2005-08-12 Dmitry Diky <diwil@spec.ru>

* elf32-msp430.c (msp430_elf_relax_delete_bytes): Adjust relocations
	referenced by .section + DISPLACEMENT.
This commit is contained in:
Dmitry Diky 2005-08-12 11:45:26 +00:00
parent e079bef8e5
commit fa9ee72b80
2 changed files with 20 additions and 3 deletions

View File

@ -1,3 +1,8 @@
2005-08-12 Dmitry Diky <diwil@spec.ru>
* elf32-msp430.c (msp430_elf_relax_delete_bytes): Adjust relocations
referenced by .section + DISPLACEMENT.
2005-08-10 James E. Wilson <wilson@specifix.com> 2005-08-10 James E. Wilson <wilson@specifix.com>
* dwarf2.c (scan_unit_for_symbols, case DT_AT_location): Verify that * dwarf2.c (scan_unit_for_symbols, case DT_AT_location): Verify that

View File

@ -868,10 +868,22 @@ msp430_elf_relax_delete_bytes (bfd * abfd, asection * sec, bfd_vma addr,
sec->size -= count; sec->size -= count;
/* Adjust all the relocs. */ /* 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++) for (irel = elf_section_data (sec)->relocs; irel < irelend; irel++)
/* Get the new reloc address. */ {
if ((irel->r_offset > addr && irel->r_offset < toaddr)) int sidx = ELF32_R_SYM(irel->r_info);
irel->r_offset -= count; 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. */ /* Adjust the local symbols defined in this section. */
symtab_hdr = & elf_tdata (abfd)->symtab_hdr; symtab_hdr = & elf_tdata (abfd)->symtab_hdr;