[MC] Accept a numeric value as an ELF section header's type
GAS supports specification of section header's type using a numeric value [1]. This patch brings the same functionality to LLVM. That allows to setup some target-specific section types belong to the SHT_LOPROC - SHT_HIPROC range. If we attempt to print unknown section type, MCSectionELF class shows an error message. It's better than print sole '@' sign without any section type name. In case of MIPS, example of such section's type is SHT_MIPS_DWARF. Without the patch we will have to implement some workarounds in probably not-MIPS-specific part of code base to convert SHT_MIPS_DWARF to the @progbits while printing assembly and to assign SHT_MIPS_DWARF for @progbits sections named .debug_* if we encounter such section in an input assembly. [1] https://sourceware.org/binutils/docs/as/Section.html Differential Revision: https://reviews.llvm.org/D29719 llvm-svn: 297446
Showing
- llvm/lib/MC/MCParser/ELFAsmParser.cpp 5 additions, 2 deletionsllvm/lib/MC/MCParser/ELFAsmParser.cpp
- llvm/lib/MC/MCSectionELF.cpp 4 additions, 0 deletionsllvm/lib/MC/MCSectionELF.cpp
- llvm/test/MC/ELF/section-numeric-invalid-type.s 14 additions, 0 deletionsllvm/test/MC/ELF/section-numeric-invalid-type.s
- llvm/test/MC/ELF/section-numeric-type.s 20 additions, 0 deletionsllvm/test/MC/ELF/section-numeric-type.s
Loading
Please register or sign in to comment