0014-Fix-build-with-binutils-note-gnu-property-section.patch 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. From beb526ca925983c7da229043790ecd552d910650 Mon Sep 17 00:00:00 2001
  2. From: Christian Stewart <christian@paral.in>
  3. Date: Thu, 4 Apr 2019 23:24:31 -0700
  4. Subject: [PATCH] Fix build with binutils note gnu property section
  5. This fixes the following build error with newer binutils:
  6. objcopy -O binary mbr.elf mbr.bin
  7. perl /build/syslinux/src/syslinux/mbr/checksize.pl mbr.bin
  8. mbr.bin: too big (452 > 440)
  9. Corresponding bug reports:
  10. - https://bugs.archlinux.org/task/60405
  11. - https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=906414
  12. Strips the .note.gnu.property in the linker scripts for the MBRs.
  13. Signed-off-by: Christian Stewart <christian@paral.in>
  14. ---
  15. mbr/i386/mbr.ld | 1 +
  16. mbr/x86_64/mbr.ld | 1 +
  17. 2 files changed, 2 insertions(+)
  18. diff --git a/mbr/i386/mbr.ld b/mbr/i386/mbr.ld
  19. index d14ba802..53683461 100644
  20. --- a/mbr/i386/mbr.ld
  21. +++ b/mbr/i386/mbr.ld
  22. @@ -70,4 +70,5 @@ SECTIONS
  23. .debug_typenames 0 : { *(.debug_typenames) }
  24. .debug_varnames 0 : { *(.debug_varnames) }
  25. /DISCARD/ : { *(.note.GNU-stack) }
  26. + /DISCARD/ : { *(.note.gnu.property) }
  27. }
  28. diff --git a/mbr/x86_64/mbr.ld b/mbr/x86_64/mbr.ld
  29. index ae27d49a..b8c0d895 100644
  30. --- a/mbr/x86_64/mbr.ld
  31. +++ b/mbr/x86_64/mbr.ld
  32. @@ -69,4 +69,5 @@ SECTIONS
  33. .debug_typenames 0 : { *(.debug_typenames) }
  34. .debug_varnames 0 : { *(.debug_varnames) }
  35. /DISCARD/ : { *(.note.GNU-stack) }
  36. + /DISCARD/ : { *(.note.gnu.property) }
  37. }
  38. --
  39. 2.21.0