On Sat, Jul 11, 2020 at 09:22:30AM +0300, Michael Tokarev wrote:
11.07.2020 03:08, Kevin O'Connor wrote: []
As for the particular workaround, "-z allowexec" generates a warning on current versions of ld. Given that, for SeaBIOS, my first reaction would probably be to change the SeaBIOS build to unconditionally clear the flag in the intermediate binary than to deploy a more complicated ld version check to set the given command-line flag. I'd like to give that some more thought though.
Can't seabios use the way suggested by Andreas Schwab, namely .incbin assembler instruction?
SeaBIOS has some funky linking requirements. It needs to link 16bit code, 32bit "segmented" code, and normal 32bit code. There's a document online describing a bit of this at: https://www.seabios.org/Linking_overview
The main limitation to simple ".incbin" usage is that SeaBIOS needs to put a variety of 16bit sections along with 32bit "segmented" sections at certain fixed memory locations. So, there is no one simple .incbin directive that would replace the final linking step. It's certainly possible to come up with an alternative linking mechanism (or to even manually assemble the final image), but I suspect the alternatives will come with further complexity. Certainly something to look at though.
Cheers, -Kevin