Browse Source

* reverted merge of r14184 because it causes a regression
(mantis #17383)

git-svn-id: branches/fixes_2_4@16036 -

Jonas Maebe 15 years ago
parent
commit
1826a3c238

+ 0 - 3
.gitattributes

@@ -9476,8 +9476,6 @@ tests/webtbs/tw1485.pp svneol=native#text/plain
 tests/webtbs/tw1489.pp svneol=native#text/plain
 tests/webtbs/tw14941.pp svneol=native#text/plain
 tests/webtbs/tw14941a.pp svneol=native#text/plain
-tests/webtbs/tw14958a.pp svneol=native#text/plain
-tests/webtbs/tw14958b.pp svneol=native#text/plain
 tests/webtbs/tw14992a.pp svneol=native#text/pascal
 tests/webtbs/tw14992b.pp svneol=native#text/pascal
 tests/webtbs/tw14992c.pp svneol=native#text/pascal
@@ -10382,7 +10380,6 @@ tests/webtbs/uw13345c.pp svneol=native#text/plain
 tests/webtbs/uw13345y.pp svneol=native#text/plain
 tests/webtbs/uw13583.pp svneol=native#text/plain
 tests/webtbs/uw14124.pp svneol=native#text/plain
-tests/webtbs/uw14958.pp svneol=native#text/plain
 tests/webtbs/uw15909.pp svneol=native#text/plain
 tests/webtbs/uw2004.inc svneol=native#text/plain
 tests/webtbs/uw2040.pp svneol=native#text/plain

+ 20 - 0
rtl/linux/i386/si_dll.inc

@@ -76,4 +76,24 @@ procedure _FPC_shared_lib_haltproc; assembler; nostackframe; public name 'FPC_SH
 asm
 .Lhaltproc:
   call	  lib_exit
+ {$ifdef FPC_PIC}
+  call    get1eipasebx
+  addl    $_GLOBAL_OFFSET_TABLE_,%ebx
+  movl    ExitCode@GOT(%ebx),%ebx
+ {$if sizeof(ExitCode)=2}
+  movzwl  (%ebx),%ebx
+ {$else}
+  mov     (%ebx),%ebx
+ {$endif}
+{$else FPC_PIC}
+ {$if sizeof(ExitCode)=2}
+  movzwl  ExitCode,%ebx
+ {$else}
+  mov     ExitCode,%ebx
+ {$endif}
+{$endif FPC_PIC}
+  xorl    %eax,%eax
+  incl    %eax                    { eax=1, exit call }
+  int     $0x80
+  jmp     .Lhaltproc
 end;

+ 5 - 1
rtl/linux/x86_64/dllprt0.as

@@ -72,7 +72,11 @@ _haltproc:
 	.type FPC_SHARED_LIB_EXIT,@function
 FPC_SHARED_LIB_EXIT:
 	call	FPC_LIB_EXIT@PLT
-	ret
+        movl    $231,%eax                 /* exit_group call */
+        movq    operatingsystem_result@GOTPCREL(%rip),%rbx
+        movzwl  (%rbx),%edi
+        syscall
+        jmp     _haltproc@PLT
 
 /* Define a symbol for the first piece of initialized data.  */
 	.data

+ 0 - 14
tests/webtbs/tw14958a.pp

@@ -1,14 +0,0 @@
-{ %target=linux }
-{ %norun }
-library tw14958a;
-
-uses
-  uw14958;
-
-exports
-  Fun;
-
-begin
-  Writeln('  ExLib Main');
-end.
-

+ 0 - 36
tests/webtbs/tw14958b.pp

@@ -1,36 +0,0 @@
-{ %target=linux }
-{ %needlibrary }
-{ %result=182 }
-program loadlib;
-
-{$mode objfpc}{$H+}
-
-uses
-  dl,dynlibs;
-
-var
-  p: Pointer;
-  s: Longint;
-begin
-  Writeln('Opening ', ParamStr(1));
-  p := dlopen('./libtw14958a.so', RTLD_LAZY);
-  if Assigned(p) then
-  begin
-    Writeln('OK. Now closing.');
-    s := dlclose(p);
-    Writeln('After close.');
-    if s = 0 then
-      begin
-        Writeln('Close OK.');
-        halt(182);
-      end
-    else
-      Writeln('Failed close. Status: ', s);
-  end
-  else
-    begin
-      Writeln('Failed open.');
-      halt(1);
-    end;
-end.
-

+ 0 - 20
tests/webtbs/uw14958.pp

@@ -1,20 +0,0 @@
-unit uw14958;
-
-interface
-
-function Fun: Boolean; stdcall;
-
-implementation
-
-function Fun: Boolean; stdcall;
-begin
-  Fun := False;
-end;
-
-initialization
-  Writeln('  ExLib Init');
-
-finalization
-  Writeln('  ExLib Final');
-
-end.