Browse Source

+ abi tag for i386
* arm abi tag moved into pascal file

git-svn-id: trunk@40454 -

florian 6 years ago
parent
commit
eeadf618b8

+ 2 - 0
.gitattributes

@@ -9607,6 +9607,7 @@ rtl/linux/aarch64/stat.inc svneol=native#text/plain
 rtl/linux/aarch64/syscall.inc svneol=native#text/plain
 rtl/linux/aarch64/syscall.inc svneol=native#text/plain
 rtl/linux/aarch64/syscallh.inc svneol=native#text/plain
 rtl/linux/aarch64/syscallh.inc svneol=native#text/plain
 rtl/linux/aarch64/sysnr.inc svneol=native#text/plain
 rtl/linux/aarch64/sysnr.inc svneol=native#text/plain
+rtl/linux/arm/abitag.inc svneol=native#text/plain
 rtl/linux/arm/bsyscall.inc svneol=native#text/plain
 rtl/linux/arm/bsyscall.inc svneol=native#text/plain
 rtl/linux/arm/cprt0.as svneol=native#text/plain
 rtl/linux/arm/cprt0.as svneol=native#text/plain
 rtl/linux/arm/dllprt0.as svneol=native#text/plain
 rtl/linux/arm/dllprt0.as svneol=native#text/plain
@@ -9628,6 +9629,7 @@ rtl/linux/errno.inc svneol=native#text/plain
 rtl/linux/errnostr.inc svneol=native#text/plain
 rtl/linux/errnostr.inc svneol=native#text/plain
 rtl/linux/fpcylix.pp svneol=native#text/plain
 rtl/linux/fpcylix.pp svneol=native#text/plain
 rtl/linux/fpmake.inc svneol=native#text/plain
 rtl/linux/fpmake.inc svneol=native#text/plain
+rtl/linux/i386/abitag.inc svneol=native#text/plain
 rtl/linux/i386/bsyscall.inc svneol=native#text/plain
 rtl/linux/i386/bsyscall.inc svneol=native#text/plain
 rtl/linux/i386/si_c.inc svneol=native#text/plain
 rtl/linux/i386/si_c.inc svneol=native#text/plain
 rtl/linux/i386/si_c21.inc svneol=native#text/plain
 rtl/linux/i386/si_c21.inc svneol=native#text/plain

+ 2 - 2
compiler/raatt.pas

@@ -1340,9 +1340,9 @@ unit raatt;
                        if actasmtoken=AS_COMMA then
                        if actasmtoken=AS_COMMA then
                          begin
                          begin
                            Consume(AS_COMMA);
                            Consume(AS_COMMA);
-                           if actasmtoken=AS_MOD then
+                           if (actasmtoken=AS_MOD) or (actasmtoken=AS_AT) then
                              begin
                              begin
-                               Consume(AS_MOD);
+                               Consume(actasmtoken);
                                if actasmtoken=AS_ID then
                                if actasmtoken=AS_ID then
                                  begin
                                  begin
                                    case actasmpattern of
                                    case actasmpattern of

+ 32 - 0
rtl/linux/arm/abitag.inc

@@ -0,0 +1,32 @@
+{
+   This file is part of the Free Pascal run time library.
+   Copyright (c) 2002,2018 by Florian Klaempfl
+   members of the Free Pascal development team.
+
+   See the file COPYING.FPC, included in this distribution,
+   for details about the copyright.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY;without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+**********************************************************************}
+
+procedure ABITag;nostackframe;assembler;
+asm
+  .section ".note.ABI-tag", "a"
+  .align 4
+  .long 4
+  .long 16
+  .long  1
+  .asciz "GNU"
+  .align 4
+  .long 0
+  // oldest supported kernel version, just a guess for now (FK)
+  .long 2,6,0
+  .align 4
+
+  .section ".note.GNU-stack","",@progbits
+  .text
+end;
+

+ 0 - 15
rtl/linux/arm/cprt0.as

@@ -131,18 +131,3 @@ __data_start:
         .byte 0
         .byte 0
         .ascii "generated by FPC http://www.freepascal.org\0"
         .ascii "generated by FPC http://www.freepascal.org\0"
 
 
-/* We need this stuff to make gdb behave itself, otherwise
-   gdb will chokes with SIGILL when trying to debug apps.
-*/
-        .section ".note.ABI-tag", "a"
-        .align 4
-        .long 1f - 0f
-        .long 3f - 2f
-        .long  1
-0:      .asciz "GNU"
-1:      .align 4
-2:      .long 0
-        .long 2,0,0
-3:      .align 4
-
-.section .note.GNU-stack,"",%progbits

+ 0 - 15
rtl/linux/arm/gprt0.as

@@ -143,18 +143,3 @@ __data_start:
         .byte 0
         .byte 0
         .ascii "generated by FPC http://www.freepascal.org\0"
         .ascii "generated by FPC http://www.freepascal.org\0"
 
 
-/* We need this stuff to make gdb behave itself, otherwise
-   gdb will chokes with SIGILL when trying to debug apps.
-*/
-        .section ".note.ABI-tag", "a"
-        .align 4
-        .long 1f - 0f
-        .long 3f - 2f
-        .long  1
-0:      .asciz "GNU"
-1:      .align 4
-2:      .long 0
-        .long 2,0,0
-3:      .align 4
-
-.section .note.GNU-stack,"",%progbits

+ 0 - 15
rtl/linux/arm/prt0.as

@@ -173,18 +173,3 @@ __data_start:
 	.byte 0
 	.byte 0
 	.ascii "generated by FPC http://www.freepascal.org\0"
 	.ascii "generated by FPC http://www.freepascal.org\0"
 
 
-/* We need this stuff to make gdb behave itself, otherwise
-   gdb will chokes with SIGILL when trying to debug apps.
-*/
-        .section ".note.ABI-tag", "a"
-        .align 4
-        .long 1f - 0f
-        .long 3f - 2f
-        .long  1
-0:      .asciz "GNU"
-1:      .align 4
-2:      .long 0
-        .long 2,0,0
-3:      .align 4
-
-.section .note.GNU-stack,"",%progbits

+ 0 - 15
rtl/linux/arm/ucprt0.as

@@ -168,18 +168,3 @@ __data_start:
         .comm operatingsystem_parameter_argc,4
         .comm operatingsystem_parameter_argc,4
         .comm operatingsystem_parameter_argv,4
         .comm operatingsystem_parameter_argv,4
 
 
-/* We need this stuff to make gdb behave itself, otherwise
-   gdb will chokes with SIGILL when trying to debug apps.
-*/
-        .section ".note.ABI-tag", "a"
-        .align 4
-        .long 1f - 0f
-        .long 3f - 2f
-        .long  1
-0:      .asciz "GNU"
-1:      .align 4
-2:      .long 0
-        .long 2,0,0
-3:      .align 4
-
-.section .note.GNU-stack,"",%progbits

+ 32 - 0
rtl/linux/i386/abitag.inc

@@ -0,0 +1,32 @@
+{
+   This file is part of the Free Pascal run time library.
+   Copyright (c) 2002,2018 by Florian Klaempfl
+   members of the Free Pascal development team.
+
+   See the file COPYING.FPC, included in this distribution,
+   for details about the copyright.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY;without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+**********************************************************************}
+
+procedure ABITag;nostackframe;assembler;
+asm
+  .section ".note.ABI-tag", "a"
+  .align 4
+  .long 4
+  .long 16
+  .long  1
+  .asciz "GNU"
+  .align 4
+  .long 0
+  // oldest supported kernel version, just a guess for now (FK)
+  .long 2,6,0
+  .align 4
+
+  .section ".note.GNU-stack","",@progbits
+  .text
+end;
+

+ 6 - 0
rtl/linux/system.pp

@@ -575,6 +575,12 @@ procedure InitTLS; [public,alias:'FPC_INITTLS'];
 {$endif CPUARM}
 {$endif CPUARM}
 
 
 
 
+{$if FPC_FULLVERSION>30200}
+{$if defined(CPUI386) or defined(CPUARM)}
+{$I abitag.inc}
+{$endif defined(CPUI386) or defined(CPUARM)}
+{$endif FPC_FULLVERSION>30200}
+
 begin
 begin
 {$if defined(i386) and not defined(FPC_USE_LIBC)}
 {$if defined(i386) and not defined(FPC_USE_LIBC)}
   InitSyscallIntf;
   InitSyscallIntf;