[parisc-linux] glibc dladdr test failure

John David Anglin dave at hiauly1.hia.nrc.ca
Sun Mar 11 13:53:45 MDT 2007


> The dladdr test of the glibc testsuite fail for the following reason :
> 
> in elf/dl-addr.c:30, the address passed is transformed this way :
>   const ElfW(Addr) addr = DL_LOOKUP_ADDRESS (address);
> 
> 
> While in ports/sysdeps/hppa/dl-lookupcfg.h:35, you have this :
> 
> /* Clear the bottom two bits so generic code can find the fdesc entry */
> #define DL_LOOKUP_ADDRESS(addr) \
>   (_dl_lookup_address ((void *)((unsigned long)addr & ~3)))
> 
> 
> If you don't apply this bitmask, addr is set to the original value of
> the passed address and it is resolved correctly.
> 
> What should be the correct fix ?

I don't believe you have provided enough info regrading the cause
of the failure.  The PA port uses the bottom two bits for special
purposes.  Magic is used to compare function pointers.

Be very careful with this.  Changing the treatment of the bottom
two bits in function pointers will break calls to/from functions
in any shared library (i.e., any call that uses a fdesc).

Dave
-- 
J. David Anglin                                  dave.anglin at nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)



More information about the parisc-linux mailing list