Skip to content

Commit e6ba1c8

Browse files
jasonmolendarorth
authored andcommitted
Revert "[lldb] Set default object format to MachO in ObjectFileMachO (llvm#142704)"
This reverts commit d4d2f06. Temporarily reverting until we can find a way to get the correct ObjectFile set in Module's Triples without adding "-macho" to the triple string for each Module. This is breaking TestUniversal.py on the x86_64 macOS CI bots.
1 parent 87e074a commit e6ba1c8

File tree

2 files changed

+0
-56
lines changed

2 files changed

+0
-56
lines changed

lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5148,7 +5148,6 @@ void ObjectFileMachO::GetAllArchSpecs(const llvm::MachO::mach_header &header,
51485148
llvm::Triple base_triple = base_arch.GetTriple();
51495149
base_triple.setOS(llvm::Triple::UnknownOS);
51505150
base_triple.setOSName(llvm::StringRef());
5151-
base_triple.setObjectFormat(llvm::Triple::MachO);
51525151

51535152
if (header.filetype == MH_PRELOAD) {
51545153
if (header.cputype == CPU_TYPE_ARM) {

lldb/unittests/ObjectFile/MachO/TestObjectFileMachO.cpp

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -94,59 +94,4 @@ TEST_F(ObjectFileMachOTest, IndirectSymbolsInTheSharedCache) {
9494
for (size_t i = 0; i < 10; i++)
9595
OF->ParseSymtab(symtab);
9696
}
97-
98-
TEST_F(ObjectFileMachOTest, ObjectFormatWithoutVersionLoadCommand) {
99-
// A Mach-O file without the load command LC_BUILD_VERSION.
100-
const char *yamldata = R"(
101-
--- !mach-o
102-
FileHeader:
103-
magic: 0xFEEDFACF
104-
cputype: 0x0100000C
105-
cpusubtype: 0x00000000
106-
filetype: 0x00000001
107-
ncmds: 1
108-
sizeofcmds: 152
109-
flags: 0x00002000
110-
reserved: 0x00000000
111-
LoadCommands:
112-
- cmd: LC_SEGMENT_64
113-
cmdsize: 152
114-
segname: __TEXT
115-
vmaddr: 0
116-
vmsize: 4
117-
fileoff: 184
118-
filesize: 4
119-
maxprot: 7
120-
initprot: 7
121-
nsects: 1
122-
flags: 0
123-
Sections:
124-
- sectname: __text
125-
segname: __TEXT
126-
addr: 0x0000000000000000
127-
content: 'AABBCCDD'
128-
size: 4
129-
offset: 184
130-
align: 0
131-
reloff: 0x00000000
132-
nreloc: 0
133-
flags: 0x80000400
134-
reserved1: 0x00000000
135-
reserved2: 0x00000000
136-
reserved3: 0x00000000
137-
...
138-
)";
139-
140-
// Perform setup.
141-
llvm::Expected<TestFile> file = TestFile::fromYaml(yamldata);
142-
EXPECT_THAT_EXPECTED(file, llvm::Succeeded());
143-
auto module_sp = std::make_shared<Module>(file->moduleSpec());
144-
ASSERT_NE(module_sp, nullptr);
145-
auto object_file = module_sp->GetObjectFile();
146-
ASSERT_NE(object_file, nullptr);
147-
148-
// Verify that the object file is recognized as Mach-O.
149-
ASSERT_EQ(object_file->GetArchitecture().GetTriple().getObjectFormat(),
150-
llvm::Triple::MachO);
151-
}
15297
#endif

0 commit comments

Comments
 (0)