summary refs log tree commit diff
path: root/configure.ac
diff options
context:
space:
mode:
authorRoland McGrath <roland@hack.frob.com>2014-03-13 10:38:27 -0700
committerRoland McGrath <roland@hack.frob.com>2014-03-13 10:38:27 -0700
commit44c4e5d598bfcbb309f05ceb7a57ab02662e7f34 (patch)
tree93cbc5ad24779ff1ecd1f644615aa2017ed94307 /configure.ac
parent041a92472e6db60b42cf2db229382fc3482304b9 (diff)
downloadglibc-44c4e5d598bfcbb309f05ceb7a57ab02662e7f34.tar.gz
glibc-44c4e5d598bfcbb309f05ceb7a57ab02662e7f34.tar.xz
glibc-44c4e5d598bfcbb309f05ceb7a57ab02662e7f34.zip
Use __ehdr_start, when available, for rtld to get its own headers.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac21
1 files changed, 21 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index f3dd87d912..59dbb5e1b2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2069,6 +2069,27 @@ if test $libc_cv_predef_stack_protector = yes; then
 fi
 AC_SUBST(libc_extra_cflags)
 
+AC_CACHE_CHECK([whether the linker provides __ehdr_start],
+	       libc_cv_ehdr_start, [
+old_CFLAGS="$CFLAGS"
+old_LDFLAGS="$LDFLAGS"
+old_LIBS="$LIBS"
+CFLAGS="$CFLAGS -fPIC"
+LDFLAGS="$LDFLAGS -nostdlib -nostartfiles -shared"
+LIBS=
+AC_LINK_IFELSE([AC_LANG_SOURCE([
+extern const char __ehdr_start __attribute__ ((visibility ("hidden")));
+const char *ehdr (void) { return &__ehdr_start; }
+])],
+	       [libc_cv_ehdr_start=yes], [libc_cv_ehdr_start=no])
+CFLAGS="$old_CFLAGS"
+LDFLAGS="$old_LDFLAGS"
+LIBS="$old_LIBS"
+])
+if test $libc_cv_ehdr_start = yes; then
+  AC_DEFINE([HAVE_EHDR_START])
+fi
+
 ### End of automated tests.
 ### Now run sysdeps configure fragments.