aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf64-ppc.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2022-06-27 17:15:22 +0930
committerAlan Modra <amodra@gmail.com>2022-06-28 13:02:26 +0930
commit04cb922adec14aa923d306050678ed074dcde365 (patch)
treeb8a8c6bdb69293ab7a404b41bee7509b619c9b47 /bfd/elf64-ppc.c
parente3940312c14b1857a92e4e282419402e36ac4cc6 (diff)
downloadfsf-binutils-gdb-04cb922adec14aa923d306050678ed074dcde365.zip
fsf-binutils-gdb-04cb922adec14aa923d306050678ed074dcde365.tar.gz
fsf-binutils-gdb-04cb922adec14aa923d306050678ed074dcde365.tar.bz2
PowerPC64: Tidy stub type changes
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.
Diffstat (limited to 'bfd/elf64-ppc.c')
-rw-r--r--bfd/elf64-ppc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index 04f2c14..9491a0f 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)