diff options
author | David E. O'Brien <obrien@FreeBSD.org> | 2001-03-02 02:46:05 +0000 |
---|---|---|
committer | David E. O'Brien <obrien@FreeBSD.org> | 2001-03-02 02:46:05 +0000 |
commit | 49bd150d8804adc49c45125b1024b079b363f139 (patch) | |
tree | a7aef6e1b53f397c6250458fac86731530774d5d | |
parent | c04329d1843d7c99f86bf055a1c165fced80163f (diff) | |
download | src-49bd150d8804adc49c45125b1024b079b363f139.tar.gz src-49bd150d8804adc49c45125b1024b079b363f139.zip |
Move the obvious bits of mixed ELF and a.out support down into this MD
header to reduce the difference of our sources to the stock GNU/FSF ones.
While the mix binary format support was nice to have in the FreeBSD MI
header as a frame work, it just clutters up too much and makes the FreeBSD
MI header more different from the FSF/GNU stock one than it needs to be.
Notes
Notes:
svn path=/head/; revision=73305
-rw-r--r-- | contrib/gcc/config/i386/freebsd.h | 108 |
1 files changed, 108 insertions, 0 deletions
diff --git a/contrib/gcc/config/i386/freebsd.h b/contrib/gcc/config/i386/freebsd.h index a20d4f9172db..4568cbddc6fb 100644 --- a/contrib/gcc/config/i386/freebsd.h +++ b/contrib/gcc/config/i386/freebsd.h @@ -341,6 +341,72 @@ Boston, MA 02111-1307, USA. */ fprintf ((FILE), "\t.p2align %d\n", (LOG)); \ } +#undef ASM_OUTPUT_ALIGNED_COMMON +#define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \ + do { \ + if (TARGET_ELF) \ + { \ + fprintf ((FILE), "%s", COMMON_ASM_OP); \ + assemble_name ((FILE), (NAME)); \ + fprintf ((FILE), ",%u,%u\n", (SIZE), (ALIGN) / BITS_PER_UNIT); \ + } \ + else \ + { \ + int rounded = (SIZE); \ + if (rounded == 0) rounded = 1; \ + rounded += (BIGGEST_ALIGNMENT / BITS_PER_UNIT) - 1; \ + rounded = (rounded / (BIGGEST_ALIGNMENT / BITS_PER_UNIT) \ + * (BIGGEST_ALIGNMENT / BITS_PER_UNIT)); \ + fprintf ((FILE), "%s ", COMMON_ASM_OP); \ + assemble_name ((FILE), (NAME)); \ + fprintf ((FILE), ",%u\n", (rounded)); \ + } \ + } while (0) + +/* This says how to output assembler code to declare an + uninitialized internal linkage data object. Under SVR4, + the linker seems to want the alignment of data objects + to depend on their types. We do exactly that here. */ + +#undef ASM_OUTPUT_ALIGNED_LOCAL +#define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN) \ + do { \ + if (TARGET_ELF) \ + { \ + fprintf ((FILE), "%s", LOCAL_ASM_OP); \ + assemble_name ((FILE), (NAME)); \ + fprintf ((FILE), "\n"); \ + ASM_OUTPUT_ALIGNED_COMMON ((FILE), (NAME), (SIZE), (ALIGN)); \ + } \ + else \ + { \ + int rounded = (SIZE); \ + if (rounded == 0) rounded = 1; \ + rounded += (BIGGEST_ALIGNMENT / BITS_PER_UNIT) - 1; \ + rounded = (rounded / (BIGGEST_ALIGNMENT / BITS_PER_UNIT) \ + * (BIGGEST_ALIGNMENT / BITS_PER_UNIT)); \ + fputs ("\t.lcomm\t", (FILE)); \ + assemble_name ((FILE), (NAME)); \ + fprintf ((FILE), ",%u\n", (rounded)); \ + } \ + } while (0) + +/* How to output some space. The rules are different depending on the + object format. */ +#undef ASM_OUTPUT_SKIP +#define ASM_OUTPUT_SKIP(FILE, SIZE) \ + do { \ + if (TARGET_ELF) \ + { \ + fprintf ((FILE), "%s%u\n", SKIP_ASM_OP, (SIZE)); \ + } \ + else \ + { \ + fprintf ((FILE), "\t.space\t%u\n", (SIZE)); \ + } \ + } while (0) + + #undef ASM_OUTPUT_SOURCE_LINE #define ASM_OUTPUT_SOURCE_LINE(FILE, LINE) \ do { \ @@ -554,6 +620,48 @@ Boston, MA 02111-1307, USA. */ const_section (); \ } +/* A C statement (sans semicolon) to output an element in the table of + global constructors. */ +#undef ASM_OUTPUT_CONSTRUCTOR +#define ASM_OUTPUT_CONSTRUCTOR(FILE, NAME) \ + do { \ + if (TARGET_ELF) \ + { \ + ctors_section (); \ + fprintf ((FILE), "%s ", INT_ASM_OP); \ + assemble_name ((FILE), (NAME)); \ + fprintf ((FILE), "\n"); \ + } \ + else \ + { \ + fprintf (asm_out_file, "%s \"%s__CTOR_LIST__\",22,0,0,", \ + ASM_STABS_OP, (TARGET_UNDERSCORES) ? "_" : ""); \ + assemble_name (asm_out_file, name); \ + fputc ('\n', asm_out_file); \ + } \ + } while (0) + +/* A C statement (sans semicolon) to output an element in the table of + global destructors. */ +#undef ASM_OUTPUT_DESTRUCTOR +#define ASM_OUTPUT_DESTRUCTOR(FILE, NAME) \ + do { \ + if (TARGET_ELF) \ + { \ + dtors_section (); \ + fprintf ((FILE), "%s ", INT_ASM_OP); \ + assemble_name ((FILE), (NAME)); \ + fprintf ((FILE), "\n"); \ + } \ + else \ + { \ + fprintf (asm_out_file, "%s \"%s__DTOR_LIST__\",22,0,0,", \ + ASM_STABS_OP, (TARGET_UNDERSCORES) ? "_" : ""); \ + assemble_name (asm_out_file, name); \ + fputc ('\n', asm_out_file); \ + } \ + } while (0) + /* Define macro used to output shift-double opcodes when the shift count is in %cl. Some assemblers require %cl as an argument; some don't. |