[lld] [llvm] [llvm-objdump][ARM] Find ELF file PLT entries for arm, thumb (PR #130764)

James Henderson via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 12 01:25:16 PDT 2025


================
@@ -833,10 +839,18 @@ std::vector<ELFPltEntry> ELFObjectFileBase::getPltEntries() const {
         consumeError(PltContents.takeError());
         return {};
       }
+      std::optional<llvm::endianness> InstrEndianness;
+      if (const auto *Elf32BE = dyn_cast<ELF32BEObjectFile>(this)) {
+        if (!Elf32BE->isRelocatableObject() &&
+            (Elf32BE->getPlatformFlags() & ELF::EF_ARM_BE8)) {
----------------
jh7370 wrote:

Doesn't this need some sort of guard that the machine is actually ARM? Otherwise, in theory, you could have a Big Endian object file for a different machine, which just so happens to have a flag with the same value as `EF_ARM_BE8`.

(It's possible I missed something, so apologies if I have)

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


More information about the llvm-commits mailing list