[llvm] [llvm-objdump][AVR] Detect AVR architecture from ELF flags for disassembling (PR #174731)
James Henderson via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 27 01:11:04 PST 2026
================
@@ -2689,6 +2690,19 @@ static void disassembleObject(ObjectFile *Obj, bool InlineRelocs,
Features.AddFeature(MAttrs[I]);
} else if (MCPU.empty() && Obj->makeTriple().isAArch64()) {
Features.AddFeature("+all");
+ } else if (MCPU.empty() && Obj->makeTriple().isAVR()) {
+ // Assign attributes based on the AVR architecture version, default to
+ // "avr0". Report "<unknown>" for unsupported AVR instructions to avoid
+ // silent failures.
+ if (const auto *Elf = dyn_cast<ELFObjectFileBase>(Obj)) {
+ unsigned AVRVersion = Elf->getPlatformFlags() & ELF::EF_AVR_ARCH_MASK;
+ std::string Version = AVR::getFeatureSetForEFlag(AVRVersion);
+ if (Version == "avr0")
----------------
jh7370 wrote:
Follow-up question then: why have you chosen "avr0" as the default string?
@benshi001, could you confirm the answer to what you think we should do here, please.
https://github.com/llvm/llvm-project/pull/174731
More information about the llvm-commits
mailing list