summaryrefslogtreecommitdiff
path: root/bfd/elf32-xtensa.c
diff options
context:
space:
mode:
authorBob Wilson <bob.wilson@acm.org>2007-12-21 23:11:28 +0000
committerBob Wilson <bob.wilson@acm.org>2007-12-21 23:11:28 +0000
commitb9cf5d41c626b2fc0c4da13bbc9efd9c320a9b82 (patch)
treeba9a948defa54d44ff81b3658f695bbc99f6c832 /bfd/elf32-xtensa.c
parent92a78412b76fd20c6fe7bd361a4fff4aa22c2f83 (diff)
downloadbinutils-redhat-b9cf5d41c626b2fc0c4da13bbc9efd9c320a9b82.tar.gz
* elf32-xtensa.c (relax_section): Update DIFF relocations in the
same way as other relocations.
Diffstat (limited to 'bfd/elf32-xtensa.c')
-rw-r--r--bfd/elf32-xtensa.c42
1 files changed, 20 insertions, 22 deletions
diff --git a/bfd/elf32-xtensa.c b/bfd/elf32-xtensa.c
index a1c608872f..d9f2aa25c9 100644
--- a/bfd/elf32-xtensa.c
+++ b/bfd/elf32-xtensa.c
@@ -8240,30 +8240,28 @@ relax_section (bfd *abfd, asection *sec, struct bfd_link_info *link_info)
pin_contents (sec, contents);
}
+
+ /* If the relocation still references a section in the same
+ input file, modify the relocation directly instead of
+ adding a "fix" record. */
+ if (target_sec->owner == abfd)
+ {
+ unsigned r_symndx = ELF32_R_SYM (new_reloc.rela.r_info);
+ irel->r_info = ELF32_R_INFO (r_symndx, r_type);
+ irel->r_addend = new_reloc.rela.r_addend;
+ pin_internal_relocs (sec, internal_relocs);
+ }
else
{
- /* If the relocation still references a section in the same
- input file, modify the relocation directly instead of
- adding a "fix" record. */
- if (target_sec->owner == abfd)
- {
- unsigned r_symndx = ELF32_R_SYM (new_reloc.rela.r_info);
- irel->r_info = ELF32_R_INFO (r_symndx, r_type);
- irel->r_addend = new_reloc.rela.r_addend;
- pin_internal_relocs (sec, internal_relocs);
- }
- else
- {
- bfd_vma addend_displacement;
- reloc_bfd_fix *fix;
-
- addend_displacement =
- new_reloc.target_offset + new_reloc.virtual_offset;
- fix = reloc_bfd_fix_init (sec, source_offset, r_type,
- target_sec,
- addend_displacement, TRUE);
- add_fix (sec, fix);
- }
+ bfd_vma addend_displacement;
+ reloc_bfd_fix *fix;
+
+ addend_displacement =
+ new_reloc.target_offset + new_reloc.virtual_offset;
+ fix = reloc_bfd_fix_init (sec, source_offset, r_type,
+ target_sec,
+ addend_displacement, TRUE);
+ add_fix (sec, fix);
}
}
}