From c084467eba0fa81b04e9d413bf8ae27475cfce61 Mon Sep 17 00:00:00 2001 From: Cyrill Gorcunov Date: Sat, 10 Apr 2010 14:58:39 +0400 Subject: [PATCH] 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 --- output/elf.h | 3 +++ output/outelf.c | 4 ++-- 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; -- 2.11.4.GIT