Skip to content

GLdispatch: Define all dispatch stubs at compile time (v2)

Created by: kbrenneman

This is an updated version of #128, rebased against the current master. Aside from the rebase and a few other minor changes, I added a fix for the PPC64LE stubs, which currently can't deal with a dispatch slot >= 4096.

As noted in #128, there's no functional difference between the static and generated dispatch stubs: They all just look up an address from a dispatch table and jump to it.

With this change, all of the "dynamic" stubs are defined at compile time just like the static ones. It no longer has to deal with the complexity and extra failure points of allocating executable memory. The code generation stuff is now only needed for restoring the entrypoints after a vendor library patched them.

In addition, the static and dynamic stubs are lumped together into a contiguous sequence instead of two separate places. As a result, most of the rest of libGLdispatch can just use dispatch table indices to identify a dispatch stub without having to care whether it's a dynamic or static one.

The first two commits are the important ones. The first is the PPC64LE fix, and the second is the removes the execmem code and extends the static dispatch stubs. The rest of the commits are cleanup changes.

Merge request reports