Skip to contentSkip to conversation

glibc dladdr test failure

parisc-linux John David Anglin 1 participant 1 message Mar 11, 2007 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 20070311201750.0f280e87@localhost

#1 lore raw
Quoted 13 lines

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)))

Quoted 4 lines

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

Signature · 6 lines
J. David Anglin                                  [email protected]
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)
_______________________________________________
parisc-linux mailing list
[email protected]
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux