aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1995-02-06 20:01:38 +0000
committerIan Lance Taylor <ian@airs.com>1995-02-06 20:01:38 +0000
commit8ed88239b4e44167abc75d9423596284de5a001d (patch)
tree6b6ca5ab9f69b98760c782a68508a5a8f2c76f8a /ld
parent6c97aedf2686633d3e837802ce51ebe630f64056 (diff)
downloadgdb-8ed88239b4e44167abc75d9423596284de5a001d.zip
gdb-8ed88239b4e44167abc75d9423596284de5a001d.tar.gz
gdb-8ed88239b4e44167abc75d9423596284de5a001d.tar.bz2
* ldctor.c (ldctor_build_sets): Handle bfd_link_hah_defweak.
* ldexp.c (fold_name): Likewise. * ldlang.c (print_one_symbol): Likewise. (lang_finish): Likewise. * ldmain.c (multiple_common): Likewise. * ldwrite.c (print_symbol): Likewise. Also, bfd_link_hash_weak renamed to bfd_link_hash_undefweak.
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog8
-rw-r--r--ld/ldlang.c6
-rw-r--r--ld/ldmain.c35
3 files changed, 38 insertions, 11 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 40f0933..2df76e9 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,5 +1,13 @@
Mon Feb 6 12:17:24 1995 Ian Lance Taylor <ian@cygnus.com>
+ * ldctor.c (ldctor_build_sets): Handle bfd_link_hah_defweak.
+ * ldexp.c (fold_name): Likewise.
+ * ldlang.c (print_one_symbol): Likewise.
+ (lang_finish): Likewise.
+ * ldmain.c (multiple_common): Likewise.
+ * ldwrite.c (print_symbol): Likewise. Also, bfd_link_hash_weak
+ renamed to bfd_link_hash_undefweak.
+
* scripttempl/alpha.sc: Set address of .data section correctly
when -n or -N is used. Patch from Chris G Demetriou
<Chris_G_Demetriou@LAGAVULIN.PDL.CS.CMU.EDU>.
diff --git a/ld/ldlang.c b/ld/ldlang.c
index c2b8e7d..bd71f2b 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -1280,7 +1280,8 @@ PTR ptr;
{
asection * sec = (asection *)ptr;
- if (hash_entry->type == bfd_link_hash_defined)
+ if (hash_entry->type == bfd_link_hash_defined
+ || hash_entry->type == bfd_link_hash_defweak)
{
if (sec == hash_entry->u.def.section) {
print_section ("");
@@ -2149,7 +2150,8 @@ lang_finish ()
h = bfd_link_hash_lookup (link_info.hash, entry_symbol, false, false, true);
if (h != (struct bfd_link_hash_entry *) NULL
- && h->type == bfd_link_hash_defined)
+ && (h->type == bfd_link_hash_defined
+ || h->type == bfd_link_hash_defweak))
{
bfd_vma val;
diff --git a/ld/ldmain.c b/ld/ldmain.c
index 392d302..a9b836a 100644
--- a/ld/ldmain.c
+++ b/ld/ldmain.c
@@ -201,12 +201,20 @@ main (argc, argv)
einfo ("%P%F: -relax and -r may not be used together\n");
if (config.dynamic_link)
einfo ("%P%F: -r and -call_shared may not be used together\n");
- if (link_info.strip == strip_all)
- einfo ("%P%F: -r and -s may not be used together\n");
if (link_info.shared)
einfo ("%P%F: -r and -shared may not be used together\n");
}
+ /* Treat ld -r -s as ld -r -S -x (i.e., strip all local symbols). I
+ don't see how else this can be handled, since in this case we
+ must preserve all externally visible symbols. */
+ if (link_info.relocateable && link_info.strip == strip_all)
+ {
+ link_info.strip = strip_debugger;
+ if (link_info.discard == discard_none)
+ link_info.discard = discard_all;
+ }
+
/* This essentially adds another -L directory so this must be done after
the -L's in argv have been processed. */
set_scripts_dir ();
@@ -629,19 +637,25 @@ multiple_common (info, name, obfd, otype, osize, nbfd, ntype, nsize)
if (! config.warn_common)
return true;
- if (ntype == bfd_link_hash_defined)
+ if (ntype == bfd_link_hash_defined
+ || ntype == bfd_link_hash_defweak
+ || ntype == bfd_link_hash_indirect)
{
ASSERT (otype == bfd_link_hash_common);
einfo ("%B: warning: definition of `%T' overriding common\n",
nbfd, name);
- einfo ("%B: warning: common is here\n", obfd);
+ if (obfd != NULL)
+ einfo ("%B: warning: common is here\n", obfd);
}
- else if (otype == bfd_link_hash_defined)
+ else if (otype == bfd_link_hash_defined
+ || otype == bfd_link_hash_defweak
+ || otype == bfd_link_hash_indirect)
{
ASSERT (ntype == bfd_link_hash_common);
einfo ("%B: warning: common of `%T' overridden by definition\n",
nbfd, name);
- einfo ("%B: warning: defined here\n", obfd);
+ if (obfd != NULL)
+ einfo ("%B: warning: defined here\n", obfd);
}
else
{
@@ -650,18 +664,21 @@ multiple_common (info, name, obfd, otype, osize, nbfd, ntype, nsize)
{
einfo ("%B: warning: common of `%T' overridden by larger common\n",
nbfd, name);
- einfo ("%B: warning: larger common is here\n", obfd);
+ if (obfd != NULL)
+ einfo ("%B: warning: larger common is here\n", obfd);
}
else if (nsize > osize)
{
einfo ("%B: warning: common of `%T' overriding smaller common\n",
nbfd, name);
- einfo ("%B: warning: smaller common is here\n", obfd);
+ if (obfd != NULL)
+ einfo ("%B: warning: smaller common is here\n", obfd);
}
else
{
einfo ("%B: warning: multiple common of `%T'\n", nbfd, name);
- einfo ("%B: warning: previous common is here\n", obfd);
+ if (obfd != NULL)
+ einfo ("%B: warning: previous common is here\n", obfd);
}
}