summaryrefslogtreecommitdiff
path: root/gcc/config/mips/elf.h
diff options
context:
space:
mode:
authorhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>2001-08-08 15:40:57 +0000
committerhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>2001-08-08 15:40:57 +0000
commit71d957f972a5d7027af88d87b0bd902d39c520f7 (patch)
tree90c84bf177629043c2093e12abfc569d7a8d4003 /gcc/config/mips/elf.h
parentfdc1df6a1525d24af9269658387175ae0964f280 (diff)
downloadgcc-71d957f972a5d7027af88d87b0bd902d39c520f7.tar.gz
2001-08-08 H.J. Lu <hjl@gnu.org>
* config/mips/mips.c (mips_unique_section): New. Copied from config/mips/elf.h. * config/mips/mips-protos.h (mips_unique_section): New prototype. * config/mips/elf.h (UNIQUE_SECTION): Use mips_unique_section. * config/mips/little.h: New. Generic little endian mips targets. Only mips*-*-linux* is converted to use it so far. * config/mips/linux.h: Include "gofast.h" and "mips/mips.h". (WCHAR_TYPE): Defined (WCHAR_TYPE_SIZE): Likewise. (INIT_SUBTARGET_OPTABS): Likewise. (BSS_SECTION_ASM_OP): Likewise. (SBSS_SECTION_ASM_OP): Likewise. (ASM_OUTPUT_ALIGNED_BSS): Likewise. (ASM_DECLARE_OBJECT_NAME): Likewise. (UNIQUE_SECTION): Likewise. (EXTRA_SECTIONS): Likewise. (ASM_OUTPUT_CONSTRUCTOR): Likewise. (ASM_OUTPUT_DESTRUCTOR): Likewise. (ASM_OUTPUT_DEF): Likewise. (HANDLE_SYSV_PRAGMA): Removed. (NO_IMPLICIT_EXTERN_C): Likewise. (TARGET_MEM_FUNCTIONS): Likewise. (STARTFILE_SPEC): Likewise. (ENDFILE_SPEC): Likewise. (LIB_SPEC): Likewise. (INVOKE__main): Likewise. (CTOR_LIST_BEGIN): Likewise. (CTOR_LIST_END): Likewise. (DTOR_LIST_BEGIN): Likewise. (DTOR_LIST_END): Likewise. (SET_ASM_OP): Likewise. (ASM_OUTPUT_SOURCE_LINE): Likewise. (ASM_OUTPUT_DEF): Likewise. (ASM_OUTPUT_IDENT): Likewise. * config/mips/mips.h (ASM_SPEC): Undefine before define. (CPLUSPLUS_CPP_SPEC): Likewise. (ASM_APP_ON) Redefine only if not defined. (ASM_APP_OFF): Likewise. (ASM_OUTPUT_SOURCE_LINE): Likewise. (ASM_OUTPUT_IDENT): Likewise. * config.gcc: Update tm_file for Linux/mips. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@44718 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/mips/elf.h')
-rw-r--r--gcc/config/mips/elf.h66
1 files changed, 2 insertions, 64 deletions
diff --git a/gcc/config/mips/elf.h b/gcc/config/mips/elf.h
index 3ef9020c28a..4b88363e1dd 100644
--- a/gcc/config/mips/elf.h
+++ b/gcc/config/mips/elf.h
@@ -197,70 +197,8 @@ do { \
#define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)
#undef UNIQUE_SECTION
-#define UNIQUE_SECTION(DECL,RELOC) \
-do { \
- int len, size, sec; \
- char *name, *string, *prefix; \
- static char *prefixes[4][2] = { \
- { ".text.", ".gnu.linkonce.t." }, \
- { ".rodata.", ".gnu.linkonce.r." }, \
- { ".data.", ".gnu.linkonce.d." }, \
- { ".sdata.", ".gnu.linkonce.s." } \
- }; \
- \
- name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (DECL)); \
- size = int_size_in_bytes (TREE_TYPE (decl)); \
- \
- /* Determine the base section we are interested in: \
- 0=text, 1=rodata, 2=data, 3=sdata, [4=bss]. */ \
- if (TREE_CODE (DECL) == FUNCTION_DECL) \
- sec = 0; \
- else if (DECL_INITIAL (DECL) == 0 \
- || DECL_INITIAL (DECL) == error_mark_node) \
- sec = 2; \
- else if ((TARGET_EMBEDDED_PIC || TARGET_MIPS16) \
- && TREE_CODE (decl) == STRING_CST \
- && !flag_writable_strings) \
- { \
- /* For embedded position independent code, put constant strings \
- in the text section, because the data section is limited to \
- 64K in size. For mips16 code, put strings in the text \
- section so that a PC relative load instruction can be used to \
- get their address. */ \
- sec = 0; \
- } \
- else if (TARGET_EMBEDDED_DATA) \
- { \
- /* For embedded applications, always put an object in read-only data \
- if possible, in order to reduce RAM usage. */ \
- \
- if (DECL_READONLY_SECTION (DECL, RELOC)) \
- sec = 1; \
- else if (size > 0 && size <= mips_section_threshold) \
- sec = 3; \
- else \
- sec = 2; \
- } \
- else \
- { \
- /* For hosted applications, always put an object in small data if \
- possible, as this gives the best performance. */ \
- \
- if (size > 0 && size <= mips_section_threshold) \
- sec = 3; \
- else if (DECL_READONLY_SECTION (DECL, RELOC)) \
- sec = 1; \
- else \
- sec = 2; \
- } \
- \
- 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)
+#define UNIQUE_SECTION(DECL,RELOC) \
+ mips_unique_section ((DECL), (RELOC))
/* Support the ctors/dtors and other sections. */