mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-09 21:40:33 +02:00
Fix section table writing for non-loadable sections
* module/system/vm/linker.scm (add-elf-objects): Don't fill in the sh_addr field if the section is not loadable.
This commit is contained in:
parent
18e1113513
commit
812c83d48b
1 changed files with 17 additions and 11 deletions
|
@ -517,17 +517,23 @@ list of objects, augmented with objects for the special ELF sections."
|
|||
(write-elf-section-header bv offset endianness word-size section)
|
||||
(if (= (elf-section-type section) SHT_NULL)
|
||||
relocs
|
||||
(cons* (make-linker-reloc
|
||||
reloc-kind
|
||||
(+ offset (elf-section-header-addr-offset word-size))
|
||||
0
|
||||
section-label)
|
||||
(make-linker-reloc
|
||||
reloc-kind
|
||||
(+ offset (elf-section-header-offset-offset word-size))
|
||||
0
|
||||
section-label)
|
||||
relocs))))
|
||||
(let ((relocs
|
||||
(cons (make-linker-reloc
|
||||
reloc-kind
|
||||
(+ offset
|
||||
(elf-section-header-offset-offset word-size))
|
||||
0
|
||||
section-label)
|
||||
relocs)))
|
||||
(if (zero? (logand SHF_ALLOC (elf-section-flags section)))
|
||||
relocs
|
||||
(cons (make-linker-reloc
|
||||
reloc-kind
|
||||
(+ offset
|
||||
(elf-section-header-addr-offset word-size))
|
||||
0
|
||||
section-label)
|
||||
relocs))))))
|
||||
(let ((relocs (fold-values
|
||||
(lambda (object relocs)
|
||||
(write-and-reloc
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue