[PATCH]mips: ldso: dlopen with flag RTLD_NOW should look up the symbols
Jean Lee
xiaoyur347 at gmail.com
Wed Feb 25 04:53:58 UTC 2015
2015-02-25 1:36 GMT+08:00 Florian Fainelli <f.fainelli at gmail.com>:
> 2015-02-23 17:06 GMT-08:00 Jean Lee <xiaoyur347 at gmail.com>:
> > I tested the following environment with MIPS32, with CPU BCM7429(MIPS
> > r3000),
>
> This is a BMIPS5000 CPU, fully compatible with the mips32r1 ISA, not a
> R3000-class MIPS processor per-se.
>
Thank you for pointing it out. This is my mistake.
> (1)
> > mipsel-linux-uclibc-gcc 4.5.3-2.4 (compiled by Broadcom)
> > binutils 2.19(GNU ld (GNU Binutils) 2.19.92.20091006)
> > uclibc 0.9.32-1
> > Segment fault.
> > (2)
> > mipsel-linux-uclibc-gcc 4.5.3-2.4 (compiled by Broadcom)
> > binutils 2.19(GNU ld (GNU Binutils) 2.19.92.20091006)
> > uclibc 0.9.34 git master
> > Segment fault.
>
> As another data point, you might want to try a newer toolchain from
> Broadcom here:
> http://www.broadcom.com/support/stb/
Thanks. I download the toolchain stbgcc-4.8-1.0 for further testing.
For android, I update the test here.
https://github.com/xiaoyur347/issue/tree/master/mips-dlopen
(1)mipsel-linux-gnu 4.8.4(compiled by Broadcom)
mipsel-linux-gnu-gcc 4.8.4
binutils 2.24 (GNU ld (GNU Binutils) 2.24.0.20140801 Linaro 2014.08)
libc 2.18-2013.10
It's not uclibc.
I run the build.sh and mipsel-linux-readelf -aW libtest_mips.so, and no
.rel.plt too.
[ 8] .rel.dyn REL 000004c4 0004c4 000010 08 A 4
0 4
[ 9] .init PROGBITS 000004dc 0004dc 00008c 00 AX 0
0 4
Relocation section '.rel.dyn' at offset 0x4c4 contains 2 entries:
Offset Info Type Sym. Value Symbol's Name
00000000 00000000 R_MIPS_NONE
000108f0 00000003 R_MIPS_REL32
(2)android-ndk-r10d mipsel-linux-android-4.8
mipsel-linux-android-gcc 4.8
binutils 2.24 (GNU ld (GNU Binutils) 2.24)
bionic
I run the build.sh and mipsel-linux-readelf -aW libtest_mips.so, and no
.rel.plt too.
[ 6] .rel.dyn REL 00000394 000394 000018 08 A 4
0 4
[ 7] .text PROGBITS 000003c0 0003c0 000080 00 AX 0
0 16
Relocation section '.rel.dyn' at offset 0x394 contains 3 entries:
Offset Info Type Sym. Value Symbol's Name
00000000 00000000 R_MIPS_NONE
00010ee0 00000003 R_MIPS_REL32
00011000 00000003 R_MIPS_REL32
(3)android-ndk-r10d mipsel-linux-android-4.9
modify the
https://github.com/xiaoyur347/issue/tree/master/mips-dlopen/and/lib/jni/Application.mk
with
NDK_TOOLCHAIN_VERSION = 4.9
mipsel-linux-android-gcc 4.9 20140827 (prerelease)
binutils 2.24 (GNU ld (GNU Binutils) 2.24)
bionic
I run the build.sh and mipsel-linux-readelf -aW libtest_mips.so, and no
.rel.plt too.
[ 6] .rel.dyn REL 00000394 000394 000018 08 A 4
0 4
[ 7] .text PROGBITS 000003c0 0003c0 000080 00 AX 0
0 16
Relocation section '.rel.dyn' at offset 0x394 contains 3 entries:
Offset Info Type Sym. Value Symbol's Name
00000000 00000000 R_MIPS_NONE
00010ee0 00000003 R_MIPS_REL32
00011000 00000003 R_MIPS_REL32
Conclusion:
All MIPS platforms never generate .rel.plt section for dynamic libraries,
even for
GCC 4.9
binutils 2.24
any libc(uclibc, libc, bionic)
More information about the uClibc
mailing list