summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCXCOFFStreamer.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [XCOFF][AIX] Emit TOC entries for object file generationjasonliu2019-12-041-6/+0
| | | | | | | | | | | | | | | | | | | | Summary: Implement emitTCEntry for PPCTargetXCOFFStreamer. Add TC csects to TOCCsects for object file writing. Note: 1. I did not include any raw data testing for this object file generation because TC entries raw data will all be 0 without relocation implemented. I will add raw data testing as part of relocation testing later. 2. I removed "Symbol->setFragment(F);" for common symbols because we don't need it, and if we have it then we would hit assertions below: Assertion `(SymbolContents == SymContentsUnset || SymbolContents == SymContentsOffset) && "Cannot get offset for a common/variable symbol"' failed. 3.Fixed incorrect TOC-base alignment. Differential Revision: https://reviews.llvm.org/D70798
* [XCOFF][AIX] Differentiate usage of label symbol and csect symbolJason Liu2019-11-081-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: We are using symbols to represent label and csect interchangeably before, and that could be a problem. There are cases we would need to add storage mapping class to the symbol if that symbol is actually the name of a csect, but it's hard for us to figure out whether that symbol is a label or csect. This patch intend to do the following: 1. Construct a QualName (A name include the storage mapping class) MCSymbolXCOFF for every MCSectionXCOFF. 2. Keep a pointer to that QualName inside of MCSectionXCOFF. 3. Use that QualName whenever we need a symbol refers to that MCSectionXCOFF. 4. Adapt the snowball effect from the above changes in XCOFFObjectWriter.cpp. Reviewers: xingxue, DiggerLin, sfertile, daltenty, hubert.reinterpretcast Reviewed By: DiggerLin, daltenty Subscribers: wuzish, nemanjai, mgorny, hiraditya, kbarton, jsji, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D69633
* [XCOFF] Output object text section header and symbol entry for program code.Digger Lin2019-10-151-4/+25
| | | | | | | | | | | | | | | | | | | | | | | | | This is remaining part of rG41ca91f2995b: [AIX][XCOFF] Output XCOFF object text section header and symbol entry for rogram code. SUMMARY: Original form of this patch is provided by Stefan Pintillie. 1. The patch try to output program code section header , symbol entry for program code (PR) and Instruction into the raw text section. 2. The patch include how to alignment and layout the CSection in the text section. 3. The patch also reorganize the code , put some codes into a function. (XCOFFObjectWriter::writeSymbolTableEntryForControlSection) Additional: We can not add raw data of text section test in the patch, If want to output raw text section data,it need a function description patch first. Reviewers: hubert.reinterpretcast, sfertile, jasonliu, xingxue. Subscribers: wuzish, nemanjai, hiraditya, MaskRay, jsjji. Differential Revision: https://reviews.llvm.org/D66969 llvm-svn: 374923
* Handle local commons for XCOFF object file writingJason Liu2019-08-271-4/+6
| | | | | | | | | | | | | | | Summary: Adds support for emitting common local global symbols to an XCOFF object file. Local commons are emitted into the .bss section with a storage class of C_HIDEXT. Patch by: daltenty Reviewers: sfertile, hubert.reinterpretcast Differential Revision: https://reviews.llvm.org/D66097 llvm-svn: 370070
* Adds support for writing the .bss section for XCOFF object files.Sean Fertile2019-08-201-1/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 369454
* [NFC][AIX] Use assert instead of llvm_unreachableDavid Tenty2019-08-131-2/+2
| | | | | | | | | | Addresses post-commit comments on https://reviews.llvm.org/D64825. Use assert instead of llvm_unreachable to check if invalid csect types are being generated. Use report_fatal_error on unimplemented XCOFF features. Differential Revision: https://reviews.llvm.org/D64825 llvm-svn: 368720
* Enable assembly output of local commons for AIXDavid Tenty2019-08-081-0/+5
| | | | | | | | | | | | | | | | | | | | | Summary: This patch enable assembly output of local commons for AIX using .lcomm directives. Adds a EmitXCOFFLocalCommonSymbol to MCStreamer so we can emit the AIX version of .lcomm assembly directives which include a csect name. Handle the case of BSS locals in PPCAIXAsmPrinter by using EmitXCOFFLocalCommonSymbol. Adds a test for generating .lcomm on AIX Targets. Reviewers: cebowleratibm, hubert.reinterpretcast, Xiangling_L, jasonliu, sfertile Reviewed By: sfertile Subscribers: wuzish, nemanjai, hiraditya, kbarton, MaskRay, jsji, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D64825 llvm-svn: 368306
* Boilerplate for producing XCOFF object files from the PowerPC backend.Sean Fertile2019-07-091-0/+59
Stubs out a number of the classes needed to produce a new object file format (XCOFF) for the powerpc-aix target. For testing input is an empty module which produces an object file with just a file header. Differential Revision: https://reviews.llvm.org/D61694 llvm-svn: 365541
OpenPOWER on IntegriCloud