[all-commits] [llvm/llvm-project] 062065: [RISCV] Enable tools such as llvm-objdump to proce...

Alex Bradbury via All-commits all-commits at lists.llvm.org
Sun Mar 26 20:34:43 PDT 2023

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 062065888f645bbe6a8eec99ba58487a539afd62
  Author: Alex Bradbury <asb at igalia.com>
  Date:   2023-03-27 (Mon, 27 Mar 2023)

  Changed paths:
    M llvm/include/llvm/Support/RISCVISAInfo.h
    M llvm/lib/Support/RISCVISAInfo.cpp
    M llvm/test/tools/llvm-objdump/ELF/RISCV/riscv-attributes.s
    M llvm/unittests/Support/RISCVISAInfoTest.cpp

  Log Message:
  [RISCV] Enable tools such as llvm-objdump to process objects with unrecognised base ISA versions

Tools such as llvm-objdump will currently inputs when the base ISA has
an unrecognised version. I addressed a similar issue in LLD in D144353,
introducing parseArchStringNormalized. While it would make sense to
migrate `llvm/lib/Object/ELFObjectFile.cpp` to using
`parseArchStringNormalized` as well, this patch takes a less ambitious
initial step. By tweaking the behaviour of `parseArchString` when
`IgnoreUnknown` is true (which only has one in-tree user), we use the
default supported ISA version when a base ISA with unrecognised version
is encountered.

This means that llvm-objdump and related tools will function better for
objects produced from a recent GCC. This isn't a full fix, as
IgnoreUnknown means that an imafd object with attributes specifying
newer A/F/D versions will have those extensions ignored.

Differential Revision: https://reviews.llvm.org/D146070

More information about the All-commits mailing list