[PATCH] D42096: [WebAssembly] Symbol changes #3: Cosmetic table, LLD. NFC.

Nicholas Wilson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 16 03:16:13 PST 2018


ncw created this revision.
ncw added a reviewer: sbc100.
Herald added subscribers: llvm-commits, sunfish, aheejin, jgravelle-google, dschuff, jfb.

Third chunk split out of https://reviews.llvm.org/D41955.

No need to commit simultaneously with the matching LLVM change (https://reviews.llvm.org/D42095), they are completely independent.

No functional changes.

Changes:

- See https://reviews.llvm.org/D42095.


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D42096

Files:
  test/wasm/relocatable.ll
  wasm/Writer.cpp


Index: wasm/Writer.cpp
===================================================================
--- wasm/Writer.cpp
+++ wasm/Writer.cpp
@@ -108,7 +108,7 @@
   uint64_t FileSize = 0;
   uint32_t DataSize = 0;
   uint32_t NumMemoryPages = 0;
-  uint32_t InitialTableOffset = 0;
+  uint32_t InitialTableOffset = 1;
 
   std::vector<const WasmSignature *> Types;
   DenseMap<WasmSignature, int32_t, WasmSignatureDenseMapInfo> TypeIndices;
@@ -780,9 +780,6 @@
 }
 
 void Writer::run() {
-  if (!Config->Relocatable)
-    InitialTableOffset = 1;
-
   log("-- calculateTypes");
   calculateTypes();
   log("-- calculateImports");
Index: test/wasm/relocatable.ll
===================================================================
--- test/wasm/relocatable.ll
+++ test/wasm/relocatable.ll
@@ -62,8 +62,8 @@
 ; CHECK-NEXT:       - ElemType:        ANYFUNC
 ; CHECK-NEXT:         Limits:
 ; CHECK-NEXT:           Flags:           [ HAS_MAX ]
-; CHECK-NEXT:           Initial:         0x00000002
-; CHECK-NEXT:           Maximum:         0x00000002
+; CHECK-NEXT:           Initial:         0x00000003
+; CHECK-NEXT:           Maximum:         0x00000003
 ; CHECK-NEXT:   - Type:            MEMORY
 ; CHECK-NEXT:     Memories:
 ; CHECK-NEXT:       - Initial:         0x00000001
@@ -129,7 +129,7 @@
 ; CHECK-NEXT:     Segments:
 ; CHECK-NEXT:       - Offset:
 ; CHECK-NEXT:           Opcode:          I32_CONST
-; CHECK-NEXT:           Value:           0
+; CHECK-NEXT:           Value:           1
 ; CHECK-NEXT:         Functions:       [ 3, 1 ]
 ; CHECK-NEXT:   - Type:            CODE
 ; CHECK-NEXT:     Relocations:
@@ -178,13 +178,13 @@
 ; CHECK-NEXT:         Offset:
 ; CHECK-NEXT:           Opcode:          I32_CONST
 ; CHECK-NEXT:           Value:           8
-; CHECK-NEXT:         Content:         '00000000'
+; CHECK-NEXT:         Content:         '01000000'
 ; CHECK-NEXT:       - SectionOffset:   27
 ; CHECK-NEXT:         MemoryIndex:     0
 ; CHECK-NEXT:         Offset:
 ; CHECK-NEXT:           Opcode:          I32_CONST
 ; CHECK-NEXT:           Value:           12
-; CHECK-NEXT:         Content:         '01000000'
+; CHECK-NEXT:         Content:         '02000000'
 ; CHECK-NEXT:       - SectionOffset:   36
 ; CHECK-NEXT:         MemoryIndex:     0
 ; CHECK-NEXT:         Offset:


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42096.129928.patch
Type: text/x-patch
Size: 2286 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180116/19a80898/attachment.bin>


More information about the llvm-commits mailing list