linker file ABS

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

linker file ABS

跳至解决方案
2,460 次查看
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,249 次查看
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,432 次查看
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,408 次查看
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,377 次查看
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,366 次查看
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,269 次查看
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,257 次查看
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,250 次查看
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 项奖励
回复