This is an archive of the discontinued LLVM Phabricator instance.

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

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

Details

Summary

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
llvm/include/llvm/BinaryFormat/XCOFF.h
96

nit:
If we want to have the comments telling what each one is doing, do we want to consider taking the description from https://www.ibm.com/support/knowledgecenter/en/ssw_aix_72/filesreference/XCOFF.html
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.
llvm/include/llvm/BinaryFormat/XCOFF.h
96

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
llvm/lib/MC/MCObjectFileInfo.cpp
841

what about to the initiation in the MCObjectFileInfo.h ?

as
MCSection *DwarfAbbrevSection = = nullptr;

hubert.reinterpretcast marked 2 inline comments as done.May 4 2020, 9:25 AM
hubert.reinterpretcast added inline comments.
llvm/lib/MC/MCObjectFileInfo.cpp
841

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

LGTM.

llvm/include/llvm/BinaryFormat/XCOFF.h
86

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

LGTM.

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