Gentoo Archives: gentoo-commits

From: "Mike Frysinger (vapier)" <vapier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-projects commit in pax-utils: paxelf.c paxelf.h
Date: Tue, 01 Dec 2009 10:14:32
Message-Id: E1NFPkc-0007i4-Do@stork.gentoo.org
1 vapier 09/12/01 10:14:30
2
3 Modified: paxelf.c paxelf.h
4 Log:
5 add SHT decoding and tweak undefined strings to not use spaces
6
7 Revision Changes Path
8 1.67 pax-utils/paxelf.c
9
10 file : http://sources.gentoo.org/viewcvs.py/gentoo-projects/pax-utils/paxelf.c?rev=1.67&view=markup
11 plain: http://sources.gentoo.org/viewcvs.py/gentoo-projects/pax-utils/paxelf.c?rev=1.67&content-type=text/plain
12 diff : http://sources.gentoo.org/viewcvs.py/gentoo-projects/pax-utils/paxelf.c?r1=1.66&r2=1.67
13
14 Index: paxelf.c
15 ===================================================================
16 RCS file: /var/cvsroot/gentoo-projects/pax-utils/paxelf.c,v
17 retrieving revision 1.66
18 retrieving revision 1.67
19 diff -u -r1.66 -r1.67
20 --- paxelf.c 1 Dec 2009 06:03:43 -0000 1.66
21 +++ paxelf.c 1 Dec 2009 10:14:30 -0000 1.67
22 @@ -1,7 +1,7 @@
23 /*
24 * Copyright 2003-2007 Gentoo Foundation
25 * Distributed under the terms of the GNU General Public License v2
26 - * $Header: /var/cvsroot/gentoo-projects/pax-utils/paxelf.c,v 1.66 2009/12/01 06:03:43 vapier Exp $
27 + * $Header: /var/cvsroot/gentoo-projects/pax-utils/paxelf.c,v 1.67 2009/12/01 10:14:30 vapier Exp $
28 *
29 * Copyright 2005-2007 Ned Ludd - <solar@g.o>
30 * Copyright 2005-2007 Mike Frysinger - <vapier@g.o>
31 @@ -24,7 +24,7 @@
32 for (i = 0; pt[i].str; ++i)
33 if (type == pt[i].value)
34 return pt[i].str;
35 - return "UNKNOWN TYPE";
36 + return "UNKNOWN_TYPE";
37 }
38
39 /* translate misc elf EI_ defines */
40 @@ -73,7 +73,7 @@
41 case EI_VERSION: return find_pairtype(elf_ei_version, type);
42 case EI_OSABI: return find_pairtype(elf_ei_osabi, type);
43 }
44 - return "UNKNOWN EI TYPE";
45 + return "UNKNOWN_EI_TYPE";
46 }
47
48 /* translate elf ET_ defines */
49 @@ -416,7 +416,7 @@
50 };
51 const char *get_elfstttype(int type)
52 {
53 - return find_pairtype(elf_stttypes, ELF32_ST_TYPE(type));
54 + return find_pairtype(elf_stttypes, type);
55 }
56
57 /* translate elf STB_ defines */
58 @@ -430,7 +430,25 @@
59 };
60 const char *get_elfstbtype(int type)
61 {
62 - return find_pairtype(elf_stbtypes, ELF32_ST_BIND(type));
63 + return find_pairtype(elf_stbtypes, type);
64 +}
65 +
66 +/* translate elf SHN_ defines */
67 +static pairtype elf_shntypes[] = {
68 + QUERY(SHN_UNDEF),
69 + QUERY(SHN_LORESERVE),
70 + QUERY(SHN_LOPROC),
71 + QUERY(SHN_HIPROC),
72 + QUERY(SHN_ABS),
73 + QUERY(SHN_COMMON),
74 + QUERY(SHN_HIRESERVE),
75 + { 0, 0 }
76 +};
77 +const char *get_elfshntype(int type)
78 +{
79 + if (type && type < SHN_LORESERVE)
80 + return "DEFINED";
81 + return find_pairtype(elf_shntypes, type);
82 }
83
84 /* Read an ELF into memory */
85
86
87
88 1.52 pax-utils/paxelf.h
89
90 file : http://sources.gentoo.org/viewcvs.py/gentoo-projects/pax-utils/paxelf.h?rev=1.52&view=markup
91 plain: http://sources.gentoo.org/viewcvs.py/gentoo-projects/pax-utils/paxelf.h?rev=1.52&content-type=text/plain
92 diff : http://sources.gentoo.org/viewcvs.py/gentoo-projects/pax-utils/paxelf.h?r1=1.51&r2=1.52
93
94 Index: paxelf.h
95 ===================================================================
96 RCS file: /var/cvsroot/gentoo-projects/pax-utils/paxelf.h,v
97 retrieving revision 1.51
98 retrieving revision 1.52
99 diff -u -r1.51 -r1.52
100 --- paxelf.h 1 Dec 2009 05:50:11 -0000 1.51
101 +++ paxelf.h 1 Dec 2009 10:14:30 -0000 1.52
102 @@ -1,7 +1,7 @@
103 /*
104 * Copyright 2005-2007 Gentoo Foundation
105 * Distributed under the terms of the GNU General Public License v2
106 - * $Header: /var/cvsroot/gentoo-projects/pax-utils/paxelf.h,v 1.51 2009/12/01 05:50:11 vapier Exp $
107 + * $Header: /var/cvsroot/gentoo-projects/pax-utils/paxelf.h,v 1.52 2009/12/01 10:14:30 vapier Exp $
108 *
109 * Copyright 2005-2007 Ned Ludd - <solar@g.o>
110 * Copyright 2005-2007 Mike Frysinger - <vapier@g.o>
111 @@ -57,8 +57,9 @@
112 extern const char *get_elfemtype(elfobj *elf);
113 extern const char *get_elfptype(int type);
114 extern const char *get_elfdtype(int type);
115 -extern const char *get_elfstbtype(int type);
116 +extern const char *get_elfshntype(int type);
117 extern const char *get_elfshttype(int type);
118 +extern const char *get_elfstbtype(int type);
119 extern const char *get_elfstttype(int type);
120 extern void *elf_findsecbyname(elfobj *elf, const char *name);
121 extern int elf_max_pt_load(elfobj *elf);