Support PIE on Solaris 12
Rainer Orth
ro@CeBiTec.Uni-Bielefeld.DE
Tue Sep 22 09:30:00 GMT 2015
"H.J. Lu" <hjl.tools@gmail.com> writes:
> On Mon, Sep 21, 2015 at 6:46 AM, Rainer Orth
> <ro@cebitec.uni-bielefeld.de> wrote:
>> "H.J. Lu" <hjl.tools@gmail.com> writes:
>>
>>> On Thu, Sep 10, 2015 at 4:40 AM, Rainer Orth
>>> <ro@cebitec.uni-bielefeld.de> wrote:
>>>> Alan Modra <amodra@gmail.com> writes:
>>>>
>>>>> On Wed, Sep 02, 2015 at 11:05:55AM +0200, Rainer Orth wrote:
>>>>>> 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_STUB, DF_1_PIE): Define.
>>>>>>
>>>>>> binutils:
>>>>>> * readelf.c (process_dynamic_section): Handle DF_1_STUB, DF_1_PIE.
>>>>>
>>>>> OK.
>>>>
>>>> How should we proceed with this patch? Keep setting DF_1_PIE
>>>> Solaris-specific as in the version above you've already approved or set
>>>> it everywhere as HJ suggested, using the ld part from
>>>>
>>>> https://sourceware.org/ml/binutils/2015-09/msg00035.html
>>>>
>>>> instead.
>>>
>>> We have set bits in DT_FLAGS_1 which ld supports. I don't see
>>> DF_1_PIE is special.
>>
>> It's been more than a week since this mail: can I have either approval
>> or rejection for generically setting DF_1_PIE so I can install either
>> version of the patch?
>>
>
> Please just set DF_1_PIE unconditionally for PIE.
Here's what I've installed.
Thanks.
Rainer
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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sol12-pie.patch
Type: text/x-patch
Size: 1901 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20150922/0372e9ec/attachment.bin>
-------------- next part --------------
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University
More information about the Binutils
mailing list