-#if ANSI_PROTOTYPES
-struct lang_input_statement_struct;
-struct search_dirs;
-#endif
-
-extern void ldemul_hll PARAMS ((char *));
-extern void ldemul_syslib PARAMS ((char *));
-extern void ldemul_after_parse PARAMS ((void));
-extern void ldemul_before_parse PARAMS ((void));
-extern void ldemul_after_open PARAMS ((void));
-extern void ldemul_after_allocation PARAMS ((void));
-extern void ldemul_before_allocation PARAMS ((void));
-extern void ldemul_set_output_arch PARAMS ((void));
-extern char *ldemul_choose_target PARAMS ((void));
-extern void ldemul_choose_mode PARAMS ((char *));
-extern void ldemul_list_emulations PARAMS ((FILE *));
-extern void ldemul_list_emulation_options PARAMS ((FILE *));
-extern char *ldemul_get_script PARAMS ((int *isfile));
-extern void ldemul_finish PARAMS ((void));
-extern void ldemul_set_symbols PARAMS ((void));
-extern void ldemul_create_output_section_statements PARAMS ((void));
-extern boolean ldemul_place_orphan
- PARAMS ((struct lang_input_statement_struct *, asection *));
-extern int ldemul_parse_args PARAMS ((int, char **));
-extern boolean ldemul_unrecognized_file
- PARAMS ((struct lang_input_statement_struct *));
-extern boolean ldemul_open_dynamic_archive
- PARAMS ((const char *, struct search_dirs *,
- struct lang_input_statement_struct *));
-extern char *ldemul_default_target PARAMS ((void));
-extern void after_parse_default PARAMS ((void));
-extern void after_open_default PARAMS ((void));
-extern void after_allocation_default PARAMS ((void));
-extern void before_allocation_default PARAMS ((void));
-extern void set_output_arch_default PARAMS ((void));
-extern void syslib_default PARAMS ((char*));
-extern void hll_default PARAMS ((char*));
-
-typedef struct ld_emulation_xfer_struct
-{
+/* Forward declaration for ldemul_add_options() and others. */
+struct option;
+
+extern void ldemul_hll
+ (char *);
+extern void ldemul_syslib
+ (char *);
+extern void ldemul_after_parse
+ (void);
+extern void ldemul_before_parse
+ (void);
+extern void ldemul_after_open
+ (void);
+extern void ldemul_after_check_relocs
+ (void);
+extern void ldemul_before_place_orphans
+ (void);
+extern void ldemul_after_allocation
+ (void);
+extern void ldemul_before_allocation
+ (void);
+extern void ldemul_set_output_arch
+ (void);
+extern char *ldemul_choose_target
+ (int, char**);
+extern void ldemul_choose_mode
+ (char *);
+extern void ldemul_list_emulations
+ (FILE *);
+extern void ldemul_list_emulation_options
+ (FILE *);
+extern char *ldemul_get_script
+ (int *isfile);
+extern void ldemul_finish
+ (void);
+extern void ldemul_set_symbols
+ (void);
+extern void ldemul_create_output_section_statements
+ (void);
+extern lang_output_section_statement_type *ldemul_place_orphan
+ (asection *, const char *, int);
+extern bfd_boolean ldemul_parse_args
+ (int, char **);
+extern void ldemul_add_options
+ (int, char **, int, struct option **, int, struct option **);
+extern bfd_boolean ldemul_handle_option
+ (int);
+extern bfd_boolean ldemul_unrecognized_file
+ (struct lang_input_statement_struct *);
+extern bfd_boolean ldemul_recognized_file
+ (struct lang_input_statement_struct *);
+extern bfd_boolean ldemul_open_dynamic_archive
+ (const char *, struct search_dirs *, struct lang_input_statement_struct *);
+extern char *ldemul_default_target
+ (int, char**);
+extern void after_parse_default
+ (void);
+extern void after_open_default
+ (void);
+extern void after_check_relocs_default
+ (void);
+extern void before_place_orphans_default
+ (void);
+extern void after_allocation_default
+ (void);
+extern void before_allocation_default
+ (void);
+extern void finish_default
+ (void);
+extern void finish_default
+ (void);
+extern void set_output_arch_default
+ (void);
+extern void syslib_default
+ (char*);
+extern void hll_default
+ (char*);
+extern int ldemul_find_potential_libraries
+ (char *, struct lang_input_statement_struct *);
+extern struct bfd_elf_version_expr *ldemul_new_vers_pattern
+ (struct bfd_elf_version_expr *);
+extern void ldemul_extra_map_file_text
+ (bfd *, struct bfd_link_info *, FILE *);
+/* Return 1 if we are emitting CTF early, and 0 if ldemul_examine_strtab_for_ctf
+ will be called by the target. */
+extern int ldemul_emit_ctf_early
+ (void);
+/* Called from per-target code to examine the strtab and symtab. */
+extern void ldemul_examine_strtab_for_ctf
+ (struct ctf_file *, struct elf_sym_strtab *, bfd_size_type,
+ struct elf_strtab_hash *);
+
+typedef struct ld_emulation_xfer_struct {