xref: /openbsd/gnu/gcc/gcc/config/score/elf.h (revision 404b540a)
1 /* elf.h for Sunplus S+CORE processor
2    Copyright (C) 2005 Free Software Foundation, Inc.
3 
4    This file is part of GCC.
5 
6    GCC is free software; you can redistribute it and/or modify it
7    under the terms of the GNU General Public License as published
8    by the Free Software Foundation; either version 2, or (at your
9    option) any later version.
10 
11    GCC is distributed in the hope that it will be useful, but WITHOUT
12    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13    or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
14    License for more details.
15 
16    You should have received a copy of the GNU General Public License
17    along with GCC; see the file COPYING.  If not, write to
18    the Free Software Foundation, 51 Franklin Street, Fifth Floor,
19    Boston, MA 02110-1301, USA.  */
20 
21 #define OBJECT_FORMAT_ELF
22 
23 /* Biggest alignment supported by the object file format of this machine.  */
24 #undef  MAX_OFILE_ALIGNMENT
25 #define MAX_OFILE_ALIGNMENT        (32768 * 8)
26 
27 /* Switch into a generic section.  */
28 #undef  TARGET_ASM_NAMED_SECTION
29 #define TARGET_ASM_NAMED_SECTION  default_elf_asm_named_section
30 
31 /* The following macro defines the format used to output the second
32    operand of the .type assembler directive.  */
33 #define TYPE_OPERAND_FMT        "@%s"
34 
35 #undef TYPE_ASM_OP
36 #define TYPE_ASM_OP        "\t.type\t"
37 
38 #undef SIZE_ASM_OP
39 #define SIZE_ASM_OP        "\t.size\t"
40 
41 /* A c expression whose value is a string containing the
42    assembler operation to identify the following data as
43    uninitialized global data.  */
44 #ifndef BSS_SECTION_ASM_OP
45 #define BSS_SECTION_ASM_OP        "\t.section\t.bss"
46 #endif
47 
48 #ifndef ASM_OUTPUT_ALIGNED_BSS
49 #define ASM_OUTPUT_ALIGNED_BSS asm_output_aligned_bss
50 #endif
51 
52 #define ASM_OUTPUT_DEF(FILE, LABEL1, LABEL2)                       \
53   do {                                                             \
54     fputc ('\t', FILE);                                            \
55     assemble_name (FILE, LABEL1);                                  \
56     fputs (" = ", FILE);                                           \
57     assemble_name (FILE, LABEL2);                                  \
58     fputc ('\n', FILE);                                            \
59  } while (0)
60 
61 
62 /* This is how we tell the assembler that a symbol is weak.  */
63 #undef  ASM_WEAKEN_LABEL
64 #define ASM_WEAKEN_LABEL(FILE, NAME) ASM_OUTPUT_WEAK_ALIAS (FILE, NAME, 0)
65 
66 #define ASM_OUTPUT_WEAK_ALIAS(FILE, NAME, VALUE)      \
67   do {                                                \
68     fputs ("\t.weak\t", FILE);                        \
69     assemble_name (FILE, NAME);                       \
70     if (VALUE)                                        \
71       {                                               \
72         fputc (' ', FILE);                            \
73         assemble_name (FILE, VALUE);                  \
74       }                                               \
75     fputc ('\n', FILE);                               \
76  } while (0)
77 
78 #define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)
79 
80 /* On elf, we *do* have support for the .init and .fini sections, and we
81    can put stuff in there to be executed before and after `main'.  We let
82    crtstuff.c and other files know this by defining the following symbols.
83    The definitions say how to change sections to the .init and .fini
84    sections.  This is the same for all known elf assemblers.  */
85 #undef  INIT_SECTION_ASM_OP
86 #define INIT_SECTION_ASM_OP     "\t.section\t.init"
87 #undef  FINI_SECTION_ASM_OP
88 #define FINI_SECTION_ASM_OP     "\t.section\t.fini"
89 
90 /* Don't set the target flags, this is done by the linker script */
91 #undef  LIB_SPEC
92 #define LIB_SPEC ""
93 
94 #undef  STARTFILE_SPEC
95 #define STARTFILE_SPEC          "crti%O%s crtbegin%O%s"
96 
97 #undef  ENDFILE_SPEC
98 #define ENDFILE_SPEC            "crtend%O%s crtn%O%s"
99 
100 /* We support #pragma.  */
101 #define HANDLE_SYSV_PRAGMA      1
102