* [gentoo-commits] gentoo-projects commit in pax-utils: paxelf.c paxelf.h
@ 2009-12-01 5:50 Mike Frysinger (vapier)
0 siblings, 0 replies; 3+ messages in thread
From: Mike Frysinger (vapier) @ 2009-12-01 5:50 UTC (permalink / raw
To: gentoo-commits
vapier 09/12/01 05:50:11
Modified: paxelf.c paxelf.h
Log:
split st_type and st_bind lookup functions
Revision Changes Path
1.64 pax-utils/paxelf.c
file : http://sources.gentoo.org/viewcvs.py/gentoo-projects/pax-utils/paxelf.c?rev=1.64&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-projects/pax-utils/paxelf.c?rev=1.64&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-projects/pax-utils/paxelf.c?r1=1.63&r2=1.64
Index: paxelf.c
===================================================================
RCS file: /var/cvsroot/gentoo-projects/pax-utils/paxelf.c,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -r1.63 -r1.64
--- paxelf.c 30 Dec 2008 12:59:42 -0000 1.63
+++ paxelf.c 1 Dec 2009 05:50:11 -0000 1.64
@@ -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.63 2008/12/30 12:59:42 vapier Exp $
+ * $Header: /var/cvsroot/gentoo-projects/pax-utils/paxelf.c,v 1.64 2009/12/01 05:50:11 vapier Exp $
*
* Copyright 2005-2007 Ned Ludd - <solar@gentoo.org>
* Copyright 2005-2007 Mike Frysinger - <vapier@gentoo.org>
@@ -414,6 +414,15 @@
QUERY(STT_FILE),
QUERY(STT_LOPROC),
QUERY(STT_HIPROC),
+ { 0, 0 }
+};
+const char *get_elfstttype(int type)
+{
+ return find_pairtype(elf_stttypes, ELF32_ST_TYPE(type));
+}
+
+/* translate elf STB_ defines */
+static pairtype elf_stbtypes[] = {
QUERY(STB_LOCAL),
QUERY(STB_GLOBAL),
QUERY(STB_WEAK),
@@ -421,9 +430,9 @@
QUERY(STB_HIPROC),
{ 0, 0 }
};
-const char *get_elfstttype(int type)
+const char *get_elfstbtype(int type)
{
- return find_pairtype(elf_stttypes, type & 0xF);
+ return find_pairtype(elf_stbtypes, ELF32_ST_BIND(type));
}
/* Read an ELF into memory */
1.51 pax-utils/paxelf.h
file : http://sources.gentoo.org/viewcvs.py/gentoo-projects/pax-utils/paxelf.h?rev=1.51&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-projects/pax-utils/paxelf.h?rev=1.51&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-projects/pax-utils/paxelf.h?r1=1.50&r2=1.51
Index: paxelf.h
===================================================================
RCS file: /var/cvsroot/gentoo-projects/pax-utils/paxelf.h,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -r1.50 -r1.51
--- paxelf.h 17 Jun 2008 17:07:57 -0000 1.50
+++ paxelf.h 1 Dec 2009 05:50:11 -0000 1.51
@@ -1,7 +1,7 @@
/*
* Copyright 2005-2007 Gentoo Foundation
* Distributed under the terms of the GNU General Public License v2
- * $Header: /var/cvsroot/gentoo-projects/pax-utils/paxelf.h,v 1.50 2008/06/17 17:07:57 solar Exp $
+ * $Header: /var/cvsroot/gentoo-projects/pax-utils/paxelf.h,v 1.51 2009/12/01 05:50:11 vapier Exp $
*
* Copyright 2005-2007 Ned Ludd - <solar@gentoo.org>
* Copyright 2005-2007 Mike Frysinger - <vapier@gentoo.org>
@@ -57,6 +57,7 @@
extern const char *get_elfemtype(elfobj *elf);
extern const char *get_elfptype(int type);
extern const char *get_elfdtype(int type);
+extern const char *get_elfstbtype(int type);
extern const char *get_elfshttype(int type);
extern const char *get_elfstttype(int type);
extern void *elf_findsecbyname(elfobj *elf, const char *name);
^ permalink raw reply [flat|nested] 3+ messages in thread
* [gentoo-commits] gentoo-projects commit in pax-utils: paxelf.c paxelf.h
@ 2009-12-01 10:14 Mike Frysinger (vapier)
0 siblings, 0 replies; 3+ messages in thread
From: Mike Frysinger (vapier) @ 2009-12-01 10:14 UTC (permalink / raw
To: gentoo-commits
vapier 09/12/01 10:14:30
Modified: paxelf.c paxelf.h
Log:
add SHT decoding and tweak undefined strings to not use spaces
Revision Changes Path
1.67 pax-utils/paxelf.c
file : http://sources.gentoo.org/viewcvs.py/gentoo-projects/pax-utils/paxelf.c?rev=1.67&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-projects/pax-utils/paxelf.c?rev=1.67&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-projects/pax-utils/paxelf.c?r1=1.66&r2=1.67
Index: paxelf.c
===================================================================
RCS file: /var/cvsroot/gentoo-projects/pax-utils/paxelf.c,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -r1.66 -r1.67
--- paxelf.c 1 Dec 2009 06:03:43 -0000 1.66
+++ paxelf.c 1 Dec 2009 10:14:30 -0000 1.67
@@ -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.66 2009/12/01 06:03:43 vapier Exp $
+ * $Header: /var/cvsroot/gentoo-projects/pax-utils/paxelf.c,v 1.67 2009/12/01 10:14:30 vapier Exp $
*
* Copyright 2005-2007 Ned Ludd - <solar@gentoo.org>
* Copyright 2005-2007 Mike Frysinger - <vapier@gentoo.org>
@@ -24,7 +24,7 @@
for (i = 0; pt[i].str; ++i)
if (type == pt[i].value)
return pt[i].str;
- return "UNKNOWN TYPE";
+ return "UNKNOWN_TYPE";
}
/* translate misc elf EI_ defines */
@@ -73,7 +73,7 @@
case EI_VERSION: return find_pairtype(elf_ei_version, type);
case EI_OSABI: return find_pairtype(elf_ei_osabi, type);
}
- return "UNKNOWN EI TYPE";
+ return "UNKNOWN_EI_TYPE";
}
/* translate elf ET_ defines */
@@ -416,7 +416,7 @@
};
const char *get_elfstttype(int type)
{
- return find_pairtype(elf_stttypes, ELF32_ST_TYPE(type));
+ return find_pairtype(elf_stttypes, type);
}
/* translate elf STB_ defines */
@@ -430,7 +430,25 @@
};
const char *get_elfstbtype(int type)
{
- return find_pairtype(elf_stbtypes, ELF32_ST_BIND(type));
+ return find_pairtype(elf_stbtypes, type);
+}
+
+/* translate elf SHN_ defines */
+static pairtype elf_shntypes[] = {
+ QUERY(SHN_UNDEF),
+ QUERY(SHN_LORESERVE),
+ QUERY(SHN_LOPROC),
+ QUERY(SHN_HIPROC),
+ QUERY(SHN_ABS),
+ QUERY(SHN_COMMON),
+ QUERY(SHN_HIRESERVE),
+ { 0, 0 }
+};
+const char *get_elfshntype(int type)
+{
+ if (type && type < SHN_LORESERVE)
+ return "DEFINED";
+ return find_pairtype(elf_shntypes, type);
}
/* Read an ELF into memory */
1.52 pax-utils/paxelf.h
file : http://sources.gentoo.org/viewcvs.py/gentoo-projects/pax-utils/paxelf.h?rev=1.52&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-projects/pax-utils/paxelf.h?rev=1.52&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-projects/pax-utils/paxelf.h?r1=1.51&r2=1.52
Index: paxelf.h
===================================================================
RCS file: /var/cvsroot/gentoo-projects/pax-utils/paxelf.h,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -r1.51 -r1.52
--- paxelf.h 1 Dec 2009 05:50:11 -0000 1.51
+++ paxelf.h 1 Dec 2009 10:14:30 -0000 1.52
@@ -1,7 +1,7 @@
/*
* Copyright 2005-2007 Gentoo Foundation
* Distributed under the terms of the GNU General Public License v2
- * $Header: /var/cvsroot/gentoo-projects/pax-utils/paxelf.h,v 1.51 2009/12/01 05:50:11 vapier Exp $
+ * $Header: /var/cvsroot/gentoo-projects/pax-utils/paxelf.h,v 1.52 2009/12/01 10:14:30 vapier Exp $
*
* Copyright 2005-2007 Ned Ludd - <solar@gentoo.org>
* Copyright 2005-2007 Mike Frysinger - <vapier@gentoo.org>
@@ -57,8 +57,9 @@
extern const char *get_elfemtype(elfobj *elf);
extern const char *get_elfptype(int type);
extern const char *get_elfdtype(int type);
-extern const char *get_elfstbtype(int type);
+extern const char *get_elfshntype(int type);
extern const char *get_elfshttype(int type);
+extern const char *get_elfstbtype(int type);
extern const char *get_elfstttype(int type);
extern void *elf_findsecbyname(elfobj *elf, const char *name);
extern int elf_max_pt_load(elfobj *elf);
^ permalink raw reply [flat|nested] 3+ messages in thread
* [gentoo-commits] gentoo-projects commit in pax-utils: paxelf.c paxelf.h
@ 2010-01-15 11:55 Mike Frysinger (vapier)
0 siblings, 0 replies; 3+ messages in thread
From: Mike Frysinger (vapier) @ 2010-01-15 11:55 UTC (permalink / raw
To: gentoo-commits
vapier 10/01/15 11:55:57
Modified: paxelf.c paxelf.h
Log:
unify elf->{ehdr,data} storage with a union
Revision Changes Path
1.69 pax-utils/paxelf.c
file : http://sources.gentoo.org/viewcvs.py/gentoo-projects/pax-utils/paxelf.c?rev=1.69&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-projects/pax-utils/paxelf.c?rev=1.69&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-projects/pax-utils/paxelf.c?r1=1.68&r2=1.69
Index: paxelf.c
===================================================================
RCS file: /var/cvsroot/gentoo-projects/pax-utils/paxelf.c,v
retrieving revision 1.68
retrieving revision 1.69
diff -u -r1.68 -r1.69
--- paxelf.c 15 Jan 2010 11:06:33 -0000 1.68
+++ paxelf.c 15 Jan 2010 11:55:56 -0000 1.69
@@ -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.68 2010/01/15 11:06:33 vapier Exp $
+ * $Header: /var/cvsroot/gentoo-projects/pax-utils/paxelf.c,v 1.69 2010/01/15 11:55:56 vapier Exp $
*
* Copyright 2005-2007 Ned Ludd - <solar@gentoo.org>
* Copyright 2005-2007 Mike Frysinger - <vapier@gentoo.org>
@@ -502,7 +502,6 @@
elf->base_filename = elf->base_filename + 1;
elf->elf_class = elf->data[EI_CLASS];
do_reverse_endian = (ELF_DATA != elf->data[EI_DATA]);
- elf->ehdr = elf->vdata;
#define READELF_HEADER(B) \
if (elf->elf_class == ELFCLASS ## B) { \
1.55 pax-utils/paxelf.h
file : http://sources.gentoo.org/viewcvs.py/gentoo-projects/pax-utils/paxelf.h?rev=1.55&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-projects/pax-utils/paxelf.h?rev=1.55&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-projects/pax-utils/paxelf.h?r1=1.54&r2=1.55
Index: paxelf.h
===================================================================
RCS file: /var/cvsroot/gentoo-projects/pax-utils/paxelf.h,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -r1.54 -r1.55
--- paxelf.h 15 Jan 2010 11:06:33 -0000 1.54
+++ paxelf.h 15 Jan 2010 11:55:56 -0000 1.55
@@ -1,7 +1,7 @@
/*
* Copyright 2005-2007 Gentoo Foundation
* Distributed under the terms of the GNU General Public License v2
- * $Header: /var/cvsroot/gentoo-projects/pax-utils/paxelf.h,v 1.54 2010/01/15 11:06:33 vapier Exp $
+ * $Header: /var/cvsroot/gentoo-projects/pax-utils/paxelf.h,v 1.55 2010/01/15 11:55:56 vapier Exp $
*
* Copyright 2005-2007 Ned Ludd - <solar@gentoo.org>
* Copyright 2005-2007 Mike Frysinger - <vapier@gentoo.org>
@@ -13,10 +13,9 @@
#define _PAX_ELF_H
typedef struct {
- void *ehdr;
void *phdr;
void *shdr;
- union { void *vdata; char *data; };
+ union { void *ehdr, *vdata; char *data; };
void *data_end;
char elf_class;
off_t len;
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-01-15 11:56 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-01 10:14 [gentoo-commits] gentoo-projects commit in pax-utils: paxelf.c paxelf.h Mike Frysinger (vapier)
-- strict thread matches above, loose matches on Subject: below --
2010-01-15 11:55 Mike Frysinger (vapier)
2009-12-01 5:50 Mike Frysinger (vapier)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox