[uClibc] RE: [uClibc-cvs] CVS uClibc/utils
Peter Kjellerstedt
peter.kjellerstedt at axis.com
Tue Sep 28 08:33:38 UTC 2004
> -----Original Message-----
> From: uclibc-cvs-bounces at uclibc.org
> [mailto:uclibc-cvs-bounces at uclibc.org] On Behalf Of CVS User jocke
> Sent: 28 September 2004 09:29
> To: uclibc-cvs at uclibc.org
> Subject: [uClibc-cvs] CVS uClibc/utils
>
> Update of /var/cvs/uClibc/utils
> In directory nail:/tmp/cvs-serv30929
>
> Modified Files:
> ldd.c
> Log Message:
> Make ldd work for ET_DYN executables. From Peter Mazinger.
>
> --- /var/cvs/uClibc/utils/ldd.c 2004/03/18 11:17:14 1.13
> +++ /var/cvs/uClibc/utils/ldd.c 2004/09/28 07:29:13 1.14
> @@ -550,7 +550,7 @@
> fprintf(stderr, "%s: not a dynamic
> executable\n", filename);
> return -1;
> }
> - if (ehdr->e_type == ET_EXEC) {
> + if (ehdr->e_type == ET_EXEC || ehdr->e_type != ET_DYN) {
This looks a bit suspicious. The first part is redundant,
since the case where ehdr->e_type is ET_EXEC is already
covered by ehdr->e_type != ET_DYN. Should the second != be == ?
> if (statbuf.st_mode & S_ISUID)
> is_suid = 1;
> if ((statbuf.st_mode & (S_ISGID | S_IXGRP)) == (S_ISGID
| S_IXGRP))
> @@ -564,7 +564,7 @@
> interp = find_elf_interpreter(ehdr);
>
> #ifdef __LDSO_LDD_SUPPORT
> - if (interp && ehdr->e_type == ET_EXEC && ehdr->e_ident[EI_CLASS]
== ELFCLASSM &&
> + if (interp && (ehdr->e_type == ET_EXEC || ehdr->e_type ==
ET_DYN) && ehdr->e_ident[EI_CLASS] == ELFCLASSM &&
> ehdr->e_ident[EI_DATA] == ELFDATAM
> && ehdr->e_ident[EI_VERSION] == EV_CURRENT &&
MATCH_MACHINE(ehdr->e_machine))
> {
//Peter
More information about the uClibc
mailing list