_dl_app_init_array and _dl_app_fini_array problems
Kevin Day
thekevinday at gmail.com
Tue Oct 3 03:48:53 UTC 2006
On 10/2/06, Erik Andersen <andersen at codepoet.org> wrote:
> On Mon Oct 02, 2006 at 04:11:09PM -0500, Kevin Day wrote:
> > > > btw, the word "file", I left out the word ELF. ( I had meant to say
> > > > that it was not an ELF file)
> > >
> > > so ? it's a linker script which is perfectly valid when it comes to linking
> > Well, the linker is ignoring this script and grabbing the host
> > libc.so. Which is my problem with it.
>
> Unhuh. And how exactly did you come up with the toolchain
> you are using that is so badly misbehaving itself?
see: http://www.topside.org/~ashes/hlfs/hlfs-book-SVN-20060717/uclibc/
Roughly follows that, minus the changes in versioning. (I am using
gcc-4.1.1 an binutils-2.17)
>
> > 1) build the basic toolchain files, all with --prefix=/tools
> > - Thse are the environment variables:
> [-------snip-----------]
> > This works in 0.9.28.
> > But not in svn for me.
> > When I install uClibc, and then remove the "libc.so script" and
> > replace with a symlink, it then works just as it did in 0.9.28.
> > (/tools/libc.so -> /tools/libc.so.0)
> >
> > But I this still leaves me with the _dl_app_init_array and
> > _dl_app_fini_array problems that are not getting linked at any point
> > to the libc.so, thus all apps linking to the libc.so will break when
> > trying to link due to unitiliazed data: _dl_app_init_array and
> > _dl_app_fini_array problems.
>
> I strongly suspect you are in fact either mixing binaries
> compiled with uClibc 0.9.28 with svn trunk, or using the older
> uClibc 0.9.28 ldso (or glibc's ldso) with binaries compiled with
> svn trunk.... Try using 'readelf -d' to check.
>
readelf -d /tools/lib/libc.so
Dynamic section at offset 0xb2e0c contains 19 entries:
Tag Type Name/Value
0x00000001 (NEEDED) Shared library: [ld-uClibc.so.0]
0x0000000e (SONAME) Library soname: [libc.so.0]
0x0000000c (INIT) 0x6df91
0x00000004 (HASH) 0x114
0x00000005 (STRTAB) 0x718c
0x00000006 (SYMTAB) 0x247c
0x0000000a (STRSZ) 11884 (bytes)
0x0000000b (SYMENT) 16 (bytes)
0x00000003 (PLTGOT) 0xb3ec4
0x00000002 (PLTRELSZ) 224 (bytes)
0x00000014 (PLTREL) REL
0x00000017 (JMPREL) 0xa740
0x00000011 (REL) 0x9ff8
0x00000012 (RELSZ) 1864 (bytes)
0x00000013 (RELENT) 8 (bytes)
0x00000018 (BIND_NOW)
0x6ffffffb (FLAGS_1) Flags: NOW
0x6ffffffa (RELCOUNT) 192
0x00000000 (NULL) 0x0
and just for good measure, readelf -l /tools/lib/libc.so is:
Elf file type is DYN (Shared object file)
Entry point 0xa9f0
There are 7 program headers, starting at offset 52
Program Headers:
Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
PHDR 0x000034 0x00000034 0x00000034 0x000e0 0x000e0 R E 0x4
INTERP 0x0b2240 0x000b2240 0x000b2240 0x00025 0x00025 R 0x20
[Requesting program interpreter: /tools/lib/ld-uClibc.so.0]
LOAD 0x000000 0x00000000 0x00000000 0xb22c0 0xb22c0 R E 0x1000
LOAD 0x0b2c60 0x000b3c60 0x000b3c60 0x00840 0x08194 RW 0x1000
DYNAMIC 0x0b2e0c 0x000b3e0c 0x000b3e0c 0x000b8 0x000b8 RW 0x4
GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x00000 RW 0x4
GNU_RELRO 0x0b2c60 0x000b3c60 0x000b3c60 0x003a0 0x003a0 R 0x1
Section to Segment mapping:
Segment Sections...
00
01 .interp
02 .hash .dynsym .dynstr .rel.dyn .rel.plt .plt .text .rodata
.interp .eh_frame
03 .data.rel.ro .dynamic .got .data .bss
04 .dynamic
05
06 .data.rel.ro .dynamic .got
--
Kevin Day
More information about the uClibc
mailing list