yaml2obj/obj2yaml does not support the symbols with STB_GNU_UNIQUE yet.
Currently, obj2yaml fails with llvm_unreachable when met such a symbol.
I faced it when investigated the https://bugs.llvm.org/show_bug.cgi?id=41196.
Paths
| Differential D59875
[yaml2obj][obj2yaml] - Teach yaml2obj/obj2yaml tools about STB_GNU_UNIQUE symbols. ClosedPublic Authored by grimar on Mar 27 2019, 6:11 AM.
Details Summary yaml2obj/obj2yaml does not support the symbols with STB_GNU_UNIQUE yet. I faced it when investigated the https://bugs.llvm.org/show_bug.cgi?id=41196.
Diff Detail Event TimelineComment Actions LGTM. The way symbols are handled in yaml2obj looks like it's desperately in need of an overhaul. It looks very fragile and easy to miss one thing when modifying it like you did here. That's a separate issue though.
This revision is now accepted and ready to land.Mar 28 2019, 2:59 AM Comment Actions
I also feel I do not like the way how yaml2obj describes/handles symbols now. At least currently for each binding, we might need to extend the syntax and it does not seem to me as a reasonable/nice approach in general.
Closed by commit rL357158: [yaml2obj][obj2yaml] - Teach yaml2obj/obj2yaml tools about STB_GNU_UNIQUE… (authored by grimar). · Explain WhyMar 28 2019, 3:52 AM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 192430 include/llvm/ObjectYAML/ELFYAML.h
lib/ObjectYAML/ELFYAML.cpp
test/tools/obj2yaml/elf-gnu-unique-symbols.yaml
test/tools/yaml2obj/elf-gnu-unique-symbols.yaml
tools/obj2yaml/elf2yaml.cpp
tools/yaml2obj/yaml2elf.cpp
|
Sounds to me like llvm_unreachable here is wrong, because it is reachable by any value not recognised. It should just be a normal error saying what the unknown binding value is. That can be a separate patch though if you want.