summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Crane <sjc@immunant.com>2018-03-16 00:48:01 +0000
committerandroid-build-merger <android-build-merger@google.com>2018-03-16 00:48:01 +0000
commit8d586522fb86dc59bd9401aafabcdc69b9320b48 (patch)
tree767baa79fb4e9ab520fb5903cf862c4abdb21e86
parentabf458733484bd3b0f29706c641511f926e595f2 (diff)
parent73fe135cd39d4b1bcba39293dc9446a7b26c5d32 (diff)
downloadbinutils-8d586522fb86dc59bd9401aafabcdc69b9320b48.tar.gz
Fix problem where undef can fail to trigger archive rescan. am: 41d8fcbbad
am: 73fe135cd3 Change-Id: I721a8cab09b24a6de1bdee0f47de584367c2885b
-rw-r--r--binutils-2.27/gold/symtab.cc15
1 files changed, 8 insertions, 7 deletions
diff --git a/binutils-2.27/gold/symtab.cc b/binutils-2.27/gold/symtab.cc
index c872f47d..e0b7e9db 100644
--- a/binutils-2.27/gold/symtab.cc
+++ b/binutils-2.27/gold/symtab.cc
@@ -989,7 +989,7 @@ Symbol_table::add_from_object(Object* object,
// ins.second: true if new entry was inserted, false if not.
Sized_symbol<size>* ret;
- bool was_undefined;
+ bool was_undefined_in_reg;
bool was_common;
if (!ins.second)
{
@@ -997,7 +997,7 @@ Symbol_table::add_from_object(Object* object,
ret = this->get_sized_symbol<size>(ins.first->second);
gold_assert(ret != NULL);
- was_undefined = ret->is_undefined();
+ was_undefined_in_reg = ret->is_undefined() && ret->in_reg();
// Commons from plugins are just placeholders.
was_common = ret->is_common() && ret->object()->pluginobj() == NULL;
@@ -1048,7 +1048,7 @@ Symbol_table::add_from_object(Object* object,
// it, then change it to NAME/VERSION.
ret = this->get_sized_symbol<size>(insdefault.first->second);
- was_undefined = ret->is_undefined();
+ was_undefined_in_reg = ret->is_undefined() && ret->in_reg();
// Commons from plugins are just placeholders.
was_common = ret->is_common() && ret->object()->pluginobj() == NULL;
@@ -1060,7 +1060,7 @@ Symbol_table::add_from_object(Object* object,
}
else
{
- was_undefined = false;
+ was_undefined_in_reg = false;
was_common = false;
Sized_target<size, big_endian>* target =
@@ -1104,9 +1104,10 @@ Symbol_table::add_from_object(Object* object,
ret->set_is_default();
}
- // Record every time we see a new undefined symbol, to speed up
- // archive groups.
- if (!was_undefined && ret->is_undefined())
+ // Record every time we see a new undefined symbol, to speed up archive
+ // groups. We only care about symbols undefined in regular objects here
+ // because undefined symbols only in dynamic objects should't trigger rescans.
+ if (!was_undefined_in_reg && ret->is_undefined() && ret->in_reg())
{
++this->saw_undefined_;
if (parameters->options().has_plugins())