Skip to content

Commit 942f4e3

Browse files
committed
Revert "[lld-macho] Initial support for EH Frames"
This reverts commit 826be33. This was causing a test failure on build bots: - https://lab.llvm.org/buildbot/#/builders/36/builds/21770 - https://lab.llvm.org/buildbot/#/builders/58/builds/23913
1 parent 10641a4 commit 942f4e3

23 files changed

+109
-988
lines changed

lld/MachO/Arch/ARM64.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#include "Target.h"
1414

1515
#include "lld/Common/ErrorHandler.h"
16-
#include "mach-o/compact_unwind_encoding.h"
1716
#include "llvm/ADT/SmallVector.h"
1817
#include "llvm/ADT/StringRef.h"
1918
#include "llvm/BinaryFormat/MachO.h"
@@ -142,10 +141,6 @@ ARM64::ARM64() : ARM64Common(LP64()) {
142141
backwardBranchRange = 128 * 1024 * 1024;
143142
forwardBranchRange = backwardBranchRange - 4;
144143

145-
modeDwarfEncoding = UNWIND_ARM64_MODE_DWARF;
146-
subtractorRelocType = ARM64_RELOC_SUBTRACTOR;
147-
unsignedRelocType = ARM64_RELOC_UNSIGNED;
148-
149144
stubHelperHeaderSize = sizeof(stubHelperHeaderCode);
150145
stubHelperEntrySize = sizeof(stubHelperEntryCode);
151146
}

lld/MachO/Arch/ARM64_32.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,6 @@ ARM64_32::ARM64_32() : ARM64Common(ILP32()) {
105105
cpuType = CPU_TYPE_ARM64_32;
106106
cpuSubtype = CPU_SUBTYPE_ARM64_V8;
107107

108-
modeDwarfEncoding = 0x04000000; // UNWIND_ARM_MODE_DWARF
109-
subtractorRelocType = GENERIC_RELOC_INVALID; // FIXME
110-
unsignedRelocType = GENERIC_RELOC_INVALID; // FIXME
111-
112108
stubSize = sizeof(stubCode);
113109
stubHelperHeaderSize = sizeof(stubHelperHeaderCode);
114110
stubHelperEntrySize = sizeof(stubHelperEntryCode);

lld/MachO/Arch/X86_64.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#include "Target.h"
1313

1414
#include "lld/Common/ErrorHandler.h"
15-
#include "mach-o/compact_unwind_encoding.h"
1615
#include "llvm/BinaryFormat/MachO.h"
1716
#include "llvm/Support/Endian.h"
1817

@@ -186,10 +185,6 @@ X86_64::X86_64() : TargetInfo(LP64()) {
186185
cpuType = CPU_TYPE_X86_64;
187186
cpuSubtype = CPU_SUBTYPE_X86_64_ALL;
188187

189-
modeDwarfEncoding = UNWIND_X86_MODE_DWARF;
190-
subtractorRelocType = X86_64_RELOC_SUBTRACTOR;
191-
unsignedRelocType = X86_64_RELOC_UNSIGNED;
192-
193188
stubSize = sizeof(stub);
194189
stubHelperHeaderSize = sizeof(stubHelperHeader);
195190
stubHelperEntrySize = sizeof(stubHelperEntry);

lld/MachO/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ add_lld_library(lldMachO
1414
Driver.cpp
1515
DriverUtils.cpp
1616
Dwarf.cpp
17-
EhFrame.cpp
1817
ExportTrie.cpp
1918
ICF.cpp
2019
InputFiles.cpp

lld/MachO/Config.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,6 @@ struct Configuration {
130130
bool dedupLiterals = true;
131131
bool omitDebugInfo = false;
132132
bool warnDylibInstallName = false;
133-
// Temporary config flag that will be removed once we have fully implemented
134-
// support for __eh_frame.
135-
bool parseEhFrames = false;
136133
uint32_t headerPad;
137134
uint32_t dylibCompatibilityVersion = 0;
138135
uint32_t dylibCurrentVersion = 0;

lld/MachO/Driver.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1039,9 +1039,8 @@ static void gatherInputSections() {
10391039
int inputOrder = 0;
10401040
for (const InputFile *file : inputFiles) {
10411041
for (const Section *section : file->sections) {
1042-
// Compact unwind entries require special handling elsewhere. (In
1043-
// contrast, EH frames are handled like regular ConcatInputSections.)
10441042
if (section->name == section_names::compactUnwind)
1043+
// Compact unwind entries require special handling elsewhere.
10451044
continue;
10461045
ConcatOutputSection *osec = nullptr;
10471046
for (const Subsection &subsection : section->subsections) {
@@ -1303,7 +1302,6 @@ bool macho::link(ArrayRef<const char *> argsArr, llvm::raw_ostream &stdoutOS,
13031302
config->callGraphProfileSort = args.hasFlag(
13041303
OPT_call_graph_profile_sort, OPT_no_call_graph_profile_sort, true);
13051304
config->printSymbolOrder = args.getLastArgValue(OPT_print_symbol_order);
1306-
config->parseEhFrames = static_cast<bool>(getenv("LLD_IN_TEST"));
13071305

13081306
// FIXME: Add a commandline flag for this too.
13091307
config->zeroModTime = getenv("ZERO_AR_DATE");

lld/MachO/EhFrame.cpp

Lines changed: 0 additions & 140 deletions
This file was deleted.

lld/MachO/EhFrame.h

Lines changed: 0 additions & 120 deletions
This file was deleted.

lld/MachO/ICF.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,9 +212,9 @@ bool ICF::equalsVariable(const ConcatInputSection *ia,
212212
// info matches. For simplicity, we only handle the case where there are only
213213
// symbols at offset zero within the section (which is typically the case with
214214
// .subsections_via_symbols.)
215-
auto hasUnwind = [](Defined *d) { return d->unwindEntry != nullptr; };
216-
auto itA = std::find_if(ia->symbols.begin(), ia->symbols.end(), hasUnwind);
217-
auto itB = std::find_if(ib->symbols.begin(), ib->symbols.end(), hasUnwind);
215+
auto hasCU = [](Defined *d) { return d->unwindEntry != nullptr; };
216+
auto itA = std::find_if(ia->symbols.begin(), ia->symbols.end(), hasCU);
217+
auto itB = std::find_if(ib->symbols.begin(), ib->symbols.end(), hasCU);
218218
if (itA == ia->symbols.end())
219219
return itB == ib->symbols.end();
220220
if (itB == ib->symbols.end())

0 commit comments

Comments
 (0)