make elf targets correctly handle constant pool entries that require relocations.
authorChris Lattner <sabre@nondot.org>
Sun, 26 Jul 2009 05:55:20 +0000 (05:55 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 26 Jul 2009 05:55:20 +0000 (05:55 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77130 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ELFTargetAsmInfo.cpp

index c4011098b89504c6ceb9fd78276377316601dc89..2ba7b96f12a599db430d1345132c9cdff07354cb 100644 (file)
@@ -81,8 +81,13 @@ ELFTargetAsmInfo::SelectSectionForGlobal(const GlobalValue *GV,
 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) {