From 785ec1d9738947b49c4deefb245ab4271b2a79f4 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Tue, 30 Apr 2002 21:04:43 +0000 Subject: [PATCH] NASM 0.98.18 --- doc/nasmdoc.src | 8 +++++++- macros.pl | 2 +- nasm.h | 2 +- outcoff.c | 11 +++++++++++ 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/doc/nasmdoc.src b/doc/nasmdoc.src index 53e4b70..fcf4700 100644 --- a/doc/nasmdoc.src +++ b/doc/nasmdoc.src @@ -3422,6 +3422,10 @@ analogously to \c{code}. Data sections are marked as readable and writable, but not executable. \c{data} declares an initialised data section, whereas \c{bss} declares an uninitialised data section. +\b \c{rdata} declares an initialised data section that is readable +but not writable. Microsoft compilers use this section to place +constants in it. + \b \c{info} defines the section to be an \i{informational section}, which is not included in the executable file by the linker, but may (for example) pass information \e{to} the linker. For example, @@ -3435,7 +3439,8 @@ sections}alignment requirements of the section. The maximum you may specify is 64: the Win32 object file format contains no means to request a greater section alignment than this. If alignment is not explicitly specified, the defaults are 16-byte alignment for code -sections, and 4-byte alignment for data (and BSS) sections. +sections, 8-byte alignment for rdata sections and 4-byte alignment +for data (and BSS) sections. Informational sections get a default alignment of 1 byte (no alignment), though the value does not matter. @@ -3444,6 +3449,7 @@ qualifiers are: \c section .text code align=16 \c section .data data align=4 +\c section .rdata rdata align=8 \c section .bss bss align=4 Any other section name is treated by default like \c{.text}. diff --git a/macros.pl b/macros.pl index 1de90e7..097cb71 100644 --- a/macros.pl +++ b/macros.pl @@ -18,7 +18,7 @@ open INPUT,$fname || die "unable to open $fname\n"; open OUTPUT,">macros.c" || die "unable to open macros.c\n"; print OUTPUT "/* This file auto-generated from standard.mac by macros.pl" . - " - don't edit it */\n\nstatic char *stdmac[] = {\n"; + " - don't edit it */\n\n#include \n\nstatic char *stdmac[] = {\n"; while () { $line++; diff --git a/nasm.h b/nasm.h index 89705c6..2cc77e6 100644 --- a/nasm.h +++ b/nasm.h @@ -13,7 +13,7 @@ #define NASM_MAJOR_VER 0 #define NASM_MINOR_VER 98 -#define NASM_VER "0.98.17" +#define NASM_VER "0.98.18" #ifndef NULL #define NULL 0 diff --git a/outcoff.c b/outcoff.c index cf2b075..973d9fe 100644 --- a/outcoff.c +++ b/outcoff.c @@ -102,6 +102,7 @@ struct Section { #define DATA_FLAGS (win32 ? 0xC0300040L : 0x40L) #define BSS_FLAGS (win32 ? 0xC0300080L : 0x80L) #define INFO_FLAGS 0x00100A00L +#define RDATA_FLAGS (win32 ? 0x40400040L : 0x40L) #define SECT_DELTA 32 static struct Section **sects; @@ -249,6 +250,14 @@ static long coff_section_names (char *name, int pass, int *bits) flags = TEXT_FLAGS; } else if (!nasm_stricmp(q, "data")) { flags = DATA_FLAGS; + } else if (!nasm_stricmp(q, "rdata")) { + if (win32) + flags = RDATA_FLAGS; + else { + flags = DATA_FLAGS; /* gotta do something */ + error (ERR_NONFATAL, "standard COFF does not support" + " read-only data sections"); + } } else if (!nasm_stricmp(q, "bss")) { flags = BSS_FLAGS; } else if (!nasm_stricmp(q, "info")) { @@ -295,6 +304,8 @@ static long coff_section_names (char *name, int pass, int *bits) if (!flags) { if (!strcmp(name, ".data")) flags = DATA_FLAGS; + else if (!strcmp(name, ".rdata")) + flags = RDATA_FLAGS; else if (!strcmp(name, ".bss")) flags = BSS_FLAGS; else -- 2.7.4