Monday, June 3, 2013

u-boot.lds file analysis

 27 OUTPUT_FORMAT ("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
Specify the output format is 32bits ARM little endian
OUTPUT_FORMAT prototype OUTPUT_FORMAT (default, big, little), at link time, if you use the-EB command line parameters, use the parameter specified here is big endian, if you use the-EL command line parameter, Use this parameter to specify the little endian, if not using any command-line parameters, use the default parameters specified here endian. Uboot.lds defined by the visible, no matter what kind of links when using the command-line parameters, output target files are used elf32-littlearm endian mode.
 28 OUTPUT_ARCH (arm)
Pointed out that the output of the executable file platform is armd
 29 ENTRY (_start)
Specify the output executable code segment is starting _start
 30 SECTIONS 
 31 { 
 32. = 0x00000000; 
 33 
 34. = ALIGN (4); 
 35. text: 
 36 { 
 37 cpu/arm_cortexa8/start.o (. text) 
 38 * (. text) 
 39}
32 lines on the location counter assignment,. = 0x00000000 positioning counter is initialized to 0x0
Line 34 makes the current location counter to a four-byte alignment
35 to 39 define an output section. Text, colon syntax is required. . Text after braces, lists all the sections should be placed on the output of the input section name * is a wildcard matching any file name,
37 line said we should / cpu/arm_cortexa8/start.o in. Text input sections into the output file. Text output section.
Line 38 * (. Text) means that all of the input file. Text input section;

 41. = ALIGN (4); 
 42. rodata: {* (SORT_BY_ALIGNMENT (SORT_BY_NAME (. rodata *)))}
41 to modify the current position register, make the following. Rodata output section aligned with 4bytes
42 definitions. Rodata output section for all files. Rodata input section

 44. = ALIGN (4); 
 45. Data: {* (. Data)} 
 46 
 47. = ALIGN (4); 
 48. got: {* (. got)}
44 ~ 48. Data and. Got the output section definition is similar. Rodata, requires that two output sections to be aligned to 4 bytes

 50 __ u_boot_cmd_start =.; 
 51. u_boot_cmd: {* (. u_boot_cmd)} 
 52 __ u_boot_cmd_end =.;
50 __u_boot_cmd_start set to the current positioning technology devices, namely. U_boot_cmd Section start
52 __u_boot_cmd_end set to the current location counter, ie. U_boot_cmd end of the section
51 definitions. U_boot_cmd output section for all the input files. U_boot_cmd input section

 54. = ALIGN (4); 
 55 __ bss_start =.; 
 56. BSS: {* (. BSS)} 
 57 _end =.; 
 58} 
defined. bss output section, and put __bss_start __bss_start output section is defined as the starting position, defined as the _end end position __bss section

1 comment:

  1. what code can I add in u-boot.lds to enable secure booitng using u-boot 2013?

    ReplyDelete