diff options
author | H. Peter Anvin <hpa@linux.intel.com> | 2018-06-14 16:42:03 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@linux.intel.com> | 2018-06-14 16:42:03 -0700 |
commit | 13587802fe602556abe5c00b7a236bfbdd98a337 (patch) | |
tree | df52ce1a03c9e6c5b1f2eb6b9bc437e5133e0dc0 | |
parent | e39202c96acd5214acfd2588cb60029cd380c866 (diff) | |
download | nasm-13587802fe602556abe5c00b7a236bfbdd98a337.tar.gz |
segalloc: DO NOT reset segment numbers
We are not supposed to reset the segment numbers; this was an
attempted fix for a convergence bug that didn't actually exist. The
backend is required to return the same segment number for the same
segment; if it does not, the front end will not converge, but that is
in fact the correct behavior.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
-rw-r--r-- | asm/nasm.c | 4 | ||||
-rw-r--r-- | asm/segalloc.c | 15 | ||||
-rw-r--r-- | include/nasmlib.h | 2 |
3 files changed, 0 insertions, 21 deletions
@@ -1390,9 +1390,6 @@ static void assemble_file(const char *fname, StrList **depend_ptr) break; } - /* Any segment numbers allocated before this point are permanent */ - seg_alloc_setup_done(); - prev_offset_changed = nasm_limit[LIMIT_PASSES]; for (passn = 1; pass0 <= 2; passn++) { pass1 = pass0 == 2 ? 2 : 1; /* 1, 1, 1, ..., 1, 2 */ @@ -1409,7 +1406,6 @@ static void assemble_file(const char *fname, StrList **depend_ptr) } in_absolute = false; global_offset_changed = 0; /* set by redefine_label */ - seg_alloc_reset(); if (passn > 1) { saa_rewind(forwrefs); forwref = saa_rstruct(forwrefs); diff --git a/asm/segalloc.c b/asm/segalloc.c index 56544b42..6d7a4202 100644 --- a/asm/segalloc.c +++ b/asm/segalloc.c @@ -41,21 +41,6 @@ #include "insns.h" static int32_t next_seg = 2; -static int32_t seg_start = 2; - -void seg_alloc_reset(void) -{ - next_seg = seg_start; -} - -/* - * This gets called after special segments are allocated, typically by - * backends; this only gets done once. - */ -void seg_alloc_setup_done(void) -{ - seg_start = next_seg; -} int32_t seg_alloc(void) { diff --git a/include/nasmlib.h b/include/nasmlib.h index f25ef827..e57d0e6d 100644 --- a/include/nasmlib.h +++ b/include/nasmlib.h @@ -193,8 +193,6 @@ int64_t readstrnum(char *str, int length, bool *warn); /* * seg_alloc: allocate a hitherto unused segment number. */ -void seg_alloc_reset(void); -void seg_alloc_setup_done(void); int32_t seg_alloc(void); /* |