* elfxx-mips.c (mips_elf_calculate_relocation): Don't report an
overflow for calls to undefined weak symbols.
This commit is contained in:
parent
4446463b16
commit
c314987d19
6 changed files with 28 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
|||
2004-12-14 Richard Sandiford <rsandifo@redhat.com>
|
||||
|
||||
* elfxx-mips.c (mips_elf_calculate_relocation): Don't report an
|
||||
overflow for calls to undefined weak symbols.
|
||||
|
||||
2004-12-11 Alan Modra <amodra@bigpond.net.au>
|
||||
|
||||
* elfcode.h (elf_slurp_symbol_table): Use bfd_elf_sym_name so that
|
||||
|
|
|
@ -3352,6 +3352,7 @@ mips_elf_calculate_relocation (bfd *abfd, bfd *input_bfd,
|
|||
else
|
||||
{
|
||||
value = (_bfd_mips_elf_sign_extend (addend, 28) + symbol) >> 2;
|
||||
if (h->root.root.type != bfd_link_hash_undefweak)
|
||||
overflowed_p = (value >> 26) != ((p + 4) >> 28);
|
||||
}
|
||||
value &= howto->dst_mask;
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
2004-12-14 Richard Sandiford <rsandifo@redhat.com>
|
||||
|
||||
* ld-mips-elf/jal-overflow-2.[sd]: New test.
|
||||
* ld-mips-elf/mips-elf.exp: Run it.
|
||||
|
||||
2004-12-13 Richard Sandiford <rsandifo@redhat.com>
|
||||
|
||||
* ld-mips-elf/mips-elf.exp: Only run jalbal if n32 is supported.
|
||||
|
|
8
ld/testsuite/ld-mips-elf/jaloverflow-2.d
Normal file
8
ld/testsuite/ld-mips-elf/jaloverflow-2.d
Normal file
|
@ -0,0 +1,8 @@
|
|||
#name: JAL overflow 2
|
||||
#source: jaloverflow-2.s
|
||||
#as:
|
||||
#ld: -Ttext=0x10000000 -e start
|
||||
#objdump: -dr
|
||||
#...
|
||||
0*10000000: 0c000000.*
|
||||
#pass
|
7
ld/testsuite/ld-mips-elf/jaloverflow-2.s
Normal file
7
ld/testsuite/ld-mips-elf/jaloverflow-2.s
Normal file
|
@ -0,0 +1,7 @@
|
|||
# jal relocs against undefined weak symbols should not be treated as
|
||||
# overflowing
|
||||
|
||||
.globl start
|
||||
.weak foo
|
||||
start:
|
||||
jal foo
|
|
@ -81,6 +81,7 @@ if {$has_newabi && $linux_gnu} {
|
|||
}
|
||||
|
||||
run_dump_test "jaloverflow"
|
||||
run_dump_test "jaloverflow-2"
|
||||
if {$has_newabi} {
|
||||
run_dump_test "jalbal"
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue