[PATCH] D54249: [WebAssembly] Initial support for shared objects (-shared)

Derek Schuff via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 13 17:40:33 PST 2018


dschuff added inline comments.


================
Comment at: wasm/Driver.cpp:463
+    if (Config->ExportTable)
+      error("-shared/-pie is incompabilbe with --export-table");
+    Config->ImportTable = true;
----------------
incompatible


================
Comment at: wasm/Driver.cpp:498
+      // For PIC code, we import two global variables (__table_base and
+      // __memory_base) from the enviroment and use these to as the offset at
+      // which to load our static data and function table.
----------------
remove "to"


================
Comment at: wasm/Driver.cpp:499
+      // __memory_base) from the enviroment and use these to as the offset at
+      // which to load our static data and function table.
+      // See: https://github.com/WebAssembly/tool-conventions/blob/master/DynamicLinking.md
----------------
"static data and function table" is the opposite of the order that `__table_base` and `__memory base` have above.


================
Comment at: wasm/OutputSections.cpp:141
+    if (Config->Pic) {
+      assert(Segments.size() <= 1 &&
+             "Currenly only a single data segment is supported in PIC mode");
----------------
Can this be a `report_fatal_error` or something even more friendly instead of an assert, since this could happen as the result of user input?


================
Comment at: wasm/Writer.cpp:712
   // Known sections
+  if (Config->Pic)
+    createDylinkSection();
----------------
shouldn't this go after the data section since it's a custom section?


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D54249





More information about the llvm-commits mailing list