mirror of
https://github.com/intel/llvm.git
synced 2026-01-19 17:45:07 +08:00
Fixed code that was not checked before on windows for me, because of testcases that are
disabled on that platform atm.
Inital commit message:
"[ELF] - Versionscript: do not treat non-wildcarded names as wildcards."
Previously we incorrectly handled cases when symbol name in extern c++ tag
was enclosed in quotes. Next case was treated as wildcard:
GLIBCXX_3.4 {
extern "C++" {
"aaa*"
}
But it should have not. Quotes around aaa here means that we should have do exact
name matching.
That is PR30268 which has name with pointer is interpreted as wildcard by lld:
extern "C++" {
"operator delete[](void*)";
Patch fixes the issue.
Differential revision: https://reviews.llvm.org/D24229
llvm-svn: 281049
59 lines
1.5 KiB
C++
59 lines
1.5 KiB
C++
//===- SymbolListFile.cpp -------------------------------------------------===//
|
|
//
|
|
// The LLVM Linker
|
|
//
|
|
// This file is distributed under the University of Illinois Open Source
|
|
// License. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// This file contains the parser/evaluator of the linker script.
|
|
// It does not construct an AST but consume linker script directives directly.
|
|
// Results are written to Driver or Config object.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include "SymbolListFile.h"
|
|
#include "Config.h"
|
|
#include "ScriptParser.h"
|
|
#include "Strings.h"
|
|
#include "llvm/Support/MemoryBuffer.h"
|
|
|
|
using namespace llvm;
|
|
using namespace llvm::ELF;
|
|
|
|
using namespace lld;
|
|
using namespace lld::elf;
|
|
|
|
// Parse the --dynamic-list argument. A dynamic list is in the form
|
|
//
|
|
// { symbol1; symbol2; [...]; symbolN };
|
|
//
|
|
// Multiple groups can be defined in the same file, and they are merged
|
|
// into a single group.
|
|
|
|
namespace {
|
|
class DynamicListParser final : public ScriptParserBase {
|
|
public:
|
|
DynamicListParser(StringRef S) : ScriptParserBase(S) {}
|
|
void run();
|
|
};
|
|
} // end anonymous namespace
|
|
|
|
void DynamicListParser::run() {
|
|
while (!atEOF()) {
|
|
expect("{");
|
|
while (!Error) {
|
|
Config->DynamicList.push_back(unquote(next()));
|
|
expect(";");
|
|
if (skip("}"))
|
|
break;
|
|
}
|
|
expect(";");
|
|
}
|
|
}
|
|
|
|
void elf::parseDynamicList(MemoryBufferRef MB) {
|
|
DynamicListParser(MB.getBuffer()).run();
|
|
}
|