summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--eval.c3
-rw-r--r--labels.c12
-rw-r--r--labels.h6
-rw-r--r--nasm.h8
-rw-r--r--nasmlib.c2
-rw-r--r--output/outaout.c2
-rw-r--r--output/outas86.c2
-rw-r--r--output/outbin.c7
-rw-r--r--output/outcoff.c4
-rw-r--r--output/outelf32.c6
-rw-r--r--output/outelf64.c6
-rw-r--r--output/outieee.c4
-rw-r--r--output/outmacho.c2
-rw-r--r--output/outobj.c4
-rw-r--r--output/outrdf2.c2
15 files changed, 37 insertions, 33 deletions
diff --git a/eval.c b/eval.c
index 3fc9732..e9f6c25 100644
--- a/eval.c
+++ b/eval.c
@@ -666,7 +666,8 @@ static expr *expr6(int critical)
{
int32_t type;
expr *e;
- int32_t label_seg, label_ofs;
+ int32_t label_seg;
+ int64_t label_ofs;
switch (i) {
case '-':
diff --git a/labels.c b/labels.c
index 1fa9fa9..96e4248 100644
--- a/labels.c
+++ b/labels.c
@@ -59,12 +59,14 @@
union label { /* actual label structures */
struct {
- int32_t segment, offset;
+ int32_t segment;
+ int64_t offset;
char *label, *special;
int is_global, is_norm;
} defn;
struct {
- int32_t movingon, dummy;
+ int32_t movingon;
+ int64_t dummy;
union label *next;
} admin;
};
@@ -146,7 +148,7 @@ static union label *find_label(char *label, int create)
return lfree++;
}
-bool lookup_label(char *label, int32_t *segment, int32_t *offset)
+bool lookup_label(char *label, int32_t *segment, int64_t *offset)
{
union label *lptr;
@@ -173,7 +175,7 @@ bool is_extern(char *label)
return (lptr && (lptr->defn.is_global & EXTERN_BIT));
}
-void redefine_label(char *label, int32_t segment, int32_t offset, char *special,
+void redefine_label(char *label, int32_t segment, int64_t offset, char *special,
bool is_norm, bool isextrn, struct ofmt *ofmt,
efunc error)
{
@@ -246,7 +248,7 @@ void redefine_label(char *label, int32_t segment, int32_t offset, char *special,
/* if (pass0 == 1) */
}
-void define_label(char *label, int32_t segment, int32_t offset, char *special,
+void define_label(char *label, int32_t segment, int64_t offset, char *special,
bool is_norm, bool isextrn, struct ofmt *ofmt, efunc error)
{
union label *lptr;
diff --git a/labels.h b/labels.h
index 327fb0f..178b794 100644
--- a/labels.h
+++ b/labels.h
@@ -12,12 +12,12 @@
extern char lprefix[PREFIX_MAX];
extern char lpostfix[PREFIX_MAX];
-bool lookup_label(char *label, int32_t *segment, int32_t *offset);
+bool lookup_label(char *label, int32_t *segment, int64_t *offset);
bool is_extern(char *label);
-void define_label(char *label, int32_t segment, int32_t offset, char *special,
+void define_label(char *label, int32_t segment, int64_t offset, char *special,
bool is_norm, bool isextrn, struct ofmt *ofmt,
efunc error);
-void redefine_label(char *label, int32_t segment, int32_t offset, char *special,
+void redefine_label(char *label, int32_t segment, int64_t offset, char *special,
bool is_norm, bool isextrn, struct ofmt *ofmt,
efunc error);
void define_common(char *label, int32_t segment, int32_t size, char *special,
diff --git a/nasm.h b/nasm.h
index fe18196..42798f1 100644
--- a/nasm.h
+++ b/nasm.h
@@ -60,7 +60,7 @@ struct ofmt;
/*
* A label-lookup function should look like this.
*/
-typedef bool (*lfunc) (char *label, int32_t *segment, int32_t *offset);
+typedef bool (*lfunc) (char *label, int32_t *segment, int64_t *offset);
/*
* And a label-definition function like this. The boolean parameter
@@ -68,7 +68,7 @@ typedef bool (*lfunc) (char *label, int32_t *segment, int32_t *offset);
* should affect the local-label system), or something odder like
* an EQU or a segment-base symbol, which shouldn't.
*/
-typedef void (*ldfunc) (char *label, int32_t segment, int32_t offset,
+typedef void (*ldfunc) (char *label, int32_t segment, int64_t offset,
char *special, bool is_norm, bool isextrn,
struct ofmt * ofmt, efunc error);
@@ -740,7 +740,7 @@ struct ofmt {
* been an EXTERN, a COMMON or a GLOBAL. The distinction should
* be obvious to the output format from the other parameters.
*/
- void (*symdef) (char *name, int32_t segment, int32_t offset,
+ void (*symdef) (char *name, int32_t segment, int64_t offset,
int is_global, char *special);
/*
@@ -887,7 +887,7 @@ struct dfmt {
* would be called before the output format version.
*/
- void (*debug_deflabel) (char *name, int32_t segment, int32_t offset,
+ void (*debug_deflabel) (char *name, int32_t segment, int64_t offset,
int is_global, char *special);
/*
* debug_directive - called whenever a DEBUG directive other than 'LINE'
diff --git a/nasmlib.c b/nasmlib.c
index a1a1af0..f065183 100644
--- a/nasmlib.c
+++ b/nasmlib.c
@@ -896,7 +896,7 @@ void null_debug_linenum(const char *filename, int32_t linenumber, int32_t segto)
(void)linenumber;
(void)segto;
}
-void null_debug_deflabel(char *name, int32_t segment, int32_t offset,
+void null_debug_deflabel(char *name, int32_t segment, int64_t offset,
int is_global, char *special)
{
(void)name;
diff --git a/output/outaout.c b/output/outaout.c
index d3e8b01..dae8d39 100644
--- a/output/outaout.c
+++ b/output/outaout.c
@@ -245,7 +245,7 @@ static int32_t aout_section_names(char *name, int pass, int *bits)
return NO_SEG;
}
-static void aout_deflabel(char *name, int32_t segment, int32_t offset,
+static void aout_deflabel(char *name, int32_t segment, int64_t offset,
int is_global, char *special)
{
int pos = strslen + 4;
diff --git a/output/outas86.c b/output/outas86.c
index 5dbdd41..ddac669 100644
--- a/output/outas86.c
+++ b/output/outas86.c
@@ -173,7 +173,7 @@ static int as86_add_string(char *name)
return pos;
}
-static void as86_deflabel(char *name, int32_t segment, int32_t offset,
+static void as86_deflabel(char *name, int32_t segment, int64_t offset,
int is_global, char *special)
{
struct Symbol *sym;
diff --git a/output/outbin.c b/output/outbin.c
index bf4c44b..bc36610 100644
--- a/output/outbin.c
+++ b/output/outbin.c
@@ -662,7 +662,8 @@ static void bin_cleanup(int debuginfo)
}
/* Display symbols information. */
if (map_control & MAP_SYMBOLS) {
- int32_t segment, offset;
+ int32_t segment;
+ int64_t offset;
fprintf(rf, "-- Symbols ");
for (h = 68; h; h--)
@@ -675,7 +676,7 @@ static void bin_cleanup(int debuginfo)
fprintf(rf, "\n\nValue Name\n");
for (l = no_seg_labels; l; l = l->next) {
lookup_label(l->name, &segment, &offset);
- fprintf(rf, "%08"PRIX32" %s\n", offset, l->name);
+ fprintf(rf, "%08"PRIX64" %s\n", offset, l->name);
}
fprintf(rf, "\n\n");
}
@@ -839,7 +840,7 @@ static void bin_out(int32_t segto, const void *data, uint32_t type,
}
}
-static void bin_deflabel(char *name, int32_t segment, int32_t offset,
+static void bin_deflabel(char *name, int32_t segment, int64_t offset,
int is_global, char *special)
{
(void)segment; /* Don't warn that this parameter is unused */
diff --git a/output/outcoff.c b/output/outcoff.c
index 14c917d..171cd0b 100644
--- a/output/outcoff.c
+++ b/output/outcoff.c
@@ -358,7 +358,7 @@ static int32_t coff_section_names(char *name, int pass, int *bits)
return sects[i]->index;
}
-static void coff_deflabel(char *name, int32_t segment, int32_t offset,
+static void coff_deflabel(char *name, int32_t segment, int64_t offset,
int is_global, char *special)
{
int pos = strslen + 4;
@@ -845,7 +845,7 @@ static void coff_write_symbols(void)
*/
memset(filename, 0, 18); /* useful zeroed buffer */
- for (i = 0; i < nsects; i++) {
+ for (i = 0; i < (uint32_t) nsects; i++) {
coff_symbol(sects[i]->name, 0L, 0L, i + 1, 3, 1);
fwriteint32_t(sects[i]->len, coffp);
fwriteint16_t(sects[i]->nrelocs, coffp);
diff --git a/output/outelf32.c b/output/outelf32.c
index 62f6c37..2652f60 100644
--- a/output/outelf32.c
+++ b/output/outelf32.c
@@ -207,7 +207,7 @@ static struct Symbol *lastsym;
void stabs32_init(struct ofmt *, void *, FILE *, efunc);
void stabs32_linenum(const char *filename, int32_t linenumber, int32_t);
-void stabs32_deflabel(char *, int32_t, int32_t, int, char *);
+void stabs32_deflabel(char *, int32_t, int64_t, int, char *);
void stabs32_directive(const char *, const char *);
void stabs32_typevalue(int32_t);
void stabs32_output(int, void *);
@@ -444,7 +444,7 @@ static int32_t elf_section_names(char *name, int pass, int *bits)
return sects[i]->index;
}
-static void elf_deflabel(char *name, int32_t segment, int32_t offset,
+static void elf_deflabel(char *name, int32_t segment, int64_t offset,
int is_global, char *special)
{
int pos = strslen;
@@ -1375,7 +1375,7 @@ void stabs32_linenum(const char *filename, int32_t linenumber, int32_t segto)
currentline = linenumber;
}
-void stabs32_deflabel(char *name, int32_t segment, int32_t offset, int is_global,
+void stabs32_deflabel(char *name, int32_t segment, int64_t offset, int is_global,
char *special)
{
(void)name;
diff --git a/output/outelf64.c b/output/outelf64.c
index 2ef1de3..d3ca8f9 100644
--- a/output/outelf64.c
+++ b/output/outelf64.c
@@ -218,7 +218,7 @@ static struct Symbol *lastsym;
void stabs64_init(struct ofmt *, void *, FILE *, efunc);
void stabs64_linenum(const char *filename, int32_t linenumber, int32_t);
-void stabs64_deflabel(char *, int32_t, int32_t, int, char *);
+void stabs64_deflabel(char *, int32_t, int64_t, int, char *);
void stabs64_directive(const char *, const char *);
void stabs64_typevalue(int32_t);
void stabs64_output(int, void *);
@@ -456,7 +456,7 @@ static int32_t elf_section_names(char *name, int pass, int *bits)
return sects[i]->index;
}
-static void elf_deflabel(char *name, int32_t segment, int32_t offset,
+static void elf_deflabel(char *name, int32_t segment, int64_t offset,
int is_global, char *special)
{
int pos = strslen;
@@ -1389,7 +1389,7 @@ void stabs64_linenum(const char *filename, int32_t linenumber, int32_t segto)
currentline = linenumber;
}
-void stabs64_deflabel(char *name, int32_t segment, int32_t offset, int is_global,
+void stabs64_deflabel(char *name, int32_t segment, int64_t offset, int is_global,
char *special)
{
(void)name;
diff --git a/output/outieee.c b/output/outieee.c
index 8af3cbe..bb9ce9a 100644
--- a/output/outieee.c
+++ b/output/outieee.c
@@ -255,7 +255,7 @@ static void ieee_cleanup(int debuginfo)
* callback for labels
*/
static void ieee_deflabel(char *name, int32_t segment,
- int32_t offset, int is_global, char *special)
+ int64_t offset, int is_global, char *special)
{
/*
* We have three cases:
@@ -1348,7 +1348,7 @@ static void dbgls_linnum(const char *lnfname, int32_t lineno, int32_t segto)
}
static void dbgls_deflabel(char *name, int32_t segment,
- int32_t offset, int is_global, char *special)
+ int64_t offset, int is_global, char *special)
{
struct ieeeSection *seg;
diff --git a/output/outmacho.c b/output/outmacho.c
index b5be2c6..0eeefe5 100644
--- a/output/outmacho.c
+++ b/output/outmacho.c
@@ -631,7 +631,7 @@ static int32_t macho_section(char *name, int pass, int *bits)
return NO_SEG;
}
-static void macho_symdef(char *name, int32_t section, int32_t offset,
+static void macho_symdef(char *name, int32_t section, int64_t offset,
int is_global, char *special)
{
struct symbol *sym;
diff --git a/output/outobj.c b/output/outobj.c
index a39b4ff..6463d65 100644
--- a/output/outobj.c
+++ b/output/outobj.c
@@ -726,7 +726,7 @@ static void obj_ext_set_defwrt(struct External *ext, char *id)
}
static void obj_deflabel(char *name, int32_t segment,
- int32_t offset, int is_global, char *special)
+ int64_t offset, int is_global, char *special)
{
/*
* We have three cases:
@@ -2407,7 +2407,7 @@ static void dbgbi_linnum(const char *lnfname, int32_t lineno, int32_t segto)
}
static void dbgbi_deflabel(char *name, int32_t segment,
- int32_t offset, int is_global, char *special)
+ int64_t offset, int is_global, char *special)
{
struct Segment *seg;
diff --git a/output/outrdf2.c b/output/outrdf2.c
index a53282a..0122ff7 100644
--- a/output/outrdf2.c
+++ b/output/outrdf2.c
@@ -353,7 +353,7 @@ static void write_modname_rec(struct ModRec *r)
/*
* Handle export, import and common records.
*/
-static void rdf2_deflabel(char *name, int32_t segment, int32_t offset,
+static void rdf2_deflabel(char *name, int32_t segment, int64_t offset,
int is_global, char *special)
{
struct ExportRec r;