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: ld --help and relro


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.


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