Explicit symbols for gnu mimicing relocations. Patch by Jack Carter
[oota-llvm.git] / lib / MC / ELFObjectWriter.cpp
index 02e1b3ab9859e2978101cc3eabc611a3029ed66c..132e81788d8b16e88a8e3e559d923552ee4f0248 100644 (file)
@@ -1831,6 +1831,20 @@ void MipsELFObjectWriter::WriteEFlags() {
           ELF::EF_MIPS_ARCH_32R2);
 }
 
+const MCSymbol *MipsELFObjectWriter::ExplicitRelSym(const MCAssembler &Asm,
+                                                    const MCValue &Target,
+                                                    const MCFragment &F,
+                                                    const MCFixup &Fixup,
+                                                    bool IsPCRel) const {
+  assert(Target.getSymA() && "SymA cannot be 0.");
+  const MCSymbol &Sym = Target.getSymA()->getSymbol();
+  
+  if (Sym.getSection().getKind().isMergeable1ByteCString())
+    return &Sym;
+
+  return NULL;
+}
+
 unsigned MipsELFObjectWriter::GetRelocType(const MCValue &Target,
                                            const MCFixup &Fixup,
                                            bool IsPCRel,