mirror of
git://sourceware.org/git/glibc.git
synced 2024-11-27 03:41:23 +08:00
61965e9b17
* elf/rtld.c (dl_main): Take new option --verify when run directly. In verify mode, exit with status zero iff the argument object's PT_INTERP matches argv[0]. * elf/ldd.sh.in: Use ${RTLD} --verify and only run the program if it exits with zero status. This makes `ldd' secure again. Fri Jul 26 22:49:58 1996 Ulrich Drepper <drepper@cygnus.com> * elf/rtld.c (dl_main): Implement LD_TRACE_LOADED_OBJECTS environment variable handling. This makes the dynamic linker only print loaded libraries and quit. * elf/ldd.sh.in: Don't use `rtld --list' but instead LD_TRACE_LOADED_OBJECTS environment variable to print needed objects. Sat Jul 27 02:03:26 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu> * db/makedb.c (main): Print version on stdout, not stderr. Don't exit after printing version until after doing usage for --help. (long_options, main, usage): Rename -l/--lowercase option to -f/--fold-case (-f matches sort). Sat Jul 27 04:32:31 1996 Ulrich Drepper <drepper@cygnus.com> * db/makedb.c: New file. Implement program to create simple <db.h> database from textual input. This will be used for nss_db. Sat Jul 27 01:24:05 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu> * sunrpc/rpc/auth_unix.h: Fix misapplied patches in last changes. * sunrpc/rpc/pmap_clnt.h: Likewise. * sunrpc/rpc/auth.h: Likewise. * sunrpc/rpc/pmap_rmt.h: Likewise. * sunrpc/rpc/rpc_msg.h: Likewise. Sat Jul 27 04:37:34 1996 Ulrich Drepper <drepper@cygnus.com> * string/string.h (strndupa): Change to use return value of `memcpy' for more performance. * string/strndup.c: Likewise. * string/string.h (strdupa): Don't call __builtin_alloca in argument. This might lead to problems. (strndupa): Likewise.
43 lines
911 B
Bash
43 lines
911 B
Bash
#! /bin/sh
|
|
|
|
# This is the `ldd' command, which lists what shared libraries are
|
|
# used by given dynamically-linked executables. It works by invoking the
|
|
# run-time dynamic linker as a command and giving it the special `--list'
|
|
# switch.
|
|
|
|
RTLD=@RTLD@
|
|
|
|
case $# in
|
|
0)
|
|
echo >&2 "Usage: $0 FILE..."
|
|
exit 1 ;;
|
|
1)
|
|
# We don't list the file name when there is only one.
|
|
case "$1" in
|
|
/*) file="$1" ;;
|
|
*) file="./$1" ;;
|
|
esac
|
|
if ${RTLD} --verify "$file"; then
|
|
LD_TRACE_LOADED_OBJECTS=1 exec "$file" && exit 1
|
|
else
|
|
echo ' not a dynamic executable'
|
|
fi
|
|
exit ;;
|
|
*)
|
|
set -e # Bail out immediately if ${RTLD} loses on any argument.
|
|
for file; do
|
|
echo "${file}:"
|
|
case "$file" in
|
|
/*) file="$file" ;;
|
|
*) file="./$file" ;;
|
|
esac
|
|
if ${RTLD} --verify "$file"; then
|
|
LD_TRACE_LOADED_OBJECTS=1 "$file"
|
|
else
|
|
echo ' not a dynamic executable'
|
|
fi
|
|
done
|
|
esac
|
|
|
|
exit 0
|