diff options
author | Dmitry Diky <diwil@spec.ru> | 2005-08-12 11:45:26 +0000 |
---|---|---|
committer | Dmitry Diky <diwil@spec.ru> | 2005-08-12 11:45:26 +0000 |
commit | d2276f7563d67896cb2057b9f610d88c1fbe4526 (patch) | |
tree | a1836b78a61e909408c9b95aab4de2dd343d6875 /bfd/elf32-msp430.c | |
parent | f28a20f1933fff01fa9bb5b8aed5cd990f012684 (diff) | |
download | binutils-redhat-d2276f7563d67896cb2057b9f610d88c1fbe4526.tar.gz |
2005-08-12 Dmitry Diky <diwil@spec.ru>
* elf32-msp430.c (msp430_elf_relax_delete_bytes): Adjust relocations
referenced by .section + DISPLACEMENT.
Diffstat (limited to 'bfd/elf32-msp430.c')
-rw-r--r-- | bfd/elf32-msp430.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/bfd/elf32-msp430.c b/bfd/elf32-msp430.c index da4278267c..3aec7aaebe 100644 --- a/bfd/elf32-msp430.c +++ b/bfd/elf32-msp430.c @@ -868,10 +868,22 @@ msp430_elf_relax_delete_bytes (bfd * abfd, asection * sec, bfd_vma addr, sec->size -= count; /* Adjust all the relocs. */ + symtab_hdr = & elf_tdata (abfd)->symtab_hdr; + isym = (Elf_Internal_Sym *) symtab_hdr->contents; for (irel = elf_section_data (sec)->relocs; irel < irelend; irel++) - /* Get the new reloc address. */ - if ((irel->r_offset > addr && irel->r_offset < toaddr)) - irel->r_offset -= count; + { + int sidx = ELF32_R_SYM(irel->r_info); + Elf_Internal_Sym *lsym = isym + sidx; + + /* Get the new reloc address. */ + if ((irel->r_offset > addr && irel->r_offset < toaddr)) + irel->r_offset -= count; + + /* Adjust symbols referenced by .sec+0xXX */ + if (irel->r_addend > addr && irel->r_addend < toaddr + && lsym->st_shndx == sec_shndx) + irel->r_addend -= count; + } /* Adjust the local symbols defined in this section. */ symtab_hdr = & elf_tdata (abfd)->symtab_hdr; |