PATCH: Increase the size of .data.rel section for -z relro check
H.J. Lu
hjl.tools@gmail.com
Tue Jul 12 15:48:00 GMT 2011
On Mon, Jul 11, 2011 at 4:14 PM, Roland McGrath <roland@hack.frob.com> wrote:
>> "z relro" check is very sentive to the size of .data.rel section.
>> This patch increases the size of .data.rel section to make it more
>> reliable. It is needed for x32 port, which I will submit later.
>
> Please elaborate on what goes wrong with the test.
>
>> -const void *relro[] = { &_start, &_exit, 0 };
>> +const void *relro[] = { &_start, &_exit, 0, 0 };
>
> I just noticed that this should be:
>
> const void *const relro[] = { &_start, &_exit, 0 };
>
> so that it really goes into .rodata modulo relocation, which is what I was
> intending to test. As I had it, this is just in writable data anyway, so
> it's not telling us anything about RELRO support.
I tried it and it failed for -m32, -m64 and -mx32 with GCC 4.7.0.
> I'll commit this later tonight when I'm where it's convenient to do it.
>
> If the test still fails in your configuration with this fix, please
> elaborate on why what's so and what the size of the section has to do with
> it.
>
I will let you know when I figure out why it happens.
--
H.J.
More information about the Libc-alpha
mailing list