Commit Graph

285 Commits

Author SHA1 Message Date
Nikolay Nikolov
c88037b8a7 * fixed another crash in the wasi internal linker, caused by missing resource section 2024-06-28 00:30:12 +03:00
Nikolay Nikolov
07da0058e3 + wasm internal linker optimization: write only the non-empty data sections to
the resulting .wasm file (the 'fpc.resources' section specifically can be
  empty, if the binary doesn't use resources)
2024-06-28 00:30:12 +03:00
Nikolay Nikolov
c4f046f1b8 + wasi internal linker: also write the fpc.resources section to the file 2024-06-28 00:30:12 +03:00
florian
4867d48e99 + support for .debug_loc and .debuc_loclist sections 2024-01-16 23:24:37 +01:00
Nikolay Nikolov
e3f4bad164 * fixed internal linker crash if no tags are defined (i.e. no WASM native exceptions used) 2024-01-07 03:29:32 +02:00
Nikolay Nikolov
93365f7e38 * wasm internal linker: produce an internal error on unknown relocations 2024-01-07 02:41:53 +02:00
Nikolay Nikolov
cd72a8910e + wasm internal linker: implemented RELOC_TAG_INDEX_LEB relocations 2024-01-07 02:39:57 +02:00
Nikolay Nikolov
4084da63ab + wasm internal linker: create the tag section (if not empty) 2024-01-07 02:35:35 +02:00
Nikolay Nikolov
033a2ae2e7 * wasm internal linker: set mempos of the .wasm_tags (and .wasm_globals) section to 0 2024-01-07 02:12:49 +02:00
Nikolay Nikolov
6b47a03cc9 * wasm internal object reader: handle tag symbol flags properly (support weak and local symbols) 2024-01-07 02:08:32 +02:00
Nikolay Nikolov
1d48cd7eba * wasm internal linker: treat exception symbols as AB_COMMON 2024-01-07 01:50:16 +02:00
Nikolay Nikolov
07677f4214 * wasm internal object reader: convert R_WASM_TAG_INDEX_LEB relocations to relocation objects 2024-01-07 01:45:27 +02:00
Nikolay Nikolov
3121f3f8a0 * wasm internal object reader: validate that R_WASM_TAG_INDEX_LEB relocations point to a SYMTAB_EVENT symbol 2024-01-07 01:43:47 +02:00
Nikolay Nikolov
962b36a6e8 + wasm internal object reader: create symbols for SYMTAB_EVENT entries in the symbol table 2024-01-07 01:42:12 +02:00
Nikolay Nikolov
09accffd28 + wasm internal object reader: range check event symbols against the tag index space (imports + tag section) 2024-01-07 01:33:00 +02:00
Nikolay Nikolov
02b7cc0e56 + wasm internal object reader: read tags from the export section 2024-01-07 01:29:10 +02:00
Nikolay Nikolov
79d739baa6 + wasm internal object reader: bounds check the tag type index against the types table 2024-01-07 01:25:48 +02:00
Nikolay Nikolov
2de0bcb8d0 + wasm internal object reader: store the tags from the tag section in the TagTypes array 2024-01-07 01:23:05 +02:00
Nikolay Nikolov
55002d1905 + wasm internal object reader: read tag imports 2024-01-07 01:15:13 +02:00
Nikolay Nikolov
c527437594 + wasm internal object reader: parse the tag section 2024-01-07 01:06:04 +02:00
Nikolay Nikolov
7f3ed9e85c * wasm internal linker: skip the element section when reading object files. This fixes linking with object modules, produced by the external assembler. 2024-01-07 00:11:59 +02:00
Nikolay Nikolov
6a9376cb9e * wasm internal linker: fixed the relocation of imported function symbol aliases 2024-01-06 23:53:15 +02:00
Nikolay Nikolov
aac37e3179 * fix warning 2024-01-06 22:10:34 +02:00
Nikolay Nikolov
4b2a924ea0 * fix warning 2024-01-06 22:05:35 +02:00
Nikolay Nikolov
3fddae4a40 + wasm internal linker: implemented R_WASM_FUNCTION_OFFSET_I32 relocations 2024-01-06 21:55:20 +02:00
Nikolay Nikolov
b679f8bc06 - wasm internal object reader: removed redundant check for R_WASM_TABLE_INDEX_I32 pointing to a SYMTAB_FUNCTION entry (we now do this check earlier) 2024-01-06 21:39:31 +02:00
Nikolay Nikolov
e3b6d70f93 * wasm internal linker: set mempos of debug sections to 0 2024-01-06 21:16:31 +02:00
Nikolay Nikolov
baee5b9fd4 * wasm internal linker: perform R_WASM_SECTION_OFFSET_I32 relocations 2024-01-06 21:12:22 +02:00
Nikolay Nikolov
1061965ea5 + wasm internal object reader: check that R_WASM_GLOBAL_INDEX_LEB point to a SYMTAB_GLOBAL symbol 2024-01-06 21:03:02 +02:00
Nikolay Nikolov
30c8930c30 * fix warning 2024-01-06 21:00:14 +02:00
Nikolay Nikolov
dc16426790 + wasm internal object reader: check that relocations that should point to a SYMTAB_DATA symbol, actually point to such symbol 2024-01-06 20:57:23 +02:00
Nikolay Nikolov
b35c118244 + wasm internal object reader: added range check to the reader of the SymKind field 2024-01-06 20:54:04 +02:00
Nikolay Nikolov
f3401c3f53 * fix warning 2024-01-06 20:51:35 +02:00
Nikolay Nikolov
3071ae231a + wasm internal object reader: validate that relocations that should point to a SYMTAB_FUNCTION entry, actually point to such entry 2024-01-06 20:30:20 +02:00
Nikolay Nikolov
baf9681684 * refactor: changed the type of SymbolTable.SymKind to TWasmSymbolType, to avoid type casts. No functional changes. 2024-01-06 20:26:27 +02:00
Nikolay Nikolov
00d8d53c4e * refactor: changed the type RelocationTable.RelocType to avoid type casts. No functional changes. 2024-01-06 20:22:47 +02:00
Nikolay Nikolov
d87a6c89d4 * wasm internal object reader: removed the warnings in case of missing symbol (this will now create an internal error, instead) 2024-01-06 20:18:14 +02:00
Nikolay Nikolov
a2a85dc7af * wasm internal object reader: validation of the RelocIndex range moved to a single place - in ReadRelocationSection 2024-01-06 20:14:40 +02:00
Nikolay Nikolov
4933d73938 + support R_WASM_SECTION_OFFSET_I32 relocations in the wasm internal object reader 2024-01-06 20:06:54 +02:00
Nikolay Nikolov
39c3d5d035 + wasm internal object reader: support relocations for debug sections 2024-01-06 19:30:14 +02:00
Nikolay Nikolov
dfdc4a4d78 + wasm internal object reader: record section indices for debug sections. Check for duplicated debug sections. 2024-01-06 19:08:01 +02:00
Nikolay Nikolov
6ab2cd3ce9 + wasm internal object reader: also read the '.debug_frame' and '.debug_str' sections 2024-01-06 18:51:22 +02:00
Nikolay Nikolov
ada576e559 + wasm internal object reader: pass a TWasmCustomDebugSectionType parameter to ReadDebugSection 2024-01-06 18:47:32 +02:00
Nikolay Nikolov
543b341203 + write debug sections in the wasm internal exe writer 2024-01-04 16:00:00 +02:00
Nikolay Nikolov
3724e00169 + wasm object reader: allow other sections to be created before the first code section 2024-01-02 20:25:54 +02:00
Nikolay Nikolov
ff4744e0ed * ignore relocation sections for custom sections for now (will be done later), so that we can proceed with the debug info generation in a later phase 2024-01-02 20:19:51 +02:00
Nikolay Nikolov
9a983632f9 + read debug sections in the wasm internal object reader 2024-01-02 20:10:43 +02:00
Nikolay Nikolov
5fe4ab49bc + fill the correct minimal number of memory pages required in the wasm internal linker 2024-01-02 17:58:01 +02:00
Nikolay Nikolov
93d38629aa + added check for whether R_WASM_TABLE_INDEX_I32 relocations always point to a function symbol in the wasm internal object reader 2024-01-01 23:52:25 +02:00
Nikolay Nikolov
dd1565c667 * wasm internal exe writer: set mempos for code sections to the offset within
the code section. This does not affect the .wasm binary generation, only the
  linker map file.
2024-01-01 23:09:54 +02:00