[patch] Correctly set the comdat symbol on COFF

Reid Kleckner rnk at google.com
Thu Jun 5 15:31:07 PDT 2014


On Thu, Jun 5, 2014 at 1:55 PM, Rafael EspĂ­ndola <rafael.espindola at gmail.com
> wrote:

> On 5 June 2014 16:40, Reid Kleckner <rnk at google.com> wrote:
> > This seems wrong for associative comdats.  Won't the comdat symbol
> > necessarily be in a different section?
>
> Not if I am reading the spec correctly. It looks like this situation
> will look like:
>
> * Section foo has the following symbols in order:
>   * The symbol foo, which has an auxiliary symbol with a Seltion field
> with IMAGE_COMDAT_SELECT_ASSOCIATIVE and a Number field pointing to
> the associated section.
>   * The comdat symbol, which can be anything, lets say bar
>
> The associated section can have any name, lets say zed. It has the
> following symbols
> * The symbol zed. The only constraint being that it is not itself
> associative.
> * The comdat symbol, with can be any other symbol, bah for example.
>
> In summary, each section has a different comdat symbol. The link of
> associative sections is independent of the comdat, except that they
> probably cannot have the some comdat, otherwise we would be asking the
> linker to keep both and discard one at the same time :-)


This patch looks good to me, but see my comment on http://llvm.org/PR19960
for how I think we should deal with associative comdats.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140605/e168424a/attachment.html>


More information about the llvm-commits mailing list