diff options
Diffstat (limited to 'gnu/egcs/gcc/config/pa/openbsd.h')
-rw-r--r-- | gnu/egcs/gcc/config/pa/openbsd.h | 71 |
1 files changed, 70 insertions, 1 deletions
diff --git a/gnu/egcs/gcc/config/pa/openbsd.h b/gnu/egcs/gcc/config/pa/openbsd.h index 53c0f33c06a..9dfc1cbaebc 100644 --- a/gnu/egcs/gcc/config/pa/openbsd.h +++ b/gnu/egcs/gcc/config/pa/openbsd.h @@ -18,12 +18,36 @@ along with GNU CC; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#define CTORS_SECTION_FUNCTION \ +void \ +ctors_section () \ +{ \ + if (in_section != in_ctors) \ + { \ + fprintf (asm_out_file, "%s\n", CTORS_SECTION_ASM_OP); \ + in_section = in_ctors; \ + } \ +} + +#define DTORS_SECTION_FUNCTION \ +void \ +dtors_section () \ +{ \ + if (in_section != in_dtors) \ + { \ + fprintf (asm_out_file, "%s\n", DTORS_SECTION_ASM_OP); \ + in_section = in_dtors; \ + } \ +} + #include <pa/pa.h> #define OBSD_HAS_DECLARE_FUNCTION_NAME #include <openbsd.h> +#define INT_ASM_OP ".long" + /* Run-time target specifications. */ -#define CPP_PREDEFINES "-D__unix__ -D__ANSI_COMPAT -Asystem(unix) -Asystem(OpenBSD) -Amachine(hppa) -D__OpenBSD__ -D__hppa__ -D__hppa" +#define CPP_PREDEFINES "-D__unix__ -D__ANSI_COMPAT -Asystem(unix) -Asystem(OpenBSD) -Amachine(hppa) -D__ELF__ -D__OpenBSD__ -D__hppa__ -D__hppa" #undef OVERRIDE_OPTIONS #define OVERRIDE_OPTIONS \ @@ -74,11 +98,50 @@ do { \ #undef ASM_OUTPUT_FUNCTION_PREFIX +#undef SELECT_RTX_SECTION +#define SELECT_RTX_SECTION(MODE,RTX) readonly_data_section (); + #undef STRING_ASM_OP #define STRING_ASM_OP ".stringz" #undef DBX_OUTPUT_MAIN_SOURCE_FILE_END + #undef ASM_OUTPUT_SECTION_NAME +/* Switch into a generic section. + This is currently only used to support section attributes. + + We make the section read-only and executable for a function decl, + read-only for a const data decl, and writable for a non-const data decl. */ +#define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME, RELOC) \ + fprintf (FILE, "\t.section\t%s,\"%s\",@progbits\n", NAME, \ + (DECL) && TREE_CODE (DECL) == FUNCTION_DECL ? "ax" : \ + (DECL) && DECL_READONLY_SECTION (DECL, RELOC) ? "a" : "aw") + +/* A C statement (sans semicolon) to output an element in the table of + global constructors. */ +#define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \ + do { \ + ctors_section (); \ + fprintf (FILE, "\t%s\t ", INT_ASM_OP); \ + assemble_name (FILE, NAME); \ + fprintf (FILE, "\n"); \ + } while (0) + +/* A C statement (sans semicolon) to output an element in the table of + global destructors. */ +#define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \ + do { \ + dtors_section (); \ + fprintf (FILE, "\t%s\t ", INT_ASM_OP); \ + assemble_name (FILE, NAME); \ + fprintf (FILE, "\n"); \ + } while (0) + +/* As an elf system, we need crtbegin/crtend stuff. */ +#undef STARTFILE_SPEC +#define STARTFILE_SPEC "%{!shared: %{pg:gcrt0%O%s} %{!pg:%{p:gcrt0%O%s} %{!p:crt0%O%s}} crtbegin%O%s} %{shared:crtbeginS%O%s}" +#undef ENDFILE_SPEC +#define ENDFILE_SPEC "%{!shared:crtend%O%s} %{shared:crtendS%O%s}" #undef TEXT_SECTION_ASM_OP #define TEXT_SECTION_ASM_OP "\t.text" @@ -88,7 +151,13 @@ do { \ #define DATA_SECTION_ASM_OP "\t.data" #undef BSS_SECTION_ASM_OP #define BSS_SECTION_ASM_OP "\t.section\t.bss" +#define CTORS_SECTION_ASM_OP "\t.section\t.ctors,\"aw\"" +#define DTORS_SECTION_ASM_OP "\t.section\t.dtors,\"aw\"" /* Remove hpux specific pa defines. */ #undef LDD_SUFFIX #undef PARSE_LDD_OUTPUT + +#undef DO_GLOBAL_DTORS_BODY +#define HAS_INIT_SECTION + |