Skip to content

Commit

Permalink
boot/syslinux: fix build with binutils note gnu property section
Browse files Browse the repository at this point in the history
Fixes #11756

This fixes the following build error with newer binutils:

  objcopy -O binary mbr.elf mbr.bin
  perl /build/syslinux/src/syslinux/mbr/checksize.pl mbr.bin
  mbr.bin: too big (452 > 440)

Corresponding bug reports:

 - https://bugs.archlinux.org/task/60405
 - https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=906414

Strip the .note.gnu.property in the linker scripts for the MBRs.

Signed-off-by: Christian Stewart <[email protected]>
Reviewed-by: "Yann E. MORIN" <[email protected]>
Signed-off-by: Peter Korsgaard <[email protected]>
(cherry picked from commit 0ca17cd)
Signed-off-by: Peter Korsgaard <[email protected]>
  • Loading branch information
paralin authored and jacmet committed Apr 14, 2019
1 parent f64a25a commit 08209c6
Showing 1 changed file with 47 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
From beb526ca925983c7da229043790ecd552d910650 Mon Sep 17 00:00:00 2001
From: Christian Stewart <[email protected]>
Date: Thu, 4 Apr 2019 23:24:31 -0700
Subject: [PATCH] Fix build with binutils note gnu property section

This fixes the following build error with newer binutils:

objcopy -O binary mbr.elf mbr.bin
perl /build/syslinux/src/syslinux/mbr/checksize.pl mbr.bin
mbr.bin: too big (452 > 440)

Corresponding bug reports:

- https://bugs.archlinux.org/task/60405
- https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=906414

Strips the .note.gnu.property in the linker scripts for the MBRs.

Signed-off-by: Christian Stewart <[email protected]>
---
mbr/i386/mbr.ld | 1 +
mbr/x86_64/mbr.ld | 1 +
2 files changed, 2 insertions(+)

diff --git a/mbr/i386/mbr.ld b/mbr/i386/mbr.ld
index d14ba802..53683461 100644
--- a/mbr/i386/mbr.ld
+++ b/mbr/i386/mbr.ld
@@ -70,4 +70,5 @@ SECTIONS
.debug_typenames 0 : { *(.debug_typenames) }
.debug_varnames 0 : { *(.debug_varnames) }
/DISCARD/ : { *(.note.GNU-stack) }
+ /DISCARD/ : { *(.note.gnu.property) }
}
diff --git a/mbr/x86_64/mbr.ld b/mbr/x86_64/mbr.ld
index ae27d49a..b8c0d895 100644
--- a/mbr/x86_64/mbr.ld
+++ b/mbr/x86_64/mbr.ld
@@ -69,4 +69,5 @@ SECTIONS
.debug_typenames 0 : { *(.debug_typenames) }
.debug_varnames 0 : { *(.debug_varnames) }
/DISCARD/ : { *(.note.GNU-stack) }
+ /DISCARD/ : { *(.note.gnu.property) }
}
--
2.21.0

0 comments on commit 08209c6

Please sign in to comment.