From c1905c21698642fa94f5887745ecf0336b15ee8c Mon Sep 17 00:00:00 2001 From: Charles Crayne Date: Thu, 11 Sep 2008 18:54:06 -0700 Subject: Halt assembly if addresses are not converging. Change global_offset_changed from bool to int so that progress of convergence can be monitored. If change count does not decrease from previous pass, increment stall counter. If stall count reaches threshold, terminate assembly with error message. --- labels.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'labels.c') diff --git a/labels.c b/labels.c index 068d758..b7a1b44 100644 --- a/labels.c +++ b/labels.c @@ -77,7 +77,7 @@ struct permts { /* permanent text storage */ char data[PERMTS_SIZE]; /* ... the data block itself */ }; -extern bool global_offset_changed; /* defined in nasm.c */ +extern int64_t global_offset_changed; /* defined in nasm.c */ static struct hash_table ltab; /* labels hash table */ static union label *ldata; /* all label data blocks */ @@ -209,7 +209,7 @@ void redefine_label(char *label, int32_t segment, int64_t offset, char *special, prevlabel = lptr->defn.label; } - global_offset_changed |= (lptr->defn.offset != offset); + if (lptr->defn.offset != offset) global_offset_changed++; lptr->defn.offset = offset; lptr->defn.segment = segment; -- cgit v1.2.3