This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[patch ob] Disallow -pie and -static
- From: Cary Coutant <ccoutant at google dot com>
- To: Ian Lance Taylor <iant at google dot com>, Binutils <binutils at sourceware dot org>
- Date: Tue, 14 Feb 2012 16:48:43 -0800
- Subject: [patch ob] Disallow -pie and -static
I'm committing this patch under the trivial and obvious rule. If -pie
and -static are both given together, gold will currently issue an
internal error.
Tested on x86_64.
-cary
* options.cc (General_options::finalize): Disallow -pie and -static.
Index: options.cc
===================================================================
RCS file: /cvs/src/src/gold/options.cc,v
retrieving revision 1.117
diff -u -p -r1.117 options.cc
--- options.cc 3 Nov 2011 04:32:01 -0000 1.117
+++ options.cc 15 Feb 2012 00:40:25 -0000
@@ -1203,6 +1203,8 @@ General_options::finalize()
gold_fatal(_("-shared and -static are incompatible"));
if (this->shared() && this->pie())
gold_fatal(_("-shared and -pie are incompatible"));
+ if (this->pie() && this->is_static())
+ gold_fatal(_("-pie and -static are incompatible"));
if (this->shared() && this->relocatable())
gold_fatal(_("-shared and -r are incompatible"));