diff options
Diffstat (limited to 'gcc/config/pa')
-rw-r--r-- | gcc/config/pa/linux-unwind.h | 4 | ||||
-rw-r--r-- | gcc/config/pa/pa.c | 29 | ||||
-rw-r--r-- | gcc/config/pa/pa.h | 9 |
3 files changed, 37 insertions, 5 deletions
diff --git a/gcc/config/pa/linux-unwind.h b/gcc/config/pa/linux-unwind.h index a0560e97445..38b4eda7aee 100644 --- a/gcc/config/pa/linux-unwind.h +++ b/gcc/config/pa/linux-unwind.h @@ -1,5 +1,5 @@ /* DWARF2 EH unwinding support for PA Linux. - Copyright (C) 2004, 2005, 2009 Free Software Foundation, Inc. + Copyright (C) 2004, 2005, 2009, 2012 Free Software Foundation, Inc. This file is part of GCC. @@ -63,7 +63,7 @@ pa32_fallback_frame_state (struct _Unwind_Context *context, int i; struct sigcontext *sc; struct rt_sigframe { - struct siginfo info; + siginfo_t info; struct ucontext uc; } *frame; diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c index 5e5a0f05b79..83e6e859e78 100644 --- a/gcc/config/pa/pa.c +++ b/gcc/config/pa/pa.c @@ -185,6 +185,7 @@ static bool pa_can_eliminate (const int, const int); static void pa_conditional_register_usage (void); static enum machine_mode pa_c_mode_for_suffix (char); static section *pa_function_section (tree, enum node_frequency, bool, bool); +static unsigned int pa_section_type_flags (tree, const char *, int); /* The following extra sections are only used for SOM. */ static GTY(()) section *som_readonly_data_section; @@ -400,6 +401,9 @@ static const struct default_options pa_option_optimization_table[] = #undef TARGET_ASM_FUNCTION_SECTION #define TARGET_ASM_FUNCTION_SECTION pa_function_section +#undef TARGET_SECTION_TYPE_FLAGS +#define TARGET_SECTION_TYPE_FLAGS pa_section_type_flags + struct gcc_target targetm = TARGET_INITIALIZER; /* Parse the -mfixed-range= option string. */ @@ -7540,7 +7544,7 @@ attr_length_millicode_call (rtx insn) return 24; else { - if (!TARGET_LONG_CALLS && distance < 240000) + if (!TARGET_LONG_CALLS && distance < MAX_PCREL17F_OFFSET) return 8; if (TARGET_LONG_ABS_CALL && !flag_pic) @@ -7753,7 +7757,7 @@ attr_length_call (rtx insn, int sibcall) /* pc-relative branch. */ if (!TARGET_LONG_CALLS && ((TARGET_PA_20 && !sibcall && distance < 7600000) - || distance < 240000)) + || distance < MAX_PCREL17F_OFFSET)) length += 8; /* 64-bit plabel sequence. */ @@ -8112,7 +8116,7 @@ attr_length_indirect_call (rtx insn) if (TARGET_FAST_INDIRECT_CALLS || (!TARGET_PORTABLE_RUNTIME && ((TARGET_PA_20 && !TARGET_SOM && distance < 7600000) - || distance < 240000))) + || distance < MAX_PCREL17F_OFFSET))) return 8; if (flag_pic) @@ -10431,4 +10435,23 @@ pa_function_section (tree decl, enum node_frequency freq, return default_function_section (decl, freq, startup, exit); } +/* Implement TARGET_SECTION_TYPE_FLAGS. */ + +static unsigned int +pa_section_type_flags (tree decl, const char *name, int reloc) +{ + unsigned int flags; + + flags = default_section_type_flags (decl, name, reloc); + + /* Function labels are placed in the constant pool. This can + cause a section conflict if decls are put in ".data.rel.ro" + or ".data.rel.ro.local" using the __attribute__ construct. */ + if (strcmp (name, ".data.rel.ro") == 0 + || strcmp (name, ".data.rel.ro.local") == 0) + flags |= SECTION_WRITE | SECTION_RELRO; + + return flags; +} + #include "gt-pa.h" diff --git a/gcc/config/pa/pa.h b/gcc/config/pa/pa.h index 012186854de..e59cd5d4578 100644 --- a/gcc/config/pa/pa.h +++ b/gcc/config/pa/pa.h @@ -1563,3 +1563,12 @@ do { \ #undef TARGET_HAVE_TLS #define TARGET_HAVE_TLS true #endif + +/* The maximum offset in bytes for a PA 1.X pc-relative call to the + head of the preceding stub table. The selected offsets have been + chosen so that approximately one call stub is allocated for every + 86.7 instructions. A long branch stub is two instructions when + not generating PIC code. For HP-UX and ELF targets, PIC stubs are + seven and four instructions, respectively. */ +#define MAX_PCREL17F_OFFSET \ + (flag_pic ? (TARGET_HPUX ? 198164 : 221312) : 240000) |