diff options
author | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-07-20 00:41:56 +0000 |
---|---|---|
committer | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-07-20 00:41:56 +0000 |
commit | 270939e795f05fa8f1cec21ee4aadad88575110c (patch) | |
tree | 379ddca64f87df426d5a2c6f83a8c27f446e5606 /gcc/config/mips/iris6gld.h | |
parent | 22971cf19d21d6e64c55e537190b5f2a946a3147 (diff) | |
download | gcc-270939e795f05fa8f1cec21ee4aadad88575110c.tar.gz |
* config/mips/iris6gld.h (MAKE_DECL_ONE_ONLY): Define.
(UNIQUE_SECTION_P): Likewise.
(UNIQUE_SECTION): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@28182 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/mips/iris6gld.h')
-rw-r--r-- | gcc/config/mips/iris6gld.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/gcc/config/mips/iris6gld.h b/gcc/config/mips/iris6gld.h index 59a7347838e..88a5f68e206 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) |