浏览代码

- reverted accidentally committed partial merge from r14510 ("svn merge"
doesn't check whether the working copy is clean before performing a new
merge...)
--- Reverse-merging r14184 into '.':
U rtl/linux/i386/si_dll.inc
U rtl/linux/x86_64/dllprt0.as
D tests/webtbs/uw14958.pp
D tests/webtbs/tw14958a.pp
D tests/webtbs/tw14958b.pp

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

Jonas Maebe 15 年之前
父节点
当前提交
eeecf48386
共有 6 个文件被更改,包括 23 次插入75 次删除
  1. 0 3
      .gitattributes
  2. 18 1
      rtl/linux/i386/si_dll.inc
  3. 5 1
      rtl/linux/x86_64/dllprt0.as
  4. 0 14
      tests/webtbs/tw14958a.pp
  5. 0 36
      tests/webtbs/tw14958b.pp
  6. 0 20
      tests/webtbs/uw14958.pp

+ 0 - 3
.gitattributes

@@ -9358,8 +9358,6 @@ tests/webtbs/tw1477.pp svneol=native#text/plain
 tests/webtbs/tw1479.pp svneol=native#text/plain
 tests/webtbs/tw1485.pp svneol=native#text/plain
 tests/webtbs/tw1489.pp svneol=native#text/plain
-tests/webtbs/tw14958a.pp svneol=native#text/plain
-tests/webtbs/tw14958b.pp svneol=native#text/plain
 tests/webtbs/tw1501.pp svneol=native#text/plain
 tests/webtbs/tw1532.pp svneol=native#text/plain
 tests/webtbs/tw1539.pp svneol=native#text/plain
@@ -10230,7 +10228,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/uw2004.inc svneol=native#text/plain
 tests/webtbs/uw2040.pp svneol=native#text/plain
 tests/webtbs/uw2266a.inc svneol=native#text/plain

+ 18 - 1
rtl/linux/i386/si_dll.inc

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

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

@@ -68,7 +68,11 @@ _startlib:
         .globl  _haltproc
         .type   _haltproc,@function
 _haltproc:
-	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.