guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

02/05: linux-modules: Adjust 'section-contents' procedure.


From: Ludovic Courtès
Subject: 02/05: linux-modules: Adjust 'section-contents' procedure.
Date: Tue, 21 Aug 2018 17:30:00 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit f43d2dcd80c201600fb161f0f3076daaccc46a2c
Author: Ludovic Courtès <address@hidden>
Date:   Tue Aug 21 14:38:15 2018 +0200

    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.
---
 gnu/build/linux-modules.scm | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/gnu/build/linux-modules.scm b/gnu/build/linux-modules.scm
index 9c87615..ae141b6 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)))))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]