This patch intends to provide relocation support for the expression contains two unpaired relocatable terms with opposite signs.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
| llvm/lib/MC/XCOFFObjectWriter.cpp | ||
|---|---|---|
| 421 | what about use const auto ? | |
| llvm/lib/MC/XCOFFObjectWriter.cpp | ||
|---|---|---|
| 421 | I'm guessing the reason you mention about "const auto" is that maybe it would help when we have 64 bit. | |
| llvm/lib/MC/XCOFFObjectWriter.cpp | ||
|---|---|---|
| 462 | I have question on the "SymbolA - SymbolB + imm64" for example: in the assembly of the test case .csect .text[PR]
.foo:
# %bb.0: # %entry
li 4, 0
cmplwi 3, 3
stw 3, -8(1)
stw 4, -12(1)
bgt 0, LBB0_5
# %bb.1: # %entry
lwz 4, LC0(2)
slwi 3, 3, 2
lwzx 3, 3, 4
add 3, 3, 4
mtctr 3
bctr
LBB0_2: # %sw.bb1
li 3, 1
b LBB0_6
.......
........
.csect .rodata[RO]
.align 2
.LJTI0_0: (symb)
.long LBB0_2-.LJTI0_0the address of LBB0_2 is 44 (0x2C) . the value in the 58: ff ff ff d4 .long 0xffffffd4 (-0x2C)
58: R_POS .text
58: R_NEG .rodata-0x58the jump address I think the content of in the address of the first bytes .csect .rodata[RO] after link in should be | |
| 463 | what about use XCOFF::RelocationType type instead of uint8_t ? | |
| llvm/lib/MC/XCOFFObjectWriter.cpp | ||
|---|---|---|
| 462 | please ignore above question. I got it . the value in the address 0x58 is .text+imm64-.rodata. | |
| llvm/lib/MC/XCOFFObjectWriter.cpp | ||
|---|---|---|
| 463 | At this stage, we are already lowering the high level representation to the actual binary level representation. XCOFFRelocation uses uint8_t to store the XCOFF::RelocationType, so I prefer to matches them here. | |
| llvm/lib/MC/XCOFFObjectWriter.cpp | ||
|---|---|---|
| 400 | On the assembly path, I don't see a label for function descriptor definitions or for common definitions. | |
| 401 | Typo: s/containting/containing/; | |
| 406 | If this is not being changed, then—given the size of the function—using const MCSymbol *const SymA could help readability. | |
| llvm/lib/MC/XCOFFObjectWriter.cpp | ||
|---|---|---|
| 400 | We don't have a label for function descriptor definitions or common definitions. So those symbols won't even get here. Could you elaborate your concern? | |
| llvm/lib/MC/XCOFFObjectWriter.cpp | ||
|---|---|---|
| 400 | Discussed offline, updated the misleading comments. | |
LGTM with a request for more input.
| llvm/test/CodeGen/PowerPC/aix-xcoff-reloc-symb.ll | ||
|---|---|---|
| 38 ↗ | (On Diff #256666) | I'd like a second opinion over whether this is too high-level. |
| llvm/test/CodeGen/PowerPC/aix-xcoff-reloc-symb.ll | ||
|---|---|---|
| 38 ↗ | (On Diff #256666) | I see your concern. The better way to write the test is through assembly. As you can easly write assembly like |
| llvm/test/CodeGen/PowerPC/aix-xcoff-reloc-symb.mir | ||
|---|---|---|
| 51 | I will subsitute index in this line and line 68, so that we don't use hardcoded value. | |
| llvm/test/CodeGen/PowerPC/aix-xcoff-reloc-symb.mir | ||
|---|---|---|
| 25 | I'm a bit disturbed by the weirdness of this function. I suggest the following. ---
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
... | |
| llvm/test/CodeGen/PowerPC/aix-xcoff-reloc-symb.mir | ||
|---|---|---|
| 25 | Thanks. It is much better. | |
On the assembly path, I don't see a label for function descriptor definitions or for common definitions.