Index: ELF/ScriptLexer.cpp =================================================================== --- ELF/ScriptLexer.cpp +++ ELF/ScriptLexer.cpp @@ -168,7 +168,7 @@ // Split a given string as an expression. // This function returns "3", "*" and "5" for "3*5" for example. static std::vector tokenizeExpr(StringRef S) { - StringRef Ops = "+-*/:"; // List of operators + StringRef Ops = "+-*/:~"; // List of operators // Quoted strings are literal strings, so we don't want to split it. if (S.startswith("\"")) Index: test/ELF/linkerscript/symbol-assignexpr.s =================================================================== --- test/ELF/linkerscript/symbol-assignexpr.s +++ test/ELF/linkerscript/symbol-assignexpr.s @@ -6,7 +6,7 @@ # RUN: symbol2 = symbol + 0x1234; \ # RUN: symbol3 = symbol2; \ # RUN: symbol4 = symbol + -4; \ -# RUN: symbol5 = symbol - ~ 0xfffb; \ +# RUN: symbol5 = symbol - ~0xfffb; \ # RUN: symbol6 = symbol - ~(0xfff0 + 0xb); \ # RUN: symbol7 = symbol - ~ 0xfffb + 4; \ # RUN: symbol8 = ~ 0xffff + 4; \