Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions Lib/test/test_perf_profiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ def tearDown(self) -> None:
for file in files_to_delete:
file.unlink()

@unittest.skipIf(support.check_bolt_optimized(), "fails on BOLT instrumented binaries")
def test_trampoline_works(self):
code = """if 1:
def foo():
Expand Down Expand Up @@ -113,7 +112,6 @@ def baz():
"Address should contain only hex characters",
)

@unittest.skipIf(support.check_bolt_optimized(), "fails on BOLT instrumented binaries")
def test_trampoline_with_unencodable_name(self):
code = """if 1:
import sys
Expand All @@ -123,7 +121,6 @@ def test_trampoline_with_unencodable_name(self):
"""
assert_python_ok("-c", code, PYTHON_JIT="0")

@unittest.skipIf(support.check_bolt_optimized(), "fails on BOLT instrumented binaries")
def test_trampoline_works_with_forks(self):
code = """if 1:
import os, sys
Expand Down Expand Up @@ -193,7 +190,6 @@ def baz():
self.assertNotIn(f"py::bar:{script}", child_perf_file_contents)
self.assertNotIn(f"py::baz:{script}", child_perf_file_contents)

@unittest.skipIf(support.check_bolt_optimized(), "fails on BOLT instrumented binaries")
def test_trampoline_works_after_fork_with_many_code_objects(self):
code = """if 1:
import gc, os, sys, signal
Expand Down Expand Up @@ -233,7 +229,6 @@ def test_trampoline_works_after_fork_with_many_code_objects(self):
self.assertEqual(process.returncode, 0, stderr)
self.assertEqual(stderr, "")

@unittest.skipIf(support.check_bolt_optimized(), "fails on BOLT instrumented binaries")
def test_sys_api(self):
code = """if 1:
import sys
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fix crashes with ``-X perf`` and ``-X perf_jit`` in BOLT builds.
The ELF perf trampoline templates now use read-only data sections.
5 changes: 5 additions & 0 deletions Python/asm_trampoline.S
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
#include "asm_trampoline_aarch64.h"

/* CPython copies this template into executable memory. */
#if defined(__ELF__)
.section .rodata
#else
.text
#endif
.globl _Py_trampoline_func_start
# The following assembly is equivalent to:
# PyObject *
Expand Down
Loading