]> git.ipfire.org Git - thirdparty/glibc.git/commit
i386: Use comdat instead of .gnu.linkonce for i386 setup pic register (BZ #20543)
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Fri, 28 Feb 2020 13:46:14 +0000 (10:46 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Tue, 24 Mar 2020 11:46:59 +0000 (08:46 -0300)
commit1ce16683d9efa1cc611ed4632645e16742699d10
treef0eef1a4c4b24659c3b3817d198a1f3c67d0bf72
parent6b11f60c700c9b50aba1a7f123411add5ade733c
i386: Use comdat instead of .gnu.linkonce for i386 setup pic register (BZ #20543)

GCC has moved from using .gnu.linkonce for i386 setup pic register with
minimum current version (as for binutils minimum binutils that support
comdat).

Trying to pinpoint when binutils has added comdat support for i686, it
seems it was around 2004 [1].  I also checking with some ancient
binutils older than 2.16 I see:

test.o: In function `__x86.get_pc_thunk.bx':
test.o(.text.__x86.get_pc_thunk.bx+0x0): multiple definition of `__x86.get_pc_thunk.bx'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../i386-linux-gnu/crti.o(.gnu.linkonce.t.__x86.get_pc_thunk.bx+0x0): first defined here

Which seems that such version can not handle either comdat at all or
a mix of linkonce and comdat.  For binutils 2.16.1 I am getting a
different issue trying to link a binary with and more recent
ctri.o (unrecognized relocation (0x2b) in section `.init', which is
R_386_GOT32X and old binutils won't generate it anyway).

So I think that either unlikely someone will use an older binutils than
the one used to glibc and even this scenario may fail with some issue
as the R_386_GOT32X.  Also, 2.16.1 is quite old and not really supported
(glibc itself required 2.25).

Checked on i686-linux-gnu.

[1] https://gcc.gnu.org/ml/gcc/2004-05/msg00030.html

(cherry picked from commit 35200fd3892f6caf867bf89bc8048e553906af28)
NEWS
sysdeps/i386/sysdep.h