Linking in a Binary Blob

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

Linking in a Binary Blob

Jump to solution
1,083 Views
izzni
Contributor I

I'm implementing an encryption algorithm that requires a little more than 4K of initialization data to sit in the flash memory. I'm using Processor Expert with Eclipse CDT and the GNU GCC Toolchain.

 

I've managed to get my binary file converted to an object file of the right format and architecture. I've added my extern variables that refer to the symbols in that object file. The only issue that I'm having is that the linker step doesn't include my object file for the binary data. I'm guessing this is because a C source file doesn't exist in the Sources directory of the project. Here's what the invocation of the linker looks like:

'Invoking: Cross G++ Linker'

arm-none-eabi-g++ -nostartfiles -mthumb -mcpu=cortex-m0 -T"C:/Users/Stefan/GaugeWorkspace/KE06ZBootStrapper/Project_Settings/Linker_Files/ProcessorExpert.ld" -o "KE06ZBootStrapper.elf"  ./Static_Code/System/CPU_Init.o ./Static_Code/System/Peripherals_Init.o ./Static_Code/System/Vectors.o  ./Sources/Events.o ./Sources/main.o ./Sources/s19Parser.o ./Sources/serialComm.o  ./Project_Settings/Startup_Code/startup.o  ./Generated_Code/AS1.o ./Generated_Code/Bit1.o ./Generated_Code/Cpu.o ./Generated_Code/FLASH1.o ./Generated_Code/PE_LDD.o ./Generated_Code/Pins1.o ./Generated_Code/TU1.o  

 

From what I can tell it looks like the Processor Expert code handles the generation of the makefiles, and more importantly, the subdir.mk file in the Sources directory that lists what object files to use during the linker step above (at least I suspect the subdir.mk file is used for that).

 

Anyone have any suggestions for how to configure Processor Expert to add the object file that I'm generating during a pre-build step to that list of object files being passed to the linker?

 

Thanks!

Stefan

Labels (1)
0 Kudos
1 Solution
669 Views
BlackNight
NXP Employee
NXP Employee

Hi Stefan,

you can link additional object files like this: http://mcuoneclipse.com/2015/09/29/linking-additional-object-files-with-gnu-linker/

Linking additional Object Files with GNU Linker | MCU on Eclipse

>>"From what I can tell it looks like the Processor Expert code handles the generation of the makefiles, and more importantly, the subdir.mk file in the Sources directory that lists what object files to use during the linker step above (at least I suspect the subdir.mk file is used for that)."

Not really. It is not Processor Expert who creates the make files. It is the Eclipse CDT build integration which does that. And you can add additional object files (and libraries) to the build process in the project settings. Above article shows how to do this for object files. If you want to use libraries (or archives), then I suggest to have a look here: Creating and using Libraries with ARM gcc and Eclipse | MCU on Eclipse

I hope this helps,

Erich

View solution in original post

0 Kudos
2 Replies
670 Views
BlackNight
NXP Employee
NXP Employee

Hi Stefan,

you can link additional object files like this: http://mcuoneclipse.com/2015/09/29/linking-additional-object-files-with-gnu-linker/

Linking additional Object Files with GNU Linker | MCU on Eclipse

>>"From what I can tell it looks like the Processor Expert code handles the generation of the makefiles, and more importantly, the subdir.mk file in the Sources directory that lists what object files to use during the linker step above (at least I suspect the subdir.mk file is used for that)."

Not really. It is not Processor Expert who creates the make files. It is the Eclipse CDT build integration which does that. And you can add additional object files (and libraries) to the build process in the project settings. Above article shows how to do this for object files. If you want to use libraries (or archives), then I suggest to have a look here: Creating and using Libraries with ARM gcc and Eclipse | MCU on Eclipse

I hope this helps,

Erich

0 Kudos
669 Views
izzni
Contributor I

That worked great, thanks!

Not sure why I didn't stumble across that guide, but I appreciate you pointing it out. I also appreciate the explanation on how the integration environment works, since it clears up a few lingering questions/misunderstandings I had about that.

Stefan

0 Kudos