summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2013-08-20 22:08:25 +0200
committerAndy Wingo <wingo@pobox.com>2013-08-20 22:08:25 +0200
commitc0ab19b92d2119bca74dbb6b37e423b4b25e3615 (patch)
tree83a02afd7e01c84da21e705fa8112d987c0140c2
parent904e99b71600fad00b69b7b026dc7f852d88b1b6 (diff)
downloadguile-c0ab19b92d2119bca74dbb6b37e423b4b25e3615.tar.gz
assembler: give proper permissions to .data section
* module/system/vm/assembler.scm (link-data): Give stringbufs the "shared" flag already, so we don't attempt to set it at runtime. Give .data sections the SHF_WRITE flag.
-rw-r--r--module/system/vm/assembler.scm14
1 files changed, 11 insertions, 3 deletions
diff --git a/module/system/vm/assembler.scm b/module/system/vm/assembler.scm
index 2c46c3b69..b2d917d90 100644
--- a/module/system/vm/assembler.scm
+++ b/module/system/vm/assembler.scm
@@ -801,8 +801,13 @@ should be .data or .rodata), and return the resulting linker object.
(modulo (- alignment (modulo address alignment)) alignment)))
(define tc7-vector 13)
- (define tc7-narrow-stringbuf 39)
- (define tc7-wide-stringbuf (+ 39 #x400))
+ (define stringbuf-shared-flag #x100)
+ (define stringbuf-wide-flag #x400)
+ (define tc7-stringbuf 39)
+ (define tc7-narrow-stringbuf
+ (+ tc7-stringbuf stringbuf-shared-flag))
+ (define tc7-wide-stringbuf
+ (+ tc7-stringbuf stringbuf-shared-flag stringbuf-wide-flag))
(define tc7-ro-string (+ 21 #x200))
(define tc7-rtl-program 69)
@@ -941,7 +946,10 @@ should be .data or .rodata), and return the resulting linker object.
(lp (1+ i)
(align (+ (byte-length obj) pos) 8)
(cons (make-linker-symbol obj-label pos) labels)))
- (make-object asm name buf '() labels))))))))
+ (make-object asm name buf '() labels
+ #:flags (match name
+ ('.data (logior SHF_ALLOC SHF_WRITE))
+ ('.rodata SHF_ALLOC))))))))))
(define (link-constants asm)
"Link sections to hold constants needed by the program text emitted