aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorlandley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-04-17 21:47:03 +0000
committerlandley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-04-17 21:47:03 +0000
commit91eceab07aff9da641d1dafe68bcd7344a3d8644 (patch)
tree83ff9593f82d0e0c1e6b2c8d7d5bd3cc345bd0b0 /docs
parenta5e4bc35cddd6a51c8828f6aa9cc31ef75c44ee9 (diff)
downloadbusybox-w32-91eceab07aff9da641d1dafe68bcd7344a3d8644.tar.gz
busybox-w32-91eceab07aff9da641d1dafe68bcd7344a3d8644.tar.bz2
busybox-w32-91eceab07aff9da641d1dafe68bcd7344a3d8644.zip
Elf dynamic linker stuff from Rich Felker.
git-svn-id: svn://busybox.net/trunk/busybox@14900 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'docs')
-rw-r--r--docs/busybox.net/programming.html35
1 files changed, 35 insertions, 0 deletions
diff --git a/docs/busybox.net/programming.html b/docs/busybox.net/programming.html
index f5433f519..61777afb1 100644
--- a/docs/busybox.net/programming.html
+++ b/docs/busybox.net/programming.html
@@ -376,6 +376,41 @@ relocations with the environment variable "LD_DEBUG". Try
376"LD_DEBUG=help /bin/true" for a list of commands. Learning to interpret 376"LD_DEBUG=help /bin/true" for a list of commands. Learning to interpret
377"LD_DEBUG=statistics cat /proc/self/statm" could be interesting.</p> 377"LD_DEBUG=statistics cat /proc/self/statm" could be interesting.</p>
378 378
379<p>For more on this topic, here's Rich Felker:</p>
380<blockquote>
381<p>Dynamic linking (without fixed load addresses) fundamentally requires
382at least one dirty page per dso that uses symbols. Making calls (but
383never taking the address explicitly) to functions within the same dso
384does not require a dirty page by itself, but will with ELF unless you
385use -Bsymbolic or hidden symbols when linking.</p>
386
387<p>ELF uses significant additional stack space for the kernel to pass all
388the ELF data structures to the newly created process image. These are
389located above the argument list and environment. This normally adds 1
390dirty page to the process size.</p>
391
392<p>The ELF dynamic linker has its own data segment, adding one or more
393dirty pages. I believe it also performs relocations on itself.</p>
394
395<p>The ELF dynamic linker makes significant dynamic allocations to manage
396the global symbol table and the loaded dso's. This data is never
397freed. It will be needed again if libdl is used, so unconditionally
398freeing it is not possible, but normal programs do not use libdl. Of
399course with glibc all programs use libdl (due to nsswitch) so the
400issue was never addressed.</p>
401
402<p>ELF also has the issue that segments are not page-aligned on disk.
403This saves up to 4k on disk, but at the expense of using an additional
404dirty page in most cases, due to a large portion of the first data
405page being filled with a duplicate copy of the last text page.</p>
406
407<p>The above is just a partial list of the tiny memory penalties of ELF
408dynamic linking, which eventually add up to quite a bit. The smallest
409I've been able to get a process down to is 8 dirty pages, and the
410above factors seem to mostly account for it (but some were difficult
411to measure).</p>
412</blockquote>
413
379<h2><a name="who">Who are the BusyBox developers?</a></h2> 414<h2><a name="who">Who are the BusyBox developers?</a></h2>
380 415
381<p>The following login accounts currently exist on busybox.net. (I.E. these 416<p>The following login accounts currently exist on busybox.net. (I.E. these