This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] elf: Apply attribute_relro to pointers in elf/dl-minimal.c
- From: Florian Weimer <fw at deneb dot enyo dot de>
- To: Joseph Myers <joseph at codesourcery dot com>
- Cc: Florian Weimer <fweimer at redhat dot com>, <libc-alpha at sourceware dot org>, <mjw at fedoraproject dot org>, Patsy Griffin <patsy at redhat dot com>
- Date: Sun, 01 Mar 2020 10:33:10 +0100
- Subject: Re: [PATCH] elf: Apply attribute_relro to pointers in elf/dl-minimal.c
- References: <87tv3d2x91.fsf@oldenburg2.str.redhat.com> <alpine.DEB.2.21.2002262121020.25531@digraph.polyomino.org.uk> <87a75558n0.fsf@mid.deneb.enyo.de>
* Florian Weimer:
> I don't know much about alpha unfortunately. Running this
>
> $ objdump -d --reloc /lib/ld-linux.so.2 | grep -E 'lda\s.*gp,'
>
> on a default build (not mainline, so successful) gives me what I
> assume are GP-relative load instructions ranging from
>
> 9ff4: 40 80 bd 23 lda gp,-32704(gp)
>
> to
>
> a040: f4 7f bd 23 lda gp,32756(gp)
>
> That seems to be rather close to the 64 KiB displacement that alpha
> apparently supports.
The above isn't correct. These instructions are half of the gp
register setup. There are more bits available in a different
instruction.
I still beleive this is a current toolchain limitation. I tried
linking with -Wl,--no-relax and also skipping the librtld.os stage,
but this didn't fix this. I think we have no choice but to drop -fpic
at this point and use -fPIC.