From 8519ea2120056aed56c20011dca7c4d72d806a61 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Wed, 11 Jun 1997 16:59:00 +0000 Subject: * 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. --- bfd/elflink.h | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) (limited to 'bfd/elflink.h') 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) -- cgit v1.1