Project

General

Profile

Bug #10899

loader: use ldscript to build loader (10605 regression)

Added by Toomas Soome 7 months ago. Updated 7 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
bootloader
Start date:
2019-05-02
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage

Description

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.

History

#1

Updated by Toomas Soome 7 months ago

  • Description updated (diff)
  • Category set to bootloader
  • Status changed from New to In Progress
  • Assignee set to Toomas Soome
  • % Done changed from 0 to 90
#2

Updated by Electric Monk 7 months ago

  • Status changed from In Progress to Closed
  • % Done changed from 90 to 100

git commit 18af157d87b4b81f71536f46eb203c55084f0e58

commit  18af157d87b4b81f71536f46eb203c55084f0e58
Author: Toomas Soome <tsoome@me.com>
Date:   2019-05-02T19:20:59.000Z

    10899 loader: use ldscript to build loader (10605 regression)
    Reviewed by: Igor Kozhukhov <igor@dilos.org>
    Reviewed by: John Levon <john.levon@joyent.com>
    Approved by: Dan McDonald <danmcd@joyent.com>

Also available in: Atom PDF