diff options
author | Alan Modra <amodra@gmail.com> | 2004-05-22 01:56:31 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2004-05-22 01:56:31 +0000 |
commit | 753731eef094e983fab58faf7c7c5e8090de6e1b (patch) | |
tree | fbb781352bd805dad317c126df1f62b7f5188e2a /bfd/elf.c | |
parent | a55491f7c4c7f716fcad92b8ad0acd4f757bc218 (diff) | |
download | gdb-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.c | 17 |
1 files changed, 13 insertions, 4 deletions
@@ -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 |