This is an archive of the discontinued LLVM Phabricator instance.

[yaml2obj] - Improve handling of SectionHeaderTable::NoHeaders flag.
ClosedPublic

Authored by grimar on Oct 28 2020, 3:57 AM.

Details

Summary

When NoHeaders is set, we still have following issues:

  1. We emit the .shstrtab implicit section of size 1 (empty string table).
  2. We still align the start of the section header table, what affects the output size.
  3. We still write section header table bytes.

This patch fixes all of these issues.

Diff Detail

Event Timeline

grimar created this revision.Oct 28 2020, 3:57 AM
Herald added a project: Restricted Project. · View Herald Transcript
grimar requested review of this revision.Oct 28 2020, 3:57 AM
grimar updated this revision to Diff 301226.
  • Minor comment fix.
jhenderson added inline comments.Oct 28 2020, 5:48 AM
llvm/lib/ObjectYAML/ELFEmitter.cpp
1886–1896
llvm/test/tools/yaml2obj/ELF/section-headers.yaml
194–196

This might want a FIXME note. I think it corresponds to https://bugs.llvm.org/show_bug.cgi?id=40804 (might be worth putting that URL as a reference here too).

grimar updated this revision to Diff 301529.Oct 29 2020, 12:16 AM
grimar marked 2 inline comments as done.
  • Addressed review comment.
This revision is now accepted and ready to land.Oct 29 2020, 2:04 AM