diff options
| author | Peter Collingbourne <peter@pcc.me.uk> | 2017-01-10 01:21:30 +0000 | 
|---|---|---|
| committer | Peter Collingbourne <peter@pcc.me.uk> | 2017-01-10 01:21:30 +0000 | 
| commit | 628ec9f193300f9a031f4fa926892f4a9687ccfe (patch) | |
| tree | cac66f5709f3842b69417e80cf189bdd7494cb59 | |
| parent | 89c3170d615d3781ce024cd0dd662fcb70a6bcb6 (diff) | |
| download | bcm5719-llvm-628ec9f193300f9a031f4fa926892f4a9687ccfe.tar.gz bcm5719-llvm-628ec9f193300f9a031f4fa926892f4a9687ccfe.zip  | |
ELF: Place relro sections after non-relro sections in r/w segment.
This is in preparation for my next change, which will introduce a relro
nobits section. That requires that relro sections appear at the end of the
progbits part of the r/w segment so that the relro nobits section can appear
contiguously.
Because of the amount of churn required in the test suite, I'm making this
change separately.
llvm-svn: 291523
85 files changed, 630 insertions, 618 deletions
diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp index 2534b1146e3..1d0cb7c229d 100644 --- a/lld/ELF/Writer.cpp +++ b/lld/ELF/Writer.cpp @@ -557,30 +557,38 @@ static bool compareSectionsNonScript(const OutputSectionBase *A,    // If we got here we know that both A and B are in the same PT_LOAD. -  // The TLS initialization block needs to be a single contiguous block in a R/W -  // PT_LOAD, so stick TLS sections directly before R/W sections. The TLS NOBITS -  // sections are placed here as they don't take up virtual address space in the -  // PT_LOAD.    bool AIsTls = A->Flags & SHF_TLS;    bool BIsTls = B->Flags & SHF_TLS; -  if (AIsTls != BIsTls) -    return AIsTls; - -  // The next requirement we have is to put nobits sections last. The -  // reason is that the only thing the dynamic linker will see about -  // them is a p_memsz that is larger than p_filesz. Seeing that it -  // zeros the end of the PT_LOAD, so that has to correspond to the -  // nobits sections.    bool AIsNoBits = A->Type == SHT_NOBITS;    bool BIsNoBits = B->Type == SHT_NOBITS; -  if (AIsNoBits != BIsNoBits) -    return BIsNoBits; -  // We place RelRo section before plain r/w ones. +  // The first requirement we have is to put (non-TLS) nobits sections last. The +  // reason is that the only thing the dynamic linker will see about them is a +  // p_memsz that is larger than p_filesz. Seeing that it zeros the end of the +  // PT_LOAD, so that has to correspond to the nobits sections. +  bool AIsNonTlsNoBits = AIsNoBits && !AIsTls; +  bool BIsNonTlsNoBits = BIsNoBits && !BIsTls; +  if (AIsNonTlsNoBits != BIsNonTlsNoBits) +    return BIsNonTlsNoBits; + +  // We place nobits RelRo sections before plain r/w ones, and non-nobits RelRo +  // sections after r/w ones, so that the RelRo sections are contiguous.    bool AIsRelRo = isRelroSection<ELFT>(A);    bool BIsRelRo = isRelroSection<ELFT>(B);    if (AIsRelRo != BIsRelRo) -    return AIsRelRo; +    return AIsNonTlsNoBits ? AIsRelRo : BIsRelRo; + +  // The TLS initialization block needs to be a single contiguous block in a R/W +  // PT_LOAD, so stick TLS sections directly before the other RelRo R/W +  // sections. The TLS NOBITS sections are placed here as they don't take up +  // virtual address space in the PT_LOAD. +  if (AIsTls != BIsTls) +    return AIsTls; + +  // Within the TLS initialization block, the non-nobits sections need to appear +  // first. +  if (AIsNoBits != BIsNoBits) +    return BIsNoBits;    // Some architectures have additional ordering restrictions for sections    // within the same PT_LOAD. @@ -1272,8 +1280,9 @@ void Writer<ELFT>::addPtArmExid(std::vector<PhdrEntry> &Phdrs) {    Phdrs.push_back(ARMExidx);  } -// The first section of each PT_LOAD and the first section after PT_GNU_RELRO -// have to be page aligned so that the dynamic linker can set the permissions. +// The first section of each PT_LOAD, the first section in PT_GNU_RELRO and the +// first section after PT_GNU_RELRO have to be page aligned so that the dynamic +// linker can set the permissions.  template <class ELFT> void Writer<ELFT>::fixSectionAlignments() {    for (const PhdrEntry &P : Phdrs)      if (P.p_type == PT_LOAD && P.First) @@ -1282,6 +1291,8 @@ template <class ELFT> void Writer<ELFT>::fixSectionAlignments() {    for (const PhdrEntry &P : Phdrs) {      if (P.p_type != PT_GNU_RELRO)        continue; +    if (P.First) +      P.First->PageAlign = true;      // Find the first section after PT_GNU_RELRO. If it is in a PT_LOAD we      // have to align it to a page.      auto End = OutputSections.end(); diff --git a/lld/test/ELF/aarch64-condb-reloc.s b/lld/test/ELF/aarch64-condb-reloc.s index b2af445f4b6..23c16c2db89 100644 --- a/lld/test/ELF/aarch64-condb-reloc.s +++ b/lld/test/ELF/aarch64-condb-reloc.s @@ -36,8 +36,8 @@  #DSOREL-NEXT:     SHF_ALLOC  #DSOREL-NEXT:     SHF_WRITE  #DSOREL-NEXT:   ] -#DSOREL-NEXT:   Address: 0x30000 -#DSOREL-NEXT:   Offset: 0x30000 +#DSOREL-NEXT:   Address: 0x20000 +#DSOREL-NEXT:   Offset: 0x20000  #DSOREL-NEXT:   Size: 48  #DSOREL-NEXT:   Link: 0  #DSOREL-NEXT:   Info: 0 @@ -46,9 +46,9 @@  #DSOREL-NEXT:  }  #DSOREL:      Relocations [  #DSOREL-NEXT:  Section ({{.*}}) .rela.plt { -#DSOREL-NEXT:    0x30018 R_AARCH64_JUMP_SLOT _foo -#DSOREL-NEXT:    0x30020 R_AARCH64_JUMP_SLOT _bar -#DSOREL-NEXT:    0x30028 R_AARCH64_JUMP_SLOT _dah +#DSOREL-NEXT:    0x20018 R_AARCH64_JUMP_SLOT _foo +#DSOREL-NEXT:    0x20020 R_AARCH64_JUMP_SLOT _bar +#DSOREL-NEXT:    0x20028 R_AARCH64_JUMP_SLOT _dah  #DSOREL-NEXT:  }  #DSOREL-NEXT:] @@ -72,22 +72,22 @@  #DSO-NEXT: Disassembly of section .plt:  #DSO-NEXT: .plt:  #DSO-NEXT:     10030: {{.*}} stp x16, x30, [sp, #-16]! -#DSO-NEXT:     10034: {{.*}} adrp x16, #131072 +#DSO-NEXT:     10034: {{.*}} adrp x16, #65536  #DSO-NEXT:     10038: {{.*}} ldr x17, [x16, #16]  #DSO-NEXT:     1003c: {{.*}} add x16, x16, #16  #DSO-NEXT:     10040: {{.*}} br x17  #DSO-NEXT:     10044: {{.*}} nop  #DSO-NEXT:     10048: {{.*}} nop  #DSO-NEXT:     1004c: {{.*}} nop -#DSO-NEXT:     10050: {{.*}} adrp x16, #131072 +#DSO-NEXT:     10050: {{.*}} adrp x16, #65536  #DSO-NEXT:     10054: {{.*}} ldr x17, [x16, #24]  #DSO-NEXT:     10058: {{.*}} add x16, x16, #24  #DSO-NEXT:     1005c: {{.*}} br x17 -#DSO-NEXT:     10060: {{.*}} adrp x16, #131072 +#DSO-NEXT:     10060: {{.*}} adrp x16, #65536  #DSO-NEXT:     10064: {{.*}} ldr x17, [x16, #32]  #DSO-NEXT:     10068: {{.*}} add x16, x16, #32  #DSO-NEXT:     1006c: {{.*}} br x17 -#DSO-NEXT:     10070: {{.*}} adrp x16, #131072 +#DSO-NEXT:     10070: {{.*}} adrp x16, #65536  #DSO-NEXT:     10074: {{.*}} ldr x17, [x16, #40]  #DSO-NEXT:     10078: {{.*}} add x16, x16, #40  #DSO-NEXT:     1007c: {{.*}} br x17 diff --git a/lld/test/ELF/aarch64-gnu-ifunc-plt.s b/lld/test/ELF/aarch64-gnu-ifunc-plt.s index 50e63f5257e..be9a8a7e674 100644 --- a/lld/test/ELF/aarch64-gnu-ifunc-plt.s +++ b/lld/test/ELF/aarch64-gnu-ifunc-plt.s @@ -10,19 +10,19 @@  // Check that the IRELATIVE relocations are after the JUMP_SLOT in the plt  // CHECK: Relocations [  // CHECK-NEXT:   Section (4) .rela.plt { -// CHECK:     0x40018 R_AARCH64_JUMP_SLOT bar2 0x0 -// CHECK-NEXT:     0x40020 R_AARCH64_JUMP_SLOT zed2 0x0 -// CHECK-NEXT:     0x40028 R_AARCH64_IRELATIVE - 0x20000 -// CHECK-NEXT:     0x40030 R_AARCH64_IRELATIVE - 0x20004 +// CHECK:     0x30018 R_AARCH64_JUMP_SLOT bar2 0x0 +// CHECK-NEXT:     0x30020 R_AARCH64_JUMP_SLOT zed2 0x0 +// CHECK-NEXT:     0x30028 R_AARCH64_IRELATIVE - 0x20000 +// CHECK-NEXT:     0x30030 R_AARCH64_IRELATIVE - 0x20004  // CHECK-NEXT:   }  // CHECK-NEXT: ]  // Check that .got.plt entries point back to PLT header  // GOTPLT: Contents of section .got.plt: -// GOTPLT-NEXT:  40000 00000000 00000000 00000000 00000000 -// GOTPLT-NEXT:  40010 00000000 00000000 20000200 00000000 -// GOTPLT-NEXT:  40020 20000200 00000000 20000200 00000000 -// GOTPLT-NEXT:  40030 20000200 00000000 +// GOTPLT-NEXT:  30000 00000000 00000000 00000000 00000000 +// GOTPLT-NEXT:  30010 00000000 00000000 20000200 00000000 +// GOTPLT-NEXT:  30020 20000200 00000000 20000200 00000000 +// GOTPLT-NEXT:  30030 20000200 00000000  // Check that the PLTRELSZ tag includes the IRELATIVE relocations  // CHECK: DynamicSection [ @@ -31,40 +31,40 @@  // Check that a PLT header is written and the ifunc entries appear last  // DISASM: Disassembly of section .text:  // DISASM-NEXT: foo: -// DISASM-NEXT:    20000:       c0 03 5f d6     ret +// DISASM-NEXT:    20000: {{.*}} ret  // DISASM:      bar: -// DISASM-NEXT:    20004:       c0 03 5f d6     ret +// DISASM-NEXT:    20004: {{.*}} ret  // DISASM:      _start: -// DISASM-NEXT:    20008:       16 00 00 94     bl      #88 -// DISASM-NEXT:    2000c:       19 00 00 94     bl      #100 -// DISASM-NEXT:    20010:       0c 00 00 94     bl      #48 -// DISASM-NEXT:    20014:       0f 00 00 94     bl      #60 +// DISASM-NEXT:    20008: {{.*}} bl      #88 +// DISASM-NEXT:    2000c: {{.*}} bl      #100 +// DISASM-NEXT:    20010: {{.*}} bl      #48 +// DISASM-NEXT:    20014: {{.*}} bl      #60  // DISASM-NEXT: Disassembly of section .plt:  // DISASM-NEXT: .plt: -// DISASM-NEXT:    20020:       f0 7b bf a9     stp     x16, x30, [sp, #-16]! -// DISASM-NEXT:    20024:       10 01 00 90     adrp    x16, #131072 -// DISASM-NEXT:    20028:       11 0a 40 f9     ldr     x17, [x16, #16] -// DISASM-NEXT:    2002c:       10 42 00 91     add     x16, x16, #16 -// DISASM-NEXT:    20030:       20 02 1f d6     br      x17 -// DISASM-NEXT:    20034:       1f 20 03 d5     nop -// DISASM-NEXT:    20038:       1f 20 03 d5     nop -// DISASM-NEXT:    2003c:       1f 20 03 d5     nop -// DISASM-NEXT:    20040:       10 01 00 90     adrp    x16, #131072 -// DISASM-NEXT:    20044:       11 0e 40 f9     ldr     x17, [x16, #24] -// DISASM-NEXT:    20048:       10 62 00 91     add     x16, x16, #24 -// DISASM-NEXT:    2004c:       20 02 1f d6     br      x17 -// DISASM-NEXT:    20050:       10 01 00 90     adrp    x16, #131072 -// DISASM-NEXT:    20054:       11 12 40 f9     ldr     x17, [x16, #32] -// DISASM-NEXT:    20058:       10 82 00 91     add     x16, x16, #32 -// DISASM-NEXT:    2005c:       20 02 1f d6     br      x17 -// DISASM-NEXT:    20060:       10 01 00 90     adrp    x16, #131072 -// DISASM-NEXT:    20064:       11 16 40 f9     ldr     x17, [x16, #40] -// DISASM-NEXT:    20068:       10 a2 00 91     add     x16, x16, #40 -// DISASM-NEXT:    2006c:       20 02 1f d6     br      x17 -// DISASM-NEXT:    20070:       10 01 00 90     adrp    x16, #131072 -// DISASM-NEXT:    20074:       11 1a 40 f9     ldr     x17, [x16, #48] -// DISASM-NEXT:    20078:       10 c2 00 91     add     x16, x16, #48 -// DISASM-NEXT:    2007c:       20 02 1f d6     br      x17 +// DISASM-NEXT:    20020: {{.*}} stp     x16, x30, [sp, #-16]! +// DISASM-NEXT:    20024: {{.*}} adrp    x16, #65536 +// DISASM-NEXT:    20028: {{.*}} ldr     x17, [x16, #16] +// DISASM-NEXT:    2002c: {{.*}} add     x16, x16, #16 +// DISASM-NEXT:    20030: {{.*}} br      x17 +// DISASM-NEXT:    20034: {{.*}} nop +// DISASM-NEXT:    20038: {{.*}} nop +// DISASM-NEXT:    2003c: {{.*}} nop +// DISASM-NEXT:    20040: {{.*}} adrp    x16, #65536 +// DISASM-NEXT:    20044: {{.*}} ldr     x17, [x16, #24] +// DISASM-NEXT:    20048: {{.*}} add     x16, x16, #24 +// DISASM-NEXT:    2004c: {{.*}} br      x17 +// DISASM-NEXT:    20050: {{.*}} adrp    x16, #65536 +// DISASM-NEXT:    20054: {{.*}} ldr     x17, [x16, #32] +// DISASM-NEXT:    20058: {{.*}} add     x16, x16, #32 +// DISASM-NEXT:    2005c: {{.*}} br      x17 +// DISASM-NEXT:    20060: {{.*}} adrp    x16, #65536 +// DISASM-NEXT:    20064: {{.*}} ldr     x17, [x16, #40] +// DISASM-NEXT:    20068: {{.*}} add     x16, x16, #40 +// DISASM-NEXT:    2006c: {{.*}} br      x17 +// DISASM-NEXT:    20070: {{.*}} adrp    x16, #65536 +// DISASM-NEXT:    20074: {{.*}} ldr     x17, [x16, #48] +// DISASM-NEXT:    20078: {{.*}} add     x16, x16, #48 +// DISASM-NEXT:    2007c: {{.*}} br      x17  .text  .type foo STT_GNU_IFUNC diff --git a/lld/test/ELF/aarch64-tstbr14-reloc.s b/lld/test/ELF/aarch64-tstbr14-reloc.s index 6523a9c1cc9..c0a0a543a6c 100644 --- a/lld/test/ELF/aarch64-tstbr14-reloc.s +++ b/lld/test/ELF/aarch64-tstbr14-reloc.s @@ -35,8 +35,8 @@  #DSOREL-NEXT:     SHF_ALLOC  #DSOREL-NEXT:     SHF_WRITE  #DSOREL-NEXT:   ] -#DSOREL-NEXT:   Address: 0x30000 -#DSOREL-NEXT:   Offset: 0x30000 +#DSOREL-NEXT:   Address: 0x20000 +#DSOREL-NEXT:   Offset: 0x20000  #DSOREL-NEXT:   Size: 40  #DSOREL-NEXT:   Link: 0  #DSOREL-NEXT:   Info: 0 @@ -45,8 +45,8 @@  #DSOREL-NEXT:  }  #DSOREL:      Relocations [  #DSOREL-NEXT:  Section ({{.*}}) .rela.plt { -#DSOREL-NEXT:    0x30018 R_AARCH64_JUMP_SLOT _foo -#DSOREL-NEXT:    0x30020 R_AARCH64_JUMP_SLOT _bar +#DSOREL-NEXT:    0x20018 R_AARCH64_JUMP_SLOT _foo +#DSOREL-NEXT:    0x20020 R_AARCH64_JUMP_SLOT _bar  #DSOREL-NEXT:  }  #DSOREL-NEXT:] @@ -72,18 +72,18 @@  #DSO-NEXT: Disassembly of section .plt:  #DSO-NEXT: .plt:  #DSO-NEXT:  10030: {{.*}} stp x16, x30, [sp, #-16]! -#DSO-NEXT:  10034: {{.*}} adrp x16, #131072 +#DSO-NEXT:  10034: {{.*}} adrp x16, #65536  #DSO-NEXT:  10038: {{.*}} ldr x17, [x16, #16]  #DSO-NEXT:  1003c: {{.*}} add x16, x16, #16  #DSO-NEXT:  10040: {{.*}} br x17  #DSO-NEXT:  10044: {{.*}} nop  #DSO-NEXT:  10048: {{.*}} nop  #DSO-NEXT:  1004c: {{.*}} nop -#DSO-NEXT:  10050: {{.*}} adrp x16, #131072 +#DSO-NEXT:  10050: {{.*}} adrp x16, #65536  #DSO-NEXT:  10054: {{.*}} ldr x17, [x16, #24]  #DSO-NEXT:  10058: {{.*}} add x16, x16, #24  #DSO-NEXT:  1005c: {{.*}} br x17 -#DSO-NEXT:  10060: {{.*}} adrp x16, #131072 +#DSO-NEXT:  10060: {{.*}} adrp x16, #65536  #DSO-NEXT:  10064: {{.*}} ldr x17, [x16, #32]  #DSO-NEXT:  10068: {{.*}} add x16, x16, #32  #DSO-NEXT:  1006c: {{.*}} br x17 diff --git a/lld/test/ELF/amdgpu-relocs.s b/lld/test/ELF/amdgpu-relocs.s index 965a812b14b..1adb1faf20f 100644 --- a/lld/test/ELF/amdgpu-relocs.s +++ b/lld/test/ELF/amdgpu-relocs.s @@ -89,5 +89,5 @@ ptr:  # CHECK-NEXT: ]  # OBJDUMP: Contents of section nonalloc: -# OBJDUMP-NEXT: 0000 00000000 14380000 00000000 18340000 -# OBJDUMP-NEXT: 00000000 1c300000 +# OBJDUMP-NEXT: 0000 00000000 04480000 00000000 08440000 +# OBJDUMP-NEXT: 00000000 0c400000 diff --git a/lld/test/ELF/arm-abs32-dyn.s b/lld/test/ELF/arm-abs32-dyn.s index 68183fe6f19..afdf573680c 100644 --- a/lld/test/ELF/arm-abs32-dyn.s +++ b/lld/test/ELF/arm-abs32-dyn.s @@ -18,8 +18,8 @@ bar:  // RUN: llvm-readobj -symbols -dyn-relocations %t.so | FileCheck %s  // CHECK:      Dynamic Relocations { -// CHECK-NEXT:   0x2004 R_ARM_RELATIVE -// CHECK-NEXT:   0x2000 R_ARM_ABS32 foo 0x0 +// CHECK-NEXT:   0x1004 R_ARM_RELATIVE +// CHECK-NEXT:   0x1000 R_ARM_ABS32 foo 0x0  // CHECK-NEXT: }  // CHECK:      Symbols [ diff --git a/lld/test/ELF/arm-exidx-shared.s b/lld/test/ELF/arm-exidx-shared.s index 86b2d1fe00d..13628405ed3 100644 --- a/lld/test/ELF/arm-exidx-shared.s +++ b/lld/test/ELF/arm-exidx-shared.s @@ -38,7 +38,7 @@ __aeabi_unwind_cpp_pr0:  // CHECK: Relocations [  // CHECK-NEXT:   Section (6) .rel.plt { -// CHECK-NEXT:     0x300C R_ARM_JUMP_SLOT __gxx_personality_v0 +// CHECK-NEXT:     0x200C R_ARM_JUMP_SLOT __gxx_personality_v0  // CHECK-EXTAB: Contents of section .ARM.extab.text.func2:  // 014c + 0ed8 = 0x1024 = __gxx_personality_v0(PLT) diff --git a/lld/test/ELF/arm-fpic-got.s b/lld/test/ELF/arm-fpic-got.s index 4b6002d3c07..a5f8152350c 100644 --- a/lld/test/ELF/arm-fpic-got.s +++ b/lld/test/ELF/arm-fpic-got.s @@ -36,7 +36,7 @@ val:  // CHECK-NEXT:      SHF_ALLOC  // CHECK-NEXT:      SHF_WRITE  // CHECK-NEXT:    ] -// CHECK-NEXT:    Address: 0x12000 +// CHECK-NEXT:    Address: 0x13000  // CHECK-NEXT:    Offset:  // CHECK-NEXT:    Size: 4  // CHECK-NEXT:    Link: @@ -45,7 +45,7 @@ val:  // CHECK-NEXT:    EntrySize:  // SYMBOLS:    Name: val -// SYMBOLS-NEXT:    Value: 0x13000 +// SYMBOLS-NEXT:    Value: 0x12000  // SYMBOLS-NEXT:    Size: 4  // SYMBOLS-NEXT:    Binding: Global  // SYMBOLS-NEXT:    Type: Object @@ -59,5 +59,5 @@ val:  // CODE-NEXT:   11008:  00 00 90 e5     ldr     r0, [r0]  // CODE-NEXT:   1100c:  1e ff 2f e1     bx      lr  // CODE: $d.1: -// 0x11004 + 0x0ff4 + 8 = 0x12000 = .got -// CODE-NEXT:   11010:  f4 0f 00 00 +// 0x11004 + 0x1ff4 + 8 = 0x13000 = .got +// CODE-NEXT:   11010:  f4 1f 00 00 diff --git a/lld/test/ELF/arm-gnu-ifunc-plt.s b/lld/test/ELF/arm-gnu-ifunc-plt.s index 30ef66a3b77..cd1e8b740b3 100644 --- a/lld/test/ELF/arm-gnu-ifunc-plt.s +++ b/lld/test/ELF/arm-gnu-ifunc-plt.s @@ -10,23 +10,23 @@  // Check that the IRELATIVE relocations are last in the .got  // CHECK: Relocations [  // CHECK-NEXT:   Section (4) .rel.dyn { -// CHECK-NEXT:     0x12078 R_ARM_GLOB_DAT bar2 0x0 -// CHECK-NEXT:     0x1207C R_ARM_GLOB_DAT zed2 0x0 -// CHECK-NEXT:     0x12080 R_ARM_IRELATIVE - 0x0 -// CHECK-NEXT:     0x12084 R_ARM_IRELATIVE - 0x0 +// CHECK-NEXT:     0x13078 R_ARM_GLOB_DAT bar2 0x0 +// CHECK-NEXT:     0x1307C R_ARM_GLOB_DAT zed2 0x0 +// CHECK-NEXT:     0x13080 R_ARM_IRELATIVE - 0x0 +// CHECK-NEXT:     0x13084 R_ARM_IRELATIVE - 0x0  // CHECK-NEXT:   }  // CHECK-NEXT:   Section (5) .rel.plt { -// CHECK-NEXT:     0x1300C R_ARM_JUMP_SLOT bar2 0x0 -// CHECK-NEXT:     0x13010 R_ARM_JUMP_SLOT zed2 0x0 +// CHECK-NEXT:     0x1200C R_ARM_JUMP_SLOT bar2 0x0 +// CHECK-NEXT:     0x12010 R_ARM_JUMP_SLOT zed2 0x0  // CHECK-NEXT:   }  // CHECK-NEXT: ]  // Check that the GOT entries refer back to the ifunc resolver +// GOTPLT: Contents of section .got.plt: +// GOTPLT-NEXT:  12000 00000000 00000000 00000000 20100100 +// GOTPLT-NEXT:  12010 20100100  // GOTPLT: Contents of section .got: -// GOTPLT-NEXT:  12078 00000000 00000000 00100100 04100100 -// GOTPLT-NEXT: Contents of section .got.plt: -// GOTPLT-NEXT:  13000 00000000 00000000 00000000 20100100 -// GOTPLT-NEXT:  13010 20100100 +// GOTPLT-NEXT:  13078 00000000 00000000 00100100 04100100  // DISASM: Disassembly of section .text:  // DISASM-NEXT: foo: @@ -46,15 +46,15 @@  // DISASM-NEXT:    11024:       04 e0 9f e5     ldr     lr, [pc, #4]  // DISASM-NEXT:    11028:       0e e0 8f e0     add     lr, pc, lr  // DISASM-NEXT:    1102c:       08 f0 be e5     ldr     pc, [lr, #8]! -// DISASM-NEXT:    11030:       d0 1f 00 00 +// DISASM-NEXT:    11030:       d0 0f 00 00  // DISASM-NEXT:    11034:       04 c0 9f e5     ldr     r12, [pc, #4]  // DISASM-NEXT:    11038:       0f c0 8c e0     add     r12, r12, pc  // DISASM-NEXT:    1103c:       00 f0 9c e5     ldr     pc, [r12] -// DISASM-NEXT:    11040:       cc 1f 00 00 +// DISASM-NEXT:    11040:       cc 0f 00 00  // DISASM-NEXT:    11044:       04 c0 9f e5     ldr     r12, [pc, #4]  // DISASM-NEXT:    11048:       0f c0 8c e0     add     r12, r12, pc  // DISASM-NEXT:    1104c:       00 f0 9c e5     ldr     pc, [r12] -// DISASM-NEXT:    11050:       c0 1f 00 00 +// DISASM-NEXT:    11050:       c0 0f 00 00  // Alignment to 16 byte boundary not strictly necessary on ARM, but harmless  // DISASM-NEXT:    11054:       00 00 00 00     andeq   r0, r0, r0  // DISASM-NEXT:    11058:       00 00 00 00     andeq   r0, r0, r0 @@ -62,11 +62,11 @@  // DISASM-NEXT:    11060:       04 c0 9f e5     ldr     r12, [pc, #4]  // DISASM-NEXT:    11064:       0f c0 8c e0     add     r12, r12, pc  // DISASM-NEXT:    11068:       00 f0 9c e5     ldr     pc, [r12] -// DISASM-NEXT:    1106c:       14 10 00 00 +// DISASM-NEXT:    1106c:       14 20 00 00  // DISASM-NEXT:    11070:       04 c0 9f e5     ldr     r12, [pc, #4]  // DISASM-NEXT:    11074:       0f c0 8c e0     add     r12, r12, pc  // DISASM-NEXT:    11078:       00 f0 9c e5     ldr     pc, [r12] -// DISASM-NEXT:    1107c:       08 10 00 00 +// DISASM-NEXT:    1107c:       08 20 00 00  .syntax unified diff --git a/lld/test/ELF/arm-pie-relative.s b/lld/test/ELF/arm-pie-relative.s index 223fcca08a2..f965c24f4fa 100644 --- a/lld/test/ELF/arm-pie-relative.s +++ b/lld/test/ELF/arm-pie-relative.s @@ -19,7 +19,7 @@ sym:  // CHECK:      Relocations [  // CHECK-NEXT:   Section (4) .rel.dyn { -// CHECK-NEXT:     0x2058 R_ARM_RELATIVE +// CHECK-NEXT:     0x3058 R_ARM_RELATIVE  // GOT: Contents of section .got: -// GOT-NEXT:  2058 00300000 +// GOT-NEXT:  3058 00200000 diff --git a/lld/test/ELF/arm-plt-reloc.s b/lld/test/ELF/arm-plt-reloc.s index 0616aa7966a..9d4ecbd6774 100644 --- a/lld/test/ELF/arm-plt-reloc.s +++ b/lld/test/ELF/arm-plt-reloc.s @@ -52,23 +52,23 @@ _start:  // DSO-NEXT:    1024:        04 e0 9f e5    ldr     lr, [pc, #4]  // DSO-NEXT:    1028:        0e e0 8f e0    add     lr, pc, lr  // DSO-NEXT:    102c:        08 f0 be e5    ldr     pc, [lr, #8]! -// 0x1028 + 8 + 1fd0 = 0x3000 -// DSO-NEXT:    1030:        d0 1f 00 00 +// 0x1028 + 8 + 0fd0 = 0x2000 +// DSO-NEXT:    1030:        d0 0f 00 00  // DSO-NEXT:    1034:        04 c0 9f e5    ldr     r12, [pc, #4]  // DSO-NEXT:    1038:        0f c0 8c e0    add     r12, r12, pc  // DSO-NEXT:    103c:        00 f0 9c e5    ldr     pc, [r12] -// 0x1038 + 8 + 1fcc = 0x300c -// DSO-NEXT:    1040:        cc 1f 00 00 +// 0x1038 + 8 + 0fcc = 0x200c +// DSO-NEXT:    1040:        cc 0f 00 00  // DSO-NEXT:    1044:        04 c0 9f e5    ldr     r12, [pc, #4]  // DSO-NEXT:    1048:        0f c0 8c e0    add     r12, r12, pc  // DSO-NEXT:    104c:        00 f0 9c e5    ldr     pc, [r12] -// 0x1048 + 8 + 1fc0 = 0x3010 -// DSO-NEXT:    1050:        c0 1f 00 00 +// 0x1048 + 8 + 0fc0 = 0x2010 +// DSO-NEXT:    1050:        c0 0f 00 00  // DSO-NEXT:    1054:        04 c0 9f e5    ldr     r12, [pc, #4]  // DSO-NEXT:    1058:        0f c0 8c e0    add     r12, r12, pc  // DSO-NEXT:    105c:        00 f0 9c e5    ldr     pc, [r12] -// 0x1058 + 8 + 1fb4 = 0x3014 -// DSO-NEXT:    1060:       b4 1f 00 00 +// 0x1058 + 8 + 0fb4 = 0x2014 +// DSO-NEXT:    1060:       b4 0f 00 00  // DSOREL:    Name: .got.plt  // DSOREL-NEXT:    Type: SHT_PROGBITS @@ -76,7 +76,7 @@ _start:  // DSOREL-NEXT:      SHF_ALLOC  // DSOREL-NEXT:      SHF_WRITE  // DSOREL-NEXT:    ] -// DSOREL-NEXT:    Address: 0x3000 +// DSOREL-NEXT:    Address: 0x2000  // DSOREL-NEXT:    Offset:  // DSOREL-NEXT:    Size: 24  // DSOREL-NEXT:    Link: @@ -85,6 +85,6 @@ _start:  // DSOREL-NEXT:    EntrySize:  // DSOREL:  Relocations [  // DSOREL-NEXT:  Section (4) .rel.plt { -// DSOREL-NEXT:    0x300C R_ARM_JUMP_SLOT func1 0x0 -// DSOREL-NEXT:    0x3010 R_ARM_JUMP_SLOT func2 0x0 -// DSOREL-NEXT:    0x3014 R_ARM_JUMP_SLOT func3 0x0 +// DSOREL-NEXT:    0x200C R_ARM_JUMP_SLOT func1 0x0 +// DSOREL-NEXT:    0x2010 R_ARM_JUMP_SLOT func2 0x0 +// DSOREL-NEXT:    0x2014 R_ARM_JUMP_SLOT func3 0x0 diff --git a/lld/test/ELF/arm-thumb-interwork-shared.s b/lld/test/ELF/arm-thumb-interwork-shared.s index ffd055e5b62..460931876dc 100644 --- a/lld/test/ELF/arm-thumb-interwork-shared.s +++ b/lld/test/ELF/arm-thumb-interwork-shared.s @@ -33,12 +33,12 @@ sym1:  // PLT-NEXT:     1024:       04 e0 9f e5     ldr     lr, [pc, #4]  // PLT-NEXT:     1028:       0e e0 8f e0     add     lr, pc, lr  // PLT-NEXT:     102c:       08 f0 be e5     ldr     pc, [lr, #8]! -// PLT-NEXT:     1030:       d0 1f 00 00 +// PLT-NEXT:     1030:       d0 0f 00 00  // PLT-NEXT:     1034:       04 c0 9f e5     ldr     r12, [pc, #4]  // PLT-NEXT:     1038:       0f c0 8c e0     add     r12, r12, pc  // PLT-NEXT:     103c:       00 f0 9c e5     ldr     pc, [r12] -// PLT-NEXT:     1040:       cc 1f 00 00 +// PLT-NEXT:     1040:       cc 0f 00 00  // PLT-NEXT:     1044:       04 c0 9f e5     ldr     r12, [pc, #4]  // PLT-NEXT:     1048:       0f c0 8c e0     add     r12, r12, pc  // PLT-NEXT:     104c:       00 f0 9c e5     ldr     pc, [r12] -// PLT-NEXT:     1050:       c0 1f 00 00 +// PLT-NEXT:     1050:       c0 0f 00 00 diff --git a/lld/test/ELF/arm-thumb-plt-reloc.s b/lld/test/ELF/arm-thumb-plt-reloc.s index 6294e909f07..36c64b1ec30 100644 --- a/lld/test/ELF/arm-thumb-plt-reloc.s +++ b/lld/test/ELF/arm-thumb-plt-reloc.s @@ -63,23 +63,23 @@ _start:  // DSOARM-NEXT:    1024:       04 e0 9f e5     ldr     lr, [pc, #4]  // DSOARM-NEXT:    1028:       0e e0 8f e0     add     lr, pc, lr  // DSOARM-NEXT:    102c:       08 f0 be e5     ldr     pc, [lr, #8]! -// DSOARM-NEXT:    1030:       d0 1f 00 00 -// 0x1028 + 8 + 1fd0 = 0x3000 +// DSOARM-NEXT:    1030:       d0 0f 00 00 +// 0x1028 + 8 + 0fd0 = 0x2000  // DSOARM-NEXT:    1034:       04 c0 9f e5     ldr     r12, [pc, #4]  // DSOARM-NEXT:    1038:       0f c0 8c e0     add     r12, r12, pc  // DSOARM-NEXT:    103c:       00 f0 9c e5     ldr     pc, [r12] -// DSOARM-NEXT:    1040:       cc 1f 00 00 -// 0x1038 + 8 + 1fcc = 0x300c +// DSOARM-NEXT:    1040:       cc 0f 00 00 +// 0x1038 + 8 + 0fcc = 0x200c  // DSOARM-NEXT:    1044:       04 c0 9f e5     ldr     r12, [pc, #4]  // DSOARM-NEXT:    1048:       0f c0 8c e0     add     r12, r12, pc  // DSOARM-NEXT:    104c:       00 f0 9c e5     ldr     pc, [r12] -// DSOARM-NEXT:    1050:       c0 1f 00 00 -// 0x1048 + 8 + 1fc0 = 0x3010 +// DSOARM-NEXT:    1050:       c0 0f 00 00 +// 0x1048 + 8 + 0fc0 = 0x2010  // DSOARM-NEXT:    1054:       04 c0 9f e5     ldr     r12, [pc, #4]  // DSOARM-NEXT:    1058:       0f c0 8c e0     add     r12, r12, pc  // DSOARM-NEXT:    105c:       00 f0 9c e5     ldr     pc, [r12] -// DSOARM-NEXT:    1060:       b4 1f 00 00 -// 0x1058 + 8 + 1fb4 = 0x3014 +// DSOARM-NEXT:    1060:       b4 0f 00 00 +// 0x1058 + 8 + 0fb4 = 0x2014  // DSOREL:    Name: .got.plt  // DSOREL-NEXT:    Type: SHT_PROGBITS @@ -87,7 +87,7 @@ _start:  // DSOREL-NEXT:      SHF_ALLOC  // DSOREL-NEXT:      SHF_WRITE  // DSOREL-NEXT:    ] -// DSOREL-NEXT:    Address: 0x3000 +// DSOREL-NEXT:    Address: 0x2000  // DSOREL-NEXT:    Offset:  // DSOREL-NEXT:    Size: 24  // DSOREL-NEXT:    Link: @@ -96,6 +96,6 @@ _start:  // DSOREL-NEXT:    EntrySize:  // DSOREL:  Relocations [  // DSOREL-NEXT:  Section (4) .rel.plt { -// DSOREL-NEXT:    0x300C R_ARM_JUMP_SLOT func1 0x0 -// DSOREL-NEXT:    0x3010 R_ARM_JUMP_SLOT func2 0x0 -// DSOREL-NEXT:    0x3014 R_ARM_JUMP_SLOT func3 0x0 +// DSOREL-NEXT:    0x200C R_ARM_JUMP_SLOT func1 0x0 +// DSOREL-NEXT:    0x2010 R_ARM_JUMP_SLOT func2 0x0 +// DSOREL-NEXT:    0x2014 R_ARM_JUMP_SLOT func3 0x0 diff --git a/lld/test/ELF/arm-tls-norelax-gd-ie.s b/lld/test/ELF/arm-tls-norelax-gd-ie.s index 3bd3db08ccf..2617089b408 100644 --- a/lld/test/ELF/arm-tls-norelax-gd-ie.s +++ b/lld/test/ELF/arm-tls-norelax-gd-ie.s @@ -25,6 +25,6 @@ func:   .Lt0: .word   y(TLSGD) + (. - .L0 - 8)  // CHECK: Dynamic Relocations { -// CHECK-NEXT:   0x12078 R_ARM_TLS_DTPMOD32 y -// CHECK-NEXT:   0x1207C R_ARM_TLS_DTPOFF32 y -// CHECK-NEXT:   0x1300C R_ARM_JUMP_SLOT __tls_get_addr +// CHECK-NEXT:   0x13078 R_ARM_TLS_DTPMOD32 y +// CHECK-NEXT:   0x1307C R_ARM_TLS_DTPOFF32 y +// CHECK-NEXT:   0x1200C R_ARM_JUMP_SLOT __tls_get_addr diff --git a/lld/test/ELF/arm-tls-norelax-gd-le.s b/lld/test/ELF/arm-tls-norelax-gd-le.s index 67952b1f856..41df72494f8 100644 --- a/lld/test/ELF/arm-tls-norelax-gd-le.s +++ b/lld/test/ELF/arm-tls-norelax-gd-le.s @@ -33,5 +33,5 @@ x:  // CHECK:       Contents of section .got:  // Module index is always 1 for executable -// CHECK-NEXT:  12060 01000000 00000000 +// CHECK-NEXT:  13060 01000000 00000000 diff --git a/lld/test/ELF/arm-tls-norelax-ie-le.s b/lld/test/ELF/arm-tls-norelax-ie-le.s index ecb68293829..e8c528b401c 100644 --- a/lld/test/ELF/arm-tls-norelax-ie-le.s +++ b/lld/test/ELF/arm-tls-norelax-ie-le.s @@ -36,6 +36,6 @@ x2:   .space 4   .type x2, %object -// CHECK: Contents of section .got +// CHECK: Contents of section .got:  // x1 at offset 8 from TP, x2 at offset c from TP. Offsets include TCB size of 8 -// CHECK-NEXT: 12064 08000000 0c000000 +// CHECK-NEXT: 13064 08000000 0c000000 diff --git a/lld/test/ELF/arm-tls-norelax-ld-le.s b/lld/test/ELF/arm-tls-norelax-ld-le.s index 380610ef394..9fd822aefef 100644 --- a/lld/test/ELF/arm-tls-norelax-ld-le.s +++ b/lld/test/ELF/arm-tls-norelax-ld-le.s @@ -32,4 +32,4 @@ x:   .word   10  // CHECK: Contents of section .got: -// CHECK-NEXT:  12064 01000000 00000000 +// CHECK-NEXT:  13064 01000000 00000000 diff --git a/lld/test/ELF/basic-mips.s b/lld/test/ELF/basic-mips.s index 84a7663675f..67b58f8f028 100644 --- a/lld/test/ELF/basic-mips.s +++ b/lld/test/ELF/basic-mips.s @@ -27,7 +27,7 @@ __start:  # CHECK-NEXT:   Version: 1  # CHECK-NEXT:   Entry: 0x20000  # CHECK-NEXT:   ProgramHeaderOffset: 0x34 -# CHECK-NEXT:   SectionHeaderOffset: 0x30098 +# CHECK-NEXT:   SectionHeaderOffset: 0x200A0  # CHECK-NEXT:   Flags [  # CHECK-NEXT:     EF_MIPS_ABI_O32  # CHECK-NEXT:     EF_MIPS_ARCH_32 @@ -103,35 +103,35 @@ __start:  # CHECK-NEXT:   }  # CHECK-NEXT:   Section {  # CHECK-NEXT:     Index: 4 -# CHECK-NEXT:     Name: .got +# CHECK-NEXT:     Name: .data  # CHECK-NEXT:     Type: SHT_PROGBITS (0x1) -# CHECK-NEXT:     Flags [ (0x10000003) +# CHECK-NEXT:     Flags [ (0x3)  # CHECK-NEXT:       SHF_ALLOC (0x2) -# CHECK-NEXT:       SHF_MIPS_GPREL (0x10000000)  # CHECK-NEXT:       SHF_WRITE (0x1)  # CHECK-NEXT:     ]  # CHECK-NEXT:     Address: 0x30000  # CHECK-NEXT:     Offset: 0x20000 -# CHECK-NEXT:     Size: 8 +# CHECK-NEXT:     Size: 0  # CHECK-NEXT:     Link: 0  # CHECK-NEXT:     Info: 0 -# CHECK-NEXT:     AddressAlignment: 4 +# CHECK-NEXT:     AddressAlignment: 16  # CHECK-NEXT:     EntrySize: 0  # CHECK-NEXT:   }  # CHECK-NEXT:   Section {  # CHECK-NEXT:     Index: 5 -# CHECK-NEXT:     Name: .data +# CHECK-NEXT:     Name: .got  # CHECK-NEXT:     Type: SHT_PROGBITS (0x1) -# CHECK-NEXT:     Flags [ (0x3) +# CHECK-NEXT:     Flags [ (0x10000003)  # CHECK-NEXT:       SHF_ALLOC (0x2) +# CHECK-NEXT:       SHF_MIPS_GPREL (0x10000000)  # CHECK-NEXT:       SHF_WRITE (0x1)  # CHECK-NEXT:     ] -# CHECK-NEXT:     Address: 0x40000 -# CHECK-NEXT:     Offset: 0x30000 -# CHECK-NEXT:     Size: 0 +# CHECK-NEXT:     Address: 0x30000 +# CHECK-NEXT:     Offset: 0x20000 +# CHECK-NEXT:     Size: 8  # CHECK-NEXT:     Link: 0  # CHECK-NEXT:     Info: 0 -# CHECK-NEXT:     AddressAlignment: 16 +# CHECK-NEXT:     AddressAlignment: 4  # CHECK-NEXT:     EntrySize: 0  # CHECK-NEXT:   }  # CHECK-NEXT:   Section { @@ -143,7 +143,7 @@ __start:  # CHECK-NEXT:       SHF_WRITE (0x1)  # CHECK-NEXT:     ]  # CHECK-NEXT:     Address: 0x40000 -# CHECK-NEXT:     Offset: 0x30000 +# CHECK-NEXT:     Offset: 0x20008  # CHECK-NEXT:     Size: 0  # CHECK-NEXT:     Link: 0  # CHECK-NEXT:     Info: 0 @@ -159,7 +159,7 @@ __start:  # CHECK-NEXT:       SHF_STRINGS (0x20)  # CHECK-NEXT:     ]  # CHECK-NEXT:     Address: 0x0 -# CHECK-NEXT:     Offset: 0x30000 +# CHECK-NEXT:     Offset: 0x20008  # CHECK-NEXT:     Size: 8  # CHECK-NEXT:     Link: 0  # CHECK-NEXT:     Info: 0 @@ -173,7 +173,7 @@ __start:  # CHECK-NEXT:     Flags [ (0x0)  # CHECK-NEXT:     ]  # CHECK-NEXT:     Address: 0x0 -# CHECK-NEXT:     Offset: 0x30008 +# CHECK-NEXT:     Offset: 0x20010  # CHECK-NEXT:     Size: 48  # CHECK-NEXT:     Link: 10  # CHECK-NEXT:     Info: 1 @@ -187,7 +187,7 @@ __start:  # CHECK-NEXT:     Flags [ (0x0)  # CHECK-NEXT:     ]  # CHECK-NEXT:     Address: 0x0 -# CHECK-NEXT:     Offset: 0x30038 +# CHECK-NEXT:     Offset: 0x20040  # CHECK-NEXT:     Size: 82  # CHECK-NEXT:     Link: 0  # CHECK-NEXT:     Info: 0 @@ -201,7 +201,7 @@ __start:  # CHECK-NEXT:     Flags [ (0x0)  # CHECK-NEXT:     ]  # CHECK-NEXT:     Address: 0x0 -# CHECK-NEXT:     Offset: 0x3008A +# CHECK-NEXT:     Offset: 0x20092  # CHECK-NEXT:     Size: 13  # CHECK-NEXT:     Link: 0  # CHECK-NEXT:     Info: 0 @@ -283,7 +283,7 @@ __start:  # CHECK-NEXT:     Offset: 0x20000  # CHECK-NEXT:     VirtualAddress: 0x30000  # CHECK-NEXT:     PhysicalAddress: 0x30000 -# CHECK-NEXT:     FileSize: 65536 +# CHECK-NEXT:     FileSize: 8  # CHECK-NEXT:     MemSize: 65536  # CHECK-NEXT:     Flags [  # CHECK-NEXT:       PF_R diff --git a/lld/test/ELF/basic64be.s b/lld/test/ELF/basic64be.s index 1ad982f0486..d16f4a07417 100644 --- a/lld/test/ELF/basic64be.s +++ b/lld/test/ELF/basic64be.s @@ -38,7 +38,7 @@ _start:  # CHECK-NEXT:   Version: 1  # CHECK-NEXT:   Entry: 0x10020040  # CHECK-NEXT:   ProgramHeaderOffset: 0x40 -# CHECK-NEXT:   SectionHeaderOffset: 0x200D8 +# CHECK-NEXT:   SectionHeaderOffset: 0x30080  # CHECK-NEXT:   Flags [ (0x0)  # CHECK-NEXT:   ]  # CHECK-NEXT:   HeaderSize: 64 @@ -85,24 +85,6 @@ _start:  # CHECK-NEXT:   }  # CHECK-NEXT:   Section {  # CHECK-NEXT:     Index: 2 -# CHECK-NEXT:     Name: .got -# CHECK-NEXT:     Type: SHT_PROGBITS -# CHECK-NEXT:     Flags [ -# CHECK-NEXT:       SHF_ALLOC -# CHECK-NEXT:       SHF_WRITE -# CHECK-NEXT:     ] -# CHECK-NEXT:     Address: 0x10020000 -# CHECK-NEXT:     Offset: 0x20000 -# CHECK-NEXT:     Size: 0 -# CHECK-NEXT:     Link: 0 -# CHECK-NEXT:     Info: 0 -# CHECK-NEXT:     AddressAlignment: 8 -# CHECK-NEXT:     EntrySize: 0 -# CHECK-NEXT:     SectionData ( -# CHECK-NEXT:     ) -# CHECK-NEXT:   } -# CHECK-NEXT:   Section { -# CHECK-NEXT:     Index: 3  # CHECK-NEXT:     Name: .toc  # CHECK-NEXT:     Type: SHT_PROGBITS (0x1)  # CHECK-NEXT:     Flags [ (0x3) @@ -122,7 +104,7 @@ _start:  # CHECK-NEXT:     )  # CHECK-NEXT:   }  # CHECK-NEXT:   Section { -# CHECK-NEXT:     Index: 4 +# CHECK-NEXT:     Index: 3  # CHECK-NEXT:     Name: .toc1  # CHECK-NEXT:     Type: SHT_PROGBITS (0x1)  # CHECK-NEXT:     Flags [ (0x3) @@ -142,7 +124,7 @@ _start:  # CHECK-NEXT:     )  # CHECK-NEXT:   }  # CHECK-NEXT:   Section { -# CHECK-NEXT:     Index: 5 +# CHECK-NEXT:     Index: 4  # CHECK-NEXT:     Name: .opd  # CHECK-NEXT:     Type: SHT_PROGBITS (0x1)  # CHECK-NEXT:     Flags [ (0x3) @@ -157,11 +139,29 @@ _start:  # CHECK-NEXT:     AddressAlignment: 1  # CHECK-NEXT:     EntrySize: 0  # CHECK-NEXT:     SectionData ( -# CHECK-NEXT:       0000: 00000000 10010000 00000000 10028000 |................| +# CHECK-NEXT:       0000: 00000000 10010000 00000000 10038000 |................|  # CHECK-NEXT:       0010: 00000000 00000000                   |........|  # CHECK-NEXT:     )  # CHECK-NEXT:   }  # CHECK-NEXT:   Section { +# CHECK-NEXT:     Index: 5 +# CHECK-NEXT:     Name: .got +# CHECK-NEXT:     Type: SHT_PROGBITS +# CHECK-NEXT:     Flags [ +# CHECK-NEXT:       SHF_ALLOC +# CHECK-NEXT:       SHF_WRITE +# CHECK-NEXT:     ] +# CHECK-NEXT:     Address: 0x10030000 +# CHECK-NEXT:     Offset: 0x30000 +# CHECK-NEXT:     Size: 0 +# CHECK-NEXT:     Link: 0 +# CHECK-NEXT:     Info: 0 +# CHECK-NEXT:     AddressAlignment: 8 +# CHECK-NEXT:     EntrySize: 0 +# CHECK-NEXT:     SectionData ( +# CHECK-NEXT:     ) +# CHECK-NEXT:   } +# CHECK-NEXT:   Section {  # CHECK-NEXT:     Index: 6  # CHECK-NEXT:     Name: .comment  # CHECK-NEXT:     Type: SHT_PROGBITS (0x1) @@ -170,7 +170,7 @@ _start:  # CHECK-NEXT:       SHF_STRINGS (0x20)  # CHECK-NEXT:     ]  # CHECK-NEXT:     Address: 0x0 -# CHECK-NEXT:     Offset: 0x20058 +# CHECK-NEXT:     Offset: 0x30000  # CHECK-NEXT:     Size: 8  # CHECK-NEXT:     Link: 0  # CHECK-NEXT:     Info: 0 @@ -187,7 +187,7 @@ _start:  # CHECK-NEXT:     Flags [ (0x0)  # CHECK-NEXT:     ]  # CHECK-NEXT:     Address: 0x0 -# CHECK-NEXT:     Offset: 0x20060 +# CHECK-NEXT:     Offset: 0x30008  # CHECK-NEXT:     Size: 48  # CHECK-NEXT:     Link: 9  # CHECK-NEXT:     Info: 1 @@ -203,7 +203,7 @@ _start:  # CHECK-NEXT:     Flags [  # CHECK-NEXT:     ]  # CHECK-NEXT:     Address: 0x0 -# CHECK-NEXT:     Offset: 0x20090 +# CHECK-NEXT:     Offset: 0x30038  # CHECK-NEXT:     Size: 63  # CHECK-NEXT:     Link: 0  # CHECK-NEXT:     Info: 0 @@ -219,7 +219,7 @@ _start:  # CHECK-NEXT:     Flags [ (0x0)  # CHECK-NEXT:     ]  # CHECK-NEXT:     Address: 0x0 -# CHECK-NEXT:     Offset: 0x200CF +# CHECK-NEXT:     Offset: 0x30077  # CHECK-NEXT:     Size: 8  # CHECK-NEXT:     Link: 0  # CHECK-NEXT:     Info: 0 @@ -273,8 +273,8 @@ _start:  # CHECK-NEXT:    Offset: 0x20000  # CHECK-NEXT:    VirtualAddress: 0x10020000  # CHECK-NEXT:    PhysicalAddress: 0x10020000 -# CHECK-NEXT:    FileSize: 88 -# CHECK-NEXT:    MemSize: 88 +# CHECK-NEXT:    FileSize: 65536 +# CHECK-NEXT:    MemSize: 65536  # CHECK-NEXT:    Flags [ (0x6)  # CHECK-NEXT:      PF_R (0x4)  # CHECK-NEXT:      PF_W (0x2) @@ -283,9 +283,9 @@ _start:  # CHECK-NEXT:  }  # CHECK-NEXT:  ProgramHeader {  # CHECK-NEXT:    Type: PT_GNU_RELRO -# CHECK-NEXT:    Offset: 0x20000 -# CHECK-NEXT:    VirtualAddress: 0x10020000 -# CHECK-NEXT:    PhysicalAddress: 0x10020000 +# CHECK-NEXT:    Offset: 0x30000 +# CHECK-NEXT:    VirtualAddress: 0x10030000 +# CHECK-NEXT:    PhysicalAddress: 0x10030000  # CHECK-NEXT:    FileSize: 0  # CHECK-NEXT:    MemSize: 0  # CHECK-NEXT:    Flags [ (0x4) diff --git a/lld/test/ELF/combrelocs.s b/lld/test/ELF/combrelocs.s index 5b876ee221a..3c8be807053 100644 --- a/lld/test/ELF/combrelocs.s +++ b/lld/test/ELF/combrelocs.s @@ -7,31 +7,31 @@  # CHECK:      Relocations [  # CHECK-NEXT:   Section ({{.*}}) .rela.dyn {  # CHECK-NEXT:     Relocation { -# CHECK-NEXT:       Offset: 0x2000 +# CHECK-NEXT:       Offset: 0x1000  # CHECK-NEXT:       Type: R_X86_64_64  # CHECK-NEXT:       Symbol: aaa (1)  # CHECK-NEXT:       Addend: 0x0  # CHECK-NEXT:     }  # CHECK-NEXT:     Relocation { -# CHECK-NEXT:       Offset: 0x2018 +# CHECK-NEXT:       Offset: 0x1018  # CHECK-NEXT:       Type: R_X86_64_64  # CHECK-NEXT:       Symbol: aaa (1)  # CHECK-NEXT:       Addend: 0x0  # CHECK-NEXT:     }  # CHECK-NEXT:     Relocation { -# CHECK-NEXT:       Offset: 0x2010 +# CHECK-NEXT:       Offset: 0x1010  # CHECK-NEXT:       Type: R_X86_64_64  # CHECK-NEXT:       Symbol: bbb (2)  # CHECK-NEXT:       Addend: 0x0  # CHECK-NEXT:     }  # CHECK-NEXT:     Relocation { -# CHECK-NEXT:       Offset: 0x2008 +# CHECK-NEXT:       Offset: 0x1008  # CHECK-NEXT:       Type: R_X86_64_64  # CHECK-NEXT:       Symbol: ccc (3)  # CHECK-NEXT:       Addend: 0x0  # CHECK-NEXT:     }  # CHECK-NEXT:     Relocation { -# CHECK-NEXT:       Offset: 0x2020 +# CHECK-NEXT:       Offset: 0x1020  # CHECK-NEXT:       Type: R_X86_64_64  # CHECK-NEXT:       Symbol: ddd (4)  # CHECK-NEXT:       Addend: 0x0 @@ -49,31 +49,31 @@  # NOCOMB:      Relocations [  # NOCOMB-NEXT:    Section ({{.*}}) .rela.dyn {  # NOCOMB-NEXT:     Relocation { -# NOCOMB-NEXT:       Offset: 0x2000 +# NOCOMB-NEXT:       Offset: 0x1000  # NOCOMB-NEXT:       Type: R_X86_64_64  # NOCOMB-NEXT:       Symbol: aaa (1)  # NOCOMB-NEXT:       Addend: 0x0  # NOCOMB-NEXT:     }  # NOCOMB-NEXT:     Relocation { -# NOCOMB-NEXT:       Offset: 0x2008 +# NOCOMB-NEXT:       Offset: 0x1008  # NOCOMB-NEXT:       Type: R_X86_64_64  # NOCOMB-NEXT:       Symbol: ccc (3)  # NOCOMB-NEXT:       Addend: 0x0  # NOCOMB-NEXT:     }  # NOCOMB-NEXT:     Relocation { -# NOCOMB-NEXT:       Offset: 0x2010 +# NOCOMB-NEXT:       Offset: 0x1010  # NOCOMB-NEXT:       Type: R_X86_64_64  # NOCOMB-NEXT:       Symbol: bbb (2)  # NOCOMB-NEXT:       Addend: 0x0  # NOCOMB-NEXT:     }  # NOCOMB-NEXT:     Relocation { -# NOCOMB-NEXT:       Offset: 0x2018 +# NOCOMB-NEXT:       Offset: 0x1018  # NOCOMB-NEXT:       Type: R_X86_64_64  # NOCOMB-NEXT:       Symbol: aaa (1)  # NOCOMB-NEXT:       Addend: 0x0  # NOCOMB-NEXT:     }  # NOCOMB-NEXT:     Relocation { -# NOCOMB-NEXT:       Offset: 0x2020 +# NOCOMB-NEXT:       Offset: 0x1020  # NOCOMB-NEXT:       Type: R_X86_64_64  # NOCOMB-NEXT:       Symbol: ddd (4)  # NOCOMB-NEXT:       Addend: 0x0 diff --git a/lld/test/ELF/copy-rel-pie.s b/lld/test/ELF/copy-rel-pie.s index be7d5acaeba..769a2431d85 100644 --- a/lld/test/ELF/copy-rel-pie.s +++ b/lld/test/ELF/copy-rel-pie.s @@ -24,21 +24,21 @@ _start:  // CHECK-NEXT:   SHF_ALLOC  // CHECK-NEXT:   SHF_WRITE  // CHECK-NEXT: ] -// CHECK-NEXT: Address: 0x3020 +// CHECK-NEXT: Address: 0x4000  // CHECK:      Relocations [  // CHECK-NEXT:   Section (4) .rela.dyn { -// CHECK-NEXT:     0x3020 R_X86_64_COPY foo 0x0 +// CHECK-NEXT:     0x4000 R_X86_64_COPY foo 0x0  // CHECK-NEXT:   }  // CHECK-NEXT:   Section (5) .rela.plt { -// CHECK-NEXT:     0x3018 R_X86_64_JUMP_SLOT bar 0x0 +// CHECK-NEXT:     0x2018 R_X86_64_JUMP_SLOT bar 0x0  // CHECK-NEXT:   }  // CHECK-NEXT: ]  // (0x1010 + 0x10) - 0x1005 = 27 -// 0x3020          - 0x100a = 8214 +// 0x4000          - 0x100a = 12278  // DISASM:      Disassembly of section .text:  // DISASM-NEXT: _start:  // DISASM-NEXT:     1000:       e8 1b 00 00 00  callq   27 -// DISASM-NEXT:     1005:       e8 16 20 00 00  callq   8214 <foo> +// DISASM-NEXT:     1005:       e8 f6 2f 00 00  callq   12278 <foo> diff --git a/lld/test/ELF/dynamic-reloc-index.s b/lld/test/ELF/dynamic-reloc-index.s index ba3c5791beb..47e8c6c4ef7 100644 --- a/lld/test/ELF/dynamic-reloc-index.s +++ b/lld/test/ELF/dynamic-reloc-index.s @@ -8,7 +8,7 @@  // CHECK:      Relocations [  // CHECK-NEXT:   Section ({{.*}}) .rela.plt { -// CHECK-NEXT:     0x203018 R_X86_64_JUMP_SLOT bar 0x0 +// CHECK-NEXT:     0x202018 R_X86_64_JUMP_SLOT bar 0x0  // CHECK-NEXT:   }  // CHECK-NEXT: ] diff --git a/lld/test/ELF/dynamic-reloc.s b/lld/test/ELF/dynamic-reloc.s index 07894cffc90..8fda0b45abe 100644 --- a/lld/test/ELF/dynamic-reloc.s +++ b/lld/test/ELF/dynamic-reloc.s @@ -33,7 +33,7 @@  // CHECK:      Relocations [  // CHECK-NEXT:   Section ({{.*}}) .rela.plt {  // CHECK-NEXT:     Relocation { -// CHECK-NEXT:       Offset: 0x203018 +// CHECK-NEXT:       Offset: 0x202018  // CHECK-NEXT:       Type: R_X86_64_JUMP_SLOT  // CHECK-NEXT:       Symbol: bar  // CHECK-NEXT:       Addend: 0x0 diff --git a/lld/test/ELF/gnu-ifunc-plt-i386.s b/lld/test/ELF/gnu-ifunc-plt-i386.s index 75ebc8dd76e..50f10c5fe6c 100644 --- a/lld/test/ELF/gnu-ifunc-plt-i386.s +++ b/lld/test/ELF/gnu-ifunc-plt-i386.s @@ -10,16 +10,16 @@  // Check that the IRELATIVE relocations are after the JUMP_SLOT in the plt  // CHECK: Relocations [  // CHECK-NEXT:   Section (4) .rel.plt { -// CHECK-NEXT:     0x1300C R_386_JUMP_SLOT bar2 -// CHECK-NEXT:     0x13010 R_386_JUMP_SLOT zed2 -// CHECK-NEXT:     0x13014 R_386_IRELATIVE -// CHECK-NEXT:     0x13018 R_386_IRELATIVE +// CHECK-NEXT:     0x1200C R_386_JUMP_SLOT bar2 +// CHECK-NEXT:     0x12010 R_386_JUMP_SLOT zed2 +// CHECK-NEXT:     0x12014 R_386_IRELATIVE +// CHECK-NEXT:     0x12018 R_386_IRELATIVE  // Check that IRELATIVE .got.plt entries point to ifunc resolver and not  // back to the plt entry + 6.  // GOTPLT: Contents of section .got.plt: -// GOTPLT:       13000 00200100 00000000 00000000 36100100 -// GOTPLT-NEXT:  13010 46100100 00100100 01100100 +// GOTPLT:       12000 00300100 00000000 00000000 36100100 +// GOTPLT-NEXT:  12010 46100100 00100100 01100100  // Check that the PLTRELSZ tag includes the IRELATIVE relocations  // CHECK: DynamicSection [ @@ -38,22 +38,22 @@  // DISASM-NEXT:    11011:       e8 2a 00 00 00          calll   42  // DISASM-NEXT: Disassembly of section .plt:  // DISASM-NEXT: .plt: -// DISASM-NEXT:    11020:       ff 35 04 30 01 00       pushl   77828 -// DISASM-NEXT:    11026:       ff 25 08 30 01 00       jmpl    *77832 +// DISASM-NEXT:    11020:       ff 35 04 20 01 00       pushl   73732 +// DISASM-NEXT:    11026:       ff 25 08 20 01 00       jmpl    *73736  // DISASM-NEXT:    1102c:       90      nop  // DISASM-NEXT:    1102d:       90      nop  // DISASM-NEXT:    1102e:       90      nop  // DISASM-NEXT:    1102f:       90      nop -// DISASM-NEXT:    11030:       ff 25 0c 30 01 00       jmpl    *77836 +// DISASM-NEXT:    11030:       ff 25 0c 20 01 00       jmpl    *73740  // DISASM-NEXT:    11036:       68 00 00 00 00          pushl   $0  // DISASM-NEXT:    1103b:       e9 e0 ff ff ff          jmp     -32 <.plt> -// DISASM-NEXT:    11040:       ff 25 10 30 01 00       jmpl    *77840 +// DISASM-NEXT:    11040:       ff 25 10 20 01 00       jmpl    *73744  // DISASM-NEXT:    11046:       68 08 00 00 00          pushl   $8  // DISASM-NEXT:    1104b:       e9 d0 ff ff ff          jmp     -48 <.plt> -// DISASM-NEXT:    11050:       ff 25 14 30 01 00       jmpl    *77844 +// DISASM-NEXT:    11050:       ff 25 14 20 01 00       jmpl    *73748  // DISASM-NEXT:    11056:       68 30 00 00 00          pushl   $48  // DISASM-NEXT:    1105b:       e9 e0 ff ff ff          jmp     -32 <.plt+0x20> -// DISASM-NEXT:    11060:       ff 25 18 30 01 00       jmpl    *77848 +// DISASM-NEXT:    11060:       ff 25 18 20 01 00       jmpl    *73752  // DISASM-NEXT:    11066:       68 38 00 00 00          pushl   $56  // DISASM-NEXT:    1106b:       e9 d0 ff ff ff          jmp     -48 <.plt+0x20> diff --git a/lld/test/ELF/gnu-ifunc-plt.s b/lld/test/ELF/gnu-ifunc-plt.s index c7bd6b67b11..cf46380d389 100644 --- a/lld/test/ELF/gnu-ifunc-plt.s +++ b/lld/test/ELF/gnu-ifunc-plt.s @@ -10,17 +10,17 @@  // Check that the IRELATIVE relocations are after the JUMP_SLOT in the plt  // CHECK: Relocations [  // CHECK-NEXT:   Section (4) .rela.plt { -// CHECK-NEXT:     0x203018 R_X86_64_JUMP_SLOT bar2 0x0 -// CHECK-NEXT:     0x203020 R_X86_64_JUMP_SLOT zed2 0x0 -// CHECK-NEXT:     0x203028 R_X86_64_IRELATIVE - 0x201000 -// CHECK-NEXT:     0x203030 R_X86_64_IRELATIVE - 0x201001 +// CHECK-NEXT:     0x202018 R_X86_64_JUMP_SLOT bar2 0x0 +// CHECK-NEXT:     0x202020 R_X86_64_JUMP_SLOT zed2 0x0 +// CHECK-NEXT:     0x202028 R_X86_64_IRELATIVE - 0x201000 +// CHECK-NEXT:     0x202030 R_X86_64_IRELATIVE - 0x201001  // Check that .got.plt entries point back to PLT header  // GOTPLT: Contents of section .got.plt: -// GOTPLT-NEXT:  203000 00202000 00000000 00000000 00000000  .  ............. -// GOTPLT-NEXT:  203010 00000000 00000000 36102000 00000000  ........6. ..... -// GOTPLT-NEXT:  203020 46102000 00000000 56102000 00000000  F. .....V. ..... -// GOTPLT-NEXT:  203030 66102000 00000000 +// GOTPLT-NEXT:  202000 00302000 00000000 00000000 00000000 +// GOTPLT-NEXT:  202010 00000000 00000000 36102000 00000000 +// GOTPLT-NEXT:  202020 46102000 00000000 56102000 00000000 +// GOTPLT-NEXT:  202030 66102000 00000000  // Check that the PLTRELSZ tag includes the IRELATIVE relocations  // CHECK: DynamicSection [ @@ -39,19 +39,19 @@  // DISASM-NEXT:   201011:       e8 2a 00 00 00          callq   42  // DISASM-NEXT: Disassembly of section .plt:  // DISASM-NEXT: .plt: -// DISASM-NEXT:   201020:       ff 35 e2 1f 00 00       pushq   8162(%rip) -// DISASM-NEXT:   201026:       ff 25 e4 1f 00 00       jmpq    *8164(%rip) +// DISASM-NEXT:   201020:       ff 35 e2 0f 00 00       pushq   4066(%rip) +// DISASM-NEXT:   201026:       ff 25 e4 0f 00 00       jmpq    *4068(%rip)  // DISASM-NEXT:   20102c:       0f 1f 40 00     nopl    (%rax) -// DISASM-NEXT:   201030:       ff 25 e2 1f 00 00       jmpq    *8162(%rip) +// DISASM-NEXT:   201030:       ff 25 e2 0f 00 00       jmpq    *4066(%rip)  // DISASM-NEXT:   201036:       68 00 00 00 00          pushq   $0  // DISASM-NEXT:   20103b:       e9 e0 ff ff ff          jmp     -32 <.plt> -// DISASM-NEXT:   201040:       ff 25 da 1f 00 00       jmpq    *8154(%rip) +// DISASM-NEXT:   201040:       ff 25 da 0f 00 00       jmpq    *4058(%rip)  // DISASM-NEXT:   201046:       68 01 00 00 00          pushq   $1  // DISASM-NEXT:   20104b:       e9 d0 ff ff ff          jmp     -48 <.plt> -// DISASM-NEXT:   201050:       ff 25 d2 1f 00 00       jmpq    *8146(%rip) +// DISASM-NEXT:   201050:       ff 25 d2 0f 00 00       jmpq    *4050(%rip)  // DISASM-NEXT:   201056:       68 00 00 00 00          pushq   $0  // DISASM-NEXT:   20105b:       e9 e0 ff ff ff          jmp     -32 <.plt+0x20> -// DISASM-NEXT:   201060:       ff 25 ca 1f 00 00       jmpq    *8138(%rip) +// DISASM-NEXT:   201060:       ff 25 ca 0f 00 00       jmpq    *4042(%rip)  // DISASM-NEXT:   201066:       68 01 00 00 00          pushq   $1  // DISASM-NEXT:   20106b:       e9 d0 ff ff ff          jmp     -48 <.plt+0x20> diff --git a/lld/test/ELF/gnu-ifunc-shared.s b/lld/test/ELF/gnu-ifunc-shared.s index 30142b6dfe5..aee870c28e1 100644 --- a/lld/test/ELF/gnu-ifunc-shared.s +++ b/lld/test/ELF/gnu-ifunc-shared.s @@ -20,24 +20,24 @@  // DISASM-NEXT:     1012:       c3      retq  // DISASM-NEXT: Disassembly of section .plt:  // DISASM-NEXT: .plt: -// DISASM-NEXT:     1020:       ff 35 e2 1f 00 00       pushq   8162(%rip) -// DISASM-NEXT:     1026:       ff 25 e4 1f 00 00       jmpq    *8164(%rip) +// DISASM-NEXT:     1020:       ff 35 e2 0f 00 00       pushq   4066(%rip) +// DISASM-NEXT:     1026:       ff 25 e4 0f 00 00       jmpq    *4068(%rip)  // DISASM-NEXT:     102c:       0f 1f 40 00     nopl    (%rax) -// DISASM-NEXT:     1030:       ff 25 e2 1f 00 00       jmpq    *8162(%rip) +// DISASM-NEXT:     1030:       ff 25 e2 0f 00 00       jmpq    *4066(%rip)  // DISASM-NEXT:     1036:       68 00 00 00 00          pushq   $0  // DISASM-NEXT:     103b:       e9 e0 ff ff ff          jmp     -32 <.plt> -// DISASM-NEXT:     1040:       ff 25 da 1f 00 00       jmpq    *8154(%rip) +// DISASM-NEXT:     1040:       ff 25 da 0f 00 00       jmpq    *4058(%rip)  // DISASM-NEXT:     1046:       68 01 00 00 00          pushq   $1  // DISASM-NEXT:     104b:       e9 d0 ff ff ff          jmp     -48 <.plt> -// DISASM-NEXT:     1050:       ff 25 d2 1f 00 00       jmpq    *8146(%rip) +// DISASM-NEXT:     1050:       ff 25 d2 0f 00 00       jmpq    *4050(%rip)  // DISASM-NEXT:     1056:       68 00 00 00 00          pushq   $0  // DISASM-NEXT:     105b:       e9 e0 ff ff ff          jmp     -32 <.plt+0x20>  // CHECK: Relocations [  // CHECK-NEXT:   Section (4) .rela.plt { -// CHECK-NEXT:     0x3018 R_X86_64_JUMP_SLOT fct2 0x0 -// CHECK-NEXT:     0x3020 R_X86_64_JUMP_SLOT f2 0x0 -// CHECK-NEXT:     0x3028 R_X86_64_IRELATIVE - 0x1000 +// CHECK-NEXT:     0x2018 R_X86_64_JUMP_SLOT fct2 0x0 +// CHECK-NEXT:     0x2020 R_X86_64_JUMP_SLOT f2 0x0 +// CHECK-NEXT:     0x2028 R_X86_64_IRELATIVE - 0x1000   // Hidden expect IRELATIVE   .globl fct diff --git a/lld/test/ELF/got-aarch64.s b/lld/test/ELF/got-aarch64.s index 8f39d5a4804..ef6943881ed 100644 --- a/lld/test/ELF/got-aarch64.s +++ b/lld/test/ELF/got-aarch64.s @@ -10,7 +10,7 @@  // CHECK-NEXT:   SHF_ALLOC  // CHECK-NEXT:   SHF_WRITE  // CHECK-NEXT: ] -// CHECK-NEXT: Address: 0x20090 +// CHECK-NEXT: Address: 0x30090  // CHECK-NEXT: Offset:  // CHECK-NEXT: Size: 8  // CHECK-NEXT: Link: 0 @@ -19,7 +19,7 @@  // CHECK:      Relocations [  // CHECK-NEXT:   Section ({{.*}}) .rela.dyn { -// CHECK-NEXT:     0x20090 R_AARCH64_GLOB_DAT dat 0x0 +// CHECK-NEXT:     0x30090 R_AARCH64_GLOB_DAT dat 0x0  // CHECK-NEXT:   }  // CHECK-NEXT: ] @@ -27,7 +27,7 @@  // 0x20098 & 0xff8 = 0x98 = 152  // DISASM: main: -// DISASM-NEXT:   10000:  80 00 00 90   adrp  x0, #65536 +// DISASM-NEXT:   10000:  00 01 00 90   adrp  x0, #131072  // DISASM-NEXT:   10004: 00 48 40 f9   ldr x0, [x0, #144]  .global main,foo,dat diff --git a/lld/test/ELF/got-plt-header.s b/lld/test/ELF/got-plt-header.s index 691516d1a34..a6b10fa3a0a 100644 --- a/lld/test/ELF/got-plt-header.s +++ b/lld/test/ELF/got-plt-header.s @@ -6,25 +6,25 @@  // Check that the first .got.plt entry has the address of the dynamic table. -// CHECK:      Type: SHT_DYNAMIC -// CHECK-NEXT: Flags [ -// CHECK-NEXT:   SHF_ALLOC -// CHECK-NEXT:   SHF_WRITE -// CHECK-NEXT: ] -// CHECK-NEXT: Address: 0x2000 -  // CHECK:      Name: .got.plt  // CHECK-NEXT: Type: SHT_PROGBITS  // CHECK-NEXT: Flags [  // CHECK-NEXT:   SHF_ALLOC  // CHECK-NEXT:   SHF_WRITE  // CHECK-NEXT: ] -// CHECK-NEXT: Address: 0x3000 -// CHECK-NEXT: Offset: 0x3000 +// CHECK-NEXT: Address: 0x2000 +// CHECK-NEXT: Offset: 0x2000  // CHECK-NEXT: Size: 32  // CHECK-NEXT: Link: 0  // CHECK-NEXT: Info: 0  // CHECK-NEXT: AddressAlignment: 8  // CHECK-NEXT: EntrySize: 0  // CHECK-NEXT: SectionData ( -// CHECK-NEXT:   0000: 00200000 00000000 00000000 00000000 +// CHECK-NEXT:   0000: 00300000 00000000 00000000 00000000 + +// CHECK:      Type: SHT_DYNAMIC +// CHECK-NEXT: Flags [ +// CHECK-NEXT:   SHF_ALLOC +// CHECK-NEXT:   SHF_WRITE +// CHECK-NEXT: ] +// CHECK-NEXT: Address: 0x3000 diff --git a/lld/test/ELF/gotpc-relax-nopic.s b/lld/test/ELF/gotpc-relax-nopic.s index 3c7a4012a7d..dc7dcf2e91e 100644 --- a/lld/test/ELF/gotpc-relax-nopic.s +++ b/lld/test/ELF/gotpc-relax-nopic.s @@ -36,8 +36,8 @@  # SEC-PIC-NEXT:     SHF_ALLOC  # SEC-PIC-NEXT:     SHF_WRITE  # SEC-PIC-NEXT:   ] -# SEC-PIC-NEXT:   Address: 0x20A0 -# SEC-PIC-NEXT:   Offset: 0x20A0 +# SEC-PIC-NEXT:   Address: 0x30A0 +# SEC-PIC-NEXT:   Offset: 0x30A0  # SEC-PIC-NEXT:   Size: 8  # SEC-PIC-NEXT:   Link:  # SEC-PIC-NEXT:   Info: @@ -46,7 +46,7 @@  # SEC-PIC-NEXT: }  # SEC-PIC:      Relocations [  # SEC-PIC-NEXT:   Section ({{.*}}) .rela.dyn { -# SEC-PIC-NEXT:     0x20A0 R_X86_64_RELATIVE - 0x3000 +# SEC-PIC-NEXT:     0x30A0 R_X86_64_RELATIVE - 0x2000  # SEC-PIC-NEXT:   }  # SEC-PIC-NEXT: ]  # SEC-PIC:      0x000000006FFFFFF9 RELACOUNT            1 @@ -56,15 +56,15 @@  ##     0x102a + 4207 + 7 = 0x20A0  # DISASM-PIC:      Disassembly of section .text:  # DISASM-PIC-NEXT: _start: -# DISASM-PIC-NEXT: 1000: {{.*}} adcq  4249(%rip), %rax -# DISASM-PIC-NEXT: 1007: {{.*}} addq  4242(%rip), %rbx -# DISASM-PIC-NEXT: 100e: {{.*}} andq  4235(%rip), %rcx -# DISASM-PIC-NEXT: 1015: {{.*}} cmpq  4228(%rip), %rdx -# DISASM-PIC-NEXT: 101c: {{.*}} orq   4221(%rip), %rdi -# DISASM-PIC-NEXT: 1023: {{.*}} sbbq  4214(%rip), %rsi -# DISASM-PIC-NEXT: 102a: {{.*}} subq  4207(%rip), %rbp -# DISASM-PIC-NEXT: 1031: {{.*}} xorq  4200(%rip), %r8 -# DISASM-PIC-NEXT: 1038: {{.*}} testq 4193(%rip), %r15 +# DISASM-PIC-NEXT: 1000: {{.*}} adcq  8345(%rip), %rax +# DISASM-PIC-NEXT: 1007: {{.*}} addq  8338(%rip), %rbx +# DISASM-PIC-NEXT: 100e: {{.*}} andq  8331(%rip), %rcx +# DISASM-PIC-NEXT: 1015: {{.*}} cmpq  8324(%rip), %rdx +# DISASM-PIC-NEXT: 101c: {{.*}} orq   8317(%rip), %rdi +# DISASM-PIC-NEXT: 1023: {{.*}} sbbq  8310(%rip), %rsi +# DISASM-PIC-NEXT: 102a: {{.*}} subq  8303(%rip), %rbp +# DISASM-PIC-NEXT: 1031: {{.*}} xorq  8296(%rip), %r8 +# DISASM-PIC-NEXT: 1038: {{.*}} testq 8289(%rip), %r15  .data  .type   bar, @object diff --git a/lld/test/ELF/i386-merge.s b/lld/test/ELF/i386-merge.s index 5d48d4d07f0..00c954945a0 100644 --- a/lld/test/ELF/i386-merge.s +++ b/lld/test/ELF/i386-merge.s @@ -27,8 +27,8 @@  // CHECK-NEXT:   SHF_ALLOC  // CHECK-NEXT:   SHF_WRITE  // CHECK-NEXT: ] -// CHECK-NEXT: Address: 0x2000 -// CHECK-NEXT: Offset: 0x2000 +// CHECK-NEXT: Address: 0x1000 +// CHECK-NEXT: Offset: 0x1000  // CHECK-NEXT: Size: 4  // CHECK-NEXT: Link: 0  // CHECK-NEXT: Info: 0 diff --git a/lld/test/ELF/linkerscript/orphan.s b/lld/test/ELF/linkerscript/orphan.s index 3daa6fbf63c..f51085383a9 100644 --- a/lld/test/ELF/linkerscript/orphan.s +++ b/lld/test/ELF/linkerscript/orphan.s @@ -9,15 +9,15 @@  # RUN: ld.lld -o %t1 --script %t.script %t  # RUN: llvm-objdump -section-headers %t1 | FileCheck %s -## .jcr is a relro section and should be placed before other RW sections. +## .jcr is a relro section and should be placed after other RW sections.  ## .bss is SHT_NOBITS section and should be last RW section, so some space  ## in ELF file could be saved.  # CHECK:       0               00000000 0000000000000000  # CHECK-NEXT:  1 .text         00000000 0000000000000000 TEXT DATA -# CHECK-NEXT:  2 .jcr          00000008 0000000000000000 DATA -# CHECK-NEXT:  3 .rw1          00000008 0000000000000008 DATA -# CHECK-NEXT:  4 .rw2          00000008 0000000000000010 DATA -# CHECK-NEXT:  5 .rw3          00000008 0000000000000018 DATA +# CHECK-NEXT:  2 .rw1          00000008 0000000000000000 DATA +# CHECK-NEXT:  3 .rw2          00000008 0000000000000008 DATA +# CHECK-NEXT:  4 .rw3          00000008 0000000000000010 DATA +# CHECK-NEXT:  5 .jcr          00000008 0000000000000018 DATA  # CHECK-NEXT:  6 .bss          00000008 0000000000000020 BSS  .section .rw1, "aw" diff --git a/lld/test/ELF/linkerscript/repsection-symbol.s b/lld/test/ELF/linkerscript/repsection-symbol.s index 6786ac47255..d2d8c9dd56e 100644 --- a/lld/test/ELF/linkerscript/repsection-symbol.s +++ b/lld/test/ELF/linkerscript/repsection-symbol.s @@ -10,13 +10,13 @@  # RUN: llvm-readobj -t %t1 | FileCheck %s  # CHECK:      Name: foo1 -# CHECK-NEXT: Value: 0x288 +# CHECK-NEXT: Value: 0x228  # CHECK:      Name: foo2 -# CHECK-NEXT: Value: 0x290 +# CHECK-NEXT: Value: 0x230  # CHECK:      Name: foo3 -# CHECK-NEXT: Value: 0x294 +# CHECK-NEXT: Value: 0x234  .section .foo.1,"a"   .long 1 diff --git a/lld/test/ELF/linkerscript/sort-non-script.s b/lld/test/ELF/linkerscript/sort-non-script.s index 75a2d450adc..b0517608d51 100644 --- a/lld/test/ELF/linkerscript/sort-non-script.s +++ b/lld/test/ELF/linkerscript/sort-non-script.s @@ -9,8 +9,8 @@  # CHECK-NEXT: .dynsym  {{.*}}   A  # CHECK-NEXT: .hash    {{.*}}   A  # CHECK-NEXT: .dynstr  {{.*}}   A -# CHECK-NEXT: .dynamic {{.*}}  WA  # CHECK-NEXT: foo      {{.*}}  WA +# CHECK-NEXT: .dynamic {{.*}}  WA  .section foo, "aw"  .byte 0 diff --git a/lld/test/ELF/lto/undefined-puts.ll b/lld/test/ELF/lto/undefined-puts.ll index 07b2b4ef641..d13630368de 100644 --- a/lld/test/ELF/lto/undefined-puts.ll +++ b/lld/test/ELF/lto/undefined-puts.ll @@ -20,7 +20,7 @@ declare i32 @printf(i8*, ...)  ; Check that puts symbol is present in the dynamic symbol table and  ; there's a relocation for it.  ; CHECK: Dynamic Relocations { -; CHECK-NEXT:  0x203018 R_X86_64_JUMP_SLOT puts 0x0 +; CHECK-NEXT:  0x202018 R_X86_64_JUMP_SLOT puts 0x0  ; CHECK-NEXT: }  ; CHECK: DynamicSymbols [ diff --git a/lld/test/ELF/lto/visibility.ll b/lld/test/ELF/lto/visibility.ll index 718cc5b0698..9acc0e2efaa 100644 --- a/lld/test/ELF/lto/visibility.ll +++ b/lld/test/ELF/lto/visibility.ll @@ -15,7 +15,7 @@  ; CHECK-NEXT: Section: .text  ; CHECK:      Name: a -; CHECK-NEXT: Value: 0x3000 +; CHECK-NEXT: Value: 0x2000  ; CHECK-NEXT: Size: 0  ; CHECK-NEXT: Binding: Local  ; CHECK-NEXT: Type: None diff --git a/lld/test/ELF/mips-26.s b/lld/test/ELF/mips-26.s index b463c1ac212..749920b88c8 100644 --- a/lld/test/ELF/mips-26.s +++ b/lld/test/ELF/mips-26.s @@ -27,7 +27,7 @@  # CHECK-NEXT:   20018:       00 00 00 00     nop  # CHECK-NEXT: Disassembly of section .plt:  # CHECK-NEXT: .plt: -# CHECK-NEXT:   20020:       3c 1c 00 04     lui     $gp, 4 +# CHECK-NEXT:   20020:       3c 1c 00 03     lui     $gp, 3  # CHECK-NEXT:   20024:       8f 99 00 04     lw      $25, 4($gp)  # CHECK-NEXT:   20028:       27 9c 00 04     addiu   $gp, $gp, 4  # CHECK-NEXT:   2002c:       03 1c c0 23     subu    $24, $24, $gp @@ -35,7 +35,7 @@  # CHECK-NEXT:   20034:       00 18 c0 82     srl     $24, $24, 2  # CHECK-NEXT:   20038:       03 20 f8 09     jalr    $25  # CHECK-NEXT:   2003c:       27 18 ff fe     addiu   $24, $24, -2 -# CHECK-NEXT:   20040:       3c 0f 00 04     lui     $15, 4 +# CHECK-NEXT:   20040:       3c 0f 00 03     lui     $15, 3  # CHECK-NEXT:   20044:       8d f9 00 0c     lw      $25, 12($15)  # CHECK-NEXT:   20048:       03 20 00 08     jr      $25  # CHECK-NEXT:   2004c:       25 f8 00 0c     addiu   $24, $15, 12 diff --git a/lld/test/ELF/mips-32.s b/lld/test/ELF/mips-32.s index 8801bcf91f4..ef97afcc031 100644 --- a/lld/test/ELF/mips-32.s +++ b/lld/test/ELF/mips-32.s @@ -34,21 +34,21 @@ v2:    .word v1   # R_MIPS_32 target v1 addend 0  # BE: Contents of section .data: -# BE-NEXT: 30000 00000000 00000004 00030000 +# BE-NEXT: 20000 00000000 00000004 00020000  #                         ^-- v2+4 ^-- v1  # EL: Contents of section .data: -# EL-NEXT: 30000 00000000 04000000 00000300 +# EL-NEXT: 20000 00000000 04000000 00000200  #                         ^-- v2+4 ^-- v1  # SYM: SYMBOL TABLE: -# SYM: 00030000 l       .data           00000004 v1 -# SYM: 00030004 g       .data           00000008 v2 +# SYM: 00020000 l       .data           00000004 v1 +# SYM: 00020004 g       .data           00000008 v2  # REL:      Relocations [  # REL-NEXT:   Section (7) .rel.dyn { -# REL-NEXT:     0x30008 R_MIPS_REL32 - 0x0 -# REL-NEXT:     0x30004 R_MIPS_REL32 v2 0x0 +# REL-NEXT:     0x20008 R_MIPS_REL32 - 0x0 +# REL-NEXT:     0x20004 R_MIPS_REL32 v2 0x0  # REL-NEXT:   }  # REL-NEXT: ] @@ -68,8 +68,8 @@ v2:  # REL-NEXT:     Entry {  # REL-NEXT:       Address:  # REL-NEXT:       Access: -# REL-NEXT:       Initial: 0x30004 -# REL-NEXT:       Value: 0x30004 +# REL-NEXT:       Initial: 0x20004 +# REL-NEXT:       Value: 0x20004  # REL-NEXT:       Type: Object  # REL-NEXT:       Section: .data  # REL-NEXT:       Name: v2 diff --git a/lld/test/ELF/mips-64-disp.s b/lld/test/ELF/mips-64-disp.s index 95568071a07..04dd743d0b5 100644 --- a/lld/test/ELF/mips-64-disp.s +++ b/lld/test/ELF/mips-64-disp.s @@ -18,23 +18,23 @@  # CHECK-NEXT:    20010:   24 42 80 38   addiu   $2, $2, -32712  # CHECK: 0000000000020014     .text   00000000 foo -# CHECK: 0000000000037ff0     *ABS*   00000000 .hidden _gp +# CHECK: 0000000000047ff0     *ABS*   00000000 .hidden _gp  # CHECK: 0000000000020000     .text   00000000 __start  # CHECK: 0000000000000000 g F *UND*   00000000 foo1a  # GOT:      Relocations [  # GOT-NEXT: ]  # GOT-NEXT: Primary GOT { -# GOT-NEXT:   Canonical gp value: 0x37FF0 +# GOT-NEXT:   Canonical gp value: 0x47FF0  # GOT-NEXT:   Reserved entries [  # GOT-NEXT:     Entry { -# GOT-NEXT:       Address: 0x30000 +# GOT-NEXT:       Address: 0x40000  # GOT-NEXT:       Access: -32752  # GOT-NEXT:       Initial: 0x0  # GOT-NEXT:       Purpose: Lazy resolver  # GOT-NEXT:     }  # GOT-NEXT:     Entry { -# GOT-NEXT:       Address: 0x30008 +# GOT-NEXT:       Address: 0x40008  # GOT-NEXT:       Access: -32744  # GOT-NEXT:       Initial: 0x8000000000000000  # GOT-NEXT:       Purpose: Module pointer (GNU extension) @@ -42,29 +42,29 @@  # GOT-NEXT:   ]  # GOT-NEXT:   Local entries [  # GOT-NEXT:     Entry { -# GOT-NEXT:       Address: 0x30010 +# GOT-NEXT:       Address: 0x40010  # GOT-NEXT:       Access: -32736  # GOT-NEXT:       Initial: 0x20014  # GOT-NEXT:     }  # GOT-NEXT:     Entry { -# GOT-NEXT:       Address: 0x30018 +# GOT-NEXT:       Address: 0x40018  # GOT-NEXT:       Access: -32728  # GOT-NEXT:       Initial: 0x20004  # GOT-NEXT:     }  # GOT-NEXT:     Entry { -# GOT-NEXT:       Address: 0x30020 +# GOT-NEXT:       Address: 0x40020  # GOT-NEXT:       Access: -32720  # GOT-NEXT:       Initial: 0x20008  # GOT-NEXT:     }  # GOT-NEXT:     Entry { -# GOT-NEXT:       Address: 0x30028 +# GOT-NEXT:       Address: 0x40028  # GOT-NEXT:       Access: -32712  # GOT-NEXT:       Initial: 0x2000C  # GOT-NEXT:     }  # GOT-NEXT:   ]  # GOT-NEXT:   Global entries [  # GOT-NEXT:     Entry { -# GOT-NEXT:       Address: 0x30030 +# GOT-NEXT:       Address: 0x40030  # GOT-NEXT:       Access: -32704  # GOT-NEXT:       Initial: 0x0  # GOT-NEXT:       Value: 0x0 diff --git a/lld/test/ELF/mips-64-got.s b/lld/test/ELF/mips-64-got.s index f489b4451b6..9bb45c57aa9 100644 --- a/lld/test/ELF/mips-64-got.s +++ b/lld/test/ELF/mips-64-got.s @@ -19,23 +19,23 @@  # CHECK-NEXT:    20010:   24 42 80 38   addiu   $2,  $2, -32712  # CHECK: 0000000000020018   .text   00000000 foo -# CHECK: 0000000000037ff0   *ABS*   00000000 .hidden _gp +# CHECK: 0000000000047ff0   *ABS*   00000000 .hidden _gp  # CHECK: 0000000000020000   .text   00000000 __start  # CHECK: 0000000000020014   .text   00000000 bar  # GOT:      Relocations [  # GOT-NEXT: ]  # GOT-NEXT: Primary GOT { -# GOT-NEXT:   Canonical gp value: 0x37FF0 +# GOT-NEXT:   Canonical gp value: 0x47FF0  # GOT-NEXT:   Reserved entries [  # GOT-NEXT:     Entry { -# GOT-NEXT:       Address: 0x30000 +# GOT-NEXT:       Address: 0x40000  # GOT-NEXT:       Access: -32752  # GOT-NEXT:       Initial: 0x0  # GOT-NEXT:       Purpose: Lazy resolver  # GOT-NEXT:     }  # GOT-NEXT:     Entry { -# GOT-NEXT:       Address: 0x30008 +# GOT-NEXT:       Address: 0x40008  # GOT-NEXT:       Access: -32744  # GOT-NEXT:       Initial: 0x8000000000000000  # GOT-NEXT:       Purpose: Module pointer (GNU extension) @@ -43,29 +43,29 @@  # GOT-NEXT:   ]  # GOT-NEXT:   Local entries [  # GOT-NEXT:     Entry { -# GOT-NEXT:       Address: 0x30010 +# GOT-NEXT:       Address: 0x40010  # GOT-NEXT:       Access: -32736  # GOT-NEXT:       Initial: 0x20000  # GOT-NEXT:     }  # GOT-NEXT:     Entry { -# GOT-NEXT:       Address: 0x30018 +# GOT-NEXT:       Address: 0x40018  # GOT-NEXT:       Access: -32728  # GOT-NEXT:       Initial: 0x30000  # GOT-NEXT:     }  # GOT-NEXT:     Entry { -# GOT-NEXT:       Address: 0x30020 +# GOT-NEXT:       Address: 0x40020  # GOT-NEXT:       Access: -32720  # GOT-NEXT:       Initial: 0x20014  # GOT-NEXT:     }  # GOT-NEXT:     Entry { -# GOT-NEXT:       Address: 0x30028 +# GOT-NEXT:       Address: 0x40028  # GOT-NEXT:       Access: -32712  # GOT-NEXT:       Initial: 0x20018  # GOT-NEXT:     }  # GOT-NEXT:   ]  # GOT-NEXT:   Global entries [  # GOT-NEXT:     Entry { -# GOT-NEXT:       Address: 0x30030 +# GOT-NEXT:       Address: 0x40030  # GOT-NEXT:       Access: -32704  # GOT-NEXT:       Initial: 0x0  # GOT-NEXT:       Value: 0x0 diff --git a/lld/test/ELF/mips-64.s b/lld/test/ELF/mips-64.s index 689669e4b09..dd8a58d604c 100644 --- a/lld/test/ELF/mips-64.s +++ b/lld/test/ELF/mips-64.s @@ -26,14 +26,14 @@ v2:  # SYM: SYMBOL TABLE: -# SYM: 00030000 l       .data           00000004 v1 -# SYM: 00030008 g       .data           00000008 v2 +# SYM: 00020000 l       .data           00000004 v1 +# SYM: 00020008 g       .data           00000008 v2  # CHECK:      Relocations [  # CHECK-NEXT:   Section (7) .rela.dyn { -# CHECK-NEXT:     0x30010 R_MIPS_REL32/R_MIPS_64/R_MIPS_NONE - 0x30000 +# CHECK-NEXT:     0x20010 R_MIPS_REL32/R_MIPS_64/R_MIPS_NONE - 0x20000  #                                                             ^-- v1 -# CHECK-NEXT:     0x30008 R_MIPS_REL32/R_MIPS_64/R_MIPS_NONE v2 0x8 +# CHECK-NEXT:     0x20008 R_MIPS_REL32/R_MIPS_64/R_MIPS_NONE v2 0x8  # CHECK-NEXT:   }  # CHECK-NEXT: ] @@ -52,8 +52,8 @@ v2:  # CHECK-NEXT:     Entry {  # CHECK-NEXT:       Address:  # CHECK-NEXT:       Access: -# CHECK-NEXT:       Initial: 0x30008 -# CHECK-NEXT:       Value: 0x30008 +# CHECK-NEXT:       Initial: 0x20008 +# CHECK-NEXT:       Value: 0x20008  # CHECK-NEXT:       Type: Object  # CHECK-NEXT:       Section: .data  # CHECK-NEXT:       Name: v2 diff --git a/lld/test/ELF/mips-dynamic.s b/lld/test/ELF/mips-dynamic.s index 3cb5c63a49f..15afb028c1f 100644 --- a/lld/test/ELF/mips-dynamic.s +++ b/lld/test/ELF/mips-dynamic.s @@ -24,25 +24,25 @@  # EXE-NEXT:     Flags [  # EXE-NEXT:       SHF_ALLOC  # EXE-NEXT:     ] -# EXE:          Name: .got +# EXE:          Name: .rld_map  # EXE-NEXT:     Type: SHT_PROGBITS -# EXE-NEXT:     Flags [ (0x10000003) +# EXE-NEXT:     Flags [  # EXE-NEXT:       SHF_ALLOC -# EXE-NEXT:       SHF_MIPS_GPREL  # EXE-NEXT:       SHF_WRITE  # EXE-NEXT:     ] -# EXE-NEXT:     Address: [[GOTADDR:0x[0-9a-f]+]] +# EXE-NEXT:     Address: [[RLDMAPADDR:0x[0-9a-f]+]]  # EXE-NEXT:     Offset: -# EXE-NEXT:     Size: 8 -# EXE:          Name: .rld_map +# EXE-NEXT:     Size: 4 +# EXE:          Name: .got  # EXE-NEXT:     Type: SHT_PROGBITS -# EXE-NEXT:     Flags [ +# EXE-NEXT:     Flags [ (0x10000003)  # EXE-NEXT:       SHF_ALLOC +# EXE-NEXT:       SHF_MIPS_GPREL  # EXE-NEXT:       SHF_WRITE  # EXE-NEXT:     ] -# EXE-NEXT:     Address: [[RLDMAPADDR:0x[0-9a-f]+]] +# EXE-NEXT:     Address: [[GOTADDR:0x[0-9a-f]+]]  # EXE-NEXT:     Offset: -# EXE-NEXT:     Size: 4 +# EXE-NEXT:     Size: 8  # EXE:      ]  # EXE:      DynamicSection [  # EXE-NEXT:   Tag        Type                 Name/Value diff --git a/lld/test/ELF/mips-got-and-copy.s b/lld/test/ELF/mips-got-and-copy.s index f42b39c6d51..70bb8d388d8 100644 --- a/lld/test/ELF/mips-got-and-copy.s +++ b/lld/test/ELF/mips-got-and-copy.s @@ -19,22 +19,22 @@  # CHECK-NEXT:   }  # CHECK-NEXT: ]  # CHECK-NEXT: Primary GOT { -# CHECK-NEXT:   Canonical gp value: 0x37FF0 +# CHECK-NEXT:   Canonical gp value: 0x47FF0  # CHECK-NEXT:   Reserved entries [  # CHECK:        ]  # CHECK-NEXT:   Local entries [  # CHECK-NEXT:     Entry { -# CHECK-NEXT:       Address: 0x30008 +# CHECK-NEXT:       Address: 0x40008  # CHECK-NEXT:       Access: -32744 -# CHECK-NEXT:       Initial: 0x40010 +# CHECK-NEXT:       Initial: 0x50000  # CHECK-NEXT:     }  # CHECK-NEXT:   ]  # CHECK-NEXT:   Global entries [  # CHECK-NEXT:     Entry { -# CHECK-NEXT:       Address: 0x3000C +# CHECK-NEXT:       Address: 0x4000C  # CHECK-NEXT:       Access: -32740 -# CHECK-NEXT:       Initial: 0x40014 -# CHECK-NEXT:       Value: 0x40014 +# CHECK-NEXT:       Initial: 0x50004 +# CHECK-NEXT:       Value: 0x50004  # CHECK-NEXT:       Type: Object (0x1)  # CHECK-NEXT:       Section: .bss (0xD)  # CHECK-NEXT:       Name: data1@ diff --git a/lld/test/ELF/mips-got-extsym.s b/lld/test/ELF/mips-got-extsym.s index 1cf99aeed49..f9d809c1009 100644 --- a/lld/test/ELF/mips-got-extsym.s +++ b/lld/test/ELF/mips-got-extsym.s @@ -30,7 +30,7 @@  # CHECK:      Local entries [  # CHECK-NEXT:   Entry { -# CHECK-NEXT:     Address: 0x30008 +# CHECK-NEXT:     Address: 0x40008  # CHECK-NEXT:     Access: -32744  # CHECK-NEXT:     Initial: 0x20008  #                          ^-- bar @@ -38,7 +38,7 @@  # CHECK-NEXT: ]  # CHECK-NEXT: Global entries [  # CHECK-NEXT:   Entry { -# CHECK-NEXT:     Address: 0x3000C +# CHECK-NEXT:     Address: 0x4000C  # CHECK-NEXT:     Access: -32740  # CHECK-NEXT:     Initial: 0x0  # CHECK-NEXT:     Value: 0x0 diff --git a/lld/test/ELF/mips-got-hilo.s b/lld/test/ELF/mips-got-hilo.s index 7e6945fd2b6..26a19811516 100644 --- a/lld/test/ELF/mips-got-hilo.s +++ b/lld/test/ELF/mips-got-hilo.s @@ -20,22 +20,22 @@  # GOT-NEXT: ]  # GOT:      Primary GOT { -# GOT-NEXT:   Canonical gp value: 0x27FF0 +# GOT-NEXT:   Canonical gp value: 0x37FF0  # GOT:        Local entries [  # GOT-NEXT:     Entry { -# GOT-NEXT:       Address: 0x20008 +# GOT-NEXT:       Address: 0x30008  # GOT-NEXT:       Access: -32744 -# GOT-NEXT:       Initial: 0x30000 +# GOT-NEXT:       Initial: 0x20000  # GOT-NEXT:     }  # GOT-NEXT:     Entry { -# GOT-NEXT:       Address: 0x2000C +# GOT-NEXT:       Address: 0x3000C  # GOT-NEXT:       Access: -32740 -# GOT-NEXT:       Initial: 0x30004 +# GOT-NEXT:       Initial: 0x20004  # GOT-NEXT:     }  # GOT-NEXT:   ]  # GOT-NEXT:   Global entries [  # GOT-NEXT:     Entry { -# GOT-NEXT:       Address: 0x20010 +# GOT-NEXT:       Address: 0x30010  # GOT-NEXT:       Access: -32736  # GOT-NEXT:       Initial: 0x0  # GOT-NEXT:       Value: 0x0 diff --git a/lld/test/ELF/mips-got-redundant.s b/lld/test/ELF/mips-got-redundant.s index 115a49f357d..e734aa5b452 100644 --- a/lld/test/ELF/mips-got-redundant.s +++ b/lld/test/ELF/mips-got-redundant.s @@ -8,27 +8,27 @@  # CHECK:      Local entries [  # CHECK-NEXT:   Entry { -# CHECK-NEXT:     Address: 0x20008 +# CHECK-NEXT:     Address: 0x40008  # CHECK-NEXT:     Access: -32744 -# CHECK-NEXT:     Initial: 0x30000 +# CHECK-NEXT:     Initial: 0x20000  #                          ^-- loc1  # CHECK-NEXT:   }  # CHECK-NEXT:   Entry { -# CHECK-NEXT:     Address: 0x2000C +# CHECK-NEXT:     Address: 0x4000C  # CHECK-NEXT:     Access: -32740 -# CHECK-NEXT:     Initial: 0x40000 +# CHECK-NEXT:     Initial: 0x30000  #                          ^-- loc2, loc3, loc4  # CHECK-NEXT:   }  # CHECK-NEXT:   Entry { -# CHECK-NEXT:     Address: 0x20010 +# CHECK-NEXT:     Address: 0x40010  # CHECK-NEXT:     Access: -32736 -# CHECK-NEXT:     Initial: 0x50000 +# CHECK-NEXT:     Initial: 0x40000  #                          ^-- redundant  # CHECK-NEXT:   }  # CHECK-NEXT:   Entry { -# CHECK-NEXT:     Address: 0x20014 +# CHECK-NEXT:     Address: 0x40014  # CHECK-NEXT:     Access: -32732 -# CHECK-NEXT:     Initial: 0x40008 +# CHECK-NEXT:     Initial: 0x30008  #                          ^-- glb1  # CHECK-NEXT:   }  # CHECK-NEXT: ] diff --git a/lld/test/ELF/mips-got-relocs.s b/lld/test/ELF/mips-got-relocs.s index 19c0db49a44..bb4efd039fd 100644 --- a/lld/test/ELF/mips-got-relocs.s +++ b/lld/test/ELF/mips-got-relocs.s @@ -45,22 +45,22 @@ v1:    .word 0  # EXE_SYM: Sections: -# EXE_SYM: .got 0000000c 0000000000030000 DATA +# EXE_SYM: .got 0000000c 0000000000040000 DATA  # EXE_SYM: SYMBOL TABLE: -# EXE_SYM: 00037ff0         *ABS*    00000000 .hidden _gp +# EXE_SYM: 00047ff0         *ABS*    00000000 .hidden _gp  #          ^-- .got + GP offset (0x7ff0) -# EXE_SYM: 00040000 g       .data		 00000004 v1 +# EXE_SYM: 00030000 g       .data		 00000004 v1  # EXE_GOT_BE: Contents of section .got: -# EXE_GOT_BE:  30000 00000000 80000000 00040000 -#                    ^        ^        ^-- v1 (0x40000) +# EXE_GOT_BE:  40000 00000000 80000000 00030000 +#                    ^        ^        ^-- v1 (0x30000)  #                    |        +-- Module pointer (0x80000000)  #                    +-- Lazy resolver (0x0)  # EXE_GOT_EL: Contents of section .got: -# EXE_GOT_EL:  30000 00000000 00000080 00000400 -#                    ^        ^        ^-- v1 (0x40000) +# EXE_GOT_EL:  40000 00000000 00000080 00000300 +#                    ^        ^        ^-- v1 (0x30000)  #                    |        +-- Module pointer (0x80000000)  #                    +-- Lazy resolver (0x0) @@ -69,21 +69,21 @@ v1:  # EXE_DIS_EL:  20000:  18 80 02 3c  lui $2, 32792  # DSO_SYM: Sections: -# DSO_SYM: .got 0000000c 0000000000020000 DATA +# DSO_SYM: .got 0000000c 0000000000030000 DATA  # DSO_SYM: SYMBOL TABLE: -# DSO_SYM: 00027ff0         *ABS*    00000000 .hidden _gp +# DSO_SYM: 00037ff0         *ABS*    00000000 .hidden _gp  #          ^-- .got + GP offset (0x7ff0) -# DSO_SYM: 00030000 g       .data		 00000004 v1 +# DSO_SYM: 00020000 g       .data		 00000004 v1  # DSO_GOT_BE: Contents of section .got: -# DSO_GOT_BE:  20000 00000000 80000000 00030000 -#                    ^        ^        ^-- v1 (0x30000) +# DSO_GOT_BE:  30000 00000000 80000000 00020000 +#                    ^        ^        ^-- v1 (0x20000)  #                    |        +-- Module pointer (0x80000000)  #                    +-- Lazy resolver (0x0)  # DSO_GOT_EL: Contents of section .got: -# DSO_GOT_EL:  20000 00000000 00000080 00000300 -#                    ^        ^        ^-- v1 (0x30000) +# DSO_GOT_EL:  30000 00000000 00000080 00000200 +#                    ^        ^        ^-- v1 (0x20000)  #                    |        +-- Module pointer (0x80000000)  #                    +-- Lazy resolver (0x0) diff --git a/lld/test/ELF/mips-got-weak.s b/lld/test/ELF/mips-got-weak.s index a77924692a1..f1faf7c3d2d 100644 --- a/lld/test/ELF/mips-got-weak.s +++ b/lld/test/ELF/mips-got-weak.s @@ -15,7 +15,7 @@  # NOSYM:        Symbol {  # NOSYM:          Name: foo -# NOSYM-NEXT:     Value: 0x30000 +# NOSYM-NEXT:     Value: 0x20000  # NOSYM-NEXT:     Size: 0  # NOSYM-NEXT:     Binding: Weak  # NOSYM-NEXT:     Type: None @@ -33,7 +33,7 @@  # NOSYM-NEXT:   }  # NOSYM-NEXT:   Symbol {  # NOSYM-NEXT:     Name: sym -# NOSYM-NEXT:     Value: 0x30004 +# NOSYM-NEXT:     Value: 0x20004  # NOSYM-NEXT:     Size: 0  # NOSYM-NEXT:     Binding: Global  # NOSYM-NEXT:     Type: None @@ -47,16 +47,16 @@  # NOSYM-NEXT: 0x70000013 MIPS_GOTSYM          0x1  # NOSYM:      Primary GOT { -# NOSYM-NEXT:   Canonical gp value: 0x27FF0 +# NOSYM-NEXT:   Canonical gp value: 0x37FF0  # NOSYM-NEXT:   Reserved entries [  # NOSYM-NEXT:     Entry { -# NOSYM-NEXT:       Address: 0x20000 +# NOSYM-NEXT:       Address: 0x30000  # NOSYM-NEXT:       Access: -32752  # NOSYM-NEXT:       Initial: 0x0  # NOSYM-NEXT:       Purpose: Lazy resolver  # NOSYM-NEXT:     }  # NOSYM-NEXT:     Entry { -# NOSYM-NEXT:       Address: 0x20004 +# NOSYM-NEXT:       Address: 0x30004  # NOSYM-NEXT:       Access: -32748  # NOSYM-NEXT:       Initial: 0x80000000  # NOSYM-NEXT:       Purpose: Module pointer (GNU extension) @@ -66,16 +66,16 @@  # NOSYM-NEXT:   ]  # NOSYM-NEXT:   Global entries [  # NOSYM-NEXT:     Entry { -# NOSYM-NEXT:       Address: 0x20008 +# NOSYM-NEXT:       Address: 0x30008  # NOSYM-NEXT:       Access: -32744 -# NOSYM-NEXT:       Initial: 0x30000 -# NOSYM-NEXT:       Value: 0x30000 +# NOSYM-NEXT:       Initial: 0x20000 +# NOSYM-NEXT:       Value: 0x20000  # NOSYM-NEXT:       Type: None  # NOSYM-NEXT:       Section: .data  # NOSYM-NEXT:       Name: foo  # NOSYM-NEXT:     }  # NOSYM-NEXT:     Entry { -# NOSYM-NEXT:       Address: 0x2000C +# NOSYM-NEXT:       Address: 0x3000C  # NOSYM-NEXT:       Access: -32740  # NOSYM-NEXT:       Initial: 0x0  # NOSYM-NEXT:       Value: 0x0 @@ -84,10 +84,10 @@  # NOSYM-NEXT:       Name: bar  # NOSYM-NEXT:     }  # NOSYM-NEXT:     Entry { -# NOSYM-NEXT:       Address: 0x20010 +# NOSYM-NEXT:       Address: 0x30010  # NOSYM-NEXT:       Access: -32736 -# NOSYM-NEXT:       Initial: 0x30004 -# NOSYM-NEXT:       Value: 0x30004 +# NOSYM-NEXT:       Initial: 0x20004 +# NOSYM-NEXT:       Value: 0x20004  # NOSYM-NEXT:       Type: None  # NOSYM-NEXT:       Section: .data  # NOSYM-NEXT:       Name: sym @@ -115,16 +115,16 @@  # SYM-NEXT: 0x70000013 MIPS_GOTSYM          0x3  # SYM:      Primary GOT { -# SYM-NEXT:   Canonical gp value: 0x27FF0 +# SYM-NEXT:   Canonical gp value: 0x37FF0  # SYM-NEXT:   Reserved entries [  # SYM-NEXT:     Entry { -# SYM-NEXT:       Address: 0x20000 +# SYM-NEXT:       Address: 0x30000  # SYM-NEXT:       Access: -32752  # SYM-NEXT:       Initial: 0x0  # SYM-NEXT:       Purpose: Lazy resolver  # SYM-NEXT:     }  # SYM-NEXT:     Entry { -# SYM-NEXT:       Address: 0x20004 +# SYM-NEXT:       Address: 0x30004  # SYM-NEXT:       Access: -32748  # SYM-NEXT:       Initial: 0x80000000  # SYM-NEXT:       Purpose: Module pointer (GNU extension) @@ -132,19 +132,19 @@  # SYM-NEXT:   ]  # SYM-NEXT:   Local entries [  # SYM-NEXT:     Entry { -# SYM-NEXT:       Address: 0x20008 +# SYM-NEXT:       Address: 0x30008  # SYM-NEXT:       Access: -32744 -# SYM-NEXT:       Initial: 0x30000 +# SYM-NEXT:       Initial: 0x20000  # SYM-NEXT:     }  # SYM-NEXT:     Entry { -# SYM-NEXT:       Address: 0x2000C +# SYM-NEXT:       Address: 0x3000C  # SYM-NEXT:       Access: -32740 -# SYM-NEXT:       Initial: 0x30004 +# SYM-NEXT:       Initial: 0x20004  # SYM-NEXT:     }  # SYM-NEXT:   ]  # SYM-NEXT:   Global entries [  # SYM-NEXT:     Entry { -# SYM-NEXT:       Address: 0x20010 +# SYM-NEXT:       Address: 0x30010  # SYM-NEXT:       Access: -32736  # SYM-NEXT:       Initial: 0x0  # SYM-NEXT:       Value: 0x0 diff --git a/lld/test/ELF/mips-got16.s b/lld/test/ELF/mips-got16.s index c4c14e46607..b7e04ad93b3 100644 --- a/lld/test/ELF/mips-got16.s +++ b/lld/test/ELF/mips-got16.s @@ -22,23 +22,23 @@  # CHECK-NEXT:    10028:       8f 88 80 34     lw      $8, -32716($gp)  #  # CHECK: SYMBOL TABLE: -# CHECK: 00051008         .data           00000000 .hidden bar +# CHECK: 00041008         .data           00000000 .hidden bar  # CHECK: 00000000         *UND*           00000000 foo  # GOT:      Relocations [  # GOT-NEXT: ]  # GOT:      Primary GOT { -# GOT-NEXT:   Canonical gp value: 0x27FF0 +# GOT-NEXT:   Canonical gp value: 0x57FF0  # GOT-NEXT:   Reserved entries [  # GOT-NEXT:     Entry { -# GOT-NEXT:       Address: 0x20000 +# GOT-NEXT:       Address: 0x50000  # GOT-NEXT:       Access: -32752  # GOT-NEXT:       Initial: 0x0  # GOT-NEXT:       Purpose: Lazy resolver  # GOT-NEXT:     }  # GOT-NEXT:     Entry { -# GOT-NEXT:       Address: 0x20004 +# GOT-NEXT:       Address: 0x50004  # GOT-NEXT:       Access: -32748  # GOT-NEXT:       Initial: 0x80000000  # GOT-NEXT:       Purpose: Module pointer (GNU extension) @@ -46,52 +46,52 @@  # GOT-NEXT:   ]  # GOT-NEXT:   Local entries [  # GOT-NEXT:     Entry { -# GOT-NEXT:       Address: 0x20008 +# GOT-NEXT:       Address: 0x50008  # GOT-NEXT:       Access: -32744  # GOT-NEXT:       Initial: 0x10000  #                          ^-- (0x1002c + 0x8000) & ~0xffff  # GOT-NEXT:     }  # GOT-NEXT:     Entry { -# GOT-NEXT:       Address: 0x2000C +# GOT-NEXT:       Address: 0x5000C  # GOT-NEXT:       Access: -32740  # GOT-NEXT:       Initial: 0x20000  #                          ^-- redundant unused entry  # GOT-NEXT:     }  # GOT-NEXT:     Entry { -# GOT-NEXT:       Address: 0x20010 +# GOT-NEXT:       Address: 0x50010  # GOT-NEXT:       Access: -32736 -# GOT-NEXT:       Initial: 0x30000 +# GOT-NEXT:       Initial: 0x20000  #                          ^-- redundant unused entry  # GOT-NEXT:     }  # GOT-NEXT:     Entry { -# GOT-NEXT:       Address: 0x20014 +# GOT-NEXT:       Address: 0x50014  # GOT-NEXT:       Access: -32732 -# GOT-NEXT:       Initial: 0x40000 -#                          ^-- (0x39000 + 0x8000) & ~0xffff +# GOT-NEXT:       Initial: 0x30000 +#                          ^-- (0x29000 + 0x8000) & ~0xffff  # GOT-NEXT:     }  # GOT-NEXT:     Entry { -# GOT-NEXT:       Address: 0x20018 +# GOT-NEXT:       Address: 0x50018  # GOT-NEXT:       Access: -32728 -# GOT-NEXT:       Initial: 0x50000 -#                          ^-- (0x39000 + 0x10004 + 0x8000) & ~0xffff -#                          ^-- (0x39000 + 0x18004 + 0x8000) & ~0xffff +# GOT-NEXT:       Initial: 0x40000 +#                          ^-- (0x29000 + 0x10004 + 0x8000) & ~0xffff +#                          ^-- (0x29000 + 0x18004 + 0x8000) & ~0xffff  # GOT-NEXT:     }  # GOT-NEXT:     Entry { -# GOT-NEXT:       Address: 0x2001C +# GOT-NEXT:       Address: 0x5001C  # GOT-NEXT:       Access: -32724 -# GOT-NEXT:       Initial: 0x60000 +# GOT-NEXT:       Initial: 0x50000  #                          ^-- redundant unused entry  # GOT-NEXT:     }  # GOT-NEXT:     Entry { -# GOT-NEXT:       Address: 0x20020 +# GOT-NEXT:       Address: 0x50020  # GOT-NEXT:       Access: -32720 -# GOT-NEXT:       Initial: 0x51008 +# GOT-NEXT:       Initial: 0x41008  #                          ^-- 'bar' address  # GOT-NEXT:     }  # GOT-NEXT:   ]  # GOT-NEXT:   Global entries [  # GOT-NEXT:     Entry { -# GOT-NEXT:       Address: 0x20024 +# GOT-NEXT:       Address: 0x50024  # GOT-NEXT:       Access: -32716  # GOT-NEXT:       Initial: 0x0  # GOT-NEXT:       Value: 0x0 diff --git a/lld/test/ELF/mips-gp-ext.s b/lld/test/ELF/mips-gp-ext.s index 16f663e13ae..21879986d51 100644 --- a/lld/test/ELF/mips-gp-ext.s +++ b/lld/test/ELF/mips-gp-ext.s @@ -20,10 +20,10 @@  # REQUIRES: mips  # REL:      Contents of section .text: -# REL-NEXT:  0000 3c080000 2108010c 8f82ffe4 +# REL-NEXT:  0000 3c080000 2108010c 8f82fff0  #                 ^-- %hi(_gp_disp)  #                          ^-- %lo(_gp_disp) -#                                   ^-- 8 - (0x10c - 0xe8) +#                                   ^-- 8 - (0x10c - 0xf4)  #                                       G - (GP - .got)  # REL:      Contents of section .reginfo: @@ -32,7 +32,7 @@  #                          ^-- _gp  # REL:      Contents of section .data: -# REL-NEXT:  0100 fffffef4 +# REL-NEXT:  00f0 fffffef4  #                 ^-- 0-0x10c  # REL: 00000000         .text           00000000 foo @@ -40,10 +40,10 @@  # REL: 0000010c         *ABS*           00000000 .hidden _gp  # ABS:      Contents of section .text: -# ABS-NEXT:  0000 3c080000 21080200 8f82fef0 +# ABS-NEXT:  0000 3c080000 21080200 8f82fefc  #                 ^-- %hi(_gp_disp)  #                          ^-- %lo(_gp_disp) -#                                   ^-- 8 - (0x200 - 0xe8) +#                                   ^-- 8 - (0x200 - 0xf4)  #                                       G - (GP - .got)  # ABS:      Contents of section .reginfo: @@ -52,7 +52,7 @@  #                          ^-- _gp  # ABS:      Contents of section .data: -# ABS-NEXT:  0100 fffffe00 +# ABS-NEXT:  00f0 fffffe00  #                 ^-- 0-0x200  # ABS: 00000000         .text           00000000 foo diff --git a/lld/test/ELF/mips-gp-lowest.s b/lld/test/ELF/mips-gp-lowest.s index b3d30aa3590..86c44b0e94e 100644 --- a/lld/test/ELF/mips-gp-lowest.s +++ b/lld/test/ELF/mips-gp-lowest.s @@ -36,7 +36,7 @@ foo:  # CHECK-NEXT:     SHF_MIPS_GPREL  # CHECK-NEXT:     SHF_WRITE  # CHECK-NEXT:   ] -# CHECK-NEXT:   Address: 0xE4 +# CHECK-NEXT:   Address: 0xF0  # CHECK:      }  # CHECK:      Name: _gp (5) diff --git a/lld/test/ELF/mips-hilo-gp-disp.s b/lld/test/ELF/mips-hilo-gp-disp.s index 16eab06e7b8..0edc2921091 100644 --- a/lld/test/ELF/mips-hilo-gp-disp.s +++ b/lld/test/ELF/mips-hilo-gp-disp.s @@ -22,34 +22,34 @@ bar:  # EXE:      Disassembly of section .text:  # EXE-NEXT: __start: -# EXE-NEXT:  20000:   3c 08 00 01   lui    $8, 1 -#                                              ^-- %hi(0x37ff0-0x20000) +# EXE-NEXT:  20000:   3c 08 00 02   lui    $8, 2 +#                                              ^-- %hi(0x47ff0-0x20000)  # EXE-NEXT:  20004:   21 08 7f f0   addi   $8, $8, 32752 -#                                                  ^-- %lo(0x37ff0-0x20004+4) +#                                                  ^-- %lo(0x47ff0-0x20004+4)  # EXE:      bar: -# EXE-NEXT:  2000c:   3c 08 00 01   lui    $8, 1 -#                                              ^-- %hi(0x37ff0-0x2000c) +# EXE-NEXT:  2000c:   3c 08 00 02   lui    $8, 2 +#                                              ^-- %hi(0x47ff0-0x2000c)  # EXE-NEXT:  20010:   21 08 7f e4   addi   $8, $8, 32740 -#                                                  ^-- %lo(0x37ff0-0x20010+4) +#                                                  ^-- %lo(0x47ff0-0x20010+4)  # EXE: SYMBOL TABLE:  # EXE: 0002000c     .text   00000000 bar -# EXE: 00037ff0     *ABS*   00000000 .hidden _gp +# EXE: 00047ff0     *ABS*   00000000 .hidden _gp  # EXE: 00020000     .text   00000000 __start  # SO:      Disassembly of section .text:  # SO-NEXT: __start: -# SO-NEXT:  10000:   3c 08 00 01   lui    $8, 1 -#                                             ^-- %hi(0x27ff0-0x10000) +# SO-NEXT:  10000:   3c 08 00 02   lui    $8, 2 +#                                             ^-- %hi(0x37ff0-0x10000)  # SO-NEXT:  10004:   21 08 7f f0   addi   $8, $8, 32752 -#                                                 ^-- %lo(0x27ff0-0x10004+4) +#                                                 ^-- %lo(0x37ff0-0x10004+4)  # SO:       bar: -# SO-NEXT:   1000c:   3c 08 00 01   lui    $8, 1 -#                                              ^-- %hi(0x27ff0-0x1000c) +# SO-NEXT:   1000c:   3c 08 00 02   lui    $8, 2 +#                                              ^-- %hi(0x37ff0-0x1000c)  # SO-NEXT:   10010:   21 08 7f e4   addi   $8, $8, 32740 -#                                                  ^-- %lo(0x27ff0-0x10010+4) +#                                                  ^-- %lo(0x37ff0-0x10010+4)  # SO: SYMBOL TABLE:  # SO: 0001000c     .text   00000000 bar -# SO: 00027ff0     *ABS*   00000000 .hidden _gp +# SO: 00037ff0     *ABS*   00000000 .hidden _gp  # SO: 00010000     .text   00000000 __start diff --git a/lld/test/ELF/mips-hilo.s b/lld/test/ELF/mips-hilo.s index 4f1452831ae..d5de9422c42 100644 --- a/lld/test/ELF/mips-hilo.s +++ b/lld/test/ELF/mips-hilo.s @@ -34,20 +34,20 @@ g1:  # CHECK-NEXT: __start:  # CHECK-NEXT:  20000:   3c 08 00 02   lui    $8, 2  #                                                ^-- %hi(__start+4) -# CHECK-NEXT:  20004:   3c 09 00 04   lui    $9, 4 +# CHECK-NEXT:  20004:   3c 09 00 03   lui    $9, 3  #                                                ^-- %hi(g1+8)  # CHECK-NEXT:  20008:   21 08 00 04   addi   $8, $8, 4  #                                                    ^-- %lo(__start+4)  # CHECK-NEXT:  2000c:   21 08 00 0c   addi   $8, $8, 12  #                                                    ^-- %lo(g1+8) -# CHECK-NEXT:  20010:   3c 08 00 05   lui    $8, 5 +# CHECK-NEXT:  20010:   3c 08 00 04   lui    $8, 4  #                                                ^-- %hi(l1+0x10000-4) -# CHECK-NEXT:  20014:   3c 09 00 06   lui    $9, 6 +# CHECK-NEXT:  20014:   3c 09 00 05   lui    $9, 5  #                                                ^-- %hi(l1+0x20000-4)  # CHECK-NEXT:  20018:   21 08 ff fc   addi   $8, $8, -4  #                                                    ^-- %lo(l1-4)  # CHECK: SYMBOL TABLE: -# CHECK: 0040000 l   .data   00000004 l1 +# CHECK: 0030000 l   .data   00000004 l1  # CHECK: 0020000     .text   00000000 __start -# CHECK: 0040004 g   .data   00000004 g1 +# CHECK: 0030004 g   .data   00000004 g1 diff --git a/lld/test/ELF/mips-options.s b/lld/test/ELF/mips-options.s index f48ecad81d2..34bf4889811 100644 --- a/lld/test/ELF/mips-options.s +++ b/lld/test/ELF/mips-options.s @@ -17,11 +17,11 @@ __start:      lui  $gp, %hi(%neg(%gp_rel(g1)))  # CHECK:      Name: _gp -# CHECK-NEXT: Value: 0x100008250 +# CHECK-NEXT: Value: 0x100008258  # CHECK:      MIPS Options {  # CHECK-NEXT:   ODK_REGINFO { -# CHECK-NEXT:     GP: 0x100008250 +# CHECK-NEXT:     GP: 0x100008258  # CHECK-NEXT:     General Mask: 0x10000001  # CHECK-NEXT:     Co-Proc Mask0: 0x0  # CHECK-NEXT:     Co-Proc Mask1: 0x0 diff --git a/lld/test/ELF/mips-pc-relocs.s b/lld/test/ELF/mips-pc-relocs.s index 209d7d2971f..e0f39e7ed7c 100644 --- a/lld/test/ELF/mips-pc-relocs.s +++ b/lld/test/ELF/mips-pc-relocs.s @@ -38,8 +38,8 @@ __start:  #                                      ^-- %lo(0x20020-0x20014)  # CHECK: Contents of section .data: -# CHECK-NEXT: 40000 fffe0028 00000000 00000000 00000000 -#                   ^-- 0x20020 + 8 - 0x40000 +# CHECK-NEXT: 30000 ffff0028 00000000 00000000 00000000 +#                   ^-- 0x20020 + 8 - 0x30000  # CHECK: 00020000         .text           00000000 __start  # CHECK: 00020020         .text           00000000 _foo diff --git a/lld/test/ELF/mips-plt-r6.s b/lld/test/ELF/mips-plt-r6.s index 8685d6158f7..ccf233cc73c 100644 --- a/lld/test/ELF/mips-plt-r6.s +++ b/lld/test/ELF/mips-plt-r6.s @@ -18,7 +18,7 @@  #  # CHECK-NEXT: Disassembly of section .plt:  # CHECK-NEXT: .plt: -# CHECK-NEXT:   20010:       3c 1c 00 04     aui     $zero, $gp, 4 +# CHECK-NEXT:   20010:       3c 1c 00 03     aui     $zero, $gp, 3  # CHECK-NEXT:   20014:       8f 99 00 04     lw      $25, 4($gp)  # CHECK-NEXT:   20018:       27 9c 00 04     addiu   $gp, $gp, 4  # CHECK-NEXT:   2001c:       03 1c c0 23     subu    $24, $24, $gp @@ -27,7 +27,7 @@  # CHECK-NEXT:   20028:       03 20 f8 09     jalr    $25  # CHECK-NEXT:   2002c:       27 18 ff fe     addiu   $24, $24, -2 -# CHECK-NEXT:   20030:       3c 0f 00 04     aui     $zero, $15, 4 +# CHECK-NEXT:   20030:       3c 0f 00 03     aui     $zero, $15, 3  # CHECK-NEXT:   20034:       8d f9 00 0c     lw      $25, 12($15)  # CHECK-NEXT:   20038:       03 20 00 09     jr      $25  # CHECK-NEXT:   2003c:       25 f8 00 0c     addiu   $24, $15, 12 diff --git a/lld/test/ELF/mips-tls-64.s b/lld/test/ELF/mips-tls-64.s index 808fa4cbd1d..39459cf2efa 100644 --- a/lld/test/ELF/mips-tls-64.s +++ b/lld/test/ELF/mips-tls-64.s @@ -23,26 +23,26 @@  # DIS-NEXT:    20010:   24 62 80 58   addiu   $2, $3, -32680  # DIS:      Contents of section .got: -# DIS-NEXT:  30008 00000000 00000000 80000000 00000000 -# DIS-NEXT:  30018 00000000 00000000 00000000 00000000 -# DIS-NEXT:  30028 00000000 00000000 00000000 00000001 -# DIS-NEXT:  30038 00000000 00000000 00000000 00000001 -# DIS-NEXT:  30048 ffffffff ffff8004 ffffffff ffff9004 +# DIS-NEXT:  40008 00000000 00000000 80000000 00000000 +# DIS-NEXT:  40018 00000000 00000000 00000000 00000000 +# DIS-NEXT:  40028 00000000 00000000 00000000 00000001 +# DIS-NEXT:  40038 00000000 00000000 00000000 00000001 +# DIS-NEXT:  40048 ffffffff ffff8004 ffffffff ffff9004 -# DIS: 0000000000030000 l       .tdata          00000000 .tdata -# DIS: 0000000000030000 l       .tdata          00000000 loc +# DIS: 0000000000040000 l       .tdata          00000000 .tdata +# DIS: 0000000000040000 l       .tdata          00000000 loc  # DIS: 0000000000000004 g       .tdata          00000000 bar  # DIS: 0000000000000000 g       *UND*           00000000 foo  # CHECK:      Relocations [  # CHECK-NEXT:   Section (7) .rela.dyn { -# CHECK-NEXT:     0x30018 R_MIPS_TLS_DTPMOD64/R_MIPS_NONE/R_MIPS_NONE foo 0x0 -# CHECK-NEXT:     0x30020 R_MIPS_TLS_DTPREL64/R_MIPS_NONE/R_MIPS_NONE foo 0x0 -# CHECK-NEXT:     0x30028 R_MIPS_TLS_TPREL64/R_MIPS_NONE/R_MIPS_NONE foo 0x0 +# CHECK-NEXT:     0x40018 R_MIPS_TLS_DTPMOD64/R_MIPS_NONE/R_MIPS_NONE foo 0x0 +# CHECK-NEXT:     0x40020 R_MIPS_TLS_DTPREL64/R_MIPS_NONE/R_MIPS_NONE foo 0x0 +# CHECK-NEXT:     0x40028 R_MIPS_TLS_TPREL64/R_MIPS_NONE/R_MIPS_NONE foo 0x0  # CHECK-NEXT:   }  # CHECK-NEXT: ]  # CHECK-NEXT: Primary GOT { -# CHECK-NEXT:   Canonical gp value: 0x37FF8 +# CHECK-NEXT:   Canonical gp value: 0x47FF8  # CHECK-NEXT:   Reserved entries [  # CHECK:        ]  # CHECK-NEXT:   Local entries [ diff --git a/lld/test/ELF/mips-tls-static-64.s b/lld/test/ELF/mips-tls-static-64.s index e7baf67bb29..6f88e86a3f4 100644 --- a/lld/test/ELF/mips-tls-static-64.s +++ b/lld/test/ELF/mips-tls-static-64.s @@ -8,8 +8,8 @@  # REQUIRES: mips  # CHECK:      Contents of section .data: -# CHECK-NEXT:  40000 00020004 ffffffff ffff8004 ffffffff -# CHECK-NEXT:  40010 ffff9004 +# CHECK-NEXT:  30000 00020004 ffffffff ffff8004 ffffffff +# CHECK-NEXT:  30010 ffff9004  #  # CHECK: SYMBOL TABLE:  # CHECK: 0000000000020004         .text           00000000 __tls_get_addr diff --git a/lld/test/ELF/mips-tls-static.s b/lld/test/ELF/mips-tls-static.s index 6f0fa559ae0..c8571a2658e 100644 --- a/lld/test/ELF/mips-tls-static.s +++ b/lld/test/ELF/mips-tls-static.s @@ -7,11 +7,11 @@  # REQUIRES: mips -# CHECK:      Contents of section .got: -# CHECK-NEXT:  30008 00000000 80000000 00000001 ffff8000 -# CHECK-NEXT:  30018 00000001 00000000 ffff9000  # CHECK:      Contents of section .data: -# CHECK-NEXT:  40000 0002000c ffff8004 ffff9004 +# CHECK-NEXT:  30000 0002000c ffff8004 ffff9004 +# CHECK:      Contents of section .got: +# CHECK-NEXT:  40008 00000000 80000000 00000001 ffff8000 +# CHECK-NEXT:  40018 00000001 00000000 ffff9000  #  # CHECK: SYMBOL TABLE:  # CHECK: 0002000c         .text           00000000 __tls_get_addr diff --git a/lld/test/ELF/mips-tls.s b/lld/test/ELF/mips-tls.s index fa02324fd85..7bca4773c99 100644 --- a/lld/test/ELF/mips-tls.s +++ b/lld/test/ELF/mips-tls.s @@ -23,24 +23,24 @@  # DIS-NEXT:    20010:   24 62 80 34   addiu   $2, $3, -32716  # DIS:      Contents of section .got: -# DIS-NEXT:  30008 00000000 80000000 00000000 00000000 -# DIS-NEXT:  30018 00000000 00000001 00000000 00000001 -# DIS-NEXT:  30028 ffff8004 ffff9004 +# DIS-NEXT:  40008 00000000 80000000 00000000 00000000 +# DIS-NEXT:  40018 00000000 00000001 00000000 00000001 +# DIS-NEXT:  40028 ffff8004 ffff9004 -# DIS: 00030000 l       .tdata          00000000 .tdata -# DIS: 00030000 l       .tdata          00000000 loc +# DIS: 00040000 l       .tdata          00000000 .tdata +# DIS: 00040000 l       .tdata          00000000 loc  # DIS: 00000004 g       .tdata          00000000 bar  # DIS: 00000000 g       *UND*           00000000 foo  # CHECK:      Relocations [  # CHECK-NEXT:   Section (7) .rel.dyn { -# CHECK-NEXT:     0x30010 R_MIPS_TLS_DTPMOD32 foo 0x0 -# CHECK-NEXT:     0x30014 R_MIPS_TLS_DTPREL32 foo 0x0 -# CHECK-NEXT:     0x30018 R_MIPS_TLS_TPREL32 foo 0x0 +# CHECK-NEXT:     0x40010 R_MIPS_TLS_DTPMOD32 foo 0x0 +# CHECK-NEXT:     0x40014 R_MIPS_TLS_DTPREL32 foo 0x0 +# CHECK-NEXT:     0x40018 R_MIPS_TLS_TPREL32 foo 0x0  # CHECK-NEXT:   }  # CHECK-NEXT: ]  # CHECK-NEXT: Primary GOT { -# CHECK-NEXT:   Canonical gp value: 0x37FF8 +# CHECK-NEXT:   Canonical gp value: 0x47FF8  # CHECK-NEXT:   Reserved entries [  # CHECK:        ]  # CHECK-NEXT:   Local entries [ diff --git a/lld/test/ELF/mips-xgot-order.s b/lld/test/ELF/mips-xgot-order.s index d249715bafa..b235c0c6b09 100644 --- a/lld/test/ELF/mips-xgot-order.s +++ b/lld/test/ELF/mips-xgot-order.s @@ -20,15 +20,15 @@  # CHECK-NEXT:    20018:       20 42 00 00     addi    $2, $2, 0  # CHECK:      Contents of section .got: -# CHECK-NEXT:  30000 00000000 80000000 00040000 00050000 +# CHECK-NEXT:  40000 00000000 80000000 00030000 00040000  #                                      ^ %hi(loc)  #                                               ^ redundant entry -# CHECK-NEXT:  30010 00020010 00020000 00040000 +# CHECK-NEXT:  40010 00020010 00020000 00030000  #                    ^ %got(bar)  #                             ^ %got_hi/lo(start)  #                                      ^ %got_hi/lo(loc) -# CHECK: 00040000         .data           00000000 loc +# CHECK: 00030000         .data           00000000 loc  # CHECK: 00020000         .text           00000000 __start  # CHECK: 00020010         .text           00000000 bar diff --git a/lld/test/ELF/plt-aarch64.s b/lld/test/ELF/plt-aarch64.s index 9bc6f54743a..372186b4b1f 100644 --- a/lld/test/ELF/plt-aarch64.s +++ b/lld/test/ELF/plt-aarch64.s @@ -31,7 +31,7 @@  // CHECKDSO-NEXT:       SHF_ALLOC  // CHECKDSO-NEXT:       SHF_WRITE  // CHECKDSO-NEXT:     ] -// CHECKDSO-NEXT:     Address: 0x30000 +// CHECKDSO-NEXT:     Address: 0x20000  // CHECKDSO-NEXT:     Offset:  // CHECKDSO-NEXT:     Size: 48  // CHECKDSO-NEXT:     Link: @@ -41,23 +41,23 @@  // CHECKDSO: Relocations [  // CHECKDSO-NEXT:   Section ({{.*}}) .rela.plt { -// &(.got.plt[3]) = 0x30000 + 3 * 8 = 0x30018 -// CHECKDSO-NEXT:     0x30018 R_AARCH64_JUMP_SLOT foo +// &(.got.plt[3]) = 0x20000 + 3 * 8 = 0x30018 +// CHECKDSO-NEXT:     0x20018 R_AARCH64_JUMP_SLOT foo -// &(.got.plt[4]) = 0x30000 + 4 * 8 = 0x30020 -// CHECKDSO-NEXT:     0x30020 R_AARCH64_JUMP_SLOT bar +// &(.got.plt[4]) = 0x20000 + 4 * 8 = 0x30020 +// CHECKDSO-NEXT:     0x20020 R_AARCH64_JUMP_SLOT bar -// &(.got.plt[5]) = 0x30000 + 5 * 8 = 0x30028 -// CHECKDSO-NEXT:     0x30028 R_AARCH64_JUMP_SLOT weak +// &(.got.plt[5]) = 0x20000 + 5 * 8 = 0x30028 +// CHECKDSO-NEXT:     0x20028 R_AARCH64_JUMP_SLOT weak  // CHECKDSO-NEXT:   }  // CHECKDSO-NEXT: ]  // DUMPDSO: Contents of section .got.plt:  // .got.plt[0..2] = 0 (reserved)  // .got.plt[3..5] = .plt = 0x10010 -// DUMPDSO-NEXT: 30000 00000000 00000000 00000000 00000000  ................ -// DUMPDSO-NEXT: 30010 00000000 00000000 10000100 00000000  ................ -// DUMPDSO-NEXT: 30020 10000100 00000000 10000100 00000000  ................ +// DUMPDSO-NEXT: 20000 00000000 00000000 00000000 00000000  ................ +// DUMPDSO-NEXT: 20010 00000000 00000000 10000100 00000000  ................ +// DUMPDSO-NEXT: 20020 10000100 00000000 10000100 00000000  ................  // DISASMDSO: _start:  // 0x10030 - 0x10000 = 0x30 = 48 @@ -74,8 +74,8 @@  // DISASMDSO-NEXT: .plt:  // DISASMDSO-NEXT:     10010:	f0 7b bf a9 	stp	x16, x30, [sp, #-16]!  // &(.got.plt[2]) = 0x3000 + 2 * 8 = 0x3010 -// Page(0x30010) - Page(0x10014) = 0x30000 - 0x10000 = 0x20000 = 131072 -// DISASMDSO-NEXT:     10014:	10 01 00 90 	adrp	x16, #131072 +// Page(0x20010) - Page(0x10014) = 0x20000 - 0x10000 = 0x10000 = 65536 +// DISASMDSO-NEXT:     10014:	90 00 00 90 	adrp	x16, #65536  // 0x3010 & 0xFFF = 0x10 = 16  // DISASMDSO-NEXT:     10018:	11 0a 40 f9 ldr x17, [x16, #16]  // DISASMDSO-NEXT:     1001c:	10 42 00 91 	add	x16, x16, #16 @@ -85,24 +85,24 @@  // DISASMDSO-NEXT:     1002c:	1f 20 03 d5 	nop  // foo@plt -// Page(0x30018) - Page(0x10030) = 0x30000 - 0x10000 = 0x20000 = 131072 -// DISASMDSO-NEXT:     10030:	10 01 00 90 	adrp	x16, #131072 +// Page(0x30018) - Page(0x10030) = 0x20000 - 0x10000 = 0x10000 = 65536 +// DISASMDSO-NEXT:     10030:	90 00 00 90 	adrp	x16, #65536  // 0x3018 & 0xFFF = 0x18 = 24  // DISASMDSO-NEXT:     10034:	11 0e 40 f9 	ldr	x17, [x16, #24]  // DISASMDSO-NEXT:     10038:	10 62 00 91 	add	x16, x16, #24  // DISASMDSO-NEXT:     1003c:	20 02 1f d6 	br	x17  // bar@plt -// Page(0x30020) - Page(0x10040) = 0x30000 - 0x10000 = 0x20000 = 131072 -// DISASMDSO-NEXT:     10040:	10 01 00 90 	adrp	x16, #131072 +// Page(0x30020) - Page(0x10040) = 0x20000 - 0x10000 = 0x10000 = 65536 +// DISASMDSO-NEXT:     10040:	90 00 00 90 	adrp	x16, #65536  // 0x3020 & 0xFFF = 0x20 = 32  // DISASMDSO-NEXT:     10044:	11 12 40 f9 	ldr	x17, [x16, #32]  // DISASMDSO-NEXT:     10048:	10 82 00 91 	add	x16, x16, #32  // DISASMDSO-NEXT:     1004c:	20 02 1f d6 	br	x17  // weak@plt -// Page(0x30028) - Page(0x10050) = 0x30000 - 0x10000 = 0x20000 = 131072 -// DISASMDSO-NEXT:     10050:	10 01 00 90 	adrp	x16, #131072 +// Page(0x30028) - Page(0x10050) = 0x20000 - 0x10000 = 0x10000 = 65536 +// DISASMDSO-NEXT:     10050:	90 00 00 90 	adrp	x16, #65536  // 0x3028 & 0xFFF = 0x28 = 40  // DISASMDSO-NEXT:     10054:	11 16 40 f9 	ldr	x17, [x16, #40]  // DISASMDSO-NEXT:     10058:	10 a2 00 91 	add	x16, x16, #40 @@ -127,7 +127,7 @@  // CHECKEXE-NEXT:       SHF_ALLOC  // CHECKEXE-NEXT:       SHF_WRITE  // CHECKEXE-NEXT:     ] -// CHECKEXE-NEXT:     Address: 0x40000 +// CHECKEXE-NEXT:     Address: 0x30000  // CHECKEXE-NEXT:     Offset:  // CHECKEXE-NEXT:     Size: 40  // CHECKEXE-NEXT:     Link: @@ -137,20 +137,20 @@  // CHECKEXE: Relocations [  // CHECKEXE-NEXT:   Section ({{.*}}) .rela.plt { -// &(.got.plt[3]) = 0x13000 + 3 * 8 = 0x13018 -// CHECKEXE-NEXT:     0x40018 R_AARCH64_JUMP_SLOT bar 0x0 +// &(.got.plt[3]) = 0x30000 + 3 * 8 = 0x30018 +// CHECKEXE-NEXT:     0x30018 R_AARCH64_JUMP_SLOT bar 0x0 -// &(.got.plt[4]) = 0x13000 + 4 * 8 = 0x13020 -// CHECKEXE-NEXT:     0x40020 R_AARCH64_JUMP_SLOT weak 0x0 +// &(.got.plt[4]) = 0x30000 + 4 * 8 = 0x30020 +// CHECKEXE-NEXT:     0x30020 R_AARCH64_JUMP_SLOT weak 0x0  // CHECKEXE-NEXT:   }  // CHECKEXE-NEXT: ]  // DUMPEXE: Contents of section .got.plt:  // .got.plt[0..2] = 0 (reserved)  // .got.plt[3..4] = .plt = 0x40010 -// DUMPEXE-NEXT:  40000 00000000 00000000 00000000 00000000  ................ -// DUMPEXE-NEXT:  40010 00000000 00000000 10000200 00000000  ................ -// DUMPEXE-NEXT:  40020 10000200 00000000                    ........ +// DUMPEXE-NEXT:  30000 00000000 00000000 00000000 00000000  ................ +// DUMPEXE-NEXT:  30010 00000000 00000000 10000200 00000000  ................ +// DUMPEXE-NEXT:  30020 10000200 00000000                    ........  // DISASMEXE: _start:  // 0x2000c - 0x20000 = 0xc = 12 @@ -167,8 +167,8 @@  // DISASMEXE-NEXT: .plt:  // DISASMEXE-NEXT:    20010:	f0 7b bf a9 	stp	x16, x30, [sp, #-16]!  // &(.got.plt[2]) = 0x300B0 + 2 * 8 = 0x300C0 -// Page(0x40010) - Page(0x20014) = 0x40000 - 0x20000 = 0x20000 = 131072 -// DISASMEXE-NEXT:    20014:	10 01 00 90  	adrp	x16, #131072 +// Page(0x30010) - Page(0x20014) = 0x30000 - 0x20000 = 0x10000 = 65536 +// DISASMEXE-NEXT:    20014:	90 00 00 90  	adrp	x16, #65536  // 0x120c0 & 0xFFF = 0xC0 = 192  // DISASMEXE-NEXT:    20018:	11 0a 40 f9 	ldr	x17, [x16, #16]  // DISASMEXE-NEXT:    2001c:	10 42 00 91 	add	x16, x16, #16 @@ -178,15 +178,15 @@  // DISASMEXE-NEXT:    2002c:	1f 20 03 d5 	nop  // bar@plt -// Page(0x40018) - Page(0x20030) = 0x40000 - 0x20000 = 0x20000 = 131072 -// DISASMEXE-NEXT:    20030:	10 01 00 90 	adrp	x16, #131072 +// Page(0x40018) - Page(0x20030) = 0x30000 - 0x20000 = 0x10000 = 65536 +// DISASMEXE-NEXT:    20030:	90 00 00 90 	adrp	x16, #65536  // DISASMEXE-NEXT:    20034:	11 0e 40 f9 	ldr	x17, [x16, #24]  // DISASMEXE-NEXT:    20038:	10 62 00 91 	add	x16, x16, #24  // DISASMEXE-NEXT:    2003c:	20 02 1f d6 	br	x17  // weak@plt -// Page(0x40020) - Page(0x20040) = 0x40000 - 0x20000 = 0x20000 = 131072 -// DISASMEXE-NEXT:    20040:	10 01 00 90 	adrp	x16, #131072 +// Page(0x40020) - Page(0x20040) = 0x30000 - 0x20000 = 0x10000 = 65536 +// DISASMEXE-NEXT:    20040:	90 00 00 90 	adrp	x16, #65536  // DISASMEXE-NEXT:    20044:	11 12 40 f9 	ldr	x17, [x16, #32]  // DISASMEXE-NEXT:    20048:	10 82 00 91 	add	x16, x16, #32  // DISASMEXE-NEXT:    2004c:	20 02 1f d6 	br	x17 diff --git a/lld/test/ELF/plt-i686.s b/lld/test/ELF/plt-i686.s index bf07fede798..e169bd4d70f 100644 --- a/lld/test/ELF/plt-i686.s +++ b/lld/test/ELF/plt-i686.s @@ -30,20 +30,20 @@  // CHECK-NEXT:   SHF_ALLOC  // CHECK-NEXT:   SHF_WRITE  // CHECK-NEXT: ] -// CHECK-NEXT: Address: 0x13000 -// CHECK-NEXT: Offset: 0x3000 +// CHECK-NEXT: Address: 0x12000 +// CHECK-NEXT: Offset: 0x2000  // CHECK-NEXT: Size: 20  // CHECK-NEXT: Link: 0  // CHECK-NEXT: Info: 0  // CHECK-NEXT: AddressAlignment: 4  // CHECK-NEXT: EntrySize: 0 -// 0x13000 + got.plt.reserved(12) = 0x1300C -// 0x13000 + got.plt.reserved(12) + 4 = 0x13010 +// 0x12000 + got.plt.reserved(12) = 0x1200C +// 0x12000 + got.plt.reserved(12) + 4 = 0x12010  // CHECK:      Relocations [  // CHECK-NEXT:   Section ({{.*}}) .rel.plt { -// CHECK-NEXT:     0x1300C R_386_JUMP_SLOT bar 0x0 -// CHECK-NEXT:     0x13010 R_386_JUMP_SLOT zed 0x0 +// CHECK-NEXT:     0x1200C R_386_JUMP_SLOT bar 0x0 +// CHECK-NEXT:     0x12010 R_386_JUMP_SLOT zed 0x0  // CHECK-NEXT:   }  // CHECK-NEXT: ] @@ -73,16 +73,16 @@  // 77840 = 0x13010 = .got.plt (0x13000) + got.plt.reserved(12) + 4  // DISASM:      Disassembly of section .plt:  // DISASM-NEXT: .plt: -// DISASM-NEXT:    11020: ff 35 04 30 01 00 pushl 77828 -// DISASM-NEXT:    11026: ff 25 08 30 01 00 jmpl *77832 +// DISASM-NEXT:    11020: ff 35 04 20 01 00 pushl 73732 +// DISASM-NEXT:    11026: ff 25 08 20 01 00 jmpl *73736  // DISASM-NEXT:    1102c: 90 nop  // DISASM-NEXT:    1102d: 90 nop  // DISASM-NEXT:    1102e: 90 nop  // DISASM-NEXT:    1102f: 90 nop -// DISASM-NEXT:    11030: ff 25 0c 30 01 00 jmpl *77836 +// DISASM-NEXT:    11030: ff 25 0c 20 01 00 jmpl *73740  // DISASM-NEXT:    11036: 68 00 00 00 00 pushl $0  // DISASM-NEXT:    1103b: e9 e0 ff ff ff jmp -32 <.plt> -// DISASM-NEXT:    11040: ff 25 10 30 01 00 jmpl *77840 +// DISASM-NEXT:    11040: ff 25 10 20 01 00 jmpl *73744  // DISASM-NEXT:    11046: 68 08 00 00 00 pushl $8  // DISASM-NEXT:    1104b: e9 d0 ff ff ff jmp -48 <.plt> @@ -106,8 +106,8 @@  // CHECKSHARED-NEXT:     SHF_ALLOC  // CHECKSHARED-NEXT:     SHF_WRITE  // CHECKSHARED-NEXT:   ] -// CHECKSHARED-NEXT:   Address: 0x3000 -// CHECKSHARED-NEXT:   Offset: 0x3000 +// CHECKSHARED-NEXT:   Address: 0x2000 +// CHECKSHARED-NEXT:   Offset: 0x2000  // CHECKSHARED-NEXT:   Size: 20  // CHECKSHARED-NEXT:   Link: 0  // CHECKSHARED-NEXT:   Info: 0 @@ -115,12 +115,12 @@  // CHECKSHARED-NEXT:   EntrySize: 0  // CHECKSHARED-NEXT:   } -// 0x3000 + got.plt.reserved(12) = 0x300C -// 0x3000 + got.plt.reserved(12) + 4 = 0x3010 +// 0x2000 + got.plt.reserved(12) = 0x200C +// 0x2000 + got.plt.reserved(12) + 4 = 0x2010  // CHECKSHARED:        Relocations [  // CHECKSHARED-NEXT:     Section ({{.*}}) .rel.plt { -// CHECKSHARED-NEXT:       0x300C R_386_JUMP_SLOT bar 0x0 -// CHECKSHARED-NEXT:       0x3010 R_386_JUMP_SLOT zed 0x0 +// CHECKSHARED-NEXT:       0x200C R_386_JUMP_SLOT bar 0x0 +// CHECKSHARED-NEXT:       0x2010 R_386_JUMP_SLOT zed 0x0  // CHECKSHARED-NEXT:     }  // CHECKSHARED-NEXT:   ] @@ -156,10 +156,10 @@  // DISASMPIE-NEXT:   102d:	90 nop  // DISASMPIE-NEXT:   102e:	90 nop  // DISASMPIE-NEXT:   102f:	90 nop -// DISASMPIE-NEXT:   1030:	ff a3 0c 30 00 00 jmpl *12300(%ebx) +// DISASMPIE-NEXT:   1030:	ff a3 0c 20 00 00 jmpl *8204(%ebx)  // DISASMPIE-NEXT:   1036:	68 00 00 00 00 pushl $0  // DISASMPIE-NEXT:   103b:	e9 e0 ff ff ff jmp -32 <.plt> -// DISASMPIE-NEXT:   1040:	ff a3 10 30 00 00 jmpl *12304(%ebx) +// DISASMPIE-NEXT:   1040:	ff a3 10 20 00 00 jmpl *8208(%ebx)  // DISASMPIE-NEXT:   1046:	68 08 00 00 00 pushl $8  // DISASMPIE-NEXT:   104b:	e9 d0 ff ff ff jmp -48 <.plt> diff --git a/lld/test/ELF/plt.s b/lld/test/ELF/plt.s index 0153e82786a..4ab81aaaed9 100644 --- a/lld/test/ELF/plt.s +++ b/lld/test/ELF/plt.s @@ -25,9 +25,9 @@  // CHECK:      Relocations [  // CHECK-NEXT:   Section ({{.*}}) .rela.plt { -// CHECK-NEXT:     0x3018 R_X86_64_JUMP_SLOT bar 0x0 -// CHECK-NEXT:     0x3020 R_X86_64_JUMP_SLOT zed 0x0 -// CHECK-NEXT:     0x3028 R_X86_64_JUMP_SLOT _start 0x0 +// CHECK-NEXT:     0x2018 R_X86_64_JUMP_SLOT bar 0x0 +// CHECK-NEXT:     0x2020 R_X86_64_JUMP_SLOT zed 0x0 +// CHECK-NEXT:     0x2028 R_X86_64_JUMP_SLOT _start 0x0  // CHECK-NEXT:   }  // CHECK-NEXT: ] @@ -46,8 +46,8 @@  // CHECK2:      Relocations [  // CHECK2-NEXT:   Section ({{.*}}) .rela.plt { -// CHECK2-NEXT:     0x203018 R_X86_64_JUMP_SLOT bar 0x0 -// CHECK2-NEXT:     0x203020 R_X86_64_JUMP_SLOT zed 0x0 +// CHECK2-NEXT:     0x202018 R_X86_64_JUMP_SLOT bar 0x0 +// CHECK2-NEXT:     0x202020 R_X86_64_JUMP_SLOT zed 0x0  // CHECK2-NEXT:   }  // CHECK2-NEXT: ] @@ -65,22 +65,22 @@  // DISASM-NEXT:   100a:  e9 {{.*}}       jmp  49  // DISASM-NEXT:   100f:  e9 {{.*}}       jmp  60 -// 0x3018 - 0x1036  = 8162 -// 0x3020 - 0x1046  = 4234 -// 0x3028 - 0x1056  = 4226 +// 0x2018 - 0x1036  = 4066 +// 0x2020 - 0x1046  = 4058 +// 0x2028 - 0x1056  = 4050  // DISASM:      Disassembly of section .plt:  // DISASM-NEXT: .plt: -// DISASM-NEXT:   1020:  ff 35 e2 1f 00 00  pushq 8162(%rip) -// DISASM-NEXT:   1026:  ff 25 e4 1f 00 00  jmpq *8164(%rip) +// DISASM-NEXT:   1020:  ff 35 e2 0f 00 00  pushq 4066(%rip) +// DISASM-NEXT:   1026:  ff 25 e4 0f 00 00  jmpq *4068(%rip)  // DISASM-NEXT:   102c:  0f 1f 40 00        nopl (%rax) -// DISASM-NEXT:   1030:  ff 25 e2 1f 00 00  jmpq *8162(%rip) +// DISASM-NEXT:   1030:  ff 25 e2 0f 00 00  jmpq *4066(%rip)  // DISASM-NEXT:   1036:  68 00 00 00 00     pushq $0  // DISASM-NEXT:   103b:  e9 e0 ff ff ff     jmp -32 <.plt> -// DISASM-NEXT:   1040:  ff 25 da 1f 00 00  jmpq *8154(%rip) +// DISASM-NEXT:   1040:  ff 25 da 0f 00 00  jmpq *4058(%rip)  // DISASM-NEXT:   1046:  68 01 00 00 00     pushq $1  // DISASM-NEXT:   104b:  e9 d0 ff ff ff     jmp -48 <.plt> -// DISASM-NEXT:   1050:  ff 25 d2 1f 00 00  jmpq *8146(%rip) +// DISASM-NEXT:   1050:  ff 25 d2 0f 00 00  jmpq *4050(%rip)  // DISASM-NEXT:   1056:  68 02 00 00 00     pushq $2  // DISASM-NEXT:   105b:  e9 c0 ff ff ff     jmp -64 <.plt> @@ -95,18 +95,18 @@  // DISASM2-NEXT:   20100a:  e9 {{.*}}     jmp  49  // DISASM2-NEXT:   20100f:  e9 {{.*}}     jmp  -20 -// 0x203018 - 0x201036  = 4242 -// 0x203020 - 0x201046  = 4234 +// 0x202018 - 0x201036  = 4066 +// 0x202020 - 0x201046  = 4058  // DISASM2:      Disassembly of section .plt:  // DISASM2-NEXT: .plt: -// DISASM2-NEXT:  201020:  ff 35 e2 1f 00 00   pushq 8162(%rip) -// DISASM2-NEXT:  201026:  ff 25 e4 1f 00 00   jmpq *8164(%rip) +// DISASM2-NEXT:  201020:  ff 35 e2 0f 00 00   pushq 4066(%rip) +// DISASM2-NEXT:  201026:  ff 25 e4 0f 00 00   jmpq *4068(%rip)  // DISASM2-NEXT:  20102c:  0f 1f 40 00         nopl  (%rax) -// DISASM2-NEXT:  201030:  ff 25 e2 1f 00 00   jmpq *8162(%rip) +// DISASM2-NEXT:  201030:  ff 25 e2 0f 00 00   jmpq *4066(%rip)  // DISASM2-NEXT:  201036:  68 00 00 00 00      pushq $0  // DISASM2-NEXT:  20103b:  e9 e0 ff ff ff      jmp -32 <.plt> -// DISASM2-NEXT:  201040:  ff 25 da 1f 00 00   jmpq *8154(%rip) +// DISASM2-NEXT:  201040:  ff 25 da 0f 00 00   jmpq *4058(%rip)  // DISASM2-NEXT:  201046:  68 01 00 00 00      pushq $1  // DISASM2-NEXT:  20104b:  e9 d0 ff ff ff      jmp -48 <.plt>  // DISASM2-NOT:   2010C0 diff --git a/lld/test/ELF/ppc64-relocs.s b/lld/test/ELF/ppc64-relocs.s index 28902aed26d..cb6177dfe30 100644 --- a/lld/test/ELF/ppc64-relocs.s +++ b/lld/test/ELF/ppc64-relocs.s @@ -43,7 +43,7 @@ _start:  # CHECK: Disassembly of section .R_PPC64_TOC16_HI:  # CHECK: .FR_PPC64_TOC16_HI: -# CHECK: 10010014: 3c 22 ff ff addis 1, 2, -1 +# CHECK: 10010014: 3c 22 ff fe addis 1, 2, -2  .section .R_PPC64_TOC16_HA,"ax",@progbits  .globl .FR_PPC64_TOC16_HA @@ -52,7 +52,7 @@ _start:  # CHECK: Disassembly of section .R_PPC64_TOC16_HA:  # CHECK: .FR_PPC64_TOC16_HA: -# CHECK: 10010018: 3c 22 00 00 addis 1, 2, 0 +# CHECK: 10010018: 3c 22 ff ff addis 1, 2, -1  .section .R_PPC64_REL24,"ax",@progbits  .globl .FR_PPC64_REL24 diff --git a/lld/test/ELF/ppc64-shared-rel-toc.s b/lld/test/ELF/ppc64-shared-rel-toc.s index f5cd4593668..445011bf8e2 100644 --- a/lld/test/ELF/ppc64-shared-rel-toc.s +++ b/lld/test/ELF/ppc64-shared-rel-toc.s @@ -19,9 +19,9 @@ foo:                                    # @foo  .Lfunc_begin0:          blr -// CHECK: 0x30000 R_PPC64_RELATIVE - 0x10000 -// CHECK: 0x30008 R_PPC64_RELATIVE - 0x8000 +// CHECK: 0x20000 R_PPC64_RELATIVE - 0x10000 +// CHECK: 0x20008 R_PPC64_RELATIVE - 0x8000  // CHECK: Name: foo -// CHECK-NEXT: Value: 0x30000 +// CHECK-NEXT: Value: 0x20000 diff --git a/lld/test/ELF/ppc64-toc-restore.s b/lld/test/ELF/ppc64-toc-restore.s index dbfeaece7db..0c3d30b2d31 100644 --- a/lld/test/ELF/ppc64-toc-restore.s +++ b/lld/test/ELF/ppc64-toc-restore.s @@ -53,7 +53,7 @@ last:  // CHECK: Disassembly of section .plt:  // CHECK: .plt:  // CHECK: 10010020:       f8 41 00 28     std 2, 40(1) -// CHECK: 10010024:       3d 62 10 03     addis 11, 2, 4099 +// CHECK: 10010024:       3d 62 10 02     addis 11, 2, 4098  // CHECK: 10010028:       e9 8b 80 18     ld 12, -32744(11)  // CHECK: 1001002c:       e9 6c 00 00     ld 11, 0(12)  // CHECK: 10010030:       7d 69 03 a6     mtctr 11 diff --git a/lld/test/ELF/rel-offset.s b/lld/test/ELF/rel-offset.s index 6f35bcebc4b..8044e61c3cb 100644 --- a/lld/test/ELF/rel-offset.s +++ b/lld/test/ELF/rel-offset.s @@ -10,6 +10,6 @@          .quad   foo  // CHECK:      Section ({{.*}}) .rela.dyn { -// CHECK-NEXT:   0x2000 R_X86_64_64 foo 0x0 -// CHECK-NEXT:   0x2008 R_X86_64_64 foo 0x0 +// CHECK-NEXT:   0x1000 R_X86_64_64 foo 0x0 +// CHECK-NEXT:   0x1008 R_X86_64_64 foo 0x0  // CHECK-NEXT: } diff --git a/lld/test/ELF/relative-dynamic-reloc-pie.s b/lld/test/ELF/relative-dynamic-reloc-pie.s index d9967af52eb..25b3e0ac233 100644 --- a/lld/test/ELF/relative-dynamic-reloc-pie.s +++ b/lld/test/ELF/relative-dynamic-reloc-pie.s @@ -5,9 +5,9 @@  ## Test that we create R_X86_64_RELATIVE relocations with -pie.  # CHECK:      Relocations [  # CHECK-NEXT:   Section ({{.*}}) .rela.dyn { -# CHECK-NEXT:     0x3000 R_X86_64_RELATIVE - 0x3000 -# CHECK-NEXT:     0x3008 R_X86_64_RELATIVE - 0x3008 -# CHECK-NEXT:     0x3010 R_X86_64_RELATIVE - 0x3009 +# CHECK-NEXT:     0x2000 R_X86_64_RELATIVE - 0x2000 +# CHECK-NEXT:     0x2008 R_X86_64_RELATIVE - 0x2008 +# CHECK-NEXT:     0x2010 R_X86_64_RELATIVE - 0x2009  # CHECK-NEXT:   }  # CHECK-NEXT: ] diff --git a/lld/test/ELF/relative-dynamic-reloc-ppc64.s b/lld/test/ELF/relative-dynamic-reloc-ppc64.s index 1df974b087c..65d0e8e8398 100644 --- a/lld/test/ELF/relative-dynamic-reloc-ppc64.s +++ b/lld/test/ELF/relative-dynamic-reloc-ppc64.s @@ -10,10 +10,10 @@  // CHECK-NEXT:   Section ({{.*}}) .rela.dyn {  // CHECK-NEXT:     0x[[FOO_ADDR:.*]] R_PPC64_RELATIVE - 0x[[FOO_ADDR]]  // CHECK-NEXT:     0x[[BAR_ADDR:.*]] R_PPC64_RELATIVE - 0x[[BAR_ADDR]] -// CHECK-NEXT:     0x20010 R_PPC64_RELATIVE - 0x20009 +// CHECK-NEXT:     0x10010 R_PPC64_RELATIVE - 0x10009  // CHECK-NEXT:     0x{{.*}} R_PPC64_RELATIVE - 0x[[ZED_ADDR:.*]]  // CHECK-NEXT:     0x{{.*}} R_PPC64_RELATIVE - 0x[[FOO_ADDR]] -// CHECK-NEXT:     0x20028 R_PPC64_ADDR64 external 0x0 +// CHECK-NEXT:     0x10028 R_PPC64_ADDR64 external 0x0  // CHECK-NEXT:   }  // CHECK-NEXT: ] diff --git a/lld/test/ELF/relative-dynamic-reloc.s b/lld/test/ELF/relative-dynamic-reloc.s index 947c86d8902..39382124e88 100644 --- a/lld/test/ELF/relative-dynamic-reloc.s +++ b/lld/test/ELF/relative-dynamic-reloc.s @@ -9,10 +9,10 @@  // CHECK-NEXT:   Section ({{.*}}) .rela.dyn {  // CHECK-NEXT:     0x[[FOO_ADDR:.*]] R_X86_64_RELATIVE - 0x[[FOO_ADDR]]  // CHECK-NEXT:     0x[[BAR_ADDR:.*]] R_X86_64_RELATIVE - 0x[[BAR_ADDR]] -// CHECK-NEXT:     0x2010 R_X86_64_RELATIVE - 0x2009 +// CHECK-NEXT:     0x1010 R_X86_64_RELATIVE - 0x1009  // CHECK-NEXT:     0x{{.*}} R_X86_64_RELATIVE - 0x[[ZED_ADDR:.*]]  // CHECK-NEXT:     0x{{.*}} R_X86_64_RELATIVE - 0x[[FOO_ADDR]] -// CHECK-NEXT:     0x2028 R_X86_64_64 external 0x0 +// CHECK-NEXT:     0x1028 R_X86_64_64 external 0x0  // CHECK-NEXT:   }  // CHECK-NEXT: ] diff --git a/lld/test/ELF/relocation-copy-flags.s b/lld/test/ELF/relocation-copy-flags.s index 069866865c2..4d97e3d95d2 100644 --- a/lld/test/ELF/relocation-copy-flags.s +++ b/lld/test/ELF/relocation-copy-flags.s @@ -30,7 +30,7 @@ _start:  // CHECK-NEXT: AddressAlignment: 4  // CHECK-NEXT: EntrySize: 0  // CHECK-NEXT: SectionData ( -// CHECK-NEXT:   0000: 10302000 +// CHECK-NEXT:   0000: 00402000  // CHECK-NEXT: )  // CHECK:      Name: bar @@ -39,8 +39,8 @@ _start:  // CHECK-NEXT:   SHF_ALLOC  // CHECK-NEXT:   SHF_WRITE  // CHECK-NEXT: ] -// CHECK-NEXT: Address: 0x203000 -// CHECK-NEXT: Offset: 0x3000 +// CHECK-NEXT: Address: 0x202000 +// CHECK-NEXT: Offset: 0x2000  // CHECK-NEXT: Size: 8  // CHECK-NEXT: Link: 0  // CHECK-NEXT: Info: 0 @@ -55,7 +55,7 @@ _start:  // CHECK-NEXT: Flags [  // CHECK-NEXT: ]  // CHECK-NEXT: Address: 0x0 -// CHECK-NEXT: Offset: 0x3008 +// CHECK-NEXT: Offset: 0x30B0  // CHECK-NEXT: Size: 8  // CHECK-NEXT: Link: 0  // CHECK-NEXT: Info: 0 @@ -67,7 +67,7 @@ _start:  // CHECK:      Relocations [  // CHECK-NEXT:   Section (4) .rela.dyn { -// CHECK-NEXT:     0x203010 R_X86_64_COPY x 0x0 -// CHECK-NEXT:     0x203000 R_X86_64_64 z 0x0 +// CHECK-NEXT:     0x204000 R_X86_64_COPY x 0x0 +// CHECK-NEXT:     0x202000 R_X86_64_64 z 0x0  // CHECK-NEXT:   }  // CHECK-NEXT: ] diff --git a/lld/test/ELF/relocation-i686.s b/lld/test/ELF/relocation-i686.s index 262f697184b..4bb55d9684b 100644 --- a/lld/test/ELF/relocation-i686.s +++ b/lld/test/ELF/relocation-i686.s @@ -49,13 +49,13 @@ movl bar@GOT, %eax  // ADDR-NEXT: Offset: 0x1040  // ADDR-NEXT: Size: 32 -// ADDR:      Name: .got +// ADDR:      Name: .got (  // ADDR-NEXT: Type: SHT_PROGBITS  // ADDR-NEXT: Flags [  // ADDR-NEXT:   SHF_ALLOC  // ADDR-NEXT:   SHF_WRITE  // ADDR-NEXT: ] -// ADDR-NEXT: Address: 0x12078 +// ADDR-NEXT: Address: 0x13078  // ADDR-NEXT: Offset:  // ADDR-NEXT: Size: 8 @@ -67,7 +67,7 @@ R_386_GOTPC:  // CHECK:      Disassembly of section .R_386_GOTPC:  // CHECK-NEXT: R_386_GOTPC: -// CHECK-NEXT:   11014:  {{.*}} movl  $4204, %eax +// CHECK-NEXT:   11014:  {{.*}} movl  $8300, %eax  .section .dynamic_reloc, "ax",@progbits   call bar diff --git a/lld/test/ELF/relocation-non-alloc.s b/lld/test/ELF/relocation-non-alloc.s index 43f6f5ff1e4..1ad15a4e578 100644 --- a/lld/test/ELF/relocation-non-alloc.s +++ b/lld/test/ELF/relocation-non-alloc.s @@ -10,8 +10,8 @@  // CHECK-NEXT:   SHF_ALLOC  // CHECK-NEXT:   SHF_WRITE  // CHECK-NEXT: ] -// CHECK-NEXT: Address: 0x2000 -// CHECK-NEXT: Offset: 0x2000 +// CHECK-NEXT: Address: 0x1000 +// CHECK-NEXT: Offset: 0x1000  // CHECK-NEXT: Size: 16  // CHECK-NEXT: Link: 0  // CHECK-NEXT: Info: 0 @@ -33,14 +33,14 @@  // CHECK-NEXT: AddressAlignment: 1  // CHECK-NEXT: EntrySize: 0  // CHECK-NEXT: SectionData ( -// CHECK-NEXT:   0000: 00200000 00000000 00200000 00000000 -// CHECK-NEXT:   0010: 00200000 00000000 00200000 00000000 +// CHECK-NEXT:   0000: 00100000 00000000 00100000 00000000 +// CHECK-NEXT:   0010: 00100000 00000000 00100000 00000000  // CHECK-NEXT: )  // CHECK:      Relocations [  // CHECK-NEXT:   Section ({{.}}) .rela.dyn { -// CHECK-NEXT:     0x2000 R_X86_64_RELATIVE - 0x2000 -// CHECK-NEXT:     0x2008 R_X86_64_64 zed 0x0 +// CHECK-NEXT:     0x1000 R_X86_64_RELATIVE - 0x1000 +// CHECK-NEXT:     0x1008 R_X86_64_64 zed 0x0  // CHECK-NEXT:   }  // CHECK-NEXT: ] diff --git a/lld/test/ELF/relocation.s b/lld/test/ELF/relocation.s index 452d1bedba5..77c766960f4 100644 --- a/lld/test/ELF/relocation.s +++ b/lld/test/ELF/relocation.s @@ -16,35 +16,35 @@  // SEC-NEXT: Offset: 0x1030  // SEC-NEXT: Size: 48 -// SEC:         Name: .got +// SEC:        Name: .got.plt  // SEC-NEXT:   Type: SHT_PROGBITS  // SEC-NEXT:   Flags [  // SEC-NEXT:     SHF_ALLOC  // SEC-NEXT:     SHF_WRITE  // SEC-NEXT:   ] -// SEC-NEXT:   Address: 0x2020F0 -// SEC-NEXT:   Offset: -// SEC-NEXT:   Size: 8 +// SEC-NEXT:   Address: 0x202000 +// SEC-NEXT:   Offset: 0x2000 +// SEC-NEXT:   Size: 40  // SEC-NEXT:   Link: 0  // SEC-NEXT:   Info: 0  // SEC-NEXT:   AddressAlignment: 8  // SEC-NEXT:   EntrySize: 0 -// SEC-NEXT: } +// SEC-NEXT:   } -// SEC:        Name: .got.plt +// SEC:         Name: .got  // SEC-NEXT:   Type: SHT_PROGBITS  // SEC-NEXT:   Flags [  // SEC-NEXT:     SHF_ALLOC  // SEC-NEXT:     SHF_WRITE  // SEC-NEXT:   ] -// SEC-NEXT:   Address: 0x203000 -// SEC-NEXT:   Offset: 0x3000 -// SEC-NEXT:   Size: 40 +// SEC-NEXT:   Address: 0x2030F0 +// SEC-NEXT:   Offset: +// SEC-NEXT:   Size: 8  // SEC-NEXT:   Link: 0  // SEC-NEXT:   Info: 0  // SEC-NEXT:   AddressAlignment: 8  // SEC-NEXT:   EntrySize: 0 -// SEC-NEXT:   } +// SEC-NEXT: }  .section       .text,"ax",@progbits,unique,1  .global _start @@ -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 201f0000 +// CHECK-NEXT:   2001d0 202f0000  .section .R_X86_64_GOT32,"a",@progbits  .global R_X86_64_GOT32 diff --git a/lld/test/ELF/section-layout.s b/lld/test/ELF/section-layout.s index 20480919956..f63066e0d92 100644 --- a/lld/test/ELF/section-layout.s +++ b/lld/test/ELF/section-layout.s @@ -34,11 +34,13 @@ _start:  // CHECK: Name: c  // CHECK: Name: d +// Writable sections appear before TLS and other relro sections. +// CHECK: Name: i +  // TLS sections are only sorted on NOBITS.  // CHECK: Name: e  // CHECK: Name: g -// CHECK: Name: i  // CHECK: Name: j  // CHECK: Name: k  // CHECK: Name: l diff --git a/lld/test/ELF/section-name.s b/lld/test/ELF/section-name.s index 06d741b2ea7..4ff97476833 100644 --- a/lld/test/ELF/section-name.s +++ b/lld/test/ELF/section-name.s @@ -45,12 +45,12 @@ _start:  // CHECK:  1 .rodata  00000002  // CHECK:  2 .gcc_except_table 00000001  // CHECK:  3 .text         00000002 -// CHECK:  4 .tdata        00000001 -// CHECK:  5 .tbss         00000001 -// CHECK:  6 .data.rel.ro  00000004 -// CHECK:  7 .data         00000002 -// CHECK:  8 .foo.a        00000001 -// CHECK:  9 .foo          00000001 +// CHECK:  4 .data         00000002 +// CHECK:  5 .foo.a        00000001 +// CHECK:  6 .foo          00000001 +// CHECK:  7 .tdata        00000001 +// CHECK:  8 .tbss         00000001 +// CHECK:  9 .data.rel.ro  00000004  // CHECK: 10 .bss          00000002  // CHECK: 11 .comment      00000008  // CHECK: 12 .symtab       00000060 diff --git a/lld/test/ELF/sort-norosegment.s b/lld/test/ELF/sort-norosegment.s index 3026bb2dbf3..c5a759a08a7 100644 --- a/lld/test/ELF/sort-norosegment.s +++ b/lld/test/ELF/sort-norosegment.s @@ -8,8 +8,8 @@  # CHECK-NEXT: .dynsym  {{.*}}   A  # CHECK-NEXT: .hash    {{.*}}   A  # CHECK-NEXT: .dynstr  {{.*}}   A -# CHECK-NEXT: .dynamic {{.*}}  WA  # CHECK-NEXT: foo      {{.*}}  WA +# CHECK-NEXT: .dynamic {{.*}}  WA  .section foo, "aw"  .byte 0 diff --git a/lld/test/ELF/startstop.s b/lld/test/ELF/startstop.s index 326196dafa6..250fb2cb3f5 100644 --- a/lld/test/ELF/startstop.s +++ b/lld/test/ELF/startstop.s @@ -22,10 +22,10 @@  // SYMBOL:      Relocations [  // SYMBOL-NEXT:   Section ({{.*}}) .rela.dyn { -// SYMBOL-NEXT:     0x3010 R_X86_64_64 __stop_zed1 0x0 -// SYMBOL-NEXT:     0x3018 R_X86_64_64 __stop_zed1 0x1 -// SYMBOL-NEXT:     0x3000 R_X86_64_64 __stop_zed2 0x0 -// SYMBOL-NEXT:     0x3008 R_X86_64_64 __stop_zed2 0x1 +// SYMBOL-NEXT:     0x2010 R_X86_64_64 __stop_zed1 0x0 +// SYMBOL-NEXT:     0x2018 R_X86_64_64 __stop_zed1 0x1 +// SYMBOL-NEXT:     0x2000 R_X86_64_64 __stop_zed2 0x0 +// SYMBOL-NEXT:     0x2008 R_X86_64_64 __stop_zed2 0x1  // SYMBOL-NEXT:   }  // SYMBOL-NEXT: ] @@ -51,13 +51,13 @@  // SYMBOL: Symbol {  // SYMBOL:   Name: __stop_zed1 -// SYMBOL:   Value: 0x3010 +// SYMBOL:   Value: 0x2010  // STMBOL:   Other: 0  // SYMBOL:   Section: zed1  // SYMBOL: }  // SYMBOL: Symbol {  // SYMBOL:   Name: __stop_zed2 -// SYMBOL:   Value: 0x3020 +// SYMBOL:   Value: 0x2020  // STMBOL:   Other: 0  // SYMBOL:   Section: zed2  // SYMBOL: } diff --git a/lld/test/ELF/synthetic-got.s b/lld/test/ELF/synthetic-got.s index c84d27827ae..8d82f3177f8 100644 --- a/lld/test/ELF/synthetic-got.s +++ b/lld/test/ELF/synthetic-got.s @@ -7,13 +7,13 @@  # RUN:   | FileCheck %s --check-prefix=GOTDATA  # GOT:     Sections: -# GOT:      9  .got         00000008 00000000000001b0 DATA -# GOT-NEXT: 10 .got.plt     00000020 00000000000001b8 DATA -# GOTDATA:     Contents of section .got: -# GOTDATA-NEXT:  01b0 00000000 00000000 -# GOTDATA-NEXT: Contents of section .got.plt: -# GOTDATA-NEXT:  01b8 e0000000 00000000 00000000 00000000 -# GOTDATA-NEXT:  01c8 00000000 00000000 d6000000 00000000 +# GOT:      8  .got.plt     00000020 00000000000000e0 DATA +# GOT:      10 .got         00000008 00000000000001d0 DATA +# GOTDATA:     Contents of section .got.plt: +# GOTDATA-NEXT:  00e0 00010000 00000000 00000000 00000000 +# GOTDATA-NEXT:  00f0 00000000 00000000 d6000000 00000000 +# GOTDATA-NEXT: Contents of section .got: +# GOTDATA-NEXT:  01d0 00000000 00000000  # RUN: echo "SECTIONS { .mygot : { *(.got) *(.got.plt) } }" > %t1.script  # RUN: ld.lld -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:      9  .mygot     00000028 00000000000001b0 DATA +# MYGOT:      8  .mygot     00000028 00000000000000e0 DATA  # MYGOT-NOT:  .got  # MYGOT-NOT:  .got.plt -# MYGOTDATA:      01b0 00000000 00000000 e0000000 00000000 -# MYGOTDATA-NEXT: 01c0 00000000 00000000 00000000 00000000 -# MYGOTDATA-NEXT: 01d0 d6000000 00000000 +# MYGOTDATA:      00e0 00000000 00000000 08010000 00000000 +# MYGOTDATA-NEXT: 00f0 00000000 00000000 00000000 00000000 +# MYGOTDATA-NEXT: 0100 d6000000 00000000  mov bar@gotpcrel(%rip), %rax  call foo@plt diff --git a/lld/test/ELF/tls-dynamic-i686.s b/lld/test/ELF/tls-dynamic-i686.s index 4db6278ca21..6732483e9e1 100644 --- a/lld/test/ELF/tls-dynamic-i686.s +++ b/lld/test/ELF/tls-dynamic-i686.s @@ -50,15 +50,14 @@ addl tls0@gotntpoff(%ebx),%eax  movl %gs:0,%eax  addl tls1@gotntpoff(%ebx),%eax -// CHECK:      Index: 10 -// CHECK-NEXT: Name: .got +// CHECK:      Name: .got (  // CHECK-NEXT: Type: SHT_PROGBITS  // CHECK-NEXT: Flags [  // CHECK-NEXT:   SHF_ALLOC  // CHECK-NEXT:   SHF_WRITE  // CHECK-NEXT: ] -// CHECK-NEXT: Address: 0x2068 -// CHECK-NEXT: Offset: 0x2068 +// CHECK-NEXT: Address: 0x3068 +// CHECK-NEXT: Offset: 0x3068  // CHECK-NEXT: Size: 32  // CHECK-NEXT: Link: 0  // CHECK-NEXT: Info: 0 @@ -67,13 +66,13 @@ addl tls1@gotntpoff(%ebx),%eax  // CHECK: Relocations [  // CHECK:      Section ({{.+}}) .rel.dyn { -// CHECK-NEXT: 0x2078 R_386_TLS_DTPMOD32 - 0x0 -// CHECK-NEXT: 0x2068 R_386_TLS_DTPMOD32 tls0 0x0 -// CHECK-NEXT: 0x206C R_386_TLS_DTPOFF32 tls0 0x0 -// CHECK-NEXT: 0x2080 R_386_TLS_TPOFF tls0 0x0 -// CHECK-NEXT: 0x2070 R_386_TLS_DTPMOD32 tls1 0x0 -// CHECK-NEXT: 0x2074 R_386_TLS_DTPOFF32 tls1 0x0 -// CHECK-NEXT: 0x2084 R_386_TLS_TPOFF tls1 0x0 +// CHECK-NEXT: 0x3078 R_386_TLS_DTPMOD32 - 0x0 +// CHECK-NEXT: 0x3068 R_386_TLS_DTPMOD32 tls0 0x0 +// CHECK-NEXT: 0x306C R_386_TLS_DTPOFF32 tls0 0x0 +// CHECK-NEXT: 0x3080 R_386_TLS_TPOFF tls0 0x0 +// CHECK-NEXT: 0x3070 R_386_TLS_DTPMOD32 tls1 0x0 +// CHECK-NEXT: 0x3074 R_386_TLS_DTPOFF32 tls1 0x0 +// CHECK-NEXT: 0x3084 R_386_TLS_TPOFF tls1 0x0  // CHECK-NEXT: }  // DIS:      Disassembly of section .text: diff --git a/lld/test/ELF/tls-dynamic.s b/lld/test/ELF/tls-dynamic.s index b627977e3c6..05473d4b5b1 100644 --- a/lld/test/ELF/tls-dynamic.s +++ b/lld/test/ELF/tls-dynamic.s @@ -42,22 +42,22 @@ c:  // Get the address of the got, and check that it has 4 entries.  // CHECK:      Sections [ -// CHECK:          Name: .got +// CHECK:          Name: .got (  // CHECK-NEXT:     Type: SHT_PROGBITS  // CHECK-NEXT:     Flags [  // CHECK-NEXT:       SHF_ALLOC  // CHECK-NEXT:       SHF_WRITE  // CHECK-NEXT:     ] -// CHECK-NEXT:     Address: 0x20D0 +// CHECK-NEXT:     Address: 0x30D0  // CHECK-NEXT:     Offset:  // CHECK-NEXT:     Size: 40  // CHECK:      Relocations [  // CHECK:        Section ({{.+}}) .rela.dyn { -// CHECK-NEXT:     0x20D0 R_X86_64_DTPMOD64 - 0x0 -// CHECK-NEXT:     0x20E0 R_X86_64_DTPMOD64 c 0x0 -// CHECK-NEXT:     0x20E8 R_X86_64_DTPOFF64 c 0x0 -// CHECK-NEXT:     0x20F0 R_X86_64_TPOFF64 c 0x0 +// CHECK-NEXT:     0x30D0 R_X86_64_DTPMOD64 - 0x0 +// CHECK-NEXT:     0x30E0 R_X86_64_DTPMOD64 c 0x0 +// CHECK-NEXT:     0x30E8 R_X86_64_DTPOFF64 c 0x0 +// CHECK-NEXT:     0x30F0 R_X86_64_TPOFF64 c 0x0  // CHECK-NEXT:   }  // 4297 = (0x20D0 + -4) - (0x1000 + 3) // PC relative offset to got entry. @@ -67,9 +67,9 @@ c:  // DIS:      Disassembly of section .text:  // DIS-NEXT: .text: -// DIS-NEXT:     1000: {{.+}} leaq    4297(%rip), %rdi +// DIS-NEXT:     1000: {{.+}} leaq    8393(%rip), %rdi  // DIS-NEXT:     1007: {{.+}} callq -// DIS-NEXT:     100c: {{.+}} leaq    4285(%rip), %rdi +// DIS-NEXT:     100c: {{.+}} leaq    8381(%rip), %rdi  // DIS-NEXT:     1013: {{.+}} callq  // DIS-NEXT:     1018: {{.+}} leaq    (%rax), %rcx  // DIS-NEXT:     101f: {{.+}} leaq    4(%rax), %rcx @@ -77,10 +77,10 @@ c:  // DIS-NEXT:     1028: 00 00  // DIS-NEXT:     102a: 00 00  // DIS-NEXT:     102c: 00 00 -// DIS-NEXT:     102e: {{.+}} leaq    4267(%rip), %rdi +// DIS-NEXT:     102e: {{.+}} leaq    8363(%rip), %rdi  // DIS-NEXT:     1035: {{.+}} callq  // DIS-NEXT:     103b: {{.+}} leaq    (%rax), %rcx -// DIS-NEXT:     1042: {{.+}} movq    4263(%rip), %rax +// DIS-NEXT:     1042: {{.+}} movq    8359(%rip), %rax  // DIS-NEXT:     1049: {{.+}} movq    %fs:(%rax), %rax  // DIS-NEXT:     104d: {{.+}} movabsq $0, %rax  // DIS-NEXT:     1057: {{.+}} movabsq $4, %rax diff --git a/lld/test/ELF/tls-offset.s b/lld/test/ELF/tls-offset.s index 1734f7fb9e9..ad921af8eff 100644 --- a/lld/test/ELF/tls-offset.s +++ b/lld/test/ELF/tls-offset.s @@ -15,7 +15,7 @@ _start:          .align  16          .zero 16 -        .data +        .section        .data.rel.ro,"aw",@progbits          .long 1 @@ -45,7 +45,7 @@ _start:  // CHECK-NEXT: Offset: 0x2004  // CHECK-NEXT: Size: 16 -// CHECK:      Name: .data +// CHECK:      Name: .data.rel.ro  // CHECK-NEXT: Type: SHT_PROGBITS  // CHECK-NEXT: Flags [  // CHECK-NEXT:   SHF_ALLOC diff --git a/lld/test/ELF/undef-with-plt-addr.s b/lld/test/ELF/undef-with-plt-addr.s index e30cd90d380..2e2fc20be3f 100644 --- a/lld/test/ELF/undef-with-plt-addr.s +++ b/lld/test/ELF/undef-with-plt-addr.s @@ -22,10 +22,10 @@ movabsq	$set_data, %rax  // CHECK-NEXT: Address: 0x201010  // CHECK:      Section ({{.*}}) .rela.dyn { -// CHECK-NEXT:   0x203000 R_X86_64_64 foo 0x0 +// CHECK-NEXT:   0x202000 R_X86_64_64 foo 0x0  // CHECK-NEXT: }  // CHECK-NEXT: Section ({{.*}}) .rela.plt { -// CHECK-NEXT:   0x203020 R_X86_64_JUMP_SLOT set_data 0x0 +// CHECK-NEXT:   0x202020 R_X86_64_JUMP_SLOT set_data 0x0  // CHECK-NEXT: }  // CHECK:      Name: foo diff --git a/lld/test/ELF/undefined-versioned-symbol.s b/lld/test/ELF/undefined-versioned-symbol.s index 4e0957f2550..afa0ab9919e 100644 --- a/lld/test/ELF/undefined-versioned-symbol.s +++ b/lld/test/ELF/undefined-versioned-symbol.s @@ -15,19 +15,19 @@  // CHECK:      Section ({{.*}}) .rela.dyn {  // CHECK-NEXT:   Relocation { -// CHECK-NEXT:     Offset: 0x2000 +// CHECK-NEXT:     Offset: 0x1000  // CHECK-NEXT:     Type: R_X86_64_64 (1)  // CHECK-NEXT:     Symbol: basename (1)  // CHECK-NEXT:     Addend: 0x0  // CHECK-NEXT:   }  // CHECK-NEXT:   Relocation { -// CHECK-NEXT:     Offset: 0x2008 +// CHECK-NEXT:     Offset: 0x1008  // CHECK-NEXT:     Type: R_X86_64_64 (1)  // CHECK-NEXT:     Symbol: basename (2)  // CHECK-NEXT:     Addend: 0x0  // CHECK-NEXT:   }  // CHECK-NEXT:   Relocation { -// CHECK-NEXT:     Offset: 0x2010 +// CHECK-NEXT:     Offset: 0x1010  // CHECK-NEXT:     Type: R_X86_64_64 (1)  // CHECK-NEXT:     Symbol: basename (3)  // CHECK-NEXT:     Addend: 0x0 diff --git a/lld/test/ELF/x86-64-tls-gd-local.s b/lld/test/ELF/x86-64-tls-gd-local.s index 843b891be56..ec6115dc2f7 100644 --- a/lld/test/ELF/x86-64-tls-gd-local.s +++ b/lld/test/ELF/x86-64-tls-gd-local.s @@ -28,14 +28,14 @@ bar:          .zero   4 -// CHECK:      Name: .got +// CHECK:      Name: .got (  // CHECK-NEXT: Type: SHT_PROGBITS  // CHECK-NEXT: Flags [  // CHECK-NEXT:   SHF_ALLOC (0x2)  // CHECK-NEXT:   SHF_WRITE (0x1)  // CHECK-NEXT: ] -// CHECK-NEXT: Address: 0x20D0 -// CHECK-NEXT: Offset: 0x20D0 +// CHECK-NEXT: Address: 0x30D0 +// CHECK-NEXT: Offset: 0x30D0  // CHECK-NEXT: Size: 32  // CHECK-NEXT: Link: 0  // CHECK-NEXT: Info: 0 @@ -47,6 +47,6 @@ bar:  // CHECK-NEXT: )  // CHECK:      Section ({{.*}}) .rela.dyn { -// CHECK-NEXT:   0x20D0 R_X86_64_DTPMOD64 - 0x0 -// CHECK-NEXT:   0x20E0 R_X86_64_DTPMOD64 - 0x0 +// CHECK-NEXT:   0x30D0 R_X86_64_DTPMOD64 - 0x0 +// CHECK-NEXT:   0x30E0 R_X86_64_DTPMOD64 - 0x0  // CHECK-NEXT: }  | 

