about summary refs log tree commit diff
diff options
context:
space:
mode:
authorStefan Liebler <stli@linux.ibm.com>2020-01-13 11:06:41 +0100
committerStefan Liebler <stli@linux.ibm.com>2020-01-13 11:06:41 +0100
commit3c8639b02efcbc5e8087b0f9bc63da8aeb203549 (patch)
treea9244be977ebb0a529eaf0ffdff9a3ecec5f4c3d
parentae793cc20d80eec6ccffc31612b635b8c1b82e89 (diff)
downloadglibc-3c8639b02efcbc5e8087b0f9bc63da8aeb203549.tar.gz
glibc-3c8639b02efcbc5e8087b0f9bc63da8aeb203549.tar.xz
glibc-3c8639b02efcbc5e8087b0f9bc63da8aeb203549.zip
Fix "elf: Add tst-ldconfig-ld_so_conf-update test" on 32bit.
This new test was introduced with recent commit
591236f1a33f11cc65ccf009d997071ba853e186.
If run on 32bit, it fails while renaming tst-ldconfig-ld-mod.so as there is no
/usr/lib64 directory. This patch is constructing the file name with help of
support_libdir_prefix.

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
-rw-r--r--elf/tst-ldconfig-ld_so_conf-update.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/elf/tst-ldconfig-ld_so_conf-update.c b/elf/tst-ldconfig-ld_so_conf-update.c
index 54fae5c829..ff2ee217d9 100644
--- a/elf/tst-ldconfig-ld_so_conf-update.c
+++ b/elf/tst-ldconfig-ld_so_conf-update.c
@@ -71,9 +71,11 @@ do_test (void)
   /* Rename the DSO to start with "lib" because there's an undocumented
      filter in ldconfig where it ignores any file that doesn't start with
      "lib" (for regular shared libraries) or "ld-" (for ld-linux-*).  */
-  if (rename ("/usr/lib64/tst-ldconfig-ld-mod.so",
-              "/tmp/tst-ldconfig/libldconfig-ld-mod.so"))
+  char *mod_src_path = xasprintf ("%s/tst-ldconfig-ld-mod.so",
+				  support_libdir_prefix);
+  if (rename (mod_src_path, "/tmp/tst-ldconfig/libldconfig-ld-mod.so"))
     FAIL_EXIT1 ("Renaming/moving the DSO failed: %m");
+  free (mod_src_path);
 
 
   /* Open the DSO.  We expect this to fail - tst-ldconfig directory