Page MenuHomePhabricator

[XCOFF] XCOFF constants, MCObjectFileInfo placeholder code for DWARF; NFC

Authored by hubert.reinterpretcast on Apr 30 2020, 5:26 PM.



This patch introduces the constants defined to identify DWARF sections in XCOFF into llvm/BinaryFormat/XCOFF.h and adds (NFC) placeholder code to llvm/lib/MC/MCObjectFileInfo.cpp where the DWARF sections for XCOFF are to be set up.

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptApr 30 2020, 5:26 PM
jasonliu added inline comments.May 1 2020, 8:39 AM

If we want to have the comments telling what each one is doing, do we want to consider taking the description from
I find the description there is much clear than the short names we are using in the comments.

     Value   |     Macro	      | Description
		0x10000  | SSUBTYP_DWINFO   | DWARF info section
		0x20000  | SSUBTYP_DWLINE   | DWARF line-number section
		0x30000  | SSUBTYP_DWPBNMS  | DWARF public names section
		0x40000  | SSUBTYP_DWPBTYP  | DWARF public types section
		0x50000  | SSUBTYP_DWARNGE  | DWARF aranges section
		0x60000  | SSUBTYP_DWABREV  | DWARF abbreviation section
		0x70000  | SSUBTYP_DWSTR    | DWARF strings section
		0x80000  | SSUBTYP_DWRNGES  | DWARF ranges section
    0x90000  | SSUBTYPE_DWLOC   | DWARF location lists section
		0xA0000  | SSUBTYPE_DWFRAME | DWARF frames section
	  0xB0000  | SSUBTYPE_DWMAC   | DWARF macros section
hubert.reinterpretcast marked an inline comment as done.May 1 2020, 6:53 PM
hubert.reinterpretcast added inline comments.

The "short names" here are precisely the second-half of the officially defined names. The descriptions from the AIX docs are a bad idea because they are ambiguous given DWARF 5's replacement of some of these with newer sections used for similar information and matching the same description.

DiggerLin added inline comments.May 4 2020, 6:49 AM

what about to the initiation in the MCObjectFileInfo.h ?

MCSection *DwarfAbbrevSection = = nullptr;

hubert.reinterpretcast marked 2 inline comments as done.May 4 2020, 9:25 AM
hubert.reinterpretcast added inline comments.

That's the common default that this code is supposed to eventually override. The patch description already says this patch is NFC.

sfertile accepted this revision.May 4 2020, 9:37 AM



I didn't know there is a separator for numeric literals, that is pretty cool 👍 .

This revision is now accepted and ready to land.May 4 2020, 9:37 AM
jasonliu accepted this revision.May 4 2020, 3:24 PM


This revision was automatically updated to reflect the committed changes.
hubert.reinterpretcast marked an inline comment as done.