summaryrefslogtreecommitdiff
path: root/Userland/DevTools
diff options
context:
space:
mode:
authorGunnar Beutner <gbeutner@serenityos.org>2021-05-28 06:59:51 +0200
committerAndreas Kling <kling@serenityos.org>2021-05-28 07:59:05 +0200
commit1f57cc595706697bb007177fe418e1766f32597c (patch)
tree9042cceae445be634605eb1f7abcf7ed8585a0a8 /Userland/DevTools
parentffaf27e4b687bc2f5b3167e1676f5cb1922e5253 (diff)
downloadserenity-1f57cc595706697bb007177fe418e1766f32597c.zip
UE: Make sure signal_trampoline_dummy is not optimized away with -flto
This adds __attribute__((used)) to the function declaration so the compiler doesn't discard it. It also makes the function NEVER_INLINE so that we don't end up with multiple copies of the function. This is necessary because the function uses inline assembly to define some unique labels.
Diffstat (limited to 'Userland/DevTools')
-rw-r--r--Userland/DevTools/UserspaceEmulator/Emulator.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/DevTools/UserspaceEmulator/Emulator.cpp b/Userland/DevTools/UserspaceEmulator/Emulator.cpp
index 4933574167..282f5cbc0b 100644
--- a/Userland/DevTools/UserspaceEmulator/Emulator.cpp
+++ b/Userland/DevTools/UserspaceEmulator/Emulator.cpp
@@ -445,8 +445,8 @@ void Emulator::dispatch_one_pending_signal()
}
// Make sure the compiler doesn't "optimize away" this function:
-extern void signal_trampoline_dummy();
-void signal_trampoline_dummy()
+static void signal_trampoline_dummy() __attribute__((used));
+NEVER_INLINE void signal_trampoline_dummy()
{
// The trampoline preserves the current eax, pushes the signal code and
// then calls the signal handler. We do this because, when interrupting a