]> git.pld-linux.org Git - packages/elfutils.git/commitdiff
- update for 0.145 merged from FC.
authorPaweł Sikora <pluto@pld-linux.org>
Thu, 11 Mar 2010 12:05:50 +0000 (12:05 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    elfutils-portability.patch -> 1.17
    elfutils-robustify.patch -> 1.12

elfutils-portability.patch
elfutils-robustify.patch

index cf387319d891f7600f15fc2156cd4ded48df7d9f..94874ed6ff0ef89a9eddd9df17d1069b93575352 100644 (file)
+--- elfutils/backends/ChangeLog
++++ elfutils/backends/ChangeLog
+@@ -88,6 +88,10 @@
+       * ppc_attrs.c (ppc_check_object_attribute): Handle tag
+       GNU_Power_ABI_Struct_Return.
++2009-01-23  Roland McGrath  <roland@redhat.com>
++
++      * Makefile.am (libebl_%.so): Use $(LD_AS_NEEDED).
++
+ 2008-10-04  Ulrich Drepper  <drepper@redhat.com>
+       * i386_reloc.def: Fix entries for TLS_GOTDESC, TLS_DESC_CALL, and
+@@ -415,6 +419,11 @@
+       * sparc_init.c: Likewise.
+       * x86_64_init.c: Likewise.
++2005-11-22  Roland McGrath  <roland@redhat.com>
++
++      * Makefile.am (LD_AS_NEEDED): New variable, substituted by configure.
++      (libebl_%.so rule): Use it in place of -Wl,--as-needed.
++
+ 2005-11-19  Roland McGrath  <roland@redhat.com>
+       * ppc64_reloc.def: REL30 -> ADDR30.
+@@ -437,6 +446,9 @@
+       * Makefile.am (uninstall): Don't try to remove $(pkgincludedir).
+       (CLEANFILES): Add libebl_$(m).so.
++      * Makefile.am (WEXTRA): New variable, substituted by configure.
++      (AM_CFLAGS): Use it in place of -Wextra.
++
+       * ppc_reloc.def: Update bits per Alan Modra <amodra@bigpond.net.au>.
+       * ppc64_reloc.def: Likewise.
 --- elfutils/backends/Makefile.am
 +++ elfutils/backends/Makefile.am
-@@ -25,12 +25,14 @@
+@@ -103,7 +103,7 @@ libebl_%.so libebl_%.map: libebl_%_pic.a
+       $(LINK) -shared -o $(@:.map=.so) \
+               -Wl,--whole-archive $< $(cpu_$*) -Wl,--no-whole-archive \
+               -Wl,--version-script,$(@:.so=.map) \
+-              -Wl,-z,defs -Wl,--as-needed $(libelf) $(libdw) $(libmudflap)
++              -Wl,-z,defs $(LD_AS_NEEDED) $(libelf) $(libdw) $(libmudflap)
+       $(textrel_check)
+ libebl_i386.so: $(cpu_i386)
+--- elfutils/backends/Makefile.in
++++ elfutils/backends/Makefile.in
+@@ -164,6 +164,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
+ INSTALL_SCRIPT = @INSTALL_SCRIPT@
+ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+ LDFLAGS = @LDFLAGS@
++LD_AS_NEEDED = @LD_AS_NEEDED@
+ LEX = @LEX@
+ LEXLIB = @LEXLIB@
+ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+@@ -193,6 +194,7 @@ SHELL = @SHELL@
+ STRIP = @STRIP@
+ USE_NLS = @USE_NLS@
+ VERSION = @VERSION@
++WEXTRA = @WEXTRA@
+ XGETTEXT = @XGETTEXT@
+ XGETTEXT_015 = @XGETTEXT_015@
+ YACC = @YACC@
+@@ -255,7 +257,7 @@ INCLUDES = -I. -I$(srcdir) -I$(top_srcdi
+       -I$(top_srcdir)/libelf -I$(top_srcdir)/libdw
+ AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \
+       $($(*F)_no_Werror),,-Werror) $(if \
+-      $($(*F)_no_Wunused),,-Wunused -Wextra) $(if \
++      $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \
+       $($(*F)_no_Wformat),-Wno-format,-Wformat=2) $($(*F)_CFLAGS) \
+       $(am__append_1)
+ @MUDFLAP_FALSE@libmudflap = 
+@@ -693,7 +695,7 @@ libebl_%.so libebl_%.map: libebl_%_pic.a
+       $(LINK) -shared -o $(@:.map=.so) \
+               -Wl,--whole-archive $< $(cpu_$*) -Wl,--no-whole-archive \
+               -Wl,--version-script,$(@:.so=.map) \
+-              -Wl,-z,defs -Wl,--as-needed $(libelf) $(libdw) $(libmudflap)
++              -Wl,-z,defs $(LD_AS_NEEDED) $(libelf) $(libdw) $(libmudflap)
+       $(textrel_check)
+ libebl_i386.so: $(cpu_i386)
+--- elfutils/ChangeLog
++++ elfutils/ChangeLog
+@@ -1,3 +1,7 @@
++2009-11-22  Roland McGrath  <roland@redhat.com>
++
++      * configure.ac: Use sed and expr instead of modern bash extensions.
++
+ 2009-09-21  Ulrich Drepper  <drepper@redhat.com>
+       * configure.ac: Update for more modern autoconf.
+@@ -6,6 +10,10 @@
+       * configure.ac (zip_LIBS): Check for liblzma too.
++2009-08-17  Roland McGrath  <roland@redhat.com>
++
++      * configure.ac: Check for -fgnu89-inline; add it to WEXTRA if it works.
++
+ 2009-04-19  Roland McGrath  <roland@redhat.com>
+       * configure.ac (eu_version): Round down here, not in version.h macros.
+@@ -17,6 +25,8 @@
+ 2009-01-23  Roland McGrath  <roland@redhat.com>
++      * configure.ac: Check for __builtin_popcount.
++
+       * configure.ac (zlib check): Check for gzdirect, need zlib >= 1.2.2.3.
+       * configure.ac (__thread check): Use AC_LINK_IFELSE, in case of
+@@ -97,6 +107,10 @@
+       * configure.ac: Add dummy automake conditional to get dependencies
+       for non-generic linker right.  See src/Makefile.am.
++2005-11-22  Roland McGrath  <roland@redhat.com>
++
++      * configure.ac: Check for --as-needed linker option.
++
+ 2005-11-18  Roland McGrath  <roland@redhat.com>
+       * Makefile.am (DISTCHECK_CONFIGURE_FLAGS): New variable.
+@@ -144,6 +158,17 @@
+       * Makefile.am (all_SUBDIRS): Add libdwfl.
+       * configure.ac: Write libdwfl/Makefile.
++2005-05-31  Roland McGrath  <roland@redhat.com>
++
++      * configure.ac (WEXTRA): Check for -Wextra and set this substitution.
++
++      * 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-05-19  Roland McGrath  <roland@redhat.com>
+       * configure.ac [AH_BOTTOM] (INTDECL, _INTDECL): New macros.
+--- elfutils/config/eu.am
++++ elfutils/config/eu.am
+@@ -25,11 +25,14 @@
  ## <http://www.openinventionnetwork.com>.
  ##
- DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H -DOBJDIR=\"$(shell pwd)\"
 +WEXTRA = @WEXTRA@
 +LD_AS_NEEDED = @LD_AS_NEEDED@
- 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)/libebl -I$(top_srcdir)/libasm \
-          -I$(top_srcdir)/libelf -I$(top_srcdir)/libdw \
-@@ -59,7 +61,6 @@ endif
- textrel_check = if readelf -d $@ | fgrep -q TEXTREL; then exit 1; fi
--
- i386_SRCS = i386_init.c i386_symbol.c i386_corenote.c \
-           i386_retval.c i386_regs.c i386_auxv.c i386_syscall.c
- cpu_i386 = ../libcpu/libcpu_i386.a
++
+ DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H
+ INCLUDES = -I. -I$(srcdir) -I$(top_srcdir)/lib -I..
+ AM_CFLAGS = -std=gnu99 -Wall -Wshadow \
+           $(if $($(*F)_no_Werror),,-Werror) \
+-          $(if $($(*F)_no_Wunused),,-Wunused -Wextra) \
++          $(if $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) \
+           $(if $($(*F)_no_Wformat),-Wno-format,-Wformat=2) \
+           $($(*F)_CFLAGS)
+--- elfutils/config/Makefile.in
++++ elfutils/config/Makefile.in
+@@ -76,6 +76,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
+ INSTALL_SCRIPT = @INSTALL_SCRIPT@
+ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+ LDFLAGS = @LDFLAGS@
++LD_AS_NEEDED = @LD_AS_NEEDED@
+ LEX = @LEX@
+ LEXLIB = @LEXLIB@
+ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+@@ -105,6 +106,7 @@ SHELL = @SHELL@
+ STRIP = @STRIP@
+ USE_NLS = @USE_NLS@
+ VERSION = @VERSION@
++WEXTRA = @WEXTRA@
+ XGETTEXT = @XGETTEXT@
+ XGETTEXT_015 = @XGETTEXT_015@
+ YACC = @YACC@
+--- elfutils/config.h.in
++++ elfutils/config.h.in
+@@ -1,5 +1,8 @@
+ /* config.h.in.  Generated from configure.ac by autoheader.  */
++/* Have __builtin_popcount. */
++#undef HAVE_BUILTIN_POPCOUNT
++
+ /* $libdir subdirectory containing libebl modules. */
+ #undef LIBEBL_SUBDIR
+@@ -55,4 +58,7 @@
+ /* Define for large files, on AIX-style hosts. */
+ #undef _LARGE_FILES
++/* Stubbed out if missing compiler support. */
++#undef __thread
++
+ #include <eu-config.h>
+--- elfutils/configure
++++ elfutils/configure
+@@ -646,6 +646,8 @@ NATIVE_LD_FALSE
+ NATIVE_LD_TRUE
+ DATADIRNAME
+ LOCALEDIR
++LD_AS_NEEDED
++WEXTRA
+ LEXLIB
+ LEX_OUTPUT_ROOT
+ LEX
+@@ -4098,6 +4100,205 @@ $as_echo "$as_me: error: gcc with C99 su
+ fi
++{ $as_echo "$as_me:$LINENO: checking for -Wextra option to $CC" >&5
++$as_echo_n "checking for -Wextra option to $CC... " >&6; }
++if test "${ac_cv_cc_wextra+set}" = set; then
++  $as_echo_n "(cached) " >&6
++else
++  old_CFLAGS="$CFLAGS"
++CFLAGS="$CFLAGS -Wextra"
++cat >conftest.$ac_ext <<_ACEOF
++void foo (void) { }
++_ACEOF
++rm -f conftest.$ac_objext
++if { (ac_try="$ac_compile"
++case "(($ac_try" in
++  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++  *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++  (eval "$ac_compile") 2>conftest.er1
++  ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
++  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); } && {
++       test -z "$ac_c_werror_flag" ||
++       test ! -s conftest.err
++       } && test -s conftest.$ac_objext; then
++  ac_cv_cc_wextra=yes
++else
++  $as_echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++      ac_cv_cc_wextra=no
++fi
++
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
++CFLAGS="$old_CFLAGS"
++fi
++{ $as_echo "$as_me:$LINENO: result: $ac_cv_cc_wextra" >&5
++$as_echo "$ac_cv_cc_wextra" >&6; }
++
++if test "x$ac_cv_cc_wextra" = xyes; then
++  WEXTRA=-Wextra
++else
++  WEXTRA=-W
++fi
++
++
++{ $as_echo "$as_me:$LINENO: checking for -fgnu89-inline option to $CC" >&5
++$as_echo_n "checking for -fgnu89-inline option to $CC... " >&6; }
++if test "${ac_cv_cc_gnu89_inline+set}" = set; then
++  $as_echo_n "(cached) " >&6
++else
++  old_CFLAGS="$CFLAGS"
++CFLAGS="$CFLAGS -fgnu89-inline -Werror"
++cat >conftest.$ac_ext <<_ACEOF
++
++void foo (void)
++{
++  inline void bar (void) {}
++  bar ();
++}
++extern inline void baz (void) {}
++
++_ACEOF
++rm -f conftest.$ac_objext
++if { (ac_try="$ac_compile"
++case "(($ac_try" in
++  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++  *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++  (eval "$ac_compile") 2>conftest.er1
++  ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
++  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); } && {
++       test -z "$ac_c_werror_flag" ||
++       test ! -s conftest.err
++       } && test -s conftest.$ac_objext; then
++  ac_cv_cc_gnu89_inline=yes
++else
++  $as_echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++      ac_cv_cc_gnu89_inline=no
++fi
++
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
++CFLAGS="$old_CFLAGS"
++fi
++{ $as_echo "$as_me:$LINENO: result: $ac_cv_cc_gnu89_inline" >&5
++$as_echo "$ac_cv_cc_gnu89_inline" >&6; }
++if test "x$ac_cv_cc_gnu89_inline" = xyes; then
++  WEXTRA="${WEXTRA:+$WEXTRA }-fgnu89-inline"
++fi
++
++
++{ $as_echo "$as_me:$LINENO: checking for --as-needed linker option" >&5
++$as_echo_n "checking for --as-needed linker option... " >&6; }
++if test "${ac_cv_as_needed+set}" = set; then
++  $as_echo_n "(cached) " >&6
++else
++  cat > conftest.c <<EOF
++int main (void) { return 0; }
++EOF
++if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
++                          -fPIC -shared -o conftest.so conftest.c
++                          -Wl,--as-needed 1>&5'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; }
++then
++  ac_cv_as_needed=yes
++else
++  ac_cv_as_needed=no
++fi
++rm -f conftest*
++fi
++{ $as_echo "$as_me:$LINENO: result: $ac_cv_as_needed" >&5
++$as_echo "$ac_cv_as_needed" >&6; }
++if test "x$ac_cv_as_needed" = xyes; then
++  LD_AS_NEEDED=-Wl,--as-needed
++else
++  LD_AS_NEEDED=
++fi
++
++
++
++{ $as_echo "$as_me:$LINENO: checking for __builtin_popcount" >&5
++$as_echo_n "checking for __builtin_popcount... " >&6; }
++if test "${ac_cv_popcount+set}" = set; then
++  $as_echo_n "(cached) " >&6
++else
++  cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h.  */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h.  */
++
++int
++main ()
++{
++exit (__builtin_popcount (127));
++  ;
++  return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext conftest$ac_exeext
++if { (ac_try="$ac_link"
++case "(($ac_try" in
++  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++  *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++  (eval "$ac_link") 2>conftest.er1
++  ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
++  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); } && {
++       test -z "$ac_c_werror_flag" ||
++       test ! -s conftest.err
++       } && test -s conftest$ac_exeext && {
++       test "$cross_compiling" = yes ||
++       $as_test_x conftest$ac_exeext
++       }; then
++  ac_cv_popcount=yes
++else
++  $as_echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++      ac_cv_popcount=no
++fi
++
++rm -rf conftest.dSYM
++rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
++      conftest$ac_exeext conftest.$ac_ext
++fi
++{ $as_echo "$as_me:$LINENO: result: $ac_cv_popcount" >&5
++$as_echo "$ac_cv_popcount" >&6; }
++if test "x$ac_cv_popcount" = xyes; then
++
++cat >>confdefs.h <<\_ACEOF
++#define HAVE_BUILTIN_POPCOUNT 1
++_ACEOF
++
++fi
++
++
+ { $as_echo "$as_me:$LINENO: checking for __thread support" >&5
+ $as_echo_n "checking for __thread support... " >&6; }
+ if test "${ac_cv_tls+set}" = set; then
+@@ -4163,9 +4364,18 @@ fi
+ { $as_echo "$as_me:$LINENO: result: $ac_cv_tls" >&5
+ $as_echo "$ac_cv_tls" >&6; }
+ if test "x$ac_cv_tls" != xyes; then
+-  { { $as_echo "$as_me:$LINENO: error: __thread support required" >&5
+-$as_echo "$as_me: error: __thread support required" >&2;}
++  if test "$use_locks" = yes; then
++  { { $as_echo "$as_me:$LINENO: error: --enable-thread-safety requires __thread support" >&5
++$as_echo "$as_me: error: --enable-thread-safety requires __thread support" >&2;}
+    { (exit 1); exit 1; }; }
++else
++
++cat >>confdefs.h <<\_ACEOF
++#define __thread /* empty: no multi-thread support */
++_ACEOF
++
++fi
++
+ fi
+@@ -5460,7 +5670,7 @@ ac_config_files="$ac_config_files versio
+ # 1.234<whatever> -> 1234<whatever>
+ case "$PACKAGE_VERSION" in
+-[0-9].*) eu_version="${PACKAGE_VERSION/./}" ;;
++[0-9].*) eu_version=`echo "$PACKAGE_VERSION" | sed 's@\.@@'` ;;
+ *)               { { $as_echo "$as_me:$LINENO: error: confused by version number '$PACKAGE_VERSION'" >&5
+ $as_echo "$as_me: error: confused by version number '$PACKAGE_VERSION'" >&2;}
+    { (exit 1); exit 1; }; } ;;
+@@ -5495,7 +5705,7 @@ $as_echo "$as_me: error: confused by ver
+ esac
+ # Round up to the next release API (x.y) version.
+-eu_version=$[($eu_version + 999) / 1000]
++eu_version=`expr \( $eu_version + 999 \) / 1000`
+ cat >confcache <<\_ACEOF
+ # This file is a shell script that caches the results of configure
 --- elfutils/configure.ac
 +++ elfutils/configure.ac
-@@ -74,6 +74,34 @@ CFLAGS="$old_CFLAGS"])
+@@ -73,6 +73,54 @@ CFLAGS="$old_CFLAGS"])
  AS_IF([test "x$ac_cv_c99" != xyes],
        AC_MSG_ERROR([gcc with C99 support required]))
  
 +AC_SUBST(WEXTRA)
 +AS_IF([test "x$ac_cv_cc_wextra" = xyes], [WEXTRA=-Wextra], [WEXTRA=-W])
 +
++AC_CACHE_CHECK([for -fgnu89-inline option to $CC], ac_cv_cc_gnu89_inline, [dnl
++old_CFLAGS="$CFLAGS"
++CFLAGS="$CFLAGS -fgnu89-inline -Werror"
++AC_COMPILE_IFELSE([
++void foo (void)
++{
++  inline void bar (void) {}
++  bar ();
++}
++extern inline void baz (void) {}
++], ac_cv_cc_gnu89_inline=yes, ac_cv_cc_gnu89_inline=no)
++CFLAGS="$old_CFLAGS"])
++AS_IF([test "x$ac_cv_cc_gnu89_inline" = xyes],
++      [WEXTRA="${WEXTRA:+$WEXTRA }-fgnu89-inline"])
++
 +AC_CACHE_CHECK([for --as-needed linker option],
 +             ac_cv_as_needed, [dnl
 +cat > conftest.c <<EOF
 +      [LD_AS_NEEDED=-Wl,--as-needed], [LD_AS_NEEDED=])
 +AC_SUBST(LD_AS_NEEDED)
 +
++AC_CACHE_CHECK([for __builtin_popcount], ac_cv_popcount, [dnl
++AC_LINK_IFELSE([AC_LANG_PROGRAM([], [[exit (__builtin_popcount (127));]])],
++             ac_cv_popcount=yes, ac_cv_popcount=no)])
++AS_IF([test "x$ac_cv_popcount" = xyes],
++      [AC_DEFINE([HAVE_BUILTIN_POPCOUNT], [1], [Have __builtin_popcount.])])
 +
+ AC_CACHE_CHECK([for __thread support], ac_cv_tls, [dnl
+ # Use the same flags that we use for our DSOs, so the test is representative.
+ # Some old compiler/linker/libc combinations fail some ways and not others.
+@@ -88,7 +136,10 @@ static __thread int a; int foo (int b) {
+ CFLAGS="$save_CFLAGS"
+ LDFLAGS="$save_LDFLAGS"])
+ AS_IF([test "x$ac_cv_tls" != xyes],
+-      AC_MSG_ERROR([__thread support required]))
++      [AS_IF([test "$use_locks" = yes],
++           [AC_MSG_ERROR([--enable-thread-safety requires __thread support])],
++           [AC_DEFINE([__thread], [/* empty: no multi-thread support */],
++                      [Stubbed out if missing compiler support.])])])
  LOCALEDIR=$datadir
  AC_SUBST(LOCALEDIR)
- AC_DEFINE_UNQUOTED(LOCALEDIR, "$LOCALEDIR")
---- elfutils/lib/Makefile.am
-+++ elfutils/lib/Makefile.am
-@@ -25,12 +25,13 @@
- ## <http://www.openinventionnetwork.com>.
- ##
- 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/libasm/Makefile.am
-+++ elfutils/libasm/Makefile.am
-@@ -25,12 +25,13 @@
- ## <http://www.openinventionnetwork.com>.
- ##
- DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H
+@@ -259,7 +310,7 @@ AC_SUBST([eu_version])
+ # 1.234<whatever> -> 1234<whatever>
+ case "$PACKAGE_VERSION" in
+-[[0-9]].*) eu_version="${PACKAGE_VERSION/./}" ;;
++[[0-9]].*) eu_version=`echo "$PACKAGE_VERSION" | sed 's@\.@@'` ;;
+ *)               AC_MSG_ERROR([confused by version number '$PACKAGE_VERSION']) ;;
+ esac
+ case "$eu_version" in
+@@ -288,6 +339,6 @@ case "$eu_version" in
+ esac
+ # Round up to the next release API (x.y) version.
+-[eu_version=$[($eu_version + 999) / 1000]]
++eu_version=`expr \( $eu_version + 999 \) / 1000`
+ AC_OUTPUT
+--- elfutils/lib/ChangeLog
++++ elfutils/lib/ChangeLog
+@@ -8,6 +8,9 @@
+ 2009-01-23  Roland McGrath  <roland@redhat.com>
++      * eu-config.h [! HAVE_BUILTIN_POPCOUNT]
++      (__builtin_popcount): New inline function.
++
+       * eu-config.h: Add multiple inclusion protection.
+ 2009-01-17  Ulrich Drepper  <drepper@redhat.com>
+@@ -64,6 +67,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/eu-config.h
++++ elfutils/lib/eu-config.h
+@@ -182,6 +182,17 @@ asm (".section predict_data, \"aw\"; .pr
+ /* This macro is used by the tests conditionalize for standalone building.  */
+ #define ELFUTILS_HEADER(name) <lib##name.h>
++#ifndef HAVE_BUILTIN_POPCOUNT
++# define __builtin_popcount hakmem_popcount
++static inline unsigned int __attribute__ ((unused))
++hakmem_popcount (unsigned int x)
++{
++  /* HAKMEM 169 */
++  unsigned int n = x - ((x >> 1) & 033333333333) - ((x >> 2) & 011111111111);
++  return ((n + (n >> 3)) & 030707070707) % 63;
++}
++#endif        /* HAVE_BUILTIN_POPCOUNT */
++
+ #ifdef SHARED
+ # define OLD_VERSION(name, version) \
+--- elfutils/lib/Makefile.in
++++ elfutils/lib/Makefile.in
+@@ -99,6 +99,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
+ INSTALL_SCRIPT = @INSTALL_SCRIPT@
+ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+ LDFLAGS = @LDFLAGS@
++LD_AS_NEEDED = @LD_AS_NEEDED@
+ LEX = @LEX@
+ LEXLIB = @LEXLIB@
+ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+@@ -128,6 +129,7 @@ SHELL = @SHELL@
+ STRIP = @STRIP@
+ USE_NLS = @USE_NLS@
+ VERSION = @VERSION@
 +WEXTRA = @WEXTRA@
- if MUDFLAP
- AM_CFLAGS = -fmudflap
- else
- AM_CFLAGS =
- endif
--AM_CFLAGS += -std=gnu99 -Wall -Wshadow -Werror -Wunused -Wextra -Wformat=2
-+AM_CFLAGS += -std=gnu99 -Wall -Wshadow -Werror -Wunused $(WEXTRA) -Wformat=2
- INCLUDES = -I. -I$(srcdir) -I.. \
-          -I$(top_srcdir)/libelf -I$(top_srcdir)/libebl -I$(top_srcdir)/libdw\
-          -I$(top_srcdir)/lib
---- elfutils/libcpu/Makefile.am
-+++ elfutils/libcpu/Makefile.am
-@@ -30,7 +30,8 @@ AM_CFLAGS = -fmudflap
- else
- AM_CFLAGS =
- endif
--AM_CFLAGS += -Wall -Wshadow -Wunused -Wextra -std=gnu99 -fpic \
+ XGETTEXT = @XGETTEXT@
+ XGETTEXT_015 = @XGETTEXT_015@
+ YACC = @YACC@
+@@ -189,7 +191,7 @@ INCLUDES = -I. -I$(srcdir) -I$(top_srcdi
+       -I$(srcdir)/../libelf
+ AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \
+       $($(*F)_no_Werror),,-Werror) $(if \
+-      $($(*F)_no_Wunused),,-Wunused -Wextra) $(if \
++      $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \
+       $($(*F)_no_Wformat),-Wno-format,-Wformat=2) $($(*F)_CFLAGS) \
+       $(am__append_1) -fpic
+ @MUDFLAP_FALSE@libmudflap = 
+--- elfutils/libasm/ChangeLog
++++ elfutils/libasm/ChangeLog
+@@ -67,6 +67,11 @@
+       * asm_error.c: Add new error ASM_E_IOERROR.
+       * libasmP.h: Add ASM_E_IOERROR definition.
++2005-05-31  Roland McGrath  <roland@redhat.com>
++
++      * Makefile.am (WEXTRA): New variable, substituted by configure.
++      (AM_CFLAGS): Use it in place of -Wextra.
++
+ 2005-02-15  Ulrich Drepper  <drepper@redhat.com>
+       * Makefile.am (AM_CFLAGS): Add -Wunused -Wextra -Wformat=2.
+--- elfutils/libasm/Makefile.in
++++ elfutils/libasm/Makefile.in
+@@ -147,6 +147,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
+ INSTALL_SCRIPT = @INSTALL_SCRIPT@
+ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+ LDFLAGS = @LDFLAGS@
++LD_AS_NEEDED = @LD_AS_NEEDED@
+ LEX = @LEX@
+ LEXLIB = @LEXLIB@
+ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+@@ -176,6 +177,7 @@ SHELL = @SHELL@
+ STRIP = @STRIP@
+ USE_NLS = @USE_NLS@
+ VERSION = 1
 +WEXTRA = @WEXTRA@
-+AM_CFLAGS += -Wall -Wshadow -Wunused $(WEXTRA) -std=gnu99 -fpic \
-            -fdollars-in-identifiers \
-            $($(*F)_CFLAGS) \
-            $(if $($(*F)_no_Werror),,-Werror)
---- elfutils/libdw/Makefile.am
-+++ elfutils/libdw/Makefile.am
-@@ -25,6 +25,7 @@
- ## <http://www.openinventionnetwork.com>.
- ##
- DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H -DIS_LIBDW
+ XGETTEXT = @XGETTEXT@
+ XGETTEXT_015 = @XGETTEXT_015@
+ YACC = @YACC@
+@@ -238,7 +240,7 @@ INCLUDES = -I. -I$(srcdir) -I$(top_srcdi
+       -I$(top_srcdir)/libdw
+ AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \
+       $($(*F)_no_Werror),,-Werror) $(if \
+-      $($(*F)_no_Wunused),,-Wunused -Wextra) $(if \
++      $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \
+       $($(*F)_no_Wformat),-Wno-format,-Wformat=2) $($(*F)_CFLAGS) \
+       $(am__append_1)
+ @MUDFLAP_FALSE@libmudflap = 
+--- elfutils/libcpu/ChangeLog
++++ elfutils/libcpu/ChangeLog
+@@ -9,6 +9,9 @@
+ 2009-01-23  Roland McGrath  <roland@redhat.com>
++      * i386_disasm.c (i386_disasm): Add abort after assert-constant for old
++      compilers that don't realize it's noreturn.
++
+       * Makefile.am (i386_parse_CFLAGS): Use quotes around command
+       substitution that can produce leading whitespace.
+@@ -338,6 +341,11 @@
+       * defs/i386.doc: New file.
+       * defs/x86_64: New file.
++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/i386_disasm.c
++++ elfutils/libcpu/i386_disasm.c
+@@ -791,6 +791,7 @@ i386_disasm (const uint8_t **startp, con
+                       default:
+                         assert (! "INVALID not handled");
++                        abort ();
+                       }
+                   }
+                 else
+--- elfutils/libcpu/Makefile.in
++++ elfutils/libcpu/Makefile.in
+@@ -116,6 +116,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
+ INSTALL_SCRIPT = @INSTALL_SCRIPT@
+ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+ LDFLAGS = @LDFLAGS@
++LD_AS_NEEDED = @LD_AS_NEEDED@
+ LEX = @LEX@
+ LEXLIB = @LEXLIB@
+ LEX_OUTPUT_ROOT = lex.$(<F:lex.l=)
+@@ -145,6 +146,7 @@ SHELL = @SHELL@
+ STRIP = @STRIP@
+ USE_NLS = @USE_NLS@
+ VERSION = @VERSION@
 +WEXTRA = @WEXTRA@
- if MUDFLAP
- AM_CFLAGS = -fmudflap
- else
-@@ -33,7 +34,7 @@ endif
- if BUILD_STATIC
- AM_CFLAGS += -fpic
- 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
+ XGETTEXT = @XGETTEXT@
+ XGETTEXT_015 = @XGETTEXT_015@
+ YACC = @YACC@
+@@ -207,7 +209,7 @@ INCLUDES = -I. -I$(srcdir) -I$(top_srcdi
+       -I$(srcdir)/../libdw -I$(srcdir)/../libasm
+ AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \
+       $($(*F)_no_Werror),,-Werror) $(if \
+-      $($(*F)_no_Wunused),,-Wunused -Wextra) $(if \
++      $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \
+       $($(*F)_no_Wformat),-Wno-format,-Wformat=2) $($(*F)_CFLAGS) \
+       $(am__append_1) -fpic -fdollars-in-identifiers
+ @MUDFLAP_FALSE@libmudflap = 
+--- elfutils/libdw/ChangeLog
++++ elfutils/libdw/ChangeLog
+@@ -57,6 +57,10 @@
+       * dwarf_hasattr_integrate.c: Integrate DW_AT_specification too.
++2009-08-17  Roland McGrath  <roland@redhat.com>
++
++      * libdw.h: Disable extern inlines for GCC 4.2.
++
+ 2009-08-10  Roland McGrath  <roland@redhat.com>
+       * dwarf_getscopevar.c: Use dwarf_diename.
+@@ -825,6 +829,11 @@
+ 2005-05-31  Roland McGrath  <roland@redhat.com>
++      * Makefile.am (WEXTRA): New variable, substituted by configure.
++      (AM_CFLAGS): Use it in place of -Wextra.
++
++2005-05-31  Roland McGrath  <roland@redhat.com>
++
+       * dwarf_formref_die.c (dwarf_formref_die): Add CU header offset to
+       formref offset.
+--- elfutils/libdw/libdw.h
++++ elfutils/libdw/libdw.h
+@@ -814,7 +814,7 @@ extern Dwarf_OOM dwarf_new_oom_handler (
+ /* Inline optimizations.  */
+-#ifdef __OPTIMIZE__
++#if defined __OPTIMIZE__ && !(__GNUC__ == 4 && __GNUC_MINOR__ == 2)
+ /* Return attribute code of given attribute.  */
+ __libdw_extern_inline unsigned int
+ dwarf_whatattr (Dwarf_Attribute *attr)
+--- elfutils/libdw/Makefile.in
++++ elfutils/libdw/Makefile.in
+@@ -188,6 +188,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
+ INSTALL_SCRIPT = @INSTALL_SCRIPT@
+ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+ LDFLAGS = @LDFLAGS@
++LD_AS_NEEDED = @LD_AS_NEEDED@
+ LEX = @LEX@
+ LEXLIB = @LEXLIB@
+ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+@@ -217,6 +218,7 @@ SHELL = @SHELL@
+ STRIP = @STRIP@
+ USE_NLS = @USE_NLS@
  VERSION = 1
++WEXTRA = @WEXTRA@
+ XGETTEXT = @XGETTEXT@
+ XGETTEXT_015 = @XGETTEXT_015@
+ YACC = @YACC@
+@@ -278,7 +280,7 @@ INCLUDES = -I. -I$(srcdir) -I$(top_srcdi
+       -I$(srcdir)/../libelf
+ AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \
+       $($(*F)_no_Werror),,-Werror) $(if \
+-      $($(*F)_no_Wunused),,-Wunused -Wextra) $(if \
++      $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \
+       $($(*F)_no_Wformat),-Wno-format,-Wformat=2) $($(*F)_CFLAGS) \
+       $(am__append_1) $(am__append_2)
+ @MUDFLAP_FALSE@libmudflap = 
+--- elfutils/libdwfl/ChangeLog
++++ elfutils/libdwfl/ChangeLog
+@@ -1184,6 +1184,11 @@
  
---- elfutils/libdwfl/Makefile.am
-+++ elfutils/libdwfl/Makefile.am
-@@ -27,12 +27,13 @@
- ## <http://www.openinventionnetwork.com>.
- ##
- DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H
+ 2005-07-21  Roland McGrath  <roland@redhat.com>
++      * Makefile.am (WEXTRA): New variable, substituted by configure.
++      (AM_CFLAGS): Use it in place of -Wextra.
++
++2005-07-21  Roland McGrath  <roland@redhat.com>
++
+       * Makefile.am (noinst_HEADERS): Add loc2c.c.
+       * test2.c (main): Check sscanf result to quiet warning.
+--- elfutils/libdwfl/Makefile.in
++++ elfutils/libdwfl/Makefile.in
+@@ -181,6 +181,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
+ INSTALL_SCRIPT = @INSTALL_SCRIPT@
+ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+ LDFLAGS = @LDFLAGS@
++LD_AS_NEEDED = @LD_AS_NEEDED@
+ LEX = @LEX@
+ LEXLIB = @LEXLIB@
+ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+@@ -210,6 +211,7 @@ SHELL = @SHELL@
+ STRIP = @STRIP@
+ USE_NLS = @USE_NLS@
+ VERSION = 1
 +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$(srcdir)/../libebl \
-          -I$(srcdir)/../libdw -I.. -I$(srcdir)/../lib
+ XGETTEXT = @XGETTEXT@
+ XGETTEXT_015 = @XGETTEXT_015@
+ YACC = @YACC@
+@@ -272,7 +274,7 @@ INCLUDES = -I. -I$(srcdir) -I$(top_srcdi
+       -I$(srcdir)/../libdw
+ AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \
+       $($(*F)_no_Werror),,-Werror) $(if \
+-      $($(*F)_no_Wunused),,-Wunused -Wextra) $(if \
++      $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \
+       $($(*F)_no_Wformat),-Wno-format,-Wformat=2) $($(*F)_CFLAGS) \
+       $(am__append_1)
+ @MUDFLAP_FALSE@libmudflap = 
+--- elfutils/libebl/ChangeLog
++++ elfutils/libebl/ChangeLog
+@@ -624,6 +624,11 @@
+       * Makefile.am (libebl_*_so_SOURCES): Set to $(*_SRCS) so dependency
+       tracking works right.
++2005-05-31  Roland McGrath  <roland@redhat.com>
++
++      * Makefile.am (WEXTRA): New variable, substituted by configure.
++      (AM_CFLAGS): Use it in place of -Wextra.
++
+ 2005-05-21  Ulrich Drepper  <drepper@redhat.com>
+       * libebl_x86_64.map: Add x86_64_core_note.
+--- elfutils/libebl/Makefile.in
++++ elfutils/libebl/Makefile.in
+@@ -143,6 +143,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
+ INSTALL_SCRIPT = @INSTALL_SCRIPT@
+ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+ LDFLAGS = @LDFLAGS@
++LD_AS_NEEDED = @LD_AS_NEEDED@
+ LEX = @LEX@
+ LEXLIB = @LEXLIB@
+ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+@@ -172,6 +173,7 @@ SHELL = @SHELL@
+ STRIP = @STRIP@
+ USE_NLS = @USE_NLS@
  VERSION = 1
---- elfutils/libebl/Makefile.am
-+++ elfutils/libebl/Makefile.am
-@@ -25,12 +25,13 @@
- ## <http://www.openinventionnetwork.com>.
- ##
- 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)/libdw \
+ XGETTEXT = @XGETTEXT@
+ XGETTEXT_015 = @XGETTEXT_015@
+ YACC = @YACC@
+@@ -234,7 +236,7 @@ INCLUDES = -I. -I$(srcdir) -I$(top_srcdi
+       -I$(srcdir)/../libasm
+ AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \
+       $($(*F)_no_Werror),,-Werror) $(if \
+-      $($(*F)_no_Wunused),,-Wunused -Wextra) $(if \
++      $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \
+       $($(*F)_no_Wformat),-Wno-format,-Wformat=2) $($(*F)_CFLAGS) \
+       $(am__append_1) -fpic
+ @MUDFLAP_FALSE@libmudflap = 
+--- elfutils/libelf/ChangeLog
++++ elfutils/libelf/ChangeLog
+@@ -624,6 +624,11 @@
+       * elf.h: Update from glibc.
++2005-05-31  Roland McGrath  <roland@redhat.com>
++
++      * Makefile.am (WEXTRA): New variable, substituted by configure.
++      (AM_CFLAGS): Use it in place of -Wextra.
++
+ 2005-05-08  Roland McGrath  <roland@redhat.com>
+       * elf_begin.c (read_file) [_MUDFLAP]: Don't use mmap for now.
 --- elfutils/libelf/common.h
 +++ elfutils/libelf/common.h
 @@ -160,7 +160,7 @@ libelf_release_all (Elf *elf)
              : (sizeof (Var) == 4                                            \
                 ? bswap_32 (Var)                                             \
                 : bswap_64 (Var))))
---- elfutils/libelf/Makefile.am
-+++ elfutils/libelf/Makefile.am
-@@ -25,6 +25,7 @@
- ## <http://www.openinventionnetwork.com>.
- ##
- DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H
+--- elfutils/libelf/Makefile.in
++++ elfutils/libelf/Makefile.in
+@@ -189,6 +189,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
+ INSTALL_SCRIPT = @INSTALL_SCRIPT@
+ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+ LDFLAGS = @LDFLAGS@
++LD_AS_NEEDED = @LD_AS_NEEDED@
+ LEX = @LEX@
+ LEXLIB = @LEXLIB@
+ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+@@ -218,6 +219,7 @@ SHELL = @SHELL@
+ STRIP = @STRIP@
+ USE_NLS = @USE_NLS@
+ VERSION = 1
 +WEXTRA = @WEXTRA@
- if MUDFLAP
- AM_CFLAGS = -fmudflap
- else
-@@ -33,7 +34,7 @@ endif
- if BUILD_STATIC
- AM_CFLAGS += -fpic
- 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)
+ XGETTEXT = @XGETTEXT@
+ XGETTEXT_015 = @XGETTEXT_015@
+ YACC = @YACC@
+@@ -278,7 +280,7 @@ zip_LIBS = @zip_LIBS@
+ INCLUDES = -I. -I$(srcdir) -I$(top_srcdir)/lib -I..
+ AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \
+       $($(*F)_no_Werror),,-Werror) $(if \
+-      $($(*F)_no_Wunused),,-Wunused -Wextra) $(if \
++      $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \
+       $($(*F)_no_Wformat),-Wno-format,-Wformat=2) $($(*F)_CFLAGS) \
+       $(am__append_1) $(am__append_2)
+ @MUDFLAP_FALSE@libmudflap = 
+--- elfutils/m4/Makefile.in
++++ elfutils/m4/Makefile.in
+@@ -75,6 +75,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
+ INSTALL_SCRIPT = @INSTALL_SCRIPT@
+ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+ LDFLAGS = @LDFLAGS@
++LD_AS_NEEDED = @LD_AS_NEEDED@
+ LEX = @LEX@
+ LEXLIB = @LEXLIB@
+ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+@@ -104,6 +105,7 @@ SHELL = @SHELL@
+ STRIP = @STRIP@
+ USE_NLS = @USE_NLS@
+ VERSION = @VERSION@
++WEXTRA = @WEXTRA@
+ XGETTEXT = @XGETTEXT@
+ XGETTEXT_015 = @XGETTEXT_015@
+ YACC = @YACC@
+--- elfutils/Makefile.in
++++ elfutils/Makefile.in
+@@ -155,6 +155,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
+ INSTALL_SCRIPT = @INSTALL_SCRIPT@
+ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+ LDFLAGS = @LDFLAGS@
++LD_AS_NEEDED = @LD_AS_NEEDED@
+ LEX = @LEX@
+ LEXLIB = @LEXLIB@
+ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+@@ -184,6 +185,7 @@ SHELL = @SHELL@
+ STRIP = @STRIP@
+ USE_NLS = @USE_NLS@
+ VERSION = @VERSION@
++WEXTRA = @WEXTRA@
+ XGETTEXT = @XGETTEXT@
+ XGETTEXT_015 = @XGETTEXT_015@
+ YACC = @YACC@
+--- elfutils/src/addr2line.c
++++ elfutils/src/addr2line.c
+@@ -447,10 +447,10 @@ handle_address (const char *string, Dwfl
+       bool parsed = false;
+       int n;
+       char *name = NULL;
+-      if (sscanf (string, "(%m[^)])%" PRIiMAX "%n", &name, &addr, &n) == 2
++      if (sscanf (string, "(%a[^)])%" PRIiMAX "%n", &name, &addr, &n) == 2
+         && string[n] == '\0')
+       parsed = adjust_to_section (name, &addr, dwfl);
+-      else if (sscanf (string, "%m[^-+]%" PRIiMAX "%n", &name, &addr, &n) == 2
++      else if (sscanf (string, "%a[^-+]%" PRIiMAX "%n", &name, &addr, &n) == 2
+              && string[n] == '\0')
+       {
+         /* It was symbol+offset.  */
+--- elfutils/src/ChangeLog
++++ elfutils/src/ChangeLog
+@@ -82,8 +82,16 @@
+       * readelf.c (attr_callback): Use print_block only when we don't use
+       print_ops.
++2009-08-17  Roland McGrath  <roland@redhat.com>
++
++      * ld.h: Disable extern inlines for GCC 4.2.
++
+ 2009-08-14  Roland McGrath  <roland@redhat.com>
++      * strings.c (read_block): Conditionalize posix_fadvise use
++      on [POSIX_FADV_SEQUENTIAL].
++      From Petr Salinger <Petr.Salinger@seznam.cz>.
++
+       * ar.c (do_oper_extract): Use pathconf instead of statfs.
+ 2009-08-01  Ulrich Drepper  <drepper@redhat.com>
+@@ -247,6 +255,8 @@
+       * readelf.c (print_debug_frame_section): Use t instead of j formats
+       for ptrdiff_t OFFSET.
++      * addr2line.c (handle_address): Use %a instead of %m for compatibility.
++
+ 2009-01-21  Ulrich Drepper  <drepper@redhat.com>
+       * elflint.c (check_program_header): Fix typo in .eh_frame_hdr section
+@@ -430,6 +440,11 @@
+       that matches its PT_LOAD's p_flags &~ PF_W.  On sparc, PF_X really
+       is valid in RELRO.
++2008-03-01  Roland McGrath  <roland@redhat.com>
++
++      * readelf.c (dump_archive_index): Tweak portability hack
++      to match [__GNUC__ < 4] too.
++
+ 2008-02-29  Roland McGrath  <roland@redhat.com>
+       * readelf.c (print_attributes): Add a cast.
+@@ -681,6 +696,8 @@
+       * readelf.c (hex_dump): Fix rounding error in whitespace calculation.
++      * Makefile.am (readelf_no_Werror): New variable.
++
+ 2007-10-15  Roland McGrath  <roland@redhat.com>
+       * make-debug-archive.in: New file.
+@@ -1120,6 +1137,10 @@
+       * elflint.c (valid_e_machine): Add EM_ALPHA.
+       Reported by Christian Aichinger <Greek0@gmx.net>.
++      * strings.c (map_file): Define POSIX_MADV_SEQUENTIAL to
++      MADV_SEQUENTIAL if undefined.   Don't call posix_madvise
++      if neither is defined.
++
+ 2006-08-08  Ulrich Drepper  <drepper@redhat.com>
+       * elflint.c (check_dynamic): Don't require DT_HASH for DT_SYMTAB.
+@@ -1196,6 +1217,10 @@
+       * Makefile.am: Add hacks to create dependency files for non-generic
+       linker.
++2006-04-05  Roland McGrath  <roland@redhat.com>
++
++      * strings.c (MAP_POPULATE): Define to 0 if undefined.
++
+ 2006-06-12  Ulrich Drepper  <drepper@redhat.com>
+       * ldgeneric.c (ld_generic_generate_sections): Don't create .interp
+@@ -1544,6 +1569,11 @@
+       * readelf.c (print_debug_loc_section): Fix indentation for larger
+       address size.
++2005-05-31  Roland McGrath  <roland@redhat.com>
++
++      * Makefile.am (WEXTRA): New variable, substituted by configure.
++      (AM_CFLAGS): Use it in place of -Wextra.
++
+ 2005-05-30  Roland McGrath  <roland@redhat.com>
+       * readelf.c (print_debug_line_section): Print section offset of each
 --- elfutils/src/findtextrel.c
 +++ elfutils/src/findtextrel.c
-@@ -488,7 +488,11 @@ ptrcompare (const void *p1, const void *
+@@ -490,7 +490,11 @@ ptrcompare (const void *p1, const void *
  
  
  static void
           GElf_Addr addr, Elf *elf, Elf_Scn *symscn, Dwarf *dw,
           const char *fname, bool more_than_one, void **knownsrcs)
  {
+--- elfutils/src/ld.h
++++ elfutils/src/ld.h
+@@ -1122,6 +1122,7 @@ extern bool dynamically_linked_p (void);
+ /* Checked whether the symbol is undefined and referenced from a DSO.  */
+ extern bool linked_from_dso_p (struct scninfo *scninfo, size_t symidx);
++#if defined __OPTIMIZE__ && !(__GNUC__ == 4 && __GNUC_MINOR__ == 2)
+ #ifdef __GNUC_STDC_INLINE__
+ __attribute__ ((__gnu_inline__))
+ #endif
+@@ -1139,5 +1140,6 @@ linked_from_dso_p (struct scninfo *scnin
+   return sym->defined && sym->in_dso;
+ }
++#endif        /* Optimizing and not GCC 4.2.  */
+ #endif        /* ld.h */
 --- elfutils/src/Makefile.am
 +++ elfutils/src/Makefile.am
-@@ -26,6 +26,7 @@
- ##
- DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H $(YYDEBUG) -DDEBUGPRED=@DEBUGPRED@ \
-        -DSRCDIR=\"$(shell cd $(srcdir);pwd)\" -DOBJDIR=\"$(shell pwd)\"
-+WEXTRA = @WEXTRA@
- if MUDFLAP
- AM_CFLAGS = -fmudflap
- else
-@@ -33,7 +34,7 @@ AM_CFLAGS =
- endif
- 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),-Wno-format,-Wformat=2) $(CFLAGS_$(*F))
- INCLUDES = -I$(srcdir) -I$(srcdir)/../libelf -I$(srcdir)/../libebl \
-@@ -111,6 +112,9 @@ strings_no_Wformat = yes
+@@ -99,6 +99,9 @@ addr2line_no_Wformat = yes
  # XXX While the file is not finished, don't warn about this
  ldgeneric_no_Wunused = yes
  
  readelf_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl
  nm_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl
  size_LDADD = $(libelf) $(libeu) $(libmudflap)
+--- elfutils/src/Makefile.in
++++ elfutils/src/Makefile.in
+@@ -228,6 +228,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
+ INSTALL_SCRIPT = @INSTALL_SCRIPT@
+ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+ LDFLAGS = @LDFLAGS@
++LD_AS_NEEDED = @LD_AS_NEEDED@
+ LEX = @LEX@
+ LEXLIB = @LEXLIB@
+ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+@@ -257,6 +258,7 @@ SHELL = @SHELL@
+ STRIP = @STRIP@
+ USE_NLS = @USE_NLS@
+ VERSION = @VERSION@
++WEXTRA = @WEXTRA@
+ XGETTEXT = @XGETTEXT@
+ XGETTEXT_015 = @XGETTEXT_015@
+ YACC = @YACC@ -d
+@@ -320,7 +322,7 @@ INCLUDES = -I. -I$(srcdir) -I$(top_srcdi
+       -I$(srcdir)/../libasm
+ AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \
+       $($(*F)_no_Werror),,-Werror) $(if \
+-      $($(*F)_no_Wunused),,-Wunused -Wextra) $(if \
++      $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \
+       $($(*F)_no_Wformat),-Wno-format,-Wformat=2) $($(*F)_CFLAGS) \
+       $(am__append_1)
+ @MUDFLAP_FALSE@libmudflap = 
+@@ -367,6 +369,9 @@ strings_no_Wformat = yes
+ addr2line_no_Wformat = yes
+ # XXX While the file is not finished, don't warn about this
+ ldgeneric_no_Wunused = yes
++
++# Buggy old compilers.
++readelf_no_Werror = yes
+ readelf_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl
+ nm_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl
+ size_LDADD = $(libelf) $(libeu) $(libmudflap)
 --- elfutils/src/readelf.c
 +++ elfutils/src/readelf.c
-@@ -6419,7 +6419,7 @@ dump_archive_index (Elf *elf, const char
+@@ -7644,7 +7644,7 @@ dump_archive_index (Elf *elf, const char
          if (unlikely (elf_rand (elf, as_off) == 0)
              || unlikely ((subelf = elf_begin (-1, ELF_C_READ_MMAP, elf))
                           == NULL))
          break;
        }
        if (errno != EINVAL && errno != ENOMEM)
+@@ -586,9 +595,11 @@ read_block (int fd, const char *fname, o
+       elfmap_off = from & ~(ps - 1);
+       elfmap_base = elfmap = map_file (fd, elfmap_off, fdlen, &elfmap_size);
++#ifdef POSIX_FADV_SEQUENTIAL
+       if (unlikely (elfmap == MAP_FAILED))
+       /* Let the kernel know we are going to read everything in sequence.  */
+       (void) posix_fadvise (fd, 0, 0, POSIX_FADV_SEQUENTIAL);
++#endif
+     }
+   if (unlikely (elfmap == MAP_FAILED))
 --- elfutils/src/strip.c
 +++ elfutils/src/strip.c
-@@ -52,6 +52,12 @@
+@@ -53,6 +53,12 @@
  #include <libebl.h>
  #include <system.h>
  
  
  /* Name and version of program.  */
  static void print_version (FILE *stream, struct argp_state *state);
-@@ -300,8 +306,18 @@ process_file (const char *fname)
+@@ -301,8 +307,18 @@ process_file (const char *fname)
  
        /* If we have to preserve the timestamp, we need it in the
         format utimes() understands.  */
      }
  
    /* Open the file.  */
-@@ -1745,7 +1761,7 @@ handle_elf (int fd, Elf *elf, const char
+@@ -1747,7 +1763,7 @@ handle_elf (int fd, Elf *elf, const char
    /* If requested, preserve the timestamp.  */
    if (tvp != NULL)
      {
        {
          error (0, errno, gettext ("\
  cannot set access and modification date of '%s'"),
-@@ -1802,7 +1818,7 @@ handle_ar (int fd, Elf *elf, const char 
+@@ -1804,7 +1820,7 @@ handle_ar (int fd, Elf *elf, const char 
  
    if (tvp != NULL)
      {
        {
          error (0, errno, gettext ("\
  cannot set access and modification date of '%s'"), fname);
+--- elfutils/tests/ChangeLog
++++ elfutils/tests/ChangeLog
+@@ -130,6 +130,8 @@
+ 2008-01-21  Roland McGrath  <roland@redhat.com>
++      * line2addr.c (main): Revert last change.
++
+       * testfile45.S.bz2: Add tests for cltq, cqto.
+       * testfile45.expect.bz2: Adjust.
+@@ -838,6 +840,11 @@
+       * Makefile.am (TESTS): Add run-elflint-test.sh.
+       (EXTRA_DIST): Add run-elflint-test.sh and testfile18.bz2.
++2005-05-31  Roland McGrath  <roland@redhat.com>
++
++      * Makefile.am (WEXTRA): New variable, substituted by configure.
++      (AM_CFLAGS): Use it in place of -Wextra.
++
+ 2005-05-24  Ulrich Drepper  <drepper@redhat.com>
+       * get-files.c (main): Use correct format specifier.
 --- elfutils/tests/line2addr.c
 +++ elfutils/tests/line2addr.c
 @@ -132,7 +132,7 @@ main (int argc, char *argv[])
        {
        default:
        case 0:
---- elfutils/tests/Makefile.am
-+++ elfutils/tests/Makefile.am
-@@ -25,12 +25,13 @@
- ## <http://www.openinventionnetwork.com>.
- ##
- DEFS = -DHAVE_CONFIG_H -D_GNU_SOURCE
+--- elfutils/tests/Makefile.in
++++ elfutils/tests/Makefile.in
+@@ -367,6 +367,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
+ INSTALL_SCRIPT = @INSTALL_SCRIPT@
+ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+ LDFLAGS = @LDFLAGS@
++LD_AS_NEEDED = @LD_AS_NEEDED@
+ LEX = @LEX@
+ LEXLIB = @LEXLIB@
+ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+@@ -396,6 +397,7 @@ SHELL = @SHELL@
+ STRIP = @STRIP@
+ USE_NLS = @USE_NLS@
+ VERSION = @VERSION@
 +WEXTRA = @WEXTRA@
- if MUDFLAP
--AM_CFLAGS = -Wall -Werror -Wextra -std=gnu99 -fmudflap\
-+AM_CFLAGS = -Wall -Werror $(WEXTRA) -std=gnu99 -fmudflap\
-           $(if $($(*F)_no_Wformat),-Wno-format,-Wformat=2)
- BUILD_RPATH = \$$ORIGIN/../backends
- else
--AM_CFLAGS = -Wall -Werror -Wextra -std=gnu99 \
-+AM_CFLAGS = -Wall -Werror $(WEXTRA) -std=gnu99 \
-           $(if $($(*F)_no_Wformat),-Wno-format,-Wformat=2)
- BUILT_RPATH = \$$ORIGIN/../libasm:\$$ORIGIN/../libdw:\$$ORIGIN/../backends:\$$ORIGIN/../libelf
- endif
+ XGETTEXT = @XGETTEXT@
+ XGETTEXT_015 = @XGETTEXT_015@
+ YACC = @YACC@
+@@ -456,7 +458,7 @@ zip_LIBS = @zip_LIBS@
+ INCLUDES = -I. -I$(srcdir) -I$(top_srcdir)/lib -I.. $(am__append_2)
+ AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \
+       $($(*F)_no_Werror),,-Werror) $(if \
+-      $($(*F)_no_Wunused),,-Wunused -Wextra) $(if \
++      $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \
+       $($(*F)_no_Wformat),-Wno-format,-Wformat=2) $($(*F)_CFLAGS) \
+       $(am__append_1)
+ @MUDFLAP_FALSE@libmudflap = 
index 1c3d3e7e9b7cf08e504443b2057f3d073da430c5..8e6f5455f20448ce20b24d9eb444b82ef62263e5 100644 (file)
@@ -1,80 +1,65 @@
-src/
-2005-06-09  Roland McGrath  <roland@redhat.com>
-
-       * readelf.c (handle_dynamic, handle_symtab): Check for bogus sh_link.
-       (handle_verneed, handle_verdef, handle_versym, handle_hash): Likewise.
-       (handle_scngrp): Check for bogus sh_info.
-
-       * strip.c (handle_elf): Check for bogus values in sh_link, sh_info,
-       st_shndx, e_shstrndx, and SHT_GROUP or SHT_SYMTAB_SHNDX data.
-       Don't use assert on input values, instead bail with "illformed" error.
-
-2005-05-17  Jakub Jelinek  <jakub@redhat.com>
-
-libelf/
-       * 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)):
-       Check if section header table fits into object's bounds.
-       * elf_begin.c (get_shnum): Ensure section headers 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.
-
-src/
-       * 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.
-
-2005-05-14  Jakub Jelinek  <jakub@redhat.com>
-
-libelf/
-       * libelfP.h (INVALID_NDX): Define.
-       * gelf_getdyn.c (gelf_getdyn): Use it.  Remove ndx < 0 test if any.
-       * gelf_getlib.c (gelf_getlib): Likewise.
-       * gelf_getmove.c (gelf_getmove): Likewise.
-       * gelf_getrel.c (gelf_getrel): Likewise.
-       * gelf_getrela.c (gelf_getrela): Likewise.
-       * gelf_getsym.c (gelf_getsym): Likewise.
-       * gelf_getsyminfo.c (gelf_getsyminfo): Likewise.
-       * gelf_getsymshndx.c (gelf_getsymshndx): Likewise.
-       * gelf_getversym.c (gelf_getversym): Likewise.
-       * gelf_update_dyn.c (gelf_update_dyn): Likewise.
-       * gelf_update_lib.c (gelf_update_lib): Likewise.
-       * gelf_update_move.c (gelf_update_move): Likewise.
-       * gelf_update_rel.c (gelf_update_rel): Likewise.
-       * gelf_update_rela.c (gelf_update_rela): Likewise.
-       * gelf_update_sym.c (gelf_update_sym): Likewise.
-       * gelf_update_syminfo.c (gelf_update_syminfo): Likewise.
-       * gelf_update_symshndx.c (gelf_update_symshndx): Likewise.
-       * gelf_update_versym.c (gelf_update_versym): Likewise.
-       * elf_newscn.c (elf_newscn): Check for overflow.
-       * elf32_updatefile.c (__elfw2(LIBELFBITS,updatemmap)): Likewise.
-       (__elfw2(LIBELFBITS,updatefile)): Likewise.
-       * elf_begin.c (file_read_elf): Likewise.
-       * elf32_newphdr.c (elfw2(LIBELFBITS,newphdr)): Likewise.
-       * elf_getarsym.c (elf_getarsym): Likewise.
-       * elf32_getshdr.c (elfw2(LIBELFBITS,getshdr)): Likewise.
-src/
-       * elflint.c (section_name): Return "<invalid>" instead of
-       crashing on invalid section name.
-       (check_symtab, is_rel_dyn, check_rela, check_rel, check_dynamic,
-       check_symtab_shndx, check_hash, check_versym): Robustify.
-
---- elfutils-0.136/libelf/elf32_getphdr.c.robustify
-+++ elfutils-0.136/libelf/elf32_getphdr.c
-@@ -105,6 +105,16 @@ __elfw2(LIBELFBITS,getphdr_wrlock) (elf)
+--- elfutils/libelf/ChangeLog
++++ elfutils/libelf/ChangeLog
+@@ -616,6 +616,49 @@
+       If section content hasn't been read yet, do it before looking for the
+       block size.  If no section data present, infer size of section header.
++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)):
++      Check if section header table fits into object's bounds.
++      * elf_begin.c (get_shnum): Ensure section headers 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.
++
++2005-05-14  Jakub Jelinek  <jakub@redhat.com>
++
++      * libelfP.h (INVALID_NDX): Define.
++      * gelf_getdyn.c (gelf_getdyn): Use it.  Remove ndx < 0 test if any.
++      * gelf_getlib.c (gelf_getlib): Likewise.
++      * gelf_getmove.c (gelf_getmove): Likewise.
++      * gelf_getrel.c (gelf_getrel): Likewise.
++      * gelf_getrela.c (gelf_getrela): Likewise.
++      * gelf_getsym.c (gelf_getsym): Likewise.
++      * gelf_getsyminfo.c (gelf_getsyminfo): Likewise.
++      * gelf_getsymshndx.c (gelf_getsymshndx): Likewise.
++      * gelf_getversym.c (gelf_getversym): Likewise.
++      * gelf_update_dyn.c (gelf_update_dyn): Likewise.
++      * gelf_update_lib.c (gelf_update_lib): Likewise.
++      * gelf_update_move.c (gelf_update_move): Likewise.
++      * gelf_update_rel.c (gelf_update_rel): Likewise.
++      * gelf_update_rela.c (gelf_update_rela): Likewise.
++      * gelf_update_sym.c (gelf_update_sym): Likewise.
++      * gelf_update_syminfo.c (gelf_update_syminfo): Likewise.
++      * gelf_update_symshndx.c (gelf_update_symshndx): Likewise.
++      * gelf_update_versym.c (gelf_update_versym): Likewise.
++      * elf_newscn.c (elf_newscn): Check for overflow.
++      * elf32_updatefile.c (__elfw2(LIBELFBITS,updatemmap)): Likewise.
++      (__elfw2(LIBELFBITS,updatefile)): Likewise.
++      * elf_begin.c (file_read_elf): Likewise.
++      * elf32_newphdr.c (elfw2(LIBELFBITS,newphdr)): Likewise.
++      * elf_getarsym.c (elf_getarsym): Likewise.
++      * elf32_getshdr.c (elfw2(LIBELFBITS,getshdr)): Likewise.
+ 2005-05-11  Ulrich Drepper  <drepper@redhat.com>
+       * elf.h: Update again.
+--- elfutils/libelf/elf32_getphdr.c
++++ elfutils/libelf/elf32_getphdr.c
+@@ -107,6 +107,16 @@ __elfw2(LIBELFBITS,getphdr_wrlock) (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))
++            || unlikely (elf->maximum_size - ehdr->e_phoff < size))
 +          {
 +            /* Something is wrong.  */
 +            __libelf_seterrno (ELF_E_INVALID_PHDR);
@@ -84,33 +69,33 @@ src/
          /* All the data is already mapped.  Use it.  */
          void *file_phdr = ((char *) elf->map_address
                             + elf->start_offset + ehdr->e_phoff);
---- elfutils-0.136/libelf/elf32_getshdr.c.robustify
-+++ elfutils-0.136/libelf/elf32_getshdr.c
+--- elfutils/libelf/elf32_getshdr.c
++++ elfutils/libelf/elf32_getshdr.c
 @@ -1,5 +1,5 @@
  /* Return section header.
--   Copyright (C) 1998, 1999, 2000, 2001, 2002, 2005, 2007 Red Hat, Inc.
-+   Copyright (C) 1998, 1999, 2000, 2001, 2002, 2005, 2007, 2008 Red Hat, Inc.
+-   Copyright (C) 1998, 1999, 2000, 2001, 2002, 2005, 2007, 2009 Red Hat, Inc.
++   Copyright (C) 1998-2009 Red Hat, Inc.
     This file is part of Red Hat elfutils.
     Written by Ulrich Drepper <drepper@redhat.com>, 1998.
  
-@@ -81,7 +81,8 @@ load_shdr_rwlock (Elf_Scn *scn)
+@@ -81,7 +81,8 @@ load_shdr_wrlock (Elf_Scn *scn)
      goto out;
  
    size_t shnum;
--  if (__elf_getshnum_rdlock (elf, &shnum) != 0)
-+  if (__elf_getshnum_rdlock (elf, &shnum) != 0
+-  if (__elf_getshdrnum_rdlock (elf, &shnum) != 0)
++  if (__elf_getshdrnum_rdlock (elf, &shnum) != 0
 +      || shnum > SIZE_MAX / sizeof (ElfW2(LIBELFBITS,Shdr)))
      goto out;
    size_t size = shnum * sizeof (ElfW2(LIBELFBITS,Shdr));
  
-@@ -98,6 +99,16 @@ load_shdr_rwlock (Elf_Scn *scn)
+@@ -98,6 +99,16 @@ load_shdr_wrlock (Elf_Scn *scn)
  
    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_shoff >= elf->maximum_size)
-+        || unlikely (ehdr->e_shoff + size > elf->maximum_size))
++        || unlikely (elf->maximum_size - ehdr->e_shoff < size))
 +      {
 +        /* Something is wrong.  */
 +        __libelf_seterrno (ELF_E_INVALID_SECTION_HEADER);
@@ -120,10 +105,10 @@ src/
        ElfW2(LIBELFBITS,Shdr) *notcvt;
  
        /* All the data is already mapped.  If we could use it
---- elfutils-0.136/libelf/elf32_newphdr.c.robustify
-+++ elfutils-0.136/libelf/elf32_newphdr.c
-@@ -124,6 +124,12 @@ elfw2(LIBELFBITS,newphdr) (elf, count)
-   else if (elf->state.ELFW(elf,LIBELFBITS).ehdr->e_phnum != count
+--- elfutils/libelf/elf32_newphdr.c
++++ elfutils/libelf/elf32_newphdr.c
+@@ -135,6 +135,12 @@ elfw2(LIBELFBITS,newphdr) (elf, count)
+          || count == PN_XNUM
           || elf->state.ELFW(elf,LIBELFBITS).phdr == NULL)
      {
 +      if (unlikely (count > SIZE_MAX / sizeof (ElfW2(LIBELFBITS,Phdr))))
@@ -135,9 +120,9 @@ src/
        /* Allocate a new program header with the appropriate number of
         elements.  */
        result = (ElfW2(LIBELFBITS,Phdr) *)
---- elfutils-0.136/libelf/elf32_updatefile.c.robustify
-+++ elfutils-0.136/libelf/elf32_updatefile.c
-@@ -212,6 +212,9 @@ __elfw2(LIBELFBITS,updatemmap) (Elf *elf
+--- elfutils/libelf/elf32_updatefile.c
++++ elfutils/libelf/elf32_updatefile.c
+@@ -223,6 +223,9 @@ __elfw2(LIBELFBITS,updatemmap) (Elf *elf
    /* Write all the sections.  Well, only those which are modified.  */
    if (shnum > 0)
      {
@@ -147,7 +132,7 @@ src/
        Elf_ScnList *list = &elf->state.ELFW(elf,LIBELFBITS).scns;
        Elf_Scn **scns = (Elf_Scn **) alloca (shnum * sizeof (Elf_Scn *));
        char *const shdr_start = ((char *) elf->map_address + elf->start_offset
-@@ -582,6 +585,10 @@ __elfw2(LIBELFBITS,updatefile) (Elf *elf
+@@ -645,6 +648,10 @@ __elfw2(LIBELFBITS,updatefile) (Elf *elf
    /* Write all the sections.  Well, only those which are modified.  */
    if (shnum > 0)
      {
@@ -158,19 +143,19 @@ src/
        off_t shdr_offset = elf->start_offset + ehdr->e_shoff;
  #if EV_NUM != 2
        xfct_t shdr_fctp = __elf_xfctstom[__libelf_version - 1][EV_CURRENT - 1][ELFW(ELFCLASS, LIBELFBITS) - 1][ELF_T_SHDR];
---- elfutils-0.136/libelf/elf_begin.c.robustify
-+++ elfutils-0.136/libelf/elf_begin.c
-@@ -155,7 +155,8 @@ get_shnum (void *map_address, unsigned c
+--- elfutils/libelf/elf_begin.c
++++ elfutils/libelf/elf_begin.c
+@@ -165,7 +165,8 @@ get_shnum (void *map_address, unsigned c
  
        if (unlikely (result == 0) && ehdr.e32->e_shoff != 0)
        {
 -        if (ehdr.e32->e_shoff + sizeof (Elf32_Shdr) > maxsize)
 +        if (unlikely (ehdr.e32->e_shoff >= maxsize)
-+            || unlikely (ehdr.e32->e_shoff + sizeof (Elf32_Shdr) > maxsize))
++            || unlikely (maxsize - ehdr.e32->e_shoff < sizeof (Elf32_Shdr)))
            /* Cannot read the first section header.  */
            return 0;
  
-@@ -203,7 +204,8 @@ get_shnum (void *map_address, unsigned c
+@@ -213,7 +214,8 @@ get_shnum (void *map_address, unsigned c
  
        if (unlikely (result == 0) && ehdr.e64->e_shoff != 0)
        {
@@ -180,7 +165,7 @@ src/
            /* Cannot read the first section header.  */
            return 0;
  
-@@ -275,6 +277,15 @@ file_read_elf (int fildes, void *map_add
+@@ -285,6 +287,15 @@ file_read_elf (int fildes, void *map_add
      /* Could not determine the number of sections.  */
      return NULL;
  
@@ -193,17 +178,17 @@ src/
 +  else if (scncnt > SIZE_MAX / (sizeof (Elf_Scn) + sizeof (Elf64_Shdr)))
 +    return NULL;
 +
-   /* We can now allocate the memory.  */
-   Elf *elf = allocate_elf (fildes, map_address, offset, maxsize, cmd, parent,
-                          ELF_K_ELF, scncnt * sizeof (Elf_Scn));
-@@ -308,13 +319,31 @@ file_read_elf (int fildes, void *map_add
+   /* We can now allocate the memory.  Even if there are no section headers,
+      we allocate space for a zeroth section in case we need it later.  */
+   const size_t scnmax = (scncnt ?: (cmd == ELF_C_RDWR || cmd == ELF_C_RDWR_MMAP)
+@@ -324,13 +335,33 @@ file_read_elf (int fildes, void *map_add
        {
          /* We can use the mmapped memory.  */
          elf->state.elf32.ehdr = ehdr;
 +
 +        if (unlikely (ehdr->e_shoff >= maxsize)
-+            || unlikely (ehdr->e_shoff
-+                         + scncnt * sizeof (Elf32_Shdr) > maxsize))
++            || unlikely (maxsize - ehdr->e_shoff
++                         < scncnt * sizeof (Elf32_Shdr)))
 +          {
 +          free_and_out:
 +            free (elf);
@@ -212,23 +197,30 @@ src/
 +          }
          elf->state.elf32.shdr
            = (Elf32_Shdr *) ((char *) ehdr + ehdr->e_shoff);
+-        if (ehdr->e_phnum > 0)
+-          /* Assign a value only if there really is a program
+-             header.  Otherwise the value remains NULL.  */
+-          elf->state.elf32.phdr
+-            = (Elf32_Phdr *) ((char *) ehdr + ehdr->e_phoff);
 +
-         if (ehdr->e_phnum > 0)
++        size_t phnum = ehdr->e_phnum;
++        if (phnum == PN_XNUM && scncnt > 0)
++          phnum = elf->state.elf32.shdr[0].sh_info;
++        if (phnum > 0)
 +          {
-           /* Assign a value only if there really is a program
-              header.  Otherwise the value remains NULL.  */
+           /* Assign a value only if there really is a program
+              header.  Otherwise the value remains NULL.  */
 +            if (unlikely (ehdr->e_phoff >= maxsize)
-+                || unlikely (ehdr->e_phoff
-+                             + ehdr->e_phnum
-+                             * sizeof (Elf32_Phdr) > maxsize))
++                || unlikely (maxsize - ehdr->e_phoff
++                             < phnum * sizeof (Elf32_Phdr)))
 +              goto free_and_out;
-           elf->state.elf32.phdr
-             = (Elf32_Phdr *) ((char *) ehdr + ehdr->e_phoff);
+           elf->state.elf32.phdr
+             = (Elf32_Phdr *) ((char *) ehdr + ehdr->e_phoff);
 +          }
  
          for (size_t cnt = 0; cnt < scncnt; ++cnt)
            {
-@@ -396,13 +425,26 @@ file_read_elf (int fildes, void *map_add
+@@ -412,13 +443,28 @@ file_read_elf (int fildes, void *map_add
        {
          /* We can use the mmapped memory.  */
          elf->state.elf64.ehdr = ehdr;
@@ -239,24 +231,31 @@ src/
 +          goto free_and_out;
          elf->state.elf64.shdr
            = (Elf64_Shdr *) ((char *) ehdr + ehdr->e_shoff);
+-        if (ehdr->e_phnum > 0)
+-          /* Assign a value only if there really is a program
+-             header.  Otherwise the value remains NULL.  */
+-          elf->state.elf64.phdr
+-            = (Elf64_Phdr *) ((char *) ehdr + ehdr->e_phoff);
 +
-         if (ehdr->e_phnum > 0)
++        size_t phnum = ehdr->e_phnum;
++        if (phnum == PN_XNUM && scncnt > 0)
++          phnum = elf->state.elf64.shdr[0].sh_info;
++        if (phnum > 0)
 +          {
-           /* Assign a value only if there really is a program
-              header.  Otherwise the value remains NULL.  */
+           /* Assign a value only if there really is a program
+              header.  Otherwise the value remains NULL.  */
 +            if (unlikely (ehdr->e_phoff >= maxsize)
 +                || unlikely (ehdr->e_phoff
-+                             + ehdr->e_phnum
-+                             * sizeof (Elf32_Phdr) > maxsize))
++                             + phnum * sizeof (Elf32_Phdr) > maxsize))
 +              goto free_and_out;
-           elf->state.elf64.phdr
-             = (Elf64_Phdr *) ((char *) ehdr + ehdr->e_phoff);
+           elf->state.elf64.phdr
+             = (Elf64_Phdr *) ((char *) ehdr + ehdr->e_phoff);
 +          }
  
          for (size_t cnt = 0; cnt < scncnt; ++cnt)
            {
---- elfutils-0.136/libelf/elf_getarsym.c.robustify
-+++ elfutils-0.136/libelf/elf_getarsym.c
+--- elfutils/libelf/elf_getarsym.c
++++ elfutils/libelf/elf_getarsym.c
 @@ -179,6 +179,9 @@ elf_getarsym (elf, ptr)
        size_t index_size = atol (tmpbuf);
  
@@ -267,9 +266,9 @@ src/
          || n * sizeof (uint32_t) > index_size)
        {
          /* This index table cannot be right since it does not fit into
---- elfutils-0.136/libelf/elf_getshstrndx.c.robustify
-+++ elfutils-0.136/libelf/elf_getshstrndx.c
-@@ -125,10 +125,25 @@ elf_getshstrndx (elf, dst)
+--- elfutils/libelf/elf_getshdrstrndx.c
++++ elfutils/libelf/elf_getshdrstrndx.c
+@@ -125,10 +125,25 @@ elf_getshdrstrndx (elf, dst)
              if (elf->map_address != NULL
                  && elf->state.elf32.ehdr->e_ident[EI_DATA] == MY_ELFDATA
                  && (ALLOW_UNALIGNED
@@ -277,11 +276,13 @@ src/
 +                    || (((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))
++                if (unlikely (elf->maximum_size - offset
++                              < sizeof (Elf32_Shdr)))
 +                  {
 +                    /* Something is wrong.  */
 +                    __libelf_seterrno (ELF_E_INVALID_SECTION_HEADER);
@@ -289,15 +290,14 @@ src/
 +                    goto out;
 +                  }
 +
-               /* We can directly access the memory.  */
--              num = ((Elf32_Shdr *) (elf->map_address + offset))->sh_link;
++                /* 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
-@@ -163,10 +178,25 @@ elf_getshstrndx (elf, dst)
+@@ -163,10 +178,25 @@ elf_getshdrstrndx (elf, dst)
              if (elf->map_address != NULL
                  && elf->state.elf64.ehdr->e_ident[EI_DATA] == MY_ELFDATA
                  && (ALLOW_UNALIGNED
@@ -305,11 +305,13 @@ src/
 +                    || (((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))
++                if (unlikely (elf->maximum_size - offset
++                              < sizeof (Elf64_Shdr)))
 +                  {
 +                    /* Something is wrong.  */
 +                    __libelf_seterrno (ELF_E_INVALID_SECTION_HEADER);
@@ -317,16 +319,15 @@ src/
 +                    goto out;
 +                  }
 +
-               /* We can directly access the memory.  */
--              num = ((Elf64_Shdr *) (elf->map_address + offset))->sh_link;
-+                num = ((Elf64_Shdr *) (elf->map_address
-+                       + elf->start_offset + offset))->sh_link;
++                /* 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.136/libelf/elf_newscn.c.robustify
-+++ elfutils-0.136/libelf/elf_newscn.c
+--- elfutils/libelf/elf_newscn.c
++++ elfutils/libelf/elf_newscn.c
 @@ -104,10 +104,18 @@ elf_newscn (elf)
    else
      {
@@ -347,54 +348,78 @@ src/
        newp = (Elf_ScnList *) calloc (sizeof (Elf_ScnList)
                                     + ((elf->state.elf.scnincr *= 2)
                                        * sizeof (Elf_Scn)), 1);
---- elfutils-0.136/libelf/gelf_getdyn.c.robustify
-+++ elfutils-0.136/libelf/gelf_getdyn.c
-@@ -93,7 +93,8 @@ gelf_getdyn (data, ndx, dst)
+--- elfutils/libelf/gelf_getdyn.c
++++ elfutils/libelf/gelf_getdyn.c
+@@ -1,5 +1,5 @@
+ /* Get information from dynamic table at the given index.
+-   Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
++   Copyright (C) 2000-2009 Red Hat, Inc.
+    This file is part of Red Hat elfutils.
+    Written by Ulrich Drepper <drepper@redhat.com>, 2000.
+@@ -93,7 +93,7 @@ gelf_getdyn (data, ndx, dst)
         table entries has to be adopted.  The user better has provided
         a buffer where we can store the information.  While copying the
         data we are converting the format.  */
 -      if (unlikely ((ndx + 1) * sizeof (Elf32_Dyn) > data_scn->d.d_size))
-+      if (INVALID_NDX (ndx, Elf32_Dyn)
-+        || unlikely ((ndx + 1) * sizeof (Elf32_Dyn) > data_scn->d.d_size))
++      if (INVALID_NDX (ndx, Elf32_Dyn, &data_scn->d))
        {
          __libelf_seterrno (ELF_E_INVALID_INDEX);
          goto out;
-@@ -114,7 +115,8 @@ gelf_getdyn (data, ndx, dst)
+@@ -114,7 +114,7 @@ gelf_getdyn (data, ndx, dst)
  
        /* The data is already in the correct form.  Just make sure the
         index is OK.  */
 -      if (unlikely ((ndx + 1) * sizeof (GElf_Dyn) > data_scn->d.d_size))
-+      if (INVALID_NDX (ndx, GElf_Dyn)
-+        || unlikely ((ndx + 1) * sizeof (GElf_Dyn) > data_scn->d.d_size))
++      if (INVALID_NDX (ndx, GElf_Dyn, &data_scn->d))
        {
          __libelf_seterrno (ELF_E_INVALID_INDEX);
          goto out;
---- elfutils-0.136/libelf/gelf_getlib.c.robustify
-+++ elfutils-0.136/libelf/gelf_getlib.c
-@@ -86,7 +86,8 @@ gelf_getlib (data, ndx, dst)
+--- elfutils/libelf/gelf_getlib.c
++++ elfutils/libelf/gelf_getlib.c
+@@ -1,5 +1,5 @@
+ /* Get library from table at the given index.
+-   Copyright (C) 2004 Red Hat, Inc.
++   Copyright (C) 2004-2009 Red Hat, Inc.
+    This file is part of Red Hat elfutils.
+    Written by Ulrich Drepper <drepper@redhat.com>, 2004.
+@@ -86,7 +86,7 @@ gelf_getlib (data, ndx, dst)
    /* The data is already in the correct form.  Just make sure the
       index is OK.  */
    GElf_Lib *result = NULL;
 -  if (unlikely ((ndx + 1) * sizeof (GElf_Lib) > data->d_size))
-+  if (INVALID_NDX (ndx, GElf_Lib)
-+      || unlikely ((ndx + 1) * sizeof (GElf_Lib) > data->d_size))
++  if (INVALID_NDX (ndx, GElf_Lib, data))
      __libelf_seterrno (ELF_E_INVALID_INDEX);
    else
      {
---- elfutils-0.136/libelf/gelf_getmove.c.robustify
-+++ elfutils-0.136/libelf/gelf_getmove.c
-@@ -83,7 +83,8 @@ gelf_getmove (data, ndx, dst)
+--- elfutils/libelf/gelf_getmove.c
++++ elfutils/libelf/gelf_getmove.c
+@@ -1,5 +1,5 @@
+ /* Get move structure at the given index.
+-   Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
++   Copyright (C) 2000-2009 Red Hat, Inc.
+    This file is part of Red Hat elfutils.
+    Written by Ulrich Drepper <drepper@redhat.com>, 2000.
+@@ -83,7 +83,7 @@ gelf_getmove (data, ndx, dst)
  
    /* The data is already in the correct form.  Just make sure the
       index is OK.  */
 -  if (unlikely ((ndx + 1) * sizeof (GElf_Move) > data->d_size))
-+  if (INVALID_NDX (ndx, GElf_Move)
-+      || unlikely ((ndx + 1) * sizeof (GElf_Move) > data->d_size))
++  if (INVALID_NDX (ndx, GElf_Move, data))
      {
        __libelf_seterrno (ELF_E_INVALID_INDEX);
        goto out;
---- elfutils-0.136/libelf/gelf_getrela.c.robustify
-+++ elfutils-0.136/libelf/gelf_getrela.c
+--- elfutils/libelf/gelf_getrela.c
++++ elfutils/libelf/gelf_getrela.c
+@@ -1,5 +1,5 @@
+ /* Get RELA relocation information at given index.
+-   Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
++   Copyright (C) 2000-2009 Red Hat, Inc.
+    This file is part of Red Hat elfutils.
+    Written by Ulrich Drepper <drepper@redhat.com>, 2000.
 @@ -71,12 +71,6 @@ gelf_getrela (data, ndx, dst)
    if (data_scn == NULL)
      return NULL;
@@ -408,28 +433,33 @@ src/
    if (unlikely (data_scn->d.d_type != ELF_T_RELA))
      {
        __libelf_seterrno (ELF_E_INVALID_HANDLE);
-@@ -93,7 +87,8 @@ gelf_getrela (data, ndx, dst)
+@@ -93,7 +87,7 @@ gelf_getrela (data, ndx, dst)
    if (scn->elf->class == ELFCLASS32)
      {
        /* We have to convert the data.  */
 -      if (unlikely ((ndx + 1) * sizeof (Elf32_Rela) > data_scn->d.d_size))
-+      if (INVALID_NDX (ndx, Elf32_Rela)
-+        || unlikely ((ndx + 1) * sizeof (Elf32_Rela) > data_scn->d.d_size))
++      if (INVALID_NDX (ndx, Elf32_Rela, &data_scn->d))
        {
          __libelf_seterrno (ELF_E_INVALID_INDEX);
          result = NULL;
-@@ -114,7 +109,8 @@ gelf_getrela (data, ndx, dst)
+@@ -114,7 +108,7 @@ gelf_getrela (data, ndx, dst)
      {
        /* Simply copy the data after we made sure we are actually getting
         correct data.  */
 -      if (unlikely ((ndx + 1) * sizeof (Elf64_Rela) > data_scn->d.d_size))
-+      if (INVALID_NDX (ndx, Elf64_Rela)
-+        || unlikely ((ndx + 1) * sizeof (Elf64_Rela) > data_scn->d.d_size))
++      if (INVALID_NDX (ndx, Elf64_Rela, &data_scn->d))
        {
          __libelf_seterrno (ELF_E_INVALID_INDEX);
          result = NULL;
---- elfutils-0.136/libelf/gelf_getrel.c.robustify
-+++ elfutils-0.136/libelf/gelf_getrel.c
+--- elfutils/libelf/gelf_getrel.c
++++ elfutils/libelf/gelf_getrel.c
+@@ -1,5 +1,5 @@
+ /* Get REL relocation information at given index.
+-   Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
++   Copyright (C) 2000-2009 Red Hat, Inc.
+    This file is part of Red Hat elfutils.
+    Written by Ulrich Drepper <drepper@redhat.com>, 2000.
 @@ -71,12 +71,6 @@ gelf_getrel (data, ndx, dst)
    if (data_scn == NULL)
      return NULL;
@@ -443,107 +473,133 @@ src/
    if (unlikely (data_scn->d.d_type != ELF_T_REL))
      {
        __libelf_seterrno (ELF_E_INVALID_HANDLE);
-@@ -93,7 +87,8 @@ gelf_getrel (data, ndx, dst)
+@@ -93,7 +87,7 @@ gelf_getrel (data, ndx, dst)
    if (scn->elf->class == ELFCLASS32)
      {
        /* We have to convert the data.  */
 -      if (unlikely ((ndx + 1) * sizeof (Elf32_Rel) > data_scn->d.d_size))
-+      if (INVALID_NDX (ndx, Elf32_Rel)
-+        || unlikely ((ndx + 1) * sizeof (Elf32_Rel) > data_scn->d.d_size))
++      if (INVALID_NDX (ndx, Elf32_Rel, &data_scn->d))
        {
          __libelf_seterrno (ELF_E_INVALID_INDEX);
          result = NULL;
-@@ -113,7 +108,8 @@ gelf_getrel (data, ndx, dst)
+@@ -113,7 +107,7 @@ gelf_getrel (data, ndx, dst)
      {
        /* Simply copy the data after we made sure we are actually getting
         correct data.  */
 -      if (unlikely ((ndx + 1) * sizeof (Elf64_Rel) > data_scn->d.d_size))
-+      if (INVALID_NDX (ndx, Elf64_Rel)
-+        || unlikely ((ndx + 1) * sizeof (Elf64_Rel) > data_scn->d.d_size))
++      if (INVALID_NDX (ndx, Elf64_Rel, &data_scn->d))
        {
          __libelf_seterrno (ELF_E_INVALID_INDEX);
          result = NULL;
---- elfutils-0.136/libelf/gelf_getsym.c.robustify
-+++ elfutils-0.136/libelf/gelf_getsym.c
-@@ -90,7 +90,8 @@ gelf_getsym (data, ndx, dst)
+--- elfutils/libelf/gelf_getsym.c
++++ elfutils/libelf/gelf_getsym.c
+@@ -1,5 +1,5 @@
+ /* Get symbol information from symbol table at the given index.
+-   Copyright (C) 1999, 2000, 2001, 2002 Red Hat, Inc.
++   Copyright (C) 1999-2009 Red Hat, Inc.
+    This file is part of Red Hat elfutils.
+    Written by Ulrich Drepper <drepper@redhat.com>, 1999.
+@@ -90,7 +90,7 @@ gelf_getsym (data, ndx, dst)
         table entries has to be adopted.  The user better has provided
         a buffer where we can store the information.  While copying the
         data we are converting the format.  */
 -      if (unlikely ((ndx + 1) * sizeof (Elf32_Sym) > data->d_size))
-+      if (INVALID_NDX (ndx, Elf32_Sym)
-+        || unlikely ((ndx + 1) * sizeof (Elf32_Sym) > data->d_size))
++      if (INVALID_NDX (ndx, Elf32_Sym, data))
        {
          __libelf_seterrno (ELF_E_INVALID_INDEX);
          goto out;
-@@ -119,7 +120,8 @@ gelf_getsym (data, ndx, dst)
+@@ -119,7 +119,7 @@ gelf_getsym (data, ndx, dst)
  
        /* The data is already in the correct form.  Just make sure the
         index is OK.  */
 -      if (unlikely ((ndx + 1) * sizeof (GElf_Sym) > data->d_size))
-+      if (INVALID_NDX (ndx, GElf_Sym)
-+        || unlikely ((ndx + 1) * sizeof (GElf_Sym) > data->d_size))
++      if (INVALID_NDX (ndx, GElf_Sym, data))
        {
          __libelf_seterrno (ELF_E_INVALID_INDEX);
          goto out;
---- elfutils-0.136/libelf/gelf_getsyminfo.c.robustify
-+++ elfutils-0.136/libelf/gelf_getsyminfo.c
-@@ -84,7 +84,8 @@ gelf_getsyminfo (data, ndx, dst)
+--- elfutils/libelf/gelf_getsyminfo.c
++++ elfutils/libelf/gelf_getsyminfo.c
+@@ -1,5 +1,5 @@
+ /* Get additional symbol information from symbol table at the given index.
+-   Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
++   Copyright (C) 2000-2009 Red Hat, Inc.
+    This file is part of Red Hat elfutils.
+    Written by Ulrich Drepper <drepper@redhat.com>, 2000.
+@@ -84,7 +84,7 @@ gelf_getsyminfo (data, ndx, dst)
  
    /* The data is already in the correct form.  Just make sure the
       index is OK.  */
 -  if (unlikely ((ndx + 1) * sizeof (GElf_Syminfo) > data->d_size))
-+  if (INVALID_NDX (ndx, GElf_Syminfo)
-+      || unlikely ((ndx + 1) * sizeof (GElf_Syminfo) > data->d_size))
++  if (INVALID_NDX (ndx, GElf_Syminfo, data))
      {
        __libelf_seterrno (ELF_E_INVALID_INDEX);
        goto out;
---- elfutils-0.136/libelf/gelf_getsymshndx.c.robustify
-+++ elfutils-0.136/libelf/gelf_getsymshndx.c
-@@ -90,7 +90,9 @@ gelf_getsymshndx (symdata, shndxdata, nd
+--- elfutils/libelf/gelf_getsymshndx.c
++++ elfutils/libelf/gelf_getsymshndx.c
+@@ -1,6 +1,6 @@
+ /* Get symbol information and separate section index from symbol table
+    at the given index.
+-   Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
++   Copyright (C) 2000-2009 Red Hat, Inc.
+    This file is part of Red Hat elfutils.
+    Written by Ulrich Drepper <drepper@redhat.com>, 2000.
+@@ -90,7 +90,7 @@ gelf_getsymshndx (symdata, shndxdata, nd
       section index table.  */
    if (likely (shndxdata_scn != NULL))
      {
 -      if (unlikely ((ndx + 1) * sizeof (Elf32_Word) > shndxdata_scn->d.d_size))
-+      if (INVALID_NDX (ndx, Elf32_Word)
-+        || unlikely ((ndx + 1) * sizeof (Elf32_Word)
-+                     > shndxdata_scn->d.d_size))
++      if (INVALID_NDX (ndx, Elf32_Word, &shndxdata_scn->d))
        {
          __libelf_seterrno (ELF_E_INVALID_INDEX);
          goto out;
-@@ -110,7 +112,8 @@ gelf_getsymshndx (symdata, shndxdata, nd
+@@ -110,7 +110,7 @@ gelf_getsymshndx (symdata, shndxdata, nd
         table entries has to be adopted.  The user better has provided
         a buffer where we can store the information.  While copying the
         data we are converting the format.  */
 -      if (unlikely ((ndx + 1) * sizeof (Elf32_Sym) > symdata->d_size))
-+      if (INVALID_NDX (ndx, Elf32_Sym)
-+        || unlikely ((ndx + 1) * sizeof (Elf32_Sym) > symdata->d_size))
++      if (INVALID_NDX (ndx, Elf32_Sym, symdata))
        {
          __libelf_seterrno (ELF_E_INVALID_INDEX);
          goto out;
-@@ -139,7 +142,8 @@ gelf_getsymshndx (symdata, shndxdata, nd
+@@ -139,7 +139,7 @@ gelf_getsymshndx (symdata, shndxdata, nd
  
        /* The data is already in the correct form.  Just make sure the
         index is OK.  */
 -      if (unlikely ((ndx + 1) * sizeof (GElf_Sym) > symdata->d_size))
-+      if (INVALID_NDX (ndx, GElf_Sym)
-+        || unlikely ((ndx + 1) * sizeof (GElf_Sym) > symdata->d_size))
++      if (INVALID_NDX (ndx, GElf_Sym, symdata))
        {
          __libelf_seterrno (ELF_E_INVALID_INDEX);
          goto out;
---- elfutils-0.136/libelf/gelf_getversym.c.robustify
-+++ elfutils-0.136/libelf/gelf_getversym.c
-@@ -92,7 +92,8 @@ gelf_getversym (data, ndx, dst)
+--- elfutils/libelf/gelf_getversym.c
++++ elfutils/libelf/gelf_getversym.c
+@@ -1,5 +1,5 @@
+ /* Get symbol version information at the given index.
+-   Copyright (C) 1999, 2000, 2001, 2002 Red Hat, Inc.
++   Copyright (C) 1999-2009 Red Hat, Inc.
+    This file is part of Red Hat elfutils.
+    Written by Ulrich Drepper <drepper@redhat.com>, 1999.
+@@ -92,7 +92,7 @@ gelf_getversym (data, ndx, dst)
  
    /* The data is already in the correct form.  Just make sure the
       index is OK.  */
 -  if (unlikely ((ndx + 1) * sizeof (GElf_Versym) > data->d_size))
-+  if (INVALID_NDX (ndx, GElf_Versym)
-+      || unlikely ((ndx + 1) * sizeof (GElf_Versym) > data->d_size))
++  if (INVALID_NDX (ndx, GElf_Versym, data))
      {
        __libelf_seterrno (ELF_E_INVALID_INDEX);
        result = NULL;
---- elfutils-0.136/libelf/gelf_update_dyn.c.robustify
-+++ elfutils-0.136/libelf/gelf_update_dyn.c
+--- elfutils/libelf/gelf_update_dyn.c
++++ elfutils/libelf/gelf_update_dyn.c
+@@ -1,5 +1,5 @@
+ /* Update information in dynamic table at the given index.
+-   Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
++   Copyright (C) 2000-2009 Red Hat, Inc.
+    This file is part of Red Hat elfutils.
+    Written by Ulrich Drepper <drepper@redhat.com>, 2000.
 @@ -71,12 +71,6 @@ gelf_update_dyn (data, ndx, src)
    if (data == NULL)
      return 0;
@@ -557,28 +613,33 @@ src/
    if (unlikely (data_scn->d.d_type != ELF_T_DYN))
      {
        /* The type of the data better should match.  */
-@@ -102,7 +96,8 @@ gelf_update_dyn (data, ndx, src)
+@@ -102,7 +96,7 @@ gelf_update_dyn (data, ndx, src)
        }
  
        /* Check whether we have to resize the data buffer.  */
 -      if (unlikely ((ndx + 1) * sizeof (Elf32_Dyn) > data_scn->d.d_size))
-+      if (INVALID_NDX (ndx, Elf32_Dyn)
-+        || unlikely ((ndx + 1) * sizeof (Elf32_Dyn) > data_scn->d.d_size))
++      if (INVALID_NDX (ndx, Elf32_Dyn, &data_scn->d))
        {
          __libelf_seterrno (ELF_E_INVALID_INDEX);
          goto out;
-@@ -116,7 +111,8 @@ gelf_update_dyn (data, ndx, src)
+@@ -116,7 +110,7 @@ gelf_update_dyn (data, ndx, src)
    else
      {
        /* Check whether we have to resize the data buffer.  */
 -      if (unlikely ((ndx + 1) * sizeof (Elf64_Dyn) > data_scn->d.d_size))
-+      if (INVALID_NDX (ndx, Elf64_Dyn)
-+        || unlikely ((ndx + 1) * sizeof (Elf64_Dyn) > data_scn->d.d_size))
++      if (INVALID_NDX (ndx, Elf64_Dyn, &data_scn->d))
        {
          __libelf_seterrno (ELF_E_INVALID_INDEX);
          goto out;
---- elfutils-0.136/libelf/gelf_update_lib.c.robustify
-+++ elfutils-0.136/libelf/gelf_update_lib.c
+--- elfutils/libelf/gelf_update_lib.c
++++ elfutils/libelf/gelf_update_lib.c
+@@ -1,5 +1,5 @@
+ /* Update library in table at the given index.
+-   Copyright (C) 2004 Red Hat, Inc.
++   Copyright (C) 2004-2009 Red Hat, Inc.
+    This file is part of Red Hat elfutils.
+    Written by Ulrich Drepper <drepper@redhat.com>, 2004.
 @@ -68,12 +68,6 @@ gelf_update_lib (data, ndx, src)
    if (data == NULL)
      return 0;
@@ -592,29 +653,43 @@ src/
    Elf_Data_Scn *data_scn = (Elf_Data_Scn *) data;
    if (unlikely (data_scn->d.d_type != ELF_T_LIB))
      {
-@@ -87,7 +81,8 @@ gelf_update_lib (data, ndx, src)
+@@ -87,7 +81,7 @@ gelf_update_lib (data, ndx, src)
  
    /* Check whether we have to resize the data buffer.  */
    int result = 0;
 -  if (unlikely ((ndx + 1) * sizeof (Elf64_Lib) > data_scn->d.d_size))
-+  if (INVALID_NDX (ndx, Elf64_Lib)
-+      || unlikely ((ndx + 1) * sizeof (Elf64_Lib) > data_scn->d.d_size))
++  if (INVALID_NDX (ndx, Elf64_Lib, &data_scn->d))
      __libelf_seterrno (ELF_E_INVALID_INDEX);
    else
      {
---- elfutils-0.136/libelf/gelf_update_move.c.robustify
-+++ elfutils-0.136/libelf/gelf_update_move.c
-@@ -75,7 +75,7 @@ gelf_update_move (data, ndx, src)
+--- elfutils/libelf/gelf_update_move.c
++++ elfutils/libelf/gelf_update_move.c
+@@ -1,5 +1,5 @@
+ /* Update move structure at the given index.
+-   Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
++   Copyright (C) 2000-2009 Red Hat, Inc.
+    This file is part of Red Hat elfutils.
+    Written by Ulrich Drepper <drepper@redhat.com>, 2000.
+@@ -75,8 +75,7 @@ gelf_update_move (data, ndx, src)
    assert (sizeof (GElf_Move) == sizeof (Elf64_Move));
  
    /* Check whether we have to resize the data buffer.  */
 -  if (unlikely (ndx < 0)
-+  if (INVALID_NDX (ndx, GElf_Move)
-       || unlikely ((ndx + 1) * sizeof (GElf_Move) > data_scn->d.d_size))
+-      || unlikely ((ndx + 1) * sizeof (GElf_Move) > data_scn->d.d_size))
++  if (INVALID_NDX (ndx, GElf_Move, &data_scn->d))
      {
        __libelf_seterrno (ELF_E_INVALID_INDEX);
---- elfutils-0.136/libelf/gelf_update_rela.c.robustify
-+++ elfutils-0.136/libelf/gelf_update_rela.c
+       return 0;
+--- elfutils/libelf/gelf_update_rela.c
++++ elfutils/libelf/gelf_update_rela.c
+@@ -1,5 +1,5 @@
+ /* Update RELA relocation information at given index.
+-   Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
++   Copyright (C) 2000-2009 Red Hat, Inc.
+    This file is part of Red Hat elfutils.
+    Written by Ulrich Drepper <drepper@redhat.com>, 2000.
 @@ -68,12 +68,6 @@ gelf_update_rela (Elf_Data *dst, int ndx
    if (dst == NULL)
      return 0;
@@ -628,28 +703,33 @@ src/
    if (unlikely (data_scn->d.d_type != ELF_T_RELA))
      {
        /* The type of the data better should match.  */
-@@ -101,7 +95,8 @@ gelf_update_rela (Elf_Data *dst, int ndx
+@@ -101,7 +95,7 @@ gelf_update_rela (Elf_Data *dst, int ndx
        }
  
        /* Check whether we have to resize the data buffer.  */
 -      if (unlikely ((ndx + 1) * sizeof (Elf32_Rela) > data_scn->d.d_size))
-+      if (INVALID_NDX (ndx, Elf32_Rela)
-+        || unlikely ((ndx + 1) * sizeof (Elf32_Rela) > data_scn->d.d_size))
++      if (INVALID_NDX (ndx, Elf32_Rela, &data_scn->d))
        {
          __libelf_seterrno (ELF_E_INVALID_INDEX);
          goto out;
-@@ -117,7 +112,8 @@ gelf_update_rela (Elf_Data *dst, int ndx
+@@ -117,7 +111,7 @@ gelf_update_rela (Elf_Data *dst, int ndx
    else
      {
        /* Check whether we have to resize the data buffer.  */
 -      if (unlikely ((ndx + 1) * sizeof (Elf64_Rela) > data_scn->d.d_size))
-+      if (INVALID_NDX (ndx, Elf64_Rela)
-+        || unlikely ((ndx + 1) * sizeof (Elf64_Rela) > data_scn->d.d_size))
++      if (INVALID_NDX (ndx, Elf64_Rela, &data_scn->d))
        {
          __libelf_seterrno (ELF_E_INVALID_INDEX);
          goto out;
---- elfutils-0.136/libelf/gelf_update_rel.c.robustify
-+++ elfutils-0.136/libelf/gelf_update_rel.c
+--- elfutils/libelf/gelf_update_rel.c
++++ elfutils/libelf/gelf_update_rel.c
+@@ -1,5 +1,5 @@
+ /* Update REL relocation information at given index.
+-   Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
++   Copyright (C) 2000-2009 Red Hat, Inc.
+    This file is part of Red Hat elfutils.
+    Written by Ulrich Drepper <drepper@redhat.com>, 2000.
 @@ -68,12 +68,6 @@ gelf_update_rel (Elf_Data *dst, int ndx,
    if (dst == NULL)
      return 0;
@@ -663,28 +743,33 @@ src/
    if (unlikely (data_scn->d.d_type != ELF_T_REL))
      {
        /* The type of the data better should match.  */
-@@ -99,7 +93,8 @@ gelf_update_rel (Elf_Data *dst, int ndx,
+@@ -99,7 +93,7 @@ gelf_update_rel (Elf_Data *dst, int ndx,
        }
  
        /* Check whether we have to resize the data buffer.  */
 -      if (unlikely ((ndx + 1) * sizeof (Elf32_Rel) > data_scn->d.d_size))
-+      if (INVALID_NDX (ndx, Elf32_Rel)
-+        || unlikely ((ndx + 1) * sizeof (Elf32_Rel) > data_scn->d.d_size))
++      if (INVALID_NDX (ndx, Elf32_Rel, &data_scn->d))
        {
          __libelf_seterrno (ELF_E_INVALID_INDEX);
          goto out;
-@@ -114,7 +109,8 @@ gelf_update_rel (Elf_Data *dst, int ndx,
+@@ -114,7 +108,7 @@ gelf_update_rel (Elf_Data *dst, int ndx,
    else
      {
        /* Check whether we have to resize the data buffer.  */
 -      if (unlikely ((ndx + 1) * sizeof (Elf64_Rel) > data_scn->d.d_size))
-+      if (INVALID_NDX (ndx, Elf64_Rel)
-+        || unlikely ((ndx + 1) * sizeof (Elf64_Rel) > data_scn->d.d_size))
++      if (INVALID_NDX (ndx, Elf64_Rel, &data_scn->d))
        {
          __libelf_seterrno (ELF_E_INVALID_INDEX);
          goto out;
---- elfutils-0.136/libelf/gelf_update_sym.c.robustify
-+++ elfutils-0.136/libelf/gelf_update_sym.c
+--- elfutils/libelf/gelf_update_sym.c
++++ elfutils/libelf/gelf_update_sym.c
+@@ -1,5 +1,5 @@
+ /* Update symbol information in symbol table at the given index.
+-   Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
++   Copyright (C) 2000-2009 Red Hat, Inc.
+    This file is part of Red Hat elfutils.
+    Written by Ulrich Drepper <drepper@redhat.com>, 2000.
 @@ -72,12 +72,6 @@ gelf_update_sym (data, ndx, src)
    if (data == NULL)
      return 0;
@@ -698,28 +783,33 @@ src/
    if (unlikely (data_scn->d.d_type != ELF_T_SYM))
      {
        /* The type of the data better should match.  */
-@@ -102,7 +96,8 @@ gelf_update_sym (data, ndx, src)
+@@ -102,7 +96,7 @@ gelf_update_sym (data, ndx, src)
        }
  
        /* Check whether we have to resize the data buffer.  */
 -      if (unlikely ((ndx + 1) * sizeof (Elf32_Sym) > data_scn->d.d_size))
-+      if (INVALID_NDX (ndx, Elf32_Sym)
-+        || unlikely ((ndx + 1) * sizeof (Elf32_Sym) > data_scn->d.d_size))
++      if (INVALID_NDX (ndx, Elf32_Sym, &data_scn->d))
        {
          __libelf_seterrno (ELF_E_INVALID_INDEX);
          goto out;
-@@ -125,7 +120,8 @@ gelf_update_sym (data, ndx, src)
+@@ -125,7 +119,7 @@ gelf_update_sym (data, ndx, src)
    else
      {
        /* Check whether we have to resize the data buffer.  */
 -      if (unlikely ((ndx + 1) * sizeof (Elf64_Sym) > data_scn->d.d_size))
-+      if (INVALID_NDX (ndx, Elf64_Sym)
-+        || unlikely ((ndx + 1) * sizeof (Elf64_Sym) > data_scn->d.d_size))
++      if (INVALID_NDX (ndx, Elf64_Sym, &data_scn->d))
        {
          __libelf_seterrno (ELF_E_INVALID_INDEX);
          goto out;
---- elfutils-0.136/libelf/gelf_update_syminfo.c.robustify
-+++ elfutils-0.136/libelf/gelf_update_syminfo.c
+--- elfutils/libelf/gelf_update_syminfo.c
++++ elfutils/libelf/gelf_update_syminfo.c
+@@ -1,5 +1,5 @@
+ /* Update additional symbol information in symbol table at the given index.
+-   Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
++   Copyright (C) 2000-2009 Red Hat, Inc.
+    This file is part of Red Hat elfutils.
+    Written by Ulrich Drepper <drepper@redhat.com>, 2000.
 @@ -72,12 +72,6 @@ gelf_update_syminfo (data, ndx, src)
    if (data == NULL)
      return 0;
@@ -733,18 +823,25 @@ src/
    if (unlikely (data_scn->d.d_type != ELF_T_SYMINFO))
      {
        /* The type of the data better should match.  */
-@@ -93,7 +87,8 @@ gelf_update_syminfo (data, ndx, src)
+@@ -93,7 +87,7 @@ gelf_update_syminfo (data, ndx, src)
    rwlock_wrlock (scn->elf->lock);
  
    /* Check whether we have to resize the data buffer.  */
 -  if (unlikely ((ndx + 1) * sizeof (GElf_Syminfo) > data_scn->d.d_size))
-+  if (INVALID_NDX (ndx, GElf_Syminfo)
-+      || unlikely ((ndx + 1) * sizeof (GElf_Syminfo) > data_scn->d.d_size))
++  if (INVALID_NDX (ndx, GElf_Syminfo, &data_scn->d))
      {
        __libelf_seterrno (ELF_E_INVALID_INDEX);
        goto out;
---- elfutils-0.136/libelf/gelf_update_symshndx.c.robustify
-+++ elfutils-0.136/libelf/gelf_update_symshndx.c
+--- elfutils/libelf/gelf_update_symshndx.c
++++ elfutils/libelf/gelf_update_symshndx.c
+@@ -1,6 +1,6 @@
+ /* Update symbol information and section index in symbol table at the
+    given index.
+-   Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
++   Copyright (C) 2000-2009 Red Hat, Inc.
+    This file is part of Red Hat elfutils.
+    Written by Ulrich Drepper <drepper@redhat.com>, 2000.
 @@ -77,12 +77,6 @@ gelf_update_symshndx (symdata, shndxdata
    if (symdata == NULL)
      return 0;
@@ -758,66 +855,107 @@ src/
    if (unlikely (symdata_scn->d.d_type != ELF_T_SYM))
      {
        /* The type of the data better should match.  */
-@@ -128,7 +122,8 @@ gelf_update_symshndx (symdata, shndxdata
+@@ -128,7 +122,7 @@ gelf_update_symshndx (symdata, shndxdata
        }
  
        /* Check whether we have to resize the data buffer.  */
 -      if (unlikely ((ndx + 1) * sizeof (Elf32_Sym) > symdata_scn->d.d_size))
-+      if (INVALID_NDX (ndx, Elf32_Sym)
-+        || unlikely ((ndx + 1) * sizeof (Elf32_Sym) > symdata_scn->d.d_size))
++      if (INVALID_NDX (ndx, Elf32_Sym, &symdata_scn->d))
        {
          __libelf_seterrno (ELF_E_INVALID_INDEX);
          goto out;
-@@ -151,7 +146,8 @@ gelf_update_symshndx (symdata, shndxdata
+@@ -151,7 +145,7 @@ gelf_update_symshndx (symdata, shndxdata
    else
      {
        /* Check whether we have to resize the data buffer.  */
 -      if (unlikely ((ndx + 1) * sizeof (Elf64_Sym) > symdata_scn->d.d_size))
-+      if (INVALID_NDX (ndx, Elf64_Sym)
-+        || unlikely ((ndx + 1) * sizeof (Elf64_Sym) > symdata_scn->d.d_size))
++      if (INVALID_NDX (ndx, Elf64_Sym, &symdata_scn->d))
        {
          __libelf_seterrno (ELF_E_INVALID_INDEX);
          goto out;
---- elfutils-0.136/libelf/gelf_update_versym.c.robustify
-+++ elfutils-0.136/libelf/gelf_update_versym.c
-@@ -75,7 +75,7 @@ gelf_update_versym (data, ndx, src)
+--- elfutils/libelf/gelf_update_versym.c
++++ elfutils/libelf/gelf_update_versym.c
+@@ -1,5 +1,5 @@
+ /* Update symbol version information.
+-   Copyright (C) 2001, 2002 Red Hat, Inc.
++   Copyright (C) 2001-2009 Red Hat, Inc.
+    This file is part of Red Hat elfutils.
+    Written by Ulrich Drepper <drepper@redhat.com>, 2001.
+@@ -75,8 +75,7 @@ gelf_update_versym (data, ndx, src)
    assert (sizeof (GElf_Versym) == sizeof (Elf64_Versym));
  
    /* Check whether we have to resize the data buffer.  */
 -  if (unlikely (ndx < 0)
-+  if (INVALID_NDX (ndx, GElf_Versym)
-       || unlikely ((ndx + 1) * sizeof (GElf_Versym) > data_scn->d.d_size))
+-      || unlikely ((ndx + 1) * sizeof (GElf_Versym) > data_scn->d.d_size))
++  if (INVALID_NDX (ndx, GElf_Versym, &data_scn->d))
      {
        __libelf_seterrno (ELF_E_INVALID_INDEX);
---- elfutils-0.136/libelf/libelfP.h.robustify
-+++ elfutils-0.136/libelf/libelfP.h
-@@ -611,4 +611,13 @@ extern uint32_t __libelf_crc32 (uint32_t
+       return 0;
+--- elfutils/libelf/libelfP.h
++++ elfutils/libelf/libelfP.h
+@@ -608,4 +608,8 @@ extern uint32_t __libelf_crc32 (uint32_t
  /* Align offset to 4 bytes as needed for note name and descriptor data.  */
  #define NOTE_ALIGN(n) (((n) + 3) & -4U)
  
-+/* Convenience macro.  Assumes int NDX and TYPE with size at least
-+   2 bytes.  */
-+#if SIZE_MAX > 4294967295U
-+# define INVALID_NDX(ndx, type) unlikely (ndx < 0)
-+#else
-+# define INVALID_NDX(ndx, type) \
-+  unlikely ((unsigned int) (ndx) >= SIZE_MAX / sizeof (type))
-+#endif
++/* Convenience macro.  */
++#define INVALID_NDX(ndx, type, data) \
++  unlikely ((data)->d_size / sizeof (type) <= (unsigned int) (ndx))
 +
  #endif  /* libelfP.h */
---- elfutils-0.136/src/elflint.c.robustify
-+++ elfutils-0.136/src/elflint.c
-@@ -131,6 +131,9 @@ static uint32_t shstrndx;
+--- elfutils/src/ChangeLog
++++ elfutils/src/ChangeLog
+@@ -1532,6 +1532,16 @@
+       object symbols or symbols with unknown type.
+       (check_rel): Likewise.
++2005-06-09  Roland McGrath  <roland@redhat.com>
++
++      * readelf.c (handle_dynamic, handle_symtab): Check for bogus sh_link.
++      (handle_verneed, handle_verdef, handle_versym, handle_hash): Likewise.
++      (handle_scngrp): Check for bogus sh_info.
++
++      * strip.c (handle_elf): Check for bogus values in sh_link, sh_info,
++      st_shndx, e_shstrndx, and SHT_GROUP or SHT_SYMTAB_SHNDX data.
++      Don't use assert on input values, instead bail with "illformed" error.
++
+ 2005-06-08  Roland McGrath  <roland@redhat.com>
+       * readelf.c (print_ops): Add consts.
+@@ -1577,6 +1587,19 @@
+       * readelf.c (dwarf_tag_string): Add new tags.
++2005-05-17  Jakub Jelinek  <jakub@redhat.com>
++
++      * 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.
++
++2005-05-14  Jakub Jelinek  <jakub@redhat.com>
++
++      * elflint.c (section_name): Return "<invalid>" instead of
++      crashing on invalid section name.
++      (check_symtab, is_rel_dyn, check_rela, check_rel, check_dynamic,
++      check_symtab_shndx, check_hash, check_versym): Robustify.
++
+ 2005-05-08  Roland McGrath  <roland@redhat.com>
+       * strip.c (handle_elf): Don't translate hash and versym data formats,
+--- elfutils/src/elflint.c
++++ elfutils/src/elflint.c
+@@ -131,6 +131,10 @@ static uint32_t shstrndx;
  /* Array to count references in section groups.  */
  static int *scnref;
  
-+/* Number of sections.  */
++/* Numbers of sections and program headers.  */
 +static unsigned int shnum;
++static unsigned int phnum;
 +
  
  int
  main (int argc, char *argv[])
-@@ -320,10 +323,19 @@ section_name (Ebl *ebl, int idx)
+@@ -319,10 +323,19 @@ section_name (Ebl *ebl, int idx)
  {
    GElf_Shdr shdr_mem;
    GElf_Shdr *shdr;
@@ -838,18 +976,19 @@ src/
  }
  
  
-@@ -345,10 +357,6 @@ static const int valid_e_machine[] =
+@@ -344,11 +357,6 @@ static const int valid_e_machine[] =
    (sizeof (valid_e_machine) / sizeof (valid_e_machine[0]))
  
  
--/* Number of sections.  */
+-/* Numbers of sections and program headers.  */
 -static unsigned int shnum;
+-static unsigned int phnum;
 -
 -
  static void
  check_elf_header (Ebl *ebl, GElf_Ehdr *ehdr, size_t size)
  {
-@@ -613,7 +621,8 @@ section [%2d] '%s': symbol table cannot 
+@@ -632,7 +640,8 @@ section [%2d] '%s': symbol table cannot 
          }
        }
  
@@ -859,7 +998,7 @@ src/
      ERROR (gettext ("\
  section [%2u] '%s': entry size is does not match ElfXX_Sym\n"),
           idx, section_name (ebl, idx));
-@@ -651,7 +660,7 @@ section [%2d] '%s': XINDEX for zeroth en
+@@ -670,7 +679,7 @@ section [%2d] '%s': XINDEX for zeroth en
               xndxscnidx, section_name (ebl, xndxscnidx));
      }
  
@@ -868,7 +1007,7 @@ src/
      {
        sym = gelf_getsymshndx (data, xndxdata, cnt, &sym_mem, &xndx);
        if (sym == NULL)
-@@ -671,7 +680,8 @@ section [%2d] '%s': symbol %zu: invalid 
+@@ -690,7 +699,8 @@ section [%2d] '%s': symbol %zu: invalid 
        else
        {
          name = elf_strptr (ebl->elf, shdr->sh_link, sym->st_name);
@@ -878,7 +1017,7 @@ src/
        }
  
        if (sym->st_shndx == SHN_XINDEX)
-@@ -1001,9 +1011,11 @@ is_rel_dyn (Ebl *ebl, const GElf_Ehdr *e
+@@ -1038,9 +1048,11 @@ is_rel_dyn (Ebl *ebl, const GElf_Ehdr *e
      {
        GElf_Shdr rcshdr_mem;
        const GElf_Shdr *rcshdr = gelf_getshdr (scn, &rcshdr_mem);
@@ -892,7 +1031,7 @@ src/
        {
          /* Found the dynamic section.  Look through it.  */
          Elf_Data *d = elf_getdata (scn, NULL);
-@@ -1013,7 +1025,9 @@ is_rel_dyn (Ebl *ebl, const GElf_Ehdr *e
+@@ -1050,7 +1062,9 @@ is_rel_dyn (Ebl *ebl, const GElf_Ehdr *e
            {
              GElf_Dyn dyn_mem;
              GElf_Dyn *dyn = gelf_getdyn (d, cnt, &dyn_mem);
@@ -903,7 +1042,7 @@ src/
  
              if (dyn->d_tag == DT_RELCOUNT)
                {
-@@ -1027,7 +1041,9 @@ section [%2d] '%s': DT_RELCOUNT used for
+@@ -1064,7 +1078,9 @@ section [%2d] '%s': DT_RELCOUNT used for
                      /* Does the number specified number of relative
                         relocations exceed the total number of
                         relocations?  */
@@ -914,7 +1053,7 @@ src/
                        ERROR (gettext ("\
  section [%2d] '%s': DT_RELCOUNT value %d too high for this section\n"),
                               idx, section_name (ebl, idx),
-@@ -1187,7 +1203,8 @@ section [%2d] '%s': no relocations for m
+@@ -1224,7 +1240,8 @@ section [%2d] '%s': no relocations for m
        }
      }
  
@@ -924,7 +1063,7 @@ src/
      ERROR (gettext (reltype == ELF_T_RELA ? "\
  section [%2d] '%s': section entry size does not match ElfXX_Rela\n" : "\
  section [%2d] '%s': section entry size does not match ElfXX_Rel\n"),
-@@ -1410,7 +1427,8 @@ check_rela (Ebl *ebl, GElf_Ehdr *ehdr, G
+@@ -1447,7 +1464,8 @@ check_rela (Ebl *ebl, GElf_Ehdr *ehdr, G
    Elf_Data *symdata = elf_getdata (symscn, NULL);
    enum load_state state = state_undecided;
  
@@ -934,7 +1073,7 @@ src/
      {
        GElf_Rela rela_mem;
        GElf_Rela *rela = gelf_getrela (data, cnt, &rela_mem);
-@@ -1460,7 +1478,8 @@ check_rel (Ebl *ebl, GElf_Ehdr *ehdr, GE
+@@ -1497,7 +1515,8 @@ check_rel (Ebl *ebl, GElf_Ehdr *ehdr, GE
    Elf_Data *symdata = elf_getdata (symscn, NULL);
    enum load_state state = state_undecided;
  
@@ -944,7 +1083,7 @@ src/
      {
        GElf_Rel rel_mem;
        GElf_Rel *rel = gelf_getrel (data, cnt, &rel_mem);
-@@ -1563,7 +1582,8 @@ section [%2d] '%s': referenced as string
+@@ -1600,7 +1619,8 @@ section [%2d] '%s': referenced as string
           shdr->sh_link, section_name (ebl, shdr->sh_link),
           idx, section_name (ebl, idx));
  
@@ -954,7 +1093,7 @@ src/
      ERROR (gettext ("\
  section [%2d] '%s': section entry size does not match ElfXX_Dyn\n"),
           idx, section_name (ebl, idx));
-@@ -1573,7 +1593,7 @@ section [%2d] '%s': section entry size d
+@@ -1610,7 +1630,7 @@ section [%2d] '%s': section entry size d
           idx, section_name (ebl, idx));
  
    bool non_null_warned = false;
@@ -963,7 +1102,7 @@ src/
      {
        GElf_Dyn dyn_mem;
        GElf_Dyn *dyn = gelf_getdyn (data, cnt, &dyn_mem);
-@@ -1854,6 +1874,8 @@ section [%2d] '%s': entry size does not 
+@@ -1891,6 +1911,8 @@ section [%2d] '%s': entry size does not 
           idx, section_name (ebl, idx));
  
    if (symshdr != NULL
@@ -972,7 +1111,7 @@ src/
        && (shdr->sh_size / shdr->sh_entsize
          < symshdr->sh_size / symshdr->sh_entsize))
      ERROR (gettext ("\
-@@ -1880,6 +1902,12 @@ section [%2d] '%s': extended section ind
+@@ -1917,6 +1939,12 @@ section [%2d] '%s': extended section ind
      }
  
    Elf_Data *data = elf_getdata (elf_getscn (ebl->elf, idx), NULL);
@@ -985,7 +1124,7 @@ src/
  
    if (*((Elf32_Word *) data->d_buf) != 0)
      ERROR (gettext ("symbol 0 should have zero extended section index\n"));
-@@ -1922,7 +1950,7 @@ section [%2d] '%s': hash table section i
+@@ -1959,7 +1987,7 @@ section [%2d] '%s': hash table section i
  
    size_t maxidx = nchain;
  
@@ -994,7 +1133,7 @@ src/
      {
        size_t symsize = symshdr->sh_size / symshdr->sh_entsize;
  
-@@ -1933,18 +1961,28 @@ section [%2d] '%s': hash table section i
+@@ -1970,18 +1998,28 @@ section [%2d] '%s': hash table section i
        maxidx = symsize;
      }
  
@@ -1025,7 +1164,7 @@ src/
  }
  
  
-@@ -1974,18 +2012,28 @@ section [%2d] '%s': hash table section i
+@@ -2011,18 +2049,28 @@ section [%2d] '%s': hash table section i
        maxidx = symsize;
      }
  
@@ -1057,7 +1196,7 @@ src/
  }
  
  
-@@ -2010,7 +2058,7 @@ section [%2d] '%s': bitmask size not pow
+@@ -2047,7 +2095,7 @@ section [%2d] '%s': bitmask size not pow
    if (shdr->sh_size < (4 + bitmask_words + nbuckets) * sizeof (Elf32_Word))
      {
        ERROR (gettext ("\
@@ -1066,7 +1205,7 @@ src/
             idx, section_name (ebl, idx), (long int) shdr->sh_size,
             (long int) ((4 + bitmask_words + nbuckets) * sizeof (Elf32_Word)));
        return;
-@@ -2682,8 +2730,9 @@ section [%2d] '%s' refers in sh_link to 
+@@ -2719,8 +2767,9 @@ section [%2d] '%s' refers in sh_link to 
  
    /* The number of elements in the version symbol table must be the
       same as the number of symbols.  */
@@ -1078,9 +1217,9 @@ src/
      ERROR (gettext ("\
  section [%2d] '%s' has different number of entries than symbol table [%2d] '%s'\n"),
           idx, section_name (ebl, idx),
---- elfutils-0.136/src/readelf.c.robustify
-+++ elfutils-0.136/src/readelf.c
-@@ -1111,6 +1111,8 @@ handle_scngrp (Ebl *ebl, Elf_Scn *scn, G
+--- elfutils/src/readelf.c
++++ elfutils/src/readelf.c
+@@ -1170,6 +1170,8 @@ handle_scngrp (Ebl *ebl, Elf_Scn *scn, G
    Elf32_Word *grpref = (Elf32_Word *) data->d_buf;
  
    GElf_Sym sym_mem;
@@ -1089,7 +1228,7 @@ src/
    printf ((grpref[0] & GRP_COMDAT)
          ? ngettext ("\
  \nCOMDAT section group [%2zu] '%s' with signature '%s' contains %zu entry:\n",
-@@ -1123,8 +1125,8 @@ handle_scngrp (Ebl *ebl, Elf_Scn *scn, G
+@@ -1182,8 +1184,8 @@ handle_scngrp (Ebl *ebl, Elf_Scn *scn, G
                      data->d_size / sizeof (Elf32_Word) - 1),
          elf_ndxscn (scn),
          elf_strptr (ebl->elf, shstrndx, shdr->sh_name),
@@ -1100,7 +1239,7 @@ src/
          ?: gettext ("<INVALID SYMBOL>"),
          data->d_size / sizeof (Elf32_Word) - 1);
  
-@@ -1275,7 +1277,8 @@ static void
+@@ -1334,7 +1336,8 @@ static void
  handle_dynamic (Ebl *ebl, Elf_Scn *scn, GElf_Shdr *shdr)
  {
    int class = gelf_getclass (ebl->elf);
@@ -1110,7 +1249,7 @@ src/
    Elf_Data *data;
    size_t cnt;
    size_t shstrndx;
-@@ -1290,6 +1293,11 @@ handle_dynamic (Ebl *ebl, Elf_Scn *scn, 
+@@ -1349,6 +1352,11 @@ handle_dynamic (Ebl *ebl, Elf_Scn *scn, 
      error (EXIT_FAILURE, 0,
           gettext ("cannot get section header string table index"));
  
@@ -1122,7 +1261,7 @@ src/
    printf (ngettext ("\
  \nDynamic segment contains %lu entry:\n Addr: %#0*" PRIx64 "  Offset: %#08" PRIx64 "  Link to section: [%2u] '%s'\n",
                    "\
-@@ -1299,9 +1307,7 @@ handle_dynamic (Ebl *ebl, Elf_Scn *scn, 
+@@ -1358,9 +1366,7 @@ handle_dynamic (Ebl *ebl, Elf_Scn *scn, 
          class == ELFCLASS32 ? 10 : 18, shdr->sh_addr,
          shdr->sh_offset,
          (int) shdr->sh_link,
@@ -1133,7 +1272,7 @@ src/
    fputs_unlocked (gettext ("  Type              Value\n"), stdout);
  
    for (cnt = 0; cnt < shdr->sh_size / shdr->sh_entsize; ++cnt)
-@@ -1801,6 +1807,13 @@ handle_symtab (Ebl *ebl, Elf_Scn *scn, G
+@@ -1943,6 +1949,13 @@ handle_symtab (Ebl *ebl, Elf_Scn *scn, G
      error (EXIT_FAILURE, 0,
           gettext ("cannot get section header string table index"));
  
@@ -1147,7 +1286,7 @@ src/
    /* Now we can compute the number of entries in the section.  */
    unsigned int nsyms = data->d_size / (class == ELFCLASS32
                                       ? sizeof (Elf32_Sym)
-@@ -1811,15 +1824,12 @@ handle_symtab (Ebl *ebl, Elf_Scn *scn, G
+@@ -1953,15 +1966,12 @@ handle_symtab (Ebl *ebl, Elf_Scn *scn, G
                    nsyms),
          (unsigned int) elf_ndxscn (scn),
          elf_strptr (ebl->elf, shstrndx, shdr->sh_name), nsyms);
@@ -1164,7 +1303,7 @@ src/
  
    fputs_unlocked (class == ELFCLASS32
                  ? gettext ("\
-@@ -2055,7 +2065,13 @@ handle_verneed (Ebl *ebl, Elf_Scn *scn, 
+@@ -2197,7 +2207,13 @@ handle_verneed (Ebl *ebl, Elf_Scn *scn, 
      error (EXIT_FAILURE, 0,
           gettext ("cannot get section header string table index"));
  
@@ -1179,7 +1318,7 @@ src/
    printf (ngettext ("\
  \nVersion needs section [%2u] '%s' contains %d entry:\n Addr: %#0*" PRIx64 "  Offset: %#08" PRIx64 "  Link to section: [%2u] '%s'\n",
                    "\
-@@ -2066,9 +2082,7 @@ handle_verneed (Ebl *ebl, Elf_Scn *scn, 
+@@ -2208,9 +2224,7 @@ handle_verneed (Ebl *ebl, Elf_Scn *scn, 
          class == ELFCLASS32 ? 10 : 18, shdr->sh_addr,
          shdr->sh_offset,
          (unsigned int) shdr->sh_link,
@@ -1190,7 +1329,7 @@ src/
  
    unsigned int offset = 0;
    for (int cnt = shdr->sh_info; --cnt >= 0; )
-@@ -2121,8 +2135,14 @@ handle_verdef (Ebl *ebl, Elf_Scn *scn, G
+@@ -2263,8 +2277,14 @@ handle_verdef (Ebl *ebl, Elf_Scn *scn, G
      error (EXIT_FAILURE, 0,
           gettext ("cannot get section header string table index"));
  
@@ -1206,7 +1345,7 @@ src/
    printf (ngettext ("\
  \nVersion definition section [%2u] '%s' contains %d entry:\n Addr: %#0*" PRIx64 "  Offset: %#08" PRIx64 "  Link to section: [%2u] '%s'\n",
                    "\
-@@ -2134,9 +2154,7 @@ handle_verdef (Ebl *ebl, Elf_Scn *scn, G
+@@ -2276,9 +2296,7 @@ handle_verdef (Ebl *ebl, Elf_Scn *scn, G
          class == ELFCLASS32 ? 10 : 18, shdr->sh_addr,
          shdr->sh_offset,
          (unsigned int) shdr->sh_link,
@@ -1217,7 +1356,7 @@ src/
  
    unsigned int offset = 0;
    for (int cnt = shdr->sh_info; --cnt >= 0; )
-@@ -2398,8 +2416,14 @@ handle_versym (Ebl *ebl, Elf_Scn *scn, G
+@@ -2540,8 +2558,14 @@ handle_versym (Ebl *ebl, Elf_Scn *scn, G
        filename = NULL;
      }
  
@@ -1233,7 +1372,7 @@ src/
    printf (ngettext ("\
  \nVersion symbols section [%2u] '%s' contains %d entry:\n Addr: %#0*" PRIx64 "  Offset: %#08" PRIx64 "  Link to section: [%2u] '%s'",
                    "\
-@@ -2411,9 +2435,7 @@ handle_versym (Ebl *ebl, Elf_Scn *scn, G
+@@ -2553,9 +2577,7 @@ handle_versym (Ebl *ebl, Elf_Scn *scn, G
          class == ELFCLASS32 ? 10 : 18, shdr->sh_addr,
          shdr->sh_offset,
          (unsigned int) shdr->sh_link,
@@ -1244,7 +1383,7 @@ src/
  
    /* Now we can finally look at the actual contents of this section.  */
    for (unsigned int cnt = 0; cnt < shdr->sh_size / shdr->sh_entsize; ++cnt)
-@@ -2465,7 +2487,17 @@ print_hash_info (Ebl *ebl, Elf_Scn *scn,
+@@ -2607,7 +2629,17 @@ print_hash_info (Ebl *ebl, Elf_Scn *scn,
    for (Elf32_Word cnt = 0; cnt < nbucket; ++cnt)
      ++counts[lengths[cnt]];
  
@@ -1263,7 +1402,7 @@ src/
    printf (ngettext ("\
  \nHistogram for bucket list length in section [%2u] '%s' (total of %d bucket):\n Addr: %#0*" PRIx64 "  Offset: %#08" PRIx64 "  Link to section: [%2u] '%s'\n",
                    "\
-@@ -2478,9 +2510,7 @@ print_hash_info (Ebl *ebl, Elf_Scn *scn,
+@@ -2620,9 +2652,7 @@ print_hash_info (Ebl *ebl, Elf_Scn *scn,
          shdr->sh_addr,
          shdr->sh_offset,
          (unsigned int) shdr->sh_link,
@@ -1274,7 +1413,7 @@ src/
  
    if (extrastr != NULL)
      fputs (extrastr, stdout);
-@@ -4039,6 +4069,16 @@ print_debug_aranges_section (Dwfl_Module
+@@ -4263,6 +4293,16 @@ print_debug_aranges_section (Dwfl_Module
        return;
      }
  
@@ -1289,11 +1428,11 @@ src/
 +    }
 +
    printf (ngettext ("\
- \nDWARF section '%s' at offset %#" PRIx64 " contains %zu entry:\n",
+ \nDWARF section [%2zu] '%s' at offset %#" PRIx64 " contains %zu entry:\n",
                    "\
---- elfutils-0.136/src/strip.c.robustify
-+++ elfutils-0.136/src/strip.c
-@@ -544,6 +544,11 @@ handle_elf (int fd, Elf *elf, const char
+--- elfutils/src/strip.c
++++ elfutils/src/strip.c
+@@ -545,6 +545,11 @@ handle_elf (int fd, Elf *elf, const char
        goto fail_close;
      }
  
@@ -1305,7 +1444,7 @@ src/
    /* Storage for section information.  We leave room for two more
       entries since we unconditionally create a section header string
       table.  Maybe some weird tool created an ELF file without one.
-@@ -565,7 +570,7 @@ handle_elf (int fd, Elf *elf, const char
+@@ -566,7 +571,7 @@ handle_elf (int fd, Elf *elf, const char
      {
        /* This should always be true (i.e., there should not be any
         holes in the numbering).  */
@@ -1314,7 +1453,7 @@ src/
  
        shdr_info[cnt].scn = scn;
  
-@@ -578,6 +583,7 @@ handle_elf (int fd, Elf *elf, const char
+@@ -579,6 +584,7 @@ handle_elf (int fd, Elf *elf, const char
                                        shdr_info[cnt].shdr.sh_name);
        if (shdr_info[cnt].name == NULL)
        {
@@ -1322,7 +1461,7 @@ src/
          error (0, 0, gettext ("illformed file '%s'"), fname);
          goto fail_close;
        }
-@@ -587,6 +593,8 @@ handle_elf (int fd, Elf *elf, const char
+@@ -588,6 +594,8 @@ handle_elf (int fd, Elf *elf, const char
  
        /* Remember the shdr.sh_link value.  */
        shdr_info[cnt].old_sh_link = shdr_info[cnt].shdr.sh_link;
@@ -1331,7 +1470,7 @@ src/
  
        /* Sections in files other than relocatable object files which
         are not loaded can be freely moved by us.  In relocatable
-@@ -599,7 +607,7 @@ handle_elf (int fd, Elf *elf, const char
+@@ -600,7 +608,7 @@ handle_elf (int fd, Elf *elf, const char
         appropriate reference.  */
        if (unlikely (shdr_info[cnt].shdr.sh_type == SHT_SYMTAB_SHNDX))
        {
@@ -1340,7 +1479,7 @@ src/
          shdr_info[shdr_info[cnt].shdr.sh_link].symtab_idx = cnt;
        }
        else if (unlikely (shdr_info[cnt].shdr.sh_type == SHT_GROUP))
-@@ -616,7 +624,12 @@ handle_elf (int fd, Elf *elf, const char
+@@ -617,7 +625,12 @@ handle_elf (int fd, Elf *elf, const char
          for (inner = 1;
               inner < shdr_info[cnt].data->d_size / sizeof (Elf32_Word);
               ++inner)
@@ -1353,7 +1492,7 @@ src/
  
          if (inner == 1 || (inner == 2 && (grpref[0] & GRP_COMDAT) == 0))
            /* If the section group contains only one element and this
-@@ -627,7 +640,7 @@ handle_elf (int fd, Elf *elf, const char
+@@ -628,7 +641,7 @@ handle_elf (int fd, Elf *elf, const char
        }
        else if (unlikely (shdr_info[cnt].shdr.sh_type == SHT_GNU_versym))
        {
@@ -1362,7 +1501,7 @@ src/
          shdr_info[shdr_info[cnt].shdr.sh_link].version_idx = cnt;
        }
  
-@@ -635,7 +648,7 @@ handle_elf (int fd, Elf *elf, const char
+@@ -636,7 +649,7 @@ handle_elf (int fd, Elf *elf, const char
         discarded right away.  */
        if ((shdr_info[cnt].shdr.sh_flags & SHF_GROUP) != 0)
        {
@@ -1371,7 +1510,7 @@ src/
  
          if (shdr_info[shdr_info[cnt].group_idx].idx == 0)
            {
-@@ -710,11 +723,15 @@ handle_elf (int fd, Elf *elf, const char
+@@ -711,11 +724,15 @@ handle_elf (int fd, Elf *elf, const char
            {
              /* If a relocation section is marked as being removed make
                 sure the section it is relocating is removed, too.  */
@@ -1389,7 +1528,7 @@ src/
  
          if (shdr_info[cnt].idx == 1)
            {
-@@ -741,7 +758,7 @@ handle_elf (int fd, Elf *elf, const char
+@@ -742,7 +759,7 @@ handle_elf (int fd, Elf *elf, const char
                  if (shdr_info[cnt].symtab_idx != 0
                      && shdr_info[shdr_info[cnt].symtab_idx].data == NULL)
                    {
@@ -1398,7 +1537,7 @@ src/
  
                      shdr_info[shdr_info[cnt].symtab_idx].data
                        = elf_getdata (shdr_info[shdr_info[cnt].symtab_idx].scn,
-@@ -781,6 +798,9 @@ handle_elf (int fd, Elf *elf, const char
+@@ -782,6 +799,9 @@ handle_elf (int fd, Elf *elf, const char
                      else if (scnidx == SHN_XINDEX)
                        scnidx = xndx;
  
@@ -1408,7 +1547,7 @@ src/
                      if (shdr_info[scnidx].idx == 0)
                        /* This symbol table has a real symbol in
                           a discarded section.  So preserve the
-@@ -811,12 +831,16 @@ handle_elf (int fd, Elf *elf, const char
+@@ -812,12 +832,16 @@ handle_elf (int fd, Elf *elf, const char
                }
  
              /* Handle references through sh_info.  */
@@ -1427,7 +1566,7 @@ src/
  
              /* Mark the section as investigated.  */
              shdr_info[cnt].idx = 2;
-@@ -954,7 +978,7 @@ handle_elf (int fd, Elf *elf, const char
+@@ -956,7 +980,7 @@ handle_elf (int fd, Elf *elf, const char
          error (EXIT_FAILURE, 0, gettext ("while generating output file: %s"),
                 elf_errmsg (-1));
  
@@ -1436,7 +1575,7 @@ src/
  
        /* Add this name to the section header string table.  */
        shdr_info[cnt].se = ebl_strtabadd (shst, shdr_info[cnt].name, 0);
-@@ -991,7 +1015,7 @@ handle_elf (int fd, Elf *elf, const char
+@@ -993,7 +1017,7 @@ handle_elf (int fd, Elf *elf, const char
        error (EXIT_FAILURE, 0,
               gettext ("while create section header section: %s"),
               elf_errmsg (-1));
@@ -1445,7 +1584,7 @@ src/
  
        shdr_info[cnt].data = elf_newdata (shdr_info[cnt].newscn);
        if (shdr_info[cnt].data == NULL)
-@@ -1047,7 +1071,7 @@ handle_elf (int fd, Elf *elf, const char
+@@ -1049,7 +1073,7 @@ handle_elf (int fd, Elf *elf, const char
      error (EXIT_FAILURE, 0,
           gettext ("while create section header section: %s"),
           elf_errmsg (-1));
@@ -1454,7 +1593,7 @@ src/
  
    /* Finalize the string table and fill in the correct indices in the
       section headers.  */
-@@ -1137,20 +1161,20 @@ handle_elf (int fd, Elf *elf, const char
+@@ -1139,20 +1163,20 @@ handle_elf (int fd, Elf *elf, const char
                    shndxdata = elf_getdata (shdr_info[shdr_info[cnt].symtab_idx].scn,
                                             NULL);
  
@@ -1478,7 +1617,7 @@ src/
                            >= shdr_info[cnt].data->d_size / elsize);
                  }
  
-@@ -1205,7 +1229,7 @@ handle_elf (int fd, Elf *elf, const char
+@@ -1207,7 +1231,7 @@ handle_elf (int fd, Elf *elf, const char
                      sec = shdr_info[sym->st_shndx].idx;
                    else
                      {
@@ -1487,7 +1626,7 @@ src/
  
                        sec = shdr_info[xshndx].idx;
                      }
-@@ -1226,7 +1250,7 @@ handle_elf (int fd, Elf *elf, const char
+@@ -1228,7 +1252,7 @@ handle_elf (int fd, Elf *elf, const char
                            nxshndx = sec;
                          }
  
@@ -1496,7 +1635,7 @@ src/
  
                        if ((inner != destidx || nshndx != sym->st_shndx
                             || (shndxdata != NULL && nxshndx != xshndx))
-@@ -1250,7 +1274,7 @@ handle_elf (int fd, Elf *elf, const char
+@@ -1252,7 +1276,7 @@ handle_elf (int fd, Elf *elf, const char
                             || shdr_info[cnt].debug_data == NULL)
                      /* This is a section symbol for a section which has
                         been removed.  */
@@ -1505,7 +1644,7 @@ src/
                  }
  
                if (destidx != inner)
-@@ -1437,11 +1461,11 @@ handle_elf (int fd, Elf *elf, const char
+@@ -1439,11 +1463,11 @@ handle_elf (int fd, Elf *elf, const char
                  {
                    GElf_Sym sym_mem;
                    GElf_Sym *sym = gelf_getsym (symd, inner, &sym_mem);
@@ -1519,7 +1658,7 @@ src/
                    size_t hidx = elf_hash (name) % nbucket;
  
                    if (bucket[hidx] == 0)
-@@ -1460,7 +1484,7 @@ handle_elf (int fd, Elf *elf, const char
+@@ -1462,7 +1486,7 @@ handle_elf (int fd, Elf *elf, const char
            else
              {
                /* Alpha and S390 64-bit use 64-bit SHT_HASH entries.  */
@@ -1528,7 +1667,7 @@ src/
                        == sizeof (Elf64_Xword));
  
                Elf64_Xword *bucket = (Elf64_Xword *) hashd->d_buf;
-@@ -1491,11 +1515,11 @@ handle_elf (int fd, Elf *elf, const char
+@@ -1493,11 +1517,11 @@ handle_elf (int fd, Elf *elf, const char
                  {
                    GElf_Sym sym_mem;
                    GElf_Sym *sym = gelf_getsym (symd, inner, &sym_mem);
This page took 0.255076 seconds and 4 git commands to generate.