diff options
author | Richard Sandiford <rdsandiford@googlemail.com> | 2003-12-18 10:23:10 +0000 |
---|---|---|
committer | Richard Sandiford <rdsandiford@googlemail.com> | 2003-12-18 10:23:10 +0000 |
commit | 30ac9238dfbbddadd84b277a9cae57a006aac265 (patch) | |
tree | c4d494c763ece8e53355b68a23a411e1c71311fd /gas/testsuite | |
parent | 8ab8a5c8883d632c9187b1dada22ec10b6109798 (diff) | |
download | gdb-30ac9238dfbbddadd84b277a9cae57a006aac265.zip gdb-30ac9238dfbbddadd84b277a9cae57a006aac265.tar.gz gdb-30ac9238dfbbddadd84b277a9cae57a006aac265.tar.bz2 |
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 'gas/testsuite')
-rw-r--r-- | gas/testsuite/ChangeLog | 7 | ||||
-rw-r--r-- | gas/testsuite/gas/mips/elf-rel17.d | 13 | ||||
-rw-r--r-- | gas/testsuite/gas/mips/elf-rel17.s | 3 | ||||
-rw-r--r-- | gas/testsuite/gas/mips/mips.exp | 1 | ||||
-rw-r--r-- | gas/testsuite/gas/mips/mips16-jalx.d | 2 | ||||
-rw-r--r-- | gas/testsuite/gas/mips/mips16.d | 2 |
6 files changed, 26 insertions, 2 deletions
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index b606043..829fb75 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2003-12-18 Richard Sandiford <rsandifo@redhat.com> + + * 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. + 2003-12-17 Nick Clifton <nickc@redhat.com> * gas/m32r/error.exp: Add parallel.s diff --git a/gas/testsuite/gas/mips/elf-rel17.d b/gas/testsuite/gas/mips/elf-rel17.d new file mode 100644 index 0000000..8774ae2 --- /dev/null +++ b/gas/testsuite/gas/mips/elf-rel17.d @@ -0,0 +1,13 @@ +#objdump: -dr +#as: -mabi=32 + +.*: file format .* + +Disassembly of section \.text: + +00000000 <.*>: +.*: 3c040000 lui a0,0x0 + .*: R_MIPS_HI16 x +.*: 24840000 addiu a0,a0,0 + .*: R_MIPS_LO16 x + \.\.\. diff --git a/gas/testsuite/gas/mips/elf-rel17.s b/gas/testsuite/gas/mips/elf-rel17.s new file mode 100644 index 0000000..44ec0fa --- /dev/null +++ b/gas/testsuite/gas/mips/elf-rel17.s @@ -0,0 +1,3 @@ + la $4,x + .space 16 + .comm x,12 diff --git a/gas/testsuite/gas/mips/mips.exp b/gas/testsuite/gas/mips/mips.exp index fa8a9a9..2d515a9 100644 --- a/gas/testsuite/gas/mips/mips.exp +++ b/gas/testsuite/gas/mips/mips.exp @@ -670,6 +670,7 @@ if { [istarget mips*-*-*] } then { run_dump_test "elf-rel-got-n64" run_dump_test "elf-rel-xgot-n64" } + run_dump_test "elf-rel17" run_dump_test "${tmips}${el}empic" run_dump_test "empic2" diff --git a/gas/testsuite/gas/mips/mips16-jalx.d b/gas/testsuite/gas/mips/mips16-jalx.d index eeec2cb..8af1066 100644 --- a/gas/testsuite/gas/mips/mips16-jalx.d +++ b/gas/testsuite/gas/mips/mips16-jalx.d @@ -1,5 +1,5 @@ #objdump: -dr -mmips:4000 -mmips:16 -#as: -mips3 -mtune=r4000 -mips16 +#as: -mips3 -mtune=r4000 -mips16 -mabi=o64 #name: mips16 jalx .*: file format .* Disassembly of section .text: diff --git a/gas/testsuite/gas/mips/mips16.d b/gas/testsuite/gas/mips/mips16.d index 1550529..7169d69 100644 --- a/gas/testsuite/gas/mips/mips16.d +++ b/gas/testsuite/gas/mips/mips16.d @@ -1,5 +1,5 @@ #objdump: -dr -mmips:4000 -#as: -mips3 -mtune=r4000 +#as: -mips3 -mtune=r4000 -mabi=o64 #name: mips16 # Test the mips16 instruction set. |