From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 108356 invoked by alias); 29 Jun 2018 22:19:13 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 108039 invoked by uid 89); 29 Jun 2018 22:19:13 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=H*f:sk:83zhzeo, UD:gdb, invoking, H*i:sk:87bmbup X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 29 Jun 2018 22:19:11 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 7B12D56134; Fri, 29 Jun 2018 18:19:10 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id uWNCMaVbnbMb; Fri, 29 Jun 2018 18:19:10 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 4837F56019; Fri, 29 Jun 2018 18:19:10 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 6992E87940; Fri, 29 Jun 2018 15:19:08 -0700 (PDT) Date: Fri, 29 Jun 2018 22:19:00 -0000 From: Joel Brobecker To: Tom Tromey Cc: Eli Zaretskii , gdb-patches@sourceware.org Subject: Re: [RFA] Add --enable-codesign to gdb's configure Message-ID: <20180629221908.GF2511@adacore.com> References: <20180628163745.12716-1-tom@tromey.com> <83zhzeoja4.fsf@gnu.org> <20180628192051.GD2511@adacore.com> <87bmbupqd4.fsf@tromey.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87bmbupqd4.fsf@tromey.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-SW-Source: 2018-06/txt/msg00743.txt.bz2 > I'm not sure there's a way for gdb to know whether it's been signed, I > guess other than invoking codesign itself. I'm going to check this in, > but if it still needs the change, let me know and I will see if I can > implement it. I just gave it a try, and basically, you do it using the -d option of codesign. I also added -v, to get a bit more information about the signature -- otherwise, you either get "not signed", or the name of the executable. Here is an example of both situations: | $ codesign -dv simple_main | simple_main: code object is not signed at all | $ codesign -dv gdb | Executable=/[...]/gdb | Identifier=org.gnu.gdb | Format=Mach-O thin (x86_64) | CodeDirectory v=20100 size=82012 flags=0x0(none) hashes=2559+2 location=embedded | Signature size=1572 | Signed Time=23 Feb 2017 09:29:17 | [...] -- Joel