NDK Toolchain and "Unknown symbol _GLOBAL_OFFSET_TABLE_" in kernel module

5,189 views
Skip to first unread message

Alessio Bianchi

unread,
Jan 25, 2011, 9:50:32 PM1/25/11
to android...@googlegroups.com
Hi, I used the NDK toolchain (arm-linux-androideabi-*) to build a custom kernel for the Nexus One. The kernel compiled and works perfectly on the device, but when I try to insert the bcm4329 kernel module for the wireless interface, I get the following error in dmesg:

bcm4329: Unknown symbol _GLOBAL_OFFSET_TABLE_

After googling a bit, I found a similar issue [1] (regarding fuse) where an user commented:
> This indicates the module was built -fPIC (or more likely -fPIE), which it
> shouldn't have been.

Is this the case too?
I'm running stock Android 2.2.2 with (patched) kernel 2.6.32.9 and NDK r5.
Any hints?

Thanks
Alessio

[1] http://bugs.gentoo.org/167844

Alessio Bianchi

unread,
Jan 26, 2011, 2:48:13 PM1/26/11
to android...@googlegroups.com
On 26/gen/2011, at 12.39, Steven Coutts wrote:

> On Tuesday 25 Jan 2011 21:50:32 Alessio Bianchi wrote:
>> Hi, I used the NDK toolchain (arm-linux-androideabi-*) to build a custom
>> kernel for the Nexus One. The kernel compiled and works perfectly on the
>> device, but when I try to insert the bcm4329 kernel module for the
>> wireless interface, I get the following error in dmesg:
>>
>> bcm4329: Unknown symbol _GLOBAL_OFFSET_TABLE_
>>
>

> I get the same thing, 'arm-eabi-4.4.0/bin/arm-eabi-' seems to work fine though.

Confirmed. Additionally, I'm getting this issue with external modules too.


Steven Coutts

unread,
Jan 26, 2011, 11:39:52 AM1/26/11
to android...@googlegroups.com, Alessio Bianchi
On Tuesday 25 Jan 2011 21:50:32 Alessio Bianchi wrote:
> Hi, I used the NDK toolchain (arm-linux-androideabi-*) to build a custom
> kernel for the Nexus One. The kernel compiled and works perfectly on the
> device, but when I try to insert the bcm4329 kernel module for the
> wireless interface, I get the following error in dmesg:
>
> bcm4329: Unknown symbol _GLOBAL_OFFSET_TABLE_
>

I get the same thing, 'arm-eabi-4.4.0/bin/arm-eabi-' seems to work fine though.

Regards

--
Steven Coutts
ste...@couttsnet.com

Sven Killig

unread,
Jul 14, 2011, 9:16:39 PM7/14/11
to android...@googlegroups.com

I also have this problem with
CROSS_COMPILE=/android-ndk-r6/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-
And 4.4.0 was removed because it was deprecated.
Has anyone found a solution?

Bruce Beare

unread,
Jul 15, 2011, 1:22:12 AM7/15/11
to Android Linux Kernel Development
Try adding -fno-pic to the gcc flags for the kernel build.

Liang William

unread,
Jul 18, 2011, 12:29:01 PM7/18/11
to Android Linux Kernel Development
Update tested result.

I've successfully tested for the following environment,

- Kernel Source: android-goldfish-2.6.29
- NDK: r6
- GCC: arm-linux-androideabi-4.4.3

with the the compilation method stated below.

- kernel: compiled as usual (It seems adding -fno-pic for kernel build
will cause the booting to be stopped.)
- module: add "EXTRA_CFLAGS=-fno-pic" during external module build.

Conclusion: only need to add -fno-pic for external module build.
Reply all
Reply to author
Forward
0 new messages