[all-commits] [llvm/llvm-project] ea0f66: [obj2yaml][yaml2obj] - Stop recognizing SHT_MIPS_A...

Georgii Rymar via All-commits all-commits at lists.llvm.org
Mon Sep 28 01:29:25 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: ea0f66e84856519e08b255fd1010d7f07ad0dabd
      https://github.com/llvm/llvm-project/commit/ea0f66e84856519e08b255fd1010d7f07ad0dabd
  Author: Georgii Rymar <grimar at accesssoftek.com>
  Date:   2020-09-28 (Mon, 28 Sep 2020)

  Changed paths:
    M llvm/lib/ObjectYAML/ELFYAML.cpp
    M llvm/test/tools/obj2yaml/ELF/mips-abi-flags.yaml
    M llvm/test/tools/yaml2obj/ELF/mips-abi-flags.yaml
    M llvm/tools/obj2yaml/elf2yaml.cpp

  Log Message:
  -----------
  [obj2yaml][yaml2obj] - Stop recognizing SHT_MIPS_ABIFLAGS on non-MIPS targets.

Currently we are always recognizing the `SHT_MIPS_ABIFLAGS` section,
even on non-MIPS targets.

The problem of doing this is briefly discussed in D88228 which does the same for `SHT_ARM_EXIDX`:

"The problem is that `SHT_ARM_EXIDX` shares the value with `SHT_X86_64_UNWIND (0x70000001U)`.
We might have other machine specific conflicts, e.g.
`SHT_ARM_ATTRIBUTES` vs `SHT_MSP430_ATTRIBUTES` vs `SHT_RISCV_ATTRIBUTES (0x70000003U)`."

I think we should only recognize target specific sections when the machine type
matches. I.e. `SHT_MIPS_*` should be recognized only on `MIPS`, `SHT_ARM_*`
only on `ARM` etc.

This patch stops recognizing `SHT_MIPS_ABIFLAGS` on `non-MIPS` targets.

Note: I had to update `ScalarEnumerationTraits<ELFYAML::MIPS_ISA>::enumeration`, because
otherwise test crashes, calling `llvm_unreachable`.

Differential revision: https://reviews.llvm.org/D88294




More information about the All-commits mailing list