From 9fa2c03227e159050e9dc4ec1e315e5909901580 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Thu, 14 Jul 2011 19:09:27 -0700 Subject: Adjust relro test to work around GNU ld limitations. --- configure.in | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'configure.in') diff --git a/configure.in b/configure.in index d40bc64ca2..55e56498c1 100644 --- a/configure.in +++ b/configure.in @@ -1607,7 +1607,14 @@ EOF AC_LANG_CONFTEST([AC_LANG_SOURCE([[ int _start (void) { return 42; } extern void _exit (int); +/* Since these pointers are const, they should go in rodata. + Since they refer to functions that have to be resolved by + dynamic linking, they should instead go in RELRO data. */ const void *const relro[] = { &_start, &_exit, 0 }; +/* GNU ld fails to produce RELRO data when it's very small and there is no + normal writable data following it, or if only uninitialized (.bss) data + follows it, or only very small writable data. */ +int data[0x10000] = { 1, }; ]])]) cat > conftest.awk <<\EOF BEGIN { -- cgit 1.4.1