diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 2002-11-10 22:48:15 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 2002-11-10 22:48:15 +0000 |
commit | daeebfdd4f71ecb3274d8c3997294baa5dc96fa7 (patch) | |
tree | d3992e5484ca33f371c835102fac8de7345daca4 /gnu/egcs/gcc | |
parent | b4f62b8d6d83c549a2d02fc25ea9774985a6b9ca (diff) |
produce proper canonical version name, support static constructors, enable exec-stack.h; espie@ ok
Diffstat (limited to 'gnu/egcs/gcc')
-rw-r--r-- | gnu/egcs/gcc/config.gcc | 6 | ||||
-rw-r--r-- | gnu/egcs/gcc/config/pa/openbsd.h | 71 |
2 files changed, 73 insertions, 4 deletions
diff --git a/gnu/egcs/gcc/config.gcc b/gnu/egcs/gcc/config.gcc index 255648aa101..af9e9638719 100644 --- a/gnu/egcs/gcc/config.gcc +++ b/gnu/egcs/gcc/config.gcc @@ -421,10 +421,10 @@ elxsi-elxsi-*) h8300-*-*) float_format=i32 ;; -hppa*-*-openbsd*) -# tm_file="${tm_file} exec-stack.h" +hppa-*-openbsd*) + tm_file="${tm_file} exec-stack.h" target_cpu_default="MASK_PA_11" - tmake_file=pa/t-openbsd + tmake_file="t-openbsd pa/t-openbsd" ;; hppa1.1-*-pro*) tm_file="pa/pa-pro.h ${tm_file} pa/pa-pro-end.h libgloss.h" 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 + |