From 44c4e5d598bfcbb309f05ceb7a57ab02662e7f34 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Thu, 13 Mar 2014 10:38:27 -0700 Subject: Use __ehdr_start, when available, for rtld to get its own headers. --- configure.ac | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index f3dd87d..59dbb5e 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. -- cgit v1.1