diff -u -r open-gpu-kernel-modules-595.71.05.orig/src/nvidia/Makefile open-gpu-kernel-modules-595.71.05/src/nvidia/Makefile
--- open-gpu-kernel-modules-595.71.05.orig/src/nvidia/Makefile	2026-05-03 10:50:17.955521361 +0200
+++ open-gpu-kernel-modules-595.71.05/src/nvidia/Makefile	2026-05-03 14:39:05.846333475 +0200
@@ -188,6 +188,11 @@
 
 CFLAGS += $(CONDITIONAL_CFLAGS)
 
+
+# Get rid of "'naked' return found in MITIGATION_RETHUNK build"
+# objtool warnings
+CFLAGS += -mfunction-return=thunk-extern
+
 CC_ONLY_CFLAGS += --std=gnu11
 CXX_ONLY_CFLAGS += --std=gnu++11
 
diff -u -r open-gpu-kernel-modules-595.71.05.orig/src/nvidia-modeset/Makefile open-gpu-kernel-modules-595.71.05/src/nvidia-modeset/Makefile
--- open-gpu-kernel-modules-595.71.05.orig/src/nvidia-modeset/Makefile	2026-05-03 10:50:17.943521129 +0200
+++ open-gpu-kernel-modules-595.71.05/src/nvidia-modeset/Makefile	2026-05-03 14:38:16.685381820 +0200
@@ -159,6 +159,13 @@
 
 CFLAGS += $(CONDITIONAL_CFLAGS)
 
+# Get rid of "'naked' return found in MITIGATION_RETHUNK build"
+# objtool warnings
+CFLAGS += -mfunction-return=thunk-extern 
+# Trying to get rid of ".eh_frame+0xXXXX: data relocation to !ENDBR:"
+# objtool warnings, but doesn't help :-(
+#CFLAGS += -fcf-protection=branch
+
 CC_ONLY_CFLAGS += -Wimplicit
 CC_ONLY_CFLAGS += -Wstrict-prototypes
 CC_ONLY_CFLAGS += -Wmissing-prototypes
