From 12b55ccc43340fd281f4eb8f4e6287f069799eab Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Tue, 10 Jun 2003 06:46:34 +0000 Subject: 2003-06-09 H.J. Lu * NEWS: Updated for the new -n option for the i386 assembler. * config/tc-i386.c (optimize_align_code): New. (md_shortopts): Add 'n'. (md_parse_option): Handle 'n'. (md_show_usage): Add '-n'. * config/tc-i386.h (optimize_align_code): Declared. (md_do_align): Optimize code alignment only if optimize_align_code is not 0. * doc/as.texinfo: Add the new -n option. * doc/c-i386.texi: Document the new -n option. --- gas/config/tc-i386.c | 13 +++++++++++-- gas/config/tc-i386.h | 9 +++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) (limited to 'gas/config') diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index 4823ee79546..a10d9e69dea 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -303,6 +303,9 @@ static int allow_naked_reg = 0; frame as in 32 bit mode. */ static char stackop_size = '\0'; +/* Non-zero to optimize code alignment. */ +int optimize_align_code = 1; + /* Non-zero to quieten some warnings. */ static int quiet_warnings = 0; @@ -4889,9 +4892,9 @@ parse_register (reg_string, end_op) } #if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF) -const char *md_shortopts = "kVQ:sq"; +const char *md_shortopts = "kVQ:sqn"; #else -const char *md_shortopts = "q"; +const char *md_shortopts = "qn"; #endif struct option md_longopts[] = { @@ -4912,6 +4915,10 @@ md_parse_option (c, arg) { switch (c) { + case 'n': + optimize_align_code = 0; + break; + case 'q': quiet_warnings = 1; break; @@ -4973,10 +4980,12 @@ md_show_usage (stream) -Q ignored\n\ -V print assembler version number\n\ -k ignored\n\ + -n Do not optimize code alignment\n\ -q quieten some warnings\n\ -s ignored\n")); #else fprintf (stream, _("\ + -n Do not optimize code alignment\n\ -q quieten some warnings\n")); #endif } diff --git a/gas/config/tc-i386.h b/gas/config/tc-i386.h index f45d7131566..295ccb98b20 100644 --- a/gas/config/tc-i386.h +++ b/gas/config/tc-i386.h @@ -516,9 +516,14 @@ extern int tc_i386_fix_adjustable PARAMS ((struct fix *)); extern const struct relax_type md_relax_table[]; #define TC_GENERIC_RELAX_TABLE md_relax_table +extern int optimize_align_code; + #define md_do_align(n, fill, len, max, around) \ -if ((n) && !need_pass_2 \ - && (!(fill) || ((char)*(fill) == (char)0x90 && (len) == 1)) \ +if ((n) \ + && !need_pass_2 \ + && optimize_align_code \ + && (!(fill) \ + || ((char)*(fill) == (char)0x90 && (len) == 1)) \ && subseg_text_p (now_seg)) \ { \ frag_align_code ((n), (max)); \ -- cgit v1.2.1