[PATCH] D18248: [ELF] - Set the sh_entsize for mergable sections

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 18 02:33:39 PDT 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL263780: [ELF] - Set the sh_entsize for mergable sections (authored by grimar).

Changed prior to commit:
  http://reviews.llvm.org/D18248?vs=50954&id=51014#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D18248

Files:
  lld/trunk/ELF/OutputSections.cpp
  lld/trunk/test/ELF/merge-string.s
  lld/trunk/test/ELF/merge.s

Index: lld/trunk/test/ELF/merge.s
===================================================================
--- lld/trunk/test/ELF/merge.s
+++ lld/trunk/test/ELF/merge.s
@@ -29,7 +29,7 @@
 // CHECK-NEXT:    Link: 0
 // CHECK-NEXT:    Info: 0
 // CHECK-NEXT:    AddressAlignment: 4
-// CHECK-NEXT:    EntrySize: 0
+// CHECK-NEXT:    EntrySize: 4
 // CHECK-NEXT:    SectionData (
 // CHECK-NEXT:      0000: 10000000 42000000
 // CHECK-NEXT:    )
Index: lld/trunk/test/ELF/merge-string.s
===================================================================
--- lld/trunk/test/ELF/merge-string.s
+++ lld/trunk/test/ELF/merge-string.s
@@ -32,7 +32,7 @@
 // CHECK-NEXT: Link: 0
 // CHECK-NEXT: Info: 0
 // CHECK-NEXT: AddressAlignment: 1
-// CHECK-NEXT: EntrySize: 0
+// CHECK-NEXT: EntrySize: 1
 // CHECK-NEXT: SectionData (
 // CHECK-NEXT:   0000: 61626300                             |abc.|
 // CHECK-NEXT: )
@@ -50,7 +50,7 @@
 // NOTAIL-NEXT: Link: 0
 // NOTAIL-NEXT: Info: 0
 // NOTAIL-NEXT: AddressAlignment: 1
-// NOTAIL-NEXT: EntrySize: 0
+// NOTAIL-NEXT: EntrySize: 1
 // NOTAIL-NEXT: SectionData (
 // NOTAIL-NEXT:   0000: 61626300 626300                     |abc.bc.|
 // NOTAIL-NEXT: )
@@ -68,7 +68,7 @@
 // CHECK-NEXT: Link: 0
 // CHECK-NEXT: Info: 0
 // CHECK-NEXT: AddressAlignment: 2
-// CHECK-NEXT: EntrySize: 0
+// CHECK-NEXT: EntrySize: 2
 // CHECK-NEXT: SectionData (
 // CHECK-NEXT:   0000: 14000000                             |....|
 // CHECK-NEXT: )
Index: lld/trunk/ELF/OutputSections.cpp
===================================================================
--- lld/trunk/ELF/OutputSections.cpp
+++ lld/trunk/ELF/OutputSections.cpp
@@ -1220,6 +1220,7 @@
   ArrayRef<uint8_t> D = S->getSectionData();
   StringRef Data((const char *)D.data(), D.size());
   uintX_t EntSize = S->getSectionHdr()->sh_entsize;
+  this->Header.sh_entsize = EntSize;
 
   // If this is of type string, the contents are null-terminated strings.
   if (this->Header.sh_flags & SHF_STRINGS) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D18248.51014.patch
Type: text/x-patch
Size: 1978 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160318/f8a4587e/attachment.bin>


More information about the llvm-commits mailing list