From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) by sourceware.org (Postfix) with ESMTPS id B930E3858D20 for ; Thu, 26 Jan 2023 21:51:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B930E3858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pj1-x1032.google.com with SMTP id e10-20020a17090a630a00b0022bedd66e6dso6688008pjj.1 for ; Thu, 26 Jan 2023 13:51:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-disposition:mime-version:message-id:subject:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=Yl9OH48SZdYpyfFkrzyzOlAuQm2dup9GWXc/KgwK0Y8=; b=d8ea9Nv6iY26/xgTiHR8c7bILodFkliWSayCc4v2Xz7QYEjF1IqA7iNIHlNdAMSlDf wWu5sI3001fH5EOalPp1FBa823xBxaUEuXRCPAjq9Q5dpr88eKMsbz9Rng5LFmt7MXwK ZJ9qCGgvF7ouiglJnoqyB3wIiyYCnr+UJ+72F3SvhHp1NAT9D3VBV91W8pJFrRxDaSml P6y5wagAXgdLkPaGsRusfRZviKCf0N3JST/Bm0Y9vkXlzx4a87DfkyJRo5gw6Ko2OFkP 65QHoQ2b0WST0hpENHjbjIUqsHG6Gyloxl5J4kZBcpOWu3RtGMt5FfKep39stTYmIZ2O slHw== 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=Yl9OH48SZdYpyfFkrzyzOlAuQm2dup9GWXc/KgwK0Y8=; b=H2lzUW/7OTUMBpel1Nq1DqE60/c/5/r0HyUNYYAYpME6pb8G1y4a0fM/42q+hdr4LR RHon1WCLviAfgTcHJkEuOHOSFoOMbN3xIhgP332RSvrtVUZhelcwD94uxFZGv7q/8ac3 /HfqkVVF/ghblSkn2tf9plNB1alnpVsAq5SCF6EIxtc3QqO/haxRoIiA091wZ+a3l68Q fZWO4oVpUepB4hmeVznTwi8r+E05CrKomBbVU19t+KH2Yj4bIUAgDuIkrhM0NTX3Xqof YnlgfVX0Ee7owFRbQmx3Cr4Pj5gzsSr45KSL9/eb2XG/oDlIrbcfgM7rvIPNiICmU/v4 vM0A== X-Gm-Message-State: AO0yUKWbREU26bvYhe8oEjepxX9wrA8TP5sbeC1OKYiY7uIw2AdKV1rG /yrjF81mlEUK0yNxedTT6Ymylat/L9E= X-Google-Smtp-Source: AK7set+kEiVAztR1I+HTyED1CsqpiTmDxns1RrYfuiLg0GQh8sEPKPzeSCiRa/EMt2Nm6sgdVSQUJw== X-Received: by 2002:a17:903:32c2:b0:196:d05:bac7 with SMTP id i2-20020a17090332c200b001960d05bac7mr14861696plr.58.1674769884520; Thu, 26 Jan 2023 13:51:24 -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 p18-20020a170902ebd200b00196053474a8sm1442348plg.53.2023.01.26.13.51.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Jan 2023 13:51:24 -0800 (PST) Received: by squeak.grove.modra.org (Postfix, from userid 1000) id 02BF61142CC6; Fri, 27 Jan 2023 08:21:21 +1030 (ACDT) Date: Fri, 27 Jan 2023 08:21:20 +1030 From: Alan Modra To: binutils@sourceware.org Subject: segv in coff_aarch64_addr32nb_reloc Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-3035.7 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 List-Id: * coff-aarch64.c (coff_aarch64_addr32nb_reloc): When output_bfd is NULL (which it is for objdump -W) get the output bfd via the input section. diff --git a/bfd/coff-aarch64.c b/bfd/coff-aarch64.c index 12e242e18d0..659cd4f162d 100644 --- a/bfd/coff-aarch64.c +++ b/bfd/coff-aarch64.c @@ -189,9 +189,10 @@ coff_aarch64_addr32nb_reloc (bfd *abfd, + symbol->section->output_section->vma); bfd_vma addend = bfd_getl_signed_32 (data + reloc_entry->address); relocation += addend; - if (bfd_get_flavour (output_bfd) == bfd_target_coff_flavour - && obj_pe (output_bfd)) - relocation -= pe_data (output_bfd)->pe_opthdr.ImageBase; + bfd *obfd = input_section->output_section->owner; + if (bfd_get_flavour (obfd) == bfd_target_coff_flavour + && obj_pe (obfd)) + relocation -= pe_data (obfd)->pe_opthdr.ImageBase; else { *error_message = "unsupported"; -- Alan Modra Australia Development Lab, IBM