diff --git a/llvm/lib/ObjectYAML/ELFYAML.cpp b/llvm/lib/ObjectYAML/ELFYAML.cpp --- a/llvm/lib/ObjectYAML/ELFYAML.cpp +++ b/llvm/lib/ObjectYAML/ELFYAML.cpp @@ -1040,6 +1040,9 @@ Map["STO_MIPS_PLT"] = ELF::STO_MIPS_PLT; Map["STO_MIPS_OPTIONAL"] = ELF::STO_MIPS_OPTIONAL; } + + if (EMachine == ELF::EM_AARCH64) + Map["STO_AARCH64_VARIANT_PCS"] = ELF::STO_AARCH64_VARIANT_PCS; return Map; } diff --git a/llvm/test/tools/obj2yaml/ELF/aarch64-sym-other.yaml b/llvm/test/tools/obj2yaml/ELF/aarch64-sym-other.yaml new file mode 100644 --- /dev/null +++ b/llvm/test/tools/obj2yaml/ELF/aarch64-sym-other.yaml @@ -0,0 +1,22 @@ +## Check AArch64 st_other extension support + +# RUN: yaml2obj %s -o %t +# RUN: obj2yaml %t | FileCheck %s + +# CHECK: Symbols: +# CHECK: - Name: foo1 +# CHECK: Other: [ STO_AARCH64_VARIANT_PCS ] +# CHECK: - Name: foo2 +# CHECK: Other: [ STO_AARCH64_VARIANT_PCS, 64 ] + +--- !ELF +FileHeader: + Class: ELFCLASS64 + Data: ELFDATA2LSB + Type: ET_REL + Machine: EM_AARCH64 +Symbols: + - Name: foo1 + Other: [ STO_AARCH64_VARIANT_PCS ] + - Name: foo2 + Other: [ STO_AARCH64_VARIANT_PCS, 0x40 ]