diff options
| author | Bruno Cardoso Lopes <bruno.cardoso@gmail.com> | 2011-12-06 03:34:42 +0000 | 
|---|---|---|
| committer | Bruno Cardoso Lopes <bruno.cardoso@gmail.com> | 2011-12-06 03:34:42 +0000 | 
| commit | 87cfffe1492646049776d25713df873d1952b911 (patch) | |
| tree | bed9fa94c067db43fbcf38db00f0124678b32509 /llvm/lib/MC | |
| parent | 1b1a122b4cfd5497f8ff73b99103246dfabab426 (diff) | |
| download | bcm5719-llvm-87cfffe1492646049776d25713df873d1952b911.tar.gz bcm5719-llvm-87cfffe1492646049776d25713df873d1952b911.zip  | |
Explicit symbols for gnu mimicing relocations. Patch by Jack Carter
llvm-svn: 145911
Diffstat (limited to 'llvm/lib/MC')
| -rw-r--r-- | llvm/lib/MC/ELFObjectWriter.cpp | 14 | ||||
| -rw-r--r-- | llvm/lib/MC/ELFObjectWriter.h | 6 | 
2 files changed, 20 insertions, 0 deletions
diff --git a/llvm/lib/MC/ELFObjectWriter.cpp b/llvm/lib/MC/ELFObjectWriter.cpp index 02e1b3ab985..132e81788d8 100644 --- a/llvm/lib/MC/ELFObjectWriter.cpp +++ b/llvm/lib/MC/ELFObjectWriter.cpp @@ -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, diff --git a/llvm/lib/MC/ELFObjectWriter.h b/llvm/lib/MC/ELFObjectWriter.h index 78382065dbc..9adf0b1bd0f 100644 --- a/llvm/lib/MC/ELFObjectWriter.h +++ b/llvm/lib/MC/ELFObjectWriter.h @@ -445,6 +445,12 @@ class ELFObjectWriter : public MCObjectWriter {      virtual void WriteEFlags();    protected: +    virtual const MCSymbol *ExplicitRelSym(const MCAssembler &Asm, +                                           const MCValue &Target, +                                           const MCFragment &F, +                                           const MCFixup &Fixup, +                                           bool IsPCRel) const; +      virtual unsigned GetRelocType(const MCValue &Target, const MCFixup &Fixup,                                    bool IsPCRel, bool IsRelocWithSymbol,                                    int64_t Addend);  | 

