mips .bss switching patch

Aldy Hernandez aldyh@redhat.com
Thu Dec 7 13:14:00 GMT 2000


Here is a patch that emits @nobits when emitting switches into the .bss
section.

Ok to install?

Aldy

2000-12-07  Aldy Hernandez  <aldyh@redhat.com>

        * config/mips/elf.h (ASM_OUTPUT_SECTION_NAME): emit @nobits
        if changing into .bss section.
        * config/mips/elf64.h: same.
        * config/mips/iris6.h: same.
        * config/mips/netbsd.h: same.
        * config/mips/openbsd.h: same.

Index: elf64.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/mips/elf64.h,v
retrieving revision 1.26
diff -c -r1.26 elf64.h
*** elf64.h	2000/09/25 13:22:47	1.26
--- elf64.h	2000/12/07 20:02:02
***************
*** 84,89 ****
--- 84,91 ----
      fprintf (asm_out_text_file, "\t.section %s,\"ax\",@progbits\n", (NAME)); \
    else if ((DECL) && DECL_READONLY_SECTION (DECL, RELOC))	\
      fprintf (F, "\t.section %s,\"a\",@progbits\n", (NAME));	\
+   else if (! strncmp (NAME, ".bss", 4))				\
+     fprintf (F, "\t.section %s,\"aw\",@nobits\n", (NAME));	\
    else								\
      fprintf (F, "\t.section %s,\"aw\",@progbits\n", (NAME));	\
  } while (0)
Index: elf.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/mips/elf.h,v
retrieving revision 1.23
diff -c -r1.23 elf.h
*** elf.h	2000/09/25 13:22:46	1.23
--- elf.h	2000/12/07 20:02:02
***************
*** 67,72 ****
--- 67,74 ----
      fprintf (asm_out_text_file, "\t.section %s,\"ax\",@progbits\n", (NAME)); \
    else if ((DECL) && DECL_READONLY_SECTION (DECL, RELOC))	\
      fprintf (F, "\t.section %s,\"a\",@progbits\n", (NAME));	\
+   else if (! strncmp (NAME, ".bss", 4))                         \
+     fprintf (F, "\t.section %s,\"aw\",@nobits\n", (NAME));      \
    else								\
      fprintf (F, "\t.section %s,\"aw\",@progbits\n", (NAME));	\
  } while (0)
Index: iris6.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/mips/iris6.h,v
retrieving revision 1.24
diff -c -r1.24 iris6.h
*** iris6.h	2000/11/03 20:43:43	1.24
--- iris6.h	2000/12/07 20:02:04
***************
*** 379,384 ****
--- 379,386 ----
      fprintf (asm_out_text_file, "\t.section %s,1,6,4,4\n", (NAME));	\
    else if ((DECL) && DECL_READONLY_SECTION (DECL, RELOC))		\
      fprintf (F, "\t.section %s,1,2,0,8\n", (NAME));			\
+   else if (! strncmp (NAME, ".bss", 4))                         	\
+     fprintf (F, "\t.section %s,\"aw\",@nobits\n", (NAME));      	\
    else									\
      fprintf (F, "\t.section %s,1,3,0,8\n", (NAME));			\
  } while (0)
Index: netbsd.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/mips/netbsd.h,v
retrieving revision 1.7
diff -c -r1.7 netbsd.h
*** netbsd.h	2000/11/02 23:29:12	1.7
--- netbsd.h	2000/12/07 20:02:05
***************
*** 214,219 ****
--- 214,221 ----
      fprintf (asm_out_text_file, "\t.section %s,\"ax\",@progbits\n", (NAME)); \
    else if ((DECL) && DECL_READONLY_SECTION (DECL, RELOC))                    \
      fprintf (F, "\t.section %s,\"a\",@progbits\n", (NAME));                  \
+   else if (! strncmp (NAME, ".bss", 4))                         	     \
+     fprintf (F, "\t.section %s,\"aw\",@nobits\n", (NAME));      	     \
    else                                                                       \
      fprintf (F, "\t.section %s,\"aw\",@progbits\n", (NAME));                 \
  } while (0)
Index: openbsd.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/mips/openbsd.h,v
retrieving revision 1.2
diff -c -r1.2 openbsd.h
*** openbsd.h	2000/11/02 23:29:12	1.2
--- openbsd.h	2000/12/07 20:02:06
***************
*** 115,120 ****
--- 115,122 ----
      fprintf (asm_out_text_file, "\t.section %s,\"ax\",@progbits\n", (NAME)); \
    else if ((DECL) && DECL_READONLY_SECTION (DECL, RELOC))                    \
      fprintf (F, "\t.section %s,\"a\",@progbits\n", (NAME));                  \
+   else if (! strncmp (NAME, ".bss", 4))                         	     \
+     fprintf (F, "\t.section %s,\"aw\",@nobits\n", (NAME));      	     \
    else                                                                       \
      fprintf (F, "\t.section %s,\"aw\",@progbits\n", (NAME));                 \
  } while (0)


More information about the Gcc-patches mailing list