Commit Graph

370 Commits

Author SHA1 Message Date
Pierre Muller
b1a18f5690 Handle floatx80 records with gaps also in InternalAssembler 2024-09-18 18:54:44 +00:00
Nikolay Nikolov
562ca0ad80 * WebAssembly internal assembler writer: generate the function locals header
when assembling the tai_local directive, instead of injecting them manually in
  TWasmObjOutput.WriteFunctionCode. This makes function code offsets correct
  and avoids the need to manually adjust relocation fixups by adding the locals
  header size. It also fixes relative relocations, used in DWARF debug line
  info.
2024-09-15 03:44:14 +03:00
Nikolay Nikolov
80523e192a * TWasmObjData.DeclareLocal renamed DeclareLocals. No functional changes. 2024-09-15 01:03:56 +03:00
Pierre Muller
318e31487a Take care about endianess in arm eabi attribute section 2024-06-11 01:05:51 +02:00
Pierre Muller
2044868c10 Swap real constant in internal assembler 2024-02-19 20:19:36 +01:00
Pierre Muller
e3b93b07c6 * Fix writereloc for cross-endian compilation 2024-02-19 20:19:36 +01:00
Pierre Muller
529b64790b Avoid 'false' warning: Local variable "gap_index" does not seem to be initialized on cycle with -O3 option 2024-01-29 18:15:28 +01:00
Pierre Muller
71ba76532b * Fix writing of 'comp' type depending on FPC_COMP_IS_INT64 macro.
* Fix writing of floatx80 on systems with gaps due to alignment requirements.
2024-01-25 10:17:11 +00:00
Pierre Muller
144ee6d51d Add missing swaping in case of different endianess of stab entry inside TInternalAssembler.WriteStab 2023-04-30 21:23:06 +02:00
Pierre Muller
5cedecbe25 Avoid float_raise call in FPC_SOFT_FPUX80 code 2023-01-14 11:41:20 +00:00
Pierre Muller
977ca19dc0 Set current_filepos in Internal assembler class also if DEBUG macro is set 2023-01-14 11:41:20 +00:00
Sven/Sarah Barth
6ac50f4100 + add method ResetSourceLines to TExternalAssembler to reset already written lines 2022-05-26 21:43:35 +02:00
Jonas Maebe
16cb409fbf LLVM: separate as_clang_llvm_darwin
The Darwin local label prefix ('L') is different from that on most other
platforms ('.L). While LLVM generally handles that for us, for inline
assembly it's still FPC's job to adhere to the target conventions.
2022-05-14 22:38:49 +02:00
florian
191dd0c637 + support .weak in the internal assembler 2022-04-09 21:12:10 +02:00
florian
e4ee8fa6a2 * patch by Rika to pass some strings by reference, resolves #39338 2021-11-09 22:41:52 +01:00
Nikolay Nikolov
b463f2a141 + added support for exception tags and for the 'throw' and 'catch' instructions
in the wasm internal assembler and object writer
2021-09-27 21:44:09 +03:00
Nikolay Nikolov
5ad2d47e23 * track wasm global types in the internal object writer 2021-09-27 03:03:57 +03:00
Nikolay Nikolov
99c84da071 + generate the export section in the wasm internal obj writer 2021-09-26 20:02:48 +03:00
Nikolay Nikolov
83f2f7bf37 + introduced TObjData.SymbolPairDefine, to allow custom handling of symbol
pairs in the internal object writer
2021-09-26 03:56:56 +03:00
Nikolay Nikolov
7e53fecd09 + handle tai_local in the internal asm writer and store the locals in the
wasm obj extra symbol data object
2021-09-25 16:00:09 +03:00
Nikolay Nikolov
050519f16f + handle the import_module and import_name directives in the internal
assembler and store them as obj symbol extra data
2021-09-25 15:44:35 +03:00
Nikolay Nikolov
628fcb9b1c + create the Type wasm section 2021-09-20 03:43:23 +03:00
Yuriy Sydorov
122ed4b76a * Support for sleb128 and uleb128 constants in the NASM writer.
* Added sleb128tostr() and uleb128tostr() methods to TExternalAssembler.
* Use these methods in assembler writers instead of code duplication.
2021-08-16 00:40:34 +03:00
florian
8535c758ef + initial support for ARMv2
* check for unassigned valuestr when writing ntbs eabi attributes

git-svn-id: trunk@49348 -
2021-05-09 20:42:31 +00:00
pierre
77e3a402da Set string length before calling move to avoid problems with global data analysis on systems using C library
git-svn-id: trunk@49280 -
2021-04-27 14:52:22 +00:00
pierre
f1d30a5bc6 Add .force_thumb pseudo-directive support forarm reader
git-svn-id: trunk@49271 -
2021-04-26 21:14:27 +00:00
Jonas Maebe
793ecb3fa6 * fixed assembling via pipe on Darwin
git-svn-id: trunk@49067 -
2021-03-27 19:01:04 +00:00
florian
f1883c4e61 * arm: taicpu uses set instead of boolean to store instruction states
+ track if an instruction is a thumb instruction in taicpu

git-svn-id: trunk@48673 -
2021-02-14 15:51:48 +00:00
pierre
f68804e9cd Replace cs_link_on_target by cs_assemble_on_target in assemble unit
git-svn-id: trunk@47490 -
2020-11-20 15:15:17 +00:00
florian
637976e83f * patch by Marģers to unify internal error numbers, resolves #37888
git-svn-id: trunk@47103 -
2020-10-13 19:59:01 +00:00
yury
6e777d8967 * ait_comment,ait_regalloc,ait_tempalloc,ait_varloc instructions produce only comments in the external assembler output. Moved handling of these instructions to TExternalAssembler.WriteComments().
This eliminates code duplication and improves maintainability.

git-svn-id: trunk@46550 -
2020-08-22 19:53:39 +00:00
Jonas Maebe
eb7ba1690e * mark all external assemblers using an LLVM tool using af_llvm
+ added support for constructing target triplets
  * pass "-target triplet" when using an LLVM assembler
   o removed no longer needed $DARWINVERSION and $ARCH parameters
  * consistently use as_clang_gas when clang is used to assembler GAS-style
    assembly, and rename as_llcm_clang to as_clang_llvm (for consistency)
  * support pipe assembling when using clang on *nix in all cases

git-svn-id: trunk@45807 -
2020-07-19 14:30:35 +00:00
Jonas Maebe
e7d1a77f9a * rename the ARM/AArch64-Darwin targets to ARM/AArch64-iOS
* rename the m68k/PowerPC-MacOS targets to m68k/PowerPC-MacOSClassic
  * repurpose the AArch64/Darwin target for AArch64/macOS
   o make AArch64-Darwin default target for a hosted AArch64-Darwin compiler

git-svn-id: trunk@45758 -
2020-07-10 21:52:24 +00:00
svenbarth
3e29742fd9 * for PE+ specific checks use a constant in systems.pas instead of an explicit list (easier to extend this way)
git-svn-id: trunk@44912 -
2020-04-21 06:04:10 +00:00
Jonas Maebe
79974a9671 + -XlS<x> option to specify a suffix for externally called LLVM utilities,
e.g. -XlS-7 to call clang-7 instead of clang)
  * IMPORTANT: changed the -CL llvm code generation options to -Cl, for
    consistency with the new -Xl option (-XL was already taken)

git-svn-id: trunk@44436 -
2020-03-30 19:58:49 +00:00
florian
245b58c249 + support for arm attributes
* abi notes fixed

git-svn-id: trunk@43157 -
2019-10-09 17:45:40 +00:00
florian
8ecdb2e9ca + dwarf support for tls threadvars
git-svn-id: trunk@43134 -
2019-10-05 20:48:31 +00:00
florian
16163b74ec + support for the gnu2 general-dynamic tls model on arm, use it instead of the gnu one as the gnu2 one can be relaxed (access optimizations by the linker)
+ support pic relocations in the internal assembler writer

git-svn-id: trunk@43128 -
2019-10-05 20:48:26 +00:00
florian
03dfc615dc + new relocations for arm tls
git-svn-id: trunk@43123 -
2019-10-05 20:48:21 +00:00
pierre
eb3a470f45 * assemble.pas (TInternalAssembler.TreePass0): Avoid range/overflow check error.
(TInternalAssembler.TreePass2): Check that objsymend and objsym are in same section
    and avoid range/overflow check error.

git-svn-id: trunk@43028 -
2019-09-17 21:06:18 +00:00
Jonas Maebe
7ef3d39d93 * one more disable location of DoPipe in case not on a Unix platform
(mantis #35743)

git-svn-id: trunk@42302 -
2019-06-27 19:20:45 +00:00
florian
1ed0000ae8 + Encode(U/S)leb128 take now a third parameter to force that the constant has a certain minimum size
+ tai_const has a new field fixed_size which is used to fix the size of an s/uleb128. This is needed to ensure convergence during assembling when calculating offsets

git-svn-id: branches/debug_eh@42255 -
2019-06-20 17:13:28 +00:00
Jonas Maebe
1b6425176b * synchronised with trunk till r42049
git-svn-id: branches/debug_eh@42050 -
2019-05-12 18:44:05 +00:00
Jonas Maebe
281b3ad276 * fix case completeness and unreachable code warnings in compiler that would
be introduced by the next commit

git-svn-id: trunk@42046 -
2019-05-12 14:29:03 +00:00
Jonas Maebe
fc60ec2ea4 + support for LLVM LTO: compile units with -CLflto -> when compiling a main
program/library also with -Clflto, all units compiled with that option
    will be linked using their bitcode files and LTO
   o compiling with -CLflto will compile all units twice: once for normal
     (static or smart) linking, and once for LTO. So the result can be
     used both with and without LTO.

git-svn-id: branches/debug_eh@41910 -
2019-04-20 18:56:11 +00:00
Jeppe Johansen
2b78a8fd3d - Add support for .option directive in riscv assembler.
- Use addiw when adjusting U32 to S32

git-svn-id: trunk@41870 -
2019-04-14 20:51:29 +00:00
florian
a092da723a + new fields for more precise control of alignment
+ support of new alignment control values for GNU AS writer
+ support of new alignment control values for binary writer
* better alignment settings on i386-win32
* improved inserted align directives for if nodes

git-svn-id: trunk@40159 -
2018-11-01 20:49:17 +00:00
florian
68eb921d46 * broken compilation after r39347 fixed
git-svn-id: trunk@39349 -
2018-06-30 12:30:25 +00:00
nickysn
3d6d020fca + implemented the actual writing of LINNUM OMF records
git-svn-id: trunk@39008 -
2018-05-16 17:37:28 +00:00
nickysn
61e6d2afec + introduce asd_omf_linnum_line directives; they will be used for writing LINNUM
entries in the OMF object format

git-svn-id: trunk@39007 -
2018-05-16 17:05:02 +00:00