# HG changeset patch # Parent a5cee57d6f429ca6dc2f929bc07a9ea8e6686d71 # Parent a5cee57d6f429ca6dc2f929bc07a9ea8e6686d71 Solaris 12+ PIE support diff --git a/binutils/readelf.c b/binutils/readelf.c --- a/binutils/readelf.c +++ b/binutils/readelf.c @@ -9234,6 +9234,16 @@ process_dynamic_section (FILE * file) printf (" SINGLETON"); val ^= DF_1_SINGLETON; } + if (val & DF_1_STUB) + { + printf (" STUB"); + val ^= DF_1_STUB; + } + if (val & DF_1_PIE) + { + printf (" PIE"); + val ^= DF_1_PIE; + } if (val != 0) printf (" %lx", val); puts (""); diff --git a/include/elf/common.h b/include/elf/common.h --- a/include/elf/common.h +++ b/include/elf/common.h @@ -867,6 +867,8 @@ #define DF_1_SYMINTPOSE 0x00800000 #define DF_1_GLOBAUDIT 0x01000000 #define DF_1_SINGLETON 0x02000000 +#define DF_1_STUB 0x04000000 +#define DF_1_PIE 0x08000000 /* Flag values for the DT_FLAGS entry. */ #define DF_ORIGIN (1 << 0) diff --git a/ld/emulparams/solaris2.sh b/ld/emulparams/solaris2.sh --- a/ld/emulparams/solaris2.sh +++ b/ld/emulparams/solaris2.sh @@ -8,3 +8,5 @@ # File, p.63. TEXT_START_SYMBOLS='_START_ = .;' OTHER_END_SYMBOLS='_END_ = .;' +# Beginning with Solaris 12, there's PIE support. +GENERATE_PIE_SCRIPT=yes diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em --- a/ld/emultempl/elf32.em +++ b/ld/emultempl/elf32.em @@ -2463,7 +2463,7 @@ struct ld_emulation_xfer_struct ld_${EMU ${LDEMUL_SET_SYMBOLS-NULL}, ${LDEMUL_PARSE_ARGS-NULL}, gld${EMULATION_NAME}_add_options, - gld${EMULATION_NAME}_handle_option, + ${LDEMUL_HANDLE_OPTION-gld${EMULATION_NAME}_handle_option}, ${LDEMUL_UNRECOGNIZED_FILE-NULL}, ${LDEMUL_LIST_OPTIONS-${gld_list_options}}, ${LDEMUL_RECOGNIZED_FILE-gld${EMULATION_NAME}_load_symbols}, diff --git a/ld/emultempl/solaris2.em b/ld/emultempl/solaris2.em --- a/ld/emultempl/solaris2.em +++ b/ld/emultempl/solaris2.em @@ -29,6 +29,10 @@ fragment <