aboutsummaryrefslogtreecommitdiff
path: root/gcc/varasm.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2011-02-05 21:35:16 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2011-02-05 21:35:16 +0100
commitc42c09fc413309bbf59e34f95f48071a9e739275 (patch)
tree84631ddec5c254cfb91584af8ddd1582c2014cfd /gcc/varasm.c
parent4a9b1f8edc0c2e32ab238bfb28a8f14c8260f27c (diff)
downloadgcc-c42c09fc413309bbf59e34f95f48071a9e739275.zip
gcc-c42c09fc413309bbf59e34f95f48071a9e739275.tar.gz
gcc-c42c09fc413309bbf59e34f95f48071a9e739275.tar.bz2
re PR middle-end/47610 (cp-demangle.c:1970:1: error: cplus_demangle_builtin_types causes a section type conflict)
PR middle-end/47610 * varasm.c (default_section_type_flags): If decl is NULL, and name is .data.rel.ro or .data.rel.ro.local, set SECTION_RELRO bit. * gcc.dg/pr47610.c: New test. From-SVN: r169855
Diffstat (limited to 'gcc/varasm.c')
-rw-r--r--gcc/varasm.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/varasm.c b/gcc/varasm.c
index 3a9fbae..76675cd 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -6060,7 +6060,12 @@ default_section_type_flags (tree decl, const char *name, int reloc)
flags = SECTION_WRITE;
}
else
- flags = SECTION_WRITE;
+ {
+ flags = SECTION_WRITE;
+ if (strcmp (name, ".data.rel.ro") == 0
+ || strcmp (name, ".data.rel.ro.local") == 0)
+ flags |= SECTION_RELRO;
+ }
if (decl && DECL_ONE_ONLY (decl))
flags |= SECTION_LINKONCE;