diff --git a/arm32-avoid-copyreloc.patch b/arm32-avoid-copyreloc.patch new file mode 100644 index 0000000..f5e18f4 --- /dev/null +++ b/arm32-avoid-copyreloc.patch @@ -0,0 +1,61 @@ +When a writable input section (i.e. data) refers to a symbol defined in an +ET_DYN object, BFD ld for ARM targets generates a COPY dynamic reloc. For +other targets like x86, this situation generates a plain data dynamic +reloc. Gold for ARM also generates the plain data dynamic reloc. + +https://bugzilla.suse.com/show_bug.cgi?id=1200962 +https://sourceware.org/bugzilla/show_bug.cgi?id=16177 + +--- + bfd/elf32-arm.c | 25 +++++++++++++++++++------ + 1 file changed, 19 insertions(+), 6 deletions(-) +Index: binutils-2.39/bfd/elf32-arm.c +=================================================================== +--- binutils-2.39.orig/bfd/elf32-arm.c ++++ binutils-2.39/bfd/elf32-arm.c +@@ -16196,6 +16196,21 @@ elf32_arm_adjust_dynamic_symbol (struct + if (bfd_link_pic (info) || globals->root.is_relocatable_executable) + return true; + ++ /* If -z nocopyreloc was given, we won't generate them either. */ ++ if (info->nocopyreloc) ++ { ++ h->non_got_ref = 0; ++ return true; ++ } ++ ++ /* If we don't find any dynamic relocs in read-only sections, then ++ we'll be keeping the dynamic relocs and avoiding the copy reloc. */ ++ if (!_bfd_elf_readonly_dynrelocs (h)) ++ { ++ h->non_got_ref = 0; ++ return true; ++ } ++ + /* We must allocate the symbol in our .dynbss section, which will + become part of the .bss section of the executable. There will be + an entry for this symbol in the .dynsym section. The dynamic +@@ -16205,9 +16220,9 @@ elf32_arm_adjust_dynamic_symbol (struct + determine the address it must put in the global offset table, so + both the dynamic object and the regular object will refer to the + same memory location for the variable. */ +- /* If allowed, we must generate a R_ARM_COPY reloc to tell the dynamic +- linker to copy the initial value out of the dynamic object and into +- the runtime process image. We need to remember the offset into the ++ /* We must generate a R_ARM_COPY reloc to tell the dynamic linker to ++ copy the initial value out of the dynamic object and into the ++ runtime process image. We need to remember the offset into the + .rel(a).bss section we are going to use. */ + if ((h->root.u.def.section->flags & SEC_READONLY) != 0) + { +@@ -16219,9 +16234,7 @@ elf32_arm_adjust_dynamic_symbol (struct + s = globals->root.sdynbss; + srel = globals->root.srelbss; + } +- if (info->nocopyreloc == 0 +- && (h->root.u.def.section->flags & SEC_ALLOC) != 0 +- && h->size != 0) ++ if ((h->root.u.def.section->flags & SEC_ALLOC) != 0 && h->size != 0) + { + elf32_arm_allocate_dynrelocs (info, srel, 1); + h->needs_copy = 1; diff --git a/binutils-maxpagesize.diff b/binutils-maxpagesize.diff new file mode 100644 index 0000000..9529719 --- /dev/null +++ b/binutils-maxpagesize.diff @@ -0,0 +1,54 @@ +commit a2267dbfc9e1dd955f78561c40f00afa9ddbe619 +Author: Michael Matz +Date: Thu Oct 20 16:06:57 2022 +0200 + + x86-64: Use only one default max-page-size + + On x86-64 the default ELF_MAXPAGESIZE depends on a configure + option (--disable-separate-code). Since 9833b775 + ("PR28824, relro security issues") we use max-page-size for relro + alignment (with a short interval, from 31b4d3a ("PR28824, relro + security issues, x86 keep COMMONPAGESIZE relro") to its revert + a1faa5ea, where x86-64 only used COMMONPAGESIZE as relro alignment + target). + + But that means that a linker configured with --disable-separate-code + behaves different from one configured with --enable-separate-code + (the default), _even if using "-z {no,}separate-code" option to use + the non-configured behaviour_ . In particular it means that when + configuring with --disable-separate-code the linker will produce + binaries aligned to 2MB pages on disk, and hence generate 2MB + executables for a hello world (and even 6MB when linked with + "-z separate-code"). + + Generally we can't have constants that ultimately land in static + variables be depending on configure options if those only influence + behaviour that is overridable by command line options. + + So, do away with that, make the default MAXPAGESIZE be 4k (as is default + for most x86-64 configs anyway, as most people won't configure with + --disable-separate-code). If people need more they can use the + "-z max-page-size" (with would have been required right now for a + default configure binutils). + + bfd/ + * elf64-x86-64.c (ELF_MAXPAGESIZE): Don't depend on + DEFAULT_LD_Z_SEPARATE_CODE. + +diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c +index f3b54400013..2ae8dffba0f 100644 +--- a/bfd/elf64-x86-64.c ++++ b/bfd/elf64-x86-64.c +@@ -5259,11 +5259,7 @@ elf_x86_64_special_sections[]= + #define ELF_ARCH bfd_arch_i386 + #define ELF_TARGET_ID X86_64_ELF_DATA + #define ELF_MACHINE_CODE EM_X86_64 +-#if DEFAULT_LD_Z_SEPARATE_CODE +-# define ELF_MAXPAGESIZE 0x1000 +-#else +-# define ELF_MAXPAGESIZE 0x200000 +-#endif ++#define ELF_MAXPAGESIZE 0x1000 + #define ELF_COMMONPAGESIZE 0x1000 + + #define elf_backend_can_gc_sections 1 diff --git a/binutils-pr29482.diff b/binutils-pr29482.diff new file mode 100644 index 0000000..49cafb6 --- /dev/null +++ b/binutils-pr29482.diff @@ -0,0 +1,33 @@ +PR29482 aka CVE-2022-38533 + +From ef186fe54aa6d281a3ff8a9528417e5cc614c797 Mon Sep 17 00:00:00 2001 +From: Alan Modra +Date: Sat, 13 Aug 2022 15:32:47 +0930 +Subject: [PATCH 1/1] PR29482 - strip: heap-buffer-overflow + + PR 29482 + * coffcode.h (coff_set_section_contents): Sanity check _LIB. +--- + bfd/coffcode.h | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +Index: binutils-2.39/bfd/coffcode.h +=================================================================== +--- binutils-2.39.orig/bfd/coffcode.h 2022-07-08 11:46:47.000000000 +0200 ++++ binutils-2.39/bfd/coffcode.h 2022-08-26 15:23:58.749610670 +0200 +@@ -4284,10 +4284,13 @@ coff_set_section_contents (bfd * abfd, + + rec = (bfd_byte *) location; + recend = rec + count; +- while (rec < recend) ++ while (recend - rec >= 4) + { ++ size_t len = bfd_get_32 (abfd, rec); ++ if (len == 0 || len > (size_t) (recend - rec) / 4) ++ break; ++ rec += len * 4; + ++section->lma; +- rec += bfd_get_32 (abfd, rec) * 4; + } + + BFD_ASSERT (rec == recend); diff --git a/binutils-revert-rela.diff b/binutils-revert-rela.diff new file mode 100644 index 0000000..eb8d1fe --- /dev/null +++ b/binutils-revert-rela.diff @@ -0,0 +1,272 @@ +This is for bsc#1198422 + +This essentially reverts commit 17c6c3b99156fe82c1e637e1a5fd9f163ac788c8 +to return back to old behaviour regarding RELA relocs: old binutils +used the relocated field as additional addend, relying on it being +zero for normal RELA behaviour. This isn't correct according to the +psABI, but some old tools (e.g. older ICC) emit object files where +the in-field "addend" is to be used (and record the zero in the A field +of the RELA reloc). This change was included starting with binutils 2.37, +but for older codestreams we want to be compatible with the old (buggy) +behaviour. We revert the change for all relocs and not just those for +which it arguably made some sense or where we had a report about (PLT32). + + +Index: binutils-2.39/bfd/elf64-x86-64.c +=================================================================== +--- binutils-2.39.orig/bfd/elf64-x86-64.c 2022-10-17 16:20:55.074224642 +0200 ++++ binutils-2.39/bfd/elf64-x86-64.c 2022-10-17 16:31:36.128864508 +0200 +@@ -47,127 +47,127 @@ static reloc_howto_type x86_64_elf_howto + bfd_elf_generic_reloc, "R_X86_64_NONE", false, 0, 0x00000000, + false), + HOWTO(R_X86_64_64, 0, 8, 64, false, 0, complain_overflow_dont, +- bfd_elf_generic_reloc, "R_X86_64_64", false, 0, MINUS_ONE, ++ bfd_elf_generic_reloc, "R_X86_64_64", false, MINUS_ONE, MINUS_ONE, + false), + HOWTO(R_X86_64_PC32, 0, 4, 32, true, 0, complain_overflow_signed, +- bfd_elf_generic_reloc, "R_X86_64_PC32", false, 0, 0xffffffff, ++ bfd_elf_generic_reloc, "R_X86_64_PC32", false, 0xffffffff, 0xffffffff, + true), + HOWTO(R_X86_64_GOT32, 0, 4, 32, false, 0, complain_overflow_signed, +- bfd_elf_generic_reloc, "R_X86_64_GOT32", false, 0, 0xffffffff, ++ bfd_elf_generic_reloc, "R_X86_64_GOT32", false, 0xffffffff, 0xffffffff, + false), + HOWTO(R_X86_64_PLT32, 0, 4, 32, true, 0, complain_overflow_signed, +- bfd_elf_generic_reloc, "R_X86_64_PLT32", false, 0, 0xffffffff, ++ bfd_elf_generic_reloc, "R_X86_64_PLT32", false, 0xffffffff, 0xffffffff, + true), + HOWTO(R_X86_64_COPY, 0, 4, 32, false, 0, complain_overflow_bitfield, +- bfd_elf_generic_reloc, "R_X86_64_COPY", false, 0, 0xffffffff, ++ bfd_elf_generic_reloc, "R_X86_64_COPY", false, 0xffffffff, 0xffffffff, + false), + HOWTO(R_X86_64_GLOB_DAT, 0, 8, 64, false, 0, complain_overflow_dont, +- bfd_elf_generic_reloc, "R_X86_64_GLOB_DAT", false, 0, MINUS_ONE, ++ bfd_elf_generic_reloc, "R_X86_64_GLOB_DAT", false, MINUS_ONE, MINUS_ONE, + false), + HOWTO(R_X86_64_JUMP_SLOT, 0, 8, 64, false, 0, complain_overflow_dont, +- bfd_elf_generic_reloc, "R_X86_64_JUMP_SLOT", false, 0, MINUS_ONE, ++ bfd_elf_generic_reloc, "R_X86_64_JUMP_SLOT", false, MINUS_ONE, MINUS_ONE, + false), + HOWTO(R_X86_64_RELATIVE, 0, 8, 64, false, 0, complain_overflow_dont, +- bfd_elf_generic_reloc, "R_X86_64_RELATIVE", false, 0, MINUS_ONE, ++ bfd_elf_generic_reloc, "R_X86_64_RELATIVE", false, MINUS_ONE, MINUS_ONE, + false), + HOWTO(R_X86_64_GOTPCREL, 0, 4, 32, true, 0, complain_overflow_signed, +- bfd_elf_generic_reloc, "R_X86_64_GOTPCREL", false, 0, 0xffffffff, ++ bfd_elf_generic_reloc, "R_X86_64_GOTPCREL", false, 0xffffffff, 0xffffffff, + true), + HOWTO(R_X86_64_32, 0, 4, 32, false, 0, complain_overflow_unsigned, +- bfd_elf_generic_reloc, "R_X86_64_32", false, 0, 0xffffffff, ++ bfd_elf_generic_reloc, "R_X86_64_32", false, 0xffffffff, 0xffffffff, + false), + HOWTO(R_X86_64_32S, 0, 4, 32, false, 0, complain_overflow_signed, +- bfd_elf_generic_reloc, "R_X86_64_32S", false, 0, 0xffffffff, ++ bfd_elf_generic_reloc, "R_X86_64_32S", false, 0xffffffff, 0xffffffff, + false), + HOWTO(R_X86_64_16, 0, 2, 16, false, 0, complain_overflow_bitfield, +- bfd_elf_generic_reloc, "R_X86_64_16", false, 0, 0xffff, false), ++ bfd_elf_generic_reloc, "R_X86_64_16", false, 0xffff, 0xffff, false), + HOWTO(R_X86_64_PC16, 0, 2, 16, true, 0, complain_overflow_bitfield, +- bfd_elf_generic_reloc, "R_X86_64_PC16", false, 0, 0xffff, true), ++ bfd_elf_generic_reloc, "R_X86_64_PC16", false, 0xffff, 0xffff, true), + HOWTO(R_X86_64_8, 0, 1, 8, false, 0, complain_overflow_bitfield, +- bfd_elf_generic_reloc, "R_X86_64_8", false, 0, 0xff, false), ++ bfd_elf_generic_reloc, "R_X86_64_8", false, 0xff, 0xff, false), + HOWTO(R_X86_64_PC8, 0, 1, 8, true, 0, complain_overflow_signed, +- bfd_elf_generic_reloc, "R_X86_64_PC8", false, 0, 0xff, true), ++ bfd_elf_generic_reloc, "R_X86_64_PC8", false, 0xff, 0xff, true), + HOWTO(R_X86_64_DTPMOD64, 0, 8, 64, false, 0, complain_overflow_dont, +- bfd_elf_generic_reloc, "R_X86_64_DTPMOD64", false, 0, MINUS_ONE, ++ bfd_elf_generic_reloc, "R_X86_64_DTPMOD64", false, MINUS_ONE, MINUS_ONE, + false), + HOWTO(R_X86_64_DTPOFF64, 0, 8, 64, false, 0, complain_overflow_dont, +- bfd_elf_generic_reloc, "R_X86_64_DTPOFF64", false, 0, MINUS_ONE, ++ bfd_elf_generic_reloc, "R_X86_64_DTPOFF64", false, MINUS_ONE, MINUS_ONE, + false), + HOWTO(R_X86_64_TPOFF64, 0, 8, 64, false, 0, complain_overflow_dont, +- bfd_elf_generic_reloc, "R_X86_64_TPOFF64", false, 0, MINUS_ONE, ++ bfd_elf_generic_reloc, "R_X86_64_TPOFF64", false, MINUS_ONE, MINUS_ONE, + false), + HOWTO(R_X86_64_TLSGD, 0, 4, 32, true, 0, complain_overflow_signed, +- bfd_elf_generic_reloc, "R_X86_64_TLSGD", false, 0, 0xffffffff, ++ bfd_elf_generic_reloc, "R_X86_64_TLSGD", false, 0xffffffff, 0xffffffff, + true), + HOWTO(R_X86_64_TLSLD, 0, 4, 32, true, 0, complain_overflow_signed, +- bfd_elf_generic_reloc, "R_X86_64_TLSLD", false, 0, 0xffffffff, ++ bfd_elf_generic_reloc, "R_X86_64_TLSLD", false, 0xffffffff, 0xffffffff, + true), + HOWTO(R_X86_64_DTPOFF32, 0, 4, 32, false, 0, complain_overflow_signed, +- bfd_elf_generic_reloc, "R_X86_64_DTPOFF32", false, 0, 0xffffffff, ++ bfd_elf_generic_reloc, "R_X86_64_DTPOFF32", false, 0xffffffff, 0xffffffff, + false), + HOWTO(R_X86_64_GOTTPOFF, 0, 4, 32, true, 0, complain_overflow_signed, +- bfd_elf_generic_reloc, "R_X86_64_GOTTPOFF", false, 0, 0xffffffff, ++ bfd_elf_generic_reloc, "R_X86_64_GOTTPOFF", false, 0xffffffff, 0xffffffff, + true), + HOWTO(R_X86_64_TPOFF32, 0, 4, 32, false, 0, complain_overflow_signed, +- bfd_elf_generic_reloc, "R_X86_64_TPOFF32", false, 0, 0xffffffff, ++ bfd_elf_generic_reloc, "R_X86_64_TPOFF32", false, 0xffffffff, 0xffffffff, + false), + HOWTO(R_X86_64_PC64, 0, 8, 64, true, 0, complain_overflow_dont, +- bfd_elf_generic_reloc, "R_X86_64_PC64", false, 0, MINUS_ONE, ++ bfd_elf_generic_reloc, "R_X86_64_PC64", false, MINUS_ONE, MINUS_ONE, + true), + HOWTO(R_X86_64_GOTOFF64, 0, 8, 64, false, 0, complain_overflow_dont, +- bfd_elf_generic_reloc, "R_X86_64_GOTOFF64", false, 0, MINUS_ONE, ++ bfd_elf_generic_reloc, "R_X86_64_GOTOFF64", false, MINUS_ONE, MINUS_ONE, + false), + HOWTO(R_X86_64_GOTPC32, 0, 4, 32, true, 0, complain_overflow_signed, +- bfd_elf_generic_reloc, "R_X86_64_GOTPC32", false, 0, 0xffffffff, ++ bfd_elf_generic_reloc, "R_X86_64_GOTPC32", false, 0xffffffff, 0xffffffff, + true), + HOWTO(R_X86_64_GOT64, 0, 8, 64, false, 0, complain_overflow_signed, +- bfd_elf_generic_reloc, "R_X86_64_GOT64", false, 0, MINUS_ONE, ++ bfd_elf_generic_reloc, "R_X86_64_GOT64", false, MINUS_ONE, MINUS_ONE, + false), + HOWTO(R_X86_64_GOTPCREL64, 0, 8, 64, true, 0, complain_overflow_signed, +- bfd_elf_generic_reloc, "R_X86_64_GOTPCREL64", false, 0, MINUS_ONE, ++ bfd_elf_generic_reloc, "R_X86_64_GOTPCREL64", false, MINUS_ONE, MINUS_ONE, + true), + HOWTO(R_X86_64_GOTPC64, 0, 8, 64, true, 0, complain_overflow_signed, +- bfd_elf_generic_reloc, "R_X86_64_GOTPC64", false, 0, MINUS_ONE, ++ bfd_elf_generic_reloc, "R_X86_64_GOTPC64", false, MINUS_ONE, MINUS_ONE, + true), + HOWTO(R_X86_64_GOTPLT64, 0, 8, 64, false, 0, complain_overflow_signed, +- bfd_elf_generic_reloc, "R_X86_64_GOTPLT64", false, 0, MINUS_ONE, ++ bfd_elf_generic_reloc, "R_X86_64_GOTPLT64", false, MINUS_ONE, MINUS_ONE, + false), + HOWTO(R_X86_64_PLTOFF64, 0, 8, 64, false, 0, complain_overflow_signed, +- bfd_elf_generic_reloc, "R_X86_64_PLTOFF64", false, 0, MINUS_ONE, ++ bfd_elf_generic_reloc, "R_X86_64_PLTOFF64", false, MINUS_ONE, MINUS_ONE, + false), + HOWTO(R_X86_64_SIZE32, 0, 4, 32, false, 0, complain_overflow_unsigned, +- bfd_elf_generic_reloc, "R_X86_64_SIZE32", false, 0, 0xffffffff, ++ bfd_elf_generic_reloc, "R_X86_64_SIZE32", false, 0xffffffff, 0xffffffff, + false), + HOWTO(R_X86_64_SIZE64, 0, 8, 64, false, 0, complain_overflow_dont, +- bfd_elf_generic_reloc, "R_X86_64_SIZE64", false, 0, MINUS_ONE, ++ bfd_elf_generic_reloc, "R_X86_64_SIZE64", false, MINUS_ONE, MINUS_ONE, + false), + HOWTO(R_X86_64_GOTPC32_TLSDESC, 0, 4, 32, true, 0, + complain_overflow_bitfield, bfd_elf_generic_reloc, +- "R_X86_64_GOTPC32_TLSDESC", false, 0, 0xffffffff, true), ++ "R_X86_64_GOTPC32_TLSDESC", false, 0xffffffff, 0xffffffff, true), + HOWTO(R_X86_64_TLSDESC_CALL, 0, 0, 0, false, 0, + complain_overflow_dont, bfd_elf_generic_reloc, + "R_X86_64_TLSDESC_CALL", + false, 0, 0, false), + HOWTO(R_X86_64_TLSDESC, 0, 8, 64, false, 0, + complain_overflow_dont, bfd_elf_generic_reloc, +- "R_X86_64_TLSDESC", false, 0, MINUS_ONE, false), ++ "R_X86_64_TLSDESC", false, MINUS_ONE, MINUS_ONE, false), + HOWTO(R_X86_64_IRELATIVE, 0, 8, 64, false, 0, complain_overflow_dont, +- bfd_elf_generic_reloc, "R_X86_64_IRELATIVE", false, 0, MINUS_ONE, ++ bfd_elf_generic_reloc, "R_X86_64_IRELATIVE", false, MINUS_ONE, MINUS_ONE, + false), + HOWTO(R_X86_64_RELATIVE64, 0, 8, 64, false, 0, complain_overflow_dont, +- bfd_elf_generic_reloc, "R_X86_64_RELATIVE64", false, 0, MINUS_ONE, ++ bfd_elf_generic_reloc, "R_X86_64_RELATIVE64", false, MINUS_ONE, MINUS_ONE, + false), + HOWTO(R_X86_64_PC32_BND, 0, 4, 32, true, 0, complain_overflow_signed, +- bfd_elf_generic_reloc, "R_X86_64_PC32_BND", false, 0, 0xffffffff, ++ bfd_elf_generic_reloc, "R_X86_64_PC32_BND", false, 0xffffffff, 0xffffffff, + true), + HOWTO(R_X86_64_PLT32_BND, 0, 4, 32, true, 0, complain_overflow_signed, +- bfd_elf_generic_reloc, "R_X86_64_PLT32_BND", false, 0, 0xffffffff, ++ bfd_elf_generic_reloc, "R_X86_64_PLT32_BND", false, 0xffffffff, 0xffffffff, + true), + HOWTO(R_X86_64_GOTPCRELX, 0, 4, 32, true, 0, complain_overflow_signed, +- bfd_elf_generic_reloc, "R_X86_64_GOTPCRELX", false, 0, 0xffffffff, ++ bfd_elf_generic_reloc, "R_X86_64_GOTPCRELX", false, 0xffffffff, 0xffffffff, + true), + HOWTO(R_X86_64_REX_GOTPCRELX, 0, 4, 32, true, 0, complain_overflow_signed, +- bfd_elf_generic_reloc, "R_X86_64_REX_GOTPCRELX", false, 0, 0xffffffff, ++ bfd_elf_generic_reloc, "R_X86_64_REX_GOTPCRELX", false, 0xffffffff, 0xffffffff, + true), + + /* We have a gap in the reloc numbers here. +@@ -188,7 +188,7 @@ static reloc_howto_type x86_64_elf_howto + + /* Use complain_overflow_bitfield on R_X86_64_32 for x32. */ + HOWTO(R_X86_64_32, 0, 4, 32, false, 0, complain_overflow_bitfield, +- bfd_elf_generic_reloc, "R_X86_64_32", false, 0, 0xffffffff, ++ bfd_elf_generic_reloc, "R_X86_64_32", false, 0xffffffff, 0xffffffff, + false) + }; + +Index: binutils-2.39/gas/testsuite/gas/i386/i386.exp +=================================================================== +--- binutils-2.39.orig/gas/testsuite/gas/i386/i386.exp 2022-07-08 11:46:47.000000000 +0200 ++++ binutils-2.39/gas/testsuite/gas/i386/i386.exp 2022-10-17 16:27:41.276966573 +0200 +@@ -1287,7 +1287,6 @@ if [gas_64_check] then { + run_list_test "reloc64" "--defsym _bad_=1" + run_list_test "x86-64-inval-tls" + run_dump_test "mixed-mode-reloc64" +- run_dump_test "rela" + run_dump_test "x86-64-ifunc" + run_dump_test "x86-64-opcode-inval" + run_dump_test "x86-64-opcode-inval-intel" +Index: binutils-2.39/gas/testsuite/gas/i386/rela.d +=================================================================== +--- binutils-2.39.orig/gas/testsuite/gas/i386/rela.d 2022-07-08 11:46:47.000000000 +0200 ++++ /dev/null 1970-01-01 00:00:00.000000000 +0000 +@@ -1,13 +0,0 @@ +-#name: x86-64 rela relocs w/ non-zero relocated fields +-#objdump: -rsj .data +- +-.*: +file format .* +- +-RELOCATION RECORDS FOR \[\.data\]: +- +-OFFSET +TYPE +VALUE +-0*0 R_X86_64_64 *q +-0*8 R_X86_64_32 *l +- +-Contents of section .data: +- 0+0 11 ?11 ?11 ?11 22 ?22 ?22 ?22 33 ?33 ?33 ?33 44 ?44 ?44 ?44 .* +Index: binutils-2.39/gas/testsuite/gas/i386/rela.s +=================================================================== +--- binutils-2.39.orig/gas/testsuite/gas/i386/rela.s 2022-07-08 11:46:47.000000000 +0200 ++++ /dev/null 1970-01-01 00:00:00.000000000 +0000 +@@ -1,14 +0,0 @@ +-# Note: This file is also used by an ld test case. +- +- .text +- .global _start +-_start: +- ret +- +- .data +- .p2align 4 +-l: .long 0x11111111, 0x22222222 +-q: .quad 0x4444444433333333 +- +- .reloc l, BFD_RELOC_64, q +- .reloc q, BFD_RELOC_32, l +Index: binutils-2.39/ld/testsuite/ld-x86-64/rela.d +=================================================================== +--- binutils-2.39.orig/ld/testsuite/ld-x86-64/rela.d 2022-07-08 11:46:48.000000000 +0200 ++++ /dev/null 1970-01-01 00:00:00.000000000 +0000 +@@ -1,10 +0,0 @@ +-#name: x86-64 rela relocs w/ non-zero relocated fields +-#as: --64 +-#source: ${srcdir}/../../../gas/testsuite/gas/i386/rela.s +-#ld: -melf_x86_64 +-#objdump: -sj .data +- +-.*: +file format .* +- +-Contents of section .data: +- *[0-9a-f]*0 .8 ?.. ?.. ?.. 00 ?00 ?00 ?00 .0 ?.. ?.. ?.. 44 ?44 ?44 ?44 .* +Index: binutils-2.39/ld/testsuite/ld-x86-64/x86-64.exp +=================================================================== +--- binutils-2.39.orig/ld/testsuite/ld-x86-64/x86-64.exp 2022-07-26 09:13:10.000000000 +0200 ++++ binutils-2.39/ld/testsuite/ld-x86-64/x86-64.exp 2022-10-17 16:27:41.276966573 +0200 +@@ -286,7 +286,6 @@ run_dump_test "apic" + run_dump_test "pcrel8" + run_dump_test "pcrel16" + run_dump_test "pcrel16-2" +-run_dump_test "rela" + run_dump_test "tlsgd2" + run_dump_test "tlsgd3" + run_dump_test "tlsgd12" diff --git a/binutils.changes b/binutils.changes index 4d7e66f..48a2e21 100644 --- a/binutils.changes +++ b/binutils.changes @@ -1,3 +1,50 @@ +------------------------------------------------------------------- +Sat Dec 10 10:00:56 UTC 2022 - Dirk Müller + +- fix build on x86_64_vX platforms + +------------------------------------------------------------------- +Tue Oct 25 14:52:30 UTC 2022 - Michael Matz + +- Add binutils-maxpagesize.diff for a problem on old code + streams, where we would generate too large binaries. + +------------------------------------------------------------------- +Tue Oct 25 12:54:34 UTC 2022 - Andreas Schwab + +- s390-pic-dso.diff: use %pB instead of %B + +------------------------------------------------------------------- +Mon Oct 17 15:16:23 UTC 2022 - Michael Matz + +- SLE toolchain update of binutils. Update to 2.39 from 2.37, + which means obsoleting and hence removing these patches: + binutils-add-efi-aarch64-1.diff, binutils-add-efi-aarch64-2.diff, + binutils-add-efi-aarch64-3.diff, binutils-fix-keepdebug.diff, + binutils-add-z16-name.diff. + Implements [jsc#SLE-25046, jsc#PED-2029, jsc#PED-2035, jsc#PED-2033, + jsc#PED-2030, jsc#PED-2038, jsc#PED-2032, jsc#PED-2034, jsc#PED-2031, + jsc#SLE-25047] +- This fixes these CVEs relative to 2.37: + [bsc#1188374, bsc#1185597] aka (GCC) PR99935 aka CVE-2021-3648 + [bsc#1193929] aka PR28694 aka CVE-2021-45078 + [bsc#1194783] aka (GCC) PR98886 aka CVE-2021-46195 + [bsc#1197592] aka (GCC) PR105039 aka CVE-2022-27943 + [bsc#1202966] aka PR29289 aka CVE-2022-38126 + [bsc#1202967] aka PR29290 aka CVE-2022-38127 + [bsc#1202969] aka CVE-2021-3826 + +------------------------------------------------------------------- +Fri Oct 14 15:22:38 UTC 2022 - Dirk Müller + +- add arm32-avoid-copyreloc.patch for PR16177 (bsc#1200962) + +------------------------------------------------------------------- +Fri Aug 26 13:24:35 UTC 2022 - Michael Matz + +- Add binutils-pr29482.diff for PR29482, aka CVE-2022-38533 + [bsc#1202816] + ------------------------------------------------------------------- Wed Aug 10 09:04:57 UTC 2022 - Martin Liška @@ -44,6 +91,15 @@ Sat Aug 6 08:41:08 UTC 2022 - Martin Liška - Includes fixes for these CVEs: bnc#1142579 aka CVE-2019-1010204 aka PR23765 +------------------------------------------------------------------- +Mon Jun 13 12:09:35 UTC 2022 - Michael Matz + +(Fake entry from SLE for tracking purposes:) +- For building shim 15.6~rc1 (and later versions) aarch64 image, objcopy + needs to support efi-app-aarch64 target. (bsc#1198458) + Adds binutils-add-efi-aarch64-1.diff, + binutils-add-efi-aarch64-2.diff, binutils-add-efi-aarch64-3.diff . + ------------------------------------------------------------------- Wed May 25 10:23:35 UTC 2022 - Martin Liška @@ -62,6 +118,13 @@ Mon May 9 10:18:29 UTC 2022 - Andreas Schwab - On SLE15 and later, use make -Oline to synchronize configure output by lines +------------------------------------------------------------------- +Fri May 6 14:17:19 UTC 2022 - Michael Matz + +(Fake entry from SLE for tracking purposes:) +- Add binutils-fix-keepdebug.diff for fix bsc#1191908, a problem + in crash not accepting some of our .ko.debug files. + ------------------------------------------------------------------- Wed May 4 12:08:27 UTC 2022 - Martin Liška @@ -83,12 +146,29 @@ Mon May 2 10:15:26 UTC 2022 - Martin Liška - Start using _multibuild for cross binutils. +------------------------------------------------------------------- +Mon Apr 25 16:25:47 UTC 2022 - Michael Matz + +- Add binutils-revert-rela.diff to revert back to old behaviour + of not ignoring the in-section content of to be relocated + fields on x86-64, even though that's a RELA architecture. + Compatibility with buggy object files generated by old tools. + [bsc#1198422] + (forward port from SLE) + ------------------------------------------------------------------- Mon Apr 11 13:49:19 UTC 2022 - Michael Matz - Update binutils-2.38-branch.diff.gz (to c210342d7f5) to include recognition of 'z16' name for 'arch14' on s390. [bsc#1198237] +------------------------------------------------------------------- +Mon Apr 11 13:43:11 UTC 2022 - Michael Matz + +(Fake entry from SLE for tracking purposes:) +- Add binutils-add-z16-name.diff so that the now official name + z16 for arch14 is recognized. [bsc#1198237] + ------------------------------------------------------------------- Mon Mar 21 16:40:26 UTC 2022 - Marcus Meissner diff --git a/binutils.spec b/binutils.spec index d894868..7506275 100644 --- a/binutils.spec +++ b/binutils.spec @@ -94,7 +94,7 @@ Release: 0 %define make_check_handling false %endif # handle all binary object formats supported by SUSE (and a few more) -%ifarch %ix86 %arm aarch64 ia64 ppc ppc64 ppc64le riscv64 s390 s390x x86_64 +%ifarch %ix86 %arm aarch64 ia64 ppc ppc64 ppc64le riscv64 s390 s390x x86_64 %x86_64 %define build_multitarget 1 %else %define build_multitarget 0 @@ -125,6 +125,7 @@ Patch6: unit-at-a-time.patch Patch8: ld-relro.diff Patch9: testsuite.diff Patch10: enable-targets-gold.diff +Patch11: arm32-avoid-copyreloc.patch Patch12: s390-pic-dso.diff Patch14: binutils-build-as-needed.diff Patch15: binutils-znow.patch @@ -138,6 +139,9 @@ Patch40: binutils-fix-abierrormsg.diff Patch41: binutils-fix-relax.diff Patch42: binutils-compat-old-behaviour.diff Patch43: binutils-revert-hlasm-insns.diff +Patch44: binutils-revert-rela.diff +Patch45: binutils-pr29482.diff +Patch46: binutils-maxpagesize.diff Patch100: add-ulp-section.diff Patch90: cross-avr-nesc-as.patch Patch92: cross-avr-omit_section_dynsym.patch @@ -165,7 +169,7 @@ Requires: alts PreReq: update-alternatives %endif %if 0%{!?cross:1} && 0%{?suse_version} >= 1310 -%define gold_archs %ix86 aarch64 %arm x86_64 ppc ppc64 ppc64le s390x %sparc +%define gold_archs %ix86 aarch64 %arm x86_64 %x86_64 ppc ppc64 ppc64le s390x %sparc %endif %description gold @@ -215,7 +219,7 @@ The next generation profiling tool for Linux %ifarch %arm %define HOST %{_target_cpu}-suse-linux-gnueabi %else -%define HOST %(echo %{_target_cpu} | sed -e "s/parisc/hppa/" -e "s/i.86/i586/" -e "s/ppc/powerpc/" -e "s/sparc64v.*/sparc64/" -e "s/sparcv.*/sparc/")-suse-linux +%define HOST %(echo %{_target_cpu} | sed -s -e "s/x86_64_v./x86_64/" -e "s/parisc/hppa/" -e "s/i.86/i586/" -e "s/ppc/powerpc/" -e "s/sparc64v.*/sparc64/" -e "s/sparcv.*/sparc/")-suse-linux %endif %define DIST %(echo '%distribution' | sed 's/ (.*)//') @@ -243,6 +247,7 @@ cp ld/ldgram.y ld/ldgram.y.orig %patch8 %patch9 %patch10 +%patch11 -p1 %patch12 %patch14 %patch15 @@ -259,7 +264,10 @@ cp ld/ldgram.y ld/ldgram.y.orig %if %{suse_version} < 1550 %patch42 -p1 %patch43 -p1 +%patch44 -p1 %endif +%patch45 -p1 +%patch46 -p1 %patch100 -p1 %if "%{TARGET}" == "avr" cp gas/config/tc-avr.h gas/config/tc-avr-nesc.h @@ -690,7 +698,7 @@ fi; %{_libdir}/libctf-nobfd.so.* %if %{suse_version} > 1500 -%ifarch %ix86 x86_64 aarch64 +%ifarch %ix86 x86_64 %x86_64 aarch64 %files -n gprofng %defattr(-,root,root) %dir %{_libdir}/gprofng/ diff --git a/s390-pic-dso.diff b/s390-pic-dso.diff index c5e9826..ec85195 100644 --- a/s390-pic-dso.diff +++ b/s390-pic-dso.diff @@ -19,7 +19,7 @@ Index: bfd/elf32-s390.c + || ELF_ST_VISIBILITY (h->other) != STV_PROTECTED)) + { + (*_bfd_error_handler) -+ (_("%B: relocation %s against `%s' can not be used when " ++ (_("%pB: relocation %s against `%s' can not be used when " + "making a shared object; recompile with -fPIC"), + input_bfd, elf_howto_table[r_type].name, + h->root.root.string);