http://sourceware.org/bugzilla/show_bug.cgi?id=12372
Summary: Segfault with STT_GNU_IFUNC symbols on x86_64 Product: binutils Version: 2.22 (HEAD) Status: NEW Severity: normal Priority: P2 Component: gold AssignedTo: i...@airs.com ReportedBy: hjl.to...@gmail.com CC: hjl.to...@gmail.com, richard.sandif...@linaro.org Depends on: 12366 +++ This bug was initially created as a clone of Bug #12366 +++ The x86 and x86_64 IFUNC code assumes that check_relocs can rely on def_regular being set for all regular definitions. That's not true, because def_regular is set by the same pass that calls check_relocs, and doesn't therefore take into account regular definitions in later objects. Everything works if the regular definition comes before the regular use, but not the other way round. +++ [...@gnu-6 pr12366-1]$ make LD=ld.gold /export/build/gnu/gcc/build-x86_64-linux/gcc/xgcc -B/export/build/gnu/gcc/build-x86_64-linux/gcc/ -fPIC -c -o main.o main.c /export/build/gnu/gcc/build-x86_64-linux/gcc/xgcc -B/export/build/gnu/gcc/build-x86_64-linux/gcc/ -fPIC -c -o bar.o bar.c /export/build/gnu/gcc/build-x86_64-linux/gcc/xgcc -B/export/build/gnu/gcc/build-x86_64-linux/gcc/ -fPIC -c -o foo.o foo.c ld.gold -shared -o libfoo.so bar.o foo.o /export/build/gnu/gcc/build-x86_64-linux/gcc/xgcc -B/export/build/gnu/gcc/build-x86_64-linux/gcc/ -o main main.o libfoo.so -Wl,-rpath,. ./main make: *** [all] Segmentation fault [...@gnu-6 pr12366-1]$ GNU linker works: [...@gnu-6 pr12366-1]$ make clean rm -f a.out *.o *.so [...@gnu-6 pr12366-1]$ make /export/build/gnu/gcc/build-x86_64-linux/gcc/xgcc -B/export/build/gnu/gcc/build-x86_64-linux/gcc/ -fPIC -c -o main.o main.c /export/build/gnu/gcc/build-x86_64-linux/gcc/xgcc -B/export/build/gnu/gcc/build-x86_64-linux/gcc/ -fPIC -c -o bar.o bar.c /export/build/gnu/gcc/build-x86_64-linux/gcc/xgcc -B/export/build/gnu/gcc/build-x86_64-linux/gcc/ -fPIC -c -o foo.o foo.c ./ld -shared -o libfoo.so bar.o foo.o /export/build/gnu/gcc/build-x86_64-linux/gcc/xgcc -B/export/build/gnu/gcc/build-x86_64-linux/gcc/ -o main main.o libfoo.so -Wl,-rpath,. ./main Hello, world! [...@gnu-6 pr12366-1]$ -- Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug. _______________________________________________ bug-binutils mailing list bug-binutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-binutils