summaryrefslogtreecommitdiff
path: root/output
diff options
context:
space:
mode:
authorCharles Crayne <chuck@thor.crayne.org>2009-01-18 15:27:03 -0800
committerCharles Crayne <chuck@thor.crayne.org>2009-01-18 15:27:03 -0800
commitcc88d658ce3ac44192c550171aac5f2f7c217e75 (patch)
treeaf6f2f4e6fb86b156acd0a5e51a774a9b1561993 /output
parentf1e46600d2760d357297d87092a72e5d9a813832 (diff)
downloadnasm-cc88d658ce3ac44192c550171aac5f2f7c217e75.tar.gz
Generate warning for unknown section atributes
Previously, the ELF backends silently ignored incorrect or unknown attributes on section declarations, and therefore used default values in cases where the user had make an error in attempting to specify custom values.
Diffstat (limited to 'output')
-rw-r--r--output/outelf32.c3
-rw-r--r--output/outelf64.c3
2 files changed, 4 insertions, 2 deletions
diff --git a/output/outelf32.c b/output/outelf32.c
index 0f9ba10b..3766cdd7 100644
--- a/output/outelf32.c
+++ b/output/outelf32.c
@@ -484,7 +484,8 @@ static int32_t elf_section_names(char *name, int pass, int *bits)
type = SHT_PROGBITS;
} else if (!nasm_stricmp(q, "nobits")) {
type = SHT_NOBITS;
- }
+ } else if (pass == 1) error(ERR_WARNING, "Unknown section attribute '%s' ignored on"
+ " declaration of section `%s'", q, name);
}
if (!strcmp(name, ".comment") ||
diff --git a/output/outelf64.c b/output/outelf64.c
index 259d7d53..a12559e8 100644
--- a/output/outelf64.c
+++ b/output/outelf64.c
@@ -520,7 +520,8 @@ static int32_t elf_section_names(char *name, int pass, int *bits)
type = SHT_PROGBITS;
} else if (!nasm_stricmp(q, "nobits")) {
type = SHT_NOBITS;
- }
+ } else if (pass == 1) error(ERR_WARNING, "Unknown section attribute '%s' ignored on"
+ " declaration of section `%s'", q, name);
}
if (!strcmp(name, ".comment") ||