aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-csky.c
diff options
context:
space:
mode:
Diffstat (limited to 'gas/config/tc-csky.c')
-rw-r--r--gas/config/tc-csky.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gas/config/tc-csky.c b/gas/config/tc-csky.c
index bd0672f..1c4b44b 100644
--- a/gas/config/tc-csky.c
+++ b/gas/config/tc-csky.c
@@ -4920,7 +4920,9 @@ md_apply_fix (fixS *fixP,
/* We can handle these relocs. */
switch (fixP->fx_r_type)
{
+ case BFD_RELOC_32_PCREL:
case BFD_RELOC_CKCORE_PCREL32:
+ fixP->fx_r_type = BFD_RELOC_CKCORE_PCREL32;
break;
case BFD_RELOC_VTABLE_INHERIT:
fixP->fx_r_type = BFD_RELOC_CKCORE_GNU_VTINHERIT;
@@ -5133,6 +5135,10 @@ tc_gen_reloc (asection *section ATTRIBUTE_UNUSED, fixS *fixP)
{
arelent *rel;
+ if (fixP->fx_pcrel
+ && fixP->fx_r_type == BFD_RELOC_CKCORE_ADDR32)
+ fixP->fx_r_type = BFD_RELOC_CKCORE_PCREL32;
+
rel = xmalloc (sizeof (arelent));
rel->sym_ptr_ptr = xmalloc (sizeof (asymbol *));
*rel->sym_ptr_ptr = symbol_get_bfdsym (fixP->fx_addsy);