Title: [174503] trunk/Source/_javascript_Core
Revision
174503
Author
commit-qu...@webkit.org
Date
2014-10-09 08:59:06 -0700 (Thu, 09 Oct 2014)

Log Message

Ensure that inline assembly Thunk functions don't conflict with the section designations of the compiler
https://bugs.webkit.org/show_bug.cgi?id=137434

Patch by Akos Kiss <ak...@inf.u-szeged.hu> on 2014-10-09
Reviewed by Michael Saboff.

The ARM64 version of the defineUnaryDoubleOpWrapper macro in
ThunkGenerators.cpp contains inline assembly with .text assembler
directive followed by a static variable declaration. This macro gets
expanded several times afterwards, however, only during the compilation
of the first expansion does gcc insert a .data assembler directive
before the assembled version of the static variable. Thus, only the
first variable gets allocated in the .data section, all the others
remain in .text. If _javascript_Core is built as a shared library then
this causes a segmentation fault during dynamic linking.

This patch puts a .previous directive at the end of the inline assembly
to ensure that the assumptions of the compiler about the sections are
not broken and the following variable goes to the right place.

* jit/ThunkGenerators.cpp:

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (174502 => 174503)


--- trunk/Source/_javascript_Core/ChangeLog	2014-10-09 07:34:41 UTC (rev 174502)
+++ trunk/Source/_javascript_Core/ChangeLog	2014-10-09 15:59:06 UTC (rev 174503)
@@ -1,3 +1,26 @@
+2014-10-09  Akos Kiss  <ak...@inf.u-szeged.hu>
+
+        Ensure that inline assembly Thunk functions don't conflict with the section designations of the compiler
+        https://bugs.webkit.org/show_bug.cgi?id=137434
+
+        Reviewed by Michael Saboff.
+
+        The ARM64 version of the defineUnaryDoubleOpWrapper macro in
+        ThunkGenerators.cpp contains inline assembly with .text assembler
+        directive followed by a static variable declaration. This macro gets
+        expanded several times afterwards, however, only during the compilation
+        of the first expansion does gcc insert a .data assembler directive
+        before the assembled version of the static variable. Thus, only the
+        first variable gets allocated in the .data section, all the others
+        remain in .text. If _javascript_Core is built as a shared library then
+        this causes a segmentation fault during dynamic linking.
+
+        This patch puts a .previous directive at the end of the inline assembly
+        to ensure that the assumptions of the compiler about the sections are
+        not broken and the following variable goes to the right place.
+
+        * jit/ThunkGenerators.cpp:
+
 2014-10-08  Oliver Hunt  <oli...@apple.com>
 
         Make sure arguments tearoff is performed through the environment record if necessary

Modified: trunk/Source/_javascript_Core/jit/ThunkGenerators.cpp (174502 => 174503)


--- trunk/Source/_javascript_Core/jit/ThunkGenerators.cpp	2014-10-09 07:34:41 UTC (rev 174502)
+++ trunk/Source/_javascript_Core/jit/ThunkGenerators.cpp	2014-10-09 15:59:06 UTC (rev 174503)
@@ -801,6 +801,7 @@
         HIDE_SYMBOL(function##Thunk) "\n" \
         SYMBOL_STRING(function##Thunk) ":" "\n" \
         "b " GLOBAL_REFERENCE(function) "\n" \
+        ".previous" \
     ); \
     extern "C" { \
         MathThunkCallingConvention function##Thunk(MathThunkCallingConvention); \
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to