Skip to content

Commit

Permalink
Print target string in fatelf-info.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Sep 24, 2009
1 parent 6ad3c13 commit 7525c48
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions utils/fatelf-info.c
Expand Up @@ -29,6 +29,16 @@ static const char *get_byteorder_name(const uint8_t byteorder)
} // get_byteorder_name


static const char *get_byteorder_target_name(const uint8_t byteorder)
{
if (byteorder == FATELF_LITTLEENDIAN)
return "le";
else if (byteorder == FATELF_BIGENDIAN)
return "be";
return "";
} // get_byteorder_target_name


static int fatelf_info(const char *fname)
{
const int fd = xopen(fname, O_RDONLY, 0755);
Expand Down Expand Up @@ -56,6 +66,10 @@ static int fatelf_info(const char *fname)
machine ? ": " : "", machine ? machine->desc : "");
printf(" Offset %llu\n", (unsigned long long) rec->offset);
printf(" Size %llu\n", (unsigned long long) rec->size);
printf(" Target string: '%s:%sbits:%s:%s:osabiver%d'\n",
machine ? machine->name : "", get_wordsize(rec->word_size),
get_byteorder_target_name(rec->byte_order),
osabi ? osabi->name : "", (int) rec->osabi_version);
} // for

xclose(fname, fd);
Expand Down

0 comments on commit 7525c48

Please sign in to comment.