diff options
author | Ian Lance Taylor <ian@airs.com> | 1999-09-12 02:39:52 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 1999-09-12 02:39:52 +0000 |
commit | 28428223eb4e69d95528a6ce78cf47fc001a2137 (patch) | |
tree | 267ab9b813bf29405973806ded2a2cac489bc5e4 | |
parent | e8a3ab752debe9a6a1d15c75950950bc9a1ef024 (diff) | |
download | gdb-28428223eb4e69d95528a6ce78cf47fc001a2137.zip gdb-28428223eb4e69d95528a6ce78cf47fc001a2137.tar.gz gdb-28428223eb4e69d95528a6ce78cf47fc001a2137.tar.bz2 |
1999-09-11 Donn Terry <donn@interix.com>
* config/obj-coff.c (obj_coff_loc): New static function.
(obj_pseudo_table): Add "loc".
-rw-r--r-- | gas/ChangeLog | 3 | ||||
-rw-r--r-- | gas/config/obj-coff.c | 55 |
2 files changed, 58 insertions, 0 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index 3650223..29ba1db 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -5,6 +5,9 @@ 1999-09-11 Donn Terry <donn@interix.com> + * config/obj-coff.c (obj_coff_loc): New static function. + (obj_pseudo_table): Add "loc". + * config/obj-coff.c (add_lineno): Check that the line number is positive. diff --git a/gas/config/obj-coff.c b/gas/config/obj-coff.c index b06710a..b488cdf 100644 --- a/gas/config/obj-coff.c +++ b/gas/config/obj-coff.c @@ -42,6 +42,9 @@ static void obj_coff_scl PARAMS ((int)); static void obj_coff_tag PARAMS ((int)); static void obj_coff_val PARAMS ((int)); static void obj_coff_type PARAMS ((int)); +#ifdef BFD_ASSEMBLER +static void obj_coff_loc PARAMS((int)); +#endif /* This is used to hold the symbol built by a sequence of pseudo-ops from .def and .endef. */ @@ -500,6 +503,55 @@ obj_coff_ln (appline) demand_empty_rest_of_line (); } +/* .loc is essentially the same as .ln; parse it for assembler + compatibility. */ + +static void +obj_coff_loc (ignore) + int ignore ATTRIBUTE_UNUSED; +{ + int lineno; + + /* FIXME: Why do we need this check? We need it for ECOFF, but why + do we need it for COFF? */ + if (now_seg != text_section) + { + as_warn (_(".loc outside of .text")); + demand_empty_rest_of_line (); + return; + } + + if (def_symbol_in_progress != NULL) + { + as_warn (_(".loc pseudo-op inside .def/.endef: ignored.")); + demand_empty_rest_of_line (); + return; + } + + /* Skip the file number. */ + SKIP_WHITESPACE (); + get_absolute_expression (); + SKIP_WHITESPACE (); + + lineno = get_absolute_expression (); + +#ifndef NO_LISTING + { + extern int listing; + + if (listing) + { + lineno += coff_line_base - 1; + listing_source_line (lineno); + } + } +#endif + + demand_empty_rest_of_line (); + + add_lineno (frag_now, frag_now_fix (), lineno); +} + /* * def() * @@ -4419,6 +4471,9 @@ const pseudo_typeS obj_pseudo_table[] = {"endef", obj_coff_endef, 0}, {"line", obj_coff_line, 0}, {"ln", obj_coff_ln, 0}, +#ifdef BFD_ASSEMBLER + {"loc", obj_coff_loc, 0}, +#endif {"appline", obj_coff_ln, 1}, {"scl", obj_coff_scl, 0}, {"size", obj_coff_size, 0}, |