All of lore.kernel.org
 help / color / mirror / Atom feed
* [prelink-cross][PATCH 1/1] debug-for-missing-loader-and-libc
@ 2015-04-06  8:29 Maninder Singh
  0 siblings, 0 replies; 3+ messages in thread
From: Maninder Singh @ 2015-04-06  8:29 UTC (permalink / raw)
  To: mark.hatle@windriver.com
  Cc: v.narang@samsung.com, yocto@yoctoproject.org, AJEET YADAV

Hi,

prelink gives below error message for failure dependency:
./prelink: /test_binary: Could not find one of the dependencies

This provides name of dependent library which is missing like below:
./prelink: /test_binary: Could not find one of the dependencies:
./prelink-rtld: error while loading shared libraries: libB.so: cannot open shared object file: No such file or directory
where libB.so is missing dependecy

Signed-off-by: Maninder Singh <maninder1.s@samsung.com>
Signed-off-by: Vaneet Narang <v.narang@samsung.com>
Reviewed-by: Ajeet Yadav <ajeet.v@samsung.com>
Reviewed-by: Geon-ho Kim <gh007.kim@samsung.com>
---
 src/gather.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/gather.c b/src/gather.c
index 5ccd243..4a3f428 100644
--- a/src/gather.c
+++ b/src/gather.c
@@ -240,8 +240,8 @@ gather_deps (DSO *dso, struct prelink_entry *ent)
          if (q != NULL)
            {
              error (0, 0,
-                "%s: Could not find one of the dependencies",
-                ent->filename);
+                "%s: Could not find one of the dependencies:\n%s",
+                ent->filename, line);
              goto error_out;
            }
        }
--


Thanks 
Maninder Singh

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [prelink-cross] [PATCH 1/1] debug-for-missing-loader-and-libc
@ 2015-04-06  8:37 Maninder Singh
  2015-04-06 15:55 ` Mark Hatle
  0 siblings, 1 reply; 3+ messages in thread
From: Maninder Singh @ 2015-04-06  8:37 UTC (permalink / raw)
  To: mark.hatle@windriver.com
  Cc: v.narang@samsung.com, yocto@yoctoproject.org, AJEET YADAV

Hi,

During cross prelink if we miss out ld-linux.so.* or libc.so.* It prints below info:
./prelink: /test_binary: Could not parse `prelink-rtld: dl-version.c:219: rtld_check_map_versions:
 Assertion `needed != ((void *)0)' failed.'

And thus we miss actual cause for this failure,  by this patch we will know failure reason.
./prelink: /test_binary: Could not parse `./prelink-rtld: error while loading shared libraries: ld-linux.so.3'
(In this case ld-linux.so.3 was missing)

Signed-off-by: Maninder Singh <maninder1.s@samsung.com>
Signed-off-by: Vaneet Narang <v.narang@samsung.com>
Reviewed-by: Ajeet Yadav <ajeet.v@samsung.com>
Reviewed-by: Geon-ho Kim <gh007.kim@samsung.com>
---
 src/rtld/dl-version.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/src/rtld/dl-version.c b/src/rtld/dl-version.c
index e4040a6..eb62943 100644
--- a/src/rtld/dl-version.c
+++ b/src/rtld/dl-version.c
@@ -216,6 +216,12 @@ _dl_check_map_versions (struct ldlibs_link_map *map, int verbose, int trace_mode
      /* If NEEDED is NULL this means a dependency was not found
         and no stub entry was created.  This should never happen.  */
+     if(needed == NULL)
+       {
+         _dl_signal_error (errval, NULL, NULL, strtab + ent->vn_file);
+         printf("error while loading shared libraries: %s", strtab + ent->vn_file);
+         exit(0);
+       }
      assert (needed != NULL);
      /* Make sure this is no stub we created because of a missing
--
1.7.1

And also if it is ok we can remove this one --- assert (needed != NULL); 
because we are using exit(0) for (needed==NULL) 

Thanks,
Maninder Singh

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [prelink-cross] [PATCH 1/1] debug-for-missing-loader-and-libc
  2015-04-06  8:37 [prelink-cross] [PATCH 1/1] debug-for-missing-loader-and-libc Maninder Singh
@ 2015-04-06 15:55 ` Mark Hatle
  0 siblings, 0 replies; 3+ messages in thread
From: Mark Hatle @ 2015-04-06 15:55 UTC (permalink / raw)
  To: maninder1.s; +Cc: v.narang@samsung.com, yocto@yoctoproject.org, AJEET YADAV

On 4/6/15 3:37 AM, Maninder Singh wrote:
> Hi,
> 
> During cross prelink if we miss out ld-linux.so.* or libc.so.* It prints below info:
> ./prelink: /test_binary: Could not parse `prelink-rtld: dl-version.c:219: rtld_check_map_versions:
>  Assertion `needed != ((void *)0)' failed.'
> 
> And thus we miss actual cause for this failure,  by this patch we will know failure reason.
> ./prelink: /test_binary: Could not parse `./prelink-rtld: error while loading shared libraries: ld-linux.so.3'
> (In this case ld-linux.so.3 was missing)
> 
> Signed-off-by: Maninder Singh <maninder1.s@samsung.com>
> Signed-off-by: Vaneet Narang <v.narang@samsung.com>
> Reviewed-by: Ajeet Yadav <ajeet.v@samsung.com>
> Reviewed-by: Geon-ho Kim <gh007.kim@samsung.com>
> ---
>  src/rtld/dl-version.c |    6 ++++++
>  1 files changed, 6 insertions(+), 0 deletions(-)
> diff --git a/src/rtld/dl-version.c b/src/rtld/dl-version.c
> index e4040a6..eb62943 100644
> --- a/src/rtld/dl-version.c
> +++ b/src/rtld/dl-version.c
> @@ -216,6 +216,12 @@ _dl_check_map_versions (struct ldlibs_link_map *map, int verbose, int trace_mode
>       /* If NEEDED is NULL this means a dependency was not found
>          and no stub entry was created.  This should never happen.  */
> +     if(needed == NULL)
> +       {
> +         _dl_signal_error (errval, NULL, NULL, strtab + ent->vn_file);
> +         printf("error while loading shared libraries: %s", strtab + ent->vn_file);
> +         exit(0);

I'm likely to change this to an exit 1.  As I want to make sure that any
failures have a non 0 return code.

I believe the assert is in the original rtld code, but I'll check that and
remove it if it's something I added.

--Mark

> +       }
>       assert (needed != NULL);
>       /* Make sure this is no stub we created because of a missing
> --
> 1.7.1
> 
> And also if it is ok we can remove this one --- assert (needed != NULL); 
> because we are using exit(0) for (needed==NULL) 
> 
> Thanks,
> Maninder Singh
> 



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-04-06 15:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-06  8:37 [prelink-cross] [PATCH 1/1] debug-for-missing-loader-and-libc Maninder Singh
2015-04-06 15:55 ` Mark Hatle
  -- strict thread matches above, loose matches on Subject: below --
2015-04-06  8:29 [prelink-cross][PATCH " Maninder Singh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.