diff options
author | Richard Sandiford <rsandifo@redhat.com> | 2002-05-03 17:08:29 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2002-05-03 17:08:29 +0000 |
commit | 66319f5cad7b88171aa276f018b7dce645b7788f (patch) | |
tree | ee8d7e5dd35946657991a1cd0b967d400002c762 | |
parent | 7bebf27930fe5d0b4c147575b213fe18cd892306 (diff) | |
download | gcc-66319f5cad7b88171aa276f018b7dce645b7788f.zip gcc-66319f5cad7b88171aa276f018b7dce645b7788f.tar.gz gcc-66319f5cad7b88171aa276f018b7dce645b7788f.tar.bz2 |
elf64.h (UNIQUE_SECTION): Use mips_unique_section.
* config/mips/elf64.h (UNIQUE_SECTION): Use mips_unique_section.
* config/mips/mips.c (mips_unique_section): Strip encoding from
decl name.
From-SVN: r53101
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/config/mips/elf64.h | 67 | ||||
-rw-r--r-- | gcc/config/mips/mips.c | 1 |
3 files changed, 9 insertions, 65 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 533ee11..71e4466 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2002-05-03 Richard Sandiford <rsandifo@redhat.com> + + * config/mips/elf64.h (UNIQUE_SECTION): Use mips_unique_section. + * config/mips/mips.c (mips_unique_section): Strip encoding from + decl name. + 2002-05-03 Jakub Jelinek <jakub@redhat.com> * config/i386/i386.c (ix86_expand_int_movcc): Truncate to proper diff --git a/gcc/config/mips/elf64.h b/gcc/config/mips/elf64.h index f0ac813..1015573 100644 --- a/gcc/config/mips/elf64.h +++ b/gcc/config/mips/elf64.h @@ -209,71 +209,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; \ - const char *name, *prefix; \ - char *string; \ - static const char *const 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)) /* A list of other sections which the compiler might be "in" at any given time. */ diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index 534b1f6..da568a5 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -10259,6 +10259,7 @@ mips_unique_section (decl, reloc) name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)); size = int_size_in_bytes (TREE_TYPE (decl)); + STRIP_NAME_ENCODING (name, name); /* Determine the base section we are interested in: 0=text, 1=rodata, 2=data, 3=sdata, [4=bss]. */ |