https://sourceware.org/bugzilla/show_bug.cgi?id=18695
--- Comment #11 from H.J. Lu <hjl.tools at gmail dot com> --- (In reply to Cary Coutant from comment #10) > Created attachment 8963 [details] > Patch to fix broken x32 overflow checks > > Fix incorrect x32 overflow checking for refs to weak undef symbols. > With this patch, I can build basic_static_pic_test in x32 mode. > HJ, I'd appreciate it if you could give it more testing before I > commit it. > > 2016-02-06 Cary Coutant <ccout...@gmail.com> > > gold/ > * x86_64.cc (X86_64_relocate_functions::pcrela32_check): Fix x32 > overflow checking when symbol value + addend < 0. Yes, it works. Can you improve overflow message? [hjl@gnu-tools-1 pr18695]$ make x gcc -B./ -mx32 -fno-lto -o x foo.o main.o /usr/lib/gcc/x86_64-redhat-linux/5.3.1/x32/crtbegin.o: In function `__do_global_dtors_aux': crtstuff.c:(.text+0x72): relocation truncated to fit: R_X86_64_PC32 against `.bss' crtstuff.c:(.text+0x84): relocation truncated to fit: R_X86_64_PC32 against `.bss' main.o: In function `main': /export/home/hjl/bugs/binutils/pr18695/main.c:8:(.text.startup+0x2): relocation truncated to fit: R_X86_64_PC32 against symbol `foo' defined in COMMON section in foo.o /export/home/hjl/bugs/binutils/pr18695/main.c:9:(.text.startup+0x22): relocation truncated to fit: R_X86_64_PC32 against symbol `foo' defined in COMMON section in foo.o collect2: error: ld returned 1 exit status Makefile:31: recipe for target 'x' failed make: *** [x] Error 1 [hjl@gnu-tools-1 pr18695]$ make y gcc -B./ -mx32 -fno-lto -o y foo.o main.o -fuse-ld=gold /usr/lib/gcc/x86_64-redhat-linux/5.3.1/x32/crtbegin.o(.text+0x72): error: relocation overflow /usr/lib/gcc/x86_64-redhat-linux/5.3.1/x32/crtbegin.o(.text+0x84): error: relocation overflow main.c:8: error: relocation overflow main.c:9: error: relocation overflow /usr/libx32/libc_nonshared.a(elf-init.oS):function __libc_csu_init: error: relocation overflow /usr/libx32/libc_nonshared.a(elf-init.oS):function __libc_csu_init: error: relocation overflow collect2: error: ld returned 1 exit status Makefile:34: recipe for target 'y' failed make: *** [y] Error 1 [hjl@gnu-tools-1 pr18695]$ Overflow message from gold contains not much useful messages for users. -- You are receiving this mail because: You are on the CC list for the bug. _______________________________________________ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils