diff options
author | Chris Lattner <sabre@nondot.org> | 2009-07-26 05:55:20 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-07-26 05:55:20 +0000 |
commit | 07203df7d4bf735368ca48195c95273a15481b9e (patch) | |
tree | c83f64377312f097493ec71fa9774517aa6e7d4b /lib/Target | |
parent | dc9d8cf1352d68bf7e01cfe7f210cdf6a180f405 (diff) | |
download | external_llvm-07203df7d4bf735368ca48195c95273a15481b9e.zip external_llvm-07203df7d4bf735368ca48195c95273a15481b9e.tar.gz external_llvm-07203df7d4bf735368ca48195c95273a15481b9e.tar.bz2 |
make elf targets correctly handle constant pool entries that require relocations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77130 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target')
-rw-r--r-- | lib/Target/ELFTargetAsmInfo.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/Target/ELFTargetAsmInfo.cpp b/lib/Target/ELFTargetAsmInfo.cpp index c401109..2ba7b96 100644 --- a/lib/Target/ELFTargetAsmInfo.cpp +++ b/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) { |