Message ID | 1483991301-14420-1-git-send-email-adhemerval.zanella@linaro.org |
---|---|
State | Dropped |
Headers |
Received: (qmail 4939 invoked by alias); 9 Jan 2017 19:48:41 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: <libc-alpha.sourceware.org> List-Unsubscribe: <mailto:libc-alpha-unsubscribe-##L=##H@sourceware.org> List-Subscribe: <mailto:libc-alpha-subscribe@sourceware.org> List-Archive: <http://sourceware.org/ml/libc-alpha/> List-Post: <mailto:libc-alpha@sourceware.org> List-Help: <mailto:libc-alpha-help@sourceware.org>, <http://sourceware.org/ml/#faqs> Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 4926 invoked by uid 89); 9 Jan 2017 19:48:41 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=no version=3.3.2 spammy=axg, Hx-languages-length:1408 X-HELO: mail-vk0-f53.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=6C0ZOt6+GPkUA5UJCu5w5Amr33gKacomtXvx5W3tBag=; b=ON0OF/3q3XJF95iSzSenrSaOBbLjgTSVY0zcpEiRDSaYH5nPYDZKEhvllKHWdDk3ub W4oIzSF2sbFOdNGDRW7nu/Akcp29i4rZFV8MEXzW8sQow/+fb1N17t7UPGgIVVxmpIx5 A0iStdhSPCEj1eYYEzXUT+S21I0sosmWBx6yhx2mbGmam2y4i/y8CgNr4kfQ3MpEGVUs +Gj2Q/ItqvXkgUwRV49LshdqsZbyIgwDIGc8raRnr8Gkug6cMHPcNsmYHinZ1vfXH6x0 ctaRaNn3nBFibOIvZq45BIB/MxtT6zj+09ltM0mzmKK0q7QeqW35HSLADg65udSI8p3M PhZA== X-Gm-Message-State: AIkVDXIlE1iLGPb5L2dZJmSyjqkQA40LvZKGTR1LlExbx9TRAi6YXKI+cWNov+TKsNOdYYYF X-Received: by 10.31.216.134 with SMTP id p128mr33120669vkg.147.1483991308769; Mon, 09 Jan 2017 11:48:28 -0800 (PST) From: Adhemerval Zanella <adhemerval.zanella@linaro.org> To: libc-alpha@sourceware.org Subject: [PATCH] Use comdat instead of .gnu.linkonce for i386 setup pic register Date: Mon, 9 Jan 2017 17:48:21 -0200 Message-Id: <1483991301-14420-1-git-send-email-adhemerval.zanella@linaro.org> |
Commit Message
Adhemerval Zanella Netto
Jan. 9, 2017, 7:48 p.m. UTC
GCC has moved from using .gnu.linkonce for i386 setup pic register with minimum current version (as for binutils minimum binutils that support comdat). This patch replace linkonce usage by comdat. Checked on i686-linux-gnu. [BZ #20543] * sysdeps/i386/sysdep.h (SETUP_PIC_REG): Use comdat instead of gnu.linkonce section. (SETUP_PIC_REG_STR): Likewise. --- ChangeLog | 7 +++++++ sysdeps/i386/sysdep.h | 5 +++-- 2 files changed, 10 insertions(+), 2 deletions(-)
Comments
On Mon, Jan 9, 2017 at 2:48 PM, Adhemerval Zanella <adhemerval.zanella@linaro.org> wrote: > GCC has moved from using .gnu.linkonce for i386 setup pic register with > minimum current version (as for binutils minimum binutils that support > comdat). This patch replace linkonce usage by comdat. Is this change compatible with older GCC/binutils versions as well as the new ones? zw
On 09/01/2017 18:26, Zack Weinberg wrote: > On Mon, Jan 9, 2017 at 2:48 PM, Adhemerval Zanella > <adhemerval.zanella@linaro.org> wrote: >> GCC has moved from using .gnu.linkonce for i386 setup pic register with >> minimum current version (as for binutils minimum binutils that support >> comdat). This patch replace linkonce usage by comdat. > > Is this change compatible with older GCC/binutils versions as well as > the new ones? > > zw > I am trying to pinpoint when binutils added comdat support for i686 and this [1] is the oldest thread I found. I also checked with some ancient binutils version and version 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 the can not handle either comdat at all or the mix of linkonce and comdat. For binutils 2.16.1 and forward 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.22). [1] https://gcc.gnu.org/ml/gcc/2004-05/msg00030.html
On 10/01/2017 12:02, Adhemerval Zanella wrote: > > > On 09/01/2017 18:26, Zack Weinberg wrote: >> On Mon, Jan 9, 2017 at 2:48 PM, Adhemerval Zanella >> <adhemerval.zanella@linaro.org> wrote: >>> GCC has moved from using .gnu.linkonce for i386 setup pic register with >>> minimum current version (as for binutils minimum binutils that support >>> comdat). This patch replace linkonce usage by comdat. >> >> Is this change compatible with older GCC/binutils versions as well as >> the new ones? >> >> zw >> > > I am trying to pinpoint when binutils added comdat support for i686 and > this [1] is the oldest thread I found. > > I also checked with some ancient binutils version and version 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 the can not handle either comdat at all or the mix of > linkonce and comdat. For binutils 2.16.1 and forward 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.22). > > [1] https://gcc.gnu.org/ml/gcc/2004-05/msg00030.html > Ping.
On 17/01/2017 08:24, Adhemerval Zanella wrote: > > > On 10/01/2017 12:02, Adhemerval Zanella wrote: >> >> >> On 09/01/2017 18:26, Zack Weinberg wrote: >>> On Mon, Jan 9, 2017 at 2:48 PM, Adhemerval Zanella >>> <adhemerval.zanella@linaro.org> wrote: >>>> GCC has moved from using .gnu.linkonce for i386 setup pic register with >>>> minimum current version (as for binutils minimum binutils that support >>>> comdat). This patch replace linkonce usage by comdat. >>> >>> Is this change compatible with older GCC/binutils versions as well as >>> the new ones? >>> >>> zw >>> >> >> I am trying to pinpoint when binutils added comdat support for i686 and >> this [1] is the oldest thread I found. >> >> I also checked with some ancient binutils version and version 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 the can not handle either comdat at all or the mix of >> linkonce and comdat. For binutils 2.16.1 and forward 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.22). >> >> [1] https://gcc.gnu.org/ml/gcc/2004-05/msg00030.html >> > > Ping. > Ping.
Ping. On 24/01/2017 18:14, Adhemerval Zanella wrote: > > > On 17/01/2017 08:24, Adhemerval Zanella wrote: >> >> >> On 10/01/2017 12:02, Adhemerval Zanella wrote: >>> >>> >>> On 09/01/2017 18:26, Zack Weinberg wrote: >>>> On Mon, Jan 9, 2017 at 2:48 PM, Adhemerval Zanella >>>> <adhemerval.zanella@linaro.org> wrote: >>>>> GCC has moved from using .gnu.linkonce for i386 setup pic register with >>>>> minimum current version (as for binutils minimum binutils that support >>>>> comdat). This patch replace linkonce usage by comdat. >>>> >>>> Is this change compatible with older GCC/binutils versions as well as >>>> the new ones? >>>> >>>> zw >>>> >>> >>> I am trying to pinpoint when binutils added comdat support for i686 and >>> this [1] is the oldest thread I found. >>> >>> I also checked with some ancient binutils version and version 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 the can not handle either comdat at all or the mix of >>> linkonce and comdat. For binutils 2.16.1 and forward 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.22). >>> >>> [1] https://gcc.gnu.org/ml/gcc/2004-05/msg00030.html >>> >> >> Ping. >> > > Ping. >
diff --git a/sysdeps/i386/sysdep.h b/sysdeps/i386/sysdep.h index d2b0860..35d65a4 100644 --- a/sysdeps/i386/sysdep.h +++ b/sysdeps/i386/sysdep.h @@ -97,7 +97,7 @@ lose: SYSCALL_PIC_SETUP \ # define SETUP_PIC_REG(reg) \ .ifndef GET_PC_THUNK(reg); \ - .section .gnu.linkonce.t.GET_PC_THUNK(reg),"ax",@progbits; \ + .section .text.GET_PC_THUNK(reg),"axG",@progbits,GET_PC_THUNK(reg),comdat; \ .globl GET_PC_THUNK(reg); \ .hidden GET_PC_THUNK(reg); \ .p2align 4; \ @@ -140,7 +140,8 @@ GET_PC_THUNK(reg): \ # define SETUP_PIC_REG_STR(reg) \ ".ifndef " GET_PC_THUNK_STR (reg) "\n" \ - ".section .gnu.linkonce.t." GET_PC_THUNK_STR (reg) ",\"ax\",@progbits\n" \ + ".section .text." GET_PC_THUNK_STR (reg) ",\"axG\",@progbits," \ + GET_PC_THUNK_STR (reg) ",comdat\n" \ ".globl " GET_PC_THUNK_STR (reg) "\n" \ ".hidden " GET_PC_THUNK_STR (reg) "\n" \ ".p2align 4\n" \