Work around gold bug http://sourceware.org/PR16794.

llvm-svn: 205416
diff --git a/llvm/lib/MC/ELFObjectWriter.cpp b/llvm/lib/MC/ELFObjectWriter.cpp
index d8f03fc..e9b8fe2 100644
--- a/llvm/lib/MC/ELFObjectWriter.cpp
+++ b/llvm/lib/MC/ELFObjectWriter.cpp
@@ -796,6 +796,11 @@
   if (Flags & ELF::SHF_MERGE) {
     if (C != 0)
       return true;
+
+    // It looks like gold has a bug (http://sourceware.org/PR16794) and can
+    // only handle section relocations to mergeable sections if using RELA.
+    if (!hasRelocationAddend())
+      return true;
   }
 
   // Most TLS relocations use a got, so they need the symbol. Even those that