diff options
author | Lifang Xia <lifang_xia@c-sky.com> | 2018-09-14 21:02:51 +0800 |
---|---|---|
committer | Lifang Xia <lifang_xia@c-sky.com> | 2018-09-14 21:04:47 +0800 |
commit | fe75f42ee15944a0d14d3d42b242676fc2417352 (patch) | |
tree | 3b2767935fe63bc1c6585bbc3a394ebab6eb34d7 /bfd | |
parent | 87b240d48512fa30aab8b5963914a9093009fd68 (diff) | |
download | binutils-fe75f42ee15944a0d14d3d42b242676fc2417352.zip binutils-fe75f42ee15944a0d14d3d42b242676fc2417352.tar.gz binutils-fe75f42ee15944a0d14d3d42b242676fc2417352.tar.bz2 |
csky: Support PC relative diff relocation
Define DIFF_EXPR_OK to Support PC relative diff relocation,
and add CKCORE_PCREL32 relocation process
bfd/
* elf32-csky.c (csky_elf_howto_table): Fill special_function of
R_CKCORE_PCREL32.
(csky_elf_relocate_section): Add R_CKCORE_PCREL32 process.
gas/
* config/tc-csky.c (md_apply_fix): Transmit
BFD_RELOC_32_PCREL to BFD_RELOC_CKCORE_PCREL32.
(tc_gen_reloc): Trasmit BFD_RELOC_CKCORE_ADDR32 to
BFD_RELOC_CKCORE_PCREL32 while pc-relative.
* config/tc-csky.h (DIFF_EXPR_OK): Define to enable PC relative
diff relocs.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 6 | ||||
-rw-r--r-- | bfd/elf32-csky.c | 7 |
2 files changed, 12 insertions, 1 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index bbc8e9f..3ed368c 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,9 @@ +2018-09-14 Lifang Xia <lifang_xia@c-sky.com> + + * elf32-csky.c (csky_elf_howto_table): Fill special_function of + R_CKCORE_PCREL32. + (csky_elf_relocate_section): Add R_CKCORE_PCREL32 process. + 2018-09-14 Alan Modra <amodra@gmail.com> PR 23425 diff --git a/bfd/elf32-csky.c b/bfd/elf32-csky.c index d406b5a..926166e 100644 --- a/bfd/elf32-csky.c +++ b/bfd/elf32-csky.c @@ -150,7 +150,7 @@ static reloc_howto_type csky_elf_howto_table[] = TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ - NULL, /* special_function */ + bfd_elf_generic_reloc, /* special_function */ "R_CKCORE_PCREL32", /* name */ FALSE, /* partial_inplace */ 0x0, /* src_mask */ @@ -4307,6 +4307,10 @@ csky_elf_relocate_section (bfd * output_bfd, if (h == NULL && (addend & 0x80000000)) addend &= 0xffffffff; break; + + case R_CKCORE_PCREL32: + break; + case R_CKCORE_GOT12: case R_CKCORE_PLT12: case R_CKCORE_GOT_HI16: @@ -5027,6 +5031,7 @@ csky_elf_relocate_section (bfd * output_bfd, if (howto->size == 2 && (howto->type == R_CKCORE_ADDR32 + || howto->type == R_CKCORE_PCREL32 || howto->type == R_CKCORE_GOT32 || howto->type == R_CKCORE_GOTOFF || howto->type == R_CKCORE_GOTPC |