aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Burgess <andrew.burgess@embecosm.com>2014-10-25 15:08:14 +0100
committerAndrew Burgess <andrew.burgess@embecosm.com>2014-11-03 20:33:25 +0000
commita12d0ffc72ee57f8db8b466fd9032360d8d15e09 (patch)
treec682547453aa205443b545869433b6f9b3abbdef /bfd/elf32-avr.c
parentMore fixes for buffer overruns instigated by corrupt binaries. (diff)
downloadbinutils-gdb-a12d0ffc72ee57f8db8b466fd9032360d8d15e09.tar.gz
binutils-gdb-a12d0ffc72ee57f8db8b466fd9032360d8d15e09.tar.bz2
binutils-gdb-a12d0ffc72ee57f8db8b466fd9032360d8d15e09.zip
When relaxing, update symbols at the very end of the section.
Symbols at the very end of a section were not being updated correctly when linker relaxation takes place due to the use of '<' instead of '<='. Added a couple of tests to cover this behaviour. bfd/ChangeLog: * elf32-avr.c (elf32_avr_relax_delete_bytes): Modify symbols located at the very end of the section. ld/ChangeLog: * ld/testsuite/ld-avr/relax-02.d: New file. * ld/testsuite/ld-avr/relax-02.s: New file. * ld/testsuite/ld-avr/relax-03.d: New file. * ld/testsuite/ld-avr/relax-03.s: New file.
Diffstat (limited to 'bfd/elf32-avr.c')
-rw-r--r--bfd/elf32-avr.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/bfd/elf32-avr.c b/bfd/elf32-avr.c
index 54d67bf0403..8498d29493e 100644
--- a/bfd/elf32-avr.c
+++ b/bfd/elf32-avr.c
@@ -1883,7 +1883,7 @@ elf32_avr_relax_delete_bytes (bfd *abfd,
{
if (isym->st_shndx == sec_shndx
&& isym->st_value > addr
- && isym->st_value < toaddr)
+ && isym->st_value <= toaddr)
isym->st_value -= count;
}
}
@@ -1900,7 +1900,7 @@ elf32_avr_relax_delete_bytes (bfd *abfd,
|| sym_hash->root.type == bfd_link_hash_defweak)
&& sym_hash->root.u.def.section == sec
&& sym_hash->root.u.def.value > addr
- && sym_hash->root.u.def.value < toaddr)
+ && sym_hash->root.u.def.value <= toaddr)
{
sym_hash->root.u.def.value -= count;
}