mirror of
https://github.com/netwide-assembler/nasm.git
synced 2025-01-18 16:25:05 +08:00
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:
parent
e39202c96a
commit
13587802fe
@ -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);
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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);
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user