summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/exec_elf.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/kern/exec_elf.c b/sys/kern/exec_elf.c
index 281b1dc61c5..5304023bf5f 100644
--- a/sys/kern/exec_elf.c
+++ b/sys/kern/exec_elf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: exec_elf.c,v 1.49 2003/11/03 19:58:22 tedu Exp $ */
+/* $OpenBSD: exec_elf.c,v 1.50 2005/11/11 16:41:24 drahn Exp $ */
/*
* Copyright (c) 1996 Per Fogelstrom
@@ -710,6 +710,13 @@ native:
}
/*
+ * Strangely some linux programs may have all load sections marked
+ * writeable, in this case, textsize is not -1, but rather 0;
+ */
+ if (epp->ep_tsize == ELFDEFNNAME(NO_ADDR))
+ epp->ep_tsize = 0;
+
+ /*
* Check if we found a dynamically linked binary and arrange to load
* it's interpreter when the exec file is released.
*/