loader: use ldscript to build loader (10605 regression)
After fixing stage2, the same issue is biting us with stage3 (loader). The problem is manifested in BIOS mode cd boot, where loader startup is assuming that we have '_start' symbol first in the loader binary.
For fix, we use the same idea as for stage2, we do add ldscript to describe how the loader.sym should be created.
Also we will not provide symbol 'end', so we replace end by _end in main.c. And we actually add --gc-sections to save ~23KB of space.
Testing done: build/install/boot for disk based boot. used distro constructor to build iso and verified it does indeed fix the cd boot case too.
Updated by Electric Monk about 3 years ago
- Status changed from In Progress to Closed
- % Done changed from 90 to 100
commit 18af157d87b4b81f71536f46eb203c55084f0e58 Author: Toomas Soome <firstname.lastname@example.org> Date: 2019-05-02T19:20:59.000Z 10899 loader: use ldscript to build loader (10605 regression) Reviewed by: Igor Kozhukhov <email@example.com> Reviewed by: John Levon <firstname.lastname@example.org> Approved by: Dan McDonald <email@example.com>