aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2001-05-10 22:59:29 +0000
committerH.J. Lu <hjl.tools@gmail.com>2001-05-10 22:59:29 +0000
commit689effed707a39631d63921f38a03f670d6ce380 (patch)
tree91ab1969e5127439c1225eba40d860ba7d813c65 /bfd
parent9a0f0643ee3bfb0a2243c195e02971b3b31c64dd (diff)
downloadgdb-689effed707a39631d63921f38a03f670d6ce380.zip
gdb-689effed707a39631d63921f38a03f670d6ce380.tar.gz
gdb-689effed707a39631d63921f38a03f670d6ce380.tar.bz2
2001-05-10 H.J. Lu <hjl@gnu.org>
* linker.c (_bfd_generic_link_add_one_symbol): Check loop on indirect symbols.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/linker.c9
2 files changed, 14 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 6703ead..29d153c 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2001-05-10 H.J. Lu <hjl@gnu.org>
+
+ * linker.c (_bfd_generic_link_add_one_symbol): Check loop on
+ indirect symbols.
+
2001-05-09 H.J. Lu <hjl@gnu.org>
* elflink.h (elf_link_add_object_symbols): Fix a typo. Allocate
diff --git a/bfd/linker.c b/bfd/linker.c
index 3efaf66..0877289 100644
--- a/bfd/linker.c
+++ b/bfd/linker.c
@@ -1801,6 +1801,15 @@ _bfd_generic_link_add_one_symbol (info, abfd, name, flags, section, value,
copy, false);
if (inh == (struct bfd_link_hash_entry *) NULL)
return false;
+ if (inh->type == bfd_link_hash_indirect
+ && inh->u.i.link == h)
+ {
+ (*_bfd_error_handler)
+ (_("%s: indirect symbol `%s' to `%s' is a loop"),
+ bfd_get_filename (abfd), name, string);
+ bfd_set_error (bfd_error_invalid_operation);
+ return false;
+ }
if (inh->type == bfd_link_hash_new)
{
inh->type = bfd_link_hash_undefined;