From a812e9fe429e31dfd71bbabf7d7a37771fe71e8e Mon Sep 17 00:00:00 2001 From: Luke Wagner Date: Fri, 11 Sep 2015 17:27:33 -0500 Subject: Move globals out of the MVP --- DynamicLinking.md | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'DynamicLinking.md') 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 -- cgit v1.2.3