summaryrefslogtreecommitdiff
path: root/nasm.h
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2016-10-04 06:29:25 -0700
committerH. Peter Anvin <hpa@zytor.com>2016-10-04 06:29:25 -0700
commit80cc2029d31f4a7f1cd4334b9cfaf9556f0163ce (patch)
treeb88e4a600398ab7d2c8763ff288d01a43fb26036 /nasm.h
parent439875c1d9773df06cabbe9611f7a67c88f58847 (diff)
downloadnasm-reldef.tar.gz
Make it possible to generate PC-relative relocations in datareldef
Allow expressions such as: dd bar - $ ... where "bar" is a symbol external to the segment. Currently this is only supported for the Dx instructions; extending it to inline immediates requires additional changes to the parser. This may, however, be sufficient for the needs of some users. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'nasm.h')
-rw-r--r--nasm.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/nasm.h b/nasm.h
index 663cc21e..0c6478f5 100644
--- a/nasm.h
+++ b/nasm.h
@@ -1,5 +1,5 @@
/* ----------------------------------------------------------------------- *
- *
+ *
* Copyright 1996-2016 The NASM Authors - All Rights Reserved
* See the file AUTHORS included with the NASM distribution for
* the specific copyright holders.
@@ -14,7 +14,7 @@
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
@@ -31,7 +31,7 @@
*
* ----------------------------------------------------------------------- */
-/*
+/*
* nasm.h main header file for the Netwide Assembler: inter-module interface
*/
@@ -546,6 +546,7 @@ typedef struct operand { /* operand to an instruction */
int32_t segment; /* immediate segment, if needed */
int64_t offset; /* any immediate number */
int32_t wrt; /* segment base it's relative to */
+ bool relative; /* self-relative expression */
int eaflags; /* special EA flags */
int opflags; /* see OPFLAG_* defines below */
decoflags_t decoflags; /* decorator flags such as {...} */
@@ -553,7 +554,7 @@ typedef struct operand { /* operand to an instruction */
#define OPFLAG_FORWARD 1 /* operand is a forward reference */
#define OPFLAG_EXTERN 2 /* operand is an external reference */
-#define OPFLAG_UNKNOWN 4 /* operand is an unknown reference
+#define OPFLAG_UNKNOWN 4 /* operand is an unknown reference
* (always a forward reference also)
*/
@@ -564,6 +565,7 @@ typedef struct extop { /* extended operand */
int64_t offset; /* ... it's given here ... */
int32_t segment; /* if it's a number/address, then... */
int32_t wrt; /* ... and here */
+ bool relative; /* self-relative expression */
enum extop_type type; /* defined above */
} extop;
@@ -678,7 +680,7 @@ struct ofmt {
/*
* Output format flags.
*/
-#define OFMT_TEXT 1 /* Text file format */
+#define OFMT_TEXT 1 /* Text file format */
unsigned int flags;
int maxbits; /* Maximum segment bits supported */