From patchwork Fri May 29 00:21:32 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roland McGrath X-Patchwork-Id: 6976 Received: (qmail 104730 invoked by alias); 29 May 2015 00:21:56 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 104719 invoked by uid 89); 29 May 2015 00:21:56 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mail-ig0-f180.google.com Received: from mail-ig0-f180.google.com (HELO mail-ig0-f180.google.com) (209.85.213.180) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Fri, 29 May 2015 00:21:55 +0000 Received: by igbpi8 with SMTP id pi8so2201656igb.1 for ; Thu, 28 May 2015 17:21:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to :content-type; bh=3WgvQi+LLRRyOvY7UZ957G9bZV1rD9pyANgdlT4is4c=; b=KkUsDphQMT+MysSXoERqrSAFgIHxN0v5GRiz4EIjEN6jV1eIRyDcy9DKI7pHAQHyww iXX801p0ZIfD7zo71fvvTpm9MFR9147oS+NtY1tyweHFfF4Msr6gFtj7QPSWhKjjHCQn m1AesD4Ru7jdYoaOhv421QQ7dueSEkGxQb/OKVKHv841MJ7O2U7UHfyGk9u928wTsFmn CXbLsMG4lQeXM+bMGXWwzZ3ihWmuUUtOYU1WYLABWwiAjxhSW9bV/7NFh0oZy0U2rhuU Pj6609uzq+3DdmL0bHoXMbCRVZexyIRV/uKeV46iJQiNZVnOAL2Kb3RNgzPM1dbMrv+y yt9w== X-Gm-Message-State: ALoCoQloonGl0hgcd3nNHfMpazitaSMifkmdFwtz2x+Pf2kPPmYuHy26XS7cTdLHgdCBUqGUvxyu X-Received: by 10.42.110.66 with SMTP id o2mr12655709icp.54.1432858912963; Thu, 28 May 2015 17:21:52 -0700 (PDT) MIME-Version: 1.0 Received: by 10.64.105.197 with HTTP; Thu, 28 May 2015 17:21:32 -0700 (PDT) From: Roland McGrath Date: Thu, 28 May 2015 17:21:32 -0700 Message-ID: Subject: [PATCH users/roland/osabi-assert] Do not crash on unrecognized GNU .note.ABI-tag values To: GDB Diagnosis of unexpected input (in this case, in an executable file) should not crash as if it were a bug in GDB. This one is especially harmless, since the "osabi" has so little effect on anything. OK for trunk and 7.9 branch? Thanks, Roland gdb/ 2015-05-28 Roland McGrath * osabi.c (generic_elf_osabi_sniff_abi_tag_sections): Use warning rather than internal_error for an unrecognized value. } diff --git a/gdb/osabi.c b/gdb/osabi.c index 9d90c55..abf4bd4 100644 --- a/gdb/osabi.c +++ b/gdb/osabi.c @@ -493,10 +493,9 @@ generic_elf_osabi_sniff_abi_tag_sections (bfd *abfd, asection *sect, void *obj) break; default: - internal_error (__FILE__, __LINE__, - _("generic_elf_osabi_sniff_abi_tag_sections: " - "unknown OS number %d"), - abi_tag); + warning ("GNU ABI tag value %u unrecognized.\n", abi_tag); + *osabi = GDB_OSABI_UNKNOWN; + break; } return;