summaryrefslogtreecommitdiff
path: root/output
diff options
context:
space:
mode:
authorCyrill Gorcunov <gorcunov@gmail.com>2010-04-10 14:58:39 +0400
committerCyrill Gorcunov <gorcunov@gmail.com>2010-04-11 12:58:05 +0400
commitc084467eba0fa81b04e9d413bf8ae27475cfce61 (patch)
tree456bddd353f9bbd1c82ebd7390f3f1a96dadde52 /output
parent367d59e2726866887b75822338fe7387c81ec298 (diff)
downloadnasm-c084467eba0fa81b04e9d413bf8ae27475cfce61.tar.gz
Elf: Use SHA_ANY constant instead of open coded number
SHA_ANY is not part of Elf specification but rather our own symbolic definition for convenience. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Diffstat (limited to 'output')
-rw-r--r--output/elf.h3
-rw-r--r--output/outelf.c4
2 files changed, 5 insertions, 2 deletions
diff --git a/output/elf.h b/output/elf.h
index ebdbfe6c..ed3467eb 100644
--- a/output/elf.h
+++ b/output/elf.h
@@ -188,6 +188,9 @@
#define SHN_COMMON 0xfff2
#define SHN_HIRESERVE 0xffff
+/* Section align flag */
+#define SHA_ANY 1 /* No alignment constraint */
+
/* Lenght of magic at the start of a file */
#define EI_NIDENT 16
diff --git a/output/outelf.c b/output/outelf.c
index 9ac39a60..f1ba7ddc 100644
--- a/output/outelf.c
+++ b/output/outelf.c
@@ -79,12 +79,12 @@ void section_attrib(char *name, char *attr, int pass,
if (!nasm_stricmp(q, "align")) {
*align = atoi(v);
if (*align == 0) {
- *align = 1;
+ *align = SHA_ANY;
} else if (!is_power2(*align)) {
nasm_error(ERR_NONFATAL,
"section alignment %"PRId64" is not a power of two",
*align);
- *align = 1;
+ *align = SHA_ANY;
}
} else if (!nasm_stricmp(q, "alloc")) {
*flags_and |= SHF_ALLOC;