Created
November 23, 2016 06:17
-
-
Save hangingman/792074e02a8d4dd33042b3dbe7febdef to your computer and use it in GitHub Desktop.
object から .hrb 形式変換のためのリンカスクリプト(from: http://vanya.jp.net/os/haribote.html)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
OUTPUT_FORMAT("binary"); | |
SECTIONS | |
{ | |
.head 0x0 : { | |
LONG(64 * 1024) /* 0 : stack+.data+heap の大きさ(4KBの倍数) */ | |
LONG(0x69726148) /* 4 : シグネチャ "Hari" */ | |
LONG(0) /* 8 : mmarea の大きさ(4KBの倍数) */ | |
LONG(0x310000) /* 12 : スタック初期値&.data転送先 */ | |
LONG(SIZEOF(.data)) /* 16 : .dataサイズ */ | |
LONG(LOADADDR(.data)) /* 20 : .dataの初期値列のファイル位置 */ | |
LONG(0xE9000000) /* 24 : 0xE9000000 */ | |
LONG(HariMain - 0x20) /* 28 : エントリアドレス - 0x20 */ | |
LONG(0) /* 32 : heap領域(malloc領域)開始アドレス */ | |
} | |
.text : { *(.text) } | |
.data 0x310000 : AT ( ADDR(.text) + SIZEOF(.text) ) { | |
*(.data) | |
*(.rodata*) | |
*(.bss) | |
} | |
/DISCARD/ : { *(.eh_frame) } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment