Commit Graph

203 Commits

Author SHA1 Message Date
sergei
b997094755 + Generate unwind bytecode for function prologues on win64.
* For now placed actual processing of unwind info under {$ifdef TEST_WIN64_UNWIND}, because in the current state it doesn't add much value.

git-svn-id: trunk@19200 -
2011-09-23 21:22:25 +00:00
sergei
b0c2548019 * Use '.tls' as name for sec_threadvar sections for all Windows and WinCE targets, not just i386-win32.
git-svn-id: trunk@19157 -
2011-09-19 22:27:53 +00:00
sergei
1365467b0d + Support classes for creating unwind bytecode for Win64.
git-svn-id: trunk@19071 -
2011-09-15 15:35:08 +00:00
florian
f1f0cb033a * move ReplaceForbiddenChars to cpubase of avr so it can be used in dbgstabs as well
* tried to fix dbgstabs so that it doesn't emit illegal chars using ReplaceForbiddenChars, however, dbgstabs accesses symbol names quite often, so this failed

git-svn-id: trunk@18972 -
2011-09-04 19:36:43 +00:00
florian
7bceba2392 * since the last name mangling changes, gas writer for avr needs to replace more illegal characters
git-svn-id: trunk@18971 -
2011-09-04 18:56:47 +00:00
florian
2eb39c8843 * patch by Jeppe Johansen to support jumptable generation for case nodes on arm/thumb-2, resolves #19502
git-svn-id: trunk@18233 -
2011-08-16 22:39:00 +00:00
sergei
ae4cdf25f8 + aggas.pas: Write section attributes when long section names are used for smart linking (enabled for win32 and win64). It is needed because GAS does not understand that '.text.something' is part of '.text' and assigns default attributes (writable data) to all such sections, which is not the desired behavior.
git-svn-id: trunk@17989 -
2011-07-13 23:45:28 +00:00
sergei
5bda700410 * External assemblers: moved some common code into the base class, 4 copies reduced to one.
git-svn-id: trunk@17561 -
2011-05-26 13:10:49 +00:00
florian
fb84cb865b * rebase to trunk@17295
git-svn-id: branches/avr@17296 -
2011-04-10 19:20:48 +00:00
florian
f328b6d635 + user section type
+ parsing of section directive for variables
  + section test
  + write section names in the assembler/binary writers correctly
  * allow section only after ; and for embedded targets

git-svn-id: branches/usersections@17154 -
2011-03-20 15:42:28 +00:00
florian
26415e9903 * as avr doesn't like $ in symbols, use ReplaceForbiddenChars to replace them
git-svn-id: branches/avr@17040 -
2011-02-27 21:04:18 +00:00
mazen
b127fc154a * Fixed spell error revealed by lintian.
git-svn-id: trunk@16094 -
2010-10-06 20:33:57 +00:00
Jonas Maebe
8b0301409a + i386/iphonesim target for the new iPhoneSimulator in Xcode 3.2.4 and
later: the same as i386/darwin, except
      a) uses the non-fragile Objective-C ABI/runtime
      b) does not require stubs for direct calls/jumps (not required for
         i386/darwin under 10.6 and later either, but still generated
         there for backwards compatibility)
      c) only the same packages are enabled as for ARM/Darwin
      d) MacOSAll is compiled specifically for the iPhoneSimulator SDK
    This target also defines the symbol "darwin" apart from the target
    name "iphonesim" for source code compatibility reasons.

git-svn-id: trunk@16065 -
2010-09-29 21:56:47 +00:00
Jonas Maebe
ad93588fa1 * use 32 bit int->string conversions for non-64 bit constants on 32 bit
platforms

git-svn-id: trunk@15517 -
2010-07-03 13:06:40 +00:00
Jonas Maebe
356026f849 * use new_section() instead of tai_section.create() everywhere
- sort of reverted r14134, which is no longer required after the above
    change (new_section() inserts the alignment itself)
  * made the tai_section.create() constructor private so it cannot be
    called directly anymore

git-svn-id: trunk@15482 -
2010-06-26 10:50:14 +00:00
Jonas Maebe
025ec34e4d + "CExtended" type that is the same as "extended", but conforming to the
properties/behaviour of the equivalent of Extended in C (i.e., to
    "long double" on i386 and x86_64 platforms that support a 10 byte
    long double, and to "double" elsewhere)

git-svn-id: trunk@14912 -
2010-02-14 13:45:58 +00:00
florian
c1f3d8dcaa * unified names of system_*/systems_* sets
git-svn-id: trunk@14566 -
2010-01-07 18:16:20 +00:00
Jonas Maebe
4838ebe73b * renamed mark_InlineStart/mark_InlineEnd to mark_NoLineinfoStart/
mark_NoLineinfoEnd
  * add "no line info" markers for try/except and try/finally internal cleanup
    code, so the debugger doesn't jump back and forth between the end and start
    of exception blocks when you arrive at the end
  * honour "no line info" markers in dbgdwarf.pas

git-svn-id: trunk@14327 -
2009-12-04 19:37:22 +00:00
Jonas Maebe
f7360d47c5 - removed aitconst_indirect_symbol, replaced with tai_directive
(patch by Dmitry Boyarintsev, mantis #15050)

git-svn-id: trunk@14157 -
2009-11-12 19:39:41 +00:00
Jonas Maebe
e04198d96f * prefetch next list elements while writing out assembler list, makes
that routine 15-20% faster on my Core 2

git-svn-id: trunk@14137 -
2009-11-10 19:32:49 +00:00
Jonas Maebe
8bc3dbafb7 * emit alignment of tai_section's instead of ignoring it
git-svn-id: trunk@14134 -
2009-11-10 10:34:15 +00:00
Jonas Maebe
edacea82be * changed assembler directives for darwin lazy/non-lazy symbol pointers
and init/fini routines into their section equivalents (based on patch
    by Dmitry Boyarintsev, mantis #15037)

git-svn-id: trunk@14128 -
2009-11-09 22:20:01 +00:00
Jonas Maebe
559e284bd0 * merged r13762-14047 from trunk
git-svn-id: branches/objc@14048 -
2009-11-04 15:50:26 +00:00
florian
515774b864 * merged armthum branch
-- Zusammenführen der Unterschiede zwischen Projektarchiv-URLs in ».«:
U    rtl/arm/setjump.inc
A    rtl/arm/thumb2.inc
U    rtl/arm/divide.inc
A    rtl/embedded/arm/stm32f103.pp
U    rtl/inc/system.inc
U    compiler/alpha/cgcpu.pas
U    compiler/sparc/cgcpu.pas
U    compiler/i386/cgcpu.pas
U    compiler/ncgld.pas
U    compiler/powerpc/cgcpu.pas
U    compiler/avr/cgcpu.pas
U    compiler/aggas.pas
U    compiler/powerpc64/cgcpu.pas
U    compiler/x86_64/cgcpu.pas
U    compiler/cgobj.pas
U    compiler/psystem.pas
U    compiler/aasmtai.pas
U    compiler/m68k/cgcpu.pas
U    compiler/ncgutil.pas
U    compiler/rautils.pas
U    compiler/arm/raarmgas.pas
U    compiler/arm/armatts.inc
U    compiler/arm/cgcpu.pas
U    compiler/arm/armins.dat
U    compiler/arm/rgcpu.pas
U    compiler/arm/cpubase.pas
U    compiler/arm/agarmgas.pas
U    compiler/arm/cpuinfo.pas
U    compiler/arm/armop.inc
U    compiler/arm/narmadd.pas
U    compiler/arm/aoptcpu.pas
U    compiler/arm/armatt.inc
U    compiler/arm/aasmcpu.pas
U    compiler/systems/t_embed.pas
U    compiler/psub.pas
U    compiler/options.pas

git-svn-id: trunk@13801 -
2009-10-04 09:03:44 +00:00
Jonas Maebe
0c675a4039 * the objc1 unit has been renamed to objc
* the objc unit links against the Foundation instead of against the Cocoa
    framework, and inludes an interface to either the fragile or non-fragile
    obj-c run time depending on the target platform
  + support for the non-fragile Objective-C runtime/ABI, as used on Mac OS X
    for ARM (iPhone) 64 bit (PowerPC/64, x86_64) -- all these targets now
    are now also supported for the objectivec1 modeswitch
  + support for private_extern symbol bindings, required for the above
  * mark objcclasses that are declared in the implementation section of a
    unit as "hidden" (not sure what the effect is, since the Objective-C
    runtime does not seem to do anything with this flag)
  * enabled all obj-c tests for the newly supported platforms

git-svn-id: branches/objc@13763 -
2009-09-27 15:24:50 +00:00
Jonas Maebe
e393446769 * fixed several omissions that could cause the dynamic linker not to
register required classes:
    + add lazy references to classes referred to in the current unit
    + define reference symbols for classes defined in the current unit
    + add lazy references to parent classes of classes defined in the current
      unit

git-svn-id: branches/objc@13679 -
2009-09-08 16:05:41 +00:00
florian
86aad85b78 + section smartlink bss for embedded targets
git-svn-id: trunk@13341 -
2009-06-27 15:21:01 +00:00
Jonas Maebe
c548ce30ba * replaced old DWARF CFI section notation for Darwin with new one (more
changes are required before it works for Darwin)

git-svn-id: trunk@12920 -
2009-03-19 14:22:26 +00:00
Jonas Maebe
6165536b5e + added {$modeswitch objectivec1}/-Mobjectivec1 mode switch to enable
the use of Objective-C 1.0 constructs. Because it is a mode switch, it
    can be used cumulatively with every syntax mode. Note that a {$mode xxx}
    statement resets all mode switches as well, so you cannot use the
    -Mobjectivec1 variant if you have such a statement in a unit. This
    modeswitch is currently only enabled for Darwin/PowerPC and Darwin/i386,
    as the backend support is not yet implemented for other platforms.
  + implemented selector() statement that can be used to create an Objective-C
    selector for the message with the specified *constant* name (in the future,
    it will also work for Objective-C method identifiers)
  + added SEL type to the system unit (the selector() statement returns it)
  + added all Objective-C segments to the assembler writers
  + (currently mostly dummy) objc1 unit that is automatically included if the
    {$modeswitch objectivec1} statement is used
  + some tests for the selector() statement

git-svn-id: trunk@12870 -
2009-03-08 18:40:32 +00:00
Jonas Maebe
3216e8c7bc * mark produced object files as "does not require executable stack" by
default for Linux (overridable using -WX switch) (mantis #11563)

git-svn-id: trunk@12356 -
2008-12-12 16:26:25 +00:00
Jonas Maebe
807c63916e * do not write the ".file" directive in assembler files for Darwin
(gcc doesn't do it either, and it causes the assembler to report
     errors as if they occur in the Pascal source file)

git-svn-id: trunk@12205 -
2008-11-23 09:49:34 +00:00
Jonas Maebe
a23630260b + "weakexternal" support for imported procedures and variables.
the syntax is exactly the same as for "external", except for
    the keyword. It is currently only active for Darwin targets.
    It should also work at least for Linux targets, but only with
    the GNU assembler (which is why it is not activated there)
  + test for this functionality

git-svn-id: trunk@12009 -
2008-11-01 18:38:32 +00:00
Jonas Maebe
5347e536c2 + support for generating non-pic darwin/arm call stubs
+ write the header for non-pic darwin/arm call stubs properly in aggas
  * r9 is not available for general use on darwin/arm according to the llvm
    code generator

git-svn-id: trunk@11862 -
2008-10-04 14:07:52 +00:00
Jonas Maebe
afa14de20d + some generic changes preparing for darwin/arm support
git-svn-id: trunk@11849 -
2008-10-02 15:10:13 +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
giulio
95ce7840bc Added comment for 11257
git-svn-id: trunk@11259 -
2008-06-21 14:32:37 +00:00
giulio
272673bfe1 .rodata* sections must end up in .data section on go32v2, since the go32v2 stub
only handles .text, .data and .bss sections.
Solves bug #11509.

git-svn-id: trunk@11257 -
2008-06-21 14:06:12 +00:00
peter
52722b2cab * allocate .bss entries manual so we can take care of alignment
* disable COMMON symbol code, it might be needed again for ELF package
    support (.comm for ELF supports alignment)

git-svn-id: trunk@10549 -
2008-03-24 11:55:03 +00:00
Jonas Maebe
f36e5411af * split cpu64bit compiler define into
a) cpu64bitaddr, which means that we are generating a compiler which
       will generate code for targets with a 64 bit address space/abi
    b) cpu64bitalu, which means that we are generating a compiler which
       will generate code for a cpu with support for 64 bit integer
       operations (possibly running in a 32 bit address space, depending
       on the cpu64bitaddr define)
   All cpus which had cpu64bit set now have both the above defines set,
   and none of the 32 bit cpus have cpu64bitalu set (and none will
   compile with it currently)
  + pint and puint types, similar to aint/aword (not pword because that
    that conflicts with pword=^word)
  * several changes from aint/aword to pint/pword
  * some changes of tcgsize2size[OS_INT] to sizeof(pint)

git-svn-id: trunk@10320 -
2008-02-13 20:44:00 +00:00
Jonas Maebe
db6e60789b * only use ".set" directive when creating dwarf relsyms on darwin and
not for other relsyms, as older versions of the darwin assembler
    don't understand the ".set" directive (mantis #10541)

git-svn-id: trunk@9621 -
2008-01-03 12:47:31 +00:00
peter
59365a6db9 - garbage was being output sometimes instead of source lines when compiling with -al. This is because lastfileinfo and lastinfile were never initialized for MASM writer. This is true for TPPCMPWAssembler, too.
- long lines were not wrapped.
- constants of type ait_comp_64bit output incorrectly.
- at end of file, current segment was not closed.
patch from Sergei Gorelkin

git-svn-id: trunk@9331 -
2007-11-25 16:46:19 +00:00
Károly Balogh
b91c0756c4 + made m68k to compile system unit again
git-svn-id: trunk@9017 -
2007-10-31 22:33:00 +00:00
peter
9f0ca44c94 * new tf_smartlink_library flag
* use create_smartlink[_sections|_library] to check what to 
    do for smartlinking

git-svn-id: trunk@8715 -
2007-10-01 16:55:08 +00:00
Jonas Maebe
5a0a6d0d9e * fixed and enabled smartlinking on Darwin by adding more .reference
statements (some to work around linker bugs, most because they were
    really missing)

git-svn-id: trunk@8673 -
2007-09-28 22:48:41 +00:00
Jonas Maebe
3266f4e483 + Compiler support for pic on darwin/i386. The i386 rtl still needs
to be made pic-safe (mainly accesses to the global default8087cw)
  * At the same time also made the non-pic code abi-compliant (access
    external data via indirect symbol pointers etc)

    Darwin/i386 also puts the got into a virtual register (like
    Darwin/ppc), a.o. because the register allocator fails to colour
    a routine in aasmcpu.pas if we take away ebx from it.

git-svn-id: trunk@8657 -
2007-09-26 21:42:27 +00:00
Jonas Maebe
335bc9fd46 + PIC support for darwin/ppc32 (-Cg works now, no regressions in test
suite compiled with -Cg compared to without -Cg)
  + support for using a virtual register as PIC/got base register
  * moved got loading code from ncgutil to cgobj/cgcpu (can't test whether
    it didn't break anything under linux/i386, because "make cycle OPT=-Cg"
    was already broken due to the *prt*.as -> si_*.pp changes)

git-svn-id: trunk@8651 -
2007-09-26 16:41:32 +00:00
Jonas Maebe
70c2414daa * split off sec_rodata_norel from sec_rodata, and only put constant data
without relocations in sec_rodata_norel. It should be possible to make
    this new section read-only on all platforms, although currently it
    is only done for darwin, and for non-pic code written using the
    -Aas assembler writer.

    Most platforms also have a special section for "constant but with
    relocations" data, but such a section is currently only used for
    Darwin (others still use plain .data sections for that, like they
    did before)

git-svn-id: trunk@8650 -
2007-09-26 15:49:01 +00:00
Jonas Maebe
399201ad7d * removed rodata support for ppc64 again because it doesn't work on
linux/ppc64. Added explanation why it doesn't work and what's needed

git-svn-id: trunk@8304 -
2007-08-24 17:19:52 +00:00
Jonas Maebe
fc53d14e58 * also enable .rodata for ppc64
git-svn-id: trunk@8278 -
2007-08-13 15:02:39 +00:00
florian
4151029ee5 + .fini section support
git-svn-id: trunk@8174 -
2007-07-28 08:40:10 +00:00