2013年10月3日 星期四

vmlinux.lds.S 相關

vmlinux.lds.S生成的vmlinux.lds是一linker script
而.lds file(linker script)是linker(such as arm-linux-ld)的其一input file
linker主要的input file是object file,加上-T可以額外指定linker script
linker的output file就是bin executable, 再kernel部份是vmlinux, 也就是kernel image

以下是.lds file範例
SECTIONS
{
       . = 0x10000;
       .text : { *(.text) }
       . = 0x8000000;
       .data : { *(.data) }
       .bss : { *(.bss) }
}

其中第一行的 . 代表location counter, 表示以下的.text段會開始0x10000
.text : { *(.text) } 代表此lds file's output的.text段由所有的輸入文件(*'s meaning)      的.text段組成, 且順序為input file的順序
第三行. = 0x8000000表示location換成0x8000000,若不指定的話location counter=0x10000+address length of all input's .text


Reference:
http://blog.csdn.net/innost/article/details/6730660
http://mcuos.com/thread-8170-1-1.html

0 意見:

張貼留言