(use-modules (system vm elf) (rnrs io ports) (ice-9 match)) (define go (search-path %load-compiled-path "gnu/packages/python-xyz.go")) (define elf (parse-elf (call-with-input-file go get-bytevector-all))) (define (elf-section-name-as-string elf section) (let ((off (elf-section-offset (list-ref (elf-sections elf) (elf-shstrndx elf))))) (string-table-ref (elf-bytes elf) (+ off (elf-section-name section))))) (sort (map (lambda (section) (cons (elf-section-name-as-string elf section) (elf-section-size section))) (elf-sections elf)) (match-lambda* (((name1 . size1) (name2 . size2)) (> size1 size2))))