From: Nick Clifton Date: Tue, 11 Oct 2016 11:04:42 +0000 (+0100) Subject: Add support to the static linker for the tokens accepted by the dynamic linker when... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=199fa1b7089d7f7438b087fa30504ea5a590f561;p=binutils-gdb.git Add support to the static linker for the tokens accepted by the dynamic linker when resolving search paths. PR ld/20535 * emultempl/elf32.em (_search_needed): Add support for pseudo environment variables supported by ld.so. Namely $ORIGIN, $LIB and $PLATFORM. * configure.ac: Add getauxval to list AC_CHECK_FUNCS list. * config.in: Regenerate. * configure: Regenerate. --- diff --git a/ld/ChangeLog b/ld/ChangeLog index 1c71de1966b..4c296bfdc50 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,13 @@ +2016-10-11 Nick Clifton + + PR ld/20535 + * emultempl/elf32.em (_search_needed): Add support for pseudo + environment variables supported by ld.so. Namely $ORIGIN, $LIB + and $PLATFORM. + * configure.ac: Add getauxval to list AC_CHECK_FUNCS list. + * config.in: Regenerate. + * configure: Regenerate. + 2016-10-11 Alan Modra * ldlang.c (lang_do_assignments_1): Descend into output section diff --git a/ld/config.in b/ld/config.in index 2c6d698b6ce..5c614ed1a2e 100644 --- a/ld/config.in +++ b/ld/config.in @@ -62,6 +62,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H +/* Define to 1 if you have the `getauxval' function. */ +#undef HAVE_GETAUXVAL + /* Define to 1 if you have the `getpagesize' function. */ #undef HAVE_GETPAGESIZE diff --git a/ld/configure b/ld/configure index 3f82f35fdd9..2c55b287381 100755 --- a/ld/configure +++ b/ld/configure @@ -16488,7 +16488,7 @@ _ACEOF fi done -for ac_func in open lseek close +for ac_func in getauxval open lseek close do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" diff --git a/ld/configure.ac b/ld/configure.ac index d17281f0a0c..454284502f6 100644 --- a/ld/configure.ac +++ b/ld/configure.ac @@ -216,7 +216,7 @@ AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h elf-hints.h limits.h local AC_CHECK_HEADERS(fcntl.h sys/file.h sys/time.h sys/stat.h) ACX_HEADER_STRING AC_CHECK_FUNCS(glob mkstemp realpath sbrk setlocale waitpid) -AC_CHECK_FUNCS(open lseek close) +AC_CHECK_FUNCS(getauxval open lseek close) AC_HEADER_DIRENT dnl AC_CHECK_HEADERS(sys/mman.h) diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em index 2815a3e461a..06f02c6d860 100644 --- a/ld/emultempl/elf32.em +++ b/ld/emultempl/elf32.em @@ -472,6 +472,15 @@ fragment < +#endif +EOF +fi +fragment < token might be a legitimate component of + a path name in the target's file system. */ + info_msg (_("unrecognised token '%s' in search path\n"), var); + + if (end) + /* Restore the path separator. */ + * end = '/'; + } + + free (freeme); + } + needed.name = filename; if (gld${EMULATION_NAME}_try_needed (&needed, force)) return TRUE;