This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [gold][patch] Plugin API and PIE binaries


This is OK if it's OK with Cary.

Thanks.

Ian


Rafael EspÃndola <rafael.espindola@gmail.com> writes:

> I don't think there is any support for PIE in the current plugin api.
> Gold currently only passes the plugin LDPO_EXEC, which causes problem
> when the plugin then gives gold an object with invalid relocations.
>
> The attached patches add a LDPO_PIE. I don't think this is a backward
> compatibility problem, since any plugin producing code for a PIE
> thinking it is a regular executable is already broken.
>
> Cheers,
> Rafael
>
> gold patch:
>
> 2012-06-12  Rafael Ãvila de EspÃndola <respindola@mozilla.com>
>
>         * plugin.cc (Plugin::load): Handle position independent executables.
>
> include patch:
>
> 2012-06-12  Rafael Ãvila de EspÃndola <respindola@mozilla.com>
>
>         *  plugin-api.h (ld_plugin_output_file_type): Add LDPO_PIE.
>
> diff --git a/gold/plugin.cc b/gold/plugin.cc
> index 63d0974..5aadc55 100644
> --- a/gold/plugin.cc
> +++ b/gold/plugin.cc
> @@ -184,6 +184,8 @@ Plugin::load()
>      tv[i].tv_u.tv_val = LDPO_REL;
>    else if (parameters->options().shared())
>      tv[i].tv_u.tv_val = LDPO_DYN;
> +  else if (parameters->options().pie())
> +    tv[i].tv_u.tv_val = LDPO_PIE;
>    else
>      tv[i].tv_u.tv_val = LDPO_EXEC;
>  
>
> diff --git a/include/plugin-api.h b/include/plugin-api.h
> index 122424c..3220142 100644
> --- a/include/plugin-api.h
> +++ b/include/plugin-api.h
> @@ -66,7 +66,8 @@ enum ld_plugin_output_file_type
>  {
>    LDPO_REL,
>    LDPO_EXEC,
> -  LDPO_DYN
> +  LDPO_DYN,
> +  LDPO_PIE
>  };
>  
>  /* An input file managed by the plugin library.  */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]