From 5cc3dc86bbbb320bd8fd7d67e27c69e8c0e13a01 Mon Sep 17 00:00:00 2001 From: Tim Northover Date: Fri, 7 Dec 2012 16:50:23 +0000 Subject: Added Mapping Symbols for ARM ELF Before this patch, when you objdump an LLVM-compiled file, objdump tried to decode data-in-code sections as if they were code. This patch adds the missing Mapping Symbols, as defined by "ELF for the ARM Architecture" (ARM IHI 0044D). Patch based on work by Greg Fitzgerald. llvm-svn: 169609 --- llvm/lib/MC/ELFObjectWriter.cpp | 2 +- llvm/lib/MC/MCELF.cpp | 2 +- llvm/lib/MC/MCELF.h | 35 ----------------------------------- llvm/lib/MC/MCELFStreamer.cpp | 23 ++++++----------------- 4 files changed, 8 insertions(+), 54 deletions(-) delete mode 100644 llvm/lib/MC/MCELF.h (limited to 'llvm/lib/MC') diff --git a/llvm/lib/MC/ELFObjectWriter.cpp b/llvm/lib/MC/ELFObjectWriter.cpp index 5b10fbbe75d..b0623d35a9e 100644 --- a/llvm/lib/MC/ELFObjectWriter.cpp +++ b/llvm/lib/MC/ELFObjectWriter.cpp @@ -12,7 +12,6 @@ //===----------------------------------------------------------------------===// #include "llvm/MC/MCELFObjectWriter.h" -#include "MCELF.h" #include "llvm/ADT/OwningPtr.h" #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/SmallPtrSet.h" @@ -22,6 +21,7 @@ #include "llvm/MC/MCAsmLayout.h" #include "llvm/MC/MCAssembler.h" #include "llvm/MC/MCContext.h" +#include "llvm/MC/MCELF.h" #include "llvm/MC/MCELFSymbolFlags.h" #include "llvm/MC/MCExpr.h" #include "llvm/MC/MCFixupKindInfo.h" diff --git a/llvm/lib/MC/MCELF.cpp b/llvm/lib/MC/MCELF.cpp index f9f98e0f730..4db2846bc3d 100644 --- a/llvm/lib/MC/MCELF.cpp +++ b/llvm/lib/MC/MCELF.cpp @@ -11,7 +11,7 @@ // //===----------------------------------------------------------------------===// -#include "MCELF.h" +#include "llvm/MC/MCELF.h" #include "llvm/MC/MCAssembler.h" #include "llvm/MC/MCELFSymbolFlags.h" #include "llvm/MC/MCFixupKindInfo.h" diff --git a/llvm/lib/MC/MCELF.h b/llvm/lib/MC/MCELF.h deleted file mode 100644 index e08f1e65429..00000000000 --- a/llvm/lib/MC/MCELF.h +++ /dev/null @@ -1,35 +0,0 @@ -//===- lib/MC/MCELF.h - ELF MC --------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file contains some support functions used by the ELF Streamer and -// ObjectWriter. -// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_MC_MCELF_H -#define LLVM_MC_MCELF_H - -#include "llvm/MC/MCExpr.h" - -namespace llvm { -class MCSymbolData; - -class MCELF { - public: - static void SetBinding(MCSymbolData &SD, unsigned Binding); - static unsigned GetBinding(const MCSymbolData &SD); - static void SetType(MCSymbolData &SD, unsigned Type); - static unsigned GetType(const MCSymbolData &SD); - static void SetVisibility(MCSymbolData &SD, unsigned Visibility); - static unsigned GetVisibility(MCSymbolData &SD); -}; - -} - -#endif diff --git a/llvm/lib/MC/MCELFStreamer.cpp b/llvm/lib/MC/MCELFStreamer.cpp index a3178ffd615..c58a6ae52c6 100644 --- a/llvm/lib/MC/MCELFStreamer.cpp +++ b/llvm/lib/MC/MCELFStreamer.cpp @@ -12,15 +12,11 @@ //===----------------------------------------------------------------------===// #include "llvm/MC/MCELFStreamer.h" - -#include "MCELF.h" #include "llvm/ADT/SmallPtrSet.h" -#include "llvm/ADT/StringExtras.h" -#include "llvm/ADT/Twine.h" -#include "llvm/MC/MCAsmBackend.h" #include "llvm/MC/MCAssembler.h" #include "llvm/MC/MCCodeEmitter.h" #include "llvm/MC/MCContext.h" +#include "llvm/MC/MCELF.h" #include "llvm/MC/MCELFSymbolFlags.h" #include "llvm/MC/MCExpr.h" #include "llvm/MC/MCInst.h" @@ -104,15 +100,6 @@ void MCELFStreamer::EmitAssemblerFlag(MCAssemblerFlag Flag) { llvm_unreachable("invalid assembler flag!"); } -void MCELFStreamer::EmitThumbFunc(MCSymbol *Func) { - // FIXME: Anything needed here to flag the function as thumb? - - getAssembler().setIsThumbFunc(Func); - - MCSymbolData &SD = getAssembler().getOrCreateSymbolData(*Func); - SD.setFlags(SD.getFlags() | ELF_Other_ThumbFunc); -} - void MCELFStreamer::EmitAssignment(MCSymbol *Symbol, const MCExpr *Value) { // TODO: This is exactly the same as WinCOFFStreamer. Consider merging into // MCObjectStreamer. @@ -396,9 +383,7 @@ void MCELFStreamer::FinishImpl() { this->MCObjectStreamer::FinishImpl(); } - -void MCELFStreamer::EmitTCEntry(const MCSymbol &S) -{ +void MCELFStreamer::EmitTCEntry(const MCSymbol &S) { // Creates a R_PPC64_TOC relocation MCObjectStreamer::EmitSymbolValue(&S, 8, 0); } @@ -414,6 +399,10 @@ MCStreamer *llvm::createELFStreamer(MCContext &Context, MCAsmBackend &MAB, return S; } +void MCELFStreamer::EmitThumbFunc(MCSymbol *Func) { + llvm_unreachable("Generic ELF doesn't support this directive"); +} + void MCELFStreamer::EmitSymbolDesc(MCSymbol *Symbol, unsigned DescValue) { llvm_unreachable("ELF doesn't support this directive"); } -- cgit v1.2.3