[PATCH] [mc-coff] Forward Linker Option flags into the .drectve section

Rafael EspĂ­ndola rafael.espindola at gmail.com
Thu Apr 25 12:14:48 PDT 2013


>> Is the format documented somewhere we could link to?
>
> The .drectve section format, or the module flags metadata format?
>
> The .drectve section, which we already use for dllexported symbols, is
> part of the PE-COFF spec:
> """
> A .drectve section consists of a string of text that can be encoded as ANSI or
> UTF8. If the UTF8 byte order marker (BOM, a three-byte prefix that consists of
> 0xEF, 0xBB, and 0xBF) is not present, the directive string is
> interpreted as ANSI.
> The directive string is a series of linker options that are separated
> by spaces. Each
> option contains a hyphen, the option name, and any appropriate attribute. If
> an option contains spaces, the option must be enclosed in quotes. The .drectve
> section must not have relocations or line numbers.
> """
>
> One thing that's a little vague is how quotes and backslashes should
> be escaped.  I'd guess it's the same escaping algorithm used for
> CreateProcess, since these are flags.
>
> Worth linking the doc here, or is the spec kind of an implicit reference?

The best url I could find is

http://msdn.microsoft.com/en-ca/library/windows/hardware/gg463119.aspx

so I guess just saying "the pe-coff spec" is fine. I tried looking at
it last night but searched for ".directive" instead of ".drectve" :-(

>> Please test the output of the assembly file. No need to use -filetype=obj.
>
> Sounds good.  For some reason I thought that wouldn't work with COFF,
> but it works fine.

Thanks!

Cheers,
Rafael



More information about the llvm-commits mailing list