Index: include/llvm/Object/ELFObjectFile.h =================================================================== --- include/llvm/Object/ELFObjectFile.h +++ include/llvm/Object/ELFObjectFile.h @@ -771,7 +771,7 @@ } } for (const Elf_Shdr &Sec : *SectionsOrErr) { - if (is_contained(Offsets, Sec.sh_offset)) + if (is_contained(Offsets, Sec.sh_addr)) Res.emplace_back(toDRI(&Sec), this); } return Res; Index: tools/llvm-objdump/llvm-objdump.cpp =================================================================== --- tools/llvm-objdump/llvm-objdump.cpp +++ tools/llvm-objdump/llvm-objdump.cpp @@ -1530,7 +1530,8 @@ return; const auto *Elf = dyn_cast(Obj); - if (!Elf || Elf->getEType() != ELF::ET_DYN) { + if (!Elf || + (Elf->getEType() != ELF::ET_DYN && Elf->getEType() != ELF::ET_EXEC)) { error("not a dynamic object"); return; }