TheLoneJoker
TheLoneJoker

Reputation: 1629

Difference between CONFIG_SYS_TEXT_BASE and _start

I have an armv7 board and I am seeing a discrepancy.

In my board file I have defined:

#define CONFIG_SYS_TEXT_BASE 0x67000004

After I build the u-boot binary, I ran

nm u-boot | grep -w _start

It returned the following:

67000020 T _start

Would anyone know why there is a difference in the values of _start and CONFIG_SYS_TEXT_BASE? I thought they were the same, please correct me if wrong.

Upvotes: 1

Views: 4549

Answers (1)

artless-noise-bye-due2AI
artless-noise-bye-due2AI

Reputation: 22489

The relevant source is start.S and u-boot.lds linker script. Assuming that CONFIG_SYS_TEXT_BASE is passed as the start address to the linker, there are various segments that can come before. For instance, many Rom loaders need a header to describe or authenticate an image.Ref1 This may come before the _start symbol (or after).

I thought they were the same, please correct me if wrong.

You are wrong. They are not always the same. Given a particular SOC and u-boot version, they could be the same.

Ref1: This would be the section .__image_copy_start in the referenced linker script.

Upvotes: 2

Related Questions