+ if (htab->params->power10_stubs == -1)
+ {
+ /* For --power10-stubs=auto, don't merge _notoc
+ and other varieties of stubs. (The _both
+ variety won't be created.) */
+ bfd_boolean notoc = r_type == R_PPC64_REL24_NOTOC;
+ struct ppc_stub_hash_entry *alt_stub
+ = select_alt_stub (stub_entry, notoc);
+
+ if (alt_stub == NULL)
+ {
+ alt_stub = (struct ppc_stub_hash_entry *)
+ stub_hash_newfunc (NULL,
+ &htab->stub_hash_table,
+ stub_entry->root.string);
+ if (alt_stub == NULL)
+ {
+ /* xgettext:c-format */
+ _bfd_error_handler
+ (_("%pB: cannot create stub entry %s"),
+ section->owner, stub_entry->root.string);
+ goto error_ret_free_internal;
+ }
+ *alt_stub = *stub_entry;
+ stub_entry->root.next = &alt_stub->root;
+ if (notoc)
+ /* Sort notoc stubs first, for no good
+ reason. */
+ alt_stub = stub_entry;
+ alt_stub->stub_type = stub_type;
+ }
+ stub_entry = alt_stub;
+ }