aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/llvm/lib/Object/Archive.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2022-07-04 19:20:19 +0000
committerDimitry Andric <dim@FreeBSD.org>2023-02-08 19:02:26 +0000
commit81ad626541db97eb356e2c1d4a20eb2a26a766ab (patch)
tree311b6a8987c32b1e1dcbab65c54cfac3fdb56175 /contrib/llvm-project/llvm/lib/Object/Archive.cpp
parent5fff09660e06a66bed6482da9c70df328e16bbb6 (diff)
parent145449b1e420787bb99721a429341fa6be3adfb6 (diff)
Diffstat (limited to 'contrib/llvm-project/llvm/lib/Object/Archive.cpp')
-rw-r--r--contrib/llvm-project/llvm/lib/Object/Archive.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/contrib/llvm-project/llvm/lib/Object/Archive.cpp b/contrib/llvm-project/llvm/lib/Object/Archive.cpp
index 9a4ef055faa4..ad03f9cae9f8 100644
--- a/contrib/llvm-project/llvm/lib/Object/Archive.cpp
+++ b/contrib/llvm-project/llvm/lib/Object/Archive.cpp
@@ -22,6 +22,7 @@
#include "llvm/Support/Error.h"
#include "llvm/Support/ErrorOr.h"
#include "llvm/Support/FileSystem.h"
+#include "llvm/Support/Host.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/Path.h"
@@ -30,7 +31,6 @@
#include <cassert>
#include <cstddef>
#include <cstdint>
-#include <cstring>
#include <memory>
#include <string>
#include <system_error>
@@ -257,6 +257,14 @@ Expected<StringRef> ArchiveMemberHeader::getName(uint64_t Size) const {
return Name;
if (Name.size() == 2 && Name[1] == '/') // String table.
return Name;
+ // System libraries from the Windows SDK for Windows 11 contain this symbol.
+ // It looks like a CFG guard: we just skip it for now.
+ if (Name.equals("/<XFGHASHMAP>/"))
+ return Name;
+ // Some libraries (e.g., arm64rt.lib) from the Windows WDK
+ // (version 10.0.22000.0) contain this undocumented special member.
+ if (Name.equals("/<ECSYMBOLS>/"))
+ return Name;
// It's a long name.
// Get the string table offset.
std::size_t StringOffset;
@@ -922,6 +930,14 @@ Archive::Archive(MemoryBufferRef Source, Error &Err)
Err = Error::success();
}
+object::Archive::Kind Archive::getDefaultKindForHost() {
+ Triple HostTriple(sys::getProcessTriple());
+ return HostTriple.isOSDarwin()
+ ? object::Archive::K_DARWIN
+ : (HostTriple.isOSAIX() ? object::Archive::K_AIXBIG
+ : object::Archive::K_GNU);
+}
+
Archive::child_iterator Archive::child_begin(Error &Err,
bool SkipInternal) const {
if (isEmpty())