authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2018-08-25 22:10:32-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2018-08-25 22:10:32-04:00
log95dbba046d84b3e95c63f97d8e6a819b3e1b4cd5
tree8ac7dfecb977ce70ec9ebb3b02392f88a74f6833
parent7109035b78ee05302bbdaadc52013b430a030b69

update LLD fork to 7.0.0rc2


22 files changed, 371 insertions(+), 31 deletions(-)

deps/lld/COFF/Driver.cpp+3-3
......@@ -1551,11 +1551,11 @@ void LinkerDriver::link(ArrayRef<const char *> ArgsArr) {
15511551 continue;
15521552 }
15531553
1554 // If the symbol isn't common, it must have been replaced with a regular
1555 // symbol, which will carry its own alignment.
15541556 auto *DC = dyn_cast<DefinedCommon>(Sym);
1555 if (!DC) {
1556 warn("/aligncomm symbol " + Name + " of wrong kind");
1557 if (!DC)
15571558 continue;
1558 }
15591559
15601560 CommonChunk *C = DC->getChunk();
15611561 C->Alignment = std::max(C->Alignment, Alignment);
deps/lld/COFF/InputFiles.cpp+49-5
......@@ -205,7 +205,13 @@ SectionChunk *ObjFile::readSection(uint32_t SectionNumber,
205205
206206void ObjFile::readAssociativeDefinition(
207207 COFFSymbolRef Sym, const coff_aux_section_definition *Def) {
208 SectionChunk *Parent = SparseChunks[Def->getNumber(Sym.isBigObj())];
208 readAssociativeDefinition(Sym, Def, Def->getNumber(Sym.isBigObj()));
209}
210
211void ObjFile::readAssociativeDefinition(COFFSymbolRef Sym,
212 const coff_aux_section_definition *Def,
213 uint32_t ParentSection) {
214 SectionChunk *Parent = SparseChunks[ParentSection];
209215
210216 // If the parent is pending, it probably means that its section definition
211217 // appears after us in the symbol table. Leave the associated section as
......@@ -225,6 +231,35 @@ void ObjFile::readAssociativeDefinition(
225231 }
226232}
227233
234void ObjFile::recordPrevailingSymbolForMingw(
235 COFFSymbolRef Sym, DenseMap<StringRef, uint32_t> &PrevailingSectionMap) {
236 // For comdat symbols in executable sections, where this is the copy
237 // of the section chunk we actually include instead of discarding it,
238 // add the symbol to a map to allow using it for implicitly
239 // associating .[px]data$<func> sections to it.
240 int32_t SectionNumber = Sym.getSectionNumber();
241 SectionChunk *SC = SparseChunks[SectionNumber];
242 if (SC && SC->getOutputCharacteristics() & IMAGE_SCN_MEM_EXECUTE) {
243 StringRef Name;
244 COFFObj->getSymbolName(Sym, Name);
245 PrevailingSectionMap[Name] = SectionNumber;
246 }
247}
248
249void ObjFile::maybeAssociateSEHForMingw(
250 COFFSymbolRef Sym, const coff_aux_section_definition *Def,
251 const DenseMap<StringRef, uint32_t> &PrevailingSectionMap) {
252 StringRef Name;
253 COFFObj->getSymbolName(Sym, Name);
254 if (Name.consume_front(".pdata$") || Name.consume_front(".xdata$")) {
255 // For MinGW, treat .[px]data$<func> as implicitly associative to
256 // the symbol <func>.
257 auto ParentSym = PrevailingSectionMap.find(Name);
258 if (ParentSym != PrevailingSectionMap.end())
259 readAssociativeDefinition(Sym, Def, ParentSym->second);
260 }
261}
262
228263Symbol *ObjFile::createRegular(COFFSymbolRef Sym) {
229264 SectionChunk *SC = SparseChunks[Sym.getSectionNumber()];
230265 if (Sym.isExternal()) {
......@@ -248,19 +283,24 @@ void ObjFile::initializeSymbols() {
248283 std::vector<uint32_t> PendingIndexes;
249284 PendingIndexes.reserve(NumSymbols);
250285
286 DenseMap<StringRef, uint32_t> PrevailingSectionMap;
251287 std::vector<const coff_aux_section_definition *> ComdatDefs(
252288 COFFObj->getNumberOfSections() + 1);
253289
254290 for (uint32_t I = 0; I < NumSymbols; ++I) {
255291 COFFSymbolRef COFFSym = check(COFFObj->getSymbol(I));
292 bool PrevailingComdat;
256293 if (COFFSym.isUndefined()) {
257294 Symbols[I] = createUndefined(COFFSym);
258295 } else if (COFFSym.isWeakExternal()) {
259296 Symbols[I] = createUndefined(COFFSym);
260297 uint32_t TagIndex = COFFSym.getAux<coff_aux_weak_external>()->TagIndex;
261298 WeakAliases.emplace_back(Symbols[I], TagIndex);
262 } else if (Optional<Symbol *> OptSym = createDefined(COFFSym, ComdatDefs)) {
299 } else if (Optional<Symbol *> OptSym =
300 createDefined(COFFSym, ComdatDefs, PrevailingComdat)) {
263301 Symbols[I] = *OptSym;
302 if (Config->MinGW && PrevailingComdat)
303 recordPrevailingSymbolForMingw(COFFSym, PrevailingSectionMap);
264304 } else {
265305 // createDefined() returns None if a symbol belongs to a section that
266306 // was pending at the point when the symbol was read. This can happen in
......@@ -278,9 +318,12 @@ void ObjFile::initializeSymbols() {
278318
279319 for (uint32_t I : PendingIndexes) {
280320 COFFSymbolRef Sym = check(COFFObj->getSymbol(I));
281 if (auto *Def = Sym.getSectionDefinition())
321 if (auto *Def = Sym.getSectionDefinition()) {
282322 if (Def->Selection == IMAGE_COMDAT_SELECT_ASSOCIATIVE)
283323 readAssociativeDefinition(Sym, Def);
324 else if (Config->MinGW)
325 maybeAssociateSEHForMingw(Sym, Def, PrevailingSectionMap);
326 }
284327 if (SparseChunks[Sym.getSectionNumber()] == PendingComdat) {
285328 StringRef Name;
286329 COFFObj->getSymbolName(Sym, Name);
......@@ -306,7 +349,9 @@ Symbol *ObjFile::createUndefined(COFFSymbolRef Sym) {
306349
307350Optional<Symbol *> ObjFile::createDefined(
308351 COFFSymbolRef Sym,
309 std::vector<const coff_aux_section_definition *> &ComdatDefs) {
352 std::vector<const coff_aux_section_definition *> &ComdatDefs,
353 bool &Prevailing) {
354 Prevailing = false;
310355 auto GetName = [&]() {
311356 StringRef S;
312357 COFFObj->getSymbolName(Sym, S);
......@@ -352,7 +397,6 @@ Optional<Symbol *> ObjFile::createDefined(
352397 if (const coff_aux_section_definition *Def = ComdatDefs[SectionNumber]) {
353398 ComdatDefs[SectionNumber] = nullptr;
354399 Symbol *Leader;
355 bool Prevailing;
356400 if (Sym.isExternal()) {
357401 std::tie(Leader, Prevailing) =
358402 Symtab->addComdat(this, GetName(), Sym.getGeneric());
deps/lld/COFF/InputFiles.h+16-1
......@@ -13,6 +13,7 @@
1313#include "Config.h"
1414#include "lld/Common/LLVM.h"
1515#include "llvm/ADT/ArrayRef.h"
16#include "llvm/ADT/DenseMap.h"
1617#include "llvm/ADT/DenseSet.h"
1718#include "llvm/LTO/LTO.h"
1819#include "llvm/Object/Archive.h"
......@@ -157,10 +158,24 @@ private:
157158 COFFSymbolRef COFFSym,
158159 const llvm::object::coff_aux_section_definition *Def);
159160
161 void readAssociativeDefinition(
162 COFFSymbolRef COFFSym,
163 const llvm::object::coff_aux_section_definition *Def,
164 uint32_t ParentSection);
165
166 void recordPrevailingSymbolForMingw(
167 COFFSymbolRef COFFSym,
168 llvm::DenseMap<StringRef, uint32_t> &PrevailingSectionMap);
169
170 void maybeAssociateSEHForMingw(
171 COFFSymbolRef Sym, const llvm::object::coff_aux_section_definition *Def,
172 const llvm::DenseMap<StringRef, uint32_t> &PrevailingSectionMap);
173
160174 llvm::Optional<Symbol *>
161175 createDefined(COFFSymbolRef Sym,
162176 std::vector<const llvm::object::coff_aux_section_definition *>
163 &ComdatDefs);
177 &ComdatDefs,
178 bool &PrevailingComdat);
164179 Symbol *createRegular(COFFSymbolRef Sym);
165180 Symbol *createUndefined(COFFSymbolRef Sym);
166181
deps/lld/ELF/LinkerScript.cpp+13-9
......@@ -116,7 +116,8 @@ void LinkerScript::expandMemoryRegions(uint64_t Size) {
116116 if (Ctx->MemRegion)
117117 expandMemoryRegion(Ctx->MemRegion, Size, Ctx->MemRegion->Name,
118118 Ctx->OutSec->Name);
119 if (Ctx->LMARegion)
119 // Only expand the LMARegion if it is different from MemRegion.
120 if (Ctx->LMARegion && Ctx->MemRegion != Ctx->LMARegion)
120121 expandMemoryRegion(Ctx->LMARegion, Size, Ctx->LMARegion->Name,
121122 Ctx->OutSec->Name);
122123}
......@@ -750,6 +751,13 @@ MemoryRegion *LinkerScript::findMemoryRegion(OutputSection *Sec) {
750751 return nullptr;
751752}
752753
754static OutputSection *findFirstSection(PhdrEntry *Load) {
755 for (OutputSection *Sec : OutputSections)
756 if (Sec->PtLoad == Load)
757 return Sec;
758 return nullptr;
759}
760
753761// This function assigns offsets to input sections and an output section
754762// for a single sections command (e.g. ".text { *(.text); }").
755763void LinkerScript::assignOffsets(OutputSection *Sec) {
......@@ -775,8 +783,11 @@ void LinkerScript::assignOffsets(OutputSection *Sec) {
775783 // will set the LMA such that the difference between VMA and LMA for the
776784 // section is the same as the preceding output section in the same region
777785 // https://sourceware.org/binutils/docs-2.20/ld/Output-Section-LMA.html
786 // This, however, should only be done by the first "non-header" section
787 // in the segment.
778788 if (PhdrEntry *L = Ctx->OutSec->PtLoad)
779 L->LMAOffset = Ctx->LMAOffset;
789 if (Sec == findFirstSection(L))
790 L->LMAOffset = Ctx->LMAOffset;
780791
781792 // We can call this method multiple times during the creation of
782793 // thunks and want to start over calculation each time.
......@@ -953,13 +964,6 @@ void LinkerScript::adjustSectionsAfterSorting() {
953964 }
954965}
955966
956static OutputSection *findFirstSection(PhdrEntry *Load) {
957 for (OutputSection *Sec : OutputSections)
958 if (Sec->PtLoad == Load)
959 return Sec;
960 return nullptr;
961}
962
963967static uint64_t computeBase(uint64_t Min, bool AllocateHeaders) {
964968 // If there is no SECTIONS or if the linkerscript is explicit about program
965969 // headers, do our best to allocate them.
deps/lld/ELF/SyntheticSections.cpp+3-1
......@@ -2929,8 +2929,10 @@ void elf::mergeSections() {
29292929
29302930 // We do not want to handle sections that are not alive, so just remove
29312931 // them instead of trying to merge.
2932 if (!MS->Live)
2932 if (!MS->Live) {
2933 S = nullptr;
29332934 continue;
2935 }
29342936
29352937 StringRef OutsecName = getOutputSectionName(MS);
29362938 uint32_t Alignment = std::max<uint32_t>(MS->Alignment, MS->Entsize);
deps/lld/ELF/Writer.cpp+7-5
......@@ -1815,12 +1815,14 @@ template <class ELFT> std::vector<PhdrEntry *> Writer<ELFT>::createPhdrs() {
18151815 // Segments are contiguous memory regions that has the same attributes
18161816 // (e.g. executable or writable). There is one phdr for each segment.
18171817 // Therefore, we need to create a new phdr when the next section has
1818 // different flags or is loaded at a discontiguous address using AT linker
1819 // script command. At the same time, we don't want to create a separate
1820 // load segment for the headers, even if the first output section has
1821 // an AT attribute.
1818 // different flags or is loaded at a discontiguous address or memory
1819 // region using AT or AT> linker script command, respectively. At the same
1820 // time, we don't want to create a separate load segment for the headers,
1821 // even if the first output section has an AT or AT> attribute.
18221822 uint64_t NewFlags = computeFlags(Sec->getPhdrFlags());
1823 if ((Sec->LMAExpr && Load->LastSec != Out::ProgramHeaders) ||
1823 if (((Sec->LMAExpr ||
1824 (Sec->LMARegion && (Sec->LMARegion != Load->FirstSec->LMARegion))) &&
1825 Load->LastSec != Out::ProgramHeaders) ||
18241826 Sec->MemRegion != Load->FirstSec->MemRegion || Flags != NewFlags) {
18251827
18261828 Load = AddHdr(PT_LOAD, NewFlags);
deps/lld/docs/ReleaseNotes.rst+7-1
......@@ -29,7 +29,13 @@ ELF Improvements
2929COFF Improvements
3030-----------------
3131
32* Item 1.
32* Improved correctness of exporting mangled stdcall symbols.
33
34* Completed support for ARM64 relocations.
35
36* Added support for outputting PDB debug info for MinGW targets.
37
38* Improved compatibility of output binaries with GNU binutils objcopy/strip.
3339
3440MachO Improvements
3541------------------
deps/lld/lib/ReaderWriter/MachO/ArchHandler_x86_64.cpp+1
......@@ -621,6 +621,7 @@ void ArchHandler_x86_64::applyFixupFinal(
621621 // Fall into llvm_unreachable().
622622 break;
623623 }
624 llvm_unreachable("invalid x86_64 Reference Kind");
624625}
625626
626627void ArchHandler_x86_64::applyFixupRelocatable(const Reference &ref,
deps/lld/test/COFF/Inputs/associative-comdat-mingw-2.s created+34
......@@ -0,0 +1,34 @@
1 .section .xdata$foo,"dr"
2 .linkonce discard
3 .p2align 3
4 .long 42
5
6 .section .xdata$bar,"dr"
7 .linkonce discard
8 .p2align 3
9 .long 43
10
11 .section .xdata$baz,"dr"
12 .linkonce discard
13 .p2align 3
14 .long 44
15
16 .def foo;
17 .scl 2;
18 .type 32;
19 .endef
20 .section .text$foo,"xr",discard,foo
21 .globl foo
22 .p2align 4
23foo:
24 ret
25
26 .def bar;
27 .scl 2;
28 .type 32;
29 .endef
30 .section .text$bar,"xr",discard,bar
31 .globl bar
32 .p2align 4
33bar:
34 ret
deps/lld/test/COFF/Inputs/common-replacement.s created+5
......@@ -0,0 +1,5 @@
1 .globl foo
2 .data
3 .p2align 2, 0
4foo:
5 .long 42
deps/lld/test/COFF/associative-comdat-mingw.s created+73
......@@ -0,0 +1,73 @@
1# REQUIRES: x86
2
3# RUN: llvm-mc -triple=x86_64-windows-gnu %s -filetype=obj -o %t1.obj
4# RUN: llvm-mc -triple=x86_64-windows-gnu %S/Inputs/associative-comdat-mingw-2.s -filetype=obj -o %t2.obj
5
6# RUN: lld-link -lldmingw -entry:main %t1.obj %t2.obj -out:%t.gc.exe -verbose
7# RUN: llvm-readobj -sections %t.gc.exe | FileCheck %s
8
9# CHECK: Sections [
10# CHECK: Section {
11# CHECK: Number: 2
12# CHECK-LABEL: Name: .rdata (2E 72 64 61 74 61 00 00)
13# This is the critical check to show that only *one* definition of
14# .xdata$foo was retained. This *must* be 4.
15# Make sure that no other .xdata sections get included, which would
16# increase the size here.
17# CHECK-NEXT: VirtualSize: 0x4
18
19 .text
20 .def main;
21 .scl 2;
22 .type 32;
23 .endef
24 .globl main
25 .p2align 4, 0x90
26main:
27 call foo
28 retq
29
30# Defines .text$foo (which has a leader symbol and is referenced like
31# normally), and .xdata$foo (which lacks a leader symbol, which normally
32# would be declared associative to the symbol foo).
33# .xdata$foo should be implicitly treated as associative to foo and brought
34# in, while .xdata$bar, implicitly associative to bar, not included, and
35# .xdata$baz not included since there's no symbol baz.
36
37# GNU binutils ld doesn't do this at all, but always includes all .xdata/.pdata
38# comdat sections, even if --gc-sections is used.
39
40 .section .xdata$foo,"dr"
41 .linkonce discard
42 .p2align 3
43 .long 42
44
45 .section .xdata$bar,"dr"
46 .linkonce discard
47 .p2align 3
48 .long 43
49
50 .section .xdata$baz,"dr"
51 .linkonce discard
52 .p2align 3
53 .long 44
54
55 .def foo;
56 .scl 2;
57 .type 32;
58 .endef
59 .section .text$foo,"xr",discard,foo
60 .globl foo
61 .p2align 4
62foo:
63 ret
64
65 .def bar;
66 .scl 2;
67 .type 32;
68 .endef
69 .section .text$bar,"xr",discard,bar
70 .globl bar
71 .p2align 4
72bar:
73 ret
deps/lld/test/COFF/common-replacement.s created+35
......@@ -0,0 +1,35 @@
1# REQUIRES: x86
2
3# RUN: llvm-mc -triple=x86_64-windows-gnu %s -filetype=obj -o %t1.obj
4# RUN: llvm-mc -triple=x86_64-windows-gnu %S/Inputs/common-replacement.s -filetype=obj -o %t2.obj
5
6# RUN: lld-link -lldmingw -entry:main %t1.obj %t2.obj -out:%t.exe -verbose 2>&1 \
7# RUN: | FileCheck -check-prefix VERBOSE %s
8# RUN: llvm-readobj -s %t.exe | FileCheck -check-prefix SECTIONS %s
9
10# VERBOSE: -aligncomm:"foo",2
11
12# As long as the .comm symbol is replaced with actual data, RawDataSize
13# below should be nonzero.
14
15# SECTIONS: Name: .data (2E 64 61 74 61 00 00 00)
16# SECTIONS-NEXT: VirtualSize: 0x8
17# SECTIONS-NEXT: VirtualAddress: 0x2000
18# SECTIONS-NEXT: RawDataSize: 512
19
20
21 .text
22 .def main;
23 .scl 2;
24 .type 32;
25 .endef
26 .globl main
27 .p2align 4, 0x90
28main:
29 movl foo(%rip), %eax
30 retq
31
32# This produces an aligncomm directive, but when linking in
33# Inputs/common-replacement.s, this symbol is replaced by a normal defined
34# symbol instead.
35 .comm foo, 4, 2
deps/lld/test/ELF/linkerscript/Inputs/at6.s created+11
......@@ -0,0 +1,11 @@
1.global _start
2.text
3_start:
4nop
5
6.section .sec1,"aw",@progbits
7.long 1
8
9.section .sec2,"aw",@progbits
10.long 2
11
deps/lld/test/ELF/linkerscript/Inputs/at7.s created+7
......@@ -0,0 +1,7 @@
1.global _start
2.text
3_start:
4nop
5
6.section .sec, "aw"
7.word 4
deps/lld/test/ELF/linkerscript/Inputs/at8.s created+8
......@@ -0,0 +1,8 @@
1.section .sec1,"aw",@progbits
2.quad 1
3
4.section .sec2,"aw",@progbits
5.quad 2
6
7.section .sec3,"aw",@progbits
8.quad 3
deps/lld/test/ELF/linkerscript/at6.test created+30
......@@ -0,0 +1,30 @@
1# REQUIRES: x86
2# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %p/Inputs/at6.s -o %t.o
3# RUN: ld.lld %t.o --script %s -o %t
4# RUN: llvm-readelf -sections -program-headers %t | FileCheck %s
5
6MEMORY {
7 FLASH : ORIGIN = 0x08000000, LENGTH = 0x100
8 RAM : ORIGIN = 0x20000000, LENGTH = 0x200
9}
10
11SECTIONS {
12 .text : { *(.text) } > FLASH
13 .sec1 : { *(.sec1) } > RAM
14 .sec2 : { *(.sec2) } > RAM AT > FLASH
15}
16
17# Make sure we create a separate PT_LOAD entry for .sec2. Previously,
18# it was added to the PT_LOAD entry of .sec1
19
20# CHECK: Name Type Address Off
21# CHECK: .text PROGBITS 0000000008000000 001000
22# CHECK: .sec1 PROGBITS 0000000020000000 002000
23# CHECK: .sec2 PROGBITS 0000000020000004 002004
24
25# CHECK: Program Headers:
26# CHECK: Type Offset VirtAddr PhysAddr
27# CHECK-NEXT: LOAD 0x001000 0x0000000008000000 0x0000000008000000
28# CHECK-NEXT: LOAD 0x002000 0x0000000020000000 0x0000000020000000
29# CHECK-NEXT: LOAD 0x002004 0x0000000020000004 0x0000000008000001
30# CHECK-NOT: LOAD
deps/lld/test/ELF/linkerscript/at7.test created+28
......@@ -0,0 +1,28 @@
1# REQUIRES: x86
2# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %p/Inputs/at7.s -o %t.o
3# RUN: ld.lld %t.o --script %s -o %t
4# RUN: llvm-readelf -sections -program-headers %t | FileCheck %s
5
6MEMORY {
7 RAM : ORIGIN = 0x20000000, LENGTH = 0x200
8}
9
10SECTIONS {
11 .text : { *(.text) } > RAM AT> RAM
12 .sec : { *(.sec) } > RAM
13}
14
15# Make sure the memory for the .text section is only reserved once.
16# Previously, the location counter for both MemRegion and LMARegion
17# was increased unconditionally.
18
19
20# CHECK: Name Type Address Off
21# CHECK: .text PROGBITS 0000000020000000 001000
22# CHECK: .sec PROGBITS 0000000020000001 001001
23
24# CHECK: Program Headers:
25# CHECK: Type Offset VirtAddr PhysAddr
26# CHECK-NEXT: LOAD 0x001000 0x0000000020000000 0x0000000020000000
27# CHECK-NEXT: LOAD 0x001001 0x0000000020000001 0x0000000020000001
28# CHECK-NOT: LOAD
deps/lld/test/ELF/linkerscript/at8.test created+31
......@@ -0,0 +1,31 @@
1# REQUIRES: x86
2# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %p/Inputs/at8.s -o %t.o
3# RUN: ld.lld %t.o --script %s -o %t
4# RUN: llvm-readelf -sections -program-headers %t | FileCheck %s
5
6MEMORY {
7 FLASH : ORIGIN = 0x08000000, LENGTH = 0x100
8 RAM : ORIGIN = 0x20000000, LENGTH = 0x200
9}
10
11SECTIONS {
12 .text : { *(.text) } > FLASH
13 .sec1 : { *(.sec1) } > RAM AT > FLASH
14 .sec2 : { *(.sec2) } > RAM
15 .sec3 : { *(.sec3) } > RAM AT > FLASH
16}
17
18# Make sure we do not issue a load-address overlap error
19# Previously, .sec3 would overwrite the LMAOffset in the
20# PT_LOAD header.
21
22# CHECK: Name Type Address Off
23# CHECK: .text PROGBITS 0000000008000000 001000
24# CHECK: .sec1 PROGBITS 0000000020000000 001000
25# CHECK: .sec2 PROGBITS 0000000020000008 001008
26# CHECK: .sec3 PROGBITS 0000000020000010 001010
27
28# CHECK: Program Headers:
29# CHECK: Type Offset VirtAddr PhysAddr
30# CHECK-NEXT: LOAD 0x001000 0x0000000020000000 0x0000000008000000
31# CHECK-NOT: LOAD
deps/lld/test/ELF/lto/cache.ll+1-1
......@@ -13,7 +13,7 @@
1313; RUN: ls %t.cache | count 4
1414
1515; Create a file of size 64KB.
16; RUN: "%python" -c "print(' ' * 65536)" > %t.cache/llvmcache-foo
16; RUN: %python -c "print(' ' * 65536)" > %t.cache/llvmcache-foo
1717
1818; This should leave the file in place.
1919; RUN: ld.lld --thinlto-cache-dir=%t.cache --thinlto-cache-policy cache_size_bytes=128k:prune_interval=0s -o %t3 %t2.o %t.o
deps/lld/test/ELF/x86-64-reloc-error2.s+7-3
......@@ -1,14 +1,18 @@
11# REQUIRES: x86
22# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
3# RUN: not ld.lld %t.o -o /dev/null 2>&1 | FileCheck %s
3# RUN: not ld.lld --entry=func --gc-sections %t.o -o /dev/null 2>&1 | FileCheck %s
44
55## Check we are able to find a function symbol that encloses
66## a given location when reporting error messages.
77# CHECK: {{.*}}.o:(function func): relocation R_X86_64_32S out of range: -281474974609408 is not in [-2147483648, 2147483647]
88
9# This mergeable section will be garbage collected. We had a crash issue in that case. Test it.
10.section .rodata.str1,"aMS",@progbits,1
11.asciz "a"
12
913.section .text.func, "ax", %progbits
1014.globl func
1115.type func,@function
12.size func, 0x10
1316func:
14 movq func - 0x1000000000000, %rdx
17 movq $func - 0x1000000000000, %rdx
18.size func, .-func
deps/lld/test/mach-o/dependency_info.yaml+1-1
......@@ -9,7 +9,7 @@
99# RUN: -F/Custom/Frameworks \
1010# RUN: -framework Bar \
1111# RUN: -framework Foo
12# RUN: '%python' %p/Inputs/DependencyDump.py %t.info | FileCheck %s
12# RUN: %python %p/Inputs/DependencyDump.py %t.info | FileCheck %s
1313
1414
1515# CHECK: linker-vers: lld
deps/lld/test/wasm/lto/cache.ll+1-1
......@@ -11,7 +11,7 @@
1111; RUN: ls %t.cache | count 4
1212
1313; Create a file of size 64KB.
14; RUN: "%python" -c "print(' ' * 65536)" > %t.cache/llvmcache-foo
14; RUN: %python -c "print(' ' * 65536)" > %t.cache/llvmcache-foo
1515
1616; This should leave the file in place.
1717; RUN: wasm-ld --thinlto-cache-dir=%t.cache --thinlto-cache-policy cache_size_bytes=128k:prune_interval=0s -o %t.wasm %t2.o %t.o