[lld] r332038 - Mitigate relocation overflow [part 1 of 2].
Han Shen via llvm-commits
llvm-commits at lists.llvm.org
Thu May 10 13:44:42 PDT 2018
Author: shenhan
Date: Thu May 10 13:44:42 2018
New Revision: 332038
URL: http://llvm.org/viewvc/llvm-project?rev=332038&view=rev
Log:
Mitigate relocation overflow [part 1 of 2].
This CL is to mitigate R_X86_64_PC32 relocation overflow problems for huge binaries that has near 4G allocated sections.
By examining those binaries, there're 2 issues contributes to the problem:
1). huge ".dynsym" and ".dynstr" stands in the way between .rodata and .text
2). _init_array_start/end are placed at 0 if no ".init_array" presents, this causes .text relocation against them become more prone to overflow.
This CL addresses 1st problem (the 2nd will be addressed in another CL.) by assigning a smaller sortrank to .dynsym and .dynstr thus they no longer stand in between.
Added:
lld/trunk/test/ELF/dynsec-at-beginning.s
Modified:
lld/trunk/ELF/Writer.cpp
lld/trunk/test/ELF/aarch64-copy.s
lld/trunk/test/ELF/aarch64-thunk-pi.s
lld/trunk/test/ELF/arm-copy.s
lld/trunk/test/ELF/arm-execute-only.s
lld/trunk/test/ELF/arm-exidx-shared.s
lld/trunk/test/ELF/basic-ppc.s
lld/trunk/test/ELF/basic-ppc64.s
lld/trunk/test/ELF/dynamic-no-rosegment.s
lld/trunk/test/ELF/eh-frame-padding-no-rosegment.s
lld/trunk/test/ELF/gc-merge-local-sym.s
lld/trunk/test/ELF/gnu-ifunc-dyntags.s
lld/trunk/test/ELF/i386-merge.s
lld/trunk/test/ELF/i386-retpoline-nopic-linkerscript.s
lld/trunk/test/ELF/i386-retpoline-pic-linkerscript.s
lld/trunk/test/ELF/linkerscript/addr-zero.test
lld/trunk/test/ELF/linkerscript/align-empty.test
lld/trunk/test/ELF/linkerscript/dot-is-not-abs.s
lld/trunk/test/ELF/linkerscript/emit-reloc.s
lld/trunk/test/ELF/linkerscript/expr-sections.test
lld/trunk/test/ELF/linkerscript/implicit-program-header.test
lld/trunk/test/ELF/linkerscript/locationcountererr2.s
lld/trunk/test/ELF/linkerscript/merge-sections-syms.s
lld/trunk/test/ELF/linkerscript/merge-sections.s
lld/trunk/test/ELF/linkerscript/no-space.s
lld/trunk/test/ELF/linkerscript/non-absolute.s
lld/trunk/test/ELF/linkerscript/non-absolute2.test
lld/trunk/test/ELF/linkerscript/non-alloc.s
lld/trunk/test/ELF/linkerscript/orphan-first-cmd.test
lld/trunk/test/ELF/linkerscript/out-of-order.s
lld/trunk/test/ELF/linkerscript/overlapping-sections.s
lld/trunk/test/ELF/linkerscript/sections-sort.s
lld/trunk/test/ELF/linkerscript/sort-non-script.s
lld/trunk/test/ELF/linkerscript/symbol-only.test
lld/trunk/test/ELF/linkerscript/unused-synthetic.s
lld/trunk/test/ELF/map-file.s
lld/trunk/test/ELF/merge-gc-piece.s
lld/trunk/test/ELF/merge-shared-str.s
lld/trunk/test/ELF/merge-shared.s
lld/trunk/test/ELF/merge-string.s
lld/trunk/test/ELF/merge-sym.s
lld/trunk/test/ELF/merge-to-non-alloc.s
lld/trunk/test/ELF/mips-got-string.s
lld/trunk/test/ELF/mips-gp-ext.s
lld/trunk/test/ELF/mips-gp-lowest.s
lld/trunk/test/ELF/note-noalloc.s
lld/trunk/test/ELF/relocation-shared.s
lld/trunk/test/ELF/relocation.s
lld/trunk/test/ELF/relro-omagic.s
lld/trunk/test/ELF/shared.s
lld/trunk/test/ELF/sort-norosegment.s
lld/trunk/test/ELF/synthetic-got.s
lld/trunk/test/ELF/verdef-defaultver.s
lld/trunk/test/ELF/verdef.s
lld/trunk/test/ELF/verneed.s
lld/trunk/test/ELF/version-script-extern.s
lld/trunk/test/ELF/x86-64-retpoline-linkerscript.s
lld/trunk/test/ELF/x86-64-retpoline-znow-linkerscript.s
Modified: lld/trunk/ELF/Writer.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Writer.cpp?rev=332038&r1=332037&r2=332038&view=diff
==============================================================================
--- lld/trunk/ELF/Writer.cpp (original)
+++ lld/trunk/ELF/Writer.cpp Thu May 10 13:44:42 2018
@@ -697,11 +697,12 @@ enum RankFlags {
RF_NOT_INTERP = 1 << 17,
RF_NOT_ALLOC = 1 << 16,
RF_WRITE = 1 << 15,
- RF_EXEC_WRITE = 1 << 13,
- RF_EXEC = 1 << 12,
- RF_NON_TLS_BSS = 1 << 11,
- RF_NON_TLS_BSS_RO = 1 << 10,
- RF_NOT_TLS = 1 << 9,
+ RF_EXEC_WRITE = 1 << 14,
+ RF_EXEC = 1 << 13,
+ RF_NON_TLS_BSS = 1 << 12,
+ RF_NON_TLS_BSS_RO = 1 << 11,
+ RF_NOT_TLS = 1 << 10,
+ RF_ALLOC_FIRST = 1 << 9,
RF_BSS = 1 << 8,
RF_NOTE = 1 << 7,
RF_PPC_NOT_TOCBSS = 1 << 6,
@@ -732,6 +733,16 @@ static unsigned getSectionRank(const Out
if (!(Sec->Flags & SHF_ALLOC))
return Rank | RF_NOT_ALLOC;
+ // Place .dynsym and .dynstr at the beginning of SHF_ALLOC
+ // sections. We want to do this to mitigate the possibility that
+ // huge .dynsym and .dynstr sections placed between text sections
+ // cause relocation overflow. Note: .dynstr has SHT_STRTAB type and
+ // SHF_ALLOC attribute, whereas sections that only have SHT_STRTAB
+ // but without SHF_ALLOC is placed at the end. All "Sec" reaching
+ // here has SHF_ALLOC bit set.
+ if (Sec->Type == SHT_DYNSYM || Sec->Type == SHT_STRTAB)
+ return Rank | RF_ALLOC_FIRST;
+
// Sort sections based on their access permission in the following
// order: R, RX, RWX, RW. This order is based on the following
// considerations:
Modified: lld/trunk/test/ELF/aarch64-copy.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/aarch64-copy.s?rev=332038&r1=332037&r2=332038&view=diff
==============================================================================
--- lld/trunk/test/ELF/aarch64-copy.s (original)
+++ lld/trunk/test/ELF/aarch64-copy.s Thu May 10 13:44:42 2018
@@ -90,4 +90,4 @@ _start:
// RODATA: Contents of section .rodata:
// S(z) = 0x40014
-// RODATA-NEXT: 101c8 14000400
+// RODATA-NEXT: 102ab 14000400
Modified: lld/trunk/test/ELF/aarch64-thunk-pi.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/aarch64-thunk-pi.s?rev=332038&r1=332037&r2=332038&view=diff
==============================================================================
--- lld/trunk/test/ELF/aarch64-thunk-pi.s (original)
+++ lld/trunk/test/ELF/aarch64-thunk-pi.s Thu May 10 13:44:42 2018
@@ -33,13 +33,13 @@ low_target2:
// Expect range extension thunks for .text_low
// adrp calculation is (PC + signed immediate) & (!0xfff)
// CHECK: __AArch64ADRPThunk_high_target:
-// CHECK-NEXT: 10: 10 00 08 90 adrp x16, #268435456
-// CHECK-NEXT: 14: 10 82 04 91 add x16, x16, #288
-// CHECK-NEXT: 18: 00 02 1f d6 br x16
+// CHECK-NEXT: 70: 10 00 08 90 adrp x16, #268435456
+// CHECK-NEXT: 74: 10 02 03 91 add x16, x16, #192
+// CHECK-NEXT: 78: 00 02 1f d6 br x16
// CHECK: __AArch64ADRPThunk_high_target2:
-// CHECK-NEXT: 1c: 10 00 08 90 adrp x16, #268435456
-// CHECK-NEXT: 20: 10 22 00 91 add x16, x16, #8
-// CHECK-NEXT: 24: 00 02 1f d6 br x16
+// CHECK-NEXT: 7c: 10 00 08 90 adrp x16, #268435456
+// CHECK-NEXT: 80: 10 22 00 91 add x16, x16, #8
+// CHECK-NEXT: 84: 00 02 1f d6 br x16
.section .text_high, "ax", %progbits
@@ -50,7 +50,7 @@ high_target:
bl low_target
ret
// CHECK: high_target:
-// CHECK-NEXT: 10000000: 4c 00 00 94 bl #304
+// CHECK-NEXT: 10000000: 34 00 00 94 bl #208
// CHECK-NEXT: 10000004: c0 03 5f d6 ret
.hidden high_target2
@@ -68,24 +68,24 @@ high_target2:
// CHECK: __AArch64ADRPThunk_low_target2:
// CHECK-NEXT: 10000010: 10 00 f8 90 adrp x16, #-268435456
-// CHECK-NEXT: 10000014: 10 22 00 91 add x16, x16, #8
+// CHECK-NEXT: 10000014: 10 a2 01 91 add x16, x16, #104
// CHECK-NEXT: 10000018: 00 02 1f d6 br x16
// CHECK: Disassembly of section .plt:
// CHECK-NEXT: .plt:
-// CHECK-NEXT: 10000100: f0 7b bf a9 stp x16, x30, [sp, #-16]!
-// CHECK-NEXT: 10000104: 10 00 00 90 adrp x16, #0
-// CHECK-NEXT: 10000108: 11 aa 40 f9 ldr x17, [x16, #336]
-// CHECK-NEXT: 1000010c: 10 42 05 91 add x16, x16, #336
-// CHECK-NEXT: 10000110: 20 02 1f d6 br x17
-// CHECK-NEXT: 10000114: 1f 20 03 d5 nop
-// CHECK-NEXT: 10000118: 1f 20 03 d5 nop
-// CHECK-NEXT: 1000011c: 1f 20 03 d5 nop
-// CHECK-NEXT: 10000120: 10 00 00 90 adrp x16, #0
-// CHECK-NEXT: 10000124: 11 ae 40 f9 ldr x17, [x16, #344]
-// CHECK-NEXT: 10000128: 10 62 05 91 add x16, x16, #344
-// CHECK-NEXT: 1000012c: 20 02 1f d6 br x17
-// CHECK-NEXT: 10000130: 10 00 00 90 adrp x16, #0
-// CHECK-NEXT: 10000134: 11 b2 40 f9 ldr x17, [x16, #352]
-// CHECK-NEXT: 10000138: 10 82 05 91 add x16, x16, #352
-// CHECK-NEXT: 1000013c: 20 02 1f d6 br x17
+// CHECK-NEXT: 100000a0: f0 7b bf a9 stp x16, x30, [sp, #-16]!
+// CHECK-NEXT: 100000a4: 10 00 00 90 adrp x16, #0
+// CHECK-NEXT: 100000a8: 11 7a 40 f9 ldr x17, [x16, #240]
+// CHECK-NEXT: 100000ac: 10 c2 03 91 add x16, x16, #240
+// CHECK-NEXT: 100000b0: 20 02 1f d6 br x17
+// CHECK-NEXT: 100000b4: 1f 20 03 d5 nop
+// CHECK-NEXT: 100000b8: 1f 20 03 d5 nop
+// CHECK-NEXT: 100000bc: 1f 20 03 d5 nop
+// CHECK-NEXT: 100000c0: 10 00 00 90 adrp x16, #0
+// CHECK-NEXT: 100000c4: 11 7e 40 f9 ldr x17, [x16, #248]
+// CHECK-NEXT: 100000c8: 10 e2 03 91 add x16, x16, #248
+// CHECK-NEXT: 100000cc: 20 02 1f d6 br x17
+// CHECK-NEXT: 100000d0: 10 00 00 90 adrp x16, #0
+// CHECK-NEXT: 100000d4: 11 82 40 f9 ldr x17, [x16, #256]
+// CHECK-NEXT: 100000d8: 10 02 04 91 add x16, x16, #256
+// CHECK-NEXT: 100000dc: 20 02 1f d6 br x17
Modified: lld/trunk/test/ELF/arm-copy.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/arm-copy.s?rev=332038&r1=332037&r2=332038&view=diff
==============================================================================
--- lld/trunk/test/ELF/arm-copy.s (original)
+++ lld/trunk/test/ELF/arm-copy.s Thu May 10 13:44:42 2018
@@ -78,4 +78,4 @@ _start:
// RODATA: Contents of section .rodata:
// S(z) = 0x13004
-// RODATA-NEXT: 10114 04300100
+// RODATA-NEXT: 101c1 04300100
Modified: lld/trunk/test/ELF/arm-execute-only.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/arm-execute-only.s?rev=332038&r1=332037&r2=332038&view=diff
==============================================================================
--- lld/trunk/test/ELF/arm-execute-only.s (original)
+++ lld/trunk/test/ELF/arm-execute-only.s Thu May 10 13:44:42 2018
@@ -14,24 +14,24 @@
// RUN: llvm-readelf -l %t.so | FileCheck --check-prefix=DIFF %s
// CHECK-NOT: LOAD
-// CHECK: LOAD 0x000000 0x00000000 0x00000000 0x0016d 0x0016d R 0x1000
+// CHECK: LOAD 0x000000 0x00000000 0x00000000 0x00170 0x00170 R 0x1000
// CHECK: LOAD 0x001000 0x00001000 0x00001000 0x{{.*}} 0x{{.*}} R E 0x1000
// CHECK: LOAD 0x002000 0x00002000 0x00002000 0x{{.*}} 0x{{.*}} E 0x1000
// CHECK: LOAD 0x003000 0x00003000 0x00003000 0x00038 0x00038 RW 0x1000
// CHECK-NOT: LOAD
-// CHECK: 01 .dynsym .gnu.hash .hash .dynstr
+// CHECK: 01 .dynsym .dynstr .gnu.hash .hash
// CHECK: 02 .text
// CHECK: 03 .foo
// CHECK: 04 .dynamic
// DIFF-NOT: LOAD
-// DIFF: LOAD 0x000000 0x00000000 0x00000000 0x0014d 0x0014d R 0x1000
+// DIFF: LOAD 0x000000 0x00000000 0x00000000 0x00150 0x00150 R 0x1000
// DIFF: LOAD 0x001000 0x00001000 0x00001000 0x0000c 0x0000c R E 0x1000
// DIFF: LOAD 0x002000 0x00002000 0x00002000 0x00038 0x00038 RW 0x1000
// DIFF-NOT: LOAD
-// DIFF: 01 .dynsym .gnu.hash .hash .dynstr
+// DIFF: 01 .dynsym .dynstr .gnu.hash .hash
// DIFF: 02 .text .foo
// DIFF: 03 .dynamic
Modified: lld/trunk/test/ELF/arm-exidx-shared.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/arm-exidx-shared.s?rev=332038&r1=332037&r2=332038&view=diff
==============================================================================
--- lld/trunk/test/ELF/arm-exidx-shared.s (original)
+++ lld/trunk/test/ELF/arm-exidx-shared.s Thu May 10 13:44:42 2018
@@ -41,5 +41,5 @@ __aeabi_unwind_cpp_pr0:
// CHECK-NEXT: 0x200C R_ARM_JUMP_SLOT __gxx_personality_v0
// CHECK-EXTAB: Contents of section .ARM.extab:
-// 014c + 0ee4 = 0x1030 = __gxx_personality_v0(PLT)
-// CHECK-EXTAB-NEXT: 014c e40e0000 b0b0b000 00000000
+// 01d8 + 0e58 = 0x1030 = __gxx_personality_v0(PLT)
+// CHECK-EXTAB-NEXT: 01d8 580e0000 b0b0b000 00000000
Modified: lld/trunk/test/ELF/basic-ppc.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/basic-ppc.s?rev=332038&r1=332037&r2=332038&view=diff
==============================================================================
--- lld/trunk/test/ELF/basic-ppc.s (original)
+++ lld/trunk/test/ELF/basic-ppc.s Thu May 10 13:44:42 2018
@@ -65,7 +65,7 @@
// CHECK-NEXT: Address: 0x114
// CHECK-NEXT: Offset: 0x114
// CHECK-NEXT: Size: 16
-// CHECK-NEXT: Link: 3
+// CHECK-NEXT: Link: 2
// CHECK-NEXT: Info: 1
// CHECK-NEXT: AddressAlignment: 4
// CHECK-NEXT: EntrySize: 16
@@ -75,38 +75,38 @@
// CHECK-NEXT: }
// CHECK-NEXT: Section {
// CHECK-NEXT: Index: 2
-// CHECK-NEXT: Name: .hash
-// CHECK-NEXT: Type: SHT_HASH (0x5)
+// CHECK-NEXT: Name: .dynstr
+// CHECK-NEXT: Type: SHT_STRTAB (0x3)
// CHECK-NEXT: Flags [ (0x2)
// CHECK-NEXT: SHF_ALLOC (0x2)
// CHECK-NEXT: ]
// CHECK-NEXT: Address: 0x124
// CHECK-NEXT: Offset: 0x124
-// CHECK-NEXT: Size: 16
-// CHECK-NEXT: Link: 1
+// CHECK-NEXT: Size: 1
+// CHECK-NEXT: Link: 0
// CHECK-NEXT: Info: 0
-// CHECK-NEXT: AddressAlignment: 4
-// CHECK-NEXT: EntrySize: 4
+// CHECK-NEXT: AddressAlignment: 1
+// CHECK-NEXT: EntrySize: 0
// CHECK-NEXT: SectionData (
-// CHECK-NEXT: 0000: 00000001 00000001 00000000 00000000 |................|
+// CHECK-NEXT: 0000: 00 |.|
// CHECK-NEXT: )
// CHECK-NEXT: }
// CHECK-NEXT: Section {
// CHECK-NEXT: Index: 3
-// CHECK-NEXT: Name: .dynstr
-// CHECK-NEXT: Type: SHT_STRTAB (0x3)
+// CHECK-NEXT: Name: .hash
+// CHECK-NEXT: Type: SHT_HASH (0x5)
// CHECK-NEXT: Flags [ (0x2)
// CHECK-NEXT: SHF_ALLOC (0x2)
// CHECK-NEXT: ]
-// CHECK-NEXT: Address: 0x134
-// CHECK-NEXT: Offset: 0x134
-// CHECK-NEXT: Size: 1
-// CHECK-NEXT: Link: 0
+// CHECK-NEXT: Address: 0x128
+// CHECK-NEXT: Offset: 0x128
+// CHECK-NEXT: Size: 16
+// CHECK-NEXT: Link: 1
// CHECK-NEXT: Info: 0
-// CHECK-NEXT: AddressAlignment: 1
-// CHECK-NEXT: EntrySize: 0
+// CHECK-NEXT: AddressAlignment: 4
+// CHECK-NEXT: EntrySize: 4
// CHECK-NEXT: SectionData (
-// CHECK-NEXT: 0000: 00 |.|
+// CHECK-NEXT: 0000: 00000001 00000001 00000000 00000000 |................|
// CHECK-NEXT: )
// CHECK-NEXT: }
// CHECK-NEXT: Section {
@@ -139,14 +139,14 @@
// CHECK-NEXT: Address: 0x2000
// CHECK-NEXT: Offset: 0x2000
// CHECK-NEXT: Size: 48
-// CHECK-NEXT: Link: 3
+// CHECK-NEXT: Link: 2
// CHECK-NEXT: Info: 0
// CHECK-NEXT: AddressAlignment: 4
// CHECK-NEXT: EntrySize: 8
// CHECK-NEXT: SectionData (
// CHECK-NEXT: 0000: 00000006 00000114 0000000B 00000010 |................|
-// CHECK-NEXT: 0010: 00000005 00000134 0000000A 00000001 |.......4........|
-// CHECK-NEXT: 0020: 00000004 00000124 00000000 00000000 |.......$........|
+// CHECK-NEXT: 0010: 00000005 00000124 0000000A 00000001 |.......$........|
+// CHECK-NEXT: 0020: 00000004 00000128 00000000 00000000 |.......(........|
// CHECK-NEXT: )
// CHECK-NEXT: }
// CHECK-NEXT: Section {
@@ -165,7 +165,7 @@
// CHECK-NEXT: AddressAlignment: 1
// CHECK-NEXT: EntrySize: 1
// CHECK-NEXT: SectionData (
-// CHECK-NEXT: 0000: 4C4C4420 312E3000 |LLD 1.0.|
+// CHECK-NEXT: 0000: 4C4C4420 312E3000 |LLD 1.0.|
// CHECK-NEXT: )
// CHECK-NEXT: }
// CHECK-NEXT: Section {
@@ -200,8 +200,8 @@
// CHECK-NEXT: AddressAlignment: 1
// CHECK-NEXT: EntrySize: 0
// CHECK-NEXT: SectionData (
-// CHECK-NEXT: 0000: 002E6479 6E73796D 002E6861 7368002E |..dynsym..hash..|
-// CHECK-NEXT: 0010: 64796E73 7472002E 74657874 002E6479 |dynstr..text..dy|
+// CHECK-NEXT: 0000: 002E6479 6E73796D 002E6479 6E737472 |..dynsym..dynstr|
+// CHECK-NEXT: 0010: 002E6861 7368002E 74657874 002E6479 |..hash..text..dy|
// CHECK-NEXT: 0020: 6E616D69 63002E63 6F6D6D65 6E74002E |namic..comment..|
// CHECK-NEXT: 0030: 73796D74 6162002E 73687374 72746162 |symtab..shstrtab|
// CHECK-NEXT: 0040: 002E7374 72746162 00 |..strtab.|
@@ -215,7 +215,7 @@
// CHECK-NEXT: ]
// CHECK-NEXT: Address: 0x0
// CHECK-NEXT: Offset: 0x20A1
-// CHECK-NEXT: Size: 1
+// CHECK-NEXT: Size: 10
// CHECK-NEXT: Link: 0
// CHECK-NEXT: Info: 0
// CHECK-NEXT: AddressAlignment: 1
@@ -243,8 +243,8 @@
// CHECK-NEXT: Offset: 0x0
// CHECK-NEXT: VirtualAddress: 0x0
// CHECK-NEXT: PhysicalAddress: 0x0
-// CHECK-NEXT: FileSize: 309
-// CHECK-NEXT: MemSize: 309
+// CHECK-NEXT: FileSize: 312
+// CHECK-NEXT: MemSize: 312
// CHECK-NEXT: Flags [ (0x4)
// CHECK-NEXT: PF_R (0x4)
// CHECK-NEXT: ]
Modified: lld/trunk/test/ELF/basic-ppc64.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/basic-ppc64.s?rev=332038&r1=332037&r2=332038&view=diff
==============================================================================
--- lld/trunk/test/ELF/basic-ppc64.s (original)
+++ lld/trunk/test/ELF/basic-ppc64.s Thu May 10 13:44:42 2018
@@ -66,7 +66,7 @@
// CHECK-NEXT: Address: 0x1C8
// CHECK-NEXT: Offset: 0x1C8
// CHECK-NEXT: Size: 24
-// CHECK-NEXT: Link: 3
+// CHECK-NEXT: Link: 2
// CHECK-NEXT: Info: 1
// CHECK-NEXT: AddressAlignment: 8
// CHECK-NEXT: EntrySize: 24
@@ -77,38 +77,38 @@
// CHECK-NEXT: }
// CHECK-NEXT: Section {
// CHECK-NEXT: Index: 2
-// CHECK-NEXT: Name: .hash (9)
-// CHECK-NEXT: Type: SHT_HASH (0x5)
+// CHECK-NEXT: Name: .dynstr (9)
+// CHECK-NEXT: Type: SHT_STRTAB (0x3)
// CHECK-NEXT: Flags [ (0x2)
// CHECK-NEXT: SHF_ALLOC (0x2)
// CHECK-NEXT: ]
// CHECK-NEXT: Address: 0x1E0
// CHECK-NEXT: Offset: 0x1E0
-// CHECK-NEXT: Size: 16
-// CHECK-NEXT: Link: 1
+// CHECK-NEXT: Size: 1
+// CHECK-NEXT: Link: 0
// CHECK-NEXT: Info: 0
-// CHECK-NEXT: AddressAlignment: 4
-// CHECK-NEXT: EntrySize: 4
+// CHECK-NEXT: AddressAlignment: 1
+// CHECK-NEXT: EntrySize: 0
// CHECK-NEXT: SectionData (
-// CHECK-NEXT: 0000: 01000000 01000000 00000000 00000000 |................|
+// CHECK-NEXT: 0000: 00 |.|
// CHECK-NEXT: )
// CHECK-NEXT: }
// CHECK-NEXT: Section {
// CHECK-NEXT: Index: 3
-// CHECK-NEXT: Name: .dynstr (15)
-// CHECK-NEXT: Type: SHT_STRTAB (0x3)
+// CHECK-NEXT: Name: .hash (17)
+// CHECK-NEXT: Type: SHT_HASH (0x5)
// CHECK-NEXT: Flags [ (0x2)
// CHECK-NEXT: SHF_ALLOC (0x2)
// CHECK-NEXT: ]
-// CHECK-NEXT: Address: 0x1F0
-// CHECK-NEXT: Offset: 0x1F0
-// CHECK-NEXT: Size: 1
-// CHECK-NEXT: Link: 0
+// CHECK-NEXT: Address: 0x1E4
+// CHECK-NEXT: Offset: 0x1E4
+// CHECK-NEXT: Size: 16
+// CHECK-NEXT: Link: 1
// CHECK-NEXT: Info: 0
-// CHECK-NEXT: AddressAlignment: 1
-// CHECK-NEXT: EntrySize: 0
+// CHECK-NEXT: AddressAlignment: 4
+// CHECK-NEXT: EntrySize: 4
// CHECK-NEXT: SectionData (
-// CHECK-NEXT: 0000: 00 |.|
+// CHECK-NEXT: 0000: 01000000 01000000 00000000 00000000 |................|
// CHECK-NEXT: )
// CHECK-NEXT: }
// CHECK-NEXT: Section {
@@ -141,16 +141,16 @@
// CHECK-NEXT: Address: 0x20000
// CHECK-NEXT: Offset: 0x20000
// CHECK-NEXT: Size: 96
-// CHECK-NEXT: Link: 3
+// CHECK-NEXT: Link: 2
// CHECK-NEXT: Info: 0
// CHECK-NEXT: AddressAlignment: 8
// CHECK-NEXT: EntrySize: 16
// CHECK-NEXT: SectionData (
// CHECK-NEXT: 0000: 06000000 00000000 C8010000 00000000 |................|
// CHECK-NEXT: 0010: 0B000000 00000000 18000000 00000000 |................|
-// CHECK-NEXT: 0020: 05000000 00000000 F0010000 00000000 |................|
+// CHECK-NEXT: 0020: 05000000 00000000 E0010000 00000000 |................|
// CHECK-NEXT: 0030: 0A000000 00000000 01000000 00000000 |................|
-// CHECK-NEXT: 0040: 04000000 00000000 E0010000 00000000 |................|
+// CHECK-NEXT: 0040: 04000000 00000000 E4010000 00000000 |................|
// CHECK-NEXT: 0050: 00000000 00000000 00000000 00000000 |................|
// CHECK-NEXT: )
// CHECK-NEXT: }
@@ -170,7 +170,7 @@
// CHECK-NEXT: AddressAlignment: 1
// CHECK-NEXT: EntrySize: 1
// CHECK-NEXT: SectionData (
-// CHECK-NEXT: 0000: 4C4C4420 312E3000 |LLD 1.0.|
+// CHECK-NEXT: 0000: 4C4C4420 312E3000 |LLD 1.0.|
// CHECK-NEXT: )
// CHECK-NEXT: }
// CHECK-NEXT: Section {
@@ -206,8 +206,8 @@
// CHECK-NEXT: AddressAlignment: 1
// CHECK-NEXT: EntrySize: 0
// CHECK-NEXT: SectionData (
-// CHECK-NEXT: 0000: 002E6479 6E73796D 002E6861 7368002E |..dynsym..hash..|
-// CHECK-NEXT: 0010: 64796E73 7472002E 74657874 002E6479 |dynstr..text..dy|
+// CHECK-NEXT: 0000: 002E6479 6E73796D 002E6479 6E737472 |..dynsym..dynstr|
+// CHECK-NEXT: 0010: 002E6861 7368002E 74657874 002E6479 |..hash..text..dy|
// CHECK-NEXT: 0020: 6E616D69 63002E63 6F6D6D65 6E74002E |namic..comment..|
// CHECK-NEXT: 0030: 73796D74 6162002E 73687374 72746162 |symtab..shstrtab|
// CHECK-NEXT: 0040: 002E7374 72746162 00 |..strtab.|
@@ -249,8 +249,8 @@
// CHECK-NEXT: Offset: 0x0
// CHECK-NEXT: VirtualAddress: 0x0
// CHECK-NEXT: PhysicalAddress: 0x0
-// CHECK-NEXT: FileSize: 497
-// CHECK-NEXT: MemSize: 497
+// CHECK-NEXT: FileSize: 500
+// CHECK-NEXT: MemSize: 500
// CHECK-NEXT: Flags [ (0x4)
// CHECK-NEXT: PF_R (0x4)
// CHECK-NEXT: ]
Modified: lld/trunk/test/ELF/dynamic-no-rosegment.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/dynamic-no-rosegment.s?rev=332038&r1=332037&r2=332038&view=diff
==============================================================================
--- lld/trunk/test/ELF/dynamic-no-rosegment.s (original)
+++ lld/trunk/test/ELF/dynamic-no-rosegment.s Thu May 10 13:44:42 2018
@@ -7,9 +7,9 @@
# CHECK-NEXT: Tag Type Name/Value
# CHECK-NEXT: 0x0000000000000006 SYMTAB 0x120
# CHECK-NEXT: 0x000000000000000B SYMENT 24 (bytes)
-# CHECK-NEXT: 0x0000000000000005 STRTAB 0x1D8
+# CHECK-NEXT: 0x0000000000000005 STRTAB 0x138
# CHECK-NEXT: 0x000000000000000A STRSZ 1 (bytes)
-# CHECK-NEXT: 0x000000006FFFFEF5 GNU_HASH 0x138
-# CHECK-NEXT: 0x0000000000000004 HASH 0x154
+# CHECK-NEXT: 0x000000006FFFFEF5 GNU_HASH 0x140
+# CHECK-NEXT: 0x0000000000000004 HASH 0x15C
# CHECK-NEXT: 0x0000000000000000 NULL 0x0
# CHECK-NEXT: ]
Added: lld/trunk/test/ELF/dynsec-at-beginning.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/dynsec-at-beginning.s?rev=332038&view=auto
==============================================================================
--- lld/trunk/test/ELF/dynsec-at-beginning.s (added)
+++ lld/trunk/test/ELF/dynsec-at-beginning.s Thu May 10 13:44:42 2018
@@ -0,0 +1,16 @@
+# REQUIRES: x86
+# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t
+
+# RUN: ld.lld --hash-style=gnu -o %t1 %t -shared
+# RUN: llvm-readobj -elf-output-style=GNU -s %t1 | FileCheck %s
+
+# Dynamic symbol and dynamic strtab sections are at the beginning of
+# SHF_ALLOC sections.
+# CHECK: .dynsym {{.*}} A
+# CHECK-NEXT: .dynstr {{.*}} A
+# CHECK-NEXT: foo {{.*}} A
+# CHECK-NEXT: .hash {{.*}} A
+# CHECK-NEXT: .text {{.*}} AX
+
+.section foo, "a"
+.byte 0
Modified: lld/trunk/test/ELF/eh-frame-padding-no-rosegment.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/eh-frame-padding-no-rosegment.s?rev=332038&r1=332037&r2=332038&view=diff
==============================================================================
--- lld/trunk/test/ELF/eh-frame-padding-no-rosegment.s (original)
+++ lld/trunk/test/ELF/eh-frame-padding-no-rosegment.s Thu May 10 13:44:42 2018
@@ -58,7 +58,7 @@ bar:
// CHECK-NEXT: EntrySize:
// CHECK-NEXT: SectionData (
// CHECK-NEXT: 0000: 1C000000 00000000 017A5052 00017810
-// CHECK-NEXT: 0010: 061BBEFF FFFF1B0C 07089001 00000000
-// CHECK-NEXT: 0020: 14000000 24000000 A8FFFFFF 00000000
+// CHECK-NEXT: 0010: 061BDAFF FFFF1B0C 07089001 00000000
+// CHECK-NEXT: 0020: 14000000 24000000 C4FFFFFF 00000000
// CHECK-NEXT: 0030: 00000000 00000000
// CHECK-NEXT: )
Modified: lld/trunk/test/ELF/gc-merge-local-sym.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/gc-merge-local-sym.s?rev=332038&r1=332037&r2=332038&view=diff
==============================================================================
--- lld/trunk/test/ELF/gc-merge-local-sym.s (original)
+++ lld/trunk/test/ELF/gc-merge-local-sym.s Thu May 10 13:44:42 2018
@@ -9,7 +9,7 @@
// CHECK-NEXT: SHF_MERGE
// CHECK-NEXT: SHF_STRINGS
// CHECK-NEXT: ]
-// CHECK-NEXT: Address: 0x1C8
+// CHECK-NEXT: Address: 0x1FD
// CHECK-NEXT: Offset:
// CHECK-NEXT: Size: 4
// CHECK-NEXT: Link: 0
Modified: lld/trunk/test/ELF/gnu-ifunc-dyntags.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/gnu-ifunc-dyntags.s?rev=332038&r1=332037&r2=332038&view=diff
==============================================================================
--- lld/trunk/test/ELF/gnu-ifunc-dyntags.s (original)
+++ lld/trunk/test/ELF/gnu-ifunc-dyntags.s Thu May 10 13:44:42 2018
@@ -8,7 +8,7 @@
## when there are no other relocations except R_*_IRELATIVE.
# CHECK: Name Size Address
-# CHECK: .rela.plt 00000030 0000000000000210
+# CHECK: .rela.plt 00000030 0000000000000218
# CHECK: .got.plt 00000010 0000000000002000
# TAGS: Relocations [
@@ -19,7 +19,7 @@
# TAGS-NEXT: ]
# TAGS: Tag Type Name/Value
-# TAGS: 0x0000000000000017 JMPREL 0x210
+# TAGS: 0x0000000000000017 JMPREL 0x218
# TAGS: 0x0000000000000002 PLTRELSZ 48
# TAGS: 0x0000000000000003 PLTGOT 0x2000
# TAGS: 0x0000000000000014 PLTREL RELA
Modified: lld/trunk/test/ELF/i386-merge.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/i386-merge.s?rev=332038&r1=332037&r2=332038&view=diff
==============================================================================
--- lld/trunk/test/ELF/i386-merge.s (original)
+++ lld/trunk/test/ELF/i386-merge.s Thu May 10 13:44:42 2018
@@ -9,7 +9,7 @@
// CHECK-NEXT: SHF_ALLOC
// CHECK-NEXT: SHF_MERGE
// CHECK-NEXT: ]
-// CHECK-NEXT: Address: 0x114
+// CHECK-NEXT: Address: 0x128
// CHECK-NEXT: Offset:
// CHECK-NEXT: Size:
// CHECK-NEXT: Link:
@@ -35,7 +35,7 @@
// CHECK-NEXT: AddressAlignment: 1
// CHECK-NEXT: EntrySize: 0
// CHECK-NEXT: SectionData (
-// CHECK-NEXT: 0000: 14010000 |
+// CHECK-NEXT: 0000: 28010000 |
// CHECK-NEXT: )
// The content of .data should be the address of .mysec. 14010000 is 0x114 in
Modified: lld/trunk/test/ELF/i386-retpoline-nopic-linkerscript.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/i386-retpoline-nopic-linkerscript.s?rev=332038&r1=332037&r2=332038&view=diff
==============================================================================
--- lld/trunk/test/ELF/i386-retpoline-nopic-linkerscript.s (original)
+++ lld/trunk/test/ELF/i386-retpoline-nopic-linkerscript.s Thu May 10 13:44:42 2018
@@ -14,9 +14,9 @@
// CHECK: Disassembly of section .plt:
// CHECK-NEXT: .plt:
-// CHECK-NEXT: 10: ff 35 fc 00 00 00 pushl 252
+// CHECK-NEXT: 10: ff 35 cc 00 00 00 pushl 204
// CHECK-NEXT: 16: 50 pushl %eax
-// CHECK-NEXT: 17: a1 00 01 00 00 movl 256, %eax
+// CHECK-NEXT: 17: a1 d0 00 00 00 movl 208, %eax
// CHECK-NEXT: 1c: e8 0f 00 00 00 calll 15 <.plt+0x20>
// CHECK-NEXT: 21: f3 90 pause
// CHECK-NEXT: 23: 0f ae e8 lfence
@@ -37,7 +37,7 @@
// CHECK-NEXT: 3e: c3 retl
// CHECK-NEXT: 3f: cc int3
// CHECK-NEXT: 40: 50 pushl %eax
-// CHECK-NEXT: 41: a1 04 01 00 00 movl 260, %eax
+// CHECK-NEXT: 41: a1 d4 00 00 00 movl 212, %eax
// CHECK-NEXT: 46: e8 e5 ff ff ff calll -27 <.plt+0x20>
// CHECK-NEXT: 4b: e9 d1 ff ff ff jmp -47 <.plt+0x11>
// CHECK-NEXT: 50: 68 00 00 00 00 pushl $0
@@ -49,7 +49,7 @@
// CHECK-NEXT: 5e: cc int3
// CHECK-NEXT: 5f: cc int3
// CHECK-NEXT: 60: 50 pushl %eax
-// CHECK-NEXT: 61: a1 08 01 00 00 movl 264, %eax
+// CHECK-NEXT: 61: a1 d8 00 00 00 movl 216, %eax
// CHECK-NEXT: 66: e8 c5 ff ff ff calll -59 <.plt+0x20>
// CHECK-NEXT: 6b: e9 b1 ff ff ff jmp -79 <.plt+0x11>
// CHECK-NEXT: 70: 68 08 00 00 00 pushl $8
Modified: lld/trunk/test/ELF/i386-retpoline-pic-linkerscript.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/i386-retpoline-pic-linkerscript.s?rev=332038&r1=332037&r2=332038&view=diff
==============================================================================
--- lld/trunk/test/ELF/i386-retpoline-pic-linkerscript.s (original)
+++ lld/trunk/test/ELF/i386-retpoline-pic-linkerscript.s Thu May 10 13:44:42 2018
@@ -14,9 +14,9 @@
// CHECK: Disassembly of section .plt:
// CHECK-NEXT: .plt:
-// CHECK-NEXT: 10: ff b3 fc 00 00 00 pushl 252(%ebx)
+// CHECK-NEXT: 10: ff b3 cc 00 00 00 pushl 204(%ebx)
// CHECK-NEXT: 16: 50 pushl %eax
-// CHECK-NEXT: 17: 8b 83 00 01 00 00 movl 256(%ebx), %eax
+// CHECK-NEXT: 17: 8b 83 d0 00 00 00 movl 208(%ebx), %eax
// CHECK-NEXT: 1d: e8 0e 00 00 00 calll 14 <.plt+0x20>
// CHECK-NEXT: 22: f3 90 pause
// CHECK-NEXT: 24: 0f ae e8 lfence
@@ -36,7 +36,7 @@
// CHECK-NEXT: 3e: c3 retl
// CHECK-NEXT: 3f: cc int3
// CHECK-NEXT: 40: 50 pushl %eax
-// CHECK-NEXT: 41: 8b 83 04 01 00 00 movl 260(%ebx), %eax
+// CHECK-NEXT: 41: 8b 83 d4 00 00 00 movl 212(%ebx), %eax
// CHECK-NEXT: 47: e8 e4 ff ff ff calll -28 <.plt+0x20>
// CHECK-NEXT: 4c: e9 d1 ff ff ff jmp -47 <.plt+0x12>
// CHECK-NEXT: 51: 68 00 00 00 00 pushl $0
@@ -47,7 +47,7 @@
// CHECK-NEXT: 5e: cc int3
// CHECK-NEXT: 5f: cc int3
// CHECK-NEXT: 60: 50 pushl %eax
-// CHECK-NEXT: 61: 8b 83 08 01 00 00 movl 264(%ebx), %eax
+// CHECK-NEXT: 61: 8b 83 d8 00 00 00 movl 216(%ebx), %eax
// CHECK-NEXT: 67: e8 c4 ff ff ff calll -60 <.plt+0x20>
// CHECK-NEXT: 6c: e9 b1 ff ff ff jmp -79 <.plt+0x12>
// CHECK-NEXT: 71: 68 08 00 00 00 pushl $8
Modified: lld/trunk/test/ELF/linkerscript/addr-zero.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/linkerscript/addr-zero.test?rev=332038&r1=332037&r2=332038&view=diff
==============================================================================
--- lld/trunk/test/ELF/linkerscript/addr-zero.test (original)
+++ lld/trunk/test/ELF/linkerscript/addr-zero.test Thu May 10 13:44:42 2018
@@ -8,7 +8,7 @@
# CHECK: Symbol {
# CHECK: Name: foo
-# CHECK-NEXT: Value: 0x0
+# CHECK-NEXT: Value: 0x38
# CHECK-NEXT: Size: 0
# CHECK-NEXT: Binding: Global
# CHECK-NEXT: Type: None
Modified: lld/trunk/test/ELF/linkerscript/align-empty.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/linkerscript/align-empty.test?rev=332038&r1=332037&r2=332038&view=diff
==============================================================================
--- lld/trunk/test/ELF/linkerscript/align-empty.test (original)
+++ lld/trunk/test/ELF/linkerscript/align-empty.test Thu May 10 13:44:42 2018
@@ -15,4 +15,6 @@ SECTIONS {
# CHECK: Sections:
# CHECK-NEXT: Idx Name Size Address
# CHECK-NEXT: 0 00000000 0000000000000000
-# CHECK-NEXT: 1 foo 00000001 0000000000001000
+# CHECK-NEXT: 1 .dynsym 00000018 0000000000000190
+# CHECK-NEXT: 2 .dynstr 00000001 00000000000001a8
+# CHECK-NEXT: 3 foo 00000001 0000000000001000
Modified: lld/trunk/test/ELF/linkerscript/dot-is-not-abs.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/linkerscript/dot-is-not-abs.s?rev=332038&r1=332037&r2=332038&view=diff
==============================================================================
--- lld/trunk/test/ELF/linkerscript/dot-is-not-abs.s (original)
+++ lld/trunk/test/ELF/linkerscript/dot-is-not-abs.s Thu May 10 13:44:42 2018
@@ -26,7 +26,7 @@
# CHECK-NEXT: SHF_ALLOC
# CHECK-NEXT: SHF_EXECINSTR
# CHECK-NEXT: ]
-# CHECK-NEXT: Address: 0x0
+# CHECK-NEXT: Address: 0x1C
# CHECK-NEXT: Offset:
# CHECK-NEXT: Size: 4
# CHECK-NEXT: Link:
@@ -40,7 +40,7 @@
# CHECK: Symbol {
# CHECK: Name: foo
-# CHECK-NEXT: Value: 0x4
+# CHECK-NEXT: Value: 0x20
# CHECK-NEXT: Size: 0
# CHECK-NEXT: Binding: Local
# CHECK-NEXT: Type: None
Modified: lld/trunk/test/ELF/linkerscript/emit-reloc.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/linkerscript/emit-reloc.s?rev=332038&r1=332037&r2=332038&view=diff
==============================================================================
--- lld/trunk/test/ELF/linkerscript/emit-reloc.s (original)
+++ lld/trunk/test/ELF/linkerscript/emit-reloc.s Thu May 10 13:44:42 2018
@@ -9,9 +9,9 @@
# CHECK: Relocations [
# CHECK-NEXT: Section ({{.*}}) .rela.dyn {
-# CHECK-NEXT: 0x66 R_X86_64_64 .foo 0x0
+# CHECK-NEXT: 0x68 R_X86_64_64 .foo 0x0
# CHECK-NEXT: }
# CHECK-NEXT: Section ({{.*}}) .rela.data {
-# CHECK-NEXT: 0x66 R_X86_64_64 .foo 0x0
+# CHECK-NEXT: 0x68 R_X86_64_64 .foo 0x0
# CHECK-NEXT: }
# CHECK-NEXT: ]
Modified: lld/trunk/test/ELF/linkerscript/expr-sections.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/linkerscript/expr-sections.test?rev=332038&r1=332037&r2=332038&view=diff
==============================================================================
--- lld/trunk/test/ELF/linkerscript/expr-sections.test (original)
+++ lld/trunk/test/ELF/linkerscript/expr-sections.test Thu May 10 13:44:42 2018
@@ -13,11 +13,11 @@ SECTIONS {
}
};
-# CHECK: 1 .text 00000000 0000000000000004 TEXT DATA
+# CHECK: 3 .text 00000000 00000000000000d0 TEXT DATA
-# CHECK: 0000000000000005 .text 00000000 foo1
-# CHECK: 0000000000000005 .text 00000000 bar1
+# CHECK: 00000000000000d1 .text 00000000 foo1
+# CHECK: 00000000000000d1 .text 00000000 bar1
# CHECK: 0000000000000000 .text 00000000 foo2
# CHECK: 0000000000000000 .text 00000000 bar2
-# CHECK: 0000000000000005 .text 00000000 foo3
-# CHECK: 0000000000000005 .text 00000000 bar3
+# CHECK: 00000000000000d1 .text 00000000 foo3
+# CHECK: 00000000000000d1 .text 00000000 bar3
Modified: lld/trunk/test/ELF/linkerscript/implicit-program-header.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/linkerscript/implicit-program-header.test?rev=332038&r1=332037&r2=332038&view=diff
==============================================================================
--- lld/trunk/test/ELF/linkerscript/implicit-program-header.test (original)
+++ lld/trunk/test/ELF/linkerscript/implicit-program-header.test Thu May 10 13:44:42 2018
@@ -8,8 +8,8 @@
# RUN: llvm-readobj -elf-output-style=GNU -l %t1 | FileCheck %s
# CHECK: Segment Sections...
-# CHECK-NEXT: 00 .text .dynsym .hash .dynstr .dynamic
-# CHECK-NEXT: 01 .bar .foo
+# CHECK-NEXT: 00 .text .hash .dynamic
+# CHECK-NEXT: 01 .bar .dynsym .dynstr .foo
PHDRS {
ph_write PT_LOAD FLAGS(2);
Modified: lld/trunk/test/ELF/linkerscript/locationcountererr2.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/linkerscript/locationcountererr2.s?rev=332038&r1=332037&r2=332038&view=diff
==============================================================================
--- lld/trunk/test/ELF/linkerscript/locationcountererr2.s (original)
+++ lld/trunk/test/ELF/linkerscript/locationcountererr2.s Thu May 10 13:44:42 2018
@@ -1,11 +1,11 @@
# REQUIRES: x86
# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
# RUN: echo "SECTIONS {" > %t.script
-# RUN: echo ". = 0x20; . = 0x10; .text : {} }" >> %t.script
+# RUN: echo ". = 0x150; . = 0x10; .text : {} }" >> %t.script
# RUN: ld.lld %t.o --script %t.script -o %t -shared
# RUN: llvm-objdump -section-headers %t | FileCheck %s
# CHECK: Idx Name Size Address
-# CHECK: 1 .text 00000000 0000000000000010
+# CHECK: 3 .text 00000000 0000000000000010
# RUN: echo "SECTIONS { . = 0x20; . = ASSERT(0x1, "foo"); }" > %t2.script
# RUN: ld.lld %t.o --script %t2.script -o %t -shared
Modified: lld/trunk/test/ELF/linkerscript/merge-sections-syms.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/linkerscript/merge-sections-syms.s?rev=332038&r1=332037&r2=332038&view=diff
==============================================================================
--- lld/trunk/test/ELF/linkerscript/merge-sections-syms.s (original)
+++ lld/trunk/test/ELF/linkerscript/merge-sections-syms.s Thu May 10 13:44:42 2018
@@ -20,7 +20,7 @@
# CHECK-NEXT: }
# CHECK-NEXT: Symbol {
# CHECK-NEXT: Name: A
-# CHECK-NEXT: Value: 0x195
+# CHECK-NEXT: Value: 0x1E2
# CHECK-NEXT: Size:
# CHECK-NEXT: Binding:
# CHECK-NEXT: Type:
@@ -29,7 +29,7 @@
# CHECK-NEXT: }
# CHECK-NEXT: Symbol {
# CHECK-NEXT: Name: B
-# CHECK-NEXT: Value: 0x196
+# CHECK-NEXT: Value: 0x1E3
# CHECK-NEXT: Size:
# CHECK-NEXT: Binding:
# CHECK-NEXT: Type:
Modified: lld/trunk/test/ELF/linkerscript/merge-sections.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/linkerscript/merge-sections.s?rev=332038&r1=332037&r2=332038&view=diff
==============================================================================
--- lld/trunk/test/ELF/linkerscript/merge-sections.s (original)
+++ lld/trunk/test/ELF/linkerscript/merge-sections.s Thu May 10 13:44:42 2018
@@ -29,7 +29,7 @@
# CHECK: Name: end
# 0x19E = begin + sizeof(.foo) = 0x190 + 0xE
-# CHECK-NEXT: Value: 0x19E
+# CHECK-NEXT: Value: 0x1F2
# Check that we don't crash with --gc-sections
# RUN: ld.lld --gc-sections -o %t2 --script %t.script %t -shared
Modified: lld/trunk/test/ELF/linkerscript/no-space.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/linkerscript/no-space.s?rev=332038&r1=332037&r2=332038&view=diff
==============================================================================
--- lld/trunk/test/ELF/linkerscript/no-space.s (original)
+++ lld/trunk/test/ELF/linkerscript/no-space.s Thu May 10 13:44:42 2018
@@ -1,11 +1,11 @@
# REQUIRES: x86
# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
-# RUN: echo "SECTIONS {foo 0 : {*(foo*)} }" > %t.script
+# RUN: echo "SECTIONS {foo 0 : {*(foo*)} .dynsym : {*(.dynsym)} .dynstr : {*(.dynstr)} }" > %t.script
# RUN: ld.lld --hash-style=sysv -o %t --script %t.script %t.o -shared
# RUN: llvm-readobj -elf-output-style=GNU -l %t | FileCheck %s
-# RUN: echo "SECTIONS {foo : {*(foo*)} }" > %t.script
+# RUN: echo "SECTIONS {foo : {*(foo*)} .dynsym : { *(.dynsym) } .dynstr : { *(.dynstr) } }" > %t.script
# RUN: ld.lld --hash-style=sysv -o %t --script %t.script %t.o -shared
# RUN: llvm-readobj -elf-output-style=GNU -l %t | FileCheck %s
@@ -18,7 +18,7 @@
# CHECK: Section to Segment mapping:
# CHECK-NEXT: Segment Sections...
-# CHECK-NEXT: 00 foo .text .dynsym .hash .dynstr
+# CHECK-NEXT: 00 foo .text .hash .dynsym .dynstr
.section foo, "a"
.quad 0
Modified: lld/trunk/test/ELF/linkerscript/non-absolute.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/linkerscript/non-absolute.s?rev=332038&r1=332037&r2=332038&view=diff
==============================================================================
--- lld/trunk/test/ELF/linkerscript/non-absolute.s (original)
+++ lld/trunk/test/ELF/linkerscript/non-absolute.s Thu May 10 13:44:42 2018
@@ -7,7 +7,7 @@
# DUMP: Disassembly of section .text:
# DUMP-NEXT: foo:
-# DUMP-NEXT: 0: {{.*}} -21(%rip), %eax
+# DUMP-NEXT: 50: {{.*}} -101(%rip), %eax
# SYMBOL: Symbol {
# SYMBOL: Name: B
@@ -18,7 +18,7 @@
# SYMBOL-NEXT: Other [
# SYMBOL-NEXT: STV_HIDDEN
# SYMBOL-NEXT: ]
-# SYMBOL-NEXT: Section: .text
+# SYMBOL-NEXT: Section: .dynsym
# SYMBOL-NEXT: }
.text
Modified: lld/trunk/test/ELF/linkerscript/non-absolute2.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/linkerscript/non-absolute2.test?rev=332038&r1=332037&r2=332038&view=diff
==============================================================================
--- lld/trunk/test/ELF/linkerscript/non-absolute2.test (original)
+++ lld/trunk/test/ELF/linkerscript/non-absolute2.test Thu May 10 13:44:42 2018
@@ -9,8 +9,10 @@ SECTIONS {
}
# CHECK: Sections:
-# CHECK-NEXT: Idx Name Size Address
-# CHECK-NEXT: 0 00000000 0000000000000000
-# CHECK-NEXT: 1 .text 00000000 0000000000001000
+# CHECK-NEXT: Idx Name Size Address Type
+# CHECK-NEXT: 0 00000000 0000000000000000
+# CHECK-NEXT: 1 .dynsym 00000030 0000000000001000
+# CHECK-NEXT: 2 .dynstr 00000003 0000000000001030
+# CHECK-NEXT: 3 .text 00000000 0000000000001034
-# CHECK: 0000000000000001 .text 00000000 A
+# CHECK: 0000000000000001 .dynsym 00000000 A
Modified: lld/trunk/test/ELF/linkerscript/non-alloc.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/linkerscript/non-alloc.s?rev=332038&r1=332037&r2=332038&view=diff
==============================================================================
--- lld/trunk/test/ELF/linkerscript/non-alloc.s (original)
+++ lld/trunk/test/ELF/linkerscript/non-alloc.s Thu May 10 13:44:42 2018
@@ -15,7 +15,7 @@
# CHECK: Section to Segment mapping:
# CHECK-NEXT: Segment Sections...
-# CHECK-NEXT: 00 .text .dynsym .hash .dynstr
+# CHECK-NEXT: 00 .dynsym .dynstr .text .hash
# CHECK-NEXT: 01 .dynamic
nop
Modified: lld/trunk/test/ELF/linkerscript/orphan-first-cmd.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/linkerscript/orphan-first-cmd.test?rev=332038&r1=332037&r2=332038&view=diff
==============================================================================
--- lld/trunk/test/ELF/linkerscript/orphan-first-cmd.test (original)
+++ lld/trunk/test/ELF/linkerscript/orphan-first-cmd.test Thu May 10 13:44:42 2018
@@ -17,4 +17,4 @@ SECTIONS {
# CHECK-NEXT: SHF_ALLOC
# CHECK-NEXT: SHF_EXECINSTR
# CHECK-NEXT: ]
-# CHECK-NEXT: Address: 0x1000
+# CHECK-NEXT: Address: 0x1038
Modified: lld/trunk/test/ELF/linkerscript/out-of-order.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/linkerscript/out-of-order.s?rev=332038&r1=332037&r2=332038&view=diff
==============================================================================
--- lld/trunk/test/ELF/linkerscript/out-of-order.s (original)
+++ lld/trunk/test/ELF/linkerscript/out-of-order.s Thu May 10 13:44:42 2018
@@ -1,19 +1,37 @@
# REQUIRES: x86
# RUN: llvm-mc -filetype=obj -triple=x86_64-linux %s -o %t.o
-# RUN: echo "SECTIONS { .data 0x4000 : { *(.data) } .text 0x2000 : { *(.text) } }" > %t.script
+# RUN: echo "SECTIONS { .data 0x4000 : {*(.data)} .dynsym 0x2000 : {*(.dynsym)} .dynstr : {*(.dynstr)} }" > %t.script
# RUN: ld.lld --hash-style=sysv -o %t.so --script %t.script %t.o -shared
# RUN: llvm-objdump -section-headers %t.so | FileCheck %s
+# Note: how the layout is done:
+# we need to layout 2 segments, each contains sections:
+# seg1: .data .dynamic
+# seg2: .dynsym .dynstr .text .hash
+# for each segment, we start from the first section, regardless
+# whether it is an orphan or not (sections that are not listed in the
+# linkerscript are orphans):
+# for seg1, we assign address: .data(0x4000), .dynamic(0x4008)
+# for seg2, we assign address: .dynsym(0x2000), .dynstr(0x2018) ...
+# .dynsym is not an orphan, so we take address from script, we assign
+# .dynstr current address cursor, which is the end # of .dynsym and so
+# on for later sections.
+
+# Also note, it is absolutely *illegal* to have section addresses of
+# the same segment in none-increasing order, authors of linker scripts
+# must take responsibility to make sure this does not happen.
+
# CHECK: Sections:
# CHECK-NEXT: Idx Name Size Address Type
# CHECK-NEXT: 0 00000000 0000000000000000
-# CHECK-NEXT: 1 .data 00000008 0000000000004000 DATA
+# CHECK-NEXT: 1 .data 00000008 0000000000004000
# CHECK-NEXT: 2 .dynamic 00000060 0000000000004008
-# CHECK-NEXT: 3 .text 00000008 0000000000002000 TEXT DATA
-# CHECK-NEXT: 4 .dynsym 00000018 0000000000002008
-# CHECK-NEXT: 5 .hash 00000010 0000000000002020
-# CHECK-NEXT: 6 .dynstr 00000001 0000000000002030
+# CHECK-NEXT: 3 .dynsym 00000018 0000000000002000
+# CHECK-NEXT: 4 .dynstr 00000001 0000000000002018
+# CHECK-NEXT: 5 .text 00000008 000000000000201c
+# CHECK-NEXT: 6 .hash 00000010 0000000000002024
.quad 0
.data
.quad 0
+
Modified: lld/trunk/test/ELF/linkerscript/overlapping-sections.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/linkerscript/overlapping-sections.s?rev=332038&r1=332037&r2=332038&view=diff
==============================================================================
--- lld/trunk/test/ELF/linkerscript/overlapping-sections.s (original)
+++ lld/trunk/test/ELF/linkerscript/overlapping-sections.s Thu May 10 13:44:42 2018
@@ -23,7 +23,7 @@
# BAD-LMA: .sec2 PROGBITS 0000000000008800 002800 000100 00 WA 0 0 1
# BAD-LMA-LABEL: Program Headers:
# BAD-LMA-NEXT: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
-# BAD-LMA-NEXT: LOAD 0x001000 0x0000000000000000 0x0000000000000000 0x0000fd 0x0000fd R E 0x1000
+# BAD-LMA-NEXT: LOAD 0x001000 0x0000000000000000 0x0000000000000000 0x000104 0x000104 R E 0x1000
# BAD-LMA-NEXT: LOAD 0x002000 0x0000000000008000 0x0000000000008000 0x000100 0x000100 RW 0x1000
# BAD-LMA-NEXT: LOAD 0x002800 0x0000000000008800 0x0000000000008080 0x000170 0x000170 RW 0x1000
# BAD-LMA-LABEL: Section to Segment mapping:
@@ -49,7 +49,7 @@
# BAD-VADDR: .sec2 PROGBITS 0000000000008020 003020 000100 00 WA 0 0 1
# BAD-VADDR-LABEL: Program Headers:
# BAD-VADDR-NEXT: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
-# BAD-VADDR-NEXT: LOAD 0x001000 0x0000000000000000 0x0000000000000000 0x0000fd 0x0000fd R E 0x1000
+# BAD-VADDR-NEXT: LOAD 0x001000 0x0000000000000000 0x0000000000000000 0x000104 0x000104 R E 0x1000
# BAD-VADDR-NEXT: LOAD 0x002000 0x0000000000008000 0x0000000000008000 0x000100 0x000100 RW 0x1000
# BAD-VADDR-NEXT: LOAD 0x003020 0x0000000000008020 0x0000000000008800 0x000170 0x000170 RW 0x1000
# BAD-VADDR-LABEL: Section to Segment mapping:
@@ -97,7 +97,7 @@
# BAD-BOTH: .sec2 PROGBITS 0000000000008040 002040 000100 00 WA 0 0 1
# BAD-BOTH-LABEL: Program Headers:
# BAD-BOTH-NEXT: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
-# BAD-BOTH-NEXT: LOAD 0x001000 0x0000000000000000 0x0000000000000000 0x0000fd 0x0000fd R E 0x1000
+# BAD-BOTH-NEXT: LOAD 0x001000 0x0000000000000000 0x0000000000000000 0x000104 0x000104 R E 0x1000
# BAD-BOTH-NEXT: LOAD 0x002000 0x0000000000008000 0x0000000000008000 0x0001b0 0x0001b0 RW 0x1000
# BAD-BOTH-LABEL: Section to Segment mapping:
# BAD-BOTH: 01 .sec1 .sec2 .dynamic
Modified: lld/trunk/test/ELF/linkerscript/sections-sort.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/linkerscript/sections-sort.s?rev=332038&r1=332037&r2=332038&view=diff
==============================================================================
--- lld/trunk/test/ELF/linkerscript/sections-sort.s (original)
+++ lld/trunk/test/ELF/linkerscript/sections-sort.s Thu May 10 13:44:42 2018
@@ -15,11 +15,11 @@ nop
# CHECK: Id
# CHECK-NEXT: 0
-# CHECK-NEXT: 1 .text
-# CHECK-NEXT: 2 foo
-# CHECK-NEXT: 3 .dynsym
-# CHECK-NEXT: 4 .hash
-# CHECK-NEXT: 5 .dynstr
+# CHECK-NEXT: 1 .dynsym
+# CHECK-NEXT: 2 .dynstr
+# CHECK-NEXT: 3 .text
+# CHECK-NEXT: 4 foo
+# CHECK-NEXT: 5 .hash
# CHECK-NEXT: 6 .dynamic
# CHECK-NEXT: 7 .comment
# CHECK-NEXT: 8 .symtab
Modified: lld/trunk/test/ELF/linkerscript/sort-non-script.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/linkerscript/sort-non-script.s?rev=332038&r1=332037&r2=332038&view=diff
==============================================================================
--- lld/trunk/test/ELF/linkerscript/sort-non-script.s (original)
+++ lld/trunk/test/ELF/linkerscript/sort-non-script.s Thu May 10 13:44:42 2018
@@ -5,10 +5,10 @@
# RUN: ld.lld --hash-style=sysv -o %t1 --script %t.script %t -shared
# RUN: llvm-readobj -elf-output-style=GNU -s %t1 | FileCheck %s
-# CHECK: .text {{.*}} AX
-# CHECK-NEXT: .dynsym {{.*}} A
-# CHECK-NEXT: .hash {{.*}} A
+# CHECK: .dynsym {{.*}} A
# CHECK-NEXT: .dynstr {{.*}} A
+# CHECK-NEXT: .text {{.*}} AX
+# CHECK-NEXT: .hash {{.*}} A
# CHECK-NEXT: foo {{.*}} WA
# CHECK-NEXT: .dynamic {{.*}} WA
Modified: lld/trunk/test/ELF/linkerscript/symbol-only.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/linkerscript/symbol-only.test?rev=332038&r1=332037&r2=332038&view=diff
==============================================================================
--- lld/trunk/test/ELF/linkerscript/symbol-only.test (original)
+++ lld/trunk/test/ELF/linkerscript/symbol-only.test Thu May 10 13:44:42 2018
@@ -15,6 +15,8 @@ SECTIONS {
# CHECK-NEXT: Idx Name Size Address
# CHECK-NEXT: 0 00000000 0000000000000000
# CHECK: abc 00000000 [[ADDR:[0-9a-f]*]] BSS
+# CHECK-NEXT: .dynsym 00000030 0000000000000190
+# CHECK-NEXT: .dynstr 00000005 00000000000001c0
# CHECK-NEXT: bar 00000000 0000000000001000 DATA
# CHECK: SYMBOL TABLE:
Modified: lld/trunk/test/ELF/linkerscript/unused-synthetic.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/linkerscript/unused-synthetic.s?rev=332038&r1=332037&r2=332038&view=diff
==============================================================================
--- lld/trunk/test/ELF/linkerscript/unused-synthetic.s (original)
+++ lld/trunk/test/ELF/linkerscript/unused-synthetic.s Thu May 10 13:44:42 2018
@@ -10,8 +10,10 @@
# RUN: llvm-objdump -section-headers %t.so | FileCheck %s
# CHECK-NOT: .got
# CHECK-NOT: .plt
-# CHECK: .text
-# CHECK-NEXT: .dynsym
+# CHECK: .dynsym
+# CHECK-NEXT: .dynstr
+# CHECK-NEXT: .text
+# CHECK-NEXT: .gnu.hash
# Test that the size of a removed unused synthetic input section is not added
# to the output section size. Adding a symbol assignment prevents removal of
Modified: lld/trunk/test/ELF/map-file.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/map-file.s?rev=332038&r1=332037&r2=332038&view=diff
==============================================================================
--- lld/trunk/test/ELF/map-file.s (original)
+++ lld/trunk/test/ELF/map-file.s Thu May 10 13:44:42 2018
@@ -43,20 +43,20 @@ labs = 0x1AB5
// CHECK: VMA LMA Size Align Out In Symbol
// CHECK-NEXT: 2001c8 2001c8 78 8 .dynsym
// CHECK-NEXT: 2001c8 2001c8 78 8 <internal>:(.dynsym)
-// CHECK-NEXT: 200240 200240 2c 8 .gnu.hash
-// CHECK-NEXT: 200240 200240 2c 8 <internal>:(.gnu.hash)
-// CHECK-NEXT: 20026c 20026c 30 4 .hash
-// CHECK-NEXT: 20026c 20026c 30 4 <internal>:(.hash)
-// CHECK-NEXT: 20029c 20029c 31 1 .dynstr
-// CHECK-NEXT: 20029c 20029c 31 1 <internal>:(.dynstr)
-// CHECK-NEXT: 2002d0 2002d0 30 8 .rela.dyn
-// CHECK-NEXT: 2002d0 2002d0 30 8 <internal>:(.rela.dyn)
-// CHECK-NEXT: 200300 200300 30 8 .rela.plt
-// CHECK-NEXT: 200300 200300 30 8 <internal>:(.rela.plt)
-// CHECK-NEXT: 200330 200330 64 8 .eh_frame
-// CHECK-NEXT: 200330 200330 2c 1 {{.*}}{{/|\\}}map-file.s.tmp1.o:(.eh_frame+0x0)
-// CHECK-NEXT: 200360 200360 14 1 {{.*}}{{/|\\}}map-file.s.tmp1.o:(.eh_frame+0x2c)
-// CHECK-NEXT: 200378 200378 18 1 {{.*}}{{/|\\}}map-file.s.tmp2.o:(.eh_frame+0x18)
+// CHECK-NEXT: 200240 200240 31 1 .dynstr
+// CHECK-NEXT: 200240 200240 31 1 <internal>:(.dynstr)
+// CHECK-NEXT: 200278 200278 2c 8 .gnu.hash
+// CHECK-NEXT: 200278 200278 2c 8 <internal>:(.gnu.hash)
+// CHECK-NEXT: 2002a4 2002a4 30 4 .hash
+// CHECK-NEXT: 2002a4 2002a4 30 4 <internal>:(.hash)
+// CHECK-NEXT: 2002d8 2002d8 30 8 .rela.dyn
+// CHECK-NEXT: 2002d8 2002d8 30 8 <internal>:(.rela.dyn)
+// CHECK-NEXT: 200308 200308 30 8 .rela.plt
+// CHECK-NEXT: 200308 200308 30 8 <internal>:(.rela.plt)
+// CHECK-NEXT: 200338 200338 64 8 .eh_frame
+// CHECK-NEXT: 200338 200338 2c 1 {{.*}}{{/|\\}}map-file.s.tmp1.o:(.eh_frame+0x0)
+// CHECK-NEXT: 200368 200368 14 1 {{.*}}{{/|\\}}map-file.s.tmp1.o:(.eh_frame+0x2c)
+// CHECK-NEXT: 200380 200380 18 1 {{.*}}{{/|\\}}map-file.s.tmp2.o:(.eh_frame+0x18)
// CHECK-NEXT: 201000 201000 2d 4 .text
// CHECK-NEXT: 201000 201000 28 4 {{.*}}{{/|\\}}map-file.s.tmp1.o:(.text)
// CHECK-NEXT: 201000 201000 0 1 _start
@@ -95,6 +95,7 @@ labs = 0x1AB5
// CHECK-NEXT: 0 0 6d 1 .strtab
// CHECK-NEXT: 0 0 6d 1 <internal>:(.strtab)
+
// RUN: not ld.lld %t1.o %t2.o %t3.o %t4.a -o %t -Map=/ 2>&1 \
// RUN: | FileCheck -check-prefix=FAIL %s
// FAIL: cannot open map file /
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=332038&r1=332037&r2=332038&view=diff
==============================================================================
--- lld/trunk/test/ELF/merge-gc-piece.s (original)
+++ lld/trunk/test/ELF/merge-gc-piece.s Thu May 10 13:44:42 2018
@@ -10,7 +10,7 @@
# CHECK-NEXT: SHF_ALLOC
# CHECK-NEXT: SHF_MERGE
# CHECK-NEXT: ]
-# CHECK-NEXT: Address: 0x190
+# CHECK-NEXT: Address: 0x1C8
# CHECK: Name: .bar
# CHECK-NEXT: Type: SHT_PROGBITS
@@ -24,7 +24,7 @@
# CHECK-NEXT: AddressAlignment:
# CHECK-NEXT: EntrySize:
# CHECK-NEXT: SectionData (
-# CHECK-NEXT: 0000: 91010000 00000000 92010000 00000000
+# CHECK-NEXT: 0000: C9010000 00000000 CA010000 00000000
# CHECK-NEXT: )
.section .foo,"aM", at progbits,8
Modified: lld/trunk/test/ELF/merge-shared-str.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/merge-shared-str.s?rev=332038&r1=332037&r2=332038&view=diff
==============================================================================
--- lld/trunk/test/ELF/merge-shared-str.s (original)
+++ lld/trunk/test/ELF/merge-shared-str.s Thu May 10 13:44:42 2018
@@ -19,10 +19,10 @@
// CHECK-NEXT: SHF_MERGE
// CHECK-NEXT: SHF_STRINGS
// CHECK-NEXT: ]
-// CHECK-NEXT: Address: 0x1C8
+// CHECK-NEXT: Address: 0x1E1
// CHECK: Relocations [
// CHECK-NEXT: Section ({{.*}}) .rela.dyn {
-// CHECK-NEXT: 0x{{.*}} R_X86_64_RELATIVE - 0x1C9
+// CHECK-NEXT: 0x{{.*}} R_X86_64_RELATIVE - 0x1E2
// CHECK-NEXT: }
// CHECK-NEXT: ]
Modified: lld/trunk/test/ELF/merge-shared.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/merge-shared.s?rev=332038&r1=332037&r2=332038&view=diff
==============================================================================
--- lld/trunk/test/ELF/merge-shared.s (original)
+++ lld/trunk/test/ELF/merge-shared.s Thu May 10 13:44:42 2018
@@ -17,10 +17,10 @@
// CHECK-NEXT: SHF_ALLOC
// CHECK-NEXT: SHF_MERGE
// CHECK-NEXT: ]
-// CHECK-NEXT: Address: 0x1C8
+// CHECK-NEXT: Address: 0x1E4
// CHECK: Relocations [
// CHECK-NEXT: Section ({{.*}}) .rela.dyn {
-// CHECK-NEXT: 0x{{.*}} R_X86_64_RELATIVE - 0x1CA
+// CHECK-NEXT: 0x{{.*}} R_X86_64_RELATIVE - 0x1E6
// CHECK-NEXT: }
// CHECK-NEXT: ]
Modified: lld/trunk/test/ELF/merge-string.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/merge-string.s?rev=332038&r1=332037&r2=332038&view=diff
==============================================================================
--- lld/trunk/test/ELF/merge-string.s (original)
+++ lld/trunk/test/ELF/merge-string.s Thu May 10 13:44:42 2018
@@ -28,8 +28,8 @@ zed:
// CHECK-NEXT: SHF_MERGE
// CHECK-NEXT: SHF_STRINGS
// CHECK-NEXT: ]
-// CHECK-NEXT: Address: 0x1C8
-// CHECK-NEXT: Offset: 0x1C8
+// CHECK-NEXT: Address: 0x1E1
+// CHECK-NEXT: Offset: 0x1E1
// CHECK-NEXT: Size: 4
// CHECK-NEXT: Link: 0
// CHECK-NEXT: Info: 0
@@ -46,8 +46,8 @@ zed:
// NOTAIL-NEXT: SHF_MERGE
// NOTAIL-NEXT: SHF_STRINGS
// NOTAIL-NEXT: ]
-// NOTAIL-NEXT: Address: 0x1C8
-// NOTAIL-NEXT: Offset: 0x1C8
+// NOTAIL-NEXT: Address: 0x1E1
+// NOTAIL-NEXT: Offset: 0x1E1
// NOTAIL-NEXT: Size: 7
// NOTAIL-NEXT: Link: 0
// NOTAIL-NEXT: Info: 0
@@ -64,8 +64,8 @@ zed:
// NOMERGE-NEXT: SHF_MERGE
// NOMERGE-NEXT: SHF_STRINGS
// NOMERGE-NEXT: ]
-// NOMERGE-NEXT: Address: 0x1C8
-// NOMERGE-NEXT: Offset: 0x1C8
+// NOMERGE-NEXT: Address: 0x1E1
+// NOMERGE-NEXT: Offset: 0x1E1
// NOMERGE-NEXT: Size: 11
// NOMERGE-NEXT: Link: 0
// NOMERGE-NEXT: Info: 0
@@ -82,8 +82,8 @@ zed:
// CHECK-NEXT: SHF_MERGE
// CHECK-NEXT: SHF_STRINGS
// CHECK-NEXT: ]
-// CHECK-NEXT: Address: 0x1CC
-// CHECK-NEXT: Offset: 0x1CC
+// CHECK-NEXT: Address: 0x1E6
+// CHECK-NEXT: Offset: 0x1E6
// CHECK-NEXT: Size: 4
// CHECK-NEXT: Link: 0
// CHECK-NEXT: Info: 0
@@ -95,11 +95,11 @@ zed:
// CHECK: Name: bar
-// CHECK-NEXT: Value: 0x1C9
+// CHECK-NEXT: Value: 0x1E2
// CHECK: Name: foo
-// CHECK-NEXT: Value: 0x1C8
+// CHECK-NEXT: Value: 0x1E1
// CHECK: Name: zed
-// CHECK-NEXT: Value: 0x1CC
+// CHECK-NEXT: Value: 0x1E6
// CHECK-NEXT: Size: 0
Modified: lld/trunk/test/ELF/merge-sym.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/merge-sym.s?rev=332038&r1=332037&r2=332038&view=diff
==============================================================================
--- lld/trunk/test/ELF/merge-sym.s (original)
+++ lld/trunk/test/ELF/merge-sym.s Thu May 10 13:44:42 2018
@@ -15,7 +15,7 @@ foo:
// CHECK-NEXT: SHF_ALLOC
// CHECK-NEXT: SHF_MERGE
// CHECK-NEXT: ]
-// CHECK-NEXT: Address: 0x1C8
+// CHECK-NEXT: Address: 0x1E4
// CHECK: Name: foo
-// CHECK-NEXT: Value: 0x1CA
+// CHECK-NEXT: Value: 0x1E6
Modified: lld/trunk/test/ELF/merge-to-non-alloc.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/merge-to-non-alloc.s?rev=332038&r1=332037&r2=332038&view=diff
==============================================================================
--- lld/trunk/test/ELF/merge-to-non-alloc.s (original)
+++ lld/trunk/test/ELF/merge-to-non-alloc.s Thu May 10 13:44:42 2018
@@ -15,11 +15,11 @@
// CHECK-NEXT: AddressAlignment:
// CHECK-NEXT: EntrySize:
// CHECK-NEXT: SectionData (
-// CHECK-NEXT: 0000: C8010000 00000000 D0010000 00000000 |
+// CHECK-NEXT: 0000: E4010000 00000000 EC010000 00000000 |
// CHECK-NEXT: )
// CHECK: Name: foo
-// CHECK-NEXT: Value: 0x1C8
+// CHECK-NEXT: Value: 0x1E4
.section .foo,"aM", at progbits,4
.align 4
Modified: lld/trunk/test/ELF/mips-got-string.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/mips-got-string.s?rev=332038&r1=332037&r2=332038&view=diff
==============================================================================
--- lld/trunk/test/ELF/mips-got-string.s (original)
+++ lld/trunk/test/ELF/mips-got-string.s Thu May 10 13:44:42 2018
@@ -8,7 +8,7 @@
# CHECK: Symbol {
# CHECK: Name: $.str
-# CHECK-NEXT: Value: 0xF4
+# CHECK-NEXT: Value: 0x105
# CHECK: }
# CHECK: Local entries [
Modified: lld/trunk/test/ELF/mips-gp-ext.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/mips-gp-ext.s?rev=332038&r1=332037&r2=332038&view=diff
==============================================================================
--- lld/trunk/test/ELF/mips-gp-ext.s (original)
+++ lld/trunk/test/ELF/mips-gp-ext.s Thu May 10 13:44:42 2018
@@ -27,42 +27,42 @@
# REQUIRES: mips
# REL: Contents of section .text:
-# REL-NEXT: 0000 3c080000 2108010c 8f82fffc
+# REL-NEXT: 0030 3c080000 2108010c 8f82ffcc
# ^-- %hi(_gp_disp)
# ^-- %lo(_gp_disp)
# ^-- 8 - (0x10c - 0x100)
# G - (GP - .got)
# REL: Contents of section .reginfo:
-# REL-NEXT: 0028 10000104 00000000 00000000 00000000
-# REL-NEXT: 0038 00000000 0000010c
+# REL-NEXT: 0058 10000104 00000000 00000000 00000000
+# REL-NEXT: 0068 00000000 0000013c
# ^-- _gp
# REL: Contents of section .data:
# REL-NEXT: 00f0 fffffef4
# ^-- 0-0x10c
-# REL: 00000000 .text 00000000 foo
+# REL: 00000030 .text 00000000 foo
# REL: 00000000 *ABS* 00000000 .hidden _gp_disp
-# REL: 0000010c *ABS* 00000000 .hidden _gp
+# REL: 0000013c *ABS* 00000000 .hidden _gp
# ABS: Contents of section .text:
-# ABS-NEXT: 0000 3c080000 21080200 8f82ff08
+# ABS-NEXT: 0030 3c080000 210801d0 8f82ff08
# ^-- %hi(_gp_disp)
# ^-- %lo(_gp_disp)
# ^-- 8 - (0x200 - 0x100)
# G - (GP - .got)
# ABS: Contents of section .reginfo:
-# ABS-NEXT: 0028 10000104 00000000 00000000 00000000
-# ABS-NEXT: 0038 00000000 00000200
+# ABS-NEXT: 0058 10000104 00000000 00000000 00000000
+# ABS-NEXT: 0068 00000000 00000200
# ^-- _gp
# ABS: Contents of section .data:
-# ABS-NEXT: 00f0 fffffe00
+# ABS-NEXT: 00f0 fffffe30
# ^-- 0-0x200
-# ABS: 00000000 .text 00000000 foo
+# ABS: 00000030 .text 00000000 foo
# ABS: 00000000 *ABS* 00000000 .hidden _gp_disp
# ABS: 00000200 *ABS* 00000000 .hidden _gp
Modified: lld/trunk/test/ELF/mips-gp-lowest.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/mips-gp-lowest.s?rev=332038&r1=332037&r2=332038&view=diff
==============================================================================
--- lld/trunk/test/ELF/mips-gp-lowest.s (original)
+++ lld/trunk/test/ELF/mips-gp-lowest.s Thu May 10 13:44:42 2018
@@ -26,7 +26,7 @@ foo:
# CHECK-NEXT: SHF_MIPS_GPREL
# CHECK-NEXT: SHF_WRITE
# CHECK-NEXT: ]
-# CHECK-NEXT: Address: 0xE0
+# CHECK-NEXT: Address: 0xF0
# CHECK: }
# CHECK: Section {
# CHECK: Name: .got
@@ -36,9 +36,9 @@ foo:
# CHECK-NEXT: SHF_MIPS_GPREL
# CHECK-NEXT: SHF_WRITE
# CHECK-NEXT: ]
-# CHECK-NEXT: Address: 0xF0
+# CHECK-NEXT: Address: 0x100
# CHECK: }
# CHECK: Name: _gp (5)
-# CHECK-NEXT: Value: 0x80D0
+# CHECK-NEXT: Value: 0x80E0
# ^-- 0xE0 + 0x7ff0
Modified: lld/trunk/test/ELF/note-noalloc.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/note-noalloc.s?rev=332038&r1=332037&r2=332038&view=diff
==============================================================================
--- lld/trunk/test/ELF/note-noalloc.s (original)
+++ lld/trunk/test/ELF/note-noalloc.s Thu May 10 13:44:42 2018
@@ -25,7 +25,7 @@
// CHECK: Type: PT_NOTE
// CHECK-NEXT: Offset:
// CHECK-NEXT: VirtualAddress: 0x[[ADDR]]
-// CHECK-NEXT: PhysicalAddress: 0x245
+// CHECK-NEXT: PhysicalAddress: 0x24C
// CHECK-NEXT: FileSize: 16
// CHECK-NEXT: MemSize: 16
// CHECK-NOT: PT_NOTE
Modified: lld/trunk/test/ELF/relocation-shared.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/relocation-shared.s?rev=332038&r1=332037&r2=332038&view=diff
==============================================================================
--- lld/trunk/test/ELF/relocation-shared.s (original)
+++ lld/trunk/test/ELF/relocation-shared.s Thu May 10 13:44:42 2018
@@ -8,7 +8,7 @@
// CHECK-NEXT: Flags [
// CHECK-NEXT: SHF_ALLOC
// CHECK-NEXT: ]
-// CHECK-NEXT: Address: 0x1C8
+// CHECK-NEXT: Address: 0x1E1
// CHECK-NEXT: Offset:
// CHECK-NEXT: Size: 8
// CHECK-NEXT: Link: 0
@@ -16,8 +16,8 @@
// CHECK-NEXT: AddressAlignment: 1
// CHECK-NEXT: EntrySize: 0
// CHECK-NEXT: SectionData (
-// CHECK-NEXT: 0000: 380E0000 00000000
-// 0x1000 - 0x1C8 = 0xE38
+// CHECK-NEXT: 0000: 1F0E0000 00000000
+// 0x1000 - 0x1E1 = 0xE1F
// CHECK-NEXT: )
// CHECK: Name: .text
Modified: lld/trunk/test/ELF/relocation.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/relocation.s?rev=332038&r1=332037&r2=332038&view=diff
==============================================================================
--- lld/trunk/test/ELF/relocation.s (original)
+++ lld/trunk/test/ELF/relocation.s Thu May 10 13:44:42 2018
@@ -113,7 +113,7 @@ R_X86_64_64:
.quad R_X86_64_64
// CHECK: Contents of section .R_X86_64_64:
-// CHECK-NEXT: 2001c8 c8012000 00000000
+// CHECK-NEXT: 2002b0 b0022000 00000000
.section .R_X86_64_GOTPCREL,"a", at progbits
.global R_X86_64_GOTPCREL
@@ -123,7 +123,7 @@ R_X86_64_GOTPCREL:
// 0x2020F8 - 0x2001D8 = 7952
// 7952 = 0x101f0000 in little endian
// CHECK: Contents of section .R_X86_64_GOTPCREL
-// CHECK-NEXT: 2001d0 202f0000
+// CHECK-NEXT: 2002b8 382e0000
.section .R_X86_64_GOT32,"a", at progbits
.global R_X86_64_GOT32
Modified: lld/trunk/test/ELF/relro-omagic.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/relro-omagic.s?rev=332038&r1=332037&r2=332038&view=diff
==============================================================================
--- lld/trunk/test/ELF/relro-omagic.s (original)
+++ lld/trunk/test/ELF/relro-omagic.s Thu May 10 13:44:42 2018
@@ -9,8 +9,8 @@
# NORELRO-NEXT: Idx Name Size Address Type
# NORELRO-NEXT: 0 00000000 0000000000000000
# NORELRO-NEXT: 1 .dynsym 00000048 0000000000200120
-# NORELRO-NEXT: 2 .hash 00000020 0000000000200168
-# NORELRO-NEXT: 3 .dynstr 00000021 0000000000200188
+# NORELRO-NEXT: 2 .dynstr 00000021 0000000000200168
+# NORELRO-NEXT: 3 .hash 00000020 000000000020018c
# NORELRO-NEXT: 4 .rela.dyn 00000018 00000000002001b0
# NORELRO-NEXT: 5 .rela.plt 00000018 00000000002001c8
# NORELRO-NEXT: 6 .text 0000000a 00000000002001e0 TEXT DATA
Modified: lld/trunk/test/ELF/shared.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/shared.s?rev=332038&r1=332037&r2=332038&view=diff
==============================================================================
--- lld/trunk/test/ELF/shared.s (original)
+++ lld/trunk/test/ELF/shared.s Thu May 10 13:44:42 2018
@@ -59,21 +59,6 @@
// CHECK-NEXT: 0030:
// CHECK-NEXT: )
// CHECK-NEXT: }
-// CHECK-NEXT: Section {
-// CHECK-NEXT: Index: 3
-// CHECK-NEXT: Name: .hash
-// CHECK-NEXT: Type: SHT_HASH
-// CHECK-NEXT: Flags [
-// CHECK-NEXT: SHF_ALLOC
-// CHECK-NEXT: ]
-// CHECK-NEXT: Address: [[HASHADDR:.*]]
-// CHECK-NEXT: Offset:
-// CHECK-NEXT: Size:
-// CHECK-NEXT: Link: 2
-// CHECK-NEXT: Info: 0
-// CHECK-NEXT: AddressAlignment: 4
-// CHECK-NEXT: EntrySize: 4
-
// CHECK: Index: [[DYNSTR]]
// CHECK-NEXT: Name: .dynstr
// CHECK-NEXT: Type: SHT_STRTAB
@@ -90,6 +75,20 @@
// CHECK-NEXT: SectionData (
// CHECK: )
// CHECK-NEXT: }
+// CHECK-NEXT: Section {
+// CHECK-NEXT: Index: 4
+// CHECK-NEXT: Name: .hash
+// CHECK-NEXT: Type: SHT_HASH
+// CHECK-NEXT: Flags [
+// CHECK-NEXT: SHF_ALLOC
+// CHECK-NEXT: ]
+// CHECK-NEXT: Address: [[HASHADDR:.*]]
+// CHECK-NEXT: Offset:
+// CHECK-NEXT: Size:
+// CHECK-NEXT: Link: 2
+// CHECK-NEXT: Info: 0
+// CHECK-NEXT: AddressAlignment: 4
+// CHECK-NEXT: EntrySize: 4
// CHECK: Name: .rel.dyn
// CHECK-NEXT: Type: SHT_REL
Modified: lld/trunk/test/ELF/sort-norosegment.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/sort-norosegment.s?rev=332038&r1=332037&r2=332038&view=diff
==============================================================================
--- lld/trunk/test/ELF/sort-norosegment.s (original)
+++ lld/trunk/test/ELF/sort-norosegment.s Thu May 10 13:44:42 2018
@@ -4,10 +4,10 @@
# RUN: ld.lld --hash-style=sysv -no-rosegment -o %t1 %t -shared
# RUN: llvm-readobj -elf-output-style=GNU -s %t1 | FileCheck %s
-# CHECK: .text {{.*}} AX
-# CHECK-NEXT: .dynsym {{.*}} A
-# CHECK-NEXT: .hash {{.*}} A
+# CHECK: .dynsym {{.*}} A
# CHECK-NEXT: .dynstr {{.*}} A
+# CHECK-NEXT: .text {{.*}} AX
+# CHECK-NEXT: .hash {{.*}} A
# CHECK-NEXT: foo {{.*}} WA
# CHECK-NEXT: .dynamic {{.*}} WA
Modified: lld/trunk/test/ELF/synthetic-got.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/synthetic-got.s?rev=332038&r1=332037&r2=332038&view=diff
==============================================================================
--- lld/trunk/test/ELF/synthetic-got.s (original)
+++ lld/trunk/test/ELF/synthetic-got.s Thu May 10 13:44:42 2018
@@ -7,13 +7,13 @@
# RUN: | FileCheck %s --check-prefix=GOTDATA
# GOT: Sections:
-# GOT: 8 .got.plt 00000020 00000000000000e0 DATA
-# GOT: 10 .got 00000008 00000000000001d0 DATA
+# GOT: 8 .got.plt 00000020 00000000000000d0 DATA
+# GOT: 10 .got 00000008 00000000000001c0 DATA
# GOTDATA: Contents of section .got.plt:
-# GOTDATA-NEXT: 00e0 00010000 00000000 00000000 00000000
-# GOTDATA-NEXT: 00f0 00000000 00000000 d6000000 00000000
+# GOTDATA-NEXT: 00d0 f0000000 00000000 00000000 00000000
+# GOTDATA-NEXT: 00e0 00000000 00000000 c6000000 00000000
# GOTDATA-NEXT: Contents of section .got:
-# GOTDATA-NEXT: 01d0 00000000 00000000
+# GOTDATA-NEXT: 01c0 00000000 00000000
# RUN: echo "SECTIONS { .mygot : { *(.got) *(.got.plt) } }" > %t1.script
# RUN: ld.lld --hash-style=sysv -shared %t.o -o %t1.out --script %t1.script
@@ -21,12 +21,12 @@
# RUN: llvm-objdump -s -section=.mygot %t1.out | FileCheck %s --check-prefix=MYGOTDATA
# MYGOT: Sections:
-# MYGOT: 8 .mygot 00000028 00000000000000e0 DATA
+# MYGOT: 8 .mygot 00000028 00000000000000d0 DATA
# MYGOT-NOT: .got
# MYGOT-NOT: .got.plt
-# MYGOTDATA: 00e0 00000000 00000000 08010000 00000000
-# MYGOTDATA-NEXT: 00f0 00000000 00000000 00000000 00000000
-# MYGOTDATA-NEXT: 0100 d6000000 00000000
+# MYGOTDATA: 00d0 00000000 00000000 f8000000 00000000
+# MYGOTDATA-NEXT: 00e0 00000000 00000000 00000000 00000000
+# MYGOTDATA-NEXT: 00f0 c6000000 00000000
mov bar at gotpcrel(%rip), %rax
call foo at plt
Modified: lld/trunk/test/ELF/verdef-defaultver.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/verdef-defaultver.s?rev=332038&r1=332037&r2=332038&view=diff
==============================================================================
--- lld/trunk/test/ELF/verdef-defaultver.s (original)
+++ lld/trunk/test/ELF/verdef-defaultver.s Thu May 10 13:44:42 2018
@@ -55,8 +55,8 @@
# DSO-NEXT: ]
# DSO-NEXT: Version symbols {
# DSO-NEXT: Section Name: .gnu.version
-# DSO-NEXT: Address: 0x240
-# DSO-NEXT: Offset: 0x240
+# DSO-NEXT: Address: 0x256
+# DSO-NEXT: Offset: 0x256
# DSO-NEXT: Link: 1
# DSO-NEXT: Symbols [
# DSO-NEXT: Symbol {
@@ -150,8 +150,8 @@
# EXE-NEXT: ]
# EXE-NEXT: Version symbols {
# EXE-NEXT: Section Name: .gnu.version
-# EXE-NEXT: Address: 0x200228
-# EXE-NEXT: Offset: 0x228
+# EXE-NEXT: Address: 0x20023C
+# EXE-NEXT: Offset: 0x23C
# EXE-NEXT: Link: 1
# EXE-NEXT: Symbols [
# EXE-NEXT: Symbol {
Modified: lld/trunk/test/ELF/verdef.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/verdef.s?rev=332038&r1=332037&r2=332038&view=diff
==============================================================================
--- lld/trunk/test/ELF/verdef.s (original)
+++ lld/trunk/test/ELF/verdef.s Thu May 10 13:44:42 2018
@@ -8,8 +8,8 @@
# DSO: Version symbols {
# DSO-NEXT: Section Name: .gnu.version
-# DSO-NEXT: Address: 0x228
-# DSO-NEXT: Offset: 0x228
+# DSO-NEXT: Address: 0x260
+# DSO-NEXT: Offset: 0x260
# DSO-NEXT: Link: 1
# DSO-NEXT: Symbols [
# DSO-NEXT: Symbol {
@@ -70,8 +70,8 @@
# MAIN: Version symbols {
# MAIN-NEXT: Section Name: .gnu.version
-# MAIN-NEXT: Address: 0x200228
-# MAIN-NEXT: Offset: 0x228
+# MAIN-NEXT: Address: 0x200260
+# MAIN-NEXT: Offset: 0x260
# MAIN-NEXT: Link: 1
# MAIN-NEXT: Symbols [
# MAIN-NEXT: Symbol {
Modified: lld/trunk/test/ELF/verneed.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/verneed.s?rev=332038&r1=332037&r2=332038&view=diff
==============================================================================
--- lld/trunk/test/ELF/verneed.s (original)
+++ lld/trunk/test/ELF/verneed.s Thu May 10 13:44:42 2018
@@ -10,67 +10,70 @@
# RUN: llvm-readobj -V -sections -section-data -dyn-symbols -dynamic-table %t | FileCheck %s
# CHECK: Section {
-# CHECK: Index: 1
-# CHECK-NEXT: Name: .dynsym
-# CHECK-NEXT: Type: SHT_DYNSYM (0xB)
+# CHECK: Index: 1
+# CHECK-NEXT: Name: .dynsym
+# CHECK-NEXT: Type: SHT_DYNSYM (0xB)
+# CHECK-NEXT: Flags [ (0x2)
+# CHECK-NEXT: SHF_ALLOC (0x2)
+# CHECK-NEXT: ]
+# CHECK-NEXT: Address: 0x2001C8
+# CHECK-NEXT: Offset: 0x1C8
+# CHECK-NEXT: Size: 96
+# CHECK-NEXT: Link: 2
+# CHECK-NEXT: Info: 1
+# CHECK-NEXT: AddressAlignment: 8
+# CHECK-NEXT: EntrySize: 24
+
+# CHECK: Section {
+# CHECK-NEXT: Index: 2
+# CHECK-NEXT: Name: .dynstr
+# CHECK-NEXT: Type: SHT_STRTAB (0x3)
+# CHECK-NEXT: Flags [ (0x2)
+# CHECK-NEXT: SHF_ALLOC (0x2)
+# CHECK-NEXT: ]
+# CHECK-NEXT: Address: 0x200228
+# CHECK-NEXT: Offset: 0x228
+# CHECK-NEXT: Size: 47
+# CHECK-NEXT: Link: 0
+# CHECK-NEXT: Info: 0
+# CHECK-NEXT: AddressAlignment: 1
+# CHECK-NEXT: EntrySize: 0
+# CHECK-NEXT: SectionData (
+# CHECK-NEXT: 0000: 00766572 6E656564 312E736F 2E300076 |.verneed1.so.0.v|
+# CHECK-NEXT: 0010: 65726E65 6564322E 736F2E30 00663100 |erneed2.so.0.f1.|
+# CHECK-NEXT: 0020: 76330066 32007632 00673100 763100 |v3.f2.v2.g1.v1.|
+# CHECK-NEXT: )
+# CHECK-NEXT: }
+
+# CHECK: Section {
+# CHECK-NEXT: Index: 3
+# CHECK-NEXT: Name: .gnu.version
+# CHECK-NEXT: Type: SHT_GNU_versym (0x6FFFFFFF)
# CHECK-NEXT: Flags [ (0x2)
# CHECK-NEXT: SHF_ALLOC (0x2)
# CHECK-NEXT: ]
-# CHECK-NEXT: Address: 0x2001C8
-# CHECK-NEXT: Offset: 0x1C8
-# CHECK-NEXT: Size: 96
-# CHECK-NEXT: Link: 5
-# CHECK-NEXT: Info: 1
-# CHECK-NEXT: AddressAlignment: 8
-# CHECK-NEXT: EntrySize: 24
-# CHECK: Section {
-# CHECK-NEXT: Index: 2
-# CHECK-NEXT: Name: .gnu.version
-# CHECK-NEXT: Type: SHT_GNU_versym (0x6FFFFFFF)
-# CHECK-NEXT: Flags [ (0x2)
-# CHECK-NEXT: SHF_ALLOC (0x2)
-# CHECK-NEXT: ]
-# CHECK-NEXT: Address: 0x200228
-# CHECK-NEXT: Offset: 0x228
-# CHECK-NEXT: Size: 8
-# CHECK-NEXT: Link: 1
-# CHECK-NEXT: Info: 0
-# CHECK-NEXT: AddressAlignment: 2
-# CHECK-NEXT: EntrySize: 2
+# CHECK-NEXT: Address: 0x200258
+# CHECK-NEXT: Offset: 0x258
+# CHECK-NEXT: Size: 8
+# CHECK-NEXT: Link: 1
+# CHECK-NEXT: Info: 0
+# CHECK-NEXT: AddressAlignment: 2
+# CHECK-NEXT: EntrySize: 2
+
# CHECK: Section {
-# CHECK-NEXT: Index: 3
-# CHECK-NEXT: Name: .gnu.version_r
-# CHECK-NEXT: Type: SHT_GNU_verneed (0x6FFFFFFE)
-# CHECK-NEXT: Flags [ (0x2)
-# CHECK-NEXT: SHF_ALLOC (0x2)
-# CHECK-NEXT: ]
-# CHECK-NEXT: Address: 0x200230
-# CHECK-NEXT: Offset: 0x230
-# CHECK-NEXT: Size: 80
-# CHECK-NEXT: Link: 5
-# CHECK-NEXT: Info: 2
-# CHECK-NEXT: AddressAlignment: 4
-# CHECK-NEXT: EntrySize: 0
-# CHECK: Section {
-# CHECK: Index: 5
-# CHECK-NEXT: Name: .dynstr
-# CHECK-NEXT: Type: SHT_STRTAB
-# CHECK-NEXT: Flags [ (0x2)
-# CHECK-NEXT: SHF_ALLOC (0x2)
-# CHECK-NEXT: ]
-# CHECK-NEXT: Address: 0x2002A8
-# CHECK-NEXT: Offset: 0x2A8
-# CHECK-NEXT: Size: 47
-# CHECK-NEXT: Link: 0
-# CHECK-NEXT: Info: 0
-# CHECK-NEXT: AddressAlignment: 1
-# CHECK-NEXT: EntrySize: 0
-# CHECK-NEXT: SectionData (
-# CHECK-NEXT: 0000: 00766572 6E656564 312E736F 2E300076 |.verneed1.so.0.v|
-# CHECK-NEXT: 0010: 65726E65 6564322E 736F2E30 00663100 |erneed2.so.0.f1.|
-# CHECK-NEXT: 0020: 76330066 32007632 00673100 763100 |v3.f2.v2.g1.v1.|
-# CHECK-NEXT: )
-# CHECK-NEXT: }
+# CHECK-NEXT: Index: 4
+# CHECK-NEXT: Name: .gnu.version_r
+# CHECK-NEXT: Type: SHT_GNU_verneed (0x6FFFFFFE)
+# CHECK-NEXT: Flags [ (0x2)
+# CHECK-NEXT: SHF_ALLOC (0x2)
+# CHECK-NEXT: ]
+# CHECK-NEXT: Address: 0x200260
+# CHECK-NEXT: Offset: 0x260
+# CHECK-NEXT: Size: 80
+# CHECK-NEXT: Link: 2
+# CHECK-NEXT: Info: 2
+# CHECK-NEXT: AddressAlignment: 4
+# CHECK-NEXT: EntrySize: 0
# CHECK: DynamicSymbols [
# CHECK-NEXT: Symbol {
@@ -111,14 +114,14 @@
# CHECK-NEXT: }
# CHECK-NEXT: ]
-# CHECK: 0x000000006FFFFFF0 VERSYM 0x200228
-# CHECK-NEXT: 0x000000006FFFFFFE VERNEED 0x200230
+# CHECK: 0x000000006FFFFFF0 VERSYM 0x200258
+# CHECK-NEXT: 0x000000006FFFFFFE VERNEED 0x200260
# CHECK-NEXT: 0x000000006FFFFFFF VERNEEDNUM 2
# CHECK: Version symbols {
# CHECK-NEXT: Section Name: .gnu.version
-# CHECK-NEXT: Address: 0x200228
-# CHECK-NEXT: Offset: 0x228
+# CHECK-NEXT: Address: 0x200258
+# CHECK-NEXT: Offset: 0x258
# CHECK-NEXT: Link: 1
# CHECK-NEXT: Symbols [
# CHECK-NEXT: Symbol {
Modified: lld/trunk/test/ELF/version-script-extern.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/version-script-extern.s?rev=332038&r1=332037&r2=332038&view=diff
==============================================================================
--- lld/trunk/test/ELF/version-script-extern.s (original)
+++ lld/trunk/test/ELF/version-script-extern.s Thu May 10 13:44:42 2018
@@ -68,8 +68,8 @@
# DSO-NEXT: ]
# DSO-NEXT: Version symbols {
# DSO-NEXT: Section Name: .gnu.version
-# DSO-NEXT: Address: 0x258
-# DSO-NEXT: Offset: 0x258
+# DSO-NEXT: Address: 0x32A
+# DSO-NEXT: Offset: 0x32A
# DSO-NEXT: Link: 1
# DSO-NEXT: Symbols [
# DSO-NEXT: Symbol {
Modified: lld/trunk/test/ELF/x86-64-retpoline-linkerscript.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/x86-64-retpoline-linkerscript.s?rev=332038&r1=332037&r2=332038&view=diff
==============================================================================
--- lld/trunk/test/ELF/x86-64-retpoline-linkerscript.s (original)
+++ lld/trunk/test/ELF/x86-64-retpoline-linkerscript.s Thu May 10 13:44:42 2018
@@ -14,8 +14,8 @@
// CHECK: Disassembly of section .plt:
// CHECK-NEXT: .plt:
-// CHECK-NEXT: 10: ff 35 4a 01 00 00 pushq 330(%rip)
-// CHECK-NEXT: 16: 4c 8b 1d 4b 01 00 00 movq 331(%rip), %r11
+// CHECK-NEXT: 10: ff 35 ea 00 00 00 pushq 234(%rip)
+// CHECK-NEXT: 16: 4c 8b 1d eb 00 00 00 movq 235(%rip), %r11
// CHECK-NEXT: 1d: e8 0e 00 00 00 callq 14 <.plt+0x20>
// CHECK-NEXT: 22: f3 90 pause
// CHECK-NEXT: 24: 0f ae e8 lfence
@@ -40,7 +40,7 @@
// CHECK-NEXT: 3d: cc int3
// CHECK-NEXT: 3e: cc int3
// CHECK-NEXT: 3f: cc int3
-// CHECK-NEXT: 40: 4c 8b 1d 29 01 00 00 movq 297(%rip), %r11
+// CHECK-NEXT: 40: 4c 8b 1d c9 00 00 00 movq 201(%rip), %r11
// CHECK-NEXT: 47: e8 e4 ff ff ff callq -28 <.plt+0x20>
// CHECK-NEXT: 4c: e9 d1 ff ff ff jmp -47 <.plt+0x12>
// CHECK-NEXT: 51: 68 00 00 00 00 pushq $0
@@ -50,7 +50,7 @@
// CHECK-NEXT: 5d: cc int3
// CHECK-NEXT: 5e: cc int3
// CHECK-NEXT: 5f: cc int3
-// CHECK-NEXT: 60: 4c 8b 1d 11 01 00 00 movq 273(%rip), %r11
+// CHECK-NEXT: 60: 4c 8b 1d b1 00 00 00 movq 177(%rip), %r11
// CHECK-NEXT: 67: e8 c4 ff ff ff callq -60 <.plt+0x20>
// CHECK-NEXT: 6c: e9 b1 ff ff ff jmp -79 <.plt+0x12>
// CHECK-NEXT: 71: 68 01 00 00 00 pushq $1
Modified: lld/trunk/test/ELF/x86-64-retpoline-znow-linkerscript.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/x86-64-retpoline-znow-linkerscript.s?rev=332038&r1=332037&r2=332038&view=diff
==============================================================================
--- lld/trunk/test/ELF/x86-64-retpoline-znow-linkerscript.s (original)
+++ lld/trunk/test/ELF/x86-64-retpoline-znow-linkerscript.s Thu May 10 13:44:42 2018
@@ -35,13 +35,13 @@
// CHECK-NEXT: 2d: cc int3
// CHECK-NEXT: 2e: cc int3
// CHECK-NEXT: 2f: cc int3
-// CHECK-NEXT: 30: 4c 8b 1d 09 01 00 00 movq 265(%rip), %r11
+// CHECK-NEXT: 30: 4c 8b 1d a9 00 00 00 movq 169(%rip), %r11
// CHECK-NEXT: 37: e9 d4 ff ff ff jmp -44 <.plt>
// CHECK-NEXT: 3c: cc int3
// CHECK-NEXT: 3d: cc int3
// CHECK-NEXT: 3e: cc int3
// CHECK-NEXT: 3f: cc int3
-// CHECK-NEXT: 40: 4c 8b 1d 01 01 00 00 movq 257(%rip), %r11
+// CHECK-NEXT: 40: 4c 8b 1d a1 00 00 00 movq 161(%rip), %r11
// CHECK-NEXT: 47: e9 c4 ff ff ff jmp -60 <.plt>
// CHECK-NEXT: 4c: cc int3
// CHECK-NEXT: 4d: cc int3
More information about the llvm-commits
mailing list