mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-17 09:10:22 +02:00
linker string tables are stateful objects
* module/system/vm/linker.scm (make-string-table): Rework to be a stateful object instead of a function object. Works better in this case. Adapt users. (string-table-intern!): Rename from string-table-intern, and just return the index of the string. (link-string-table!): Rename from link-string-table, and set a flag to prevent interning strings after linking, as that's not going to work well. * module/language/objcode/elf.scm (bytecode->elf): Adapt.
This commit is contained in:
parent
90a7976eb8
commit
f5473fbaaf
2 changed files with 44 additions and 36 deletions
|
@ -36,11 +36,7 @@
|
|||
(define (bytecode->elf bv)
|
||||
(let ((string-table (make-string-table)))
|
||||
(define (intern-string! string)
|
||||
(call-with-values
|
||||
(lambda () (string-table-intern string-table string))
|
||||
(lambda (table idx)
|
||||
(set! string-table table)
|
||||
idx)))
|
||||
(string-table-intern! string-table string))
|
||||
(define (make-object index name bv relocs . kwargs)
|
||||
(let ((name-idx (intern-string! (symbol->string name))))
|
||||
(make-linker-object (apply make-elf-section
|
||||
|
@ -79,7 +75,7 @@
|
|||
#:type SHT_DYNAMIC #:flags SHF_ALLOC))))
|
||||
(define (make-string-table index)
|
||||
(intern-string! ".shstrtab")
|
||||
(make-object index '.shstrtab (link-string-table string-table) '()
|
||||
(make-object index '.shstrtab (link-string-table! string-table) '()
|
||||
#:type SHT_STRTAB #:flags 0))
|
||||
(let* ((word-size (target-word-size))
|
||||
(endianness (target-endianness))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue