[PATCH] D156514: [llvm-nm][RISCV] Recognize mapping symbols
Job Noorman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 28 06:43:56 PDT 2023
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG1f12f6fff447: [llvm-nm][RISCV] Recognize mapping symbols (authored by jobnoorman).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D156514/new/
https://reviews.llvm.org/D156514
Files:
llvm/test/tools/llvm-nm/special-syms-riscv.test
llvm/tools/llvm-nm/llvm-nm.cpp
Index: llvm/tools/llvm-nm/llvm-nm.cpp
===================================================================
--- llvm/tools/llvm-nm/llvm-nm.cpp
+++ llvm/tools/llvm-nm/llvm-nm.cpp
@@ -1803,9 +1803,9 @@
// --special-syms option.
auto *ELFObj = dyn_cast<ELFObjectFileBase>(&Obj);
bool HasMappingSymbol =
- ELFObj &&
- llvm::is_contained({ELF::EM_ARM, ELF::EM_AARCH64, ELF::EM_CSKY},
- ELFObj->getEMachine());
+ ELFObj && llvm::is_contained({ELF::EM_ARM, ELF::EM_AARCH64,
+ ELF::EM_CSKY, ELF::EM_RISCV},
+ ELFObj->getEMachine());
if (!HasMappingSymbol && !DebugSyms &&
(*SymFlagsOrErr & SymbolRef::SF_FormatSpecific))
continue;
Index: llvm/test/tools/llvm-nm/special-syms-riscv.test
===================================================================
--- /dev/null
+++ llvm/test/tools/llvm-nm/special-syms-riscv.test
@@ -0,0 +1,29 @@
+## Test --special-syms flag.
+# RUN: yaml2obj %s -o %t
+
+# RUN: llvm-nm %t | count 0
+# RUN: llvm-nm %t --special-syms | FileCheck %s
+
+!ELF
+FileHeader:
+ Class: ELFCLASS64
+ Data: ELFDATA2LSB
+ Type: ET_REL
+ Machine: EM_RISCV
+Sections:
+ - Name: .text
+ Type: SHT_PROGBITS
+ Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
+ Address: 0x1000
+ - Name: .data
+ Type: SHT_PROGBITS
+ Flags: [ SHF_ALLOC, SHF_WRITE ]
+ Address: 0x2000
+Symbols:
+ - Name: $x.1
+ Section: .text
+ - Name: $d.1
+ Section: .data
+
+# CHECK: 2000 d $d.1
+# CHECK-NEXT: 1000 t $x.1
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D156514.545137.patch
Type: text/x-patch
Size: 1724 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230728/46e32b78/attachment.bin>
More information about the llvm-commits
mailing list