This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: usage of --start-group and --end-group


On 17 May 2018 at 08:48, tong chen wrote:
> yeah, It works if places -lintl -lz to the end of the cmd.
> I think It will work with --start-group/--end-group, but It doesn't  .

I think the group will cause the linker to loop over those libraries
in the group, but only at the specified position in the argument list.

If there are no unresolved references at that point, the linker will
stop looping over the group and continue to other arguments. After
processing the other arguments there are more unresolved references,
but it's too late for libint and libz to help, because they've already
been processed.

You always need to list libraries *after* anything that depends on them.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]