using -z relro for arm-none-eabi

Norbert Lange nolange79@gmail.com
Wed Apr 7 12:51:37 GMT 2021


Am Mi., 7. Apr. 2021 um 14:22 Uhr schrieb Alan Modra <amodra@gmail.com>:
>
> On Wed, Apr 07, 2021 at 11:34:44AM +0100, Nick Clifton via Binutils wrote:
> > > Id hope the solution can be added upstream, if for example those default to 1,
> > > then there should be little to no adverse effects.
> >
> > I have to say that I am very reluctant to make a change like this as it is almost
> > bound to break some user's projects.
>
> Probably the easiest option for anyone wanting -z relro on arm is just
> to use an arm-unknown-linux-gnueabi configured toolchain rather than
> arm-unknown-eabi.

True, lots of ways around that. I dont understand the reasoning tho,
seems really inconsistent.

Look at whats defined for armelf.sh:

GENERATE_SHLIB_SCRIPT=yes
GENERATE_PIE_SCRIPT=yes
MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"

If I assume that arm-none-eabi should know nothing about ldso stuff
(relocations etc), then those are suspect.
Anyone using a custom loader would have to specialize binutils (or use
arm-unknown-linux-gnueabi) and provide those.

Yet the one thing missing is COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)",
which is even weirder to me, given that MAXPAGESIZE is defined.

Would it be possible to allow '-z relro' but then later fail if
necessary definitions are missing in the linkerscript?

Norbert


More information about the Binutils mailing list