authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-08-20 19:33:58-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-08-20 19:33:58-04:00
log37a06f4dcf27c6bb5759656d6abc0d8b290f093f
tree285802e5224a4f7881913092dd77b3d9779cca1a
parentc0bd2eb3987698ee9b91f6b7ef6eb85526749ed4
signaturelock-open Commit is signed but in an unrecognized format.

update embedded LLD to 9.0.0-rc2

upstream commit 67a4a12d61bfb10b2410b53c5a43ef9b4a03de7d

16 files changed, 321 insertions(+), 181 deletions(-)

deps/lld-prebuilt/MinGW/Options.inc+3
...@@ -37,6 +37,9 @@ OPTION(prefix_2, "Bdynamic", Bdynamic, Flag, INVALID, INVALID, nullptr, 0, 0,...@@ -37,6 +37,9 @@ OPTION(prefix_2, "Bdynamic", Bdynamic, Flag, INVALID, INVALID, nullptr, 0, 0,
37OPTION(prefix_2, "Bstatic", Bstatic, Flag, INVALID, INVALID, nullptr, 0, 0,37OPTION(prefix_2, "Bstatic", Bstatic, Flag, INVALID, INVALID, nullptr, 0, 0,
38 "Do not link against shared libraries", nullptr, nullptr)38 "Do not link against shared libraries", nullptr, nullptr)
39OPTION(prefix_2, "build-id", anonymous_1, Flag, INVALID, INVALID, nullptr, 0, 0, nullptr, nullptr, nullptr)39OPTION(prefix_2, "build-id", anonymous_1, Flag, INVALID, INVALID, nullptr, 0, 0, nullptr, nullptr, nullptr)
40OPTION(prefix_2, "delayload=", delayload_eq, Joined, INVALID, delayload, nullptr, 0, 0, nullptr, nullptr, nullptr)
41OPTION(prefix_2, "delayload", delayload, Separate, INVALID, INVALID, nullptr, 0, 0,
42 "DLL to load only on demand", nullptr, nullptr)
40OPTION(prefix_2, "disable-auto-image-base", anonymous_2, Flag, INVALID, INVALID, nullptr, 0, 0, nullptr, nullptr, nullptr)43OPTION(prefix_2, "disable-auto-image-base", anonymous_2, Flag, INVALID, INVALID, nullptr, 0, 0, nullptr, nullptr, nullptr)
41OPTION(prefix_2, "dynamicbase", dynamicbase, Flag, INVALID, INVALID, nullptr, 0, 0,44OPTION(prefix_2, "dynamicbase", dynamicbase, Flag, INVALID, INVALID, nullptr, 0, 0,
42 "Enable ASLR", nullptr, nullptr)45 "Enable ASLR", nullptr, nullptr)
deps/lld/COFF/Driver.cpp+3-1
...@@ -184,8 +184,10 @@ void LinkerDriver::addBuffer(std::unique_ptr<MemoryBuffer> mb,...@@ -184,8 +184,10 @@ void LinkerDriver::addBuffer(std::unique_ptr<MemoryBuffer> mb,
184 if (wholeArchive) {184 if (wholeArchive) {
185 std::unique_ptr<Archive> file =185 std::unique_ptr<Archive> file =
186 CHECK(Archive::create(mbref), filename + ": failed to parse archive");186 CHECK(Archive::create(mbref), filename + ": failed to parse archive");
187 Archive *archive = file.get();
188 make<std::unique_ptr<Archive>>(std::move(file)); // take ownership
187189
188 for (MemoryBufferRef m : getArchiveMembers(file.get()))190 for (MemoryBufferRef m : getArchiveMembers(archive))
189 addArchiveBuffer(m, "<whole-archive>", filename, 0);191 addArchiveBuffer(m, "<whole-archive>", filename, 0);
190 return;192 return;
191 }193 }
deps/lld/COFF/Writer.cpp+7
...@@ -1095,6 +1095,13 @@ Optional<coff_symbol16> Writer::createSymbol(Defined *def) {...@@ -1095,6 +1095,13 @@ Optional<coff_symbol16> Writer::createSymbol(Defined *def) {
1095 }1095 }
1096 }1096 }
10971097
1098 // Symbols that are runtime pseudo relocations don't point to the actual
1099 // symbol data itself (as they are imported), but points to the IAT entry
1100 // instead. Avoid emitting them to the symbol table, as they can confuse
1101 // debuggers.
1102 if (def->isRuntimePseudoReloc)
1103 return None;
1104
1098 StringRef name = def->getName();1105 StringRef name = def->getName();
1099 if (name.size() > COFF::NameSize) {1106 if (name.size() > COFF::NameSize) {
1100 sym.Name.Offset.Zeroes = 0;1107 sym.Name.Offset.Zeroes = 0;
deps/lld/ELF/SyntheticSections.cpp+13-1
...@@ -3177,11 +3177,23 @@ static bool isDuplicateArmExidxSec(InputSection *prev, InputSection *cur) {...@@ -3177,11 +3177,23 @@ static bool isDuplicateArmExidxSec(InputSection *prev, InputSection *cur) {
31773177
3178// The .ARM.exidx table must be sorted in ascending order of the address of the3178// The .ARM.exidx table must be sorted in ascending order of the address of the
3179// functions the table describes. Optionally duplicate adjacent table entries3179// functions the table describes. Optionally duplicate adjacent table entries
3180// can be removed. At the end of the function the ExecutableSections must be3180// can be removed. At the end of the function the executableSections must be
3181// sorted in ascending order of address, Sentinel is set to the InputSection3181// sorted in ascending order of address, Sentinel is set to the InputSection
3182// with the highest address and any InputSections that have mergeable3182// with the highest address and any InputSections that have mergeable
3183// .ARM.exidx table entries are removed from it.3183// .ARM.exidx table entries are removed from it.
3184void ARMExidxSyntheticSection::finalizeContents() {3184void ARMExidxSyntheticSection::finalizeContents() {
3185 if (script->hasSectionsCommand) {
3186 // The executableSections and exidxSections that we use to derive the
3187 // final contents of this SyntheticSection are populated before the
3188 // linker script assigns InputSections to OutputSections. The linker script
3189 // SECTIONS command may have a /DISCARD/ entry that removes executable
3190 // InputSections and their dependent .ARM.exidx section that we recorded
3191 // earlier.
3192 auto isDiscarded = [](const InputSection *isec) { return !isec->isLive(); };
3193 llvm::erase_if(executableSections, isDiscarded);
3194 llvm::erase_if(exidxSections, isDiscarded);
3195 }
3196
3185 // Sort the executable sections that may or may not have associated3197 // Sort the executable sections that may or may not have associated
3186 // .ARM.exidx sections by order of ascending address. This requires the3198 // .ARM.exidx sections by order of ascending address. This requires the
3187 // relative positions of InputSections to be known.3199 // relative positions of InputSections to be known.
deps/lld/MinGW/Driver.cpp+2
...@@ -303,6 +303,8 @@ bool mingw::link(ArrayRef<const char *> argsArr, raw_ostream &diag) {...@@ -303,6 +303,8 @@ bool mingw::link(ArrayRef<const char *> argsArr, raw_ostream &diag) {
303 add("-include:" + StringRef(a->getValue()));303 add("-include:" + StringRef(a->getValue()));
304 for (auto *a : args.filtered(OPT_undefined))304 for (auto *a : args.filtered(OPT_undefined))
305 add("-includeoptional:" + StringRef(a->getValue()));305 add("-includeoptional:" + StringRef(a->getValue()));
306 for (auto *a : args.filtered(OPT_delayload))
307 add("-delayload:" + StringRef(a->getValue()));
306308
307 std::vector<StringRef> searchPaths;309 std::vector<StringRef> searchPaths;
308 for (auto *a : args.filtered(OPT_L)) {310 for (auto *a : args.filtered(OPT_L)) {
deps/lld/MinGW/Options.td+2
...@@ -80,6 +80,8 @@ def require_defined_eq: J<"require-defined=">, Alias<require_defined>;...@@ -80,6 +80,8 @@ def require_defined_eq: J<"require-defined=">, Alias<require_defined>;
80def _HASH_HASH_HASH : Flag<["-"], "###">,80def _HASH_HASH_HASH : Flag<["-"], "###">,
81 HelpText<"Print (but do not run) the commands to run for this compilation">;81 HelpText<"Print (but do not run) the commands to run for this compilation">;
82def appcontainer: F<"appcontainer">, HelpText<"Set the appcontainer flag in the executable">;82def appcontainer: F<"appcontainer">, HelpText<"Set the appcontainer flag in the executable">;
83def delayload: S<"delayload">, HelpText<"DLL to load only on demand">;
84def delayload_eq: J<"delayload=">, Alias<delayload>;
83def mllvm: S<"mllvm">;85def mllvm: S<"mllvm">;
84def pdb: S<"pdb">, HelpText<"Output PDB debug info file, chosen implicitly if the argument is empty">;86def pdb: S<"pdb">, HelpText<"Output PDB debug info file, chosen implicitly if the argument is empty">;
85def pdb_eq: J<"pdb=">, Alias<pdb>;87def pdb_eq: J<"pdb=">, Alias<pdb>;
deps/lld/docs/ReleaseNotes.rst+9
...@@ -28,6 +28,15 @@ ELF Improvements...@@ -28,6 +28,15 @@ ELF Improvements
28 ``$ ld.lld --call-shared`` now prints28 ``$ ld.lld --call-shared`` now prints
29 ``unknown argument '--call-shared', did you mean '--call_shared'``.29 ``unknown argument '--call-shared', did you mean '--call_shared'``.
3030
31* lld now supports replacing ``JAL`` with ``JALX`` instructions in case
32 of MIPS - microMIPS cross-mode jumps.
33
34* lld now creates LA25 thunks for MIPS R6 code.
35
36* Put MIPS-specific .reginfo, .MIPS.options, and .MIPS.abiflags sections
37 into corresponding PT_MIPS_REGINFO, PT_MIPS_OPTIONS, and PT_MIPS_ABIFLAGS
38 segments.
39
31* ...40* ...
3241
33COFF Improvements42COFF Improvements
deps/lld/lib/ReaderWriter/MachO/ArchHandler_x86_64.cpp+1
...@@ -621,6 +621,7 @@ void ArchHandler_x86_64::applyFixupFinal(...@@ -621,6 +621,7 @@ void ArchHandler_x86_64::applyFixupFinal(
621 // Fall into llvm_unreachable().621 // Fall into llvm_unreachable().
622 break;622 break;
623 }623 }
624 llvm_unreachable("invalid x86_64 Reference Kind");
624}625}
625626
626void ArchHandler_x86_64::applyFixupRelocatable(const Reference &ref,627void ArchHandler_x86_64::applyFixupRelocatable(const Reference &ref,
deps/lld/test/COFF/Inputs/mangled-symbol.s created+9
...@@ -0,0 +1,9 @@
1 .text
2
3 .def "?f@@YAHXZ"
4 .scl 2
5 .type 32
6 .endef
7 .global "?f@@YAHXZ"
8"?f@@YAHXZ":
9 retq $0
deps/lld/test/COFF/autoimport-gnu-implib.s+6-1
...@@ -7,9 +7,10 @@...@@ -7,9 +7,10 @@
7# RUN: llvm-ar rcs %t-implib.a %t-dabcdh.o %t-dabcds00000.o %t-dabcdt.o7# RUN: llvm-ar rcs %t-implib.a %t-dabcdh.o %t-dabcds00000.o %t-dabcdt.o
88
9# RUN: llvm-mc -triple=x86_64-windows-gnu %s -filetype=obj -o %t.obj9# RUN: llvm-mc -triple=x86_64-windows-gnu %s -filetype=obj -o %t.obj
10# RUN: lld-link -lldmingw -out:%t.exe -entry:main %t.obj %t-implib.a -verbose10# RUN: lld-link -lldmingw -debug:symtab -out:%t.exe -entry:main %t.obj %t-implib.a -verbose
1111
12# RUN: llvm-readobj --coff-imports %t.exe | FileCheck -check-prefix=IMPORTS %s12# RUN: llvm-readobj --coff-imports %t.exe | FileCheck -check-prefix=IMPORTS %s
13# RUN: llvm-nm %t.exe | FileCheck -check-prefix=SYMBOLS %s
1314
14# IMPORTS: Import {15# IMPORTS: Import {
15# IMPORTS-NEXT: Name: foo.dll16# IMPORTS-NEXT: Name: foo.dll
...@@ -18,6 +19,10 @@...@@ -18,6 +19,10 @@
18# IMPORTS-NEXT: Symbol: data (0)19# IMPORTS-NEXT: Symbol: data (0)
19# IMPORTS-NEXT: }20# IMPORTS-NEXT: }
2021
22# Check that the automatically imported symbol "data" is not listed in
23# the symbol table.
24# SYMBOLS-NOT: {{ }}data
25
21 .global main26 .global main
22 .text27 .text
23main:28main:
deps/lld/test/COFF/autoimport-x86.s+7-2
...@@ -5,11 +5,12 @@...@@ -5,11 +5,12 @@
5# RUN: lld-link -out:%t-lib.dll -dll -entry:DllMainCRTStartup %t-lib.obj -lldmingw -implib:%t-lib.lib5# RUN: lld-link -out:%t-lib.dll -dll -entry:DllMainCRTStartup %t-lib.obj -lldmingw -implib:%t-lib.lib
66
7# RUN: llvm-mc -triple=x86_64-windows-gnu %s -filetype=obj -o %t.obj7# RUN: llvm-mc -triple=x86_64-windows-gnu %s -filetype=obj -o %t.obj
8# RUN: lld-link -lldmingw -out:%t.exe -entry:main %t.obj %t-lib.lib -verbose8# RUN: lld-link -lldmingw -debug:symtab -out:%t.exe -entry:main %t.obj %t-lib.lib -verbose
99
10# RUN: llvm-readobj --coff-imports %t.exe | FileCheck -check-prefix=IMPORTS %s10# RUN: llvm-readobj --coff-imports %t.exe | FileCheck -check-prefix=IMPORTS %s
11# RUN: llvm-objdump -d %t.exe | FileCheck -check-prefix=DISASM %s11# RUN: llvm-objdump -d %t.exe | FileCheck -check-prefix=DISASM %s
12# RUN: llvm-objdump -s %t.exe | FileCheck -check-prefix=CONTENTS %s12# RUN: llvm-objdump -s %t.exe | FileCheck -check-prefix=CONTENTS %s
13# RUN: llvm-nm %t.exe | FileCheck -check-prefix=SYMBOLS %s
1314
14# IMPORTS: Import {15# IMPORTS: Import {
15# IMPORTS-NEXT: Name: autoimport-x86.s.tmp-lib.dll16# IMPORTS-NEXT: Name: autoimport-x86.s.tmp-lib.dll
...@@ -20,7 +21,7 @@...@@ -20,7 +21,7 @@
2021
21# DISASM: Disassembly of section .text:22# DISASM: Disassembly of section .text:
22# DISASM-EMPTY:23# DISASM-EMPTY:
23# DISASM: .text:24# DISASM: main:
24# Relative offset at 0x1002 pointing at the IAT at 0x2080.25# Relative offset at 0x1002 pointing at the IAT at 0x2080.
25# DISASM: 140001000: 8b 05 7a 10 00 00 movl 4218(%rip), %eax26# DISASM: 140001000: 8b 05 7a 10 00 00 movl 4218(%rip), %eax
26# DISASM: 140001006: c3 retq27# DISASM: 140001006: c3 retq
...@@ -41,6 +42,10 @@...@@ -41,6 +42,10 @@
41# CONTENTS: 140003000 80200040 01000000 00200040 0100000042# CONTENTS: 140003000 80200040 01000000 00200040 01000000
42# CONTENTS: 140003010 24200040 0100000043# CONTENTS: 140003010 24200040 01000000
4344
45# Check that the automatically imported symbol "variable" is not listed in
46# the symbol table.
47# SYMBOLS-NOT: variable
48
44 .global main49 .global main
45 .text50 .text
46main:51main:
deps/lld/test/COFF/thin-archive.s created+32
...@@ -0,0 +1,32 @@
1# REQUIRES: x86
2
3# RUN: llvm-mc -filetype=obj -triple=x86_64-windows-msvc -o %t.main.obj %s
4
5# RUN: llvm-mc -filetype=obj -triple=x86_64-windows-msvc -o %t.lib.obj \
6# RUN: %S/Inputs/mangled-symbol.s
7# RUN: lld-link /lib /out:%t.lib %t.lib.obj
8# RUN: lld-link /lib /llvmlibthin /out:%t_thin.lib %t.lib.obj
9
10# RUN: lld-link /entry:main %t.main.obj %t.lib /out:%t.exe 2>&1 | \
11# RUN: FileCheck --allow-empty %s
12# RUN: lld-link /entry:main %t.main.obj %t_thin.lib /out:%t.exe 2>&1 | \
13# RUN: FileCheck --allow-empty %s
14# RUN: lld-link /entry:main %t.main.obj /wholearchive:%t_thin.lib /out:%t.exe 2>&1 | \
15# RUN: FileCheck --allow-empty %s
16
17# RUN: rm %t.lib.obj
18# RUN: lld-link /entry:main %t.main.obj %t.lib /out:%t.exe 2>&1 | \
19# RUN: FileCheck --allow-empty %s
20
21# CHECK-NOT: error: could not get the buffer for the member defining
22
23 .text
24
25 .def main
26 .scl 2
27 .type 32
28 .endef
29 .global main
30main:
31 call "?f@@YAHXZ"
32 retq $0
deps/lld/test/ELF/arm-exidx-partial-discard.s created+37
...@@ -0,0 +1,37 @@
1// REQUIRES: arm
2// RUN: llvm-mc -filetype=obj -triple arm-gnu-linux-eabi -mcpu cortex-a7 -arm-add-build-attributes %s -o %t.o
3// RUN: echo "SECTIONS { . = 0x10000; .text : { *(.text) } /DISCARD/ : { *(.exit.text) } }" > %t.script
4// RUN: ld.lld -T %t.script %t.o -o %t.elf
5// RUN: llvm-readobj -x .ARM.exidx --sections %t.elf | FileCheck %s
6
7// CHECK-NOT: .exit.text
8/// Expect 2 entries both CANTUNWIND as the .ARM.exidx.exit.text
9// should have been removed.
10// CHECK: Hex dump of section '.ARM.exidx':
11// CHECK-NEXT: 0x00010000 10000000 01000000 10000000 01000000
12
13/// The /DISCARD/ is evaluated after sections have been assigned to the
14/// .ARM.exidx synthetic section. We must account for the /DISCARD/
15 .section .exit.text, "ax", %progbits
16 .globl foo
17 .type foo, %function
18foo:
19 .fnstart
20 bx lr
21 .save {r7, lr}
22 .setfp r7, sp, #0
23 .fnend
24
25 .text
26 .globl _start
27 .type _start, %function
28_start:
29 .fnstart
30 bx lr
31 .cantunwind
32 .fnend
33
34 .section .text.__aeabi_unwind_cpp_pr0, "ax", %progbits
35 .global __aeabi_unwind_cpp_pr0
36__aeabi_unwind_cpp_pr0:
37 bx lr
deps/lld/test/MinGW/driver.test+4
...@@ -200,3 +200,7 @@ APPCONTAINER: -appcontainer...@@ -200,3 +200,7 @@ APPCONTAINER: -appcontainer
200# RUN: ld.lld -m i386pep --help 2>&1 | FileCheck -check-prefix=HELP %s200# RUN: ld.lld -m i386pep --help 2>&1 | FileCheck -check-prefix=HELP %s
201# HELP: USAGE:201# HELP: USAGE:
202# HELP: --enable-auto-import202# HELP: --enable-auto-import
203
204RUN: ld.lld -### -m i386pep foo.o -delayload user32.dll --delayload shell32.dll | FileCheck -check-prefix DELAYLOAD %s
205RUN: ld.lld -### -m i386pep foo.o -delayload=user32.dll --delayload=shell32.dll | FileCheck -check-prefix DELAYLOAD %s
206DELAYLOAD: -delayload:user32.dll -delayload:shell32.dll
deps/lld/test/wasm/relocatable.ll+185-175
...@@ -1,7 +1,12 @@...@@ -1,7 +1,12 @@
1; RUN: llc -filetype=obj %p/Inputs/hello.ll -o %t.hello.o1; RUN: llc -filetype=obj %p/Inputs/hello.ll -o %t.hello.o
2; RUN: llc -filetype=obj %s -o %t.o2; RUN: llc -filetype=obj %s -o %t.o
3; RUN: wasm-ld -r -o %t.wasm %t.hello.o %t.o3; RUN: wasm-ld -r -o %t.wasm %t.hello.o %t.o
4; RUN: obj2yaml %t.wasm | FileCheck %s4; RUN: obj2yaml %t.wasm | FileCheck %s --check-prefixes CHECK,NORMAL
5
6; RUN: llc -filetype=obj %p/Inputs/hello.ll -o %t.hello.bm.o -mattr=+bulk-memory
7; RUN: llc -filetype=obj %s -o %t.bm.o -mattr=+bulk-memory
8; RUN: wasm-ld -r -o %t.mt.wasm %t.hello.bm.o %t.bm.o --shared-memory --max-memory=131072
9; RUN: obj2yaml %t.mt.wasm | FileCheck %s --check-prefixes CHECK,SHARED
510
6target triple = "wasm32-unknown-unknown"11target triple = "wasm32-unknown-unknown"
712
...@@ -70,13 +75,18 @@ entry:...@@ -70,13 +75,18 @@ entry:
70; CHECK-NEXT: Maximum: 0x0000000475; CHECK-NEXT: Maximum: 0x00000004
71; CHECK-NEXT: - Type: MEMORY76; CHECK-NEXT: - Type: MEMORY
72; CHECK-NEXT: Memories:77; CHECK-NEXT: Memories:
73; CHECK-NEXT: - Initial: 0x0000000178; NORMAL-NEXT: - Initial: 0x00000001
79; SHARED-NEXT: - Flags: [ HAS_MAX, IS_SHARED ]
80; SHARED-NEXT: Initial: 0x00000001
81; SHARED-NEXT: Maximum: 0x00000002
74; CHECK-NEXT: - Type: ELEM82; CHECK-NEXT: - Type: ELEM
75; CHECK-NEXT: Segments:83; CHECK-NEXT: Segments:
76; CHECK-NEXT: - Offset:84; CHECK-NEXT: - Offset:
77; CHECK-NEXT: Opcode: I32_CONST85; CHECK-NEXT: Opcode: I32_CONST
78; CHECK-NEXT: Value: 186; CHECK-NEXT: Value: 1
79; CHECK-NEXT: Functions: [ 4, 1, 2 ]87; CHECK-NEXT: Functions: [ 4, 1, 2 ]
88; SHARED-NEXT: - Type: DATACOUNT
89; SHARED-NEXT: Count: 6
80; CHECK-NEXT: - Type: CODE90; CHECK-NEXT: - Type: CODE
81; CHECK-NEXT: Relocations:91; CHECK-NEXT: Relocations:
82; CHECK-NEXT: - Type: R_WASM_MEMORY_ADDR_SLEB92; CHECK-NEXT: - Type: R_WASM_MEMORY_ADDR_SLEB
...@@ -104,176 +114,176 @@ entry:...@@ -104,176 +114,176 @@ entry:
104; CHECK-NEXT: - Index: 5114; CHECK-NEXT: - Index: 5
105; CHECK-NEXT: Locals:115; CHECK-NEXT: Locals:
106; CHECK-NEXT: Body: 419C808080000B116; CHECK-NEXT: Body: 419C808080000B
107; CHECK-NEXT: - Type: DATA117; NORMAL-NEXT: - Type: DATA
108; CHECK-NEXT: Relocations:118; NORMAL-NEXT: Relocations:
109; CHECK-NEXT: - Type: R_WASM_TABLE_INDEX_I32119; NORMAL-NEXT: - Type: R_WASM_TABLE_INDEX_I32
110; CHECK-NEXT: Index: 3120; NORMAL-NEXT: Index: 3
111; CHECK-NEXT: Offset: 0x00000012121; NORMAL-NEXT: Offset: 0x00000012
112; CHECK-NEXT: - Type: R_WASM_TABLE_INDEX_I32122; NORMAL-NEXT: - Type: R_WASM_TABLE_INDEX_I32
113; CHECK-NEXT: Index: 4123; NORMAL-NEXT: Index: 4
114; CHECK-NEXT: Offset: 0x0000001B124; NORMAL-NEXT: Offset: 0x0000001B
115; CHECK-NEXT: - Type: R_WASM_TABLE_INDEX_I32125; NORMAL-NEXT: - Type: R_WASM_TABLE_INDEX_I32
116; CHECK-NEXT: Index: 5126; NORMAL-NEXT: Index: 5
117; CHECK-NEXT: Offset: 0x00000024127; NORMAL-NEXT: Offset: 0x00000024
118; CHECK-NEXT: - Type: R_WASM_MEMORY_ADDR_I32128; NORMAL-NEXT: - Type: R_WASM_MEMORY_ADDR_I32
119; CHECK-NEXT: Index: 12129; NORMAL-NEXT: Index: 12
120; CHECK-NEXT: Offset: 0x0000002D130; NORMAL-NEXT: Offset: 0x0000002D
121; CHECK-NEXT: Segments:131; NORMAL-NEXT: Segments:
122; CHECK-NEXT: - SectionOffset: 6132; NORMAL-NEXT: - SectionOffset: 6
123; CHECK-NEXT: InitFlags: 0133; NORMAL-NEXT: InitFlags: 0
124; CHECK-NEXT: Offset:134; NORMAL-NEXT: Offset:
125; CHECK-NEXT: Opcode: I32_CONST135; NORMAL-NEXT: Opcode: I32_CONST
126; CHECK-NEXT: Value: 0136; NORMAL-NEXT: Value: 0
127; CHECK-NEXT: Content: 68656C6C6F0A00137; NORMAL-NEXT: Content: 68656C6C6F0A00
128; CHECK-NEXT: - SectionOffset: 18138; NORMAL-NEXT: - SectionOffset: 18
129; CHECK-NEXT: InitFlags: 0139; NORMAL-NEXT: InitFlags: 0
130; CHECK-NEXT: Offset:140; NORMAL-NEXT: Offset:
131; CHECK-NEXT: Opcode: I32_CONST141; NORMAL-NEXT: Opcode: I32_CONST
132; CHECK-NEXT: Value: 8142; NORMAL-NEXT: Value: 8
133; CHECK-NEXT: Content: '01000000'143; NORMAL-NEXT: Content: '01000000'
134; CHECK-NEXT: - SectionOffset: 27144; NORMAL-NEXT: - SectionOffset: 27
135; CHECK-NEXT: InitFlags: 0145; NORMAL-NEXT: InitFlags: 0
136; CHECK-NEXT: Offset:146; NORMAL-NEXT: Offset:
137; CHECK-NEXT: Opcode: I32_CONST147; NORMAL-NEXT: Opcode: I32_CONST
138; CHECK-NEXT: Value: 12148; NORMAL-NEXT: Value: 12
139; CHECK-NEXT: Content: '02000000'149; NORMAL-NEXT: Content: '02000000'
140; CHECK-NEXT: - SectionOffset: 36150; NORMAL-NEXT: - SectionOffset: 36
141; CHECK-NEXT: InitFlags: 0151; NORMAL-NEXT: InitFlags: 0
142; CHECK-NEXT: Offset:152; NORMAL-NEXT: Offset:
143; CHECK-NEXT: Opcode: I32_CONST153; NORMAL-NEXT: Opcode: I32_CONST
144; CHECK-NEXT: Value: 16154; NORMAL-NEXT: Value: 16
145; CHECK-NEXT: Content: '03000000'155; NORMAL-NEXT: Content: '03000000'
146; CHECK-NEXT: - SectionOffset: 45156; NORMAL-NEXT: - SectionOffset: 45
147; CHECK-NEXT: InitFlags: 0157; NORMAL-NEXT: InitFlags: 0
148; CHECK-NEXT: Offset:158; NORMAL-NEXT: Offset:
149; CHECK-NEXT: Opcode: I32_CONST159; NORMAL-NEXT: Opcode: I32_CONST
150; CHECK-NEXT: Value: 24160; NORMAL-NEXT: Value: 24
151; CHECK-NEXT: Content: '00000000'161; NORMAL-NEXT: Content: '00000000'
152; CHECK-NEXT: - SectionOffset: 54162; NORMAL-NEXT: - SectionOffset: 54
153; CHECK-NEXT: InitFlags: 0163; NORMAL-NEXT: InitFlags: 0
154; CHECK-NEXT: Offset:164; NORMAL-NEXT: Offset:
155; CHECK-NEXT: Opcode: I32_CONST165; NORMAL-NEXT: Opcode: I32_CONST
156; CHECK-NEXT: Value: 28166; NORMAL-NEXT: Value: 28
157; CHECK-NEXT: Content: '616263'167; NORMAL-NEXT: Content: '616263'
158; CHECK-NEXT: - Type: CUSTOM168; NORMAL-NEXT: - Type: CUSTOM
159; CHECK-NEXT: Name: linking169; NORMAL-NEXT: Name: linking
160; CHECK-NEXT: Version: 2170; NORMAL-NEXT: Version: 2
161; CHECK-NEXT: SymbolTable:171; NORMAL-NEXT: SymbolTable:
162; CHECK-NEXT: - Index: 0172; NORMAL-NEXT: - Index: 0
163; CHECK-NEXT: Kind: FUNCTION173; NORMAL-NEXT: Kind: FUNCTION
164; CHECK-NEXT: Name: hello174; NORMAL-NEXT: Name: hello
165; CHECK-NEXT: Flags: [ VISIBILITY_HIDDEN ]175; NORMAL-NEXT: Flags: [ VISIBILITY_HIDDEN ]
166; CHECK-NEXT: Function: 3176; NORMAL-NEXT: Function: 3
167; CHECK-NEXT: - Index: 1177; NORMAL-NEXT: - Index: 1
168; CHECK-NEXT: Kind: DATA178; NORMAL-NEXT: Kind: DATA
169; CHECK-NEXT: Name: hello_str179; NORMAL-NEXT: Name: hello_str
170; CHECK-NEXT: Flags: [ ]180; NORMAL-NEXT: Flags: [ ]
171; CHECK-NEXT: Segment: 0181; NORMAL-NEXT: Segment: 0
172; CHECK-NEXT: Size: 7182; NORMAL-NEXT: Size: 7
173; CHECK-NEXT: - Index: 2183; NORMAL-NEXT: - Index: 2
174; CHECK-NEXT: Kind: FUNCTION184; NORMAL-NEXT: Kind: FUNCTION
175; CHECK-NEXT: Name: puts185; NORMAL-NEXT: Name: puts
176; CHECK-NEXT: Flags: [ UNDEFINED ]186; NORMAL-NEXT: Flags: [ UNDEFINED ]
177; CHECK-NEXT: Function: 0187; NORMAL-NEXT: Function: 0
178; CHECK-NEXT: - Index: 3188; NORMAL-NEXT: - Index: 3
179; CHECK-NEXT: Kind: FUNCTION189; NORMAL-NEXT: Kind: FUNCTION
180; CHECK-NEXT: Name: my_func190; NORMAL-NEXT: Name: my_func
181; CHECK-NEXT: Flags: [ VISIBILITY_HIDDEN ]191; NORMAL-NEXT: Flags: [ VISIBILITY_HIDDEN ]
182; CHECK-NEXT: Function: 4192; NORMAL-NEXT: Function: 4
183; CHECK-NEXT: - Index: 4193; NORMAL-NEXT: - Index: 4
184; CHECK-NEXT: Kind: FUNCTION194; NORMAL-NEXT: Kind: FUNCTION
185; CHECK-NEXT: Name: foo_import195; NORMAL-NEXT: Name: foo_import
186; CHECK-NEXT: Flags: [ UNDEFINED ]196; NORMAL-NEXT: Flags: [ UNDEFINED ]
187; CHECK-NEXT: Function: 1197; NORMAL-NEXT: Function: 1
188; CHECK-NEXT: - Index: 5198; NORMAL-NEXT: - Index: 5
189; CHECK-NEXT: Kind: FUNCTION199; NORMAL-NEXT: Kind: FUNCTION
190; CHECK-NEXT: Name: bar_import200; NORMAL-NEXT: Name: bar_import
191; CHECK-NEXT: Flags: [ BINDING_WEAK, UNDEFINED ]201; NORMAL-NEXT: Flags: [ BINDING_WEAK, UNDEFINED ]
192; CHECK-NEXT: Function: 2202; NORMAL-NEXT: Function: 2
193; CHECK-NEXT: - Index: 6203; NORMAL-NEXT: - Index: 6
194; CHECK-NEXT: Kind: FUNCTION204; NORMAL-NEXT: Kind: FUNCTION
195; CHECK-NEXT: Name: func_comdat205; NORMAL-NEXT: Name: func_comdat
196; CHECK-NEXT: Flags: [ BINDING_WEAK ]206; NORMAL-NEXT: Flags: [ BINDING_WEAK ]
197; CHECK-NEXT: Function: 5207; NORMAL-NEXT: Function: 5
198; CHECK-NEXT: - Index: 7208; NORMAL-NEXT: - Index: 7
199; CHECK-NEXT: Kind: DATA209; NORMAL-NEXT: Kind: DATA
200; CHECK-NEXT: Name: data_comdat210; NORMAL-NEXT: Name: data_comdat
201; CHECK-NEXT: Flags: [ BINDING_WEAK ]211; NORMAL-NEXT: Flags: [ BINDING_WEAK ]
202; CHECK-NEXT: Segment: 5212; NORMAL-NEXT: Segment: 5
203; CHECK-NEXT: Size: 3213; NORMAL-NEXT: Size: 3
204; CHECK-NEXT: - Index: 8214; NORMAL-NEXT: - Index: 8
205; CHECK-NEXT: Kind: DATA215; NORMAL-NEXT: Kind: DATA
206; CHECK-NEXT: Name: func_addr1216; NORMAL-NEXT: Name: func_addr1
207; CHECK-NEXT: Flags: [ VISIBILITY_HIDDEN ]217; NORMAL-NEXT: Flags: [ VISIBILITY_HIDDEN ]
208; CHECK-NEXT: Segment: 1218; NORMAL-NEXT: Segment: 1
209; CHECK-NEXT: Size: 4219; NORMAL-NEXT: Size: 4
210; CHECK-NEXT: - Index: 9220; NORMAL-NEXT: - Index: 9
211; CHECK-NEXT: Kind: DATA221; NORMAL-NEXT: Kind: DATA
212; CHECK-NEXT: Name: func_addr2222; NORMAL-NEXT: Name: func_addr2
213; CHECK-NEXT: Flags: [ VISIBILITY_HIDDEN ]223; NORMAL-NEXT: Flags: [ VISIBILITY_HIDDEN ]
214; CHECK-NEXT: Segment: 2224; NORMAL-NEXT: Segment: 2
215; CHECK-NEXT: Size: 4225; NORMAL-NEXT: Size: 4
216; CHECK-NEXT: - Index: 10226; NORMAL-NEXT: - Index: 10
217; CHECK-NEXT: Kind: DATA227; NORMAL-NEXT: Kind: DATA
218; CHECK-NEXT: Name: func_addr3228; NORMAL-NEXT: Name: func_addr3
219; CHECK-NEXT: Flags: [ VISIBILITY_HIDDEN ]229; NORMAL-NEXT: Flags: [ VISIBILITY_HIDDEN ]
220; CHECK-NEXT: Segment: 3230; NORMAL-NEXT: Segment: 3
221; CHECK-NEXT: Size: 4231; NORMAL-NEXT: Size: 4
222; CHECK-NEXT: - Index: 11232; NORMAL-NEXT: - Index: 11
223; CHECK-NEXT: Kind: DATA233; NORMAL-NEXT: Kind: DATA
224; CHECK-NEXT: Name: data_addr1234; NORMAL-NEXT: Name: data_addr1
225; CHECK-NEXT: Flags: [ VISIBILITY_HIDDEN ]235; NORMAL-NEXT: Flags: [ VISIBILITY_HIDDEN ]
226; CHECK-NEXT: Segment: 4236; NORMAL-NEXT: Segment: 4
227; CHECK-NEXT: Size: 4237; NORMAL-NEXT: Size: 4
228; CHECK-NEXT: - Index: 12238; NORMAL-NEXT: - Index: 12
229; CHECK-NEXT: Kind: DATA239; NORMAL-NEXT: Kind: DATA
230; CHECK-NEXT: Name: data_import240; NORMAL-NEXT: Name: data_import
231; CHECK-NEXT: Flags: [ UNDEFINED ]241; NORMAL-NEXT: Flags: [ UNDEFINED ]
232; CHECK-NEXT: SegmentInfo:242; NORMAL-NEXT: SegmentInfo:
233; CHECK-NEXT: - Index: 0243; NORMAL-NEXT: - Index: 0
234; CHECK-NEXT: Name: .rodata.hello_str244; NORMAL-NEXT: Name: .rodata.hello_str
235; CHECK-NEXT: Alignment: 0245; NORMAL-NEXT: Alignment: 0
236; CHECK-NEXT: Flags: [ ]246; NORMAL-NEXT: Flags: [ ]
237; CHECK-NEXT: - Index: 1247; NORMAL-NEXT: - Index: 1
238; CHECK-NEXT: Name: .data.func_addr1248; NORMAL-NEXT: Name: .data.func_addr1
239; CHECK-NEXT: Alignment: 2249; NORMAL-NEXT: Alignment: 2
240; CHECK-NEXT: Flags: [ ]250; NORMAL-NEXT: Flags: [ ]
241; CHECK-NEXT: - Index: 2251; NORMAL-NEXT: - Index: 2
242; CHECK-NEXT: Name: .data.func_addr2252; NORMAL-NEXT: Name: .data.func_addr2
243; CHECK-NEXT: Alignment: 2253; NORMAL-NEXT: Alignment: 2
244; CHECK-NEXT: Flags: [ ]254; NORMAL-NEXT: Flags: [ ]
245; CHECK-NEXT: - Index: 3255; NORMAL-NEXT: - Index: 3
246; CHECK-NEXT: Name: .data.func_addr3256; NORMAL-NEXT: Name: .data.func_addr3
247; CHECK-NEXT: Alignment: 2257; NORMAL-NEXT: Alignment: 2
248; CHECK-NEXT: Flags: [ ]258; NORMAL-NEXT: Flags: [ ]
249; CHECK-NEXT: - Index: 4259; NORMAL-NEXT: - Index: 4
250; CHECK-NEXT: Name: .data.data_addr1260; NORMAL-NEXT: Name: .data.data_addr1
251; CHECK-NEXT: Alignment: 3261; NORMAL-NEXT: Alignment: 3
252; CHECK-NEXT: Flags: [ ]262; NORMAL-NEXT: Flags: [ ]
253; CHECK-NEXT: - Index: 5263; NORMAL-NEXT: - Index: 5
254; CHECK-NEXT: Name: .rodata.data_comdat264; NORMAL-NEXT: Name: .rodata.data_comdat
255; CHECK-NEXT: Alignment: 0265; NORMAL-NEXT: Alignment: 0
256; CHECK-NEXT: Flags: [ ]266; NORMAL-NEXT: Flags: [ ]
257; CHECK-NEXT: Comdats:267; NORMAL-NEXT: Comdats:
258; CHECK-NEXT: - Name: func_comdat268; NORMAL-NEXT: - Name: func_comdat
259; CHECK-NEXT: Entries:269; NORMAL-NEXT: Entries:
260; CHECK-NEXT: - Kind: FUNCTION270; NORMAL-NEXT: - Kind: FUNCTION
261; CHECK-NEXT: Index: 5271; NORMAL-NEXT: Index: 5
262; CHECK-NEXT: - Kind: DATA272; NORMAL-NEXT: - Kind: DATA
263; CHECK-NEXT: Index: 5273; NORMAL-NEXT: Index: 5
264; CHECK-NEXT: - Type: CUSTOM274; NORMAL-NEXT: - Type: CUSTOM
265; CHECK-NEXT: Name: name275; NORMAL-NEXT: Name: name
266; CHECK-NEXT: FunctionNames:276; NORMAL-NEXT: FunctionNames:
267; CHECK-NEXT: - Index: 0277; NORMAL-NEXT: - Index: 0
268; CHECK-NEXT: Name: puts278; NORMAL-NEXT: Name: puts
269; CHECK-NEXT: - Index: 1279; NORMAL-NEXT: - Index: 1
270; CHECK-NEXT: Name: foo_import280; NORMAL-NEXT: Name: foo_import
271; CHECK-NEXT: - Index: 2281; NORMAL-NEXT: - Index: 2
272; CHECK-NEXT: Name: bar_import282; NORMAL-NEXT: Name: bar_import
273; CHECK-NEXT: - Index: 3283; NORMAL-NEXT: - Index: 3
274; CHECK-NEXT: Name: hello284; NORMAL-NEXT: Name: hello
275; CHECK-NEXT: - Index: 4285; NORMAL-NEXT: - Index: 4
276; CHECK-NEXT: Name: my_func286; NORMAL-NEXT: Name: my_func
277; CHECK-NEXT: - Index: 5287; NORMAL-NEXT: - Index: 5
278; CHECK-NEXT: Name: func_comdat288; NORMAL-NEXT: Name: func_comdat
279; CHECK-NEXT: ...289; NORMAL-NEXT:...
deps/lld/wasm/Writer.cpp+1-1
...@@ -898,7 +898,7 @@ void Writer::run() {...@@ -898,7 +898,7 @@ void Writer::run() {
898 createCallCtorsFunction();898 createCallCtorsFunction();
899 }899 }
900900
901 if (config->sharedMemory && !config->shared)901 if (!config->relocatable && config->sharedMemory && !config->shared)
902 createInitTLSFunction();902 createInitTLSFunction();
903903
904 if (errorCount())904 if (errorCount())