aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>1999-07-20 00:41:56 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>1999-07-20 00:41:56 +0000
commit2d6b61cb6ea59cc5fb83db43abbc53d737f13901 (patch)
tree379ddca64f87df426d5a2c6f83a8c27f446e5606 /gcc
parent66191c20ee094395d51eaa90465bfb4b4d23eb8c (diff)
downloadgcc-2d6b61cb6ea59cc5fb83db43abbc53d737f13901.zip
gcc-2d6b61cb6ea59cc5fb83db43abbc53d737f13901.tar.gz
gcc-2d6b61cb6ea59cc5fb83db43abbc53d737f13901.tar.bz2
iris6gld.h (MAKE_DECL_ONE_ONLY): Define.
* config/mips/iris6gld.h (MAKE_DECL_ONE_ONLY): Define. (UNIQUE_SECTION_P): Likewise. (UNIQUE_SECTION): Likewise. From-SVN: r28182
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config/mips/iris6gld.h35
2 files changed, 41 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 6c8acf9..9b7d8a6 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+Mon Jul 19 14:22:18 1999 Mark P. Mitchell <mark@codesourcery.com>
+
+ * config/mips/iris6gld.h (MAKE_DECL_ONE_ONLY): Define.
+ (UNIQUE_SECTION_P): Likewise.
+ (UNIQUE_SECTION): Likewise.
+
1999-07-19 Linas Vepstas <linas@linas.org>
* config/i370/README: New file.
diff --git a/gcc/config/mips/iris6gld.h b/gcc/config/mips/iris6gld.h
index 59a7347..88a5f68 100644
--- a/gcc/config/mips/iris6gld.h
+++ b/gcc/config/mips/iris6gld.h
@@ -46,3 +46,38 @@ Boston, MA 02111-1307, USA. */
%{!shared: %{!non_shared: %{!call_shared: -call_shared}}}} \
%{rpath} -init __do_global_ctors -fini __do_global_dtors \
%{mabi=32: -melf32bsmip}%{mabi=n32: -melfbmipn32}%{mabi=64: -melf64bmip}%{!mabi*: -melf32bmipn32}"
+
+/* The GNU linker supports one-only sections. */
+#define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)
+#undef UNIQUE_SECTION_P
+#define UNIQUE_SECTION_P(DECL) (DECL_ONE_ONLY (DECL))
+#define UNIQUE_SECTION(DECL,RELOC) \
+do { \
+ int len; \
+ char *name, *string, *prefix; \
+ \
+ name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (DECL)); \
+ \
+ if (! DECL_ONE_ONLY (DECL)) \
+ { \
+ prefix = "."; \
+ if (TREE_CODE (DECL) == FUNCTION_DECL) \
+ prefix = ".text."; \
+ else if (DECL_READONLY_SECTION (DECL, RELOC)) \
+ prefix = ".rodata."; \
+ else \
+ prefix = ".data."; \
+ } \
+ else if (TREE_CODE (DECL) == FUNCTION_DECL) \
+ prefix = ".gnu.linkonce.t."; \
+ else if (DECL_READONLY_SECTION (DECL, RELOC)) \
+ prefix = ".gnu.linkonce.r."; \
+ else \
+ prefix = ".gnu.linkonce.d."; \
+ \
+ len = strlen (name) + strlen (prefix); \
+ string = alloca (len + 1); \
+ sprintf (string, "%s%s", prefix, name); \
+ \
+ DECL_SECTION_NAME (DECL) = build_string (len, string); \
+} while (0)