aboutsummaryrefslogtreecommitdiff
path: root/bfd/elflink.h
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1997-06-11 16:59:00 +0000
committerIan Lance Taylor <ian@airs.com>1997-06-11 16:59:00 +0000
commit8519ea2120056aed56c20011dca7c4d72d806a61 (patch)
tree06039844f5c6bff006dbe5742ef9841c6dfd620f /bfd/elflink.h
parentb4a3d2217687d8f8706285ba423dfb3430890f11 (diff)
downloadfsf-binutils-gdb-8519ea2120056aed56c20011dca7c4d72d806a61.zip
fsf-binutils-gdb-8519ea2120056aed56c20011dca7c4d72d806a61.tar.gz
fsf-binutils-gdb-8519ea2120056aed56c20011dca7c4d72d806a61.tar.bz2
* elflink.h (elf_link_output_extsym): Call finish_dynamic_symbol
for a symbol which is being forced to be local. * elf32-i386.c (elf_i386_relocate_section): Write out the relocation value for a GOT reloc for a symbol which is turning into a local symbol. (elf_i386_finish_dynamic_symbol): If a symbol is turning into a local symbol, write out a RELATIVE reloc rather than a GLOB_DAT reloc. * elf32-m68k.c, elf32-sparc.c: Corresponding changes.
Diffstat (limited to 'bfd/elflink.h')
-rw-r--r--bfd/elflink.h29
1 files changed, 18 insertions, 11 deletions
diff --git a/bfd/elflink.h b/bfd/elflink.h
index b295e10..0ac27da 100644
--- a/bfd/elflink.h
+++ b/bfd/elflink.h
@@ -4123,6 +4123,24 @@ elf_link_output_extsym (h, data)
((struct elf_link_hash_entry *) h->root.u.i.link, data));
}
+ /* Give the processor backend a chance to tweak the symbol value,
+ and also to finish up anything that needs to be done for this
+ symbol. */
+ if ((h->dynindx != -1
+ || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0)
+ && elf_hash_table (finfo->info)->dynamic_sections_created)
+ {
+ struct elf_backend_data *bed;
+
+ bed = get_elf_backend_data (finfo->output_bfd);
+ if (! ((*bed->elf_backend_finish_dynamic_symbol)
+ (finfo->output_bfd, finfo->info, h, &sym)))
+ {
+ eoinfo->failed = true;
+ return false;
+ }
+ }
+
/* If this symbol should be put in the .dynsym section, then put it
there now. We have already know the symbol index. We also fill
in the entry in the .hash section. */
@@ -4139,17 +4157,6 @@ elf_link_output_extsym (h, data)
sym.st_name = h->dynstr_index;
- /* Give the processor backend a chance to tweak the symbol
- value, and also to finish up anything that needs to be done
- for this symbol. */
- bed = get_elf_backend_data (finfo->output_bfd);
- if (! ((*bed->elf_backend_finish_dynamic_symbol)
- (finfo->output_bfd, finfo->info, h, &sym)))
- {
- eoinfo->failed = true;
- return false;
- }
-
elf_swap_symbol_out (finfo->output_bfd, &sym,
(PTR) (((Elf_External_Sym *)
finfo->dynsym_sec->contents)