[yocto] [prelink-cross] [PATCH 1/1] debug-for-missing-loader-and-libc
Mark Hatle
mark.hatle at windriver.com
Mon Apr 6 08:55:30 PDT 2015
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 at samsung.com>
> Signed-off-by: Vaneet Narang <v.narang at samsung.com>
> Reviewed-by: Ajeet Yadav <ajeet.v at samsung.com>
> Reviewed-by: Geon-ho Kim <gh007.kim at 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
>
More information about the yocto
mailing list