Commit Graph

141 Commits

Author SHA1 Message Date
Jonas Maebe
4686f61002 * keep track of the temp position separately from the offset in references,
so that they can still be freed after the reference has been changed
    (e.g. in case of array indexing or record field accesses) (mantis #33628)

git-svn-id: trunk@38814 -
2018-04-22 17:03:16 +00:00
florian
0baf3f69d8 * modified patch of Sergey Shishmintzev: add a __text_start symbol if an external linker is used, resolves #26190
git-svn-id: trunk@38235 -
2018-02-13 21:16:58 +00:00
Károly Balogh
e6aed467b5 renamed script unit to cscript to avoid namespace conflict with univint package on Darwin. this makes it possible to build the textmode IDE on Darwin
git-svn-id: trunk@37598 -
2017-11-17 11:27:19 +00:00
florian
b1dff29cbf * removed unused units
git-svn-id: trunk@36165 -
2017-05-09 19:53:14 +00:00
florian
0897bd154a + align(<int64>,<int64>) and align(<qword>,<qword>), resolves an issue reported on the mailing list with large records
+ tests
* trecordsymtable.insertunionst takes a asizeint parameter
* changed one aint into a asizeint

git-svn-id: trunk@35662 -
2017-03-26 09:35:56 +00:00
Jonas Maebe
a25ebbba3e + added volatility information to all memory references
o separate information for reading and writing, because e.g. in a
     try-block, only the writes to local variables and parameters are
     volatile (they have to be committed immediately in case the next
     instruction causes an exception)
   o for now, only references to absolute memory addresses are marked
     as volatile
   o the volatily information is (should be) properly maintained throughout
     all code generators for all archictures with this patch
   o no optimizers or other compiler infrastructure uses the volatility
     information yet
   o this functionality is not (yet) exposed at the language level, it
     is only for internal code generator use right now

git-svn-id: trunk@34996 -
2016-11-27 18:17:37 +00:00
svenbarth
2808be3e20 + add and use sysinit unit for Win64 (only one since we don't support cygwin and gprof there)
* switch Win64 to indirect entry information

git-svn-id: trunk@34307 -
2016-08-13 19:10:27 +00:00
Jonas Maebe
aa1be3276f - removed default value of _typ parameter of TAsmData.(Weak)RefAsmSymbol():
it was AT_NONE, which is invalid and should never be used
  * explicitly pass the correct value for all calls to those methods elsewhere
    in the compiler

git-svn-id: trunk@34250 -
2016-08-05 07:09:16 +00:00
Jonas Maebe
1cb8c0d00c * specify the def of assembler level symbols defined via
tasmdata.DefineAsmSymbol() and all routines that call it
   o will be used to automatically generate AB_INDIRECT sybols when
     necessary

git-svn-id: trunk@34164 -
2016-07-20 20:52:59 +00:00
pierre
fba50767b3 Add SUPPORT_OMF conditional to be able to test OMF for win32/win64 targets, not working for now
git-svn-id: trunk@34076 -
2016-07-06 06:08:01 +00:00
svenbarth
adbef4fc84 New export option that enforces the use of the provided export name instead of using the name of the provided symbol. This is necessary to correctly handle overloaded functions, especially if one of them is an internproc one.
export.pas:
  + texportoption: new option eo_no_sym_name
pkgutil.pas:
  * exportprocsym: set eo_no_sym_name when exporting procdefs from a package
systems/t_win.pas, TExportLibWin:
  * generatelib: respect eo_no_sym_name

git-svn-id: trunk@33574 -
2016-04-29 15:03:18 +00:00
svenbarth
716b3082e9 Merged revision(s) 28792 from branches/svenbarth/packages:
Provide a possibility to ignore duplicate symbols for exporting.

export.pas, texportlib:
  + new property "ignoreduplicates" with which duplicate symbols are ignored upon insertion
  + new method "duplicatesymbol" which checks "ignoreduplicates" and generates an error if it is False (this method needs to be used if a duplicate was detected)
expunix.pas, texportlibunix:
  * exportprocedure: use "duplicatesymbol" instead of always generating an error
systems/t_beos.pas, texportlibbeos:
  * exportprocedure: use "duplicatesymbol" instead of always generating an error
systems/t_haiku.pas, texportlibhaiku:
  * exportprocedure: use "duplicatesymbol" instead of always generating an error
systems/t_nwl.pas, texportlibnetwlibc:
  * exportprocedure: use "duplicatesymbol" instead of always generating an error
systems/t_nwm.pas, texportlibnetware:
  * exportprocedure: use "duplicatesymbol" instead of always generating an error
systems/t_win.pas, texportlibwin:
  * exportfromlist: use "duplicatesymbol" instead of always generating an error
........

git-svn-id: trunk@32974 -
2016-01-22 13:57:41 +00:00
svenbarth
3b71841a84 Merged revision(s) 28691, 31914 from branches/svenbarth/packages:
Convert export options from constants to a set and accordingly adjust all usage locations

git-svn-id: trunk@32945 -
2016-01-15 16:06:06 +00:00
yury
432248cbf1 * Removed lot of unused vars.
git-svn-id: trunk@31732 -
2015-09-17 12:48:58 +00:00
Jonas Maebe
0d74e4f719 * changed paratargetdbg from a global variable into a field of toption
git-svn-id: trunk@31443 -
2015-08-28 22:31:17 +00:00
nickysn
d4a4b9a57b * refactored the internal linker ar object reader object creation to allow using
different 'ar' implementations under different platforms
* use the omflib reader instead of the ar reader in the msdos internal linker

git-svn-id: trunk@31322 -
2015-08-14 13:52:45 +00:00
nickysn
d204aaab72 * refactored "ar" object writer creation in the internal assembler to allow
having different implementations of an internal "ar" writer

git-svn-id: trunk@30667 -
2015-04-19 16:35:16 +00:00
florian
2c5a0ffc89 * make windres the default resource compiler on x86_64-win64
git-svn-id: trunk@27041 -
2014-03-09 10:52:10 +00:00
florian
4d5119bf1c * fixes several issues which cause warnings by the dfa code when using it to detect uninitialized variables
git-svn-id: trunk@26161 -
2013-12-01 17:02:08 +00:00
sergei
38058505ba * Changed linking infrastructure to look like assembler one:
* Changed direct references to linker classes in TSystemInfo records to enumerated ids.
  * RegisterExtennalLinker and RegisterInternalLinker procedures replaced by single RegisterLinker procedure and moved to link.pas.
  - TAbstractLinker is no longer necessary, removed.

This change allows to register linker once per id, rather than once per target, and also allows TSystemInfo records to be read-only.

git-svn-id: trunk@25279 -
2013-08-18 12:01:21 +00:00
marco
09e742f243 * add a -dfpc define to the resource compiler commandlines, which allows to make FPC specific exceptions in resource scripts. Mantis #24044
git-svn-id: trunk@24438 -
2013-05-04 21:25:36 +00:00
sergei
73030ddb57 + Support smart-linked .rdata section with external linker for Windows targets after r23025.
git-svn-id: trunk@23084 -
2012-12-01 15:04:23 +00:00
sergei
1a25aed68d * Renamed a method for consistency (let script building methods start with ScriptAdd).
git-svn-id: trunk@21814 -
2012-07-07 22:49:05 +00:00
sergei
346fbef445 * Factored a common linker script building block into separate method.
git-svn-id: trunk@21730 -
2012-06-28 17:18:02 +00:00
sergei
6571b4d140 * Factored code to create internal link script for debug sections into a separate procedure.
git-svn-id: trunk@21410 -
2012-05-28 13:28:21 +00:00
Jonas Maebe
c27f9da1b2 * always surround ld link.res SEARCH_DIR() arguments with double quotes,
rather than with single/double quotes depending on the target platform
    (ld only supports double quotes), and rather than only quoting when
    necessary (wastes time since quotes are always allowed, and double
    quotes inside a directory name cannot be escaped for ld; they are
    simply not supported by the program) (mantis #22059, follow-up to
    r21069 and r21208)

git-svn-id: trunk@21343 -
2012-05-20 13:30:51 +00:00
Jonas Maebe
0841ee6e4f * GNU ld only supports double quotes in its response file -> requote there
as well under Unix (mantis #21928, caused by r21069)

git-svn-id: trunk@21208 -
2012-05-03 12:41:16 +00:00
Jonas Maebe
14cfe770a4 * replaced most (if not all) remaining fields/parameters in the compiler
that deal with paths/filenames with TPathStr (= ansistring) to prevent
    cutting off long paths (no change in speed when compiling the compiler,
    1% extra memory usage)

git-svn-id: trunk@21120 -
2012-04-29 17:36:23 +00:00
florian
d7f7a9bb76 * patch by Alexander Shishkin to clean up $ifopt usage by $push/$pop, resolves #20346
git-svn-id: trunk@19256 -
2011-09-27 20:22:40 +00:00
pierre
841b3e4179 TImportLibWin.generateimportlib method:
local procedure AddImport: Use same RIP relative code
  as in ogcoff unit for x86_64 CPU to allow a VMA above
  0x100000000 even when using.
  TImportLibWin.generateidatasection;
  also used RIP base for import libraries created using -WI option.

git-svn-id: trunk@19161 -
2011-09-20 15:25:13 +00:00
sergei
6280ee2eed * Changed attributes of .pdata section so it is smart-linkable on x86_64.
* Changed alignment of .pdata section to 4.
+ Support saving RELOC_NONE relocations to .o files and reading them back on x86_64.

git-svn-id: trunk@19070 -
2011-09-15 15:22:03 +00:00
pierre
d1a6ef9cd9 * Restrict use of postw32 external utility to
win32/wdosx target systems.

git-svn-id: trunk@17929 -
2011-07-04 07:36:47 +00:00
pierre
c611c91cef Provide _tls_index in script
git-svn-id: trunk@17901 -
2011-07-01 14:27:33 +00:00
pierre
0227fbad7d * Fix some internal linker script lines
git-svn-id: trunk@17881 -
2011-06-30 13:02:31 +00:00
pierre
446c128e71 * Double LONG (-1) and LONG (0) for x86_64 linker script
git-svn-id: trunk@17862 -
2011-06-28 20:41:05 +00:00
pierre
239944f8d0 + Use DLL name in assembler labels used to import DLL functions/variables
in Windows, Emx and OS2 targets.
    This fixes test failures: test/library/tlib1b.pp and lib2b.pp

    link unit TLinker.AddImportSymbol: Added symmangledname parameter.
    ogbase unit TImportSymbol.Create: Add AMangledName parameter.
    fmodule unit TModule.AddExternalImport: Add symmangledname parameter.
    fppu unit: Also put mangled name string for imported symbol.
    ppu unit: Increase PPUVersion
    utils/ppudump.pp: Adapt to PPU change above.
    systems/T_OS units: Use ImportSymbol.MangledName property to create
    import libraries or .idata sections.

git-svn-id: trunk@17804 -
2011-06-23 11:38:57 +00:00
pierre
1a9f4ba314 * Improve ogbase linker script support, add warnings for unknown entries
git-svn-id: trunk@17784 -
2011-06-21 16:49:50 +00:00
pierre
7c04d8d13b From patch submitted by Willibald Krenn in Bug Report 17500.
* assemble.pas (TInternalAssembler.WriteStab): Use RELOC_ABSOLUTE32 for
   32-bit stab entry.
 * ogcoff.pas: Add check for correct generated reloc section size.
 * systems/t_win.pas: Use 0x400000 image base for x86_64 programs using
   stabs debug information format.

git-svn-id: trunk@16056 -
2010-09-28 10:06:54 +00:00
pierre
cd0329a15e * fix target options for GNU ld
git-svn-id: trunk@15938 -
2010-09-02 06:59:01 +00:00
pierre
d27278faac * Add external linker possibility for windows x86_64 compiler
git-svn-id: trunk@15761 -
2010-08-10 11:28:31 +00:00
Jonas Maebe
ab2b596575 * ld uses arm_wince_pe rather than arm-wince-pe (mantis #15666)
git-svn-id: trunk@15707 -
2010-08-04 19:01:46 +00:00
Jonas Maebe
879e487ee8 * changed linker target name for WinCE from arm-pe into arm-wince-pe
(mantis #15666)

git-svn-id: trunk@14872 -
2010-02-06 20:22:15 +00:00
florian
c1f3d8dcaa * unified names of system_*/systems_* sets
git-svn-id: trunk@14566 -
2010-01-07 18:16:20 +00:00
florian
34227e811d + patch by Sven Barth to add native NT rtl support to the compiler, resolves #14886
git-svn-id: trunk@14565 -
2010-01-07 17:42:11 +00:00
yury
9a0808d0fb * Set default image base for win64 dlls to $110000000.
git-svn-id: trunk@13160 -
2009-05-17 12:47:26 +00:00
Jonas Maebe
4106ce540f * fixed compilation with -Cr after r13147
* changed type of minstacksize, maxstacksize and imagebase from aword
    (= size of integer registers of the target platform) into puint
    (= size of address space of target platform)

git-svn-id: trunk@13155 -
2009-05-17 10:07:54 +00:00
yury
78b2618db6 * Fixed setting of image base using {$IMAGEBASE X} directive.
* Cleanup of relative code.

git-svn-id: trunk@13147 -
2009-05-15 23:12:02 +00:00
yury
187a145358 * Fixed build for ARM targets.
git-svn-id: trunk@13142 -
2009-05-14 08:47:18 +00:00
yury
f726e1691b * Fixed warnings and notes.
git-svn-id: trunk@13139 -
2009-05-13 11:26:01 +00:00
yury
e23a304254 * Set default images base to $100000000 for win64 executables as done by MS linkers. It helps to detect portability errors early.
git-svn-id: trunk@13138 -
2009-05-13 10:56:33 +00:00