From 302247c89121e8d4c7629e589edbb4974fff6edb Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Tue, 10 Aug 2021 11:04:56 -0700 Subject: elf: Unconditionally use __ehdr_start We can consider __ehdr_start (from binutils 2.23 onwards) unconditionally supported, since configure.ac requires binutils>=2.25. The configure.ac check is related to an ia64 bug fixed by binutils 2.24. See https://sourceware.org/pipermail/libc-alpha/2014-August/053503.html Tested on x86_64-linux-gnu. Tested build-many-glibcs.py with aarch64-linux-gnu and s390x-linux-gnu. Reviewed-by: Szabolcs Nagy --- configure.ac | 34 ---------------------------------- 1 file changed, 34 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 34ecbba540..af47cd51e6 100644 --- a/configure.ac +++ b/configure.ac @@ -1662,40 +1662,6 @@ if test $libc_cv_predef_fortify_source = yes; then fi AC_SUBST(CPPUNDEFS) -# Some linkers on some architectures support __ehdr_start but with -# bugs. Make sure usage of it does not create relocations in the -# output (as the linker should resolve them all for us). -AC_CACHE_CHECK([whether the linker provides working __ehdr_start], - libc_cv_ehdr_start, [ -old_CFLAGS="$CFLAGS" -old_LDFLAGS="$LDFLAGS" -old_LIBS="$LIBS" -CFLAGS="$CFLAGS -fPIC" -LDFLAGS="$LDFLAGS -nostdlib -nostartfiles -shared $no_ssp" -LIBS= -AC_LINK_IFELSE([AC_LANG_SOURCE([ -typedef struct { - char foo; - long val; -} Ehdr; -extern const Ehdr __ehdr_start __attribute__ ((visibility ("hidden"))); -long ehdr (void) { return __ehdr_start.val; } -])], - [if $READELF -r conftest | grep -F __ehdr_start >/dev/null; then - libc_cv_ehdr_start=broken - else - libc_cv_ehdr_start=yes - fi], [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]) -elif test "$libc_cv_ehdr_start" = broken; then - AC_MSG_WARN([linker is broken -- you should upgrade]) -fi - dnl Starting with binutils 2.35, GAS can attach multiple symbol versions dnl to one symbol (PR 23840). AC_CACHE_CHECK(whether the assembler requires one version per symbol, -- cgit 1.4.1