From 25324313325e906368fafd142bc6138c231e0b44 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Fri, 3 Feb 2017 21:29:51 +0000 Subject: [PATCH] Stop propagating Entsize. Now that we combine multiple synthetic merge section into one output section there is no point in trying to propagate a value. llvm-svn: 294048 --- lld/ELF/OutputSections.cpp | 2 -- lld/ELF/SyntheticSections.cpp | 5 +---- lld/test/ELF/basic-aarch64.s | 2 +- lld/test/ELF/basic-mips.s | 2 +- lld/test/ELF/basic-ppc.s | 2 +- lld/test/ELF/basic.s | 2 +- lld/test/ELF/basic32.s | 2 +- lld/test/ELF/basic64be.s | 2 +- lld/test/ELF/build-id.s | 6 +++--- lld/test/ELF/compressed-debug-input.s | 2 +- lld/test/ELF/gc-merge-local-sym.s | 2 +- lld/test/ELF/gc-sections-merge-addend.s | 2 +- lld/test/ELF/gc-sections-merge-implicit-addend.s | 2 +- lld/test/ELF/gc-sections-merge.s | 4 ++-- lld/test/ELF/linkerscript/merge-sections.s | 2 +- lld/test/ELF/merge-string.s | 6 +++--- lld/test/ELF/merge.s | 2 +- 17 files changed, 21 insertions(+), 26 deletions(-) diff --git a/lld/ELF/OutputSections.cpp b/lld/ELF/OutputSections.cpp index 135a9ccbc914..33044af35b0e 100644 --- a/lld/ELF/OutputSections.cpp +++ b/lld/ELF/OutputSections.cpp @@ -603,8 +603,6 @@ OutputSectionFactory::create(const SectionKey &Key, if (C->kind() == InputSectionBase::EHFrame) return {Out::EhFrame, false}; Sec = make>(Key.Name, Type, Flags); - if (Flags & SHF_MERGE) - Sec->Entsize = C->Entsize; return {Sec, true}; } diff --git a/lld/ELF/SyntheticSections.cpp b/lld/ELF/SyntheticSections.cpp index 7f589c4f680d..58a75c5ac772 100644 --- a/lld/ELF/SyntheticSections.cpp +++ b/lld/ELF/SyntheticSections.cpp @@ -1876,16 +1876,13 @@ MergeSyntheticSection::MergeSyntheticSection(StringRef Name, uint32_t Type, uintX_t Flags, uintX_t Alignment) : SyntheticSection(Flags, Type, Alignment, Name), - Builder(StringTableBuilder::RAW, Alignment) { - this->Entsize = Alignment; -} + Builder(StringTableBuilder::RAW, Alignment) {} template void MergeSyntheticSection::addSection(MergeInputSection *MS) { assert(!Finalized); MS->MergeSec = this; Sections.push_back(MS); - this->Entsize = MS->Entsize; } template void MergeSyntheticSection::writeTo(uint8_t *Buf) { diff --git a/lld/test/ELF/basic-aarch64.s b/lld/test/ELF/basic-aarch64.s index b68a2f9942a7..144fe6aee41b 100644 --- a/lld/test/ELF/basic-aarch64.s +++ b/lld/test/ELF/basic-aarch64.s @@ -81,7 +81,7 @@ _start: # CHECK-NEXT: Link: 0 # CHECK-NEXT: Info: 0 # CHECK-NEXT: AddressAlignment: 1 -# CHECK-NEXT: EntrySize: 1 +# CHECK-NEXT: EntrySize: 0 # CHECK-NEXT: } # CHECK-NEXT: Section { # CHECK-NEXT: Index: 3 diff --git a/lld/test/ELF/basic-mips.s b/lld/test/ELF/basic-mips.s index b143697ce0f8..4c7a66cf0050 100644 --- a/lld/test/ELF/basic-mips.s +++ b/lld/test/ELF/basic-mips.s @@ -164,7 +164,7 @@ __start: # CHECK-NEXT: Link: 0 # CHECK-NEXT: Info: 0 # CHECK-NEXT: AddressAlignment: 1 -# CHECK-NEXT: EntrySize: 1 +# CHECK-NEXT: EntrySize: 0 # CHECK-NEXT: } # CHECK-NEXT: Section { # CHECK-NEXT: Index: 8 diff --git a/lld/test/ELF/basic-ppc.s b/lld/test/ELF/basic-ppc.s index aae81fe2ac0e..4a36af99ed72 100644 --- a/lld/test/ELF/basic-ppc.s +++ b/lld/test/ELF/basic-ppc.s @@ -163,7 +163,7 @@ // CHECK-NEXT: Link: 0 // CHECK-NEXT: Info: 0 // CHECK-NEXT: AddressAlignment: 1 -// CHECK-NEXT: EntrySize: 1 +// CHECK-NEXT: EntrySize: 0 // CHECK-NEXT: SectionData ( // CHECK-NEXT: 0000: 4C4C4420 312E3000 |LLD 1.0.| // CHECK-NEXT: ) diff --git a/lld/test/ELF/basic.s b/lld/test/ELF/basic.s index 93ef03f9cd81..ff812f1f7f4d 100644 --- a/lld/test/ELF/basic.s +++ b/lld/test/ELF/basic.s @@ -83,7 +83,7 @@ _start: # CHECK-NEXT: Link: 0 # CHECK-NEXT: Info: 0 # CHECK-NEXT: AddressAlignment: 1 -# CHECK-NEXT: EntrySize: 1 +# CHECK-NEXT: EntrySize: 0 # CHECK-NEXT: } # CHECK-NEXT: Section { # CHECK-NEXT: Index: 3 diff --git a/lld/test/ELF/basic32.s b/lld/test/ELF/basic32.s index e68ed73e637d..cbf67eec8b7d 100644 --- a/lld/test/ELF/basic32.s +++ b/lld/test/ELF/basic32.s @@ -80,7 +80,7 @@ _start: # CHECK-NEXT: Link: 0 # CHECK-NEXT: Info: 0 # CHECK-NEXT: AddressAlignment: 1 -# CHECK-NEXT: EntrySize: 1 +# CHECK-NEXT: EntrySize: 0 # CHECK-NEXT: } # CHECK-NEXT: Section { # CHECK-NEXT: Index: 3 diff --git a/lld/test/ELF/basic64be.s b/lld/test/ELF/basic64be.s index d16f4a074175..c39669bfd547 100644 --- a/lld/test/ELF/basic64be.s +++ b/lld/test/ELF/basic64be.s @@ -175,7 +175,7 @@ _start: # CHECK-NEXT: Link: 0 # CHECK-NEXT: Info: 0 # CHECK-NEXT: AddressAlignment: 1 -# CHECK-NEXT: EntrySize: 1 +# CHECK-NEXT: EntrySize: 0 # CHECK-NEXT: SectionData ( # CHECK-NEXT: 0000: 4C4C4420 312E3000 |LLD 1.0.| # CHECK-NEXT: ) diff --git a/lld/test/ELF/build-id.s b/lld/test/ELF/build-id.s index 51758d9eb24a..ffd8d7744f70 100644 --- a/lld/test/ELF/build-id.s +++ b/lld/test/ELF/build-id.s @@ -44,15 +44,15 @@ _start: # DEFAULT: Contents of section .note.test: # DEFAULT: Contents of section .note.gnu.build-id: # DEFAULT-NEXT: 04000000 08000000 03000000 474e5500 ............GNU. -# DEFAULT-NEXT: d08dafb4 e6294b62 +# DEFAULT-NEXT: fd36edb1 f6ff02af # MD5: Contents of section .note.gnu.build-id: # MD5-NEXT: 04000000 10000000 03000000 474e5500 ............GNU. -# MD5-NEXT: 37 +# MD5-NEXT: fc # SHA1: Contents of section .note.gnu.build-id: # SHA1-NEXT: 04000000 14000000 03000000 474e5500 ............GNU. -# SHA1-NEXT: 7a4f4eaf 69ceb948 4a7d6e51 2225e87c +# SHA1-NEXT: 55b1eedb 03b588e1 09987d1d e9a79be7 # UUID: Contents of section .note.gnu.build-id: # UUID-NEXT: 04000000 10000000 03000000 474e5500 ............GNU. diff --git a/lld/test/ELF/compressed-debug-input.s b/lld/test/ELF/compressed-debug-input.s index 5104a102ba30..fbd5b02a07f0 100644 --- a/lld/test/ELF/compressed-debug-input.s +++ b/lld/test/ELF/compressed-debug-input.s @@ -59,7 +59,7 @@ # DATA-NEXT: Link: 0 # DATA-NEXT: Info: 0 # DATA-NEXT: AddressAlignment: 1 -# DATA-NEXT: EntrySize: 1 +# DATA-NEXT: EntrySize: 0 # DATA-NEXT: SectionData ( # DATA-NEXT: 0000: 73686F72 7420756E 7369676E 65642069 |short unsigned i| # DATA-NEXT: 0010: 6E740075 6E736967 6E656420 696E7400 |nt.unsigned int.| diff --git a/lld/test/ELF/gc-merge-local-sym.s b/lld/test/ELF/gc-merge-local-sym.s index b02a3a4e4762..a4540af4d9cc 100644 --- a/lld/test/ELF/gc-merge-local-sym.s +++ b/lld/test/ELF/gc-merge-local-sym.s @@ -15,7 +15,7 @@ // CHECK-NEXT: Link: 0 // CHECK-NEXT: Info: 0 // CHECK-NEXT: AddressAlignment: 1 -// CHECK-NEXT: EntrySize: 1 +// CHECK-NEXT: EntrySize: 0 // CHECK-NEXT: SectionData ( // CHECK-NEXT: 0000: 61626300 |abc.| // CHECK-NEXT: ) diff --git a/lld/test/ELF/gc-sections-merge-addend.s b/lld/test/ELF/gc-sections-merge-addend.s index 8595f5802be5..1c1f6ee2389b 100644 --- a/lld/test/ELF/gc-sections-merge-addend.s +++ b/lld/test/ELF/gc-sections-merge-addend.s @@ -16,7 +16,7 @@ // CHECK-NEXT: Link: 0 // CHECK-NEXT: Info: 0 // CHECK-NEXT: AddressAlignment: 1 -// CHECK-NEXT: EntrySize: 1 +// CHECK-NEXT: EntrySize: 0 // CHECK-NEXT: SectionData ( // CHECK-NEXT: 0000: 62617200 |bar.| // CHECK-NEXT: ) diff --git a/lld/test/ELF/gc-sections-merge-implicit-addend.s b/lld/test/ELF/gc-sections-merge-implicit-addend.s index 8a7c804a830a..c725e294a187 100644 --- a/lld/test/ELF/gc-sections-merge-implicit-addend.s +++ b/lld/test/ELF/gc-sections-merge-implicit-addend.s @@ -16,7 +16,7 @@ // CHECK-NEXT: Link: 0 // CHECK-NEXT: Info: 0 // CHECK-NEXT: AddressAlignment: 1 -// CHECK-NEXT: EntrySize: 1 +// CHECK-NEXT: EntrySize: 0 // CHECK-NEXT: SectionData ( // CHECK-NEXT: 0000: 62617200 |bar.| // CHECK-NEXT: ) diff --git a/lld/test/ELF/gc-sections-merge.s b/lld/test/ELF/gc-sections-merge.s index ef2688659871..d7b3eaeca751 100644 --- a/lld/test/ELF/gc-sections-merge.s +++ b/lld/test/ELF/gc-sections-merge.s @@ -18,7 +18,7 @@ // CHECK-NEXT: Link: 0 // CHECK-NEXT: Info: 0 // CHECK-NEXT: AddressAlignment: 1 -// CHECK-NEXT: EntrySize: 1 +// CHECK-NEXT: EntrySize: 0 // CHECK-NEXT: SectionData ( // CHECK-NEXT: 0000: 666F6F00 62617200 |foo.bar.| // CHECK-NEXT: ) @@ -36,7 +36,7 @@ // GC-NEXT: Link: 0 // GC-NEXT: Info: 0 // GC-NEXT: AddressAlignment: 1 -// GC-NEXT: EntrySize: 1 +// GC-NEXT: EntrySize: 0 // GC-NEXT: SectionData ( // GC-NEXT: 0000: 666F6F00 |foo.| // GC-NEXT: ) diff --git a/lld/test/ELF/linkerscript/merge-sections.s b/lld/test/ELF/linkerscript/merge-sections.s index b2c7cf2900d7..ae53ebc4d400 100644 --- a/lld/test/ELF/linkerscript/merge-sections.s +++ b/lld/test/ELF/linkerscript/merge-sections.s @@ -21,7 +21,7 @@ # CHECK-NEXT: Link: 0 # CHECK-NEXT: Info: 0 # CHECK-NEXT: AddressAlignment: 2 -# CHECK-NEXT: EntrySize: 1 +# CHECK-NEXT: EntrySize: 0 # CHECK-NEXT: } # CHECK: Name: begin diff --git a/lld/test/ELF/merge-string.s b/lld/test/ELF/merge-string.s index d730f42de9bf..9e59a9cd29e9 100644 --- a/lld/test/ELF/merge-string.s +++ b/lld/test/ELF/merge-string.s @@ -34,7 +34,7 @@ zed: // CHECK-NEXT: Link: 0 // CHECK-NEXT: Info: 0 // CHECK-NEXT: AddressAlignment: 1 -// CHECK-NEXT: EntrySize: 1 +// CHECK-NEXT: EntrySize: 0 // CHECK-NEXT: SectionData ( // CHECK-NEXT: 0000: 61626300 |abc.| // CHECK-NEXT: ) @@ -52,7 +52,7 @@ zed: // NOTAIL-NEXT: Link: 0 // NOTAIL-NEXT: Info: 0 // NOTAIL-NEXT: AddressAlignment: 1 -// NOTAIL-NEXT: EntrySize: 1 +// NOTAIL-NEXT: EntrySize: 0 // NOTAIL-NEXT: SectionData ( // NOTAIL-NEXT: 0000: 61626300 626300 |abc.bc.| // NOTAIL-NEXT: ) @@ -86,7 +86,7 @@ zed: // CHECK-NEXT: Link: 0 // CHECK-NEXT: Info: 0 // CHECK-NEXT: AddressAlignment: 2 -// CHECK-NEXT: EntrySize: 2 +// CHECK-NEXT: EntrySize: 0 // CHECK-NEXT: SectionData ( // CHECK-NEXT: 0000: 14000000 |....| // CHECK-NEXT: ) diff --git a/lld/test/ELF/merge.s b/lld/test/ELF/merge.s index b84d33a3411e..fba41346c536 100644 --- a/lld/test/ELF/merge.s +++ b/lld/test/ELF/merge.s @@ -29,7 +29,7 @@ zed: // CHECK-NEXT: Link: 0 // CHECK-NEXT: Info: 0 // CHECK-NEXT: AddressAlignment: 4 -// CHECK-NEXT: EntrySize: 4 +// CHECK-NEXT: EntrySize: 0 // CHECK-NEXT: SectionData ( // CHECK-NEXT: 0000: 10000000 42000000 // CHECK-NEXT: )