This is an archive of the discontinued LLVM Phabricator instance.

[yaml2obj/obj2yaml] - Add support for SHT_LLVM_DEPENDENT_LIBRARIES sections.
ClosedPublic

Authored by grimar on Nov 22 2019, 6:44 AM.

Details

Summary

This section contains strings specifying libraries to be added to the link by the linker.
The strings are encoded as standard null-terminated UTF-8 strings.

This patch adds a way to describe and dump SHT_LLVM_DEPENDENT_LIBRARIES sections.

I introduced a new YAMLFlowString type here. That used to teach obj2yaml to dump
them like:

Libraries: [ foo, bar ]

instead of the following (if StringRef would be used):

Libraries:
  - foo
  - bar

Diff Detail

Event Timeline

grimar created this revision.Nov 22 2019, 6:44 AM
MaskRay added inline comments.Nov 22 2019, 10:21 AM
llvm/lib/ObjectYAML/ELFEmitter.cpp
947

() can be omitted.

llvm/test/tools/yaml2obj/ELF/llvm-deplibs-section.yaml
67

Align the values.

llvm/tools/obj2yaml/elf2yaml.cpp
661

(I) -> I

grimar updated this revision to Diff 230786.Nov 24 2019, 2:00 AM
grimar marked 3 inline comments as done.
  • Addressed review comments.
jhenderson accepted this revision.Nov 25 2019, 1:21 AM

LGTM, with a couple of nits.

llvm/test/tools/obj2yaml/llvm-deplibs-section.yaml
27

to dump -> when dumping

also for case 3 and 4.

(I think that more clearly says that the interesting bit is "Libraries" in the output).

31

but section now has -> but the section has

This revision is now accepted and ready to land.Nov 25 2019, 1:21 AM
This revision was automatically updated to reflect the committed changes.
grimar marked 2 inline comments as done.