[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
relocation R_X86_64_32S bug in ld version 2.28
From: |
Nicolas Gama |
Subject: |
relocation R_X86_64_32S bug in ld version 2.28 |
Date: |
Wed, 2 Aug 2017 17:58:09 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 |
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).
Thanks in advance,
Nicolas
bug.tar.gz
Description: application/gzip
- relocation R_X86_64_32S bug in ld version 2.28,
Nicolas Gama <=