summaryrefslogtreecommitdiffstats
path: root/support
diff options
context:
space:
mode:
authorLuca Ceresoli <luca@lucaceresoli.net>2017-05-16 22:45:30 +0200
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>2017-05-17 21:56:38 +0200
commitee72dbe576e0c8e11a0bd61028950b2f8de29642 (patch)
tree21050009aedb921d9bc8a063cae07696dc1a37e4 /support
parent52258901eccb72eeafab61f855f4b8ce34bf4159 (diff)
downloadbuildroot-ee72dbe576e0c8e11a0bd61028950b2f8de29642.tar.gz
buildroot-ee72dbe576e0c8e11a0bd61028950b2f8de29642.zip
support/testing: document get_elf_prog_interpreter
Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'support')
-rw-r--r--support/testing/infra/__init__.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/support/testing/infra/__init__.py b/support/testing/infra/__init__.py
index c3f645cf99..b5634f6f64 100644
--- a/support/testing/infra/__init__.py
+++ b/support/testing/infra/__init__.py
@@ -77,6 +77,16 @@ def get_file_arch(builddir, prefix, fpath):
return get_elf_arch_tag(builddir, prefix, fpath, "Tag_CPU_arch")
def get_elf_prog_interpreter(builddir, prefix, fpath):
+ """
+ Runs the cross readelf on 'fpath' to extract the program interpreter
+ name and returns it.
+ Example:
+ >>> get_elf_prog_interpreter('br-tests/TestExternalToolchainLinaroArm',
+ 'arm-linux-gnueabihf',
+ 'bin/busybox')
+ /lib/ld-linux-armhf.so.3
+ >>>
+ """
cmd = ["host/usr/bin/{}-readelf".format(prefix),
"-l", os.path.join("target", fpath)]
out = subprocess.check_output(cmd, cwd=builddir, env={"LANG": "C"})
OpenPOWER on IntegriCloud