[PATCH] D36712: Emit section information for extern variables
Eli Friedman via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Aug 15 11:53:34 PDT 2017
efriedma added a comment.
> The other side of the problem is, what if the declarations don't have any section information, but the definition does? Is that also an undefined behavior?
I can't see how "undefined behavior" could possibly be the right answer in that case. Every definition has to end up in some section eventually, and in many cases we don't know what section that will be when a global is declared. (For example, we put constants into different sections depending on the contents of the initializer.)
But yes, it would be nice to explicitly define how this behaves.
https://reviews.llvm.org/D36712
More information about the cfe-commits
mailing list