summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/ELFObjectWriter.cpp
diff options
context:
space:
mode:
authorAkira Hatanaka <ahatanaka@mips.com>2011-12-13 02:27:40 +0000
committerAkira Hatanaka <ahatanaka@mips.com>2011-12-13 02:27:40 +0000
commite41963ce479b4fe0e886d829554900c09f4164b0 (patch)
tree19597a9acfc24fe8900c1e387b00721877121e71 /llvm/lib/MC/ELFObjectWriter.cpp
parent09880c42c6b5234f6a4a02bf2af04519084eb97c (diff)
downloadbcm5719-llvm-e41963ce479b4fe0e886d829554900c09f4164b0.tar.gz
bcm5719-llvm-e41963ce479b4fe0e886d829554900c09f4164b0.zip
Relocation against a symbol, instead of against section. We had some extreme
test cases where there were a lot of relocations applied relative to a large rodata section. Gas would create a symbol for each of these whereas we would be relative to the beginning of the rodata section. This change mimics what gas does. Patch by Jack Carter. llvm-svn: 146468
Diffstat (limited to 'llvm/lib/MC/ELFObjectWriter.cpp')
-rw-r--r--llvm/lib/MC/ELFObjectWriter.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/MC/ELFObjectWriter.cpp b/llvm/lib/MC/ELFObjectWriter.cpp
index 40b84ae4585..92aad94f17f 100644
--- a/llvm/lib/MC/ELFObjectWriter.cpp
+++ b/llvm/lib/MC/ELFObjectWriter.cpp
@@ -1851,7 +1851,8 @@ const MCSymbol *MipsELFObjectWriter::ExplicitRelSym(const MCAssembler &Asm,
assert(Target.getSymA() && "SymA cannot be 0.");
const MCSymbol &Sym = Target.getSymA()->getSymbol();
- if (Sym.getSection().getKind().isMergeable1ByteCString())
+ if (Sym.getSection().getKind().isMergeableCString() ||
+ Sym.getSection().getKind().isMergeableConst())
return &Sym;
return NULL;
@@ -1914,4 +1915,3 @@ unsigned MipsELFObjectWriter::GetRelocType(const MCValue &Target,
return Type;
}
-
OpenPOWER on IntegriCloud