From owner-svn-src-head@FreeBSD.ORG Wed Mar 18 13:59:05 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 935AC840; Wed, 18 Mar 2015 13:59:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7F239E1E; Wed, 18 Mar 2015 13:59:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2IDx5W9086218; Wed, 18 Mar 2015 13:59:05 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2IDx5MO086217; Wed, 18 Mar 2015 13:59:05 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201503181359.t2IDx5MO086217@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 18 Mar 2015 13:59:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280220 - head/usr.bin/ldd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Mar 2015 13:59:05 -0000 Author: andrew Date: Wed Mar 18 13:59:04 2015 New Revision: 280220 URL: https://svnweb.freebsd.org/changeset/base/280220 Log: Allowus to exclude a.out support from ldd and use it with arm64 as it won't support the a.out format. Reviewed by: emaste Sponsored by: The FreeBSD Foundation Modified: head/usr.bin/ldd/ldd.c Modified: head/usr.bin/ldd/ldd.c ============================================================================== --- head/usr.bin/ldd/ldd.c Wed Mar 18 13:54:53 2015 (r280219) +++ head/usr.bin/ldd/ldd.c Wed Mar 18 13:59:04 2015 (r280220) @@ -37,7 +37,6 @@ __FBSDID("$FreeBSD$"); #include -#include #include #include #include @@ -49,6 +48,12 @@ __FBSDID("$FreeBSD$"); #include "extern.h" +/* We don't support a.out executables on arm64 */ +#ifndef __aarch64__ +#include +#define AOUT_SUPPORTED +#endif + /* * 32-bit ELF data structures can only be used if the system header[s] declare * them. There is no official macro for determining whether they are declared, @@ -274,7 +279,9 @@ static int is_executable(const char *fname, int fd, int *is_shlib, int *type) { union { +#ifdef AOUT_SUPPORTED struct exec aout; +#endif #if __ELF_WORD_SIZE > 32 && defined(ELF32_SUPPORTED) Elf32_Ehdr elf32; #endif @@ -290,6 +297,7 @@ is_executable(const char *fname, int fd, return (0); } +#ifdef AOUT_SUPPORTED if ((size_t)n >= sizeof(hdr.aout) && !N_BADMAG(hdr.aout)) { /* a.out file */ if ((N_GETFLAG(hdr.aout) & EX_DPMASK) != EX_DYNAMIC @@ -303,6 +311,7 @@ is_executable(const char *fname, int fd, *type = TYPE_AOUT; return (1); } +#endif #if __ELF_WORD_SIZE > 32 && defined(ELF32_SUPPORTED) if ((size_t)n >= sizeof(hdr.elf32) && IS_ELF(hdr.elf32) &&