summaryrefslogtreecommitdiff
path: root/gnu/build
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2018-08-21 14:38:15 +0200
committerLudovic Courtès <ludo@gnu.org>2018-08-21 23:27:08 +0200
commitf43d2dcd80c201600fb161f0f3076daaccc46a2c (patch)
tree5653ed64e99112d19b4ae2847db70389d8d856e9 /gnu/build
parenta81b59b1bf99255cf78d736c3d2aa28eb1e9bbdf (diff)
downloadpatches-f43d2dcd80c201600fb161f0f3076daaccc46a2c.tar
patches-f43d2dcd80c201600fb161f0f3076daaccc46a2c.tar.gz
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.
Diffstat (limited to 'gnu/build')
-rw-r--r--gnu/build/linux-modules.scm10
1 files changed, 5 insertions, 5 deletions
diff --git a/gnu/build/linux-modules.scm b/gnu/build/linux-modules.scm
index 9c8761527a..ae141b6f54 100644
--- a/gnu/build/linux-modules.scm
+++ b/gnu/build/linux-modules.scm
@@ -58,11 +58,10 @@
(define (section-contents elf section)
"Return the contents of SECTION in ELF as a bytevector."
- (let* ((modinfo (elf-section-by-name elf ".modinfo"))
- (contents (make-bytevector (elf-section-size modinfo))))
- (bytevector-copy! (elf-bytes elf) (elf-section-offset modinfo)
+ (let ((contents (make-bytevector (elf-section-size section))))
+ (bytevector-copy! (elf-bytes elf) (elf-section-offset section)
contents 0
- (elf-section-size modinfo))
+ (elf-section-size section))
contents))
(define %not-nul
@@ -85,7 +84,8 @@ string list."
key/value pairs.."
(let* ((bv (call-with-input-file file get-bytevector-all))
(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
(nul-separated-string->list (utf8->string modinfo)))))