aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2004-05-22 01:56:31 +0000
committerAlan Modra <amodra@gmail.com>2004-05-22 01:56:31 +0000
commit753731eef094e983fab58faf7c7c5e8090de6e1b (patch)
treefbb781352bd805dad317c126df1f62b7f5188e2a /bfd/elf.c
parenta55491f7c4c7f716fcad92b8ad0acd4f757bc218 (diff)
downloadgdb-753731eef094e983fab58faf7c7c5e8090de6e1b.zip
gdb-753731eef094e983fab58faf7c7c5e8090de6e1b.tar.gz
gdb-753731eef094e983fab58faf7c7c5e8090de6e1b.tar.bz2
* merge.c (_bfd_merged_section_offset): Remove "addend" param.
* libbfd-in.h (_bfd_merged_section_offset): Adjust prototype. * libbfd.h: Regenerate. * elf.c (_bfd_elf_rela_local_sym): Adjust call. (_bfd_elf_rel_local_sym): Likewise. * elflink.c (_bfd_elf_link_sec_merge_syms): Likewise. (elf_link_input_bfd): Likewise. * elf32-ppc.c (ppc_elf_relax_section): Likewise. * elf64-alpha.c (elf64_alpha_relocate_section): Likewise. * elfxx-ia64.c (elfNN_ia64_relax_section): Likewise. (elfNN_ia64_relocate_section): Likewise.
Diffstat (limited to 'bfd/elf.c')
-rw-r--r--bfd/elf.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/bfd/elf.c b/bfd/elf.c
index 0317e35..e5ab09e 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -7537,9 +7537,18 @@ _bfd_elf_rela_local_sym (bfd *abfd,
rel->r_addend =
_bfd_merged_section_offset (abfd, psec,
elf_section_data (sec)->sec_info,
- sym->st_value + rel->r_addend,
- 0);
- sec = *psec;
+ sym->st_value + rel->r_addend);
+ if (sec != *psec)
+ {
+ /* If we have changed the section, and our original section is
+ marked with SEC_EXCLUDE, it means that the original
+ SEC_MERGE section has been completely subsumed in some
+ other SEC_MERGE section. In this case, we need to leave
+ some info around for --emit-relocs. */
+ if ((sec->flags & SEC_EXCLUDE) != 0)
+ sec->kept_section = *psec;
+ sec = *psec;
+ }
rel->r_addend -= relocation;
rel->r_addend += sec->output_section->vma + sec->output_offset;
}
@@ -7559,7 +7568,7 @@ _bfd_elf_rel_local_sym (bfd *abfd,
return _bfd_merged_section_offset (abfd, psec,
elf_section_data (sec)->sec_info,
- sym->st_value + addend, 0);
+ sym->st_value + addend);
}
bfd_vma