[PATCH] D117511: [AIX] identify big archive magic as archive.
Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 19 09:19:24 PST 2022
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG3062a1469da0: [AIX] identify big archive magic as archive. (authored by zhijian <zhijian at ca.ibm.com>).
Changed prior to commit:
https://reviews.llvm.org/D117511?vs=400622&id=401282#toc
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D117511/new/
https://reviews.llvm.org/D117511
Files:
llvm/lib/BinaryFormat/Magic.cpp
llvm/unittests/BinaryFormat/TestFileMagic.cpp
Index: llvm/unittests/BinaryFormat/TestFileMagic.cpp
===================================================================
--- llvm/unittests/BinaryFormat/TestFileMagic.cpp
+++ llvm/unittests/BinaryFormat/TestFileMagic.cpp
@@ -46,6 +46,7 @@
};
const char archive[] = "!<arch>\x0A";
+const char big_archive[] = "<bigaf>\x0A";
const char bitcode[] = "\xde\xc0\x17\x0b";
const char coff_object[] = "\x00\x00......";
const char coff_bigobj[] =
@@ -96,6 +97,7 @@
} types[] = {
#define DEFINE(magic) {#magic, magic, sizeof(magic), file_magic::magic}
DEFINE(archive),
+ {"big_archive", big_archive, sizeof(big_archive), file_magic::archive},
DEFINE(bitcode),
DEFINE(coff_object),
{"coff_bigobj", coff_bigobj, sizeof(coff_bigobj),
Index: llvm/lib/BinaryFormat/Magic.cpp
===================================================================
--- llvm/lib/BinaryFormat/Magic.cpp
+++ llvm/lib/BinaryFormat/Magic.cpp
@@ -88,7 +88,10 @@
if (startswith(Magic, "!<arch>\n") || startswith(Magic, "!<thin>\n"))
return file_magic::archive;
break;
-
+ case '<':
+ if (startswith(Magic, "<bigaf>\n"))
+ return file_magic::archive;
+ break;
case '\177':
if (startswith(Magic, "\177ELF") && Magic.size() >= 18) {
bool Data2MSB = Magic[5] == 2;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D117511.401282.patch
Type: text/x-patch
Size: 1305 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220119/7439d02c/attachment.bin>
More information about the llvm-commits
mailing list