1. linker 文件里面专门有个地方定义start address的symbol和run address。因此,linker文件会自动将startup.c 文件里面的_START函数存放在0x80020020地址。 而在寄存器的配置过程中,我们会将ECU的reset vector [BMHD] 指向 0x80020020。 因此,当ECU重启后,就会自动跳转到startup函数,接着顺利跳转到各个main函数

linker file:

AUTOSAR面试话题3_startup code + 编译过程

 AUTOSAR面试话题3_startup code + 编译过程

 https://blog.csdn.net/qq_20848757/article/details/90542909 

 

2.  编译过程:

  •      Assembering:    assembler converts hand-written or compiler-generated assembly language programs into machine language , generate the relocated object file
  •      linker/locator:  linker links the relocated object file and library together, locator assigns absolute addresses to the linker object file

 

 

AUTOSAR面试话题3_startup code + 编译过程

 AUTOSAR面试话题3_startup code + 编译过程

重点看下图的7.1章节,有时间的话

AUTOSAR面试话题3_startup code + 编译过程

 https://www.tasking.com/support/tricore/ctc_user_guide_v6.2r2.pdf 

 

3. 可以顺便讲讲堆栈的初始化,通过map文件确定linker是否成功

相关文章:

  • 2022-12-23
  • 2022-01-02
  • 2022-12-23
  • 2021-07-15
  • 2021-09-14
  • 2022-12-23
  • 2022-12-23
  • 2021-07-14
猜你喜欢
  • 2021-12-30
  • 2021-08-09
  • 2021-06-11
  • 2021-06-02
  • 2021-12-23
  • 2022-12-23
相关资源
相似解决方案