Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion llvm/lib/Object/OffloadBundle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,9 @@ Error OffloadBundleFatBin::extractBundle(const ObjectFile &Source) {

Error object::extractOffloadBundleFatBinary(
const ObjectFile &Obj, SmallVectorImpl<OffloadBundleFatBin> &Bundles) {
assert((Obj.isELF() || Obj.isCOFF()) && "Invalid file type");
// Ignore unsupported object formats.
if (!Obj.isELF() && !Obj.isCOFF())
return Error::success();

// Iterate through Sections until we find an offload_bundle section.
for (SectionRef Sec : Obj.sections()) {
Expand Down
34 changes: 34 additions & 0 deletions llvm/test/tools/llvm-readobj/MachO/all.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# RUN: yaml2obj %s | llvm-readobj --all - | FileCheck %s

## Make sure that --all at least doesn't crash.

# CHECK: Format: Mach-O arm
# CHECK: Arch: arm
# CHECK: AddressSize: 32bit
# CHECK: MachHeader {
# CHECK: Magic: Magic (0xFEEDFACE)
# CHECK: CpuType: Arm (0xC)
# CHECK: CpuSubType: CPU_SUBTYPE_ARM_V7 (0x9)
# CHECK: FileType: Relocatable (0x1)
# CHECK: NumOfLoadCommands: 0
# CHECK: SizeOfLoadCommands: 0
# CHECK: Flags [ (0x0)
# CHECK: ]
# CHECK: }
# CHECK: Sections [
# CHECK: ]
# CHECK: Relocations [
# CHECK: ]
# CHECK: UnwindInfo not implemented.
# CHECK: Symbols [
# CHECK: ]

--- !mach-o
FileHeader:
magic: 0xFEEDFACE
cputype: 0xC
cpusubtype: 0x9
filetype: 0x1
ncmds: 0
sizeofcmds: 0
flags: 0x0