#!/bin/sh

# Copyright (C) 2004, 2005 Valery Reznic
# This file is part of the Elf Statifier project
# 
# This project is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License.
# See LICENSE file in the doc directory.

# Modified by B. Watson for the SlackBuilds.org project: detects
# whether VDSO has been disabled and prints a warning if not.
if ldd /bin/ls | grep -q 'linux-\(gate\|vdso\)\.'; then
  echo "VDSO is enabled. Converted binary will likely segfault when run."
  if [ -e /proc/sys/vm/vdso_enabled ]; then
    cat <<EOF
Disable VDSO by running this command, as root:
  echo "0" > /proc/sys/vm/vdso_enabled
EOF
  else
     cat <<EOF
To disable VDSO, reboot with 'vdso=0 vdso32=0' on the kernel command line.
EOF
  fi
fi

${STATIFIER_ROOT_DIR:-/usr/lib64/statifier}/statifier.sh "$@"
