summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH. Peter Anvin (Intel) <hpa@zytor.com>2019-01-11 12:27:02 -0800
committerH. Peter Anvin (Intel) <hpa@zytor.com>2019-01-11 12:27:02 -0800
commit38ddb19977c109ae18d69699d177c7d34c9d0455 (patch)
tree55121449214287e2d51d29b70c41ea2dd5f4b056
parentef4f23d76a6ce89c93b40150f48ba6803d42341e (diff)
downloadnasm-38ddb19977c109ae18d69699d177c7d34c9d0455.tar.gz
Warnings: move zeroing reserved space to a separate warning class
Zeroing reserved space in a progbits section really should be a separate warning class, so it can be controlled independently. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
-rw-r--r--asm/assemble.c12
-rw-r--r--output/outaout.c2
-rw-r--r--output/outas86.c2
-rw-r--r--output/outbin.c2
-rw-r--r--output/outcoff.c2
-rw-r--r--output/outelf.c6
-rw-r--r--travis/test/multisection-elf32.stderr2
-rw-r--r--travis/test/multisection-elf64.stderr2
-rw-r--r--travis/test/multisection.stderr2
9 files changed, 21 insertions, 11 deletions
diff --git a/asm/assemble.c b/asm/assemble.c
index fc216a8f..6d66210f 100644
--- a/asm/assemble.c
+++ b/asm/assemble.c
@@ -1,6 +1,6 @@
/* ----------------------------------------------------------------------- *
*
- * Copyright 1996-2018 The NASM Authors - All Rights Reserved
+ * Copyright 1996-2019 The NASM Authors - All Rights Reserved
* See the file AUTHORS included with the NASM distribution for
* the specific copyright holders.
*
@@ -329,6 +329,16 @@ static void warn_overflow_out(int64_t data, int size, enum out_sign sign)
* generator at the same time, flatten unnecessary relocations,
* and verify backend compatibility.
*/
+/*
+ * This warning is currently issued by backends, but in the future
+ * this code should be centralized.
+ *
+ *!zeroing [on] RESx in initialized section becomes zero
+ *! a \c{RESx} directive was used in a section which contains
+ *! initialized data, and the output format does not support
+ *! this. Instead, this will be replaced with explicit zero
+ *! content, which may produce a large output file.
+ */
static void out(struct out_data *data)
{
static int32_t lineno = 0; /* static!!! */
diff --git a/output/outaout.c b/output/outaout.c
index 53a5611c..8821d7fe 100644
--- a/output/outaout.c
+++ b/output/outaout.c
@@ -603,7 +603,7 @@ static void aout_out(int32_t segto, const void *data,
if (type == OUT_RESERVE) {
if (s) {
- nasm_warn(WARN_OTHER, "uninitialized space declared in"
+ nasm_warn(WARN_ZEROING, "uninitialized space declared in"
" %s section: zeroing",
(segto == stext.index ? "code" : "data"));
aout_sect_write(s, NULL, size);
diff --git a/output/outas86.c b/output/outas86.c
index fc283f4a..3b44aea9 100644
--- a/output/outas86.c
+++ b/output/outas86.c
@@ -314,7 +314,7 @@ static void as86_out(int32_t segto, const void *data,
if (type == OUT_RESERVE) {
if (s) {
- nasm_warn(WARN_OTHER, "uninitialized space declared in"
+ nasm_warn(WARN_ZEROING, "uninitialized space declared in"
" %s section: zeroing",
(segto == stext.index ? "code" : "data"));
as86_sect_write(s, NULL, size);
diff --git a/output/outbin.c b/output/outbin.c
index 148a1fdf..9983cd33 100644
--- a/output/outbin.c
+++ b/output/outbin.c
@@ -783,7 +783,7 @@ static void bin_out(int32_t segto, const void *data,
case OUT_RESERVE:
if (s->flags & TYPE_PROGBITS) {
- nasm_warn(WARN_OTHER, "uninitialized space declared in"
+ nasm_warn(WARN_ZEROING, "uninitialized space declared in"
" %s section: zeroing", s->name);
saa_wbytes(s->contents, NULL, size);
}
diff --git a/output/outcoff.c b/output/outcoff.c
index da563ca3..67bd3ce5 100644
--- a/output/outcoff.c
+++ b/output/outcoff.c
@@ -606,7 +606,7 @@ static void coff_out(int32_t segto, const void *data,
if (type == OUT_RESERVE) {
if (s->data) {
- nasm_warn(WARN_OTHER, "uninitialised space declared in"
+ nasm_warn(WARN_ZEROING, "uninitialised space declared in"
" non-BSS section `%s': zeroing", s->name);
coff_sect_write(s, NULL, size);
} else
diff --git a/output/outelf.c b/output/outelf.c
index bfbb5a8b..bacecbc6 100644
--- a/output/outelf.c
+++ b/output/outelf.c
@@ -828,7 +828,7 @@ static void elf32_out(int32_t segto, const void *data,
switch (type) {
case OUT_RESERVE:
if (s->type == SHT_PROGBITS) {
- nasm_warn(WARN_OTHER, "uninitialized space declared in"
+ nasm_warn(WARN_ZEROING, "uninitialized space declared in"
" non-BSS section `%s': zeroing", s->name);
elf_sect_write(s, NULL, size);
} else
@@ -1039,7 +1039,7 @@ static void elf64_out(int32_t segto, const void *data,
switch (type) {
case OUT_RESERVE:
if (s->type == SHT_PROGBITS) {
- nasm_warn(WARN_OTHER, "uninitialized space declared in"
+ nasm_warn(WARN_ZEROING, "uninitialized space declared in"
" non-BSS section `%s': zeroing", s->name);
elf_sect_write(s, NULL, size);
} else
@@ -1317,7 +1317,7 @@ static void elfx32_out(int32_t segto, const void *data,
switch (type) {
case OUT_RESERVE:
if (s->type == SHT_PROGBITS) {
- nasm_warn(WARN_OTHER, "uninitialized space declared in"
+ nasm_warn(WARN_ZEROING, "uninitialized space declared in"
" non-BSS section `%s': zeroing", s->name);
elf_sect_write(s, NULL, size);
} else
diff --git a/travis/test/multisection-elf32.stderr b/travis/test/multisection-elf32.stderr
index 8ee51353..c014ba25 100644
--- a/travis/test/multisection-elf32.stderr
+++ b/travis/test/multisection-elf32.stderr
@@ -1 +1 @@
-./travis/test/multisection.asm:84: warning: uninitialized space declared in non-BSS section `.hmm': zeroing [-w+other] \ No newline at end of file
+./travis/test/multisection.asm:84: warning: uninitialized space declared in non-BSS section `.hmm': zeroing [-w+zeroing]
diff --git a/travis/test/multisection-elf64.stderr b/travis/test/multisection-elf64.stderr
index 8ee51353..c014ba25 100644
--- a/travis/test/multisection-elf64.stderr
+++ b/travis/test/multisection-elf64.stderr
@@ -1 +1 @@
-./travis/test/multisection.asm:84: warning: uninitialized space declared in non-BSS section `.hmm': zeroing [-w+other] \ No newline at end of file
+./travis/test/multisection.asm:84: warning: uninitialized space declared in non-BSS section `.hmm': zeroing [-w+zeroing]
diff --git a/travis/test/multisection.stderr b/travis/test/multisection.stderr
index f8575e13..a65c95f9 100644
--- a/travis/test/multisection.stderr
+++ b/travis/test/multisection.stderr
@@ -1 +1 @@
-./travis/test/multisection.asm:84: warning: uninitialized space declared in .hmm section: zeroing [-w+other] \ No newline at end of file
+./travis/test/multisection.asm:84: warning: uninitialized space declared in .hmm section: zeroing [-w+zeroing]