diff options
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 */ |