summaryrefslogtreecommitdiff
path: root/ld/emultempl
diff options
context:
space:
mode:
authorRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>2015-09-22 11:12:51 +0200
committerRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>2015-09-22 11:12:51 +0200
commit5c383f026242d25a3c21fdfda42e5ca218b346c8 (patch)
treed854510497f70338583a6b6c6ca22abb91d9279b /ld/emultempl
parent6dca4fd141fd0b9fe0ea662295833b8ed43cb4e8 (diff)
downloadbinutils-gdb-5c383f026242d25a3c21fdfda42e5ca218b346c8.tar.gz
Solaris PIE support
include/elf: * common.h (DF_1_STUB, DF_1_PIE): Define. ld: * emulparams/solaris2.sh (GENERATE_PIE_SCRIPT): Set to yes. * emultempl/elf32.em: Include ldlex.h. (gld${EMULATION_NAME}_handle_option) [GENERATE_PIE_SCRIPT] <OPTION_PIE>: Set DF_1_PIE. binutils: * readelf.c (process_dynamic_section): Handle DF_1_STUB, DF_1_PIE.
Diffstat (limited to 'ld/emultempl')
-rw-r--r--ld/emultempl/elf32.em8
1 files changed, 8 insertions, 0 deletions
diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em
index 7fe90894e8f..5fe576ea480 100644
--- a/ld/emultempl/elf32.em
+++ b/ld/emultempl/elf32.em
@@ -49,6 +49,7 @@ fragment <<EOF
#include "ldmain.h"
#include "ldmisc.h"
#include "ldexp.h"
+#include "ldlex.h"
#include "ldlang.h"
#include "ldfile.h"
#include "ldemul.h"
@@ -2289,6 +2290,13 @@ fragment <<EOF
EOF
fi
+if test x"$GENERATE_PIE_SCRIPT" = xyes; then
+fragment <<EOF
+ case OPTION_PIE:
+ link_info.flags_1 |= (bfd_vma) DF_1_PIE;
+ break;
+EOF
+fi
fragment <<EOF
case 'z':
if (strcmp (optarg, "defs") == 0)