[問題] share library 如何讓process共享
看板C_and_CPP (C/C++)作者powertodream (The Beginning)時間15年前 (2010/10/25 19:03)推噓0(0推 0噓 1→)留言1則, 1人參與討論串1/1
※ [本文轉錄自 LinuxDev 看板 #1CnKpI8j ]
作者: powertodream (The Beginning) 看板: LinuxDev
標題: [問題] share library 如何讓process共享
時間: Mon Oct 25 17:24:30 2010
.so 使用 -fPIC編譯
process在dynamic linking時會與其他有使用到相同 .so 的process 共用 .text 段
我的問題是:
在process 被產生的時候, 經由 fork / execv 呼叫之後.
那在什麼時候會將共用的 text 段分配呢?
是由 kernel 還是 linker (ld.so?) 處理?
不知道詳細的行為是怎麼運作的,是否有人能解答一下?
或者有相關資訊可以參考, 亦或閱讀程式碼的話應該由哪邊看起比較洽當?
--
最難的兩件事:
把你的錢放到我的口袋裡
把我的想法放到你腦袋裡
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 122.147.15.66
→
10/25 17:25,
10/25 17:25
推
10/25 17:49,
10/25 17:49
→
10/25 18:59,
10/25 18:59
→
10/25 19:00,
10/25 19:00
--
If people do not believe that mathematics is simple,
it is because they do not realize how complicated life is.
-- John Louis von Neumann
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 122.147.15.66
→
10/26 00:32, , 1F
10/26 00:32, 1F
C_and_CPP 近期熱門文章
PTT數位生活區 即時熱門文章