This is an archive of the discontinued LLVM Phabricator instance.

[ObjectYAML][ELF] Let the endianness of DWARF sections be inferred from FileHeader.

Authored by Higuoxing on Jun 2 2020, 8:22 PM.



This patch helps infer the endianness of DWARF sections from FileHeader.

Diff Detail

Event Timeline

Higuoxing created this revision.Jun 2 2020, 8:22 PM
Higuoxing retitled this revision from [ObjectYAML][ELF] Let the endianness be inferred from FileHeader. to [ObjectYAML][ELF] Let the endianness of DWARF sections be inferred from FileHeader..Jun 3 2020, 12:05 AM

Same comments generally apply to this test case as the big endian one from D80972. Otherwise, this looks fine.


You're welcome to continue to use %t1.o and %t2.o etc if you want - my previous suggestion in this area was more by way of example. What you have here is fine too though.

grimar accepted this revision.EditedJun 3 2020, 2:17 AM

This LGTM.

(With @jhenderson comments addressed. Haven't saw them when approved).

This revision is now accepted and ready to land.Jun 3 2020, 2:17 AM
Higuoxing marked 2 inline comments as done.Jun 3 2020, 6:24 AM
Higuoxing added inline comments.
7–9 and %t.le.o belong to the test case (a). I want to avoid having something like:

# RUN: yaml2obj --docnum=1 %s -o %t1.o ## Big endian case.
# RUN: yaml2obj --docnum=1 %s -o %t2.o ## Little endian case.
# RUN: yaml2obj --dconum=2 %s -o %t3.o
Higuoxing updated this revision to Diff 268168.Jun 3 2020, 6:26 AM
Higuoxing marked an inline comment as done.
  • Rebase.
  • Address comments in D80972.
    • Remove spaces between dashes.
jhenderson accepted this revision.Jun 3 2020, 6:37 AM



Makes sense.

This revision was automatically updated to reflect the committed changes.