diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2011-03-28 22:47:59 +0000 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2011-03-28 22:47:59 +0000 |
commit | 314a59d568af6b0353bb0263c42741268c8f6839 (patch) | |
tree | 08ed7881ee469e09f50eddf2792ceb9a05ac86e2 /gas/config/tc-i386.c | |
parent | e462023046d892ff820fe6c141eb3ae7cdbaaa91 (diff) | |
download | gdb-314a59d568af6b0353bb0263c42741268c8f6839.zip gdb-314a59d568af6b0353bb0263c42741268c8f6839.tar.gz gdb-314a59d568af6b0353bb0263c42741268c8f6839.tar.bz2 |
Support .quad for x32.
gas/
2011-03-28 H.J. Lu <hongjiu.lu@intel.com>
* config/tc-i386.c (handle_quad): New.
(md_pseudo_table): Add "quad".
gas/testsuite/
2011-03-28 H.J. Lu <hongjiu.lu@intel.com>
* gas/i386/ilp32/inval.s: Remove .quad.
* gas/i386/ilp32/inval.l: Updated.
* gas/i386/ilp32/quad.d: New.
* gas/i386/ilp32/quad.s: Likewise.
Diffstat (limited to 'gas/config/tc-i386.c')
-rw-r--r-- | gas/config/tc-i386.c | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index e7f9c9a..624c78a 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -182,6 +182,7 @@ static void s_bss (int); #endif #if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF) static void handle_large_common (int small ATTRIBUTE_UNUSED); +static void handle_quad (int); #endif static const char *default_arch = DEFAULT_ARCH; @@ -813,6 +814,7 @@ const pseudo_typeS md_pseudo_table[] = {"sse_check", set_sse_check, 0}, #if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF) {"largecomm", handle_large_common, 0}, + {"quad", handle_quad, 8}, #else {"file", (void (*) (int)) dwarf2_directive_file, 0}, {"loc", dwarf2_directive_loc, 0}, @@ -9149,4 +9151,50 @@ handle_large_common (int small ATTRIBUTE_UNUSED) bss_section = saved_bss_section; } } + +static void +handle_quad (int nbytes) +{ + expressionS exp; + + if (x86_elf_abi != X86_64_X32_ABI) + { + cons (nbytes); + return; + } + + if (is_it_end_of_statement ()) + { + demand_empty_rest_of_line (); + return; + } + + do + { + if (*input_line_pointer == '"') + { + as_bad (_("unexpected `\"' in expression")); + ignore_rest_of_line (); + return; + } + x86_cons (&exp, nbytes); + /* Output 4 bytes if not constant. */ + if (exp.X_op != O_constant) + nbytes = 4; + emit_expr (&exp, (unsigned int) nbytes); + } + while (*input_line_pointer++ == ','); + + input_line_pointer--; /* Put terminator back into stream. */ + + demand_empty_rest_of_line (); + + /* Zero-extends to 8 bytes if not constant. */ + if (nbytes == 4) + { + memset (&exp, '\0', sizeof (exp)); + exp.X_op = O_constant; + emit_expr (&exp, nbytes); + } +} #endif /* OBJ_ELF || OBJ_MAYBE_ELF */ |