linker file ABS

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 
2,470件の閲覧回数
kjy106906
Contributor IV

Hello

In the linker file, what does the ABS below mean? It seems to be an absolute address, but please explain in detail.

linker_flash_s32K312.ld

.ramcode ABS ALIGN(4) : > .
.data                 ALIGN(4) : > .
.mcal_data     ALIGN(4) : > .

 

Thank you!

タグ(1)
0 件の賞賛
返信
1 解決策
2,259件の閲覧回数
VaneB
NXP TechSupport
NXP TechSupport

Hi @kjy106906 

As said before, ABS indicates that section address cannot be relocated once it has been loaded to memory.

As the sections are mapped and aligned to a previously defined region, they should not overlap or interfere with each other.

元の投稿で解決策を見る

0 件の賞賛
返信
7 返答(返信)
2,442件の閲覧回数
VaneB
NXP TechSupport
NXP TechSupport

Hi @kjy106906 

ABS stands for absolute: not adjusted to any section address's relocation.

The absolute (un-moveable) symbols are there to support embedded development, where locating elements at absolute addresses in memory is required. Normally, such symbols would be produced only when cross-compiling for an embedded system, using C language extensions that allow the absolute address to be specified.

 

BR, VaneB

0 件の賞賛
返信
2,418件の閲覧回数
kjy106906
Contributor IV

@VaneB 

Thank you

I don't understand.
Ram code has ABS attached,
but can't the address change depending on the size of the bss above?

.standby_data ABS MAX_SIZE(0x8000) ALIGN(8) : > int_sram
.bss (NOLOAD)                                           ALIGN(16) : > .
.mcal_bss (NOLOAD)                               ALIGN(16) : > .
__BSS_SRAM_END = align(4);

.ramcode                                             ABS ALIGN(4) : > .
.data                                                             ALIGN(4) : > .
.mcal_data                                                 ALIGN(4) : > .

タグ(1)
0 件の賞賛
返信
2,387件の閲覧回数
VaneB
NXP TechSupport
NXP TechSupport

Hi @kjy106906 

The ALIGN(n) instructs the compiler to align a variable on an n-byte boundary starting from the ORIGIN address. This just limits the location of a memory region to a certain n-byte size, this should not interfere with other memory regions as the memory region size does not exceed the n-byte boundary.

0 件の賞賛
返信
2,376件の閲覧回数
kjy106906
Contributor IV

Thank you

I didn't understand.
As the bss variable is added,
doesn't the ramcode address get pushed out?
I wonder what the effect of ABS is here.

0 件の賞賛
返信
2,279件の閲覧回数
VaneB
NXP TechSupport
NXP TechSupport

Hi @kjy106906 

bss id defined as NOLOAD. The NOLOAD defines a section that is required to link the program properly but must not be loaded to memory. For example you may need to link your program with some code located in ROM, so you tell the linker to mark the code in ROM as NOLOAD. Then the tool that will load the program (a debugger, an OS or whatever) will not load this part of the code.

0 件の賞賛
返信
2,267件の閲覧回数
kjy106906
Contributor IV

Sorry. I didn't understand.
Explaining with an example of .map file
case 1. standbyram size 0, bss size 16, mcal_bss size 0 -> ramcode address = 0x20400010
case 1. standbyram size 0, bss size 32, mcal_bss size 0 -> ramcode address = 0x20400020
In this case, the ramcode address changes, but I don't know what role ABS plays.

.standby_data ABS MAX_SIZE(0x8000) ALIGN(8) : > int_sram
.bss (NOLOAD)                                           ALIGN(16) : > .
.mcal_bss (NOLOAD)                               ALIGN(16) : > .
__BSS_SRAM_END = align(4);

.ramcode                                             ABS ALIGN(4) : > .
.data                                                             ALIGN(4) : > .
.mcal_data                                                 ALIGN(4) : > .

0 件の賞賛
返信
2,260件の閲覧回数
VaneB
NXP TechSupport
NXP TechSupport

Hi @kjy106906 

As said before, ABS indicates that section address cannot be relocated once it has been loaded to memory.

As the sections are mapped and aligned to a previously defined region, they should not overlap or interfere with each other.

0 件の賞賛
返信