Skip to content

GH-126910: Build/link the JIT shim in the Python interpreter#148872

Open
diegorusso wants to merge 5 commits intopython:mainfrom
diegorusso:jit-linked-shim
Open

GH-126910: Build/link the JIT shim in the Python interpreter#148872
diegorusso wants to merge 5 commits intopython:mainfrom
diegorusso:jit-linked-shim

Conversation

@diegorusso
Copy link
Copy Markdown
Contributor

@diegorusso diegorusso commented Apr 22, 2026

There are various reason why we want to do this but the main is to help simplifying #146071

The _PyJIT symbol (the shim) is now part of the python interpreter with its eh_frame and gdb can see it as normal symbol. There is no need to compile/emit code/eh_frame at runtime as this is done at build time.

@diegorusso
Copy link
Copy Markdown
Contributor Author

diegorusso commented Apr 23, 2026

eh_frame of the shim is now present in the python binary

$ nm -an python | grep ' _PyJIT$'
000000000035e5b8 T _PyJIT

$ readelf --debug-dump=frames-interp python | grep -A4 -B1 '35e5b8'
  0xffffffffffdbbf88 (offset: 0x35d568) -> 0x66f08 fde=[ 564a0]
  0xffffffffffdbcfd8 (offset: 0x35e5b8) -> 0x66f4c fde=[ 564e4]
  0xffffffffffdbd060 (offset: 0x35e640) -> 0x66fc0 fde=[ 56558]
  0xffffffffffdbd1c4 (offset: 0x35e7a4) -> 0x6701c fde=[ 565b4]
  0xffffffffffdbd2e0 (offset: 0x35e8c0) -> 0x67050 fde=[ 565e8]
  0xffffffffffdbd3cc (offset: 0x35e9ac) -> 0x67088 fde=[ 56620]
--

000564e4 0000000000000070 00000018 FDE cie=000564d0 pc=000000000035e5b8..000000000035e634
   LOC           CFA      x19   x20   x21   x22   x23   x24   x25   x26   x27   x28   x29   ra    v8    v9    v10   v11   v12   v13   v14   v15
000000000035e5b8 sp+0     u     u     u     u     u     u     u     u     u     u     u     u     u     u     u     u     u     u     u     u
000000000035e5bc sp+160   u     u     u     u     u     u     u     u     u     u     u     u     u     u     u     u     u     u     u     u
000000000035e5e4 x29+96   c-8   c-16  c-24  c-32  c-40  c-48  c-56  c-64  c-72  c-80  c-96  c-88  c-104 c-112 c-120 c-128 c-136 c-144 c-152 c-160
000000000035e608 sp+160   c-8   c-16  c-24  c-32  c-40  c-48  c-56  c-64  c-72  c-80  c-96  c-88  c-104 c-112 c-120 c-128 c-136 c-144 c-152 c-160
000000000035e630 sp+0     u     u     u     u     u     u     u     u     u     u     u     u     u     u     u     u     u     u     u     u

Copy link
Copy Markdown
Member

@markshannon markshannon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants