summaryrefslogtreecommitdiff
path: root/libgcc/config/i386
diff options
context:
space:
mode:
authorhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>2015-04-17 12:58:07 +0000
committerhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>2015-04-17 12:58:07 +0000
commit4b5fb32aba30762e0d8c9e75d1b46b47bee5eeb4 (patch)
tree65719a14085bffae4c5e478b099f6bf4f54ba60d /libgcc/config/i386
parentf8544110b0437273fe6b667d8f793afd69de7aeb (diff)
downloadgcc-4b5fb32aba30762e0d8c9e75d1b46b47bee5eeb4.tar.gz
Hide __cpu_indicator_init/__cpu_model from linker
We shouldn't call external function, __cpu_indicator_init, while an object is being relocated since its .got.plt section hasn't been updated. It works for non-PIE since no update on .got.plt section is required. This patch creates libgcc.so as a linker script, hides __cpu_indicator_init and __cpu_model in libgcc.so.1 from linker, forces linker to resolve __cpu_indicator_init and __cpu_model to their hidden definitions in libgcc.a while providing backward binary compatibility. gcc/testsuite/ PR target/65612 * g++.dg/ext/mv18.C: New test. * g++.dg/ext/mv19.C: Likewise. * g++.dg/ext/mv20.C: Likewise. * g++.dg/ext/mv21.C: Likewise. * g++.dg/ext/mv22.C: Likewise. * g++.dg/ext/mv23.C: Likewise. libgcc/ PR target/65612 * config.host (tmake_file): Add t-slibgcc-libgcc for Linux/x86. * config/i386/cpuinfo.c (__cpu_model): Initialize. (__cpu_indicator_init@GCC_4.8.0): New. (__cpu_model@GCC_4.8.0): Likewise. * config/i386/t-linux (HOST_LIBGCC2_CFLAGS): Add -DUSE_ELF_SYMVER. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@222178 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgcc/config/i386')
-rw-r--r--libgcc/config/i386/cpuinfo.c7
-rw-r--r--libgcc/config/i386/t-linux2
2 files changed, 7 insertions, 2 deletions
diff --git a/libgcc/config/i386/cpuinfo.c b/libgcc/config/i386/cpuinfo.c
index eaf2f100d59..f6f91ddce6a 100644
--- a/libgcc/config/i386/cpuinfo.c
+++ b/libgcc/config/i386/cpuinfo.c
@@ -109,7 +109,7 @@ struct __processor_model
unsigned int __cpu_type;
unsigned int __cpu_subtype;
unsigned int __cpu_features[1];
-} __cpu_model;
+} __cpu_model = { };
/* Get the specific type of AMD CPU. */
@@ -424,3 +424,8 @@ __cpu_indicator_init (void)
return 0;
}
+
+#if defined SHARED && defined USE_ELF_SYMVER
+__asm__ (".symver __cpu_indicator_init, __cpu_indicator_init@GCC_4.8.0");
+__asm__ (".symver __cpu_model, __cpu_model@GCC_4.8.0");
+#endif
diff --git a/libgcc/config/i386/t-linux b/libgcc/config/i386/t-linux
index 4f47f7bfa59..11bb46e0ee4 100644
--- a/libgcc/config/i386/t-linux
+++ b/libgcc/config/i386/t-linux
@@ -3,4 +3,4 @@
# t-slibgcc-elf-ver and t-linux
SHLIB_MAPFILES = libgcc-std.ver $(srcdir)/config/i386/libgcc-glibc.ver
-HOST_LIBGCC2_CFLAGS += -mlong-double-80
+HOST_LIBGCC2_CFLAGS += -mlong-double-80 -DUSE_ELF_SYMVER