Commit Graph

68874 Commits

Author SHA1 Message Date
Michaël Van Canneyt
702ec640ac * Fix variant record definition for CIF 2024-01-02 07:09:21 +01:00
Michaël Van Canneyt
5193f676bf * Add tests for variant arguments 2024-01-02 07:09:21 +01:00
Michaël Van Canneyt
5a78e82c8f * Add Tests.Rtti.Util to uses clause. Keeps lazarus happy :) 2024-01-02 07:09:20 +01:00
Michaël Van Canneyt
85524ff821 * Do not test variants with equal memory area: e.g. strings may point to different memory areas 2024-01-02 07:09:20 +01:00
Michaël Van Canneyt
b6a87450eb * test for variant TValue 2024-01-02 07:09:20 +01:00
Michaël Van Canneyt
c39e51485c * Avoid range error in comparisons 2024-01-02 07:09:20 +01:00
Sven/Sarah Barth
30bf8047aa * ensure that the field and method tables are always accessed with the default alignment 2024-01-02 07:09:20 +01:00
Sven/Sarah Barth
a4121d2201 * use SizeInt instead of PtrInt for the stack area size (this both matches the declaration in TypInfo as well as enough on 16-bit targets like i8086) 2024-01-02 07:09:19 +01:00
Sven/Sarah Barth
7eea850726 * TVmtFieldEntry.FieldOffset needs to be SizeUInt instead of PtrUInt, so that it works correctly on the various memory models of i8086 as well
+ added test
2024-01-02 07:09:19 +01:00
Sven/Sarah Barth
c74441323a + add descriptive comment regarding the TVmtField* types 2024-01-02 07:09:19 +01: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
Rika Ichinose
9d8b801e4c Improve i386 fpc_shortstr_to_shortstr(), fpc_shortstr_compare(), and add fpc_shortstr_compare_equal(). 2024-01-01 21:12:52 +00:00
Rika Ichinose
fca0ace070 Improve shortstring Pos() and generic fpc_shortstr_compare(). 2024-01-01 21:12:52 +00: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
Nikolay Nikolov
c49ac16a19 * wasm internal linker: start the .text section at mempos 0 2024-01-01 22:54:16 +02:00
Nikolay Nikolov
5eb5fdabad * start the data at offset 1024 instead of 0, just like the LLVM linker 2024-01-01 22:38:03 +02:00
Nikolay Nikolov
baa81d5275 + allocate stack and set the initial value for the stack pointer in the wasm internal exe writer 2024-01-01 22:32:48 +02:00
Nikolay Nikolov
eaf9a9f1b9 * fixed bug in the application of RELOC_GLOBAL_INDEX_LEB fixups in the wasm internal exe writer 2024-01-01 22:14:39 +02:00
Nikolay Nikolov
ec206cf490 + wasm internal linker: write the exported functions to the export section in the exe writer 2024-01-01 22:05:03 +02:00
Nikolay Nikolov
c4a77a832f + write export section in the wasm internal linker exe writer, only the memory is exported for now 2024-01-01 21:20:37 +02:00
Nikolay Nikolov
d03963afe9 + generate the global section in the wasm internal linker exe writer 2024-01-01 21:11:56 +02:00
Rika Ichinose
0d5f7fa66b Increase non-temporal i386 & x64 Fill* thresholds to 4 Mb. 2024-01-01 18:33:33 +00:00
Rika Ichinose
b7d32e4933 ERMSB-aware Fill* for i386. 2024-01-01 18:33:33 +00:00
florian
27be091c44 * more clean variable initialization 2024-01-01 19:31:04 +01:00
Nikolay Nikolov
f48282d7b3 + implemented R_WASM_GLOBAL_INDEX_LEB relocations in the wasm internal linker 2024-01-01 20:09:04 +02:00
Nikolay Nikolov
bbeb98aeef + wasm internal linker: put all wasm global symbols in separate sections,
called .wasm_globals.n_XXX. This allows section-based smartlinking to work on
  global symbols.
2024-01-01 19:06:24 +02:00
Nikolay Nikolov
cd93050d7e * set the size of AT_WASM_GLOBAL symbols to 1 2024-01-01 18:10:20 +02:00
Nikolay Nikolov
ef796906e9 + wasm internal obj reader: add globals to a '.wasm_globals' object section 2024-01-01 18:03:02 +02:00
Nikolay Nikolov
2eae62a6e8 * define the __stack_pointer symbol in a different way, so it doesn't crash during linking 2024-01-01 17:54:59 +02:00
Nikolay Nikolov
167c7bc565 + create relocations for R_WASM_GLOBAL_INDEX_LEB entires in the wasm object reader 2024-01-01 17:46:51 +02:00
Nikolay Nikolov
9ee13f2937 + also define non-imported SYMTAB_GLOBAL symbols in the wasm internal object reader 2024-01-01 17:40:31 +02:00
Nikolay Nikolov
408e388af3 + wasm internal linker: internally define the '__stack_pointer' global symbol 2024-01-01 17:36:52 +02:00
Nikolay Nikolov
880d0333b0 + wasm internal object reader: process SYMTAB_GLOBAL import entries 2024-01-01 17:25:56 +02:00
Nikolay Nikolov
e6a68b28b6 * wasm internal linker: produce an error if an R_WASM_SECTION_OFFSET_I32 or an
R_WASM_TAG_INDEX_LEB relocations is encountered - these aren't implemented,
  and are not required for 'hello, world', so will be done later.
2024-01-01 17:12:07 +02:00
Nikolay Nikolov
4208fc79c7 + implemented R_WASM_MEMORY_ADDR_SLEB and R_WASM_TABLE_INDEX_SLEB relocations in the wasm internal linker 2024-01-01 17:08:36 +02:00
Nikolay Nikolov
b440f57739 + implemented R_WASM_MEMORY_ADDR_LEB relocations in the wasm internal linker 2024-01-01 17:04:35 +02:00
Nikolay Nikolov
5771245d74 + create the Table and Elem sections in the wasm exe writer 2024-01-01 16:56:53 +02:00
Nikolay Nikolov
7a228bccfc + implement R_WASM_TABLE_INDEX_I32 relocations in the wasm internal linker 2024-01-01 16:41:03 +02:00
Nikolay Nikolov
1b2d29ea1a + implemented R_WASM_MEMORY_ADDR_I32 relocations in the wasm internal linker 2024-01-01 16:13:11 +02:00
Nikolay Nikolov
12d7d271d6 + write the data section in the wasm internal linker exe writer 2024-01-01 15:58:17 +02:00
Nikolay Nikolov
1e89579766 + WASI internal linker: implemented GetCodeSize, GetDataSize and GetBssSize. 2024-01-01 15:32:28 +02:00
Nikolay Nikolov
b361b41a86 + webassembly internal linker: create separate exe sections for .rodata and .bss 2024-01-01 14:56:33 +02:00
Nikolay Nikolov
dc4689ba1b * wasm internal linker: start the data section at offset 0, as WebAssembly is a Harvard architecture. 2024-01-01 14:44:44 +02:00
Nikolay Nikolov
69ce966691 + implemented RELOC_TYPE_INDEX_LEB relocations in the wasm internal linker 2024-01-01 14:35:10 +02:00
Nikolay Nikolov
0b3238bcd3 * refactor: invert if condition and else statement (reducing the nesting level), because then terminates the function. No functional changes. 2024-01-01 14:04:29 +02:00
Nikolay Nikolov
5845bb9095 * produce an internal error, instead of a warning in case of RELOC_FUNCTION_INDEX_LEB pointing to a function with missing ExeFunctionIndex 2024-01-01 14:03:03 +02:00
Nikolay Nikolov
50986967f5 + wasm internal linker: fill ExeFunctionIndex of alias code symbols as well 2024-01-01 14:01:43 +02:00
Nikolay Nikolov
cf79ca16b4 * only set MainFuncSymbol of code sections to the main (non-alias) symbol 2024-01-01 13:44:36 +02:00
Nikolay Nikolov
c453bac7ad + report an error in case a wasm object file has a code section, without a main symbol 2024-01-01 13:42:24 +02:00
Nikolay Nikolov
e1d56a9944 * wasm internal linker: use the main symbol (without WASM_SYM_EXPLICIT_NAME,
i.e. not an alias) to define code section names in the wasm object reader.
  For example, the section for the INITHEAP function is now called:
    .text.n_SYSTEM_$$_INITHEAP
  instead of
    .text.n__FPC_InitHeap
  (which is based on an explicit alias for the function - '_FPC_InitHeap')
2024-01-01 13:35:23 +02:00