load address with init/fini arrays

Mike Frysinger vapier at gentoo.org
Wed Jul 5 22:46:09 UTC 2006


ive been looking to merge some fixes for FDPIC ELFs when i noticed that 
_dl_fini() uses the load address when calculating the func address while the 
init/fini arrays do not:

void _dl_run_fini_array() {
ElfW(Addr) *array = (ElfW(Addr) *) tpnt->loadaddr + 
tpnt->dynamic_info[DT_FINI_ARRAY]);
dl_elf_func = (void (*)(void)) array[i];
(*dl_elf_func) ();
}

void _dl_fini() {
dl_elf_func = (void (*)(void)) (tpnt->loadaddr + tpnt->dynamic_info[DT_FINI]);
(*dl_elf_func) ();
}

glibc is the same way ... i flipped through sun's linker and libraries guide, 
caldera's elf docs, lsb's measly docs, and the TIS doc (v1.2), but couldnt 
seem to find a definite answer
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 827 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/uclibc/attachments/20060705/e347d173/attachment-0002.pgp 


More information about the uClibc mailing list