[llvm] ef9dc51 - [obj2yaml][yaml2obj] - Add AArch64 STO_AARCH64_VARIANT_PCS support
Adhemerval Zanella via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 17 06:34:30 PST 2020
Author: Adhemerval Zanella
Date: 2020-12-17T11:09:53-03:00
New Revision: ef9dc51cd4af509e7c28573e15e13a98b17c9511
URL: https://github.com/llvm/llvm-project/commit/ef9dc51cd4af509e7c28573e15e13a98b17c9511
DIFF: https://github.com/llvm/llvm-project/commit/ef9dc51cd4af509e7c28573e15e13a98b17c9511.diff
LOG: [obj2yaml][yaml2obj] - Add AArch64 STO_AARCH64_VARIANT_PCS support
Reviewed By: grimar, MaskRay
Differential Revision: https://reviews.llvm.org/D93235
Added:
llvm/test/tools/obj2yaml/ELF/aarch64-sym-other.yaml
Modified:
llvm/lib/ObjectYAML/ELFYAML.cpp
Removed:
################################################################################
diff --git a/llvm/lib/ObjectYAML/ELFYAML.cpp b/llvm/lib/ObjectYAML/ELFYAML.cpp
index 52a4a3a2d80b..3a280b06336d 100644
--- a/llvm/lib/ObjectYAML/ELFYAML.cpp
+++ b/llvm/lib/ObjectYAML/ELFYAML.cpp
@@ -1040,6 +1040,9 @@ struct NormalizedOther {
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
index 000000000000..ad20a6546e62
--- /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 ]
More information about the llvm-commits
mailing list