国产肉体XXXX裸体137大胆,国产成人久久精品流白浆,国产乱子伦视频在线观看,无码中文字幕免费一区二区三区 国产成人手机在线-午夜国产精品无套-swag国产精品-国产毛片久久国产

新聞中心

EEPW首頁 > 嵌入式系統(tǒng) > 設(shè)計(jì)應(yīng)用 > 控制linux動(dòng)態(tài)鏈接庫(kù)導(dǎo)出函數(shù)

控制linux動(dòng)態(tài)鏈接庫(kù)導(dǎo)出函數(shù)

作者: 時(shí)間:2016-11-22 來源:網(wǎng)絡(luò) 收藏
linux中,我們可以通過-fvisibility=default|internal|hidden|protected來控制導(dǎo)出函數(shù)。

在GCC幫助文檔 -fvisibility=default|internal|hidden|protected參數(shù)下有這樣一段描述:

本文引用地址:http://m.ptau.cn/article/201611/320008.htm

a superior solution made possible by this option to marking things hidden when the default is public is to make the default hidden and mark things public. This is the norm with DLLs on Windows and with -fvisibility=hidden and "__attribute__ ((visibility("default")))" instead of "__declspec(dllexport)" you get almost identical semantics with identical syntax. This is a great boon to those working with cross-platform projects.

需要了解的是,在linux下,源文件中的所有函數(shù)都有一個(gè)默認(rèn)的visibility屬性,即為public,在編譯命令中加入 -fvisibility=hidden參數(shù),會(huì)將所有默認(rèn)的public的屬性變?yōu)閔idden。此時(shí),如果對(duì)函數(shù)設(shè)置__attribute__ ((visibility("default")))參數(shù),使特定的函數(shù)仍然按默認(rèn)的public屬性處理,則-fvisibility=hidden參數(shù)不會(huì)對(duì)該函數(shù)起作用。所以,設(shè)置了-fvisibility=hidden參數(shù)之后,只有設(shè)置了__attribute__ ((visibility("default")))的函數(shù)才是對(duì)外可見的。



評(píng)論


技術(shù)專區(qū)

關(guān)閉