rhboot / shim

UEFI shim loader
Other
819 stars 289 forks source link

Make sbat_var.S parse right with buggy gcc/binutils #535

Closed vathpela closed 1 year ago

vathpela commented 1 year ago

In https://github.com/rhboot/shim/issues/533 , iokomin noticed that gas in binutils before 2.36 appears to be incorrectly concatenating string literals in '.asciz' directives, including an extra NUL character in between the strings, and this will cause us to incorrectly parse the .sbatlevel section in shim binaries.

This patch adds test cases that will cause the build to fail if this has happened, as well as changing sbat_var.S to to use '.ascii' and '.byte' to construct the data, rather than using '.asciz'.

Signed-off-by: Peter Jones pjones@redhat.com