diff options
author | Nick Clifton <nickc@redhat.com> | 1999-07-05 07:51:39 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 1999-07-05 07:51:39 +0000 |
commit | f11523b01363bac4f0b7384c30fee355e9943b99 (patch) | |
tree | 53c4635a65694d8d4869595374cd2d42f1dcb047 /ld/emultempl/armelf.em | |
parent | 9f20bbfd4c709ce9141913e51935899b23fc0907 (diff) | |
download | gdb-f11523b01363bac4f0b7384c30fee355e9943b99.zip gdb-f11523b01363bac4f0b7384c30fee355e9943b99.tar.gz gdb-f11523b01363bac4f0b7384c30fee355e9943b99.tar.bz2 |
Abort if input format is ARM and output format is not
Diffstat (limited to 'ld/emultempl/armelf.em')
-rw-r--r-- | ld/emultempl/armelf.em | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/ld/emultempl/armelf.em b/ld/emultempl/armelf.em index 88d7e27..a0f1a0d 100644 --- a/ld/emultempl/armelf.em +++ b/ld/emultempl/armelf.em @@ -308,13 +308,25 @@ gld${EMULATION_NAME}_after_open () { struct bfd_link_needed_list *needed, *l; - LANG_FOR_EACH_INPUT_STATEMENT (is) + if (strstr (bfd_get_target (output_bfd), "arm") == NULL) { - /* The interworking bfd must be the last one to be processed */ - if (!is->next) - bfd_elf32_arm_get_bfd_for_interworking (is->the_bfd, & link_info); + /* 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%X%P: error: cannot change output format whilst linking ARM binaries\n"); + return; } + { + LANG_FOR_EACH_INPUT_STATEMENT (is) + { + /* The interworking bfd must be the last one to be processed */ + if (!is->next) + bfd_elf32_arm_get_bfd_for_interworking (is->the_bfd, & link_info); + } + } + /* We only need to worry about this when doing a final link. */ if (link_info.relocateable || link_info.shared) return; |