[PATCH] D67657: [yaml2obj/obj2yaml] - Do not trigger llvm_unreachable when dumping/parsing relocations and e_machine is unsupported.

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 19 22:43:42 PDT 2019


MaskRay accepted this revision.
MaskRay added a comment.
This revision is now accepted and ready to land.

> Though this situation is valid.

I would still argue this as an invalid case but I agree this is nice for testing purposes.



================
Comment at: test/tools/obj2yaml/relocation-unsupported-machine.yaml:1
+## Show that obj2yaml is able to dump relocations when machine type is unknown.
+
----------------
machine type -> the machine type
Or
e_machine


I find that the ELF spec describes e_machine as:

> This member's value specifies the required architecture for an individual file. 

"require architecture", not "machine type" as I thought.. So for the term used here, I have a slight preference for the literal `e_machine` now.


================
Comment at: test/tools/yaml2obj/relocation-unsupported-machine.yaml:1
+## Show that yaml2obj is able to write relocations for an unknown/unsupported
+## machine type properly.
----------------
an unknown `e_machine`


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

https://reviews.llvm.org/D67657





More information about the llvm-commits mailing list