[PATCH] Use comdat instead of .gnu.linkonce for i386 setup pic register

Adhemerval Zanella adhemerval.zanella@linaro.org
Mon Jan 9 19:48:00 GMT 2017


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



More information about the Libc-alpha mailing list