@@ -150,7 +150,7 @@ The current list of valid `type` codes are:
150
150
- ` 5 / WASM_SEGMENT_INFO ` - Extra metadata about the data segments.
151
151
152
152
- ` 6 / WASM_INIT_FUNCS ` - Specifies a list of constructor functions to be called
153
- at startup time .
153
+ at startup by ` __wasm_call_ctors ` after it initializes memory .
154
154
155
155
- ` 7 / WASM_COMDAT_INFO ` - Specifies the COMDAT groups of associated linking
156
156
objects, which are linked only once and all together.
@@ -357,9 +357,9 @@ represented in the object file as Wasm data segments with an associated data
357
357
symbol, so each linked data symbol pulls its associated data segment into the
358
358
linked output.
359
359
360
- Segments are merged according their type: segments with a common prefix such as
361
- ` .data ` or ` .rodata ` are merged into a single segment in the output data
362
- section .
360
+ Segments are merged according their name and type: segments with a common prefix
361
+ such as ` .data ` or ` .rodata ` are merged in the output data section, but active
362
+ and passive segments are kept separate .
363
363
364
364
The output data section is formed, essentially, by concatenating the data
365
365
sections of the input files. Since the final location in linear memory of any
@@ -370,10 +370,21 @@ which reference a data symbol.
370
370
Segments are linked as a whole, and a segment is either entirely included or
371
371
excluded from the link.
372
372
373
- Mergin Custom Sections
373
+ Merging Memory Sections
374
+ -----------------------
375
+
376
+ It is an error to link together object files with shared and unshared
377
+ memories. Object files with unshared memories are produced by tools that are not
378
+ aware of WebAssembly threads or are configured to produce code for a
379
+ single-threaded environment. These objects may have been compiled from
380
+ thread-aware source code but had their atomic operations stripped, so it would
381
+ be dangerous to allow users to accidentally link these objects together with
382
+ properly thread-aware objects.
383
+
384
+ Merging Custom Sections
374
385
----------------------
375
386
376
- Mergin of custom sections is performed by concatenating all payloads for the
387
+ Merging of custom sections is performed by concatenating all payloads for the
377
388
customs sections with the same name. The section symbol will refer the resulting
378
389
section, this means that the relocation entries addend that refer
379
390
the referred custom section fields shall be adjusted to take new offset
0 commit comments