Re: Re: call_init in libc6 2.3.6.ds1-11
"Carlos O'Donell" <[email protected]>
| Newsgroups | gmane.linux.ports.hppa |
|---|---|
| Message-ID | <[email protected]> |
On 2/17/07, John David Anglin <[email protected]> wrote: > > /* The test for "addr & 2" below is to accomodate old binaries which > > violated the ELF ABI by pointing DT_INIT and DT_FINI at a function > > descriptor. */ > > #define DL_DT_INIT_ADDRESS(map, addr) \ > > ((Elf32_Addr)(addr) & 2 ? (addr) : DL_AUTO_FUNCTION_ADDRESS (map, addr)) > > This is the ia64 define: > > #define DL_DT_INIT_ADDRESS(map, addr) DL_AUTO_FUNCTION_ADDRESS (map, addr) > > Calls to init on ia64 always use a function descriptor. > > While it's possible that DT_INIT and DT_FINI shouldn't point at function > descriptors, the above hack can't be right since DL_DT_INIT_ADDRESS is used > for calling init() from dl-init.c: > > init_t init = (init_t) DL_DT_INIT_ADDRESS > (l, l->l_addr + l->l_info[DT_INIT]->d_un.d_ptr); > > /* Call the function. */ > init (argc, argv, env); We might have been lucky in that init () called another function which setup r19 for us before we accessed data. I agree completely that r19 should be set to the r19 of the module before calling init(), even if it *is* or *isn't* a function descriptor. I wrote dl-lookupcfg.h, and the code you see there is legacy. I carried it forward without understanding what it meant. c.