aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-avr.c
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
parent5a3f568b70bdfb91aacdfb66657b56d8c6d242f1 (diff)
downloadgdb-a12d0ffc72ee57f8db8b466fd9032360d8d15e09.zip
gdb-a12d0ffc72ee57f8db8b466fd9032360d8d15e09.tar.gz
gdb-a12d0ffc72ee57f8db8b466fd9032360d8d15e09.tar.bz2
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 54d67bf..8498d29 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;
}