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
This commit is contained in:
Rafael Espindola 2017-02-03 21:29:51 +00:00
parent c1d820c0a7
commit 2532431332
17 changed files with 21 additions and 26 deletions

View File

@ -603,8 +603,6 @@ OutputSectionFactory<ELFT>::create(const SectionKey &Key,
if (C->kind() == InputSectionBase<ELFT>::EHFrame)
return {Out<ELFT>::EhFrame, false};
Sec = make<OutputSection<ELFT>>(Key.Name, Type, Flags);
if (Flags & SHF_MERGE)
Sec->Entsize = C->Entsize;
return {Sec, true};
}

View File

@ -1876,16 +1876,13 @@ MergeSyntheticSection<ELFT>::MergeSyntheticSection(StringRef Name,
uint32_t Type, uintX_t Flags,
uintX_t Alignment)
: SyntheticSection<ELFT>(Flags, Type, Alignment, Name),
Builder(StringTableBuilder::RAW, Alignment) {
this->Entsize = Alignment;
}
Builder(StringTableBuilder::RAW, Alignment) {}
template <class ELFT>
void MergeSyntheticSection<ELFT>::addSection(MergeInputSection<ELFT> *MS) {
assert(!Finalized);
MS->MergeSec = this;
Sections.push_back(MS);
this->Entsize = MS->Entsize;
}
template <class ELFT> void MergeSyntheticSection<ELFT>::writeTo(uint8_t *Buf) {

View File

@ -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

View File

@ -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

View File

@ -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: )

View File

@ -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

View File

@ -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

View File

@ -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: )

View File

@ -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.

View File

@ -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.|

View File

@ -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: )

View File

@ -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: )

View File

@ -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: )

View File

@ -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: )

View File

@ -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

View File

@ -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: )

View File

@ -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: )