* config/tc-mips.c (mips_need_elf_addend_fixup): Return true

for relocs against symbols in a merged section.

testsuite/
	* gas/mips/elf-rel7.[sd]: New test.
	* gas/mips/mips.exp: Run it.
This commit is contained in:
Richard Sandiford 2002-10-21 14:59:30 +00:00
parent 407caf07a4
commit 631cb423b2
6 changed files with 55 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2002-10-21 Richard Sandiford <rsandifo@redhat.com>
* config/tc-mips.c (mips_need_elf_addend_fixup): Return true
for relocs against symbols in a merged section.
2002-10-18 Alexandre Oliva <aoliva@redhat.com>
* config/tc-mips.c (md_begin): Add $fcc registers to the symbol

View File

@ -10981,7 +10981,7 @@ mips_need_elf_addend_fixup (fixP)
if (symbol_used_in_reloc_p (fixP->fx_addsy)
&& (((bfd_get_section_flags (stdoutput,
S_GET_SEGMENT (fixP->fx_addsy))
& SEC_LINK_ONCE) != 0)
& (SEC_LINK_ONCE | SEC_MERGE)) != 0)
|| !strncmp (segment_name (S_GET_SEGMENT (fixP->fx_addsy)),
".gnu.linkonce",
sizeof (".gnu.linkonce") - 1)))

View File

@ -1,3 +1,8 @@
2002-10-21 Richard Sandiford <rsandifo@redhat.com>
* gas/mips/elf-rel7.[sd]: New test.
* gas/mips/mips.exp: Run it.
2002-10-12 Alexandre Oliva <aoliva@redhat.com>
* gas/mips/mips.exp: Don't xfail relax.

View File

@ -0,0 +1,31 @@
#objdump: -dr --prefix-addresses
#name: MIPS ELF reloc 7
.*: +file format elf.*mips.*
Disassembly of section \.text:
0+00 <.*> lui a0,0x0
0: R_MIPS_HI16 .barsec
0+04 <.*> lw a0,8\(a0\)
4: R_MIPS_LO16 .barsec
0+08 <.*> lui a0,0x0
8: R_MIPS_HI16 bar
0+0c <.*> lw a0,4\(a0\)
c: R_MIPS_LO16 bar
0+10 <.*> lui a0,0x0
10: R_MIPS_HI16 bar
0+14 <.*> lw a0,8\(a0\)
14: R_MIPS_LO16 bar
0+18 <.*> lui a0,0x0
18: R_MIPS_HI16 frob
0+1c <.*> lw a0,0\(a0\)
1c: R_MIPS_LO16 frob
0+20 <.*> lui a0,0x0
20: R_MIPS_HI16 frob
0+24 <.*> lw a0,4\(a0\)
24: R_MIPS_LO16 frob
0+28 <.*> lui a0,0x0
28: R_MIPS_HI16 frob
0+2c <.*> lw a0,16\(a0\)
2c: R_MIPS_LO16 frob
#pass

View File

@ -0,0 +1,12 @@
.global frob
.section .barsec,"aM",@progbits,8
.word 0,1
bar: .word 2,3
frob: .word 4,5
.text
foo: lw $4,bar
lw $4,bar+4
lw $4,bar+8
lw $4,frob
lw $4,frob+4
lw $4,frob+16

View File

@ -220,6 +220,7 @@ if { [istarget mips*-*-*] } then {
}
run_dump_test "elf-rel5"
run_dump_test "elf-rel6"
run_dump_test "elf-rel7"
run_dump_test "${tmips}${el}empic"
run_dump_test "empic2"
run_dump_test "empic3_e"