summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Stormont <astormont@racktopsystems.com>2017-07-29 23:36:43 +0100
committerRichard Lowe <richlowe@richlowe.net>2017-09-07 14:14:48 -0400
commit202ca9ae460faf1825ede303c46abd4e1f6cee28 (patch)
tree29544acfbf48cc35b5fcd6e6745deb0099fb0f19
parent554675eee75dd2d7398d960aa5c81083ceb8505a (diff)
downloadillumos-joyent-202ca9ae460faf1825ede303c46abd4e1f6cee28.tar.gz
8616 ld has trouble parsing -z options specified with -Wl
Reviewed by: Toomas Soome <tsoome@me.com> Reviewed by: Yuri Pankov <yuripv@gmx.com> Approved by: Richard Lowe <richlowe@richlowe.net>
-rw-r--r--usr/src/cmd/sgs/libld/common/args.c9
-rw-r--r--usr/src/cmd/sgs/libld/common/libld.msg2
-rw-r--r--usr/src/cmd/sgs/packages/common/SUNWonld-README1
3 files changed, 12 insertions, 0 deletions
diff --git a/usr/src/cmd/sgs/libld/common/args.c b/usr/src/cmd/sgs/libld/common/args.c
index d130f4ecf3..c737ea9065 100644
--- a/usr/src/cmd/sgs/libld/common/args.c
+++ b/usr/src/cmd/sgs/libld/common/args.c
@@ -27,6 +27,7 @@
*/
/*
* Copyright (c) 2012, Joyent, Inc. All rights reserved.
+ * Copyright 2017 RackTop Systems.
*/
/*
@@ -1237,6 +1238,14 @@ parseopt_pass1(Ofl_desc *ofl, int argc, char **argv, int *usage)
DBG_CALL(Dbg_args_option(ofl->ofl_lml, ndx, c, optarg));
/*
+ * Skip comma that might be present between -z and its
+ * argument (e.g. if -Wl,-z,assert-deflib was passed).
+ */
+ if (strncmp(optarg, MSG_ORIG(MSG_STR_COMMA),
+ MSG_STR_COMMA_SIZE) == 0)
+ optarg++;
+
+ /*
* For specific help, print our usage message and exit
* immediately to ensure a 0 return code.
*/
diff --git a/usr/src/cmd/sgs/libld/common/libld.msg b/usr/src/cmd/sgs/libld/common/libld.msg
index 26c0e33054..45a90b0e82 100644
--- a/usr/src/cmd/sgs/libld/common/libld.msg
+++ b/usr/src/cmd/sgs/libld/common/libld.msg
@@ -25,6 +25,7 @@
#
# Copyright (c) 2012, Joyent, Inc. All rights reserved.
+# Copyright 2017 RackTop Systems.
#
@ _START_
@@ -730,6 +731,7 @@
@ MSG_QSTR_STAR "'*'"
@ MSG_STR_DOT "."
@ MSG_STR_SLASH "/"
+@ MSG_STR_COMMA ","
@ MSG_STR_DYNAMIC "(.dynamic)"
@ MSG_STR_ORIGIN "$ORIGIN"
@ MSG_STR_MACHINE "$MACHINE"
diff --git a/usr/src/cmd/sgs/packages/common/SUNWonld-README b/usr/src/cmd/sgs/packages/common/SUNWonld-README
index 0f3d5f67bd..b895773d15 100644
--- a/usr/src/cmd/sgs/packages/common/SUNWonld-README
+++ b/usr/src/cmd/sgs/packages/common/SUNWonld-README
@@ -1660,3 +1660,4 @@ Bugid Risk Synopsis
6252 ld should merge function/data-sections in the same manner as GNU ld
7323 ld(1) -zignore can erroneously discard init and fini arrays as unreferenced
7594 ld -zaslr should accept Solaris-compatible values
+8616 ld has trouble parsing -z options specified with -Wl