Skip to content

Commit e2c868f

Browse files
committed
Revert "[lld-macho] Fix bugs around EH_Frame symbols"
This reverts commit 1a2bc10. This patch series breaks lld:map-file.s on arm v7 linux buildbots. e.g https://lab.llvm.org/buildbot/#/builders/178/builds/3190
1 parent 3ea86a1 commit e2c868f

File tree

2 files changed

+15
-20
lines changed

2 files changed

+15
-20
lines changed

lld/MachO/InputFiles.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1346,11 +1346,11 @@ void ObjFile::registerEhFrames(Section &ehFrameSection) {
13461346
// that all EH frames have an associated symbol so that we can generate
13471347
// subtractor relocs that reference them.
13481348
if (isec->symbols.size() == 0)
1349-
make<Defined>("EH_Frame", isec->getFile(), isec, /*value=*/0,
1350-
isec->getSize(), /*isWeakDef=*/false, /*isExternal=*/false,
1351-
/*isPrivateExtern=*/false, /*includeInSymtab=*/false,
1352-
/*isThumb=*/false, /*isReferencedDynamically=*/false,
1353-
/*noDeadStrip=*/false);
1349+
isec->symbols.push_back(make<Defined>(
1350+
"EH_Frame", isec->getFile(), isec, /*value=*/0, /*size=*/0,
1351+
/*isWeakDef=*/false, /*isExternal=*/false, /*isPrivateExtern=*/false,
1352+
/*includeInSymtab=*/false, /*isThumb=*/false,
1353+
/*isReferencedDynamically=*/false, /*noDeadStrip=*/false));
13541354
else if (isec->symbols[0]->value != 0)
13551355
fatal("found symbol at unexpected offset in __eh_frame");
13561356

lld/test/MachO/map-file.s

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@
88
# RUN: --time-trace -o %t/test
99
# RUN: llvm-objdump --syms --section-headers %t/test > %t/objdump
1010
## Check that symbols in cstring sections aren't emitted
11-
## Also check that we don't have redundant EH_Frame symbols (regression test)
12-
# RUN: cat %t/objdump %t/map | FileCheck %s --implicit-check-not _hello_world \
13-
# RUN: --implicit-check-not EH_Frame
11+
# RUN: cat %t/objdump %t/map | FileCheck %s --implicit-check-not _hello_world
1412
# RUN: FileCheck %s --check-prefix=MAPFILE < %t/test.time-trace
1513

1614
# CHECK: Sections:
@@ -46,18 +44,15 @@
4644
# CHECK-NEXT: 0x[[#%X,BSS]] 0x{{[0-9A-F]+}} __DATA __common
4745

4846
# CHECK-NEXT: # Symbols:
49-
# CHECK-NEXT: # Address Size File Name
50-
# CHECK-DAG: 0x[[#%X,MAIN]] 0x00000001 [ 1] _main
51-
# CHECK-DAG: 0x[[#%X,BAR]] 0x00000001 [ 1] _bar
52-
# CHECK-DAG: 0x[[#%X,FOO]] 0x00000001 [ 2] __ZTIN3foo3bar4MethE
53-
# CHECK-DAG: 0x[[#%X,HIWORLD]] 0x0000000E [ 3] literal string: Hello world!\n
54-
# CHECK-DAG: 0x[[#%X,HIITSME]] 0x0000000F [ 3] literal string: Hello, it's me
55-
# CHECK-DAG: 0x[[#%X,HIITSME + 0xf]] 0x0000000E [ 3] literal string: Hello world!\n
56-
# CHECK-DAG: 0x[[#%X,NUMBER]] 0x00000001 [ 1] _number
57-
# CHECK-DAG: 0x[[#%X,UNWIND]] 0x0000103C [ 0] compact unwind info
58-
## Note: ld64 prints "CIE" and "FDE for: <function>" instead of "EH_Frame".
59-
# CHECK-DAG: 0x[[#%X,EH_FRAME]] 0x00000018 [ 1] EH_Frame
60-
# CHECK-DAG: 0x[[#%X,EH_FRAME + 0x18]] 0x00000020 [ 1] EH_Frame
47+
# CHECK-NEXT: # Address Size File Name
48+
# CHECK-DAG: 0x[[#%X,MAIN]] 0x00000001 [ 1] _main
49+
# CHECK-DAG: 0x[[#%X,BAR]] 0x00000001 [ 1] _bar
50+
# CHECK-DAG: 0x[[#%X,FOO]] 0x00000001 [ 2] __ZTIN3foo3bar4MethE
51+
# CHECK-DAG: 0x[[#%X,HIWORLD]] 0x0000000E [ 3] literal string: Hello world!\n
52+
# CHECK-DAG: 0x[[#%X,HIITSME]] 0x0000000F [ 3] literal string: Hello, it's me
53+
# CHECK-DAG: 0x[[#%X,HIITSME + 0xf]] 0x0000000E [ 3] literal string: Hello world!\n
54+
# CHECK-DAG: 0x[[#%X,NUMBER]] 0x00000001 [ 1] _number
55+
# CHECK-DAG: 0x[[#%X,UNWIND]] 0x0000103C [ 0] compact unwind info
6156

6257
# MAPFILE: "name":"Total Write map file"
6358

0 commit comments

Comments
 (0)