Commit Graph

226 Commits

Author SHA1 Message Date
nickysn
eddab86312 * pass the -b option to wlib to avoid creating .bak files
git-svn-id: trunk@27270 -
2014-03-24 17:35:11 +00:00
pierre
754790f641 Use new static library not supproted message
git-svn-id: trunk@26598 -
2014-01-27 22:29:07 +00:00
pierre
bef22b2a6f Add scripted version of wlib call for msdos
git-svn-id: trunk@26442 -
2014-01-12 22:47:27 +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
sergei
eec8129738 * TInternalLinker.Load_ReadStaticLibrary: exit if error has occurred while opening a static library or dynamic object, continuing can cause other errors/crashes in this case.
* t_linux.pas: use sysrootpath when specifying dynamic interpreter (for cross-linking).

git-svn-id: trunk@25277 -
2013-08-18 09:14:16 +00:00
Károly Balogh
a11c113429 reverted the link object search change
git-svn-id: trunk@24727 -
2013-06-01 15:35:59 +00:00
Károly Balogh
e7094cf1d6 fix redundant searches in FindObjectFile, if the object was found on the first try
git-svn-id: trunk@24725 -
2013-06-01 15:21:57 +00:00
nickysn
a1ee8ab9bc * suppress annoying wlib header
git-svn-id: branches/i8086@23967 -
2013-03-23 00:08:52 +00:00
nickysn
ac64663e70 + openwatcom wlib support added
git-svn-id: branches/i8086@23964 -
2013-03-22 23:44:33 +00:00
sergei
a1503b51f2 + chmod 755 on executable files produced by internal linker. I missed this "small" detail for half a year because all development was going on a NTFS drive where everything is executable.
git-svn-id: trunk@23374 -
2013-01-13 17:18:11 +00:00
sergei
36859068f5 * Propagate AS_NEEDED flag further into Load_DynamicObject and handle it properly: shared objects marked with AS_NEEDED are added to dependencies only if they actually resolve some symbol.
* Dropped TObjInput.newObjData method. Instead, TObjData instances are created directly in ReadObjData, this gives possibility to create a different type of TObjData based on file header.
- Dropped TObjInput destructor, it does nothing except calling inherited.

git-svn-id: trunk@23118 -
2012-12-06 18:19:19 +00:00
sergei
7d19a6d551 * Propagate AS_NEEDED flag down the expression tree an assign it to TStaticLibrary objects.
git-svn-id: trunk@23116 -
2012-12-05 16:05:16 +00:00
sergei
49501413e1 + Support library grouping in internal linker script, use it to load C libraries.
git-svn-id: trunk@22962 -
2012-11-09 14:38:11 +00:00
sergei
6d70009f06 + ELF linker. Works on x86_64-linux and i386-linux good enough to pass the testsuite, but still requires a lot of work in nearly all aspects. In particular, no attempt to resolve symbols from shared libs is done, everything is just treated as imports. Symbol versioning isn't supported either.
x86_64 is the most elaborated, has some degree of indirect function (GNU_IFUNC) and TLS support, so it is even able to link with static libc/pthreads code (tw14265) and produce an executable that can launch (but still fails due to invalid DWARF unwind info).

i386 produces working shared libraries if they are compiled with -Cg, without one your mileage may vary. tw14265 does not link yet due to missing COMDAT group support.

git-svn-id: trunk@22775 -
2012-10-19 17:21:08 +00:00
sergei
d79511f96e + Basic ld script parsing capabilities (barely enough to parse glibc2.1 'libc.so' files, lacks any error handling).
+ Support linker input source grouping functionality.
* Promote TStaticLibrary to something like generic linker input statement, it can now hold regular ObjData or a group of other TStaticLibrary objects in addition to tarobjectreader.

git-svn-id: trunk@22155 -
2012-08-21 08:37:39 +00:00
sergei
1d09005542 + Implemented two-stage removal of empty exe sections. Candidates for removal are first marked with oso_disabled flag, then actually removed. Descendants of TExeOutput that override MemPos_Start may modify list of sections pending removal. In particular, the COFF-specific .reloc section no longer has to be handled in base TExeOutput class.
git-svn-id: trunk@21971 -
2012-07-26 10:04:12 +00:00
sergei
31d004e056 + Basic executable stack support in TExeOutput.
+ Two stubs (TExeOutput.Load_DynamicObject and TObjInput.CanReadObjData) to override in ELF linker.
+ Stop linking if errors were detected while loading object files.
* Changed TStaticLibrary to TObject. It is never looked up by name, so hashing is redundant; moreover its name has been changed to TCmdStr, which may be trimmed by TFPHashList. 

git-svn-id: trunk@21968 -
2012-07-25 11:08:54 +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
80bbd388f9 * Made removal of unused ExeSymbols a separate procedure, call it earlier and regardless of presence of the 'SYMBOLS' directive in the linker script.
git-svn-id: trunk@21727 -
2012-06-27 20:26:49 +00:00
sergei
a2f0e54dc6 * Fixed internal linker entering infinite loop if script contains empty lines or comments.
git-svn-id: trunk@21650 -
2012-06-18 17:03:35 +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
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
Jonas Maebe
02413c8a57 * moved maybequoted() from cutils to cfileutl and let its behaviour vary
based on the actual target platform rather than always on the host
    platform
  * on Unix, use single rather than double quotes for quoting, so it also
    properly handles $, ! and `, which keep their special meaning when
    appearing in scripts inside double quotes
  * since sysutils.executeprocess() can only deal with double-quoted
    strings in parameters, re-quote parameters on Unix when they turn
    out not to be for scripts but for direct execution (which is most
    of the time, but unfortunately doing the reverse is not possible
    because parameters used in scripts sometimes contain script-specific
    code that must not be quoted, such as `cat link.res`)
   -> always use cfileutl.RequotedExecuteProcess() rather than
    sysutils.ExecuteProcess() in the compiler (added a bunch of dummy
    ExecuteProcess string constants to common units to prevent accidental
    usage)

git-svn-id: branches/jvmbackend@20901 -
2012-04-16 19:52:36 +00:00
Jonas Maebe
ddde9760c2 * ignore tf_no_backquote_support in source_info.flags in case we will link
on the target system (-St command line option during cross-compiling)

git-svn-id: trunk@20817 -
2012-04-11 18:04:36 +00:00
pierre
5d6a7dc03d + TExternalLinker.CatFileContent method and tf_no_backquote_support tsystemflags enum value
git-svn-id: trunk@19648 -
2011-11-18 21:32:25 +00:00
paul
7a74d2c2f8 compiler: reduce amount of hints and notes
git-svn-id: trunk@19293 -
2011-09-30 08:56:05 +00:00
pierre
bcb2bb9e5b Add removal of braces for parameters in linker script
git-svn-id: trunk@17902 -
2011-07-01 14:28:18 +00:00
pierre
f328836cad + Add checks for internal linker script
git-svn-id: trunk@17882 -
2011-06-30 13:16:04 +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
florian
81bd7867b3 * it makes no sense to search the windows dirs for dlls when cross compiling
git-svn-id: trunk@17687 -
2011-06-07 19:24:53 +00:00
florian
0c62133d38 * patch by Mattias Gaertner to allow to override how the compiler reads source/ppu files, resolves #18740
git-svn-id: trunk@17255 -
2011-04-05 20:10:09 +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
florian
26fbfaf5a7 + introduce the usage of asizeint/asizeuint for cpus with sizeof("alu")<>sizeof(pointer)
git-svn-id: trunk@17011 -
2011-02-26 20:10:03 +00:00
Jonas Maebe
1f6ec379de * moved field definitions before method/property definitions (see mantis
#13971)

git-svn-id: trunk@13330 -
2009-06-27 11:27:31 +00:00
Jonas Maebe
78c12ba82b * only store debug link file name in .gnu_debuglink section
(mantis #13324)

git-svn-id: trunk@12884 -
2009-03-14 14:03:38 +00:00
Jonas Maebe
8adde04a0b * don't warn that a unit won't be smartlinked in case no .a file is
available when smart linking happens using the plain object files
    (mantis #12316)

git-svn-id: trunk@11874 -
2008-10-10 14:11:00 +00:00
yury
5e11e697b4 * Use unsigned integers for sizes and positions to break 2GB limit in tdynamicarray, object writer, internal linker, coff and PE headers.
git-svn-id: trunk@11480 -
2008-07-28 20:29:25 +00:00
yury
491f0fa1d8 * Replaced all user defined warnings by TODO comments to reduce compiler noise.
git-svn-id: trunk@11443 -
2008-07-23 11:00:03 +00:00
peter
de918497ef * support -Xg under linux
git-svn-id: trunk@9811 -
2008-01-20 12:12:15 +00:00
peter
793fd8fc09 * Add -Xg to help pages
* -Xg now produces a .dbg file with debuginfo
    that can be used by gdb. The main executable gets
    a debuglink section that references the .dbg file.

git-svn-id: trunk@9778 -
2008-01-17 01:20:37 +00:00
florian
d9e0f078e1 * continued to play around with package support
git-svn-id: trunk@9075 -
2007-11-02 22:26:43 +00:00
Jonas Maebe
a3c9dc5ec6 + support for {$linkframework x} to link to framework x (Darwin only)
+ support for {$frameworkpath x} and -Ffx to add x to the directories to
    search for frameworks (Darwin only)

git-svn-id: trunk@8165 -
2007-07-25 15:42:30 +00:00
daniel
9adb202a92 * Rework the constexprint to allow operations from low(int64) to high(qword).
+ Some initial work on a formaldef which also carries the typinfo of a parameter.

git-svn-id: trunk@7639 -
2007-06-13 07:41:18 +00:00
yury
55394d9e72 * Added FlushOutput after "Linking..." message by internal linker. Now this message is visible in Lazarus during linking.
git-svn-id: trunk@7518 -
2007-05-29 17:04:53 +00:00
yury
821c91c230 * fix Mantis #8760: do not put actually empty sections in executable by internal linker.
* .bss section no longer required by internal linker.

git-svn-id: trunk@7316 -
2007-05-12 13:32:52 +00:00
peter
9f3de7e809 * -Xg generates a separate file with the debug info sections
git-svn-id: trunk@6628 -
2007-02-24 15:06:31 +00:00
Jonas Maebe
90ea73a90b * more file handling from shortstring to tcmdstr
git-svn-id: trunk@6595 -
2007-02-21 21:54:54 +00:00
tom_at_work
106fe68ce6 * renamed TStringList to TCmdStrList, in general use TCmdStr instead of shortstrings to fix bug #6351
git-svn-id: trunk@6215 -
2007-01-26 22:29:39 +00:00