diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2013-02-05 14:31:33 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2013-02-05 14:31:33 +0000 |
commit | eafbfecfba57718a24c0bd9814e1166fe97dbd14 (patch) | |
tree | dcb7c4c9fd8d9fc98eb83554696ee251e8750cf3 /gnu/usr.bin | |
parent | 9ab126405989913e3609ef0eb5688bcf593c6fbc (diff) |
Disable PIE-by-default if -static (or one of its aliases) is passed on the
command line. While technically -static only controls whether we link against
static libraries, people expect that doing so produces a fully static binary.
tested by sthen@
ok pascal@, miod@
Diffstat (limited to 'gnu/usr.bin')
-rw-r--r-- | gnu/usr.bin/binutils-2.17/ld/lexsup.c | 2 | ||||
-rw-r--r-- | gnu/usr.bin/binutils/ld/lexsup.c | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/gnu/usr.bin/binutils-2.17/ld/lexsup.c b/gnu/usr.bin/binutils-2.17/ld/lexsup.c index 654edb52f27..6df8c2110f8 100644 --- a/gnu/usr.bin/binutils-2.17/ld/lexsup.c +++ b/gnu/usr.bin/binutils-2.17/ld/lexsup.c @@ -722,6 +722,8 @@ parse_args (unsigned argc, char **argv) break; case OPTION_NON_SHARED: config.dynamic_link = FALSE; + if (! link_info.shared) + link_info.pie = FALSE; break; case OPTION_CREF: command_line.cref = TRUE; diff --git a/gnu/usr.bin/binutils/ld/lexsup.c b/gnu/usr.bin/binutils/ld/lexsup.c index dbcb19880cf..68384f4330f 100644 --- a/gnu/usr.bin/binutils/ld/lexsup.c +++ b/gnu/usr.bin/binutils/ld/lexsup.c @@ -649,6 +649,8 @@ parse_args (unsigned argc, char **argv) break; case OPTION_NON_SHARED: config.dynamic_link = FALSE; + if (! link_info.shared) + link_info.pie = FALSE; break; case OPTION_CREF: command_line.cref = TRUE; |