Commit Graph

12 Commits

Author SHA1 Message Date
florian
3e3b96e088 * fix of Erroneous reading of the value of the StackLength variable at program start based on issue report by Sergey Larin, resolves #40211 2023-03-21 22:37:40 +01:00
svenbarth
359bb64aed * if the Linux target is compiled with FPC_USE_LIBC the initialization of TLS is not required (according to one comment by Florian), so disable all related code in that case (as for example the syscall numbers are not available then)
git-svn-id: trunk@48120 -
2021-01-09 15:58:13 +00:00
florian
f6667a5143 * we have to use __tls_get_addr from the dyn. linker lib else tls on programs with pure pascal dyn. libraries fail
git-svn-id: trunk@43069 -
2019-09-25 21:19:01 +00:00
florian
597a23d278 + tls support for x86_64-linux (not yet enabled by default)
git-svn-id: trunk@41081 -
2019-01-27 09:37:25 +00:00
svenbarth
0f9451fbb7 * switch x86_64-linux to indirect entry, essentially allowing for the use of dynamic packages on that target
git-svn-id: trunk@36690 -
2017-07-08 20:39:36 +00:00
svenbarth
266eccde9f Merge revision(s) 32484 from branches/svenbarth/packages
Move PascalMain external from the si_*.inc files to a new include file si_impl.inc that's included in the implementation sections of the si_*.pp units

git-svn-id: trunk@33970 -
2016-06-12 16:49:56 +00:00
florian
c1091e1724 * added more asmmode directives to make compilation more robust in case the asmmode is changed by configuration files, resolves #27255
git-svn-id: trunk@29589 -
2015-01-31 10:37:48 +00:00
sergei
50639d89e7 * x86_64-linux startup: use ABI tag from abitag.o, cleaned out inlined versions.
git-svn-id: trunk@29578 -
2015-01-29 17:07:45 +00:00
sergei
3a3f7859f7 * x86_64-linux: ExitCode is passed as parameter to _haltproc, so assembler hacking with global variable is not necessary.
git-svn-id: trunk@29542 -
2015-01-24 15:28:00 +00:00
sergei
eb30da60a6 * x86_64-linux: fixed existing Pascal startup code (syntax only, operation not tested yet) and added missing files.
git-svn-id: trunk@27414 -
2014-03-31 15:57:11 +00:00
tom_at_work
9ce34c63c9 Fix shared library loading and unloading for Linux platforms. Shared library initialization and finalization are now called correctly at program startup for compile-time linked dynamic libraries on powerpc-/powerpc64-/arm-/i386- and x86_64-linux.
Every startup code must now provide an additional entry point called "_dynamic_start" that is set as new the entry point if the program links to a Pascal shared library. Its purpose is to set up an exit hook usually passed via a register, which should be called during program finalization if non-nil.

We use this additional entry point because this register only has meaningful content when there are any compile-time linked shared libraries, otherwise it often contains random garbage. The difference between the _dynamic_start and the original code is minimal; actually in all implementations the _dynamic_start code passes on control to the old startup code, so we use an additional entry point instead of an additional startup file.

Detailed changes and fixes list:
compiler:
  always link to the dynamic loader (ld.so) when compiling shared libraries. Fixes crashes in the loader during shared library finalization on some Linuxes
  remove additional ENTRY() section in arm linker script
  select either _dynamic_start or _start as entry point depending on whether this is a static or dynamic executable
powerpc*:
  do not set System.isLibrary in startup code, it will be set during library initialization anyway
  trap in case of reaching code locations that should not be reached instead of looping (possibly endlessly)
powerpc:
  register atexit() function pointer if supplied to the executable and call it during shutdown
  correctly set argc/argv/envp in shared library code and return correctly to the caller after initialization
  pass on exitcode in shared library haltproc
  use the more recent exit_group system call if available for shutdown
powerpc64
  fix .ptrgl stub, do not set the environment register to the value of the GOT entry in the function descriptor
arm
  do not set System.isLibrary in startup code, it will be set during library initialization anyway
  reload exitcode to pass to shutdown
mips,mipsel,sparc
  added stubs to allow correct linking

git-svn-id: trunk@19036 -
2011-09-08 21:17:35 +00:00
florian
0d97f9ab6c + initial implementation for x86_64, problem currently the usage of .section to create the necessary note section
git-svn-id: trunk@5491 -
2006-11-26 14:44:00 +00:00