This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH to enable one-only handling on IRIX6 with GNU ld
- To: gcc-patches at egcs dot cygnus dot com
- Subject: PATCH to enable one-only handling on IRIX6 with GNU ld
- From: "Mark P. Mitchell" <mark at codesourcery dot com>
- Date: Mon, 19 Jul 1999 14:25:22 -0600 (MDT)
- Cc: wilson at cygnus dot com
- Reply-to: mark at codesourcery dot com
Now that we have the GNU linker, we can do one-only handling of templates
on IRIX6.
OK to check in?
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.
Index: iris6gld.h
===================================================================
RCS file: /cvs/egcs/egcs/gcc/config/mips/iris6gld.h,v
retrieving revision 1.2
diff -c -p -r1.2 iris6gld.h
*** iris6gld.h 1999/07/15 13:59:03 1.2
--- iris6gld.h 1999/07/19 20:23:43
*************** Boston, MA 02111-1307, USA. */
*** 46,48 ****
--- 46,83 ----
%{!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)