linux-modules: Adjust 'section-contents' procedure.
* gnu/build/linux-modules.scm (section-contents): Honor SECTION as was intended. (modinfo-section-contents): Pass 'section-contents' a section, not a section name.
This commit is contained in:
parent
a81b59b1bf
commit
f43d2dcd80
|
@ -58,11 +58,10 @@
|
||||||
|
|
||||||
(define (section-contents elf section)
|
(define (section-contents elf section)
|
||||||
"Return the contents of SECTION in ELF as a bytevector."
|
"Return the contents of SECTION in ELF as a bytevector."
|
||||||
(let* ((modinfo (elf-section-by-name elf ".modinfo"))
|
(let ((contents (make-bytevector (elf-section-size section))))
|
||||||
(contents (make-bytevector (elf-section-size modinfo))))
|
(bytevector-copy! (elf-bytes elf) (elf-section-offset section)
|
||||||
(bytevector-copy! (elf-bytes elf) (elf-section-offset modinfo)
|
|
||||||
contents 0
|
contents 0
|
||||||
(elf-section-size modinfo))
|
(elf-section-size section))
|
||||||
contents))
|
contents))
|
||||||
|
|
||||||
(define %not-nul
|
(define %not-nul
|
||||||
|
@ -85,7 +84,8 @@ string list."
|
||||||
key/value pairs.."
|
key/value pairs.."
|
||||||
(let* ((bv (call-with-input-file file get-bytevector-all))
|
(let* ((bv (call-with-input-file file get-bytevector-all))
|
||||||
(elf (parse-elf bv))
|
(elf (parse-elf bv))
|
||||||
(modinfo (section-contents elf ".modinfo")))
|
(section (elf-section-by-name elf ".modinfo"))
|
||||||
|
(modinfo (section-contents elf section)))
|
||||||
(map key=value->pair
|
(map key=value->pair
|
||||||
(nul-separated-string->list (utf8->string modinfo)))))
|
(nul-separated-string->list (utf8->string modinfo)))))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue