vppinfra: Fix a bug related to path_search
[vpp.git] / src / vppinfra / elf_clib.c
index 2bc05e1..d2865f8 100644 (file)
@@ -94,7 +94,7 @@ path_search (char *file)
 
   result = 0;
   if (i < vec_len (ps.path))
-    result = (char *) format (0, "%s/%s%c", ps.path[i], file);
+    result = (char *) format (0, "%s/%s%c", ps.path[i], file, 0);
 
   path_search_free (&ps);
 
@@ -243,7 +243,13 @@ add_section (struct dl_phdr_info *info, size_t size, void *opaque)
 
   error = clib_elf_parse_file (cem, name, addr);
   if (error)
-    clib_error_report (error);
+    {
+      /* Don't complain about 'linux-vdso.so.1' */
+      if (!is_main && name[0] != '/' && error->code == ENOENT)
+       clib_error_free (error);
+      else
+       clib_error_report (error);
+    }
 
   if (is_main && name != cem->exec_path)
     vec_free (name);
@@ -253,7 +259,7 @@ add_section (struct dl_phdr_info *info, size_t size, void *opaque)
 
 static clib_elf_main_t clib_elf_main;
 
-void
+__clib_export void
 clib_elf_main_init (char *exec_path)
 {
   clib_elf_main_t *cem = &clib_elf_main;
@@ -345,7 +351,7 @@ format_clib_elf_symbol (u8 * s, va_list * args)
     }
 }
 
-u8 *
+__clib_export u8 *
 format_clib_elf_symbol_with_address (u8 * s, va_list * args)
 {
   uword address = va_arg (*args, uword);