summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/elfutils/elfutils/redhat-portability.diff
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/elfutils/elfutils/redhat-portability.diff')
-rw-r--r--meta/recipes-devtools/elfutils/elfutils/redhat-portability.diff756
1 files changed, 756 insertions, 0 deletions
diff --git a/meta/recipes-devtools/elfutils/elfutils/redhat-portability.diff b/meta/recipes-devtools/elfutils/elfutils/redhat-portability.diff
new file mode 100644
index 0000000000..b8a912c412
--- /dev/null
+++ b/meta/recipes-devtools/elfutils/elfutils/redhat-portability.diff
@@ -0,0 +1,756 @@
1Upstream-Status: Backport
2
3Index: elfutils-0.148/backends/ChangeLog
4===================================================================
5--- elfutils-0.148.orig/backends/ChangeLog 2010-04-13 20:08:02.000000000 +0000
6+++ elfutils-0.148/backends/ChangeLog 2010-07-03 13:04:07.000000000 +0000
7@@ -106,6 +106,10 @@
8 * ppc_attrs.c (ppc_check_object_attribute): Handle tag
9 GNU_Power_ABI_Struct_Return.
10
11+2009-01-23 Roland McGrath <roland@redhat.com>
12+
13+ * Makefile.am (libebl_%.so): Use $(LD_AS_NEEDED).
14+
15 2008-10-04 Ulrich Drepper <drepper@redhat.com>
16
17 * i386_reloc.def: Fix entries for TLS_GOTDESC, TLS_DESC_CALL, and
18@@ -433,6 +437,11 @@
19 * sparc_init.c: Likewise.
20 * x86_64_init.c: Likewise.
21
22+2005-11-22 Roland McGrath <roland@redhat.com>
23+
24+ * Makefile.am (LD_AS_NEEDED): New variable, substituted by configure.
25+ (libebl_%.so rule): Use it in place of -Wl,--as-needed.
26+
27 2005-11-19 Roland McGrath <roland@redhat.com>
28
29 * ppc64_reloc.def: REL30 -> ADDR30.
30@@ -455,6 +464,9 @@
31 * Makefile.am (uninstall): Don't try to remove $(pkgincludedir).
32 (CLEANFILES): Add libebl_$(m).so.
33
34+ * Makefile.am (WEXTRA): New variable, substituted by configure.
35+ (AM_CFLAGS): Use it in place of -Wextra.
36+
37 * ppc_reloc.def: Update bits per Alan Modra <amodra@bigpond.net.au>.
38 * ppc64_reloc.def: Likewise.
39
40Index: elfutils-0.148/backends/Makefile.am
41===================================================================
42--- elfutils-0.148.orig/backends/Makefile.am 2010-04-13 20:08:02.000000000 +0000
43+++ elfutils-0.148/backends/Makefile.am 2010-07-03 13:04:07.000000000 +0000
44@@ -103,7 +103,7 @@
45 $(LINK) -shared -o $(@:.map=.so) \
46 -Wl,--whole-archive $< $(cpu_$*) -Wl,--no-whole-archive \
47 -Wl,--version-script,$(@:.so=.map) \
48- -Wl,-z,defs -Wl,--as-needed $(libelf) $(libdw) $(libmudflap)
49+ -Wl,-z,defs $(LD_AS_NEEDED) $(libelf) $(libdw) $(libmudflap)
50 $(textrel_check)
51
52 libebl_i386.so: $(cpu_i386)
53Index: elfutils-0.148/ChangeLog
54===================================================================
55--- elfutils-0.148.orig/ChangeLog 2010-04-21 14:26:40.000000000 +0000
56+++ elfutils-0.148/ChangeLog 2010-07-03 13:04:07.000000000 +0000
57@@ -2,6 +2,10 @@
58
59 * configure.ac (LOCALEDIR, DATADIRNAME): Removed.
60
61+2009-11-22 Roland McGrath <roland@redhat.com>
62+
63+ * configure.ac: Use sed and expr instead of modern bash extensions.
64+
65 2009-09-21 Ulrich Drepper <drepper@redhat.com>
66
67 * configure.ac: Update for more modern autoconf.
68@@ -10,6 +14,10 @@
69
70 * configure.ac (zip_LIBS): Check for liblzma too.
71
72+2009-08-17 Roland McGrath <roland@redhat.com>
73+
74+ * configure.ac: Check for -fgnu89-inline; add it to WEXTRA if it works.
75+
76 2009-04-19 Roland McGrath <roland@redhat.com>
77
78 * configure.ac (eu_version): Round down here, not in version.h macros.
79@@ -21,6 +29,8 @@
80
81 2009-01-23 Roland McGrath <roland@redhat.com>
82
83+ * configure.ac: Check for __builtin_popcount.
84+
85 * configure.ac (zlib check): Check for gzdirect, need zlib >= 1.2.2.3.
86
87 * configure.ac (__thread check): Use AC_LINK_IFELSE, in case of
88@@ -101,6 +111,10 @@
89 * configure.ac: Add dummy automake conditional to get dependencies
90 for non-generic linker right. See src/Makefile.am.
91
92+2005-11-22 Roland McGrath <roland@redhat.com>
93+
94+ * configure.ac: Check for --as-needed linker option.
95+
96 2005-11-18 Roland McGrath <roland@redhat.com>
97
98 * Makefile.am (DISTCHECK_CONFIGURE_FLAGS): New variable.
99@@ -148,6 +162,17 @@
100 * Makefile.am (all_SUBDIRS): Add libdwfl.
101 * configure.ac: Write libdwfl/Makefile.
102
103+2005-05-31 Roland McGrath <roland@redhat.com>
104+
105+ * configure.ac (WEXTRA): Check for -Wextra and set this substitution.
106+
107+ * configure.ac: Check for struct stat st_?tim members.
108+ * src/strip.c (process_file): Use st_?time if st_?tim are not there.
109+
110+ * configure.ac: Check for futimes function.
111+ * src/strip.c (handle_elf) [! HAVE_FUTIMES]: Use utimes instead.
112+ (handle_ar) [! HAVE_FUTIMES]: Likewise.
113+
114 2005-05-19 Roland McGrath <roland@redhat.com>
115
116 * configure.ac [AH_BOTTOM] (INTDECL, _INTDECL): New macros.
117Index: elfutils-0.148/config/eu.am
118===================================================================
119--- elfutils-0.148.orig/config/eu.am 2010-04-21 14:26:40.000000000 +0000
120+++ elfutils-0.148/config/eu.am 2010-07-03 13:04:07.000000000 +0000
121@@ -25,11 +25,14 @@
122 ## <http://www.openinventionnetwork.com>.
123 ##
124
125+WEXTRA = @WEXTRA@
126+LD_AS_NEEDED = @LD_AS_NEEDED@
127+
128 DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H -DLOCALEDIR='"${localedir}"'
129 INCLUDES = -I. -I$(srcdir) -I$(top_srcdir)/lib -I..
130 AM_CFLAGS = -std=gnu99 -Wall -Wshadow \
131 $(if $($(*F)_no_Werror),,-Werror) \
132- $(if $($(*F)_no_Wunused),,-Wunused -Wextra) \
133+ $(if $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) \
134 $(if $($(*F)_no_Wformat),-Wno-format,-Wformat=2) \
135 $($(*F)_CFLAGS)
136
137Index: elfutils-0.148/config.h.in
138===================================================================
139--- elfutils-0.148.orig/config.h.in 2010-06-28 19:07:37.000000000 +0000
140+++ elfutils-0.148/config.h.in 2010-07-03 13:04:07.000000000 +0000
141@@ -1,5 +1,8 @@
142 /* config.h.in. Generated from configure.ac by autoheader. */
143
144+/* Have __builtin_popcount. */
145+#undef HAVE_BUILTIN_POPCOUNT
146+
147 /* $libdir subdirectory containing libebl modules. */
148 #undef LIBEBL_SUBDIR
149
150@@ -55,4 +58,7 @@
151 /* Define for large files, on AIX-style hosts. */
152 #undef _LARGE_FILES
153
154+/* Stubbed out if missing compiler support. */
155+#undef __thread
156+
157 #include <eu-config.h>
158Index: elfutils-0.148/configure.ac
159===================================================================
160--- elfutils-0.148.orig/configure.ac 2010-06-28 19:07:26.000000000 +0000
161+++ elfutils-0.148/configure.ac 2010-07-03 13:04:07.000000000 +0000
162@@ -73,6 +73,54 @@
163 AS_IF([test "x$ac_cv_c99" != xyes],
164 AC_MSG_ERROR([gcc with C99 support required]))
165
166+AC_CACHE_CHECK([for -Wextra option to $CC], ac_cv_cc_wextra, [dnl
167+old_CFLAGS="$CFLAGS"
168+CFLAGS="$CFLAGS -Wextra"
169+AC_COMPILE_IFELSE([void foo (void) { }],
170+ ac_cv_cc_wextra=yes, ac_cv_cc_wextra=no)
171+CFLAGS="$old_CFLAGS"])
172+AC_SUBST(WEXTRA)
173+AS_IF([test "x$ac_cv_cc_wextra" = xyes], [WEXTRA=-Wextra], [WEXTRA=-W])
174+
175+AC_CACHE_CHECK([for -fgnu89-inline option to $CC], ac_cv_cc_gnu89_inline, [dnl
176+old_CFLAGS="$CFLAGS"
177+CFLAGS="$CFLAGS -fgnu89-inline -Werror"
178+AC_COMPILE_IFELSE([
179+void foo (void)
180+{
181+ inline void bar (void) {}
182+ bar ();
183+}
184+extern inline void baz (void) {}
185+], ac_cv_cc_gnu89_inline=yes, ac_cv_cc_gnu89_inline=no)
186+CFLAGS="$old_CFLAGS"])
187+AS_IF([test "x$ac_cv_cc_gnu89_inline" = xyes],
188+ [WEXTRA="${WEXTRA:+$WEXTRA }-fgnu89-inline"])
189+
190+AC_CACHE_CHECK([for --as-needed linker option],
191+ ac_cv_as_needed, [dnl
192+cat > conftest.c <<EOF
193+int main (void) { return 0; }
194+EOF
195+if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
196+ -fPIC -shared -o conftest.so conftest.c
197+ -Wl,--as-needed 1>&AS_MESSAGE_LOG_FD])
198+then
199+ ac_cv_as_needed=yes
200+else
201+ ac_cv_as_needed=no
202+fi
203+rm -f conftest*])
204+AS_IF([test "x$ac_cv_as_needed" = xyes],
205+ [LD_AS_NEEDED=-Wl,--as-needed], [LD_AS_NEEDED=])
206+AC_SUBST(LD_AS_NEEDED)
207+
208+AC_CACHE_CHECK([for __builtin_popcount], ac_cv_popcount, [dnl
209+AC_LINK_IFELSE([AC_LANG_PROGRAM([], [[exit (__builtin_popcount (127));]])],
210+ ac_cv_popcount=yes, ac_cv_popcount=no)])
211+AS_IF([test "x$ac_cv_popcount" = xyes],
212+ [AC_DEFINE([HAVE_BUILTIN_POPCOUNT], [1], [Have __builtin_popcount.])])
213+
214 AC_CACHE_CHECK([for __thread support], ac_cv_tls, [dnl
215 # Use the same flags that we use for our DSOs, so the test is representative.
216 # Some old compiler/linker/libc combinations fail some ways and not others.
217@@ -88,7 +136,10 @@
218 CFLAGS="$save_CFLAGS"
219 LDFLAGS="$save_LDFLAGS"])
220 AS_IF([test "x$ac_cv_tls" != xyes],
221- AC_MSG_ERROR([__thread support required]))
222+ [AS_IF([test "$use_locks" = yes],
223+ [AC_MSG_ERROR([--enable-thread-safety requires __thread support])],
224+ [AC_DEFINE([__thread], [/* empty: no multi-thread support */],
225+ [Stubbed out if missing compiler support.])])])
226
227 dnl This test must come as early as possible after the compiler configuration
228 dnl tests, because the choice of the file model can (in principle) affect
229@@ -251,7 +302,7 @@
230
231 # 1.234<whatever> -> 1234<whatever>
232 case "$PACKAGE_VERSION" in
233-[[0-9]].*) eu_version="${PACKAGE_VERSION/./}" ;;
234+[[0-9]].*) eu_version=`echo "$PACKAGE_VERSION" | sed 's@\.@@'` ;;
235 *) AC_MSG_ERROR([confused by version number '$PACKAGE_VERSION']) ;;
236 esac
237 case "$eu_version" in
238@@ -280,6 +331,6 @@
239 esac
240
241 # Round up to the next release API (x.y) version.
242-[eu_version=$[($eu_version + 999) / 1000]]
243+eu_version=`expr \( $eu_version + 999 \) / 1000`
244
245 AC_OUTPUT
246Index: elfutils-0.148/lib/ChangeLog
247===================================================================
248--- elfutils-0.148.orig/lib/ChangeLog 2010-06-28 19:05:56.000000000 +0000
249+++ elfutils-0.148/lib/ChangeLog 2010-07-03 13:04:07.000000000 +0000
250@@ -14,6 +14,9 @@
251
252 2009-01-23 Roland McGrath <roland@redhat.com>
253
254+ * eu-config.h [! HAVE_BUILTIN_POPCOUNT]
255+ (__builtin_popcount): New inline function.
256+
257 * eu-config.h: Add multiple inclusion protection.
258
259 2009-01-17 Ulrich Drepper <drepper@redhat.com>
260@@ -70,6 +73,11 @@
261 * Makefile.am (libeu_a_SOURCES): Add it.
262 * system.h: Declare crc32_file.
263
264+2005-02-07 Roland McGrath <roland@redhat.com>
265+
266+ * Makefile.am (WEXTRA): New variable, substituted by configure.
267+ (AM_CFLAGS): Use it in place of -Wextra.
268+
269 2005-04-30 Ulrich Drepper <drepper@redhat.com>
270
271 * Makefile.am: Use -ffunction-sections for xmalloc.c.
272Index: elfutils-0.148/lib/eu-config.h
273===================================================================
274--- elfutils-0.148.orig/lib/eu-config.h 2009-08-12 14:23:22.000000000 +0000
275+++ elfutils-0.148/lib/eu-config.h 2010-07-03 13:04:07.000000000 +0000
276@@ -182,6 +182,17 @@
277 /* This macro is used by the tests conditionalize for standalone building. */
278 #define ELFUTILS_HEADER(name) <lib##name.h>
279
280+#ifndef HAVE_BUILTIN_POPCOUNT
281+# define __builtin_popcount hakmem_popcount
282+static inline unsigned int __attribute__ ((unused))
283+hakmem_popcount (unsigned int x)
284+{
285+ /* HAKMEM 169 */
286+ unsigned int n = x - ((x >> 1) & 033333333333) - ((x >> 2) & 011111111111);
287+ return ((n + (n >> 3)) & 030707070707) % 63;
288+}
289+#endif /* HAVE_BUILTIN_POPCOUNT */
290+
291
292 #ifdef SHARED
293 # define OLD_VERSION(name, version) \
294Index: elfutils-0.148/libasm/ChangeLog
295===================================================================
296--- elfutils-0.148.orig/libasm/ChangeLog 2010-03-05 05:48:23.000000000 +0000
297+++ elfutils-0.148/libasm/ChangeLog 2010-07-03 13:04:07.000000000 +0000
298@@ -67,6 +67,11 @@
299 * asm_error.c: Add new error ASM_E_IOERROR.
300 * libasmP.h: Add ASM_E_IOERROR definition.
301
302+2005-05-31 Roland McGrath <roland@redhat.com>
303+
304+ * Makefile.am (WEXTRA): New variable, substituted by configure.
305+ (AM_CFLAGS): Use it in place of -Wextra.
306+
307 2005-02-15 Ulrich Drepper <drepper@redhat.com>
308
309 * Makefile.am (AM_CFLAGS): Add -Wunused -Wextra -Wformat=2.
310Index: elfutils-0.148/libcpu/ChangeLog
311===================================================================
312--- elfutils-0.148.orig/libcpu/ChangeLog 2010-03-05 05:48:23.000000000 +0000
313+++ elfutils-0.148/libcpu/ChangeLog 2010-07-03 13:04:07.000000000 +0000
314@@ -9,6 +9,9 @@
315
316 2009-01-23 Roland McGrath <roland@redhat.com>
317
318+ * i386_disasm.c (i386_disasm): Add abort after assert-constant for old
319+ compilers that don't realize it's noreturn.
320+
321 * Makefile.am (i386_parse_CFLAGS): Use quotes around command
322 substitution that can produce leading whitespace.
323
324@@ -338,6 +341,11 @@
325 * defs/i386.doc: New file.
326 * defs/x86_64: New file.
327
328+2005-04-04 Roland McGrath <roland@redhat.com>
329+
330+ * Makefile.am (WEXTRA): New variable, substituted by configure.
331+ (AM_CFLAGS): Use it instead of -Wextra.
332+
333 2005-02-15 Ulrich Drepper <drepper@redhat.com>
334
335 * Makefile (AM_CFLAGS): Add -Wunused -Wextra -Wformat=2.
336Index: elfutils-0.148/libcpu/i386_disasm.c
337===================================================================
338--- elfutils-0.148.orig/libcpu/i386_disasm.c 2009-01-08 20:56:36.000000000 +0000
339+++ elfutils-0.148/libcpu/i386_disasm.c 2010-07-03 13:04:07.000000000 +0000
340@@ -791,6 +791,7 @@
341
342 default:
343 assert (! "INVALID not handled");
344+ abort ();
345 }
346 }
347 else
348Index: elfutils-0.148/libdw/ChangeLog
349===================================================================
350--- elfutils-0.148.orig/libdw/ChangeLog 2010-06-28 19:05:56.000000000 +0000
351+++ elfutils-0.148/libdw/ChangeLog 2010-07-03 13:04:07.000000000 +0000
352@@ -276,6 +276,10 @@
353
354 * dwarf_hasattr_integrate.c: Integrate DW_AT_specification too.
355
356+2009-08-17 Roland McGrath <roland@redhat.com>
357+
358+ * libdw.h: Disable extern inlines for GCC 4.2.
359+
360 2009-08-10 Roland McGrath <roland@redhat.com>
361
362 * dwarf_getscopevar.c: Use dwarf_diename.
363@@ -1044,6 +1048,11 @@
364
365 2005-05-31 Roland McGrath <roland@redhat.com>
366
367+ * Makefile.am (WEXTRA): New variable, substituted by configure.
368+ (AM_CFLAGS): Use it in place of -Wextra.
369+
370+2005-05-31 Roland McGrath <roland@redhat.com>
371+
372 * dwarf_formref_die.c (dwarf_formref_die): Add CU header offset to
373 formref offset.
374
375Index: elfutils-0.148/libdw/libdw.h
376===================================================================
377--- elfutils-0.148.orig/libdw/libdw.h 2010-06-28 19:05:56.000000000 +0000
378+++ elfutils-0.148/libdw/libdw.h 2010-07-03 13:04:07.000000000 +0000
379@@ -842,7 +842,7 @@
380
381
382 /* Inline optimizations. */
383-#ifdef __OPTIMIZE__
384+#if defined __OPTIMIZE__ && !(__GNUC__ == 4 && __GNUC_MINOR__ == 2)
385 /* Return attribute code of given attribute. */
386 __libdw_extern_inline unsigned int
387 dwarf_whatattr (Dwarf_Attribute *attr)
388Index: elfutils-0.148/libdwfl/ChangeLog
389===================================================================
390--- elfutils-0.148.orig/libdwfl/ChangeLog 2010-06-28 19:05:56.000000000 +0000
391+++ elfutils-0.148/libdwfl/ChangeLog 2010-07-03 13:04:07.000000000 +0000
392@@ -1265,6 +1265,11 @@
393
394 2005-07-21 Roland McGrath <roland@redhat.com>
395
396+ * Makefile.am (WEXTRA): New variable, substituted by configure.
397+ (AM_CFLAGS): Use it in place of -Wextra.
398+
399+2005-07-21 Roland McGrath <roland@redhat.com>
400+
401 * Makefile.am (noinst_HEADERS): Add loc2c.c.
402
403 * test2.c (main): Check sscanf result to quiet warning.
404Index: elfutils-0.148/libebl/ChangeLog
405===================================================================
406--- elfutils-0.148.orig/libebl/ChangeLog 2010-03-05 05:48:23.000000000 +0000
407+++ elfutils-0.148/libebl/ChangeLog 2010-07-03 13:04:07.000000000 +0000
408@@ -624,6 +624,11 @@
409 * Makefile.am (libebl_*_so_SOURCES): Set to $(*_SRCS) so dependency
410 tracking works right.
411
412+2005-05-31 Roland McGrath <roland@redhat.com>
413+
414+ * Makefile.am (WEXTRA): New variable, substituted by configure.
415+ (AM_CFLAGS): Use it in place of -Wextra.
416+
417 2005-05-21 Ulrich Drepper <drepper@redhat.com>
418
419 * libebl_x86_64.map: Add x86_64_core_note.
420Index: elfutils-0.148/libelf/ChangeLog
421===================================================================
422--- elfutils-0.148.orig/libelf/ChangeLog 2010-06-14 21:17:20.000000000 +0000
423+++ elfutils-0.148/libelf/ChangeLog 2010-07-03 13:04:07.000000000 +0000
424@@ -657,6 +657,11 @@
425
426 * elf.h: Update from glibc.
427
428+2005-05-31 Roland McGrath <roland@redhat.com>
429+
430+ * Makefile.am (WEXTRA): New variable, substituted by configure.
431+ (AM_CFLAGS): Use it in place of -Wextra.
432+
433 2005-05-08 Roland McGrath <roland@redhat.com>
434
435 * elf_begin.c (read_file) [_MUDFLAP]: Don't use mmap for now.
436Index: elfutils-0.148/libelf/common.h
437===================================================================
438--- elfutils-0.148.orig/libelf/common.h 2009-01-08 20:56:36.000000000 +0000
439+++ elfutils-0.148/libelf/common.h 2010-07-03 13:04:07.000000000 +0000
440@@ -160,7 +160,7 @@
441 (Var) = (sizeof (Var) == 1 \
442 ? (unsigned char) (Var) \
443 : (sizeof (Var) == 2 \
444- ? bswap_16 (Var) \
445+ ? (unsigned short int) bswap_16 (Var) \
446 : (sizeof (Var) == 4 \
447 ? bswap_32 (Var) \
448 : bswap_64 (Var))))
449@@ -169,7 +169,7 @@
450 (Dst) = (sizeof (Var) == 1 \
451 ? (unsigned char) (Var) \
452 : (sizeof (Var) == 2 \
453- ? bswap_16 (Var) \
454+ ? (unsigned short int) bswap_16 (Var) \
455 : (sizeof (Var) == 4 \
456 ? bswap_32 (Var) \
457 : bswap_64 (Var))))
458Index: elfutils-0.148/src/addr2line.c
459===================================================================
460--- elfutils-0.148.orig/src/addr2line.c 2010-05-28 14:38:30.000000000 +0000
461+++ elfutils-0.148/src/addr2line.c 2010-07-03 13:05:40.000000000 +0000
462@@ -447,10 +447,10 @@
463 bool parsed = false;
464 int i, j;
465 char *name = NULL;
466- if (sscanf (string, "(%m[^)])%" PRIiMAX "%n", &name, &addr, &i) == 2
467+ if (sscanf (string, "(%a[^)])%" PRIiMAX "%n", &name, &addr, &i) == 2
468 && string[i] == '\0')
469 parsed = adjust_to_section (name, &addr, dwfl);
470- switch (sscanf (string, "%m[^-+]%n%" PRIiMAX "%n", &name, &i, &addr, &j))
471+ switch (sscanf (string, "%a[^-+]%n%" PRIiMAX "%n", &name, &i, &addr, &j))
472 {
473 default:
474 break;
475Index: elfutils-0.148/src/ChangeLog
476===================================================================
477--- elfutils-0.148.orig/src/ChangeLog 2010-06-28 19:05:56.000000000 +0000
478+++ elfutils-0.148/src/ChangeLog 2010-07-03 13:04:08.000000000 +0000
479@@ -165,8 +165,16 @@
480 * readelf.c (attr_callback): Use print_block only when we don't use
481 print_ops.
482
483+2009-08-17 Roland McGrath <roland@redhat.com>
484+
485+ * ld.h: Disable extern inlines for GCC 4.2.
486+
487 2009-08-14 Roland McGrath <roland@redhat.com>
488
489+ * strings.c (read_block): Conditionalize posix_fadvise use
490+ on [POSIX_FADV_SEQUENTIAL].
491+ From Petr Salinger <Petr.Salinger@seznam.cz>.
492+
493 * ar.c (do_oper_extract): Use pathconf instead of statfs.
494
495 2009-08-01 Ulrich Drepper <drepper@redhat.com>
496@@ -330,6 +338,8 @@
497 * readelf.c (print_debug_frame_section): Use t instead of j formats
498 for ptrdiff_t OFFSET.
499
500+ * addr2line.c (handle_address): Use %a instead of %m for compatibility.
501+
502 2009-01-21 Ulrich Drepper <drepper@redhat.com>
503
504 * elflint.c (check_program_header): Fix typo in .eh_frame_hdr section
505@@ -513,6 +523,11 @@
506 that matches its PT_LOAD's p_flags &~ PF_W. On sparc, PF_X really
507 is valid in RELRO.
508
509+2008-03-01 Roland McGrath <roland@redhat.com>
510+
511+ * readelf.c (dump_archive_index): Tweak portability hack
512+ to match [__GNUC__ < 4] too.
513+
514 2008-02-29 Roland McGrath <roland@redhat.com>
515
516 * readelf.c (print_attributes): Add a cast.
517@@ -764,6 +779,8 @@
518
519 * readelf.c (hex_dump): Fix rounding error in whitespace calculation.
520
521+ * Makefile.am (readelf_no_Werror): New variable.
522+
523 2007-10-15 Roland McGrath <roland@redhat.com>
524
525 * make-debug-archive.in: New file.
526@@ -1203,6 +1220,10 @@
527 * elflint.c (valid_e_machine): Add EM_ALPHA.
528 Reported by Christian Aichinger <Greek0@gmx.net>.
529
530+ * strings.c (map_file): Define POSIX_MADV_SEQUENTIAL to
531+ MADV_SEQUENTIAL if undefined. Don't call posix_madvise
532+ if neither is defined.
533+
534 2006-08-08 Ulrich Drepper <drepper@redhat.com>
535
536 * elflint.c (check_dynamic): Don't require DT_HASH for DT_SYMTAB.
537@@ -1279,6 +1300,10 @@
538 * Makefile.am: Add hacks to create dependency files for non-generic
539 linker.
540
541+2006-04-05 Roland McGrath <roland@redhat.com>
542+
543+ * strings.c (MAP_POPULATE): Define to 0 if undefined.
544+
545 2006-06-12 Ulrich Drepper <drepper@redhat.com>
546
547 * ldgeneric.c (ld_generic_generate_sections): Don't create .interp
548@@ -1627,6 +1652,11 @@
549 * readelf.c (print_debug_loc_section): Fix indentation for larger
550 address size.
551
552+2005-05-31 Roland McGrath <roland@redhat.com>
553+
554+ * Makefile.am (WEXTRA): New variable, substituted by configure.
555+ (AM_CFLAGS): Use it in place of -Wextra.
556+
557 2005-05-30 Roland McGrath <roland@redhat.com>
558
559 * readelf.c (print_debug_line_section): Print section offset of each
560Index: elfutils-0.148/src/findtextrel.c
561===================================================================
562--- elfutils-0.148.orig/src/findtextrel.c 2009-02-11 01:12:59.000000000 +0000
563+++ elfutils-0.148/src/findtextrel.c 2010-07-03 13:04:08.000000000 +0000
564@@ -490,7 +490,11 @@
565
566
567 static void
568-check_rel (size_t nsegments, struct segments segments[nsegments],
569+check_rel (size_t nsegments, struct segments segments[
570+#if __GNUC__ >= 4
571+ nsegments
572+#endif
573+ ],
574 GElf_Addr addr, Elf *elf, Elf_Scn *symscn, Dwarf *dw,
575 const char *fname, bool more_than_one, void **knownsrcs)
576 {
577Index: elfutils-0.148/src/ld.h
578===================================================================
579--- elfutils-0.148.orig/src/ld.h 2009-06-13 22:39:51.000000000 +0000
580+++ elfutils-0.148/src/ld.h 2010-07-03 13:04:08.000000000 +0000
581@@ -1122,6 +1122,7 @@
582
583 /* Checked whether the symbol is undefined and referenced from a DSO. */
584 extern bool linked_from_dso_p (struct scninfo *scninfo, size_t symidx);
585+#if defined __OPTIMIZE__ && !(__GNUC__ == 4 && __GNUC_MINOR__ == 2)
586 #ifdef __GNUC_STDC_INLINE__
587 __attribute__ ((__gnu_inline__))
588 #endif
589@@ -1139,5 +1140,6 @@
590
591 return sym->defined && sym->in_dso;
592 }
593+#endif /* Optimizing and not GCC 4.2. */
594
595 #endif /* ld.h */
596Index: elfutils-0.148/src/Makefile.am
597===================================================================
598--- elfutils-0.148.orig/src/Makefile.am 2010-03-05 05:48:23.000000000 +0000
599+++ elfutils-0.148/src/Makefile.am 2010-07-03 13:04:08.000000000 +0000
600@@ -99,6 +99,9 @@
601 # XXX While the file is not finished, don't warn about this
602 ldgeneric_no_Wunused = yes
603
604+# Buggy old compilers.
605+readelf_no_Werror = yes
606+
607 readelf_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl
608 nm_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl
609 size_LDADD = $(libelf) $(libeu) $(libmudflap)
610
611Index: elfutils-0.148/src/readelf.c
612===================================================================
613--- elfutils-0.148.orig/src/readelf.c 2010-06-28 19:05:56.000000000 +0000
614+++ elfutils-0.148/src/readelf.c 2010-07-03 13:04:08.000000000 +0000
615@@ -7845,7 +7845,7 @@
616 if (unlikely (elf_rand (elf, as_off) == 0)
617 || unlikely ((subelf = elf_begin (-1, ELF_C_READ_MMAP, elf))
618 == NULL))
619-#if __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 7)
620+#if __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 7) || __GNUC__ < 4
621 while (1)
622 #endif
623 error (EXIT_FAILURE, 0,
624Index: elfutils-0.148/src/strings.c
625===================================================================
626--- elfutils-0.148.orig/src/strings.c 2009-02-11 01:12:59.000000000 +0000
627+++ elfutils-0.148/src/strings.c 2010-07-03 13:04:08.000000000 +0000
628@@ -51,6 +51,10 @@
629
630 #include <system.h>
631
632+#ifndef MAP_POPULATE
633+# define MAP_POPULATE 0
634+#endif
635+
636
637 /* Prototypes of local functions. */
638 static int read_fd (int fd, const char *fname, off64_t fdlen);
639@@ -491,8 +495,13 @@
640 fd, start_off);
641 if (mem != MAP_FAILED)
642 {
643+#if !defined POSIX_MADV_SEQUENTIAL && defined MADV_SEQUENTIAL
644+# define POSIX_MADV_SEQUENTIAL MADV_SEQUENTIAL
645+#endif
646+#ifdef POSIX_MADV_SEQUENTIAL
647 /* We will go through the mapping sequentially. */
648 (void) posix_madvise (mem, map_size, POSIX_MADV_SEQUENTIAL);
649+#endif
650 break;
651 }
652 if (errno != EINVAL && errno != ENOMEM)
653@@ -586,9 +595,11 @@
654 elfmap_off = from & ~(ps - 1);
655 elfmap_base = elfmap = map_file (fd, elfmap_off, fdlen, &elfmap_size);
656
657+#ifdef POSIX_FADV_SEQUENTIAL
658 if (unlikely (elfmap == MAP_FAILED))
659 /* Let the kernel know we are going to read everything in sequence. */
660 (void) posix_fadvise (fd, 0, 0, POSIX_FADV_SEQUENTIAL);
661+#endif
662 }
663
664 if (unlikely (elfmap == MAP_FAILED))
665Index: elfutils-0.148/src/strip.c
666===================================================================
667--- elfutils-0.148.orig/src/strip.c 2010-01-15 09:05:55.000000000 +0000
668+++ elfutils-0.148/src/strip.c 2010-07-03 13:04:08.000000000 +0000
669@@ -53,6 +53,12 @@
670 #include <libebl.h>
671 #include <system.h>
672
673+#ifdef HAVE_FUTIMES
674+# define FUTIMES(fd, fname, tvp) futimes (fd, tvp)
675+#else
676+# define FUTIMES(fd, fname, tvp) utimes (fname, tvp)
677+#endif
678+
679
680 /* Name and version of program. */
681 static void print_version (FILE *stream, struct argp_state *state);
682@@ -301,8 +307,18 @@
683
684 /* If we have to preserve the timestamp, we need it in the
685 format utimes() understands. */
686+#ifdef HAVE_STRUCT_STAT_ST_ATIM
687 TIMESPEC_TO_TIMEVAL (&tv[0], &pre_st.st_atim);
688+#else
689+ tv[0].tv_sec = pre_st.st_atime;
690+ tv[0].tv_usec = 0;
691+#endif
692+#ifdef HAVE_STRUCT_STAT_ST_MTIM
693 TIMESPEC_TO_TIMEVAL (&tv[1], &pre_st.st_mtim);
694+#else
695+ tv[1].tv_sec = pre_st.st_atime;
696+ tv[1].tv_usec = 0;
697+#endif
698 }
699
700 /* Open the file. */
701@@ -1747,7 +1763,7 @@
702 /* If requested, preserve the timestamp. */
703 if (tvp != NULL)
704 {
705- if (futimes (fd, tvp) != 0)
706+ if (FUTIMES (fd, output_fname, tvp) != 0)
707 {
708 error (0, errno, gettext ("\
709 cannot set access and modification date of '%s'"),
710@@ -1804,7 +1820,7 @@
711
712 if (tvp != NULL)
713 {
714- if (unlikely (futimes (fd, tvp) != 0))
715+ if (unlikely (FUTIMES (fd, fname, tvp) != 0))
716 {
717 error (0, errno, gettext ("\
718 cannot set access and modification date of '%s'"), fname);
719Index: elfutils-0.148/tests/ChangeLog
720===================================================================
721--- elfutils-0.148.orig/tests/ChangeLog 2010-06-28 19:05:56.000000000 +0000
722+++ elfutils-0.148/tests/ChangeLog 2010-07-03 13:04:08.000000000 +0000
723@@ -154,6 +154,8 @@
724
725 2008-01-21 Roland McGrath <roland@redhat.com>
726
727+ * line2addr.c (main): Revert last change.
728+
729 * testfile45.S.bz2: Add tests for cltq, cqto.
730 * testfile45.expect.bz2: Adjust.
731
732@@ -862,6 +864,11 @@
733 * Makefile.am (TESTS): Add run-elflint-test.sh.
734 (EXTRA_DIST): Add run-elflint-test.sh and testfile18.bz2.
735
736+2005-05-31 Roland McGrath <roland@redhat.com>
737+
738+ * Makefile.am (WEXTRA): New variable, substituted by configure.
739+ (AM_CFLAGS): Use it in place of -Wextra.
740+
741 2005-05-24 Ulrich Drepper <drepper@redhat.com>
742
743 * get-files.c (main): Use correct format specifier.
744Index: elfutils-0.148/tests/line2addr.c
745===================================================================
746--- elfutils-0.148.orig/tests/line2addr.c 2009-01-08 20:56:37.000000000 +0000
747+++ elfutils-0.148/tests/line2addr.c 2010-07-03 13:04:08.000000000 +0000
748@@ -132,7 +132,7 @@
749 {
750 struct args a = { .arg = argv[cnt] };
751
752- switch (sscanf (a.arg, "%m[^:]:%d", &a.file, &a.line))
753+ switch (sscanf (a.arg, "%a[^:]:%d", &a.file, &a.line))
754 {
755 default:
756 case 0: