This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[patch] Use LDPR_PREVAILING_DEF for symbols in -u
- From: Rafael Avila de Espindola <respindola at mozilla dot com>
- To: binutils at sourceware dot org
- Cc: iant at google dot com, dnovillo at google dot com
- Date: Fri, 04 Feb 2011 16:20:52 -0500
- Subject: [patch] Use LDPR_PREVAILING_DEF for symbols in -u
Using the gold plugin I noticed that symbols passed to -u were still
reported as LDPR_PREVAILING_DEF_IRONLY. I believe the correct behaviour
would be to return LDPR_PREVAILING_DEF. This is useful for example for
letting the linker (and therefore the compiler) know of references that
exist only in inline assembly.
2010-02-04 Rafael Ávila de Espíndola <respindola@mozilla.com>
* plugin.cc (is_visible_from_outside): Return true for symbols
in the -u option.
Cheers,
Rafael
diff --git a/gold/plugin.cc b/gold/plugin.cc
index 9c444c2..214eff3 100644
--- a/gold/plugin.cc
+++ b/gold/plugin.cc
@@ -699,6 +699,8 @@ is_visible_from_outside(Symbol* lsym)
return true;
if (parameters->options().relocatable())
return true;
+ if (parameters->options().is_undefined(lsym->name()))
+ return true;
if (parameters->options().export_dynamic() || parameters->options().shared())
return lsym->is_externally_visible();
return false;