aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNed Ludd <solar@gentoo.org>2006-02-18 15:51:11 +0000
committerNed Ludd <solar@gentoo.org>2006-02-18 15:51:11 +0000
commit0512afc32892d60b6adf1c50c1ab5a34845ba4ca (patch)
tree6a2ba69cf5ab7ce57c1e3ef642dd4cc413befe65 /paxelf.c
parent- finished up ei_pax handling (diff)
downloadpax-utils-0512afc32892d60b6adf1c50c1ab5a34845ba4ca.tar.gz
pax-utils-0512afc32892d60b6adf1c50c1ab5a34845ba4ca.tar.bz2
pax-utils-0512afc32892d60b6adf1c50c1ab5a34845ba4ca.zip
- Make -E take strings vs just numerics. Fixed off by one in ld.so.conf include file handling(Reported by PaX autho.r). Made sure we only set ei pax flags when etype is ET_EXEC || ET_DYN. Updated README, man page
Diffstat (limited to 'paxelf.c')
-rw-r--r--paxelf.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/paxelf.c b/paxelf.c
index 4b95361..bd6f959 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.47 2006/02/17 15:36:16 solar Exp $
+ * $Header: /var/cvsroot/gentoo-projects/pax-utils/paxelf.c,v 1.48 2006/02/18 15:51:11 solar Exp $
*
* Copyright 2005-2006 Ned Ludd - <solar@gentoo.org>
* Copyright 2005-2006 Mike Frysinger - <vapier@gentoo.org>
@@ -115,6 +115,20 @@ void print_etypes(FILE *stream)
fprintf(stream, " (%d) = %s\n", elf_etypes[i].value, elf_etypes[i].str);
}
}
+
+int etype_lookup(const char *str)
+{
+ if (*str == 'E') {
+ int i;
+ for (i = 0; elf_etypes[i].str; ++i) {
+ if (strcmp(str, elf_etypes[i].str) == 0)
+ return elf_etypes[i].value;
+ }
+ }
+ return atoi(str);
+}
+
+
/* translate elf EM_ defines */
static pairtype elf_emtypes[] = {
QUERY(EM_NONE),