aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2019-05-13 13:13:46 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2019-05-14 11:04:41 -0300
commitda2b83ef6ba6f4c974664f69e715cc85b9173938 (patch)
tree55d5fc64f44ad76bd62d7b98ba879c7e7b2896fb
parentc7ac9caaae6f8d02d4e0c7618d4991324a084c66 (diff)
downloadglibc-da2b83ef6ba6f4c974664f69e715cc85b9173938.tar.gz
glibc-da2b83ef6ba6f4c974664f69e715cc85b9173938.tar.xz
glibc-da2b83ef6ba6f4c974664f69e715cc85b9173938.zip
elf: Fix tst-pldd for non-default --prefix and/or --bindir (BZ#24544)
Use a new libsupport support_bindir_prefix instead of a hardcoded /usr/bin to create the pldd path on container directory. Checked on x86_64-linux-gnu with default and non-default --prefix and --bindir paths, as well with --enable-hardcoded-path-in-tests. [BZ #24544] * elf/tst-pldd.c (do_test): Use support_bindir_prefix instead of pre-defined value. Reviewed-by: DJ Delorie <dj@redhat.com>
-rw-r--r--ChangeLog4
-rw-r--r--elf/tst-pldd.c6
2 files changed, 9 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 9a4c89d42f5..7f2ed939a7b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
2019-05-14 Adhemerval Zanella <adhemerval.zanella@linaro.org>
+ [BZ #24544]
+ * elf/tst-pldd.c (do_test): Use support_bindir_prefix instead of
+ pre-defined value.
+
* support/Makefile (CFLAGS-support_paths.c): Add -DBINDIR_PATH.
* support/support.h (support_bindir_prefix): New variable.
* support/support_paths.c [BINDIR_PATH] (support_bindir_prefix):
diff --git a/elf/tst-pldd.c b/elf/tst-pldd.c
index 2a9f58936f0..6b7c94a1c09 100644
--- a/elf/tst-pldd.c
+++ b/elf/tst-pldd.c
@@ -18,6 +18,7 @@
#include <stdio.h>
#include <string.h>
+#include <stdlib.h>
#include <unistd.h>
#include <stdint.h>
#include <stdbool.h>
@@ -28,6 +29,7 @@
#include <support/subprocess.h>
#include <support/capture_subprocess.h>
#include <support/check.h>
+#include <support/support.h>
static void
target_process (void *arg)
@@ -60,12 +62,14 @@ do_test (void)
char pid[3 * sizeof (uint32_t) + 1];
snprintf (pid, array_length (pid), "%d", target.pid);
- const char prog[] = "/usr/bin/pldd";
+ char *prog = xasprintf ("%s/pldd", support_bindir_prefix);
pldd = support_capture_subprogram (prog,
(char *const []) { (char *) prog, pid, NULL });
support_capture_subprocess_check (&pldd, "pldd", 0, sc_allow_stdout);
+
+ free (prog);
}
/* Check 'pldd' output. The test is expected to be linked against only