[PATCH] [PECOFF] Support COMDAT associative sections.

Rui Ueyama ruiu at google.com
Wed May 28 22:42:49 PDT 2014


Hi Bigcheese, shankarke, atanasyan,

COFF supports a feature similar to ELF's section groups. This
patch implements it.

In ELF, section groups are identified by their names, and they are
treated somewhat differently from regular symbols. In COFF, the
feature is realized in a more straightforward way. A section can
have an annotation saying "if Nth section is linked, link this
section too."

Implementing such feature is easy. We can add a reference from a
target atom to an original atom, so that if the target is linked,
the original atom is also linked. If not linked, both will be
dead-stripped. So they are treated as a group.

I added a new reference type, kindAssociate. It does nothing except
preventing referenced atoms from being dead-stripped.

No change to the Resolver is needed.

http://reviews.llvm.org/D3946

Files:
  include/lld/Core/Reference.h
  lib/ReaderWriter/PECOFF/Atoms.h
  lib/ReaderWriter/PECOFF/ReaderCOFF.cpp
  test/pecoff/Inputs/associative1.obj.yaml
  test/pecoff/Inputs/associative3.obj.yaml
  test/pecoff/associative.test
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D3946.9905.patch
Type: text/x-patch
Size: 7977 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140529/f21cb311/attachment.bin>


More information about the llvm-commits mailing list