rnk added a comment.

Oops, forgot to respond to this...

In D58737#1412734 <https://reviews.llvm.org/D58737#1412734>, @vsk wrote:

> I'm confused by this wording re: comdats in the LangRef: "All global objects 
> that specify this key will only end up in the final object file if the linker 
> chooses that key over some other key". Why can multiple global objects with 
> the same comdat key end up in the final object file?


I agree, that wording seems very confusing. I probably even wrote it. I'll try 
editing it and send you the result later.

These words are trying to say that, some number of global objects can use a 
comdat key. If the object file they are contained in has the prevailing 
definition of that comdat key, then they will be included, and they will be 
discarded if not. The prevailing object is typically just the first object file 
that uses the comdat.

So, multiple objects from *one TU* can use the key and end up in the final 
binary, but objects from different TUs will never end up mixed together in the 
final binary.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D58737/new/

https://reviews.llvm.org/D58737



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to