Commit Graph

18398 Commits

Author SHA1 Message Date
nickysn
8458bbfaf6 + enabled the huge memory model command line option
git-svn-id: trunk@31495 -
2015-09-03 17:31:41 +00:00
nickysn
cf144a7fb7 * use a dummy non-nil pointer in FSectionsUsed and FSectionsInDGROUP, because
TFPHashList refuses to add an item with nil pointer data

git-svn-id: trunk@31494 -
2015-09-03 15:14:00 +00:00
nickysn
3b36e3d0b5 * declare segments as use16 or use32 in the nasm asm writer
git-svn-id: trunk@31493 -
2015-09-03 13:57:36 +00:00
nickysn
672ff1d863 * fixed memleak after r31487
git-svn-id: trunk@31492 -
2015-09-03 13:40:00 +00:00
nickysn
314b5e5eac * fixed class name in comment
git-svn-id: trunk@31491 -
2015-09-03 13:36:12 +00:00
Jonas Maebe
0031e12bf3 * enable the code that determines the complexity of arguments to inline
routines to see through free type conversions (such as type conversions
    inserted for absolute variables, like the 'result' variable)

git-svn-id: trunk@31490 -
2015-09-03 13:36:03 +00:00
Jonas Maebe
ee3f89246c * assume that compilerprocs never capture the addresses of their arguments
git-svn-id: trunk@31489 -
2015-09-03 13:35:59 +00:00
nickysn
92c831c3dd * writing of omf section attributes in the NASM asm writer rewritten to use the
new functions in unit omfbase (also used by the internal asm)

git-svn-id: trunk@31487 -
2015-09-03 13:32:17 +00:00
nickysn
cc2e27b555 * the function which returns the alignment of omf sections moved to unit
omfbase, so it can be used by the nasm asm writer as well

git-svn-id: trunk@31486 -
2015-09-03 12:36:58 +00:00
nickysn
3abfa177c4 * initialization of stack and dwarf debug omf sections moved from
TOmfObjSection.create to TOmfObjData.createsection and is now based on the
  section type (TAsmSectionType) instead of name (string)

git-svn-id: trunk@31485 -
2015-09-03 11:38:51 +00:00
nickysn
efef3882a0 * moved the code for determining whether an omf object section should
belong to group DGROUP to a function in unit omfbase (so it can be used in the
  future by the nasm asm writer as well)

git-svn-id: trunk@31484 -
2015-09-02 16:11:02 +00:00
nickysn
2e6d462ff6 * omf segment class names moved to a const array in omfbase, so they can be used
(in the future) in the nasm asm writer as well

git-svn-id: trunk@31483 -
2015-09-02 14:37:20 +00:00
nickysn
4061628ffb * the i8086-msdos default code segment (in near code memory models) renamed
'_TEXT'. This name is used in object modules, produced by Borland C and Open
  Watcom.

git-svn-id: trunk@31482 -
2015-09-02 13:14:12 +00:00
nickysn
1a8e203bf5 * moved the omf section names constant to the omfbase unit and use it also in
the nasm asm writer when targeting i8086-msdos

git-svn-id: trunk@31481 -
2015-09-02 12:28:46 +00:00
Jonas Maebe
5c5935346a * explain why we may have to search for the uppercase version of a symbol in
tcallnode.createintern()

git-svn-id: trunk@31479 -
2015-09-02 09:54:06 +00:00
Jonas Maebe
fbacf9682f * rename WinCE softfp compilerproc names to lowercase, needed since r31404
(mantis #28598)

git-svn-id: trunk@31478 -
2015-09-02 09:54:02 +00:00
sergei
5cfeaedd23 * Fixed copy&paste error introduced in r24398, resolves #28584.
git-svn-id: trunk@31475 -
2015-09-01 14:06:02 +00:00
florian
c9b1df2c91 * the test $-1,%reg optimization shall be done not only if the cpu type is i386, but for the i386 compiler
git-svn-id: trunk@31474 -
2015-08-31 20:03:56 +00:00
florian
63f828d54e * take care of nf_internal when doing range checking and inserting type conversions in tassignmentnode.pass_typecheck
git-svn-id: trunk@31473 -
2015-08-31 20:03:54 +00:00
florian
27828d41e7 * extended nodes which return true from is_const
git-svn-id: trunk@31472 -
2015-08-31 20:03:52 +00:00
florian
f00a55ae08 + tinlinenode.createintern
* do not do range checking on constants created by pred/succ if these nodes are created internally

git-svn-id: trunk@31471 -
2015-08-31 20:03:51 +00:00
florian
049491a573 + fold the constructs @<record type>(nil^).<field >) and @<record point>(nil)^.<field> used to get the offset of a field into a constant
git-svn-id: trunk@31470 -
2015-08-31 20:03:49 +00:00
florian
495b7181a8 + write the value of a pointer constant node in printnodedata
git-svn-id: trunk@31469 -
2015-08-31 20:03:47 +00:00
Jonas Maebe
f374b81c12 * disabled ARM-specific code for smallset in-operations on big endian targets,
as it's also little endian-specific (mantis #28592)

git-svn-id: trunk@31466 -
2015-08-31 13:06:42 +00:00
Jonas Maebe
4f38317bd2 * fixed small linker script syntax error in r31459
git-svn-id: trunk@31460 -
2015-08-30 15:45:57 +00:00
Jonas Maebe
6d29ad44f7 * always use a minimal linker script when we are not using -T, so that the
chance of conflicts with the built-in linkerscript is minimised
   o removed special case for AArch64 which that already
   o check the diff without whitespace changes, most is indentation

git-svn-id: trunk@31459 -
2015-08-30 15:25:44 +00:00
Jonas Maebe
c27807ee63 * resolve formal/anonymous external classes before comparing parameters to
overloaded routines

git-svn-id: trunk@31458 -
2015-08-30 14:33:01 +00:00
Jonas Maebe
e720b44471 * expand the error message for when trying to use a formal class with an
explanation of what to do

git-svn-id: trunk@31457 -
2015-08-30 14:32:56 +00:00
Jonas Maebe
32c3f05522 + peepholeoptimizations to remove swap instructions
git-svn-id: trunk@31456 -
2015-08-29 21:06:29 +00:00
Jonas Maebe
dde8e323e0 * insert swap instructions if it results in store/regdealloc/load
sequences

git-svn-id: trunk@31455 -
2015-08-29 21:06:26 +00:00
Jonas Maebe
51864b0458 * skip temp (de)allocs when looking for store/regdealloc/load and
regalloc/regdealloc sequences

git-svn-id: trunk@31454 -
2015-08-29 21:06:23 +00:00
Jonas Maebe
6bb430e97c * also use the ARM/EABI linker script when targeting armhf
git-svn-id: trunk@31451 -
2015-08-29 13:00:03 +00:00
Jonas Maebe
882421a3ad * also use -T when cross-compiling a shared library using a sysroot on
Linux (we want to replace the entire built-in linker script in that case)

git-svn-id: trunk@31450 -
2015-08-29 12:26:12 +00:00
Jonas Maebe
e391a37b30 * add the sysrootpath to the path of the dynamic linker in the INPUT()
section for Linux

git-svn-id: trunk@31449 -
2015-08-29 12:26:08 +00:00
Jonas Maebe
8c8657e2d5 * base optimiser support for the JVM target
o jump threading only works for unconditional branches until now,
     as conditional ones have limited offsets

git-svn-id: trunk@31448 -
2015-08-29 10:08:19 +00:00
Jonas Maebe
c3a7d76c68 * ait_jcatch should not be skipped by optimizers, as it does result in
control flow

git-svn-id: trunk@31447 -
2015-08-29 10:08:15 +00:00
Jonas Maebe
3f9f498e0d - removed leftover alpha, ia64 and vis code
git-svn-id: trunk@31446 -
2015-08-28 22:31:29 +00:00
Jonas Maebe
bc62795f15 * removed no longer used simplify_ppu global
git-svn-id: trunk@31445 -
2015-08-28 22:31:24 +00:00
Jonas Maebe
21066ba3f3 * changed LinkTypeSetExplicitly from a global variable into a field of toption
git-svn-id: trunk@31444 -
2015-08-28 22:31:21 +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
Jonas Maebe
84bd523867 * changed paratargetasm from a global variable into a field of toption
git-svn-id: trunk@31442 -
2015-08-28 22:31:12 +00:00
Jonas Maebe
13638d958d * changed paratarget from a global variable into a field of toption
git-svn-id: trunk@31441 -
2015-08-28 22:31:08 +00:00
florian
199b1861d6 * fix wrong comparisons in trgobj.conservative to enable better coalescing,
before this patch, k was calculated wrong most of the time

git-svn-id: trunk@31439 -
2015-08-28 18:49:04 +00:00
svenbarth
66781b5526 Fix for Mantis #28530.
ptype.pas:
  * record_dec: if parse_generic is given set current_genericdef

+ added test

git-svn-id: trunk@31437 -
2015-08-28 15:46:18 +00:00
Jonas Maebe
0fc1fd6ac1 * replaced current_procinfo.currtrue/falselabel with storing the true/false
labels of LOC_JUMP in the node's location. This generates some extra jumps
    for short circuit boolean and/or-expressions if optimizations are off, but
    with optimisations enabled the generated code is the same (except for JVM
    because the jump threading optimisation isn't enabled there yet).

git-svn-id: trunk@31431 -
2015-08-27 18:28:57 +00:00
Jonas Maebe
10b2ea3b1b * use handle_locjump() instead of local inlined version
git-svn-id: trunk@31430 -
2015-08-27 18:28:52 +00:00
nickysn
e9c790f4eb + support 'SEG' in the i8086 inline assembler
git-svn-id: trunk@31428 -
2015-08-26 15:57:44 +00:00
nickysn
919cc8377a + added class type property CObjSymbol to TExeOutput as well
git-svn-id: trunk@31426 -
2015-08-25 16:07:59 +00:00
nickysn
19aab3fd31 + i8086-msdos internal linker: write symbol addresses in segment:offset format in the linker map file
git-svn-id: trunk@31425 -
2015-08-25 14:48:08 +00:00
nickysn
046a4e4114 * allow using a TObjSymbol subclass via using a "class of" type
git-svn-id: trunk@31424 -
2015-08-25 14:32:08 +00:00
nickysn
f41692710f - removed bogus comment from TMZExeUnifiedLogicalSegment.CalcMemPos
git-svn-id: trunk@31423 -
2015-08-25 14:04:51 +00:00
nickysn
2467cb34c2 * fixed MemBasePos calculation for segments that go beyond the previous segment base
git-svn-id: trunk@31421 -
2015-08-25 13:06:50 +00:00
nickysn
2c05bcc28f + i8086-msdos internal linker: in the far data memory models, fill
MaxExtraParagraphs in the MZ exe header according to the specified max heap
  size

git-svn-id: trunk@31420 -
2015-08-25 11:40:02 +00:00
nickysn
dad0f015a9 - removed the TOmfObjSectionGroup class, because it is not used
git-svn-id: trunk@31419 -
2015-08-25 11:32:30 +00:00
nickysn
0894ede9cd + enable the i8086-msdos internal linker
git-svn-id: trunk@31417 -
2015-08-25 01:32:46 +00:00
nickysn
6e20e0fc84 + added checks and error messages in case a 16-bit segment or group exceeds 64k
git-svn-id: trunk@31416 -
2015-08-25 01:01:20 +00:00
nickysn
851ebd9850 * use a normalized MemBasePos (i.e. offset<16) for stack segments
git-svn-id: trunk@31415 -
2015-08-25 00:29:02 +00:00
nickysn
f3d5bf3743 * the result of tobjsymbol.address changed from 'aword' to 'qword' as well
git-svn-id: trunk@31414 -
2015-08-25 00:19:26 +00:00
nickysn
8977c0fc78 * TExeSection.Size and .DataPos changed from aword to qword, because:
1) aword follows the ALU size of the CPU, not the address type
  2) MemPos is qword and is already checked against MaxMemPos

git-svn-id: trunk@31413 -
2015-08-25 00:08:02 +00:00
nickysn
fb1be14337 * yet another fix for the MZ relocation offsets
+ support RELOC_SEG and RELOC_SEGREL relocations pointing to an object section

git-svn-id: trunk@31412 -
2015-08-24 23:40:07 +00:00
nickysn
ba1c494cd6 * the code for displaying a symbol address in the linker map file moved to a
method in TObjSymbol

git-svn-id: trunk@31411 -
2015-08-24 22:12:00 +00:00
Jonas Maebe
677595880a + support for get_frame() for the LLVM target (using the llvm.frameaddress()
intrinsic)

git-svn-id: trunk@31409 -
2015-08-24 22:07:03 +00:00
Jonas Maebe
be9d2b1c26 * implement concatcopy for complex types by calling the llvm.memcpy()
intrinsic. This may insert actual calls to a function called memcpy with
    the signature of the libc function, but llvm optimizers are free to
    insert such calls by themselves already. This means that for non-libc
    targets, we will have to add weak symbols for memcpy/memmove/memset
    that call through to move/fillchar when using LLVM, so that these
    implementation are used when not linking to libc

git-svn-id: trunk@31408 -
2015-08-24 22:07:00 +00:00
Jonas Maebe
ba9d54beb5 * don't mangle symbol names for llvm intrinsics
git-svn-id: trunk@31406 -
2015-08-24 22:06:53 +00:00
Jonas Maebe
7a8921a060 * define CPULLVM when using the LLVM backend (in addtion to the CPUXXX define
for the actual target architecture)

git-svn-id: trunk@31405 -
2015-08-24 22:06:50 +00:00
Jonas Maebe
052af9200e * support external declarations for compilerprocs
o since there is no separate implementation for them, we have to immediately
     convert the symbol to lower case after parsing the declaration

git-svn-id: trunk@31404 -
2015-08-24 22:06:47 +00:00
nickysn
faa9362b44 + calculate and fill "min extra paragraphs" in the MZ header
git-svn-id: trunk@31403 -
2015-08-24 21:33:26 +00:00
nickysn
6665cec157 * put the startup code first also when using the internal linker in i8086 far
code memory models

git-svn-id: trunk@31402 -
2015-08-24 21:13:57 +00:00
nickysn
2100714ebe + implemented RELOC_SEG and RELOC_SEGREL fixups for a symbol target
* bug fix in the MZ relocation generated for RELOC_DGROUP/RELOC_DGROUPREL
  relocations
* reduced code duplication in TMZExeOutput.DoRelocationFixup a little by using
  nested procedures

git-svn-id: trunk@31401 -
2015-08-24 21:12:26 +00:00
nickysn
0eb1cd157a * don't subtract two from the end of the stack segment when calculating the
initial SP value - seems to be wlink compatible

git-svn-id: trunk@31399 -
2015-08-24 20:22:01 +00:00
nickysn
2431b6e63b * i8086-msdos internal linker: use a different approach for finding the stack
segment - either its class name must be 'STACK' (wlink compatible) or its
  combine type must be scStack (tlink compatible)

git-svn-id: trunk@31398 -
2015-08-24 20:18:44 +00:00
nickysn
d2a47a7c69 + fill the initial stack address in the MZ exe header
git-svn-id: trunk@31396 -
2015-08-24 18:28:00 +00:00
nickysn
ea27b97f3a * fixed the order of the _NULL and _AFTERNULL segments
git-svn-id: trunk@31395 -
2015-08-24 18:14:55 +00:00
nickysn
18cdc08c26 + prevent certain special omf sections from being smartlinked out
git-svn-id: trunk@31394 -
2015-08-24 18:10:50 +00:00
nickysn
fe69e3324c + implemented RELOC_DGROUP and RELOC_DGROUPREL in TMZExeOutput.DoRelocationFixup
git-svn-id: trunk@31393 -
2015-08-24 17:55:44 +00:00
nickysn
0eda4c954d + handle omf references to a segment with frame method=target
git-svn-id: trunk@31392 -
2015-08-24 17:34:04 +00:00
nickysn
d8f88599de + support REL_DGROUP and REL_DGROUPREL in TExeOutput.RemoveUnreferencedSections
git-svn-id: trunk@31391 -
2015-08-24 17:25:33 +00:00
nickysn
e88dc71983 + import DGROUP omf fixup references
git-svn-id: trunk@31390 -
2015-08-24 16:53:44 +00:00
nickysn
73ea3b7ff1 + implemented fixups targeting a logical segment offset in the omf internal linker
git-svn-id: trunk@31389 -
2015-08-24 15:50:47 +00:00
nickysn
3d3eb6c472 * stop with an error when encountering omf fixups that aren't yet implemented
git-svn-id: trunk@31388 -
2015-08-24 15:20:59 +00:00
nickysn
d7f08866e5 * use the TMZExeOutput.MZFlatContentSection property in TInternalLinkerMsDos.GetTotalSizeForSegmentClass
instead of finding the exe section by name

git-svn-id: trunk@31387 -
2015-08-24 15:09:35 +00:00
nickysn
449506ffb7 + write mz exe section data
+ fill MaxExtraParagraphs in the MZ header with $ffff by default, to prevent DOS
  from loading the program at the highest possible address

git-svn-id: trunk@31386 -
2015-08-24 15:02:37 +00:00
nickysn
fdbfaacec8 + calculate the MZ loadable image size (excluding bss, stack and heap)
+ only write the loadable image size number of bytes to .com files

git-svn-id: trunk@31385 -
2015-08-24 14:42:43 +00:00
nickysn
a7e63581b4 + i8086-msdos internal lniker: find the program entry point and fill it in the
mz exe header; also write it in the linker map file

git-svn-id: trunk@31384 -
2015-08-24 14:22:17 +00:00
nickysn
e0bd25191e + also take into account the frame method when converting the omf start address to a symbol
git-svn-id: trunk@31383 -
2015-08-24 13:46:37 +00:00
nickysn
cff94639d5 * i8086-msdos internal linker: improved handling of the _edata and _end internal
symbols - add them to 'DGROUP' and define them in a section with class 'BSS'

git-svn-id: trunk@31382 -
2015-08-24 12:39:39 +00:00
nickysn
989afc6ecb * show section addresses relative to the segment's MemBasePos in the i8086-msdos
internal linker map file

git-svn-id: trunk@31380 -
2015-08-24 01:31:16 +00:00
nickysn
368ba47d6e * support writing more than 1024 zeros in tobjectwriter.writezeros
git-svn-id: trunk@31379 -
2015-08-24 01:09:53 +00:00
nickysn
fa8841d575 + support omf group-relative fixups pointing to external symbol (e.g.
'wrt dgroup' references)
- removed debug code from TMZExeOutput.DoRelocationFixup

git-svn-id: trunk@31378 -
2015-08-24 00:55:56 +00:00
nickysn
173713ce57 * preserve original order (as specified in the link script) of omf sections with
the same name. This ensures that the startup code always comes first, which is
  important for .com files

git-svn-id: trunk@31377 -
2015-08-24 00:30:24 +00:00
nickysn
f182a98d7b * also preserve TObjSymbol.group when updating external with global symbols
git-svn-id: trunk@31376 -
2015-08-24 00:25:37 +00:00
nickysn
f08e98bfd0 + partial implementation of DoRelocationFixups for the i8086-msdos internal linker
git-svn-id: trunk@31375 -
2015-08-24 00:23:56 +00:00
nickysn
78cbb1ba2b + implemented writing .com files in the i8086-msdos internal linker
git-svn-id: trunk@31374 -
2015-08-23 22:06:30 +00:00
nickysn
fa9a1f706b + i8086-msdos internal linker: calculate the final segments and groups locations
in memory (incl. segment bases) before DoRelocations; list segments and groups
  in the map file as well

git-svn-id: trunk@31373 -
2015-08-23 21:36:24 +00:00
nickysn
5dc42404cf * capitalize omf segment class names, as that's how other 16-bit compilers write them
git-svn-id: trunk@31371 -
2015-08-22 19:07:04 +00:00
nickysn
e09ab50724 * capitalize the group name 'DGROUP' in the generated omf object files, because
that's how it is usually written by other 16-bit compilers

git-svn-id: trunk@31369 -
2015-08-22 16:28:36 +00:00
nickysn
70677e3e44 + added a descendant class for omf section groups, which adds base address, size
and a method to calculate these new fields

git-svn-id: trunk@31363 -
2015-08-22 12:23:49 +00:00
marco
f59b88f6f8 * Add support for libraries with C linking under Haiku
Patch by Olivier, mantis #28558

git-svn-id: trunk@31362 -
2015-08-22 12:23:15 +00:00
nickysn
b74a104e48 * instantiate TObjSectionGroup through a class type, to allow using a child
class for certain object formats

git-svn-id: trunk@31360 -
2015-08-22 11:27:22 +00:00
nickysn
9aeb94676c + added virtual method to tobjsection for returning a string representation of
the section's base address for the internal linker map file
* implemented it for omf sections to return the address in 'seg:ofs' format

git-svn-id: trunk@31359 -
2015-08-21 16:21:16 +00:00
nickysn
a762532ae1 * changed the MemPos field in TObjSection and TExeSection from aword to qword:
1) aword follows the ALU size of the CPU, not the address size
  2) it is already qword in TExeOutput and its methods and there's already
     MaxMemPos to check if the limits of the platform/exe format have been
     exceeded

git-svn-id: trunk@31357 -
2015-08-21 14:13:27 +00:00
nickysn
157345c9c2 + obtain and return the internal module name in brackets in the internal omf
library reader (just like the internal .ar reader does)

git-svn-id: trunk@31355 -
2015-08-20 23:24:54 +00:00
nickysn
808b5dfb78 * allow gaps between LEDATA records, as nasm seems to produce them. They're
automatically filled with zeros. This fixes reading of the tiny memory model
  startup code object module by the i8086-msdos internal linker.

git-svn-id: trunk@31354 -
2015-08-20 22:57:15 +00:00
nickysn
1b9eeee25d + order omf sections first by classname, then by name
git-svn-id: trunk@31352 -
2015-08-20 21:21:52 +00:00
nickysn
eed7e3aa6b + implemented GetCode/Data/BssSize in the i8086-msdos internal linker
git-svn-id: trunk@31351 -
2015-08-20 21:11:09 +00:00
nickysn
7d586df038 * override DoRelocationFixup in TMZExeOutput - doing nothing for now, but
prevents the "abstract method called" error

git-svn-id: trunk@31350 -
2015-08-20 20:55:24 +00:00
nickysn
0fb92b803b * set the MZ exe section limit to 640k
git-svn-id: trunk@31348 -
2015-08-20 15:01:39 +00:00
nickysn
07fff73527 * fixed the "Incompatible section options" error when using the omf internal linker to produce msdos executables
git-svn-id: trunk@31347 -
2015-08-20 14:50:59 +00:00
nickysn
a4c188ff01 + partial implementation of omf fixup reading
git-svn-id: trunk@31346 -
2015-08-19 15:55:03 +00:00
Jonas Maebe
4c5191f5d7 * generate LLVM typedefs for file-typed data
git-svn-id: trunk@31344 -
2015-08-18 16:10:29 +00:00
Jonas Maebe
2cf17c0487 * don't generate DWARF cfi when targeting LLVM, it will do that itself
git-svn-id: trunk@31343 -
2015-08-18 16:09:44 +00:00
nickysn
6d6ed840a4 * set the data record start offset of the omf fixup object when reading omf fixups
git-svn-id: trunk@31342 -
2015-08-18 15:18:03 +00:00
nickysn
ebde434255 * specify the proper segment ordering in the link script of the i8086-msdos
internal linker

git-svn-id: trunk@31341 -
2015-08-18 14:44:00 +00:00
nickysn
cbc676e80e * ignore case (i.e. always convert to upper case) in omf segment/class/overlay/group names
git-svn-id: trunk@31340 -
2015-08-18 14:41:29 +00:00
nickysn
d4b0b6f6e6 * use SegmentName+'||'+ClassName for the name of OMF sections when reading OMF
files, because omf segments are (according to the spec) identified by the
  tuple <SegmentName,ClassName,OverlayName> and not just by name (and we ignore
  the overlay name)

git-svn-id: trunk@31339 -
2015-08-18 14:31:59 +00:00
nickysn
0dab94e35d * i8086-msdos internal linker: put the static libraries in a group, to enable
multiple passes when resolving symbols

git-svn-id: trunk@31338 -
2015-08-18 13:37:57 +00:00
nickysn
3c0d83bd74 * fixed reading of OMF library dictionary
git-svn-id: trunk@31337 -
2015-08-17 13:03:57 +00:00
nickysn
9ff0057a94 * return true if TOmfObjInput.ReadObjData is successful
git-svn-id: trunk@31336 -
2015-08-17 12:25:59 +00:00
Jonas Maebe
add015f808 * ensure that the dwarf file table contains an entry if the current unit
contains any code, even if we cannot generate any debug info for that
    code (because the default file is file number 1, and if that table is
    empty some gdb versions crash)

git-svn-id: trunk@31335 -
2015-08-17 08:47:38 +00:00
Jonas Maebe
e06181749c * guarantee the order of parameter pushes again after r31201 on platforms
that don't use a fixed stack (mantis #28454)
   o moved the code to finalise managed out parameters from ncgcal to ncal,
     and add it to the init code of the call node (so it's evaluated before
     any parameters are processed, ensuring that mantis #28390 stays fixed)

git-svn-id: trunk@31328 -
2015-08-16 12:47:09 +00:00
Jonas Maebe
c95a3f2cf7 * firstpass rather than typecheckpass statements added to the call node
init/done block, as these can be added while pass_1 is ongoing

git-svn-id: trunk@31327 -
2015-08-16 12:47:04 +00:00
nickysn
41203a9152 * support far classrefdef targets on i8086 in thlcgcpu.a_loadaddr_ref_reg. This
fixes code generation for loadvmtaddr nodes in i8086 far data memory models
  after r31064.

git-svn-id: trunk@31326 -
2015-08-15 17:24:49 +00:00
nickysn
ef207475fd + parse omf modend records and add symbol for module start address
git-svn-id: trunk@31324 -
2015-08-14 15:42:43 +00:00
nickysn
e1298a035c * provide msdos-specific dummy overrides for GetCode/Data/BssSize to avoid crash
when using the (not yet finished) internal linker

git-svn-id: trunk@31323 -
2015-08-14 14:36:18 +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
8206c6dbd0 * the code for determining the code, data and bss sizes in the internal linker
moved to virtual methods, to allow for platform specific overrides (e.g. for
  supporting section names, other than '.text', '.data' and '.bss', etc.)

git-svn-id: trunk@31321 -
2015-08-13 15:07:24 +00:00
nickysn
e59c164844 + parse FIXUPP records in the omf object reader (although converting them TOmfRelocation is not yet implemented)
git-svn-id: trunk@31320 -
2015-08-13 13:44:46 +00:00
Jeppe Johansen
59f164b948 Changed type of size argument from aint to asizeint. This previously broke things on 8bit targets.
git-svn-id: trunk@31319 -
2015-08-13 01:57:09 +00:00
nickysn
c3133c498a + added property tobjectreader.pos, which returns the current position when reading an object file
git-svn-id: trunk@31315 -
2015-08-11 15:46:44 +00:00
nickysn
515d702408 - removed semicolon after 'begin'
git-svn-id: trunk@31314 -
2015-08-11 14:30:32 +00:00
nickysn
0cd1a88588 * fixed memory leak in TOmfObjInput.ReadExtDef
git-svn-id: trunk@31313 -
2015-08-11 13:39:26 +00:00
nickysn
9fc100574c + added property TObjSymbol.group for use with the omf object format
git-svn-id: trunk@31312 -
2015-08-11 13:38:28 +00:00
nickysn
c50991713c + implemented reading of omf public names
git-svn-id: trunk@31311 -
2015-08-11 13:04:22 +00:00
Jonas Maebe
0d87df71a9 * default to ARMv7/VFPv3 for Darwin/ARM (since that's what most iOS devices
use nowadays)

git-svn-id: trunk@31302 -
2015-08-09 09:08:26 +00:00
svenbarth
39016c032e Fix for Mantis #28442. Do not generate the VMT record definition for generic classes. It isn't used anyway.
nobj.pas, TVMTBuilder:
  * generate_vmt_def: check for df_generic (not is_generic!) and abort if set

+ added test

git-svn-id: trunk@31301 -
2015-08-07 15:02:55 +00:00
Jonas Maebe
4c0807c596 * simplified enum lookup table management by using tfplist instead of
an ad hoc dynamic array implementation

git-svn-id: trunk@31295 -
2015-08-06 18:34:31 +00:00
Jonas Maebe
a722b5dbc5 * add alignment padding to internally constructed llvm records
git-svn-id: trunk@31290 -
2015-08-05 21:06:09 +00:00
Jonas Maebe
b4e61b2469 * enable the llvm code generator for VMT generation
git-svn-id: trunk@31288 -
2015-08-05 21:06:04 +00:00
Jonas Maebe
bfa94ae908 * further (final?) reworking of llvm external symbol handling:
o all external symbol definitions are now inserted in the llvmtype post pass
     based on all declarations and types used in llvm instructions
   o this means we don't have to use the workaround with the Pascal mangled
     names anymore for all external names, as we now insert the external
     references only once we know all type information

git-svn-id: trunk@31287 -
2015-08-05 21:06:01 +00:00
Jonas Maebe
6dcf61f057 * an alias is an explicit definition of a symbol -> override types gleaned
from implicit ones

git-svn-id: trunk@31286 -
2015-08-05 21:05:58 +00:00
Jonas Maebe
a58504990a * fixed llvm handling of routines that are normally declared in the
interface of a unit, or forward declared, and then the implementation turns
    out to be external. We now properly generate a wrapper routine at the
    Pascal level for the original declaration that calls through to the
    external routine

git-svn-id: trunk@31285 -
2015-08-05 21:05:55 +00:00
Jonas Maebe
1cdaf8e332 * don't write external linkage for aliases: llvm 3.6 has a bug that rejects
linkage types for aliases (or its documentation hasn't been updated), and
    external linkage is the default so it doesn't matter for earlier versions

git-svn-id: trunk@31284 -
2015-08-05 21:05:52 +00:00
florian
29ba426fcc * call DefaultReplacements for #WRITE and #INCLUDE, resolves #28315
git-svn-id: trunk@31263 -
2015-08-02 20:45:49 +00:00
florian
9a55e8fa3c * do not call typecheckpass unncessarily in generic definitions, it might cause only errors, resolves #28058
git-svn-id: trunk@31262 -
2015-08-02 20:29:30 +00:00
florian
f1decfb6b6 * do not generate a vmt record for generics, they are only needed for specializations
git-svn-id: trunk@31261 -
2015-08-02 19:51:08 +00:00
Jeppe Johansen
2b80d46492 Added STM32F7xx controller units and types.
git-svn-id: trunk@31257 -
2015-07-31 22:21:16 +00:00
Jonas Maebe
9a8a323578 * (again) fixed loading the address of the string data of an ansi/
unicodestring constants: specify the type of the pointer to the
    string record (which is indirect) rather than that of the string
    array (which will implicitly be the result of the getelementptr)

git-svn-id: trunk@31256 -
2015-07-30 16:58:19 +00:00
Jonas Maebe
d7f6744f7b * converted ncgrtti to the high level typed constant builder
o the result is still not very clean due to the fact that this data
     is almost completely unstructured due to variable-length strings
     everywhere, which means that
    a) we cannot just load recorddefs from the system or typeinfo unit
       and use those as templates
    b) we cannot easily reuse the recorddefs we create ourselves (except
       if the strings have the same length -- this is the reason for all
       of the names specified to begin_anonymous_record: to reuse defs
       as much as possible rather than creating new ones all the time)
    c) we have to add explicitly aligned subrecords everywhere to insert
       explicit alignment on platforms that need it

git-svn-id: trunk@31255 -
2015-07-30 16:58:17 +00:00
Jonas Maebe
c946a85ae6 * give an internalerror if a typed const builder is finalised while there
is still an unfinished aggregate

git-svn-id: trunk@31254 -
2015-07-30 16:58:14 +00:00
Jonas Maebe
2cfc3ca4d1 * end the vmtdef aggregate so appropriate padding is inserted (if necessary)
git-svn-id: trunk@31253 -
2015-07-30 16:58:11 +00:00