This is an archive of the discontinued LLVM Phabricator instance.

[ObjectYAML][ELF] Add support for emitting the .debug_pubnames section.
ClosedPublic

Authored by Higuoxing on Jun 22 2020, 6:27 AM.

Details

Summary

This patch helps add support for emitting the .debug_pubnames section to yaml2elf.

Known issues:

  • Current implementation doesn't support emitting multiple sets of entries.
  • Doesn't support DWARF64.

Diff Detail

Event Timeline

Higuoxing created this revision.Jun 22 2020, 6:27 AM
jhenderson accepted this revision.Jun 22 2020, 7:25 AM

This patch LGTM. Don't spend hours of time working on supporting .pubnames/.pubtypes however, as they aren't widely used by my understanding. Still, for completeness, it doesn't hurt to support them for now.

This revision is now accepted and ready to land.Jun 22 2020, 7:25 AM

This patch LGTM. Don't spend hours of time working on supporting .pubnames/.pubtypes however, as they aren't widely used by my understanding. Still, for completeness, it doesn't hurt to support them for now.

Yeah, I will not spend too much time on them. In the next patch, I will replace the InitialLength with Format and Length just as what we do in other sections. As for supporting multiple sets of entries, if nobody requests it, I will not work on it.

This patch LGTM. Don't spend hours of time working on supporting .pubnames/.pubtypes however, as they aren't widely used by my understanding. Still, for completeness, it doesn't hurt to support them for now.

Yeah, I will not spend too much time on them. In the next patch, I will replace the InitialLength with Format and Length just as what we do in other sections. As for supporting multiple sets of entries, if nobody requests it, I will not work on it.

I think if you end up with some spare time towards the end of the project, it doesn't hurt to "finish this off". Just not at the cost of more useful features. I do agree with the Length change though. Consistency is quite important.

This revision was automatically updated to reflect the committed changes.
aprantl added inline comments.Jun 26 2020, 10:17 AM
llvm/lib/ObjectYAML/ELFEmitter.cpp
947

FYI: This looks like a good candidate for http://llvm.org/doxygen/classllvm_1_1StringSwitch.html

Higuoxing marked an inline comment as done.Jun 28 2020, 7:28 PM
Higuoxing added inline comments.
llvm/lib/ObjectYAML/ELFEmitter.cpp
947

Thanks a lot for pointing this out! I'll look into it.