diff options
author | Jack Carter <jcarter@mips.com> | 2013-02-19 21:57:35 +0000 |
---|---|---|
committer | Jack Carter <jcarter@mips.com> | 2013-02-19 21:57:35 +0000 |
commit | 77afbdce53aa740777486b0cc4e9df151ae65468 (patch) | |
tree | 5a88999e0f6d615b69f8e750be18b064a50adc0c /include | |
parent | 608e3554847ef35995b7310ba8acd43ab861e3f0 (diff) |
ELF symbol table field st_other support,
excluding visibility bits.
Generic STO handling at the Target level.
The st_other field of the ELF symbol table is one
byte in size. The first 2 bytes are used for generic
visibility and are currently handled by llvm.
The other six bits are processor specific and need
to be set at the target level.
A couple of notes:
The new static methods for accessing and setting the "other"
flags in include/llvm/MC/MCELF.h match the style guide
and not the other methods in the file. I don't like the
inconsistency, but feel I should follow the prescribed
lowerUpper() convention.
STO_ value definitions are not specified in gnu land as
consistently as the STT_ and STB_ fields. Probably because
the latter were defined in a standards doc and the former
defined partially in code. I have stuck with the full byte
definition of the flags.
Contributer: Zoran Jovanovic
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175561 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/MC/MCELF.h | 2 | ||||
-rw-r--r-- | include/llvm/MC/MCELFStreamer.h | 2 | ||||
-rw-r--r-- | include/llvm/MC/MCStreamer.h | 4 |
3 files changed, 8 insertions, 0 deletions
diff --git a/include/llvm/MC/MCELF.h b/include/llvm/MC/MCELF.h index e08f1e6542..7e59911a89 100644 --- a/include/llvm/MC/MCELF.h +++ b/include/llvm/MC/MCELF.h @@ -28,6 +28,8 @@ class MCELF { static unsigned GetType(const MCSymbolData &SD); static void SetVisibility(MCSymbolData &SD, unsigned Visibility); static unsigned GetVisibility(MCSymbolData &SD); + static void setOther(MCSymbolData &SD, unsigned Other); + static unsigned getOther(MCSymbolData &SD); }; } diff --git a/include/llvm/MC/MCELFStreamer.h b/include/llvm/MC/MCELFStreamer.h index f78de15701..6fb2d22be2 100644 --- a/include/llvm/MC/MCELFStreamer.h +++ b/include/llvm/MC/MCELFStreamer.h @@ -65,6 +65,8 @@ public: virtual void EmitCOFFSymbolType(int Type); virtual void EndCOFFSymbolDef(); + virtual MCSymbolData &getOrCreateSymbolData(MCSymbol *Symbol); + virtual void EmitELFSize(MCSymbol *Symbol, const MCExpr *Value); virtual void EmitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size, diff --git a/include/llvm/MC/MCStreamer.h b/include/llvm/MC/MCStreamer.h index 9bc4a8bbb5..d247066cd9 100644 --- a/include/llvm/MC/MCStreamer.h +++ b/include/llvm/MC/MCStreamer.h @@ -16,6 +16,7 @@ #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/SmallVector.h" +#include "llvm/MC/MCAssembler.h" #include "llvm/MC/MCDirectives.h" #include "llvm/MC/MCDwarf.h" #include "llvm/MC/MCWin64EH.h" @@ -286,6 +287,9 @@ namespace llvm { /// a Thumb mode function (ARM target only). virtual void EmitThumbFunc(MCSymbol *Func) = 0; + /// getOrCreateSymbolData - Get symbol data for given symbol. + virtual MCSymbolData &getOrCreateSymbolData(MCSymbol *Symbol); + /// EmitAssignment - Emit an assignment of @p Value to @p Symbol. /// /// This corresponds to an assembler statement such as: |