https://sourceware.org/bugzilla/show_bug.cgi?id=21896
Bug ID: 21896 Summary: relocation R_X86_64_32S bug in ld version 2.28 Product: binutils Version: 2.28 Status: UNCONFIRMED Severity: normal Priority: P2 Component: ld Assignee: unassigned at sourceware dot org Reporter: nicolas.gama at gmail dot com Target Milestone: --- Created attachment 10312 --> https://sourceware.org/bugzilla/attachment.cgi?id=10312&action=edit minimal code to reproduce the bug A regression appeared with ld version 2.28: When trying to link the following assembly program (with any version of gcc, x86_64 platform) ---------------- a.s ----------------------- .globl toto toto: movq tata,%rax #trying to reference a constant ret tata: .quad 42 -------------------------------------------- The linker ld fails with the following error, even when linking a regular a.out binary (not a shared object): /usr/bin/ld: a.o: relocation R_X86_64_32S against `.text' can not be used when making a shared object; recompile with -fPIC Normally, this error should only occur when trying to create a shared object, but since 2.28, the error appears even for regular binaries, which is wrong. version 2.26 of ld managed to compile the program correctly (for instance on Ubuntu Xenial). Enclosed is a minimal program to reproduce the bug. (toto() function should return 42, and main should print it). -- 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