summaryrefslogtreecommitdiff
path: root/bfd/elfxx-mips.h
diff options
context:
space:
mode:
authorRichard Sandiford <rsandifo@nildram.co.uk>2003-12-18 10:23:10 +0000
committerRichard Sandiford <rsandifo@nildram.co.uk>2003-12-18 10:23:10 +0000
commitfd10a6073147b017460ec70d83e7f05baceab8c5 (patch)
tree9c0b710972bc7418a9612826481132becd0b9435 /bfd/elfxx-mips.h
parent7b5390363ebf0b04607df1f0abcc3ec68ca50459 (diff)
downloadbinutils-redhat-fd10a6073147b017460ec70d83e7f05baceab8c5.tar.gz
bfd/
* elf32-mips.c (elf_mips_howto_table_rel): Replace all uses of mips_elf_generic_reloc with _bfd_mips_elf_generic_reloc. Use _bfd_mips_elf_hi16_reloc for R_MIPS_HI16 and R_MIPS_GNU_REL_HI16, _bfd_mips_elf_lo16_reloc for R_MIPS_LO16 and R_MIPS_GNU_REL_LO16, and _bfd_mips_elf_got16_reloc for R_MIPS_GOT16. Change rightshift to 16 for R_MIPS_HI16 and R_MIPS_GNU_REL_HI16. (mips_elf_generic_reloc, struct mips_hi16, mips_elf_hi16_reloc) (mips_elf_lo16_reloc, mips_elf_got16_reloc): Delete. (_bfd_mips_elf32_gprel16_reloc): Remove special case. (mips_elf_gprel32_reloc, mips32_64bit_reloc): Likewise. * elf64-mips.c (mips_elf64_howto_table_rel): Replace all uses of mips_elf_generic_reloc with _bfd_mips_elf_generic_reloc. Use _bfd_mips_elf_hi16_reloc for R_MIPS_HI16, _bfd_mips_elf_lo16_reloc for R_MIPS_LO16 and _bfd_mips_elf_got16_reloc for R_MIPS_GOT16. Change R_MIPS_HI16's rightshift to 16. (mips_elf64_howto_table_rela): Replace all uses of mips_elf_generic_reloc with _bfd_mips_elf_generic_reloc. Use _bfd_mips_elf_generic_reloc for R_MIPS_GOT16 as well. (mips_elf64_hi16_reloc, mips_elf64_got16_reloc): Delete. (mips_elf64_shift6_reloc): Remove special case. Use _bfd_mips_elf_generic_reloc instead of returning bfd_reloc_continue. * elfn32-mips.c (prev_reloc_section): Delete. (prev_reloc_address, prev_reloc_addend): Delete. (elf_mips_howto_table_rel, elf_mips_howto_table_rela): As for elf64-mips.c (GET_RELOC_ADDEND, SET_RELOC_ADDEND): Delete. (mips_elf_generic_reloc, struct mips_hi16, mips_elf_hi16_reloc) (mips_elf_lo16_reloc, mips_elf_got16_reloc): Delete. (mips_elf_gprel16_reloc): Delete use of GET_RELOC_ADDEND. (mips_elf_literal_reloc, mips_elf_gprel32_reloc): Likewise. (mips16_jump_reloc, mips16_gprel_reloc): Likewise. (mips_elf_shift6_reloc): Likewise. Delete use of SET_RELOC_ADDEND. * elfxx-mips.c (_bfd_mips_elf_gprel16_with_gp): Use _bfd_relocate_contents to install an in-place addend. (mips_hi16): New structure. (mips_hi16_list): Moved from elf32-mips.c. (_bfd_mips_elf_hi16_reloc, _bfd_mips_elf_got16_reloc): New functions. (_bfd_mips_elf_lo16_reloc, _bfd_mips_elf_generic_reloc): New functions. (mips_elf_calculate_relocation): Assume addend is unshifted. (_bfd_mips_elf_relocate_section): Don't apply the howto rightshift on top of the usual high-part shift. Don't shift the addend right before calling mips_elf_calculate_relocation. * elfxx-mips.h (_bfd_mips_elf_hi16_reloc): Declare. (_bfd_mips_elf_got16_reloc, _bfd_mips_elf_lo16_reloc): Declare. (_bfd_mips_elf_generic_reloc): Declare. gas/ * config/tc-mips.c (mips_need_elf_addend_fixup): Delete. (md_apply_fix3): Remove bfd_install_relocation workarounds. (tc_gen_reloc): Likewise. Factor handling of pc-relative relocations and treat fx_addnumber as relative to the relocation address. gas/testsuite/ * gas/mips/mips16-jalx.d: Use -mabi=o64. * gas/mips/mips16.d: Likewise. * gas/mips/elf-rel17.[sd]: New test. * gas/mips/mips.exp: Run it.
Diffstat (limited to 'bfd/elfxx-mips.h')
-rw-r--r--bfd/elfxx-mips.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/bfd/elfxx-mips.h b/bfd/elfxx-mips.h
index aef4e7b7b2..d3787e9ef9 100644
--- a/bfd/elfxx-mips.h
+++ b/bfd/elfxx-mips.h
@@ -103,6 +103,14 @@ extern bfd_reloc_status_type _bfd_mips_elf_gprel16_with_gp
(bfd *, asymbol *, arelent *, asection *, bfd_boolean, void *, bfd_vma);
extern bfd_reloc_status_type _bfd_mips_elf32_gprel16_reloc
(bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **);
+extern bfd_reloc_status_type _bfd_mips_elf_hi16_reloc
+ (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **);
+extern bfd_reloc_status_type _bfd_mips_elf_got16_reloc
+ (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **);
+extern bfd_reloc_status_type _bfd_mips_elf_lo16_reloc
+ (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **);
+extern bfd_reloc_status_type _bfd_mips_elf_generic_reloc
+ (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **);
extern unsigned long _bfd_elf_mips_mach
(flagword);
extern bfd_boolean _bfd_mips_relax_section