Skip to content

Commit 4980eea

Browse files
committed
Revert "[RFC][MC][MachO]Only emits compact-unwind format for "canonical" personality symbols. For the rest, use DWARFs."
This reverts commit 09aaf53. Causes toolchain asserts building libc++ for x86_64, see https://reviews.llvm.org/D144999#4356215
1 parent 62eecbc commit 4980eea

38 files changed

+59
-232
lines changed

clang/include/clang/Basic/CodeGenOptions.def

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,6 @@ CODEGENOPT(StackSizeSection , 1, 0) ///< Set when -fstack-size-section is enabl
114114
CODEGENOPT(ForceDwarfFrameSection , 1, 0) ///< Set when -fforce-dwarf-frame is
115115
///< enabled.
116116

117-
///< Set when -femit-compact-unwind-non-canonical is enabled.
118-
CODEGENOPT(EmitCompactUnwindNonCanonical, 1, 0)
119-
120117
///< Set when -femit-dwarf-unwind is passed.
121118
ENUM_CODEGENOPT(EmitDwarfUnwind, llvm::EmitDwarfUnwindType, 2,
122119
llvm::EmitDwarfUnwindType::Default)

clang/include/clang/Driver/Options.td

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3249,9 +3249,6 @@ def femit_dwarf_unwind_EQ : Joined<["-"], "femit-dwarf-unwind=">,
32493249
NormalizedValues<["Always", "NoCompactUnwind", "Default"]>,
32503250
NormalizedValuesScope<"llvm::EmitDwarfUnwindType">,
32513251
MarshallingInfoEnum<CodeGenOpts<"EmitDwarfUnwind">, "Default">;
3252-
defm emit_compact_unwind_non_canonical : BoolFOption<"emit-compact-unwind-non-canonical",
3253-
CodeGenOpts<"EmitCompactUnwindNonCanonical">, DefaultFalse,
3254-
PosFlag<SetTrue, [CC1Option, CC1AsOption], "Try emitting Compact-Unwind for non-canonical entries. Maybe overriden by other constraints">, NegFlag<SetFalse>>;
32553252
def g_Flag : Flag<["-"], "g">, Group<g_Group>,
32563253
Flags<[CoreOption,FlangOption]>, HelpText<"Generate source-level debug information">;
32573254
def gline_tables_only : Flag<["-"], "gline-tables-only">, Group<gN_Group>,

clang/lib/CodeGen/BackendUtil.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -454,8 +454,6 @@ static bool initTargetOptions(DiagnosticsEngine &Diags,
454454

455455
Options.MCOptions.SplitDwarfFile = CodeGenOpts.SplitDwarfFile;
456456
Options.MCOptions.EmitDwarfUnwind = CodeGenOpts.getEmitDwarfUnwind();
457-
Options.MCOptions.EmitCompactUnwindNonCanonical =
458-
CodeGenOpts.EmitCompactUnwindNonCanonical;
459457
Options.MCOptions.MCRelaxAll = CodeGenOpts.RelaxAll;
460458
Options.MCOptions.MCSaveTempLabels = CodeGenOpts.SaveTempLabels;
461459
Options.MCOptions.MCUseDwarfDirectory =

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2511,9 +2511,6 @@ static void CollectArgsForIntegratedAssembler(Compilation &C,
25112511

25122512
Args.AddLastArg(CmdArgs, options::OPT_femit_dwarf_unwind_EQ);
25132513

2514-
Args.addOptInFlag(CmdArgs, options::OPT_femit_compact_unwind_non_canonical,
2515-
options::OPT_fno_emit_compact_unwind_non_canonical);
2516-
25172514
// If you add more args here, also add them to the block below that
25182515
// starts with "// If CollectArgsForIntegratedAssembler() isn't called below".
25192516

clang/test/Driver/femit-dwarf-unwind.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// REQUIRES: x86-registered-target
22

33
// RUN: rm -rf %t; mkdir %t
4-
// RUN: %clang -target x86_64-apple-macos11.0 -c %s -o %t/x86_64.o -femit-compact-unwind-non-canonical
5-
// RUN: %clang -target x86_64-apple-macos11.0 -femit-dwarf-unwind=no-compact-unwind -femit-compact-unwind-non-canonical -c %s -o %t/x86_64-no-dwarf.o
4+
// RUN: %clang -target x86_64-apple-macos11.0 -c %s -o %t/x86_64.o
5+
// RUN: %clang -target x86_64-apple-macos11.0 -femit-dwarf-unwind=no-compact-unwind -c %s -o %t/x86_64-no-dwarf.o
66
// RUN: llvm-objdump --macho --dwarf=frames %t/x86_64.o | FileCheck %s --check-prefix=WITH-FDE
77
// RUN: llvm-objdump --macho --dwarf=frames %t/x86_64-no-dwarf.o | FileCheck %s --check-prefix=NO-FDE
88

clang/test/Driver/femit-dwarf-unwind.s

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// REQUIRES: x86-registered-target
22

33
// RUN: rm -rf %t; mkdir %t
4-
// RUN: %clang -target x86_64-apple-macos11.0 -c %s -o %t/x86_64.o -femit-compact-unwind-non-canonical
5-
// RUN: %clang -target x86_64-apple-macos11.0 -femit-dwarf-unwind=no-compact-unwind -c %s -o %t/x86_64-no-dwarf.o -femit-compact-unwind-non-canonical
4+
// RUN: %clang -target x86_64-apple-macos11.0 -c %s -o %t/x86_64.o
5+
// RUN: %clang -target x86_64-apple-macos11.0 -femit-dwarf-unwind=no-compact-unwind -c %s -o %t/x86_64-no-dwarf.o
66
// RUN: llvm-objdump --macho --dwarf=frames %t/x86_64.o | FileCheck %s --check-prefix=WITH-FDE
77
// RUN: llvm-objdump --macho --dwarf=frames %t/x86_64-no-dwarf.o | FileCheck %s --check-prefix=NO-FDE
88

clang/tools/driver/cc1as_main.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,6 @@ struct AssemblerInvocation {
142142
/// Whether to emit DWARF unwind info.
143143
EmitDwarfUnwindType EmitDwarfUnwind;
144144

145-
// Whether to emit compact-unwind for non-canonical entries.
146-
// Note: maybe overriden by other constraints.
147-
unsigned EmitCompactUnwindNonCanonical : 1;
148-
149145
/// The name of the relocation model to use.
150146
std::string RelocationModel;
151147

@@ -185,7 +181,6 @@ struct AssemblerInvocation {
185181
DwarfVersion = 0;
186182
EmbedBitcode = 0;
187183
EmitDwarfUnwind = EmitDwarfUnwindType::Default;
188-
EmitCompactUnwindNonCanonical = false;
189184
}
190185

191186
static bool CreateFromArgs(AssemblerInvocation &Res,
@@ -353,9 +348,6 @@ bool AssemblerInvocation::CreateFromArgs(AssemblerInvocation &Opts,
353348
.Case("default", EmitDwarfUnwindType::Default);
354349
}
355350

356-
Opts.EmitCompactUnwindNonCanonical =
357-
Args.hasArg(OPT_femit_compact_unwind_non_canonical);
358-
359351
Opts.AsSecureLogFile = Args.getLastArgValue(OPT_as_secure_log_file);
360352

361353
return Success;
@@ -409,7 +401,6 @@ static bool ExecuteAssemblerImpl(AssemblerInvocation &Opts,
409401

410402
MCTargetOptions MCOptions;
411403
MCOptions.EmitDwarfUnwind = Opts.EmitDwarfUnwind;
412-
MCOptions.EmitCompactUnwindNonCanonical = Opts.EmitCompactUnwindNonCanonical;
413404
MCOptions.AsSecureLogFile = Opts.AsSecureLogFile;
414405

415406
std::unique_ptr<MCAsmInfo> MAI(

lld/MachO/UnwindInfoSection.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -343,8 +343,7 @@ void UnwindInfoSectionImpl::relocateCompactUnwind(
343343
if (!d->unwindEntry)
344344
return;
345345

346-
// If we have DWARF unwind info, create a slimmed-down CU entry that points
347-
// to it.
346+
// If we have DWARF unwind info, create a CU entry that points to it.
348347
if (d->unwindEntry->getName() == section_names::ehFrame) {
349348
// The unwinder will look for the DWARF entry starting at the hint,
350349
// assuming the hint points to a valid CFI record start. If it
@@ -361,9 +360,7 @@ void UnwindInfoSectionImpl::relocateCompactUnwind(
361360
cu.encoding = target->modeDwarfEncoding | dwarfOffsetHint;
362361
const FDE &fde = cast<ObjFile>(d->getFile())->fdes[d->unwindEntry];
363362
cu.functionLength = fde.funcLength;
364-
// Omit the DWARF personality from compact-unwind entry so that we
365-
// don't need to encode it.
366-
cu.personality = nullptr;
363+
cu.personality = fde.personality;
367364
cu.lsda = fde.lsda;
368365
return;
369366
}
0 Bytes
Binary file not shown.

lld/test/MachO/compact-unwind-both-local-and-dylib-personality.s

Lines changed: 2 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,8 @@
33

44
# REQUIRES: x86
55
# RUN: rm -rf %t; split-file %s %t
6-
# RUN: llvm-mc -emit-compact-unwind-non-canonical=true -filetype=obj -triple=x86_64-apple-darwin19.0.0 %t/user_2.s -o %t/user_2.o
7-
# RUN: llvm-mc -emit-compact-unwind-non-canonical=true -filetype=obj -triple=x86_64-apple-darwin19.0.0 %t/user_3.s -o %t/user_3.o
8-
9-
## Test case for linking 3+ personaltiies (all globals) without crashing because all the non-canonical are DWARFs
10-
# RUN: llvm-mc -emit-compact-unwind-non-canonical=false -filetype=obj -triple=x86_64-apple-darwin19.0.0 %t/user_4.s -o %t/user_4.o
11-
6+
# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin19.0.0 %t/user_2.s -o %t/user_2.o
7+
# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin19.0.0 %t/user_3.s -o %t/user_3.o
128
# RUN: yaml2obj %t/combined.yaml > %t/combined.o
139

1410
## Pre-condition: check that ___gxx_personality_v0 really is locally defined in combined.o before we proceed.
@@ -25,12 +21,6 @@
2521
## ___gxx_personality_v0 (global), ___gxx_personality_v0(local), _personality_1, and _personality_2
2622
# RUN: %lld -lSystem -dylib %t/user_3.o %t/combined.o %t/user_2.o -o %t/c.out
2723

28-
## check that we can link with 3+ personalities without crashing because
29-
## non-canonical personalities are dwarf.
30-
## This has ___gxx_personality_v0(global), ___gxx_personality_v0(local), and _personality_{1,2,3,4}
31-
## Only the ___gxx_personality_v0(global) should have compact-unwind. The rest should have DWARFs.
32-
# RUN: %lld -lSystem -lc++ %t/user_4.o %t/combined.o -o %t/d.out
33-
3424
## Postlink checks.
3525
# RUN: llvm-nm %t/a.out | FileCheck %s --check-prefix=POSTCHECK
3626
# POSTCHECK: {{.*}} U ___gxx_personality_v0
@@ -40,8 +30,6 @@
4030
# RUN: llvm-objdump --macho --unwind-info --syms --indirect-symbols --bind %t/b.out | FileCheck %s --check-prefixes=BC,CHECK -D#%x,OFF=0x100000000
4131
# RUN: llvm-objdump --macho --unwind-info --syms --indirect-symbols --bind %t/c.out | FileCheck %s --check-prefixes=BC,C,CHECK -D#%x,OFF=0
4232

43-
# RUN: llvm-objdump --macho --indirect-symbols --unwind-info --bind %t/d.out | FileCheck %s --check-prefixes=D -D#%x,OFF=0x100000000
44-
4533
# A: Indirect symbols for (__DATA_CONST,__got)
4634
# A-NEXT: address index name
4735
# A: 0x[[#%x,GXX_PERSONALITY_LO:]] [[#]] ___gxx_personality_v0
@@ -65,80 +53,11 @@
6553
# A-NEXT: segment section address type addend dylib symbol
6654
# A-NEXT: __DATA_CONST __got 0x[[#GXX_PERSONALITY_LO-0]] pointer 0 libc++abi ___gxx_personality_v0
6755

68-
69-
# D: Indirect symbols for (__DATA_CONST,__got)
70-
# D-NEXT: address index name
71-
# D: 0x[[#%x,GXX_PERSONALITY_HI:]] [[#]] ___gxx_personality_v0
72-
# D: 0x[[#%x,PERSONALITY_1:]] [[#]] _personality_1
73-
# D: 0x[[#%x,PERSONALITY_2:]] [[#]] _personality_2
74-
# D: 0x[[#%x,PERSONALITY_3:]] [[#]] _personality_3
75-
# D: 0x[[#%x,PERSONALITY_4:]] [[#]] _personality_4
76-
# D: 0x[[#%x,GXX_PERSONALITY_LO:]] [[#]] ___gxx_personality_v0
77-
78-
# D: Contents of __unwind_info section:
79-
# D: Personality functions: (count = 1)
80-
personality[1]: 0x{{0*}}[[#GXX_PERSONALITY_HI-OFF]]
81-
82-
# D: Bind table:
83-
# D: segment section address type addend dylib symbol
84-
# D: __DATA_CONST __got 0x[[#GXX_PERSONALITY_HI-0]] pointer 0 libc++abi ___gxx_personality_v0
85-
86-
8756
## Error cases.
8857
## Check that dylib symbols are picked (which means without libc++, we'd get an undefined symbol error.
8958
# RUN: not %lld -lSystem %t/user_2.o %t/combined.o -o /dev/null 2>&1 | FileCheck %s --check-prefix=ERRORCHECK
9059
# ERRORCHECK: {{.*}} undefined symbol: ___gxx_personality_v0
9160

92-
#--- user_4.s
93-
.globl _main, _personality_1, _personality_2, _personality_3, _personality_4
94-
95-
.text
96-
97-
_baz1:
98-
.cfi_startproc
99-
.cfi_personality 155, _personality_1
100-
.cfi_def_cfa_offset 16
101-
retq
102-
.cfi_endproc
103-
104-
_baz2:
105-
.cfi_startproc
106-
.cfi_personality 155, _personality_2
107-
.cfi_def_cfa_offset 16
108-
retq
109-
.cfi_endproc
110-
111-
_baz3:
112-
.cfi_startproc
113-
.cfi_personality 155, _personality_3
114-
.cfi_def_cfa_offset 16
115-
retq
116-
.cfi_endproc
117-
118-
119-
_baz4:
120-
.cfi_startproc
121-
.cfi_personality 155, _personality_4
122-
.cfi_def_cfa_offset 16
123-
retq
124-
.cfi_endproc
125-
126-
_main:
127-
.cfi_startproc
128-
.cfi_personality 155, ___gxx_personality_v0
129-
.cfi_def_cfa_offset 16
130-
retq
131-
.cfi_endproc
132-
133-
_personality_1:
134-
retq
135-
_personality_2:
136-
retq
137-
_personality_3:
138-
retq
139-
_personality_4:
140-
retq
141-
14261
#--- user_3.s
14362
.globl _baz3
14463
.private_extern ___gxx_personality_v0

lld/test/MachO/compact-unwind-generated.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# those from the linked output
1616

1717
# RUN: %python %S/tools/generate-cfi-funcs.py --seed=johnnyapple >%t.s
18-
# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin19.0.0 -emit-compact-unwind-non-canonical=true -o %t.o %t.s
18+
# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin19.0.0 -o %t.o %t.s
1919
# RUN: %lld -Z -L%S/Inputs/MacOSX.sdk/usr/lib -lSystem -o %t %t.o
2020
# RUN: llvm-objdump --unwind-info --syms %t %t.o >%t.dump
2121
# RUN: %python %S/tools/validate-unwind-info.py %t.dump

lld/test/MachO/compact-unwind-lsda-folding.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# REQUIRES: x86
66
# RUN: rm -rf %t; mkdir %t
7-
# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos11.0 -emit-compact-unwind-non-canonical=true -o %t/lsda.o %s
7+
# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos11.0 -o %t/lsda.o %s
88
# RUN: %lld -dylib --icf=all -lSystem -lc++ -o %t/liblsda.dylib %t/lsda.o
99
# RUN: llvm-objdump --macho --syms --unwind-info %t/liblsda.dylib | FileCheck %s
1010

lld/test/MachO/compact-unwind-stack-ind.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# REQUIRES: x86
2-
# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin19.0.0 -emit-compact-unwind-non-canonical=true %s -o %t.o
2+
# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin19.0.0 %s -o %t.o
33
# RUN: %lld -arch x86_64 -dylib %t.o -o %t.dylib
44
# RUN: llvm-objdump --macho --syms --unwind-info %t.dylib | FileCheck %s
55

lld/test/MachO/compact-unwind.s

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
# REQUIRES: x86, aarch64
22
# RUN: rm -rf %t; split-file %s %t
3-
# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin19.0.0 -emit-compact-unwind-non-canonical=true %t/my-personality.s -o %t/x86_64-my-personality.o
4-
# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin19.0.0 -emit-compact-unwind-non-canonical=true %t/main.s -o %t/x86_64-main.o
3+
# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin19.0.0 %t/my-personality.s -o %t/x86_64-my-personality.o
4+
# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin19.0.0 %t/main.s -o %t/x86_64-main.o
55
# RUN: %lld -arch x86_64 -lSystem -lc++ %t/x86_64-my-personality.o %t/x86_64-main.o -o %t/x86_64-personality-first
66
# RUN: llvm-objdump --macho --unwind-info --syms --indirect-symbols --rebase %t/x86_64-personality-first | FileCheck %s --check-prefixes=FIRST,CHECK -D#%x,BASE=0x100000000 -DSEG=__TEXT
77
# RUN: %lld -dead_strip -arch x86_64 -lSystem -lc++ %t/x86_64-main.o %t/x86_64-my-personality.o -o %t/x86_64-personality-second
88
# RUN: llvm-objdump --macho --unwind-info --syms --indirect-symbols --rebase %t/x86_64-personality-second | FileCheck %s --check-prefixes=SECOND,CHECK -D#%x,BASE=0x100000000 -DSEG=__TEXT
99

10-
# RUN: llvm-mc -filetype=obj -triple=arm64-apple-darwin19.0.0 -emit-compact-unwind-non-canonical=true %t/my-personality.s -o %t/arm64-my-personality.o
11-
# RUN: llvm-mc -filetype=obj -triple=arm64-apple-darwin19.0.0 -emit-compact-unwind-non-canonical=true %t/main.s -o %t/arm64-main.o
10+
# RUN: llvm-mc -filetype=obj -triple=arm64-apple-darwin19.0.0 %t/my-personality.s -o %t/arm64-my-personality.o
11+
# RUN: llvm-mc -filetype=obj -triple=arm64-apple-darwin19.0.0 %t/main.s -o %t/arm64-main.o
1212
# RUN: %lld -arch arm64 -lSystem -lc++ %t/arm64-my-personality.o %t/arm64-main.o -o %t/arm64-personality-first
1313
# RUN: llvm-objdump --macho --unwind-info --syms --indirect-symbols --rebase %t/arm64-personality-first | FileCheck %s --check-prefixes=FIRST,CHECK -D#%x,BASE=0x100000000 -DSEG=__TEXT
1414
# RUN: %lld -dead_strip -arch arm64 -lSystem -lc++ %t/arm64-main.o %t/arm64-my-personality.o -o %t/arm64-personality-second
1515
# RUN: llvm-objdump --macho --unwind-info --syms --indirect-symbols --rebase %t/arm64-personality-second | FileCheck %s --check-prefixes=SECOND,CHECK -D#%x,BASE=0x100000000 -DSEG=__TEXT
1616

17-
# RUN: llvm-mc -filetype=obj -triple=arm64_32-apple-watchos -emit-compact-unwind-non-canonical=true %t/my-personality.s -o %t/arm64-32-my-personality.o
18-
# RUN: llvm-mc -filetype=obj -triple=arm64_32-apple-watchos -emit-compact-unwind-non-canonical=true %t/main.s -o %t/arm64-32-main.o
17+
# RUN: llvm-mc -filetype=obj -triple=arm64_32-apple-watchos %t/my-personality.s -o %t/arm64-32-my-personality.o
18+
# RUN: llvm-mc -filetype=obj -triple=arm64_32-apple-watchos %t/main.s -o %t/arm64-32-main.o
1919
# RUN: %lld-watchos -lSystem -lc++ %t/arm64-32-my-personality.o %t/arm64-32-main.o -o %t/arm64-32-personality-first
2020
# RUN: llvm-objdump --macho --unwind-info --syms --indirect-symbols --rebase %t/arm64-32-personality-first | FileCheck %s --check-prefixes=FIRST,CHECK -D#%x,BASE=0x4000 -DSEG=__TEXT
2121
# RUN: %lld-watchos -dead_strip -lSystem -lc++ %t/arm64-32-main.o %t/arm64-32-my-personality.o -o %t/arm64-32-personality-second

lld/test/MachO/eh-frame-personality-dedup.s

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# REQUIRES: x86
22
# RUN: rm -rf %t; split-file %s %t
3-
# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin19.0.0 -emit-compact-unwind-non-canonical=true %t/eh-frame.s -o %t/eh-frame.o
4-
# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin19.0.0 -emit-compact-unwind-non-canonical=true %t/cu.s -o %t/cu.o
3+
# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin19.0.0 %t/eh-frame.s -o %t/eh-frame.o
4+
# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin19.0.0 %t/cu.s -o %t/cu.o
55
# RUN: %lld -dylib %t/cu.o %t/eh-frame.o -o %t/out
66

77
## Sanity check: we want our input to contain a section (and not symbol)

lld/test/MachO/eh-frame.s

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# REQUIRES: x86, aarch64
22
# RUN: rm -rf %t; mkdir %t
33

4-
# RUN: llvm-mc -emit-compact-unwind-non-canonical=true -filetype=obj -triple=x86_64-apple-macos10.15 %s -o %t/eh-frame-x86_64.o
4+
# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos10.15 %s -o %t/eh-frame-x86_64.o
55
# RUN: %lld -lSystem -lc++ %t/eh-frame-x86_64.o -o %t/eh-frame-x86_64
66
# RUN: llvm-objdump --macho --syms --indirect-symbols --unwind-info \
77
# RUN: --dwarf=frames %t/eh-frame-x86_64 | FileCheck %s -D#BASE=0x100000000 -D#DWARF_ENC=4
@@ -20,7 +20,7 @@
2020
# RUN: llvm-nm -m %t/eh-frame-x86_64-r | FileCheck %s --check-prefix NO-EH-SYMS
2121
# RUN: llvm-readobj --section-headers %t/eh-frame-x86_64-r | FileCheck %s --check-prefix=ALIGN -D#ALIGN=3
2222

23-
# RUN: llvm-mc -filetype=obj -emit-compact-unwind-non-canonical=true -triple=arm64-apple-macos11.0 %s -o %t/eh-frame-arm64.o
23+
# RUN: llvm-mc -filetype=obj -triple=arm64-apple-macos11.0 %s -o %t/eh-frame-arm64.o
2424
# RUN: %lld -arch arm64 -lSystem -lc++ %t/eh-frame-arm64.o -o %t/eh-frame-arm64
2525
# RUN: llvm-objdump --macho --syms --indirect-symbols --unwind-info \
2626
# RUN: --dwarf=frames %t/eh-frame-arm64 | FileCheck %s -D#BASE=0x100000000 -D#DWARF_ENC=3
@@ -56,21 +56,22 @@
5656
# CHECK-DAG: [[#%x,MY_PERSONALITY:]] g F __TEXT,__text _my_personality
5757
# CHECK: Contents of __unwind_info section:
5858
# CHECK: Version: 0x1
59-
# CHECK: Number of personality functions in array: 0x1
59+
# CHECK: Number of personality functions in array: 0x2
6060
# CHECK: Number of indices in array: 0x2
61-
# CHECK: Personality functions: (count = 1)
61+
# CHECK: Personality functions: (count = 2)
6262
# CHECK: personality[1]: 0x[[#%.8x,GXX_PERSONALITY_GOT - BASE]]
63+
# CHECK: personality[2]: 0x[[#%.8x,MY_PERSONALITY_GOT - BASE]]
6364
# CHECK: LSDA descriptors:
6465
# CHECK: [0]: function offset=0x[[#%.8x,F - BASE]], LSDA offset=0x[[#%.8x,EXCEPT0 - BASE]]
6566
# CHECK: [1]: function offset=0x[[#%.8x,G - BASE]], LSDA offset=0x[[#%.8x,EXCEPT1 - BASE]]
6667
# CHECK: [2]: function offset=0x[[#%.8x,H - BASE]], LSDA offset=0x[[#%.8x,EXCEPT2 - BASE]]
6768
# CHECK: Second level indices:
6869
# CHECK: Second level index[0]:
69-
# CHECK [0]: function offset=0x[[#%.8x,F - BASE]], encoding[{{.*}}]=0x52{{.*}}
70-
# CHECK [1]: function offset=0x[[#%.8x,NO_UNWIND - BASE]], encoding[{{.*}}]=0x00000000
71-
# CHECK: [2]: function offset=0x[[#%.8x,G - BASE]], encoding[{{.*}}]=0x0[[#%x,DWARF_ENC]][[#%.6x, G_DWARF_OFF:]]
72-
# CHECK: [3]: function offset=0x[[#%.8x,H - BASE]], encoding[{{.*}}]=0x0[[#%x,DWARF_ENC]][[#%.6x, H_DWARF_OFF:]]
73-
# CHECK: [4]: function offset=0x[[#%.8x,MY_PERSONALITY - BASE]], encoding[{{.*}}]=0x00000000
70+
# CHECK: [0]: function offset=0x[[#%.8x,F - BASE]], encoding[{{.*}}]=0x52{{.*}}
71+
# CHECK: [1]: function offset=0x[[#%.8x,NO_UNWIND - BASE]], encoding[{{.*}}]=0x00000000
72+
# CHECK: [2]: function offset=0x[[#%.8x,G - BASE]], encoding[{{.*}}]=0x1[[#%x,DWARF_ENC]][[#%.6x, G_DWARF_OFF:]]
73+
# CHECK: [3]: function offset=0x[[#%.8x,H - BASE]], encoding[{{.*}}]=0x2[[#%x,DWARF_ENC]][[#%.6x, H_DWARF_OFF:]]
74+
# CHECK: [4]: function offset=0x[[#%.8x,MY_PERSONALITY - BASE]], encoding[{{.*}}]=0x00000000
7475

7576
# CHECK: .debug_frame contents:
7677
# CHECK: .eh_frame contents:

lld/test/MachO/icf-only-lsda-folded.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
## the broken output would only appear if the compact unwind entry that pointed
1212
## to it was not itself folded.
1313

14-
# RUN: llvm-mc -emit-compact-unwind-non-canonical=true -filetype=obj -triple=x86_64-apple-darwin19.0.0 %t/test.s -o %t/test.o
14+
# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin19.0.0 %t/test.s -o %t/test.o
1515
# RUN: %lld -dylib -dead_strip --icf=all %t/test.o -o %t/test
1616
# RUN: llvm-objdump --macho --syms --unwind-info %t/test | FileCheck %s
1717

lld/test/MachO/icf.s

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
## groups, we use `mov` instructions with a variety of immediates, with
88
## different immediate values for each group.
99

10-
# RUN: llvm-mc -emit-compact-unwind-non-canonical=true -filetype=obj -triple=x86_64-apple-darwin19.0.0 %t/main.s -o %t/main.o
11-
# RUN: llvm-mc -emit-compact-unwind-non-canonical=true -filetype=obj -triple=x86_64-apple-darwin19.0.0 %t/abs.s -o %t/abs.o
10+
# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin19.0.0 %t/main.s -o %t/main.o
11+
# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin19.0.0 %t/abs.s -o %t/abs.o
1212
# RUN: %lld -lSystem --icf=all -o %t/main %t/main.o %t/abs.o
1313
# RUN: llvm-objdump -d --syms --dwarf=frames %t/main | FileCheck %s
1414

0 commit comments

Comments
 (0)