[llvm] 6231ba0 - [Orc] Drop arch check in the DebugObjectManagerPlugin for ELF

Stefan Gränitz via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 31 03:59:51 PDT 2023


Author: Stefan Gränitz
Date: 2023-03-31T12:59:09+02:00
New Revision: 6231ba0eed7898020fab6393b2792bbfaa175efd

URL: https://github.com/llvm/llvm-project/commit/6231ba0eed7898020fab6393b2792bbfaa175efd
DIFF: https://github.com/llvm/llvm-project/commit/6231ba0eed7898020fab6393b2792bbfaa175efd.diff

LOG: [Orc] Drop arch check in the DebugObjectManagerPlugin for ELF

Tested this with the new AArch32 backend on armv7l and it works without issues in GDB. The size of the load-address field is only 32-bit here, but we implicitly account for it by writing a ELFT::uint which is:
https://github.com/llvm/llvm-project/blob/release/16.x/llvm/include/llvm/Object/ELFTypes.h#L57

So, instead of adding a newly supported machine type, let's just drop this restriction althogether.

Added: 
    

Modified: 
    llvm/lib/ExecutionEngine/Orc/DebugObjectManagerPlugin.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/ExecutionEngine/Orc/DebugObjectManagerPlugin.cpp b/llvm/lib/ExecutionEngine/Orc/DebugObjectManagerPlugin.cpp
index bd2faebc16d2..ab2f7a139a70 100644
--- a/llvm/lib/ExecutionEngine/Orc/DebugObjectManagerPlugin.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/DebugObjectManagerPlugin.cpp
@@ -60,8 +60,6 @@ class ELFDebugObjectSection : public DebugObjectSection {
 
 private:
   typename ELFT::Shdr *Header;
-
-  bool isTextOrDataSection() const;
 };
 
 template <typename ELFT>
@@ -268,11 +266,6 @@ ELFDebugObject::CreateArchType(MemoryBufferRef Buffer,
   if (!ObjRef)
     return ObjRef.takeError();
 
-  // TODO: Add support for other architectures.
-  uint16_t TargetMachineArch = ObjRef->getHeader().e_machine;
-  if (TargetMachineArch != ELF::EM_X86_64)
-    return nullptr;
-
   Expected<ArrayRef<SectionHeader>> Sections = ObjRef->sections();
   if (!Sections)
     return Sections.takeError();


        


More information about the llvm-commits mailing list