about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--loftix/patching.scm2
-rw-r--r--patches/e9patch-static-pie.patch22
2 files changed, 24 insertions, 0 deletions
diff --git a/loftix/patching.scm b/loftix/patching.scm
index 8b50e6e..85e41d6 100644
--- a/loftix/patching.scm
+++ b/loftix/patching.scm
@@ -32,6 +32,8 @@
               (patches (search-patches
                          ;; https://github.com/GJDuck/e9patch/pull/94
                          "patches/e9patch-zydis-4.1.0.patch"
+                         ;; https://github.com/GJDuck/e9patch/pull/104
+                         "patches/e9patch-static-pie.patch"
                          ;; https://github.com/GJDuck/e9patch/pull/92
                          "patches/e9patch-check.patch"
                          ;; https://github.com/GJDuck/e9patch/pull/95
diff --git a/patches/e9patch-static-pie.patch b/patches/e9patch-static-pie.patch
new file mode 100644
index 0000000..cb269a7
--- /dev/null
+++ b/patches/e9patch-static-pie.patch
@@ -0,0 +1,22 @@
+From 4e41d765307fae15c903dc6d1141ec85e9047d87 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Nguy=E1=BB=85n=20Gia=20Phong?= <cnx@loang.net>
+Date: Wed, 22 Oct 2025 16:37:24 +0900
+Subject: [PATCH] Support call trampolines in static-PIE linked executables
+
+---
+ src/e9tool/e9frontend.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/e9tool/e9frontend.cpp b/src/e9tool/e9frontend.cpp
+index a296a71..080e751 100644
+--- a/src/e9tool/e9frontend.cpp
++++ b/src/e9tool/e9frontend.cpp
+@@ -1022,7 +1022,7 @@ ELF *e9tool::parseELF(const char *filename, intptr_t base)
+         end = std::max(end, phdr_end);
+         switch (phdr->p_type)
+         {
+-            case PT_INTERP:
++            case PT_DYNAMIC:
+                 if (!exe && !isLibraryFilename(filename))
+                     exe = true;
+                 dynlink = true;