diff options
author | danglin <danglin@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-06-03 12:41:02 +0000 |
---|---|---|
committer | danglin <danglin@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-06-03 12:41:02 +0000 |
commit | 2cec7bca186bb6f4035ffafe3d91a44933bf9e22 (patch) | |
tree | 8e95a26ba473a5d2a06e4ee5bcc49c5f6ca01f45 /gcc/config/pa/pa.c | |
parent | f70b010da1e85a2042bb96127982d5591ac98701 (diff) | |
download | gcc-2cec7bca186bb6f4035ffafe3d91a44933bf9e22.tar.gz |
PR target/52999
* config/pa/pa.c (TARGET_SECTION_TYPE_FLAGS): Define.
(pa_section_type_flags): New.
* config/pa/pa.h (LEGITIMATE_CONSTANT_P): Revert previous change.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_6-branch@188150 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/pa/pa.c')
-rw-r--r-- | gcc/config/pa/pa.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c index 5e5a0f05b79..6f67ca8ea34 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. */ @@ -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" |