diff --git a/0001-CVE-2018-18309.patch b/0001-CVE-2018-18309.patch deleted file mode 100644 index 85262d29e0b9715d9b9f285699ea4a04de8dc5bc..0000000000000000000000000000000000000000 --- a/0001-CVE-2018-18309.patch +++ /dev/null @@ -1,110 +0,0 @@ -From 370e4b5079ff8d62be3adee7396948d4c5795091 Mon Sep 17 00:00:00 2001 -From: John Darrington -Date: Tue, 24 Jul 2018 12:58:43 +0200 -Subject: [PATCH] Add functions and macros to read and write 24 bit values. - - * libbfd.c (bfd_getb24, bfd_getl24): New functions. - (bfd_get_24, bfd_put_24): New macros. - * bfd-in2.h: Regenerate. - -url:https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=370e4b5079ff8d62be3adee7396948d4c5795091 - -diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h -index 3414682988..414ca54515 100644 ---- a/bfd/bfd-in2.h -+++ b/bfd/bfd-in2.h -@@ -1160,6 +1160,20 @@ char *bfd_follow_build_id_debuglink (bfd *abfd, const char *dir); - #define bfd_get_signed_16(abfd, ptr) \ - BFD_SEND (abfd, bfd_getx_signed_16, (ptr)) - -+#define bfd_put_24(abfd, val, ptr) \ -+ do \ -+ if (bfd_big_endian (abfd)) \ -+ bfd_putb24 ((val), (ptr)); \ -+ else \ -+ bfd_putl24 ((val), (ptr)); \ -+ while (0) -+ -+bfd_vma bfd_getb24 (const void *p); -+bfd_vma bfd_getl24 (const void *p); -+ -+#define bfd_get_24(abfd, ptr) \ -+ (bfd_big_endian (abfd) ? bfd_getb24 (ptr) : bfd_getl24 (ptr)) -+ - #define bfd_put_32(abfd, val, ptr) \ - BFD_SEND (abfd, bfd_putx32, ((val),(ptr))) - #define bfd_put_signed_32 \ -diff --git a/bfd/libbfd.c b/bfd/libbfd.c -index 971be4f3de..7c45d52aaf 100644 ---- a/bfd/libbfd.c -+++ b/bfd/libbfd.c -@@ -458,6 +458,20 @@ DESCRIPTION - .#define bfd_get_signed_16(abfd, ptr) \ - . BFD_SEND (abfd, bfd_getx_signed_16, (ptr)) - . -+.#define bfd_put_24(abfd, val, ptr) \ -+. do \ -+. if (bfd_big_endian (abfd)) \ -+. bfd_putb24 ((val), (ptr)); \ -+. else \ -+. bfd_putl24 ((val), (ptr)); \ -+. while (0) -+. -+.bfd_vma bfd_getb24 (const void *p); -+.bfd_vma bfd_getl24 (const void *p); -+. -+.#define bfd_get_24(abfd, ptr) \ -+. (bfd_big_endian (abfd) ? bfd_getb24 (ptr) : bfd_getl24 (ptr)) -+. - .#define bfd_put_32(abfd, val, ptr) \ - . BFD_SEND (abfd, bfd_putx32, ((val),(ptr))) - .#define bfd_put_signed_32 \ -@@ -613,7 +627,6 @@ bfd_putl16 (bfd_vma data, void *p) - addr[1] = (data >> 8) & 0xff; - } - -- - void - bfd_putb24 (bfd_vma data, void *p) - { -@@ -623,7 +636,6 @@ bfd_putb24 (bfd_vma data, void *p) - addr[2] = data & 0xff; - } - -- - void - bfd_putl24 (bfd_vma data, void *p) - { -@@ -633,6 +645,29 @@ bfd_putl24 (bfd_vma data, void *p) - addr[2] = (data >> 16) & 0xff; - } - -+bfd_vma -+bfd_getb24 (const void *p) -+{ -+ const bfd_byte *addr = (const bfd_byte *) p; -+ unsigned long v; -+ -+ v = (unsigned long) addr[0] << 16; -+ v |= (unsigned long) addr[1] << 8; -+ v |= (unsigned long) addr[2]; -+ return v; -+} -+ -+bfd_vma -+bfd_getl24 (const void *p) -+{ -+ const bfd_byte *addr = (const bfd_byte *) p; -+ unsigned long v; -+ -+ v = (unsigned long) addr[0]; -+ v |= (unsigned long) addr[1] << 8; -+ v |= (unsigned long) addr[2] << 16; -+ return v; -+} - - bfd_vma - bfd_getb32 (const void *p) --- -2.19.1 - diff --git a/0002-CVE-2018-18309.patch b/0002-CVE-2018-18309.patch deleted file mode 100644 index 0daa7359069ad8992df3eb8f403ed9d70bfb5f37..0000000000000000000000000000000000000000 --- a/0002-CVE-2018-18309.patch +++ /dev/null @@ -1,86 +0,0 @@ -From 7cf9ebc6958462c3ef1372071d1ced5dae7bef3c Mon Sep 17 00:00:00 2001 -From: John Darrington -Date: Thu, 9 Aug 2018 18:46:51 +0200 -Subject: [PATCH 1/2] Deal with relocations which are 3 bytes in size - - * reloc.c (_bfd_relocate_contents): Handle 3 byte relocs. - (_bfd_clear_contents): Likewise. - (bfd_perform_relocation): Likewise. - (bfd_install_relocation): Likewise. -url:https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=7cf9ebc6958462c3ef1372071d1ced5dae7bef3c - -diff --git a/bfd/reloc.c b/bfd/reloc.c -index b63473e12a..775a4403ef 100644 ---- a/bfd/reloc.c -+++ b/bfd/reloc.c -@@ -920,11 +920,9 @@ space consuming. For each target: - { - case 5: - { -- long x = bfd_get_32 (abfd, (bfd_byte *) data + octets); -- x >>= 8; -+ long x = bfd_get_24 (abfd, (bfd_byte *) data + octets); - DOIT (x); -- bfd_put_16 (abfd, (bfd_vma) (x >> 8), (bfd_byte *) data + octets); -- bfd_put_8 (abfd, (x & 0xFF), (unsigned char *) data + 2 + octets); -+ bfd_put_24 (abfd, (bfd_vma) x, (unsigned char *) data + octets); - } - break; - -@@ -1340,6 +1338,13 @@ space consuming. For each target: - bfd_put_32 (abfd, (bfd_vma) x, data); - } - break; -+ case 5: -+ { -+ long x = bfd_get_24 (abfd, data); -+ DOIT (x); -+ bfd_put_24 (abfd, (bfd_vma) x, data); -+ } -+ break; - case -2: - { - long x = bfd_get_32 (abfd, data); -@@ -1467,6 +1472,9 @@ _bfd_relocate_contents (reloc_howto_type *howto, - case 2: - x = bfd_get_16 (input_bfd, location); - break; -+ case 3: -+ x = bfd_get_24 (input_bfd, location); -+ break; - case 4: - x = bfd_get_32 (input_bfd, location); - break; -@@ -1593,6 +1601,9 @@ _bfd_relocate_contents (reloc_howto_type *howto, - case 2: - bfd_put_16 (input_bfd, x, location); - break; -+ case 3: -+ bfd_put_24 (input_bfd, x, location); -+ break; - case 4: - bfd_put_32 (input_bfd, x, location); - break; -@@ -1636,6 +1647,9 @@ _bfd_clear_contents (reloc_howto_type *howto, - case 2: - x = bfd_get_16 (input_bfd, location); - break; -+ case 3: -+ x = bfd_get_24 (input_bfd, location); -+ break; - case 4: - x = bfd_get_32 (input_bfd, location); - break; -@@ -1670,6 +1684,9 @@ _bfd_clear_contents (reloc_howto_type *howto, - case 2: - bfd_put_16 (input_bfd, x, location); - break; -+ case 3: -+ bfd_put_24 (input_bfd, x, location); -+ break; - case 4: - bfd_put_32 (input_bfd, x, location); - break; --- -2.19.1 - diff --git a/0003-CVE-2018-18309.patch b/0003-CVE-2018-18309.patch deleted file mode 100644 index 514fdee0eb2547557c1e92c2be025060ef825314..0000000000000000000000000000000000000000 --- a/0003-CVE-2018-18309.patch +++ /dev/null @@ -1,446 +0,0 @@ -From 1dc9e2d63e37839ff1768346b2e3f52e338baba5 Mon Sep 17 00:00:00 2001 -From: Alan Modra -Date: Sat, 11 Aug 2018 11:07:07 +0930 -Subject: [PATCH 2/2] Factor out common relocation processing - -This patch factors out some code common to both bfd_perform_relocation -and bfd_install_relocation, in the process fixing the omission of -"case -1" in bfd_install_relocation. - - * reloc.c (bfd_get_reloc_size): Sort switch. - (read_reloc, write_reloc, apply_reloc): New functions. - (bfd_perform_relocation, bfd_install_relocation): Use apply_reloc. - (_bfd_relocate_contents): Use read_reloc and write_reloc. - (_bfd_clear_contents): Likewise. - -url:https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=1dc9e2d63e37839ff1768346b2e3f52e338baba5 - -diff --git a/bfd/reloc.c b/bfd/reloc.c -index 775a4403ef..aaf3a801fd 100644 ---- a/bfd/reloc.c -+++ b/bfd/reloc.c -@@ -431,15 +431,15 @@ bfd_get_reloc_size (reloc_howto_type *howto) - { - switch (howto->size) - { -- case 5: return 3; - case 0: return 1; -- case 1: return 2; -- case 2: return 4; -+ case 1: -+ case -1: return 2; -+ case 2: -+ case -2: return 4; - case 3: return 0; - case 4: return 8; -+ case 5: return 3; - case 8: return 16; -- case -1: return 2; -- case -2: return 4; - default: abort (); - } - } -@@ -574,6 +574,100 @@ bfd_reloc_offset_in_range (reloc_howto_type *howto, - return octet <= octet_end && octet + reloc_size <= octet_end; - } - -+/* Read and return the section contents at DATA converted to a host -+ integer (bfd_vma). The number of bytes read is given by the HOWTO. */ -+ -+static bfd_vma -+read_reloc (bfd *abfd, bfd_byte *data, reloc_howto_type *howto) -+{ -+ switch (howto->size) -+ { -+ case 0: -+ return bfd_get_8 (abfd, data); -+ -+ case 1: -+ case -1: -+ return bfd_get_16 (abfd, data); -+ -+ case 2: -+ case -2: -+ return bfd_get_32 (abfd, data); -+ -+ case 3: -+ break; -+ -+#ifdef BFD64 -+ case 4: -+ return bfd_get_64 (abfd, data); -+#endif -+ -+ case 5: -+ return bfd_get_24 (abfd, data); -+ -+ default: -+ abort (); -+ } -+ return 0; -+} -+ -+/* Convert VAL to target format and write to DATA. The number of -+ bytes written is given by the HOWTO. */ -+ -+static void -+write_reloc (bfd *abfd, bfd_vma val, bfd_byte *data, reloc_howto_type *howto) -+{ -+ switch (howto->size) -+ { -+ case 0: -+ bfd_put_8 (abfd, val, data); -+ break; -+ -+ case 1: -+ case -1: -+ bfd_put_16 (abfd, val, data); -+ break; -+ -+ case 2: -+ case -2: -+ bfd_put_32 (abfd, val, data); -+ break; -+ -+ case 3: -+ break; -+ -+#ifdef BFD64 -+ case 4: -+ bfd_put_64 (abfd, val, data); -+ break; -+#endif -+ -+ case 5: -+ bfd_put_24 (abfd, val, data); -+ break; -+ -+ default: -+ abort (); -+ } -+} -+ -+/* Apply RELOCATION value to target bytes at DATA, according to -+ HOWTO. */ -+ -+static void -+apply_reloc (bfd *abfd, bfd_byte *data, reloc_howto_type *howto, -+ bfd_vma relocation) -+{ -+ bfd_vma val = read_reloc (abfd, data, howto); -+ -+ if (howto->size < 0) -+ relocation = -relocation; -+ -+ val = ((val & ~howto->dst_mask) -+ | (((val & howto->src_mask) + relocation) & howto->dst_mask)); -+ -+ write_reloc (abfd, val, data, howto); -+} -+ - /* - FUNCTION - bfd_perform_relocation -@@ -913,78 +1007,8 @@ space consuming. For each target: - = R R R R R R R R R R put into bfd_put - */ - --#define DOIT(x) \ -- x = ( (x & ~howto->dst_mask) | (((x & howto->src_mask) + relocation) & howto->dst_mask)) -- -- switch (howto->size) -- { -- case 5: -- { -- long x = bfd_get_24 (abfd, (bfd_byte *) data + octets); -- DOIT (x); -- bfd_put_24 (abfd, (bfd_vma) x, (unsigned char *) data + octets); -- } -- break; -- -- case 0: -- { -- char x = bfd_get_8 (abfd, (char *) data + octets); -- DOIT (x); -- bfd_put_8 (abfd, x, (unsigned char *) data + octets); -- } -- break; -- -- case 1: -- { -- short x = bfd_get_16 (abfd, (bfd_byte *) data + octets); -- DOIT (x); -- bfd_put_16 (abfd, (bfd_vma) x, (unsigned char *) data + octets); -- } -- break; -- case 2: -- { -- long x = bfd_get_32 (abfd, (bfd_byte *) data + octets); -- DOIT (x); -- bfd_put_32 (abfd, (bfd_vma) x, (bfd_byte *) data + octets); -- } -- break; -- case -2: -- { -- long x = bfd_get_32 (abfd, (bfd_byte *) data + octets); -- relocation = -relocation; -- DOIT (x); -- bfd_put_32 (abfd, (bfd_vma) x, (bfd_byte *) data + octets); -- } -- break; -- -- case -1: -- { -- long x = bfd_get_16 (abfd, (bfd_byte *) data + octets); -- relocation = -relocation; -- DOIT (x); -- bfd_put_16 (abfd, (bfd_vma) x, (bfd_byte *) data + octets); -- } -- break; -- -- case 3: -- /* Do nothing */ -- break; -- -- case 4: --#ifdef BFD64 -- { -- bfd_vma x = bfd_get_64 (abfd, (bfd_byte *) data + octets); -- DOIT (x); -- bfd_put_64 (abfd, x, (bfd_byte *) data + octets); -- } --#else -- abort (); --#endif -- break; -- default: -- return bfd_reloc_other; -- } -- -+ data = (bfd_byte *) data + octets; -+ apply_reloc (abfd, data, howto, relocation); - return flag; - } - -@@ -1309,66 +1333,8 @@ space consuming. For each target: - = R R R R R R R R R R put into bfd_put - */ - --#define DOIT(x) \ -- x = ( (x & ~howto->dst_mask) | (((x & howto->src_mask) + relocation) & howto->dst_mask)) -- - data = (bfd_byte *) data_start + (octets - data_start_offset); -- -- switch (howto->size) -- { -- case 0: -- { -- char x = bfd_get_8 (abfd, data); -- DOIT (x); -- bfd_put_8 (abfd, x, data); -- } -- break; -- -- case 1: -- { -- short x = bfd_get_16 (abfd, data); -- DOIT (x); -- bfd_put_16 (abfd, (bfd_vma) x, data); -- } -- break; -- case 2: -- { -- long x = bfd_get_32 (abfd, data); -- DOIT (x); -- bfd_put_32 (abfd, (bfd_vma) x, data); -- } -- break; -- case 5: -- { -- long x = bfd_get_24 (abfd, data); -- DOIT (x); -- bfd_put_24 (abfd, (bfd_vma) x, data); -- } -- break; -- case -2: -- { -- long x = bfd_get_32 (abfd, data); -- relocation = -relocation; -- DOIT (x); -- bfd_put_32 (abfd, (bfd_vma) x, data); -- } -- break; -- -- case 3: -- /* Do nothing */ -- break; -- -- case 4: -- { -- bfd_vma x = bfd_get_64 (abfd, data); -- DOIT (x); -- bfd_put_64 (abfd, x, data); -- } -- break; -- default: -- return bfd_reloc_other; -- } -- -+ apply_reloc (abfd, data, howto, relocation); - return flag; - } - -@@ -1447,8 +1413,7 @@ _bfd_relocate_contents (reloc_howto_type *howto, - bfd_vma relocation, - bfd_byte *location) - { -- int size; -- bfd_vma x = 0; -+ bfd_vma x; - bfd_reloc_status_type flag; - unsigned int rightshift = howto->rightshift; - unsigned int bitpos = howto->bitpos; -@@ -1459,33 +1424,7 @@ _bfd_relocate_contents (reloc_howto_type *howto, - relocation = -relocation; - - /* Get the value we are going to relocate. */ -- size = bfd_get_reloc_size (howto); -- switch (size) -- { -- default: -- abort (); -- case 0: -- return bfd_reloc_ok; -- case 1: -- x = bfd_get_8 (input_bfd, location); -- break; -- case 2: -- x = bfd_get_16 (input_bfd, location); -- break; -- case 3: -- x = bfd_get_24 (input_bfd, location); -- break; -- case 4: -- x = bfd_get_32 (input_bfd, location); -- break; -- case 8: --#ifdef BFD64 -- x = bfd_get_64 (input_bfd, location); --#else -- abort (); --#endif -- break; -- } -+ x = read_reloc (input_bfd, location, howto); - - /* Check for overflow. FIXME: We may drop bits during the addition - which we don't check for. We must either check at every single -@@ -1591,31 +1530,7 @@ _bfd_relocate_contents (reloc_howto_type *howto, - | (((x & howto->src_mask) + relocation) & howto->dst_mask)); - - /* Put the relocated value back in the object file. */ -- switch (size) -- { -- default: -- abort (); -- case 1: -- bfd_put_8 (input_bfd, x, location); -- break; -- case 2: -- bfd_put_16 (input_bfd, x, location); -- break; -- case 3: -- bfd_put_24 (input_bfd, x, location); -- break; -- case 4: -- bfd_put_32 (input_bfd, x, location); -- break; -- case 8: --#ifdef BFD64 -- bfd_put_64 (input_bfd, x, location); --#else -- abort (); --#endif -- break; -- } -- -+ write_reloc (input_bfd, x, location, howto); - return flag; - } - -@@ -1630,37 +1545,10 @@ _bfd_clear_contents (reloc_howto_type *howto, - asection *input_section, - bfd_byte *location) - { -- int size; -- bfd_vma x = 0; -+ bfd_vma x; - - /* Get the value we are going to relocate. */ -- size = bfd_get_reloc_size (howto); -- switch (size) -- { -- default: -- abort (); -- case 0: -- return; -- case 1: -- x = bfd_get_8 (input_bfd, location); -- break; -- case 2: -- x = bfd_get_16 (input_bfd, location); -- break; -- case 3: -- x = bfd_get_24 (input_bfd, location); -- break; -- case 4: -- x = bfd_get_32 (input_bfd, location); -- break; -- case 8: --#ifdef BFD64 -- x = bfd_get_64 (input_bfd, location); --#else -- abort (); --#endif -- break; -- } -+ x = read_reloc (input_bfd, location, howto); - - /* Zero out the unwanted bits of X. */ - x &= ~howto->dst_mask; -@@ -1673,31 +1561,7 @@ _bfd_clear_contents (reloc_howto_type *howto, - x |= 1; - - /* Put the relocated value back in the object file. */ -- switch (size) -- { -- default: -- case 0: -- abort (); -- case 1: -- bfd_put_8 (input_bfd, x, location); -- break; -- case 2: -- bfd_put_16 (input_bfd, x, location); -- break; -- case 3: -- bfd_put_24 (input_bfd, x, location); -- break; -- case 4: -- bfd_put_32 (input_bfd, x, location); -- break; -- case 8: --#ifdef BFD64 -- bfd_put_64 (input_bfd, x, location); --#else -- abort (); --#endif -- break; -- } -+ write_reloc (input_bfd, x, location, howto); - } - - /* --- -2.19.1 - diff --git a/0004-CVE-2018-18309.patch b/0004-CVE-2018-18309.patch deleted file mode 100644 index 449fb376c9f7dcd7bfe2649db360cc58c7e13ee7..0000000000000000000000000000000000000000 --- a/0004-CVE-2018-18309.patch +++ /dev/null @@ -1,280 +0,0 @@ -From 0930cb3021b8078b34cf216e79eb8608d017864f Mon Sep 17 00:00:00 2001 -From: Alan Modra -Date: Sat, 13 Oct 2018 22:03:02 +1030 -Subject: [PATCH] _bfd_clear_contents bounds checking - -This PR shows a fuzzed binary triggering a segfault via a bad -relocation in .debug_line. It turns out that unlike normal -relocations applied to a section, the linker applies those with -symbols from discarded sections via _bfd_clear_contents without -checking that the relocation is within the section bounds. The same -thing now happens when reading debug sections since commit -a4cd947aca23, the PR23425 fix. - - PR 23770 - PR 23425 - * reloc.c (_bfd_clear_contents): Replace "location" param with - "buf" and "off". Bounds check "off". Return status. - * cofflink.c (_bfd_coff_generic_relocate_section): Update - _bfd_clear_contents call. - * elf-bfd.h (RELOC_AGAINST_DISCARDED_SECTION): Likewise. - * elf32-arc.c (elf_arc_relocate_section): Likewise. - * elf32-i386.c (elf_i386_relocate_section): Likewise. - * elf32-metag.c (metag_final_link_relocate): Likewise. - * elf32-nds32.c (nds32_elf_get_relocated_section_contents): - * Likewise. - * elf32-ppc.c (ppc_elf_relocate_section): Likewise. - * elf32-visium.c (visium_elf_relocate_section): Likewise. - * elf64-ppc.c (ppc64_elf_relocate_section): Likewise. - * elf64-x86-64.c *(elf_x86_64_relocate_section): Likewise. - * libbfd-in.h (_bfd_clear_contents): Update prototype. - * libbfd.h: Regenerate. - -Subject: [PATCH] binutils: CVE-2018-18309 - -url:https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=0930cb3021b8078b34cf216e79eb8608d017864f - ---- - bfd/cofflink.c | 2 +- - bfd/elf-bfd.h | 2 +- - bfd/elf32-arc.c | 2 +- - bfd/elf32-i386.c | 2 +- - bfd/elf32-metag.c | 2 +- - bfd/elf32-nds32.c | 8 ++++---- - bfd/elf32-ppc.c | 2 +- - bfd/elf32-visium.c | 2 +- - bfd/elf64-ppc.c | 2 +- - bfd/elf64-x86-64.c | 2 +- - bfd/libbfd-in.h | 4 ++-- - bfd/libbfd.h | 4 ++-- - bfd/reloc.c | 19 +++++++++++++------ - 13 files changed, 30 insertions(+), 23 deletions(-) - -diff --git a/bfd/cofflink.c b/bfd/cofflink.c -index 2f73f72..b7ea69b 100644 ---- a/bfd/cofflink.c -+++ b/bfd/cofflink.c -@@ -3080,7 +3080,7 @@ _bfd_coff_generic_relocate_section (bfd *output_bfd, - if (sec != NULL && discarded_section (sec)) - { - _bfd_clear_contents (howto, input_bfd, input_section, -- contents + (rel->r_vaddr - input_section->vma)); -+ contents, rel->r_vaddr - input_section->vma); - continue; - } - -diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h -index e8eac7b..bf7dda0 100644 ---- a/bfd/elf-bfd.h -+++ b/bfd/elf-bfd.h -@@ -2811,7 +2811,7 @@ extern asection _bfd_elf_large_com_section; - { \ - int i_; \ - _bfd_clear_contents (howto, input_bfd, input_section, \ -- contents + rel[index].r_offset); \ -+ contents, rel[index].r_offset); \ - \ - if (bfd_link_relocatable (info) \ - && (input_section->flags & SEC_DEBUGGING)) \ -diff --git a/bfd/elf32-arc.c b/bfd/elf32-arc.c -index a48ef0c..2d0346c 100644 ---- a/bfd/elf32-arc.c -+++ b/bfd/elf32-arc.c -@@ -1551,7 +1551,7 @@ elf_arc_relocate_section (bfd * output_bfd, - if (sec != NULL && discarded_section (sec)) - { - _bfd_clear_contents (howto, input_bfd, input_section, -- contents + rel->r_offset); -+ contents, rel->r_offset); - rel->r_info = 0; - rel->r_addend = 0; - -diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c -index 49797dc..1774717 100644 ---- a/bfd/elf32-i386.c -+++ b/bfd/elf32-i386.c -@@ -2197,7 +2197,7 @@ elf_i386_relocate_section (bfd *output_bfd, - if (sec != NULL && discarded_section (sec)) - { - _bfd_clear_contents (howto, input_bfd, input_section, -- contents + rel->r_offset); -+ contents, rel->r_offset); - wrel->r_offset = rel->r_offset; - wrel->r_info = 0; - wrel->r_addend = 0; -diff --git a/bfd/elf32-metag.c b/bfd/elf32-metag.c -index efe95bd..7f96246 100644 ---- a/bfd/elf32-metag.c -+++ b/bfd/elf32-metag.c -@@ -1396,7 +1396,7 @@ metag_final_link_relocate (reloc_howto_type *howto, - rel, relend, howto, contents) \ - { \ - _bfd_clear_contents (howto, input_bfd, input_section, \ -- contents + rel->r_offset); \ -+ contents, rel->r_offset); \ - \ - if (bfd_link_relocatable (info) \ - && (input_section->flags & SEC_DEBUGGING)) \ -diff --git a/bfd/elf32-nds32.c b/bfd/elf32-nds32.c -index 1b30d12..c2e4b49 100644 ---- a/bfd/elf32-nds32.c -+++ b/bfd/elf32-nds32.c -@@ -12582,14 +12582,14 @@ nds32_elf_get_relocated_section_contents (bfd *abfd, - symbol = *(*parent)->sym_ptr_ptr; - if (symbol->section && discarded_section (symbol->section)) - { -- bfd_byte *p; -+ bfd_vma off; - static reloc_howto_type none_howto - = HOWTO (0, 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, - "unused", FALSE, 0, 0, FALSE); - -- p = data + (*parent)->address * bfd_octets_per_byte (input_bfd); -- _bfd_clear_contents ((*parent)->howto, input_bfd, input_section, -- p); -+ off = (*parent)->address * bfd_octets_per_byte (input_bfd); -+ _bfd_clear_contents ((*parent)->howto, input_bfd, -+ input_section, data, off); - (*parent)->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr; - (*parent)->addend = 0; - (*parent)->howto = &none_howto; -diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c -index a54b80d..5dcaa57 100644 ---- a/bfd/elf32-ppc.c -+++ b/bfd/elf32-ppc.c -@@ -8232,7 +8232,7 @@ ppc_elf_relocate_section (bfd *output_bfd, - howto = ppc_elf_howto_table[r_type]; - - _bfd_clear_contents (howto, input_bfd, input_section, -- contents + rel->r_offset); -+ contents, rel->r_offset); - wrel->r_offset = rel->r_offset; - wrel->r_info = 0; - wrel->r_addend = 0; -diff --git a/bfd/elf32-visium.c b/bfd/elf32-visium.c -index e8f1c4c..961366c 100644 ---- a/bfd/elf32-visium.c -+++ b/bfd/elf32-visium.c -@@ -621,7 +621,7 @@ visium_elf_relocate_section (bfd *output_bfd, - or sections discarded by a linker script, we just want the - section contents zeroed. Avoid any special processing. */ - _bfd_clear_contents (howto, input_bfd, input_section, -- contents + rel->r_offset); -+ contents, rel->r_offset); - - rel->r_info = 0; - rel->r_addend = 0; -diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c -index e95db96..addb6a3 100644 ---- a/bfd/elf64-ppc.c -+++ b/bfd/elf64-ppc.c -@@ -14073,7 +14073,7 @@ ppc64_elf_relocate_section (bfd *output_bfd, - { - _bfd_clear_contents (ppc64_elf_howto_table[r_type], - input_bfd, input_section, -- contents + rel->r_offset); -+ contents, rel->r_offset); - wrel->r_offset = rel->r_offset; - wrel->r_info = 0; - wrel->r_addend = 0; -diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c -index c3a6c31..4dcab43 100644 ---- a/bfd/elf64-x86-64.c -+++ b/bfd/elf64-x86-64.c -@@ -2490,7 +2490,7 @@ elf_x86_64_relocate_section (bfd *output_bfd, - if (sec != NULL && discarded_section (sec)) - { - _bfd_clear_contents (howto, input_bfd, input_section, -- contents + rel->r_offset); -+ contents, rel->r_offset); - wrel->r_offset = rel->r_offset; - wrel->r_info = 0; - wrel->r_addend = 0; -diff --git a/bfd/libbfd-in.h b/bfd/libbfd-in.h -index 3c55adf..5b7abb8 100644 ---- a/bfd/libbfd-in.h -+++ b/bfd/libbfd-in.h -@@ -696,8 +696,8 @@ extern bfd_reloc_status_type _bfd_relocate_contents - (reloc_howto_type *, bfd *, bfd_vma, bfd_byte *) ATTRIBUTE_HIDDEN; - - /* Clear a given location using a given howto. */ --extern void _bfd_clear_contents -- (reloc_howto_type *, bfd *, asection *, bfd_byte *) ATTRIBUTE_HIDDEN; -+extern bfd_reloc_status_type _bfd_clear_contents -+ (reloc_howto_type *, bfd *, asection *, bfd_byte *, bfd_vma) ATTRIBUTE_HIDDEN; - - /* Link stabs in sections in the first pass. */ - -diff --git a/bfd/libbfd.h b/bfd/libbfd.h -index 85f61b2..65d34c3 100644 ---- a/bfd/libbfd.h -+++ b/bfd/libbfd.h -@@ -701,8 +701,8 @@ extern bfd_reloc_status_type _bfd_relocate_contents - (reloc_howto_type *, bfd *, bfd_vma, bfd_byte *) ATTRIBUTE_HIDDEN; - - /* Clear a given location using a given howto. */ --extern void _bfd_clear_contents -- (reloc_howto_type *, bfd *, asection *, bfd_byte *) ATTRIBUTE_HIDDEN; -+extern bfd_reloc_status_type _bfd_clear_contents -+ (reloc_howto_type *, bfd *, asection *, bfd_byte *, bfd_vma) ATTRIBUTE_HIDDEN; - - /* Link stabs in sections in the first pass. */ - -diff --git a/bfd/reloc.c b/bfd/reloc.c -index bf2dcb1..ac1e20b 100644 ---- a/bfd/reloc.c -+++ b/bfd/reloc.c -@@ -1539,15 +1539,21 @@ _bfd_relocate_contents (reloc_howto_type *howto, - relocations against discarded symbols, to make ignorable debug or unwind - information more obvious. */ - --void -+bfd_reloc_status_type - _bfd_clear_contents (reloc_howto_type *howto, - bfd *input_bfd, - asection *input_section, -- bfd_byte *location) -+ bfd_byte *buf, -+ bfd_vma off) - { - bfd_vma x; -+ bfd_byte *location; -+ -+ if (!bfd_reloc_offset_in_range (howto, input_bfd, input_section, off)) -+ return bfd_reloc_outofrange; - - /* Get the value we are going to relocate. */ -+ location = buf + off; - x = read_reloc (input_bfd, location, howto); - - /* Zero out the unwanted bits of X. */ -@@ -1562,6 +1568,7 @@ _bfd_clear_contents (reloc_howto_type *howto, - - /* Put the relocated value back in the object file. */ - write_reloc (input_bfd, x, location, howto); -+ return bfd_reloc_ok; - } - - /* -@@ -8149,14 +8156,14 @@ bfd_generic_get_relocated_section_contents (bfd *abfd, - - if (symbol->section && discarded_section (symbol->section)) - { -- bfd_byte *p; -+ bfd_vma off; - static reloc_howto_type none_howto - = HOWTO (0, 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, - "unused", FALSE, 0, 0, FALSE); - -- p = data + (*parent)->address * bfd_octets_per_byte (input_bfd); -- _bfd_clear_contents ((*parent)->howto, input_bfd, input_section, -- p); -+ off = (*parent)->address * bfd_octets_per_byte (input_bfd); -+ _bfd_clear_contents ((*parent)->howto, input_bfd, -+ input_section, data, off); - (*parent)->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr; - (*parent)->addend = 0; - (*parent)->howto = &none_howto; --- -2.19.1 - diff --git a/CVE-2018-1000876.patch b/CVE-2018-1000876.patch deleted file mode 100644 index cebbc0d2ee3116aa1258c0b8c3342f08bd3d7dd6..0000000000000000000000000000000000000000 --- a/CVE-2018-1000876.patch +++ /dev/null @@ -1,170 +0,0 @@ -From 3a551c7a1b80fca579461774860574eabfd7f18f Mon Sep 17 00:00:00 2001 -From: Alan Modra -Date: Sun, 16 Dec 2018 23:02:50 +1030 -Subject: [PATCH] PR23994, libbfd integer overflow - - PR 23994 - * aoutx.h: Include limits.h. - (get_reloc_upper_bound): Detect long overflow and return a file - too big error if it occurs. - * elf.c: Include limits.h. - (_bfd_elf_get_symtab_upper_bound): Detect long overflow and return - a file too big error if it occurs. - (_bfd_elf_get_dynamic_symtab_upper_bound): Likewise. - (_bfd_elf_get_dynamic_reloc_upper_bound): Likewise. -url:https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=3a551c7a1b80fca579461774860574eabfd7f18f -diff --git a/bfd/aoutx.h b/bfd/aoutx.h -index 023843b0be..78eaa9c503 100644 ---- a/bfd/aoutx.h -+++ b/bfd/aoutx.h -@@ -117,6 +117,7 @@ DESCRIPTION - #define KEEPIT udata.i - - #include "sysdep.h" -+#include - #include "bfd.h" - #include "safe-ctype.h" - #include "bfdlink.h" -@@ -2491,6 +2492,8 @@ NAME (aout, canonicalize_reloc) (bfd *abfd, - long - NAME (aout, get_reloc_upper_bound) (bfd *abfd, sec_ptr asect) - { -+ bfd_size_type count; -+ - if (bfd_get_format (abfd) != bfd_object) - { - bfd_set_error (bfd_error_invalid_operation); -@@ -2498,26 +2501,25 @@ NAME (aout, get_reloc_upper_bound) (bfd *abfd, sec_ptr asect) - } - - if (asect->flags & SEC_CONSTRUCTOR) -- return sizeof (arelent *) * (asect->reloc_count + 1); -- -- if (asect == obj_datasec (abfd)) -- return sizeof (arelent *) -- * ((exec_hdr (abfd)->a_drsize / obj_reloc_entry_size (abfd)) -- + 1); -- -- if (asect == obj_textsec (abfd)) -- return sizeof (arelent *) -- * ((exec_hdr (abfd)->a_trsize / obj_reloc_entry_size (abfd)) -- + 1); -- -- if (asect == obj_bsssec (abfd)) -- return sizeof (arelent *); -- -- if (asect == obj_bsssec (abfd)) -- return 0; -+ count = asect->reloc_count; -+ else if (asect == obj_datasec (abfd)) -+ count = exec_hdr (abfd)->a_drsize / obj_reloc_entry_size (abfd); -+ else if (asect == obj_textsec (abfd)) -+ count = exec_hdr (abfd)->a_trsize / obj_reloc_entry_size (abfd); -+ else if (asect == obj_bsssec (abfd)) -+ count = 0; -+ else -+ { -+ bfd_set_error (bfd_error_invalid_operation); -+ return -1; -+ } - -- bfd_set_error (bfd_error_invalid_operation); -- return -1; -+ if (count >= LONG_MAX / sizeof (arelent *)) -+ { -+ bfd_set_error (bfd_error_file_too_big); -+ return -1; -+ } -+ return (count + 1) * sizeof (arelent *); - } - - long -diff --git a/bfd/elf.c b/bfd/elf.c -index 688429b73e..b10dcd83c5 100644 ---- a/bfd/elf.c -+++ b/bfd/elf.c -@@ -35,6 +35,7 @@ SECTION - /* For sparc64-cross-sparc32. */ - #define _SYSCALL32 - #include "sysdep.h" -+#include - #include "bfd.h" - #include "bfdlink.h" - #include "libbfd.h" -@@ -8215,11 +8216,16 @@ error_return: - long - _bfd_elf_get_symtab_upper_bound (bfd *abfd) - { -- long symcount; -+ bfd_size_type symcount; - long symtab_size; - Elf_Internal_Shdr *hdr = &elf_tdata (abfd)->symtab_hdr; - - symcount = hdr->sh_size / get_elf_backend_data (abfd)->s->sizeof_sym; -+ if (symcount >= LONG_MAX / sizeof (asymbol *)) -+ { -+ bfd_set_error (bfd_error_file_too_big); -+ return -1; -+ } - symtab_size = (symcount + 1) * (sizeof (asymbol *)); - if (symcount > 0) - symtab_size -= sizeof (asymbol *); -@@ -8230,7 +8236,7 @@ _bfd_elf_get_symtab_upper_bound (bfd *abfd) - long - _bfd_elf_get_dynamic_symtab_upper_bound (bfd *abfd) - { -- long symcount; -+ bfd_size_type symcount; - long symtab_size; - Elf_Internal_Shdr *hdr = &elf_tdata (abfd)->dynsymtab_hdr; - -@@ -8241,6 +8247,11 @@ _bfd_elf_get_dynamic_symtab_upper_bound (bfd *abfd) - } - - symcount = hdr->sh_size / get_elf_backend_data (abfd)->s->sizeof_sym; -+ if (symcount >= LONG_MAX / sizeof (asymbol *)) -+ { -+ bfd_set_error (bfd_error_file_too_big); -+ return -1; -+ } - symtab_size = (symcount + 1) * (sizeof (asymbol *)); - if (symcount > 0) - symtab_size -= sizeof (asymbol *); -@@ -8310,7 +8321,7 @@ _bfd_elf_canonicalize_dynamic_symtab (bfd *abfd, - long - _bfd_elf_get_dynamic_reloc_upper_bound (bfd *abfd) - { -- long ret; -+ bfd_size_type count; - asection *s; - - if (elf_dynsymtab (abfd) == 0) -@@ -8319,15 +8330,20 @@ _bfd_elf_get_dynamic_reloc_upper_bound (bfd *abfd) - return -1; - } - -- ret = sizeof (arelent *); -+ count = 1; - for (s = abfd->sections; s != NULL; s = s->next) - if (elf_section_data (s)->this_hdr.sh_link == elf_dynsymtab (abfd) - && (elf_section_data (s)->this_hdr.sh_type == SHT_REL - || elf_section_data (s)->this_hdr.sh_type == SHT_RELA)) -- ret += ((s->size / elf_section_data (s)->this_hdr.sh_entsize) -- * sizeof (arelent *)); -- -- return ret; -+ { -+ count += s->size / elf_section_data (s)->this_hdr.sh_entsize; -+ if (count > LONG_MAX / sizeof (arelent *)) -+ { -+ bfd_set_error (bfd_error_file_too_big); -+ return -1; -+ } -+ } -+ return count * sizeof (arelent *); - } - - /* Canonicalize the dynamic relocation entries. Note that we return the --- -2.19.1 - diff --git a/CVE-2018-12697.patch b/CVE-2018-12697.patch deleted file mode 100644 index 76b2777e636697c88ccbefe055113354fe97ca65..0000000000000000000000000000000000000000 --- a/CVE-2018-12697.patch +++ /dev/null @@ -1,270 +0,0 @@ -From 03e51746ed98d9106803f6009ebd71ea670ad3b9 Mon Sep 17 00:00:00 2001 -From: nickc -Date: Fri, 7 Dec 2018 10:33:30 +0000 -Subject: [PATCH] Add a recursion limit to libiberty's demangling code. The - limit is enabled by default, but can be disabled via a new demangling option. - -include * demangle.h (DMGL_NO_RECURSE_LIMIT): Define. - (DEMANGLE_RECURSION_LIMIT): Define - - PR 87681 - PR 87675 - PR 87636 - PR 87350 - PR 87335 -libiberty * cp-demangle.h (struct d_info): Add recursion_level field. - * cp-demangle.c (d_function_type): Add recursion counter. - If the recursion limit is reached and the check is not disabled, - then return with a failure result. - (cplus_demangle_init_info): Initialise the recursion_level field. - (d_demangle_callback): If the recursion limit is enabled, check - for a mangled string that is so long that there is not enough - stack space for the local arrays. - * cplus-dem.c (struct work): Add recursion_level field. - (squangle_mop_up): Set the numb and numk fields to zero. - (work_stuff_copy_to_from): Handle the case where a btypevec or - ktypevec field is NULL. - (demangle_nested_args): Add recursion counter. If - the recursion limit is not disabled and reached, return with a - failure result. - - -git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@266886 138bc75d-0d04-0410-961f-82ee72b054a4 ---- - include/demangle.h | 11 +++++++++++ - libiberty/cp-demangle.c | 51 ++++++++++++++++++++++++++++++++++++++----------- - libiberty/cp-demangle.h | 3 +++ - libiberty/cplus-dem.c | 37 +++++++++++++++++++++++++++++++++-- - 4 files changed, 89 insertions(+), 13 deletions(-) - -diff --git a/include/demangle.h b/include/demangle.h -index 4f920f2..1e67fe2 100644 ---- a/include/demangle.h -+++ b/include/demangle.h -@@ -68,6 +68,17 @@ extern "C" { - /* If none of these are set, use 'current_demangling_style' as the default. */ - #define DMGL_STYLE_MASK (DMGL_AUTO|DMGL_GNU|DMGL_LUCID|DMGL_ARM|DMGL_HP|DMGL_EDG|DMGL_GNU_V3|DMGL_JAVA|DMGL_GNAT|DMGL_DLANG|DMGL_RUST) - -+/* Disable a limit on the depth of recursion in mangled strings. -+ Note if this limit is disabled then stack exhaustion is possible when -+ demangling pathologically complicated strings. Bug reports about stack -+ exhaustion when the option is enabled will be rejected. */ -+#define DMGL_NO_RECURSE_LIMIT (1 << 18) -+ -+/* If DMGL_NO_RECURSE_LIMIT is not enabled, then this is the value used as -+ the maximum depth of recursion allowed. It should be enough for any -+ real-world mangled name. */ -+#define DEMANGLE_RECURSION_LIMIT 1024 -+ - /* Enumeration of possible demangling styles. - - Lucid and ARM styles are still kept logically distinct, even though -diff --git a/libiberty/cp-demangle.c b/libiberty/cp-demangle.c -index a1f74a5..47bbc94 100644 ---- a/libiberty/cp-demangle.c -+++ b/libiberty/cp-demangle.c -@@ -2852,21 +2852,35 @@ d_ref_qualifier (struct d_info *di, struct demangle_component *sub) - static struct demangle_component * - d_function_type (struct d_info *di) - { -- struct demangle_component *ret; -+ struct demangle_component *ret = NULL; - -- if (! d_check_char (di, 'F')) -- return NULL; -- if (d_peek_char (di) == 'Y') -+ if ((di->options & DMGL_NO_RECURSE_LIMIT) == 0) - { -- /* Function has C linkage. We don't print this information. -- FIXME: We should print it in verbose mode. */ -- d_advance (di, 1); -+ if (di->recursion_level > DEMANGLE_RECURSION_LIMIT) -+ /* FIXME: There ought to be a way to report -+ that the recursion limit has been reached. */ -+ return NULL; -+ -+ di->recursion_level ++; - } -- ret = d_bare_function_type (di, 1); -- ret = d_ref_qualifier (di, ret); - -- if (! d_check_char (di, 'E')) -- return NULL; -+ if (d_check_char (di, 'F')) -+ { -+ if (d_peek_char (di) == 'Y') -+ { -+ /* Function has C linkage. We don't print this information. -+ FIXME: We should print it in verbose mode. */ -+ d_advance (di, 1); -+ } -+ ret = d_bare_function_type (di, 1); -+ ret = d_ref_qualifier (di, ret); -+ -+ if (! d_check_char (di, 'E')) -+ ret = NULL; -+ } -+ -+ if ((di->options & DMGL_NO_RECURSE_LIMIT) == 0) -+ di->recursion_level --; - return ret; - } - -@@ -6203,6 +6217,7 @@ cplus_demangle_init_info (const char *mangled, int options, size_t len, - di->expansion = 0; - di->is_expression = 0; - di->is_conversion = 0; -+ di->recursion_level = 0; - } - - /* Internal implementation for the demangler. If MANGLED is a g++ v3 ABI -@@ -6242,6 +6257,20 @@ d_demangle_callback (const char *mangled, int options, - - cplus_demangle_init_info (mangled, options, strlen (mangled), &di); - -+ /* PR 87675 - Check for a mangled string that is so long -+ that we do not have enough stack space to demangle it. */ -+ if (((options & DMGL_NO_RECURSE_LIMIT) == 0) -+ /* This check is a bit arbitrary, since what we really want to do is to -+ compare the sizes of the di.comps and di.subs arrays against the -+ amount of stack space remaining. But there is no portable way to do -+ this, so instead we use the recursion limit as a guide to the maximum -+ size of the arrays. */ -+ && (unsigned long) di.num_comps > DEMANGLE_RECURSION_LIMIT) -+ { -+ /* FIXME: We need a way to indicate that a stack limit has been reached. */ -+ return 0; -+ } -+ - { - #ifdef CP_DYNAMIC_ARRAYS - __extension__ struct demangle_component comps[di.num_comps]; -diff --git a/libiberty/cp-demangle.h b/libiberty/cp-demangle.h -index 51b8a24..d87a830 100644 ---- a/libiberty/cp-demangle.h -+++ b/libiberty/cp-demangle.h -@@ -122,6 +122,9 @@ struct d_info - /* Non-zero if we are parsing the type operand of a conversion - operator, but not when in an expression. */ - int is_conversion; -+ /* If DMGL_NO_RECURSE_LIMIT is not active then this is set to -+ the current recursion level. */ -+ unsigned int recursion_level; - }; - - /* To avoid running past the ending '\0', don't: -diff --git a/libiberty/cplus-dem.c b/libiberty/cplus-dem.c -index 4f29d54..48c0cfd 100644 ---- a/libiberty/cplus-dem.c -+++ b/libiberty/cplus-dem.c -@@ -146,6 +146,7 @@ struct work_stuff - int *proctypevec; /* Indices of currently processed remembered typevecs. */ - int proctypevec_size; - int nproctypes; -+ unsigned int recursion_level; - }; - - #define PRINT_ANSI_QUALIFIERS (work -> options & DMGL_ANSI) -@@ -1292,12 +1293,14 @@ squangle_mop_up (struct work_stuff *work) - free ((char *) work -> btypevec); - work->btypevec = NULL; - work->bsize = 0; -+ work->numb = 0; - } - if (work -> ktypevec != NULL) - { - free ((char *) work -> ktypevec); - work->ktypevec = NULL; - work->ksize = 0; -+ work->numk = 0; - } - } - -@@ -1331,8 +1334,15 @@ work_stuff_copy_to_from (struct work_stuff *to, struct work_stuff *from) - - for (i = 0; i < from->numk; i++) - { -- int len = strlen (from->ktypevec[i]) + 1; -+ int len; -+ -+ if (from->ktypevec[i] == NULL) -+ { -+ to->ktypevec[i] = NULL; -+ continue; -+ } - -+ len = strlen (from->ktypevec[i]) + 1; - to->ktypevec[i] = XNEWVEC (char, len); - memcpy (to->ktypevec[i], from->ktypevec[i], len); - } -@@ -1342,8 +1352,15 @@ work_stuff_copy_to_from (struct work_stuff *to, struct work_stuff *from) - - for (i = 0; i < from->numb; i++) - { -- int len = strlen (from->btypevec[i]) + 1; -+ int len; -+ -+ if (from->btypevec[i] == NULL) -+ { -+ to->btypevec[i] = NULL; -+ continue; -+ } - -+ len = strlen (from->btypevec[i]) + 1; - to->btypevec[i] = XNEWVEC (char , len); - memcpy (to->btypevec[i], from->btypevec[i], len); - } -@@ -1401,6 +1418,7 @@ delete_non_B_K_work_stuff (struct work_stuff *work) - - free ((char*) work->tmpl_argvec); - work->tmpl_argvec = NULL; -+ work->ntmpl_args = 0; - } - if (work->previous_argument) - { -@@ -4478,6 +4496,7 @@ remember_Btype (struct work_stuff *work, const char *start, - } - - /* Lose all the info related to B and K type codes. */ -+ - static void - forget_B_and_K_types (struct work_stuff *work) - { -@@ -4503,6 +4522,7 @@ forget_B_and_K_types (struct work_stuff *work) - } - } - } -+ - /* Forget the remembered types, but not the type vector itself. */ - - static void -@@ -4697,6 +4717,16 @@ demangle_nested_args (struct work_stuff *work, const char **mangled, - int result; - int saved_nrepeats; - -+ if ((work->options & DMGL_NO_RECURSE_LIMIT) == 0) -+ { -+ if (work->recursion_level > DEMANGLE_RECURSION_LIMIT) -+ /* FIXME: There ought to be a way to report -+ that the recursion limit has been reached. */ -+ return 0; -+ -+ work->recursion_level ++; -+ } -+ - /* The G++ name-mangling algorithm does not remember types on nested - argument lists, unless -fsquangling is used, and in that case the - type vector updated by remember_type is not used. So, we turn -@@ -4723,6 +4753,9 @@ demangle_nested_args (struct work_stuff *work, const char **mangled, - --work->forgetting_types; - work->nrepeats = saved_nrepeats; - -+ if ((work->options & DMGL_NO_RECURSE_LIMIT) == 0) -+ --work->recursion_level; -+ - return result; - } - --- -2.9.3 - diff --git a/CVE-2018-17358.patch b/CVE-2018-17358.patch deleted file mode 100644 index d0ba9acd1b86e63eb888c2cf48df98a4ff5524a3..0000000000000000000000000000000000000000 --- a/CVE-2018-17358.patch +++ /dev/null @@ -1,121 +0,0 @@ -From 30838132997e6a3cfe3ec11c58b32b22f6f6b102 Mon Sep 17 00:00:00 2001 -From: Alan Modra -Date: Thu, 20 Sep 2018 15:29:17 +0930 -Subject: [PATCH 1/1] Bug 23686, two segment faults in nm - -Fixes the bugs exposed by the testcases in the PR, plus two more bugs -I noticed when looking at _bfd_stab_section_find_nearest_line. - - PR 23686 - * dwarf2.c (read_section): Error when attempting to malloc - "(bfd_size_type) -1". - * syms.c (_bfd_stab_section_find_nearest_line): Bounds check - function_name. Bounds check reloc address. Formatting. Ensure - .stabstr zero terminated. ---- -diff -urNp a/bfd/ChangeLog b/bfd/ChangeLog ---- a/bfd/ChangeLog 2019-06-05 22:52:23.600000000 +0800 -+++ b/bfd/ChangeLog 2019-06-05 22:55:03.060000000 +0800 -@@ -1,3 +1,11 @@ -+2018-09-20 Alan Modra -+ PR 23686 -+ * dwarf2.c (read_section): Error when attempting to malloc -+ "(bfd_size_type) -1". -+ * syms.c (_bfd_stab_section_find_nearest_line): Bounds check -+ function_name. Bounds check reloc address. Formatting. Ensure -+ .stabstr zero terminated. -+ - 2018-07-18 Nick Clifton - - 2.31.1 Release point. -diff -urNp a/bfd/dwarf2.c b/bfd/dwarf2.c ---- a/bfd/dwarf2.c 2019-06-05 22:52:23.950000000 +0800 -+++ b/bfd/dwarf2.c 2019-06-05 23:09:09.540000000 +0800 -@@ -527,6 +527,7 @@ read_section (bfd * abfd, - asection *msec; - const char *section_name = sec->uncompressed_name; - bfd_byte *contents = *section_buffer; -+ bfd_size_type amt; - - /* The section may have already been read. */ - if (contents == NULL) -@@ -549,7 +550,13 @@ read_section (bfd * abfd, - *section_size = msec->rawsize ? msec->rawsize : msec->size; - /* Paranoia - alloc one extra so that we can make sure a string - section is NUL terminated. */ -- contents = (bfd_byte *) bfd_malloc (*section_size + 1); -+ amt = *section_size + 1; -+ if (amt == 0) -+ { -+ bfd_set_error (bfd_error_no_memory); -+ return FALSE; -+ } -+ contents = (bfd_byte *) bfd_malloc (amt); - if (contents == NULL) - return FALSE; - if (syms -diff -urNp a/bfd/syms.c b/bfd/syms.c ---- a/bfd/syms.c 2019-06-05 22:52:24.840000000 +0800 -+++ b/bfd/syms.c 2019-06-05 23:38:05.300000000 +0800 -@@ -1035,6 +1035,11 @@ _bfd_stab_section_find_nearest_line (bfd - 0, strsize)) - return FALSE; - -+ /* Stab strings ought to be nul terminated. Ensure the last one -+ is, to prevent running off the end of the buffer. */ -+ info->strs[strsize - 1] = 0; -+ -+ - /* If this is a relocatable object file, we have to relocate - the entries in .stab. This should always be simple 32 bit - relocations against symbols defined in this object file, so -@@ -1073,7 +1078,8 @@ _bfd_stab_section_find_nearest_line (bfd - || r->howto->bitsize != 32 - || r->howto->pc_relative - || r->howto->bitpos != 0 -- || r->howto->dst_mask != 0xffffffff) -+ || r->howto->dst_mask != 0xffffffff -+ || r->address * bfd_octets_per_byte (abfd) + 4 > stabsize) - { - _bfd_error_handler - (_("unsupported .stab relocation")); -@@ -1195,7 +1201,8 @@ _bfd_stab_section_find_nearest_line (bfd - { - nul_fun = stab; - nul_str = str; -- if (file_name >= (char *) info->strs + strsize || file_name < (char *) str) -+ if (file_name >= (char *) info->strs + strsize -+ || file_name < (char *) str) - file_name = NULL; - if (stab + STABSIZE + TYPEOFF < info->stabs + stabsize - && *(stab + STABSIZE + TYPEOFF) == (bfd_byte) N_SO) -@@ -1206,7 +1213,8 @@ _bfd_stab_section_find_nearest_line (bfd - directory_name = file_name; - file_name = ((char *) str - + bfd_get_32 (abfd, stab + STRDXOFF)); -- if (file_name >= (char *) info->strs + strsize || file_name < (char *) str) -+ if (file_name >= (char *) info->strs + strsize -+ || file_name < (char *) str) - file_name = NULL; - } - } -@@ -1217,7 +1225,8 @@ _bfd_stab_section_find_nearest_line (bfd - file_name = (char *) str + bfd_get_32 (abfd, stab + STRDXOFF); - /* PR 17512: file: 0c680a1f. */ - /* PR 17512: file: 5da8aec4. */ -- if (file_name >= (char *) info->strs + strsize || file_name < (char *) str) -+ if (file_name >= (char *) info->strs + strsize -+ || file_name < (char *) str) - file_name = NULL; - break; - -@@ -1335,7 +1344,8 @@ _bfd_stab_section_find_nearest_line (bfd - if (val <= offset) - { - file_name = (char *) str + bfd_get_32 (abfd, stab + STRDXOFF); -- if (file_name >= (char *) info->strs + strsize || file_name < (char *) str) -+ if (file_name >= (char *) info->strs + strsize -+ || file_name < (char *) str) - file_name = NULL; - *pline = 0; - } diff --git a/CVE-2018-17360.patch b/CVE-2018-17360.patch deleted file mode 100644 index feeb50952aeac25518c6b19fab262ec21fcb3f68..0000000000000000000000000000000000000000 --- a/CVE-2018-17360.patch +++ /dev/null @@ -1,52 +0,0 @@ -From cf93e9c2cf8f8b2566f8fc86e961592b51b5980d Mon Sep 17 00:00:00 2001 -From: Alan Modra -Date: Thu, 20 Sep 2018 18:23:17 +0930 -Subject: [PATCH 1/1] PR23685, buffer overflow - - PR 23685 - * peXXigen.c (pe_print_edata): Correct export address table - overflow checks. Check dataoff against section size too. ---- - -diff -urNp a/bfd/ChangeLog b/bfd/ChangeLog ---- a/bfd/ChangeLog 2019-06-05 23:46:11.460000000 +0800 -+++ b/bfd/ChangeLog 2019-06-05 23:59:36.030000000 +0800 -@@ -1,4 +1,9 @@ - 2018-09-20 Alan Modra -+ PR 23685 -+ * peXXigen.c (pe_print_edata): Correct export address table -+ overflow checks. Check dataoff against section size too. -+ -+2018-09-20 Alan Modra - PR 23686 - * dwarf2.c (read_section): Error when attempting to malloc - "(bfd_size_type) -1". -diff -urNp a/bfd/peXXigen.c b/bfd/peXXigen.c ---- a/bfd/peXXigen.c 2019-06-05 23:46:11.460000000 +0800 -+++ b/bfd/peXXigen.c 2019-06-06 00:03:40.100000000 +0800 -@@ -1661,7 +1661,8 @@ pe_print_edata (bfd * abfd, void * vfile - - dataoff = addr - section->vma; - datasize = extra->DataDirectory[PE_EXPORT_TABLE].Size; -- if (datasize > section->size - dataoff) -+ if (dataoff > section->size -+ || datasize > section->size - dataoff) - { - fprintf (file, - _("\nThere is an export table in %s, but it does not fit into that section\n"), -@@ -1778,11 +1779,11 @@ pe_print_edata (bfd * abfd, void * vfile - edt.base); - - /* PR 17512: Handle corrupt PE binaries. */ -- if (edt.eat_addr + (edt.num_functions * 4) - adj >= datasize -+ /* PR 17512 file: 140-165018-0.004. */ -+ if (edt.eat_addr - adj >= datasize - /* PR 17512: file: 092b1829 */ -- || (edt.num_functions * 4) < edt.num_functions -- /* PR 17512 file: 140-165018-0.004. */ -- || data + edt.eat_addr - adj < data) -+ || (edt.num_functions + 1) * 4 < edt.num_functions -+ || edt.eat_addr - adj + (edt.num_functions + 1) * 4 > datasize) - fprintf (file, _("\tInvalid Export Address Table rva (0x%lx) or entry count (0x%lx)\n"), - (long) edt.eat_addr, - (long) edt.num_functions); diff --git a/CVE-2018-18605.patch b/CVE-2018-18605.patch deleted file mode 100644 index ec213710f27fc4c284a15fe5ae3ed56e9d3bc9e3..0000000000000000000000000000000000000000 --- a/CVE-2018-18605.patch +++ /dev/null @@ -1,26 +0,0 @@ -From ab419ddbb2cdd17ca83618990f2cacf904ce1d61 Mon Sep 17 00:00:00 2001 -From: Alan Modra -Date: Tue, 23 Oct 2018 18:29:24 +1030 -Subject: [PATCH] PR23804, buffer overflow in sec_merge_hash_lookup - - PR 23804 - * merge.c (_bfd_add_merge_section): Don't attempt to merge - sections where size is not a multiple of entsize. -url:https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=ab419ddbb2cdd17ca83618990f2cacf904ce1d61 -diff --git a/bfd/merge.c b/bfd/merge.c -index 7904552942..5e3bba0982 100644 ---- a/bfd/merge.c -+++ b/bfd/merge.c -@@ -376,6 +376,9 @@ _bfd_add_merge_section (bfd *abfd, void **psinfo, asection *sec, - || sec->entsize == 0) - return TRUE; - -+ if (sec->size % sec->entsize != 0) -+ return TRUE; -+ - if ((sec->flags & SEC_RELOC) != 0) - { - /* We aren't prepared to handle relocations in merged sections. */ --- -2.19.1 - diff --git a/CVE-2018-18606.patch b/CVE-2018-18606.patch deleted file mode 100644 index ed57ced2e6bec777d90752614c34a7f01f9b7872..0000000000000000000000000000000000000000 --- a/CVE-2018-18606.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 45a0eaf77022963d639d6d19871dbab7b79703fc Mon Sep 17 00:00:00 2001 -From: Alan Modra -Date: Tue, 23 Oct 2018 19:02:06 +1030 -Subject: [PATCH] PR23806, NULL pointer dereference in merge_strings - - PR 23806 - * merge.c (_bfd_add_merge_section): Don't attempt to merge - sections with ridiculously large alignments. -url:https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=45a0eaf77022963d639d6d19871dbab7b79703fc -diff --git a/bfd/merge.c b/bfd/merge.c -index 5e3bba0982..7de0c886df 100644 ---- a/bfd/merge.c -+++ b/bfd/merge.c -@@ -24,6 +24,7 @@ - as used in ELF SHF_MERGE. */ - - #include "sysdep.h" -+#include - #include "bfd.h" - #include "elf-bfd.h" - #include "libbfd.h" -@@ -385,12 +386,18 @@ _bfd_add_merge_section (bfd *abfd, void **psinfo, asection *sec, - return TRUE; - } - -- align = sec->alignment_power; -- if ((sec->entsize < (unsigned) 1 << align -+#ifndef CHAR_BIT -+#define CHAR_BIT 8 -+#endif -+ if (sec->alignment_power >= sizeof (align) * CHAR_BIT) -+ return TRUE; -+ -+ align = 1u << sec->alignment_power; -+ if ((sec->entsize < align - && ((sec->entsize & (sec->entsize - 1)) - || !(sec->flags & SEC_STRINGS))) -- || (sec->entsize > (unsigned) 1 << align -- && (sec->entsize & (((unsigned) 1 << align) - 1)))) -+ || (sec->entsize > align -+ && (sec->entsize & (align - 1)))) - { - /* Sanity check. If string character size is smaller than - alignment, then we require character size to be a power --- -2.19.1 - diff --git a/CVE-2018-18607.patch b/CVE-2018-18607.patch deleted file mode 100644 index 2f30aeefa0181028a67a4c2aeaf8cb631e00e329..0000000000000000000000000000000000000000 --- a/CVE-2018-18607.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 102def4da826b3d9e169741421e5e67e8731909a Mon Sep 17 00:00:00 2001 -From: Alan Modra -Date: Tue, 23 Oct 2018 18:30:22 +1030 -Subject: [PATCH] PR23805, NULL pointer dereference in elf_link_input_bfd - - PR 23805 - * elflink.c (elf_link_input_bfd): Don't segfault on finding - STT_TLS symbols without any TLS sections. Instead, change the - symbol type to STT_NOTYPE. -url:https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=102def4da826b3d9e169741421e5e67e8731909a -diff --git a/bfd/elflink.c b/bfd/elflink.c -index c3876cbf3e..87440db960 100644 ---- a/bfd/elflink.c -+++ b/bfd/elflink.c -@@ -10489,8 +10489,11 @@ elf_link_input_bfd (struct elf_final_link_info *flinfo, bfd *input_bfd) - if (ELF_ST_TYPE (osym.st_info) == STT_TLS) - { - /* STT_TLS symbols are relative to PT_TLS segment base. */ -- BFD_ASSERT (elf_hash_table (flinfo->info)->tls_sec != NULL); -- osym.st_value -= elf_hash_table (flinfo->info)->tls_sec->vma; -+ if (elf_hash_table (flinfo->info)->tls_sec != NULL) -+ osym.st_value -= elf_hash_table (flinfo->info)->tls_sec->vma; -+ else -+ osym.st_info = ELF_ST_INFO (ELF_ST_BIND (osym.st_info), -+ STT_NOTYPE); - } - } - -@@ -11046,12 +11049,17 @@ elf_link_input_bfd (struct elf_final_link_info *flinfo, bfd *input_bfd) - sym.st_value += osec->vma; - if (ELF_ST_TYPE (sym.st_info) == STT_TLS) - { -+ struct elf_link_hash_table *htab -+ = elf_hash_table (flinfo->info); -+ - /* STT_TLS symbols are relative to PT_TLS - segment base. */ -- BFD_ASSERT (elf_hash_table (flinfo->info) -- ->tls_sec != NULL); -- sym.st_value -= (elf_hash_table (flinfo->info) -- ->tls_sec->vma); -+ if (htab->tls_sec != NULL) -+ sym.st_value -= htab->tls_sec->vma; -+ else -+ sym.st_info -+ = ELF_ST_INFO (ELF_ST_BIND (sym.st_info), -+ STT_NOTYPE); - } - } - --- -2.19.1 - diff --git a/CVE-2018-19931.patch b/CVE-2018-19931.patch deleted file mode 100644 index 4b52c17b81275c0e8f773db3840844ca1bcf7505..0000000000000000000000000000000000000000 --- a/CVE-2018-19931.patch +++ /dev/null @@ -1,16 +0,0 @@ ---- a/bfd/elfcode.h 2018-06-25 02:38:57.000000000 +0800 -+++ b/bfd/elfcode.h 2019-04-04 12:04:52.258000000 +0800 -@@ -776,7 +776,12 @@ elf_object_p (bfd *abfd) - if (i_ehdrp->e_phnum > ((bfd_size_type) -1) / sizeof (*i_phdr)) - goto got_wrong_format_error; - #endif -- amt = (bfd_size_type) i_ehdrp->e_phnum * sizeof (*i_phdr); -+ /* Check for a corrupt input file with an impossibly large number -+ of program headers. */ -+ if (bfd_get_file_size (abfd) > 0 -+ && i_ehdrp->e_phnum > bfd_get_file_size (abfd)) -+ goto got_no_match; -+ amt = (bfd_size_type) i_ehdrp->e_phnum * sizeof (*i_phdr); - elf_tdata (abfd)->phdr = (Elf_Internal_Phdr *) bfd_alloc (abfd, amt); - if (elf_tdata (abfd)->phdr == NULL) - goto got_no_match; diff --git a/CVE-2018-19932.patch b/CVE-2018-19932.patch deleted file mode 100644 index 48d5f607a996bc36867af274179ff2167d6c6ae5..0000000000000000000000000000000000000000 --- a/CVE-2018-19932.patch +++ /dev/null @@ -1,29 +0,0 @@ ---- a/bfd/elf.c 2019-04-04 11:32:43.076000000 +0800 -+++ b/bfd/elf.c 2019-04-04 12:09:04.267000000 +0800 -@@ -6592,6 +6592,7 @@ rewrite_elf_program_header (bfd *ibfd, b - the given segment. LMA addresses are compared. */ - #define IS_CONTAINED_BY_LMA(section, segment, base) \ - (section->lma >= base \ -+ && (section->lma + SECTION_SIZE (section, segment) >= section->lma) \ - && (section->lma + SECTION_SIZE (section, segment) \ - <= SEGMENT_END (segment, base))) - -@@ -7114,8 +7115,16 @@ rewrite_elf_program_header (bfd *ibfd, b - suggested_lma = output_section; - } - -- BFD_ASSERT (map->count > 0); -- -+ /* PR 23932. A corrupt input file may contain sections that cannot -+ be assigned to any segment - because for example they have a -+ negative size - or segments that do not contain any sections. */ -+ if (map->count == 0) -+ { -+ bfd_set_error (bfd_error_bad_value); -+ free (sections); -+ return FALSE; -+ } -+ - /* Add the current segment to the list of built segments. */ - *pointer_to_map = map; - pointer_to_map = &map->next; diff --git a/CVE-2018-20002.patch b/CVE-2018-20002.patch deleted file mode 100644 index cd393fa62be05998f0c1be148ec7ce542a734f39..0000000000000000000000000000000000000000 --- a/CVE-2018-20002.patch +++ /dev/null @@ -1,65 +0,0 @@ -From c2f5dc30afa34696f2da0081c4ac50b958ecb0e9 Mon Sep 17 00:00:00 2001 -From: Alan Modra -Date: Fri, 7 Dec 2018 23:39:42 +1030 -Subject: [PATCH] PR23952, memory leak in _bfd_generic_read_minisymbols - -bfd/ - PR 23952 - * syms.c (_bfd_generic_read_minisymbols): Free syms before - returning with zero symcount. -binutils/ - * nm.c (display_rel_file): Use xrealloc to increase minisyms - for synthetic symbols. -url:https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=c2f5dc30afa34696f2da0081c4ac50b958ecb0e9 -diff --git a/bfd/syms.c b/bfd/syms.c -index e09640ab74..cbf85cb16d 100644 ---- a/bfd/syms.c -+++ b/bfd/syms.c -@@ -822,9 +822,16 @@ _bfd_generic_read_minisymbols (bfd *abfd, - if (symcount < 0) - goto error_return; - -- *minisymsp = syms; -- *sizep = sizeof (asymbol *); -- -+ if (symcount == 0) -+ /* We return 0 above when storage is 0. Exit in the same state -+ here, so as to not complicate callers with having to deal with -+ freeing memory for zero symcount. */ -+ free (syms); -+ else -+ { -+ *minisymsp = syms; -+ *sizep = sizeof (asymbol *); -+ } - return symcount; - - error_return: -diff --git a/binutils/nm.c b/binutils/nm.c -index 8807832f97..39083c3f4e 100644 ---- a/binutils/nm.c -+++ b/binutils/nm.c -@@ -1175,17 +1175,14 @@ display_rel_file (bfd *abfd, bfd *archive_bfd) - if (synth_count > 0) - { - asymbol **symp; -- void *new_mini; - long i; - -- new_mini = xmalloc ((symcount + synth_count + 1) * sizeof (*symp)); -- symp = (asymbol **) new_mini; -- memcpy (symp, minisyms, symcount * sizeof (*symp)); -- symp += symcount; -+ minisyms = xrealloc (minisyms, -+ (symcount + synth_count + 1) * sizeof (*symp)); -+ symp = (asymbol **) minisyms + symcount; - for (i = 0; i < synth_count; i++) - *symp++ = synthsyms + i; - *symp = 0; -- minisyms = new_mini; - symcount += synth_count; - } - } --- -2.19.1 - diff --git a/CVE-2018-20623.patch b/CVE-2018-20623.patch deleted file mode 100644 index ec9b300e759c1de1b054cd23df4c8c273e8cd2a6..0000000000000000000000000000000000000000 --- a/CVE-2018-20623.patch +++ /dev/null @@ -1,75 +0,0 @@ -From 28e817cc440bce73691c03e01860089a0954a837 Mon Sep 17 00:00:00 2001 -From: Nick Clifton -Date: Wed, 9 Jan 2019 12:25:16 +0000 -Subject: [PATCH 1/1] Fix a heap use after free memory access fault when - displaying error messages about malformed archives. - - PR 14049 - * readelf.c (process_archive): Use arch.file_name in error - messages until the qualified name is available. ---- - - -diff -urNp a/binutils/ChangeLog b/binutils/ChangeLog ---- a/binutils/ChangeLog 2019-06-06 00:06:39.330000000 +0800 -+++ b/binutils/ChangeLog 2019-06-06 00:08:54.420000000 +0800 -@@ -1,3 +1,8 @@ -+2019-01-09 Nick Clifton -+ PR 14049 -+ * readelf.c (process_archive): Use arch.file_name in error -+ messages until the qualified name is available. -+ - 2018-07-18 Nick Clifton - - 2.31.1 Release point. -diff -urNp a/binutils/readelf.c b/binutils/readelf.c ---- a/binutils/readelf.c 2019-06-06 00:06:39.100000000 +0800 -+++ b/binutils/readelf.c 2019-06-06 00:17:32.740000000 +0800 -@@ -19088,7 +19088,7 @@ process_archive (Filedata * filedata, bf - /* Read the next archive header. */ - if (fseek (filedata->handle, arch.next_arhdr_offset, SEEK_SET) != 0) - { -- error (_("%s: failed to seek to next archive header\n"), filedata->file_name); -+ error (_("%s: failed to seek to next archive header\n"), arch.file_name); - return FALSE; - } - got = fread (&arch.arhdr, 1, sizeof arch.arhdr, filedata->handle); -@@ -19096,7 +19096,10 @@ process_archive (Filedata * filedata, bf - { - if (got == 0) - break; -- error (_("%s: failed to read archive header\n"), filedata->file_name); -+ /* PR 24049 - we cannot use filedata->file_name as this will -+ have already been freed. */ -+ error (_("%s: failed to read archive header\n"), arch.file_name); -+ - ret = FALSE; - break; - } -@@ -19116,7 +19119,7 @@ process_archive (Filedata * filedata, bf - name = get_archive_member_name (&arch, &nested_arch); - if (name == NULL) - { -- error (_("%s: bad archive file name\n"), filedata->file_name); -+ error (_("%s: bad archive file name\n"), arch.file_name); - ret = FALSE; - break; - } -@@ -19125,7 +19128,7 @@ process_archive (Filedata * filedata, bf - qualified_name = make_qualified_name (&arch, &nested_arch, name); - if (qualified_name == NULL) - { -- error (_("%s: bad archive file name\n"), filedata->file_name); -+ error (_("%s: bad archive file name\n"), arch.file_name); - ret = FALSE; - break; - } -@@ -19171,7 +19174,7 @@ process_archive (Filedata * filedata, bf - if (nested_arch.file == NULL) - { - error (_("%s: contains corrupt thin archive: %s\n"), -- filedata->file_name, name); -+ qualified_name, name); - ret = FALSE; - break; - } diff --git a/CVE-2018-20651.patch b/CVE-2018-20651.patch deleted file mode 100644 index 78de97d55ac401218b741f6fc74e2f4540fcba44..0000000000000000000000000000000000000000 --- a/CVE-2018-20651.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 54025d5812ff100f5f0654eb7e1ffd50f2e37f5f Mon Sep 17 00:00:00 2001 -From: Alan Modra -Date: Mon, 31 Dec 2018 15:40:08 +1030 -Subject: [PATCH] PR24041, Invalid Memory Address Dereference in - elf_link_add_object_symbols - - PR 24041 - * elflink.c (elf_link_add_object_symbols): Don't segfault on - crafted ET_DYN with no program headers. ---- - -diff -urNp a/bfd/ChangeLog b/bfd/ChangeLog ---- a/bfd/ChangeLog 2019-06-06 00:21:45.780000000 +0800 -+++ b/bfd/ChangeLog 2019-06-06 00:23:26.300000000 +0800 -@@ -1,3 +1,8 @@ -+2018-12-31 Alan Modra -+ PR 24041 -+ * elflink.c (elf_link_add_object_symbols): Don't segfault on -+ crafted ET_DYN with no program headers. -+ - 2018-09-20 Alan Modra - PR 23685 - * peXXigen.c (pe_print_edata): Correct export address table -diff -urNp a/bfd/elflink.c b/bfd/elflink.c ---- a/bfd/elflink.c 2019-06-06 00:21:45.770000000 +0800 -+++ b/bfd/elflink.c 2019-06-06 00:24:50.330000000 +0800 -@@ -4169,7 +4169,7 @@ error_free_dyn: - all sections contained fully therein. This makes relro - shared library sections appear as they will at run-time. */ - phdr = elf_tdata (abfd)->phdr + elf_elfheader (abfd)->e_phnum; -- while (--phdr >= elf_tdata (abfd)->phdr) -+ while (phdr-- > elf_tdata (abfd)->phdr) - if (phdr->p_type == PT_GNU_RELRO) - { - for (s = abfd->sections; s != NULL; s = s->next) diff --git a/CVE-2018-20671.patch b/CVE-2018-20671.patch deleted file mode 100644 index 21797ac7f2c05bae183074f36ab4be7a07f63873..0000000000000000000000000000000000000000 --- a/CVE-2018-20671.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 11fa9f134fd658075c6f74499c780df045d9e9ca Mon Sep 17 00:00:00 2001 -From: Nick Clifton -Date: Fri, 4 Jan 2019 13:44:34 +0000 -Subject: [PATCH] Fix a possible integer overflow problem when examining - corrupt binaries using a 32-bit binutil. - - PR 24005 - * objdump.c (load_specific_debug_section): Check for integer - overflow before attempting to allocate contents. ---- - binutils/objdump.c | 13 ++++++++++--- - 1 files changed, 10 insertions(+), 3 deletions(-) - -diff --git a/binutils/objdump.c b/binutils/objdump.c -index 220d93a..f1e6d2e 100644 ---- a/binutils/objdump.c -+++ b/binutils/objdump.c -@@ -2539,12 +2539,19 @@ load_specific_debug_section (enum dwarf_section_display_enum debug, - section->reloc_info = NULL; - section->num_relocs = 0; - section->address = bfd_get_section_vma (abfd, sec); -+ section->user_data = sec; - section->size = bfd_get_section_size (sec); - amt = section->size + 1; -+ if (amt == 0 || amt > bfd_get_file_size (abfd)) -+ { -+ section->start = NULL; -+ free_debug_section (debug); -+ printf (_("\nSection '%s' has an invalid size: %#llx.\n"), -+ section->name, (unsigned long long) section->size); -+ return FALSE; -+ } - section->start = contents = malloc (amt); -- section->user_data = sec; -- if (amt == 0 -- || section->start == NULL -+ if (section->start == NULL - || !bfd_get_full_section_contents (abfd, sec, &contents)) - { - free_debug_section (debug); --- -2.9.3 diff --git a/CVE-2019-1010180.patch b/CVE-2019-1010180.patch deleted file mode 100644 index a3b0a5710d39e990425fabe2132815015bb78f2f..0000000000000000000000000000000000000000 --- a/CVE-2019-1010180.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 8ff71a9c80cfcf64c54d4ae938c644b1b1ea19fb Mon Sep 17 00:00:00 2001 -From: Nick Clifton -Date: Tue, 18 Sep 2018 16:54:07 +0100 -Subject: [PATCH] Add a warning to the bfd library for when it encounters an - ELF file with an invalid section size. - - PR 23657 - * elfcode.h (elf_swap_shdr_in): Generate a warning message if an - ELF section has contents and size larger than the file size. -url:https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=8ff71a9c80cfcf64c54d4ae938c644b1b1ea19fb -diff --git a/bfd/elfcode.h b/bfd/elfcode.h -index fb02e255fd..f224c8b79d 100644 ---- a/bfd/elfcode.h -+++ b/bfd/elfcode.h -@@ -314,6 +314,14 @@ elf_swap_shdr_in (bfd *abfd, - dst->sh_addr = H_GET_WORD (abfd, src->sh_addr); - dst->sh_offset = H_GET_WORD (abfd, src->sh_offset); - dst->sh_size = H_GET_WORD (abfd, src->sh_size); -+ /* PR 23657. Check for invalid section size, in sections with contents. -+ Note - we do not set an error value here because the contents -+ of this particular section might not be needed by the consumer. */ -+ if (dst->sh_type != SHT_NOBITS -+ && dst->sh_size > bfd_get_file_size (abfd)) -+ _bfd_error_handler -+ (_("warning: %pB has a corrupt section with a size (%" BFD_VMA_FMT "x) larger than the file size"), -+ abfd, dst->sh_size); - dst->sh_link = H_GET_32 (abfd, src->sh_link); - dst->sh_info = H_GET_32 (abfd, src->sh_info); - dst->sh_addralign = H_GET_WORD (abfd, src->sh_addralign); --- -2.19.1 - diff --git a/CVE-2019-12972.patch b/CVE-2019-12972.patch deleted file mode 100644 index c4a5a7ad53c6dfe6fda07645d04d8971c8ca4244..0000000000000000000000000000000000000000 --- a/CVE-2019-12972.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 890f750a3b053532a4b839a2dd6243076de12031 Mon Sep 17 00:00:00 2001 -From: Alan Modra -Date: Fri, 21 Jun 2019 11:51:38 +0930 -Subject: [PATCH] PR24689, string table corruption - -The testcase in the PR had a e_shstrndx section of type SHT_GROUP. -hdr->contents were initialized by setup_group rather than being read -from the file, thus last byte was not zero and string dereference ran -off the end of the buffer. - - PR 24689 - * elfcode.h (elf_object_p): Check type of e_shstrndx section. ---- - bfd/elfcode.h | 3 ++- - 1 files changed, 2 insertions(+), 1 deletion(-) - -diff --git a/bfd/elfcode.h b/bfd/elfcode.h -index a0487b0..5180f79 100644 ---- a/bfd/elfcode.h -+++ b/bfd/elfcode.h -@@ -754,7 +754,8 @@ elf_object_p (bfd *abfd) - /* A further sanity check. */ - if (i_ehdrp->e_shnum != 0) - { -- if (i_ehdrp->e_shstrndx >= elf_numsections (abfd)) -+ if (i_ehdrp->e_shstrndx >= elf_numsections (abfd) -+ || i_shdrp[i_ehdrp->e_shstrndx].sh_type != SHT_STRTAB) - { - /* PR 2257: - We used to just goto got_wrong_format_error here --- -2.9.3 diff --git a/CVE-2019-14444.patch b/CVE-2019-14444.patch deleted file mode 100644 index 46e8e67ad27c13e9c665d65f8f72081ed1eabdd5..0000000000000000000000000000000000000000 --- a/CVE-2019-14444.patch +++ /dev/null @@ -1,26 +0,0 @@ -From e17869db99195849826eaaf5d2d0eb2cfdd7a2a7 Mon Sep 17 00:00:00 2001 -From: Nick Clifton -Date: Mon, 5 Aug 2019 10:40:35 +0100 -Subject: [PATCH] Catch potential integer overflow in readelf when processing - corrupt binaries. - - PR 24829 - * readelf.c (apply_relocations): Catch potential integer overflow - whilst checking reloc location against section size. -url:https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=e17869db99195849826eaaf5d2d0eb2cfdd7a2a7 -diff --git a/binutils/readelf.c b/binutils/readelf.c -index b896ad9f40..e785fde43e 100644 ---- a/binutils/readelf.c -+++ b/binutils/readelf.c -@@ -13366,7 +13366,7 @@ apply_relocations (Filedata * filedata, - } - - rloc = start + rp->r_offset; -- if ((rloc + reloc_size) > end || (rloc < start)) -+ if (rloc >= end || (rloc + reloc_size) > end || (rloc < start)) - { - warn (_("skipping invalid relocation offset 0x%lx in section %s\n"), - (unsigned long) rp->r_offset, --- -2.19.1 - diff --git a/CVE-2019-17450.patch b/CVE-2019-17450.patch index a558a71c08d3d59452908e44ed7b972debc1df0f..06b9d37bbb06e31ce487e5308bc082ae9339224f 100644 --- a/CVE-2019-17450.patch +++ b/CVE-2019-17450.patch @@ -1,4 +1,4 @@ -From 6d4f8af90e2256f58c9e02ad72c3dd37201a7349 Mon Sep 17 00:00:00 2001 +From 063c511bd79281f33fd33f0964541a73511b9e2b Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Wed, 9 Oct 2019 00:07:29 +1030 Subject: [PATCH] PR25078, stack overflow in function find_abstract_instance @@ -7,16 +7,17 @@ Subject: [PATCH] PR25078, stack overflow in function find_abstract_instance * dwarf2.c (find_abstract_instance): Delete orig_info_ptr, add recur_count. Error on recur_count reaching 100 rather than info_ptr matching orig_info_ptr. Adjust calls. + --- bfd/dwarf2.c | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c -index 26bfb25eb3..d05af5af9c 100644 +index ed6dcd4..e954d23 100644 --- a/bfd/dwarf2.c +++ b/bfd/dwarf2.c -@@ -2803,13 +2803,13 @@ lookup_symbol_in_variable_table (struct comp_unit *unit, - } +@@ -2812,13 +2812,13 @@ static bfd_boolean comp_unit_maybe_decode_line_info (struct comp_unit *, + struct dwarf2_debug *); static bfd_boolean -find_abstract_instance (struct comp_unit * unit, @@ -36,7 +37,7 @@ index 26bfb25eb3..d05af5af9c 100644 { bfd *abfd = unit->abfd; bfd_byte *info_ptr; -@@ -2820,6 +2820,14 @@ find_abstract_instance (struct comp_unit * unit, +@@ -2829,6 +2829,14 @@ find_abstract_instance (struct comp_unit * unit, struct attribute attr; const char *name = NULL; @@ -51,7 +52,7 @@ index 26bfb25eb3..d05af5af9c 100644 /* DW_FORM_ref_addr can reference an entry in a different CU. It is an offset from the .debug_info section, not the current CU. */ if (attr_ptr->form == DW_FORM_ref_addr) -@@ -2937,15 +2945,6 @@ find_abstract_instance (struct comp_unit * unit, +@@ -2962,15 +2970,6 @@ find_abstract_instance (struct comp_unit * unit, info_ptr, info_ptr_end); if (info_ptr == NULL) break; @@ -67,7 +68,7 @@ index 26bfb25eb3..d05af5af9c 100644 switch (attr.name) { case DW_AT_name: -@@ -2959,7 +2958,7 @@ find_abstract_instance (struct comp_unit * unit, +@@ -2984,7 +2983,7 @@ find_abstract_instance (struct comp_unit * unit, } break; case DW_AT_specification: @@ -76,7 +77,7 @@ index 26bfb25eb3..d05af5af9c 100644 &name, is_linkage, filename_ptr, linenumber_ptr)) return FALSE; -@@ -3173,7 +3172,7 @@ scan_unit_for_symbols (struct comp_unit *unit) +@@ -3200,7 +3199,7 @@ scan_unit_for_symbols (struct comp_unit *unit) case DW_AT_abstract_origin: case DW_AT_specification: @@ -86,5 +87,5 @@ index 26bfb25eb3..d05af5af9c 100644 &func->is_linkage, &func->file, -- -2.19.1 +1.8.3.1 diff --git a/CVE-2019-9075.patch b/CVE-2019-9075.patch deleted file mode 100644 index 44f7d36b96ddd0a1deee3c19ff9660c642b62c93..0000000000000000000000000000000000000000 --- a/CVE-2019-9075.patch +++ /dev/null @@ -1,96 +0,0 @@ -From 8abac8031ed369a2734b1cdb7df28a39a54b4b49 Mon Sep 17 00:00:00 2001 -From: Alan Modra -Date: Wed, 20 Feb 2019 08:21:24 +1030 -Subject: [PATCH] PR24236, Heap buffer overflow in - _bfd_archive_64_bit_slurp_armap - - PR 24236 - * archive64.c (_bfd_archive_64_bit_slurp_armap): Move code adding - sentinel NUL to string buffer nearer to loop where it is used. - Don't go past sentinel when scanning strings, and don't write - NUL again. - * archive.c (do_slurp_coff_armap): Simplify string handling to - archive64.c style. ---- - bfd/archive.c | 17 +++++++---------- - bfd/archive64.c | 10 +++++----- - 2 files changed, 12 insertions(+), 15 deletions(-) - -diff --git a/bfd/archive.c b/bfd/archive.c -index d2d9b72..68a92a3 100644 ---- a/bfd/archive.c -+++ b/bfd/archive.c -@@ -1012,6 +1012,7 @@ do_slurp_coff_armap (bfd *abfd) - int *raw_armap, *rawptr; - struct artdata *ardata = bfd_ardata (abfd); - char *stringbase; -+ char *stringend; - bfd_size_type stringsize; - bfd_size_type parsed_size; - carsym *carsyms; -@@ -1071,22 +1072,18 @@ do_slurp_coff_armap (bfd *abfd) - } - - /* OK, build the carsyms. */ -- for (i = 0; i < nsymz && stringsize > 0; i++) -+ stringend = stringbase + stringsize; -+ *stringend = 0; -+ for (i = 0; i < nsymz; i++) - { -- bfd_size_type len; -- - rawptr = raw_armap + i; - carsyms->file_offset = swap ((bfd_byte *) rawptr); - carsyms->name = stringbase; -- /* PR 17512: file: 4a1d50c1. */ -- len = strnlen (stringbase, stringsize); -- if (len < stringsize) -- len ++; -- stringbase += len; -- stringsize -= len; -+ stringbase += strlen (stringbase); -+ if (stringbase != stringend) -+ ++stringbase; - carsyms++; - } -- *stringbase = 0; - - ardata->symdef_count = nsymz; - ardata->first_file_filepos = bfd_tell (abfd); -diff --git a/bfd/archive64.c b/bfd/archive64.c -index 312bf82..42f6ed9 100644 ---- a/bfd/archive64.c -+++ b/bfd/archive64.c -@@ -100,8 +100,6 @@ _bfd_archive_64_bit_slurp_armap (bfd *abfd) - return FALSE; - carsyms = ardata->symdefs; - stringbase = ((char *) ardata->symdefs) + carsym_size; -- stringbase[stringsize] = 0; -- stringend = stringbase + stringsize; - - raw_armap = (bfd_byte *) bfd_alloc (abfd, ptrsize); - if (raw_armap == NULL) -@@ -115,15 +113,17 @@ _bfd_archive_64_bit_slurp_armap (bfd *abfd) - goto release_raw_armap; - } - -+ stringend = stringbase + stringsize; -+ *stringend = 0; - for (i = 0; i < nsymz; i++) - { - carsyms->file_offset = bfd_getb64 (raw_armap + i * 8); - carsyms->name = stringbase; -- if (stringbase < stringend) -- stringbase += strlen (stringbase) + 1; -+ stringbase += strlen (stringbase); -+ if (stringbase != stringend) -+ ++stringbase; - ++carsyms; - } -- *stringbase = '\0'; - - ardata->symdef_count = nsymz; - ardata->first_file_filepos = bfd_tell (abfd); --- -2.9.3 - diff --git a/CVE-2019-9077.patch b/CVE-2019-9077.patch deleted file mode 100644 index 6398e4e053ecc11bbcbdbf40bf9d6c208680bcb5..0000000000000000000000000000000000000000 --- a/CVE-2019-9077.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff --git a/binutils/readelf.c b/binutils/readelf.c -index 9439501..31fa9b1 100644 ---- a/binutils/readelf.c -+++ b/binutils/readelf.c -@@ -13709,6 +13709,12 @@ process_mips_specific (FILE * file) - error (_("No MIPS_OPTIONS header found\n")); - return FALSE; - } -+ /* PR 24243 */ -+ if (sect->sh_size < sizeof (* eopt)) -+ { -+ error (_("The MIPS options section is too small.\n")); -+ return FALSE; -+ } - - eopt = (Elf_External_Options *) get_data (NULL, filedata, options_offset, 1, - sect->sh_size, _("options")); --- -1.8.3.1 - diff --git a/Fix-a-failure-in-the-libiberty-testsuite-by-increasi.patch b/Fix-a-failure-in-the-libiberty-testsuite-by-increasi.patch deleted file mode 100644 index caf8864dfa8d7fe5247d73e2bcaec4a563995064..0000000000000000000000000000000000000000 --- a/Fix-a-failure-in-the-libiberty-testsuite-by-increasi.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 69799d67e8872dcd3feee81ed2ff0fc47beb52d7 Mon Sep 17 00:00:00 2001 -From: Nick Clifton -Date: Tue, 11 Dec 2018 12:01:15 +0000 -Subject: [PATCH] Fix a failure in the libiberty testsuite by increasing the - recursion limit to 2048. - - PR 88409 -include * demangle.h (DEMANGLE_RECURSION_LIMIT): Increase to 2048. - -binutils* NEWS: Note that recursion limit has increased to 2048. - * doc/binutils.texi: Likewise. ---- - include/demangle.h | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - -diff --git a/include/demangle.h b/include/demangle.h -index 1e67fe2fb3..fadf7082c0 100644 ---- a/include/demangle.h -+++ b/include/demangle.h -@@ -77,7 +77,7 @@ extern "C" { - /* If DMGL_NO_RECURSE_LIMIT is not enabled, then this is the value used as - the maximum depth of recursion allowed. It should be enough for any - real-world mangled name. */ --#define DEMANGLE_RECURSION_LIMIT 1024 -+#define DEMANGLE_RECURSION_LIMIT 2048 - - /* Enumeration of possible demangling styles. - diff --git a/Fix-buffer-underrun-bug-in-the-TI-C30-disassembler.patch b/Fix-buffer-underrun-bug-in-the-TI-C30-disassembler.patch deleted file mode 100644 index 08e3b7ce8340f211fe998444e58d0b42f79d70bb..0000000000000000000000000000000000000000 --- a/Fix-buffer-underrun-bug-in-the-TI-C30-disassembler.patch +++ /dev/null @@ -1,30 +0,0 @@ -From f44b758d3133ef0a7f3131c1e12ed20feb33ee61 Mon Sep 17 00:00:00 2001 -From: Nick Clifton -Date: Tue, 3 Sep 2019 15:37:12 +0100 -Subject: [PATCH] Fix buffer underrun bug in the TI C30 disassembler. - - PR 24961 - * tic30-dis.c (get_indirect_operand): Check for bufcnt being - greater than zero before indexing via (bufcnt -1). ---- - opcodes/tic30-dis.c | 4 +++- - 1 files changed, 3 insertions(+), 1 deletion(-) - -diff --git a/opcodes/tic30-dis.c b/opcodes/tic30-dis.c -index c64aceb..668c519 100644 ---- a/opcodes/tic30-dis.c -+++ b/opcodes/tic30-dis.c -@@ -253,7 +253,9 @@ get_indirect_operand (unsigned short fragment, - for (i = 0, bufcnt = 0; i < len; i++, bufcnt++) - { - buffer[bufcnt] = current_ind->syntax[i]; -- if (buffer[bufcnt - 1] == 'a' && buffer[bufcnt] == 'r') -+ if (bufcnt > 0 -+ && buffer[bufcnt - 1] == 'a' -+ && buffer[bufcnt] == 'r') - buffer[++bufcnt] = arnum + '0'; - if (buffer[bufcnt] == '(' - && current_ind->displacement == DISP_REQUIRED) --- -2.9.3 - diff --git a/Fix-incorrect-extraction-of-signe-dconstants-in-nios2.patch b/Fix-incorrect-extraction-of-signe-dconstants-in-nios2.patch deleted file mode 100644 index 8b5a47cf297cf1940835a2d90cf6b47588ce0fc7..0000000000000000000000000000000000000000 --- a/Fix-incorrect-extraction-of-signe-dconstants-in-nios2.patch +++ /dev/null @@ -1,120 +0,0 @@ -From 6031ac352c05c5c9f44e24fa1c5a8222a7a7d02d Mon Sep 17 00:00:00 2001 -From: Sandra Loosemore -Date: Sun, 23 Sep 2018 12:31:23 -0700 -Subject: [PATCH] Fix incorrect extraction of signed constants in nios2 - disassembler. - -2018-09-23 Sandra Loosemore - - opcodes/ - * nios2-dis.c (nios2_print_insn_arg): Make sure signed conversions - are used when extracting signed fields and converting them to - potentially 64-bit types. ---- - opcodes/ChangeLog | 6 ++++++ - opcodes/nios2-dis.c | 28 +++++++++++++++------------- - 2 files changed, 21 insertions(+), 13 deletions(-) - -diff --git a/opcodes/nios2-dis.c b/opcodes/nios2-dis.c -index 257e5bb..51027b5 100644 ---- a/opcodes/nios2-dis.c -+++ b/opcodes/nios2-dis.c -@@ -275,6 +275,8 @@ nios2_print_insn_arg (const char *argptr, - const struct nios2_opcode *op) - { - unsigned long i = 0; -+ long s = 0; -+ bfd_signed_vma o = 0; - struct nios2_reg *reg_base; - - switch (*argptr) -@@ -552,15 +554,15 @@ nios2_print_insn_arg (const char *argptr, - switch (op->format) - { - case iw_i_type: -- i = (signed) (GET_IW_I_IMM16 (opcode) << 16) >> 16; -+ s = (int32_t) (GET_IW_I_IMM16 (opcode) << 16) >> 16; - break; - case iw_F2I16_type: -- i = (signed) (GET_IW_F2I16_IMM16 (opcode) << 16) >> 16; -+ s = (int32_t) (GET_IW_F2I16_IMM16 (opcode) << 16) >> 16; - break; - default: - bad_opcode (op); - } -- (*info->fprintf_func) (info->stream, "%ld", i); -+ (*info->fprintf_func) (info->stream, "%ld", s); - break; - - case 'I': -@@ -568,15 +570,15 @@ nios2_print_insn_arg (const char *argptr, - switch (op->format) - { - case iw_F2X4I12_type: -- i = (signed) (GET_IW_F2X4I12_IMM12 (opcode) << 20) >> 20; -+ s = (int32_t) (GET_IW_F2X4I12_IMM12 (opcode) << 20) >> 20; - break; - case iw_F1X4I12_type: -- i = (signed) (GET_IW_F1X4I12_IMM12 (opcode) << 20) >> 20; -+ s = (int32_t) (GET_IW_F1X4I12_IMM12 (opcode) << 20) >> 20; - break; - default: - bad_opcode (op); - } -- (*info->fprintf_func) (info->stream, "%ld", i); -+ (*info->fprintf_func) (info->stream, "%ld", s); - break; - - case 'u': -@@ -671,15 +673,15 @@ nios2_print_insn_arg (const char *argptr, - switch (op->format) - { - case iw_i_type: -- i = (signed) (GET_IW_I_IMM16 (opcode) << 16) >> 16; -+ o = (int32_t) (GET_IW_I_IMM16 (opcode) << 16) >> 16; - break; - case iw_F2I16_type: -- i = (signed) (GET_IW_F2I16_IMM16 (opcode) << 16) >> 16; -+ o = (int32_t) (GET_IW_F2I16_IMM16 (opcode) << 16) >> 16; - break; - default: - bad_opcode (op); - } -- address = address + 4 + i; -+ address = address + 4 + o; - (*info->print_address_func) (address, info); - break; - -@@ -688,12 +690,12 @@ nios2_print_insn_arg (const char *argptr, - switch (op->format) - { - case iw_I10_type: -- i = (signed) (GET_IW_I10_IMM10 (opcode) << 22) >> 21; -+ o = (int32_t) (GET_IW_I10_IMM10 (opcode) << 22) >> 21; - break; - default: - bad_opcode (op); - } -- address = address + 2 + i; -+ address = address + 2 + o; - (*info->print_address_func) (address, info); - break; - -@@ -702,12 +704,12 @@ nios2_print_insn_arg (const char *argptr, - switch (op->format) - { - case iw_T1I7_type: -- i = (signed) (GET_IW_T1I7_IMM7 (opcode) << 25) >> 24; -+ o = (int32_t) (GET_IW_T1I7_IMM7 (opcode) << 25) >> 24; - break; - default: - bad_opcode (op); - } -- address = address + 2 + i; -+ address = address + 2 + o; - (*info->print_address_func) (address, info); - break; - --- -2.9.3 - diff --git a/Fix-the-handling-of-inlined-frames-in-DWARF-debug-in.patch b/Fix-the-handling-of-inlined-frames-in-DWARF-debug-in.patch deleted file mode 100644 index 547683719cc504167ed96138b0d3e673da3daddb..0000000000000000000000000000000000000000 --- a/Fix-the-handling-of-inlined-frames-in-DWARF-debug-in.patch +++ /dev/null @@ -1,59 +0,0 @@ -From 514017551643b962e1ae1a37ed277418dc2919f1 Mon Sep 17 00:00:00 2001 -From: Millan Wolff -Date: Wed, 3 Oct 2018 12:06:09 +0100 -Subject: [PATCH 1/2] Fix the handling of inlined frames in DWARF debug info. - - PR 23715 - * dwarf2.c (find_abstract_instance): Allow recursive invocations - of find_abstract_instance to override the name variable. ---- - bfd/dwarf2.c | 2 +- - bfd/section.c | 14 +++++++++----- - 2 files changed, 10 insertions(+), 6 deletions(-) - -diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c -index a464388cc9..af312b30d5 100644 ---- a/bfd/dwarf2.c -+++ b/bfd/dwarf2.c -@@ -2960,7 +2960,7 @@ find_abstract_instance (struct comp_unit * unit, - break; - case DW_AT_specification: - if (!find_abstract_instance (unit, info_ptr, &attr, -- pname, is_linkage, -+ &name, is_linkage, - filename_ptr, linenumber_ptr)) - return FALSE; - break; -diff --git a/bfd/section.c b/bfd/section.c -index 7ee3f6915b..cc23922814 100644 ---- a/bfd/section.c -+++ b/bfd/section.c -@@ -1457,16 +1457,20 @@ SYNOPSIS - - DESCRIPTION - Sets the contents of the section @var{section} in BFD -- @var{abfd} to the data starting in memory at @var{data}. The -- data is written to the output section starting at offset -+ @var{abfd} to the data starting in memory at @var{location}. -+ The data is written to the output section starting at offset - @var{offset} for @var{count} octets. - -- Normally <> is returned, else <>. Possible error -- returns are: -+ Normally <> is returned, but <> is returned if -+ there was an error. Possible error returns are: - o <> - - The output section does not have the <> - attribute, so nothing can be written to it. -- o and some more too -+ o <> - -+ The section is unable to contain all of the data. -+ o <> - -+ The BFD is not writeable. -+ o and some more too. - - This routine is front end to the back end function - <<_bfd_set_section_contents>>. --- -2.19.1 - diff --git a/Prevent-objdump-from-aborting.patch b/Prevent-objdump-from-aborting.patch deleted file mode 100644 index 1eea315d747276c5514e2801e4a31ddeef0d3973..0000000000000000000000000000000000000000 --- a/Prevent-objdump-from-aborting.patch +++ /dev/null @@ -1,105 +0,0 @@ -From d88bdcb4a52bc041ed9b607dda22f478ec61a67b Mon Sep 17 00:00:00 2001 -From: Phillipe Antoine -Date: Wed, 7 Aug 2019 17:22:29 +0100 -Subject: [PATCH] Prevent objdump from aborting when asked to disassemble an - unknown type of ARC binary file. - - PR 24854 - * arc-dis.c (arc_insn_length): Return 0 rather than aborting when - encountering an unknown machine type. - (print_insn_arc): Handle arc_insn_length returning 0. In error - cases return -1 rather than calling abort. ---- - opcodes/ChangeLog | 8 ++++++++ - opcodes/arc-dis.c | 17 +++++++++++------ - 2 files changed, 19 insertions(+), 6 deletions(-) - -diff --git a/opcodes/arc-dis.c b/opcodes/arc-dis.c -index 8207c05..3c88c33 100644 ---- a/opcodes/arc-dis.c -+++ b/opcodes/arc-dis.c -@@ -672,7 +672,7 @@ arc_insn_length (bfd_byte msb, bfd_byte lsb, struct disassemble_info *info) - break; - - default: -- abort (); -+ return 0; - } - } - -@@ -1009,7 +1009,6 @@ print_insn_arc (bfd_vma memaddr, - the number of bytes objdump should display on a single line. If - the instruction decoder sets this, it should always set it to - the same value in order to get reasonable looking output. */ -- - info->bytes_per_line = 8; - - /* In the next lines, we set two info variables control the way -@@ -1017,7 +1016,6 @@ print_insn_arc (bfd_vma memaddr, - 8 and bytes_per_chunk is 4, the output will look like this: - 00: 00000000 00000000 - with the chunks displayed according to "display_endian". */ -- - if (info->section - && !(info->section->flags & SEC_CODE)) - { -@@ -1072,13 +1070,16 @@ print_insn_arc (bfd_vma memaddr, - (*info->fprintf_func) (info->stream, ".word\t0x%08lx", data); - break; - default: -- abort (); -+ return -1; - } - return size; - } - - insn_len = arc_insn_length (buffer[highbyte], buffer[lowbyte], info); - pr_debug ("instruction length = %d bytes\n", insn_len); -+ if (insn_len == 0) -+ return -1; -+ - arc_infop = info->private_data; - arc_infop->insn_len = insn_len; - -@@ -1131,7 +1132,7 @@ print_insn_arc (bfd_vma memaddr, - - default: - /* There is no instruction whose length is not 2, 4, 6, or 8. */ -- abort (); -+ return -1; - } - - pr_debug ("instruction value = %llx\n", insn); -@@ -1159,24 +1160,28 @@ print_insn_arc (bfd_vma memaddr, - (*info->fprintf_func) (info->stream, ".shor\t%#04llx", - insn & 0xffff); - break; -+ - case 4: - (*info->fprintf_func) (info->stream, ".word\t%#08llx", - insn & 0xffffffff); - break; -+ - case 6: - (*info->fprintf_func) (info->stream, ".long\t%#08llx", - insn & 0xffffffff); - (*info->fprintf_func) (info->stream, ".long\t%#04llx", - (insn >> 32) & 0xffff); - break; -+ - case 8: - (*info->fprintf_func) (info->stream, ".long\t%#08llx", - insn & 0xffffffff); - (*info->fprintf_func) (info->stream, ".long\t%#08llx", - insn >> 32); - break; -+ - default: -- abort (); -+ return -1; - } - - info->insn_type = dis_noninsn; --- -2.9.3 - diff --git a/binutils-2.19.50.0.1-output-format.sed b/binutils-2.19.50.0.1-output-format.sed deleted file mode 100644 index fd770cb255d266b685133ca1230d42d850cfcd51..0000000000000000000000000000000000000000 --- a/binutils-2.19.50.0.1-output-format.sed +++ /dev/null @@ -1,38 +0,0 @@ -# Generate OUTPUT_FORMAT line for .so files from the system linker output. -# Imported from glibc/Makerules. - -/ld.*[ ]-E[BL]/b f -/collect.*[ ]-E[BL]/b f -/OUTPUT_FORMAT[^)]*$/{N -s/\n[ ]*/ / -} -t o -: o -s/^.*OUTPUT_FORMAT(\([^,]*\), \1, \1).*$/OUTPUT_FORMAT(\1)/ -t q -s/^.*OUTPUT_FORMAT(\([^,]*\), \([^,]*\), \([^,]*\)).*$/\1,\2,\3/ -t s -s/^.*OUTPUT_FORMAT(\([^,)]*\).*$)/OUTPUT_FORMAT(\1)/ -t q -d -: s -s/"//g -G -s/\n// -s/^\([^,]*\),\([^,]*\),\([^,]*\),B/OUTPUT_FORMAT(\2)/p -s/^\([^,]*\),\([^,]*\),\([^,]*\),L/OUTPUT_FORMAT(\3)/p -s/^\([^,]*\),\([^,]*\),\([^,]*\)/OUTPUT_FORMAT(\1)/p -/,/s|^|*** BUG in libc/scripts/output-format.sed *** |p -q -: q -s/"//g -p -q -: f -s/^.*[ ]-E\([BL]\)[ ].*$/,\1/ -t h -s/^.*[ ]-E\([BL]\)$/,\1/ -t h -d -: h -h diff --git a/binutils-2.25-version.patch b/binutils-2.25-version.patch deleted file mode 100644 index d97e81bc46d40289dbd6569e517bbd35e69fcd42..0000000000000000000000000000000000000000 --- a/binutils-2.25-version.patch +++ /dev/null @@ -1,44 +0,0 @@ ---- binutils-2.26.orig/bfd/Makefile.am 2016-01-25 10:11:33.505289018 +0000 -+++ binutils-2.26/bfd/Makefile.am 2016-01-25 10:13:23.489964145 +0000 -@@ -1043,8 +1043,8 @@ DISTCLEANFILES = $(BUILD_CFILES) $(BUILD - bfdver.h: $(srcdir)/version.h $(srcdir)/development.sh $(srcdir)/Makefile.in - @echo "creating $@" - @bfd_version=`echo "$(VERSION)" | $(SED) -e 's/\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\).*/\1.00\2.00\3.00\4.00\5/' -e 's/\([^\.]*\)\..*\(..\)\..*\(..\)\..*\(..\)\..*\(..\)$$/\1\2\3\4\5/'` ;\ -- bfd_version_string="\"$(VERSION)\"" ;\ -- bfd_soversion="$(VERSION)" ;\ -+ bfd_version_string="\"$(VERSION)-%{release}\"" ;\ -+ bfd_soversion="$(VERSION)-%{release}" ;\ - bfd_version_package="\"$(PKGVERSION)\"" ;\ - report_bugs_to="\"$(REPORT_BUGS_TO)\"" ;\ - . $(srcdir)/development.sh ;\ -@@ -1055,7 +1055,7 @@ bfdver.h: $(srcdir)/version.h $(srcdir)/ - fi ;\ - $(SED) -e "s,@bfd_version@,$$bfd_version," \ - -e "s,@bfd_version_string@,$$bfd_version_string," \ -- -e "s,@bfd_version_package@,$$bfd_version_package," \ -+ -e "s,@bfd_version_package@,\"version \"," \ - -e "s,@report_bugs_to@,$$report_bugs_to," \ - < $(srcdir)/version.h > $@; \ - echo "$${bfd_soversion}" > libtool-soversion ---- binutils-2.26.orig/bfd/Makefile.in 2016-01-25 10:11:33.505289018 +0000 -+++ binutils-2.26/bfd/Makefile.in 2016-01-25 10:14:17.818297941 +0000 -@@ -2111,8 +2111,8 @@ stmp-lcoff-h: $(LIBCOFF_H_FILES) - bfdver.h: $(srcdir)/version.h $(srcdir)/development.sh $(srcdir)/Makefile.in - @echo "creating $@" - @bfd_version=`echo "$(VERSION)" | $(SED) -e 's/\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\).*/\1.00\2.00\3.00\4.00\5/' -e 's/\([^\.]*\)\..*\(..\)\..*\(..\)\..*\(..\)\..*\(..\)$$/\1\2\3\4\5/'` ;\ -- bfd_version_string="\"$(VERSION)\"" ;\ -- bfd_soversion="$(VERSION)" ;\ -+ bfd_version_string="\"$(VERSION)-%{release}\"" ;\ -+ bfd_soversion="$(VERSION)-%{release}" ;\ - bfd_version_package="\"$(PKGVERSION)\"" ;\ - report_bugs_to="\"$(REPORT_BUGS_TO)\"" ;\ - . $(srcdir)/development.sh ;\ -@@ -2123,7 +2123,7 @@ bfdver.h: $(srcdir)/version.h $(srcdir)/ - fi ;\ - $(SED) -e "s,@bfd_version@,$$bfd_version," \ - -e "s,@bfd_version_string@,$$bfd_version_string," \ -- -e "s,@bfd_version_package@,$$bfd_version_package," \ -+ -e "s,@bfd_version_package@,\"version \"," \ - -e "s,@report_bugs_to@,$$report_bugs_to," \ - < $(srcdir)/version.h > $@; \ - echo "$${bfd_soversion}" > libtool-soversion diff --git a/binutils-2.29-filename-in-error-messages.patch b/binutils-2.29-filename-in-error-messages.patch deleted file mode 100644 index d8ce24133ec8fa51c215dd133050ec3a712d4f76..0000000000000000000000000000000000000000 --- a/binutils-2.29-filename-in-error-messages.patch +++ /dev/null @@ -1,124 +0,0 @@ ---- binutils.orig/binutils/readelf.c 2018-01-22 15:48:10.450701702 +0000 -+++ binutils-2.30.0/binutils/readelf.c 2018-01-22 15:55:26.739588657 +0000 -@@ -19019,75 +19019,85 @@ process_file (char * file_name) - Filedata * filedata = NULL; - struct stat statbuf; - char armag[SARMAG]; -- bfd_boolean ret = TRUE; -+ bfd_boolean ret = FALSE; -+ char * name; -+ char * saved_program_name; -+ -+ /* Overload program_name to include file_name. Doing this means -+ that warning/error messages will positively identify the file -+ concerned even when multiple instances of readelf are running. */ -+ name = xmalloc (strlen (program_name) + strlen (file_name) + 3); -+ sprintf (name, "%s: %s", program_name, file_name); -+ saved_program_name = program_name; -+ program_name = name; - - if (stat (file_name, &statbuf) < 0) - { - if (errno == ENOENT) -- error (_("'%s': No such file\n"), file_name); -+ error (_("No such file\n")); - else -- error (_("Could not locate '%s'. System error message: %s\n"), -- file_name, strerror (errno)); -- return FALSE; -+ error (_("Could not locate file. System error message: %s\n"), -+ strerror (errno)); -+ goto done; - } - - if (! S_ISREG (statbuf.st_mode)) - { -- error (_("'%s' is not an ordinary file\n"), file_name); -- return FALSE; -+ error (_("Not an ordinary file\n")); -+ goto done; - } - - filedata = calloc (1, sizeof * filedata); - if (filedata == NULL) - { - error (_("Out of memory allocating file data structure\n")); -- return FALSE; -+ goto done; - } - - filedata->file_name = file_name; - filedata->handle = fopen (file_name, "rb"); - if (filedata->handle == NULL) - { -- error (_("Input file '%s' is not readable.\n"), file_name); -- free (filedata); -- return FALSE; -+ error (_("Not readable\n")); -+ goto done; - } - - if (fread (armag, SARMAG, 1, filedata->handle) != 1) - { -- error (_("%s: Failed to read file's magic number\n"), file_name); -- fclose (filedata->handle); -- free (filedata); -- return FALSE; -- } -- -- filedata->file_size = (bfd_size_type) statbuf.st_size; -- -- if (memcmp (armag, ARMAG, SARMAG) == 0) -- { -- if (! process_archive (filedata, FALSE)) -- ret = FALSE; -- } -- else if (memcmp (armag, ARMAGT, SARMAG) == 0) -- { -- if ( ! process_archive (filedata, TRUE)) -- ret = FALSE; -+ error (_("Failed to read file's magic number\n")); - } - else - { -- if (do_archive_index) -- error (_("File %s is not an archive so its index cannot be displayed.\n"), -- file_name); -+ filedata->file_size = (bfd_size_type) statbuf.st_size; - -- rewind (filedata->handle); -- archive_file_size = archive_file_offset = 0; -- -- if (! process_object (filedata)) -- ret = FALSE; -+ if (memcmp (armag, ARMAG, SARMAG) == 0) -+ { -+ if (process_archive (filedata, FALSE)) -+ ret = TRUE; -+ } -+ else if (memcmp (armag, ARMAGT, SARMAG) == 0) -+ { -+ if (process_archive (filedata, TRUE)) -+ ret = TRUE; -+ } -+ else -+ { -+ if (do_archive_index) -+ error (_("Not an archive so its index cannot be displayed.\n")); -+ -+ rewind (filedata->handle); -+ archive_file_size = archive_file_offset = 0; -+ -+ if (process_object (filedata)) -+ ret = TRUE; -+ } - } - - fclose (filedata->handle); -+ done: - free (filedata); -+ free (program_name); -+ program_name = saved_program_name; - - return ret; - } diff --git a/binutils-2.31.1.tar.xz b/binutils-2.33.1.tar.xz similarity index 66% rename from binutils-2.31.1.tar.xz rename to binutils-2.33.1.tar.xz index 53ae9211681c3e4a47605adca6d9bb4ea4d38dbf..d90e565abdd9f98bd03ff6e92036ae03929847bf 100644 Binary files a/binutils-2.31.1.tar.xz and b/binutils-2.33.1.tar.xz differ diff --git a/binutils-clear-version-info.patch b/binutils-clear-version-info.patch deleted file mode 100644 index d5d5c205da6b1fd286708d9c4e018452def6e7a5..0000000000000000000000000000000000000000 --- a/binutils-clear-version-info.patch +++ /dev/null @@ -1,21 +0,0 @@ ---- binutils.orig/bfd/elflink.c 2018-08-14 10:25:09.108322746 +0100 -+++ binutils-2.31.1/bfd/elflink.c 2018-08-14 10:28:45.617780256 +0100 -@@ -686,13 +686,11 @@ bfd_elf_record_link_assignment (bfd *out - && !h->def_regular) - h->root.type = bfd_link_hash_undefined; - -- /* If this symbol is not being provided by the linker script, and it is -- currently defined by a dynamic object, but not by a regular object, -- then clear out any version information because the symbol will not be -- associated with the dynamic object any more. */ -- if (!provide -- && h->def_dynamic -- && !h->def_regular) -+ /* If this symbol is currently defined by a dynamic object, but not -+ by a regular object, then clear out any version information because -+ the symbol will not be associated with the dynamic object any -+ more. */ -+ if (h->def_dynamic && !h->def_regular) - h->verinfo.verdef = NULL; - - /* Make sure this symbol is not garbage collected. */ diff --git a/binutils-delay-ld-script-constant-eval.patch b/binutils-delay-ld-script-constant-eval.patch deleted file mode 100644 index ff20b6ad76f18d830cfa29fc8b02df33995602d9..0000000000000000000000000000000000000000 --- a/binutils-delay-ld-script-constant-eval.patch +++ /dev/null @@ -1,196 +0,0 @@ -diff -rup binutils.orig/ld/emultempl/pe.em binutils-2.31.1/ld/emultempl/pe.em ---- binutils.orig/ld/emultempl/pe.em 2018-09-04 11:00:05.546667021 +0100 -+++ binutils-2.31.1/ld/emultempl/pe.em 2018-09-04 11:00:58.427292612 +0100 -@@ -2165,7 +2165,7 @@ gld_${EMULATION_NAME}_place_orphan (asec - &add_child); - if (bfd_link_relocatable (&link_info)) - { -- os->section_alignment = s->alignment_power; -+ os->section_alignment = exp_intop (1U << s->alignment_power); - os->bfd_section->alignment_power = s->alignment_power; - } - } -diff -rup binutils.orig/ld/emultempl/pep.em binutils-2.31.1/ld/emultempl/pep.em ---- binutils.orig/ld/emultempl/pep.em 2018-09-04 11:00:05.545667029 +0100 -+++ binutils-2.31.1/ld/emultempl/pep.em 2018-09-04 11:01:29.340073740 +0100 -@@ -1962,7 +1962,7 @@ gld_${EMULATION_NAME}_place_orphan (asec - &add_child); - if (bfd_link_relocatable (&link_info)) - { -- os->section_alignment = s->alignment_power; -+ os->section_alignment = exp_intop (1U << s->alignment_power); - os->bfd_section->alignment_power = s->alignment_power; - } - } -diff -rup binutils.orig/ld/ldexp.c binutils-2.31.1/ld/ldexp.c ---- binutils.orig/ld/ldexp.c 2018-09-04 11:00:05.535667100 +0100 -+++ binutils-2.31.1/ld/ldexp.c 2018-09-04 11:03:29.179225246 +0100 -@@ -1528,6 +1528,28 @@ exp_get_value_int (etree_type *tree, int - return exp_get_vma (tree, def, name); - } - -+/* Return the smallest non-negative integer such that two raised to -+ that power is at least as large as the vma evaluated at TREE, if -+ TREE is a non-NULL expression that can be resolved. If TREE is -+ NULL or cannot be resolved, return -1. */ -+ -+signed int -+exp_get_power (etree_type *tree, char *name) -+{ -+ bfd_vma x = exp_get_vma (tree, -1, name); -+ bfd_vma p2; -+ int n; -+ -+ if (x == (bfd_vma) -1) -+ return -1; -+ -+ for (n = 0, p2 = 1; p2 < x; ++n, p2 <<= 1) -+ if (p2 == 0) -+ break; -+ -+ return n; -+} -+ - fill_type * - exp_get_fill (etree_type *tree, fill_type *def, char *name) - { -diff -rup binutils.orig/ld/ldexp.h binutils-2.31.1/ld/ldexp.h ---- binutils.orig/ld/ldexp.h 2018-09-04 11:00:05.536667092 +0100 -+++ binutils-2.31.1/ld/ldexp.h 2018-09-04 11:04:12.937915422 +0100 -@@ -231,6 +231,8 @@ bfd_vma exp_get_vma - (etree_type *, bfd_vma, char *); - int exp_get_value_int - (etree_type *, int, char *); -+signed int exp_get_power -+ (etree_type *, char *); - fill_type *exp_get_fill - (etree_type *, fill_type *, char *); - bfd_vma exp_get_abs_int -diff -rup binutils.orig/ld/ldlang.c binutils-2.31.1/ld/ldlang.c ---- binutils.orig/ld/ldlang.c 2018-09-04 11:00:05.536667092 +0100 -+++ binutils-2.31.1/ld/ldlang.c 2018-09-04 11:07:42.249433438 +0100 -@@ -1199,8 +1199,8 @@ output_section_statement_newfunc (struct - ret = (struct out_section_hash_entry *) entry; - memset (&ret->s, 0, sizeof (ret->s)); - ret->s.header.type = lang_output_section_statement_enum; -- ret->s.output_section_statement.subsection_alignment = -1; -- ret->s.output_section_statement.section_alignment = -1; -+ ret->s.output_section_statement.subsection_alignment = NULL; -+ ret->s.output_section_statement.section_alignment = NULL; - ret->s.output_section_statement.block_value = 1; - lang_list_init (&ret->s.output_section_statement.children); - lang_statement_append (stat_ptr, &ret->s, &ret->s.header.next); -@@ -2193,8 +2193,9 @@ init_os (lang_output_section_statement_t - exp_init_os (s->load_base); - - /* If supplied an alignment, set it. */ -- if (s->section_alignment != -1) -- s->bfd_section->alignment_power = s->section_alignment; -+ if (s->section_alignment != NULL) -+ s->bfd_section->alignment_power = exp_get_power (s->section_alignment, -+ "section alignment"); - } - - /* Make sure that all output sections mentioned in an expression are -@@ -4706,8 +4707,10 @@ size_input_section - is greater than any seen before, then record it too. Perform - the alignment by inserting a magic 'padding' statement. */ - -- if (output_section_statement->subsection_alignment != -1) -- i->alignment_power = output_section_statement->subsection_alignment; -+ if (output_section_statement->subsection_alignment != NULL) -+ i->alignment_power -+ = exp_get_power (output_section_statement->subsection_alignment, -+ "subsection alignment"); - - if (o->alignment_power < i->alignment_power) - o->alignment_power = i->alignment_power; -@@ -5147,7 +5150,8 @@ lang_size_sections_1 - section_alignment = os->bfd_section->alignment_power; - } - else -- section_alignment = os->section_alignment; -+ section_alignment = exp_get_power (os->section_alignment, -+ "section alignment"); - - /* Align to what the section needs. */ - if (section_alignment > 0) -@@ -5225,7 +5229,8 @@ lang_size_sections_1 - only align according to the value in the output - statement. */ - if (os->lma_region != os->region) -- section_alignment = os->section_alignment; -+ section_alignment = exp_get_power (os->section_alignment, -+ "section alignment"); - if (section_alignment > 0) - lma = align_power (lma, section_alignment); - } -@@ -6673,25 +6678,6 @@ lang_add_output (const char *name, int f - } - } - --static int --topower (int x) --{ -- unsigned int i = 1; -- int l; -- -- if (x < 0) -- return -1; -- -- for (l = 0; l < 32; l++) -- { -- if (i >= (unsigned int) x) -- return l; -- i <<= 1; -- } -- -- return 0; --} -- - lang_output_section_statement_type * - lang_enter_output_section_statement (const char *output_section_statement_name, - etree_type *address_exp, -@@ -6727,10 +6713,8 @@ lang_enter_output_section_statement (con - einfo (_("%F%P:%pS: error: align with input and explicit align specified\n"), - NULL); - -- os->subsection_alignment = -- topower (exp_get_value_int (subalign, -1, "subsection alignment")); -- os->section_alignment = -- topower (exp_get_value_int (align, -1, "section alignment")); -+ os->subsection_alignment = subalign; -+ os->section_alignment = align; - - os->load_base = ebase; - return os; -@@ -7748,7 +7732,7 @@ lang_new_phdr (const char *name, - n = (struct lang_phdr *) stat_alloc (sizeof (struct lang_phdr)); - n->next = NULL; - n->name = name; -- n->type = exp_get_value_int (type, 0, "program header type"); -+ n->type = exp_get_vma (type, 0, "program header type"); - n->filehdr = filehdr; - n->phdrs = phdrs; - n->at = at; -diff -rup binutils.orig/ld/ldlang.h binutils-2.31.1/ld/ldlang.h ---- binutils.orig/ld/ldlang.h 2018-09-04 11:00:05.533667114 +0100 -+++ binutils-2.31.1/ld/ldlang.h 2018-09-04 11:08:29.224100845 +0100 -@@ -143,6 +143,8 @@ typedef struct lang_output_section_state - fill_type *fill; - union etree_union *addr_tree; - union etree_union *load_base; -+ union etree_union *section_alignment; -+ union etree_union *subsection_alignment; - - /* If non-null, an expression to evaluate after setting the section's - size. The expression is evaluated inside REGION (above) with '.' -@@ -153,8 +155,6 @@ typedef struct lang_output_section_state - lang_output_section_phdr_list *phdrs; - - unsigned int block_value; -- int subsection_alignment; /* Alignment of components. */ -- int section_alignment; /* Alignment of start of section. */ - int constraint; - flagword flags; - enum section_type sectype; diff --git a/binutils-detect-corrupt-sym-version-info.patch b/binutils-detect-corrupt-sym-version-info.patch deleted file mode 100644 index dc7cf178c5948fdf60aa7e9a2188f458527f35f0..0000000000000000000000000000000000000000 --- a/binutils-detect-corrupt-sym-version-info.patch +++ /dev/null @@ -1,52 +0,0 @@ -diff -rup binutils,orig/bfd/elf.c binutils-2.31.1/bfd/elf.c ---- binutils,orig/bfd/elf.c 2018-08-28 12:38:29.987511521 +0100 -+++ binutils-2.31.1/bfd/elf.c 2018-08-28 12:39:35.010036349 +0100 -@@ -1877,7 +1877,7 @@ _bfd_elf_get_symbol_version_string (bfd - { - Elf_Internal_Verneed *t; - -- version_string = ""; -+ version_string = _(""); - for (t = elf_tdata (abfd)->verref; - t != NULL; - t = t->vn_nextref) -diff -rup binutils,orig/binutils/readelf.c binutils-2.31.1/binutils/readelf.c ---- binutils,orig/binutils/readelf.c 2018-08-28 12:38:30.552507392 +0100 -+++ binutils-2.31.1/binutils/readelf.c 2018-08-28 12:42:04.625942967 +0100 -@@ -11263,6 +11263,7 @@ get_symbol_version_string (Filedata * - unsigned char data[2]; - unsigned short vers_data; - unsigned long offset; -+ unsigned short max_vd_ndx; - - if (!is_dynsym - || version_info[DT_VERSIONTAGIDX (DT_VERSYM)] == 0) -@@ -11280,6 +11281,8 @@ get_symbol_version_string (Filedata * - if ((vers_data & VERSYM_HIDDEN) == 0 && vers_data == 0) - return NULL; - -+ max_vd_ndx = 0; -+ - /* Usually we'd only see verdef for defined symbols, and verneed for - undefined symbols. However, symbols defined by the linker in - .dynbss for variables copied from a shared library in order to -@@ -11322,6 +11325,9 @@ get_symbol_version_string (Filedata * - ivd.vd_flags = BYTE_GET (evd.vd_flags); - } - -+ if ((ivd.vd_ndx & VERSYM_VERSION) > max_vd_ndx) -+ max_vd_ndx = ivd.vd_ndx & VERSYM_VERSION; -+ - off += ivd.vd_next; - } - while (ivd.vd_ndx != (vers_data & VERSYM_VERSION) && ivd.vd_next != 0); -@@ -11413,6 +11419,9 @@ get_symbol_version_string (Filedata * - return (ivna.vna_name < strtab_size - ? strtab + ivna.vna_name : _("")); - } -+ else if ((max_vd_ndx || (vers_data & VERSYM_VERSION) != 1) -+ && (vers_data & VERSYM_VERSION) > max_vd_ndx) -+ return _(""); - } - return NULL; - } diff --git a/binutils-fix-testsuite-failures.patch b/binutils-fix-testsuite-failures.patch deleted file mode 100644 index b8a1a56d80a715f977e6fa6478ca1e3954a9dad9..0000000000000000000000000000000000000000 --- a/binutils-fix-testsuite-failures.patch +++ /dev/null @@ -1,657 +0,0 @@ -diff -rup binutils.orig/gold/testsuite/Makefile.am binutils-2.30/gold/testsuite/Makefile.am ---- binutils.orig/gold/testsuite/Makefile.am 2018-05-31 16:14:12.736538727 +0100 -+++ binutils-2.30/gold/testsuite/Makefile.am 2018-06-01 10:15:00.936103521 +0100 -@@ -393,7 +393,7 @@ icf_sht_rel_addend_test: icf_sht_rel_add - icf_sht_rel_addend_test.stdout: icf_sht_rel_addend_test - $(TEST_NM) icf_sht_rel_addend_test > icf_sht_rel_addend_test.stdout - --check_PROGRAMS += large_symbol_alignment -+# check_PROGRAMS += large_symbol_alignment - large_symbol_alignment_SOURCES = large_symbol_alignment.cc - large_symbol_alignment_DEPENDENCIES = gcctestdir/ld - large_symbol_alignment_LDFLAGS = -Bgcctestdir/ -@@ -783,7 +783,7 @@ weak_test_DEPENDENCIES = gcctestdir/ld - weak_test_LDFLAGS = -Bgcctestdir/ - weak_test_LDADD = - --check_PROGRAMS += weak_undef_test -+# check_PROGRAMS += weak_undef_test - MOSTLYCLEANFILES += alt/weak_undef_lib.so - weak_undef_test_SOURCES = weak_undef_test.cc - weak_undef_test_DEPENDENCIES = gcctestdir/ld weak_undef_lib.so alt/weak_undef_lib.so -@@ -1409,7 +1409,7 @@ initpri2_DEPENDENCIES = gcctestdir/ld - initpri2_LDFLAGS = -Bgcctestdir/ -Wl,--ctors-in-init-array - initpri2_LDADD = - --check_PROGRAMS += initpri3a -+# check_PROGRAMS += initpri3a - initpri3a_SOURCES = initpri3.c - initpri3a_DEPENDENCIES = gcctestdir/ld - initpri3a_LDFLAGS = -Bgcctestdir/ -@@ -1897,19 +1897,19 @@ relro_script_test_LDADD = relro_script_t - relro_script_test.so: gcctestdir/ld relro_script_test.t relro_test_pic.o - $(CXXLINK) -Bgcctestdir/ -shared -Wl,-z,relro -Wl,-T,$(srcdir)/relro_script_test.t relro_test_pic.o - --check_PROGRAMS += script_test_1 -+# check_PROGRAMS += script_test_1 - script_test_1_SOURCES = script_test_1a.cc script_test_1b.cc - script_test_1_DEPENDENCIES = gcctestdir/ld script_test_1.t - script_test_1_LDFLAGS = -Bgcctestdir/ -Wl,-R,. -Wl,-T,$(srcdir)/script_test_1.t - script_test_1_LDADD = - --check_PROGRAMS += script_test_2 -+# check_PROGRAMS += script_test_2 - script_test_2_SOURCES = script_test_2.cc script_test_2a.cc script_test_2b.cc - script_test_2_DEPENDENCIES = gcctestdir/ld script_test_2.t - script_test_2_LDFLAGS = -Bgcctestdir/ -Wl,-R,. -Wl,-T,$(srcdir)/script_test_2.t - script_test_2_LDADD = - --check_PROGRAMS += justsyms -+# check_PROGRAMS += justsyms - justsyms_SOURCES = justsyms_1.cc - justsyms_DEPENDENCIES = gcctestdir/ld justsyms_2r.o - justsyms_LDFLAGS = -Bgcctestdir/ -Wl,-R,justsyms_2r.o -@@ -1919,7 +1919,7 @@ justsyms_2.o: justsyms_2.cc - justsyms_2r.o: justsyms_2.o gcctestdir/ld $(srcdir)/justsyms.t - gcctestdir/ld -o $@ -r -T $(srcdir)/justsyms.t justsyms_2.o - --check_PROGRAMS += justsyms_exec -+# check_PROGRAMS += justsyms_exec - justsyms_exec_SOURCES = justsyms_exec.c - justsyms_exec_DEPENDENCIES = gcctestdir/ld justsyms_lib - justsyms_exec_LDFLAGS = -Bgcctestdir/ -Wl,-R,justsyms_lib -@@ -1930,7 +1930,7 @@ justsyms_lib.o: justsyms_lib.c - justsyms_lib: justsyms_lib.o gcctestdir/ld - gcctestdir/ld -o $@ -Ttext=0x1000200 -Tdata=0x2000000 -e exported_func justsyms_lib.o - --check_PROGRAMS += binary_test -+# check_PROGRAMS += binary_test - MOSTLYCLEANFILES += binary.txt - binary_test_SOURCES = binary_test.cc - binary_test_DEPENDENCIES = gcctestdir/ld binary.txt -@@ -1952,7 +1952,7 @@ ver_matching_def_pic.o: ver_matching_def - ver_matching_test.stdout: ver_matching_def.so - $(TEST_OBJDUMP) -T ver_matching_def.so | $(TEST_CXXFILT) > ver_matching_test.stdout - --check_PROGRAMS += script_test_3 -+# check_PROGRAMS += script_test_3 - check_SCRIPTS += script_test_3.sh - check_DATA += script_test_3.stdout - MOSTLYCLEANFILES += script_test_3.stdout -@@ -1961,7 +1961,7 @@ script_test_3: basic_test.o gcctestdir/l - script_test_3.stdout: script_test_3 - $(TEST_READELF) -SlW script_test_3 > script_test_3.stdout - --check_PROGRAMS += tls_phdrs_script_test -+# check_PROGRAMS += tls_phdrs_script_test - tls_phdrs_script_test_SOURCES = $(tls_test_SOURCES) - tls_phdrs_script_test_DEPENDENCIES = $(tls_test_DEPENDENCIES) $(srcdir)/script_test_3.t - tls_phdrs_script_test_LDFLAGS = $(tls_test_LDFLAGS) -Wl,-T,$(srcdir)/script_test_3.t -@@ -2043,7 +2043,7 @@ check_PROGRAMS += script_test_12 - script_test_12: gcctestdir/ld $(srcdir)/script_test_12.t script_test_12a.o script_test_12b.o - $(LINK) -Bgcctestdir/ -Wl,-T,$(srcdir)/script_test_12.t script_test_12a.o script_test_12b.o - --check_PROGRAMS += script_test_12i -+# check_PROGRAMS += script_test_12i - script_test_12i: gcctestdir/ld $(srcdir)/script_test_12i.t script_test_12a.o script_test_12b.o - $(LINK) -Bgcctestdir/ -Wl,-T,$(srcdir)/script_test_12i.t script_test_12a.o script_test_12b.o - script_test_12a.o: script_test_12a.c -@@ -3023,7 +3023,7 @@ two_file_test_2_ndebug.o: two_file_test_ - two_file_test_main_ndebug.o: two_file_test_main.cc - $(CXXCOMPILE) -O0 -g0 -c -o $@ $< - --check_PROGRAMS += incremental_test_2 -+# check_PROGRAMS += incremental_test_2 - MOSTLYCLEANFILES += two_file_test_tmp_2.o - incremental_test_2: two_file_test_1_v1_ndebug.o two_file_test_1_ndebug.o two_file_test_1b_ndebug.o \ - two_file_test_2_ndebug.o two_file_test_main_ndebug.o gcctestdir/ld -@@ -3033,7 +3033,7 @@ incremental_test_2: two_file_test_1_v1_n - cp -f two_file_test_1_ndebug.o two_file_test_tmp_2.o - $(CXXLINK) -Wl,--incremental-update -Wl,-z,norelro,-no-pie -Bgcctestdir/ two_file_test_tmp_2.o two_file_test_1b_ndebug.o two_file_test_2_ndebug.o two_file_test_main_ndebug.o - --check_PROGRAMS += incremental_test_3 -+# check_PROGRAMS += incremental_test_3 - MOSTLYCLEANFILES += two_file_test_tmp_3.o - incremental_test_3: two_file_test_1.o two_file_test_1b_v1.o two_file_test_1b.o \ - two_file_test_2.o two_file_test_main.o gcctestdir/ld -@@ -3043,7 +3043,7 @@ incremental_test_3: two_file_test_1.o tw - cp -f two_file_test_1b.o two_file_test_tmp_3.o - $(CXXLINK) -Wl,--incremental-update -Wl,-z,norelro,-no-pie -Bgcctestdir/ two_file_test_1.o two_file_test_tmp_3.o two_file_test_2.o two_file_test_main.o - --check_PROGRAMS += incremental_test_4 -+# check_PROGRAMS += incremental_test_4 - MOSTLYCLEANFILES += incremental_test_4.base two_file_test_tmp_4.o - incremental_test_4: two_file_test_1.o two_file_test_1b.o two_file_test_2_v1.o \ - two_file_test_2.o two_file_test_main.o gcctestdir/ld -@@ -3054,7 +3054,7 @@ incremental_test_4: two_file_test_1.o tw - cp -f two_file_test_2.o two_file_test_tmp_4.o - $(CXXLINK) -Wl,--incremental-update,--incremental-base=incremental_test_4.base -Wl,-z,norelro,-no-pie -Bgcctestdir/ two_file_test_1.o two_file_test_1b.o two_file_test_tmp_4.o two_file_test_main.o - --check_PROGRAMS += incremental_test_5 -+# check_PROGRAMS += incremental_test_5 - MOSTLYCLEANFILES += two_file_test_5.a - incremental_test_5: two_file_test_1.o two_file_test_1b_v1.o two_file_test_1b.o \ - two_file_test_2.o two_file_test_main.o gcctestdir/ld -@@ -3068,7 +3068,7 @@ incremental_test_5: two_file_test_1.o tw - - # Test the --incremental-unchanged flag with an archive library. - # The second link should not update the library. --check_PROGRAMS += incremental_test_6 -+# check_PROGRAMS += incremental_test_6 - MOSTLYCLEANFILES += two_file_test_6.a - incremental_test_6: two_file_test_1.o two_file_test_1b_v1.o two_file_test_1b.o \ - two_file_test_2.o two_file_test_main.o gcctestdir/ld -@@ -3080,7 +3080,7 @@ incremental_test_6: two_file_test_1.o tw - $(TEST_AR) rc two_file_test_6.a two_file_test_1.o two_file_test_tmp_6.o two_file_test_2.o - $(CXXLINK) -Wl,--incremental-update -Wl,-z,norelro,-no-pie -Bgcctestdir/ two_file_test_main.o -Wl,--incremental-unchanged two_file_test_6.a -Wl,--incremental-unknown - --check_PROGRAMS += incremental_copy_test -+# check_PROGRAMS += incremental_copy_test - incremental_copy_test: copy_test_v1.o copy_test.o copy_test_1.so copy_test_2.so - cp -f copy_test_v1.o copy_test_tmp.o - $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Wl,-z,norelro,-no-pie -Bgcctestdir/ -Wl,-R,. -Wl,--no-as-needed copy_test_tmp.o copy_test_1.so copy_test_2.so -@@ -3088,7 +3088,7 @@ incremental_copy_test: copy_test_v1.o co - cp -f copy_test.o copy_test_tmp.o - $(CXXLINK) -Wl,--incremental-update -Wl,-z,norelro,-no-pie -Bgcctestdir/ -Wl,-R,. -Wl,--no-as-needed copy_test_tmp.o copy_test_1.so copy_test_2.so - --check_PROGRAMS += incremental_common_test_1 -+# check_PROGRAMS += incremental_common_test_1 - incremental_common_test_1: common_test_1_v1.o common_test_1_v2.o gcctestdir/ld - cp -f common_test_1_v1.o common_test_1_tmp.o - $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Wl,-z,norelro,-no-pie -Bgcctestdir/ common_test_1_tmp.o -@@ -3096,7 +3096,7 @@ incremental_common_test_1: common_test_1 - cp -f common_test_1_v2.o common_test_1_tmp.o - $(CXXLINK) -Wl,--incremental-update -Wl,-z,norelro,-no-pie -Bgcctestdir/ common_test_1_tmp.o - --check_PROGRAMS += incremental_comdat_test_1 -+# check_PROGRAMS += incremental_comdat_test_1 - incremental_comdat_test_1: incr_comdat_test_1.o incr_comdat_test_2_v1.o incr_comdat_test_2_v2.o incr_comdat_test_2_v3.o gcctestdir/ld - cp -f incr_comdat_test_2_v1.o incr_comdat_test_1_tmp.o - $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Wl,-z,norelro,-no-pie -Bgcctestdir/ incr_comdat_test_1.o incr_comdat_test_1_tmp.o -diff -rup binutils.orig/gold/testsuite/Makefile.in binutils-2.30/gold/testsuite/Makefile.in ---- binutils.orig/gold/testsuite/Makefile.in 2018-05-31 16:14:12.729538804 +0100 -+++ binutils-2.30/gold/testsuite/Makefile.in 2018-06-01 10:15:13.070965094 +0100 -@@ -166,7 +166,6 @@ check_PROGRAMS = $(am__EXEEXT_1) $(am__E - @GCC_TRUE@@NATIVE_LINKER_TRUE@ alt/weak_undef_lib.so \ - @GCC_TRUE@@NATIVE_LINKER_TRUE@ libweak_undef_2.a - @GCC_TRUE@@NATIVE_LINKER_TRUE@am__append_5 = icf_virtual_function_folding_test \ --@GCC_TRUE@@NATIVE_LINKER_TRUE@ large_symbol_alignment \ - @GCC_TRUE@@NATIVE_LINKER_TRUE@ basic_test basic_pic_test \ - @GCC_TRUE@@NATIVE_LINKER_TRUE@ eh_test - @GCC_FALSE@large_symbol_alignment_DEPENDENCIES = -@@ -220,7 +219,6 @@ check_PROGRAMS = $(am__EXEEXT_1) $(am__E - @NATIVE_LINKER_FALSE@exception_test_DEPENDENCIES = - @GCC_TRUE@@HAVE_STATIC_TRUE@@NATIVE_LINKER_TRUE@am__append_14 = exception_static_test - @GCC_TRUE@@NATIVE_LINKER_TRUE@am__append_15 = weak_test \ --@GCC_TRUE@@NATIVE_LINKER_TRUE@ weak_undef_test \ - @GCC_TRUE@@NATIVE_LINKER_TRUE@ weak_undef_test_2 - @GCC_FALSE@weak_test_DEPENDENCIES = - @NATIVE_LINKER_FALSE@weak_test_DEPENDENCIES = -@@ -334,7 +332,7 @@ check_PROGRAMS = $(am__EXEEXT_1) $(am__E - # Test difference between "*(a b)" and "*(a) *(b)" in input section spec. - @GCC_TRUE@@NATIVE_LINKER_TRUE@am__append_39 = many_sections_test \ - @GCC_TRUE@@NATIVE_LINKER_TRUE@ many_sections_r_test initpri1 \ --@GCC_TRUE@@NATIVE_LINKER_TRUE@ initpri2 initpri3a \ -+@GCC_TRUE@@NATIVE_LINKER_TRUE@ initpri2 \ - @GCC_TRUE@@NATIVE_LINKER_TRUE@ flagstest_o_specialfile \ - @GCC_TRUE@@NATIVE_LINKER_TRUE@ flagstest_compress_debug_sections_none \ - @GCC_TRUE@@NATIVE_LINKER_TRUE@ flagstest_compress_debug_sections \ -@@ -348,13 +346,9 @@ check_PROGRAMS = $(am__EXEEXT_1) $(am__E - @GCC_TRUE@@NATIVE_LINKER_TRUE@ ver_test_12 protected_1 \ - @GCC_TRUE@@NATIVE_LINKER_TRUE@ protected_2 relro_test \ - @GCC_TRUE@@NATIVE_LINKER_TRUE@ relro_now_test relro_strip_test \ --@GCC_TRUE@@NATIVE_LINKER_TRUE@ relro_script_test script_test_1 \ --@GCC_TRUE@@NATIVE_LINKER_TRUE@ script_test_2 justsyms \ --@GCC_TRUE@@NATIVE_LINKER_TRUE@ justsyms_exec binary_test \ --@GCC_TRUE@@NATIVE_LINKER_TRUE@ script_test_3 \ --@GCC_TRUE@@NATIVE_LINKER_TRUE@ tls_phdrs_script_test \ -+@GCC_TRUE@@NATIVE_LINKER_TRUE@ relro_script_test \ - @GCC_TRUE@@NATIVE_LINKER_TRUE@ tls_script_test script_test_11 \ --@GCC_TRUE@@NATIVE_LINKER_TRUE@ script_test_12 script_test_12i \ -+@GCC_TRUE@@NATIVE_LINKER_TRUE@ script_test_12 \ - @GCC_TRUE@@NATIVE_LINKER_TRUE@ dynamic_list_2 \ - @GCC_TRUE@@NATIVE_LINKER_TRUE@ thin_archive_test_1 \ - @GCC_TRUE@@NATIVE_LINKER_TRUE@ thin_archive_test_2 -@@ -813,15 +807,7 @@ check_PROGRAMS = $(am__EXEEXT_1) $(am__E - - # Test the --incremental-unchanged flag with an archive library. - # The second link should not update the library. --@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@am__append_82 = incremental_test_2 \ --@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ incremental_test_3 \ --@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ incremental_test_4 \ --@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ incremental_test_5 \ --@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ incremental_test_6 \ --@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ incremental_copy_test \ --@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ incremental_common_test_1 \ --@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ incremental_comdat_test_1 \ --@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_x86_64_bnd_test -+@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@am__append_82 = - @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@am__append_83 = two_file_test_tmp_2.o \ - @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_test_tmp_3.o \ - @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ incremental_test_4.base \ -@@ -1082,7 +1068,6 @@ libgoldtest_a_OBJECTS = $(am_libgoldtest - @NATIVE_OR_CROSS_LINKER_TRUE@ leb128_unittest$(EXEEXT) \ - @NATIVE_OR_CROSS_LINKER_TRUE@ overflow_unittest$(EXEEXT) - @GCC_TRUE@@NATIVE_LINKER_TRUE@am__EXEEXT_2 = icf_virtual_function_folding_test$(EXEEXT) \ --@GCC_TRUE@@NATIVE_LINKER_TRUE@ large_symbol_alignment$(EXEEXT) \ - @GCC_TRUE@@NATIVE_LINKER_TRUE@ basic_test$(EXEEXT) \ - @GCC_TRUE@@NATIVE_LINKER_TRUE@ basic_pic_test$(EXEEXT) \ - @GCC_TRUE@@NATIVE_LINKER_TRUE@ eh_test$(EXEEXT) -@@ -1127,7 +1112,6 @@ libgoldtest_a_OBJECTS = $(am_libgoldtest - @GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_separate_shared_21_test$(EXEEXT) - @GCC_TRUE@@HAVE_STATIC_TRUE@@NATIVE_LINKER_TRUE@am__EXEEXT_11 = exception_static_test$(EXEEXT) - @GCC_TRUE@@NATIVE_LINKER_TRUE@am__EXEEXT_12 = weak_test$(EXEEXT) \ --@GCC_TRUE@@NATIVE_LINKER_TRUE@ weak_undef_test$(EXEEXT) \ - @GCC_TRUE@@NATIVE_LINKER_TRUE@ weak_undef_test_2$(EXEEXT) - @FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@am__EXEEXT_13 = weak_undef_nonpic_test$(EXEEXT) - @GCC_TRUE@@NATIVE_LINKER_TRUE@am__EXEEXT_14 = \ -@@ -1164,7 +1148,6 @@ libgoldtest_a_OBJECTS = $(am_libgoldtest - @GCC_TRUE@@NATIVE_LINKER_TRUE@ many_sections_r_test$(EXEEXT) \ - @GCC_TRUE@@NATIVE_LINKER_TRUE@ initpri1$(EXEEXT) \ - @GCC_TRUE@@NATIVE_LINKER_TRUE@ initpri2$(EXEEXT) \ --@GCC_TRUE@@NATIVE_LINKER_TRUE@ initpri3a$(EXEEXT) \ - @GCC_TRUE@@NATIVE_LINKER_TRUE@ flagstest_o_specialfile$(EXEEXT) \ - @GCC_TRUE@@NATIVE_LINKER_TRUE@ flagstest_compress_debug_sections_none$(EXEEXT) \ - @GCC_TRUE@@NATIVE_LINKER_TRUE@ flagstest_compress_debug_sections$(EXEEXT) \ -@@ -1186,17 +1169,9 @@ libgoldtest_a_OBJECTS = $(am_libgoldtest - @GCC_TRUE@@NATIVE_LINKER_TRUE@ relro_now_test$(EXEEXT) \ - @GCC_TRUE@@NATIVE_LINKER_TRUE@ relro_strip_test$(EXEEXT) \ - @GCC_TRUE@@NATIVE_LINKER_TRUE@ relro_script_test$(EXEEXT) \ --@GCC_TRUE@@NATIVE_LINKER_TRUE@ script_test_1$(EXEEXT) \ --@GCC_TRUE@@NATIVE_LINKER_TRUE@ script_test_2$(EXEEXT) \ --@GCC_TRUE@@NATIVE_LINKER_TRUE@ justsyms$(EXEEXT) \ --@GCC_TRUE@@NATIVE_LINKER_TRUE@ justsyms_exec$(EXEEXT) \ --@GCC_TRUE@@NATIVE_LINKER_TRUE@ binary_test$(EXEEXT) \ --@GCC_TRUE@@NATIVE_LINKER_TRUE@ script_test_3$(EXEEXT) \ --@GCC_TRUE@@NATIVE_LINKER_TRUE@ tls_phdrs_script_test$(EXEEXT) \ - @GCC_TRUE@@NATIVE_LINKER_TRUE@ tls_script_test$(EXEEXT) \ - @GCC_TRUE@@NATIVE_LINKER_TRUE@ script_test_11$(EXEEXT) \ - @GCC_TRUE@@NATIVE_LINKER_TRUE@ script_test_12$(EXEEXT) \ --@GCC_TRUE@@NATIVE_LINKER_TRUE@ script_test_12i$(EXEEXT) \ - @GCC_TRUE@@NATIVE_LINKER_TRUE@ dynamic_list_2$(EXEEXT) \ - @GCC_TRUE@@NATIVE_LINKER_TRUE@ thin_archive_test_1$(EXEEXT) \ - @GCC_TRUE@@NATIVE_LINKER_TRUE@ thin_archive_test_2$(EXEEXT) -@@ -1263,14 +1238,7 @@ libgoldtest_a_OBJECTS = $(am_libgoldtest - @GCC_TRUE@@NATIVE_LINKER_TRUE@ ehdr_start_test_3$(EXEEXT) \ - @GCC_TRUE@@NATIVE_LINKER_TRUE@ ehdr_start_test_5$(EXEEXT) \ - @GCC_TRUE@@NATIVE_LINKER_TRUE@ pr20976$(EXEEXT) --@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@am__EXEEXT_40 = incremental_test_2$(EXEEXT) \ --@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ incremental_test_3$(EXEEXT) \ --@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ incremental_test_4$(EXEEXT) \ --@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ incremental_test_5$(EXEEXT) \ --@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ incremental_test_6$(EXEEXT) \ --@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ incremental_copy_test$(EXEEXT) \ --@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ incremental_common_test_1$(EXEEXT) \ --@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ incremental_comdat_test_1$(EXEEXT) \ -+@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@am__EXEEXT_40 = \ - @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_x86_64_bnd_test$(EXEEXT) - @GCC_TRUE@@NATIVE_LINKER_TRUE@am__EXEEXT_41 = pr22266$(EXEEXT) - basic_pic_test_SOURCES = basic_pic_test.c ---- binutils.orig/ld/testsuite/ld-elf/pr22269-1.c 2018-05-31 16:14:12.648539694 +0100 -+++ binutils-2.30/ld/testsuite/ld-elf/pr22269-1.c 2018-06-01 10:55:24.284977908 +0100 -@@ -5,4 +5,5 @@ _start (void) - { - if (&foo) - return foo; -+ return 0; - } ---- binutils.orig/ld/testsuite/ld-scripts/cross3.t 2018-05-31 16:14:12.679539354 +0100 -+++ binutils-2.30/ld/testsuite/ld-scripts/cross3.t 2018-06-01 10:59:46.109996654 +0100 -@@ -6,5 +6,6 @@ SECTIONS - .nocrossrefs : { *(.nocrossrefs) } - .data : { *(.data) *(.data.*) *(.sdata) *(.opd) *(.toc) } - .bss : { *(.bss) *(COMMON) } -+ .got.plt : { *(.got) *(.plt) *(.got.plt) } - /DISCARD/ : { *(*) } - } ---- binutils.orig/ld/testsuite/ld-srec/srec.exp 2018-05-31 16:14:12.570540551 +0100 -+++ binutils-2.30/ld/testsuite/ld-srec/srec.exp 2018-06-01 11:01:15.443979458 +0100 -@@ -19,6 +19,14 @@ - # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, - # MA 02110-1301, USA. - -+if [istarget x86_64-*-*] { -+ # The S-record tests are failing for some configurations -+ # of x86_64-linux builds, but not others. Not worth -+ # investigating however as S-record conversion can always -+ # be done outside of the linker. -+ return -+} -+ - # Get the offset from an S-record line to the start of the data. - - proc srec_off { l } { ---- binutils.orig/ld/testsuite/ld-x86-64/pr22001-1b.err 2018-05-31 16:14:12.621539991 +0100 -+++ binutils-2.30/ld/testsuite/ld-x86-64/pr22001-1b.err 2018-06-01 11:02:58.554805393 +0100 -@@ -1,2 +1,2 @@ --.*relocation R_X86_64_32S against symbol `copy' can not be used when making a P(D|I)E object; recompile with -fPIC -+.*relocation R_X86_64_(PC32|32S) against symbol `copy' can not be used when making a P(D|I)E object; recompile with -fPIC - #... ---- binutils.orig/ld/testsuite/ld-x86-64/pr21997-1b.err 2018-05-31 16:14:12.620540002 +0100 -+++ binutils-2.30/ld/testsuite/ld-x86-64/pr21997-1b.err 2018-06-01 11:04:01.535088273 +0100 -@@ -1,2 +1,2 @@ --.*relocation R_X86_64_32S against protected symbol `protected' can not be used when making a P(D|I)E object; recompile with -fPIC -+.*relocation R_X86_64_(PC32|32S) against protected symbol `protected' can not be used when making a P(D|I)E object; recompile with -fPIC - #... ---- binutils.orig/ld/testsuite/ld-x86-64/x86-64.exp 2018-05-31 16:14:12.617540035 +0100 -+++ binutils-2.30/ld/testsuite/ld-x86-64/x86-64.exp 2018-06-01 11:05:46.005912951 +0100 -@@ -1792,7 +1792,7 @@ if { [isnative] && [which $CC] != 0 } { - } - } - -- undefined_weak "$NOPIE_CFLAGS" "$NOPIE_LDFLAGS" -+ # undefined_weak "$NOPIE_CFLAGS" "$NOPIE_LDFLAGS" - undefined_weak "-fPIE" "" - undefined_weak "-fPIE" "-pie" - undefined_weak "-fPIE" "-Wl,-z,nodynamic-undefined-weak" ---- binutils.orig/ld/testsuite/ld-size/size-7a.c 2018-05-31 16:14:12.569540562 +0100 -+++ binutils-2.30/ld/testsuite/ld-size/size-7a.c 2018-06-01 11:06:44.106265741 +0100 -@@ -1,11 +1,12 @@ - #include - --extern char size_of_bar asm ("bar@SIZE"); -+extern char size_of_bar asm ("bar@SIZE"); -+char * bar_size = & size_of_bar; - - int --main () -+main (void) - { -- if (10 == (long) &size_of_bar) -+ if (10L == (long) bar_size) - printf ("OK\n"); - - return 0; ---- binutils.orig/ld/testsuite/ld-size/size-8a.c 2018-05-31 16:14:12.568540573 +0100 -+++ binutils-2.30/ld/testsuite/ld-size/size-8a.c 2018-06-01 11:07:54.926476839 +0100 -@@ -1,14 +1,15 @@ - #include - - extern __thread char bar[]; --extern char size_of_bar asm ("bar@SIZE"); --extern void set_bar (int, int); -+extern char size_of_bar asm ("bar@SIZE"); -+extern void set_bar (int, int); -+char * bar_size = & size_of_bar; - - int --main () -+main (void) - { - set_bar (1, 20); -- if (10 == (long) &size_of_bar && bar[1] == 20) -+ if (10L == (long) bar_size && bar[1] == 20) - printf ("OK\n"); - - return 0; ---- binutils.orig/ld/testsuite/ld-size/size-4b.c 2018-05-31 16:14:12.569540562 +0100 -+++ binutils-2.30/ld/testsuite/ld-size/size-4b.c 2018-06-01 11:09:00.979741038 +0100 -@@ -2,7 +2,7 @@ extern char bar[]; - extern char size_of_bar asm ("bar@SIZE"); - - char *bar_size_1 = &size_of_bar; --static char *bar_size_2 = &size_of_bar; -+char *bar_size_2 = &size_of_bar; - - char * - bar_size1 (void) -@@ -20,7 +20,7 @@ extern char foo[]; - extern char size_of_foo asm ("foo@SIZE"); - - char *foo_size_1 = &size_of_foo; --static char *foo_size_2 = &size_of_foo; -+char *foo_size_2 = &size_of_foo; - - char * - foo_size1 (void) ---- binutils.orig/ld/testsuite/ld-size/size-5b.c 2018-05-31 16:14:12.569540562 +0100 -+++ binutils-2.30/ld/testsuite/ld-size/size-5b.c 2018-06-01 11:09:42.134282596 +0100 -@@ -2,7 +2,7 @@ extern __thread char bar[]; - extern char size_of_bar asm ("bar@SIZE"); - - char *bar_size_1 = &size_of_bar; --static char *bar_size_2 = &size_of_bar; -+char *bar_size_2 = &size_of_bar; - - char * - bar_size1 (void) -@@ -21,7 +21,7 @@ extern __thread char foo[]; - extern char size_of_foo asm ("foo@SIZE"); - - char *foo_size_1 = &size_of_foo; --static char *foo_size_2 = &size_of_foo; -+char *foo_size_2 = &size_of_foo; - - char * - foo_size1 (void) ---- binutils.orig/ld/testsuite/ld-size/size-6a.c 2018-05-31 16:14:12.568540573 +0100 -+++ binutils-2.30/ld/testsuite/ld-size/size-6a.c 2018-06-01 11:11:42.478942015 +0100 -@@ -1,14 +1,15 @@ - #include - --extern char bar[]; --extern char size_of_bar asm ("bar@SIZE"); --extern void set_bar (int, int); -+extern char bar[]; -+extern char size_of_bar asm ("bar@SIZE"); -+extern void set_bar (int, int); -+char * bar_size = & size_of_bar; - - int --main () -+main (void) - { - set_bar (1, 20); -- if (10 == (long) &size_of_bar && bar[1] == 20) -+ if (10 == (long) bar_size && bar[1] == 20) - printf ("OK\n"); - - return 0; ---- binutils.orig/ld/testsuite/ld-s390/tlspic_64.dd 2018-05-31 16:14:12.579540452 +0100 -+++ binutils-2.30/ld/testsuite/ld-s390/tlspic_64.dd 2018-06-01 13:20:16.509595466 +0100 -@@ -78,7 +78,7 @@ Disassembly of section .text: - +[0-9a-f]+: 00 00 00 60 .long 0x00000060 - # function prolog - +[0-9a-f]+: b9 04 00 ef lgr %r14,%r15 -- +[0-9a-f]+: c0 c0 [0-9a-f ]+ larl %r12,[0-9a-f]+ <_GLOBAL_OFFSET_TABLE_> -+ +[0-9a-f]+: c0 c0 [0-9a-f ]+ larl %r12,[0-9a-f]+ <.*> - +[0-9a-f]+: a7 fb ff 60 aghi %r15,-160 - +[0-9a-f]+: e3 e0 e0 00 00 24 stg %r14,0\(%r14\) - # extract TCB ---- binutils.orig/ld/testsuite/ld-srec/srec.exp 2018-05-31 16:14:12.570540551 +0100 -+++ binutils-2.30/ld/testsuite/ld-srec/srec.exp 2018-06-01 13:24:35.262758291 +0100 -@@ -420,6 +420,8 @@ setup_xfail "bfin-*-linux-uclibc" - # generate the format if need be). - setup_xfail "tile*-*-*" - -+setup_xfail "s390*-*-*" -+ - run_srec_test $test1 "tmpdir/sr1.o tmpdir/sr2.o" - - # Now try linking a C++ program with global constructors and ---- binutils.orig/ld/testsuite/ld-elf/indirect.exp 2018-05-31 16:14:12.649539683 +0100 -+++ binutils-2.30/ld/testsuite/ld-elf/indirect.exp 2018-06-01 14:32:22.949232924 +0100 -@@ -156,12 +156,26 @@ set run_tests { - {"Run with libindirect4c.so 4" - "-Wl,--no-as-needed tmpdir/libindirect4c.so tmpdir/indirect4b.o tmpdir/indirect4a.o" "" - {dummy.c} "indirect4d" "indirect4.out"} -- {"Run indirect5 1" -- "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/libindirect5.so" "" -- {indirect5a.c} "indirect5a" "indirect5.out" "$NOPIE_CFLAGS"} -- {"Run indirect5 2" -- "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/indirect5a.o tmpdir/libindirect5.so" "" -- {dummy.c} "indirect5b" "indirect5.out" "$NOPIE_CFLAGS"} -+} -+ -+run_ld_link_exec_tests $run_tests -+ -+# The s390x system compiler miscompiles these tests. -+if { ! [istarget s390x-*-*] } { -+ -+ set run_tests { -+ {"Run indirect5 1" -+ "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/libindirect5.so" "" -+ {indirect5a.c} "indirect5a" "indirect5.out" "$NOPIE_CFLAGS"} -+ {"Run indirect5 2" -+ "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/indirect5a.o tmpdir/libindirect5.so" "" -+ {dummy.c} "indirect5b" "indirect5.out" "$NOPIE_CFLAGS"} -+ } -+ -+ run_ld_link_exec_tests $run_tests -+} -+ -+set run_tests { - {"Run indirect6 1" - "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/libindirect5.so" "" - {indirect6a.c} "indirect6a" "indirect5.out" "$NOPIE_CFLAGS"} -@@ -213,12 +227,15 @@ proc check_dynamic_syms { test } { - return 1 - } - --foreach t [list indirect5a indirect5b indirect6a indirect6b] { -- set testname [concat $t "dynsym"] -- if { [check_dynamic_syms tmpdir/$t] } { -- pass $testname -- } else { -- fail $testname -+# The s390x system compiler miscompiles indirect5 tests. -+if { ! [istarget s390x-*-*] } { -+ foreach t [list indirect5a indirect5b indirect6a indirect6b] { -+ set testname [concat $t "dynsym"] -+ if { [check_dynamic_syms tmpdir/$t] } { -+ pass $testname -+ } else { -+ fail $testname -+ } - } - } - -@@ -229,13 +246,22 @@ if { ! [string match "" $exec_output] } - return - } - -+ -+# The s390x system compiler miscompiles these tests. -+if { ! [istarget s390x-*-*] } { -+ set pie_tests { -+ {"Run indirect5 3" -+ "-pie -Wl,--no-as-needed tmpdir/libindirect5.so" "" -+ {indirect5a.c} "indirect5c" "indirect5.out" "-fPIE"} -+ {"Run indirect5 4" -+ "-pie -Wl,--no-as-needed tmpdir/indirect5a.o tmpdir/libindirect5.so" "" -+ {dummy.c} "indirect5d" "indirect5.out" "-fPIE"} -+ } -+ -+ run_ld_link_exec_tests $pie_tests -+} -+ - set pie_tests { -- {"Run indirect5 3" -- "-pie -Wl,--no-as-needed tmpdir/libindirect5.so" "" -- {indirect5a.c} "indirect5c" "indirect5.out" "-fPIE"} -- {"Run indirect5 4" -- "-pie -Wl,--no-as-needed tmpdir/indirect5a.o tmpdir/libindirect5.so" "" -- {dummy.c} "indirect5d" "indirect5.out" "-fPIE"} - {"Run indirect6 3" - "-pie -Wl,--no-as-needed tmpdir/libindirect5.so" "" - {indirect6a.c} "indirect6c" "indirect5.out" "-fPIE"} -@@ -246,11 +272,14 @@ set pie_tests { - - run_ld_link_exec_tests $pie_tests - --foreach t [list indirect5c indirect5d indirect6c indirect6d] { -- set testname [concat $t "dynsym"] -- if { [check_dynamic_syms tmpdir/$t] } { -- pass $testname -- } else { -- fail $testname -+# The s390x system compiler miscompiles indirect5 tests. -+if { ! [istarget s390x-*-*] } { -+ foreach t [list indirect5c indirect5d indirect6c indirect6d] { -+ set testname [concat $t "dynsym"] -+ if { [check_dynamic_syms tmpdir/$t] } { -+ pass $testname -+ } else { -+ fail $testname -+ } - } - } ---- binutils.orig/ld/testsuite/ld-elfvers/vers.exp 2018-05-31 16:14:12.572540529 +0100 -+++ binutils-2.30/ld/testsuite/ld-elfvers/vers.exp 2018-06-01 15:23:36.518815276 +0100 -@@ -938,6 +938,7 @@ if [string match "yes" $pic] then { - build_exec "vers23" vers23.c vers23 "-Wl,--no-as-needed tmpdir/vers23a.so tmpdir/vers23b.o tmpdir/vers23b.so" "" vers23.ver vers23.dsym "" - } - -+if {! [istarget ppc64*-*-*] } { - # Test .symver x,x@VERS.0 - set as_pic_flags "" - if [istarget sparc*-*-*] { -@@ -955,6 +956,7 @@ run_ld_link_tests [list "\"vers24c\" - \"-shared --version-script $srcdir/$subdir/vers24.map\" \"\" - \"$as_pic_flags $as_options\" {vers24c.c} { { readelf -Wrs vers24.rd } } - \"libvers24c.so\" \"-fpic\""] -+} - - # Test versioned definition vs. normal definition in different files. - if [string match "yes" $pic] then { ---- binutils.orig/ld/testsuite/ld-ifunc/ifunc.exp 2018-05-31 16:14:12.573540519 +0100 -+++ binutils-2.30/ld/testsuite/ld-ifunc/ifunc.exp 2018-06-01 15:26:52.020691739 +0100 -@@ -284,11 +284,14 @@ if {! [check_osabi tmpdir/static_nonifun - # The linked ifunc using executables and the shared library containing - # ifunc should contain an IFUNC symbol. The non-ifunc using executable - # should not. -- -+if { ![istarget "ppc*-*-*"] } { - if {[contains_ifunc_symbol tmpdir/libshared_ifunc.so] != 1} { - fail "Shared libraries containing ifunc does not contain an IFUNC symbol" - set fails [expr $fails + 1] - } -+} -+ -+if { ![istarget "ppc*-*-*"] } { - if {[contains_ifunc_symbol tmpdir/local_prog] != 1} { - fail "Local ifunc-using executable does not contain an IFUNC symbol" - set fails [expr $fails + 1] -@@ -297,6 +300,7 @@ if {[contains_ifunc_symbol tmpdir/static - fail "Static ifunc-using executable does not contain an IFUNC symbol" - set fails [expr $fails + 1] - } -+} - if {[contains_ifunc_symbol tmpdir/dynamic_prog] != 0} { - fail "Dynamic ifunc-using executable contains an IFUNC symbol" - set fails [expr $fails + 1] ---- binutils.orig/ld/testsuite/ld-plugin/plugin.exp 2018-05-31 16:14:12.580540442 +0100 -+++ binutils-2.30/ld/testsuite/ld-plugin/plugin.exp 2018-06-01 15:29:44.048823172 +0100 -@@ -293,12 +293,14 @@ if { !$can_compile || $failed_compile } - - run_ld_link_tests $plugin_tests - -+if { ! [istarget "ppc*-*-*"] } { - if { [is_elf_format] \ - && [ld_compile "$CC $CFLAGS" $srcdir/$subdir/func1p.c tmpdir/func1p.o] \ - && [ld_compile "$CC $CFLAGS" $srcdir/$subdir/func2i.c tmpdir/func2i.o] \ - && [ld_compile "$CC $CFLAGS" $srcdir/$subdir/func3h.c tmpdir/func3h.o] } { - run_ld_link_tests $plugin_extra_elf_tests - } -+} - - if {![ar_simple_create $ar "" "tmpdir/libtext.a" "tmpdir/text.o"] || \ - ![ar_simple_create $ar "" "tmpdir/libempty.a" ""]} { ---- binutils.orig/ld/testsuite/ld-elf/tls.exp 2018-07-09 09:49:50.488248175 +0100 -+++ binutils-2.30.90/ld/testsuite/ld-elf/tls.exp 2018-07-09 10:46:26.449688046 +0100 -@@ -39,7 +39,9 @@ if [istarget "sparc*-*-*"] { - append AFLAGS_PIC " -K PIC" - } - --run_ld_link_tests [list \ -+# The s390x system compiler miscompiles these tests. -+if { ! [istarget s390x-*-*] } { -+ run_ld_link_tests [list \ - [list \ - "Build pr22263-1" \ - "-pie -e _start -z text" \ -@@ -51,3 +53,4 @@ run_ld_link_tests [list \ - "-fPIE -O2" \ - ] \ - ] -+} diff --git a/binutils-gold-ignore-discarded-note-relocs.patch b/binutils-gold-ignore-discarded-note-relocs.patch deleted file mode 100644 index b354fa477b5fe553ba1d98aac2945baadaa37805..0000000000000000000000000000000000000000 --- a/binutils-gold-ignore-discarded-note-relocs.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- binutils.orig/gold/target-reloc.h 2018-07-12 11:37:24.894494658 +0100 -+++ binutils-2.30.90/gold/target-reloc.h 2018-07-12 15:38:50.049083904 +0100 -@@ -136,6 +136,7 @@ class Default_comdat_behavior - if (Layout::is_debug_info_section(name)) - return CB_PRETEND; - if (strcmp(name, ".eh_frame") == 0 -+ || strncmp(name, ".gnu.build.attributes", 21) == 0 // FIXME: We should really be checking the section type for ST_NOTE... - || strcmp(name, ".gcc_except_table") == 0) - return CB_IGNORE; - return CB_ERROR; diff --git a/binutils-merge-attribute-sections.patch b/binutils-merge-attribute-sections.patch deleted file mode 100644 index 5dcd5e49a15eba8abf5889c4950a6dc31e1b6a08..0000000000000000000000000000000000000000 --- a/binutils-merge-attribute-sections.patch +++ /dev/null @@ -1,23 +0,0 @@ -diff -rup binutils.orig/gold/layout.cc binutils-2.31.1/gold/layout.cc ---- binutils.orig/gold/layout.cc 2018-07-27 11:49:15.188939352 +0100 -+++ binutils-2.31.1/gold/layout.cc 2018-07-27 11:50:03.984405949 +0100 -@@ -5429,6 +5429,7 @@ const Layout::Section_name_mapping Layou - MAPPING_INIT(".gnu.linkonce.armextab.", ".ARM.extab"), - MAPPING_INIT(".ARM.exidx", ".ARM.exidx"), - MAPPING_INIT(".gnu.linkonce.armexidx.", ".ARM.exidx"), -+ MAPPING_INIT(".gnu.build.attributes.", ".gnu.build.attributes"), - }; - - // Mapping for ".text" section prefixes with -z,keep-text-section-prefix. -diff -rup binutils.orig/ld/scripttempl/elf.sc binutils-2.31.1/ld/scripttempl/elf.sc ---- binutils.orig/ld/scripttempl/elf.sc 2018-07-30 10:48:58.409509857 +0100 -+++ binutils-2.31.1/ld/scripttempl/elf.sc 2018-07-30 10:49:09.267393364 +0100 -@@ -692,6 +692,8 @@ cat <start == pnote->end) -+ { -+ duplicate_found = TRUE; -+ pnote->note.type = 0; -+ continue; -+ } -+ - /* Rule 2 - preserve function notes. */ - if (! is_open_note (pnote)) -- continue; -+ { -+ int iter; -+ -+ /* Check to see if there is an identical previous function note. -+ This can happen with overlays for example. */ -+ for (iter = 0, back = pnote -1; back >= pnotes; back --) -+ { -+ if (back->start == pnote->start -+ && back->end == pnote->end -+ && back->note.namesz == pnote->note.namesz -+ && memcmp (back->note.namedata, pnote->note.namedata, pnote->note.namesz) == 0) -+ { -+ fprintf (stderr, "DUP FUNXC\n"); -+ duplicate_found = TRUE; -+ pnote->note.type = 0; -+ break; -+ } -+ -+ /* Don't scan too far back however. */ -+ if (iter ++ > 16) -+ break; -+ } -+ continue; -+ } - - note_type = pnote->note.namedata[attribute_type_byte]; - diff --git a/binutils-readelf-other-sym-info.patch b/binutils-readelf-other-sym-info.patch deleted file mode 100644 index fa1b2f2e2413fe7d4980a542d0867abf8537daf1..0000000000000000000000000000000000000000 --- a/binutils-readelf-other-sym-info.patch +++ /dev/null @@ -1,66 +0,0 @@ -diff -rup binutils.orig/binutils/readelf.c binutils-2.29/binutils/readelf.c ---- binutils.orig/binutils/readelf.c 2017-12-12 16:24:19.571221194 +0000 -+++ binutils-2.29/binutils/readelf.c 2017-12-12 16:27:26.997979803 +0000 -@@ -11018,12 +11018,14 @@ print_dynamic_symbol (bfd_vma si, unsign - unsigned int vis = ELF_ST_VISIBILITY (psym->st_other); - - printf (" %-7s", get_symbol_visibility (vis)); -+#if 0 - /* Check to see if any other bits in the st_other field are set. - Note - displaying this information disrupts the layout of the - table being generated, but for the moment this case is very - rare. */ - if (psym->st_other ^ vis) - printf (" [%s] ", get_symbol_other (filedata, psym->st_other ^ vis)); -+#endif - } - - printf (" %3.3s ", get_symbol_index_type (filedata, psym->st_shndx)); -@@ -11031,6 +11033,15 @@ print_dynamic_symbol (bfd_vma si, unsign - print_symbol (25, GET_DYNAMIC_NAME (psym->st_name)); - else - printf (_(" "), psym->st_name); -+#if 1 -+ { -+ unsigned int vis = ELF_ST_VISIBILITY (psym->st_other); -+ -+ /* Check to see if any other bits in the st_other field are set. */ -+ if (psym->st_other ^ vis) -+ printf (" \t[%s]", get_symbol_other (filedata, psym->st_other ^ vis)); -+ } -+#endif - putchar ('\n'); - } - ---- binutils.orig/binutils/readelf.c 2017-12-12 16:36:21.806561149 +0000 -+++ binutils-2.29.1/binutils/readelf.c 2017-12-12 16:38:17.763168514 +0000 -@@ -11548,11 +11548,13 @@ process_symbol_table (FILE * file) - unsigned int vis = ELF_ST_VISIBILITY (psym->st_other); - - printf (" %-7s", get_symbol_visibility (vis)); -+#if 0 - /* Check to see if any other bits in the st_other field are set. - Note - displaying this information disrupts the layout of the - table being generated, but for the moment this case is very rare. */ - if (psym->st_other ^ vis) - printf (" [%s] ", get_symbol_other (filedata, psym->st_other ^ vis)); -+#endif - } - printf (" %4s ", get_symbol_index_type (filedata, psym->st_shndx)); - print_symbol (25, psym->st_name < strtab_size -@@ -11571,7 +11573,15 @@ process_symbol_table (FILE * file) - printf (sym_info == symbol_hidden ? "@%s" : "@@%s", - version_string); - } -+#if 1 -+ { -+ unsigned int vis = ELF_ST_VISIBILITY (psym->st_other); - -+ /* Check to see if any other bits in the st_other field are set. */ -+ if (psym->st_other ^ vis) -+ printf (" \t[%s] ", get_symbol_other (filedata, psym->st_other ^ vis)); -+ } -+#endif - putchar ('\n'); - - if (ELF_ST_BIND (psym->st_info) == STB_LOCAL diff --git a/binutils-s390-partial-relro.patch b/binutils-s390-partial-relro.patch deleted file mode 100644 index 83fd98a469fa470097952391555f14a99f6a0a76..0000000000000000000000000000000000000000 --- a/binutils-s390-partial-relro.patch +++ /dev/null @@ -1,872 +0,0 @@ -diff -rup binutils.orig/bfd/elf64-s390.c binutils-2.31.1/bfd/elf64-s390.c ---- binutils.orig/bfd/elf64-s390.c 2018-07-19 12:37:28.107030007 +0100 -+++ binutils-2.31.1/bfd/elf64-s390.c 2018-07-19 12:38:11.235548717 +0100 -@@ -481,7 +481,7 @@ elf_s390_is_local_label_name (bfd *abfd, - - #define RELA_ENTRY_SIZE sizeof (Elf64_External_Rela) - --/* The first three entries in a procedure linkage table are reserved, -+/* The first three entries in a global offset table are reserved, - and the initial contents are unimportant (we zero them out). - Subsequent entries look like this. See the SVR4 ABI 386 - supplement to see how this works. */ -@@ -511,8 +511,8 @@ elf_s390_is_local_label_name (bfd *abfd, - LG 1,0(1) # 6 bytes Load address from GOT in r1 - BCR 15,1 # 2 bytes Jump to address - RET1: BASR 1,0 # 2 bytes Return from GOT 1st time -- LGF 1,12(1) # 6 bytes Load offset in symbl table in r1 -- BRCL 15,-x # 6 bytes Jump to start of PLT -+ LGF 1,12(1) # 6 bytes Load rela.plt offset into r1 -+ BRCL 15,-x # 6 bytes Jump to first PLT entry - .long ? # 4 bytes offset into .rela.plt - - Total = 32 bytes per PLT entry -@@ -1605,8 +1605,7 @@ allocate_dynrelocs (struct elf_link_hash - /* Make room for this entry. */ - s->size += PLT_ENTRY_SIZE; - -- /* We also need to make an entry in the .got.plt section, which -- will be placed in the .got section by the linker script. */ -+ /* We also need to make an entry in the .got.plt section. */ - htab->elf.sgotplt->size += GOT_ENTRY_SIZE; - - /* We also need to make an entry in the .rela.plt section. */ -@@ -1831,6 +1830,20 @@ elf_s390_size_dynamic_sections (bfd *out - } - } - -+ if (htab->elf.sgot && s390_gotplt_after_got_p (info)) -+ { -+ /* _bfd_elf_create_got_section adds the got header size always -+ to .got.plt but we need it in .got if this section comes -+ first. */ -+ htab->elf.sgot->size += 3 * GOT_ENTRY_SIZE; -+ htab->elf.sgotplt->size -= 3 * GOT_ENTRY_SIZE; -+ -+ /* Make the _GLOBAL_OFFSET_TABLE_ symbol point to the .got -+ instead of .got.plt. */ -+ htab->elf.hgot->root.u.def.section = htab->elf.sgot; -+ htab->elf.hgot->root.u.def.value = 0; -+ } -+ - /* Set up .got offsets for local syms, and space for local dynamic - relocs. */ - for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next) -@@ -2131,7 +2144,6 @@ elf_s390_relocate_section (bfd *output_b - bfd_boolean unresolved_reloc; - bfd_reloc_status_type r; - int tls_type; -- asection *base_got = htab->elf.sgot; - bfd_boolean resolved_to_zero; - - r_type = ELF64_R_TYPE (rel->r_info); -@@ -2172,7 +2184,7 @@ elf_s390_relocate_section (bfd *output_b - case R_390_PLTOFF16: - case R_390_PLTOFF32: - case R_390_PLTOFF64: -- relocation -= htab->elf.sgot->output_section->vma; -+ relocation -= s390_got_pointer (info); - break; - case R_390_GOTPLT12: - case R_390_GOTPLT16: -@@ -2192,10 +2204,10 @@ elf_s390_relocate_section (bfd *output_b - htab->elf.sgot->contents + - local_got_offsets[r_symndx]); - relocation = (local_got_offsets[r_symndx] + -- htab->elf.sgot->output_offset); -+ s390_got_offset (info)); - - if (r_type == R_390_GOTENT || r_type == R_390_GOTPLTENT) -- relocation += htab->elf.sgot->output_section->vma; -+ relocation += s390_got_pointer (info); - break; - } - default: -@@ -2254,25 +2266,23 @@ elf_s390_relocate_section (bfd *output_b - - if (s390_is_ifunc_symbol_p (h)) - { -+ /* Entry indices of .iplt and .igot.plt match -+ 1:1. No magic PLT first entry here. */ - plt_index = h->plt.offset / PLT_ENTRY_SIZE; -- relocation = (plt_index * GOT_ENTRY_SIZE + -- htab->elf.igotplt->output_offset); -- if (r_type == R_390_GOTPLTENT) -- relocation += htab->elf.igotplt->output_section->vma; -+ relocation = (plt_index * GOT_ENTRY_SIZE -+ + s390_gotplt_offset (info) -+ + htab->elf.igotplt->output_offset); - } - else - { -- /* Calc. index no. -- Current offset - size first entry / entry size. */ -- plt_index = (h->plt.offset - PLT_FIRST_ENTRY_SIZE) / -- PLT_ENTRY_SIZE; -- -- /* Offset in GOT is PLT index plus GOT headers(3) -- times 8, addr & GOT addr. */ -- relocation = (plt_index + 3) * GOT_ENTRY_SIZE; -- if (r_type == R_390_GOTPLTENT) -- relocation += htab->elf.sgot->output_section->vma; -+ plt_index = ((h->plt.offset - PLT_FIRST_ENTRY_SIZE) -+ / PLT_ENTRY_SIZE); -+ -+ relocation = (plt_index * GOT_ENTRY_SIZE -+ + s390_gotplt_offset (info)); - } -+ if (r_type == R_390_GOTPLTENT) -+ relocation += s390_got_pointer (info); - unresolved_reloc = FALSE; - break; - } -@@ -2286,7 +2296,7 @@ elf_s390_relocate_section (bfd *output_b - case R_390_GOTENT: - /* Relocation is to the entry for this symbol in the global - offset table. */ -- if (base_got == NULL) -+ if (htab->elf.sgot == NULL) - abort (); - - if (h != NULL) -@@ -2303,8 +2313,19 @@ elf_s390_relocate_section (bfd *output_b - { - /* No explicit GOT usage so redirect to the - got.iplt slot. */ -- base_got = htab->elf.igotplt; -- off = h->plt.offset / PLT_ENTRY_SIZE * GOT_ENTRY_SIZE; -+ relocation = (s390_gotplt_offset (info) -+ + htab->elf.igotplt->output_offset -+ + (h->plt.offset / PLT_ENTRY_SIZE -+ * GOT_ENTRY_SIZE)); -+ -+ /* For @GOTENT the relocation is against the offset between -+ the instruction and the symbols entry in the GOT and not -+ between the start of the GOT and the symbols entry. We -+ add the vma of the GOT to get the correct value. */ -+ if (r_type == R_390_GOTENT || r_type == R_390_GOTPLTENT) -+ relocation += s390_got_pointer (info); -+ -+ break; - } - else - { -@@ -2337,7 +2358,7 @@ elf_s390_relocate_section (bfd *output_b - else - { - bfd_put_64 (output_bfd, relocation, -- base_got->contents + off); -+ htab->elf.sgot->contents + off); - h->got.offset |= 1; - } - -@@ -2419,7 +2440,7 @@ elf_s390_relocate_section (bfd *output_b - if (off >= (bfd_vma) -2) - abort (); - -- relocation = base_got->output_offset + off; -+ relocation = s390_got_offset (info) + off; - - /* For @GOTENT the relocation is against the offset between - the instruction and the symbols entry in the GOT and not -@@ -2427,7 +2448,7 @@ elf_s390_relocate_section (bfd *output_b - add the vma of the GOT to get the correct value. */ - if ( r_type == R_390_GOTENT - || r_type == R_390_GOTPLTENT) -- relocation += base_got->output_section->vma; -+ relocation += s390_got_pointer (info); - - break; - -@@ -2445,22 +2466,17 @@ elf_s390_relocate_section (bfd *output_b - relocation = (htab->elf.iplt->output_section->vma - + htab->elf.iplt->output_offset - + h->plt.offset -- - htab->elf.sgot->output_section->vma); -+ - s390_got_pointer (info)); - goto do_relocation; - } - -- /* Note that sgot->output_offset is not involved in this -- calculation. We always want the start of .got. If we -- defined _GLOBAL_OFFSET_TABLE in a different way, as is -- permitted by the ABI, we might have to change this -- calculation. */ -- relocation -= htab->elf.sgot->output_section->vma; -+ relocation -= s390_got_pointer (info); - break; - - case R_390_GOTPC: - case R_390_GOTPCDBL: - /* Use global offset table as symbol value. */ -- relocation = htab->elf.sgot->output_section->vma; -+ relocation = s390_got_pointer (info); - unresolved_reloc = FALSE; - break; - -@@ -2509,7 +2525,7 @@ elf_s390_relocate_section (bfd *output_b - || h->plt.offset == (bfd_vma) -1 - || (htab->elf.splt == NULL && !s390_is_ifunc_symbol_p (h))) - { -- relocation -= htab->elf.sgot->output_section->vma; -+ relocation -= s390_got_pointer (info); - break; - } - -@@ -2517,12 +2533,12 @@ elf_s390_relocate_section (bfd *output_b - relocation = (htab->elf.iplt->output_section->vma - + htab->elf.iplt->output_offset - + h->plt.offset -- - htab->elf.sgot->output_section->vma); -+ - s390_got_pointer (info)); - else - relocation = (htab->elf.splt->output_section->vma - + htab->elf.splt->output_offset - + h->plt.offset -- - htab->elf.sgot->output_section->vma); -+ - s390_got_pointer (info)); - unresolved_reloc = FALSE; - break; - -@@ -3296,7 +3312,7 @@ elf_s390_finish_dynamic_symbol (bfd *out - if (h->plt.offset != (bfd_vma) -1) - { - bfd_vma plt_index; -- bfd_vma got_offset; -+ bfd_vma gotplt_offset; - Elf_Internal_Rela rela; - bfd_byte *loc; - -@@ -3325,18 +3341,25 @@ elf_s390_finish_dynamic_symbol (bfd *out - Current offset - size first entry / entry size. */ - plt_index = (h->plt.offset - PLT_FIRST_ENTRY_SIZE) / PLT_ENTRY_SIZE; - -- /* Offset in GOT is PLT index plus GOT headers(3) times 8, -- addr & GOT addr. */ -- got_offset = (plt_index + 3) * GOT_ENTRY_SIZE; -+ /* The slots in the .got.plt correspond to the PLT slots in -+ the same order. */ -+ gotplt_offset = plt_index * GOT_ENTRY_SIZE; -+ -+ /* If .got.plt comes first it needs to contain the 3 header -+ entries. */ -+ if (!s390_gotplt_after_got_p (info)) -+ gotplt_offset += 3 * GOT_ENTRY_SIZE; - - /* Fill in the blueprint of a PLT. */ - memcpy (htab->elf.splt->contents + h->plt.offset, elf_s390x_plt_entry, - PLT_ENTRY_SIZE); - -- /* Fixup the relative address to the GOT entry */ -+ /* The first instruction in the PLT entry is a LARL loading -+ the address of the GOT slot. We write the 4 byte -+ immediate operand of the LARL instruction here. */ - bfd_put_32 (output_bfd, - (htab->elf.sgotplt->output_section->vma + -- htab->elf.sgotplt->output_offset + got_offset -+ htab->elf.sgotplt->output_offset + gotplt_offset - - (htab->elf.splt->output_section->vma + - htab->elf.splt->output_offset + - h->plt.offset))/2, -@@ -3356,12 +3379,12 @@ elf_s390_finish_dynamic_symbol (bfd *out - + htab->elf.splt->output_offset - + h->plt.offset - + 14), -- htab->elf.sgotplt->contents + got_offset); -+ htab->elf.sgotplt->contents + gotplt_offset); - - /* Fill in the entry in the .rela.plt section. */ - rela.r_offset = (htab->elf.sgotplt->output_section->vma - + htab->elf.sgotplt->output_offset -- + got_offset); -+ + gotplt_offset); - rela.r_info = ELF64_R_INFO (h->dynindx, R_390_JMP_SLOT); - rela.r_addend = 0; - loc = htab->elf.srelplt->contents + plt_index * -@@ -3568,8 +3591,8 @@ elf_s390_finish_dynamic_sections (bfd *o - continue; - - case DT_PLTGOT: -- s = htab->elf.sgotplt; -- dyn.d_un.d_ptr = s->output_section->vma + s->output_offset; -+ /* DT_PLTGOT matches _GLOBAL_OFFSET_TABLE_ */ -+ dyn.d_un.d_ptr = s390_got_pointer (info); - break; - - case DT_JMPREL: -@@ -3606,10 +3629,11 @@ elf_s390_finish_dynamic_sections (bfd *o - /* fill in blueprint for plt 0 entry */ - memcpy (htab->elf.splt->contents, elf_s390x_first_plt_entry, - PLT_FIRST_ENTRY_SIZE); -- /* Fixup relative address to start of GOT */ -+ /* The second instruction in the first PLT entry is a LARL -+ loading the GOT pointer. Fill in the LARL immediate -+ address. */ - bfd_put_32 (output_bfd, -- (htab->elf.sgotplt->output_section->vma -- + htab->elf.sgotplt->output_offset -+ (s390_got_pointer (info) - - htab->elf.splt->output_section->vma - - htab->elf.splt->output_offset - 6)/2, - htab->elf.splt->contents + 8); -@@ -3619,21 +3643,22 @@ elf_s390_finish_dynamic_sections (bfd *o - = PLT_ENTRY_SIZE; - } - -- if (htab->elf.sgotplt) -+ if (htab->elf.hgot && htab->elf.hgot->root.u.def.section) - { - /* Fill in the first three entries in the global offset table. */ -- if (htab->elf.sgotplt->size > 0) -+ if (htab->elf.hgot->root.u.def.section->size > 0) - { - bfd_put_64 (output_bfd, - (sdyn == NULL ? (bfd_vma) 0 - : sdyn->output_section->vma + sdyn->output_offset), -- htab->elf.sgotplt->contents); -+ htab->elf.hgot->root.u.def.section->contents); - /* One entry for shared object struct ptr. */ -- bfd_put_64 (output_bfd, (bfd_vma) 0, htab->elf.sgotplt->contents + 8); -+ bfd_put_64 (output_bfd, (bfd_vma) 0, -+ htab->elf.hgot->root.u.def.section->contents + 8); - /* One entry for _dl_runtime_resolve. */ -- bfd_put_64 (output_bfd, (bfd_vma) 0, htab->elf.sgotplt->contents + 16); -+ bfd_put_64 (output_bfd, (bfd_vma) 0, -+ htab->elf.hgot->root.u.def.section->contents + 16); - } -- - elf_section_data (htab->elf.sgot->output_section) - ->this_hdr.sh_entsize = 8; - } -diff -rup binutils.orig/bfd/elf-s390-common.c binutils-2.31.1/bfd/elf-s390-common.c ---- binutils.orig/bfd/elf-s390-common.c 2018-07-19 12:37:28.113029940 +0100 -+++ binutils-2.31.1/bfd/elf-s390-common.c 2018-07-19 12:38:11.235548717 +0100 -@@ -30,6 +30,87 @@ s390_is_ifunc_symbol_p (struct elf_link_ - return h->type == STT_GNU_IFUNC || eh->ifunc_resolver_address != 0; - } - -+/* Return true if .got.plt is supposed to be emitted after .got. */ -+ -+static inline bfd_boolean -+s390_gotplt_after_got_p (struct bfd_link_info *info) -+{ -+ struct elf_s390_link_hash_table *htab = elf_s390_hash_table (info); -+ -+ if (!htab->elf.sgot || !htab->elf.sgotplt) -+ return TRUE; -+ -+ if (htab->elf.sgot->output_section == htab->elf.sgotplt->output_section) -+ { -+ if (htab->elf.sgot->output_offset < htab->elf.sgotplt->output_offset) -+ return TRUE; -+ } -+ else -+ { -+ if (htab->elf.sgot->output_section->vma -+ <= htab->elf.sgotplt->output_section->vma) -+ return TRUE; -+ } -+ return FALSE; -+} -+ -+/* Return the value of the _GLOBAL_OFFSET_TABLE_ symbol. */ -+ -+static inline bfd_vma -+s390_got_pointer (struct bfd_link_info *info) -+{ -+ struct elf_s390_link_hash_table *htab = elf_s390_hash_table (info); -+ bfd_vma got_pointer; -+ -+ BFD_ASSERT (htab && htab->elf.hgot); -+ -+ got_pointer = (htab->elf.hgot->root.u.def.section->output_section->vma -+ + htab->elf.hgot->root.u.def.section->output_offset); -+ /* Our ABI requires the GOT pointer to point at the very beginning -+ of the global offset table. */ -+ BFD_ASSERT (got_pointer -+ <= (htab->elf.sgot->output_section->vma -+ + htab->elf.sgot->output_offset)); -+ BFD_ASSERT (got_pointer -+ <= (htab->elf.sgotplt->output_section->vma -+ + htab->elf.sgotplt->output_offset)); -+ -+ return got_pointer; -+} -+ -+ -+/* Return the offset of the .got versus _GLOBAL_OFFSET_TABLE_. */ -+ -+static inline bfd_vma -+s390_got_offset (struct bfd_link_info *info) -+{ -+ struct elf_s390_link_hash_table *htab = elf_s390_hash_table (info); -+ -+ /* The absolute address of the .got in the target image. */ -+ bfd_vma got_address = (htab->elf.sgot->output_section->vma -+ + htab->elf.sgot->output_offset); -+ -+ /* GOT offset must not be negative. */ -+ BFD_ASSERT (s390_got_pointer (info) <= got_address); -+ return got_address - s390_got_pointer (info); -+} -+ -+/* Return the offset of the .got.plt versus _GLOBAL_OFFSET_TABLE_. */ -+ -+static inline bfd_vma -+s390_gotplt_offset (struct bfd_link_info *info) -+{ -+ struct elf_s390_link_hash_table *htab = elf_s390_hash_table (info); -+ -+ /* The absolute address of the .got.plt in the target image. */ -+ bfd_vma gotplt_address = (htab->elf.sgotplt->output_section->vma -+ + htab->elf.sgotplt->output_offset); -+ -+ /* GOT offset must not be negative. */ -+ BFD_ASSERT (s390_got_pointer (info) <= gotplt_address); -+ return gotplt_address - s390_got_pointer (info); -+} -+ - /* Create sections needed by STT_GNU_IFUNC symbol. */ - - static bfd_boolean -diff -rup binutils.orig/ld/emulparams/elf64_s390.sh binutils-2.31.1/ld/emulparams/elf64_s390.sh ---- binutils.orig/ld/emulparams/elf64_s390.sh 2018-07-19 12:37:28.544025130 +0100 -+++ binutils-2.31.1/ld/emulparams/elf64_s390.sh 2018-07-19 12:38:11.235548717 +0100 -@@ -11,9 +11,12 @@ NOP=0x07070707 - TEMPLATE_NAME=elf32 - GENERATE_SHLIB_SCRIPT=yes - GENERATE_PIE_SCRIPT=yes -+GENERATE_RELRO_SCRIPT=yes - NO_SMALL_DATA=yes - EXTRA_EM_FILE=s390 - IREL_IN_PLT= -+SEPARATE_GOTPLT=0 -+test -z "$RELRO" && unset SEPARATE_GOTPLT - - # Treat a host that matches the target with the possible exception of "x" - # in the name as if it were native. -diff -rup binutils.orig/ld/emultempl/elf32.em binutils-2.31.1/ld/emultempl/elf32.em ---- binutils.orig/ld/emultempl/elf32.em 2018-07-19 12:37:28.549025074 +0100 -+++ binutils-2.31.1/ld/emultempl/elf32.em 2018-07-19 12:37:39.041907980 +0100 -@@ -2376,17 +2376,41 @@ echo ' && link_info.combrelo - echo ' && link_info.relro' >> e${EMULATION_NAME}.c - echo ' && (link_info.flags & DF_BIND_NOW)) return' >> e${EMULATION_NAME}.c - sed $sc ldscripts/${EMULATION_NAME}.xdw >> e${EMULATION_NAME}.c -+if test -n "$GENERATE_RELRO_SCRIPT" ; then -+echo ' ; else if (bfd_link_pie (&link_info)' >> e${EMULATION_NAME}.c -+echo ' && link_info.combreloc' >> e${EMULATION_NAME}.c -+echo ' && link_info.separate_code' >> e${EMULATION_NAME}.c -+echo ' && link_info.relro) return' >> e${EMULATION_NAME}.c -+sed $sc ldscripts/${EMULATION_NAME}.xdceo >> e${EMULATION_NAME}.c -+fi - echo ' ; else if (bfd_link_pie (&link_info)' >> e${EMULATION_NAME}.c - echo ' && link_info.separate_code' >> e${EMULATION_NAME}.c - echo ' && link_info.combreloc) return' >> e${EMULATION_NAME}.c - sed $sc ldscripts/${EMULATION_NAME}.xdce >> e${EMULATION_NAME}.c -+if test -n "$GENERATE_RELRO_SCRIPT" ; then -+echo ' ; else if (bfd_link_pie (&link_info)' >> e${EMULATION_NAME}.c -+echo ' && link_info.combreloc' >> e${EMULATION_NAME}.c -+echo ' && link_info.relro) return' >> e${EMULATION_NAME}.c -+sed $sc ldscripts/${EMULATION_NAME}.xdco >> e${EMULATION_NAME}.c -+fi - echo ' ; else if (bfd_link_pie (&link_info)' >> e${EMULATION_NAME}.c - echo ' && link_info.combreloc) return' >> e${EMULATION_NAME}.c - sed $sc ldscripts/${EMULATION_NAME}.xdc >> e${EMULATION_NAME}.c -+if test -n "$GENERATE_RELRO_SCRIPT" ; then -+echo ' ; else if (bfd_link_pie (&link_info)' >> e${EMULATION_NAME}.c -+echo ' && link_info.separate_code' >> e${EMULATION_NAME}.c -+echo ' && link_info.relro) return' >> e${EMULATION_NAME}.c -+sed $sc ldscripts/${EMULATION_NAME}.xdeo >> e${EMULATION_NAME}.c -+fi - fi - echo ' ; else if (bfd_link_pie (&link_info)' >> e${EMULATION_NAME}.c - echo ' && link_info.separate_code) return' >> e${EMULATION_NAME}.c - sed $sc ldscripts/${EMULATION_NAME}.xde >> e${EMULATION_NAME}.c -+if test -n "$GENERATE_RELRO_SCRIPT" ; then -+echo ' ; else if (bfd_link_pie (&link_info)' >> e${EMULATION_NAME}.c -+echo ' && link_info.relro) return' >> e${EMULATION_NAME}.c -+sed $sc ldscripts/${EMULATION_NAME}.xdo >> e${EMULATION_NAME}.c -+fi - echo ' ; else if (bfd_link_pie (&link_info)) return' >> e${EMULATION_NAME}.c - sed $sc ldscripts/${EMULATION_NAME}.xd >> e${EMULATION_NAME}.c - fi -@@ -2402,17 +2426,41 @@ echo ' && link_info.combrelo - echo ' && link_info.relro' >> e${EMULATION_NAME}.c - echo ' && (link_info.flags & DF_BIND_NOW)) return' >> e${EMULATION_NAME}.c - sed $sc ldscripts/${EMULATION_NAME}.xsw >> e${EMULATION_NAME}.c -+if test -n "$GENERATE_RELRO_SCRIPT" ; then -+echo ' ; else if (bfd_link_dll (&link_info)' >> e${EMULATION_NAME}.c -+echo ' && link_info.combreloc' >> e${EMULATION_NAME}.c -+echo ' && link_info.separate_code' >> e${EMULATION_NAME}.c -+echo ' && link_info.relro) return' >> e${EMULATION_NAME}.c -+sed $sc ldscripts/${EMULATION_NAME}.xsceo >> e${EMULATION_NAME}.c -+fi - echo ' ; else if (bfd_link_dll (&link_info)' >> e${EMULATION_NAME}.c - echo ' && link_info.combreloc' >> e${EMULATION_NAME}.c - echo ' && link_info.separate_code) return' >> e${EMULATION_NAME}.c - sed $sc ldscripts/${EMULATION_NAME}.xsce >> e${EMULATION_NAME}.c -+if test -n "$GENERATE_RELRO_SCRIPT" ; then -+echo ' ; else if (bfd_link_dll (&link_info)' >> e${EMULATION_NAME}.c -+echo ' && link_info.combreloc' >> e${EMULATION_NAME}.c -+echo ' && link_info.relro) return' >> e${EMULATION_NAME}.c -+sed $sc ldscripts/${EMULATION_NAME}.xsco >> e${EMULATION_NAME}.c -+fi - echo ' ; else if (bfd_link_dll (&link_info)' >> e${EMULATION_NAME}.c - echo ' && link_info.combreloc) return' >> e${EMULATION_NAME}.c - sed $sc ldscripts/${EMULATION_NAME}.xsc >> e${EMULATION_NAME}.c -+if test -n "$GENERATE_RELRO_SCRIPT" ; then -+echo ' ; else if (bfd_link_dll (&link_info)' >> e${EMULATION_NAME}.c -+echo ' && link_info.separate_code' >> e${EMULATION_NAME}.c -+echo ' && link_info.relro) return' >> e${EMULATION_NAME}.c -+sed $sc ldscripts/${EMULATION_NAME}.xseo >> e${EMULATION_NAME}.c -+fi - fi - echo ' ; else if (bfd_link_dll (&link_info)' >> e${EMULATION_NAME}.c - echo ' && link_info.separate_code) return' >> e${EMULATION_NAME}.c - sed $sc ldscripts/${EMULATION_NAME}.xse >> e${EMULATION_NAME}.c -+if test -n "$GENERATE_RELRO_SCRIPT" ; then -+echo ' ; else if (bfd_link_dll (&link_info)' >> e${EMULATION_NAME}.c -+echo ' && link_info.relro) return' >> e${EMULATION_NAME}.c -+sed $sc ldscripts/${EMULATION_NAME}.xso >> e${EMULATION_NAME}.c -+fi - echo ' ; else if (bfd_link_dll (&link_info)) return' >> e${EMULATION_NAME}.c - sed $sc ldscripts/${EMULATION_NAME}.xs >> e${EMULATION_NAME}.c - fi -@@ -2425,14 +2473,34 @@ echo ' ; else if (link_info.combreloc' - echo ' && link_info.relro' >> e${EMULATION_NAME}.c - echo ' && (link_info.flags & DF_BIND_NOW)) return' >> e${EMULATION_NAME}.c - sed $sc ldscripts/${EMULATION_NAME}.xw >> e${EMULATION_NAME}.c -+if test -n "$GENERATE_RELRO_SCRIPT" ; then -+echo ' ; else if (link_info.combreloc' >> e${EMULATION_NAME}.c -+echo ' && link_info.separate_code' >> e${EMULATION_NAME}.c -+echo ' && link_info.relro) return' >> e${EMULATION_NAME}.c -+sed $sc ldscripts/${EMULATION_NAME}.xceo >> e${EMULATION_NAME}.c -+fi - echo ' ; else if (link_info.combreloc' >> e${EMULATION_NAME}.c - echo ' && link_info.separate_code) return' >> e${EMULATION_NAME}.c - sed $sc ldscripts/${EMULATION_NAME}.xce >> e${EMULATION_NAME}.c -+if test -n "$GENERATE_RELRO_SCRIPT" ; then -+echo ' ; else if (link_info.combreloc' >> e${EMULATION_NAME}.c -+echo ' && link_info.relro) return' >> e${EMULATION_NAME}.c -+sed $sc ldscripts/${EMULATION_NAME}.xco >> e${EMULATION_NAME}.c -+fi - echo ' ; else if (link_info.combreloc) return' >> e${EMULATION_NAME}.c - sed $sc ldscripts/${EMULATION_NAME}.xc >> e${EMULATION_NAME}.c - fi --echo ' ; else if (link_info.separate_code) return' >> e${EMULATION_NAME}.c -+if test -n "$GENERATE_RELRO_SCRIPT" ; then -+echo ' ; else if (link_info.separate_code' >> e${EMULATION_NAME}.c -+echo ' && link_info.relro) return' >> e${EMULATION_NAME}.c -+sed $sc ldscripts/${EMULATION_NAME}.xeo >> e${EMULATION_NAME}.c -+fi -+echo ' ; else if (link_info.separate_code) return' >> e${EMULATION_NAME}.c - sed $sc ldscripts/${EMULATION_NAME}.xe >> e${EMULATION_NAME}.c -+if test -n "$GENERATE_RELRO_SCRIPT" ; then -+echo ' ; else if (link_info.relro) return' >> e${EMULATION_NAME}.c -+sed $sc ldscripts/${EMULATION_NAME}.xo >> e${EMULATION_NAME}.c -+fi - echo ' ; else return' >> e${EMULATION_NAME}.c - sed $sc ldscripts/${EMULATION_NAME}.x >> e${EMULATION_NAME}.c - echo '; }' >> e${EMULATION_NAME}.c -@@ -2471,6 +2539,21 @@ fragment < ldscripts/${EMULATION_NAME}.xe - -+if test -n "$GENERATE_RELRO_SCRIPT"; then -+ LD_FLAG= -+ RELRO=" " -+ ( echo "/* Script for -z relo: generate normal executables with separate code segment */" -+ . ${CUSTOMIZER_SCRIPT} -+ . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc -+ ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xo -+ LD_FLAG=textonly -+ ( echo "/* Script for -z separate-code -z relo: generate normal executables with separate code segment */" -+ . ${CUSTOMIZER_SCRIPT} -+ . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc -+ ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xeo -+ unset RELRO -+fi - LD_FLAG=n - DATA_ALIGNMENT=${DATA_ALIGNMENT_n} - ( echo "/* Script for -n: mix text and data on same page */" -@@ -353,6 +367,25 @@ if test -n "$GENERATE_COMBRELOC_SCRIPT"; - rm -f ${COMBRELOC} - COMBRELOC= - unset RELRO_NOW -+ if test -n "$GENERATE_RELRO_SCRIPT"; then -+ LD_FLAG=c -+ RELRO=" " -+ COMBRELOC=ldscripts/${EMULATION_NAME}.xco.tmp -+ ( echo "/* Script for -z combreloc -z relro: combine and sort reloc sections */" -+ . ${CUSTOMIZER_SCRIPT} -+ . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc -+ ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xco -+ rm -f ${COMBRELOC} -+ LD_FLAG=ctextonly -+ COMBRELOC=ldscripts/${EMULATION_NAME}.xceo.tmp -+ ( echo "/* Script for -z combreloc -z separate-code -z relro: combine and sort reloc sections */" -+ . ${CUSTOMIZER_SCRIPT} -+ . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc -+ ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xceo -+ rm -f ${COMBRELOC} -+ COMBRELOC= -+ unset RELRO -+ fi - fi - - if test -n "$GENERATE_SHLIB_SCRIPT"; then -@@ -370,6 +403,23 @@ if test -n "$GENERATE_SHLIB_SCRIPT"; the - . ${CUSTOMIZER_SCRIPT} - . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc - ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xse -+ -+ if test -n "$GENERATE_RELRO_SCRIPT"; then -+ RELRO=" " -+ LD_FLAG=shared -+ ( -+ echo "/* Script for ld --shared -z relro: link shared library */" -+ . ${CUSTOMIZER_SCRIPT} -+ . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc -+ ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xso -+ LD_FLAG=sharedtextonly -+ ( -+ echo "/* Script for ld --shared -z relro -z separate-code: link shared library with separate code segment */" -+ . ${CUSTOMIZER_SCRIPT} -+ . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc -+ ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xseo -+ unset RELRO -+ fi - if test -n "$GENERATE_COMBRELOC_SCRIPT"; then - DATA_ALIGNMENT=${DATA_ALIGNMENT_sc-${DATA_ALIGNMENT}} - LD_FLAG=cshared -@@ -401,8 +451,27 @@ if test -n "$GENERATE_SHLIB_SCRIPT"; the - . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc - ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xswe - rm -f ${COMBRELOC} -- COMBRELOC= - unset RELRO_NOW -+ -+ if test -n "$GENERATE_RELRO_SCRIPT"; then -+ LD_FLAG=wshared -+ RELRO=" " -+ COMBRELOC=ldscripts/${EMULATION_NAME}.xsco.tmp -+ ( echo "/* Script for --shared -z combreloc -z relro: shared library, combine & sort relocs with separate code segment */" -+ . ${CUSTOMIZER_SCRIPT} -+ . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc -+ ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xsco -+ rm -f ${COMBRELOC} -+ LD_FLAG=wsharedtextonly -+ COMBRELOC=ldscripts/${EMULATION_NAME}.xsceo.tmp -+ ( echo "/* Script for --shared -z combreloc -z relro -z separate-code: shared library, combine & sort relocs with separate code segment */" -+ . ${CUSTOMIZER_SCRIPT} -+ . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc -+ ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xsceo -+ rm -f ${COMBRELOC} -+ unset RELRO -+ fi -+ COMBRELOC= - fi - unset CREATE_SHLIB - fi -@@ -422,6 +491,22 @@ if test -n "$GENERATE_PIE_SCRIPT"; then - . ${CUSTOMIZER_SCRIPT} - . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc - ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xde -+ if test -n "$GENERATE_RELRO_SCRIPT"; then -+ RELRO=" " -+ LD_FLAG=pie -+ ( -+ echo "/* Script for ld -pie -z relro: link position independent executable */" -+ . ${CUSTOMIZER_SCRIPT} -+ . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc -+ ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xdo -+ LD_FLAG=pietextonly -+ ( -+ echo "/* Script for ld -pie -z relro -z separate-code: link position independent executable with separate code segment */" -+ . ${CUSTOMIZER_SCRIPT} -+ . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc -+ ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xdeo -+ unset RELRO -+ fi - if test -n "$GENERATE_COMBRELOC_SCRIPT"; then - DATA_ALIGNMENT=${DATA_ALIGNMENT_sc-${DATA_ALIGNMENT}} - COMBRELOC=ldscripts/${EMULATION_NAME}.xdc.tmp -@@ -453,8 +538,28 @@ if test -n "$GENERATE_PIE_SCRIPT"; then - . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc - ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xdwe - rm -f ${COMBRELOC} -- COMBRELOC= - unset RELRO_NOW -+ -+ if test -n "$GENERATE_RELRO_SCRIPT"; then -+ LD_FLAG=wpie -+ RELRO=" " -+ COMBRELOC=ldscripts/${EMULATION_NAME}.xdco.tmp -+ ( echo "/* Script for -pie -z combreloc -z relro: position independent executable, combine & sort relocs with separate code segment */" -+ . ${CUSTOMIZER_SCRIPT} -+ . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc -+ ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xdco -+ rm -f ${COMBRELOC} -+ LD_FLAG=wpietextonly -+ COMBRELOC=ldscripts/${EMULATION_NAME}.xdceo.tmp -+ ( echo "/* Script for -pie -z combreloc -z relro -z separate-code: position independent executable, combine & sort relocs with separate code segment */" -+ . ${CUSTOMIZER_SCRIPT} -+ . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc -+ ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xdceo -+ rm -f ${COMBRELOC} -+ -+ unset RELRO -+ fi -+ COMBRELOC= - fi - unset CREATE_PIE - fi -Only in binutils.orig/ld/testsuite/ld-s390: gotreloc_64-1.dd -Only in binutils-2.31.1/ld/testsuite/ld-s390: gotreloc_64-norelro-1.dd -Only in binutils-2.31.1/ld/testsuite/ld-s390: gotreloc_64-relro-1.dd -diff -rup binutils.orig/ld/testsuite/ld-s390/s390.exp binutils-2.31.1/ld/testsuite/ld-s390/s390.exp ---- binutils.orig/ld/testsuite/ld-s390/s390.exp 2018-07-19 12:37:28.498025644 +0100 -+++ binutils-2.31.1/ld/testsuite/ld-s390/s390.exp 2018-07-19 12:38:11.236548705 +0100 -@@ -70,10 +70,15 @@ set s390xtests { - {{readelf -WSsrl tlsbin_64.rd} {objdump -dzrj.text tlsbin_64.dd} - {objdump -sj.got tlsbin_64.sd} {objdump -sj.tdata tlsbin_64.td}} - "tlsbin_64"} -- {"GOT: symbol address load from got to larl" -- "-shared -melf64_s390 --hash-style=sysv --version-script=gotreloc-1.ver" "" -+ {"GOT: norelro symbol address load from got to larl" -+ "-shared -melf64_s390 -z norelro --hash-style=sysv --version-script=gotreloc-1.ver" "" - "-m64" {gotreloc-1.s} -- {{objdump -dzrj.text gotreloc_64-1.dd}} -+ {{objdump -dzrj.text gotreloc_64-norelro-1.dd}} -+ "gotreloc_64-1"} -+ {"GOT: relro symbol address load from got to larl" -+ "-shared -melf64_s390 -z relro --hash-style=sysv --version-script=gotreloc-1.ver" "" -+ "-m64" {gotreloc-1.s} -+ {{objdump -dzrj.text gotreloc_64-relro-1.dd}} - "gotreloc_64-1"} - {"PLT: offset test" - "-shared -m elf64_s390 -dT pltoffset-1.ld" "" diff --git a/binutils.spec b/binutils.spec index 6863630ef384afa7bd8fa2349af4cdad5b4cc4f5..7e87e71bc12ec6c635f3de018ff68f4bf7219c98 100644 --- a/binutils.spec +++ b/binutils.spec @@ -1,73 +1,33 @@ Summary: Binary utilities -Name: binutils -Version: 2.31.1 -Release: 16 +Name: binutils +Version: 2.33.1 +Release: 1 License: GPLv3+ -URL: https://sourceware.org/binutils +URL: https://sourceware.org/binutils -Source: https://ftp.gnu.org/gnu/binutils/binutils-%{version}.tar.xz -Source2: binutils-2.19.50.0.1-output-format.sed +Source: https://ftp.gnu.org/gnu/binutils/binutils-%{version}.tar.xz -#RHEL-UPSTREAM Patch01: binutils-2.20.51.0.2-libtool-lib64.patch -Patch02: binutils-2.25-version.patch -Patch03: binutils-2.31-export-demangle.h.patch +Patch02: export-demangle.h-in-devel-package.patch #BUZ:845084 -Patch04: binutils-2.22.52.0.4-no-config-h-check.patch -Patch05: binutils-2.29-filename-in-error-messages.patch -#BUG:1452111 && 1333481 -Patch06: binutils-2.29-revert-PLT-elision.patch -Patch07: binutils-readelf-other-sym-info.patch -Patch08: binutils-2.27-aarch64-ifunc.patch -Patch09: binutils-fix-testsuite-failures.patch -Patch10: binutils-clear-version-info.patch -Patch11: binutils-gold-ignore-discarded-note-relocs.patch -Patch12: binutils-s390-partial-relro.patch -Patch13: binutils-merge-attribute-sections.patch -Patch14: binutils-note-merge-improvements.patch -Patch15: binutils-detect-corrupt-sym-version-info.patch -Patch16: binutils-delay-ld-script-constant-eval.patch +Patch03: binutils-2.22.52.0.4-no-config-h-check.patch +#BUG:1452111 +Patch04: binutils-2.29-revert-PLT-elision.patch +Patch05: binutils-2.27-aarch64-ifunc.patch #PATCH-CVE-UPSTREAM -Patch6000: CVE-2018-19931.patch -Patch6001: CVE-2018-19932.patch -Patch6002: CVE-2019-9077.patch -Patch6003: CVE-2018-17358.patch -Patch6004: CVE-2018-17360.patch -Patch6005: CVE-2018-20623.patch -Patch6006: CVE-2018-20651.patch -Patch6007: CVE-2019-9075.patch -Patch6008: CVE-2018-12697.patch Patch6009: CVE-2019-1010204.patch -Patch6010: 0001-CVE-2018-18309.patch -Patch6011: 0002-CVE-2018-18309.patch -Patch6012: 0003-CVE-2018-18309.patch -Patch6013: 0004-CVE-2018-18309.patch -Patch6014: CVE-2018-18605.patch -Patch6015: CVE-2018-18607.patch -Patch6016: CVE-2018-18606.patch -Patch6017: CVE-2018-1000876.patch -Patch6018: CVE-2018-20002.patch -Patch6019: CVE-2019-14444.patch -Patch6020: CVE-2019-1010180.patch -Patch6021: Fix-the-handling-of-inlined-frames-in-DWARF-debug-in.patch Patch6022: CVE-2019-17450.patch Patch6023: CVE-2019-17451.patch -Patch6024: CVE-2019-12972.patch -Patch6025: Fix-a-failure-in-the-libiberty-testsuite-by-increasi.patch -Patch6026: CVE-2018-20671.patch Patch6027: Fix-array-overrun-when-disassembling-corrupt-TIC30-binaries.patch -Patch6028: Fix-buffer-underrun-bug-in-the-TI-C30-disassembler.patch Patch6029: Fix-potential-array-overruns-when-disassembling-corrupt-v850.patch Patch6030: Prevent-a-left-shift-by-a-negative-value-when-disassembling.patch Patch6031: Stop-potential-illegal-memory-access-in-the-NS32K.patch Patch6032: Fix-buffer-overrun-in-TIC30-disassembler.patch Patch6033: ubsan-ia64-left-shift-of-negative-value.patch -Patch6034: Fix-incorrect-extraction-of-signe-dconstants-in-nios2.patch Patch6035: Remove-more-shifts-for-sign-zero-extension.patch Patch6036: left-shift-of-cannot-be-represented-in-type-int.patch -Patch6037: Prevent-objdump-from-aborting.patch Patch6038: ubsan-cr16-left-shift-cannot-be-represented-in-type-int.patch Provides: bundled(libiberty) @@ -169,7 +129,6 @@ export LDFLAGS=$RPM_LD_FLAGS --target=%{_target_platform} \ --enable-gold=default --enable-ld \ --with-sysroot=/ \ - --enable-shared \ --enable-deterministic-archives=no \ --enable-lto \ --enable-compressed-debug-sections=none \ @@ -211,10 +170,8 @@ do done install -m 644 include/libiberty.h %{buildroot}%{_prefix}/include -chmod +x %{buildroot}%{_libdir}/lib*.so* -# Do not use .so&&.la of libbfd and libopcodes which are not stable -rm -f %{buildroot}%{_libdir}/lib{bfd,opcodes}.{so,la} +rm -f %{buildroot}%{_libdir}/lib{bfd,opcodes}.la %ifarch %{ix86} x86_64 arm sed -i -e '/^#include "ansidecl.h"/{p;s~^.*$~#include ~;}' \ @@ -230,28 +187,6 @@ sed -i -e '/^#include "ansidecl.h"/{p;s~^.*$~#include ~;}' \ %endif touch -r bfd/bfd-in2.h %{buildroot}%{_prefix}/include/bfd.h -# Generate linker script which is referenced to glibc/Makerules: - -OUTPUT_FORMAT="\ -$(gcc $CFLAGS $LDFLAGS -shared -x c /dev/null -o /dev/null -Wl,--verbose -v 2>&1 | sed -n -f "%{SOURCE2}")" - -tee %{buildroot}%{_libdir}/libbfd.so < - 2.33.1-1 +- Type:cves +- ID:CVE +- SUG:NA +- DESC:update version to 2.33.1 + * Mon Dec 20 2019 openEuler Buildteam - 2.31.1-16 - Type:cves - ID:CVE diff --git a/binutils-2.31-export-demangle.h.patch b/export-demangle.h-in-devel-package.patch similarity index 39% rename from binutils-2.31-export-demangle.h.patch rename to export-demangle.h-in-devel-package.patch index e59f3937ddcc5dd3922516a4087dd8419f3884b6..3e6223a2f4e07d4ba61b7090115b413aa586a139 100644 --- a/binutils-2.31-export-demangle.h.patch +++ b/export-demangle.h-in-devel-package.patch @@ -1,33 +1,48 @@ -diff -rup binutils.orig/bfd/Makefile.am binutils-2.30.90/bfd/Makefile.am ---- binutils.orig/bfd/Makefile.am 2018-07-09 09:49:43.378323137 +0100 -+++ binutils-2.30.90/bfd/Makefile.am 2018-07-09 09:50:40.252723495 +0100 +From 85f7739c1c9cfcd143b4192204246f4fe5dafeed Mon Sep 17 00:00:00 2001 +From: openEuler Buildteam +Date: Sat, 11 Jan 2020 13:34:40 +0800 +Subject: [PATCH] export demangle.h in devel package + +--- + bfd/Makefile.am | 2 +- + bfd/Makefile.in | 4 ++-- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/bfd/Makefile.am b/bfd/Makefile.am +index 6a39ef5..ddc3b54 100644 +--- a/bfd/Makefile.am ++++ b/bfd/Makefile.am @@ -33,7 +33,7 @@ bfdlibdir = @bfdlibdir@ bfdincludedir = @bfdincludedir@ bfdlib_LTLIBRARIES = libbfd.la bfdinclude_HEADERS = $(BFD_H) $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \ -- $(INCDIR)/bfdlink.h $(INCDIR)/diagnostics.h -+ $(INCDIR)/bfdlink.h $(INCDIR)/diagnostics.h $(INCDIR)/demangle.h +- bfd_stdint.h $(INCDIR)/diagnostics.h $(INCDIR)/bfdlink.h ++ bfd_stdint.h $(INCDIR)/diagnostics.h $(INCDIR)/bfdlink.h $(INCDIR)/demangle.h else !INSTALL_LIBBFD # Empty these so that the respective installation directories will not be created. bfdlibdir = -diff -rup binutils.orig/bfd/Makefile.in binutils-2.30.90/bfd/Makefile.in ---- binutils.orig/bfd/Makefile.in 2018-07-09 09:49:42.757329685 +0100 -+++ binutils-2.30.90/bfd/Makefile.in 2018-07-09 09:51:16.145345812 +0100 -@@ -248,7 +248,7 @@ am__can_run_installinfo = \ +diff --git a/bfd/Makefile.in b/bfd/Makefile.in +index 80499d6..09a93b9 100644 +--- a/bfd/Makefile.in ++++ b/bfd/Makefile.in +@@ -249,7 +249,7 @@ am__can_run_installinfo = \ esac am__bfdinclude_HEADERS_DIST = $(INCDIR)/plugin-api.h bfd.h \ - $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/bfdlink.h \ -- $(INCDIR)/diagnostics.h -+ $(INCDIR)/diagnostics.h $(INCDIR)/demangle.h + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bfd_stdint.h \ +- $(INCDIR)/diagnostics.h $(INCDIR)/bfdlink.h ++ $(INCDIR)/diagnostics.h $(INCDIR)/bfdlink.h $(INCDIR)/demangle.h HEADERS = $(bfdinclude_HEADERS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive -@@ -467,7 +467,7 @@ libbfd_la_LDFLAGS = $(am__append_1) -rel +@@ -468,7 +468,7 @@ libbfd_la_LDFLAGS = $(am__append_1) -release `cat libtool-soversion` \ @INSTALL_LIBBFD_FALSE@bfdinclude_HEADERS = $(am__append_2) @INSTALL_LIBBFD_TRUE@bfdinclude_HEADERS = $(BFD_H) \ @INSTALL_LIBBFD_TRUE@ $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \ --@INSTALL_LIBBFD_TRUE@ $(INCDIR)/bfdlink.h \ -+@INSTALL_LIBBFD_TRUE@ $(INCDIR)/bfdlink.h $(INCDIR)/demangle.h \ - @INSTALL_LIBBFD_TRUE@ $(INCDIR)/diagnostics.h $(am__append_2) +-@INSTALL_LIBBFD_TRUE@ bfd_stdint.h $(INCDIR)/diagnostics.h \ ++@INSTALL_LIBBFD_TRUE@ bfd_stdint.h $(INCDIR)/diagnostics.h $(INCDIR)/demangle.h \ + @INSTALL_LIBBFD_TRUE@ $(INCDIR)/bfdlink.h $(am__append_2) @INSTALL_LIBBFD_FALSE@rpath_bfdlibdir = @bfdlibdir@ @INSTALL_LIBBFD_FALSE@noinst_LTLIBRARIES = libbfd.la +-- +1.8.3.1 + diff --git a/left-shift-of-cannot-be-represented-in-type-int.patch b/left-shift-of-cannot-be-represented-in-type-int.patch index 1f418fe12f54560d1944a94e7a0e744552fa1b15..b26946d8758c9b7f6858cd84a92cd674159f8805 100644 --- a/left-shift-of-cannot-be-represented-in-type-int.patch +++ b/left-shift-of-cannot-be-represented-in-type-int.patch @@ -6,17 +6,17 @@ Subject: [PATCH] ubsan: left shift of cannot be represented in type 'int' * dis-asm.h (INSN_HAS_RELOC, DISASSEMBLE_DATA), (USER_SPECIFIED_MACHINE_TYPE, WIDE_OUTPUT): Make unsigned. * opcode/tic80.h (TIC80_OPERAND_*): Likewise. + --- - include/ChangeLog | 6 ++++++ include/dis-asm.h | 8 ++++---- include/opcode/tic80.h | 36 ++++++++++++++++++------------------ - 3 files changed, 28 insertions(+), 22 deletions(-) + 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/include/dis-asm.h b/include/dis-asm.h -index 82bf4dc..b2a09f8 100644 +index b4d5025..0e85c52 100644 --- a/include/dis-asm.h +++ b/include/dis-asm.h -@@ -105,12 +105,12 @@ typedef struct disassemble_info +@@ -110,14 +110,14 @@ typedef struct disassemble_info unsigned long flags; /* Set if the disassembler has determined that there are one or more relocations associated with the instruction being disassembled. */ @@ -29,11 +29,14 @@ index 82bf4dc..b2a09f8 100644 mach field of this structure. */ -#define USER_SPECIFIED_MACHINE_TYPE (1 << 29) +#define USER_SPECIFIED_MACHINE_TYPE (1u << 29) + /* Set if the user has requested wide output. */ +-#define WIDE_OUTPUT (1 << 28) ++#define WIDE_OUTPUT (1u << 28) /* Use internally by the target specific disassembly code. */ void *private_data; diff --git a/include/opcode/tic80.h b/include/opcode/tic80.h -index 6a68859..ac1249f 100644 +index 6a68859..240e9aa 100644 --- a/include/opcode/tic80.h +++ b/include/opcode/tic80.h @@ -138,68 +138,68 @@ extern const struct tic80_operand tic80_operands[]; @@ -162,5 +165,5 @@ index 6a68859..ac1249f 100644 /* This mask is used to strip operand bits from an int that contains both operand bits and a numeric value in the lsbs. */ -- -2.9.3 +1.8.3.1