diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2018-09-10 08:43:34 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2018-09-10 08:43:34 +0000 |
commit | 314d517fbc2e514a2498402eec6361743c8c4bdf (patch) | |
tree | bf3bf07d7451b9e4dc3d7056888173dd25ec2044 /main/grub | |
parent | b718f3d261afe0aab934d62d969a15f99381e23d (diff) | |
download | aports-314d517fbc2e514a2498402eec6361743c8c4bdf.tar.bz2 aports-314d517fbc2e514a2498402eec6361743c8c4bdf.tar.xz |
main/grub: fix for binutils-2.31.1
fixes grub-mkimage: error: relocation 0x4 is not implemented yet.
Diffstat (limited to 'main/grub')
-rw-r--r-- | main/grub/APKBUILD | 6 | ||||
-rw-r--r-- | main/grub/x86-64-Treat-R_X86_64_PLT32-as-R_X86_64_PC32.patch | 73 |
2 files changed, 77 insertions, 2 deletions
diff --git a/main/grub/APKBUILD b/main/grub/APKBUILD index cd082e2891..4e2a0e2741 100644 --- a/main/grub/APKBUILD +++ b/main/grub/APKBUILD @@ -2,7 +2,7 @@ # Maintainer: Timo Teräs <timo.teras@iki.fi> pkgname=grub pkgver=2.02 -pkgrel=6 +pkgrel=7 pkgdesc="Bootloader with support for Linux, Multiboot and more" url="https://www.gnu.org/software/grub/" arch="all !s390x" @@ -36,6 +36,7 @@ source="https://ftp.gnu.org/gnu/grub/grub-$pkgver.tar.xz grub-xen-host_grub.cfg 2.02_beta3-mkconfig-alpine.patch 0009-xfs-Accept-filesystem-with-sparse-inodes.patch + x86-64-Treat-R_X86_64_PLT32-as-R_X86_64_PC32.patch " builddir="$srcdir/grub-$pkgver" @@ -161,4 +162,5 @@ f2a7d9ab6c445f4e402e790db56378cecd6631b5c367451aa6ce5c01cd95b95c83c3dd24d6d4b857 098a1742aef131c85d63b934a9815879b991f2e73030cb90ac4b5dcd07d249fa0dd0a281e52ada0e10f05d59223493bd416eb47543242bf0ba336a0ebc9b2a1a grub2-accept-empty-module.patch 4e7394e0fff6772c89683039ccf81099ebbfe4f498e6df408977a1488fd59389b6e19afdbf0860ec271e2b2aea0df7216243dcc8235d1ca3af0e7f4d0a9d60a4 grub-xen-host_grub.cfg 5de7c1cc11640a3892447f0daa1e3fd1f67b0c474c8aec555e4e6315b5e6c00491ba02c88b420cec221da0640c6961d639f148746df14a0b2c15bda7989cd25c 2.02_beta3-mkconfig-alpine.patch -4723c5dd9fd6e9b6c8677e32e4906c7995d695c7e85e834b1b29eb1d9a024678f8fa75846c7b929d1db9b5911b604c69c1b0379cb3b9adc98d5bb6d6719eb2c4 0009-xfs-Accept-filesystem-with-sparse-inodes.patch" +4723c5dd9fd6e9b6c8677e32e4906c7995d695c7e85e834b1b29eb1d9a024678f8fa75846c7b929d1db9b5911b604c69c1b0379cb3b9adc98d5bb6d6719eb2c4 0009-xfs-Accept-filesystem-with-sparse-inodes.patch +e11f62b5012ecc8abf9d4912db12a263470887671b05ccb4de54981fb3b32a52d4557439a160e69e0654e35a57fdb0afd5fe801709b8037a6ea4a50d8b8455ec x86-64-Treat-R_X86_64_PLT32-as-R_X86_64_PC32.patch" diff --git a/main/grub/x86-64-Treat-R_X86_64_PLT32-as-R_X86_64_PC32.patch b/main/grub/x86-64-Treat-R_X86_64_PLT32-as-R_X86_64_PC32.patch new file mode 100644 index 0000000000..4f2716e9a7 --- /dev/null +++ b/main/grub/x86-64-Treat-R_X86_64_PLT32-as-R_X86_64_PC32.patch @@ -0,0 +1,73 @@ +From 842c390469e2c2e10b5aa36700324cd3bde25875 Mon Sep 17 00:00:00 2001 +From: "H.J. Lu" <hjl.tools@gmail.com> +Date: Sat, 17 Feb 2018 06:47:28 -0800 +Subject: 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 <hjl.tools@gmail.com> +Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com> +--- + grub-core/efiemu/i386/loadcore64.c | 1 + + grub-core/kern/x86_64/dl.c | 1 + + util/grub-mkimagexx.c | 1 + + util/grub-module-verifier.c | 1 + + 4 files changed, 4 insertions(+) + +diff --git a/grub-core/efiemu/i386/loadcore64.c b/grub-core/efiemu/i386/loadcore64.c +index e49d0b6..18facf4 100644 +--- a/grub-core/efiemu/i386/loadcore64.c ++++ b/grub-core/efiemu/i386/loadcore64.c +@@ -98,6 +98,7 @@ grub_arch_efiemu_relocate_symbols64 (grub_efiemu_segment_t segs, + break; + + case R_X86_64_PC32: ++ case R_X86_64_PLT32: + err = grub_efiemu_write_value (addr, + *addr32 + rel->r_addend + + sym.off +diff --git a/grub-core/kern/x86_64/dl.c b/grub-core/kern/x86_64/dl.c +index 4406906..3a73e6e 100644 +--- a/grub-core/kern/x86_64/dl.c ++++ b/grub-core/kern/x86_64/dl.c +@@ -70,6 +70,7 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr, + break; + + case R_X86_64_PC32: ++ case R_X86_64_PLT32: + { + grub_int64_t value; + value = ((grub_int32_t) *addr32) + rel->r_addend + sym->st_value - +diff --git a/util/grub-mkimagexx.c b/util/grub-mkimagexx.c +index a2bb054..39d7efb 100644 +--- a/util/grub-mkimagexx.c ++++ b/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 +--- a/util/grub-module-verifier.c ++++ b/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 + } + }, +-- +cgit v1.0-41-gc330 + |