From: danglin Date: Wed, 30 May 2012 23:03:59 +0000 (+0000) Subject: PR target/52999 X-Git-Url: http://git.sourceforge.jp/view?p=pf3gnuchains%2Fgcc-fork.git;a=commitdiff_plain;h=998e157edb453f61e8252bc586309977e39e78d9;hp=939634fb3d61b083624df10a953c5d0382b6e03d PR target/52999 * config/pa/pa.c (TARGET_SECTION_TYPE_FLAGS): Define. (pa_section_type_flags): New. (pa_legitimate_constant_p): Revert previous change. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_7-branch@188032 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d198a6ced92..0e97e80ca5b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2012-05-30 John David Anglin + + PR target/52999 + * config/pa/pa.c (TARGET_SECTION_TYPE_FLAGS): Define. + (pa_section_type_flags): New. + (pa_legitimate_constant_p): Revert previous change. + 2012-05-30 Aldy Hernandez Backport from mainline diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c index 6b4ea25fa22..fc3214361fe 100644 --- a/gcc/config/pa/pa.c +++ b/gcc/config/pa/pa.c @@ -188,6 +188,7 @@ static enum machine_mode pa_c_mode_for_suffix (char); static section *pa_function_section (tree, enum node_frequency, bool, bool); static bool pa_cannot_force_const_mem (enum machine_mode, rtx); static bool pa_legitimate_constant_p (enum machine_mode, rtx); +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; @@ -383,6 +384,8 @@ static size_t n_deferred_plabels = 0; #undef TARGET_LEGITIMATE_CONSTANT_P #define TARGET_LEGITIMATE_CONSTANT_P pa_legitimate_constant_p +#undef TARGET_SECTION_TYPE_FLAGS +#define TARGET_SECTION_TYPE_FLAGS pa_section_type_flags struct gcc_target targetm = TARGET_INITIALIZER; @@ -10332,7 +10335,29 @@ pa_legitimate_constant_p (enum machine_mode mode, rtx x) && !pa_cint_ok_for_move (INTVAL (x))) return false; + if (function_label_operand (x, mode)) + return false; + return true; } +/* 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"