diff options
author | Alexandre Oliva <oliva@adacore.com> | 2023-12-19 21:06:17 -0300 |
---|---|---|
committer | Alexandre Oliva <oliva@gnu.org> | 2023-12-19 21:06:17 -0300 |
commit | 66c8b0f695ffaf1b727dc024618b80256317ae33 (patch) | |
tree | 1c71d9e78c718106bd7fe73fd7f0d1fb556e2652 /gcc/gcc.cc | |
parent | 40337cae12051336626d39500485cfc488c9c26e (diff) | |
download | gcc-66c8b0f695ffaf1b727dc024618b80256317ae33.zip gcc-66c8b0f695ffaf1b727dc024618b80256317ae33.tar.gz gcc-66c8b0f695ffaf1b727dc024618b80256317ae33.tar.bz2 |
hardened: use LD_PIE_SPEC only if defined
sol2.h may define LINK_PIE_SPEC and leave LD_PIE_SPEC undefined, but
gcc.cc will only provide a LD_PIE_SPEC definition if LINK_PIE_SPEC is
not defined, and thenit uses LD_PIE_SPEC guarded by #ifdef HAVE_LD_PIE
only. Add LD_PIE_SPEC to the guard.
gcc/ChangeLog
* gcc.cc (process_command): Use LD_PIE_SPEC only if defined.
Diffstat (limited to 'gcc/gcc.cc')
-rw-r--r-- | gcc/gcc.cc | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -5008,7 +5008,7 @@ process_command (unsigned int decoded_options_count, { if (!any_link_options_p && !static_p) { -#ifdef HAVE_LD_PIE +#if defined HAVE_LD_PIE && defined LD_PIE_SPEC save_switch (LD_PIE_SPEC, 0, NULL, /*validated=*/true, /*known=*/false); #endif /* These are passed straight down to collect2 so we have to break |