[PATCH] D86309: [ELF] Handle SHT_RISCV_ATTRIBUTES similarly to SHT_ARM_ATTRIBUTES
Fangrui Song via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 20 16:17:03 PDT 2020
MaskRay added inline comments.
================
Comment at: lld/ELF/InputFiles.cpp:869
- switch (sec.sh_type) {
- case SHT_ARM_ATTRIBUTES: {
- if (config->emachine != EM_ARM)
- break;
+ if (config->emachine == EM_ARM && sec.sh_type == SHT_ARM_ATTRIBUTES) {
ARMAttributeParser attributes;
----------------
Keeping the switch may be fine.
```
case SHT_ARM_ATTRIBUTES:
assert(SHT_ARM_ATTRIBUTES == SHT_RISCV_ATTRIBUTES);
if (EM_ARM) {
} else if (EM_RISCV) {
} else
break;
```
Adding `assert(SHT_ARM_ATTRIBUTES == SHT_RISCV_ATTRIBUTES);` should be sufficiently clear.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D86309/new/
https://reviews.llvm.org/D86309
More information about the llvm-commits
mailing list