diff options
author | Steve Chamberlain <sac@cygnus> | 1992-01-28 03:43:23 +0000 |
---|---|---|
committer | Steve Chamberlain <sac@cygnus> | 1992-01-28 03:43:23 +0000 |
commit | 9ce31b6601d834bfddcbfff16c187a5fd3a6e498 (patch) | |
tree | 11c25171584a94d6638c6be32b1b5f520eea36f3 /gas/config | |
parent | fa4b55a1b125d9076dee21f26512bfb8b3e8a5fa (diff) | |
download | gdb-9ce31b6601d834bfddcbfff16c187a5fd3a6e498.zip gdb-9ce31b6601d834bfddcbfff16c187a5fd3a6e498.tar.gz gdb-9ce31b6601d834bfddcbfff16c187a5fd3a6e498.tar.bz2 |
obj-coff* now copes with C mingled listings
tc-h8300.c: better error messages
Diffstat (limited to 'gas/config')
-rw-r--r-- | gas/config/obj-coffbfd.c | 91 | ||||
-rw-r--r-- | gas/config/obj-coffbfd.h | 3 |
2 files changed, 70 insertions, 24 deletions
diff --git a/gas/config/obj-coffbfd.c b/gas/config/obj-coffbfd.c index 07ec33b..37f95b7 100644 --- a/gas/config/obj-coffbfd.c +++ b/gas/config/obj-coffbfd.c @@ -89,6 +89,7 @@ int text_lineno_number = 0; */ static symbolS *previous_file_symbol = NULL; void c_symbol_merge(); +static int line_base; symbolS *c_section_symbol(); bfd *abfd; @@ -679,21 +680,34 @@ stack* st; * Handle .ln directives. */ -static void obj_coff_ln() { - if (def_symbol_in_progress != NULL) { - as_warn(".ln pseudo-op inside .def/.endef: ignored."); - demand_empty_rest_of_line(); - return; - } /* wrong context */ - - c_line_new(0, - obstack_next_free(&frags) - frag_now->fr_literal, - get_absolute_expression(), - frag_now); +static void obj_coff_ln() +{ + int l; + + if (def_symbol_in_progress != NULL) { + as_warn(".ln pseudo-op inside .def/.endef: ignored."); + demand_empty_rest_of_line(); + return; + } /* wrong context */ - demand_empty_rest_of_line(); - return; -} /* obj_coff_line() */ + c_line_new(0, + obstack_next_free(&frags) - frag_now->fr_literal, + l = get_absolute_expression(), + frag_now); +#ifndef NO_LISTING +{ + extern int listing; + + if (listing) + { + listing_source_line(l + line_base - 1); + } + +} +#endif + demand_empty_rest_of_line(); + return; +} /* obj_coff_line() */ /* * def() @@ -962,18 +976,36 @@ DEFUN_VOID(obj_coff_dim) return; } /* obj_coff_dim() */ -static void obj_coff_line() { - if (def_symbol_in_progress == NULL) { - obj_coff_ln(); - return; - } /* if it looks like a stabs style line */ +static void obj_coff_line() +{ + int this_base; + + if (def_symbol_in_progress == NULL) { + obj_coff_ln(); + return; + } /* if it looks like a stabs style line */ - S_SET_NUMBER_AUXILIARY(def_symbol_in_progress, 1); - SA_SET_SYM_LNNO(def_symbol_in_progress, get_absolute_expression()); + this_base = get_absolute_expression(); + if (this_base > line_base) + { + line_base = this_base; + } + + +#ifndef NO_LISTING +{ + extern int listing; + if (listing && 0) { + listing_source_line(line_base); + } +} +#endif + S_SET_NUMBER_AUXILIARY(def_symbol_in_progress, 1); + SA_SET_SYM_LNNO(def_symbol_in_progress, line_base); - demand_empty_rest_of_line(); - return; -} /* obj_coff_line() */ + demand_empty_rest_of_line(); + return; +} /* obj_coff_line() */ static void obj_coff_size() { if (def_symbol_in_progress == NULL) { @@ -1816,6 +1848,17 @@ char *filename; S_SET_STORAGE_CLASS(symbolP, C_FILE); S_SET_NUMBER_AUXILIARY(symbolP, 1); SA_SET_FILE_FNAME(symbolP, filename); +#ifndef NO_LISTING + { + extern int listing; + if (listing) + { + listing_source_file(filename); + } + + } + +#endif SF_SET_DEBUG(symbolP); S_SET_VALUE(symbolP, (long) previous_file_symbol); diff --git a/gas/config/obj-coffbfd.h b/gas/config/obj-coffbfd.h index 7a53663..5527181 100644 --- a/gas/config/obj-coffbfd.h +++ b/gas/config/obj-coffbfd.h @@ -1,3 +1,5 @@ +#ifndef OBJ_FORMAT_H +#define OBJ_FORMAT_H /* coff object file format Copyright (C) 1989, 1990, 1991 Free Software Foundation, Inc. @@ -511,3 +513,4 @@ extern SCNHDR text_section_header; */ /* end of obj-coff.h */ +#endif |