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