diff options
author | Charles Crayne <chuck@thor.crayne.org> | 2008-09-11 18:54:06 -0700 |
---|---|---|
committer | Charles Crayne <chuck@thor.crayne.org> | 2008-09-11 18:54:06 -0700 |
commit | c1905c21698642fa94f5887745ecf0336b15ee8c (patch) | |
tree | d4fe8d13bfb57458fedb190d42ae75680c90b64f /labels.c | |
parent | 4252823e95bb365e704cdd8ae526d2daf01a6533 (diff) | |
download | nasm-c1905c21698642fa94f5887745ecf0336b15ee8c.tar.gz nasm-c1905c21698642fa94f5887745ecf0336b15ee8c.tar.bz2 nasm-c1905c21698642fa94f5887745ecf0336b15ee8c.zip |
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.
Diffstat (limited to 'labels.c')
-rw-r--r-- | labels.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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; |