summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES1
-rw-r--r--assemble.c13
2 files changed, 12 insertions, 2 deletions
diff --git a/CHANGES b/CHANGES
index 1684a6cf..b508ca60 100644
--- a/CHANGES
+++ b/CHANGES
@@ -7,6 +7,7 @@
* Fix the STR instruction.
* Fix the ELF output format, which was broken under certain
circumstances due to the addition of stabs support.
+* Quick-fix Borland format debug-info for -f obj
0.98.37
-------
diff --git a/assemble.c b/assemble.c
index 160e6713..5cfc9457 100644
--- a/assemble.c
+++ b/assemble.c
@@ -105,8 +105,8 @@ static int chsize (operand *, int);
static void out (long offset, long segto, const void *data, unsigned long type,
long segment, long wrt)
{
- long lineno;
- char *lnfname = NULL;
+ static long lineno = 0; /* static!!! */
+ static char *lnfname = NULL;
if ((type & OUT_TYPMASK) == OUT_ADDRESS) {
if (segment != NO_SEG || wrt != NO_SEG) {
@@ -143,6 +143,15 @@ static void out (long offset, long segto, const void *data, unsigned long type,
list->output (offset, data, type);
}
+ /*
+ * this call to src_get determines when we call the
+ * debug-format-specific "linenum" function
+ * it updates lineno and lnfname to the current values
+ * returning 0 if "same as last time", -2 if lnfname
+ * changed, and the amount by which lineno changed,
+ * if it did. thus, these variables must be static
+ */
+
if (src_get(&lineno,&lnfname))
{
outfmt->current_dfmt->linenum(lnfname,lineno,segto);