Commit Graph

649 Commits

Author SHA1 Message Date
florian
ce070c93fc + patch by Jeppe Johansen to support the SC32442B
git-svn-id: trunk@20081 -
2012-01-14 21:39:32 +00:00
florian
7070fef055 * patch by Jeppe Johansen to fix postprocessexecutable for the embedded target if host and target OS have different endianess, resolves #20926
git-svn-id: trunk@19913 -
2011-12-29 17:27:28 +00:00
Jonas Maebe
8d2a7f3b88 * switched linux/ppc64 to tf_smartlink_sections (works fine even with
binutils 2.17, which is kind of ancient by today's standards),
    since it's much faster than tf_smartlink_library without an internal
    assembler 

git-svn-id: trunk@19680 -
2011-11-24 23:46:05 +00:00
pierre
4bda40649d * Add missing CATRES substitution and remove blank lines in link.res
git-svn-id: trunk@19667 -
2011-11-22 11:15:23 +00:00
pierre
30baddd3b8 Fix Haiku shared library creatiion
git-svn-id: trunk@19665 -
2011-11-21 14:14:31 +00:00
Jonas Maebe
3188916cda * also replace $CATRES for shared libraries (fix for r19649)
git-svn-id: trunk@19661 -
2011-11-20 20:06:43 +00:00
pierre
836da25e81 * Do not call with UseShell = true if CatFileContent expands the file into parameters
git-svn-id: trunk@19650 -
2011-11-18 22:08:51 +00:00
pierre
b1bd1d29ec Replace cat $RESby $CATRES and call CatFileContent method
git-svn-id: trunk@19649 -
2011-11-18 21:33:24 +00:00
pierre
98c7a5e4b0 * Enable internal elf writer for freebsd x86_64 target
git-svn-id: trunk@19608 -
2011-11-08 14:05:57 +00:00
Jonas Maebe
f2823a1d68 * r17629 changed the condition for generating safecall code on x64 and ARM
platforms from testing for a Windows target into testing to the
    tf_safecall_exceptions target flag. However, this flag was not set for
    non-i386 Windows platforms (mantis #20385)

git-svn-id: trunk@19486 -
2011-10-14 16:11:46 +00:00
pierre
0cd15043b3 * Set a default dynamic linker for OpenBSD
git-svn-id: trunk@19451 -
2011-10-10 21:45:21 +00:00
pierre
4601bca836 * i386 OpenBSD target also uses GOT for pic code
git-svn-id: trunk@19450 -
2011-10-10 21:44:44 +00:00
pierre
94eea3eca7 * Fix source info for openbsd
git-svn-id: trunk@19412 -
2011-10-08 09:53:46 +00:00
pierre
4a8b37016a i386-OpenBSD 4.9 has no underscore prefix
git-svn-id: trunk@19377 -
2011-10-04 22:33:13 +00:00
paul
7a74d2c2f8 compiler: reduce amount of hints and notes
git-svn-id: trunk@19293 -
2011-09-30 08:56:05 +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
1f0e5b496f Try to support shared libraries for freebsd
git-svn-id: trunk@19242 -
2011-09-26 10:25:27 +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
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
e9f2f3388e * use dwarf2 on avr-embedded by default because stabs is difficult due to name mangling issues
git-svn-id: trunk@18973 -
2011-09-04 19:37:26 +00:00
florian
0781ac1f82 + support for lpc1768 by David Welch
git-svn-id: trunk@18927 -
2011-08-31 20:17:23 +00:00
florian
df01d0209e * report code and data size for embedded targets
git-svn-id: trunk@18866 -
2011-08-27 22:03:40 +00:00
florian
a08dfdf803 o slightly modified patch by John Clymer:
* converts the embedded information into controller specific records (arm and avr)
  * new cpu-specific units for several Stellaris (Fury and Tempest class) targets, 
  + STM32F103RB
  - old Stellaris unit has been removed

git-svn-id: trunk@18848 -
2011-08-25 21:46:26 +00:00
Jonas Maebe
ec8c7b4888 + when compiling for Darwin/ARM, pass the subarchitecture to the linker.
The old linker option to accept object files from all subarchitecture
    types no longer works.
  + support for subarchitectures in fcl-res/fpcres

git-svn-id: trunk@18070 -
2011-08-02 20:41:39 +00:00
florian
95ad75c7bf * hack to set stack top for atmega128
* default output for avr-embedded is .hex

git-svn-id: trunk@18015 -
2011-07-17 20:46:05 +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
3cc2b5e97b + Added default dynamic linker for mips CPU
git-svn-id: trunk@17889 -
2011-07-01 07:37:05 +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
Legolas
2503ac1d97 * Updated nds to devkitARM r33
git-svn-id: trunk@17843 -
2011-06-27 12:22:46 +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
e4bb241409 * Silence warning in MakeSharedLibrary
git-svn-id: trunk@17750 -
2011-06-14 12:37:27 +00:00
Jonas Maebe
78c3e6b359 * always use crtbeginS.o/crtendS.o when generating PIC code, not just when
generating libraries for x86_64 (at least all Linux systems I checked
    have the S-variants of those files) (mantis #19501)

git-svn-id: trunk@17713 -
2011-06-10 14:17:20 +00:00
joost
45bc3fcae0 * Enabled safecall on x86_64-linux
git-svn-id: trunk@17629 -
2011-06-02 10:43:18 +00:00
Jonas Maebe
1b5fed238a * don't quote the Darwin syslibroot path in link.res, it's not reinterpreted
by the shell since it's cat'ed into the command line

git-svn-id: trunk@17422 -
2011-05-09 21:26:36 +00:00
Jonas Maebe
9cd6a7ad85 * correctly handle -XR (sysroot) paths with spaces under Darwin
git-svn-id: trunk@17421 -
2011-05-09 20:14:17 +00:00
paul
d21bbc4548 compiler: reduce amount of hints and warnings
git-svn-id: trunk@17350 -
2011-04-20 02:58:52 +00:00
florian
7f0d245ac2 * reintegrate avr branch into trunk, work on avr is less invasive than I thought so it can be continued in trunk
git-svn-id: trunk@17348 -
2011-04-19 20:17:52 +00:00
florian
fb84cb865b * rebase to trunk@17295
git-svn-id: branches/avr@17296 -
2011-04-10 19:20:48 +00:00
florian
ebe8078263 * compilation fixed
git-svn-id: branches/avr@17293 -
2011-04-10 18:43:44 +00:00
florian
610fa89484 + basic avr linker script
git-svn-id: branches/avr@17292 -
2011-04-10 18:43:04 +00:00
florian
3ce9ff93f1 + patch by Jeppe Johansen to support automatic interrupt table generation by using the interrupt directive with an offset. Not activated yet because it requires to change also the startup code of the different mcus.
git-svn-id: trunk@17279 -
2011-04-10 15:59:06 +00:00
armin
672d76e636 added a segment table containing segments for symbols defined by linker script (needed for relocs)
git-svn-id: trunk@17268 -
2011-04-07 19:38:25 +00:00
armin
7eace122dc internal linker support for creating novell netware loadable modules
git-svn-id: trunk@17192 -
2011-03-27 14:47:25 +00:00
Legolas
5fc349eda7 * Fixed stacksize for Wii
git-svn-id: trunk@17035 -
2011-02-27 19:27:12 +00:00
Jonas Maebe
601b90d74c * don't specify a custom pagezero size on Mac OS X when compiling with -gv
(Valgrind support), because Valgrind cannot deal with that

git-svn-id: trunk@16916 -
2011-02-14 20:31:30 +00:00
Legolas
527dd56b28 + Initial Wii support
git-svn-id: trunk@16888 -
2011-02-07 16:56:45 +00:00