[lld] r281046 - Revert r281045, it broke BB.
George Rimar via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 9 07:16:01 PDT 2016
Author: grimar
Date: Fri Sep 9 09:16:00 2016
New Revision: 281046
URL: http://llvm.org/viewvc/llvm-project?rev=281046&view=rev
Log:
Revert r281045, it broke BB.
Broken BB:
http://lab.llvm.org:8011/builders/lld-x86_64-darwin13/builds/27211
Removed:
lld/trunk/test/ELF/version-script-extern-exact.s
Modified:
lld/trunk/ELF/Config.h
lld/trunk/ELF/LinkerScript.cpp
lld/trunk/ELF/ScriptParser.cpp
lld/trunk/ELF/SymbolTable.cpp
lld/trunk/test/ELF/dynamic-list.s
Modified: lld/trunk/ELF/Config.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Config.h?rev=281046&r1=281045&r2=281046&view=diff
==============================================================================
--- lld/trunk/ELF/Config.h (original)
+++ lld/trunk/ELF/Config.h Fri Sep 9 09:16:00 2016
@@ -45,7 +45,6 @@ enum class UnresolvedPolicy { NoUndef, R
struct SymbolVersion {
llvm::StringRef Name;
bool IsExternCpp;
- bool HasWildcards;
};
// This struct contains symbols version definition that
Modified: lld/trunk/ELF/LinkerScript.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/LinkerScript.cpp?rev=281046&r1=281045&r2=281046&view=diff
==============================================================================
--- lld/trunk/ELF/LinkerScript.cpp (original)
+++ lld/trunk/ELF/LinkerScript.cpp Fri Sep 9 09:16:00 2016
@@ -780,18 +780,12 @@ void ScriptParser::addFile(StringRef S)
}
}
-static StringRef unquote(StringRef S) {
- if (!S.startswith("\""))
- return S;
- return S.substr(1, S.size() - 2);
-}
-
void ScriptParser::readAsNeeded() {
expect("(");
bool Orig = Config->AsNeeded;
Config->AsNeeded = true;
while (!Error && !skip(")"))
- addFile(unquote(next()));
+ addFile(next());
Config->AsNeeded = Orig;
}
@@ -817,13 +811,13 @@ void ScriptParser::readGroup() {
if (Tok == "AS_NEEDED")
readAsNeeded();
else
- addFile(unquote(Tok));
+ addFile(Tok);
}
}
void ScriptParser::readInclude() {
StringRef Tok = next();
- auto MBOrErr = MemoryBuffer::getFile(unquote(Tok));
+ auto MBOrErr = MemoryBuffer::getFile(Tok);
if (!MBOrErr) {
setError("cannot open " + Tok);
return;
@@ -839,7 +833,7 @@ void ScriptParser::readOutput() {
expect("(");
StringRef Tok = next();
if (Config->OutputFile.empty())
- Config->OutputFile = unquote(Tok);
+ Config->OutputFile = Tok;
expect(")");
}
@@ -1010,7 +1004,7 @@ Expr ScriptParser::readAssert() {
expect("(");
Expr E = readExpr();
expect(",");
- StringRef Msg = unquote(next());
+ StringRef Msg = next();
expect(")");
return [=](uint64_t Dot) {
uint64_t V = E(Dot);
@@ -1427,14 +1421,13 @@ void ScriptParser::readLocal() {
}
void ScriptParser::readExtern(std::vector<SymbolVersion> *Globals) {
- expect("\"C++\"");
+ expect("C++");
expect("{");
for (;;) {
if (peek() == "}" || Error)
break;
- bool HasWildcard = !peek().startswith("\"") && hasWildcard(peek());
- Globals->push_back({unquote(next()), true, HasWildcard});
+ Globals->push_back({next(), true});
expect(";");
}
@@ -1457,7 +1450,7 @@ void ScriptParser::readGlobal(StringRef
if (Cur == "}" || Cur == "local:" || Error)
return;
next();
- Globals->push_back({unquote(Cur), false, hasWildcard(Cur)});
+ Globals->push_back({Cur, false});
expect(";");
}
}
Modified: lld/trunk/ELF/ScriptParser.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/ScriptParser.cpp?rev=281046&r1=281045&r2=281046&view=diff
==============================================================================
--- lld/trunk/ELF/ScriptParser.cpp (original)
+++ lld/trunk/ELF/ScriptParser.cpp Fri Sep 9 09:16:00 2016
@@ -60,17 +60,14 @@ std::vector<StringRef> ScriptParserBase:
if (S.empty())
return Ret;
- // Quoted token. Note that double-quote characters are parts of a token
- // because, in a glob match context, only unquoted tokens are interpreted
- // as glob patterns. Double-quoted tokens are literal patterns in that
- // context.
+ // Quoted token.
if (S.startswith("\"")) {
size_t E = S.find("\"", 1);
if (E == StringRef::npos) {
error("unclosed quote");
return {};
}
- Ret.push_back(S.take_front(E + 1));
+ Ret.push_back(S.substr(1, E - 1));
S = S.substr(E + 1);
continue;
}
Modified: lld/trunk/ELF/SymbolTable.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SymbolTable.cpp?rev=281046&r1=281045&r2=281046&view=diff
==============================================================================
--- lld/trunk/ELF/SymbolTable.cpp (original)
+++ lld/trunk/ELF/SymbolTable.cpp Fri Sep 9 09:16:00 2016
@@ -18,6 +18,7 @@
#include "Config.h"
#include "Error.h"
#include "LinkerScript.h"
+#include "Strings.h"
#include "SymbolListFile.h"
#include "Symbols.h"
#include "llvm/Bitcode/ReaderWriter.h"
@@ -677,7 +678,7 @@ template <class ELFT> void SymbolTable<E
// i.e. version definitions not containing any glob meta-characters.
for (VersionDefinition &V : Config->VersionDefinitions) {
for (SymbolVersion Sym : V.Globals) {
- if (Sym.HasWildcards)
+ if (hasWildcard(Sym.Name))
continue;
StringRef N = Sym.Name;
SymbolBody *B = Sym.IsExternCpp ? findDemangled(Demangled, N) : find(N);
@@ -692,7 +693,7 @@ template <class ELFT> void SymbolTable<E
for (size_t I = Config->VersionDefinitions.size() - 1; I != (size_t)-1; --I) {
VersionDefinition &V = Config->VersionDefinitions[I];
for (SymbolVersion &Sym : V.Globals) {
- if (!Sym.HasWildcards)
+ if (!hasWildcard(Sym.Name))
continue;
Regex Re = compileGlobPatterns({Sym.Name});
std::vector<SymbolBody *> Syms =
Modified: lld/trunk/test/ELF/dynamic-list.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/dynamic-list.s?rev=281046&r1=281045&r2=281046&view=diff
==============================================================================
--- lld/trunk/test/ELF/dynamic-list.s (original)
+++ lld/trunk/test/ELF/dynamic-list.s Fri Sep 9 09:16:00 2016
@@ -2,8 +2,6 @@
## implemented in Python, and the Cygwin implementations of the Unix utilities.
## Avoid running these tests on Windows for now by requiring a real shell.
-# REQUIRES: shell
-
# REQUIRES: x86
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %p/Inputs/shared.s -o %t2.o
Removed: lld/trunk/test/ELF/version-script-extern-exact.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/version-script-extern-exact.s?rev=281045&view=auto
==============================================================================
--- lld/trunk/test/ELF/version-script-extern-exact.s (original)
+++ lld/trunk/test/ELF/version-script-extern-exact.s (removed)
@@ -1,22 +0,0 @@
-# REQUIRES: x86
-
-# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
-# RUN: echo "FOO { global: extern \"C++\" { \"aaa*\"; }; };" > %t.script
-# RUN: ld.lld --version-script %t.script -shared %t.o -o %t.so
-# RUN: llvm-readobj -V -dyn-symbols %t.so | FileCheck %s
-
-# CHECK: Symbol {
-# CHECK: Name: _Z3aaaPf@ (1)
-# CHECK: Symbol {
-# CHECK: Name: _Z3aaaPi@ (10)
-
-.text
-.globl _Z3aaaPi
-.type _Z3aaaPi, at function
-_Z3aaaPi:
-retq
-
-.globl _Z3aaaPf
-.type _Z3aaaPf, at function
-_Z3aaaPf:
-retq
More information about the llvm-commits
mailing list