linker file ABS

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

linker file ABS

Jump to solution
2,369 Views
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!

Tags (1)
0 Kudos
Reply
1 Solution
2,158 Views
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.

View solution in original post

0 Kudos
Reply
7 Replies
2,341 Views
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 Kudos
Reply
2,317 Views
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) : > .

Tags (1)
0 Kudos
Reply
2,286 Views
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 Kudos
Reply
2,275 Views
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 Kudos
Reply
2,178 Views
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 Kudos
Reply
2,166 Views
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 Kudos
Reply
2,159 Views
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 Kudos
Reply