summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHongxu Jia <hongxu.jia@windriver.com>2014-11-14 17:29:03 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-11-25 13:03:28 +0000
commit2e13f27e38a7e366e8ce12bd22aa072a7bf89068 (patch)
tree2bc963b4bf5cd06b47e9475fb1ecf21306abc929
parentfa234ef4e0855bfcd0411c6039d941c59d421b36 (diff)
downloadpoky-2e13f27e38a7e366e8ce12bd22aa072a7bf89068.tar.gz
elfutils: upgrade to 0.160
- Upgrade elfutils to 0.160 - Move 0.148 patches from elfutils to elfutils-0.148 - Drop 0.158 patches that got from debain, so far debian doesn't provide patches for 0.160 (the latest is 0.159) - Move fixheadercheck.patch from 0.159 to 0.160 - We choose to use 0.159 patches from debian for the current 0.160 which located in elfutils-0.160 1) Rebase the following patches from 0.159 to 0.160 hppa_backend.diff arm_backend.diff mips_backend.diff m68k_backend.diff arm_func_value.patch arm_unwind_ret_mask.patch 2) Rebase redhat-portability.diff according to commit 52a6d20519870103134166d91e22d21fd736195d Author: Roxana Ciobanu <roxana.ciobanu@intel.com> Date: Tue Jul 1 17:17:00 2014 +0300 elfutils/elfutils-native: Fix patching generated files 3) Drop the following patches which have already beem merged to 0.160 arm_unsupported.patch arm_syscall.patch unaligned.patch aarch64-run-native-test-fix.patch (From OE-Core rev: 74b191022494fc1d357c1f05dbce38c986bed365) Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-devtools/elfutils/elfutils-0.148/arm_backend.diff (renamed from meta/recipes-devtools/elfutils/elfutils/arm_backend.diff)0
-rw-r--r--meta/recipes-devtools/elfutils/elfutils-0.148/elf_additions.diff (renamed from meta/recipes-devtools/elfutils/elfutils/elf_additions.diff)0
-rw-r--r--meta/recipes-devtools/elfutils/elfutils-0.148/elfutils-ar-c-fix-num-passed-to-memset.patch (renamed from meta/recipes-devtools/elfutils/elfutils/elfutils-ar-c-fix-num-passed-to-memset.patch)0
-rw-r--r--meta/recipes-devtools/elfutils/elfutils-0.148/elfutils-fsize.patch (renamed from meta/recipes-devtools/elfutils/elfutils/elfutils-fsize.patch)0
-rw-r--r--meta/recipes-devtools/elfutils/elfutils-0.148/fix-build-gcc-4.8.patch (renamed from meta/recipes-devtools/elfutils/elfutils/fix-build-gcc-4.8.patch)0
-rw-r--r--meta/recipes-devtools/elfutils/elfutils-0.148/fix_for_gcc-4.7.patch (renamed from meta/recipes-devtools/elfutils/elfutils/fix_for_gcc-4.7.patch)0
-rw-r--r--meta/recipes-devtools/elfutils/elfutils-0.148/hppa_backend.diff (renamed from meta/recipes-devtools/elfutils/elfutils/hppa_backend.diff)0
-rw-r--r--meta/recipes-devtools/elfutils/elfutils-0.148/m68k_backend.diff (renamed from meta/recipes-devtools/elfutils/elfutils/m68k_backend.diff)0
-rw-r--r--meta/recipes-devtools/elfutils/elfutils-0.148/mips_backend.diff (renamed from meta/recipes-devtools/elfutils/elfutils/mips_backend.diff)0
-rw-r--r--meta/recipes-devtools/elfutils/elfutils-0.148/nm-Fix-size-passed-to-snprintf-for-invalid-sh_name-case.patch (renamed from meta/recipes-devtools/elfutils/elfutils/nm-Fix-size-passed-to-snprintf-for-invalid-sh_name-case.patch)0
-rw-r--r--meta/recipes-devtools/elfutils/elfutils-0.148/redhat-portability.diff (renamed from meta/recipes-devtools/elfutils/elfutils/redhat-portability.diff)0
-rw-r--r--meta/recipes-devtools/elfutils/elfutils-0.148/redhat-robustify.diff (renamed from meta/recipes-devtools/elfutils/elfutils/redhat-robustify.diff)0
-rw-r--r--meta/recipes-devtools/elfutils/elfutils-0.148/remove-unused.patch (renamed from meta/recipes-devtools/elfutils/elfutils/remove-unused.patch)0
-rw-r--r--meta/recipes-devtools/elfutils/elfutils-0.148/testsuite-ignore-elflint.diff (renamed from meta/recipes-devtools/elfutils/elfutils/testsuite-ignore-elflint.diff)0
-rw-r--r--meta/recipes-devtools/elfutils/elfutils-0.158/CVE-2014-0172.patch35
-rw-r--r--meta/recipes-devtools/elfutils/elfutils-0.158/core_filename.patch27
-rw-r--r--meta/recipes-devtools/elfutils/elfutils-0.158/elf_additions.diff77
-rw-r--r--meta/recipes-devtools/elfutils/elfutils-0.158/m4-biarch.m4-tweak-AC_RUN_IFELSE-for-cross-compiling.patch34
-rw-r--r--meta/recipes-devtools/elfutils/elfutils-0.158/redhat-robustify.diff1756
-rw-r--r--meta/recipes-devtools/elfutils/elfutils-0.158/unwind_non_linux.patch256
-rw-r--r--meta/recipes-devtools/elfutils/elfutils-0.160/arm_backend.diff (renamed from meta/recipes-devtools/elfutils/elfutils-0.158/arm_backend.diff)382
-rw-r--r--meta/recipes-devtools/elfutils/elfutils-0.160/arm_func_value.patch166
-rw-r--r--meta/recipes-devtools/elfutils/elfutils-0.160/arm_unwind_ret_mask.patch83
-rw-r--r--meta/recipes-devtools/elfutils/elfutils-0.160/fixheadercheck.patch (renamed from meta/recipes-devtools/elfutils/elfutils-0.158/fixheadercheck.patch)0
-rw-r--r--meta/recipes-devtools/elfutils/elfutils-0.160/hppa_backend.diff (renamed from meta/recipes-devtools/elfutils/elfutils-0.158/hppa_backend.diff)2
-rw-r--r--meta/recipes-devtools/elfutils/elfutils-0.160/m68k_backend.diff (renamed from meta/recipes-devtools/elfutils/elfutils-0.158/m68k_backend.diff)2
-rw-r--r--meta/recipes-devtools/elfutils/elfutils-0.160/mips_backend.diff (renamed from meta/recipes-devtools/elfutils/elfutils-0.158/mips_backend.diff)2
-rw-r--r--meta/recipes-devtools/elfutils/elfutils-0.160/mips_readelf_w.patch (renamed from meta/recipes-devtools/elfutils/elfutils-0.158/mips_readelf_w.patch)0
-rw-r--r--meta/recipes-devtools/elfutils/elfutils-0.160/non_linux.patch35
-rw-r--r--meta/recipes-devtools/elfutils/elfutils-0.160/redhat-portability.diff (renamed from meta/recipes-devtools/elfutils/elfutils-0.158/redhat-portability.diff)408
-rw-r--r--meta/recipes-devtools/elfutils/elfutils-0.160/scanf-format.patch (renamed from meta/recipes-devtools/elfutils/elfutils-0.158/scanf-format.patch)0
-rw-r--r--meta/recipes-devtools/elfutils/elfutils-0.160/testsuite-ignore-elflint.diff (renamed from meta/recipes-devtools/elfutils/elfutils-0.158/testsuite-ignore-elflint.diff)0
-rw-r--r--meta/recipes-devtools/elfutils/elfutils_0.160.bb (renamed from meta/recipes-devtools/elfutils/elfutils_0.158.bb)28
33 files changed, 736 insertions, 2557 deletions
diff --git a/meta/recipes-devtools/elfutils/elfutils/arm_backend.diff b/meta/recipes-devtools/elfutils/elfutils-0.148/arm_backend.diff
index d4e4675ad5..d4e4675ad5 100644
--- a/meta/recipes-devtools/elfutils/elfutils/arm_backend.diff
+++ b/meta/recipes-devtools/elfutils/elfutils-0.148/arm_backend.diff
diff --git a/meta/recipes-devtools/elfutils/elfutils/elf_additions.diff b/meta/recipes-devtools/elfutils/elfutils-0.148/elf_additions.diff
index 5baa709000..5baa709000 100644
--- a/meta/recipes-devtools/elfutils/elfutils/elf_additions.diff
+++ b/meta/recipes-devtools/elfutils/elfutils-0.148/elf_additions.diff
diff --git a/meta/recipes-devtools/elfutils/elfutils/elfutils-ar-c-fix-num-passed-to-memset.patch b/meta/recipes-devtools/elfutils/elfutils-0.148/elfutils-ar-c-fix-num-passed-to-memset.patch
index b619619ec0..b619619ec0 100644
--- a/meta/recipes-devtools/elfutils/elfutils/elfutils-ar-c-fix-num-passed-to-memset.patch
+++ b/meta/recipes-devtools/elfutils/elfutils-0.148/elfutils-ar-c-fix-num-passed-to-memset.patch
diff --git a/meta/recipes-devtools/elfutils/elfutils/elfutils-fsize.patch b/meta/recipes-devtools/elfutils/elfutils-0.148/elfutils-fsize.patch
index 0ff353d0de..0ff353d0de 100644
--- a/meta/recipes-devtools/elfutils/elfutils/elfutils-fsize.patch
+++ b/meta/recipes-devtools/elfutils/elfutils-0.148/elfutils-fsize.patch
diff --git a/meta/recipes-devtools/elfutils/elfutils/fix-build-gcc-4.8.patch b/meta/recipes-devtools/elfutils/elfutils-0.148/fix-build-gcc-4.8.patch
index 0e28690207..0e28690207 100644
--- a/meta/recipes-devtools/elfutils/elfutils/fix-build-gcc-4.8.patch
+++ b/meta/recipes-devtools/elfutils/elfutils-0.148/fix-build-gcc-4.8.patch
diff --git a/meta/recipes-devtools/elfutils/elfutils/fix_for_gcc-4.7.patch b/meta/recipes-devtools/elfutils/elfutils-0.148/fix_for_gcc-4.7.patch
index bd634b4418..bd634b4418 100644
--- a/meta/recipes-devtools/elfutils/elfutils/fix_for_gcc-4.7.patch
+++ b/meta/recipes-devtools/elfutils/elfutils-0.148/fix_for_gcc-4.7.patch
diff --git a/meta/recipes-devtools/elfutils/elfutils/hppa_backend.diff b/meta/recipes-devtools/elfutils/elfutils-0.148/hppa_backend.diff
index a86b97c683..a86b97c683 100644
--- a/meta/recipes-devtools/elfutils/elfutils/hppa_backend.diff
+++ b/meta/recipes-devtools/elfutils/elfutils-0.148/hppa_backend.diff
diff --git a/meta/recipes-devtools/elfutils/elfutils/m68k_backend.diff b/meta/recipes-devtools/elfutils/elfutils-0.148/m68k_backend.diff
index 5b621f92ff..5b621f92ff 100644
--- a/meta/recipes-devtools/elfutils/elfutils/m68k_backend.diff
+++ b/meta/recipes-devtools/elfutils/elfutils-0.148/m68k_backend.diff
diff --git a/meta/recipes-devtools/elfutils/elfutils/mips_backend.diff b/meta/recipes-devtools/elfutils/elfutils-0.148/mips_backend.diff
index 3f81a75b1a..3f81a75b1a 100644
--- a/meta/recipes-devtools/elfutils/elfutils/mips_backend.diff
+++ b/meta/recipes-devtools/elfutils/elfutils-0.148/mips_backend.diff
diff --git a/meta/recipes-devtools/elfutils/elfutils/nm-Fix-size-passed-to-snprintf-for-invalid-sh_name-case.patch b/meta/recipes-devtools/elfutils/elfutils-0.148/nm-Fix-size-passed-to-snprintf-for-invalid-sh_name-case.patch
index 2b5dad368a..2b5dad368a 100644
--- a/meta/recipes-devtools/elfutils/elfutils/nm-Fix-size-passed-to-snprintf-for-invalid-sh_name-case.patch
+++ b/meta/recipes-devtools/elfutils/elfutils-0.148/nm-Fix-size-passed-to-snprintf-for-invalid-sh_name-case.patch
diff --git a/meta/recipes-devtools/elfutils/elfutils/redhat-portability.diff b/meta/recipes-devtools/elfutils/elfutils-0.148/redhat-portability.diff
index b8a912c412..b8a912c412 100644
--- a/meta/recipes-devtools/elfutils/elfutils/redhat-portability.diff
+++ b/meta/recipes-devtools/elfutils/elfutils-0.148/redhat-portability.diff
diff --git a/meta/recipes-devtools/elfutils/elfutils/redhat-robustify.diff b/meta/recipes-devtools/elfutils/elfutils-0.148/redhat-robustify.diff
index cd398549df..cd398549df 100644
--- a/meta/recipes-devtools/elfutils/elfutils/redhat-robustify.diff
+++ b/meta/recipes-devtools/elfutils/elfutils-0.148/redhat-robustify.diff
diff --git a/meta/recipes-devtools/elfutils/elfutils/remove-unused.patch b/meta/recipes-devtools/elfutils/elfutils-0.148/remove-unused.patch
index 6a19791480..6a19791480 100644
--- a/meta/recipes-devtools/elfutils/elfutils/remove-unused.patch
+++ b/meta/recipes-devtools/elfutils/elfutils-0.148/remove-unused.patch
diff --git a/meta/recipes-devtools/elfutils/elfutils/testsuite-ignore-elflint.diff b/meta/recipes-devtools/elfutils/elfutils-0.148/testsuite-ignore-elflint.diff
index d792d5fd73..d792d5fd73 100644
--- a/meta/recipes-devtools/elfutils/elfutils/testsuite-ignore-elflint.diff
+++ b/meta/recipes-devtools/elfutils/elfutils-0.148/testsuite-ignore-elflint.diff
diff --git a/meta/recipes-devtools/elfutils/elfutils-0.158/CVE-2014-0172.patch b/meta/recipes-devtools/elfutils/elfutils-0.158/CVE-2014-0172.patch
deleted file mode 100644
index 6c44314589..0000000000
--- a/meta/recipes-devtools/elfutils/elfutils-0.158/CVE-2014-0172.patch
+++ /dev/null
@@ -1,35 +0,0 @@
1From 7f1eec317db79627b473c5b149a22a1b20d1f68f Mon Sep 17 00:00:00 2001
2From: Mark Wielaard <mjw@redhat.com>
3Date: Wed, 9 Apr 2014 11:33:23 +0200
4Subject: [PATCH] CVE-2014-0172 Check for overflow before calling malloc to
5 uncompress data.
6
7https://bugzilla.redhat.com/show_bug.cgi?id=1085663
8
9Reported-by: Florian Weimer <fweimer@redhat.com>
10Signed-off-by: Mark Wielaard <mjw@redhat.com>
11
12Index: elfutils-0.158/libdw/dwarf_begin_elf.c
13===================================================================
14--- elfutils-0.158.orig/libdw/dwarf_begin_elf.c 2014-05-01 17:10:01.928213292 +0000
15+++ elfutils-0.158/libdw/dwarf_begin_elf.c 2014-05-01 17:10:01.924213375 +0000
16@@ -1,5 +1,5 @@
17 /* Create descriptor from ELF descriptor for processing file.
18- Copyright (C) 2002-2011 Red Hat, Inc.
19+ Copyright (C) 2002-2011, 2014 Red Hat, Inc.
20 This file is part of elfutils.
21 Written by Ulrich Drepper <drepper@redhat.com>, 2002.
22
23@@ -289,6 +289,12 @@
24 memcpy (&size, data->d_buf + 4, sizeof size);
25 size = be64toh (size);
26
27+ /* Check for unsigned overflow so malloc always allocated
28+ enough memory for both the Elf_Data header and the
29+ uncompressed section data. */
30+ if (unlikely (sizeof (Elf_Data) + size < size))
31+ break;
32+
33 Elf_Data *zdata = malloc (sizeof (Elf_Data) + size);
34 if (unlikely (zdata == NULL))
35 break;
diff --git a/meta/recipes-devtools/elfutils/elfutils-0.158/core_filename.patch b/meta/recipes-devtools/elfutils/elfutils-0.158/core_filename.patch
deleted file mode 100644
index e2f0576d7b..0000000000
--- a/meta/recipes-devtools/elfutils/elfutils-0.158/core_filename.patch
+++ /dev/null
@@ -1,27 +0,0 @@
1From: Matthias Klose <doko@ubuntu.com>
2Date: Tue, 7 Jan 2014 10:25:29 +0100
3Subject: [PATCH] tests: backtrace-subr.sh (check_native_core) should check
4 core file name.
5
6Needed when /proc/sys/kernel/core_uses_pid is set to 0. Try to rename
7the core file, and if it does still fail, skip the test.
8
9diff --git a/tests/backtrace-subr.sh b/tests/backtrace-subr.sh
10index e7ece91..62b873c 100644
11--- a/tests/backtrace-subr.sh
12+++ b/tests/backtrace-subr.sh
13@@ -111,6 +111,11 @@ check_native_core()
14
15 # Skip the test if we cannot adjust core ulimit.
16 core="core.`ulimit -c unlimited || exit 77; set +ex; testrun ${abs_builddir}/$child --gencore; true`"
17+ # see if /proc/sys/kernel/core_uses_pid is set to 0
18+ if [ -f core ]; then
19+ mv core "$core"
20+ fi
21+ if [ ! -f "$core" ]; then exit 77; fi
22
23 if [ "x$SAVED_VALGRIND_CMD" != "x" ]; then
24 VALGRIND_CMD="$SAVED_VALGRIND_CMD"
25--
261.9.2
27
diff --git a/meta/recipes-devtools/elfutils/elfutils-0.158/elf_additions.diff b/meta/recipes-devtools/elfutils/elfutils-0.158/elf_additions.diff
deleted file mode 100644
index 671c8ee1ae..0000000000
--- a/meta/recipes-devtools/elfutils/elfutils-0.158/elf_additions.diff
+++ /dev/null
@@ -1,77 +0,0 @@
1Upstream-Status: Backport
2
3Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
4---
5 libelf/elf.h | 27 +++++++++++++++++++++++++--
6 1 file changed, 25 insertions(+), 2 deletions(-)
7
8diff --git a/libelf/elf.h b/libelf/elf.h
9--- a/libelf/elf.h
10+++ b/libelf/elf.h
11@@ -142,6 +142,7 @@ typedef struct
12 #define ELFOSABI_NETBSD 2 /* NetBSD. */
13 #define ELFOSABI_GNU 3 /* Object uses GNU ELF extensions. */
14 #define ELFOSABI_LINUX ELFOSABI_GNU /* Compatibility alias. */
15+#define ELFOSABI_HURD 4 /* GNU/Hurd */
16 #define ELFOSABI_SOLARIS 6 /* Sun Solaris. */
17 #define ELFOSABI_AIX 7 /* IBM AIX. */
18 #define ELFOSABI_IRIX 8 /* SGI Irix. */
19@@ -149,8 +150,13 @@ typedef struct
20 #define ELFOSABI_TRU64 10 /* Compaq TRU64 UNIX. */
21 #define ELFOSABI_MODESTO 11 /* Novell Modesto. */
22 #define ELFOSABI_OPENBSD 12 /* OpenBSD. */
23+#define ELFOSABI_OPENVMS 13 /* OpenVMS */
24+#define ELFOSABI_NSK 14 /* Hewlett-Packard Non-Stop Kernel */
25+#define ELFOSABI_AROS 15 /* Amiga Research OS */
26+/* 64-255 Architecture-specific value range */
27 #define ELFOSABI_ARM_AEABI 64 /* ARM EABI */
28 #define ELFOSABI_ARM 97 /* ARM */
29+/* This is deprecated? It's not in the latest version anymore. */
30 #define ELFOSABI_STANDALONE 255 /* Standalone (embedded) application */
31
32 #define EI_ABIVERSION 8 /* ABI version */
33@@ -205,7 +211,7 @@ typedef struct
34 #define EM_H8_300H 47 /* Hitachi H8/300H */
35 #define EM_H8S 48 /* Hitachi H8S */
36 #define EM_H8_500 49 /* Hitachi H8/500 */
37-#define EM_IA_64 50 /* Intel Merced */
38+#define EM_IA_64 50 /* Intel IA64 */
39 #define EM_MIPS_X 51 /* Stanford MIPS-X */
40 #define EM_COLDFIRE 52 /* Motorola Coldfire */
41 #define EM_68HC12 53 /* Motorola M68HC12 */
42@@ -219,7 +225,8 @@ typedef struct
43 #define EM_TINYJ 61 /* Advanced Logic Corp. Tinyj emb.fam*/
44 #define EM_X86_64 62 /* AMD x86-64 architecture */
45 #define EM_PDSP 63 /* Sony DSP Processor */
46-
47+#define EM_PDP10 64 /* Digital Equipment Corp. PDP-10 */
48+#define EM_PDP11 65 /* Digital Equipment Corp. PDP-11 */
49 #define EM_FX66 66 /* Siemens FX66 microcontroller */
50 #define EM_ST9PLUS 67 /* STMicroelectronics ST9+ 8/16 mc */
51 #define EM_ST7 68 /* STmicroelectronics ST7 8 bit mc */
52@@ -249,6 +256,22 @@ typedef struct
53 #define EM_OPENRISC 92 /* OpenRISC 32-bit embedded processor */
54 #define EM_ARC_A5 93 /* ARC Cores Tangent-A5 */
55 #define EM_XTENSA 94 /* Tensilica Xtensa Architecture */
56+#define EM_VIDEOCORE 95 /* Alphamosaic VideoCore processor */
57+#define EM_TMM_GPP 96 /* Thompson Multimedia General Purpose Processor */
58+#define EM_NS32K 97 /* National Semiconductor 32000 series */
59+#define EM_TPC 98 /* Tenor Network TPC processor */
60+#define EM_SNP1K 99 /* Trebia SNP 1000 processor */
61+#define EM_ST200 100 /* STMicroelectronics (www.st.com) ST200 microcontroller */
62+#define EM_IP2K 101 /* Ubicom IP2XXX microcontroller family */
63+#define EM_MAX 102 /* MAX Processor */
64+#define EM_CR 103 /* National Semiconductor CompactRISC */
65+#define EM_F2MC16 104 /* Fujitsu F2MC16 */
66+#define EM_MSP430 105 /* TI msp430 micro controller */
67+#define EM_BLACKFIN 106 /* Analog Devices Blackfin (DSP) processor */
68+#define EM_SE_C33 107 /* S1C33 Family of Seiko Epson processors */
69+#define EM_SEP 108 /* Sharp embedded microprocessor */
70+#define EM_ARCA 109 /* Arca RISC Microprocessor */
71+
72 #define EM_AARCH64 183 /* ARM AARCH64 */
73 #define EM_TILEPRO 188 /* Tilera TILEPro */
74 #define EM_MICROBLAZE 189 /* Xilinx MicroBlaze */
75--
761.8.1.2
77
diff --git a/meta/recipes-devtools/elfutils/elfutils-0.158/m4-biarch.m4-tweak-AC_RUN_IFELSE-for-cross-compiling.patch b/meta/recipes-devtools/elfutils/elfutils-0.158/m4-biarch.m4-tweak-AC_RUN_IFELSE-for-cross-compiling.patch
deleted file mode 100644
index 1dbd52d557..0000000000
--- a/meta/recipes-devtools/elfutils/elfutils-0.158/m4-biarch.m4-tweak-AC_RUN_IFELSE-for-cross-compiling.patch
+++ /dev/null
@@ -1,34 +0,0 @@
1m4/biarch.m4: tweak AC_RUN_IFELSE for cross-compiling
2
3Macro: AC_RUN_IFELSE (input,
4 [action-if-true],
5 [action-if-false],
6 [action-if-cross-compiling])
7
8Add the missing [action-if-cross-compiling] part to support
9cross-compiling.
10
11Upstream-Status: inappropriate [oe specific]
12
13Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
14---
15 m4/biarch.m4 | 4 +++-
16 1 file changed, 3 insertions(+), 1 deletion(-)
17
18diff --git a/m4/biarch.m4 b/m4/biarch.m4
19--- a/m4/biarch.m4
20+++ b/m4/biarch.m4
21@@ -40,7 +40,9 @@ AC_CACHE_CHECK([whether $biarch_CC makes executables we can run],
22 save_CC="$CC"
23 CC="$biarch_CC"
24 AC_RUN_IFELSE([AC_LANG_PROGRAM([], [])],
25- utrace_cv_cc_biarch=yes, utrace_cv_cc_biarch=no)
26+ utrace_cv_cc_biarch=yes,
27+ utrace_cv_cc_biarch=no,
28+ utrace_cv_cc_biarch=yes)
29 CC="$save_CC"])], [utrace_cv_cc_biarch=no])
30 AS_IF([test $utrace_cv_cc_biarch != yes], [dnl
31 AC_MSG_WARN([not running biarch tests, $biarch_CC does not work])])])
32--
331.8.1.2
34
diff --git a/meta/recipes-devtools/elfutils/elfutils-0.158/redhat-robustify.diff b/meta/recipes-devtools/elfutils/elfutils-0.158/redhat-robustify.diff
deleted file mode 100644
index f358a85466..0000000000
--- a/meta/recipes-devtools/elfutils/elfutils-0.158/redhat-robustify.diff
+++ /dev/null
@@ -1,1756 +0,0 @@
1--- elfutils/libdwfl/ChangeLog
2+++ elfutils/libdwfl/ChangeLog
3@@ -680,6 +680,11 @@
4 * dwfl_module_getdwarf.c (open_elf): Clear errno before CBFAIL.
5 Reported by Kurt Roeckx <kurt@roeckx.be>.
6
7+2011-03-23 Petr Machata <pmachata@redhat.com>
8+
9+ * relocate.c (relocate_section): Use gelf_fsize instead of relying
10+ on shdr->sh_entsize.
11+
12 2011-02-11 Roland McGrath <roland@redhat.com>
13
14 * linux-kernel-modules.c (try_kernel_name): Try .gz, .bz2, .xz
15--- elfutils/libdwfl/relocate.c
16+++ elfutils/libdwfl/relocate.c
17@@ -1,5 +1,5 @@
18 /* Relocate debug information.
19- Copyright (C) 2005-2010 Red Hat, Inc.
20+ Copyright (C) 2005-2011 Red Hat, Inc.
21 This file is part of elfutils.
22
23 This file is free software; you can redistribute it and/or modify
24@@ -456,7 +456,10 @@ relocate_section (Dwfl_Module *mod, Elf
25 }
26 }
27
28- size_t nrels = shdr->sh_size / shdr->sh_entsize;
29+ size_t sh_entsize
30+ = gelf_fsize (relocated, shdr->sh_type == SHT_REL ? ELF_T_REL : ELF_T_RELA,
31+ 1, EV_CURRENT);
32+ size_t nrels = shdr->sh_size / sh_entsize;
33 size_t complete = 0;
34 if (shdr->sh_type == SHT_REL)
35 for (size_t relidx = 0; !result && relidx < nrels; ++relidx)
36@@ -558,7 +561,7 @@ relocate_section (Dwfl_Module *mod, Elf
37 nrels = next;
38 }
39
40- shdr->sh_size = reldata->d_size = nrels * shdr->sh_entsize;
41+ shdr->sh_size = reldata->d_size = nrels * sh_entsize;
42 gelf_update_shdr (scn, shdr);
43 }
44
45--- elfutils/libelf/ChangeLog
46+++ elfutils/libelf/ChangeLog
47@@ -754,10 +754,53 @@
48 If section content hasn't been read yet, do it before looking for the
49 block size. If no section data present, infer size of section header.
50
51+2005-05-14 Jakub Jelinek <jakub@redhat.com>
52+
53+ * libelfP.h (INVALID_NDX): Define.
54+ * gelf_getdyn.c (gelf_getdyn): Use it. Remove ndx < 0 test if any.
55+ * gelf_getlib.c (gelf_getlib): Likewise.
56+ * gelf_getmove.c (gelf_getmove): Likewise.
57+ * gelf_getrel.c (gelf_getrel): Likewise.
58+ * gelf_getrela.c (gelf_getrela): Likewise.
59+ * gelf_getsym.c (gelf_getsym): Likewise.
60+ * gelf_getsyminfo.c (gelf_getsyminfo): Likewise.
61+ * gelf_getsymshndx.c (gelf_getsymshndx): Likewise.
62+ * gelf_getversym.c (gelf_getversym): Likewise.
63+ * gelf_update_dyn.c (gelf_update_dyn): Likewise.
64+ * gelf_update_lib.c (gelf_update_lib): Likewise.
65+ * gelf_update_move.c (gelf_update_move): Likewise.
66+ * gelf_update_rel.c (gelf_update_rel): Likewise.
67+ * gelf_update_rela.c (gelf_update_rela): Likewise.
68+ * gelf_update_sym.c (gelf_update_sym): Likewise.
69+ * gelf_update_syminfo.c (gelf_update_syminfo): Likewise.
70+ * gelf_update_symshndx.c (gelf_update_symshndx): Likewise.
71+ * gelf_update_versym.c (gelf_update_versym): Likewise.
72+ * elf_newscn.c (elf_newscn): Check for overflow.
73+ * elf32_updatefile.c (__elfw2(LIBELFBITS,updatemmap)): Likewise.
74+ (__elfw2(LIBELFBITS,updatefile)): Likewise.
75+ * elf_begin.c (file_read_elf): Likewise.
76+ * elf32_newphdr.c (elfw2(LIBELFBITS,newphdr)): Likewise.
77+ * elf_getarsym.c (elf_getarsym): Likewise.
78+ * elf32_getshdr.c (elfw2(LIBELFBITS,getshdr)): Likewise.
79 2005-05-11 Ulrich Drepper <drepper@redhat.com>
80
81 * elf.h: Update again.
82
83+2005-05-17 Jakub Jelinek <jakub@redhat.com>
84+
85+ * elf32_getphdr.c (elfw2(LIBELFBITS,getphdr)): Check if program header
86+ table fits into object's bounds.
87+ * elf_getshstrndx.c (elf_getshstrndx): Add elf->start_offset to
88+ elf->map_address. Check if first section header fits into object's
89+ bounds.
90+ * elf32_getshdr.c (elfw2(LIBELFBITS,getshdr)):
91+ Check if section header table fits into object's bounds.
92+ * elf_begin.c (get_shnum): Ensure section headers fits into
93+ object's bounds.
94+ (file_read_elf): Make sure scncnt is small enough to allocate both
95+ ElfXX_Shdr and Elf_Scn array. Make sure section and program header
96+ tables fit into object's bounds. Avoid memory leak on failure.
97+
98 2005-05-09 Ulrich Drepper <drepper@redhat.com>
99
100 * elf.h: Update from glibc.
101--- elfutils/libelf/elf32_getphdr.c
102+++ elfutils/libelf/elf32_getphdr.c
103@@ -93,6 +93,16 @@ __elfw2(LIBELFBITS,getphdr_wrlock) (elf)
104
105 if (elf->map_address != NULL)
106 {
107+ /* First see whether the information in the ELF header is
108+ valid and it does not ask for too much. */
109+ if (unlikely (ehdr->e_phoff >= elf->maximum_size)
110+ || unlikely (elf->maximum_size - ehdr->e_phoff < size))
111+ {
112+ /* Something is wrong. */
113+ __libelf_seterrno (ELF_E_INVALID_PHDR);
114+ goto out;
115+ }
116+
117 /* All the data is already mapped. Use it. */
118 void *file_phdr = ((char *) elf->map_address
119 + elf->start_offset + ehdr->e_phoff);
120--- elfutils/libelf/elf32_getshdr.c
121+++ elfutils/libelf/elf32_getshdr.c
122@@ -60,7 +60,8 @@ load_shdr_wrlock (Elf_Scn *scn)
123 goto out;
124
125 size_t shnum;
126- if (__elf_getshdrnum_rdlock (elf, &shnum) != 0)
127+ if (__elf_getshdrnum_rdlock (elf, &shnum) != 0
128+ || shnum > SIZE_MAX / sizeof (ElfW2(LIBELFBITS,Shdr)))
129 goto out;
130 size_t size = shnum * sizeof (ElfW2(LIBELFBITS,Shdr));
131
132@@ -77,6 +78,16 @@ load_shdr_wrlock (Elf_Scn *scn)
133
134 if (elf->map_address != NULL)
135 {
136+ /* First see whether the information in the ELF header is
137+ valid and it does not ask for too much. */
138+ if (unlikely (ehdr->e_shoff >= elf->maximum_size)
139+ || unlikely (elf->maximum_size - ehdr->e_shoff < size))
140+ {
141+ /* Something is wrong. */
142+ __libelf_seterrno (ELF_E_INVALID_SECTION_HEADER);
143+ goto free_and_out;
144+ }
145+
146 ElfW2(LIBELFBITS,Shdr) *notcvt;
147
148 /* All the data is already mapped. If we could use it
149--- elfutils/libelf/elf32_newphdr.c
150+++ elfutils/libelf/elf32_newphdr.c
151@@ -114,6 +114,12 @@ elfw2(LIBELFBITS,newphdr) (elf, count)
152 || count == PN_XNUM
153 || elf->state.ELFW(elf,LIBELFBITS).phdr == NULL)
154 {
155+ if (unlikely (count > SIZE_MAX / sizeof (ElfW2(LIBELFBITS,Phdr))))
156+ {
157+ result = NULL;
158+ goto out;
159+ }
160+
161 /* Allocate a new program header with the appropriate number of
162 elements. */
163 result = (ElfW2(LIBELFBITS,Phdr) *)
164--- elfutils/libelf/elf32_updatefile.c
165+++ elfutils/libelf/elf32_updatefile.c
166@@ -202,6 +202,9 @@ __elfw2(LIBELFBITS,updatemmap) (Elf *elf
167 /* Write all the sections. Well, only those which are modified. */
168 if (shnum > 0)
169 {
170+ if (unlikely (shnum > SIZE_MAX / sizeof (Elf_Scn *)))
171+ return 1;
172+
173 Elf_ScnList *list = &elf->state.ELFW(elf,LIBELFBITS).scns;
174 Elf_Scn **scns = (Elf_Scn **) alloca (shnum * sizeof (Elf_Scn *));
175 char *const shdr_start = ((char *) elf->map_address + elf->start_offset
176@@ -624,6 +627,10 @@ __elfw2(LIBELFBITS,updatefile) (Elf *elf
177 /* Write all the sections. Well, only those which are modified. */
178 if (shnum > 0)
179 {
180+ if (unlikely (shnum > SIZE_MAX / (sizeof (Elf_Scn *)
181+ + sizeof (ElfW2(LIBELFBITS,Shdr)))))
182+ return 1;
183+
184 off_t shdr_offset = elf->start_offset + ehdr->e_shoff;
185 #if EV_NUM != 2
186 xfct_t shdr_fctp = __elf_xfctstom[__libelf_version - 1][EV_CURRENT - 1][ELFW(ELFCLASS, LIBELFBITS) - 1][ELF_T_SHDR];
187--- elfutils/libelf/elf_begin.c
188+++ elfutils/libelf/elf_begin.c
189@@ -144,7 +144,8 @@ get_shnum (void *map_address, unsigned c
190
191 if (unlikely (result == 0) && ehdr.e32->e_shoff != 0)
192 {
193- if (ehdr.e32->e_shoff + sizeof (Elf32_Shdr) > maxsize)
194+ if (unlikely (ehdr.e32->e_shoff >= maxsize)
195+ || unlikely (maxsize - ehdr.e32->e_shoff < sizeof (Elf32_Shdr)))
196 /* Cannot read the first section header. */
197 return 0;
198
199@@ -192,7 +193,8 @@ get_shnum (void *map_address, unsigned c
200
201 if (unlikely (result == 0) && ehdr.e64->e_shoff != 0)
202 {
203- if (ehdr.e64->e_shoff + sizeof (Elf64_Shdr) > maxsize)
204+ if (unlikely (ehdr.e64->e_shoff >= maxsize)
205+ || unlikely (ehdr.e64->e_shoff + sizeof (Elf64_Shdr) > maxsize))
206 /* Cannot read the first section header. */
207 return 0;
208
209@@ -264,6 +266,15 @@ file_read_elf (int fildes, void *map_add
210 /* Could not determine the number of sections. */
211 return NULL;
212
213+ /* Check for too many sections. */
214+ if (e_ident[EI_CLASS] == ELFCLASS32)
215+ {
216+ if (scncnt > SIZE_MAX / (sizeof (Elf_Scn) + sizeof (Elf32_Shdr)))
217+ return NULL;
218+ }
219+ else if (scncnt > SIZE_MAX / (sizeof (Elf_Scn) + sizeof (Elf64_Shdr)))
220+ return NULL;
221+
222 /* We can now allocate the memory. Even if there are no section headers,
223 we allocate space for a zeroth section in case we need it later. */
224 const size_t scnmax = (scncnt ?: (cmd == ELF_C_RDWR || cmd == ELF_C_RDWR_MMAP)
225@@ -303,6 +314,16 @@ file_read_elf (int fildes, void *map_add
226 {
227 /* We can use the mmapped memory. */
228 elf->state.elf32.ehdr = ehdr;
229+
230+ if (unlikely (ehdr->e_shoff >= maxsize)
231+ || unlikely (maxsize - ehdr->e_shoff
232+ < scncnt * sizeof (Elf32_Shdr)))
233+ {
234+ free_and_out:
235+ free (elf);
236+ __libelf_seterrno (ELF_E_INVALID_FILE);
237+ return NULL;
238+ }
239 elf->state.elf32.shdr
240 = (Elf32_Shdr *) ((char *) ehdr + ehdr->e_shoff);
241
242@@ -389,6 +410,11 @@ file_read_elf (int fildes, void *map_add
243 {
244 /* We can use the mmapped memory. */
245 elf->state.elf64.ehdr = ehdr;
246+
247+ if (unlikely (ehdr->e_shoff >= maxsize)
248+ || unlikely (ehdr->e_shoff
249+ + scncnt * sizeof (Elf32_Shdr) > maxsize))
250+ goto free_and_out;
251 elf->state.elf64.shdr
252 = (Elf64_Shdr *) ((char *) ehdr + ehdr->e_shoff);
253
254--- elfutils/libelf/elf_getarsym.c
255+++ elfutils/libelf/elf_getarsym.c
256@@ -183,6 +183,9 @@ elf_getarsym (elf, ptr)
257 size_t index_size = atol (tmpbuf);
258
259 if (SARMAG + sizeof (struct ar_hdr) + index_size > elf->maximum_size
260+#if SIZE_MAX <= 4294967295U
261+ || n >= SIZE_MAX / sizeof (Elf_Arsym)
262+#endif
263 || n * w > index_size)
264 {
265 /* This index table cannot be right since it does not fit into
266--- elfutils/libelf/elf_getshdrstrndx.c
267+++ elfutils/libelf/elf_getshdrstrndx.c
268@@ -104,10 +104,25 @@ elf_getshdrstrndx (elf, dst)
269 if (elf->map_address != NULL
270 && elf->state.elf32.ehdr->e_ident[EI_DATA] == MY_ELFDATA
271 && (ALLOW_UNALIGNED
272- || (((size_t) ((char *) elf->map_address + offset))
273+ || (((size_t) ((char *) elf->map_address
274+ + elf->start_offset + offset))
275 & (__alignof__ (Elf32_Shdr) - 1)) == 0))
276- /* We can directly access the memory. */
277- num = ((Elf32_Shdr *) (elf->map_address + offset))->sh_link;
278+ {
279+ /* First see whether the information in the ELF header is
280+ valid and it does not ask for too much. */
281+ if (unlikely (elf->maximum_size - offset
282+ < sizeof (Elf32_Shdr)))
283+ {
284+ /* Something is wrong. */
285+ __libelf_seterrno (ELF_E_INVALID_SECTION_HEADER);
286+ result = -1;
287+ goto out;
288+ }
289+
290+ /* We can directly access the memory. */
291+ num = ((Elf32_Shdr *) (elf->map_address + elf->start_offset
292+ + offset))->sh_link;
293+ }
294 else
295 {
296 /* We avoid reading in all the section headers. Just read
297@@ -142,10 +157,25 @@ elf_getshdrstrndx (elf, dst)
298 if (elf->map_address != NULL
299 && elf->state.elf64.ehdr->e_ident[EI_DATA] == MY_ELFDATA
300 && (ALLOW_UNALIGNED
301- || (((size_t) ((char *) elf->map_address + offset))
302+ || (((size_t) ((char *) elf->map_address
303+ + elf->start_offset + offset))
304 & (__alignof__ (Elf64_Shdr) - 1)) == 0))
305- /* We can directly access the memory. */
306- num = ((Elf64_Shdr *) (elf->map_address + offset))->sh_link;
307+ {
308+ /* First see whether the information in the ELF header is
309+ valid and it does not ask for too much. */
310+ if (unlikely (elf->maximum_size - offset
311+ < sizeof (Elf64_Shdr)))
312+ {
313+ /* Something is wrong. */
314+ __libelf_seterrno (ELF_E_INVALID_SECTION_HEADER);
315+ result = -1;
316+ goto out;
317+ }
318+
319+ /* We can directly access the memory. */
320+ num = ((Elf64_Shdr *) (elf->map_address + elf->start_offset
321+ + offset))->sh_link;
322+ }
323 else
324 {
325 /* We avoid reading in all the section headers. Just read
326--- elfutils/libelf/elf_newscn.c
327+++ elfutils/libelf/elf_newscn.c
328@@ -83,10 +83,18 @@ elf_newscn (elf)
329 else
330 {
331 /* We must allocate a new element. */
332- Elf_ScnList *newp;
333+ Elf_ScnList *newp = NULL;
334
335 assert (elf->state.elf.scnincr > 0);
336
337+ if (
338+#if SIZE_MAX <= 4294967295U
339+ likely (elf->state.elf.scnincr
340+ < SIZE_MAX / 2 / sizeof (Elf_Scn) - sizeof (Elf_ScnList))
341+#else
342+ 1
343+#endif
344+ )
345 newp = (Elf_ScnList *) calloc (sizeof (Elf_ScnList)
346 + ((elf->state.elf.scnincr *= 2)
347 * sizeof (Elf_Scn)), 1);
348--- elfutils/libelf/gelf_getdyn.c
349+++ elfutils/libelf/gelf_getdyn.c
350@@ -1,5 +1,5 @@
351 /* Get information from dynamic table at the given index.
352- Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
353+ Copyright (C) 2000-2009 Red Hat, Inc.
354 This file is part of elfutils.
355 Written by Ulrich Drepper <drepper@redhat.com>, 2000.
356
357@@ -72,7 +72,7 @@ gelf_getdyn (data, ndx, dst)
358 table entries has to be adopted. The user better has provided
359 a buffer where we can store the information. While copying the
360 data we are converting the format. */
361- if (unlikely ((ndx + 1) * sizeof (Elf32_Dyn) > data_scn->d.d_size))
362+ if (INVALID_NDX (ndx, Elf32_Dyn, &data_scn->d))
363 {
364 __libelf_seterrno (ELF_E_INVALID_INDEX);
365 goto out;
366@@ -93,7 +93,7 @@ gelf_getdyn (data, ndx, dst)
367
368 /* The data is already in the correct form. Just make sure the
369 index is OK. */
370- if (unlikely ((ndx + 1) * sizeof (GElf_Dyn) > data_scn->d.d_size))
371+ if (INVALID_NDX (ndx, GElf_Dyn, &data_scn->d))
372 {
373 __libelf_seterrno (ELF_E_INVALID_INDEX);
374 goto out;
375--- elfutils/libelf/gelf_getlib.c
376+++ elfutils/libelf/gelf_getlib.c
377@@ -1,5 +1,5 @@
378 /* Get library from table at the given index.
379- Copyright (C) 2004 Red Hat, Inc.
380+ Copyright (C) 2004-2009 Red Hat, Inc.
381 This file is part of elfutils.
382 Written by Ulrich Drepper <drepper@redhat.com>, 2004.
383
384@@ -65,7 +65,7 @@ gelf_getlib (data, ndx, dst)
385 /* The data is already in the correct form. Just make sure the
386 index is OK. */
387 GElf_Lib *result = NULL;
388- if (unlikely ((ndx + 1) * sizeof (GElf_Lib) > data->d_size))
389+ if (INVALID_NDX (ndx, GElf_Lib, data))
390 __libelf_seterrno (ELF_E_INVALID_INDEX);
391 else
392 {
393--- elfutils/libelf/gelf_getmove.c
394+++ elfutils/libelf/gelf_getmove.c
395@@ -1,5 +1,5 @@
396 /* Get move structure at the given index.
397- Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
398+ Copyright (C) 2000-2009 Red Hat, Inc.
399 This file is part of elfutils.
400 Written by Ulrich Drepper <drepper@redhat.com>, 2000.
401
402@@ -62,7 +62,7 @@ gelf_getmove (data, ndx, dst)
403
404 /* The data is already in the correct form. Just make sure the
405 index is OK. */
406- if (unlikely ((ndx + 1) * sizeof (GElf_Move) > data->d_size))
407+ if (INVALID_NDX (ndx, GElf_Move, data))
408 {
409 __libelf_seterrno (ELF_E_INVALID_INDEX);
410 goto out;
411--- elfutils/libelf/gelf_getrela.c
412+++ elfutils/libelf/gelf_getrela.c
413@@ -1,5 +1,5 @@
414 /* Get RELA relocation information at given index.
415- Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
416+ Copyright (C) 2000-2009 Red Hat, Inc.
417 This file is part of elfutils.
418 Written by Ulrich Drepper <drepper@redhat.com>, 2000.
419
420@@ -50,12 +50,6 @@ gelf_getrela (data, ndx, dst)
421 if (data_scn == NULL)
422 return NULL;
423
424- if (unlikely (ndx < 0))
425- {
426- __libelf_seterrno (ELF_E_INVALID_INDEX);
427- return NULL;
428- }
429-
430 if (unlikely (data_scn->d.d_type != ELF_T_RELA))
431 {
432 __libelf_seterrno (ELF_E_INVALID_HANDLE);
433@@ -72,7 +66,7 @@ gelf_getrela (data, ndx, dst)
434 if (scn->elf->class == ELFCLASS32)
435 {
436 /* We have to convert the data. */
437- if (unlikely ((ndx + 1) * sizeof (Elf32_Rela) > data_scn->d.d_size))
438+ if (INVALID_NDX (ndx, Elf32_Rela, &data_scn->d))
439 {
440 __libelf_seterrno (ELF_E_INVALID_INDEX);
441 result = NULL;
442@@ -93,7 +87,7 @@ gelf_getrela (data, ndx, dst)
443 {
444 /* Simply copy the data after we made sure we are actually getting
445 correct data. */
446- if (unlikely ((ndx + 1) * sizeof (Elf64_Rela) > data_scn->d.d_size))
447+ if (INVALID_NDX (ndx, Elf64_Rela, &data_scn->d))
448 {
449 __libelf_seterrno (ELF_E_INVALID_INDEX);
450 result = NULL;
451--- elfutils/libelf/gelf_getrel.c
452+++ elfutils/libelf/gelf_getrel.c
453@@ -1,5 +1,5 @@
454 /* Get REL relocation information at given index.
455- Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
456+ Copyright (C) 2000-2009 Red Hat, Inc.
457 This file is part of elfutils.
458 Written by Ulrich Drepper <drepper@redhat.com>, 2000.
459
460@@ -50,12 +50,6 @@ gelf_getrel (data, ndx, dst)
461 if (data_scn == NULL)
462 return NULL;
463
464- if (unlikely (ndx < 0))
465- {
466- __libelf_seterrno (ELF_E_INVALID_INDEX);
467- return NULL;
468- }
469-
470 if (unlikely (data_scn->d.d_type != ELF_T_REL))
471 {
472 __libelf_seterrno (ELF_E_INVALID_HANDLE);
473@@ -72,7 +66,7 @@ gelf_getrel (data, ndx, dst)
474 if (scn->elf->class == ELFCLASS32)
475 {
476 /* We have to convert the data. */
477- if (unlikely ((ndx + 1) * sizeof (Elf32_Rel) > data_scn->d.d_size))
478+ if (INVALID_NDX (ndx, Elf32_Rel, &data_scn->d))
479 {
480 __libelf_seterrno (ELF_E_INVALID_INDEX);
481 result = NULL;
482@@ -92,7 +86,7 @@ gelf_getrel (data, ndx, dst)
483 {
484 /* Simply copy the data after we made sure we are actually getting
485 correct data. */
486- if (unlikely ((ndx + 1) * sizeof (Elf64_Rel) > data_scn->d.d_size))
487+ if (INVALID_NDX (ndx, Elf64_Rel, &data_scn->d))
488 {
489 __libelf_seterrno (ELF_E_INVALID_INDEX);
490 result = NULL;
491--- elfutils/libelf/gelf_getsym.c
492+++ elfutils/libelf/gelf_getsym.c
493@@ -1,5 +1,5 @@
494 /* Get symbol information from symbol table at the given index.
495- Copyright (C) 1999, 2000, 2001, 2002 Red Hat, Inc.
496+ Copyright (C) 1999-2009 Red Hat, Inc.
497 This file is part of elfutils.
498 Written by Ulrich Drepper <drepper@redhat.com>, 1999.
499
500@@ -69,7 +69,7 @@ gelf_getsym (data, ndx, dst)
501 table entries has to be adopted. The user better has provided
502 a buffer where we can store the information. While copying the
503 data we are converting the format. */
504- if (unlikely ((ndx + 1) * sizeof (Elf32_Sym) > data->d_size))
505+ if (INVALID_NDX (ndx, Elf32_Sym, data))
506 {
507 __libelf_seterrno (ELF_E_INVALID_INDEX);
508 goto out;
509@@ -98,7 +98,7 @@ gelf_getsym (data, ndx, dst)
510
511 /* The data is already in the correct form. Just make sure the
512 index is OK. */
513- if (unlikely ((ndx + 1) * sizeof (GElf_Sym) > data->d_size))
514+ if (INVALID_NDX (ndx, GElf_Sym, data))
515 {
516 __libelf_seterrno (ELF_E_INVALID_INDEX);
517 goto out;
518--- elfutils/libelf/gelf_getsyminfo.c
519+++ elfutils/libelf/gelf_getsyminfo.c
520@@ -1,5 +1,5 @@
521 /* Get additional symbol information from symbol table at the given index.
522- Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
523+ Copyright (C) 2000-2009 Red Hat, Inc.
524 This file is part of elfutils.
525 Written by Ulrich Drepper <drepper@redhat.com>, 2000.
526
527@@ -63,7 +63,7 @@ gelf_getsyminfo (data, ndx, dst)
528
529 /* The data is already in the correct form. Just make sure the
530 index is OK. */
531- if (unlikely ((ndx + 1) * sizeof (GElf_Syminfo) > data->d_size))
532+ if (INVALID_NDX (ndx, GElf_Syminfo, data))
533 {
534 __libelf_seterrno (ELF_E_INVALID_INDEX);
535 goto out;
536--- elfutils/libelf/gelf_getsymshndx.c
537+++ elfutils/libelf/gelf_getsymshndx.c
538@@ -1,6 +1,6 @@
539 /* Get symbol information and separate section index from symbol table
540 at the given index.
541- Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
542+ Copyright (C) 2000-2009 Red Hat, Inc.
543 This file is part of elfutils.
544 Written by Ulrich Drepper <drepper@redhat.com>, 2000.
545
546@@ -69,7 +69,7 @@ gelf_getsymshndx (symdata, shndxdata, nd
547 section index table. */
548 if (likely (shndxdata_scn != NULL))
549 {
550- if (unlikely ((ndx + 1) * sizeof (Elf32_Word) > shndxdata_scn->d.d_size))
551+ if (INVALID_NDX (ndx, Elf32_Word, &shndxdata_scn->d))
552 {
553 __libelf_seterrno (ELF_E_INVALID_INDEX);
554 goto out;
555@@ -89,7 +89,7 @@ gelf_getsymshndx (symdata, shndxdata, nd
556 table entries has to be adopted. The user better has provided
557 a buffer where we can store the information. While copying the
558 data we are converting the format. */
559- if (unlikely ((ndx + 1) * sizeof (Elf32_Sym) > symdata->d_size))
560+ if (INVALID_NDX (ndx, Elf32_Sym, symdata))
561 {
562 __libelf_seterrno (ELF_E_INVALID_INDEX);
563 goto out;
564@@ -118,7 +118,7 @@ gelf_getsymshndx (symdata, shndxdata, nd
565
566 /* The data is already in the correct form. Just make sure the
567 index is OK. */
568- if (unlikely ((ndx + 1) * sizeof (GElf_Sym) > symdata->d_size))
569+ if (INVALID_NDX (ndx, GElf_Sym, symdata))
570 {
571 __libelf_seterrno (ELF_E_INVALID_INDEX);
572 goto out;
573--- elfutils/libelf/gelf_getversym.c
574+++ elfutils/libelf/gelf_getversym.c
575@@ -1,5 +1,5 @@
576 /* Get symbol version information at the given index.
577- Copyright (C) 1999, 2000, 2001, 2002 Red Hat, Inc.
578+ Copyright (C) 1999-2009 Red Hat, Inc.
579 This file is part of elfutils.
580 Written by Ulrich Drepper <drepper@redhat.com>, 1999.
581
582@@ -71,7 +71,7 @@ gelf_getversym (data, ndx, dst)
583
584 /* The data is already in the correct form. Just make sure the
585 index is OK. */
586- if (unlikely ((ndx + 1) * sizeof (GElf_Versym) > data->d_size))
587+ if (INVALID_NDX (ndx, GElf_Versym, data))
588 {
589 __libelf_seterrno (ELF_E_INVALID_INDEX);
590 result = NULL;
591--- elfutils/libelf/gelf_update_dyn.c
592+++ elfutils/libelf/gelf_update_dyn.c
593@@ -1,5 +1,5 @@
594 /* Update information in dynamic table at the given index.
595- Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
596+ Copyright (C) 2000-2009 Red Hat, Inc.
597 This file is part of elfutils.
598 Written by Ulrich Drepper <drepper@redhat.com>, 2000.
599
600@@ -50,12 +50,6 @@ gelf_update_dyn (data, ndx, src)
601 if (data == NULL)
602 return 0;
603
604- if (unlikely (ndx < 0))
605- {
606- __libelf_seterrno (ELF_E_INVALID_INDEX);
607- return 0;
608- }
609-
610 if (unlikely (data_scn->d.d_type != ELF_T_DYN))
611 {
612 /* The type of the data better should match. */
613@@ -81,7 +75,7 @@ gelf_update_dyn (data, ndx, src)
614 }
615
616 /* Check whether we have to resize the data buffer. */
617- if (unlikely ((ndx + 1) * sizeof (Elf32_Dyn) > data_scn->d.d_size))
618+ if (INVALID_NDX (ndx, Elf32_Dyn, &data_scn->d))
619 {
620 __libelf_seterrno (ELF_E_INVALID_INDEX);
621 goto out;
622@@ -95,7 +89,7 @@ gelf_update_dyn (data, ndx, src)
623 else
624 {
625 /* Check whether we have to resize the data buffer. */
626- if (unlikely ((ndx + 1) * sizeof (Elf64_Dyn) > data_scn->d.d_size))
627+ if (INVALID_NDX (ndx, Elf64_Dyn, &data_scn->d))
628 {
629 __libelf_seterrno (ELF_E_INVALID_INDEX);
630 goto out;
631--- elfutils/libelf/gelf_update_lib.c
632+++ elfutils/libelf/gelf_update_lib.c
633@@ -1,5 +1,5 @@
634 /* Update library in table at the given index.
635- Copyright (C) 2004 Red Hat, Inc.
636+ Copyright (C) 2004-2009 Red Hat, Inc.
637 This file is part of elfutils.
638 Written by Ulrich Drepper <drepper@redhat.com>, 2004.
639
640@@ -47,12 +47,6 @@ gelf_update_lib (data, ndx, src)
641 if (data == NULL)
642 return 0;
643
644- if (unlikely (ndx < 0))
645- {
646- __libelf_seterrno (ELF_E_INVALID_INDEX);
647- return 0;
648- }
649-
650 Elf_Data_Scn *data_scn = (Elf_Data_Scn *) data;
651 if (unlikely (data_scn->d.d_type != ELF_T_LIB))
652 {
653@@ -66,7 +60,7 @@ gelf_update_lib (data, ndx, src)
654
655 /* Check whether we have to resize the data buffer. */
656 int result = 0;
657- if (unlikely ((ndx + 1) * sizeof (Elf64_Lib) > data_scn->d.d_size))
658+ if (INVALID_NDX (ndx, Elf64_Lib, &data_scn->d))
659 __libelf_seterrno (ELF_E_INVALID_INDEX);
660 else
661 {
662--- elfutils/libelf/gelf_update_move.c
663+++ elfutils/libelf/gelf_update_move.c
664@@ -1,5 +1,5 @@
665 /* Update move structure at the given index.
666- Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
667+ Copyright (C) 2000-2009 Red Hat, Inc.
668 This file is part of elfutils.
669 Written by Ulrich Drepper <drepper@redhat.com>, 2000.
670
671@@ -54,8 +54,7 @@ gelf_update_move (data, ndx, src)
672 assert (sizeof (GElf_Move) == sizeof (Elf64_Move));
673
674 /* Check whether we have to resize the data buffer. */
675- if (unlikely (ndx < 0)
676- || unlikely ((ndx + 1) * sizeof (GElf_Move) > data_scn->d.d_size))
677+ if (INVALID_NDX (ndx, GElf_Move, &data_scn->d))
678 {
679 __libelf_seterrno (ELF_E_INVALID_INDEX);
680 return 0;
681--- elfutils/libelf/gelf_update_rela.c
682+++ elfutils/libelf/gelf_update_rela.c
683@@ -1,5 +1,5 @@
684 /* Update RELA relocation information at given index.
685- Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
686+ Copyright (C) 2000-2009 Red Hat, Inc.
687 This file is part of elfutils.
688 Written by Ulrich Drepper <drepper@redhat.com>, 2000.
689
690@@ -47,12 +47,6 @@ gelf_update_rela (Elf_Data *dst, int ndx
691 if (dst == NULL)
692 return 0;
693
694- if (unlikely (ndx < 0))
695- {
696- __libelf_seterrno (ELF_E_INVALID_INDEX);
697- return 0;
698- }
699-
700 if (unlikely (data_scn->d.d_type != ELF_T_RELA))
701 {
702 /* The type of the data better should match. */
703@@ -80,7 +74,7 @@ gelf_update_rela (Elf_Data *dst, int ndx
704 }
705
706 /* Check whether we have to resize the data buffer. */
707- if (unlikely ((ndx + 1) * sizeof (Elf32_Rela) > data_scn->d.d_size))
708+ if (INVALID_NDX (ndx, Elf32_Rela, &data_scn->d))
709 {
710 __libelf_seterrno (ELF_E_INVALID_INDEX);
711 goto out;
712@@ -96,7 +90,7 @@ gelf_update_rela (Elf_Data *dst, int ndx
713 else
714 {
715 /* Check whether we have to resize the data buffer. */
716- if (unlikely ((ndx + 1) * sizeof (Elf64_Rela) > data_scn->d.d_size))
717+ if (INVALID_NDX (ndx, Elf64_Rela, &data_scn->d))
718 {
719 __libelf_seterrno (ELF_E_INVALID_INDEX);
720 goto out;
721--- elfutils/libelf/gelf_update_rel.c
722+++ elfutils/libelf/gelf_update_rel.c
723@@ -1,5 +1,5 @@
724 /* Update REL relocation information at given index.
725- Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
726+ Copyright (C) 2000-2009 Red Hat, Inc.
727 This file is part of elfutils.
728 Written by Ulrich Drepper <drepper@redhat.com>, 2000.
729
730@@ -47,12 +47,6 @@ gelf_update_rel (Elf_Data *dst, int ndx,
731 if (dst == NULL)
732 return 0;
733
734- if (unlikely (ndx < 0))
735- {
736- __libelf_seterrno (ELF_E_INVALID_INDEX);
737- return 0;
738- }
739-
740 if (unlikely (data_scn->d.d_type != ELF_T_REL))
741 {
742 /* The type of the data better should match. */
743@@ -78,7 +72,7 @@ gelf_update_rel (Elf_Data *dst, int ndx,
744 }
745
746 /* Check whether we have to resize the data buffer. */
747- if (unlikely ((ndx + 1) * sizeof (Elf32_Rel) > data_scn->d.d_size))
748+ if (INVALID_NDX (ndx, Elf32_Rel, &data_scn->d))
749 {
750 __libelf_seterrno (ELF_E_INVALID_INDEX);
751 goto out;
752@@ -93,7 +87,7 @@ gelf_update_rel (Elf_Data *dst, int ndx,
753 else
754 {
755 /* Check whether we have to resize the data buffer. */
756- if (unlikely ((ndx + 1) * sizeof (Elf64_Rel) > data_scn->d.d_size))
757+ if (INVALID_NDX (ndx, Elf64_Rel, &data_scn->d))
758 {
759 __libelf_seterrno (ELF_E_INVALID_INDEX);
760 goto out;
761--- elfutils/libelf/gelf_update_sym.c
762+++ elfutils/libelf/gelf_update_sym.c
763@@ -1,5 +1,5 @@
764 /* Update symbol information in symbol table at the given index.
765- Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
766+ Copyright (C) 2000-2009 Red Hat, Inc.
767 This file is part of elfutils.
768 Written by Ulrich Drepper <drepper@redhat.com>, 2000.
769
770@@ -51,12 +51,6 @@ gelf_update_sym (data, ndx, src)
771 if (data == NULL)
772 return 0;
773
774- if (unlikely (ndx < 0))
775- {
776- __libelf_seterrno (ELF_E_INVALID_INDEX);
777- return 0;
778- }
779-
780 if (unlikely (data_scn->d.d_type != ELF_T_SYM))
781 {
782 /* The type of the data better should match. */
783@@ -81,7 +75,7 @@ gelf_update_sym (data, ndx, src)
784 }
785
786 /* Check whether we have to resize the data buffer. */
787- if (unlikely ((ndx + 1) * sizeof (Elf32_Sym) > data_scn->d.d_size))
788+ if (INVALID_NDX (ndx, Elf32_Sym, &data_scn->d))
789 {
790 __libelf_seterrno (ELF_E_INVALID_INDEX);
791 goto out;
792@@ -104,7 +98,7 @@ gelf_update_sym (data, ndx, src)
793 else
794 {
795 /* Check whether we have to resize the data buffer. */
796- if (unlikely ((ndx + 1) * sizeof (Elf64_Sym) > data_scn->d.d_size))
797+ if (INVALID_NDX (ndx, Elf64_Sym, &data_scn->d))
798 {
799 __libelf_seterrno (ELF_E_INVALID_INDEX);
800 goto out;
801--- elfutils/libelf/gelf_update_syminfo.c
802+++ elfutils/libelf/gelf_update_syminfo.c
803@@ -1,5 +1,5 @@
804 /* Update additional symbol information in symbol table at the given index.
805- Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
806+ Copyright (C) 2000-2009 Red Hat, Inc.
807 This file is part of elfutils.
808 Written by Ulrich Drepper <drepper@redhat.com>, 2000.
809
810@@ -51,12 +51,6 @@ gelf_update_syminfo (data, ndx, src)
811 if (data == NULL)
812 return 0;
813
814- if (unlikely (ndx < 0))
815- {
816- __libelf_seterrno (ELF_E_INVALID_INDEX);
817- return 0;
818- }
819-
820 if (unlikely (data_scn->d.d_type != ELF_T_SYMINFO))
821 {
822 /* The type of the data better should match. */
823@@ -72,7 +66,7 @@ gelf_update_syminfo (data, ndx, src)
824 rwlock_wrlock (scn->elf->lock);
825
826 /* Check whether we have to resize the data buffer. */
827- if (unlikely ((ndx + 1) * sizeof (GElf_Syminfo) > data_scn->d.d_size))
828+ if (INVALID_NDX (ndx, GElf_Syminfo, &data_scn->d))
829 {
830 __libelf_seterrno (ELF_E_INVALID_INDEX);
831 goto out;
832--- elfutils/libelf/gelf_update_symshndx.c
833+++ elfutils/libelf/gelf_update_symshndx.c
834@@ -1,6 +1,6 @@
835 /* Update symbol information and section index in symbol table at the
836 given index.
837- Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
838+ Copyright (C) 2000-2009 Red Hat, Inc.
839 This file is part of elfutils.
840 Written by Ulrich Drepper <drepper@redhat.com>, 2000.
841
842@@ -56,12 +56,6 @@ gelf_update_symshndx (symdata, shndxdata
843 if (symdata == NULL)
844 return 0;
845
846- if (unlikely (ndx < 0))
847- {
848- __libelf_seterrno (ELF_E_INVALID_INDEX);
849- return 0;
850- }
851-
852 if (unlikely (symdata_scn->d.d_type != ELF_T_SYM))
853 {
854 /* The type of the data better should match. */
855@@ -107,7 +101,7 @@ gelf_update_symshndx (symdata, shndxdata
856 }
857
858 /* Check whether we have to resize the data buffer. */
859- if (unlikely ((ndx + 1) * sizeof (Elf32_Sym) > symdata_scn->d.d_size))
860+ if (INVALID_NDX (ndx, Elf32_Sym, &symdata_scn->d))
861 {
862 __libelf_seterrno (ELF_E_INVALID_INDEX);
863 goto out;
864@@ -130,7 +124,7 @@ gelf_update_symshndx (symdata, shndxdata
865 else
866 {
867 /* Check whether we have to resize the data buffer. */
868- if (unlikely ((ndx + 1) * sizeof (Elf64_Sym) > symdata_scn->d.d_size))
869+ if (INVALID_NDX (ndx, Elf64_Sym, &symdata_scn->d))
870 {
871 __libelf_seterrno (ELF_E_INVALID_INDEX);
872 goto out;
873--- elfutils/libelf/gelf_update_versym.c
874+++ elfutils/libelf/gelf_update_versym.c
875@@ -1,5 +1,5 @@
876 /* Update symbol version information.
877- Copyright (C) 2001, 2002 Red Hat, Inc.
878+ Copyright (C) 2001-2009 Red Hat, Inc.
879 This file is part of elfutils.
880 Written by Ulrich Drepper <drepper@redhat.com>, 2001.
881
882@@ -54,8 +54,7 @@ gelf_update_versym (data, ndx, src)
883 assert (sizeof (GElf_Versym) == sizeof (Elf64_Versym));
884
885 /* Check whether we have to resize the data buffer. */
886- if (unlikely (ndx < 0)
887- || unlikely ((ndx + 1) * sizeof (GElf_Versym) > data_scn->d.d_size))
888+ if (INVALID_NDX (ndx, GElf_Versym, &data_scn->d))
889 {
890 __libelf_seterrno (ELF_E_INVALID_INDEX);
891 return 0;
892--- elfutils/libelf/libelfP.h
893+++ elfutils/libelf/libelfP.h
894@@ -587,4 +587,8 @@ extern uint32_t __libelf_crc32 (uint32_t
895 /* Align offset to 4 bytes as needed for note name and descriptor data. */
896 #define NOTE_ALIGN(n) (((n) + 3) & -4U)
897
898+/* Convenience macro. */
899+#define INVALID_NDX(ndx, type, data) \
900+ unlikely ((data)->d_size / sizeof (type) <= (unsigned int) (ndx))
901+
902 #endif /* libelfP.h */
903--- elfutils/src/ChangeLog
904+++ elfutils/src/ChangeLog
905@@ -702,6 +702,12 @@
906
907 * readelf.c (dwarf_attr_string): Grok DW_AT_GNU_odr_signature.
908
909+2011-03-23 Petr Machata <pmachata@redhat.com>
910+
911+ * readelf.c (handle_dynamic, handle_relocs_rel)
912+ (handle_relocs_rela, handle_versym, print_liblist):
913+ Use gelf_fsize instead of relying on shdr->sh_entsize.
914+
915 2011-02-11 Roland McGrath <roland@redhat.com>
916
917 * elfcmp.c (verbose): New variable.
918@@ -2414,6 +2420,16 @@
919 object symbols or symbols with unknown type.
920 (check_rel): Likewise.
921
922+2005-06-09 Roland McGrath <roland@redhat.com>
923+
924+ * readelf.c (handle_dynamic, handle_symtab): Check for bogus sh_link.
925+ (handle_verneed, handle_verdef, handle_versym, handle_hash): Likewise.
926+ (handle_scngrp): Check for bogus sh_info.
927+
928+ * strip.c (handle_elf): Check for bogus values in sh_link, sh_info,
929+ st_shndx, e_shstrndx, and SHT_GROUP or SHT_SYMTAB_SHNDX data.
930+ Don't use assert on input values, instead bail with "illformed" error.
931+
932 2005-06-08 Roland McGrath <roland@redhat.com>
933
934 * readelf.c (print_ops): Add consts.
935@@ -2459,6 +2475,19 @@
936
937 * readelf.c (dwarf_tag_string): Add new tags.
938
939+2005-05-17 Jakub Jelinek <jakub@redhat.com>
940+
941+ * elflint.c (check_hash): Don't check entries beyond end of section.
942+ (check_note): Don't crash if gelf_rawchunk fails.
943+ (section_name): Return <invalid> if gelf_getshdr returns NULL.
944+
945+2005-05-14 Jakub Jelinek <jakub@redhat.com>
946+
947+ * elflint.c (section_name): Return "<invalid>" instead of
948+ crashing on invalid section name.
949+ (check_symtab, is_rel_dyn, check_rela, check_rel, check_dynamic,
950+ check_symtab_shndx, check_hash, check_versym): Robustify.
951+
952 2005-05-08 Roland McGrath <roland@redhat.com>
953
954 * strip.c (handle_elf): Don't translate hash and versym data formats,
955--- elfutils/src/elflint.c
956+++ elfutils/src/elflint.c
957@@ -123,6 +123,10 @@ static uint32_t shstrndx;
958 /* Array to count references in section groups. */
959 static int *scnref;
960
961+/* Numbers of sections and program headers. */
962+static unsigned int shnum;
963+static unsigned int phnum;
964+
965
966 int
967 main (int argc, char *argv[])
968@@ -311,10 +315,19 @@ section_name (Ebl *ebl, int idx)
969 {
970 GElf_Shdr shdr_mem;
971 GElf_Shdr *shdr;
972+ const char *ret;
973+
974+ if ((unsigned int) idx > shnum)
975+ return "<invalid>";
976
977 shdr = gelf_getshdr (elf_getscn (ebl->elf, idx), &shdr_mem);
978+ if (shdr == NULL)
979+ return "<invalid>";
980
981- return elf_strptr (ebl->elf, shstrndx, shdr->sh_name);
982+ ret = elf_strptr (ebl->elf, shstrndx, shdr->sh_name);
983+ if (ret == NULL)
984+ return "<invalid>";
985+ return ret;
986 }
987
988
989@@ -337,11 +350,6 @@ static const int valid_e_machine[] =
990 (sizeof (valid_e_machine) / sizeof (valid_e_machine[0]))
991
992
993-/* Numbers of sections and program headers. */
994-static unsigned int shnum;
995-static unsigned int phnum;
996-
997-
998 static void
999 check_elf_header (Ebl *ebl, GElf_Ehdr *ehdr, size_t size)
1000 {
1001@@ -625,7 +633,8 @@ section [%2d] '%s': symbol table cannot
1002 }
1003 }
1004
1005- if (shdr->sh_entsize != gelf_fsize (ebl->elf, ELF_T_SYM, 1, EV_CURRENT))
1006+ size_t sh_entsize = gelf_fsize (ebl->elf, ELF_T_SYM, 1, EV_CURRENT);
1007+ if (shdr->sh_entsize != sh_entsize)
1008 ERROR (gettext ("\
1009 section [%2u] '%s': entry size is does not match ElfXX_Sym\n"),
1010 idx, section_name (ebl, idx));
1011@@ -663,7 +672,7 @@ section [%2d] '%s': XINDEX for zeroth en
1012 xndxscnidx, section_name (ebl, xndxscnidx));
1013 }
1014
1015- for (size_t cnt = 1; cnt < shdr->sh_size / shdr->sh_entsize; ++cnt)
1016+ for (size_t cnt = 1; cnt < shdr->sh_size / sh_entsize; ++cnt)
1017 {
1018 sym = gelf_getsymshndx (data, xndxdata, cnt, &sym_mem, &xndx);
1019 if (sym == NULL)
1020@@ -683,7 +692,8 @@ section [%2d] '%s': symbol %zu: invalid
1021 else
1022 {
1023 name = elf_strptr (ebl->elf, shdr->sh_link, sym->st_name);
1024- assert (name != NULL);
1025+ assert (name != NULL
1026+ || strshdr->sh_type != SHT_STRTAB);
1027 }
1028
1029 if (sym->st_shndx == SHN_XINDEX)
1030@@ -1040,9 +1050,11 @@ is_rel_dyn (Ebl *ebl, const GElf_Ehdr *e
1031 {
1032 GElf_Shdr rcshdr_mem;
1033 const GElf_Shdr *rcshdr = gelf_getshdr (scn, &rcshdr_mem);
1034- assert (rcshdr != NULL);
1035
1036- if (rcshdr->sh_type == SHT_DYNAMIC)
1037+ if (rcshdr == NULL)
1038+ break;
1039+
1040+ if (rcshdr->sh_type == SHT_DYNAMIC && rcshdr->sh_entsize)
1041 {
1042 /* Found the dynamic section. Look through it. */
1043 Elf_Data *d = elf_getdata (scn, NULL);
1044@@ -1052,7 +1064,9 @@ is_rel_dyn (Ebl *ebl, const GElf_Ehdr *e
1045 {
1046 GElf_Dyn dyn_mem;
1047 GElf_Dyn *dyn = gelf_getdyn (d, cnt, &dyn_mem);
1048- assert (dyn != NULL);
1049+
1050+ if (dyn == NULL)
1051+ break;
1052
1053 if (dyn->d_tag == DT_RELCOUNT)
1054 {
1055@@ -1066,7 +1080,9 @@ section [%2d] '%s': DT_RELCOUNT used for
1056 /* Does the number specified number of relative
1057 relocations exceed the total number of
1058 relocations? */
1059- if (dyn->d_un.d_val > shdr->sh_size / shdr->sh_entsize)
1060+ if (shdr->sh_entsize != 0
1061+ && dyn->d_un.d_val > (shdr->sh_size
1062+ / shdr->sh_entsize))
1063 ERROR (gettext ("\
1064 section [%2d] '%s': DT_RELCOUNT value %d too high for this section\n"),
1065 idx, section_name (ebl, idx),
1066@@ -1226,7 +1242,8 @@ section [%2d] '%s': no relocations for m
1067 }
1068 }
1069
1070- if (shdr->sh_entsize != gelf_fsize (ebl->elf, reltype, 1, EV_CURRENT))
1071+ size_t sh_entsize = gelf_fsize (ebl->elf, reltype, 1, EV_CURRENT);
1072+ if (shdr->sh_entsize != sh_entsize)
1073 ERROR (gettext (reltype == ELF_T_RELA ? "\
1074 section [%2d] '%s': section entry size does not match ElfXX_Rela\n" : "\
1075 section [%2d] '%s': section entry size does not match ElfXX_Rel\n"),
1076@@ -1449,7 +1466,8 @@ check_rela (Ebl *ebl, GElf_Ehdr *ehdr, G
1077 Elf_Data *symdata = elf_getdata (symscn, NULL);
1078 enum load_state state = state_undecided;
1079
1080- for (size_t cnt = 0; cnt < shdr->sh_size / shdr->sh_entsize; ++cnt)
1081+ size_t sh_entsize = gelf_fsize (ebl->elf, ELF_T_RELA, 1, EV_CURRENT);
1082+ for (size_t cnt = 0; cnt < shdr->sh_size / sh_entsize; ++cnt)
1083 {
1084 GElf_Rela rela_mem;
1085 GElf_Rela *rela = gelf_getrela (data, cnt, &rela_mem);
1086@@ -1499,7 +1517,8 @@ check_rel (Ebl *ebl, GElf_Ehdr *ehdr, GE
1087 Elf_Data *symdata = elf_getdata (symscn, NULL);
1088 enum load_state state = state_undecided;
1089
1090- for (size_t cnt = 0; cnt < shdr->sh_size / shdr->sh_entsize; ++cnt)
1091+ size_t sh_entsize = gelf_fsize (ebl->elf, ELF_T_REL, 1, EV_CURRENT);
1092+ for (size_t cnt = 0; cnt < shdr->sh_size / sh_entsize; ++cnt)
1093 {
1094 GElf_Rel rel_mem;
1095 GElf_Rel *rel = gelf_getrel (data, cnt, &rel_mem);
1096@@ -1598,7 +1617,8 @@ section [%2d] '%s': referenced as string
1097 shdr->sh_link, section_name (ebl, shdr->sh_link),
1098 idx, section_name (ebl, idx));
1099
1100- if (shdr->sh_entsize != gelf_fsize (ebl->elf, ELF_T_DYN, 1, EV_CURRENT))
1101+ size_t sh_entsize = gelf_fsize (ebl->elf, ELF_T_DYN, 1, EV_CURRENT);
1102+ if (shdr->sh_entsize != sh_entsize)
1103 ERROR (gettext ("\
1104 section [%2d] '%s': section entry size does not match ElfXX_Dyn\n"),
1105 idx, section_name (ebl, idx));
1106@@ -1608,7 +1628,7 @@ section [%2d] '%s': section entry size d
1107 idx, section_name (ebl, idx));
1108
1109 bool non_null_warned = false;
1110- for (cnt = 0; cnt < shdr->sh_size / shdr->sh_entsize; ++cnt)
1111+ for (cnt = 0; cnt < shdr->sh_size / sh_entsize; ++cnt)
1112 {
1113 GElf_Dyn dyn_mem;
1114 GElf_Dyn *dyn = gelf_getdyn (data, cnt, &dyn_mem);
1115@@ -1880,6 +1900,8 @@ section [%2d] '%s': entry size does not
1116 idx, section_name (ebl, idx));
1117
1118 if (symshdr != NULL
1119+ && shdr->sh_entsize
1120+ && symshdr->sh_entsize
1121 && (shdr->sh_size / shdr->sh_entsize
1122 < symshdr->sh_size / symshdr->sh_entsize))
1123 ERROR (gettext ("\
1124@@ -1906,6 +1928,12 @@ section [%2d] '%s': extended section ind
1125 }
1126
1127 Elf_Data *data = elf_getdata (elf_getscn (ebl->elf, idx), NULL);
1128+ if (data == NULL)
1129+ {
1130+ ERROR (gettext ("section [%2d] '%s': cannot get section data\n"),
1131+ idx, section_name (ebl, idx));
1132+ return;
1133+ }
1134
1135 if (*((Elf32_Word *) data->d_buf) != 0)
1136 ERROR (gettext ("symbol 0 should have zero extended section index\n"));
1137@@ -1948,7 +1976,7 @@ section [%2d] '%s': hash table section i
1138
1139 size_t maxidx = nchain;
1140
1141- if (symshdr != NULL)
1142+ if (symshdr != NULL && symshdr->sh_entsize != 0)
1143 {
1144 size_t symsize = symshdr->sh_size / symshdr->sh_entsize;
1145
1146@@ -1959,18 +1987,28 @@ section [%2d] '%s': hash table section i
1147 maxidx = symsize;
1148 }
1149
1150+ Elf32_Word *buf = (Elf32_Word *) data->d_buf;
1151+ Elf32_Word *end = (Elf32_Word *) ((char *) data->d_buf + shdr->sh_size);
1152 size_t cnt;
1153 for (cnt = 2; cnt < 2 + nbucket; ++cnt)
1154- if (((Elf32_Word *) data->d_buf)[cnt] >= maxidx)
1155+ {
1156+ if (buf + cnt >= end)
1157+ break;
1158+ else if (buf[cnt] >= maxidx)
1159 ERROR (gettext ("\
1160 section [%2d] '%s': hash bucket reference %zu out of bounds\n"),
1161 idx, section_name (ebl, idx), cnt - 2);
1162+ }
1163
1164 for (; cnt < 2 + nbucket + nchain; ++cnt)
1165- if (((Elf32_Word *) data->d_buf)[cnt] >= maxidx)
1166+ {
1167+ if (buf + cnt >= end)
1168+ break;
1169+ else if (buf[cnt] >= maxidx)
1170 ERROR (gettext ("\
1171 section [%2d] '%s': hash chain reference %zu out of bounds\n"),
1172 idx, section_name (ebl, idx), cnt - 2 - nbucket);
1173+ }
1174 }
1175
1176
1177@@ -2000,18 +2038,28 @@ section [%2d] '%s': hash table section i
1178 maxidx = symsize;
1179 }
1180
1181+ Elf64_Xword *buf = (Elf64_Xword *) data->d_buf;
1182+ Elf64_Xword *end = (Elf64_Xword *) ((char *) data->d_buf + shdr->sh_size);
1183 size_t cnt;
1184 for (cnt = 2; cnt < 2 + nbucket; ++cnt)
1185- if (((Elf64_Xword *) data->d_buf)[cnt] >= maxidx)
1186+ {
1187+ if (buf + cnt >= end)
1188+ break;
1189+ else if (buf[cnt] >= maxidx)
1190 ERROR (gettext ("\
1191 section [%2d] '%s': hash bucket reference %zu out of bounds\n"),
1192 idx, section_name (ebl, idx), cnt - 2);
1193+ }
1194
1195 for (; cnt < 2 + nbucket + nchain; ++cnt)
1196- if (((Elf64_Xword *) data->d_buf)[cnt] >= maxidx)
1197+ {
1198+ if (buf + cnt >= end)
1199+ break;
1200+ else if (buf[cnt] >= maxidx)
1201 ERROR (gettext ("\
1202 section [%2d] '%s': hash chain reference %" PRIu64 " out of bounds\n"),
1203- idx, section_name (ebl, idx), (uint64_t) (cnt - 2 - nbucket));
1204+ idx, section_name (ebl, idx), (uint64_t) cnt - 2 - nbucket);
1205+ }
1206 }
1207
1208
1209@@ -2036,7 +2084,7 @@ section [%2d] '%s': bitmask size not pow
1210 if (shdr->sh_size < (4 + bitmask_words + nbuckets) * sizeof (Elf32_Word))
1211 {
1212 ERROR (gettext ("\
1213-section [%2d] '%s': hash table section is too small (is %ld, expected at least%ld)\n"),
1214+section [%2d] '%s': hash table section is too small (is %ld, expected at least %ld)\n"),
1215 idx, section_name (ebl, idx), (long int) shdr->sh_size,
1216 (long int) ((4 + bitmask_words + nbuckets) * sizeof (Elf32_Word)));
1217 return;
1218@@ -2708,8 +2756,9 @@ section [%2d] '%s' refers in sh_link to
1219
1220 /* The number of elements in the version symbol table must be the
1221 same as the number of symbols. */
1222- if (shdr->sh_size / shdr->sh_entsize
1223- != symshdr->sh_size / symshdr->sh_entsize)
1224+ if (shdr->sh_entsize && symshdr->sh_entsize
1225+ && (shdr->sh_size / shdr->sh_entsize
1226+ != symshdr->sh_size / symshdr->sh_entsize))
1227 ERROR (gettext ("\
1228 section [%2d] '%s' has different number of entries than symbol table [%2d] '%s'\n"),
1229 idx, section_name (ebl, idx),
1230--- elfutils/src/readelf.c
1231+++ elfutils/src/readelf.c
1232@@ -1364,6 +1364,8 @@ handle_scngrp (Ebl *ebl, Elf_Scn *scn, G
1233 Elf32_Word *grpref = (Elf32_Word *) data->d_buf;
1234
1235 GElf_Sym sym_mem;
1236+ GElf_Sym *sym = gelf_getsym (symdata, shdr->sh_info, &sym_mem);
1237+
1238 printf ((grpref[0] & GRP_COMDAT)
1239 ? ngettext ("\
1240 \nCOMDAT section group [%2zu] '%s' with signature '%s' contains %zu entry:\n",
1241@@ -1376,8 +1378,8 @@ handle_scngrp (Ebl *ebl, Elf_Scn *scn, G
1242 data->d_size / sizeof (Elf32_Word) - 1),
1243 elf_ndxscn (scn),
1244 elf_strptr (ebl->elf, shstrndx, shdr->sh_name),
1245- elf_strptr (ebl->elf, symshdr->sh_link,
1246- gelf_getsym (symdata, shdr->sh_info, &sym_mem)->st_name)
1247+ (sym == NULL ? NULL
1248+ : elf_strptr (ebl->elf, symshdr->sh_link, sym->st_name))
1249 ?: gettext ("<INVALID SYMBOL>"),
1250 data->d_size / sizeof (Elf32_Word) - 1);
1251
1252@@ -1528,10 +1530,12 @@ static void
1253 handle_dynamic (Ebl *ebl, Elf_Scn *scn, GElf_Shdr *shdr)
1254 {
1255 int class = gelf_getclass (ebl->elf);
1256- GElf_Shdr glink;
1257+ GElf_Shdr glink_mem;
1258+ GElf_Shdr *glink;
1259 Elf_Data *data;
1260 size_t cnt;
1261 size_t shstrndx;
1262+ size_t sh_entsize;
1263
1264 /* Get the data of the section. */
1265 data = elf_getdata (scn, NULL);
1266@@ -1543,21 +1547,26 @@ handle_dynamic (Ebl *ebl, Elf_Scn *scn,
1267 error (EXIT_FAILURE, 0,
1268 gettext ("cannot get section header string table index"));
1269
1270+ sh_entsize = gelf_fsize (ebl->elf, ELF_T_DYN, 1, EV_CURRENT);
1271+
1272+ glink = gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link), &glink_mem);
1273+ if (glink == NULL)
1274+ error (EXIT_FAILURE, 0, gettext ("invalid sh_link value in section %Zu"),
1275+ elf_ndxscn (scn));
1276+
1277 printf (ngettext ("\
1278 \nDynamic segment contains %lu entry:\n Addr: %#0*" PRIx64 " Offset: %#08" PRIx64 " Link to section: [%2u] '%s'\n",
1279 "\
1280 \nDynamic segment contains %lu entries:\n Addr: %#0*" PRIx64 " Offset: %#08" PRIx64 " Link to section: [%2u] '%s'\n",
1281- shdr->sh_size / shdr->sh_entsize),
1282- (unsigned long int) (shdr->sh_size / shdr->sh_entsize),
1283+ shdr->sh_size / sh_entsize),
1284+ (unsigned long int) (shdr->sh_size / sh_entsize),
1285 class == ELFCLASS32 ? 10 : 18, shdr->sh_addr,
1286 shdr->sh_offset,
1287 (int) shdr->sh_link,
1288- elf_strptr (ebl->elf, shstrndx,
1289- gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link),
1290- &glink)->sh_name));
1291+ elf_strptr (ebl->elf, shstrndx, glink->sh_name));
1292 fputs_unlocked (gettext (" Type Value\n"), stdout);
1293
1294- for (cnt = 0; cnt < shdr->sh_size / shdr->sh_entsize; ++cnt)
1295+ for (cnt = 0; cnt < shdr->sh_size / sh_entsize; ++cnt)
1296 {
1297 GElf_Dyn dynmem;
1298 GElf_Dyn *dyn = gelf_getdyn (data, cnt, &dynmem);
1299@@ -1706,7 +1715,8 @@ static void
1300 handle_relocs_rel (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn, GElf_Shdr *shdr)
1301 {
1302 int class = gelf_getclass (ebl->elf);
1303- int nentries = shdr->sh_size / shdr->sh_entsize;
1304+ size_t sh_entsize = gelf_fsize (ebl->elf, ELF_T_REL, 1, EV_CURRENT);
1305+ int nentries = shdr->sh_size / sh_entsize;
1306
1307 /* Get the data of the section. */
1308 Elf_Data *data = elf_getdata (scn, NULL);
1309@@ -1892,7 +1902,8 @@ static void
1310 handle_relocs_rela (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn, GElf_Shdr *shdr)
1311 {
1312 int class = gelf_getclass (ebl->elf);
1313- int nentries = shdr->sh_size / shdr->sh_entsize;
1314+ size_t sh_entsize = gelf_fsize (ebl->elf, ELF_T_RELA, 1, EV_CURRENT);
1315+ int nentries = shdr->sh_size / sh_entsize;
1316
1317 /* Get the data of the section. */
1318 Elf_Data *data = elf_getdata (scn, NULL);
1319@@ -2139,6 +2150,13 @@ handle_symtab (Ebl *ebl, Elf_Scn *scn, G
1320 error (EXIT_FAILURE, 0,
1321 gettext ("cannot get section header string table index"));
1322
1323+ GElf_Shdr glink_mem;
1324+ GElf_Shdr *glink = gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link),
1325+ &glink_mem);
1326+ if (glink == NULL)
1327+ error (EXIT_FAILURE, 0, gettext ("invalid sh_link value in section %Zu"),
1328+ elf_ndxscn (scn));
1329+
1330 /* Now we can compute the number of entries in the section. */
1331 unsigned int nsyms = data->d_size / (class == ELFCLASS32
1332 ? sizeof (Elf32_Sym)
1333@@ -2149,15 +2167,12 @@ handle_symtab (Ebl *ebl, Elf_Scn *scn, G
1334 nsyms),
1335 (unsigned int) elf_ndxscn (scn),
1336 elf_strptr (ebl->elf, shstrndx, shdr->sh_name), nsyms);
1337- GElf_Shdr glink;
1338 printf (ngettext (" %lu local symbol String table: [%2u] '%s'\n",
1339 " %lu local symbols String table: [%2u] '%s'\n",
1340 shdr->sh_info),
1341 (unsigned long int) shdr->sh_info,
1342 (unsigned int) shdr->sh_link,
1343- elf_strptr (ebl->elf, shstrndx,
1344- gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link),
1345- &glink)->sh_name));
1346+ elf_strptr (ebl->elf, shstrndx, glink->sh_name));
1347
1348 fputs_unlocked (class == ELFCLASS32
1349 ? gettext ("\
1350@@ -2393,7 +2408,13 @@ handle_verneed (Ebl *ebl, Elf_Scn *scn,
1351 error (EXIT_FAILURE, 0,
1352 gettext ("cannot get section header string table index"));
1353
1354- GElf_Shdr glink;
1355+ GElf_Shdr glink_mem;
1356+ GElf_Shdr *glink = gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link),
1357+ &glink_mem);
1358+ if (glink == NULL)
1359+ error (EXIT_FAILURE, 0, gettext ("invalid sh_link value in section %Zu"),
1360+ elf_ndxscn (scn));
1361+
1362 printf (ngettext ("\
1363 \nVersion needs section [%2u] '%s' contains %d entry:\n Addr: %#0*" PRIx64 " Offset: %#08" PRIx64 " Link to section: [%2u] '%s'\n",
1364 "\
1365@@ -2404,9 +2425,7 @@ handle_verneed (Ebl *ebl, Elf_Scn *scn,
1366 class == ELFCLASS32 ? 10 : 18, shdr->sh_addr,
1367 shdr->sh_offset,
1368 (unsigned int) shdr->sh_link,
1369- elf_strptr (ebl->elf, shstrndx,
1370- gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link),
1371- &glink)->sh_name));
1372+ elf_strptr (ebl->elf, shstrndx, glink->sh_name));
1373
1374 unsigned int offset = 0;
1375 for (int cnt = shdr->sh_info; --cnt >= 0; )
1376@@ -2459,8 +2478,14 @@ handle_verdef (Ebl *ebl, Elf_Scn *scn, G
1377 error (EXIT_FAILURE, 0,
1378 gettext ("cannot get section header string table index"));
1379
1380+ GElf_Shdr glink_mem;
1381+ GElf_Shdr *glink = gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link),
1382+ &glink_mem);
1383+ if (glink == NULL)
1384+ error (EXIT_FAILURE, 0, gettext ("invalid sh_link value in section %Zu"),
1385+ elf_ndxscn (scn));
1386+
1387 int class = gelf_getclass (ebl->elf);
1388- GElf_Shdr glink;
1389 printf (ngettext ("\
1390 \nVersion definition section [%2u] '%s' contains %d entry:\n Addr: %#0*" PRIx64 " Offset: %#08" PRIx64 " Link to section: [%2u] '%s'\n",
1391 "\
1392@@ -2472,9 +2497,7 @@ handle_verdef (Ebl *ebl, Elf_Scn *scn, G
1393 class == ELFCLASS32 ? 10 : 18, shdr->sh_addr,
1394 shdr->sh_offset,
1395 (unsigned int) shdr->sh_link,
1396- elf_strptr (ebl->elf, shstrndx,
1397- gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link),
1398- &glink)->sh_name));
1399+ elf_strptr (ebl->elf, shstrndx, glink->sh_name));
1400
1401 unsigned int offset = 0;
1402 for (int cnt = shdr->sh_info; --cnt >= 0; )
1403@@ -2736,25 +2759,30 @@ handle_versym (Ebl *ebl, Elf_Scn *scn, G
1404 filename = NULL;
1405 }
1406
1407+ GElf_Shdr glink_mem;
1408+ GElf_Shdr *glink = gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link),
1409+ &glink_mem);
1410+ size_t sh_entsize = gelf_fsize (ebl->elf, ELF_T_HALF, 1, EV_CURRENT);
1411+ if (glink == NULL)
1412+ error (EXIT_FAILURE, 0, gettext ("invalid sh_link value in section %Zu"),
1413+ elf_ndxscn (scn));
1414+
1415 /* Print the header. */
1416- GElf_Shdr glink;
1417 printf (ngettext ("\
1418 \nVersion symbols section [%2u] '%s' contains %d entry:\n Addr: %#0*" PRIx64 " Offset: %#08" PRIx64 " Link to section: [%2u] '%s'",
1419 "\
1420 \nVersion symbols section [%2u] '%s' contains %d entries:\n Addr: %#0*" PRIx64 " Offset: %#08" PRIx64 " Link to section: [%2u] '%s'",
1421- shdr->sh_size / shdr->sh_entsize),
1422+ shdr->sh_size / sh_entsize),
1423 (unsigned int) elf_ndxscn (scn),
1424 elf_strptr (ebl->elf, shstrndx, shdr->sh_name),
1425- (int) (shdr->sh_size / shdr->sh_entsize),
1426+ (int) (shdr->sh_size / sh_entsize),
1427 class == ELFCLASS32 ? 10 : 18, shdr->sh_addr,
1428 shdr->sh_offset,
1429 (unsigned int) shdr->sh_link,
1430- elf_strptr (ebl->elf, shstrndx,
1431- gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link),
1432- &glink)->sh_name));
1433+ elf_strptr (ebl->elf, shstrndx, glink->sh_name));
1434
1435 /* Now we can finally look at the actual contents of this section. */
1436- for (unsigned int cnt = 0; cnt < shdr->sh_size / shdr->sh_entsize; ++cnt)
1437+ for (unsigned int cnt = 0; cnt < shdr->sh_size / sh_entsize; ++cnt)
1438 {
1439 if (cnt % 2 == 0)
1440 printf ("\n %4d:", cnt);
1441@@ -2803,7 +2831,17 @@ print_hash_info (Ebl *ebl, Elf_Scn *scn,
1442 for (Elf32_Word cnt = 0; cnt < nbucket; ++cnt)
1443 ++counts[lengths[cnt]];
1444
1445- GElf_Shdr glink;
1446+ GElf_Shdr glink_mem;
1447+ GElf_Shdr *glink = gelf_getshdr (elf_getscn (ebl->elf,
1448+ shdr->sh_link),
1449+ &glink_mem);
1450+ if (glink == NULL)
1451+ {
1452+ error (0, 0, gettext ("invalid sh_link value in section %Zu"),
1453+ elf_ndxscn (scn));
1454+ return;
1455+ }
1456+
1457 printf (ngettext ("\
1458 \nHistogram for bucket list length in section [%2u] '%s' (total of %d bucket):\n Addr: %#0*" PRIx64 " Offset: %#08" PRIx64 " Link to section: [%2u] '%s'\n",
1459 "\
1460@@ -2816,9 +2854,7 @@ print_hash_info (Ebl *ebl, Elf_Scn *scn,
1461 shdr->sh_addr,
1462 shdr->sh_offset,
1463 (unsigned int) shdr->sh_link,
1464- elf_strptr (ebl->elf, shstrndx,
1465- gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link),
1466- &glink)->sh_name));
1467+ elf_strptr (ebl->elf, shstrndx, glink->sh_name));
1468
1469 if (extrastr != NULL)
1470 fputs (extrastr, stdout);
1471@@ -3078,7 +3114,8 @@ print_liblist (Ebl *ebl)
1472
1473 if (shdr != NULL && shdr->sh_type == SHT_GNU_LIBLIST)
1474 {
1475- int nentries = shdr->sh_size / shdr->sh_entsize;
1476+ size_t sh_entsize = gelf_fsize (ebl->elf, ELF_T_LIB, 1, EV_CURRENT);
1477+ int nentries = shdr->sh_size / sh_entsize;
1478 printf (ngettext ("\
1479 \nLibrary list section [%2zu] '%s' at offset %#0" PRIx64 " contains %d entry:\n",
1480 "\
1481@@ -4398,6 +4435,16 @@ print_decoded_aranges_section (Ebl *ebl,
1482 return;
1483 }
1484
1485+ GElf_Shdr glink_mem;
1486+ GElf_Shdr *glink;
1487+ glink = gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link), &glink_mem);
1488+ if (glink == NULL)
1489+ {
1490+ error (0, 0, gettext ("invalid sh_link value in section %Zu"),
1491+ elf_ndxscn (scn));
1492+ return;
1493+ }
1494+
1495 printf (ngettext ("\
1496 \nDWARF section [%2zu] '%s' at offset %#" PRIx64 " contains %zu entry:\n",
1497 "\
1498--- elfutils/src/strip.c
1499+++ elfutils/src/strip.c
1500@@ -565,6 +565,11 @@ handle_elf (int fd, Elf *elf, const char
1501 goto fail_close;
1502 }
1503
1504+ if (shstrndx >= shnum)
1505+ goto illformed;
1506+
1507+#define elf_assert(test) do { if (!(test)) goto illformed; } while (0)
1508+
1509 /* Storage for section information. We leave room for two more
1510 entries since we unconditionally create a section header string
1511 table. Maybe some weird tool created an ELF file without one.
1512@@ -586,7 +591,7 @@ handle_elf (int fd, Elf *elf, const char
1513 {
1514 /* This should always be true (i.e., there should not be any
1515 holes in the numbering). */
1516- assert (elf_ndxscn (scn) == cnt);
1517+ elf_assert (elf_ndxscn (scn) == cnt);
1518
1519 shdr_info[cnt].scn = scn;
1520
1521@@ -599,6 +604,7 @@ handle_elf (int fd, Elf *elf, const char
1522 shdr_info[cnt].shdr.sh_name);
1523 if (shdr_info[cnt].name == NULL)
1524 {
1525+ illformed:
1526 error (0, 0, gettext ("illformed file '%s'"), fname);
1527 goto fail_close;
1528 }
1529@@ -608,6 +614,8 @@ handle_elf (int fd, Elf *elf, const char
1530
1531 /* Remember the shdr.sh_link value. */
1532 shdr_info[cnt].old_sh_link = shdr_info[cnt].shdr.sh_link;
1533+ if (shdr_info[cnt].old_sh_link >= shnum)
1534+ goto illformed;
1535
1536 /* Sections in files other than relocatable object files which
1537 are not loaded can be freely moved by us. In relocatable
1538@@ -620,7 +628,7 @@ handle_elf (int fd, Elf *elf, const char
1539 appropriate reference. */
1540 if (unlikely (shdr_info[cnt].shdr.sh_type == SHT_SYMTAB_SHNDX))
1541 {
1542- assert (shdr_info[shdr_info[cnt].shdr.sh_link].symtab_idx == 0);
1543+ elf_assert (shdr_info[shdr_info[cnt].shdr.sh_link].symtab_idx == 0);
1544 shdr_info[shdr_info[cnt].shdr.sh_link].symtab_idx = cnt;
1545 }
1546 else if (unlikely (shdr_info[cnt].shdr.sh_type == SHT_GROUP))
1547@@ -637,7 +645,12 @@ handle_elf (int fd, Elf *elf, const char
1548 for (inner = 1;
1549 inner < shdr_info[cnt].data->d_size / sizeof (Elf32_Word);
1550 ++inner)
1551+ {
1552+ if (grpref[inner] < shnum)
1553 shdr_info[grpref[inner]].group_idx = cnt;
1554+ else
1555+ goto illformed;
1556+ }
1557
1558 if (inner == 1 || (inner == 2 && (grpref[0] & GRP_COMDAT) == 0))
1559 /* If the section group contains only one element and this
1560@@ -648,7 +661,7 @@ handle_elf (int fd, Elf *elf, const char
1561 }
1562 else if (unlikely (shdr_info[cnt].shdr.sh_type == SHT_GNU_versym))
1563 {
1564- assert (shdr_info[shdr_info[cnt].shdr.sh_link].version_idx == 0);
1565+ elf_assert (shdr_info[shdr_info[cnt].shdr.sh_link].version_idx == 0);
1566 shdr_info[shdr_info[cnt].shdr.sh_link].version_idx = cnt;
1567 }
1568
1569@@ -656,7 +669,7 @@ handle_elf (int fd, Elf *elf, const char
1570 discarded right away. */
1571 if ((shdr_info[cnt].shdr.sh_flags & SHF_GROUP) != 0)
1572 {
1573- assert (shdr_info[cnt].group_idx != 0);
1574+ elf_assert (shdr_info[cnt].group_idx != 0);
1575
1576 if (shdr_info[shdr_info[cnt].group_idx].idx == 0)
1577 {
1578@@ -732,10 +745,14 @@ handle_elf (int fd, Elf *elf, const char
1579 {
1580 /* If a relocation section is marked as being removed make
1581 sure the section it is relocating is removed, too. */
1582- if ((shdr_info[cnt].shdr.sh_type == SHT_REL
1583+ if (shdr_info[cnt].shdr.sh_type == SHT_REL
1584 || shdr_info[cnt].shdr.sh_type == SHT_RELA)
1585- && shdr_info[shdr_info[cnt].shdr.sh_info].idx != 0)
1586- shdr_info[cnt].idx = 1;
1587+ {
1588+ if (shdr_info[cnt].shdr.sh_info >= shnum)
1589+ goto illformed;
1590+ else if (shdr_info[shdr_info[cnt].shdr.sh_info].idx != 0)
1591+ shdr_info[cnt].idx = 1;
1592+ }
1593
1594 /* If a group section is marked as being removed make
1595 sure all the sections it contains are being removed, too. */
1596@@ -779,7 +796,7 @@ handle_elf (int fd, Elf *elf, const char
1597 if (shdr_info[cnt].symtab_idx != 0
1598 && shdr_info[shdr_info[cnt].symtab_idx].data == NULL)
1599 {
1600- assert (shdr_info[cnt].shdr.sh_type == SHT_SYMTAB);
1601+ elf_assert (shdr_info[cnt].shdr.sh_type == SHT_SYMTAB);
1602
1603 shdr_info[shdr_info[cnt].symtab_idx].data
1604 = elf_getdata (shdr_info[shdr_info[cnt].symtab_idx].scn,
1605@@ -819,6 +836,9 @@ handle_elf (int fd, Elf *elf, const char
1606 else if (scnidx == SHN_XINDEX)
1607 scnidx = xndx;
1608
1609+ if (scnidx >= shnum)
1610+ goto illformed;
1611+
1612 if (shdr_info[scnidx].idx == 0)
1613 /* This symbol table has a real symbol in
1614 a discarded section. So preserve the
1615@@ -849,12 +869,16 @@ handle_elf (int fd, Elf *elf, const char
1616 }
1617
1618 /* Handle references through sh_info. */
1619- if (SH_INFO_LINK_P (&shdr_info[cnt].shdr)
1620- && shdr_info[shdr_info[cnt].shdr.sh_info].idx == 0)
1621+ if (SH_INFO_LINK_P (&shdr_info[cnt].shdr))
1622+ {
1623+ if (shdr_info[cnt].shdr.sh_info >= shnum)
1624+ goto illformed;
1625+ else if ( shdr_info[shdr_info[cnt].shdr.sh_info].idx == 0)
1626 {
1627 shdr_info[shdr_info[cnt].shdr.sh_info].idx = 1;
1628 changes |= shdr_info[cnt].shdr.sh_info < cnt;
1629 }
1630+ }
1631
1632 /* Mark the section as investigated. */
1633 shdr_info[cnt].idx = 2;
1634@@ -995,7 +1019,7 @@ handle_elf (int fd, Elf *elf, const char
1635 error (EXIT_FAILURE, 0, gettext ("while generating output file: %s"),
1636 elf_errmsg (-1));
1637
1638- assert (elf_ndxscn (shdr_info[cnt].newscn) == shdr_info[cnt].idx);
1639+ elf_assert (elf_ndxscn (shdr_info[cnt].newscn) == shdr_info[cnt].idx);
1640
1641 /* Add this name to the section header string table. */
1642 shdr_info[cnt].se = ebl_strtabadd (shst, shdr_info[cnt].name, 0);
1643@@ -1032,7 +1056,7 @@ handle_elf (int fd, Elf *elf, const char
1644 error (EXIT_FAILURE, 0,
1645 gettext ("while create section header section: %s"),
1646 elf_errmsg (-1));
1647- assert (elf_ndxscn (shdr_info[cnt].newscn) == shdr_info[cnt].idx);
1648+ elf_assert (elf_ndxscn (shdr_info[cnt].newscn) == shdr_info[cnt].idx);
1649
1650 shdr_info[cnt].data = elf_newdata (shdr_info[cnt].newscn);
1651 if (shdr_info[cnt].data == NULL)
1652@@ -1089,7 +1113,7 @@ handle_elf (int fd, Elf *elf, const char
1653 error (EXIT_FAILURE, 0,
1654 gettext ("while create section header section: %s"),
1655 elf_errmsg (-1));
1656- assert (elf_ndxscn (shdr_info[cnt].newscn) == idx);
1657+ elf_assert (elf_ndxscn (shdr_info[cnt].newscn) == idx);
1658
1659 /* Finalize the string table and fill in the correct indices in the
1660 section headers. */
1661@@ -1179,20 +1203,20 @@ handle_elf (int fd, Elf *elf, const char
1662 shndxdata = elf_getdata (shdr_info[shdr_info[cnt].symtab_idx].scn,
1663 NULL);
1664
1665- assert ((versiondata->d_size / sizeof (Elf32_Word))
1666+ elf_assert ((versiondata->d_size / sizeof (Elf32_Word))
1667 >= shdr_info[cnt].data->d_size / elsize);
1668 }
1669
1670 if (shdr_info[cnt].version_idx != 0)
1671 {
1672- assert (shdr_info[cnt].shdr.sh_type == SHT_DYNSYM);
1673+ elf_assert (shdr_info[cnt].shdr.sh_type == SHT_DYNSYM);
1674 /* This section has associated version
1675 information. We have to modify that
1676 information, too. */
1677 versiondata = elf_getdata (shdr_info[shdr_info[cnt].version_idx].scn,
1678 NULL);
1679
1680- assert ((versiondata->d_size / sizeof (GElf_Versym))
1681+ elf_assert ((versiondata->d_size / sizeof (GElf_Versym))
1682 >= shdr_info[cnt].data->d_size / elsize);
1683 }
1684
1685@@ -1247,7 +1271,7 @@ handle_elf (int fd, Elf *elf, const char
1686 sec = shdr_info[sym->st_shndx].idx;
1687 else
1688 {
1689- assert (shndxdata != NULL);
1690+ elf_assert (shndxdata != NULL);
1691
1692 sec = shdr_info[xshndx].idx;
1693 }
1694@@ -1268,7 +1292,7 @@ handle_elf (int fd, Elf *elf, const char
1695 nxshndx = sec;
1696 }
1697
1698- assert (sec < SHN_LORESERVE || shndxdata != NULL);
1699+ elf_assert (sec < SHN_LORESERVE || shndxdata != NULL);
1700
1701 if ((inner != destidx || nshndx != sym->st_shndx
1702 || (shndxdata != NULL && nxshndx != xshndx))
1703@@ -1295,9 +1319,11 @@ handle_elf (int fd, Elf *elf, const char
1704 {
1705 size_t sidx = (sym->st_shndx != SHN_XINDEX
1706 ? sym->st_shndx : xshndx);
1707- assert (GELF_ST_TYPE (sym->st_info) == STT_SECTION
1708- || (shdr_info[sidx].shdr.sh_type == SHT_GROUP
1709- && shdr_info[sidx].shdr.sh_info == inner));
1710+ elf_assert (GELF_ST_TYPE (sym->st_info) == STT_SECTION
1711+ || ((shdr_info[sidx].shdr.sh_type
1712+ == SHT_GROUP)
1713+ && (shdr_info[sidx].shdr.sh_info
1714+ == inner)));
1715 }
1716 }
1717
1718@@ -1485,11 +1511,11 @@ handle_elf (int fd, Elf *elf, const char
1719 {
1720 GElf_Sym sym_mem;
1721 GElf_Sym *sym = gelf_getsym (symd, inner, &sym_mem);
1722- assert (sym != NULL);
1723+ elf_assert (sym != NULL);
1724
1725 const char *name = elf_strptr (elf, strshndx,
1726 sym->st_name);
1727- assert (name != NULL);
1728+ elf_assert (name != NULL);
1729 size_t hidx = elf_hash (name) % nbucket;
1730
1731 if (bucket[hidx] == 0)
1732@@ -1508,8 +1534,8 @@ handle_elf (int fd, Elf *elf, const char
1733 else
1734 {
1735 /* Alpha and S390 64-bit use 64-bit SHT_HASH entries. */
1736- assert (shdr_info[cnt].shdr.sh_entsize
1737- == sizeof (Elf64_Xword));
1738+ elf_assert (shdr_info[cnt].shdr.sh_entsize
1739+ == sizeof (Elf64_Xword));
1740
1741 Elf64_Xword *bucket = (Elf64_Xword *) hashd->d_buf;
1742
1743@@ -1539,11 +1565,11 @@ handle_elf (int fd, Elf *elf, const char
1744 {
1745 GElf_Sym sym_mem;
1746 GElf_Sym *sym = gelf_getsym (symd, inner, &sym_mem);
1747- assert (sym != NULL);
1748+ elf_assert (sym != NULL);
1749
1750 const char *name = elf_strptr (elf, strshndx,
1751 sym->st_name);
1752- assert (name != NULL);
1753+ elf_assert (name != NULL);
1754 size_t hidx = elf_hash (name) % nbucket;
1755
1756 if (bucket[hidx] == 0)
diff --git a/meta/recipes-devtools/elfutils/elfutils-0.158/unwind_non_linux.patch b/meta/recipes-devtools/elfutils/elfutils-0.158/unwind_non_linux.patch
deleted file mode 100644
index 870ec23703..0000000000
--- a/meta/recipes-devtools/elfutils/elfutils-0.158/unwind_non_linux.patch
+++ /dev/null
@@ -1,256 +0,0 @@
1From 02cefdaa6429e620d6457fdb3ad9934f194c5a93 Mon Sep 17 00:00:00 2001
2From: Kurt Roeckx <kurt@roeckx.be>
3Date: Tue, 22 Apr 2014 21:46:22 +0200
4Subject: [PATCH] Unwinding is only supported on Linux
5
6Index: elfutils-0.158/backends/i386_initreg.c
7===================================================================
8--- elfutils-0.158.orig/backends/i386_initreg.c 2014-05-01 17:11:18.870616302 +0000
9+++ elfutils-0.158/backends/i386_initreg.c 2014-05-01 17:11:18.866616384 +0000
10@@ -44,7 +44,7 @@
11 ebl_tid_registers_t *setfunc __attribute__ ((unused)),
12 void *arg __attribute__ ((unused)))
13 {
14-#if !defined __i386__ && !defined __x86_64__
15+#if (!defined __i386__ && !defined __x86_64__) || !defined(__linux__)
16 return false;
17 #else /* __i386__ || __x86_64__ */
18 struct user_regs_struct user_regs;
19Index: elfutils-0.158/backends/x86_64_initreg.c
20===================================================================
21--- elfutils-0.158.orig/backends/x86_64_initreg.c 2014-05-01 17:11:18.870616302 +0000
22+++ elfutils-0.158/backends/x86_64_initreg.c 2014-05-01 17:11:18.866616384 +0000
23@@ -44,7 +44,7 @@
24 ebl_tid_registers_t *setfunc __attribute__ ((unused)),
25 void *arg __attribute__ ((unused)))
26 {
27-#ifndef __x86_64__
28+#if !defined(__x86_64__) || !defined(__linux__)
29 return false;
30 #else /* __x86_64__ */
31 struct user_regs_struct user_regs;
32Index: elfutils-0.158/libdwfl/linux-pid-attach.c
33===================================================================
34--- elfutils-0.158.orig/libdwfl/linux-pid-attach.c 2014-05-01 17:11:18.870616302 +0000
35+++ elfutils-0.158/libdwfl/linux-pid-attach.c 2014-05-01 17:12:47.980766442 +0000
36@@ -37,6 +37,8 @@
37 # define MAX(a, b) ((a) > (b) ? (a) : (b))
38 #endif
39
40+#ifdef __linux__
41+
42 struct pid_arg
43 {
44 DIR *dir;
45@@ -358,3 +360,87 @@
46 return 0;
47 }
48 INTDEF (dwfl_linux_proc_attach)
49+
50+#else /* __linux__ */
51+
52+static pid_t
53+pid_next_thread (Dwfl *dwfl __attribute__ ((unused)),
54+ void *dwfl_arg __attribute__ ((unused)),
55+ void **thread_argp __attribute__ ((unused)))
56+{
57+ errno = ENOSYS;
58+ __libdwfl_seterrno (DWFL_E_ERRNO);
59+ return -1;
60+}
61+
62+static bool
63+pid_getthread (Dwfl *dwfl __attribute__ ((unused)),
64+ pid_t tid __attribute__ ((unused)),
65+ void *dwfl_arg __attribute__ ((unused)),
66+ void **thread_argp __attribute__ ((unused)))
67+{
68+ errno = ENOSYS;
69+ __libdwfl_seterrno (DWFL_E_ERRNO);
70+ return false;
71+}
72+
73+static bool
74+pid_memory_read (Dwfl *dwfl __attribute__ ((unused)),
75+ Dwarf_Addr addr __attribute__ ((unused)),
76+ Dwarf_Word *result __attribute__ ((unused)),
77+ void *arg __attribute__ ((unused)))
78+{
79+ errno = ENOSYS;
80+ __libdwfl_seterrno (DWFL_E_ERRNO);
81+ return false;
82+}
83+
84+static bool
85+pid_set_initial_registers (Dwfl_Thread *thread __attribute__ ((unused)),
86+ void *thread_arg __attribute__ ((unused)))
87+{
88+ errno = ENOSYS;
89+ __libdwfl_seterrno (DWFL_E_ERRNO);
90+ return false;
91+}
92+
93+static void
94+pid_detach (Dwfl *dwfl __attribute__ ((unused)),
95+ void *dwfl_arg __attribute__ ((unused)))
96+{
97+}
98+
99+static void
100+pid_thread_detach (Dwfl_Thread *thread __attribute__ ((unused)),
101+ void *thread_arg __attribute__ ((unused)))
102+{
103+}
104+
105+static const Dwfl_Thread_Callbacks pid_thread_callbacks =
106+{
107+ pid_next_thread,
108+ pid_getthread,
109+ pid_memory_read,
110+ pid_set_initial_registers,
111+ pid_detach,
112+ pid_thread_detach,
113+};
114+
115+int
116+dwfl_linux_proc_attach (Dwfl *dwfl __attribute__ ((unused)),
117+ pid_t pid __attribute__ ((unused)),
118+ bool assume_ptrace_stopped __attribute__ ((unused)))
119+{
120+ return ENOSYS;
121+}
122+INTDEF (dwfl_linux_proc_attach)
123+
124+struct __libdwfl_pid_arg *
125+internal_function
126+__libdwfl_get_pid_arg (Dwfl *dwfl __attribute__ ((unused)))
127+{
128+ return NULL;
129+}
130+
131+#endif /* ! __linux __ */
132+
133Index: elfutils-0.158/tests/backtrace-child.c
134===================================================================
135--- elfutils-0.158.orig/tests/backtrace-child.c 2014-05-01 17:11:18.870616302 +0000
136+++ elfutils-0.158/tests/backtrace-child.c 2014-05-01 17:11:18.866616384 +0000
137@@ -79,6 +79,18 @@
138 #include <stdio.h>
139 #include <unistd.h>
140
141+#ifndef __linux__
142+
143+int
144+main (int argc __attribute__ ((unused)), char **argv)
145+{
146+ fprintf (stderr, "%s: Unwinding not supported for this architecture\n",
147+ argv[0]);
148+ return 77;
149+}
150+
151+#else /* __linux__ */
152+
153 #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
154 #define NOINLINE_NOCLONE __attribute__ ((noinline, noclone))
155 #else
156@@ -221,3 +233,6 @@
157 /* Not reached. */
158 abort ();
159 }
160+
161+#endif /* ! __linux__ */
162+
163Index: elfutils-0.158/tests/backtrace-data.c
164===================================================================
165--- elfutils-0.158.orig/tests/backtrace-data.c 2014-05-01 17:11:18.870616302 +0000
166+++ elfutils-0.158/tests/backtrace-data.c 2014-05-01 17:11:18.866616384 +0000
167@@ -40,7 +40,7 @@
168 #include <string.h>
169 #include ELFUTILS_HEADER(dwfl)
170
171-#ifndef __x86_64__
172+#if !defined(__x86_64__) || !defined(__linux__)
173
174 int
175 main (int argc __attribute__ ((unused)), char **argv)
176@@ -50,7 +50,7 @@
177 return 77;
178 }
179
180-#else /* __x86_64__ */
181+#else /* __x86_64__ && __linux__ */
182
183 /* The only arch specific code is set_initial_registers. */
184
185Index: elfutils-0.158/tests/backtrace-dwarf.c
186===================================================================
187--- elfutils-0.158.orig/tests/backtrace-dwarf.c 2014-05-01 17:11:18.870616302 +0000
188+++ elfutils-0.158/tests/backtrace-dwarf.c 2014-05-01 17:11:18.866616384 +0000
189@@ -25,6 +25,18 @@
190 #include <sys/ptrace.h>
191 #include ELFUTILS_HEADER(dwfl)
192
193+#ifndef __linux__
194+
195+int
196+main (int argc __attribute__ ((unused)), char **argv)
197+{
198+ fprintf (stderr, "%s: Unwinding not supported for this architecture\n",
199+ argv[0]);
200+ return 77;
201+}
202+
203+#else /* __linux__ */
204+
205 static void cleanup_13_abort (void);
206 #define main cleanup_13_main
207 #include "cleanup-13.c"
208@@ -148,3 +160,6 @@
209 /* There is an exit (0) call if we find the "main" frame, */
210 error (1, 0, "dwfl_getthreads: %s", dwfl_errmsg (-1));
211 }
212+
213+#endif /* ! __linux__ */
214+
215Index: elfutils-0.158/tests/backtrace-subr.sh
216===================================================================
217--- elfutils-0.158.orig/tests/backtrace-subr.sh 2014-05-01 17:11:18.870616302 +0000
218+++ elfutils-0.158/tests/backtrace-subr.sh 2014-05-01 17:11:18.866616384 +0000
219@@ -84,6 +84,7 @@
220 echo ./backtrace ./backtrace.$arch.{exec,core}
221 testrun ${abs_builddir}/backtrace -e ./backtrace.$arch.exec --core=./backtrace.$arch.core 1>backtrace.$arch.bt 2>backtrace.$arch.err || true
222 cat backtrace.$arch.{bt,err}
223+ check_unsupported backtrace.$arch.err backtrace.$arch.core
224 check_all backtrace.$arch.{bt,err} backtrace.$arch.core
225 }
226
227Index: elfutils-0.158/tests/backtrace.c
228===================================================================
229--- elfutils-0.158.orig/tests/backtrace.c 2014-05-01 17:11:18.870616302 +0000
230+++ elfutils-0.158/tests/backtrace.c 2014-05-01 17:11:18.866616384 +0000
231@@ -39,6 +39,18 @@
232 #include <sys/syscall.h>
233 #include ELFUTILS_HEADER(dwfl)
234
235+#ifndef __linux__
236+
237+int
238+main (int argc __attribute__ ((unused)), char **argv)
239+{
240+ fprintf (stderr, "%s: Unwinding not supported for this architecture\n",
241+ argv[0]);
242+ return 77;
243+}
244+
245+#else /* __linux__ */
246+
247 static int
248 dump_modules (Dwfl_Module *mod, void **userdata __attribute__ ((unused)),
249 const char *name, Dwarf_Addr start,
250@@ -452,3 +464,6 @@
251 dwfl_end (dwfl);
252 return 0;
253 }
254+
255+#endif /* ! __linux__ */
256+
diff --git a/meta/recipes-devtools/elfutils/elfutils-0.158/arm_backend.diff b/meta/recipes-devtools/elfutils/elfutils-0.160/arm_backend.diff
index fc3d6dc3f4..c97c4e470d 100644
--- a/meta/recipes-devtools/elfutils/elfutils-0.158/arm_backend.diff
+++ b/meta/recipes-devtools/elfutils/elfutils-0.160/arm_backend.diff
@@ -1,7 +1,25 @@
1Index: elfutils-0.158/backends/arm_init.c 1From 0db1687eee0b4d16ccbc40db5a06b574fca6614c Mon Sep 17 00:00:00 2001
2=================================================================== 2From: Hongxu Jia <hongxu.jia@windriver.com>
3--- elfutils-0.158.orig/backends/arm_init.c 2014-04-21 11:13:24.378519252 +0000 3Date: Fri, 14 Nov 2014 15:25:42 +0800
4+++ elfutils-0.158/backends/arm_init.c 2014-04-21 11:13:24.374519343 +0000 4Subject: [PATCH] Rebase arm_backend.diff from 0.159 to 0.160
5
6Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
7---
8 backends/arm_init.c | 18 ++++-
9 backends/arm_regs.c | 132 ++++++++++++++++++++++++++++++++++++
10 backends/arm_retval.c | 44 +++++++++++-
11 backends/libebl_arm.h | 9 +++
12 libelf/elf.h | 11 +++
13 tests/run-addrcfi.sh | 93 ++++++++++++++++++++++++-
14 tests/run-allregs.sh | 95 +++++++++++++++++++++++++-
15 tests/run-readelf-mixed-corenote.sh | 11 ++-
16 8 files changed, 401 insertions(+), 12 deletions(-)
17 create mode 100644 backends/libebl_arm.h
18
19diff --git a/backends/arm_init.c b/backends/arm_init.c
20index 3283c97..8b57d3f 100644
21--- a/backends/arm_init.c
22+++ b/backends/arm_init.c
5@@ -35,21 +35,32 @@ 23@@ -35,21 +35,32 @@
6 #define RELOC_PREFIX R_ARM_ 24 #define RELOC_PREFIX R_ARM_
7 #include "libebl_CPU.h" 25 #include "libebl_CPU.h"
@@ -36,7 +54,7 @@ Index: elfutils-0.158/backends/arm_init.c
36 /* We handle it. */ 54 /* We handle it. */
37 eh->name = "ARM"; 55 eh->name = "ARM";
38 arm_init_reloc (eh); 56 arm_init_reloc (eh);
39@@ -61,7 +72,10 @@ 57@@ -61,7 +72,10 @@ arm_init (elf, machine, eh, ehlen)
40 HOOK (eh, core_note); 58 HOOK (eh, core_note);
41 HOOK (eh, auxv_info); 59 HOOK (eh, auxv_info);
42 HOOK (eh, check_object_attribute); 60 HOOK (eh, check_object_attribute);
@@ -46,12 +64,12 @@ Index: elfutils-0.158/backends/arm_init.c
46+ else 64+ else
47+ eh->return_value_location = arm_return_value_location_hard; 65+ eh->return_value_location = arm_return_value_location_hard;
48 HOOK (eh, abi_cfi); 66 HOOK (eh, abi_cfi);
67 HOOK (eh, check_reloc_target_type);
49 68
50 return MODVERSION; 69diff --git a/backends/arm_regs.c b/backends/arm_regs.c
51Index: elfutils-0.158/backends/arm_regs.c 70index 21c5ad3..4ee1039 100644
52=================================================================== 71--- a/backends/arm_regs.c
53--- elfutils-0.158.orig/backends/arm_regs.c 2014-04-21 11:13:24.378519252 +0000 72+++ b/backends/arm_regs.c
54+++ elfutils-0.158/backends/arm_regs.c 2014-04-21 11:13:24.374519343 +0000
55@@ -31,6 +31,7 @@ 73@@ -31,6 +31,7 @@
56 #endif 74 #endif
57 75
@@ -60,7 +78,7 @@ Index: elfutils-0.158/backends/arm_regs.c
60 #include <dwarf.h> 78 #include <dwarf.h>
61 79
62 #define BACKEND arm_ 80 #define BACKEND arm_
63@@ -76,6 +77,9 @@ 81@@ -76,6 +77,9 @@ arm_register_info (Ebl *ebl __attribute__ ((unused)),
64 break; 82 break;
65 83
66 case 16 + 0 ... 16 + 7: 84 case 16 + 0 ... 16 + 7:
@@ -70,7 +88,7 @@ Index: elfutils-0.158/backends/arm_regs.c
70 regno += 96 - 16; 88 regno += 96 - 16;
71 /* Fall through. */ 89 /* Fall through. */
72 case 96 + 0 ... 96 + 7: 90 case 96 + 0 ... 96 + 7:
73@@ -87,11 +91,139 @@ 91@@ -87,11 +91,139 @@ arm_register_info (Ebl *ebl __attribute__ ((unused)),
74 namelen = 2; 92 namelen = 2;
75 break; 93 break;
76 94
@@ -210,11 +228,11 @@ Index: elfutils-0.158/backends/arm_regs.c
210 *setname = "VFP"; 228 *setname = "VFP";
211 *type = DW_ATE_float; 229 *type = DW_ATE_float;
212 *bits = 64; 230 *bits = 64;
213Index: elfutils-0.158/backends/arm_retval.c 231diff --git a/backends/arm_retval.c b/backends/arm_retval.c
214=================================================================== 232index 7aced74..052132e 100644
215--- elfutils-0.158.orig/backends/arm_retval.c 2014-04-21 11:13:24.378519252 +0000 233--- a/backends/arm_retval.c
216+++ elfutils-0.158/backends/arm_retval.c 2014-04-21 11:13:24.374519343 +0000 234+++ b/backends/arm_retval.c
217@@ -48,6 +48,13 @@ 235@@ -48,6 +48,13 @@ static const Dwarf_Op loc_intreg[] =
218 #define nloc_intreg 1 236 #define nloc_intreg 1
219 #define nloc_intregs(n) (2 * (n)) 237 #define nloc_intregs(n) (2 * (n))
220 238
@@ -228,7 +246,7 @@ Index: elfutils-0.158/backends/arm_retval.c
228 /* The return value is a structure and is actually stored in stack space 246 /* The return value is a structure and is actually stored in stack space
229 passed in a hidden argument by the caller. But, the compiler 247 passed in a hidden argument by the caller. But, the compiler
230 helpfully returns the address of that space in r0. */ 248 helpfully returns the address of that space in r0. */
231@@ -58,8 +65,9 @@ 249@@ -58,8 +65,9 @@ static const Dwarf_Op loc_aggregate[] =
232 #define nloc_aggregate 1 250 #define nloc_aggregate 1
233 251
234 252
@@ -240,11 +258,11 @@ Index: elfutils-0.158/backends/arm_retval.c
240 { 258 {
241 /* Start with the function's type, and get the DW_AT_type attribute, 259 /* Start with the function's type, and get the DW_AT_type attribute,
242 which is the type of the return value. */ 260 which is the type of the return value. */
243@@ -112,14 +120,31 @@ 261@@ -98,14 +106,31 @@ arm_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
244 else 262 else
245 return -1; 263 return -1;
246 } 264 }
247+ if (tag == DW_TAG_base_type) 265+ if (tag == DW_TAG_base_type)
248+ { 266+ {
249+ Dwarf_Word encoding; 267+ Dwarf_Word encoding;
250+ if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_encoding, 268+ if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_encoding,
@@ -259,20 +277,20 @@ Index: elfutils-0.158/backends/arm_retval.c
259+ goto aggregate; 277+ goto aggregate;
260+ } 278+ }
261+ } 279+ }
262 if (size <= 16) 280 if (size <= 16)
263 { 281 {
264 intreg: 282 intreg:
265 *locp = loc_intreg; 283 *locp = loc_intreg;
266 return size <= 4 ? nloc_intreg : nloc_intregs ((size + 3) / 4); 284 return size <= 4 ? nloc_intreg : nloc_intregs ((size + 3) / 4);
267 } 285 }
268+ /* fall through. */ 286+ /* fall through. */
269 287
270 aggregate: 288 aggregate:
271+ /* XXX TODO sometimes aggregates are returned in r0 (-mabi=aapcs) */ 289+ /* XXX TODO sometimes aggregates are returned in r0 (-mabi=aapcs) */
272 *locp = loc_aggregate; 290 *locp = loc_aggregate;
273 return nloc_aggregate; 291 return nloc_aggregate;
274 292 }
275@@ -138,3 +163,18 @@ 293@@ -125,3 +150,18 @@ arm_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
276 DWARF and might be valid. */ 294 DWARF and might be valid. */
277 return -2; 295 return -2;
278 } 296 }
@@ -291,11 +309,26 @@ Index: elfutils-0.158/backends/arm_retval.c
291+ return arm_return_value_location_ (functypedie, locp, 0); 309+ return arm_return_value_location_ (functypedie, locp, 0);
292+} 310+}
293+ 311+
294Index: elfutils-0.158/libelf/elf.h 312diff --git a/backends/libebl_arm.h b/backends/libebl_arm.h
295=================================================================== 313new file mode 100644
296--- elfutils-0.158.orig/libelf/elf.h 2014-04-21 11:13:24.378519252 +0000 314index 0000000..c00770c
297+++ elfutils-0.158/libelf/elf.h 2014-04-21 11:13:24.374519343 +0000 315--- /dev/null
298@@ -2318,6 +2318,9 @@ 316+++ b/backends/libebl_arm.h
317@@ -0,0 +1,9 @@
318+#ifndef _LIBEBL_ARM_H
319+#define _LIBEBL_ARM_H 1
320+
321+#include <libdw.h>
322+
323+extern int arm_return_value_location_soft(Dwarf_Die *, const Dwarf_Op **locp);
324+extern int arm_return_value_location_hard(Dwarf_Die *, const Dwarf_Op **locp);
325+
326+#endif
327diff --git a/libelf/elf.h b/libelf/elf.h
328index a3cce3e..0891674 100644
329--- a/libelf/elf.h
330+++ b/libelf/elf.h
331@@ -2346,6 +2346,9 @@ typedef Elf32_Addr Elf32_Conflict;
299 #define EF_ARM_EABI_VER4 0x04000000 332 #define EF_ARM_EABI_VER4 0x04000000
300 #define EF_ARM_EABI_VER5 0x05000000 333 #define EF_ARM_EABI_VER5 0x05000000
301 334
@@ -305,7 +338,7 @@ Index: elfutils-0.158/libelf/elf.h
305 /* Additional symbol types for Thumb. */ 338 /* Additional symbol types for Thumb. */
306 #define STT_ARM_TFUNC STT_LOPROC /* A Thumb function. */ 339 #define STT_ARM_TFUNC STT_LOPROC /* A Thumb function. */
307 #define STT_ARM_16BIT STT_HIPROC /* A Thumb label. */ 340 #define STT_ARM_16BIT STT_HIPROC /* A Thumb label. */
308@@ -2335,12 +2338,19 @@ 341@@ -2363,12 +2366,19 @@ typedef Elf32_Addr Elf32_Conflict;
309 342
310 /* Processor specific values for the Phdr p_type field. */ 343 /* Processor specific values for the Phdr p_type field. */
311 #define PT_ARM_EXIDX (PT_LOPROC + 1) /* ARM unwind segment. */ 344 #define PT_ARM_EXIDX (PT_LOPROC + 1) /* ARM unwind segment. */
@@ -325,7 +358,7 @@ Index: elfutils-0.158/libelf/elf.h
325 358
326 /* AArch64 relocs. */ 359 /* AArch64 relocs. */
327 360
328@@ -2619,6 +2629,7 @@ 361@@ -2647,6 +2657,7 @@ typedef Elf32_Addr Elf32_Conflict;
329 TLS block (LDR, STR). */ 362 TLS block (LDR, STR). */
330 #define R_ARM_TLS_IE12GP 111 /* 12 bit GOT entry relative 363 #define R_ARM_TLS_IE12GP 111 /* 12 bit GOT entry relative
331 to GOT origin (LDR). */ 364 to GOT origin (LDR). */
@@ -333,25 +366,122 @@ Index: elfutils-0.158/libelf/elf.h
333 #define R_ARM_ME_TOO 128 /* Obsolete. */ 366 #define R_ARM_ME_TOO 128 /* Obsolete. */
334 #define R_ARM_THM_TLS_DESCSEQ 129 367 #define R_ARM_THM_TLS_DESCSEQ 129
335 #define R_ARM_THM_TLS_DESCSEQ16 129 368 #define R_ARM_THM_TLS_DESCSEQ16 129
336Index: elfutils-0.158/backends/libebl_arm.h 369diff --git a/tests/run-addrcfi.sh b/tests/run-addrcfi.sh
337=================================================================== 370index 5d33246..78464a8 100755
338--- /dev/null 1970-01-01 00:00:00.000000000 +0000 371--- a/tests/run-addrcfi.sh
339+++ elfutils-0.158/backends/libebl_arm.h 2014-04-21 11:13:24.374519343 +0000 372+++ b/tests/run-addrcfi.sh
340@@ -0,0 +1,9 @@ 373@@ -2530,6 +2530,38 @@ dwarf_cfi_addrframe (.eh_frame): no matching address range
341+#ifndef _LIBEBL_ARM_H 374 FPA reg21 (f5): undefined
342+#define _LIBEBL_ARM_H 1 375 FPA reg22 (f6): undefined
343+ 376 FPA reg23 (f7): undefined
344+#include <libdw.h> 377+ VFP reg64 (s0): undefined
345+ 378+ VFP reg65 (s1): undefined
346+extern int arm_return_value_location_soft(Dwarf_Die *, const Dwarf_Op **locp); 379+ VFP reg66 (s2): undefined
347+extern int arm_return_value_location_hard(Dwarf_Die *, const Dwarf_Op **locp); 380+ VFP reg67 (s3): undefined
348+ 381+ VFP reg68 (s4): undefined
349+#endif 382+ VFP reg69 (s5): undefined
350Index: elfutils-0.158/tests/run-allregs.sh 383+ VFP reg70 (s6): undefined
351=================================================================== 384+ VFP reg71 (s7): undefined
352--- elfutils-0.158.orig/tests/run-allregs.sh 2014-04-21 11:13:24.378519252 +0000 385+ VFP reg72 (s8): undefined
353+++ elfutils-0.158/tests/run-allregs.sh 2014-04-21 11:13:24.378519252 +0000 386+ VFP reg73 (s9): undefined
354@@ -2671,7 +2671,28 @@ 387+ VFP reg74 (s10): undefined
388+ VFP reg75 (s11): undefined
389+ VFP reg76 (s12): undefined
390+ VFP reg77 (s13): undefined
391+ VFP reg78 (s14): undefined
392+ VFP reg79 (s15): undefined
393+ VFP reg80 (s16): undefined
394+ VFP reg81 (s17): undefined
395+ VFP reg82 (s18): undefined
396+ VFP reg83 (s19): undefined
397+ VFP reg84 (s20): undefined
398+ VFP reg85 (s21): undefined
399+ VFP reg86 (s22): undefined
400+ VFP reg87 (s23): undefined
401+ VFP reg88 (s24): undefined
402+ VFP reg89 (s25): undefined
403+ VFP reg90 (s26): undefined
404+ VFP reg91 (s27): undefined
405+ VFP reg92 (s28): undefined
406+ VFP reg93 (s29): undefined
407+ VFP reg94 (s30): undefined
408+ VFP reg95 (s31): undefined
409 FPA reg96 (f0): undefined
410 FPA reg97 (f1): undefined
411 FPA reg98 (f2): undefined
412@@ -2538,7 +2570,66 @@ dwarf_cfi_addrframe (.eh_frame): no matching address range
413 FPA reg101 (f5): undefined
414 FPA reg102 (f6): undefined
415 FPA reg103 (f7): undefined
416- integer reg128 (spsr): undefined
417+ MMX reg104 (wcgr0): undefined
418+ MMX reg105 (wcgr1): undefined
419+ MMX reg106 (wcgr2): undefined
420+ MMX reg107 (wcgr3): undefined
421+ MMX reg108 (wcgr4): undefined
422+ MMX reg109 (wcgr5): undefined
423+ MMX reg110 (wcgr6): undefined
424+ MMX reg111 (wcgr7): undefined
425+ MMX reg112 (wr0): undefined
426+ MMX reg113 (wr1): undefined
427+ MMX reg114 (wr2): undefined
428+ MMX reg115 (wr3): undefined
429+ MMX reg116 (wr4): undefined
430+ MMX reg117 (wr5): undefined
431+ MMX reg118 (wr6): undefined
432+ MMX reg119 (wr7): undefined
433+ MMX reg120 (wr8): undefined
434+ MMX reg121 (wr9): undefined
435+ MMX reg122 (wr10): undefined
436+ MMX reg123 (wr11): undefined
437+ MMX reg124 (wr12): undefined
438+ MMX reg125 (wr13): undefined
439+ MMX reg126 (wr14): undefined
440+ MMX reg127 (wr15): undefined
441+ state reg128 (spsr): undefined
442+ state reg129 (spsr_fiq): undefined
443+ state reg130 (spsr_irq): undefined
444+ state reg131 (spsr_abt): undefined
445+ state reg132 (spsr_und): undefined
446+ state reg133 (spsr_svc): undefined
447+ integer reg144 (r8_usr): undefined
448+ integer reg145 (r9_usr): undefined
449+ integer reg146 (r10_usr): undefined
450+ integer reg147 (r11_usr): undefined
451+ integer reg148 (r12_usr): undefined
452+ integer reg149 (r13_usr): undefined
453+ integer reg150 (r14_usr): undefined
454+ integer reg151 (r8_fiq): undefined
455+ integer reg152 (r9_fiq): undefined
456+ integer reg153 (r10_fiq): undefined
457+ integer reg154 (r11_fiq): undefined
458+ integer reg155 (r12_fiq): undefined
459+ integer reg156 (r13_fiq): undefined
460+ integer reg157 (r14_fiq): undefined
461+ integer reg158 (r13_irq): undefined
462+ integer reg159 (r14_irq): undefined
463+ integer reg160 (r13_abt): undefined
464+ integer reg161 (r14_abt): undefined
465+ integer reg162 (r13_und): undefined
466+ integer reg163 (r14_und): undefined
467+ integer reg164 (r13_svc): undefined
468+ integer reg165 (r14_svc): undefined
469+ MMX reg192 (wc0): undefined
470+ MMX reg193 (wc1): undefined
471+ MMX reg194 (wc2): undefined
472+ MMX reg195 (wc3): undefined
473+ MMX reg196 (wc4): undefined
474+ MMX reg197 (wc5): undefined
475+ MMX reg198 (wc6): undefined
476+ MMX reg199 (wc7): undefined
477 VFP reg256 (d0): undefined
478 VFP reg257 (d1): undefined
479 VFP reg258 (d2): undefined
480diff --git a/tests/run-allregs.sh b/tests/run-allregs.sh
481index 6f3862e..13557d5 100755
482--- a/tests/run-allregs.sh
483+++ b/tests/run-allregs.sh
484@@ -2671,7 +2671,28 @@ integer registers:
355 13: sp (sp), address 32 bits 485 13: sp (sp), address 32 bits
356 14: lr (lr), address 32 bits 486 14: lr (lr), address 32 bits
357 15: pc (pc), address 32 bits 487 15: pc (pc), address 32 bits
@@ -381,7 +511,7 @@ Index: elfutils-0.158/tests/run-allregs.sh
381 FPA registers: 511 FPA registers:
382 16: f0 (f0), float 96 bits 512 16: f0 (f0), float 96 bits
383 17: f1 (f1), float 96 bits 513 17: f1 (f1), float 96 bits
384@@ -2689,7 +2710,72 @@ 514@@ -2689,7 +2710,72 @@ FPA registers:
385 101: f5 (f5), float 96 bits 515 101: f5 (f5), float 96 bits
386 102: f6 (f6), float 96 bits 516 102: f6 (f6), float 96 bits
387 103: f7 (f7), float 96 bits 517 103: f7 (f7), float 96 bits
@@ -454,7 +584,7 @@ Index: elfutils-0.158/tests/run-allregs.sh
454 256: d0 (d0), float 64 bits 584 256: d0 (d0), float 64 bits
455 257: d1 (d1), float 64 bits 585 257: d1 (d1), float 64 bits
456 258: d2 (d2), float 64 bits 586 258: d2 (d2), float 64 bits
457@@ -2722,6 +2808,13 @@ 587@@ -2722,6 +2808,13 @@ VFP registers:
458 285: d29 (d29), float 64 bits 588 285: d29 (d29), float 64 bits
459 286: d30 (d30), float 64 bits 589 286: d30 (d30), float 64 bits
460 287: d31 (d31), float 64 bits 590 287: d31 (d31), float 64 bits
@@ -468,11 +598,11 @@ Index: elfutils-0.158/tests/run-allregs.sh
468 EOF 598 EOF
469 599
470 # See run-readelf-mixed-corenote.sh for instructions to regenerate 600 # See run-readelf-mixed-corenote.sh for instructions to regenerate
471Index: elfutils-0.158/tests/run-readelf-mixed-corenote.sh 601diff --git a/tests/run-readelf-mixed-corenote.sh b/tests/run-readelf-mixed-corenote.sh
472=================================================================== 602index 01e4594..9a8a380 100755
473--- elfutils-0.158.orig/tests/run-readelf-mixed-corenote.sh 2014-04-21 11:13:24.378519252 +0000 603--- a/tests/run-readelf-mixed-corenote.sh
474+++ elfutils-0.158/tests/run-readelf-mixed-corenote.sh 2014-04-21 11:13:24.378519252 +0000 604+++ b/tests/run-readelf-mixed-corenote.sh
475@@ -30,12 +30,11 @@ 605@@ -30,12 +30,11 @@ Note segment of 892 bytes at offset 0x274:
476 pid: 11087, ppid: 11063, pgrp: 11087, sid: 11063 606 pid: 11087, ppid: 11063, pgrp: 11087, sid: 11063
477 utime: 0.000000, stime: 0.010000, cutime: 0.000000, cstime: 0.000000 607 utime: 0.000000, stime: 0.010000, cutime: 0.000000, cstime: 0.000000
478 orig_r0: -1, fpvalid: 1 608 orig_r0: -1, fpvalid: 1
@@ -490,114 +620,6 @@ Index: elfutils-0.158/tests/run-readelf-mixed-corenote.sh
490 CORE 124 PRPSINFO 620 CORE 124 PRPSINFO
491 state: 0, sname: R, zomb: 0, nice: 0, flag: 0x00400500 621 state: 0, sname: R, zomb: 0, nice: 0, flag: 0x00400500
492 uid: 0, gid: 0, pid: 11087, ppid: 11063, pgrp: 11087, sid: 11063 622 uid: 0, gid: 0, pid: 11087, ppid: 11063, pgrp: 11087, sid: 11063
493Index: elfutils-0.158/tests/run-addrcfi.sh 623--
494=================================================================== 6241.9.1
495--- elfutils-0.158.orig/tests/run-addrcfi.sh 2014-04-21 11:13:24.378519252 +0000 625
496+++ elfutils-0.158/tests/run-addrcfi.sh 2014-04-21 11:13:24.378519252 +0000
497@@ -2530,6 +2530,38 @@
498 FPA reg21 (f5): undefined
499 FPA reg22 (f6): undefined
500 FPA reg23 (f7): undefined
501+ VFP reg64 (s0): undefined
502+ VFP reg65 (s1): undefined
503+ VFP reg66 (s2): undefined
504+ VFP reg67 (s3): undefined
505+ VFP reg68 (s4): undefined
506+ VFP reg69 (s5): undefined
507+ VFP reg70 (s6): undefined
508+ VFP reg71 (s7): undefined
509+ VFP reg72 (s8): undefined
510+ VFP reg73 (s9): undefined
511+ VFP reg74 (s10): undefined
512+ VFP reg75 (s11): undefined
513+ VFP reg76 (s12): undefined
514+ VFP reg77 (s13): undefined
515+ VFP reg78 (s14): undefined
516+ VFP reg79 (s15): undefined
517+ VFP reg80 (s16): undefined
518+ VFP reg81 (s17): undefined
519+ VFP reg82 (s18): undefined
520+ VFP reg83 (s19): undefined
521+ VFP reg84 (s20): undefined
522+ VFP reg85 (s21): undefined
523+ VFP reg86 (s22): undefined
524+ VFP reg87 (s23): undefined
525+ VFP reg88 (s24): undefined
526+ VFP reg89 (s25): undefined
527+ VFP reg90 (s26): undefined
528+ VFP reg91 (s27): undefined
529+ VFP reg92 (s28): undefined
530+ VFP reg93 (s29): undefined
531+ VFP reg94 (s30): undefined
532+ VFP reg95 (s31): undefined
533 FPA reg96 (f0): undefined
534 FPA reg97 (f1): undefined
535 FPA reg98 (f2): undefined
536@@ -2538,7 +2570,66 @@
537 FPA reg101 (f5): undefined
538 FPA reg102 (f6): undefined
539 FPA reg103 (f7): undefined
540- integer reg128 (spsr): undefined
541+ MMX reg104 (wcgr0): undefined
542+ MMX reg105 (wcgr1): undefined
543+ MMX reg106 (wcgr2): undefined
544+ MMX reg107 (wcgr3): undefined
545+ MMX reg108 (wcgr4): undefined
546+ MMX reg109 (wcgr5): undefined
547+ MMX reg110 (wcgr6): undefined
548+ MMX reg111 (wcgr7): undefined
549+ MMX reg112 (wr0): undefined
550+ MMX reg113 (wr1): undefined
551+ MMX reg114 (wr2): undefined
552+ MMX reg115 (wr3): undefined
553+ MMX reg116 (wr4): undefined
554+ MMX reg117 (wr5): undefined
555+ MMX reg118 (wr6): undefined
556+ MMX reg119 (wr7): undefined
557+ MMX reg120 (wr8): undefined
558+ MMX reg121 (wr9): undefined
559+ MMX reg122 (wr10): undefined
560+ MMX reg123 (wr11): undefined
561+ MMX reg124 (wr12): undefined
562+ MMX reg125 (wr13): undefined
563+ MMX reg126 (wr14): undefined
564+ MMX reg127 (wr15): undefined
565+ state reg128 (spsr): undefined
566+ state reg129 (spsr_fiq): undefined
567+ state reg130 (spsr_irq): undefined
568+ state reg131 (spsr_abt): undefined
569+ state reg132 (spsr_und): undefined
570+ state reg133 (spsr_svc): undefined
571+ integer reg144 (r8_usr): undefined
572+ integer reg145 (r9_usr): undefined
573+ integer reg146 (r10_usr): undefined
574+ integer reg147 (r11_usr): undefined
575+ integer reg148 (r12_usr): undefined
576+ integer reg149 (r13_usr): undefined
577+ integer reg150 (r14_usr): undefined
578+ integer reg151 (r8_fiq): undefined
579+ integer reg152 (r9_fiq): undefined
580+ integer reg153 (r10_fiq): undefined
581+ integer reg154 (r11_fiq): undefined
582+ integer reg155 (r12_fiq): undefined
583+ integer reg156 (r13_fiq): undefined
584+ integer reg157 (r14_fiq): undefined
585+ integer reg158 (r13_irq): undefined
586+ integer reg159 (r14_irq): undefined
587+ integer reg160 (r13_abt): undefined
588+ integer reg161 (r14_abt): undefined
589+ integer reg162 (r13_und): undefined
590+ integer reg163 (r14_und): undefined
591+ integer reg164 (r13_svc): undefined
592+ integer reg165 (r14_svc): undefined
593+ MMX reg192 (wc0): undefined
594+ MMX reg193 (wc1): undefined
595+ MMX reg194 (wc2): undefined
596+ MMX reg195 (wc3): undefined
597+ MMX reg196 (wc4): undefined
598+ MMX reg197 (wc5): undefined
599+ MMX reg198 (wc6): undefined
600+ MMX reg199 (wc7): undefined
601 VFP reg256 (d0): undefined
602 VFP reg257 (d1): undefined
603 VFP reg258 (d2): undefined
diff --git a/meta/recipes-devtools/elfutils/elfutils-0.160/arm_func_value.patch b/meta/recipes-devtools/elfutils/elfutils-0.160/arm_func_value.patch
new file mode 100644
index 0000000000..eeb2063807
--- /dev/null
+++ b/meta/recipes-devtools/elfutils/elfutils-0.160/arm_func_value.patch
@@ -0,0 +1,166 @@
1From: Mark Wielaard <mjw@redhat.com>
2Date: Sun, 15 Jun 2014 11:30:35 +0200
3Subject: libebl: Add sym_func_value hook.
4
5The ARM EABI says that the zero bit of function symbol st_value indicates
6whether the symbol points to a THUMB or ARM function. Add a new ebl hook
7to adjust the st_value in such a case so that we get the actual value that
8the symbol points to. It isn't easily possible to reuse the existing
9resolve_sym_value for this purpose, so we end up with another hook that
10can be used from dwfl_module_getsym and elflint.
11
12Rebase arm_func_value.patch from 0.159 to 0.160
13Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
14---
15 backends/arm_init.c | 1 +
16 backends/arm_symbol.c | 8 ++++++++
17 libdwfl/dwfl_module_getsym.c | 2 +-
18 libebl/Makefile.am | 3 ++-
19 libebl/ebl-hooks.h | 3 +++
20 libebl/eblsymfuncval.c | 43 +++++++++++++++++++++++++++++++++++++++++++
21 libebl/libebl.h | 11 +++++++++++
22 7 files changed, 69 insertions(+), 2 deletions(-)
23 create mode 100644 libebl/eblsymfuncval.c
24
25diff --git a/backends/arm_init.c b/backends/arm_init.c
26index 8b57d3f..2266829 100644
27--- a/backends/arm_init.c
28+++ b/backends/arm_init.c
29@@ -78,6 +78,7 @@ arm_init (elf, machine, eh, ehlen)
30 eh->return_value_location = arm_return_value_location_hard;
31 HOOK (eh, abi_cfi);
32 HOOK (eh, check_reloc_target_type);
33+ HOOK (eh, sym_func_value);
34
35 /* We only unwind the core integer registers. */
36 eh->frame_nregs = 16;
37diff --git a/backends/arm_symbol.c b/backends/arm_symbol.c
38index cd467ff..49fca55 100644
39--- a/backends/arm_symbol.c
40+++ b/backends/arm_symbol.c
41@@ -129,3 +129,11 @@ arm_check_reloc_target_type (Ebl *ebl __attribute__ ((unused)), Elf64_Word sh_ty
42 {
43 return sh_type == SHT_ARM_EXIDX;
44 }
45+
46+/* ARM EABI says that the low bit indicates whether the function
47+ symbol value is a THUMB function or not. Mask it off. */
48+GElf_Addr
49+arm_sym_func_value (Ebl *ebl __attribute__ ((unused)), GElf_Addr val)
50+{
51+ return val & ~(GElf_Addr)1;
52+}
53diff --git a/libdwfl/dwfl_module_getsym.c b/libdwfl/dwfl_module_getsym.c
54index 42d2b67..fb192d7 100644
55--- a/libdwfl/dwfl_module_getsym.c
56+++ b/libdwfl/dwfl_module_getsym.c
57@@ -119,7 +119,7 @@ __libdwfl_getsym (Dwfl_Module *mod, int ndx, GElf_Sym *sym, GElf_Addr *addr,
58 descriptors). */
59
60 char *ident;
61- GElf_Addr st_value = sym->st_value & ebl_func_addr_mask (mod->ebl);
62+ GElf_Addr st_value = ebl_sym_func_value (mod->ebl, sym->st_value);
63 *resolved = false;
64 if (! adjust_st_value && mod->e_type != ET_REL && alloc
65 && (GELF_ST_TYPE (sym->st_info) == STT_FUNC
66diff --git a/libebl/Makefile.am b/libebl/Makefile.am
67index ec4477b..889c21b 100644
68--- a/libebl/Makefile.am
69+++ b/libebl/Makefile.am
70@@ -55,7 +55,8 @@ gen_SOURCES = eblopenbackend.c eblclosebackend.c eblstrtab.c \
71 eblsysvhashentrysize.c eblauxvinfo.c eblcheckobjattr.c \
72 ebl_check_special_section.c ebl_syscall_abi.c eblabicfi.c \
73 eblstother.c eblinitreg.c ebldwarftoregno.c eblnormalizepc.c \
74- eblunwind.c eblresolvesym.c eblcheckreloctargettype.c
75+ eblunwind.c eblresolvesym.c eblcheckreloctargettype.c \
76+ eblsymfuncval.c
77
78 libebl_a_SOURCES = $(gen_SOURCES)
79
80diff --git a/libebl/ebl-hooks.h b/libebl/ebl-hooks.h
81index e1186f8..160a821 100644
82--- a/libebl/ebl-hooks.h
83+++ b/libebl/ebl-hooks.h
84@@ -191,5 +191,8 @@ bool EBLHOOK(unwind) (Ebl *ebl, Dwarf_Addr pc, ebl_tid_registers_t *setfunc,
85 (e.g. function descriptor resolving) */
86 bool EBLHOOK(resolve_sym_value) (Ebl *ebl, GElf_Addr *addr);
87
88+/* Returns the real value of a symbol function address or offset. */
89+GElf_Addr EBLHOOK(sym_func_value) (Ebl *ebl, GElf_Addr val);
90+
91 /* Destructor for ELF backend handle. */
92 void EBLHOOK(destr) (struct ebl *);
93diff --git a/libebl/eblsymfuncval.c b/libebl/eblsymfuncval.c
94new file mode 100644
95index 0000000..c0b322f
96--- /dev/null
97+++ b/libebl/eblsymfuncval.c
98@@ -0,0 +1,43 @@
99+/* Turn a symbol function value into a real function address or offset.
100+ Copyright (C) 2014 Red Hat, Inc.
101+ This file is part of elfutils.
102+
103+ This file is free software; you can redistribute it and/or modify
104+ it under the terms of either
105+
106+ * the GNU Lesser General Public License as published by the Free
107+ Software Foundation; either version 3 of the License, or (at
108+ your option) any later version
109+
110+ or
111+
112+ * the GNU General Public License as published by the Free
113+ Software Foundation; either version 2 of the License, or (at
114+ your option) any later version
115+
116+ or both in parallel, as here.
117+
118+ elfutils is distributed in the hope that it will be useful, but
119+ WITHOUT ANY WARRANTY; without even the implied warranty of
120+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
121+ General Public License for more details.
122+
123+ You should have received copies of the GNU General Public License and
124+ the GNU Lesser General Public License along with this program. If
125+ not, see <http://www.gnu.org/licenses/>. */
126+
127+#ifdef HAVE_CONFIG_H
128+# include <config.h>
129+#endif
130+
131+#include <libeblP.h>
132+#include <assert.h>
133+
134+GElf_Addr
135+ebl_sym_func_value (Ebl *ebl, GElf_Addr val)
136+{
137+ if (ebl == NULL || ebl->sym_func_value == NULL)
138+ return val;
139+
140+ return ebl->sym_func_value (ebl, val);
141+}
142diff --git a/libebl/libebl.h b/libebl/libebl.h
143index bb993bf..40cf635 100644
144--- a/libebl/libebl.h
145+++ b/libebl/libebl.h
146@@ -459,6 +459,17 @@ extern bool ebl_unwind (Ebl *ebl, Dwarf_Addr pc, ebl_tid_registers_t *setfunc,
147 extern bool ebl_resolve_sym_value (Ebl *ebl, GElf_Addr *addr)
148 __nonnull_attribute__ (2);
149
150+/* Returns the real value of a symbol function address or offset
151+ (e.g. when the st_value contains some flag bits that need to be
152+ masked off). This is different from ebl_resolve_sym_value which
153+ only works for actual symbol addresses (in non-ET_REL files) that
154+ might resolve to an address in a different section.
155+ ebl_sym_func_value is called to turn the given value into the a
156+ real address or offset (the original value might not be a real
157+ address). This works for both ET_REL when the value is a section
158+ offset or ET_EXEC or ET_DYN symbol values, which are addresses. */
159+extern GElf_Addr ebl_sym_func_value (Ebl *ebl, GElf_Addr val);
160+
161 #ifdef __cplusplus
162 }
163 #endif
164--
1651.9.1
166
diff --git a/meta/recipes-devtools/elfutils/elfutils-0.160/arm_unwind_ret_mask.patch b/meta/recipes-devtools/elfutils/elfutils-0.160/arm_unwind_ret_mask.patch
new file mode 100644
index 0000000000..8abb36bb49
--- /dev/null
+++ b/meta/recipes-devtools/elfutils/elfutils-0.160/arm_unwind_ret_mask.patch
@@ -0,0 +1,83 @@
1From: Mark Wielaard <mjw@redhat.com>
2Date: Sun, 15 Jun 2014 12:30:02 +0200
3Subject: libebl: Add ebl_unwind_ret_mask.
4
5Another ARM oddity. A return value address in an unwind will contain an
6extra bit to indicate whether to return to a regular ARM or THUMB function.
7Add a new ebl function to return a mask to use to get the actual return
8address during an unwind ebl_unwind_ret_mask.
9
10Rebase arm_unwind_ret_mask.patch from 0.159 to 0.160
11
12Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
13---
14 backends/arm_init.c | 3 +++
15 libebl/eblinitreg.c | 8 ++++++++
16 libebl/libebl.h | 4 ++++
17 libebl/libeblP.h | 6 ++++++
18 4 files changed, 21 insertions(+)
19
20diff --git a/backends/arm_init.c b/backends/arm_init.c
21index 2266829..f8df042 100644
22--- a/backends/arm_init.c
23+++ b/backends/arm_init.c
24@@ -87,5 +87,8 @@ arm_init (elf, machine, eh, ehlen)
25 /* Bit zero encodes whether an function address is THUMB or ARM. */
26 eh->func_addr_mask = ~(GElf_Addr)1;
27
28+ /* Bit zero encodes whether to return to a THUMB or ARM function. */
29+ eh->unwind_ret_mask = ~(GElf_Addr)1;
30+
31 return MODVERSION;
32 }
33diff --git a/libebl/eblinitreg.c b/libebl/eblinitreg.c
34index 5729b3c..ca681c0 100644
35--- a/libebl/eblinitreg.c
36+++ b/libebl/eblinitreg.c
37@@ -56,3 +56,11 @@ ebl_func_addr_mask (Ebl *ebl)
38 return ((ebl == NULL || ebl->func_addr_mask == 0)
39 ? ~(GElf_Addr)0 : ebl->func_addr_mask);
40 }
41+
42+GElf_Addr
43+ebl_unwind_ret_mask (Ebl *ebl)
44+{
45+ return ((ebl == NULL || ebl->unwind_ret_mask == 0)
46+ ? ~(GElf_Addr)0 : ebl->unwind_ret_mask);
47+}
48+
49diff --git a/libebl/libebl.h b/libebl/libebl.h
50index 40cf635..be70027 100644
51--- a/libebl/libebl.h
52+++ b/libebl/libebl.h
53@@ -420,6 +420,10 @@ extern size_t ebl_frame_nregs (Ebl *ebl)
54 tables) is needed. */
55 extern GElf_Addr ebl_func_addr_mask (Ebl *ebl);
56
57+/* Mask to use for unwind return address in case the architecture adds
58+ some extra non-address bits to it. */
59+extern GElf_Addr ebl_unwind_ret_mask (Ebl *ebl);
60+
61 /* Convert *REGNO as is in DWARF to a lower range suitable for
62 Dwarf_Frame->REGS indexing. */
63 extern bool ebl_dwarf_to_regno (Ebl *ebl, unsigned *regno)
64diff --git a/libebl/libeblP.h b/libebl/libeblP.h
65index dbd67f3..e18ace6 100644
66--- a/libebl/libeblP.h
67+++ b/libebl/libeblP.h
68@@ -70,6 +70,12 @@ struct ebl
69 otherwise it should be the actual mask to use. */
70 GElf_Addr func_addr_mask;
71
72+ /* Mask to use to get the return address from an unwind in case the
73+ architecture adds some extra non-address bits to it. When not
74+ initialized (0) then ebl_unwind_ret_mask will return ~0, otherwise
75+ it should be the actual mask to use. */
76+ GElf_Addr unwind_ret_mask;
77+
78 /* Function descriptor load address and table as used by
79 ebl_resolve_sym_value if available for this arch. */
80 GElf_Addr fd_addr;
81--
821.9.1
83
diff --git a/meta/recipes-devtools/elfutils/elfutils-0.158/fixheadercheck.patch b/meta/recipes-devtools/elfutils/elfutils-0.160/fixheadercheck.patch
index 8796e9a394..8796e9a394 100644
--- a/meta/recipes-devtools/elfutils/elfutils-0.158/fixheadercheck.patch
+++ b/meta/recipes-devtools/elfutils/elfutils-0.160/fixheadercheck.patch
diff --git a/meta/recipes-devtools/elfutils/elfutils-0.158/hppa_backend.diff b/meta/recipes-devtools/elfutils/elfutils-0.160/hppa_backend.diff
index 6c19d176e0..d51a720073 100644
--- a/meta/recipes-devtools/elfutils/elfutils-0.158/hppa_backend.diff
+++ b/meta/recipes-devtools/elfutils/elfutils-0.160/hppa_backend.diff
@@ -478,7 +478,7 @@ Index: elfutils-0.158/backends/parisc_retval.c
478+ /* Follow typedefs and qualifiers to get to the actual type. */ 478+ /* Follow typedefs and qualifiers to get to the actual type. */
479+ while (tag == DW_TAG_typedef 479+ while (tag == DW_TAG_typedef
480+ || tag == DW_TAG_const_type || tag == DW_TAG_volatile_type 480+ || tag == DW_TAG_const_type || tag == DW_TAG_volatile_type
481+ || tag == DW_TAG_restrict_type || tag == DW_TAG_mutable_type) 481+ || tag == DW_TAG_restrict_type)
482+ { 482+ {
483+ attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem); 483+ attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem);
484+ typedie = dwarf_formref_die (attr, &die_mem); 484+ typedie = dwarf_formref_die (attr, &die_mem);
diff --git a/meta/recipes-devtools/elfutils/elfutils-0.158/m68k_backend.diff b/meta/recipes-devtools/elfutils/elfutils-0.160/m68k_backend.diff
index 48bffdad0c..f5b566f2d5 100644
--- a/meta/recipes-devtools/elfutils/elfutils-0.158/m68k_backend.diff
+++ b/meta/recipes-devtools/elfutils/elfutils-0.160/m68k_backend.diff
@@ -409,7 +409,7 @@ Index: elfutils-0.158/backends/m68k_retval.c
409+ /* Follow typedefs and qualifiers to get to the actual type. */ 409+ /* Follow typedefs and qualifiers to get to the actual type. */
410+ while (tag == DW_TAG_typedef 410+ while (tag == DW_TAG_typedef
411+ || tag == DW_TAG_const_type || tag == DW_TAG_volatile_type 411+ || tag == DW_TAG_const_type || tag == DW_TAG_volatile_type
412+ || tag == DW_TAG_restrict_type || tag == DW_TAG_mutable_type) 412+ || tag == DW_TAG_restrict_type)
413+ { 413+ {
414+ attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem); 414+ attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem);
415+ typedie = dwarf_formref_die (attr, &die_mem); 415+ typedie = dwarf_formref_die (attr, &die_mem);
diff --git a/meta/recipes-devtools/elfutils/elfutils-0.158/mips_backend.diff b/meta/recipes-devtools/elfutils/elfutils-0.160/mips_backend.diff
index b188927a0b..d73a3f2869 100644
--- a/meta/recipes-devtools/elfutils/elfutils-0.158/mips_backend.diff
+++ b/meta/recipes-devtools/elfutils/elfutils-0.160/mips_backend.diff
@@ -496,7 +496,7 @@ Index: elfutils-0.158/backends/mips_retval.c
496+ /* Follow typedefs and qualifiers to get to the actual type. */ 496+ /* Follow typedefs and qualifiers to get to the actual type. */
497+ while (tag == DW_TAG_typedef 497+ while (tag == DW_TAG_typedef
498+ || tag == DW_TAG_const_type || tag == DW_TAG_volatile_type 498+ || tag == DW_TAG_const_type || tag == DW_TAG_volatile_type
499+ || tag == DW_TAG_restrict_type || tag == DW_TAG_mutable_type) 499+ || tag == DW_TAG_restrict_type)
500+ { 500+ {
501+ attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem); 501+ attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem);
502+ typedie = dwarf_formref_die (attr, &die_mem); 502+ typedie = dwarf_formref_die (attr, &die_mem);
diff --git a/meta/recipes-devtools/elfutils/elfutils-0.158/mips_readelf_w.patch b/meta/recipes-devtools/elfutils/elfutils-0.160/mips_readelf_w.patch
index 8e669e7199..8e669e7199 100644
--- a/meta/recipes-devtools/elfutils/elfutils-0.158/mips_readelf_w.patch
+++ b/meta/recipes-devtools/elfutils/elfutils-0.160/mips_readelf_w.patch
diff --git a/meta/recipes-devtools/elfutils/elfutils-0.160/non_linux.patch b/meta/recipes-devtools/elfutils/elfutils-0.160/non_linux.patch
new file mode 100644
index 0000000000..35b1b389fb
--- /dev/null
+++ b/meta/recipes-devtools/elfutils/elfutils-0.160/non_linux.patch
@@ -0,0 +1,35 @@
1Index: elfutils-0.159/libdwfl/linux-pid-attach.c
2===================================================================
3--- elfutils-0.159.orig/libdwfl/linux-pid-attach.c
4+++ elfutils-0.159/libdwfl/linux-pid-attach.c
5@@ -393,6 +393,16 @@ pid_getthread (Dwfl *dwfl __attribute__
6 return false;
7 }
8
9+bool
10+internal_function
11+__libdwfl_ptrace_attach (pid_t tid __attribute__ ((unused)),
12+ bool *tid_was_stoppedp __attribute__ ((unused)))
13+{
14+ errno = ENOSYS;
15+ __libdwfl_seterrno (DWFL_E_ERRNO);
16+ return false;
17+}
18+
19 static bool
20 pid_memory_read (Dwfl *dwfl __attribute__ ((unused)),
21 Dwarf_Addr addr __attribute__ ((unused)),
22@@ -419,6 +429,13 @@ pid_detach (Dwfl *dwfl __attribute__ ((u
23 {
24 }
25
26+void
27+internal_function
28+__libdwfl_ptrace_detach (pid_t tid __attribute__ ((unused)),
29+ bool tid_was_stopped __attribute__ ((unused)))
30+{
31+}
32+
33 static void
34 pid_thread_detach (Dwfl_Thread *thread __attribute__ ((unused)),
35 void *thread_arg __attribute__ ((unused)))
diff --git a/meta/recipes-devtools/elfutils/elfutils-0.158/redhat-portability.diff b/meta/recipes-devtools/elfutils/elfutils-0.160/redhat-portability.diff
index 5a75375690..a358b11fe6 100644
--- a/meta/recipes-devtools/elfutils/elfutils-0.158/redhat-portability.diff
+++ b/meta/recipes-devtools/elfutils/elfutils-0.160/redhat-portability.diff
@@ -1,6 +1,8 @@
1--- elfutils/backends/ChangeLog 1Index: elfutils-0.159/backends/ChangeLog
2+++ elfutils/backends/ChangeLog 2===================================================================
3@@ -292,6 +292,10 @@ 3--- elfutils-0.159.orig/backends/ChangeLog
4+++ elfutils-0.159/backends/ChangeLog
5@@ -364,6 +364,10 @@
4 * ppc_attrs.c (ppc_check_object_attribute): Handle tag 6 * ppc_attrs.c (ppc_check_object_attribute): Handle tag
5 GNU_Power_ABI_Struct_Return. 7 GNU_Power_ABI_Struct_Return.
6 8
@@ -11,7 +13,7 @@
11 2008-10-04 Ulrich Drepper <drepper@redhat.com> 13 2008-10-04 Ulrich Drepper <drepper@redhat.com>
12 14
13 * i386_reloc.def: Fix entries for TLS_GOTDESC, TLS_DESC_CALL, and 15 * i386_reloc.def: Fix entries for TLS_GOTDESC, TLS_DESC_CALL, and
14@@ -619,6 +623,11 @@ 16@@ -691,6 +695,11 @@
15 * sparc_init.c: Likewise. 17 * sparc_init.c: Likewise.
16 * x86_64_init.c: Likewise. 18 * x86_64_init.c: Likewise.
17 19
@@ -23,7 +25,7 @@
23 2005-11-19 Roland McGrath <roland@redhat.com> 25 2005-11-19 Roland McGrath <roland@redhat.com>
24 26
25 * ppc64_reloc.def: REL30 -> ADDR30. 27 * ppc64_reloc.def: REL30 -> ADDR30.
26@@ -641,6 +650,9 @@ 28@@ -713,6 +722,9 @@
27 * Makefile.am (uninstall): Don't try to remove $(pkgincludedir). 29 * Makefile.am (uninstall): Don't try to remove $(pkgincludedir).
28 (CLEANFILES): Add libebl_$(m).so. 30 (CLEANFILES): Add libebl_$(m).so.
29 31
@@ -33,20 +35,24 @@
33 * ppc_reloc.def: Update bits per Alan Modra <amodra@bigpond.net.au>. 35 * ppc_reloc.def: Update bits per Alan Modra <amodra@bigpond.net.au>.
34 * ppc64_reloc.def: Likewise. 36 * ppc64_reloc.def: Likewise.
35 37
36--- elfutils/backends/Makefile.am 38Index: elfutils-0.159/backends/Makefile.am
37+++ elfutils/backends/Makefile.am 39===================================================================
38@@ -124,7 +124,7 @@ libebl_%.so libebl_%.map: libebl_%_pic.a 40--- elfutils-0.159.orig/backends/Makefile.am
41+++ elfutils-0.159/backends/Makefile.am
42@@ -119,7 +119,7 @@ libebl_%.so libebl_%.map: libebl_%_pic.a
39 $(LINK) -shared -o $(@:.map=.so) \ 43 $(LINK) -shared -o $(@:.map=.so) \
40 -Wl,--whole-archive $< $(cpu_$*) -Wl,--no-whole-archive \ 44 -Wl,--whole-archive $< $(cpu_$*) -Wl,--no-whole-archive \
41 -Wl,--version-script,$(@:.so=.map) \ 45 -Wl,--version-script,$(@:.so=.map) \
42- -Wl,-z,defs -Wl,--as-needed $(libelf) $(libdw) $(libmudflap) 46- -Wl,-z,defs -Wl,--as-needed $(libelf) $(libdw)
43+ -Wl,-z,defs $(LD_AS_NEEDED) $(libelf) $(libdw) $(libmudflap) 47+ -Wl,-z,defs $(LD_AS_NEEDED) $(libelf) $(libdw)
44 $(textrel_check) 48 $(textrel_check)
45 49
46 libebl_i386.so: $(cpu_i386) 50 libebl_i386.so: $(cpu_i386)
47--- elfutils/ChangeLog 51Index: elfutils-0.159/ChangeLog
48+++ elfutils/ChangeLog 52===================================================================
49@@ -118,6 +118,8 @@ 53--- elfutils-0.159.orig/ChangeLog
54+++ elfutils-0.159/ChangeLog
55@@ -148,6 +148,8 @@
50 56
51 2012-01-24 Mark Wielaard <mjw@redhat.com> 57 2012-01-24 Mark Wielaard <mjw@redhat.com>
52 58
@@ -55,7 +61,7 @@
55 * COPYING: Fix address. Updated version from gnulib. 61 * COPYING: Fix address. Updated version from gnulib.
56 62
57 2012-01-23 Mark Wielaard <mjw@redhat.com> 63 2012-01-23 Mark Wielaard <mjw@redhat.com>
58@@ -136,6 +138,9 @@ 64@@ -166,6 +168,9 @@
59 65
60 2011-10-08 Mike Frysinger <vapier@gentoo.org> 66 2011-10-08 Mike Frysinger <vapier@gentoo.org>
61 67
@@ -65,7 +71,7 @@
65 * configure.ac: Fix use of AC_ARG_ENABLE to handle $enableval correctly. 71 * configure.ac: Fix use of AC_ARG_ENABLE to handle $enableval correctly.
66 72
67 2011-10-02 Ulrich Drepper <drepper@gmail.com> 73 2011-10-02 Ulrich Drepper <drepper@gmail.com>
68@@ -157,6 +162,10 @@ 74@@ -187,6 +192,10 @@
69 75
70 * configure.ac (LOCALEDIR, DATADIRNAME): Removed. 76 * configure.ac (LOCALEDIR, DATADIRNAME): Removed.
71 77
@@ -76,7 +82,7 @@
76 2009-09-21 Ulrich Drepper <drepper@redhat.com> 82 2009-09-21 Ulrich Drepper <drepper@redhat.com>
77 83
78 * configure.ac: Update for more modern autoconf. 84 * configure.ac: Update for more modern autoconf.
79@@ -165,6 +174,10 @@ 85@@ -195,6 +204,10 @@
80 86
81 * configure.ac (zip_LIBS): Check for liblzma too. 87 * configure.ac (zip_LIBS): Check for liblzma too.
82 88
@@ -87,7 +93,7 @@
87 2009-04-19 Roland McGrath <roland@redhat.com> 93 2009-04-19 Roland McGrath <roland@redhat.com>
88 94
89 * configure.ac (eu_version): Round down here, not in version.h macros. 95 * configure.ac (eu_version): Round down here, not in version.h macros.
90@@ -176,6 +189,8 @@ 96@@ -206,6 +219,8 @@
91 97
92 2009-01-23 Roland McGrath <roland@redhat.com> 98 2009-01-23 Roland McGrath <roland@redhat.com>
93 99
@@ -96,7 +102,7 @@
96 * configure.ac (zlib check): Check for gzdirect, need zlib >= 1.2.2.3. 102 * configure.ac (zlib check): Check for gzdirect, need zlib >= 1.2.2.3.
97 103
98 * configure.ac (__thread check): Use AC_LINK_IFELSE, in case of 104 * configure.ac (__thread check): Use AC_LINK_IFELSE, in case of
99@@ -256,6 +271,10 @@ 105@@ -286,6 +301,10 @@
100 * configure.ac: Add dummy automake conditional to get dependencies 106 * configure.ac: Add dummy automake conditional to get dependencies
101 for non-generic linker right. See src/Makefile.am. 107 for non-generic linker right. See src/Makefile.am.
102 108
@@ -107,7 +113,7 @@
107 2005-11-18 Roland McGrath <roland@redhat.com> 113 2005-11-18 Roland McGrath <roland@redhat.com>
108 114
109 * Makefile.am (DISTCHECK_CONFIGURE_FLAGS): New variable. 115 * Makefile.am (DISTCHECK_CONFIGURE_FLAGS): New variable.
110@@ -303,6 +322,17 @@ 116@@ -333,6 +352,17 @@
111 * Makefile.am (all_SUBDIRS): Add libdwfl. 117 * Makefile.am (all_SUBDIRS): Add libdwfl.
112 * configure.ac: Write libdwfl/Makefile. 118 * configure.ac: Write libdwfl/Makefile.
113 119
@@ -125,9 +131,11 @@
125 2005-05-19 Roland McGrath <roland@redhat.com> 131 2005-05-19 Roland McGrath <roland@redhat.com>
126 132
127 * configure.ac [AH_BOTTOM] (INTDECL, _INTDECL): New macros. 133 * configure.ac [AH_BOTTOM] (INTDECL, _INTDECL): New macros.
128--- elfutils/config/ChangeLog 134Index: elfutils-0.159/config/ChangeLog
129+++ elfutils/config/ChangeLog 135===================================================================
130@@ -44,6 +44,10 @@ 136--- elfutils-0.159.orig/config/ChangeLog
137+++ elfutils-0.159/config/ChangeLog
138@@ -58,6 +58,10 @@
131 139
132 * known-dwarf.awk: Use gawk. 140 * known-dwarf.awk: Use gawk.
133 141
@@ -138,17 +146,19 @@
138 2010-07-02 Ulrich Drepper <drepper@redhat.com> 146 2010-07-02 Ulrich Drepper <drepper@redhat.com>
139 147
140 * elfutils.spec.in: Add more BuildRequires. 148 * elfutils.spec.in: Add more BuildRequires.
141--- elfutils/config/eu.am 149Index: elfutils-0.159/config/eu.am
142+++ elfutils/config/eu.am 150===================================================================
151--- elfutils-0.159.orig/config/eu.am
152+++ elfutils-0.159/config/eu.am
143@@ -1,6 +1,6 @@ 153@@ -1,6 +1,6 @@
144 ## Common automake fragments for elfutils subdirectory makefiles. 154 ## Common automake fragments for elfutils subdirectory makefiles.
145 ## 155 ##
146-## Copyright (C) 2010 Red Hat, Inc. 156-## Copyright (C) 2010, 2014 Red Hat, Inc.
147+## Copyright (C) 2010-2011 Red Hat, Inc. 157+## Copyright (C) 2010-2011, 2014 Red Hat, Inc.
148 ## 158 ##
149 ## This file is part of elfutils. 159 ## This file is part of elfutils.
150 ## 160 ##
151@@ -29,14 +29,20 @@ 161@@ -29,13 +29,21 @@
152 ## not, see <http://www.gnu.org/licenses/>. 162 ## not, see <http://www.gnu.org/licenses/>.
153 ## 163 ##
154 164
@@ -157,43 +167,26 @@
157+ 167+
158 DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H -DLOCALEDIR='"${localedir}"' 168 DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H -DLOCALEDIR='"${localedir}"'
159 AM_CPPFLAGS = -I. -I$(srcdir) -I$(top_srcdir)/lib -I.. 169 AM_CPPFLAGS = -I. -I$(srcdir) -I$(top_srcdir)/lib -I..
160 AM_CFLAGS = -std=gnu99 -Wall -Wshadow \ 170-AM_CFLAGS = -std=gnu99 -Wall -Wshadow -Wformat=2 \
161- $(if $($(*F)_no_Werror),,-Werror) \ 171+AM_CFLAGS = -std=gnu99 -Wall -Wshadow \
172 $(if $($(*F)_no_Werror),,-Werror) \
162- $(if $($(*F)_no_Wunused),,-Wunused -Wextra) \ 173- $(if $($(*F)_no_Wunused),,-Wunused -Wextra) \
163+ $(if $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) \ 174+ $(if $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) \
164 $(if $($(*F)_no_Wformat),-Wno-format,-Wformat=2) \ 175+ $(if $($(*F)_no_Wformat),-Wno-format,-Wformat=2) \
165 $($(*F)_CFLAGS) 176 $($(*F)_CFLAGS)
166 177
167+if BUILD_WERROR 178+if BUILD_WERROR
168+AM_CFLAGS += $(if $($(*F)_no_Werror),,-Werror) 179+AM_CFLAGS += $(if $($(*F)_no_Werror),,-Werror)
169+endif 180+endif
170+ 181+
171 if MUDFLAP 182 COMPILE.os = $(filter-out -fprofile-arcs -ftest-coverage, $(COMPILE))
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 183
180+/* Have __builtin_popcount. */ 184 %.os: %.c %.o
181+#undef HAVE_BUILTIN_POPCOUNT 185Index: elfutils-0.159/configure.ac
182+ 186===================================================================
183 /* Define to 1 if you have the <inttypes.h> header file. */ 187--- elfutils-0.159.orig/configure.ac
184 #undef HAVE_INTTYPES_H 188+++ elfutils-0.159/configure.ac
185 189@@ -89,6 +89,54 @@ CFLAGS="$old_CFLAGS"])
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], 190 AS_IF([test "x$ac_cv_c99" != xyes],
198 AC_MSG_ERROR([gcc with C99 support required])) 191 AC_MSG_ERROR([gcc with C99 support required]))
199 192
@@ -248,7 +241,7 @@
248 AC_CACHE_CHECK([for __thread support], ac_cv_tls, [dnl 241 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. 242 # 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. 243 # 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) { 244@@ -104,7 +152,10 @@ static __thread int a; int foo (int b) {
252 CFLAGS="$save_CFLAGS" 245 CFLAGS="$save_CFLAGS"
253 LDFLAGS="$save_LDFLAGS"]) 246 LDFLAGS="$save_LDFLAGS"])
254 AS_IF([test "x$ac_cv_tls" != xyes], 247 AS_IF([test "x$ac_cv_tls" != xyes],
@@ -260,9 +253,9 @@
260 253
261 dnl This test must come as early as possible after the compiler configuration 254 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 255 dnl tests, because the choice of the file model can (in principle) affect
263@@ -213,6 +264,11 @@ AM_CONDITIONAL(USE_VALGRIND, test "$use_ 256@@ -183,6 +234,11 @@ AM_CONDITIONAL(USE_VALGRIND, test "$use_
264 AM_CONDITIONAL(BUILD_STATIC, [dnl 257 AM_CONDITIONAL(BUILD_STATIC, [dnl
265 test "$use_mudflap" = yes -o "$use_gprof" = yes -o "$use_gcov" = yes]) 258 test "$use_gprof" = yes -o "$use_gcov" = yes])
266 259
267+AC_ARG_ENABLE([werror], 260+AC_ARG_ENABLE([werror],
268+AS_HELP_STRING([--disable-werror],[do not build with -Werror]), 261+AS_HELP_STRING([--disable-werror],[do not build with -Werror]),
@@ -272,7 +265,7 @@
272 AC_ARG_ENABLE([tests-rpath], 265 AC_ARG_ENABLE([tests-rpath],
273 AS_HELP_STRING([--enable-tests-rpath],[build $ORIGIN-using rpath into tests]), 266 AS_HELP_STRING([--enable-tests-rpath],[build $ORIGIN-using rpath into tests]),
274 [tests_use_rpath=$enableval], [tests_use_rpath=no]) 267 [tests_use_rpath=$enableval], [tests_use_rpath=no])
275@@ -324,7 +380,7 @@ case "$eu_version" in 268@@ -297,7 +353,7 @@ case "$eu_version" in
276 esac 269 esac
277 270
278 # Round up to the next release API (x.y) version. 271 # Round up to the next release API (x.y) version.
@@ -281,9 +274,11 @@
281 274
282 AC_CHECK_SIZEOF(long) 275 AC_CHECK_SIZEOF(long)
283 276
284--- elfutils/lib/ChangeLog 277Index: elfutils-0.159/lib/ChangeLog
285+++ elfutils/lib/ChangeLog 278===================================================================
286@@ -61,6 +61,9 @@ 279--- elfutils-0.159.orig/lib/ChangeLog
280+++ elfutils-0.159/lib/ChangeLog
281@@ -65,6 +65,9 @@
287 282
288 2009-01-23 Roland McGrath <roland@redhat.com> 283 2009-01-23 Roland McGrath <roland@redhat.com>
289 284
@@ -293,7 +288,7 @@
293 * eu-config.h: Add multiple inclusion protection. 288 * eu-config.h: Add multiple inclusion protection.
294 289
295 2009-01-17 Ulrich Drepper <drepper@redhat.com> 290 2009-01-17 Ulrich Drepper <drepper@redhat.com>
296@@ -117,6 +120,11 @@ 291@@ -121,6 +124,11 @@
297 * Makefile.am (libeu_a_SOURCES): Add it. 292 * Makefile.am (libeu_a_SOURCES): Add it.
298 * system.h: Declare crc32_file. 293 * system.h: Declare crc32_file.
299 294
@@ -305,8 +300,10 @@
305 2005-04-30 Ulrich Drepper <drepper@redhat.com> 300 2005-04-30 Ulrich Drepper <drepper@redhat.com>
306 301
307 * Makefile.am: Use -ffunction-sections for xmalloc.c. 302 * Makefile.am: Use -ffunction-sections for xmalloc.c.
308--- elfutils/lib/eu-config.h 303Index: elfutils-0.159/lib/eu-config.h
309+++ elfutils/lib/eu-config.h 304===================================================================
305--- elfutils-0.159.orig/lib/eu-config.h
306+++ elfutils-0.159/lib/eu-config.h
310@@ -162,6 +162,17 @@ asm (".section predict_data, \"aw\"; .pr 307@@ -162,6 +162,17 @@ asm (".section predict_data, \"aw\"; .pr
311 /* This macro is used by the tests conditionalize for standalone building. */ 308 /* This macro is used by the tests conditionalize for standalone building. */
312 #define ELFUTILS_HEADER(name) <lib##name.h> 309 #define ELFUTILS_HEADER(name) <lib##name.h>
@@ -325,9 +322,11 @@
325 322
326 #ifdef SHARED 323 #ifdef SHARED
327 # define OLD_VERSION(name, version) \ 324 # define OLD_VERSION(name, version) \
328--- elfutils/libasm/ChangeLog 325Index: elfutils-0.159/libasm/ChangeLog
329+++ elfutils/libasm/ChangeLog 326===================================================================
330@@ -75,6 +75,11 @@ 327--- elfutils-0.159.orig/libasm/ChangeLog
328+++ elfutils-0.159/libasm/ChangeLog
329@@ -79,6 +79,11 @@
331 * asm_error.c: Add new error ASM_E_IOERROR. 330 * asm_error.c: Add new error ASM_E_IOERROR.
332 * libasmP.h: Add ASM_E_IOERROR definition. 331 * libasmP.h: Add ASM_E_IOERROR definition.
333 332
@@ -339,9 +338,11 @@
339 2005-02-15 Ulrich Drepper <drepper@redhat.com> 338 2005-02-15 Ulrich Drepper <drepper@redhat.com>
340 339
341 * Makefile.am (AM_CFLAGS): Add -Wunused -Wextra -Wformat=2. 340 * Makefile.am (AM_CFLAGS): Add -Wunused -Wextra -Wformat=2.
342--- elfutils/libcpu/ChangeLog 341Index: elfutils-0.159/libcpu/ChangeLog
343+++ elfutils/libcpu/ChangeLog 342===================================================================
344@@ -47,6 +47,9 @@ 343--- elfutils-0.159.orig/libcpu/ChangeLog
344+++ elfutils-0.159/libcpu/ChangeLog
345@@ -51,6 +51,9 @@
345 346
346 2009-01-23 Roland McGrath <roland@redhat.com> 347 2009-01-23 Roland McGrath <roland@redhat.com>
347 348
@@ -351,7 +352,7 @@
351 * Makefile.am (i386_parse_CFLAGS): Use quotes around command 352 * Makefile.am (i386_parse_CFLAGS): Use quotes around command
352 substitution that can produce leading whitespace. 353 substitution that can produce leading whitespace.
353 354
354@@ -376,6 +379,11 @@ 355@@ -380,6 +383,11 @@
355 * defs/i386.doc: New file. 356 * defs/i386.doc: New file.
356 * defs/x86_64: New file. 357 * defs/x86_64: New file.
357 358
@@ -363,8 +364,10 @@
363 2005-02-15 Ulrich Drepper <drepper@redhat.com> 364 2005-02-15 Ulrich Drepper <drepper@redhat.com>
364 365
365 * Makefile (AM_CFLAGS): Add -Wunused -Wextra -Wformat=2. 366 * Makefile (AM_CFLAGS): Add -Wunused -Wextra -Wformat=2.
366--- elfutils/libcpu/i386_disasm.c 367Index: elfutils-0.159/libcpu/i386_disasm.c
367+++ elfutils/libcpu/i386_disasm.c 368===================================================================
369--- elfutils-0.159.orig/libcpu/i386_disasm.c
370+++ elfutils-0.159/libcpu/i386_disasm.c
368@@ -822,6 +822,7 @@ i386_disasm (const uint8_t **startp, con 371@@ -822,6 +822,7 @@ i386_disasm (const uint8_t **startp, con
369 372
370 default: 373 default:
@@ -373,9 +376,11 @@
373 } 376 }
374 } 377 }
375 else 378 else
376--- elfutils/libdw/ChangeLog 379Index: elfutils-0.159/libdw/ChangeLog
377+++ elfutils/libdw/ChangeLog 380===================================================================
378@@ -346,6 +346,10 @@ 381--- elfutils-0.159.orig/libdw/ChangeLog
382+++ elfutils-0.159/libdw/ChangeLog
383@@ -420,6 +420,10 @@
379 384
380 * Makefile.am (known-dwarf.h): Run gawk on config/known-dwarf.awk. 385 * Makefile.am (known-dwarf.h): Run gawk on config/known-dwarf.awk.
381 386
@@ -386,7 +391,7 @@
386 2011-07-14 Mark Wielaard <mjw@redhat.com> 391 2011-07-14 Mark Wielaard <mjw@redhat.com>
387 392
388 * libdw.h (dwarf_offdie): Fix documentation to mention .debug_info. 393 * libdw.h (dwarf_offdie): Fix documentation to mention .debug_info.
389@@ -705,6 +709,10 @@ 394@@ -779,6 +783,10 @@
390 395
391 * dwarf_hasattr_integrate.c: Integrate DW_AT_specification too. 396 * dwarf_hasattr_integrate.c: Integrate DW_AT_specification too.
392 397
@@ -397,7 +402,7 @@
397 2009-08-10 Roland McGrath <roland@redhat.com> 402 2009-08-10 Roland McGrath <roland@redhat.com>
398 403
399 * dwarf_getscopevar.c: Use dwarf_diename. 404 * dwarf_getscopevar.c: Use dwarf_diename.
400@@ -1473,6 +1481,11 @@ 405@@ -1547,6 +1555,11 @@
401 406
402 2005-05-31 Roland McGrath <roland@redhat.com> 407 2005-05-31 Roland McGrath <roland@redhat.com>
403 408
@@ -409,9 +414,11 @@
409 * dwarf_formref_die.c (dwarf_formref_die): Add CU header offset to 414 * dwarf_formref_die.c (dwarf_formref_die): Add CU header offset to
410 formref offset. 415 formref offset.
411 416
412--- elfutils/libdw/dwarf_begin_elf.c 417Index: elfutils-0.159/libdw/dwarf_begin_elf.c
413+++ elfutils/libdw/dwarf_begin_elf.c 418===================================================================
414@@ -48,6 +48,14 @@ 419--- elfutils-0.159.orig/libdw/dwarf_begin_elf.c
420+++ elfutils-0.159/libdw/dwarf_begin_elf.c
421@@ -47,6 +47,14 @@
415 #if USE_ZLIB 422 #if USE_ZLIB
416 # include <endian.h> 423 # include <endian.h>
417 # define crc32 loser_crc32 424 # define crc32 loser_crc32
@@ -426,9 +433,11 @@
426 # include <zlib.h> 433 # include <zlib.h>
427 # undef crc32 434 # undef crc32
428 #endif 435 #endif
429--- elfutils/libdw/libdw.h 436Index: elfutils-0.159/libdw/libdw.h
430+++ elfutils/libdw/libdw.h 437===================================================================
431@@ -879,7 +879,7 @@ extern Dwarf_OOM dwarf_new_oom_handler ( 438--- elfutils-0.159.orig/libdw/libdw.h
439+++ elfutils-0.159/libdw/libdw.h
440@@ -891,7 +891,7 @@ extern Dwarf_OOM dwarf_new_oom_handler (
432 441
433 442
434 /* Inline optimizations. */ 443 /* Inline optimizations. */
@@ -437,9 +446,11 @@
437 /* Return attribute code of given attribute. */ 446 /* Return attribute code of given attribute. */
438 __libdw_extern_inline unsigned int 447 __libdw_extern_inline unsigned int
439 dwarf_whatattr (Dwarf_Attribute *attr) 448 dwarf_whatattr (Dwarf_Attribute *attr)
440--- elfutils/libdwfl/ChangeLog 449Index: elfutils-0.159/libdwfl/ChangeLog
441+++ elfutils/libdwfl/ChangeLog 450===================================================================
442@@ -283,6 +283,21 @@ 451--- elfutils-0.159.orig/libdwfl/ChangeLog
452+++ elfutils-0.159/libdwfl/ChangeLog
453@@ -421,6 +421,21 @@
443 (dwfl_module_addrsym) (i_to_symfile): New function. 454 (dwfl_module_addrsym) (i_to_symfile): New function.
444 (dwfl_module_addrsym) (search_table): Use it. 455 (dwfl_module_addrsym) (search_table): Use it.
445 456
@@ -461,7 +472,7 @@
461 2013-11-07 Jan Kratochvil <jan.kratochvil@redhat.com> 472 2013-11-07 Jan Kratochvil <jan.kratochvil@redhat.com>
462 Mark Wielaard <mjw@redhat.com> 473 Mark Wielaard <mjw@redhat.com>
463 474
464@@ -2048,6 +2063,11 @@ 475@@ -2186,6 +2201,11 @@
465 476
466 2005-07-21 Roland McGrath <roland@redhat.com> 477 2005-07-21 Roland McGrath <roland@redhat.com>
467 478
@@ -473,8 +484,10 @@
473 * Makefile.am (noinst_HEADERS): Add loc2c.c. 484 * Makefile.am (noinst_HEADERS): Add loc2c.c.
474 485
475 * test2.c (main): Check sscanf result to quiet warning. 486 * test2.c (main): Check sscanf result to quiet warning.
476--- elfutils/libdwfl/linux-core-attach.c 487Index: elfutils-0.159/libdwfl/linux-core-attach.c
477+++ elfutils/libdwfl/linux-core-attach.c 488===================================================================
489--- elfutils-0.159.orig/libdwfl/linux-core-attach.c
490+++ elfutils-0.159/libdwfl/linux-core-attach.c
478@@ -29,6 +29,35 @@ 491@@ -29,6 +29,35 @@
479 #include "libdwflP.h" 492 #include "libdwflP.h"
480 #include <fcntl.h> 493 #include <fcntl.h>
@@ -511,40 +524,43 @@
511 524
512 #ifndef MIN 525 #ifndef MIN
513 # define MIN(a, b) ((a) < (b) ? (a) : (b)) 526 # define MIN(a, b) ((a) < (b) ? (a) : (b))
514--- elfutils/libdwfl/linux-pid-attach.c 527Index: elfutils-0.159/libdwfl/linux-pid-attach.c
515+++ elfutils/libdwfl/linux-pid-attach.c 528===================================================================
516@@ -268,13 +268,24 @@ pid_thread_detach (Dwfl_Thread *thread, 529--- elfutils-0.159.orig/libdwfl/linux-pid-attach.c
517 pid_arg->tid_attached = 0; 530+++ elfutils-0.159/libdwfl/linux-pid-attach.c
518 if (! pid_arg->assume_ptrace_stopped) 531@@ -255,6 +255,11 @@ void
519 { 532 internal_function
520+ // Older kernels (tested kernel-2.6.18-348.12.1.el5.x86_64) need special 533 __libdwfl_ptrace_detach (pid_t tid, bool tid_was_stopped)
521+ // handling of the detachment to keep the process State: T (stopped). 534 {
522+ if (pid_arg->tid_was_stopped) 535+ // Older kernels (tested kernel-2.6.18-348.12.1.el5.x86_64) need special
523+ syscall (__NR_tkill, tid, SIGSTOP); 536+ // handling of the detachment to keep the process State: T (stopped).
524 /* This handling is needed only on older Linux kernels such as 537+ if (tid_was_stopped)
525- 2.6.32-358.23.2.el6.ppc64. Later kernels such as 538+ syscall (__NR_tkill, tid, SIGSTOP);
526- 3.11.7-200.fc19.x86_64 remember the T (stopped) state 539+
527- themselves and no longer need to pass SIGSTOP during 540 /* This handling is needed only on older Linux kernels such as
528- PTRACE_DETACH. */ 541 2.6.32-358.23.2.el6.ppc64. Later kernels such as
529+ 2.6.32-358.23.2.el6.ppc64. Later kernels such as 3.11.7-200.fc19.x86_64 542 3.11.7-200.fc19.x86_64 remember the T (stopped) state
530+ remember the T (stopped) state themselves and no longer need to pass 543@@ -262,6 +267,15 @@ __libdwfl_ptrace_detach (pid_t tid, bool
531+ SIGSTOP during PTRACE_DETACH. */ 544 PTRACE_DETACH. */
532 ptrace (PTRACE_DETACH, tid, NULL, 545 ptrace (PTRACE_DETACH, tid, NULL,
533 (void *) (intptr_t) (pid_arg->tid_was_stopped ? SIGSTOP : 0)); 546 (void *) (intptr_t) (tid_was_stopped ? SIGSTOP : 0));
534+ if (pid_arg->tid_was_stopped) 547+
535+ { 548+ if (tid_was_stopped)
536+ // Wait till the SIGSTOP settles down. 549+ {
537+ int i; 550+ // Wait till the SIGSTOP settles down.
538+ for (i = 0; i < 100000; i++) 551+ int i;
539+ if (linux_proc_pid_is_stopped (tid)) 552+ for (i = 0; i < 100000; i++)
540+ break; 553+ if (linux_proc_pid_is_stopped (tid))
541+ } 554+ break;
542 } 555+ }
543 } 556 }
544 557
545--- elfutils/libebl/ChangeLog 558 static void
546+++ elfutils/libebl/ChangeLog 559Index: elfutils-0.159/libebl/ChangeLog
547@@ -738,6 +738,11 @@ 560===================================================================
561--- elfutils-0.159.orig/libebl/ChangeLog
562+++ elfutils-0.159/libebl/ChangeLog
563@@ -748,6 +748,11 @@
548 * Makefile.am (libebl_*_so_SOURCES): Set to $(*_SRCS) so dependency 564 * Makefile.am (libebl_*_so_SOURCES): Set to $(*_SRCS) so dependency
549 tracking works right. 565 tracking works right.
550 566
@@ -556,9 +572,11 @@
556 2005-05-21 Ulrich Drepper <drepper@redhat.com> 572 2005-05-21 Ulrich Drepper <drepper@redhat.com>
557 573
558 * libebl_x86_64.map: Add x86_64_core_note. 574 * libebl_x86_64.map: Add x86_64_core_note.
559--- elfutils/libelf/ChangeLog 575Index: elfutils-0.159/libelf/ChangeLog
560+++ elfutils/libelf/ChangeLog 576===================================================================
561@@ -85,6 +85,11 @@ 577--- elfutils-0.159.orig/libelf/ChangeLog
578+++ elfutils-0.159/libelf/ChangeLog
579@@ -135,6 +135,11 @@
562 580
563 * elf-knowledge.h (SECTION_STRIP_P): Remove < SHT_NUM check. 581 * elf-knowledge.h (SECTION_STRIP_P): Remove < SHT_NUM check.
564 582
@@ -570,7 +588,7 @@
570 2011-02-26 Mark Wielaard <mjw@redhat.com> 588 2011-02-26 Mark Wielaard <mjw@redhat.com>
571 589
572 * elf_end.c (elf_end): Call rwlock_unlock before rwlock_fini. 590 * elf_end.c (elf_end): Call rwlock_unlock before rwlock_fini.
573@@ -762,6 +767,11 @@ 591@@ -812,6 +817,11 @@
574 592
575 * elf.h: Update from glibc. 593 * elf.h: Update from glibc.
576 594
@@ -582,8 +600,10 @@
582 2005-05-08 Roland McGrath <roland@redhat.com> 600 2005-05-08 Roland McGrath <roland@redhat.com>
583 601
584 * elf_begin.c (read_file) [_MUDFLAP]: Don't use mmap for now. 602 * elf_begin.c (read_file) [_MUDFLAP]: Don't use mmap for now.
585--- elfutils/libelf/common.h 603Index: elfutils-0.159/libelf/common.h
586+++ elfutils/libelf/common.h 604===================================================================
605--- elfutils-0.159.orig/libelf/common.h
606+++ elfutils-0.159/libelf/common.h
587@@ -139,7 +139,7 @@ libelf_release_all (Elf *elf) 607@@ -139,7 +139,7 @@ libelf_release_all (Elf *elf)
588 (Var) = (sizeof (Var) == 1 \ 608 (Var) = (sizeof (Var) == 1 \
589 ? (unsigned char) (Var) \ 609 ? (unsigned char) (Var) \
@@ -602,8 +622,10 @@
602 : (sizeof (Var) == 4 \ 622 : (sizeof (Var) == 4 \
603 ? bswap_32 (Var) \ 623 ? bswap_32 (Var) \
604 : bswap_64 (Var)))) 624 : bswap_64 (Var))))
605--- elfutils/libelf/gnuhash_xlate.h 625Index: elfutils-0.159/libelf/gnuhash_xlate.h
606+++ elfutils/libelf/gnuhash_xlate.h 626===================================================================
627--- elfutils-0.159.orig/libelf/gnuhash_xlate.h
628+++ elfutils-0.159/libelf/gnuhash_xlate.h
607@@ -1,5 +1,5 @@ 629@@ -1,5 +1,5 @@
608 /* Conversion functions for versioning information. 630 /* Conversion functions for versioning information.
609- Copyright (C) 2006, 2007 Red Hat, Inc. 631- Copyright (C) 2006, 2007 Red Hat, Inc.
@@ -622,8 +644,10 @@
622 len -= 4; 644 len -= 4;
623 } 645 }
624 } 646 }
625--- elfutils/src/addr2line.c 647Index: elfutils-0.159/src/addr2line.c
626+++ elfutils/src/addr2line.c 648===================================================================
649--- elfutils-0.159.orig/src/addr2line.c
650+++ elfutils-0.159/src/addr2line.c
627@@ -540,10 +540,10 @@ handle_address (const char *string, Dwfl 651@@ -540,10 +540,10 @@ handle_address (const char *string, Dwfl
628 bool parsed = false; 652 bool parsed = false;
629 int i, j; 653 int i, j;
@@ -637,9 +661,11 @@
637 { 661 {
638 default: 662 default:
639 break; 663 break;
640--- elfutils/src/ChangeLog 664Index: elfutils-0.159/src/ChangeLog
641+++ elfutils/src/ChangeLog 665===================================================================
642@@ -964,8 +964,16 @@ 666--- elfutils-0.159.orig/src/ChangeLog
667+++ elfutils-0.159/src/ChangeLog
668@@ -1112,8 +1112,16 @@
643 * readelf.c (attr_callback): Use print_block only when we don't use 669 * readelf.c (attr_callback): Use print_block only when we don't use
644 print_ops. 670 print_ops.
645 671
@@ -656,7 +682,7 @@
656 * ar.c (do_oper_extract): Use pathconf instead of statfs. 682 * ar.c (do_oper_extract): Use pathconf instead of statfs.
657 683
658 2009-08-01 Ulrich Drepper <drepper@redhat.com> 684 2009-08-01 Ulrich Drepper <drepper@redhat.com>
659@@ -1129,6 +1137,8 @@ 685@@ -1277,6 +1285,8 @@
660 * readelf.c (print_debug_frame_section): Use t instead of j formats 686 * readelf.c (print_debug_frame_section): Use t instead of j formats
661 for ptrdiff_t OFFSET. 687 for ptrdiff_t OFFSET.
662 688
@@ -665,7 +691,7 @@
665 2009-01-21 Ulrich Drepper <drepper@redhat.com> 691 2009-01-21 Ulrich Drepper <drepper@redhat.com>
666 692
667 * elflint.c (check_program_header): Fix typo in .eh_frame_hdr section 693 * elflint.c (check_program_header): Fix typo in .eh_frame_hdr section
668@@ -1312,6 +1322,11 @@ 694@@ -1460,6 +1470,11 @@
669 that matches its PT_LOAD's p_flags &~ PF_W. On sparc, PF_X really 695 that matches its PT_LOAD's p_flags &~ PF_W. On sparc, PF_X really
670 is valid in RELRO. 696 is valid in RELRO.
671 697
@@ -677,7 +703,7 @@
677 2008-02-29 Roland McGrath <roland@redhat.com> 703 2008-02-29 Roland McGrath <roland@redhat.com>
678 704
679 * readelf.c (print_attributes): Add a cast. 705 * readelf.c (print_attributes): Add a cast.
680@@ -1563,6 +1578,8 @@ 706@@ -1711,6 +1726,8 @@
681 707
682 * readelf.c (hex_dump): Fix rounding error in whitespace calculation. 708 * readelf.c (hex_dump): Fix rounding error in whitespace calculation.
683 709
@@ -686,7 +712,7 @@
686 2007-10-15 Roland McGrath <roland@redhat.com> 712 2007-10-15 Roland McGrath <roland@redhat.com>
687 713
688 * make-debug-archive.in: New file. 714 * make-debug-archive.in: New file.
689@@ -2002,6 +2019,10 @@ 715@@ -2150,6 +2167,10 @@
690 * elflint.c (valid_e_machine): Add EM_ALPHA. 716 * elflint.c (valid_e_machine): Add EM_ALPHA.
691 Reported by Christian Aichinger <Greek0@gmx.net>. 717 Reported by Christian Aichinger <Greek0@gmx.net>.
692 718
@@ -697,7 +723,7 @@
697 2006-08-08 Ulrich Drepper <drepper@redhat.com> 723 2006-08-08 Ulrich Drepper <drepper@redhat.com>
698 724
699 * elflint.c (check_dynamic): Don't require DT_HASH for DT_SYMTAB. 725 * elflint.c (check_dynamic): Don't require DT_HASH for DT_SYMTAB.
700@@ -2078,6 +2099,10 @@ 726@@ -2226,6 +2247,10 @@
701 * Makefile.am: Add hacks to create dependency files for non-generic 727 * Makefile.am: Add hacks to create dependency files for non-generic
702 linker. 728 linker.
703 729
@@ -708,7 +734,7 @@
708 2006-06-12 Ulrich Drepper <drepper@redhat.com> 734 2006-06-12 Ulrich Drepper <drepper@redhat.com>
709 735
710 * ldgeneric.c (ld_generic_generate_sections): Don't create .interp 736 * ldgeneric.c (ld_generic_generate_sections): Don't create .interp
711@@ -2426,6 +2451,11 @@ 737@@ -2574,6 +2599,11 @@
712 * readelf.c (print_debug_loc_section): Fix indentation for larger 738 * readelf.c (print_debug_loc_section): Fix indentation for larger
713 address size. 739 address size.
714 740
@@ -720,8 +746,10 @@
720 2005-05-30 Roland McGrath <roland@redhat.com> 746 2005-05-30 Roland McGrath <roland@redhat.com>
721 747
722 * readelf.c (print_debug_line_section): Print section offset of each 748 * readelf.c (print_debug_line_section): Print section offset of each
723--- elfutils/src/findtextrel.c 749Index: elfutils-0.159/src/findtextrel.c
724+++ elfutils/src/findtextrel.c 750===================================================================
751--- elfutils-0.159.orig/src/findtextrel.c
752+++ elfutils-0.159/src/findtextrel.c
725@@ -496,7 +496,11 @@ ptrcompare (const void *p1, const void * 753@@ -496,7 +496,11 @@ ptrcompare (const void *p1, const void *
726 754
727 755
@@ -735,8 +763,10 @@
735 GElf_Addr addr, Elf *elf, Elf_Scn *symscn, Dwarf *dw, 763 GElf_Addr addr, Elf *elf, Elf_Scn *symscn, Dwarf *dw,
736 const char *fname, bool more_than_one, void **knownsrcs) 764 const char *fname, bool more_than_one, void **knownsrcs)
737 { 765 {
738--- elfutils/src/ld.h 766Index: elfutils-0.159/src/ld.h
739+++ elfutils/src/ld.h 767===================================================================
768--- elfutils-0.159.orig/src/ld.h
769+++ elfutils-0.159/src/ld.h
740@@ -1114,6 +1114,7 @@ extern bool dynamically_linked_p (void); 770@@ -1114,6 +1114,7 @@ extern bool dynamically_linked_p (void);
741 771
742 /* Checked whether the symbol is undefined and referenced from a DSO. */ 772 /* Checked whether the symbol is undefined and referenced from a DSO. */
@@ -752,21 +782,27 @@
752+#endif /* Optimizing and not GCC 4.2. */ 782+#endif /* Optimizing and not GCC 4.2. */
753 783
754 #endif /* ld.h */ 784 #endif /* ld.h */
755--- elfutils/src/Makefile.am 785Index: elfutils-0.159/src/Makefile.am
756+++ elfutils/src/Makefile.am 786===================================================================
757@@ -95,6 +95,9 @@ addr2line_no_Wformat = yes 787--- elfutils-0.159.orig/src/Makefile.am
788+++ elfutils-0.159/src/Makefile.am
789@@ -89,6 +89,11 @@ endif
758 # XXX While the file is not finished, don't warn about this 790 # XXX While the file is not finished, don't warn about this
759 ldgeneric_no_Wunused = yes 791 ldgeneric_no_Wunused = yes
760 792
761+# Buggy old compilers. 793+# Buggy old compilers or libc headers.
762+readelf_no_Werror = yes 794+readelf_no_Werror = yes
795+strings_no_Werror = yes
796+addr2line_no_Wformat = yes
763+ 797+
764 readelf_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl 798 readelf_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) -ldl
765 nm_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl \ 799 nm_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) -ldl \
766 $(demanglelib) 800 $(demanglelib)
767--- elfutils/src/readelf.c 801Index: elfutils-0.159/src/readelf.c
768+++ elfutils/src/readelf.c 802===================================================================
769@@ -4171,10 +4171,12 @@ listptr_base (struct listptr *p) 803--- elfutils-0.159.orig/src/readelf.c
804+++ elfutils-0.159/src/readelf.c
805@@ -4239,10 +4239,12 @@ listptr_base (struct listptr *p)
770 return base; 806 return base;
771 } 807 }
772 808
@@ -781,7 +817,7 @@
781 struct listptr *p1 = (void *) a; 817 struct listptr *p1 = (void *) a;
782 struct listptr *p2 = (void *) b; 818 struct listptr *p2 = (void *) b;
783 819
784@@ -4263,8 +4265,11 @@ static void 820@@ -4331,8 +4333,11 @@ static void
785 sort_listptr (struct listptr_table *table, const char *name) 821 sort_listptr (struct listptr_table *table, const char *name)
786 { 822 {
787 if (table->n > 0) 823 if (table->n > 0)
@@ -795,7 +831,7 @@
795 } 831 }
796 832
797 static bool 833 static bool
798@@ -9151,7 +9156,7 @@ dump_archive_index (Elf *elf, const char 834@@ -9252,7 +9257,7 @@ dump_archive_index (Elf *elf, const char
799 if (unlikely (elf_rand (elf, as_off) == 0) 835 if (unlikely (elf_rand (elf, as_off) == 0)
800 || unlikely ((subelf = elf_begin (-1, ELF_C_READ_MMAP, elf)) 836 || unlikely ((subelf = elf_begin (-1, ELF_C_READ_MMAP, elf))
801 == NULL)) 837 == NULL))
@@ -804,8 +840,10 @@
804 while (1) 840 while (1)
805 #endif 841 #endif
806 error (EXIT_FAILURE, 0, 842 error (EXIT_FAILURE, 0,
807--- elfutils/src/strings.c 843Index: elfutils-0.159/src/strings.c
808+++ elfutils/src/strings.c 844===================================================================
845--- elfutils-0.159.orig/src/strings.c
846+++ elfutils-0.159/src/strings.c
809@@ -43,6 +43,10 @@ 847@@ -43,6 +43,10 @@
810 848
811 #include <system.h> 849 #include <system.h>
@@ -817,7 +855,7 @@
817 855
818 /* Prototypes of local functions. */ 856 /* Prototypes of local functions. */
819 static int read_fd (int fd, const char *fname, off64_t fdlen); 857 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 858@@ -489,8 +493,13 @@ map_file (int fd, off64_t start_off, off
821 fd, start_off); 859 fd, start_off);
822 if (mem != MAP_FAILED) 860 if (mem != MAP_FAILED)
823 { 861 {
@@ -831,7 +869,7 @@
831 break; 869 break;
832 } 870 }
833 if (errno != EINVAL && errno != ENOMEM) 871 if (errno != EINVAL && errno != ENOMEM)
834@@ -576,9 +585,11 @@ read_block (int fd, const char *fname, o 872@@ -581,9 +590,11 @@ read_block (int fd, const char *fname, o
835 elfmap_off = from & ~(ps - 1); 873 elfmap_off = from & ~(ps - 1);
836 elfmap_base = elfmap = map_file (fd, elfmap_off, fdlen, &elfmap_size); 874 elfmap_base = elfmap = map_file (fd, elfmap_off, fdlen, &elfmap_size);
837 875
@@ -843,8 +881,10 @@
843 } 881 }
844 882
845 if (unlikely (elfmap == MAP_FAILED)) 883 if (unlikely (elfmap == MAP_FAILED))
846--- elfutils/src/strip.c 884Index: elfutils-0.159/src/strip.c
847+++ elfutils/src/strip.c 885===================================================================
886--- elfutils-0.159.orig/src/strip.c
887+++ elfutils-0.159/src/strip.c
848@@ -45,6 +45,12 @@ 888@@ -45,6 +45,12 @@
849 #include <libebl.h> 889 #include <libebl.h>
850 #include <system.h> 890 #include <system.h>
@@ -877,7 +917,7 @@
877 } 917 }
878 918
879 /* Open the file. */ 919 /* Open the file. */
880@@ -2060,7 +2076,7 @@ while computing checksum for debug infor 920@@ -2086,7 +2102,7 @@ while computing checksum for debug infor
881 /* If requested, preserve the timestamp. */ 921 /* If requested, preserve the timestamp. */
882 if (tvp != NULL) 922 if (tvp != NULL)
883 { 923 {
@@ -886,7 +926,7 @@
886 { 926 {
887 error (0, errno, gettext ("\ 927 error (0, errno, gettext ("\
888 cannot set access and modification date of '%s'"), 928 cannot set access and modification date of '%s'"),
889@@ -2117,7 +2133,7 @@ handle_ar (int fd, Elf *elf, const char 929@@ -2143,7 +2159,7 @@ handle_ar (int fd, Elf *elf, const char
890 930
891 if (tvp != NULL) 931 if (tvp != NULL)
892 { 932 {
@@ -895,8 +935,10 @@
895 { 935 {
896 error (0, errno, gettext ("\ 936 error (0, errno, gettext ("\
897 cannot set access and modification date of '%s'"), fname); 937 cannot set access and modification date of '%s'"), fname);
898--- elfutils/tests/backtrace.c 938Index: elfutils-0.159/tests/backtrace.c
899+++ elfutils/tests/backtrace.c 939===================================================================
940--- elfutils-0.159.orig/tests/backtrace.c
941+++ elfutils-0.159/tests/backtrace.c
900@@ -36,6 +36,7 @@ 942@@ -36,6 +36,7 @@
901 #include <fcntl.h> 943 #include <fcntl.h>
902 #include <string.h> 944 #include <string.h>
@@ -904,10 +946,12 @@
904+#include <sys/syscall.h> 946+#include <sys/syscall.h>
905 #include ELFUTILS_HEADER(dwfl) 947 #include ELFUTILS_HEADER(dwfl)
906 948
907 static int 949 #ifndef __linux__
908--- elfutils/tests/ChangeLog 950Index: elfutils-0.159/tests/ChangeLog
909+++ elfutils/tests/ChangeLog 951===================================================================
910@@ -123,6 +123,13 @@ 952--- elfutils-0.159.orig/tests/ChangeLog
953+++ elfutils-0.159/tests/ChangeLog
954@@ -283,6 +283,13 @@
911 955
912 2013-12-02 Jan Kratochvil <jan.kratochvil@redhat.com> 956 2013-12-02 Jan Kratochvil <jan.kratochvil@redhat.com>
913 957
@@ -921,7 +965,7 @@
921 * Makefile.am (check_PROGRAMS): Add backtrace, backtrace-child, 965 * Makefile.am (check_PROGRAMS): Add backtrace, backtrace-child,
922 backtrace-data and backtrace-dwarf. 966 backtrace-data and backtrace-dwarf.
923 (BUILT_SOURCES, clean-local, backtrace-child-biarch): New. 967 (BUILT_SOURCES, clean-local, backtrace-child-biarch): New.
924@@ -987,6 +994,8 @@ 968@@ -1147,6 +1154,8 @@
925 969
926 2008-01-21 Roland McGrath <roland@redhat.com> 970 2008-01-21 Roland McGrath <roland@redhat.com>
927 971
@@ -930,7 +974,7 @@
930 * testfile45.S.bz2: Add tests for cltq, cqto. 974 * testfile45.S.bz2: Add tests for cltq, cqto.
931 * testfile45.expect.bz2: Adjust. 975 * testfile45.expect.bz2: Adjust.
932 976
933@@ -1695,6 +1704,11 @@ 977@@ -1855,6 +1864,11 @@
934 * Makefile.am (TESTS): Add run-elflint-test.sh. 978 * Makefile.am (TESTS): Add run-elflint-test.sh.
935 (EXTRA_DIST): Add run-elflint-test.sh and testfile18.bz2. 979 (EXTRA_DIST): Add run-elflint-test.sh and testfile18.bz2.
936 980
@@ -942,8 +986,10 @@
942 2005-05-24 Ulrich Drepper <drepper@redhat.com> 986 2005-05-24 Ulrich Drepper <drepper@redhat.com>
943 987
944 * get-files.c (main): Use correct format specifier. 988 * get-files.c (main): Use correct format specifier.
945--- elfutils/tests/line2addr.c 989Index: elfutils-0.159/tests/line2addr.c
946+++ elfutils/tests/line2addr.c 990===================================================================
991--- elfutils-0.159.orig/tests/line2addr.c
992+++ elfutils-0.159/tests/line2addr.c
947@@ -124,7 +124,7 @@ main (int argc, char *argv[]) 993@@ -124,7 +124,7 @@ main (int argc, char *argv[])
948 { 994 {
949 struct args a = { .arg = argv[cnt] }; 995 struct args a = { .arg = argv[cnt] };
@@ -953,3 +999,15 @@
953 { 999 {
954 default: 1000 default:
955 case 0: 1001 case 0:
1002Index: elfutils-0.159/tests/Makefile.am
1003===================================================================
1004--- elfutils-0.159.orig/tests/Makefile.am
1005+++ elfutils-0.159/tests/Makefile.am
1006@@ -356,6 +356,7 @@ get_lines_LDADD = $(libdw) $(libelf)
1007 get_files_LDADD = $(libdw) $(libelf)
1008 get_aranges_LDADD = $(libdw) $(libelf)
1009 allfcts_LDADD = $(libdw) $(libelf)
1010+line2addr_no_Wformat = yes
1011 line2addr_LDADD = $(libdw)
1012 addrscopes_LDADD = $(libdw)
1013 funcscopes_LDADD = $(libdw)
diff --git a/meta/recipes-devtools/elfutils/elfutils-0.158/scanf-format.patch b/meta/recipes-devtools/elfutils/elfutils-0.160/scanf-format.patch
index c08519cf53..c08519cf53 100644
--- a/meta/recipes-devtools/elfutils/elfutils-0.158/scanf-format.patch
+++ b/meta/recipes-devtools/elfutils/elfutils-0.160/scanf-format.patch
diff --git a/meta/recipes-devtools/elfutils/elfutils-0.158/testsuite-ignore-elflint.diff b/meta/recipes-devtools/elfutils/elfutils-0.160/testsuite-ignore-elflint.diff
index eae5796de3..eae5796de3 100644
--- a/meta/recipes-devtools/elfutils/elfutils-0.158/testsuite-ignore-elflint.diff
+++ b/meta/recipes-devtools/elfutils/elfutils-0.160/testsuite-ignore-elflint.diff
diff --git a/meta/recipes-devtools/elfutils/elfutils_0.158.bb b/meta/recipes-devtools/elfutils/elfutils_0.160.bb
index 42724a1590..e02918e94a 100644
--- a/meta/recipes-devtools/elfutils/elfutils_0.158.bb
+++ b/meta/recipes-devtools/elfutils/elfutils_0.160.bb
@@ -7,14 +7,20 @@ DEPENDS = "libtool bzip2 zlib virtual/libintl"
7 7
8SRC_URI = "https://fedorahosted.org/releases/e/l/elfutils/${PV}/elfutils-${PV}.tar.bz2" 8SRC_URI = "https://fedorahosted.org/releases/e/l/elfutils/${PV}/elfutils-${PV}.tar.bz2"
9 9
10SRC_URI[md5sum] = "050a4909e452d01ab4747fd69d4036e0" 10SRC_URI[md5sum] = "7527f22dff8b1ac8c122cfc4d3d3bb1e"
11SRC_URI[sha256sum] = "be27af5c21352f53e010342bf1c68e0b9e18232dbf3adec7e2f9b41f6bbe397d" 11SRC_URI[sha256sum] = "741b556863c069ceab2d81eb54aeda8c34f46728859704eaf9baef8503e9a9d1"
12 12
13# Pick patches from debian 13SRC_URI += "\
14# http://ftp.de.debian.org/debian/pool/main/e/elfutils/elfutils_0.158-2.debian.tar.xz 14 file://mempcpy.patch \
15 file://dso-link-change.patch \
16 file://Fix_elf_cvt_gunhash.patch \
17 file://fixheadercheck.patch \
18"
19
20# pick the patch from debian
21# http://ftp.de.debian.org/debian/pool/main/e/elfutils/elfutils_0.159-4.debian.tar.xz
15SRC_URI += "\ 22SRC_URI += "\
16 file://redhat-portability.diff \ 23 file://redhat-portability.diff \
17 file://redhat-robustify.diff \
18 file://hppa_backend.diff \ 24 file://hppa_backend.diff \
19 file://arm_backend.diff \ 25 file://arm_backend.diff \
20 file://mips_backend.diff \ 26 file://mips_backend.diff \
@@ -22,15 +28,9 @@ SRC_URI += "\
22 file://testsuite-ignore-elflint.diff \ 28 file://testsuite-ignore-elflint.diff \
23 file://scanf-format.patch \ 29 file://scanf-format.patch \
24 file://mips_readelf_w.patch \ 30 file://mips_readelf_w.patch \
25 file://core_filename.patch \ 31 file://arm_func_value.patch \
26 file://CVE-2014-0172.patch \ 32 file://arm_unwind_ret_mask.patch \
27 file://unwind_non_linux.patch \ 33 file://non_linux.patch \
28 file://elf_additions.diff \
29 file://mempcpy.patch \
30 file://dso-link-change.patch \
31 file://m4-biarch.m4-tweak-AC_RUN_IFELSE-for-cross-compiling.patch \
32 file://fixheadercheck.patch \
33 file://Fix_elf_cvt_gunhash.patch \
34" 34"
35 35
36# Only apply when building uclibc based target recipe 36# Only apply when building uclibc based target recipe