TXR heads up: executable stack, oops!

 new new list compose Reply to this message Top page
Attachments:
+ (text/plain)

Delete this message
Author: Kaz Kylheku
Date:  
To: TXR Users
CC: Moritz Barsnick, Dave Love
Subject: TXR heads up: executable stack, oops!
Hi all,

I've discovered that the txr executable has a "rwx" STACK section.

$ objdump -p txr | grep -A 1 STACK
    STACK off    0x00000000 vaddr 0x00000000 paddr 0x00000000 align 2**2
          filesz 0x00000000 memsz 0x00000000 flags rwx
                                                   ^^^ !


This is caused by the lack of a special .section in the jmp.S
assembly language module. A patch for this issue:

diff --git a/jmp.S b/jmp.S
index b1449a9..8827098 100644
--- a/jmp.S
+++ b/jmp.S
@@ -238,3 +238,7 @@ DEFUN(jmp_restore)
#else
#error port me!
#endif
+
+/* This is needed so our assembly code doesn't cause
+ the program to require an executable stack! */
+.section .note.GNU-stack,"",@progbits

Cheers ...