Support TOCU and TOCL relocation type for object file generation.
Details
Diff Detail
Event Timeline
llvm/lib/MC/XCOFFObjectWriter.cpp | ||
---|---|---|
433 | I just wonder why there is no Type == XCOFF::RelocationType::R_TOCU ? we do not need to applyFixup for the instruction ? | |
435–440 | I am not sure whether I understand is correct or not ? lwz 3, L..C0@l(3) FixedValue should get the low 16bits of SectionMap[SymASec]->Address - TOCCsects.front().Address; if I understand correct , the code need to change. |
llvm/lib/MC/XCOFFObjectWriter.cpp | ||
---|---|---|
435–440 | Could you give an example that would generated non-0 FixedValue in TOCU position? |
llvm/lib/MC/XCOFFObjectWriter.cpp | ||
---|---|---|
435–440 | 1ae98: 3c 62 00 01 addis 3, 2, 1 0001ae9a: R_TOCU (idx: 36364) a10995[TE] 1ae9c: 80 63 8d f8 lwz 3, -29192(3) 0001ae9e: R_TOCL (idx: 36364) a10995[TE] 1aea0: 90 83 00 00 stw 4, 0(3) 1aea4: 3c 62 00 01 addis 3, 2, 1 0001aea6: R_TOCU (idx: 36366) a10996[TE] 1aea8: 80 63 8d fc lwz 3, -29188(3) 0001aeaa: R_TOCL (idx: 36366) a10996[TE] 1aeac: 90 83 00 00 stw 4, 0(3) 1aeb0: 3c 62 00 01 addis 3, 2, 1 |
llvm/lib/MC/XCOFFObjectWriter.cpp | ||
---|---|---|
435–440 | It seems the system as would generate a non-0 FixedValue for you when your TOC region is larger than 64KB. |
Report fatal error when we know the initial 64kb TOC region is not enough to contain all the TOC entries.
llvm/lib/MC/XCOFFObjectWriter.cpp | ||
---|---|---|
435–440 | Some update on this: |
LGTM
llvm/test/CodeGen/PowerPC/aix-xcoff-reloc-large.ll | ||
---|---|---|
1 | minor: do we need -verify-machineinstrs here ? |
llvm/test/CodeGen/PowerPC/aix-xcoff-reloc-large.ll | ||
---|---|---|
1 | I think it's good to always verify if the machine instruction generated during the obj gen process are valid. |
I just wonder why there is no Type == XCOFF::RelocationType::R_TOCU ? we do not need to applyFixup for the instruction ?
addis 3, L..C0@u(2) ?