[PATCH] D37489: Linker script handing of file patterns with COMMON defs

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 7 14:54:37 PDT 2017


ruiu added a comment.

When I link clang, lld doesn't actually create any Common section because no input file has common symbols. I haven't thought about that until now, but that makes sense -- I personally don't write code that depends on common symbols too. Maybe common symbols are not that common these days as people have been trained to add `extern` to global varaible declarations.

We are sorting common symbols because it is believed to pack common symbols well. But we didn't verify that when we add that code to lld. It's a copy of GNU linker's behavior. Maybe we should stop doing that.


https://reviews.llvm.org/D37489





More information about the llvm-commits mailing list