From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x431.google.com (mail-pf1-x431.google.com [IPv6:2607:f8b0:4864:20::431]) by sourceware.org (Postfix) with ESMTPS id 0AB8738582B8 for ; Tue, 20 Sep 2022 23:38:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0AB8738582B8 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-pf1-x431.google.com with SMTP id j12so4188607pfi.11 for ; Tue, 20 Sep 2022 16:38:29 -0700 (PDT) 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; bh=nMLleuummjVnFBD6pfysjuWQQwuOG51c7Sg5BjZbDrw=; b=oJURnKErIBHk1kQ+bAUs077MJvw47bcDkzaHgr6652WHQZnjq1toNLygpWnBjYdl8x kC9/XgBzZVDMbf3clZuFzMQLNcPQX8iGphgHvbvbb11sTRQl6//Mq5e/EnQszgWEgAjj SRfHFOmAQJ3LRAm37dJdEx/N/ct41TrrULhN0cqN27bktXjI2BAnoeA8K/eMeqYG+DDL KNbWaNNqspJmpQLLVOB8cvy+QhFyt0uPeUxTXeStByPj5jMT1Yi4kM8UwqJTfsp96cQC 74yNNPI2nv+WXcOmSIapOlPOeXHTG/OQASIRGvzMGg5+dVvvpHEez8GjPMA388y7xGkQ 2+Iw== 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; bh=nMLleuummjVnFBD6pfysjuWQQwuOG51c7Sg5BjZbDrw=; b=T5WLvC1Bj488Sgjsbb96WuJ40zd6Wb3EGMo4+VeGTrHWR9SevsTdmfs4pkgbDYFSU4 j0j4BqDdBwpT9yqOPo3B88tDmrOLKJeSLjJe5omTlMgQNOU+yeisTbTgSu36zPlPjvcy hVmSZQzpDUTlkdycsFELGKOrvvW/15kusjuYgoHDifSP335+IudJ3pgUEiU1R6Chca9H rNsm+pB1Yp6JxAUIDAm6fCBCsJ8c2JQHeT6YZ+biDgd4Hu7HZWXBsyAJLnL8rEIRuSrQ A7NaOBZtiSUoyiFOTWu1o07bU0wgiOc+ktX/2bOIXokVJ1hIhS6Mc+aMoU8bXeatC//M A97A== X-Gm-Message-State: ACrzQf1vs69jqmhIL1FftVIsYntyw+UgqHW5C4LwD48ZvpjXsYaTplTn w6i2KAfq+z/9Pq76ibM8kru6o5fdAjc= X-Google-Smtp-Source: AMsMyM5gSM5VUeI08bCMvaLYo/NmwxL/3TvSUdfSSoW7PqI4So/KBZi8mpT3W3R5HNJkOhPX5O9Vdw== X-Received: by 2002:a63:c06:0:b0:439:9b18:8574 with SMTP id b6-20020a630c06000000b004399b188574mr21930842pgl.608.1663717108877; Tue, 20 Sep 2022 16:38:28 -0700 (PDT) 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 h8-20020aa79f48000000b0053e42167a33sm498512pfr.53.2022.09.20.16.38.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Sep 2022 16:38:28 -0700 (PDT) Received: by squeak.grove.modra.org (Postfix, from userid 1000) id C5DFB1142E0E; Wed, 21 Sep 2022 09:08:25 +0930 (ACST) Date: Wed, 21 Sep 2022 09:08:25 +0930 From: Alan Modra To: binutils@sourceware.org Subject: Re: PowerPC64 pcrel got relocs against local symbols Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-3036.9 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,UPPERCASE_50_75 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: The last patch wasn't all that shiny. There are rather a lot more relocations that can hit the assertion in md_apply_fix if the symbol is local or absolute. Fix them all. * config/tc-ppc.c (ppc_force_relocation): Add all relocs that expect a symbol in md_apply_fix. Remove tls pcrel relocs already covered in general tls match range. diff --git a/gas/config/tc-ppc.c b/gas/config/tc-ppc.c index 1ed8ef2034b..d20fd757091 100644 --- a/gas/config/tc-ppc.c +++ b/gas/config/tc-ppc.c @@ -6679,8 +6679,6 @@ ppc_force_relocation (fixS *fix) int ppc_force_relocation (fixS *fix) { - /* Branch prediction relocations must force a relocation, as must - the vtable description relocs. */ switch (fix->fx_r_type) { case BFD_RELOC_PPC_B16_BRTAKEN: @@ -6689,12 +6687,60 @@ ppc_force_relocation (fixS *fix) case BFD_RELOC_PPC_BA16_BRNTAKEN: case BFD_RELOC_24_PLT_PCREL: case BFD_RELOC_PPC64_TOC: + case BFD_RELOC_16_GOTOFF: + case BFD_RELOC_LO16_GOTOFF: + case BFD_RELOC_HI16_GOTOFF: + case BFD_RELOC_HI16_S_GOTOFF: + case BFD_RELOC_LO16_PLTOFF: + case BFD_RELOC_HI16_PLTOFF: + case BFD_RELOC_HI16_S_PLTOFF: + case BFD_RELOC_GPREL16: + case BFD_RELOC_16_BASEREL: + case BFD_RELOC_LO16_BASEREL: + case BFD_RELOC_HI16_BASEREL: + case BFD_RELOC_HI16_S_BASEREL: + case BFD_RELOC_PPC_TOC16: + case BFD_RELOC_PPC64_TOC16_LO: + case BFD_RELOC_PPC64_TOC16_HI: + case BFD_RELOC_PPC64_TOC16_HA: + case BFD_RELOC_PPC64_PLTGOT16: + case BFD_RELOC_PPC64_PLTGOT16_LO: + case BFD_RELOC_PPC64_PLTGOT16_HI: + case BFD_RELOC_PPC64_PLTGOT16_HA: + case BFD_RELOC_PPC64_GOT16_DS: + case BFD_RELOC_PPC64_GOT16_LO_DS: + case BFD_RELOC_PPC64_PLT16_LO_DS: + case BFD_RELOC_PPC64_SECTOFF_DS: + case BFD_RELOC_PPC64_SECTOFF_LO_DS: + case BFD_RELOC_PPC64_TOC16_DS: + case BFD_RELOC_PPC64_TOC16_LO_DS: + case BFD_RELOC_PPC64_PLTGOT16_DS: + case BFD_RELOC_PPC64_PLTGOT16_LO_DS: + case BFD_RELOC_PPC_EMB_NADDR16: + case BFD_RELOC_PPC_EMB_NADDR16_LO: + case BFD_RELOC_PPC_EMB_NADDR16_HI: + case BFD_RELOC_PPC_EMB_NADDR16_HA: + case BFD_RELOC_PPC_EMB_SDAI16: + case BFD_RELOC_PPC_EMB_SDA2I16: + case BFD_RELOC_PPC_EMB_SDA2REL: + case BFD_RELOC_PPC_EMB_SDA21: + case BFD_RELOC_PPC_EMB_MRKREF: + case BFD_RELOC_PPC_EMB_RELSEC16: + case BFD_RELOC_PPC_EMB_RELST_LO: + case BFD_RELOC_PPC_EMB_RELST_HI: + case BFD_RELOC_PPC_EMB_RELST_HA: + case BFD_RELOC_PPC_EMB_BIT_FLD: + case BFD_RELOC_PPC_EMB_RELSDA: + case BFD_RELOC_PPC_VLE_SDA21: + case BFD_RELOC_PPC_VLE_SDA21_LO: + case BFD_RELOC_PPC_VLE_SDAREL_LO16A: + case BFD_RELOC_PPC_VLE_SDAREL_LO16D: + case BFD_RELOC_PPC_VLE_SDAREL_HI16A: + case BFD_RELOC_PPC_VLE_SDAREL_HI16D: + case BFD_RELOC_PPC_VLE_SDAREL_HA16A: + case BFD_RELOC_PPC_VLE_SDAREL_HA16D: case BFD_RELOC_PPC64_PLT_PCREL34: case BFD_RELOC_PPC64_GOT_PCREL34: - case BFD_RELOC_PPC64_GOT_TLSGD_PCREL34: - case BFD_RELOC_PPC64_GOT_TLSLD_PCREL34: - case BFD_RELOC_PPC64_GOT_TPREL_PCREL34: - case BFD_RELOC_PPC64_GOT_DTPREL_PCREL34: return 1; case BFD_RELOC_PPC_B26: case BFD_RELOC_PPC_BA26: -- Alan Modra Australia Development Lab, IBM