[ELF][HEXAGON] Add R_HEX_32_6_X and R_HEX_12_X

And add a test.

llvm-svn: 338213
This commit is contained in:
Sid Manning 2018-07-29 11:59:38 +00:00
parent 6bc5d5c6db
commit bff6719450
2 changed files with 13 additions and 0 deletions

View File

@ -70,6 +70,12 @@ void Hexagon::relocateOne(uint8_t *Loc, RelType Type, uint64_t Val) const {
switch (Type) {
case R_HEX_NONE:
break;
case R_HEX_12_X:
or32le(Loc, applyMask(0x000007e0, Val));
break;
case R_HEX_32_6_X:
or32le(Loc, applyMask(0x0fff3fff, Val >> 6));
break;
case R_HEX_B15_PCREL:
or32le(Loc, applyMask(0x00df20fe, Val >> 2));
break;

View File

@ -4,6 +4,13 @@
# RUN: ld.lld %t2 %t -o %t3
# RUN: llvm-objdump -d %t3 | FileCheck %s
# Note: 69632 == 0x11000
# R_HEX_32_6_X
# R_HEX_12_X
if (p0) r0 = ##_start
# CHECK: immext(#69632)
# CHECK: if (p0) r0 = ##69632
# R_HEX_B15_PCREL
if (p0) jump:nt #_start
# CHECK: if (p0) jump:nt 0x11000