901878
diffelfutils/backends/ChangeLog git-portable/backends/ChangeLog
08a3ec
--- elfutils/backends/ChangeLog
08a3ec
+++ elfutils/backends/ChangeLog
901878
@@ -498,6 +498,10 @@
08a3ec
 	* ppc_attrs.c (ppc_check_object_attribute): Handle tag
08a3ec
 	GNU_Power_ABI_Struct_Return.
08a3ec
 
08a3ec
+2009-01-23  Roland McGrath  <roland@redhat.com>
08a3ec
+
08a3ec
+	* Makefile.am (libebl_%.so): Use $(LD_AS_NEEDED).
08a3ec
+
08a3ec
 2008-10-04  Ulrich Drepper  <drepper@redhat.com>
08a3ec
 
08a3ec
 	* i386_reloc.def: Fix entries for TLS_GOTDESC, TLS_DESC_CALL, and
901878
@@ -825,6 +829,11 @@
08a3ec
 	* sparc_init.c: Likewise.
08a3ec
 	* x86_64_init.c: Likewise.
08a3ec
 
08a3ec
+2005-11-22  Roland McGrath  <roland@redhat.com>
08a3ec
+
08a3ec
+	* Makefile.am (LD_AS_NEEDED): New variable, substituted by configure.
08a3ec
+	(libebl_%.so rule): Use it in place of -Wl,--as-needed.
08a3ec
+
08a3ec
 2005-11-19  Roland McGrath  <roland@redhat.com>
08a3ec
 
08a3ec
 	* ppc64_reloc.def: REL30 -> ADDR30.
901878
@@ -847,6 +856,9 @@
08a3ec
 	* Makefile.am (uninstall): Don't try to remove $(pkgincludedir).
08a3ec
 	(CLEANFILES): Add libebl_$(m).so.
08a3ec
 
08a3ec
+	* Makefile.am (WEXTRA): New variable, substituted by configure.
08a3ec
+	(AM_CFLAGS): Use it in place of -Wextra.
08a3ec
+
08a3ec
 	* ppc_reloc.def: Update bits per Alan Modra <amodra@bigpond.net.au>.
08a3ec
 	* ppc64_reloc.def: Likewise.
08a3ec
 
901878
diffelfutils/backends/Makefile.am git-portable/backends/Makefile.am
08a3ec
--- elfutils/backends/Makefile.am
08a3ec
+++ elfutils/backends/Makefile.am
8372ba
@@ -119,7 +119,7 @@ libebl_%.so libebl_%.map: libebl_%_pic.a
08a3ec
 	$(LINK) -shared -o $(@:.map=.so) \
08a3ec
 		-Wl,--whole-archive $< $(cpu_$*) -Wl,--no-whole-archive \
08a3ec
 		-Wl,--version-script,$(@:.so=.map) \
8372ba
-		-Wl,-z,defs -Wl,--as-needed $(libelf) $(libdw)
8372ba
+		-Wl,-z,defs $(LD_AS_NEEDED) $(libelf) $(libdw)
901878
 	@$(textrel_check)
08a3ec
 
08a3ec
 libebl_i386.so: $(cpu_i386)
901878
diffelfutils/backends/Makefile.in git-portable/backends/Makefile.in
08a3ec
--- elfutils/backends/Makefile.in
08a3ec
+++ elfutils/backends/Makefile.in
901878
@@ -90,7 +90,8 @@ PRE_UNINSTALL = :
901878
 POST_UNINSTALL = :
901878
 build_triplet = @build@
901878
 host_triplet = @host@
901878
-@SYMBOL_VERSIONING_TRUE@am__append_1 = -DSYMBOL_VERSIONING
08a3ec
+@BUILD_WERROR_TRUE@am__append_1 = $(if $($(*F)_no_Werror),,-Werror)
901878
+@SYMBOL_VERSIONING_TRUE@am__append_2 = -DSYMBOL_VERSIONING
08a3ec
 subdir = backends
08a3ec
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
d56182
 am__aclocal_m4_deps = $(top_srcdir)/m4/biarch.m4 \
901878
@@ -300,6 +301,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
08a3ec
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
08a3ec
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
08a3ec
 LDFLAGS = @LDFLAGS@
08a3ec
+LD_AS_NEEDED = @LD_AS_NEEDED@
08a3ec
 LEX = @LEX@
08a3ec
 LEXLIB = @LEXLIB@
08a3ec
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
901878
@@ -331,6 +333,7 @@ SHELL = @SHELL@
08a3ec
 STRIP = @STRIP@
08a3ec
 USE_NLS = @USE_NLS@
08a3ec
 VERSION = @VERSION@
08a3ec
+WEXTRA = @WEXTRA@
08a3ec
 XGETTEXT = @XGETTEXT@
08a3ec
 XGETTEXT_015 = @XGETTEXT_015@
08a3ec
 XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
901878
@@ -398,14 +401,14 @@ AM_CPPFLAGS = -I. -I$(srcdir) -I$(top_sr
901878
 
901878
 # Warn about stack usage of more than 256K = 262144 bytes.
901878
 @ADD_STACK_USAGE_WARNING_TRUE@STACK_USAGE_WARNING = -Wstack-usage=262144
8372ba
-AM_CFLAGS = -std=gnu99 -Wall -Wshadow -Wformat=2 \
8372ba
-	    $(if $($(*F)_no_Werror),,-Werror) \
8372ba
-	    $(if $($(*F)_no_Wunused),,-Wunused -Wextra) \
901878
-	    $(if $($(*F)_no_Wstack_usage),,$(STACK_USAGE_WARNING)) \
8372ba
-	    $($(*F)_CFLAGS)
8372ba
-
8372ba
+AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \
8372ba
+	$($(*F)_no_Werror),,-Werror) $(if \
08a3ec
+	$($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \
901878
+	$($(*F)_no_Wformat),-Wno-format,-Wformat=2) $(if \
901878
+	$($(*F)_no_Wstack_usage),,$(STACK_USAGE_WARNING)) \
901878
+	$($(*F)_CFLAGS) $(am__append_1)
8372ba
 COMPILE.os = $(filter-out -fprofile-arcs -ftest-coverage, $(COMPILE))
901878
-DEFS.os = -DPIC -DSHARED $(am__append_1)
901878
+DEFS.os = -DPIC -DSHARED $(am__append_2)
8372ba
 CLEANFILES = *.gcno *.gcda $(foreach m,$(modules), libebl_$(m).map \
8372ba
 	libebl_$(m).so $(am_libebl_$(m)_pic_a_OBJECTS))
901878
 textrel_msg = echo "WARNING: TEXTREL found in '$@'"
901878
@@ -912,7 +915,7 @@ libebl_%.so libebl_%.map: libebl_%_pic.a
08a3ec
 	$(LINK) -shared -o $(@:.map=.so) \
08a3ec
 		-Wl,--whole-archive $< $(cpu_$*) -Wl,--no-whole-archive \
08a3ec
 		-Wl,--version-script,$(@:.so=.map) \
8372ba
-		-Wl,-z,defs -Wl,--as-needed $(libelf) $(libdw)
8372ba
+		-Wl,-z,defs $(LD_AS_NEEDED) $(libelf) $(libdw)
901878
 	@$(textrel_check)
08a3ec
 
08a3ec
 libebl_i386.so: $(cpu_i386)
901878
diffelfutils/ChangeLog git-portable/ChangeLog
08a3ec
--- elfutils/ChangeLog
08a3ec
+++ elfutils/ChangeLog
901878
@@ -258,6 +258,8 @@
08a3ec
 
08a3ec
 2012-01-24  Mark Wielaard  <mjw@redhat.com>
08a3ec
 
08a3ec
+	* configure.ac: Wrap AC_COMPILE_IFELSE sources in AC_LANG_SOURCE.
08a3ec
+
08a3ec
 	* COPYING: Fix address. Updated version from gnulib.
08a3ec
 
08a3ec
 2012-01-23  Mark Wielaard  <mjw@redhat.com>
901878
@@ -276,6 +278,9 @@
08a3ec
 
08a3ec
 2011-10-08  Mike Frysinger  <vapier@gentoo.org>
08a3ec
 
08a3ec
+	* configure.ac (--disable-werror): Handle it, controlling BUILD_WERROR
08a3ec
+	automake option.
08a3ec
+
08a3ec
 	* configure.ac: Fix use of AC_ARG_ENABLE to handle $enableval correctly.
08a3ec
 
08a3ec
 2011-10-02  Ulrich Drepper  <drepper@gmail.com>
901878
@@ -297,6 +302,10 @@
08a3ec
 
08a3ec
 	* configure.ac (LOCALEDIR, DATADIRNAME): Removed.
08a3ec
 
08a3ec
+2009-11-22  Roland McGrath  <roland@redhat.com>
08a3ec
+
08a3ec
+	* configure.ac: Use sed and expr instead of modern bash extensions.
08a3ec
+
08a3ec
 2009-09-21  Ulrich Drepper  <drepper@redhat.com>
08a3ec
 
08a3ec
 	* configure.ac: Update for more modern autoconf.
901878
@@ -305,6 +314,10 @@
08a3ec
 
08a3ec
 	* configure.ac (zip_LIBS): Check for liblzma too.
08a3ec
 
08a3ec
+2009-08-17  Roland McGrath  <roland@redhat.com>
08a3ec
+
08a3ec
+	* configure.ac: Check for -fgnu89-inline; add it to WEXTRA if it works.
08a3ec
+
08a3ec
 2009-04-19  Roland McGrath  <roland@redhat.com>
08a3ec
 
08a3ec
 	* configure.ac (eu_version): Round down here, not in version.h macros.
901878
@@ -316,6 +329,8 @@
08a3ec
 
08a3ec
 2009-01-23  Roland McGrath  <roland@redhat.com>
08a3ec
 
08a3ec
+	* configure.ac: Check for __builtin_popcount.
08a3ec
+
08a3ec
 	* configure.ac (zlib check): Check for gzdirect, need zlib >= 1.2.2.3.
08a3ec
 
08a3ec
 	* configure.ac (__thread check): Use AC_LINK_IFELSE, in case of
901878
@@ -396,6 +411,10 @@
08a3ec
 	* configure.ac: Add dummy automake conditional to get dependencies
08a3ec
 	for non-generic linker right.  See src/Makefile.am.
08a3ec
 
08a3ec
+2005-11-22  Roland McGrath  <roland@redhat.com>
08a3ec
+
08a3ec
+	* configure.ac: Check for --as-needed linker option.
08a3ec
+
08a3ec
 2005-11-18  Roland McGrath  <roland@redhat.com>
08a3ec
 
08a3ec
 	* Makefile.am (DISTCHECK_CONFIGURE_FLAGS): New variable.
901878
@@ -443,6 +462,17 @@
08a3ec
 	* Makefile.am (all_SUBDIRS): Add libdwfl.
08a3ec
 	* configure.ac: Write libdwfl/Makefile.
08a3ec
 
08a3ec
+2005-05-31  Roland McGrath  <roland@redhat.com>
08a3ec
+
08a3ec
+	* configure.ac (WEXTRA): Check for -Wextra and set this substitution.
08a3ec
+
08a3ec
+	* configure.ac: Check for struct stat st_?tim members.
08a3ec
+	* src/strip.c (process_file): Use st_?time if st_?tim are not there.
08a3ec
+
08a3ec
+	* configure.ac: Check for futimes function.
08a3ec
+	* src/strip.c (handle_elf) [! HAVE_FUTIMES]: Use utimes instead.
08a3ec
+	(handle_ar) [! HAVE_FUTIMES]: Likewise.
08a3ec
+
08a3ec
 2005-05-19  Roland McGrath  <roland@redhat.com>
08a3ec
 
08a3ec
 	* configure.ac [AH_BOTTOM] (INTDECL, _INTDECL): New macros.
901878
diffelfutils/config/ChangeLog git-portable/config/ChangeLog
08a3ec
--- elfutils/config/ChangeLog
08a3ec
+++ elfutils/config/ChangeLog
901878
@@ -110,6 +110,10 @@
08a3ec
 
08a3ec
 	* known-dwarf.awk: Use gawk.
08a3ec
 
08a3ec
+2011-10-08  Mike Frysinger  <vapier@gentoo.org>
08a3ec
+
08a3ec
+	* eu.am [BUILD_WERROR]: Conditionalize -Werror use on this.
08a3ec
+
08a3ec
 2010-07-02  Ulrich Drepper  <drepper@redhat.com>
08a3ec
 
08a3ec
 	* elfutils.spec.in: Add more BuildRequires.
901878
diffelfutils/config/eu.am git-portable/config/eu.am
08a3ec
--- elfutils/config/eu.am
08a3ec
+++ elfutils/config/eu.am
08a3ec
@@ -1,6 +1,6 @@
08a3ec
 ## Common automake fragments for elfutils subdirectory makefiles.
08a3ec
 ##
8372ba
-## Copyright (C) 2010, 2014 Red Hat, Inc.
8372ba
+## Copyright (C) 2010-2011, 2014 Red Hat, Inc.
08a3ec
 ##
08a3ec
 ## This file is part of elfutils.
08a3ec
 ##
901878
@@ -29,6 +29,9 @@
08a3ec
 ## not, see <http://www.gnu.org/licenses/>.
08a3ec
 ##
08a3ec
 
08a3ec
+WEXTRA = @WEXTRA@
08a3ec
+LD_AS_NEEDED = @LD_AS_NEEDED@
08a3ec
+
08a3ec
 DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H -DLOCALEDIR='"${localedir}"'
08a3ec
 AM_CPPFLAGS = -I. -I$(srcdir) -I$(top_srcdir)/lib -I..
901878
 
901878
@@ -38,12 +41,17 @@ STACK_USAGE_WARNING=-Wstack-usage=262144
901878
 else
901878
 STACK_USAGE_WARNING=
901878
 endif
8372ba
-AM_CFLAGS = -std=gnu99 -Wall -Wshadow -Wformat=2 \
8372ba
+AM_CFLAGS = -std=gnu99 -Wall -Wshadow \
8372ba
 	    $(if $($(*F)_no_Werror),,-Werror) \
08a3ec
-	    $(if $($(*F)_no_Wunused),,-Wunused -Wextra) \
08a3ec
+	    $(if $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) \
8372ba
+	    $(if $($(*F)_no_Wformat),-Wno-format,-Wformat=2) \
901878
 	    $(if $($(*F)_no_Wstack_usage),,$(STACK_USAGE_WARNING)) \
08a3ec
 	    $($(*F)_CFLAGS)
08a3ec
 
08a3ec
+if BUILD_WERROR
08a3ec
+AM_CFLAGS += $(if $($(*F)_no_Werror),,-Werror)
08a3ec
+endif
08a3ec
+
8372ba
 COMPILE.os = $(filter-out -fprofile-arcs -ftest-coverage, $(COMPILE))
8372ba
 
901878
 DEFS.os = -DPIC -DSHARED
901878
diffelfutils/config/Makefile.in git-portable/config/Makefile.in
08a3ec
--- elfutils/config/Makefile.in
08a3ec
+++ elfutils/config/Makefile.in
901878
@@ -160,6 +160,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
08a3ec
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
08a3ec
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
08a3ec
 LDFLAGS = @LDFLAGS@
08a3ec
+LD_AS_NEEDED = @LD_AS_NEEDED@
08a3ec
 LEX = @LEX@
08a3ec
 LEXLIB = @LEXLIB@
08a3ec
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
901878
@@ -191,6 +192,7 @@ SHELL = @SHELL@
08a3ec
 STRIP = @STRIP@
08a3ec
 USE_NLS = @USE_NLS@
08a3ec
 VERSION = @VERSION@
08a3ec
+WEXTRA = @WEXTRA@
08a3ec
 XGETTEXT = @XGETTEXT@
08a3ec
 XGETTEXT_015 = @XGETTEXT_015@
08a3ec
 XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
901878
diffelfutils/config.h.in git-portable/config.h.in
08a3ec
--- elfutils/config.h.in
08a3ec
+++ elfutils/config.h.in
901878
@@ -6,6 +6,12 @@
8372ba
 /* Should ar and ranlib use -D behavior by default? */
8372ba
 #undef DEFAULT_AR_DETERMINISTIC
08a3ec
 
08a3ec
+/* Have __builtin_popcount. */
08a3ec
+#undef HAVE_BUILTIN_POPCOUNT
08a3ec
+
901878
+/* Define to 1 if you have the `futimens' function. */
901878
+#undef HAVE_FUTIMENS
901878
+
d56182
 /* Define to 1 if you have the <inttypes.h> header file. */
d56182
 #undef HAVE_INTTYPES_H
08a3ec
 
901878
@@ -105,4 +111,7 @@
08a3ec
 /* Define for large files, on AIX-style hosts. */
08a3ec
 #undef _LARGE_FILES
08a3ec
 
08a3ec
+/* Stubbed out if missing compiler support. */
08a3ec
+#undef __thread
08a3ec
+
08a3ec
 #include <eu-config.h>
901878
diffelfutils/configure git-portable/configure
08a3ec
--- elfutils/configure
08a3ec
+++ elfutils/configure
901878
@@ -672,6 +672,8 @@ ZLIB_TRUE
08a3ec
 LIBEBL_SUBDIR
08a3ec
 TESTS_RPATH_FALSE
08a3ec
 TESTS_RPATH_TRUE
08a3ec
+BUILD_WERROR_FALSE
08a3ec
+BUILD_WERROR_TRUE
08a3ec
 BUILD_STATIC_FALSE
08a3ec
 BUILD_STATIC_TRUE
08a3ec
 USE_VALGRIND_FALSE
901878
@@ -687,6 +689,8 @@ NEVER_TRUE
08a3ec
 base_cpu
08a3ec
 NATIVE_LD_FALSE
08a3ec
 NATIVE_LD_TRUE
08a3ec
+LD_AS_NEEDED
08a3ec
+WEXTRA
d56182
 NM
d56182
 READELF
d56182
 ac_ct_AR
901878
@@ -807,6 +811,7 @@ enable_gprof
08a3ec
 enable_gcov
901878
 enable_sanitize_undefined
08a3ec
 enable_valgrind
08a3ec
+enable_werror
08a3ec
 enable_tests_rpath
08a3ec
 enable_libebl_subdir
08a3ec
 with_zlib
901878
@@ -1467,6 +1472,7 @@ Optional Features:
901878
   --enable-sanitize-undefined
901878
                           Use gcc undefined behaviour sanitizer
08a3ec
   --enable-valgrind       run all tests under valgrind
08a3ec
+  --disable-werror        do not build with -Werror
08a3ec
   --enable-tests-rpath    build $ORIGIN-using rpath into tests
08a3ec
   --enable-libebl-subdir=DIR
08a3ec
                           install libebl_CPU modules in $(libdir)/DIR
901878
@@ -1665,6 +1671,73 @@ fi
901878
 
901878
 } # ac_fn_c_try_link
901878
 
901878
+# ac_fn_c_check_func LINENO FUNC VAR
901878
+# ----------------------------------
901878
+# Tests whether FUNC exists, setting the cache variable VAR accordingly
901878
+ac_fn_c_check_func ()
901878
+{
901878
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
901878
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
901878
+$as_echo_n "checking for $2... " >&6; }
901878
+if eval \${$3+:} false; then :
901878
+  $as_echo_n "(cached) " >&6
901878
+else
901878
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
901878
+/* end confdefs.h.  */
901878
+/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
901878
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
901878
+#define $2 innocuous_$2
901878
+
901878
+/* System header to define __stub macros and hopefully few prototypes,
901878
+    which can conflict with char $2 (); below.
901878
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
901878
+    <limits.h> exists even on freestanding compilers.  */
901878
+
901878
+#ifdef __STDC__
901878
+# include <limits.h>
901878
+#else
901878
+# include <assert.h>
901878
+#endif
901878
+
901878
+#undef $2
901878
+
901878
+/* Override any GCC internal prototype to avoid an error.
901878
+   Use char because int might match the return type of a GCC
901878
+   builtin and then its argument prototype would still apply.  */
901878
+#ifdef __cplusplus
901878
+extern "C"
901878
+#endif
901878
+char $2 ();
901878
+/* The GNU C library defines this for functions which it implements
901878
+    to always fail with ENOSYS.  Some functions are actually named
901878
+    something starting with __ and the normal name is an alias.  */
901878
+#if defined __stub_$2 || defined __stub___$2
901878
+choke me
901878
+#endif
901878
+
901878
+int
901878
+main ()
901878
+{
901878
+return $2 ();
901878
+  ;
901878
+  return 0;
901878
+}
901878
+_ACEOF
901878
+if ac_fn_c_try_link "$LINENO"; then :
901878
+  eval "$3=yes"
901878
+else
901878
+  eval "$3=no"
901878
+fi
901878
+rm -f core conftest.err conftest.$ac_objext \
901878
+    conftest$ac_exeext conftest.$ac_ext
901878
+fi
901878
+eval ac_res=\$$3
901878
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
901878
+$as_echo "$ac_res" >&6; }
901878
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
901878
+
901878
+} # ac_fn_c_check_func
901878
+
901878
 # ac_fn_c_try_run LINENO
901878
 # ----------------------
901878
 # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
901878
@@ -4825,6 +4898,18 @@ else
901878
 fi
901878
 
901878
 
901878
+for ac_func in futimens
901878
+do :
901878
+  ac_fn_c_check_func "$LINENO" "futimens" "ac_cv_func_futimens"
901878
+if test "x$ac_cv_func_futimens" = xyes; then :
901878
+  cat >>confdefs.h <<_ACEOF
901878
+#define HAVE_FUTIMENS 1
901878
+_ACEOF
901878
+
901878
+fi
901878
+done
901878
+
901878
+
901878
 # We use -std=gnu99 but have explicit checks for some language constructs
901878
 # and GNU extensions since some compilers claim GNU99 support, but don't
901878
 # really support all language extensions. In particular we need
901878
@@ -4873,6 +4958,130 @@ if test "x$ac_cv_c99" != xyes; then :
901878
   as_fn_error $? "gcc with GNU99 support required" "$LINENO" 5
08a3ec
 fi
08a3ec
 
08a3ec
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -Wextra option to $CC" >&5
08a3ec
+$as_echo_n "checking for -Wextra option to $CC... " >&6; }
08a3ec
+if ${ac_cv_cc_wextra+:} false; then :
08a3ec
+  $as_echo_n "(cached) " >&6
08a3ec
+else
08a3ec
+  old_CFLAGS="$CFLAGS"
08a3ec
+CFLAGS="$CFLAGS -Wextra"
08a3ec
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
08a3ec
+/* end confdefs.h.  */
08a3ec
+void foo (void) { }
08a3ec
+_ACEOF
08a3ec
+if ac_fn_c_try_compile "$LINENO"; then :
08a3ec
+  ac_cv_cc_wextra=yes
08a3ec
+else
08a3ec
+  ac_cv_cc_wextra=no
08a3ec
+fi
08a3ec
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
08a3ec
+CFLAGS="$old_CFLAGS"
08a3ec
+fi
08a3ec
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cc_wextra" >&5
08a3ec
+$as_echo "$ac_cv_cc_wextra" >&6; }
08a3ec
+
08a3ec
+if test "x$ac_cv_cc_wextra" = xyes; then :
08a3ec
+  WEXTRA=-Wextra
08a3ec
+else
08a3ec
+  WEXTRA=-W
08a3ec
+fi
08a3ec
+
08a3ec
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -fgnu89-inline option to $CC" >&5
08a3ec
+$as_echo_n "checking for -fgnu89-inline option to $CC... " >&6; }
08a3ec
+if ${ac_cv_cc_gnu89_inline+:} false; then :
08a3ec
+  $as_echo_n "(cached) " >&6
08a3ec
+else
08a3ec
+  old_CFLAGS="$CFLAGS"
08a3ec
+CFLAGS="$CFLAGS -fgnu89-inline -Werror"
08a3ec
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
08a3ec
+/* end confdefs.h.  */
08a3ec
+
08a3ec
+void foo (void)
08a3ec
+{
08a3ec
+  inline void bar (void) {}
08a3ec
+  bar ();
08a3ec
+}
08a3ec
+extern inline void baz (void) {}
08a3ec
+
08a3ec
+_ACEOF
08a3ec
+if ac_fn_c_try_compile "$LINENO"; then :
08a3ec
+  ac_cv_cc_gnu89_inline=yes
08a3ec
+else
08a3ec
+  ac_cv_cc_gnu89_inline=no
08a3ec
+fi
08a3ec
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
08a3ec
+CFLAGS="$old_CFLAGS"
08a3ec
+fi
08a3ec
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cc_gnu89_inline" >&5
08a3ec
+$as_echo "$ac_cv_cc_gnu89_inline" >&6; }
08a3ec
+if test "x$ac_cv_cc_gnu89_inline" = xyes; then :
08a3ec
+  WEXTRA="${WEXTRA:+$WEXTRA }-fgnu89-inline"
08a3ec
+fi
08a3ec
+
08a3ec
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --as-needed linker option" >&5
08a3ec
+$as_echo_n "checking for --as-needed linker option... " >&6; }
08a3ec
+if ${ac_cv_as_needed+:} false; then :
08a3ec
+  $as_echo_n "(cached) " >&6
08a3ec
+else
08a3ec
+  cat > conftest.c <
08a3ec
+int main (void) { return 0; }
08a3ec
+EOF
08a3ec
+if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
08a3ec
+			    -fPIC -shared -o conftest.so conftest.c
08a3ec
+			    -Wl,--as-needed 1>&5'
08a3ec
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
08a3ec
+  (eval $ac_try) 2>&5
08a3ec
+  ac_status=$?
08a3ec
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
08a3ec
+  test $ac_status = 0; }; }
08a3ec
+then
08a3ec
+  ac_cv_as_needed=yes
08a3ec
+else
08a3ec
+  ac_cv_as_needed=no
08a3ec
+fi
08a3ec
+rm -f conftest*
08a3ec
+fi
08a3ec
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_as_needed" >&5
08a3ec
+$as_echo "$ac_cv_as_needed" >&6; }
08a3ec
+if test "x$ac_cv_as_needed" = xyes; then :
08a3ec
+  LD_AS_NEEDED=-Wl,--as-needed
08a3ec
+else
08a3ec
+  LD_AS_NEEDED=
08a3ec
+fi
08a3ec
+
08a3ec
+
08a3ec
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_popcount" >&5
08a3ec
+$as_echo_n "checking for __builtin_popcount... " >&6; }
08a3ec
+if ${ac_cv_popcount+:} false; then :
08a3ec
+  $as_echo_n "(cached) " >&6
08a3ec
+else
08a3ec
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
08a3ec
+/* end confdefs.h.  */
08a3ec
+
08a3ec
+int
08a3ec
+main ()
08a3ec
+{
08a3ec
+exit (__builtin_popcount (127));
08a3ec
+  ;
08a3ec
+  return 0;
08a3ec
+}
08a3ec
+_ACEOF
08a3ec
+if ac_fn_c_try_link "$LINENO"; then :
08a3ec
+  ac_cv_popcount=yes
08a3ec
+else
08a3ec
+  ac_cv_popcount=no
08a3ec
+fi
08a3ec
+rm -f core conftest.err conftest.$ac_objext \
08a3ec
+    conftest$ac_exeext conftest.$ac_ext
08a3ec
+fi
08a3ec
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_popcount" >&5
08a3ec
+$as_echo "$ac_cv_popcount" >&6; }
08a3ec
+if test "x$ac_cv_popcount" = xyes; then :
08a3ec
+
08a3ec
+$as_echo "#define HAVE_BUILTIN_POPCOUNT 1" >>confdefs.h
08a3ec
+
08a3ec
+fi
08a3ec
+
08a3ec
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __thread support" >&5
08a3ec
 $as_echo_n "checking for __thread support... " >&6; }
08a3ec
 if ${ac_cv_tls+:} false; then :
901878
@@ -4910,7 +5119,13 @@ fi
08a3ec
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_tls" >&5
08a3ec
 $as_echo "$ac_cv_tls" >&6; }
08a3ec
 if test "x$ac_cv_tls" != xyes; then :
08a3ec
-  as_fn_error $? "__thread support required" "$LINENO" 5
08a3ec
+  if test "$use_locks" = yes; then :
08a3ec
+  as_fn_error $? "--enable-thread-safety requires __thread support" "$LINENO" 5
08a3ec
+else
08a3ec
+
08a3ec
+$as_echo "#define __thread /* empty: no multi-thread support */" >>confdefs.h
08a3ec
+
08a3ec
+fi
08a3ec
 fi
08a3ec
 
08a3ec
 # Check whether --enable-largefile was given.
901878
@@ -5318,6 +5533,22 @@ else
08a3ec
 fi
08a3ec
 
08a3ec
 
08a3ec
+# Check whether --enable-werror was given.
08a3ec
+if test "${enable_werror+set}" = set; then :
08a3ec
+  enableval=$enable_werror; enable_werror=$enableval
08a3ec
+else
08a3ec
+  enable_werror=yes
08a3ec
+fi
08a3ec
+
08a3ec
+ if test "$enable_werror" = yes; then
08a3ec
+  BUILD_WERROR_TRUE=
08a3ec
+  BUILD_WERROR_FALSE='#'
08a3ec
+else
08a3ec
+  BUILD_WERROR_TRUE='#'
08a3ec
+  BUILD_WERROR_FALSE=
08a3ec
+fi
08a3ec
+
08a3ec
+
08a3ec
 # Check whether --enable-tests-rpath was given.
08a3ec
 if test "${enable_tests_rpath+set}" = set; then :
08a3ec
   enableval=$enable_tests_rpath; tests_use_rpath=$enableval
901878
@@ -6199,7 +6430,7 @@ case "$eu_version" in
08a3ec
 esac
08a3ec
 
08a3ec
 # Round up to the next release API (x.y) version.
08a3ec
-eu_version=$(( (eu_version + 999) / 1000 ))
08a3ec
+eu_version=`expr \( $eu_version + 999 \) / 1000`
08a3ec
 
901878
 MODVERSION="Build for ${LIBEBL_SUBDIR} ${eu_version} ${ac_cv_build}"
901878
 
901878
@@ -7088,6 +7319,10 @@ if test -z "${BUILD_STATIC_TRUE}" && tes
08a3ec
   as_fn_error $? "conditional \"BUILD_STATIC\" was never defined.
08a3ec
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
08a3ec
 fi
08a3ec
+if test -z "${BUILD_WERROR_TRUE}" && test -z "${BUILD_WERROR_FALSE}"; then
08a3ec
+  as_fn_error $? "conditional \"BUILD_WERROR\" was never defined.
08a3ec
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
08a3ec
+fi
08a3ec
 if test -z "${TESTS_RPATH_TRUE}" && test -z "${TESTS_RPATH_FALSE}"; then
08a3ec
   as_fn_error $? "conditional \"TESTS_RPATH\" was never defined.
08a3ec
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
901878
diffelfutils/configure.ac git-portable/configure.ac
08a3ec
--- elfutils/configure.ac
08a3ec
+++ elfutils/configure.ac
901878
@@ -73,6 +73,8 @@ m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
901878
 AC_CHECK_TOOL([READELF], [readelf])
901878
 AC_CHECK_TOOL([NM], [nm])
901878
 
901878
+AC_CHECK_FUNCS([futimens])
901878
+
901878
 # We use -std=gnu99 but have explicit checks for some language constructs
901878
 # and GNU extensions since some compilers claim GNU99 support, but don't
901878
 # really support all language extensions. In particular we need
901878
@@ -106,6 +108,54 @@ CFLAGS="$old_CFLAGS"])
08a3ec
 AS_IF([test "x$ac_cv_c99" != xyes],
901878
       AC_MSG_ERROR([gcc with GNU99 support required]))
08a3ec
 
08a3ec
+AC_CACHE_CHECK([for -Wextra option to $CC], ac_cv_cc_wextra, [dnl
08a3ec
+old_CFLAGS="$CFLAGS"
08a3ec
+CFLAGS="$CFLAGS -Wextra"
08a3ec
+AC_COMPILE_IFELSE([AC_LANG_SOURCE([void foo (void) { }])],
08a3ec
+		  ac_cv_cc_wextra=yes, ac_cv_cc_wextra=no)
08a3ec
+CFLAGS="$old_CFLAGS"])
08a3ec
+AC_SUBST(WEXTRA)
08a3ec
+AS_IF([test "x$ac_cv_cc_wextra" = xyes], [WEXTRA=-Wextra], [WEXTRA=-W])
08a3ec
+
08a3ec
+AC_CACHE_CHECK([for -fgnu89-inline option to $CC], ac_cv_cc_gnu89_inline, [dnl
08a3ec
+old_CFLAGS="$CFLAGS"
08a3ec
+CFLAGS="$CFLAGS -fgnu89-inline -Werror"
08a3ec
+AC_COMPILE_IFELSE([AC_LANG_SOURCE([
08a3ec
+void foo (void)
08a3ec
+{
08a3ec
+  inline void bar (void) {}
08a3ec
+  bar ();
08a3ec
+}
08a3ec
+extern inline void baz (void) {}
08a3ec
+])], ac_cv_cc_gnu89_inline=yes, ac_cv_cc_gnu89_inline=no)
08a3ec
+CFLAGS="$old_CFLAGS"])
08a3ec
+AS_IF([test "x$ac_cv_cc_gnu89_inline" = xyes],
08a3ec
+      [WEXTRA="${WEXTRA:+$WEXTRA }-fgnu89-inline"])
08a3ec
+
08a3ec
+AC_CACHE_CHECK([for --as-needed linker option],
08a3ec
+	       ac_cv_as_needed, [dnl
08a3ec
+cat > conftest.c <
08a3ec
+int main (void) { return 0; }
08a3ec
+EOF
08a3ec
+if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
08a3ec
+			    -fPIC -shared -o conftest.so conftest.c
08a3ec
+			    -Wl,--as-needed 1>&AS_MESSAGE_LOG_FD])
08a3ec
+then
08a3ec
+  ac_cv_as_needed=yes
08a3ec
+else
08a3ec
+  ac_cv_as_needed=no
08a3ec
+fi
08a3ec
+rm -f conftest*])
08a3ec
+AS_IF([test "x$ac_cv_as_needed" = xyes],
08a3ec
+      [LD_AS_NEEDED=-Wl,--as-needed], [LD_AS_NEEDED=])
08a3ec
+AC_SUBST(LD_AS_NEEDED)
08a3ec
+
08a3ec
+AC_CACHE_CHECK([for __builtin_popcount], ac_cv_popcount, [dnl
08a3ec
+AC_LINK_IFELSE([AC_LANG_PROGRAM([], [[exit (__builtin_popcount (127));]])],
08a3ec
+	       ac_cv_popcount=yes, ac_cv_popcount=no)])
08a3ec
+AS_IF([test "x$ac_cv_popcount" = xyes],
08a3ec
+      [AC_DEFINE([HAVE_BUILTIN_POPCOUNT], [1], [Have __builtin_popcount.])])
08a3ec
+
08a3ec
 AC_CACHE_CHECK([for __thread support], ac_cv_tls, [dnl
08a3ec
 # Use the same flags that we use for our DSOs, so the test is representative.
08a3ec
 # Some old compiler/linker/libc combinations fail some ways and not others.
901878
@@ -122,7 +172,10 @@ static __thread int a; int foo (int b) {
08a3ec
 CFLAGS="$save_CFLAGS"
08a3ec
 LDFLAGS="$save_LDFLAGS"])
08a3ec
 AS_IF([test "x$ac_cv_tls" != xyes],
08a3ec
-      AC_MSG_ERROR([__thread support required]))
08a3ec
+      [AS_IF([test "$use_locks" = yes],
08a3ec
+	     [AC_MSG_ERROR([--enable-thread-safety requires __thread support])],
08a3ec
+	     [AC_DEFINE([__thread], [/* empty: no multi-thread support */],
08a3ec
+			[Stubbed out if missing compiler support.])])])
08a3ec
 
08a3ec
 dnl This test must come as early as possible after the compiler configuration
08a3ec
 dnl tests, because the choice of the file model can (in principle) affect
901878
@@ -224,6 +277,11 @@ AM_CONDITIONAL(USE_VALGRIND, test "$use_
08a3ec
 AM_CONDITIONAL(BUILD_STATIC, [dnl
8372ba
 test "$use_gprof" = yes -o "$use_gcov" = yes])
08a3ec
 
08a3ec
+AC_ARG_ENABLE([werror],
08a3ec
+AS_HELP_STRING([--disable-werror],[do not build with -Werror]),
08a3ec
+	       [enable_werror=$enableval], [enable_werror=yes])
08a3ec
+AM_CONDITIONAL(BUILD_WERROR, test "$enable_werror" = yes)
08a3ec
+
08a3ec
 AC_ARG_ENABLE([tests-rpath],
08a3ec
 AS_HELP_STRING([--enable-tests-rpath],[build $ORIGIN-using rpath into tests]),
08a3ec
 	       [tests_use_rpath=$enableval], [tests_use_rpath=no])
901878
@@ -388,7 +446,7 @@ case "$eu_version" in
08a3ec
 esac
08a3ec
 
08a3ec
 # Round up to the next release API (x.y) version.
08a3ec
-eu_version=$(( (eu_version + 999) / 1000 ))
08a3ec
+eu_version=`expr \( $eu_version + 999 \) / 1000`
08a3ec
 
901878
 dnl Unique ID for this build.
901878
 MODVERSION="Build for ${LIBEBL_SUBDIR} ${eu_version} ${ac_cv_build}"
901878
diffelfutils/lib/ChangeLog git-portable/lib/ChangeLog
08a3ec
--- elfutils/lib/ChangeLog
08a3ec
+++ elfutils/lib/ChangeLog
901878
@@ -73,6 +73,9 @@
08a3ec
 
08a3ec
 2009-01-23  Roland McGrath  <roland@redhat.com>
08a3ec
 
08a3ec
+	* eu-config.h [! HAVE_BUILTIN_POPCOUNT]
08a3ec
+	(__builtin_popcount): New inline function.
08a3ec
+
08a3ec
 	* eu-config.h: Add multiple inclusion protection.
08a3ec
 
08a3ec
 2009-01-17  Ulrich Drepper  <drepper@redhat.com>
901878
@@ -129,6 +132,11 @@
08a3ec
 	* Makefile.am (libeu_a_SOURCES): Add it.
08a3ec
 	* system.h: Declare crc32_file.
08a3ec
 
08a3ec
+2005-02-07  Roland McGrath  <roland@redhat.com>
08a3ec
+
08a3ec
+	* Makefile.am (WEXTRA): New variable, substituted by configure.
08a3ec
+	(AM_CFLAGS): Use it in place of -Wextra.
08a3ec
+
08a3ec
 2005-04-30  Ulrich Drepper  <drepper@redhat.com>
08a3ec
 
08a3ec
 	* Makefile.am: Use -ffunction-sections for xmalloc.c.
901878
diffelfutils/lib/eu-config.h git-portable/lib/eu-config.h
08a3ec
--- elfutils/lib/eu-config.h
08a3ec
+++ elfutils/lib/eu-config.h
901878
@@ -163,6 +163,17 @@ asm (".section predict_data, \"aw\"; .pr
08a3ec
 /* This macro is used by the tests conditionalize for standalone building.  */
08a3ec
 #define ELFUTILS_HEADER(name) <lib##name.h>
08a3ec
 
08a3ec
+#ifndef HAVE_BUILTIN_POPCOUNT
08a3ec
+# define __builtin_popcount hakmem_popcount
08a3ec
+static inline unsigned int __attribute__ ((unused))
08a3ec
+hakmem_popcount (unsigned int x)
08a3ec
+{
08a3ec
+  /* HAKMEM 169 */
08a3ec
+  unsigned int n = x - ((x >> 1) & 033333333333) - ((x >> 2) & 011111111111);
08a3ec
+  return ((n + (n >> 3)) & 030707070707) % 63;
08a3ec
+}
08a3ec
+#endif	/* HAVE_BUILTIN_POPCOUNT */
08a3ec
+
08a3ec
 
901878
 #ifdef SYMBOL_VERSIONING
08a3ec
 # define OLD_VERSION(name, version) \
901878
diffelfutils/lib/Makefile.in git-portable/lib/Makefile.in
08a3ec
--- elfutils/lib/Makefile.in
08a3ec
+++ elfutils/lib/Makefile.in
901878
@@ -89,7 +89,8 @@ PRE_UNINSTALL = :
901878
 POST_UNINSTALL = :
901878
 build_triplet = @build@
901878
 host_triplet = @host@
901878
-@SYMBOL_VERSIONING_TRUE@am__append_1 = -DSYMBOL_VERSIONING
08a3ec
+@BUILD_WERROR_TRUE@am__append_1 = $(if $($(*F)_no_Werror),,-Werror)
901878
+@SYMBOL_VERSIONING_TRUE@am__append_2 = -DSYMBOL_VERSIONING
08a3ec
 subdir = lib
08a3ec
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
d56182
 am__aclocal_m4_deps = $(top_srcdir)/m4/biarch.m4 \
901878
@@ -212,6 +213,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
08a3ec
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
08a3ec
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
08a3ec
 LDFLAGS = @LDFLAGS@
08a3ec
+LD_AS_NEEDED = @LD_AS_NEEDED@
08a3ec
 LEX = @LEX@
08a3ec
 LEXLIB = @LEXLIB@
08a3ec
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
901878
@@ -243,6 +245,7 @@ SHELL = @SHELL@
08a3ec
 STRIP = @STRIP@
08a3ec
 USE_NLS = @USE_NLS@
08a3ec
 VERSION = @VERSION@
08a3ec
+WEXTRA = @WEXTRA@
08a3ec
 XGETTEXT = @XGETTEXT@
08a3ec
 XGETTEXT_015 = @XGETTEXT_015@
08a3ec
 XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
901878
@@ -309,13 +312,14 @@ AM_CPPFLAGS = -I. -I$(srcdir) -I$(top_sr
901878
 
901878
 # Warn about stack usage of more than 256K = 262144 bytes.
901878
 @ADD_STACK_USAGE_WARNING_TRUE@STACK_USAGE_WARNING = -Wstack-usage=262144
8372ba
-AM_CFLAGS = -std=gnu99 -Wall -Wshadow -Wformat=2 $(if \
8372ba
+AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \
8372ba
 	$($(*F)_no_Werror),,-Werror) $(if \
901878
-	$($(*F)_no_Wunused),,-Wunused -Wextra) $(if \
08a3ec
+	$($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \
901878
+	$($(*F)_no_Wformat),-Wno-format,-Wformat=2) $(if \
901878
 	$($(*F)_no_Wstack_usage),,$(STACK_USAGE_WARNING)) \
901878
-	$($(*F)_CFLAGS) -fpic
901878
+	$($(*F)_CFLAGS) $(am__append_1) -fpic
8372ba
 COMPILE.os = $(filter-out -fprofile-arcs -ftest-coverage, $(COMPILE))
901878
-DEFS.os = -DPIC -DSHARED $(am__append_1)
901878
+DEFS.os = -DPIC -DSHARED $(am__append_2)
8372ba
 CLEANFILES = *.gcno *.gcda
901878
 textrel_msg = echo "WARNING: TEXTREL found in '$@'"
901878
 @FATAL_TEXTREL_FALSE@textrel_found = $(textrel_msg)
901878
diffelfutils/libasm/ChangeLog git-portable/libasm/ChangeLog
08a3ec
--- elfutils/libasm/ChangeLog
08a3ec
+++ elfutils/libasm/ChangeLog
901878
@@ -87,6 +87,11 @@
08a3ec
 	* asm_error.c: Add new error ASM_E_IOERROR.
08a3ec
 	* libasmP.h: Add ASM_E_IOERROR definition.
08a3ec
 
08a3ec
+2005-05-31  Roland McGrath  <roland@redhat.com>
08a3ec
+
08a3ec
+	* Makefile.am (WEXTRA): New variable, substituted by configure.
08a3ec
+	(AM_CFLAGS): Use it in place of -Wextra.
08a3ec
+
08a3ec
 2005-02-15  Ulrich Drepper  <drepper@redhat.com>
08a3ec
 
08a3ec
 	* Makefile.am (AM_CFLAGS): Add -Wunused -Wextra -Wformat=2.
901878
diffelfutils/libasm/Makefile.in git-portable/libasm/Makefile.in
08a3ec
--- elfutils/libasm/Makefile.in
08a3ec
+++ elfutils/libasm/Makefile.in
901878
@@ -90,9 +90,10 @@ PRE_UNINSTALL = :
901878
 POST_UNINSTALL = :
901878
 build_triplet = @build@
901878
 host_triplet = @host@
901878
-@SYMBOL_VERSIONING_TRUE@am__append_1 = -DSYMBOL_VERSIONING
08a3ec
+@BUILD_WERROR_TRUE@am__append_1 = $(if $($(*F)_no_Werror),,-Werror)
901878
+@SYMBOL_VERSIONING_TRUE@am__append_2 = -DSYMBOL_VERSIONING
8372ba
 noinst_PROGRAMS = $(am__EXEEXT_1)
901878
-@USE_LOCKS_TRUE@am__append_2 = -lpthread
901878
+@USE_LOCKS_TRUE@am__append_3 = -lpthread
08a3ec
 subdir = libasm
08a3ec
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
d56182
 am__aclocal_m4_deps = $(top_srcdir)/m4/biarch.m4 \
901878
@@ -263,6 +264,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
08a3ec
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
08a3ec
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
08a3ec
 LDFLAGS = @LDFLAGS@
08a3ec
+LD_AS_NEEDED = @LD_AS_NEEDED@
08a3ec
 LEX = @LEX@
08a3ec
 LEXLIB = @LEXLIB@
08a3ec
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
901878
@@ -294,6 +296,7 @@ SHELL = @SHELL@
08a3ec
 STRIP = @STRIP@
08a3ec
 USE_NLS = @USE_NLS@
08a3ec
 VERSION = 1
08a3ec
+WEXTRA = @WEXTRA@
08a3ec
 XGETTEXT = @XGETTEXT@
08a3ec
 XGETTEXT_015 = @XGETTEXT_015@
08a3ec
 XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
901878
@@ -361,14 +364,14 @@ AM_CPPFLAGS = -I. -I$(srcdir) -I$(top_sr
901878
 
901878
 # Warn about stack usage of more than 256K = 262144 bytes.
901878
 @ADD_STACK_USAGE_WARNING_TRUE@STACK_USAGE_WARNING = -Wstack-usage=262144
8372ba
-AM_CFLAGS = -std=gnu99 -Wall -Wshadow -Wformat=2 \
8372ba
-	    $(if $($(*F)_no_Werror),,-Werror) \
8372ba
-	    $(if $($(*F)_no_Wunused),,-Wunused -Wextra) \
901878
-	    $(if $($(*F)_no_Wstack_usage),,$(STACK_USAGE_WARNING)) \
8372ba
-	    $($(*F)_CFLAGS)
8372ba
-
8372ba
+AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \
8372ba
+	$($(*F)_no_Werror),,-Werror) $(if \
08a3ec
+	$($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \
901878
+	$($(*F)_no_Wformat),-Wno-format,-Wformat=2) $(if \
901878
+	$($(*F)_no_Wstack_usage),,$(STACK_USAGE_WARNING)) \
901878
+	$($(*F)_CFLAGS) $(am__append_1)
8372ba
 COMPILE.os = $(filter-out -fprofile-arcs -ftest-coverage, $(COMPILE))
901878
-DEFS.os = -DPIC -DSHARED $(am__append_1)
901878
+DEFS.os = -DPIC -DSHARED $(am__append_2)
8372ba
 CLEANFILES = *.gcno *.gcda $(am_libasm_pic_a_OBJECTS) \
8372ba
 	libasm.so.$(VERSION)
901878
 textrel_msg = echo "WARNING: TEXTREL found in '$@'"
901878
@@ -395,7 +398,7 @@ libasm_a_SOURCES = asm_begin.c asm_abort
8372ba
 
8372ba
 libasm_pic_a_SOURCES = 
8372ba
 am_libasm_pic_a_OBJECTS = $(libasm_a_SOURCES:.c=.os)
901878
-libasm_so_LDLIBS = $(am__append_2)
901878
+libasm_so_LDLIBS = $(am__append_3)
8372ba
 libasm_so_SOURCES = 
08a3ec
 noinst_HEADERS = libasmP.h symbolhash.h
08a3ec
 EXTRA_DIST = libasm.map
901878
diffelfutils/libcpu/ChangeLog git-portable/libcpu/ChangeLog
08a3ec
--- elfutils/libcpu/ChangeLog
08a3ec
+++ elfutils/libcpu/ChangeLog
8372ba
@@ -51,6 +51,9 @@
08a3ec
 
08a3ec
 2009-01-23  Roland McGrath  <roland@redhat.com>
08a3ec
 
08a3ec
+	* i386_disasm.c (i386_disasm): Add abort after assert-constant for old
08a3ec
+	compilers that don't realize it's noreturn.
08a3ec
+
08a3ec
 	* Makefile.am (i386_parse_CFLAGS): Use quotes around command
08a3ec
 	substitution that can produce leading whitespace.
08a3ec
 
8372ba
@@ -380,6 +383,11 @@
08a3ec
 	* defs/i386.doc: New file.
08a3ec
 	* defs/x86_64: New file.
08a3ec
 
08a3ec
+2005-04-04  Roland McGrath  <roland@redhat.com>
08a3ec
+
08a3ec
+	* Makefile.am (WEXTRA): New variable, substituted by configure.
08a3ec
+	(AM_CFLAGS): Use it instead of -Wextra.
08a3ec
+
08a3ec
 2005-02-15  Ulrich Drepper  <drepper@redhat.com>
08a3ec
 
08a3ec
 	* Makefile (AM_CFLAGS): Add -Wunused -Wextra -Wformat=2.
901878
diffelfutils/libcpu/i386_disasm.c git-portable/libcpu/i386_disasm.c
08a3ec
--- elfutils/libcpu/i386_disasm.c
08a3ec
+++ elfutils/libcpu/i386_disasm.c
08a3ec
@@ -822,6 +822,7 @@ i386_disasm (const uint8_t **startp, con
08a3ec
 
08a3ec
 			default:
08a3ec
 			  assert (! "INVALID not handled");
08a3ec
+			  abort ();
08a3ec
 			}
08a3ec
 		    }
08a3ec
 		  else
901878
diffelfutils/libcpu/Makefile.in git-portable/libcpu/Makefile.in
08a3ec
--- elfutils/libcpu/Makefile.in
08a3ec
+++ elfutils/libcpu/Makefile.in
901878
@@ -90,7 +90,8 @@ PRE_UNINSTALL = :
901878
 POST_UNINSTALL = :
901878
 build_triplet = @build@
901878
 host_triplet = @host@
901878
-@SYMBOL_VERSIONING_TRUE@am__append_1 = -DSYMBOL_VERSIONING
08a3ec
+@BUILD_WERROR_TRUE@am__append_1 = $(if $($(*F)_no_Werror),,-Werror)
901878
+@SYMBOL_VERSIONING_TRUE@am__append_2 = -DSYMBOL_VERSIONING
08a3ec
 @MAINTAINER_MODE_TRUE@noinst_PROGRAMS = i386_gendis$(EXEEXT)
08a3ec
 subdir = libcpu
08a3ec
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
901878
@@ -238,6 +239,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
08a3ec
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
08a3ec
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
08a3ec
 LDFLAGS = @LDFLAGS@
08a3ec
+LD_AS_NEEDED = @LD_AS_NEEDED@
08a3ec
 LEX = @LEX@
08a3ec
 LEXLIB = @LEXLIB@
08a3ec
 LEX_OUTPUT_ROOT = lex.$(
901878
@@ -269,6 +271,7 @@ SHELL = @SHELL@
08a3ec
 STRIP = @STRIP@
08a3ec
 USE_NLS = @USE_NLS@
08a3ec
 VERSION = @VERSION@
08a3ec
+WEXTRA = @WEXTRA@
08a3ec
 XGETTEXT = @XGETTEXT@
08a3ec
 XGETTEXT_015 = @XGETTEXT_015@
08a3ec
 XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
901878
@@ -336,13 +339,14 @@ AM_CPPFLAGS = -I. -I$(srcdir) -I$(top_sr
901878
 
901878
 # Warn about stack usage of more than 256K = 262144 bytes.
901878
 @ADD_STACK_USAGE_WARNING_TRUE@STACK_USAGE_WARNING = -Wstack-usage=262144
8372ba
-AM_CFLAGS = -std=gnu99 -Wall -Wshadow -Wformat=2 $(if \
8372ba
+AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \
8372ba
 	$($(*F)_no_Werror),,-Werror) $(if \
901878
-	$($(*F)_no_Wunused),,-Wunused -Wextra) $(if \
08a3ec
+	$($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \
901878
+	$($(*F)_no_Wformat),-Wno-format,-Wformat=2) $(if \
901878
 	$($(*F)_no_Wstack_usage),,$(STACK_USAGE_WARNING)) \
901878
-	$($(*F)_CFLAGS) -fpic -fdollars-in-identifiers
901878
+	$($(*F)_CFLAGS) $(am__append_1) -fpic -fdollars-in-identifiers
8372ba
 COMPILE.os = $(filter-out -fprofile-arcs -ftest-coverage, $(COMPILE))
901878
-DEFS.os = -DPIC -DSHARED $(am__append_1)
901878
+DEFS.os = -DPIC -DSHARED $(am__append_2)
8372ba
 CLEANFILES = *.gcno *.gcda $(foreach P,i386 x86_64,$P_defs \
8372ba
 	$P.mnemonics)
901878
 textrel_msg = echo "WARNING: TEXTREL found in '$@'"
901878
diffelfutils/libdw/ChangeLog git-portable/libdw/ChangeLog
08a3ec
--- elfutils/libdw/ChangeLog
08a3ec
+++ elfutils/libdw/ChangeLog
901878
@@ -904,6 +904,10 @@
08a3ec
 
08a3ec
 	* Makefile.am (known-dwarf.h): Run gawk on config/known-dwarf.awk.
08a3ec
 
08a3ec
+2011-07-20  Mark Wielaard  <mjw@redhat.com>
08a3ec
+
08a3ec
+	* dwarf_begin_elf.c: Add fallback for be64toh if not defined.
08a3ec
+
08a3ec
 2011-07-14  Mark Wielaard  <mjw@redhat.com>
08a3ec
 
08a3ec
 	* libdw.h (dwarf_offdie): Fix documentation to mention .debug_info.
901878
@@ -1263,6 +1267,10 @@
08a3ec
 
08a3ec
 	* dwarf_hasattr_integrate.c: Integrate DW_AT_specification too.
08a3ec
 
08a3ec
+2009-08-17  Roland McGrath  <roland@redhat.com>
08a3ec
+
08a3ec
+	* libdw.h: Disable extern inlines for GCC 4.2.
08a3ec
+
08a3ec
 2009-08-10  Roland McGrath  <roland@redhat.com>
08a3ec
 
08a3ec
 	* dwarf_getscopevar.c: Use dwarf_diename.
901878
@@ -2031,6 +2039,11 @@
08a3ec
 
08a3ec
 2005-05-31  Roland McGrath  <roland@redhat.com>
08a3ec
 
08a3ec
+	* Makefile.am (WEXTRA): New variable, substituted by configure.
08a3ec
+	(AM_CFLAGS): Use it in place of -Wextra.
08a3ec
+
08a3ec
+2005-05-31  Roland McGrath  <roland@redhat.com>
08a3ec
+
08a3ec
 	* dwarf_formref_die.c (dwarf_formref_die): Add CU header offset to
08a3ec
 	formref offset.
08a3ec
 
901878
diffelfutils/libdw/dwarf_begin_elf.c git-portable/libdw/dwarf_begin_elf.c
08a3ec
--- elfutils/libdw/dwarf_begin_elf.c
08a3ec
+++ elfutils/libdw/dwarf_begin_elf.c
8372ba
@@ -47,6 +47,14 @@
08a3ec
 #if USE_ZLIB
08a3ec
 # include <endian.h>
08a3ec
 # define crc32		loser_crc32
08a3ec
+# ifndef be64toh
08a3ec
+#  include <byteswap.h>
08a3ec
+#  if __BYTE_ORDER == __LITTLE_ENDIAN
08a3ec
+#   define be64toh(x) bswap_64 (x)
08a3ec
+#  else
08a3ec
+#   define be64toh(x) (x)
08a3ec
+#  endif
08a3ec
+# endif
08a3ec
 # include <zlib.h>
08a3ec
 # undef crc32
08a3ec
 #endif
901878
diffelfutils/libdw/libdw.h git-portable/libdw/libdw.h
08a3ec
--- elfutils/libdw/libdw.h
08a3ec
+++ elfutils/libdw/libdw.h
901878
@@ -1004,7 +1004,7 @@ extern Dwarf_OOM dwarf_new_oom_handler (
08a3ec
 
08a3ec
 
08a3ec
 /* Inline optimizations.  */
08a3ec
-#ifdef __OPTIMIZE__
08a3ec
+#if defined __OPTIMIZE__ && !(__GNUC__ == 4 && __GNUC_MINOR__ == 2)
08a3ec
 /* Return attribute code of given attribute.  */
08a3ec
 __libdw_extern_inline unsigned int
08a3ec
 dwarf_whatattr (Dwarf_Attribute *attr)
901878
diffelfutils/libdw/Makefile.in git-portable/libdw/Makefile.in
08a3ec
--- elfutils/libdw/Makefile.in
08a3ec
+++ elfutils/libdw/Makefile.in
901878
@@ -90,8 +90,9 @@ PRE_UNINSTALL = :
901878
 POST_UNINSTALL = :
901878
 build_triplet = @build@
901878
 host_triplet = @host@
901878
-@SYMBOL_VERSIONING_TRUE@am__append_1 = -DSYMBOL_VERSIONING
901878
-@BUILD_STATIC_TRUE@am__append_2 = -fpic
08a3ec
+@BUILD_WERROR_TRUE@am__append_1 = $(if $($(*F)_no_Werror),,-Werror)
901878
+@SYMBOL_VERSIONING_TRUE@am__append_2 = -DSYMBOL_VERSIONING
901878
+@BUILD_STATIC_TRUE@am__append_3 = -fpic
8372ba
 noinst_PROGRAMS = $(am__EXEEXT_1)
08a3ec
 subdir = libdw
8372ba
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
901878
@@ -312,6 +313,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
08a3ec
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
08a3ec
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
08a3ec
 LDFLAGS = @LDFLAGS@
08a3ec
+LD_AS_NEEDED = @LD_AS_NEEDED@
08a3ec
 LEX = @LEX@
08a3ec
 LEXLIB = @LEXLIB@
08a3ec
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
901878
@@ -343,6 +345,7 @@ SHELL = @SHELL@
08a3ec
 STRIP = @STRIP@
08a3ec
 USE_NLS = @USE_NLS@
08a3ec
 VERSION = 1
08a3ec
+WEXTRA = @WEXTRA@
08a3ec
 XGETTEXT = @XGETTEXT@
08a3ec
 XGETTEXT_015 = @XGETTEXT_015@
08a3ec
 XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
901878
@@ -409,13 +412,14 @@ AM_CPPFLAGS = -I. -I$(srcdir) -I$(top_sr
901878
 
901878
 # Warn about stack usage of more than 256K = 262144 bytes.
901878
 @ADD_STACK_USAGE_WARNING_TRUE@STACK_USAGE_WARNING = -Wstack-usage=262144
8372ba
-AM_CFLAGS = -std=gnu99 -Wall -Wshadow -Wformat=2 $(if \
8372ba
+AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \
8372ba
 	$($(*F)_no_Werror),,-Werror) $(if \
901878
-	$($(*F)_no_Wunused),,-Wunused -Wextra) $(if \
08a3ec
+	$($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \
901878
+	$($(*F)_no_Wformat),-Wno-format,-Wformat=2) $(if \
901878
 	$($(*F)_no_Wstack_usage),,$(STACK_USAGE_WARNING)) \
901878
-	$($(*F)_CFLAGS) $(am__append_2)
901878
+	$($(*F)_CFLAGS) $(am__append_1) $(am__append_3)
8372ba
 COMPILE.os = $(filter-out -fprofile-arcs -ftest-coverage, $(COMPILE))
901878
-DEFS.os = -DPIC -DSHARED $(am__append_1)
901878
+DEFS.os = -DPIC -DSHARED $(am__append_2)
8372ba
 CLEANFILES = *.gcno *.gcda
901878
 textrel_msg = echo "WARNING: TEXTREL found in '$@'"
901878
 @FATAL_TEXTREL_FALSE@textrel_found = $(textrel_msg)
901878
diffelfutils/libdwelf/Makefile.in git-portable/libdwelf/Makefile.in
8372ba
--- elfutils/libdwelf/Makefile.in
8372ba
+++ elfutils/libdwelf/Makefile.in
901878
@@ -89,7 +89,8 @@ PRE_UNINSTALL = :
901878
 POST_UNINSTALL = :
901878
 build_triplet = @build@
901878
 host_triplet = @host@
901878
-@SYMBOL_VERSIONING_TRUE@am__append_1 = -DSYMBOL_VERSIONING
8372ba
+@BUILD_WERROR_TRUE@am__append_1 = $(if $($(*F)_no_Werror),,-Werror)
901878
+@SYMBOL_VERSIONING_TRUE@am__append_2 = -DSYMBOL_VERSIONING
8372ba
 subdir = libdwelf
8372ba
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
8372ba
 am__aclocal_m4_deps = $(top_srcdir)/m4/biarch.m4 \
901878
@@ -242,6 +243,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
8372ba
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
8372ba
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
8372ba
 LDFLAGS = @LDFLAGS@
8372ba
+LD_AS_NEEDED = @LD_AS_NEEDED@
8372ba
 LEX = @LEX@
8372ba
 LEXLIB = @LEXLIB@
8372ba
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
901878
@@ -273,6 +275,7 @@ SHELL = @SHELL@
8372ba
 STRIP = @STRIP@
8372ba
 USE_NLS = @USE_NLS@
8372ba
 VERSION = 1
8372ba
+WEXTRA = @WEXTRA@
8372ba
 XGETTEXT = @XGETTEXT@
8372ba
 XGETTEXT_015 = @XGETTEXT_015@
8372ba
 XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
901878
@@ -340,14 +343,14 @@ AM_CPPFLAGS = -I. -I$(srcdir) -I$(top_sr
901878
 
901878
 # Warn about stack usage of more than 256K = 262144 bytes.
901878
 @ADD_STACK_USAGE_WARNING_TRUE@STACK_USAGE_WARNING = -Wstack-usage=262144
8372ba
-AM_CFLAGS = -std=gnu99 -Wall -Wshadow -Wformat=2 \
8372ba
-	    $(if $($(*F)_no_Werror),,-Werror) \
8372ba
-	    $(if $($(*F)_no_Wunused),,-Wunused -Wextra) \
901878
-	    $(if $($(*F)_no_Wstack_usage),,$(STACK_USAGE_WARNING)) \
8372ba
-	    $($(*F)_CFLAGS)
8372ba
-
8372ba
+AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \
8372ba
+	$($(*F)_no_Werror),,-Werror) $(if \
8372ba
+	$($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \
901878
+	$($(*F)_no_Wformat),-Wno-format,-Wformat=2) $(if \
901878
+	$($(*F)_no_Wstack_usage),,$(STACK_USAGE_WARNING)) \
901878
+	$($(*F)_CFLAGS) $(am__append_1)
8372ba
 COMPILE.os = $(filter-out -fprofile-arcs -ftest-coverage, $(COMPILE))
901878
-DEFS.os = -DPIC -DSHARED $(am__append_1)
901878
+DEFS.os = -DPIC -DSHARED $(am__append_2)
8372ba
 CLEANFILES = *.gcno *.gcda $(am_libdwelf_pic_a_OBJECTS)
901878
 textrel_msg = echo "WARNING: TEXTREL found in '$@'"
901878
 @FATAL_TEXTREL_FALSE@textrel_found = $(textrel_msg)
901878
diffelfutils/libdwfl/ChangeLog git-portable/libdwfl/ChangeLog
08a3ec
--- elfutils/libdwfl/ChangeLog
08a3ec
+++ elfutils/libdwfl/ChangeLog
901878
@@ -713,6 +713,21 @@
d56182
 	(dwfl_module_addrsym) (i_to_symfile): New function.
d56182
 	(dwfl_module_addrsym) (search_table): Use it.
d56182
 
d56182
+2013-11-09  Jan Kratochvil  <jan.kratochvil@redhat.com>
d56182
+
d56182
+	Older OS compatibility bits.
d56182
+	* linux-core-attach.c (be64toh, le64toh, be32toh, le32toh): Provide
d56182
+	fallbacks if not defined by system.
d56182
+
d56182
+2013-11-09  Jan Kratochvil  <jan.kratochvil@redhat.com>
d56182
+
d56182
+	Handle T-stopped detach for old kernels.
d56182
+	* linux-pid-attach.c (struct pid_arg): New field stopped.
d56182
+	(ptrace_attach): New parameter stoppedp.  Set it appropriately.
d56182
+	(pid_set_initial_registers): Pass the new field.
d56182
+	(pid_thread_detach): Handle the case of STOPPED for old kernels.
d56182
+	(__libdwfl_attach_state_for_pid): Initialize STOPPED.
d56182
+
d56182
 2013-11-07  Jan Kratochvil  <jan.kratochvil@redhat.com>
d56182
 	    Mark Wielaard  <mjw@redhat.com>
d56182
 
901878
@@ -2478,6 +2493,11 @@
08a3ec
 
08a3ec
 2005-07-21  Roland McGrath  <roland@redhat.com>
08a3ec
 
08a3ec
+	* Makefile.am (WEXTRA): New variable, substituted by configure.
08a3ec
+	(AM_CFLAGS): Use it in place of -Wextra.
08a3ec
+
08a3ec
+2005-07-21  Roland McGrath  <roland@redhat.com>
08a3ec
+
08a3ec
 	* Makefile.am (noinst_HEADERS): Add loc2c.c.
08a3ec
 
08a3ec
 	* test2.c (main): Check sscanf result to quiet warning.
901878
diffelfutils/libdwfl/linux-core-attach.c git-portable/libdwfl/linux-core-attach.c
d56182
--- elfutils/libdwfl/linux-core-attach.c
d56182
+++ elfutils/libdwfl/linux-core-attach.c
d56182
@@ -29,6 +29,35 @@
d56182
 #include "libdwflP.h"
d56182
 #include <fcntl.h>
d56182
 #include "system.h"
d56182
+#include <endian.h>
d56182
+#include <byteswap.h>
d56182
+#if __BYTE_ORDER == __LITTLE_ENDIAN
d56182
+# ifndef be64toh
d56182
+#  define be64toh(x) bswap_64 (x)
d56182
+# endif
d56182
+# ifndef le64toh
d56182
+#  define le64toh(x) (x)
d56182
+# endif
d56182
+# ifndef be32toh
d56182
+#  define be32toh(x) bswap_32 (x)
d56182
+# endif
d56182
+# ifndef le32toh
d56182
+#  define le32toh(x) (x)
d56182
+# endif
d56182
+#else
d56182
+# ifndef be64toh
d56182
+#  define be64toh(x) (x)
d56182
+# endif
d56182
+# ifndef le64toh
d56182
+#  define le64toh(x) bswap_64 (x)
d56182
+# endif
d56182
+# ifndef be32toh
d56182
+#  define be32toh(x) (x)
d56182
+# endif
d56182
+# ifndef le32toh
d56182
+#  define le32toh(x) bswap_32 (x)
d56182
+# endif
d56182
+#endif
d56182
 
8372ba
 #include "../libdw/memory-access.h"
8372ba
 
901878
diffelfutils/libdwfl/linux-pid-attach.c git-portable/libdwfl/linux-pid-attach.c
d56182
--- elfutils/libdwfl/linux-pid-attach.c
d56182
+++ elfutils/libdwfl/linux-pid-attach.c
8372ba
@@ -255,6 +255,11 @@ void
8372ba
 internal_function
8372ba
 __libdwfl_ptrace_detach (pid_t tid, bool tid_was_stopped)
8372ba
 {
8372ba
+  // Older kernels (tested kernel-2.6.18-348.12.1.el5.x86_64) need special
8372ba
+  // handling of the detachment to keep the process State: T (stopped).
8372ba
+  if (tid_was_stopped)
8372ba
+    syscall (__NR_tkill, tid, SIGSTOP);
8372ba
+
8372ba
   /* This handling is needed only on older Linux kernels such as
8372ba
      2.6.32-358.23.2.el6.ppc64.  Later kernels such as
8372ba
      3.11.7-200.fc19.x86_64 remember the T (stopped) state
8372ba
@@ -262,6 +267,15 @@ __libdwfl_ptrace_detach (pid_t tid, bool
8372ba
      PTRACE_DETACH.  */
8372ba
   ptrace (PTRACE_DETACH, tid, NULL,
8372ba
 	  (void *) (intptr_t) (tid_was_stopped ? SIGSTOP : 0));
8372ba
+
8372ba
+  if (tid_was_stopped)
8372ba
+    {
8372ba
+      // Wait till the SIGSTOP settles down.
8372ba
+      int i;
8372ba
+      for (i = 0; i < 100000; i++)
8372ba
+	if (linux_proc_pid_is_stopped (tid))
8372ba
+	  break;
8372ba
+    }
d56182
 }
d56182
 
8372ba
 static void
901878
diffelfutils/libdwfl/Makefile.in git-portable/libdwfl/Makefile.in
08a3ec
--- elfutils/libdwfl/Makefile.in
08a3ec
+++ elfutils/libdwfl/Makefile.in
901878
@@ -89,10 +89,11 @@ PRE_UNINSTALL = :
901878
 POST_UNINSTALL = :
901878
 build_triplet = @build@
901878
 host_triplet = @host@
901878
-@SYMBOL_VERSIONING_TRUE@am__append_1 = -DSYMBOL_VERSIONING
901878
-@ZLIB_TRUE@am__append_2 = gzip.c
901878
-@BZLIB_TRUE@am__append_3 = bzip2.c
901878
-@LZMA_TRUE@am__append_4 = lzma.c
08a3ec
+@BUILD_WERROR_TRUE@am__append_1 = $(if $($(*F)_no_Werror),,-Werror)
901878
+@SYMBOL_VERSIONING_TRUE@am__append_2 = -DSYMBOL_VERSIONING
901878
+@ZLIB_TRUE@am__append_3 = gzip.c
901878
+@BZLIB_TRUE@am__append_4 = bzip2.c
901878
+@LZMA_TRUE@am__append_5 = lzma.c
08a3ec
 subdir = libdwfl
08a3ec
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
8372ba
 am__aclocal_m4_deps = $(top_srcdir)/m4/biarch.m4 \
901878
@@ -301,6 +302,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
08a3ec
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
08a3ec
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
08a3ec
 LDFLAGS = @LDFLAGS@
08a3ec
+LD_AS_NEEDED = @LD_AS_NEEDED@
08a3ec
 LEX = @LEX@
08a3ec
 LEXLIB = @LEXLIB@
08a3ec
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
901878
@@ -332,6 +334,7 @@ SHELL = @SHELL@
08a3ec
 STRIP = @STRIP@
08a3ec
 USE_NLS = @USE_NLS@
08a3ec
 VERSION = 1
08a3ec
+WEXTRA = @WEXTRA@
08a3ec
 XGETTEXT = @XGETTEXT@
08a3ec
 XGETTEXT_015 = @XGETTEXT_015@
08a3ec
 XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
901878
@@ -399,14 +402,14 @@ AM_CPPFLAGS = -I. -I$(srcdir) -I$(top_sr
901878
 
901878
 # Warn about stack usage of more than 256K = 262144 bytes.
901878
 @ADD_STACK_USAGE_WARNING_TRUE@STACK_USAGE_WARNING = -Wstack-usage=262144
8372ba
-AM_CFLAGS = -std=gnu99 -Wall -Wshadow -Wformat=2 \
8372ba
-	    $(if $($(*F)_no_Werror),,-Werror) \
8372ba
-	    $(if $($(*F)_no_Wunused),,-Wunused -Wextra) \
901878
-	    $(if $($(*F)_no_Wstack_usage),,$(STACK_USAGE_WARNING)) \
8372ba
-	    $($(*F)_CFLAGS)
8372ba
-
8372ba
+AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \
8372ba
+	$($(*F)_no_Werror),,-Werror) $(if \
08a3ec
+	$($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \
901878
+	$($(*F)_no_Wformat),-Wno-format,-Wformat=2) $(if \
901878
+	$($(*F)_no_Wstack_usage),,$(STACK_USAGE_WARNING)) \
901878
+	$($(*F)_CFLAGS) $(am__append_1)
8372ba
 COMPILE.os = $(filter-out -fprofile-arcs -ftest-coverage, $(COMPILE))
901878
-DEFS.os = -DPIC -DSHARED $(am__append_1)
901878
+DEFS.os = -DPIC -DSHARED $(am__append_2)
08a3ec
 CLEANFILES = *.gcno *.gcda $(am_libdwfl_pic_a_OBJECTS)
901878
 textrel_msg = echo "WARNING: TEXTREL found in '$@'"
901878
 @FATAL_TEXTREL_FALSE@textrel_found = $(textrel_msg)
901878
@@ -435,8 +438,8 @@ libdwfl_a_SOURCES = dwfl_begin.c dwfl_en
08a3ec
 	dwfl_module_register_names.c dwfl_segment_report_module.c \
d56182
 	link_map.c core-file.c open.c image-header.c dwfl_frame.c \
d56182
 	frame_unwind.c dwfl_frame_pc.c linux-pid-attach.c \
901878
-	linux-core-attach.c dwfl_frame_regs.c $(am__append_2) \
901878
-	$(am__append_3) $(am__append_4)
901878
+	linux-core-attach.c dwfl_frame_regs.c $(am__append_3) \
901878
+	$(am__append_4) $(am__append_5)
8372ba
 libdwfl = $(libdw)
8372ba
 libdw = ../libdw/libdw.so
8372ba
 libelf = ../libelf/libelf.so
901878
diffelfutils/libebl/ChangeLog git-portable/libebl/ChangeLog
08a3ec
--- elfutils/libebl/ChangeLog
08a3ec
+++ elfutils/libebl/ChangeLog
901878
@@ -785,6 +785,11 @@
08a3ec
 	* Makefile.am (libebl_*_so_SOURCES): Set to $(*_SRCS) so dependency
08a3ec
 	tracking works right.
08a3ec
 
08a3ec
+2005-05-31  Roland McGrath  <roland@redhat.com>
08a3ec
+
08a3ec
+	* Makefile.am (WEXTRA): New variable, substituted by configure.
08a3ec
+	(AM_CFLAGS): Use it in place of -Wextra.
08a3ec
+
08a3ec
 2005-05-21  Ulrich Drepper  <drepper@redhat.com>
08a3ec
 
08a3ec
 	* libebl_x86_64.map: Add x86_64_core_note.
901878
diffelfutils/libebl/Makefile.in git-portable/libebl/Makefile.in
08a3ec
--- elfutils/libebl/Makefile.in
08a3ec
+++ elfutils/libebl/Makefile.in
901878
@@ -89,7 +89,8 @@ PRE_UNINSTALL = :
901878
 POST_UNINSTALL = :
901878
 build_triplet = @build@
901878
 host_triplet = @host@
901878
-@SYMBOL_VERSIONING_TRUE@am__append_1 = -DSYMBOL_VERSIONING
08a3ec
+@BUILD_WERROR_TRUE@am__append_1 = $(if $($(*F)_no_Werror),,-Werror)
901878
+@SYMBOL_VERSIONING_TRUE@am__append_2 = -DSYMBOL_VERSIONING
08a3ec
 subdir = libebl
08a3ec
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
d56182
 am__aclocal_m4_deps = $(top_srcdir)/m4/biarch.m4 \
901878
@@ -264,6 +265,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
08a3ec
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
08a3ec
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
08a3ec
 LDFLAGS = @LDFLAGS@
08a3ec
+LD_AS_NEEDED = @LD_AS_NEEDED@
08a3ec
 LEX = @LEX@
08a3ec
 LEXLIB = @LEXLIB@
08a3ec
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
901878
@@ -295,6 +297,7 @@ SHELL = @SHELL@
08a3ec
 STRIP = @STRIP@
08a3ec
 USE_NLS = @USE_NLS@
08a3ec
 VERSION = 1
08a3ec
+WEXTRA = @WEXTRA@
08a3ec
 XGETTEXT = @XGETTEXT@
08a3ec
 XGETTEXT_015 = @XGETTEXT_015@
08a3ec
 XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
901878
@@ -362,13 +365,14 @@ AM_CPPFLAGS = -I. -I$(srcdir) -I$(top_sr
901878
 
901878
 # Warn about stack usage of more than 256K = 262144 bytes.
901878
 @ADD_STACK_USAGE_WARNING_TRUE@STACK_USAGE_WARNING = -Wstack-usage=262144
8372ba
-AM_CFLAGS = -std=gnu99 -Wall -Wshadow -Wformat=2 $(if \
8372ba
+AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \
8372ba
 	$($(*F)_no_Werror),,-Werror) $(if \
901878
-	$($(*F)_no_Wunused),,-Wunused -Wextra) $(if \
08a3ec
+	$($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \
901878
+	$($(*F)_no_Wformat),-Wno-format,-Wformat=2) $(if \
901878
 	$($(*F)_no_Wstack_usage),,$(STACK_USAGE_WARNING)) \
901878
-	$($(*F)_CFLAGS) -fpic
901878
+	$($(*F)_CFLAGS) $(am__append_1) -fpic
8372ba
 COMPILE.os = $(filter-out -fprofile-arcs -ftest-coverage, $(COMPILE))
901878
-DEFS.os = -DPIC -DSHARED $(am__append_1)
901878
+DEFS.os = -DPIC -DSHARED $(am__append_2)
8372ba
 CLEANFILES = *.gcno *.gcda $(am_libebl_pic_a_OBJECTS)
901878
 textrel_msg = echo "WARNING: TEXTREL found in '$@'"
901878
 @FATAL_TEXTREL_FALSE@textrel_found = $(textrel_msg)
901878
diffelfutils/libelf/ChangeLog git-portable/libelf/ChangeLog
08a3ec
--- elfutils/libelf/ChangeLog
08a3ec
+++ elfutils/libelf/ChangeLog
901878
@@ -412,6 +412,11 @@
08a3ec
 
08a3ec
 	* elf-knowledge.h (SECTION_STRIP_P): Remove < SHT_NUM check.
08a3ec
 
08a3ec
+2011-03-10  Roland McGrath  <roland@redhat.com>
08a3ec
+
08a3ec
+	* gnuhash_xlate.h (elf_cvt_gnuhash): Avoid post-increment in bswap_32
08a3ec
+	argument, since some implementations are buggy macros.
08a3ec
+
08a3ec
 2011-02-26  Mark Wielaard  <mjw@redhat.com>
08a3ec
 
08a3ec
 	* elf_end.c (elf_end): Call rwlock_unlock before rwlock_fini.
901878
@@ -1089,6 +1094,11 @@
08a3ec
 
08a3ec
 	* elf.h: Update from glibc.
08a3ec
 
08a3ec
+2005-05-31  Roland McGrath  <roland@redhat.com>
08a3ec
+
08a3ec
+	* Makefile.am (WEXTRA): New variable, substituted by configure.
08a3ec
+	(AM_CFLAGS): Use it in place of -Wextra.
08a3ec
+
08a3ec
 2005-05-08  Roland McGrath  <roland@redhat.com>
08a3ec
 
08a3ec
 	* elf_begin.c (read_file) [_MUDFLAP]: Don't use mmap for now.
901878
diffelfutils/libelf/common.h git-portable/libelf/common.h
08a3ec
--- elfutils/libelf/common.h
08a3ec
+++ elfutils/libelf/common.h
08a3ec
@@ -139,7 +139,7 @@ libelf_release_all (Elf *elf)
08a3ec
   (Var) = (sizeof (Var) == 1						      \
08a3ec
 	   ? (unsigned char) (Var)					      \
08a3ec
 	   : (sizeof (Var) == 2						      \
08a3ec
-	      ? bswap_16 (Var)						      \
08a3ec
+	      ? (unsigned short int) bswap_16 (Var)			      \
08a3ec
 	      : (sizeof (Var) == 4					      \
08a3ec
 		 ? bswap_32 (Var)					      \
08a3ec
 		 : bswap_64 (Var))))
08a3ec
@@ -148,7 +148,7 @@ libelf_release_all (Elf *elf)
08a3ec
   (Dst) = (sizeof (Var) == 1						      \
08a3ec
 	   ? (unsigned char) (Var)					      \
08a3ec
 	   : (sizeof (Var) == 2						      \
08a3ec
-	      ? bswap_16 (Var)						      \
08a3ec
+	      ? (unsigned short int) bswap_16 (Var)			      \
08a3ec
 	      : (sizeof (Var) == 4					      \
08a3ec
 		 ? bswap_32 (Var)					      \
08a3ec
 		 : bswap_64 (Var))))
901878
diffelfutils/libelf/gnuhash_xlate.h git-portable/libelf/gnuhash_xlate.h
08a3ec
--- elfutils/libelf/gnuhash_xlate.h
08a3ec
+++ elfutils/libelf/gnuhash_xlate.h
08a3ec
@@ -1,5 +1,5 @@
08a3ec
 /* Conversion functions for versioning information.
08a3ec
-   Copyright (C) 2006, 2007 Red Hat, Inc.
08a3ec
+   Copyright (C) 2006-2011 Red Hat, Inc.
08a3ec
    This file is part of elfutils.
08a3ec
    Written by Ulrich Drepper <drepper@redhat.com>, 2006.
08a3ec
 
08a3ec
@@ -68,7 +68,9 @@ elf_cvt_gnuhash (void *dest, const void
08a3ec
   dest32 = (Elf32_Word *) &dest64[bitmask_words];
08a3ec
   while (len >= 4)
08a3ec
     {
08a3ec
-      *dest32++ = bswap_32 (*src32++);
08a3ec
+      *dest32 = bswap_32 (*src32);
08a3ec
+      ++dest32;
08a3ec
+      ++src32;
08a3ec
       len -= 4;
08a3ec
     }
08a3ec
 }
901878
diffelfutils/libelf/Makefile.in git-portable/libelf/Makefile.in
08a3ec
--- elfutils/libelf/Makefile.in
08a3ec
+++ elfutils/libelf/Makefile.in
901878
@@ -90,10 +90,11 @@ PRE_UNINSTALL = :
901878
 POST_UNINSTALL = :
901878
 build_triplet = @build@
901878
 host_triplet = @host@
901878
-@SYMBOL_VERSIONING_TRUE@am__append_1 = -DSYMBOL_VERSIONING
901878
-@BUILD_STATIC_TRUE@am__append_2 = -fpic
08a3ec
+@BUILD_WERROR_TRUE@am__append_1 = $(if $($(*F)_no_Werror),,-Werror)
901878
+@SYMBOL_VERSIONING_TRUE@am__append_2 = -DSYMBOL_VERSIONING
901878
+@BUILD_STATIC_TRUE@am__append_3 = -fpic
8372ba
 noinst_PROGRAMS = $(am__EXEEXT_1)
901878
-@USE_LOCKS_TRUE@am__append_3 = -lpthread
901878
+@USE_LOCKS_TRUE@am__append_4 = -lpthread
08a3ec
 subdir = libelf
08a3ec
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
d56182
 am__aclocal_m4_deps = $(top_srcdir)/m4/biarch.m4 \
901878
@@ -305,6 +306,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
08a3ec
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
08a3ec
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
08a3ec
 LDFLAGS = @LDFLAGS@
08a3ec
+LD_AS_NEEDED = @LD_AS_NEEDED@
08a3ec
 LEX = @LEX@
08a3ec
 LEXLIB = @LEXLIB@
08a3ec
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
901878
@@ -336,6 +338,7 @@ SHELL = @SHELL@
08a3ec
 STRIP = @STRIP@
08a3ec
 USE_NLS = @USE_NLS@
08a3ec
 VERSION = 1
08a3ec
+WEXTRA = @WEXTRA@
08a3ec
 XGETTEXT = @XGETTEXT@
08a3ec
 XGETTEXT_015 = @XGETTEXT_015@
08a3ec
 XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
901878
@@ -401,13 +404,14 @@ AM_CPPFLAGS = -I. -I$(srcdir) -I$(top_sr
901878
 
901878
 # Warn about stack usage of more than 256K = 262144 bytes.
901878
 @ADD_STACK_USAGE_WARNING_TRUE@STACK_USAGE_WARNING = -Wstack-usage=262144
8372ba
-AM_CFLAGS = -std=gnu99 -Wall -Wshadow -Wformat=2 $(if \
8372ba
+AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \
8372ba
 	$($(*F)_no_Werror),,-Werror) $(if \
901878
-	$($(*F)_no_Wunused),,-Wunused -Wextra) $(if \
08a3ec
+	$($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \
901878
+	$($(*F)_no_Wformat),-Wno-format,-Wformat=2) $(if \
901878
 	$($(*F)_no_Wstack_usage),,$(STACK_USAGE_WARNING)) \
901878
-	$($(*F)_CFLAGS) $(am__append_2)
901878
+	$($(*F)_CFLAGS) $(am__append_1) $(am__append_3)
8372ba
 COMPILE.os = $(filter-out -fprofile-arcs -ftest-coverage, $(COMPILE))
901878
-DEFS.os = -DPIC -DSHARED $(am__append_1)
901878
+DEFS.os = -DPIC -DSHARED $(am__append_2)
8372ba
 CLEANFILES = *.gcno *.gcda $(am_libelf_pic_a_OBJECTS) \
8372ba
 	libelf.so.$(VERSION)
901878
 textrel_msg = echo "WARNING: TEXTREL found in '$@'"
901878
@@ -470,7 +474,7 @@ libelf_a_SOURCES = elf_version.c elf_has
8372ba
 
8372ba
 libelf_pic_a_SOURCES = 
8372ba
 am_libelf_pic_a_OBJECTS = $(libelf_a_SOURCES:.c=.os)
901878
-libelf_so_LDLIBS = $(am__append_3)
901878
+libelf_so_LDLIBS = $(am__append_4)
8372ba
 libelf_so_SOURCES = 
08a3ec
 noinst_HEADERS = elf.h abstract.h common.h exttypes.h gelf_xlate.h libelfP.h \
08a3ec
 		 version_xlate.h gnuhash_xlate.h note_xlate.h dl-hash.h
901878
diffelfutils/m4/Makefile.in git-portable/m4/Makefile.in
08a3ec
--- elfutils/m4/Makefile.in
08a3ec
+++ elfutils/m4/Makefile.in
901878
@@ -159,6 +159,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
08a3ec
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
08a3ec
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
08a3ec
 LDFLAGS = @LDFLAGS@
08a3ec
+LD_AS_NEEDED = @LD_AS_NEEDED@
08a3ec
 LEX = @LEX@
08a3ec
 LEXLIB = @LEXLIB@
08a3ec
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
901878
@@ -190,6 +191,7 @@ SHELL = @SHELL@
08a3ec
 STRIP = @STRIP@
08a3ec
 USE_NLS = @USE_NLS@
08a3ec
 VERSION = @VERSION@
08a3ec
+WEXTRA = @WEXTRA@
08a3ec
 XGETTEXT = @XGETTEXT@
08a3ec
 XGETTEXT_015 = @XGETTEXT_015@
08a3ec
 XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
901878
diffelfutils/Makefile.in git-portable/Makefile.in
08a3ec
--- elfutils/Makefile.in
08a3ec
+++ elfutils/Makefile.in
901878
@@ -277,6 +277,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
08a3ec
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
08a3ec
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
08a3ec
 LDFLAGS = @LDFLAGS@
08a3ec
+LD_AS_NEEDED = @LD_AS_NEEDED@
08a3ec
 LEX = @LEX@
08a3ec
 LEXLIB = @LEXLIB@
08a3ec
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
901878
@@ -308,6 +309,7 @@ SHELL = @SHELL@
08a3ec
 STRIP = @STRIP@
08a3ec
 USE_NLS = @USE_NLS@
08a3ec
 VERSION = @VERSION@
08a3ec
+WEXTRA = @WEXTRA@
08a3ec
 XGETTEXT = @XGETTEXT@
08a3ec
 XGETTEXT_015 = @XGETTEXT_015@
08a3ec
 XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
901878
diffelfutils/src/addr2line.c git-portable/src/addr2line.c
08a3ec
--- elfutils/src/addr2line.c
08a3ec
+++ elfutils/src/addr2line.c
901878
@@ -622,10 +622,10 @@ handle_address (const char *string, Dwfl
08a3ec
       bool parsed = false;
08a3ec
       int i, j;
08a3ec
       char *name = NULL;
08a3ec
-      if (sscanf (string, "(%m[^)])%" PRIiMAX "%n", &name, &addr, &i) == 2
08a3ec
+      if (sscanf (string, "(%a[^)])%" PRIiMAX "%n", &name, &addr, &i) == 2
08a3ec
 	  && string[i] == '\0')
08a3ec
 	parsed = adjust_to_section (name, &addr, dwfl);
08a3ec
-      switch (sscanf (string, "%m[^-+]%n%" PRIiMAX "%n", &name, &i, &addr, &j))
08a3ec
+      switch (sscanf (string, "%a[^-+]%n%" PRIiMAX "%n", &name, &i, &addr, &j))
08a3ec
 	{
08a3ec
 	default:
08a3ec
 	  break;
901878
diffelfutils/src/ar.c git-portable/src/ar.c
901878
--- elfutils/src/ar.c
901878
+++ elfutils/src/ar.c
901878
@@ -685,7 +685,14 @@ do_oper_extract (int oper, const char *a
901878
 		  tv[1].tv_sec = arhdr->ar_date;
901878
 		  tv[1].tv_nsec = 0;
901878
 
901878
+#ifdef HAVE_FUTIMENS
901878
 		  if (unlikely (futimens (xfd, tv) != 0))
901878
+#else
901878
+		  struct timeval times[2];
901878
+		  TIMESPEC_TO_TIMEVAL (&times[0], &tv[0]);
901878
+		  TIMESPEC_TO_TIMEVAL (&times[1], &tv[1]);
901878
+		  if (unlikely (futimes (xfd, times) != 0))
901878
+#endif
901878
 		    {
901878
 		      error (0, errno,
901878
 			     gettext ("cannot change modification time of %s"),
901878
diffelfutils/src/ChangeLog git-portable/src/ChangeLog
08a3ec
--- elfutils/src/ChangeLog
08a3ec
+++ elfutils/src/ChangeLog
901878
@@ -1626,8 +1626,16 @@
08a3ec
 	* readelf.c (attr_callback): Use print_block only when we don't use
08a3ec
 	print_ops.
08a3ec
 
08a3ec
+2009-08-17  Roland McGrath  <roland@redhat.com>
08a3ec
+
08a3ec
+	* ld.h: Disable extern inlines for GCC 4.2.
08a3ec
+
08a3ec
 2009-08-14  Roland McGrath  <roland@redhat.com>
08a3ec
 
08a3ec
+	* strings.c (read_block): Conditionalize posix_fadvise use
08a3ec
+	on [POSIX_FADV_SEQUENTIAL].
08a3ec
+	From Petr Salinger <Petr.Salinger@seznam.cz>.
08a3ec
+
08a3ec
 	* ar.c (do_oper_extract): Use pathconf instead of statfs.
08a3ec
 
08a3ec
 2009-08-01  Ulrich Drepper  <drepper@redhat.com>
901878
@@ -1791,6 +1799,8 @@
08a3ec
 	* readelf.c (print_debug_frame_section): Use t instead of j formats
08a3ec
 	for ptrdiff_t OFFSET.
08a3ec
 
08a3ec
+	* addr2line.c (handle_address): Use %a instead of %m for compatibility.
08a3ec
+
08a3ec
 2009-01-21  Ulrich Drepper  <drepper@redhat.com>
08a3ec
 
08a3ec
 	* elflint.c (check_program_header): Fix typo in .eh_frame_hdr section
901878
@@ -1974,6 +1984,11 @@
08a3ec
 	that matches its PT_LOAD's p_flags &~ PF_W.  On sparc, PF_X really
08a3ec
 	is valid in RELRO.
08a3ec
 
08a3ec
+2008-03-01  Roland McGrath  <roland@redhat.com>
08a3ec
+
08a3ec
+	* readelf.c (dump_archive_index): Tweak portability hack
08a3ec
+	to match [__GNUC__ < 4] too.
08a3ec
+
08a3ec
 2008-02-29  Roland McGrath  <roland@redhat.com>
08a3ec
 
08a3ec
 	* readelf.c (print_attributes): Add a cast.
901878
@@ -2225,6 +2240,8 @@
08a3ec
 
08a3ec
 	* readelf.c (hex_dump): Fix rounding error in whitespace calculation.
08a3ec
 
08a3ec
+	* Makefile.am (readelf_no_Werror): New variable.
08a3ec
+
08a3ec
 2007-10-15  Roland McGrath  <roland@redhat.com>
08a3ec
 
08a3ec
 	* make-debug-archive.in: New file.
901878
@@ -2664,6 +2681,10 @@
08a3ec
 	* elflint.c (valid_e_machine): Add EM_ALPHA.
08a3ec
 	Reported by Christian Aichinger <Greek0@gmx.net>.
08a3ec
 
08a3ec
+	* strings.c (map_file): Define POSIX_MADV_SEQUENTIAL to
08a3ec
+	MADV_SEQUENTIAL if undefined.  	Don't call posix_madvise
08a3ec
+	if neither is defined.
08a3ec
+
08a3ec
 2006-08-08  Ulrich Drepper  <drepper@redhat.com>
08a3ec
 
08a3ec
 	* elflint.c (check_dynamic): Don't require DT_HASH for DT_SYMTAB.
901878
@@ -2740,6 +2761,10 @@
08a3ec
 	* Makefile.am: Add hacks to create dependency files for non-generic
08a3ec
 	linker.
08a3ec
 
08a3ec
+2006-04-05  Roland McGrath  <roland@redhat.com>
08a3ec
+
08a3ec
+	* strings.c (MAP_POPULATE): Define to 0 if undefined.
08a3ec
+
08a3ec
 2006-06-12  Ulrich Drepper  <drepper@redhat.com>
08a3ec
 
08a3ec
 	* ldgeneric.c (ld_generic_generate_sections): Don't create .interp
901878
@@ -3088,6 +3113,11 @@
08a3ec
 	* readelf.c (print_debug_loc_section): Fix indentation for larger
08a3ec
 	address size.
08a3ec
 
08a3ec
+2005-05-31  Roland McGrath  <roland@redhat.com>
08a3ec
+
08a3ec
+	* Makefile.am (WEXTRA): New variable, substituted by configure.
08a3ec
+	(AM_CFLAGS): Use it in place of -Wextra.
08a3ec
+
08a3ec
 2005-05-30  Roland McGrath  <roland@redhat.com>
08a3ec
 
08a3ec
 	* readelf.c (print_debug_line_section): Print section offset of each
901878
diffelfutils/src/findtextrel.c git-portable/src/findtextrel.c
08a3ec
--- elfutils/src/findtextrel.c
08a3ec
+++ elfutils/src/findtextrel.c
901878
@@ -503,7 +503,11 @@ ptrcompare (const void *p1, const void *
08a3ec
 
08a3ec
 
08a3ec
 static void
08a3ec
-check_rel (size_t nsegments, struct segments segments[nsegments],
08a3ec
+check_rel (size_t nsegments, struct segments segments[
08a3ec
+#if __GNUC__ >= 4
08a3ec
+						      nsegments
08a3ec
+#endif
08a3ec
+	   ],
08a3ec
 	   GElf_Addr addr, Elf *elf, Elf_Scn *symscn, Dwarf *dw,
08a3ec
 	   const char *fname, bool more_than_one, void **knownsrcs)
08a3ec
 {
901878
diffelfutils/src/ld.h git-portable/src/ld.h
08a3ec
--- elfutils/src/ld.h
08a3ec
+++ elfutils/src/ld.h
08a3ec
@@ -1114,6 +1114,7 @@ extern bool dynamically_linked_p (void);
08a3ec
 
08a3ec
 /* Checked whether the symbol is undefined and referenced from a DSO.  */
08a3ec
 extern bool linked_from_dso_p (struct scninfo *scninfo, size_t symidx);
08a3ec
+#if defined __OPTIMIZE__ && !(__GNUC__ == 4 && __GNUC_MINOR__ == 2)
08a3ec
 #ifdef __GNUC_STDC_INLINE__
08a3ec
 __attribute__ ((__gnu_inline__))
08a3ec
 #endif
08a3ec
@@ -1131,5 +1132,6 @@ linked_from_dso_p (struct scninfo *scnin
08a3ec
 
08a3ec
   return sym->defined && sym->in_dso;
08a3ec
 }
08a3ec
+#endif	/* Optimizing and not GCC 4.2.  */
08a3ec
 
08a3ec
 #endif	/* ld.h */
901878
diffelfutils/src/Makefile.am git-portable/src/Makefile.am
08a3ec
--- elfutils/src/Makefile.am
08a3ec
+++ elfutils/src/Makefile.am
901878
@@ -90,6 +90,11 @@ endif
08a3ec
 ldgeneric_no_Wunused = yes
901878
 ldgeneric_no_Wstack_usage = yes
08a3ec
 
8372ba
+# Buggy old compilers or libc headers.
08a3ec
+readelf_no_Werror = yes
8372ba
+strings_no_Werror = yes
8372ba
+addr2line_no_Wformat = yes
08a3ec
+
901878
 # Bad, bad stack usage...
901878
 readelf_no_Wstack_usage = yes
901878
 nm_no_Wstack_usage = yes
901878
diffelfutils/src/Makefile.in git-portable/src/Makefile.in
08a3ec
--- elfutils/src/Makefile.in
08a3ec
+++ elfutils/src/Makefile.in
901878
@@ -91,7 +91,8 @@ PRE_UNINSTALL = :
901878
 POST_UNINSTALL = :
901878
 build_triplet = @build@
901878
 host_triplet = @host@
901878
-@SYMBOL_VERSIONING_TRUE@am__append_1 = -DSYMBOL_VERSIONING
08a3ec
+@BUILD_WERROR_TRUE@am__append_1 = $(if $($(*F)_no_Werror),,-Werror)
901878
+@SYMBOL_VERSIONING_TRUE@am__append_2 = -DSYMBOL_VERSIONING
08a3ec
 bin_PROGRAMS = readelf$(EXEEXT) nm$(EXEEXT) size$(EXEEXT) \
08a3ec
 	strip$(EXEEXT) ld$(EXEEXT) elflint$(EXEEXT) \
08a3ec
 	findtextrel$(EXEEXT) addr2line$(EXEEXT) elfcmp$(EXEEXT) \
901878
@@ -100,9 +101,9 @@ bin_PROGRAMS = readelf$(EXEEXT) nm$(EXEE
08a3ec
 @NATIVE_LD_FALSE@noinst_PROGRAMS = $(am__EXEEXT_1)
08a3ec
 # We never build this library but we need to get the dependency files
08a3ec
 # of all the linker backends that might be used in a non-generic linker.
901878
-@NEVER_TRUE@am__append_2 = libdummy.a
901878
+@NEVER_TRUE@am__append_3 = libdummy.a
08a3ec
 # -ldl is always needed for libebl.
901878
-@NATIVE_LD_TRUE@am__append_3 = libld_elf.a
901878
+@NATIVE_LD_TRUE@am__append_4 = libld_elf.a
08a3ec
 @NATIVE_LD_TRUE@am_libld_elf_i386_pic_a_OBJECTS =
08a3ec
 subdir = src
08a3ec
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
901878
@@ -172,7 +173,7 @@ am_ld_OBJECTS = ld.$(OBJEXT) ldgeneric.$
08a3ec
 	versionhash.$(OBJEXT)
08a3ec
 ld_OBJECTS = $(am_ld_OBJECTS)
901878
 ld_DEPENDENCIES = $(libebl) $(libelf) $(libeu) $(am__DEPENDENCIES_1) \
901878
-	$(am__append_3)
901878
+	$(am__append_4)
08a3ec
 ld_LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(ld_LDFLAGS) $(LDFLAGS) -o \
08a3ec
 	$@
08a3ec
 am_libld_elf_i386_so_OBJECTS =
901878
@@ -361,6 +362,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
08a3ec
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
08a3ec
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
08a3ec
 LDFLAGS = @LDFLAGS@
08a3ec
+LD_AS_NEEDED = @LD_AS_NEEDED@
08a3ec
 LEX = @LEX@
08a3ec
 LEXLIB = @LEXLIB@
08a3ec
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
901878
@@ -392,6 +394,7 @@ SHELL = @SHELL@
08a3ec
 STRIP = @STRIP@
08a3ec
 USE_NLS = @USE_NLS@
08a3ec
 VERSION = @VERSION@
08a3ec
+WEXTRA = @WEXTRA@
08a3ec
 XGETTEXT = @XGETTEXT@
08a3ec
 XGETTEXT_015 = @XGETTEXT_015@
08a3ec
 XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
901878
@@ -460,14 +463,14 @@ AM_CPPFLAGS = -I. -I$(srcdir) -I$(top_sr
901878
 
901878
 # Warn about stack usage of more than 256K = 262144 bytes.
901878
 @ADD_STACK_USAGE_WARNING_TRUE@STACK_USAGE_WARNING = -Wstack-usage=262144
8372ba
-AM_CFLAGS = -std=gnu99 -Wall -Wshadow -Wformat=2 \
8372ba
-	    $(if $($(*F)_no_Werror),,-Werror) \
8372ba
-	    $(if $($(*F)_no_Wunused),,-Wunused -Wextra) \
901878
-	    $(if $($(*F)_no_Wstack_usage),,$(STACK_USAGE_WARNING)) \
8372ba
-	    $($(*F)_CFLAGS)
8372ba
-
8372ba
+AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \
8372ba
+	$($(*F)_no_Werror),,-Werror) $(if \
08a3ec
+	$($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \
901878
+	$($(*F)_no_Wformat),-Wno-format,-Wformat=2) $(if \
901878
+	$($(*F)_no_Wstack_usage),,$(STACK_USAGE_WARNING)) \
901878
+	$($(*F)_CFLAGS) $(am__append_1)
8372ba
 COMPILE.os = $(filter-out -fprofile-arcs -ftest-coverage, $(COMPILE))
901878
-DEFS.os = -DPIC -DSHARED $(am__append_1)
901878
+DEFS.os = -DPIC -DSHARED $(am__append_2)
8372ba
 CLEANFILES = *.gcno *.gcda make-debug-archive none_ld.os \
8372ba
 	$(ld_modules:.c=.os) *.gconv
901878
 textrel_msg = echo "WARNING: TEXTREL found in '$@'"
901878
@@ -480,8 +483,8 @@ AM_LFLAGS = -Pld -olex.yy.c
08a3ec
 native_ld = @native_ld@
08a3ec
 ld_dsos = libld_elf_i386_pic.a
08a3ec
 @NATIVE_LD_FALSE@noinst_LIBRARIES = libld_elf.a libar.a $(ld_dsos) \
901878
-@NATIVE_LD_FALSE@	$(am__append_2)
901878
-@NATIVE_LD_TRUE@noinst_LIBRARIES = libld_elf.a libar.a $(am__append_2)
901878
+@NATIVE_LD_FALSE@	$(am__append_3)
901878
+@NATIVE_LD_TRUE@noinst_LIBRARIES = libld_elf.a libar.a $(am__append_3)
08a3ec
 @NATIVE_LD_TRUE@native_ld_cflags = -DBASE_ELF_NAME=elf_$(base_cpu)
08a3ec
 @NEVER_TRUE@libdummy_a_SOURCES = i386_ld.c
08a3ec
 ld_SOURCES = ld.c ldgeneric.c ldlex.l ldscript.y symbolhash.c sectionhash.c \
901878
@@ -509,6 +512,11 @@ libeu = ../lib/libeu.a
08a3ec
 ldgeneric_no_Wunused = yes
901878
 ldgeneric_no_Wstack_usage = yes
901878
 
8372ba
+# Buggy old compilers or libc headers.
08a3ec
+readelf_no_Werror = yes
8372ba
+strings_no_Werror = yes
8372ba
+addr2line_no_Wformat = yes
901878
+
901878
 # Bad, bad stack usage...
901878
 readelf_no_Wstack_usage = yes
901878
 nm_no_Wstack_usage = yes
901878
@@ -528,7 +536,7 @@ nm_LDADD = $(libdw) $(libebl) $(libelf)
901878
 size_LDADD = $(libelf) $(libeu) $(argp_LDADD)
901878
 strip_LDADD = $(libebl) $(libelf) $(libeu) $(argp_LDADD) -ldl
901878
 ld_LDADD = $(libebl) $(libelf) $(libeu) $(argp_LDADD) -ldl \
901878
-	$(am__append_3)
901878
+	$(am__append_4)
08a3ec
 ld_LDFLAGS = -rdynamic
901878
 elflint_LDADD = $(libebl) $(libelf) $(libeu) $(argp_LDADD) -ldl
901878
 findtextrel_LDADD = $(libdw) $(libelf) $(argp_LDADD)
901878
diffelfutils/src/readelf.c git-portable/src/readelf.c
08a3ec
--- elfutils/src/readelf.c
08a3ec
+++ elfutils/src/readelf.c
901878
@@ -4366,10 +4366,12 @@ listptr_base (struct listptr *p)
d56182
   return base;
d56182
 }
08a3ec
 
08a3ec
+static const char *listptr_name;
08a3ec
+
08a3ec
 static int
08a3ec
-compare_listptr (const void *a, const void *b, void *arg)
08a3ec
+compare_listptr (const void *a, const void *b)
08a3ec
 {
08a3ec
-  const char *name = arg;
08a3ec
+  const char *const name = listptr_name;
08a3ec
   struct listptr *p1 = (void *) a;
08a3ec
   struct listptr *p2 = (void *) b;
08a3ec
 
901878
@@ -4465,8 +4467,11 @@ static void
08a3ec
 sort_listptr (struct listptr_table *table, const char *name)
08a3ec
 {
08a3ec
   if (table->n > 0)
08a3ec
-    qsort_r (table->table, table->n, sizeof table->table[0],
08a3ec
-	     &compare_listptr, (void *) name);
08a3ec
+    {
08a3ec
+      listptr_name = name;
08a3ec
+      qsort (table->table, table->n, sizeof table->table[0],
08a3ec
+	     &compare_listptr);
08a3ec
+    }
08a3ec
 }
08a3ec
 
08a3ec
 static bool
901878
@@ -9563,7 +9568,7 @@ dump_archive_index (Elf *elf, const char
08a3ec
 	  if (unlikely (elf_rand (elf, as_off) == 0)
08a3ec
 	      || unlikely ((subelf = elf_begin (-1, ELF_C_READ_MMAP, elf))
08a3ec
 			   == NULL))
08a3ec
-#if __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 7)
08a3ec
+#if __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 7) || __GNUC__ < 4
08a3ec
 	    while (1)
08a3ec
 #endif
08a3ec
 	      error (EXIT_FAILURE, 0,
901878
diffelfutils/src/strings.c git-portable/src/strings.c
08a3ec
--- elfutils/src/strings.c
08a3ec
+++ elfutils/src/strings.c
08a3ec
@@ -43,6 +43,10 @@
08a3ec
 
08a3ec
 #include <system.h>
08a3ec
 
08a3ec
+#ifndef MAP_POPULATE
08a3ec
+# define MAP_POPULATE 0
08a3ec
+#endif
08a3ec
+
08a3ec
 
08a3ec
 /* Prototypes of local functions.  */
08a3ec
 static int read_fd (int fd, const char *fname, off64_t fdlen);
8372ba
@@ -489,8 +493,13 @@ map_file (int fd, off64_t start_off, off
08a3ec
 		    fd, start_off);
08a3ec
       if (mem != MAP_FAILED)
08a3ec
 	{
08a3ec
+#if !defined POSIX_MADV_SEQUENTIAL && defined MADV_SEQUENTIAL
08a3ec
+# define POSIX_MADV_SEQUENTIAL MADV_SEQUENTIAL
08a3ec
+#endif
08a3ec
+#ifdef POSIX_MADV_SEQUENTIAL
08a3ec
 	  /* We will go through the mapping sequentially.  */
08a3ec
 	  (void) posix_madvise (mem, map_size, POSIX_MADV_SEQUENTIAL);
08a3ec
+#endif
08a3ec
 	  break;
08a3ec
 	}
08a3ec
       if (errno != EINVAL && errno != ENOMEM)
8372ba
@@ -581,9 +590,11 @@ read_block (int fd, const char *fname, o
08a3ec
       elfmap_off = from & ~(ps - 1);
08a3ec
       elfmap_base = elfmap = map_file (fd, elfmap_off, fdlen, &elfmap_size);
08a3ec
 
08a3ec
+#ifdef POSIX_FADV_SEQUENTIAL
08a3ec
       if (unlikely (elfmap == MAP_FAILED))
08a3ec
 	/* Let the kernel know we are going to read everything in sequence.  */
08a3ec
 	(void) posix_fadvise (fd, 0, 0, POSIX_FADV_SEQUENTIAL);
08a3ec
+#endif
08a3ec
     }
08a3ec
 
08a3ec
   if (unlikely (elfmap == MAP_FAILED))
901878
diffelfutils/src/strip.c git-portable/src/strip.c
08a3ec
--- elfutils/src/strip.c
08a3ec
+++ elfutils/src/strip.c
901878
@@ -2191,7 +2191,14 @@ while computing checksum for debug infor
08a3ec
   /* If requested, preserve the timestamp.  */
08a3ec
   if (tvp != NULL)
08a3ec
     {
901878
+#ifdef HAVE_FUTIMENS
901878
       if (futimens (fd, tvp) != 0)
901878
+#else
901878
+      struct timeval times[2];
901878
+      TIMESPEC_TO_TIMEVAL (&times[0], &tvp[0]);
901878
+      TIMESPEC_TO_TIMEVAL (&times[1], &tvp[1]);
901878
+      if (futimes (fd, times) != 0)
901878
+#endif
08a3ec
 	{
08a3ec
 	  error (0, errno, gettext ("\
08a3ec
 cannot set access and modification date of '%s'"),
901878
@@ -2263,7 +2270,14 @@ handle_ar (int fd, Elf *elf, const char
08a3ec
 
08a3ec
   if (tvp != NULL)
08a3ec
     {
901878
+#ifdef HAVE_FUTIMENS
901878
       if (unlikely (futimens (fd, tvp) != 0))
901878
+#else
901878
+      struct timeval times[2];
901878
+      TIMESPEC_TO_TIMEVAL (&times[0], &tvp[0]);
901878
+      TIMESPEC_TO_TIMEVAL (&times[1], &tvp[1]);
901878
+      if (unlikely (futimes (fd, times) != 0))
901878
+#endif
08a3ec
 	{
08a3ec
 	  error (0, errno, gettext ("\
08a3ec
 cannot set access and modification date of '%s'"), fname);
901878
diffelfutils/tests/backtrace.c git-portable/tests/backtrace.c
d56182
--- elfutils/tests/backtrace.c
d56182
+++ elfutils/tests/backtrace.c
d56182
@@ -36,6 +36,7 @@
d56182
 #include <fcntl.h>
d56182
 #include <string.h>
d56182
 #include <argp.h>
d56182
+#include <sys/syscall.h>
d56182
 #include ELFUTILS_HEADER(dwfl)
d56182
 
8372ba
 #ifndef __linux__
901878
diffelfutils/tests/ChangeLog git-portable/tests/ChangeLog
08a3ec
--- elfutils/tests/ChangeLog
08a3ec
+++ elfutils/tests/ChangeLog
901878
@@ -614,6 +614,13 @@
d56182
 
d56182
 2013-12-02  Jan Kratochvil  <jan.kratochvil@redhat.com>
d56182
 
d56182
+	Handle T-stopped detach for old kernels.
d56182
+	* backtrace.c: Include sys/syscall.h.
d56182
+	(linux_proc_pid_is_stopped): New function.
d56182
+	(ptrace_detach_stopped): Handle old kernels.
d56182
+
d56182
+2013-12-02  Jan Kratochvil  <jan.kratochvil@redhat.com>
d56182
+
d56182
 	* Makefile.am (check_PROGRAMS): Add backtrace, backtrace-child,
d56182
 	backtrace-data and backtrace-dwarf.
d56182
 	(BUILT_SOURCES, clean-local, backtrace-child-biarch): New.
901878
@@ -1478,6 +1485,8 @@
08a3ec
 
08a3ec
 2008-01-21  Roland McGrath  <roland@redhat.com>
08a3ec
 
08a3ec
+	* line2addr.c (main): Revert last change.
08a3ec
+
08a3ec
 	* testfile45.S.bz2: Add tests for cltq, cqto.
08a3ec
 	* testfile45.expect.bz2: Adjust.
08a3ec
 
901878
@@ -2186,6 +2195,11 @@
08a3ec
 	* Makefile.am (TESTS): Add run-elflint-test.sh.
08a3ec
 	(EXTRA_DIST): Add run-elflint-test.sh and testfile18.bz2.
08a3ec
 
08a3ec
+2005-05-31  Roland McGrath  <roland@redhat.com>
08a3ec
+
08a3ec
+	* Makefile.am (WEXTRA): New variable, substituted by configure.
08a3ec
+	(AM_CFLAGS): Use it in place of -Wextra.
08a3ec
+
08a3ec
 2005-05-24  Ulrich Drepper  <drepper@redhat.com>
08a3ec
 
08a3ec
 	* get-files.c (main): Use correct format specifier.
901878
diffelfutils/tests/line2addr.c git-portable/tests/line2addr.c
08a3ec
--- elfutils/tests/line2addr.c
08a3ec
+++ elfutils/tests/line2addr.c
08a3ec
@@ -124,7 +124,7 @@ main (int argc, char *argv[])
08a3ec
     {
08a3ec
       struct args a = { .arg = argv[cnt] };
08a3ec
 
08a3ec
-      switch (sscanf (a.arg, "%m[^:]:%d", &a.file, &a.line))
08a3ec
+      switch (sscanf (a.arg, "%a[^:]:%d", &a.file, &a.line))
08a3ec
 	{
08a3ec
 	default:
08a3ec
 	case 0:
901878
diffelfutils/tests/Makefile.am git-portable/tests/Makefile.am
8372ba
--- elfutils/tests/Makefile.am
8372ba
+++ elfutils/tests/Makefile.am
901878
@@ -382,6 +382,7 @@ get_lines_LDADD = $(libdw) $(libelf)
8372ba
 get_files_LDADD = $(libdw) $(libelf)
8372ba
 get_aranges_LDADD = $(libdw) $(libelf)
8372ba
 allfcts_LDADD = $(libdw) $(libelf)
8372ba
+line2addr_no_Wformat = yes
901878
 line2addr_LDADD = $(libdw) $(argp_LDADD)
901878
 addrscopes_LDADD = $(libdw) $(argp_LDADD)
901878
 funcscopes_LDADD = $(libdw) $(argp_LDADD)
901878
diffelfutils/tests/Makefile.in git-portable/tests/Makefile.in
08a3ec
--- elfutils/tests/Makefile.in
08a3ec
+++ elfutils/tests/Makefile.in
901878
@@ -87,14 +87,15 @@ PRE_UNINSTALL = :
901878
 POST_UNINSTALL = :
901878
 build_triplet = @build@
901878
 host_triplet = @host@
901878
-@SYMBOL_VERSIONING_TRUE@am__append_1 = -DSYMBOL_VERSIONING
901878
-@STANDALONE_FALSE@am__append_2 = -I$(top_srcdir)/libasm -I$(top_srcdir)/libdw \
08a3ec
+@BUILD_WERROR_TRUE@am__append_1 = $(if $($(*F)_no_Werror),,-Werror)
901878
+@SYMBOL_VERSIONING_TRUE@am__append_2 = -DSYMBOL_VERSIONING
901878
+@STANDALONE_FALSE@am__append_3 = -I$(top_srcdir)/libasm -I$(top_srcdir)/libdw \
8372ba
 @STANDALONE_FALSE@	    -I$(top_srcdir)/libdwfl -I$(top_srcdir)/libdwelf \
08a3ec
 @STANDALONE_FALSE@	    -I$(top_srcdir)/libebl -I$(top_srcdir)/libelf \
08a3ec
 @STANDALONE_FALSE@	    -I$(top_srcdir)/lib -I..
08a3ec
 
901878
-@STANDALONE_FALSE@am__append_3 = -Wl,-rpath-link,../libasm:../libdw:../libelf
901878
-@TESTS_RPATH_TRUE@am__append_4 = -Wl,-rpath,$(BUILD_RPATH)
901878
+@STANDALONE_FALSE@am__append_4 = -Wl,-rpath-link,../libasm:../libdw:../libelf
901878
+@TESTS_RPATH_TRUE@am__append_5 = -Wl,-rpath,$(BUILD_RPATH)
08a3ec
 check_PROGRAMS = arextract$(EXEEXT) arsymtest$(EXEEXT) \
08a3ec
 	newfile$(EXEEXT) saridx$(EXEEXT) scnnames$(EXEEXT) \
08a3ec
 	sectiondump$(EXEEXT) showptable$(EXEEXT) update1$(EXEEXT) \
901878
@@ -123,7 +124,7 @@ check_PROGRAMS = arextract$(EXEEXT) arsy
901878
 	aggregate_size$(EXEEXT) vdsosyms$(EXEEXT) getsrc_die$(EXEEXT) \
901878
 	strptr$(EXEEXT) newdata$(EXEEXT) elfstrtab$(EXEEXT) \
d56182
 	$(am__EXEEXT_1) $(am__EXEEXT_2) $(am__EXEEXT_4)
901878
-@BIARCH_TRUE@am__append_5 = backtrace-child-biarch
901878
+@BIARCH_TRUE@am__append_6 = backtrace-child-biarch
d56182
 TESTS = run-arextract.sh run-arsymtest.sh newfile$(EXEEXT) \
d56182
 	test-nlist$(EXEEXT) update1$(EXEEXT) update2$(EXEEXT) \
d56182
 	update3$(EXEEXT) update4$(EXEEXT) run-show-die-info.sh \
901878
@@ -173,14 +174,14 @@ TESTS = run-arextract.sh run-arsymtest.s
901878
 	run-allfcts-multi.sh run-deleted.sh run-linkmap-cut.sh \
901878
 	run-aggregate-size.sh vdsosyms$(EXEEXT) run-readelf-A.sh \
901878
 	run-getsrc-die.sh run-strptr.sh newdata$(EXEEXT) \
901878
-	elfstrtab$(EXEEXT) $(am__EXEEXT_2) $(am__append_8) \
901878
-	$(am__append_9) $(am__EXEEXT_4)
901878
-@STANDALONE_FALSE@am__append_6 = msg_tst md5-sha1-test
901878
+	elfstrtab$(EXEEXT) $(am__EXEEXT_2) $(am__append_9) \
901878
+	$(am__append_10) $(am__EXEEXT_4)
901878
 @STANDALONE_FALSE@am__append_7 = msg_tst md5-sha1-test
901878
-@LZMA_TRUE@am__append_8 = run-readelf-s.sh run-dwflsyms.sh
901878
-@ZLIB_TRUE@am__append_9 = run-readelf-zdebug.sh
901878
-@HAVE_LIBASM_TRUE@am__append_10 = $(asm_TESTS)
901878
+@STANDALONE_FALSE@am__append_8 = msg_tst md5-sha1-test
901878
+@LZMA_TRUE@am__append_9 = run-readelf-s.sh run-dwflsyms.sh
901878
+@ZLIB_TRUE@am__append_10 = run-readelf-zdebug.sh
901878
 @HAVE_LIBASM_TRUE@am__append_11 = $(asm_TESTS)
901878
+@HAVE_LIBASM_TRUE@am__append_12 = $(asm_TESTS)
08a3ec
 subdir = tests
08a3ec
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
d56182
 am__aclocal_m4_deps = $(top_srcdir)/m4/biarch.m4 \
901878
@@ -830,6 +831,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
08a3ec
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
08a3ec
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
08a3ec
 LDFLAGS = @LDFLAGS@
08a3ec
+LD_AS_NEEDED = @LD_AS_NEEDED@
08a3ec
 LEX = @LEX@
08a3ec
 LEXLIB = @LEXLIB@
08a3ec
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
901878
@@ -861,6 +863,7 @@ SHELL = @SHELL@
08a3ec
 STRIP = @STRIP@
08a3ec
 USE_NLS = @USE_NLS@
08a3ec
 VERSION = @VERSION@
08a3ec
+WEXTRA = @WEXTRA@
08a3ec
 XGETTEXT = @XGETTEXT@
08a3ec
 XGETTEXT_015 = @XGETTEXT_015@
08a3ec
 XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
901878
@@ -921,26 +924,26 @@ top_build_prefix = @top_build_prefix@
08a3ec
 top_builddir = @top_builddir@
08a3ec
 top_srcdir = @top_srcdir@
08a3ec
 zip_LIBS = @zip_LIBS@
901878
-AM_CPPFLAGS = -I. -I$(srcdir) -I$(top_srcdir)/lib -I.. $(am__append_2)
901878
+AM_CPPFLAGS = -I. -I$(srcdir) -I$(top_srcdir)/lib -I.. $(am__append_3)
901878
 @ADD_STACK_USAGE_WARNING_FALSE@STACK_USAGE_WARNING = 
901878
 
901878
 # Warn about stack usage of more than 256K = 262144 bytes.
901878
 @ADD_STACK_USAGE_WARNING_TRUE@STACK_USAGE_WARNING = -Wstack-usage=262144
8372ba
-AM_CFLAGS = -std=gnu99 -Wall -Wshadow -Wformat=2 \
8372ba
-	    $(if $($(*F)_no_Werror),,-Werror) \
8372ba
-	    $(if $($(*F)_no_Wunused),,-Wunused -Wextra) \
901878
-	    $(if $($(*F)_no_Wstack_usage),,$(STACK_USAGE_WARNING)) \
8372ba
-	    $($(*F)_CFLAGS)
8372ba
-
8372ba
+AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \
8372ba
+	$($(*F)_no_Werror),,-Werror) $(if \
08a3ec
+	$($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \
901878
+	$($(*F)_no_Wformat),-Wno-format,-Wformat=2) $(if \
901878
+	$($(*F)_no_Wstack_usage),,$(STACK_USAGE_WARNING)) \
901878
+	$($(*F)_CFLAGS) $(am__append_1)
8372ba
 COMPILE.os = $(filter-out -fprofile-arcs -ftest-coverage, $(COMPILE))
901878
-DEFS.os = -DPIC -DSHARED $(am__append_1)
901878
+DEFS.os = -DPIC -DSHARED $(am__append_2)
8372ba
 CLEANFILES = *.gcno *.gcda
901878
 textrel_msg = echo "WARNING: TEXTREL found in '$@'"
901878
 @FATAL_TEXTREL_FALSE@textrel_found = $(textrel_msg)
901878
 @FATAL_TEXTREL_TRUE@textrel_found = $(textrel_msg); exit 1
901878
 textrel_check = if $(READELF) -d $@ | fgrep -q TEXTREL; then $(textrel_found); fi
8372ba
 BUILD_RPATH = \$$ORIGIN/../libasm:\$$ORIGIN/../libdw:\$$ORIGIN/../backends:\$$ORIGIN/../libelf
901878
-AM_LDFLAGS = $(am__append_3) $(am__append_4)
901878
+AM_LDFLAGS = $(am__append_4) $(am__append_5)
08a3ec
 @TESTS_RPATH_FALSE@tests_rpath = no
08a3ec
 @TESTS_RPATH_TRUE@tests_rpath = yes
08a3ec
 asm_TESTS = asm-tst1 asm-tst2 asm-tst3 asm-tst4 asm-tst5 \
901878
@@ -1167,6 +1170,7 @@ get_lines_LDADD = $(libdw) $(libelf)
8372ba
 get_files_LDADD = $(libdw) $(libelf)
8372ba
 get_aranges_LDADD = $(libdw) $(libelf)
8372ba
 allfcts_LDADD = $(libdw) $(libelf)
8372ba
+line2addr_no_Wformat = yes
901878
 line2addr_LDADD = $(libdw) $(argp_LDADD)
901878
 addrscopes_LDADD = $(libdw) $(argp_LDADD)
901878
 funcscopes_LDADD = $(libdw) $(argp_LDADD)