build kernel for arm64 - linker ld ignored -z relro

Milan Buška milan.buska@gmail.com
Sun Sep 13 14:37:28 GMT 2020
ne 13. 9. 2020 v 8:05 odesílatel Alan Modra <amodra@gmail.com> napsal:
>
> On Sat, Sep 12, 2020 at 06:35:58PM +0200, Milan Buška wrote:
> > so 12. 9. 2020 v 8:30 odesílatel Alan Modra <amodra@gmail.com> napsal:
> > >
> > > On Sun, Sep 06, 2020 at 04:45:52PM +0000, Milan Buška via Binutils wrote:
> > > > Hello.
> > > > I'm compiling the kernel v.5.8.7 on arm64.
> > > > This is a compilation in a native environment.
> > > > Toolchain:
> > > > glibc v. 2.32
> > > > binutils v. 2.35
> > > > gcc v. 10.2.0
> > > >
> > > > This is the last part of the output after make Image.
> > > [snip]
> > > >   LD .tmp_vmlinux.kallsyms1
> > > > ld: warning: -z norelro ignored
> > >
> > > I suspect you are not configuring binutils correctly for
> > > aarch64-linux.  A target of aarch64-elf for example won't give you a
> > > toolchain supporting relro.
> > >
> >
> > I compiled binutils according to this configuration
> >
> >     --prefix=/usr \
> >     --build=aarch64-unknown-linux-gnu \
> >     --host=aarch64-unknown-linux-gnu \
> >     --with-lib-path=/usr/lib:/usr/local/lib \
> >     --with-bugurl=https://github.com/archlinuxarm/PKGBUILDs/issues \
> >     --enable-deterministic-archives \
> >     --enable-gold \
> >     --enable-ld=default \
> >     --enable-lto \
> >     --enable-plugins \
> >     --enable-relro \
> >     --enable-shared \
> >     --enable-threads \
> >     --disable-gdb \
> >     --disable-werror \
> >     --with-debuginfod \
> >     --with-pic \
> >     --with-system-zlib \
> >     --disable-sim
> >
> > Best regards
> >
> > Milan Buska
>
> Hmm, I don't see anything much wrong with that, and it looks like
> archlinux doesn't make any patches to binutils that might cause the
> problem you're seeing.  I suggested it might be an aarch64-elf config
> because the only reasons to see "-z norelro ignored" are
> GENERATE_SHLIB_SCRIPT not being "yes" or COMMONPAGESIZE not being
> set.  The latter happens with an aarch64-elf toolchain.  See the
> relevant ld/emulparams/ files and ld/emultempl/elf.em.
>
> --
> Alan Modra
> Australia Development Lab, IBM

Result build kernel 5.8.7

Toolchain aarch64:
glibc v. 2.32
binutils v. 2.35
gcc v. 10.2.0
kernel v. 5.8.7
gmp v. 6.2.0
mpfr v. 4.1.0
mpc v. 1.2.0

- toolchain use binutils-2.35 gives the message ignore -z norelro

Toolchain aarch64:
glibc v. 2.32
binutils v. 2.34
gcc v. 10.2.0
kernel v. 5.8.7
gmp v. 6.2.0
mpfr v. 4.1.0
mpc v. 1.2.0

- toolchain use binutils v. 2.34  works well

Best regards

-- 

Remember, no question is too stupid and no problem too small
       -- We've all been beginners


More information about the Binutils mailing list