From 3f962919790055ee62963e54097f51f83a58d5e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Buchm=C3=BCller?= Date: Wed, 24 Oct 2018 20:06:04 +0200 Subject: [PATCH] grub: add patch to support binutils-2.31.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See: #2813 Signed-off-by: Jürgen Buchmüller --- .../patches/grub-mkimage-R_X86_64_PLT32.patch | 33 +++++++++++++++++++ srcpkgs/grub/template | 4 +-- 2 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 srcpkgs/grub/patches/grub-mkimage-R_X86_64_PLT32.patch diff --git a/srcpkgs/grub/patches/grub-mkimage-R_X86_64_PLT32.patch b/srcpkgs/grub/patches/grub-mkimage-R_X86_64_PLT32.patch new file mode 100644 index 0000000000..d4b91f9051 --- /dev/null +++ b/srcpkgs/grub/patches/grub-mkimage-R_X86_64_PLT32.patch @@ -0,0 +1,33 @@ +x86-64: Treat R_X86_64_PLT32 as R_X86_64_PC32 + +Starting from binutils commit bd7ab16b4537788ad53521c45469a1bdae84ad4a: +https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=bd7ab16b4537788ad53521c45469a1bdae84ad4a +x86-64 assembler generates R_X86_64_PLT32, instead of R_X86_64_PC32, for +32-bit PC-relative branches. Grub2 should treat R_X86_64_PLT32 as +R_X86_64_PC32. + +Signed-off-by: H.J. Lu +Reviewed-by: Daniel Kiper + +--- util/grub-mkimagexx.c ++++ util/grub-mkimagexx.c +@@ -841,6 +841,7 @@ SUFFIX (relocate_addresses) (Elf_Ehdr *e, Elf_Shdr *sections, + break; + + case R_X86_64_PC32: ++ case R_X86_64_PLT32: + { + grub_uint32_t *t32 = (grub_uint32_t *) target; + *t32 = grub_host_to_target64 (grub_target_to_host32 (*t32) +diff --git a/util/grub-module-verifier.c b/util/grub-module-verifier.c +index 9179285..a79271f 100644 +--- util/grub-module-verifier.c ++++ util/grub-module-verifier.c +@@ -19,6 +19,7 @@ struct grub_module_verifier_arch archs[] = { + -1 + }, (int[]){ + R_X86_64_PC32, ++ R_X86_64_PLT32, + -1 + } + }, diff --git a/srcpkgs/grub/template b/srcpkgs/grub/template index fd84eea481..5e948e7987 100644 --- a/srcpkgs/grub/template +++ b/srcpkgs/grub/template @@ -1,8 +1,8 @@ # Template file for 'grub' pkgname=grub version=2.02 -revision=2 -hostmakedepends="flex" +revision=3 +hostmakedepends="flex freetype-devel" makedepends="libusb-compat-devel ncurses-devel freetype-devel liblzma-devel device-mapper-devel font-unifont-bdf fuse-devel" depends="os-prober"