From patchwork Thu Feb 23 03:49:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Modra X-Patchwork-Id: 60776 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp102664wrd; Wed, 22 Feb 2023 19:50:31 -0800 (PST) X-Google-Smtp-Source: AK7set/0YLAsJnu6rAeMkWmh1SJnpZsAB1vVr8doqokRWt9J824giTHswuKvYI1vVHl7th8cHrZM X-Received: by 2002:a05:6402:1202:b0:4af:59fa:2a20 with SMTP id c2-20020a056402120200b004af59fa2a20mr5621984edw.15.1677124231607; Wed, 22 Feb 2023 19:50:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677124231; cv=none; d=google.com; s=arc-20160816; b=e5vefGLbsbrqrOP1rW3cudaVa+ZqTyI5+BSFa2dNh40m8qH6nSJir4NIUlzB8uWwwr 4xPSh76CqeF9oxNDbLdBD9EhfF0rjGhnA79AMvvaLMv235i7nv/E97ICztD2jUaciy7B vOlkMGQaI5EGfiOwSf+1eKoyb2jTfZUa1n80LpshBMQEtOZJie7MUbenP673AZD2pJqn 3T5lENuo/Hv9iMMqgOlaY8qY+rKk3cvFHi7Facb7cxSyisyk3IFhwSB91KQygD4JrBDz RA5g8Dar6/rwKtY6VcjsrIgHomH9N2gWGdvpmUTV+ZKzACWQl5xN0U25fH+D0vKJ6+4I 66Ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-disposition:mime-version:message-id:subject:to:date :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=Rq08HIOu2oueGHfJkIRXmCt5Lr9uxrB9YxT0py8oHaI=; b=x84FPCnslrsaSzqrtDIHLEbQ6AN9+57zQqq1EhDVAd4YsscWUKrSa0BXCpW8vKZOG+ 8Kk9u4S5DmNepzr+VETYDANrKUzboaeRSBJjGsfzgpnKew3hyDogMWEsb1xgyGQvN0Rm 0aozne6jpn6PYLqic/Xab5K0ELNuY2huDvyFCUR4G7n5FKX8o1j1dCgNLY8wrVfL3Cxq gmTJlbqLaRzR91AMWjNi3wBjAos1JkZxk69o0nFuahipgPOwDQ3NamIXD22Xck5BwHW3 b+IlzKnvToIHXWp1b+606Oi4w3qT3xCUgY5FSv91zx6Txa4fcl5X0PiTzW6MsDUI9YO7 YdvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=tWpogy2Z; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id n27-20020a056402515b00b004acc5bb3e0esi10705617edd.562.2023.02.22.19.50.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Feb 2023 19:50:31 -0800 (PST) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=tWpogy2Z; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 066473857C5A for ; Thu, 23 Feb 2023 03:50:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 066473857C5A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1677124212; bh=Rq08HIOu2oueGHfJkIRXmCt5Lr9uxrB9YxT0py8oHaI=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=tWpogy2ZglVstlcr51Rhi20dlnc1ivVZAgFwwsojHLcOzYd9OasTxlg1V7l63eVCm 8osrWrZ472Wfml4sy/WOjUrYlmbxWQSLWDEepDpxiymfSr0q0lbOseuVrPvzPQhCSc MWMa1GKqIf65Ad29USxUm/Z45cMFGmTwfdSm2D10= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by sourceware.org (Postfix) with ESMTPS id 16AEA385B516 for ; Thu, 23 Feb 2023 03:50:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 16AEA385B516 Received: by mail-pj1-x1033.google.com with SMTP id qi12-20020a17090b274c00b002341621377cso11087866pjb.2 for ; Wed, 22 Feb 2023 19:50:03 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-disposition:mime-version:message-id:subject:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Rq08HIOu2oueGHfJkIRXmCt5Lr9uxrB9YxT0py8oHaI=; b=lYsy5zGOYL2yLjRv8ui1vuB0nc3CrkOXkDge86n3O7gYQ1pr1WUVpUUmaFwg+YsJYi rg8C6uNzDzqxwuQdhjxN8hHnuoqoHX6vS2/pALCfIm0KlpoVYj2n6oSHPHBTjm/8erRT mKBWcjCgrxsWSX6/eUNhUOsgfeNKkti6BuGkblYyu9zPVo2TKJLp1mPHo+26bcgyceaq uXv4vJ0AqMnfCsKe5St9viu1Z+bZ4kR1fSSoYX+Pe+USKkyl43XJeWrH/p8jsJHMwU3a oURxo3fb4tHxRjkJT4fixKx308eec3QdzB9cEd/zmkOxXtH0FrA1lq23rs6OfNFWfMtB 1k2A== X-Gm-Message-State: AO0yUKVWkViZe1yk8aM/edDswEfxK8L+ZcqVQr5vjLNBk5xrkh3ZTC5M lX9zD5ZDE7WHS1qFTxRKE6UhgEmH1S0= X-Received: by 2002:a17:902:9a4b:b0:19c:bd10:3444 with SMTP id x11-20020a1709029a4b00b0019cbd103444mr707022plv.63.1677124202039; Wed, 22 Feb 2023 19:50:02 -0800 (PST) Received: from squeak.grove.modra.org (158.106.96.58.static.exetel.com.au. [58.96.106.158]) by smtp.gmail.com with ESMTPSA id b16-20020a170902b61000b0019602b2c00csm3861222pls.175.2023.02.22.19.50.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Feb 2023 19:50:01 -0800 (PST) Received: by squeak.grove.modra.org (Postfix, from userid 1000) id CCC791142D15; Thu, 23 Feb 2023 14:19:58 +1030 (ACDT) Date: Thu, 23 Feb 2023 14:19:58 +1030 To: binutils@sourceware.org Subject: ip2k: don't look at stab sections without relocs Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-3035.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Alan Modra via Binutils From: Alan Modra Reply-To: Alan Modra Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1758592217989078104?= X-GMAIL-MSGID: =?utf-8?q?1758592217989078104?= No need to read contents if we won't do anything. * elf32-ip2k.c (adjust_all_relocations): Skip stab sections without relocs. diff --git a/bfd/elf32-ip2k.c b/bfd/elf32-ip2k.c index cb1ab0e12e5..90104379096 100644 --- a/bfd/elf32-ip2k.c +++ b/bfd/elf32-ip2k.c @@ -623,7 +623,7 @@ adjust_all_relocations (bfd *abfd, /* Now fix the stab relocations. */ stab = bfd_get_section_by_name (abfd, ".stab"); - if (stab) + if (stab && stab->reloc_count != 0) { bfd_byte *stabcontents, *stabend, *stabp; bfd_size_type stab_size = stab->rawsize ? stab->rawsize : stab->size;