1
0
mirror of https://git.yoctoproject.org/poky synced 2026-07-16 15:57:04 +00:00

elfutils: 0.170 -> 0.172

- Update debian 0.170 patches and rebase them for 0.172;

- Drop 0001-Use-fallthrough-attribute.patch which was
  accepted by upstream;

- Drop 0001-Ensure-that-packed-structs-follow-the-gcc-memory-lay.patch
  which was backported from upstream;

(From OE-Core rev: dbbe9c1d1f822cf13a4c16b79bccf6bf5c4b91e4)

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:
Hongxu Jia
2018-07-02 13:57:09 +08:00
committed by Richard Purdie
parent b07db23759
commit 60857bd2d4
24 changed files with 651 additions and 424 deletions
@@ -8,10 +8,6 @@ from the elf machine id. Also, the EM_MIPS_RS3_LE machine is dead anyway (the
kernel will not load binaries containing it).
Signed-off-by: James Cowgill <james410@cowgill.org.uk>
Upstream-Status: Backport [from debian]
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
backends/mips_init.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
@@ -1,8 +1,28 @@
Upstream-Status: Backport [from debian]
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
From a95f370bc2690c150c46f215543de278469900eb Mon Sep 17 00:00:00 2001
From: Hongxu Jia <hongxu.jia@windriver.com>
Date: Fri, 29 Jun 2018 15:42:39 +0800
Subject: [PATCH] arm_backend
Index: b/backends/arm_init.c
===================================================================
Upstream-Status: Backport from debian
arm_backend.diff and rebase to 0.172
http://ftp.de.debian.org/debian/pool/main/e/elfutils/elfutils_0.170-0.5.debian.tar.xz
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
backends/arm_init.c | 18 ++++-
backends/arm_regs.c | 132 ++++++++++++++++++++++++++++++++++++
backends/arm_retval.c | 43 +++++++++++-
backends/libebl_arm.h | 9 +++
libelf/elf.h | 11 +++
tests/run-addrcfi.sh | 93 ++++++++++++++++++++++++-
tests/run-allregs.sh | 95 +++++++++++++++++++++++++-
tests/run-readelf-mixed-corenote.sh | 11 ++-
8 files changed, 400 insertions(+), 12 deletions(-)
create mode 100644 backends/libebl_arm.h
diff --git a/backends/arm_init.c b/backends/arm_init.c
index f2b1b11..1b71f16 100644
--- a/backends/arm_init.c
+++ b/backends/arm_init.c
@@ -35,20 +35,31 @@
@@ -38,7 +58,7 @@ Index: b/backends/arm_init.c
/* We handle it. */
eh->name = "ARM";
arm_init_reloc (eh);
@@ -60,7 +71,10 @@ arm_init (Elf *elf __attribute__ ((unuse
@@ -60,7 +71,10 @@ arm_init (Elf *elf __attribute__ ((unused)),
HOOK (eh, core_note);
HOOK (eh, auxv_info);
HOOK (eh, check_object_attribute);
@@ -50,8 +70,8 @@ Index: b/backends/arm_init.c
HOOK (eh, abi_cfi);
HOOK (eh, check_reloc_target_type);
HOOK (eh, symbol_type_name);
Index: b/backends/arm_regs.c
===================================================================
diff --git a/backends/arm_regs.c b/backends/arm_regs.c
index a46a4c9..418c931 100644
--- a/backends/arm_regs.c
+++ b/backends/arm_regs.c
@@ -31,6 +31,7 @@
@@ -62,7 +82,7 @@ Index: b/backends/arm_regs.c
#include <dwarf.h>
#define BACKEND arm_
@@ -76,6 +77,9 @@ arm_register_info (Ebl *ebl __attribute_
@@ -76,6 +77,9 @@ arm_register_info (Ebl *ebl __attribute__ ((unused)),
break;
case 16 + 0 ... 16 + 7:
@@ -70,9 +90,9 @@ Index: b/backends/arm_regs.c
+ * but gcc maps FPA registers here
+ */
regno += 96 - 16;
/* Fall through. */
FALLTHROUGH;
case 96 + 0 ... 96 + 7:
@@ -87,11 +91,139 @@ arm_register_info (Ebl *ebl __attribute_
@@ -87,11 +91,139 @@ arm_register_info (Ebl *ebl __attribute__ ((unused)),
namelen = 2;
break;
@@ -212,8 +232,8 @@ Index: b/backends/arm_regs.c
*setname = "VFP";
*type = DW_ATE_float;
*bits = 64;
Index: b/backends/arm_retval.c
===================================================================
diff --git a/backends/arm_retval.c b/backends/arm_retval.c
index 1c28f01..313e4eb 100644
--- a/backends/arm_retval.c
+++ b/backends/arm_retval.c
@@ -48,6 +48,13 @@ static const Dwarf_Op loc_intreg[] =
@@ -242,7 +262,7 @@ Index: b/backends/arm_retval.c
{
/* Start with the function's type, and get the DW_AT_type attribute,
which is the type of the return value. */
@@ -98,6 +106,21 @@ arm_return_value_location (Dwarf_Die *fu
@@ -98,6 +106,21 @@ arm_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
else
return -1;
}
@@ -264,7 +284,7 @@ Index: b/backends/arm_retval.c
if (size <= 16)
{
intreg:
@@ -106,6 +129,7 @@ arm_return_value_location (Dwarf_Die *fu
@@ -106,6 +129,7 @@ arm_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
}
aggregate:
@@ -272,7 +292,7 @@ Index: b/backends/arm_retval.c
*locp = loc_aggregate;
return nloc_aggregate;
}
@@ -125,3 +149,18 @@ arm_return_value_location (Dwarf_Die *fu
@@ -125,3 +149,18 @@ arm_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
DWARF and might be valid. */
return -2;
}
@@ -291,11 +311,26 @@ Index: b/backends/arm_retval.c
+ return arm_return_value_location_ (functypedie, locp, 0);
+}
+
Index: b/libelf/elf.h
===================================================================
diff --git a/backends/libebl_arm.h b/backends/libebl_arm.h
new file mode 100644
index 0000000..c00770c
--- /dev/null
+++ b/backends/libebl_arm.h
@@ -0,0 +1,9 @@
+#ifndef _LIBEBL_ARM_H
+#define _LIBEBL_ARM_H 1
+
+#include <libdw.h>
+
+extern int arm_return_value_location_soft(Dwarf_Die *, const Dwarf_Op **locp);
+extern int arm_return_value_location_hard(Dwarf_Die *, const Dwarf_Op **locp);
+
+#endif
diff --git a/libelf/elf.h b/libelf/elf.h
index 6c9f61e..6d82fef 100644
--- a/libelf/elf.h
+++ b/libelf/elf.h
@@ -2593,6 +2593,9 @@ enum
@@ -2692,6 +2692,9 @@ enum
#define EF_ARM_EABI_VER4 0x04000000
#define EF_ARM_EABI_VER5 0x05000000
@@ -305,7 +340,7 @@ Index: b/libelf/elf.h
/* Additional symbol types for Thumb. */
#define STT_ARM_TFUNC STT_LOPROC /* A Thumb function. */
#define STT_ARM_16BIT STT_HIPROC /* A Thumb label. */
@@ -2610,12 +2613,19 @@ enum
@@ -2709,12 +2712,19 @@ enum
/* Processor specific values for the Phdr p_type field. */
#define PT_ARM_EXIDX (PT_LOPROC + 1) /* ARM unwind segment. */
@@ -325,7 +360,7 @@ Index: b/libelf/elf.h
/* AArch64 relocs. */
@@ -2908,6 +2918,7 @@ enum
@@ -3007,6 +3017,7 @@ enum
TLS block (LDR, STR). */
#define R_ARM_TLS_IE12GP 111 /* 12 bit GOT entry relative
to GOT origin (LDR). */
@@ -333,22 +368,119 @@ Index: b/libelf/elf.h
#define R_ARM_ME_TOO 128 /* Obsolete. */
#define R_ARM_THM_TLS_DESCSEQ 129
#define R_ARM_THM_TLS_DESCSEQ16 129
Index: b/backends/libebl_arm.h
===================================================================
--- /dev/null
+++ b/backends/libebl_arm.h
@@ -0,0 +1,9 @@
+#ifndef _LIBEBL_ARM_H
+#define _LIBEBL_ARM_H 1
+
+#include <libdw.h>
+
+extern int arm_return_value_location_soft(Dwarf_Die *, const Dwarf_Op **locp);
+extern int arm_return_value_location_hard(Dwarf_Die *, const Dwarf_Op **locp);
+
+#endif
Index: b/tests/run-allregs.sh
===================================================================
diff --git a/tests/run-addrcfi.sh b/tests/run-addrcfi.sh
index fd89d02..462d7c5 100755
--- a/tests/run-addrcfi.sh
+++ b/tests/run-addrcfi.sh
@@ -3554,6 +3554,38 @@ dwarf_cfi_addrframe (.eh_frame): no matching address range
FPA reg21 (f5): undefined
FPA reg22 (f6): undefined
FPA reg23 (f7): undefined
+ VFP reg64 (s0): undefined
+ VFP reg65 (s1): undefined
+ VFP reg66 (s2): undefined
+ VFP reg67 (s3): undefined
+ VFP reg68 (s4): undefined
+ VFP reg69 (s5): undefined
+ VFP reg70 (s6): undefined
+ VFP reg71 (s7): undefined
+ VFP reg72 (s8): undefined
+ VFP reg73 (s9): undefined
+ VFP reg74 (s10): undefined
+ VFP reg75 (s11): undefined
+ VFP reg76 (s12): undefined
+ VFP reg77 (s13): undefined
+ VFP reg78 (s14): undefined
+ VFP reg79 (s15): undefined
+ VFP reg80 (s16): undefined
+ VFP reg81 (s17): undefined
+ VFP reg82 (s18): undefined
+ VFP reg83 (s19): undefined
+ VFP reg84 (s20): undefined
+ VFP reg85 (s21): undefined
+ VFP reg86 (s22): undefined
+ VFP reg87 (s23): undefined
+ VFP reg88 (s24): undefined
+ VFP reg89 (s25): undefined
+ VFP reg90 (s26): undefined
+ VFP reg91 (s27): undefined
+ VFP reg92 (s28): undefined
+ VFP reg93 (s29): undefined
+ VFP reg94 (s30): undefined
+ VFP reg95 (s31): undefined
FPA reg96 (f0): undefined
FPA reg97 (f1): undefined
FPA reg98 (f2): undefined
@@ -3562,7 +3594,66 @@ dwarf_cfi_addrframe (.eh_frame): no matching address range
FPA reg101 (f5): undefined
FPA reg102 (f6): undefined
FPA reg103 (f7): undefined
- integer reg128 (spsr): undefined
+ MMX reg104 (wcgr0): undefined
+ MMX reg105 (wcgr1): undefined
+ MMX reg106 (wcgr2): undefined
+ MMX reg107 (wcgr3): undefined
+ MMX reg108 (wcgr4): undefined
+ MMX reg109 (wcgr5): undefined
+ MMX reg110 (wcgr6): undefined
+ MMX reg111 (wcgr7): undefined
+ MMX reg112 (wr0): undefined
+ MMX reg113 (wr1): undefined
+ MMX reg114 (wr2): undefined
+ MMX reg115 (wr3): undefined
+ MMX reg116 (wr4): undefined
+ MMX reg117 (wr5): undefined
+ MMX reg118 (wr6): undefined
+ MMX reg119 (wr7): undefined
+ MMX reg120 (wr8): undefined
+ MMX reg121 (wr9): undefined
+ MMX reg122 (wr10): undefined
+ MMX reg123 (wr11): undefined
+ MMX reg124 (wr12): undefined
+ MMX reg125 (wr13): undefined
+ MMX reg126 (wr14): undefined
+ MMX reg127 (wr15): undefined
+ state reg128 (spsr): undefined
+ state reg129 (spsr_fiq): undefined
+ state reg130 (spsr_irq): undefined
+ state reg131 (spsr_abt): undefined
+ state reg132 (spsr_und): undefined
+ state reg133 (spsr_svc): undefined
+ integer reg144 (r8_usr): undefined
+ integer reg145 (r9_usr): undefined
+ integer reg146 (r10_usr): undefined
+ integer reg147 (r11_usr): undefined
+ integer reg148 (r12_usr): undefined
+ integer reg149 (r13_usr): undefined
+ integer reg150 (r14_usr): undefined
+ integer reg151 (r8_fiq): undefined
+ integer reg152 (r9_fiq): undefined
+ integer reg153 (r10_fiq): undefined
+ integer reg154 (r11_fiq): undefined
+ integer reg155 (r12_fiq): undefined
+ integer reg156 (r13_fiq): undefined
+ integer reg157 (r14_fiq): undefined
+ integer reg158 (r13_irq): undefined
+ integer reg159 (r14_irq): undefined
+ integer reg160 (r13_abt): undefined
+ integer reg161 (r14_abt): undefined
+ integer reg162 (r13_und): undefined
+ integer reg163 (r14_und): undefined
+ integer reg164 (r13_svc): undefined
+ integer reg165 (r14_svc): undefined
+ MMX reg192 (wc0): undefined
+ MMX reg193 (wc1): undefined
+ MMX reg194 (wc2): undefined
+ MMX reg195 (wc3): undefined
+ MMX reg196 (wc4): undefined
+ MMX reg197 (wc5): undefined
+ MMX reg198 (wc6): undefined
+ MMX reg199 (wc7): undefined
VFP reg256 (d0): undefined
VFP reg257 (d1): undefined
VFP reg258 (d2): undefined
diff --git a/tests/run-allregs.sh b/tests/run-allregs.sh
index 7ddd452..a31dba4 100755
--- a/tests/run-allregs.sh
+++ b/tests/run-allregs.sh
@@ -2672,7 +2672,28 @@ integer registers:
@@ -468,11 +600,11 @@ Index: b/tests/run-allregs.sh
EOF
# See run-readelf-mixed-corenote.sh for instructions to regenerate
Index: b/tests/run-readelf-mixed-corenote.sh
===================================================================
diff --git a/tests/run-readelf-mixed-corenote.sh b/tests/run-readelf-mixed-corenote.sh
index 86171c4..018612f 100755
--- a/tests/run-readelf-mixed-corenote.sh
+++ b/tests/run-readelf-mixed-corenote.sh
@@ -31,12 +31,11 @@ Note segment of 892 bytes at offset 0x27
@@ -31,12 +31,11 @@ Note segment of 892 bytes at offset 0x274:
pid: 11087, ppid: 11063, pgrp: 11087, sid: 11063
utime: 0.000000, stime: 0.010000, cutime: 0.000000, cstime: 0.000000
orig_r0: -1, fpvalid: 1
@@ -490,114 +622,6 @@ Index: b/tests/run-readelf-mixed-corenote.sh
CORE 124 PRPSINFO
state: 0, sname: R, zomb: 0, nice: 0, flag: 0x00400500
uid: 0, gid: 0, pid: 11087, ppid: 11063, pgrp: 11087, sid: 11063
Index: b/tests/run-addrcfi.sh
===================================================================
--- a/tests/run-addrcfi.sh
+++ b/tests/run-addrcfi.sh
@@ -3554,6 +3554,38 @@ dwarf_cfi_addrframe (.eh_frame): no matc
FPA reg21 (f5): undefined
FPA reg22 (f6): undefined
FPA reg23 (f7): undefined
+ VFP reg64 (s0): undefined
+ VFP reg65 (s1): undefined
+ VFP reg66 (s2): undefined
+ VFP reg67 (s3): undefined
+ VFP reg68 (s4): undefined
+ VFP reg69 (s5): undefined
+ VFP reg70 (s6): undefined
+ VFP reg71 (s7): undefined
+ VFP reg72 (s8): undefined
+ VFP reg73 (s9): undefined
+ VFP reg74 (s10): undefined
+ VFP reg75 (s11): undefined
+ VFP reg76 (s12): undefined
+ VFP reg77 (s13): undefined
+ VFP reg78 (s14): undefined
+ VFP reg79 (s15): undefined
+ VFP reg80 (s16): undefined
+ VFP reg81 (s17): undefined
+ VFP reg82 (s18): undefined
+ VFP reg83 (s19): undefined
+ VFP reg84 (s20): undefined
+ VFP reg85 (s21): undefined
+ VFP reg86 (s22): undefined
+ VFP reg87 (s23): undefined
+ VFP reg88 (s24): undefined
+ VFP reg89 (s25): undefined
+ VFP reg90 (s26): undefined
+ VFP reg91 (s27): undefined
+ VFP reg92 (s28): undefined
+ VFP reg93 (s29): undefined
+ VFP reg94 (s30): undefined
+ VFP reg95 (s31): undefined
FPA reg96 (f0): undefined
FPA reg97 (f1): undefined
FPA reg98 (f2): undefined
@@ -3562,7 +3594,66 @@ dwarf_cfi_addrframe (.eh_frame): no matc
FPA reg101 (f5): undefined
FPA reg102 (f6): undefined
FPA reg103 (f7): undefined
- integer reg128 (spsr): undefined
+ MMX reg104 (wcgr0): undefined
+ MMX reg105 (wcgr1): undefined
+ MMX reg106 (wcgr2): undefined
+ MMX reg107 (wcgr3): undefined
+ MMX reg108 (wcgr4): undefined
+ MMX reg109 (wcgr5): undefined
+ MMX reg110 (wcgr6): undefined
+ MMX reg111 (wcgr7): undefined
+ MMX reg112 (wr0): undefined
+ MMX reg113 (wr1): undefined
+ MMX reg114 (wr2): undefined
+ MMX reg115 (wr3): undefined
+ MMX reg116 (wr4): undefined
+ MMX reg117 (wr5): undefined
+ MMX reg118 (wr6): undefined
+ MMX reg119 (wr7): undefined
+ MMX reg120 (wr8): undefined
+ MMX reg121 (wr9): undefined
+ MMX reg122 (wr10): undefined
+ MMX reg123 (wr11): undefined
+ MMX reg124 (wr12): undefined
+ MMX reg125 (wr13): undefined
+ MMX reg126 (wr14): undefined
+ MMX reg127 (wr15): undefined
+ state reg128 (spsr): undefined
+ state reg129 (spsr_fiq): undefined
+ state reg130 (spsr_irq): undefined
+ state reg131 (spsr_abt): undefined
+ state reg132 (spsr_und): undefined
+ state reg133 (spsr_svc): undefined
+ integer reg144 (r8_usr): undefined
+ integer reg145 (r9_usr): undefined
+ integer reg146 (r10_usr): undefined
+ integer reg147 (r11_usr): undefined
+ integer reg148 (r12_usr): undefined
+ integer reg149 (r13_usr): undefined
+ integer reg150 (r14_usr): undefined
+ integer reg151 (r8_fiq): undefined
+ integer reg152 (r9_fiq): undefined
+ integer reg153 (r10_fiq): undefined
+ integer reg154 (r11_fiq): undefined
+ integer reg155 (r12_fiq): undefined
+ integer reg156 (r13_fiq): undefined
+ integer reg157 (r14_fiq): undefined
+ integer reg158 (r13_irq): undefined
+ integer reg159 (r14_irq): undefined
+ integer reg160 (r13_abt): undefined
+ integer reg161 (r14_abt): undefined
+ integer reg162 (r13_und): undefined
+ integer reg163 (r14_und): undefined
+ integer reg164 (r13_svc): undefined
+ integer reg165 (r14_svc): undefined
+ MMX reg192 (wc0): undefined
+ MMX reg193 (wc1): undefined
+ MMX reg194 (wc2): undefined
+ MMX reg195 (wc3): undefined
+ MMX reg196 (wc4): undefined
+ MMX reg197 (wc5): undefined
+ MMX reg198 (wc6): undefined
+ MMX reg199 (wc7): undefined
VFP reg256 (d0): undefined
VFP reg257 (d1): undefined
VFP reg258 (d2): undefined
--
2.7.4
@@ -0,0 +1,35 @@
From 5d45565e71ddab3d7848077b61eb0ca73c0bcbcc Mon Sep 17 00:00:00 2001
From: Hongxu Jia <hongxu.jia@windriver.com>
Date: Fri, 29 Jun 2018 16:01:14 +0800
Subject: [PATCH] disable -Werror as it tends to break with new gcc versions
Bug-Debian: https://bugs.debian.org/886004
Last-Update: 2018-01-01
Signed-off-by: Helmut Grohne <helmut@subdivi.de>
Upstream-Status: Backport from debian
mdisable_werror.patc and rebase to 0.172
http://ftp.de.debian.org/debian/pool/main/e/elfutils/elfutils_0.170-0.5.debian.tar.xz
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
config/eu.am | 1 -
1 file changed, 1 deletion(-)
diff --git a/config/eu.am b/config/eu.am
index c2cc349..99b368e 100644
--- a/config/eu.am
+++ b/config/eu.am
@@ -73,7 +73,6 @@ AM_CFLAGS = -std=gnu99 -Wall -Wshadow -Wformat=2 \
-Wold-style-definition -Wstrict-prototypes \
$(LOGICAL_OP_WARNING) $(DUPLICATED_COND_WARNING) \
$(NULL_DEREFERENCE_WARNING) $(IMPLICIT_FALLTHROUGH_WARNING) \
- $(if $($(*F)_no_Werror),,-Werror) \
$(if $($(*F)_no_Wunused),,-Wunused -Wextra) \
$(if $($(*F)_no_Wstack_usage),,$(STACK_USAGE_WARNING)) \
$(if $($(*F)_no_Wpacked_not_aligned),-Wno-packed-not-aligned,) \
--
2.7.4
@@ -0,0 +1,57 @@
From 91c0a0da2a8932f163d57db5d9d847bed6822502 Mon Sep 17 00:00:00 2001
From: Hongxu Jia <hongxu.jia@windriver.com>
Date: Fri, 29 Jun 2018 15:59:57 +0800
Subject: [PATCH] fix gcc7 ftbfs
Upstream-Status: Backport from debian
fix-gcc7-ftbfs.diff and rebase to 0.172
http://ftp.de.debian.org/debian/pool/main/e/elfutils/elfutils_0.170-0.5.debian.tar.xz
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
backends/mips_retval.c | 1 +
backends/parisc_retval.c | 1 +
src/ar.c | 2 +-
3 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/backends/mips_retval.c b/backends/mips_retval.c
index 57487bb..e7973a8 100644
--- a/backends/mips_retval.c
+++ b/backends/mips_retval.c
@@ -390,6 +390,7 @@ mips_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
}
/* Fallthrough to handle large types */
+ /* Fall through. */
case DW_TAG_array_type:
large:
diff --git a/backends/parisc_retval.c b/backends/parisc_retval.c
index df7ec3a..988e1fe 100644
--- a/backends/parisc_retval.c
+++ b/backends/parisc_retval.c
@@ -167,6 +167,7 @@ parisc_return_value_location_ (Dwarf_Die *functypedie, const Dwarf_Op **locp, in
/* Else fall through. */
}
+ /* Fall through. */
case DW_TAG_structure_type:
case DW_TAG_class_type:
diff --git a/src/ar.c b/src/ar.c
index 818115b..c77e9f4 100644
--- a/src/ar.c
+++ b/src/ar.c
@@ -1073,7 +1073,7 @@ do_oper_delete (const char *arfname, char **argv, int argc,
static bool
no0print (bool ofmt, char *buf, int bufsize, long int val)
{
- char tmpbuf[bufsize + 1];
+ char tmpbuf[bufsize + 1 + 4];
int ret = snprintf (tmpbuf, sizeof (tmpbuf), ofmt ? "%-*lo" : "%-*ld",
bufsize, val);
if (ret >= (int) sizeof (tmpbuf))
--
2.7.4
@@ -1,10 +1,84 @@
Upstream-Status: Backport [from debian]
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
From c510c6c8523246dd79c6ea28d1646b153c23e491 Mon Sep 17 00:00:00 2001
From: Hongxu Jia <hongxu.jia@windriver.com>
Date: Fri, 29 Jun 2018 15:39:46 +0800
Subject: [PATCH] hppa_backend
Index: elfutils-0.170/backends/parisc_init.c
===================================================================
Upstream-Status: Backport from debian
hppa_backend.diff and rebase to 0.172
http://ftp.de.debian.org/debian/pool/main/e/elfutils/elfutils_0.170-0.5.debian.tar.xz
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
backends/Makefile.am | 9 +-
backends/libebl_parisc.h | 9 ++
backends/parisc_init.c | 73 ++++++++++++++++
backends/parisc_regs.c | 159 ++++++++++++++++++++++++++++++++++
backends/parisc_reloc.def | 128 ++++++++++++++++++++++++++++
backends/parisc_retval.c | 213 ++++++++++++++++++++++++++++++++++++++++++++++
backends/parisc_symbol.c | 112 ++++++++++++++++++++++++
libelf/elf.h | 11 +++
8 files changed, 711 insertions(+), 3 deletions(-)
create mode 100644 backends/libebl_parisc.h
create mode 100644 backends/parisc_init.c
create mode 100644 backends/parisc_regs.c
create mode 100644 backends/parisc_reloc.def
create mode 100644 backends/parisc_retval.c
create mode 100644 backends/parisc_symbol.c
diff --git a/backends/Makefile.am b/backends/Makefile.am
index 80aa00e..1e4b8e9 100644
--- a/backends/Makefile.am
+++ b/backends/Makefile.am
@@ -33,16 +33,16 @@ AM_CPPFLAGS += -I$(top_srcdir)/libebl -I$(top_srcdir)/libasm \
modules = i386 sh x86_64 ia64 alpha arm aarch64 sparc ppc ppc64 s390 \
- tilegx m68k bpf riscv
+ tilegx m68k bpf riscv parisc
libebl_pic = libebl_i386_pic.a libebl_sh_pic.a libebl_x86_64_pic.a \
libebl_ia64_pic.a libebl_alpha_pic.a libebl_arm_pic.a \
libebl_aarch64_pic.a libebl_sparc_pic.a libebl_ppc_pic.a \
libebl_ppc64_pic.a libebl_s390_pic.a libebl_tilegx_pic.a \
- libebl_m68k_pic.a libebl_bpf_pic.a libebl_riscv_pic.a
+ libebl_m68k_pic.a libebl_bpf_pic.a libebl_riscv_pic.a \
+ libebl_parisc_pic.a
noinst_LIBRARIES = $(libebl_pic)
noinst_DATA = $(libebl_pic:_pic.a=.so)
-
libelf = ../libelf/libelf.so
libdw = ../libdw/libdw.so
libeu = ../lib/libeu.a
@@ -135,6 +135,9 @@ riscv_SRCS = riscv_init.c riscv_symbol.c
libebl_riscv_pic_a_SOURCES = $(riscv_SRCS)
am_libebl_riscv_pic_a_OBJECTS = $(riscv_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) $(libeu)
@rm -f $(@:.so=.map)
diff --git a/backends/libebl_parisc.h b/backends/libebl_parisc.h
new file mode 100644
index 0000000..f473b79
--- /dev/null
+++ elfutils-0.170/backends/parisc_init.c
+++ b/backends/libebl_parisc.h
@@ -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
diff --git a/backends/parisc_init.c b/backends/parisc_init.c
new file mode 100644
index 0000000..f1e401c
--- /dev/null
+++ b/backends/parisc_init.c
@@ -0,0 +1,73 @@
+/* Initialization of PA-RISC specific backend library.
+ Copyright (C) 2002, 2005, 2006 Red Hat, Inc.
@@ -79,10 +153,11 @@ Index: elfutils-0.170/backends/parisc_init.c
+
+ return MODVERSION;
+}
Index: elfutils-0.170/backends/parisc_regs.c
===================================================================
diff --git a/backends/parisc_regs.c b/backends/parisc_regs.c
new file mode 100644
index 0000000..3895f8e
--- /dev/null
+++ elfutils-0.170/backends/parisc_regs.c
+++ b/backends/parisc_regs.c
@@ -0,0 +1,159 @@
+/* Register names and numbers for PA-RISC DWARF.
+ Copyright (C) 2005, 2006 Red Hat, Inc.
@@ -243,10 +318,11 @@ Index: elfutils-0.170/backends/parisc_regs.c
+ name[namelen++] = '\0';
+ return namelen;
+}
Index: elfutils-0.170/backends/parisc_reloc.def
===================================================================
diff --git a/backends/parisc_reloc.def b/backends/parisc_reloc.def
new file mode 100644
index 0000000..1f875ba
--- /dev/null
+++ elfutils-0.170/backends/parisc_reloc.def
+++ b/backends/parisc_reloc.def
@@ -0,0 +1,128 @@
+/* List the relocation types for PA-RISC. -*- C -*-
+ Copyright (C) 2005 Red Hat, Inc.
@@ -376,10 +452,11 @@ Index: elfutils-0.170/backends/parisc_reloc.def
+RELOC_TYPE (TLS_DTPMOD64, DYN)
+
+#define NO_RELATIVE_RELOC 1
Index: elfutils-0.170/backends/parisc_retval.c
===================================================================
diff --git a/backends/parisc_retval.c b/backends/parisc_retval.c
new file mode 100644
index 0000000..df7ec3a
--- /dev/null
+++ elfutils-0.170/backends/parisc_retval.c
+++ b/backends/parisc_retval.c
@@ -0,0 +1,213 @@
+/* Function return value location for Linux/PA-RISC ABI.
+ Copyright (C) 2005 Red Hat, Inc.
@@ -594,10 +671,11 @@ Index: elfutils-0.170/backends/parisc_retval.c
+ return parisc_return_value_location_ (functypedie, locp, 1);
+}
+
Index: elfutils-0.170/backends/parisc_symbol.c
===================================================================
diff --git a/backends/parisc_symbol.c b/backends/parisc_symbol.c
new file mode 100644
index 0000000..d111a76
--- /dev/null
+++ elfutils-0.170/backends/parisc_symbol.c
+++ b/backends/parisc_symbol.c
@@ -0,0 +1,112 @@
+/* PA-RISC specific symbolic name handling.
+ Copyright (C) 2002, 2005 Red Hat, Inc.
@@ -711,54 +789,11 @@ Index: elfutils-0.170/backends/parisc_symbol.c
+ return ELF_T_NUM;
+ }
+}
Index: elfutils-0.170/backends/libebl_parisc.h
===================================================================
--- /dev/null
+++ elfutils-0.170/backends/libebl_parisc.h
@@ -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.170/backends/Makefile.am
===================================================================
--- elfutils-0.170.orig/backends/Makefile.am
+++ elfutils-0.170/backends/Makefile.am
@@ -33,12 +33,12 @@ AM_CPPFLAGS += -I$(top_srcdir)/libebl -I
modules = i386 sh x86_64 ia64 alpha arm aarch64 sparc ppc ppc64 s390 \
- tilegx m68k bpf
+ tilegx m68k bpf parisc
libebl_pic = libebl_i386_pic.a libebl_sh_pic.a libebl_x86_64_pic.a \
libebl_ia64_pic.a libebl_alpha_pic.a libebl_arm_pic.a \
libebl_aarch64_pic.a libebl_sparc_pic.a libebl_ppc_pic.a \
libebl_ppc64_pic.a libebl_s390_pic.a libebl_tilegx_pic.a \
- libebl_m68k_pic.a libebl_bpf_pic.a
+ libebl_m68k_pic.a libebl_bpf_pic.a libebl_parisc_pic.a
noinst_LIBRARIES = $(libebl_pic)
noinst_DATA = $(libebl_pic:_pic.a=.so)
@@ -124,6 +124,9 @@ cpu_bpf = ../libcpu/libcpu_bpf.a
libebl_bpf_pic_a_SOURCES = $(bpf_SRCS)
am_libebl_bpf_pic_a_OBJECTS = $(bpf_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) $(libeu)
@rm -f $(@:.so=.map)
Index: elfutils-0.170/libelf/elf.h
===================================================================
--- elfutils-0.170.orig/libelf/elf.h
+++ elfutils-0.170/libelf/elf.h
@@ -2056,16 +2056,24 @@ enum
diff --git a/libelf/elf.h b/libelf/elf.h
index f774898..6c9f61e 100644
--- a/libelf/elf.h
+++ b/libelf/elf.h
@@ -2153,16 +2153,24 @@ enum
#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. */
@@ -783,7 +818,7 @@ Index: elfutils-0.170/libelf/elf.h
#define R_PARISC_LTOFF_FPTR32 57 /* 32 bits LT-rel. function pointer. */
#define R_PARISC_LTOFF_FPTR21L 58 /* LT-rel. fct ptr, left 21 bits. */
#define R_PARISC_LTOFF_FPTR14R 62 /* LT-rel. fct ptr, right 14 bits. */
@@ -2074,6 +2082,7 @@ enum
@@ -2171,6 +2179,7 @@ enum
#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. */
@@ -791,7 +826,7 @@ Index: elfutils-0.170/libelf/elf.h
#define R_PARISC_PCREL22F 74 /* 22 bits PC-rel. address. */
#define R_PARISC_PCREL14WR 75 /* PC-rel. address, right 14 bits. */
#define R_PARISC_PCREL14DR 76 /* PC rel. address, right 14 bits. */
@@ -2099,6 +2108,8 @@ enum
@@ -2196,6 +2205,8 @@ enum
#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. */
@@ -800,3 +835,6 @@ Index: elfutils-0.170/libelf/elf.h
#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. */
--
2.7.4
@@ -1,11 +1,13 @@
From 46d0d0ca718093486eeeedf1b44134e9e29b56f7 Mon Sep 17 00:00:00 2001
From 59ffb86bda845a68d3686afa7bc784131df678f7 Mon Sep 17 00:00:00 2001
From: Hongxu Jia <hongxu.jia@windriver.com>
Date: Wed, 16 Aug 2017 09:18:59 +0800
Subject: [PATCH] mips backends
Date: Fri, 29 Jun 2018 15:45:58 +0800
Subject: [PATCH] mips_backend
Upstream-Status: Backport [from debian]
Upstream-Status: Backport from debian
mips_backend.diff and rebase to 0.172
http://ftp.de.debian.org/debian/pool/main/e/elfutils/elfutils_0.170-0.5.debian.tar.xz
Rebase to 0.170
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
backends/Makefile.am | 8 +-
@@ -23,25 +25,26 @@ Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
create mode 100644 backends/mips_symbol.c
diff --git a/backends/Makefile.am b/backends/Makefile.am
index 7f1f5d4..91baf6e 100644
index 1e4b8e9..e7bccf8 100644
--- a/backends/Makefile.am
+++ b/backends/Makefile.am
@@ -33,12 +33,12 @@ AM_CPPFLAGS += -I$(top_srcdir)/libebl -I$(top_srcdir)/libasm \
@@ -33,13 +33,13 @@ AM_CPPFLAGS += -I$(top_srcdir)/libebl -I$(top_srcdir)/libasm \
modules = i386 sh x86_64 ia64 alpha arm aarch64 sparc ppc ppc64 s390 \
- tilegx m68k bpf parisc
+ tilegx m68k bpf parisc mips
- tilegx m68k bpf riscv parisc
+ tilegx m68k bpf riscv parisc mips
libebl_pic = libebl_i386_pic.a libebl_sh_pic.a libebl_x86_64_pic.a \
libebl_ia64_pic.a libebl_alpha_pic.a libebl_arm_pic.a \
libebl_aarch64_pic.a libebl_sparc_pic.a libebl_ppc_pic.a \
libebl_ppc64_pic.a libebl_s390_pic.a libebl_tilegx_pic.a \
- libebl_m68k_pic.a libebl_bpf_pic.a libebl_parisc_pic.a
+ libebl_m68k_pic.a libebl_bpf_pic.a libebl_parisc_pic.a libebl_mips_pic.a
libebl_m68k_pic.a libebl_bpf_pic.a libebl_riscv_pic.a \
- libebl_parisc_pic.a
+ libebl_parisc_pic.a libebl_mips_pic.a
noinst_LIBRARIES = $(libebl_pic)
noinst_DATA = $(libebl_pic:_pic.a=.so)
@@ -128,6 +128,10 @@ parisc_SRCS = parisc_init.c parisc_symbol.c parisc_regs.c parisc_retval.c
@@ -139,6 +139,10 @@ 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)
@@ -698,7 +701,7 @@ index 0000000..ba465fe
+ }
+}
diff --git a/libebl/eblopenbackend.c b/libebl/eblopenbackend.c
index 1f81477..5371396 100644
index 8b063f4..5405b0c 100644
--- a/libebl/eblopenbackend.c
+++ b/libebl/eblopenbackend.c
@@ -72,6 +72,8 @@ static const struct
@@ -711,5 +714,5 @@ index 1f81477..5371396 100644
{ "m32", "elf_m32", "m32", 3, EM_M32, 0, 0 },
{ "m68k", "elf_m68k", "m68k", 4, EM_68K, ELFCLASS32, ELFDATA2MSB },
--
1.8.3.1
2.7.4
@@ -0,0 +1,39 @@
From a188ea1ada6b990b72b91266ae02da058dcd9523 Mon Sep 17 00:00:00 2001
From: Kurt Roeckx <kurt@roeckx.be>
Date: Fri, 29 Jun 2018 15:49:32 +0800
Subject: [PATCH] Make readelf -w output debug information on mips
Bug-Debian: http://bugs.debian.org/662041
Forwarded: not-needed
Upstreams wants a change where this is handled by a hook that needs
to be filled in by the backend for the arch.
Signed-off-by: Kurt Roeckx <kurt@roeckx.be>
Upstream-Status: Backport from debian
mips_readelf_w.patch and rebase to 0.172
http://ftp.de.debian.org/debian/pool/main/e/elfutils/elfutils_0.170-0.5.debian.tar.xz
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
src/readelf.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/readelf.c b/src/readelf.c
index f185897..0db197c 100644
--- a/src/readelf.c
+++ b/src/readelf.c
@@ -10979,7 +10979,8 @@ print_debug (Dwfl_Module *dwflmod, Ebl *ebl, GElf_Ehdr *ehdr)
GElf_Shdr shdr_mem;
GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem);
- if (shdr != NULL && shdr->sh_type == SHT_PROGBITS)
+ if (shdr != NULL && (
+ (shdr->sh_type == SHT_PROGBITS) || (shdr->sh_type == SHT_MIPS_DWARF)))
{
static const struct
{
--
2.7.4
@@ -0,0 +1,57 @@
From fe7613a3b9f2443cc11917826348d4521f267c96 Mon Sep 17 00:00:00 2001
From: Hongxu Jia <hongxu.jia@windriver.com>
Date: Fri, 29 Jun 2018 15:48:33 +0800
Subject: [PATCH] testsuite ignore elflint
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).
Upstream-Status: Backport from debian
testsuite-ignore-elflint.diff and rebase to 0.172
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
tests/run-elflint-self.sh | 2 +-
tests/test-subr.sh | 15 +++++++++++++++
2 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/tests/run-elflint-self.sh b/tests/run-elflint-self.sh
index 58fa7d0..85d21a5 100755
--- a/tests/run-elflint-self.sh
+++ b/tests/run-elflint-self.sh
@@ -18,5 +18,5 @@
. $srcdir/test-subr.sh
-testrun_on_self ${abs_top_builddir}/src/elflint --quiet --gnu-ld
+testrun_on_self_skip ${abs_top_builddir}/src/elflint --quiet --gnu-ld
testrun_on_self_compressed ${abs_top_builddir}/src/elflint --quiet --gnu-ld
diff --git a/tests/test-subr.sh b/tests/test-subr.sh
index 09f428d..26f61f1 100644
--- a/tests/test-subr.sh
+++ b/tests/test-subr.sh
@@ -201,3 +201,18 @@ testrun_on_self_quiet()
# Only exit if something failed
if test $exit_status != 0; then exit $exit_status; fi
}
+
+# Same as testrun_on_self(), but skip on failure.
+testrun_on_self_skip()
+{
+ exit_status=0
+
+ for file in $self_test_files; do
+ testrun $* $file \
+ || { echo "*** failure in $* $file"; exit_status=77; }
+ done
+
+ # Only exit if something failed
+ if test $exit_status != 0; then exit $exit_status; fi
+}
+
--
2.7.4
@@ -4,9 +4,6 @@ Date: Mon, 5 Jan 2015 15:17:01 +0000
Subject: [PATCH 2/3] Add support for mips64 abis in mips_retval.c
Signed-off-by: James Cowgill <james410@cowgill.org.uk>
Upstream-Status: Backport [from debian]
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
backends/mips_retval.c | 104 ++++++++++++++++++++++++++++++++++++++++++++-----
1 file changed, 94 insertions(+), 10 deletions(-)
@@ -12,9 +12,6 @@ This patch also ensures that strip.c sets the correct value of e_machine
before manipulating relocations so that these changes take effect.
Signed-off-by: James Cowgill <james410@cowgill.org.uk>
Upstream-Status: Backport [from debian]
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
libelf/gelf_getrel.c | 25 +++++++++++++++++++++++--
libelf/gelf_getrela.c | 25 +++++++++++++++++++++++--
@@ -203,7 +200,7 @@ Index: b/src/strip.c
===================================================================
--- a/src/strip.c
+++ b/src/strip.c
@@ -532,6 +532,23 @@ handle_elf (int fd, Elf *elf, const char
@@ -598,6 +598,23 @@ handle_elf (int fd, Elf *elf, const char
goto fail;
}
@@ -0,0 +1,14 @@
Index: elfutils-0.165/tests/run-native-test.sh
===================================================================
--- elfutils-0.165.orig/tests/run-native-test.sh
+++ elfutils-0.165/tests/run-native-test.sh
@@ -83,6 +83,9 @@ native_test()
# "cannot attach to process: Function not implemented".
[ "$(uname)" = "GNU/kFreeBSD" ] && exit 77
+# hurd's /proc/$PID/maps does not give paths yet.
+[ "$(uname)" = "GNU" ] && exit 77
+
native_test ${abs_builddir}/allregs
native_test ${abs_builddir}/funcretval
@@ -0,0 +1,11 @@
--- elfutils-0.165.orig/tests/run-strip-strmerge.sh
+++ elfutils-0.165/tests/run-strip-strmerge.sh
@@ -30,7 +30,7 @@ remerged=remerged.elf
tempfiles $merged $stripped $debugfile $remerged
echo elflint $input
-testrun ${abs_top_builddir}/src/elflint --gnu $input
+testrun_on_self_skip ${abs_top_builddir}/src/elflint --gnu $input
echo elfstrmerge
testrun ${abs_top_builddir}/tests/elfstrmerge -o $merged $input
echo elflint $merged
@@ -0,0 +1,17 @@
Index: b/tests/run-native-test.sh
===================================================================
--- a/tests/run-native-test.sh
+++ b/tests/run-native-test.sh
@@ -77,6 +77,12 @@ native_test()
test $native -eq 0 || testrun "$@" -p $native > /dev/null
}
+# On the Debian buildds, GNU/kFreeBSD linprocfs /proc/$PID/maps does
+# not give absolute paths due to sbuild's bind mounts (bug #570805)
+# therefore the next two test programs are expected to fail with
+# "cannot attach to process: Function not implemented".
+[ "$(uname)" = "GNU/kFreeBSD" ] && exit 77
+
native_test ${abs_builddir}/allregs
native_test ${abs_builddir}/funcretval
@@ -1,25 +0,0 @@
From: Kurt Roeckx <kurt@roeckx.be>
Subject: Make readelf -w output debug information on mips
Bug-Debian: http://bugs.debian.org/662041
Forwarded: not-needed
Upstreams wants a change where this is handled by a hook that needs
to be filled in by the backend for the arch.
Upstream-Status: Backport [from debian]
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Index: b/src/readelf.c
===================================================================
--- a/src/readelf.c
+++ b/src/readelf.c
@@ -8343,7 +8343,8 @@ print_debug (Dwfl_Module *dwflmod, Ebl *
GElf_Shdr shdr_mem;
GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem);
- if (shdr != NULL && shdr->sh_type == SHT_PROGBITS)
+ if (shdr != NULL && (
+ (shdr->sh_type == SHT_PROGBITS) || (shdr->sh_type == SHT_MIPS_DWARF)))
{
static const struct
{