I have built a static library foo.a with a bunch of functions. Some function definitions are not preset and as expected the linker gives undefined reference when I link it and try to create an elf. I would like to know if there is an option to provide the symbols along with addresses as a separate input in the linker command line(for the functions whose definitions are missing).
e.g: lets say I have a symbol definition file def.txt that has following function/global variable defines,
func_a 0x100 0x10
func_b 0x120 0x20
glob_b 0x200 0x4
glob_c 0x240 0x4
I would like to link the foo.a along with this file so that the linker doesn't complain about the definitions. In my system these functions exist in a different area(Lets say a ROM), That is the reason I am not defining them in this elf and just want to point out where they exist
gcc -static -nostdlib -nostartfiles -o foo.elf foo.a -lm -lgcc -T test.lod
In the above command line is there a way to input this def.txt file also