Support PIE on Solaris 12

Rainer Orth ro@CeBiTec.Uni-Bielefeld.DE
Wed Sep 2 09:06:00 GMT 2015


"H.J. Lu" <hjl.tools@gmail.com> writes:

> On Tue, Sep 1, 2015 at 5:02 AM, Rainer Orth <ro@cebitec.uni-bielefeld.de> wrote:
>> "H.J. Lu" <hjl.tools@gmail.com> writes:
>>
>>> @@ -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?
>>
>> I had it to mark the gap in the flags.  Solaris 11 (and 12) has
>>
>> #define DF_1_STUB       0x04000000      /* stub object */
>
> We should add DF_1_STUB.
>
>> between the two.  It's documented in the Linkers and Libraries Guide:
>>
>> http://docs.oracle.com/cd/E36784_01/html/E36857/chapter6-42444.html

Fine with me.  Patch updated to define DF_1_STUB and print it in
readelf.  Supporting creation of stub objects for real is beyond the
scope of the current patch, I believe.

	Rainer


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.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: sol12-pie.patch
Type: text/x-patch
Size: 2874 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20150902/f50a48a4/attachment.bin>
-------------- next part --------------

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University


More information about the Binutils mailing list