This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

libc library compiled with PIC

Hello,

I try to compile an executable as a position independent executable. I have access to all the source code except for libc and crtbegin which are provided as pre-compiled libraries in the arm-none-eabi-gcc directory.

I compile my own libraries with -fPIC compiler and linker argument; and the executable with -fPIE compiler argument and -fPIE -pie linker arguments. But it appears the libc and crtbegin libraries are not compiled as position independent shared libraries i.e. without the -fPIC argument.

Please see the error I get below:

Is there any way to get the librairies above compiled as PIC? or shall I compile the gnu toolchain myself with these arguments on?

Any advice is welcome.

Thank you

0