[lld] r329307 - Initialize OutputOff to zero.
Rafael Espindola via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 5 08:56:05 PDT 2018
Author: rafael
Date: Thu Apr 5 08:56:04 2018
New Revision: 329307
URL: http://llvm.org/viewvc/llvm-project?rev=329307&view=rev
Log:
Initialize OutputOff to zero.
We have a dedicated Live bit, so we don't need a special value and we
were not accounting for in at least one place.
Modified:
lld/trunk/ELF/InputSection.h
lld/trunk/test/ELF/merge-gc-piece.s
Modified: lld/trunk/ELF/InputSection.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputSection.h?rev=329307&r1=329306&r2=329307&view=diff
==============================================================================
--- lld/trunk/ELF/InputSection.h (original)
+++ lld/trunk/ELF/InputSection.h Thu Apr 5 08:56:04 2018
@@ -200,7 +200,7 @@ private:
// be found by looking at the next one).
struct SectionPiece {
SectionPiece(size_t Off, uint32_t Hash, bool Live)
- : InputOff(Off), Hash(Hash), OutputOff(-1),
+ : InputOff(Off), Hash(Hash), OutputOff(0),
Live(Live || !Config->GcSections) {}
uint32_t InputOff;
Modified: lld/trunk/test/ELF/merge-gc-piece.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/merge-gc-piece.s?rev=329307&r1=329306&r2=329307&view=diff
==============================================================================
--- lld/trunk/test/ELF/merge-gc-piece.s (original)
+++ lld/trunk/test/ELF/merge-gc-piece.s Thu Apr 5 08:56:04 2018
@@ -3,6 +3,15 @@
# RUN: ld.lld %t.o -o %t.so -shared --gc-sections
# RUN: llvm-readobj -s -section-data %t.so | FileCheck %s
+
+# CHECK: Name: .foo
+# CHECK-NEXT: Type: SHT_PROGBITS
+# CHECK-NEXT: Flags [
+# CHECK-NEXT: SHF_ALLOC
+# CHECK-NEXT: SHF_MERGE
+# CHECK-NEXT: ]
+# CHECK-NEXT: Address: 0x190
+
# CHECK: Name: .bar
# CHECK-NEXT: Type: SHT_PROGBITS
# CHECK-NEXT: Flags [
@@ -15,7 +24,7 @@
# CHECK-NEXT: AddressAlignment:
# CHECK-NEXT: EntrySize:
# CHECK-NEXT: SectionData (
-# CHECK-NEXT: 0000: 90010000 00000000 91010000 00000000
+# CHECK-NEXT: 0000: 91010000 00000000 92010000 00000000
# CHECK-NEXT: )
.section .foo,"aM", at progbits,8
More information about the llvm-commits
mailing list