diff options
-rw-r--r-- | .SRCINFO | 10 | ||||
-rw-r--r-- | 10-relocation.patch | 65 | ||||
-rw-r--r-- | PKGBUILD | 11 | ||||
-rw-r--r-- | grub.install | 2 |
4 files changed, 80 insertions, 8 deletions
@@ -1,5 +1,3 @@ -# Generated by mksrcinfo v8 -# Wed Jun 13 21:31:56 UTC 2018 pkgbase = grub-silent pkgdesc = GNU GRand Unified Bootloader (2) [without welcome and kernel messages] pkgver = 2.02 @@ -36,19 +34,19 @@ pkgbase = grub-silent provides = grub-common provides = grub-bios provides = grub-emu - provides = grub-efi- + provides = grub-efi-x86_64 conflicts = grub conflicts = grub-common conflicts = grub-bios conflicts = grub-emu - conflicts = grub-efi- + conflicts = grub-efi-x86_64 conflicts = grub-legacy conflicts = grub-git replaces = grub replaces = grub-common replaces = grub-bios replaces = grub-emu - replaces = grub-efi- + replaces = grub-efi-x86_64 options = !makeflags backup = etc/grub.d/40_custom source = https://ftp.gnu.org/gnu/grub/grub-2.02.tar.xz @@ -63,6 +61,7 @@ pkgbase = grub-silent source = 07-maybe_quiet.patch source = 08-quick_boot.patch source = 09-Fix-packed-not-aligned-error-on-GCC-8.patch + source = 10-relocation.patch source = grub.silent sha256sums = 810b3798d316394f94096ec2797909dbf23c858e48f7b3830826b8daa06b7b0f sha256sums = 2844601914cea6b1231eca0104853a93c4d67a5209933a0766f1475953300646 @@ -76,6 +75,7 @@ pkgbase = grub-silent sha256sums = b7489c7facc4fb3dad4426c9c00079b64908640a2bec2409e22194daa3f72af4 sha256sums = 057f076ddca241d92a094bc05828e3eb18d3439bf4d2f3d8ca8fa1c51b5b1b2b sha256sums = e84b8de569c7e6b73263758c35cf95c6516fde85d4ed451991427864f6a4e5a8 + sha256sums = 51562fa1016c54567dbf42a86c0cfc902372ab579bbee17879a81aff09b76b99 sha256sums = 764844ca8ee0869761cc1a7ed76b5c729ea560664ba26afc339ba4c5d5c7b2e3 pkgname = grub-silent diff --git a/10-relocation.patch b/10-relocation.patch new file mode 100644 index 000000000000..1aeae68493f7 --- /dev/null +++ b/10-relocation.patch @@ -0,0 +1,65 @@ +commit 842c390469e2c2e10b5aa36700324cd3bde25875 +Author: H.J. Lu <hjl.tools@gmail.com> +Date: Sat Feb 17 06:47:28 2018 -0800 + + 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> + +diff --git a/grub-core/efiemu/i386/loadcore64.c b/grub-core/efiemu/i386/loadcore64.c +index e49d0b6ff..18facf47f 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 440690673..3a73e6e6c 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 a2bb05439..39d7efb91 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 9179285a5..a79271f66 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 + } + }, @@ -1,4 +1,5 @@ -# Maintainer : Özgür Sarıer <echo b3pndXJzYXJpZXIxMDExNjAxMTE1QGdtYWlsLmNvbQo= | base64 -d> +# Maintainer : Martin Villagra <possum@archlinux.org> +# Contributor : Özgür Sarıer <echo b3pndXJzYXJpZXIxMDExNjAxMTE1QGdtYWlsLmNvbQo= | base64 -d> # Derived from official Arch Lnux grub package # Maintainer : Christian Hesse <mail@eworm.de> # Maintainer : Ronald van Haren <ronald.archlinux.org> @@ -65,6 +66,7 @@ source=("https://ftp.gnu.org/gnu/${pkgname%-*}/${pkgname%-*}-${pkgver}.tar.xz" '07-maybe_quiet.patch' '08-quick_boot.patch' '09-Fix-packed-not-aligned-error-on-GCC-8.patch' + '10-relocation.patch' 'grub.silent') sha256sums=('810b3798d316394f94096ec2797909dbf23c858e48f7b3830826b8daa06b7b0f' @@ -79,6 +81,7 @@ sha256sums=('810b3798d316394f94096ec2797909dbf23c858e48f7b3830826b8daa06b7b0f' 'b7489c7facc4fb3dad4426c9c00079b64908640a2bec2409e22194daa3f72af4' '057f076ddca241d92a094bc05828e3eb18d3439bf4d2f3d8ca8fa1c51b5b1b2b' 'e84b8de569c7e6b73263758c35cf95c6516fde85d4ed451991427864f6a4e5a8' + '51562fa1016c54567dbf42a86c0cfc902372ab579bbee17879a81aff09b76b99' '764844ca8ee0869761cc1a7ed76b5c729ea560664ba26afc339ba4c5d5c7b2e3') prepare() { @@ -121,6 +124,10 @@ prepare() { patch -Np1 -i "${srcdir}/09-Fix-packed-not-aligned-error-on-GCC-8.patch" echo + msg "Applying fix for relocation error 0x4" + patch -Np1 -i "${srcdir}/10-relocation.patch" + echo + msg "Pull in latest language files" ./linguas.sh echo @@ -130,7 +137,7 @@ prepare() { msg "Avoid problem with unifont during compile of grub" # http://savannah.gnu.org/bugs/?40330 and https://bugs.archlinux.org/task/37847 - cp "${srcdir}/unifont-${_UNIFONT_VER}.bdf" "unifont.bdf" + cp "${srcdir}/unifont-${_UNIFONT_VER}.bdf.gz" "unifont.bdf.gz" } _build_grub-common_and_bios() { diff --git a/grub.install b/grub.install index 59dc2dd45006..d8b4d7930aa6 100644 --- a/grub.install +++ b/grub.install @@ -1,7 +1,7 @@ post_install() { printf "\e[37;1m\e[44;1m%s\e[0m\n" "\ - Please reinstall GRUB first: - # grub-install --target=i386-pc --boot-directory=/your/boot/partition /dev/sdx + # grub-install --target=i386-pc --boot-directory=/your/boot/partition --bootloader-id=GRUB /dev/sdx - Then; look at \"/etc/default/grub.silent\" sample file and make necessary changes to \"/etc/default/grub\". |