aboutsummaryrefslogtreecommitdiff
path: root/gold/archive.cc
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2010-11-03 17:18:23 +0000
committerNick Clifton <nickc@redhat.com>2010-11-03 17:18:23 +0000
commite597fa086665187c4d0dea1c45d5c044e297af66 (patch)
tree425160e0e61155ace9a561b8166d4f3fc29c067c /gold/archive.cc
parent74cea91bbb82d5e4afa212b67eaf53710fd99dcd (diff)
downloadgdb-e597fa086665187c4d0dea1c45d5c044e297af66.zip
gdb-e597fa086665187c4d0dea1c45d5c044e297af66.tar.gz
gdb-e597fa086665187c4d0dea1c45d5c044e297af66.tar.bz2
PR ld/12001
* ldlang.c (ldlang_def_chain_list): New variable. Contains a list of symbols defined via the --defsym command line option and currently waiting assignment. (insert_defined): Add a defined symbol to the symbol table. (ldlang_add_def): Add a entry to the ldlang_def_chain_list. (lang_place_defineds): Walk ldlang_def_chain_list defining the symbols. (lang_process): Call lang_place_defineds. (lang_add_assignment): If the assignment has come from a --defsym command line option then call lang_add_def. * ld-script/default-script2.d: Fix expected address for text section. PR gold/12001 * script.h (class Symbol_assignment: name): New member. Returns the name of the symbol. * scrfipt.cc (Script_options::is_pending_assignment): New member. Returns true if the given symbol name is on the list of assignments wating to be processed. * archive.cc (should_incldue_member): If the symbol is undefined, check to see if it is on the list of symbols pending assignment.
Diffstat (limited to 'gold/archive.cc')
-rw-r--r--gold/archive.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/gold/archive.cc b/gold/archive.cc
index 541a494..a289e5e 100644
--- a/gold/archive.cc
+++ b/gold/archive.cc
@@ -671,6 +671,10 @@ Archive::should_include_member(Symbol_table* symtab, Layout* layout,
}
else if (!sym->is_undefined())
return Archive::SHOULD_INCLUDE_NO;
+ // PR 12001: Do not include an archive when the undefined
+ // symbol has actually been defined on the command line.
+ else if (layout->script_options()->is_pending_assignment(sym_name))
+ return Archive::SHOULD_INCLUDE_NO;
else if (sym->binding() == elfcpp::STB_WEAK)
return Archive::SHOULD_INCLUDE_UNKNOWN;