Is it possible to locate start up code generated by PE in a defined memory location?

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

Is it possible to locate start up code generated by PE in a defined memory location?

377 Views
leccy
Contributor III

Is it possible to locate start up code generated by PE in a defined memory location? 

__thumb_startup() and its subroutines etc.

I was thinking along the lines of using "#pragma define section...", but can't find anything in CW10.5 for doing this.

I want to be able to control locations of certain routines for field upgrade purposes.

Thanks

Alex

0 Kudos
3 Replies

244 Views
Ben
Senior Contributor I

I am using the LCF file too, like Alex wrote,  in order to add section with specific address, then you can use this section in code with #pragma.

Look in freescale site for document about segmentation, and document about ELF linker.

If you still need detailed information let me know and I'll write a sample code with detailed information

0 Kudos

244 Views
leccy
Contributor III

Ben

I had used #pragma sections on other sections of code i wanted in specific locations, the problem with the PE-generated start-up code was that i had no editing control over it.

Took a while of throwing things at it to find this solution for the start-up code...

One observation from the freescale documentation was that it claimed you could place a named .c file in the structure above, but i got linker errors when trying this.

It only worked for .a files from PE, and .obj files from my code.

Since i was looking to place entire .c files into specific locations, it was much easier to name the files as "filename_c.obj" in the linker structure rather than adding #pragma section lines to the files themselves.

Cheers

Alex

0 Kudos

244 Views
leccy
Contributor III

Using this structure in my lcf file:

.startup :

  {

      librt_Thumb_LE_v7M.a (.text)

      . = ALIGN (0x4);

   } > m_startup

placed start up code in memory location of my choosing, by assigning a memory range to m_startup.

0 Kudos