summaryrefslogtreecommitdiff
path: root/output
diff options
context:
space:
mode:
authorCyrill Gorcunov <gorcunov@gmail.com>2010-04-22 22:32:17 +0400
committerCyrill Gorcunov <gorcunov@gmail.com>2010-04-22 22:32:17 +0400
commitbb196d4fd31f147c177e5ed28b9ad82718248daa (patch)
tree2923d4be792f1b2a228f42e55abda0e3c2a9692e /output
parent4c45e83aacbda260ef582ec584649589eb7b62f5 (diff)
downloadnasm-bb196d4fd31f147c177e5ed28b9ad82718248daa.tar.gz
outbin: Drop current_section variable
There is no need for it anymore. Reported-by: "H. Peter Anvin" <hpa@linux.intel.com> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Diffstat (limited to 'output')
-rw-r--r--output/outbin.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/output/outbin.c b/output/outbin.c
index 2492c098..dca7721c 100644
--- a/output/outbin.c
+++ b/output/outbin.c
@@ -152,7 +152,6 @@ static struct Reloc {
struct Section *target;
} *relocs, **reloctail;
-static int32_t current_section;
static uint64_t origin;
static int origin_defined;
@@ -1242,8 +1241,7 @@ static int32_t bin_secname(char *name, int pass, int *bits)
*bits = 16;
sec = find_section_by_name(".text");
sec->flags |= TYPE_DEFINED | TYPE_PROGBITS;
- current_section = sec->vstart_index;
- return current_section;
+ return sec->vstart_index;
}
/* Attempt to find the requested section. If it does not
@@ -1276,9 +1274,7 @@ static int32_t bin_secname(char *name, int pass, int *bits)
sec->flags |= TYPE_DEFINED | TYPE_PROGBITS;
#endif
- /* Set the current section and return. */
- current_section = sec->vstart_index;
- return current_section;
+ return sec->vstart_index;
}
static int bin_directive(enum directives directive, char *args, int pass)
@@ -1444,7 +1440,7 @@ static void binfmt_init(void)
last_section->labels = NULL;
last_section->labels_end = &(last_section->labels);
last_section->start_index = seg_alloc();
- last_section->vstart_index = current_section = seg_alloc();
+ last_section->vstart_index = seg_alloc();
}
/* Generate binary file output */