summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDinar Temirbulatov <dtemirbulatov@gmail.com>2010-11-18 01:54:05 +0300
committerSteve Ellcey <sje@gcc.gnu.org>2010-11-17 22:54:05 +0000
commit86f27ba678fb1db724b0cc1dba3576f8ff0647e0 (patch)
tree6cf58c8467a051998cc1187523cc0a43f4846259
parent3a3a1e7484fa1e2d0fb20782719cf75c0c0082e4 (diff)
downloadgcc-86f27ba678fb1db724b0cc1dba3576f8ff0647e0.tar.gz
re PR middle-end/31490 (Compile error section type conflict)
2010-11-17 Dinar Temirbulatov <dtemirbulatov@gmail.com> Steve Ellcey <sje@cup.hp.com> PR middle-end/31490 * varasm.c (categorize_decl_for_section): Ignore reloc_rw_mask if section attribute used. Co-Authored-By: Steve Ellcey <sje@cup.hp.com> From-SVN: r166887
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/varasm.c10
2 files changed, 14 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index d21e2e96d4e..162295b15c7 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2010-11-17 Dinar Temirbulatov <dtemirbulatov@gmail.com>
+ Steve Ellcey <sje@cup.hp.com>
+
+ PR middle-end/31490
+ * varasm.c (categorize_decl_for_section): Ignore reloc_rw_mask
+ if section attribute used.
+
2010-11-17 Jan Hubicka <jh@suse.cz>
* builtins.c (expand_builtin_mathfn_2, expand_builtin_mathfn): Do not
diff --git a/gcc/varasm.c b/gcc/varasm.c
index 215e0edbd59..6171e30799a 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -6102,13 +6102,17 @@ categorize_decl_for_section (const_tree decl, int reloc)
/* Here the reloc_rw_mask is not testing whether the section should
be read-only or not, but whether the dynamic link will have to
do something. If so, we wish to segregate the data in order to
- minimize cache misses inside the dynamic linker. */
- if (reloc & targetm.asm_out.reloc_rw_mask ())
+ minimize cache misses inside the dynamic linker. If the data
+ has a section attribute, ignore reloc_rw_mask() so that all data
+ in a given named section is catagorized in the same way. */
+ if (reloc & targetm.asm_out.reloc_rw_mask ()
+ && !lookup_attribute ("section", DECL_ATTRIBUTES (decl)))
ret = reloc == 1 ? SECCAT_DATA_REL_LOCAL : SECCAT_DATA_REL;
else
ret = SECCAT_DATA;
}
- else if (reloc & targetm.asm_out.reloc_rw_mask ())
+ else if (reloc & targetm.asm_out.reloc_rw_mask ()
+ && !lookup_attribute ("section", DECL_ATTRIBUTES (decl)))
ret = reloc == 1 ? SECCAT_DATA_REL_RO_LOCAL : SECCAT_DATA_REL_RO;
else if (reloc || flag_merge_constants < 2)
/* C and C++ don't allow different variables to share the same