How do I prevent dynamic movement (rela.dyn)?

I am trying to run a simple program on an embedded powerpc system without any operating system. I am using the GNU and PSIM compiler linker tools as a simulator. I wrote my very simple linker directive file.

I used a global variable in my static library and want to use this variable in my example program. But when linking the GNU ld sample program, an error appears and stops. It says that it cannot find rela.dyn in the linker directive file. I actually don't want to use a dynamically moved library because I don't have a dynamic loader. What am I doing wrong?

+2


source to share


2 answers


It's hard to say without additional information. If you don't have a base OS, have you used -ffreestanding to avoid linking at the platform runtime?



Edit: does -ffreestanding require -shared? -ffreestanding means compiling to a non-hosted environment. How can such an environment support shared libraries?

+1


source


-ffreestanding, as Solar says. If that fails, run ld with the --verbose option to see exactly what it is trying to connect to: this will allow you additional debugging.



0


source







All Articles