This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Support PIE on Solaris 12
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Rainer Orth <ro at cebitec dot uni-bielefeld dot de>
- Cc: Alan Modra <amodra at gmail dot com>, Binutils <binutils at sourceware dot org>
- Date: Tue, 22 Sep 2015 11:18:35 -0700
- Subject: Re: Support PIE on Solaris 12
- Authentication-results: sourceware.org; auth=none
- References: <yddd1yb7fgm dot fsf at lokon dot CeBiTec dot Uni-Bielefeld dot DE> <CAMe9rOr8Y059NZ2D2uP2TLwyipzBrWDrNRtTDP7eqnYZKQdi7A at mail dot gmail dot com> <ydd1teijqjb dot fsf at lokon dot CeBiTec dot Uni-Bielefeld dot DE> <CAMe9rOrHK7vmy43j4+eoFjB4e_N89f_3oZXGTTAdGoLTOomTgA at mail dot gmail dot com> <ydd4mjdgpho dot fsf at lokon dot CeBiTec dot Uni-Bielefeld dot DE> <20150902125127 dot GV24814 at bubble dot grove dot modra dot org> <yddtwr2cxk0 dot fsf at lokon dot CeBiTec dot Uni-Bielefeld dot DE> <CAMe9rOrbYEoJS693SciwZsgk3SGbSnPSb-CowD+MeO2Dq-uh3A at mail dot gmail dot com> <yddvbb36g26 dot fsf at lokon dot CeBiTec dot Uni-Bielefeld dot DE> <CAMe9rOpK-rbNQRnvar-QT-PE5OQmFF+G_ymRTr0aSbNO89wx9Q at mail dot gmail dot com> <yddmvwe6bsx dot fsf at lokon dot CeBiTec dot Uni-Bielefeld dot DE> <CAMe9rOpUXOmvZKjLRoWCX+Cq_WRpD26jfLwf+sHqz2mW2rfdsA at mail dot gmail dot com> <ydd1tdqtx16 dot fsf at lokon dot CeBiTec dot Uni-Bielefeld dot DE>
On Tue, Sep 22, 2015 at 6:15 AM, Rainer Orth
<ro@cebitec.uni-bielefeld.de> wrote:
> "H.J. Lu" <hjl.tools@gmail.com> writes:
>
>>> 2015-09-03 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
>>>
>>> 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.
>>>
>>> include/elf:
>>> * common.h (DF_1_STUB, DF_1_PIE): Define.
>>>
>>> binutils:
>>> * readelf.c (process_dynamic_section): Handle DF_1_STUB, DF_1_PIE.
>>>
>>
>> It breaks the linker. I checked in this patch to fix it.
>
> Sorry about that. I'm pretty sure I tried it on both Solaris and
> Linux/x86_64.
>
I checked in this patch to update MIPS tests.
--
H.J.
---
>From 0a6b6047cfd01e229234b747c7694e545b9aefb3 Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Tue, 22 Sep 2015 11:12:01 -0700
Subject: [PATCH] Update MIPS PIE tests for DF_1_PIE change
Since linker now sets the DF_1_PIE bit in the DT_FLAGS_1 tag for PIE,
we need to update MIPS PIE tests for it.
* ld-mips-elf/pie-n32.d: Updated.
* ld-mips-elf/pie-n64.d: Likewise.
* ld-mips-elf/pie-o32.d: Likewise.
---
ld/testsuite/ChangeLog | 6 ++++++
ld/testsuite/ld-mips-elf/pie-n32.d | 13 +++++++------
ld/testsuite/ld-mips-elf/pie-n64.d | 13 +++++++------
ld/testsuite/ld-mips-elf/pie-o32.d | 9 +++++----
4 files changed, 25 insertions(+), 16 deletions(-)
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index 78de2b2..8a1eef2 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,5 +1,11 @@
2015-09-22 H.J. Lu <hongjiu.lu@intel.com>
+ * ld-mips-elf/pie-n32.d: Updated.
+ * ld-mips-elf/pie-n64.d: Likewise.
+ * ld-mips-elf/pie-o32.d: Likewise.
+
+2015-09-22 H.J. Lu <hongjiu.lu@intel.com>
+
* ld-elf/pie.d: New test.
2015-09-18 Alan Modra <amodra@gmail.com>
diff --git a/ld/testsuite/ld-mips-elf/pie-n32.d
b/ld/testsuite/ld-mips-elf/pie-n32.d
index bcfbcd2..dec984d 100644
--- a/ld/testsuite/ld-mips-elf/pie-n32.d
+++ b/ld/testsuite/ld-mips-elf/pie-n32.d
@@ -3,16 +3,16 @@
#ld: -melf32btsmipn32 -pie
#readelf: -d
-Dynamic section at offset 0x180 contains 16 entries:
+Dynamic section at offset 0x180 contains 17 entries:
Tag * Type * Name/Value
- 0x00000004 \(HASH\) * 0x228
- 0x00000005 \(STRTAB\) * 0x304
- 0x00000006 \(SYMTAB\) * 0x264
+ 0x00000004 \(HASH\) * 0x230
+ 0x00000005 \(STRTAB\) * 0x30c
+ 0x00000006 \(SYMTAB\) * 0x26c
0x0000000a \(STRSZ\) * 72 \(bytes\)
0x0000000b \(SYMENT\) * 16 \(bytes\)
- 0x70000035 \(MIPS_RLD_MAP_REL\) * 0x101b8
+ 0x70000035 \(MIPS_RLD_MAP_REL\) * 0x101c8
0x00000015 \(DEBUG\) * 0x0
- 0x00000003 \(PLTGOT\) * 0x10370
+ 0x00000003 \(PLTGOT\) * 0x10380
0x70000001 \(MIPS_RLD_VERSION\) * 1
0x70000005 \(MIPS_FLAGS\) * NOTPOT
0x70000006 \(MIPS_BASE_ADDRESS\) * 0x0
@@ -20,4 +20,5 @@ Dynamic section at offset 0x180 contains 16 entries:
0x70000011 \(MIPS_SYMTABNO\) * 10
0x70000012 \(MIPS_UNREFEXTNO\) * 13
0x70000013 \(MIPS_GOTSYM\) * 0xa
+ 0x6ffffffb \(FLAGS_1\) * Flags: PIE
0x00000000 \(NULL\) * 0x0
diff --git a/ld/testsuite/ld-mips-elf/pie-n64.d
b/ld/testsuite/ld-mips-elf/pie-n64.d
index bf2238c..75a78e3 100644
--- a/ld/testsuite/ld-mips-elf/pie-n64.d
+++ b/ld/testsuite/ld-mips-elf/pie-n64.d
@@ -3,16 +3,16 @@
#ld: -melf64btsmip -pie
#readelf: -d
-Dynamic section at offset 0x208 contains 16 entries:
+Dynamic section at offset 0x208 contains 17 entries:
Tag * Type * Name/Value
- 0x0+00000004 \(HASH\) * 0x358
- 0x0+00000005 \(STRTAB\) * 0x488
- 0x0+00000006 \(SYMTAB\) * 0x398
+ 0x0+00000004 \(HASH\) * 0x368
+ 0x0+00000005 \(STRTAB\) * 0x498
+ 0x0+00000006 \(SYMTAB\) * 0x3a8
0x0+0000000a \(STRSZ\) * 72 \(bytes\)
0x0+0000000b \(SYMENT\) * 24 \(bytes\)
- 0x0+70000035 \(MIPS_RLD_MAP_REL\) * 0x102a8
+ 0x0+70000035 \(MIPS_RLD_MAP_REL\) * 0x102b8
0x0+00000015 \(DEBUG\) * 0x0
- 0x0+00000003 \(PLTGOT\) * 0x10510
+ 0x0+00000003 \(PLTGOT\) * 0x10520
0x0+70000001 \(MIPS_RLD_VERSION\) * 1
0x0+70000005 \(MIPS_FLAGS\) * NOTPOT
0x0+70000006 \(MIPS_BASE_ADDRESS\) * 0x0
@@ -20,4 +20,5 @@ Dynamic section at offset 0x208 contains 16 entries:
0x0+70000011 \(MIPS_SYMTABNO\) * 10
0x0+70000012 \(MIPS_UNREFEXTNO\) * 13
0x0+70000013 \(MIPS_GOTSYM\) * 0xa
+ 0x0+6ffffffb \(FLAGS_1\) * Flags: PIE
0x0+00000000 \(NULL\) * 0x0
diff --git a/ld/testsuite/ld-mips-elf/pie-o32.d
b/ld/testsuite/ld-mips-elf/pie-o32.d
index 5a9a308..4db3d2c 100644
--- a/ld/testsuite/ld-mips-elf/pie-o32.d
+++ b/ld/testsuite/ld-mips-elf/pie-o32.d
@@ -3,11 +3,11 @@
#ld: -melf32btsmip -pie
#readelf: -d
-Dynamic section at offset 0x178 contains 16 entries:
+Dynamic section at offset 0x178 contains 17 entries:
Tag * Type * Name/Value
- 0x00000004 \(HASH\) * 0x220
- 0x00000005 \(STRTAB\) * 0x2fc
- 0x00000006 \(SYMTAB\) * 0x25c
+ 0x00000004 \(HASH\) * 0x228
+ 0x00000005 \(STRTAB\) * 0x304
+ 0x00000006 \(SYMTAB\) * 0x264
0x0000000a \(STRSZ\) * 72 \(bytes\)
0x0000000b \(SYMENT\) * 16 \(bytes\)
0x70000035 \(MIPS_RLD_MAP_REL\) * 0x101c0
@@ -20,4 +20,5 @@ Dynamic section at offset 0x178 contains 16 entries:
0x70000011 \(MIPS_SYMTABNO\) * 10
0x70000012 \(MIPS_UNREFEXTNO\) * 13
0x70000013 \(MIPS_GOTSYM\) * 0xa
+ 0x6ffffffb \(FLAGS_1\) * Flags: PIE
0x00000000 \(NULL\) * 0x0
--