This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[SPARC] Segfault when resolving STT_GNU_IFUNC functions


Hi,

I am experiencing an issue with glibc 2.13 on sparc32 and sparc64 when
multiarch is enabled. In some cases, probably depending on order the
relocations are done, the resolution of STT_GNU_IFUNC functions
(typically memset or memcpy) does a segmentation fault, with a
backtrace looking like that:

| #0  memset () at ../sysdeps/sparc/sparc64/multiarch/memset.S:42
| #1  0xf7fb26c8 in elf_machine_rela (scope=0x21, reloc_mode=<value optimized out>, consider_profiling=Cannot access memory at address 0x50
| ) at ../sysdeps/sparc/sparc32/dl-machine.h:402
| #2  elf_dynamic_do_rela (scope=0x21, reloc_mode=<value optimized out>, consider_profiling=Cannot access memory at address 0x50
| ) at do-rel.h:120
| #3  _dl_relocate_object (scope=0x21, reloc_mode=<value optimized out>, consider_profiling=Cannot access memory at address 0x50
| ) at dl-reloc.c:268
| #4  0x00000458 in ?? ()

It seems at this point the GOT is only filled with zeros, hence the
segmentation fault. 

One way to almost always trigger the issue (for example with /bin/ls) 
is to set LD_BIND_NOW=1, otherwise it happens with more complex binaries
like cmake. I am able to reproduce the issue on both sparc32 and
sparc64, although with LD_BIND_NOW=1, the set of binaries that works or
not is not the same.

Help to solve this issue would be appreciated.

Thanks,
Aurelien

-- 
Aurelien Jarno	                        GPG: 1024D/F1BCDB73
aurelien@aurel32.net                 http://www.aurel32.net


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]