What is it?

backgorund:

an archive file (.a) is similar as .lib compared to Winodws. it simply contains object files. Creating an archive file is not "linking", thus no symbol missing/confilct will be checked.

but an. so/.dll is somehow more like a executable/runnable image of system process, which will not allow undefined symbol or reduplicated symbol.

at linking time, linker will look into each archive file(.a) provide by command line for un-resolved symbols. once it finds the first one, it will stop and look for the next. if there're more symbols with the same signaure defined in other ojbect files whithin the same archive, linker just igonre them.

if the archive contains an object file whose symbols are totally never referenced, the object file will not be linked in.

That's why when you write an "plugin style" file which only calls foundation functions but not get called directly (no symbol referenced by others), it will not be linked in, if its object file is in an archive. and static object surely won't init too.

that's why "--whole-archive" is needed, if you wanna force link all object files within the archive file.

Howto?

--whole-archive will affect the subsequence archive files in command line, if you wanna link whole archive for libA, other archives not whole linked in, then use [-Wl,]--whole-archive -lA [-Wl,]--no-whole-arhive -lB lC ...  Use -Wl, if you're passing it via compiler, not directly to LD.

but if an archive contains reduplicated symbol and you're using "--whole-archive", you will get a symbol conflict error because all symbols will be linked in.

[百度空间] --whole-archive & --no-whole-archive的更多相关文章

  1. Android手机无法访问百度空间的解决办法

    本文网址:http://www.cnblogs.com/tunnel213/p/4301165.html 现象: 百度“JavaScript函数高级”后找到一篇文章,百度空间的,无法查看: 配置: 三 ...

  2. jquery-plugin-biggerLink,highLight-层加亮_andy 阳光生活_百度空间

    How to get the xpath by clicking an html element How to get the xpath by clicking an html element Qu ...

  3. document.domain - JavaScript的同源策略问题:错误信息:Permission denied to access property 'document'_eecc00_百度空间

    document.domain - JavaScript的同源策略问题:错误信息:Permission denied to access property 'document'_eecc00_百度空间 ...

  4. memcached vs MySQL Memory engine table 速度比较_XMPP Jabber即时通讯开发实践_百度空间

    memcached vs MySQL Memory engine table 速度比较_XMPP Jabber即时通讯开发实践_百度空间 memcached vs MySQL Memory engin ...

  5. 提高mysql memory(heap) engine内存性能的开源补丁_XMPP Jabber即时通讯开发实践_百度空间

    提高mysql memory(heap) engine内存性能的开源补丁_XMPP Jabber即时通讯开发实践_百度空间 提高mysql memory(heap) engine内存性能的开源补丁

  6. sort 使用 tab键 作为 分隔符_人生如梦_百度空间

    sort 使用 tab键 作为 分隔符_人生如梦_百度空间 sort 使用 tab键 作为 分隔符 For some reason "\t" doesn't work right, ...

  7. centos5.5字体为方块问题的解决_深入学习编程_百度空间

    centos5.5字体为方块问题的解决_深入学习编程_百度空间 centos5.5字体为方块问题的解决 一.yum -y install fonts-chinese二.yum -y install f ...

  8. 毕业论文评审意见、导师意见范文、模板_Smile~风_百度空间

    body{ font-family: "Microsoft YaHei UI","Microsoft YaHei",SimSun,"Segoe UI& ...

  9. Attribute name invalid for tag form according to TLD异常解决办法_gaigai_百度空间

    body{ font-family: "Microsoft YaHei UI","Microsoft YaHei",SimSun,"Segoe UI& ...

随机推荐

  1. ASP.net UrlRewrite的防盗链功能

    ASP.net中如何实现基于UrlRewrite的防盗链. ASP.net中最快实现UrlRewrite的方法这篇文章中说了如何做UrlRewrite,那只是一个最简单的应用 其实利用UrlRewri ...

  2. 重拾C,一天一点点_10

    来博客园今天刚好两年了,两年前开始学编程. 忙碌近两个月,项目昨天上线了,真心不容易,也不敢懈怠,接下来的问题会更多.这两天调试服务器,遇到不少麻烦. 刚出去溜达了一下,晚上天凉了,现在手感觉凉的有点 ...

  3. pthreads多线程数据采集

    以前使用curl的多线程并不是真正的多线程,只是一种模拟的多线程,现在使用pthreads来实现真正意义上的多线程. 下载: windows下: http://windows.php.net/down ...

  4. RecyclerView的基本创建

    线性显示 类似于listview: 线性宫格显示 类似于grid view: 用线性宫格显示 类似于瀑布流: 结构图: 测试代码: activity_main.xml: <RelativeLay ...

  5. 4.css度量单位

    在 CSS 长度设置中,我们经常需要使用到度量单位,即以什么样的单位设计我们的字 体或边框长度.而在 CSS 中长度单位又分为绝对长度和相对长度. 绝对长度指的是现实世界的度量单位,CSS 支持五种绝 ...

  6. python 循环、循环设计、循环对象

    作者:Vamei 出处:http://www.cnblogs.com/vamei 欢迎转载,也请保留这段声明.谢谢! 1.循环 循环用于重复执行一些程序块.从上一讲的选择结构,我们已经看到了如何用缩进 ...

  7. scp 跨机远程拷贝

    scp是secure copy的简写,用于在Linux下进行远程拷贝文件的命令,和它类似的命令有cp,不过cp只是在本机进行拷贝不能跨服务器. 命令格式: scp [参数] [原路径] [目标路径] ...

  8. 启动FM预算基金管理模块后,0L总账消失的解决办法

    只要用SE38运行一下:FMGL_CHANGE_APPL_IN_LEDGER 问题就解决了.

  9. MVC4.0网站发布和部署到IIS7.0上的方法【转:http://www.th7.cn/Program/net/201403/183756.shtml】

    最近在研究MVC4,使用vs2010,开发的站点在发布和部署到iis7上的过程中遇到了很多问题,现在将解决的过程记录下来,以便日后参考,整个过程主要以截图形式呈现 vs2010的安装和mvc4的安装不 ...

  10. [转]理解与使用Javascript中的回调函数

    在Javascript中,函数是第一类对象,这意味着函数可以像对象一样按照第一类管理被使用.既然函数实际上是对象:它们能被“存储”在变量中,能作为函数参数被传递,能在函数中被创建,能从函数中返回. 因 ...