This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: ld --help and relro
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Dilyan Palauzov <dilyan dot palauzov at aegee dot org>, Binutils <binutils at sourceware dot org>
- Date: Thu, 23 Jun 2016 12:39:23 -0700
- Subject: Re: ld --help and relro
- Authentication-results: sourceware.org; auth=none
- References: <49a86f41-1ec2-15ac-360a-c0cfa7621908 at aegee dot org>
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.