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
signature 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,
3737OPTION(prefix_2, "Bstatic", Bstatic, Flag, INVALID, INVALID, nullptr, 0, 0,
3838 "Do not link against shared libraries", nullptr, nullptr)
3939OPTION(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)
4043OPTION(prefix_2, "disable-auto-image-base", anonymous_2, Flag, INVALID, INVALID, nullptr, 0, 0, nullptr, nullptr, nullptr)
4144OPTION(prefix_2, "dynamicbase", dynamicbase, Flag, INVALID, INVALID, nullptr, 0, 0,
4245 "Enable ASLR", nullptr, nullptr)
deps/lld/COFF/Driver.cpp+3-1
......@@ -184,8 +184,10 @@ void LinkerDriver::addBuffer(std::unique_ptr<MemoryBuffer> mb,
184184 if (wholeArchive) {
185185 std::unique_ptr<Archive> file =
186186 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))
189191 addArchiveBuffer(m, "<whole-archive>", filename, 0);
190192 return;
191193 }
deps/lld/COFF/Writer.cpp+7
......@@ -1095,6 +1095,13 @@ Optional<coff_symbol16> Writer::createSymbol(Defined *def) {
10951095 }
10961096 }
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
10981105 StringRef name = def->getName();
10991106 if (name.size() > COFF::NameSize) {
11001107 sym.Name.Offset.Zeroes = 0;
deps/lld/ELF/SyntheticSections.cpp+13-1
......@@ -3177,11 +3177,23 @@ static bool isDuplicateArmExidxSec(InputSection *prev, InputSection *cur) {
31773177
31783178// The .ARM.exidx table must be sorted in ascending order of the address of the
31793179// functions the table describes. Optionally duplicate adjacent table entries
3180// can be removed. At the end of the function the ExecutableSections must be
3180// can be removed. At the end of the function the executableSections must be
31813181// sorted in ascending order of address, Sentinel is set to the InputSection
31823182// with the highest address and any InputSections that have mergeable
31833183// .ARM.exidx table entries are removed from it.
31843184void 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
31853197 // Sort the executable sections that may or may not have associated
31863198 // .ARM.exidx sections by order of ascending address. This requires the
31873199 // 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) {
303303 add("-include:" + StringRef(a->getValue()));
304304 for (auto *a : args.filtered(OPT_undefined))
305305 add("-includeoptional:" + StringRef(a->getValue()));
306 for (auto *a : args.filtered(OPT_delayload))
307 add("-delayload:" + StringRef(a->getValue()));
306308
307309 std::vector<StringRef> searchPaths;
308310 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>;
8080def _HASH_HASH_HASH : Flag<["-"], "###">,
8181 HelpText<"Print (but do not run) the commands to run for this compilation">;
8282def 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>;
8385def mllvm: S<"mllvm">;
8486def pdb: S<"pdb">, HelpText<"Output PDB debug info file, chosen implicitly if the argument is empty">;
8587def pdb_eq: J<"pdb=">, Alias<pdb>;
deps/lld/docs/ReleaseNotes.rst+9
......@@ -28,6 +28,15 @@ ELF Improvements
2828 ``$ ld.lld --call-shared`` now prints
2929 ``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
3140* ...
3241
3342COFF Improvements
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/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 @@
77# RUN: llvm-ar rcs %t-implib.a %t-dabcdh.o %t-dabcds00000.o %t-dabcdt.o
88
99# 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 -verbose
10# RUN: lld-link -lldmingw -debug:symtab -out:%t.exe -entry:main %t.obj %t-implib.a -verbose
1111
1212# RUN: llvm-readobj --coff-imports %t.exe | FileCheck -check-prefix=IMPORTS %s
13# RUN: llvm-nm %t.exe | FileCheck -check-prefix=SYMBOLS %s
1314
1415# IMPORTS: Import {
1516# IMPORTS-NEXT: Name: foo.dll
......@@ -18,6 +19,10 @@
1819# IMPORTS-NEXT: Symbol: data (0)
1920# IMPORTS-NEXT: }
2021
22# Check that the automatically imported symbol "data" is not listed in
23# the symbol table.
24# SYMBOLS-NOT: {{ }}data
25
2126 .global main
2227 .text
2328main:
deps/lld/test/COFF/autoimport-x86.s+7-2
......@@ -5,11 +5,12 @@
55# RUN: lld-link -out:%t-lib.dll -dll -entry:DllMainCRTStartup %t-lib.obj -lldmingw -implib:%t-lib.lib
66
77# 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 -verbose
8# RUN: lld-link -lldmingw -debug:symtab -out:%t.exe -entry:main %t.obj %t-lib.lib -verbose
99
1010# RUN: llvm-readobj --coff-imports %t.exe | FileCheck -check-prefix=IMPORTS %s
1111# RUN: llvm-objdump -d %t.exe | FileCheck -check-prefix=DISASM %s
1212# RUN: llvm-objdump -s %t.exe | FileCheck -check-prefix=CONTENTS %s
13# RUN: llvm-nm %t.exe | FileCheck -check-prefix=SYMBOLS %s
1314
1415# IMPORTS: Import {
1516# IMPORTS-NEXT: Name: autoimport-x86.s.tmp-lib.dll
......@@ -20,7 +21,7 @@
2021
2122# DISASM: Disassembly of section .text:
2223# DISASM-EMPTY:
23# DISASM: .text:
24# DISASM: main:
2425# Relative offset at 0x1002 pointing at the IAT at 0x2080.
2526# DISASM: 140001000: 8b 05 7a 10 00 00 movl 4218(%rip), %eax
2627# DISASM: 140001006: c3 retq
......@@ -41,6 +42,10 @@
4142# CONTENTS: 140003000 80200040 01000000 00200040 01000000
4243# 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
4449 .global main
4550 .text
4651main:
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
200200# RUN: ld.lld -m i386pep --help 2>&1 | FileCheck -check-prefix=HELP %s
201201# HELP: USAGE:
202202# 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 @@
11; RUN: llc -filetype=obj %p/Inputs/hello.ll -o %t.hello.o
22; RUN: llc -filetype=obj %s -o %t.o
33; RUN: wasm-ld -r -o %t.wasm %t.hello.o %t.o
4; RUN: obj2yaml %t.wasm | FileCheck %s
4; 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
611target triple = "wasm32-unknown-unknown"
712
......@@ -70,13 +75,18 @@ entry:
7075; CHECK-NEXT: Maximum: 0x00000004
7176; CHECK-NEXT: - Type: MEMORY
7277; CHECK-NEXT: Memories:
73; CHECK-NEXT: - Initial: 0x00000001
78; NORMAL-NEXT: - Initial: 0x00000001
79; SHARED-NEXT: - Flags: [ HAS_MAX, IS_SHARED ]
80; SHARED-NEXT: Initial: 0x00000001
81; SHARED-NEXT: Maximum: 0x00000002
7482; CHECK-NEXT: - Type: ELEM
7583; CHECK-NEXT: Segments:
7684; CHECK-NEXT: - Offset:
7785; CHECK-NEXT: Opcode: I32_CONST
7886; CHECK-NEXT: Value: 1
7987; CHECK-NEXT: Functions: [ 4, 1, 2 ]
88; SHARED-NEXT: - Type: DATACOUNT
89; SHARED-NEXT: Count: 6
8090; CHECK-NEXT: - Type: CODE
8191; CHECK-NEXT: Relocations:
8292; CHECK-NEXT: - Type: R_WASM_MEMORY_ADDR_SLEB
......@@ -104,176 +114,176 @@ entry:
104114; CHECK-NEXT: - Index: 5
105115; CHECK-NEXT: Locals:
106116; CHECK-NEXT: Body: 419C808080000B
107; CHECK-NEXT: - Type: DATA
108; CHECK-NEXT: Relocations:
109; CHECK-NEXT: - Type: R_WASM_TABLE_INDEX_I32
110; CHECK-NEXT: Index: 3
111; CHECK-NEXT: Offset: 0x00000012
112; CHECK-NEXT: - Type: R_WASM_TABLE_INDEX_I32
113; CHECK-NEXT: Index: 4
114; CHECK-NEXT: Offset: 0x0000001B
115; CHECK-NEXT: - Type: R_WASM_TABLE_INDEX_I32
116; CHECK-NEXT: Index: 5
117; CHECK-NEXT: Offset: 0x00000024
118; CHECK-NEXT: - Type: R_WASM_MEMORY_ADDR_I32
119; CHECK-NEXT: Index: 12
120; CHECK-NEXT: Offset: 0x0000002D
121; CHECK-NEXT: Segments:
122; CHECK-NEXT: - SectionOffset: 6
123; CHECK-NEXT: InitFlags: 0
124; CHECK-NEXT: Offset:
125; CHECK-NEXT: Opcode: I32_CONST
126; CHECK-NEXT: Value: 0
127; CHECK-NEXT: Content: 68656C6C6F0A00
128; CHECK-NEXT: - SectionOffset: 18
129; CHECK-NEXT: InitFlags: 0
130; CHECK-NEXT: Offset:
131; CHECK-NEXT: Opcode: I32_CONST
132; CHECK-NEXT: Value: 8
133; CHECK-NEXT: Content: '01000000'
134; CHECK-NEXT: - SectionOffset: 27
135; CHECK-NEXT: InitFlags: 0
136; CHECK-NEXT: Offset:
137; CHECK-NEXT: Opcode: I32_CONST
138; CHECK-NEXT: Value: 12
139; CHECK-NEXT: Content: '02000000'
140; CHECK-NEXT: - SectionOffset: 36
141; CHECK-NEXT: InitFlags: 0
142; CHECK-NEXT: Offset:
143; CHECK-NEXT: Opcode: I32_CONST
144; CHECK-NEXT: Value: 16
145; CHECK-NEXT: Content: '03000000'
146; CHECK-NEXT: - SectionOffset: 45
147; CHECK-NEXT: InitFlags: 0
148; CHECK-NEXT: Offset:
149; CHECK-NEXT: Opcode: I32_CONST
150; CHECK-NEXT: Value: 24
151; CHECK-NEXT: Content: '00000000'
152; CHECK-NEXT: - SectionOffset: 54
153; CHECK-NEXT: InitFlags: 0
154; CHECK-NEXT: Offset:
155; CHECK-NEXT: Opcode: I32_CONST
156; CHECK-NEXT: Value: 28
157; CHECK-NEXT: Content: '616263'
158; CHECK-NEXT: - Type: CUSTOM
159; CHECK-NEXT: Name: linking
160; CHECK-NEXT: Version: 2
161; CHECK-NEXT: SymbolTable:
162; CHECK-NEXT: - Index: 0
163; CHECK-NEXT: Kind: FUNCTION
164; CHECK-NEXT: Name: hello
165; CHECK-NEXT: Flags: [ VISIBILITY_HIDDEN ]
166; CHECK-NEXT: Function: 3
167; CHECK-NEXT: - Index: 1
168; CHECK-NEXT: Kind: DATA
169; CHECK-NEXT: Name: hello_str
170; CHECK-NEXT: Flags: [ ]
171; CHECK-NEXT: Segment: 0
172; CHECK-NEXT: Size: 7
173; CHECK-NEXT: - Index: 2
174; CHECK-NEXT: Kind: FUNCTION
175; CHECK-NEXT: Name: puts
176; CHECK-NEXT: Flags: [ UNDEFINED ]
177; CHECK-NEXT: Function: 0
178; CHECK-NEXT: - Index: 3
179; CHECK-NEXT: Kind: FUNCTION
180; CHECK-NEXT: Name: my_func
181; CHECK-NEXT: Flags: [ VISIBILITY_HIDDEN ]
182; CHECK-NEXT: Function: 4
183; CHECK-NEXT: - Index: 4
184; CHECK-NEXT: Kind: FUNCTION
185; CHECK-NEXT: Name: foo_import
186; CHECK-NEXT: Flags: [ UNDEFINED ]
187; CHECK-NEXT: Function: 1
188; CHECK-NEXT: - Index: 5
189; CHECK-NEXT: Kind: FUNCTION
190; CHECK-NEXT: Name: bar_import
191; CHECK-NEXT: Flags: [ BINDING_WEAK, UNDEFINED ]
192; CHECK-NEXT: Function: 2
193; CHECK-NEXT: - Index: 6
194; CHECK-NEXT: Kind: FUNCTION
195; CHECK-NEXT: Name: func_comdat
196; CHECK-NEXT: Flags: [ BINDING_WEAK ]
197; CHECK-NEXT: Function: 5
198; CHECK-NEXT: - Index: 7
199; CHECK-NEXT: Kind: DATA
200; CHECK-NEXT: Name: data_comdat
201; CHECK-NEXT: Flags: [ BINDING_WEAK ]
202; CHECK-NEXT: Segment: 5
203; CHECK-NEXT: Size: 3
204; CHECK-NEXT: - Index: 8
205; CHECK-NEXT: Kind: DATA
206; CHECK-NEXT: Name: func_addr1
207; CHECK-NEXT: Flags: [ VISIBILITY_HIDDEN ]
208; CHECK-NEXT: Segment: 1
209; CHECK-NEXT: Size: 4
210; CHECK-NEXT: - Index: 9
211; CHECK-NEXT: Kind: DATA
212; CHECK-NEXT: Name: func_addr2
213; CHECK-NEXT: Flags: [ VISIBILITY_HIDDEN ]
214; CHECK-NEXT: Segment: 2
215; CHECK-NEXT: Size: 4
216; CHECK-NEXT: - Index: 10
217; CHECK-NEXT: Kind: DATA
218; CHECK-NEXT: Name: func_addr3
219; CHECK-NEXT: Flags: [ VISIBILITY_HIDDEN ]
220; CHECK-NEXT: Segment: 3
221; CHECK-NEXT: Size: 4
222; CHECK-NEXT: - Index: 11
223; CHECK-NEXT: Kind: DATA
224; CHECK-NEXT: Name: data_addr1
225; CHECK-NEXT: Flags: [ VISIBILITY_HIDDEN ]
226; CHECK-NEXT: Segment: 4
227; CHECK-NEXT: Size: 4
228; CHECK-NEXT: - Index: 12
229; CHECK-NEXT: Kind: DATA
230; CHECK-NEXT: Name: data_import
231; CHECK-NEXT: Flags: [ UNDEFINED ]
232; CHECK-NEXT: SegmentInfo:
233; CHECK-NEXT: - Index: 0
234; CHECK-NEXT: Name: .rodata.hello_str
235; CHECK-NEXT: Alignment: 0
236; CHECK-NEXT: Flags: [ ]
237; CHECK-NEXT: - Index: 1
238; CHECK-NEXT: Name: .data.func_addr1
239; CHECK-NEXT: Alignment: 2
240; CHECK-NEXT: Flags: [ ]
241; CHECK-NEXT: - Index: 2
242; CHECK-NEXT: Name: .data.func_addr2
243; CHECK-NEXT: Alignment: 2
244; CHECK-NEXT: Flags: [ ]
245; CHECK-NEXT: - Index: 3
246; CHECK-NEXT: Name: .data.func_addr3
247; CHECK-NEXT: Alignment: 2
248; CHECK-NEXT: Flags: [ ]
249; CHECK-NEXT: - Index: 4
250; CHECK-NEXT: Name: .data.data_addr1
251; CHECK-NEXT: Alignment: 3
252; CHECK-NEXT: Flags: [ ]
253; CHECK-NEXT: - Index: 5
254; CHECK-NEXT: Name: .rodata.data_comdat
255; CHECK-NEXT: Alignment: 0
256; CHECK-NEXT: Flags: [ ]
257; CHECK-NEXT: Comdats:
258; CHECK-NEXT: - Name: func_comdat
259; CHECK-NEXT: Entries:
260; CHECK-NEXT: - Kind: FUNCTION
261; CHECK-NEXT: Index: 5
262; CHECK-NEXT: - Kind: DATA
263; CHECK-NEXT: Index: 5
264; CHECK-NEXT: - Type: CUSTOM
265; CHECK-NEXT: Name: name
266; CHECK-NEXT: FunctionNames:
267; CHECK-NEXT: - Index: 0
268; CHECK-NEXT: Name: puts
269; CHECK-NEXT: - Index: 1
270; CHECK-NEXT: Name: foo_import
271; CHECK-NEXT: - Index: 2
272; CHECK-NEXT: Name: bar_import
273; CHECK-NEXT: - Index: 3
274; CHECK-NEXT: Name: hello
275; CHECK-NEXT: - Index: 4
276; CHECK-NEXT: Name: my_func
277; CHECK-NEXT: - Index: 5
278; CHECK-NEXT: Name: func_comdat
279; CHECK-NEXT: ...
117; NORMAL-NEXT: - Type: DATA
118; NORMAL-NEXT: Relocations:
119; NORMAL-NEXT: - Type: R_WASM_TABLE_INDEX_I32
120; NORMAL-NEXT: Index: 3
121; NORMAL-NEXT: Offset: 0x00000012
122; NORMAL-NEXT: - Type: R_WASM_TABLE_INDEX_I32
123; NORMAL-NEXT: Index: 4
124; NORMAL-NEXT: Offset: 0x0000001B
125; NORMAL-NEXT: - Type: R_WASM_TABLE_INDEX_I32
126; NORMAL-NEXT: Index: 5
127; NORMAL-NEXT: Offset: 0x00000024
128; NORMAL-NEXT: - Type: R_WASM_MEMORY_ADDR_I32
129; NORMAL-NEXT: Index: 12
130; NORMAL-NEXT: Offset: 0x0000002D
131; NORMAL-NEXT: Segments:
132; NORMAL-NEXT: - SectionOffset: 6
133; NORMAL-NEXT: InitFlags: 0
134; NORMAL-NEXT: Offset:
135; NORMAL-NEXT: Opcode: I32_CONST
136; NORMAL-NEXT: Value: 0
137; NORMAL-NEXT: Content: 68656C6C6F0A00
138; NORMAL-NEXT: - SectionOffset: 18
139; NORMAL-NEXT: InitFlags: 0
140; NORMAL-NEXT: Offset:
141; NORMAL-NEXT: Opcode: I32_CONST
142; NORMAL-NEXT: Value: 8
143; NORMAL-NEXT: Content: '01000000'
144; NORMAL-NEXT: - SectionOffset: 27
145; NORMAL-NEXT: InitFlags: 0
146; NORMAL-NEXT: Offset:
147; NORMAL-NEXT: Opcode: I32_CONST
148; NORMAL-NEXT: Value: 12
149; NORMAL-NEXT: Content: '02000000'
150; NORMAL-NEXT: - SectionOffset: 36
151; NORMAL-NEXT: InitFlags: 0
152; NORMAL-NEXT: Offset:
153; NORMAL-NEXT: Opcode: I32_CONST
154; NORMAL-NEXT: Value: 16
155; NORMAL-NEXT: Content: '03000000'
156; NORMAL-NEXT: - SectionOffset: 45
157; NORMAL-NEXT: InitFlags: 0
158; NORMAL-NEXT: Offset:
159; NORMAL-NEXT: Opcode: I32_CONST
160; NORMAL-NEXT: Value: 24
161; NORMAL-NEXT: Content: '00000000'
162; NORMAL-NEXT: - SectionOffset: 54
163; NORMAL-NEXT: InitFlags: 0
164; NORMAL-NEXT: Offset:
165; NORMAL-NEXT: Opcode: I32_CONST
166; NORMAL-NEXT: Value: 28
167; NORMAL-NEXT: Content: '616263'
168; NORMAL-NEXT: - Type: CUSTOM
169; NORMAL-NEXT: Name: linking
170; NORMAL-NEXT: Version: 2
171; NORMAL-NEXT: SymbolTable:
172; NORMAL-NEXT: - Index: 0
173; NORMAL-NEXT: Kind: FUNCTION
174; NORMAL-NEXT: Name: hello
175; NORMAL-NEXT: Flags: [ VISIBILITY_HIDDEN ]
176; NORMAL-NEXT: Function: 3
177; NORMAL-NEXT: - Index: 1
178; NORMAL-NEXT: Kind: DATA
179; NORMAL-NEXT: Name: hello_str
180; NORMAL-NEXT: Flags: [ ]
181; NORMAL-NEXT: Segment: 0
182; NORMAL-NEXT: Size: 7
183; NORMAL-NEXT: - Index: 2
184; NORMAL-NEXT: Kind: FUNCTION
185; NORMAL-NEXT: Name: puts
186; NORMAL-NEXT: Flags: [ UNDEFINED ]
187; NORMAL-NEXT: Function: 0
188; NORMAL-NEXT: - Index: 3
189; NORMAL-NEXT: Kind: FUNCTION
190; NORMAL-NEXT: Name: my_func
191; NORMAL-NEXT: Flags: [ VISIBILITY_HIDDEN ]
192; NORMAL-NEXT: Function: 4
193; NORMAL-NEXT: - Index: 4
194; NORMAL-NEXT: Kind: FUNCTION
195; NORMAL-NEXT: Name: foo_import
196; NORMAL-NEXT: Flags: [ UNDEFINED ]
197; NORMAL-NEXT: Function: 1
198; NORMAL-NEXT: - Index: 5
199; NORMAL-NEXT: Kind: FUNCTION
200; NORMAL-NEXT: Name: bar_import
201; NORMAL-NEXT: Flags: [ BINDING_WEAK, UNDEFINED ]
202; NORMAL-NEXT: Function: 2
203; NORMAL-NEXT: - Index: 6
204; NORMAL-NEXT: Kind: FUNCTION
205; NORMAL-NEXT: Name: func_comdat
206; NORMAL-NEXT: Flags: [ BINDING_WEAK ]
207; NORMAL-NEXT: Function: 5
208; NORMAL-NEXT: - Index: 7
209; NORMAL-NEXT: Kind: DATA
210; NORMAL-NEXT: Name: data_comdat
211; NORMAL-NEXT: Flags: [ BINDING_WEAK ]
212; NORMAL-NEXT: Segment: 5
213; NORMAL-NEXT: Size: 3
214; NORMAL-NEXT: - Index: 8
215; NORMAL-NEXT: Kind: DATA
216; NORMAL-NEXT: Name: func_addr1
217; NORMAL-NEXT: Flags: [ VISIBILITY_HIDDEN ]
218; NORMAL-NEXT: Segment: 1
219; NORMAL-NEXT: Size: 4
220; NORMAL-NEXT: - Index: 9
221; NORMAL-NEXT: Kind: DATA
222; NORMAL-NEXT: Name: func_addr2
223; NORMAL-NEXT: Flags: [ VISIBILITY_HIDDEN ]
224; NORMAL-NEXT: Segment: 2
225; NORMAL-NEXT: Size: 4
226; NORMAL-NEXT: - Index: 10
227; NORMAL-NEXT: Kind: DATA
228; NORMAL-NEXT: Name: func_addr3
229; NORMAL-NEXT: Flags: [ VISIBILITY_HIDDEN ]
230; NORMAL-NEXT: Segment: 3
231; NORMAL-NEXT: Size: 4
232; NORMAL-NEXT: - Index: 11
233; NORMAL-NEXT: Kind: DATA
234; NORMAL-NEXT: Name: data_addr1
235; NORMAL-NEXT: Flags: [ VISIBILITY_HIDDEN ]
236; NORMAL-NEXT: Segment: 4
237; NORMAL-NEXT: Size: 4
238; NORMAL-NEXT: - Index: 12
239; NORMAL-NEXT: Kind: DATA
240; NORMAL-NEXT: Name: data_import
241; NORMAL-NEXT: Flags: [ UNDEFINED ]
242; NORMAL-NEXT: SegmentInfo:
243; NORMAL-NEXT: - Index: 0
244; NORMAL-NEXT: Name: .rodata.hello_str
245; NORMAL-NEXT: Alignment: 0
246; NORMAL-NEXT: Flags: [ ]
247; NORMAL-NEXT: - Index: 1
248; NORMAL-NEXT: Name: .data.func_addr1
249; NORMAL-NEXT: Alignment: 2
250; NORMAL-NEXT: Flags: [ ]
251; NORMAL-NEXT: - Index: 2
252; NORMAL-NEXT: Name: .data.func_addr2
253; NORMAL-NEXT: Alignment: 2
254; NORMAL-NEXT: Flags: [ ]
255; NORMAL-NEXT: - Index: 3
256; NORMAL-NEXT: Name: .data.func_addr3
257; NORMAL-NEXT: Alignment: 2
258; NORMAL-NEXT: Flags: [ ]
259; NORMAL-NEXT: - Index: 4
260; NORMAL-NEXT: Name: .data.data_addr1
261; NORMAL-NEXT: Alignment: 3
262; NORMAL-NEXT: Flags: [ ]
263; NORMAL-NEXT: - Index: 5
264; NORMAL-NEXT: Name: .rodata.data_comdat
265; NORMAL-NEXT: Alignment: 0
266; NORMAL-NEXT: Flags: [ ]
267; NORMAL-NEXT: Comdats:
268; NORMAL-NEXT: - Name: func_comdat
269; NORMAL-NEXT: Entries:
270; NORMAL-NEXT: - Kind: FUNCTION
271; NORMAL-NEXT: Index: 5
272; NORMAL-NEXT: - Kind: DATA
273; NORMAL-NEXT: Index: 5
274; NORMAL-NEXT: - Type: CUSTOM
275; NORMAL-NEXT: Name: name
276; NORMAL-NEXT: FunctionNames:
277; NORMAL-NEXT: - Index: 0
278; NORMAL-NEXT: Name: puts
279; NORMAL-NEXT: - Index: 1
280; NORMAL-NEXT: Name: foo_import
281; NORMAL-NEXT: - Index: 2
282; NORMAL-NEXT: Name: bar_import
283; NORMAL-NEXT: - Index: 3
284; NORMAL-NEXT: Name: hello
285; NORMAL-NEXT: - Index: 4
286; NORMAL-NEXT: Name: my_func
287; NORMAL-NEXT: - Index: 5
288; NORMAL-NEXT: Name: func_comdat
289; NORMAL-NEXT:...
deps/lld/wasm/Writer.cpp+1-1
......@@ -898,7 +898,7 @@ void Writer::run() {
898898 createCallCtorsFunction();
899899 }
900900
901 if (config->sharedMemory && !config->shared)
901 if (!config->relocatable && config->sharedMemory && !config->shared)
902902 createInitTLSFunction();
903903
904904 if (errorCount())