mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-20 11:40:18 +02:00
assembler: Separate effectful part of 'link-procprops'.
* module/system/vm/assembler.scm (link-procprops): Define 'write-procprops!' and use it.
This commit is contained in:
parent
c7f1522c6d
commit
dc0c4ccb1f
1 changed files with 26 additions and 14 deletions
|
@ -2744,20 +2744,32 @@ procedure with label @var{rw-init}. @var{rw-init} may be false. If
|
|||
(let* ((endianness (asm-endianness asm))
|
||||
(procprops (find-procprops))
|
||||
(bv (make-bytevector (* (length procprops) procprops-size) 0)))
|
||||
(let lp ((procprops procprops) (pos 0) (relocs '()))
|
||||
(match procprops
|
||||
(()
|
||||
(make-object asm '.guile.procprops
|
||||
bv
|
||||
relocs '()
|
||||
#:type SHT_PROGBITS #:flags 0))
|
||||
(((pc . props) . procprops)
|
||||
(bytevector-u32-set! bv pos pc endianness)
|
||||
(lp procprops
|
||||
(+ pos procprops-size)
|
||||
(cons (make-linker-reloc 'abs32/1 (+ pos 4) 0
|
||||
(intern-constant asm props))
|
||||
relocs)))))))
|
||||
(define (write-procprops! bv offset)
|
||||
(let lp ((procprops procprops) (pos offset))
|
||||
(match procprops
|
||||
(()
|
||||
#t)
|
||||
(((pc . props) . procprops)
|
||||
(bytevector-u32-set! bv pos pc endianness)
|
||||
(lp procprops (+ pos procprops-size))))))
|
||||
|
||||
(define relocs
|
||||
(let lp ((procprops procprops) (pos 0) (relocs '()))
|
||||
(match procprops
|
||||
(()
|
||||
relocs)
|
||||
(((pc . props) . procprops)
|
||||
(lp procprops
|
||||
(+ pos procprops-size)
|
||||
(cons (make-linker-reloc 'abs32/1 (+ pos 4) 0
|
||||
(intern-constant asm props))
|
||||
relocs))))))
|
||||
|
||||
(write-procprops! bv 0)
|
||||
(make-object asm '.guile.procprops
|
||||
bv
|
||||
relocs '()
|
||||
#:type SHT_PROGBITS #:flags 0)))
|
||||
|
||||
;;;
|
||||
;;; The DWARF .debug_info, .debug_abbrev, .debug_str, and .debug_loc
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue