summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/elfutils/elfutils-0.158/redhat-portability.diff
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/elfutils/elfutils-0.158/redhat-portability.diff')
-rw-r--r--meta/recipes-devtools/elfutils/elfutils-0.158/redhat-portability.diff955
1 files changed, 955 insertions, 0 deletions
diff --git a/meta/recipes-devtools/elfutils/elfutils-0.158/redhat-portability.diff b/meta/recipes-devtools/elfutils/elfutils-0.158/redhat-portability.diff
new file mode 100644
index 0000000000..5a75375690
--- /dev/null
+++ b/meta/recipes-devtools/elfutils/elfutils-0.158/redhat-portability.diff
@@ -0,0 +1,955 @@
1--- elfutils/backends/ChangeLog
2+++ elfutils/backends/ChangeLog
3@@ -292,6 +292,10 @@
4 * ppc_attrs.c (ppc_check_object_attribute): Handle tag
5 GNU_Power_ABI_Struct_Return.
6
7+2009-01-23 Roland McGrath <roland@redhat.com>
8+
9+ * Makefile.am (libebl_%.so): Use $(LD_AS_NEEDED).
10+
11 2008-10-04 Ulrich Drepper <drepper@redhat.com>
12
13 * i386_reloc.def: Fix entries for TLS_GOTDESC, TLS_DESC_CALL, and
14@@ -619,6 +623,11 @@
15 * sparc_init.c: Likewise.
16 * x86_64_init.c: Likewise.
17
18+2005-11-22 Roland McGrath <roland@redhat.com>
19+
20+ * Makefile.am (LD_AS_NEEDED): New variable, substituted by configure.
21+ (libebl_%.so rule): Use it in place of -Wl,--as-needed.
22+
23 2005-11-19 Roland McGrath <roland@redhat.com>
24
25 * ppc64_reloc.def: REL30 -> ADDR30.
26@@ -641,6 +650,9 @@
27 * Makefile.am (uninstall): Don't try to remove $(pkgincludedir).
28 (CLEANFILES): Add libebl_$(m).so.
29
30+ * Makefile.am (WEXTRA): New variable, substituted by configure.
31+ (AM_CFLAGS): Use it in place of -Wextra.
32+
33 * ppc_reloc.def: Update bits per Alan Modra <amodra@bigpond.net.au>.
34 * ppc64_reloc.def: Likewise.
35
36--- elfutils/backends/Makefile.am
37+++ elfutils/backends/Makefile.am
38@@ -124,7 +124,7 @@ libebl_%.so libebl_%.map: libebl_%_pic.a
39 $(LINK) -shared -o $(@:.map=.so) \
40 -Wl,--whole-archive $< $(cpu_$*) -Wl,--no-whole-archive \
41 -Wl,--version-script,$(@:.so=.map) \
42- -Wl,-z,defs -Wl,--as-needed $(libelf) $(libdw) $(libmudflap)
43+ -Wl,-z,defs $(LD_AS_NEEDED) $(libelf) $(libdw) $(libmudflap)
44 $(textrel_check)
45
46 libebl_i386.so: $(cpu_i386)
47--- elfutils/ChangeLog
48+++ elfutils/ChangeLog
49@@ -118,6 +118,8 @@
50
51 2012-01-24 Mark Wielaard <mjw@redhat.com>
52
53+ * configure.ac: Wrap AC_COMPILE_IFELSE sources in AC_LANG_SOURCE.
54+
55 * COPYING: Fix address. Updated version from gnulib.
56
57 2012-01-23 Mark Wielaard <mjw@redhat.com>
58@@ -136,6 +138,9 @@
59
60 2011-10-08 Mike Frysinger <vapier@gentoo.org>
61
62+ * configure.ac (--disable-werror): Handle it, controlling BUILD_WERROR
63+ automake option.
64+
65 * configure.ac: Fix use of AC_ARG_ENABLE to handle $enableval correctly.
66
67 2011-10-02 Ulrich Drepper <drepper@gmail.com>
68@@ -157,6 +162,10 @@
69
70 * configure.ac (LOCALEDIR, DATADIRNAME): Removed.
71
72+2009-11-22 Roland McGrath <roland@redhat.com>
73+
74+ * configure.ac: Use sed and expr instead of modern bash extensions.
75+
76 2009-09-21 Ulrich Drepper <drepper@redhat.com>
77
78 * configure.ac: Update for more modern autoconf.
79@@ -165,6 +174,10 @@
80
81 * configure.ac (zip_LIBS): Check for liblzma too.
82
83+2009-08-17 Roland McGrath <roland@redhat.com>
84+
85+ * configure.ac: Check for -fgnu89-inline; add it to WEXTRA if it works.
86+
87 2009-04-19 Roland McGrath <roland@redhat.com>
88
89 * configure.ac (eu_version): Round down here, not in version.h macros.
90@@ -176,6 +189,8 @@
91
92 2009-01-23 Roland McGrath <roland@redhat.com>
93
94+ * configure.ac: Check for __builtin_popcount.
95+
96 * configure.ac (zlib check): Check for gzdirect, need zlib >= 1.2.2.3.
97
98 * configure.ac (__thread check): Use AC_LINK_IFELSE, in case of
99@@ -256,6 +271,10 @@
100 * configure.ac: Add dummy automake conditional to get dependencies
101 for non-generic linker right. See src/Makefile.am.
102
103+2005-11-22 Roland McGrath <roland@redhat.com>
104+
105+ * configure.ac: Check for --as-needed linker option.
106+
107 2005-11-18 Roland McGrath <roland@redhat.com>
108
109 * Makefile.am (DISTCHECK_CONFIGURE_FLAGS): New variable.
110@@ -303,6 +322,17 @@
111 * Makefile.am (all_SUBDIRS): Add libdwfl.
112 * configure.ac: Write libdwfl/Makefile.
113
114+2005-05-31 Roland McGrath <roland@redhat.com>
115+
116+ * configure.ac (WEXTRA): Check for -Wextra and set this substitution.
117+
118+ * configure.ac: Check for struct stat st_?tim members.
119+ * src/strip.c (process_file): Use st_?time if st_?tim are not there.
120+
121+ * configure.ac: Check for futimes function.
122+ * src/strip.c (handle_elf) [! HAVE_FUTIMES]: Use utimes instead.
123+ (handle_ar) [! HAVE_FUTIMES]: Likewise.
124+
125 2005-05-19 Roland McGrath <roland@redhat.com>
126
127 * configure.ac [AH_BOTTOM] (INTDECL, _INTDECL): New macros.
128--- elfutils/config/ChangeLog
129+++ elfutils/config/ChangeLog
130@@ -44,6 +44,10 @@
131
132 * known-dwarf.awk: Use gawk.
133
134+2011-10-08 Mike Frysinger <vapier@gentoo.org>
135+
136+ * eu.am [BUILD_WERROR]: Conditionalize -Werror use on this.
137+
138 2010-07-02 Ulrich Drepper <drepper@redhat.com>
139
140 * elfutils.spec.in: Add more BuildRequires.
141--- elfutils/config/eu.am
142+++ elfutils/config/eu.am
143@@ -1,6 +1,6 @@
144 ## Common automake fragments for elfutils subdirectory makefiles.
145 ##
146-## Copyright (C) 2010 Red Hat, Inc.
147+## Copyright (C) 2010-2011 Red Hat, Inc.
148 ##
149 ## This file is part of elfutils.
150 ##
151@@ -29,14 +29,20 @@
152 ## not, see <http://www.gnu.org/licenses/>.
153 ##
154
155+WEXTRA = @WEXTRA@
156+LD_AS_NEEDED = @LD_AS_NEEDED@
157+
158 DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H -DLOCALEDIR='"${localedir}"'
159 AM_CPPFLAGS = -I. -I$(srcdir) -I$(top_srcdir)/lib -I..
160 AM_CFLAGS = -std=gnu99 -Wall -Wshadow \
161- $(if $($(*F)_no_Werror),,-Werror) \
162- $(if $($(*F)_no_Wunused),,-Wunused -Wextra) \
163+ $(if $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) \
164 $(if $($(*F)_no_Wformat),-Wno-format,-Wformat=2) \
165 $($(*F)_CFLAGS)
166
167+if BUILD_WERROR
168+AM_CFLAGS += $(if $($(*F)_no_Werror),,-Werror)
169+endif
170+
171 if MUDFLAP
172 AM_CFLAGS += -fmudflap
173 libmudflap = -lmudflap
174--- elfutils/config.h.in
175+++ elfutils/config.h.in
176@@ -6,6 +6,9 @@
177 /* Defined if libdw should support GNU ref_alt FORM, dwz multi files. */
178 #undef ENABLE_DWZ
179
180+/* Have __builtin_popcount. */
181+#undef HAVE_BUILTIN_POPCOUNT
182+
183 /* Define to 1 if you have the <inttypes.h> header file. */
184 #undef HAVE_INTTYPES_H
185
186@@ -102,4 +105,7 @@
187 /* Define for large files, on AIX-style hosts. */
188 #undef _LARGE_FILES
189
190+/* Stubbed out if missing compiler support. */
191+#undef __thread
192+
193 #include <eu-config.h>
194--- elfutils/configure.ac
195+++ elfutils/configure.ac
196@@ -99,6 +99,54 @@ CFLAGS="$old_CFLAGS"])
197 AS_IF([test "x$ac_cv_c99" != xyes],
198 AC_MSG_ERROR([gcc with C99 support required]))
199
200+AC_CACHE_CHECK([for -Wextra option to $CC], ac_cv_cc_wextra, [dnl
201+old_CFLAGS="$CFLAGS"
202+CFLAGS="$CFLAGS -Wextra"
203+AC_COMPILE_IFELSE([AC_LANG_SOURCE([void foo (void) { }])],
204+ ac_cv_cc_wextra=yes, ac_cv_cc_wextra=no)
205+CFLAGS="$old_CFLAGS"])
206+AC_SUBST(WEXTRA)
207+AS_IF([test "x$ac_cv_cc_wextra" = xyes], [WEXTRA=-Wextra], [WEXTRA=-W])
208+
209+AC_CACHE_CHECK([for -fgnu89-inline option to $CC], ac_cv_cc_gnu89_inline, [dnl
210+old_CFLAGS="$CFLAGS"
211+CFLAGS="$CFLAGS -fgnu89-inline -Werror"
212+AC_COMPILE_IFELSE([AC_LANG_SOURCE([
213+void foo (void)
214+{
215+ inline void bar (void) {}
216+ bar ();
217+}
218+extern inline void baz (void) {}
219+])], ac_cv_cc_gnu89_inline=yes, ac_cv_cc_gnu89_inline=no)
220+CFLAGS="$old_CFLAGS"])
221+AS_IF([test "x$ac_cv_cc_gnu89_inline" = xyes],
222+ [WEXTRA="${WEXTRA:+$WEXTRA }-fgnu89-inline"])
223+
224+AC_CACHE_CHECK([for --as-needed linker option],
225+ ac_cv_as_needed, [dnl
226+cat > conftest.c <<EOF
227+int main (void) { return 0; }
228+EOF
229+if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
230+ -fPIC -shared -o conftest.so conftest.c
231+ -Wl,--as-needed 1>&AS_MESSAGE_LOG_FD])
232+then
233+ ac_cv_as_needed=yes
234+else
235+ ac_cv_as_needed=no
236+fi
237+rm -f conftest*])
238+AS_IF([test "x$ac_cv_as_needed" = xyes],
239+ [LD_AS_NEEDED=-Wl,--as-needed], [LD_AS_NEEDED=])
240+AC_SUBST(LD_AS_NEEDED)
241+
242+AC_CACHE_CHECK([for __builtin_popcount], ac_cv_popcount, [dnl
243+AC_LINK_IFELSE([AC_LANG_PROGRAM([], [[exit (__builtin_popcount (127));]])],
244+ ac_cv_popcount=yes, ac_cv_popcount=no)])
245+AS_IF([test "x$ac_cv_popcount" = xyes],
246+ [AC_DEFINE([HAVE_BUILTIN_POPCOUNT], [1], [Have __builtin_popcount.])])
247+
248 AC_CACHE_CHECK([for __thread support], ac_cv_tls, [dnl
249 # Use the same flags that we use for our DSOs, so the test is representative.
250 # Some old compiler/linker/libc combinations fail some ways and not others.
251@@ -114,7 +162,10 @@ static __thread int a; int foo (int b) {
252 CFLAGS="$save_CFLAGS"
253 LDFLAGS="$save_LDFLAGS"])
254 AS_IF([test "x$ac_cv_tls" != xyes],
255- AC_MSG_ERROR([__thread support required]))
256+ [AS_IF([test "$use_locks" = yes],
257+ [AC_MSG_ERROR([--enable-thread-safety requires __thread support])],
258+ [AC_DEFINE([__thread], [/* empty: no multi-thread support */],
259+ [Stubbed out if missing compiler support.])])])
260
261 dnl This test must come as early as possible after the compiler configuration
262 dnl tests, because the choice of the file model can (in principle) affect
263@@ -213,6 +264,11 @@ AM_CONDITIONAL(USE_VALGRIND, test "$use_
264 AM_CONDITIONAL(BUILD_STATIC, [dnl
265 test "$use_mudflap" = yes -o "$use_gprof" = yes -o "$use_gcov" = yes])
266
267+AC_ARG_ENABLE([werror],
268+AS_HELP_STRING([--disable-werror],[do not build with -Werror]),
269+ [enable_werror=$enableval], [enable_werror=yes])
270+AM_CONDITIONAL(BUILD_WERROR, test "$enable_werror" = yes)
271+
272 AC_ARG_ENABLE([tests-rpath],
273 AS_HELP_STRING([--enable-tests-rpath],[build $ORIGIN-using rpath into tests]),
274 [tests_use_rpath=$enableval], [tests_use_rpath=no])
275@@ -324,7 +380,7 @@ case "$eu_version" in
276 esac
277
278 # Round up to the next release API (x.y) version.
279-eu_version=$(( (eu_version + 999) / 1000 ))
280+eu_version=`expr \( $eu_version + 999 \) / 1000`
281
282 AC_CHECK_SIZEOF(long)
283
284--- elfutils/lib/ChangeLog
285+++ elfutils/lib/ChangeLog
286@@ -61,6 +61,9 @@
287
288 2009-01-23 Roland McGrath <roland@redhat.com>
289
290+ * eu-config.h [! HAVE_BUILTIN_POPCOUNT]
291+ (__builtin_popcount): New inline function.
292+
293 * eu-config.h: Add multiple inclusion protection.
294
295 2009-01-17 Ulrich Drepper <drepper@redhat.com>
296@@ -117,6 +120,11 @@
297 * Makefile.am (libeu_a_SOURCES): Add it.
298 * system.h: Declare crc32_file.
299
300+2005-02-07 Roland McGrath <roland@redhat.com>
301+
302+ * Makefile.am (WEXTRA): New variable, substituted by configure.
303+ (AM_CFLAGS): Use it in place of -Wextra.
304+
305 2005-04-30 Ulrich Drepper <drepper@redhat.com>
306
307 * Makefile.am: Use -ffunction-sections for xmalloc.c.
308--- elfutils/lib/eu-config.h
309+++ elfutils/lib/eu-config.h
310@@ -162,6 +162,17 @@ asm (".section predict_data, \"aw\"; .pr
311 /* This macro is used by the tests conditionalize for standalone building. */
312 #define ELFUTILS_HEADER(name) <lib##name.h>
313
314+#ifndef HAVE_BUILTIN_POPCOUNT
315+# define __builtin_popcount hakmem_popcount
316+static inline unsigned int __attribute__ ((unused))
317+hakmem_popcount (unsigned int x)
318+{
319+ /* HAKMEM 169 */
320+ unsigned int n = x - ((x >> 1) & 033333333333) - ((x >> 2) & 011111111111);
321+ return ((n + (n >> 3)) & 030707070707) % 63;
322+}
323+#endif /* HAVE_BUILTIN_POPCOUNT */
324+
325
326 #ifdef SHARED
327 # define OLD_VERSION(name, version) \
328--- elfutils/libasm/ChangeLog
329+++ elfutils/libasm/ChangeLog
330@@ -75,6 +75,11 @@
331 * asm_error.c: Add new error ASM_E_IOERROR.
332 * libasmP.h: Add ASM_E_IOERROR definition.
333
334+2005-05-31 Roland McGrath <roland@redhat.com>
335+
336+ * Makefile.am (WEXTRA): New variable, substituted by configure.
337+ (AM_CFLAGS): Use it in place of -Wextra.
338+
339 2005-02-15 Ulrich Drepper <drepper@redhat.com>
340
341 * Makefile.am (AM_CFLAGS): Add -Wunused -Wextra -Wformat=2.
342--- elfutils/libcpu/ChangeLog
343+++ elfutils/libcpu/ChangeLog
344@@ -47,6 +47,9 @@
345
346 2009-01-23 Roland McGrath <roland@redhat.com>
347
348+ * i386_disasm.c (i386_disasm): Add abort after assert-constant for old
349+ compilers that don't realize it's noreturn.
350+
351 * Makefile.am (i386_parse_CFLAGS): Use quotes around command
352 substitution that can produce leading whitespace.
353
354@@ -376,6 +379,11 @@
355 * defs/i386.doc: New file.
356 * defs/x86_64: New file.
357
358+2005-04-04 Roland McGrath <roland@redhat.com>
359+
360+ * Makefile.am (WEXTRA): New variable, substituted by configure.
361+ (AM_CFLAGS): Use it instead of -Wextra.
362+
363 2005-02-15 Ulrich Drepper <drepper@redhat.com>
364
365 * Makefile (AM_CFLAGS): Add -Wunused -Wextra -Wformat=2.
366--- elfutils/libcpu/i386_disasm.c
367+++ elfutils/libcpu/i386_disasm.c
368@@ -822,6 +822,7 @@ i386_disasm (const uint8_t **startp, con
369
370 default:
371 assert (! "INVALID not handled");
372+ abort ();
373 }
374 }
375 else
376--- elfutils/libdw/ChangeLog
377+++ elfutils/libdw/ChangeLog
378@@ -346,6 +346,10 @@
379
380 * Makefile.am (known-dwarf.h): Run gawk on config/known-dwarf.awk.
381
382+2011-07-20 Mark Wielaard <mjw@redhat.com>
383+
384+ * dwarf_begin_elf.c: Add fallback for be64toh if not defined.
385+
386 2011-07-14 Mark Wielaard <mjw@redhat.com>
387
388 * libdw.h (dwarf_offdie): Fix documentation to mention .debug_info.
389@@ -705,6 +709,10 @@
390
391 * dwarf_hasattr_integrate.c: Integrate DW_AT_specification too.
392
393+2009-08-17 Roland McGrath <roland@redhat.com>
394+
395+ * libdw.h: Disable extern inlines for GCC 4.2.
396+
397 2009-08-10 Roland McGrath <roland@redhat.com>
398
399 * dwarf_getscopevar.c: Use dwarf_diename.
400@@ -1473,6 +1481,11 @@
401
402 2005-05-31 Roland McGrath <roland@redhat.com>
403
404+ * Makefile.am (WEXTRA): New variable, substituted by configure.
405+ (AM_CFLAGS): Use it in place of -Wextra.
406+
407+2005-05-31 Roland McGrath <roland@redhat.com>
408+
409 * dwarf_formref_die.c (dwarf_formref_die): Add CU header offset to
410 formref offset.
411
412--- elfutils/libdw/dwarf_begin_elf.c
413+++ elfutils/libdw/dwarf_begin_elf.c
414@@ -48,6 +48,14 @@
415 #if USE_ZLIB
416 # include <endian.h>
417 # define crc32 loser_crc32
418+# ifndef be64toh
419+# include <byteswap.h>
420+# if __BYTE_ORDER == __LITTLE_ENDIAN
421+# define be64toh(x) bswap_64 (x)
422+# else
423+# define be64toh(x) (x)
424+# endif
425+# endif
426 # include <zlib.h>
427 # undef crc32
428 #endif
429--- elfutils/libdw/libdw.h
430+++ elfutils/libdw/libdw.h
431@@ -879,7 +879,7 @@ extern Dwarf_OOM dwarf_new_oom_handler (
432
433
434 /* Inline optimizations. */
435-#ifdef __OPTIMIZE__
436+#if defined __OPTIMIZE__ && !(__GNUC__ == 4 && __GNUC_MINOR__ == 2)
437 /* Return attribute code of given attribute. */
438 __libdw_extern_inline unsigned int
439 dwarf_whatattr (Dwarf_Attribute *attr)
440--- elfutils/libdwfl/ChangeLog
441+++ elfutils/libdwfl/ChangeLog
442@@ -283,6 +283,21 @@
443 (dwfl_module_addrsym) (i_to_symfile): New function.
444 (dwfl_module_addrsym) (search_table): Use it.
445
446+2013-11-09 Jan Kratochvil <jan.kratochvil@redhat.com>
447+
448+ Older OS compatibility bits.
449+ * linux-core-attach.c (be64toh, le64toh, be32toh, le32toh): Provide
450+ fallbacks if not defined by system.
451+
452+2013-11-09 Jan Kratochvil <jan.kratochvil@redhat.com>
453+
454+ Handle T-stopped detach for old kernels.
455+ * linux-pid-attach.c (struct pid_arg): New field stopped.
456+ (ptrace_attach): New parameter stoppedp. Set it appropriately.
457+ (pid_set_initial_registers): Pass the new field.
458+ (pid_thread_detach): Handle the case of STOPPED for old kernels.
459+ (__libdwfl_attach_state_for_pid): Initialize STOPPED.
460+
461 2013-11-07 Jan Kratochvil <jan.kratochvil@redhat.com>
462 Mark Wielaard <mjw@redhat.com>
463
464@@ -2048,6 +2063,11 @@
465
466 2005-07-21 Roland McGrath <roland@redhat.com>
467
468+ * Makefile.am (WEXTRA): New variable, substituted by configure.
469+ (AM_CFLAGS): Use it in place of -Wextra.
470+
471+2005-07-21 Roland McGrath <roland@redhat.com>
472+
473 * Makefile.am (noinst_HEADERS): Add loc2c.c.
474
475 * test2.c (main): Check sscanf result to quiet warning.
476--- elfutils/libdwfl/linux-core-attach.c
477+++ elfutils/libdwfl/linux-core-attach.c
478@@ -29,6 +29,35 @@
479 #include "libdwflP.h"
480 #include <fcntl.h>
481 #include "system.h"
482+#include <endian.h>
483+#include <byteswap.h>
484+#if __BYTE_ORDER == __LITTLE_ENDIAN
485+# ifndef be64toh
486+# define be64toh(x) bswap_64 (x)
487+# endif
488+# ifndef le64toh
489+# define le64toh(x) (x)
490+# endif
491+# ifndef be32toh
492+# define be32toh(x) bswap_32 (x)
493+# endif
494+# ifndef le32toh
495+# define le32toh(x) (x)
496+# endif
497+#else
498+# ifndef be64toh
499+# define be64toh(x) (x)
500+# endif
501+# ifndef le64toh
502+# define le64toh(x) bswap_64 (x)
503+# endif
504+# ifndef be32toh
505+# define be32toh(x) (x)
506+# endif
507+# ifndef le32toh
508+# define le32toh(x) bswap_32 (x)
509+# endif
510+#endif
511
512 #ifndef MIN
513 # define MIN(a, b) ((a) < (b) ? (a) : (b))
514--- elfutils/libdwfl/linux-pid-attach.c
515+++ elfutils/libdwfl/linux-pid-attach.c
516@@ -268,13 +268,24 @@ pid_thread_detach (Dwfl_Thread *thread,
517 pid_arg->tid_attached = 0;
518 if (! pid_arg->assume_ptrace_stopped)
519 {
520+ // Older kernels (tested kernel-2.6.18-348.12.1.el5.x86_64) need special
521+ // handling of the detachment to keep the process State: T (stopped).
522+ if (pid_arg->tid_was_stopped)
523+ syscall (__NR_tkill, tid, SIGSTOP);
524 /* This handling is needed only on older Linux kernels such as
525- 2.6.32-358.23.2.el6.ppc64. Later kernels such as
526- 3.11.7-200.fc19.x86_64 remember the T (stopped) state
527- themselves and no longer need to pass SIGSTOP during
528- PTRACE_DETACH. */
529+ 2.6.32-358.23.2.el6.ppc64. Later kernels such as 3.11.7-200.fc19.x86_64
530+ remember the T (stopped) state themselves and no longer need to pass
531+ SIGSTOP during PTRACE_DETACH. */
532 ptrace (PTRACE_DETACH, tid, NULL,
533 (void *) (intptr_t) (pid_arg->tid_was_stopped ? SIGSTOP : 0));
534+ if (pid_arg->tid_was_stopped)
535+ {
536+ // Wait till the SIGSTOP settles down.
537+ int i;
538+ for (i = 0; i < 100000; i++)
539+ if (linux_proc_pid_is_stopped (tid))
540+ break;
541+ }
542 }
543 }
544
545--- elfutils/libebl/ChangeLog
546+++ elfutils/libebl/ChangeLog
547@@ -738,6 +738,11 @@
548 * Makefile.am (libebl_*_so_SOURCES): Set to $(*_SRCS) so dependency
549 tracking works right.
550
551+2005-05-31 Roland McGrath <roland@redhat.com>
552+
553+ * Makefile.am (WEXTRA): New variable, substituted by configure.
554+ (AM_CFLAGS): Use it in place of -Wextra.
555+
556 2005-05-21 Ulrich Drepper <drepper@redhat.com>
557
558 * libebl_x86_64.map: Add x86_64_core_note.
559--- elfutils/libelf/ChangeLog
560+++ elfutils/libelf/ChangeLog
561@@ -85,6 +85,11 @@
562
563 * elf-knowledge.h (SECTION_STRIP_P): Remove < SHT_NUM check.
564
565+2011-03-10 Roland McGrath <roland@redhat.com>
566+
567+ * gnuhash_xlate.h (elf_cvt_gnuhash): Avoid post-increment in bswap_32
568+ argument, since some implementations are buggy macros.
569+
570 2011-02-26 Mark Wielaard <mjw@redhat.com>
571
572 * elf_end.c (elf_end): Call rwlock_unlock before rwlock_fini.
573@@ -762,6 +767,11 @@
574
575 * elf.h: Update from glibc.
576
577+2005-05-31 Roland McGrath <roland@redhat.com>
578+
579+ * Makefile.am (WEXTRA): New variable, substituted by configure.
580+ (AM_CFLAGS): Use it in place of -Wextra.
581+
582 2005-05-08 Roland McGrath <roland@redhat.com>
583
584 * elf_begin.c (read_file) [_MUDFLAP]: Don't use mmap for now.
585--- elfutils/libelf/common.h
586+++ elfutils/libelf/common.h
587@@ -139,7 +139,7 @@ libelf_release_all (Elf *elf)
588 (Var) = (sizeof (Var) == 1 \
589 ? (unsigned char) (Var) \
590 : (sizeof (Var) == 2 \
591- ? bswap_16 (Var) \
592+ ? (unsigned short int) bswap_16 (Var) \
593 : (sizeof (Var) == 4 \
594 ? bswap_32 (Var) \
595 : bswap_64 (Var))))
596@@ -148,7 +148,7 @@ libelf_release_all (Elf *elf)
597 (Dst) = (sizeof (Var) == 1 \
598 ? (unsigned char) (Var) \
599 : (sizeof (Var) == 2 \
600- ? bswap_16 (Var) \
601+ ? (unsigned short int) bswap_16 (Var) \
602 : (sizeof (Var) == 4 \
603 ? bswap_32 (Var) \
604 : bswap_64 (Var))))
605--- elfutils/libelf/gnuhash_xlate.h
606+++ elfutils/libelf/gnuhash_xlate.h
607@@ -1,5 +1,5 @@
608 /* Conversion functions for versioning information.
609- Copyright (C) 2006, 2007 Red Hat, Inc.
610+ Copyright (C) 2006-2011 Red Hat, Inc.
611 This file is part of elfutils.
612 Written by Ulrich Drepper <drepper@redhat.com>, 2006.
613
614@@ -68,7 +68,9 @@ elf_cvt_gnuhash (void *dest, const void
615 dest32 = (Elf32_Word *) &dest64[bitmask_words];
616 while (len >= 4)
617 {
618- *dest32++ = bswap_32 (*src32++);
619+ *dest32 = bswap_32 (*src32);
620+ ++dest32;
621+ ++src32;
622 len -= 4;
623 }
624 }
625--- elfutils/src/addr2line.c
626+++ elfutils/src/addr2line.c
627@@ -540,10 +540,10 @@ handle_address (const char *string, Dwfl
628 bool parsed = false;
629 int i, j;
630 char *name = NULL;
631- if (sscanf (string, "(%m[^)])%" PRIiMAX "%n", &name, &addr, &i) == 2
632+ if (sscanf (string, "(%a[^)])%" PRIiMAX "%n", &name, &addr, &i) == 2
633 && string[i] == '\0')
634 parsed = adjust_to_section (name, &addr, dwfl);
635- switch (sscanf (string, "%m[^-+]%n%" PRIiMAX "%n", &name, &i, &addr, &j))
636+ switch (sscanf (string, "%a[^-+]%n%" PRIiMAX "%n", &name, &i, &addr, &j))
637 {
638 default:
639 break;
640--- elfutils/src/ChangeLog
641+++ elfutils/src/ChangeLog
642@@ -964,8 +964,16 @@
643 * readelf.c (attr_callback): Use print_block only when we don't use
644 print_ops.
645
646+2009-08-17 Roland McGrath <roland@redhat.com>
647+
648+ * ld.h: Disable extern inlines for GCC 4.2.
649+
650 2009-08-14 Roland McGrath <roland@redhat.com>
651
652+ * strings.c (read_block): Conditionalize posix_fadvise use
653+ on [POSIX_FADV_SEQUENTIAL].
654+ From Petr Salinger <Petr.Salinger@seznam.cz>.
655+
656 * ar.c (do_oper_extract): Use pathconf instead of statfs.
657
658 2009-08-01 Ulrich Drepper <drepper@redhat.com>
659@@ -1129,6 +1137,8 @@
660 * readelf.c (print_debug_frame_section): Use t instead of j formats
661 for ptrdiff_t OFFSET.
662
663+ * addr2line.c (handle_address): Use %a instead of %m for compatibility.
664+
665 2009-01-21 Ulrich Drepper <drepper@redhat.com>
666
667 * elflint.c (check_program_header): Fix typo in .eh_frame_hdr section
668@@ -1312,6 +1322,11 @@
669 that matches its PT_LOAD's p_flags &~ PF_W. On sparc, PF_X really
670 is valid in RELRO.
671
672+2008-03-01 Roland McGrath <roland@redhat.com>
673+
674+ * readelf.c (dump_archive_index): Tweak portability hack
675+ to match [__GNUC__ < 4] too.
676+
677 2008-02-29 Roland McGrath <roland@redhat.com>
678
679 * readelf.c (print_attributes): Add a cast.
680@@ -1563,6 +1578,8 @@
681
682 * readelf.c (hex_dump): Fix rounding error in whitespace calculation.
683
684+ * Makefile.am (readelf_no_Werror): New variable.
685+
686 2007-10-15 Roland McGrath <roland@redhat.com>
687
688 * make-debug-archive.in: New file.
689@@ -2002,6 +2019,10 @@
690 * elflint.c (valid_e_machine): Add EM_ALPHA.
691 Reported by Christian Aichinger <Greek0@gmx.net>.
692
693+ * strings.c (map_file): Define POSIX_MADV_SEQUENTIAL to
694+ MADV_SEQUENTIAL if undefined. Don't call posix_madvise
695+ if neither is defined.
696+
697 2006-08-08 Ulrich Drepper <drepper@redhat.com>
698
699 * elflint.c (check_dynamic): Don't require DT_HASH for DT_SYMTAB.
700@@ -2078,6 +2099,10 @@
701 * Makefile.am: Add hacks to create dependency files for non-generic
702 linker.
703
704+2006-04-05 Roland McGrath <roland@redhat.com>
705+
706+ * strings.c (MAP_POPULATE): Define to 0 if undefined.
707+
708 2006-06-12 Ulrich Drepper <drepper@redhat.com>
709
710 * ldgeneric.c (ld_generic_generate_sections): Don't create .interp
711@@ -2426,6 +2451,11 @@
712 * readelf.c (print_debug_loc_section): Fix indentation for larger
713 address size.
714
715+2005-05-31 Roland McGrath <roland@redhat.com>
716+
717+ * Makefile.am (WEXTRA): New variable, substituted by configure.
718+ (AM_CFLAGS): Use it in place of -Wextra.
719+
720 2005-05-30 Roland McGrath <roland@redhat.com>
721
722 * readelf.c (print_debug_line_section): Print section offset of each
723--- elfutils/src/findtextrel.c
724+++ elfutils/src/findtextrel.c
725@@ -496,7 +496,11 @@ ptrcompare (const void *p1, const void *
726
727
728 static void
729-check_rel (size_t nsegments, struct segments segments[nsegments],
730+check_rel (size_t nsegments, struct segments segments[
731+#if __GNUC__ >= 4
732+ nsegments
733+#endif
734+ ],
735 GElf_Addr addr, Elf *elf, Elf_Scn *symscn, Dwarf *dw,
736 const char *fname, bool more_than_one, void **knownsrcs)
737 {
738--- elfutils/src/ld.h
739+++ elfutils/src/ld.h
740@@ -1114,6 +1114,7 @@ extern bool dynamically_linked_p (void);
741
742 /* Checked whether the symbol is undefined and referenced from a DSO. */
743 extern bool linked_from_dso_p (struct scninfo *scninfo, size_t symidx);
744+#if defined __OPTIMIZE__ && !(__GNUC__ == 4 && __GNUC_MINOR__ == 2)
745 #ifdef __GNUC_STDC_INLINE__
746 __attribute__ ((__gnu_inline__))
747 #endif
748@@ -1131,5 +1132,6 @@ linked_from_dso_p (struct scninfo *scnin
749
750 return sym->defined && sym->in_dso;
751 }
752+#endif /* Optimizing and not GCC 4.2. */
753
754 #endif /* ld.h */
755--- elfutils/src/Makefile.am
756+++ elfutils/src/Makefile.am
757@@ -95,6 +95,9 @@ addr2line_no_Wformat = yes
758 # XXX While the file is not finished, don't warn about this
759 ldgeneric_no_Wunused = yes
760
761+# Buggy old compilers.
762+readelf_no_Werror = yes
763+
764 readelf_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl
765 nm_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl \
766 $(demanglelib)
767--- elfutils/src/readelf.c
768+++ elfutils/src/readelf.c
769@@ -4171,10 +4171,12 @@ listptr_base (struct listptr *p)
770 return base;
771 }
772
773+static const char *listptr_name;
774+
775 static int
776-compare_listptr (const void *a, const void *b, void *arg)
777+compare_listptr (const void *a, const void *b)
778 {
779- const char *name = arg;
780+ const char *const name = listptr_name;
781 struct listptr *p1 = (void *) a;
782 struct listptr *p2 = (void *) b;
783
784@@ -4263,8 +4265,11 @@ static void
785 sort_listptr (struct listptr_table *table, const char *name)
786 {
787 if (table->n > 0)
788- qsort_r (table->table, table->n, sizeof table->table[0],
789- &compare_listptr, (void *) name);
790+ {
791+ listptr_name = name;
792+ qsort (table->table, table->n, sizeof table->table[0],
793+ &compare_listptr);
794+ }
795 }
796
797 static bool
798@@ -9151,7 +9156,7 @@ dump_archive_index (Elf *elf, const char
799 if (unlikely (elf_rand (elf, as_off) == 0)
800 || unlikely ((subelf = elf_begin (-1, ELF_C_READ_MMAP, elf))
801 == NULL))
802-#if __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 7)
803+#if __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 7) || __GNUC__ < 4
804 while (1)
805 #endif
806 error (EXIT_FAILURE, 0,
807--- elfutils/src/strings.c
808+++ elfutils/src/strings.c
809@@ -43,6 +43,10 @@
810
811 #include <system.h>
812
813+#ifndef MAP_POPULATE
814+# define MAP_POPULATE 0
815+#endif
816+
817
818 /* Prototypes of local functions. */
819 static int read_fd (int fd, const char *fname, off64_t fdlen);
820@@ -483,8 +487,13 @@ map_file (int fd, off64_t start_off, off
821 fd, start_off);
822 if (mem != MAP_FAILED)
823 {
824+#if !defined POSIX_MADV_SEQUENTIAL && defined MADV_SEQUENTIAL
825+# define POSIX_MADV_SEQUENTIAL MADV_SEQUENTIAL
826+#endif
827+#ifdef POSIX_MADV_SEQUENTIAL
828 /* We will go through the mapping sequentially. */
829 (void) posix_madvise (mem, map_size, POSIX_MADV_SEQUENTIAL);
830+#endif
831 break;
832 }
833 if (errno != EINVAL && errno != ENOMEM)
834@@ -576,9 +585,11 @@ read_block (int fd, const char *fname, o
835 elfmap_off = from & ~(ps - 1);
836 elfmap_base = elfmap = map_file (fd, elfmap_off, fdlen, &elfmap_size);
837
838+#ifdef POSIX_FADV_SEQUENTIAL
839 if (unlikely (elfmap == MAP_FAILED))
840 /* Let the kernel know we are going to read everything in sequence. */
841 (void) posix_fadvise (fd, 0, 0, POSIX_FADV_SEQUENTIAL);
842+#endif
843 }
844
845 if (unlikely (elfmap == MAP_FAILED))
846--- elfutils/src/strip.c
847+++ elfutils/src/strip.c
848@@ -45,6 +45,12 @@
849 #include <libebl.h>
850 #include <system.h>
851
852+#ifdef HAVE_FUTIMES
853+# define FUTIMES(fd, fname, tvp) futimes (fd, tvp)
854+#else
855+# define FUTIMES(fd, fname, tvp) utimes (fname, tvp)
856+#endif
857+
858 typedef uint8_t GElf_Byte;
859
860 /* Name and version of program. */
861@@ -318,8 +324,18 @@ process_file (const char *fname)
862
863 /* If we have to preserve the timestamp, we need it in the
864 format utimes() understands. */
865+#ifdef HAVE_STRUCT_STAT_ST_ATIM
866 TIMESPEC_TO_TIMEVAL (&tv[0], &pre_st.st_atim);
867+#else
868+ tv[0].tv_sec = pre_st.st_atime;
869+ tv[0].tv_usec = 0;
870+#endif
871+#ifdef HAVE_STRUCT_STAT_ST_MTIM
872 TIMESPEC_TO_TIMEVAL (&tv[1], &pre_st.st_mtim);
873+#else
874+ tv[1].tv_sec = pre_st.st_atime;
875+ tv[1].tv_usec = 0;
876+#endif
877 }
878
879 /* Open the file. */
880@@ -2060,7 +2076,7 @@ while computing checksum for debug infor
881 /* If requested, preserve the timestamp. */
882 if (tvp != NULL)
883 {
884- if (futimes (fd, tvp) != 0)
885+ if (FUTIMES (fd, output_fname, tvp) != 0)
886 {
887 error (0, errno, gettext ("\
888 cannot set access and modification date of '%s'"),
889@@ -2117,7 +2133,7 @@ handle_ar (int fd, Elf *elf, const char
890
891 if (tvp != NULL)
892 {
893- if (unlikely (futimes (fd, tvp) != 0))
894+ if (unlikely (FUTIMES (fd, fname, tvp) != 0))
895 {
896 error (0, errno, gettext ("\
897 cannot set access and modification date of '%s'"), fname);
898--- elfutils/tests/backtrace.c
899+++ elfutils/tests/backtrace.c
900@@ -36,6 +36,7 @@
901 #include <fcntl.h>
902 #include <string.h>
903 #include <argp.h>
904+#include <sys/syscall.h>
905 #include ELFUTILS_HEADER(dwfl)
906
907 static int
908--- elfutils/tests/ChangeLog
909+++ elfutils/tests/ChangeLog
910@@ -123,6 +123,13 @@
911
912 2013-12-02 Jan Kratochvil <jan.kratochvil@redhat.com>
913
914+ Handle T-stopped detach for old kernels.
915+ * backtrace.c: Include sys/syscall.h.
916+ (linux_proc_pid_is_stopped): New function.
917+ (ptrace_detach_stopped): Handle old kernels.
918+
919+2013-12-02 Jan Kratochvil <jan.kratochvil@redhat.com>
920+
921 * Makefile.am (check_PROGRAMS): Add backtrace, backtrace-child,
922 backtrace-data and backtrace-dwarf.
923 (BUILT_SOURCES, clean-local, backtrace-child-biarch): New.
924@@ -987,6 +994,8 @@
925
926 2008-01-21 Roland McGrath <roland@redhat.com>
927
928+ * line2addr.c (main): Revert last change.
929+
930 * testfile45.S.bz2: Add tests for cltq, cqto.
931 * testfile45.expect.bz2: Adjust.
932
933@@ -1695,6 +1704,11 @@
934 * Makefile.am (TESTS): Add run-elflint-test.sh.
935 (EXTRA_DIST): Add run-elflint-test.sh and testfile18.bz2.
936
937+2005-05-31 Roland McGrath <roland@redhat.com>
938+
939+ * Makefile.am (WEXTRA): New variable, substituted by configure.
940+ (AM_CFLAGS): Use it in place of -Wextra.
941+
942 2005-05-24 Ulrich Drepper <drepper@redhat.com>
943
944 * get-files.c (main): Use correct format specifier.
945--- elfutils/tests/line2addr.c
946+++ elfutils/tests/line2addr.c
947@@ -124,7 +124,7 @@ main (int argc, char *argv[])
948 {
949 struct args a = { .arg = argv[cnt] };
950
951- switch (sscanf (a.arg, "%m[^:]:%d", &a.file, &a.line))
952+ switch (sscanf (a.arg, "%a[^:]:%d", &a.file, &a.line))
953 {
954 default:
955 case 0: