aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorHans-Peter Nilsson <hp@axis.com>2001-06-19 19:57:39 +0000
committerHans-Peter Nilsson <hp@axis.com>2001-06-19 19:57:39 +0000
commit429d935daaf8b8bd56656d15801b6b61412eca3d (patch)
tree47d10b974c485920f171c3032efbe22140c086c1 /ld
parent105e7211d32ae94f38778eeaa735c8965eade1b3 (diff)
downloadgdb-429d935daaf8b8bd56656d15801b6b61412eca3d.zip
gdb-429d935daaf8b8bd56656d15801b6b61412eca3d.tar.gz
gdb-429d935daaf8b8bd56656d15801b6b61412eca3d.tar.bz2
* ldlang.c (lang_check): Emit fatal error if relocatable link
between different object flavours with relocations in input.
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog5
-rw-r--r--ld/ldlang.c12
2 files changed, 17 insertions, 0 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 9810435..9858969 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,8 @@
+2001-06-19 Hans-Peter Nilsson <hp@axis.com>
+
+ * ldlang.c (lang_check): Emit fatal error if relocatable link
+ between different object flavours with relocations in input.
+
2001-06-19 H.J. Lu <hjl@gnu.org>
* ld.texinfo (-E, --export-dynamic): Mention --version-script.
diff --git a/ld/ldlang.c b/ld/ldlang.c
index 5e57cac..2b88068 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -3520,6 +3520,18 @@ lang_check ()
bfd_printable_name (input_bfd), input_bfd,
bfd_printable_name (output_bfd));
}
+ else if (link_info.relocateable
+ /* In general it is not possible to perform a relocatable
+ link between differing object formats when the input
+ file has relocations, because the relocations in the
+ input format may not have equivalent representations in
+ the output format (and besides BFD does not translate
+ relocs for other link purposes than a final link). */
+ && bfd_get_flavour (input_bfd) != bfd_get_flavour (output_bfd)
+ && (bfd_get_file_flags (input_bfd) & HAS_RELOC) != 0)
+ einfo (_("%P%F: Relocatable linking with relocations from format %s (%B) to format %s (%B) is not supported\n"),
+ bfd_get_target (input_bfd), input_bfd,
+ bfd_get_target (output_bfd), output_bfd);
else if (bfd_count_sections (input_bfd))
{
/* If the input bfd has no contents, it shouldn't set the