aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/MC/ELFObjectWriter.cpp
diff options
context:
space:
mode:
authorMitch Phillips <31459023+hctim@users.noreply.github.com>2020-08-07 10:56:33 -0700
committerMitch Phillips <31459023+hctim@users.noreply.github.com>2020-08-07 10:56:33 -0700
commit382df1c6744d09e9f3362f9743788574913980b4 (patch)
tree2808d318a748688202380f8daf644a7fab9ee642 /llvm/lib/MC/ELFObjectWriter.cpp
parentac3e720dc1af9555c5591017bd2b6c7f6641a34d (diff)
downloadllvm-382df1c6744d09e9f3362f9743788574913980b4.zip
llvm-382df1c6744d09e9f3362f9743788574913980b4.tar.gz
llvm-382df1c6744d09e9f3362f9743788574913980b4.tar.bz2
Revert "Reland D64327 [MC][ELF] Allow STT_SECTION referencing SHF_MERGE on REL targets"
This reverts commit b497665d98ad5026b1d3d67d5793a28fefe27bea. Spent some time trying to reproduce this locally, reverting in a desparate attempt to fix the sanitizer buildbot: - http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/builds/28828 I don't know exactly why or how this patch breaks the bots, but it seems pretty concrete that it's the culprit.
Diffstat (limited to 'llvm/lib/MC/ELFObjectWriter.cpp')
-rw-r--r--llvm/lib/MC/ELFObjectWriter.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/MC/ELFObjectWriter.cpp b/llvm/lib/MC/ELFObjectWriter.cpp
index b44a36b..494f825 100644
--- a/llvm/lib/MC/ELFObjectWriter.cpp
+++ b/llvm/lib/MC/ELFObjectWriter.cpp
@@ -1393,6 +1393,11 @@ bool ELFObjectWriter::shouldRelocateWithSymbol(const MCAssembler &Asm,
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