Link address in ARM (why ARM needs relocation)

Publisher:EnchantedHeartLatest update time:2018-07-22 Source: eefocusKeywords:ARM Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

    Before considering why relocation is necessary, we must first understand the following points:
    
    1. Definition of link address: My own understanding is that it is the memory address where the program is defined to start execution.
    
    2. When ARM starts from nandflash, the CPU automatically copies the first 8K code in nandflash to address 0 of 6410 (i.e. Stepping Stone), and then executes the program from address 0.
    
    3. During the execution of the program, the link address is used to access global variables. Global variables are generally stored at the end of the program.
    
    When the program exceeds 8K, if relocation is not performed, an access error similar to the following will occur, which will cause the program to fail to execute normally.
    
    Suppose we define the link address of the program as 0x50000000. When the program is executed from address 0 of 6410 (i.e. Stepping Stone), if a global variable is to be accessed, the disassembled code is as follows:
    500000a4 e59f303c ldr r0, [pc, #60] ;r0 = [0x500000e8] =0x00000200
    500000a8 e5933000 ldr r0, [r0] ;r0 = [0x00000200]
    500000ac ......
    ......
    500000e8 00000200 .......
    
    00000200 :
    200: 00000000 ......    
    

    We can see that the value of r0 is obtained from the address 0x500000e8, but the address 0x500000e8 cannot be found in Stepping Stone, so the program will fail. Therefore, after the program is copied to Stepping Stone by CPU, we need to write a program to initialize nandflash and memory, and then use position-independent code to copy the program from nandflash to memory, and then jump to other functions to continue execution. This is ARM relocation.

*************************************************** *************************************************** *************************************************** *************************************

The above is purely my personal opinion. If there are any mistakes, please correct me!


Keywords:ARM Reference address:Link address in ARM (why ARM needs relocation)

Previous article:Detailed explanation of arm's MMU (virtual address)
Next article:ARM peripheral flash and SDRAM address connection

Recommended ReadingLatest update time:2024-11-23 03:28

ARM S3C44B0X Watchdog Timer
    When disturbed by faults such as noise or system errors, the s3c44b0x watchdog timer can generate a reset signal to reset the CPU. It can also be used as an ordinary 16-bit timer to generate an interrupt signal after calculation. If used as a reset signal, a reset signal of up to 128MCLK clock cycles can be generat
[Microcontroller]
ARM stack instructions
ARM stack instructions The contents of stack instructions in ARM's instruction system are easy to cause confusion. This is because two parameters are required to accurately describe the characteristics of a stack: The growth direction of the stack address: ARM calls the stack that grows toward a higher address an a
[Microcontroller]
ARM stack instructions
ARM embedded development software learning steps
    For many beginners, to deeply learn arm+linux, you need to consider from two directions, software and hardware. About in-depth learning of arm+linux, software learning:     Software     1. Bootloader     1) Can be written and compiled based on ADS and GCC. (Besides the difference in the use of assembly and compil
[Microcontroller]
10 highlights from the 2020 Arm Developer Conference
Source: Hackster.io, author: Ish Ot Jr. From October 6 to 8, 2020, Arm held an online DevSummit (Developer Conference), which was also the first conference since Arm renamed TechCon as DevSummit. In addition to the virtualization required by the global epidemic, the new conference reflects Arm's transformation: from
[Internet of Things]
10 highlights from the 2020 Arm Developer Conference
Advantech Arm-based edge intelligent gateway creates a stable and efficient battery management system solution
Advantech's Arm-based edge intelligent gateway helps energy storage companies build stable and efficient battery management system (BMS) solutions In response to global warming, Advantech has integrated software, hardware, and services to develop edge intelligence solutions that can be applied to energy storage syst
[Power Management]
Advantech Arm-based edge intelligent gateway creates a stable and efficient battery management system solution
Design of embedded LINUX seismic data acquisition system based on ARM9
0 Introduction With the rapid development of digital technology, digital instruments have become the mainstream instruments in the field of observation technology, so data acquisition technology has also become a very important technical link in the field of observation technology. As we all know, earthquake pr
[Microcontroller]
Design of embedded LINUX seismic data acquisition system based on ARM9
Embedded industrial control (ARM) motherboard data acquisition and control system application solution
The embedded industrial control motherboard can quickly build a field bus control system through onboard serial ports, network ports and other functions, plus a good human-machine interface. With a 10/100M Ethernet interface, the system can easily access the enterprise information management layer and realize local
[Microcontroller]
Embedded industrial control (ARM) motherboard data acquisition and control system application solution
Home network system solution based on ARM
0. Introduction Home networking is an important part of social informatization. Home network systems can realize the connection and management of various smart home appliances, security devices, etc., and provide people with convenient, flexible and efficient network services. At present, there are two main solu
[Microcontroller]
Home network system solution based on ARM
Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号