public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Use comdat instead of .gnu.linkonce for i386 setup pic register
@ 2017-01-09 19:48 Adhemerval Zanella
  2017-01-09 20:26 ` Zack Weinberg
  0 siblings, 1 reply; 6+ messages in thread
From: Adhemerval Zanella @ 2017-01-09 19:48 UTC (permalink / raw)
  To: libc-alpha

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(-)

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"							\
-- 
2.7.4

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Use comdat instead of .gnu.linkonce for i386 setup pic register
  2017-01-09 19:48 [PATCH] Use comdat instead of .gnu.linkonce for i386 setup pic register Adhemerval Zanella
@ 2017-01-09 20:26 ` Zack Weinberg
  2017-01-10 14:02   ` Adhemerval Zanella
  0 siblings, 1 reply; 6+ messages in thread
From: Zack Weinberg @ 2017-01-09 20:26 UTC (permalink / raw)
  To: Adhemerval Zanella; +Cc: GNU C Library

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Use comdat instead of .gnu.linkonce for i386 setup pic register
  2017-01-09 20:26 ` Zack Weinberg
@ 2017-01-10 14:02   ` Adhemerval Zanella
  2017-01-17 10:24     ` Adhemerval Zanella
  0 siblings, 1 reply; 6+ messages in thread
From: Adhemerval Zanella @ 2017-01-10 14:02 UTC (permalink / raw)
  To: Zack Weinberg; +Cc: GNU C Library



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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Use comdat instead of .gnu.linkonce for i386 setup pic register
  2017-01-10 14:02   ` Adhemerval Zanella
@ 2017-01-17 10:24     ` Adhemerval Zanella
  2017-01-24 20:14       ` Adhemerval Zanella
  0 siblings, 1 reply; 6+ messages in thread
From: Adhemerval Zanella @ 2017-01-17 10:24 UTC (permalink / raw)
  To: Zack Weinberg; +Cc: GNU C Library



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.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Use comdat instead of .gnu.linkonce for i386 setup pic register
  2017-01-17 10:24     ` Adhemerval Zanella
@ 2017-01-24 20:14       ` Adhemerval Zanella
  2017-02-16 18:03         ` Adhemerval Zanella
  0 siblings, 1 reply; 6+ messages in thread
From: Adhemerval Zanella @ 2017-01-24 20:14 UTC (permalink / raw)
  To: Zack Weinberg; +Cc: GNU C Library



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.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Use comdat instead of .gnu.linkonce for i386 setup pic register
  2017-01-24 20:14       ` Adhemerval Zanella
@ 2017-02-16 18:03         ` Adhemerval Zanella
  0 siblings, 0 replies; 6+ messages in thread
From: Adhemerval Zanella @ 2017-02-16 18:03 UTC (permalink / raw)
  To: Zack Weinberg; +Cc: GNU C Library

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.
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-02-16 18:03 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-09 19:48 [PATCH] Use comdat instead of .gnu.linkonce for i386 setup pic register Adhemerval Zanella
2017-01-09 20:26 ` Zack Weinberg
2017-01-10 14:02   ` Adhemerval Zanella
2017-01-17 10:24     ` Adhemerval Zanella
2017-01-24 20:14       ` Adhemerval Zanella
2017-02-16 18:03         ` Adhemerval Zanella

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).