Re: .a file not linking correctly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 1 April 2015 at 14:15, Marcelo Utikawa da Fonseca wrote:
> Hi!
>
> I am new to the list but I work with gcc and cross-compiling for
> several years. Now I am facing something new: I can generate a .elf
> file from *.o files. If I join the same files in a .a file and try to
> use it instead of *.o files, I always get an empty file. Please note:
> it is not an zero size file, just empty elf... It is a valid .elf file
> but without any sections.

Does anything in your poptools.c file actually refer to any symbols
defined in the .a archive?

If not, the linker will not need to search the archive and so will not
include any of the archive contents in the output.

You can use -Wl,--whole-archive libpop.a -Wl,--no-whole-archive to
force the linker to include everything in the archive even if it isn't
needed.




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux