summaryrefslogtreecommitdiff
path: root/ld/plugin.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2011-10-10 12:43:14 +0000
committerAlan Modra <amodra@bigpond.net.au>2011-10-10 12:43:14 +0000
commitd32da3905b7608e98952b5736561cfcd7bf70372 (patch)
tree2382014452595adfb23096ab05517b18e3dfa8fb /ld/plugin.c
parent1fe9b2355081373e6b5efca1af8bc9975b7ffaac (diff)
downloadbinutils-redhat-d32da3905b7608e98952b5736561cfcd7bf70372.tar.gz
* ldmain.c (main): Move code twiddling various config and link_info
bits to.. * lexsup.c (parse_args): ..here. Move plugin_load_plugins call into main. * plugin.c (set_tv_header): Test link_info.executable, not link_info.shared. (is_visible_from_outside): Likewise. Delete redundant is_ir_dummy_bfd check and "section" parameter.
Diffstat (limited to 'ld/plugin.c')
-rw-r--r--ld/plugin.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/ld/plugin.c b/ld/plugin.c
index 250233b898..5f4aa8faa6 100644
--- a/ld/plugin.c
+++ b/ld/plugin.c
@@ -442,18 +442,14 @@ release_input_file (const void *handle)
/* Return TRUE if a defined symbol might be reachable from outside the
universe of claimed objects. */
static inline bfd_boolean
-is_visible_from_outside (struct ld_plugin_symbol *lsym, asection *section,
+is_visible_from_outside (struct ld_plugin_symbol *lsym,
struct bfd_link_hash_entry *blhe)
{
struct bfd_sym_chain *sym;
- /* Section's owner may be NULL if it is the absolute
- section, fortunately is_ir_dummy_bfd handles that. */
- if (!is_ir_dummy_bfd (section->owner))
- return TRUE;
if (link_info.relocatable)
return TRUE;
- if (link_info.export_dynamic || link_info.shared)
+ if (link_info.export_dynamic || !link_info.executable)
{
/* Check if symbol is hidden by version script. */
if (bfd_hide_sym_by_version (link_info.version_info,
@@ -580,7 +576,7 @@ get_symbols (const void *handle, int nsyms, struct ld_plugin_symbol *syms,
symbol is externally visible. */
if (blhe->non_ir_ref)
res = LDPR_PREVAILING_DEF;
- else if (is_visible_from_outside (&syms[n], owner_sec, blhe))
+ else if (is_visible_from_outside (&syms[n], blhe))
res = def_ironly_exp;
}
@@ -701,7 +697,7 @@ set_tv_header (struct ld_plugin_tv *tv)
case LDPT_LINKER_OUTPUT:
TVU(val) = (link_info.relocatable
? LDPO_REL
- : (link_info.shared ? LDPO_DYN : LDPO_EXEC));
+ : link_info.executable ? LDPO_EXEC : LDPO_DYN);
break;
case LDPT_OUTPUT_NAME:
TVU(string) = output_filename;