summaryrefslogtreecommitdiff
path: root/3rdparty/libbacktrace/filetype.awk
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/libbacktrace/filetype.awk')
-rw-r--r--3rdparty/libbacktrace/filetype.awk11
1 files changed, 11 insertions, 0 deletions
diff --git a/3rdparty/libbacktrace/filetype.awk b/3rdparty/libbacktrace/filetype.awk
new file mode 100644
index 000000000..a5f6c8cc1
--- /dev/null
+++ b/3rdparty/libbacktrace/filetype.awk
@@ -0,0 +1,11 @@
+# An awk script to determine the type of a file.
+/\177ELF\001/ { if (NR == 1) { print "elf32"; exit } }
+/\177ELF\002/ { if (NR == 1) { print "elf64"; exit } }
+/\114\001/ { if (NR == 1) { print "pecoff"; exit } }
+/\144\206/ { if (NR == 1) { print "pecoff"; exit } }
+/\xFE\xED\xFA\xCE/ { if (NR == 1) { print "macho32"; exit } }
+/\xCE\xFA\xED\xFE/ { if (NR == 1) { print "macho32"; exit } }
+/\xFE\xED\xFA\xCF/ { if (NR == 1) { print "macho64"; exit } }
+/\xCF\xFA\xED\xFE/ { if (NR == 1) { print "macho64"; exit } }
+/\xCA\xFE\xBA\xBE/ { if (NR == 1) { print "macho-fat"; exit } }
+/\xBE\xBA\xFE\xCA/ { if (NR == 1) { print "macho-fat"; exit } }