[U-Boot-Users] Question about ld script for s3c44b0
gwunangle
gwunangle at gmail.com
Mon Sep 18 16:02:36 CEST 2006
hi guys,
I have a doubt about the following code which is from u-boot-dist/board/dave/b2
/*code*/
0 OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
1 OUTPUT_ARCH(arm)
2 ENTRY(_start)
3 SECTIONS
4 {
5 . = 0x00000000;
6
7 . = ALIGN(4);
8 .text :
9 {
10 cpu/s3c44b0/start.o (.text)
11 *(.text)
12 }
13
14 . = ALIGN(4);
15 .rodata : { *(.rodata) }
16
17 . = ALIGN(4);
18 .data : { *(.data) }
19
20 . = ALIGN(4);
21 .got : { *(.got) }
22
23 . = .;
24 __u_boot_cmd_start = .;
25 .u_boot_cmd : { *(.u_boot_cmd) }
26 __u_boot_cmd_end = .;
27
28 armboot_end_data = .;
29
30 . = ALIGN(4);
31 __bss_start = .;
32 .bss : { *(.bss) }
33 _end = .;
34 }
/*code*/
My question:
Let's assume it boots from ROM which starts at 0x0(address) and
s3c44b0 has no remap mechanism by the way. After bootloader relocates
section .text,.rodata,.data and .got from ROM to RAM, we get two
copies of codes and data. So here come the question:
ldr pc, _start_armboot
_start_armboot: .word start_armboot
When the above code is executed, which start_armboot is called, the
one is ROM or the one in RAM?
I mean how we can assure cpu fetches code from RAM instead of ROM to
be more efficient?
I think u-boot.lds acts just like a scatter file.(Am I right?)
So maybe we can write like this:
.=ROM_BASE
section:
{
start.o(.text)
lowlevel_init.o(.text)
}
.=RAM_BASE
section:
{
*(.text)
}
. = ALIGN(4);
.rodata : { *(.rodata) }
...and so on
OK,this is my opinion. I need you guys comment on it.
If i am wrong, please give me the right answer so i won't doubt any more.
Sincelely, i need your help.
--
Best Wishes!
Sincerely yours
gWuNangle
--
Never Understand Radical Version
More information about the U-Boot
mailing list