aboutsummaryrefslogtreecommitdiff
path: root/ld/ldmain.c
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/ldmain.c
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/ldmain.c')
-rw-r--r--ld/ldmain.c35
1 files changed, 26 insertions, 9 deletions
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);
}
}