關於dladdr函數參數的問題

來源:互聯網
上載者:User

The dladdr() function queries the dynamic linker for information aboutthe shared object containing the address addr. The information isreturned in the structure
specified by info. The structure containsat least the following members


關於dladdr函數可以知道關於包含了這個地址的共用對象的動態連結的資訊,這些資訊會記錄到info這個結構中,這個結構包含一下幾個成員


constchar *dli_fname

The  pathname of the shared object containing the address.

這個路徑是包含這個共用對象地址的檔案路徑,以我的理解就是調用這個函數的檔案


void*dli_fbase


The base address at which the shared object is mapped into the addressspace of the calling process.

這個地址是這個共用庫被映射到調用他的進程的地址空間中的地址


constchar *dli_sname


Thename of the nearest run-time symbol with a value less than or equalto addr. When possible, the symbol name is returned as it wouldappear in C source code.
If no symbol with a suitable value is found,both this field and dli_saddr are set to NULL.


這個是在運行時的符號表中,小於或者等於addr(這個addr是參數傳進來的)這個地址的最接近的符號,如果可能的話,那麼就返回一個源碼中的字串,如果不行的話那就是使dli_saddr為null


void*dli_saddr


Thevalue of the symbol returned in dli_sname.

返回dli_sanme這個值的地址,通常是函數的地址


Thedladdr() function is available only in dynamically linked programs.


這個dladdr這個函數只對動態連結程式起作用。 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.