Commit graph

13 commits

Author SHA1 Message Date
Kyle Brenneman a7bb6f4d19 Remove extra paragraph from license text.
Remove the "If only executable code is distributed..." paragraph from
the license text. Everything now uses a normal MIT license.

The only code from Khronos that's included in libglvnd is the EGL/GL
header and XML files, which do not contain that paragraph.

Fixes https://gitlab.freedesktop.org/glvnd/libglvnd/-/issues/221
2021-09-30 09:21:34 -06:00
H.J. Lu f96f6bde04 x86: Add ENDBR at function entries
Intel Control-flow Enforcement Technology (CET):

https://software.intel.com/en-us/articles/intel-sdm

contains shadow stack (SHSTK) and indirect branch tracking (IBT). When
CET is enabled, ELF object files must be marked with .note.gnu.property
section. Also when IBT is enabled, all indirect branch targets must
start with ENDBR instruction which is NOP on non-CET processors.

This fixes:

https://gitlab.freedesktop.org/glvnd/libglvnd/issues/202
2020-02-21 21:28:29 +00:00
q66 c31a7c06eb vnd-glapi: allow asm to be used on ELFv2 ppc64 big endian
These entry points are actually not little endian specific,
but they are specific to ELFv2 ABI. ELFv2 ABI can be used
on either little or big endian, and there are distributions
doing so (e.g. Void Linux, Adélie Linux) as well as other
OSes transitioning (FreeBSD).

These have been confirmed to work on a Power Mac G5 running
Void Linux.
2019-12-09 18:49:41 +01:00
Kyle Brenneman 8b4f6aeb7a PPC64LE: Fix the cache clear instructions.
Change the cache clear instructions for generated PPC64LE code so that it uses
an input variable instead of an output variable.

With an output variable, it doesn't use the correct address for the dcbst and
icbi instructions, possibly causing it to crash.
2017-06-13 11:53:51 -06:00
Ben Crocker 962fc1a161 tests: Fill in the ASM code in the template in patch_ppc64le().
Signed-off-by: Ben Crocker <bcrocker@redhat.com>
2017-04-24 11:50:07 -06:00
Kyle Brenneman e77d29a67c Makefile and structural changes for ppc64le support.
Added the files and makefile changes needed for adding support for ppc64le
dispatch stubs.

The actual assembly code still needs to be written, along with any other
arch-specific requirements for self-modifying code.

The new entry_ppc64le_*.c files are mostly based on the x86-64 files.

It still needs:
- Assembly code for OpenGL dispatch stubs in entry_ppc64le_tls.c,
  entry_ppc64le_tsd.c, or both.
- Assembly code for GLX dispatch stubs in glvnd_genentry.c.
- Assembly code for the entrypoint patching tests in patchentrypoints.c.
2017-04-24 11:49:02 -06:00
Kyle Brenneman 8e6e102820 Merge branch 'x32-support'
Fixes https://github.com/NVIDIA/libglvnd/issues/115
2017-03-08 13:41:29 -07:00
Kyle Brenneman bb3d4a044c tests: Add support for x32.
Update the entrypoint patching tests to work on an x32 build. On x32, it'll use
the same patching as it would for x86-64.
2017-03-08 13:40:00 -07:00
Kyle Brenneman 8b7a44fb6d tests: Expand the unit tests for libGLdispatch.
Replaced testpatchentrypoints_gldispatch with three new unit tests.

testgldispatch_static and testgldispatch_generated test dispatching to multiple
vendor libraries through static and generated dispatch stubs, respectively.

testgldispatch_generated tests entrypoint patching and unpatching. This adds
coverage for patching generated stubs in addition to the static ones.

The entrypoint patching functions in tests/dummy/patchentrypoints.c now take
the name of the function to patch, instead of hard-coding it to only patch
glVertex3fv.
2017-02-28 16:37:36 -07:00
Kyle Brenneman 522c601799 Add support for aarch64.
Add assembly code and stub generation for TSD stubs on aarch64.
2016-11-15 08:36:51 -07:00
Kyle Brenneman f556baa293 Change the assembly templates for ARMv7 to use uint16_t.
Change the assembly template arrays for ARMv7 to use arrays of 16-bit integers
instead of 8-bit.

This removes the need to byte swap them on little-endian systems.
2016-10-18 15:25:21 -06:00
Kyle Brenneman a813b56339 tests: Add a more extensive test for entrypoint patching.
Add a new unit test, testpatchentrypoints_gldispatch. It calls into
libGLdispatch directly instead of going through GLX or EGL, and it tests
patching and unpatching between multiple vendor libraries.

Rewrote the x86-64 assembly for the entrypoint patching tests. It now uses
absolute memory addresses instead of RIP-relative, so it can work even if the
variable that it's supposed to update isn't within +-2GB of the function.
2016-10-17 11:12:21 -06:00
Kyle Brenneman dbfaa50bd8 tests: Move the entrypoint patching code into a helper library.
Moved the code for testing entrypoint patching into a helper library so that
it can be used for more than just GLX.
2016-10-17 11:12:21 -06:00