diff --git a/llvm/tools/llvm-objdump/llvm-objdump.cpp b/llvm/tools/llvm-objdump/llvm-objdump.cpp --- a/llvm/tools/llvm-objdump/llvm-objdump.cpp +++ b/llvm/tools/llvm-objdump/llvm-objdump.cpp @@ -1181,6 +1181,19 @@ return SymbolInfoTy(Addr, Name, Type); } +static bool isNoteSection(SectionRef S) { + // Right now we only support detecting note section for ELF objects. + // TODO: + // Support other formats too. + + auto Obj = S.getObject(); + if (Obj->isELF()) { + ELFSectionRef ES(S); + return ES.getType() == ELF::SHT_NOTE; + } + return false; +} + static void disassembleObject(const Target *TheTarget, const ObjectFile *Obj, MCContext &Ctx, MCDisassembler *PrimaryDisAsm, MCDisassembler *SecondaryDisAsm, @@ -1293,6 +1306,12 @@ (!Section.isText() || Section.isVirtual())) continue; + // The note section needs to be handled separately. + if (isNoteSection(Section)) { + outs() << "\n.note section : Pending support\n"; + continue; + } + uint64_t SectionAddr = Section.getAddress(); uint64_t SectSize = Section.getSize(); if (!SectSize)