Date: Wed, 10 Apr 2002 14:53:14 +0900 (JST) From: Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> To: FreeBSD-gnats-submit@FreeBSD.org Subject: kern/36952: ldd comand of linux does not work Message-ID: <200204100553.g3A5rEC02288@smr01.gssm.otsuka.tsukuba.ac.jp>
next in thread | raw e-mail | index | archive | help
>Number: 36952 >Category: kern >Synopsis: ldd comand of linux does not work >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Apr 09 23:00:01 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Atsuo Ohki >Release: FreeBSD 4.5-RELEASE i386 >Organization: gssm, University of Tsukuba, Tokyo >Environment: System: FreeBSD smr01 4.5-RELEASE FreeBSD 4.5-RELEASE #0: Wed Feb 27 19:18:56 JST 2002 ohki@smr01:/usr/src/sys/compile/gssm i386 >Description: ldd command of linux does not work. >How-To-Repeat: /compat/linux/usr/bin/ldd /compat/linux/bin/uname >Fix: --- sys/kern/imgact_elf.c-ORIG Mon Dec 17 03:26:16 2001 +++ sys/kern/imgact_elf.c Wed Feb 27 18:46:49 2002 @@ -469,10 +469,17 @@ const char *interp = NULL; Elf_Brandinfo *brand_info; char *path; + int fallback_elf_brand_val = fallback_elf_brand; /* * Do we have a valid ELF header ? */ + if (bcmp("Linux ", imgp->proc->p_sysent->sv_name, 6) == 0) { + if (elf_check_header(hdr) != 0 || + (hdr->e_type != ET_EXEC && hdr->e_type != ET_DYN)) + return -1; + fallback_elf_brand_val = ELFOSABI_LINUX; + } else if (elf_check_header(hdr) != 0 || hdr->e_type != ET_EXEC) return -1; @@ -616,7 +623,7 @@ for (i = 0; i < MAX_BRANDS; i++) { Elf_Brandinfo *bi = elf_brand_list[i]; - if (bi != NULL && fallback_elf_brand == bi->brand) { + if (bi != NULL && fallback_elf_brand_val == bi->brand) { brand_info = bi; break; } >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200204100553.g3A5rEC02288>