diff options
author | Nick Clifton <nickc@redhat.com> | 2008-09-03 14:02:30 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2008-09-03 14:02:30 +0000 |
commit | a6c24e68b9c0bde0587b9fbf2a50aa09c58c207c (patch) | |
tree | 6532bfb765766c2b7fa3e647ac4c1fda0c604ae4 /gas/config | |
parent | 514f746bdc40681c8a32ef8077adeae4f2098db2 (diff) | |
download | gdb-a6c24e68b9c0bde0587b9fbf2a50aa09c58c207c.zip gdb-a6c24e68b9c0bde0587b9fbf2a50aa09c58c207c.tar.gz gdb-a6c24e68b9c0bde0587b9fbf2a50aa09c58c207c.tar.bz2 |
* config/tc-i386.c (pe_lcomm_internal): New function. Allows the
alignment field of the .lcomm directive to be optional.
(pe_lcomm): New function. Pass pe_lcomm_internal to
s_comm_internal.
(md_pseudo_table): Implement .lcomm directive for COFF based
targets.
* doc/c-i386.texi (i386-Directives): New node. Used to document
the .lcomm directive.
Diffstat (limited to 'gas/config')
-rw-r--r-- | gas/config/tc-i386.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index 86ef49c..7744b16 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -684,6 +684,48 @@ static const arch_entry cpu_arch[] = CPU_SSE5_FLAGS }, }; +/* Like s_lcomm_internal in gas/read.c but the alignment string + is allowed to be optional. */ + +static symbolS * +pe_lcomm_internal (int needs_align, symbolS *symbolP, addressT size) +{ + addressT align = 0; + + SKIP_WHITESPACE (); + + if (needs_align + && *input_line_pointer == ',') + { + align = parse_align (needs_align - 1); + + if (align == (addressT) -1) + return NULL; + } + else + { + if (size >= 8) + align = 3; + else if (size >= 4) + align = 2; + else if (size >= 2) + align = 1; + else + align = 0; + } + + bss_alloc (symbolP, size, align); + return symbolP; +} + +void pe_lcomm (int); + +void +pe_lcomm (int needs_align) +{ + s_comm_internal (needs_align * 2, pe_lcomm_internal); +} + const pseudo_typeS md_pseudo_table[] = { #if !defined(OBJ_AOUT) && !defined(USE_ALIGN_PTWO) @@ -694,6 +736,8 @@ const pseudo_typeS md_pseudo_table[] = {"arch", set_cpu_arch, 0}, #ifndef I386COFF {"bss", s_bss, 0}, +#else + {"lcomm", pe_lcomm, 1}, #endif {"ffloat", float_cons, 'f'}, {"dfloat", float_cons, 'd'}, |