This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: statically linking standard libraries
JJ <alchemistmba@gmail.com> writes:
> I've gotten to a point where g++ no longer complains about missing
> functions in my program. It now complains about some system(?)
> functions:
>
> $ cross-g++ -Bstatic -Xlinker -T -Xlinker temp.ld -o
> standalone_program xyz.o abc.o
>
> In function `__libc_csu_init':
> ../../elf-init.c:66: undefined reference to `__init_array_start'
> ..
> : undefined reference to `__init_array_end'
> ..
> : undefined reference to `__fini_array_start'
> ..
> ..
>
> If I specify the "-shared" option, it doesn't throw these errors. But
> I need to build a standalone program with the standard libraries built
> in - hence the "-Bstatic" option.
These symbols are normally defined by the linker script.
Ian