From 9ba844eb3a21d461c3adc7add7691a076c6992fc Mon Sep 17 00:00:00 2001 From: Walter Erquinigo Date: Fri, 19 Sep 2025 14:14:20 -0400 Subject: [ELF][LLDB] Add an nvsass triple (#159459) When handling CUDA ELF files via objdump or LLDB, the ELF parser in LLVM needs to distinguish if an ELF file is sass or not, which requires a triple for sass to exist in llvm. This patch includes all the necessary changes for LLDB and objdump to correctly identify these files with the correct triple. --- llvm/lib/Object/ELFObjectFile.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'llvm/lib/Object/ELFObjectFile.cpp') diff --git a/llvm/lib/Object/ELFObjectFile.cpp b/llvm/lib/Object/ELFObjectFile.cpp index f9fda23..f083efe 100644 --- a/llvm/lib/Object/ELFObjectFile.cpp +++ b/llvm/lib/Object/ELFObjectFile.cpp @@ -438,7 +438,7 @@ std::optional ELFObjectFileBase::tryGetCPUName() const { case ELF::EM_AMDGPU: return getAMDGPUCPUName(); case ELF::EM_CUDA: - return getNVPTXCPUName(); + return getCUDACPUName(); case ELF::EM_PPC: case ELF::EM_PPC64: return StringRef("future"); @@ -620,7 +620,7 @@ StringRef ELFObjectFileBase::getAMDGPUCPUName() const { } } -StringRef ELFObjectFileBase::getNVPTXCPUName() const { +StringRef ELFObjectFileBase::getCUDACPUName() const { assert(getEMachine() == ELF::EM_CUDA); unsigned SM = getEIdentABIVersion() == ELF::ELFABIVERSION_CUDA_V1 ? getPlatformFlags() & ELF::EF_CUDA_SM -- cgit v1.1