mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-09 17:43:57 +00:00
Unpollute the global namespace. lld edition.
llvm-svn: 277926
This commit is contained in:
parent
ef10e922d8
commit
df8f196f9a
@ -54,7 +54,7 @@ static uint16_t getImgRelRelocation() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class T> void append(std::vector<uint8_t> &B, const T &Data) {
|
template <class T> static void append(std::vector<uint8_t> &B, const T &Data) {
|
||||||
size_t S = B.size();
|
size_t S = B.size();
|
||||||
B.resize(S + sizeof(T));
|
B.resize(S + sizeof(T));
|
||||||
memcpy(&B[S], &Data, sizeof(T));
|
memcpy(&B[S], &Data, sizeof(T));
|
||||||
|
@ -41,6 +41,7 @@ using namespace llvm::support::endian;
|
|||||||
using namespace lld;
|
using namespace lld;
|
||||||
using namespace lld::elf;
|
using namespace lld::elf;
|
||||||
|
|
||||||
|
namespace {
|
||||||
// A resolved relocation. The Sec and Offset fields are set if the relocation
|
// A resolved relocation. The Sec and Offset fields are set if the relocation
|
||||||
// was resolved to an offset within a section.
|
// was resolved to an offset within a section.
|
||||||
template <class ELFT>
|
template <class ELFT>
|
||||||
@ -48,6 +49,7 @@ struct ResolvedReloc {
|
|||||||
InputSectionBase<ELFT> *Sec;
|
InputSectionBase<ELFT> *Sec;
|
||||||
typename ELFT::uint Offset;
|
typename ELFT::uint Offset;
|
||||||
};
|
};
|
||||||
|
} // end anonymous namespace
|
||||||
|
|
||||||
template <class ELFT>
|
template <class ELFT>
|
||||||
static typename ELFT::uint getAddend(InputSectionBase<ELFT> &Sec,
|
static typename ELFT::uint getAddend(InputSectionBase<ELFT> &Sec,
|
||||||
|
@ -31,11 +31,13 @@ using namespace lld::elf;
|
|||||||
// Multiple groups can be defined in the same file, and they are merged
|
// Multiple groups can be defined in the same file, and they are merged
|
||||||
// into a single group.
|
// into a single group.
|
||||||
|
|
||||||
|
namespace {
|
||||||
class DynamicListParser final : public ScriptParserBase {
|
class DynamicListParser final : public ScriptParserBase {
|
||||||
public:
|
public:
|
||||||
DynamicListParser(StringRef S) : ScriptParserBase(S) {}
|
DynamicListParser(StringRef S) : ScriptParserBase(S) {}
|
||||||
void run();
|
void run();
|
||||||
};
|
};
|
||||||
|
} // end anonymous namespace
|
||||||
|
|
||||||
void DynamicListParser::run() {
|
void DynamicListParser::run() {
|
||||||
while (!atEOF()) {
|
while (!atEOF()) {
|
||||||
@ -62,6 +64,7 @@ void elf::parseDynamicList(MemoryBufferRef MB) {
|
|||||||
// No wildcards are supported, other than for the local entry. Symbol versioning
|
// No wildcards are supported, other than for the local entry. Symbol versioning
|
||||||
// is also not supported.
|
// is also not supported.
|
||||||
|
|
||||||
|
namespace {
|
||||||
class VersionScriptParser final : public ScriptParserBase {
|
class VersionScriptParser final : public ScriptParserBase {
|
||||||
public:
|
public:
|
||||||
VersionScriptParser(StringRef S) : ScriptParserBase(S) {}
|
VersionScriptParser(StringRef S) : ScriptParserBase(S) {}
|
||||||
@ -74,6 +77,7 @@ private:
|
|||||||
void parseGlobal(StringRef VerStr);
|
void parseGlobal(StringRef VerStr);
|
||||||
void parseLocal();
|
void parseLocal();
|
||||||
};
|
};
|
||||||
|
} // end anonymous namespace
|
||||||
|
|
||||||
size_t elf::defineSymbolVersion(StringRef VerStr) {
|
size_t elf::defineSymbolVersion(StringRef VerStr) {
|
||||||
// Identifiers start at 2 because 0 and 1 are reserved
|
// Identifiers start at 2 because 0 and 1 are reserved
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
using namespace lld;
|
using namespace lld;
|
||||||
|
|
||||||
|
namespace {
|
||||||
class _YamlReaderErrorCategory : public std::error_category {
|
class _YamlReaderErrorCategory : public std::error_category {
|
||||||
public:
|
public:
|
||||||
const char* name() const LLVM_NOEXCEPT override {
|
const char* name() const LLVM_NOEXCEPT override {
|
||||||
@ -33,6 +34,7 @@ public:
|
|||||||
"message defined.");
|
"message defined.");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
} // end anonymous namespace
|
||||||
|
|
||||||
const std::error_category &lld::YamlReaderCategory() {
|
const std::error_category &lld::YamlReaderCategory() {
|
||||||
static _YamlReaderErrorCategory o;
|
static _YamlReaderErrorCategory o;
|
||||||
|
Loading…
Reference in New Issue
Block a user