1
0
mirror of https://git.savannah.gnu.org/git/guix.git synced 2026-04-06 21:20:33 +02:00

gremlin: 'elf-dynamic-info' returns a file name rathern than a dynamic entry.

* guix/build/gremlin.scm (elf-dynamic-info): Return the dynamic entry
value, not the dynamic entry.
* tests/gremlin.scm ("elf-dynamic-info-soname"): New test.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
Dion Mendel
2021-04-22 10:32:35 +08:00
committed by Ludovic Courtès
parent a24562af52
commit 1010171280
2 changed files with 21 additions and 1 deletions

View File

@@ -160,4 +160,22 @@
(close-pipe pipe)
str)))))))
(unless c-compiler
(test-skip 1))
(test-equal "elf-dynamic-info-soname"
"libfoo.so.2"
(call-with-temporary-directory
(lambda (directory)
(with-directory-excursion directory
(call-with-output-file "t.c"
(lambda (port)
(display "// empty file" port)))
(invoke c-compiler "t.c"
"-shared" "-Wl,-soname,libfoo.so.2")
(let* ((dyninfo (elf-dynamic-info
(parse-elf (call-with-input-file "a.out"
get-bytevector-all))))
(soname (elf-dynamic-info-soname dyninfo)))
soname)))))
(test-end "gremlin")