+++ /dev/null
-# Copyright 1999-2006 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-libs/elfutils/elfutils-0.108-r1.ebuild,v 1.6 2006/01/18 12:23:40 vapier Exp $
-
-inherit eutils
-
-DESCRIPTION="Libraries/utilities to handle ELF objects (drop in replacement for libelf)"
-HOMEPAGE="http://people.redhat.com/drepper/"
-SRC_URI="mirror://gentoo/${P}.tar.gz
- http://dev.gentoo.org/~azarah/${PN}/${P}-robustify3.patch.bz2
- mirror://gentoo/${P}-robustify3.patch.bz2"
-
-LICENSE="OpenSoftware"
-SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
-IUSE=""
-
-# This pkg does not actually seem to compile currently in a uClibc
-# environment (xrealloc errs), but we need to ensure that glibc never
-# gets pulled in as a dep since this package does not respect virtual/libc
-DEPEND="elibc_glibc? ( >=sys-libs/glibc-2.3.2 )
- sys-devel/gettext
- sys-devel/autoconf
- >=sys-devel/binutils-2.14.90.0.6
- >=sys-devel/gcc-3.2.1-r6
- !dev-libs/libelf"
-RDEPEND=""
-
-src_unpack() {
- unpack ${A}
-
- cd "${S}"
- epatch "${FILESDIR}"/${PN}-0.101-bswap.patch
- epatch "${FILESDIR}"/${P}-portability.patch
-
- # The next patch should not be needed in 0.109
- epatch ${DISTDIR}/${P}-robustify3.patch.bz2
-
- # Needed by ${P}-portability.patch
- autoreconf || die
-
- find . -name Makefile.in -print0 | xargs -0 sed -i -e 's:-W\(error\|extra\)::g'
-}
-
-src_compile() {
- econf \
- --program-prefix="eu-" \
- --enable-shared \
- || die "./configure failed"
- emake || die
-}
-
-src_test() {
- env LD_LIBRARY_PATH="${S}/libelf:${S}/libebl:${S}/libdw:${S}/libasm" \
- make check || die "test failed"
-}
-
-src_install() {
- make DESTDIR="${D}" install || die
- dodoc AUTHORS ChangeLog NEWS NOTES README THANKS TODO
-}
+++ /dev/null
-# Copyright 1999-2006 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-libs/elfutils/elfutils-0.108.ebuild,v 1.16 2006/01/18 12:23:40 vapier Exp $
-
-inherit eutils
-
-DESCRIPTION="Libraries/utilities to handle ELF objects (drop in replacement for libelf)"
-HOMEPAGE="http://people.redhat.com/drepper/"
-SRC_URI="mirror://gentoo/${P}.tar.gz mirror://gentoo/${P}.robustify.patch.bz2"
-
-LICENSE="OpenSoftware"
-SLOT="0"
-KEYWORDS="alpha amd64 arm hppa ia64 mips ppc ppc64 s390 sh sparc x86"
-IUSE=""
-
-# This pkg does not actually seem to compile currently in a uClibc
-# environment (xrealloc errs), but we need to ensure that glibc never
-# gets pulled in as a dep since this package does not respect virtual/libc
-DEPEND="elibc_glibc? ( >=sys-libs/glibc-2.3.2 )
- sys-devel/gettext
- >=sys-devel/binutils-2.14.90.0.6
- >=sys-devel/gcc-3.2.1-r6
- !dev-libs/libelf"
-RDEPEND=""
-
-src_unpack() {
- unpack ${A}
- cd "${S}"
- epatch "${FILESDIR}"/${PN}-0.101-bswap.patch
- epatch "${FILESDIR}"/${P}-portability.patch
-
- #the next 2 patches should not be needed in 0.109
- epatch ${WORKDIR}/elfutils-0.108.robustify.patch
- # incremental patch.
- epatch ${FILESDIR}/elfutils-0.108-robustify2.patch
-
- # Needed by ${P}-portability.patch
- autoreconf || die
-
- find . -name Makefile.in -print0 | xargs -0 sed -i -e 's:-W\(error\|extra\)::g'
-}
-
-src_compile() {
- econf \
- --program-prefix="eu-" \
- --enable-shared \
- || die "./configure failed"
- emake || die
-}
-
-src_test() {
- env LD_LIBRARY_PATH="${S}/libelf:${S}/libebl:${S}/libdw:${S}/libasm" \
- make check || die "test failed"
-}
-
-src_install() {
- make DESTDIR="${D}" install || die
- dodoc AUTHORS ChangeLog NEWS NOTES README THANKS TODO
-}
+++ /dev/null
-# Copyright 1999-2006 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-libs/elfutils/elfutils-0.120.ebuild,v 1.1 2006/04/16 05:17:40 vapier Exp $
-
-inherit eutils autotools
-
-PVER="1.0"
-DESCRIPTION="Libraries/utilities to handle ELF objects (drop in replacement for libelf)"
-HOMEPAGE="http://people.redhat.com/drepper/"
-SRC_URI="ftp://sources.redhat.com/pub/systemtap/${PN}/${P}.tar.gz
- mirror://gentoo/${P}-patches-${PVER}.tar.bz2"
-
-LICENSE="OpenSoftware"
-SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
-IUSE=""
-
-# This pkg does not actually seem to compile currently in a uClibc
-# environment (xrealloc errs), but we need to ensure that glibc never
-# gets pulled in as a dep since this package does not respect virtual/libc
-DEPEND="elibc_glibc? ( >=sys-libs/glibc-2.3.2 )
- sys-devel/gettext
- sys-devel/autoconf
- >=sys-devel/binutils-2.15.90.0.1
- >=sys-devel/gcc-3.3.3
- !dev-libs/libelf"
-RDEPEND=""
-
-src_unpack() {
- unpack ${A}
-
- cd "${S}"
- epatch "${WORKDIR}"/patch/*.patch
- epatch "${FILESDIR}"/${PN}-0.118-libelf-link.patch
- epatch "${FILESDIR}"/${PN}-0.118-PaX-support.patch
- epatch "${FILESDIR}"/${PN}-0.118-no-nested-functions.patch #116968
- epatch "${FILESDIR}"/${PN}-0.120-mkinstalldirs.patch
-
- eautoreconf
-
- find . -name Makefile.in -print0 | xargs -0 sed -i -e 's:-W\(error\|extra\)::g'
-}
-
-src_compile() {
- econf \
- --program-prefix="eu-" \
- --enable-shared \
- || die "./configure failed"
- emake || die
-}
-
-src_test() {
- env LD_LIBRARY_PATH="${S}/libelf:${S}/libebl:${S}/libdw:${S}/libasm" \
- make check || die "test failed"
-}
-
-src_install() {
- make DESTDIR="${D}" install || die
- dodoc AUTHORS ChangeLog NEWS NOTES README THANKS TODO
-}
+++ /dev/null
-# Copyright 1999-2006 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-libs/elfutils/elfutils-0.122.ebuild,v 1.3 2006/08/05 21:10:27 vapier Exp $
-
-inherit eutils autotools
-
-PVER="1.0"
-DESCRIPTION="Libraries/utilities to handle ELF objects (drop in replacement for libelf)"
-HOMEPAGE="http://people.redhat.com/drepper/"
-SRC_URI="ftp://sources.redhat.com/pub/systemtap/${PN}/${P}.tar.gz
- mirror://gentoo/${P}-patches-${PVER}.tar.bz2"
-
-LICENSE="OpenSoftware"
-SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
-IUSE=""
-
-# This pkg does not actually seem to compile currently in a uClibc
-# environment (xrealloc errs), but we need to ensure that glibc never
-# gets pulled in as a dep since this package does not respect virtual/libc
-DEPEND="elibc_glibc? ( >=sys-libs/glibc-2.3.2 )
- sys-devel/gettext
- sys-devel/autoconf
- >=sys-devel/binutils-2.15.90.0.1
- >=sys-devel/gcc-3.3.3
- !dev-libs/libelf"
-RDEPEND=""
-
-src_unpack() {
- unpack ${A}
-
- cd "${S}"
- epatch "${WORKDIR}"/patch/*.patch
- epatch "${FILESDIR}"/${PN}-0.118-libelf-link.patch
- epatch "${FILESDIR}"/${PN}-0.118-PaX-support.patch
- epatch "${FILESDIR}"/${PN}-0.118-no-nested-functions.patch #116968
- # this will make more files +x than need be, but who cares really
- chmod a+rx config/*
-
- AT_M4DIR="${S}/m4" eautoreconf
-
- find . -name Makefile.in -print0 | xargs -0 sed -i -e 's:-W\(error\|extra\)::g'
-}
-
-src_compile() {
- econf \
- --program-prefix="eu-" \
- --enable-shared \
- || die "./configure failed"
- emake || die
-}
-
-src_test() {
- env LD_LIBRARY_PATH="${S}/libelf:${S}/libebl:${S}/libdw:${S}/libasm" \
- make check || die "test failed"
-}
-
-src_install() {
- make DESTDIR="${D}" install || die
- dodoc AUTHORS ChangeLog NEWS NOTES README THANKS TODO
-}
+++ /dev/null
-MD5 c619914318460f1dc9434407b982f64a elfutils-0.108.robustify.patch.bz2 5637
-RMD160 f5f24712649b2d85e695e24ca38d7871745be6c8 elfutils-0.108.robustify.patch.bz2 5637
-SHA256 7ca7ffcb5368bfa03dc3da2a70153d9a13c6b6cc675bcd05edd589d13f94a84c elfutils-0.108.robustify.patch.bz2 5637
-MD5 fd318a634c8f67c7ac8a975f16965cc3 elfutils-0.108.tar.gz 938036
-RMD160 ac7a1314fd9d18413670ce46d0558e8399d1b32e elfutils-0.108.tar.gz 938036
-SHA256 794070c8108a2d8b7c6890ba42edb37510cc845bf601517cf4a0ea5443dfde29 elfutils-0.108.tar.gz 938036
+++ /dev/null
-MD5 169a22f3a4fa472e4c0cff290282aaaa elfutils-0.108-robustify3.patch.bz2 10811
-RMD160 31660eba01bf6469db01bb704ca7e90b56e69286 elfutils-0.108-robustify3.patch.bz2 10811
-SHA256 acdd745bbc82937b5252775b9ae951fa3fc8e98f1d8b5524ddbf30f5bd16ebee elfutils-0.108-robustify3.patch.bz2 10811
-MD5 fd318a634c8f67c7ac8a975f16965cc3 elfutils-0.108.tar.gz 938036
-RMD160 ac7a1314fd9d18413670ce46d0558e8399d1b32e elfutils-0.108.tar.gz 938036
-SHA256 794070c8108a2d8b7c6890ba42edb37510cc845bf601517cf4a0ea5443dfde29 elfutils-0.108.tar.gz 938036
+++ /dev/null
-MD5 ccdd17f58c0c6feb35c9aff0b1217650 elfutils-0.120-patches-1.0.tar.bz2 16322
-RMD160 979160ef30a7d3d2bfc8bce20143b8663c62e3d0 elfutils-0.120-patches-1.0.tar.bz2 16322
-SHA256 527501e03b1267bd2e9f0283319db120d9f15324bd9f7820d24624a323ddf136 elfutils-0.120-patches-1.0.tar.bz2 16322
-MD5 3f757d85af891904892b4a6dc3f9e14c elfutils-0.120.tar.gz 1126669
-RMD160 9c9ad5f23092bb812a5cb6649005bb04b0226ea8 elfutils-0.120.tar.gz 1126669
-SHA256 0e868eb7468e639a95c1d5260bd0313cd30e578f308e0abf990a9519c2a304e7 elfutils-0.120.tar.gz 1126669
+++ /dev/null
-MD5 58575912c5f4d27a5eb8fbbc42a154f2 elfutils-0.122-patches-1.0.tar.bz2 17255
-RMD160 389405535527ede14182461b5cb35596f30e822d elfutils-0.122-patches-1.0.tar.bz2 17255
-SHA256 591b916cc7b40598e9a1b7e11cb386ad41d25bbf24b97b37bb5bdfa76b198fdb elfutils-0.122-patches-1.0.tar.bz2 17255
-MD5 d83e9022eb342eede549dd6d6a537b59 elfutils-0.122.tar.gz 1138835
-RMD160 a557348346afd1fb4dcd06c4f1b62cb6eaab6942 elfutils-0.122.tar.gz 1138835
-SHA256 82616fb9790543a6c5a28e45fd363622b4cc73c9cf3304b06171fa8584b740be elfutils-0.122.tar.gz 1138835
+++ /dev/null
---- libelf/common.h.~1.3.~ 2005-02-15 14:23:41.000000000 -0800
-+++ libelf/common.h 2005-02-15 14:52:48.706163944 -0800
-@@ -122,7 +122,7 @@ libelf_release_all (Elf *elf)
- (Var) = (sizeof (Var) == 1 \
- ? (unsigned char) (Var) \
- : (sizeof (Var) == 2 \
-- ? bswap_16 (Var) \
-+ ? (unsigned short int) bswap_16 (Var) \
- : (sizeof (Var) == 4 \
- ? bswap_32 (Var) \
- : bswap_64 (Var))))
-@@ -131,7 +131,7 @@ libelf_release_all (Elf *elf)
- (Dst) = (sizeof (Var) == 1 \
- ? (unsigned char) (Var) \
- : (sizeof (Var) == 2 \
-- ? bswap_16 (Var) \
-+ ? (unsigned short int) bswap_16 (Var) \
- : (sizeof (Var) == 4 \
- ? bswap_32 (Var) \
- : bswap_64 (Var))))
+++ /dev/null
---- elfutils/ChangeLog
-+++ elfutils/ChangeLog
-@@ -1,3 +1,16 @@
-+2005-02-07 Roland McGrath <roland@frob.com>
-+
-+ * configure.ac (WEXTRA): Check for -Wextra and set this substitution.
-+
-+2003-08-12 Roland McGrath <roland@redhat.com>
-+
-+ * configure.ac: Check for struct stat st_?tim members.
-+ * src/strip.c (process_file): Use st_?time if st_?tim are not there.
-+
-+ * configure.ac: Check for futimes function.
-+ * src/strip.c (handle_elf) [! HAVE_FUTIMES]: Use utimes instead.
-+ (handle_ar) [! HAVE_FUTIMES]: Likewise.
-+
- 2005-02-22 Ulrich Drepper <drepper@redhat.com>
-
- * Makefile.am (all_SUBDIRS): Don't add doc subdir for now.
---- elfutils/Makefile.in
-+++ elfutils/Makefile.in
-@@ -127,6 +127,7 @@ SHELL = @SHELL@
- STRIP = @STRIP@
- USE_NLS = @USE_NLS@
- VERSION = @VERSION@
-+WEXTRA = @WEXTRA@
- XGETTEXT = @XGETTEXT@
- YACC = @YACC@
- ac_ct_CC = @ac_ct_CC@
---- elfutils/config/Makefile.in
-+++ elfutils/config/Makefile.in
-@@ -105,6 +105,7 @@ SHELL = @SHELL@
- STRIP = @STRIP@
- USE_NLS = @USE_NLS@
- VERSION = @VERSION@
-+WEXTRA = @WEXTRA@
- XGETTEXT = @XGETTEXT@
- YACC = @YACC@
- ac_ct_CC = @ac_ct_CC@
---- elfutils/configure
-+++ elfutils/configure
-@@ -277,7 +277,7 @@ PACKAGE_STRING='Red Hat elfutils 0.108'
- PACKAGE_BUGREPORT='http://bugzilla.redhat.com/bugzilla/'
-
- ac_unique_file="libelf/libelf.h"
--ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE RANLIB ac_ct_RANLIB YACC LEX LEXLIB LEX_OUTPUT_ROOT LOCALEDIR DATADIRNAME NATIVE_LD_TRUE NATIVE_LD_FALSE base_cpu MUDFLAP_TRUE MUDFLAP_FALSE USE_NLS MKINSTALLDIRS MSGFMT GMSGFMT XGETTEXT MSGMERGE LIBOBJS LTLIBOBJS'
-+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE RANLIB ac_ct_RANLIB YACC LEX LEXLIB LEX_OUTPUT_ROOT WEXTRA LOCALEDIR DATADIRNAME NATIVE_LD_TRUE NATIVE_LD_FALSE base_cpu MUDFLAP_TRUE MUDFLAP_FALSE USE_NLS MKINSTALLDIRS MSGFMT GMSGFMT XGETTEXT MSGMERGE LIBOBJS LTLIBOBJS'
- ac_subst_files=''
-
- # Initialize some variables set by options.
-@@ -3373,6 +3373,58 @@ echo "$as_me: error: gcc with C99 suppor
- fi
-
-
-+echo "$as_me:$LINENO: checking for -Wextra option to $CC" >&5
-+echo $ECHO_N "checking for -Wextra option to $CC... $ECHO_C" >&6
-+if test "${ac_cv_cc_wextra+set}" = set; then
-+ echo $ECHO_N "(cached) $ECHO_C" >&6
-+else
-+ old_CFLAGS="$CFLAGS"
-+CFLAGS="$CFLAGS -Wextra"
-+cat >conftest.$ac_ext <<_ACEOF
-+void foo (void) { }
-+_ACEOF
-+rm -f conftest.$ac_objext
-+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-+ (eval $ac_compile) 2>conftest.er1
-+ ac_status=$?
-+ grep -v '^ *+' conftest.er1 >conftest.err
-+ rm -f conftest.er1
-+ cat conftest.err >&5
-+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+ (exit $ac_status); } &&
-+ { ac_try='test -z "$ac_c_werror_flag"
-+ || test ! -s conftest.err'
-+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+ (eval $ac_try) 2>&5
-+ ac_status=$?
-+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+ (exit $ac_status); }; } &&
-+ { ac_try='test -s conftest.$ac_objext'
-+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+ (eval $ac_try) 2>&5
-+ ac_status=$?
-+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+ (exit $ac_status); }; }; then
-+ ac_cv_cc_wextra=yes
-+else
-+ echo "$as_me: failed program was:" >&5
-+sed 's/^/| /' conftest.$ac_ext >&5
-+
-+ac_cv_cc_wextra=no
-+fi
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-+CFLAGS="$old_CFLAGS"
-+fi
-+echo "$as_me:$LINENO: result: $ac_cv_cc_wextra" >&5
-+echo "${ECHO_T}$ac_cv_cc_wextra" >&6
-+
-+if test "x$ac_cv_cc_wextra" = yes; then
-+ WEXTRA=-Wextra
-+else
-+ WEXTRA=-W
-+fi
-+
-+
- LOCALEDIR=$datadir
-
- cat >>confdefs.h <<_ACEOF
-@@ -4818,6 +4870,7 @@ s,@YACC@,$YACC,;t t
- s,@LEX@,$LEX,;t t
- s,@LEXLIB@,$LEXLIB,;t t
- s,@LEX_OUTPUT_ROOT@,$LEX_OUTPUT_ROOT,;t t
-+s,@WEXTRA@,$WEXTRA,;t t
- s,@LOCALEDIR@,$LOCALEDIR,;t t
- s,@DATADIRNAME@,$DATADIRNAME,;t t
- s,@NATIVE_LD_TRUE@,$NATIVE_LD_TRUE,;t t
---- elfutils/configure.ac
-+++ elfutils/configure.ac
-@@ -64,6 +64,15 @@ CFLAGS="$old_CFLAGS"])
- AS_IF([test "x$ac_cv_c99" != xyes],
- AC_MSG_ERROR([gcc with C99 support required]))
-
-+AC_CACHE_CHECK([for -Wextra option to $CC], ac_cv_cc_wextra, [dnl
-+old_CFLAGS="$CFLAGS"
-+CFLAGS="$CFLAGS -Wextra"
-+AC_COMPILE_IFELSE([void foo (void) { }],
-+ ac_cv_cc_wextra=yes, ac_cv_cc_wextra=no)
-+CFLAGS="$old_CFLAGS"])
-+AC_SUBST(WEXTRA)
-+AS_IF([test "x$ac_cv_cc_wextra" = yes], [WEXTRA=-Wextra], [WEXTRA=-W])
-+
- LOCALEDIR=$datadir
- AC_SUBST(LOCALEDIR)
- AC_DEFINE_UNQUOTED(LOCALEDIR, "$LOCALEDIR")
---- elfutils/lib/ChangeLog
-+++ elfutils/lib/ChangeLog
-@@ -4,6 +4,11 @@
- * Makefile.am (libeu_a_SOURCES): Add it.
- * system.h: Declare crc32_file.
-
-+2005-02-07 Roland McGrath <roland@redhat.com>
-+
-+ * Makefile.am (WEXTRA): New variable, substituted by configure.
-+ (AM_CFLAGS): Use it in place of -Wextra.
-+
- 2005-04-30 Ulrich Drepper <drepper@redhat.com>
-
- * Makefile.am: Use -ffunction-sections for xmalloc.c.
---- elfutils/lib/Makefile.am
-+++ elfutils/lib/Makefile.am
-@@ -16,12 +16,13 @@
- ## Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- ##
- DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H
-+WEXTRA = @WEXTRA@
- if MUDFLAP
- AM_CFLAGS = -fmudflap
- else
- AM_CFLAGS =
- endif
--AM_CFLAGS += -fpic -Wall -Wshadow -Werror -Wunused -Wextra $($(*F)_CFLAGS)
-+AM_CFLAGS += -fpic -Wall -Wshadow -Werror -Wunused $(WEXTRA) $($(*F)_CFLAGS)
- INCLUDES = -I$(srcdir)/../libelf -I..
-
- noinst_LIBRARIES = libeu.a
---- elfutils/lib/Makefile.in
-+++ elfutils/lib/Makefile.in
-@@ -127,6 +127,7 @@ SHELL = @SHELL@
- STRIP = @STRIP@
- USE_NLS = @USE_NLS@
- VERSION = @VERSION@
-+WEXTRA = @WEXTRA@
- XGETTEXT = @XGETTEXT@
- YACC = @YACC@
- ac_ct_CC = @ac_ct_CC@
-@@ -169,9 +170,9 @@ sharedstatedir = @sharedstatedir@
- sysconfdir = @sysconfdir@
- target_alias = @target_alias@
- @MUDFLAP_FALSE@AM_CFLAGS = -fpic -Wall -Wshadow -Werror -Wunused \
--@MUDFLAP_FALSE@ -Wextra $($(*F)_CFLAGS)
-+@MUDFLAP_FALSE@ $(WEXTRA) $($(*F)_CFLAGS)
- @MUDFLAP_TRUE@AM_CFLAGS = -fmudflap -fpic -Wall -Wshadow -Werror \
--@MUDFLAP_TRUE@ -Wunused -Wextra $($(*F)_CFLAGS)
-+@MUDFLAP_TRUE@ -Wunused $(WEXTRA) $($(*F)_CFLAGS)
- INCLUDES = -I$(srcdir)/../libelf -I..
- noinst_LIBRARIES = libeu.a
- libeu_a_SOURCES = xstrdup.c xstrndup.c xmalloc.c next_prime.c \
---- elfutils/libasm/Makefile.am
-+++ elfutils/libasm/Makefile.am
-@@ -13,12 +13,13 @@
- ## 3001 King Ranch Road, Ukiah, CA 95482.
- ##
- DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H
-+WEXTRA = @WEXTRA@
- if MUDFLAP
- AM_CFLAGS = -fmudflap
- else
- AM_CFLAGS =
- endif
--AM_CFLAGS += -Wall -Wshadow -Werror -Wunused -Wextra -Wformat=2
-+AM_CFLAGS += -Wall -Wshadow -Werror -Wunused $(WEXTRA) -Wformat=2
- INCLUDES = -I. -I$(srcdir) -I.. -I$(top_srcdir)/libelf -I$(top_srcdir)/libebl \
- -I$(top_srcdir)/lib
- GCC_INCLUDE = -I$(shell $(CC) -print-file-name=include)
---- elfutils/libasm/Makefile.in
-+++ elfutils/libasm/Makefile.in
-@@ -159,6 +159,7 @@ SHELL = @SHELL@
- STRIP = @STRIP@
- USE_NLS = @USE_NLS@
- VERSION = 1
-+WEXTRA = @WEXTRA@
- XGETTEXT = @XGETTEXT@
- YACC = @YACC@
- ac_ct_CC = @ac_ct_CC@
-@@ -200,10 +201,10 @@ sbindir = @sbindir@
- sharedstatedir = @sharedstatedir@
- sysconfdir = @sysconfdir@
- target_alias = @target_alias@
--@MUDFLAP_FALSE@AM_CFLAGS = -Wall -Wshadow -Werror -Wunused -Wextra \
-+@MUDFLAP_FALSE@AM_CFLAGS = -Wall -Wshadow -Werror -Wunused $(WEXTRA) \
- @MUDFLAP_FALSE@ -Wformat=2
- @MUDFLAP_TRUE@AM_CFLAGS = -fmudflap -Wall -Wshadow -Werror -Wunused \
--@MUDFLAP_TRUE@ -Wextra -Wformat=2
-+@MUDFLAP_TRUE@ $(WEXTRA) -Wformat=2
- INCLUDES = -I. -I$(srcdir) -I.. -I$(top_srcdir)/libelf -I$(top_srcdir)/libebl \
- -I$(top_srcdir)/lib
-
---- elfutils/libcpu/ChangeLog
-+++ elfutils/libcpu/ChangeLog
-@@ -1,3 +1,8 @@
-+2005-04-04 Roland McGrath <roland@redhat.com>
-+
-+ * Makefile.am (WEXTRA): New variable, substituted by configure.
-+ (AM_CFLAGS): Use it instead of -Wextra.
-+
- 2005-02-15 Ulrich Drepper <drepper@redhat.com>
-
- * Makefile (AM_CFLAGS): Add -Wunused -Wextra -Wformat=2.
---- elfutils/libcpu/Makefile.am
-+++ elfutils/libcpu/Makefile.am
-@@ -13,7 +13,8 @@
- ## 3001 King Ranch Road, Ukiah, CA 95482.
- ##
- DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H
--AM_CFLAGS = -Wall -Wshadow -Werror -Wextra -Wformat=2 -Wunused
-+WEXTRA = @WEXTRA@
-+AM_CFLAGS = -Wall -Wshadow -Werror $(WEXTRA) -Wformat=2 -Wunused
- INCLUDES = -I$(srcdir)
-
- noinst_LIBRARIES = libcpu_i386.a
---- elfutils/libcpu/Makefile.in
-+++ elfutils/libcpu/Makefile.in
-@@ -122,6 +122,7 @@ SHELL = @SHELL@
- STRIP = @STRIP@
- USE_NLS = @USE_NLS@
- VERSION = @VERSION@
-+WEXTRA = @WEXTRA@
- XGETTEXT = @XGETTEXT@
- YACC = @YACC@
- ac_ct_CC = @ac_ct_CC@
-@@ -163,7 +164,7 @@ sbindir = @sbindir@
- sharedstatedir = @sharedstatedir@
- sysconfdir = @sysconfdir@
- target_alias = @target_alias@
--AM_CFLAGS = -Wall -Wshadow -Werror -Wextra -Wformat=2 -Wunused
-+AM_CFLAGS = -Wall -Wshadow -Werror $(WEXTRA) -Wformat=2 -Wunused
- INCLUDES = -I$(srcdir)
- noinst_LIBRARIES = libcpu_i386.a
- libcpu_i386_a_SOURCES = i386_dis.c
---- elfutils/libdw/Makefile.am
-+++ elfutils/libdw/Makefile.am
-@@ -13,12 +13,13 @@
- ## 3001 King Ranch Road, Ukiah, CA 95482.
- ##
- DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H
-+WEXTRA = @WEXTRA@
- if MUDFLAP
- AM_CFLAGS = -fmudflap
- else
- AM_CFLAGS =
- endif
--AM_CFLAGS += -Wall -Werror -Wshadow -Wunused -Wformat=2 -Wextra -std=gnu99
-+AM_CFLAGS += -Wall -Werror -Wshadow -Wunused -Wformat=2 $(WEXTRA) -std=gnu99
- INCLUDES = -I. -I$(srcdir) -I$(srcdir)/../libelf -I.. -I$(srcdir)/../lib
- VERSION = 1
-
---- elfutils/libdw/Makefile.in
-+++ elfutils/libdw/Makefile.in
-@@ -190,6 +190,7 @@ SHELL = @SHELL@
- STRIP = @STRIP@
- USE_NLS = @USE_NLS@
- VERSION = 1
-+WEXTRA = @WEXTRA@
- XGETTEXT = @XGETTEXT@
- YACC = @YACC@
- ac_ct_CC = @ac_ct_CC@
-@@ -232,9 +233,9 @@ sharedstatedir = @sharedstatedir@
- sysconfdir = @sysconfdir@
- target_alias = @target_alias@
- @MUDFLAP_FALSE@AM_CFLAGS = -Wall -Werror -Wshadow -Wunused -Wformat=2 \
--@MUDFLAP_FALSE@ -Wextra -std=gnu99
-+@MUDFLAP_FALSE@ $(WEXTRA) -std=gnu99
- @MUDFLAP_TRUE@AM_CFLAGS = -fmudflap -Wall -Werror -Wshadow -Wunused \
--@MUDFLAP_TRUE@ -Wformat=2 -Wextra -std=gnu99
-+@MUDFLAP_TRUE@ -Wformat=2 $(WEXTRA) -std=gnu99
- INCLUDES = -I. -I$(srcdir) -I$(srcdir)/../libelf -I.. -I$(srcdir)/../lib
- lib_LIBRARIES = libdw.a
- @MUDFLAP_FALSE@noinst_LIBRARIES = libdw_pic.a
---- elfutils/libebl/Makefile.am
-+++ elfutils/libebl/Makefile.am
-@@ -13,12 +13,13 @@
- ## 3001 King Ranch Road, Ukiah, CA 95482.
- ##
- DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H -DOBJDIR=\"$(shell pwd)\"
-+WEXTRA = @WEXTRA@
- if MUDFLAP
- AM_CFLAGS = -fmudflap
- else
- AM_CFLAGS =
- endif
--AM_CFLAGS += -fpic -Wall -Wshadow -Werror -Wunused -Wextra -Wformat=2 \
-+AM_CFLAGS += -fpic -Wall -Wshadow -Werror -Wunused $(WEXTRA) -Wformat=2 \
- -std=gnu99
-
- INCLUDES = -I$(srcdir) -I$(top_srcdir)/libelf -I$(top_srcdir)/lib -I..
---- elfutils/libebl/Makefile.in
-+++ elfutils/libebl/Makefile.in
-@@ -236,6 +236,7 @@ SHELL = @SHELL@
- STRIP = @STRIP@
- USE_NLS = @USE_NLS@
- VERSION = 1
-+WEXTRA = @WEXTRA@
- XGETTEXT = @XGETTEXT@
- YACC = @YACC@
- ac_ct_CC = @ac_ct_CC@
-@@ -278,9 +279,9 @@ sharedstatedir = @sharedstatedir@
- sysconfdir = @sysconfdir@
- target_alias = @target_alias@
- @MUDFLAP_FALSE@AM_CFLAGS = -fpic -Wall -Wshadow -Werror -Wunused \
--@MUDFLAP_FALSE@ -Wextra -Wformat=2 -std=gnu99
-+@MUDFLAP_FALSE@ $(WEXTRA) -Wformat=2 -std=gnu99
- @MUDFLAP_TRUE@AM_CFLAGS = -fmudflap -fpic -Wall -Wshadow -Werror \
--@MUDFLAP_TRUE@ -Wunused -Wextra -Wformat=2 -std=gnu99
-+@MUDFLAP_TRUE@ -Wunused $(WEXTRA) -Wformat=2 -std=gnu99
- INCLUDES = -I$(srcdir) -I$(top_srcdir)/libelf -I$(top_srcdir)/lib -I..
- lib_LIBRARIES = libebl.a
- modules = i386 sh mips x86_64 ia64 alpha arm sparc ppc ppc64
---- elfutils/libelf/Makefile.am
-+++ elfutils/libelf/Makefile.am
-@@ -16,12 +16,13 @@
- ## Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- ##
- DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H
-+WEXTRA = @WEXTRA@
- if MUDFLAP
- AM_CFLAGS = -fpic -fmudflap
- else
- AM_CFLAGS =
- endif
--AM_CFLAGS += -Wall -Wshadow -Werror -Wunused -Wextra -Wformat=2 -std=gnu99 \
-+AM_CFLAGS += -Wall -Wshadow -Werror -Wunused $(WEXTRA) -Wformat=2 -std=gnu99 \
- $($(*F)_CFLAGS)
- INCLUDES = -I$(srcdir) -I$(top_srcdir)/lib -I..
- GCC_INCLUDE = -I$(shell $(CC) -print-file-name=include)
---- elfutils/libelf/Makefile.in
-+++ elfutils/libelf/Makefile.in
-@@ -199,6 +199,7 @@ SHELL = @SHELL@
- STRIP = @STRIP@
- USE_NLS = @USE_NLS@
- VERSION = 1
-+WEXTRA = @WEXTRA@
- XGETTEXT = @XGETTEXT@
- YACC = @YACC@
- ac_ct_CC = @ac_ct_CC@
-@@ -240,10 +241,10 @@ sbindir = @sbindir@
- sharedstatedir = @sharedstatedir@
- sysconfdir = @sysconfdir@
- target_alias = @target_alias@
--@MUDFLAP_FALSE@AM_CFLAGS = -Wall -Wshadow -Werror -Wunused -Wextra \
-+@MUDFLAP_FALSE@AM_CFLAGS = -Wall -Wshadow -Werror -Wunused $(WEXTRA) \
- @MUDFLAP_FALSE@ -Wformat=2 -std=gnu99 $($(*F)_CFLAGS)
- @MUDFLAP_TRUE@AM_CFLAGS = -fpic -fmudflap -Wall -Wshadow -Werror \
--@MUDFLAP_TRUE@ -Wunused -Wextra -Wformat=2 -std=gnu99 \
-+@MUDFLAP_TRUE@ -Wunused $(WEXTRA) -Wformat=2 -std=gnu99 \
- @MUDFLAP_TRUE@ $($(*F)_CFLAGS)
- INCLUDES = -I$(srcdir) -I$(top_srcdir)/lib -I..
- GCC_INCLUDE = -I$(shell $(CC) -print-file-name=include)
---- elfutils/m4/Makefile.in
-+++ elfutils/m4/Makefile.in
-@@ -103,6 +103,7 @@ SHELL = @SHELL@
- STRIP = @STRIP@
- USE_NLS = @USE_NLS@
- VERSION = @VERSION@
-+WEXTRA = @WEXTRA@
- XGETTEXT = @XGETTEXT@
- YACC = @YACC@
- ac_ct_CC = @ac_ct_CC@
---- elfutils/src/Makefile.am
-+++ elfutils/src/Makefile.am
-@@ -14,14 +14,15 @@
- ##
- DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H $(YYDEBUG) \
- -DSRCDIR=\"$(shell cd $(srcdir);pwd)\" -DOBJDIR=\"$(shell pwd)\"
-+WEXTRA = @WEXTRA@
- if MUDFLAP
--AM_CFLAGS = -Wall -Wshadow -Wunused -Wextra -std=gnu99 -fmudflap \
-+AM_CFLAGS = -Wall -Wshadow -Wunused $(WEXTRA) -std=gnu99 -fmudflap \
- $(native_ld_cflags) $(if $($(*F)_no_Wunused),,-Wunused) \
- $(if $($(*F)_no_Wformat),,-Wformat=2)
- else
- AM_CFLAGS = -Wall -Wshadow -std=gnu99 $(native_ld_cflags) \
- $(if $($(*F)_no_Werror),,-Werror) \
-- $(if $($(*F)_no_Wunused),,-Wunused -Wextra) \
-+ $(if $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) \
- $(if $($(*F)_no_Wformat),,-Wformat=2)
- endif
- if MUDFLAP
---- elfutils/src/Makefile.in
-+++ elfutils/src/Makefile.in
-@@ -194,6 +194,7 @@ SHELL = @SHELL@
- STRIP = @STRIP@
- USE_NLS = @USE_NLS@
- VERSION = @VERSION@
-+WEXTRA = @WEXTRA@
- XGETTEXT = @XGETTEXT@
- YACC = @YACC@ -d
- ac_ct_CC = @ac_ct_CC@
-@@ -237,10 +238,10 @@ sysconfdir = @sysconfdir@
- target_alias = @target_alias@
- @MUDFLAP_FALSE@AM_CFLAGS = -Wall -Wshadow -std=gnu99 $(native_ld_cflags) \
- @MUDFLAP_FALSE@ $(if $($(*F)_no_Werror),,-Werror) \
--@MUDFLAP_FALSE@ $(if $($(*F)_no_Wunused),,-Wunused -Wextra) \
-+@MUDFLAP_FALSE@ $(if $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) \
- @MUDFLAP_FALSE@ $(if $($(*F)_no_Wformat),,-Wformat=2)
-
--@MUDFLAP_TRUE@AM_CFLAGS = -Wall -Wshadow -Wunused -Wextra -std=gnu99 -fmudflap \
-+@MUDFLAP_TRUE@AM_CFLAGS = -Wall -Wshadow -Wunused $(WEXTRA) -std=gnu99 -fmudflap \
- @MUDFLAP_TRUE@ $(native_ld_cflags) $(if $($(*F)_no_Wunused),,-Wunused) \
- @MUDFLAP_TRUE@ $(if $($(*F)_no_Wformat),,-Wformat=2)
-
---- elfutils/src/findtextrel.c
-+++ elfutils/src/findtextrel.c
-@@ -476,7 +476,11 @@ ptrcompare (const void *p1, const void *
-
-
- static void
--check_rel (size_t nsegments, struct segments segments[nsegments],
-+check_rel (size_t nsegments, struct segments segments[
-+#if __GNUC__ >= 4
-+ nsegments
-+#endif
-+ ],
- GElf_Addr addr, Elf *elf, Elf_Scn *symscn, Dwarf *dw,
- const char *fname, bool more_than_one, void **knownsrcs)
- {
---- elfutils/src/strip.c
-+++ elfutils/src/strip.c
-@@ -40,6 +40,12 @@
- #include <libebl.h>
- #include <system.h>
-
-+#ifdef HAVE_FUTIMES
-+# define FUTIMES(fd, fname, tvp) futimes (fd, tvp)
-+#else
-+# define FUTIMES(fd, fname, tvp) utimes (fname, tvp)
-+#endif
-+
-
- /* Name and version of program. */
- static void print_version (FILE *stream, struct argp_state *state);
-@@ -269,8 +275,18 @@ process_file (const char *fname)
-
- /* If we have to preserve the timestamp, we need it in the
- format utimes() understands. */
-+#ifdef HAVE_STRUCT_STAT_ST_ATIM
- TIMESPEC_TO_TIMEVAL (&tv[0], &pre_st.st_atim);
-+#else
-+ tv[0].tv_sec = pre_st.st_atime;
-+ tv[0].tv_usec = 0;
-+#endif
-+#ifdef HAVE_STRUCT_STAT_ST_MTIM
- TIMESPEC_TO_TIMEVAL (&tv[1], &pre_st.st_mtim);
-+#else
-+ tv[1].tv_sec = pre_st.st_atime;
-+ tv[1].tv_usec = 0;
-+#endif
- }
-
- /* Open the file. */
-@@ -1677,7 +1693,7 @@ handle_elf (int fd, Elf *elf, const char
- /* If requested, preserve the timestamp. */
- if (tvp != NULL)
- {
-- if (futimes (fd, tvp) != 0)
-+ if (FUTIMES (fd, output_fname, tvp) != 0)
- {
- error (0, errno, gettext ("\
- cannot set access and modification date of '%s'"),
-@@ -1734,7 +1750,7 @@ handle_ar (int fd, Elf *elf, const char
-
- if (tvp != NULL)
- {
-- if (unlikely (futimes (fd, tvp) != 0))
-+ if (unlikely (FUTIMES (fd, fname, tvp) != 0))
- {
- error (0, errno, gettext ("\
- cannot set access and modification date of '%s'"), fname);
---- elfutils/tests/Makefile.in
-+++ elfutils/tests/Makefile.in
-@@ -266,6 +266,7 @@ SHELL = @SHELL@
- STRIP = @STRIP@
- USE_NLS = @USE_NLS@
- VERSION = @VERSION@
-+WEXTRA = @WEXTRA@
- XGETTEXT = @XGETTEXT@
- YACC = @YACC@
- ac_ct_CC = @ac_ct_CC@
+++ /dev/null
-2005-05-17 Jakub Jelinek <jakub@redhat.com>
-
- * elf32_getphdr.c (elfw2(LIBELFBITS,getphdr)): Check if program header
- table fits into object's bounds.
- * elf_getshstrndx.c (elf_getshstrndx): Add elf->start_offset to
- elf->map_address. Check if first section header fits into object's
- bounds.
- * elf32_getshdr.c (elfw2(LIBELFBITS,getshdr)): Fix comment pasto.
- Check if section header table fits into object's bounds.
- * elf_begin.c (get_shnum): Fail if maxsize is smaller than ELF headers.
- Ensure first section header fits into object's bounds.
- (file_read_elf): Make sure scncnt is small enough to allocate both
- ElfXX_Shdr and Elf_Scn array. Make sure section and program header
- tables fit into object's bounds. Avoid memory leak on failure.
-
- * elflint.c (check_hash): Don't check entries beyond end of section.
- (check_note): Don't crash if gelf_rawchunk fails.
- (section_name): Return <invalid> if gelf_getshdr returns NULL.
-
---- elfutils-0.108/libelf/elf32_getphdr.c.jj 2005-02-06 10:14:52.000000000 +0100
-+++ elfutils-0.108/libelf/elf32_getphdr.c 2005-05-17 16:53:41.000000000 +0200
-@@ -80,6 +80,16 @@ elfw2(LIBELFBITS,getphdr) (elf)
-
- if (elf->map_address != NULL)
- {
-+ /* First see whether the information in the ELF header is
-+ valid and it does not ask for too much. */
-+ if (unlikely (ehdr->e_phoff >= elf->maximum_size)
-+ || unlikely (ehdr->e_phoff + size > elf->maximum_size))
-+ {
-+ /* Something is wrong. */
-+ __libelf_seterrno (ELF_E_INVALID_PHDR);
-+ goto out;
-+ }
-+
- /* All the data is already mapped. Use it. */
- if (ehdr->e_ident[EI_DATA] == MY_ELFDATA
- && (ALLOW_UNALIGNED
---- elfutils-0.108/libelf/elf_getshstrndx.c.jj 2004-01-05 21:45:05.000000000 +0100
-+++ elfutils-0.108/libelf/elf_getshstrndx.c 2005-05-17 15:42:32.000000000 +0200
-@@ -1,5 +1,5 @@
- /* Return section index of section header string table.
-- Copyright (C) 2002 Red Hat, Inc.
-+ Copyright (C) 2002, 2005 Red Hat, Inc.
- Written by Ulrich Drepper <drepper@redhat.com>, 2002.
-
- This program is free software; you can redistribute it and/or modify
-@@ -90,10 +90,25 @@ elf_getshstrndx (elf, dst)
- if (elf->map_address != NULL
- && elf->state.elf32.ehdr->e_ident[EI_DATA] == MY_ELFDATA
- && (ALLOW_UNALIGNED
-- || (((size_t) ((char *) elf->map_address + offset))
-+ || (((size_t) ((char *) elf->map_address
-+ + elf->start_offset + offset))
- & (__alignof__ (Elf32_Shdr) - 1)) == 0))
-- /* We can directly access the memory. */
-- num = ((Elf32_Shdr *) (elf->map_address + offset))->sh_link;
-+ {
-+ /* First see whether the information in the ELF header is
-+ valid and it does not ask for too much. */
-+ if (unlikely (offset + sizeof (Elf32_Shdr)
-+ > elf->maximum_size))
-+ {
-+ /* Something is wrong. */
-+ __libelf_seterrno (ELF_E_INVALID_SECTION_HEADER);
-+ result = -1;
-+ goto out;
-+ }
-+
-+ /* We can directly access the memory. */
-+ num = ((Elf32_Shdr *) (elf->map_address + elf->start_offset
-+ + offset))->sh_link;
-+ }
- else
- {
- /* We avoid reading in all the section headers. Just read
-@@ -129,10 +144,25 @@ elf_getshstrndx (elf, dst)
- if (elf->map_address != NULL
- && elf->state.elf64.ehdr->e_ident[EI_DATA] == MY_ELFDATA
- && (ALLOW_UNALIGNED
-- || (((size_t) ((char *) elf->map_address + offset))
-+ || (((size_t) ((char *) elf->map_address
-+ + elf->start_offset + offset))
- & (__alignof__ (Elf64_Shdr) - 1)) == 0))
-- /* We can directly access the memory. */
-- num = ((Elf64_Shdr *) (elf->map_address + offset))->sh_link;
-+ {
-+ /* First see whether the information in the ELF header is
-+ valid and it does not ask for too much. */
-+ if (unlikely (offset + sizeof (Elf64_Shdr)
-+ > elf->maximum_size))
-+ {
-+ /* Something is wrong. */
-+ __libelf_seterrno (ELF_E_INVALID_SECTION_HEADER);
-+ result = -1;
-+ goto out;
-+ }
-+
-+ /* We can directly access the memory. */
-+ num = ((Elf64_Shdr *) (elf->map_address
-+ + elf->start_offset + offset))->sh_link;
-+ }
- else
- {
- /* We avoid reading in all the section headers. Just read
---- elfutils-0.108/libelf/elf32_getshdr.c.jj 2005-05-14 00:32:57.000000000 +0200
-+++ elfutils-0.108/libelf/elf32_getshdr.c 2005-05-17 15:27:52.000000000 +0200
-@@ -71,7 +71,7 @@ elfw2(LIBELFBITS,getshdr) (scn)
- goto out;
- size_t size = shnum * sizeof (ElfW2(LIBELFBITS,Shdr));
-
-- /* Allocate memory for the program headers. We know the number
-+ /* Allocate memory for the section headers. We know the number
- of entries from the ELF header. */
- ElfW2(LIBELFBITS,Shdr) *shdr = elf->state.ELFW(elf,LIBELFBITS).shdr =
- (ElfW2(LIBELFBITS,Shdr) *) malloc (size);
-@@ -93,6 +93,16 @@ elfw2(LIBELFBITS,getshdr) (scn)
- && (ehdr->e_shoff
- & (__alignof__ (ElfW2(LIBELFBITS,Shdr)) - 1)) != 0));
-
-+ /* First see whether the information in the ELF header is
-+ valid and it does not ask for too much. */
-+ if (unlikely (ehdr->e_shoff >= elf->maximum_size)
-+ || unlikely (ehdr->e_shoff + size > elf->maximum_size))
-+ {
-+ /* Something is wrong. */
-+ __libelf_seterrno (ELF_E_INVALID_SECTION_HEADER);
-+ goto free_and_out;
-+ }
-+
- /* Now copy the data and at the same time convert the byte
- order. */
- if (ALLOW_UNALIGNED
---- elfutils-0.108/libelf/elf_begin.c.jj 2005-05-17 16:18:51.000000000 +0200
-+++ elfutils-0.108/libelf/elf_begin.c 2005-05-17 17:31:37.000000000 +0200
-@@ -77,7 +77,11 @@ get_shnum (void *map_address, unsigned c
- || (((size_t) ((char *) map_address + offset))
- & ((is32 ? __alignof__ (Elf32_Ehdr) : __alignof__ (Elf64_Ehdr))
- - 1)) == 0))
-- ehdr.p = (char *) map_address + offset;
-+ {
-+ ehdr.p = (char *) map_address + offset;
-+ if (maxsize < (is32 ? sizeof (Elf32_Ehdr) : sizeof (Elf64_Ehdr)))
-+ return (size_t) -1l;
-+ }
- else
- {
- /* We have to read the data from the file. */
-@@ -111,7 +115,8 @@ get_shnum (void *map_address, unsigned c
-
- if (unlikely (result == 0) && ehdr.e32->e_shoff != 0)
- {
-- if (offset + ehdr.e32->e_shoff + sizeof (Elf32_Shdr) > maxsize)
-+ if (unlikely (ehdr.e32->e_shoff >= maxsize)
-+ || unlikely (ehdr.e32->e_shoff + sizeof (Elf32_Shdr) > maxsize))
- /* Cannot read the first section header. */
- return (size_t) -1l;
-
-@@ -147,7 +152,8 @@ get_shnum (void *map_address, unsigned c
-
- if (unlikely (result == 0) && ehdr.e64->e_shoff != 0)
- {
-- if (offset + ehdr.e64->e_shoff + sizeof (Elf64_Shdr) > maxsize)
-+ if (unlikely (ehdr.e64->e_shoff >= maxsize)
-+ || unlikely (ehdr.e64->e_shoff + sizeof (Elf64_Shdr) > maxsize))
- /* Cannot read the first section header. */
- return (size_t) -1l;
-
-@@ -220,10 +226,19 @@ file_read_elf (int fildes, void *map_add
-
- /* Determine the number of sections. */
- scncnt = get_shnum (map_address, e_ident, fildes, offset, maxsize);
-- if (scncnt == (size_t) -1l || scncnt > SIZE_MAX / sizeof (Elf_Scn))
-+ if (scncnt == (size_t) -1l)
- /* Could not determine the number of sections. */
- return NULL;
-
-+ /* Check for too many sections. */
-+ if (e_ident[EI_CLASS] == ELFCLASS32)
-+ {
-+ if (scncnt > SIZE_MAX / (sizeof (Elf_Scn) + sizeof (Elf32_Shdr)))
-+ return NULL;
-+ }
-+ else if (scncnt > SIZE_MAX / (sizeof (Elf_Scn) + sizeof (Elf64_Shdr)))
-+ return NULL;
-+
- /* We can now allocate the memory. */
- elf = allocate_elf (fildes, map_address, offset, maxsize, cmd, parent,
- ELF_K_ELF, scncnt * sizeof (Elf_Scn));
-@@ -255,15 +270,31 @@ file_read_elf (int fildes, void *map_add
- /* We can use the mmapped memory. */
- elf->state.elf32.ehdr =
- (Elf32_Ehdr *) ((char *) map_address + offset);
-+ if (unlikely (elf->state.elf32.ehdr->e_shoff >= maxsize)
-+ || unlikely (elf->state.elf32.ehdr->e_shoff
-+ + scncnt * sizeof (Elf32_Shdr) > maxsize))
-+ {
-+ free_and_out:
-+ __libelf_seterrno (ELF_E_INVALID_FILE);
-+ free (elf);
-+ return NULL;
-+ }
- elf->state.elf32.shdr =
- (Elf32_Shdr *) ((char *) map_address + offset
- + elf->state.elf32.ehdr->e_shoff);
- if (elf->state.elf32.ehdr->e_phnum)
-- /* Assign a value only if there really is a program
-- header. Otherwise the value remains NULL. */
-- elf->state.elf32.phdr
-- = (Elf32_Phdr *) ((char *) map_address + offset
-- + elf->state.elf32.ehdr->e_phoff);
-+ {
-+ /* Assign a value only if there really is a program
-+ header. Otherwise the value remains NULL. */
-+ if (unlikely (elf->state.elf32.ehdr->e_phoff >= maxsize)
-+ || unlikely (elf->state.elf32.ehdr->e_phoff
-+ + elf->state.elf32.ehdr->e_phnum
-+ * sizeof (Elf32_Phdr) > maxsize))
-+ goto free_and_out;
-+ elf->state.elf32.phdr
-+ = (Elf32_Phdr *) ((char *) map_address + offset
-+ + elf->state.elf32.ehdr->e_phoff);
-+ }
-
- for (size_t cnt = 0; cnt < scncnt; ++cnt)
- {
-@@ -285,8 +316,7 @@ file_read_elf (int fildes, void *map_add
- sizeof (Elf32_Ehdr), offset) != sizeof (Elf32_Ehdr))
- {
- /* We must be able to read the ELF header. */
-- __libelf_seterrno (ELF_E_INVALID_FILE);
-- return NULL;
-+ goto free_and_out;
- }
-
- if (e_ident[EI_DATA] != MY_ELFDATA)
-@@ -340,15 +370,26 @@ file_read_elf (int fildes, void *map_add
- /* We can use the mmapped memory. */
- elf->state.elf64.ehdr =
- (Elf64_Ehdr *) ((char *) map_address + offset);
-+ if (unlikely (elf->state.elf64.ehdr->e_shoff >= maxsize)
-+ || unlikely (elf->state.elf64.ehdr->e_shoff
-+ + scncnt * sizeof (Elf64_Shdr) > maxsize))
-+ goto free_and_out;
- elf->state.elf64.shdr =
- (Elf64_Shdr *) ((char *) map_address + offset
- + elf->state.elf64.ehdr->e_shoff);
- if (elf->state.elf64.ehdr->e_phnum)
-- /* Assign a value only if there really is a program
-- header. Otherwise the value remains NULL. */
-- elf->state.elf64.phdr
-- = (Elf64_Phdr *) ((char *) map_address + offset
-- + elf->state.elf64.ehdr->e_phoff);
-+ {
-+ /* Assign a value only if there really is a program
-+ header. Otherwise the value remains NULL. */
-+ if (unlikely (elf->state.elf64.ehdr->e_phoff >= maxsize)
-+ || unlikely (elf->state.elf64.ehdr->e_phoff
-+ + elf->state.elf64.ehdr->e_phnum
-+ * sizeof (Elf64_Phdr) > maxsize))
-+ goto free_and_out;
-+ elf->state.elf64.phdr
-+ = (Elf64_Phdr *) ((char *) map_address + offset
-+ + elf->state.elf64.ehdr->e_phoff);
-+ }
-
- for (size_t cnt = 0; cnt < scncnt; ++cnt)
- {
-@@ -370,8 +411,7 @@ file_read_elf (int fildes, void *map_add
- sizeof (Elf64_Ehdr), offset) != sizeof (Elf64_Ehdr))
- {
- /* We must be able to read the ELF header. */
-- __libelf_seterrno (ELF_E_INVALID_FILE);
-- return NULL;
-+ goto free_and_out;
- }
-
- if (e_ident[EI_DATA] != MY_ELFDATA)
---- elfutils-0.108/src/elflint.c.jj 2005-05-14 02:22:24.000000000 +0200
-+++ elfutils-0.108/src/elflint.c 2005-05-17 18:02:00.000000000 +0200
-@@ -309,6 +309,8 @@ section_name (Ebl *ebl, int idx)
- return "<invalid>";
-
- shdr = gelf_getshdr (elf_getscn (ebl->elf, idx), &shdr_mem);
-+ if (shdr == NULL)
-+ return "<invalid>";
-
- ret = elf_strptr (ebl->elf, shstrndx, shdr->sh_name);
- if (ret == NULL)
-@@ -1639,19 +1641,26 @@ section [%2d] '%s': hash table section i
- {
- size_t symsize = symshdr->sh_size / symshdr->sh_entsize;
- size_t cnt;
-+ Elf32_Word *buf, *end;
-
- if (nchain < symshdr->sh_size / symshdr->sh_entsize)
- ERROR (gettext ("section [%2d] '%s': chain array not large enough\n"),
- idx, section_name (ebl, idx));
-
-+ buf = ((Elf32_Word *) data->d_buf) + 2;
-+ end = (Elf32_Word *) ((char *) data->d_buf + shdr->sh_size);
- for (cnt = 2; cnt < 2 + nbucket; ++cnt)
-- if (((Elf32_Word *) data->d_buf)[cnt] >= symsize)
-+ if (buf >= end)
-+ return;
-+ else if (*buf++ >= symsize)
- ERROR (gettext ("\
- section [%2d] '%s': hash bucket reference %zu out of bounds\n"),
- idx, section_name (ebl, idx), cnt - 2);
-
- for (; cnt < 2 + nbucket + nchain; ++cnt)
-- if (((Elf32_Word *) data->d_buf)[cnt] >= symsize)
-+ if (buf >= end)
-+ return;
-+ else if (*buf++ >= symsize)
- ERROR (gettext ("\
- section [%2d] '%s': hash chain reference %zu out of bounds\n"),
- idx, section_name (ebl, idx), cnt - 2 - nbucket);
-@@ -2311,6 +2320,8 @@ phdr[%d]: no note entries defined for th
- return;
-
- char *notemem = gelf_rawchunk (ebl->elf, phdr->p_offset, phdr->p_filesz);
-+ if (notemem == NULL)
-+ return;
-
- /* ELF64 files often use note section entries in the 32-bit format.
- The p_align field is set to 8 in case the 64-bit format is used.