aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNico Weber <thakis@chromium.org>2012-03-06 17:40:41 -0800
committerNico Weber <thakis@chromium.org>2012-03-06 17:40:41 -0800
commit01ab853e68ef8aeded716d6f5b34895200f66a51 (patch)
tree789ac7e11d35345baac2110a3ef1d0606f838f55
parentcc06a6a43dfbbb814c65512efb245c67b2400816 (diff)
downloadyasm-01ab853e68ef8aeded716d6f5b34895200f66a51.tar.gz
In the Mach-O writer, only warn on ignored flags if the new flags
are different from the old flags. Fixes http://tortall.lighthouseapp.com/projects/78676-yasm/tickets/246
-rw-r--r--modules/objfmts/macho/macho-objfmt.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/modules/objfmts/macho/macho-objfmt.c b/modules/objfmts/macho/macho-objfmt.c
index 76b80292..bef564a6 100644
--- a/modules/objfmts/macho/macho-objfmt.c
+++ b/modules/objfmts/macho/macho-objfmt.c
@@ -1497,9 +1497,13 @@ macho_objfmt_section_switch(yasm_object *object, yasm_valparamhead *valparams,
msd->sectname = f_sectname;
msd->flags = flags;
yasm_section_set_align(retval, align, line);
- } else if (flags_override)
- yasm_warn_set(YASM_WARN_GENERAL,
- N_("section flags ignored on section redeclaration"));
+ } else if (flags_override) {
+ // align is the only value used from overrides.
+ if (yasm_section_get_align(retval) != align) {
+ yasm_warn_set(YASM_WARN_GENERAL,
+ N_("section flags ignored on section redeclaration"));
+ }
+ }
return retval;
}