On Sat, 11 Jul 2020, Kevin O'Connor wrote:
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.
The point is with `.incbin' you can effectively convert any piece of data back into the relocatable format without having to resort to undocumented hacks or plain bugs. And you have further control over this data by, say, putting it into an individual section, or defining symbols to delimit the beginning and/or the end. Then you can use the resulting object file as an ordinary input to the linker just as with your current recipe, and use a linker script to lay out individual inputs however you wish, including at fixed memory locations.
Maciej