Commit-ID: b8d153eb4dee2ac22fc09cfba99dbae48c724b88
Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=b8d153eb4dee2ac22fc09cfba99dbae48c724b88
Author: Chang S. Bae <cha...@in...>
AuthorDate: Mon, 13 Aug 2018 13:50:18 -0700
Committer: Cyrill Gorcunov <gor...@gm...>
CommitDate: Thu, 16 Aug 2018 00:01:38 +0300
macho: Turn off jump-match optimization for subsections_via_symbols
The jump-match optimization tends to remove labels. When the
"subsections_via_symbols" pragma is declared, all the labels
should be emitted. Disabling the optimization (only) makes
the pragma effective.
It might be cleaner to extend the OFMT interface to support
callback function. In this case, the reconfiguration can be
done through the callback interface, rather than direct
access to the global variable.
Signed-off-by: Chang S. Bae <cha...@in...>
---
output/outmacho.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/output/outmacho.c b/output/outmacho.c
index 93b4768..d092cf2 100644
--- a/output/outmacho.c
+++ b/output/outmacho.c
@@ -1891,6 +1891,9 @@ macho_pragma(const struct pragma *pragma)
if (real)
head_flags |= MH_SUBSECTIONS_VIA_SYMBOLS;
+ /* Jmp-match optimization conflicts */
+ optimizing.flag |= OPTIM_DISABLE_JMP_MATCH;
+
return DIRR_OK;
case D_NO_DEAD_STRIP:
|