1
Fork 0
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:
Andy Wingo 2013-12-10 20:03:59 +01:00
parent 18e1113513
commit 812c83d48b

View file

@ -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) (write-elf-section-header bv offset endianness word-size section)
(if (= (elf-section-type section) SHT_NULL) (if (= (elf-section-type section) SHT_NULL)
relocs relocs
(cons* (make-linker-reloc (let ((relocs
reloc-kind (cons (make-linker-reloc
(+ offset (elf-section-header-addr-offset word-size)) reloc-kind
0 (+ offset
section-label) (elf-section-header-offset-offset word-size))
(make-linker-reloc 0
reloc-kind section-label)
(+ offset (elf-section-header-offset-offset word-size)) relocs)))
0 (if (zero? (logand SHF_ALLOC (elf-section-flags section)))
section-label) relocs
relocs)))) (cons (make-linker-reloc
reloc-kind
(+ offset
(elf-section-header-addr-offset word-size))
0
section-label)
relocs))))))
(let ((relocs (fold-values (let ((relocs (fold-values
(lambda (object relocs) (lambda (object relocs)
(write-and-reloc (write-and-reloc