how to specify object file (*.o) address

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

how to specify object file (*.o) address

587 Views
ttikalit
Contributor I

I want to put the application and driver code into different addresses so that I can split the hexadecimal file into two complete blocks

When I use IAR, in the *.icf file, using the following code, I can specify the link address of the file

                 place at address mem:0x12345678 {section .text object a.o}

Is there a way to do this in s32ds, s32k146

 

   

 

 

 

 

 

0 Kudos
2 Replies

562 Views
stanish
NXP Employee
NXP Employee

Hi,

Please have a look here:

https://community.nxp.com/t5/S32-Design-Studio-Knowledge-Base/HOWTO-Execute-a-library-function-from-...

you can force to place a certain segment from specific object file into a different memory region (example uses a object file "lib_a-memcpy-stub.o" from a static library):

1) exclude the object file section from  the default section e.g. (.text):

 

 

 .text :
  {
    . = ALIGN(4);
     /* Exclude file(s) from NewLib libc.a from .text.* section - this replaces .text*  */     
     *(EXCLUDE_FILE (*libc.a:lib_a-memcpy-stub.o) .text*)   
 
    *(.rodata)               /* .rodata sections (constants, strings, etc.) */
    *(.rodata*)              /* .rodata* sections (constants, strings, etc.) */
    *(.glue_7)               /* glue arm to thumb code */
    *(.glue_7t)              /* glue thumb to arm code */
    *(.eh_frame)
    KEEP (*(.init))
    KEEP (*(.fini))
    . = ALIGN(4);
  } > m_text‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

 

 

2) place the object file section into a new placement rule:

 

 

.my_text:
{
    *libc.a:lib_a-memcpy-stub.o (.text*)   /* add memcpy from the NewLib library here*/ 
 
  } > m_my_text /* my new memory region 0x12345678*/

 

 

if your object file is directly compiled from the source code you can replace:

*libc.a:lib_a-memcpy-stub.o (.text*)

with:

*lib_a-memcpy-stub.o (.text*)

 

Hope it helps

Stan

0 Kudos

535 Views
ttikalit
Contributor I

Hi Stan,

its work

Many Thanks

ttikalit

0 Kudos