mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-10-10 04:44:53 +00:00
[ELF][HEXAGON] Add R_HEX_B15_PCREL_X relocation
Update testcase Differential Revision: https://reviews.llvm.org/D49567 llvm-svn: 337829
This commit is contained in:
parent
36d2e25d5a
commit
3241724536
@ -54,6 +54,7 @@ RelExpr Hexagon::getRelExpr(RelType Type, const Symbol &S,
|
||||
const uint8_t *Loc) const {
|
||||
switch (Type) {
|
||||
case R_HEX_B15_PCREL:
|
||||
case R_HEX_B15_PCREL_X:
|
||||
case R_HEX_B22_PCREL:
|
||||
case R_HEX_B22_PCREL_X:
|
||||
case R_HEX_B32_PCREL_X:
|
||||
@ -72,6 +73,9 @@ void Hexagon::relocateOne(uint8_t *Loc, RelType Type, uint64_t Val) const {
|
||||
case R_HEX_B15_PCREL:
|
||||
or32le(Loc, applyMask(0x00df20fe, Val >> 2));
|
||||
break;
|
||||
case R_HEX_B15_PCREL_X:
|
||||
or32le(Loc, applyMask(0x00df20fe, Val & 0x3f));
|
||||
break;
|
||||
case R_HEX_B22_PCREL:
|
||||
or32le(Loc, applyMask(0x1ff3ffe, Val >> 2));
|
||||
break;
|
||||
|
@ -8,6 +8,11 @@
|
||||
if (p0) jump:nt #_start
|
||||
# CHECK: if (p0) jump:nt 0x11000
|
||||
|
||||
# R_HEX_B32_PCREL_X
|
||||
# R_HEX_B15_PCREL_X
|
||||
if (p0) jump:nt ##_start
|
||||
# CHECK: if (p0) jump:nt 0x11000
|
||||
|
||||
# R_HEX_B22_PCREL
|
||||
call #_start
|
||||
# CHECK: call 0x11000
|
||||
|
Loading…
Reference in New Issue
Block a user