aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1995-07-04 17:44:38 +0000
committerIan Lance Taylor <ian@airs.com>1995-07-04 17:44:38 +0000
commit7158d2b1a33bdb747c3310f5fe5884dec8e31a72 (patch)
treefab09fb1485b12cca58082d228d452b0693c4b0d /ld
parentb5279eb6a9672dba08ce9bbef0490f4bf26243f3 (diff)
downloadgdb-7158d2b1a33bdb747c3310f5fe5884dec8e31a72.zip
gdb-7158d2b1a33bdb747c3310f5fe5884dec8e31a72.tar.gz
gdb-7158d2b1a33bdb747c3310f5fe5884dec8e31a72.tar.bz2
* emultempl/elf32.em (gld${EMULATION_NAME}_find_exp_assignment):
Handle etree_provide. PR 7164.
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog3
-rw-r--r--ld/emultempl/elf32.em22
2 files changed, 23 insertions, 2 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 605d189..3ee74c4 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,5 +1,8 @@
Tue Jul 4 12:55:48 1995 Ian Lance Taylor <ian@cygnus.com>
+ * emultempl/elf32.em (gld${EMULATION_NAME}_find_exp_assignment):
+ Handle etree_provide.
+
* emultempl/elf32.em (global_needed): New static variable.
(global_found): Likewise.
(gld${EMULATION_NAME}_after_open): New static function.
diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em
index 9cfb3ea..bc84a8f 100644
--- a/ld/emultempl/elf32.em
+++ b/ld/emultempl/elf32.em
@@ -399,13 +399,31 @@ static void
gld${EMULATION_NAME}_find_exp_assignment (exp)
etree_type *exp;
{
+ struct bfd_link_hash_entry *h;
+
switch (exp->type.node_class)
{
+ case etree_provide:
+ h = bfd_link_hash_lookup (link_info.hash, exp->assign.dst,
+ false, false, false);
+ if (h == NULL)
+ break;
+
+ /* We call record_link_assignment even if the symbol is defined.
+ This is because if it is defined by a dynamic object, we
+ actually want to use the value defined by the linker script,
+ not the value from the dynamic object (because we are setting
+ symbols like etext). If the symbol is defined by a regular
+ object, then, as it happens, calling record_link_assignment
+ will do no harm. */
+
+ /* Fall through. */
case etree_assign:
if (strcmp (exp->assign.dst, ".") != 0)
{
- if (! bfd_elf32_record_link_assignment (output_bfd, &link_info,
- exp->assign.dst))
+ if (! (bfd_elf32_record_link_assignment
+ (output_bfd, &link_info, exp->assign.dst,
+ exp->type.node_class == etree_provide ? true : false)))
einfo ("%P%F: failed to record assignment to %s: %E\n",
exp->assign.dst);
}