[PATCH] D153260: [RISCV][MC] Implement mapping symbols
Fangrui Song via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 25 11:06:33 PDT 2023
MaskRay added inline comments.
================
Comment at: llvm/test/MC/RISCV/mapping-across-sections.s:1
+# RUN: llvm-mc -triple=riscv32 -filetype=obj < %s | llvm-objdump -t - | FileCheck %s
+# RUN: llvm-mc -triple=riscv64 -filetype=obj < %s | llvm-objdump -t - | FileCheck %s
----------------
jobnoorman wrote:
> MaskRay wrote:
> > Ideally use llvm-readelf for testing, which retains all `Elf*_Sym` information. llvm-objdump -t output losses some information e.g. certain ELF symbol types are not distinguishable.
> Good point. One slight annoyance with implementing this is that `llvm-readelf` doesn't show section names, only indices. I would ideally like to avoid having to hard code indices. This could in principle be done using `--elf-output-style=LLVM` but this makes the `CHECK`s very verbose.
>
> So before implementing this, I wanted to ask your opinion. Do you prefer hard coding indices or more verbosity in the tests (or stick with the current version)?
The `objdump -t` feature displaying the section name is the only reason I sometimes use it:)
However, you can use `llvm-readelf -Ss` and FileCheck captured variables, e.g.,
`lld/test/ELF/copy-rel-alias.s`
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D153260/new/
https://reviews.llvm.org/D153260
More information about the llvm-commits
mailing list