Support PIE on Solaris 12
H.J. Lu
hjl.tools@gmail.com
Tue Sep 1 11:51:00 GMT 2015
On Tue, Aug 25, 2015 at 4:52 AM, Rainer Orth
<ro@cebitec.uni-bielefeld.de> wrote:
> As mentioned in
>
> https://gcc.gnu.org/ml/gcc-patches/2015-08/msg01389.html
>
> Solaris 12 will gain support for Position Independent Executables
> (PIE). The following patch implements the changes to ld (and a minor
> readelf addition) to handle this. Effectively it's only setting the new
> DF_1_PIE flag.
>
> The patch was tested with an early version of the new PIC CRTs, the PIE
> patch from the message above, and mainline gcc configured both without
> and with --enable-default-pie.
>
> Ok for mainline?
>
> Rainer
>
> --
> -----------------------------------------------------------------------------
> Rainer Orth, Center for Biotechnology, Bielefeld University
>
>
> 2015-08-25 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
>
> ld:
> * emulparams/solaris2.sh (GENERATE_PIE_SCRIPT): Set to yes.
>
> * emultempl/elf32.em (ld_${EMULATION_NAME}_emulation): Allow
> overriding gld${EMULATION_NAME}_handle_option.
> * emultempl/solaris2.em: Include ldlex.h.
> (gld${EMULATION_NAME}_handle_option): Declare.
> (elf_solaris2_handle_option): New function.
> (LDEMUL_HANDLE_OPTION): Uset it.
>
> include/elf:
> * common.h (DF_1_PIE): Define.
>
> binutils:
> * readelf.c (process_dynamic_section): Handle DF_1_PIE.
>
@@ -868,6 +868,8 @@
#define DF_1_GLOBAUDIT 0x01000000
#define DF_1_SINGLETON 0x02000000
+#define DF_1_PIE 0x08000000
You don't need a blank line before DF_1_PIE. Should we always set
DF_1_PIE for PIE?
--
H.J.
More information about the Binutils
mailing list