[PATCH] D123902: [llvm-objcopy][mips] Add MIPS specific ELF section indexes
Anubhab Ghosh via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 19 10:41:49 PDT 2022
argentite added inline comments.
================
Comment at: llvm/lib/ObjectYAML/ELFYAML.cpp:768
+
+ if (Object->getMachine() == ELF::EM_MIPS) {
+ ECase(SHN_MIPS_ACOMMON);
----------------
jhenderson wrote:
> This `if` isn't present for other machines (see the below Hexagon and AMDGPU values), and I'm not convinced we want it here. It is sometimes useful to be able to write YAML that uses one of these properties, but is not for MIPS. In this case, the value would be used, but it would be meaningless.
Apologies if my understanding is incorrect but it seems like without the machine check, the first case matching the value will be shown in obj2yaml. Some of the values such as `SHN_MIPS_SCOMMON` and `SHN_HEXAGON_SCOMMON_4` conflict with each other (0xff03), so whichever appears first in the code will be displayed (also leading to some test failures like `tools/obj2yaml/ELF/special-symbol-indices.yaml`).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D123902/new/
https://reviews.llvm.org/D123902
More information about the llvm-commits
mailing list