Skip to content

Commit b24f4fa

Browse files
author
Alex B
committed
Fix high memory usage due to strings
1 parent c6f0916 commit b24f4fa

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

lld/test/MachO/arm64-thunks.s

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,7 @@
1717
# RUN: %lld -arch arm64 -dead_strip -lSystem -U _extern_sym -map %t/thunk.map -o %t/thunk %t/input.o
1818
# RUN: llvm-objdump --no-print-imm-hex -d --no-show-raw-insn %t/thunk | FileCheck %s
1919

20-
## Check that the thunks appear in the map file and that everything is sorted by address
21-
# Because of the `.space` instructions, there will end up being a lot of dead symbols in the
22-
# linker map (linker map will be ~2.7GB). So to avoid the test trying to (slowly) match regex
23-
# across all the ~2.7GB of the linker map - generate a version of the linker map without dead symbols.
24-
# RUN: awk '/# Dead Stripped Symbols:/ {exit} {print}' %t/thunk.map > %t/thunk_no_dead_syms.map
25-
26-
# RUN: FileCheck %s --input-file %t/thunk_no_dead_syms.map --check-prefix=MAP
20+
# RUN: FileCheck %s --input-file %t/thunk.map --check-prefix=MAP
2721

2822
# MAP: 0x{{[[:xdigit:]]+}} {{.*}} _b
2923
# MAP-NEXT: 0x{{[[:xdigit:]]+}} {{.*}} _c
@@ -339,7 +333,11 @@ _main:
339333
ret
340334

341335
.section __TEXT,__cstring
342-
.space 0x4000000
336+
# The .space below has to be composed of non-zero characters. Otherwise, the
337+
# linker will create a symbol for every '0' in the section, leading to
338+
# dramatic memory usage and a huge linker map file
339+
.space 0x4000000, 'A'
340+
343341

344342
.section __TEXT,__lcxx_override,regular,pure_instructions
345343

0 commit comments

Comments
 (0)