Pārlūkot izejas kodu

* synchronized with trunk up to and including r25430

git-svn-id: branches/cpstrrtl@25431 -
Jonas Maebe 12 gadi atpakaļ
vecāks
revīzija
de56f909d5
100 mainītis faili ar 1896 papildinājumiem un 1101 dzēšanām
  1. 40 0
      .gitattributes
  2. 44 45
      compiler/aasmtai.pas
  3. 6 17
      compiler/aggas.pas
  4. 39 2
      compiler/aoptobj.pas
  5. 71 27
      compiler/arm/aasmcpu.pas
  6. 8 8
      compiler/arm/agarmgas.pas
  7. 45 20
      compiler/arm/aoptcpu.pas
  8. 216 82
      compiler/arm/cgcpu.pas
  9. 26 2
      compiler/arm/cpubase.pas
  10. 12 11
      compiler/arm/cpuinfo.pas
  11. 2 2
      compiler/arm/cpupara.pas
  12. 16 5
      compiler/arm/cpupi.pas
  13. 10 23
      compiler/arm/narmadd.pas
  14. 1 1
      compiler/arm/narminl.pas
  15. 13 7
      compiler/arm/narmmat.pas
  16. 5 5
      compiler/arm/narmmem.pas
  17. 32 9
      compiler/arm/narmset.pas
  18. 33 5
      compiler/arm/rgcpu.pas
  19. 1 1
      compiler/assemble.pas
  20. 2 2
      compiler/cresstr.pas
  21. 52 29
      compiler/dbgdwarf.pas
  22. 6 4
      compiler/defcmp.pas
  23. 35 0
      compiler/fppu.pas
  24. 42 3
      compiler/globals.pas
  25. 11 2
      compiler/globtype.pas
  26. 5 5
      compiler/hlcgobj.pas
  27. 1 1
      compiler/i8086/cpuinfo.pas
  28. 4 6
      compiler/jvm/hlcgcpu.pas
  29. 76 4
      compiler/jvm/njvmutil.pas
  30. 19 11
      compiler/link.pas
  31. 2 2
      compiler/msg/errorct.msg
  32. 2 2
      compiler/msg/errord.msg
  33. 2 2
      compiler/msg/errorda.msg
  34. 2 2
      compiler/msg/errordu.msg
  35. 13 7
      compiler/msg/errore.msg
  36. 2 2
      compiler/msg/errores.msg
  37. 2 2
      compiler/msg/errorf.msg
  38. 2 2
      compiler/msg/errorfi.msg
  39. 2 2
      compiler/msg/errorhe.msg
  40. 2 2
      compiler/msg/errorheu.msg
  41. 2 2
      compiler/msg/errorid.msg
  42. 2 2
      compiler/msg/erroriu.msg
  43. 2 2
      compiler/msg/errorn.msg
  44. 2 2
      compiler/msg/errorpl.msg
  45. 2 2
      compiler/msg/errorpli.msg
  46. 2 2
      compiler/msg/errorpt.msg
  47. 2 2
      compiler/msg/errorptu.msg
  48. 2 2
      compiler/msg/errorr.msg
  49. 2 2
      compiler/msg/errorru.msg
  50. 2 2
      compiler/msg/errorues.msg
  51. 4 3
      compiler/msgidx.inc
  52. 306 302
      compiler/msgtxt.inc
  53. 6 6
      compiler/ncgrtti.pas
  54. 0 39
      compiler/ncgutil.pas
  55. 54 14
      compiler/ncgvmt.pas
  56. 5 5
      compiler/ncnv.pas
  57. 4 2
      compiler/ncon.pas
  58. 24 17
      compiler/ngenutil.pas
  59. 3 2
      compiler/ninl.pas
  60. 24 6
      compiler/options.pas
  61. 16 1
      compiler/pdecsub.pas
  62. 51 28
      compiler/pexpr.pas
  63. 4 0
      compiler/pgenutil.pas
  64. 1 1
      compiler/powerpc/agppcmpw.pas
  65. 2 2
      compiler/ppcgen/cgppc.pas
  66. 4 1
      compiler/ppu.pas
  67. 11 0
      compiler/procinfo.pas
  68. 26 27
      compiler/pstatmnt.pas
  69. 1 1
      compiler/psub.pas
  70. 0 2
      compiler/psystem.pas
  71. 3 0
      compiler/ptype.pas
  72. 248 91
      compiler/scanner.pas
  73. 2 2
      compiler/symdef.pas
  74. 11 2
      compiler/symsym.pas
  75. 33 0
      compiler/systems.inc
  76. 2 39
      compiler/systems.pas
  77. 4 4
      compiler/systems/i_aix.pas
  78. 4 4
      compiler/systems/i_amiga.pas
  79. 4 4
      compiler/systems/i_android.pas
  80. 2 2
      compiler/systems/i_beos.pas
  81. 29 29
      compiler/systems/i_bsd.pas
  82. 6 6
      compiler/systems/i_embed.pas
  83. 2 2
      compiler/systems/i_emx.pas
  84. 2 2
      compiler/systems/i_gba.pas
  85. 2 2
      compiler/systems/i_go32v2.pas
  86. 2 2
      compiler/systems/i_haiku.pas
  87. 4 4
      compiler/systems/i_jvm.pas
  88. 34 31
      compiler/systems/i_linux.pas
  89. 2 2
      compiler/systems/i_macos.pas
  90. 2 2
      compiler/systems/i_morph.pas
  91. 2 2
      compiler/systems/i_msdos.pas
  92. 2 2
      compiler/systems/i_nativent.pas
  93. 2 2
      compiler/systems/i_nds.pas
  94. 2 2
      compiler/systems/i_nwl.pas
  95. 2 2
      compiler/systems/i_nwm.pas
  96. 2 2
      compiler/systems/i_os2.pas
  97. 4 4
      compiler/systems/i_palmos.pas
  98. 6 6
      compiler/systems/i_sunos.pas
  99. 4 4
      compiler/systems/i_symbian.pas
  100. 2 2
      compiler/systems/i_watcom.pas

+ 40 - 0
.gitattributes

@@ -2189,6 +2189,7 @@ packages/fcl-db/tests/README.txt svneol=native#text/plain
 packages/fcl-db/tests/bufdatasettoolsunit.pas svneol=native#text/plain
 packages/fcl-db/tests/bufdatasettoolsunit.pas svneol=native#text/plain
 packages/fcl-db/tests/database.ini.txt svneol=native#text/plain
 packages/fcl-db/tests/database.ini.txt svneol=native#text/plain
 packages/fcl-db/tests/dbftoolsunit.pas svneol=native#text/plain
 packages/fcl-db/tests/dbftoolsunit.pas svneol=native#text/plain
+packages/fcl-db/tests/dbguitestrunner.pas svneol=native#text/plain
 packages/fcl-db/tests/dbtestframework.pas svneol=native#text/plain
 packages/fcl-db/tests/dbtestframework.pas svneol=native#text/plain
 packages/fcl-db/tests/dbtestframework_gui.lpi svneol=native#text/plain
 packages/fcl-db/tests/dbtestframework_gui.lpi svneol=native#text/plain
 packages/fcl-db/tests/dbtestframework_gui.lpr svneol=native#text/plain
 packages/fcl-db/tests/dbtestframework_gui.lpr svneol=native#text/plain
@@ -2473,6 +2474,7 @@ packages/fcl-process/src/wince/simpleipc.inc svneol=native#text/plain
 packages/fcl-registry/Makefile svneol=native#text/plain
 packages/fcl-registry/Makefile svneol=native#text/plain
 packages/fcl-registry/Makefile.fpc svneol=native#text/plain
 packages/fcl-registry/Makefile.fpc svneol=native#text/plain
 packages/fcl-registry/Makefile.fpc.fpcmake svneol=native#text/plain
 packages/fcl-registry/Makefile.fpc.fpcmake svneol=native#text/plain
+packages/fcl-registry/examples/remotereg.pp svneol=native#text/pascal
 packages/fcl-registry/fpmake.pp svneol=native#text/plain
 packages/fcl-registry/fpmake.pp svneol=native#text/plain
 packages/fcl-registry/src/regdef.inc svneol=native#text/plain
 packages/fcl-registry/src/regdef.inc svneol=native#text/plain
 packages/fcl-registry/src/regini.inc svneol=native#text/plain
 packages/fcl-registry/src/regini.inc svneol=native#text/plain
@@ -10010,6 +10012,7 @@ tests/tbs/tb0595.pp svneol=native#text/plain
 tests/tbs/tb0596.pp svneol=native#text/pascal
 tests/tbs/tb0596.pp svneol=native#text/pascal
 tests/tbs/tb0597.pp svneol=native#text/plain
 tests/tbs/tb0597.pp svneol=native#text/plain
 tests/tbs/tb0598.pp svneol=native#text/plain
 tests/tbs/tb0598.pp svneol=native#text/plain
+tests/tbs/tb0599.pp svneol=native#text/plain
 tests/tbs/tb0600.pp svneol=native#text/plain
 tests/tbs/tb0600.pp svneol=native#text/plain
 tests/tbs/tb205.pp svneol=native#text/plain
 tests/tbs/tb205.pp svneol=native#text/plain
 tests/tbs/tbs0594.pp svneol=native#text/pascal
 tests/tbs/tbs0594.pp svneol=native#text/pascal
@@ -10667,9 +10670,12 @@ tests/test/jvm/testansi.pp svneol=native#text/plain
 tests/test/jvm/testintf.pp svneol=native#text/plain
 tests/test/jvm/testintf.pp svneol=native#text/plain
 tests/test/jvm/testshort.pp svneol=native#text/plain
 tests/test/jvm/testshort.pp svneol=native#text/plain
 tests/test/jvm/tformalpara.pp svneol=native#text/plain
 tests/test/jvm/tformalpara.pp svneol=native#text/plain
+tests/test/jvm/tinitvar.pp svneol=native#text/plain
 tests/test/jvm/tint.pp svneol=native#text/plain
 tests/test/jvm/tint.pp svneol=native#text/plain
 tests/test/jvm/tintstr.pp svneol=native#text/plain
 tests/test/jvm/tintstr.pp svneol=native#text/plain
+tests/test/jvm/tjavalowercaseproc.java svneol=native#text/plain
 tests/test/jvm/tjsetter.java svneol=native#text/plain
 tests/test/jvm/tjsetter.java svneol=native#text/plain
+tests/test/jvm/tlowercaseproc.pp svneol=native#text/plain
 tests/test/jvm/tnestdynarr.pp svneol=native#text/plain
 tests/test/jvm/tnestdynarr.pp svneol=native#text/plain
 tests/test/jvm/tnestedset.pp svneol=native#text/plain
 tests/test/jvm/tnestedset.pp svneol=native#text/plain
 tests/test/jvm/tnestproc.pp svneol=native#text/plain
 tests/test/jvm/tnestproc.pp svneol=native#text/plain
@@ -12024,6 +12030,30 @@ tests/test/units/fpcunit/testclasses.lpr svneol=native#text/plain
 tests/test/units/fpcunit/testcomps.pp svneol=native#text/plain
 tests/test/units/fpcunit/testcomps.pp svneol=native#text/plain
 tests/test/units/fpcunit/tstrutils.lpi svneol=native#text/plain
 tests/test/units/fpcunit/tstrutils.lpi svneol=native#text/plain
 tests/test/units/fpcunit/tstrutils.lpr svneol=native#text/plain
 tests/test/units/fpcunit/tstrutils.lpr svneol=native#text/plain
+tests/test/units/fpwidestring/CollationTest_NON_IGNORABLE_SHORT.txt svneol=native#text/plain
+tests/test/units/fpwidestring/CollationTest_SHIFTED_SHORT.txt svneol=native#text/plain
+tests/test/units/fpwidestring/tcpstr13fpwidestring.pp svneol=native#text/pascal
+tests/test/units/fpwidestring/tcpstr17fpwidestring.pp svneol=native#text/pascal
+tests/test/units/fpwidestring/tcpstr18fpwidestring.pp svneol=native#text/pascal
+tests/test/units/fpwidestring/tcpstr1fpwidestring.pp svneol=native#text/pascal
+tests/test/units/fpwidestring/tcpstr9fpwidestring.pp svneol=native#text/pascal
+tests/test/units/fpwidestring/tcpstransistr2shortstringfpwidestring.pp svneol=native#text/pascal
+tests/test/units/fpwidestring/tcpstransistr2widechararrayfpwidestring.pp svneol=native#text/pascal
+tests/test/units/fpwidestring/tcpstransistrcompareequalfpws.pp svneol=native#text/pascal
+tests/test/units/fpwidestring/tcpstransistrcomparefpwidestring.pp svneol=native#text/pascal
+tests/test/units/fpwidestring/tcpstrpchar2ansistrfpws.pp svneol=native#text/pascal
+tests/test/units/fpwidestring/tcpstrshortstr2ansistrfpws.pp svneol=native#text/pascal
+tests/test/units/fpwidestring/tuca1.pp svneol=native#text/pascal
+tests/test/units/fpwidestring/tuca2.pp svneol=native#text/pascal
+tests/test/units/fpwidestring/tucawsm.pp svneol=native#text/pascal
+tests/test/units/fpwidestring/tunistr1fpwidestring.pp svneol=native#text/pascal
+tests/test/units/fpwidestring/tunistr2fpwidestring.pp svneol=native#text/pascal
+tests/test/units/fpwidestring/tunistr6fpwidestring.pp svneol=native#text/pascal
+tests/test/units/fpwidestring/tunistr7fpwidestring.pp svneol=native#text/pascal
+tests/test/units/fpwidestring/twide1fpwidestring.pp svneol=native#text/pascal
+tests/test/units/fpwidestring/twide2fpwidestring.pp svneol=native#text/pascal
+tests/test/units/fpwidestring/twide6fpwidestring.pp svneol=native#text/pascal
+tests/test/units/fpwidestring/twide7fpwidestring.pp svneol=native#text/pascal
 tests/test/units/lineinfo/tlininfo.pp svneol=native#text/plain
 tests/test/units/lineinfo/tlininfo.pp svneol=native#text/plain
 tests/test/units/math/tdivmod.pp svneol=native#text/plain
 tests/test/units/math/tdivmod.pp svneol=native#text/plain
 tests/test/units/math/tmask.inc svneol=native#text/plain
 tests/test/units/math/tmask.inc svneol=native#text/plain
@@ -13352,6 +13382,7 @@ tests/webtbs/tw20947.pp svneol=native#text/pascal
 tests/webtbs/tw20962.pp svneol=native#text/plain
 tests/webtbs/tw20962.pp svneol=native#text/plain
 tests/webtbs/tw20995a.pp svneol=native#text/pascal
 tests/webtbs/tw20995a.pp svneol=native#text/pascal
 tests/webtbs/tw20995b.pp svneol=native#text/pascal
 tests/webtbs/tw20995b.pp svneol=native#text/pascal
+tests/webtbs/tw20996.pp svneol=native#text/pascal
 tests/webtbs/tw20998.pp svneol=native#text/pascal
 tests/webtbs/tw20998.pp svneol=native#text/pascal
 tests/webtbs/tw21029.pp svneol=native#text/plain
 tests/webtbs/tw21029.pp svneol=native#text/plain
 tests/webtbs/tw21044.pp svneol=native#text/pascal
 tests/webtbs/tw21044.pp svneol=native#text/pascal
@@ -13420,6 +13451,7 @@ tests/webtbs/tw22155.pp svneol=native#text/plain
 tests/webtbs/tw22160a1.pp svneol=native#text/pascal
 tests/webtbs/tw22160a1.pp svneol=native#text/pascal
 tests/webtbs/tw22160b1.pp svneol=native#text/pascal
 tests/webtbs/tw22160b1.pp svneol=native#text/pascal
 tests/webtbs/tw2220.pp svneol=native#text/plain
 tests/webtbs/tw2220.pp svneol=native#text/plain
+tests/webtbs/tw22225.pp svneol=native#text/pascal
 tests/webtbs/tw2226.pp svneol=native#text/plain
 tests/webtbs/tw2226.pp svneol=native#text/plain
 tests/webtbs/tw2229.pp svneol=native#text/plain
 tests/webtbs/tw2229.pp svneol=native#text/plain
 tests/webtbs/tw22290.pp svneol=native#text/plain
 tests/webtbs/tw22290.pp svneol=native#text/plain
@@ -13508,6 +13540,7 @@ tests/webtbs/tw2397.pp svneol=native#text/plain
 tests/webtbs/tw24007.pp svneol=native#text/plain
 tests/webtbs/tw24007.pp svneol=native#text/plain
 tests/webtbs/tw24071.pp svneol=native#text/pascal
 tests/webtbs/tw24071.pp svneol=native#text/pascal
 tests/webtbs/tw2409.pp svneol=native#text/plain
 tests/webtbs/tw2409.pp svneol=native#text/plain
+tests/webtbs/tw24129.pp svneol=native#text/pascal
 tests/webtbs/tw24131.pp svneol=native#text/plain
 tests/webtbs/tw24131.pp svneol=native#text/plain
 tests/webtbs/tw24197.pp svneol=native#text/plain
 tests/webtbs/tw24197.pp svneol=native#text/plain
 tests/webtbs/tw2421.pp svneol=native#text/plain
 tests/webtbs/tw2421.pp svneol=native#text/plain
@@ -13517,7 +13550,9 @@ tests/webtbs/tw2432.pp svneol=native#text/plain
 tests/webtbs/tw2435.pp svneol=native#text/plain
 tests/webtbs/tw2435.pp svneol=native#text/plain
 tests/webtbs/tw2438.pp svneol=native#text/plain
 tests/webtbs/tw2438.pp svneol=native#text/plain
 tests/webtbs/tw2442.pp svneol=native#text/plain
 tests/webtbs/tw2442.pp svneol=native#text/plain
+tests/webtbs/tw24486.pp svneol=native#text/pascal
 tests/webtbs/tw2452.pp svneol=native#text/plain
 tests/webtbs/tw2452.pp svneol=native#text/plain
+tests/webtbs/tw24536.pp svneol=native#text/plain
 tests/webtbs/tw2454.pp svneol=native#text/plain
 tests/webtbs/tw2454.pp svneol=native#text/plain
 tests/webtbs/tw24651.pp svneol=native#text/pascal
 tests/webtbs/tw24651.pp svneol=native#text/pascal
 tests/webtbs/tw24705.pp svneol=native#text/pascal
 tests/webtbs/tw24705.pp svneol=native#text/pascal
@@ -13526,8 +13561,12 @@ tests/webtbs/tw2480.pp svneol=native#text/plain
 tests/webtbs/tw2481.pp svneol=native#text/plain
 tests/webtbs/tw2481.pp svneol=native#text/plain
 tests/webtbs/tw2483.pp svneol=native#text/plain
 tests/webtbs/tw2483.pp svneol=native#text/plain
 tests/webtbs/tw24848.pp svneol=native#text/pascal
 tests/webtbs/tw24848.pp svneol=native#text/pascal
+tests/webtbs/tw24863.pp svneol=native#text/plain
+tests/webtbs/tw24865.pp svneol=native#text/pascal
+tests/webtbs/tw24871.pp svneol=native#text/pascal
 tests/webtbs/tw2492.pp svneol=native#text/plain
 tests/webtbs/tw2492.pp svneol=native#text/plain
 tests/webtbs/tw2494.pp svneol=native#text/plain
 tests/webtbs/tw2494.pp svneol=native#text/plain
+tests/webtbs/tw24953.pp svneol=native#text/pascal
 tests/webtbs/tw2503.pp svneol=native#text/plain
 tests/webtbs/tw2503.pp svneol=native#text/plain
 tests/webtbs/tw2504.pp svneol=native#text/plain
 tests/webtbs/tw2504.pp svneol=native#text/plain
 tests/webtbs/tw2514.pp svneol=native#text/plain
 tests/webtbs/tw2514.pp svneol=native#text/plain
@@ -14284,6 +14323,7 @@ tests/webtbs/uw2040.pp svneol=native#text/plain
 tests/webtbs/uw20909a.pas svneol=native#text/pascal
 tests/webtbs/uw20909a.pas svneol=native#text/pascal
 tests/webtbs/uw20909b.pas svneol=native#text/pascal
 tests/webtbs/uw20909b.pas svneol=native#text/pascal
 tests/webtbs/uw20940.pp svneol=native#text/pascal
 tests/webtbs/uw20940.pp svneol=native#text/pascal
+tests/webtbs/uw20996.pp svneol=native#text/pascal
 tests/webtbs/uw21538.pp svneol=native#text/pascal
 tests/webtbs/uw21538.pp svneol=native#text/pascal
 tests/webtbs/uw21808a.pp svneol=native#text/plain
 tests/webtbs/uw21808a.pp svneol=native#text/plain
 tests/webtbs/uw21808b.pp svneol=native#text/plain
 tests/webtbs/uw21808b.pp svneol=native#text/plain

+ 44 - 45
compiler/aasmtai.pas

@@ -68,10 +68,6 @@ interface
           ait_stab,
           ait_stab,
           ait_force_line,
           ait_force_line,
           ait_function_name,
           ait_function_name,
-		  { Used for .ent .end pair used for .dpr section in MIPS
-		    and probably also for Alpha }
-          ait_ent,
-		  ait_ent_end,
 {$ifdef alpha}
 {$ifdef alpha}
           { the follow is for the DEC Alpha }
           { the follow is for the DEC Alpha }
           ait_frame,
           ait_frame,
@@ -140,7 +136,8 @@ interface
           aitconst_32bit_unaligned,
           aitconst_32bit_unaligned,
           aitconst_64bit_unaligned,
           aitconst_64bit_unaligned,
           { i8086 far pointer; emits: 'DW symbol, SEG symbol' }
           { i8086 far pointer; emits: 'DW symbol, SEG symbol' }
-          aitconst_farptr
+          aitconst_farptr,
+          aitconst_got
         );
         );
 
 
     const
     const
@@ -186,8 +183,6 @@ interface
           'stab',
           'stab',
           'force_line',
           'force_line',
           'function_name',
           'function_name',
-          'ent',
-          'ent_end',
 {$ifdef alpha}
 {$ifdef alpha}
           { the follow is for the DEC Alpha }
           { the follow is for the DEC Alpha }
           'frame',
           'frame',
@@ -297,7 +292,7 @@ interface
       SkipInstr = [ait_comment, ait_symbol,ait_section
       SkipInstr = [ait_comment, ait_symbol,ait_section
                    ,ait_stab, ait_function_name, ait_force_line
                    ,ait_stab, ait_function_name, ait_force_line
                    ,ait_regalloc, ait_tempalloc, ait_symbol_end
                    ,ait_regalloc, ait_tempalloc, ait_symbol_end
-                   ,ait_ent, ait_ent_end, ait_directive
+                   ,ait_directive
                    ,ait_varloc,
                    ,ait_varloc,
 {$ifdef JVM}
 {$ifdef JVM}
                    ait_jvar, ait_jcatch,
                    ait_jvar, ait_jcatch,
@@ -311,7 +306,6 @@ interface
                      ait_stab,ait_function_name,
                      ait_stab,ait_function_name,
                      ait_cutobject,ait_marker,ait_varloc,ait_align,ait_section,ait_comment,
                      ait_cutobject,ait_marker,ait_varloc,ait_align,ait_section,ait_comment,
                      ait_const,ait_directive,
                      ait_const,ait_directive,
-                     ait_ent, ait_ent_end,
 {$ifdef arm}
 {$ifdef arm}
                      ait_thumb_func,
                      ait_thumb_func,
                      ait_thumb_set,
                      ait_thumb_set,
@@ -357,7 +351,9 @@ interface
         asd_reference,asd_no_dead_strip,asd_weak_reference,asd_lazy_reference,
         asd_reference,asd_no_dead_strip,asd_weak_reference,asd_lazy_reference,
         asd_weak_definition,
         asd_weak_definition,
         { for Jasmin }
         { for Jasmin }
-        asd_jclass,asd_jinterface,asd_jsuper,asd_jfield,asd_jlimit,asd_jline
+        asd_jclass,asd_jinterface,asd_jsuper,asd_jfield,asd_jlimit,asd_jline,
+        { .ent/.end for MIPS and Alpha }
+        asd_ent,asd_ent_end
       );
       );
 
 
       TAsmSehDirective=(
       TAsmSehDirective=(
@@ -384,7 +380,9 @@ interface
         'extern','nasm_import', 'tc', 'reference',
         'extern','nasm_import', 'tc', 'reference',
         'no_dead_strip','weak_reference','lazy_reference','weak_definition',
         'no_dead_strip','weak_reference','lazy_reference','weak_definition',
         { for Jasmin }
         { for Jasmin }
-        'class','interface','super','field','limit','line'
+        'class','interface','super','field','limit','line',
+        { .ent/.end for MIPS and Alpha }
+        'ent','end'
       );
       );
       sehdirectivestr : array[TAsmSehDirective] of string[16]=(
       sehdirectivestr : array[TAsmSehDirective] of string[16]=(
         '.seh_proc','.seh_endproc',
         '.seh_proc','.seh_endproc',
@@ -464,16 +462,6 @@ interface
           procedure derefimpl;override;
           procedure derefimpl;override;
        end;
        end;
 
 
-       tai_ent = class(tai)
-          Name : string;
-          Constructor Create (const ProcName : String);
-       end;
-
-       tai_ent_end = class(tai)
-          Name : string;
-          Constructor Create (const ProcName : String);
-       end;
-
        tai_directive = class(tailineinfo)
        tai_directive = class(tailineinfo)
           name : ansistring;
           name : ansistring;
           directive : TAsmDirective;
           directive : TAsmDirective;
@@ -485,7 +473,6 @@ interface
        { Generates an assembler label }
        { Generates an assembler label }
        tai_label = class(tai)
        tai_label = class(tai)
           labsym    : tasmlabel;
           labsym    : tasmlabel;
-          is_global : boolean;
 {$ifdef arm}
 {$ifdef arm}
           { set to true when the label has been moved by insertpcrelativedata to the correct location
           { set to true when the label has been moved by insertpcrelativedata to the correct location
             so one label can be used multiple times }
             so one label can be used multiple times }
@@ -572,7 +559,9 @@ interface
           constructor Create_sym(_sym:tasmsymbol);
           constructor Create_sym(_sym:tasmsymbol);
           constructor Create_type_sym(_typ:taiconst_type;_sym:tasmsymbol);
           constructor Create_type_sym(_typ:taiconst_type;_sym:tasmsymbol);
           constructor Create_sym_offset(_sym:tasmsymbol;ofs:aint);
           constructor Create_sym_offset(_sym:tasmsymbol;ofs:aint);
+          constructor Create_type_sym_offset(_typ:taiconst_type;_sym:tasmsymbol;ofs:aint);
           constructor Create_rel_sym(_typ:taiconst_type;_sym,_endsym:tasmsymbol);
           constructor Create_rel_sym(_typ:taiconst_type;_sym,_endsym:tasmsymbol);
+          constructor Create_rel_sym_offset(_typ : taiconst_type; _sym,_endsym : tasmsymbol; _ofs : int64);
           constructor Create_rva_sym(_sym:tasmsymbol);
           constructor Create_rva_sym(_sym:tasmsymbol);
           constructor Createname(const name:string;ofs:aint);
           constructor Createname(const name:string;ofs:aint);
           constructor Createname(const name:string;_symtyp:Tasmsymtype;ofs:aint);
           constructor Createname(const name:string;_symtyp:Tasmsymtype;ofs:aint);
@@ -1288,6 +1277,10 @@ implementation
          typ:=ait_symbol;
          typ:=ait_symbol;
          sym:=_sym;
          sym:=_sym;
          size:=siz;
          size:=siz;
+         { don't redefine global/external symbols as local, as code to access
+           such symbols is different on some platforms }
+         if not(sym.bind in [AB_NONE,AB_LOCAL]) then
+           internalerror(2013081601);
          sym.bind:=AB_LOCAL;
          sym.bind:=AB_LOCAL;
          is_global:=false;
          is_global:=false;
       end;
       end;
@@ -1426,26 +1419,6 @@ implementation
         ppufile.putbyte(byte(directive));
         ppufile.putbyte(byte(directive));
       end;
       end;
 
 
-{****************************************************************************
-                               TAI_ENT / TAI_ENT_END
- ****************************************************************************}
-
-    Constructor tai_ent.Create (const ProcName : String);
-
-    begin
-      Inherited Create;
-	  Name:=ProcName;
-      typ:=ait_ent;
-    end;
-
-    Constructor tai_ent_end.Create (const ProcName : String);
-
-    begin
-      Inherited Create;
-	  Name:=ProcName;
-      typ:=ait_ent_end;
-    end;
-
 
 
 {****************************************************************************
 {****************************************************************************
                                TAI_CONST
                                TAI_CONST
@@ -1680,6 +1653,24 @@ implementation
       end;
       end;
 
 
 
 
+    constructor tai_const.Create_type_sym_offset(_typ : taiconst_type;_sym : tasmsymbol; ofs : aint);
+      begin
+         inherited Create;
+         typ:=ait_const;
+         consttype:=_typ;
+         { sym is allowed to be nil, this is used to write nil pointers }
+         sym:=_sym;
+         endsym:=nil;
+         { store the original offset in symofs so that we can recalculate the
+           value field in the assembler }
+         symofs:=ofs;
+         value:=ofs;
+         { update sym info }
+         if assigned(sym) then
+           sym.increfs;
+      end;
+
+
     constructor tai_const.Create_rel_sym(_typ:taiconst_type;_sym,_endsym:tasmsymbol);
     constructor tai_const.Create_rel_sym(_typ:taiconst_type;_sym,_endsym:tasmsymbol);
       begin
       begin
          self.create_sym_offset(_sym,0);
          self.create_sym_offset(_sym,0);
@@ -1689,6 +1680,15 @@ implementation
       end;
       end;
 
 
 
 
+    constructor tai_const.Create_rel_sym_offset(_typ: taiconst_type; _sym,_endsym: tasmsymbol; _ofs: int64);
+       begin
+         self.create_sym_offset(_sym,_ofs);
+         consttype:=_typ;
+         endsym:=_endsym;
+         endsym.increfs;
+       end;
+
+
     constructor tai_const.Create_rva_sym(_sym:tasmsymbol);
     constructor tai_const.Create_rva_sym(_sym:tasmsymbol);
       begin
       begin
          self.create_sym_offset(_sym,0);
          self.create_sym_offset(_sym,0);
@@ -2046,7 +2046,6 @@ implementation
         typ:=ait_label;
         typ:=ait_label;
         labsym:=_labsym;
         labsym:=_labsym;
         labsym.is_set:=true;
         labsym.is_set:=true;
-        is_global:=(labsym.bind in [AB_GLOBAL,AB_PRIVATE_EXTERN]);
       end;
       end;
 
 
 
 
@@ -2054,7 +2053,7 @@ implementation
       begin
       begin
         inherited ppuload(t,ppufile);
         inherited ppuload(t,ppufile);
         labsym:=tasmlabel(ppufile.getasmsymbol);
         labsym:=tasmlabel(ppufile.getasmsymbol);
-        is_global:=boolean(ppufile.getbyte);
+        ppufile.getbyte; { was is_global flag, now unused }
       end;
       end;
 
 
 
 
@@ -2062,7 +2061,7 @@ implementation
       begin
       begin
         inherited ppuwrite(ppufile);
         inherited ppuwrite(ppufile);
         ppufile.putasmsymbol(labsym);
         ppufile.putasmsymbol(labsym);
-        ppufile.putbyte(byte(is_global));
+        ppufile.putbyte(0); { was is_global flag, now unused }
       end;
       end;
 
 
 
 

+ 6 - 17
compiler/aggas.pas

@@ -956,6 +956,11 @@ implementation
                       AsmLn;
                       AsmLn;
                     end;
                     end;
 {$endif cpu64bitaddr}
 {$endif cpu64bitaddr}
+                 aitconst_got:
+                   begin
+                     AsmWrite(#9'.word'#9+tai_const(hp).sym.name+'(GOT)');
+                     Asmln;
+                   end;
                  aitconst_uleb128bit,
                  aitconst_uleb128bit,
                  aitconst_sleb128bit,
                  aitconst_sleb128bit,
 {$ifdef cpu64bitaddr}
 {$ifdef cpu64bitaddr}
@@ -1337,23 +1342,7 @@ implementation
              begin
              begin
                AsmWriteLn(#9'.weak '+tai_weak(hp).sym^);
                AsmWriteLn(#9'.weak '+tai_weak(hp).sym^);
              end;
              end;
-           ait_ent:
-             begin
-               AsmWrite(#9'.ent'#9);
-			   if replaceforbidden then
-                 AsmWriteLn(ReplaceForbiddenAsmSymbolChars(tai_ent(hp).Name))
-               else
-                 AsmWriteLn(tai_ent(hp).Name);
-             end;
-           ait_ent_end:
-             begin
-               AsmWrite(#9'.end'#9);
-			   if replaceforbidden then
-                 AsmWriteLn(ReplaceForbiddenAsmSymbolChars(tai_ent_end(hp).Name))
-               else
-  			     AsmWriteLn(tai_ent_end(hp).Name);
-             end;
-            ait_symbol_end :
+           ait_symbol_end :
              begin
              begin
                if tf_needs_symbol_size in target_info.flags then
                if tf_needs_symbol_size in target_info.flags then
                 begin
                 begin

+ 39 - 2
compiler/aoptobj.pas

@@ -289,13 +289,23 @@ Unit AoptObj;
         { returns true if the operands o1 and o2 are completely equal }
         { returns true if the operands o1 and o2 are completely equal }
         Function OpsEqual(const o1,o2:toper): Boolean;
         Function OpsEqual(const o1,o2:toper): Boolean;
 
 
-        { Returns the next ait_alloc object with ratype ra_dealloc for
+        { Returns the next ait_alloc object with ratype ra_alloc for
           Reg is found in the block
           Reg is found in the block
           of Tai's starting with StartPai and ending with the next "real"
           of Tai's starting with StartPai and ending with the next "real"
           instruction. If none is found, it returns
           instruction. If none is found, it returns
-          nil                                                                        }
+          nil
+        }
         Function FindRegAlloc(Reg: TRegister; StartPai: Tai): tai_regalloc;
         Function FindRegAlloc(Reg: TRegister; StartPai: Tai): tai_regalloc;
 
 
+        { Returns the last ait_alloc object with ratype ra_alloc for
+          Reg is found in the block
+          of Tai's starting with StartPai and ending with the next "real"
+          instruction. If none is found, it returns
+          nil
+        }
+        Function FindRegAllocBackward(Reg : TRegister; StartPai : Tai) : tai_regalloc;
+
+
         { Returns the next ait_alloc object with ratype ra_dealloc
         { Returns the next ait_alloc object with ratype ra_dealloc
           for Reg which is found in the block of Tai's starting with StartPai
           for Reg which is found in the block of Tai's starting with StartPai
           and ending with the next "real" instruction. If none is found, it returns
           and ending with the next "real" instruction. If none is found, it returns
@@ -1048,6 +1058,33 @@ Unit AoptObj;
       End;
       End;
 
 
 
 
+      Function TAOptObj.FindRegAllocBackward(Reg: TRegister; StartPai: Tai): tai_regalloc;
+      Begin
+        Result:=nil;
+        Repeat
+          While Assigned(StartPai) And
+                ((StartPai.typ in (SkipInstr - [ait_regAlloc])) Or
+                 ((StartPai.typ = ait_label) and
+                  Not(Tai_Label(StartPai).labsym.Is_Used))) Do
+            StartPai := Tai(StartPai.Previous);
+          If Assigned(StartPai) And
+             (StartPai.typ = ait_regAlloc) Then
+            Begin
+              if (tai_regalloc(StartPai).ratype=ra_alloc) and
+                (getregtype(tai_regalloc(StartPai).Reg) = getregtype(Reg)) and
+                (getsupreg(tai_regalloc(StartPai).Reg) = getsupreg(Reg)) then
+               begin
+                 Result:=tai_regalloc(StartPai);
+                 exit;
+               end;
+              StartPai := Tai(StartPai.Previous);
+            End
+          else
+            exit;
+        Until false;
+      End;
+
+
       function TAOptObj.FindRegDeAlloc(Reg: TRegister; StartPai: Tai): tai_regalloc;
       function TAOptObj.FindRegDeAlloc(Reg: TRegister; StartPai: Tai): tai_regalloc;
       Begin
       Begin
          Result:=nil;
          Result:=nil;

+ 71 - 27
compiler/arm/aasmcpu.pas

@@ -644,6 +644,8 @@ implementation
                   op:=A_FLDD;
                   op:=A_FLDD;
                 R_SUBFS:
                 R_SUBFS:
                   op:=A_FLDS;
                   op:=A_FLDS;
+                R_SUBNONE:
+                  op:=A_VLDR;
                 else
                 else
                   internalerror(2009112905);
                   internalerror(2009112905);
               end;
               end;
@@ -674,6 +676,8 @@ implementation
                   op:=A_FSTD;
                   op:=A_FSTD;
                 R_SUBFS:
                 R_SUBFS:
                   op:=A_FSTS;
                   op:=A_FSTS;
+                R_SUBNONE:
+                  op:=A_VSTR;
                 else
                 else
                   internalerror(2009112904);
                   internalerror(2009112904);
               end;
               end;
@@ -715,7 +719,8 @@ implementation
           A_FTOUIS,A_FTOUID,A_FUITOS,A_FUITOD,
           A_FTOUIS,A_FTOUID,A_FUITOS,A_FUITOD,
           A_SXTB16,A_UXTB16,
           A_SXTB16,A_UXTB16,
           A_UXTB,A_UXTH,A_SXTB,A_SXTH,
           A_UXTB,A_UXTH,A_SXTB,A_SXTH,
-          A_NEG:
+          A_NEG,
+          A_VABS,A_VADD,A_VCVT,A_VDIV,A_VLDR,A_VMOV,A_VMUL,A_VNEG,A_VSQRT,A_VSUB:
             if opnr=0 then
             if opnr=0 then
               result:=operand_write
               result:=operand_write
             else
             else
@@ -724,7 +729,8 @@ implementation
           A_CMN,A_CMP,A_TEQ,A_TST,
           A_CMN,A_CMP,A_TEQ,A_TST,
           A_CMF,A_CMFE,A_WFS,A_CNF,
           A_CMF,A_CMFE,A_WFS,A_CNF,
           A_FCMPS,A_FCMPD,A_FCMPES,A_FCMPED,A_FCMPEZS,A_FCMPEZD,
           A_FCMPS,A_FCMPD,A_FCMPES,A_FCMPED,A_FCMPEZS,A_FCMPEZD,
-          A_FCMPZS,A_FCMPZD:
+          A_FCMPZS,A_FCMPZD,
+          A_VCMP,A_VCMPE:
             result:=operand_read;
             result:=operand_read;
           A_SMLAL,A_UMLAL:
           A_SMLAL,A_UMLAL:
             if opnr in [0,1] then
             if opnr in [0,1] then
@@ -739,7 +745,8 @@ implementation
               result:=operand_read;
               result:=operand_read;
           A_STR,A_STRB,A_STRBT,
           A_STR,A_STRB,A_STRBT,
           A_STRH,A_STRT,A_STF,A_SFM,
           A_STRH,A_STRT,A_STF,A_SFM,
-          A_FSTS,A_FSTD:
+          A_FSTS,A_FSTD,
+          A_VSTR:
             { important is what happens with the involved registers }
             { important is what happens with the involved registers }
             if opnr=0 then
             if opnr=0 then
               result := operand_read
               result := operand_read
@@ -885,7 +892,7 @@ implementation
         lastinspos:=-1;
         lastinspos:=-1;
         curinspos:=0;
         curinspos:=0;
         extradataoffset:=0;
         extradataoffset:=0;
-        if current_settings.cputype in cpu_thumb then
+        if GenerateThumbCode then
           begin
           begin
             multiplier:=2;
             multiplier:=2;
             limit:=504;
             limit:=504;
@@ -915,7 +922,7 @@ implementation
                             begin
                             begin
                               { create a new copy of a data entry on arm thumb if the entry has been inserted already
                               { create a new copy of a data entry on arm thumb if the entry has been inserted already
                                 before because arm thumb does not allow pc relative negative offsets }
                                 before because arm thumb does not allow pc relative negative offsets }
-                              if (current_settings.cputype in cpu_thumb) and
+                              if (GenerateThumbCode) and
                                 tai_label(curdatatai).inserted then
                                 tai_label(curdatatai).inserted then
                                 begin
                                 begin
                                   current_asmdata.getjumplabel(l);
                                   current_asmdata.getjumplabel(l);
@@ -1026,21 +1033,57 @@ implementation
             end;
             end;
             { special case for case jump tables }
             { special case for case jump tables }
             if SimpleGetNextInstruction(curtai,hp) and
             if SimpleGetNextInstruction(curtai,hp) and
-              (tai(hp).typ=ait_instruction) and
-              (taicpu(hp).opcode=A_LDR) and
-              (taicpu(hp).oper[0]^.typ=top_reg) and
-              (taicpu(hp).oper[0]^.reg=NR_PC) then
+              (tai(hp).typ=ait_instruction) then
               begin
               begin
-                penalty:=1*multiplier;
-                hp:=tai(hp.next);
-                { skip register allocations and comments inserted by the optimizer }
-                while assigned(hp) and (hp.typ in [ait_comment,ait_regalloc]) do
-                  hp:=tai(hp.next);
-                while assigned(hp) and (hp.typ=ait_const) do
-                  begin
-                    inc(penalty,multiplier);
-                    hp:=tai(hp.next);
-                  end;
+                case taicpu(hp).opcode of
+                  A_BX,
+                  A_LDR:
+                    { approximation if we hit a case jump table }
+                    if ((taicpu(hp).opcode=A_LDR) and not(GenerateThumbCode or GenerateThumb2Code) and
+                       (taicpu(hp).oper[0]^.typ=top_reg) and
+                      (taicpu(hp).oper[0]^.reg=NR_PC)) or
+                      ((taicpu(hp).opcode=A_BX) and (GenerateThumbCode) and
+                       (taicpu(hp).oper[0]^.typ=top_reg))
+                       then
+                      begin
+                        penalty:=multiplier;
+                        hp:=tai(hp.next);
+                        { skip register allocations and comments inserted by the optimizer as well as a label
+                          as jump tables for thumb might have }
+                        while assigned(hp) and (hp.typ in [ait_comment,ait_regalloc,ait_label]) do
+                          hp:=tai(hp.next);
+                        while assigned(hp) and (hp.typ=ait_const) do
+                          begin
+                            inc(penalty,multiplier);
+                            hp:=tai(hp.next);
+                          end;
+                      end;
+                  A_IT:
+                    if GenerateThumb2Code then
+                      penalty:=multiplier;
+                  A_ITE,
+                  A_ITT:
+                    if GenerateThumb2Code then
+                      penalty:=2*multiplier;
+                  A_ITEE,
+                  A_ITTE,
+                  A_ITET,
+                  A_ITTT:
+                    if GenerateThumb2Code then
+                      penalty:=3*multiplier;
+                  A_ITEEE,
+                  A_ITTEE,
+                  A_ITETE,
+                  A_ITTTE,
+                  A_ITEET,
+                  A_ITTET,
+                  A_ITETT,
+                  A_ITTTT:
+                    if GenerateThumb2Code then
+                      penalty:=4*multiplier;
+                  else
+                    penalty:=0;
+                end;
               end
               end
             else
             else
               penalty:=0;
               penalty:=0;
@@ -1049,7 +1092,8 @@ implementation
             if SimpleGetNextInstruction(curtai,hp) and
             if SimpleGetNextInstruction(curtai,hp) and
                (tai(hp).typ=ait_instruction) and
                (tai(hp).typ=ait_instruction) and
                ((taicpu(hp).opcode=A_FLDS) or
                ((taicpu(hp).opcode=A_FLDS) or
-                (taicpu(hp).opcode=A_FLDD)) then
+                (taicpu(hp).opcode=A_FLDD) or
+                (taicpu(hp).opcode=A_VLDR)) then
               limit:=254;
               limit:=254;
 
 
             { don't miss an insert }
             { don't miss an insert }
@@ -1071,7 +1115,7 @@ implementation
               ) and
               ) and
               (
               (
                 { do not insert data after a B instruction due to their limited range }
                 { do not insert data after a B instruction due to their limited range }
-                not((current_settings.cputype in cpu_thumb) and
+                not((GenerateThumbCode) and
                     (taicpu(curtai).opcode=A_B)
                     (taicpu(curtai).opcode=A_B)
                    )
                    )
               ) then
               ) then
@@ -1079,15 +1123,15 @@ implementation
                 lastinspos:=-1;
                 lastinspos:=-1;
                 extradataoffset:=0;
                 extradataoffset:=0;
 
 
-                if current_settings.cputype in cpu_thumb then
+                if GenerateThumbCode then
                   limit:=502
                   limit:=502
                 else
                 else
                   limit:=1016;
                   limit:=1016;
 
 
-                { on arm thumb, insert the date always after all labels etc. following an instruction so it
+                { on arm thumb, insert the data always after all labels etc. following an instruction so it
                   is prevent that a bxx yyy; bl xxx; yyyy: sequence gets separated ( we never insert on arm thumb after
                   is prevent that a bxx yyy; bl xxx; yyyy: sequence gets separated ( we never insert on arm thumb after
                   bxx) and the distance of bxx gets too long }
                   bxx) and the distance of bxx gets too long }
-                if current_settings.cputype in cpu_thumb then
+                if GenerateThumbCode then
                   while assigned(tai(curtai.Next)) and (tai(curtai.Next).typ in SkipInstr+[ait_label]) do
                   while assigned(tai(curtai.Next)) and (tai(curtai.Next).typ in SkipInstr+[ait_label]) do
                     curtai:=tai(curtai.next);
                     curtai:=tai(curtai.next);
 
 
@@ -1095,7 +1139,7 @@ implementation
                 current_asmdata.getjumplabel(l);
                 current_asmdata.getjumplabel(l);
 
 
                 { align thumb in thumb .text section to 4 bytes }
                 { align thumb in thumb .text section to 4 bytes }
-                if not(curdata.empty) and (current_settings.cputype in cpu_thumb) then
+                if not(curdata.empty) and (GenerateThumbCode) then
                   curdata.Insert(tai_align.Create(4));
                   curdata.Insert(tai_align.Create(4));
                 curdata.insert(taicpu.op_sym(A_B,l));
                 curdata.insert(taicpu.op_sym(A_B,l));
                 curdata.concat(tai_label.create(l));
                 curdata.concat(tai_label.create(l));
@@ -1123,7 +1167,7 @@ implementation
               curtai:=tai(curtai.next);
               curtai:=tai(curtai.next);
           end;
           end;
         { align thumb in thumb .text section to 4 bytes }
         { align thumb in thumb .text section to 4 bytes }
-        if not(curdata.empty) and (current_settings.cputype in cpu_thumb+cpu_thumb2) then
+        if not(curdata.empty) and (GenerateThumbCode or GenerateThumb2Code) then
           curdata.Insert(tai_align.Create(4));
           curdata.Insert(tai_align.Create(4));
         list.concatlist(curdata);
         list.concatlist(curdata);
         curdata.free;
         curdata.free;
@@ -1285,7 +1329,7 @@ implementation
     procedure finalizearmcode(list, listtoinsert: TAsmList);
     procedure finalizearmcode(list, listtoinsert: TAsmList);
       begin
       begin
         { Do Thumb-2 16bit -> 32bit transformations }
         { Do Thumb-2 16bit -> 32bit transformations }
-        if current_settings.cputype in cpu_thumb2 then
+        if GenerateThumb2Code then
           begin
           begin
             ensurethumb2encodings(list);
             ensurethumb2encodings(list);
             foldITInstructions(list);
             foldITInstructions(list);

+ 8 - 8
compiler/arm/agarmgas.pas

@@ -110,9 +110,9 @@ unit agarmgas;
         if (current_settings.fputype = fpu_fpv4_s16) then
         if (current_settings.fputype = fpu_fpv4_s16) then
           result:='-mfpu=fpv4-sp-d16 '+result;
           result:='-mfpu=fpv4-sp-d16 '+result;
 
 
-        if current_settings.cputype in cpu_thumb2 then
+        if GenerateThumb2Code then
           result:='-march='+cputype_to_gas_march[current_settings.cputype]+' -mthumb -mthumb-interwork '+result
           result:='-march='+cputype_to_gas_march[current_settings.cputype]+' -mthumb -mthumb-interwork '+result
-        else if current_settings.cputype in cpu_thumb then
+        else if GenerateThumbCode then
           result:='-march='+cputype_to_gas_march[current_settings.cputype]+' -mthumb -mthumb-interwork '+result
           result:='-march='+cputype_to_gas_march[current_settings.cputype]+' -mthumb -mthumb-interwork '+result
         // EDSP instructions in RTL require armv5te at least to not generate error
         // EDSP instructions in RTL require armv5te at least to not generate error
         else if current_settings.cputype >= cpu_armv5te then
         else if current_settings.cputype >= cpu_armv5te then
@@ -126,7 +126,7 @@ unit agarmgas;
     procedure TArmGNUAssembler.WriteExtraHeader;
     procedure TArmGNUAssembler.WriteExtraHeader;
       begin
       begin
         inherited WriteExtraHeader;
         inherited WriteExtraHeader;
-        if current_settings.cputype in cpu_thumb2 then
+        if GenerateThumb2Code then
           AsmWriteLn(#9'.syntax unified');
           AsmWriteLn(#9'.syntax unified');
       end;
       end;
 
 
@@ -164,10 +164,10 @@ unit agarmgas;
                 if (base<>NR_NO) and not(is_pc(base)) then
                 if (base<>NR_NO) and not(is_pc(base)) then
                   internalerror(200309011);
                   internalerror(200309011);
                 s:=symbol.name;
                 s:=symbol.name;
-                if offset<0 then
-                  s:=s+tostr(offset)
-                else if offset>0 then
-                  s:=s+'+'+tostr(offset);
+                if offset<>0 then
+                  s:=s+tostr_with_plus(offset);
+                if refaddr=addr_pic then
+                  s:=s+'(PLT)';
               end
               end
             else
             else
               begin
               begin
@@ -289,7 +289,7 @@ unit agarmgas;
         sep: string[3];
         sep: string[3];
     begin
     begin
       op:=taicpu(hp).opcode;
       op:=taicpu(hp).opcode;
-      if current_settings.cputype in cpu_thumb2 then
+      if GenerateThumb2Code then
         begin
         begin
           postfix:='';
           postfix:='';
           if taicpu(hp).wideformat then
           if taicpu(hp).wideformat then

+ 45 - 20
compiler/arm/aoptcpu.pas

@@ -86,7 +86,7 @@ Implementation
   function CanBeCond(p : tai) : boolean;
   function CanBeCond(p : tai) : boolean;
     begin
     begin
       result:=
       result:=
-        not(current_settings.cputype in cpu_thumb) and
+        not(GenerateThumbCode) and
         (p.typ=ait_instruction) and
         (p.typ=ait_instruction) and
         (taicpu(p).condition=C_None) and
         (taicpu(p).condition=C_None) and
         ((taicpu(p).opcode<A_IT) or (taicpu(p).opcode>A_ITTTT)) and
         ((taicpu(p).opcode<A_IT) or (taicpu(p).opcode>A_ITTTT)) and
@@ -284,7 +284,7 @@ Implementation
 
 
   function isValidConstLoadStoreOffset(const aoffset: longint; const pf: TOpPostfix) : boolean;
   function isValidConstLoadStoreOffset(const aoffset: longint; const pf: TOpPostfix) : boolean;
     begin
     begin
-      if current_settings.cputype in cpu_thumb2 then
+      if GenerateThumb2Code then
         result := (aoffset<4096) and (aoffset>-256)
         result := (aoffset<4096) and (aoffset>-256)
       else
       else
         result := ((pf in [PF_None,PF_B]) and
         result := ((pf in [PF_None,PF_B]) and
@@ -375,9 +375,8 @@ Implementation
 
 
               { taicpu(p).oper[0]^.reg is not used anymore, try to find its allocation
               { taicpu(p).oper[0]^.reg is not used anymore, try to find its allocation
                 and remove it if possible }
                 and remove it if possible }
-              GetLastInstruction(p,hp1);
               asml.Remove(dealloc);
               asml.Remove(dealloc);
-              alloc:=FindRegAlloc(taicpu(p).oper[0]^.reg,tai(hp1.Next));
+              alloc:=FindRegAllocBackward(taicpu(p).oper[0]^.reg,tai(p.previous));
               if assigned(alloc) then
               if assigned(alloc) then
                 begin
                 begin
                   asml.Remove(alloc);
                   asml.Remove(alloc);
@@ -420,7 +419,7 @@ Implementation
     var
     var
       hp1: tai;
       hp1: tai;
     begin
     begin
-      if (current_settings.cputype in cpu_arm) and
+      if GenerateARMCode and
         (p.ops=3) and
         (p.ops=3) and
         MatchOperand(p.oper[0]^, p.oper[1]^.reg) and
         MatchOperand(p.oper[0]^, p.oper[1]^.reg) and
         GetNextInstructionUsingReg(p, hp1, p.oper[0]^.reg) and
         GetNextInstructionUsingReg(p, hp1, p.oper[0]^.reg) and
@@ -500,7 +499,7 @@ Implementation
         { don't apply the optimization if the (new) index register is loaded }
         { don't apply the optimization if the (new) index register is loaded }
         (p.oper[0]^.reg<>taicpu(hp1).oper[2]^.reg) and
         (p.oper[0]^.reg<>taicpu(hp1).oper[2]^.reg) and
         not(RegModifiedBetween(taicpu(hp1).oper[2]^.reg,p,hp1)) and
         not(RegModifiedBetween(taicpu(hp1).oper[2]^.reg,p,hp1)) and
-        (current_settings.cputype in cpu_arm) then
+        GenerateARMCode then
         begin
         begin
           DebugMsg('Peephole Str/LdrAdd/Sub2Str/Ldr Postindex done', p);
           DebugMsg('Peephole Str/LdrAdd/Sub2Str/Ldr Postindex done', p);
           p.oper[1]^.ref^.addressmode:=AM_POSTINDEXED;
           p.oper[1]^.ref^.addressmode:=AM_POSTINDEXED;
@@ -641,7 +640,8 @@ Implementation
                       into
                       into
                       strd reg1,ref
                       strd reg1,ref
                     }
                     }
-                    else if (CPUARM_HAS_EDSP in cpu_capabilities[current_settings.cputype]) and
+                    else if (GenerateARMCode or GenerateThumb2Code) and
+                       (CPUARM_HAS_EDSP in cpu_capabilities[current_settings.cputype]) and
                        (taicpu(p).oppostfix=PF_None) and
                        (taicpu(p).oppostfix=PF_None) and
                        (taicpu(p).oper[1]^.ref^.addressmode=AM_OFFSET) and
                        (taicpu(p).oper[1]^.ref^.addressmode=AM_OFFSET) and
                        GetNextInstruction(p,hp1) and
                        GetNextInstruction(p,hp1) and
@@ -705,7 +705,8 @@ Implementation
                            ...
                            ...
                            ldrd reg1,ref
                            ldrd reg1,ref
                         }
                         }
-                        else if (CPUARM_HAS_EDSP in cpu_capabilities[current_settings.cputype]) and
+                        else if (GenerateARMCode or GenerateThumb2Code) and
+                          (CPUARM_HAS_EDSP in cpu_capabilities[current_settings.cputype]) and
                           { ldrd does not allow any postfixes ... }
                           { ldrd does not allow any postfixes ... }
                           (taicpu(p).oppostfix=PF_None) and
                           (taicpu(p).oppostfix=PF_None) and
                           not(odd(getsupreg(taicpu(p).oper[0]^.reg))) and
                           not(odd(getsupreg(taicpu(p).oper[0]^.reg))) and
@@ -736,7 +737,8 @@ Implementation
 
 
                         ldrb dst2, [ref]
                         ldrb dst2, [ref]
                     }
                     }
-                    if (taicpu(p).oppostfix=PF_B) and
+                    if not(GenerateThumbCode) and
+                       (taicpu(p).oppostfix=PF_B) and
                        GetNextInstructionUsingReg(p, hp1, taicpu(p).oper[0]^.reg) and
                        GetNextInstructionUsingReg(p, hp1, taicpu(p).oper[0]^.reg) and
                        MatchInstruction(hp1, A_AND, [taicpu(p).condition], [PF_NONE]) and
                        MatchInstruction(hp1, A_AND, [taicpu(p).condition], [PF_NONE]) and
                        (taicpu(hp1).oper[1]^.reg = taicpu(p).oper[0]^.reg) and
                        (taicpu(hp1).oper[1]^.reg = taicpu(p).oper[0]^.reg) and
@@ -838,10 +840,10 @@ Implementation
                                 SM_LSR,
                                 SM_LSR,
                                 SM_LSL:
                                 SM_LSL:
                                   begin
                                   begin
-                                    hp1:=taicpu.op_reg_const(A_MOV,taicpu(p).oper[0]^.reg,0);
-                                    InsertLLItem(p.previous, p.next, hp1);
+                                    hp2:=taicpu.op_reg_const(A_MOV,taicpu(p).oper[0]^.reg,0);
+                                    InsertLLItem(p.previous, p.next, hp2);
                                     p.free;
                                     p.free;
-                                    p:=hp1;
+                                    p:=hp2;
                                   end;
                                   end;
                                 else
                                 else
                                   internalerror(2008072803);
                                   internalerror(2008072803);
@@ -1085,7 +1087,12 @@ Implementation
                             will also be in hp1 then.
                             will also be in hp1 then.
                           }
                           }
                           if (taicpu(hp1).ops > I) and
                           if (taicpu(hp1).ops > I) and
-                             MatchOperand(taicpu(p).oper[0]^, taicpu(hp1).oper[I]^.reg) then
+                             MatchOperand(taicpu(p).oper[0]^, taicpu(hp1).oper[I]^.reg) and
+                             { prevent certain combinations on thumb(2), this is only a safe approximation }
+                             (not(GenerateThumbCode or GenerateThumb2Code) or
+                              ((getsupreg(taicpu(p).oper[1]^.reg)<>RS_R13) and
+                               (getsupreg(taicpu(p).oper[1]^.reg)<>RS_R15))
+                             ) then
                             begin
                             begin
                               DebugMsg('Peephole RedundantMovProcess done', hp1);
                               DebugMsg('Peephole RedundantMovProcess done', hp1);
                               taicpu(hp1).oper[I]^.reg := taicpu(p).oper[1]^.reg;
                               taicpu(hp1).oper[I]^.reg := taicpu(p).oper[1]^.reg;
@@ -1116,7 +1123,7 @@ Implementation
                                               A_AND, A_BIC, A_EOR, A_ORR, A_TEQ, A_TST,
                                               A_AND, A_BIC, A_EOR, A_ORR, A_TEQ, A_TST,
                                               A_CMP, A_CMN],
                                               A_CMP, A_CMN],
                                         [taicpu(p).condition], [PF_None]) and
                                         [taicpu(p).condition], [PF_None]) and
-                       (not ((current_settings.cputype in cpu_thumb2) and
+                       (not ((GenerateThumb2Code) and
                              (taicpu(hp1).opcode in [A_SBC]) and
                              (taicpu(hp1).opcode in [A_SBC]) and
                              (((taicpu(hp1).ops=3) and 
                              (((taicpu(hp1).ops=3) and 
                                MatchOperand(taicpu(p).oper[0]^, taicpu(hp1).oper[1]^.reg)) or
                                MatchOperand(taicpu(p).oper[0]^, taicpu(hp1).oper[1]^.reg)) or
@@ -1217,7 +1224,8 @@ Implementation
                              add r1, r3, #imm
                              add r1, r3, #imm
                              ldr r0, [r1, r2, lsl #2]
                              ldr r0, [r1, r2, lsl #2]
                     }
                     }
-                    if (taicpu(p).opcode = A_MOV) and
+                    if (not(GenerateThumbCode)) and
+                       (taicpu(p).opcode = A_MOV) and
                        (taicpu(p).ops = 3) and
                        (taicpu(p).ops = 3) and
                        (taicpu(p).oper[1]^.typ = top_reg) and
                        (taicpu(p).oper[1]^.typ = top_reg) and
                        (taicpu(p).oper[2]^.typ = top_shifterop) and
                        (taicpu(p).oper[2]^.typ = top_shifterop) and
@@ -1225,6 +1233,12 @@ Implementation
                          it is also extremly unlikely to be emitted this way}
                          it is also extremly unlikely to be emitted this way}
                        (taicpu(p).oper[2]^.shifterop^.shiftmode <> SM_RRX) and
                        (taicpu(p).oper[2]^.shifterop^.shiftmode <> SM_RRX) and
                        (taicpu(p).oper[2]^.shifterop^.shiftimm <> 0) and
                        (taicpu(p).oper[2]^.shifterop^.shiftimm <> 0) and
+                       { thumb2 allows only lsl #0..#3 }
+                       (not(GenerateThumb2Code) or
+                        ((taicpu(p).oper[2]^.shifterop^.shiftimm in [0..3]) and
+                         (taicpu(p).oper[2]^.shifterop^.shiftmode=SM_LSL)
+                        )
+                       ) and
                        (taicpu(p).oppostfix = PF_NONE) and
                        (taicpu(p).oppostfix = PF_NONE) and
                        GetNextInstructionUsingReg(p, hp1, taicpu(p).oper[0]^.reg) and
                        GetNextInstructionUsingReg(p, hp1, taicpu(p).oper[0]^.reg) and
                        {Only LDR, LDRB, STR, STRB can handle scaled register indexing}
                        {Only LDR, LDRB, STR, STRB can handle scaled register indexing}
@@ -1894,7 +1908,7 @@ Implementation
                 case taicpu(p).opcode Of
                 case taicpu(p).opcode Of
                   A_B:
                   A_B:
                     if (taicpu(p).condition<>C_None) and
                     if (taicpu(p).condition<>C_None) and
-                      not(current_settings.cputype in cpu_thumb) then
+                      not(GenerateThumbCode) then
                       begin
                       begin
                          { check for
                          { check for
                                 Bxx   xxx
                                 Bxx   xxx
@@ -2142,7 +2156,7 @@ Implementation
   { TODO : schedule also forward }
   { TODO : schedule also forward }
   { TODO : schedule distance > 1 }
   { TODO : schedule distance > 1 }
     var
     var
-      hp1,hp2,hp3,hp4,hp5 : tai;
+      hp1,hp2,hp3,hp4,hp5,insertpos : tai;
       list : TAsmList;
       list : TAsmList;
     begin
     begin
       result:=true;
       result:=true;
@@ -2233,11 +2247,22 @@ Implementation
                 end;
                 end;
 
 
               asml.Remove(hp1);
               asml.Remove(hp1);
+              { if there are address labels associated with hp2, those must
+                stay with hp2 (e.g. for GOT-less PIC) }
+              insertpos:=hp2;
+              while assigned(hp2.previous) and
+                    (tai(hp2.previous).typ<>ait_instruction) do
+                begin
+                  hp2:=tai(hp2.previous);
+                  if (hp2.typ=ait_label) and
+                     (tai_label(hp2).labsym.typ=AT_ADDR) then
+                    insertpos:=hp2;
+                end;
 {$ifdef DEBUG_PREREGSCHEDULER}
 {$ifdef DEBUG_PREREGSCHEDULER}
-              asml.insertbefore(tai_comment.Create(strpnew('Rescheduled')),hp2);
+              asml.insertbefore(tai_comment.Create(strpnew('Rescheduled')),insertpos);
 {$endif DEBUG_PREREGSCHEDULER}
 {$endif DEBUG_PREREGSCHEDULER}
-              asml.InsertBefore(hp1,hp2);
-              asml.InsertListBefore(hp2,list);
+              asml.InsertBefore(hp1,insertpos);
+              asml.InsertListBefore(insertpos,list);
               p:=tai(p.next)
               p:=tai(p.next)
             end
             end
           else if p.typ=ait_instruction then
           else if p.typ=ait_instruction then

+ 216 - 82
compiler/arm/cgcpu.pas

@@ -74,6 +74,7 @@ unit cgcpu;
 
 
         procedure g_proc_entry(list : TAsmList;localsize : longint;nostackframe:boolean);override;
         procedure g_proc_entry(list : TAsmList;localsize : longint;nostackframe:boolean);override;
         procedure g_proc_exit(list : TAsmList;parasize : longint;nostackframe:boolean); override;
         procedure g_proc_exit(list : TAsmList;parasize : longint;nostackframe:boolean); override;
+        procedure g_maybe_got_init(list : TAsmList); override;
 
 
         procedure a_loadaddr_ref_reg(list : TAsmList;const ref : treference;r : tregister);override;
         procedure a_loadaddr_ref_reg(list : TAsmList;const ref : treference;r : tregister);override;
 
 
@@ -111,7 +112,9 @@ unit cgcpu;
         { clear out potential overflow bits from 8 or 16 bit operations  }
         { clear out potential overflow bits from 8 or 16 bit operations  }
         { the upper 24/16 bits of a register after an operation          }
         { the upper 24/16 bits of a register after an operation          }
         procedure maybeadjustresult(list: TAsmList; op: TOpCg; size: tcgsize; dst: tregister);
         procedure maybeadjustresult(list: TAsmList; op: TOpCg; size: tcgsize; dst: tregister);
-        function get_darwin_call_stub(const s: string; weak: boolean): tasmsymbol;
+
+        { mla for thumb requires that none of the registers is equal to r13/r15, this method ensures this }
+        procedure safe_mla(list: TAsmList;op1,op2,op3,op4 : TRegister);
       end;
       end;
 
 
       { tcgarm is shared between normal arm and thumb-2 }
       { tcgarm is shared between normal arm and thumb-2 }
@@ -624,19 +627,30 @@ unit cgcpu;
     procedure tbasecgarm.a_call_name(list : TAsmList;const s : string; weak: boolean);
     procedure tbasecgarm.a_call_name(list : TAsmList;const s : string; weak: boolean);
       var
       var
         branchopcode: tasmop;
         branchopcode: tasmop;
+        r : treference;
+        sym : TAsmSymbol;
       begin
       begin
         { check not really correct: should only be used for non-Thumb cpus }
         { check not really correct: should only be used for non-Thumb cpus }
         if CPUARM_HAS_BLX_LABEL in cpu_capabilities[current_settings.cputype] then
         if CPUARM_HAS_BLX_LABEL in cpu_capabilities[current_settings.cputype] then
           branchopcode:=A_BLX
           branchopcode:=A_BLX
         else
         else
           branchopcode:=A_BL;
           branchopcode:=A_BL;
-        if target_info.system<>system_arm_darwin then
-          if not weak then
-            list.concat(taicpu.op_sym(branchopcode,current_asmdata.RefAsmSymbol(s)))
-          else
-            list.concat(taicpu.op_sym(branchopcode,current_asmdata.WeakRefAsmSymbol(s)))
+        if not(weak) then
+          sym:=current_asmdata.RefAsmSymbol(s)
+        else
+          sym:=current_asmdata.WeakRefAsmSymbol(s);
+        reference_reset_symbol(r,sym,0,sizeof(pint));
+
+        if (tf_pic_uses_got in target_info.flags) and
+           (cs_create_pic in current_settings.moduleswitches) then
+          begin
+            include(current_procinfo.flags,pi_needs_got);
+            r.refaddr:=addr_pic
+          end
         else
         else
-          list.concat(taicpu.op_sym(branchopcode,get_darwin_call_stub(s,weak)));
+          r.refaddr:=addr_full;
+
+        list.concat(taicpu.op_ref(branchopcode,r));
 {
 {
         the compiler does not properly set this flag anymore in pass 1, and
         the compiler does not properly set this flag anymore in pass 1, and
         for now we only need it after pass 2 (I hope) (JM)
         for now we only need it after pass 2 (I hope) (JM)
@@ -1173,7 +1187,7 @@ unit cgcpu;
              ((abs(ref.offset) mod 4)<>0)
              ((abs(ref.offset) mod 4)<>0)
             )
             )
            ) or
            ) or
-           ((current_settings.cputype in cpu_thumb) and
+           ((GenerateThumbCode) and
             (((oppostfix in [PF_SB,PF_SH]) and (ref.offset<>0)) or
             (((oppostfix in [PF_SB,PF_SH]) and (ref.offset<>0)) or
              ((oppostfix=PF_None) and ((ref.offset<0) or ((ref.base<>NR_STACK_POINTER_REG) and (ref.offset>124)) or
              ((oppostfix=PF_None) and ((ref.offset<0) or ((ref.base<>NR_STACK_POINTER_REG) and (ref.offset>124)) or
                ((ref.base=NR_STACK_POINTER_REG) and (ref.offset>1020)) or ((ref.offset mod 4)<>0))) or
                ((ref.base=NR_STACK_POINTER_REG) and (ref.offset>1020)) or ((ref.offset mod 4)<>0))) or
@@ -1185,7 +1199,7 @@ unit cgcpu;
             fixref(list,ref);
             fixref(list,ref);
           end;
           end;
 
 
-        if current_settings.cputype in cpu_thumb then
+        if GenerateThumbCode then
           begin
           begin
             { certain thumb load require base and index }
             { certain thumb load require base and index }
             if (oppostfix in [PF_SB,PF_SH]) and
             if (oppostfix in [PF_SB,PF_SH]) and
@@ -1401,9 +1415,25 @@ unit cgcpu;
 
 
        procedure do_shift(shiftmode : tshiftmode; shiftimm : byte; reg : tregister);
        procedure do_shift(shiftmode : tshiftmode; shiftimm : byte; reg : tregister);
          begin
          begin
-           so.shiftmode:=shiftmode;
-           so.shiftimm:=shiftimm;
-           list.concat(taicpu.op_reg_reg_shifterop(A_MOV,reg2,reg,so));
+           if GenerateThumbCode then
+             begin
+               case shiftmode of
+                 SM_ASR:
+                   a_op_const_reg_reg(list,OP_SAR,OS_32,shiftimm,reg,reg2);
+                 SM_LSR:
+                   a_op_const_reg_reg(list,OP_SHR,OS_32,shiftimm,reg,reg2);
+                 SM_LSL:
+                   a_op_const_reg_reg(list,OP_SHL,OS_32,shiftimm,reg,reg2);
+                 else
+                   internalerror(2013090301);
+               end;
+             end
+           else
+             begin
+               so.shiftmode:=shiftmode;
+               so.shiftimm:=shiftimm;
+               list.concat(taicpu.op_reg_reg_shifterop(A_MOV,reg2,reg,so));
+             end;
          end;
          end;
 
 
        var
        var
@@ -1423,7 +1453,10 @@ unit cgcpu;
              if current_settings.cputype<cpu_armv6 then
              if current_settings.cputype<cpu_armv6 then
                case fromsize of
                case fromsize of
                  OS_8:
                  OS_8:
-                   list.concat(taicpu.op_reg_reg_const(A_AND,reg2,reg1,$ff));
+                   if GenerateThumbCode then
+                     a_op_const_reg_reg(list,OP_AND,OS_32,$ff,reg1,reg2)
+                   else
+                     list.concat(taicpu.op_reg_reg_const(A_AND,reg2,reg1,$ff));
                  OS_S8:
                  OS_S8:
                    begin
                    begin
                      do_shift(SM_LSL,24,reg1);
                      do_shift(SM_LSL,24,reg1);
@@ -1451,7 +1484,7 @@ unit cgcpu;
              else
              else
                case fromsize of
                case fromsize of
                  OS_8:
                  OS_8:
-                   if current_settings.cputype in cpu_thumb then
+                   if GenerateThumbCode then
                      list.concat(taicpu.op_reg_reg(A_UXTB,reg2,reg1))
                      list.concat(taicpu.op_reg_reg(A_UXTB,reg2,reg1))
                    else
                    else
                      list.concat(taicpu.op_reg_reg_const(A_AND,reg2,reg1,$ff));
                      list.concat(taicpu.op_reg_reg_const(A_AND,reg2,reg1,$ff));
@@ -1586,12 +1619,12 @@ unit cgcpu;
         b : byte;
         b : byte;
       begin
       begin
         a_reg_alloc(list,NR_DEFAULTFLAGS);
         a_reg_alloc(list,NR_DEFAULTFLAGS);
-        if (not(current_settings.cputype in cpu_thumb) and is_shifter_const(a,b)) or
-          ((current_settings.cputype in cpu_thumb) and is_thumb_imm(a)) then
+        if (not(GenerateThumbCode) and is_shifter_const(a,b)) or
+          ((GenerateThumbCode) and is_thumb_imm(a)) then
           list.concat(taicpu.op_reg_const(A_CMP,reg,a))
           list.concat(taicpu.op_reg_const(A_CMP,reg,a))
         { CMN reg,0 and CMN reg,$80000000 are different from CMP reg,$ffffffff
         { CMN reg,0 and CMN reg,$80000000 are different from CMP reg,$ffffffff
           and CMP reg,$7fffffff regarding the flags according to the ARM manual }
           and CMP reg,$7fffffff regarding the flags according to the ARM manual }
-        else if (a<>$7fffffff) and (a<>-1) and not(current_settings.cputype in cpu_thumb) and is_shifter_const(-a,b) then
+        else if (a<>$7fffffff) and (a<>-1) and not(GenerateThumbCode) and is_shifter_const(-a,b) then
           list.concat(taicpu.op_reg_const(A_CMN,reg,-a))
           list.concat(taicpu.op_reg_const(A_CMN,reg,-a))
         else
         else
           begin
           begin
@@ -1620,7 +1653,7 @@ unit cgcpu;
             list.Concat(taicpu.op_reg_reg(A_CLZ,dst,dst));
             list.Concat(taicpu.op_reg_reg(A_CLZ,dst,dst));
             a_reg_alloc(list,NR_DEFAULTFLAGS);
             a_reg_alloc(list,NR_DEFAULTFLAGS);
             list.Concat(taicpu.op_reg_const(A_CMP,dst,32));
             list.Concat(taicpu.op_reg_const(A_CMP,dst,32));
-            if current_settings.cputype in cpu_thumb2 then
+            if GenerateThumb2Code then
               list.Concat(taicpu.op_cond(A_IT, C_EQ));
               list.Concat(taicpu.op_cond(A_IT, C_EQ));
             list.Concat(setcondition(taicpu.op_reg_const(A_MOV,dst,$ff),C_EQ));
             list.Concat(setcondition(taicpu.op_reg_const(A_MOV,dst,$ff),C_EQ));
             a_reg_dealloc(list,NR_DEFAULTFLAGS);
             a_reg_dealloc(list,NR_DEFAULTFLAGS);
@@ -1642,7 +1675,7 @@ unit cgcpu;
         ai : taicpu;
         ai : taicpu;
       begin
       begin
         { generate far jump, leave it to the optimizer to get rid of it }
         { generate far jump, leave it to the optimizer to get rid of it }
-        if current_settings.cputype in cpu_thumb then
+        if GenerateThumbCode then
           ai:=taicpu.op_sym(A_BL,current_asmdata.RefAsmSymbol(s))
           ai:=taicpu.op_sym(A_BL,current_asmdata.RefAsmSymbol(s))
         else
         else
           ai:=taicpu.op_sym(A_B,current_asmdata.RefAsmSymbol(s));
           ai:=taicpu.op_sym(A_B,current_asmdata.RefAsmSymbol(s));
@@ -1656,7 +1689,7 @@ unit cgcpu;
         ai : taicpu;
         ai : taicpu;
       begin
       begin
         { generate far jump, leave it to the optimizer to get rid of it }
         { generate far jump, leave it to the optimizer to get rid of it }
-        if current_settings.cputype in cpu_thumb then
+        if GenerateThumbCode then
           ai:=taicpu.op_sym(A_BL,l)
           ai:=taicpu.op_sym(A_BL,l)
         else
         else
           ai:=taicpu.op_sym(A_B,l);
           ai:=taicpu.op_sym(A_B,l);
@@ -1671,7 +1704,7 @@ unit cgcpu;
         inv_flags : TResFlags;
         inv_flags : TResFlags;
         hlabel : TAsmLabel;
         hlabel : TAsmLabel;
       begin
       begin
-        if current_settings.cputype in cpu_thumb then
+        if GenerateThumbCode then
           begin
           begin
             inv_flags:=f;
             inv_flags:=f;
             inverse_flags(inv_flags);
             inverse_flags(inv_flags);
@@ -1715,6 +1748,7 @@ unit cgcpu;
         LocalSize:=align(LocalSize,4);
         LocalSize:=align(LocalSize,4);
         { call instruction does not put anything on the stack }
         { call instruction does not put anything on the stack }
         stackmisalignment:=0;
         stackmisalignment:=0;
+        tarmprocinfo(current_procinfo).stackpaddingreg:=High(TSuperRegister);
         if not(nostackframe) then
         if not(nostackframe) then
           begin
           begin
             firstfloatreg:=RS_NO;
             firstfloatreg:=RS_NO;
@@ -1773,6 +1807,18 @@ unit cgcpu;
                      for r:=RS_R0 to RS_R15 do
                      for r:=RS_R0 to RS_R15 do
                        if r in regs then
                        if r in regs then
                          inc(stackmisalignment,4);
                          inc(stackmisalignment,4);
+
+                     { if the stack is not 8 byte aligned, try to add an extra register,
+                       so we can avoid the extra sub/add ...,#4 later (KB) }
+                     if ((stackmisalignment mod current_settings.alignment.localalignmax) <> 0) then
+                       for r:=RS_R3 downto RS_R0 do
+                         if not(r in regs) then
+                           begin
+                             regs:=regs+[r];
+                             inc(stackmisalignment,4);
+                             tarmprocinfo(current_procinfo).stackpaddingreg:=r;
+                             break;
+                           end;
                      list.concat(setoppostfix(taicpu.op_ref_regset(A_STM,ref,R_INTREGISTER,R_SUBWHOLE,regs),PF_FD));
                      list.concat(setoppostfix(taicpu.op_ref_regset(A_STM,ref,R_INTREGISTER,R_SUBWHOLE,regs),PF_FD));
                    end;
                    end;
 
 
@@ -1921,6 +1967,7 @@ unit cgcpu;
          saveregs,
          saveregs,
          regs : tcpuregisterset;
          regs : tcpuregisterset;
          stackmisalignment: pint;
          stackmisalignment: pint;
+         paddingreg: TSuperRegister;
          mmpostfix: toppostfix;
          mmpostfix: toppostfix;
          imm1, imm2: DWord;
          imm1, imm2: DWord;
       begin
       begin
@@ -2004,7 +2051,7 @@ unit cgcpu;
                 end;
                 end;
               end;
               end;
 
 
-            regs:=rg[R_INTREGISTER].used_in_proc-paramanager.get_volatile_registers_int(pocall_stdcall)        ;
+            regs:=rg[R_INTREGISTER].used_in_proc-paramanager.get_volatile_registers_int(pocall_stdcall);
             if (pi_do_call in current_procinfo.flags) or
             if (pi_do_call in current_procinfo.flags) or
                (regs<>[]) or
                (regs<>[]) or
                ((target_info.system in systems_darwin) and
                ((target_info.system in systems_darwin) and
@@ -2043,6 +2090,18 @@ unit cgcpu;
             for r:=RS_R0 to RS_R15 do
             for r:=RS_R0 to RS_R15 do
               if r in regs then
               if r in regs then
                 inc(stackmisalignment,4);
                 inc(stackmisalignment,4);
+
+            { reapply the stack padding reg, in case there was one, see the complimentary
+              comment in g_proc_entry() (KB) }
+            paddingreg:=tarmprocinfo(current_procinfo).stackpaddingreg;
+            if paddingreg < RS_R4 then
+              if paddingreg in regs then
+                internalerror(201306190)
+              else
+                begin
+                  regs:=regs+[paddingreg];
+                  inc(stackmisalignment,4);
+                end;
             stackmisalignment:=stackmisalignment mod current_settings.alignment.localalignmax;
             stackmisalignment:=stackmisalignment mod current_settings.alignment.localalignmax;
             if (current_procinfo.framepointer=NR_STACK_POINTER_REG) or
             if (current_procinfo.framepointer=NR_STACK_POINTER_REG) or
                (target_info.system in systems_darwin) then
                (target_info.system in systems_darwin) then
@@ -2104,6 +2163,30 @@ unit cgcpu;
       end;
       end;
 
 
 
 
+    procedure tbasecgarm.g_maybe_got_init(list : TAsmList);
+      var
+        ref : treference;
+        l : TAsmLabel;
+      begin
+        if (cs_create_pic in current_settings.moduleswitches) and
+           (pi_needs_got in current_procinfo.flags) and
+           (tf_pic_uses_got in target_info.flags) then
+          begin
+            reference_reset(ref,4);
+            current_asmdata.getdatalabel(l);
+            cg.a_label(current_procinfo.aktlocaldata,l);
+            ref.symbol:=l;
+            ref.base:=NR_PC;
+            ref.symboldata:=current_procinfo.aktlocaldata.last;
+            list.concat(Taicpu.op_reg_ref(A_LDR,current_procinfo.got,ref));
+            current_asmdata.getaddrlabel(l);
+            current_procinfo.aktlocaldata.concat(tai_const.Create_rel_sym_offset(aitconst_32bit,l,current_asmdata.RefAsmSymbol('_GLOBAL_OFFSET_TABLE_'),-8));
+            cg.a_label(list,l);
+            list.concat(Taicpu.op_reg_reg_reg(A_ADD,current_procinfo.got,NR_PC,current_procinfo.got));
+          end;
+      end;
+
+
     procedure tbasecgarm.a_loadaddr_ref_reg(list : TAsmList;const ref : treference;r : tregister);
     procedure tbasecgarm.a_loadaddr_ref_reg(list : TAsmList;const ref : treference;r : tregister);
       var
       var
         b : byte;
         b : byte;
@@ -2164,9 +2247,9 @@ unit cgcpu;
 
 
     procedure tbasecgarm.fixref(list : TAsmList;var ref : treference);
     procedure tbasecgarm.fixref(list : TAsmList;var ref : treference);
       var
       var
-        tmpreg : tregister;
+        tmpreg, tmpreg2 : tregister;
         tmpref : treference;
         tmpref : treference;
-        l : tasmlabel;
+        l, piclabel : tasmlabel;
         indirection_done : boolean;
         indirection_done : boolean;
       begin
       begin
         { absolute symbols can't be handled directly, we've to store the symbol reference
         { absolute symbols can't be handled directly, we've to store the symbol reference
@@ -2184,6 +2267,7 @@ unit cgcpu;
         current_asmdata.getjumplabel(l);
         current_asmdata.getjumplabel(l);
         cg.a_label(current_procinfo.aktlocaldata,l);
         cg.a_label(current_procinfo.aktlocaldata,l);
         tmpref.symboldata:=current_procinfo.aktlocaldata.last;
         tmpref.symboldata:=current_procinfo.aktlocaldata.last;
+        piclabel:=nil;
 
 
         indirection_done:=false;
         indirection_done:=false;
         if assigned(ref.symbol) then
         if assigned(ref.symbol) then
@@ -2196,6 +2280,28 @@ unit cgcpu;
                   a_op_const_reg(list,OP_ADD,OS_ADDR,ref.offset,tmpreg);
                   a_op_const_reg(list,OP_ADD,OS_ADDR,ref.offset,tmpreg);
                 indirection_done:=true;
                 indirection_done:=true;
               end
               end
+            else if (cs_create_pic in current_settings.moduleswitches) then
+              if (tf_pic_uses_got in target_info.flags) then
+                current_procinfo.aktlocaldata.concat(tai_const.Create_type_sym_offset(aitconst_got,ref.symbol,ref.offset))
+              else
+                begin
+                  { ideally, we would want to generate
+
+                      ldr       r1, LPICConstPool
+                    LPICLocal:
+                      ldr/str   r2,[pc,r1]
+
+                    ...
+                      LPICConstPool:
+                        .long _globsym-(LPICLocal+8)
+
+                    However, we cannot be sure that the ldr/str will follow
+                    right after the call to fixref, so we have to load the
+                    complete address already in a register.
+                  }
+                  current_asmdata.getaddrlabel(piclabel);
+                  current_procinfo.aktlocaldata.concat(tai_const.Create_rel_sym_offset(aitconst_ptr,piclabel,ref.symbol,ref.offset-8));
+                end
             else
             else
               current_procinfo.aktlocaldata.concat(tai_const.create_sym_offset(ref.symbol,ref.offset))
               current_procinfo.aktlocaldata.concat(tai_const.create_sym_offset(ref.symbol,ref.offset))
           end
           end
@@ -2209,6 +2315,24 @@ unit cgcpu;
             tmpref.symbol:=l;
             tmpref.symbol:=l;
             tmpref.base:=NR_PC;
             tmpref.base:=NR_PC;
             list.concat(taicpu.op_reg_ref(A_LDR,tmpreg,tmpref));
             list.concat(taicpu.op_reg_ref(A_LDR,tmpreg,tmpref));
+
+            if (cs_create_pic in current_settings.moduleswitches) and
+               (tf_pic_uses_got in target_info.flags) and
+               assigned(ref.symbol) then
+              begin
+                reference_reset(tmpref,4);
+                tmpref.base:=current_procinfo.got;
+                tmpref.index:=tmpreg;
+                list.concat(taicpu.op_reg_ref(A_LDR,tmpreg,tmpref));
+              end;
+          end;
+
+        if assigned(piclabel) then
+          begin
+            cg.a_label(list,piclabel);
+            tmpreg2:=getaddressregister(list);
+            a_op_reg_reg_reg(list,OP_ADD,OS_ADDR,tmpreg,NR_PC,tmpreg2);
+            tmpreg:=tmpreg2
           end;
           end;
 
 
         { This routine can be called with PC as base/index in case the offset
         { This routine can be called with PC as base/index in case the offset
@@ -2440,7 +2564,7 @@ unit cgcpu;
       begin
       begin
         if len=0 then
         if len=0 then
           exit;
           exit;
-        if current_settings.cputype in cpu_thumb then
+        if GenerateThumbCode then
           maxtmpreg:=maxtmpreg_thumb
           maxtmpreg:=maxtmpreg_thumb
         else
         else
           maxtmpreg:=maxtmpreg_arm;
           maxtmpreg:=maxtmpreg_arm;
@@ -2573,7 +2697,7 @@ unit cgcpu;
                 {if aligned then
                 {if aligned then
                 genloop(len,4)
                 genloop(len,4)
                 else}
                 else}
-                if current_settings.cputype in cpu_thumb then
+                if GenerateThumbCode then
                   genloop_thumb(len,1)
                   genloop_thumb(len,1)
                 else
                 else
                   genloop(len,1);
                   genloop(len,1);
@@ -2667,7 +2791,7 @@ unit cgcpu;
         ai : taicpu;
         ai : taicpu;
         hlabel : TAsmLabel;
         hlabel : TAsmLabel;
       begin
       begin
-        if current_settings.cputype in cpu_thumb then
+        if GenerateThumbCode then
           begin
           begin
             { the optimizer has to fix this if jump range is sufficient short }
             { the optimizer has to fix this if jump range is sufficient short }
             current_asmdata.getjumplabel(hlabel);
             current_asmdata.getjumplabel(hlabel);
@@ -2952,7 +3076,7 @@ unit cgcpu;
           l : TAsmLabel;
           l : TAsmLabel;
         begin
         begin
           reference_reset_base(href,NR_R0,0,sizeof(pint));
           reference_reset_base(href,NR_R0,0,sizeof(pint));
-          if current_settings.cputype in cpu_thumb then
+          if GenerateThumbCode then
             begin
             begin
               if (href.offset in [0..124]) and ((href.offset mod 4)=0) then
               if (href.offset in [0..124]) and ((href.offset mod 4)=0) then
                 begin
                 begin
@@ -2994,7 +3118,7 @@ unit cgcpu;
         begin
         begin
           if (procdef.extnumber=$ffff) then
           if (procdef.extnumber=$ffff) then
             Internalerror(200006139);
             Internalerror(200006139);
-          if current_settings.cputype in cpu_thumb then
+          if GenerateThumbCode then
             begin
             begin
               reference_reset_base(href,NR_R0,tobjectdef(procdef.struct).vmtmethodoffset(procdef.extnumber),sizeof(pint));
               reference_reset_base(href,NR_R0,tobjectdef(procdef.struct).vmtmethodoffset(procdef.extnumber),sizeof(pint));
               if (href.offset in [0..124]) and ((href.offset mod 4)=0) then
               if (href.offset in [0..124]) and ((href.offset mod 4)=0) then
@@ -3073,7 +3197,7 @@ unit cgcpu;
             op_onr12methodaddr;
             op_onr12methodaddr;
           end
           end
         { case 0 }
         { case 0 }
-        else if current_settings.cputype in cpu_thumb then
+        else if GenerateThumbCode then
           begin
           begin
             { bl cannot be used here because it destroys lr }
             { bl cannot be used here because it destroys lr }
 
 
@@ -3115,47 +3239,27 @@ unit cgcpu;
       end;
       end;
 
 
 
 
-    function tbasecgarm.get_darwin_call_stub(const s: string; weak: boolean): tasmsymbol;
-      var
-        stubname: string;
-        l1: tasmsymbol;
-        href: treference;
-      begin
-        stubname := 'L'+s+'$stub';
-        result := current_asmdata.getasmsymbol(stubname);
-        if assigned(result) then
-          exit;
-
-        if current_asmdata.asmlists[al_imports]=nil then
-          current_asmdata.asmlists[al_imports]:=TAsmList.create;
-
-        new_section(current_asmdata.asmlists[al_imports],sec_stub,'',4);
-        result := current_asmdata.RefAsmSymbol(stubname);
-        current_asmdata.asmlists[al_imports].concat(Tai_symbol.Create(result,0));
-        { register as a weak symbol if necessary }
-        if weak then
-          current_asmdata.weakrefasmsymbol(s);
-        current_asmdata.asmlists[al_imports].concat(tai_directive.create(asd_indirect_symbol,s));
+    procedure tbasecgarm.safe_mla(list : TAsmList; op1,op2,op3,op4 : TRegister);
 
 
-        if not(cs_create_pic in current_settings.moduleswitches) then
-          begin
-            l1 := current_asmdata.RefAsmSymbol('L'+s+'$slp');
-            reference_reset_symbol(href,l1,0,sizeof(pint));
-            href.refaddr:=addr_full;
-            current_asmdata.asmlists[al_imports].concat(taicpu.op_reg_ref(A_LDR,NR_R12,href));
-            reference_reset_base(href,NR_R12,0,sizeof(pint));
-            current_asmdata.asmlists[al_imports].concat(taicpu.op_reg_ref(A_LDR,NR_R15,href));
-            current_asmdata.asmlists[al_imports].concat(Tai_symbol.Create(l1,0));
-            l1 := current_asmdata.RefAsmSymbol('L'+s+'$lazy_ptr');
-            current_asmdata.asmlists[al_imports].concat(tai_const.create_sym(l1));
-          end
-        else
-          internalerror(2008100401);
+      procedure checkreg(var reg : TRegister);
+        var
+          tmpreg : TRegister;
+        begin
+          if ((GenerateThumbCode or GenerateThumb2Code) and (getsupreg(reg)=RS_R13)) or
+            (getsupreg(reg)=RS_R15) then
+            begin
+              tmpreg:=getintregister(list,OS_INT);
+              a_load_reg_reg(list,OS_INT,OS_INT,reg,tmpreg);
+              reg:=tmpreg;
+            end;
+        end;
 
 
-        new_section(current_asmdata.asmlists[al_imports],sec_data_lazy,'',sizeof(pint));
-        current_asmdata.asmlists[al_imports].concat(Tai_symbol.Create(l1,0));
-        current_asmdata.asmlists[al_imports].concat(tai_directive.create(asd_indirect_symbol,s));
-        current_asmdata.asmlists[al_imports].concat(tai_const.createname('dyld_stub_binding_helper',0));
+      begin
+        checkreg(op1);
+        checkreg(op2);
+        checkreg(op3);
+        checkreg(op4);
+        list.concat(taicpu.op_reg_reg_reg_reg(A_MLA,op1,op2,op3,op4));
       end;
       end;
 
 
 
 
@@ -3572,12 +3676,14 @@ unit cgcpu;
          shift : byte;
          shift : byte;
          saveregs,
          saveregs,
          regs : tcpuregisterset;
          regs : tcpuregisterset;
+         registerarea : DWord;
          stackmisalignment: pint;
          stackmisalignment: pint;
          imm1, imm2: DWord;
          imm1, imm2: DWord;
+         stack_parameters : Boolean;
       begin
       begin
         if not(nostackframe) then
         if not(nostackframe) then
           begin
           begin
-            stackmisalignment:=0;
+            stack_parameters:=current_procinfo.procdef.stack_tainting_parameter(calleeside);
             regs:=rg[R_INTREGISTER].used_in_proc-paramanager.get_volatile_registers_int(pocall_stdcall);
             regs:=rg[R_INTREGISTER].used_in_proc-paramanager.get_volatile_registers_int(pocall_stdcall);
 
 
             include(regs,RS_R15);
             include(regs,RS_R15);
@@ -3585,12 +3691,19 @@ unit cgcpu;
             if current_procinfo.framepointer<>NR_STACK_POINTER_REG then
             if current_procinfo.framepointer<>NR_STACK_POINTER_REG then
               include(regs,getsupreg(current_procinfo.framepointer));
               include(regs,getsupreg(current_procinfo.framepointer));
 
 
+            registerarea:=0;
             for r:=RS_R0 to RS_R15 do
             for r:=RS_R0 to RS_R15 do
               if r in regs then
               if r in regs then
-                inc(stackmisalignment,4);
-            stackmisalignment:=stackmisalignment mod current_settings.alignment.localalignmax;
+                inc(registerarea,4);
+
+            stackmisalignment:=registerarea mod current_settings.alignment.localalignmax;
+
             LocalSize:=current_procinfo.calc_stackframe_size;
             LocalSize:=current_procinfo.calc_stackframe_size;
-            localsize:=align(localsize+stackmisalignment,current_settings.alignment.localalignmax)-stackmisalignment;
+            if stack_parameters then
+              localsize:=tarmprocinfo(current_procinfo).stackframesize-registerarea
+            else
+              localsize:=align(localsize+stackmisalignment,current_settings.alignment.localalignmax)-stackmisalignment;
+
             if (current_procinfo.framepointer=NR_STACK_POINTER_REG) or
             if (current_procinfo.framepointer=NR_STACK_POINTER_REG) or
                (target_info.system in systems_darwin) then
                (target_info.system in systems_darwin) then
               begin
               begin
@@ -3993,7 +4106,7 @@ unit cgcpu;
                 list.concat(taicpu.op_reg_reg_const(op_reg_reg_opcg2asmop[op],dst,dst,imm2));
                 list.concat(taicpu.op_reg_reg_const(op_reg_reg_opcg2asmop[op],dst,dst,imm2));
               end
               end
 {$endif DUMMY}
 {$endif DUMMY}
-            else if (op in [OP_SHL, OP_SHR, OP_SAR, OP_ROR]) then
+            else if (op in [OP_SHL, OP_SHR, OP_SAR]) then
               begin
               begin
                 list.concat(taicpu.op_reg_reg_const(op_reg_opcg2asmop[op],dst,dst,a));
                 list.concat(taicpu.op_reg_reg_const(op_reg_opcg2asmop[op],dst,dst,a));
               end
               end
@@ -4019,17 +4132,20 @@ unit cgcpu;
 
 
     procedure tthumbcgarm.g_flags2reg(list: TAsmList; size: TCgSize; const f: TResFlags; reg: TRegister);
     procedure tthumbcgarm.g_flags2reg(list: TAsmList; size: TCgSize; const f: TResFlags; reg: TRegister);
       var
       var
-        l : tasmlabel;
+        l1,l2 : tasmlabel;
         ai : taicpu;
         ai : taicpu;
       begin
       begin
-        current_asmdata.getjumplabel(l);
-        list.concat(taicpu.op_reg_const(A_MOV,reg,1));
-        ai:=setcondition(taicpu.op_sym(A_B,l),flags_to_cond(f));
+        current_asmdata.getjumplabel(l1);
+        current_asmdata.getjumplabel(l2);
+        ai:=setcondition(taicpu.op_sym(A_B,l1),flags_to_cond(f));
         ai.is_jmp:=true;
         ai.is_jmp:=true;
         list.concat(ai);
         list.concat(ai);
         list.concat(taicpu.op_reg_const(A_MOV,reg,0));
         list.concat(taicpu.op_reg_const(A_MOV,reg,0));
+        list.concat(taicpu.op_sym(A_B,l2));
+        cg.a_label(list,l1);
+        list.concat(taicpu.op_reg_const(A_MOV,reg,1));
         a_reg_dealloc(list,NR_DEFAULTFLAGS);
         a_reg_dealloc(list,NR_DEFAULTFLAGS);
-        cg.a_label(list,l);
+        cg.a_label(list,l2);
       end;
       end;
 
 
 
 
@@ -4430,7 +4546,7 @@ unit cgcpu;
             {else if (op = OP_AND) and is_shifter_const(not(dword(a)),shift) then
             {else if (op = OP_AND) and is_shifter_const(not(dword(a)),shift) then
               list.concat(taicpu.op_reg_reg_const(A_BIC,dst,src,not(dword(a))))}
               list.concat(taicpu.op_reg_reg_const(A_BIC,dst,src,not(dword(a))))}
             else if (op = OP_AND) and is_thumb32_imm(a) then
             else if (op = OP_AND) and is_thumb32_imm(a) then
-              list.concat(taicpu.op_reg_reg_const(A_MOV,dst,src,dword(a)))
+              list.concat(taicpu.op_reg_reg_const(A_AND,dst,src,dword(a)))
             else if (op = OP_AND) and (a = $FFFF) then
             else if (op = OP_AND) and (a = $FFFF) then
               list.concat(taicpu.op_reg_reg(A_UXTH,dst,src))
               list.concat(taicpu.op_reg_reg(A_UXTH,dst,src))
             else if (op = OP_AND) and is_thumb32_imm(not(dword(a))) then
             else if (op = OP_AND) and is_thumb32_imm(not(dword(a))) then
@@ -4543,6 +4659,24 @@ unit cgcpu;
              begin
              begin
                if cgsetflags or setflags then
                if cgsetflags or setflags then
                  a_reg_alloc(list,NR_DEFAULTFLAGS);
                  a_reg_alloc(list,NR_DEFAULTFLAGS);
+{$ifdef dummy}
+               { R13 is not allowed for certain instruction operands }
+               if op_reg_reg_opcg2asmopThumb2[op] in [A_ADD,A_SUB,A_AND,A_BIC,A_EOR] then
+                 begin
+                   if getsupreg(dst)=RS_R13 then
+                     begin
+                       tmpreg:=getintregister(list,OS_INT);
+                       a_load_reg_reg(list,OS_INT,OS_INT,dst,tmpreg);
+                       dst:=tmpreg;
+                     end;
+                   if getsupreg(src1)=RS_R13 then
+                     begin
+                       tmpreg:=getintregister(list,OS_INT);
+                       a_load_reg_reg(list,OS_INT,OS_INT,src1,tmpreg);
+                       src1:=tmpreg;
+                     end;
+                 end;
+{$endif}
                list.concat(setoppostfix(
                list.concat(setoppostfix(
                  taicpu.op_reg_reg_reg(op_reg_reg_opcg2asmopThumb2[op],dst,src2,src1),toppostfix(ord(cgsetflags or setflags)*ord(PF_S))));
                  taicpu.op_reg_reg_reg(op_reg_reg_opcg2asmopThumb2[op],dst,src2,src1),toppostfix(ord(cgsetflags or setflags)*ord(PF_S))));
              end;
              end;
@@ -5160,14 +5294,14 @@ unit cgcpu;
 
 
     procedure create_codegen;
     procedure create_codegen;
       begin
       begin
-        if current_settings.cputype in cpu_thumb2 then
+        if GenerateThumb2Code then
           begin
           begin
             cg:=tthumb2cgarm.create;
             cg:=tthumb2cgarm.create;
             cg64:=tthumb2cg64farm.create;
             cg64:=tthumb2cg64farm.create;
 
 
             casmoptimizer:=TCpuThumb2AsmOptimizer;
             casmoptimizer:=TCpuThumb2AsmOptimizer;
           end
           end
-        else if current_settings.cputype in cpu_thumb then
+        else if GenerateThumbCode then
           begin
           begin
             cg:=tthumbcgarm.create;
             cg:=tthumbcgarm.create;
             cg64:=tthumbcg64farm.create;
             cg64:=tthumbcg64farm.create;

+ 26 - 2
compiler/arm/cpubase.pas

@@ -374,6 +374,10 @@ unit cpubase;
     function IsIT(op: TAsmOp) : boolean;
     function IsIT(op: TAsmOp) : boolean;
     function GetITLevels(op: TAsmOp) : longint;
     function GetITLevels(op: TAsmOp) : longint;
 
 
+    function GenerateARMCode : boolean;
+    function GenerateThumbCode : boolean;
+    function GenerateThumb2Code : boolean;
+
   implementation
   implementation
 
 
     uses
     uses
@@ -526,7 +530,7 @@ unit cpubase;
       var
       var
          i : longint;
          i : longint;
       begin
       begin
-        if current_settings.cputype in cpu_thumb2 then
+        if GenerateThumb2Code then
           begin
           begin
             for i:=0 to 24 do
             for i:=0 to 24 do
               begin
               begin
@@ -616,7 +620,7 @@ unit cpubase;
       begin
       begin
         Result:=false;
         Result:=false;
         {Thumb2 is not supported (YET?)}
         {Thumb2 is not supported (YET?)}
-        if current_settings.cputype in cpu_thumb2 then exit;
+        if GenerateThumb2Code then exit;
         d:=DWord(value);
         d:=DWord(value);
         for i:=0 to 15 do
         for i:=0 to 15 do
           begin
           begin
@@ -707,4 +711,24 @@ unit cpubase;
         end;
         end;
       end;
       end;
 
 
+
+    function GenerateARMCode : boolean;
+      begin
+        Result:=current_settings.instructionset=is_arm;
+      end;
+
+
+    function GenerateThumbCode : boolean;
+      begin
+        Result:=(current_settings.instructionset=is_thumb) and not(CPUARM_HAS_THUMB2 in cpu_capabilities[current_settings.cputype]);
+      end;
+
+
+    function GenerateThumb2Code : boolean;
+      begin
+        Result:=(current_settings.instructionset=is_thumb) and (CPUARM_HAS_THUMB2 in cpu_capabilities[current_settings.cputype]);
+      end;
+
+
 end.
 end.
+

+ 12 - 11
compiler/arm/cpuinfo.pas

@@ -51,10 +51,7 @@ Type
        cpu_armv7em
        cpu_armv7em
       );
       );
 
 
-Const
-   cpu_arm = [cpu_none,cpu_armv3,cpu_armv4,cpu_armv4t,cpu_armv5];
-   cpu_thumb = [cpu_armv6m];
-   cpu_thumb2 = [cpu_armv7m,cpu_armv7em];
+   tinstructionset = (is_thumb,is_arm);
 
 
 Type
 Type
    tfputype =
    tfputype =
@@ -665,7 +662,8 @@ Const
        CPUARM_HAS_RBIT,       { CPU supports the RBIT instruction                         }
        CPUARM_HAS_RBIT,       { CPU supports the RBIT instruction                         }
        CPUARM_HAS_DMB,        { CPU has memory barrier instructions (DMB, DSB, ISB)       }
        CPUARM_HAS_DMB,        { CPU has memory barrier instructions (DMB, DSB, ISB)       }
        CPUARM_HAS_LDREX,
        CPUARM_HAS_LDREX,
-       CPUARM_HAS_IDIV
+       CPUARM_HAS_IDIV,
+       CPUARM_HAS_THUMB2
       );
       );
 
 
  const
  const
@@ -680,17 +678,20 @@ Const
        { cpu_armv5tej } [CPUARM_HAS_BX,CPUARM_HAS_BLX,CPUARM_HAS_BLX_LABEL,CPUARM_HAS_CLZ,CPUARM_HAS_EDSP],
        { cpu_armv5tej } [CPUARM_HAS_BX,CPUARM_HAS_BLX,CPUARM_HAS_BLX_LABEL,CPUARM_HAS_CLZ,CPUARM_HAS_EDSP],
        { cpu_armv6    } [CPUARM_HAS_BX,CPUARM_HAS_BLX,CPUARM_HAS_BLX_LABEL,CPUARM_HAS_CLZ,CPUARM_HAS_EDSP,CPUARM_HAS_REV,CPUARM_HAS_LDREX],
        { cpu_armv6    } [CPUARM_HAS_BX,CPUARM_HAS_BLX,CPUARM_HAS_BLX_LABEL,CPUARM_HAS_CLZ,CPUARM_HAS_EDSP,CPUARM_HAS_REV,CPUARM_HAS_LDREX],
        { cpu_armv6k   } [CPUARM_HAS_BX,CPUARM_HAS_BLX,CPUARM_HAS_BLX_LABEL,CPUARM_HAS_CLZ,CPUARM_HAS_EDSP,CPUARM_HAS_REV,CPUARM_HAS_LDREX],
        { cpu_armv6k   } [CPUARM_HAS_BX,CPUARM_HAS_BLX,CPUARM_HAS_BLX_LABEL,CPUARM_HAS_CLZ,CPUARM_HAS_EDSP,CPUARM_HAS_REV,CPUARM_HAS_LDREX],
-       { cpu_armv6t2  } [CPUARM_HAS_BX,CPUARM_HAS_BLX,CPUARM_HAS_BLX_LABEL,CPUARM_HAS_CLZ,CPUARM_HAS_EDSP,CPUARM_HAS_REV,CPUARM_HAS_RBIT,CPUARM_HAS_LDREX],
+       { cpu_armv6t2  } [CPUARM_HAS_BX,CPUARM_HAS_BLX,CPUARM_HAS_BLX_LABEL,CPUARM_HAS_CLZ,CPUARM_HAS_EDSP,CPUARM_HAS_REV,CPUARM_HAS_RBIT,CPUARM_HAS_LDREX,CPUARM_HAS_THUMB2],
        { cpu_armv6z   } [CPUARM_HAS_BX,CPUARM_HAS_BLX,CPUARM_HAS_BLX_LABEL,CPUARM_HAS_CLZ,CPUARM_HAS_EDSP,CPUARM_HAS_REV,CPUARM_HAS_LDREX],
        { cpu_armv6z   } [CPUARM_HAS_BX,CPUARM_HAS_BLX,CPUARM_HAS_BLX_LABEL,CPUARM_HAS_CLZ,CPUARM_HAS_EDSP,CPUARM_HAS_REV,CPUARM_HAS_LDREX],
        { cpu_armv6m   } [CPUARM_HAS_BX,CPUARM_HAS_BLX,CPUARM_HAS_REV],
        { cpu_armv6m   } [CPUARM_HAS_BX,CPUARM_HAS_BLX,CPUARM_HAS_REV],
        { the identifier armv7 is should not be used, it is considered being equal to armv7a }
        { the identifier armv7 is should not be used, it is considered being equal to armv7a }
-       { cpu_armv7    } [CPUARM_HAS_BX,CPUARM_HAS_BLX,CPUARM_HAS_BLX_LABEL,CPUARM_HAS_CLZ,CPUARM_HAS_EDSP,CPUARM_HAS_REV,CPUARM_HAS_RBIT,CPUARM_HAS_LDREX,CPUARM_HAS_DMB],
-       { cpu_armv7a   } [CPUARM_HAS_BX,CPUARM_HAS_BLX,CPUARM_HAS_BLX_LABEL,CPUARM_HAS_CLZ,CPUARM_HAS_EDSP,CPUARM_HAS_REV,CPUARM_HAS_RBIT,CPUARM_HAS_LDREX,CPUARM_HAS_DMB],
-       { cpu_armv7r   } [CPUARM_HAS_BX,CPUARM_HAS_BLX,CPUARM_HAS_BLX_LABEL,CPUARM_HAS_CLZ,CPUARM_HAS_EDSP,CPUARM_HAS_REV,CPUARM_HAS_RBIT,CPUARM_HAS_LDREX,CPUARM_HAS_DMB],
-       { cpu_armv7m   } [CPUARM_HAS_BX,CPUARM_HAS_BLX,CPUARM_HAS_CLZ,CPUARM_HAS_EDSP,CPUARM_HAS_REV,CPUARM_HAS_RBIT,CPUARM_HAS_LDREX,CPUARM_HAS_IDIV,CPUARM_HAS_DMB],
-       { cpu_armv7em  } [CPUARM_HAS_BX,CPUARM_HAS_BLX,CPUARM_HAS_CLZ,CPUARM_HAS_EDSP,CPUARM_HAS_REV,CPUARM_HAS_RBIT,CPUARM_HAS_LDREX,CPUARM_HAS_IDIV,CPUARM_HAS_DMB]
+       { cpu_armv7    } [CPUARM_HAS_BX,CPUARM_HAS_BLX,CPUARM_HAS_BLX_LABEL,CPUARM_HAS_CLZ,CPUARM_HAS_EDSP,CPUARM_HAS_REV,CPUARM_HAS_RBIT,CPUARM_HAS_LDREX,CPUARM_HAS_DMB,CPUARM_HAS_THUMB2],
+       { cpu_armv7a   } [CPUARM_HAS_BX,CPUARM_HAS_BLX,CPUARM_HAS_BLX_LABEL,CPUARM_HAS_CLZ,CPUARM_HAS_EDSP,CPUARM_HAS_REV,CPUARM_HAS_RBIT,CPUARM_HAS_LDREX,CPUARM_HAS_DMB,CPUARM_HAS_THUMB2],
+       { cpu_armv7r   } [CPUARM_HAS_BX,CPUARM_HAS_BLX,CPUARM_HAS_BLX_LABEL,CPUARM_HAS_CLZ,CPUARM_HAS_EDSP,CPUARM_HAS_REV,CPUARM_HAS_RBIT,CPUARM_HAS_LDREX,CPUARM_HAS_DMB,CPUARM_HAS_THUMB2],
+       { cpu_armv7m   } [CPUARM_HAS_BX,CPUARM_HAS_BLX,CPUARM_HAS_CLZ,CPUARM_HAS_EDSP,CPUARM_HAS_REV,CPUARM_HAS_RBIT,CPUARM_HAS_LDREX,CPUARM_HAS_IDIV,CPUARM_HAS_DMB,CPUARM_HAS_THUMB2],
+       { cpu_armv7em  } [CPUARM_HAS_BX,CPUARM_HAS_BLX,CPUARM_HAS_CLZ,CPUARM_HAS_EDSP,CPUARM_HAS_REV,CPUARM_HAS_RBIT,CPUARM_HAS_LDREX,CPUARM_HAS_IDIV,CPUARM_HAS_DMB,CPUARM_HAS_THUMB2]
      );
      );
 
 
+   { contains all CPU supporting any kind of thumb instruction set }
+   cpu_has_thumb = [cpu_armv4t,cpu_armv5t,cpu_armv5te,cpu_armv5tej,cpu_armv6t2,cpu_armv6z,cpu_armv6m,cpu_armv7a,cpu_armv7r,cpu_armv7m,cpu_armv7em];
+
 Implementation
 Implementation
 
 
 end.
 end.

+ 2 - 2
compiler/arm/cpupara.pas

@@ -298,7 +298,7 @@ unit cpupara;
         curfloatreg:=RS_F0;
         curfloatreg:=RS_F0;
         curmmreg:=RS_D0;
         curmmreg:=RS_D0;
 
 
-        if (current_settings.cputype in cpu_thumb) and (side=calleeside) then
+        if GenerateThumbCode and (side=calleeside) then
           cur_stack_offset:=(p as tprocdef).total_stackframe_size
           cur_stack_offset:=(p as tprocdef).total_stackframe_size
         else
         else
           cur_stack_offset:=0;
           cur_stack_offset:=0;
@@ -581,7 +581,7 @@ unit cpupara;
                    begin
                    begin
                      if paraloc^.loc=LOC_REFERENCE then
                      if paraloc^.loc=LOC_REFERENCE then
                        begin
                        begin
-                         if current_settings.cputype in cpu_thumb then
+                         if GenerateThumbCode then
                            begin
                            begin
                              paraloc^.reference.index:=NR_STACK_POINTER_REG;
                              paraloc^.reference.index:=NR_STACK_POINTER_REG;
                            end
                            end

+ 16 - 5
compiler/arm/cpupi.pas

@@ -29,7 +29,8 @@ unit cpupi;
 
 
     uses
     uses
        globtype,cutils,
        globtype,cutils,
-       procinfo,cpuinfo,psub;
+       procinfo,cpuinfo,psub,cgbase,
+       aasmdata;
 
 
     type
     type
        tarmprocinfo = class(tcgprocinfo)
        tarmprocinfo = class(tcgprocinfo)
@@ -39,12 +40,14 @@ unit cpupi;
             if this size is too little the procedure must be compiled again with a larger value }
             if this size is too little the procedure must be compiled again with a larger value }
           stackframesize,
           stackframesize,
           floatregstart : aint;
           floatregstart : aint;
+          stackpaddingreg: TSuperRegister;
           // procedure handle_body_start;override;
           // procedure handle_body_start;override;
           // procedure after_pass1;override;
           // procedure after_pass1;override;
           procedure set_first_temp_offset;override;
           procedure set_first_temp_offset;override;
           function calc_stackframe_size:longint;override;
           function calc_stackframe_size:longint;override;
           procedure init_framepointer; override;
           procedure init_framepointer; override;
           procedure generate_parameter_info;override;
           procedure generate_parameter_info;override;
+          procedure allocate_got_register(list : TAsmList);override;
        end;
        end;
 
 
 
 
@@ -55,7 +58,7 @@ unit cpupi;
        cpubase,
        cpubase,
        tgobj,
        tgobj,
        symconst,symtype,symsym,paramgr,
        symconst,symtype,symsym,paramgr,
-       cgbase,cgutils,
+       cgutils,
        cgobj,
        cgobj,
        defutil;
        defutil;
 
 
@@ -96,7 +99,7 @@ unit cpupi;
           tg.setfirsttemp(maxpushedparasize);
           tg.setfirsttemp(maxpushedparasize);
 
 
         { estimate stack frame size }
         { estimate stack frame size }
-        if current_settings.cputype in cpu_thumb then
+        if GenerateThumbCode then
           begin
           begin
             stackframesize:=maxpushedparasize+32;
             stackframesize:=maxpushedparasize+32;
             localsize:=0;
             localsize:=0;
@@ -138,7 +141,7 @@ unit cpupi;
          floatsavesize : aword;
          floatsavesize : aword;
          regs: tcpuregisterset;
          regs: tcpuregisterset;
       begin
       begin
-        if current_settings.cputype in cpu_thumb then
+        if GenerateThumbCode then
           result:=stackframesize
           result:=stackframesize
         else
         else
           begin
           begin
@@ -192,7 +195,7 @@ unit cpupi;
 
 
     procedure tarmprocinfo.init_framepointer;
     procedure tarmprocinfo.init_framepointer;
       begin
       begin
-        if (target_info.system in systems_darwin) or (current_settings.cputype in cpu_thumb) then
+        if (target_info.system in systems_darwin) or GenerateThumbCode then
           begin
           begin
             RS_FRAME_POINTER_REG:=RS_R7;
             RS_FRAME_POINTER_REG:=RS_R7;
             NR_FRAME_POINTER_REG:=NR_R7;
             NR_FRAME_POINTER_REG:=NR_R7;
@@ -212,6 +215,14 @@ unit cpupi;
       end;
       end;
 
 
 
 
+    procedure tarmprocinfo.allocate_got_register(list: TAsmList);
+      begin
+        { darwin doesn't use a got }
+        if tf_pic_uses_got in target_info.flags then
+          got := cg.getaddressregister(list);
+      end;
+
+
 begin
 begin
    cprocinfo:=tarmprocinfo;
    cprocinfo:=tarmprocinfo;
 end.
 end.

+ 10 - 23
compiler/arm/narmadd.pas

@@ -53,7 +53,7 @@ interface
       defutil,htypechk,cgbase,cgutils,
       defutil,htypechk,cgbase,cgutils,
       cpuinfo,pass_1,pass_2,procinfo,
       cpuinfo,pass_1,pass_2,procinfo,
       ncon,nadd,ncnv,ncal,nmat,
       ncon,nadd,ncnv,ncal,nmat,
-      ncgutil,cgobj,
+      ncgutil,cgobj,cgcpu,
       hlcgobj
       hlcgobj
       ;
       ;
 
 
@@ -332,7 +332,7 @@ interface
         (* Try to keep right as a constant *)
         (* Try to keep right as a constant *)
         if (right.location.loc <> LOC_CONSTANT) or
         if (right.location.loc <> LOC_CONSTANT) or
           not(is_shifter_const(right.location.value, b)) or
           not(is_shifter_const(right.location.value, b)) or
-          ((current_settings.cputype in cpu_thumb) and not(is_thumb_imm(right.location.value))) then
+          ((GenerateThumbCode) and not(is_thumb_imm(right.location.value))) then
           hlcg.location_force_reg(current_asmdata.CurrAsmList,right.location,right.resultdef,right.resultdef,true);
           hlcg.location_force_reg(current_asmdata.CurrAsmList,right.location,right.resultdef,right.resultdef,true);
         hlcg.location_force_reg(current_asmdata.CurrAsmList,left.location,left.resultdef,left.resultdef,true);
         hlcg.location_force_reg(current_asmdata.CurrAsmList,left.location,left.resultdef,left.resultdef,true);
 
 
@@ -386,22 +386,9 @@ interface
 
 
         pass_left_right;
         pass_left_right;
 
 
+        { pass_left_right moves possible consts to the right, the only
+          remaining case with left consts (currency) can take this path too (KB) }
         if (nodetype in [equaln,unequaln]) and
         if (nodetype in [equaln,unequaln]) and
-          (left.nodetype=ordconstn) and (tordconstnode(left).value=0) then
-          begin
-            location_reset(location,LOC_FLAGS,OS_NO);
-            location.resflags:=getresflags(unsigned);
-            if not(right.location.loc in [LOC_CREGISTER,LOC_REGISTER]) then
-              hlcg.location_force_reg(current_asmdata.CurrAsmList,right.location,right.resultdef,right.resultdef,true);
-            dummyreg:=cg.getintregister(current_asmdata.CurrAsmList,location.size);
-            cg.a_reg_alloc(current_asmdata.CurrAsmList,NR_DEFAULTFLAGS);
-
-            if current_settings.cputype in cpu_thumb then
-              cg.a_op_reg_reg_reg(current_asmdata.CurrAsmList,OP_OR,OS_32,right.location.register64.reglo,right.location.register64.reghi,dummyreg)
-            else
-              current_asmdata.CurrAsmList.concat(setoppostfix(taicpu.op_reg_reg_reg(A_ORR,dummyreg,right.location.register64.reglo,right.location.register64.reghi),PF_S));
-          end
-        else if (nodetype in [equaln,unequaln]) and
           (right.nodetype=ordconstn) and (tordconstnode(right).value=0) then
           (right.nodetype=ordconstn) and (tordconstnode(right).value=0) then
           begin
           begin
             location_reset(location,LOC_FLAGS,OS_NO);
             location_reset(location,LOC_FLAGS,OS_NO);
@@ -411,7 +398,7 @@ interface
             dummyreg:=cg.getintregister(current_asmdata.CurrAsmList,location.size);
             dummyreg:=cg.getintregister(current_asmdata.CurrAsmList,location.size);
             cg.a_reg_alloc(current_asmdata.CurrAsmList,NR_DEFAULTFLAGS);
             cg.a_reg_alloc(current_asmdata.CurrAsmList,NR_DEFAULTFLAGS);
 
 
-            if current_settings.cputype in cpu_thumb then
+            if GenerateThumbCode then
               cg.a_op_reg_reg_reg(current_asmdata.CurrAsmList,OP_OR,OS_32,left.location.register64.reglo,left.location.register64.reghi,dummyreg)
               cg.a_op_reg_reg_reg(current_asmdata.CurrAsmList,OP_OR,OS_32,left.location.register64.reglo,left.location.register64.reghi,dummyreg)
             else
             else
               current_asmdata.CurrAsmList.concat(setoppostfix(taicpu.op_reg_reg_reg(A_ORR,dummyreg,left.location.register64.reglo,left.location.register64.reghi),PF_S));
               current_asmdata.CurrAsmList.concat(setoppostfix(taicpu.op_reg_reg_reg(A_ORR,dummyreg,left.location.register64.reglo,left.location.register64.reghi),PF_S));
@@ -428,7 +415,7 @@ interface
                 location.resflags:=getresflags(unsigned);
                 location.resflags:=getresflags(unsigned);
                 cg.a_reg_alloc(current_asmdata.CurrAsmList,NR_DEFAULTFLAGS);
                 cg.a_reg_alloc(current_asmdata.CurrAsmList,NR_DEFAULTFLAGS);
                 current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg(A_CMP,left.location.register64.reghi,right.location.register64.reghi));
                 current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg(A_CMP,left.location.register64.reghi,right.location.register64.reghi));
-                if current_settings.cputype in (cpu_thumb+cpu_thumb2) then
+                if GenerateThumbCode or GenerateThumb2Code then
                   begin
                   begin
                     current_asmdata.getjumplabel(l);
                     current_asmdata.getjumplabel(l);
                     cg.a_jmp_flags(current_asmdata.CurrAsmList,F_NE,l);
                     cg.a_jmp_flags(current_asmdata.CurrAsmList,F_NE,l);
@@ -509,7 +496,7 @@ interface
             tmpreg := cg.getintregister(current_asmdata.CurrAsmList,OS_32);
             tmpreg := cg.getintregister(current_asmdata.CurrAsmList,OS_32);
             asmList.concat(taicpu.op_reg_reg_reg(A_MUL,tmpreg,ll.reglo,rl.reghi));
             asmList.concat(taicpu.op_reg_reg_reg(A_MUL,tmpreg,ll.reglo,rl.reghi));
             asmList.concat(taicpu.op_reg_reg_reg_reg(A_UMULL,res.reglo,res.reghi,rl.reglo,ll.reglo));
             asmList.concat(taicpu.op_reg_reg_reg_reg(A_UMULL,res.reglo,res.reghi,rl.reglo,ll.reglo));
-            asmList.concat(taicpu.op_reg_reg_reg_reg(A_MLA,tmpreg,rl.reglo,ll.reghi,tmpreg));
+            tbasecgarm(cg).safe_mla(asmList,tmpreg,rl.reglo,ll.reghi,tmpreg);
             asmList.concat(taicpu.op_reg_reg_reg(A_ADD,res.reghi,tmpreg,res.reghi));
             asmList.concat(taicpu.op_reg_reg_reg(A_ADD,res.reghi,tmpreg,res.reghi));
           end
           end
         else
         else
@@ -524,7 +511,7 @@ interface
         if (not(cs_check_overflow in current_settings.localswitches)) and
         if (not(cs_check_overflow in current_settings.localswitches)) and
            (nodetype in [muln]) and
            (nodetype in [muln]) and
            (is_64bitint(left.resultdef)) and
            (is_64bitint(left.resultdef)) and
-           (not (current_settings.cputype in cpu_thumb)) then
+           (not (GenerateThumbCode)) then
           begin
           begin
             result := nil;
             result := nil;
             firstpass(left);
             firstpass(left);
@@ -639,8 +626,8 @@ interface
         cg.a_reg_alloc(current_asmdata.CurrAsmList,NR_DEFAULTFLAGS);
         cg.a_reg_alloc(current_asmdata.CurrAsmList,NR_DEFAULTFLAGS);
         if right.location.loc = LOC_CONSTANT then
         if right.location.loc = LOC_CONSTANT then
           begin
           begin
-             if (not(current_settings.cputype in cpu_thumb) and is_shifter_const(right.location.value,b)) or
-                ((current_settings.cputype in cpu_thumb) and is_thumb_imm(right.location.value)) then
+             if (not(GenerateThumbCode) and is_shifter_const(right.location.value,b)) or
+                ((GenerateThumbCode) and is_thumb_imm(right.location.value)) then
                current_asmdata.CurrAsmList.concat(taicpu.op_reg_const(A_CMP,left.location.register,right.location.value))
                current_asmdata.CurrAsmList.concat(taicpu.op_reg_const(A_CMP,left.location.register,right.location.value))
              else
              else
                begin
                begin

+ 1 - 1
compiler/arm/narminl.pas

@@ -342,7 +342,7 @@ implementation
         ref : treference;
         ref : treference;
         r : tregister;
         r : tregister;
       begin
       begin
-        if CPUARM_HAS_EDSP in cpu_capabilities[current_settings.cputype] then
+        if not(GenerateThumbCode) and (CPUARM_HAS_EDSP in cpu_capabilities[current_settings.cputype]) then
           begin
           begin
             secondpass(left);
             secondpass(left);
             case left.location.loc of
             case left.location.loc of

+ 13 - 7
compiler/arm/narmmat.pas

@@ -91,13 +91,14 @@ implementation
               ispowerof2(tordconstnode(right).value,power) and
               ispowerof2(tordconstnode(right).value,power) and
               (tordconstnode(right).value<=256) and
               (tordconstnode(right).value<=256) and
               (tordconstnode(right).value>0) then
               (tordconstnode(right).value>0) then
-              result:=caddnode.create(andn,left,cordconstnode.create(tordconstnode(right).value-1,sinttype,false))
+              result:=caddnode.create_internal(andn,left,cordconstnode.create(tordconstnode(right).value-1,sinttype,false))
             else
             else
               begin
               begin
-                result:=caddnode.create(subn,left,caddnode.create(muln,right.getcopy, cmoddivnode.Create(divn,left.getcopy,right.getcopy)));
+                result:=caddnode.create_internal(subn,left,caddnode.create_internal(muln,right,cmoddivnode.Create(divn,left.getcopy,right.getcopy)));
                 right:=nil;
                 right:=nil;
               end;
               end;
             left:=nil;
             left:=nil;
+            firstpass(result);
           end
           end
         else if (nodetype=modn) and
         else if (nodetype=modn) and
           (is_signed(left.resultdef)) and
           (is_signed(left.resultdef)) and
@@ -105,13 +106,18 @@ implementation
           (tordconstnode(right).value=2) then
           (tordconstnode(right).value=2) then
           begin
           begin
             // result:=(0-(left and 1)) and (1+(sarlongint(left,31) shl 1))
             // result:=(0-(left and 1)) and (1+(sarlongint(left,31) shl 1))
-            result:=caddnode.create(andn,caddnode.create(subn,cordconstnode.create(0,sinttype,false),caddnode.create(andn,left,cordconstnode.create(1,sinttype,false))),
-                                         caddnode.create(addn,cordconstnode.create(1,sinttype,false),
+            result:=caddnode.create_internal(andn,caddnode.create_internal(subn,cordconstnode.create(0,sinttype,false),caddnode.create_internal(andn,left,cordconstnode.create(1,sinttype,false))),
+                                         caddnode.create_internal(addn,cordconstnode.create(1,sinttype,false),
                                                               cshlshrnode.create(shln,cinlinenode.create(in_sar_x_y,false,ccallparanode.create(cordconstnode.create(31,sinttype,false),ccallparanode.Create(left.getcopy,nil))),cordconstnode.create(1,sinttype,false))));
                                                               cshlshrnode.create(shln,cinlinenode.create(in_sar_x_y,false,ccallparanode.create(cordconstnode.create(31,sinttype,false),ccallparanode.Create(left.getcopy,nil))),cordconstnode.create(1,sinttype,false))));
             left:=nil;
             left:=nil;
+            firstpass(result);
           end
           end
         else
         else
           result:=inherited first_moddivint;
           result:=inherited first_moddivint;
+
+        { we may not change the result type here }
+        if assigned(result) and (torddef(result.resultdef).ordtype<>torddef(resultdef).ordtype) then
+          inserttypeconv(result,resultdef);
       end;
       end;
 
 
 
 
@@ -150,7 +156,7 @@ implementation
                       cg.a_load_reg_reg(current_asmdata.CurrAsmList,OS_INT,OS_INT,numerator,helper1)
                       cg.a_load_reg_reg(current_asmdata.CurrAsmList,OS_INT,OS_INT,numerator,helper1)
                     else
                     else
                       cg.a_op_const_reg_reg(current_asmdata.CurrAsmList,OP_SAR,OS_INT,31,numerator,helper1);
                       cg.a_op_const_reg_reg(current_asmdata.CurrAsmList,OP_SAR,OS_INT,31,numerator,helper1);
-                    if current_settings.cputype in cpu_thumb then
+                    if GenerateThumbCode then
                       begin
                       begin
                         cg.a_op_const_reg(current_asmdata.CurrAsmList,OP_SAR,OS_INT,32-power,helper1);
                         cg.a_op_const_reg(current_asmdata.CurrAsmList,OP_SAR,OS_INT,32-power,helper1);
                         current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg_reg(A_ADD,helper2,numerator,helper1));
                         current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg_reg(A_ADD,helper2,numerator,helper1));
@@ -431,7 +437,7 @@ implementation
 
 
     function tarmshlshrnode.first_shlshr64bitint: tnode;
     function tarmshlshrnode.first_shlshr64bitint: tnode;
       begin
       begin
-        if (current_settings.cputype in cpu_thumb+cpu_thumb2) then
+        if GenerateThumbCode or GenerateThumb2Code then
           result:=inherited
           result:=inherited
         else
         else
           result := nil;
           result := nil;
@@ -506,7 +512,7 @@ implementation
         end;
         end;
 
 
       begin
       begin
-        if (current_settings.cputype in cpu_thumb+cpu_thumb2) then
+        if GenerateThumbCode or GenerateThumb2Code then
         begin
         begin
           inherited;
           inherited;
           exit;
           exit;

+ 5 - 5
compiler/arm/narmmem.pas

@@ -42,7 +42,7 @@ interface
 implementation
 implementation
 
 
     uses
     uses
-      cutils,verbose,globals,aasmdata,aasmcpu,cgobj,
+      cutils,verbose,globals,aasmdata,aasmcpu,cgobj,cgcpu,
       cpuinfo,
       cpuinfo,
       cgutils,
       cgutils,
       procinfo;
       procinfo;
@@ -54,7 +54,7 @@ implementation
     procedure tarmloadparentfpnode.pass_generate_code;
     procedure tarmloadparentfpnode.pass_generate_code;
       begin
       begin
         { normally, we cannot use the stack pointer as normal register on arm thumb }
         { normally, we cannot use the stack pointer as normal register on arm thumb }
-        if (current_settings.cputype in cpu_thumb) and
+        if (GenerateThumbCode) and
           (getsupreg(current_procinfo.framepointer) in [RS_R8..RS_R15]) and
           (getsupreg(current_procinfo.framepointer) in [RS_R8..RS_R15]) and
           (current_procinfo.procdef.parast.symtablelevel=parentpd.parast.symtablelevel) then
           (current_procinfo.procdef.parast.symtablelevel=parentpd.parast.symtablelevel) then
           begin
           begin
@@ -76,7 +76,7 @@ implementation
          hl : longint;
          hl : longint;
        begin
        begin
          if ((location.reference.base=NR_NO) and (location.reference.index=NR_NO)) or
          if ((location.reference.base=NR_NO) and (location.reference.index=NR_NO)) or
-            (current_settings.cputype in cpu_thumb) or
+            (GenerateThumbCode) or
             { simple constant? }
             { simple constant? }
             (l=1) or ispowerof2(l,hl) or ispowerof2(l+1,hl) or ispowerof2(l-1,hl) then
             (l=1) or ispowerof2(l,hl) or ispowerof2(l+1,hl) or ispowerof2(l-1,hl) then
            inherited update_reference_reg_mul(maybe_const_reg,l)
            inherited update_reference_reg_mul(maybe_const_reg,l)
@@ -84,7 +84,7 @@ implementation
            begin
            begin
              hreg:=cg.getaddressregister(current_asmdata.CurrAsmList);
              hreg:=cg.getaddressregister(current_asmdata.CurrAsmList);
              cg.a_load_const_reg(current_asmdata.CurrAsmList,OS_ADDR,l,hreg);
              cg.a_load_const_reg(current_asmdata.CurrAsmList,OS_ADDR,l,hreg);
-             current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg_reg_reg(A_MLA,hreg,maybe_const_reg,hreg,location.reference.base));
+             tbasecgarm(cg).safe_mla(current_asmdata.CurrAsmList,hreg,maybe_const_reg,hreg,location.reference.base);
              location.reference.base:=hreg;
              location.reference.base:=hreg;
              { update alignment }
              { update alignment }
              if (location.reference.alignment=0) then
              if (location.reference.alignment=0) then
@@ -95,7 +95,7 @@ implementation
            begin
            begin
              hreg:=cg.getaddressregister(current_asmdata.CurrAsmList);
              hreg:=cg.getaddressregister(current_asmdata.CurrAsmList);
              cg.a_load_const_reg(current_asmdata.CurrAsmList,OS_ADDR,l,hreg);
              cg.a_load_const_reg(current_asmdata.CurrAsmList,OS_ADDR,l,hreg);
-             current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg_reg_reg(A_MLA,hreg,maybe_const_reg,hreg,location.reference.index));
+             tbasecgarm(cg).safe_mla(current_asmdata.CurrAsmList,hreg,maybe_const_reg,hreg,location.reference.index);
              location.reference.base:=hreg;
              location.reference.base:=hreg;
              location.reference.index:=NR_NO;
              location.reference.index:=NR_NO;
              { update alignment }
              { update alignment }

+ 32 - 9
compiler/arm/narmset.pas

@@ -84,7 +84,7 @@ implementation
       begin
       begin
         location_reset(location,LOC_FLAGS,OS_NO);
         location_reset(location,LOC_FLAGS,OS_NO);
         location.resflags:=F_NE;
         location.resflags:=F_NE;
-        if (left.location.loc=LOC_CONSTANT) and not(current_settings.cputype in cpu_thumb) then
+        if (left.location.loc=LOC_CONSTANT) and not(GenerateThumbCode) then
           begin
           begin
             hlcg.location_force_reg(current_asmdata.CurrAsmList, right.location,
             hlcg.location_force_reg(current_asmdata.CurrAsmList, right.location,
               right.resultdef, right.resultdef, true);
               right.resultdef, right.resultdef, true);
@@ -104,7 +104,7 @@ implementation
             hregister:=cg.getintregister(current_asmdata.CurrAsmList, uopsize);
             hregister:=cg.getintregister(current_asmdata.CurrAsmList, uopsize);
             current_asmdata.CurrAsmList.concat(taicpu.op_reg_const(A_MOV,hregister,1));
             current_asmdata.CurrAsmList.concat(taicpu.op_reg_const(A_MOV,hregister,1));
 
 
-            if current_settings.cputype in cpu_thumb then
+            if GenerateThumbCode or GenerateThumb2Code then
               begin
               begin
                 current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg(A_LSL,hregister,left.location.register));
                 current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg(A_LSL,hregister,left.location.register));
                 cg.a_reg_alloc(current_asmdata.CurrAsmList,NR_DEFAULTFLAGS);
                 cg.a_reg_alloc(current_asmdata.CurrAsmList,NR_DEFAULTFLAGS);
@@ -144,8 +144,9 @@ implementation
         basereg,
         basereg,
         indexreg : tregister;
         indexreg : tregister;
         href : treference;
         href : treference;
-        tablelabel: TAsmLabel;
+        tablelabel, piclabel : TAsmLabel;
         opcgsize : tcgsize;
         opcgsize : tcgsize;
+        picoffset : int64;
 
 
         procedure genitem(list:TAsmList;t : pcaselabel);
         procedure genitem(list:TAsmList;t : pcaselabel);
           var
           var
@@ -155,9 +156,15 @@ implementation
               genitem(list,t^.less);
               genitem(list,t^.less);
             { fill possible hole }
             { fill possible hole }
             for i:=last.svalue+1 to t^._low.svalue-1 do
             for i:=last.svalue+1 to t^._low.svalue-1 do
-              list.concat(Tai_const.Create_sym(elselabel));
+              if cs_create_pic in current_settings.moduleswitches then
+                list.concat(Tai_const.Create_rel_sym_offset(aitconst_ptr,piclabel,elselabel,picoffset))
+              else
+                list.concat(Tai_const.Create_sym(elselabel));
             for i:=t^._low.svalue to t^._high.svalue do
             for i:=t^._low.svalue to t^._high.svalue do
-              list.concat(Tai_const.Create_sym(blocklabel(t^.blockid)));
+              if cs_create_pic in current_settings.moduleswitches then
+                list.concat(Tai_const.Create_rel_sym_offset(aitconst_ptr,piclabel,blocklabel(t^.blockid),picoffset))
+              else
+                list.concat(Tai_const.Create_sym(blocklabel(t^.blockid)));
             last:=t^._high.svalue;
             last:=t^._high.svalue;
             if assigned(t^.greater) then
             if assigned(t^.greater) then
               genitem(list,t^.greater);
               genitem(list,t^.greater);
@@ -192,8 +199,10 @@ implementation
         indexreg:=cg.makeregsize(current_asmdata.CurrAsmList,hregister,OS_INT);
         indexreg:=cg.makeregsize(current_asmdata.CurrAsmList,hregister,OS_INT);
         cg.a_load_reg_reg(current_asmdata.CurrAsmList,opcgsize,OS_INT,hregister,indexreg);
         cg.a_load_reg_reg(current_asmdata.CurrAsmList,opcgsize,OS_INT,hregister,indexreg);
 
 
-        if current_settings.cputype in cpu_thumb2 then
+        if GenerateThumb2Code then
           begin
           begin
+            if cs_create_pic in current_settings.moduleswitches then
+              internalerror(2013082101);
             { adjust index }
             { adjust index }
             cg.a_op_const_reg_reg(current_asmdata.CurrAsmList,OP_SUB,OS_ADDR,min_,indexreg,indexreg);
             cg.a_op_const_reg_reg(current_asmdata.CurrAsmList,OP_SUB,OS_ADDR,min_,indexreg,indexreg);
             { create reference and generate jump table }
             { create reference and generate jump table }
@@ -209,8 +218,10 @@ implementation
             last:=min_;
             last:=min_;
             genitem_thumb2(current_asmdata.CurrAsmList,hp);
             genitem_thumb2(current_asmdata.CurrAsmList,hp);
           end
           end
-        else if current_settings.cputype in cpu_thumb then
+        else if GenerateThumbCode then
           begin
           begin
+            if cs_create_pic in current_settings.moduleswitches then
+              internalerror(2013082102);
             cg.a_op_const_reg_reg(current_asmdata.CurrAsmList,OP_SUB,OS_ADDR,min_+1,indexreg,indexreg);
             cg.a_op_const_reg_reg(current_asmdata.CurrAsmList,OP_SUB,OS_ADDR,min_+1,indexreg,indexreg);
             current_asmdata.getaddrlabel(tablelabel);
             current_asmdata.getaddrlabel(tablelabel);
 
 
@@ -232,14 +243,26 @@ implementation
         else
         else
           begin
           begin
             { adjust index }
             { adjust index }
-            cg.a_op_const_reg_reg(current_asmdata.CurrAsmList,OP_SUB,OS_ADDR,min_+1,indexreg,indexreg);
+            cg.a_op_const_reg_reg(current_asmdata.CurrAsmList,OP_SUB,OS_ADDR,
+              min_+ord(not(cs_create_pic in current_settings.moduleswitches)),
+              indexreg,indexreg);
             { create reference and generate jump table }
             { create reference and generate jump table }
             reference_reset(href,4);
             reference_reset(href,4);
             href.base:=NR_PC;
             href.base:=NR_PC;
             href.index:=indexreg;
             href.index:=indexreg;
             href.shiftmode:=SM_LSL;
             href.shiftmode:=SM_LSL;
             href.shiftimm:=2;
             href.shiftimm:=2;
-            cg.a_load_ref_reg(current_asmdata.CurrAsmList,OS_ADDR,OS_ADDR,href,NR_PC);
+            if cs_create_pic in current_settings.moduleswitches then
+              begin
+                picoffset:=-8;
+                current_asmdata.getaddrlabel(piclabel);
+                indexreg:=cg.getaddressregister(current_asmdata.CurrAsmList);
+                cg.a_load_ref_reg(current_asmdata.CurrAsmList,OS_ADDR,OS_ADDR,href,indexreg);
+                cg.a_label(current_asmdata.CurrAsmList,piclabel);
+                cg.a_op_reg_reg(current_asmdata.CurrAsmList,OP_ADD,OS_ADDR,indexreg,NR_PC);
+              end
+            else
+              cg.a_load_ref_reg(current_asmdata.CurrAsmList,OS_ADDR,OS_ADDR,href,NR_PC);
             { generate jump table }
             { generate jump table }
             last:=min_;
             last:=min_;
             genitem(current_asmdata.CurrAsmList,hp);
             genitem(current_asmdata.CurrAsmList,hp);

+ 33 - 5
compiler/arm/rgcpu.pas

@@ -92,7 +92,11 @@ unit rgcpu;
                   for hr := RS_R8 to RS_R15 do
                   for hr := RS_R8 to RS_R15 do
                     add_edge(getsupreg(taicpu(p).oper[0]^.reg), hr);
                     add_edge(getsupreg(taicpu(p).oper[0]^.reg), hr);
                 end;
                 end;
-              A_ADD:
+              A_ADD,
+              A_SUB,
+              A_AND,
+              A_BIC,
+              A_EOR:
                 begin
                 begin
                   if taicpu(p).ops = 3 then
                   if taicpu(p).ops = 3 then
                     begin
                     begin
@@ -121,6 +125,23 @@ unit rgcpu;
                         end;
                         end;
                     end;
                     end;
                 end;
                 end;
+              A_MLA,
+              A_MUL:
+                begin
+                  if current_settings.cputype<cpu_armv6 then
+                    add_edge(getsupreg(taicpu(p).oper[0]^.reg),getsupreg(taicpu(p).oper[1]^.reg));
+                   add_edge(getsupreg(taicpu(p).oper[0]^.reg),RS_R13);
+                   add_edge(getsupreg(taicpu(p).oper[0]^.reg),RS_R15);
+                   add_edge(getsupreg(taicpu(p).oper[1]^.reg),RS_R13);
+                   add_edge(getsupreg(taicpu(p).oper[1]^.reg),RS_R15);
+                   add_edge(getsupreg(taicpu(p).oper[2]^.reg),RS_R13);
+                   add_edge(getsupreg(taicpu(p).oper[2]^.reg),RS_R15);
+                   if taicpu(p).opcode=A_MLA then
+                     begin
+                       add_edge(getsupreg(taicpu(p).oper[3]^.reg),RS_R13);
+                       add_edge(getsupreg(taicpu(p).oper[3]^.reg),RS_R15);
+                     end;
+                end;
               A_LDRB,
               A_LDRB,
               A_STRB,
               A_STRB,
               A_STR,
               A_STR,
@@ -165,7 +186,7 @@ unit rgcpu;
 
 
       { Lets remove the bits we can fold in later and check if the result can be easily with an add or sub }
       { Lets remove the bits we can fold in later and check if the result can be easily with an add or sub }
       a:=abs(spilltemp.offset);
       a:=abs(spilltemp.offset);
-      if current_settings.cputype in cpu_thumb then
+      if GenerateThumbCode then
         begin
         begin
           {$ifdef DEBUG_SPILLING}
           {$ifdef DEBUG_SPILLING}
           helplist.concat(tai_comment.create(strpnew('Spilling: Use a_load_const_reg to fix spill offset')));
           helplist.concat(tai_comment.create(strpnew('Spilling: Use a_load_const_reg to fix spill offset')));
@@ -222,7 +243,7 @@ unit rgcpu;
    function fix_spilling_offset(offset : ASizeInt) : boolean;
    function fix_spilling_offset(offset : ASizeInt) : boolean;
      begin
      begin
        result:=(abs(offset)>4095) or
        result:=(abs(offset)>4095) or
-          ((current_settings.cputype in cpu_thumb) and ((offset<0) or (offset>1020)));
+          ((GenerateThumbCode) and ((offset<0) or (offset>1020)));
      end;
      end;
 
 
 
 
@@ -486,8 +507,15 @@ unit rgcpu;
             case taicpu(p).opcode of
             case taicpu(p).opcode of
               A_MLA,
               A_MLA,
               A_MUL:
               A_MUL:
-                if current_settings.cputype<cpu_armv6 then
-                  add_edge(getsupreg(taicpu(p).oper[0]^.reg),getsupreg(taicpu(p).oper[1]^.reg));
+                begin
+                  if current_settings.cputype<cpu_armv6 then
+                    add_edge(getsupreg(taicpu(p).oper[0]^.reg),getsupreg(taicpu(p).oper[1]^.reg));
+                  add_edge(getsupreg(taicpu(p).oper[0]^.reg),RS_R15);
+                  add_edge(getsupreg(taicpu(p).oper[1]^.reg),RS_R15);
+                  add_edge(getsupreg(taicpu(p).oper[2]^.reg),RS_R15);
+                  if taicpu(p).opcode=A_MLA then
+                    add_edge(getsupreg(taicpu(p).oper[3]^.reg),RS_R15);
+                end;
               A_UMULL,
               A_UMULL,
               A_UMLAL,
               A_UMLAL,
               A_SMULL,
               A_SMULL,

+ 1 - 1
compiler/assemble.pas

@@ -42,7 +42,7 @@ interface
        AsmOutSize=32768*4;
        AsmOutSize=32768*4;
 
 
     type
     type
-      TAssembler=class(TAbstractAssembler)
+      TAssembler=class(TObject)
       public
       public
       {filenames}
       {filenames}
         path        : TPathStr;
         path        : TPathStr;

+ 2 - 2
compiler/cresstr.pas

@@ -152,8 +152,8 @@ uses
         { Write unitname entry }
         { Write unitname entry }
         namelab:=emit_ansistring_const(current_asmdata.asmlists[al_const],@current_module.localsymtable.name^[1],length(current_module.localsymtable.name^),getansistringcodepage,False);
         namelab:=emit_ansistring_const(current_asmdata.asmlists[al_const],@current_module.localsymtable.name^[1],length(current_module.localsymtable.name^),getansistringcodepage,False);
         current_asmdata.asmlists[al_resourcestrings].concat(tai_const.Create_sym_offset(namelab.lab,namelab.ofs));
         current_asmdata.asmlists[al_resourcestrings].concat(tai_const.Create_sym_offset(namelab.lab,namelab.ofs));
-        current_asmdata.asmlists[al_resourcestrings].concat(tai_const.create_sym(nil));
-        current_asmdata.asmlists[al_resourcestrings].concat(tai_const.create_sym(nil));
+        current_asmdata.asmlists[al_resourcestrings].concat(tai_const.create_nil_dataptr);
+        current_asmdata.asmlists[al_resourcestrings].concat(tai_const.create_nil_dataptr);
         current_asmdata.asmlists[al_resourcestrings].concat(tai_const.create_32bit(0));
         current_asmdata.asmlists[al_resourcestrings].concat(tai_const.create_32bit(0));
 {$ifdef cpu64bitaddr}
 {$ifdef cpu64bitaddr}
         current_asmdata.asmlists[al_resourcestrings].concat(tai_const.create_32bit(0));
         current_asmdata.asmlists[al_resourcestrings].concat(tai_const.create_32bit(0));

+ 52 - 29
compiler/dbgdwarf.pas

@@ -921,10 +921,10 @@ implementation
                   begin
                   begin
                     if not assigned(def.typesym) then
                     if not assigned(def.typesym) then
                       internalerror(200610011);
                       internalerror(200610011);
-                    def.dwarf_lab:=current_asmdata.RefAsmSymbol(make_mangledname('DBG',def.owner,symname(def.typesym)));
-                    def.dwarf_ref_lab:=current_asmdata.RefAsmSymbol(make_mangledname('DBGREF',def.owner,symname(def.typesym)));
+                    def.dwarf_lab:=current_asmdata.RefAsmSymbol(make_mangledname('DBG',def.owner,symname(def.typesym)),AT_DATA);
+                    def.dwarf_ref_lab:=current_asmdata.RefAsmSymbol(make_mangledname('DBGREF',def.owner,symname(def.typesym)),AT_DATA);
                     if is_class_or_interface_or_dispinterface(def) or is_objectpascal_helper(def) then
                     if is_class_or_interface_or_dispinterface(def) or is_objectpascal_helper(def) then
-                      tobjectdef(def).dwarf_struct_lab:=current_asmdata.RefAsmSymbol(make_mangledname('DBG2',def.owner,symname(def.typesym)));
+                      tobjectdef(def).dwarf_struct_lab:=current_asmdata.RefAsmSymbol(make_mangledname('DBG2',def.owner,symname(def.typesym)),AT_DATA);
                     def.dbg_state:=dbg_state_written;
                     def.dbg_state:=dbg_state_written;
                   end
                   end
                 else
                 else
@@ -1251,7 +1251,7 @@ implementation
         else
         else
           begin
           begin
             AddConstToAbbrev(ord(DW_FORM_ref4));
             AddConstToAbbrev(ord(DW_FORM_ref4));
-            current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_rel_sym(offsetreltype,current_asmdata.RefAsmSymbol(target_asm.labelprefix+'debug_info0'),sym));
+            current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_rel_sym(offsetreltype,current_asmdata.DefineAsmSymbol(target_asm.labelprefix+'debug_info0',AB_LOCAL,AT_DATA),sym));
           end;
           end;
       end;
       end;
 
 
@@ -1785,7 +1785,10 @@ implementation
           finish_children;
           finish_children;
 
 
           { now the data array }
           { now the data array }
-          current_asmdata.asmlists[al_dwarf_info].concat(tai_symbol.create(arr,0));
+          if arr.bind=AB_GLOBAL then
+            current_asmdata.asmlists[al_dwarf_info].concat(tai_symbol.create_global(arr,0))
+          else
+            current_asmdata.asmlists[al_dwarf_info].concat(tai_symbol.create(arr,0));
           append_entry(DW_TAG_array_type,true,[
           append_entry(DW_TAG_array_type,true,[
             DW_AT_byte_size,DW_FORM_udata,def.size,
             DW_AT_byte_size,DW_FORM_udata,def.size,
             DW_AT_byte_stride,DW_FORM_udata,1
             DW_AT_byte_stride,DW_FORM_udata,1
@@ -1916,7 +1919,10 @@ implementation
 
 
             finish_children;
             finish_children;
 
 
-            current_asmdata.asmlists[al_dwarf_info].concat(tai_symbol.create(proc,0));
+            if proc.bind=AB_GLOBAL then
+              current_asmdata.asmlists[al_dwarf_info].concat(tai_symbol.create_global(proc,0))
+            else
+              current_asmdata.asmlists[al_dwarf_info].concat(tai_symbol.create(proc,0));
             doappend;
             doappend;
           end
           end
         else
         else
@@ -1931,10 +1937,14 @@ implementation
         current_asmdata.asmlists[al_dwarf_info].concat(tai_comment.Create(strpnew('Definition '+def.typename)));
         current_asmdata.asmlists[al_dwarf_info].concat(tai_comment.Create(strpnew('Definition '+def.typename)));
 
 
         labsym:=def_dwarf_lab(def);
         labsym:=def_dwarf_lab(def);
-        if ds_dwarf_dbg_info_written in def.defstates then
-          current_asmdata.asmlists[al_dwarf_info].concat(tai_symbol.create_global(labsym,0))
-        else
-          current_asmdata.asmlists[al_dwarf_info].concat(tai_symbol.create(labsym,0));
+        case labsym.bind of
+          AB_GLOBAL:
+            current_asmdata.asmlists[al_dwarf_info].concat(tai_symbol.create_global(labsym,0));
+          AB_LOCAL:
+            current_asmdata.asmlists[al_dwarf_info].concat(tai_symbol.create(labsym,0));
+          else
+            internalerror(2013082001);
+        end;
 
 
         { On Darwin, dwarf info is not linked in the final binary,
         { On Darwin, dwarf info is not linked in the final binary,
           but kept in the individual object files. This allows for
           but kept in the individual object files. This allows for
@@ -2013,10 +2023,14 @@ implementation
         { create a derived reference type for pass-by-reference parameters }
         { create a derived reference type for pass-by-reference parameters }
         { (gdb doesn't support DW_AT_variable_parameter yet)               }
         { (gdb doesn't support DW_AT_variable_parameter yet)               }
         labsym:=def_dwarf_ref_lab(def);
         labsym:=def_dwarf_ref_lab(def);
-        if ds_dwarf_dbg_info_written in def.defstates then
-          current_asmdata.asmlists[al_dwarf_info].concat(tai_symbol.create_global(labsym,0))
-        else
-          current_asmdata.asmlists[al_dwarf_info].concat(tai_symbol.create(labsym,0));
+        case labsym.bind of
+          AB_GLOBAL:
+            current_asmdata.asmlists[al_dwarf_info].concat(tai_symbol.create_global(labsym,0));
+          AB_LOCAL:
+            current_asmdata.asmlists[al_dwarf_info].concat(tai_symbol.create(labsym,0));
+          else
+            internalerror(2013082002);
+        end;
         append_entry(DW_TAG_reference_type,false,[]);
         append_entry(DW_TAG_reference_type,false,[]);
         append_labelentry_ref(DW_AT_type,def_dwarf_lab(def));
         append_labelentry_ref(DW_AT_type,def_dwarf_lab(def));
         finish_entry;
         finish_entry;
@@ -2383,7 +2397,7 @@ implementation
                     else
                     else
                       begin
                       begin
                         templist.concat(tai_const.create_8bit(ord(DW_OP_addr)));
                         templist.concat(tai_const.create_8bit(ord(DW_OP_addr)));
-                        templist.concat(tai_const.Create_type_name(offsetabstype,sym.mangledname,offset));
+                        templist.concat(tai_const.Create_type_name(aitconst_ptr,sym.mangledname,offset));
                         blocksize:=1+sizeof(puint);
                         blocksize:=1+sizeof(puint);
                       end;
                       end;
                   end;
                   end;
@@ -2844,7 +2858,7 @@ implementation
           toasm :
           toasm :
             begin
             begin
               templist.concat(tai_const.create_8bit(3));
               templist.concat(tai_const.create_8bit(3));
-              templist.concat(tai_const.create_type_name(offsetabstype,sym.mangledname,0));
+              templist.concat(tai_const.create_type_name(aitconst_ptr,sym.mangledname,0));
               blocksize:=1+sizeof(puint);
               blocksize:=1+sizeof(puint);
             end;
             end;
           tovar:
           tovar:
@@ -2960,7 +2974,7 @@ implementation
         if use_64bit_headers then
         if use_64bit_headers then
           linelist.concat(tai_const.create_32bit_unaligned(longint($FFFFFFFF)));
           linelist.concat(tai_const.create_32bit_unaligned(longint($FFFFFFFF)));
         linelist.concat(tai_const.create_rel_sym(offsetreltype,
         linelist.concat(tai_const.create_rel_sym(offsetreltype,
-          lbl,current_asmdata.RefAsmSymbol(target_asm.labelprefix+'edebug_line0')));
+          lbl,current_asmdata.DefineAsmSymbol(target_asm.labelprefix+'edebug_line0',AB_LOCAL,AT_DATA)));
         linelist.concat(tai_label.create(lbl));
         linelist.concat(tai_label.create(lbl));
 
 
         { version }
         { version }
@@ -2969,7 +2983,7 @@ implementation
         { header length }
         { header length }
         current_asmdata.getlabel(lbl,alt_dbgfile);
         current_asmdata.getlabel(lbl,alt_dbgfile);
         linelist.concat(tai_const.create_rel_sym(offsetreltype,
         linelist.concat(tai_const.create_rel_sym(offsetreltype,
-          lbl,current_asmdata.RefAsmSymbol(target_asm.labelprefix+'ehdebug_line0')));
+          lbl,current_asmdata.DefineAsmSymbol(target_asm.labelprefix+'ehdebug_line0',AB_LOCAL,AT_DATA)));
         linelist.concat(tai_label.create(lbl));
         linelist.concat(tai_label.create(lbl));
 
 
         { minimum_instruction_length }
         { minimum_instruction_length }
@@ -3078,6 +3092,7 @@ implementation
         def: tdef;
         def: tdef;
         dbgname: string;
         dbgname: string;
         vardatatype: ttypesym;
         vardatatype: ttypesym;
+        bind: tasmsymbind;
       begin
       begin
         current_module.flags:=current_module.flags or uf_has_dwarf_debuginfo;
         current_module.flags:=current_module.flags or uf_has_dwarf_debuginfo;
         storefilepos:=current_filepos;
         storefilepos:=current_filepos;
@@ -3109,7 +3124,7 @@ implementation
         if use_64bit_headers then
         if use_64bit_headers then
           current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_32bit_unaligned(longint($FFFFFFFF)));
           current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_32bit_unaligned(longint($FFFFFFFF)));
         current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_rel_sym(offsetreltype,
         current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_rel_sym(offsetreltype,
-          lenstartlabel,current_asmdata.RefAsmSymbol(target_asm.labelprefix+'edebug_info0')));
+          lenstartlabel,current_asmdata.DefineAsmSymbol(target_asm.labelprefix+'edebug_info0',AB_LOCAL,AT_DATA)));
 
 
         current_asmdata.asmlists[al_dwarf_info].concat(tai_label.create(lenstartlabel));
         current_asmdata.asmlists[al_dwarf_info].concat(tai_label.create(lenstartlabel));
         { version }
         { version }
@@ -3117,11 +3132,11 @@ implementation
         { abbrev table (=relative from section start)}
         { abbrev table (=relative from section start)}
         if not(tf_dwarf_relative_addresses in target_info.flags) then
         if not(tf_dwarf_relative_addresses in target_info.flags) then
           current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_type_sym(offsetabstype,
           current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_type_sym(offsetabstype,
-            current_asmdata.RefAsmSymbol(target_asm.labelprefix+'debug_abbrev0')))
+            current_asmdata.DefineAsmSymbol(target_asm.labelprefix+'debug_abbrev0',AB_LOCAL,AT_DATA)))
         else
         else
           current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_rel_sym(offsetreltype,
           current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_rel_sym(offsetreltype,
-            current_asmdata.RefAsmSymbol(target_asm.labelprefix+'debug_abbrevsection0'),
-            current_asmdata.RefAsmSymbol(target_asm.labelprefix+'debug_abbrev0')));
+            current_asmdata.DefineAsmSymbol(target_asm.labelprefix+'debug_abbrevsection0',AB_LOCAL,AT_DATA),
+            current_asmdata.DefineAsmSymbol(target_asm.labelprefix+'debug_abbrev0',AB_LOCAL,AT_DATA)));
 
 
         { address size }
         { address size }
         current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_8bit(sizeof(pint)));
         current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_8bit(sizeof(pint)));
@@ -3136,23 +3151,28 @@ implementation
 
 
         { reference to line info section }
         { reference to line info section }
         if not(tf_dwarf_relative_addresses in target_info.flags) then
         if not(tf_dwarf_relative_addresses in target_info.flags) then
-          append_labelentry_dataptr_abs(DW_AT_stmt_list,current_asmdata.RefAsmSymbol(target_asm.labelprefix+'debug_line0'))
+          append_labelentry_dataptr_abs(DW_AT_stmt_list,current_asmdata.DefineAsmSymbol(target_asm.labelprefix+'debug_line0',AB_LOCAL,AT_DATA))
         else
         else
           append_labelentry_dataptr_rel(DW_AT_stmt_list,
           append_labelentry_dataptr_rel(DW_AT_stmt_list,
-            current_asmdata.RefAsmSymbol(target_asm.labelprefix+'debug_linesection0'),
-            current_asmdata.RefAsmSymbol(target_asm.labelprefix+'debug_line0'));
+            current_asmdata.DefineAsmSymbol(target_asm.labelprefix+'debug_linesection0',AB_LOCAL,AT_DATA),
+            current_asmdata.DefineAsmSymbol(target_asm.labelprefix+'debug_line0',AB_LOCAL,AT_DATA));
 
 
         if (m_objectivec1 in current_settings.modeswitches) then
         if (m_objectivec1 in current_settings.modeswitches) then
           append_attribute(DW_AT_APPLE_major_runtime_vers,DW_FORM_data1,[1]);
           append_attribute(DW_AT_APPLE_major_runtime_vers,DW_FORM_data1,[1]);
 
 
         dbgname:=make_mangledname('DEBUGSTART',current_module.localsymtable,'');
         dbgname:=make_mangledname('DEBUGSTART',current_module.localsymtable,'');
         if (target_info.system in systems_darwin) then
         if (target_info.system in systems_darwin) then
-          dbgname:='L'+dbgname;
-        append_labelentry(DW_AT_low_pc,current_asmdata.RefAsmSymbol(dbgname));
+          begin
+            bind:=AB_LOCAL;
+            dbgname:='L'+dbgname;
+          end
+        else
+          bind:=AB_GLOBAL;
+        append_labelentry(DW_AT_low_pc,current_asmdata.DefineAsmSymbol(dbgname,bind,AT_DATA));
         dbgname:=make_mangledname('DEBUGEND',current_module.localsymtable,'');
         dbgname:=make_mangledname('DEBUGEND',current_module.localsymtable,'');
         if (target_info.system in systems_darwin) then
         if (target_info.system in systems_darwin) then
           dbgname:='L'+dbgname;
           dbgname:='L'+dbgname;
-        append_labelentry(DW_AT_high_pc,current_asmdata.RefAsmSymbol(dbgname));
+        append_labelentry(DW_AT_high_pc,current_asmdata.DefineAsmSymbol(dbgname,bind,AT_DATA));
 
 
         finish_entry;
         finish_entry;
 
 
@@ -3641,7 +3661,10 @@ implementation
                   current_asmdata.getaddrlabel(lab);
                   current_asmdata.getaddrlabel(lab);
                 append_labelentry_ref(DW_AT_type,lab);
                 append_labelentry_ref(DW_AT_type,lab);
                 finish_entry;
                 finish_entry;
-                current_asmdata.asmlists[al_dwarf_info].concat(tai_symbol.create(lab,0));
+                if lab.bind=AB_GLOBAL then
+                  current_asmdata.asmlists[al_dwarf_info].concat(tai_symbol.create_global(lab,0))
+                else
+                  current_asmdata.asmlists[al_dwarf_info].concat(tai_symbol.create(lab,0));
                 { Sets of e.g. [1..5] are actually stored as a set of [0..7],
                 { Sets of e.g. [1..5] are actually stored as a set of [0..7],
                   so write the exact boundaries of the set here. Let's hope no
                   so write the exact boundaries of the set here. Let's hope no
                   debugger ever rejects this because this "subrange" type can
                   debugger ever rejects this because this "subrange" type can

+ 6 - 4
compiler/defcmp.pas

@@ -2119,8 +2119,8 @@ implementation
 
 
     function proc_to_procvar_equal(def1:tabstractprocdef;def2:tprocvardef;checkincompatibleuniv: boolean):tequaltype;
     function proc_to_procvar_equal(def1:tabstractprocdef;def2:tprocvardef;checkincompatibleuniv: boolean):tequaltype;
       var
       var
-        eq : tequaltype;
-        po_comp : tprocoptions;
+        eq: tequaltype;
+        po_comp: tprocoptions;
         pa_comp: tcompare_paras_options;
         pa_comp: tcompare_paras_options;
       begin
       begin
          proc_to_procvar_equal:=te_incompatible;
          proc_to_procvar_equal:=te_incompatible;
@@ -2154,8 +2154,10 @@ implementation
          if checkincompatibleuniv then
          if checkincompatibleuniv then
            include(pa_comp,cpo_warn_incompatible_univ);
            include(pa_comp,cpo_warn_incompatible_univ);
          { check return value and options, methodpointer is already checked }
          { check return value and options, methodpointer is already checked }
-         po_comp:=[po_staticmethod,po_interrupt,
-                   po_iocheck,po_varargs];
+         po_comp:=[po_interrupt,po_iocheck,po_varargs];
+         { check static only if we compare method pointers }
+         if def1.is_methodpointer then
+           include(po_comp,po_staticmethod);
          if (m_delphi in current_settings.modeswitches) then
          if (m_delphi in current_settings.modeswitches) then
            exclude(po_comp,po_varargs);
            exclude(po_comp,po_varargs);
          if (def1.proccalloption=def2.proccalloption) and
          if (def1.proccalloption=def2.proccalloption) and

+ 35 - 0
compiler/fppu.pas

@@ -230,6 +230,33 @@ var
            Message(unit_u_ppu_invalid_target,@queuecomment);
            Message(unit_u_ppu_invalid_target,@queuecomment);
            exit;
            exit;
          end;
          end;
+{$ifdef i8086}
+      { check i8086 memory model flags }
+        if ((ppufile.header.flags and uf_i8086_far_code)<>0) xor
+            (current_settings.x86memorymodel in [mm_medium,mm_large,mm_huge]) then
+         begin
+           ppufile.free;
+           ppufile:=nil;
+           Message(unit_u_ppu_invalid_memory_model,@queuecomment);
+           exit;
+         end;
+        if ((ppufile.header.flags and uf_i8086_far_data)<>0) xor
+            (current_settings.x86memorymodel in [mm_compact,mm_large]) then
+         begin
+           ppufile.free;
+           ppufile:=nil;
+           Message(unit_u_ppu_invalid_memory_model,@queuecomment);
+           exit;
+         end;
+        if ((ppufile.header.flags and uf_i8086_huge_data)<>0) xor
+            (current_settings.x86memorymodel=mm_huge) then
+         begin
+           ppufile.free;
+           ppufile:=nil;
+           Message(unit_u_ppu_invalid_memory_model,@queuecomment);
+           exit;
+         end;
+{$endif i8086}
 {$ifdef cpufpemu}
 {$ifdef cpufpemu}
        { check if floating point emulation is on?
        { check if floating point emulation is on?
          fpu emulation isn't unit levelwise because it affects calling convention }
          fpu emulation isn't unit levelwise because it affects calling convention }
@@ -1061,6 +1088,14 @@ var
           flags:=flags or uf_release;
           flags:=flags or uf_release;
          if assigned(localsymtable) then
          if assigned(localsymtable) then
            flags:=flags or uf_local_symtable;
            flags:=flags or uf_local_symtable;
+{$ifdef i8086}
+         if current_settings.x86memorymodel in [mm_medium,mm_large,mm_huge] then
+           flags:=flags or uf_i8086_far_code;
+         if current_settings.x86memorymodel in [mm_compact,mm_large] then
+           flags:=flags or uf_i8086_far_data;
+         if current_settings.x86memorymodel=mm_huge then
+           flags:=flags or uf_i8086_huge_data;
+{$endif i8086}
 {$ifdef cpufpemu}
 {$ifdef cpufpemu}
          if (cs_fp_emulation in current_settings.moduleswitches) then
          if (cs_fp_emulation in current_settings.moduleswitches) then
            flags:=flags or uf_fpu_emulation;
            flags:=flags or uf_fpu_emulation;

+ 42 - 3
compiler/globals.pas

@@ -154,11 +154,17 @@ interface
 
 
          disabledircache : boolean;
          disabledircache : boolean;
 
 
+{$if defined(i8086)}
          x86memorymodel  : tx86memorymodel;
          x86memorymodel  : tx86memorymodel;
+{$endif defined(i8086)}
+
+{$if defined(ARM)}
+         instructionset : tinstructionset;
+{$endif defined(ARM)}
 
 
         { CPU targets with microcontroller support can add a controller specific unit }
         { CPU targets with microcontroller support can add a controller specific unit }
 {$if defined(ARM) or defined(AVR)}
 {$if defined(ARM) or defined(AVR)}
-        controllertype   : tcontrollertype;
+         controllertype   : tcontrollertype;
 {$endif defined(ARM) or defined(AVR)}
 {$endif defined(ARM) or defined(AVR)}
          { WARNING: this pointer cannot be written as such in record token }
          { WARNING: this pointer cannot be written as such in record token }
          pmessage : pmessagestaterecord;
          pmessage : pmessagestaterecord;
@@ -479,7 +485,12 @@ interface
         minfpconstprec : s32real;
         minfpconstprec : s32real;
 
 
         disabledircache : false;
         disabledircache : false;
+{$if defined(i8086)}
         x86memorymodel : mm_small;
         x86memorymodel : mm_small;
+{$endif defined(i8086)}
+{$if defined(ARM)}
+        instructionset : is_arm;
+{$endif defined(ARM)}
 {$if defined(ARM) or defined(AVR)}
 {$if defined(ARM) or defined(AVR)}
         controllertype : ct_none;
         controllertype : ct_none;
 {$endif defined(ARM) or defined(AVR)}
 {$endif defined(ARM) or defined(AVR)}
@@ -511,7 +522,8 @@ interface
 
 
     function SetAktProcCall(const s:string; var a:tproccalloption):boolean;
     function SetAktProcCall(const s:string; var a:tproccalloption):boolean;
     function Setabitype(const s:string;var a:tabi):boolean;
     function Setabitype(const s:string;var a:tabi):boolean;
-    function Setcputype(const s:string;var a:tcputype):boolean;
+    function Setoptimizecputype(const s:string;var a:tcputype):boolean;
+    function Setcputype(const s:string;var a:tsettings):boolean;
     function SetFpuType(const s:string;var a:tfputype):boolean;
     function SetFpuType(const s:string;var a:tfputype):boolean;
 {$if defined(arm) or defined(avr)}
 {$if defined(arm) or defined(avr)}
     function SetControllerType(const s:string;var a:tcontrollertype):boolean;
     function SetControllerType(const s:string;var a:tcontrollertype):boolean;
@@ -1107,7 +1119,7 @@ implementation
       end;
       end;
 
 
 
 
-    function Setcputype(const s:string;var a:tcputype):boolean;
+    function Setoptimizecputype(const s:string;var a:tcputype):boolean;
       var
       var
         t  : tcputype;
         t  : tcputype;
         hs : string;
         hs : string;
@@ -1124,6 +1136,33 @@ implementation
       end;
       end;
 
 
 
 
+    function Setcputype(const s:string;var a:tsettings):boolean;
+      var
+        t  : tcputype;
+        hs : string;
+      begin
+        result:=false;
+        hs:=Upper(s);
+        for t:=low(tcputype) to high(tcputype) do
+          if cputypestr[t]=hs then
+            begin
+              a.cputype:=t;
+              result:=true;
+              break;
+            end;
+{$ifdef arm}
+        { set default instruction set for arm }
+        if result then
+          begin
+            if a.cputype in [cpu_armv6m,cpu_armv6t2,cpu_armv7m] then
+              a.instructionset:=is_thumb
+            else
+              a.instructionset:=is_arm;
+          end;
+{$endif arm}
+      end;
+
+
     function SetFpuType(const s:string;var a:tfputype):boolean;
     function SetFpuType(const s:string;var a:tfputype):boolean;
       var
       var
         t : tfputype;
         t : tfputype;

+ 11 - 2
compiler/globtype.pas

@@ -232,7 +232,14 @@ interface
            these strings as prefixes for the generated getters/setter names }
            these strings as prefixes for the generated getters/setter names }
          ts_auto_getter_prefix,
          ts_auto_getter_prefix,
          ts_auto_setter_predix,
          ts_auto_setter_predix,
-         ts_thumb_interworking
+         ts_thumb_interworking,
+         { lowercase the first character of routine names, used to generate
+           names that are compliant with Java coding standards from code
+           written according to Delphi coding standards }
+         ts_lowercase_proc_start,
+         { initialise local variables on the JVM target so you won't get
+           accidental uses of uninitialised values }
+         ts_init_locals
        );
        );
        ttargetswitches = set of ttargetswitch;
        ttargetswitches = set of ttargetswitch;
 
 
@@ -313,7 +320,9 @@ interface
          (name: 'ENUMFIELDINIT';       hasvalue: false; isglobal: true ),
          (name: 'ENUMFIELDINIT';       hasvalue: false; isglobal: true ),
          (name: 'AUTOGETTERPREFIX';    hasvalue: true ; isglobal: false),
          (name: 'AUTOGETTERPREFIX';    hasvalue: true ; isglobal: false),
          (name: 'AUTOSETTERPREFIX';    hasvalue: true ; isglobal: false),
          (name: 'AUTOSETTERPREFIX';    hasvalue: true ; isglobal: false),
-         (name: 'THUMBINTERWORKING';   hasvalue: false; isglobal: true )
+         (name: 'THUMBINTERWORKING';   hasvalue: false; isglobal: true ),
+         (name: 'LOWERCASEPROCSTART';  hasvalue: false; isglobal: true ),
+         (name: 'INITLOCALS';          hasvalue: false; isglobal: true )
        );
        );
 
 
        { switches being applied to all CPUs at the given level }
        { switches being applied to all CPUs at the given level }

+ 5 - 5
compiler/hlcgobj.pas

@@ -3888,7 +3888,7 @@ implementation
       while assigned(item) do
       while assigned(item) do
         begin
         begin
 {$ifdef arm}
 {$ifdef arm}
-          if current_settings.cputype in cpu_thumb2+cpu_thumb then
+          if GenerateThumbCode or GenerateThumb2Code then
             list.concat(tai_thumb_func.create);
             list.concat(tai_thumb_func.create);
 {$endif arm}
 {$endif arm}
           { "double link" all procedure entry symbols via .reference }
           { "double link" all procedure entry symbols via .reference }
@@ -3911,15 +3911,15 @@ implementation
           previtem:=item;
           previtem:=item;
           item := TCmdStrListItem(item.next);
           item := TCmdStrListItem(item.next);
         end;
         end;
-	  if (use_ent) then
-	    list.concat(Tai_ent.create(current_procinfo.procdef.mangledname));
+      if (use_ent) then
+        list.concat(Tai_directive.create(asd_ent,current_procinfo.procdef.mangledname));
       current_procinfo.procdef.procstarttai:=tai(list.last);
       current_procinfo.procdef.procstarttai:=tai(list.last);
     end;
     end;
 
 
   procedure thlcgobj.gen_proc_symbol_end(list: TAsmList);
   procedure thlcgobj.gen_proc_symbol_end(list: TAsmList);
     begin
     begin
-	  if (use_ent) then
-	    list.concat(Tai_ent_end.create(current_procinfo.procdef.mangledname));
+      if (use_ent) then
+        list.concat(Tai_directive.create(asd_ent_end,current_procinfo.procdef.mangledname));
       list.concat(Tai_symbol_end.Createname(current_procinfo.procdef.mangledname));
       list.concat(Tai_symbol_end.Createname(current_procinfo.procdef.mangledname));
 
 
       current_procinfo.procdef.procendtai:=tai(list.last);
       current_procinfo.procdef.procendtai:=tai(list.last);

+ 1 - 1
compiler/i8086/cpuinfo.pas

@@ -125,7 +125,7 @@ Const
 
 
    level1optimizerswitches = genericlevel1optimizerswitches + [cs_opt_peephole];
    level1optimizerswitches = genericlevel1optimizerswitches + [cs_opt_peephole];
    level2optimizerswitches = genericlevel2optimizerswitches + level1optimizerswitches +
    level2optimizerswitches = genericlevel2optimizerswitches + level1optimizerswitches +
-     [cs_opt_regvar,cs_opt_stackframe,cs_opt_tailrecursion,cs_opt_nodecse];
+     [{cs_opt_regvar,}cs_opt_stackframe,cs_opt_tailrecursion,cs_opt_nodecse];
    level3optimizerswitches = genericlevel3optimizerswitches + level2optimizerswitches + [{,cs_opt_loopunroll}];
    level3optimizerswitches = genericlevel3optimizerswitches + level2optimizerswitches + [{,cs_opt_loopunroll}];
    level4optimizerswitches = genericlevel4optimizerswitches + level3optimizerswitches + [cs_useebp];
    level4optimizerswitches = genericlevel4optimizerswitches + level3optimizerswitches + [cs_useebp];
 
 

+ 4 - 6
compiler/jvm/hlcgcpu.pas

@@ -559,8 +559,6 @@ implementation
     begin
     begin
       maybepreparedivu32(list,op,size,trunc32);
       maybepreparedivu32(list,op,size,trunc32);
       case op of
       case op of
-        OP_NEG,OP_NOT:
-          ;
         OP_SHL,OP_SHR,OP_SAR:
         OP_SHL,OP_SHR,OP_SAR:
           if not is_64bitint(size) then
           if not is_64bitint(size) then
             a_load_reg_stack(list,size,reg)
             a_load_reg_stack(list,size,reg)
@@ -590,8 +588,6 @@ implementation
         internalerror(2010121102);
         internalerror(2010121102);
       maybepreparedivu32(list,op,size,trunc32);
       maybepreparedivu32(list,op,size,trunc32);
       case op of
       case op of
-        OP_NEG,OP_NOT:
-          ;
         OP_SHL,OP_SHR,OP_SAR:
         OP_SHL,OP_SHR,OP_SAR:
           begin
           begin
             if not is_64bitint(size) then
             if not is_64bitint(size) then
@@ -1157,14 +1153,16 @@ implementation
 
 
   procedure thlcgjvm.a_op_ref_reg(list: TAsmList; Op: TOpCG; size: tdef; const ref: TReference; reg: TRegister);
   procedure thlcgjvm.a_op_ref_reg(list: TAsmList; Op: TOpCG; size: tdef; const ref: TReference; reg: TRegister);
     begin
     begin
-      a_load_reg_stack(list,size,reg);
+      if not(op in [OP_NOT,OP_NEG]) then
+        a_load_reg_stack(list,size,reg);
       a_op_ref_stack(list,op,size,ref);
       a_op_ref_stack(list,op,size,ref);
       a_load_stack_reg(list,size,reg);
       a_load_stack_reg(list,size,reg);
     end;
     end;
 
 
   procedure thlcgjvm.a_op_reg_reg_reg(list: TAsmList; op: TOpCg; size: tdef; src1, src2, dst: tregister);
   procedure thlcgjvm.a_op_reg_reg_reg(list: TAsmList; op: TOpCg; size: tdef; src1, src2, dst: tregister);
     begin
     begin
-      a_load_reg_stack(list,size,src2);
+      if not(op in [OP_NOT,OP_NEG]) then
+        a_load_reg_stack(list,size,src2);
       a_op_reg_stack(list,op,size,src1);
       a_op_reg_stack(list,op,size,src1);
       a_load_stack_reg(list,size,dst);
       a_load_stack_reg(list,size,dst);
     end;
     end;

+ 76 - 4
compiler/jvm/njvmutil.pas

@@ -26,9 +26,9 @@ unit njvmutil;
 interface
 interface
 
 
   uses
   uses
-    node,
+    node,nbas,
     ngenutil,
     ngenutil,
-    symtype,symconst,symsym;
+    symtype,symconst,symsym,symdef;
 
 
 
 
   type
   type
@@ -38,6 +38,11 @@ interface
       class function force_init: boolean; override;
       class function force_init: boolean; override;
       class procedure insertbssdata(sym: tstaticvarsym); override;
       class procedure insertbssdata(sym: tstaticvarsym); override;
       class function create_main_procdef(const name: string; potype: tproctypeoption; ps: tprocsym): tdef; override;
       class function create_main_procdef(const name: string; potype: tproctypeoption; ps: tprocsym): tdef; override;
+
+      class function check_insert_trashing(pd: tprocdef): boolean; override;
+      class function  trashable_sym(p: tsym): boolean; override;
+      class procedure maybe_trash_variable(var stat: tstatementnode; p: tabstractnormalvarsym; trashn: tnode); override;
+
       class procedure InsertInitFinalTable; override;
       class procedure InsertInitFinalTable; override;
       class procedure InsertThreadvarTablesTable; override;
       class procedure InsertThreadvarTablesTable; override;
       class procedure InsertThreadvars; override;
       class procedure InsertThreadvars; override;
@@ -56,8 +61,8 @@ implementation
     uses
     uses
       verbose,cutils,globtype,globals,constexp,fmodule,
       verbose,cutils,globtype,globals,constexp,fmodule,
       aasmdata,aasmtai,cpubase,aasmcpu,
       aasmdata,aasmtai,cpubase,aasmcpu,
-      symdef,symbase,symtable,defutil,jvmdef,
-      nbas,ncnv,ncon,ninl,ncal,nld,nmem,
+      symbase,symtable,defutil,jvmdef,
+      ncnv,ncon,ninl,ncal,nld,nmem,
       ppu,
       ppu,
       pass_1;
       pass_1;
 
 
@@ -301,6 +306,73 @@ implementation
     end;
     end;
 
 
 
 
+  class function tjvmnodeutils.check_insert_trashing(pd: tprocdef): boolean;
+    begin
+      { initialise locals with 0 }
+      if ts_init_locals in current_settings.targetswitches then
+        localvartrashing:=high(trashintvalues);
+      result:=inherited;
+    end;
+
+
+  class function tjvmnodeutils.trashable_sym(p: tsym): boolean;
+    begin
+      result:=
+        inherited and
+        not jvmimplicitpointertype(tabstractnormalvarsym(p).vardef);
+    end;
+
+
+  class procedure tjvmnodeutils.maybe_trash_variable(var stat: tstatementnode; p: tabstractnormalvarsym; trashn: tnode);
+    var
+      enumdef: tenumdef;
+      trashintval: int64;
+      trashenumval: longint;
+      trashable: boolean;
+    begin
+      trashable:=trashable_sym(p);
+      trashintval:=trashintvalues[localvartrashing];
+      { widechar is a separate type in the JVM, can't cast left hand to integer
+        like in common code }
+      if trashable and
+         is_widechar(tabstractvarsym(p).vardef) then
+        trash_small(stat,trashn,
+          cordconstnode.create(word(trashintval),tabstractvarsym(p).vardef,false))
+      { enums are class instances in the JVM -> create a valid instance }
+      else if trashable and
+         is_enum(tabstractvarsym(p).vardef) then
+        begin
+          enumdef:=tenumdef(tabstractvarsym(p).vardef);
+          trashenumval:=longint(trashintval);
+          if not assigned(enumdef.int2enumsym(trashenumval)) then
+            trashintval:=longint(enumdef.min);
+          trash_small(stat,trashn,
+            cordconstnode.create(trashintval,enumdef,false))
+        end
+      { can't init pointers with arbitrary values; procvardef and objectdef are
+        always pointer-sized here because tjvmnodeutils.trashablesym returns
+        false for jvm implicit pointer types }
+      else if trashable and
+         (tabstractvarsym(p).vardef.typ in [pointerdef,classrefdef,objectdef,procvardef]) then
+        trash_small(stat,trashn,cnilnode.create)
+      else if trashable and
+         is_real(tabstractvarsym(p).vardef) then
+        trash_small(stat,trashn,crealconstnode.create(trashintval,tabstractvarsym(p).vardef))
+      { don't use inherited routines because it typecasts left to the target
+        type, and that doesn't always work in the JVM }
+      else if trashable and
+         (is_integer(tabstractvarsym(p).vardef) or
+          is_cbool(tabstractvarsym(p).vardef) or
+          is_anychar(tabstractvarsym(p).vardef) or
+          is_currency(tabstractvarsym(p).vardef)) then
+        trash_small(stat,trashn,cordconstnode.create(trashintval,tabstractvarsym(p).vardef,false))
+      else if trashable and
+         is_pasbool(tabstractvarsym(p).vardef) then
+        trash_small(stat,trashn,cordconstnode.create(trashintval and 1,tabstractvarsym(p).vardef,false))
+      else
+        inherited;
+    end;
+
   class procedure tjvmnodeutils.InsertInitFinalTable;
   class procedure tjvmnodeutils.InsertInitFinalTable;
     var
     var
       hp : tused_unit;
       hp : tused_unit;

+ 19 - 11
compiler/link.pas

@@ -46,7 +46,7 @@ interface
         DynamicLinker : string[100];
         DynamicLinker : string[100];
       end;
       end;
 
 
-      TLinker = class(TAbstractLinker)
+      TLinker = class(TObject)
       public
       public
          HasResources,
          HasResources,
          HasExports      : boolean;
          HasExports      : boolean;
@@ -132,6 +132,8 @@ interface
          procedure AddImportSymbol(const libname,symname,symmangledname:TCmdStr;OrdNr: longint;isvar:boolean);override;
          procedure AddImportSymbol(const libname,symname,symmangledname:TCmdStr;OrdNr: longint;isvar:boolean);override;
        end;
        end;
 
 
+      TLinkerClass = class of Tlinker;
+
     var
     var
       Linker  : TLinker;
       Linker  : TLinker;
 
 
@@ -139,6 +141,8 @@ interface
     function FindLibraryFile(s:TCmdStr;const prefix,ext:TCmdStr;var foundfile : TCmdStr) : boolean;
     function FindLibraryFile(s:TCmdStr;const prefix,ext:TCmdStr;var foundfile : TCmdStr) : boolean;
     function FindDLL(const s:TCmdStr;var founddll:TCmdStr):boolean;
     function FindDLL(const s:TCmdStr;var founddll:TCmdStr):boolean;
 
 
+    procedure RegisterLinker(id:tlink;c:TLinkerClass);
+
     procedure InitLinker;
     procedure InitLinker;
     procedure DoneLinker;
     procedure DoneLinker;
 
 
@@ -154,8 +158,8 @@ Implementation
       aasmbase,aasmtai,aasmdata,aasmcpu,
       aasmbase,aasmtai,aasmdata,aasmcpu,
       owbase,owar,ogmap;
       owbase,owar,ogmap;
 
 
-    type
-     TLinkerClass = class of Tlinker;
+    var
+      CLinker : array[tlink] of TLinkerClass;
 
 
 {*****************************************************************************
 {*****************************************************************************
                                    Helpers
                                    Helpers
@@ -1033,6 +1037,8 @@ Implementation
           exit;
           exit;
         Comment(V_Tried,'Opening library '+para);
         Comment(V_Tried,'Opening library '+para);
         objreader:=TArObjectreader.create(para,true);
         objreader:=TArObjectreader.create(para,true);
+        if ErrorCount>0 then
+          exit;
         if objreader.isarchive then
         if objreader.isarchive then
           TFPObjectList(FGroupStack.Last).Add(TStaticLibrary.Create(para,objreader,CObjInput))
           TFPObjectList(FGroupStack.Last).Add(TStaticLibrary.Create(para,objreader,CObjInput))
         else
         else
@@ -1518,21 +1524,23 @@ Implementation
                                  Init/Done
                                  Init/Done
 *****************************************************************************}
 *****************************************************************************}
 
 
+    procedure RegisterLinker(id:tlink;c:TLinkerClass);
+      begin
+        CLinker[id]:=c;
+      end;
+
+
     procedure InitLinker;
     procedure InitLinker;
-      var
-        lk : TlinkerClass;
       begin
       begin
         if (cs_link_extern in current_settings.globalswitches) and
         if (cs_link_extern in current_settings.globalswitches) and
-           assigned(target_info.linkextern) then
+           assigned(CLinker[target_info.linkextern]) then
           begin
           begin
-            lk:=TlinkerClass(target_info.linkextern);
-            linker:=lk.Create;
+            linker:=CLinker[target_info.linkextern].Create;
           end
           end
         else
         else
-          if assigned(target_info.link) then
+          if assigned(CLinker[target_info.link]) then
             begin
             begin
-              lk:=TLinkerClass(target_info.link);
-              linker:=lk.Create;
+              linker:=CLinker[target_info.link].Create;
             end
             end
         else
         else
           linker:=Tlinker.Create;
           linker:=Tlinker.Create;

+ 2 - 2
compiler/msg/errorct.msg

@@ -1273,8 +1273,8 @@ sym_e_forward_type_not_resolved=05009_E_No s'ha resolt el tipus posterior "$1"
 % A symbolwas forward defined, but no declaration was encountered.
 % A symbolwas forward defined, but no declaration was encountered.
 sym_e_only_static_in_static=05010_E_Només les variables estàtiques poden ser utilitzades en mètodes estàtics o fora dels mètodes
 sym_e_only_static_in_static=05010_E_Només les variables estàtiques poden ser utilitzades en mètodes estàtics o fora dels mètodes
 % A static method of an object can only access static variables.
 % A static method of an object can only access static variables.
-sym_f_type_must_be_rec_or_class=05012_F_S'esperava un tipus de registre o classe
-% The variable or expression isn't of the type \var{record} or \var{class}.
+sym_e_type_must_be_rec_or_object_or_class=05012_E_Record or object or class type expected
+% The variable or expression isn't of the type \var{record} or \var{object} or \var{class}.
 sym_e_no_instance_of_abstract_object=05013_E_No es permeten les instàncies de les classes o els objectes amb un mètode abstracte 
 sym_e_no_instance_of_abstract_object=05013_E_No es permeten les instàncies de les classes o els objectes amb un mètode abstracte 
 % You are trying to generate an instance of a class which has an abstract
 % You are trying to generate an instance of a class which has an abstract
 % method that wasn't overridden.
 % method that wasn't overridden.

+ 2 - 2
compiler/msg/errord.msg

@@ -1984,8 +1984,8 @@ sym_e_forward_type_not_resolved=05009_E_Forward-Typ "$1" nicht gefunden
 % The compiler encountered an unknown type.
 % The compiler encountered an unknown type.
 sym_e_only_static_in_static=05010_E_Nur statische Variablen k”nnen in statischen oder „usseren Methoden verwendet werden
 sym_e_only_static_in_static=05010_E_Nur statische Variablen k”nnen in statischen oder „usseren Methoden verwendet werden
 % A static method of an object can only access static variables.
 % A static method of an object can only access static variables.
-sym_f_type_must_be_rec_or_class=05012_F_Record- oder Klassen-Typ erwartet
-% The variable or expression isn't of the type \var{record} or \var{class}.
+sym_e_type_must_be_rec_or_object_or_class=05012_E_Record or object or class type expected
+% The variable or expression isn't of the type \var{record} or \var{object} or \var{class}.
 sym_e_no_instance_of_abstract_object=05013_E_Instanzen von Klassen oder Objekten mit abstrakten Methoden sind unzul„ssig
 sym_e_no_instance_of_abstract_object=05013_E_Instanzen von Klassen oder Objekten mit abstrakten Methoden sind unzul„ssig
 % You are trying to generate an instance of a class which has an abstract
 % You are trying to generate an instance of a class which has an abstract
 % method that wasn't overridden.
 % method that wasn't overridden.

+ 2 - 2
compiler/msg/errorda.msg

@@ -1326,8 +1326,8 @@ sym_e_forward_type_not_resolved=05009_E_Forward-type ikke erklæret: "$1"
 % A symbol was forward defined, but no declaration was encountered.
 % A symbol was forward defined, but no declaration was encountered.
 sym_e_only_static_in_static=05010_E_Kun statiske variabler kan bruges i statiske metoder, eller uden for metoder
 sym_e_only_static_in_static=05010_E_Kun statiske variabler kan bruges i statiske metoder, eller uden for metoder
 % A static method of an object can only access static variables.
 % A static method of an object can only access static variables.
-sym_f_type_must_be_rec_or_class=05012_F_Struktur- eller klassetype forventet
-% The variable or expression isn't of the type \var{record} or \var{class}.
+sym_e_type_must_be_rec_or_object_or_class=05012_E_Record or object or class type expected
+% The variable or expression isn't of the type \var{record} or \var{object} or \var{class}.
 sym_e_no_instance_of_abstract_object=05013_E_Instancer af klasser eller objekter med abstrakte metoder er ikke tilladt
 sym_e_no_instance_of_abstract_object=05013_E_Instancer af klasser eller objekter med abstrakte metoder er ikke tilladt
 % You are trying to generate an instance of a class which has an abstract
 % You are trying to generate an instance of a class which has an abstract
 % method that wasn't overridden.
 % method that wasn't overridden.

+ 2 - 2
compiler/msg/errordu.msg

@@ -1984,8 +1984,8 @@ sym_e_forward_type_not_resolved=05009_E_Forward-Typ "$1" nicht gefunden
 % The compiler encountered an unknown type.
 % The compiler encountered an unknown type.
 sym_e_only_static_in_static=05010_E_Nur statische Variablen können in statischen oder äusseren Methoden verwendet werden
 sym_e_only_static_in_static=05010_E_Nur statische Variablen können in statischen oder äusseren Methoden verwendet werden
 % A static method of an object can only access static variables.
 % A static method of an object can only access static variables.
-sym_f_type_must_be_rec_or_class=05012_F_Record- oder Klassen-Typ erwartet
-% The variable or expression isn't of the type \var{record} or \var{class}.
+sym_e_type_must_be_rec_or_object_or_class=05012_E_Record or object or class type expected
+% The variable or expression isn't of the type \var{record} or \var{object} or \var{class}.
 sym_e_no_instance_of_abstract_object=05013_E_Instanzen von Klassen oder Objekten mit abstrakten Methoden sind unzulässig
 sym_e_no_instance_of_abstract_object=05013_E_Instanzen von Klassen oder Objekten mit abstrakten Methoden sind unzulässig
 % You are trying to generate an instance of a class which has an abstract
 % You are trying to generate an instance of a class which has an abstract
 % method that wasn't overridden.
 % method that wasn't overridden.

+ 13 - 7
compiler/msg/errore.msg

@@ -1,6 +1,6 @@
 #
 #
 #   This file is part of the Free Pascal Compiler
 #   This file is part of the Free Pascal Compiler
-#   Copyright (c) 1999-2009 by the Free Pascal Development team
+#   Copyright (c) 1999-2013 by the Free Pascal Development team
 #
 #
 #   English (default) Language File for Free Pascal
 #   English (default) Language File for Free Pascal
 #
 #
@@ -1969,8 +1969,8 @@ sym_e_forward_type_not_resolved=05009_E_Forward type not resolved "$1"
 % A symbol was forward defined, but no declaration was encountered.
 % A symbol was forward defined, but no declaration was encountered.
 sym_e_only_static_in_static=05010_E_Only static variables can be used in static methods or outside methods
 sym_e_only_static_in_static=05010_E_Only static variables can be used in static methods or outside methods
 % A static method of an object can only access static variables.
 % A static method of an object can only access static variables.
-sym_f_type_must_be_rec_or_class=05012_F_record or class type expected
-% The variable or expression isn't of the type \var{record} or \var{class}.
+sym_e_type_must_be_rec_or_object_or_class=05012_E_Record or object or class type expected
+% The variable or expression isn't of the type \var{record} or \var{object} or \var{class}.
 sym_e_no_instance_of_abstract_object=05013_E_Instances of classes or objects with an abstract method are not allowed
 sym_e_no_instance_of_abstract_object=05013_E_Instances of classes or objects with an abstract method are not allowed
 % You are trying to generate an instance of a class which has an abstract
 % You are trying to generate an instance of a class which has an abstract
 % method that wasn't overridden.
 % method that wasn't overridden.
@@ -3055,6 +3055,9 @@ unit_u_indirect_crc_changed=10062_U_Indirect interface (objects/classes) CRC cha
 % in the interfaces of units directly or indirectly used by this unit in the interface) has been changed after the
 % in the interfaces of units directly or indirectly used by this unit in the interface) has been changed after the
 % implementation has been parsed.
 % implementation has been parsed.
 % \end{description}
 % \end{description}
+unit_u_ppu_invalid_memory_model=10063_U_PPU is compiled for another i8086 memory model
+% This unit file was compiled for a different i8086 memory model and
+% cannot be read.
 # EndOfTeX
 # EndOfTeX
 
 
 #
 #
@@ -3398,7 +3401,7 @@ S*2Aas_Assemble using GNU AS
 **2bl_Generate local symbol info
 **2bl_Generate local symbol info
 **1B_Build all modules
 **1B_Build all modules
 **1C<x>_Code generation options:
 **1C<x>_Code generation options:
-**2C3<x>_Turn on ieee error checking for constants
+**2C3_Turn on ieee error checking for constants
 **2Ca<x>_Select ABI, see fpc -i for possible values
 **2Ca<x>_Select ABI, see fpc -i for possible values
 **2Cb_Generate code for a big-endian variant of the target architecture
 **2Cb_Generate code for a big-endian variant of the target architecture
 **2Cc<x>_Set default calling convention to <x>
 **2Cc<x>_Set default calling convention to <x>
@@ -3409,6 +3412,7 @@ S*2Aas_Assemble using GNU AS
 **2Cg_Generate PIC code
 **2Cg_Generate PIC code
 **2Ch<n>_<n> bytes heap (between 1023 and 67107840)
 **2Ch<n>_<n> bytes heap (between 1023 and 67107840)
 **2Ci_IO-checking
 **2Ci_IO-checking
+A*2CI<x>_Select instruction set on ARM: ARM or THUMB
 **2Cn_Omit linking stage
 **2Cn_Omit linking stage
 P*2CN_Generate nil-pointer checks (AIX-only)
 P*2CN_Generate nil-pointer checks (AIX-only)
 **2Co_Check overflow of integer operations
 **2Co_Check overflow of integer operations
@@ -3426,10 +3430,12 @@ J*2CT<x>_Target-specific code generation options
 A*2CT<x>_Target-specific code generation options
 A*2CT<x>_Target-specific code generation options
 p*3CTsmalltoc_ Generate smaller TOCs at the expense of execution speed (AIX)
 p*3CTsmalltoc_ Generate smaller TOCs at the expense of execution speed (AIX)
 P*3CTsmalltoc_ Generate smaller TOCs at the expense of execution speed (AIX)
 P*3CTsmalltoc_ Generate smaller TOCs at the expense of execution speed (AIX)
+J*3CTautogetterprefix=X_  Automatically create getters for properties with prefix X (empty string disables)
+J*3CTautosetterprefix=X_  Automatically create setters for properties with prefix X (empty string disables)
 J*3CTcompactintarrayinit_ Generate smaller (but potentially slower) code for initializing integer array constants
 J*3CTcompactintarrayinit_ Generate smaller (but potentially slower) code for initializing integer array constants
-J*3CTenumfieldinit_ Initialize enumeration fields in constructors to enumtype(0), after calling inherited constructors
-J*3CTautogetterprefix=X_ Automatically create getters for properties with prefix X (empty string disables)
-J*3CTautosetterprefix=X_ Automatically create setters for properties with prefix X (empty string disables)
+J*3CTenumfieldinit_       Initialize enumeration fields in constructors to enumtype(0), after calling inherited constructors
+J*3CTinitlocals_          Initialize local variables that trigger a JVM bytecode verification error if used uninitialized (slows down code)
+J*3CTlowercaseprocstart_  Lowercase the first character of procedure/function/method names
 A*3CTthumbinterworking_ Generate Thumb interworking-safe code if possible
 A*3CTthumbinterworking_ Generate Thumb interworking-safe code if possible
 J*2Cv_Var/out parameter copy-out checking
 J*2Cv_Var/out parameter copy-out checking
 **2CX_Create also smartlinked library
 **2CX_Create also smartlinked library

+ 2 - 2
compiler/msg/errores.msg

@@ -1276,8 +1276,8 @@ sym_e_forward_type_not_resolved=05009_E_Tipo posterior no resuelto "$1"
 % A symbol was forward defined, but no declaration was encountered.
 % A symbol was forward defined, but no declaration was encountered.
 sym_e_only_static_in_static=05010_E_Solo las variables estáticas pueden ser usadas en métodos estáticos o fuera de métodos
 sym_e_only_static_in_static=05010_E_Solo las variables estáticas pueden ser usadas en métodos estáticos o fuera de métodos
 % A static method of an object can only access static variables.
 % A static method of an object can only access static variables.
-sym_f_type_must_be_rec_or_class=05012_F_tipo record o class esperado
-% The variable or expression isn't of the type \var{record} or \var{class}.
+sym_e_type_must_be_rec_or_object_or_class=05012_E_Record or object or class type expected
+% The variable or expression isn't of the type \var{record} or \var{object} or \var{class}.
 sym_e_no_instance_of_abstract_object=05013_E_No se permiten instancias de clases u objetos con un métodos abstractos
 sym_e_no_instance_of_abstract_object=05013_E_No se permiten instancias de clases u objetos con un métodos abstractos
 % You are trying to generate an instance of a class which has an abstract
 % You are trying to generate an instance of a class which has an abstract
 % method that wasn't overridden.
 % method that wasn't overridden.

+ 2 - 2
compiler/msg/errorf.msg

@@ -1058,8 +1058,8 @@ sym_e_invalid_call_tvarsymmangledname=05011_E_Invalid call to tvarsym.manglednam
 % An internal error occurred in the compiler; If you encounter such an error,
 % An internal error occurred in the compiler; If you encounter such an error,
 % please contact the developers and try to provide an exact description of
 % please contact the developers and try to provide an exact description of
 % the circumstances in which the error occurs.
 % the circumstances in which the error occurs.
-sym_f_type_must_be_rec_or_class=05012_F_record or class type expected
-% The variable or expression isn't of the type \var{record} or \var{class}.
+sym_e_type_must_be_rec_or_object_or_class=05012_E_Record or object or class type expected
+% The variable or expression isn't of the type \var{record} or \var{object} or \var{class}.
 sym_e_no_instance_of_abstract_object=05013_E_Instances of classes or objects with an abstract method are not allowed
 sym_e_no_instance_of_abstract_object=05013_E_Instances of classes or objects with an abstract method are not allowed
 % You are trying to generate an instance of a class which has an abstract
 % You are trying to generate an instance of a class which has an abstract
 % method that wasn't overridden.
 % method that wasn't overridden.

+ 2 - 2
compiler/msg/errorfi.msg

@@ -1358,8 +1358,8 @@ sym_e_forward_type_not_resolved=05009_E_D
 % A symbol was forward defined, but no declaration was encountered.
 % A symbol was forward defined, but no declaration was encountered.
 sym_e_only_static_in_static=05010_E_Seules les variables statiques peuvent être utilisées dans les méthodes statiques ou en dehors des méthodes
 sym_e_only_static_in_static=05010_E_Seules les variables statiques peuvent être utilisées dans les méthodes statiques ou en dehors des méthodes
 % A static method of an object can only access static variables.
 % A static method of an object can only access static variables.
-sym_f_type_must_be_rec_or_class=05012_F_Type record ou classe attendu
-% The variable or expression isn't of the type \var{record} or \var{class}.
+sym_e_type_must_be_rec_or_object_or_class=05012_E_Record or object or class type expected
+% The variable or expression isn't of the type \var{record} or \var{object} or \var{class}.
 sym_e_no_instance_of_abstract_object=05013_E_Les instances de classes ou les objets avec une méthode abstraite ne sont pas autorisés
 sym_e_no_instance_of_abstract_object=05013_E_Les instances de classes ou les objets avec une méthode abstraite ne sont pas autorisés
 % You are trying to generate an instance of a class which has an abstract
 % You are trying to generate an instance of a class which has an abstract
 % method that wasn't overridden.
 % method that wasn't overridden.

+ 2 - 2
compiler/msg/errorhe.msg

@@ -1457,8 +1457,8 @@ sym_e_forward_type_not_resolved=05009_E_
 % A symbol was forward defined, but no declaration was encountered.
 % A symbol was forward defined, but no declaration was encountered.
 sym_e_only_static_in_static=05010_E_ø÷ îùúðéí ñèèééí éëåìéí ìäéåú áùéîåù òí îúåãåú ñèèéåú àå îçåõ ìîèåãåú
 sym_e_only_static_in_static=05010_E_ø÷ îùúðéí ñèèééí éëåìéí ìäéåú áùéîåù òí îúåãåú ñèèéåú àå îçåõ ìîèåãåú
 % A static method of an object can only access static variables.
 % A static method of an object can only access static variables.
-sym_f_type_must_be_rec_or_class=05012_F_îöôä ìèéôåñ ùì øùåîä àå èéôåñ ùì îçì÷ä
-% The variable or expression isn't of the type \var{record} or \var{class}.
+sym_e_type_must_be_rec_or_object_or_class=05012_E_Record or object or class type expected
+% The variable or expression isn't of the type \var{record} or \var{object} or \var{class}.
 sym_e_no_instance_of_abstract_object=05013_E_àãâí ùì îçì÷åú àå àåáéé÷èéí òí îúåãåú abstract àéðí îåøùéí
 sym_e_no_instance_of_abstract_object=05013_E_àãâí ùì îçì÷åú àå àåáéé÷èéí òí îúåãåú abstract àéðí îåøùéí
 % You are trying to generate an instance of a class which has an abstract
 % You are trying to generate an instance of a class which has an abstract
 % method that wasn't overridden.
 % method that wasn't overridden.

+ 2 - 2
compiler/msg/errorheu.msg

@@ -1457,8 +1457,8 @@ sym_e_forward_type_not_resolved=05009_E_הגדרת הטיפוס לא הושלה
 % A symbol was forward defined, but no declaration was encountered.
 % A symbol was forward defined, but no declaration was encountered.
 sym_e_only_static_in_static=05010_E_רק משתנים סטטיים יכולים להיות בשימוש עם מתודות סטטיות או מחוץ למטודות
 sym_e_only_static_in_static=05010_E_רק משתנים סטטיים יכולים להיות בשימוש עם מתודות סטטיות או מחוץ למטודות
 % A static method of an object can only access static variables.
 % A static method of an object can only access static variables.
-sym_f_type_must_be_rec_or_class=05012_F_מצפה לטיפוס של רשומה או טיפוס של מחלקה
-% The variable or expression isn't of the type \var{record} or \var{class}.
+sym_e_type_must_be_rec_or_object_or_class=05012_E_Record or object or class type expected
+% The variable or expression isn't of the type \var{record} or \var{object} or \var{class}.
 sym_e_no_instance_of_abstract_object=05013_E_אדגם של מחלקות או אובייקטים עם מתודות abstract אינם מורשים
 sym_e_no_instance_of_abstract_object=05013_E_אדגם של מחלקות או אובייקטים עם מתודות abstract אינם מורשים
 % You are trying to generate an instance of a class which has an abstract
 % You are trying to generate an instance of a class which has an abstract
 % method that wasn't overridden.
 % method that wasn't overridden.

+ 2 - 2
compiler/msg/errorid.msg

@@ -1476,8 +1476,8 @@ sym_e_forward_type_not_resolved=05009_E_Tipe forward tidak memecahkan "$1"
 % Simbol forward didefinisikan, tapi tidak ada deklarasi yang ditemukan.
 % Simbol forward didefinisikan, tapi tidak ada deklarasi yang ditemukan.
 sym_e_only_static_in_static=05010_E_Hanya variabel statis bisa dipakai dalam metode statis atau di luar metode
 sym_e_only_static_in_static=05010_E_Hanya variabel statis bisa dipakai dalam metode statis atau di luar metode
 % Metode statis pada obyek hanya bisa mengakses variabel statis.
 % Metode statis pada obyek hanya bisa mengakses variabel statis.
-sym_f_type_must_be_rec_or_class=05012_F_tipe record atau class diharapkan
-% Variabel atau ekspresi bukan tipe \var{record} atau \var{class}.
+sym_e_type_must_be_rec_or_object_or_class=05012_E_Record or object or class type expected
+% The variable or expression isn't of the type \var{record} or \var{object} or \var{class}.
 sym_e_no_instance_of_abstract_object=05013_E_Turunan kelas atau obyek dengan metode abstrak tidak dibolehkan
 sym_e_no_instance_of_abstract_object=05013_E_Turunan kelas atau obyek dengan metode abstrak tidak dibolehkan
 % Anda mencoba untuk membuat turunan kelas yang memiliki metode abstrak yang
 % Anda mencoba untuk membuat turunan kelas yang memiliki metode abstrak yang
 % tidak diganti.
 % tidak diganti.

+ 2 - 2
compiler/msg/erroriu.msg

@@ -1568,8 +1568,8 @@ sym_e_forward_type_not_resolved=05009_E_Tipo "$1" dichiarato ma non implementato
 % A symbol was forward defined, but no declaration was encountered.
 % A symbol was forward defined, but no declaration was encountered.
 sym_e_only_static_in_static=05010_E_Al di fuori dei metodi o nei metodi statici si possono usare solo variabli statiche
 sym_e_only_static_in_static=05010_E_Al di fuori dei metodi o nei metodi statici si possono usare solo variabli statiche
 % A static method of an object can only access static variables.
 % A static method of an object can only access static variables.
-sym_f_type_must_be_rec_or_class=05012_F_Qui era atteso un tipo record o classe
-% The variable or expression isn't of the type \var{record} or \var{class}.
+sym_e_type_must_be_rec_or_object_or_class=05012_E_Record or object or class type expected
+% The variable or expression isn't of the type \var{record} or \var{object} or \var{class}.
 sym_e_no_instance_of_abstract_object=05013_E_Non sono permesse istanze di classi o di oggetti con un metodo astratto
 sym_e_no_instance_of_abstract_object=05013_E_Non sono permesse istanze di classi o di oggetti con un metodo astratto
 % You are trying to generate an instance of a class which has an abstract
 % You are trying to generate an instance of a class which has an abstract
 % method that wasn't overridden.
 % method that wasn't overridden.

+ 2 - 2
compiler/msg/errorn.msg

@@ -1331,8 +1331,8 @@ sym_e_forward_type_not_resolved=05009_E_Forward declaratie niet opgelost $1
 % A symbol was forward defined, but no declaration was encountered.
 % A symbol was forward defined, but no declaration was encountered.
 sym_e_only_static_in_static=05010_E_Alleen statische variabelen kunnen gebruikt worden in statische methoden
 sym_e_only_static_in_static=05010_E_Alleen statische variabelen kunnen gebruikt worden in statische methoden
 % A static method of an object can only access static variables.
 % A static method of an object can only access static variables.
-sym_f_type_must_be_rec_or_class=05012_F_Record- of klassetype verwacht
-% The variable or expression isn't of the type \var{record} or \var{class}.
+sym_e_type_must_be_rec_or_object_or_class=05012_E_Record or object or class type expected
+% The variable or expression isn't of the type \var{record} or \var{object} or \var{class}.
 sym_e_no_instance_of_abstract_object=05013_E_U kunt geen vertegenwoordiger van een klasse met abstracte methoden instantieren
 sym_e_no_instance_of_abstract_object=05013_E_U kunt geen vertegenwoordiger van een klasse met abstracte methoden instantieren
 % You are trying to generate an instance of a class which has an abstract
 % You are trying to generate an instance of a class which has an abstract
 % method that wasn't overridden.
 % method that wasn't overridden.

+ 2 - 2
compiler/msg/errorpl.msg

@@ -1281,8 +1281,8 @@ sym_e_forward_type_not_resolved=05009_E_Brak definicji typu $1
 % A symbol was forward defined, but no declaration was encountered.
 % A symbol was forward defined, but no declaration was encountered.
 sym_e_only_static_in_static=05010_E_Tylko zmienne statyczne mog¥ by† u¾ywane w metodach statycznych
 sym_e_only_static_in_static=05010_E_Tylko zmienne statyczne mog¥ by† u¾ywane w metodach statycznych
 % A static method of an object can only access static variables.
 % A static method of an object can only access static variables.
-sym_f_type_must_be_rec_or_class=05012_F_Oczekiwano rekordu lub klasy
-% The variable or expression isn't of the type \var{record} or \var{class}.
+sym_e_type_must_be_rec_or_object_or_class=05012_E_Record or object or class type expected
+% The variable or expression isn't of the type \var{record} or \var{object} or \var{class}.
 sym_e_no_instance_of_abstract_object=05013_E_Instancje klas i obiekt¢w z metodami abstrakcyjnymi niedozwolone
 sym_e_no_instance_of_abstract_object=05013_E_Instancje klas i obiekt¢w z metodami abstrakcyjnymi niedozwolone
 % You are trying to generate an instance of a class which has an abstract
 % You are trying to generate an instance of a class which has an abstract
 % method that wasn't overridden.
 % method that wasn't overridden.

+ 2 - 2
compiler/msg/errorpli.msg

@@ -1281,8 +1281,8 @@ sym_e_forward_type_not_resolved=05009_E_Brak definicji typu $1
 % A symbol was forward defined, but no declaration was encountered.
 % A symbol was forward defined, but no declaration was encountered.
 sym_e_only_static_in_static=05010_E_Tylko zmienne statyczne mog± byæ u¿ywane w metodach statycznych
 sym_e_only_static_in_static=05010_E_Tylko zmienne statyczne mog± byæ u¿ywane w metodach statycznych
 % A static method of an object can only access static variables.
 % A static method of an object can only access static variables.
-sym_f_type_must_be_rec_or_class=05012_F_Oczekiwano rekordu lub klasy
-% The variable or expression isn't of the type \var{record} or \var{class}.
+sym_e_type_must_be_rec_or_object_or_class=05012_E_Record or object or class type expected
+% The variable or expression isn't of the type \var{record} or \var{object} or \var{class}.
 sym_e_no_instance_of_abstract_object=05013_E_Instancje klas i obiektów z metodami abstrakcyjnymi niedozwolone
 sym_e_no_instance_of_abstract_object=05013_E_Instancje klas i obiektów z metodami abstrakcyjnymi niedozwolone
 % You are trying to generate an instance of a class which has an abstract
 % You are trying to generate an instance of a class which has an abstract
 % method that wasn't overridden.
 % method that wasn't overridden.

+ 2 - 2
compiler/msg/errorpt.msg

@@ -1834,8 +1834,8 @@ sym_e_forward_type_not_resolved=05009_E_Tipo posterior n
 % A symbol was forward defined, but no declaration was encountered.
 % A symbol was forward defined, but no declaration was encountered.
 sym_e_only_static_in_static=05010_E_Apenas vari veis est ticas podem ser usadas em m‚todos est ticos ou m‚todos externos
 sym_e_only_static_in_static=05010_E_Apenas vari veis est ticas podem ser usadas em m‚todos est ticos ou m‚todos externos
 % A static method of an object can only access static variables.
 % A static method of an object can only access static variables.
-sym_f_type_must_be_rec_or_class=05012_F_Tipo registro ou classe esperados
-% The variable or expression isn't of the type \var{record} or \var{class}.
+sym_e_type_must_be_rec_or_object_or_class=05012_E_Record or object or class type expected
+% The variable or expression isn't of the type \var{record} or \var{object} or \var{class}.
 sym_e_no_instance_of_abstract_object=05013_E_Instƒncias de classes ou objetos com m‚todos abstratos nÆo sÆo permitidas
 sym_e_no_instance_of_abstract_object=05013_E_Instƒncias de classes ou objetos com m‚todos abstratos nÆo sÆo permitidas
 % You are trying to generate an instance of a class which has an abstract
 % You are trying to generate an instance of a class which has an abstract
 % method that wasn't overridden.
 % method that wasn't overridden.

+ 2 - 2
compiler/msg/errorptu.msg

@@ -1834,8 +1834,8 @@ sym_e_forward_type_not_resolved=05009_E_Tipo posterior não resolvido "$1"
 % A symbol was forward defined, but no declaration was encountered.
 % A symbol was forward defined, but no declaration was encountered.
 sym_e_only_static_in_static=05010_E_Apenas variáveis estáticas podem ser usadas em métodos estáticos ou métodos externos
 sym_e_only_static_in_static=05010_E_Apenas variáveis estáticas podem ser usadas em métodos estáticos ou métodos externos
 % A static method of an object can only access static variables.
 % A static method of an object can only access static variables.
-sym_f_type_must_be_rec_or_class=05012_F_Tipo registro ou classe esperados
-% The variable or expression isn't of the type \var{record} or \var{class}.
+sym_e_type_must_be_rec_or_object_or_class=05012_E_Record or object or class type expected
+% The variable or expression isn't of the type \var{record} or \var{object} or \var{class}.
 sym_e_no_instance_of_abstract_object=05013_E_Instâncias de classes ou objetos com métodos abstratos não são permitidas
 sym_e_no_instance_of_abstract_object=05013_E_Instâncias de classes ou objetos com métodos abstratos não são permitidas
 % You are trying to generate an instance of a class which has an abstract
 % You are trying to generate an instance of a class which has an abstract
 % method that wasn't overridden.
 % method that wasn't overridden.

+ 2 - 2
compiler/msg/errorr.msg

@@ -1446,8 +1446,8 @@ sym_e_forward_type_not_resolved=05009_E_
 % ‘¨¬¢®« ¡ë« ®¡ê¥­ § à ­¥¥, ­® ®¯à¥¤¥«¥­¨¥ ¤«ï ­¥£® ­¥ ¡ë«® ®¡­ à㦥­®.
 % ‘¨¬¢®« ¡ë« ®¡ê¥­ § à ­¥¥, ­® ®¯à¥¤¥«¥­¨¥ ¤«ï ­¥£® ­¥ ¡ë«® ®¡­ à㦥­®.
 sym_e_only_static_in_static=05010_E_’®«ìª® áâ â¨ç¥áª¨¥ ¯¥à¥¬¥­­ë¥ ¬®£ã⠨ᯮ«ì§®¢ âìáï ¢ áâ â¨ç¥áª¨å ¬¥â®¤ å ¨«¨ ¢­¥ ¬¥â®¤®¢
 sym_e_only_static_in_static=05010_E_’®«ìª® áâ â¨ç¥áª¨¥ ¯¥à¥¬¥­­ë¥ ¬®£ã⠨ᯮ«ì§®¢ âìáï ¢ áâ â¨ç¥áª¨å ¬¥â®¤ å ¨«¨ ¢­¥ ¬¥â®¤®¢
 % ‘â â¨ç¥áª¨© ¬¥â®¤ ®¡ê¥ªâ  ¨¬¥¥â ¤®áâ㯠⮫쪮 ª áâ â¨ç¥áª¨¬ ¯¥à¥¬¥­­ë¬.
 % ‘â â¨ç¥áª¨© ¬¥â®¤ ®¡ê¥ªâ  ¨¬¥¥â ¤®áâ㯠⮫쪮 ª áâ â¨ç¥áª¨¬ ¯¥à¥¬¥­­ë¬.
-sym_f_type_must_be_rec_or_class=05012_F_ަ¨¤ ¥âáï ⨯ record ¨«¨ class
-% ¥à¥¬¥­­ ï ¨«¨ ¢ëà ¦¥­¨¥ ¨¬¥¥â ⨯, ®â«¨ç­ë© ®â \var{record} ¨«¨ \var{class}.
+sym_e_type_must_be_rec_or_object_or_class=05012_E_ަ¨¤ ¥âáï ⨯ record ¨«¨ object ¨«¨ class
+% ¥à¥¬¥­­ ï ¨«¨ ¢ëà ¦¥­¨¥ ¨¬¥¥â ⨯, ®â«¨ç­ë© ®â \var{record} ¨«¨ \var{object} ¨«¨ \var{class}.
 sym_e_no_instance_of_abstract_object=05013_E_ª§¥¬¯«ïàë ª« áᮢ ¨«¨ ®¡ê¥ªâ®¢ á  ¡áâp ªâ­ë¬ ¬¥â®¤®¬ ­¥ ¤®¯ã᪠îâáï
 sym_e_no_instance_of_abstract_object=05013_E_ª§¥¬¯«ïàë ª« áᮢ ¨«¨ ®¡ê¥ªâ®¢ á  ¡áâp ªâ­ë¬ ¬¥â®¤®¬ ­¥ ¤®¯ã᪠îâáï
 % ®¯ë⪠ á®§¤ âì íª§¥¬¯«ïà ª« áá  á  ¡áâà ªâ­ë¬ ¬¥â®¤®¬, ª®â®àë© ­¥ ¡ë« ¯¥à¥ªàëâ.
 % ®¯ë⪠ á®§¤ âì íª§¥¬¯«ïà ª« áá  á  ¡áâà ªâ­ë¬ ¬¥â®¤®¬, ª®â®àë© ­¥ ¡ë« ¯¥à¥ªàëâ.
 sym_w_label_not_defined=05014_W_Œ¥âª  "$1" ­¥ ®¯p¥¤¥«¥­ 
 sym_w_label_not_defined=05014_W_Œ¥âª  "$1" ­¥ ®¯p¥¤¥«¥­ 

+ 2 - 2
compiler/msg/errorru.msg

@@ -1446,8 +1446,8 @@ sym_e_forward_type_not_resolved=05009_E_Раннее объявление тип
 % Символ был объявлен заранее, но определение для него не было обнаружено.
 % Символ был объявлен заранее, но определение для него не было обнаружено.
 sym_e_only_static_in_static=05010_E_Только статические переменные могут использоваться в статических методах или вне методов
 sym_e_only_static_in_static=05010_E_Только статические переменные могут использоваться в статических методах или вне методов
 % Статический метод объекта имеет доступ только к статическим переменным.
 % Статический метод объекта имеет доступ только к статическим переменным.
-sym_f_type_must_be_rec_or_class=05012_F_Ожидается тип record или class
-% Переменная или выражение имеет тип, отличный от \var{record} или \var{class}.
+sym_e_type_must_be_rec_or_object_or_class=05012_E_Ожидается тип record или object или class
+% Переменная или выражение имеет тип, отличный от \var{record} или \var{object} или \var{class}.
 sym_e_no_instance_of_abstract_object=05013_E_Экземпляры классов или объектов с абстpактным методом не допускаются
 sym_e_no_instance_of_abstract_object=05013_E_Экземпляры классов или объектов с абстpактным методом не допускаются
 % Попытка создать экземпляр класса с абстрактным методом, который не был перекрыт.
 % Попытка создать экземпляр класса с абстрактным методом, который не был перекрыт.
 sym_w_label_not_defined=05014_W_Метка "$1" не опpеделена
 sym_w_label_not_defined=05014_W_Метка "$1" не опpеделена

+ 2 - 2
compiler/msg/errorues.msg

@@ -1270,8 +1270,8 @@ sym_e_forward_type_not_resolved=05009_E_Tipo posterior no resuelto "$1"
 % A symbol was forward defined, but no declaration was encountered.
 % A symbol was forward defined, but no declaration was encountered.
 sym_e_only_static_in_static=05010_E_Solo las variables estáticas pueden ser usadas en métodos estáticos o fuera de métodos
 sym_e_only_static_in_static=05010_E_Solo las variables estáticas pueden ser usadas en métodos estáticos o fuera de métodos
 % A static method of an object can only access static variables.
 % A static method of an object can only access static variables.
-sym_f_type_must_be_rec_or_class=05012_F_tipo record o class esperado
-% The variable or expression isn't of the type \var{record} or \var{class}.
+sym_e_type_must_be_rec_or_object_or_class=05012_E_Record or object or class type expected
+% The variable or expression isn't of the type \var{record} or \var{object} or \var{class}.
 sym_e_no_instance_of_abstract_object=05013_E_No se permiten instancias de clases u objetos con un métodos abstractos
 sym_e_no_instance_of_abstract_object=05013_E_No se permiten instancias de clases u objetos con un métodos abstractos
 % You are trying to generate an instance of a class which has an abstract
 % You are trying to generate an instance of a class which has an abstract
 % method that wasn't overridden.
 % method that wasn't overridden.

+ 4 - 3
compiler/msgidx.inc

@@ -552,7 +552,7 @@ const
   sym_e_error_in_type_def=05007;
   sym_e_error_in_type_def=05007;
   sym_e_forward_type_not_resolved=05009;
   sym_e_forward_type_not_resolved=05009;
   sym_e_only_static_in_static=05010;
   sym_e_only_static_in_static=05010;
-  sym_f_type_must_be_rec_or_class=05012;
+  sym_e_type_must_be_rec_or_object_or_class=05012;
   sym_e_no_instance_of_abstract_object=05013;
   sym_e_no_instance_of_abstract_object=05013;
   sym_w_label_not_defined=05014;
   sym_w_label_not_defined=05014;
   sym_e_label_used_and_not_defined=05015;
   sym_e_label_used_and_not_defined=05015;
@@ -903,6 +903,7 @@ const
   unit_u_unload_resunit=10060;
   unit_u_unload_resunit=10060;
   unit_e_different_wpo_file=10061;
   unit_e_different_wpo_file=10061;
   unit_u_indirect_crc_changed=10062;
   unit_u_indirect_crc_changed=10062;
+  unit_u_ppu_invalid_memory_model=10063;
   option_usage=11000;
   option_usage=11000;
   option_only_one_source_support=11001;
   option_only_one_source_support=11001;
   option_def_only_for_os2=11002;
   option_def_only_for_os2=11002;
@@ -976,9 +977,9 @@ const
   option_info=11024;
   option_info=11024;
   option_help_pages=11025;
   option_help_pages=11025;
 
 
-  MsgTxtSize = 69123;
+  MsgTxtSize = 69477;
 
 
   MsgIdxMax : array[1..20] of longint=(
   MsgIdxMax : array[1..20] of longint=(
-    26,95,335,121,88,56,126,27,202,63,
+    26,95,335,121,88,56,126,27,202,64,
     54,20,1,1,1,1,1,1,1,1
     54,20,1,1,1,1,1,1,1,1
   );
   );

+ 306 - 302
compiler/msgtxt.inc

@@ -1,7 +1,7 @@
 {$ifdef Delphi}
 {$ifdef Delphi}
-const msgtxt : array[0..000288] of string[240]=(
+const msgtxt : array[0..000289] of string[240]=(
 {$else Delphi}
 {$else Delphi}
-const msgtxt : array[0..000288,1..240] of char=(
+const msgtxt : array[0..000289,1..240] of char=(
 {$endif Delphi}
 {$endif Delphi}
   '01000_T_Compiler: $1'#000+
   '01000_T_Compiler: $1'#000+
   '01001_D_Compiler OS: $1'#000+
   '01001_D_Compiler OS: $1'#000+
@@ -692,333 +692,333 @@ const msgtxt : array[0..000288,1..240] of char=(
   '05009_E_Forward type',' not resolved "$1"'#000+
   '05009_E_Forward type',' not resolved "$1"'#000+
   '05010_E_Only static variables can be used in static methods or outside'+
   '05010_E_Only static variables can be used in static methods or outside'+
   ' methods'#000+
   ' methods'#000+
-  '05012_F_record or class type expected'#000+
+  '05012_E_Record or object or class type expected'#000+
   '05013_E_Instances of classes or objects with an abstract method are no'+
   '05013_E_Instances of classes or objects with an abstract method are no'+
   't allowed'#000+
   't allowed'#000+
-  '05014_W_Label not define','d "$1"'#000+
+  '05014_W_Label ','not defined "$1"'#000+
   '05015_E_Label used but not defined "$1"'#000+
   '05015_E_Label used but not defined "$1"'#000+
   '05016_E_Illegal label declaration'#000+
   '05016_E_Illegal label declaration'#000+
   '05017_E_GOTO and LABEL are not supported (use switch -Sg)'#000+
   '05017_E_GOTO and LABEL are not supported (use switch -Sg)'#000+
   '05018_E_Label not found'#000+
   '05018_E_Label not found'#000+
   '05019_E_identifier isn'#039't a label'#000+
   '05019_E_identifier isn'#039't a label'#000+
   '05020_E_label already defined'#000+
   '05020_E_label already defined'#000+
-  '05021_E_illega','l type declaration of set elements'#000+
+  '0502','1_E_illegal type declaration of set elements'#000+
   '05022_E_Forward class definition not resolved "$1"'#000+
   '05022_E_Forward class definition not resolved "$1"'#000+
   '05023_H_Unit "$1" not used in $2'#000+
   '05023_H_Unit "$1" not used in $2'#000+
   '05024_H_Parameter "$1" not used'#000+
   '05024_H_Parameter "$1" not used'#000+
   '05025_N_Local variable "$1" not used'#000+
   '05025_N_Local variable "$1" not used'#000+
-  '05026_H_Value parameter "$1" is assigned but never u','sed'#000+
+  '05026_H_Value parameter "$1" is assigned b','ut never used'#000+
   '05027_N_Local variable "$1" is assigned but never used'#000+
   '05027_N_Local variable "$1" is assigned but never used'#000+
   '05028_H_Local $1 "$2" is not used'#000+
   '05028_H_Local $1 "$2" is not used'#000+
   '05029_N_Private field "$1.$2" is never used'#000+
   '05029_N_Private field "$1.$2" is never used'#000+
   '05030_N_Private field "$1.$2" is assigned but never used'#000+
   '05030_N_Private field "$1.$2" is assigned but never used'#000+
-  '05031_N_Private method "$1.$2" never used'#000+
-  '0503','2_E_Set type expected'#000+
+  '05031_N_Private method "$1.$2" never',' used'#000+
+  '05032_E_Set type expected'#000+
   '05033_W_Function result does not seem to be set'#000+
   '05033_W_Function result does not seem to be set'#000+
   '05034_W_Type "$1" is not aligned correctly in current record for C'#000+
   '05034_W_Type "$1" is not aligned correctly in current record for C'#000+
   '05035_E_Unknown record field identifier "$1"'#000+
   '05035_E_Unknown record field identifier "$1"'#000+
-  '05036_W_Local variable "$1" does not seem to be initialize','d'#000+
+  '05036_W_Local variable "$1" does not seem to be ','initialized'#000+
   '05037_W_Variable "$1" does not seem to be initialized'#000+
   '05037_W_Variable "$1" does not seem to be initialized'#000+
   '05038_E_identifier idents no member "$1"'#000+
   '05038_E_identifier idents no member "$1"'#000+
   '05039_H_Found declaration: $1'#000+
   '05039_H_Found declaration: $1'#000+
   '05040_E_Data element too large'#000+
   '05040_E_Data element too large'#000+
   '05042_E_No matching implementation for interface method "$1" found'#000+
   '05042_E_No matching implementation for interface method "$1" found'#000+
-  '05043_W_Symbol ','"$1" is deprecated'#000+
+  '05043','_W_Symbol "$1" is deprecated'#000+
   '05044_W_Symbol "$1" is not portable'#000+
   '05044_W_Symbol "$1" is not portable'#000+
   '05055_W_Symbol "$1" is not implemented'#000+
   '05055_W_Symbol "$1" is not implemented'#000+
   '05056_E_Can'#039't create unique type from this type'#000+
   '05056_E_Can'#039't create unique type from this type'#000+
   '05057_H_Local variable "$1" does not seem to be initialized'#000+
   '05057_H_Local variable "$1" does not seem to be initialized'#000+
-  '05058_H_Variable "$1" does not seem to',' be initialized'#000+
+  '05058_H_Variable "$1" does n','ot seem to be initialized'#000+
   '05059_W_Function result variable does not seem to initialized'#000+
   '05059_W_Function result variable does not seem to initialized'#000+
   '05060_H_Function result variable does not seem to be initialized'#000+
   '05060_H_Function result variable does not seem to be initialized'#000+
   '05061_W_Variable "$1" read but nowhere assigned'#000+
   '05061_W_Variable "$1" read but nowhere assigned'#000+
   '05062_H_Found abstract method: $1'#000+
   '05062_H_Found abstract method: $1'#000+
-  '05063_W_Symbol ','"$1" is experimental'#000+
+  '05063','_W_Symbol "$1" is experimental'#000+
   '05064_W_Forward declaration "$1" not resolved, assumed external'#000+
   '05064_W_Forward declaration "$1" not resolved, assumed external'#000+
   '05065_W_Symbol "$1" is belongs to a library'#000+
   '05065_W_Symbol "$1" is belongs to a library'#000+
   '05066_W_Symbol "$1" is deprecated: "$2"'#000+
   '05066_W_Symbol "$1" is deprecated: "$2"'#000+
   '05067_E_Cannot find an enumerator for the type "$1"'#000+
   '05067_E_Cannot find an enumerator for the type "$1"'#000+
-  '05068_E_Cannot find',' a "MoveNext" method in enumerator "$1"'#000+
+  '05068_E_C','annot find a "MoveNext" method in enumerator "$1"'#000+
   '05069_E_Cannot find a "Current" property in enumerator "$1"'#000+
   '05069_E_Cannot find a "Current" property in enumerator "$1"'#000+
   '05070_E_Mismatch between number of declared parameters and number of c'+
   '05070_E_Mismatch between number of declared parameters and number of c'+
   'olons in message string.'#000+
   'olons in message string.'#000+
-  '05071_N_Private type "$1.$2" never used'#000+
-  '05072','_N_Private const "$1.$2" never used'#000+
+  '05071_N_Private type "$1.$2" never ','used'#000+
+  '05072_N_Private const "$1.$2" never used'#000+
   '05073_N_Private property "$1.$2" never used'#000+
   '05073_N_Private property "$1.$2" never used'#000+
   '05074_W_Unit "$1" is deprecated'#000+
   '05074_W_Unit "$1" is deprecated'#000+
   '05075_W_Unit "$1" is deprecated: "$2"'#000+
   '05075_W_Unit "$1" is deprecated: "$2"'#000+
   '05076_W_Unit "$1" is not portable'#000+
   '05076_W_Unit "$1" is not portable'#000+
   '05077_W_Unit "$1" is belongs to a library'#000+
   '05077_W_Unit "$1" is belongs to a library'#000+
-  '05078_W_Unit "','$1" is not implemented'#000+
+  '0507','8_W_Unit "$1" is not implemented'#000+
   '05079_W_Unit "$1" is experimental'#000+
   '05079_W_Unit "$1" is experimental'#000+
   '05080_E_No complete definition of the formally declared class "$1" is '+
   '05080_E_No complete definition of the formally declared class "$1" is '+
   'in scope'#000+
   'in scope'#000+
   '05081_E_Gotos into initialization or finalization blocks of units are '+
   '05081_E_Gotos into initialization or finalization blocks of units are '+
   'not allowed'#000+
   'not allowed'#000+
-  '05082_E_Invalid extern','al name "$1" for formal class "$2"'#000+
+  '05082_E_Inva','lid external name "$1" for formal class "$2"'#000+
   '05083_E_Complete class definition with external name "$1" here'#000+
   '05083_E_Complete class definition with external name "$1" here'#000+
   '05084_W_Possible library conflict: symbol "$1" from library "$2" also '+
   '05084_W_Possible library conflict: symbol "$1" from library "$2" also '+
   'found in library "$3"'#000+
   'found in library "$3"'#000+
-  '05085_E_Cannot add implicit constructor '#039'Create'#039' b','ecause ide'+
-  'ntifier already used by "$1"'#000+
+  '05085_E_Cannot add implicit constructor ',#039'Create'#039' because ident'+
+  'ifier already used by "$1"'#000+
   '05086_E_Cannot generate default constructor for class, because parent '+
   '05086_E_Cannot generate default constructor for class, because parent '+
   'has no parameterless constructor'#000+
   'has no parameterless constructor'#000+
   '05087_D_Adding helper for $1'#000+
   '05087_D_Adding helper for $1'#000+
   '06009_E_Parameter list size exceeds 65535 bytes'#000+
   '06009_E_Parameter list size exceeds 65535 bytes'#000+
-  '06012_E_File types mu','st be var parameters'#000+
+  '06012_E_Fil','e types must be var parameters'#000+
   '06013_E_The use of a far pointer isn'#039't allowed there'#000+
   '06013_E_The use of a far pointer isn'#039't allowed there'#000+
   '06015_E_EXPORT declared functions can'#039't be called'#000+
   '06015_E_EXPORT declared functions can'#039't be called'#000+
   '06016_W_Possible illegal call of constructor or destructor'#000+
   '06016_W_Possible illegal call of constructor or destructor'#000+
   '06017_N_Inefficient code'#000+
   '06017_N_Inefficient code'#000+
-  '06018_W_unreachable code'#000+
-  '06020_E','_Abstract methods can'#039't be called directly'#000+
+  '06018_W_unreachable co','de'#000+
+  '06020_E_Abstract methods can'#039't be called directly'#000+
   '06027_DL_Register $1 weight $2 $3'#000+
   '06027_DL_Register $1 weight $2 $3'#000+
   '06029_DL_Stack frame is omitted'#000+
   '06029_DL_Stack frame is omitted'#000+
   '06031_E_Object or class methods can'#039't be inline.'#000+
   '06031_E_Object or class methods can'#039't be inline.'#000+
   '06032_E_Procvar calls cannot be inline.'#000+
   '06032_E_Procvar calls cannot be inline.'#000+
-  '06033_E_No code for inline procedure store','d'#000+
+  '06033_E_No code for inline proce','dure stored'#000+
   '06035_E_Element zero of an ansi/wide- or longstring can'#039't be acces'+
   '06035_E_Element zero of an ansi/wide- or longstring can'#039't be acces'+
   'sed, use (set)length instead'#000+
   'sed, use (set)length instead'#000+
   '06037_E_Constructors or destructors cannot be called inside a '#039'wit'+
   '06037_E_Constructors or destructors cannot be called inside a '#039'wit'+
   'h'#039' clause'#000+
   'h'#039' clause'#000+
   '06038_E_Cannot call message handler methods directly'#000+
   '06038_E_Cannot call message handler methods directly'#000+
-  '06039_E_Jump i','n or outside of an exception block'#000+
+  '0603','9_E_Jump in or outside of an exception block'#000+
   '06040_E_Control flow statements aren'#039't allowed in a finally block'#000+
   '06040_E_Control flow statements aren'#039't allowed in a finally block'#000+
   '06041_W_Parameters size exceeds limit for certain cpu'#039's'#000+
   '06041_W_Parameters size exceeds limit for certain cpu'#039's'#000+
   '06042_W_Local variable size exceed limit for certain cpu'#039's'#000+
   '06042_W_Local variable size exceed limit for certain cpu'#039's'#000+
-  '06043_E_Local variables ','size exceeds supported limit'#000+
+  '06043_E_Local ','variables size exceeds supported limit'#000+
   '06044_E_BREAK not allowed'#000+
   '06044_E_BREAK not allowed'#000+
   '06045_E_CONTINUE not allowed'#000+
   '06045_E_CONTINUE not allowed'#000+
   '06046_F_Unknown compilerproc "$1". Check if you use the correct run ti'+
   '06046_F_Unknown compilerproc "$1". Check if you use the correct run ti'+
   'me library.'#000+
   'me library.'#000+
-  '06047_F_Cannot find system type "$1". Check if you use the correct run'+
-  ' tim','e library.'#000+
+  '06047_F_Cannot find system type "$1". Check if you use the corre','ct r'+
+  'un time library.'#000+
   '06048_H_Inherited call to abstract method ignored'#000+
   '06048_H_Inherited call to abstract method ignored'#000+
   '06049_E_Goto label "$1" not defined or optimized away'#000+
   '06049_E_Goto label "$1" not defined or optimized away'#000+
   '06050_F_Cannot find type "$1" in unit "$2". Check if you use the corre'+
   '06050_F_Cannot find type "$1" in unit "$2". Check if you use the corre'+
   'ct run time library.'#000+
   'ct run time library.'#000+
-  '06051_E_Interprocedural gotos are ','allowed only to outer subroutines'#000+
+  '06051_E_Interprocedural ','gotos are allowed only to outer subroutines'#000+
   '06052_E_Label must be defined in the same scope as it is declared'#000+
   '06052_E_Label must be defined in the same scope as it is declared'#000+
   '06053_E_Leaving procedures containing explicit or implicit exceptions '+
   '06053_E_Leaving procedures containing explicit or implicit exceptions '+
   'frames using goto is not allowed'#000+
   'frames using goto is not allowed'#000+
-  '06054_E_In ISO mode, the mod operator',' is defined only for positive q'+
+  '06054_E_In ISO mode, the mo','d operator is defined only for positive q'+
   'uotient'#000+
   'uotient'#000+
   '06055_DL_Auto inlining: $1'#000+
   '06055_DL_Auto inlining: $1'#000+
   '07000_DL_Starting $1 styled assembler parsing'#000+
   '07000_DL_Starting $1 styled assembler parsing'#000+
   '07001_DL_Finished $1 styled assembler parsing'#000+
   '07001_DL_Finished $1 styled assembler parsing'#000+
   '07002_E_Non-label pattern contains @'#000+
   '07002_E_Non-label pattern contains @'#000+
-  '07004_E_Error building record offset'#000+
-  '07005_E_','OFFSET used without identifier'#000+
+  '07004_E_Error building record offse','t'#000+
+  '07005_E_OFFSET used without identifier'#000+
   '07006_E_TYPE used without identifier'#000+
   '07006_E_TYPE used without identifier'#000+
   '07007_E_Cannot use local variable or parameters here'#000+
   '07007_E_Cannot use local variable or parameters here'#000+
   '07008_E_need to use OFFSET here'#000+
   '07008_E_need to use OFFSET here'#000+
   '07009_E_need to use $ here'#000+
   '07009_E_need to use $ here'#000+
   '07010_E_Cannot use multiple relocatable symbols'#000+
   '07010_E_Cannot use multiple relocatable symbols'#000+
-  '07011_E_Relo','catable symbol can only be added'#000+
+  '07','011_E_Relocatable symbol can only be added'#000+
   '07012_E_Invalid constant expression'#000+
   '07012_E_Invalid constant expression'#000+
   '07013_E_Relocatable symbol is not allowed'#000+
   '07013_E_Relocatable symbol is not allowed'#000+
   '07014_E_Invalid reference syntax'#000+
   '07014_E_Invalid reference syntax'#000+
   '07015_E_You cannot reach $1 from that code'#000+
   '07015_E_You cannot reach $1 from that code'#000+
-  '07016_E_Local symbols/labels aren'#039't allowed as refere','nces'#000+
+  '07016_E_Local symbols/labels aren'#039't allowed',' as references'#000+
   '07017_E_Invalid base and index register usage'#000+
   '07017_E_Invalid base and index register usage'#000+
   '07018_W_Possible error in object field handling'#000+
   '07018_W_Possible error in object field handling'#000+
   '07019_E_Wrong scale factor specified'#000+
   '07019_E_Wrong scale factor specified'#000+
   '07020_E_Multiple index register usage'#000+
   '07020_E_Multiple index register usage'#000+
   '07021_E_Invalid operand type'#000+
   '07021_E_Invalid operand type'#000+
-  '07022_E_Invalid string as opcode oper','and: $1'#000+
+  '07022_E_Invalid string as o','pcode operand: $1'#000+
   '07023_W_@CODE and @DATA not supported'#000+
   '07023_W_@CODE and @DATA not supported'#000+
   '07024_E_Null label references are not allowed'#000+
   '07024_E_Null label references are not allowed'#000+
   '07025_E_Divide by zero in asm evaluator'#000+
   '07025_E_Divide by zero in asm evaluator'#000+
   '07026_E_Illegal expression'#000+
   '07026_E_Illegal expression'#000+
   '07027_E_escape sequence ignored: $1'#000+
   '07027_E_escape sequence ignored: $1'#000+
   '07028_E_Invalid symbol reference'#000+
   '07028_E_Invalid symbol reference'#000+
-  '07029_W_Fwai','t can cause emulation problems with emu387'#000+
+  '07','029_W_Fwait can cause emulation problems with emu387'#000+
   '07030_W_$1 without operand translated into $1P'#000+
   '07030_W_$1 without operand translated into $1P'#000+
   '07031_W_ENTER instruction is not supported by Linux kernel'#000+
   '07031_W_ENTER instruction is not supported by Linux kernel'#000+
   '07032_W_Calling an overload function in assembler'#000+
   '07032_W_Calling an overload function in assembler'#000+
-  '07033_E_Unsupported symbol type for opera','nd'#000+
+  '07033_E_Unsupported symbol type',' for operand'#000+
   '07034_E_Constant value out of bounds'#000+
   '07034_E_Constant value out of bounds'#000+
   '07035_E_Error converting decimal $1'#000+
   '07035_E_Error converting decimal $1'#000+
   '07036_E_Error converting octal $1'#000+
   '07036_E_Error converting octal $1'#000+
   '07037_E_Error converting binary $1'#000+
   '07037_E_Error converting binary $1'#000+
   '07038_E_Error converting hexadecimal $1'#000+
   '07038_E_Error converting hexadecimal $1'#000+
   '07039_H_$1 translated to $2'#000+
   '07039_H_$1 translated to $2'#000+
-  '07040_W_$1 is associated to',' an overloaded function'#000+
+  '07040_W_$1 is ass','ociated to an overloaded function'#000+
   '07041_E_Cannot use SELF outside a method'#000+
   '07041_E_Cannot use SELF outside a method'#000+
   '07042_E_Cannot use OLDEBP outside a nested procedure'#000+
   '07042_E_Cannot use OLDEBP outside a nested procedure'#000+
   '07043_W_Procedures can'#039't return any value in asm code'#000+
   '07043_W_Procedures can'#039't return any value in asm code'#000+
   '07044_E_SEG not supported'#000+
   '07044_E_SEG not supported'#000+
-  '07045_E_Size suffix and destination or sou','rce size do not match'#000+
+  '07045_E_Size suffix and destinat','ion or source size do not match'#000+
   '07046_W_Size suffix and destination or source size do not match'#000+
   '07046_W_Size suffix and destination or source size do not match'#000+
   '07047_E_Assembler syntax error'#000+
   '07047_E_Assembler syntax error'#000+
   '07048_E_Invalid combination of opcode and operands'#000+
   '07048_E_Invalid combination of opcode and operands'#000+
   '07049_E_Assembler syntax error in operand'#000+
   '07049_E_Assembler syntax error in operand'#000+
-  '07050_E_Assembler syntax error',' in constant'#000+
+  '07050_E_Assembler sy','ntax error in constant'#000+
   '07051_E_Invalid String expression'#000+
   '07051_E_Invalid String expression'#000+
   '07052_W_constant with symbol $1 for address which is not on a pointer'#000+
   '07052_W_constant with symbol $1 for address which is not on a pointer'#000+
   '07053_E_Unrecognized opcode $1'#000+
   '07053_E_Unrecognized opcode $1'#000+
   '07054_E_Invalid or missing opcode'#000+
   '07054_E_Invalid or missing opcode'#000+
-  '07055_E_Invalid combination of prefix and opcode: $1'#000+
-  '07056','_E_Invalid combination of override and opcode: $1'#000+
+  '07055_E_Invalid combination of prefix and opcode',': $1'#000+
+  '07056_E_Invalid combination of override and opcode: $1'#000+
   '07057_E_Too many operands on line'#000+
   '07057_E_Too many operands on line'#000+
   '07058_W_NEAR ignored'#000+
   '07058_W_NEAR ignored'#000+
   '07059_W_FAR ignored'#000+
   '07059_W_FAR ignored'#000+
   '07060_E_Duplicate local symbol $1'#000+
   '07060_E_Duplicate local symbol $1'#000+
   '07061_E_Undefined local symbol $1'#000+
   '07061_E_Undefined local symbol $1'#000+
   '07062_E_Unknown label identifier $1'#000+
   '07062_E_Unknown label identifier $1'#000+
-  '07063_E_Inv','alid register name'#000+
+  '0','7063_E_Invalid register name'#000+
   '07064_E_Invalid floating point register name'#000+
   '07064_E_Invalid floating point register name'#000+
   '07066_W_Modulo not supported'#000+
   '07066_W_Modulo not supported'#000+
   '07067_E_Invalid floating point constant $1'#000+
   '07067_E_Invalid floating point constant $1'#000+
   '07068_E_Invalid floating point expression'#000+
   '07068_E_Invalid floating point expression'#000+
   '07069_E_Wrong symbol type'#000+
   '07069_E_Wrong symbol type'#000+
-  '07070_E_Cannot index a local var or ','parameter with a register'#000+
+  '07070_E_Cannot index a loc','al var or parameter with a register'#000+
   '07071_E_Invalid segment override expression'#000+
   '07071_E_Invalid segment override expression'#000+
   '07072_W_Identifier $1 supposed external'#000+
   '07072_W_Identifier $1 supposed external'#000+
   '07073_E_Strings not allowed as constants'#000+
   '07073_E_Strings not allowed as constants'#000+
   '07074_E_No type of variable specified'#000+
   '07074_E_No type of variable specified'#000+
-  '07075_E_assembler code not returned to text section',#000+
+  '07075_E_assembler code not returned to te','xt section'#000+
   '07076_E_Not a directive or local symbol $1'#000+
   '07076_E_Not a directive or local symbol $1'#000+
   '07077_E_Using a defined name as a local label'#000+
   '07077_E_Using a defined name as a local label'#000+
   '07078_E_Dollar token is used without an identifier'#000+
   '07078_E_Dollar token is used without an identifier'#000+
   '07079_W_32bit constant created for address'#000+
   '07079_W_32bit constant created for address'#000+
-  '07080_N_.align is target specific, use .balign or .p2ali','gn'#000+
+  '07080_N_.align is target specific, use .balign',' or .p2align'#000+
   '07081_E_Can'#039't access fields directly for parameters'#000+
   '07081_E_Can'#039't access fields directly for parameters'#000+
   '07082_E_Can'#039't access fields of objects/classes directly'#000+
   '07082_E_Can'#039't access fields of objects/classes directly'#000+
   '07083_E_No size specified and unable to determine the size of the oper'+
   '07083_E_No size specified and unable to determine the size of the oper'+
   'ands'#000+
   'ands'#000+
   '07084_E_Cannot use RESULT in this function'#000+
   '07084_E_Cannot use RESULT in this function'#000+
-  '07086_W_"$1','" without operand translated into "$1 %st,%st(1)"'#000+
+  '0','7086_W_"$1" without operand translated into "$1 %st,%st(1)"'#000+
   '07087_W_"$1 %st(n)" translated into "$1 %st,%st(n)"'#000+
   '07087_W_"$1 %st(n)" translated into "$1 %st,%st(n)"'#000+
   '07088_W_"$1 %st(n)" translated into "$1 %st(n),%st"'#000+
   '07088_W_"$1 %st(n)" translated into "$1 %st(n),%st"'#000+
   '07089_E_Char < not allowed here'#000+
   '07089_E_Char < not allowed here'#000+
   '07090_E_Char > not allowed here'#000+
   '07090_E_Char > not allowed here'#000+
-  '07093_W_ALIGN not supp','orted'#000+
+  '07093_W_ALIG','N not supported'#000+
   '07094_E_Inc and Dec cannot be together'#000+
   '07094_E_Inc and Dec cannot be together'#000+
   '07095_E_Invalid reglist for movem'#000+
   '07095_E_Invalid reglist for movem'#000+
   '07096_E_Reglist invalid for opcode'#000+
   '07096_E_Reglist invalid for opcode'#000+
   '07097_E_Higher cpu mode required ($1)'#000+
   '07097_E_Higher cpu mode required ($1)'#000+
   '07098_W_No size specified and unable to determine the size of the oper'+
   '07098_W_No size specified and unable to determine the size of the oper'+
-  'ands, using DWORD ','as default'#000+
+  'ands, us','ing DWORD as default'#000+
   '07099_E_Syntax error while trying to parse a shifter operand'#000+
   '07099_E_Syntax error while trying to parse a shifter operand'#000+
   '07100_E_Address of packed component is not at a byte boundary'#000+
   '07100_E_Address of packed component is not at a byte boundary'#000+
   '07101_W_No size specified and unable to determine the size of the oper'+
   '07101_W_No size specified and unable to determine the size of the oper'+
-  'ands, using BYTE as default'#000+
-  '07102_W_','Use of +offset(%ebp) for parameters invalid here'#000+
+  'ands, using BYTE as defaul','t'#000+
+  '07102_W_Use of +offset(%ebp) for parameters invalid here'#000+
   '07103_W_Use of +offset(%ebp) is not compatible with regcall convention'+
   '07103_W_Use of +offset(%ebp) is not compatible with regcall convention'+
   #000+
   #000+
   '07104_W_Use of -offset(%ebp) is not recommended for local variable acc'+
   '07104_W_Use of -offset(%ebp) is not recommended for local variable acc'+
   'ess'#000+
   'ess'#000+
-  '07105_W_Use of -offset(%esp), access may cause',' a crash or value may '+
+  '07105_W_Use of -offset(%esp), access',' may cause a crash or value may '+
   'be lost'#000+
   'be lost'#000+
   '07106_E_VMTOffset must be used in combination with a virtual method, a'+
   '07106_E_VMTOffset must be used in combination with a virtual method, a'+
   'nd "$1" is not virtual'#000+
   'nd "$1" is not virtual'#000+
   '07107_E_Generating PIC, but reference is not PIC-safe'#000+
   '07107_E_Generating PIC, but reference is not PIC-safe'#000+
-  '07108_E_All registers in a register set must be of the same kin','d and'+
+  '07108_E_All registers in a register set must be of th','e same kind and'+
   ' width'#000+
   ' width'#000+
   '07109_E_A register set cannot be empty'#000+
   '07109_E_A register set cannot be empty'#000+
   '07110_W_@GOTPCREL is useless and potentially dangereous for local symb'+
   '07110_W_@GOTPCREL is useless and potentially dangereous for local symb'+
   'ols'#000+
   'ols'#000+
   '07111_W_Constant with general purpose segment register'#000+
   '07111_W_Constant with general purpose segment register'#000+
   '07112_E_Invalid offset value for $1'#000+
   '07112_E_Invalid offset value for $1'#000+
-  '07113_E_Invalid register',' for $1'#000+
+  '07113_E_Invali','d register for $1'#000+
   '07114_E_SEH directives are allowed only in pure assembler procedures'#000+
   '07114_E_SEH directives are allowed only in pure assembler procedures'#000+
   '07115_E_Directive "$1" is not supported for the current target'#000+
   '07115_E_Directive "$1" is not supported for the current target'#000+
   '07116_E_This function'#039's result location cannot be encoded directly'+
   '07116_E_This function'#039's result location cannot be encoded directly'+
-  ' in a single operand when "nostack','frame" is used'#000+
+  ' in a single operand whe','n "nostackframe" is used'#000+
   '07117_E_GOTPCREL references in Intel assembler syntax cannot contain a'+
   '07117_E_GOTPCREL references in Intel assembler syntax cannot contain a'+
   ' base or index register, and their offset must 0.'#000+
   ' base or index register, and their offset must 0.'#000+
   '07118_E_The current target does not support GOTPCREL relocations'#000+
   '07118_E_The current target does not support GOTPCREL relocations'#000+
-  '07119_W_Exported/global symbols should a','ccessed via the GOT'#000+
+  '07119_W_Exported/global symbol','s should accessed via the GOT'#000+
   '07120_W_Check size of memory operand "$1"'#000+
   '07120_W_Check size of memory operand "$1"'#000+
   '07121_W_Check size of memory operand "$1: memory-operand-size is $2 bi'+
   '07121_W_Check size of memory operand "$1: memory-operand-size is $2 bi'+
   'ts, but expected [$3 bits]"'#000+
   'ts, but expected [$3 bits]"'#000+
-  '07122_W_Check size of memory operand "$1: memory-operand-size is $2 bi'+
-  'ts, but ex','pected [$3 bits + $4 byte offset]"'#000+
+  '07122_W_Check size of memory operand "$1: memory-operand-size is $2 bi',
+  'ts, but expected [$3 bits + $4 byte offset]"'#000+
   '07123_W_Check "$1: offset of memory operand is negative "$2 byte"'#000+
   '07123_W_Check "$1: offset of memory operand is negative "$2 byte"'#000+
   '07124_W_Check "$1: size of memory operand is empty, but es exists diff'+
   '07124_W_Check "$1: size of memory operand is empty, but es exists diff'+
-  'erent definitions of the memory size =>> map to $2 (smallest option)"',
-  #000+
+  'erent definitions of the memory size =>> map to $2 (smalles','t option)'+
+  '"'#000+
   '07125_E_Invalid register used in memory reference expression: "$1"'#000+
   '07125_E_Invalid register used in memory reference expression: "$1"'#000+
   '08000_F_Too many assembler files'#000+
   '08000_F_Too many assembler files'#000+
   '08001_F_Selected assembler output not supported'#000+
   '08001_F_Selected assembler output not supported'#000+
   '08002_F_Comp not supported'#000+
   '08002_F_Comp not supported'#000+
   '08003_F_Direct not support for binary writers'#000+
   '08003_F_Direct not support for binary writers'#000+
-  '08004_E_Allocating',' of data is only allowed in bss section'#000+
+  '08004_E_','Allocating of data is only allowed in bss section'#000+
   '08005_F_No binary writer selected'#000+
   '08005_F_No binary writer selected'#000+
   '08006_E_Asm: Opcode $1 not in table'#000+
   '08006_E_Asm: Opcode $1 not in table'#000+
   '08007_E_Asm: $1 invalid combination of opcode and operands'#000+
   '08007_E_Asm: $1 invalid combination of opcode and operands'#000+
   '08008_E_Asm: 16 Bit references not supported'#000+
   '08008_E_Asm: 16 Bit references not supported'#000+
-  '08009_E_Asm: Invalid effec','tive address'#000+
+  '08009_E_Asm: Inv','alid effective address'#000+
   '08010_E_Asm: Immediate or reference expected'#000+
   '08010_E_Asm: Immediate or reference expected'#000+
   '08011_E_Asm: $1 value exceeds bounds $2'#000+
   '08011_E_Asm: $1 value exceeds bounds $2'#000+
   '08012_E_Asm: Short jump is out of range $1'#000+
   '08012_E_Asm: Short jump is out of range $1'#000+
   '08013_E_Asm: Undefined label $1'#000+
   '08013_E_Asm: Undefined label $1'#000+
   '08014_E_Asm: Comp type not supported for this target'#000+
   '08014_E_Asm: Comp type not supported for this target'#000+
-  '08015_E_Asm: E','xtended type not supported for this target'#000+
+  '0801','5_E_Asm: Extended type not supported for this target'#000+
   '08016_E_Asm: Duplicate label $1'#000+
   '08016_E_Asm: Duplicate label $1'#000+
   '08017_E_Asm: Redefined label $1'#000+
   '08017_E_Asm: Redefined label $1'#000+
   '08018_E_Asm: First defined here'#000+
   '08018_E_Asm: First defined here'#000+
   '08019_E_Asm: Invalid register $1'#000+
   '08019_E_Asm: Invalid register $1'#000+
   '08020_E_Asm: 16 or 32 Bit references not supported'#000+
   '08020_E_Asm: 16 or 32 Bit references not supported'#000+
-  '08021_E_Asm: 64 B','it operands not supported'#000+
+  '08021_E','_Asm: 64 Bit operands not supported'#000+
   '08022_E_Asm: AH,BH,CH or DH cannot be used in an instruction requiring'+
   '08022_E_Asm: AH,BH,CH or DH cannot be used in an instruction requiring'+
   ' REX prefix'#000+
   ' REX prefix'#000+
   '08023_E_Missing .seh_endprologue directive'#000+
   '08023_E_Missing .seh_endprologue directive'#000+
   '08024_E_Function prologue exceeds 255 bytes'#000+
   '08024_E_Function prologue exceeds 255 bytes'#000+
-  '08025_E_.seh_handlerdata directive without pr','eceding .seh_handler'#000+
+  '08025_E_.seh_handlerdata directive ','without preceding .seh_handler'#000+
   '08026_F_Relocation count for section $1 exceeds 65535'#000+
   '08026_F_Relocation count for section $1 exceeds 65535'#000+
   '09000_W_Source operating system redefined'#000+
   '09000_W_Source operating system redefined'#000+
   '09001_I_Assembling (pipe) $1'#000+
   '09001_I_Assembling (pipe) $1'#000+
   '09002_E_Can'#039't create assembler file: $1'#000+
   '09002_E_Can'#039't create assembler file: $1'#000+
-  '09003_E_Can'#039't create object file: $1 (error code: $2)'#000,
+  '09003_E_Can'#039't create object file: $1 (error ','code: $2)'#000+
   '09004_E_Can'#039't create archive file: $1'#000+
   '09004_E_Can'#039't create archive file: $1'#000+
   '09005_E_Assembler $1 not found, switching to external assembling'#000+
   '09005_E_Assembler $1 not found, switching to external assembling'#000+
   '09006_T_Using assembler: $1'#000+
   '09006_T_Using assembler: $1'#000+
   '09007_E_Error while assembling exitcode $1'#000+
   '09007_E_Error while assembling exitcode $1'#000+
-  '09008_E_Can'#039't call the assembler, error $1 switching to external a',
-  'ssembling'#000+
+  '09008_E_Can'#039't call the assembler, error $1 switching to ','external'+
+  ' assembling'#000+
   '09009_I_Assembling $1'#000+
   '09009_I_Assembling $1'#000+
   '09010_I_Assembling with smartlinking $1'#000+
   '09010_I_Assembling with smartlinking $1'#000+
   '09011_W_Object $1 not found, Linking may fail !'#000+
   '09011_W_Object $1 not found, Linking may fail !'#000+
   '09012_W_Library $1 not found, Linking may fail !'#000+
   '09012_W_Library $1 not found, Linking may fail !'#000+
   '09013_E_Error while linking'#000+
   '09013_E_Error while linking'#000+
-  '09014_E_Can'#039't call the linker, switching to',' external linking'#000+
+  '09014_E_Can'#039't call the linker, sw','itching to external linking'#000+
   '09015_I_Linking $1'#000+
   '09015_I_Linking $1'#000+
   '09016_E_Util $1 not found, switching to external linking'#000+
   '09016_E_Util $1 not found, switching to external linking'#000+
   '09017_T_Using util $1'#000+
   '09017_T_Using util $1'#000+
   '09018_E_Creation of Executables not supported'#000+
   '09018_E_Creation of Executables not supported'#000+
   '09019_E_Creation of Dynamic/Shared Libraries not supported'#000+
   '09019_E_Creation of Dynamic/Shared Libraries not supported'#000+
-  '09020_I_Closing scr','ipt $1'#000+
+  '09020_I_C','losing script $1'#000+
   '09021_E_resource compiler "$1" not found, switching to external mode'#000+
   '09021_E_resource compiler "$1" not found, switching to external mode'#000+
   '09022_I_Compiling resource $1'#000+
   '09022_I_Compiling resource $1'#000+
   '09023_T_unit $1 can'#039't be statically linked, switching to smart lin'+
   '09023_T_unit $1 can'#039't be statically linked, switching to smart lin'+
   'king'#000+
   'king'#000+
-  '09024_T_unit $1 can'#039't be smart linked, switching to static link','i'+
+  '09024_T_unit $1 can'#039't be smart linked, switching to s','tatic linki'+
   'ng'#000+
   'ng'#000+
   '09025_T_unit $1 can'#039't be shared linked, switching to static linkin'+
   '09025_T_unit $1 can'#039't be shared linked, switching to static linkin'+
   'g'#000+
   'g'#000+
   '09026_E_unit $1 can'#039't be smart or static linked'#000+
   '09026_E_unit $1 can'#039't be smart or static linked'#000+
   '09027_E_unit $1 can'#039't be shared or static linked'#000+
   '09027_E_unit $1 can'#039't be shared or static linked'#000+
-  '09028_D_Calling resource compiler "$1" with "$2" as command line'#000+
-  '09029_','E_Error while compiling resources'#000+
+  '09028_D_Calling resource compiler "$1" with "$2" as command l','ine'#000+
+  '09029_E_Error while compiling resources'#000+
   '09030_E_Can'#039't call the resource compiler "$1", switching to extern'+
   '09030_E_Can'#039't call the resource compiler "$1", switching to extern'+
   'al mode'#000+
   'al mode'#000+
   '09031_E_Can'#039't open resource file "$1"'#000+
   '09031_E_Can'#039't open resource file "$1"'#000+
   '09032_E_Can'#039't write resource file "$1"'#000+
   '09032_E_Can'#039't write resource file "$1"'#000+
-  '09033_N_File "$1" not found for backquoted cat command'#000,
+  '09033_N_File "$1" not found for backquoted ca','t command'#000+
   '09034_W_"$1" not found, this will probably cause a linking failure'#000+
   '09034_W_"$1" not found, this will probably cause a linking failure'#000+
   '09128_F_Can'#039't post process executable $1'#000+
   '09128_F_Can'#039't post process executable $1'#000+
   '09129_F_Can'#039't open executable $1'#000+
   '09129_F_Can'#039't open executable $1'#000+
   '09130_X_Size of Code: $1 bytes'#000+
   '09130_X_Size of Code: $1 bytes'#000+
   '09131_X_Size of initialized data: $1 bytes'#000+
   '09131_X_Size of initialized data: $1 bytes'#000+
-  '09132_X_Size of uninitial','ized data: $1 bytes'#000+
+  '09132_X_Size of',' uninitialized data: $1 bytes'#000+
   '09133_X_Stack space reserved: $1 bytes'#000+
   '09133_X_Stack space reserved: $1 bytes'#000+
   '09134_X_Stack space committed: $1 bytes'#000+
   '09134_X_Stack space committed: $1 bytes'#000+
   '09200_F_Executable image size is too big for $1 target.'#000+
   '09200_F_Executable image size is too big for $1 target.'#000+
   '09201_W_Object file "$1" contains 32-bit absolute relocation to symbol'+
   '09201_W_Object file "$1" contains 32-bit absolute relocation to symbol'+
-  ' "$2".'#000+
-  '10000_T_','Unitsearch: $1'#000+
+  ' "$2"','.'#000+
+  '10000_T_Unitsearch: $1'#000+
   '10001_T_PPU Loading $1'#000+
   '10001_T_PPU Loading $1'#000+
   '10002_U_PPU Name: $1'#000+
   '10002_U_PPU Name: $1'#000+
   '10003_U_PPU Flags: $1'#000+
   '10003_U_PPU Flags: $1'#000+
@@ -1027,170 +1027,171 @@ const msgtxt : array[0..000288,1..240] of char=(
   '10006_U_PPU File too short'#000+
   '10006_U_PPU File too short'#000+
   '10007_U_PPU Invalid Header (no PPU at the begin)'#000+
   '10007_U_PPU Invalid Header (no PPU at the begin)'#000+
   '10008_U_PPU Invalid Version $1'#000+
   '10008_U_PPU Invalid Version $1'#000+
-  '10009_U_PPU',' is compiled for another processor'#000+
+  '1','0009_U_PPU is compiled for another processor'#000+
   '10010_U_PPU is compiled for another target'#000+
   '10010_U_PPU is compiled for another target'#000+
   '10011_U_PPU Source: $1'#000+
   '10011_U_PPU Source: $1'#000+
   '10012_U_Writing $1'#000+
   '10012_U_Writing $1'#000+
   '10013_F_Can'#039't Write PPU-File'#000+
   '10013_F_Can'#039't Write PPU-File'#000+
   '10014_F_Error reading PPU-File'#000+
   '10014_F_Error reading PPU-File'#000+
   '10015_F_unexpected end of PPU-File'#000+
   '10015_F_unexpected end of PPU-File'#000+
-  '10016_F_Invalid PPU-File ','entry: $1'#000+
+  '10016_F_Invalid',' PPU-File entry: $1'#000+
   '10017_F_PPU Dbx count problem'#000+
   '10017_F_PPU Dbx count problem'#000+
   '10018_E_Illegal unit name: $1'#000+
   '10018_E_Illegal unit name: $1'#000+
   '10019_F_Too much units'#000+
   '10019_F_Too much units'#000+
   '10020_F_Circular unit reference between $1 and $2'#000+
   '10020_F_Circular unit reference between $1 and $2'#000+
   '10021_F_Can'#039't compile unit $1, no sources available'#000+
   '10021_F_Can'#039't compile unit $1, no sources available'#000+
-  '10022_F_Can'#039't find unit $1 used by $2'#000+
-  '10023_W','_Unit $1 was not found but $2 exists'#000+
+  '10022_F_Can'#039't find unit $1 used by ','$2'#000+
+  '10023_W_Unit $1 was not found but $2 exists'#000+
   '10024_F_Unit $1 searched but $2 found'#000+
   '10024_F_Unit $1 searched but $2 found'#000+
   '10025_W_Compiling the system unit requires the -Us switch'#000+
   '10025_W_Compiling the system unit requires the -Us switch'#000+
   '10026_F_There were $1 errors compiling module, stopping'#000+
   '10026_F_There were $1 errors compiling module, stopping'#000+
   '10027_U_Load from $1 ($2) unit $3'#000+
   '10027_U_Load from $1 ($2) unit $3'#000+
-  '10028_U_Recompili','ng $1, checksum changed for $2'#000+
+  '10028_U','_Recompiling $1, checksum changed for $2'#000+
   '10029_U_Recompiling $1, source found only'#000+
   '10029_U_Recompiling $1, source found only'#000+
   '10030_U_Recompiling unit, static lib is older than ppufile'#000+
   '10030_U_Recompiling unit, static lib is older than ppufile'#000+
   '10031_U_Recompiling unit, shared lib is older than ppufile'#000+
   '10031_U_Recompiling unit, shared lib is older than ppufile'#000+
-  '10032_U_Recompiling unit, obj and asm are older t','han ppufile'#000+
+  '10032_U_Recompiling unit, obj and asm a','re older than ppufile'#000+
   '10033_U_Recompiling unit, obj is older than asm'#000+
   '10033_U_Recompiling unit, obj is older than asm'#000+
   '10034_U_Parsing interface of $1'#000+
   '10034_U_Parsing interface of $1'#000+
   '10035_U_Parsing implementation of $1'#000+
   '10035_U_Parsing implementation of $1'#000+
   '10036_U_Second load for unit $1'#000+
   '10036_U_Second load for unit $1'#000+
   '10037_U_PPU Check file $1 time $2'#000+
   '10037_U_PPU Check file $1 time $2'#000+
-  '10040_W_Can'#039't recompile unit $1, but found mo','difed include files'+
+  '10040_W_Can'#039't recompile unit $1, bu','t found modifed include files'+
   #000+
   #000+
   '10041_U_File $1 is newer than the one used for creating PPU file $2'#000+
   '10041_U_File $1 is newer than the one used for creating PPU file $2'#000+
   '10042_U_Trying to use a unit which was compiled with a different FPU m'+
   '10042_U_Trying to use a unit which was compiled with a different FPU m'+
   'ode'#000+
   'ode'#000+
   '10043_U_Loading interface units from $1'#000+
   '10043_U_Loading interface units from $1'#000+
-  '10044_U_Loading implementation units f','rom $1'#000+
+  '10044_U_Loading implementati','on units from $1'#000+
   '10045_U_Interface CRC changed for unit $1'#000+
   '10045_U_Interface CRC changed for unit $1'#000+
   '10046_U_Implementation CRC changed for unit $1'#000+
   '10046_U_Implementation CRC changed for unit $1'#000+
   '10047_U_Finished compiling unit $1'#000+
   '10047_U_Finished compiling unit $1'#000+
   '10048_U_Adding dependency: $1 depends on $2'#000+
   '10048_U_Adding dependency: $1 depends on $2'#000+
   '10049_U_No reload, is caller: $1'#000+
   '10049_U_No reload, is caller: $1'#000+
-  '10050_U_No reload, already in se','cond compile: $1'#000+
+  '10050_U_No reload, alr','eady in second compile: $1'#000+
   '10051_U_Flag for reload: $1'#000+
   '10051_U_Flag for reload: $1'#000+
   '10052_U_Forced reloading'#000+
   '10052_U_Forced reloading'#000+
   '10053_U_Previous state of $1: $2'#000+
   '10053_U_Previous state of $1: $2'#000+
   '10054_U_Already compiling $1, setting second compile'#000+
   '10054_U_Already compiling $1, setting second compile'#000+
   '10055_U_Loading unit $1'#000+
   '10055_U_Loading unit $1'#000+
   '10056_U_Finished loading unit $1'#000+
   '10056_U_Finished loading unit $1'#000+
-  '10057_U_Registering new uni','t $1'#000+
+  '10057_U_Registeri','ng new unit $1'#000+
   '10058_U_Re-resolving unit $1'#000+
   '10058_U_Re-resolving unit $1'#000+
   '10059_U_Skipping re-resolving unit $1, still loading used units'#000+
   '10059_U_Skipping re-resolving unit $1, still loading used units'#000+
   '10060_U_Unloading resource unit $1 (not needed)'#000+
   '10060_U_Unloading resource unit $1 (not needed)'#000+
   '10061_E_Unit $1 was compiled using a different whole program optimizat'+
   '10061_E_Unit $1 was compiled using a different whole program optimizat'+
-  'ion feedback input ($2, ','$3); recompile it without wpo or use the sam'+
+  'ion feedback i','nput ($2, $3); recompile it without wpo or use the sam'+
   'e wpo feedback input file for this compilation invocation'#000+
   'e wpo feedback input file for this compilation invocation'#000+
   '10062_U_Indirect interface (objects/classes) CRC changed for unit $1'#000+
   '10062_U_Indirect interface (objects/classes) CRC changed for unit $1'#000+
-  '11000_O_$1 [options] <inputfile> [options]'#000+
-  '11001_W_Only one source fi','le supported, changing source file to comp'+
-  'ile from "$1" into "$2"'#000+
+  '10063_U_PPU is compiled for another i8086 memory model'#000+
+  '1100','0_O_$1 [options] <inputfile> [options]'#000+
+  '11001_W_Only one source file supported, changing source file to compil'+
+  'e from "$1" into "$2"'#000+
   '11002_W_DEF file can be created only for OS/2'#000+
   '11002_W_DEF file can be created only for OS/2'#000+
   '11003_E_nested response files are not supported'#000+
   '11003_E_nested response files are not supported'#000+
-  '11004_F_No source file name in command line'#000+
-  '11005_N_No option inside $1 config f','ile'#000+
+  '11004_F_No sour','ce file name in command line'#000+
+  '11005_N_No option inside $1 config file'#000+
   '11006_E_Illegal parameter: $1'#000+
   '11006_E_Illegal parameter: $1'#000+
   '11007_H_-? writes help pages'#000+
   '11007_H_-? writes help pages'#000+
   '11008_F_Too many config files nested'#000+
   '11008_F_Too many config files nested'#000+
   '11009_F_Unable to open file $1'#000+
   '11009_F_Unable to open file $1'#000+
   '11010_D_Reading further options from $1'#000+
   '11010_D_Reading further options from $1'#000+
-  '11011_W_Target is already set to: $1'#000+
-  '11012_W_Shared libs not supporte','d on DOS platform, reverting to stat'+
-  'ic'#000+
+  '1101','1_W_Target is already set to: $1'#000+
+  '11012_W_Shared libs not supported on DOS platform, reverting to static'+
+  #000+
   '11013_F_In options file $1 at line $2 too many \var{\#IF(N)DEFs} encou'+
   '11013_F_In options file $1 at line $2 too many \var{\#IF(N)DEFs} encou'+
   'ntered'#000+
   'ntered'#000+
-  '11014_F_In options file $1 at line $2 unexpected \var{\#ENDIFs} encoun'+
-  'tered'#000+
-  '11015_F_Open conditional at the end of the optio','ns file'#000+
+  '11014_F_In options file $1 at line $2 unexpected \var{\#END','IFs} enco'+
+  'untered'#000+
+  '11015_F_Open conditional at the end of the options file'#000+
   '11016_W_Debug information generation is not supported by this executab'+
   '11016_W_Debug information generation is not supported by this executab'+
   'le'#000+
   'le'#000+
   '11017_H_Try recompiling with -dGDB'#000+
   '11017_H_Try recompiling with -dGDB'#000+
   '11018_W_You are using the obsolete switch $1'#000+
   '11018_W_You are using the obsolete switch $1'#000+
-  '11019_W_You are using the obsolete switch $1, please use $2'#000+
-  '11020_N_Switching a','ssembler to default source writing assembler'#000+
+  '11019_W_You ar','e using the obsolete switch $1, please use $2'#000+
+  '11020_N_Switching assembler to default source writing assembler'#000+
   '11021_W_Assembler output selected "$1" is not compatible with "$2"'#000+
   '11021_W_Assembler output selected "$1" is not compatible with "$2"'#000+
   '11022_W_"$1" assembler use forced'#000+
   '11022_W_"$1" assembler use forced'#000+
-  '11026_T_Reading options from file $1'#000+
+  '11026_T_Reading options from ','file $1'#000+
   '11027_T_Reading options from environment $1'#000+
   '11027_T_Reading options from environment $1'#000+
-  '11028_D_Handl','ing option "$1"'#000+
+  '11028_D_Handling option "$1"'#000+
   '11029_O_*** press enter ***'#000+
   '11029_O_*** press enter ***'#000+
   '11030_H_Start of reading config file $1'#000+
   '11030_H_Start of reading config file $1'#000+
   '11031_H_End of reading config file $1'#000+
   '11031_H_End of reading config file $1'#000+
   '11032_D_interpreting option "$1"'#000+
   '11032_D_interpreting option "$1"'#000+
-  '11036_D_interpreting firstpass option "$1"'#000+
+  '11036_D_interpreting',' firstpass option "$1"'#000+
   '11033_D_interpreting file option "$1"'#000+
   '11033_D_interpreting file option "$1"'#000+
-  '1103','4_D_Reading config file "$1"'#000+
+  '11034_D_Reading config file "$1"'#000+
   '11035_D_found source file name "$1"'#000+
   '11035_D_found source file name "$1"'#000+
   '11039_E_Unknown codepage "$1"'#000+
   '11039_E_Unknown codepage "$1"'#000+
   '11040_F_Config file $1 is a directory'#000+
   '11040_F_Config file $1 is a directory'#000+
-  '11041_W_Assembler output selected "$1" cannot generate debug info, deb'+
-  'ugging disabled'#000+
-  '11042_W_Use of ppc386','.cfg is deprecated, please use fpc.cfg instead'#000+
+  '11041_W_Assembler output selected "$1" can','not generate debug info, d'+
+  'ebugging disabled'#000+
+  '11042_W_Use of ppc386.cfg is deprecated, please use fpc.cfg instead'#000+
   '11043_F_In options file $1 at line $2 \var{\#ELSE} directive without \'+
   '11043_F_In options file $1 at line $2 \var{\#ELSE} directive without \'+
   'var{\#IF(N)DEF} found'#000+
   'var{\#IF(N)DEF} found'#000+
-  '11044_F_Option "$1" is not, or not yet, supported on the current targe'+
-  't platform'#000+
-  '11045_F_The feature ','"$1" is not, or not yet, supported on the select'+
-  'ed target platform'#000+
+  '11044_F_Option "$1" is not, or not y','et, supported on the current tar'+
+  'get platform'#000+
+  '11045_F_The feature "$1" is not, or not yet, supported on the selected'+
+  ' target platform'#000+
   '11046_N_DWARF debug information cannot be used with smart linking on t'+
   '11046_N_DWARF debug information cannot be used with smart linking on t'+
-  'his target, switching to static linking'#000+
-  '11047_W_Option "$1" is ignored for the current target platform.',#000+
+  'his target, switching to static linkin','g'#000+
+  '11047_W_Option "$1" is ignored for the current target platform.'#000+
   '11048_W_Disabling external debug information because it is unsupported'+
   '11048_W_Disabling external debug information because it is unsupported'+
   ' for the selected target/debug format combination.'#000+
   ' for the selected target/debug format combination.'#000+
-  '11049_N_DWARF debug information cannot be used with smart linking with'+
-  ' external assembler, disabling static library cr','eation.'#000+
+  '11049_N_DWARF debug information cannot be used with s','mart linking wi'+
+  'th external assembler, disabling static library creation.'#000+
   '11050_E_Invalid value for MACOSX_DEPLOYMENT_TARGET environment variabl'+
   '11050_E_Invalid value for MACOSX_DEPLOYMENT_TARGET environment variabl'+
   'e: $1'#000+
   'e: $1'#000+
   '11051_E_Invalid value for IPHONEOS_DEPLOYMENT_TARGET environment varia'+
   '11051_E_Invalid value for IPHONEOS_DEPLOYMENT_TARGET environment varia'+
   'ble: $1'#000+
   'ble: $1'#000+
-  '11052_E_You must use a FPU type of VFPV2, VFPV3 or VFPV3_D16 when usin'+
-  'g the EA','BIHF ABI target'#000+
+  '11052_E_You m','ust use a FPU type of VFPV2, VFPV3 or VFPV3_D16 when us'+
+  'ing the EABIHF ABI target'#000+
   '11053_W_The selected debug format is not supported on the current targ'+
   '11053_W_The selected debug format is not supported on the current targ'+
   'et, not changing the current setting'#000+
   'et, not changing the current setting'#000+
-  '12000_F_Cannot open whole program optimization feedback file "$1"'#000+
-  '12001_D_Processing whole program optimization infor','mation in wpo fee'+
-  'dback file "$1"'#000+
+  '12000_F_Cannot open whole program optimization feedb','ack file "$1"'#000+
+  '12001_D_Processing whole program optimization information in wpo feedb'+
+  'ack file "$1"'#000+
   '12002_D_Finished processing the whole program optimization information'+
   '12002_D_Finished processing the whole program optimization information'+
   ' in wpo feedback file "$1"'#000+
   ' in wpo feedback file "$1"'#000+
-  '12003_E_Expected section header, but got "$2" at line $1 of wpo feedba'+
-  'ck file'#000+
-  '12004_W_No handler registered fo','r whole program optimization section'+
-  ' "$2" at line $1 of wpo feedback file, ignoring'#000+
+  '12003_E_Expected section header, but got "$2"',' at line $1 of wpo feed'+
+  'back file'#000+
+  '12004_W_No handler registered for whole program optimization section "'+
+  '$2" at line $1 of wpo feedback file, ignoring'#000+
   '12005_D_Found whole program optimization section "$1" with information'+
   '12005_D_Found whole program optimization section "$1" with information'+
   ' about "$2"'#000+
   ' about "$2"'#000+
-  '12006_F_The selected whole program optimizations require a previously '+
-  'gene','rated feedback file (use -Fw to specify)'#000+
+  '12006_F_T','he selected whole program optimizations require a previousl'+
+  'y generated feedback file (use -Fw to specify)'#000+
   '12007_E_No collected information necessary to perform "$1" whole progr'+
   '12007_E_No collected information necessary to perform "$1" whole progr'+
   'am optimization found'#000+
   'am optimization found'#000+
-  '12008_F_Specify a whole program optimization feedback file to store th'+
-  'e generated info in (using -FW)'#000+
-  '12009','_E_Not generating any whole program optimization information, y'+
-  'et a feedback file was specified (using -FW)'#000+
-  '12010_E_Not performing any whole program optimizations, yet an input f'+
-  'eedback file was specified (using -Fw)'#000+
-  '12011_D_Skipping whole ','program optimization section "$1", because no'+
-  't needed by the requested optimizations'#000+
+  '12008_F_Specify a whole program optimizati','on feedback file to store '+
+  'the generated info in (using -FW)'#000+
+  '12009_E_Not generating any whole program optimization information, yet'+
+  ' a feedback file was specified (using -FW)'#000+
+  '12010_E_Not performing any whole program optimizations, yet an inpu','t'+
+  ' feedback file was specified (using -Fw)'#000+
+  '12011_D_Skipping whole program optimization section "$1", because not '+
+  'needed by the requested optimizations'#000+
   '12012_W_Overriding previously read information for "$1" from feedback '+
   '12012_W_Overriding previously read information for "$1" from feedback '+
-  'input file using information in section "$2"'#000+
-  '12013_E_Cannot extract symbol liveness i','nformation from program when'+
-  ' stripping symbols, use -Xs-'#000+
+  'input file using inf','ormation in section "$2"'#000+
+  '12013_E_Cannot extract symbol liveness information from program when s'+
+  'tripping symbols, use -Xs-'#000+
   '12014_E_Cannot extract symbol liveness information from program when w'+
   '12014_E_Cannot extract symbol liveness information from program when w'+
   'hen not linking'#000+
   'hen not linking'#000+
-  '12015_F_Cannot find "$1" or "$2" to extract symbol liveness informatio'+
-  'n from linked program'#000+
-  '12016','_E_Error during reading symbol liveness information produced by'+
-  ' "$1"'#000+
+  '12015_F_Cannot find "$1" or "$2"',' to extract symbol liveness informat'+
+  'ion from linked program'#000+
+  '12016_E_Error during reading symbol liveness information produced by "'+
+  '$1"'#000+
   '12017_F_Error executing "$1" (exitcode: $2) to extract symbol informat'+
   '12017_F_Error executing "$1" (exitcode: $2) to extract symbol informat'+
   'ion from linked program'#000+
   'ion from linked program'#000+
-  '12018_E_Collection of symbol liveness information can only help when u'+
-  'sing sm','art linking, use -CX -XX'#000+
+  '12018_E_Coll','ection of symbol liveness information can only help when'+
+  ' using smart linking, use -CX -XX'#000+
   '12019_E_Cannot create specified whole program optimisation feedback fi'+
   '12019_E_Cannot create specified whole program optimisation feedback fi'+
   'le "$1"'#000+
   'le "$1"'#000+
   '11023_Free Pascal Compiler version $FPCFULLVERSION [$FPCDATE] for $FPC'+
   '11023_Free Pascal Compiler version $FPCFULLVERSION [$FPCDATE] for $FPC'+
-  'CPU'#010+
+  'CP','U'#010+
   'Copyright (c) 1993-2013 by Florian Klaempfl and others'#000+
   'Copyright (c) 1993-2013 by Florian Klaempfl and others'#000+
-  '11024_Fr','ee Pascal Compiler version $FPCVERSION'#010+
+  '11024_Free Pascal Compiler version $FPCVERSION'#010+
   #010+
   #010+
   'Compiler Date      : $FPCDATE'#010+
   'Compiler Date      : $FPCDATE'#010+
   'Compiler CPU Target: $FPCCPU'#010+
   'Compiler CPU Target: $FPCCPU'#010+
@@ -1199,11 +1200,11 @@ const msgtxt : array[0..000288,1..240] of char=(
   '  $OSTARGETS'#010+
   '  $OSTARGETS'#010+
   #010+
   #010+
   'Supported CPU instruction sets:'#010+
   'Supported CPU instruction sets:'#010+
-  '  $INSTRUCTIONSETS'#010+
+  '  $INSTRUC','TIONSETS'#010+
   #010+
   #010+
   'Supported FPU instruction sets:'#010+
   'Supported FPU instruction sets:'#010+
   '  $FPUINSTRUCTIONSETS'#010+
   '  $FPUINSTRUCTIONSETS'#010+
-  #010,
+  #010+
   'Supported ABI targets:'#010+
   'Supported ABI targets:'#010+
   '  $ABITARGETS'#010+
   '  $ABITARGETS'#010+
   #010+
   #010+
@@ -1214,381 +1215,384 @@ const msgtxt : array[0..000288,1..240] of char=(
   '  All'#010+
   '  All'#010+
   '  $WPOPTIMIZATIONS'#010+
   '  $WPOPTIMIZATIONS'#010+
   #010+
   #010+
-  'Supported Microcontroller types:'#010+
+  'Supported Microcontroller typ','es:'#010+
   '  $CONTROLLERTYPES'#010+
   '  $CONTROLLERTYPES'#010+
   #010+
   #010+
-  'This program comes under the GNU General ','Public Licence'#010+
+  'This program comes under the GNU General Public Licence'#010+
   'For more information read COPYING.v2'#010+
   'For more information read COPYING.v2'#010+
   #010+
   #010+
   'Please report bugs in our bug tracker on:'#010+
   'Please report bugs in our bug tracker on:'#010+
   '                 http://bugs.freepascal.org'#010+
   '                 http://bugs.freepascal.org'#010+
   #010+
   #010+
-  'More information may be found on our WWW pages (including directions'#010+
-  'for mailing lists useful for as','king questions or discussing potentia'+
-  'l'#010+
+  'More information may be found on ou','r WWW pages (including directions'+
+  #010+
+  'for mailing lists useful for asking questions or discussing potential'#010+
   'new features, etc.):'#010+
   'new features, etc.):'#010+
   '                 http://www.freepascal.org'#000+
   '                 http://www.freepascal.org'#000+
   '11025_**0*_Put + after a boolean switch option to enable it, - to disa'+
   '11025_**0*_Put + after a boolean switch option to enable it, - to disa'+
-  'ble it'#010+
-  '**1a_The compiler doesn'#039't delete the generated assembler fil','e'#010+
+  'bl','e it'#010+
+  '**1a_The compiler doesn'#039't delete the generated assembler file'#010+
   '**2al_List sourcecode lines in assembler file'#010+
   '**2al_List sourcecode lines in assembler file'#010+
   '**2an_List node info in assembler file (-dEXTDEBUG compiler)'#010+
   '**2an_List node info in assembler file (-dEXTDEBUG compiler)'#010+
   '*L2ap_Use pipes instead of creating temporary assembler files'#010+
   '*L2ap_Use pipes instead of creating temporary assembler files'#010+
-  '**2ar_List register allocation/release info in assembler file'#010+
-  '**2at_L','ist temp allocation/release info in assembler file'#010+
+  '**2a','r_List register allocation/release info in assembler file'#010+
+  '**2at_List temp allocation/release info in assembler file'#010+
   '**1A<x>_Output format:'#010+
   '**1A<x>_Output format:'#010+
   '**2Adefault_Use default assembler'#010+
   '**2Adefault_Use default assembler'#010+
   '3*2Aas_Assemble using GNU AS'#010+
   '3*2Aas_Assemble using GNU AS'#010+
-  '3*2Amacho_Mach-O (Darwin, Intel 32 bit) using internal writer'#010+
-  '3*2Anasmcoff_COFF (Go32v2) file using Nas','m'#010+
+  '3*2Amacho_Mach-O (Darwin, Intel 32 bit',') using internal writer'#010+
+  '3*2Anasmcoff_COFF (Go32v2) file using Nasm'#010+
   '3*2Anasmelf_ELF32 (Linux) file using Nasm'#010+
   '3*2Anasmelf_ELF32 (Linux) file using Nasm'#010+
   '3*2Anasmwin32_Win32 object file using Nasm'#010+
   '3*2Anasmwin32_Win32 object file using Nasm'#010+
   '3*2Anasmwdosx_Win32/WDOSX object file using Nasm'#010+
   '3*2Anasmwdosx_Win32/WDOSX object file using Nasm'#010+
   '3*2Awasm_Obj file using Wasm (Watcom)'#010+
   '3*2Awasm_Obj file using Wasm (Watcom)'#010+
-  '3*2Anasmobj_Obj file using Nasm'#010+
-  '3*2Amasm_Obj file using Masm (Micr','osoft)'#010+
+  '3','*2Anasmobj_Obj file using Nasm'#010+
+  '3*2Amasm_Obj file using Masm (Microsoft)'#010+
   '3*2Atasm_Obj file using Tasm (Borland)'#010+
   '3*2Atasm_Obj file using Tasm (Borland)'#010+
   '3*2Aelf_ELF (Linux) using internal writer'#010+
   '3*2Aelf_ELF (Linux) using internal writer'#010+
   '3*2Acoff_COFF (Go32v2) using internal writer'#010+
   '3*2Acoff_COFF (Go32v2) using internal writer'#010+
-  '3*2Apecoff_PE-COFF (Win32) using internal writer'#010+
+  '3*2Apecoff_PE-COFF (Win32) using internal ','writer'#010+
   '4*2Aas_Assemble using GNU AS'#010+
   '4*2Aas_Assemble using GNU AS'#010+
-  '4*2Agas_Assemble using GNU GA','S'#010+
+  '4*2Agas_Assemble using GNU GAS'#010+
   '4*2Agas-darwin_Assemble darwin Mach-O64 using GNU GAS'#010+
   '4*2Agas-darwin_Assemble darwin Mach-O64 using GNU GAS'#010+
   '4*2Amasm_Win64 object file using ml64 (Microsoft)'#010+
   '4*2Amasm_Win64 object file using ml64 (Microsoft)'#010+
   '4*2Apecoff_PE-COFF (Win64) using internal writer'#010+
   '4*2Apecoff_PE-COFF (Win64) using internal writer'#010+
-  '4*2Aelf_ELF (Linux-64bit) using internal writer'#010+
+  '4*2Aelf_ELF (Linux-6','4bit) using internal writer'#010+
   '6*2Aas_Unix o-file using GNU AS'#010+
   '6*2Aas_Unix o-file using GNU AS'#010+
-  '6*2Ag','as_GNU Motorola assembler'#010+
+  '6*2Agas_GNU Motorola assembler'#010+
   '6*2Amit_MIT Syntax (old GAS)'#010+
   '6*2Amit_MIT Syntax (old GAS)'#010+
   '6*2Amot_Standard Motorola assembler'#010+
   '6*2Amot_Standard Motorola assembler'#010+
   'A*2Aas_Assemble using GNU AS'#010+
   'A*2Aas_Assemble using GNU AS'#010+
   'P*2Aas_Assemble using GNU AS'#010+
   'P*2Aas_Assemble using GNU AS'#010+
-  'S*2Aas_Assemble using GNU AS'#010+
+  'S*2Aas_Assemble using GNU ','AS'#010+
   '**1b_Generate browser info'#010+
   '**1b_Generate browser info'#010+
   '**2bl_Generate local symbol info'#010+
   '**2bl_Generate local symbol info'#010+
-  '**','1B_Build all modules'#010+
+  '**1B_Build all modules'#010+
   '**1C<x>_Code generation options:'#010+
   '**1C<x>_Code generation options:'#010+
-  '**2C3<x>_Turn on ieee error checking for constants'#010+
+  '**2C3_Turn on ieee error checking for constants'#010+
   '**2Ca<x>_Select ABI, see fpc -i for possible values'#010+
   '**2Ca<x>_Select ABI, see fpc -i for possible values'#010+
-  '**2Cb_Generate code for a big-endian variant of the target architectur'+
-  'e'#010+
-  '**2Cc<x>_Se','t default calling convention to <x>'#010+
+  '**2Cb_Generate code f','or a big-endian variant of the target architect'+
+  'ure'#010+
+  '**2Cc<x>_Set default calling convention to <x>'#010+
   '**2CD_Create also dynamic library (not supported)'#010+
   '**2CD_Create also dynamic library (not supported)'#010+
   '**2Ce_Compilation with emulated floating point opcodes'#010+
   '**2Ce_Compilation with emulated floating point opcodes'#010+
-  '**2Cf<x>_Select fpu instruction set to use, see fpc -i for possible va'+
-  'lues'#010+
-  '**2CF<x>_Minimal floatin','g point constant precision (default, 32, 64)'+
-  #010+
+  '**2Cf<x>_Select fpu instruction set t','o use, see fpc -i for possible '+
+  'values'#010+
+  '**2CF<x>_Minimal floating point constant precision (default, 32, 64)'#010+
   '**2Cg_Generate PIC code'#010+
   '**2Cg_Generate PIC code'#010+
   '**2Ch<n>_<n> bytes heap (between 1023 and 67107840)'#010+
   '**2Ch<n>_<n> bytes heap (between 1023 and 67107840)'#010+
   '**2Ci_IO-checking'#010+
   '**2Ci_IO-checking'#010+
+  'A*2CI<x>_Select instruction set on ARM:',' ARM or THUMB'#010+
   '**2Cn_Omit linking stage'#010+
   '**2Cn_Omit linking stage'#010+
   'P*2CN_Generate nil-pointer checks (AIX-only)'#010+
   'P*2CN_Generate nil-pointer checks (AIX-only)'#010+
-  '**2Co_Check overflow of integer',' operations'#010+
+  '**2Co_Check overflow of integer operations'#010+
   '**2CO_Check for possible overflow of integer operations'#010+
   '**2CO_Check for possible overflow of integer operations'#010+
-  '**2Cp<x>_Select instruction set, see fpc -i for possible values'#010+
+  '**2Cp<x>_Select instruction set, see fpc -i for possible ','values'#010+
   '**2CP<x>=<y>_ packing settings'#010+
   '**2CP<x>=<y>_ packing settings'#010+
   '**3CPPACKSET=<y>_ <y> set allocation: 0, 1 or DEFAULT or NORMAL, 2, 4 '+
   '**3CPPACKSET=<y>_ <y> set allocation: 0, 1 or DEFAULT or NORMAL, 2, 4 '+
   'and 8'#010+
   'and 8'#010+
-  '*','*2Cr_Range checking'#010+
+  '**2Cr_Range checking'#010+
   '**2CR_Verify object method call validity'#010+
   '**2CR_Verify object method call validity'#010+
   '**2Cs<n>_Set stack checking size to <n>'#010+
   '**2Cs<n>_Set stack checking size to <n>'#010+
-  '**2Ct_Stack checking (for testing only, see manual)'#010+
+  '**2Ct_Stack checking (fo','r testing only, see manual)'#010+
   'p*2CT<x>_Target-specific code generation options'#010+
   'p*2CT<x>_Target-specific code generation options'#010+
-  'P*2CT<x>_Target-specific code generati','on options'#010+
+  'P*2CT<x>_Target-specific code generation options'#010+
   'J*2CT<x>_Target-specific code generation options'#010+
   'J*2CT<x>_Target-specific code generation options'#010+
   'A*2CT<x>_Target-specific code generation options'#010+
   'A*2CT<x>_Target-specific code generation options'#010+
-  'p*3CTsmalltoc_ Generate smaller TOCs at the expense of execution speed'+
-  ' (AIX)'#010+
-  'P*3CTsmalltoc_ Generate smaller TOCs at the expense of',' execution spe'+
+  'p*3CTsmalltoc_ G','enerate smaller TOCs at the expense of execution spe'+
   'ed (AIX)'#010+
   'ed (AIX)'#010+
+  'P*3CTsmalltoc_ Generate smaller TOCs at the expense of execution speed'+
+  ' (AIX)'#010+
+  'J*3CTautogetterprefix=X_  Automatically create getters for properties '+
+  'with prefix X (empty string disa','bles)'#010+
+  'J*3CTautosetterprefix=X_  Automatically create setters for properties '+
+  'with prefix X (empty string disables)'#010+
   'J*3CTcompactintarrayinit_ Generate smaller (but potentially slower) co'+
   'J*3CTcompactintarrayinit_ Generate smaller (but potentially slower) co'+
   'de for initializing integer array constants'#010+
   'de for initializing integer array constants'#010+
-  'J*3CTenumfieldinit_ Initialize enumeration fields in constructors to e'+
-  'numtype(0), after calling inherit','ed constructors'#010+
-  'J*3CTautogetterprefix=X_ Automatically create getters for properties w'+
-  'ith prefix X (empty string disables)'#010+
-  'J*3CTautosetterprefix=X_ Automatically create setters for properties w'+
-  'ith prefix X (empty string disables)'#010+
-  'A*3CTthumb','interworking_ Generate Thumb interworking-safe code if pos'+
-  'sible'#010+
+  'J*3CTenumfie','ldinit_       Initialize enumeration fields in construct'+
+  'ors to enumtype(0), after calling inherited constructors'#010+
+  'J*3CTinitlocals_          Initialize local variables that trigger a JV'+
+  'M bytecode verification error if used uninitialized (slow','s down code'+
+  ')'#010+
+  'J*3CTlowercaseprocstart_  Lowercase the first character of procedure/f'+
+  'unction/method names'#010+
+  'A*3CTthumbinterworking_ Generate Thumb interworking-safe code if possi'+
+  'ble'#010+
   'J*2Cv_Var/out parameter copy-out checking'#010+
   'J*2Cv_Var/out parameter copy-out checking'#010+
-  '**2CX_Create also smartlinked library'#010+
+  '**2CX_Create also sm','artlinked library'#010+
   '**1d<x>_Defines the symbol <x>'#010+
   '**1d<x>_Defines the symbol <x>'#010+
   '**1D_Generate a DEF file'#010+
   '**1D_Generate a DEF file'#010+
   '**2Dd<x>_Set description to <x>'#010+
   '**2Dd<x>_Set description to <x>'#010+
-  '**2Dv<x>','_Set DLL version to <x>'#010+
+  '**2Dv<x>_Set DLL version to <x>'#010+
   '*O2Dw_PM application'#010+
   '*O2Dw_PM application'#010+
   '**1e<x>_Set path to executable'#010+
   '**1e<x>_Set path to executable'#010+
   '**1E_Same as -Cn'#010+
   '**1E_Same as -Cn'#010+
   '**1fPIC_Same as -Cg'#010+
   '**1fPIC_Same as -Cg'#010+
-  '**1F<x>_Set file names and paths:'#010+
+  '**1F<x>_Set f','ile names and paths:'#010+
   '**2Fa<x>[,y]_(for a program) load units <x> and [y] before uses is par'+
   '**2Fa<x>[,y]_(for a program) load units <x> and [y] before uses is par'+
   'sed'#010+
   'sed'#010+
-  '**2Fc<x>_Set input ','codepage to <x>'#010+
+  '**2Fc<x>_Set input codepage to <x>'#010+
   '**2FC<x>_Set RC compiler binary name to <x>'#010+
   '**2FC<x>_Set RC compiler binary name to <x>'#010+
   '**2Fd_Disable the compiler'#039's internal directory cache'#010+
   '**2Fd_Disable the compiler'#039's internal directory cache'#010+
-  '**2FD<x>_Set the directory where to search for compiler utilities'#010+
+  '**2FD<x>_Set',' the directory where to search for compiler utilities'#010+
   '**2Fe<x>_Redirect error output to <x>'#010+
   '**2Fe<x>_Redirect error output to <x>'#010+
-  '**2Ff<x>_Add <x> to fr','amework path (Darwin only)'#010+
+  '**2Ff<x>_Add <x> to framework path (Darwin only)'#010+
   '**2FE<x>_Set exe/unit output path to <x>'#010+
   '**2FE<x>_Set exe/unit output path to <x>'#010+
   '**2Fi<x>_Add <x> to include path'#010+
   '**2Fi<x>_Add <x> to include path'#010+
-  '**2Fl<x>_Add <x> to library path'#010+
+  '**2Fl<x>_Add <x> to libra','ry path'#010+
   '**2FL<x>_Use <x> as dynamic linker'#010+
   '**2FL<x>_Use <x> as dynamic linker'#010+
   '**2Fm<x>_Load unicode conversion table from <x>.txt in the compiler di'+
   '**2Fm<x>_Load unicode conversion table from <x>.txt in the compiler di'+
-  'r',#010+
+  'r'#010+
   '**2Fo<x>_Add <x> to object path'#010+
   '**2Fo<x>_Add <x> to object path'#010+
   '**2Fr<x>_Load error message file <x>'#010+
   '**2Fr<x>_Load error message file <x>'#010+
   '**2FR<x>_Set resource (.res) linker to <x>'#010+
   '**2FR<x>_Set resource (.res) linker to <x>'#010+
-  '**2Fu<x>_Add <x> to unit path'#010+
+  '**2Fu<x>_Add ','<x> to unit path'#010+
   '**2FU<x>_Set unit output path to <x>, overrides -FE'#010+
   '**2FU<x>_Set unit output path to <x>, overrides -FE'#010+
-  '**2FW<x>_Store generated whole-program optimi','zation feedback in <x>'#010+
+  '**2FW<x>_Store generated whole-program optimization feedback in <x>'#010+
   '**2Fw<x>_Load previously stored whole-program optimization feedback fr'+
   '**2Fw<x>_Load previously stored whole-program optimization feedback fr'+
   'om <x>'#010+
   'om <x>'#010+
-  '*g1g_Generate debug information (default format for target)'#010+
+  '*g1g_Generate debug inform','ation (default format for target)'#010+
   '*g2gc_Generate checks for pointers'#010+
   '*g2gc_Generate checks for pointers'#010+
-  '*g2gh_Use heaptrace unit (for memory leak/cor','ruption debugging)'#010+
+  '*g2gh_Use heaptrace unit (for memory leak/corruption debugging)'#010+
   '*g2gl_Use line info unit (show more info with backtraces)'#010+
   '*g2gl_Use line info unit (show more info with backtraces)'#010+
   '*g2go<x>_Set debug information options'#010+
   '*g2go<x>_Set debug information options'#010+
-  '*g3godwarfsets_ Enable DWARF '#039'set'#039' type debug information (bre'+
-  'aks gdb < 6.5)'#010+
-  '*g3gostabsabsincludes_ Store absolute/full incl','ude file paths in Sta'+
-  'bs'#010+
+  '*g3godwarf','sets_ Enable DWARF '#039'set'#039' type debug information (b'+
+  'reaks gdb < 6.5)'#010+
+  '*g3gostabsabsincludes_ Store absolute/full include file paths in Stabs'+
+  #010+
   '*g3godwarfmethodclassprefix_ Prefix method names in DWARF with class n'+
   '*g3godwarfmethodclassprefix_ Prefix method names in DWARF with class n'+
   'ame'#010+
   'ame'#010+
-  '*g2gp_Preserve case in stabs symbol names'#010+
+  '*g2gp_Preserve case in stabs',' symbol names'#010+
   '*g2gs_Generate Stabs debug information'#010+
   '*g2gs_Generate Stabs debug information'#010+
   '*g2gt_Trash local variables (to detect uninitialized uses)'#010+
   '*g2gt_Trash local variables (to detect uninitialized uses)'#010+
-  '*g','2gv_Generates programs traceable with Valgrind'#010+
+  '*g2gv_Generates programs traceable with Valgrind'#010+
   '*g2gw_Generate DWARFv2 debug information (same as -gw2)'#010+
   '*g2gw_Generate DWARFv2 debug information (same as -gw2)'#010+
-  '*g2gw2_Generate DWARFv2 debug information'#010+
+  '*g2gw2_Generate DWARFv2',' debug information'#010+
   '*g2gw3_Generate DWARFv3 debug information'#010+
   '*g2gw3_Generate DWARFv3 debug information'#010+
-  '*g2gw4_Generate DWARFv4 debug information (experiment','al)'#010+
+  '*g2gw4_Generate DWARFv4 debug information (experimental)'#010+
   '**1i_Information'#010+
   '**1i_Information'#010+
   '**2iD_Return compiler date'#010+
   '**2iD_Return compiler date'#010+
   '**2iV_Return short compiler version'#010+
   '**2iV_Return short compiler version'#010+
   '**2iW_Return full compiler version'#010+
   '**2iW_Return full compiler version'#010+
-  '**2iSO_Return compiler OS'#010+
+  '**2iSO_','Return compiler OS'#010+
   '**2iSP_Return compiler host processor'#010+
   '**2iSP_Return compiler host processor'#010+
   '**2iTO_Return target OS'#010+
   '**2iTO_Return target OS'#010+
   '**2iTP_Return target processor'#010+
   '**2iTP_Return target processor'#010+
-  '**','1I<x>_Add <x> to include path'#010+
+  '**1I<x>_Add <x> to include path'#010+
   '**1k<x>_Pass <x> to the linker'#010+
   '**1k<x>_Pass <x> to the linker'#010+
   '**1l_Write logo'#010+
   '**1l_Write logo'#010+
   '**1M<x>_Set language mode to <x>'#010+
   '**1M<x>_Set language mode to <x>'#010+
-  '**2Mfpc_Free Pascal dialect (default)'#010+
+  '**2Mfpc_Free Pas','cal dialect (default)'#010+
   '**2Mobjfpc_FPC mode with Object Pascal support'#010+
   '**2Mobjfpc_FPC mode with Object Pascal support'#010+
   '**2Mdelphi_Delphi 7 compatibility mode'#010+
   '**2Mdelphi_Delphi 7 compatibility mode'#010+
-  '**2Mtp','_TP/BP 7.0 compatibility mode'#010+
+  '**2Mtp_TP/BP 7.0 compatibility mode'#010+
   '**2Mmacpas_Macintosh Pascal dialects compatibility mode'#010+
   '**2Mmacpas_Macintosh Pascal dialects compatibility mode'#010+
-  '**1n_Do not read the default config files'#010+
+  '**1n_Do not read the default config file','s'#010+
   '**1o<x>_Change the name of the executable produced to <x>'#010+
   '**1o<x>_Change the name of the executable produced to <x>'#010+
   '**1O<x>_Optimizations:'#010+
   '**1O<x>_Optimizations:'#010+
   '**2O-_Disable optimizations'#010+
   '**2O-_Disable optimizations'#010+
-  '**2','O1_Level 1 optimizations (quick and debugger friendly)'#010+
+  '**2O1_Level 1 optimizations (quick and debugger friendly)'#010+
   '**2O2_Level 2 optimizations (-O1 + quick optimizations)'#010+
   '**2O2_Level 2 optimizations (-O1 + quick optimizations)'#010+
-  '**2O3_Level 3 optimizations (-O2 + slow optimizations)'#010+
+  '**2O3_Level 3 o','ptimizations (-O2 + slow optimizations)'#010+
   '**2O4_Level 4 optimizations (-O3 + optimizations which might have unex'+
   '**2O4_Level 4 optimizations (-O3 + optimizations which might have unex'+
-  'pect','ed side effects)'#010+
+  'pected side effects)'#010+
   '**2Oa<x>=<y>_Set alignment'#010+
   '**2Oa<x>=<y>_Set alignment'#010+
   '**2Oo[NO]<x>_Enable or disable optimizations, see fpc -i for possible '+
   '**2Oo[NO]<x>_Enable or disable optimizations, see fpc -i for possible '+
   'values'#010+
   'values'#010+
-  '**2Op<x>_Set target cpu for optimizing, see fpc -i for possible values'+
-  #010+
-  '**2OW<x>_Generate whole-program optimization fee','dback for optimizati'+
-  'on <x>, see fpc -i for possible values'#010+
-  '**2Ow<x>_Perform whole-program optimization <x>, see fpc -i for possib'+
-  'le values'#010+
+  '**2Op','<x>_Set target cpu for optimizing, see fpc -i for possible valu'+
+  'es'#010+
+  '**2OW<x>_Generate whole-program optimization feedback for optimization'+
+  ' <x>, see fpc -i for possible values'#010+
+  '**2Ow<x>_Perform whole-program optimization <x>, see fpc -i for pos','s'+
+  'ible values'#010+
   '**2Os_Optimize for size rather than speed'#010+
   '**2Os_Optimize for size rather than speed'#010+
-  '**1pg_Generate profile code for gprof (defines FPC_PROFILE)',#010+
+  '**1pg_Generate profile code for gprof (defines FPC_PROFILE)'#010+
   'F*1P<x>_Target CPU / compiler related options:'#010+
   'F*1P<x>_Target CPU / compiler related options:'#010+
   'F*2PB_Show default compiler binary'#010+
   'F*2PB_Show default compiler binary'#010+
   'F*2PP_Show default target cpu'#010+
   'F*2PP_Show default target cpu'#010+
-  'F*2P<x>_Set target CPU (arm,i386,m68k,mips,mipsel,powerpc,powerpc64,sp'+
-  'arc,x86_64'#010+
+  'F*2P<x>_Set t','arget CPU (arm,i386,m68k,mips,mipsel,powerpc,powerpc64,'+
+  'sparc,x86_64'#010+
   '**1R<x>_Assembler reading style:'#010+
   '**1R<x>_Assembler reading style:'#010+
-  '**2Rdefault_U','se default assembler for target'#010+
+  '**2Rdefault_Use default assembler for target'#010+
   '3*2Ratt_Read AT&T style assembler'#010+
   '3*2Ratt_Read AT&T style assembler'#010+
   '3*2Rintel_Read Intel style assembler'#010+
   '3*2Rintel_Read Intel style assembler'#010+
-  '6*2RMOT_Read motorola style assembler'#010+
+  '6*2RMOT_Read motorola s','tyle assembler'#010+
   '**1S<x>_Syntax options:'#010+
   '**1S<x>_Syntax options:'#010+
   '**2S2_Same as -Mobjfpc'#010+
   '**2S2_Same as -Mobjfpc'#010+
   '**2Sc_Support operators like C (*=,+=,/= and -=)'#010+
   '**2Sc_Support operators like C (*=,+=,/= and -=)'#010+
-  '**2','Sa_Turn on assertions'#010+
+  '**2Sa_Turn on assertions'#010+
   '**2Sd_Same as -Mdelphi'#010+
   '**2Sd_Same as -Mdelphi'#010+
   '**2Se<x>_Error options. <x> is a combination of the following:'#010+
   '**2Se<x>_Error options. <x> is a combination of the following:'#010+
-  '**3*_<n> : Compiler halts after the <n> errors (default is 1)'#010+
+  '**3*_<n> : Compile','r halts after the <n> errors (default is 1)'#010+
   '**3*_w : Compiler also halts after warnings'#010+
   '**3*_w : Compiler also halts after warnings'#010+
-  '**3*_n : Compiler also hal','ts after notes'#010+
+  '**3*_n : Compiler also halts after notes'#010+
   '**3*_h : Compiler also halts after hints'#010+
   '**3*_h : Compiler also halts after hints'#010+
   '**2Sg_Enable LABEL and GOTO (default in -Mtp and -Mdelphi)'#010+
   '**2Sg_Enable LABEL and GOTO (default in -Mtp and -Mdelphi)'#010+
-  '**2Sh_Use reference counted strings (ansistring by default) instead of'+
-  ' shortstrings'#010+
-  '**2Si_Turn on inlining of procedures/func','tions declared as "inline"'#010+
+  '**2Sh_Use r','eference counted strings (ansistring by default) instead '+
+  'of shortstrings'#010+
+  '**2Si_Turn on inlining of procedures/functions declared as "inline"'#010+
   '**2Sk_Load fpcylix unit'#010+
   '**2Sk_Load fpcylix unit'#010+
   '**2SI<x>_Set interface style to <x>'#010+
   '**2SI<x>_Set interface style to <x>'#010+
-  '**3SIcom_COM compatible interface (default)'#010+
+  '**3SIcom_COM compatible interface (defa','ult)'#010+
   '**3SIcorba_CORBA compatible interface'#010+
   '**3SIcorba_CORBA compatible interface'#010+
   '**2Sm_Support macros like C (global)'#010+
   '**2Sm_Support macros like C (global)'#010+
   '**2So_Same as -Mtp'#010+
   '**2So_Same as -Mtp'#010+
-  '**2Ss_Construct','or name must be init (destructor must be done)'#010+
+  '**2Ss_Constructor name must be init (destructor must be done)'#010+
   '**2Sx_Enable exception keywords (default in Delphi/ObjFPC modes)'#010+
   '**2Sx_Enable exception keywords (default in Delphi/ObjFPC modes)'#010+
-  '**2Sy_@<pointer> returns a typed pointer, same as $T+'#010+
+  '**2Sy_@<pointe','r> returns a typed pointer, same as $T+'#010+
   '**1s_Do not call assembler and linker'#010+
   '**1s_Do not call assembler and linker'#010+
-  '**2sh_Generate script to link on hos','t'#010+
+  '**2sh_Generate script to link on host'#010+
   '**2st_Generate script to link on target'#010+
   '**2st_Generate script to link on target'#010+
   '**2sr_Skip register allocation phase (use with -alr)'#010+
   '**2sr_Skip register allocation phase (use with -alr)'#010+
-  '**1T<x>_Target operating system:'#010+
+  '**1T<x>_Target operating system',':'#010+
   '3*2Tdarwin_Darwin/Mac OS X'#010+
   '3*2Tdarwin_Darwin/Mac OS X'#010+
   '3*2Temx_OS/2 via EMX (including EMX/RSX extender)'#010+
   '3*2Temx_OS/2 via EMX (including EMX/RSX extender)'#010+
   '3*2Tfreebsd_FreeBSD'#010+
   '3*2Tfreebsd_FreeBSD'#010+
-  '3*2Tgo32v2_Vers','ion 2 of DJ Delorie DOS extender'#010+
+  '3*2Tgo32v2_Version 2 of DJ Delorie DOS extender'#010+
   '3*2Tiphonesim_ iPhoneSimulator from iOS SDK 3.2+ (older versions: -Tda'+
   '3*2Tiphonesim_ iPhoneSimulator from iOS SDK 3.2+ (older versions: -Tda'+
   'rwin)'#010+
   'rwin)'#010+
   '3*2Tlinux_Linux'#010+
   '3*2Tlinux_Linux'#010+
-  '3*2Tnativent_Native NT API (experimental)'#010+
+  '3','*2Tnativent_Native NT API (experimental)'#010+
   '3*2Tnetbsd_NetBSD'#010+
   '3*2Tnetbsd_NetBSD'#010+
   '3*2Tnetware_Novell Netware Module (clib)'#010+
   '3*2Tnetware_Novell Netware Module (clib)'#010+
-  '3*2Tnetwlibc_N','ovell Netware Module (libc)'#010+
+  '3*2Tnetwlibc_Novell Netware Module (libc)'#010+
   '3*2Topenbsd_OpenBSD'#010+
   '3*2Topenbsd_OpenBSD'#010+
   '3*2Tos2_OS/2 / eComStation'#010+
   '3*2Tos2_OS/2 / eComStation'#010+
   '3*2Tsunos_SunOS/Solaris'#010+
   '3*2Tsunos_SunOS/Solaris'#010+
   '3*2Tsymbian_Symbian OS'#010+
   '3*2Tsymbian_Symbian OS'#010+
-  '3*2Tsolaris_Solaris'#010+
+  '3*2T','solaris_Solaris'#010+
   '3*2Twatcom_Watcom compatible DOS extender'#010+
   '3*2Twatcom_Watcom compatible DOS extender'#010+
   '3*2Twdosx_WDOSX DOS extender'#010+
   '3*2Twdosx_WDOSX DOS extender'#010+
   '3*2Twin32_Windows 32 Bit'#010+
   '3*2Twin32_Windows 32 Bit'#010+
-  '3*','2Twince_Windows CE'#010+
+  '3*2Twince_Windows CE'#010+
   '4*2Tdarwin_Darwin/Mac OS X'#010+
   '4*2Tdarwin_Darwin/Mac OS X'#010+
   '4*2Tlinux_Linux'#010+
   '4*2Tlinux_Linux'#010+
   '4*2Twin64_Win64 (64 bit Windows systems)'#010+
   '4*2Twin64_Win64 (64 bit Windows systems)'#010+
-  '6*2Tamiga_Commodore Amiga'#010+
+  '6*2Tamiga_Commodore Ami','ga'#010+
   '6*2Tatari_Atari ST/STe/TT'#010+
   '6*2Tatari_Atari ST/STe/TT'#010+
   '6*2Tlinux_Linux'#010+
   '6*2Tlinux_Linux'#010+
   '6*2Tpalmos_PalmOS'#010+
   '6*2Tpalmos_PalmOS'#010+
   'A*2Tdarwin_Darwin/iPhoneOS/iOS'#010+
   'A*2Tdarwin_Darwin/iPhoneOS/iOS'#010+
   'A*2Tlinux_Linux'#010+
   'A*2Tlinux_Linux'#010+
-  'A*2T','wince_Windows CE'#010+
+  'A*2Twince_Windows CE'#010+
   'P*2Tamiga_AmigaOS'#010+
   'P*2Tamiga_AmigaOS'#010+
   'P*2Tdarwin_Darwin/Mac OS X'#010+
   'P*2Tdarwin_Darwin/Mac OS X'#010+
   'P*2Tlinux_Linux'#010+
   'P*2Tlinux_Linux'#010+
   'P*2Tmacos_Mac OS (classic)'#010+
   'P*2Tmacos_Mac OS (classic)'#010+
   'P*2Tmorphos_MorphOS'#010+
   'P*2Tmorphos_MorphOS'#010+
-  'S*2Tsolaris_Solaris'#010+
+  'S','*2Tsolaris_Solaris'#010+
   'S*2Tlinux_Linux'#010+
   'S*2Tlinux_Linux'#010+
   '**1u<x>_Undefines the symbol <x>'#010+
   '**1u<x>_Undefines the symbol <x>'#010+
   '**1U_Unit options:'#010+
   '**1U_Unit options:'#010+
-  '**2Un_Do not check where th','e unit name matches the file name'#010+
+  '**2Un_Do not check where the unit name matches the file name'#010+
   '**2Ur_Generate release unit files (never automatically recompiled)'#010+
   '**2Ur_Generate release unit files (never automatically recompiled)'#010+
-  '**2Us_Compile a system unit'#010+
+  '**2Us_Compile a system un','it'#010+
   '**1v<x>_Be verbose. <x> is a combination of the following letters:'#010+
   '**1v<x>_Be verbose. <x> is a combination of the following letters:'#010+
-  '**2*_e : Show errors (default)       0 : Sho','w nothing (except errors'+
-  ')'#010+
+  '**2*_e : Show errors (default)       0 : Show nothing (except errors)'#010+
   '**2*_w : Show warnings               u : Show unit info'#010+
   '**2*_w : Show warnings               u : Show unit info'#010+
-  '**2*_n : Show notes                  t : Show tried/used files'#010+
+  '**2*_n : Show notes                  t : Sho','w tried/used files'#010+
   '**2*_h : Show hints                  c : Show conditionals'#010+
   '**2*_h : Show hints                  c : Show conditionals'#010+
-  '**2*_i : Show general info          ',' d : Show debug info'#010+
+  '**2*_i : Show general info           d : Show debug info'#010+
   '**2*_l : Show linenumbers            r : Rhide/GCC compatibility mode'#010+
   '**2*_l : Show linenumbers            r : Rhide/GCC compatibility mode'#010+
-  '**2*_s : Show time stamps            q : Show message numbers'#010+
+  '**2*_s : Show time stamps          ','  q : Show message numbers'#010+
   '**2*_a : Show everything             x : Executable info (Win32 only)'#010+
   '**2*_a : Show everything             x : Executable info (Win32 only)'#010+
-  '**2*_b : Write fi','le names messages   p : Write tree.log with parse t'+
-  'ree'#010+
+  '**2*_b : Write file names messages   p : Write tree.log with parse tre'+
+  'e'#010+
   '**2*_    with full path              v : Write fpcdebug.txt with'#010+
   '**2*_    with full path              v : Write fpcdebug.txt with'#010+
-  '**2*_                                    lots of debugging info'#010+
-  '**2*_m<x>,<y> : Don'#039't show messages numbered <x> and <y>',#010+
+  '**2*_ ','                                   lots of debugging info'#010+
+  '**2*_m<x>,<y> : Don'#039't show messages numbered <x> and <y>'#010+
   'F*1V<x>_Append '#039'-<x>'#039' to the used compiler binary name (e.g. f'+
   'F*1V<x>_Append '#039'-<x>'#039' to the used compiler binary name (e.g. f'+
   'or version)'#010+
   'or version)'#010+
   '**1W<x>_Target-specific options (targets)'#010+
   '**1W<x>_Target-specific options (targets)'#010+
-  '3*2WA_Specify native type application (Windows)'#010+
+  '3*2WA_Spe','cify native type application (Windows)'#010+
   '4*2WA_Specify native type application (Windows)'#010+
   '4*2WA_Specify native type application (Windows)'#010+
-  'A*2WA_Specify native type a','pplication (Windows)'#010+
+  'A*2WA_Specify native type application (Windows)'#010+
   '3*2Wb_Create a bundle instead of a library (Darwin)'#010+
   '3*2Wb_Create a bundle instead of a library (Darwin)'#010+
   'P*2Wb_Create a bundle instead of a library (Darwin)'#010+
   'P*2Wb_Create a bundle instead of a library (Darwin)'#010+
-  'p*2Wb_Create a bundle instead of a library (Darwin)'#010+
+  'p','*2Wb_Create a bundle instead of a library (Darwin)'#010+
   'A*2Wb_Create a bundle instead of a library (Darwin)'#010+
   'A*2Wb_Create a bundle instead of a library (Darwin)'#010+
-  '4*2Wb_Creat','e a bundle instead of a library (Darwin)'#010+
+  '4*2Wb_Create a bundle instead of a library (Darwin)'#010+
   '3*2WB_Create a relocatable image (Windows, Symbian)'#010+
   '3*2WB_Create a relocatable image (Windows, Symbian)'#010+
-  '3*2WBxxxx_Set image base to xxxx (Windows, Symbian)'#010+
+  '3*2WBxxxx_Set image base to xxxx ','(Windows, Symbian)'#010+
   '4*2WB_Create a relocatable image (Windows)'#010+
   '4*2WB_Create a relocatable image (Windows)'#010+
   '4*2WBxxxx_Set image base to xxxx (Windows)'#010+
   '4*2WBxxxx_Set image base to xxxx (Windows)'#010+
-  'A*2WB_Cre','ate a relocatable image (Windows, Symbian)'#010+
+  'A*2WB_Create a relocatable image (Windows, Symbian)'#010+
   'A*2WBxxxx_Set image base to xxxx (Windows, Symbian)'#010+
   'A*2WBxxxx_Set image base to xxxx (Windows, Symbian)'#010+
-  '3*2WC_Specify console type application (EMX, OS/2, Windows)'#010+
+  '3*2WC_Specify console type appl','ication (EMX, OS/2, Windows)'#010+
   '4*2WC_Specify console type application (EMX, OS/2, Windows)'#010+
   '4*2WC_Specify console type application (EMX, OS/2, Windows)'#010+
-  'A*2WC_Specify console typ','e application (Windows)'#010+
+  'A*2WC_Specify console type application (Windows)'#010+
   'P*2WC_Specify console type application (Classic Mac OS)'#010+
   'P*2WC_Specify console type application (Classic Mac OS)'#010+
-  '3*2WD_Use DEFFILE to export functions of DLL or EXE (Windows)'#010+
+  '3*2WD_Use DEFFILE to export functions of DLL o','r EXE (Windows)'#010+
   '4*2WD_Use DEFFILE to export functions of DLL or EXE (Windows)'#010+
   '4*2WD_Use DEFFILE to export functions of DLL or EXE (Windows)'#010+
-  'A*2WD_Use DEFFILE to export function','s of DLL or EXE (Windows)'#010+
+  'A*2WD_Use DEFFILE to export functions of DLL or EXE (Windows)'#010+
   '3*2We_Use external resources (Darwin)'#010+
   '3*2We_Use external resources (Darwin)'#010+
   '4*2We_Use external resources (Darwin)'#010+
   '4*2We_Use external resources (Darwin)'#010+
-  'A*2We_Use external resources (Darwin)'#010+
+  'A*2We_Use external resou','rces (Darwin)'#010+
   'P*2We_Use external resources (Darwin)'#010+
   'P*2We_Use external resources (Darwin)'#010+
   'p*2We_Use external resources (Darwin)'#010+
   'p*2We_Use external resources (Darwin)'#010+
-  '3*2WF_Specify full-scree','n type application (EMX, OS/2)'#010+
+  '3*2WF_Specify full-screen type application (EMX, OS/2)'#010+
   '3*2WG_Specify graphic type application (EMX, OS/2, Windows)'#010+
   '3*2WG_Specify graphic type application (EMX, OS/2, Windows)'#010+
-  '4*2WG_Specify graphic type application (EMX, OS/2, Windows)'#010+
+  '4*2WG_Specify graphic type applicat','ion (EMX, OS/2, Windows)'#010+
   'A*2WG_Specify graphic type application (Windows)'#010+
   'A*2WG_Specify graphic type application (Windows)'#010+
-  'P*2WG_Specify graphic type application (','Classic Mac OS)'#010+
+  'P*2WG_Specify graphic type application (Classic Mac OS)'#010+
   '3*2Wi_Use internal resources (Darwin)'#010+
   '3*2Wi_Use internal resources (Darwin)'#010+
   '4*2Wi_Use internal resources (Darwin)'#010+
   '4*2Wi_Use internal resources (Darwin)'#010+
-  'A*2Wi_Use internal resources (Darwin)'#010+
+  'A*2Wi_Use internal resources (Darw','in)'#010+
   'P*2Wi_Use internal resources (Darwin)'#010+
   'P*2Wi_Use internal resources (Darwin)'#010+
   'p*2Wi_Use internal resources (Darwin)'#010+
   'p*2Wi_Use internal resources (Darwin)'#010+
-  '3*2WI_Turn on/off the usage of imp','ort sections (Windows)'#010+
+  '3*2WI_Turn on/off the usage of import sections (Windows)'#010+
   '4*2WI_Turn on/off the usage of import sections (Windows)'#010+
   '4*2WI_Turn on/off the usage of import sections (Windows)'#010+
-  'A*2WI_Turn on/off the usage of import sections (Windows)'#010+
+  'A*2WI_Turn on/off the usage of import sections',' (Windows)'#010+
   '8*2Wm<x>_Set memory model'#010+
   '8*2Wm<x>_Set memory model'#010+
   '8*3WmTiny_Tiny memory model'#010+
   '8*3WmTiny_Tiny memory model'#010+
   '8*3WmSmall_Small memory model (default)'#010+
   '8*3WmSmall_Small memory model (default)'#010+
-  '8*3WmMedi','um_Medium memory model'#010+
+  '8*3WmMedium_Medium memory model'#010+
   '3*2WM<x>_Minimum Mac OS X deployment version: 10.4, 10.5.1, ... (Darwi'+
   '3*2WM<x>_Minimum Mac OS X deployment version: 10.4, 10.5.1, ... (Darwi'+
   'n)'#010+
   'n)'#010+
-  '4*2WM<x>_Minimum Mac OS X deployment version: 10.4, 10.5.1, ... (Darwi'+
-  'n)'#010+
+  '4*2WM<x>_Minimum Mac OS X depl','oyment version: 10.4, 10.5.1, ... (Dar'+
+  'win)'#010+
   'p*2WM<x>_Minimum Mac OS X deployment version: 10.4, 10.5.1, ... (Darwi'+
   'p*2WM<x>_Minimum Mac OS X deployment version: 10.4, 10.5.1, ... (Darwi'+
-  'n',')'#010+
+  'n)'#010+
   'P*2WM<x>_Minimum Mac OS X deployment version: 10.4, 10.5.1, ... (Darwi'+
   'P*2WM<x>_Minimum Mac OS X deployment version: 10.4, 10.5.1, ... (Darwi'+
   'n)'#010+
   'n)'#010+
-  '3*2WN_Do not generate relocation code, needed for debugging (Windows)'#010+
-  '4*2WN_Do not generate relocation code, needed for debugging (Windows)'#010+
-  'A*2WN_Do not generate rel','ocation code, needed for debugging (Windows'+
+  '3*2WN_Do not generate relocation code, needed for d','ebugging (Windows'+
   ')'#010+
   ')'#010+
+  '4*2WN_Do not generate relocation code, needed for debugging (Windows)'#010+
+  'A*2WN_Do not generate relocation code, needed for debugging (Windows)'#010+
   'A*2Wpxxxx_Specify the controller type, see fpc -i for possible values'#010+
   'A*2Wpxxxx_Specify the controller type, see fpc -i for possible values'#010+
-  'V*2Wpxxxx_Specify the controller type, see fpc -i for possible values'#010+
-  '3*2WP<x>_Minimum iOS deployment version: 3.0, 5.0.1, ..','. (iphonesim)'+
-  #010+
+  'V*2Wpxxxx_S','pecify the controller type, see fpc -i for possible value'+
+  's'#010+
+  '3*2WP<x>_Minimum iOS deployment version: 3.0, 5.0.1, ... (iphonesim)'#010+
   'A*2WP<x>_Minimum iOS deployment version: 3.0, 5.0.1, ... (Darwin)'#010+
   'A*2WP<x>_Minimum iOS deployment version: 3.0, 5.0.1, ... (Darwin)'#010+
   '3*2WR_Generate relocation code (Windows)'#010+
   '3*2WR_Generate relocation code (Windows)'#010+
-  '4*2WR_Generate relocation code (Windows)'#010+
+  '4*2WR','_Generate relocation code (Windows)'#010+
   'A*2WR_Generate relocation code (Windows)'#010+
   'A*2WR_Generate relocation code (Windows)'#010+
-  'P*2WT_Specify MPW tool type applicati','on (Classic Mac OS)'#010+
+  'P*2WT_Specify MPW tool type application (Classic Mac OS)'#010+
   '**2WX_Enable executable stack (Linux)'#010+
   '**2WX_Enable executable stack (Linux)'#010+
   '**1X_Executable options:'#010+
   '**1X_Executable options:'#010+
-  '**2Xc_Pass --shared/-dynamic to the linker (BeOS, Darwin, FreeBSD, Lin'+
-  'ux)'#010+
+  '**2Xc_Pass --shared/-dynamic to the linker ','(BeOS, Darwin, FreeBSD, L'+
+  'inux)'#010+
   '**2Xd_Do not search default library path (sometimes required for cross'+
   '**2Xd_Do not search default library path (sometimes required for cross'+
-  '-compiling wh','en not using -XR)'#010+
+  '-compiling when not using -XR)'#010+
   '**2Xe_Use external linker'#010+
   '**2Xe_Use external linker'#010+
   '**2Xg_Create debuginfo in a separate file and add a debuglink section '+
   '**2Xg_Create debuginfo in a separate file and add a debuglink section '+
-  'to executable'#010+
+  'to executabl','e'#010+
   '**2XD_Try to link units dynamically      (defines FPC_LINK_DYNAMIC)'#010+
   '**2XD_Try to link units dynamically      (defines FPC_LINK_DYNAMIC)'#010+
   '**2Xi_Use internal linker'#010+
   '**2Xi_Use internal linker'#010+
-  '**2Xm_Generate lin','k map'#010+
+  '**2Xm_Generate link map'#010+
   '**2XM<x>_Set the name of the '#039'main'#039' program routine (default i'+
   '**2XM<x>_Set the name of the '#039'main'#039' program routine (default i'+
   's '#039'main'#039')'#010+
   's '#039'main'#039')'#010+
-  'F*2Xp<x>_First search for the compiler binary in the directory <x>'#010+
+  'F*2Xp<x>_First search for the compiler binary in',' the directory <x>'#010+
   '**2XP<x>_Prepend the binutils names with the prefix <x>'#010+
   '**2XP<x>_Prepend the binutils names with the prefix <x>'#010+
-  '**2Xr<x>_Set the linker'#039's rlink-path to',' <x> (needed for cross co'+
-  'mpile, see the ld manual for more information) (BeOS, Linux)'#010+
-  '**2XR<x>_Prepend <x> to all linker search paths (BeOS, Darwin, FreeBSD'+
-  ', Linux, Mac OS, Solaris)'#010+
+  '**2Xr<x>_Set the linker'#039's rlink-path to <x> (needed for cross comp'+
+  'ile, see the ld manual for more information) (BeOS, Linux)'#010+
+  '**2XR<x>_Prepend <x> to all linker searc','h paths (BeOS, Darwin, FreeB'+
+  'SD, Linux, Mac OS, Solaris)'#010+
   '**2Xs_Strip all symbols from executable'#010+
   '**2Xs_Strip all symbols from executable'#010+
-  '**2XS_Try to link ','units statically (default, defines FPC_LINK_STATIC'+
-  ')'#010+
+  '**2XS_Try to link units statically (default, defines FPC_LINK_STATIC)'#010+
   '**2Xt_Link with static libraries (-static is passed to linker)'#010+
   '**2Xt_Link with static libraries (-static is passed to linker)'#010+
-  '**2XX_Try to smartlink units             (defines FPC_LINK_SMART)'#010+
+  '**2XX_Try t','o smartlink units             (defines FPC_LINK_SMART)'#010+
   '**1*_'#010+
   '**1*_'#010+
   '**1?_Show this help'#010+
   '**1?_Show this help'#010+
-  '**1h_Shows this help without wait','ing'
+  '**1h_Shows this help without waiting'
 );
 );

+ 6 - 6
compiler/ncgrtti.pas

@@ -343,7 +343,7 @@ implementation
                 if not(po_virtualmethod in tprocdef(propaccesslist.procdef).procoptions) or
                 if not(po_virtualmethod in tprocdef(propaccesslist.procdef).procoptions) or
                    is_objectpascal_helper(tprocdef(propaccesslist.procdef).struct) then
                    is_objectpascal_helper(tprocdef(propaccesslist.procdef).struct) then
                   begin
                   begin
-                     current_asmdata.asmlists[al_rtti].concat(Tai_const.createname(tprocdef(propaccesslist.procdef).mangledname,0));
+                     current_asmdata.asmlists[al_rtti].concat(Tai_const.createname(tprocdef(propaccesslist.procdef).mangledname,AT_FUNCTION,0));
                      typvalue:=1;
                      typvalue:=1;
                   end
                   end
                 else
                 else
@@ -857,7 +857,7 @@ implementation
 
 
             if not is_objectpascal_helper(def) then
             if not is_objectpascal_helper(def) then
               if (oo_has_vmt in def.objectoptions) then
               if (oo_has_vmt in def.objectoptions) then
-                current_asmdata.asmlists[al_rtti].concat(Tai_const.Createname(def.vmt_mangledname,0))
+                current_asmdata.asmlists[al_rtti].concat(Tai_const.Createname(def.vmt_mangledname,AT_DATA,0))
               else
               else
                 current_asmdata.asmlists[al_rtti].concat(Tai_const.Create_nil_dataptr);
                 current_asmdata.asmlists[al_rtti].concat(Tai_const.Create_nil_dataptr);
 
 
@@ -1307,7 +1307,7 @@ implementation
 
 
     function TRTTIWriter.ref_rtti(def:tdef;rt:trttitype):tasmsymbol;
     function TRTTIWriter.ref_rtti(def:tdef;rt:trttitype):tasmsymbol;
       begin
       begin
-        result:=current_asmdata.RefAsmSymbol(def.rtti_mangledname(rt));
+        result:=current_asmdata.RefAsmSymbol(def.rtti_mangledname(rt),AT_DATA);
         if (cs_create_pic in current_settings.moduleswitches) and
         if (cs_create_pic in current_settings.moduleswitches) and
            assigned(current_procinfo) then
            assigned(current_procinfo) then
           include(current_procinfo.flags,pi_needs_got);
           include(current_procinfo.flags,pi_needs_got);
@@ -1343,7 +1343,7 @@ implementation
 
 
     function TRTTIWriter.get_rtti_label(def:tdef;rt:trttitype):tasmsymbol;
     function TRTTIWriter.get_rtti_label(def:tdef;rt:trttitype):tasmsymbol;
       begin
       begin
-        result:=current_asmdata.RefAsmSymbol(def.rtti_mangledname(rt));
+        result:=current_asmdata.RefAsmSymbol(def.rtti_mangledname(rt),AT_DATA);
         if (cs_create_pic in current_settings.moduleswitches) and
         if (cs_create_pic in current_settings.moduleswitches) and
            assigned(current_procinfo) then
            assigned(current_procinfo) then
           include(current_procinfo.flags,pi_needs_got);
           include(current_procinfo.flags,pi_needs_got);
@@ -1351,7 +1351,7 @@ implementation
 
 
     function TRTTIWriter.get_rtti_label_ord2str(def:tdef;rt:trttitype):tasmsymbol;
     function TRTTIWriter.get_rtti_label_ord2str(def:tdef;rt:trttitype):tasmsymbol;
       begin
       begin
-        result:=current_asmdata.RefAsmSymbol(def.rtti_mangledname(rt)+'_o2s');
+        result:=current_asmdata.RefAsmSymbol(def.rtti_mangledname(rt)+'_o2s',AT_DATA);
         if (cs_create_pic in current_settings.moduleswitches) and
         if (cs_create_pic in current_settings.moduleswitches) and
            assigned(current_procinfo) then
            assigned(current_procinfo) then
           include(current_procinfo.flags,pi_needs_got);
           include(current_procinfo.flags,pi_needs_got);
@@ -1359,7 +1359,7 @@ implementation
 
 
     function TRTTIWriter.get_rtti_label_str2ord(def:tdef;rt:trttitype):tasmsymbol;
     function TRTTIWriter.get_rtti_label_str2ord(def:tdef;rt:trttitype):tasmsymbol;
       begin
       begin
-        result:=current_asmdata.RefAsmSymbol(def.rtti_mangledname(rt)+'_s2o');
+        result:=current_asmdata.RefAsmSymbol(def.rtti_mangledname(rt)+'_s2o',AT_DATA);
         if (cs_create_pic in current_settings.moduleswitches) and
         if (cs_create_pic in current_settings.moduleswitches) and
            assigned(current_procinfo) then
            assigned(current_procinfo) then
           include(current_procinfo.flags,pi_needs_got);
           include(current_procinfo.flags,pi_needs_got);

+ 0 - 39
compiler/ncgutil.pas

@@ -77,7 +77,6 @@ interface
 
 
     function  has_alias_name(pd:tprocdef;const s:string):boolean;
     function  has_alias_name(pd:tprocdef;const s:string):boolean;
     procedure alloc_proc_symbol(pd: tprocdef);
     procedure alloc_proc_symbol(pd: tprocdef);
-    procedure gen_proc_symbol(list:TAsmList);
     procedure gen_proc_entry_code(list:TAsmList);
     procedure gen_proc_entry_code(list:TAsmList);
     procedure gen_proc_exit_code(list:TAsmList);
     procedure gen_proc_exit_code(list:TAsmList);
     procedure gen_stack_check_size_para(list:TAsmList);
     procedure gen_stack_check_size_para(list:TAsmList);
@@ -1312,44 +1311,6 @@ implementation
        end;
        end;
 
 
 
 
-    procedure gen_proc_symbol(list:TAsmList);
-      var
-        item,
-        previtem : TCmdStrListItem;
-      begin
-        previtem:=nil;
-        item := TCmdStrListItem(current_procinfo.procdef.aliasnames.first);
-        while assigned(item) do
-          begin
-{$ifdef arm}
-            if current_settings.cputype in cpu_thumb2+cpu_thumb then
-              list.concat(tai_thumb_func.create);
-{$endif arm}
-            { "double link" all procedure entry symbols via .reference }
-            { directives on darwin, because otherwise the linker       }
-            { sometimes strips the procedure if only on of the symbols }
-            { is referenced                                            }
-            if assigned(previtem) and
-               (target_info.system in systems_darwin) then
-              list.concat(tai_directive.create(asd_reference,item.str));
-            if (cs_profile in current_settings.moduleswitches) or
-              (po_global in current_procinfo.procdef.procoptions) then
-              list.concat(Tai_symbol.createname_global(item.str,AT_FUNCTION,0))
-            else
-              list.concat(Tai_symbol.createname(item.str,AT_FUNCTION,0));
-            if assigned(previtem) and
-               (target_info.system in systems_darwin) then
-              list.concat(tai_directive.create(asd_reference,previtem.str));
-            if not(af_stabs_use_function_absolute_addresses in target_asm.flags) then
-              list.concat(Tai_function_name.create(item.str));
-            previtem:=item;
-            item := TCmdStrListItem(item.next);
-          end;
-        current_procinfo.procdef.procstarttai:=tai(list.last);
-      end;
-
-
-
     procedure gen_proc_entry_code(list:TAsmList);
     procedure gen_proc_entry_code(list:TAsmList);
       var
       var
         hitemp,
         hitemp,

+ 54 - 14
compiler/ncgvmt.pas

@@ -87,6 +87,7 @@ implementation
         function  genintmsgtab(list : TAsmList) : tasmlabel;
         function  genintmsgtab(list : TAsmList) : tasmlabel;
         function  genpublishedmethodstable(list : TAsmList) : tasmlabel;
         function  genpublishedmethodstable(list : TAsmList) : tasmlabel;
         function  generate_field_table(list : TAsmList) : tasmlabel;
         function  generate_field_table(list : TAsmList) : tasmlabel;
+        procedure generate_abstract_stub(list:TAsmList;pd:tprocdef);
 {$ifdef WITHDMT}
 {$ifdef WITHDMT}
         { generates a DMT for _class }
         { generates a DMT for _class }
         function  gendmt : tasmlabel;
         function  gendmt : tasmlabel;
@@ -241,7 +242,7 @@ implementation
          list.concat(cai_align.create(const_align(sizeof(pint))));
          list.concat(cai_align.create(const_align(sizeof(pint))));
          list.concat(Tai_const.Create_sym(p^.nl));
          list.concat(Tai_const.Create_sym(p^.nl));
          list.concat(cai_align.create(const_align(sizeof(pint))));
          list.concat(cai_align.create(const_align(sizeof(pint))));
-         list.concat(Tai_const.Createname(p^.data.mangledname,0));
+         list.concat(Tai_const.Createname(p^.data.mangledname,AT_FUNCTION,0));
 
 
          if assigned(p^.r) then
          if assigned(p^.r) then
            writestrentry(list,p^.r);
            writestrentry(list,p^.r);
@@ -285,7 +286,7 @@ implementation
          list.concat(cai_align.create(const_align(sizeof(longint))));
          list.concat(cai_align.create(const_align(sizeof(longint))));
          list.concat(Tai_const.Create_32bit(p^.data.messageinf.i));
          list.concat(Tai_const.Create_32bit(p^.data.messageinf.i));
          list.concat(cai_align.create(const_align(sizeof(pint))));
          list.concat(cai_align.create(const_align(sizeof(pint))));
-         list.concat(Tai_const.Createname(p^.data.mangledname,0));
+         list.concat(Tai_const.Createname(p^.data.mangledname,AT_FUNCTION,0));
 
 
          if assigned(p^.r) then
          if assigned(p^.r) then
            writeintentry(list,p^.r);
            writeintentry(list,p^.r);
@@ -448,7 +449,7 @@ implementation
                 if po_abstractmethod in pd.procoptions then
                 if po_abstractmethod in pd.procoptions then
                   lists[0].concat(Tai_const.Create_nil_codeptr)
                   lists[0].concat(Tai_const.Create_nil_codeptr)
                 else
                 else
-                  lists[0].concat(Tai_const.Createname(pd.mangledname,0));
+                  lists[0].concat(Tai_const.Createname(pd.mangledname,AT_FUNCTION,0));
               end;
               end;
            end;
            end;
       end;
       end;
@@ -546,7 +547,7 @@ implementation
             if (tf_requires_proper_alignment in target_info.flags) then
             if (tf_requires_proper_alignment in target_info.flags) then
               list.concat(cai_align.Create(sizeof(TConstPtrUInt)));
               list.concat(cai_align.Create(sizeof(TConstPtrUInt)));
             for i:=0 to classtablelist.Count-1 do
             for i:=0 to classtablelist.Count-1 do
-              list.concat(Tai_const.Createname(tobjectdef(classtablelist[i]).vmt_mangledname,0));
+              list.concat(Tai_const.Createname(tobjectdef(classtablelist[i]).vmt_mangledname,AT_DATA,0));
             result:=fieldtable;
             result:=fieldtable;
           end
           end
         else
         else
@@ -584,7 +585,7 @@ implementation
                 hs:=make_mangledname('WRPR',_class.owner,_class.objname^+'_$_'+AImplIntf.IntfDef.objname^+'_$_'+
                 hs:=make_mangledname('WRPR',_class.owner,_class.objname^+'_$_'+AImplIntf.IntfDef.objname^+'_$_'+
                                      tostr(i)+'_$_'+pd.mangledname);
                                      tostr(i)+'_$_'+pd.mangledname);
                 { create reference }
                 { create reference }
-                rawdata.concat(Tai_const.Createname(hs,0));
+                rawdata.concat(Tai_const.Createname(hs,AT_FUNCTION,0));
               end;
               end;
            end;
            end;
         rawdata.concat(tai_symbol_end.createname(vtblstr));
         rawdata.concat(tai_symbol_end.createname(vtblstr));
@@ -598,12 +599,12 @@ implementation
         { GUID (or nil for Corba interfaces) }
         { GUID (or nil for Corba interfaces) }
         if AImplIntf.IntfDef.objecttype in [odt_interfacecom] then
         if AImplIntf.IntfDef.objecttype in [odt_interfacecom] then
           rawdata.concat(Tai_const.CreateName(
           rawdata.concat(Tai_const.CreateName(
-            make_mangledname('IID',AImplIntf.IntfDef.owner,AImplIntf.IntfDef.objname^),0))
+            make_mangledname('IID',AImplIntf.IntfDef.owner,AImplIntf.IntfDef.objname^),AT_DATA,0))
         else
         else
           rawdata.concat(Tai_const.Create_nil_dataptr);
           rawdata.concat(Tai_const.Create_nil_dataptr);
 
 
         { VTable }
         { VTable }
-        rawdata.concat(Tai_const.Createname(intf_get_vtbl_name(AImplIntf.VtblImplIntf),0));
+        rawdata.concat(Tai_const.Createname(intf_get_vtbl_name(AImplIntf.VtblImplIntf),AT_DATA,0));
         { IOffset field }
         { IOffset field }
         case AImplIntf.VtblImplIntf.IType of
         case AImplIntf.VtblImplIntf.IType of
           etFieldValue, etFieldValueClass,
           etFieldValue, etFieldValueClass,
@@ -612,6 +613,7 @@ implementation
           etStaticMethodResult, etStaticMethodClass:
           etStaticMethodResult, etStaticMethodClass:
             rawdata.concat(Tai_const.Createname(
             rawdata.concat(Tai_const.Createname(
               tprocdef(tpropertysym(AImplIntf.ImplementsGetter).propaccesslist[palt_read].procdef).mangledname,
               tprocdef(tpropertysym(AImplIntf.ImplementsGetter).propaccesslist[palt_read].procdef).mangledname,
+              AT_FUNCTION,
               0
               0
             ));
             ));
           etVirtualMethodResult, etVirtualMethodClass:
           etVirtualMethodResult, etVirtualMethodClass:
@@ -625,7 +627,7 @@ implementation
 
 
         { IIDStr }
         { IIDStr }
         rawdata.concat(Tai_const.CreateName(
         rawdata.concat(Tai_const.CreateName(
-          make_mangledname('IIDSTR',AImplIntf.IntfDef.owner,AImplIntf.IntfDef.objname^),0));
+          make_mangledname('IIDSTR',AImplIntf.IntfDef.owner,AImplIntf.IntfDef.objname^),AT_DATA,0));
         { IType }
         { IType }
         rawdata.concat(Tai_const.Create_pint(aint(AImplIntf.VtblImplIntf.IType)));
         rawdata.concat(Tai_const.Create_pint(aint(AImplIntf.VtblImplIntf.IType)));
       end;
       end;
@@ -714,6 +716,35 @@ implementation
       end;
       end;
 
 
 
 
+    procedure TVMTWriter.generate_abstract_stub(list:TAsmList;pd:tprocdef);
+      var
+        sym: TAsmSymbol;
+      begin
+        { Generate stubs for abstract methods, so their symbols are present and
+          can be used e.g. to take address (see issue #24536). }
+        if (po_global in pd.procoptions) and
+           (pd.owner.defowner<>self._class) then
+          exit;
+        sym:=current_asmdata.GetAsmSymbol(pd.mangledname);
+        if assigned(sym) and (sym.bind<>AB_EXTERNAL) then
+          exit;
+        maybe_new_object_file(list);
+        new_section(list,sec_code,lower(pd.mangledname),target_info.alignment.procalign);
+        if (po_global in pd.procoptions) then
+          begin
+            sym:=current_asmdata.DefineAsmSymbol(pd.mangledname,AB_GLOBAL,AT_FUNCTION);
+            list.concat(Tai_symbol.Create_global(sym,0));
+          end
+        else
+          begin
+            sym:=current_asmdata.DefineAsmSymbol(pd.mangledname,AB_LOCAL,AT_FUNCTION);
+            list.concat(Tai_symbol.Create(sym,0));
+          end;
+        cg.g_external_wrapper(list,pd,'FPC_ABSTRACTERROR');
+        list.concat(Tai_symbol_end.Create(sym));
+      end;
+
+
     procedure TVMTWriter.writevirtualmethods(List:TAsmList);
     procedure TVMTWriter.writevirtualmethods(List:TAsmList);
       var
       var
          vmtpd : tprocdef;
          vmtpd : tprocdef;
@@ -736,12 +767,15 @@ implementation
            if vmtpd.extnumber<>i then
            if vmtpd.extnumber<>i then
              internalerror(200611083);
              internalerror(200611083);
            if (po_abstractmethod in vmtpd.procoptions) then
            if (po_abstractmethod in vmtpd.procoptions) then
-             procname:='FPC_ABSTRACTERROR'
+             begin
+               procname:='FPC_ABSTRACTERROR';
+               generate_abstract_stub(current_asmdata.AsmLists[al_procedures],vmtpd);
+             end
            else if (cs_opt_remove_emtpy_proc in current_settings.optimizerswitches) and RedirectToEmpty(vmtpd) then
            else if (cs_opt_remove_emtpy_proc in current_settings.optimizerswitches) and RedirectToEmpty(vmtpd) then
              procname:='FPC_EMPTYMETHOD'
              procname:='FPC_EMPTYMETHOD'
            else if not wpoinfomanager.optimized_name_for_vmt(_class,vmtpd,procname) then
            else if not wpoinfomanager.optimized_name_for_vmt(_class,vmtpd,procname) then
              procname:=vmtpd.mangledname;
              procname:=vmtpd.mangledname;
-           List.concat(Tai_const.createname(procname,0));
+           List.concat(Tai_const.createname(procname,AT_FUNCTION,0));
 {$ifdef vtentry}
 {$ifdef vtentry}
            hs:='VTENTRY'+'_'+_class.vmt_mangledname+'$$'+tostr(_class.vmtmethodoffset(i) div sizeof(pint));
            hs:='VTENTRY'+'_'+_class.vmt_mangledname+'$$'+tostr(_class.vmtmethodoffset(i) div sizeof(pint));
            current_asmdata.asmlists[al_globals].concat(tai_symbol.CreateName(hs,AT_DATA,0));
            current_asmdata.asmlists[al_globals].concat(tai_symbol.CreateName(hs,AT_DATA,0));
@@ -817,7 +851,7 @@ implementation
          { it is not written for parents that don't have any vmt !! }
          { it is not written for parents that don't have any vmt !! }
          if assigned(_class.childof) and
          if assigned(_class.childof) and
             (oo_has_vmt in _class.childof.objectoptions) then
             (oo_has_vmt in _class.childof.objectoptions) then
-           current_asmdata.asmlists[al_globals].concat(Tai_const.Createname(_class.childof.vmt_mangledname,0))
+           current_asmdata.asmlists[al_globals].concat(Tai_const.Createname(_class.childof.vmt_mangledname,AT_DATA,0))
          else
          else
            current_asmdata.asmlists[al_globals].concat(Tai_const.Create_nil_dataptr);
            current_asmdata.asmlists[al_globals].concat(Tai_const.Create_nil_dataptr);
 
 
@@ -832,9 +866,15 @@ implementation
             else
             else
               current_asmdata.asmlists[al_globals].concat(Tai_const.Create_nil_dataptr);
               current_asmdata.asmlists[al_globals].concat(Tai_const.Create_nil_dataptr);
             { pointer to method table or nil }
             { pointer to method table or nil }
-            current_asmdata.asmlists[al_globals].concat(Tai_const.Create_sym(methodnametable));
+            if assigned(methodnametable) then
+              current_asmdata.asmlists[al_globals].concat(Tai_const.Create_sym(methodnametable))
+            else
+              current_asmdata.asmlists[al_globals].concat(Tai_const.Create_nil_dataptr);
             { pointer to field table }
             { pointer to field table }
-            current_asmdata.asmlists[al_globals].concat(Tai_const.Create_sym(fieldtablelabel));
+            if assigned(fieldtablelabel) then
+              current_asmdata.asmlists[al_globals].concat(Tai_const.Create_sym(fieldtablelabel))
+            else
+              current_asmdata.asmlists[al_globals].concat(Tai_const.Create_nil_dataptr);
             { pointer to type info of published section }
             { pointer to type info of published section }
             current_asmdata.asmlists[al_globals].concat(Tai_const.Create_sym(RTTIWriter.get_rtti_label(_class,fullrtti)));
             current_asmdata.asmlists[al_globals].concat(Tai_const.Create_sym(RTTIWriter.get_rtti_label(_class,fullrtti)));
             { inittable for con-/destruction }
             { inittable for con-/destruction }
@@ -850,7 +890,7 @@ implementation
             else if _class.implements_any_interfaces then
             else if _class.implements_any_interfaces then
               current_asmdata.asmlists[al_globals].concat(Tai_const.Create_nil_dataptr)
               current_asmdata.asmlists[al_globals].concat(Tai_const.Create_nil_dataptr)
             else
             else
-              current_asmdata.asmlists[al_globals].concat(Tai_const.Create_sym(current_asmdata.RefAsmSymbol('FPC_EMPTYINTF')));
+              current_asmdata.asmlists[al_globals].concat(Tai_const.Create_sym(current_asmdata.RefAsmSymbol('FPC_EMPTYINTF',AT_DATA)));
             { table for string messages }
             { table for string messages }
             if (oo_has_msgstr in _class.objectoptions) then
             if (oo_has_msgstr in _class.objectoptions) then
               current_asmdata.asmlists[al_globals].concat(Tai_const.Create_sym(strmessagetable))
               current_asmdata.asmlists[al_globals].concat(Tai_const.Create_sym(strmessagetable))

+ 5 - 5
compiler/ncnv.pas

@@ -3567,11 +3567,11 @@ implementation
           are smaller than an entire register }
           are smaller than an entire register }
         if result and
         if result and
            { don't try to check the size of an open array }
            { don't try to check the size of an open array }
-           is_open_array(resultdef) or
-           (resultdef.size<left.resultdef.size) or
-           ((resultdef.size=left.resultdef.size) and
-            (left.resultdef.size<sizeof(aint)) and
-            (is_signed(resultdef) xor is_signed(left.resultdef))) then
+           (is_open_array(resultdef) or
+            (resultdef.size<left.resultdef.size) or
+            ((resultdef.size=left.resultdef.size) and
+             (left.resultdef.size<sizeof(aint)) and
+             (is_signed(resultdef) xor is_signed(left.resultdef)))) then
           make_not_regable(left,[ra_addr_regable]);
           make_not_regable(left,[ra_addr_regable]);
       end;
       end;
 
 

+ 4 - 2
compiler/ncon.pas

@@ -912,14 +912,16 @@ implementation
     procedure tstringconstnode.buildderefimpl;
     procedure tstringconstnode.buildderefimpl;
       begin
       begin
         inherited buildderefimpl;
         inherited buildderefimpl;
-        astringdefderef.build(astringdef);
+        if cst_type=cst_ansistring then
+          astringdefderef.build(astringdef);
       end;
       end;
 
 
 
 
     procedure tstringconstnode.derefimpl;
     procedure tstringconstnode.derefimpl;
       begin
       begin
         inherited derefimpl;
         inherited derefimpl;
-        astringdef:=tdef(astringdefderef.resolve);
+        if cst_type=cst_ansistring then
+          astringdef:=tdef(astringdefderef.resolve);
       end;
       end;
 
 
 
 

+ 24 - 17
compiler/ngenutil.pas

@@ -55,7 +55,8 @@ interface
      strict protected
      strict protected
       { called from wrap_proc_body to insert the trashing for the wrapped
       { called from wrap_proc_body to insert the trashing for the wrapped
         routine's local variables and parameters }
         routine's local variables and parameters }
-      class function  maybe_insert_trashing(pd: tprocdef; n: tnode): tnode; virtual;
+      class function  maybe_insert_trashing(pd: tprocdef; n: tnode): tnode;
+      class function  check_insert_trashing(pd: tprocdef): boolean; virtual;
       { callback called for every local variable and parameter by
       { callback called for every local variable and parameter by
         maybe_insert_trashing(), calls through to maybe_trash_variable() }
         maybe_insert_trashing(), calls through to maybe_trash_variable() }
       class procedure maybe_trash_variable_callback(p: TObject; statn: pointer);
       class procedure maybe_trash_variable_callback(p: TObject; statn: pointer);
@@ -330,8 +331,7 @@ implementation
       stat: tstatementnode;
       stat: tstatementnode;
     begin
     begin
       result:=n;
       result:=n;
-      if (localvartrashing<>-1)  and
-         not(po_assembler in pd.procoptions) then
+      if check_insert_trashing(pd) then
         begin
         begin
           result:=internalstatements(stat);
           result:=internalstatements(stat);
           pd.parast.SymList.ForEachCall(@maybe_trash_variable_callback,@stat);
           pd.parast.SymList.ForEachCall(@maybe_trash_variable_callback,@stat);
@@ -340,6 +340,13 @@ implementation
         end;
         end;
     end;
     end;
 
 
+  class function tnodeutils.check_insert_trashing(pd: tprocdef): boolean;
+    begin
+      result:=
+        (localvartrashing<>-1) and
+        not(po_assembler in pd.procoptions);
+    end;
+
 
 
   class function tnodeutils.trashable_sym(p: tsym): boolean;
   class function tnodeutils.trashable_sym(p: tsym): boolean;
     begin
     begin
@@ -572,14 +579,14 @@ implementation
           begin
           begin
             pd := tabstractrecorddef(structlist[i]).find_procdef_bytype(potype_class_constructor);
             pd := tabstractrecorddef(structlist[i]).find_procdef_bytype(potype_class_constructor);
             if assigned(pd) then
             if assigned(pd) then
-              unitinits.concat(Tai_const.Createname(pd.mangledname,0))
+              unitinits.concat(Tai_const.Createname(pd.mangledname,AT_FUNCTION,0))
             else
             else
-              unitinits.concat(Tai_const.Create_pint(0));
+              unitinits.concat(Tai_const.Create_nil_codeptr);
             pd := tabstractrecorddef(structlist[i]).find_procdef_bytype(potype_class_destructor);
             pd := tabstractrecorddef(structlist[i]).find_procdef_bytype(potype_class_destructor);
             if assigned(pd) then
             if assigned(pd) then
-              unitinits.concat(Tai_const.Createname(pd.mangledname,0))
+              unitinits.concat(Tai_const.Createname(pd.mangledname,AT_FUNCTION,0))
             else
             else
-              unitinits.concat(Tai_const.Create_pint(0));
+              unitinits.concat(Tai_const.Create_nil_codeptr);
             inc(count);
             inc(count);
           end;
           end;
           structlist.free;
           structlist.free;
@@ -598,13 +605,13 @@ implementation
          if (hp.u.flags and (uf_init or uf_finalize))<>0 then
          if (hp.u.flags and (uf_init or uf_finalize))<>0 then
            begin
            begin
              if (hp.u.flags and uf_init)<>0 then
              if (hp.u.flags and uf_init)<>0 then
-               unitinits.concat(Tai_const.Createname(make_mangledname('INIT$',hp.u.globalsymtable,''),0))
+               unitinits.concat(Tai_const.Createname(make_mangledname('INIT$',hp.u.globalsymtable,''),AT_FUNCTION,0))
              else
              else
-               unitinits.concat(Tai_const.Create_sym(nil));
+               unitinits.concat(Tai_const.Create_nil_codeptr);
              if (hp.u.flags and uf_finalize)<>0 then
              if (hp.u.flags and uf_finalize)<>0 then
-               unitinits.concat(Tai_const.Createname(make_mangledname('FINALIZE$',hp.u.globalsymtable,''),0))
+               unitinits.concat(Tai_const.Createname(make_mangledname('FINALIZE$',hp.u.globalsymtable,''),AT_FUNCTION,0))
              else
              else
-               unitinits.concat(Tai_const.Create_sym(nil));
+               unitinits.concat(Tai_const.Create_nil_codeptr);
              inc(count);
              inc(count);
            end;
            end;
          hp:=tused_unit(hp.next);
          hp:=tused_unit(hp.next);
@@ -616,13 +623,13 @@ implementation
       if (current_module.flags and (uf_init or uf_finalize))<>0 then
       if (current_module.flags and (uf_init or uf_finalize))<>0 then
         begin
         begin
           if (current_module.flags and uf_init)<>0 then
           if (current_module.flags and uf_init)<>0 then
-            unitinits.concat(Tai_const.Createname(make_mangledname('INIT$',current_module.localsymtable,''),0))
+            unitinits.concat(Tai_const.Createname(make_mangledname('INIT$',current_module.localsymtable,''),AT_FUNCTION,0))
           else
           else
-            unitinits.concat(Tai_const.Create_sym(nil));
+            unitinits.concat(Tai_const.Create_nil_codeptr);
           if (current_module.flags and uf_finalize)<>0 then
           if (current_module.flags and uf_finalize)<>0 then
-            unitinits.concat(Tai_const.Createname(make_mangledname('FINALIZE$',current_module.localsymtable,''),0))
+            unitinits.concat(Tai_const.Createname(make_mangledname('FINALIZE$',current_module.localsymtable,''),AT_FUNCTION,0))
           else
           else
-            unitinits.concat(Tai_const.Create_sym(nil));
+            unitinits.concat(Tai_const.Create_nil_codeptr);
           inc(count);
           inc(count);
         end;
         end;
       { Insert TableCount,InitCount at start }
       { Insert TableCount,InitCount at start }
@@ -824,8 +831,8 @@ implementation
         begin
         begin
           If (hp.flags and uf_has_resourcestrings)=uf_has_resourcestrings then
           If (hp.flags and uf_has_resourcestrings)=uf_has_resourcestrings then
             begin
             begin
-              ResourceStringTables.concat(Tai_const.Createname(make_mangledname('RESSTR',hp.localsymtable,'START'),0));
-              ResourceStringTables.concat(Tai_const.Createname(make_mangledname('RESSTR',hp.localsymtable,'END'),0));
+              ResourceStringTables.concat(Tai_const.Createname(make_mangledname('RESSTR',hp.localsymtable,'START'),AT_DATA,0));
+              ResourceStringTables.concat(Tai_const.Createname(make_mangledname('RESSTR',hp.localsymtable,'END'),AT_DATA,0));
               inc(count);
               inc(count);
             end;
             end;
           hp:=tmodule(hp.next);
           hp:=tmodule(hp.next);

+ 3 - 2
compiler/ninl.pas

@@ -1553,8 +1553,9 @@ implementation
         { the shortstring-longint val routine by default                   }
         { the shortstring-longint val routine by default                   }
         if (sourcepara.resultdef.typ = stringdef) then
         if (sourcepara.resultdef.typ = stringdef) then
           procname := procname + tstringdef(sourcepara.resultdef).stringtypname
           procname := procname + tstringdef(sourcepara.resultdef).stringtypname
-        { zero-based arrays (of char) can be implicitely converted to ansistring }
-        else if is_zero_based_array(sourcepara.resultdef) then
+        { zero-based arrays (of char) can be implicitely converted to ansistring, but don't do
+          so if not needed because the array is too short }
+        else if is_zero_based_array(sourcepara.resultdef) and (sourcepara.resultdef.size>255) then
           procname := procname + 'ansistr'
           procname := procname + 'ansistr'
         else
         else
           procname := procname + 'shortstr';
           procname := procname + 'shortstr';

+ 24 - 6
compiler/options.pas

@@ -892,6 +892,20 @@ begin
                         exclude(init_settings.localswitches,cs_check_io)
                         exclude(init_settings.localswitches,cs_check_io)
                       else
                       else
                         include(init_settings.localswitches,cs_check_io);
                         include(init_settings.localswitches,cs_check_io);
+{$ifdef arm}
+                    'I' :
+                      begin
+                        if (upper(copy(more,j+1,length(more)-j))='THUMB') and
+                          { does selected CPU really understand thumb? }
+                          (init_settings.cputype in cpu_has_thumb) then
+                          init_settings.instructionset:=is_thumb
+                        else if upper(copy(more,j+1,length(more)-j))='ARM' then
+                          init_settings.instructionset:=is_arm
+                        else
+                          IllegalPara(opt);
+                        break;
+                      end;
+{$endif arm}
                     'n' :
                     'n' :
                       If UnsetBool(More, j, opt, false) then
                       If UnsetBool(More, j, opt, false) then
                         exclude(init_settings.globalswitches,cs_link_nolink)
                         exclude(init_settings.globalswitches,cs_link_nolink)
@@ -915,7 +929,7 @@ begin
                     'p' :
                     'p' :
                       begin
                       begin
                         s:=upper(copy(more,j+1,length(more)-j));
                         s:=upper(copy(more,j+1,length(more)-j));
-                        if not(Setcputype(s,init_settings.cputype)) then
+                        if not(Setcputype(s,init_settings)) then
                           IllegalPara(opt);
                           IllegalPara(opt);
                         CPUSetExplicitly:=true;
                         CPUSetExplicitly:=true;
                         break;
                         break;
@@ -1404,7 +1418,7 @@ begin
                       include(init_settings.optimizerswitches,cs_opt_size);
                       include(init_settings.optimizerswitches,cs_opt_size);
                     'p' :
                     'p' :
                       begin
                       begin
-                        if not Setcputype(copy(more,j+1,length(more)),init_settings.optimizecputype) then
+                        if not Setoptimizecputype(copy(more,j+1,length(more)),init_settings.optimizecputype) then
                           begin
                           begin
                             OptCPUSetExplicitly:=true;
                             OptCPUSetExplicitly:=true;
                             { Give warning for old i386 switches }
                             { Give warning for old i386 switches }
@@ -1847,6 +1861,7 @@ begin
                       end;
                       end;
                     'm':
                     'm':
                       begin
                       begin
+{$if defined(i8086)}
                         if (target_info.system in [system_i8086_msdos]) then
                         if (target_info.system in [system_i8086_msdos]) then
                           begin
                           begin
                             case Upper(Copy(More,j+1,255)) of
                             case Upper(Copy(More,j+1,255)) of
@@ -1862,6 +1877,7 @@ begin
                             break;
                             break;
                           end
                           end
                         else
                         else
+{$endif defined(i8086)}
                           IllegalPara(opt);
                           IllegalPara(opt);
                       end;
                       end;
                     'M':
                     'M':
@@ -3225,7 +3241,7 @@ begin
   { Force use of external linker if there is no
   { Force use of external linker if there is no
     internal linker or the linking is skipped }
     internal linker or the linking is skipped }
   if not(cs_link_extern in init_settings.globalswitches) and
   if not(cs_link_extern in init_settings.globalswitches) and
-     (not assigned(target_info.link) or
+     ((target_info.link=ld_none) or
       (cs_link_nolink in init_settings.globalswitches)) then
       (cs_link_nolink in init_settings.globalswitches)) then
     include(init_settings.globalswitches,cs_link_extern);
     include(init_settings.globalswitches,cs_link_extern);
 
 
@@ -3322,14 +3338,14 @@ if (target_info.abi = abi_eabihf) then
 {$endif CPUARMV6}
 {$endif CPUARMV6}
   end;
   end;
 
 
-  if init_settings.cputype in cpu_thumb then
+  if (init_settings.instructionset=is_thumb) and not(CPUARM_HAS_THUMB2 in cpu_capabilities[init_settings.cputype]) then
     begin
     begin
       def_system_macro('CPUTHUMB');
       def_system_macro('CPUTHUMB');
       if not option.FPUSetExplicitly then
       if not option.FPUSetExplicitly then
         init_settings.fputype:=fpu_soft;
         init_settings.fputype:=fpu_soft;
     end;
     end;
 
 
-  if init_settings.cputype in cpu_thumb2 then
+  if (init_settings.instructionset=is_thumb) and (CPUARM_HAS_THUMB2 in cpu_capabilities[init_settings.cputype]) then
     def_system_macro('CPUTHUMB2');
     def_system_macro('CPUTHUMB2');
 {$endif arm}
 {$endif arm}
 
 
@@ -3408,7 +3424,9 @@ if (target_info.abi = abi_eabihf) then
   { it is determined during system unit compilation if clz is used for bsf or not,
   { it is determined during system unit compilation if clz is used for bsf or not,
     this is not perfect but the current implementation bsf/bsr does not allow another
     this is not perfect but the current implementation bsf/bsr does not allow another
     solution }
     solution }
-  if CPUARM_HAS_CLZ in cpu_capabilities[init_settings.cputype] then
+  if (CPUARM_HAS_CLZ in cpu_capabilities[init_settings.cputype]) and
+     ((init_settings.instructionset=is_arm) or
+      (CPUARM_HAS_THUMB2 in cpu_capabilities[init_settings.cputype])) then
     begin
     begin
       def_system_macro('FPC_HAS_INTERNAL_BSR');
       def_system_macro('FPC_HAS_INTERNAL_BSR');
       if CPUARM_HAS_RBIT in cpu_capabilities[init_settings.cputype] then
       if CPUARM_HAS_RBIT in cpu_capabilities[init_settings.cputype] then

+ 16 - 1
compiler/pdecsub.pas

@@ -103,7 +103,7 @@ implementation
        { parameter handling }
        { parameter handling }
        paramgr,cpupara,
        paramgr,cpupara,
        { pass 1 }
        { pass 1 }
-       fmodule,node,htypechk,ncon,
+       fmodule,node,htypechk,ncon,ppu,
        objcutil,
        objcutil,
        { parser }
        { parser }
        scanner,
        scanner,
@@ -907,6 +907,14 @@ implementation
                         HideSym(srsym);
                         HideSym(srsym);
                         searchagain:=true;
                         searchagain:=true;
                       end
                       end
+                     else
+                     if (m_delphi in current_settings.modeswitches) and
+                        (srsym.typ=absolutevarsym) and
+                        ([vo_is_funcret,vo_is_result]*tabstractvarsym(srsym).varoptions=[vo_is_funcret]) then
+                       begin
+                         HideSym(srsym);
+                         searchagain:=true;
+                       end
                      else
                      else
                       begin
                       begin
                         {  we use a different error message for tp7 so it looks more compatible }
                         {  we use a different error message for tp7 so it looks more compatible }
@@ -1078,6 +1086,13 @@ implementation
               end;
               end;
             single_type(pd.returndef,[stoAllowSpecialization]);
             single_type(pd.returndef,[stoAllowSpecialization]);
 
 
+// Issue #24863, commented out for now because it breaks building of RTL and needs extensive
+// testing and/or RTL patching.
+{
+            if ((pd.returndef=cvarianttype) or (pd.returndef=colevarianttype)) and
+               not(cs_compilesystem in current_settings.moduleswitches) then
+              current_module.flags:=current_module.flags or uf_uses_variants;
+}
             if is_dispinterface(pd.struct) and not is_automatable(pd.returndef) then
             if is_dispinterface(pd.struct) and not is_automatable(pd.returndef) then
               Message1(type_e_not_automatable,pd.returndef.typename);
               Message1(type_e_not_automatable,pd.returndef.typename);
 
 

+ 51 - 28
compiler/pexpr.pas

@@ -337,8 +337,8 @@ implementation
                             begin
                             begin
                               if not(assigned(exit_procinfo.nestedexitlabel)) then
                               if not(assigned(exit_procinfo.nestedexitlabel)) then
                                 begin
                                 begin
-                                  include(exit_procinfo.flags,pi_has_nested_exit);
-                                  exclude(exit_procinfo.procdef.procoptions,po_inline);
+                                  include(current_procinfo.flags,pi_has_nested_exit);
+                                  exclude(current_procinfo.procdef.procoptions,po_inline);
 
 
                                   exit_procinfo.nestedexitlabel:=tlabelsym.create('$nestedexit');
                                   exit_procinfo.nestedexitlabel:=tlabelsym.create('$nestedexit');
 
 
@@ -907,6 +907,8 @@ implementation
 
 
 
 
     function maybe_load_methodpointer(st:TSymtable;var p1:tnode):boolean;
     function maybe_load_methodpointer(st:TSymtable;var p1:tnode):boolean;
+      var
+        pd: tprocdef;
       begin
       begin
         maybe_load_methodpointer:=false;
         maybe_load_methodpointer:=false;
         if not assigned(p1) then
         if not assigned(p1) then
@@ -920,12 +922,19 @@ implementation
              ObjectSymtable,
              ObjectSymtable,
              recordsymtable:
              recordsymtable:
                begin
                begin
-                 { We are calling from the static class method which has no self node }
-                 if assigned(current_procinfo) and current_procinfo.procdef.no_self_node then
-                   if st.symtabletype=recordsymtable then
-                     p1:=ctypenode.create(current_procinfo.procdef.struct)
-                   else
-                     p1:=cloadvmtaddrnode.create(ctypenode.create(current_procinfo.procdef.struct))
+                 { Escape nested procedures }
+                 if assigned(current_procinfo) then
+                   begin
+                     pd:=current_procinfo.get_normal_proc.procdef;
+                     { We are calling from the static class method which has no self node }
+                     if assigned(pd) and pd.no_self_node then
+                       if st.symtabletype=recordsymtable then
+                         p1:=ctypenode.create(pd.struct)
+                       else
+                         p1:=cloadvmtaddrnode.create(ctypenode.create(pd.struct))
+                     else
+                       p1:=load_self_node;
+                   end
                  else
                  else
                    p1:=load_self_node;
                    p1:=load_self_node;
                  { We are calling a member }
                  { We are calling a member }
@@ -1288,7 +1297,7 @@ implementation
                             if assigned(p1) and
                             if assigned(p1) and
                               (
                               (
                                 is_self_node(p1) or
                                 is_self_node(p1) or
-                                (assigned(current_procinfo) and (current_procinfo.procdef.no_self_node) and
+                                (assigned(current_procinfo) and (current_procinfo.get_normal_proc.procdef.no_self_node) and
                                 (current_procinfo.procdef.struct=structh))) then
                                 (current_procinfo.procdef.struct=structh))) then
                               Message(parser_e_only_class_members)
                               Message(parser_e_only_class_members)
                             else
                             else
@@ -1400,8 +1409,8 @@ implementation
                 if assigned(srsym) then
                 if assigned(srsym) then
                   begin
                   begin
                     check_hints(srsym,srsym.symoptions,srsym.deprecatedmsg);
                     check_hints(srsym,srsym.symoptions,srsym.deprecatedmsg);
-                        consume(_ID);
-                        do_member_read(tabstractrecorddef(hdef),getaddr,srsym,result,again,[]);
+                    consume(_ID);
+                    do_member_read(tabstractrecorddef(hdef),getaddr,srsym,result,again,[]);
                   end
                   end
                 else
                 else
                   Message1(sym_e_id_no_member,orgpattern);
                   Message1(sym_e_id_no_member,orgpattern);
@@ -2404,11 +2413,12 @@ implementation
            end;
            end;
 
 
          var
          var
-           srsym : tsym;
-           srsymtable : TSymtable;
-           hdef  : tdef;
+           srsym: tsym;
+           srsymtable: TSymtable;
+           hdef: tdef;
+           pd: tprocdef;
            orgstoredpattern,
            orgstoredpattern,
-           storedpattern : string;
+           storedpattern: string;
            callflags: tcallnodeflags;
            callflags: tcallnodeflags;
            t : ttoken;
            t : ttoken;
            unit_found : boolean;
            unit_found : boolean;
@@ -2566,10 +2576,18 @@ implementation
                             else
                             else
                               p1:=cloadvmtaddrnode.create(ctypenode.create(hdef))
                               p1:=cloadvmtaddrnode.create(ctypenode.create(hdef))
                           else
                           else
-                          if assigned(current_procinfo) and current_procinfo.procdef.no_self_node then
-                            p1:=cloadvmtaddrnode.create(ctypenode.create(current_procinfo.procdef.struct))
-                          else
-                            p1:=load_self_node;
+                            begin
+                              if assigned(current_procinfo) then
+                                begin
+                                  pd:=current_procinfo.get_normal_proc.procdef;
+                                  if assigned(pd) and pd.no_self_node then
+                                    p1:=cloadvmtaddrnode.create(ctypenode.create(pd.struct))
+                                  else
+                                    p1:=load_self_node;
+                                end
+                              else
+                                p1:=load_self_node;
+                            end;
                         { now, if the field itself is part of an objectsymtab }
                         { now, if the field itself is part of an objectsymtab }
                         { (it can be even if it was found in a withsymtable,  }
                         { (it can be even if it was found in a withsymtable,  }
                         {  e.g., "with classinstance do field := 5"), then    }
                         {  e.g., "with classinstance do field := 5"), then    }
@@ -2664,12 +2682,10 @@ implementation
                       begin
                       begin
                         if (srsymtable.symtabletype in [ObjectSymtable,recordsymtable]) then
                         if (srsymtable.symtabletype in [ObjectSymtable,recordsymtable]) then
                           { if we are accessing a owner procsym from the nested }
                           { if we are accessing a owner procsym from the nested }
-                          { class we need to call it as a class member          }
-                          if assigned(current_structdef) and (current_structdef<>hdef) and is_owned_by(current_structdef,hdef) then
-                            p1:=cloadvmtaddrnode.create(ctypenode.create(hdef))
-                          else
-                          if assigned(current_procinfo) and current_procinfo.procdef.no_self_node then
-                          { no self node in static class methods }
+                          { class or from a static class method we need to call }
+                          { it as a class member                                }
+                          if (assigned(current_structdef) and (current_structdef<>hdef) and is_owned_by(current_structdef,hdef)) or
+                             (assigned(current_procinfo) and current_procinfo.get_normal_proc.procdef.no_self_node) then
                             p1:=cloadvmtaddrnode.create(ctypenode.create(hdef))
                             p1:=cloadvmtaddrnode.create(ctypenode.create(hdef))
                           else
                           else
                             p1:=load_self_node;
                             p1:=load_self_node;
@@ -2788,6 +2804,15 @@ implementation
            factor_read_set:=buildp;
            factor_read_set:=buildp;
          end;
          end;
 
 
+         function can_load_self_node: boolean;
+         begin
+           result:=false;
+           if (block_type in [bt_const,bt_type,bt_const_type,bt_var_type]) or
+              not assigned(current_structdef) or
+              not assigned(current_procinfo) then
+             exit;
+           result:=not current_procinfo.get_normal_proc.procdef.no_self_node;
+         end;
 
 
       {---------------------------------------------
       {---------------------------------------------
                       Factor (Main)
                       Factor (Main)
@@ -2822,9 +2847,7 @@ implementation
          begin
          begin
            again:=true;
            again:=true;
            { Handle references to self }
            { Handle references to self }
-           if (idtoken=_SELF) and
-              not(block_type in [bt_const,bt_type,bt_const_type,bt_var_type]) and
-              assigned(current_structdef) then
+           if (idtoken=_SELF) and can_load_self_node then
              begin
              begin
                p1:=load_self_node;
                p1:=load_self_node;
                consume(_ID);
                consume(_ID);

+ 4 - 0
compiler/pgenutil.pas

@@ -1009,6 +1009,10 @@ uses
 
 
               for i:=firstidx to result.count-1 do
               for i:=firstidx to result.count-1 do
                 ttypesym(result[i]).typedef:=basedef;
                 ttypesym(result[i]).typedef:=basedef;
+              { we need a typesym in case we do a Delphi-mode inline
+                specialization with this parameter; so just use the first sym }
+              if not assigned(basedef.typesym) then
+                basedef.typesym:=ttypesym(result[firstidx]);
               firstidx:=result.count;
               firstidx:=result.count;
 
 
               constraintdata.free;
               constraintdata.free;

+ 1 - 1
compiler/powerpc/agppcmpw.pas

@@ -1036,7 +1036,7 @@ interface
                         //Procedure entry points:
                         //Procedure entry points:
                         if not macos_direct_globals then
                         if not macos_direct_globals then
                           begin
                           begin
-                            WriteDataHeader(s, tai_label(hp).is_global, true);
+                            WriteDataHeader(s, tai_label(hp).labsym.bind in [AB_GLOBAL,AB_PRIVATE_EXTERN], true);
                           end
                           end
                         else
                         else
                           begin
                           begin

+ 2 - 2
compiler/ppcgen/cgppc.pas

@@ -320,13 +320,13 @@ unit cgppc;
         else
         else
           stubalign:=16;
           stubalign:=16;
         new_section(current_asmdata.asmlists[al_imports],sec_stub,'',stubalign);
         new_section(current_asmdata.asmlists[al_imports],sec_stub,'',stubalign);
-        result := current_asmdata.RefAsmSymbol(stubname);
+        result := current_asmdata.DefineAsmSymbol(stubname,AB_LOCAL,AT_FUNCTION);
         current_asmdata.asmlists[al_imports].concat(Tai_symbol.Create(result,0));
         current_asmdata.asmlists[al_imports].concat(Tai_symbol.Create(result,0));
         { register as a weak symbol if necessary }
         { register as a weak symbol if necessary }
         if weak then
         if weak then
           current_asmdata.weakrefasmsymbol(s);
           current_asmdata.weakrefasmsymbol(s);
         current_asmdata.asmlists[al_imports].concat(tai_directive.create(asd_indirect_symbol,s));
         current_asmdata.asmlists[al_imports].concat(tai_directive.create(asd_indirect_symbol,s));
-        l1 := current_asmdata.RefAsmSymbol('L'+s+'$lazy_ptr');
+        l1 := current_asmdata.DefineAsmSymbol('L'+s+'$lazy_ptr',AB_LOCAL,AT_DATA);
         reference_reset_symbol(href,l1,0,sizeof(pint));
         reference_reset_symbol(href,l1,0,sizeof(pint));
         href.refaddr := addr_higha;
         href.refaddr := addr_higha;
         if (cs_create_pic in current_settings.moduleswitches) then
         if (cs_create_pic in current_settings.moduleswitches) then

+ 4 - 1
compiler/ppu.pas

@@ -43,7 +43,7 @@ type
 {$endif Test_Double_checksum}
 {$endif Test_Double_checksum}
 
 
 const
 const
-  CurrentPPUVersion = 162;
+  CurrentPPUVersion = 163;
 
 
 { buffer sizes }
 { buffer sizes }
   maxentrysize = 1024;
   maxentrysize = 1024;
@@ -162,6 +162,9 @@ const
   uf_wideinits           = $400000; { this unit has winlike widestring typed constants }
   uf_wideinits           = $400000; { this unit has winlike widestring typed constants }
   uf_classinits          = $800000; { this unit has class constructors/destructors }
   uf_classinits          = $800000; { this unit has class constructors/destructors }
   uf_resstrinits        = $1000000; { this unit has string consts referencing resourcestrings }
   uf_resstrinits        = $1000000; { this unit has string consts referencing resourcestrings }
+  uf_i8086_far_code     = $2000000; { this unit uses an i8086 memory model with far code (i.e. medium, large or huge) }
+  uf_i8086_far_data     = $4000000; { this unit uses an i8086 memory model with far data (i.e. compact or large) }
+  uf_i8086_huge_data    = $8000000; { this unit uses an i8086 memory model with huge data (i.e. huge) }
 
 
 {$ifdef generic_cpu}
 {$ifdef generic_cpu}
 { We need to use the correct size of aint and pint for
 { We need to use the correct size of aint and pint for

+ 11 - 0
compiler/procinfo.pas

@@ -52,6 +52,9 @@ unit procinfo;
        { This object gives information on the current routine being
        { This object gives information on the current routine being
          compiled.
          compiled.
        }
        }
+
+       { tprocinfo }
+
        tprocinfo = class(tlinkedlistitem)
        tprocinfo = class(tlinkedlistitem)
        private
        private
           { list to store the procinfo's of the nested procedures }
           { list to store the procinfo's of the nested procedures }
@@ -165,6 +168,7 @@ unit procinfo;
 
 
           function get_first_nestedproc: tprocinfo;
           function get_first_nestedproc: tprocinfo;
           function has_nestedprocs: boolean;
           function has_nestedprocs: boolean;
+          function get_normal_proc: tprocinfo;
 
 
           { Add to parent's list of nested procedures even if parent is a 'main' procedure }
           { Add to parent's list of nested procedures even if parent is a 'main' procedure }
           procedure force_nested;
           procedure force_nested;
@@ -268,6 +272,13 @@ implementation
         result:=assigned(nestedprocs) and (nestedprocs.count>0);
         result:=assigned(nestedprocs) and (nestedprocs.count>0);
       end;
       end;
 
 
+    function tprocinfo.get_normal_proc: tprocinfo;
+      begin
+        result:=self;
+        while assigned(result.parent)and(result.procdef.parast.symtablelevel>normal_function_level) do
+          result:=result.parent;
+      end;
+
     procedure tprocinfo.save_jump_labels(out saved: tsavedlabels);
     procedure tprocinfo.save_jump_labels(out saved: tsavedlabels);
       begin
       begin
         saved[false]:=CurrFalseLabel;
         saved[false]:=CurrFalseLabel;

+ 26 - 27
compiler/pstatmnt.pas

@@ -53,7 +53,7 @@ implementation
        nutils,ngenutil,nbas,nmat,nadd,ncal,nmem,nset,ncnv,ninl,ncon,nld,nflw,
        nutils,ngenutil,nbas,nmat,nadd,ncal,nmem,nset,ncnv,ninl,ncon,nld,nflw,
        { parser }
        { parser }
        scanner,
        scanner,
-       pbase,pexpr,
+       pbase,ptype,pexpr,
        { codegen }
        { codegen }
        procinfo,cgbase,
        procinfo,cgbase,
        { assembler reader }
        { assembler reader }
@@ -825,6 +825,18 @@ implementation
 
 
 
 
     function try_statement : tnode;
     function try_statement : tnode;
+
+      procedure check_type_valid(var def: tdef);
+        begin
+           if not (is_class(def) or is_javaclass(def) or
+              { skip showing error message the second time }
+              (def.typ=errordef)) then
+             begin
+               Message1(type_e_class_type_expected,def.typename);
+               def:=generrordef;
+             end;
+        end;
+
       var
       var
          p_try_block,p_finally_block,first,last,
          p_try_block,p_finally_block,first,last,
          p_default,p_specific,hp : tnode;
          p_default,p_specific,hp : tnode;
@@ -900,22 +912,9 @@ implementation
                           { is a explicit name for the exception given ? }
                           { is a explicit name for the exception given ? }
                           if try_to_consume(_COLON) then
                           if try_to_consume(_COLON) then
                             begin
                             begin
-                               consume_sym(srsym,srsymtable);
-                               if (srsym.typ=typesym) and
-                                  (is_class(ttypesym(srsym).typedef) or
-                                   is_javaclass(ttypesym(srsym).typedef)) then
-                                 begin
-                                    ot:=ttypesym(srsym).typedef;
-                                    sym:=tlocalvarsym.create(objrealname,vs_value,ot,[]);
-                                 end
-                               else
-                                 begin
-                                    sym:=tlocalvarsym.create(objrealname,vs_value,generrordef,[]);
-                                    if (srsym.typ=typesym) then
-                                      Message1(type_e_class_type_expected,ttypesym(srsym).typedef.typename)
-                                    else
-                                      Message1(type_e_class_type_expected,ot.typename);
-                                 end;
+                              single_type(ot,[]);
+                              check_type_valid(ot);
+                              sym:=tlocalvarsym.create(objrealname,vs_value,ot,[]);
                             end
                             end
                           else
                           else
                             begin
                             begin
@@ -933,19 +932,19 @@ implementation
                                  consume(t);
                                  consume(t);
                                { check if type is valid, must be done here because
                                { check if type is valid, must be done here because
                                  with "e: Exception" the e is not necessary }
                                  with "e: Exception" the e is not necessary }
-                               if (srsym.typ=typesym) and
-                                  (is_class(ttypesym(srsym).typedef) or
-                                   is_javaclass(ttypesym(srsym).typedef)) then
-                                 ot:=ttypesym(srsym).typedef
+                               if (srsym.typ=typesym) then
+                                 begin
+                                   ot:=ttypesym(srsym).typedef;
+                                   parse_nested_types(ot,false,nil);
+                                   check_type_valid(ot);
+                                 end
                                else
                                else
                                  begin
                                  begin
-                                    ot:=generrordef;
-                                    if (srsym.typ=typesym) then
-                                      Message1(type_e_class_type_expected,ttypesym(srsym).typedef.typename)
-                                    else
-                                      Message1(type_e_class_type_expected,ot.typename);
+                                   Message(type_e_type_id_expected);
+                                   ot:=generrordef;
                                  end;
                                  end;
-                               { create dummy symbol so we don't need a special
+
+                                 { create dummy symbol so we don't need a special
                                  case in ncgflw, and so that we always know the
                                  case in ncgflw, and so that we always know the
                                  type }
                                  type }
                                sym:=tlocalvarsym.create('$exceptsym',vs_value,ot,[]);
                                sym:=tlocalvarsym.create('$exceptsym',vs_value,ot,[]);

+ 1 - 1
compiler/psub.pas

@@ -957,7 +957,7 @@ implementation
 {$if defined(arm)}
 {$if defined(arm)}
         { frame and stack pointer must be always the same on arm thumb so it makes no
         { frame and stack pointer must be always the same on arm thumb so it makes no
           sense to fiddle with a frame pointer }
           sense to fiddle with a frame pointer }
-        if current_settings.cputype in cpu_thumb then
+        if GenerateThumbCode then
           begin
           begin
             framepointer:=NR_STACK_POINTER_REG;
             framepointer:=NR_STACK_POINTER_REG;
             tg.direction:=1;
             tg.direction:=1;

+ 0 - 2
compiler/psystem.pas

@@ -683,8 +683,6 @@ implementation
         aiclass[ait_stab]:=tai_stab;
         aiclass[ait_stab]:=tai_stab;
         aiclass[ait_force_line]:=tai_force_line;
         aiclass[ait_force_line]:=tai_force_line;
         aiclass[ait_function_name]:=tai_function_name;
         aiclass[ait_function_name]:=tai_function_name;
-        aiclass[ait_ent]:=tai_ent;
-        aiclass[ait_ent_end]:=tai_ent_end;
 {$ifdef alpha}
 {$ifdef alpha}
           { the follow is for the DEC Alpha }
           { the follow is for the DEC Alpha }
         aiclass[ait_frame]:=tai_frame;
         aiclass[ait_frame]:=tai_frame;

+ 3 - 0
compiler/ptype.pas

@@ -49,6 +49,9 @@ interface
     { reads any type declaration }
     { reads any type declaration }
     procedure read_anon_type(var def : tdef;parseprocvardir:boolean);
     procedure read_anon_type(var def : tdef;parseprocvardir:boolean);
 
 
+    { parse nested type declaration of the def (typedef) }
+    procedure parse_nested_types(var def: tdef; isforwarddef: boolean; currentstructstack: tfpobjectlist);
+
 
 
     { add a definition for a method to a record/objectdef that will contain
     { add a definition for a method to a record/objectdef that will contain
       all code for initialising typed constants (only for targets in
       all code for initialising typed constants (only for targets in

+ 248 - 91
compiler/scanner.pas

@@ -844,6 +844,150 @@ In case not, the value returned can be arbitrary.
           current_scanner.preproc_token:=current_scanner.readpreproc;
           current_scanner.preproc_token:=current_scanner.readpreproc;
         end;
         end;
 
 
+        function try_consume_unitsym(var srsym:tsym;var srsymtable:TSymtable;var tokentoconsume:ttoken):boolean;
+          var
+            hmodule: tmodule;
+            ns:ansistring;
+            nssym:tsym;
+          begin
+            result:=false;
+            tokentoconsume:=_ID;
+
+            if assigned(srsym) and (srsym.typ in [unitsym,namespacesym]) then
+              begin
+                if not(srsym.owner.symtabletype in [staticsymtable,globalsymtable]) then
+                  internalerror(200501154);
+                { only allow unit.symbol access if the name was
+                  found in the current module
+                  we can use iscurrentunit because generic specializations does not
+                  change current_unit variable }
+                hmodule:=find_module_from_symtable(srsym.Owner);
+                if not Assigned(hmodule) then
+                  internalerror(201001120);
+                if hmodule.unit_index=current_filepos.moduleindex then
+                  begin
+                    preproc_consume(_POINT);
+                    current_scanner.skipspace;
+                    if srsym.typ=namespacesym then
+                      begin
+                        ns:=srsym.name;
+                        nssym:=srsym;
+                        while assigned(srsym) and (srsym.typ=namespacesym) do
+                          begin
+                            { we have a namespace. the next identifier should be either a namespace or a unit }
+                            searchsym_in_module(hmodule,ns+'.'+current_scanner.preproc_pattern,srsym,srsymtable);
+                            if assigned(srsym) and (srsym.typ in [namespacesym,unitsym]) then
+                              begin
+                                ns:=ns+'.'+current_scanner.preproc_pattern;
+                                nssym:=srsym;
+                                preproc_consume(_ID);
+                                current_scanner.skipspace;
+                                preproc_consume(_POINT);
+                                current_scanner.skipspace;
+                              end;
+                          end;
+                        { check if there is a hidden unit with this pattern in the namespace }
+                        if not assigned(srsym) and
+                           assigned(nssym) and (nssym.typ=namespacesym) and assigned(tnamespacesym(nssym).unitsym) then
+                          srsym:=tnamespacesym(nssym).unitsym;
+                        if assigned(srsym) and (srsym.typ<>unitsym) then
+                          internalerror(201108260);
+                        if not assigned(srsym) then
+                          begin
+                            result:=true;
+                            srsymtable:=nil;
+                            exit;
+                          end;
+                      end;
+                    case current_scanner.preproc_token of
+                      _ID:
+                        { system.char? (char=widechar comes from the implicit
+                          uuchar unit -> override) }
+                        if (current_scanner.preproc_pattern='CHAR') and
+                           (tmodule(tunitsym(srsym).module).globalsymtable=systemunit) then
+                          begin
+                            if m_default_unicodestring in current_settings.modeswitches then
+                              searchsym_in_module(tunitsym(srsym).module,'WIDECHAR',srsym,srsymtable)
+                            else
+                              searchsym_in_module(tunitsym(srsym).module,'ANSICHAR',srsym,srsymtable)
+                          end
+                        else
+                          searchsym_in_module(tunitsym(srsym).module,current_scanner.preproc_pattern,srsym,srsymtable);
+                      _STRING:
+                        begin
+                          { system.string? }
+                          if tmodule(tunitsym(srsym).module).globalsymtable=systemunit then
+                            begin
+                              if cs_refcountedstrings in current_settings.localswitches then
+                                begin
+                                  if m_default_unicodestring in current_settings.modeswitches then
+                                    searchsym_in_module(tunitsym(srsym).module,'UNICODESTRING',srsym,srsymtable)
+                                  else
+                                    searchsym_in_module(tunitsym(srsym).module,'ANSISTRING',srsym,srsymtable)
+                                end
+                              else
+                                searchsym_in_module(tunitsym(srsym).module,'SHORTSTRING',srsym,srsymtable);
+                              tokentoconsume:=_STRING;
+                            end;
+                        end
+                      end;
+                  end
+                else
+                  begin
+                    srsym:=nil;
+                    srsymtable:=nil;
+                  end;
+                result:=true;
+              end;
+          end;
+
+        procedure try_consume_nestedsym(var srsym:tsym;var srsymtable:TSymtable);
+          var
+            def:tdef;
+            tokentoconsume:ttoken;
+            found:boolean;
+          begin
+            found:=try_consume_unitsym(srsym,srsymtable,tokentoconsume);
+            if found then
+              begin
+                preproc_consume(tokentoconsume);
+                current_scanner.skipspace;
+              end;
+             while (current_scanner.preproc_token=_POINT) do
+               begin
+                 if assigned(srsym)and(srsym.typ=typesym) then
+                   begin
+                     def:=ttypesym(srsym).typedef;
+                     if is_class_or_object(def) or is_record(def) or is_java_class_or_interface(def) then
+                       begin
+                         preproc_consume(_POINT);
+                         current_scanner.skipspace;
+                         if def.typ=objectdef then
+                           found:=searchsym_in_class(tobjectdef(def),tobjectdef(def),current_scanner.preproc_pattern,srsym,srsymtable,true)
+                         else
+                           found:=searchsym_in_record(trecorddef(def),current_scanner.preproc_pattern,srsym,srsymtable);
+                         if not found then
+                           begin
+                             Message1(sym_e_id_not_found,current_scanner.preproc_pattern);
+                             exit;
+                           end;
+                         preproc_consume(_ID);
+                         current_scanner.skipspace;
+                       end
+                     else
+                       begin
+                         Message(sym_e_type_must_be_rec_or_object_or_class);
+                         exit;
+                       end;
+                   end
+                 else
+                   begin
+                     Message(type_e_type_id_expected);
+                     exit;
+                   end;
+               end;
+          end;
+
         function preproc_substitutedtoken(var macroType: TCTETypeSet; eval : Boolean): string;
         function preproc_substitutedtoken(var macroType: TCTETypeSet; eval : Boolean): string;
                                 { Currently this parses identifiers as well as numbers.
                                 { Currently this parses identifiers as well as numbers.
           The result from this procedure can either be that the token
           The result from this procedure can either be that the token
@@ -941,7 +1085,7 @@ In case not, the value returned can be arbitrary.
 
 
         function read_factor(var factorType: TCTETypeSet; eval : Boolean) : string;
         function read_factor(var factorType: TCTETypeSet; eval : Boolean) : string;
         var
         var
-           hs,countstr : string;
+           hs,countstr,storedpattern: string;
            mac: tmacro;
            mac: tmacro;
            srsym : tsym;
            srsym : tsym;
            srsymtable : TSymtable;
            srsymtable : TSymtable;
@@ -950,7 +1094,6 @@ In case not, the value returned can be arbitrary.
            w : integer;
            w : integer;
            hasKlammer: Boolean;
            hasKlammer: Boolean;
            setElemType : TCTETypeSet;
            setElemType : TCTETypeSet;
-
         begin
         begin
            read_factor:='';
            read_factor:='';
            if current_scanner.preproc_token=_ID then
            if current_scanner.preproc_token=_ID then
@@ -1069,27 +1212,30 @@ In case not, the value returned can be arbitrary.
                     else
                     else
                       Message(scan_e_preproc_syntax_error);
                       Message(scan_e_preproc_syntax_error);
 
 
+                    storedpattern:=current_scanner.preproc_pattern;
+                    preproc_consume(_ID);
+                    current_scanner.skipspace;
+
                     if eval then
                     if eval then
-                      if searchsym(current_scanner.preproc_pattern,srsym,srsymtable) then
+                      if searchsym(storedpattern,srsym,srsymtable) then
                         begin
                         begin
+                          try_consume_nestedsym(srsym,srsymtable);
                           l:=0;
                           l:=0;
-                          case srsym.typ of
-                            staticvarsym,
-                            localvarsym,
-                            paravarsym :
-                              l:=tabstractvarsym(srsym).getsize;
-                            typesym:
-                              l:=ttypesym(srsym).typedef.size;
-                            else
-                              Message(scan_e_error_in_preproc_expr);
-                          end;
+                          if assigned(srsym) then
+                            case srsym.typ of
+                              staticvarsym,
+                              localvarsym,
+                              paravarsym :
+                                l:=tabstractvarsym(srsym).getsize;
+                              typesym:
+                                l:=ttypesym(srsym).typedef.size;
+                              else
+                                Message(scan_e_error_in_preproc_expr);
+                            end;
                           str(l,read_factor);
                           str(l,read_factor);
                         end
                         end
                       else
                       else
-                        Message1(sym_e_id_not_found,current_scanner.preproc_pattern);
-
-                    preproc_consume(_ID);
-                    current_scanner.skipspace;
+                        Message1(sym_e_id_not_found,storedpattern);
 
 
                     if current_scanner.preproc_token =_RKLAMMER then
                     if current_scanner.preproc_token =_RKLAMMER then
                       preproc_consume(_RKLAMMER)
                       preproc_consume(_RKLAMMER)
@@ -1110,23 +1256,29 @@ In case not, the value returned can be arbitrary.
                     else
                     else
                       Message(scan_e_preproc_syntax_error);
                       Message(scan_e_preproc_syntax_error);
 
 
+                    storedpattern:=current_scanner.preproc_pattern;
+                    preproc_consume(_ID);
+                    current_scanner.skipspace;
+
                     if eval then
                     if eval then
-                      if searchsym(current_scanner.preproc_pattern,srsym,srsymtable) then
+                      if searchsym(storedpattern,srsym,srsymtable) then
                         begin
                         begin
+                          try_consume_nestedsym(srsym,srsymtable);
                           hdef:=nil;
                           hdef:=nil;
                           hs:='';
                           hs:='';
                           l:=0;
                           l:=0;
-                          case srsym.typ of
-                            staticvarsym,
-                            localvarsym,
-                            paravarsym :
-                              hdef:=tabstractvarsym(srsym).vardef;
-                            typesym:
-                              hdef:=ttypesym(srsym).typedef;
-                            else
-                              Message(scan_e_error_in_preproc_expr);
-                          end;
-                          if hdef<>nil then
+                          if assigned(srsym) then
+                            case srsym.typ of
+                              staticvarsym,
+                              localvarsym,
+                              paravarsym :
+                                hdef:=tabstractvarsym(srsym).vardef;
+                              typesym:
+                                hdef:=ttypesym(srsym).typedef;
+                              else
+                                Message(scan_e_error_in_preproc_expr);
+                            end;
+                          if assigned(hdef) then
                             begin
                             begin
                               if hdef.typ=setdef then
                               if hdef.typ=setdef then
                                 hdef:=tsetdef(hdef).elementdef;
                                 hdef:=tsetdef(hdef).elementdef;
@@ -1159,10 +1311,7 @@ In case not, the value returned can be arbitrary.
                             read_factor:=hs;
                             read_factor:=hs;
                         end
                         end
                       else
                       else
-                        Message1(sym_e_id_not_found,current_scanner.preproc_pattern);
-
-                    preproc_consume(_ID);
-                    current_scanner.skipspace;
+                        Message1(sym_e_id_not_found,storedpattern);
 
 
                     if current_scanner.preproc_token =_RKLAMMER then
                     if current_scanner.preproc_token =_RKLAMMER then
                       preproc_consume(_RKLAMMER)
                       preproc_consume(_RKLAMMER)
@@ -1278,69 +1427,72 @@ In case not, the value returned can be arbitrary.
 
 
                     { Default is to return the original symbol }
                     { Default is to return the original symbol }
                     read_factor:=hs;
                     read_factor:=hs;
+                    storedpattern:=current_scanner.preproc_pattern;
+                    preproc_consume(_ID);
+                    current_scanner.skipspace;
                     if eval and ([m_delphi,m_objfpc]*current_settings.modeswitches<>[]) and (ctetString in factorType) then
                     if eval and ([m_delphi,m_objfpc]*current_settings.modeswitches<>[]) and (ctetString in factorType) then
-                      if searchsym(current_scanner.preproc_pattern,srsym,srsymtable) then
+                      if searchsym(storedpattern,srsym,srsymtable) then
                         begin
                         begin
-                          case srsym.typ of
-                            constsym :
-                              begin
-                                with tconstsym(srsym) do
-                                  begin
-                                    case consttyp of
-                                      constord :
-                                        begin
-                                          case constdef.typ of
-                                            orddef:
-                                              begin
-                                                if is_integer(constdef) then
-                                                  begin
-                                                    read_factor:=tostr(value.valueord);
-                                                    factorType:= [ctetInteger];
-                                                  end
-                                                else if is_boolean(constdef) then
-                                                  begin
-                                                    read_factor:=tostr(value.valueord);
-                                                    factorType:= [ctetBoolean];
-                                                  end
-                                                else if is_char(constdef) then
-                                                  begin
-                                                    read_factor:=char(qword(value.valueord));
-                                                    factorType:= [ctetString];
-                                                  end
-                                              end;
-                                            enumdef:
-                                              begin
-                                                read_factor:=tostr(value.valueord);
-                                                factorType:= [ctetInteger];
-                                              end;
+                          try_consume_nestedsym(srsym,srsymtable);
+                          if assigned(srsym) then
+                            case srsym.typ of
+                              constsym :
+                                begin
+                                  with tconstsym(srsym) do
+                                    begin
+                                      case consttyp of
+                                        constord :
+                                          begin
+                                            case constdef.typ of
+                                              orddef:
+                                                begin
+                                                  if is_integer(constdef) then
+                                                    begin
+                                                      read_factor:=tostr(value.valueord);
+                                                      factorType:= [ctetInteger];
+                                                    end
+                                                  else if is_boolean(constdef) then
+                                                    begin
+                                                      read_factor:=tostr(value.valueord);
+                                                      factorType:= [ctetBoolean];
+                                                    end
+                                                  else if is_char(constdef) then
+                                                    begin
+                                                      read_factor:=char(qword(value.valueord));
+                                                      factorType:= [ctetString];
+                                                    end
+                                                end;
+                                              enumdef:
+                                                begin
+                                                  read_factor:=tostr(value.valueord);
+                                                  factorType:= [ctetInteger];
+                                                end;
+                                            end;
+                                          end;
+                                        conststring :
+                                          begin
+                                            read_factor := upper(pchar(value.valueptr));
+                                            factorType:= [ctetString];
+                                          end;
+                                        constset :
+                                          begin
+                                            hs:=',';
+                                            for l:=0 to 255 do
+                                              if l in pconstset(tconstsym(srsym).value.valueptr)^ then
+                                                hs:=hs+tostr(l)+',';
+                                            read_factor := hs;
+                                            factorType:= [ctetSet];
                                           end;
                                           end;
-                                        end;
-                                      conststring :
-                                        begin
-                                          read_factor := upper(pchar(value.valueptr));
-                                          factorType:= [ctetString];
-                                        end;
-                                      constset :
-                                        begin
-                                          hs:=',';
-                                          for l:=0 to 255 do
-                                            if l in pconstset(tconstsym(srsym).value.valueptr)^ then
-                                              hs:=hs+tostr(l)+',';
-                                          read_factor := hs;
-                                          factorType:= [ctetSet];
-                                        end;
+                                      end;
                                     end;
                                     end;
-                                  end;
-                              end;
-                            enumsym :
-                              begin
-                                read_factor:=tostr(tenumsym(srsym).value);
-                                factorType:= [ctetInteger];
-                              end;
-                          end;
+                                end;
+                              enumsym :
+                                begin
+                                  read_factor:=tostr(tenumsym(srsym).value);
+                                  factorType:= [ctetInteger];
+                                end;
+                            end;
                         end;
                         end;
-                    preproc_consume(_ID);
-                    current_scanner.skipspace;
                   end
                   end
              end
              end
            else if current_scanner.preproc_token =_LKLAMMER then
            else if current_scanner.preproc_token =_LKLAMMER then
@@ -4720,6 +4872,11 @@ exit_label:
                current_scanner.preproc_pattern:=readval_asstring;
                current_scanner.preproc_pattern:=readval_asstring;
                readpreproc:=_ID;
                readpreproc:=_ID;
              end;
              end;
+           '.' :
+             begin
+               readchar;
+               readpreproc:=_POINT;
+             end;
            ',' :
            ',' :
              begin
              begin
                readchar;
                readchar;

+ 2 - 2
compiler/symdef.pas

@@ -4735,14 +4735,14 @@ implementation
       begin
       begin
         { don't check assigned(_class), that's also the case for nested
         { don't check assigned(_class), that's also the case for nested
           procedures inside methods }
           procedures inside methods }
-        result:=owner.symtabletype=ObjectSymtable;
+        result:=(owner.symtabletype=ObjectSymtable)and not no_self_node;
       end;
       end;
 
 
 
 
     function tprocdef.is_addressonly:boolean;
     function tprocdef.is_addressonly:boolean;
       begin
       begin
         result:=assigned(owner) and
         result:=assigned(owner) and
-                (owner.symtabletype<>ObjectSymtable) and
+                not is_methodpointer and
                 (not(m_nested_procvars in current_settings.modeswitches) or
                 (not(m_nested_procvars in current_settings.modeswitches) or
                  not is_nested_pd(self));
                  not is_nested_pd(self));
       end;
       end;

+ 11 - 2
compiler/symsym.pas

@@ -614,7 +614,11 @@ implementation
 
 
     constructor tprocsym.create(const n : string);
     constructor tprocsym.create(const n : string);
       begin
       begin
-         inherited create(procsym,n);
+         if not(ts_lowercase_proc_start in current_settings.targetswitches) or
+            (n='') then
+           inherited create(procsym,n)
+         else
+           inherited create(procsym,lowercase(n[1])+copy(n,2,length(n)-1));
          FProcdefList:=TFPObjectList.Create(false);
          FProcdefList:=TFPObjectList.Create(false);
          FProcdefderefList:=nil;
          FProcdefderefList:=nil;
          { the tprocdef have their own symoptions, make the procsym
          { the tprocdef have their own symoptions, make the procsym
@@ -1667,7 +1671,12 @@ implementation
            not(tf_smartlink_sections in target_info.flags)) or
            not(tf_smartlink_sections in target_info.flags)) or
           DLLSource or
           DLLSource or
           (assigned(current_procinfo) and
           (assigned(current_procinfo) and
-           (po_inline in current_procinfo.procdef.procoptions)) or
+           ((po_inline in current_procinfo.procdef.procoptions) or
+            { globalasmsym is called normally before the body of a subroutine is parsed
+              so we cannot know if it will be auto inlined, so make all symbols of it
+              global if asked }
+            (cs_opt_autoinline in current_settings.optimizerswitches))
+          ) or
           (vo_is_public in varoptions);
           (vo_is_public in varoptions);
       end;
       end;
 
 

+ 33 - 0
compiler/systems.inc

@@ -197,6 +197,39 @@
              ,as_jvm_jasmin
              ,as_jvm_jasmin
        );
        );
 
 
+       tlink = (ld_none,
+             ld_aix,           { external linkers (one per OS, handles all CPUs) }
+             ld_amiga,
+             ld_android,
+             ld_beos,
+             ld_bsd,
+             ld_embedded,
+             ld_emx,
+             ld_gba,
+             ld_go32v2,
+             ld_haiku,
+             ld_jvm,
+             ld_linux,
+             ld_morphos,
+             ld_mpw,
+             ld_msdos,
+             ld_nds,
+             ld_netwlibc,
+             ld_netware,
+             ld_os2,
+             ld_palmos,
+             ld_solaris,
+             ld_watcom,
+             ld_wdosx,
+             ld_wii,
+             ld_windows,
+             ld_int_go32v2,    { implemented internal linkers }
+             ld_int_linux,
+             ld_int_nativent,
+             ld_int_netware,
+             ld_int_windows
+       );
+
        tar = (ar_none
        tar = (ar_none
             ,ar_gnu_ar
             ,ar_gnu_ar
             ,ar_mpw_ar
             ,ar_mpw_ar

+ 2 - 39
compiler/systems.pas

@@ -33,20 +33,6 @@ interface
 *****************************************************************************}
 *****************************************************************************}
 
 
      type
      type
-       { Abstract linker class which is implemented in link module }
-       TAbstractLinker = class
-       end;
-
-       TAbstractLinkerClass = class of TAbstractLinker;
-
-
-       { Abstract assembler class which is implemented in assemble module }
-       TAbstractAssembler = class
-       end;
-
-       TAbstractAssemblerClass = class of TAbstractAssembler;
-
-
        TAbstractResourceFile = class
        TAbstractResourceFile = class
          constructor create(const fn : ansistring);virtual;abstract;
          constructor create(const fn : ansistring);virtual;abstract;
        end;
        end;
@@ -194,8 +180,8 @@ interface
           dirsep       : char;
           dirsep       : char;
           assem        : tasm;
           assem        : tasm;
           assemextern  : tasm; { external assembler, used by -a }
           assemextern  : tasm; { external assembler, used by -a }
-          link         : tabstractlinkerclass;
-          linkextern   : tabstractlinkerclass;  { external linker, used by -s }
+          link         : tlink;
+          linkextern   : tlink;  { external linker, used by -s }
           ar           : tar;
           ar           : tar;
           res          : tres;
           res          : tres;
           dbg          : tdbg;
           dbg          : tdbg;
@@ -394,19 +380,6 @@ interface
     procedure RegisterTarget(const r:tsysteminfo);
     procedure RegisterTarget(const r:tsysteminfo);
     procedure RegisterRes(const r:tresinfo; rcf : TAbstractResourceFileClass);
     procedure RegisterRes(const r:tresinfo; rcf : TAbstractResourceFileClass);
     procedure RegisterAr(const r:tarinfo);
     procedure RegisterAr(const r:tarinfo);
-    { Register the external linker. This routine is called to setup the
-      class to use for the linker. It returns the tsysteminfo structure
-      updated with the correct linker class for external linking.
-    }
-    procedure RegisterExternalLinker(var system_info: tsysteminfo; c:TAbstractLinkerClass);
-    { Register the internal linker. This routine is called to setup the
-      class to use for the linker. It returns the tsysteminfo structure
-      updated with the correct linker class for internal linking.
-
-      If internal linking is not supported, this class can be set
-      to nil.
-    }
-    procedure RegisterInternalLinker(var system_info : tsysteminfo; c:TAbstractLinkerClass);
 
 
     procedure InitSystems;
     procedure InitSystems;
 
 
@@ -669,16 +642,6 @@ begin
   arinfos[t]^:=r;
   arinfos[t]^:=r;
 end;
 end;
 
 
-procedure RegisterExternalLinker(var system_info: tsysteminfo; c:TAbstractLinkerClass);
-begin
-  system_info.linkextern := c;
-end;
-
-procedure RegisterInternalLinker(var system_info : tsysteminfo; c:TAbstractLinkerClass);
-begin
-  system_info.link := c;
-end;
-
 
 
 
 
 procedure DeregisterInfos;
 procedure DeregisterInfos;

+ 4 - 4
compiler/systems/i_aix.pas

@@ -64,8 +64,8 @@ unit i_aix;
             dirsep       : '/';
             dirsep       : '/';
             assem        : as_powerpc_xcoff;
             assem        : as_powerpc_xcoff;
             assemextern  : as_powerpc_xcoff;
             assemextern  : as_powerpc_xcoff;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_aix;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_xcoff;
             res          : res_xcoff;
             dbg          : dbg_stabx;
             dbg          : dbg_stabx;
@@ -127,8 +127,8 @@ unit i_aix;
             dirsep       : '/';
             dirsep       : '/';
             assem        : as_powerpc_xcoff;
             assem        : as_powerpc_xcoff;
             assemextern  : as_powerpc_xcoff;
             assemextern  : as_powerpc_xcoff;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_aix;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_xcoff;
             res          : res_xcoff;
             dbg          : dbg_stabx;
             dbg          : dbg_stabx;

+ 4 - 4
compiler/systems/i_amiga.pas

@@ -63,8 +63,8 @@ unit i_amiga;
             dirsep       : '/';
             dirsep       : '/';
             assem        : as_gas;
             assem        : as_gas;
             assemextern  : as_gas;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_amiga;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_none;
             res          : res_none;
             dbg          : dbg_stabs;
             dbg          : dbg_stabs;
@@ -125,8 +125,8 @@ unit i_amiga;
             dirsep       : '/';
             dirsep       : '/';
             assem        : as_gas;
             assem        : as_gas;
             assemextern  : as_gas;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_amiga;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_none;
             res          : res_none;
             dbg          : dbg_stabs;
             dbg          : dbg_stabs;

+ 4 - 4
compiler/systems/i_android.pas

@@ -65,8 +65,8 @@ unit i_android;
             dirsep       : '/';
             dirsep       : '/';
             assem        : as_gas;
             assem        : as_gas;
             assemextern  : as_gas;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_android;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_elf;
             res          : res_elf;
             dbg          : dbg_stabs;
             dbg          : dbg_stabs;
@@ -130,8 +130,8 @@ unit i_android;
             dirsep       : '/';
             dirsep       : '/';
             assem        : as_i386_elf32;
             assem        : as_i386_elf32;
             assemextern  : as_gas;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_android;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_elf;
             res          : res_elf;
             dbg          : dbg_stabs;
             dbg          : dbg_stabs;

+ 2 - 2
compiler/systems/i_beos.pas

@@ -64,8 +64,8 @@ unit i_beos;
             dirsep       : '/';
             dirsep       : '/';
             assem        : as_i386_elf32;
             assem        : as_i386_elf32;
             assemextern  : as_gas;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_beos;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_none;
             res          : res_none;
             dbg          : dbg_stabs;
             dbg          : dbg_stabs;

+ 29 - 29
compiler/systems/i_bsd.pas

@@ -93,8 +93,8 @@ unit i_bsd;
             dirsep       : '/';
             dirsep       : '/';
             assem        : as_i386_elf32;
             assem        : as_i386_elf32;
             assemextern  : as_gas;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_bsd;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_elf;
             res          : res_elf;
             dbg          : dbg_stabs;
             dbg          : dbg_stabs;
@@ -159,8 +159,8 @@ unit i_bsd;
             dirsep       : '/';
             dirsep       : '/';
             assem        : as_x86_64_elf64;
             assem        : as_x86_64_elf64;
             assemextern  : as_gas;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_bsd;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_elf;
             res          : res_elf;
             dbg          : dbg_dwarf2;            //dbg_stabs;
             dbg          : dbg_dwarf2;            //dbg_stabs;
@@ -222,8 +222,8 @@ unit i_bsd;
             dirsep       : '/';
             dirsep       : '/';
             assem        : as_i386_elf32;
             assem        : as_i386_elf32;
             assemextern  : as_gas;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_bsd;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_elf;
             res          : res_elf;
             dbg          : dbg_stabs;
             dbg          : dbg_stabs;
@@ -284,8 +284,8 @@ unit i_bsd;
             dirsep       : '/';
             dirsep       : '/';
             assem        : as_gas;
             assem        : as_gas;
             assemextern  : as_gas;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_bsd;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_elf;
             res          : res_elf;
             dbg          : dbg_stabs;
             dbg          : dbg_stabs;
@@ -349,8 +349,8 @@ unit i_bsd;
             dirsep       : '/';
             dirsep       : '/';
             assem        : as_x86_64_elf64;
             assem        : as_x86_64_elf64;
             assemextern  : as_gas;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_bsd;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_elf;
             res          : res_elf;
             dbg          : dbg_dwarf2;            //dbg_stabs;
             dbg          : dbg_dwarf2;            //dbg_stabs;
@@ -411,8 +411,8 @@ unit i_bsd;
             dirsep       : '/';
             dirsep       : '/';
             assem        : as_gas;
             assem        : as_gas;
             assemextern  : as_gas;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_bsd;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_elf;
             res          : res_elf;
             dbg          : dbg_stabs;
             dbg          : dbg_stabs;
@@ -473,8 +473,8 @@ unit i_bsd;
             dirsep       : '/';
             dirsep       : '/';
             assem        : as_gas;
             assem        : as_gas;
             assemextern  : as_gas;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_bsd;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_elf;
             res          : res_elf;
             dbg          : dbg_stabs;
             dbg          : dbg_stabs;
@@ -539,8 +539,8 @@ unit i_bsd;
             dirsep       : '/';
             dirsep       : '/';
             assem        : as_x86_64_elf64;
             assem        : as_x86_64_elf64;
             assemextern  : as_gas;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_bsd;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_elf;
             res          : res_elf;
             dbg          : dbg_dwarf2;            //dbg_stabs;
             dbg          : dbg_dwarf2;            //dbg_stabs;
@@ -601,8 +601,8 @@ unit i_bsd;
             dirsep       : '/';
             dirsep       : '/';
             assem        : as_darwin;
             assem        : as_darwin;
             assemextern  : as_darwin;
             assemextern  : as_darwin;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_bsd;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_macho;
             res          : res_macho;
             dbg          : dbg_stabs;
             dbg          : dbg_stabs;
@@ -665,8 +665,8 @@ unit i_bsd;
             dirsep       : '/';
             dirsep       : '/';
             assem        : as_darwin;
             assem        : as_darwin;
             assemextern  : as_darwin;
             assemextern  : as_darwin;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_bsd;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_macho;
             res          : res_macho;
             dbg          : dbg_stabs;
             dbg          : dbg_stabs;
@@ -729,8 +729,8 @@ unit i_bsd;
             dirsep       : '/';
             dirsep       : '/';
             assem        : as_darwin;
             assem        : as_darwin;
             assemextern  : as_darwin;
             assemextern  : as_darwin;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_bsd;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_macho;
             res          : res_macho;
             dbg          : dbg_dwarf2;
             dbg          : dbg_dwarf2;
@@ -793,8 +793,8 @@ unit i_bsd;
             dirsep       : '/';
             dirsep       : '/';
             assem        : as_darwin;
             assem        : as_darwin;
             assemextern  : as_darwin;
             assemextern  : as_darwin;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_bsd;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_macho;
             res          : res_macho;
             dbg          : dbg_dwarf2;
             dbg          : dbg_dwarf2;
@@ -857,8 +857,8 @@ unit i_bsd;
             dirsep       : '/';
             dirsep       : '/';
             assem        : as_darwin;
             assem        : as_darwin;
             assemextern  : as_darwin;
             assemextern  : as_darwin;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_bsd;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_macho;
             res          : res_macho;
             dbg          : dbg_dwarf2;
             dbg          : dbg_dwarf2;
@@ -891,7 +891,7 @@ unit i_bsd;
             system       : system_arm_darwin;
             system       : system_arm_darwin;
             name         : 'Darwin for ARM';
             name         : 'Darwin for ARM';
             shortname    : 'Darwin';
             shortname    : 'Darwin';
-            flags        : [tf_p_ext_support,tf_requires_proper_alignment,tf_files_case_sensitive,tf_smartlink_sections,tf_dwarf_relative_addresses,tf_dwarf_only_local_labels,tf_has_winlike_resources];
+            flags        : [tf_p_ext_support,tf_requires_proper_alignment,tf_files_case_sensitive,tf_smartlink_sections,tf_dwarf_relative_addresses,tf_dwarf_only_local_labels,tf_has_winlike_resources,tf_pic_default];
             cpu          : cpu_arm;
             cpu          : cpu_arm;
             unit_env     : 'BSDUNITS';
             unit_env     : 'BSDUNITS';
             extradefines : 'UNIX;BSD;HASUNIX;CPUARMEL';
             extradefines : 'UNIX;BSD;HASUNIX;CPUARMEL';
@@ -920,8 +920,8 @@ unit i_bsd;
             dirsep       : '/';
             dirsep       : '/';
             assem        : as_darwin;
             assem        : as_darwin;
             assemextern  : as_darwin;
             assemextern  : as_darwin;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_bsd;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_macho;
             res          : res_macho;
             dbg          : dbg_dwarf2;
             dbg          : dbg_dwarf2;

+ 6 - 6
compiler/systems/i_embed.pas

@@ -63,8 +63,8 @@ unit i_embed;
             dirsep       : '/';
             dirsep       : '/';
             assem        : as_gas;
             assem        : as_gas;
             assemextern  : as_gas;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_embedded;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_none;
             res          : res_none;
             dbg          : dbg_stabs;
             dbg          : dbg_stabs;
@@ -126,8 +126,8 @@ unit i_embed;
             dirsep       : '/';
             dirsep       : '/';
             assem        : as_gas;
             assem        : as_gas;
             assemextern  : as_gas;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_embedded;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_none;
             res          : res_none;
             dbg          : dbg_dwarf2;
             dbg          : dbg_dwarf2;
@@ -189,8 +189,8 @@ unit i_embed;
             dirsep       : '/';
             dirsep       : '/';
             assem        : as_i386_elf32;
             assem        : as_i386_elf32;
             assemextern  : as_gas;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_embedded;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_none;
             res          : res_none;
             dbg          : dbg_stabs;
             dbg          : dbg_stabs;

+ 2 - 2
compiler/systems/i_emx.pas

@@ -74,8 +74,8 @@ unit i_emx;
             dirsep       : '\';
             dirsep       : '\';
             assem        : as_i386_as_aout;
             assem        : as_i386_as_aout;
             assemextern  : as_i386_as_aout;
             assemextern  : as_i386_as_aout;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_emx;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_watcom_wrc_os2;
             res          : res_watcom_wrc_os2;
             dbg          : dbg_stabs;
             dbg          : dbg_stabs;

+ 2 - 2
compiler/systems/i_gba.pas

@@ -64,8 +64,8 @@ unit i_gba;
             dirsep       : '/';
             dirsep       : '/';
             assem        : as_gas;
             assem        : as_gas;
             assemextern  : as_gas;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_gba;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_none;
             res          : res_none;
             dbg          : dbg_stabs;
             dbg          : dbg_stabs;

+ 2 - 2
compiler/systems/i_go32v2.pas

@@ -63,8 +63,8 @@ unit i_go32v2;
             dirsep       : '\';
             dirsep       : '\';
             assem        : as_i386_coff;
             assem        : as_i386_coff;
             assemextern  : as_gas;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_int_go32v2;
+            linkextern   : ld_go32v2;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_none;
             res          : res_none;
             dbg          : dbg_stabs;
             dbg          : dbg_stabs;

+ 2 - 2
compiler/systems/i_haiku.pas

@@ -65,8 +65,8 @@ unit i_haiku;
             dirsep       : '/';
             dirsep       : '/';
             assem        : as_i386_elf32;
             assem        : as_i386_elf32;
             assemextern  : as_gas;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_haiku;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_elf;
             res          : res_elf;
             dbg          : dbg_stabs;
             dbg          : dbg_stabs;

+ 4 - 4
compiler/systems/i_jvm.pas

@@ -81,8 +81,8 @@ unit i_jvm;
             dirsep       : '/';
             dirsep       : '/';
             assem        : as_jvm_jasmin;
             assem        : as_jvm_jasmin;
             assemextern  : as_jvm_jasmin;
             assemextern  : as_jvm_jasmin;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_jvm;
             ar           : ar_none;
             ar           : ar_none;
             res          : res_jvm_raw;
             res          : res_jvm_raw;
             dbg          : dbg_jasmin;
             dbg          : dbg_jasmin;
@@ -146,8 +146,8 @@ unit i_jvm;
             dirsep       : '/';
             dirsep       : '/';
             assem        : as_jvm_jasmin;
             assem        : as_jvm_jasmin;
             assemextern  : as_jvm_jasmin;
             assemextern  : as_jvm_jasmin;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_jvm;
             ar           : ar_none;
             ar           : ar_none;
             res          : res_jvm_raw;
             res          : res_jvm_raw;
             dbg          : dbg_jasmin;
             dbg          : dbg_jasmin;

+ 34 - 31
compiler/systems/i_linux.pas

@@ -69,8 +69,8 @@ unit i_linux;
             dirsep       : '/';
             dirsep       : '/';
             assem        : as_i386_elf32;
             assem        : as_i386_elf32;
             assemextern  : as_gas;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_linux;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_elf;
             res          : res_elf;
             dbg          : dbg_stabs;
             dbg          : dbg_stabs;
@@ -133,8 +133,8 @@ unit i_linux;
             dirsep       : '/';
             dirsep       : '/';
             assem        : as_i386_elf32;
             assem        : as_i386_elf32;
             assemextern  : as_gas;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_linux;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_elf;
             res          : res_elf;
             dbg          : dbg_stabs;
             dbg          : dbg_stabs;
@@ -197,8 +197,8 @@ unit i_linux;
             dirsep       : '/';
             dirsep       : '/';
             assem        : as_gas;
             assem        : as_gas;
             assemextern  : as_gas;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_linux;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_elf;
             res          : res_elf;
             dbg          : dbg_stabs;
             dbg          : dbg_stabs;
@@ -261,8 +261,8 @@ unit i_linux;
             dirsep       : '/';
             dirsep       : '/';
             assem        : as_gas;
             assem        : as_gas;
             assemextern  : as_gas;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_linux;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_elf;
             res          : res_elf;
             dbg          : dbg_stabs;
             dbg          : dbg_stabs;
@@ -324,8 +324,8 @@ unit i_linux;
             dirsep       : '/';
             dirsep       : '/';
             assem        : as_gas;
             assem        : as_gas;
             assemextern  : as_gas;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_linux;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_elf;
             res          : res_elf;
             dbg          : dbg_dwarf2;
             dbg          : dbg_dwarf2;
@@ -387,8 +387,8 @@ unit i_linux;
             dirsep       : '/';
             dirsep       : '/';
             assem        : as_gas;
             assem        : as_gas;
             assemextern  : as_gas;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_linux;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_elf;
             res          : res_elf;
             dbg          : dbg_stabs;
             dbg          : dbg_stabs;
@@ -451,8 +451,8 @@ unit i_linux;
             dirsep       : '/';
             dirsep       : '/';
             assem        : as_x86_64_elf64;
             assem        : as_x86_64_elf64;
             assemextern  : as_gas;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_linux;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_elf;
             res          : res_elf;
             dbg          : dbg_dwarf2;
             dbg          : dbg_dwarf2;
@@ -517,8 +517,8 @@ unit i_linux;
             dirsep       : '/';
             dirsep       : '/';
             assem        : as_gas;
             assem        : as_gas;
             assemextern  : as_gas;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_linux;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_elf;
             res          : res_elf;
             dbg          : dbg_stabs;
             dbg          : dbg_stabs;
@@ -553,7 +553,8 @@ unit i_linux;
             shortname    : 'Linux';
             shortname    : 'Linux';
             flags        : [tf_needs_symbol_size,tf_needs_symbol_type,tf_files_case_sensitive,
             flags        : [tf_needs_symbol_size,tf_needs_symbol_type,tf_files_case_sensitive,
                             tf_requires_proper_alignment,
                             tf_requires_proper_alignment,
-                            tf_smartlink_sections,tf_smartlink_library,tf_has_winlike_resources];
+                            tf_smartlink_sections,tf_smartlink_library,tf_pic_uses_got,
+                            tf_has_winlike_resources];
             cpu          : cpu_arm;
             cpu          : cpu_arm;
             unit_env     : 'LINUXUNITS';
             unit_env     : 'LINUXUNITS';
             extradefines : 'UNIX;HASUNIX;CPUARMHF';
             extradefines : 'UNIX;HASUNIX;CPUARMHF';
@@ -582,8 +583,8 @@ unit i_linux;
             dirsep       : '/';
             dirsep       : '/';
             assem        : as_gas;
             assem        : as_gas;
             assemextern  : as_gas;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_linux;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_elf;
             res          : res_elf;
             dbg          : dbg_stabs;
             dbg          : dbg_stabs;
@@ -618,7 +619,8 @@ unit i_linux;
             shortname    : 'Linux';
             shortname    : 'Linux';
             flags        : [tf_needs_symbol_size,tf_needs_symbol_type,tf_files_case_sensitive,
             flags        : [tf_needs_symbol_size,tf_needs_symbol_type,tf_files_case_sensitive,
                             tf_requires_proper_alignment,
                             tf_requires_proper_alignment,
-                            tf_smartlink_sections,tf_smartlink_library,tf_has_winlike_resources];
+                            tf_smartlink_sections,tf_smartlink_library,tf_pic_uses_got,
+                            tf_has_winlike_resources];
             cpu          : cpu_arm;
             cpu          : cpu_arm;
             unit_env     : 'LINUXUNITS';
             unit_env     : 'LINUXUNITS';
             extradefines : 'UNIX;HASUNIX;CPUARMEL';
             extradefines : 'UNIX;HASUNIX;CPUARMEL';
@@ -647,8 +649,8 @@ unit i_linux;
             dirsep       : '/';
             dirsep       : '/';
             assem        : as_gas;
             assem        : as_gas;
             assemextern  : as_gas;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_linux;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_elf;
             res          : res_elf;
             dbg          : dbg_stabs;
             dbg          : dbg_stabs;
@@ -683,7 +685,8 @@ unit i_linux;
             shortname    : 'Linux';
             shortname    : 'Linux';
             flags        : [tf_needs_symbol_size,tf_needs_symbol_type,tf_files_case_sensitive,
             flags        : [tf_needs_symbol_size,tf_needs_symbol_type,tf_files_case_sensitive,
                             tf_requires_proper_alignment,
                             tf_requires_proper_alignment,
-                            tf_smartlink_sections,tf_smartlink_library,tf_has_winlike_resources];
+                            tf_smartlink_sections,tf_smartlink_library,tf_pic_uses_got,
+                            tf_has_winlike_resources];
             cpu          : cpu_arm;
             cpu          : cpu_arm;
             unit_env     : 'LINUXUNITS';
             unit_env     : 'LINUXUNITS';
             extradefines : 'UNIX;HASUNIX;CPUARMEB';
             extradefines : 'UNIX;HASUNIX;CPUARMEB';
@@ -712,8 +715,8 @@ unit i_linux;
             dirsep       : '/';
             dirsep       : '/';
             assem        : as_gas;
             assem        : as_gas;
             assemextern  : as_gas;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_linux;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_elf;
             res          : res_elf;
             dbg          : dbg_stabs;
             dbg          : dbg_stabs;
@@ -776,8 +779,8 @@ unit i_linux;
             dirsep       : '/';
             dirsep       : '/';
             assem        : as_gas;
             assem        : as_gas;
             assemextern  : as_gas;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_linux;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_elf;
             res          : res_elf;
             dbg          : dbg_stabs;
             dbg          : dbg_stabs;
@@ -844,8 +847,8 @@ unit i_linux;
             dirsep       : '/';
             dirsep       : '/';
             assem        : as_gas;
             assem        : as_gas;
             assemextern  : as_gas;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_linux;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_elf;
             res          : res_elf;
             dbg          : dbg_stabs;
             dbg          : dbg_stabs;
@@ -909,8 +912,8 @@ unit i_linux;
             dirsep       : '/';
             dirsep       : '/';
             assem        : as_gas;
             assem        : as_gas;
             assemextern  : as_gas;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_linux;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_elf;
             res          : res_elf;
             dbg          : dbg_stabs;
             dbg          : dbg_stabs;

+ 2 - 2
compiler/systems/i_macos.pas

@@ -62,8 +62,8 @@ unit i_macos;
             dirsep       : ':';
             dirsep       : ':';
             assem        : as_powerpc_mpw;
             assem        : as_powerpc_mpw;
             assemextern  : as_powerpc_mpw;
             assemextern  : as_powerpc_mpw;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_mpw;
             ar           : ar_mpw_ar;
             ar           : ar_mpw_ar;
             res          : res_powerpc_mpw;
             res          : res_powerpc_mpw;
             dbg          : dbg_stabs;
             dbg          : dbg_stabs;

+ 2 - 2
compiler/systems/i_morph.pas

@@ -63,8 +63,8 @@ unit i_morph;
             dirsep       : '/';
             dirsep       : '/';
             assem        : as_gas;
             assem        : as_gas;
             assemextern  : as_gas;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_morphos;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_none;
             res          : res_none;
             dbg          : dbg_stabs;
             dbg          : dbg_stabs;

+ 2 - 2
compiler/systems/i_msdos.pas

@@ -64,8 +64,8 @@ unit i_msdos;
             dirsep       : '\';
             dirsep       : '\';
             assem        : as_i386_nasmobj;
             assem        : as_i386_nasmobj;
             assemextern  : as_i386_nasmobj;
             assemextern  : as_i386_nasmobj;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_msdos;
             ar           : ar_watcom_wlib_omf;
             ar           : ar_watcom_wlib_omf;
             res          : res_none;
             res          : res_none;
             dbg          : dbg_stabs;
             dbg          : dbg_stabs;

+ 2 - 2
compiler/systems/i_nativent.pas

@@ -68,8 +68,8 @@ unit i_nativent;
             dirsep       : '\';
             dirsep       : '\';
             assem        : as_i386_pecoff;
             assem        : as_i386_pecoff;
             assemextern  : as_gas;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_int_nativent;
+            linkextern   : ld_none;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_gnu_windres;
             res          : res_gnu_windres;
             dbg          : dbg_stabs;
             dbg          : dbg_stabs;

+ 2 - 2
compiler/systems/i_nds.pas

@@ -64,8 +64,8 @@ unit i_nds;
             dirsep       : '/';
             dirsep       : '/';
             assem        : as_gas;
             assem        : as_gas;
             assemextern  : as_gas;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_nds;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_none;
             res          : res_none;
             dbg          : dbg_stabs;
             dbg          : dbg_stabs;

+ 2 - 2
compiler/systems/i_nwl.pas

@@ -63,8 +63,8 @@ unit i_nwl;
             dirsep       : '/';
             dirsep       : '/';
             assem        : as_i386_elf32;
             assem        : as_i386_elf32;
             assemextern  : as_gas;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_netwlibc;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_none;
             res          : res_none;
             dbg          : dbg_stabs;
             dbg          : dbg_stabs;

+ 2 - 2
compiler/systems/i_nwm.pas

@@ -63,8 +63,8 @@ unit i_nwm;
             dirsep       : '/';
             dirsep       : '/';
             assem        : as_i386_nlmcoff; // as_i386_elf32;
             assem        : as_i386_nlmcoff; // as_i386_elf32;
             assemextern  : as_gas;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_int_netware;
+            linkextern   : ld_netware;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_none;
             res          : res_none;
             dbg          : dbg_stabs;
             dbg          : dbg_stabs;

+ 2 - 2
compiler/systems/i_os2.pas

@@ -74,8 +74,8 @@ unit i_os2;
             dirsep       : '\';
             dirsep       : '\';
             assem        : as_i386_as_aout;
             assem        : as_i386_as_aout;
             assemextern  : as_i386_as_aout;
             assemextern  : as_i386_as_aout;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_os2;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_watcom_wrc_os2;
             res          : res_watcom_wrc_os2;
             dbg          : dbg_stabs;
             dbg          : dbg_stabs;

+ 4 - 4
compiler/systems/i_palmos.pas

@@ -63,8 +63,8 @@ unit i_palmos;
             dirsep       : '/';
             dirsep       : '/';
             assem        : as_gas;
             assem        : as_gas;
             assemextern  : as_gas;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_palmos;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_none;
             res          : res_none;
             dbg          : dbg_stabs;
             dbg          : dbg_stabs;
@@ -136,8 +136,8 @@ unit i_palmos;
             dirsep       : '/';
             dirsep       : '/';
             assem        : as_gas;
             assem        : as_gas;
             assemextern  : as_gas;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_palmos;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_none;
             res          : res_none;
             dbg          : dbg_stabs;
             dbg          : dbg_stabs;

+ 6 - 6
compiler/systems/i_sunos.pas

@@ -65,8 +65,8 @@ unit i_sunos;
             dirsep       : '/';
             dirsep       : '/';
             assem        : as_i386_elf32;
             assem        : as_i386_elf32;
             assemextern  : as_ggas;
             assemextern  : as_ggas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_solaris;
             ar           : ar_gnu_gar;
             ar           : ar_gnu_gar;
             res          : res_elf;
             res          : res_elf;
             dbg          : dbg_stabs;
             dbg          : dbg_stabs;
@@ -132,8 +132,8 @@ unit i_sunos;
             dirsep       : '/';
             dirsep       : '/';
             assem        : as_ggas{as_x86_64_elf64};
             assem        : as_ggas{as_x86_64_elf64};
             assemextern  : as_ggas;
             assemextern  : as_ggas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_solaris;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_elf;
             res          : res_elf;
             dbg          : dbg_dwarf2;
             dbg          : dbg_dwarf2;
@@ -199,8 +199,8 @@ unit i_sunos;
             dirsep       : '/';
             dirsep       : '/';
             assem        : as_ggas;
             assem        : as_ggas;
             assemextern  : as_ggas;
             assemextern  : as_ggas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_solaris;
             ar           : ar_gnu_gar;
             ar           : ar_gnu_gar;
             res          : res_elf;
             res          : res_elf;
             dbg          : dbg_stabs;
             dbg          : dbg_stabs;

+ 4 - 4
compiler/systems/i_symbian.pas

@@ -65,8 +65,8 @@ unit i_symbian;
             dirsep       : '\';
             dirsep       : '\';
             assem        : as_gas;
             assem        : as_gas;
             assemextern  : as_gas;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_windows;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_gnu_windres;
             res          : res_gnu_windres;
             dbg          : dbg_stabs;
             dbg          : dbg_stabs;
@@ -128,8 +128,8 @@ unit i_symbian;
             dirsep       : '\';
             dirsep       : '\';
             assem        : as_gas;
             assem        : as_gas;
             assemextern  : as_gas;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_windows;
+            linkextern   : ld_none;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_none;
             res          : res_none;
             dbg          : dbg_stabs;
             dbg          : dbg_stabs;

+ 2 - 2
compiler/systems/i_watcom.pas

@@ -63,8 +63,8 @@ unit i_watcom;
             dirsep       : '\';
             dirsep       : '\';
             assem        : as_i386_wasm;
             assem        : as_i386_wasm;
             assemextern  : as_gas;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_watcom;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_none;
             res          : res_none;
             dbg          : dbg_stabs;
             dbg          : dbg_stabs;

Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels