[RISCV] ELF attribute section for RISC-V.

Leverage ARM ELF build attribute section to create ELF attribute section
for RISC-V. Extract the common part of parsing logic for this section
into ELFAttributeParser.[cpp|h] and ELFAttributes.[cpp|h].

Differential Revision: https://reviews.llvm.org/D74023
This commit is contained in:
Kai Wang
2020-02-04 22:20:10 +08:00
parent 86b4076027
commit 581ba35291
40 changed files with 1455 additions and 348 deletions

View File

@@ -1239,7 +1239,7 @@ void ObjectFileELF::ParseARMAttributes(DataExtractor &data, uint64_t length,
lldb::offset_t Offset = 0;
uint8_t FormatVersion = data.GetU8(&Offset);
if (FormatVersion != llvm::ARMBuildAttrs::Format_Version)
if (FormatVersion != llvm::ELFAttrs::Format_Version)
return;
Offset = Offset + sizeof(uint32_t); // Section Length