From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by sourceware.org (Postfix) with ESMTPS id 254BC3856080 for ; Tue, 28 Jun 2022 03:17:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 254BC3856080 Received: by mail-pj1-x1035.google.com with SMTP id i8-20020a17090aee8800b001ecc929d14dso11441493pjz.0 for ; Mon, 27 Jun 2022 20:17:07 -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:mime-version :content-disposition; bh=skcsfynTXo0T66CyCnKw1xmCCW4S0mQOaSz8xjQdMXA=; b=cJQkFrQOWG3xTpgSxGI3XmR999dkllwRU7TmT4bTRxhBzAPeEwsuM+7SF62A8QtmIu E4aQO0qpth3MWVoxEPoUkeImkhwRcQqUlKBLdGEYrv/hTwqgTaqPYVM+Xm3SPG9m0Prm Jo2t15vQchbT+qt8SvPy+gwvEMK95I2UytuYgPidIiXbbC8IS/CAFX5rML/cijiUw4XH DrdumDjzLrQu62HTLvEQveWddJnHkhrq0f8OLI1jd4PTSJnhM4tH0DlN8A+YX8YA+j09 q2SoEEk5xXW2UnuLc0FgQsDZ0jp9ujTZ94fU5ioeFrV31Y/tfyYKxRAVULxK0TMfJk1d MCzg== X-Gm-Message-State: AJIora+E2ghXw6grU2xwcLb6rzUWDHWPy9ZKuwbwleRu1NhsbS9jR2OU 8Z3Xwepum2vEmWh0MRbm/01bcPA8mKg= X-Google-Smtp-Source: AGRyM1tvywTrByWFckFHO+Bc4TL5QSWGjLm8oAyGUtBH6U5wOfWxqMSY/Ghti4Mu47VNXaHh1ogccQ== X-Received: by 2002:a17:90b:3b44:b0:1ec:d7a8:7528 with SMTP id ot4-20020a17090b3b4400b001ecd7a87528mr24826563pjb.231.1656386225849; Mon, 27 Jun 2022 20:17:05 -0700 (PDT) Received: from squeak.grove.modra.org ([2406:3400:51d:8cc0:ff85:b5f6:bac4:e58f]) by smtp.gmail.com with ESMTPSA id i4-20020a17090332c400b0016a214e4afasm7979056plr.125.2022.06.27.20.17.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jun 2022 20:17:05 -0700 (PDT) Received: by squeak.grove.modra.org (Postfix, from userid 1000) id B72B911404EA; Tue, 28 Jun 2022 12:47:02 +0930 (ACST) Date: Tue, 28 Jun 2022 12:47:02 +0930 From: Alan Modra To: binutils@sourceware.org Subject: PowerPC64: Tidy stub type changes Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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: Tue, 28 Jun 2022 03:17:11 -0000 It made sense before I started using separate fields for main type and sub type to add a difference in main type to the type (thus keeping sub type unchanged). Not so much now. * elf64-ppc.c (ppc_merge_stub): Simplify stub type change. (ppc_size_one_stub): Likewise. diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c index 04f2c146535..9491a0f9e66 100644 --- a/bfd/elf64-ppc.c +++ b/bfd/elf64-ppc.c @@ -3969,7 +3969,7 @@ ppc_merge_stub (struct ppc_link_hash_table *htab, old_type = stub_entry->type; if (old_type.main == ppc_stub_plt_branch) - old_type.main += ppc_stub_long_branch - ppc_stub_plt_branch; + old_type.main = ppc_stub_long_branch; if (old_type.main != stub_type.main || (old_type.sub != stub_type.sub @@ -12300,7 +12300,7 @@ ppc_size_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg) { /* Reset the stub type from the plt branch variant in case we now can reach with a shorter stub. */ - stub_entry->type.main += ppc_stub_long_branch - ppc_stub_plt_branch; + stub_entry->type.main = ppc_stub_long_branch; } if (stub_entry->type.main == ppc_stub_long_branch @@ -12382,7 +12382,7 @@ ppc_size_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg) stub_entry->group->stub_sec->flags |= SEC_RELOC; } - stub_entry->type.main += ppc_stub_plt_branch - ppc_stub_long_branch; + stub_entry->type.main = ppc_stub_plt_branch; if (!stub_entry->type.r2save) { size = 12; @@ -12462,7 +12462,7 @@ ppc_size_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg) /* If the branch can't reach, use a plt_branch. */ if (off + (1 << 25) >= (bfd_vma) (1 << 26)) { - stub_entry->type.main += ppc_stub_plt_branch - ppc_stub_long_branch; + stub_entry->type.main = ppc_stub_plt_branch; size += 4; } else if (info->emitrelocations) -- Alan Modra Australia Development Lab, IBM