summaryrefslogtreecommitdiff
path: root/gcc/config/ia64
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2002-05-17 07:43:41 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2002-05-17 07:43:41 +0000
commit5247088939be6a330f9faf74f0dde78f301abb78 (patch)
treea091fa322b67f7b86562f6228ca9bec436939a5d /gcc/config/ia64
parentbe17000d9783c1a2222157b2f3f88494e3e62bde (diff)
downloadgcc-5247088939be6a330f9faf74f0dde78f301abb78.tar.gz
* hooks.c (hook_tree_bool_false): New.
* hooks.h: Declare it. * target-def.h (TARGET_ASM_SELECT_SECTION): New. (TARGET_ASM_UNIQUE_SECTION, TARGET_IN_SMALL_DATA_P): New. * target.h (select_section, unique_section): New. (in_small_data_p): New. * varasm.c (resolve_unique_section): Use hooks instead of macros. (variable_section, output_constant_def_contents): Likewise. (default_select_section, default_unique_section): New. (categorize_decl_for_section, default_elf_select_section): New. * output.h: Declare them. * config/darwin.h (ALIAS_SECTION, try_section_alias): Remove. (TARGET_ASM_SELECT_SECTION): New. (SELECT_SECTION): Move ... * config/darwin.c (machopic_select_section): ... here. * config/darwin-protos.h: Update. * config/nextstep.h (TARGET_ASM_SELECT_SECTION): New. (SELECT_SECTION): Move ... * config/nextstep.c (nextstep_select_section): ... here. * config/nextstep-protos.h: Update. * config/elfos.h (UNIQUE_SECTION, SELECT_SECTION): Remove. (TARGET_ASM_SELECT_SECTION): New. * config/svr3.h (SELECT_SECTION): Remove. * config/alpha/alpha.c (unicosmk_unique_section): Make static. (TARGET_ASM_UNIQUE_SECTION) [UNICOS]: New. (TARGET_IN_SMALL_DATA_P, alpha_in_small_data_p): New. (alpha_encode_section_info): Use it. * config/alpha/alpha-protos.h: Update. * config/alpha/elf.h (DO_SELECT_SECTION): Remove. (SELECT_SECTION, UNIQUE_SECTION): Remove. (TARGET_ASM_SELECT_SECTION): New. * config/alpha/unicosmk.h (UNIQUE_SECTION): Remove. * config/arm/pe.h (UNIQUE_SECTION): Remove. (TARGET_ASM_UNIQUE_SECTION): New. * config/avr/avr.c (TARGET_ASM_UNIQUE_SECTION): New. (avr_unique_section): Rename from unique_section; make static. * config/avr/avr-protos.h: Update. * config/avr/avr.h (UNIQUE_SECTION): Remove. * config/c4x/c4x.h (SELECT_SECTION): Remove. * config/i386/cygwin.h (UNIQUE_SECTION): Remove. (TARGET_ASM_UNIQUE_SECTION): New. * config/i386/i386-interix.h: Likewise. * config/i386/win32.h: Likewise. * config/i386/djgpp.h (UNIQUE_SECTION): Remove. * config/i386/i386.c (ix86_asm_file_end): Use target hook not macro. * config/i386/sco5.h (SELECT_SECTION): Remove. (TARGET_ASM_SELECT_SECTION): New. * config/i386/svr3gas.h (SELECT_SECTION): Remove. * config/i860/paragon.h: Undef TARGET_ASM_SELECT_SECTION instead of SELECT_SECTION. * config/m68k/dpx2.h: Likewise. * config/rs6000/lynx.h: Likewise. * config/ia64/aix.h (SELECT_SECTION, UNIQUE_SECTION): Remove. (TARGET_ASM_SELECT_SECTION, TARGET_ASM_UNIQUE_SECTION): New. * config/ia64/ia64.c (TARGET_IN_SMALL_DATA_P): New. (ia64_in_small_data_p): New. (ia64_encode_section_info): Use it. Reorganize overlarge conditional. (ia64_aix_select_section, ia64_aix_unique_section): New. * config/ia64/sysv4.h (DO_SELECT_SECTION): Remove. (SELECT_SECTION, UNIQUE_SECTION): Remove. * config/m32r/m32r.h (SELECT_SECTION): Remove. (TARGET_ASM_SELECT_SECTION): New. * config/m32r/m32r.c (m32r_select_section): Take align argument. * config/m32r/m32r-protos.h: Update. * config/m88k/m88k.h (TARGET_ASM_SELECT_SECTION): New. (SELECT_SECTION): Move ... * config/m88k/m88k.c (m88k_select_section): ... here. * config/mcore/mcore-pe.h (SELECT_SECTION): Remove. * config/mcore/mcore.h (UNIQUE_SECTION): Remove. * config/mcore/mcore.c (TARGET_ASM_UNIQUE_SECTION): New. (mcore_unique_section): Make static. * config/mcore/mcore-protos.h: Update. * config/mips/elf.h (UNIQUE_SECTION): Remove. (TARGET_ASM_UNIQUE_SECTION): New. * config/mips/elf64.h: Likewise. * config/mips/iris6gld.h: Likewise. * config/mips/linux.h: Likewise. * config/mips/mips-protos.h: Update. * config/mips/mips.c (mips_select_section): Add align argument. * config/mips/mips.h (SELECT_SECTION): Remove. (TARGET_ASM_SELECT_SECTION): New. * config/mmix/mmix.h (SELECT_SECTION, UNIQUE_SECTION): Remove. * config/mmix/mmix.c (mmix_select_section): Remove. (mmix_unique_section): Remove. * config/mmix/mmix-protos.h: Update. * config/pa/pa.h (TARGET_ASM_SELECT_SECTION): New. (SELECT_SECTION): Move ... * config/pa/pa.c (pa_select_section): ... here. * config/pa/pa64-hpux.h (UNIQUE_SECTION): Remove. * config/rs6000/rs6000.c (rs6000_elf_select_section): Rename from rs6000_select_section and make static. (rs6000_elf_unique_section): Similarly. (rs6000_xcoff_select_section): From xcoff.h. (rs6000_xcoff_unique_section): Likewise. * config/rs6000/rs6000-protos.h: Update. * config/rs6000/sysv4.h (SELECT_SECTION, UNIQUE_SECTION): Remove. (TARGET_ASM_SELECT_SECTION, TARGET_ASM_UNIQUE_SECTION): New. * config/rs6000/xcoff.h: Likewise. * config/sparc/aout.h (TARGET_ASM_SELECT_SECTION): New. (SELECT_SECTION): Move ... * config/sparc/sparc.c (sparc_aout_select_section): ... here. * config/v850/v850.h (SELECT_SECTION): Move ... * config/v850/v850.c (v850_select_section): ... here. (TARGET_ASM_SELECT_SECTION): New. * config/vax/vms.h (SELECT_SECTION): Move ... * config/vax/vax.c (vms_select_section): ... here. (TARGET_ASM_SELECT_SECTION): New. * doc/tm.texi: Update SELECT_SECTION and UNIQUE_SECTION docs for the target hooks. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@53550 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/ia64')
-rw-r--r--gcc/config/ia64/aix.h88
-rw-r--r--gcc/config/ia64/ia64.c188
-rw-r--r--gcc/config/ia64/sysv4.h129
3 files changed, 122 insertions, 283 deletions
diff --git a/gcc/config/ia64/aix.h b/gcc/config/ia64/aix.h
index fee073213e2..0e66a5dcb08 100644
--- a/gcc/config/ia64/aix.h
+++ b/gcc/config/ia64/aix.h
@@ -132,47 +132,10 @@ do { \
#define STANDARD_STARTFILE_PREFIX "/usr/lib/ia64l64/"
#endif
-/* Override SELECT_SECTION and SELECT_RTX_SECTION from config/ia64/sysv4.h;
- these definitions ignore flag_pic as if it were always set;
- it is illegal to have relocations in shared segments on AIX. */
-
-/* A C statement or statements to switch to the appropriate
- section for output of DECL. DECL is either a `VAR_DECL' node
- or a constant of some sort. RELOC indicates whether forming
- the initial value of DECL requires link-time relocations. */
-
-#undef SELECT_SECTION
-#define SELECT_SECTION(DECL,RELOC,ALIGN) \
-{ \
- if (TREE_CODE (DECL) == STRING_CST) \
- { \
- if (! flag_writable_strings) \
- const_section (); \
- else \
- data_section (); \
- } \
- else if (TREE_CODE (DECL) == VAR_DECL) \
- { \
- if (XSTR (XEXP (DECL_RTL (DECL), 0), 0)[0] \
- == SDATA_NAME_FLAG_CHAR) \
- sdata_section (); \
- /* ??? We need the extra ! RELOC check, because the default is to \
- only check RELOC if flag_pic is set, and we don't set flag_pic \
- (yet?). */ \
- else if (DECL_READONLY_SECTION (DECL, RELOC) && ! (RELOC)) \
- const_section (); \
- else \
- data_section (); \
- } \
- /* This could be a CONSTRUCTOR containing ADDR_EXPR of a VAR_DECL, \
- in which case we can't put it in a shared library rodata. */ \
- else if (RELOC) \
- data_section (); \
- else \
- const_section (); \
-}
-
-/* Similarly for constant pool data. */
+#undef TARGET_ASM_SELECT_SECTION
+#define TARGET_ASM_SELECT_SECTION ia64_aix_select_section
+#undef TARGET_ASM_UNIQUE_SECTION
+#define TARGET_ASM_UNIQUE_SECTION ia64_aix_unique_section
extern unsigned int ia64_section_threshold;
#undef SELECT_RTX_SECTION
@@ -187,49 +150,6 @@ extern unsigned int ia64_section_threshold;
const_section (); \
}
-#undef UNIQUE_SECTION
-#define UNIQUE_SECTION(DECL, RELOC) \
- do \
- { \
- int len; \
- int sec; \
- const char *name; \
- char *string; \
- const char *prefix; \
- static const char *const prefixes[/*4*/3][2] = \
- { \
- { ".text.", ".gnu.linkonce.t." }, \
- { ".rodata.", ".gnu.linkonce.r." }, \
- { ".data.", ".gnu.linkonce.d." } \
- /* Do not generate unique sections for uninitialised \
- data since we do not have support for this in the \
- linker scripts yet... \
- ,{ ".bss.", ".gnu.linkonce.b." } */ \
- }; \
- \
- if (TREE_CODE (DECL) == FUNCTION_DECL) \
- sec = 0; \
- /* else if (DECL_INITIAL (DECL) == 0 \
- || DECL_INITIAL (DECL) == error_mark_node) \
- sec = 3; */ \
- else if (DECL_READONLY_SECTION (DECL, RELOC) && ! (RELOC))\
- sec = 1; \
- else \
- sec = 2; \
- \
- name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (DECL)); \
- /* Strip off any encoding in name. */ \
- STRIP_NAME_ENCODING (name, name); \
- prefix = prefixes[sec][DECL_ONE_ONLY(DECL)]; \
- 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)
-
/* Override ia64/sysv4.h setting with that used by AIX5. */
#undef WCHAR_TYPE
#ifdef __64BIT__
diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c
index 562c977f677..f6f6c551bce 100644
--- a/gcc/config/ia64/ia64.c
+++ b/gcc/config/ia64/ia64.c
@@ -125,6 +125,7 @@ static void ia64_free_machine_status PARAMS ((struct function *));
static void emit_insn_group_barriers PARAMS ((FILE *, rtx));
static void emit_all_insn_group_barriers PARAMS ((FILE *, rtx));
static void emit_predicate_relation_info PARAMS ((void));
+static bool ia64_in_small_data_p PARAMS ((tree));
static void process_epilogue PARAMS ((void));
static int process_set PARAMS ((FILE *, rtx));
@@ -152,6 +153,11 @@ static int ia64_sched_reorder PARAMS ((FILE *, int, rtx *, int *, int));
static int ia64_sched_reorder2 PARAMS ((FILE *, int, rtx *, int *, int));
static int ia64_variable_issue PARAMS ((FILE *, int, rtx, int));
+static void ia64_aix_select_section PARAMS ((tree, int,
+ unsigned HOST_WIDE_INT))
+ ATTRIBUTE_UNUSED;
+static void ia64_aix_unique_section PARAMS ((tree, int))
+ ATTRIBUTE_UNUSED;
/* Table of valid machine attributes. */
static const struct attribute_spec ia64_attribute_table[] =
@@ -195,6 +201,9 @@ static const struct attribute_spec ia64_attribute_table[] =
#undef TARGET_ASM_FUNCTION_EPILOGUE
#define TARGET_ASM_FUNCTION_EPILOGUE ia64_output_function_epilogue
+#undef TARGET_IN_SMALL_DATA_P
+#define TARGET_IN_SMALL_DATA_P ia64_in_small_data_p
+
#undef TARGET_SCHED_ADJUST_COST
#define TARGET_SCHED_ADJUST_COST ia64_adjust_cost
#undef TARGET_SCHED_ISSUE_RATE
@@ -6858,9 +6867,32 @@ ia64_eh_uses (regno)
code faster because there is one less load. This also includes incomplete
types which can't go in sdata/sbss. */
-/* ??? See select_section. We must put short own readonly variables in
- sdata/sbss instead of the more natural rodata, because we can't perform
- the DECL_READONLY_SECTION test here. */
+static bool
+ia64_in_small_data_p (exp)
+ tree exp;
+{
+ if (TARGET_NO_SDATA)
+ return false;
+
+ if (TREE_CODE (exp) == VAR_DECL && DECL_SECTION_NAME (exp))
+ {
+ const char *section = TREE_STRING_POINTER (DECL_SECTION_NAME (exp));
+ if (strcmp (section, ".sdata") == 0
+ || strcmp (section, ".sbss") == 0)
+ return true;
+ }
+ else
+ {
+ HOST_WIDE_INT size = int_size_in_bytes (TREE_TYPE (exp));
+
+ /* If this is an incomplete type with size 0, then we can't put it
+ in sdata because it might be too big when completed. */
+ if (size > 0 && size <= ia64_section_threshold)
+ return true;
+ }
+
+ return false;
+}
void
ia64_encode_section_info (decl, first)
@@ -6868,6 +6900,8 @@ ia64_encode_section_info (decl, first)
int first ATTRIBUTE_UNUSED;
{
const char *symbol_str;
+ bool is_local, is_small;
+ rtx symbol;
if (TREE_CODE (decl) == FUNCTION_DECL)
{
@@ -6880,76 +6914,64 @@ ia64_encode_section_info (decl, first)
|| GET_CODE (DECL_RTL (decl)) != MEM
|| GET_CODE (XEXP (DECL_RTL (decl), 0)) != SYMBOL_REF)
return;
-
- symbol_str = XSTR (XEXP (DECL_RTL (decl), 0), 0);
-
- /* We assume that -fpic is used only to create a shared library (dso).
- With -fpic, no global data can ever be sdata.
- Without -fpic, global common uninitialized data can never be sdata, since
- it can unify with a real definition in a dso. */
- /* ??? Actually, we can put globals in sdata, as long as we don't use gprel
- to access them. The linker may then be able to do linker relaxation to
- optimize references to them. Currently sdata implies use of gprel. */
- /* We need the DECL_EXTERNAL check for C++. static class data members get
- both TREE_STATIC and DECL_EXTERNAL set, to indicate that they are
- statically allocated, but the space is allocated somewhere else. Such
- decls can not be own data. */
- if (! TARGET_NO_SDATA
- && ((TREE_STATIC (decl) && ! DECL_EXTERNAL (decl)
- && ! (DECL_ONE_ONLY (decl) || DECL_WEAK (decl))
- && ! (TREE_PUBLIC (decl)
- && (flag_pic
- || (DECL_COMMON (decl)
- && (DECL_INITIAL (decl) == 0
- || DECL_INITIAL (decl) == error_mark_node)))))
- || MODULE_LOCAL_P (decl))
- /* Either the variable must be declared without a section attribute,
- or the section must be sdata or sbss. */
- && (DECL_SECTION_NAME (decl) == 0
- || ! strcmp (TREE_STRING_POINTER (DECL_SECTION_NAME (decl)),
- ".sdata")
- || ! strcmp (TREE_STRING_POINTER (DECL_SECTION_NAME (decl)),
- ".sbss")))
- {
- HOST_WIDE_INT size = int_size_in_bytes (TREE_TYPE (decl));
-
- /* If the variable has already been defined in the output file, then it
- is too late to put it in sdata if it wasn't put there in the first
- place. The test is here rather than above, because if it is already
- in sdata, then it can stay there. */
-
- if (TREE_ASM_WRITTEN (decl))
- ;
-
- /* If this is an incomplete type with size 0, then we can't put it in
- sdata because it might be too big when completed.
- Objects bigger than threshold should have SDATA_NAME_FLAG_CHAR
- added if they are in .sdata or .sbss explicitely. */
- else if (((size > 0
- && size <= (HOST_WIDE_INT) ia64_section_threshold)
- || DECL_SECTION_NAME (decl))
- && symbol_str[0] != SDATA_NAME_FLAG_CHAR)
- {
- size_t len = strlen (symbol_str);
- char *newstr = alloca (len + 1);
- const char *string;
- *newstr = SDATA_NAME_FLAG_CHAR;
- memcpy (newstr + 1, symbol_str, len + 1);
-
- string = ggc_alloc_string (newstr, len + 1);
- XSTR (XEXP (DECL_RTL (decl), 0), 0) = string;
- }
- }
- /* This decl is marked as being in small data/bss but it shouldn't
- be; one likely explanation for this is that the decl has been
- moved into a different section from the one it was in when
- ENCODE_SECTION_INFO was first called. Remove the '@'. */
- else if (symbol_str[0] == SDATA_NAME_FLAG_CHAR)
+ symbol = XEXP (DECL_RTL (decl), 0);
+ symbol_str = XSTR (symbol, 0);
+
+ /* A variable is considered "local" if it is defined by this module. */
+
+ if (MODULE_LOCAL_P (decl))
+ is_local = true;
+ /* Otherwise, variables defined outside this object may not be local. */
+ else if (DECL_EXTERNAL (decl))
+ is_local = false;
+ /* Linkonce and weak data are never local. */
+ else if (DECL_ONE_ONLY (decl) || DECL_WEAK (decl))
+ is_local = false;
+ /* Static variables are always local. */
+ else if (! TREE_PUBLIC (decl))
+ is_local = true;
+ /* If PIC, then assume that any global name can be overridden by
+ symbols resolved from other modules. */
+ else if (flag_pic)
+ is_local = false;
+ /* Uninitialized COMMON variable may be unified with symbols
+ resolved from other modules. */
+ else if (DECL_COMMON (decl)
+ && (DECL_INITIAL (decl) == NULL
+ || DECL_INITIAL (decl) == error_mark_node))
+ is_local = false;
+ /* Otherwise we're left with initialized (or non-common) global data
+ which is of necessity defined locally. */
+ else
+ is_local = true;
+
+ /* Determine if DECL will wind up in .sdata/.sbss. */
+ is_small = ia64_in_small_data_p (decl);
+
+ /* Finally, encode this into the symbol string. */
+ if (is_local && is_small)
{
- XSTR (XEXP (DECL_RTL (decl), 0), 0)
- = ggc_strdup (symbol_str + 1);
+ char *newstr;
+ size_t len;
+
+ if (symbol_str[0] == SDATA_NAME_FLAG_CHAR)
+ return;
+
+ len = strlen (symbol_str) + 1;
+ newstr = alloca (len + 1);
+ newstr[0] = SDATA_NAME_FLAG_CHAR;
+ memcpy (newstr + 1, symbol_str, len);
+
+ XSTR (symbol, 0) = ggc_alloc_string (newstr, len);
}
+
+ /* This decl is marked as being in small data/bss but it shouldn't be;
+ one likely explanation for this is that the decl has been moved into
+ a different section from the one it was in when ENCODE_SECTION_INFO
+ was first called. Remove the '@'. */
+ else if (symbol_str[0] == SDATA_NAME_FLAG_CHAR)
+ XSTR (symbol, 0) = ggc_strdup (symbol_str + 1);
}
/* Output assembly directives for prologue regions. */
@@ -7820,3 +7842,29 @@ ia64_hpux_function_arg_padding (mode, type)
: GET_MODE_BITSIZE (mode) < PARM_BOUNDARY)
? downward : upward);
}
+
+/* It is illegal to have relocations in shared segments on AIX.
+ Pretend flag_pic is always set. */
+
+static void
+ia64_aix_select_section (exp, reloc, align)
+ tree exp;
+ int reloc;
+ unsigned HOST_WIDE_INT align;
+{
+ int save_pic = flag_pic;
+ flag_pic = 1;
+ default_elf_select_section (exp, reloc, align);
+ flag_pic = save_pic;
+}
+
+static void
+ia64_aix_unique_section (decl, reloc)
+ tree decl;
+ int reloc;
+{
+ int save_pic = flag_pic;
+ flag_pic = 1;
+ default_unique_section (decl, reloc);
+ flag_pic = save_pic;
+}
diff --git a/gcc/config/ia64/sysv4.h b/gcc/config/ia64/sysv4.h
index f4550b682db..1f07b8c0f91 100644
--- a/gcc/config/ia64/sysv4.h
+++ b/gcc/config/ia64/sysv4.h
@@ -140,135 +140,6 @@ do { \
emit_safe_across_calls (STREAM); \
} while (0)
-/* A C statement or statements to switch to the appropriate
- section for output of DECL. DECL is either a `VAR_DECL' node
- or a constant of some sort. RELOC indicates whether forming
- the initial value of DECL requires link-time relocations.
-
- Set SECNUM to:
- 0 .text
- 1 .rodata
- 2 .data
- 3 .sdata
- 4 .bss
- 5 .sbss
-*/
-#define DO_SELECT_SECTION(SECNUM, DECL, RELOC) \
- do \
- { \
- if (TREE_CODE (DECL) == STRING_CST) \
- { \
- if (! flag_writable_strings) \
- SECNUM = 0x101; \
- else \
- SECNUM = 2; \
- } \
- else if (TREE_CODE (DECL) == VAR_DECL) \
- { \
- if (XSTR (XEXP (DECL_RTL (DECL), 0), 0)[0] \
- == SDATA_NAME_FLAG_CHAR) \
- SECNUM = 3; \
- /* ??? We need the extra RELOC check, because the default \
- is to only check RELOC if flag_pic is set, and we don't \
- set flag_pic (yet?). */ \
- else if (!DECL_READONLY_SECTION (DECL, RELOC) || (RELOC)) \
- SECNUM = 2; \
- else if (flag_merge_constants < 2) \
- /* C and C++ don't allow different variables to share \
- the same location. -fmerge-all-constants allows \
- even that (at the expense of not conforming). */ \
- SECNUM = 1; \
- else if (TREE_CODE (DECL_INITIAL (DECL)) == STRING_CST) \
- SECNUM = 0x201; \
- else \
- SECNUM = 0x301; \
- } \
- /* This could be a CONSTRUCTOR containing ADDR_EXPR of a VAR_DECL, \
- in which case we can't put it in a shared library rodata. */ \
- else if (flag_pic && (RELOC)) \
- SECNUM = 3; \
- else \
- SECNUM = 2; \
- } \
- while (0)
-
-/* We override svr4.h so that we can support the sdata section. */
-
-#undef SELECT_SECTION
-#define SELECT_SECTION(DECL,RELOC,ALIGN) \
- do \
- { \
- typedef void (*sec_fn) PARAMS ((void)); \
- static sec_fn const sec_functions[6] = \
- { \
- text_section, \
- const_section, \
- data_section, \
- sdata_section, \
- bss_section, \
- sbss_section \
- }; \
- \
- int sec; \
- \
- DO_SELECT_SECTION (sec, DECL, RELOC); \
- \
- switch (sec) \
- { \
- case 0x101: \
- mergeable_string_section (DECL, ALIGN, 0); \
- break; \
- case 0x201: \
- mergeable_string_section (DECL_INITIAL (DECL), \
- ALIGN, 0); \
- break; \
- case 0x301: \
- mergeable_constant_section (DECL_MODE (DECL), \
- ALIGN, 0); \
- break; \
- default: \
- (*sec_functions[sec]) (); \
- break; \
- } \
- } \
- while (0)
-
-#undef UNIQUE_SECTION
-#define UNIQUE_SECTION(DECL, RELOC) \
- do \
- { \
- static const char * const prefixes[6][2] = \
- { \
- { ".text.", ".gnu.linkonce.t." }, \
- { ".rodata.", ".gnu.linkonce.r." }, \
- { ".data.", ".gnu.linkonce.d." }, \
- { ".sdata.", ".gnu.linkonce.s." }, \
- { ".bss.", ".gnu.linkonce.b." }, \
- { ".sbss.", ".gnu.linkonce.sb." } \
- }; \
- \
- int nlen, plen, sec; \
- const char *name, *prefix; \
- char *string; \
- \
- DO_SELECT_SECTION (sec, DECL, RELOC); \
- \
- name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (DECL)); \
- STRIP_NAME_ENCODING (name, name); \
- nlen = strlen (name); \
- \
- prefix = prefixes[sec & 0xff][DECL_ONE_ONLY(DECL)]; \
- plen = strlen (prefix); \
- \
- string = alloca (nlen + plen + 1); \
- \
- memcpy (string, prefix, plen); \
- memcpy (string + plen, name, nlen + 1); \
- \
- DECL_SECTION_NAME (DECL) = build_string (nlen + plen, string); \
- } \
- while (0)
-
/* Similarly for constant pool data. */
extern unsigned int ia64_section_threshold;