summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/binutils/gas/config/obj-aout.c
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/usr.bin/binutils/gas/config/obj-aout.c')
-rw-r--r--gnu/usr.bin/binutils/gas/config/obj-aout.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gnu/usr.bin/binutils/gas/config/obj-aout.c b/gnu/usr.bin/binutils/gas/config/obj-aout.c
index d4d8ee394f7..0a090295e04 100644
--- a/gnu/usr.bin/binutils/gas/config/obj-aout.c
+++ b/gnu/usr.bin/binutils/gas/config/obj-aout.c
@@ -239,6 +239,18 @@ obj_emit_relocations (where, fixP, segment_address_in_file)
sym = sym->sy_value.X_add_symbol;
fixP->fx_addsy = sym;
+ if (! sym->sy_resolved && ! S_IS_DEFINED (sym))
+ {
+ char *file;
+ unsigned int line;
+
+ if (expr_symbol_where (sym, &file, &line))
+ as_bad_where (file, line, "unresolved relocation");
+ else
+ as_bad ("bad relocation: symbol `%s' not in symbol table",
+ S_GET_NAME (sym));
+ }
+
tc_aout_fix_to_chars (*where, fixP, segment_address_in_file);
*where += md_reloc_size;
}