Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[XCOFF][AIX] Relocation support for SymB
This patch intends to provide relocation support for the expression contains two unpaired relocatable terms with opposite signs. Differential Revision: https://reviews.llvm.org/D77424
- Loading branch information
1 parent
4578fa8
commit c3c67e9
Showing
2 changed files
with
133 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
# RUN: llc -verify-machineinstrs -mcpu=pwr4 -mtriple powerpc-ibm-aix-xcoff -x mir -verify-machineinstrs -start-after=lazy-machine-block-freq -filetype=obj -o %t.o < %s | ||
# RUN: llvm-readobj --relocs --expand-relocs -t %t.o | FileCheck --check-prefixes=RELOC,SYM %s | ||
# RUN: llvm-objdump -D %t.o | FileCheck --check-prefix=DIS %s | ||
|
||
--- | ||
name: foo | ||
alignment: 16 | ||
tracksRegLiveness: true | ||
jumpTable: | ||
kind: label-difference32 | ||
entries: | ||
- id: 0 | ||
blocks: [ '%bb.0' ] | ||
body: | | ||
bb.0: | ||
successors: %bb.0(0x20000000) | ||
liveins: $r2 | ||
renamable $r3 = LWZtoc %jump-table.0, $r2 :: (load 4 from got) | ||
BLR implicit $lr, implicit $rm, implicit killed $r3 | ||
... | ||
|
||
# RELOC: Relocation {{[{][[:space:]] *}}Virtual Address: 0x8 | ||
# RELOC-NEXT: Symbol: .text ([[#TXT_INDX:]]) | ||
# RELOC-NEXT: IsSigned: No | ||
# RELOC-NEXT: FixupBitValue: 0 | ||
# RELOC-NEXT: Length: 32 | ||
# RELOC-NEXT: Type: R_POS (0x0) | ||
# RELOC-NEXT: } | ||
# RELOC-NEXT: Relocation { | ||
# RELOC-NEXT: Virtual Address: 0x8 | ||
# RELOC-NEXT: Symbol: .rodata ([[#RO_INDX:]]) | ||
# RELOC-NEXT: IsSigned: No | ||
# RELOC-NEXT: FixupBitValue: 0 | ||
# RELOC-NEXT: Length: 32 | ||
# RELOC-NEXT: Type: R_NEG (0x1) | ||
# RELOC-NEXT: } | ||
|
||
# SYM: Symbol {{[{][[:space:]] *}}Index: [[#TXT_INDX]]{{[[:space:]] *}}Name: .text | ||
# SYM-NEXT: Value (RelocatableAddress): 0x0 | ||
# SYM-NEXT: Section: .text | ||
# SYM-NEXT: Type: 0x0 | ||
# SYM-NEXT: StorageClass: C_HIDEXT (0x6B) | ||
# SYM-NEXT: NumberOfAuxEntries: 1 | ||
# SYM-NEXT: CSECT Auxiliary Entry { | ||
# SYM-NEXT: Index: [[#TXT_INDX+1]] | ||
# SYM-NEXT: SectionLen: 8 | ||
# SYM-NEXT: ParameterHashIndex: 0x0 | ||
# SYM-NEXT: TypeChkSectNum: 0x0 | ||
# SYM-NEXT: SymbolAlignmentLog2: 4 | ||
# SYM-NEXT: SymbolType: XTY_SD (0x1) | ||
# SYM-NEXT: StorageMappingClass: XMC_PR (0x0) | ||
# SYM-NEXT: StabInfoIndex: 0x0 | ||
# SYM-NEXT: StabSectNum: 0x0 | ||
# SYM-NEXT: } | ||
# SYM-NEXT: } | ||
# SYM: Symbol {{[{][[:space:]] *}}Index: [[#RO_INDX]]{{[[:space:]] *}}Name: .rodata | ||
# SYM-NEXT: Value (RelocatableAddress): 0x8 | ||
# SYM-NEXT: Section: .text | ||
# SYM-NEXT: Type: 0x0 | ||
# SYM-NEXT: StorageClass: C_HIDEXT (0x6B) | ||
# SYM-NEXT: NumberOfAuxEntries: 1 | ||
# SYM-NEXT: CSECT Auxiliary Entry { | ||
# SYM-NEXT: Index: [[#RO_INDX+1]] | ||
# SYM-NEXT: SectionLen: 4 | ||
# SYM-NEXT: ParameterHashIndex: 0x0 | ||
# SYM-NEXT: TypeChkSectNum: 0x0 | ||
# SYM-NEXT: SymbolAlignmentLog2: 2 | ||
# SYM-NEXT: SymbolType: XTY_SD (0x1) | ||
# SYM-NEXT: StorageMappingClass: XMC_RO (0x1) | ||
# SYM-NEXT: StabInfoIndex: 0x0 | ||
# SYM-NEXT: StabSectNum: 0x0 | ||
# SYM-NEXT: } | ||
# SYM-NEXT: } | ||
|
||
# DIS: Disassembly of section .text: | ||
# DIS-EMPTY: | ||
# DIS-NEXT: 00000000 <.text>: | ||
# DIS-NEXT: 0: 80 62 00 00 lwz 3, 0(2) | ||
# DIS-NEXT: 4: 4e 80 00 20 blr | ||
# DIS-EMPTY: | ||
# DIS-NEXT: 00000008 <.rodata>: | ||
# DIS-NEXT: 8: ff ff ff f8 fmsub 31, 31, 31, 31 | ||
# DIS-EMPTY: |