mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-21 02:24:22 +00:00
Update enforceKnownAlignment after the isWeakForLinker semantic change
Previously we would refrain from attempting to increase the linkage of available_externally globals because they were considered weak for the linker. Now they are treated more like a declaration instead of a weak definition. This was causing SSE alignment faults in Chromuim, when some code assumed it could increase the alignment of a dllimported global that it didn't control. http://crbug.com/509256 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242091 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -900,13 +900,10 @@ static unsigned enforceKnownAlignment(Value *V, unsigned Align,
|
||||
|
||||
if (auto *GO = dyn_cast<GlobalObject>(V)) {
|
||||
// If there is a large requested alignment and we can, bump up the alignment
|
||||
// of the global.
|
||||
if (GO->isDeclaration())
|
||||
return Align;
|
||||
// If the memory we set aside for the global may not be the memory used by
|
||||
// the final program then it is impossible for us to reliably enforce the
|
||||
// preferred alignment.
|
||||
if (GO->isWeakForLinker())
|
||||
// of the global. If the memory we set aside for the global may not be the
|
||||
// memory used by the final program then it is impossible for us to reliably
|
||||
// enforce the preferred alignment.
|
||||
if (!GO->isStrongDefinitionForLinker())
|
||||
return Align;
|
||||
|
||||
if (GO->getAlignment() >= PrefAlign)
|
||||
|
Reference in New Issue
Block a user