Enable assembly output of local commons for AIX
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
2019-08-08 15:40:35 +00:00
|
|
|
; RUN: llc -mtriple powerpc-ibm-aix-xcoff < %s | FileCheck %s
|
|
|
|
; RUN: llc -mtriple powerpc64-ibm-aix-xcoff < %s | FileCheck %s
|
|
|
|
|
2019-08-27 15:14:45 +00:00
|
|
|
; RUN: llc -mtriple powerpc-ibm-aix-xcoff -filetype=obj -o %t.o < %s
|
|
|
|
; RUN: llvm-readobj --section-headers --file-header %t.o | \
|
|
|
|
; RUN: FileCheck --check-prefix=OBJ %s
|
2019-09-06 18:56:14 +00:00
|
|
|
; RUN: llvm-readobj --syms %t.o | FileCheck --check-prefix=SYMS %s
|
2019-08-27 15:14:45 +00:00
|
|
|
|
2020-02-13 10:08:05 -08:00
|
|
|
; RUN: not llc -mtriple powerpc64-ibm-aix-xcoff -filetype=obj < %s 2>&1 | \
|
2019-08-27 15:14:45 +00:00
|
|
|
; RUN: FileCheck --check-prefix=OBJ64 %s
|
|
|
|
; OBJ64: LLVM ERROR: 64-bit XCOFF object files are not supported yet.
|
|
|
|
|
Enable assembly output of local commons for AIX
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
2019-08-08 15:40:35 +00:00
|
|
|
@a = internal global i32 0, align 4
|
|
|
|
@b = internal global i64 0, align 8
|
|
|
|
@c = internal global i16 0, align 2
|
|
|
|
|
[XCOFF][AIX] Differentiate usage of label symbol and csect symbol
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
2019-11-08 09:26:28 -05:00
|
|
|
; CHECK: .lcomm a,4,a[BS],2
|
|
|
|
; CHECK-NEXT: .lcomm b,8,b[BS],3
|
|
|
|
; CHECK-NEXT: .lcomm c,2,c[BS],1
|
2019-08-27 15:14:45 +00:00
|
|
|
|
|
|
|
; OBJ: File: {{.*}}aix-xcoff-lcomm.ll.tmp.o
|
|
|
|
; OBJ-NEXT: Format: aixcoff-rs6000
|
|
|
|
; OBJ-NEXT: Arch: powerpc
|
|
|
|
; OBJ-NEXT: AddressSize: 32bit
|
|
|
|
; OBJ-NEXT: FileHeader {
|
|
|
|
; OBJ-NEXT: Magic: 0x1DF
|
[XCOFF] Output object text section header and symbol entry for program code.
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
2019-10-15 17:40:41 +00:00
|
|
|
; OBJ-NEXT: NumberOfSections: 2
|
2019-08-27 15:14:45 +00:00
|
|
|
; OBJ-NEXT: TimeStamp:
|
[XCOFF] Output object text section header and symbol entry for program code.
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
2019-10-15 17:40:41 +00:00
|
|
|
; OBJ-NEXT: SymbolTableOffset: 0x64
|
|
|
|
; OBJ-NEXT: SymbolTableEntries: 8
|
2019-08-27 15:14:45 +00:00
|
|
|
; OBJ-NEXT: OptionalHeaderSize: 0x0
|
|
|
|
; OBJ-NEXT: Flags: 0x0
|
|
|
|
; OBJ-NEXT: }
|
|
|
|
; OBJ-NEXT: Sections [
|
[XCOFF] Output object text section header and symbol entry for program code.
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
2019-10-15 17:40:41 +00:00
|
|
|
; OBJ: Section {{[{][[:space:]] *}}Index: 2
|
2019-08-27 15:14:45 +00:00
|
|
|
; OBJ-NEXT: Name: .bss
|
|
|
|
; OBJ-NEXT: PhysicalAddress: 0x0
|
|
|
|
; OBJ-NEXT: VirtualAddress: 0x0
|
|
|
|
; OBJ-NEXT: Size: 0x14
|
|
|
|
; OBJ-NEXT: RawDataOffset: 0x0
|
|
|
|
; OBJ-NEXT: RelocationPointer: 0x0
|
|
|
|
; OBJ-NEXT: LineNumberPointer: 0x0
|
|
|
|
; OBJ-NEXT: NumberOfRelocations: 0
|
|
|
|
; OBJ-NEXT: NumberOfLineNumbers: 0
|
|
|
|
; OBJ-NEXT: Type: STYP_BSS (0x80)
|
|
|
|
; OBJ-NEXT: }
|
|
|
|
; OBJ-NEXT: ]
|
2019-09-06 18:56:14 +00:00
|
|
|
|
|
|
|
; SYMS: File: {{.*}}aix-xcoff-lcomm.ll.tmp.o
|
|
|
|
; SYMS-NEXT: Format: aixcoff-rs6000
|
|
|
|
; SYMS-NEXT: Arch: powerpc
|
|
|
|
; SYMS-NEXT: AddressSize: 32bit
|
|
|
|
; SYMS-NEXT: Symbols [
|
[XCOFF] Output object text section header and symbol entry for program code.
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
2019-10-15 17:40:41 +00:00
|
|
|
; SYMS: Symbol {{[{][[:space:]] *}}Index: [[#Index:]]{{[[:space:]] *}}Name: a
|
2019-09-06 18:56:14 +00:00
|
|
|
; SYMS-NEXT: Value (RelocatableAddress): 0x0
|
|
|
|
; SYMS-NEXT: Section: .bss
|
|
|
|
; SYMS-NEXT: Type: 0x0
|
|
|
|
; SYMS-NEXT: StorageClass: C_HIDEXT (0x6B)
|
|
|
|
; SYMS-NEXT: NumberOfAuxEntries: 1
|
|
|
|
; SYMS-NEXT: CSECT Auxiliary Entry {
|
|
|
|
; SYMS-NEXT: Index: [[#Index + 1]]
|
|
|
|
; SYMS-NEXT: SectionLen: 4
|
|
|
|
; SYMS-NEXT: ParameterHashIndex: 0x0
|
|
|
|
; SYMS-NEXT: TypeChkSectNum: 0x0
|
|
|
|
; SYMS-NEXT: SymbolAlignmentLog2: 2
|
|
|
|
; SYMS-NEXT: SymbolType: XTY_CM (0x3)
|
|
|
|
; SYMS-NEXT: StorageMappingClass: XMC_BS (0x9)
|
|
|
|
; SYMS-NEXT: StabInfoIndex: 0x0
|
|
|
|
; SYMS-NEXT: StabSectNum: 0x0
|
|
|
|
; SYMS-NEXT: }
|
|
|
|
; SYMS-NEXT: }
|
|
|
|
; SYMS-NEXT: Symbol {
|
|
|
|
; SYMS-NEXT: Index: [[#Index + 2]]
|
|
|
|
; SYMS-NEXT: Name: b
|
|
|
|
; SYMS-NEXT: Value (RelocatableAddress): 0x8
|
|
|
|
; SYMS-NEXT: Section: .bss
|
|
|
|
; SYMS-NEXT: Type: 0x0
|
|
|
|
; SYMS-NEXT: StorageClass: C_HIDEXT (0x6B)
|
|
|
|
; SYMS-NEXT: NumberOfAuxEntries: 1
|
|
|
|
; SYMS-NEXT: CSECT Auxiliary Entry {
|
|
|
|
; SYMS-NEXT: Index: [[#Index + 3]]
|
|
|
|
; SYMS-NEXT: SectionLen: 8
|
|
|
|
; SYMS-NEXT: ParameterHashIndex: 0x0
|
|
|
|
; SYMS-NEXT: TypeChkSectNum: 0x0
|
|
|
|
; SYMS-NEXT: SymbolAlignmentLog2: 3
|
|
|
|
; SYMS-NEXT: SymbolType: XTY_CM (0x3)
|
|
|
|
; SYMS-NEXT: StorageMappingClass: XMC_BS (0x9)
|
|
|
|
; SYMS-NEXT: StabInfoIndex: 0x0
|
|
|
|
; SYMS-NEXT: StabSectNum: 0x0
|
|
|
|
; SYMS-NEXT: }
|
|
|
|
; SYMS-NEXT: }
|
|
|
|
; SYMS-NEXT: Symbol {
|
|
|
|
; SYMS-NEXT: Index: [[#Index + 4]]
|
|
|
|
; SYMS-NEXT: Name: c
|
|
|
|
; SYMS-NEXT: Value (RelocatableAddress): 0x10
|
|
|
|
; SYMS-NEXT: Section: .bss
|
|
|
|
; SYMS-NEXT: Type: 0x0
|
|
|
|
; SYMS-NEXT: StorageClass: C_HIDEXT (0x6B)
|
|
|
|
; SYMS-NEXT: NumberOfAuxEntries: 1
|
|
|
|
; SYMS-NEXT: CSECT Auxiliary Entry {
|
|
|
|
; SYMS-NEXT: Index: [[#Index + 5]]
|
|
|
|
; SYMS-NEXT: SectionLen: 2
|
|
|
|
; SYMS-NEXT: ParameterHashIndex: 0x0
|
|
|
|
; SYMS-NEXT: TypeChkSectNum: 0x0
|
|
|
|
; SYMS-NEXT: SymbolAlignmentLog2: 1
|
|
|
|
; SYMS-NEXT: SymbolType: XTY_CM (0x3)
|
|
|
|
; SYMS-NEXT: StorageMappingClass: XMC_BS (0x9)
|
|
|
|
; SYMS-NEXT: StabInfoIndex: 0x0
|
|
|
|
; SYMS-NEXT: StabSectNum: 0x0
|
|
|
|
; SYMS-NEXT: }
|
|
|
|
; SYMS-NEXT: }
|
|
|
|
; SYMS-NEXT: ]
|