From c5fe2888efdc59804bf5774f95c20a885b077fa8 Mon Sep 17 00:00:00 2001 From: q66 Date: Sun, 10 Jan 2021 15:43:54 +0100 Subject: [PATCH] binutils: backport patch this should fix chromium link on i686 --- ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 +++++++++++++++++++ srcpkgs/binutils/template | 2 +- 2 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch new file mode 100644 index 0000000000..a55432d83c --- /dev/null +++ b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch @@ -0,0 +1,60 @@ +From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001 +From: "H.J. Lu" +Date: Mon, 16 Nov 2020 06:37:53 -0800 +Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start + +bfdlink.h has + + /* Symbol will be converted from absolute to section-relative. Set for + symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN) + outside of an output section statement. */ + unsigned int rel_from_abs : 1; + +linker.c has + +.{* Return TRUE if the symbol described by a linker hash entry H +. is going to be absolute. Linker-script defined symbols can be +. converted from absolute to section-relative ones late in the +. link. Use this macro to correctly determine whether the symbol +. will actually end up absolute in output. *} +.#define bfd_is_abs_symbol(H) \ +. (((H)->type == bfd_link_hash_defined \ +. || (H)->type == bfd_link_hash_defweak) \ +. && bfd_is_abs_section ((H)->u.def.section) \ +. && !(H)->rel_from_abs) +. + +Set rel_from_abs to 1 for __ehdr_start which will be converted from +absolute to section-relative in assign_file_positions_for_load_sections. + + PR ld/26869 + * ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for + __ehdr_start. + * testsuite/ld-i386/i386.exp: Run pr26869. + * testsuite/ld-i386/pr26869.d: New file. + * testsuite/ld-i386/pr26869.s: Likewise. + +(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51) +--- + ld/ChangeLog | 9 +++++++++ + ld/ldelf.c | 2 ++ + ld/testsuite/ld-i386/i386.exp | 1 + + ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++ + ld/testsuite/ld-i386/pr26869.s | 3 +++ + 5 files changed, 29 insertions(+) + create mode 100644 ld/testsuite/ld-i386/pr26869.d + create mode 100644 ld/testsuite/ld-i386/pr26869.s + +diff --git a/ld/ldelf.c b/ld/ldelf.c +index bada3ade2d7..831d032fe56 100644 +--- a/ld/ldelf.c ++++ b/ld/ldelf.c +@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit, + (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next, + sizeof ehdr_start_save_u); + ehdr_start->type = bfd_link_hash_defined; ++ /* It will be converted to section-relative later. */ ++ ehdr_start->rel_from_abs = 1; + ehdr_start->u.def.section = bfd_abs_section_ptr; + ehdr_start->u.def.value = 0; + } diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template index 0e6463ad43..b87e20315f 100644 --- a/srcpkgs/binutils/template +++ b/srcpkgs/binutils/template @@ -1,7 +1,7 @@ # Template file for 'binutils' pkgname=binutils version=2.35.1 -revision=1 +revision=2 bootstrap=yes short_desc="GNU binary utilities" maintainer="Enno Boland "