using -z relo for arm-none-eabi

Norbert Lange nolange79@gmail.com
Tue Apr 6 13:46:24 GMT 2021


Am Di., 6. Apr. 2021 um 15:20 Uhr schrieb Nick Clifton <nickc@redhat.com>:
>
> Hi Norbert,
>
> > Is there a way to activate this? AFAIU, relro is purely some modified
> > layout so that should not be a problem, atlease if I feed the linker
> > commonpagesize and maxpagesize?
>
> You would have to define these values in the emulation parameters file
> and then rebuild the linker,  but I think that in theory it should work.
> This patch might do the trick, although I have not actually tested it
> myself:
>
> diff --git a/ld/emulparams/armelf.sh b/ld/emulparams/armelf.sh
> index 1995c449975..5eba388fd81 100644
> --- a/ld/emulparams/armelf.sh
> +++ b/ld/emulparams/armelf.sh
> @@ -41,3 +41,6 @@ NO_SMALL_DATA=yes
>   # ARM supports the .noinit and .persistent sections.
>   HAVE_NOINIT=yes
>   HAVE_PERSISTENT=yes
> +
> +MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
> +COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)"

MAXPAGESIZE is already set at line 31.

I guess if I do that, then the drawback would be some holes caused by
grouping and alignment?
Are there defaults for COMMONPAGESIZE and MAXPAGESIZE defined anywhere (else)?

Id hope the solution can be added upstream, if for example those default to 1,
then there should be little to no adverse effects.

Thanks, Norbert


More information about the Binutils mailing list