[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
Thu Jan 22 00:46:48 PST 2026


================
@@ -0,0 +1,44 @@
+## When --mattr and --mcpu are both empty, disassemble ELF with e_flags derived feature.
----------------
jh7370 wrote:

I appreciate that a well-formed object probably won't have multiple of these flags set, but what happens if a slightly broken object with multiple of the relevant flags is specified e.g. both `EF_AVR_ARCH_AVR1` and `EF_AVR_ARCH_AVR3`?

If I understand the code correctly, it'll be as if only the first flag, numerically, is specified. I don't think you necessarily need to do more than this (perhaps you could emit a warning, but I leave that up to your judgement). You probably should have a single test case that documents the behaviour of this case though.

https://github.com/llvm/llvm-project/pull/174731


More information about the llvm-commits mailing list