[llvm-commits] [release_19] CVS: llvm/lib/Linker/LinkModules.cpp

Andrew Lenharth alenhar2 at cs.uiuc.edu
Fri Jan 26 14:29:24 PST 2007



Changes in directory llvm/lib/Linker:

LinkModules.cpp updated: 1.117 -> 1.117.4.1
---
Log message:

Linker should keep sections on globals.  This should propagate to mainline if it is correct

---
Diffs of the changes:  (+9 -0)

 LinkModules.cpp |    9 +++++++++
 1 files changed, 9 insertions(+)


Index: llvm/lib/Linker/LinkModules.cpp
diff -u llvm/lib/Linker/LinkModules.cpp:1.117 llvm/lib/Linker/LinkModules.cpp:1.117.4.1
--- llvm/lib/Linker/LinkModules.cpp:1.117	Thu Sep 14 13:23:26 2006
+++ llvm/lib/Linker/LinkModules.cpp	Fri Jan 26 16:28:48 2007
@@ -456,6 +456,9 @@
                            SGV->getName(), Dest);
       // Propagate alignment info.
       NewDGV->setAlignment(SGV->getAlignment());
+
+      // Propagate section info.
+      NewDGV->setSection(SGV->getSection());
       
       // If the LLVM runtime renamed the global, but it is an externally visible
       // symbol, DGV must be an existing global with internal linkage.  Rename
@@ -481,6 +484,9 @@
       // Propagate alignment info.
       NewDGV->setAlignment(std::max(DGV->getAlignment(), SGV->getAlignment()));
 
+      // Propagate section info.
+      NewDGV->setSection(SGV->getSection());
+
       // Make sure to remember this mapping...
       ValueMap.insert(std::make_pair(SGV, NewDGV));
 
@@ -490,6 +496,9 @@
       // Propagate alignment info.
       DGV->setAlignment(std::max(DGV->getAlignment(), SGV->getAlignment()));
 
+      // Propagate section info.
+      DGV->setSection(SGV->getSection());
+
       // 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
       // and create a new one of the appropriate type.






More information about the llvm-commits mailing list