diff options
author | 2007-06-29 17:09:12 +0000 | |
---|---|---|
committer | 2007-06-29 17:09:12 +0000 | |
commit | 9fbb1a70d9646fac024ddf2e36af024542dfb650 (patch) | |
tree | 4881e8615dc251ec451e1b8e076b4f2d141b8e1d /paxelf.c | |
parent | add a note about needing ~app-text/docbook-xml-dtd-4.4 (diff) | |
download | pax-utils-9fbb1a70d9646fac024ddf2e36af024542dfb650.tar.gz pax-utils-9fbb1a70d9646fac024ddf2e36af024542dfb650.tar.bz2 pax-utils-9fbb1a70d9646fac024ddf2e36af024542dfb650.zip |
- add endian scanning support
Diffstat (limited to 'paxelf.c')
-rw-r--r-- | paxelf.c | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -1,7 +1,7 @@ /* * Copyright 2003-2007 Gentoo Foundation * Distributed under the terms of the GNU General Public License v2 - * $Header: /var/cvsroot/gentoo-projects/pax-utils/paxelf.c,v 1.54 2007/06/09 18:54:44 solar Exp $ + * $Header: /var/cvsroot/gentoo-projects/pax-utils/paxelf.c,v 1.55 2007/06/29 17:09:12 solar Exp $ * * Copyright 2005-2007 Ned Ludd - <solar@gentoo.org> * Copyright 2005-2007 Mike Frysinger - <vapier@gentoo.org> @@ -108,6 +108,15 @@ const char *get_elfetype(elfobj *elf) return find_pairtype(elf_etypes, get_etype(elf)); } +const char *get_endian(elfobj *elf) +{ + if (elf->data[EI_DATA] == ELFDATA2LSB) + return (char *) "LE"; + if (elf->data[EI_DATA] == ELFDATA2MSB) + return (char *) "BE"; + return (char *) "??"; +} + void print_etypes(FILE *stream) { int i, wrap = 0; |