0016-strip-gnu-property.patch 1.2 KB

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