[llvm-commits] [llvm] r77130 - /llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp

Chris Lattner sabre at nondot.org
Sat Jul 25 22:55:50 PDT 2009


Author: lattner
Date: Sun Jul 26 00:55:20 2009
New Revision: 77130

URL: http://llvm.org/viewvc/llvm-project?rev=77130&view=rev
Log:
make elf targets correctly handle constant pool entries that require relocations.

Modified:
    llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp

Modified: llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp?rev=77130&r1=77129&r2=77130&view=diff

==============================================================================
--- llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp Sun Jul 26 00:55:20 2009
@@ -81,8 +81,13 @@
 const Section *
 ELFTargetAsmInfo::getSectionForMergableConstant(uint64_t Size,
                                                 unsigned ReloInfo) const {
-  // FIXME: IF this global requires a relocation, can we really put it in
-  // rodata???  This should check ReloInfo like darwin.
+  // If this constant pool entry has relocations, stick it into a relocatable
+  // section.
+  if (ReloInfo == 2)
+    return DataRelROSection;
+  if (ReloInfo == 1)
+    return DataRelROLocalSection;
+  
   
   const char *SecName = 0;
   switch (Size) {





More information about the llvm-commits mailing list