mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-08 21:32:39 +00:00
preserve sections of globals
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33756 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
b82313fdc2
commit
5dfbaf1fe3
@ -478,7 +478,10 @@ static bool LinkGlobals(Module *Dest, Module *Src,
|
|||||||
SGV->getName(), Dest);
|
SGV->getName(), Dest);
|
||||||
// Propagate alignment info.
|
// Propagate alignment info.
|
||||||
NewDGV->setAlignment(SGV->getAlignment());
|
NewDGV->setAlignment(SGV->getAlignment());
|
||||||
|
|
||||||
|
// Propagate section info.
|
||||||
|
NewDGV->setSection(SGV->getSection());
|
||||||
|
|
||||||
// If the LLVM runtime renamed the global, but it is an externally visible
|
// If the LLVM runtime renamed the global, but it is an externally visible
|
||||||
// symbol, DGV must be an existing global with internal linkage. Rename
|
// symbol, DGV must be an existing global with internal linkage. Rename
|
||||||
// it.
|
// it.
|
||||||
@ -503,6 +506,9 @@ static bool LinkGlobals(Module *Dest, Module *Src,
|
|||||||
// Propagate alignment info.
|
// Propagate alignment info.
|
||||||
NewDGV->setAlignment(std::max(DGV->getAlignment(), SGV->getAlignment()));
|
NewDGV->setAlignment(std::max(DGV->getAlignment(), SGV->getAlignment()));
|
||||||
|
|
||||||
|
// Propagate section info.
|
||||||
|
NewDGV->setSection(SGV->getSection());
|
||||||
|
|
||||||
// Make sure to remember this mapping...
|
// Make sure to remember this mapping...
|
||||||
ValueMap.insert(std::make_pair(SGV, NewDGV));
|
ValueMap.insert(std::make_pair(SGV, NewDGV));
|
||||||
|
|
||||||
@ -512,6 +518,9 @@ static bool LinkGlobals(Module *Dest, Module *Src,
|
|||||||
// Propagate alignment info.
|
// Propagate alignment info.
|
||||||
DGV->setAlignment(std::max(DGV->getAlignment(), SGV->getAlignment()));
|
DGV->setAlignment(std::max(DGV->getAlignment(), SGV->getAlignment()));
|
||||||
|
|
||||||
|
// Propagate section info.
|
||||||
|
DGV->setSection(SGV->getSection());
|
||||||
|
|
||||||
// Otherwise, perform the mapping as instructed by GetLinkageResult. If
|
// Otherwise, perform the mapping as instructed by GetLinkageResult. If
|
||||||
// the types don't match, and if we are to link from the source, nuke DGV
|
// the types don't match, and if we are to link from the source, nuke DGV
|
||||||
// and create a new one of the appropriate type.
|
// and create a new one of the appropriate type.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user