[ELF][HEXAGON] Add R_HEX_11/10/9_X support
Differential Revision: https://reviews.llvm.org/D51225 llvm-svn: 340739
This commit is contained in:
parent
8d6c7a63a1
commit
569a56d6a0
|
@ -115,6 +115,12 @@ static uint32_t findMaskR8(uint32_t Insn) {
|
||||||
return 0x00001fe0;
|
return 0x00001fe0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static uint32_t findMaskR11(uint32_t Insn) {
|
||||||
|
if ((0xff000000 & Insn) == 0xa1000000)
|
||||||
|
return 0x060020ff;
|
||||||
|
return 0x06003fe0;
|
||||||
|
}
|
||||||
|
|
||||||
static uint32_t findMaskR16(uint32_t Insn) {
|
static uint32_t findMaskR16(uint32_t Insn) {
|
||||||
if ((0xff000000 & Insn) == 0x48000000)
|
if ((0xff000000 & Insn) == 0x48000000)
|
||||||
return 0x061f20ff;
|
return 0x061f20ff;
|
||||||
|
@ -143,6 +149,15 @@ void Hexagon::relocateOne(uint8_t *Loc, RelType Type, uint64_t Val) const {
|
||||||
case R_HEX_8_X:
|
case R_HEX_8_X:
|
||||||
or32le(Loc, applyMask(findMaskR8(read32le(Loc)), Val));
|
or32le(Loc, applyMask(findMaskR8(read32le(Loc)), Val));
|
||||||
break;
|
break;
|
||||||
|
case R_HEX_9_X:
|
||||||
|
or32le(Loc, applyMask(0x00003fe0, Val & 0x3f));
|
||||||
|
break;
|
||||||
|
case R_HEX_10_X:
|
||||||
|
or32le(Loc, applyMask(0x00203fe0, Val & 0x3f));
|
||||||
|
break;
|
||||||
|
case R_HEX_11_X:
|
||||||
|
or32le(Loc, applyMask(findMaskR11(read32le(Loc)), Val & 0x3f));
|
||||||
|
break;
|
||||||
case R_HEX_12_X:
|
case R_HEX_12_X:
|
||||||
or32le(Loc, applyMask(0x000007e0, Val));
|
or32le(Loc, applyMask(0x000007e0, Val));
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -206,3 +206,18 @@ r0 = add(r1, ##_start)
|
||||||
# R_HEX_B13_PCREL
|
# R_HEX_B13_PCREL
|
||||||
if (r0 == #0) jump:t #_start
|
if (r0 == #0) jump:t #_start
|
||||||
# CHECK: if (r0==#0) jump:t 0x11000
|
# CHECK: if (r0==#0) jump:t 0x11000
|
||||||
|
|
||||||
|
# R_HEX_9_X
|
||||||
|
p0 = !cmp.gtu(r0, ##_start)
|
||||||
|
# CHECK: p0 = !cmp.gtu(r0,##69632)
|
||||||
|
|
||||||
|
# R_HEX_10_X
|
||||||
|
p0 = !cmp.gt(r0, ##_start)
|
||||||
|
# CHECK: p0 = !cmp.gt(r0,##69632)
|
||||||
|
|
||||||
|
# R_HEX_11_X
|
||||||
|
r0 = memw(r1+##_start)
|
||||||
|
# CHECK: r0 = memw(r1+##69632)
|
||||||
|
|
||||||
|
memw(r0+##_start) = r1
|
||||||
|
# CHECK: memw(r0+##69632) = r1
|
||||||
|
|
Loading…
Reference in New Issue