diff options
author | Khem Raj <raj.khem@gmail.com> | 2016-10-28 11:40:58 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-11-16 10:37:56 +0000 |
commit | 4722bfbda95109611a8a3a1c071474015e26bf66 (patch) | |
tree | 27da895ee06865382968dd52bfd91641359b58ea /meta/recipes-devtools | |
parent | 6c9f6b5f70ab3ee194b2c2c6f3bd462c994848fa (diff) | |
download | poky-4722bfbda95109611a8a3a1c071474015e26bf66.tar.gz |
binutils-2.27: Fix linker segfaults when linking binary files
Fixes segfaults when doing partial linking and generaring binary objects
/tmp/binu/ld/ld-new -r -b binary -o etc_certs_ui_ca_pem.o etc_certs_ui_ca_pem
0 elf32_arm_count_additional_relocs (sec=0x79bf40) at /mnt/a/work/oe/binutils-gdb/bfd/elf32-arm.c:18210
1 0x000000000047635a in bfd_elf_final_link (abfd=abfd@entry=0x783250, info=info@entry=0x748400 <link_info>) at /mnt/a/work/oe/binutils-gdb/bfd/elflink.c:11224
2 0x000000000044df7b in elf32_arm_final_link (abfd=0x783250, info=0x748400 <link_info>) at /mnt/a/work/oe/binutils-gdb/bfd/elf32-arm.c:12131
3 0x0000000000418917 in ldwrite () at /mnt/a/work/oe/binutils-gdb/ld/ldwrite.c:577
4 0x000000000040365f in main (argc=<optimized out>, argv=<optimized out>) at /mnt/a/work/oe/binutils-gdb/ld/ldmain.c:433
gold works ok. The patch is already applied in master binutils
(From OE-Core rev: 00d1913520f1572fa7def865e57852c7f25b0ec4)
(From OE-Core rev: 2b1a571899eec018d6f44876b743e06835ed761d)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools')
-rw-r--r-- | meta/recipes-devtools/binutils/binutils-2.27.inc | 1 | ||||
-rw-r--r-- | meta/recipes-devtools/binutils/binutils/0016-Fix-seg-fault-in-ARM-linker-when-trying-to-parse-a-b.patch | 31 |
2 files changed, 32 insertions, 0 deletions
diff --git a/meta/recipes-devtools/binutils/binutils-2.27.inc b/meta/recipes-devtools/binutils/binutils-2.27.inc index af1420b247..fc81721f80 100644 --- a/meta/recipes-devtools/binutils/binutils-2.27.inc +++ b/meta/recipes-devtools/binutils/binutils-2.27.inc | |||
@@ -36,6 +36,7 @@ SRC_URI = "\ | |||
36 | file://0014-libtool-remove-rpath.patch \ | 36 | file://0014-libtool-remove-rpath.patch \ |
37 | file://0015-binutils-mips-gas-pic-relax-linkonce.diff \ | 37 | file://0015-binutils-mips-gas-pic-relax-linkonce.diff \ |
38 | file://0015-Refine-.cfi_sections-check-to-only-consider-compact-.patch \ | 38 | file://0015-Refine-.cfi_sections-check-to-only-consider-compact-.patch \ |
39 | file://0016-Fix-seg-fault-in-ARM-linker-when-trying-to-parse-a-b.patch \ | ||
39 | " | 40 | " |
40 | S = "${WORKDIR}/git" | 41 | S = "${WORKDIR}/git" |
41 | 42 | ||
diff --git a/meta/recipes-devtools/binutils/binutils/0016-Fix-seg-fault-in-ARM-linker-when-trying-to-parse-a-b.patch b/meta/recipes-devtools/binutils/binutils/0016-Fix-seg-fault-in-ARM-linker-when-trying-to-parse-a-b.patch new file mode 100644 index 0000000000..33bf1e8f65 --- /dev/null +++ b/meta/recipes-devtools/binutils/binutils/0016-Fix-seg-fault-in-ARM-linker-when-trying-to-parse-a-b.patch | |||
@@ -0,0 +1,31 @@ | |||
1 | From 72b09de92cc597c53b1d762882b67a17fe56846c Mon Sep 17 00:00:00 2001 | ||
2 | From: Nick Clifton <nickc@redhat.com> | ||
3 | Date: Tue, 23 Aug 2016 09:45:11 +0100 | ||
4 | Subject: [PATCH 16/16] Fix seg-fault in ARM linker when trying to parse a | ||
5 | binary file. | ||
6 | |||
7 | * elf32-arm.c (elf32_arm_count_additional_relocs): Return zero if | ||
8 | there is no arm data associated with the section. | ||
9 | --- | ||
10 | Upstream-Status: Backport | ||
11 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
12 | |||
13 | bfd/elf32-arm.c | 2 +- | ||
14 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
15 | |||
16 | diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c | ||
17 | index 700bec3..3fab609 100644 | ||
18 | --- a/bfd/elf32-arm.c | ||
19 | +++ b/bfd/elf32-arm.c | ||
20 | @@ -18207,7 +18207,7 @@ elf32_arm_count_additional_relocs (asection *sec) | ||
21 | { | ||
22 | struct _arm_elf_section_data *arm_data; | ||
23 | arm_data = get_arm_elf_section_data (sec); | ||
24 | - return arm_data->additional_reloc_count; | ||
25 | + return arm_data == NULL ? 0 : arm_data->additional_reloc_count; | ||
26 | } | ||
27 | |||
28 | /* Called to set the sh_flags, sh_link and sh_info fields of OSECTION which | ||
29 | -- | ||
30 | 2.10.1 | ||
31 | |||