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-24 15:28:03 +0200
commit8fa728892853c04f0e73572f31773f6bfb804440 (patch)
treeb3051a85a47486acdb140ff7826fec833a939b1f
parent72bb47ae4cc2f15f88173ff29b0b1011ac68279a (diff)
downloadguile-8fa728892853c04f0e73572f31773f6bfb804440.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