포럼 회원으로 등록하신분만 다운로드가 가능합니다. 최대 업로드 가능한 용량은 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
번호 제목 글쓴이 날짜 조회 수sort
70 MTD/JFFS2 howto file 고도리 2015-06-17 403
69 devicetree usage 번역판 file [1] 고도리 2016-09-17 716
68 드라이버의 다이내믹 설정? [1] lveritas 2013-07-29 3479
67 DeviceTree for ARM 관련 간단 글. [3] 고도리 2013-08-27 5424
66 Linux kernel Documentation DocBook 만들기 [1] 고도리 2012-08-25 5626
65 crosstool-ng 관련 site 고도리 2011-08-15 8462
64 리눅스 커널에서의 container_of macro 설명 고도리 2011-08-15 8895
63 kernel architecture number(mach-types) 직접 커널에 입력하기 고도리 2011-08-15 9234
62 autologin 고현철 2009-01-30 9886
61 debug print문(kernel & app용) 고현철 2009-01-30 10060
60 Creating a Root File System for Linux on OMAP35x 장석원 2009-04-24 10114
59 Embedded linux Swap howto 고현철 2009-01-30 10252
58 ubuntu 에서 kubuntu ppa backports repository 지정방법 [1] 고도리 2011-05-10 10403
57 ramdisk howto file 고현철 2009-01-30 10622
56 uBuntu 8.10에서 Crosstool 0.43 사용 방법 [2] 김재훈 2009-02-18 10780
55 2.6.28 kernel에서 sk_buff에서 mac header를 가져오고 찍는 방법 [1] 고현철 2009-02-10 10864
54 GStreamer on TI DaVinci and OMAP 장석원 2009-04-25 10929
53 kernel 2.6(S3C64XX)용 kernel image구조 고현철 2009-02-16 10982
52 임베디드 시스템 포팅 가이드(PXA255 ) #2 file 김재훈 2009-05-17 11018
51 Windows CE에서 NK.bin에 포함된 모듈 확인 하는 방법 file [1] 김재훈 2009-02-04 11030

사용자 로그인