It is possible that subprgoram definition is only encoding return value directly...
[oota-llvm.git] / lib / CodeGen / ELFWriter.cpp
index 5d2fca134e67de1683842d2995e03d3ebc1958a6..7cca74b1fb14acb44e0aa569ad3870de7cfe95ad 100644 (file)
@@ -121,6 +121,10 @@ namespace llvm {
       assert(0 && "JIT specific function called!");
       abort();
     }
+    void startGVStub(const GlobalValue* F,  void *Buffer, unsigned StubSize) {
+      assert(0 && "JIT specific function called!");
+      abort();
+    }
     void *finishGVStub(const GlobalValue *F) {
       assert(0 && "JIT specific function called!");
       abort();
@@ -174,6 +178,8 @@ bool ELFCodeEmitter::finishFunction(MachineFunction &F) {
   case GlobalValue::WeakLinkage:
     FnSym.SetBind(ELFWriter::ELFSym::STB_WEAK);
     break;
+  case GlobalValue::PrivateLinkage:
+    assert (0 && "PrivateLinkage should not be in the symbol table.");
   case GlobalValue::InternalLinkage:
     FnSym.SetBind(ELFWriter::ELFSym::STB_LOCAL);
     break;
@@ -329,7 +335,8 @@ void ELFWriter::EmitGlobal(GlobalVariable *GV) {
 
     // Set the idx of the .bss section
     BSSSym.SectionIdx = BSSSection.SectionIdx;
-    SymbolTable.push_back(BSSSym);
+    if (!GV->hasPrivateLinkage())
+      SymbolTable.push_back(BSSSym);
 
     // Reserve space in the .bss section for this symbol.
     BSSSection.Size += Size;