ld --help and relro
H.J. Lu
hjl.tools@gmail.com
Thu Jun 23 19:39:00 GMT 2016
On Thu, Jun 23, 2016 at 9:48 AM, Dilyan Palauzov
<dilyan.palauzov@aegee.org> wrote:
> Hello,
>
> please consider adding incorporating the following code, so that ld --help
> shows if relro is by default on or off.
>
> Greetings
> Dilian
>
> diff --git a/ld/lexsup.c b/ld/lexsup.c
> index 6e0f932..335afb1 100644
> --- a/ld/lexsup.c
> +++ b/ld/lexsup.c
> @@ -1754,10 +1754,17 @@ elf_shlib_list_options (FILE *file)
> fprintf (file, _("\
> -z origin Mark object requiring immediate $ORIGIN\n\
> processing at runtime\n"));
> +#ifdef DEFAULT_LD_Z_RELRO
> + fprintf (file, _("\
> + -z relro Create RELRO program header (default)\n"));
> + fprintf (file, _("\
> + -z norelro Don't create RELRO program header\n"));
> +#else
> fprintf (file, _("\
> -z relro Create RELRO program header\n"));
> fprintf (file, _("\
> - -z norelro Don't create RELRO program header\n"));
> + -z norelro Don't create RELRO program header
> (default)\n"));
> +#endif
> fprintf (file, _("\
> -z common Generate common symbols with STT_COMMON
> type\n"));
> fprintf (file, _("\
Sounds a good idea. We have
-z lazy Mark object lazy runtime binding (default)
Any comments?
--
H.J.
More information about the Binutils
mailing list