mirror of
https://git.yoctoproject.org/poky
synced 2026-06-03 13:49:49 +00:00
elfutils: upgrade to 0.160
- Upgrade elfutils to 0.160
- Move 0.148 patches from elfutils to elfutils-0.148
- Drop 0.158 patches that got from debain, so far debian
doesn't provide patches for 0.160 (the latest is 0.159)
- Move fixheadercheck.patch from 0.159 to 0.160
- We choose to use 0.159 patches from debian for the current 0.160
which located in elfutils-0.160
1) Rebase the following patches from 0.159 to 0.160
hppa_backend.diff
arm_backend.diff
mips_backend.diff
m68k_backend.diff
arm_func_value.patch
arm_unwind_ret_mask.patch
2) Rebase redhat-portability.diff according to
commit 52a6d20519
Author: Roxana Ciobanu <roxana.ciobanu@intel.com>
Date: Tue Jul 1 17:17:00 2014 +0300
elfutils/elfutils-native: Fix patching generated files
3) Drop the following patches which have already beem merged to 0.160
arm_unsupported.patch
arm_syscall.patch
unaligned.patch
aarch64-run-native-test-fix.patch
(From OE-Core rev: 74b191022494fc1d357c1f05dbce38c986bed365)
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
fa234ef4e0
commit
2e13f27e38
@@ -0,0 +1,449 @@
|
||||
Upstream-Status: Backport
|
||||
|
||||
Index: elfutils-0.146/backends/arm_init.c
|
||||
===================================================================
|
||||
--- elfutils-0.146.orig/backends/arm_init.c 2009-04-21 14:50:01.000000000 +0000
|
||||
+++ elfutils-0.146/backends/arm_init.c 2010-04-24 10:11:13.000000000 +0000
|
||||
@@ -32,21 +32,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);
|
||||
@@ -58,7 +69,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;
|
||||
|
||||
return MODVERSION;
|
||||
}
|
||||
Index: elfutils-0.146/backends/arm_regs.c
|
||||
===================================================================
|
||||
--- elfutils-0.146.orig/backends/arm_regs.c 2009-04-21 14:50:01.000000000 +0000
|
||||
+++ elfutils-0.146/backends/arm_regs.c 2010-04-24 10:11:13.000000000 +0000
|
||||
@@ -28,6 +28,7 @@
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
+#include <stdio.h>
|
||||
#include <dwarf.h>
|
||||
|
||||
#define BACKEND arm_
|
||||
@@ -58,7 +59,15 @@
|
||||
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';
|
||||
@@ -73,6 +82,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:
|
||||
@@ -84,11 +96,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 = "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.146/backends/arm_retval.c
|
||||
===================================================================
|
||||
--- elfutils-0.146.orig/backends/arm_retval.c 2010-01-12 16:57:54.000000000 +0000
|
||||
+++ elfutils-0.146/backends/arm_retval.c 2010-04-24 10:11:13.000000000 +0000
|
||||
@@ -45,6 +45,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. */
|
||||
@@ -55,8 +62,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. */
|
||||
@@ -109,14 +117,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;
|
||||
|
||||
@@ -135,3 +160,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.146/libelf/elf.h
|
||||
===================================================================
|
||||
--- elfutils-0.146.orig/libelf/elf.h 2010-04-24 10:11:11.000000000 +0000
|
||||
+++ elfutils-0.146/libelf/elf.h 2010-04-24 10:11:13.000000000 +0000
|
||||
@@ -2290,6 +2290,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. */
|
||||
@@ -2307,12 +2310,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
|
||||
|
||||
/* ARM relocs. */
|
||||
|
||||
@@ -2344,12 +2354,75 @@
|
||||
#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_NOI 55
|
||||
+#define R_ARM_REL32_NOI 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_GNU_VTENTRY 100
|
||||
#define R_ARM_GNU_VTINHERIT 101
|
||||
#define R_ARM_THM_PC11 102 /* thumb unconditional branch */
|
||||
@@ -2364,6 +2437,12 @@
|
||||
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_RXPC25 249
|
||||
#define R_ARM_RSBREL32 250
|
||||
#define R_ARM_THM_RPC22 251
|
||||
Index: elfutils-0.146/backends/libebl_arm.h
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ elfutils-0.146/backends/libebl_arm.h 2010-04-24 10:11:13.000000000 +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
|
||||
@@ -0,0 +1,71 @@
|
||||
Upstream-Status: Backport
|
||||
|
||||
Index: elfutils-0.146/libelf/elf.h
|
||||
===================================================================
|
||||
--- elfutils-0.146.orig/libelf/elf.h 2010-04-24 10:13:50.000000000 +0000
|
||||
+++ elfutils-0.146/libelf/elf.h 2010-04-24 10:22:43.000000000 +0000
|
||||
@@ -143,6 +143,7 @@
|
||||
#define ELFOSABI_HPUX 1 /* HP-UX */
|
||||
#define ELFOSABI_NETBSD 2 /* NetBSD. */
|
||||
#define ELFOSABI_LINUX 3 /* Linux. */
|
||||
+#define ELFOSABI_HURD 4 /* GNU/Hurd */
|
||||
#define ELFOSABI_SOLARIS 6 /* Sun Solaris. */
|
||||
#define ELFOSABI_AIX 7 /* IBM AIX. */
|
||||
#define ELFOSABI_IRIX 8 /* SGI Irix. */
|
||||
@@ -150,8 +151,13 @@
|
||||
#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 */
|
||||
@@ -206,7 +212,7 @@
|
||||
#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 */
|
||||
@@ -220,7 +226,8 @@
|
||||
#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 */
|
||||
@@ -250,7 +257,22 @@
|
||||
#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_NUM 95
|
||||
+#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_NUM 110
|
||||
|
||||
/* If it is necessary to assign new unofficial EM_* values, please
|
||||
pick large random numbers (0x8523, 0xa7f2, etc.) to minimize the
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
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.148/src/ar.c.org 2013-03-12 21:12:17.928281375 -0500
|
||||
+++ elfutils-0.148/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;
|
||||
@@ -0,0 +1,39 @@
|
||||
Upstream-Status: Backport
|
||||
|
||||
The ELF_T_LIB and ELF_T_GNUHASH sizes were missing from fsize table.
|
||||
|
||||
This could cause a failure in the elf*_xlatetof function.
|
||||
|
||||
diff -ur elfutils-0.148.orig/libelf/exttypes.h elfutils-0.148/libelf/exttypes.h
|
||||
--- elfutils-0.148.orig/libelf/exttypes.h 2009-01-08 12:56:37.000000000 -0800
|
||||
+++ elfutils-0.148/libelf/exttypes.h 2010-08-18 14:00:33.000000000 -0700
|
||||
@@ -94,6 +94,7 @@
|
||||
Vernaux32 (Ext_);
|
||||
Syminfo32 (Ext_);
|
||||
Move32 (Ext_);
|
||||
+Lib32 (Ext_);
|
||||
auxv_t32 (Ext_);
|
||||
|
||||
Ehdr64 (Ext_);
|
||||
@@ -110,6 +111,7 @@
|
||||
Vernaux64 (Ext_);
|
||||
Syminfo64 (Ext_);
|
||||
Move64 (Ext_);
|
||||
+Lib64 (Ext_);
|
||||
auxv_t64 (Ext_);
|
||||
|
||||
#undef START
|
||||
diff -ur elfutils-0.148.orig/libelf/gelf_fsize.c elfutils-0.148/libelf/gelf_fsize.c
|
||||
--- elfutils-0.148.orig/libelf/gelf_fsize.c 2009-01-08 12:56:37.000000000 -0800
|
||||
+++ elfutils-0.148/libelf/gelf_fsize.c 2010-08-18 14:11:57.000000000 -0700
|
||||
@@ -87,7 +87,9 @@
|
||||
[ELF_T_NHDR] = sizeof (ElfW2(LIBELFBITS, Ext_Nhdr)), \
|
||||
[ELF_T_SYMINFO] = sizeof (ElfW2(LIBELFBITS, Ext_Syminfo)), \
|
||||
[ELF_T_MOVE] = sizeof (ElfW2(LIBELFBITS, Ext_Move)), \
|
||||
- [ELF_T_AUXV] = sizeof (ElfW2(LIBELFBITS, Ext_auxv_t))
|
||||
+ [ELF_T_LIB] = sizeof (ElfW2(LIBELFBITS, Ext_Lib)), \
|
||||
+ [ELF_T_AUXV] = sizeof (ElfW2(LIBELFBITS, Ext_auxv_t)), \
|
||||
+ [ELF_T_GNUHASH] = ELFW2(LIBELFBITS, FSZ_WORD)
|
||||
TYPE_SIZES (32)
|
||||
},
|
||||
[ELFCLASS64 - 1] = {
|
||||
@@ -0,0 +1,57 @@
|
||||
This patch fixes a warning seen with gcc 4.8 (especially on ubuntu 13.10)
|
||||
|
||||
| addr2line.c: In function 'handle_address':
|
||||
| addr2line.c:450:7: error: format '%a' expects argument of type 'float *', but argument 3 has type 'char **' [-Werror=format=]
|
||||
| if (sscanf (string, "(%a[^)])%" PRIiMAX "%n", &name, &addr, &i) == 2
|
||||
| ^
|
||||
| addr2line.c:453:7: error: format '%a' expects argument of type 'float *', but argument 3 has type 'char **' [-Werror=format=]
|
||||
| switch (sscanf (string, "%a[^-+]%n%" PRIiMAX "%n", &name, &i, &addr, &j))
|
||||
| ^
|
||||
| cc1: all warnings being treated as errors
|
||||
|
||||
|
||||
%a is old GNU style and should be abandoned in favor of %m
|
||||
|
||||
Also see
|
||||
|
||||
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54361
|
||||
|
||||
to support this assertion
|
||||
|
||||
This patch is added via redhat-compatibility patch so lets revert this part
|
||||
here.
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
|
||||
Upstream-Status: Inappropriate [Caused by an earlier patch]
|
||||
|
||||
Index: elfutils-0.148/src/addr2line.c
|
||||
===================================================================
|
||||
--- elfutils-0.148.orig/src/addr2line.c 2013-09-23 17:46:45.513586538 -0700
|
||||
+++ elfutils-0.148/src/addr2line.c 2013-09-23 17:46:46.329586558 -0700
|
||||
@@ -447,10 +447,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.148/tests/line2addr.c
|
||||
===================================================================
|
||||
--- elfutils-0.148.orig/tests/line2addr.c 2013-09-23 17:46:45.521586538 -0700
|
||||
+++ elfutils-0.148/tests/line2addr.c 2013-09-23 17:46:46.329586558 -0700
|
||||
@@ -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:
|
||||
@@ -0,0 +1,73 @@
|
||||
Upstream-Status: pending
|
||||
gcc 4.7 does not like pointer conversion, so have a void * tmp var to work
|
||||
around following compilation issue.
|
||||
|
||||
Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
|
||||
2011/07/07
|
||||
|
||||
| md5.c: In function 'md5_finish_ctx':
|
||||
| md5.c:108:3: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
|
||||
| md5.c:109:3: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
|
||||
| cc1: all warnings being treated as errors
|
||||
|
|
||||
| make[2]: *** [md5.o] Error 1
|
||||
| make[2]: *** Waiting for unfinished jobs....
|
||||
| sha1.c: In function 'sha1_finish_ctx':
|
||||
| sha1.c:109:3: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
|
||||
| sha1.c:111:3: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
|
||||
| cc1: all warnings being treated as errors
|
||||
|
|
||||
| make[2]: *** [sha1.o] Error 1
|
||||
|
||||
Index: elfutils-0.148/lib/md5.c
|
||||
===================================================================
|
||||
--- elfutils-0.148.orig/lib/md5.c
|
||||
+++ elfutils-0.148/lib/md5.c
|
||||
@@ -95,6 +95,7 @@ md5_finish_ctx (ctx, resbuf)
|
||||
/* Take yet unprocessed bytes into account. */
|
||||
md5_uint32 bytes = ctx->buflen;
|
||||
size_t pad;
|
||||
+ void * tmp;
|
||||
|
||||
/* Now count remaining bytes. */
|
||||
ctx->total[0] += bytes;
|
||||
@@ -105,9 +106,10 @@ md5_finish_ctx (ctx, resbuf)
|
||||
memcpy (&ctx->buffer[bytes], fillbuf, pad);
|
||||
|
||||
/* Put the 64-bit file length in *bits* at the end of the buffer. */
|
||||
- *(md5_uint32 *) &ctx->buffer[bytes + pad] = SWAP (ctx->total[0] << 3);
|
||||
- *(md5_uint32 *) &ctx->buffer[bytes + pad + 4] = SWAP ((ctx->total[1] << 3) |
|
||||
- (ctx->total[0] >> 29));
|
||||
+ tmp = &ctx->buffer[bytes + pad];
|
||||
+ *(md5_uint32 *) tmp = SWAP (ctx->total[0] << 3);
|
||||
+ tmp = &ctx->buffer[bytes + pad + 4];
|
||||
+ *(md5_uint32 *) tmp = SWAP ((ctx->total[1] << 3) | (ctx->total[0] >> 29));
|
||||
|
||||
/* Process last bytes. */
|
||||
md5_process_block (ctx->buffer, bytes + pad + 8, ctx);
|
||||
Index: elfutils-0.148/lib/sha1.c
|
||||
===================================================================
|
||||
--- elfutils-0.148.orig/lib/sha1.c
|
||||
+++ elfutils-0.148/lib/sha1.c
|
||||
@@ -96,6 +96,7 @@ sha1_finish_ctx (ctx, resbuf)
|
||||
/* Take yet unprocessed bytes into account. */
|
||||
sha1_uint32 bytes = ctx->buflen;
|
||||
size_t pad;
|
||||
+ void * tmp;
|
||||
|
||||
/* Now count remaining bytes. */
|
||||
ctx->total[0] += bytes;
|
||||
@@ -106,9 +107,10 @@ sha1_finish_ctx (ctx, resbuf)
|
||||
memcpy (&ctx->buffer[bytes], fillbuf, pad);
|
||||
|
||||
/* Put the 64-bit file length in *bits* at the end of the buffer. */
|
||||
- *(sha1_uint32 *) &ctx->buffer[bytes + pad] = SWAP ((ctx->total[1] << 3) |
|
||||
- (ctx->total[0] >> 29));
|
||||
- *(sha1_uint32 *) &ctx->buffer[bytes + pad + 4] = SWAP (ctx->total[0] << 3);
|
||||
+ tmp = &ctx->buffer[bytes + pad];
|
||||
+ *(sha1_uint32 *) tmp = SWAP ((ctx->total[1] << 3) | (ctx->total[0] >> 29));
|
||||
+ tmp = &ctx->buffer[bytes + pad + 4];
|
||||
+ *(sha1_uint32 *) tmp = SWAP (ctx->total[0] << 3);
|
||||
|
||||
/* Process last bytes. */
|
||||
sha1_process_block (ctx->buffer, bytes + pad + 8, ctx);
|
||||
@@ -0,0 +1,801 @@
|
||||
Upstream-Status: Backport
|
||||
|
||||
Index: elfutils-0.146/backends/parisc_init.c
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ elfutils-0.146/backends/parisc_init.c 2010-04-24 10:10:50.000000000 +0000
|
||||
@@ -0,0 +1,74 @@
|
||||
+/* Initialization of PA-RISC specific backend library.
|
||||
+ Copyright (C) 2002, 2005, 2006 Red Hat, Inc.
|
||||
+ This file is part of Red Hat elfutils.
|
||||
+ Written by Ulrich Drepper <drepper@redhat.com>, 2002.
|
||||
+
|
||||
+ 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
|
||||
+
|
||||
+#define BACKEND parisc_
|
||||
+#define RELOC_PREFIX R_PARISC_
|
||||
+#include "libebl_CPU.h"
|
||||
+#include "libebl_parisc.h"
|
||||
+
|
||||
+/* This defines the common reloc hooks based on parisc_reloc.def. */
|
||||
+#include "common-reloc.c"
|
||||
+
|
||||
+
|
||||
+const char *
|
||||
+parisc_init (elf, machine, eh, ehlen)
|
||||
+ Elf *elf __attribute__ ((unused));
|
||||
+ GElf_Half machine __attribute__ ((unused));
|
||||
+ Ebl *eh;
|
||||
+ size_t ehlen;
|
||||
+{
|
||||
+ int pa64 = 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_PARISC_WIDE))
|
||||
+ pa64 = 1;
|
||||
+ }
|
||||
+ /* We handle it. */
|
||||
+ eh->name = "PA-RISC";
|
||||
+ parisc_init_reloc (eh);
|
||||
+ HOOK (eh, reloc_simple_type);
|
||||
+ HOOK (eh, machine_flag_check);
|
||||
+ HOOK (eh, symbol_type_name);
|
||||
+ HOOK (eh, segment_type_name);
|
||||
+ HOOK (eh, section_type_name);
|
||||
+ HOOK (eh, register_info);
|
||||
+ if (pa64)
|
||||
+ eh->return_value_location = parisc_return_value_location_64;
|
||||
+ else
|
||||
+ eh->return_value_location = parisc_return_value_location_32;
|
||||
+
|
||||
+ return MODVERSION;
|
||||
+}
|
||||
Index: elfutils-0.146/backends/parisc_regs.c
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ elfutils-0.146/backends/parisc_regs.c 2010-04-24 10:10:50.000000000 +0000
|
||||
@@ -0,0 +1,159 @@
|
||||
+/* Register names and numbers for PA-RISC DWARF.
|
||||
+ Copyright (C) 2005, 2006 Red Hat, Inc.
|
||||
+ 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 <string.h>
|
||||
+#include <dwarf.h>
|
||||
+
|
||||
+#define BACKEND parisc_
|
||||
+#include "libebl_CPU.h"
|
||||
+
|
||||
+ssize_t
|
||||
+parisc_register_info (Ebl *ebl, int regno, char *name, size_t namelen,
|
||||
+ const char **prefix, const char **setname,
|
||||
+ int *bits, int *type)
|
||||
+{
|
||||
+ int pa64 = 0;
|
||||
+
|
||||
+ if (ebl->elf) {
|
||||
+ GElf_Ehdr ehdr_mem;
|
||||
+ GElf_Ehdr *ehdr = gelf_getehdr (ebl->elf, &ehdr_mem);
|
||||
+ if (ehdr->e_flags & EF_PARISC_WIDE)
|
||||
+ pa64 = 1;
|
||||
+ }
|
||||
+
|
||||
+ int nregs = pa64 ? 127 : 128;
|
||||
+
|
||||
+ if (name == NULL)
|
||||
+ return nregs;
|
||||
+
|
||||
+ if (regno < 0 || regno >= nregs || namelen < 6)
|
||||
+ return -1;
|
||||
+
|
||||
+ *prefix = "%";
|
||||
+
|
||||
+ if (regno < 32)
|
||||
+ {
|
||||
+ *setname = "integer";
|
||||
+ *type = DW_ATE_signed;
|
||||
+ if (pa64)
|
||||
+ {
|
||||
+ *bits = 64;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ *bits = 32;
|
||||
+ }
|
||||
+ }
|
||||
+ else if (regno == 32)
|
||||
+ {
|
||||
+ *setname = "special";
|
||||
+ if (pa64)
|
||||
+ {
|
||||
+ *bits = 6;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ *bits = 5;
|
||||
+ }
|
||||
+ *type = DW_ATE_unsigned;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ *setname = "FPU";
|
||||
+ *type = DW_ATE_float;
|
||||
+ if (pa64)
|
||||
+ {
|
||||
+ *bits = 64;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ *bits = 32;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (regno < 33) {
|
||||
+ switch (regno)
|
||||
+ {
|
||||
+ case 0 ... 9:
|
||||
+ name[0] = 'r';
|
||||
+ name[1] = regno + '0';
|
||||
+ namelen = 2;
|
||||
+ break;
|
||||
+ case 10 ... 31:
|
||||
+ name[0] = 'r';
|
||||
+ name[1] = regno / 10 + '0';
|
||||
+ name[2] = regno % 10 + '0';
|
||||
+ namelen = 3;
|
||||
+ break;
|
||||
+ case 32:
|
||||
+ *prefix = NULL;
|
||||
+ name[0] = 'S';
|
||||
+ name[1] = 'A';
|
||||
+ name[2] = 'R';
|
||||
+ namelen = 3;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ else {
|
||||
+ if (pa64 && ((regno - 72) % 2)) {
|
||||
+ *setname = NULL;
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ switch (regno)
|
||||
+ {
|
||||
+ case 72 + 0 ... 72 + 11:
|
||||
+ name[0] = 'f';
|
||||
+ name[1] = 'r';
|
||||
+ name[2] = (regno + 8 - 72) / 2 + '0';
|
||||
+ namelen = 3;
|
||||
+ if ((regno + 8 - 72) % 2) {
|
||||
+ name[3] = 'R';
|
||||
+ namelen++;
|
||||
+ }
|
||||
+ break;
|
||||
+ case 72 + 12 ... 72 + 55:
|
||||
+ name[0] = 'f';
|
||||
+ name[1] = 'r';
|
||||
+ name[2] = (regno + 8 - 72) / 2 / 10 + '0';
|
||||
+ name[3] = (regno + 8 - 72) / 2 % 10 + '0';
|
||||
+ namelen = 4;
|
||||
+ if ((regno + 8 - 72) % 2) {
|
||||
+ name[4] = 'R';
|
||||
+ namelen++;
|
||||
+ }
|
||||
+ break;
|
||||
+ default:
|
||||
+ *setname = NULL;
|
||||
+ return 0;
|
||||
+ }
|
||||
+ }
|
||||
+ name[namelen++] = '\0';
|
||||
+ return namelen;
|
||||
+}
|
||||
Index: elfutils-0.146/backends/parisc_reloc.def
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ elfutils-0.146/backends/parisc_reloc.def 2010-04-24 10:10:50.000000000 +0000
|
||||
@@ -0,0 +1,128 @@
|
||||
+/* List the relocation types for PA-RISC. -*- C -*-
|
||||
+ Copyright (C) 2005 Red Hat, Inc.
|
||||
+ 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>. */
|
||||
+
|
||||
+/* NAME, REL|EXEC|DYN */
|
||||
+
|
||||
+RELOC_TYPE (NONE, EXEC|DYN)
|
||||
+RELOC_TYPE (DIR32, REL|EXEC|DYN)
|
||||
+RELOC_TYPE (DIR21L, REL|EXEC|DYN)
|
||||
+RELOC_TYPE (DIR17R, REL)
|
||||
+RELOC_TYPE (DIR17F, REL)
|
||||
+RELOC_TYPE (DIR14R, REL|DYN)
|
||||
+RELOC_TYPE (PCREL32, REL)
|
||||
+RELOC_TYPE (PCREL21L, REL)
|
||||
+RELOC_TYPE (PCREL17R, REL)
|
||||
+RELOC_TYPE (PCREL17F, REL)
|
||||
+RELOC_TYPE (PCREL14R, REL|EXEC)
|
||||
+RELOC_TYPE (DPREL21L, REL)
|
||||
+RELOC_TYPE (DPREL14WR, REL)
|
||||
+RELOC_TYPE (DPREL14DR, REL)
|
||||
+RELOC_TYPE (DPREL14R, REL)
|
||||
+RELOC_TYPE (GPREL21L, 0)
|
||||
+RELOC_TYPE (GPREL14R, 0)
|
||||
+RELOC_TYPE (LTOFF21L, REL)
|
||||
+RELOC_TYPE (LTOFF14R, REL)
|
||||
+RELOC_TYPE (DLTIND14F, 0)
|
||||
+RELOC_TYPE (SETBASE, 0)
|
||||
+RELOC_TYPE (SECREL32, REL)
|
||||
+RELOC_TYPE (BASEREL21L, 0)
|
||||
+RELOC_TYPE (BASEREL17R, 0)
|
||||
+RELOC_TYPE (BASEREL14R, 0)
|
||||
+RELOC_TYPE (SEGBASE, 0)
|
||||
+RELOC_TYPE (SEGREL32, REL)
|
||||
+RELOC_TYPE (PLTOFF21L, 0)
|
||||
+RELOC_TYPE (PLTOFF14R, 0)
|
||||
+RELOC_TYPE (PLTOFF14F, 0)
|
||||
+RELOC_TYPE (LTOFF_FPTR32, 0)
|
||||
+RELOC_TYPE (LTOFF_FPTR21L, 0)
|
||||
+RELOC_TYPE (LTOFF_FPTR14R, 0)
|
||||
+RELOC_TYPE (FPTR64, 0)
|
||||
+RELOC_TYPE (PLABEL32, REL|DYN)
|
||||
+RELOC_TYPE (PCREL64, 0)
|
||||
+RELOC_TYPE (PCREL22C, 0)
|
||||
+RELOC_TYPE (PCREL22F, 0)
|
||||
+RELOC_TYPE (PCREL14WR, 0)
|
||||
+RELOC_TYPE (PCREL14DR, 0)
|
||||
+RELOC_TYPE (PCREL16F, 0)
|
||||
+RELOC_TYPE (PCREL16WF, 0)
|
||||
+RELOC_TYPE (PCREL16DF, 0)
|
||||
+RELOC_TYPE (DIR64, REL|DYN)
|
||||
+RELOC_TYPE (DIR14WR, REL)
|
||||
+RELOC_TYPE (DIR14DR, REL)
|
||||
+RELOC_TYPE (DIR16F, REL)
|
||||
+RELOC_TYPE (DIR16WF, REL)
|
||||
+RELOC_TYPE (DIR16DF, REL)
|
||||
+RELOC_TYPE (GPREL64, 0)
|
||||
+RELOC_TYPE (GPREL14WR, 0)
|
||||
+RELOC_TYPE (GPREL14DR, 0)
|
||||
+RELOC_TYPE (GPREL16F, 0)
|
||||
+RELOC_TYPE (GPREL16WF, 0)
|
||||
+RELOC_TYPE (GPREL16DF, 0)
|
||||
+RELOC_TYPE (LTOFF64, 0)
|
||||
+RELOC_TYPE (LTOFF14WR, 0)
|
||||
+RELOC_TYPE (LTOFF14DR, 0)
|
||||
+RELOC_TYPE (LTOFF16F, 0)
|
||||
+RELOC_TYPE (LTOFF16WF, 0)
|
||||
+RELOC_TYPE (LTOFF16DF, 0)
|
||||
+RELOC_TYPE (SECREL64, 0)
|
||||
+RELOC_TYPE (BASEREL14WR, 0)
|
||||
+RELOC_TYPE (BASEREL14DR, 0)
|
||||
+RELOC_TYPE (SEGREL64, 0)
|
||||
+RELOC_TYPE (PLTOFF14WR, 0)
|
||||
+RELOC_TYPE (PLTOFF14DR, 0)
|
||||
+RELOC_TYPE (PLTOFF16F, 0)
|
||||
+RELOC_TYPE (PLTOFF16WF, 0)
|
||||
+RELOC_TYPE (PLTOFF16DF, 0)
|
||||
+RELOC_TYPE (LTOFF_FPTR64, 0)
|
||||
+RELOC_TYPE (LTOFF_FPTR14WR, 0)
|
||||
+RELOC_TYPE (LTOFF_FPTR14DR, 0)
|
||||
+RELOC_TYPE (LTOFF_FPTR16F, 0)
|
||||
+RELOC_TYPE (LTOFF_FPTR16WF, 0)
|
||||
+RELOC_TYPE (LTOFF_FPTR16DF, 0)
|
||||
+RELOC_TYPE (COPY, EXEC)
|
||||
+RELOC_TYPE (IPLT, EXEC|DYN)
|
||||
+RELOC_TYPE (EPLT, 0)
|
||||
+RELOC_TYPE (TPREL32, DYN)
|
||||
+RELOC_TYPE (TPREL21L, 0)
|
||||
+RELOC_TYPE (TPREL14R, 0)
|
||||
+RELOC_TYPE (LTOFF_TP21L, 0)
|
||||
+RELOC_TYPE (LTOFF_TP14R, 0)
|
||||
+RELOC_TYPE (LTOFF_TP14F, 0)
|
||||
+RELOC_TYPE (TPREL64, 0)
|
||||
+RELOC_TYPE (TPREL14WR, 0)
|
||||
+RELOC_TYPE (TPREL14DR, 0)
|
||||
+RELOC_TYPE (TPREL16F, 0)
|
||||
+RELOC_TYPE (TPREL16WF, 0)
|
||||
+RELOC_TYPE (TPREL16DF, 0)
|
||||
+RELOC_TYPE (LTOFF_TP64, 0)
|
||||
+RELOC_TYPE (LTOFF_TP14WR, 0)
|
||||
+RELOC_TYPE (LTOFF_TP14DR, 0)
|
||||
+RELOC_TYPE (LTOFF_TP16F, 0)
|
||||
+RELOC_TYPE (LTOFF_TP16WF, 0)
|
||||
+RELOC_TYPE (LTOFF_TP16DF, 0)
|
||||
+RELOC_TYPE (TLS_DTPMOD32, DYN)
|
||||
+RELOC_TYPE (TLS_DTPMOD64, DYN)
|
||||
+
|
||||
+#define NO_RELATIVE_RELOC 1
|
||||
Index: elfutils-0.146/backends/parisc_retval.c
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ elfutils-0.146/backends/parisc_retval.c 2010-04-24 10:10:50.000000000 +0000
|
||||
@@ -0,0 +1,213 @@
|
||||
+/* Function return value location for Linux/PA-RISC ABI.
|
||||
+ Copyright (C) 2005 Red Hat, Inc.
|
||||
+ 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 parisc_
|
||||
+#include "libebl_CPU.h"
|
||||
+#include "libebl_parisc.h"
|
||||
+
|
||||
+/* %r28, or pair %r28, %r29. */
|
||||
+static const Dwarf_Op loc_intreg32[] =
|
||||
+ {
|
||||
+ { .atom = DW_OP_reg28 }, { .atom = DW_OP_piece, .number = 4 },
|
||||
+ { .atom = DW_OP_reg29 }, { .atom = DW_OP_piece, .number = 4 },
|
||||
+ };
|
||||
+
|
||||
+static const Dwarf_Op loc_intreg[] =
|
||||
+ {
|
||||
+ { .atom = DW_OP_reg28 }, { .atom = DW_OP_piece, .number = 8 },
|
||||
+ { .atom = DW_OP_reg29 }, { .atom = DW_OP_piece, .number = 8 },
|
||||
+ };
|
||||
+#define nloc_intreg 1
|
||||
+#define nloc_intregpair 4
|
||||
+
|
||||
+/* %fr4L, or pair %fr4L, %fr4R on pa-32 */
|
||||
+static const Dwarf_Op loc_fpreg32[] =
|
||||
+ {
|
||||
+ { .atom = DW_OP_regx, .number = 72 }, { .atom = DW_OP_piece, .number = 4 },
|
||||
+ { .atom = DW_OP_regx, .number = 73 }, { .atom = DW_OP_piece, .number = 4 },
|
||||
+ };
|
||||
+#define nloc_fpreg32 2
|
||||
+#define nloc_fpregpair32 4
|
||||
+
|
||||
+/* $fr4 */
|
||||
+static const Dwarf_Op loc_fpreg[] =
|
||||
+ {
|
||||
+ { .atom = DW_OP_regx, .number = 72 },
|
||||
+ };
|
||||
+#define nloc_fpreg 1
|
||||
+
|
||||
+#if 0
|
||||
+/* The return value is a structure and is actually stored in stack space
|
||||
+ passed in a hidden argument by the caller. Address of the location is stored
|
||||
+ in %r28 before function call, but it may be changed by function. */
|
||||
+static const Dwarf_Op loc_aggregate[] =
|
||||
+ {
|
||||
+ { .atom = DW_OP_breg28 },
|
||||
+ };
|
||||
+#define nloc_aggregate 1
|
||||
+#endif
|
||||
+
|
||||
+static int
|
||||
+parisc_return_value_location_ (Dwarf_Die *functypedie, const Dwarf_Op **locp, int pa64)
|
||||
+{
|
||||
+ Dwarf_Word regsize = pa64 ? 8 : 4;
|
||||
+
|
||||
+ /* 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:
|
||||
+ {
|
||||
+ Dwarf_Word size;
|
||||
+ 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_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)
|
||||
+ {
|
||||
+ if (pa64) {
|
||||
+ *locp = loc_fpreg;
|
||||
+ if (size <= 8)
|
||||
+ return nloc_fpreg;
|
||||
+ }
|
||||
+ else {
|
||||
+ *locp = loc_fpreg32;
|
||||
+ if (size <= 4)
|
||||
+ return nloc_fpreg32;
|
||||
+ else if (size <= 8)
|
||||
+ return nloc_fpregpair32;
|
||||
+ }
|
||||
+ goto aggregate;
|
||||
+ }
|
||||
+ }
|
||||
+ if (pa64)
|
||||
+ *locp = loc_intreg;
|
||||
+ else
|
||||
+ *locp = loc_intreg32;
|
||||
+ if (size <= regsize)
|
||||
+ return nloc_intreg;
|
||||
+ if (size <= 2 * regsize)
|
||||
+ return nloc_intregpair;
|
||||
+
|
||||
+ /* Else fall through. */
|
||||
+ }
|
||||
+
|
||||
+ case DW_TAG_structure_type:
|
||||
+ case DW_TAG_class_type:
|
||||
+ case DW_TAG_union_type:
|
||||
+ case DW_TAG_array_type:
|
||||
+ aggregate: {
|
||||
+ Dwarf_Word size;
|
||||
+ if (dwarf_aggregate_size (typedie, &size) != 0)
|
||||
+ return -1;
|
||||
+ if (pa64)
|
||||
+ *locp = loc_intreg;
|
||||
+ else
|
||||
+ *locp = loc_intreg32;
|
||||
+ if (size <= regsize)
|
||||
+ return nloc_intreg;
|
||||
+ if (size <= 2 * regsize)
|
||||
+ return nloc_intregpair;
|
||||
+#if 0
|
||||
+ /* there should be some way to know this location... But I do not see it. */
|
||||
+ *locp = loc_aggregate;
|
||||
+ return nloc_aggregate;
|
||||
+#endif
|
||||
+ /* fall through. */
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ /* 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;
|
||||
+}
|
||||
+
|
||||
+int
|
||||
+parisc_return_value_location_32 (Dwarf_Die *functypedie, const Dwarf_Op **locp)
|
||||
+{
|
||||
+ return parisc_return_value_location_ (functypedie, locp, 0);
|
||||
+}
|
||||
+
|
||||
+int
|
||||
+parisc_return_value_location_64 (Dwarf_Die *functypedie, const Dwarf_Op **locp)
|
||||
+{
|
||||
+ return parisc_return_value_location_ (functypedie, locp, 1);
|
||||
+}
|
||||
+
|
||||
Index: elfutils-0.146/backends/parisc_symbol.c
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ elfutils-0.146/backends/parisc_symbol.c 2010-04-24 10:10:50.000000000 +0000
|
||||
@@ -0,0 +1,112 @@
|
||||
+/* PA-RISC specific symbolic name handling.
|
||||
+ Copyright (C) 2002, 2005 Red Hat, Inc.
|
||||
+ This file is part of Red Hat elfutils.
|
||||
+ Written by Ulrich Drepper <drepper@redhat.com>, 2002.
|
||||
+
|
||||
+ 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 <elf.h>
|
||||
+#include <stddef.h>
|
||||
+
|
||||
+#define BACKEND parisc_
|
||||
+#include "libebl_CPU.h"
|
||||
+
|
||||
+const char *
|
||||
+parisc_segment_type_name (int segment, char *buf __attribute__ ((unused)),
|
||||
+ size_t len __attribute__ ((unused)))
|
||||
+{
|
||||
+ switch (segment)
|
||||
+ {
|
||||
+ case PT_PARISC_ARCHEXT:
|
||||
+ return "PARISC_ARCHEXT";
|
||||
+ case PT_PARISC_UNWIND:
|
||||
+ return "PARISC_UNWIND";
|
||||
+ default:
|
||||
+ break;
|
||||
+ }
|
||||
+ return NULL;
|
||||
+}
|
||||
+
|
||||
+/* Return symbolic representation of symbol type. */
|
||||
+const char *
|
||||
+parisc_symbol_type_name(int symbol, char *buf __attribute__ ((unused)),
|
||||
+ size_t len __attribute__ ((unused)))
|
||||
+{
|
||||
+ if (symbol == STT_PARISC_MILLICODE)
|
||||
+ return "PARISC_MILLI";
|
||||
+ return NULL;
|
||||
+}
|
||||
+
|
||||
+/* Return symbolic representation of section type. */
|
||||
+const char *
|
||||
+parisc_section_type_name (int type,
|
||||
+ char *buf __attribute__ ((unused)),
|
||||
+ size_t len __attribute__ ((unused)))
|
||||
+{
|
||||
+ switch (type)
|
||||
+ {
|
||||
+ case SHT_PARISC_EXT:
|
||||
+ return "PARISC_EXT";
|
||||
+ case SHT_PARISC_UNWIND:
|
||||
+ return "PARISC_UNWIND";
|
||||
+ case SHT_PARISC_DOC:
|
||||
+ return "PARISC_DOC";
|
||||
+ }
|
||||
+
|
||||
+ return NULL;
|
||||
+}
|
||||
+
|
||||
+/* Check whether machine flags are valid. */
|
||||
+bool
|
||||
+parisc_machine_flag_check (GElf_Word flags)
|
||||
+{
|
||||
+ if (flags &~ (EF_PARISC_TRAPNIL | EF_PARISC_EXT | EF_PARISC_LSB |
|
||||
+ EF_PARISC_WIDE | EF_PARISC_NO_KABP |
|
||||
+ EF_PARISC_LAZYSWAP | EF_PARISC_ARCH))
|
||||
+ return 0;
|
||||
+
|
||||
+ GElf_Word arch = flags & EF_PARISC_ARCH;
|
||||
+
|
||||
+ return ((arch == EFA_PARISC_1_0) || (arch == EFA_PARISC_1_1) ||
|
||||
+ (arch == EFA_PARISC_2_0));
|
||||
+}
|
||||
+
|
||||
+/* Check for the simple reloc types. */
|
||||
+Elf_Type
|
||||
+parisc_reloc_simple_type (Ebl *ebl __attribute__ ((unused)), int type)
|
||||
+{
|
||||
+ switch (type)
|
||||
+ {
|
||||
+ case R_PARISC_DIR64:
|
||||
+ case R_PARISC_SECREL64:
|
||||
+ return ELF_T_XWORD;
|
||||
+ case R_PARISC_DIR32:
|
||||
+ case R_PARISC_SECREL32:
|
||||
+ return ELF_T_WORD;
|
||||
+ default:
|
||||
+ return ELF_T_NUM;
|
||||
+ }
|
||||
+}
|
||||
Index: elfutils-0.146/backends/libebl_parisc.h
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ elfutils-0.146/backends/libebl_parisc.h 2010-04-24 10:10:50.000000000 +0000
|
||||
@@ -0,0 +1,9 @@
|
||||
+#ifndef _LIBEBL_HPPA_H
|
||||
+#define _LIBEBL_HPPA_H 1
|
||||
+
|
||||
+#include <libdw.h>
|
||||
+
|
||||
+extern int parisc_return_value_location_32(Dwarf_Die *, const Dwarf_Op **locp);
|
||||
+extern int parisc_return_value_location_64(Dwarf_Die *, const Dwarf_Op **locp);
|
||||
+
|
||||
+#endif
|
||||
Index: elfutils-0.146/backends/Makefile.am
|
||||
===================================================================
|
||||
--- elfutils-0.146.orig/backends/Makefile.am 2010-04-24 10:10:41.000000000 +0000
|
||||
+++ elfutils-0.146/backends/Makefile.am 2010-04-24 10:10:50.000000000 +0000
|
||||
@@ -29,11 +29,11 @@
|
||||
-I$(top_srcdir)/libelf -I$(top_srcdir)/libdw
|
||||
|
||||
|
||||
-modules = i386 sh x86_64 ia64 alpha arm sparc ppc ppc64 s390
|
||||
+modules = i386 sh x86_64 ia64 alpha arm sparc ppc ppc64 s390 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_s390_pic.a libebl_parisc_pic.a
|
||||
noinst_LIBRARIES = $(libebl_pic)
|
||||
noinst_DATA = $(libebl_pic:_pic.a=.so)
|
||||
|
||||
@@ -95,6 +95,9 @@
|
||||
libebl_s390_pic_a_SOURCES = $(s390_SRCS)
|
||||
am_libebl_s390_pic_a_OBJECTS = $(s390_SRCS:.c=.os)
|
||||
|
||||
+parisc_SRCS = parisc_init.c parisc_symbol.c parisc_regs.c parisc_retval.c
|
||||
+libebl_parisc_pic_a_SOURCES = $(parisc_SRCS)
|
||||
+am_libebl_parisc_pic_a_OBJECTS = $(parisc_SRCS:.c=.os)
|
||||
|
||||
libebl_%.so libebl_%.map: libebl_%_pic.a $(libelf) $(libdw)
|
||||
@rm -f $(@:.so=.map)
|
||||
Index: elfutils-0.146/libelf/elf.h
|
||||
===================================================================
|
||||
--- elfutils-0.146.orig/libelf/elf.h 2010-04-13 20:08:02.000000000 +0000
|
||||
+++ elfutils-0.146/libelf/elf.h 2010-04-24 10:10:50.000000000 +0000
|
||||
@@ -1789,16 +1789,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. */
|
||||
+#define R_PARISC_DPREL14WR 19
|
||||
+#define R_PARISC_DPREL14DR 20
|
||||
#define R_PARISC_DPREL14R 22 /* Right 14 bits of rel. address. */
|
||||
#define R_PARISC_GPREL21L 26 /* GP-relative, left 21 bits. */
|
||||
#define R_PARISC_GPREL14R 30 /* GP-relative, right 14 bits. */
|
||||
#define R_PARISC_LTOFF21L 34 /* LT-relative, left 21 bits. */
|
||||
#define R_PARISC_LTOFF14R 38 /* LT-relative, right 14 bits. */
|
||||
+#define R_PARISC_DLTIND14F 39
|
||||
+#define R_PARISC_SETBASE 40
|
||||
#define R_PARISC_SECREL32 41 /* 32 bits section rel. address. */
|
||||
+#define R_PARISC_BASEREL21L 42
|
||||
+#define R_PARISC_BASEREL17R 43
|
||||
+#define R_PARISC_BASEREL14R 46
|
||||
#define R_PARISC_SEGBASE 48 /* No relocation, set segment base. */
|
||||
#define R_PARISC_SEGREL32 49 /* 32 bits segment rel. address. */
|
||||
#define R_PARISC_PLTOFF21L 50 /* PLT rel. address, left 21 bits. */
|
||||
#define R_PARISC_PLTOFF14R 54 /* PLT rel. address, right 14 bits. */
|
||||
+#define R_PARISC_PLTOFF14F 55
|
||||
#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. */
|
||||
@@ -1807,6 +1815,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. */
|
||||
+#define R_PARISC_PCREL22C 73
|
||||
#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. */
|
||||
@@ -1832,6 +1841,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. */
|
||||
+#define R_PARISC_BASEREL14WR 107
|
||||
+#define R_PARISC_BASEREL14DR 108
|
||||
#define R_PARISC_SEGREL64 112 /* 64 bits segment rel. address. */
|
||||
#define R_PARISC_PLTOFF14WR 115 /* PLT-rel. address, right 14 bits. */
|
||||
#define R_PARISC_PLTOFF14DR 116 /* PLT-rel. address, right 14 bits. */
|
||||
@@ -0,0 +1,309 @@
|
||||
Upstream-Status: Backport
|
||||
|
||||
Index: elfutils-0.146/backends/m68k_init.c
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ elfutils-0.146/backends/m68k_init.c 2010-04-24 10:11:38.000000000 +0000
|
||||
@@ -0,0 +1,49 @@
|
||||
+/* Initialization of m68k specific backend library.
|
||||
+ Copyright (C) 2007 Kurt Roeckx <kurt@roeckx.be>
|
||||
+
|
||||
+ This software 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.
|
||||
+
|
||||
+ This softare 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 this software; if not, write to the Free Software Foundation,
|
||||
+ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
|
||||
+
|
||||
+*/
|
||||
+
|
||||
+#ifdef HAVE_CONFIG_H
|
||||
+# include <config.h>
|
||||
+#endif
|
||||
+
|
||||
+#define BACKEND m68k_
|
||||
+#define RELOC_PREFIX R_68K_
|
||||
+#include "libebl_CPU.h"
|
||||
+
|
||||
+/* This defines the common reloc hooks based on m68k_reloc.def. */
|
||||
+#include "common-reloc.c"
|
||||
+
|
||||
+
|
||||
+const char *
|
||||
+m68k_init (elf, machine, eh, ehlen)
|
||||
+ Elf *elf __attribute__ ((unused));
|
||||
+ GElf_Half machine __attribute__ ((unused));
|
||||
+ Ebl *eh;
|
||||
+ size_t ehlen;
|
||||
+{
|
||||
+ /* Check whether the Elf_BH object has a sufficent size. */
|
||||
+ if (ehlen < sizeof (Ebl))
|
||||
+ return NULL;
|
||||
+
|
||||
+ /* We handle it. */
|
||||
+ eh->name = "m68k";
|
||||
+ m68k_init_reloc (eh);
|
||||
+ HOOK (eh, reloc_simple_type);
|
||||
+ HOOK (eh, register_info);
|
||||
+
|
||||
+ return MODVERSION;
|
||||
+}
|
||||
Index: elfutils-0.146/backends/m68k_regs.c
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ elfutils-0.146/backends/m68k_regs.c 2010-04-24 10:11:38.000000000 +0000
|
||||
@@ -0,0 +1,106 @@
|
||||
+/* Register names and numbers for m68k DWARF.
|
||||
+ Copyright (C) 2007 Kurt Roeckx <kurt@roeckx.be>
|
||||
+
|
||||
+ This software 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.
|
||||
+
|
||||
+ This software 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 this software; if not, write to the Free Software Foundation,
|
||||
+ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
|
||||
+
|
||||
+ */
|
||||
+
|
||||
+#ifdef HAVE_CONFIG_H
|
||||
+# include <config.h>
|
||||
+#endif
|
||||
+
|
||||
+#include <string.h>
|
||||
+#include <dwarf.h>
|
||||
+
|
||||
+#define BACKEND m68k_
|
||||
+#include "libebl_CPU.h"
|
||||
+
|
||||
+ssize_t
|
||||
+m68k_register_info (Ebl *ebl __attribute__ ((unused)),
|
||||
+ int regno, char *name, size_t namelen,
|
||||
+ const char **prefix, const char **setname,
|
||||
+ int *bits, int *type)
|
||||
+{
|
||||
+ if (name == NULL)
|
||||
+ return 25;
|
||||
+
|
||||
+ if (regno < 0 || regno > 24 || namelen < 5)
|
||||
+ return -1;
|
||||
+
|
||||
+ *prefix = "%";
|
||||
+ *bits = 32;
|
||||
+ *type = (regno < 8 ? DW_ATE_signed
|
||||
+ : regno < 16 ? DW_ATE_address : DW_ATE_float);
|
||||
+
|
||||
+ if (regno < 8)
|
||||
+ {
|
||||
+ *setname = "integer";
|
||||
+ }
|
||||
+ else if (regno < 16)
|
||||
+ {
|
||||
+ *setname = "address";
|
||||
+ }
|
||||
+ else if (regno < 24)
|
||||
+ {
|
||||
+ *setname = "FPU";
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ *setname = "address";
|
||||
+ *type = DW_ATE_address;
|
||||
+ }
|
||||
+
|
||||
+ switch (regno)
|
||||
+ {
|
||||
+ case 0 ... 7:
|
||||
+ name[0] = 'd';
|
||||
+ name[1] = regno + '0';
|
||||
+ namelen = 2;
|
||||
+ break;
|
||||
+
|
||||
+ case 8 ... 13:
|
||||
+ name[0] = 'a';
|
||||
+ name[1] = regno - 8 + '0';
|
||||
+ namelen = 2;
|
||||
+ break;
|
||||
+
|
||||
+ case 14:
|
||||
+ name[0] = 'f';
|
||||
+ name[1] = 'p';
|
||||
+ namelen = 2;
|
||||
+ break;
|
||||
+
|
||||
+ case 15:
|
||||
+ name[0] = 's';
|
||||
+ name[1] = 'p';
|
||||
+ namelen = 2;
|
||||
+ break;
|
||||
+
|
||||
+ case 16 ... 23:
|
||||
+ name[0] = 'f';
|
||||
+ name[1] = 'p';
|
||||
+ name[2] = regno - 16 + '0';
|
||||
+ namelen = 3;
|
||||
+ break;
|
||||
+
|
||||
+ case 24:
|
||||
+ name[0] = 'p';
|
||||
+ name[1] = 'c';
|
||||
+ namelen = 2;
|
||||
+ }
|
||||
+
|
||||
+ name[namelen++] = '\0';
|
||||
+ return namelen;
|
||||
+}
|
||||
+
|
||||
Index: elfutils-0.146/backends/m68k_reloc.def
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ elfutils-0.146/backends/m68k_reloc.def 2010-04-24 10:11:38.000000000 +0000
|
||||
@@ -0,0 +1,45 @@
|
||||
+/* List the relocation types for m68k. -*- C -*-
|
||||
+ Copyright (C) 2007 Kurt Roeckx <kurt@roeckx.be>
|
||||
+
|
||||
+ This software 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.
|
||||
+
|
||||
+ This software 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 this software; if not, write to the Free Software Foundation,
|
||||
+ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
|
||||
+*/
|
||||
+
|
||||
+/* NAME, REL|EXEC|DYN */
|
||||
+
|
||||
+RELOC_TYPE (NONE, 0)
|
||||
+RELOC_TYPE (32, REL|EXEC|DYN)
|
||||
+RELOC_TYPE (16, REL)
|
||||
+RELOC_TYPE (8, REL)
|
||||
+RELOC_TYPE (PC32, REL|EXEC|DYN)
|
||||
+RELOC_TYPE (PC16, REL)
|
||||
+RELOC_TYPE (PC8, REL)
|
||||
+RELOC_TYPE (GOT32, REL)
|
||||
+RELOC_TYPE (GOT16, REL)
|
||||
+RELOC_TYPE (GOT8, REL)
|
||||
+RELOC_TYPE (GOT32O, REL)
|
||||
+RELOC_TYPE (GOT16O, REL)
|
||||
+RELOC_TYPE (GOT8O, REL)
|
||||
+RELOC_TYPE (PLT32, REL)
|
||||
+RELOC_TYPE (PLT16, REL)
|
||||
+RELOC_TYPE (PLT8, REL)
|
||||
+RELOC_TYPE (PLT32O, REL)
|
||||
+RELOC_TYPE (PLT16O, REL)
|
||||
+RELOC_TYPE (PLT8O, REL)
|
||||
+RELOC_TYPE (COPY, EXEC)
|
||||
+RELOC_TYPE (GLOB_DAT, EXEC|DYN)
|
||||
+RELOC_TYPE (JMP_SLOT, EXEC|DYN)
|
||||
+RELOC_TYPE (RELATIVE, EXEC|DYN)
|
||||
+RELOC_TYPE (GNU_VTINHERIT, REL)
|
||||
+RELOC_TYPE (GNU_VTENTRY, REL)
|
||||
+
|
||||
Index: elfutils-0.146/libelf/elf.h
|
||||
===================================================================
|
||||
--- elfutils-0.146.orig/libelf/elf.h 2010-04-24 10:11:13.000000000 +0000
|
||||
+++ elfutils-0.146/libelf/elf.h 2010-04-24 10:13:50.000000000 +0000
|
||||
@@ -1125,6 +1125,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 */
|
||||
+/* The next 2 are GNU extensions to enable C++ vtable garbage collection. */
|
||||
+#define R_68K_GNU_VTINHERIT 23
|
||||
+#define R_68K_GNU_VTENTRY 24
|
||||
#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.146/backends/Makefile.am
|
||||
===================================================================
|
||||
--- elfutils-0.146.orig/backends/Makefile.am 2010-04-24 10:11:23.000000000 +0000
|
||||
+++ elfutils-0.146/backends/Makefile.am 2010-04-24 10:11:38.000000000 +0000
|
||||
@@ -29,11 +29,12 @@
|
||||
-I$(top_srcdir)/libelf -I$(top_srcdir)/libdw
|
||||
|
||||
|
||||
-modules = i386 sh x86_64 ia64 alpha arm sparc ppc ppc64 s390 parisc mips
|
||||
+modules = i386 sh x86_64 ia64 alpha arm sparc ppc ppc64 s390 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_parisc_pic.a libebl_mips_pic.a
|
||||
+ libebl_s390_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)
|
||||
|
||||
@@ -103,6 +104,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
|
||||
+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.146/backends/m68k_symbol.c
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ elfutils-0.146/backends/m68k_symbol.c 2010-04-24 10:11:38.000000000 +0000
|
||||
@@ -0,0 +1,43 @@
|
||||
+/* m68k specific symbolic name handling.
|
||||
+ Copyright (C) 2007 Kurt Roeckx <kurt@roeckx.be>
|
||||
+
|
||||
+ This software 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.
|
||||
+
|
||||
+ This software 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 this software; if not, write to the Free Software Foundation,
|
||||
+ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
|
||||
+*/
|
||||
+
|
||||
+#ifdef HAVE_CONFIG_H
|
||||
+# include <config.h>
|
||||
+#endif
|
||||
+
|
||||
+#include <elf.h>
|
||||
+#include <stddef.h>
|
||||
+
|
||||
+#define BACKEND m68k_
|
||||
+#include "libebl_CPU.h"
|
||||
+
|
||||
+/* Check for the simple reloc types. */
|
||||
+Elf_Type
|
||||
+m68k_reloc_simple_type (Ebl *ebl __attribute__ ((unused)), int type)
|
||||
+{
|
||||
+ switch (type)
|
||||
+ {
|
||||
+ case R_68K_32:
|
||||
+ return ELF_T_SWORD;
|
||||
+ case R_68K_16:
|
||||
+ return ELF_T_HALF;
|
||||
+ case R_68K_8:
|
||||
+ return ELF_T_BYTE;
|
||||
+ default:
|
||||
+ return ELF_T_NUM;
|
||||
+ }
|
||||
+}
|
||||
@@ -0,0 +1,713 @@
|
||||
Upstream-Status: Backport
|
||||
|
||||
Index: elfutils-0.145/backends/mips_init.c
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ elfutils-0.145/backends/mips_init.c 2010-02-24 18:57:35.000000000 +0000
|
||||
@@ -0,0 +1,60 @@
|
||||
+/* Initialization of mips specific backend library.
|
||||
+ Copyright (C) 2006 Red Hat, Inc.
|
||||
+ 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
|
||||
+
|
||||
+#define BACKEND mips_
|
||||
+#define RELOC_PREFIX R_MIPS_
|
||||
+#include "libebl_CPU.h"
|
||||
+
|
||||
+/* This defines the common reloc hooks based on mips_reloc.def. */
|
||||
+#include "common-reloc.c"
|
||||
+
|
||||
+const char *
|
||||
+mips_init (elf, machine, eh, ehlen)
|
||||
+ Elf *elf __attribute__ ((unused));
|
||||
+ GElf_Half machine __attribute__ ((unused));
|
||||
+ Ebl *eh;
|
||||
+ size_t ehlen;
|
||||
+{
|
||||
+ /* Check whether the Elf_BH object has a sufficent size. */
|
||||
+ if (ehlen < sizeof (Ebl))
|
||||
+ return NULL;
|
||||
+
|
||||
+ /* We handle it. */
|
||||
+ if (machine == EM_MIPS)
|
||||
+ eh->name = "MIPS R3000 big-endian";
|
||||
+ else if (machine == EM_MIPS_RS3_LE)
|
||||
+ eh->name = "MIPS R3000 little-endian";
|
||||
+
|
||||
+ mips_init_reloc (eh);
|
||||
+ HOOK (eh, reloc_simple_type);
|
||||
+ HOOK (eh, return_value_location);
|
||||
+ HOOK (eh, register_info);
|
||||
+
|
||||
+ return MODVERSION;
|
||||
+}
|
||||
Index: elfutils-0.145/backends/mips_regs.c
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ elfutils-0.145/backends/mips_regs.c 2010-02-24 18:57:35.000000000 +0000
|
||||
@@ -0,0 +1,104 @@
|
||||
+/* Register names and numbers for MIPS DWARF.
|
||||
+ Copyright (C) 2006 Red Hat, Inc.
|
||||
+ 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 <string.h>
|
||||
+#include <dwarf.h>
|
||||
+
|
||||
+#define BACKEND mips_
|
||||
+#include "libebl_CPU.h"
|
||||
+
|
||||
+ssize_t
|
||||
+mips_register_info (Ebl *ebl __attribute__((unused)),
|
||||
+ int regno, char *name, size_t namelen,
|
||||
+ const char **prefix, const char **setname,
|
||||
+ int *bits, int *type)
|
||||
+{
|
||||
+ if (name == NULL)
|
||||
+ return 66;
|
||||
+
|
||||
+ if (regno < 0 || regno > 65 || namelen < 4)
|
||||
+ return -1;
|
||||
+
|
||||
+ *prefix = "$";
|
||||
+
|
||||
+ if (regno < 32)
|
||||
+ {
|
||||
+ *setname = "integer";
|
||||
+ *type = DW_ATE_signed;
|
||||
+ *bits = 32;
|
||||
+ if (regno < 32 + 10)
|
||||
+ {
|
||||
+ name[0] = regno + '0';
|
||||
+ namelen = 1;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ name[0] = (regno / 10) + '0';
|
||||
+ name[1] = (regno % 10) + '0';
|
||||
+ namelen = 2;
|
||||
+ }
|
||||
+ }
|
||||
+ else if (regno < 64)
|
||||
+ {
|
||||
+ *setname = "FPU";
|
||||
+ *type = DW_ATE_float;
|
||||
+ *bits = 32;
|
||||
+ name[0] = 'f';
|
||||
+ if (regno < 32 + 10)
|
||||
+ {
|
||||
+ name[1] = (regno - 32) + '0';
|
||||
+ namelen = 2;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ name[1] = (regno - 32) / 10 + '0';
|
||||
+ name[2] = (regno - 32) % 10 + '0';
|
||||
+ namelen = 3;
|
||||
+ }
|
||||
+ }
|
||||
+ else if (regno == 64)
|
||||
+ {
|
||||
+ *type = DW_ATE_signed;
|
||||
+ *bits = 32;
|
||||
+ name[0] = 'h';
|
||||
+ name[1] = 'i';
|
||||
+ namelen = 2;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ *type = DW_ATE_signed;
|
||||
+ *bits = 32;
|
||||
+ name[0] = 'l';
|
||||
+ name[1] = 'o';
|
||||
+ namelen = 2;
|
||||
+ }
|
||||
+
|
||||
+ name[namelen++] = '\0';
|
||||
+ return namelen;
|
||||
+}
|
||||
Index: elfutils-0.145/backends/mips_reloc.def
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ elfutils-0.145/backends/mips_reloc.def 2010-02-24 18:57:35.000000000 +0000
|
||||
@@ -0,0 +1,79 @@
|
||||
+/* List the relocation types for mips. -*- C -*-
|
||||
+ Copyright (C) 2006 Red Hat, Inc.
|
||||
+ 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>. */
|
||||
+
|
||||
+/* NAME, REL|EXEC|DYN */
|
||||
+
|
||||
+RELOC_TYPE (NONE, 0)
|
||||
+RELOC_TYPE (16, 0)
|
||||
+RELOC_TYPE (32, 0)
|
||||
+RELOC_TYPE (REL32, 0)
|
||||
+RELOC_TYPE (26, 0)
|
||||
+RELOC_TYPE (HI16, 0)
|
||||
+RELOC_TYPE (LO16, 0)
|
||||
+RELOC_TYPE (GPREL16, 0)
|
||||
+RELOC_TYPE (LITERAL, 0)
|
||||
+RELOC_TYPE (GOT16, 0)
|
||||
+RELOC_TYPE (PC16, 0)
|
||||
+RELOC_TYPE (CALL16, 0)
|
||||
+RELOC_TYPE (GPREL32, 0)
|
||||
+
|
||||
+RELOC_TYPE (SHIFT5, 0)
|
||||
+RELOC_TYPE (SHIFT6, 0)
|
||||
+RELOC_TYPE (64, 0)
|
||||
+RELOC_TYPE (GOT_DISP, 0)
|
||||
+RELOC_TYPE (GOT_PAGE, 0)
|
||||
+RELOC_TYPE (GOT_OFST, 0)
|
||||
+RELOC_TYPE (GOT_HI16, 0)
|
||||
+RELOC_TYPE (GOT_LO16, 0)
|
||||
+RELOC_TYPE (SUB, 0)
|
||||
+RELOC_TYPE (INSERT_A, 0)
|
||||
+RELOC_TYPE (INSERT_B, 0)
|
||||
+RELOC_TYPE (DELETE, 0)
|
||||
+RELOC_TYPE (HIGHER, 0)
|
||||
+RELOC_TYPE (HIGHEST, 0)
|
||||
+RELOC_TYPE (CALL_HI16, 0)
|
||||
+RELOC_TYPE (CALL_LO16, 0)
|
||||
+RELOC_TYPE (SCN_DISP, 0)
|
||||
+RELOC_TYPE (REL16, 0)
|
||||
+RELOC_TYPE (ADD_IMMEDIATE, 0)
|
||||
+RELOC_TYPE (PJUMP, 0)
|
||||
+RELOC_TYPE (RELGOT, 0)
|
||||
+RELOC_TYPE (JALR, 0)
|
||||
+RELOC_TYPE (TLS_DTPMOD32, 0)
|
||||
+RELOC_TYPE (TLS_DTPREL32, 0)
|
||||
+RELOC_TYPE (TLS_DTPMOD64, 0)
|
||||
+RELOC_TYPE (TLS_DTPREL64, 0)
|
||||
+RELOC_TYPE (TLS_GD, 0)
|
||||
+RELOC_TYPE (TLS_LDM, 0)
|
||||
+RELOC_TYPE (TLS_DTPREL_HI16, 0)
|
||||
+RELOC_TYPE (TLS_DTPREL_LO16, 0)
|
||||
+RELOC_TYPE (TLS_GOTTPREL, 0)
|
||||
+RELOC_TYPE (TLS_TPREL32, 0)
|
||||
+RELOC_TYPE (TLS_TPREL64, 0)
|
||||
+RELOC_TYPE (TLS_TPREL_HI16, 0)
|
||||
+RELOC_TYPE (TLS_TPREL_LO16, 0)
|
||||
+
|
||||
+#define NO_COPY_RELOC 1
|
||||
+#define NO_RELATIVE_RELOC 1
|
||||
Index: elfutils-0.145/backends/mips_retval.c
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ elfutils-0.145/backends/mips_retval.c 2010-02-24 18:57:35.000000000 +0000
|
||||
@@ -0,0 +1,321 @@
|
||||
+/* Function return value location for Linux/mips ABI.
|
||||
+ Copyright (C) 2005 Red Hat, Inc.
|
||||
+ 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 <string.h>
|
||||
+#include <assert.h>
|
||||
+#include <dwarf.h>
|
||||
+#include <elf.h>
|
||||
+
|
||||
+#include "../libebl/libeblP.h"
|
||||
+#include "../libdw/libdwP.h"
|
||||
+
|
||||
+#define BACKEND mips_
|
||||
+#include "libebl_CPU.h"
|
||||
+
|
||||
+/* The ABI of the file. Also see EF_MIPS_ABI2 above. */
|
||||
+#define EF_MIPS_ABI 0x0000F000
|
||||
+
|
||||
+/* The original o32 abi. */
|
||||
+#define E_MIPS_ABI_O32 0x00001000
|
||||
+
|
||||
+/* O32 extended to work on 64 bit architectures */
|
||||
+#define E_MIPS_ABI_O64 0x00002000
|
||||
+
|
||||
+/* EABI in 32 bit mode */
|
||||
+#define E_MIPS_ABI_EABI32 0x00003000
|
||||
+
|
||||
+/* EABI in 64 bit mode */
|
||||
+#define E_MIPS_ABI_EABI64 0x00004000
|
||||
+
|
||||
+/* All the possible MIPS ABIs. */
|
||||
+enum mips_abi
|
||||
+ {
|
||||
+ MIPS_ABI_UNKNOWN = 0,
|
||||
+ MIPS_ABI_N32,
|
||||
+ MIPS_ABI_O32,
|
||||
+ MIPS_ABI_N64,
|
||||
+ MIPS_ABI_O64,
|
||||
+ MIPS_ABI_EABI32,
|
||||
+ MIPS_ABI_EABI64,
|
||||
+ MIPS_ABI_LAST
|
||||
+ };
|
||||
+
|
||||
+/* Find the mips ABI of the current file */
|
||||
+enum mips_abi find_mips_abi(Elf *elf)
|
||||
+{
|
||||
+ GElf_Ehdr ehdr_mem;
|
||||
+ GElf_Ehdr *ehdr = gelf_getehdr (elf, &ehdr_mem);
|
||||
+
|
||||
+ if (ehdr == NULL)
|
||||
+ return MIPS_ABI_LAST;
|
||||
+
|
||||
+ GElf_Word elf_flags = ehdr->e_flags;
|
||||
+
|
||||
+ /* Check elf_flags to see if it specifies the ABI being used. */
|
||||
+ switch ((elf_flags & EF_MIPS_ABI))
|
||||
+ {
|
||||
+ case E_MIPS_ABI_O32:
|
||||
+ return MIPS_ABI_O32;
|
||||
+ case E_MIPS_ABI_O64:
|
||||
+ return MIPS_ABI_O64;
|
||||
+ case E_MIPS_ABI_EABI32:
|
||||
+ return MIPS_ABI_EABI32;
|
||||
+ case E_MIPS_ABI_EABI64:
|
||||
+ return MIPS_ABI_EABI64;
|
||||
+ default:
|
||||
+ if ((elf_flags & EF_MIPS_ABI2))
|
||||
+ return MIPS_ABI_N32;
|
||||
+ }
|
||||
+
|
||||
+ /* GCC creates a pseudo-section whose name describes the ABI. */
|
||||
+ size_t shstrndx;
|
||||
+ if (elf_getshdrstrndx (elf, &shstrndx) < 0)
|
||||
+ return MIPS_ABI_LAST;
|
||||
+
|
||||
+ const char *name;
|
||||
+ Elf_Scn *scn = NULL;
|
||||
+ while ((scn = elf_nextscn (elf, scn)) != NULL)
|
||||
+ {
|
||||
+ GElf_Shdr shdr_mem;
|
||||
+ GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem);
|
||||
+ if (shdr == NULL)
|
||||
+ return MIPS_ABI_LAST;
|
||||
+
|
||||
+ name = elf_strptr (elf, shstrndx, shdr->sh_name) ?: "";
|
||||
+ if (strncmp (name, ".mdebug.", 8) != 0)
|
||||
+ continue;
|
||||
+
|
||||
+ if (strcmp (name, ".mdebug.abi32") == 0)
|
||||
+ return MIPS_ABI_O32;
|
||||
+ else if (strcmp (name, ".mdebug.abiN32") == 0)
|
||||
+ return MIPS_ABI_N32;
|
||||
+ else if (strcmp (name, ".mdebug.abi64") == 0)
|
||||
+ return MIPS_ABI_N64;
|
||||
+ else if (strcmp (name, ".mdebug.abiO64") == 0)
|
||||
+ return MIPS_ABI_O64;
|
||||
+ else if (strcmp (name, ".mdebug.eabi32") == 0)
|
||||
+ return MIPS_ABI_EABI32;
|
||||
+ else if (strcmp (name, ".mdebug.eabi64") == 0)
|
||||
+ return MIPS_ABI_EABI64;
|
||||
+ else
|
||||
+ return MIPS_ABI_UNKNOWN;
|
||||
+ }
|
||||
+
|
||||
+ return MIPS_ABI_UNKNOWN;
|
||||
+}
|
||||
+
|
||||
+unsigned int
|
||||
+mips_abi_regsize (enum mips_abi abi)
|
||||
+{
|
||||
+ switch (abi)
|
||||
+ {
|
||||
+ case MIPS_ABI_EABI32:
|
||||
+ case MIPS_ABI_O32:
|
||||
+ return 4;
|
||||
+ case MIPS_ABI_N32:
|
||||
+ case MIPS_ABI_N64:
|
||||
+ case MIPS_ABI_O64:
|
||||
+ case MIPS_ABI_EABI64:
|
||||
+ return 8;
|
||||
+ case MIPS_ABI_UNKNOWN:
|
||||
+ case MIPS_ABI_LAST:
|
||||
+ default:
|
||||
+ return 0;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+
|
||||
+/* $v0 or pair $v0, $v1 */
|
||||
+static const Dwarf_Op loc_intreg_o32[] =
|
||||
+ {
|
||||
+ { .atom = DW_OP_reg2 }, { .atom = DW_OP_piece, .number = 4 },
|
||||
+ { .atom = DW_OP_reg3 }, { .atom = DW_OP_piece, .number = 4 },
|
||||
+ };
|
||||
+
|
||||
+static const Dwarf_Op loc_intreg[] =
|
||||
+ {
|
||||
+ { .atom = DW_OP_reg2 }, { .atom = DW_OP_piece, .number = 8 },
|
||||
+ { .atom = DW_OP_reg3 }, { .atom = DW_OP_piece, .number = 8 },
|
||||
+ };
|
||||
+#define nloc_intreg 1
|
||||
+#define nloc_intregpair 4
|
||||
+
|
||||
+/* $f0 (float), or pair $f0, $f1 (double).
|
||||
+ * f2/f3 are used for COMPLEX (= 2 doubles) returns in Fortran */
|
||||
+static const Dwarf_Op loc_fpreg_o32[] =
|
||||
+ {
|
||||
+ { .atom = DW_OP_regx, .number = 32 }, { .atom = DW_OP_piece, .number = 4 },
|
||||
+ { .atom = DW_OP_regx, .number = 33 }, { .atom = DW_OP_piece, .number = 4 },
|
||||
+ { .atom = DW_OP_regx, .number = 34 }, { .atom = DW_OP_piece, .number = 4 },
|
||||
+ { .atom = DW_OP_regx, .number = 35 }, { .atom = DW_OP_piece, .number = 4 },
|
||||
+ };
|
||||
+
|
||||
+/* $f0, or pair $f0, $f2. */
|
||||
+static const Dwarf_Op loc_fpreg[] =
|
||||
+ {
|
||||
+ { .atom = DW_OP_regx, .number = 32 }, { .atom = DW_OP_piece, .number = 8 },
|
||||
+ { .atom = DW_OP_regx, .number = 34 }, { .atom = DW_OP_piece, .number = 8 },
|
||||
+ };
|
||||
+#define nloc_fpreg 1
|
||||
+#define nloc_fpregpair 4
|
||||
+#define nloc_fpregquad 8
|
||||
+
|
||||
+/* 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 $v0. */
|
||||
+static const Dwarf_Op loc_aggregate[] =
|
||||
+ {
|
||||
+ { .atom = DW_OP_breg2, .number = 0 }
|
||||
+ };
|
||||
+#define nloc_aggregate 1
|
||||
+
|
||||
+int
|
||||
+mips_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
|
||||
+{
|
||||
+ /* First find the ABI used by the elf object */
|
||||
+ enum mips_abi abi = find_mips_abi(functypedie->cu->dbg->elf);
|
||||
+
|
||||
+ /* Something went seriously wrong while trying to figure out the ABI */
|
||||
+ if (abi == MIPS_ABI_LAST)
|
||||
+ return -1;
|
||||
+
|
||||
+ /* We couldn't identify the ABI, but the file seems valid */
|
||||
+ if (abi == MIPS_ABI_UNKNOWN)
|
||||
+ return -2;
|
||||
+
|
||||
+ /* Can't handle EABI variants */
|
||||
+ if ((abi == MIPS_ABI_EABI32) || (abi == MIPS_ABI_EABI64))
|
||||
+ return -2;
|
||||
+
|
||||
+ unsigned int regsize = mips_abi_regsize (abi);
|
||||
+ if (!regsize)
|
||||
+ return -2;
|
||||
+
|
||||
+ /* 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:
|
||||
+ {
|
||||
+ Dwarf_Word size;
|
||||
+ 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 = regsize;
|
||||
+ 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;
|
||||
+
|
||||
+#define ABI_LOC(loc, regsize) ((regsize) == 4 ? (loc ## _o32) : (loc))
|
||||
+
|
||||
+ if (encoding == DW_ATE_float)
|
||||
+ {
|
||||
+ *locp = ABI_LOC(loc_fpreg, regsize);
|
||||
+ if (size <= regsize)
|
||||
+ return nloc_fpreg;
|
||||
+
|
||||
+ if (size <= 2*regsize)
|
||||
+ return nloc_fpregpair;
|
||||
+
|
||||
+ if (size <= 4*regsize && abi == MIPS_ABI_O32)
|
||||
+ return nloc_fpregquad;
|
||||
+
|
||||
+ goto aggregate;
|
||||
+ }
|
||||
+ }
|
||||
+ *locp = ABI_LOC(loc_intreg, regsize);
|
||||
+ if (size <= regsize)
|
||||
+ return nloc_intreg;
|
||||
+ if (size <= 2*regsize)
|
||||
+ return nloc_intregpair;
|
||||
+
|
||||
+ /* Else fall through. Shouldn't happen though (at least with gcc) */
|
||||
+ }
|
||||
+
|
||||
+ case DW_TAG_structure_type:
|
||||
+ case DW_TAG_class_type:
|
||||
+ case DW_TAG_union_type:
|
||||
+ case DW_TAG_array_type:
|
||||
+ aggregate:
|
||||
+ /* XXX TODO: Can't handle structure return with other ABI's yet :-/ */
|
||||
+ if ((abi != MIPS_ABI_O32) && (abi != MIPS_ABI_O64))
|
||||
+ return -2;
|
||||
+
|
||||
+ *locp = loc_aggregate;
|
||||
+ return nloc_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;
|
||||
+}
|
||||
Index: elfutils-0.145/backends/mips_symbol.c
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ elfutils-0.145/backends/mips_symbol.c 2010-02-24 18:57:35.000000000 +0000
|
||||
@@ -0,0 +1,52 @@
|
||||
+/* MIPS specific symbolic name handling.
|
||||
+ Copyright (C) 2002, 2003, 2005 Red Hat, Inc.
|
||||
+ This file is part of Red Hat elfutils.
|
||||
+ Written by Jakub Jelinek <jakub@redhat.com>, 2002.
|
||||
+
|
||||
+ 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 <elf.h>
|
||||
+#include <stddef.h>
|
||||
+
|
||||
+#define BACKEND mips_
|
||||
+#include "libebl_CPU.h"
|
||||
+
|
||||
+/* Check for the simple reloc types. */
|
||||
+Elf_Type
|
||||
+mips_reloc_simple_type (Ebl *ebl __attribute__ ((unused)), int type)
|
||||
+{
|
||||
+ switch (type)
|
||||
+ {
|
||||
+ case R_MIPS_16:
|
||||
+ return ELF_T_HALF;
|
||||
+ case R_MIPS_32:
|
||||
+ return ELF_T_WORD;
|
||||
+ case R_MIPS_64:
|
||||
+ return ELF_T_XWORD;
|
||||
+ default:
|
||||
+ return ELF_T_NUM;
|
||||
+ }
|
||||
+}
|
||||
Index: elfutils-0.145/libebl/eblopenbackend.c
|
||||
===================================================================
|
||||
--- elfutils-0.145.orig/libebl/eblopenbackend.c 2010-02-24 18:55:51.000000000 +0000
|
||||
+++ elfutils-0.145/libebl/eblopenbackend.c 2010-02-24 18:57:35.000000000 +0000
|
||||
@@ -91,6 +91,8 @@
|
||||
{ "sparc", "elf_sparc", "sparc", 5, EM_SPARC, 0, 0 },
|
||||
{ "sparc", "elf_sparcv8plus", "sparc", 5, EM_SPARC32PLUS, 0, 0 },
|
||||
{ "s390", "ebl_s390", "s390", 4, EM_S390, 0, 0 },
|
||||
+ { "mips", "elf_mips", "mips", 4, EM_MIPS, 0, 0 },
|
||||
+ { "mips", "elf_mipsel", "mipsel", 4, EM_MIPS_RS3_LE, 0, 0 },
|
||||
|
||||
{ "m32", "elf_m32", "m32", 3, EM_M32, 0, 0 },
|
||||
{ "m68k", "elf_m68k", "m68k", 4, EM_68K, 0, 0 },
|
||||
Index: elfutils-0.145/backends/common-reloc.c
|
||||
===================================================================
|
||||
--- elfutils-0.145.orig/backends/common-reloc.c 2010-02-24 18:55:51.000000000 +0000
|
||||
+++ elfutils-0.145/backends/common-reloc.c 2010-02-24 18:57:35.000000000 +0000
|
||||
@@ -109,11 +109,13 @@
|
||||
}
|
||||
|
||||
|
||||
+#ifndef NO_COPY_RELOC
|
||||
bool
|
||||
EBLHOOK(copy_reloc_p) (int reloc)
|
||||
{
|
||||
return reloc == R_TYPE (COPY);
|
||||
}
|
||||
+#endif
|
||||
|
||||
bool
|
||||
EBLHOOK(none_reloc_p) (int reloc)
|
||||
@@ -135,7 +137,9 @@
|
||||
ebl->reloc_type_name = EBLHOOK(reloc_type_name);
|
||||
ebl->reloc_type_check = EBLHOOK(reloc_type_check);
|
||||
ebl->reloc_valid_use = EBLHOOK(reloc_valid_use);
|
||||
+#ifndef NO_COPY_RELOC
|
||||
ebl->copy_reloc_p = EBLHOOK(copy_reloc_p);
|
||||
+#endif
|
||||
ebl->none_reloc_p = EBLHOOK(none_reloc_p);
|
||||
#ifndef NO_RELATIVE_RELOC
|
||||
ebl->relative_reloc_p = EBLHOOK(relative_reloc_p);
|
||||
Index: elfutils-0.145/backends/Makefile.am
|
||||
===================================================================
|
||||
--- elfutils-0.145.orig/backends/Makefile.am 2010-02-24 18:57:26.000000000 +0000
|
||||
+++ elfutils-0.145/backends/Makefile.am 2010-02-24 18:57:57.000000000 +0000
|
||||
@@ -29,11 +29,11 @@
|
||||
-I$(top_srcdir)/libelf -I$(top_srcdir)/libdw
|
||||
|
||||
|
||||
-modules = i386 sh x86_64 ia64 alpha arm sparc ppc ppc64 s390 parisc
|
||||
+modules = i386 sh x86_64 ia64 alpha arm sparc ppc ppc64 s390 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_parisc_pic.a
|
||||
+ libebl_s390_pic.a libebl_parisc_pic.a libebl_mips_pic.a
|
||||
noinst_LIBRARIES = $(libebl_pic)
|
||||
noinst_DATA = $(libebl_pic:_pic.a=.so)
|
||||
|
||||
@@ -99,6 +99,10 @@
|
||||
libebl_parisc_pic_a_SOURCES = $(parisc_SRCS)
|
||||
am_libebl_parisc_pic_a_OBJECTS = $(parisc_SRCS:.c=.os)
|
||||
|
||||
+mips_SRCS = mips_init.c mips_symbol.c mips_regs.c mips_retval.c
|
||||
+libebl_mips_pic_a_SOURCES = $(mips_SRCS)
|
||||
+am_libebl_mips_pic_a_OBJECTS = $(mips_SRCS:.c=.os)
|
||||
+
|
||||
libebl_%.so libebl_%.map: libebl_%_pic.a $(libelf) $(libdw)
|
||||
@rm -f $(@:.so=.map)
|
||||
echo 'ELFUTILS_$(PACKAGE_VERSION) { global: $*_init; local: *; };' \
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
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.148/src/nm.c.org 2013-03-11 22:36:11.000000000 -0500
|
||||
+++ elfutils-0.148/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;
|
||||
@@ -0,0 +1,756 @@
|
||||
Upstream-Status: Backport
|
||||
|
||||
Index: elfutils-0.148/backends/ChangeLog
|
||||
===================================================================
|
||||
--- elfutils-0.148.orig/backends/ChangeLog 2010-04-13 20:08:02.000000000 +0000
|
||||
+++ elfutils-0.148/backends/ChangeLog 2010-07-03 13:04:07.000000000 +0000
|
||||
@@ -106,6 +106,10 @@
|
||||
* ppc_attrs.c (ppc_check_object_attribute): Handle tag
|
||||
GNU_Power_ABI_Struct_Return.
|
||||
|
||||
+2009-01-23 Roland McGrath <roland@redhat.com>
|
||||
+
|
||||
+ * Makefile.am (libebl_%.so): Use $(LD_AS_NEEDED).
|
||||
+
|
||||
2008-10-04 Ulrich Drepper <drepper@redhat.com>
|
||||
|
||||
* i386_reloc.def: Fix entries for TLS_GOTDESC, TLS_DESC_CALL, and
|
||||
@@ -433,6 +437,11 @@
|
||||
* sparc_init.c: Likewise.
|
||||
* x86_64_init.c: Likewise.
|
||||
|
||||
+2005-11-22 Roland McGrath <roland@redhat.com>
|
||||
+
|
||||
+ * Makefile.am (LD_AS_NEEDED): New variable, substituted by configure.
|
||||
+ (libebl_%.so rule): Use it in place of -Wl,--as-needed.
|
||||
+
|
||||
2005-11-19 Roland McGrath <roland@redhat.com>
|
||||
|
||||
* ppc64_reloc.def: REL30 -> ADDR30.
|
||||
@@ -455,6 +464,9 @@
|
||||
* Makefile.am (uninstall): Don't try to remove $(pkgincludedir).
|
||||
(CLEANFILES): Add libebl_$(m).so.
|
||||
|
||||
+ * Makefile.am (WEXTRA): New variable, substituted by configure.
|
||||
+ (AM_CFLAGS): Use it in place of -Wextra.
|
||||
+
|
||||
* ppc_reloc.def: Update bits per Alan Modra <amodra@bigpond.net.au>.
|
||||
* ppc64_reloc.def: Likewise.
|
||||
|
||||
Index: elfutils-0.148/backends/Makefile.am
|
||||
===================================================================
|
||||
--- elfutils-0.148.orig/backends/Makefile.am 2010-04-13 20:08:02.000000000 +0000
|
||||
+++ elfutils-0.148/backends/Makefile.am 2010-07-03 13:04:07.000000000 +0000
|
||||
@@ -103,7 +103,7 @@
|
||||
$(LINK) -shared -o $(@:.map=.so) \
|
||||
-Wl,--whole-archive $< $(cpu_$*) -Wl,--no-whole-archive \
|
||||
-Wl,--version-script,$(@:.so=.map) \
|
||||
- -Wl,-z,defs -Wl,--as-needed $(libelf) $(libdw) $(libmudflap)
|
||||
+ -Wl,-z,defs $(LD_AS_NEEDED) $(libelf) $(libdw) $(libmudflap)
|
||||
$(textrel_check)
|
||||
|
||||
libebl_i386.so: $(cpu_i386)
|
||||
Index: elfutils-0.148/ChangeLog
|
||||
===================================================================
|
||||
--- elfutils-0.148.orig/ChangeLog 2010-04-21 14:26:40.000000000 +0000
|
||||
+++ elfutils-0.148/ChangeLog 2010-07-03 13:04:07.000000000 +0000
|
||||
@@ -2,6 +2,10 @@
|
||||
|
||||
* configure.ac (LOCALEDIR, DATADIRNAME): Removed.
|
||||
|
||||
+2009-11-22 Roland McGrath <roland@redhat.com>
|
||||
+
|
||||
+ * configure.ac: Use sed and expr instead of modern bash extensions.
|
||||
+
|
||||
2009-09-21 Ulrich Drepper <drepper@redhat.com>
|
||||
|
||||
* configure.ac: Update for more modern autoconf.
|
||||
@@ -10,6 +14,10 @@
|
||||
|
||||
* configure.ac (zip_LIBS): Check for liblzma too.
|
||||
|
||||
+2009-08-17 Roland McGrath <roland@redhat.com>
|
||||
+
|
||||
+ * configure.ac: Check for -fgnu89-inline; add it to WEXTRA if it works.
|
||||
+
|
||||
2009-04-19 Roland McGrath <roland@redhat.com>
|
||||
|
||||
* configure.ac (eu_version): Round down here, not in version.h macros.
|
||||
@@ -21,6 +29,8 @@
|
||||
|
||||
2009-01-23 Roland McGrath <roland@redhat.com>
|
||||
|
||||
+ * configure.ac: Check for __builtin_popcount.
|
||||
+
|
||||
* configure.ac (zlib check): Check for gzdirect, need zlib >= 1.2.2.3.
|
||||
|
||||
* configure.ac (__thread check): Use AC_LINK_IFELSE, in case of
|
||||
@@ -101,6 +111,10 @@
|
||||
* configure.ac: Add dummy automake conditional to get dependencies
|
||||
for non-generic linker right. See src/Makefile.am.
|
||||
|
||||
+2005-11-22 Roland McGrath <roland@redhat.com>
|
||||
+
|
||||
+ * configure.ac: Check for --as-needed linker option.
|
||||
+
|
||||
2005-11-18 Roland McGrath <roland@redhat.com>
|
||||
|
||||
* Makefile.am (DISTCHECK_CONFIGURE_FLAGS): New variable.
|
||||
@@ -148,6 +162,17 @@
|
||||
* Makefile.am (all_SUBDIRS): Add libdwfl.
|
||||
* configure.ac: Write libdwfl/Makefile.
|
||||
|
||||
+2005-05-31 Roland McGrath <roland@redhat.com>
|
||||
+
|
||||
+ * configure.ac (WEXTRA): Check for -Wextra and set this substitution.
|
||||
+
|
||||
+ * configure.ac: Check for struct stat st_?tim members.
|
||||
+ * src/strip.c (process_file): Use st_?time if st_?tim are not there.
|
||||
+
|
||||
+ * configure.ac: Check for futimes function.
|
||||
+ * src/strip.c (handle_elf) [! HAVE_FUTIMES]: Use utimes instead.
|
||||
+ (handle_ar) [! HAVE_FUTIMES]: Likewise.
|
||||
+
|
||||
2005-05-19 Roland McGrath <roland@redhat.com>
|
||||
|
||||
* configure.ac [AH_BOTTOM] (INTDECL, _INTDECL): New macros.
|
||||
Index: elfutils-0.148/config/eu.am
|
||||
===================================================================
|
||||
--- elfutils-0.148.orig/config/eu.am 2010-04-21 14:26:40.000000000 +0000
|
||||
+++ elfutils-0.148/config/eu.am 2010-07-03 13:04:07.000000000 +0000
|
||||
@@ -25,11 +25,14 @@
|
||||
## <http://www.openinventionnetwork.com>.
|
||||
##
|
||||
|
||||
+WEXTRA = @WEXTRA@
|
||||
+LD_AS_NEEDED = @LD_AS_NEEDED@
|
||||
+
|
||||
DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H -DLOCALEDIR='"${localedir}"'
|
||||
INCLUDES = -I. -I$(srcdir) -I$(top_srcdir)/lib -I..
|
||||
AM_CFLAGS = -std=gnu99 -Wall -Wshadow \
|
||||
$(if $($(*F)_no_Werror),,-Werror) \
|
||||
- $(if $($(*F)_no_Wunused),,-Wunused -Wextra) \
|
||||
+ $(if $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) \
|
||||
$(if $($(*F)_no_Wformat),-Wno-format,-Wformat=2) \
|
||||
$($(*F)_CFLAGS)
|
||||
|
||||
Index: elfutils-0.148/config.h.in
|
||||
===================================================================
|
||||
--- elfutils-0.148.orig/config.h.in 2010-06-28 19:07:37.000000000 +0000
|
||||
+++ elfutils-0.148/config.h.in 2010-07-03 13:04:07.000000000 +0000
|
||||
@@ -1,5 +1,8 @@
|
||||
/* config.h.in. Generated from configure.ac by autoheader. */
|
||||
|
||||
+/* Have __builtin_popcount. */
|
||||
+#undef HAVE_BUILTIN_POPCOUNT
|
||||
+
|
||||
/* $libdir subdirectory containing libebl modules. */
|
||||
#undef LIBEBL_SUBDIR
|
||||
|
||||
@@ -55,4 +58,7 @@
|
||||
/* Define for large files, on AIX-style hosts. */
|
||||
#undef _LARGE_FILES
|
||||
|
||||
+/* Stubbed out if missing compiler support. */
|
||||
+#undef __thread
|
||||
+
|
||||
#include <eu-config.h>
|
||||
Index: elfutils-0.148/configure.ac
|
||||
===================================================================
|
||||
--- elfutils-0.148.orig/configure.ac 2010-06-28 19:07:26.000000000 +0000
|
||||
+++ elfutils-0.148/configure.ac 2010-07-03 13:04:07.000000000 +0000
|
||||
@@ -73,6 +73,54 @@
|
||||
AS_IF([test "x$ac_cv_c99" != xyes],
|
||||
AC_MSG_ERROR([gcc with C99 support required]))
|
||||
|
||||
+AC_CACHE_CHECK([for -Wextra option to $CC], ac_cv_cc_wextra, [dnl
|
||||
+old_CFLAGS="$CFLAGS"
|
||||
+CFLAGS="$CFLAGS -Wextra"
|
||||
+AC_COMPILE_IFELSE([void foo (void) { }],
|
||||
+ ac_cv_cc_wextra=yes, ac_cv_cc_wextra=no)
|
||||
+CFLAGS="$old_CFLAGS"])
|
||||
+AC_SUBST(WEXTRA)
|
||||
+AS_IF([test "x$ac_cv_cc_wextra" = xyes], [WEXTRA=-Wextra], [WEXTRA=-W])
|
||||
+
|
||||
+AC_CACHE_CHECK([for -fgnu89-inline option to $CC], ac_cv_cc_gnu89_inline, [dnl
|
||||
+old_CFLAGS="$CFLAGS"
|
||||
+CFLAGS="$CFLAGS -fgnu89-inline -Werror"
|
||||
+AC_COMPILE_IFELSE([
|
||||
+void foo (void)
|
||||
+{
|
||||
+ inline void bar (void) {}
|
||||
+ bar ();
|
||||
+}
|
||||
+extern inline void baz (void) {}
|
||||
+], ac_cv_cc_gnu89_inline=yes, ac_cv_cc_gnu89_inline=no)
|
||||
+CFLAGS="$old_CFLAGS"])
|
||||
+AS_IF([test "x$ac_cv_cc_gnu89_inline" = xyes],
|
||||
+ [WEXTRA="${WEXTRA:+$WEXTRA }-fgnu89-inline"])
|
||||
+
|
||||
+AC_CACHE_CHECK([for --as-needed linker option],
|
||||
+ ac_cv_as_needed, [dnl
|
||||
+cat > conftest.c <<EOF
|
||||
+int main (void) { return 0; }
|
||||
+EOF
|
||||
+if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
|
||||
+ -fPIC -shared -o conftest.so conftest.c
|
||||
+ -Wl,--as-needed 1>&AS_MESSAGE_LOG_FD])
|
||||
+then
|
||||
+ ac_cv_as_needed=yes
|
||||
+else
|
||||
+ ac_cv_as_needed=no
|
||||
+fi
|
||||
+rm -f conftest*])
|
||||
+AS_IF([test "x$ac_cv_as_needed" = xyes],
|
||||
+ [LD_AS_NEEDED=-Wl,--as-needed], [LD_AS_NEEDED=])
|
||||
+AC_SUBST(LD_AS_NEEDED)
|
||||
+
|
||||
+AC_CACHE_CHECK([for __builtin_popcount], ac_cv_popcount, [dnl
|
||||
+AC_LINK_IFELSE([AC_LANG_PROGRAM([], [[exit (__builtin_popcount (127));]])],
|
||||
+ ac_cv_popcount=yes, ac_cv_popcount=no)])
|
||||
+AS_IF([test "x$ac_cv_popcount" = xyes],
|
||||
+ [AC_DEFINE([HAVE_BUILTIN_POPCOUNT], [1], [Have __builtin_popcount.])])
|
||||
+
|
||||
AC_CACHE_CHECK([for __thread support], ac_cv_tls, [dnl
|
||||
# Use the same flags that we use for our DSOs, so the test is representative.
|
||||
# Some old compiler/linker/libc combinations fail some ways and not others.
|
||||
@@ -88,7 +136,10 @@
|
||||
CFLAGS="$save_CFLAGS"
|
||||
LDFLAGS="$save_LDFLAGS"])
|
||||
AS_IF([test "x$ac_cv_tls" != xyes],
|
||||
- AC_MSG_ERROR([__thread support required]))
|
||||
+ [AS_IF([test "$use_locks" = yes],
|
||||
+ [AC_MSG_ERROR([--enable-thread-safety requires __thread support])],
|
||||
+ [AC_DEFINE([__thread], [/* empty: no multi-thread support */],
|
||||
+ [Stubbed out if missing compiler support.])])])
|
||||
|
||||
dnl This test must come as early as possible after the compiler configuration
|
||||
dnl tests, because the choice of the file model can (in principle) affect
|
||||
@@ -251,7 +302,7 @@
|
||||
|
||||
# 1.234<whatever> -> 1234<whatever>
|
||||
case "$PACKAGE_VERSION" in
|
||||
-[[0-9]].*) eu_version="${PACKAGE_VERSION/./}" ;;
|
||||
+[[0-9]].*) eu_version=`echo "$PACKAGE_VERSION" | sed 's@\.@@'` ;;
|
||||
*) AC_MSG_ERROR([confused by version number '$PACKAGE_VERSION']) ;;
|
||||
esac
|
||||
case "$eu_version" in
|
||||
@@ -280,6 +331,6 @@
|
||||
esac
|
||||
|
||||
# Round up to the next release API (x.y) version.
|
||||
-[eu_version=$[($eu_version + 999) / 1000]]
|
||||
+eu_version=`expr \( $eu_version + 999 \) / 1000`
|
||||
|
||||
AC_OUTPUT
|
||||
Index: elfutils-0.148/lib/ChangeLog
|
||||
===================================================================
|
||||
--- elfutils-0.148.orig/lib/ChangeLog 2010-06-28 19:05:56.000000000 +0000
|
||||
+++ elfutils-0.148/lib/ChangeLog 2010-07-03 13:04:07.000000000 +0000
|
||||
@@ -14,6 +14,9 @@
|
||||
|
||||
2009-01-23 Roland McGrath <roland@redhat.com>
|
||||
|
||||
+ * eu-config.h [! HAVE_BUILTIN_POPCOUNT]
|
||||
+ (__builtin_popcount): New inline function.
|
||||
+
|
||||
* eu-config.h: Add multiple inclusion protection.
|
||||
|
||||
2009-01-17 Ulrich Drepper <drepper@redhat.com>
|
||||
@@ -70,6 +73,11 @@
|
||||
* Makefile.am (libeu_a_SOURCES): Add it.
|
||||
* system.h: Declare crc32_file.
|
||||
|
||||
+2005-02-07 Roland McGrath <roland@redhat.com>
|
||||
+
|
||||
+ * Makefile.am (WEXTRA): New variable, substituted by configure.
|
||||
+ (AM_CFLAGS): Use it in place of -Wextra.
|
||||
+
|
||||
2005-04-30 Ulrich Drepper <drepper@redhat.com>
|
||||
|
||||
* Makefile.am: Use -ffunction-sections for xmalloc.c.
|
||||
Index: elfutils-0.148/lib/eu-config.h
|
||||
===================================================================
|
||||
--- elfutils-0.148.orig/lib/eu-config.h 2009-08-12 14:23:22.000000000 +0000
|
||||
+++ elfutils-0.148/lib/eu-config.h 2010-07-03 13:04:07.000000000 +0000
|
||||
@@ -182,6 +182,17 @@
|
||||
/* This macro is used by the tests conditionalize for standalone building. */
|
||||
#define ELFUTILS_HEADER(name) <lib##name.h>
|
||||
|
||||
+#ifndef HAVE_BUILTIN_POPCOUNT
|
||||
+# define __builtin_popcount hakmem_popcount
|
||||
+static inline unsigned int __attribute__ ((unused))
|
||||
+hakmem_popcount (unsigned int x)
|
||||
+{
|
||||
+ /* HAKMEM 169 */
|
||||
+ unsigned int n = x - ((x >> 1) & 033333333333) - ((x >> 2) & 011111111111);
|
||||
+ return ((n + (n >> 3)) & 030707070707) % 63;
|
||||
+}
|
||||
+#endif /* HAVE_BUILTIN_POPCOUNT */
|
||||
+
|
||||
|
||||
#ifdef SHARED
|
||||
# define OLD_VERSION(name, version) \
|
||||
Index: elfutils-0.148/libasm/ChangeLog
|
||||
===================================================================
|
||||
--- elfutils-0.148.orig/libasm/ChangeLog 2010-03-05 05:48:23.000000000 +0000
|
||||
+++ elfutils-0.148/libasm/ChangeLog 2010-07-03 13:04:07.000000000 +0000
|
||||
@@ -67,6 +67,11 @@
|
||||
* asm_error.c: Add new error ASM_E_IOERROR.
|
||||
* libasmP.h: Add ASM_E_IOERROR definition.
|
||||
|
||||
+2005-05-31 Roland McGrath <roland@redhat.com>
|
||||
+
|
||||
+ * Makefile.am (WEXTRA): New variable, substituted by configure.
|
||||
+ (AM_CFLAGS): Use it in place of -Wextra.
|
||||
+
|
||||
2005-02-15 Ulrich Drepper <drepper@redhat.com>
|
||||
|
||||
* Makefile.am (AM_CFLAGS): Add -Wunused -Wextra -Wformat=2.
|
||||
Index: elfutils-0.148/libcpu/ChangeLog
|
||||
===================================================================
|
||||
--- elfutils-0.148.orig/libcpu/ChangeLog 2010-03-05 05:48:23.000000000 +0000
|
||||
+++ elfutils-0.148/libcpu/ChangeLog 2010-07-03 13:04:07.000000000 +0000
|
||||
@@ -9,6 +9,9 @@
|
||||
|
||||
2009-01-23 Roland McGrath <roland@redhat.com>
|
||||
|
||||
+ * i386_disasm.c (i386_disasm): Add abort after assert-constant for old
|
||||
+ compilers that don't realize it's noreturn.
|
||||
+
|
||||
* Makefile.am (i386_parse_CFLAGS): Use quotes around command
|
||||
substitution that can produce leading whitespace.
|
||||
|
||||
@@ -338,6 +341,11 @@
|
||||
* defs/i386.doc: New file.
|
||||
* defs/x86_64: New file.
|
||||
|
||||
+2005-04-04 Roland McGrath <roland@redhat.com>
|
||||
+
|
||||
+ * Makefile.am (WEXTRA): New variable, substituted by configure.
|
||||
+ (AM_CFLAGS): Use it instead of -Wextra.
|
||||
+
|
||||
2005-02-15 Ulrich Drepper <drepper@redhat.com>
|
||||
|
||||
* Makefile (AM_CFLAGS): Add -Wunused -Wextra -Wformat=2.
|
||||
Index: elfutils-0.148/libcpu/i386_disasm.c
|
||||
===================================================================
|
||||
--- elfutils-0.148.orig/libcpu/i386_disasm.c 2009-01-08 20:56:36.000000000 +0000
|
||||
+++ elfutils-0.148/libcpu/i386_disasm.c 2010-07-03 13:04:07.000000000 +0000
|
||||
@@ -791,6 +791,7 @@
|
||||
|
||||
default:
|
||||
assert (! "INVALID not handled");
|
||||
+ abort ();
|
||||
}
|
||||
}
|
||||
else
|
||||
Index: elfutils-0.148/libdw/ChangeLog
|
||||
===================================================================
|
||||
--- elfutils-0.148.orig/libdw/ChangeLog 2010-06-28 19:05:56.000000000 +0000
|
||||
+++ elfutils-0.148/libdw/ChangeLog 2010-07-03 13:04:07.000000000 +0000
|
||||
@@ -276,6 +276,10 @@
|
||||
|
||||
* dwarf_hasattr_integrate.c: Integrate DW_AT_specification too.
|
||||
|
||||
+2009-08-17 Roland McGrath <roland@redhat.com>
|
||||
+
|
||||
+ * libdw.h: Disable extern inlines for GCC 4.2.
|
||||
+
|
||||
2009-08-10 Roland McGrath <roland@redhat.com>
|
||||
|
||||
* dwarf_getscopevar.c: Use dwarf_diename.
|
||||
@@ -1044,6 +1048,11 @@
|
||||
|
||||
2005-05-31 Roland McGrath <roland@redhat.com>
|
||||
|
||||
+ * Makefile.am (WEXTRA): New variable, substituted by configure.
|
||||
+ (AM_CFLAGS): Use it in place of -Wextra.
|
||||
+
|
||||
+2005-05-31 Roland McGrath <roland@redhat.com>
|
||||
+
|
||||
* dwarf_formref_die.c (dwarf_formref_die): Add CU header offset to
|
||||
formref offset.
|
||||
|
||||
Index: elfutils-0.148/libdw/libdw.h
|
||||
===================================================================
|
||||
--- elfutils-0.148.orig/libdw/libdw.h 2010-06-28 19:05:56.000000000 +0000
|
||||
+++ elfutils-0.148/libdw/libdw.h 2010-07-03 13:04:07.000000000 +0000
|
||||
@@ -842,7 +842,7 @@
|
||||
|
||||
|
||||
/* Inline optimizations. */
|
||||
-#ifdef __OPTIMIZE__
|
||||
+#if defined __OPTIMIZE__ && !(__GNUC__ == 4 && __GNUC_MINOR__ == 2)
|
||||
/* Return attribute code of given attribute. */
|
||||
__libdw_extern_inline unsigned int
|
||||
dwarf_whatattr (Dwarf_Attribute *attr)
|
||||
Index: elfutils-0.148/libdwfl/ChangeLog
|
||||
===================================================================
|
||||
--- elfutils-0.148.orig/libdwfl/ChangeLog 2010-06-28 19:05:56.000000000 +0000
|
||||
+++ elfutils-0.148/libdwfl/ChangeLog 2010-07-03 13:04:07.000000000 +0000
|
||||
@@ -1265,6 +1265,11 @@
|
||||
|
||||
2005-07-21 Roland McGrath <roland@redhat.com>
|
||||
|
||||
+ * Makefile.am (WEXTRA): New variable, substituted by configure.
|
||||
+ (AM_CFLAGS): Use it in place of -Wextra.
|
||||
+
|
||||
+2005-07-21 Roland McGrath <roland@redhat.com>
|
||||
+
|
||||
* Makefile.am (noinst_HEADERS): Add loc2c.c.
|
||||
|
||||
* test2.c (main): Check sscanf result to quiet warning.
|
||||
Index: elfutils-0.148/libebl/ChangeLog
|
||||
===================================================================
|
||||
--- elfutils-0.148.orig/libebl/ChangeLog 2010-03-05 05:48:23.000000000 +0000
|
||||
+++ elfutils-0.148/libebl/ChangeLog 2010-07-03 13:04:07.000000000 +0000
|
||||
@@ -624,6 +624,11 @@
|
||||
* Makefile.am (libebl_*_so_SOURCES): Set to $(*_SRCS) so dependency
|
||||
tracking works right.
|
||||
|
||||
+2005-05-31 Roland McGrath <roland@redhat.com>
|
||||
+
|
||||
+ * Makefile.am (WEXTRA): New variable, substituted by configure.
|
||||
+ (AM_CFLAGS): Use it in place of -Wextra.
|
||||
+
|
||||
2005-05-21 Ulrich Drepper <drepper@redhat.com>
|
||||
|
||||
* libebl_x86_64.map: Add x86_64_core_note.
|
||||
Index: elfutils-0.148/libelf/ChangeLog
|
||||
===================================================================
|
||||
--- elfutils-0.148.orig/libelf/ChangeLog 2010-06-14 21:17:20.000000000 +0000
|
||||
+++ elfutils-0.148/libelf/ChangeLog 2010-07-03 13:04:07.000000000 +0000
|
||||
@@ -657,6 +657,11 @@
|
||||
|
||||
* elf.h: Update from glibc.
|
||||
|
||||
+2005-05-31 Roland McGrath <roland@redhat.com>
|
||||
+
|
||||
+ * Makefile.am (WEXTRA): New variable, substituted by configure.
|
||||
+ (AM_CFLAGS): Use it in place of -Wextra.
|
||||
+
|
||||
2005-05-08 Roland McGrath <roland@redhat.com>
|
||||
|
||||
* elf_begin.c (read_file) [_MUDFLAP]: Don't use mmap for now.
|
||||
Index: elfutils-0.148/libelf/common.h
|
||||
===================================================================
|
||||
--- elfutils-0.148.orig/libelf/common.h 2009-01-08 20:56:36.000000000 +0000
|
||||
+++ elfutils-0.148/libelf/common.h 2010-07-03 13:04:07.000000000 +0000
|
||||
@@ -160,7 +160,7 @@
|
||||
(Var) = (sizeof (Var) == 1 \
|
||||
? (unsigned char) (Var) \
|
||||
: (sizeof (Var) == 2 \
|
||||
- ? bswap_16 (Var) \
|
||||
+ ? (unsigned short int) bswap_16 (Var) \
|
||||
: (sizeof (Var) == 4 \
|
||||
? bswap_32 (Var) \
|
||||
: bswap_64 (Var))))
|
||||
@@ -169,7 +169,7 @@
|
||||
(Dst) = (sizeof (Var) == 1 \
|
||||
? (unsigned char) (Var) \
|
||||
: (sizeof (Var) == 2 \
|
||||
- ? bswap_16 (Var) \
|
||||
+ ? (unsigned short int) bswap_16 (Var) \
|
||||
: (sizeof (Var) == 4 \
|
||||
? bswap_32 (Var) \
|
||||
: bswap_64 (Var))))
|
||||
Index: elfutils-0.148/src/addr2line.c
|
||||
===================================================================
|
||||
--- elfutils-0.148.orig/src/addr2line.c 2010-05-28 14:38:30.000000000 +0000
|
||||
+++ elfutils-0.148/src/addr2line.c 2010-07-03 13:05:40.000000000 +0000
|
||||
@@ -447,10 +447,10 @@
|
||||
bool parsed = false;
|
||||
int i, j;
|
||||
char *name = NULL;
|
||||
- if (sscanf (string, "(%m[^)])%" PRIiMAX "%n", &name, &addr, &i) == 2
|
||||
+ if (sscanf (string, "(%a[^)])%" PRIiMAX "%n", &name, &addr, &i) == 2
|
||||
&& string[i] == '\0')
|
||||
parsed = adjust_to_section (name, &addr, dwfl);
|
||||
- switch (sscanf (string, "%m[^-+]%n%" PRIiMAX "%n", &name, &i, &addr, &j))
|
||||
+ switch (sscanf (string, "%a[^-+]%n%" PRIiMAX "%n", &name, &i, &addr, &j))
|
||||
{
|
||||
default:
|
||||
break;
|
||||
Index: elfutils-0.148/src/ChangeLog
|
||||
===================================================================
|
||||
--- elfutils-0.148.orig/src/ChangeLog 2010-06-28 19:05:56.000000000 +0000
|
||||
+++ elfutils-0.148/src/ChangeLog 2010-07-03 13:04:08.000000000 +0000
|
||||
@@ -165,8 +165,16 @@
|
||||
* readelf.c (attr_callback): Use print_block only when we don't use
|
||||
print_ops.
|
||||
|
||||
+2009-08-17 Roland McGrath <roland@redhat.com>
|
||||
+
|
||||
+ * ld.h: Disable extern inlines for GCC 4.2.
|
||||
+
|
||||
2009-08-14 Roland McGrath <roland@redhat.com>
|
||||
|
||||
+ * strings.c (read_block): Conditionalize posix_fadvise use
|
||||
+ on [POSIX_FADV_SEQUENTIAL].
|
||||
+ From Petr Salinger <Petr.Salinger@seznam.cz>.
|
||||
+
|
||||
* ar.c (do_oper_extract): Use pathconf instead of statfs.
|
||||
|
||||
2009-08-01 Ulrich Drepper <drepper@redhat.com>
|
||||
@@ -330,6 +338,8 @@
|
||||
* readelf.c (print_debug_frame_section): Use t instead of j formats
|
||||
for ptrdiff_t OFFSET.
|
||||
|
||||
+ * addr2line.c (handle_address): Use %a instead of %m for compatibility.
|
||||
+
|
||||
2009-01-21 Ulrich Drepper <drepper@redhat.com>
|
||||
|
||||
* elflint.c (check_program_header): Fix typo in .eh_frame_hdr section
|
||||
@@ -513,6 +523,11 @@
|
||||
that matches its PT_LOAD's p_flags &~ PF_W. On sparc, PF_X really
|
||||
is valid in RELRO.
|
||||
|
||||
+2008-03-01 Roland McGrath <roland@redhat.com>
|
||||
+
|
||||
+ * readelf.c (dump_archive_index): Tweak portability hack
|
||||
+ to match [__GNUC__ < 4] too.
|
||||
+
|
||||
2008-02-29 Roland McGrath <roland@redhat.com>
|
||||
|
||||
* readelf.c (print_attributes): Add a cast.
|
||||
@@ -764,6 +779,8 @@
|
||||
|
||||
* readelf.c (hex_dump): Fix rounding error in whitespace calculation.
|
||||
|
||||
+ * Makefile.am (readelf_no_Werror): New variable.
|
||||
+
|
||||
2007-10-15 Roland McGrath <roland@redhat.com>
|
||||
|
||||
* make-debug-archive.in: New file.
|
||||
@@ -1203,6 +1220,10 @@
|
||||
* elflint.c (valid_e_machine): Add EM_ALPHA.
|
||||
Reported by Christian Aichinger <Greek0@gmx.net>.
|
||||
|
||||
+ * strings.c (map_file): Define POSIX_MADV_SEQUENTIAL to
|
||||
+ MADV_SEQUENTIAL if undefined. Don't call posix_madvise
|
||||
+ if neither is defined.
|
||||
+
|
||||
2006-08-08 Ulrich Drepper <drepper@redhat.com>
|
||||
|
||||
* elflint.c (check_dynamic): Don't require DT_HASH for DT_SYMTAB.
|
||||
@@ -1279,6 +1300,10 @@
|
||||
* Makefile.am: Add hacks to create dependency files for non-generic
|
||||
linker.
|
||||
|
||||
+2006-04-05 Roland McGrath <roland@redhat.com>
|
||||
+
|
||||
+ * strings.c (MAP_POPULATE): Define to 0 if undefined.
|
||||
+
|
||||
2006-06-12 Ulrich Drepper <drepper@redhat.com>
|
||||
|
||||
* ldgeneric.c (ld_generic_generate_sections): Don't create .interp
|
||||
@@ -1627,6 +1652,11 @@
|
||||
* readelf.c (print_debug_loc_section): Fix indentation for larger
|
||||
address size.
|
||||
|
||||
+2005-05-31 Roland McGrath <roland@redhat.com>
|
||||
+
|
||||
+ * Makefile.am (WEXTRA): New variable, substituted by configure.
|
||||
+ (AM_CFLAGS): Use it in place of -Wextra.
|
||||
+
|
||||
2005-05-30 Roland McGrath <roland@redhat.com>
|
||||
|
||||
* readelf.c (print_debug_line_section): Print section offset of each
|
||||
Index: elfutils-0.148/src/findtextrel.c
|
||||
===================================================================
|
||||
--- elfutils-0.148.orig/src/findtextrel.c 2009-02-11 01:12:59.000000000 +0000
|
||||
+++ elfutils-0.148/src/findtextrel.c 2010-07-03 13:04:08.000000000 +0000
|
||||
@@ -490,7 +490,11 @@
|
||||
|
||||
|
||||
static void
|
||||
-check_rel (size_t nsegments, struct segments segments[nsegments],
|
||||
+check_rel (size_t nsegments, struct segments segments[
|
||||
+#if __GNUC__ >= 4
|
||||
+ nsegments
|
||||
+#endif
|
||||
+ ],
|
||||
GElf_Addr addr, Elf *elf, Elf_Scn *symscn, Dwarf *dw,
|
||||
const char *fname, bool more_than_one, void **knownsrcs)
|
||||
{
|
||||
Index: elfutils-0.148/src/ld.h
|
||||
===================================================================
|
||||
--- elfutils-0.148.orig/src/ld.h 2009-06-13 22:39:51.000000000 +0000
|
||||
+++ elfutils-0.148/src/ld.h 2010-07-03 13:04:08.000000000 +0000
|
||||
@@ -1122,6 +1122,7 @@
|
||||
|
||||
/* Checked whether the symbol is undefined and referenced from a DSO. */
|
||||
extern bool linked_from_dso_p (struct scninfo *scninfo, size_t symidx);
|
||||
+#if defined __OPTIMIZE__ && !(__GNUC__ == 4 && __GNUC_MINOR__ == 2)
|
||||
#ifdef __GNUC_STDC_INLINE__
|
||||
__attribute__ ((__gnu_inline__))
|
||||
#endif
|
||||
@@ -1139,5 +1140,6 @@
|
||||
|
||||
return sym->defined && sym->in_dso;
|
||||
}
|
||||
+#endif /* Optimizing and not GCC 4.2. */
|
||||
|
||||
#endif /* ld.h */
|
||||
Index: elfutils-0.148/src/Makefile.am
|
||||
===================================================================
|
||||
--- elfutils-0.148.orig/src/Makefile.am 2010-03-05 05:48:23.000000000 +0000
|
||||
+++ elfutils-0.148/src/Makefile.am 2010-07-03 13:04:08.000000000 +0000
|
||||
@@ -99,6 +99,9 @@
|
||||
# XXX While the file is not finished, don't warn about this
|
||||
ldgeneric_no_Wunused = yes
|
||||
|
||||
+# Buggy old compilers.
|
||||
+readelf_no_Werror = yes
|
||||
+
|
||||
readelf_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl
|
||||
nm_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl
|
||||
size_LDADD = $(libelf) $(libeu) $(libmudflap)
|
||||
|
||||
Index: elfutils-0.148/src/readelf.c
|
||||
===================================================================
|
||||
--- elfutils-0.148.orig/src/readelf.c 2010-06-28 19:05:56.000000000 +0000
|
||||
+++ elfutils-0.148/src/readelf.c 2010-07-03 13:04:08.000000000 +0000
|
||||
@@ -7845,7 +7845,7 @@
|
||||
if (unlikely (elf_rand (elf, as_off) == 0)
|
||||
|| unlikely ((subelf = elf_begin (-1, ELF_C_READ_MMAP, elf))
|
||||
== NULL))
|
||||
-#if __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 7)
|
||||
+#if __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 7) || __GNUC__ < 4
|
||||
while (1)
|
||||
#endif
|
||||
error (EXIT_FAILURE, 0,
|
||||
Index: elfutils-0.148/src/strings.c
|
||||
===================================================================
|
||||
--- elfutils-0.148.orig/src/strings.c 2009-02-11 01:12:59.000000000 +0000
|
||||
+++ elfutils-0.148/src/strings.c 2010-07-03 13:04:08.000000000 +0000
|
||||
@@ -51,6 +51,10 @@
|
||||
|
||||
#include <system.h>
|
||||
|
||||
+#ifndef MAP_POPULATE
|
||||
+# define MAP_POPULATE 0
|
||||
+#endif
|
||||
+
|
||||
|
||||
/* Prototypes of local functions. */
|
||||
static int read_fd (int fd, const char *fname, off64_t fdlen);
|
||||
@@ -491,8 +495,13 @@
|
||||
fd, start_off);
|
||||
if (mem != MAP_FAILED)
|
||||
{
|
||||
+#if !defined POSIX_MADV_SEQUENTIAL && defined MADV_SEQUENTIAL
|
||||
+# define POSIX_MADV_SEQUENTIAL MADV_SEQUENTIAL
|
||||
+#endif
|
||||
+#ifdef POSIX_MADV_SEQUENTIAL
|
||||
/* We will go through the mapping sequentially. */
|
||||
(void) posix_madvise (mem, map_size, POSIX_MADV_SEQUENTIAL);
|
||||
+#endif
|
||||
break;
|
||||
}
|
||||
if (errno != EINVAL && errno != ENOMEM)
|
||||
@@ -586,9 +595,11 @@
|
||||
elfmap_off = from & ~(ps - 1);
|
||||
elfmap_base = elfmap = map_file (fd, elfmap_off, fdlen, &elfmap_size);
|
||||
|
||||
+#ifdef POSIX_FADV_SEQUENTIAL
|
||||
if (unlikely (elfmap == MAP_FAILED))
|
||||
/* Let the kernel know we are going to read everything in sequence. */
|
||||
(void) posix_fadvise (fd, 0, 0, POSIX_FADV_SEQUENTIAL);
|
||||
+#endif
|
||||
}
|
||||
|
||||
if (unlikely (elfmap == MAP_FAILED))
|
||||
Index: elfutils-0.148/src/strip.c
|
||||
===================================================================
|
||||
--- elfutils-0.148.orig/src/strip.c 2010-01-15 09:05:55.000000000 +0000
|
||||
+++ elfutils-0.148/src/strip.c 2010-07-03 13:04:08.000000000 +0000
|
||||
@@ -53,6 +53,12 @@
|
||||
#include <libebl.h>
|
||||
#include <system.h>
|
||||
|
||||
+#ifdef HAVE_FUTIMES
|
||||
+# define FUTIMES(fd, fname, tvp) futimes (fd, tvp)
|
||||
+#else
|
||||
+# define FUTIMES(fd, fname, tvp) utimes (fname, tvp)
|
||||
+#endif
|
||||
+
|
||||
|
||||
/* Name and version of program. */
|
||||
static void print_version (FILE *stream, struct argp_state *state);
|
||||
@@ -301,8 +307,18 @@
|
||||
|
||||
/* If we have to preserve the timestamp, we need it in the
|
||||
format utimes() understands. */
|
||||
+#ifdef HAVE_STRUCT_STAT_ST_ATIM
|
||||
TIMESPEC_TO_TIMEVAL (&tv[0], &pre_st.st_atim);
|
||||
+#else
|
||||
+ tv[0].tv_sec = pre_st.st_atime;
|
||||
+ tv[0].tv_usec = 0;
|
||||
+#endif
|
||||
+#ifdef HAVE_STRUCT_STAT_ST_MTIM
|
||||
TIMESPEC_TO_TIMEVAL (&tv[1], &pre_st.st_mtim);
|
||||
+#else
|
||||
+ tv[1].tv_sec = pre_st.st_atime;
|
||||
+ tv[1].tv_usec = 0;
|
||||
+#endif
|
||||
}
|
||||
|
||||
/* Open the file. */
|
||||
@@ -1747,7 +1763,7 @@
|
||||
/* If requested, preserve the timestamp. */
|
||||
if (tvp != NULL)
|
||||
{
|
||||
- if (futimes (fd, tvp) != 0)
|
||||
+ if (FUTIMES (fd, output_fname, tvp) != 0)
|
||||
{
|
||||
error (0, errno, gettext ("\
|
||||
cannot set access and modification date of '%s'"),
|
||||
@@ -1804,7 +1820,7 @@
|
||||
|
||||
if (tvp != NULL)
|
||||
{
|
||||
- if (unlikely (futimes (fd, tvp) != 0))
|
||||
+ if (unlikely (FUTIMES (fd, fname, tvp) != 0))
|
||||
{
|
||||
error (0, errno, gettext ("\
|
||||
cannot set access and modification date of '%s'"), fname);
|
||||
Index: elfutils-0.148/tests/ChangeLog
|
||||
===================================================================
|
||||
--- elfutils-0.148.orig/tests/ChangeLog 2010-06-28 19:05:56.000000000 +0000
|
||||
+++ elfutils-0.148/tests/ChangeLog 2010-07-03 13:04:08.000000000 +0000
|
||||
@@ -154,6 +154,8 @@
|
||||
|
||||
2008-01-21 Roland McGrath <roland@redhat.com>
|
||||
|
||||
+ * line2addr.c (main): Revert last change.
|
||||
+
|
||||
* testfile45.S.bz2: Add tests for cltq, cqto.
|
||||
* testfile45.expect.bz2: Adjust.
|
||||
|
||||
@@ -862,6 +864,11 @@
|
||||
* Makefile.am (TESTS): Add run-elflint-test.sh.
|
||||
(EXTRA_DIST): Add run-elflint-test.sh and testfile18.bz2.
|
||||
|
||||
+2005-05-31 Roland McGrath <roland@redhat.com>
|
||||
+
|
||||
+ * Makefile.am (WEXTRA): New variable, substituted by configure.
|
||||
+ (AM_CFLAGS): Use it in place of -Wextra.
|
||||
+
|
||||
2005-05-24 Ulrich Drepper <drepper@redhat.com>
|
||||
|
||||
* get-files.c (main): Use correct format specifier.
|
||||
Index: elfutils-0.148/tests/line2addr.c
|
||||
===================================================================
|
||||
--- elfutils-0.148.orig/tests/line2addr.c 2009-01-08 20:56:37.000000000 +0000
|
||||
+++ elfutils-0.148/tests/line2addr.c 2010-07-03 13:04:08.000000000 +0000
|
||||
@@ -132,7 +132,7 @@
|
||||
{
|
||||
struct args a = { .arg = argv[cnt] };
|
||||
|
||||
- switch (sscanf (a.arg, "%m[^:]:%d", &a.file, &a.line))
|
||||
+ switch (sscanf (a.arg, "%a[^:]:%d", &a.file, &a.line))
|
||||
{
|
||||
default:
|
||||
case 0:
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,154 @@
|
||||
Upstream-Status: Backport
|
||||
|
||||
Remove unused variables from the code to prevent -Werror causing a build
|
||||
failure on hosts with GCC 4.6.
|
||||
|
||||
These changes are all upstream so should not be required once we've updated
|
||||
to elfutils 0.152 or later. Therefore this patch consolidates several
|
||||
changes from elfutils upstream by Roland McGrath into a single file so that
|
||||
it's easier to remove later once we upgrade.
|
||||
Links to upstream gitweb of the consolidated commits follow:
|
||||
- http://git.fedorahosted.org/git?p=elfutils.git;a=commit;h=7094d00a169afb27e0323f8580e817798ae7c240
|
||||
- http://git.fedorahosted.org/git?p=elfutils.git;a=commit;h=fd992543185126eb0280c1ee0883e073020499b4
|
||||
- http://git.fedorahosted.org/git?p=elfutils.git;a=commit;h=4db89f04bb59327abd7a3b60e88f2e7e73c65c79
|
||||
- http://git.fedorahosted.org/git?p=elfutils.git;a=commit;h=8f6c1795ab9d41f03805eebd55767070ade55aac
|
||||
- http://git.fedorahosted.org/git?p=elfutils.git;a=commit;h=240784b48aa276822c5a61c9ad6a4355051ce259
|
||||
|
||||
Joshua Lock <josh@linux.intel.com> - 06/04/11
|
||||
|
||||
Index: elfutils-0.148/libasm/asm_newscn.c
|
||||
===================================================================
|
||||
--- elfutils-0.148.orig/libasm/asm_newscn.c
|
||||
+++ elfutils-0.148/libasm/asm_newscn.c
|
||||
@@ -162,7 +162,6 @@ asm_newscn (ctx, scnname, type, flags)
|
||||
GElf_Xword flags;
|
||||
{
|
||||
size_t scnname_len = strlen (scnname) + 1;
|
||||
- unsigned long int hval;
|
||||
AsmScn_t *result;
|
||||
|
||||
/* If no context is given there might be an earlier error. */
|
||||
@@ -180,8 +179,6 @@ asm_newscn (ctx, scnname, type, flags)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
- hval = elf_hash (scnname);
|
||||
-
|
||||
rwlock_wrlock (ctx->lock);
|
||||
|
||||
/* This is a new section. */
|
||||
Index: elfutils-0.148/src/elflint.c
|
||||
===================================================================
|
||||
--- elfutils-0.148.orig/src/elflint.c
|
||||
+++ elfutils-0.148/src/elflint.c
|
||||
@@ -707,9 +707,10 @@ section [%2d] '%s': symbol %zu: invalid
|
||||
{
|
||||
if (xndxdata == NULL)
|
||||
{
|
||||
- ERROR (gettext ("\
|
||||
+ if (!no_xndx_warned)
|
||||
+ ERROR (gettext ("\
|
||||
section [%2d] '%s': symbol %zu: too large section index but no extended section index section\n"),
|
||||
- idx, section_name (ebl, idx), cnt);
|
||||
+ idx, section_name (ebl, idx), cnt);
|
||||
no_xndx_warned = true;
|
||||
}
|
||||
else if (xndx < SHN_LORESERVE)
|
||||
@@ -1592,10 +1593,6 @@ check_dynamic (Ebl *ebl, GElf_Ehdr *ehdr
|
||||
[DT_STRSZ] = true,
|
||||
[DT_SYMENT] = true
|
||||
};
|
||||
- GElf_Addr reladdr = 0;
|
||||
- GElf_Word relsz = 0;
|
||||
- GElf_Addr pltreladdr = 0;
|
||||
- GElf_Word pltrelsz = 0;
|
||||
|
||||
memset (has_dt, '\0', sizeof (has_dt));
|
||||
memset (has_val_dt, '\0', sizeof (has_val_dt));
|
||||
@@ -1694,15 +1691,6 @@ section [%2d] '%s': entry %zu: level 2 t
|
||||
section [%2d] '%s': entry %zu: DT_PLTREL value must be DT_REL or DT_RELA\n"),
|
||||
idx, section_name (ebl, idx), cnt);
|
||||
|
||||
- if (dyn->d_tag == DT_REL)
|
||||
- reladdr = dyn->d_un.d_ptr;
|
||||
- if (dyn->d_tag == DT_RELSZ)
|
||||
- relsz = dyn->d_un.d_val;
|
||||
- if (dyn->d_tag == DT_JMPREL)
|
||||
- pltreladdr = dyn->d_un.d_ptr;
|
||||
- if (dyn->d_tag == DT_PLTRELSZ)
|
||||
- pltrelsz = dyn->d_un.d_val;
|
||||
-
|
||||
/* Check that addresses for entries are in loaded segments. */
|
||||
switch (dyn->d_tag)
|
||||
{
|
||||
Index: elfutils-0.148/src/ldgeneric.c
|
||||
===================================================================
|
||||
--- elfutils-0.148.orig/src/ldgeneric.c
|
||||
+++ elfutils-0.148/src/ldgeneric.c
|
||||
@@ -285,12 +285,10 @@ static int
|
||||
check_for_duplicate2 (struct usedfiles *newp, struct usedfiles *list)
|
||||
{
|
||||
struct usedfiles *first;
|
||||
- struct usedfiles *prevp;
|
||||
|
||||
if (list == NULL)
|
||||
return 0;
|
||||
|
||||
- prevp = list;
|
||||
list = first = list->next;
|
||||
do
|
||||
{
|
||||
Index: elfutils-0.148/src/ldscript.y
|
||||
===================================================================
|
||||
--- elfutils-0.148.orig/src/ldscript.y
|
||||
+++ elfutils-0.148/src/ldscript.y
|
||||
@@ -802,12 +802,9 @@ add_versions (struct version *versions)
|
||||
|
||||
do
|
||||
{
|
||||
- struct version *oldp;
|
||||
-
|
||||
add_id_list (versions->versionname, versions->local_names, true);
|
||||
add_id_list (versions->versionname, versions->global_names, false);
|
||||
|
||||
- oldp = versions;
|
||||
versions = versions->next;
|
||||
}
|
||||
while (versions != NULL);
|
||||
Index: elfutils-0.148/src/unstrip.c
|
||||
===================================================================
|
||||
--- elfutils-0.148.orig/src/unstrip.c
|
||||
+++ elfutils-0.148/src/unstrip.c
|
||||
@@ -1301,7 +1301,6 @@ more sections in stripped file than debu
|
||||
/* Match each debuginfo section with its corresponding stripped section. */
|
||||
bool check_prelink = false;
|
||||
Elf_Scn *unstripped_symtab = NULL;
|
||||
- size_t unstripped_strtab_ndx = SHN_UNDEF;
|
||||
size_t alloc_avail = 0;
|
||||
scn = NULL;
|
||||
while ((scn = elf_nextscn (unstripped, scn)) != NULL)
|
||||
@@ -1313,7 +1312,6 @@ more sections in stripped file than debu
|
||||
if (shdr->sh_type == SHT_SYMTAB)
|
||||
{
|
||||
unstripped_symtab = scn;
|
||||
- unstripped_strtab_ndx = shdr->sh_link;
|
||||
continue;
|
||||
}
|
||||
|
||||
Index: elfutils-0.148/src/ldscript.c
|
||||
===================================================================
|
||||
--- elfutils-0.148.orig/src/ldscript.c
|
||||
+++ elfutils-0.148/src/ldscript.c
|
||||
@@ -2728,12 +2728,9 @@ add_versions (struct version *versions)
|
||||
|
||||
do
|
||||
{
|
||||
- struct version *oldp;
|
||||
-
|
||||
add_id_list (versions->versionname, versions->local_names, true);
|
||||
add_id_list (versions->versionname, versions->global_names, false);
|
||||
|
||||
- oldp = versions;
|
||||
versions = versions->next;
|
||||
}
|
||||
while (versions != NULL);
|
||||
@@ -0,0 +1,21 @@
|
||||
Upstream-Status: Backport
|
||||
|
||||
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.128/tests/run-elflint-self.sh
|
||||
===================================================================
|
||||
--- elfutils-0.128.orig/tests/run-elflint-self.sh 2007-07-08 21:46:16.000000000 +0000
|
||||
+++ elfutils-0.128/tests/run-elflint-self.sh 2007-07-08 21:46:49.000000000 +0000
|
||||
@@ -32,7 +32,7 @@
|
||||
# echo $1
|
||||
if [ -f $1 ]; then
|
||||
testrun ../src/elflint --quiet --gnu-ld $1 ||
|
||||
- { echo "*** failure in $1"; status=1; }
|
||||
+ { echo "*** failure in $1"; status=77; }
|
||||
fi
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user