From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5234 invoked by alias); 4 Apr 2014 12:43:07 -0000 Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org Received: (qmail 5200 invoked by uid 89); 4 Apr 2014 12:43:06 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.0 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: smtp.eu.adacore.com Received: from mel.act-europe.fr (HELO smtp.eu.adacore.com) (194.98.77.210) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 04 Apr 2014 12:43:05 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 5B993272010C for ; Fri, 4 Apr 2014 14:43:03 +0200 (CEST) Received: from smtp.eu.adacore.com ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zFjVf1iydqUz for ; Fri, 4 Apr 2014 14:43:03 +0200 (CEST) Received: from ulanbator.act-europe.fr (ulanbator.act-europe.fr [10.10.1.67]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.eu.adacore.com (Postfix) with ESMTPSA id 3AB1D27200B6 for ; Fri, 4 Apr 2014 14:43:03 +0200 (CEST) From: Tristan Gingold Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Subject: [Mach-O]: Reject 64 bit targets when not configured for Message-Id: <6143B2E1-D48D-4F65-A5CB-D9CAA945B7F8@adacore.com> Date: Fri, 04 Apr 2014 12:43:00 -0000 To: "binutils@sourceware.org Development" Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) X-IsSubscribed: yes X-SW-Source: 2014-04/txt/msg00057.txt.bz2 Hello, the generic mach-o backend now rejects 64 bit mach-o files if bfd is not configured for 64 bit targets. That avoids crashes (the first one I encounter was in the disassembler). Committed on trunk. Tristan. bfd/ * mach-o.c (bfd_mach_o_header_p): Reject 64 bit target when not configured for. diff --git a/bfd/mach-o.c b/bfd/mach-o.c index 5203c0f..50173b9 100644 --- a/bfd/mach-o.c +++ b/bfd/mach-o.c @@ -4300,6 +4300,15 @@ bfd_mach_o_header_p (bfd *abfd, if (header.cputype !=3D cputype) goto wrong; } + else + { +#ifndef BFD64 + /* Do not recognize 64 architectures if not configured for 64bit tar= gets. + This could happen only for generic targets. */ + if (mach_o_wide_p (&header)) + goto wrong; +#endif + } =20 if (filetype) {