diff options
author | Magnus Granberg <zorry@gentoo.org> | 2014-08-19 21:25:22 +0000 |
---|---|---|
committer | Konstantin Tokarev <annulen@yandex.ru> | 2017-01-04 16:08:54 +0000 |
commit | 548380af096f8277e460383c81a4ecdf2b77523f (patch) | |
tree | 2329801867abe7563b74bddcc1d00ef406a89c96 | |
parent | 19d304e8d17fb39efe795b51e1ee0f5564a0692a (diff) |
TEXTREL in libjavascriptcoregtk-1.0.so.0.11.0 on x86 (or i586)
https://bugs.webkit.org/show_bug.cgi?id=70610
Patch by Magnus Granberg <zorry@gentoo.org> on 2014-08-19
Reviewed by Darin Adler.
Source/JavaScriptCore:
Setup %ebx so we can use the plt.
* jit/ThunkGenerators.cpp:
Source/WTF:
Add PLT if we're building with PIC.
* wtf/InlineASM.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@172759 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Change-Id: I7524a662f76f75f8dee0a07bf2360420d7b23d2d
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
-rw-r--r-- | Source/JavaScriptCore/jit/ThunkGenerators.cpp | 24 | ||||
-rw-r--r-- | Source/WTF/wtf/InlineASM.h | 2 |
2 files changed, 26 insertions, 0 deletions
diff --git a/Source/JavaScriptCore/jit/ThunkGenerators.cpp b/Source/JavaScriptCore/jit/ThunkGenerators.cpp index fde1347a0..fbf550ba4 100644 --- a/Source/JavaScriptCore/jit/ThunkGenerators.cpp +++ b/Source/JavaScriptCore/jit/ThunkGenerators.cpp @@ -524,6 +524,30 @@ double jsRound(double d) } \ static MathThunk UnaryDoubleOpWrapper(function) = &function##Thunk; +#elif CPU(X86) && COMPILER(GCC) && OS(LINUX) && defined(__PIC__) +#define defineUnaryDoubleOpWrapper(function) \ + asm( \ + ".text\n" \ + ".globl " SYMBOL_STRING(function##Thunk) "\n" \ + HIDE_SYMBOL(function##Thunk) "\n" \ + SYMBOL_STRING(function##Thunk) ":" "\n" \ + "pushl %ebx\n" \ + "subl $20, %esp\n" \ + "movsd %xmm0, (%esp) \n" \ + "call __x86.get_pc_thunk.bx\n" \ + "addl $_GLOBAL_OFFSET_TABLE_, %ebx\n" \ + "call " GLOBAL_REFERENCE(function) "\n" \ + "fstpl (%esp) \n" \ + "movsd (%esp), %xmm0 \n" \ + "addl $20, %esp\n" \ + "popl %ebx\n" \ + "ret\n" \ + );\ + extern "C" { \ + MathThunkCallingConvention function##Thunk(MathThunkCallingConvention); \ + } \ + static MathThunk UnaryDoubleOpWrapper(function) = &function##Thunk; + #elif CPU(X86) && COMPILER(GCC) && (OS(DARWIN) || OS(LINUX)) #define defineUnaryDoubleOpWrapper(function) \ asm( \ diff --git a/Source/WTF/wtf/InlineASM.h b/Source/WTF/wtf/InlineASM.h index 0a2fe78b7..2dc40ef4e 100644 --- a/Source/WTF/wtf/InlineASM.h +++ b/Source/WTF/wtf/InlineASM.h @@ -46,6 +46,8 @@ #define GLOBAL_REFERENCE(name) #name "@plt" #elif CPU(X86) && COMPILER(MINGW) #define GLOBAL_REFERENCE(name) "@" #name "@4" +#elif OS(LINUX) && CPU(X86) && defined(__PIC__) +#define GLOBAL_REFERENCE(name) SYMBOL_STRING(name) "@plt" #else #define GLOBAL_REFERENCE(name) SYMBOL_STRING(name) #endif |