aboutsummaryrefslogtreecommitdiff
path: root/toys
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2017-11-26 23:40:20 -0600
committerRob Landley <rob@landley.net>2017-11-26 23:40:20 -0600
commitd61aeaf9e48cde0481e3a54acaa89a99018fda99 (patch)
tree47beb8de7d0cc9e72073924bf6bb94b446a2c781 /toys
parenta9111bd499622577c3acd6565f02d6efdd16b44c (diff)
downloadtoybox-d61aeaf9e48cde0481e3a54acaa89a99018fda99.tar.gz
Recognize sh/frv fdpic, and add types for bpf and new microblaze.
Diffstat (limited to 'toys')
-rw-r--r--toys/posix/file.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/toys/posix/file.c b/toys/posix/file.c
index b84eece6..2eeb058b 100644
--- a/toys/posix/file.c
+++ b/toys/posix/file.c
@@ -35,14 +35,14 @@ static void do_elf_file(int fd, struct stat *sb)
// Names are linux/arch/ directory (sometimes before 32/64 bit merges)
struct {int val; char *name;} type[] = {{0x9026, "alpha"}, {93, "arc"},
{195, "arcv2"}, {40, "arm"}, {183, "arm64"}, {0x18ad, "avr32"},
- {106, "blackfin"}, {140, "c6x"}, {23, "cell"}, {76, "cris"},
+ {247, "bpf"}, {106, "blackfin"}, {140, "c6x"}, {23, "cell"}, {76, "cris"},
{0x5441, "frv"}, {46, "h8300"}, {164, "hexagon"}, {50, "ia64"},
{88, "m32r"}, {0x9041, "m32r"}, {4, "m68k"}, {174, "metag"},
- {0xbaab, "microblaze"}, {8, "mips"}, {10, "mips-old"}, {89, "mn10300"},
- {0xbeef, "mn10300-old"}, {113, "nios2"}, {92, "openrisc"},
- {0x8472, "openrisc-old"}, {15, "parisc"}, {20, "ppc"}, {21, "ppc64"},
- {22, "s390"}, {0xa390, "s390-old"}, {135, "score"}, {42, "sh"},
- {2, "sparc"}, {18, "sparc8+"}, {43, "sparc9"}, {188, "tile"},
+ {189, "microblaze"}, {0xbaab, "microblaze-old"}, {8, "mips"},
+ {10, "mips-old"}, {89, "mn10300"}, {0xbeef, "mn10300-old"}, {113, "nios2"},
+ {92, "openrisc"}, {0x8472, "openrisc-old"}, {15, "parisc"}, {20, "ppc"},
+ {21, "ppc64"}, {22, "s390"}, {0xa390, "s390-old"}, {135, "score"},
+ {42, "sh"}, {2, "sparc"}, {18, "sparc8+"}, {43, "sparc9"}, {188, "tile"},
{191, "tilegx"}, {3, "386"}, {6, "486"}, {62, "x86-64"}, {94, "xtensa"},
{0xabc7, "xtensa-old"}
};
@@ -62,6 +62,7 @@ static void do_elf_file(int fd, struct stat *sb)
else if (i == 3) printf("shared object");
else if (i == 4) printf("core dump");
else printf("(bad type %d)", i);
+ if (elf_int(toybuf+36+12*(bits==2), 4) & 0x8000) printf(" (fdpic)");
printf(", ");
// "64-bit"