- bfd_elf32_arm_set_target_relocs (link_info.output_bfd, &link_info,
- target1_is_rel,
- target2_type, fix_v4bx, use_blx,
- vfp11_denorm_fix, no_enum_size_warning,
- pic_veneer);
+ if (strstr (bfd_get_target (link_info.output_bfd), "arm") == NULL)
+ {
+ /* The arm backend needs special fields in the output hash structure.
+ These will only be created if the output format is an arm format,
+ hence we do not support linking and changing output formats at the
+ same time. Use a link followed by objcopy to change output formats. */
+ einfo (_("%F%P: error: cannot change output format "
+ "whilst linking %s binaries\n"), "ARM");
+ return;
+ }
+
+ if (in_implib_filename)
+ {
+ params.in_implib_bfd = bfd_openr (in_implib_filename,
+ bfd_get_target (link_info.output_bfd));
+
+ if (params.in_implib_bfd == NULL)
+ einfo (_("%F%P: %s: can't open: %E\n"), in_implib_filename);
+
+ if (!bfd_check_format (params.in_implib_bfd, bfd_object))
+ einfo (_("%F%P: %s: not a relocatable file: %E\n"), in_implib_filename);
+ }
+
+ bfd_elf32_arm_set_target_params (link_info.output_bfd, &link_info, ¶ms);
+
+ stub_file = lang_add_input_file ("linker stubs",
+ lang_input_file_is_fake_enum,
+ NULL);
+ stub_file->the_bfd = bfd_create ("linker stubs", link_info.output_bfd);
+ if (stub_file->the_bfd == NULL
+ || ! bfd_set_arch_mach (stub_file->the_bfd,
+ bfd_get_arch (link_info.output_bfd),
+ bfd_get_mach (link_info.output_bfd)))
+ {
+ einfo (_("%F%P: can not create BFD: %E\n"));
+ return;
+ }
+
+ stub_file->the_bfd->flags |= BFD_LINKER_CREATED;
+ ldlang_add_file (stub_file);
+
+ /* Also use the stub file for stubs placed in a single output section. */
+ bfd_elf32_arm_add_glue_sections_to_bfd (stub_file->the_bfd, &link_info);
+ bfd_elf32_arm_get_bfd_for_interworking (stub_file->the_bfd, &link_info);