[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
Thu Nov 12 11:15:20 PST 2015


grimar updated this revision to Diff 40072.
grimar added a comment.

Updated to suggested variant.


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,8 @@
 // CHECK:     Name: .data
 // CHECK:     Name: .foo.a
 // CHECK:     Name: .foo
+// CHECK-NOT: Name: .data.rel.ro.a
+// CHECK-NOT: Name: .data.rel.ro.local.a
+// CHECK:     Name: .data.rel.ro
 // CHECK-NOT: Name: .bss.a
 // CHECK:     Name: .bss
Index: ELF/Writer.cpp
===================================================================
--- ELF/Writer.cpp
+++ ELF/Writer.cpp
@@ -478,6 +478,8 @@
     return ".text";
   if (S.startswith(".rodata."))
     return ".rodata";
+  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.40072.patch
Type: text/x-patch
Size: 1112 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151112/d9bae475/attachment.bin>


More information about the llvm-commits mailing list