[CPP]View Plain Copy # (C) Copyright 2000-2013 # Wolfgang Denk, Denx Software, Engineering wd@denx.de. # spdx-license-identifier:gpl-2.0+ # VERSION = 2014 Patchlevel = sublevel = extraversion = NAME =
Version 2014.4 uboot boot to the command line several important functions are:_start,_main,board_init_f,relocate_code,board_init_r.
a _start
For any program, the entry function is determined at the time of the link, and the Uboot entry is determined by the link script. Uboot the ARMV7 link script default directory is arch/arm/cpu/u-boot.lds. This can be specified in the configuration file with Config_sys_ldscript.
The entry address is also determined by the connector, which can be specified by config_sys_text_base in the configuration file. This will be added to the option-ttext of the LD connector at compile time
View U-boot.lds
[CPP] View plain copy Output_format ("Elf32-littlearm", "Elf32-littlearm", "Elf32-littlearm") Output_arch (ARM) ENTRY (_start) sections { . = 0x00000000; . = align (4); .text : { * (. __image_copy_start) CPUDIR/start.o (. text*) * (. text*) } . = align (4); .rodata : { * (SORT_BY_ Alignment (Sort_by_name (. rodata*))) } . = align (4 );  &NBsp .data : { * (. data*)  } The definitions of these macros in the link script in the linkage.h, see the literal meaning also understand, the program's entrance is in _ Start., followed by the text segment, the data section, and so on.
_start in Arch/arm/cpu/armv7/start. s, a section of the analysis, as follows:
[CPP] view plain copy globl _start _start:b reset Ldr pc, _undefined_instruction ldr pc, _SOFTW Are_interrupt Ldr pc, _prefetch_abort ldr pc, _data_abort ldr pc, _not_used ldr pc, _irq LDR PC, _fiq #ifdef config_spl_build _undefined_instruction:. Word _undefined_instruction _software_interrupt:. Word _software_interrupt _prefetch_abort:. Word _prefetch_abort