mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 04:30:23 +00:00
[ELFYAML] Group ELF section type flags to target specific blocks.
Recognize only flags which correspond to the current target. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212880 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
452bd5f9c6
commit
dafce2c9a6
@ -298,6 +298,8 @@ void ScalarBitSetTraits<ELFYAML::ELF_EF>::bitset(IO &IO,
|
||||
|
||||
void ScalarEnumerationTraits<ELFYAML::ELF_SHT>::enumeration(
|
||||
IO &IO, ELFYAML::ELF_SHT &Value) {
|
||||
const auto *Object = static_cast<ELFYAML::Object *>(IO.getContext());
|
||||
assert(Object && "The IO context is not initialized");
|
||||
#define ECase(X) IO.enumCase(Value, #X, ELF::X);
|
||||
ECase(SHT_NULL)
|
||||
ECase(SHT_PROGBITS)
|
||||
@ -325,15 +327,27 @@ void ScalarEnumerationTraits<ELFYAML::ELF_SHT>::enumeration(
|
||||
ECase(SHT_GNU_versym)
|
||||
ECase(SHT_HIOS)
|
||||
ECase(SHT_LOPROC)
|
||||
ECase(SHT_ARM_EXIDX)
|
||||
ECase(SHT_ARM_PREEMPTMAP)
|
||||
ECase(SHT_ARM_ATTRIBUTES)
|
||||
ECase(SHT_ARM_DEBUGOVERLAY)
|
||||
ECase(SHT_ARM_OVERLAYSECTION)
|
||||
ECase(SHT_HEX_ORDERED)
|
||||
ECase(SHT_X86_64_UNWIND)
|
||||
ECase(SHT_MIPS_REGINFO)
|
||||
ECase(SHT_MIPS_OPTIONS)
|
||||
switch (Object->Header.Machine) {
|
||||
case ELF::EM_ARM:
|
||||
ECase(SHT_ARM_EXIDX)
|
||||
ECase(SHT_ARM_PREEMPTMAP)
|
||||
ECase(SHT_ARM_ATTRIBUTES)
|
||||
ECase(SHT_ARM_DEBUGOVERLAY)
|
||||
ECase(SHT_ARM_OVERLAYSECTION)
|
||||
break;
|
||||
case ELF::EM_HEXAGON:
|
||||
ECase(SHT_HEX_ORDERED)
|
||||
break;
|
||||
case ELF::EM_X86_64:
|
||||
ECase(SHT_X86_64_UNWIND)
|
||||
break;
|
||||
case ELF::EM_MIPS:
|
||||
ECase(SHT_MIPS_REGINFO)
|
||||
ECase(SHT_MIPS_OPTIONS)
|
||||
default:
|
||||
// Nothing to do.
|
||||
break;
|
||||
}
|
||||
#undef ECase
|
||||
}
|
||||
|
||||
|
BIN
test/Object/Inputs/unwind-section.elf-x86-64
Normal file
BIN
test/Object/Inputs/unwind-section.elf-x86-64
Normal file
Binary file not shown.
@ -3,6 +3,8 @@ RUN: obj2yaml %p/Inputs/trivial-object-test.coff-x86-64 | FileCheck %s --check-p
|
||||
RUN: obj2yaml %p/Inputs/trivial-object-test.elf-mipsel | FileCheck %s --check-prefix ELF-MIPSEL
|
||||
RUN: obj2yaml %p/Inputs/trivial-object-test.elf-mips64el | FileCheck %s --check-prefix ELF-MIPS64EL
|
||||
RUN: obj2yaml %p/Inputs/trivial-object-test.elf-x86-64 | FileCheck %s --check-prefix ELF-X86-64
|
||||
RUN: obj2yaml %p/Inputs/unwind-section.elf-x86-64 \
|
||||
RUN: | FileCheck %s --check-prefix ELF-X86-64-UNWIND
|
||||
|
||||
COFF-I386: header:
|
||||
COFF-I386-NEXT: Machine: IMAGE_FILE_MACHINE_I386
|
||||
@ -405,3 +407,9 @@ ELF-X86-64-NEXT: Section: .text
|
||||
ELF-X86-64-NEXT: Size: 0x0000000000000026
|
||||
ELF-X86-64-NEXT: - Name: SomeOtherFunction
|
||||
ELF-X86-64-NEXT: - Name: puts
|
||||
|
||||
ELF-X86-64-UNWIND: - Name: .eh_frame
|
||||
ELF-X86-64-UNWIND-NEXT: Type: SHT_X86_64_UNWIND
|
||||
ELF-X86-64-UNWIND-NEXT: Flags: [ SHF_ALLOC ]
|
||||
ELF-X86-64-UNWIND-NEXT: AddressAlign: 0x0000000000000001
|
||||
ELF-X86-64-UNWIND-NEXT: Content: ''
|
||||
|
Loading…
Reference in New Issue
Block a user