uboot分析-メイクファイル

1. Makefile分析

$(TOPDIR)/メイク

    |

    | ----->インクルード$(obj)/include/config.mkでボード環境を決定       

    | ||

    | V

    | ----------> 136 CROSS_COMPILEを確認

    |

    | ----------> 186 include $(TOPDIR)/config.mk

    | |

    | | ------------------------------> 112 include $(OBJTREE)/include/autoconf.mk import configuration variables

    | |

    | | -------------------------------> 145リンク確認スクリプト

    | |

    | | --------------------------------> 200 OK TEXT_BASE

    | |

    |

    | -----------> OBJS、LIBS、目標、ルールを決定する

    |

    | ----------->構成する2500

 

2. mkconfig分析

  コンパイル時にボード環境に対応するディレクトリを使用するシンボリックリンクを作成します。

  include / config.mkを作成して、将来のmakeのためにmake構成情報を記録します

  include / config.hを作成して、x210_sd構成情報をコンパイルして使用します(開発ボードメーカーが追加)。

 

3.リンクスクリプト分析

OUTPUT_FORMAT(" elf32-littlearm "" elf32-littlearm "" elf32-littlearm " / * OUTPUT_FORMAT( "elf32-arm"、 "elf32-arm"、 "elf32-arm")* / 
OUTPUT_ARCH(arm)        
ENTRY( _start)                        
SECTIONS        
{                                                           = 0x00000000 ; //接続の最初のアドレスを0x00000000として指定します。TEXT_BASEも指定されており、TEXT_BASEの方が優先順位が高いことに注意してください        
                                                        = ALIGN(4 ); //アライメント
        .text:    //テキストセクションは順序に注意する必要がありますbl0は16kbしかロードできないため、再配置を担当するコードを最初に実行してください。
        { 
          cpu / s5pc11x / start.o(.text)    
          cpu / s5pc11x / s5pc110 / cpu_init.o(.text)
          board / samsung / x210 / lowlevel_init.o (.text)
          cpu / s5pc11x / onenand_cp.o(.text)       
          cpu / s5pc11x / nand_cp.o(.text)
          cpu / s5pc11x / movi.o(.text)                       
          common / secure_boot.o(.text)
          common / ace_sha1.o(.text)
          cpu/ s5pc11x / pmic.o(.text) * 
        . 
                             text
           
        } = ALIGN(4 );                                 
        .rodata:{ * 

        . rodata)} = ALIGN(4 );          
        .data:{ * 
                                                         
        . data)}                               = ALIGN(4 ); 
        .got:{ * (.got)} 
                                                  
        __u_boot_cmd_start = 。; //自定义段
        .u_boot_cmd:{ * (.u_boot_cmd)} 
        __u_boot_cmd_end =。;                  
      = ALIGN(4 ); 
        .mmudata:{ *(.mmudata)}                
= ALIGN(4 );                                                    
        __bss_start = 。;                                              
        .bss:{ * (.bss)} 
        _end = 。;                                    
}                    

 

おすすめ

転載: www.cnblogs.com/yangxinrui/p/12689136.html