aboutsummaryrefslogtreecommitdiff
path: root/DynamicLinking.md
diff options
context:
space:
mode:
authorLuke Wagner <mail@lukewagner.name>2015-09-11 17:27:33 -0500
committerLuke Wagner <mail@lukewagner.name>2015-09-15 11:27:22 -0500
commita812e9fe429e31dfd71bbabf7d7a37771fe71e8e (patch)
tree63a5540c64c8d60a37db4a79daf30e535f393188 /DynamicLinking.md
parent1f05c4cdbc0dc51952579dfbaba3a7a7ce710562 (diff)
downloadnanowasm-design-a812e9fe429e31dfd71bbabf7d7a37771fe71e8e.tar.gz
Move globals out of the MVP
Diffstat (limited to 'DynamicLinking.md')
-rw-r--r--DynamicLinking.md11
1 files changed, 11 insertions, 0 deletions
diff --git a/DynamicLinking.md b/DynamicLinking.md
index 675471f..f110d8f 100644
--- a/DynamicLinking.md
+++ b/DynamicLinking.md
@@ -10,6 +10,17 @@ dynamic libraries.
WebAssembly will support both load-time and run-time (`dlopen`) dynamic linking
of libraries.
+One important requirement of dynamic linking is to allow the linked module
+to have its own position-independent global data segment. This could be achieved
+by specifying a new kind of link-time-initialized immutable global variable
+which would be initialized with the address (in linear memory) of the modules'
+global data segment. These immutable globals could also be used to provide
+a linked module with the offsets of its function pointers in the instance's
+function pointer tables. An important aspect of immutable globals is that they
+could either be patched directly as constant values or implemented through a
+[Global Offset Table](https://en.wikipedia.org/wiki/Position-independent_code)
+in position-independent code.
+
Dynamic linking is especially useful when combined with a Content Distribution
Network (CDN) such as [hosted libraries][] because the library is only ever
downloaded and compiled once per user device. It can also allow for smaller