From 6050a3fb8c13b9976005df4b871e4dd6497d4c16 Mon Sep 17 00:00:00 2001 From: Ned Ludd Date: Sun, 5 Feb 2006 02:25:57 +0000 Subject: - add ability to scan files based on etype via new -E option. syntax is -E 1 or -E 1,2,3,4 --- paxelf.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'paxelf.c') diff --git a/paxelf.c b/paxelf.c index 8a90566..6813d30 100644 --- a/paxelf.c +++ b/paxelf.c @@ -1,7 +1,7 @@ /* * Copyright 2003-2006 Gentoo Foundation * Distributed under the terms of the GNU General Public License v2 - * $Header: /var/cvsroot/gentoo-projects/pax-utils/paxelf.c,v 1.40 2006/01/29 14:36:41 vapier Exp $ + * $Header: /var/cvsroot/gentoo-projects/pax-utils/paxelf.c,v 1.41 2006/02/05 02:25:57 solar Exp $ * * Copyright 2005-2006 Ned Ludd - * Copyright 2005-2006 Mike Frysinger - @@ -92,14 +92,20 @@ static pairtype elf_etypes[] = { QUERY(ET_HIPROC), { 0, 0 } }; -const char *get_elfetype(elfobj *elf) + +int get_etype(elfobj *elf) { int type; if (elf->elf_class == ELFCLASS32) type = EGET(EHDR32(elf->ehdr)->e_type); else type = EGET(EHDR64(elf->ehdr)->e_type); - return find_pairtype(elf_etypes, type); + return type; +} + +const char *get_elfetype(elfobj *elf) +{ + return find_pairtype(elf_etypes, get_etype(elf)); } /* translate elf EM_ defines */ -- cgit v1.2.3-65-gdbad