aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf64-alpha.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2001-11-28 19:15:14 +0000
committerJakub Jelinek <jakub@redhat.com>2001-11-28 19:15:14 +0000
commitf7460f5f7689262ad24e7e28c9d6662169cd3549 (patch)
treeb91781a60f2fdb2d19a13d770b42458fc58772ea /bfd/elf64-alpha.c
parent607334a109d5de6cddbcec994bf142aa099cfe41 (diff)
downloadgdb-f7460f5f7689262ad24e7e28c9d6662169cd3549.zip
gdb-f7460f5f7689262ad24e7e28c9d6662169cd3549.tar.gz
gdb-f7460f5f7689262ad24e7e28c9d6662169cd3549.tar.bz2
* elf64-alpha.c (ALPHA_ELF_GOT_ENTRY_RELOCS_XLATED): Defined.
(elf64_alpha_relocate_section): Translate local_got_entries for STT_SECTION symbol to SHF_MERGE section the first time we see it. * elfxx-ia64.c (struct elfNN_ia64_local_hash_entry): Add sec_merge_done. (get_local_sym_hash): New, extracted from get_dyn_sym_info. (get_dyn_sym_info): Use it. (elfNN_ia64_relocate_section): Translate local dyn entries for STT_SECTION symbol to SHF_MERGE section the first time we see it. * write.c (adjust_reloc_syms): Mark SEC_MERGE symbols as used in reloc if it has non-zero addend. * config/tc-alpha.c (tc_gen_reloc): Reinstall SEC_MERGE check. * config/tc-sparc.c (md_apply_fix3): Likewise.
Diffstat (limited to 'bfd/elf64-alpha.c')
-rw-r--r--bfd/elf64-alpha.c34
1 files changed, 33 insertions, 1 deletions
diff --git a/bfd/elf64-alpha.c b/bfd/elf64-alpha.c
index 783f010..950d051 100644
--- a/bfd/elf64-alpha.c
+++ b/bfd/elf64-alpha.c
@@ -170,8 +170,9 @@ struct alpha_elf_link_hash_entry
int flags;
- /* An additional flag. */
+ /* Additional flags. */
#define ALPHA_ELF_GOT_ENTRY_RELOCS_DONE 0x10
+#define ALPHA_ELF_GOT_ENTRY_RELOCS_XLATED 0x20
int use_count;
} *got_entries;
@@ -3400,6 +3401,37 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section,
gotent = (alpha_elf_tdata(input_bfd)->
local_got_entries[r_symndx]);
dynamic_symbol = false;
+
+ /* Need to adjust local GOT entries' addends for SEC_MERGE
+ unless it has been done already. */
+ if ((sec->flags & SEC_MERGE)
+ && ELF_ST_TYPE (sym->st_info) == STT_SECTION
+ && elf_section_data (sec)->merge_info
+ && (gotent->flags & ALPHA_ELF_GOT_ENTRY_RELOCS_XLATED) == 0)
+ {
+ struct alpha_elf_got_entry *ent;
+ asection *msec;
+
+ for (ent = gotent; ent; ent = ent->next)
+ {
+ ent->flags |= ALPHA_ELF_GOT_ENTRY_RELOCS_XLATED;
+ if (ent->use_count == 0)
+ continue;
+ msec = sec;
+ ent->addend =
+ _bfd_merged_section_offset (output_bfd, &msec,
+ elf_section_data (sec)->
+ merge_info,
+ sym->st_value
+ + ent->addend,
+ (bfd_vma) 0);
+ ent->addend -= sym->st_value;
+ ent->addend += msec->output_section->vma
+ + msec->output_offset
+ - sec->output_section->vma
+ - sec->output_offset;
+ }
+ }
}
BFD_ASSERT(gotent != NULL);