[binutils-gdb] bfd/ELF: fold BFD_RELOC_<arch>_PCREL*
Jan Beulich via Binutils-cvs <[email protected]>
| Newsgroups | gmane.comp.gnu.binutils.cvs |
|---|---|
| Message-ID | <[email protected]> |
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=b49b0bfe1215d2233fa896973802b5afcdd2c99b commit b49b0bfe1215d2233fa896973802b5afcdd2c99b Author: Jan Beulich <[email protected]> Date: Thu Apr 9 08:39:10 2026 +0200 bfd/ELF: fold BFD_RELOC_<arch>_PCREL* There's no need to have a separate reloc per arch; just like for other more or less generic ones a single one will (mostly) do, as long as the resulting reloc's properties fit such a generic use (in the assembler it could, after all, also result from ordinary expressions or uses with the .reloc directive). Arm64, C-Sky, and KVX - sadly - are once again exceptions. For cris it's a PLT reloc which is being replaced. For msp430 also drop BFD_RELOC_MSP430_16_BYTE, which has already been merely an alias of BFD_RELOC_16 (resolving to R_MSP430_16_BYTE). Diff: --- bfd/bfd-in2.h | 14 +------------- bfd/elf32-cris.c | 2 +- bfd/elf32-msp430.c | 3 +-- bfd/elf32-pj.c | 4 ++-- bfd/elfxx-loongarch.c | 10 +++++----- bfd/elfxx-riscv.c | 2 +- bfd/libbfd.h | 9 --------- bfd/reloc.c | 25 +------------------------ gas/config/tc-cris.c | 8 ++++---- gas/config/tc-cris.h | 2 +- gas/config/tc-loongarch.c | 12 +++++++----- gas/config/tc-msp430.c | 7 +++---- gas/config/tc-pdp11.c | 4 ++-- gas/config/tc-pj.c | 8 ++++---- gas/config/tc-riscv.c | 2 +- 15 files changed, 34 insertions(+), 78 deletions(-) diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h index 22f29584779..c3257e2a7e4 100644 --- a/bfd/bfd-in2.h +++ b/bfd/bfd-in2.h @@ -3932,8 +3932,7 @@ enum bfd_reloc_code_real BFD_RELOC_NS32K_DISP_16_PCREL, BFD_RELOC_NS32K_DISP_32_PCREL, - /* PDP11 relocations. */ - BFD_RELOC_PDP11_DISP_8_PCREL, + /* PDP11 relocation(s). */ BFD_RELOC_PDP11_DISP_6_PCREL, /* Picojava relocs. Not all of these appear in object files. */ @@ -3941,8 +3940,6 @@ enum bfd_reloc_code_real BFD_RELOC_PJ_CODE_LO16, BFD_RELOC_PJ_CODE_DIR16, BFD_RELOC_PJ_CODE_DIR32, - BFD_RELOC_PJ_CODE_REL16, - BFD_RELOC_PJ_CODE_REL32, /* Power(rs6000) and PowerPC relocations. */ BFD_RELOC_PPC_B26, @@ -5345,7 +5342,6 @@ enum bfd_reloc_code_real BFD_RELOC_RISCV_SET8, BFD_RELOC_RISCV_SET16, BFD_RELOC_RISCV_SET32, - BFD_RELOC_RISCV_32_PCREL, BFD_RELOC_RISCV_SET_ULEB128, BFD_RELOC_RISCV_SUB_ULEB128, @@ -5885,10 +5881,6 @@ enum bfd_reloc_code_real /* 32-bit offset to symbol with PLT entry, relative to GOT. */ BFD_RELOC_CRIS_32_PLT_GOTREL, - /* 32-bit offset to symbol with PLT entry, relative to this - relocation. */ - BFD_RELOC_CRIS_32_PLT_PCREL, - /* Relocs used in TLS code for CRIS. */ BFD_RELOC_CRIS_32_GOT_GD, BFD_RELOC_CRIS_16_GOT_GD, @@ -5980,8 +5972,6 @@ enum bfd_reloc_code_real BFD_RELOC_MSP430_10_PCREL, BFD_RELOC_MSP430_16_PCREL, BFD_RELOC_MSP430_16, - BFD_RELOC_MSP430_16_PCREL_BYTE, - BFD_RELOC_MSP430_16_BYTE, BFD_RELOC_MSP430_2X_PCREL, BFD_RELOC_MSP430_RL_PCREL, BFD_RELOC_MSP430_ABS8, @@ -7260,7 +7250,6 @@ enum bfd_reloc_code_real BFD_RELOC_LARCH_TLS_LD_HI20, BFD_RELOC_LARCH_TLS_GD_PC_HI20, BFD_RELOC_LARCH_TLS_GD_HI20, - BFD_RELOC_LARCH_32_PCREL, BFD_RELOC_LARCH_RELAX, BFD_RELOC_LARCH_DELETE, BFD_RELOC_LARCH_ALIGN, @@ -7270,7 +7259,6 @@ enum bfd_reloc_code_real BFD_RELOC_LARCH_SUB6, BFD_RELOC_LARCH_ADD_ULEB128, BFD_RELOC_LARCH_SUB_ULEB128, - BFD_RELOC_LARCH_64_PCREL, BFD_RELOC_LARCH_CALL36, BFD_RELOC_LARCH_TLS_DESC_PC_HI20, BFD_RELOC_LARCH_TLS_DESC_PC_LO12, diff --git a/bfd/elf32-cris.c b/bfd/elf32-cris.c index fd45586faf1..73d446c6fb0 100644 --- a/bfd/elf32-cris.c +++ b/bfd/elf32-cris.c @@ -408,7 +408,7 @@ static const struct cris_reloc_map cris_reloc_map [] = { BFD_RELOC_CRIS_32_GOTPLT, R_CRIS_32_GOTPLT }, { BFD_RELOC_CRIS_32_GOTREL, R_CRIS_32_GOTREL }, { BFD_RELOC_CRIS_32_PLT_GOTREL, R_CRIS_32_PLT_GOTREL }, - { BFD_RELOC_CRIS_32_PLT_PCREL, R_CRIS_32_PLT_PCREL }, + { BFD_RELOC_32_PLT_PCREL, R_CRIS_32_PLT_PCREL }, { BFD_RELOC_CRIS_32_GOT_GD, R_CRIS_32_GOT_GD }, { BFD_RELOC_CRIS_16_GOT_GD, R_CRIS_16_GOT_GD }, { BFD_RELOC_CRIS_32_GD, R_CRIS_32_GD }, diff --git a/bfd/elf32-msp430.c b/bfd/elf32-msp430.c index 5123a138b0b..bf85349ad73 100644 --- a/bfd/elf32-msp430.c +++ b/bfd/elf32-msp430.c @@ -622,8 +622,7 @@ static const struct msp430_reloc_map msp430_reloc_map[] = {BFD_RELOC_16, R_MSP430_16_BYTE}, {BFD_RELOC_MSP430_16_PCREL, R_MSP430_16_PCREL}, {BFD_RELOC_MSP430_16, R_MSP430_16}, - {BFD_RELOC_MSP430_16_PCREL_BYTE, R_MSP430_16_PCREL_BYTE}, - {BFD_RELOC_MSP430_16_BYTE, R_MSP430_16_BYTE}, + {BFD_RELOC_16_PCREL, R_MSP430_16_PCREL_BYTE}, {BFD_RELOC_MSP430_2X_PCREL, R_MSP430_2X_PCREL}, {BFD_RELOC_MSP430_RL_PCREL, R_MSP430_RL_PCREL}, {BFD_RELOC_8, R_MSP430_8}, diff --git a/bfd/elf32-pj.c b/bfd/elf32-pj.c index f0af7297a37..6ec17c219c5 100644 --- a/bfd/elf32-pj.c +++ b/bfd/elf32-pj.c @@ -271,8 +271,8 @@ static const struct elf_reloc_map pj_reloc_map[] = { BFD_RELOC_PJ_CODE_DIR32, R_PJ_CODE_DIR32 }, { BFD_RELOC_PJ_CODE_LO16, R_PJ_CODE_LO16 }, { BFD_RELOC_PJ_CODE_HI16, R_PJ_CODE_HI16 }, - { BFD_RELOC_PJ_CODE_REL32, R_PJ_CODE_REL32 }, - { BFD_RELOC_PJ_CODE_REL16, R_PJ_CODE_REL16 }, + { BFD_RELOC_32_PCREL, R_PJ_CODE_REL32 }, + { BFD_RELOC_16_PCREL, R_PJ_CODE_REL16 }, { BFD_RELOC_VTABLE_INHERIT, R_PJ_GNU_VTINHERIT }, { BFD_RELOC_VTABLE_ENTRY, R_PJ_GNU_VTENTRY }, }; diff --git a/bfd/elfxx-loongarch.c b/bfd/elfxx-loongarch.c index 2dd470ddafb..11754d62737 100644 --- a/bfd/elfxx-loongarch.c +++ b/bfd/elfxx-loongarch.c @@ -1389,7 +1389,7 @@ static loongarch_reloc_howto_type loongarch_howto_table[] = 0, /* src_mask */ 0xffffffff, /* dst_mask */ true, /* pcrel_offset */ - BFD_RELOC_LARCH_32_PCREL, /* bfd_reloc_code_real_type */ + BFD_RELOC_32_PCREL, /* bfd_reloc_code_real_type */ reloc_sign_bits, /* adjust_reloc_bits */ NULL), /* larch_reloc_type_name */ @@ -1581,7 +1581,7 @@ static loongarch_reloc_howto_type loongarch_howto_table[] = 0, /* src_mask */ 0xffffffffffffffff, /* dst_mask */ true, /* pcrel_offset */ - BFD_RELOC_LARCH_64_PCREL, /* bfd_reloc_code_real_type */ + BFD_RELOC_64_PCREL, /* bfd_reloc_code_real_type */ NULL, /* adjust_reloc_bits */ NULL), /* larch_reloc_type_name */ @@ -2144,10 +2144,10 @@ loongarch_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, BFD_ASSERT (ARRAY_SIZE (loongarch_howto_table) == R_LARCH_count); /* Fast search for new reloc types. */ - if (BFD_RELOC_LARCH_B16 <= code && code < BFD_RELOC_LARCH_RELAX) + if (BFD_RELOC_LARCH_B16 <= code && code <= BFD_RELOC_LARCH_TLS_GD_HI20) { - BFD_ASSERT (BFD_RELOC_LARCH_RELAX - BFD_RELOC_LARCH_B16 - == R_LARCH_RELAX - R_LARCH_B16); + BFD_ASSERT (BFD_RELOC_LARCH_TLS_GD_HI20 - BFD_RELOC_LARCH_B16 + == R_LARCH_TLS_GD_HI20 - R_LARCH_B16); loongarch_reloc_howto_type *ht; ht = &loongarch_howto_table[code - BFD_RELOC_LARCH_B16 + R_LARCH_B16]; BFD_ASSERT (ht->bfd_type == code); diff --git a/bfd/elfxx-riscv.c b/bfd/elfxx-riscv.c index ee962b4f6f1..83134f81c96 100644 --- a/bfd/elfxx-riscv.c +++ b/bfd/elfxx-riscv.c @@ -1020,7 +1020,7 @@ static const struct elf_reloc_map riscv_reloc_map[] = { BFD_RELOC_RISCV_SET8, R_RISCV_SET8 }, { BFD_RELOC_RISCV_SET16, R_RISCV_SET16 }, { BFD_RELOC_RISCV_SET32, R_RISCV_SET32 }, - { BFD_RELOC_RISCV_32_PCREL, R_RISCV_32_PCREL }, + { BFD_RELOC_32_PCREL, R_RISCV_32_PCREL }, { BFD_RELOC_RISCV_SET_ULEB128, R_RISCV_SET_ULEB128 }, { BFD_RELOC_RISCV_SUB_ULEB128, R_RISCV_SUB_ULEB128 }, }; diff --git a/bfd/libbfd.h b/bfd/libbfd.h index 7ccabbd283e..3d19b597b71 100644 --- a/bfd/libbfd.h +++ b/bfd/libbfd.h @@ -1503,14 +1503,11 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_NS32K_DISP_8_PCREL", "BFD_RELOC_NS32K_DISP_16_PCREL", "BFD_RELOC_NS32K_DISP_32_PCREL", - "BFD_RELOC_PDP11_DISP_8_PCREL", "BFD_RELOC_PDP11_DISP_6_PCREL", "BFD_RELOC_PJ_CODE_HI16", "BFD_RELOC_PJ_CODE_LO16", "BFD_RELOC_PJ_CODE_DIR16", "BFD_RELOC_PJ_CODE_DIR32", - "BFD_RELOC_PJ_CODE_REL16", - "BFD_RELOC_PJ_CODE_REL32", "BFD_RELOC_PPC_B26", "BFD_RELOC_PPC_BA26", "BFD_RELOC_PPC_TOC16", @@ -2347,7 +2344,6 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_RISCV_SET8", "BFD_RELOC_RISCV_SET16", "BFD_RELOC_RISCV_SET32", - "BFD_RELOC_RISCV_32_PCREL", "BFD_RELOC_RISCV_SET_ULEB128", "BFD_RELOC_RISCV_SUB_ULEB128", "BFD_RELOC_RL78_NEG8", @@ -2658,7 +2654,6 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_CRIS_16_GOTPLT", "BFD_RELOC_CRIS_32_GOTREL", "BFD_RELOC_CRIS_32_PLT_GOTREL", - "BFD_RELOC_CRIS_32_PLT_PCREL", "BFD_RELOC_CRIS_32_GOT_GD", "BFD_RELOC_CRIS_16_GOT_GD", "BFD_RELOC_CRIS_32_GD", @@ -2727,8 +2722,6 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_MSP430_10_PCREL", "BFD_RELOC_MSP430_16_PCREL", "BFD_RELOC_MSP430_16", - "BFD_RELOC_MSP430_16_PCREL_BYTE", - "BFD_RELOC_MSP430_16_BYTE", "BFD_RELOC_MSP430_2X_PCREL", "BFD_RELOC_MSP430_RL_PCREL", "BFD_RELOC_MSP430_ABS8", @@ -3434,7 +3427,6 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_LARCH_TLS_LD_HI20", "BFD_RELOC_LARCH_TLS_GD_PC_HI20", "BFD_RELOC_LARCH_TLS_GD_HI20", - "BFD_RELOC_LARCH_32_PCREL", "BFD_RELOC_LARCH_RELAX", "BFD_RELOC_LARCH_DELETE", "BFD_RELOC_LARCH_ALIGN", @@ -3444,7 +3436,6 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_LARCH_SUB6", "BFD_RELOC_LARCH_ADD_ULEB128", "BFD_RELOC_LARCH_SUB_ULEB128", - "BFD_RELOC_LARCH_64_PCREL", "BFD_RELOC_LARCH_CALL36", "BFD_RELOC_LARCH_TLS_DESC_PC_HI20", "BFD_RELOC_LARCH_TLS_DESC_PC_LO12", diff --git a/bfd/reloc.c b/bfd/reloc.c index 9e851ea127a..6b9e00da5d6 100644 --- a/bfd/reloc.c +++ b/bfd/reloc.c @@ -2447,11 +2447,9 @@ ENUMDOC ns32k relocations. ENUM - BFD_RELOC_PDP11_DISP_8_PCREL -ENUMX BFD_RELOC_PDP11_DISP_6_PCREL ENUMDOC - PDP11 relocations. + PDP11 relocation(s). ENUM BFD_RELOC_PJ_CODE_HI16 @@ -2461,10 +2459,6 @@ ENUMX BFD_RELOC_PJ_CODE_DIR16 ENUMX BFD_RELOC_PJ_CODE_DIR32 -ENUMX - BFD_RELOC_PJ_CODE_REL16 -ENUMX - BFD_RELOC_PJ_CODE_REL32 ENUMDOC Picojava relocs. Not all of these appear in object files. @@ -4751,8 +4745,6 @@ ENUMX BFD_RELOC_RISCV_SET16 ENUMX BFD_RELOC_RISCV_SET32 -ENUMX - BFD_RELOC_RISCV_32_PCREL ENUMX BFD_RELOC_RISCV_SET_ULEB128 ENUMX @@ -5616,11 +5608,6 @@ ENUM BFD_RELOC_CRIS_32_PLT_GOTREL ENUMDOC 32-bit offset to symbol with PLT entry, relative to GOT. -ENUM - BFD_RELOC_CRIS_32_PLT_PCREL -ENUMDOC - 32-bit offset to symbol with PLT entry, relative to this - relocation. ENUM BFD_RELOC_CRIS_32_GOT_GD @@ -5786,10 +5773,6 @@ ENUMX BFD_RELOC_MSP430_16_PCREL ENUMX BFD_RELOC_MSP430_16 -ENUMX - BFD_RELOC_MSP430_16_PCREL_BYTE -ENUMX - BFD_RELOC_MSP430_16_BYTE ENUMX BFD_RELOC_MSP430_2X_PCREL ENUMX @@ -7797,9 +7780,6 @@ ENUMX ENUMX BFD_RELOC_LARCH_TLS_GD_HI20 -ENUMX - BFD_RELOC_LARCH_32_PCREL - ENUMX BFD_RELOC_LARCH_RELAX @@ -7825,9 +7805,6 @@ ENUMX ENUMX BFD_RELOC_LARCH_SUB_ULEB128 -ENUMX - BFD_RELOC_LARCH_64_PCREL - ENUMX BFD_RELOC_LARCH_CALL36 diff --git a/gas/config/tc-cris.c b/gas/config/tc-cris.c index 71425f56477..7dce7004e16 100644 --- a/gas/config/tc-cris.c +++ b/gas/config/tc-cris.c @@ -3502,7 +3502,7 @@ cris_get_reloc_suffix (char **cPP, bfd_reloc_code_real_type *relocp, PICMAP ("GOTPLT16", BFD_RELOC_CRIS_16_GOTPLT), PICMAP ("GOTPLT", BFD_RELOC_CRIS_32_GOTPLT), PICMAP ("PLTG", BFD_RELOC_CRIS_32_PLT_GOTREL), - PICMAP ("PLT", BFD_RELOC_CRIS_32_PLT_PCREL), + PICMAP ("PLT", BFD_RELOC_32_PLT_PCREL), PICMAP ("GOTOFF", BFD_RELOC_CRIS_32_GOTREL), PICMAP ("GOT16", BFD_RELOC_CRIS_16_GOT), PICMAP ("GOT", BFD_RELOC_CRIS_32_GOT), @@ -3672,7 +3672,7 @@ cris_number_to_imm (char *bufp, long val, int n, fixS *fixP, segT seg) case BFD_RELOC_CRIS_16_GOTPLT: case BFD_RELOC_CRIS_32_GOTPLT: case BFD_RELOC_CRIS_32_PLT_GOTREL: - case BFD_RELOC_CRIS_32_PLT_PCREL: + case BFD_RELOC_32_PLT_PCREL: /* We don't want to put in any kind of non-zero bits in the data being relocated for these. */ md_number_to_chars (bufp, 0, n); @@ -3924,7 +3924,7 @@ tc_gen_reloc (asection *section ATTRIBUTE_UNUSED, fixS *fixP) case BFD_RELOC_CRIS_32_GOTPLT: case BFD_RELOC_CRIS_32_GOTREL: case BFD_RELOC_CRIS_32_PLT_GOTREL: - case BFD_RELOC_CRIS_32_PLT_PCREL: + case BFD_RELOC_32_PLT_PCREL: case BFD_RELOC_32: case BFD_RELOC_32_PCREL: case BFD_RELOC_16: @@ -4101,7 +4101,7 @@ md_cris_force_relocation (struct fix *fixp) case BFD_RELOC_CRIS_32_GOTPLT: case BFD_RELOC_CRIS_32_GOTREL: case BFD_RELOC_CRIS_32_PLT_GOTREL: - case BFD_RELOC_CRIS_32_PLT_PCREL: + case BFD_RELOC_32_PLT_PCREL: return 1; default: ; diff --git a/gas/config/tc-cris.h b/gas/config/tc-cris.h index 8c887776418..4cfb18277ad 100644 --- a/gas/config/tc-cris.h +++ b/gas/config/tc-cris.h @@ -79,7 +79,7 @@ extern int md_cris_force_relocation (struct fix *); || (RTYPE) == BFD_RELOC_CRIS_32_GOTPLT \ || (RTYPE) == BFD_RELOC_CRIS_32_GOTREL \ || (RTYPE) == BFD_RELOC_CRIS_32_PLT_GOTREL \ - || (RTYPE) == BFD_RELOC_CRIS_32_PLT_PCREL) + || (RTYPE) == BFD_RELOC_32_PLT_PCREL) /* Make sure we don't resolve fixups for which we want to emit dynamic relocations. */ diff --git a/gas/config/tc-loongarch.c b/gas/config/tc-loongarch.c index 7e501404ed7..1eb35f2c75e 100644 --- a/gas/config/tc-loongarch.c +++ b/gas/config/tc-loongarch.c @@ -865,8 +865,10 @@ loongarch_args_parser_can_match_arg_helper (char esc_ch1, char esc_ch2, _("not support reloc bit-field\nfmt: %c%c %s\nargs: %s"), esc_ch1, esc_ch2, bit_field, arg); - if (ip->reloc_info[0].type >= BFD_RELOC_LARCH_B16 - && ip->reloc_info[0].type <= BFD_RELOC_LARCH_TLS_DESC_PCADD_LO12) + if ((ip->reloc_info[0].type >= BFD_RELOC_LARCH_B16 + && ip->reloc_info[0].type <= BFD_RELOC_LARCH_TLS_DESC_PCADD_LO12) + || ip->reloc_info[0].type == BFD_RELOC_32_PCREL + || ip->reloc_info[0].type == BFD_RELOC_64_PCREL) { /* As we compact stack-relocs, it is no need for pop operation. But break out until here in order to check the imm field. @@ -1714,10 +1716,10 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) switch (fixP->fx_r_type) { case BFD_RELOC_64: - fixP->fx_r_type = BFD_RELOC_LARCH_64_PCREL; + fixP->fx_r_type = BFD_RELOC_64_PCREL; break; case BFD_RELOC_32: - fixP->fx_r_type = BFD_RELOC_LARCH_32_PCREL; + fixP->fx_r_type = BFD_RELOC_32_PCREL; break; default: break; @@ -1736,7 +1738,7 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) && S_GET_VALUE (fixP->fx_subsy) == fixP->fx_frag->fr_address + fixP->fx_where) { - fixP->fx_r_type = BFD_RELOC_LARCH_32_PCREL; + fixP->fx_r_type = BFD_RELOC_32_PCREL; fixP->fx_subsy = NULL; break; } diff --git a/gas/config/tc-msp430.c b/gas/config/tc-msp430.c index 6a613e30dba..088cade1eda 100644 --- a/gas/config/tc-msp430.c +++ b/gas/config/tc-msp430.c @@ -291,7 +291,7 @@ target_is_430xv2 (void) : ((OP).vshift == 1 \ ? BFD_RELOC_MSP430_ABS_HI16 : BFD_RELOC_16)) \ : ((imm_op || byte_op) \ - ? BFD_RELOC_MSP430_16_BYTE : BFD_RELOC_MSP430_16)) + ? BFD_RELOC_16 : BFD_RELOC_MSP430_16)) /* Generate a 16-bit pc-relative relocation. For the 430X we generate a relocation without linker range checking. @@ -302,7 +302,7 @@ target_is_430xv2 (void) (target_is_430x () \ ? BFD_RELOC_MSP430X_PCR16 \ : (imm_op || byte_op) \ - ? BFD_RELOC_MSP430_16_PCREL_BYTE : BFD_RELOC_MSP430_16_PCREL) + ? BFD_RELOC_16_PCREL : BFD_RELOC_MSP430_16_PCREL) /* Profiling capability: It is a performance hit to use gcc's profiling approach for this tiny target. @@ -4523,7 +4523,7 @@ md_apply_fix (fixS * fixp, valueT * valuep, segT seg) _("odd address operand: %ld"), value); /* Fall through. */ - case BFD_RELOC_MSP430_16_PCREL_BYTE: + case BFD_RELOC_16_PCREL: /* Nothing to be corrected here. */ if (value < -32768 || value > 65536) as_bad_where (fixp->fx_file, fixp->fx_line, @@ -4533,7 +4533,6 @@ md_apply_fix (fixS * fixp, valueT * valuep, segT seg) case BFD_RELOC_MSP430X_ABS16: case BFD_RELOC_MSP430_16: case BFD_RELOC_16: - case BFD_RELOC_MSP430_16_BYTE: value &= 0xffff; /* Get rid of extended sign. */ bfd_putl16 (value, where); break; diff --git a/gas/config/tc-pdp11.c b/gas/config/tc-pdp11.c index 522f6f27bed..ed703bf227a 100644 --- a/gas/config/tc-pdp11.c +++ b/gas/config/tc-pdp11.c @@ -268,7 +268,7 @@ md_apply_fix (fixS *fixP, mask = 0xffffffff; shift = 0; break; - case BFD_RELOC_PDP11_DISP_8_PCREL: + case BFD_RELOC_8_PCREL: mask = 0x00ff; shift = 1; break; @@ -790,7 +790,7 @@ md_assemble (char *instruction_string) new_pointer = parse_expression (str, &op1); op1.code = 0; op1.reloc.pc_rel = 1; - op1.reloc.type = BFD_RELOC_PDP11_DISP_8_PCREL; + op1.reloc.type = BFD_RELOC_8_PCREL; if (op1.reloc.exp.X_op != O_symbol) { op1.error = _("Symbol expected"); diff --git a/gas/config/tc-pj.c b/gas/config/tc-pj.c index 5f5379519c1..71dda9128a2 100644 --- a/gas/config/tc-pj.c +++ b/gas/config/tc-pj.c @@ -127,12 +127,12 @@ c_to_r (int x) case O_8: return BFD_RELOC_8; case O_R16: - return BFD_RELOC_PJ_CODE_REL16; + return BFD_RELOC_16_PCREL; case O_U16: case O_16: return BFD_RELOC_PJ_CODE_DIR16; case O_R32: - return BFD_RELOC_PJ_CODE_REL32; + return BFD_RELOC_32_PCREL; case O_32: return BFD_RELOC_PJ_CODE_DIR32; } @@ -375,7 +375,7 @@ md_apply_fix (fixS *fixP, valueT * valP, segT seg ATTRIBUTE_UNUSED) fixP->fx_done = 0; return; - case BFD_RELOC_PJ_CODE_REL16: + case BFD_RELOC_16_PCREL: if (val < -0x8000 || val >= 0x7fff) as_bad_where (fixP->fx_file, fixP->fx_line, _("pcrel too far")); buf[0] |= (val >> 8) & 0xff; @@ -404,7 +404,7 @@ md_apply_fix (fixS *fixP, valueT * valP, segT seg ATTRIBUTE_UNUSED) break; case BFD_RELOC_PJ_CODE_DIR32: - case BFD_RELOC_PJ_CODE_REL32: + case BFD_RELOC_32_PCREL: *buf++ = val >> 24; *buf++ = val >> 16; *buf++ = val >> 8; diff --git a/gas/config/tc-riscv.c b/gas/config/tc-riscv.c index 17205db68b2..b00b530b0bd 100644 --- a/gas/config/tc-riscv.c +++ b/gas/config/tc-riscv.c @@ -4748,7 +4748,7 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg) && S_GET_VALUE (fixP->fx_subsy) == fixP->fx_frag->fr_address + fixP->fx_where) { - fixP->fx_r_type = BFD_RELOC_RISCV_32_PCREL; + fixP->fx_r_type = BFD_RELOC_32_PCREL; fixP->fx_subsy = NULL; break; }