From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) by sourceware.org (Postfix) with ESMTPS id 401FB3858D28 for ; Wed, 21 Jun 2023 13:37:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 401FB3858D28 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-pl1-x636.google.com with SMTP id d9443c01a7336-1b512309c86so39711815ad.1 for ; Wed, 21 Jun 2023 06:37:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687354672; x=1689946672; h=content-disposition:mime-version:message-id:subject:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=epVFkJpL84olJ4qmNDZVjqdWdcQTkL+vbu12yE0qRx8=; b=bihUGQoZzuh3tgoSEjhmHsgIeeHCIUUzfruz2mLE5YcMOZjoDzbb6ULJ2QEhhvpDPT 6p/OAIYEk8aq2Boep94S+F1utTknkUZUUKbdaHEj9FPuwfsF5xOUG6HHJvd068fy1nEp uE+xIdhMG32FS6JnQi8F915OEvYPK4p+1eK0jqmv5w3qq8mhjE2CUzUsBS77yP7xmnSl mkF4aN1+yQ4Wv2U4XNEgnzURxAlramkVyteV43pKmA01HMXHxomsdDsIykAtV7G1Q0ga IHRI7g5Vpgearziw56228YWMi8CMA03GaUqYtexyBDGsnSMo+oAM0aVRQ2ILP4TnKTNd 87Wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687354672; x=1689946672; 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=epVFkJpL84olJ4qmNDZVjqdWdcQTkL+vbu12yE0qRx8=; b=WKBwFoC5dpCZwwydZVrM90iATcnzdevFf9wm3WS9/UE9gK8WjRfycmLxFhJwTY0/OB kMaobKYyWyukfOxryANNlM8ZTqw7jwGmlQzX97eOCSNkmlwuFeTZ+GBzDc74wUenIi8C 5kjZcsPc+eT/mTl4D5BwZx/jpOSWRS928sgVyWhWx9YNSQ6efCmNN4U/oWVvnGH8WLso ZpCJweUV/xRhjFRn4f4f7yFAJlkmUTOpUa6vdVPimGTNDR2zfNatF+3HZLeDsips4qsR SDdPmp7UJ3XUQWxtUvpqFx/sKg6z/SpllWOzI68I1oYrzvrXUzEMEFh82mGM7T50pkSU uXnA== X-Gm-Message-State: AC+VfDwTKFBlatk7H1o6++gp3ba2A2pKd8Ucxi4itkVL8NvSCPnaHUCd sDTmhhBOfggydr0beyyjL07cNHpaQj4= X-Google-Smtp-Source: ACHHUZ6TZPBC7NBWwQayECbAPYMHPVyaiogw4lZNHqeFXrC/JLHA6E35v7mtBL4EsG3HPXJxBVUOFw== X-Received: by 2002:a17:902:b7c9:b0:1b2:676d:1143 with SMTP id v9-20020a170902b7c900b001b2676d1143mr18199008plz.15.1687354671916; Wed, 21 Jun 2023 06:37:51 -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 o4-20020a1709026b0400b001b176d96da0sm3513011plk.78.2023.06.21.06.37.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Jun 2023 06:37:50 -0700 (PDT) Received: by squeak.grove.modra.org (Postfix, from userid 1000) id 2AE671143558; Wed, 21 Jun 2023 23:07:48 +0930 (ACST) Date: Wed, 21 Jun 2023 23:07:48 +0930 From: Alan Modra To: binutils@sourceware.org Subject: [GOLD] PR30536, ppc64el gold linker produces unusable clang-16 binary Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-3034.6 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,T_SCC_BODY_TEXT_LINE 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: In commit 0961e631575b, the fix for PR30217, make_lplt_section and make_brlt_section were changed to use rela_dyn_ rather than their own separate dynamic reloc sections. This fails miserably whenever brlt_ is needed for long branches, due to needing to iterate sizing and thus reset brlt_ sizes. PR 30536 PR 30217 * powerpc.cc (Target_powerpc::make_brlt_section): Don't use rela_dyn_. diff --git a/gold/powerpc.cc b/gold/powerpc.cc index a847dadf900..aa2d9a18787 100644 --- a/gold/powerpc.cc +++ b/gold/powerpc.cc @@ -4632,7 +4632,15 @@ Target_powerpc::make_brlt_section(Layout* layout) { // When PIC we can't fill in .branch_lt but must initialise at // runtime via dynamic relocations. - brlt_rel = this->rela_dyn_section(layout); + this->rela_dyn_section(layout); + // FIXME: This reloc section won't have its relative relocs + // sorted properly among the other relative relocs in rela_dyn_ + // but it must be a separate section due to needing to call + // reset_data_size(). + brlt_rel = new Reloc_section(false); + if (this->rela_dyn_->output_section()) + this->rela_dyn_->output_section() + ->add_output_section_data(brlt_rel); } this->brlt_section_ = new Output_data_brlt_powerpc(this, brlt_rel); -- Alan Modra Australia Development Lab, IBM