<div dir="ltr">Thank you for doing this. The code to check for section size was the piece of code that I didn't really understand. I'm happy to see that's removed.</div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Nov 3, 2015 at 2:08 PM, Rafael Espindola via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: rafael<br>
Date: Tue Nov 3 16:08:08 2015<br>
New Revision: 251988<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=251988&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=251988&view=rev</a><br>
Log:<br>
Handle 0 sized sections like any other section.<br>
<br>
This is a case where there is inconsistency among ELF linkers:<br>
<br>
* The spec says nothing special about empty sections.<br>
* BFD ld removes them.<br>
* Gold handles them like regular sections.<br>
<br>
We were outputting them but sometimes ignoring them. This would create<br>
odd looking outputs where a rw section could be in a ro segment for example.<br>
<br>
The bfd way of doing things is also strange for the case where a symbol<br>
points to the empty section.<br>
<br>
Now we match gold and what seems to be the intention of the spec.<br>
<br>
Modified:<br>
lld/trunk/ELF/Writer.cpp<br>
lld/trunk/test/elf2/basic-mips.s<br>
lld/trunk/test/elf2/discard-locals.s<br>
lld/trunk/test/elf2/discard-none.s<br>
lld/trunk/test/elf2/emulation.s<br>
lld/trunk/test/elf2/gnu-hash-table.s<br>
lld/trunk/test/elf2/local-dynamic.s<br>
lld/trunk/test/elf2/local.s<br>
lld/trunk/test/elf2/merge-string-align.s<br>
lld/trunk/test/elf2/merge-string.s<br>
lld/trunk/test/elf2/merge-sym.s<br>
lld/trunk/test/elf2/program-header-layout.s<br>
lld/trunk/test/elf2/string-table.s<br>
<br>
Modified: lld/trunk/ELF/Writer.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Writer.cpp?rev=251988&r1=251987&r2=251988&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Writer.cpp?rev=251988&r1=251987&r2=251988&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/ELF/Writer.cpp (original)<br>
+++ lld/trunk/ELF/Writer.cpp Tue Nov 3 16:08:08 2015<br>
@@ -698,27 +698,24 @@ template <class ELFT> void Writer<ELFT>:<br>
// Create phdrs as we assign VAs and file offsets to all output sections.<br>
SmallPtrSet<Elf_Phdr *, 8> Closed;<br>
for (OutputSectionBase<ELFT> *Sec : OutputSections) {<br>
- if (Sec->getSize()) {<br>
- uintX_t Flags = toPhdrFlags(Sec->getFlags());<br>
- Elf_Phdr *Last = &Phdrs[PhdrIdx];<br>
- if (Last->p_flags != Flags || !needsPhdr<ELFT>(Sec)) {<br>
- // Flags changed. End current Phdr and potentially create a new one.<br>
- if (Closed.insert(Last).second) {<br>
- Last->p_filesz = FileOff - Last->p_offset;<br>
- Last->p_memsz = VA - Last->p_vaddr;<br>
- }<br>
-<br>
- if (needsPhdr<ELFT>(Sec)) {<br>
- VA = RoundUpToAlignment(VA, Target->getPageSize());<br>
- FileOff = RoundUpToAlignment(FileOff, Target->getPageSize());<br>
- Elf_Phdr *PH = &Phdrs[++PhdrIdx];<br>
- setPhdr(PH, PT_LOAD, Flags, FileOff, VA, 0, Target->getPageSize());<br>
- }<br>
+ uintX_t Flags = toPhdrFlags(Sec->getFlags());<br>
+ Elf_Phdr *Last = &Phdrs[PhdrIdx];<br>
+ if (Last->p_flags != Flags || !needsPhdr<ELFT>(Sec)) {<br>
+ // Flags changed. End current Phdr and potentially create a new one.<br>
+ if (Closed.insert(Last).second) {<br>
+ Last->p_filesz = FileOff - Last->p_offset;<br>
+ Last->p_memsz = VA - Last->p_vaddr;<br>
+ }<br>
+<br>
+ if (needsPhdr<ELFT>(Sec)) {<br>
+ VA = RoundUpToAlignment(VA, Target->getPageSize());<br>
+ FileOff = RoundUpToAlignment(FileOff, Target->getPageSize());<br>
+ Elf_Phdr *PH = &Phdrs[++PhdrIdx];<br>
+ setPhdr(PH, PT_LOAD, Flags, FileOff, VA, 0, Target->getPageSize());<br>
}<br>
}<br>
<br>
- if (Sec->getSize() && (Sec->getFlags() & SHF_ALLOC) &&<br>
- (Sec->getFlags() & SHF_TLS)) {<br>
+ if ((Sec->getFlags() & SHF_ALLOC) && (Sec->getFlags() & SHF_TLS)) {<br>
if (!TlsPhdr.p_vaddr)<br>
setPhdr(&TlsPhdr, PT_TLS, PF_R, FileOff, VA, 0, Sec->getAlign());<br>
if (Sec->getType() != SHT_NOBITS)<br>
@@ -776,7 +773,7 @@ template <class ELFT> int Writer<ELFT>::<br>
++I;<br>
uintX_t Last = PF_R;<br>
for (OutputSectionBase<ELFT> *Sec : OutputSections) {<br>
- if (!Sec->getSize() || !needsPhdr<ELFT>(Sec))<br>
+ if (!needsPhdr<ELFT>(Sec))<br>
continue;<br>
if (Sec->getFlags() & SHF_TLS)<br>
Tls = true;<br>
<br>
Modified: lld/trunk/test/elf2/basic-mips.s<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf2/basic-mips.s?rev=251988&r1=251987&r2=251988&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf2/basic-mips.s?rev=251988&r1=251987&r2=251988&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/test/elf2/basic-mips.s (original)<br>
+++ lld/trunk/test/elf2/basic-mips.s Tue Nov 3 16:08:08 2015<br>
@@ -27,12 +27,12 @@ __start:<br>
# CHECK-NEXT: Version: 1<br>
# CHECK-NEXT: Entry: 0x20000<br>
# CHECK-NEXT: ProgramHeaderOffset: 0x34<br>
-# CHECK-NEXT: SectionHeaderOffset: 0x10080<br>
+# CHECK-NEXT: SectionHeaderOffset: 0x20070<br>
# CHECK-NEXT: Flags [ (0x0)<br>
# CHECK-NEXT: ]<br>
# CHECK-NEXT: HeaderSize: 52<br>
# CHECK-NEXT: ProgramHeaderEntrySize: 32<br>
-# CHECK-NEXT: ProgramHeaderCount: 3<br>
+# CHECK-NEXT: ProgramHeaderCount: 4<br>
# CHECK-NEXT: SectionHeaderEntrySize: 40<br>
# CHECK-NEXT: SectionHeaderCount: 9<br>
# CHECK-NEXT: StringTableSectionIndex: 7<br>
@@ -59,8 +59,8 @@ __start:<br>
# CHECK-NEXT: Flags [ (0x2)<br>
# CHECK-NEXT: SHF_ALLOC (0x2)<br>
# CHECK-NEXT: ]<br>
-# CHECK-NEXT: Address: 0x10094<br>
-# CHECK-NEXT: Offset: 0x94<br>
+# CHECK-NEXT: Address: 0x100B4<br>
+# CHECK-NEXT: Offset: 0xB4<br>
# CHECK-NEXT: Size: 24<br>
# CHECK-NEXT: Link: 0<br>
# CHECK-NEXT: Info: 0<br>
@@ -74,8 +74,8 @@ __start:<br>
# CHECK-NEXT: Flags [ (0x2)<br>
# CHECK-NEXT: SHF_ALLOC (0x2)<br>
# CHECK-NEXT: ]<br>
-# CHECK-NEXT: Address: 0x100B0<br>
-# CHECK-NEXT: Offset: 0xB0<br>
+# CHECK-NEXT: Address: 0x100D0<br>
+# CHECK-NEXT: Offset: 0xD0<br>
# CHECK-NEXT: Size: 24<br>
# CHECK-NEXT: Link: 0<br>
# CHECK-NEXT: Info: 0<br>
@@ -106,8 +106,8 @@ __start:<br>
# CHECK-NEXT: SHF_ALLOC (0x2)<br>
# CHECK-NEXT: SHF_WRITE (0x1)<br>
# CHECK-NEXT: ]<br>
-# CHECK-NEXT: Address: 0x20010<br>
-# CHECK-NEXT: Offset: 0x10010<br>
+# CHECK-NEXT: Address: 0x30000<br>
+# CHECK-NEXT: Offset: 0x20000<br>
# CHECK-NEXT: Size: 0<br>
# CHECK-NEXT: Link: 0<br>
# CHECK-NEXT: Info: 0<br>
@@ -122,8 +122,8 @@ __start:<br>
# CHECK-NEXT: SHF_ALLOC (0x2)<br>
# CHECK-NEXT: SHF_WRITE (0x1)<br>
# CHECK-NEXT: ]<br>
-# CHECK-NEXT: Address: 0x20010<br>
-# CHECK-NEXT: Offset: 0x10010<br>
+# CHECK-NEXT: Address: 0x30000<br>
+# CHECK-NEXT: Offset: 0x20000<br>
# CHECK-NEXT: Size: 0<br>
# CHECK-NEXT: Link: 0<br>
# CHECK-NEXT: Info: 0<br>
@@ -137,7 +137,7 @@ __start:<br>
# CHECK-NEXT: Flags [ (0x0)<br>
# CHECK-NEXT: ]<br>
# CHECK-NEXT: Address: 0x0<br>
-# CHECK-NEXT: Offset: 0x10010<br>
+# CHECK-NEXT: Offset: 0x20000<br>
# CHECK-NEXT: Size: 32<br>
# CHECK-NEXT: Link: 8<br>
# CHECK-NEXT: Info: 1<br>
@@ -151,7 +151,7 @@ __start:<br>
# CHECK-NEXT: Flags [ (0x0)<br>
# CHECK-NEXT: ]<br>
# CHECK-NEXT: Address: 0x0<br>
-# CHECK-NEXT: Offset: 0x10030<br>
+# CHECK-NEXT: Offset: 0x20020<br>
# CHECK-NEXT: Size: 68<br>
# CHECK-NEXT: Link: 0<br>
# CHECK-NEXT: Info: 0<br>
@@ -165,7 +165,7 @@ __start:<br>
# CHECK-NEXT: Flags [ (0x0)<br>
# CHECK-NEXT: ]<br>
# CHECK-NEXT: Address: 0x0<br>
-# CHECK-NEXT: Offset: 0x10074<br>
+# CHECK-NEXT: Offset: 0x20064<br>
# CHECK-NEXT: Size: 9<br>
# CHECK-NEXT: Link: 0<br>
# CHECK-NEXT: Info: 0<br>
@@ -199,8 +199,8 @@ __start:<br>
# CHECK-NEXT: Offset: 0x34<br>
# CHECK-NEXT: VirtualAddress: 0x10034<br>
# CHECK-NEXT: PhysicalAddress: 0x10034<br>
-# CHECK-NEXT: FileSize: 96<br>
-# CHECK-NEXT: MemSize: 96<br>
+# CHECK-NEXT: FileSize: 128<br>
+# CHECK-NEXT: MemSize: 128<br>
# CHECK-NEXT: Flags [ (0x4)<br>
# CHECK-NEXT: PF_R (0x4)<br>
# CHECK-NEXT: ]<br>
@@ -211,8 +211,8 @@ __start:<br>
# CHECK-NEXT: Offset: 0x0<br>
# CHECK-NEXT: VirtualAddress: 0x10000<br>
# CHECK-NEXT: PhysicalAddress: 0x10000<br>
-# CHECK-NEXT: FileSize: 200<br>
-# CHECK-NEXT: MemSize: 200<br>
+# CHECK-NEXT: FileSize: 232<br>
+# CHECK-NEXT: MemSize: 232<br>
# CHECK-NEXT: Flags [ (0x4)<br>
# CHECK-NEXT: PF_R (0x4)<br>
# CHECK-NEXT: ]<br>
@@ -223,12 +223,25 @@ __start:<br>
# CHECK-NEXT: Offset: 0x10000<br>
# CHECK-NEXT: VirtualAddress: 0x20000<br>
# CHECK-NEXT: PhysicalAddress: 0x20000<br>
-# CHECK-NEXT: FileSize: 16<br>
-# CHECK-NEXT: MemSize: 16<br>
+# CHECK-NEXT: FileSize: 12<br>
+# CHECK-NEXT: MemSize: 12<br>
# CHECK-NEXT: Flags [ (0x5)<br>
# CHECK-NEXT: PF_R (0x4)<br>
# CHECK-NEXT: PF_X (0x1)<br>
# CHECK-NEXT: ]<br>
# CHECK-NEXT: Alignment: 65536<br>
# CHECK-NEXT: }<br>
+# CHECK-NEXT: ProgramHeader {<br>
+# CHECK-NEXT: Type: PT_LOAD (0x1)<br>
+# CHECK-NEXT: Offset: 0x20000<br>
+# CHECK-NEXT: VirtualAddress: 0x30000<br>
+# CHECK-NEXT: PhysicalAddress: 0x30000<br>
+# CHECK-NEXT: FileSize: 0<br>
+# CHECK-NEXT: MemSize: 0<br>
+# CHECK-NEXT: Flags [<br>
+# CHECK-NEXT: PF_R<br>
+# CHECK-NEXT: PF_W<br>
+# CHECK-NEXT: ]<br>
+# CHECK-NEXT: Alignment: 65536<br>
+# CHECK-NEXT: }<br>
# CHECK-NEXT: ]<br>
<br>
Modified: lld/trunk/test/elf2/discard-locals.s<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf2/discard-locals.s?rev=251988&r1=251987&r2=251988&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf2/discard-locals.s?rev=251988&r1=251987&r2=251988&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/test/elf2/discard-locals.s (original)<br>
+++ lld/trunk/test/elf2/discard-locals.s Tue Nov 3 16:08:08 2015<br>
@@ -40,7 +40,7 @@ _start:<br>
// CHECK-NEXT: }<br>
// CHECK-NEXT: Symbol {<br>
// CHECK-NEXT: Name: _start<br>
-// CHECK-NEXT: Value: 0x100B0<br>
+// CHECK-NEXT: Value: 0x11000<br>
// CHECK-NEXT: Size: 0<br>
// CHECK-NEXT: Binding: Global<br>
// CHECK-NEXT: Type: None<br>
<br>
Modified: lld/trunk/test/elf2/discard-none.s<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf2/discard-none.s?rev=251988&r1=251987&r2=251988&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf2/discard-none.s?rev=251988&r1=251987&r2=251988&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/test/elf2/discard-none.s (original)<br>
+++ lld/trunk/test/elf2/discard-none.s Tue Nov 3 16:08:08 2015<br>
@@ -36,7 +36,7 @@<br>
// CHECK-NEXT: }<br>
// CHECK-NEXT: Symbol {<br>
// CHECK-NEXT: Name: .Lmyothervar<br>
-// CHECK-NEXT: Value: 0x14C<br>
+// CHECK-NEXT: Value: 0x1000<br>
// CHECK-NEXT: Size: 0<br>
// CHECK-NEXT: Binding: Local<br>
// CHECK-NEXT: Type: None<br>
@@ -45,7 +45,7 @@<br>
// CHECK-NEXT: }<br>
// CHECK-NEXT: Symbol {<br>
// CHECK-NEXT: Name: .Lmyvar<br>
-// CHECK-NEXT: Value: 0x14C<br>
+// CHECK-NEXT: Value: 0x1000<br>
// CHECK-NEXT: Size: 0<br>
// CHECK-NEXT: Binding: Local<br>
// CHECK-NEXT: Type: None<br>
<br>
Modified: lld/trunk/test/elf2/emulation.s<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf2/emulation.s?rev=251988&r1=251987&r2=251988&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf2/emulation.s?rev=251988&r1=251987&r2=251988&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/test/elf2/emulation.s (original)<br>
+++ lld/trunk/test/elf2/emulation.s Tue Nov 3 16:08:08 2015<br>
@@ -16,14 +16,14 @@<br>
# X86-64-NEXT: Type: Executable (0x2)<br>
# X86-64-NEXT: Machine: EM_X86_64 (0x3E)<br>
# X86-64-NEXT: Version: 1<br>
-# X86-64-NEXT: Entry: 0x100B0<br>
+# X86-64-NEXT: Entry:<br>
# X86-64-NEXT: ProgramHeaderOffset: 0x40<br>
# X86-64-NEXT: SectionHeaderOffset:<br>
# X86-64-NEXT: Flags [ (0x0)<br>
# X86-64-NEXT: ]<br>
# X86-64-NEXT: HeaderSize: 64<br>
# X86-64-NEXT: ProgramHeaderEntrySize: 56<br>
-# X86-64-NEXT: ProgramHeaderCount: 2<br>
+# X86-64-NEXT: ProgramHeaderCount:<br>
# X86-64-NEXT: SectionHeaderEntrySize: 64<br>
# X86-64-NEXT: SectionHeaderCount:<br>
# X86-64-NEXT: StringTableSectionIndex:<br>
@@ -47,14 +47,14 @@<br>
# X86-NEXT: Type: Executable (0x2)<br>
# X86-NEXT: Machine: EM_386 (0x3)<br>
# X86-NEXT: Version: 1<br>
-# X86-NEXT: Entry: 0x10074<br>
+# X86-NEXT: Entry:<br>
# X86-NEXT: ProgramHeaderOffset: 0x34<br>
# X86-NEXT: SectionHeaderOffset:<br>
# X86-NEXT: Flags [ (0x0)<br>
# X86-NEXT: ]<br>
# X86-NEXT: HeaderSize: 52<br>
# X86-NEXT: ProgramHeaderEntrySize: 32<br>
-# X86-NEXT: ProgramHeaderCount: 2<br>
+# X86-NEXT: ProgramHeaderCount:<br>
# X86-NEXT: SectionHeaderEntrySize: 40<br>
# X86-NEXT: SectionHeaderCount:<br>
# X86-NEXT: StringTableSectionIndex:<br>
@@ -78,14 +78,14 @@<br>
# PPC64-NEXT: Type: Executable (0x2)<br>
# PPC64-NEXT: Machine: EM_PPC64 (0x15)<br>
# PPC64-NEXT: Version: 1<br>
-# PPC64-NEXT: Entry: 0x100000B0<br>
+# PPC64-NEXT: Entry:<br>
# PPC64-NEXT: ProgramHeaderOffset: 0x40<br>
# PPC64-NEXT: SectionHeaderOffset:<br>
# PPC64-NEXT: Flags [ (0x0)<br>
# PPC64-NEXT: ]<br>
# PPC64-NEXT: HeaderSize: 64<br>
# PPC64-NEXT: ProgramHeaderEntrySize: 56<br>
-# PPC64-NEXT: ProgramHeaderCount: 2<br>
+# PPC64-NEXT: ProgramHeaderCount:<br>
# PPC64-NEXT: SectionHeaderEntrySize: 64<br>
# PPC64-NEXT: SectionHeaderCount:<br>
# PPC64-NEXT: StringTableSectionIndex:<br>
@@ -109,9 +109,9 @@<br>
# MIPS-NEXT: Type: Executable (0x2)<br>
# MIPS-NEXT: Machine: EM_MIPS (0x8)<br>
# MIPS-NEXT: Version: 1<br>
-# MIPS-NEXT: Entry: 0x100B0<br>
+# MIPS-NEXT: Entry:<br>
# MIPS-NEXT: ProgramHeaderOffset: 0x34<br>
-# MIPS-NEXT: SectionHeaderOffset: 0x11C<br>
+# MIPS-NEXT: SectionHeaderOffset:<br>
# MIPS-NEXT: Flags [ (0x0)<br>
# MIPS-NEXT: ]<br>
<br>
@@ -135,9 +135,9 @@<br>
# MIPSEL-NEXT: Type: Executable (0x2)<br>
# MIPSEL-NEXT: Machine: EM_MIPS (0x8)<br>
# MIPSEL-NEXT: Version: 1<br>
-# MIPSEL-NEXT: Entry: 0x100B0<br>
+# MIPSEL-NEXT: Entry:<br>
# MIPSEL-NEXT: ProgramHeaderOffset: 0x34<br>
-# MIPSEL-NEXT: SectionHeaderOffset: 0x11C<br>
+# MIPSEL-NEXT: SectionHeaderOffset:<br>
# MIPSEL-NEXT: Flags [ (0x0)<br>
# MIPSEL-NEXT: ]<br>
<br>
<br>
Modified: lld/trunk/test/elf2/gnu-hash-table.s<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf2/gnu-hash-table.s?rev=251988&r1=251987&r2=251988&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf2/gnu-hash-table.s?rev=251988&r1=251987&r2=251988&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/test/elf2/gnu-hash-table.s (original)<br>
+++ lld/trunk/test/elf2/gnu-hash-table.s Tue Nov 3 16:08:08 2015<br>
@@ -149,8 +149,8 @@<br>
# PPC64-NEXT: Flags [<br>
# PPC64-NEXT: SHF_ALLOC<br>
# PPC64-NEXT: ]<br>
-# PPC64-NEXT: Address: 0x180<br>
-# PPC64-NEXT: Offset: 0x180<br>
+# PPC64-NEXT: Address: 0x1B8<br>
+# PPC64-NEXT: Offset: 0x1B8<br>
# PPC64-NEXT: Size: 36<br>
# PPC64-NEXT: Link: 1<br>
# PPC64-NEXT: Info: 0<br>
<br>
Modified: lld/trunk/test/elf2/local-dynamic.s<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf2/local-dynamic.s?rev=251988&r1=251987&r2=251988&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf2/local-dynamic.s?rev=251988&r1=251987&r2=251988&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/test/elf2/local-dynamic.s (original)<br>
+++ lld/trunk/test/elf2/local-dynamic.s Tue Nov 3 16:08:08 2015<br>
@@ -16,7 +16,7 @@<br>
// CHECK-NEXT: }<br>
// CHECK-NEXT: Symbol {<br>
// CHECK-NEXT: Name: blah<br>
-// CHECK-NEXT: Value: 0x170<br>
+// CHECK-NEXT: Value: 0x1000<br>
// CHECK-NEXT: Size: 0<br>
// CHECK-NEXT: Binding: Local<br>
// CHECK-NEXT: Type: None<br>
@@ -25,7 +25,7 @@<br>
// CHECK-NEXT: }<br>
// CHECK-NEXT: Symbol {<br>
// CHECK-NEXT: Name: foo<br>
-// CHECK-NEXT: Value: 0x170<br>
+// CHECK-NEXT: Value: 0x1000<br>
// CHECK-NEXT: Size: 0<br>
// CHECK-NEXT: Binding: Local<br>
// CHECK-NEXT: Type: None<br>
@@ -34,7 +34,7 @@<br>
// CHECK-NEXT: }<br>
// CHECK-NEXT: Symbol {<br>
// CHECK-NEXT: Name: goo<br>
-// CHECK-NEXT: Value: 0x170<br>
+// CHECK-NEXT: Value: 0x1000<br>
// CHECK-NEXT: Size: 0<br>
// CHECK-NEXT: Binding: Local<br>
// CHECK-NEXT: Type: None<br>
@@ -43,7 +43,7 @@<br>
// CHECK-NEXT: }<br>
// CHECK-NEXT: Symbol {<br>
// CHECK-NEXT: Name: _start<br>
-// CHECK-NEXT: Value: 0x170<br>
+// CHECK-NEXT: Value: 0x1000<br>
// CHECK-NEXT: Size: 0<br>
// CHECK-NEXT: Binding: Global<br>
// CHECK-NEXT: Type: None<br>
@@ -64,7 +64,7 @@<br>
// CHECK-NEXT: }<br>
// CHECK-NEXT: Symbol {<br>
// CHECK-NEXT: Name: _start@<br>
-// CHECK-NEXT: Value: 0x170<br>
+// CHECK-NEXT: Value: 0x1000<br>
// CHECK-NEXT: Size: 0<br>
// CHECK-NEXT: Binding: Global<br>
// CHECK-NEXT: Type: None<br>
<br>
Modified: lld/trunk/test/elf2/local.s<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf2/local.s?rev=251988&r1=251987&r2=251988&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf2/local.s?rev=251988&r1=251987&r2=251988&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/test/elf2/local.s (original)<br>
+++ lld/trunk/test/elf2/local.s Tue Nov 3 16:08:08 2015<br>
@@ -37,7 +37,7 @@<br>
// CHECK-NEXT: }<br>
// CHECK-NEXT: Symbol {<br>
// CHECK-NEXT: Name: blah<br>
-// CHECK-NEXT: Value: 0x100B0<br>
+// CHECK-NEXT: Value: 0x11000<br>
// CHECK-NEXT: Size: 0<br>
// CHECK-NEXT: Binding: Local<br>
// CHECK-NEXT: Type: None<br>
@@ -46,7 +46,7 @@<br>
// CHECK-NEXT: }<br>
// CHECK-NEXT: Symbol {<br>
// CHECK-NEXT: Name: foo<br>
-// CHECK-NEXT: Value: 0x100B0<br>
+// CHECK-NEXT: Value: 0x11000<br>
// CHECK-NEXT: Size: 0<br>
// CHECK-NEXT: Binding: Local<br>
// CHECK-NEXT: Type: None<br>
@@ -55,7 +55,7 @@<br>
// CHECK-NEXT: }<br>
// CHECK-NEXT: Symbol {<br>
// CHECK-NEXT: Name: goo<br>
-// CHECK-NEXT: Value: 0x100B0<br>
+// CHECK-NEXT: Value: 0x11000<br>
// CHECK-NEXT: Size: 0<br>
// CHECK-NEXT: Binding: Local<br>
// CHECK-NEXT: Type: None<br>
@@ -64,7 +64,7 @@<br>
// CHECK-NEXT: }<br>
// CHECK-NEXT: Symbol {<br>
// CHECK-NEXT: Name: _start<br>
-// CHECK-NEXT: Value: 0x100B0<br>
+// CHECK-NEXT: Value: 0x11000<br>
// CHECK-NEXT: Size: 0<br>
// CHECK-NEXT: Binding: Global<br>
// CHECK-NEXT: Type: None<br>
<br>
Modified: lld/trunk/test/elf2/merge-string-align.s<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf2/merge-string-align.s?rev=251988&r1=251987&r2=251988&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf2/merge-string-align.s?rev=251988&r1=251987&r2=251988&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/test/elf2/merge-string-align.s (original)<br>
+++ lld/trunk/test/elf2/merge-string-align.s Tue Nov 3 16:08:08 2015<br>
@@ -17,8 +17,8 @@<br>
// CHECK-NEXT: SHF_MERGE<br>
// CHECK-NEXT: SHF_STRINGS<br>
// CHECK-NEXT: ]<br>
-// CHECK-NEXT: Address: 0x120<br>
-// CHECK-NEXT: Offset: 0x120<br>
+// CHECK-NEXT: Address:<br>
+// CHECK-NEXT: Offset:<br>
// CHECK-NEXT: Size: 4<br>
// CHECK-NEXT: Link: 0<br>
// CHECK-NEXT: Info: 0<br>
@@ -31,8 +31,8 @@<br>
// CHECK-NEXT: SHF_MERGE<br>
// CHECK-NEXT: SHF_STRINGS<br>
// CHECK-NEXT: ]<br>
-// CHECK-NEXT: Address: 0x124<br>
-// CHECK-NEXT: Offset: 0x124<br>
+// CHECK-NEXT: Address:<br>
+// CHECK-NEXT: Offset:<br>
// CHECK-NEXT: Size: 4<br>
// CHECK-NEXT: Link: 0<br>
// CHECK-NEXT: Info: 0<br>
<br>
Modified: lld/trunk/test/elf2/merge-string.s<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf2/merge-string.s?rev=251988&r1=251987&r2=251988&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf2/merge-string.s?rev=251988&r1=251987&r2=251988&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/test/elf2/merge-string.s (original)<br>
+++ lld/trunk/test/elf2/merge-string.s Tue Nov 3 16:08:08 2015<br>
@@ -26,8 +26,8 @@ zed:<br>
// CHECK-NEXT: SHF_MERGE<br>
// CHECK-NEXT: SHF_STRINGS<br>
// CHECK-NEXT: ]<br>
-// CHECK-NEXT: Address: 0x120<br>
-// CHECK-NEXT: Offset: 0x120<br>
+// CHECK-NEXT: Address: 0x158<br>
+// CHECK-NEXT: Offset: 0x158<br>
// CHECK-NEXT: Size: 4<br>
// CHECK-NEXT: Link: 0<br>
// CHECK-NEXT: Info: 0<br>
@@ -44,8 +44,8 @@ zed:<br>
// NOTAIL-NEXT: SHF_MERGE<br>
// NOTAIL-NEXT: SHF_STRINGS<br>
// NOTAIL-NEXT: ]<br>
-// NOTAIL-NEXT: Address: 0x120<br>
-// NOTAIL-NEXT: Offset: 0x120<br>
+// NOTAIL-NEXT: Address: 0x158<br>
+// NOTAIL-NEXT: Offset: 0x158<br>
// NOTAIL-NEXT: Size: 7<br>
// NOTAIL-NEXT: Link: 0<br>
// NOTAIL-NEXT: Info: 0<br>
@@ -62,8 +62,8 @@ zed:<br>
// CHECK-NEXT: SHF_MERGE<br>
// CHECK-NEXT: SHF_STRINGS<br>
// CHECK-NEXT: ]<br>
-// CHECK-NEXT: Address: 0x124<br>
-// CHECK-NEXT: Offset: 0x124<br>
+// CHECK-NEXT: Address: 0x15C<br>
+// CHECK-NEXT: Offset: 0x15C<br>
// CHECK-NEXT: Size: 4<br>
// CHECK-NEXT: Link: 0<br>
// CHECK-NEXT: Info: 0<br>
@@ -75,11 +75,11 @@ zed:<br>
<br>
<br>
// CHECK: Name: bar<br>
-// CHECK-NEXT: Value: 0x121<br>
+// CHECK-NEXT: Value: 0x159<br>
<br>
// CHECK: Name: foo<br>
-// CHECK-NEXT: Value: 0x120<br>
+// CHECK-NEXT: Value: 0x158<br>
<br>
// CHECK: Name: zed<br>
-// CHECK-NEXT: Value: 0x124<br>
+// CHECK-NEXT: Value: 0x15C<br>
// CHECK-NEXT: Size: 0<br>
<br>
Modified: lld/trunk/test/elf2/merge-sym.s<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf2/merge-sym.s?rev=251988&r1=251987&r2=251988&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf2/merge-sym.s?rev=251988&r1=251987&r2=251988&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/test/elf2/merge-sym.s (original)<br>
+++ lld/trunk/test/elf2/merge-sym.s Tue Nov 3 16:08:08 2015<br>
@@ -15,7 +15,7 @@ foo:<br>
// CHECK-NEXT: SHF_ALLOC<br>
// CHECK-NEXT: SHF_MERGE<br>
// CHECK-NEXT: ]<br>
-// CHECK-NEXT: Address: 0x120<br>
+// CHECK-NEXT: Address: 0x158<br>
<br>
// CHECK: Name: foo<br>
-// CHECK-NEXT: Value: 0x122<br>
+// CHECK-NEXT: Value: 0x15A<br>
<br>
Modified: lld/trunk/test/elf2/program-header-layout.s<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf2/program-header-layout.s?rev=251988&r1=251987&r2=251988&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf2/program-header-layout.s?rev=251988&r1=251987&r2=251988&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/test/elf2/program-header-layout.s (original)<br>
+++ lld/trunk/test/elf2/program-header-layout.s Tue Nov 3 16:08:08 2015<br>
@@ -23,7 +23,7 @@ _start:<br>
# CHECK-NEXT: SHF_ALLOC<br>
# CHECK-NEXT: ]<br>
# CHECK-NEXT: Address:<br>
-# CHECK-NEXT: Offset: 0xE8<br>
+# CHECK-NEXT: Offset: 0x120<br>
# CHECK-NEXT: Size:<br>
# CHECK-NEXT: Link:<br>
# CHECK-NEXT: Info:<br>
@@ -37,8 +37,8 @@ _start:<br>
# CHECK-NEXT: Offset: 0x40<br>
# CHECK-NEXT: VirtualAddress: 0x10040<br>
# CHECK-NEXT: PhysicalAddress: 0x10040<br>
-# CHECK-NEXT: FileSize: 168<br>
-# CHECK-NEXT: MemSize: 168<br>
+# CHECK-NEXT: FileSize: 224<br>
+# CHECK-NEXT: MemSize: 224<br>
# CHECK-NEXT: Flags [ (0x4)<br>
# CHECK-NEXT: PF_R (0x4)<br>
# CHECK-NEXT: ]<br>
@@ -49,13 +49,26 @@ _start:<br>
# CHECK-NEXT: Offset: 0x0<br>
# CHECK-NEXT: VirtualAddress:<br>
# CHECK-NEXT: PhysicalAddress:<br>
-# CHECK-NEXT: FileSize: 240<br>
-# CHECK-NEXT: MemSize: 240<br>
+# CHECK-NEXT: FileSize: 296<br>
+# CHECK-NEXT: MemSize: 296<br>
# CHECK-NEXT: Flags [<br>
# CHECK-NEXT: PF_R<br>
# CHECK-NEXT: ]<br>
# CHECK-NEXT: Alignment:<br>
# CHECK-NEXT: }<br>
+# CHECK-NEXT: ProgramHeader {<br>
+# CHECK-NEXT: Type: PT_LOAD<br>
+# CHECK-NEXT: Offset:<br>
+# CHECK-NEXT: VirtualAddress:<br>
+# CHECK-NEXT: PhysicalAddress:<br>
+# CHECK-NEXT: FileSize: 0<br>
+# CHECK-NEXT: MemSize: 0<br>
+# CHECK-NEXT: Flags [<br>
+# CHECK-NEXT: PF_R<br>
+# CHECK-NEXT: PF_X<br>
+# CHECK-NEXT: ]<br>
+# CHECK-NEXT: Alignment:<br>
+# CHECK-NEXT: }<br>
# CHECK-NEXT: ProgramHeader {<br>
# CHECK-NEXT: Type: PT_LOAD<br>
# CHECK-NEXT: Offset:<br>
<br>
Modified: lld/trunk/test/elf2/string-table.s<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf2/string-table.s?rev=251988&r1=251987&r2=251988&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf2/string-table.s?rev=251988&r1=251987&r2=251988&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/test/elf2/string-table.s (original)<br>
+++ lld/trunk/test/elf2/string-table.s Tue Nov 3 16:08:08 2015<br>
@@ -19,7 +19,7 @@ _start:<br>
// CHECK-NEXT: Flags [<br>
// CHECK-NEXT: SHF_ALLOC<br>
// CHECK-NEXT: ]<br>
-// CHECK-NEXT: Address: 0x100B0<br>
+// CHECK-NEXT: Address: 0x100E8<br>
<br>
// CHECK: Name: foobar<br>
// CHECK-NEXT: Type: SHT_PROGBITS<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div>