Revert "[lldb] Set default object format to MachO in ObjectFileMachO (#142704)"

This reverts commit d4d2f069de.

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.
This commit is contained in:
Jason Molenda
2025-06-05 16:23:27 -07:00
parent 34c011d544
commit f961d6a89a
2 changed files with 0 additions and 56 deletions

View File

@@ -5148,7 +5148,6 @@ void ObjectFileMachO::GetAllArchSpecs(const llvm::MachO::mach_header &header,
llvm::Triple base_triple = base_arch.GetTriple();
base_triple.setOS(llvm::Triple::UnknownOS);
base_triple.setOSName(llvm::StringRef());
base_triple.setObjectFormat(llvm::Triple::MachO);
if (header.filetype == MH_PRELOAD) {
if (header.cputype == CPU_TYPE_ARM) {

View File

@@ -94,59 +94,4 @@ TEST_F(ObjectFileMachOTest, IndirectSymbolsInTheSharedCache) {
for (size_t i = 0; i < 10; i++)
OF->ParseSymtab(symtab);
}
TEST_F(ObjectFileMachOTest, ObjectFormatWithoutVersionLoadCommand) {
// A Mach-O file without the load command LC_BUILD_VERSION.
const char *yamldata = R"(
--- !mach-o
FileHeader:
magic: 0xFEEDFACF
cputype: 0x0100000C
cpusubtype: 0x00000000
filetype: 0x00000001
ncmds: 1
sizeofcmds: 152
flags: 0x00002000
reserved: 0x00000000
LoadCommands:
- cmd: LC_SEGMENT_64
cmdsize: 152
segname: __TEXT
vmaddr: 0
vmsize: 4
fileoff: 184
filesize: 4
maxprot: 7
initprot: 7
nsects: 1
flags: 0
Sections:
- sectname: __text
segname: __TEXT
addr: 0x0000000000000000
content: 'AABBCCDD'
size: 4
offset: 184
align: 0
reloff: 0x00000000
nreloc: 0
flags: 0x80000400
reserved1: 0x00000000
reserved2: 0x00000000
reserved3: 0x00000000
...
)";
// Perform setup.
llvm::Expected<TestFile> file = TestFile::fromYaml(yamldata);
EXPECT_THAT_EXPECTED(file, llvm::Succeeded());
auto module_sp = std::make_shared<Module>(file->moduleSpec());
ASSERT_NE(module_sp, nullptr);
auto object_file = module_sp->GetObjectFile();
ASSERT_NE(object_file, nullptr);
// Verify that the object file is recognized as Mach-O.
ASSERT_EQ(object_file->GetArchitecture().GetTriple().getObjectFormat(),
llvm::Triple::MachO);
}
#endif