From dd55947b4b362bbb336c02c2995639e6e2e02547 Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Fri, 1 May 2009 14:54:38 +0000 Subject: [PATCH] - disabled jump tables for x86_64, because they cause various kinds of crashes with dynamic libraries (mantis #13628 and related bugs) git-svn-id: trunk@13073 - --- .gitattributes | 2 ++ compiler/x86/nx86set.pas | 6 +++++- tests/webtbs/tw13628a.pp | 10 ++++++++++ tests/webtbs/tw13628b.pp | 29 +++++++++++++++++++++++++++++ 4 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 tests/webtbs/tw13628a.pp create mode 100644 tests/webtbs/tw13628b.pp diff --git a/.gitattributes b/.gitattributes index 7786e63c42..b90132a2a5 100644 --- a/.gitattributes +++ b/.gitattributes @@ -8840,6 +8840,8 @@ tests/webtbs/tw13583.pp svneol=native#text/plain tests/webtbs/tw13596.pp svneol=native#text/plain tests/webtbs/tw13596a.pp svneol=native#text/plain tests/webtbs/tw13622.pp svneol=native#text/plain +tests/webtbs/tw13628a.pp svneol=native#text/plain +tests/webtbs/tw13628b.pp svneol=native#text/plain tests/webtbs/tw1364.pp svneol=native#text/plain tests/webtbs/tw1365.pp svneol=native#text/plain tests/webtbs/tw1374.pp svneol=native#text/plain diff --git a/compiler/x86/nx86set.pas b/compiler/x86/nx86set.pas index f1f44b6154..8f1b93d594 100644 --- a/compiler/x86/nx86set.pas +++ b/compiler/x86/nx86set.pas @@ -73,7 +73,11 @@ implementation function tx86casenode.has_jumptable : boolean; begin - has_jumptable:=target_info.system<>system_x86_64_darwin; +{$ifdef i386} + has_jumptable:=true; +{$else} + has_jumptable:=false; +{$endif} end; diff --git a/tests/webtbs/tw13628a.pp b/tests/webtbs/tw13628a.pp new file mode 100644 index 0000000000..b668b40f2c --- /dev/null +++ b/tests/webtbs/tw13628a.pp @@ -0,0 +1,10 @@ +{ %norun } + +library tw13628a; + +uses + SysUtils; + +begin +end. + diff --git a/tests/webtbs/tw13628b.pp b/tests/webtbs/tw13628b.pp new file mode 100644 index 0000000000..fd67790d67 --- /dev/null +++ b/tests/webtbs/tw13628b.pp @@ -0,0 +1,29 @@ +{ %needlibrary } + +program loadmodule; + +uses + dynlibs; + +const + {$ifdef unix} + {$ifdef darwin} + libname = './libtw13628a.dylib'; + {$else darwin} + libname = './libtw13628a.so'; + {$endif darwin} + {$endif unix} + + {$ifdef windows} + libname = 'tw13628a.dll'; + {$endif windows} + +var + hdl: TLibHandle; +begin + hdl := loadlibrary(libname); + if (hdl=nilhandle) then + halt(1); + if not UnloadLibrary(hdl) then + halt(2);; +end.