summaryrefslogtreecommitdiff
path: root/asm/segalloc.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@linux.intel.com>2018-06-01 18:02:54 -0700
committerH. Peter Anvin <hpa@linux.intel.com>2018-06-01 18:06:25 -0700
commit98578071b9d71ecaa2344dd9c185237c1765041e (patch)
tree74dfdf8b0f587364f34ae804dc7ce0cd7d81ba7e /asm/segalloc.c
parent8413e8167a21a922bbf99660165bb091e71bf1c0 (diff)
downloadnasm-98578071b9d71ecaa2344dd9c185237c1765041e.tar.gz
Cleanup of label renaming infrastructure, add subsection support
In order to support Mach-O better, add support for subsections, as used by Mach-O "subsections_via_symbols". We also want to add infrastructure to support this by downcalling to the backend to indicate if a new subsection is needed. Currently this supports a maximum of 2^14 subsections per section for Mach-O; this can be addressed by adding a level of indirection (or cleaning up the handling of sections so we have an actual data structure.) Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'asm/segalloc.c')
-rw-r--r--asm/segalloc.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/asm/segalloc.c b/asm/segalloc.c
index e81f919d..5b4ea4bb 100644
--- a/asm/segalloc.c
+++ b/asm/segalloc.c
@@ -40,10 +40,10 @@
#include "nasmlib.h"
#include "insns.h"
-static int32_t next_seg = 0;
+static int32_t next_seg = 2;
void seg_alloc_reset(void)
{
- next_seg = 0;
+ next_seg = 2;
}
int32_t seg_alloc(void)
@@ -51,6 +51,5 @@ int32_t seg_alloc(void)
int32_t this_seg = next_seg;
next_seg += 2;
-
return this_seg;
}