From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-x52c.google.com (mail-pg1-x52c.google.com [IPv6:2607:f8b0:4864:20::52c]) by sourceware.org (Postfix) with ESMTPS id C995C3856DD0 for ; Thu, 23 Jun 2022 08:36:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C995C3856DD0 Received: by mail-pg1-x52c.google.com with SMTP id z14so18526254pgh.0 for ; Thu, 23 Jun 2022 01:36:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=QWTO6vOj1fHE8f92V5ynWOfy0GYCfEZN1PnR4NcmBKA=; b=3/9mg/ztjTXu0bX+yCL5/YptApgrX2JtMV/ys9Qy8Fhlx7P8cwyJ35rTp0OuKQSTuN 2Pu1VLOLEsynGjwE278Atc9otlJnzL+6KJSLxPylOrMRNjOfgboMoenBcnivBCaehCm0 e46fIyYa/t5DcX9j/hc/l6ZslX7y3k5j+MuI1P1j39sgOxh2LB9NXHCkLA+XFSVQUN0T 5RShfMO7XVJI0JbqHfkDr/AGqKAQVEVZ7Vy/2qK46gsQ9+G/ecUXcotuAC7Hu6KfQUW4 QVpljtxomgvCGeqjbQxfAw/qgyt9WgLTr8oALCM0DjHhHMCOCeYBBuqvOoc0jTYYEII4 otHQ== X-Gm-Message-State: AJIora+0maIE3V6Nwe1MxYqS3r938u+BWSMEY6cPObhYtHD9b0WEJ7vo jUMP9RfbirdWycbYbvCi/gbdsOANRQg= X-Google-Smtp-Source: AGRyM1sa59iX2S6JHBiF+Z62xF9UffOQfuOzXGOh7DrU0eKs1V0L+S7DvNTkD5VAs7OMez5FgBEX4w== X-Received: by 2002:a63:5950:0:b0:3fd:b97d:90d2 with SMTP id j16-20020a635950000000b003fdb97d90d2mr6454590pgm.502.1655973395384; Thu, 23 Jun 2022 01:36:35 -0700 (PDT) Received: from squeak.grove.modra.org ([2406:3400:51d:8cc0:50a0:d1ef:c251:2d8d]) by smtp.gmail.com with ESMTPSA id u12-20020a17090a4bcc00b001ecae1019dfsm1257820pjl.45.2022.06.23.01.36.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Jun 2022 01:36:34 -0700 (PDT) Received: by squeak.grove.modra.org (Postfix, from userid 1000) id D4F4F1140364; Thu, 23 Jun 2022 18:06:31 +0930 (ACST) Date: Thu, 23 Jun 2022 18:06:31 +0930 From: Alan Modra To: binutils@sourceware.org Subject: PowerPC64: fix assertion in ppc_build_one_stub with -Os code Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-3036.3 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 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: Thu, 23 Jun 2022 08:36:41 -0000 The last stub debug dump showed what was really going on. save_res stubs aren't written in ppc_build_one_stub, their offsets (which are zero) should not be checked. * elf64-ppc.c (ppc_build_one_stub): Don't check save_res offsets. diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c index 6af33d883b3..04f2c146535 100644 --- a/bfd/elf64-ppc.c +++ b/bfd/elf64-ppc.c @@ -11735,7 +11735,8 @@ ppc_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg) = ppc64_elf_section_data (stub_entry->group->stub_sec); ++htab->stub_id; if (stub_entry->id != htab->stub_id - || stub_entry->stub_offset < stub_entry->group->stub_sec->size) + || (stub_entry->type.main != ppc_stub_save_res + && stub_entry->stub_offset < stub_entry->group->stub_sec->size)) { BFD_ASSERT (0); if (stub_entry->id != htab->stub_id) -- Alan Modra Australia Development Lab, IBM