[PATCH] MC: Add .section directive to COFF

Nico Rieck nico.rieck at gmail.com
Sun Apr 14 14:02:02 PDT 2013


On 14.04.2013 22:43, Anton Korobeynikov wrote:
>> I am probably missing something on the patch. If there is really a
>> case that MC accepts and GAS rejects, then yes, it should be
>> documented as an extension.
> As far as I understand the patch now there is a possibility to define
> section flags for COFF. Which GAS implementes not fully. This is why:
> "No changes to the printed flags when generating asm (there also
> doesn't seem to be a sane way to make these flags roundtrip)."
>
> Nico, please correct, if I'm wrong.

Sorry for being unclear.

What I meant with that paragraph was that I didn't touch 
"MCSectionCOFF::PrintSwitchToSection" to add more flags. At first I 
tried to make the flags roundtrip, which seems impossible in a sane way. 
Then I replicated GCC's printing, but ultimately scrapped it for this 
patch, as it's not that relevant.

When it comes to parsing, this patch doesn't implement anything GAS 
doesn't do. It implements all flags described in the manual[1]. It 
doesn't support the non-documented "e" flag, extended ASCII names and 
subsections (I might come back to that if the ELF subsection patch is done).

On 14.04.2013 22:16, Rafael EspĂ­ndola wrote:> On 14 April 2013 06:47,
 > Does GAS produce an error for conflicting flags like 'b' and 'd'?
 > Could we? If we are going to have different behavior, producing an
 > error is probably the best.

GAS doesn't produce any errors or warnings for any combinations, and 
usually later flags override previous flags, and this is probably a bug 
in GAS (that is never hit because I assume such weird combinations 
aren't used in practice).

-Nico


[1] http://sourceware.org/binutils/docs/as/Section.html



More information about the llvm-commits mailing list