[PATCH] D88228: [yaml2obj][obj2yaml] - Add support for SHT_ARM_EXIDX section.

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 25 00:54:33 PDT 2020


jhenderson added inline comments.


================
Comment at: llvm/lib/ObjectYAML/ELFYAML.cpp:1322
+  const auto &Obj = *static_cast<ELFYAML::Object *>(IO.getContext());
+  if (Obj.getMachine() == ELF::EM_ARM && Type == ELF::SHT_ARM_EXIDX) {
+    if (!IO.outputting())
----------------
I think you should drop the `EM_ARM` requirement here. It doesn't really add anything, and makes it more restrictive on what one can use this code for. Imagine I have a downstream target that is ARM-based - I might have a different EM_* value, but still want to be able to use SHT_ARM_EXIDX, and therefore I'd want to be able to write tests using this format.


================
Comment at: llvm/test/tools/obj2yaml/ELF/arm-exidx-section.yaml:4
+## For a valid section, obj2yaml emits the "Entries" key.
+## This checks that we respect data endianess and recognize the
+## EXIDX_CANTUNWIND (0x1) special value properly.
----------------



================
Comment at: llvm/test/tools/obj2yaml/ELF/arm-exidx-section.yaml:24-27
+# BE-NEXT:     - Offset: 0xAABBCCDD
+# BE-NEXT:       Value:  EXIDX_CANTUNWIND
+# BE-NEXT:     - Offset: 0xEEFF8899
+# BE-NEXT:       Value:  0x01000000
----------------
I might be missing something, but why are the entries in a different order here? I wouldn't expect endianness ot have any impact outside individual values.


================
Comment at: llvm/test/tools/obj2yaml/ELF/arm-exidx-section.yaml:44
+
+## Check that we dump a content of a truncated SHT_ARM_EXIDX section
+## using the "Content" key.
----------------



================
Comment at: llvm/test/tools/yaml2obj/ELF/arm-exidx-section.yaml:52
+
+## Check we can set arbitraty section properties for a SHT_ARM_EXIDX section.
+## Also check that we are able to specify none of "Entries", "Content" nor "Size" keys.
----------------



================
Comment at: llvm/test/tools/yaml2obj/ELF/arm-exidx-section.yaml:119
+
+## Check we can use "Content" key alone to emit an arbitrary content.
+
----------------



================
Comment at: llvm/test/tools/yaml2obj/ELF/arm-exidx-section.yaml:125
+
+## Check we can use "Size" key alone to emit a content of an arbitrary size.
+
----------------



CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D88228/new/

https://reviews.llvm.org/D88228



More information about the llvm-commits mailing list