0016-strip-gnu-property.patch 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. From: Lukas Schwaighofer <lukas@schwaighofer.name>
  2. Date: Sat, 18 Aug 2018 12:48:21 +0200
  3. Subject: Strip the .note.gnu.property section for the mbr
  4. This section is added since binutils Debian version 2.31.1-2 and causes mbr.bin
  5. to grow in size beyond what can fit into the master boot record.
  6. Forwarded: https://www.syslinux.org/archives/2018-August/026168.html
  7. ---
  8. mbr/i386/mbr.ld | 6 +++++-
  9. mbr/x86_64/mbr.ld | 6 +++++-
  10. 2 files changed, 10 insertions(+), 2 deletions(-)
  11. diff --git a/mbr/i386/mbr.ld b/mbr/i386/mbr.ld
  12. index d14ba80..6d48990 100644
  13. --- a/mbr/i386/mbr.ld
  14. +++ b/mbr/i386/mbr.ld
  15. @@ -69,5 +69,9 @@ SECTIONS
  16. .debug_funcnames 0 : { *(.debug_funcnames) }
  17. .debug_typenames 0 : { *(.debug_typenames) }
  18. .debug_varnames 0 : { *(.debug_varnames) }
  19. - /DISCARD/ : { *(.note.GNU-stack) }
  20. + /DISCARD/ :
  21. + {
  22. + *(.note.GNU-stack)
  23. + *(.note.gnu.property)
  24. + }
  25. }
  26. diff --git a/mbr/x86_64/mbr.ld b/mbr/x86_64/mbr.ld
  27. index ae27d49..5b46db6 100644
  28. --- a/mbr/x86_64/mbr.ld
  29. +++ b/mbr/x86_64/mbr.ld
  30. @@ -68,5 +68,9 @@ SECTIONS
  31. .debug_funcnames 0 : { *(.debug_funcnames) }
  32. .debug_typenames 0 : { *(.debug_typenames) }
  33. .debug_varnames 0 : { *(.debug_varnames) }
  34. - /DISCARD/ : { *(.note.GNU-stack) }
  35. + /DISCARD/ :
  36. + {
  37. + *(.note.GNU-stack)
  38. + *(.note.gnu.property)
  39. + }
  40. }