diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2011-05-01 03:50:49 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2011-05-01 03:50:49 +0000 |
commit | debd7e4e8bc5cfe61bfb71835ce2b1a3fbccc2be (patch) | |
tree | 7069783c01e7b31f77ab0886700221df01554a8a /lib/MC/MCDwarf.cpp | |
parent | d4b0c6c3fa22deee5c447e982058e38022968656 (diff) |
Simplify the handling of pcrel relocations on ELF. Now we do the right thing
for all symbol differences and can drop the old EmitPCRelSymbolValue
method.
This also make getExprForFDESymbol on ELF equal to the one on MachO, and it
can be made non-virtual.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130634 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/MCDwarf.cpp')
-rw-r--r-- | lib/MC/MCDwarf.cpp | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/lib/MC/MCDwarf.cpp b/lib/MC/MCDwarf.cpp index 0296951490..09a87fb0bf 100644 --- a/lib/MC/MCDwarf.cpp +++ b/lib/MC/MCDwarf.cpp @@ -468,26 +468,21 @@ static void EmitSymbol(MCStreamer &streamer, const MCSymbol &symbol, MCContext &context = streamer.getContext(); const MCAsmInfo &asmInfo = context.getAsmInfo(); const MCExpr *v = asmInfo.getExprForFDESymbol(&symbol, + symbolEncoding, streamer); unsigned size = getSizeForEncoding(streamer, symbolEncoding); - unsigned application = symbolEncoding & 0x70; - if (isa<MCSymbolRefExpr>(v) && application == dwarf::DW_EH_PE_pcrel) - streamer.EmitPCRelValue(v, size); - else - streamer.EmitAbsValue(v, size); + streamer.EmitAbsValue(v, size); } static void EmitPersonality(MCStreamer &streamer, const MCSymbol &symbol, unsigned symbolEncoding) { MCContext &context = streamer.getContext(); const MCAsmInfo &asmInfo = context.getAsmInfo(); - const MCExpr *v = asmInfo.getExprForPersonalitySymbol(&symbol, streamer); + const MCExpr *v = asmInfo.getExprForPersonalitySymbol(&symbol, + symbolEncoding, + streamer); unsigned size = getSizeForEncoding(streamer, symbolEncoding); - unsigned application = symbolEncoding & 0x70; - if (isa<MCSymbolRefExpr>(v) && application == dwarf::DW_EH_PE_pcrel) - streamer.EmitPCRelValue(v, size); - else - streamer.EmitValue(v, size); + streamer.EmitValue(v, size); } static const MachineLocation TranslateMachineLocation( |