aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2020-01-27 22:00:52 +0000
committerJoseph Myers <joseph@codesourcery.com>2020-01-27 22:00:52 +0000
commit15d552394e1cb94598eef278ff3d9e9876097b33 (patch)
tree60ff225677b8d641751985f0321c31226ca62914
parent2f195832a12ff4fb54d723f32019d4175db1b5da (diff)
downloadgcc-15d552394e1cb94598eef278ff3d9e9876097b33.zip
gcc-15d552394e1cb94598eef278ff3d9e9876097b33.tar.gz
gcc-15d552394e1cb94598eef278ff3d9e9876097b33.tar.bz2
Support gnu_unique_object symbols on MIPS.
mips_declare_object_name is missing the support for declaring symbols as gnu_unique_object that is present in the generic ASM_DECLARE_OBJECT_NAME in elfos.h. I'm not aware of any MIPS-specific reason for that support to be absent; mips_declare_object_name predates the addition of gnu_unique_object support and as far as I can tell this was simply an oversight when that support was added. This patch adds the missing support, following the code in elfos.h. Tested with no regressions with cross to mips-linux-gnu. In particular, this fixes the failure of the recently-added glibc test elf/tst-dlopen-nodelete-reloc, which relies on the compiler generating such symbols, for MIPS. * config/mips/mips.c (mips_declare_object_name) [USE_GNU_UNIQUE_OBJECT]: Support use of gnu_unique_object.
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/mips/mips.c9
2 files changed, 13 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index b3624b1..af0945f 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2020-01-27 Joseph Myers <joseph@codesourcery.com>
+
+ * config/mips/mips.c (mips_declare_object_name)
+ [USE_GNU_UNIQUE_OBJECT]: Support use of gnu_unique_object.
+
2020-01-27 Martin Liska <mliska@suse.cz>
PR gcov-profile/93403
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index dae189e..513fc5f 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -9775,7 +9775,14 @@ mips_declare_object_name (FILE *stream, const char *name,
tree decl ATTRIBUTE_UNUSED)
{
#ifdef ASM_OUTPUT_TYPE_DIRECTIVE
- ASM_OUTPUT_TYPE_DIRECTIVE (stream, name, "object");
+#ifdef USE_GNU_UNIQUE_OBJECT
+ /* As in elfos.h. */
+ if (USE_GNU_UNIQUE_OBJECT && DECL_ONE_ONLY (decl)
+ && (!DECL_ARTIFICIAL (decl) || !TREE_READONLY (decl)))
+ ASM_OUTPUT_TYPE_DIRECTIVE (stream, name, "gnu_unique_object");
+ else
+#endif
+ ASM_OUTPUT_TYPE_DIRECTIVE (stream, name, "object");
#endif
size_directive_output = 0;