output/outdbg.$(O): output/outdbg.c compiler.h config.h insnsi.h nasm.h \
nasmlib.h outform.h regs.h version.h
output/outelf32.$(O): output/outelf32.c compiler.h config.h insnsi.h nasm.h \
- nasmlib.h outform.h regs.h stdscan.h version.h
+ nasmlib.h outform.h regs.h stdscan.h version.h wsaa.h
output/outelf64.$(O): output/outelf64.c compiler.h config.h insnsi.h nasm.h \
- nasmlib.h outform.h regs.h stdscan.h version.h
+ nasmlib.h outform.h regs.h stdscan.h version.h wsaa.h
output/outieee.$(O): output/outieee.c compiler.h config.h insnsi.h nasm.h \
nasmlib.h outform.h regs.h version.h
output/outmacho.$(O): output/outmacho.c compiler.h config.h insnsi.h nasm.h \
output/outdbg.$(O): output/outdbg.c compiler.h insnsi.h nasm.h nasmlib.h \
outform.h regs.h version.h
output/outelf32.$(O): output/outelf32.c compiler.h insnsi.h nasm.h nasmlib.h \
- outform.h regs.h stdscan.h version.h
+ outform.h regs.h stdscan.h version.h wsaa.h
output/outelf64.$(O): output/outelf64.c compiler.h insnsi.h nasm.h nasmlib.h \
- outform.h regs.h stdscan.h version.h
+ outform.h regs.h stdscan.h version.h wsaa.h
output/outieee.$(O): output/outieee.c compiler.h insnsi.h nasm.h nasmlib.h \
outform.h regs.h version.h
output/outmacho.$(O): output/outmacho.c compiler.h insnsi.h nasm.h nasmlib.h \
output/outdbg.o: output/outdbg.c compiler.h config.h insnsi.h nasm.h \
nasmlib.h outform.h regs.h version.h
output/outelf32.o: output/outelf32.c compiler.h config.h insnsi.h nasm.h \
- nasmlib.h outform.h regs.h stdscan.h version.h
+ nasmlib.h outform.h regs.h stdscan.h version.h wsaa.h
output/outelf64.o: output/outelf64.c compiler.h config.h insnsi.h nasm.h \
- nasmlib.h outform.h regs.h stdscan.h version.h
+ nasmlib.h outform.h regs.h stdscan.h version.h wsaa.h
output/outieee.o: output/outieee.c compiler.h config.h insnsi.h nasm.h \
nasmlib.h outform.h regs.h version.h
output/outmacho.o: output/outmacho.c compiler.h config.h insnsi.h nasm.h \
output\outdbg.$(O): output\outdbg.c compiler.h insnsi.h nasm.h nasmlib.h &
outform.h regs.h version.h
output\outelf32.$(O): output\outelf32.c compiler.h insnsi.h nasm.h nasmlib.h &
- outform.h regs.h stdscan.h version.h
+ outform.h regs.h stdscan.h version.h wsaa.h
output\outelf64.$(O): output\outelf64.c compiler.h insnsi.h nasm.h nasmlib.h &
- outform.h regs.h stdscan.h version.h
+ outform.h regs.h stdscan.h version.h wsaa.h
output\outieee.$(O): output\outieee.c compiler.h insnsi.h nasm.h nasmlib.h &
outform.h regs.h version.h
output\outmacho.$(O): output\outmacho.c compiler.h insnsi.h nasm.h nasmlib.h &
output/outdbg.$(O): output/outdbg.c compiler.h insnsi.h nasm.h nasmlib.h \
outform.h regs.h version.h
output/outelf32.$(O): output/outelf32.c compiler.h insnsi.h nasm.h nasmlib.h \
- outform.h regs.h stdscan.h version.h
+ outform.h regs.h stdscan.h version.h wsaa.h
output/outelf64.$(O): output/outelf64.c compiler.h insnsi.h nasm.h nasmlib.h \
- outform.h regs.h stdscan.h version.h
+ outform.h regs.h stdscan.h version.h wsaa.h
output/outieee.$(O): output/outieee.c compiler.h insnsi.h nasm.h nasmlib.h \
outform.h regs.h version.h
output/outmacho.$(O): output/outmacho.c compiler.h insnsi.h nasm.h nasmlib.h \
#define WRITEADDR(p,v,s) \
do { \
- uint64_t _v = (v); \
- memcpy((p), &_v, (s)); \
+ uint64_t _wa_v = (v); \
+ memcpy((p), &_wa_v, (s)); \
(p) += (s); \
} while (0)
#define WRITECHAR(p,v) \
do { \
- uint8_t *_p = (uint8_t *)(p); \
- uint8_t _v = (v); \
- _p[0] = _v; \
- (p) = (void *)(_p + 1); \
+ uint8_t *_wc_p = (uint8_t *)(p); \
+ uint8_t _wc_v = (v); \
+ _wc_p[0] = _wc_v; \
+ (p) = (void *)(_wc_p + 1); \
} while (0)
#define WRITESHORT(p,v) \
do { \
- uint8_t *_p = (uint8_t *)(p); \
- uint16_t _v = (v); \
- _p[0] = _v; \
- _p[1] = _v >> 8; \
- (p) = (void *)(_p + 2); \
+ uint8_t *_ws_p = (uint8_t *)(p); \
+ uint16_t _ws_v = (v); \
+ _ws_p[0] = _ws_v; \
+ _ws_p[1] = _ws_v >> 8; \
+ (p) = (void *)(_ws_p + 2); \
} while (0)
#define WRITELONG(p,v) \
do { \
- uint8_t *_p = (uint8_t *)(p); \
- uint32_t _v = (v); \
- _p[0] = _v; \
- _p[1] = _v >> 8; \
- _p[2] = _v >> 16; \
- _p[3] = _v >> 24; \
- (p) = (void *)(_p + 4); \
+ uint8_t *_wl_p = (uint8_t *)(p); \
+ uint32_t _wl_v = (v); \
+ _wl_p[0] = _wl_v; \
+ _wl_p[1] = _wl_v >> 8; \
+ _wl_p[2] = _wl_v >> 16; \
+ _wl_p[3] = _wl_v >> 24; \
+ (p) = (void *)(_wl_p + 4); \
} while (0)
#define WRITEDLONG(p,v) \
do { \
- uint8_t *_p = (uint8_t *)(p); \
- uint64_t _v = (v); \
- _p[0] = _v; \
- _p[1] = _v >> 8; \
- _p[2] = _v >> 16; \
- _p[3] = _v >> 24; \
- _p[4] = _v >> 32; \
- _p[5] = _v >> 40; \
- _p[6] = _v >> 48; \
- _p[7] = _v >> 56; \
- (p) = (void *)(_p + 8); \
+ uint8_t *_wq_p = (uint8_t *)(p); \
+ uint64_t _wq_v = (v); \
+ _wq_p[0] = _wq_v; \
+ _wq_p[1] = _wq_v >> 8; \
+ _wq_p[2] = _wq_v >> 16; \
+ _wq_p[3] = _wq_v >> 24; \
+ _wq_p[4] = _wq_v >> 32; \
+ _wq_p[5] = _wq_v >> 40; \
+ _wq_p[6] = _wq_v >> 48; \
+ _wq_p[7] = _wq_v >> 56; \
+ (p) = (void *)(_wq_p + 8); \
} while (0)
#define WRITEADDR(p,v,s) \
do { \
- int _s = (s); \
- uint64_t _v = (v); \
- while (_s--) { \
- WRITECHAR(p,_v); \
- _v >>= 8; \
+ int _wa_s = (s); \
+ uint64_t _wa_v = (v); \
+ while (_wa_s--) { \
+ WRITECHAR(p,_wa_v); \
+ _wa_v >>= 8; \
} \
} while(0)
#include "nasmlib.h"
#include "stdscan.h"
#include "outform.h"
+#include "wsaa.h"
#ifdef OF_ELF32
#define DW_LANG_Mips_Assembler 0x8001
#define SOC(ln,aa) ln - line_base + (line_range * aa) + opcode_base
-#if X86_MEMORY
-
-#define WSAACHAR(s,p,v) \
- do { \
- *(uint8_t *)(p) = (v); \
- saa_wbytes(s, p, 1); \
- } while (0)
-
-#define WSAASHORT(s,p,v) \
- do { \
- *(uint16_t *)(p) = (v); \
- saa_wbytes(s, p, 2); \
- } while (0)
-
-#define WSAALONG(s,p,v) \
- do { \
- *(uint32_t *)(p) = (v); \
- saa_wbytes(s, p, 4); \
- } while (0)
-
-#else /* !X86_MEMORY */
-
-#define WSAACHAR(s,p,v) \
- do { \
- *(uint8_t *)p = (v); \
- saa_wbytes(s, p, 1); \
- } while (0)
-
-#define WSAASHORT(s,p,v) \
- do { \
- uint16_t _v = (v); \
- uint8_t *_p = (uint8_t *)(p); \
- _p[0] = _v; \
- _p[1] = _v >> 8; \
- saa_wbytes(s, _p, 2); \
- } while (0)
-
-#define WSAALONG(s,p,v) \
- do { \
- uint32_t _v = (v); \
- uint8_t *_p = (uint8_t *)(p); \
- _p[0] = _v; \
- _p[1] = _v >> 8; \
- _p[2] = _v >> 16; \
- _p[3] = _v >> 24; \
- saa_wbytes(s, _p, 4); \
- } while (0)
-#endif
static const char align_str[SEG_ALIGN] = ""; /* ANSI will pad this with 0s */
static struct ELF_SECTDATA {
return 0;
}
static struct dfmt df_dwarf = {
- "elf32 (i386) dwarf debug format for Linux",
+ "elf32 (X86_64) dwarf debug format for Linux",
"dwarf",
debug32_init,
dwarf32_linenum,
#include "nasmlib.h"
#include "stdscan.h"
#include "outform.h"
+#include "wsaa.h"
/* Definitions in lieu of elf.h */
#define SHT_NULL 0 /* Inactive section header */
#define DW_LANG_Mips_Assembler 0x8001
#define SOC(ln,aa) ln - line_base + (line_range * aa) + opcode_base
-#if X86_MEMORY
-
-#define WSAACHAR(s,p,v) \
- do { \
- *(uint8_t *)(p) = (v); \
- saa_wbytes(s, p, 1); \
- } while (0)
-
-#define WSAASHORT(s,p,v) \
- do { \
- *(uint16_t *)(p) = (v); \
- saa_wbytes(s, p, 2); \
- } while (0)
-
-#define WSAALONG(s,p,v) \
- do { \
- *(uint32_t *)(p) = (v); \
- saa_wbytes(s, p, 4); \
- } while (0)
-
-#define WSAADLONG(s,p,v) \
- do { \
- *(uint64_t *)(p) = (v); \
- saa_wbytes(s, p, 8); \
- } while (0)
-
-#else /* !X86_MEMORY */
-
-#define WSAACHAR(s,p,v) \
- do { \
- *(uint8_t *)p = (v); \
- saa_wbytes(s, p, 1); \
- } while (0)
-
-#define WSAASHORT(s,p,v) \
- do { \
- uint16_t _v = (v); \
- uint8_t *_p = (uint8_t *)(p); \
- _p[0] = _v; \
- _p[1] = _v >> 8; \
- saa_wbytes(s, _p, 2); \
- } while (0)
-
-#define WSAALONG(s,p,v) \
- do { \
- uint32_t _v = (v); \
- uint8_t *_p = (uint8_t *)(p); \
- _p[0] = _v; \
- _p[1] = _v >> 8; \
- _p[2] = _v >> 16; \
- _p[3] = _v >> 24; \
- saa_wbytes(s, _p, 4); \
- } while (0)
-
-#define WSAADLONG(s,p,v) \
- do { \
- uint64_t _v = (v); \
- uint8_t *_p = (uint8_t *)(p); \
- _p[0] = _v; \
- _p[1] = _v >> 8; \
- _p[2] = _v >> 16; \
- _p[3] = _v >> 24; \
- _p[4] = _v >> 32; \
- _p[5] = _v >> 40; \
- _p[6] = _v >> 48; \
- _p[7] = _v >> 56; \
- saa_wbytes(s, _p, 8); \
- } while (0)
-
-#endif
typedef uint32_t Elf64_Word;
typedef uint64_t Elf64_Xword;
--- /dev/null
+#ifndef NASM_WSAA_H
+#define NASM_WSAA_H
+
+#include "compiler.h"
+#include "nasmlib.h"
+
+#if X86_MEMORY
+
+#define WSAACHAR(s,p,v) \
+ do { \
+ *(uint8_t *)(p) = (v); \
+ saa_wbytes(s, p, 1); \
+ } while (0)
+
+#define WSAASHORT(s,p,v) \
+ do { \
+ *(uint16_t *)(p) = (v); \
+ saa_wbytes(s, p, 2); \
+ } while (0)
+
+#define WSAALONG(s,p,v) \
+ do { \
+ *(uint32_t *)(p) = (v); \
+ saa_wbytes(s, p, 4); \
+ } while (0)
+
+#define WSAADLONG(s,p,v) \
+ do { \
+ *(uint64_t *)(p) = (v); \
+ saa_wbytes(s, p, 8); \
+ } while (0)
+
+#else /* !X86_MEMORY */
+
+#define WSAACHAR(s,p,v) \
+ do { \
+ *(uint8_t *)(p) = (v); \
+ saa_wbytes(s, p, 1); \
+ } while (0)
+
+#define WSAASHORT(s,p,v) \
+ do { \
+ uint16_t _wss_v = (v); \
+ uint8_t *_wss_p = (uint8_t *)(p); \
+ _wss_p[0] = _wss_v; \
+ _wss_p[1] = _wss_v >> 8; \
+ saa_wbytes(s, _wss_p, 2); \
+ } while (0)
+
+#define WSAALONG(s,p,v) \
+ do { \
+ uint32_t _wsl_v = (v); \
+ uint8_t *_wsl_p = (uint8_t *)(p); \
+ _wsl_p[0] = _wsl_v; \
+ _wsl_p[1] = _wsl_v >> 8; \
+ _wsl_p[2] = _wsl_v >> 16; \
+ _wsl_p[3] = _wsl_v >> 24; \
+ saa_wbytes(s, _wsl_p, 4); \
+ } while (0)
+
+#define WSAADLONG(s,p,v) \
+ do { \
+ uint64_t _wsq_v = (v); \
+ uint8_t *_wsq_p = (uint8_t *)(p); \
+ _wsq_p[0] = _wsq_v; \
+ _wsq_p[1] = _wsq_v >> 8; \
+ _wsq_p[2] = _wsq_v >> 16; \
+ _wsq_p[3] = _wsq_v >> 24; \
+ _wsq_p[4] = _wsq_v >> 32; \
+ _wsq_p[5] = _wsq_v >> 40; \
+ _wsq_p[6] = _wsq_v >> 48; \
+ _wsq_p[7] = _wsq_v >> 56; \
+ saa_wbytes(s, _wsq_p, 8); \
+ } while (0)
+
+#endif
+
+#endif /* NASM_WSAA_H */