summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMatt Fleming <matt@console-pimps.org>2010-08-16 18:35:43 +0000
committerMatt Fleming <matt@console-pimps.org>2010-08-16 18:35:43 +0000
commit6b2e257e74b2c8e2f93bb244e0c80cb73005b74a (patch)
treeb8c7a1032963f3c677507eae205cbec13e0d7856 /include
parenta8bf473fb15bbedc78144ec57438f884616283b0 (diff)
downloadllvm-6b2e257e74b2c8e2f93bb244e0c80cb73005b74a.tar.gz
llvm-6b2e257e74b2c8e2f93bb244e0c80cb73005b74a.tar.bz2
llvm-6b2e257e74b2c8e2f93bb244e0c80cb73005b74a.tar.xz
Add ELF ObjectWriter and Streamer support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111172 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/MC/MCSectionELF.h5
-rw-r--r--include/llvm/MC/MCStreamer.h6
-rw-r--r--include/llvm/Support/ELF.h6
3 files changed, 15 insertions, 2 deletions
diff --git a/include/llvm/MC/MCSectionELF.h b/include/llvm/MC/MCSectionELF.h
index a90aa38156..5de0bf58fe 100644
--- a/include/llvm/MC/MCSectionELF.h
+++ b/include/llvm/MC/MCSectionELF.h
@@ -44,9 +44,9 @@ class MCSectionELF : public MCSection {
private:
friend class MCContext;
MCSectionELF(StringRef Section, unsigned type, unsigned flags,
- SectionKind K, bool isExplicit)
+ SectionKind K, bool isExplicit, unsigned entrySize)
: MCSection(SV_ELF, K), SectionName(Section), Type(type), Flags(flags),
- IsExplicit(isExplicit) {}
+ IsExplicit(isExplicit), EntrySize(entrySize) {}
~MCSectionELF();
public:
@@ -174,6 +174,7 @@ public:
StringRef getSectionName() const { return SectionName; }
unsigned getType() const { return Type; }
unsigned getFlags() const { return Flags; }
+ unsigned getEntrySize() const { return EntrySize; }
void PrintSwitchToSection(const MCAsmInfo &MAI,
raw_ostream &OS) const;
diff --git a/include/llvm/MC/MCStreamer.h b/include/llvm/MC/MCStreamer.h
index 5767a94a6b..e152c39e19 100644
--- a/include/llvm/MC/MCStreamer.h
+++ b/include/llvm/MC/MCStreamer.h
@@ -359,6 +359,12 @@ namespace llvm {
MCCodeEmitter &CE, raw_ostream &OS,
bool RelaxAll = false);
+ /// createELFStreamer - Create a machine code streamer which will generate
+ /// ELF format object files.
+ MCStreamer *createELFStreamer(MCContext &Ctx, TargetAsmBackend &TAB,
+ raw_ostream &OS, MCCodeEmitter *CE,
+ bool RelaxAll = false);
+
/// createLoggingStreamer - Create a machine code streamer which just logs the
/// API calls and then dispatches to another streamer.
///
diff --git a/include/llvm/Support/ELF.h b/include/llvm/Support/ELF.h
index a4223cf6ca..f33aeb4188 100644
--- a/include/llvm/Support/ELF.h
+++ b/include/llvm/Support/ELF.h
@@ -330,6 +330,12 @@ struct Elf64_Sym {
}
};
+// The size (in bytes) of symbol table entries.
+enum {
+ SYMENTRY_SIZE32 = 16, // 32-bit symbol entry size
+ SYMENTRY_SIZE64 = 24 // 64-bit symbol entry size.
+};
+
// Symbol bindings.
enum {
STB_LOCAL = 0, // Local symbol, not visible outside obj file containing def