summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-07-26 05:55:20 +0000
committerChris Lattner <sabre@nondot.org>2009-07-26 05:55:20 +0000
commit1e76db06b91ba4d09a20263b6da07ee81bf2f96c (patch)
tree00ddc008e63402b5df1e6c5c34978489d127a13b
parent1d68bd7f97e4b412c10534d67c7c525ade40e729 (diff)
downloadbcm5719-llvm-1e76db06b91ba4d09a20263b6da07ee81bf2f96c.tar.gz
bcm5719-llvm-1e76db06b91ba4d09a20263b6da07ee81bf2f96c.zip
make elf targets correctly handle constant pool entries that require relocations.
llvm-svn: 77130
-rw-r--r--llvm/lib/Target/ELFTargetAsmInfo.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/llvm/lib/Target/ELFTargetAsmInfo.cpp b/llvm/lib/Target/ELFTargetAsmInfo.cpp
index c4011098b89..2ba7b96f12a 100644
--- a/llvm/lib/Target/ELFTargetAsmInfo.cpp
+++ b/llvm/lib/Target/ELFTargetAsmInfo.cpp
@@ -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) {
OpenPOWER on IntegriCloud