* config/tc-mips.h (tc_frag_data_type, TC_FRAG_TYPE): Remove.
* config/tc-mips.c (RELAX_ENCODE): Take three arguments: the size of the first sequence, the size of the second sequence, and a flag that says whether we should warn. (RELAX_OLD, RELAX_NEW, RELAX_RELOC[123]): Delete. (RELAX_FIRST, RELAX_SECOND): New. (mips_relax): New variable. (relax_close_frag, relax_start, relax_switch, relax_end): New fns. (append_insn): Remove "place" argument. Use mips_relax.sequence rather than "place" to check whether we're expanding the second alternative of a relaxable macro. Remove redundant check for branch relaxation. If generating a normal insn, and there is not enough room in the current frag, call relax_close_frag() to close it. Update mips_relax.sizes[]. Emit fixups for the second version of a relaxable macro. Record the first relaxable fixup in mips_relax. Remove tc_gen_reloc workaround. (macro_build): Remove all uses of "place". Use mips_relax.sequence in the same way as in append_insn. (mips16_macro_build): Remove "place" argument. (macro_build_lui): As for macro_build. Don't drop the add_symbol when generating the second version of a relaxable macro. (load_got_offset, add_got_offset): New functions. (load_address, macro): Use new relaxation machinery. Remove tc_gen_reloc workarounds. (md_estimate_size_before_relax): Set RELAX_USE_SECOND if the second version of a relaxable macro is needed. Return -RELAX_SECOND if the first version is needed. (tc_gen_reloc): Remove relaxation handling. (md_convert_frag): Go through the fixups for a relaxable macro and mark those that belong to the unneeded alternative as done. If the second alternative is needed, adjust the fixup addresses to account for the deleted first alternative. testsuite/ * gas/mips/elf-rel19.[sd]: New test. * gas/mips/mips.exp: Run it.
This commit is contained in:
parent
0530d30a58
commit
4d7206a284
6 changed files with 574 additions and 685 deletions
|
@ -1,3 +1,38 @@
|
|||
2004-01-23 Richard Sandiford <rsandifo@redhat.com>
|
||||
|
||||
* config/tc-mips.h (tc_frag_data_type, TC_FRAG_TYPE): Remove.
|
||||
* config/tc-mips.c (RELAX_ENCODE): Take three arguments: the size of
|
||||
the first sequence, the size of the second sequence, and a flag
|
||||
that says whether we should warn.
|
||||
(RELAX_OLD, RELAX_NEW, RELAX_RELOC[123]): Delete.
|
||||
(RELAX_FIRST, RELAX_SECOND): New.
|
||||
(mips_relax): New variable.
|
||||
(relax_close_frag, relax_start, relax_switch, relax_end): New fns.
|
||||
(append_insn): Remove "place" argument. Use mips_relax.sequence
|
||||
rather than "place" to check whether we're expanding the second
|
||||
alternative of a relaxable macro. Remove redundant check for
|
||||
branch relaxation. If generating a normal insn, and there
|
||||
is not enough room in the current frag, call relax_close_frag()
|
||||
to close it. Update mips_relax.sizes[]. Emit fixups for the
|
||||
second version of a relaxable macro. Record the first relaxable
|
||||
fixup in mips_relax. Remove tc_gen_reloc workaround.
|
||||
(macro_build): Remove all uses of "place". Use mips_relax.sequence
|
||||
in the same way as in append_insn.
|
||||
(mips16_macro_build): Remove "place" argument.
|
||||
(macro_build_lui): As for macro_build. Don't drop the add_symbol
|
||||
when generating the second version of a relaxable macro.
|
||||
(load_got_offset, add_got_offset): New functions.
|
||||
(load_address, macro): Use new relaxation machinery. Remove
|
||||
tc_gen_reloc workarounds.
|
||||
(md_estimate_size_before_relax): Set RELAX_USE_SECOND if the second
|
||||
version of a relaxable macro is needed. Return -RELAX_SECOND if the
|
||||
first version is needed.
|
||||
(tc_gen_reloc): Remove relaxation handling.
|
||||
(md_convert_frag): Go through the fixups for a relaxable macro and
|
||||
mark those that belong to the unneeded alternative as done. If the
|
||||
second alternative is needed, adjust the fixup addresses to account
|
||||
for the deleted first alternative.
|
||||
|
||||
2004-01-23 Richard Sandiford <rsandifo@redhat.com>
|
||||
|
||||
* frags.h (frag_room): Declare.
|
||||
|
|
1176
gas/config/tc-mips.c
1176
gas/config/tc-mips.c
File diff suppressed because it is too large
Load diff
|
@ -1,3 +1,8 @@
|
|||
2004-01-23 Richard Sandiford <rsandifo@redhat.com>
|
||||
|
||||
* gas/mips/elf-rel19.[sd]: New test.
|
||||
* gas/mips/mips.exp: Run it.
|
||||
|
||||
2004-01-11 Tom Rix <tcrix@worldnet.att.net>
|
||||
|
||||
* gas/m68hc11/movb.s: Add m68hc12 movb and movw dump test.
|
||||
|
|
34
gas/testsuite/gas/mips/elf-rel19.d
Normal file
34
gas/testsuite/gas/mips/elf-rel19.d
Normal file
|
@ -0,0 +1,34 @@
|
|||
#objdump: -dr
|
||||
#as: -mabi=32 -KPIC
|
||||
|
||||
.*: file format .*
|
||||
|
||||
Disassembly of section \.text:
|
||||
|
||||
00000000 <.*>:
|
||||
#
|
||||
# Relocation agsinst .rodata.str1.1
|
||||
#
|
||||
.*: 8f840000 lw a0,0\(gp\)
|
||||
.*: R_MIPS_GOT16 \.rodata\.str1\.1
|
||||
.*: 00000000 nop
|
||||
.*: 24840004 addiu a0,a0,4
|
||||
.*: R_MIPS_LO16 \.rodata\.str1\.1
|
||||
#
|
||||
# Relocation agsinst L2 + 2
|
||||
#
|
||||
.*: 8f840000 lw a0,0\(gp\)
|
||||
.*: R_MIPS_GOT16 L2
|
||||
.*: 00000000 nop
|
||||
.*: 24840002 addiu a0,a0,2
|
||||
.*: R_MIPS_LO16 L2
|
||||
#
|
||||
# Relocation agsinst L2 - 0x4000 with 0x10000 added separately.
|
||||
#
|
||||
.*: 8f840000 lw a0,0\(gp\)
|
||||
.*: R_MIPS_GOT16 L2
|
||||
.*: 3c010001 lui at,0x1
|
||||
.*: 2421c000 addiu at,at,-16384
|
||||
.*: R_MIPS_LO16 L2
|
||||
.*: 00812021 addu a0,a0,at
|
||||
\.\.\.
|
8
gas/testsuite/gas/mips/elf-rel19.s
Normal file
8
gas/testsuite/gas/mips/elf-rel19.s
Normal file
|
@ -0,0 +1,8 @@
|
|||
.abicalls
|
||||
la $4,L2
|
||||
la $4,L2 + 2
|
||||
la $4,L2 + 0xc000
|
||||
.space 16
|
||||
.section .rodata.str1.1,"aMS",@progbits,1
|
||||
L1: .string "foo"
|
||||
L2: .string "a"
|
|
@ -678,6 +678,7 @@ if { [istarget mips*-*-*] } then {
|
|||
if $has_newabi {
|
||||
run_dump_test "elf-rel18"
|
||||
}
|
||||
run_dump_test "elf-rel19"
|
||||
|
||||
run_dump_test "${tmips}${el}empic"
|
||||
run_dump_test "empic2"
|
||||
|
|
Loading…
Reference in a new issue