]> granicus.if.org Git - llvm/commit
Adds support for writing the .bss section for XCOFF object files.
authorSean Fertile <sfertile@ca.ibm.com>
Tue, 20 Aug 2019 22:03:18 +0000 (22:03 +0000)
committerSean Fertile <sfertile@ca.ibm.com>
Tue, 20 Aug 2019 22:03:18 +0000 (22:03 +0000)
commitb0e685a1a372b1ef1978bfcc16ebeb2be9c70b82
tree73f9677ad3a4f6cc7d013af682a1103ad2a946df
parentbe1590c3b8e8700daff64d7cd8297523ec9b6c21
Adds support for writing the .bss section for XCOFF object files.

Adds Wrapper classes for MCSymbol and MCSection into the XCOFF target
object writer. Also adds a class to represent the top-level sections, which we
materialize in the ObjectWriter.

executePostLayoutBinding will map all csects into the appropriate
container depending on its storage mapping class, and map all symbols
into their containing csect. Once all symbols have been processed we
- Assign addresses and symbol table indices.
- Calaculte section sizes.
- Build the section header table.
- Assign the sections raw-pointer value for non-virtual sections.

Since the .bss section is virtual, writing the header table is enough to
add support. Writing of a sections raw data, or of any relocations is
not included in this patch.

Testing is done by dumping the section header table, but it needs to be
extended to include dumping the symbol table once readobj support for
dumping auxiallary entries lands.

Differential Revision: https://reviews.llvm.org/D65159

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369454 91177308-0d34-0410-b5e6-96231b3b80d8
14 files changed:
include/llvm/BinaryFormat/XCOFF.h
include/llvm/CodeGen/TargetLoweringObjectFileImpl.h
include/llvm/MC/MCContext.h
include/llvm/MC/MCSectionXCOFF.h
include/llvm/MC/MCSymbolXCOFF.h
include/llvm/MC/StringTableBuilder.h
lib/CodeGen/TargetLoweringObjectFileImpl.cpp
lib/MC/MCContext.cpp
lib/MC/MCObjectFileInfo.cpp
lib/MC/MCXCOFFStreamer.cpp
lib/MC/StringTableBuilder.cpp
lib/MC/XCOFFObjectWriter.cpp
lib/Target/PowerPC/PPCAsmPrinter.cpp
test/CodeGen/PowerPC/aix-xcoff-common.ll