Commit Graph

81 Commits

Author SHA1 Message Date
pierre
bba4932ef9 * Fix commit 23220, by moving declaration from syscallh.inc to syscall.inc
git-svn-id: trunk@23221 -
2012-12-25 22:54:49 +00:00
pierre
70a29668a4 Try to fix simply the fpc_threadvar_relocate_proc problem
git-svn-id: trunk@23220 -
2012-12-24 16:23:30 +00:00
pierre
4295cc417e Fix PIC instruction for syscalls
git-svn-id: trunk@22497 -
2012-09-28 14:47:54 +00:00
pierre
d95ff52463 Add PIC code
git-svn-id: trunk@22496 -
2012-09-28 13:52:02 +00:00
pierre
20c9d19764 Add PIC specific code
git-svn-id: trunk@22484 -
2012-09-27 15:50:31 +00:00
pierre
62356c0e17 + add support for unlimited PIC mode
git-svn-id: trunk@22483 -
2012-09-27 15:50:02 +00:00
pierre
abef064786 Adapt TSigContext to structure found by debugging
git-svn-id: trunk@22482 -
2012-09-27 15:49:13 +00:00
pierre
5deddaec8c Adapt TSigContext to structure found by debugging
git-svn-id: trunk@22481 -
2012-09-27 15:48:54 +00:00
pierre
645698183d Integer Overflow signal must be mapped to error 215, not 205, which is for floating point overflow
git-svn-id: trunk@21807 -
2012-07-06 15:54:45 +00:00
pierre
94c8a75efd syscall 280 is __NR_tee for sparc CPU
git-svn-id: trunk@20922 -
2012-04-18 15:54:34 +00:00
florian
c7f846ebd5 + added missing syscalls so sparc-linux rtl compiles again
git-svn-id: trunk@19790 -
2011-12-09 20:35: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
ivost
d4cde5eaa2 * added syscall_nr_futex = 142 for sparc architecture
git-svn-id: trunk@16994 -
2011-02-24 10:51:54 +00:00
daniel
3307d98c40 - Revert micro-exe mode for now.
git-svn-id: trunk@16170 -
2010-10-15 16:49:48 +00:00
daniel
2139a229d3 + If no unit is used, no symbol inside the system unit is used,
and no language features requiring initialization are used,
    do not initialize units, but just configure the fpu and
    signal handlers.

git-svn-id: trunk@16124 -
2010-10-10 17:40:39 +00:00
Jonas Maebe
f6d452c2c0 * remove the RTL's installed signal handlers at the end of the system
unit's initialization code in case we're in a library
  + implemented InquireSignal(), AbandonSignalHandler(), HookSignal() and
    UnhookSignal() in the sysutils unit
  * for Kylix compatibility, these routines support operating on
    SIGINT and SIGQUIT as well, although they are not hooked by default
    by FPC. The run time errors/exception codes for these signals are
    resp. 217 and 233 (same as in Kylix; I changed ENoWideStringSupport
    to 234).
  * changed the BSD syscall version of fpsigaction to use pointer
    rather than "var" arguments (compatible with other targets, and
    required to be able to pass nil arguments inside the system unit)
  -> together fixes mantis #12704

git-svn-id: trunk@13077 -
2009-05-02 09:40:44 +00:00
micha
341cec908d * update linux syscall numbers (merge powerpc64 to powerpc)
git-svn-id: trunk@12106 -
2008-11-15 15:42:12 +00:00
marco
a123ec0d14 * More deprecated.
git-svn-id: trunk@7566 -
2007-06-03 18:55:36 +00:00
Jonas Maebe
cb23a80178 * fixed fpu rte code for invalid, inexact and "subscript out of range"
errors (216 -> 207) (same as for sparc/solaris in r7453)

git-svn-id: trunk@7477 -
2007-05-25 19:22:28 +00:00
Jonas Maebe
a2dbc4d272 * fixed multi-thread case of FPC_SYSCALL3 (all others were already correct)
git-svn-id: trunk@7476 -
2007-05-25 19:02:19 +00:00
Jonas Maebe
f8b40e90dc * exit -> exit_group to exit so unterminated threads are killed too
git-svn-id: trunk@7474 -
2007-05-25 17:48:24 +00:00
Jonas Maebe
cc03eacd2a * fixed program exitcode after change of operatingsystem_result from
word to longint

git-svn-id: trunk@7473 -
2007-05-25 13:07:23 +00:00
Jonas Maebe
b9a97ae891 * another sparc/linux fix for stat (record must NOT be packed, or
variables of that type will not be aligned properly)

git-svn-id: trunk@7460 -
2007-05-24 22:50:33 +00:00
florian
d7da24aae2 * fixed another bloody stat record issue
git-svn-id: trunk@7060 -
2007-04-05 09:38:06 +00:00
daniel
3a7266a462 * Handle FPC_USE_LIBC case for Sparc too.
git-svn-id: trunk@6967 -
2007-03-23 23:30:18 +00:00
daniel
084a78fdd3 * Make sparc/linux stat structure backward compatible too.
git-svn-id: trunk@6966 -
2007-03-23 23:24:12 +00:00
marco
57cfd89fbd * Linux 64-bit FS patch from neli for FPC_USE_LIBC
git-svn-id: trunk@6517 -
2007-02-16 22:16:54 +00:00
micha
b14c83a7e1 * stat records differ too much: use stat include file
git-svn-id: trunk@5126 -
2006-10-31 15:45:22 +00:00
Jonas Maebe
934734df85 + added missing syscalls from Mark Morgan Lloyd
git-svn-id: trunk@4339 -
2006-08-03 16:16:07 +00:00
marco
05bb11b2ba * syscalls regenerated by Neli.
git-svn-id: trunk@2552 -
2006-02-12 21:45:34 +00:00
peter
94f2b1d941 * add initialstkptr to get the stackpointer at startup before
PASCALMAIN is called so the main body framepointer is seen as
    a valid pointer with backtracing

git-svn-id: trunk@2266 -
2006-01-12 09:29:57 +00:00
florian
834ae15bd1 * fixed sparc building
git-svn-id: trunk@2063 -
2005-12-27 10:41:42 +00:00
florian
d4bb99a5fb + runerror 214: bus error/data misaligment
git-svn-id: trunk@1263 -
2005-10-03 08:25:20 +00:00
peter
4ace790492 * remove $Log
git-svn-id: trunk@231 -
2005-06-07 09:47:55 +00:00
fpc
790a4fe2d3 * log and id tags removed
git-svn-id: trunk@42 -
2005-05-21 09:42:41 +00:00
fpc
50778076c3 initial import
git-svn-id: trunk@1 -
2005-05-16 18:37:41 +00:00
peter
16b121f8c4 * unblock signal in signalhandler, remove the sigprocmask call
from setjmp
2005-04-24 21:19:22 +00:00
florian
c5be640fb6 * final fppipe fix hopefully 2005-03-03 22:02:59 +00:00
florian
314fe14247 + routines in baseunix can be overriden by processor specifics in bsyscall.inc 2005-03-03 20:58:38 +00:00
florian
a6b7be5ca1 + sparc specific pipe implementation 2005-03-03 20:13:44 +00:00
peter
e417e34496 * truncate log 2005-02-14 17:13:06 +00:00
peter
9db91c3f23 * set addr:=nil for other signals 2005-02-05 23:46:12 +00:00
peter
7335a0e9af * sigcontext is invalid, use siginfo only 2005-02-05 23:45:38 +00:00
peter
7fb8c3dfbd * signal cleanup for linux
* sigactionhandler instead of tsigaction for bsds
  * sigcontext moved to cpu dir
2005-01-30 18:01:15 +00:00
florian
aa9e238fb2 * more errno setting in sparc/linux mt programs fixed 2004-11-07 00:30:17 +00:00
florian
71c7fc8a7a * fixed errno setting in mt sparc/linux mt programs 2004-11-06 22:48:16 +00:00
florian
bfe0a81d81 * initial implementation 2004-11-05 21:36:36 +00:00
florian
df90903031 * fixed symbol names 2004-09-25 18:43:45 +00:00
florian
8540efa2f9 * first implementation 2004-09-25 12:25:32 +00:00
florian
241587174e * fixed fork for sparc 2004-08-22 12:34:11 +00:00