+void
+after_check_relocs_default (void)
+{
+}
+
+void
+after_allocation_default (void)
+{
+ lang_relax_sections (FALSE);
+}
+
+void
+before_allocation_default (void)
+{
+ if (!bfd_link_relocatable (&link_info))
+ strip_excluded_output_sections ();
+}
+
+void
+finish_default (void)
+{
+ if (!bfd_link_relocatable (&link_info))
+ _bfd_fix_excluded_sec_syms (link_info.output_bfd, &link_info);
+}
+
+void
+set_output_arch_default (void)
+{
+ /* Set the output architecture and machine if possible. */
+ bfd_set_arch_mach (link_info.output_bfd,
+ ldfile_output_architecture, ldfile_output_machine);
+
+ bfd_emul_set_maxpagesize (output_target, config.maxpagesize);
+ bfd_emul_set_commonpagesize (output_target, config.commonpagesize);
+}
+
+void
+syslib_default (char *ignore ATTRIBUTE_UNUSED)
+{
+ info_msg (_("%pS SYSLIB ignored\n"), NULL);
+}
+
+void
+hll_default (char *ignore ATTRIBUTE_UNUSED)
+{
+ info_msg (_("%pS HLL ignored\n"), NULL);
+}
+
+ld_emulation_xfer_type *ld_emulations[] = { EMULATION_LIST };
+
+void
+ldemul_choose_mode (char *target)
+{
+ ld_emulation_xfer_type **eptr = ld_emulations;
+ /* Ignore "gld" prefix. */
+ if (target[0] == 'g' && target[1] == 'l' && target[2] == 'd')
+ target += 3;
+ for (; *eptr; eptr++)
+ {
+ if (strcmp (target, (*eptr)->emulation_name) == 0)
+ {
+ ld_emulation = *eptr;
+ return;
+ }
+ }
+ einfo (_("%P: unrecognised emulation mode: %s\n"), target);
+ einfo (_("Supported emulations: "));
+ ldemul_list_emulations (stderr);
+ einfo ("%F\n");
+}
+
+void
+ldemul_list_emulations (FILE *f)
+{
+ ld_emulation_xfer_type **eptr = ld_emulations;
+ bfd_boolean first = TRUE;
+
+ for (; *eptr; eptr++)
+ {
+ if (first)
+ first = FALSE;
+ else
+ fprintf (f, " ");
+ fprintf (f, "%s", (*eptr)->emulation_name);
+ }
+}
+
+void
+ldemul_list_emulation_options (FILE *f)
+{
+ ld_emulation_xfer_type **eptr;
+ int options_found = 0;
+
+ for (eptr = ld_emulations; *eptr; eptr++)
+ {
+ ld_emulation_xfer_type *emul = *eptr;
+
+ if (emul->list_options)
+ {
+ fprintf (f, "%s: \n", emul->emulation_name);
+
+ emul->list_options (f);
+
+ options_found = 1;
+ }
+ }
+
+ if (!options_found)
+ fprintf (f, _(" no emulation specific options.\n"));
+}
+
+int
+ldemul_find_potential_libraries (char *name, lang_input_statement_type *entry)
+{
+ if (ld_emulation->find_potential_libraries)
+ return ld_emulation->find_potential_libraries (name, entry);
+
+ return 0;
+}
+
+struct bfd_elf_version_expr *
+ldemul_new_vers_pattern (struct bfd_elf_version_expr *entry)
+{
+ if (ld_emulation->new_vers_pattern)
+ entry = (*ld_emulation->new_vers_pattern) (entry);
+ return entry;
+}
+
+void
+ldemul_extra_map_file_text (bfd *abfd, struct bfd_link_info *info, FILE *mapf)
+{
+ if (ld_emulation->extra_map_file_text)
+ ld_emulation->extra_map_file_text (abfd, info, mapf);
+}
+
+int
+ldemul_emit_ctf_early (void)
+{
+ if (ld_emulation->emit_ctf_early)
+ return ld_emulation->emit_ctf_early ();
+ /* If the emulation doesn't know if it wants to emit CTF early, it is going
+ to do so. */
+ return 1;
+}
+
+void
+ldemul_examine_strtab_for_ctf (struct ctf_file *ctf_output,
+ struct elf_sym_strtab *syms,
+ bfd_size_type symcount,
+ struct elf_strtab_hash *symstrtab)
+
+{
+ if (ld_emulation->examine_strtab_for_ctf)
+ ld_emulation->examine_strtab_for_ctf (ctf_output, syms,
+ symcount, symstrtab);
+}