포럼 회원으로 등록하신분만 다운로드가 가능합니다. 최대 업로드 가능한 용량은 20MB 입니다.

고현철님의 4-startup-#1.txt 문서의 주석 내용을 6410으로 옮겼습니다.

board/aesop6410/u-boot.lds

그리고 아래의 사이트에 있는 문서를 참고하였습니다.
http://kelp.or.kr/korweblog/upload/15/20070407092902/U_BOOT.pdf
Linker Script 관련 사이트
http://korea.gnu.org/manual/release/ld/ld-mahajjh/ld_3.html


 

u-boot.lds 파일은 링커에게 코드 배치를 이렇게 하라고 설명하는 파일입니다.

==========================================

/*

 * (C) Copyright 2002

 * Gary Jennejohn, DENX Software Engineering, <[email protected]>

 *

 * See file CREDITS for list of people who contributed to this

 * project.

 *

 * This program is free software; you can redistribute it and/or

 * modify it under the terms of the GNU General Public License as

 * published by the Free Software Foundation; either version 2 of

 * the License, or (at your option) any later version.

 *

 * This program is distributed in the hope that it will be useful,

 * but WITHOUT ANY WARRANTY; without even the implied warranty of

 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the

 * GNU General Public License for more details.

 *

 * You should have received a copy of the GNU General Public License

 * along with this program; if not, write to the Free Software

 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,

 * MA 02111-1307 USA

 */

 

OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm") little endian으로 코드를 생성하겠다는 말.

/*OUTPUT_FORMAT("elf32-arm", "elf32-arm", "elf32-arm")*/

OUTPUT_ARCH(arm) binary를 실행할 수 있는 CPU architecture로 ARM을 쓰겠다는 뜻.

ENTRY(_start) Program의 시작을 가리키며, 시작되는 함수의 이름은 _start이다. u-boot binary의 시작을 _start 부터 시작하겠다는 의미. C에서의 main()과 비슷
SECTIONS의 정의를 보면, text, rodata, data, got , bss라는 section들이 정의되어 있다.
.text : 실행할 프로그램 코드 영역
.rodata : read-only data 영역 (const 등으로 지정된 데이터)
.data : initialized data 영역
.got : global offset table 영역
.bss : uninitialized data 영역
특수한 링커 변수 dot '.'는 항상 현재 출력 address point를 담고 있다.
address point는 출력 섹션의 크기만큼 증가한다.
u-boot의 시작은 Entry point에 선언된 _start부터 시작된다.
_start는 /cpu/s3c64xx/start.S에 선언되어 있다.


SECTIONS
배치, SECTIONS
를 이용해서 각 섹션의 위치와 정렬을 지정하는데, .으로 시작하는 것들이 각 section에 대한 내용입니다. 이 부분은 코드의 배치를 어떻게 하라는 설명입니다. text section은 실행코드란 의미입니다.

{

             . = 0x00000000; section의 시작을 0번지부터 시작하라는 의미

 

             . = ALIGN(4); 4bytes 정렬을 하라는 말

             .text      : text section

             {

               cpu/s3c64xx/start.o     (.text) startup 코드 , text section의 맨 앞에 start.o를 배열하라는 의미,

               cpu/s3c64xx/s3c6410/cpu_init.o            (.text)

               cpu/s3c64xx/onenand_cp.o      (.text)

               cpu/s3c64xx/nand_cp.o            (.text)

               cpu/s3c64xx/movi.o (.text)

               *(.text)

               lib_arm/div0.o

             }

 

             . = ALIGN(4);

             .rodata : { *(.rodata) }

 

             . = ALIGN(4);

             .data : { *(.data) }

 

             . = ALIGN(4);

             .got : { *(.got) }

 

             __u_boot_cmd_start = .; global 변수 선언 시작, 나중에 C코드, startup코드에서 이것을 가지고 위치계산을 합니다

             .u_boot_cmd : { *(.u_boot_cmd) }

             __u_boot_cmd_end = .; global 변수 선언 끝

 

             . = ALIGN(4);

             .mmudata : { *(.mmudata) }

 

             . = ALIGN(4);

             __bss_start = .; global 변수 선언 시작, 나중에 C코드, startup코드에서 이것을 가지고 위치계산을 합니다

             .bss : { *(.bss) }

             _end = .; global 변수 선언 끝

}

List of Articles
번호 제목 글쓴이 날짜 조회 수

lowlevel_init.S 분석자료(aesop6410) [2]

리눅스 커널 소스 기본 구조

Hotplugging with udev file

FATAL: kernel too oldKernel panic - not syncing: Attempt...

GStreamer on TI DaVinci and OMAP

Creating a Root File System for Linux on OMAP35x

start.S 분석(aesop6410) [1]

u-boot.lds 분석(aesop6410)

u-boot - config.mk 분석(aesop6410) [3]

u-boot source tree 구조(aesop-6410) [3]

mdev and udev 사용 방법 및 적용 가이드 file

고현철님의 리눅스 Root File System 만들기 동영상 실습

고현철님의 리눅스 Root File System 만들기 동영상 강좌 [2]

linux kernel의 ethernet(MAC) address를 자동 지정해 주는 방법 [1]

embedded linux porting guide(ppcboot & mpc860) file [4]

uBuntu 8.10에서 Crosstool 0.43 사용 방법 [2]

kernel 2.6(S3C64XX)용 kernel image구조

리눅스 루트 파일 시스템 기본 구조 및 스펙 문서 file [3]

2.6.28 kernel에서 sk_buff에서 mac header를 가져오고 찍는 방법 [1]

Windows CE에서 NK.bin에 포함된 모듈 확인 하는 방법 file [1]

사용자 로그인