-wl,--start-group在make文件中是什么意思? [英] what does -wl, --start-group mean in make file?

查看:293
本文介绍了-wl,--start-group在make文件中是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的Make文件中有这个文件.

I have this in my Make file..

# Create list of object files
#
LIB_OBJS =  -Wl,--start-group \
$(T_OBJ_DIR)/Source1.o \
$(T_OBJ_DIR)/Source2.o \
$(T_OBJ_DIR)/Source3.o \
$(T_OBJ_DIR)/Source4.o \
$(T_OBJ_DIR)/Source5.o \
-Wl,--end-group \

任何人都可以解释"-Wl,-start-group"和"-Wl,-end-group"是什么意思吗?

Could anyone please explain What "-Wl,--start-group" and "-Wl,--end-group" mean?

推荐答案

这些是链接器的标志(这是 -Wl 的意思),因此 ld 的文档(链接程序)将解释其余的内容.

Those are flags to the linker (that's what -Wl means) so the documentation for ld (the linker) will explain the rest.

对于GNU ld,从手册页中:

From the man page for GNU ld:

-(存档-)

-开始组存档-结束组

档案应该是档案文件的列表.它们可以是显式文件名,也可以是 -l <​​/strong>选项.

The archives should be a list of archive files. They may be either explicit file names, or -l options.

重复搜索指定的档案,直到没有创建新的未定义引用.通常,仅按在命令行上指定的顺序搜索一次存档.如果需要该归档文件中的符号来解析由归档文件中的对象所引用的未定义符号,该符号会在以后的命令行中显示,则链接程序将无法解析该引用.通过对档案进行分组,可以重复搜索所有档案,直到解决所有可能的引用为止.

The specified archives are searched repeatedly until no new undefined references are created. Normally, an archive is searched only once in the order that it is specified on the command line. If a symbol in that archive is needed to resolve an undefined symbol referred to by an object in an archive that appears later on the command line, the linker would not be able to resolve that reference. By grouping the archives, they all be searched repeatedly until all possible references are resolved.

使用此选项会产生很大的性能成本.最好仅在两个或多个存档之间存在不可避免的循环引用时才使用它.

Using this option has a significant performance cost. It is best to use it only when there are unavoidable circular references between two or more archives.

这篇关于-wl,--start-group在make文件中是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆