diff --git a/guix/build/gremlin.scm b/guix/build/gremlin.scm index 2a74d51dd9..8a38dde1eb 100644 --- a/guix/build/gremlin.scm +++ b/guix/build/gremlin.scm @@ -250,7 +250,11 @@ (define (file-dynamic-info file) info." (call-with-input-file file (lambda (port) - (elf-dynamic-info (parse-elf (get-bytevector-all port)))))) + (elf-dynamic-info (parse-elf + ;; Read at most 10 MiB in memory, which should be + ;; enough to get the PT_DYNAMIC segment. + ;; TODO: mmap the whole file instead. + (get-bytevector-n port (* 10 (expt 2 20)))))))) (define (file-runpath file) "Return the DT_RUNPATH dynamic entry of FILE as a list of strings, or #f if