gcc/gcc46-pr47610.patch

24 lines
678 B
Diff

2011-02-05 Jakub Jelinek <jakub@redhat.com>
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/varasm.c.jj 2011-02-03 20:09:38.000000000 +0100
+++ gcc/varasm.c 2011-02-05 00:01:59.911796344 +0100
@@ -6060,7 +6060,12 @@ default_section_type_flags (tree decl, c
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;