[MIPS] Check info->executable to create DT_MIPS_RLD_MAP

David Daney ddaney.cavm@gmail.com
Sat Jun 22 00:17:00 GMT 2013


On 06/21/2013 05:00 PM, Chao-Ying Fu wrote:
> Hi All,
>
>    When using "-pie", LD doesn't create the DT_MIPS_RLD_MAP entry,
> because LD checks "!info->shared" and the "-pie" flag sets "info->shared" to true.
> Note that LD checks "info->executable" to create DT_DEBUG, and
> creating DT_MIPS_RLD_MAP should be similar to creating DT_DEBUG.
> Ex:
>        /* SGI object has the equivalence of DT_DEBUG in the
>           DT_MIPS_RLD_MAP entry.  This must come first because glibc
>           only fills in DT_MIPS_RLD_MAP (not DT_DEBUG) and some tools
>           may only look at the first one they see.  */
>        if (!info->shared
>            && !MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_RLD_MAP, 0))
>          return FALSE;
>

Probably you want info->executable here too.

I have tried simple programs with -pie and they seem to work as is. 
What failures are you seeing?  Does the libgcc unwinder use this?

In any event, you could test changing this.

David Daney



>        /* The DT_DEBUG entry may be filled in by the dynamic linker and
>           used by the debugger.  */
>        if (info->executable
>            && !SGI_COMPAT (output_bfd)
>            && !MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_DEBUG, 0))
>          return FALSE;
>
>    Any feedback about checking "info->executable" to create DT_MIPS_RLD_MAP and related stuffs?
> Thanks a lot!
>
> Regards,
> Chao-ying
> 	
>
> 	
>
>



More information about the Binutils mailing list