[llvm] r257902 - Stop increasing alignment of externally-visible globals on ELF

Hans Wennborg via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 19 10:32:09 PST 2016


On Fri, Jan 15, 2016 at 8:33 AM, James Y Knight via llvm-commits
<llvm-commits at lists.llvm.org> wrote:
> Author: jyknight
> Date: Fri Jan 15 10:33:06 2016
> New Revision: 257902
>
> URL: http://llvm.org/viewvc/llvm-project?rev=257902&view=rev
> Log:
> Stop increasing alignment of externally-visible globals on ELF
> platforms.
>
> With ELF, the alignment of a global variable in a shared library will
> get copied into an executables linked against it, if the executable even
> accesss the variable. So, it's not possible to implicitly increase
> alignment based on access patterns, or you'll break existing binaries.
>
> This happened to affect libc++'s std::cout symbol, for example. See
> thread: http://thread.gmane.org/gmane.comp.compilers.clang.devel/45311
>
> (This is a re-commit of r257719, without the bug reported in
> PR26144. I've tweaked the code to not assert-fail in
> enforceKnownAlignment when computeKnownBits doesn't recurse far enough
> to find the underlying Alloca/GlobalObject value.)
>
> Differential Revision: http://reviews.llvm.org/D16145

Merged to 3.8 in r258155.


More information about the llvm-commits mailing list