#! /bin/sh

# If you don't use rpm, you can use this file to apply additional Linux
# patches. At the top level of the binutils source tree, do
#
# /bin/sh patches/README
#
# You may have to do
#
# cd bfd
# make headers
#
# if the build fails.

dir=`dirname $0`

patch -p1 -b --suffix .exec < $dir/binutils-version-exec-3.patch &&
patch -p0 -b --suffix .pie < $dir/bfd-pie-4.patch &&
patch -p0 -b --suffix .error < $dir/bfd-elf-error-2.patch &&
true
[ $? = 0 ] || exit 1
find -name "*.orig" | xargs rm -fv
find -name "*.gmo" | xargs rm -fv
