commit 98b3f4f999d949d6b028b99217484596b3afa982 Author: Brandon Bergren Date: Fri Nov 8 21:57:52 2019 -0600 SEND TO LLD: Actually *allow* text relocations when allowing text relocations. diff --git a/contrib/llvm/tools/lld/ELF/Relocations.cpp b/contrib/llvm/tools/lld/ELF/Relocations.cpp index 671b76f0ddf..e57b0a15b5e 100644 --- a/contrib/llvm/tools/lld/ELF/Relocations.cpp +++ b/contrib/llvm/tools/lld/ELF/Relocations.cpp @@ -1074,10 +1074,11 @@ static void processRelocAux(InputSectionBase &sec, RelExpr expr, RelType type, "or pass '-Wl,-z,notext' to allow text relocations in the output" + getLocation(sec, sym, offset)); else - errorOrWarn( - "relocation " + toString(type) + " cannot be used against " + - (sym.getName().empty() ? "local symbol" : "symbol " + toString(sym)) + - "; recompile with -fPIC" + getLocation(sec, sym, offset)); + if (!canWrite) + errorOrWarn( + "relocation " + toString(type) + " cannot be used against " + + (sym.getName().empty() ? "local symbol" : "symbol " + toString(sym)) + + "; recompile with -fPIC" + getLocation(sec, sym, offset)); return; }