/* Called via elf_link_hash_traverse to transfer dynamic linking
information on function code symbol entries to their corresponding
- function descriptor symbol entries. */
+ function descriptor symbol entries. Must not be called twice for
+ any given code symbol. */
static bool
func_desc_adjust (struct elf_link_hash_entry *h, void *inf)
if (ent->plt.refcount > 0)
break;
if (ent == NULL)
- return true;
+ {
+ if (fdh != NULL && fdh->fake)
+ _bfd_elf_link_hash_hide_symbol (info, &fdh->elf, true);
+ return true;
+ }
}
/* Create a descriptor as undefined if necessary. */
= (htab->elf.hgot->other & ~ELF_ST_VISIBILITY (-1)) | STV_HIDDEN;
}
- if (htab->need_func_desc_adj)
- {
- elf_link_hash_traverse (&htab->elf, func_desc_adjust, info);
- htab->need_func_desc_adj = 0;
- }
-
return true;
}
if (htab == NULL)
return false;
+ /* Move dynamic linking info to the function descriptor sym. */
+ if (htab->need_func_desc_adj)
+ {
+ elf_link_hash_traverse (&htab->elf, func_desc_adjust, info);
+ htab->need_func_desc_adj = 0;
+ }
+
if (abiversion (info->output_bfd) == 1)
htab->opd_abi = 1;
tga = elf_link_hash_lookup (&htab->elf, ".__tls_get_addr",
false, false, true);
htab->tls_get_addr = ppc_elf_hash_entry (tga);
-
- /* Move dynamic linking info to the function descriptor sym. */
- if (tga != NULL)
- func_desc_adjust (tga, info);
tga_fd = elf_link_hash_lookup (&htab->elf, "__tls_get_addr",
false, false, true);
htab->tls_get_addr_fd = ppc_elf_hash_entry (tga_fd);
desc = elf_link_hash_lookup (&htab->elf, ".__tls_get_addr_desc",
false, false, true);
htab->tga_desc = ppc_elf_hash_entry (desc);
- if (desc != NULL)
- func_desc_adjust (desc, info);
desc_fd = elf_link_hash_lookup (&htab->elf, "__tls_get_addr_desc",
false, false, true);
htab->tga_desc_fd = ppc_elf_hash_entry (desc_fd);
opt = elf_link_hash_lookup (&htab->elf, ".__tls_get_addr_opt",
false, false, true);
- if (opt != NULL)
- func_desc_adjust (opt, info);
opt_fd = elf_link_hash_lookup (&htab->elf, "__tls_get_addr_opt",
false, false, true);
if (opt_fd != NULL