Index: lib/ObjectYAML/ELFYAML.cpp =================================================================== --- lib/ObjectYAML/ELFYAML.cpp +++ lib/ObjectYAML/ELFYAML.cpp @@ -359,6 +359,14 @@ BCase(EF_AVR_ARCH_XMEGA6); BCase(EF_AVR_ARCH_XMEGA7); break; + case ELF::EM_RISCV: + BCase(EF_RISCV_RVC); + BCaseMask(EF_RISCV_FLOAT_ABI_SOFT, EF_RISCV_FLOAT_ABI); + BCaseMask(EF_RISCV_FLOAT_ABI_SINGLE, EF_RISCV_FLOAT_ABI); + BCaseMask(EF_RISCV_FLOAT_ABI_DOUBLE, EF_RISCV_FLOAT_ABI); + BCaseMask(EF_RISCV_FLOAT_ABI_QUAD, EF_RISCV_FLOAT_ABI); + BCase(EF_RISCV_RVE); + break; case ELF::EM_AMDGPU: case ELF::EM_X86_64: break; Index: test/Object/RISCV/elf-flags.yaml =================================================================== --- /dev/null +++ test/Object/RISCV/elf-flags.yaml @@ -0,0 +1,17 @@ +# RUN: yaml2obj %s > %t +# RUN: obj2yaml %t | FileCheck -check-prefix=YAML %s + +# YAML: FileHeader: +# YAML-NEXT: Class: ELFCLASS32 +# YAML-NEXT: Data: ELFDATA2LSB +# YAML-NEXT: Type: ET_EXEC +# YAML-NEXT: Machine: EM_RISCV +# YAML-NEXT: Flags: [ EF_RISCV_RVC, EF_RISCV_FLOAT_ABI_DOUBLE, EF_RISCV_RVE ] + +--- !ELF +FileHeader: + Class: ELFCLASS32 + Data: ELFDATA2LSB + Type: ET_EXEC + Machine: EM_RISCV + Flags: [ EF_RISCV_RVC, EF_RISCV_FLOAT_ABI_DOUBLE, EF_RISCV_RVE ] Index: test/Object/RISCV/lit.local.cfg =================================================================== --- /dev/null +++ test/Object/RISCV/lit.local.cfg @@ -0,0 +1,2 @@ +if not 'RISCV' in config.root.targets: + config.unsupported = True