[PATCH] D128493: [llvm-readobj][RISCV] Support dumping PT_RISCV_ATTRIBUTES

luxufan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 28 20:14:50 PDT 2022


StephenFan added a comment.

In D128493#3607134 <https://reviews.llvm.org/D128493#3607134>, @MaskRay wrote:

>> Supporting dump PT_RISCV_ATTRIBUTES
>
> Support dumping
>
>> But it is weird that riscv gnu toolchain's readelf dumps PT_RISCV_ATTRIBUTES as RISCV_ATTRIBUT.
>
> riscv gnu toolchain's readelf => GNU readelf
>
> When describing binutils-gdb behavior, prefer the official binutils-gdb to a downstream repository like riscv-gnu-toolchain.
>
>> But it is weird that riscv gnu toolchain's readelf dumps PT_RISCV_ATTRIBUTES as RISCV_ATTRIBUT.
>
> Because it uses something like `%-14.14s` so only the first 14 bytes are printed. Many long program header types like PT_AARCH64_MEMTAG_MTE are affected as well.
>
>> For target specific program headers, we generally drop the PT_xxxx_prefix. This patch also adopts this approach.
>
> Actually I am unsure we should drop the machine prefix. GNU readelf uses the prefix and it seems clearer to have the prefix.



In D128493#3607134 <https://reviews.llvm.org/D128493#3607134>, @MaskRay wrote:

>> Supporting dump PT_RISCV_ATTRIBUTES
>
> Support dumping
>
>> But it is weird that riscv gnu toolchain's readelf dumps PT_RISCV_ATTRIBUTES as RISCV_ATTRIBUT.
>
> riscv gnu toolchain's readelf => GNU readelf
>
> When describing binutils-gdb behavior, prefer the official binutils-gdb to a downstream repository like riscv-gnu-toolchain.
>
>> But it is weird that riscv gnu toolchain's readelf dumps PT_RISCV_ATTRIBUTES as RISCV_ATTRIBUT.
>
> Because it uses something like `%-14.14s` so only the first 14 bytes are printed. Many long program header types like PT_AARCH64_MEMTAG_MTE are affected as well.
>
>> For target specific program headers, we generally drop the PT_xxxx_prefix. This patch also adopts this approach.
>
> Actually I am unsure we should drop the machine prefix. GNU readelf uses the prefix and it seems clearer to have the prefix.

Thanks for detailed explanation

In D128493#3607134 <https://reviews.llvm.org/D128493#3607134>, @MaskRay wrote:

>> Supporting dump PT_RISCV_ATTRIBUTES
>
> Support dumping
>
>> But it is weird that riscv gnu toolchain's readelf dumps PT_RISCV_ATTRIBUTES as RISCV_ATTRIBUT.
>
> riscv gnu toolchain's readelf => GNU readelf
>
> When describing binutils-gdb behavior, prefer the official binutils-gdb to a downstream repository like riscv-gnu-toolchain.
>
>> But it is weird that riscv gnu toolchain's readelf dumps PT_RISCV_ATTRIBUTES as RISCV_ATTRIBUT.
>
> Because it uses something like `%-14.14s` so only the first 14 bytes are printed. Many long program header types like PT_AARCH64_MEMTAG_MTE are affected as well.
>
>> For target specific program headers, we generally drop the PT_xxxx_prefix. This patch also adopts this approach.
>
> Actually I am unsure we should drop the machine prefix. GNU readelf uses the prefix and it seems clearer to have the prefix.

Thanks for such a detailed explanation!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D128493/new/

https://reviews.llvm.org/D128493



More information about the llvm-commits mailing list