[PATCH] D14567: [ELF2] - dont merge .data.rel.ro/.data.rel.ro.local into .data section.
George Rimar via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 11 03:17:00 PST 2015
grimar created this revision.
grimar added reviewers: ruiu, rafael.
grimar added subscribers: llvm-commits, grimar.
This sections can be protected with relro after resolving relocations by dynamic linker.
http://reviews.llvm.org/D14567
Files:
ELF/Writer.cpp
test/elf2/section-name.s
Index: test/elf2/section-name.s
===================================================================
--- test/elf2/section-name.s
+++ test/elf2/section-name.s
@@ -17,6 +17,10 @@
.section .bss,"", at nobits
.section .foo.a,"aw"
.section .foo,"aw"
+.section .data.rel.ro,"aw",%progbits
+.section .data.rel.ro.a,"aw",%progbits
+.section .data.rel.ro.local,"aw",%progbits
+.section .data.rel.ro.local.a,"aw",%progbits
// CHECK-NOT: Name: .rodata.a
// CHECK: Name: .rodata
@@ -26,5 +30,9 @@
// CHECK: Name: .data
// CHECK: Name: .foo.a
// CHECK: Name: .foo
+// CHECK-NOT: Name: .data.rel.ro.a
+// CHECK: Name: .data.rel.ro
+// CHECK-NOT: Name: .data.rel.ro.local.a
+// CHECK: Name: .data.rel.ro.local
// CHECK-NOT: Name: .bss.a
// CHECK: Name: .bss
Index: ELF/Writer.cpp
===================================================================
--- ELF/Writer.cpp
+++ ELF/Writer.cpp
@@ -462,6 +462,10 @@
return ".text";
if (S.startswith(".rodata."))
return ".rodata";
+ if (S.startswith(".data.rel.ro.local"))
+ return ".data.rel.ro.local";
+ if (S.startswith(".data.rel.ro"))
+ return ".data.rel.ro";
if (S.startswith(".data."))
return ".data";
if (S.startswith(".bss."))
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D14567.39895.patch
Type: text/x-patch
Size: 1230 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151111/e1a7f6b1/attachment.bin>
More information about the llvm-commits
mailing list