Re: GNU_RELRO support broken on mips64e[bl] (Was: "security/sudo" gets SIGBUS on Lemote Yeeloong (LOONGSON))

Nick Hudson <[email protected]> Sun, 11 Sep 2016 09:55:08 +0100
Newsgroups gmane.os.netbsd.ports.evbmips,gmane.os.netbsd.ports.mips.devel
Message-ID <[email protected]>
On 09/11/16 03:42, Rin Okuyama wrote:

> I found that this failure occurs with binaries compiled with 
> -Wl,-z,relro:
>
>   $ cc hello.c && ./a.out
>   Hello, World!
>   $ cc -Wl,-z,relro hello.c && ./a.out
>   pid 2526(a.out): sig 11: cause=0x80000004
>   (snip)
>   pid 2526 (a.out), uid 501: exited on signal 11 (core dumped)
>   Memory fault
>   $
>
This is a problem due to the new page size of 8KB.

erlite# cc -Wl,-z,relro  -Wl,-z,common-page-size=0x2000 hello.c && ./a.out
hello
erlite#


Still thinking how to best fix this...

Nick