summaryrefslogtreecommitdiff
path: root/gcc/config/svr4.h
diff options
context:
space:
mode:
authormerrill <merrill@138bc75d-0d04-0410-961f-82ee72b054a4>1996-09-18 11:07:42 +0000
committermerrill <merrill@138bc75d-0d04-0410-961f-82ee72b054a4>1996-09-18 11:07:42 +0000
commitf04f88f267778d68030cadd0c0be39897d3e3859 (patch)
treec1c0c371005b3462f1316b5ede3d9d4b901f69bf /gcc/config/svr4.h
parentf65e35739adb6457a4ef13261589492f8e86e344 (diff)
downloadgcc-f04f88f267778d68030cadd0c0be39897d3e3859.tar.gz
(MAKE_DECL_ONE_ONLY): Define.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@12736 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/svr4.h')
-rw-r--r--gcc/config/svr4.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/gcc/config/svr4.h b/gcc/config/svr4.h
index 4332c0fecd1..f39dd15731a 100644
--- a/gcc/config/svr4.h
+++ b/gcc/config/svr4.h
@@ -639,6 +639,37 @@ do { \
} \
} while (0)
+/* A C statement (sans semicolon) to mark DECL to be emitted as a
+ public symbol such that extra copies in multiple translation units will
+ be discarded by the linker. */
+#define MAKE_DECL_ONE_ONLY(DECL) \
+do { \
+ int len; \
+ char *name, *string, *prefix; \
+ \
+ DECL_WEAK (DECL) = 1; \
+ \
+ name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)); \
+ \
+ if (DECL_ONE_ONLY (decl)) \
+ { \
+ if (TREE_CODE (decl) == FUNCTION_DECL) \
+ prefix = ".gnu.linkonce.t."; \
+ else if (TREE_READONLY (decl)) \
+ prefix = ".gnu.linkonce.r."; \
+ else \
+ prefix = ".gnu.linkonce.d."; \
+ } \
+ else \
+ prefix = ""; \
+ \
+ 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)
+
/* A C statement (sans semicolon) to output an element in the table of
global constructors. */
#define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \