GCC link option

本文探讨了GCC链接时如何处理未解析的符号问题,引用了aarch64-linux-gnu-ld的手册页,提供了四种不同的处理方法,并提到了针对共享库的特殊处理以及如何将错误变为警告。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

针对gcc未链接相关文件却编译通过的问题


The following is from http://linux.die.net/man/1/aarch64-linux-gnu-ld, for your reference.

 

--unresolved-symbols=method

Determine how tohandle unresolved symbols. There are four possible values for method:

ignore-all

Do not reportany unresolved symbols.

report-all

Report allunresolved symbols. This is the default.

ignore-in-object-files

Reportunresolved symbols that are contained in shared libraries, but ignore them ifthey come from regular object files.

ignore-in-shared-libs

Reportunresolved symbols that come from regular object files, but ignore them if theycome from shared libraries. This can be useful when creating a dynamic binaryand it is known that all the shared libraries that it should be referencing areincluded on the linker's command line.

The behaviourfor shared libraries on their own can also be controlled bythe --[no-]allow-shlib-undefined option.

Normally the linker will generate an errormessage for each reported unresolved symbol but the option --warn-unresolved-symbols canchange this to a warning.


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值