Generate warning for unknown section atributes
authorCharles Crayne <chuck@thor.crayne.org>
Sun, 18 Jan 2009 23:27:03 +0000 (15:27 -0800)
committerCharles Crayne <chuck@thor.crayne.org>
Sun, 18 Jan 2009 23:27:03 +0000 (15:27 -0800)
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.

output/outelf32.c
output/outelf64.c

index 0f9ba10..3766cdd 100644 (file)
@@ -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") ||
index 259d7d5..a12559e 100644 (file)
@@ -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") ||