Skip to content

Commit

Permalink
Fix crash when running QtCore: Stack is misaligned on x86-64
Browse files Browse the repository at this point in the history
When our ELF entry point function is started by the kernel, the stack is
aligned at 16 bytes. However, the stack is expected to be off by 8, due
to a preceding CALL instruction which didn't exist. This cauases a crash
further down as the compiler may generate aligned stack access.

Change-Id: I1496b069cc534f1a838dfffd15c9dc4ef9e3869e
Reviewed-by: Edward Welbourne <[email protected]>
  • Loading branch information
thiagomacieira committed Oct 3, 2019
1 parent 5aa13ea commit 9328058
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/corelib/global/qlibraryinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -709,10 +709,14 @@ QT_END_NAMESPACE

#include "private/qcoreapplication_p.h"

QT_WARNING_DISABLE_GCC("-Wattributes")
QT_WARNING_DISABLE_CLANG("-Wattributes")
QT_WARNING_DISABLE_INTEL(2621)

extern const char qt_core_interpreter[] __attribute__((section(".interp")))
= ELF_INTERPRETER;

extern "C" void qt_core_boilerplate();
extern "C" void qt_core_boilerplate() __attribute__((force_align_arg_pointer));
void qt_core_boilerplate()
{
printf("This is the QtCore library version " QT_BUILD_STR "\n"
Expand Down

0 comments on commit 9328058

Please sign in to comment.