So, here is the problem.
I have compiled some object files, using gcc -c
, and I have cloned them using obj-copy
.
If the a function of the initial object file was named foo()
, then the resulting function names in the cloned objects are:
foo1(); foo2(); foo3();
Then, I link those 3 objects, with another file, that contains the main method, and I can invoke each of the function variants by using e.g. foo2();
. This work perfectly fine!
However, if I try to create a function pointer to point to those functions by using:
functionPtr=&foo1; \\ tried also w/o the &
then, I get:
error: 'foo2' undeclared (first use in this function)
Any ideas? Does this have to do with the linking?