From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-x52f.google.com (mail-pg1-x52f.google.com [IPv6:2607:f8b0:4864:20::52f]) by sourceware.org (Postfix) with ESMTPS id 261EE3858D20 for ; Fri, 4 Feb 2022 14:37:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 261EE3858D20 Received: by mail-pg1-x52f.google.com with SMTP id d186so5178253pgc.9 for ; Fri, 04 Feb 2022 06:37:08 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=wUMFjpHtNnUrUXDhkwtpaSAsRQ9LC7R5G/vjyUrcxpk=; b=qj80cfCTqrZujqPl/YrcWU3yew0e9djGPOVGTjCHUy2eMQgsoyD9W1kfpffoe/lndl ee9tzhzvyY7t0B1nDEHg6IOAjjwsBqzj5BAheChAJyOA0Mhja3pkOX6JcwIPJLbHVfUf /RiMwt86yoAFBOywFEvw2PCploQpxl4qgH7og3OSwu42oCmMepuYfwQuYWNfIC5At3t5 pOe6i/xT6XEpq6betNKYCqiyR5qKgyPl8l7RyUrRDNdDFpYZjnFBAeN9YVDLlxhbL6FS sB/0X4MOCFXuPgZ5Jk/Cxea1tVp/jWs3DdieBHmtZsgt8m9qx0IaBEHFydEt8iuWdYqd G3gQ== X-Gm-Message-State: AOAM530P0GmTLNYUizZJopssABRoNS26/yRVgNnbe7+Mm0k78ej6GlYu G2n0PN+Id05JRKQS5JNtSwWux1rPcBKeTLpnXWE= X-Google-Smtp-Source: ABdhPJwF+l0CxtvWQmZODCVckGQkhFhbwCJVtSvIKJAVckQqVYoIaCooNIKctjDxlfPAOVY8hMQgmka9/hq7EPX60Hw= X-Received: by 2002:a62:1dd0:: with SMTP id d199mr3367329pfd.60.1643985426308; Fri, 04 Feb 2022 06:37:06 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: "H.J. Lu" Date: Fri, 4 Feb 2022 06:36:30 -0800 Message-ID: Subject: Re: PR28827 - [2.38 Regression] ld hits assertion building LLVM 9 on powerpc64le-linux-gnu To: Alan Modra Cc: Nick Clifton , Binutils Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3021.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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-List-Received-Date: Fri, 04 Feb 2022 14:37:10 -0000 On Fri, Feb 4, 2022 at 3:06 AM Alan Modra wrote: > > Hi Nick, HJ, > I've spent most of today debugging a build of libclang-cpp.so.9 using > the binutils 2.38 release branch. The problem occurs after only a few > iterations of stub sizing, so all the patches I already committed for > potential bugs when we hit 20 iteration don't so anything as far as > actually linking the real object files. > > The problem is caused by the new relro code introducing a gap at the > end of the relro segment. On powerpc64 that means between the .got > and .plt section. That gap changes when .eh_frame shrinks after > consolidating CIEs and garbage collecting unused FDEs, which happens > after the stub sizing passes are run from ldemul_after_allocation. > Unfortunately, if the .got/.plt gap increases, plt call stubs may need > to be larger to access addresses in the PLT from the toc pointer reg > and thus not fit in space allocated for them. I ran into similar issues when I was implementing DT_RELR on x86. I added size_relative_relocs and finish_relative_relocs hooks to resolve them. > Please revert the relro patches on the branch. I'm now certain that > PR28827 is directly caused by them. I submit a patch to remove the 1-page gap only for x86: https://sourceware.org/pipermail/binutils/2022-February/119625.html -- H.J.