[Nios2] final infrastructure to provide compilation of a return from a function

This patch includes all missing functionality needed to provide first
compilation of a simple program that just returns from a function.
I've added a test case that checks for "ret" instruction printed in assembly
output.

Patch by Andrei Grischenko (andrei.l.grischenko@intel.com)
Differential revision: https://reviews.llvm.org/D39688

llvm-svn: 320035
diff --git a/llvm/lib/Target/Nios2/Nios2TargetObjectFile.cpp b/llvm/lib/Target/Nios2/Nios2TargetObjectFile.cpp
new file mode 100644
index 0000000..5fc85ef
--- /dev/null
+++ b/llvm/lib/Target/Nios2/Nios2TargetObjectFile.cpp
@@ -0,0 +1,18 @@
+//===-- Nios2TargetObjectFile.cpp - Nios2 Object Files --------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "Nios2TargetObjectFile.h"
+
+using namespace llvm;
+
+void Nios2TargetObjectFile::Initialize(MCContext &Ctx,
+                                       const TargetMachine &TM) {
+  TargetLoweringObjectFileELF::Initialize(Ctx, TM);
+  InitializeELF(TM.Options.UseInitArray);
+}