From: Michael Meissner Date: Fri, 1 Mar 1996 20:34:12 +0000 (+0000) Subject: Define ASM_OUTPUT_ALIGNED_BSS X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fff4998bc9872fac229a83563e4759e811ab360a;p=gcc.git Define ASM_OUTPUT_ALIGNED_BSS From-SVN: r11397 --- diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h index e91c7eefd25..a043e3eaec2 100644 --- a/gcc/config/rs6000/sysv4.h +++ b/gcc/config/rs6000/sysv4.h @@ -282,10 +282,13 @@ do { \ /* Use ELF style section commands. */ #undef TEXT_SECTION_ASM_OP -#define TEXT_SECTION_ASM_OP "\t.section\t\".text\"" +#define TEXT_SECTION_ASM_OP "\t.section \".text\"" #undef DATA_SECTION_ASM_OP -#define DATA_SECTION_ASM_OP "\t.section\t\".data\"" +#define DATA_SECTION_ASM_OP "\t.section \".data\"" + +#undef BSS_SECTION_ASM_OP +#define BSS_SECTION_ASM_OP "\t.section \".bss\"" /* Besides the usual ELF sections, we need a toc section. */ #undef EXTRA_SECTIONS @@ -350,12 +353,12 @@ toc_section () \ } \ } -#define TOC_SECTION_ASM_OP "\t.section\t\".got\",\"aw\"" -#define MINIMAL_TOC_SECTION_ASM_OP "\t.section\t\".got1\",\"aw\"" +#define TOC_SECTION_ASM_OP "\t.section \".got\",\"aw\"" +#define MINIMAL_TOC_SECTION_ASM_OP "\t.section \".got1\",\"aw\"" -#define SDATA_SECTION_ASM_OP "\t.section\t\".sdata\",\"aw\"" -#define SDATA2_SECTION_ASM_OP "\t.section\t\".sdata2\",\"a\"" -#define SBSS_SECTION_ASM_OP "\t.section\t\".sbss\",\"aw\",@nobits" +#define SDATA_SECTION_ASM_OP "\t.section \".sdata\",\"aw\"" +#define SDATA2_SECTION_ASM_OP "\t.section \".sdata2\",\"a\"" +#define SBSS_SECTION_ASM_OP "\t.section \".sbss\",\"aw\",@nobits" #define SDATA_SECTION_FUNCTION \ void \ @@ -517,19 +520,20 @@ extern int rs6000_pic_labelno; #define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN) \ do { \ if (TARGET_SDATA && (SIZE) > 0 && (SIZE) <= g_switch_value) \ - { \ - sbss_section (); \ - ASM_OUTPUT_ALIGN (FILE, exact_log2 (ALIGN / BITS_PER_UNIT)); \ - ASM_OUTPUT_LABEL (FILE, NAME); \ - ASM_OUTPUT_SKIP (FILE, SIZE); \ - } \ + sbss_section (); \ else \ - { \ - fprintf ((FILE), "\t%s\t", LOCAL_ASM_OP); \ - assemble_name ((FILE), (NAME)); \ - fprintf ((FILE), "\n"); \ - ASM_OUTPUT_ALIGNED_COMMON (FILE, NAME, SIZE, ALIGN); \ - } \ + bss_section (); \ + \ + ASM_OUTPUT_ALIGN (FILE, exact_log2 (ALIGN / BITS_PER_UNIT)); \ + ASM_OUTPUT_LABEL (FILE, NAME); \ + ASM_OUTPUT_SKIP (FILE, SIZE); \ +} while (0) + +/* Describe how to emit unitialized external linkage items */ +#define ASM_OUTPUT_ALIGNED_BSS(FILE, NAME, SIZE, ALIGN) \ +do { \ + ASM_GLOBALIZE_LABEL (FILE, NAME); \ + ASM_OUTPUT_ALIGNED_LOCAL (FILE, NAME, SIZE, ALIGN); \ } while (0) /* Pass various options to the assembler */ @@ -589,7 +593,7 @@ do { \ fprintf (FILE, "\t.long ("); \ output_addr_const (FILE, (VALUE)); \ fprintf (FILE, ")@fixup\n"); \ - fprintf (FILE, "\t.section\t\".fixup\",\"aw\"\n"); \ + fprintf (FILE, "\t.section \".fixup\",\"aw\"\n"); \ ASM_OUTPUT_ALIGN (FILE, 2); \ fprintf (FILE, "\t.long\t%s\n", p); \ fprintf (FILE, "\t.previous\n"); \ diff --git a/gcc/config/rs6000/win-nt.h b/gcc/config/rs6000/win-nt.h index de34f973b00..c8356343df5 100644 --- a/gcc/config/rs6000/win-nt.h +++ b/gcc/config/rs6000/win-nt.h @@ -138,7 +138,7 @@ Boston, MA 02111-1307, USA. */ #undef READONLY_DATA_SECTION #undef EXTRA_SECTIONS -#define EXTRA_SECTIONS toc, bss +#define EXTRA_SECTIONS toc /* Define the routines to implement these extra sections. */ @@ -180,14 +180,28 @@ toc_section () \ fprintf ((FILE), ",%d\n", (SIZE)); } while (0) /* This says how to output an assembler line - to define a local common symbol. */ - -#undef ASM_OUTPUT_LOCAL -#define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE,ROUNDED) \ - do { fputs ("\t.lcomm \t", (FILE)); \ - assemble_name ((FILE), (NAME)); \ - fprintf ((FILE), ",%d\n", (SIZE)); \ - } while (0) + to define an aligned local common symbol. */ + +#undef ASM_OUTPUT_ALIGNED_LOCAL +#define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN) \ +do { \ + bss_section (); \ + ASM_OUTPUT_ALIGN (FILE, exact_log2 (ALIGN / BITS_PER_UNIT)); \ + ASM_OUTPUT_LABEL (FILE, NAME); \ + ASM_OUTPUT_SKIP (FILE, SIZE); \ +} while (0) + +/* Describe how to emit unitialized external linkage items */ +#define ASM_OUTPUT_ALIGNED_BSS(FILE, NAME, SIZE, ALIGN) \ +do { \ + ASM_GLOBALIZE_LABEL (FILE, NAME); \ + ASM_OUTPUT_ALIGNED_LOCAL (FILE, NAME, SIZE, ALIGN); \ +} while (0) + +/* This says out to put a global symbol in the BSS section */ +#undef ASM_OUTPUT_ALIGNED_BSS +#define ASM_OUTPUT_ALIGNED_BSS(FILE, NAME, SIZE, ALIGN) \ + asm_output_aligned_bss ((FILE), (NAME), (SIZE), (ALIGN)) /* Stuff to force fit us into the Motorola PPC assembler */ @@ -321,6 +335,10 @@ toc_section () \ #undef DATA_SECTION_ASM_OP #define DATA_SECTION_ASM_OP "\t.data" +/* Output to the bss section. */ +#undef BSS_SECTION_ASM_OP +#define BSS_SECTION_ASM_OP "\t.section .bss" + /* Text to write out after a CALL that may be replaced by glue code by the loader. The motorola asm demands that, for dll support, a .znop be issued after a bl instruction, and the symbol on the .znop is the