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>
This commit is contained in:
H. Peter Anvin 2018-06-14 16:42:03 -07:00
parent e39202c96a
commit 13587802fe
3 changed files with 0 additions and 21 deletions

View File

@ -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);

View File

@ -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)
{

View File

@ -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);
/*