[PATCH v2 06/12] elf: Enable relro for static build

Florian Weimer fweimer@redhat.com
Fri Dec 13 12:08:00 GMT 2019


* Adhemerval Zanella:

> +static volatile int val __attribute__ ((section (".data.rel.ro")));

I would prefer something that needs an actual run-time relocation
because I doubt that all targets use .data.rel.ro.

> +int do_test (void)
> +{
> +  struct support_capture_subprocess result
> +    = support_capture_subprocess (callback, NULL);
> +  support_capture_subprocess_check (&result, "tst-relro", -SIGSEGV,
> +				    sc_allow_stdout);
> +  return 0;
> +}

My test <https://sourceware.org/ml/libc-alpha/2019-10/msg00130.html>
used a new support/ helper for that.

Thanks,
Florian



More information about the Libc-alpha mailing list