1 diff --git a/ChangeLog b/ChangeLog
6 * configure.ac (LOCALEDIR, DATADIRNAME): Removed.
8 +2009-11-22 Roland McGrath <roland@redhat.com>
10 + * configure.ac: Use sed and expr instead of modern bash extensions.
12 2009-09-21 Ulrich Drepper <drepper@redhat.com>
14 * configure.ac: Update for more modern autoconf.
17 * configure.ac (zip_LIBS): Check for liblzma too.
19 +2009-08-17 Roland McGrath <roland@redhat.com>
21 + * configure.ac: Check for -fgnu89-inline; add it to WEXTRA if it works.
23 2009-04-19 Roland McGrath <roland@redhat.com>
25 * configure.ac (eu_version): Round down here, not in version.h macros.
28 2009-01-23 Roland McGrath <roland@redhat.com>
30 + * configure.ac: Check for __builtin_popcount.
32 * configure.ac (zlib check): Check for gzdirect, need zlib >= 1.2.2.3.
34 * configure.ac (__thread check): Use AC_LINK_IFELSE, in case of
36 * configure.ac: Add dummy automake conditional to get dependencies
37 for non-generic linker right. See src/Makefile.am.
39 +2005-11-22 Roland McGrath <roland@redhat.com>
41 + * configure.ac: Check for --as-needed linker option.
43 2005-11-18 Roland McGrath <roland@redhat.com>
45 * Makefile.am (DISTCHECK_CONFIGURE_FLAGS): New variable.
47 * Makefile.am (all_SUBDIRS): Add libdwfl.
48 * configure.ac: Write libdwfl/Makefile.
50 +2005-05-31 Roland McGrath <roland@redhat.com>
52 + * configure.ac (WEXTRA): Check for -Wextra and set this substitution.
54 + * configure.ac: Check for struct stat st_?tim members.
55 + * src/strip.c (process_file): Use st_?time if st_?tim are not there.
57 + * configure.ac: Check for futimes function.
58 + * src/strip.c (handle_elf) [! HAVE_FUTIMES]: Use utimes instead.
59 + (handle_ar) [! HAVE_FUTIMES]: Likewise.
61 2005-05-19 Roland McGrath <roland@redhat.com>
63 * configure.ac [AH_BOTTOM] (INTDECL, _INTDECL): New macros.
64 diff --git a/Makefile.am b/Makefile.am
68 pkginclude_HEADERS = version.h
70 # Add doc back when we have some real content.
71 -SUBDIRS = config m4 lib libelf libebl libdwfl libdw libcpu libasm backends \
73 +#SUBDIRS = config m4 lib libelf libebl libdwfl libdw libcpu libasm backends \
77 EXTRA_DIST = elfutils.spec GPG-KEY NOTES EXCEPTION
79 diff --git a/Makefile.in b/Makefile.in
83 INSTALL_SCRIPT = @INSTALL_SCRIPT@
84 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
86 +LD_AS_NEEDED = @LD_AS_NEEDED@
89 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
96 XGETTEXT_015 = @XGETTEXT_015@
97 XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
99 pkginclude_HEADERS = version.h
101 # Add doc back when we have some real content.
102 -SUBDIRS = config m4 lib libelf libebl libdwfl libdw libcpu libasm backends \
104 +#SUBDIRS = config m4 lib libelf libebl libdwfl libdw libcpu libasm backends \
108 EXTRA_DIST = elfutils.spec GPG-KEY NOTES EXCEPTION
110 diff --git a/backends/ChangeLog b/backends/ChangeLog
111 --- a/backends/ChangeLog
112 +++ b/backends/ChangeLog
114 * ppc_attrs.c (ppc_check_object_attribute): Handle tag
115 GNU_Power_ABI_Struct_Return.
117 +2009-01-23 Roland McGrath <roland@redhat.com>
119 + * Makefile.am (libebl_%.so): Use $(LD_AS_NEEDED).
121 2008-10-04 Ulrich Drepper <drepper@redhat.com>
123 * i386_reloc.def: Fix entries for TLS_GOTDESC, TLS_DESC_CALL, and
125 * sparc_init.c: Likewise.
126 * x86_64_init.c: Likewise.
128 +2005-11-22 Roland McGrath <roland@redhat.com>
130 + * Makefile.am (LD_AS_NEEDED): New variable, substituted by configure.
131 + (libebl_%.so rule): Use it in place of -Wl,--as-needed.
133 2005-11-19 Roland McGrath <roland@redhat.com>
135 * ppc64_reloc.def: REL30 -> ADDR30.
137 * Makefile.am (uninstall): Don't try to remove $(pkgincludedir).
138 (CLEANFILES): Add libebl_$(m).so.
140 + * Makefile.am (WEXTRA): New variable, substituted by configure.
141 + (AM_CFLAGS): Use it in place of -Wextra.
143 * ppc_reloc.def: Update bits per Alan Modra <amodra@bigpond.net.au>.
144 * ppc64_reloc.def: Likewise.
146 diff --git a/backends/Makefile.am b/backends/Makefile.am
147 --- a/backends/Makefile.am
148 +++ b/backends/Makefile.am
150 $(LINK) -shared -o $(@:.map=.so) \
151 -Wl,--whole-archive $< $(cpu_$*) -Wl,--no-whole-archive \
152 -Wl,--version-script,$(@:.so=.map) \
153 - -Wl,-z,defs -Wl,--as-needed $(libelf) $(libdw) $(libmudflap)
154 + -Wl,-z,defs $(LD_AS_NEEDED) $(libelf) $(libdw) $(libmudflap)
157 libebl_i386.so: $(cpu_i386)
158 diff --git a/backends/Makefile.in b/backends/Makefile.in
159 --- a/backends/Makefile.in
160 +++ b/backends/Makefile.in
162 INSTALL_SCRIPT = @INSTALL_SCRIPT@
163 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
165 +LD_AS_NEEDED = @LD_AS_NEEDED@
168 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
174 XGETTEXT = @XGETTEXT@
175 XGETTEXT_015 = @XGETTEXT_015@
176 XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
178 -I$(top_srcdir)/libebl -I$(top_srcdir)/libasm \
179 -I$(top_srcdir)/libelf -I$(top_srcdir)/libdw
180 AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \
181 - $($(*F)_no_Werror),,-Werror) $(if \
182 - $($(*F)_no_Wunused),,-Wunused -Wextra) $(if \
183 + $($(*F)_no_Werror),,) $(if \
184 + $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \
185 $($(*F)_no_Wformat),-Wno-format,-Wformat=2) $($(*F)_CFLAGS) \
187 @MUDFLAP_FALSE@libmudflap =
189 $(LINK) -shared -o $(@:.map=.so) \
190 -Wl,--whole-archive $< $(cpu_$*) -Wl,--no-whole-archive \
191 -Wl,--version-script,$(@:.so=.map) \
192 - -Wl,-z,defs -Wl,--as-needed $(libelf) $(libdw) $(libmudflap)
193 + -Wl,-z,defs $(LD_AS_NEEDED) $(libelf) $(libdw) $(libmudflap)
196 libebl_i386.so: $(cpu_i386)
197 diff --git a/config.h.in b/config.h.in
201 /* config.h.in. Generated from configure.ac by autoheader. */
203 +/* Have __builtin_popcount. */
204 +#undef HAVE_BUILTIN_POPCOUNT
206 /* $libdir subdirectory containing libebl modules. */
210 /* Define for large files, on AIX-style hosts. */
213 +/* Stubbed out if missing compiler support. */
216 #include <eu-config.h>
217 diff --git a/config/Makefile.in b/config/Makefile.in
218 --- a/config/Makefile.in
219 +++ b/config/Makefile.in
221 INSTALL_SCRIPT = @INSTALL_SCRIPT@
222 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
224 +LD_AS_NEEDED = @LD_AS_NEEDED@
227 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
233 XGETTEXT = @XGETTEXT@
234 XGETTEXT_015 = @XGETTEXT_015@
235 XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
236 diff --git a/config/eu.am b/config/eu.am
240 ## <http://www.openinventionnetwork.com>.
244 +LD_AS_NEEDED = @LD_AS_NEEDED@
246 DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H -DLOCALEDIR='"${localedir}"'
247 INCLUDES = -I. -I$(srcdir) -I$(top_srcdir)/lib -I..
248 AM_CFLAGS = -std=gnu99 -Wall -Wshadow \
249 $(if $($(*F)_no_Werror),,-Werror) \
250 - $(if $($(*F)_no_Wunused),,-Wunused -Wextra) \
251 + $(if $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) \
252 $(if $($(*F)_no_Wformat),-Wno-format,-Wformat=2) \
255 diff --git a/configure b/configure
267 @@ -3856,6 +3858,130 @@
268 as_fn_error $? "gcc with C99 support required" "$LINENO" 5
271 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -Wextra option to $CC" >&5
272 +$as_echo_n "checking for -Wextra option to $CC... " >&6; }
273 +if test "${ac_cv_cc_wextra+set}" = set; then :
274 + $as_echo_n "(cached) " >&6
276 + old_CFLAGS="$CFLAGS"
277 +CFLAGS="$CFLAGS -Wextra"
278 +cat confdefs.h - <<_ACEOF >conftest.$ac_ext
279 +/* end confdefs.h. */
282 +if ac_fn_c_try_compile "$LINENO"; then :
283 + ac_cv_cc_wextra=yes
287 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
288 +CFLAGS="$old_CFLAGS"
290 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cc_wextra" >&5
291 +$as_echo "$ac_cv_cc_wextra" >&6; }
293 +if test "x$ac_cv_cc_wextra" = xyes; then :
299 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -fgnu89-inline option to $CC" >&5
300 +$as_echo_n "checking for -fgnu89-inline option to $CC... " >&6; }
301 +if test "${ac_cv_cc_gnu89_inline+set}" = set; then :
302 + $as_echo_n "(cached) " >&6
304 + old_CFLAGS="$CFLAGS"
305 +CFLAGS="$CFLAGS -fgnu89-inline -Werror"
306 +cat confdefs.h - <<_ACEOF >conftest.$ac_ext
307 +/* end confdefs.h. */
311 + inline void bar (void) {}
314 +extern inline void baz (void) {}
317 +if ac_fn_c_try_compile "$LINENO"; then :
318 + ac_cv_cc_gnu89_inline=yes
320 + ac_cv_cc_gnu89_inline=no
322 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
323 +CFLAGS="$old_CFLAGS"
325 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cc_gnu89_inline" >&5
326 +$as_echo "$ac_cv_cc_gnu89_inline" >&6; }
327 +if test "x$ac_cv_cc_gnu89_inline" = xyes; then :
328 + WEXTRA="${WEXTRA:+$WEXTRA }-fgnu89-inline"
331 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --as-needed linker option" >&5
332 +$as_echo_n "checking for --as-needed linker option... " >&6; }
333 +if test "${ac_cv_as_needed+set}" = set; then :
334 + $as_echo_n "(cached) " >&6
336 + cat > conftest.c <<EOF
337 +int main (void) { return 0; }
339 +if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
340 + -fPIC -shared -o conftest.so conftest.c
341 + -Wl,--as-needed 1>&5'
342 + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
343 + (eval $ac_try) 2>&5
345 + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
346 + test $ac_status = 0; }; }
348 + ac_cv_as_needed=yes
354 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_as_needed" >&5
355 +$as_echo "$ac_cv_as_needed" >&6; }
356 +if test "x$ac_cv_as_needed" = xyes; then :
357 + LD_AS_NEEDED=-Wl,--as-needed
363 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_popcount" >&5
364 +$as_echo_n "checking for __builtin_popcount... " >&6; }
365 +if test "${ac_cv_popcount+set}" = set; then :
366 + $as_echo_n "(cached) " >&6
368 + cat confdefs.h - <<_ACEOF >conftest.$ac_ext
369 +/* end confdefs.h. */
374 +exit (__builtin_popcount (127));
379 +if ac_fn_c_try_link "$LINENO"; then :
384 +rm -f core conftest.err conftest.$ac_objext \
385 + conftest$ac_exeext conftest.$ac_ext
387 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_popcount" >&5
388 +$as_echo "$ac_cv_popcount" >&6; }
389 +if test "x$ac_cv_popcount" = xyes; then :
391 +$as_echo "#define HAVE_BUILTIN_POPCOUNT 1" >>confdefs.h
395 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __thread support" >&5
396 $as_echo_n "checking for __thread support... " >&6; }
397 if test "${ac_cv_tls+set}" = set; then :
398 @@ -3892,7 +4018,13 @@
399 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_tls" >&5
400 $as_echo "$ac_cv_tls" >&6; }
401 if test "x$ac_cv_tls" != xyes; then :
402 - as_fn_error $? "__thread support required" "$LINENO" 5
403 + if test "$use_locks" = yes; then :
404 + as_fn_error $? "--enable-thread-safety requires __thread support" "$LINENO" 5
407 +$as_echo "#define __thread /* empty: no multi-thread support */" >>confdefs.h
412 # Check whether --enable-largefile was given.
413 @@ -4878,7 +5010,7 @@
415 # 1.234<whatever> -> 1234<whatever>
416 case "$PACKAGE_VERSION" in
417 -[0-9].*) eu_version="${PACKAGE_VERSION/./}" ;;
418 +[0-9].*) eu_version=`echo "$PACKAGE_VERSION" | sed 's@\.@@'` ;;
419 *) as_fn_error $? "confused by version number '$PACKAGE_VERSION'" "$LINENO" 5 ;;
421 case "$eu_version" in
422 @@ -4907,7 +5039,7 @@
425 # Round up to the next release API (x.y) version.
426 -eu_version=$[($eu_version + 999) / 1000]
427 +eu_version=`expr \( $eu_version + 999 \) / 1000`
429 cat >confcache <<\_ACEOF
430 # This file is a shell script that caches the results of configure
431 diff --git a/configure.ac b/configure.ac
435 AS_IF([test "x$ac_cv_c99" != xyes],
436 AC_MSG_ERROR([gcc with C99 support required]))
438 +AC_CACHE_CHECK([for -Wextra option to $CC], ac_cv_cc_wextra, [dnl
439 +old_CFLAGS="$CFLAGS"
440 +CFLAGS="$CFLAGS -Wextra"
441 +AC_COMPILE_IFELSE([void foo (void) { }],
442 + ac_cv_cc_wextra=yes, ac_cv_cc_wextra=no)
443 +CFLAGS="$old_CFLAGS"])
445 +AS_IF([test "x$ac_cv_cc_wextra" = xyes], [WEXTRA=-Wextra], [WEXTRA=-W])
447 +AC_CACHE_CHECK([for -fgnu89-inline option to $CC], ac_cv_cc_gnu89_inline, [dnl
448 +old_CFLAGS="$CFLAGS"
449 +CFLAGS="$CFLAGS -fgnu89-inline -Werror"
453 + inline void bar (void) {}
456 +extern inline void baz (void) {}
457 +], ac_cv_cc_gnu89_inline=yes, ac_cv_cc_gnu89_inline=no)
458 +CFLAGS="$old_CFLAGS"])
459 +AS_IF([test "x$ac_cv_cc_gnu89_inline" = xyes],
460 + [WEXTRA="${WEXTRA:+$WEXTRA }-fgnu89-inline"])
462 +AC_CACHE_CHECK([for --as-needed linker option],
463 + ac_cv_as_needed, [dnl
464 +cat > conftest.c <<EOF
465 +int main (void) { return 0; }
467 +if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
468 + -fPIC -shared -o conftest.so conftest.c
469 + -Wl,--as-needed 1>&AS_MESSAGE_LOG_FD])
471 + ac_cv_as_needed=yes
476 +AS_IF([test "x$ac_cv_as_needed" = xyes],
477 + [LD_AS_NEEDED=-Wl,--as-needed], [LD_AS_NEEDED=])
478 +AC_SUBST(LD_AS_NEEDED)
480 +AC_CACHE_CHECK([for __builtin_popcount], ac_cv_popcount, [dnl
481 +AC_LINK_IFELSE([AC_LANG_PROGRAM([], [[exit (__builtin_popcount (127));]])],
482 + ac_cv_popcount=yes, ac_cv_popcount=no)])
483 +AS_IF([test "x$ac_cv_popcount" = xyes],
484 + [AC_DEFINE([HAVE_BUILTIN_POPCOUNT], [1], [Have __builtin_popcount.])])
486 AC_CACHE_CHECK([for __thread support], ac_cv_tls, [dnl
487 # Use the same flags that we use for our DSOs, so the test is representative.
488 # Some old compiler/linker/libc combinations fail some ways and not others.
490 CFLAGS="$save_CFLAGS"
491 LDFLAGS="$save_LDFLAGS"])
492 AS_IF([test "x$ac_cv_tls" != xyes],
493 - AC_MSG_ERROR([__thread support required]))
494 + [AS_IF([test "$use_locks" = yes],
495 + [AC_MSG_ERROR([--enable-thread-safety requires __thread support])],
496 + [AC_DEFINE([__thread], [/* empty: no multi-thread support */],
497 + [Stubbed out if missing compiler support.])])])
499 dnl This test must come as early as possible after the compiler configuration
500 dnl tests, because the choice of the file model can (in principle) affect
503 # 1.234<whatever> -> 1234<whatever>
504 case "$PACKAGE_VERSION" in
505 -[[0-9]].*) eu_version="${PACKAGE_VERSION/./}" ;;
506 +[[0-9]].*) eu_version=`echo "$PACKAGE_VERSION" | sed 's@\.@@'` ;;
507 *) AC_MSG_ERROR([confused by version number '$PACKAGE_VERSION']) ;;
509 case "$eu_version" in
513 # Round up to the next release API (x.y) version.
514 -[eu_version=$[($eu_version + 999) / 1000]]
515 +eu_version=`expr \( $eu_version + 999 \) / 1000`
518 diff --git a/lib/ChangeLog b/lib/ChangeLog
523 2009-01-23 Roland McGrath <roland@redhat.com>
525 + * eu-config.h [! HAVE_BUILTIN_POPCOUNT]
526 + (__builtin_popcount): New inline function.
528 * eu-config.h: Add multiple inclusion protection.
530 2009-01-17 Ulrich Drepper <drepper@redhat.com>
532 * Makefile.am (libeu_a_SOURCES): Add it.
533 * system.h: Declare crc32_file.
535 +2005-02-07 Roland McGrath <roland@redhat.com>
537 + * Makefile.am (WEXTRA): New variable, substituted by configure.
538 + (AM_CFLAGS): Use it in place of -Wextra.
540 2005-04-30 Ulrich Drepper <drepper@redhat.com>
542 * Makefile.am: Use -ffunction-sections for xmalloc.c.
543 diff --git a/lib/Makefile.in b/lib/Makefile.in
544 --- a/lib/Makefile.in
545 +++ b/lib/Makefile.in
547 INSTALL_SCRIPT = @INSTALL_SCRIPT@
548 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
550 +LD_AS_NEEDED = @LD_AS_NEEDED@
553 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
559 XGETTEXT = @XGETTEXT@
560 XGETTEXT_015 = @XGETTEXT_015@
561 XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
563 INCLUDES = -I. -I$(srcdir) -I$(top_srcdir)/lib -I.. \
564 -I$(srcdir)/../libelf
565 AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \
566 - $($(*F)_no_Werror),,-Werror) $(if \
567 - $($(*F)_no_Wunused),,-Wunused -Wextra) $(if \
568 + $($(*F)_no_Werror),,) $(if \
569 + $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \
570 $($(*F)_no_Wformat),-Wno-format,-Wformat=2) $($(*F)_CFLAGS) \
571 $(am__append_1) -fpic
572 @MUDFLAP_FALSE@libmudflap =
573 diff --git a/lib/eu-config.h b/lib/eu-config.h
574 --- a/lib/eu-config.h
575 +++ b/lib/eu-config.h
577 /* This macro is used by the tests conditionalize for standalone building. */
578 #define ELFUTILS_HEADER(name) <lib##name.h>
580 +#ifndef HAVE_BUILTIN_POPCOUNT
581 +# define __builtin_popcount hakmem_popcount
582 +static inline unsigned int __attribute__ ((unused))
583 +hakmem_popcount (unsigned int x)
586 + unsigned int n = x - ((x >> 1) & 033333333333) - ((x >> 2) & 011111111111);
587 + return ((n + (n >> 3)) & 030707070707) % 63;
589 +#endif /* HAVE_BUILTIN_POPCOUNT */
593 # define OLD_VERSION(name, version) \
594 diff --git a/lib/fixedsizehash.h b/lib/fixedsizehash.h
595 --- a/lib/fixedsizehash.h
596 +++ b/lib/fixedsizehash.h
601 -#include <sys/cdefs.h>
602 #include <sys/param.h>
606 -#define CONCAT(t1,t2) __CONCAT (t1,t2)
607 +#define CONCAT1(x,y) x##y
608 +#define CONCAT(x,y) CONCAT1(x,y)
610 /* Before including this file the following macros must be defined:
612 diff --git a/lib/system.h b/lib/system.h
616 Network licensing program, please visit www.openinventionnetwork.com
617 <http://www.openinventionnetwork.com>. */
619 +#ifndef TEMP_FAILURE_RETRY
620 +#define TEMP_FAILURE_RETRY(x) x
621 +#define rawmemchr(s,c) memchr((s),(size_t)-1,(c))
625 #define LIB_SYSTEM_H 1
627 diff --git a/lib/xmalloc.c b/lib/xmalloc.c
643 - error (EXIT_FAILURE, 0, _("memory exhausted"));
644 + err (EXIT_FAILURE, _("memory exhausted"));
652 - error (EXIT_FAILURE, 0, _("memory exhausted"));
653 + err (EXIT_FAILURE, _("memory exhausted"));
661 - error (EXIT_FAILURE, 0, _("memory exhausted"));
662 + err (EXIT_FAILURE, _("memory exhausted"));
665 diff --git a/libasm/ChangeLog b/libasm/ChangeLog
666 --- a/libasm/ChangeLog
667 +++ b/libasm/ChangeLog
669 * asm_error.c: Add new error ASM_E_IOERROR.
670 * libasmP.h: Add ASM_E_IOERROR definition.
672 +2005-05-31 Roland McGrath <roland@redhat.com>
674 + * Makefile.am (WEXTRA): New variable, substituted by configure.
675 + (AM_CFLAGS): Use it in place of -Wextra.
677 2005-02-15 Ulrich Drepper <drepper@redhat.com>
679 * Makefile.am (AM_CFLAGS): Add -Wunused -Wextra -Wformat=2.
680 diff --git a/libasm/Makefile.in b/libasm/Makefile.in
681 --- a/libasm/Makefile.in
682 +++ b/libasm/Makefile.in
684 INSTALL_SCRIPT = @INSTALL_SCRIPT@
685 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
687 +LD_AS_NEEDED = @LD_AS_NEEDED@
690 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
696 XGETTEXT = @XGETTEXT@
697 XGETTEXT_015 = @XGETTEXT_015@
698 XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
700 -I$(top_srcdir)/libelf -I$(top_srcdir)/libebl \
701 -I$(top_srcdir)/libdw
702 AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \
703 - $($(*F)_no_Werror),,-Werror) $(if \
704 - $($(*F)_no_Wunused),,-Wunused -Wextra) $(if \
705 + $($(*F)_no_Werror),,) $(if \
706 + $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \
707 $($(*F)_no_Wformat),-Wno-format,-Wformat=2) $($(*F)_CFLAGS) \
709 @MUDFLAP_FALSE@libmudflap =
710 diff --git a/libcpu/ChangeLog b/libcpu/ChangeLog
711 --- a/libcpu/ChangeLog
712 +++ b/libcpu/ChangeLog
715 2009-01-23 Roland McGrath <roland@redhat.com>
717 + * i386_disasm.c (i386_disasm): Add abort after assert-constant for old
718 + compilers that don't realize it's noreturn.
720 * Makefile.am (i386_parse_CFLAGS): Use quotes around command
721 substitution that can produce leading whitespace.
724 * defs/i386.doc: New file.
725 * defs/x86_64: New file.
727 +2005-04-04 Roland McGrath <roland@redhat.com>
729 + * Makefile.am (WEXTRA): New variable, substituted by configure.
730 + (AM_CFLAGS): Use it instead of -Wextra.
732 2005-02-15 Ulrich Drepper <drepper@redhat.com>
734 * Makefile (AM_CFLAGS): Add -Wunused -Wextra -Wformat=2.
735 diff --git a/libcpu/Makefile.in b/libcpu/Makefile.in
736 --- a/libcpu/Makefile.in
737 +++ b/libcpu/Makefile.in
739 INSTALL_SCRIPT = @INSTALL_SCRIPT@
740 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
742 +LD_AS_NEEDED = @LD_AS_NEEDED@
745 LEX_OUTPUT_ROOT = lex.$(<F:lex.l=)
751 XGETTEXT = @XGETTEXT@
752 XGETTEXT_015 = @XGETTEXT_015@
753 XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
755 -I$(srcdir)/../libelf -I$(srcdir)/../libebl \
756 -I$(srcdir)/../libdw -I$(srcdir)/../libasm
757 AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \
758 - $($(*F)_no_Werror),,-Werror) $(if \
759 - $($(*F)_no_Wunused),,-Wunused -Wextra) $(if \
760 + $($(*F)_no_Werror),,) $(if \
761 + $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \
762 $($(*F)_no_Wformat),-Wno-format,-Wformat=2) $($(*F)_CFLAGS) \
763 $(am__append_1) -fpic -fdollars-in-identifiers
764 @MUDFLAP_FALSE@libmudflap =
765 diff --git a/libcpu/i386_disasm.c b/libcpu/i386_disasm.c
766 --- a/libcpu/i386_disasm.c
767 +++ b/libcpu/i386_disasm.c
771 assert (! "INVALID not handled");
776 diff --git a/libcpu/i386_gendis.c b/libcpu/i386_gendis.c
777 --- a/libcpu/i386_gendis.c
778 +++ b/libcpu/i386_gendis.c
789 main (int argc, char *argv[argc])
795 - error (EXIT_FAILURE, 0, "usage: %s <MNEDEFFILE>", argv[0]);
797 + err (EXIT_FAILURE, "usage: %s <MNEDEFFILE>", argv[0]);
806 i386_in = fopen (infname, "r");
807 - if (i386_in == NULL)
808 - error (EXIT_FAILURE, errno, "cannot open %s", argv[1]);
809 + if (i386_in == NULL) {
810 + err (EXIT_FAILURE, "cannot open %s", argv[1]);
817 - return error_message_count != 0;
820 diff --git a/libcpu/i386_lex.c b/libcpu/i386_lex.c
821 --- a/libcpu/i386_lex.c
822 +++ b/libcpu/i386_lex.c
832 @@ -1999,7 +1999,7 @@
834 invalid_char (int ch)
836 - error (0, 0, (isascii (ch)
837 + err (0, (isascii (ch)
838 ? gettext ("invalid character '%c' at line %d; ignored")
839 : gettext ("invalid character '\\%o' at line %d; ignored")),
841 diff --git a/libcpu/i386_lex.l b/libcpu/i386_lex.l
842 --- a/libcpu/i386_lex.l
843 +++ b/libcpu/i386_lex.l
855 invalid_char (int ch)
857 - error (0, 0, (isascii (ch)
858 + err (0, (isascii (ch)
859 ? gettext ("invalid character '%c' at line %d; ignored")
860 : gettext ("invalid character '\\%o' at line %d; ignored")),
862 diff --git a/libcpu/i386_parse.c b/libcpu/i386_parse.c
863 --- a/libcpu/i386_parse.c
864 +++ b/libcpu/i386_parse.c
871 #include <inttypes.h>
874 @@ -1607,9 +1607,6 @@
875 /* Line 1464 of yacc.c */
876 #line 245 "i386_parse.y"
878 - if (error_message_count != 0)
879 - error (EXIT_FAILURE, 0,
880 - "terminated due to previous error");
884 @@ -1645,11 +1642,11 @@
885 newp->from = (yyvsp[(2) - (3)].str);
886 newp->to = (yyvsp[(3) - (3)].str);
887 if (tfind (newp, &synonyms, compare_syn) != NULL)
890 "%d: duplicate definition for synonym '%s'",
891 i386_lineno, (yyvsp[(2) - (3)].str));
892 else if (tsearch ( newp, &synonyms, compare_syn) == NULL)
893 - error (EXIT_FAILURE, 0, "tsearch");
894 + err (EXIT_FAILURE, "tsearch");
898 @@ -1661,7 +1658,7 @@
899 if ((yyvsp[(3) - (6)].field) != NULL && strcmp ((yyvsp[(3) - (6)].field)->name, "RE") != 0
900 && strcmp ((yyvsp[(3) - (6)].field)->name, "R") != 0)
902 - error (0, 0, "%d: only 'R' and 'RE' prefix allowed",
903 + err (0, "%d: only 'R' and 'RE' prefix allowed",
906 if (check_duplicates ((yyvsp[(1) - (6)].bit)) == 0
907 @@ -1686,7 +1683,7 @@
909 if (tsearch ((yyvsp[(4) - (6)].str), &mnemonics,
910 (comparison_fn_t) strcmp) == NULL)
911 - error (EXIT_FAILURE, errno, "tsearch");
912 + err (EXIT_FAILURE, "tsearch");
916 @@ -1707,7 +1704,7 @@
917 else if (strcmp ((yyvsp[(5) - (6)].field)->name, "D") == 0)
918 newp->suffix = suffix_D;
920 - error (EXIT_FAILURE, 0,
922 "%s: %d: unknown suffix '%s'",
923 infname, i386_lineno - 1, (yyvsp[(5) - (6)].field)->name);
925 @@ -1720,7 +1717,7 @@
926 ns->idx = ++nsuffixes;
927 if (tsearch (ns, &suffixes, compare_suf)
929 - error (EXIT_FAILURE, errno, "tsearch");
930 + err (EXIT_FAILURE, "tsearch");
934 @@ -1752,7 +1749,7 @@
935 res = tfind (&search, &bitfields, bitfield_compare);
938 - error (0, 0, "%d: unknown bitfield '%s'",
939 + err (0, "%d: unknown bitfield '%s'",
940 i386_lineno, search.name);
941 (yyval.field) = NULL;
943 @@ -1849,7 +1846,7 @@
944 res = tfind (&search, &bitfields, bitfield_compare);
947 - error (0, 0, "%d: unknown bitfield '%s'",
948 + err (0, "%d: unknown bitfield '%s'",
949 i386_lineno, search.name);
950 (yyval.bit)->type = failure;
952 @@ -1949,7 +1946,7 @@
953 (yyval.name)->field = &bx_reg;
956 - error (0, 0, "%d: unknown bitfield '%s'",
957 + err (0, "%d: unknown bitfield '%s'",
958 i386_lineno, search.name);
959 (yyval.name)->field = NULL;
961 @@ -2220,7 +2217,7 @@
963 yyerror (const char *s)
965 - error (0, 0, gettext ("while reading i386 CPU description: %s at line %d"),
966 + err (0, gettext ("while reading i386 CPU description: %s at line %d"),
967 gettext (s), i386_lineno);
970 @@ -2245,14 +2242,14 @@
972 if (tfind (newp, &bitfields, bitfield_compare) != NULL)
974 - error (0, 0, "%d: duplicated definition of bitfield '%s'",
975 + err (0, "%d: duplicated definition of bitfield '%s'",
981 if (tsearch (newp, &bitfields, bitfield_compare) == NULL)
982 - error (EXIT_FAILURE, errno, "%d: cannot insert new bitfield '%s'",
983 + err (EXIT_FAILURE, "%d: cannot insert new bitfield '%s'",
987 @@ -2292,7 +2289,7 @@
989 obstack_1grow (&os, '\0');
991 - error (0, 0, "%d: field '%s' not a multiple of 8 bits in size",
992 + err (0, "%d: field '%s' not a multiple of 8 bits in size",
993 i386_lineno, (char *) obstack_finish (&os));
995 obstack_free (&os, NULL);
996 @@ -2313,7 +2310,7 @@
998 if (val->field->tmp == testcnt)
1000 - error (0, 0, "%d: bitfield '%s' used more than once",
1001 + err (0, "%d: bitfield '%s' used more than once",
1002 i386_lineno - 1, val->field->name);
1005 @@ -2350,7 +2347,7 @@
1009 - error (0, 0, "%d: unknown bitfield '%s' used in output format",
1010 + err (0, "%d: unknown bitfield '%s' used in output format",
1011 i386_lineno - 1, name->field->name);
1014 @@ -2394,7 +2391,7 @@
1018 - error (0, 0, "%d: bitfield '%s' not used",
1019 + err (0, "%d: bitfield '%s' not used",
1020 i386_lineno - 1, bitval->field->name);
1023 @@ -2457,7 +2454,7 @@
1024 if (runp->type == string)
1026 if (instr->operands[n].str != NULL)
1027 - error (EXIT_FAILURE, 0,
1028 + err (EXIT_FAILURE,
1029 "%d: cannot have more than one string parameter",
1032 @@ -2511,7 +2508,7 @@
1033 else if (instr->operands[n].off3 == 0)
1034 instr->operands[n].off3 = bitoff;
1036 - error (EXIT_FAILURE, 0,
1037 + err (EXIT_FAILURE,
1038 "%d: cannot have more than three fields in parameter",
1041 @@ -2587,7 +2584,7 @@
1042 newp->str = runp->operands[i].fct;
1044 if (tsearch (newp, &fct_names[i], compare_argstring) == NULL)
1045 - error (EXIT_FAILURE, errno, "tsearch");
1046 + err (EXIT_FAILURE, "tsearch");
1050 @@ -2600,7 +2597,7 @@
1051 newp->str = runp->operands[i].str;
1053 if (tsearch (newp, &strs[i], compare_argstring) == NULL)
1054 - error (EXIT_FAILURE, errno, "tsearch");
1055 + err (EXIT_FAILURE, "tsearch");
1059 diff --git a/libcpu/i386_parse.y b/libcpu/i386_parse.y
1060 --- a/libcpu/i386_parse.y
1061 +++ b/libcpu/i386_parse.y
1068 #include <inttypes.h>
1069 #include <libintl.h>
1071 @@ -243,10 +243,6 @@
1073 spec: masks kPERCPERC '\n' instrs
1075 - if (error_message_count != 0)
1076 - error (EXIT_FAILURE, 0,
1077 - "terminated due to previous error");
1082 @@ -267,11 +263,11 @@
1085 if (tfind (newp, &synonyms, compare_syn) != NULL)
1088 "%d: duplicate definition for synonym '%s'",
1090 else if (tsearch ( newp, &synonyms, compare_syn) == NULL)
1091 - error (EXIT_FAILURE, 0, "tsearch");
1092 + err (EXIT_FAILURE, "tsearch");
1097 if ($3 != NULL && strcmp ($3->name, "RE") != 0
1098 && strcmp ($3->name, "R") != 0)
1100 - error (0, 0, "%d: only 'R' and 'RE' prefix allowed",
1101 + err (0, "%d: only 'R' and 'RE' prefix allowed",
1104 if (check_duplicates ($1) == 0
1107 if (tsearch ($4, &mnemonics,
1108 (comparison_fn_t) strcmp) == NULL)
1109 - error (EXIT_FAILURE, errno, "tsearch");
1110 + err (EXIT_FAILURE, "tsearch");
1115 else if (strcmp ($5->name, "D") == 0)
1116 newp->suffix = suffix_D;
1118 - error (EXIT_FAILURE, 0,
1119 + err (EXIT_FAILURE,
1120 "%s: %d: unknown suffix '%s'",
1121 infname, i386_lineno - 1, $5->name);
1124 ns->idx = ++nsuffixes;
1125 if (tsearch (ns, &suffixes, compare_suf)
1127 - error (EXIT_FAILURE, errno, "tsearch");
1128 + err (EXIT_FAILURE, "tsearch");
1133 res = tfind (&search, &bitfields, bitfield_compare);
1136 - error (0, 0, "%d: unknown bitfield '%s'",
1137 + err (0, "%d: unknown bitfield '%s'",
1138 i386_lineno, search.name);
1142 res = tfind (&search, &bitfields, bitfield_compare);
1145 - error (0, 0, "%d: unknown bitfield '%s'",
1146 + err (0, "%d: unknown bitfield '%s'",
1147 i386_lineno, search.name);
1151 $$->field = &bx_reg;
1154 - error (0, 0, "%d: unknown bitfield '%s'",
1155 + err (0, "%d: unknown bitfield '%s'",
1156 i386_lineno, search.name);
1161 yyerror (const char *s)
1163 - error (0, 0, gettext ("while reading i386 CPU description: %s at line %d"),
1164 + err (0, gettext ("while reading i386 CPU description: %s at line %d"),
1165 gettext (s), i386_lineno);
1168 @@ -574,14 +570,14 @@
1170 if (tfind (newp, &bitfields, bitfield_compare) != NULL)
1172 - error (0, 0, "%d: duplicated definition of bitfield '%s'",
1173 + err (0, "%d: duplicated definition of bitfield '%s'",
1179 if (tsearch (newp, &bitfields, bitfield_compare) == NULL)
1180 - error (EXIT_FAILURE, errno, "%d: cannot insert new bitfield '%s'",
1181 + err (EXIT_FAILURE, "%d: cannot insert new bitfield '%s'",
1187 obstack_1grow (&os, '\0');
1189 - error (0, 0, "%d: field '%s' not a multiple of 8 bits in size",
1190 + err (0, "%d: field '%s' not a multiple of 8 bits in size",
1191 i386_lineno, (char *) obstack_finish (&os));
1193 obstack_free (&os, NULL);
1196 if (val->field->tmp == testcnt)
1198 - error (0, 0, "%d: bitfield '%s' used more than once",
1199 + err (0, "%d: bitfield '%s' used more than once",
1200 i386_lineno - 1, val->field->name);
1207 - error (0, 0, "%d: unknown bitfield '%s' used in output format",
1208 + err (0, "%d: unknown bitfield '%s' used in output format",
1209 i386_lineno - 1, name->field->name);
1216 - error (0, 0, "%d: bitfield '%s' not used",
1217 + err (0, "%d: bitfield '%s' not used",
1218 i386_lineno - 1, bitval->field->name);
1222 if (runp->type == string)
1224 if (instr->operands[n].str != NULL)
1225 - error (EXIT_FAILURE, 0,
1226 + err (EXIT_FAILURE,
1227 "%d: cannot have more than one string parameter",
1231 else if (instr->operands[n].off3 == 0)
1232 instr->operands[n].off3 = bitoff;
1234 - error (EXIT_FAILURE, 0,
1235 + err (EXIT_FAILURE,
1236 "%d: cannot have more than three fields in parameter",
1240 newp->str = runp->operands[i].fct;
1242 if (tsearch (newp, &fct_names[i], compare_argstring) == NULL)
1243 - error (EXIT_FAILURE, errno, "tsearch");
1244 + err (EXIT_FAILURE, "tsearch");
1249 newp->str = runp->operands[i].str;
1251 if (tsearch (newp, &strs[i], compare_argstring) == NULL)
1252 - error (EXIT_FAILURE, errno, "tsearch");
1253 + err (EXIT_FAILURE, "tsearch");
1257 diff --git a/libdw/ChangeLog b/libdw/ChangeLog
1258 --- a/libdw/ChangeLog
1259 +++ b/libdw/ChangeLog
1260 @@ -308,6 +308,10 @@
1262 * dwarf_hasattr_integrate.c: Integrate DW_AT_specification too.
1264 +2009-08-17 Roland McGrath <roland@redhat.com>
1266 + * libdw.h: Disable extern inlines for GCC 4.2.
1268 2009-08-10 Roland McGrath <roland@redhat.com>
1270 * dwarf_getscopevar.c: Use dwarf_diename.
1271 @@ -1076,6 +1080,11 @@
1273 2005-05-31 Roland McGrath <roland@redhat.com>
1275 + * Makefile.am (WEXTRA): New variable, substituted by configure.
1276 + (AM_CFLAGS): Use it in place of -Wextra.
1278 +2005-05-31 Roland McGrath <roland@redhat.com>
1280 * dwarf_formref_die.c (dwarf_formref_die): Add CU header offset to
1283 diff --git a/libdw/Makefile.in b/libdw/Makefile.in
1284 --- a/libdw/Makefile.in
1285 +++ b/libdw/Makefile.in
1287 INSTALL_SCRIPT = @INSTALL_SCRIPT@
1288 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
1290 +LD_AS_NEEDED = @LD_AS_NEEDED@
1293 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
1299 XGETTEXT = @XGETTEXT@
1300 XGETTEXT_015 = @XGETTEXT_015@
1301 XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
1303 INCLUDES = -I. -I$(srcdir) -I$(top_srcdir)/lib -I.. \
1304 -I$(srcdir)/../libelf
1305 AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \
1306 - $($(*F)_no_Werror),,-Werror) $(if \
1307 - $($(*F)_no_Wunused),,-Wunused -Wextra) $(if \
1308 + $($(*F)_no_Werror),,) $(if \
1309 + $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \
1310 $($(*F)_no_Wformat),-Wno-format,-Wformat=2) $($(*F)_CFLAGS) \
1311 $(am__append_1) $(am__append_2)
1312 @MUDFLAP_FALSE@libmudflap =
1313 diff --git a/libdw/dwarf_getpubnames.c b/libdw/dwarf_getpubnames.c
1314 --- a/libdw/dwarf_getpubnames.c
1315 +++ b/libdw/dwarf_getpubnames.c
1317 #include <sys/param.h>
1320 +#include <system.h>
1324 diff --git a/libdw/libdw.h b/libdw/libdw.h
1330 /* Inline optimizations. */
1331 -#ifdef __OPTIMIZE__
1332 +#if defined __OPTIMIZE__ && !(__GNUC__ == 4 && __GNUC_MINOR__ == 2)
1333 /* Return attribute code of given attribute. */
1334 __libdw_extern_inline unsigned int
1335 dwarf_whatattr (Dwarf_Attribute *attr)
1336 diff --git a/libdw/libdw_alloc.c b/libdw/libdw_alloc.c
1337 --- a/libdw/libdw_alloc.c
1338 +++ b/libdw/libdw_alloc.c
1340 # include <config.h>
1347 #include <sys/param.h>
1352 - error (EXIT_FAILURE, ENOMEM, "libdw");
1353 + err (EXIT_FAILURE, "libdw");
1355 diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog
1356 --- a/libdwfl/ChangeLog
1357 +++ b/libdwfl/ChangeLog
1358 @@ -1366,6 +1366,11 @@
1360 2005-07-21 Roland McGrath <roland@redhat.com>
1362 + * Makefile.am (WEXTRA): New variable, substituted by configure.
1363 + (AM_CFLAGS): Use it in place of -Wextra.
1365 +2005-07-21 Roland McGrath <roland@redhat.com>
1367 * Makefile.am (noinst_HEADERS): Add loc2c.c.
1369 * test2.c (main): Check sscanf result to quiet warning.
1370 diff --git a/libdwfl/Makefile.in b/libdwfl/Makefile.in
1371 --- a/libdwfl/Makefile.in
1372 +++ b/libdwfl/Makefile.in
1374 dwfl_getmodules.c dwfl_getdwarf.c dwfl_module_getdwarf.c \
1375 dwfl_module_getelf.c dwfl_validate_address.c argp-std.c \
1376 find-debuginfo.c dwfl_build_id_find_elf.c \
1377 - dwfl_build_id_find_debuginfo.c linux-kernel-modules.c \
1378 + dwfl_build_id_find_debuginfo.c \
1379 linux-proc-maps.c dwfl_addrmodule.c dwfl_addrdwarf.c cu.c \
1380 dwfl_module_nextcu.c dwfl_nextcu.c dwfl_cumodule.c \
1381 dwfl_module_addrdie.c dwfl_addrdie.c lines.c dwfl_lineinfo.c \
1383 dwfl_validate_address.$(OBJEXT) argp-std.$(OBJEXT) \
1384 find-debuginfo.$(OBJEXT) dwfl_build_id_find_elf.$(OBJEXT) \
1385 dwfl_build_id_find_debuginfo.$(OBJEXT) \
1386 - linux-kernel-modules.$(OBJEXT) linux-proc-maps.$(OBJEXT) \
1387 + linux-proc-maps.$(OBJEXT) \
1388 dwfl_addrmodule.$(OBJEXT) dwfl_addrdwarf.$(OBJEXT) \
1389 cu.$(OBJEXT) dwfl_module_nextcu.$(OBJEXT) \
1390 dwfl_nextcu.$(OBJEXT) dwfl_cumodule.$(OBJEXT) \
1392 INSTALL_SCRIPT = @INSTALL_SCRIPT@
1393 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
1395 +LD_AS_NEEDED = @LD_AS_NEEDED@
1398 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
1404 XGETTEXT = @XGETTEXT@
1405 XGETTEXT_015 = @XGETTEXT_015@
1406 XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
1408 -I$(srcdir)/../libelf -I$(srcdir)/../libebl \
1409 -I$(srcdir)/../libdw
1410 AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \
1411 - $($(*F)_no_Werror),,-Werror) $(if \
1412 - $($(*F)_no_Wunused),,-Wunused -Wextra) $(if \
1413 + $($(*F)_no_Werror),,) $(if \
1414 + $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \
1415 $($(*F)_no_Wformat),-Wno-format,-Wformat=2) $($(*F)_CFLAGS) \
1417 @MUDFLAP_FALSE@libmudflap =
1419 dwfl_getmodules.c dwfl_getdwarf.c dwfl_module_getdwarf.c \
1420 dwfl_module_getelf.c dwfl_validate_address.c argp-std.c \
1421 find-debuginfo.c dwfl_build_id_find_elf.c \
1422 - dwfl_build_id_find_debuginfo.c linux-kernel-modules.c \
1423 + dwfl_build_id_find_debuginfo.c \
1424 linux-proc-maps.c dwfl_addrmodule.c dwfl_addrdwarf.c cu.c \
1425 dwfl_module_nextcu.c dwfl_nextcu.c dwfl_cumodule.c \
1426 dwfl_module_addrdie.c dwfl_addrdie.c lines.c dwfl_lineinfo.c \
1428 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdwfl_crc32_file.Po@am__quote@
1429 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lines.Po@am__quote@
1430 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/link_map.Po@am__quote@
1431 -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/linux-kernel-modules.Po@am__quote@
1432 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/linux-proc-maps.Po@am__quote@
1433 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzma.Po@am__quote@
1434 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/offline.Po@am__quote@
1435 diff --git a/libdwfl/argp-std.c b/libdwfl/argp-std.c
1436 --- a/libdwfl/argp-std.c
1437 +++ b/libdwfl/argp-std.c
1439 { "linux-process-map", 'M', "FILE", 0,
1440 N_("Find addresses in files mapped as read from FILE"
1441 " in Linux /proc/PID/maps format"), 0 },
1442 - { "kernel", 'k', NULL, 0, N_("Find addresses in the running kernel"), 0 },
1443 - { "offline-kernel", 'K', "RELEASE", OPTION_ARG_OPTIONAL,
1444 - N_("Kernel with all modules"), 0 },
1445 { "debuginfo-path", OPT_DEBUGINFO, "PATH", 0,
1446 N_("Search path for separate debuginfo files"), 0 },
1447 { NULL, 0, NULL, 0, NULL, 0 }
1449 .find_elf = INTUSE(dwfl_linux_proc_find_elf),
1452 -static const Dwfl_Callbacks kernel_callbacks =
1454 - .find_debuginfo = INTUSE(dwfl_standard_find_debuginfo),
1455 - .debuginfo_path = &debuginfo_path,
1457 - .find_elf = INTUSE(dwfl_linux_kernel_find_elf),
1458 - .section_address = INTUSE(dwfl_linux_kernel_module_section_address),
1462 parse_opt (int key, char *arg, struct argp_state *state)
1464 @@ -244,37 +232,6 @@
1469 - if (state->hook == NULL)
1471 - Dwfl *dwfl = INTUSE(dwfl_begin) (&kernel_callbacks);
1472 - int result = INTUSE(dwfl_linux_kernel_report_kernel) (dwfl);
1474 - return fail (dwfl, result, _("cannot load kernel symbols"));
1475 - result = INTUSE(dwfl_linux_kernel_report_modules) (dwfl);
1477 - /* Non-fatal to have no modules since we do have the kernel. */
1478 - failure (dwfl, result, _("cannot find kernel modules"));
1479 - state->hook = dwfl;
1486 - if (state->hook == NULL)
1488 - Dwfl *dwfl = INTUSE(dwfl_begin) (&offline_callbacks);
1489 - int result = INTUSE(dwfl_linux_kernel_report_offline) (dwfl, arg,
1492 - return fail (dwfl, result, _("cannot find kernel or modules"));
1493 - state->hook = dwfl;
1499 case ARGP_KEY_SUCCESS:
1501 Dwfl *dwfl = state->hook;
1502 diff --git a/libdwfl/core-file.c b/libdwfl/core-file.c
1503 --- a/libdwfl/core-file.c
1504 +++ b/libdwfl/core-file.c
1506 This implementation is pessimal for non-mmap cases and should
1507 be replaced by more diddling inside libelf internals. */
1509 -elf_begin_rand (Elf *parent, loff_t offset, loff_t size, loff_t *next)
1510 +elf_begin_rand (Elf *parent, off_t offset, off_t size, off_t *next)
1518 - loff_t min = (parent->kind == ELF_K_ELF ?
1519 + off_t min = (parent->kind == ELF_K_ELF ?
1520 (parent->class == ELFCLASS32
1521 ? sizeof (Elf32_Ehdr) : sizeof (Elf64_Ehdr))
1522 : parent->kind == ELF_K_AR ? SARMAG
1525 if (unlikely (offset < min)
1526 - || unlikely (offset >= (loff_t) parent->maximum_size))
1527 + || unlikely (offset >= (off_t) parent->maximum_size))
1528 return fail (ELF_E_RANGE);
1530 /* For an archive, fetch just the size field
1531 @@ -113,11 +113,11 @@
1533 size = strtoll (h.ar_size, &endp, 10);
1534 if (unlikely (endp == h.ar_size)
1535 - || unlikely ((loff_t) parent->maximum_size - offset < size))
1536 + || unlikely ((off_t) parent->maximum_size - offset < size))
1537 return fail (ELF_E_INVALID_ARCHIVE);
1540 - if (unlikely ((loff_t) parent->maximum_size - offset < size))
1541 + if (unlikely ((off_t) parent->maximum_size - offset < size))
1542 return fail (ELF_E_RANGE);
1544 /* Even if we fail at this point, update *NEXT to point past the file. */
1546 *next = offset + size;
1548 if (unlikely (offset == 0)
1549 - && unlikely (size == (loff_t) parent->maximum_size))
1550 + && unlikely (size == (off_t) parent->maximum_size))
1551 return elf_clone (parent, parent->cmd);
1553 /* Note the image is guaranteed live only as long as PARENT
1555 Elf_Data *data = elf_getdata_rawchunk (parent, offset, size, ELF_T_BYTE);
1558 - assert ((loff_t) data->d_size == size);
1559 + assert ((off_t) data->d_size == size);
1560 return elf_memory (data->d_buf, size);
1563 diff --git a/libdwfl/dwfl_build_id_find_elf.c b/libdwfl/dwfl_build_id_find_elf.c
1564 --- a/libdwfl/dwfl_build_id_find_elf.c
1565 +++ b/libdwfl/dwfl_build_id_find_elf.c
1567 <http://www.openinventionnetwork.com>. */
1569 #include "libdwflP.h"
1570 +#include <system.h>
1571 #include <inttypes.h>
1576 if (*file_name != NULL)
1578 - *file_name = canonicalize_file_name (name);
1579 + *file_name = realpath (name, NULL);
1580 if (*file_name == NULL)
1583 diff --git a/libdwfl/dwfl_module_getdwarf.c b/libdwfl/dwfl_module_getdwarf.c
1584 --- a/libdwfl/dwfl_module_getdwarf.c
1585 +++ b/libdwfl/dwfl_module_getdwarf.c
1587 <http://www.openinventionnetwork.com>. */
1589 #include "libdwflP.h"
1590 +#include <system.h>
1594 diff --git a/libdwfl/find-debuginfo.c b/libdwfl/find-debuginfo.c
1595 --- a/libdwfl/find-debuginfo.c
1596 +++ b/libdwfl/find-debuginfo.c
1600 char *file_dirname = (file_basename == file_name ? NULL
1601 - : strndupa (file_name, file_basename - 1 - file_name));
1602 + : strndup (file_name, file_basename - 1 - file_name));
1604 while ((p = strsep (&path, ":")) != NULL)
1607 /* If FILE_NAME is a symlink, the debug file might be associated
1608 with the symlink target name instead. */
1610 - char *canon = canonicalize_file_name (file_name);
1611 + char *canon = realpath (file_name, NULL);
1612 if (canon != NULL && strcmp (file_name, canon))
1613 fd = find_debuginfo_in_path (mod, canon,
1614 debuglink_file, debuglink_crc,
1615 diff --git a/libebl/ChangeLog b/libebl/ChangeLog
1616 --- a/libebl/ChangeLog
1617 +++ b/libebl/ChangeLog
1618 @@ -628,6 +628,11 @@
1619 * Makefile.am (libebl_*_so_SOURCES): Set to $(*_SRCS) so dependency
1620 tracking works right.
1622 +2005-05-31 Roland McGrath <roland@redhat.com>
1624 + * Makefile.am (WEXTRA): New variable, substituted by configure.
1625 + (AM_CFLAGS): Use it in place of -Wextra.
1627 2005-05-21 Ulrich Drepper <drepper@redhat.com>
1629 * libebl_x86_64.map: Add x86_64_core_note.
1630 diff --git a/libebl/Makefile.in b/libebl/Makefile.in
1631 --- a/libebl/Makefile.in
1632 +++ b/libebl/Makefile.in
1634 INSTALL_SCRIPT = @INSTALL_SCRIPT@
1635 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
1637 +LD_AS_NEEDED = @LD_AS_NEEDED@
1640 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
1646 XGETTEXT = @XGETTEXT@
1647 XGETTEXT_015 = @XGETTEXT_015@
1648 XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
1650 -I$(srcdir)/../libelf -I$(srcdir)/../libdw \
1651 -I$(srcdir)/../libasm
1652 AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \
1653 - $($(*F)_no_Werror),,-Werror) $(if \
1654 - $($(*F)_no_Wunused),,-Wunused -Wextra) $(if \
1655 + $($(*F)_no_Werror),,) $(if \
1656 + $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \
1657 $($(*F)_no_Wformat),-Wno-format,-Wformat=2) $($(*F)_CFLAGS) \
1658 $(am__append_1) -fpic
1659 @MUDFLAP_FALSE@libmudflap =
1660 diff --git a/libebl/eblopenbackend.c b/libebl/eblopenbackend.c
1661 --- a/libebl/eblopenbackend.c
1662 +++ b/libebl/eblopenbackend.c
1668 #include <libelfP.h>
1671 diff --git a/libelf/ChangeLog b/libelf/ChangeLog
1672 --- a/libelf/ChangeLog
1673 +++ b/libelf/ChangeLog
1674 @@ -671,6 +671,11 @@
1676 * elf.h: Update from glibc.
1678 +2005-05-31 Roland McGrath <roland@redhat.com>
1680 + * Makefile.am (WEXTRA): New variable, substituted by configure.
1681 + (AM_CFLAGS): Use it in place of -Wextra.
1683 2005-05-08 Roland McGrath <roland@redhat.com>
1685 * elf_begin.c (read_file) [_MUDFLAP]: Don't use mmap for now.
1686 diff --git a/libelf/Makefile.in b/libelf/Makefile.in
1687 --- a/libelf/Makefile.in
1688 +++ b/libelf/Makefile.in
1690 INSTALL_SCRIPT = @INSTALL_SCRIPT@
1691 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
1693 +LD_AS_NEEDED = @LD_AS_NEEDED@
1696 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
1702 XGETTEXT = @XGETTEXT@
1703 XGETTEXT_015 = @XGETTEXT_015@
1704 XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
1706 zip_LIBS = @zip_LIBS@
1707 INCLUDES = -I. -I$(srcdir) -I$(top_srcdir)/lib -I..
1708 AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \
1709 - $($(*F)_no_Werror),,-Werror) $(if \
1710 - $($(*F)_no_Wunused),,-Wunused -Wextra) $(if \
1711 + $($(*F)_no_Werror),,) $(if \
1712 + $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \
1713 $($(*F)_no_Wformat),-Wno-format,-Wformat=2) $($(*F)_CFLAGS) \
1714 $(am__append_1) $(am__append_2)
1715 @MUDFLAP_FALSE@libmudflap =
1716 diff --git a/libelf/ar.h b/libelf/ar.h
1717 new file mode 100644
1721 +/* archive file definition for GNU software
1723 + Copyright 2001, 2008, 2010 Free Software Foundation, Inc.
1725 + This program is free software; you can redistribute it and/or modify
1726 + it under the terms of the GNU General Public License as published by
1727 + the Free Software Foundation; either version 3 of the License, or
1728 + (at your option) any later version.
1730 + This program is distributed in the hope that it will be useful,
1731 + but WITHOUT ANY WARRANTY; without even the implied warranty of
1732 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1733 + GNU General Public License for more details.
1735 + You should have received a copy of the GNU General Public License
1736 + along with this program; if not, write to the Free Software
1737 + Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
1738 + MA 02110-1301, USA. */
1740 +/* So far this is correct for BSDish archives. Don't forget that
1741 + files must begin on an even byte boundary. */
1743 +#ifndef __GNU_AR_H__
1744 +#define __GNU_AR_H__
1746 +/* Note that the usual '\n' in magic strings may translate to different
1747 + characters, as allowed by ANSI. '\012' has a fixed value, and remains
1748 + compatible with existing BSDish archives. */
1750 +#define ARMAG "!<arch>\012" /* For COFF and a.out archives. */
1751 +#define ARMAGB "!<bout>\012" /* For b.out archives. */
1752 +#define ARMAGT "!<thin>\012" /* For thin archives. */
1754 +#define ARFMAG "`\012"
1756 +/* The ar_date field of the armap (__.SYMDEF) member of an archive
1757 + must be greater than the modified date of the entire file, or
1758 + BSD-derived linkers complain. We originally write the ar_date with
1759 + this offset from the real file's mod-time. After finishing the
1760 + file, we rewrite ar_date if it's not still greater than the mod date. */
1762 +#define ARMAP_TIME_OFFSET 60
1766 + char ar_name[16]; /* Name of this member. */
1767 + char ar_date[12]; /* File mtime. */
1768 + char ar_uid[6]; /* Owner uid; printed as decimal. */
1769 + char ar_gid[6]; /* Owner gid; printed as decimal. */
1770 + char ar_mode[8]; /* File mode, printed as octal. */
1771 + char ar_size[10]; /* File size, printed as decimal. */
1772 + char ar_fmag[2]; /* Should contain ARFMAG. */
1775 +#endif /* __GNU_AR_H__ */
1776 diff --git a/libelf/common.h b/libelf/common.h
1777 --- a/libelf/common.h
1778 +++ b/libelf/common.h
1785 #include <byteswap.h>
1789 (Var) = (sizeof (Var) == 1 \
1790 ? (unsigned char) (Var) \
1791 : (sizeof (Var) == 2 \
1792 - ? bswap_16 (Var) \
1793 + ? (unsigned short int) bswap_16 (Var) \
1794 : (sizeof (Var) == 4 \
1798 (Dst) = (sizeof (Var) == 1 \
1799 ? (unsigned char) (Var) \
1800 : (sizeof (Var) == 2 \
1801 - ? bswap_16 (Var) \
1802 + ? (unsigned short int) bswap_16 (Var) \
1803 : (sizeof (Var) == 4 \
1806 diff --git a/libelf/elf.h b/libelf/elf.h
1813 -#include <features.h>
1820 /* Standard ELF types. */
1822 @@ -2794,6 +2795,8 @@
1823 #define R_M32R_NUM 256 /* Keep this the last entry. */
1832 diff --git a/libelf/elf_begin.c b/libelf/elf_begin.c
1833 --- a/libelf/elf_begin.c
1834 +++ b/libelf/elf_begin.c
1838 /* Copy the raw name over to a NUL terminated buffer. */
1839 - *((char *) __mempcpy (elf->state.ar.raw_name, ar_hdr->ar_name, 16)) = '\0';
1840 + *((char *) mempcpy (elf->state.ar.raw_name, ar_hdr->ar_name, 16)) = '\0';
1842 elf_ar_hdr = &elf->state.ar.elf_ar_hdr;
1845 const char *string = ar_hdr->FIELD; \
1846 if (ar_hdr->FIELD[sizeof (ar_hdr->FIELD) - 1] != ' ') \
1848 - *((char *) __mempcpy (buf, ar_hdr->FIELD, sizeof (ar_hdr->FIELD))) \
1849 + *((char *) mempcpy (buf, ar_hdr->FIELD, sizeof (ar_hdr->FIELD))) \
1853 diff --git a/libelf/libelf.h b/libelf/libelf.h
1854 --- a/libelf/libelf.h
1855 +++ b/libelf/libelf.h
1857 Elf_Type d_type; /* Type of this piece of data. */
1858 unsigned int d_version; /* ELF version. */
1859 size_t d_size; /* Size in bytes. */
1860 - loff_t d_off; /* Offset into section. */
1861 + off_t d_off; /* Offset into section. */
1862 size_t d_align; /* Alignment in section. */
1866 uid_t ar_uid; /* User ID. */
1867 gid_t ar_gid; /* Group ID. */
1868 mode_t ar_mode; /* File mode. */
1869 - loff_t ar_size; /* File size. */
1870 + off_t ar_size; /* File size. */
1871 char *ar_rawname; /* Original name of archive member. */
1874 @@ -198,13 +198,13 @@
1875 extern int elf_end (Elf *__elf);
1877 /* Update ELF descriptor and write file to disk. */
1878 -extern loff_t elf_update (Elf *__elf, Elf_Cmd __cmd);
1879 +extern off_t elf_update (Elf *__elf, Elf_Cmd __cmd);
1881 /* Determine what kind of file is associated with ELF. */
1882 extern Elf_Kind elf_kind (Elf *__elf) __attribute__ ((__pure__));
1884 /* Get the base offset for an object file. */
1885 -extern loff_t elf_getbase (Elf *__elf);
1886 +extern off_t elf_getbase (Elf *__elf);
1889 /* Retrieve file identification data. */
1891 would be for TYPE. The resulting Elf_Data pointer is valid until
1892 elf_end (ELF) is called. */
1893 extern Elf_Data *elf_getdata_rawchunk (Elf *__elf,
1894 - loff_t __offset, size_t __size,
1895 + off_t __offset, size_t __size,
1900 extern Elf_Arhdr *elf_getarhdr (Elf *__elf);
1902 /* Return offset in archive for current file ELF. */
1903 -extern loff_t elf_getaroff (Elf *__elf);
1904 +extern off_t elf_getaroff (Elf *__elf);
1906 /* Select archive element at OFFSET. */
1907 extern size_t elf_rand (Elf *__elf, size_t __offset);
1908 diff --git a/libelf/libelfP.h b/libelf/libelfP.h
1909 --- a/libelf/libelfP.h
1910 +++ b/libelf/libelfP.h
1912 # include <config.h>
1920 diff --git a/m4/Makefile.in b/m4/Makefile.in
1921 --- a/m4/Makefile.in
1922 +++ b/m4/Makefile.in
1924 INSTALL_SCRIPT = @INSTALL_SCRIPT@
1925 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
1927 +LD_AS_NEEDED = @LD_AS_NEEDED@
1930 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
1936 XGETTEXT = @XGETTEXT@
1937 XGETTEXT_015 = @XGETTEXT_015@
1938 XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
1939 diff --git a/src/ChangeLog b/src/ChangeLog
1942 @@ -260,8 +260,16 @@
1943 * readelf.c (attr_callback): Use print_block only when we don't use
1946 +2009-08-17 Roland McGrath <roland@redhat.com>
1948 + * ld.h: Disable extern inlines for GCC 4.2.
1950 2009-08-14 Roland McGrath <roland@redhat.com>
1952 + * strings.c (read_block): Conditionalize posix_fadvise use
1953 + on [POSIX_FADV_SEQUENTIAL].
1954 + From Petr Salinger <Petr.Salinger@seznam.cz>.
1956 * ar.c (do_oper_extract): Use pathconf instead of statfs.
1958 2009-08-01 Ulrich Drepper <drepper@redhat.com>
1960 * readelf.c (print_debug_frame_section): Use t instead of j formats
1961 for ptrdiff_t OFFSET.
1963 + * addr2line.c (handle_address): Use %a instead of %m for compatibility.
1965 2009-01-21 Ulrich Drepper <drepper@redhat.com>
1967 * elflint.c (check_program_header): Fix typo in .eh_frame_hdr section
1968 @@ -608,6 +618,11 @@
1969 that matches its PT_LOAD's p_flags &~ PF_W. On sparc, PF_X really
1972 +2008-03-01 Roland McGrath <roland@redhat.com>
1974 + * readelf.c (dump_archive_index): Tweak portability hack
1975 + to match [__GNUC__ < 4] too.
1977 2008-02-29 Roland McGrath <roland@redhat.com>
1979 * readelf.c (print_attributes): Add a cast.
1982 * readelf.c (hex_dump): Fix rounding error in whitespace calculation.
1984 + * Makefile.am (readelf_no_Werror): New variable.
1986 2007-10-15 Roland McGrath <roland@redhat.com>
1988 * make-debug-archive.in: New file.
1989 @@ -1298,6 +1315,10 @@
1990 * elflint.c (valid_e_machine): Add EM_ALPHA.
1991 Reported by Christian Aichinger <Greek0@gmx.net>.
1993 + * strings.c (map_file): Define POSIX_MADV_SEQUENTIAL to
1994 + MADV_SEQUENTIAL if undefined. Don't call posix_madvise
1995 + if neither is defined.
1997 2006-08-08 Ulrich Drepper <drepper@redhat.com>
1999 * elflint.c (check_dynamic): Don't require DT_HASH for DT_SYMTAB.
2000 @@ -1374,6 +1395,10 @@
2001 * Makefile.am: Add hacks to create dependency files for non-generic
2004 +2006-04-05 Roland McGrath <roland@redhat.com>
2006 + * strings.c (MAP_POPULATE): Define to 0 if undefined.
2008 2006-06-12 Ulrich Drepper <drepper@redhat.com>
2010 * ldgeneric.c (ld_generic_generate_sections): Don't create .interp
2011 @@ -1722,6 +1747,11 @@
2012 * readelf.c (print_debug_loc_section): Fix indentation for larger
2015 +2005-05-31 Roland McGrath <roland@redhat.com>
2017 + * Makefile.am (WEXTRA): New variable, substituted by configure.
2018 + (AM_CFLAGS): Use it in place of -Wextra.
2020 2005-05-30 Roland McGrath <roland@redhat.com>
2022 * readelf.c (print_debug_line_section): Print section offset of each
2023 diff --git a/src/Makefile.am b/src/Makefile.am
2024 --- a/src/Makefile.am
2025 +++ b/src/Makefile.am
2027 # XXX While the file is not finished, don't warn about this
2028 ldgeneric_no_Wunused = yes
2030 +# Buggy old compilers.
2031 +readelf_no_Werror = yes
2033 readelf_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl
2034 nm_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl
2035 size_LDADD = $(libelf) $(libeu) $(libmudflap)
2036 diff --git a/src/Makefile.in b/src/Makefile.in
2037 --- a/src/Makefile.in
2038 +++ b/src/Makefile.in
2040 INSTALL_SCRIPT = @INSTALL_SCRIPT@
2041 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
2043 +LD_AS_NEEDED = @LD_AS_NEEDED@
2046 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
2052 XGETTEXT = @XGETTEXT@
2053 XGETTEXT_015 = @XGETTEXT_015@
2054 XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
2056 -I$(srcdir)/../libdw -I$(srcdir)/../libdwfl \
2057 -I$(srcdir)/../libasm
2058 AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \
2059 - $($(*F)_no_Werror),,-Werror) $(if \
2060 - $($(*F)_no_Wunused),,-Wunused -Wextra) $(if \
2061 + $($(*F)_no_Werror),,) $(if \
2062 + $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \
2063 $($(*F)_no_Wformat),-Wno-format,-Wformat=2) $($(*F)_CFLAGS) \
2065 @MUDFLAP_FALSE@libmudflap =
2067 addr2line_no_Wformat = yes
2068 # XXX While the file is not finished, don't warn about this
2069 ldgeneric_no_Wunused = yes
2071 +# Buggy old compilers.
2072 +readelf_no_Werror = yes
2073 readelf_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl
2074 nm_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl
2075 size_LDADD = $(libelf) $(libeu) $(libmudflap)
2076 diff --git a/src/addr2line.c b/src/addr2line.c
2077 --- a/src/addr2line.c
2078 +++ b/src/addr2line.c
2079 @@ -455,10 +455,10 @@
2080 bool parsed = false;
2083 - if (sscanf (string, "(%m[^)])%" PRIiMAX "%n", &name, &addr, &i) == 2
2084 + if (sscanf (string, "(%a[^)])%" PRIiMAX "%n", &name, &addr, &i) == 2
2085 && string[i] == '\0')
2086 parsed = adjust_to_section (name, &addr, dwfl);
2087 - switch (sscanf (string, "%m[^-+]%n%" PRIiMAX "%n", &name, &i, &addr, &j))
2088 + switch (sscanf (string, "%a[^-+]%n%" PRIiMAX "%n", &name, &i, &addr, &j))
2092 diff --git a/src/findtextrel.c b/src/findtextrel.c
2093 --- a/src/findtextrel.c
2094 +++ b/src/findtextrel.c
2104 @@ -226,14 +226,14 @@
2105 int fd = open64 (real_fname, O_RDONLY);
2108 - error (0, errno, gettext ("cannot open '%s'"), fname);
2109 + err (0, gettext ("cannot open '%s'"), fname);
2113 Elf *elf = elf_begin (fd, ELF_C_READ_MMAP, NULL);
2116 - error (0, 0, gettext ("cannot create ELF descriptor for '%s': %s"),
2117 + err (0, gettext ("cannot create ELF descriptor for '%s': %s"),
2118 fname, elf_errmsg (-1));
2122 GElf_Ehdr *ehdr = gelf_getehdr (elf, &ehdr_mem);
2125 - error (0, 0, gettext ("cannot get ELF header '%s': %s"),
2126 + err (0, gettext ("cannot get ELF header '%s': %s"),
2127 fname, elf_errmsg (-1));
2132 if (ehdr->e_type != ET_DYN)
2134 - error (0, 0, gettext ("'%s' is not a DSO or PIE"), fname);
2135 + err (0, gettext ("'%s' is not a DSO or PIE"), fname);
2145 gettext ("getting get section header of section %zu: %s"),
2146 elf_ndxscn (scn), elf_errmsg (-1));
2149 dyn = gelf_getdyn (data, cnt, &dynmem);
2152 - error (0, 0, gettext ("cannot read dynamic section: %s"),
2153 + err (0, gettext ("cannot read dynamic section: %s"),
2161 - error (0, 0, gettext ("no text relocations reported in '%s'"), fname);
2162 + err (0, gettext ("no text relocations reported in '%s'"), fname);
2167 struct segments *segments
2168 = (struct segments *) malloc (nsegments_max * sizeof (segments[0]));
2169 if (segments == NULL)
2170 - error (1, errno, gettext ("while reading ELF file"));
2171 + err (1, gettext ("while reading ELF file"));
2173 for (int i = 0; i < ehdr->e_phnum; ++i)
2176 GElf_Phdr *phdr = gelf_getphdr (elf, i, &phdr_mem);
2181 gettext ("cannot get program header index at offset %d: %s"),
2182 i, elf_errmsg (-1));
2185 * sizeof (segments[0]));
2186 if (segments == NULL)
2188 - error (0, 0, gettext ("\
2189 + err (0, gettext ("\
2190 cannot get program header index at offset %d: %s"),
2191 i, elf_errmsg (-1));
2199 gettext ("cannot get section header of section %Zu: %s"),
2200 elf_ndxscn (scn), elf_errmsg (-1));
2203 symscn = elf_getscn (elf, shdr->sh_link);
2206 - error (0, 0, gettext ("\
2207 + err (0, gettext ("\
2208 cannot get symbol table section %zu in '%s': %s"),
2209 (size_t) shdr->sh_link, fname, elf_errmsg (-1));
2212 GElf_Rel *rel = gelf_getrel (data, cnt, &rel_mem);
2215 - error (0, 0, gettext ("\
2216 + err (0, gettext ("\
2217 cannot get relocation at index %d in section %zu in '%s': %s"),
2218 cnt, elf_ndxscn (scn), fname, elf_errmsg (-1));
2221 GElf_Rela *rela = gelf_getrela (data, cnt, &rela_mem);
2224 - error (0, 0, gettext ("\
2225 + err (0, gettext ("\
2226 cannot get relocation at index %d in section %zu in '%s': %s"),
2227 cnt, elf_ndxscn (scn), fname, elf_errmsg (-1));
2229 @@ -504,7 +504,11 @@
2233 -check_rel (size_t nsegments, struct segments segments[nsegments],
2234 +check_rel (size_t nsegments, struct segments segments[
2239 GElf_Addr addr, Elf *elf, Elf_Scn *symscn, Dwarf *dw,
2240 const char *fname, bool more_than_one, void **knownsrcs)
2242 diff --git a/src/ld.h b/src/ld.h
2245 @@ -1122,6 +1122,7 @@
2247 /* Checked whether the symbol is undefined and referenced from a DSO. */
2248 extern bool linked_from_dso_p (struct scninfo *scninfo, size_t symidx);
2249 +#if defined __OPTIMIZE__ && !(__GNUC__ == 4 && __GNUC_MINOR__ == 2)
2250 #ifdef __GNUC_STDC_INLINE__
2251 __attribute__ ((__gnu_inline__))
2253 @@ -1139,5 +1140,6 @@
2255 return sym->defined && sym->in_dso;
2257 +#endif /* Optimizing and not GCC 4.2. */
2260 diff --git a/src/readelf.c b/src/readelf.c
2263 @@ -4274,10 +4274,11 @@
2264 #define listptr_offset_size(p) ((p)->dwarf64 ? 8 : 4)
2265 #define listptr_address_size(p) ((p)->addr64 ? 8 : 4)
2267 +static const char *listptr_name;
2269 -compare_listptr (const void *a, const void *b, void *arg)
2270 +compare_listptr (const void *a, const void *b)
2272 - const char *name = arg;
2273 + const char *const name = listptr_name;
2274 struct listptr *p1 = (void *) a;
2275 struct listptr *p2 = (void *) b;
2277 @@ -4357,8 +4358,11 @@
2278 sort_listptr (struct listptr_table *table, const char *name)
2281 - qsort_r (table->table, table->n, sizeof table->table[0],
2282 - &compare_listptr, (void *) name);
2284 + listptr_name = name;
2285 + qsort (table->table, table->n, sizeof table->table[0],
2286 + &compare_listptr);
2291 @@ -8098,7 +8102,7 @@
2292 if (unlikely (elf_rand (elf, as_off) == 0)
2293 || unlikely ((subelf = elf_begin (-1, ELF_C_READ_MMAP, elf))
2295 -#if __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 7)
2296 +#if __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 7) || __GNUC__ < 4
2299 error (EXIT_FAILURE, 0,
2300 diff --git a/src/strings.c b/src/strings.c
2307 +#ifndef MAP_POPULATE
2308 +# define MAP_POPULATE 0
2312 /* Prototypes of local functions. */
2313 static int read_fd (int fd, const char *fname, off64_t fdlen);
2314 @@ -491,8 +495,13 @@
2316 if (mem != MAP_FAILED)
2318 +#if !defined POSIX_MADV_SEQUENTIAL && defined MADV_SEQUENTIAL
2319 +# define POSIX_MADV_SEQUENTIAL MADV_SEQUENTIAL
2321 +#ifdef POSIX_MADV_SEQUENTIAL
2322 /* We will go through the mapping sequentially. */
2323 (void) posix_madvise (mem, map_size, POSIX_MADV_SEQUENTIAL);
2327 if (errno != EINVAL && errno != ENOMEM)
2328 @@ -584,9 +593,11 @@
2329 elfmap_off = from & ~(ps - 1);
2330 elfmap_base = elfmap = map_file (fd, elfmap_off, fdlen, &elfmap_size);
2332 +#ifdef POSIX_FADV_SEQUENTIAL
2333 if (unlikely (elfmap == MAP_FAILED))
2334 /* Let the kernel know we are going to read everything in sequence. */
2335 (void) posix_fadvise (fd, 0, 0, POSIX_FADV_SEQUENTIAL);
2339 if (unlikely (elfmap == MAP_FAILED))
2340 diff --git a/src/strip.c b/src/strip.c
2347 +#ifdef HAVE_FUTIMES
2348 +# define FUTIMES(fd, fname, tvp) futimes (fd, tvp)
2350 +# define FUTIMES(fd, fname, tvp) utimes (fname, tvp)
2354 /* Name and version of program. */
2355 static void print_version (FILE *stream, struct argp_state *state);
2356 @@ -311,8 +317,18 @@
2358 /* If we have to preserve the timestamp, we need it in the
2359 format utimes() understands. */
2360 +#ifdef HAVE_STRUCT_STAT_ST_ATIM
2361 TIMESPEC_TO_TIMEVAL (&tv[0], &pre_st.st_atim);
2363 + tv[0].tv_sec = pre_st.st_atime;
2364 + tv[0].tv_usec = 0;
2366 +#ifdef HAVE_STRUCT_STAT_ST_MTIM
2367 TIMESPEC_TO_TIMEVAL (&tv[1], &pre_st.st_mtim);
2369 + tv[1].tv_sec = pre_st.st_atime;
2370 + tv[1].tv_usec = 0;
2374 /* Open the file. */
2375 @@ -1809,7 +1825,7 @@
2376 /* If requested, preserve the timestamp. */
2379 - if (futimes (fd, tvp) != 0)
2380 + if (FUTIMES (fd, output_fname, tvp) != 0)
2382 error (0, errno, gettext ("\
2383 cannot set access and modification date of '%s'"),
2384 @@ -1866,7 +1882,7 @@
2388 - if (unlikely (futimes (fd, tvp) != 0))
2389 + if (unlikely (FUTIMES (fd, fname, tvp) != 0))
2391 error (0, errno, gettext ("\
2392 cannot set access and modification date of '%s'"), fname);
2393 diff --git a/tests/ChangeLog b/tests/ChangeLog
2394 --- a/tests/ChangeLog
2395 +++ b/tests/ChangeLog
2398 2008-01-21 Roland McGrath <roland@redhat.com>
2400 + * line2addr.c (main): Revert last change.
2402 * testfile45.S.bz2: Add tests for cltq, cqto.
2403 * testfile45.expect.bz2: Adjust.
2405 @@ -913,6 +915,11 @@
2406 * Makefile.am (TESTS): Add run-elflint-test.sh.
2407 (EXTRA_DIST): Add run-elflint-test.sh and testfile18.bz2.
2409 +2005-05-31 Roland McGrath <roland@redhat.com>
2411 + * Makefile.am (WEXTRA): New variable, substituted by configure.
2412 + (AM_CFLAGS): Use it in place of -Wextra.
2414 2005-05-24 Ulrich Drepper <drepper@redhat.com>
2416 * get-files.c (main): Use correct format specifier.
2417 diff --git a/tests/Makefile.in b/tests/Makefile.in
2418 --- a/tests/Makefile.in
2419 +++ b/tests/Makefile.in
2421 INSTALL_SCRIPT = @INSTALL_SCRIPT@
2422 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
2424 +LD_AS_NEEDED = @LD_AS_NEEDED@
2427 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
2433 XGETTEXT = @XGETTEXT@
2434 XGETTEXT_015 = @XGETTEXT_015@
2435 XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
2437 zip_LIBS = @zip_LIBS@
2438 INCLUDES = -I. -I$(srcdir) -I$(top_srcdir)/lib -I.. $(am__append_2)
2439 AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \
2440 - $($(*F)_no_Werror),,-Werror) $(if \
2441 - $($(*F)_no_Wunused),,-Wunused -Wextra) $(if \
2442 + $($(*F)_no_Werror),,) $(if \
2443 + $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \
2444 $($(*F)_no_Wformat),-Wno-format,-Wformat=2) $($(*F)_CFLAGS) \
2446 @MUDFLAP_FALSE@libmudflap =
2447 diff --git a/tests/line2addr.c b/tests/line2addr.c
2448 --- a/tests/line2addr.c
2449 +++ b/tests/line2addr.c
2452 struct args a = { .arg = argv[cnt] };
2454 - switch (sscanf (a.arg, "%m[^:]:%d", &a.file, &a.line))
2455 + switch (sscanf (a.arg, "%a[^:]:%d", &a.file, &a.line))