elfutils: upgrade to 0.158

Add 'm4-biarch.m4-tweak-AC_RUN_IFELSE-for-cross-compiling.patch' to fix cross compiling failure;

Rebase 'elf_additions.diff' for 0.158;

Drop obsolete patches:
- nm-Fix-size-passed-to-snprintf-for-invalid-sh_name-case.patch
- elfutils-ar-c-fix-num-passed-to-memset.patch
- fix-build-gcc-4.8.patch

Pick patches from debian:
http://ftp.de.debian.org/debian/pool/main/e/elfutils/elfutils_0.158-2.debian.tar.xz

We could not directly add elfutils_0.158-2.debian.tar.xz to SRC_URI, because it
contains other souce codes which are not pathces.

(From OE-Core rev: d9c7a02240ce37d5b2569d9177e8ba534b9295ce)

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Hongxu Jia
2014-05-28 16:49:57 +08:00
committed by Richard Purdie
parent 5f45b00604
commit 4b616f06c1
24 changed files with 2180 additions and 4654 deletions

View File

@@ -1,450 +0,0 @@
Upstream-Status: Backport
Index: elfutils-0.155/backends/arm_init.c
===================================================================
--- elfutils-0.155.orig/backends/arm_init.c
+++ elfutils-0.155/backends/arm_init.c
@@ -35,21 +35,32 @@
#define RELOC_PREFIX R_ARM_
#include "libebl_CPU.h"
+#include "libebl_arm.h"
+
/* This defines the common reloc hooks based on arm_reloc.def. */
#include "common-reloc.c"
const char *
arm_init (elf, machine, eh, ehlen)
- Elf *elf __attribute__ ((unused));
+ Elf *elf;
GElf_Half machine __attribute__ ((unused));
Ebl *eh;
size_t ehlen;
{
+ int soft_float = 0;
+
/* Check whether the Elf_BH object has a sufficent size. */
if (ehlen < sizeof (Ebl))
return NULL;
+ if (elf) {
+ GElf_Ehdr ehdr_mem;
+ GElf_Ehdr *ehdr = gelf_getehdr (elf, &ehdr_mem);
+ if (ehdr && (ehdr->e_flags & EF_ARM_SOFT_FLOAT))
+ soft_float = 1;
+ }
+
/* We handle it. */
eh->name = "ARM";
arm_init_reloc (eh);
@@ -61,7 +72,10 @@ arm_init (elf, machine, eh, ehlen)
HOOK (eh, core_note);
HOOK (eh, auxv_info);
HOOK (eh, check_object_attribute);
- HOOK (eh, return_value_location);
+ if (soft_float)
+ eh->return_value_location = arm_return_value_location_soft;
+ else
+ eh->return_value_location = arm_return_value_location_hard;
return MODVERSION;
}
Index: elfutils-0.155/backends/arm_regs.c
===================================================================
--- elfutils-0.155.orig/backends/arm_regs.c
+++ elfutils-0.155/backends/arm_regs.c
@@ -31,6 +31,7 @@
#endif
#include <string.h>
+#include <stdio.h>
#include <dwarf.h>
#define BACKEND arm_
@@ -61,7 +62,15 @@ arm_register_info (Ebl *ebl __attribute_
namelen = 2;
break;
- case 10 ... 12:
+ case 10 ... 11:
+ name[0] = 'r';
+ name[1] = '1';
+ name[2] = regno % 10 + '0';
+ namelen = 3;
+ break;
+
+ case 12:
+ *type = DW_ATE_unsigned;
name[0] = 'r';
name[1] = '1';
name[2] = regno % 10 + '0';
@@ -76,6 +85,9 @@ arm_register_info (Ebl *ebl __attribute_
break;
case 16 + 0 ... 16 + 7:
+ /* AADWARF says that there are no registers in that range,
+ * but gcc maps FPA registers here
+ */
regno += 96 - 16;
/* Fall through. */
case 96 + 0 ... 96 + 7:
@@ -87,11 +99,139 @@ arm_register_info (Ebl *ebl __attribute_
namelen = 2;
break;
+ case 64 + 0 ... 64 + 9:
+ *setname = "VFP";
+ *bits = 32;
+ *type = DW_ATE_float;
+ name[0] = 's';
+ name[1] = regno - 64 + '0';
+ namelen = 2;
+ break;
+
+ case 64 + 10 ... 64 + 31:
+ *setname = "VFP";
+ *bits = 32;
+ *type = DW_ATE_float;
+ name[0] = 's';
+ name[1] = (regno - 64) / 10 + '0';
+ name[2] = (regno - 64) % 10 + '0';
+ namelen = 3;
+ break;
+
+ case 104 + 0 ... 104 + 7:
+ /* XXX TODO:
+ * This can be either intel wireless MMX general purpose/control
+ * registers or xscale accumulator, which have different usage.
+ * We only have the intel wireless MMX here now.
+ * The name needs to be changed for the xscale accumulator too. */
+ *setname = "MMX";
+ *type = DW_ATE_unsigned;
+ *bits = 32;
+ memcpy(name, "wcgr", 4);
+ name[4] = regno - 104 + '0';
+ namelen = 5;
+ break;
+
+ case 112 + 0 ... 112 + 9:
+ *setname = "MMX";
+ *type = DW_ATE_unsigned;
+ *bits = 64;
+ name[0] = 'w';
+ name[1] = 'r';
+ name[2] = regno - 112 + '0';
+ namelen = 3;
+ break;
+
+ case 112 + 10 ... 112 + 15:
+ *setname = "MMX";
+ *type = DW_ATE_unsigned;
+ *bits = 64;
+ name[0] = 'w';
+ name[1] = 'r';
+ name[2] = '1';
+ name[3] = regno - 112 - 10 + '0';
+ namelen = 4;
+ break;
+
case 128:
+ *setname = "special";
*type = DW_ATE_unsigned;
return stpcpy (name, "spsr") + 1 - name;
+ case 129:
+ *setname = "special";
+ *type = DW_ATE_unsigned;
+ return stpcpy(name, "spsr_fiq") + 1 - name;
+
+ case 130:
+ *setname = "special";
+ *type = DW_ATE_unsigned;
+ return stpcpy(name, "spsr_irq") + 1 - name;
+
+ case 131:
+ *setname = "special";
+ *type = DW_ATE_unsigned;
+ return stpcpy(name, "spsr_abt") + 1 - name;
+
+ case 132:
+ *setname = "special";
+ *type = DW_ATE_unsigned;
+ return stpcpy(name, "spsr_und") + 1 - name;
+
+ case 133:
+ *setname = "special";
+ *type = DW_ATE_unsigned;
+ return stpcpy(name, "spsr_svc") + 1 - name;
+
+ case 144 ... 150:
+ *setname = "integer";
+ *type = DW_ATE_signed;
+ *bits = 32;
+ return sprintf(name, "r%d_usr", regno - 144 + 8) + 1;
+
+ case 151 ... 157:
+ *setname = "integer";
+ *type = DW_ATE_signed;
+ *bits = 32;
+ return sprintf(name, "r%d_fiq", regno - 151 + 8) + 1;
+
+ case 158 ... 159:
+ *setname = "integer";
+ *type = DW_ATE_signed;
+ *bits = 32;
+ return sprintf(name, "r%d_irq", regno - 158 + 13) + 1;
+
+ case 160 ... 161:
+ *setname = "integer";
+ *type = DW_ATE_signed;
+ *bits = 32;
+ return sprintf(name, "r%d_abt", regno - 160 + 13) + 1;
+
+ case 162 ... 163:
+ *setname = "integer";
+ *type = DW_ATE_signed;
+ *bits = 32;
+ return sprintf(name, "r%d_und", regno - 162 + 13) + 1;
+
+ case 164 ... 165:
+ *setname = "integer";
+ *type = DW_ATE_signed;
+ *bits = 32;
+ return sprintf(name, "r%d_svc", regno - 164 + 13) + 1;
+
+ case 192 ... 199:
+ *setname = "MMX";
+ *bits = 32;
+ *type = DW_ATE_unsigned;
+ name[0] = 'w';
+ name[1] = 'c';
+ name[2] = regno - 192 + '0';
+ namelen = 3;
+ break;
+
case 256 + 0 ... 256 + 9:
+ /* XXX TODO: Neon also uses those registers and can contain
+ * both float and integers */
*setname = "VFP";
*type = DW_ATE_float;
*bits = 64;
Index: elfutils-0.155/backends/arm_retval.c
===================================================================
--- elfutils-0.155.orig/backends/arm_retval.c
+++ elfutils-0.155/backends/arm_retval.c
@@ -48,6 +48,13 @@ static const Dwarf_Op loc_intreg[] =
#define nloc_intreg 1
#define nloc_intregs(n) (2 * (n))
+/* f1 */ /* XXX TODO: f0 can also have number 96 if program was compiled with -mabi=aapcs */
+static const Dwarf_Op loc_fpreg[] =
+ {
+ { .atom = DW_OP_reg16 },
+ };
+#define nloc_fpreg 1
+
/* The return value is a structure and is actually stored in stack space
passed in a hidden argument by the caller. But, the compiler
helpfully returns the address of that space in r0. */
@@ -58,8 +65,9 @@ static const Dwarf_Op loc_aggregate[] =
#define nloc_aggregate 1
-int
-arm_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
+static int
+arm_return_value_location_ (Dwarf_Die *functypedie, const Dwarf_Op **locp,
+ int soft_float)
{
/* Start with the function's type, and get the DW_AT_type attribute,
which is the type of the return value. */
@@ -112,14 +120,31 @@ arm_return_value_location (Dwarf_Die *fu
else
return -1;
}
+ if (tag == DW_TAG_base_type)
+ {
+ Dwarf_Word encoding;
+ if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_encoding,
+ &attr_mem), &encoding) != 0)
+ return -1;
+
+ if ((encoding == DW_ATE_float) && !soft_float)
+ {
+ *locp = loc_fpreg;
+ if (size <= 8)
+ return nloc_fpreg;
+ goto aggregate;
+ }
+ }
if (size <= 16)
{
intreg:
*locp = loc_intreg;
return size <= 4 ? nloc_intreg : nloc_intregs ((size + 3) / 4);
}
+ /* fall through. */
aggregate:
+ /* XXX TODO sometimes aggregates are returned in r0 (-mabi=aapcs) */
*locp = loc_aggregate;
return nloc_aggregate;
@@ -138,3 +163,18 @@ arm_return_value_location (Dwarf_Die *fu
DWARF and might be valid. */
return -2;
}
+
+/* return location for -mabi=apcs-gnu -msoft-float */
+int
+arm_return_value_location_soft (Dwarf_Die *functypedie, const Dwarf_Op **locp)
+{
+ return arm_return_value_location_ (functypedie, locp, 1);
+}
+
+/* return location for -mabi=apcs-gnu -mhard-float (current default) */
+int
+arm_return_value_location_hard (Dwarf_Die *functypedie, const Dwarf_Op **locp)
+{
+ return arm_return_value_location_ (functypedie, locp, 0);
+}
+
Index: elfutils-0.155/libelf/elf.h
===================================================================
--- elfutils-0.155.orig/libelf/elf.h
+++ elfutils-0.155/libelf/elf.h
@@ -2281,6 +2281,9 @@ typedef Elf32_Addr Elf32_Conflict;
#define EF_ARM_EABI_VER4 0x04000000
#define EF_ARM_EABI_VER5 0x05000000
+/* EI_OSABI values */
+#define ELFOSABI_ARM_AEABI 64 /* Contains symbol versioning. */
+
/* Additional symbol types for Thumb. */
#define STT_ARM_TFUNC STT_LOPROC /* A Thumb function. */
#define STT_ARM_16BIT STT_HIPROC /* A Thumb label. */
@@ -2298,12 +2301,19 @@ typedef Elf32_Addr Elf32_Conflict;
/* Processor specific values for the Phdr p_type field. */
#define PT_ARM_EXIDX (PT_LOPROC + 1) /* ARM unwind segment. */
+#define PT_ARM_UNWIND PT_ARM_EXIDX
/* Processor specific values for the Shdr sh_type field. */
#define SHT_ARM_EXIDX (SHT_LOPROC + 1) /* ARM unwind section. */
#define SHT_ARM_PREEMPTMAP (SHT_LOPROC + 2) /* Preemption details. */
#define SHT_ARM_ATTRIBUTES (SHT_LOPROC + 3) /* ARM attributes section. */
+/* Processor specific values for the Dyn d_tag field. */
+#define DT_ARM_RESERVED1 (DT_LOPROC + 0)
+#define DT_ARM_SYMTABSZ (DT_LOPROC + 1)
+#define DT_ARM_PREEMTMAB (DT_LOPROC + 2)
+#define DT_ARM_RESERVED2 (DT_LOPROC + 3)
+#define DT_ARM_NUM 4
/* ARM relocs. */
@@ -2336,12 +2346,75 @@ typedef Elf32_Addr Elf32_Conflict;
#define R_ARM_GOTPC 25 /* 32 bit PC relative offset to GOT */
#define R_ARM_GOT32 26 /* 32 bit GOT entry */
#define R_ARM_PLT32 27 /* 32 bit PLT address */
+#define R_ARM_CALL 28
+#define R_ARM_JUMP24 29
+#define R_ARM_THM_JUMP24 30
+#define R_ARM_BASE_ABS 31
#define R_ARM_ALU_PCREL_7_0 32
#define R_ARM_ALU_PCREL_15_8 33
#define R_ARM_ALU_PCREL_23_15 34
#define R_ARM_LDR_SBREL_11_0 35
#define R_ARM_ALU_SBREL_19_12 36
#define R_ARM_ALU_SBREL_27_20 37
+#define R_ARM_TARGET1 38
+#define R_ARM_SBREL31 39
+#define R_ARM_V4BX 40
+#define R_ARM_TARGET2 41
+#define R_ARM_PREL31 42
+#define R_ARM_MOVW_ABS_NC 43
+#define R_ARM_MOVT_ABS 44
+#define R_ARM_MOVW_PREL_NC 45
+#define R_ARM_MOVT_PREL 46
+#define R_ARM_THM_MOVW_ABS_NC 47
+#define R_ARM_THM_MOVT_ABS 48
+#define R_ARM_THM_MOVW_PREL_NC 49
+#define R_ARM_THM_MOVT_PREL 50
+#define R_ARM_THM_JUMP19 51
+#define R_ARM_THM_JUMP6 52
+#define R_ARM_THM_ALU_PREL_11_0 53
+#define R_ARM_THM_PC12 54
+#define R_ARM_ABS32_NO 55
+#define R_ARM_REL32_NO 56
+#define R_ARM_ALU_PC_G0_NC 57
+#define R_ARM_ALU_PC_G0 58
+#define R_ARM_ALU_PC_G1_NC 59
+#define R_ARM_ALU_PC_G1 60
+#define R_ARM_ALU_PC_G2 61
+#define R_ARM_LDR_PC_G1 62
+#define R_ARM_LDR_PC_G2 63
+#define R_ARM_LDRS_PC_G0 64
+#define R_ARM_LDRS_PC_G1 65
+#define R_ARM_LDRS_PC_G2 66
+#define R_ARM_LDC_PC_G0 67
+#define R_ARM_LDC_PC_G1 68
+#define R_ARM_LDC_PC_G2 69
+#define R_ARM_ALU_SB_G0_NC 70
+#define R_ARM_ALU_SB_G0 71
+#define R_ARM_ALU_SB_G1_NC 72
+#define R_ARM_ALU_SB_G1 73
+#define R_ARM_ALU_SB_G2 74
+#define R_ARM_LDR_SB_G0 75
+#define R_ARM_LDR_SB_G1 76
+#define R_ARM_LDR_SB_G2 77
+#define R_ARM_LDRS_SB_G0 78
+#define R_ARM_LDRS_SB_G1 79
+#define R_ARM_LDRS_SB_G2 80
+#define R_ARM_LDC_G0 81
+#define R_ARM_LDC_G1 82
+#define R_ARM_LDC_G2 83
+#define R_ARM_MOVW_BREL_NC 84
+#define R_ARM_MOVT_BREL 85
+#define R_ARM_MOVW_BREL 86
+#define R_ARM_THM_MOVW_BREL_NC 87
+#define R_ARM_THM_MOVT_BREL 88
+#define R_ARM_THM_MOVW_BREL 89
+/* 90-93 unallocated */
+#define R_ARM_PLT32_ABS 94
+#define R_ARM_GOT_ABS 95
+#define R_ARM_GOT_PREL 96
+#define R_ARM_GOT_BREL12 97
+#define R_ARM_GOTOFF12 98
+#define R_ARM_GOTRELAX 99
#define R_ARM_TLS_GOTDESC 90
#define R_ARM_TLS_CALL 91
#define R_ARM_TLS_DESCSEQ 92
@@ -2360,6 +2433,13 @@ typedef Elf32_Addr Elf32_Conflict;
static TLS block offset */
#define R_ARM_TLS_LE32 108 /* 32 bit offset relative to static
TLS block */
+#define R_ARM_TLS_LDO12 109
+#define R_ARM_TLS_LE12 110
+#define R_ARM_TLS_IE12GP 111
+/* 112 - 127 private range */
+#define R_ARM_ME_TOO 128|/* obsolete */
+
+
#define R_ARM_THM_TLS_DESCSEQ 129
#define R_ARM_IRELATIVE 160
#define R_ARM_RXPC25 249
Index: elfutils-0.155/backends/libebl_arm.h
===================================================================
--- /dev/null
+++ elfutils-0.155/backends/libebl_arm.h
@@ -0,0 +1,9 @@
+#ifndef _LIBEBL_ARM_H
+#define _LIBEBL_ARM_H 1
+
+#include <libdw.h>
+
+extern int arm_return_value_location_soft(Dwarf_Die *, const Dwarf_Op **locp);
+extern int arm_return_value_location_hard(Dwarf_Die *, const Dwarf_Op **locp);
+
+#endif

View File

@@ -1,32 +0,0 @@
Upstream-Status: Pending
# This patch makes the link to the dependencies of libdw explicit, as recent
# ld no longer implicitly links them. See
# http://lists.fedoraproject.org/pipermail/devel/2010-March/133601.html as
# a similar example of the error message you can encounter without this patch,
# and https://fedoraproject.org/wiki/UnderstandingDSOLinkChange and
# https://fedoraproject.org/wiki/Features/ChangeInImplicitDSOLinking for more
# details.
--- elfutils-0.155.orig/src/Makefile.am
+++ elfutils-0.155/src/Makefile.am
@@ -86,7 +86,7 @@ libdw = ../libdw/libdw.a $(zip_LIBS) $(l
libelf = ../libelf/libelf.a
else
libasm = ../libasm/libasm.so
-libdw = ../libdw/libdw.so
+libdw = ../libdw/libdw.so $(zip_LIBS) $(libelf) $(libebl) -ldl
libelf = ../libelf/libelf.so
endif
libebl = ../libebl/libebl.a
--- elfutils-0.155.orig/tests/Makefile.am
+++ elfutils-0.155/tests/Makefile.am
@@ -172,7 +172,7 @@ libdw = ../libdw/libdw.a $(zip_LIBS) $(l
libelf = ../libelf/libelf.a
libasm = ../libasm/libasm.a
else
-libdw = ../libdw/libdw.so
+libdw = ../libdw/libdw.so $(zip_LIBS) $(libelf) $(libebl) -ldl
libelf = ../libelf/libelf.so
libasm = ../libasm/libasm.so
endif

View File

@@ -1,61 +0,0 @@
Upstream-Status: Backport
Index: elfutils-0.155/libelf/elf.h
===================================================================
--- elfutils-0.155.orig/libelf/elf.h
+++ elfutils-0.155/libelf/elf.h
@@ -149,8 +149,13 @@ typedef struct
#define ELFOSABI_TRU64 10 /* Compaq TRU64 UNIX. */
#define ELFOSABI_MODESTO 11 /* Novell Modesto. */
#define ELFOSABI_OPENBSD 12 /* OpenBSD. */
+#define ELFOSABI_OPENVMS 13 /* OpenVMS */
+#define ELFOSABI_NSK 14 /* Hewlett-Packard Non-Stop Kernel */
+#define ELFOSABI_AROS 15 /* Amiga Research OS */
+/* 64-255 Architecture-specific value range */
#define ELFOSABI_ARM_AEABI 64 /* ARM EABI */
#define ELFOSABI_ARM 97 /* ARM */
+/* This is deprecated? It's not in the latest version anymore. */
#define ELFOSABI_STANDALONE 255 /* Standalone (embedded) application */
#define EI_ABIVERSION 8 /* ABI version */
@@ -205,7 +210,7 @@ typedef struct
#define EM_H8_300H 47 /* Hitachi H8/300H */
#define EM_H8S 48 /* Hitachi H8S */
#define EM_H8_500 49 /* Hitachi H8/500 */
-#define EM_IA_64 50 /* Intel Merced */
+#define EM_IA_64 50 /* Intel IA64 */
#define EM_MIPS_X 51 /* Stanford MIPS-X */
#define EM_COLDFIRE 52 /* Motorola Coldfire */
#define EM_68HC12 53 /* Motorola M68HC12 */
@@ -219,7 +224,8 @@ typedef struct
#define EM_TINYJ 61 /* Advanced Logic Corp. Tinyj emb.fam*/
#define EM_X86_64 62 /* AMD x86-64 architecture */
#define EM_PDSP 63 /* Sony DSP Processor */
-
+#define EM_PDP10 64 /* Digital Equipment Corp. PDP-10 */
+#define EM_PDP11 65 /* Digital Equipment Corp. PDP-11 */
#define EM_FX66 66 /* Siemens FX66 microcontroller */
#define EM_ST9PLUS 67 /* STMicroelectronics ST9+ 8/16 mc */
#define EM_ST7 68 /* STmicroelectronics ST7 8 bit mc */
@@ -249,6 +255,21 @@ typedef struct
#define EM_OPENRISC 92 /* OpenRISC 32-bit embedded processor */
#define EM_ARC_A5 93 /* ARC Cores Tangent-A5 */
#define EM_XTENSA 94 /* Tensilica Xtensa Architecture */
+#define EM_VIDEOCORE 95 /* Alphamosaic VideoCore processor */
+#define EM_TMM_GPP 96 /* Thompson Multimedia General Purpose Processor */
+#define EM_NS32K 97 /* National Semiconductor 32000 series */
+#define EM_TPC 98 /* Tenor Network TPC processor */
+#define EM_SNP1K 99 /* Trebia SNP 1000 processor */
+#define EM_ST200 100 /* STMicroelectronics (www.st.com) ST200 microcontroller */
+#define EM_IP2K 101 /* Ubicom IP2XXX microcontroller family */
+#define EM_MAX 102 /* MAX Processor */
+#define EM_CR 103 /* National Semiconductor CompactRISC */
+#define EM_F2MC16 104 /* Fujitsu F2MC16 */
+#define EM_MSP430 105 /* TI msp430 micro controller */
+#define EM_BLACKFIN 106 /* Analog Devices Blackfin (DSP) processor */
+#define EM_SE_C33 107 /* S1C33 Family of Seiko Epson processors */
+#define EM_SEP 108 /* Sharp embedded microprocessor */
+#define EM_ARCA 109 /* Arca RISC Microprocessor */
#define EM_TILEPRO 188 /* Tilera TILEPro */
#define EM_TILEGX 191 /* Tilera TILE-Gx */
#define EM_NUM 192

View File

@@ -1,23 +0,0 @@
Upstream-Status: Backport
ar.c (do_oper_delete): Fix num passed to memset
native build failed as following on Fedora18+:
ar.c: In function 'do_oper_delete':
ar.c:918:31: error: argument to 'sizeof' in 'memset' call is the same expression as the destination; did you mean to dereference it? [-Werror=sizeof-pointer-memaccess]
memset (found, '\0', sizeof (found));
^
The original commit is http://git.fedorahosted.org/cgit/elfutils.git/commit/src/ar.c?id=1a4d0668d18bf1090c5c08cdb5cb3ba2b8eb5410
Signed-off-by: Zhenhua Luo <zhenhua.luo@freescale.com>
--- elfutils-0.155/src/ar.c.org 2013-03-12 21:12:17.928281375 -0500
+++ elfutils-0.155/src/ar.c 2013-03-12 21:15:30.053285271 -0500
@@ -915,7 +915,7 @@
long int instance)
{
bool *found = alloca (sizeof (bool) * argc);
- memset (found, '\0', sizeof (found));
+ memset (found, '\0', sizeof (bool) * argc);
/* List of the files we keep. */
struct armem *to_copy = NULL;

File diff suppressed because it is too large Load Diff

View File

@@ -1,24 +0,0 @@
uclibc does not export __mempcpy like glibc so we alias it here.
This patch may make sense for upstream but elfutils uses more
glibc specific features like obstack_printf which are missing in
uclibc they need to be fixed along to make it work all the way
Upstream-Status: Inappropriate[Elfutils uses more glibc specific features]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Index: elfutils-0.155/libelf/elf_begin.c
===================================================================
--- elfutils-0.155.orig/libelf/elf_begin.c
+++ elfutils-0.155/libelf/elf_begin.c
@@ -68,6 +68,9 @@
#include "libelfP.h"
#include "common.h"
+#ifdef __UCLIBC__
+#define __mempcpy mempcpy
+#endif
/* Create descriptor for archive in memory. */
static inline Elf *

View File

@@ -1,27 +0,0 @@
Upstream-Status: Backport
nm: Fix size passed to snprintf for invalid sh_name case.
native build failed as following on Fedora18:
nm.c: In function 'show_symbols_sysv':
nm.c:756:27: error: argument to 'sizeof' in 'snprintf' call is the same expression as the destination; did you mean to provide an explicit length? [-Werror=sizeof-pointer-memaccess]
snprintf (name, sizeof name, "[invalid sh_name %#" PRIx32 "]",
^
The original commit is http://git.fedorahosted.org/cgit/elfutils.git/commit/src/nm.c?id=57bd66cabf6e6b9ecf622cdbf350804897a8df58
Signed-off-by: Zhenhua Luo <zhenhua.luo@freescale.com>
--- elfutils-0.155/src/nm.c.org 2013-03-11 22:36:11.000000000 -0500
+++ elfutils-0.155/src/nm.c 2013-03-11 22:46:09.000000000 -0500
@@ -752,8 +752,9 @@
gelf_getshdr (scn, &shdr_mem)->sh_name);
if (unlikely (name == NULL))
{
- name = alloca (sizeof "[invalid sh_name 0x12345678]");
- snprintf (name, sizeof name, "[invalid sh_name %#" PRIx32 "]",
+ const size_t bufsz = sizeof "[invalid sh_name 0x12345678]";
+ name = alloca (bufsz);
+ snprintf (name, bufsz, "[invalid sh_name %#" PRIx32 "]",
gelf_getshdr (scn, &shdr_mem)->sh_name);
}
scnnames[elf_ndxscn (scn)] = name;

View File

@@ -1,91 +0,0 @@
on uclibc systems libintl and libuargp are separate from libc.
so they need to be specified on commandline when we use proxy-libintl
then libintl is a static archive so it should be listed last since
elfutils does not respect disable-nls we need to link in libintl
We add a new option --enable-uclibc which will be used to control
the uclibc specific configurations during build.
Signed-off-by: Khem Raj <raj.khem>
Upstream-Status: Inappropriate [uclibc specific]
Index: elfutils-0.155/configure.ac
===================================================================
--- elfutils-0.155.orig/configure.ac
+++ elfutils-0.155/configure.ac
@@ -55,9 +55,16 @@ AS_IF([test "$use_locks" = yes], [AC_DEF
AH_TEMPLATE([USE_LOCKS], [Defined if libraries should be thread-safe.])
+AC_ARG_ENABLE([uclibc],
+AS_HELP_STRING([--enable-uclibc], [Use uclibc for system libraries]),
+use_uclibc=yes, use_uclibc=no)
+AM_CONDITIONAL(USE_UCLIBC, test "$use_uclibc" = yes)
+AS_IF([test "$use_uclibc" = yes], [AC_DEFINE(USE_UCLIBC)])
+
+AH_TEMPLATE([USE_UCLIBC], [Defined if uclibc libraries are used.])
+
dnl Add all the languages for which translations are available.
ALL_LINGUAS=
-
AC_PROG_CC
AC_PROG_RANLIB
AC_PROG_YACC
Index: elfutils-0.155/libelf/Makefile.am
===================================================================
--- elfutils-0.155.orig/libelf/Makefile.am
+++ elfutils-0.155/libelf/Makefile.am
@@ -93,7 +93,12 @@ if !MUDFLAP
libelf_pic_a_SOURCES =
am_libelf_pic_a_OBJECTS = $(libelf_a_SOURCES:.c=.os)
+
libelf_so_LDLIBS =
+if USE_UCLIBC
+libelf_so_LDLIBS += -lintl -luargp
+endif
+
if USE_LOCKS
libelf_so_LDLIBS += -lpthread
endif
Index: elfutils-0.155/libdw/Makefile.am
===================================================================
--- elfutils-0.155.orig/libdw/Makefile.am
+++ elfutils-0.155/libdw/Makefile.am
@@ -98,6 +98,11 @@ if !MUDFLAP
libdw_pic_a_SOURCES =
am_libdw_pic_a_OBJECTS = $(libdw_a_SOURCES:.c=.os)
+libdw_so_LDLIBS =
+if USE_UCLIBC
+libdw_so_LDLIBS += -lintl -luargp
+endif
+
libdw_so_SOURCES =
libdw.so: $(srcdir)/libdw.map libdw_pic.a \
../libdwfl/libdwfl_pic.a ../libebl/libebl.a \
@@ -108,7 +113,7 @@ libdw.so: $(srcdir)/libdw.map libdw_pic.
-Wl,--enable-new-dtags,-rpath,$(pkglibdir) \
-Wl,--version-script,$<,--no-undefined \
-Wl,--whole-archive $(filter-out $<,$^) -Wl,--no-whole-archive\
- -ldl $(zip_LIBS)
+ -ldl $(zip_LIBS) $(libdw_so_LDLIBS)
if readelf -d $@ | fgrep -q TEXTREL; then exit 1; fi
ln -fs $@ $@.$(VERSION)
Index: elfutils-0.155/libcpu/Makefile.am
===================================================================
--- elfutils-0.155.orig/libcpu/Makefile.am
+++ elfutils-0.155/libcpu/Makefile.am
@@ -63,6 +63,10 @@ i386_parse_CFLAGS = -DNMNES="`wc -l < i3
i386_lex.o: i386_parse.h
i386_gendis_LDADD = $(libeu) -lm $(libmudflap)
+if USE_UCLIBC
+i386_gendis_LDADD += -luargp -lintl
+endif
+
i386_parse.h: i386_parse.c ;
noinst_HEADERS = memory-access.h i386_parse.h i386_data.h

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,35 @@
From 7f1eec317db79627b473c5b149a22a1b20d1f68f Mon Sep 17 00:00:00 2001
From: Mark Wielaard <mjw@redhat.com>
Date: Wed, 9 Apr 2014 11:33:23 +0200
Subject: [PATCH] CVE-2014-0172 Check for overflow before calling malloc to
uncompress data.
https://bugzilla.redhat.com/show_bug.cgi?id=1085663
Reported-by: Florian Weimer <fweimer@redhat.com>
Signed-off-by: Mark Wielaard <mjw@redhat.com>
Index: elfutils-0.158/libdw/dwarf_begin_elf.c
===================================================================
--- elfutils-0.158.orig/libdw/dwarf_begin_elf.c 2014-05-01 17:10:01.928213292 +0000
+++ elfutils-0.158/libdw/dwarf_begin_elf.c 2014-05-01 17:10:01.924213375 +0000
@@ -1,5 +1,5 @@
/* Create descriptor from ELF descriptor for processing file.
- Copyright (C) 2002-2011 Red Hat, Inc.
+ Copyright (C) 2002-2011, 2014 Red Hat, Inc.
This file is part of elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -289,6 +289,12 @@
memcpy (&size, data->d_buf + 4, sizeof size);
size = be64toh (size);
+ /* Check for unsigned overflow so malloc always allocated
+ enough memory for both the Elf_Data header and the
+ uncompressed section data. */
+ if (unlikely (sizeof (Elf_Data) + size < size))
+ break;
+
Elf_Data *zdata = malloc (sizeof (Elf_Data) + size);
if (unlikely (zdata == NULL))
break;

View File

@@ -0,0 +1,603 @@
Index: elfutils-0.158/backends/arm_init.c
===================================================================
--- elfutils-0.158.orig/backends/arm_init.c 2014-04-21 11:13:24.378519252 +0000
+++ elfutils-0.158/backends/arm_init.c 2014-04-21 11:13:24.374519343 +0000
@@ -35,21 +35,32 @@
#define RELOC_PREFIX R_ARM_
#include "libebl_CPU.h"
+#include "libebl_arm.h"
+
/* This defines the common reloc hooks based on arm_reloc.def. */
#include "common-reloc.c"
const char *
arm_init (elf, machine, eh, ehlen)
- Elf *elf __attribute__ ((unused));
+ Elf *elf;
GElf_Half machine __attribute__ ((unused));
Ebl *eh;
size_t ehlen;
{
+ int soft_float = 0;
+
/* Check whether the Elf_BH object has a sufficent size. */
if (ehlen < sizeof (Ebl))
return NULL;
+ if (elf) {
+ GElf_Ehdr ehdr_mem;
+ GElf_Ehdr *ehdr = gelf_getehdr (elf, &ehdr_mem);
+ if (ehdr && (ehdr->e_flags & EF_ARM_SOFT_FLOAT))
+ soft_float = 1;
+ }
+
/* We handle it. */
eh->name = "ARM";
arm_init_reloc (eh);
@@ -61,7 +72,10 @@
HOOK (eh, core_note);
HOOK (eh, auxv_info);
HOOK (eh, check_object_attribute);
- HOOK (eh, return_value_location);
+ if (soft_float)
+ eh->return_value_location = arm_return_value_location_soft;
+ else
+ eh->return_value_location = arm_return_value_location_hard;
HOOK (eh, abi_cfi);
return MODVERSION;
Index: elfutils-0.158/backends/arm_regs.c
===================================================================
--- elfutils-0.158.orig/backends/arm_regs.c 2014-04-21 11:13:24.378519252 +0000
+++ elfutils-0.158/backends/arm_regs.c 2014-04-21 11:13:24.374519343 +0000
@@ -31,6 +31,7 @@
#endif
#include <string.h>
+#include <stdio.h>
#include <dwarf.h>
#define BACKEND arm_
@@ -76,6 +77,9 @@
break;
case 16 + 0 ... 16 + 7:
+ /* AADWARF says that there are no registers in that range,
+ * but gcc maps FPA registers here
+ */
regno += 96 - 16;
/* Fall through. */
case 96 + 0 ... 96 + 7:
@@ -87,11 +91,139 @@
namelen = 2;
break;
+ case 64 + 0 ... 64 + 9:
+ *setname = "VFP";
+ *bits = 32;
+ *type = DW_ATE_float;
+ name[0] = 's';
+ name[1] = regno - 64 + '0';
+ namelen = 2;
+ break;
+
+ case 64 + 10 ... 64 + 31:
+ *setname = "VFP";
+ *bits = 32;
+ *type = DW_ATE_float;
+ name[0] = 's';
+ name[1] = (regno - 64) / 10 + '0';
+ name[2] = (regno - 64) % 10 + '0';
+ namelen = 3;
+ break;
+
+ case 104 + 0 ... 104 + 7:
+ /* XXX TODO:
+ * This can be either intel wireless MMX general purpose/control
+ * registers or xscale accumulator, which have different usage.
+ * We only have the intel wireless MMX here now.
+ * The name needs to be changed for the xscale accumulator too. */
+ *setname = "MMX";
+ *type = DW_ATE_unsigned;
+ *bits = 32;
+ memcpy(name, "wcgr", 4);
+ name[4] = regno - 104 + '0';
+ namelen = 5;
+ break;
+
+ case 112 + 0 ... 112 + 9:
+ *setname = "MMX";
+ *type = DW_ATE_unsigned;
+ *bits = 64;
+ name[0] = 'w';
+ name[1] = 'r';
+ name[2] = regno - 112 + '0';
+ namelen = 3;
+ break;
+
+ case 112 + 10 ... 112 + 15:
+ *setname = "MMX";
+ *type = DW_ATE_unsigned;
+ *bits = 64;
+ name[0] = 'w';
+ name[1] = 'r';
+ name[2] = '1';
+ name[3] = regno - 112 - 10 + '0';
+ namelen = 4;
+ break;
+
case 128:
+ *setname = "state";
*type = DW_ATE_unsigned;
return stpcpy (name, "spsr") + 1 - name;
+ case 129:
+ *setname = "state";
+ *type = DW_ATE_unsigned;
+ return stpcpy(name, "spsr_fiq") + 1 - name;
+
+ case 130:
+ *setname = "state";
+ *type = DW_ATE_unsigned;
+ return stpcpy(name, "spsr_irq") + 1 - name;
+
+ case 131:
+ *setname = "state";
+ *type = DW_ATE_unsigned;
+ return stpcpy(name, "spsr_abt") + 1 - name;
+
+ case 132:
+ *setname = "state";
+ *type = DW_ATE_unsigned;
+ return stpcpy(name, "spsr_und") + 1 - name;
+
+ case 133:
+ *setname = "state";
+ *type = DW_ATE_unsigned;
+ return stpcpy(name, "spsr_svc") + 1 - name;
+
+ case 144 ... 150:
+ *setname = "integer";
+ *type = DW_ATE_signed;
+ *bits = 32;
+ return sprintf(name, "r%d_usr", regno - 144 + 8) + 1;
+
+ case 151 ... 157:
+ *setname = "integer";
+ *type = DW_ATE_signed;
+ *bits = 32;
+ return sprintf(name, "r%d_fiq", regno - 151 + 8) + 1;
+
+ case 158 ... 159:
+ *setname = "integer";
+ *type = DW_ATE_signed;
+ *bits = 32;
+ return sprintf(name, "r%d_irq", regno - 158 + 13) + 1;
+
+ case 160 ... 161:
+ *setname = "integer";
+ *type = DW_ATE_signed;
+ *bits = 32;
+ return sprintf(name, "r%d_abt", regno - 160 + 13) + 1;
+
+ case 162 ... 163:
+ *setname = "integer";
+ *type = DW_ATE_signed;
+ *bits = 32;
+ return sprintf(name, "r%d_und", regno - 162 + 13) + 1;
+
+ case 164 ... 165:
+ *setname = "integer";
+ *type = DW_ATE_signed;
+ *bits = 32;
+ return sprintf(name, "r%d_svc", regno - 164 + 13) + 1;
+
+ case 192 ... 199:
+ *setname = "MMX";
+ *bits = 32;
+ *type = DW_ATE_unsigned;
+ name[0] = 'w';
+ name[1] = 'c';
+ name[2] = regno - 192 + '0';
+ namelen = 3;
+ break;
+
case 256 + 0 ... 256 + 9:
+ /* XXX TODO: Neon also uses those registers and can contain
+ * both float and integers */
*setname = "VFP";
*type = DW_ATE_float;
*bits = 64;
Index: elfutils-0.158/backends/arm_retval.c
===================================================================
--- elfutils-0.158.orig/backends/arm_retval.c 2014-04-21 11:13:24.378519252 +0000
+++ elfutils-0.158/backends/arm_retval.c 2014-04-21 11:13:24.374519343 +0000
@@ -48,6 +48,13 @@
#define nloc_intreg 1
#define nloc_intregs(n) (2 * (n))
+/* f1 */ /* XXX TODO: f0 can also have number 96 if program was compiled with -mabi=aapcs */
+static const Dwarf_Op loc_fpreg[] =
+ {
+ { .atom = DW_OP_reg16 },
+ };
+#define nloc_fpreg 1
+
/* The return value is a structure and is actually stored in stack space
passed in a hidden argument by the caller. But, the compiler
helpfully returns the address of that space in r0. */
@@ -58,8 +65,9 @@
#define nloc_aggregate 1
-int
-arm_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
+static int
+arm_return_value_location_ (Dwarf_Die *functypedie, const Dwarf_Op **locp,
+ int soft_float)
{
/* Start with the function's type, and get the DW_AT_type attribute,
which is the type of the return value. */
@@ -112,14 +120,31 @@
else
return -1;
}
+ if (tag == DW_TAG_base_type)
+ {
+ Dwarf_Word encoding;
+ if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_encoding,
+ &attr_mem), &encoding) != 0)
+ return -1;
+
+ if ((encoding == DW_ATE_float) && !soft_float)
+ {
+ *locp = loc_fpreg;
+ if (size <= 8)
+ return nloc_fpreg;
+ goto aggregate;
+ }
+ }
if (size <= 16)
{
intreg:
*locp = loc_intreg;
return size <= 4 ? nloc_intreg : nloc_intregs ((size + 3) / 4);
}
+ /* fall through. */
aggregate:
+ /* XXX TODO sometimes aggregates are returned in r0 (-mabi=aapcs) */
*locp = loc_aggregate;
return nloc_aggregate;
@@ -138,3 +163,18 @@
DWARF and might be valid. */
return -2;
}
+
+/* return location for -mabi=apcs-gnu -msoft-float */
+int
+arm_return_value_location_soft (Dwarf_Die *functypedie, const Dwarf_Op **locp)
+{
+ return arm_return_value_location_ (functypedie, locp, 1);
+}
+
+/* return location for -mabi=apcs-gnu -mhard-float (current default) */
+int
+arm_return_value_location_hard (Dwarf_Die *functypedie, const Dwarf_Op **locp)
+{
+ return arm_return_value_location_ (functypedie, locp, 0);
+}
+
Index: elfutils-0.158/libelf/elf.h
===================================================================
--- elfutils-0.158.orig/libelf/elf.h 2014-04-21 11:13:24.378519252 +0000
+++ elfutils-0.158/libelf/elf.h 2014-04-21 11:13:24.374519343 +0000
@@ -2318,6 +2318,9 @@
#define EF_ARM_EABI_VER4 0x04000000
#define EF_ARM_EABI_VER5 0x05000000
+/* EI_OSABI values */
+#define ELFOSABI_ARM_AEABI 64 /* Contains symbol versioning. */
+
/* Additional symbol types for Thumb. */
#define STT_ARM_TFUNC STT_LOPROC /* A Thumb function. */
#define STT_ARM_16BIT STT_HIPROC /* A Thumb label. */
@@ -2335,12 +2338,19 @@
/* Processor specific values for the Phdr p_type field. */
#define PT_ARM_EXIDX (PT_LOPROC + 1) /* ARM unwind segment. */
+#define PT_ARM_UNWIND PT_ARM_EXIDX
/* Processor specific values for the Shdr sh_type field. */
#define SHT_ARM_EXIDX (SHT_LOPROC + 1) /* ARM unwind section. */
#define SHT_ARM_PREEMPTMAP (SHT_LOPROC + 2) /* Preemption details. */
#define SHT_ARM_ATTRIBUTES (SHT_LOPROC + 3) /* ARM attributes section. */
+/* Processor specific values for the Dyn d_tag field. */
+#define DT_ARM_RESERVED1 (DT_LOPROC + 0)
+#define DT_ARM_SYMTABSZ (DT_LOPROC + 1)
+#define DT_ARM_PREEMTMAB (DT_LOPROC + 2)
+#define DT_ARM_RESERVED2 (DT_LOPROC + 3)
+#define DT_ARM_NUM 4
/* AArch64 relocs. */
@@ -2619,6 +2629,7 @@
TLS block (LDR, STR). */
#define R_ARM_TLS_IE12GP 111 /* 12 bit GOT entry relative
to GOT origin (LDR). */
+/* 112 - 127 private range */
#define R_ARM_ME_TOO 128 /* Obsolete. */
#define R_ARM_THM_TLS_DESCSEQ 129
#define R_ARM_THM_TLS_DESCSEQ16 129
Index: elfutils-0.158/backends/libebl_arm.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ elfutils-0.158/backends/libebl_arm.h 2014-04-21 11:13:24.374519343 +0000
@@ -0,0 +1,9 @@
+#ifndef _LIBEBL_ARM_H
+#define _LIBEBL_ARM_H 1
+
+#include <libdw.h>
+
+extern int arm_return_value_location_soft(Dwarf_Die *, const Dwarf_Op **locp);
+extern int arm_return_value_location_hard(Dwarf_Die *, const Dwarf_Op **locp);
+
+#endif
Index: elfutils-0.158/tests/run-allregs.sh
===================================================================
--- elfutils-0.158.orig/tests/run-allregs.sh 2014-04-21 11:13:24.378519252 +0000
+++ elfutils-0.158/tests/run-allregs.sh 2014-04-21 11:13:24.378519252 +0000
@@ -2671,7 +2671,28 @@
13: sp (sp), address 32 bits
14: lr (lr), address 32 bits
15: pc (pc), address 32 bits
- 128: spsr (spsr), unsigned 32 bits
+ 144: r8_usr (r8_usr), signed 32 bits
+ 145: r9_usr (r9_usr), signed 32 bits
+ 146: r10_usr (r10_usr), signed 32 bits
+ 147: r11_usr (r11_usr), signed 32 bits
+ 148: r12_usr (r12_usr), signed 32 bits
+ 149: r13_usr (r13_usr), signed 32 bits
+ 150: r14_usr (r14_usr), signed 32 bits
+ 151: r8_fiq (r8_fiq), signed 32 bits
+ 152: r9_fiq (r9_fiq), signed 32 bits
+ 153: r10_fiq (r10_fiq), signed 32 bits
+ 154: r11_fiq (r11_fiq), signed 32 bits
+ 155: r12_fiq (r12_fiq), signed 32 bits
+ 156: r13_fiq (r13_fiq), signed 32 bits
+ 157: r14_fiq (r14_fiq), signed 32 bits
+ 158: r13_irq (r13_irq), signed 32 bits
+ 159: r14_irq (r14_irq), signed 32 bits
+ 160: r13_abt (r13_abt), signed 32 bits
+ 161: r14_abt (r14_abt), signed 32 bits
+ 162: r13_und (r13_und), signed 32 bits
+ 163: r14_und (r14_und), signed 32 bits
+ 164: r13_svc (r13_svc), signed 32 bits
+ 165: r14_svc (r14_svc), signed 32 bits
FPA registers:
16: f0 (f0), float 96 bits
17: f1 (f1), float 96 bits
@@ -2689,7 +2710,72 @@
101: f5 (f5), float 96 bits
102: f6 (f6), float 96 bits
103: f7 (f7), float 96 bits
+MMX registers:
+ 104: wcgr0 (wcgr0), unsigned 32 bits
+ 105: wcgr1 (wcgr1), unsigned 32 bits
+ 106: wcgr2 (wcgr2), unsigned 32 bits
+ 107: wcgr3 (wcgr3), unsigned 32 bits
+ 108: wcgr4 (wcgr4), unsigned 32 bits
+ 109: wcgr5 (wcgr5), unsigned 32 bits
+ 110: wcgr6 (wcgr6), unsigned 32 bits
+ 111: wcgr7 (wcgr7), unsigned 32 bits
+ 112: wr0 (wr0), unsigned 64 bits
+ 113: wr1 (wr1), unsigned 64 bits
+ 114: wr2 (wr2), unsigned 64 bits
+ 115: wr3 (wr3), unsigned 64 bits
+ 116: wr4 (wr4), unsigned 64 bits
+ 117: wr5 (wr5), unsigned 64 bits
+ 118: wr6 (wr6), unsigned 64 bits
+ 119: wr7 (wr7), unsigned 64 bits
+ 120: wr8 (wr8), unsigned 64 bits
+ 121: wr9 (wr9), unsigned 64 bits
+ 122: wr10 (wr10), unsigned 64 bits
+ 123: wr11 (wr11), unsigned 64 bits
+ 124: wr12 (wr12), unsigned 64 bits
+ 125: wr13 (wr13), unsigned 64 bits
+ 126: wr14 (wr14), unsigned 64 bits
+ 127: wr15 (wr15), unsigned 64 bits
+ 192: wc0 (wc0), unsigned 32 bits
+ 193: wc1 (wc1), unsigned 32 bits
+ 194: wc2 (wc2), unsigned 32 bits
+ 195: wc3 (wc3), unsigned 32 bits
+ 196: wc4 (wc4), unsigned 32 bits
+ 197: wc5 (wc5), unsigned 32 bits
+ 198: wc6 (wc6), unsigned 32 bits
+ 199: wc7 (wc7), unsigned 32 bits
VFP registers:
+ 64: s0 (s0), float 32 bits
+ 65: s1 (s1), float 32 bits
+ 66: s2 (s2), float 32 bits
+ 67: s3 (s3), float 32 bits
+ 68: s4 (s4), float 32 bits
+ 69: s5 (s5), float 32 bits
+ 70: s6 (s6), float 32 bits
+ 71: s7 (s7), float 32 bits
+ 72: s8 (s8), float 32 bits
+ 73: s9 (s9), float 32 bits
+ 74: s10 (s10), float 32 bits
+ 75: s11 (s11), float 32 bits
+ 76: s12 (s12), float 32 bits
+ 77: s13 (s13), float 32 bits
+ 78: s14 (s14), float 32 bits
+ 79: s15 (s15), float 32 bits
+ 80: s16 (s16), float 32 bits
+ 81: s17 (s17), float 32 bits
+ 82: s18 (s18), float 32 bits
+ 83: s19 (s19), float 32 bits
+ 84: s20 (s20), float 32 bits
+ 85: s21 (s21), float 32 bits
+ 86: s22 (s22), float 32 bits
+ 87: s23 (s23), float 32 bits
+ 88: s24 (s24), float 32 bits
+ 89: s25 (s25), float 32 bits
+ 90: s26 (s26), float 32 bits
+ 91: s27 (s27), float 32 bits
+ 92: s28 (s28), float 32 bits
+ 93: s29 (s29), float 32 bits
+ 94: s30 (s30), float 32 bits
+ 95: s31 (s31), float 32 bits
256: d0 (d0), float 64 bits
257: d1 (d1), float 64 bits
258: d2 (d2), float 64 bits
@@ -2722,6 +2808,13 @@
285: d29 (d29), float 64 bits
286: d30 (d30), float 64 bits
287: d31 (d31), float 64 bits
+state registers:
+ 128: spsr (spsr), unsigned 32 bits
+ 129: spsr_fiq (spsr_fiq), unsigned 32 bits
+ 130: spsr_irq (spsr_irq), unsigned 32 bits
+ 131: spsr_abt (spsr_abt), unsigned 32 bits
+ 132: spsr_und (spsr_und), unsigned 32 bits
+ 133: spsr_svc (spsr_svc), unsigned 32 bits
EOF
# See run-readelf-mixed-corenote.sh for instructions to regenerate
Index: elfutils-0.158/tests/run-readelf-mixed-corenote.sh
===================================================================
--- elfutils-0.158.orig/tests/run-readelf-mixed-corenote.sh 2014-04-21 11:13:24.378519252 +0000
+++ elfutils-0.158/tests/run-readelf-mixed-corenote.sh 2014-04-21 11:13:24.378519252 +0000
@@ -30,12 +30,11 @@
pid: 11087, ppid: 11063, pgrp: 11087, sid: 11063
utime: 0.000000, stime: 0.010000, cutime: 0.000000, cstime: 0.000000
orig_r0: -1, fpvalid: 1
- r0: 1 r1: -1091672508 r2: -1091672500
- r3: 0 r4: 0 r5: 0
- r6: 33728 r7: 0 r8: 0
- r9: 0 r10: -1225703496 r11: -1091672844
- r12: 0 sp: 0xbeee64f4 lr: 0xb6dc3f48
- pc: 0x00008500 spsr: 0x60000010
+ r0: 1 r1: -1091672508 r2: -1091672500 r3: 0
+ r4: 0 r5: 0 r6: 33728 r7: 0
+ r8: 0 r9: 0 r10: -1225703496 r11: -1091672844
+ r12: 0 sp: 0xbeee64f4 lr: 0xb6dc3f48 pc: 0x00008500
+ spsr: 0x60000010
CORE 124 PRPSINFO
state: 0, sname: R, zomb: 0, nice: 0, flag: 0x00400500
uid: 0, gid: 0, pid: 11087, ppid: 11063, pgrp: 11087, sid: 11063
Index: elfutils-0.158/tests/run-addrcfi.sh
===================================================================
--- elfutils-0.158.orig/tests/run-addrcfi.sh 2014-04-21 11:13:24.378519252 +0000
+++ elfutils-0.158/tests/run-addrcfi.sh 2014-04-21 11:13:24.378519252 +0000
@@ -2530,6 +2530,38 @@
FPA reg21 (f5): undefined
FPA reg22 (f6): undefined
FPA reg23 (f7): undefined
+ VFP reg64 (s0): undefined
+ VFP reg65 (s1): undefined
+ VFP reg66 (s2): undefined
+ VFP reg67 (s3): undefined
+ VFP reg68 (s4): undefined
+ VFP reg69 (s5): undefined
+ VFP reg70 (s6): undefined
+ VFP reg71 (s7): undefined
+ VFP reg72 (s8): undefined
+ VFP reg73 (s9): undefined
+ VFP reg74 (s10): undefined
+ VFP reg75 (s11): undefined
+ VFP reg76 (s12): undefined
+ VFP reg77 (s13): undefined
+ VFP reg78 (s14): undefined
+ VFP reg79 (s15): undefined
+ VFP reg80 (s16): undefined
+ VFP reg81 (s17): undefined
+ VFP reg82 (s18): undefined
+ VFP reg83 (s19): undefined
+ VFP reg84 (s20): undefined
+ VFP reg85 (s21): undefined
+ VFP reg86 (s22): undefined
+ VFP reg87 (s23): undefined
+ VFP reg88 (s24): undefined
+ VFP reg89 (s25): undefined
+ VFP reg90 (s26): undefined
+ VFP reg91 (s27): undefined
+ VFP reg92 (s28): undefined
+ VFP reg93 (s29): undefined
+ VFP reg94 (s30): undefined
+ VFP reg95 (s31): undefined
FPA reg96 (f0): undefined
FPA reg97 (f1): undefined
FPA reg98 (f2): undefined
@@ -2538,7 +2570,66 @@
FPA reg101 (f5): undefined
FPA reg102 (f6): undefined
FPA reg103 (f7): undefined
- integer reg128 (spsr): undefined
+ MMX reg104 (wcgr0): undefined
+ MMX reg105 (wcgr1): undefined
+ MMX reg106 (wcgr2): undefined
+ MMX reg107 (wcgr3): undefined
+ MMX reg108 (wcgr4): undefined
+ MMX reg109 (wcgr5): undefined
+ MMX reg110 (wcgr6): undefined
+ MMX reg111 (wcgr7): undefined
+ MMX reg112 (wr0): undefined
+ MMX reg113 (wr1): undefined
+ MMX reg114 (wr2): undefined
+ MMX reg115 (wr3): undefined
+ MMX reg116 (wr4): undefined
+ MMX reg117 (wr5): undefined
+ MMX reg118 (wr6): undefined
+ MMX reg119 (wr7): undefined
+ MMX reg120 (wr8): undefined
+ MMX reg121 (wr9): undefined
+ MMX reg122 (wr10): undefined
+ MMX reg123 (wr11): undefined
+ MMX reg124 (wr12): undefined
+ MMX reg125 (wr13): undefined
+ MMX reg126 (wr14): undefined
+ MMX reg127 (wr15): undefined
+ state reg128 (spsr): undefined
+ state reg129 (spsr_fiq): undefined
+ state reg130 (spsr_irq): undefined
+ state reg131 (spsr_abt): undefined
+ state reg132 (spsr_und): undefined
+ state reg133 (spsr_svc): undefined
+ integer reg144 (r8_usr): undefined
+ integer reg145 (r9_usr): undefined
+ integer reg146 (r10_usr): undefined
+ integer reg147 (r11_usr): undefined
+ integer reg148 (r12_usr): undefined
+ integer reg149 (r13_usr): undefined
+ integer reg150 (r14_usr): undefined
+ integer reg151 (r8_fiq): undefined
+ integer reg152 (r9_fiq): undefined
+ integer reg153 (r10_fiq): undefined
+ integer reg154 (r11_fiq): undefined
+ integer reg155 (r12_fiq): undefined
+ integer reg156 (r13_fiq): undefined
+ integer reg157 (r14_fiq): undefined
+ integer reg158 (r13_irq): undefined
+ integer reg159 (r14_irq): undefined
+ integer reg160 (r13_abt): undefined
+ integer reg161 (r14_abt): undefined
+ integer reg162 (r13_und): undefined
+ integer reg163 (r14_und): undefined
+ integer reg164 (r13_svc): undefined
+ integer reg165 (r14_svc): undefined
+ MMX reg192 (wc0): undefined
+ MMX reg193 (wc1): undefined
+ MMX reg194 (wc2): undefined
+ MMX reg195 (wc3): undefined
+ MMX reg196 (wc4): undefined
+ MMX reg197 (wc5): undefined
+ MMX reg198 (wc6): undefined
+ MMX reg199 (wc7): undefined
VFP reg256 (d0): undefined
VFP reg257 (d1): undefined
VFP reg258 (d2): undefined

View File

@@ -0,0 +1,27 @@
From: Matthias Klose <doko@ubuntu.com>
Date: Tue, 7 Jan 2014 10:25:29 +0100
Subject: [PATCH] tests: backtrace-subr.sh (check_native_core) should check
core file name.
Needed when /proc/sys/kernel/core_uses_pid is set to 0. Try to rename
the core file, and if it does still fail, skip the test.
diff --git a/tests/backtrace-subr.sh b/tests/backtrace-subr.sh
index e7ece91..62b873c 100644
--- a/tests/backtrace-subr.sh
+++ b/tests/backtrace-subr.sh
@@ -111,6 +111,11 @@ check_native_core()
# Skip the test if we cannot adjust core ulimit.
core="core.`ulimit -c unlimited || exit 77; set +ex; testrun ${abs_builddir}/$child --gencore; true`"
+ # see if /proc/sys/kernel/core_uses_pid is set to 0
+ if [ -f core ]; then
+ mv core "$core"
+ fi
+ if [ ! -f "$core" ]; then exit 77; fi
if [ "x$SAVED_VALGRIND_CMD" != "x" ]; then
VALGRIND_CMD="$SAVED_VALGRIND_CMD"
--
1.9.2

View File

@@ -0,0 +1,77 @@
Upstream-Status: Backport
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
libelf/elf.h | 27 +++++++++++++++++++++++++--
1 file changed, 25 insertions(+), 2 deletions(-)
diff --git a/libelf/elf.h b/libelf/elf.h
--- a/libelf/elf.h
+++ b/libelf/elf.h
@@ -142,6 +142,7 @@ typedef struct
#define ELFOSABI_NETBSD 2 /* NetBSD. */
#define ELFOSABI_GNU 3 /* Object uses GNU ELF extensions. */
#define ELFOSABI_LINUX ELFOSABI_GNU /* Compatibility alias. */
+#define ELFOSABI_HURD 4 /* GNU/Hurd */
#define ELFOSABI_SOLARIS 6 /* Sun Solaris. */
#define ELFOSABI_AIX 7 /* IBM AIX. */
#define ELFOSABI_IRIX 8 /* SGI Irix. */
@@ -149,8 +150,13 @@ typedef struct
#define ELFOSABI_TRU64 10 /* Compaq TRU64 UNIX. */
#define ELFOSABI_MODESTO 11 /* Novell Modesto. */
#define ELFOSABI_OPENBSD 12 /* OpenBSD. */
+#define ELFOSABI_OPENVMS 13 /* OpenVMS */
+#define ELFOSABI_NSK 14 /* Hewlett-Packard Non-Stop Kernel */
+#define ELFOSABI_AROS 15 /* Amiga Research OS */
+/* 64-255 Architecture-specific value range */
#define ELFOSABI_ARM_AEABI 64 /* ARM EABI */
#define ELFOSABI_ARM 97 /* ARM */
+/* This is deprecated? It's not in the latest version anymore. */
#define ELFOSABI_STANDALONE 255 /* Standalone (embedded) application */
#define EI_ABIVERSION 8 /* ABI version */
@@ -205,7 +211,7 @@ typedef struct
#define EM_H8_300H 47 /* Hitachi H8/300H */
#define EM_H8S 48 /* Hitachi H8S */
#define EM_H8_500 49 /* Hitachi H8/500 */
-#define EM_IA_64 50 /* Intel Merced */
+#define EM_IA_64 50 /* Intel IA64 */
#define EM_MIPS_X 51 /* Stanford MIPS-X */
#define EM_COLDFIRE 52 /* Motorola Coldfire */
#define EM_68HC12 53 /* Motorola M68HC12 */
@@ -219,7 +225,8 @@ typedef struct
#define EM_TINYJ 61 /* Advanced Logic Corp. Tinyj emb.fam*/
#define EM_X86_64 62 /* AMD x86-64 architecture */
#define EM_PDSP 63 /* Sony DSP Processor */
-
+#define EM_PDP10 64 /* Digital Equipment Corp. PDP-10 */
+#define EM_PDP11 65 /* Digital Equipment Corp. PDP-11 */
#define EM_FX66 66 /* Siemens FX66 microcontroller */
#define EM_ST9PLUS 67 /* STMicroelectronics ST9+ 8/16 mc */
#define EM_ST7 68 /* STmicroelectronics ST7 8 bit mc */
@@ -249,6 +256,22 @@ typedef struct
#define EM_OPENRISC 92 /* OpenRISC 32-bit embedded processor */
#define EM_ARC_A5 93 /* ARC Cores Tangent-A5 */
#define EM_XTENSA 94 /* Tensilica Xtensa Architecture */
+#define EM_VIDEOCORE 95 /* Alphamosaic VideoCore processor */
+#define EM_TMM_GPP 96 /* Thompson Multimedia General Purpose Processor */
+#define EM_NS32K 97 /* National Semiconductor 32000 series */
+#define EM_TPC 98 /* Tenor Network TPC processor */
+#define EM_SNP1K 99 /* Trebia SNP 1000 processor */
+#define EM_ST200 100 /* STMicroelectronics (www.st.com) ST200 microcontroller */
+#define EM_IP2K 101 /* Ubicom IP2XXX microcontroller family */
+#define EM_MAX 102 /* MAX Processor */
+#define EM_CR 103 /* National Semiconductor CompactRISC */
+#define EM_F2MC16 104 /* Fujitsu F2MC16 */
+#define EM_MSP430 105 /* TI msp430 micro controller */
+#define EM_BLACKFIN 106 /* Analog Devices Blackfin (DSP) processor */
+#define EM_SE_C33 107 /* S1C33 Family of Seiko Epson processors */
+#define EM_SEP 108 /* Sharp embedded microprocessor */
+#define EM_ARCA 109 /* Arca RISC Microprocessor */
+
#define EM_AARCH64 183 /* ARM AARCH64 */
#define EM_TILEPRO 188 /* Tilera TILEPro */
#define EM_MICROBLAZE 189 /* Xilinx MicroBlaze */
--
1.8.1.2

View File

@@ -1,9 +1,7 @@
Upstream-Status: Backport
Index: elfutils-0.155/backends/parisc_init.c
Index: elfutils-0.158/backends/parisc_init.c
===================================================================
--- /dev/null
+++ elfutils-0.155/backends/parisc_init.c
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ elfutils-0.158/backends/parisc_init.c 2014-04-21 11:12:12.228150280 +0000
@@ -0,0 +1,74 @@
+/* Initialization of PA-RISC specific backend library.
+ Copyright (C) 2002, 2005, 2006 Red Hat, Inc.
@@ -79,10 +77,10 @@ Index: elfutils-0.155/backends/parisc_init.c
+
+ return MODVERSION;
+}
Index: elfutils-0.155/backends/parisc_regs.c
Index: elfutils-0.158/backends/parisc_regs.c
===================================================================
--- /dev/null
+++ elfutils-0.155/backends/parisc_regs.c
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ elfutils-0.158/backends/parisc_regs.c 2014-04-21 11:12:12.228150280 +0000
@@ -0,0 +1,159 @@
+/* Register names and numbers for PA-RISC DWARF.
+ Copyright (C) 2005, 2006 Red Hat, Inc.
@@ -243,10 +241,10 @@ Index: elfutils-0.155/backends/parisc_regs.c
+ name[namelen++] = '\0';
+ return namelen;
+}
Index: elfutils-0.155/backends/parisc_reloc.def
Index: elfutils-0.158/backends/parisc_reloc.def
===================================================================
--- /dev/null
+++ elfutils-0.155/backends/parisc_reloc.def
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ elfutils-0.158/backends/parisc_reloc.def 2014-04-21 11:12:12.228150280 +0000
@@ -0,0 +1,128 @@
+/* List the relocation types for PA-RISC. -*- C -*-
+ Copyright (C) 2005 Red Hat, Inc.
@@ -376,10 +374,10 @@ Index: elfutils-0.155/backends/parisc_reloc.def
+RELOC_TYPE (TLS_DTPMOD64, DYN)
+
+#define NO_RELATIVE_RELOC 1
Index: elfutils-0.155/backends/parisc_retval.c
Index: elfutils-0.158/backends/parisc_retval.c
===================================================================
--- /dev/null
+++ elfutils-0.155/backends/parisc_retval.c
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ elfutils-0.158/backends/parisc_retval.c 2014-04-21 11:12:12.228150280 +0000
@@ -0,0 +1,213 @@
+/* Function return value location for Linux/PA-RISC ABI.
+ Copyright (C) 2005 Red Hat, Inc.
@@ -594,10 +592,10 @@ Index: elfutils-0.155/backends/parisc_retval.c
+ return parisc_return_value_location_ (functypedie, locp, 1);
+}
+
Index: elfutils-0.155/backends/parisc_symbol.c
Index: elfutils-0.158/backends/parisc_symbol.c
===================================================================
--- /dev/null
+++ elfutils-0.155/backends/parisc_symbol.c
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ elfutils-0.158/backends/parisc_symbol.c 2014-04-21 11:12:12.228150280 +0000
@@ -0,0 +1,112 @@
+/* PA-RISC specific symbolic name handling.
+ Copyright (C) 2002, 2005 Red Hat, Inc.
@@ -711,10 +709,10 @@ Index: elfutils-0.155/backends/parisc_symbol.c
+ return ELF_T_NUM;
+ }
+}
Index: elfutils-0.155/backends/libebl_parisc.h
Index: elfutils-0.158/backends/libebl_parisc.h
===================================================================
--- /dev/null
+++ elfutils-0.155/backends/libebl_parisc.h
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ elfutils-0.158/backends/libebl_parisc.h 2014-04-21 11:12:12.228150280 +0000
@@ -0,0 +1,9 @@
+#ifndef _LIBEBL_HPPA_H
+#define _LIBEBL_HPPA_H 1
@@ -725,25 +723,26 @@ Index: elfutils-0.155/backends/libebl_parisc.h
+extern int parisc_return_value_location_64(Dwarf_Die *, const Dwarf_Op **locp);
+
+#endif
Index: elfutils-0.155/backends/Makefile.am
Index: elfutils-0.158/backends/Makefile.am
===================================================================
--- elfutils-0.155.orig/backends/Makefile.am
+++ elfutils-0.155/backends/Makefile.am
@@ -32,11 +32,11 @@
-I$(top_srcdir)/libelf -I$(top_srcdir)/libdw
--- elfutils-0.158.orig/backends/Makefile.am 2014-04-21 11:12:12.252149737 +0000
+++ elfutils-0.158/backends/Makefile.am 2014-04-21 11:13:11.910801105 +0000
@@ -33,11 +33,12 @@
-modules = i386 sh x86_64 ia64 alpha arm sparc ppc ppc64 s390 tilegx
+modules = i386 sh x86_64 ia64 alpha arm sparc ppc ppc64 s390 tilegx parisc
libebl_pic = libebl_i386_pic.a libebl_sh_pic.a libebl_x86_64_pic.a \
libebl_ia64_pic.a libebl_alpha_pic.a libebl_arm_pic.a \
libebl_sparc_pic.a libebl_ppc_pic.a libebl_ppc64_pic.a \
- libebl_s390_pic.a libebl_tilegx_pic.a
+ libebl_s390_pic.a libebl_tilegx_pic.a libebl_parisc_pic.a
modules = i386 sh x86_64 ia64 alpha arm aarch64 sparc ppc ppc64 s390 \
- tilegx
+ tilegx parisc
libebl_pic = libebl_i386_pic.a libebl_sh_pic.a libebl_x86_64_pic.a \
libebl_ia64_pic.a libebl_alpha_pic.a libebl_arm_pic.a \
libebl_aarch64_pic.a libebl_sparc_pic.a libebl_ppc_pic.a \
- libebl_ppc64_pic.a libebl_s390_pic.a libebl_tilegx_pic.a
+ libebl_ppc64_pic.a libebl_s390_pic.a libebl_tilegx_pic.a \
+ libebl_parisc_pic.a
noinst_LIBRARIES = $(libebl_pic)
noinst_DATA = $(libebl_pic:_pic.a=.so)
@@ -103,6 +103,9 @@
@@ -116,6 +117,9 @@
libebl_tilegx_pic_a_SOURCES = $(tilegx_SRCS)
am_libebl_tilegx_pic_a_OBJECTS = $(tilegx_SRCS:.c=.os)
@@ -753,11 +752,11 @@ Index: elfutils-0.155/backends/Makefile.am
libebl_%.so libebl_%.map: libebl_%_pic.a $(libelf) $(libdw)
@rm -f $(@:.so=.map)
Index: elfutils-0.155/libelf/elf.h
Index: elfutils-0.158/libelf/elf.h
===================================================================
--- elfutils-0.155.orig/libelf/elf.h
+++ elfutils-0.155/libelf/elf.h
@@ -1780,16 +1780,24 @@
--- elfutils-0.158.orig/libelf/elf.h 2014-04-21 11:12:12.252149737 +0000
+++ elfutils-0.158/libelf/elf.h 2014-04-21 11:12:12.228150280 +0000
@@ -1814,16 +1814,24 @@
#define R_PARISC_PCREL17F 12 /* 17 bits of rel. address. */
#define R_PARISC_PCREL14R 14 /* Right 14 bits of rel. address. */
#define R_PARISC_DPREL21L 18 /* Left 21 bits of rel. address. */
@@ -782,7 +781,7 @@ Index: elfutils-0.155/libelf/elf.h
#define R_PARISC_LTOFF_FPTR32 57 /* 32 bits LT-rel. function pointer. */
#define R_PARISC_LTOFF_FPTR21L 58 /* LT-rel. fct ptr, left 21 bits. */
#define R_PARISC_LTOFF_FPTR14R 62 /* LT-rel. fct ptr, right 14 bits. */
@@ -1798,6 +1806,7 @@
@@ -1832,6 +1840,7 @@
#define R_PARISC_PLABEL21L 66 /* Left 21 bits of fdesc address. */
#define R_PARISC_PLABEL14R 70 /* Right 14 bits of fdesc address. */
#define R_PARISC_PCREL64 72 /* 64 bits PC-rel. address. */
@@ -790,7 +789,7 @@ Index: elfutils-0.155/libelf/elf.h
#define R_PARISC_PCREL22F 74 /* 22 bits PC-rel. address. */
#define R_PARISC_PCREL14WR 75 /* PC-rel. address, right 14 bits. */
#define R_PARISC_PCREL14DR 76 /* PC rel. address, right 14 bits. */
@@ -1823,6 +1832,8 @@
@@ -1857,6 +1866,8 @@
#define R_PARISC_LTOFF16WF 102 /* 16 bits LT-rel. address. */
#define R_PARISC_LTOFF16DF 103 /* 16 bits LT-rel. address. */
#define R_PARISC_SECREL64 104 /* 64 bits section rel. address. */

View File

@@ -0,0 +1,34 @@
m4/biarch.m4: tweak AC_RUN_IFELSE for cross-compiling
Macro: AC_RUN_IFELSE (input,
[action-if-true],
[action-if-false],
[action-if-cross-compiling])
Add the missing [action-if-cross-compiling] part to support
cross-compiling.
Upstream-Status: inappropriate [oe specific]
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
m4/biarch.m4 | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/m4/biarch.m4 b/m4/biarch.m4
--- a/m4/biarch.m4
+++ b/m4/biarch.m4
@@ -40,7 +40,9 @@ AC_CACHE_CHECK([whether $biarch_CC makes executables we can run],
save_CC="$CC"
CC="$biarch_CC"
AC_RUN_IFELSE([AC_LANG_PROGRAM([], [])],
- utrace_cv_cc_biarch=yes, utrace_cv_cc_biarch=no)
+ utrace_cv_cc_biarch=yes,
+ utrace_cv_cc_biarch=no,
+ utrace_cv_cc_biarch=yes)
CC="$save_CC"])], [utrace_cv_cc_biarch=no])
AS_IF([test $utrace_cv_cc_biarch != yes], [dnl
AC_MSG_WARN([not running biarch tests, $biarch_CC does not work])])])
--
1.8.1.2

View File

@@ -1,10 +1,16 @@
Upstream-Status: Backport
From: Kurt Roeckx <kurt@roeckx.be>
From: Thorsten Glaser <tg@mirbsd.de>
Subject: m68k support
Index: elfutils-0.155/backends/m68k_init.c
Written by Kurt Roeckx, except for the retval support which was written
by Thorsten Glaser
Index: elfutils-0.158/backends/m68k_init.c
===================================================================
--- /dev/null
+++ elfutils-0.155/backends/m68k_init.c
@@ -0,0 +1,49 @@
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ elfutils-0.158/backends/m68k_init.c 2014-04-21 11:14:23.813175704 +0000
@@ -0,0 +1,50 @@
+/* Initialization of m68k specific backend library.
+ Copyright (C) 2007 Kurt Roeckx <kurt@roeckx.be>
+
@@ -50,14 +56,15 @@ Index: elfutils-0.155/backends/m68k_init.c
+ eh->name = "m68k";
+ m68k_init_reloc (eh);
+ HOOK (eh, reloc_simple_type);
+ HOOK (eh, return_value_location);
+ HOOK (eh, register_info);
+
+ return MODVERSION;
+}
Index: elfutils-0.155/backends/m68k_regs.c
Index: elfutils-0.158/backends/m68k_regs.c
===================================================================
--- /dev/null
+++ elfutils-0.155/backends/m68k_regs.c
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ elfutils-0.158/backends/m68k_regs.c 2014-04-21 11:14:23.813175704 +0000
@@ -0,0 +1,106 @@
+/* Register names and numbers for m68k DWARF.
+ Copyright (C) 2007 Kurt Roeckx <kurt@roeckx.be>
@@ -165,10 +172,10 @@ Index: elfutils-0.155/backends/m68k_regs.c
+ return namelen;
+}
+
Index: elfutils-0.155/backends/m68k_reloc.def
Index: elfutils-0.158/backends/m68k_reloc.def
===================================================================
--- /dev/null
+++ elfutils-0.155/backends/m68k_reloc.def
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ elfutils-0.158/backends/m68k_reloc.def 2014-04-21 11:14:23.813175704 +0000
@@ -0,0 +1,45 @@
+/* List the relocation types for m68k. -*- C -*-
+ Copyright (C) 2007 Kurt Roeckx <kurt@roeckx.be>
@@ -215,11 +222,11 @@ Index: elfutils-0.155/backends/m68k_reloc.def
+RELOC_TYPE (GNU_VTINHERIT, REL)
+RELOC_TYPE (GNU_VTENTRY, REL)
+
Index: elfutils-0.155/libelf/elf.h
Index: elfutils-0.158/libelf/elf.h
===================================================================
--- elfutils-0.155.orig/libelf/elf.h
+++ elfutils-0.155/libelf/elf.h
@@ -1126,6 +1126,9 @@
--- elfutils-0.158.orig/libelf/elf.h 2014-04-21 11:14:23.813175704 +0000
+++ elfutils-0.158/libelf/elf.h 2014-04-21 11:14:23.813175704 +0000
@@ -1157,6 +1157,9 @@
#define R_68K_GLOB_DAT 20 /* Create GOT entry */
#define R_68K_JMP_SLOT 21 /* Create PLT entry */
#define R_68K_RELATIVE 22 /* Adjust by program base */
@@ -229,40 +236,40 @@ Index: elfutils-0.155/libelf/elf.h
#define R_68K_TLS_GD32 25 /* 32 bit GOT offset for GD */
#define R_68K_TLS_GD16 26 /* 16 bit GOT offset for GD */
#define R_68K_TLS_GD8 27 /* 8 bit GOT offset for GD */
Index: elfutils-0.155/backends/Makefile.am
Index: elfutils-0.158/backends/Makefile.am
===================================================================
--- elfutils-0.155.orig/backends/Makefile.am
+++ elfutils-0.155/backends/Makefile.am
@@ -32,12 +32,12 @@
-I$(top_srcdir)/libelf -I$(top_srcdir)/libdw
--- elfutils-0.158.orig/backends/Makefile.am 2014-04-21 11:14:23.813175704 +0000
+++ elfutils-0.158/backends/Makefile.am 2014-04-21 11:14:48.344621167 +0000
@@ -33,12 +33,12 @@
-modules = i386 sh x86_64 ia64 alpha arm sparc ppc ppc64 s390 tilegx parisc mips
+modules = i386 sh x86_64 ia64 alpha arm sparc ppc ppc64 s390 tilegx parisc mips m68k
libebl_pic = libebl_i386_pic.a libebl_sh_pic.a libebl_x86_64_pic.a \
libebl_ia64_pic.a libebl_alpha_pic.a libebl_arm_pic.a \
libebl_sparc_pic.a libebl_ppc_pic.a libebl_ppc64_pic.a \
libebl_s390_pic.a libebl_tilegx_pic.a libebl_parisc_pic.a \
- libebl_mips_pic.a
+ libebl_mips_pic.a libebl_m68k_pic.a
modules = i386 sh x86_64 ia64 alpha arm aarch64 sparc ppc ppc64 s390 \
- tilegx parisc mips
+ tilegx parisc mips m68k
libebl_pic = libebl_i386_pic.a libebl_sh_pic.a libebl_x86_64_pic.a \
libebl_ia64_pic.a libebl_alpha_pic.a libebl_arm_pic.a \
libebl_aarch64_pic.a libebl_sparc_pic.a libebl_ppc_pic.a \
libebl_ppc64_pic.a libebl_s390_pic.a libebl_tilegx_pic.a \
- libebl_parisc_pic.a libebl_mips_pic.a
+ libebl_parisc_pic.a libebl_mips_pic.a libebl_m68k_pic.a
noinst_LIBRARIES = $(libebl_pic)
noinst_DATA = $(libebl_pic:_pic.a=.so)
@@ -112,6 +112,10 @@
@@ -125,6 +125,10 @@
libebl_mips_pic_a_SOURCES = $(mips_SRCS)
am_libebl_mips_pic_a_OBJECTS = $(mips_SRCS:.c=.os)
+m68k_SRCS = m68k_init.c m68k_symbol.c m68k_regs.c
+m68k_SRCS = m68k_init.c m68k_symbol.c m68k_regs.c m68k_retval.c
+libebl_m68k_pic_a_SOURCES = $(m68k_SRCS)
+am_libebl_m68k_pic_a_OBJECTS = $(m68k_SRCS:.c=.os)
+
libebl_%.so libebl_%.map: libebl_%_pic.a $(libelf) $(libdw)
@rm -f $(@:.so=.map)
echo 'ELFUTILS_$(PACKAGE_VERSION) { global: $*_init; local: *; };' \
Index: elfutils-0.155/backends/m68k_symbol.c
Index: elfutils-0.158/backends/m68k_symbol.c
===================================================================
--- /dev/null
+++ elfutils-0.155/backends/m68k_symbol.c
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ elfutils-0.158/backends/m68k_symbol.c 2014-04-21 11:14:23.813175704 +0000
@@ -0,0 +1,43 @@
+/* m68k specific symbolic name handling.
+ Copyright (C) 2007 Kurt Roeckx <kurt@roeckx.be>
@@ -307,3 +314,180 @@ Index: elfutils-0.155/backends/m68k_symbol.c
+ return ELF_T_NUM;
+ }
+}
Index: elfutils-0.158/backends/m68k_retval.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ elfutils-0.158/backends/m68k_retval.c 2014-04-21 11:14:23.813175704 +0000
@@ -0,0 +1,172 @@
+/* Function return value location for Linux/m68k ABI.
+ Copyright (C) 2005-2010 Red Hat, Inc.
+ Copyright (c) 2011 Thorsten Glaser, Debian.
+ This file is part of Red Hat elfutils.
+
+ Red Hat elfutils is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by the
+ Free Software Foundation; version 2 of the License.
+
+ Red Hat elfutils is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with Red Hat elfutils; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
+
+ Red Hat elfutils is an included package of the Open Invention Network.
+ An included package of the Open Invention Network is a package for which
+ Open Invention Network licensees cross-license their patents. No patent
+ license is granted, either expressly or impliedly, by designation as an
+ included package. Should you wish to participate in the Open Invention
+ Network licensing program, please visit www.openinventionnetwork.com
+ <http://www.openinventionnetwork.com>. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <assert.h>
+#include <dwarf.h>
+
+#define BACKEND m68k_
+#include "libebl_CPU.h"
+
+
+/* %d0, or pair %d0, %d1, or %a0 */
+static const Dwarf_Op loc_intreg[] =
+ {
+ { .atom = DW_OP_reg0 }, { .atom = DW_OP_piece, .number = 4 },
+ { .atom = DW_OP_reg1 }, { .atom = DW_OP_piece, .number = 4 },
+ };
+static const Dwarf_Op loc_ptrreg[] =
+ {
+ { .atom = DW_OP_reg8 },
+ };
+#define nloc_intreg 1
+#define nloc_intregpair 4
+#define nloc_ptrreg 1
+
+/* %f0 */
+static const Dwarf_Op loc_fpreg[] =
+ {
+ { .atom = DW_OP_reg16 }
+ };
+#define nloc_fpreg 1
+
+/* Structures are a bit more complicated - small structures are returned
+ in %d0 / %d1 (-freg-struct-return which is enabled by default), large
+ structures use %a1 (in constrast to the SYSV psABI which says %a0) as
+ reentrant storage space indicator. */
+static const Dwarf_Op loc_aggregate[] =
+ {
+ { .atom = DW_OP_breg9, .number = 0 }
+ };
+#define nloc_aggregate 1
+
+int
+m68k_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
+{
+ Dwarf_Word size;
+
+ /* Start with the function's type, and get the DW_AT_type attribute,
+ which is the type of the return value. */
+
+ Dwarf_Attribute attr_mem;
+ Dwarf_Attribute *attr = dwarf_attr_integrate (functypedie, DW_AT_type,
+ &attr_mem);
+ if (attr == NULL)
+ /* The function has no return value, like a `void' function in C. */
+ return 0;
+
+ Dwarf_Die die_mem;
+ Dwarf_Die *typedie = dwarf_formref_die (attr, &die_mem);
+ int tag = dwarf_tag (typedie);
+
+ /* Follow typedefs and qualifiers to get to the actual type. */
+ while (tag == DW_TAG_typedef
+ || tag == DW_TAG_const_type || tag == DW_TAG_volatile_type
+ || tag == DW_TAG_restrict_type || tag == DW_TAG_mutable_type)
+ {
+ attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem);
+ typedie = dwarf_formref_die (attr, &die_mem);
+ tag = dwarf_tag (typedie);
+ }
+
+ switch (tag)
+ {
+ case -1:
+ return -1;
+
+ case DW_TAG_subrange_type:
+ if (! dwarf_hasattr_integrate (typedie, DW_AT_byte_size))
+ {
+ attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem);
+ typedie = dwarf_formref_die (attr, &die_mem);
+ tag = dwarf_tag (typedie);
+ }
+ /* Fall through. */
+
+ case DW_TAG_base_type:
+ case DW_TAG_enumeration_type:
+ case DW_TAG_pointer_type:
+ case DW_TAG_ptr_to_member_type:
+ if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_byte_size,
+ &attr_mem), &size) != 0)
+ {
+ if (tag == DW_TAG_pointer_type || tag == DW_TAG_ptr_to_member_type)
+ size = 4;
+ else
+ return -1;
+ }
+ if (tag == DW_TAG_pointer_type || tag == DW_TAG_ptr_to_member_type)
+ {
+ *locp = loc_ptrreg;
+ return nloc_ptrreg;
+ }
+ if (tag == DW_TAG_base_type)
+ {
+ Dwarf_Word encoding;
+ if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_encoding,
+ &attr_mem),
+ &encoding) != 0)
+ return -1;
+ if (encoding == DW_ATE_float)
+ {
+ /* XXX really 10? */
+ if (size > 10)
+ return -2;
+ *locp = loc_fpreg;
+ return nloc_fpreg;
+ }
+ }
+ if (size <= 8)
+ {
+ intreg:
+ /* XXX check endianness of dword pair, int64 vs aggregate */
+ *locp = loc_intreg;
+ return size <= 4 ? nloc_intreg : nloc_intregpair;
+ }
+
+ aggregate:
+ *locp = loc_aggregate;
+ return nloc_aggregate;
+
+ case DW_TAG_structure_type:
+ case DW_TAG_class_type:
+ case DW_TAG_union_type:
+ case DW_TAG_array_type:
+ if (dwarf_aggregate_size (typedie, &size) == 0
+ && size > 0 && size <= 8)
+ /* not accurate for a struct whose only member is a float */
+ goto intreg;
+ goto aggregate;
+ }
+
+ /* XXX We don't have a good way to return specific errors from ebl calls.
+ This value means we do not understand the type, but it is well-formed
+ DWARF and might be valid. */
+ return -2;
+}

View File

@@ -1,9 +1,7 @@
Upstream-Status: Backport
Index: elfutils-0.155/backends/mips_init.c
Index: elfutils-0.158/backends/mips_init.c
===================================================================
--- /dev/null
+++ elfutils-0.155/backends/mips_init.c
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ elfutils-0.158/backends/mips_init.c 2014-04-21 11:13:36.910235965 +0000
@@ -0,0 +1,60 @@
+/* Initialization of mips specific backend library.
+ Copyright (C) 2006 Red Hat, Inc.
@@ -65,10 +63,10 @@ Index: elfutils-0.155/backends/mips_init.c
+
+ return MODVERSION;
+}
Index: elfutils-0.155/backends/mips_regs.c
Index: elfutils-0.158/backends/mips_regs.c
===================================================================
--- /dev/null
+++ elfutils-0.155/backends/mips_regs.c
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ elfutils-0.158/backends/mips_regs.c 2014-04-21 11:13:36.910235965 +0000
@@ -0,0 +1,104 @@
+/* Register names and numbers for MIPS DWARF.
+ Copyright (C) 2006 Red Hat, Inc.
@@ -174,10 +172,10 @@ Index: elfutils-0.155/backends/mips_regs.c
+ name[namelen++] = '\0';
+ return namelen;
+}
Index: elfutils-0.155/backends/mips_reloc.def
Index: elfutils-0.158/backends/mips_reloc.def
===================================================================
--- /dev/null
+++ elfutils-0.155/backends/mips_reloc.def
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ elfutils-0.158/backends/mips_reloc.def 2014-04-21 11:13:36.910235965 +0000
@@ -0,0 +1,79 @@
+/* List the relocation types for mips. -*- C -*-
+ Copyright (C) 2006 Red Hat, Inc.
@@ -258,10 +256,10 @@ Index: elfutils-0.155/backends/mips_reloc.def
+
+#define NO_COPY_RELOC 1
+#define NO_RELATIVE_RELOC 1
Index: elfutils-0.155/backends/mips_retval.c
Index: elfutils-0.158/backends/mips_retval.c
===================================================================
--- /dev/null
+++ elfutils-0.155/backends/mips_retval.c
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ elfutils-0.158/backends/mips_retval.c 2014-04-21 11:13:36.910235965 +0000
@@ -0,0 +1,321 @@
+/* Function return value location for Linux/mips ABI.
+ Copyright (C) 2005 Red Hat, Inc.
@@ -584,10 +582,10 @@ Index: elfutils-0.155/backends/mips_retval.c
+ DWARF and might be valid. */
+ return -2;
+}
Index: elfutils-0.155/backends/mips_symbol.c
Index: elfutils-0.158/backends/mips_symbol.c
===================================================================
--- /dev/null
+++ elfutils-0.155/backends/mips_symbol.c
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ elfutils-0.158/backends/mips_symbol.c 2014-04-21 11:13:36.910235965 +0000
@@ -0,0 +1,52 @@
+/* MIPS specific symbolic name handling.
+ Copyright (C) 2002, 2003, 2005 Red Hat, Inc.
@@ -641,10 +639,10 @@ Index: elfutils-0.155/backends/mips_symbol.c
+ return ELF_T_NUM;
+ }
+}
Index: elfutils-0.155/libebl/eblopenbackend.c
Index: elfutils-0.158/libebl/eblopenbackend.c
===================================================================
--- elfutils-0.155.orig/libebl/eblopenbackend.c
+++ elfutils-0.155/libebl/eblopenbackend.c
--- elfutils-0.158.orig/libebl/eblopenbackend.c 2014-04-21 11:13:36.914235875 +0000
+++ elfutils-0.158/libebl/eblopenbackend.c 2014-04-21 11:13:36.910235965 +0000
@@ -71,6 +71,8 @@
{ "sparc", "elf_sparc", "sparc", 5, EM_SPARC, 0, 0 },
{ "sparc", "elf_sparcv8plus", "sparc", 5, EM_SPARC32PLUS, 0, 0 },
@@ -654,10 +652,10 @@ Index: elfutils-0.155/libebl/eblopenbackend.c
{ "m32", "elf_m32", "m32", 3, EM_M32, 0, 0 },
{ "m68k", "elf_m68k", "m68k", 4, EM_68K, 0, 0 },
Index: elfutils-0.155/backends/common-reloc.c
Index: elfutils-0.158/backends/common-reloc.c
===================================================================
--- elfutils-0.155.orig/backends/common-reloc.c
+++ elfutils-0.155/backends/common-reloc.c
--- elfutils-0.158.orig/backends/common-reloc.c 2014-04-21 11:13:36.914235875 +0000
+++ elfutils-0.158/backends/common-reloc.c 2014-04-21 11:13:36.910235965 +0000
@@ -112,11 +112,13 @@
}
@@ -682,26 +680,26 @@ Index: elfutils-0.155/backends/common-reloc.c
ebl->none_reloc_p = EBLHOOK(none_reloc_p);
#ifndef NO_RELATIVE_RELOC
ebl->relative_reloc_p = EBLHOOK(relative_reloc_p);
Index: elfutils-0.155/backends/Makefile.am
Index: elfutils-0.158/backends/Makefile.am
===================================================================
--- elfutils-0.155.orig/backends/Makefile.am
+++ elfutils-0.155/backends/Makefile.am
@@ -32,11 +32,12 @@
-I$(top_srcdir)/libelf -I$(top_srcdir)/libdw
--- elfutils-0.158.orig/backends/Makefile.am 2014-04-21 11:13:36.914235875 +0000
+++ elfutils-0.158/backends/Makefile.am 2014-04-21 11:14:10.841468934 +0000
@@ -33,12 +33,12 @@
-modules = i386 sh x86_64 ia64 alpha arm sparc ppc ppc64 s390 tilegx parisc
+modules = i386 sh x86_64 ia64 alpha arm sparc ppc ppc64 s390 tilegx parisc mips
libebl_pic = libebl_i386_pic.a libebl_sh_pic.a libebl_x86_64_pic.a \
libebl_ia64_pic.a libebl_alpha_pic.a libebl_arm_pic.a \
libebl_sparc_pic.a libebl_ppc_pic.a libebl_ppc64_pic.a \
- libebl_s390_pic.a libebl_tilegx_pic.a libebl_parisc_pic.a
+ libebl_s390_pic.a libebl_tilegx_pic.a libebl_parisc_pic.a \
+ libebl_mips_pic.a
modules = i386 sh x86_64 ia64 alpha arm aarch64 sparc ppc ppc64 s390 \
- tilegx parisc
+ tilegx parisc mips
libebl_pic = libebl_i386_pic.a libebl_sh_pic.a libebl_x86_64_pic.a \
libebl_ia64_pic.a libebl_alpha_pic.a libebl_arm_pic.a \
libebl_aarch64_pic.a libebl_sparc_pic.a libebl_ppc_pic.a \
libebl_ppc64_pic.a libebl_s390_pic.a libebl_tilegx_pic.a \
- libebl_parisc_pic.a
+ libebl_parisc_pic.a libebl_mips_pic.a
noinst_LIBRARIES = $(libebl_pic)
noinst_DATA = $(libebl_pic:_pic.a=.so)
@@ -107,6 +108,10 @@
@@ -121,6 +121,10 @@
libebl_parisc_pic_a_SOURCES = $(parisc_SRCS)
am_libebl_parisc_pic_a_OBJECTS = $(parisc_SRCS:.c=.os)

View File

@@ -0,0 +1,22 @@
From: Kurt Roeckx <kurt@roeckx.be>
Subject: Make readelf -w output debug information on mips
Bug-Debian: http://bugs.debian.org/662041
Forwarded: not-needed
Upstreams wants a change where this is handled by a hook that needs
to be filled in by the backend for the arch.
Index: elfutils-0.153/src/readelf.c
===================================================================
--- elfutils-0.153.orig/src/readelf.c 2012-08-10 22:01:55.000000000 +0200
+++ elfutils-0.153/src/readelf.c 2012-09-18 21:46:27.000000000 +0200
@@ -7364,7 +7364,8 @@
GElf_Shdr shdr_mem;
GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem);
- if (shdr != NULL && shdr->sh_type == SHT_PROGBITS)
+ if (shdr != NULL && (
+ (shdr->sh_type == SHT_PROGBITS) || (shdr->sh_type == SHT_MIPS_DWARF)))
{
static const struct
{

View File

@@ -1,10 +1,6 @@
Upstream-Status: Backport
Index: elfutils-0.155/libelf/ChangeLog
===================================================================
--- elfutils-0.155.orig/libdwfl/ChangeLog
+++ elfutils-0.155/libdwfl/ChangeLog
@@ -52,6 +52,11 @@
--- elfutils/libdwfl/ChangeLog
+++ elfutils/libdwfl/ChangeLog
@@ -680,6 +680,11 @@
* dwfl_module_getdwarf.c (open_elf): Clear errno before CBFAIL.
Reported by Kurt Roeckx <kurt@roeckx.be>.
@@ -25,7 +21,7 @@ Index: elfutils-0.155/libelf/ChangeLog
This file is part of elfutils.
This file is free software; you can redistribute it and/or modify
@@ -457,7 +457,10 @@ relocate_section (Dwfl_Module *mod, Elf
@@ -456,7 +456,10 @@ relocate_section (Dwfl_Module *mod, Elf
}
}
@@ -37,7 +33,7 @@ Index: elfutils-0.155/libelf/ChangeLog
size_t complete = 0;
if (shdr->sh_type == SHT_REL)
for (size_t relidx = 0; !result && relidx < nrels; ++relidx)
@@ -559,7 +562,7 @@ relocate_section (Dwfl_Module *mod, Elf
@@ -558,7 +561,7 @@ relocate_section (Dwfl_Module *mod, Elf
nrels = next;
}
@@ -46,11 +42,9 @@ Index: elfutils-0.155/libelf/ChangeLog
gelf_update_shdr (scn, shdr);
}
Index: elfutils-0.155/libelf/ChangeLog
===================================================================
--- elfutils-0.155.orig/libelf/ChangeLog 2010-07-03 13:07:10.000000000 +0000
+++ elfutils-0.155/libelf/ChangeLog 2010-07-03 13:07:11.000000000 +0000
@@ -703,10 +703,53 @@
--- elfutils/libelf/ChangeLog
+++ elfutils/libelf/ChangeLog
@@ -754,10 +754,53 @@
If section content hasn't been read yet, do it before looking for the
block size. If no section data present, infer size of section header.
@@ -104,10 +98,8 @@ Index: elfutils-0.155/libelf/ChangeLog
2005-05-09 Ulrich Drepper <drepper@redhat.com>
* elf.h: Update from glibc.
Index: elfutils-0.155/libelf/elf32_getphdr.c
===================================================================
--- elfutils-0.155.orig/libelf/elf32_getphdr.c 2010-04-21 14:26:40.000000000 +0000
+++ elfutils-0.155/libelf/elf32_getphdr.c 2010-07-03 13:07:11.000000000 +0000
--- elfutils/libelf/elf32_getphdr.c
+++ elfutils/libelf/elf32_getphdr.c
@@ -93,6 +93,16 @@ __elfw2(LIBELFBITS,getphdr_wrlock) (elf)
if (elf->map_address != NULL)
@@ -125,10 +117,8 @@ Index: elfutils-0.155/libelf/elf32_getphdr.c
/* All the data is already mapped. Use it. */
void *file_phdr = ((char *) elf->map_address
+ elf->start_offset + ehdr->e_phoff);
Index: elfutils-0.155/libelf/elf32_getshdr.c
===================================================================
--- elfutils-0.155.orig/libelf/elf32_getshdr.c 2009-06-13 22:41:42.000000000 +0000
+++ elfutils-0.155/libelf/elf32_getshdr.c 2010-07-03 13:07:11.000000000 +0000
--- elfutils/libelf/elf32_getshdr.c
+++ elfutils/libelf/elf32_getshdr.c
@@ -60,7 +60,8 @@ load_shdr_wrlock (Elf_Scn *scn)
goto out;
@@ -156,10 +146,8 @@ Index: elfutils-0.155/libelf/elf32_getshdr.c
ElfW2(LIBELFBITS,Shdr) *notcvt;
/* All the data is already mapped. If we could use it
Index: elfutils-0.155/libelf/elf32_newphdr.c
===================================================================
--- elfutils-0.155.orig/libelf/elf32_newphdr.c 2010-01-12 16:57:54.000000000 +0000
+++ elfutils-0.155/libelf/elf32_newphdr.c 2010-07-03 13:07:11.000000000 +0000
--- elfutils/libelf/elf32_newphdr.c
+++ elfutils/libelf/elf32_newphdr.c
@@ -114,6 +114,12 @@ elfw2(LIBELFBITS,newphdr) (elf, count)
|| count == PN_XNUM
|| elf->state.ELFW(elf,LIBELFBITS).phdr == NULL)
@@ -173,10 +161,8 @@ Index: elfutils-0.155/libelf/elf32_newphdr.c
/* Allocate a new program header with the appropriate number of
elements. */
result = (ElfW2(LIBELFBITS,Phdr) *)
Index: elfutils-0.155/libelf/elf32_updatefile.c
===================================================================
--- elfutils-0.155.orig/libelf/elf32_updatefile.c 2010-01-12 16:57:54.000000000 +0000
+++ elfutils-0.155/libelf/elf32_updatefile.c 2010-07-03 13:07:11.000000000 +0000
--- elfutils/libelf/elf32_updatefile.c
+++ elfutils/libelf/elf32_updatefile.c
@@ -202,6 +202,9 @@ __elfw2(LIBELFBITS,updatemmap) (Elf *elf
/* Write all the sections. Well, only those which are modified. */
if (shnum > 0)
@@ -198,10 +184,8 @@ Index: elfutils-0.155/libelf/elf32_updatefile.c
off_t shdr_offset = elf->start_offset + ehdr->e_shoff;
#if EV_NUM != 2
xfct_t shdr_fctp = __elf_xfctstom[__libelf_version - 1][EV_CURRENT - 1][ELFW(ELFCLASS, LIBELFBITS) - 1][ELF_T_SHDR];
Index: elfutils-0.155/libelf/elf_begin.c
===================================================================
--- elfutils-0.155.orig/libelf/elf_begin.c 2010-04-21 14:26:40.000000000 +0000
+++ elfutils-0.155/libelf/elf_begin.c 2010-07-03 13:07:11.000000000 +0000
--- elfutils/libelf/elf_begin.c
+++ elfutils/libelf/elf_begin.c
@@ -144,7 +144,8 @@ get_shnum (void *map_address, unsigned c
if (unlikely (result == 0) && ehdr.e32->e_shoff != 0)
@@ -267,11 +251,9 @@ Index: elfutils-0.155/libelf/elf_begin.c
elf->state.elf64.shdr
= (Elf64_Shdr *) ((char *) ehdr + ehdr->e_shoff);
Index: elfutils-0.155/libelf/elf_getarsym.c
===================================================================
--- elfutils-0.155.orig/libelf/elf_getarsym.c 2009-01-08 20:56:37.000000000 +0000
+++ elfutils-0.155/libelf/elf_getarsym.c 2010-07-03 13:07:11.000000000 +0000
@@ -181,6 +181,9 @@ elf_getarsym (elf, ptr)
--- elfutils/libelf/elf_getarsym.c
+++ elfutils/libelf/elf_getarsym.c
@@ -183,6 +183,9 @@ elf_getarsym (elf, ptr)
size_t index_size = atol (tmpbuf);
if (SARMAG + sizeof (struct ar_hdr) + index_size > elf->maximum_size
@@ -281,10 +263,8 @@ Index: elfutils-0.155/libelf/elf_getarsym.c
|| n * w > index_size)
{
/* This index table cannot be right since it does not fit into
Index: elfutils-0.155/libelf/elf_getshdrstrndx.c
===================================================================
--- elfutils-0.155.orig/libelf/elf_getshdrstrndx.c 2009-06-13 22:31:35.000000000 +0000
+++ elfutils-0.155/libelf/elf_getshdrstrndx.c 2010-07-03 13:07:11.000000000 +0000
--- elfutils/libelf/elf_getshdrstrndx.c
+++ elfutils/libelf/elf_getshdrstrndx.c
@@ -104,10 +104,25 @@ elf_getshdrstrndx (elf, dst)
if (elf->map_address != NULL
&& elf->state.elf32.ehdr->e_ident[EI_DATA] == MY_ELFDATA
@@ -343,10 +323,8 @@ Index: elfutils-0.155/libelf/elf_getshdrstrndx.c
else
{
/* We avoid reading in all the section headers. Just read
Index: elfutils-0.155/libelf/elf_newscn.c
===================================================================
--- elfutils-0.155.orig/libelf/elf_newscn.c 2009-01-08 20:56:37.000000000 +0000
+++ elfutils-0.155/libelf/elf_newscn.c 2010-07-03 13:07:11.000000000 +0000
--- elfutils/libelf/elf_newscn.c
+++ elfutils/libelf/elf_newscn.c
@@ -83,10 +83,18 @@ elf_newscn (elf)
else
{
@@ -367,10 +345,8 @@ Index: elfutils-0.155/libelf/elf_newscn.c
newp = (Elf_ScnList *) calloc (sizeof (Elf_ScnList)
+ ((elf->state.elf.scnincr *= 2)
* sizeof (Elf_Scn)), 1);
Index: elfutils-0.155/libelf/gelf_getdyn.c
===================================================================
--- elfutils-0.155.orig/libelf/gelf_getdyn.c 2009-01-08 20:56:37.000000000 +0000
+++ elfutils-0.155/libelf/gelf_getdyn.c 2010-07-03 13:07:11.000000000 +0000
--- elfutils/libelf/gelf_getdyn.c
+++ elfutils/libelf/gelf_getdyn.c
@@ -1,5 +1,5 @@
/* Get information from dynamic table at the given index.
- Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
@@ -396,10 +372,8 @@ Index: elfutils-0.155/libelf/gelf_getdyn.c
{
__libelf_seterrno (ELF_E_INVALID_INDEX);
goto out;
Index: elfutils-0.155/libelf/gelf_getlib.c
===================================================================
--- elfutils-0.155.orig/libelf/gelf_getlib.c 2009-01-08 20:56:37.000000000 +0000
+++ elfutils-0.155/libelf/gelf_getlib.c 2010-07-03 13:07:11.000000000 +0000
--- elfutils/libelf/gelf_getlib.c
+++ elfutils/libelf/gelf_getlib.c
@@ -1,5 +1,5 @@
/* Get library from table at the given index.
- Copyright (C) 2004 Red Hat, Inc.
@@ -416,10 +390,8 @@ Index: elfutils-0.155/libelf/gelf_getlib.c
__libelf_seterrno (ELF_E_INVALID_INDEX);
else
{
Index: elfutils-0.155/libelf/gelf_getmove.c
===================================================================
--- elfutils-0.155.orig/libelf/gelf_getmove.c 2009-01-08 20:56:37.000000000 +0000
+++ elfutils-0.155/libelf/gelf_getmove.c 2010-07-03 13:07:11.000000000 +0000
--- elfutils/libelf/gelf_getmove.c
+++ elfutils/libelf/gelf_getmove.c
@@ -1,5 +1,5 @@
/* Get move structure at the given index.
- Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
@@ -436,10 +408,8 @@ Index: elfutils-0.155/libelf/gelf_getmove.c
{
__libelf_seterrno (ELF_E_INVALID_INDEX);
goto out;
Index: elfutils-0.155/libelf/gelf_getrela.c
===================================================================
--- elfutils-0.155.orig/libelf/gelf_getrela.c 2009-01-08 20:56:37.000000000 +0000
+++ elfutils-0.155/libelf/gelf_getrela.c 2010-07-03 13:07:11.000000000 +0000
--- elfutils/libelf/gelf_getrela.c
+++ elfutils/libelf/gelf_getrela.c
@@ -1,5 +1,5 @@
/* Get RELA relocation information at given index.
- Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
@@ -478,10 +448,8 @@ Index: elfutils-0.155/libelf/gelf_getrela.c
{
__libelf_seterrno (ELF_E_INVALID_INDEX);
result = NULL;
Index: elfutils-0.155/libelf/gelf_getrel.c
===================================================================
--- elfutils-0.155.orig/libelf/gelf_getrel.c 2009-01-08 20:56:37.000000000 +0000
+++ elfutils-0.155/libelf/gelf_getrel.c 2010-07-03 13:07:11.000000000 +0000
--- elfutils/libelf/gelf_getrel.c
+++ elfutils/libelf/gelf_getrel.c
@@ -1,5 +1,5 @@
/* Get REL relocation information at given index.
- Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
@@ -520,10 +488,8 @@ Index: elfutils-0.155/libelf/gelf_getrel.c
{
__libelf_seterrno (ELF_E_INVALID_INDEX);
result = NULL;
Index: elfutils-0.155/libelf/gelf_getsym.c
===================================================================
--- elfutils-0.155.orig/libelf/gelf_getsym.c 2009-01-08 20:56:37.000000000 +0000
+++ elfutils-0.155/libelf/gelf_getsym.c 2010-07-03 13:07:11.000000000 +0000
--- elfutils/libelf/gelf_getsym.c
+++ elfutils/libelf/gelf_getsym.c
@@ -1,5 +1,5 @@
/* Get symbol information from symbol table at the given index.
- Copyright (C) 1999, 2000, 2001, 2002 Red Hat, Inc.
@@ -549,10 +515,8 @@ Index: elfutils-0.155/libelf/gelf_getsym.c
{
__libelf_seterrno (ELF_E_INVALID_INDEX);
goto out;
Index: elfutils-0.155/libelf/gelf_getsyminfo.c
===================================================================
--- elfutils-0.155.orig/libelf/gelf_getsyminfo.c 2009-01-08 20:56:37.000000000 +0000
+++ elfutils-0.155/libelf/gelf_getsyminfo.c 2010-07-03 13:07:11.000000000 +0000
--- elfutils/libelf/gelf_getsyminfo.c
+++ elfutils/libelf/gelf_getsyminfo.c
@@ -1,5 +1,5 @@
/* Get additional symbol information from symbol table at the given index.
- Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
@@ -569,10 +533,8 @@ Index: elfutils-0.155/libelf/gelf_getsyminfo.c
{
__libelf_seterrno (ELF_E_INVALID_INDEX);
goto out;
Index: elfutils-0.155/libelf/gelf_getsymshndx.c
===================================================================
--- elfutils-0.155.orig/libelf/gelf_getsymshndx.c 2009-01-08 20:56:37.000000000 +0000
+++ elfutils-0.155/libelf/gelf_getsymshndx.c 2010-07-03 13:07:11.000000000 +0000
--- elfutils/libelf/gelf_getsymshndx.c
+++ elfutils/libelf/gelf_getsymshndx.c
@@ -1,6 +1,6 @@
/* Get symbol information and separate section index from symbol table
at the given index.
@@ -608,10 +570,8 @@ Index: elfutils-0.155/libelf/gelf_getsymshndx.c
{
__libelf_seterrno (ELF_E_INVALID_INDEX);
goto out;
Index: elfutils-0.155/libelf/gelf_getversym.c
===================================================================
--- elfutils-0.155.orig/libelf/gelf_getversym.c 2009-01-08 20:56:37.000000000 +0000
+++ elfutils-0.155/libelf/gelf_getversym.c 2010-07-03 13:07:11.000000000 +0000
--- elfutils/libelf/gelf_getversym.c
+++ elfutils/libelf/gelf_getversym.c
@@ -1,5 +1,5 @@
/* Get symbol version information at the given index.
- Copyright (C) 1999, 2000, 2001, 2002 Red Hat, Inc.
@@ -628,10 +588,8 @@ Index: elfutils-0.155/libelf/gelf_getversym.c
{
__libelf_seterrno (ELF_E_INVALID_INDEX);
result = NULL;
Index: elfutils-0.155/libelf/gelf_update_dyn.c
===================================================================
--- elfutils-0.155.orig/libelf/gelf_update_dyn.c 2009-01-08 20:56:37.000000000 +0000
+++ elfutils-0.155/libelf/gelf_update_dyn.c 2010-07-03 13:07:11.000000000 +0000
--- elfutils/libelf/gelf_update_dyn.c
+++ elfutils/libelf/gelf_update_dyn.c
@@ -1,5 +1,5 @@
/* Update information in dynamic table at the given index.
- Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
@@ -670,10 +628,8 @@ Index: elfutils-0.155/libelf/gelf_update_dyn.c
{
__libelf_seterrno (ELF_E_INVALID_INDEX);
goto out;
Index: elfutils-0.155/libelf/gelf_update_lib.c
===================================================================
--- elfutils-0.155.orig/libelf/gelf_update_lib.c 2009-01-08 20:56:37.000000000 +0000
+++ elfutils-0.155/libelf/gelf_update_lib.c 2010-07-03 13:07:11.000000000 +0000
--- elfutils/libelf/gelf_update_lib.c
+++ elfutils/libelf/gelf_update_lib.c
@@ -1,5 +1,5 @@
/* Update library in table at the given index.
- Copyright (C) 2004 Red Hat, Inc.
@@ -703,10 +659,8 @@ Index: elfutils-0.155/libelf/gelf_update_lib.c
__libelf_seterrno (ELF_E_INVALID_INDEX);
else
{
Index: elfutils-0.155/libelf/gelf_update_move.c
===================================================================
--- elfutils-0.155.orig/libelf/gelf_update_move.c 2009-01-08 20:56:37.000000000 +0000
+++ elfutils-0.155/libelf/gelf_update_move.c 2010-07-03 13:07:11.000000000 +0000
--- elfutils/libelf/gelf_update_move.c
+++ elfutils/libelf/gelf_update_move.c
@@ -1,5 +1,5 @@
/* Update move structure at the given index.
- Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
@@ -724,10 +678,8 @@ Index: elfutils-0.155/libelf/gelf_update_move.c
{
__libelf_seterrno (ELF_E_INVALID_INDEX);
return 0;
Index: elfutils-0.155/libelf/gelf_update_rela.c
===================================================================
--- elfutils-0.155.orig/libelf/gelf_update_rela.c 2009-01-08 20:56:37.000000000 +0000
+++ elfutils-0.155/libelf/gelf_update_rela.c 2010-07-03 13:07:11.000000000 +0000
--- elfutils/libelf/gelf_update_rela.c
+++ elfutils/libelf/gelf_update_rela.c
@@ -1,5 +1,5 @@
/* Update RELA relocation information at given index.
- Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
@@ -766,10 +718,8 @@ Index: elfutils-0.155/libelf/gelf_update_rela.c
{
__libelf_seterrno (ELF_E_INVALID_INDEX);
goto out;
Index: elfutils-0.155/libelf/gelf_update_rel.c
===================================================================
--- elfutils-0.155.orig/libelf/gelf_update_rel.c 2009-01-08 20:56:37.000000000 +0000
+++ elfutils-0.155/libelf/gelf_update_rel.c 2010-07-03 13:07:11.000000000 +0000
--- elfutils/libelf/gelf_update_rel.c
+++ elfutils/libelf/gelf_update_rel.c
@@ -1,5 +1,5 @@
/* Update REL relocation information at given index.
- Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
@@ -808,10 +758,8 @@ Index: elfutils-0.155/libelf/gelf_update_rel.c
{
__libelf_seterrno (ELF_E_INVALID_INDEX);
goto out;
Index: elfutils-0.155/libelf/gelf_update_sym.c
===================================================================
--- elfutils-0.155.orig/libelf/gelf_update_sym.c 2009-01-08 20:56:37.000000000 +0000
+++ elfutils-0.155/libelf/gelf_update_sym.c 2010-07-03 13:07:11.000000000 +0000
--- elfutils/libelf/gelf_update_sym.c
+++ elfutils/libelf/gelf_update_sym.c
@@ -1,5 +1,5 @@
/* Update symbol information in symbol table at the given index.
- Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
@@ -850,10 +798,8 @@ Index: elfutils-0.155/libelf/gelf_update_sym.c
{
__libelf_seterrno (ELF_E_INVALID_INDEX);
goto out;
Index: elfutils-0.155/libelf/gelf_update_syminfo.c
===================================================================
--- elfutils-0.155.orig/libelf/gelf_update_syminfo.c 2009-01-08 20:56:37.000000000 +0000
+++ elfutils-0.155/libelf/gelf_update_syminfo.c 2010-07-03 13:07:11.000000000 +0000
--- elfutils/libelf/gelf_update_syminfo.c
+++ elfutils/libelf/gelf_update_syminfo.c
@@ -1,5 +1,5 @@
/* Update additional symbol information in symbol table at the given index.
- Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
@@ -883,10 +829,8 @@ Index: elfutils-0.155/libelf/gelf_update_syminfo.c
{
__libelf_seterrno (ELF_E_INVALID_INDEX);
goto out;
Index: elfutils-0.155/libelf/gelf_update_symshndx.c
===================================================================
--- elfutils-0.155.orig/libelf/gelf_update_symshndx.c 2009-01-08 20:56:37.000000000 +0000
+++ elfutils-0.155/libelf/gelf_update_symshndx.c 2010-07-03 13:07:11.000000000 +0000
--- elfutils/libelf/gelf_update_symshndx.c
+++ elfutils/libelf/gelf_update_symshndx.c
@@ -1,6 +1,6 @@
/* Update symbol information and section index in symbol table at the
given index.
@@ -926,10 +870,8 @@ Index: elfutils-0.155/libelf/gelf_update_symshndx.c
{
__libelf_seterrno (ELF_E_INVALID_INDEX);
goto out;
Index: elfutils-0.155/libelf/gelf_update_versym.c
===================================================================
--- elfutils-0.155.orig/libelf/gelf_update_versym.c 2009-01-08 20:56:37.000000000 +0000
+++ elfutils-0.155/libelf/gelf_update_versym.c 2010-07-03 13:07:11.000000000 +0000
--- elfutils/libelf/gelf_update_versym.c
+++ elfutils/libelf/gelf_update_versym.c
@@ -1,5 +1,5 @@
/* Update symbol version information.
- Copyright (C) 2001, 2002 Red Hat, Inc.
@@ -947,11 +889,9 @@ Index: elfutils-0.155/libelf/gelf_update_versym.c
{
__libelf_seterrno (ELF_E_INVALID_INDEX);
return 0;
Index: elfutils-0.155/libelf/libelfP.h
===================================================================
--- elfutils-0.155.orig/libelf/libelfP.h 2010-01-12 16:57:54.000000000 +0000
+++ elfutils-0.155/libelf/libelfP.h 2010-07-03 13:07:11.000000000 +0000
@@ -608,4 +608,8 @@
--- elfutils/libelf/libelfP.h
+++ elfutils/libelf/libelfP.h
@@ -587,4 +587,8 @@ extern uint32_t __libelf_crc32 (uint32_t
/* Align offset to 4 bytes as needed for note name and descriptor data. */
#define NOTE_ALIGN(n) (((n) + 3) & -4U)
@@ -960,11 +900,9 @@ Index: elfutils-0.155/libelf/libelfP.h
+ unlikely ((data)->d_size / sizeof (type) <= (unsigned int) (ndx))
+
#endif /* libelfP.h */
Index: elfutils-0.155/src/ChangeLog
===================================================================
--- elfutils-0.155.orig/src/ChangeLog 2010-07-03 13:07:10.000000000 +0000
+++ elfutils-0.155/src/ChangeLog 2010-07-03 13:07:11.000000000 +0000
@@ -344,6 +344,12 @@
--- elfutils/src/ChangeLog
+++ elfutils/src/ChangeLog
@@ -702,6 +702,12 @@
* readelf.c (dwarf_attr_string): Grok DW_AT_GNU_odr_signature.
@@ -977,7 +915,7 @@ Index: elfutils-0.155/src/ChangeLog
2011-02-11 Roland McGrath <roland@redhat.com>
* elfcmp.c (verbose): New variable.
@@ -2056,6 +2062,16 @@
@@ -2414,6 +2420,16 @@
object symbols or symbols with unknown type.
(check_rel): Likewise.
@@ -994,7 +932,7 @@ Index: elfutils-0.155/src/ChangeLog
2005-06-08 Roland McGrath <roland@redhat.com>
* readelf.c (print_ops): Add consts.
@@ -2101,6 +2117,19 @@
@@ -2459,6 +2475,19 @@
* readelf.c (dwarf_tag_string): Add new tags.
@@ -1014,10 +952,8 @@ Index: elfutils-0.155/src/ChangeLog
2005-05-08 Roland McGrath <roland@redhat.com>
* strip.c (handle_elf): Don't translate hash and versym data formats,
Index: elfutils-0.155/src/elflint.c
===================================================================
--- elfutils-0.155.orig/src/elflint.c 2010-04-13 20:08:02.000000000 +0000
+++ elfutils-0.155/src/elflint.c 2010-07-03 13:07:11.000000000 +0000
--- elfutils/src/elflint.c
+++ elfutils/src/elflint.c
@@ -123,6 +123,10 @@ static uint32_t shstrndx;
/* Array to count references in section groups. */
static int *scnref;
@@ -1091,7 +1027,7 @@ Index: elfutils-0.155/src/elflint.c
}
if (sym->st_shndx == SHN_XINDEX)
@@ -1032,9 +1042,11 @@ is_rel_dyn (Ebl *ebl, const GElf_Ehdr *e
@@ -1040,9 +1050,11 @@ is_rel_dyn (Ebl *ebl, const GElf_Ehdr *e
{
GElf_Shdr rcshdr_mem;
const GElf_Shdr *rcshdr = gelf_getshdr (scn, &rcshdr_mem);
@@ -1105,7 +1041,7 @@ Index: elfutils-0.155/src/elflint.c
{
/* Found the dynamic section. Look through it. */
Elf_Data *d = elf_getdata (scn, NULL);
@@ -1044,7 +1056,9 @@ is_rel_dyn (Ebl *ebl, const GElf_Ehdr *e
@@ -1052,7 +1064,9 @@ is_rel_dyn (Ebl *ebl, const GElf_Ehdr *e
{
GElf_Dyn dyn_mem;
GElf_Dyn *dyn = gelf_getdyn (d, cnt, &dyn_mem);
@@ -1116,7 +1052,7 @@ Index: elfutils-0.155/src/elflint.c
if (dyn->d_tag == DT_RELCOUNT)
{
@@ -1058,7 +1072,9 @@ section [%2d] '%s': DT_RELCOUNT used for
@@ -1066,7 +1080,9 @@ section [%2d] '%s': DT_RELCOUNT used for
/* Does the number specified number of relative
relocations exceed the total number of
relocations? */
@@ -1127,7 +1063,7 @@ Index: elfutils-0.155/src/elflint.c
ERROR (gettext ("\
section [%2d] '%s': DT_RELCOUNT value %d too high for this section\n"),
idx, section_name (ebl, idx),
@@ -1218,7 +1234,8 @@ section [%2d] '%s': no relocations for m
@@ -1226,7 +1242,8 @@ section [%2d] '%s': no relocations for m
}
}
@@ -1137,7 +1073,7 @@ Index: elfutils-0.155/src/elflint.c
ERROR (gettext (reltype == ELF_T_RELA ? "\
section [%2d] '%s': section entry size does not match ElfXX_Rela\n" : "\
section [%2d] '%s': section entry size does not match ElfXX_Rel\n"),
@@ -1441,7 +1458,8 @@ check_rela (Ebl *ebl, GElf_Ehdr *ehdr, G
@@ -1449,7 +1466,8 @@ check_rela (Ebl *ebl, GElf_Ehdr *ehdr, G
Elf_Data *symdata = elf_getdata (symscn, NULL);
enum load_state state = state_undecided;
@@ -1147,7 +1083,7 @@ Index: elfutils-0.155/src/elflint.c
{
GElf_Rela rela_mem;
GElf_Rela *rela = gelf_getrela (data, cnt, &rela_mem);
@@ -1491,7 +1509,8 @@ check_rel (Ebl *ebl, GElf_Ehdr *ehdr, GE
@@ -1499,7 +1517,8 @@ check_rel (Ebl *ebl, GElf_Ehdr *ehdr, GE
Elf_Data *symdata = elf_getdata (symscn, NULL);
enum load_state state = state_undecided;
@@ -1157,7 +1093,7 @@ Index: elfutils-0.155/src/elflint.c
{
GElf_Rel rel_mem;
GElf_Rel *rel = gelf_getrel (data, cnt, &rel_mem);
@@ -1590,7 +1609,8 @@ section [%2d] '%s': referenced as string
@@ -1598,7 +1617,8 @@ section [%2d] '%s': referenced as string
shdr->sh_link, section_name (ebl, shdr->sh_link),
idx, section_name (ebl, idx));
@@ -1167,7 +1103,7 @@ Index: elfutils-0.155/src/elflint.c
ERROR (gettext ("\
section [%2d] '%s': section entry size does not match ElfXX_Dyn\n"),
idx, section_name (ebl, idx));
@@ -1600,7 +1620,7 @@ section [%2d] '%s': section entry size d
@@ -1608,7 +1628,7 @@ section [%2d] '%s': section entry size d
idx, section_name (ebl, idx));
bool non_null_warned = false;
@@ -1176,7 +1112,7 @@ Index: elfutils-0.155/src/elflint.c
{
GElf_Dyn dyn_mem;
GElf_Dyn *dyn = gelf_getdyn (data, cnt, &dyn_mem);
@@ -1872,6 +1892,8 @@ section [%2d] '%s': entry size does not
@@ -1880,6 +1900,8 @@ section [%2d] '%s': entry size does not
idx, section_name (ebl, idx));
if (symshdr != NULL
@@ -1185,7 +1121,7 @@ Index: elfutils-0.155/src/elflint.c
&& (shdr->sh_size / shdr->sh_entsize
< symshdr->sh_size / symshdr->sh_entsize))
ERROR (gettext ("\
@@ -1898,6 +1920,12 @@ section [%2d] '%s': extended section ind
@@ -1906,6 +1928,12 @@ section [%2d] '%s': extended section ind
}
Elf_Data *data = elf_getdata (elf_getscn (ebl->elf, idx), NULL);
@@ -1198,7 +1134,7 @@ Index: elfutils-0.155/src/elflint.c
if (*((Elf32_Word *) data->d_buf) != 0)
ERROR (gettext ("symbol 0 should have zero extended section index\n"));
@@ -1940,7 +1968,7 @@ section [%2d] '%s': hash table section i
@@ -1948,7 +1976,7 @@ section [%2d] '%s': hash table section i
size_t maxidx = nchain;
@@ -1207,7 +1143,7 @@ Index: elfutils-0.155/src/elflint.c
{
size_t symsize = symshdr->sh_size / symshdr->sh_entsize;
@@ -1951,18 +1979,28 @@ section [%2d] '%s': hash table section i
@@ -1959,18 +1987,28 @@ section [%2d] '%s': hash table section i
maxidx = symsize;
}
@@ -1238,7 +1174,7 @@ Index: elfutils-0.155/src/elflint.c
}
@@ -1992,18 +2030,28 @@ section [%2d] '%s': hash table section i
@@ -2000,18 +2038,28 @@ section [%2d] '%s': hash table section i
maxidx = symsize;
}
@@ -1270,7 +1206,7 @@ Index: elfutils-0.155/src/elflint.c
}
@@ -2028,7 +2076,7 @@ section [%2d] '%s': bitmask size not pow
@@ -2036,7 +2084,7 @@ section [%2d] '%s': bitmask size not pow
if (shdr->sh_size < (4 + bitmask_words + nbuckets) * sizeof (Elf32_Word))
{
ERROR (gettext ("\
@@ -1279,7 +1215,7 @@ Index: elfutils-0.155/src/elflint.c
idx, section_name (ebl, idx), (long int) shdr->sh_size,
(long int) ((4 + bitmask_words + nbuckets) * sizeof (Elf32_Word)));
return;
@@ -2700,8 +2748,9 @@ section [%2d] '%s' refers in sh_link to
@@ -2708,8 +2756,9 @@ section [%2d] '%s' refers in sh_link to
/* The number of elements in the version symbol table must be the
same as the number of symbols. */
@@ -1291,11 +1227,9 @@ Index: elfutils-0.155/src/elflint.c
ERROR (gettext ("\
section [%2d] '%s' has different number of entries than symbol table [%2d] '%s'\n"),
idx, section_name (ebl, idx),
Index: elfutils-0.155/src/readelf.c
===================================================================
--- elfutils-0.155.orig/src/readelf.c 2010-07-03 13:07:10.000000000 +0000
+++ elfutils-0.155/src/readelf.c 2010-07-03 13:07:11.000000000 +0000
@@ -1189,6 +1189,8 @@ handle_scngrp (Ebl *ebl, Elf_Scn *scn, G
--- elfutils/src/readelf.c
+++ elfutils/src/readelf.c
@@ -1364,6 +1364,8 @@ handle_scngrp (Ebl *ebl, Elf_Scn *scn, G
Elf32_Word *grpref = (Elf32_Word *) data->d_buf;
GElf_Sym sym_mem;
@@ -1304,7 +1238,7 @@ Index: elfutils-0.155/src/readelf.c
printf ((grpref[0] & GRP_COMDAT)
? ngettext ("\
\nCOMDAT section group [%2zu] '%s' with signature '%s' contains %zu entry:\n",
@@ -1201,8 +1203,8 @@ handle_scngrp (Ebl *ebl, Elf_Scn *scn, G
@@ -1376,8 +1378,8 @@ handle_scngrp (Ebl *ebl, Elf_Scn *scn, G
data->d_size / sizeof (Elf32_Word) - 1),
elf_ndxscn (scn),
elf_strptr (ebl->elf, shstrndx, shdr->sh_name),
@@ -1315,7 +1249,7 @@ Index: elfutils-0.155/src/readelf.c
?: gettext ("<INVALID SYMBOL>"),
data->d_size / sizeof (Elf32_Word) - 1);
@@ -1353,10 +1355,12 @@ static void
@@ -1528,10 +1530,12 @@ static void
handle_dynamic (Ebl *ebl, Elf_Scn *scn, GElf_Shdr *shdr)
{
int class = gelf_getclass (ebl->elf);
@@ -1329,7 +1263,7 @@ Index: elfutils-0.155/src/readelf.c
/* Get the data of the section. */
data = elf_getdata (scn, NULL);
@@ -1368,21 +1372,26 @@ handle_dynamic (Ebl *ebl, Elf_Scn *scn,
@@ -1543,21 +1547,26 @@ handle_dynamic (Ebl *ebl, Elf_Scn *scn,
error (EXIT_FAILURE, 0,
gettext ("cannot get section header string table index"));
@@ -1362,7 +1296,7 @@ Index: elfutils-0.155/src/readelf.c
{
GElf_Dyn dynmem;
GElf_Dyn *dyn = gelf_getdyn (data, cnt, &dynmem);
@@ -1531,7 +1540,8 @@ static void
@@ -1706,7 +1715,8 @@ static void
handle_relocs_rel (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn, GElf_Shdr *shdr)
{
int class = gelf_getclass (ebl->elf);
@@ -1372,7 +1306,7 @@ Index: elfutils-0.155/src/readelf.c
/* Get the data of the section. */
Elf_Data *data = elf_getdata (scn, NULL);
@@ -1717,7 +1727,8 @@ static void
@@ -1892,7 +1902,8 @@ static void
handle_relocs_rela (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn, GElf_Shdr *shdr)
{
int class = gelf_getclass (ebl->elf);
@@ -1382,7 +1316,7 @@ Index: elfutils-0.155/src/readelf.c
/* Get the data of the section. */
Elf_Data *data = elf_getdata (scn, NULL);
@@ -1964,6 +1975,13 @@ handle_symtab (Ebl *ebl, Elf_Scn *scn, G
@@ -2139,6 +2150,13 @@ handle_symtab (Ebl *ebl, Elf_Scn *scn, G
error (EXIT_FAILURE, 0,
gettext ("cannot get section header string table index"));
@@ -1396,7 +1330,7 @@ Index: elfutils-0.155/src/readelf.c
/* Now we can compute the number of entries in the section. */
unsigned int nsyms = data->d_size / (class == ELFCLASS32
? sizeof (Elf32_Sym)
@@ -1974,15 +1992,12 @@ handle_symtab (Ebl *ebl, Elf_Scn *scn, G
@@ -2149,15 +2167,12 @@ handle_symtab (Ebl *ebl, Elf_Scn *scn, G
nsyms),
(unsigned int) elf_ndxscn (scn),
elf_strptr (ebl->elf, shstrndx, shdr->sh_name), nsyms);
@@ -1413,7 +1347,7 @@ Index: elfutils-0.155/src/readelf.c
fputs_unlocked (class == ELFCLASS32
? gettext ("\
@@ -2218,7 +2233,13 @@ handle_verneed (Ebl *ebl, Elf_Scn *scn,
@@ -2393,7 +2408,13 @@ handle_verneed (Ebl *ebl, Elf_Scn *scn,
error (EXIT_FAILURE, 0,
gettext ("cannot get section header string table index"));
@@ -1428,7 +1362,7 @@ Index: elfutils-0.155/src/readelf.c
printf (ngettext ("\
\nVersion needs section [%2u] '%s' contains %d entry:\n Addr: %#0*" PRIx64 " Offset: %#08" PRIx64 " Link to section: [%2u] '%s'\n",
"\
@@ -2229,9 +2250,7 @@ handle_verneed (Ebl *ebl, Elf_Scn *scn,
@@ -2404,9 +2425,7 @@ handle_verneed (Ebl *ebl, Elf_Scn *scn,
class == ELFCLASS32 ? 10 : 18, shdr->sh_addr,
shdr->sh_offset,
(unsigned int) shdr->sh_link,
@@ -1439,7 +1373,7 @@ Index: elfutils-0.155/src/readelf.c
unsigned int offset = 0;
for (int cnt = shdr->sh_info; --cnt >= 0; )
@@ -2284,8 +2303,14 @@ handle_verdef (Ebl *ebl, Elf_Scn *scn, G
@@ -2459,8 +2478,14 @@ handle_verdef (Ebl *ebl, Elf_Scn *scn, G
error (EXIT_FAILURE, 0,
gettext ("cannot get section header string table index"));
@@ -1455,7 +1389,7 @@ Index: elfutils-0.155/src/readelf.c
printf (ngettext ("\
\nVersion definition section [%2u] '%s' contains %d entry:\n Addr: %#0*" PRIx64 " Offset: %#08" PRIx64 " Link to section: [%2u] '%s'\n",
"\
@@ -2297,9 +2322,7 @@ handle_verdef (Ebl *ebl, Elf_Scn *scn, G
@@ -2472,9 +2497,7 @@ handle_verdef (Ebl *ebl, Elf_Scn *scn, G
class == ELFCLASS32 ? 10 : 18, shdr->sh_addr,
shdr->sh_offset,
(unsigned int) shdr->sh_link,
@@ -1466,7 +1400,7 @@ Index: elfutils-0.155/src/readelf.c
unsigned int offset = 0;
for (int cnt = shdr->sh_info; --cnt >= 0; )
@@ -2561,25 +2584,30 @@ handle_versym (Ebl *ebl, Elf_Scn *scn, G
@@ -2736,25 +2759,30 @@ handle_versym (Ebl *ebl, Elf_Scn *scn, G
filename = NULL;
}
@@ -1504,7 +1438,7 @@ Index: elfutils-0.155/src/readelf.c
{
if (cnt % 2 == 0)
printf ("\n %4d:", cnt);
@@ -2628,7 +2656,17 @@ print_hash_info (Ebl *ebl, Elf_Scn *scn,
@@ -2803,7 +2831,17 @@ print_hash_info (Ebl *ebl, Elf_Scn *scn,
for (Elf32_Word cnt = 0; cnt < nbucket; ++cnt)
++counts[lengths[cnt]];
@@ -1523,7 +1457,7 @@ Index: elfutils-0.155/src/readelf.c
printf (ngettext ("\
\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",
"\
@@ -2641,9 +2679,7 @@ print_hash_info (Ebl *ebl, Elf_Scn *scn,
@@ -2816,9 +2854,7 @@ print_hash_info (Ebl *ebl, Elf_Scn *scn,
shdr->sh_addr,
shdr->sh_offset,
(unsigned int) shdr->sh_link,
@@ -1534,7 +1468,7 @@ Index: elfutils-0.155/src/readelf.c
if (extrastr != NULL)
fputs (extrastr, stdout);
@@ -2903,7 +2939,8 @@ print_liblist (Ebl *ebl)
@@ -3078,7 +3114,8 @@ print_liblist (Ebl *ebl)
if (shdr != NULL && shdr->sh_type == SHT_GNU_LIBLIST)
{
@@ -1544,7 +1478,7 @@ Index: elfutils-0.155/src/readelf.c
printf (ngettext ("\
\nLibrary list section [%2zu] '%s' at offset %#0" PRIx64 " contains %d entry:\n",
"\
@@ -4164,6 +4201,16 @@ print_debug_aranges_section (Dwfl_Module
@@ -4398,6 +4435,16 @@ print_decoded_aranges_section (Ebl *ebl,
return;
}
@@ -1561,11 +1495,9 @@ Index: elfutils-0.155/src/readelf.c
printf (ngettext ("\
\nDWARF section [%2zu] '%s' at offset %#" PRIx64 " contains %zu entry:\n",
"\
Index: elfutils-0.155/src/strip.c
===================================================================
--- elfutils-0.155.orig/src/strip.c 2010-07-03 13:07:10.000000000 +0000
+++ elfutils-0.155/src/strip.c 2010-07-03 13:07:11.000000000 +0000
@@ -564,6 +564,11 @@ handle_elf (int fd, Elf *elf, const char
--- elfutils/src/strip.c
+++ elfutils/src/strip.c
@@ -565,6 +565,11 @@ handle_elf (int fd, Elf *elf, const char
goto fail_close;
}
@@ -1577,7 +1509,7 @@ Index: elfutils-0.155/src/strip.c
/* Storage for section information. We leave room for two more
entries since we unconditionally create a section header string
table. Maybe some weird tool created an ELF file without one.
@@ -585,7 +590,7 @@ handle_elf (int fd, Elf *elf, const char
@@ -586,7 +591,7 @@ handle_elf (int fd, Elf *elf, const char
{
/* This should always be true (i.e., there should not be any
holes in the numbering). */
@@ -1586,7 +1518,7 @@ Index: elfutils-0.155/src/strip.c
shdr_info[cnt].scn = scn;
@@ -598,6 +603,7 @@ handle_elf (int fd, Elf *elf, const char
@@ -599,6 +604,7 @@ handle_elf (int fd, Elf *elf, const char
shdr_info[cnt].shdr.sh_name);
if (shdr_info[cnt].name == NULL)
{
@@ -1594,7 +1526,7 @@ Index: elfutils-0.155/src/strip.c
error (0, 0, gettext ("illformed file '%s'"), fname);
goto fail_close;
}
@@ -607,6 +613,8 @@ handle_elf (int fd, Elf *elf, const char
@@ -608,6 +614,8 @@ handle_elf (int fd, Elf *elf, const char
/* Remember the shdr.sh_link value. */
shdr_info[cnt].old_sh_link = shdr_info[cnt].shdr.sh_link;
@@ -1603,7 +1535,7 @@ Index: elfutils-0.155/src/strip.c
/* Sections in files other than relocatable object files which
are not loaded can be freely moved by us. In relocatable
@@ -619,7 +627,7 @@ handle_elf (int fd, Elf *elf, const char
@@ -620,7 +628,7 @@ handle_elf (int fd, Elf *elf, const char
appropriate reference. */
if (unlikely (shdr_info[cnt].shdr.sh_type == SHT_SYMTAB_SHNDX))
{
@@ -1612,7 +1544,7 @@ Index: elfutils-0.155/src/strip.c
shdr_info[shdr_info[cnt].shdr.sh_link].symtab_idx = cnt;
}
else if (unlikely (shdr_info[cnt].shdr.sh_type == SHT_GROUP))
@@ -636,7 +644,12 @@ handle_elf (int fd, Elf *elf, const char
@@ -637,7 +645,12 @@ handle_elf (int fd, Elf *elf, const char
for (inner = 1;
inner < shdr_info[cnt].data->d_size / sizeof (Elf32_Word);
++inner)
@@ -1625,7 +1557,7 @@ Index: elfutils-0.155/src/strip.c
if (inner == 1 || (inner == 2 && (grpref[0] & GRP_COMDAT) == 0))
/* If the section group contains only one element and this
@@ -647,7 +660,7 @@ handle_elf (int fd, Elf *elf, const char
@@ -648,7 +661,7 @@ handle_elf (int fd, Elf *elf, const char
}
else if (unlikely (shdr_info[cnt].shdr.sh_type == SHT_GNU_versym))
{
@@ -1634,7 +1566,7 @@ Index: elfutils-0.155/src/strip.c
shdr_info[shdr_info[cnt].shdr.sh_link].version_idx = cnt;
}
@@ -655,7 +668,7 @@ handle_elf (int fd, Elf *elf, const char
@@ -656,7 +669,7 @@ handle_elf (int fd, Elf *elf, const char
discarded right away. */
if ((shdr_info[cnt].shdr.sh_flags & SHF_GROUP) != 0)
{
@@ -1643,7 +1575,7 @@ Index: elfutils-0.155/src/strip.c
if (shdr_info[shdr_info[cnt].group_idx].idx == 0)
{
@@ -731,10 +744,14 @@ handle_elf (int fd, Elf *elf, const char
@@ -732,10 +745,14 @@ handle_elf (int fd, Elf *elf, const char
{
/* If a relocation section is marked as being removed make
sure the section it is relocating is removed, too. */
@@ -1661,7 +1593,7 @@ Index: elfutils-0.155/src/strip.c
/* If a group section is marked as being removed make
sure all the sections it contains are being removed, too. */
@@ -778,7 +795,7 @@ handle_elf (int fd, Elf *elf, const char
@@ -779,7 +796,7 @@ handle_elf (int fd, Elf *elf, const char
if (shdr_info[cnt].symtab_idx != 0
&& shdr_info[shdr_info[cnt].symtab_idx].data == NULL)
{
@@ -1670,7 +1602,7 @@ Index: elfutils-0.155/src/strip.c
shdr_info[shdr_info[cnt].symtab_idx].data
= elf_getdata (shdr_info[shdr_info[cnt].symtab_idx].scn,
@@ -818,6 +835,9 @@ handle_elf (int fd, Elf *elf, const char
@@ -819,6 +836,9 @@ handle_elf (int fd, Elf *elf, const char
else if (scnidx == SHN_XINDEX)
scnidx = xndx;
@@ -1680,7 +1612,7 @@ Index: elfutils-0.155/src/strip.c
if (shdr_info[scnidx].idx == 0)
/* This symbol table has a real symbol in
a discarded section. So preserve the
@@ -848,12 +868,16 @@ handle_elf (int fd, Elf *elf, const char
@@ -849,12 +869,16 @@ handle_elf (int fd, Elf *elf, const char
}
/* Handle references through sh_info. */
@@ -1699,7 +1631,7 @@ Index: elfutils-0.155/src/strip.c
/* Mark the section as investigated. */
shdr_info[cnt].idx = 2;
@@ -994,7 +1018,7 @@ handle_elf (int fd, Elf *elf, const char
@@ -995,7 +1019,7 @@ handle_elf (int fd, Elf *elf, const char
error (EXIT_FAILURE, 0, gettext ("while generating output file: %s"),
elf_errmsg (-1));
@@ -1708,7 +1640,7 @@ Index: elfutils-0.155/src/strip.c
/* Add this name to the section header string table. */
shdr_info[cnt].se = ebl_strtabadd (shst, shdr_info[cnt].name, 0);
@@ -1031,7 +1055,7 @@ handle_elf (int fd, Elf *elf, const char
@@ -1032,7 +1056,7 @@ handle_elf (int fd, Elf *elf, const char
error (EXIT_FAILURE, 0,
gettext ("while create section header section: %s"),
elf_errmsg (-1));
@@ -1717,7 +1649,7 @@ Index: elfutils-0.155/src/strip.c
shdr_info[cnt].data = elf_newdata (shdr_info[cnt].newscn);
if (shdr_info[cnt].data == NULL)
@@ -1087,7 +1111,7 @@ handle_elf (int fd, Elf *elf, const char
@@ -1089,7 +1113,7 @@ handle_elf (int fd, Elf *elf, const char
error (EXIT_FAILURE, 0,
gettext ("while create section header section: %s"),
elf_errmsg (-1));
@@ -1726,7 +1658,7 @@ Index: elfutils-0.155/src/strip.c
/* Finalize the string table and fill in the correct indices in the
section headers. */
@@ -1177,20 +1201,20 @@ handle_elf (int fd, Elf *elf, const char
@@ -1179,20 +1203,20 @@ handle_elf (int fd, Elf *elf, const char
shndxdata = elf_getdata (shdr_info[shdr_info[cnt].symtab_idx].scn,
NULL);
@@ -1750,7 +1682,7 @@ Index: elfutils-0.155/src/strip.c
>= shdr_info[cnt].data->d_size / elsize);
}
@@ -1245,7 +1269,7 @@ handle_elf (int fd, Elf *elf, const char
@@ -1247,7 +1271,7 @@ handle_elf (int fd, Elf *elf, const char
sec = shdr_info[sym->st_shndx].idx;
else
{
@@ -1759,7 +1691,7 @@ Index: elfutils-0.155/src/strip.c
sec = shdr_info[xshndx].idx;
}
@@ -1266,7 +1290,7 @@ handle_elf (int fd, Elf *elf, const char
@@ -1268,7 +1292,7 @@ handle_elf (int fd, Elf *elf, const char
nxshndx = sec;
}
@@ -1768,7 +1700,7 @@ Index: elfutils-0.155/src/strip.c
if ((inner != destidx || nshndx != sym->st_shndx
|| (shndxdata != NULL && nxshndx != xshndx))
@@ -1293,9 +1317,11 @@ handle_elf (int fd, Elf *elf, const char
@@ -1295,9 +1319,11 @@ handle_elf (int fd, Elf *elf, const char
{
size_t sidx = (sym->st_shndx != SHN_XINDEX
? sym->st_shndx : xshndx);
@@ -1783,7 +1715,7 @@ Index: elfutils-0.155/src/strip.c
}
}
@@ -1483,11 +1509,11 @@ handle_elf (int fd, Elf *elf, const char
@@ -1485,11 +1511,11 @@ handle_elf (int fd, Elf *elf, const char
{
GElf_Sym sym_mem;
GElf_Sym *sym = gelf_getsym (symd, inner, &sym_mem);
@@ -1797,7 +1729,7 @@ Index: elfutils-0.155/src/strip.c
size_t hidx = elf_hash (name) % nbucket;
if (bucket[hidx] == 0)
@@ -1506,8 +1532,8 @@ handle_elf (int fd, Elf *elf, const char
@@ -1508,8 +1534,8 @@ handle_elf (int fd, Elf *elf, const char
else
{
/* Alpha and S390 64-bit use 64-bit SHT_HASH entries. */
@@ -1808,7 +1740,7 @@ Index: elfutils-0.155/src/strip.c
Elf64_Xword *bucket = (Elf64_Xword *) hashd->d_buf;
@@ -1537,11 +1563,11 @@ handle_elf (int fd, Elf *elf, const char
@@ -1539,11 +1565,11 @@ handle_elf (int fd, Elf *elf, const char
{
GElf_Sym sym_mem;
GElf_Sym *sym = gelf_getsym (symd, inner, &sym_mem);

View File

@@ -0,0 +1,40 @@
From: Kurt Roeckx <kurt@roeckx.be>
Subject: Use %m[ instead of %a[ in scanf()
%a was a gnu extention, but C99 made this a float. So it got
changed to %m (supported by glibc 2.7), but %a[ and %as are
still supported by glibc. The portability branch changed this
from %m to %a again since that's supported by more versions of
glibc. However gcc gives a warning about this using -Wformat
and we have a new enough libc to use %m.
Index: elfutils-0.153/src/addr2line.c
===================================================================
--- elfutils-0.153.orig/src/addr2line.c 2012-02-24 22:29:50.000000000 +0000
+++ elfutils-0.153/src/addr2line.c 2012-02-24 22:29:52.000000000 +0000
@@ -455,10 +455,10 @@
bool parsed = false;
int i, j;
char *name = NULL;
- if (sscanf (string, "(%a[^)])%" PRIiMAX "%n", &name, &addr, &i) == 2
+ if (sscanf (string, "(%m[^)])%" PRIiMAX "%n", &name, &addr, &i) == 2
&& string[i] == '\0')
parsed = adjust_to_section (name, &addr, dwfl);
- switch (sscanf (string, "%a[^-+]%n%" PRIiMAX "%n", &name, &i, &addr, &j))
+ switch (sscanf (string, "%m[^-+]%n%" PRIiMAX "%n", &name, &i, &addr, &j))
{
default:
break;
Index: elfutils-0.153/tests/line2addr.c
===================================================================
--- elfutils-0.153.orig/tests/line2addr.c 2012-02-24 22:29:50.000000000 +0000
+++ elfutils-0.153/tests/line2addr.c 2012-02-24 22:29:52.000000000 +0000
@@ -132,7 +132,7 @@
{
struct args a = { .arg = argv[cnt] };
- switch (sscanf (a.arg, "%a[^:]:%d", &a.file, &a.line))
+ switch (sscanf (a.arg, "%m[^:]:%d", &a.file, &a.line))
{
default:
case 0:

View File

@@ -0,0 +1,39 @@
On many architectures this test fails because binaries/libs produced by
binutils don't pass elflint. However elfutils shouldn't FTBFS because of this.
So we run the tests on all archs to see what breaks, but if it breaks we ignore
the result (exitcode 77 means: this test was skipped).
Index: elfutils-0.156/tests/run-elflint-self.sh
===================================================================
--- elfutils-0.156.orig/tests/run-elflint-self.sh 2013-07-28 14:35:36.000000000 +0200
+++ elfutils-0.156/tests/run-elflint-self.sh 2013-07-28 14:36:10.000000000 +0200
@@ -18,4 +18,4 @@
. $srcdir/test-subr.sh
-testrun_on_self ${abs_top_builddir}/src/elflint --quiet --gnu-ld
+testrun_on_self_skip ${abs_top_builddir}/src/elflint --quiet --gnu-ld
Index: elfutils-0.156/tests/test-subr.sh
===================================================================
--- elfutils-0.156.orig/tests/test-subr.sh 2013-07-28 14:35:36.000000000 +0200
+++ elfutils-0.156/tests/test-subr.sh 2013-07-28 14:35:36.000000000 +0200
@@ -149,3 +149,18 @@
# Only exit if something failed
if test $exit_status != 0; then exit $exit_status; fi
}
+
+# Same as testrun_on_self(), but skip on failure.
+testrun_on_self_skip()
+{
+ exit_status=0
+
+ for file in $self_test_files; do
+ testrun $* $file \
+ || { echo "*** failure in $* $file"; exit_status=77; }
+ done
+
+ # Only exit if something failed
+ if test $exit_status != 0; then exit $exit_status; fi
+}
+

View File

@@ -0,0 +1,256 @@
From 02cefdaa6429e620d6457fdb3ad9934f194c5a93 Mon Sep 17 00:00:00 2001
From: Kurt Roeckx <kurt@roeckx.be>
Date: Tue, 22 Apr 2014 21:46:22 +0200
Subject: [PATCH] Unwinding is only supported on Linux
Index: elfutils-0.158/backends/i386_initreg.c
===================================================================
--- elfutils-0.158.orig/backends/i386_initreg.c 2014-05-01 17:11:18.870616302 +0000
+++ elfutils-0.158/backends/i386_initreg.c 2014-05-01 17:11:18.866616384 +0000
@@ -44,7 +44,7 @@
ebl_tid_registers_t *setfunc __attribute__ ((unused)),
void *arg __attribute__ ((unused)))
{
-#if !defined __i386__ && !defined __x86_64__
+#if (!defined __i386__ && !defined __x86_64__) || !defined(__linux__)
return false;
#else /* __i386__ || __x86_64__ */
struct user_regs_struct user_regs;
Index: elfutils-0.158/backends/x86_64_initreg.c
===================================================================
--- elfutils-0.158.orig/backends/x86_64_initreg.c 2014-05-01 17:11:18.870616302 +0000
+++ elfutils-0.158/backends/x86_64_initreg.c 2014-05-01 17:11:18.866616384 +0000
@@ -44,7 +44,7 @@
ebl_tid_registers_t *setfunc __attribute__ ((unused)),
void *arg __attribute__ ((unused)))
{
-#ifndef __x86_64__
+#if !defined(__x86_64__) || !defined(__linux__)
return false;
#else /* __x86_64__ */
struct user_regs_struct user_regs;
Index: elfutils-0.158/libdwfl/linux-pid-attach.c
===================================================================
--- elfutils-0.158.orig/libdwfl/linux-pid-attach.c 2014-05-01 17:11:18.870616302 +0000
+++ elfutils-0.158/libdwfl/linux-pid-attach.c 2014-05-01 17:12:47.980766442 +0000
@@ -37,6 +37,8 @@
# define MAX(a, b) ((a) > (b) ? (a) : (b))
#endif
+#ifdef __linux__
+
struct pid_arg
{
DIR *dir;
@@ -358,3 +360,87 @@
return 0;
}
INTDEF (dwfl_linux_proc_attach)
+
+#else /* __linux__ */
+
+static pid_t
+pid_next_thread (Dwfl *dwfl __attribute__ ((unused)),
+ void *dwfl_arg __attribute__ ((unused)),
+ void **thread_argp __attribute__ ((unused)))
+{
+ errno = ENOSYS;
+ __libdwfl_seterrno (DWFL_E_ERRNO);
+ return -1;
+}
+
+static bool
+pid_getthread (Dwfl *dwfl __attribute__ ((unused)),
+ pid_t tid __attribute__ ((unused)),
+ void *dwfl_arg __attribute__ ((unused)),
+ void **thread_argp __attribute__ ((unused)))
+{
+ errno = ENOSYS;
+ __libdwfl_seterrno (DWFL_E_ERRNO);
+ return false;
+}
+
+static bool
+pid_memory_read (Dwfl *dwfl __attribute__ ((unused)),
+ Dwarf_Addr addr __attribute__ ((unused)),
+ Dwarf_Word *result __attribute__ ((unused)),
+ void *arg __attribute__ ((unused)))
+{
+ errno = ENOSYS;
+ __libdwfl_seterrno (DWFL_E_ERRNO);
+ return false;
+}
+
+static bool
+pid_set_initial_registers (Dwfl_Thread *thread __attribute__ ((unused)),
+ void *thread_arg __attribute__ ((unused)))
+{
+ errno = ENOSYS;
+ __libdwfl_seterrno (DWFL_E_ERRNO);
+ return false;
+}
+
+static void
+pid_detach (Dwfl *dwfl __attribute__ ((unused)),
+ void *dwfl_arg __attribute__ ((unused)))
+{
+}
+
+static void
+pid_thread_detach (Dwfl_Thread *thread __attribute__ ((unused)),
+ void *thread_arg __attribute__ ((unused)))
+{
+}
+
+static const Dwfl_Thread_Callbacks pid_thread_callbacks =
+{
+ pid_next_thread,
+ pid_getthread,
+ pid_memory_read,
+ pid_set_initial_registers,
+ pid_detach,
+ pid_thread_detach,
+};
+
+int
+dwfl_linux_proc_attach (Dwfl *dwfl __attribute__ ((unused)),
+ pid_t pid __attribute__ ((unused)),
+ bool assume_ptrace_stopped __attribute__ ((unused)))
+{
+ return ENOSYS;
+}
+INTDEF (dwfl_linux_proc_attach)
+
+struct __libdwfl_pid_arg *
+internal_function
+__libdwfl_get_pid_arg (Dwfl *dwfl __attribute__ ((unused)))
+{
+ return NULL;
+}
+
+#endif /* ! __linux __ */
+
Index: elfutils-0.158/tests/backtrace-child.c
===================================================================
--- elfutils-0.158.orig/tests/backtrace-child.c 2014-05-01 17:11:18.870616302 +0000
+++ elfutils-0.158/tests/backtrace-child.c 2014-05-01 17:11:18.866616384 +0000
@@ -79,6 +79,18 @@
#include <stdio.h>
#include <unistd.h>
+#ifndef __linux__
+
+int
+main (int argc __attribute__ ((unused)), char **argv)
+{
+ fprintf (stderr, "%s: Unwinding not supported for this architecture\n",
+ argv[0]);
+ return 77;
+}
+
+#else /* __linux__ */
+
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
#define NOINLINE_NOCLONE __attribute__ ((noinline, noclone))
#else
@@ -221,3 +233,6 @@
/* Not reached. */
abort ();
}
+
+#endif /* ! __linux__ */
+
Index: elfutils-0.158/tests/backtrace-data.c
===================================================================
--- elfutils-0.158.orig/tests/backtrace-data.c 2014-05-01 17:11:18.870616302 +0000
+++ elfutils-0.158/tests/backtrace-data.c 2014-05-01 17:11:18.866616384 +0000
@@ -40,7 +40,7 @@
#include <string.h>
#include ELFUTILS_HEADER(dwfl)
-#ifndef __x86_64__
+#if !defined(__x86_64__) || !defined(__linux__)
int
main (int argc __attribute__ ((unused)), char **argv)
@@ -50,7 +50,7 @@
return 77;
}
-#else /* __x86_64__ */
+#else /* __x86_64__ && __linux__ */
/* The only arch specific code is set_initial_registers. */
Index: elfutils-0.158/tests/backtrace-dwarf.c
===================================================================
--- elfutils-0.158.orig/tests/backtrace-dwarf.c 2014-05-01 17:11:18.870616302 +0000
+++ elfutils-0.158/tests/backtrace-dwarf.c 2014-05-01 17:11:18.866616384 +0000
@@ -25,6 +25,18 @@
#include <sys/ptrace.h>
#include ELFUTILS_HEADER(dwfl)
+#ifndef __linux__
+
+int
+main (int argc __attribute__ ((unused)), char **argv)
+{
+ fprintf (stderr, "%s: Unwinding not supported for this architecture\n",
+ argv[0]);
+ return 77;
+}
+
+#else /* __linux__ */
+
static void cleanup_13_abort (void);
#define main cleanup_13_main
#include "cleanup-13.c"
@@ -148,3 +160,6 @@
/* There is an exit (0) call if we find the "main" frame, */
error (1, 0, "dwfl_getthreads: %s", dwfl_errmsg (-1));
}
+
+#endif /* ! __linux__ */
+
Index: elfutils-0.158/tests/backtrace-subr.sh
===================================================================
--- elfutils-0.158.orig/tests/backtrace-subr.sh 2014-05-01 17:11:18.870616302 +0000
+++ elfutils-0.158/tests/backtrace-subr.sh 2014-05-01 17:11:18.866616384 +0000
@@ -84,6 +84,7 @@
echo ./backtrace ./backtrace.$arch.{exec,core}
testrun ${abs_builddir}/backtrace -e ./backtrace.$arch.exec --core=./backtrace.$arch.core 1>backtrace.$arch.bt 2>backtrace.$arch.err || true
cat backtrace.$arch.{bt,err}
+ check_unsupported backtrace.$arch.err backtrace.$arch.core
check_all backtrace.$arch.{bt,err} backtrace.$arch.core
}
Index: elfutils-0.158/tests/backtrace.c
===================================================================
--- elfutils-0.158.orig/tests/backtrace.c 2014-05-01 17:11:18.870616302 +0000
+++ elfutils-0.158/tests/backtrace.c 2014-05-01 17:11:18.866616384 +0000
@@ -39,6 +39,18 @@
#include <sys/syscall.h>
#include ELFUTILS_HEADER(dwfl)
+#ifndef __linux__
+
+int
+main (int argc __attribute__ ((unused)), char **argv)
+{
+ fprintf (stderr, "%s: Unwinding not supported for this architecture\n",
+ argv[0]);
+ return 77;
+}
+
+#else /* __linux__ */
+
static int
dump_modules (Dwfl_Module *mod, void **userdata __attribute__ ((unused)),
const char *name, Dwarf_Addr start,
@@ -452,3 +464,6 @@
dwfl_end (dwfl);
return 0;
}
+
+#endif /* ! __linux__ */
+

View File

@@ -7,9 +7,11 @@ DEPENDS = "libtool bzip2 zlib virtual/libintl"
SRC_URI = "https://fedorahosted.org/releases/e/l/elfutils/${PV}/elfutils-${PV}.tar.bz2"
SRC_URI[md5sum] = "163a5712b86f6bdfebdf233cc6e2192d"
SRC_URI[sha256sum] = "68444a4526416ffd68852ec3c6a40ceddcca46538297322405319884c5d30ed8"
SRC_URI[md5sum] = "050a4909e452d01ab4747fd69d4036e0"
SRC_URI[sha256sum] = "be27af5c21352f53e010342bf1c68e0b9e18232dbf3adec7e2f9b41f6bbe397d"
# Pick patches from debian
# http://ftp.de.debian.org/debian/pool/main/e/elfutils/elfutils_0.158-2.debian.tar.xz
SRC_URI += "\
file://redhat-portability.diff \
file://redhat-robustify.diff \
@@ -17,13 +19,21 @@ SRC_URI += "\
file://arm_backend.diff \
file://mips_backend.diff \
file://m68k_backend.diff \
file://elf_additions.diff \
file://mempcpy.patch \
file://dso-link-change.patch \
file://nm-Fix-size-passed-to-snprintf-for-invalid-sh_name-case.patch \
file://elfutils-ar-c-fix-num-passed-to-memset.patch \
file://fix-build-gcc-4.8.patch \
file://testsuite-ignore-elflint.diff \
file://scanf-format.patch \
file://mips_readelf_w.patch \
file://core_filename.patch \
file://CVE-2014-0172.patch \
file://unwind_non_linux.patch \
"
SRC_URI += " \
file://elf_additions.diff \
file://mempcpy.patch \
file://dso-link-change.patch \
file://m4-biarch.m4-tweak-AC_RUN_IFELSE-for-cross-compiling.patch \
"
# Only apply when building uclibc based target recipe
SRC_URI_append_libc-uclibc = " file://uclibc-support.patch"