Gentoo Archives: gentoo-commits

From: "Robin H. Johnson (robbat2)" <robbat2@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in dev-libs/libmelf/files: libmelf-0.4.0-r1-gcc-makefile-cleanup.patch libmelf-0.4.1-unfinal-release.patch
Date: Tue, 01 Jun 2010 03:48:25
Message-Id: 20100601034820.938A22CAD8@corvid.gentoo.org
1 robbat2 10/06/01 03:48:20
2
3 Added: libmelf-0.4.0-r1-gcc-makefile-cleanup.patch
4 libmelf-0.4.1-unfinal-release.patch
5 Log:
6 Add in upstream changes from the 0.4.1 that was never released.
7 (Portage version: 2.2_rc67/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.1 dev-libs/libmelf/files/libmelf-0.4.0-r1-gcc-makefile-cleanup.patch
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/libmelf/files/libmelf-0.4.0-r1-gcc-makefile-cleanup.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/libmelf/files/libmelf-0.4.0-r1-gcc-makefile-cleanup.patch?rev=1.1&content-type=text/plain
14
15 Index: libmelf-0.4.0-r1-gcc-makefile-cleanup.patch
16 ===================================================================
17 diff -Nuar --exclude '*~' libmelf-0.4.0.orig/example/Makefile.in libmelf-0.4.0/example/Makefile.in
18 --- libmelf-0.4.0.orig/example/Makefile.in 2003-03-24 00:48:22.000000000 -0800
19 +++ libmelf-0.4.0/example/Makefile.in 2010-05-31 19:56:43.546947560 -0700
20 @@ -1,7 +1,13 @@
21 cc=@CC@
22 DEFINES=@DEFINES@
23 +OPTFLAGS=-Wall -O3
24 +CFLAGS=${DEFINES} ${OPTFLAGS} -I..
25 +BINS = sign test new
26
27 -all:
28 - ${CC} ${DEFINES} -I.. -Wall -O3 sign.c -o sign ../libmelf.a
29 - ${CC} ${DEFINES} -I.. -Wall -O3 test.c -o test ../libmelf.a
30 - ${CC} ${DEFINES} -I.. -Wall -O3 new.c -o new ../libmelf.a
31 +%: %.c
32 + ${CC} $(CFLAGS) $^ -o $@ -L.. -lmelf
33 +
34 +all: $(BINS)
35 +
36 +clean:
37 + -rm -f $(BINS)
38 diff -Nuar --exclude '*~' libmelf-0.4.0.orig/Makefile.in libmelf-0.4.0/Makefile.in
39 --- libmelf-0.4.0.orig/Makefile.in 2003-11-07 22:09:10.000000000 -0800
40 +++ libmelf-0.4.0/Makefile.in 2010-05-31 19:58:12.172822406 -0700
41 @@ -6,35 +6,43 @@
42 DEFINES=@DEFINES@ -DMELF_COMP
43 INCLUDES=-I.
44 PREFIX=@PREFIX@
45 -CFLAGS=${DEBUG} ${DEFINES} ${INCLUDES} -Wall -O3 -fPIC
46 -LFLAGS=${DEBUG} ${DEFINES} ${INCLUDES} -Wall -O3 -o
47 +OPTFLAGS=-Wall -O3
48 +CFLAGS=${DEBUG} ${DEFINES} ${INCLUDES} ${OPTFLAGS}
49 +LFLAGS=${DEBUG} ${DEFINES} ${INCLUDES} ${OPTFLAGS} -o
50 +LIBDIR=lib
51 LIBS=
52 OBJS=melf.o melf_dynamic.o melf_elf.o melf_list.o melf_note.o melf_program.o melf_reloc.o \
53 melf_res.o melf_section.o melf_string.o melf_symbol.o melf_symbolTable.o
54
55 -all: ${OBJS}
56 - ar rc ${STATICBIN} ${OBJS} && ranlib ${STATICBIN}
57 - @SHAREDEXEC@
58 - cd example && make
59 - cd tools && make
60 +all: ${STATICBIN} ${DYNAMICBIN}
61 + cd example && $(MAKE)
62 + cd tools && $(MAKE)
63
64 *.c.${O}:
65 ${CC} ${CFLAGS} $*.c
66
67 +${STATICBIN}: ${OBJS}
68 + ar rc ${STATICBIN} ${OBJS} && ranlib ${STATICBIN}
69 +${DYNAMICBIN}: ${OBJS}
70 + @SHAREDEXEC@
71 +
72 clean:
73 rm -f *.o ${STATICBIN} ${DYNAMICBIN} example/test example/new example/sign tools/elfres config.*
74 - cd tools && make clean
75 + cd tools && $(MAKE) clean
76
77 -distclean:
78 - make clean
79 +distclean: clean
80 rm -f Makefile example/Makefile stdelf.h
81 - cd tools && make distclean
82 + cd tools && $(MAKE) distclean
83
84 install: ${OBJS} ${STATICBIN}
85 - cp libmelf.a ${PREFIX}/lib
86 - cp libmelf.so ${PREFIX}/lib
87 + cp ${STATICBIN} ${PREFIX}/$(LIBDIR)
88 + cp ${DYNAMICBIN} ${PREFIX}/$(LIBDIR)
89 cp melf.h ${PREFIX}/include
90 cp stdelf.h ${PREFIX}/include
91
92 uninstall:
93 - rm -f ${PREFIX}/lib/libmelf.a ${PREFIX}/lib/libmelf.so ${PREFIX}/include/melf.h ${PREFIX}/include/stdelf.h
94 + -rm -f \
95 + ${PREFIX}/$(LIBDIR)/${STATICBIN} \
96 + ${PREFIX}/$(LIBDIR)/${DYNAMICBIN} \
97 + ${PREFIX}/include/melf.h \
98 + ${PREFIX}/include/stdelf.h
99 diff -Nuar --exclude '*~' libmelf-0.4.0.orig/tools/Makefile.in libmelf-0.4.0/tools/Makefile.in
100 --- libmelf-0.4.0.orig/tools/Makefile.in 2003-09-17 01:03:49.000000000 -0700
101 +++ libmelf-0.4.0/tools/Makefile.in 2010-05-31 19:57:55.126198024 -0700
102 @@ -1,11 +1,15 @@
103 cc=@CC@
104 DEFINES=@DEFINES@
105 +CFLAGS=${DEFINES} ${OPTFLAGS} -I..
106 +BINS=elfres
107
108 -all:
109 - ${CC} ${DEFINES} -I.. -Wall -O3 elfres.c -o elfres ../libmelf.a
110 +%: %.c
111 + ${CC} $(CFLAGS) $^ -o $@ -L.. -lmelf
112 +
113 +all: $(BINS)
114
115 clean:
116 - rm -f elfres
117 + -rm -f $(BINS)
118
119 distclean:
120 - rm -f elfres Makefile
121 + -rm -f $(BINS) Makefile
122
123
124
125 1.1 dev-libs/libmelf/files/libmelf-0.4.1-unfinal-release.patch
126
127 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/libmelf/files/libmelf-0.4.1-unfinal-release.patch?rev=1.1&view=markup
128 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/libmelf/files/libmelf-0.4.1-unfinal-release.patch?rev=1.1&content-type=text/plain
129
130 Index: libmelf-0.4.1-unfinal-release.patch
131 ===================================================================
132 diff -Nuar --exclude enum_sym --exclude configure libmelf-0.4.0.orig//ChangeLog elfsign-0.2.2/melf//ChangeLog
133 --- libmelf-0.4.0.orig//ChangeLog 2004-05-03 22:15:29.000000000 -0700
134 +++ elfsign-0.2.2/melf//ChangeLog 2004-11-30 08:14:39.000000000 -0800
135 @@ -1,3 +1,7 @@
136 +0.4.1
137 +
138 + * Fixed issues with serializing SHT_DYNSYM
139 +
140 0.4.0 05/04/2004
141
142 * Major enhancements to make the library more robust
143 diff -Nuar --exclude enum_sym --exclude configure libmelf-0.4.0.orig//configure.in elfsign-0.2.2/melf//configure.in
144 --- libmelf-0.4.0.orig//configure.in 2003-11-07 22:08:15.000000000 -0800
145 +++ elfsign-0.2.2/melf//configure.in 2004-06-05 10:44:17.000000000 -0700
146 @@ -25,7 +25,7 @@
147 if test "x$cache_sys_os" = "xSolaris"; then
148 SHAREDEXEC="ld -dy -r -o libmelf.so \${OBJS}"
149 else
150 - SHAREDEXEC="\${CC} \${FLAGS} -shared -fPIC \${OBJS} -o libmelf.so"
151 + SHAREDEXEC="\${CC} \${FLAGS} -shared \${OBJS} -o libmelf.so"
152 fi
153
154 AC_C_BIGENDIAN()
155 diff -Nuar --exclude enum_sym --exclude configure libmelf-0.4.0.orig//example/enum_sym.c elfsign-0.2.2/melf//example/enum_sym.c
156 --- libmelf-0.4.0.orig//example/enum_sym.c 1969-12-31 16:00:00.000000000 -0800
157 +++ elfsign-0.2.2/melf//example/enum_sym.c 2004-11-27 18:04:36.000000000 -0800
158 @@ -0,0 +1,39 @@
159 +#include <stdlib.h>
160 +#include <stdio.h>
161 +
162 +#include "melf.h"
163 +
164 +void enum_symtab(MELF *melf, ELF_SPEC_HEADER *curr);
165 +
166 +int main(int argc, char **argv)
167 +{
168 + ELF_SPEC_HEADER *curr;
169 + MELF *melf = melf_open(argv[1], MELF_ACCESS_ALL);
170 +
171 + if (!melf)
172 + return 0;
173 +
174 + for (curr = melf_sectionGetEnum(melf);
175 + curr;
176 + curr = melf_sectionEnumNext(melf, curr))
177 + {
178 + if ((curr->spec.section.sh_type == SHT_DYNSYM) ||
179 + (curr->spec.section.sh_type == SHT_SYMTAB))
180 + {
181 + enum_symtab(melf, curr);
182 + }
183 + }
184 +
185 + return 0;
186 +}
187 +
188 +void enum_symtab(MELF *melf, ELF_SPEC_HEADER *curr)
189 +{
190 + Elf32_Sym *sym;
191 + unsigned long index = 0;
192 +
193 + while ((sym = melf_symbolTableEnum(melf, curr, index++)))
194 + {
195 + printf("%s\n", melf_symbolGetName(melf, curr, sym));
196 + }
197 +}
198 diff -Nuar --exclude enum_sym --exclude configure libmelf-0.4.0.orig//Makefile.in elfsign-0.2.2/melf//Makefile.in
199 --- libmelf-0.4.0.orig//Makefile.in 2003-11-07 22:09:10.000000000 -0800
200 +++ elfsign-0.2.2/melf//Makefile.in 2004-06-05 10:44:06.000000000 -0700
201 @@ -6,7 +6,7 @@
202 DEFINES=@DEFINES@ -DMELF_COMP
203 INCLUDES=-I.
204 PREFIX=@PREFIX@
205 -CFLAGS=${DEBUG} ${DEFINES} ${INCLUDES} -Wall -O3
206 +CFLAGS=${DEBUG} ${DEFINES} ${INCLUDES} -Wall -O3 -fPIC
207 LFLAGS=${DEBUG} ${DEFINES} ${INCLUDES} -Wall -O3 -o
208 LIBS=
209 OBJS=melf.o melf_dynamic.o melf_elf.o melf_list.o melf_note.o melf_program.o melf_reloc.o \
210 diff -Nuar --exclude enum_sym --exclude configure libmelf-0.4.0.orig//melf_dynamic.c elfsign-0.2.2/melf//melf_dynamic.c
211 --- libmelf-0.4.0.orig//melf_dynamic.c 2004-01-08 23:25:32.000000000 -0800
212 +++ elfsign-0.2.2/melf//melf_dynamic.c 2004-12-19 13:12:45.000000000 -0800
213 @@ -227,7 +227,7 @@
214 return NULL;
215
216 dynamic->content = (void *)base;
217 - (unsigned char *)base += dynamic->contentLength;
218 + base = (Elf32_Dyn *)((char *)base + dynamic->contentLength);
219 dynamic->contentLength = newLength;
220
221 base->d_tag = DT_NULL;
222 diff -Nuar --exclude enum_sym --exclude configure libmelf-0.4.0.orig//melf_note.c elfsign-0.2.2/melf//melf_note.c
223 --- libmelf-0.4.0.orig//melf_note.c 2004-01-08 23:25:56.000000000 -0800
224 +++ elfsign-0.2.2/melf//melf_note.c 2004-12-19 13:13:16.000000000 -0800
225 @@ -204,8 +204,8 @@
226 if (!base)
227 return NULL;
228
229 - note->content = (void *)base;
230 - (unsigned char *)base += note->contentLength;
231 + note->content = (void *)base;
232 + base = (Elf32_Nhdr *)((char *)base + note->contentLength);
233
234 memset(base, 0, newLength - note->contentLength);
235
236 diff -Nuar --exclude enum_sym --exclude configure libmelf-0.4.0.orig//melf_section.c elfsign-0.2.2/melf//melf_section.c
237 --- libmelf-0.4.0.orig//melf_section.c 2004-05-03 21:37:29.000000000 -0700
238 +++ elfsign-0.2.2/melf//melf_section.c 2004-11-27 17:46:45.000000000 -0800
239 @@ -485,6 +485,7 @@
240 melf_relocInitializeRelaEntryList(melf, sect);
241 break;
242 case SHT_SYMTAB:
243 + case SHT_DYNSYM:
244 melf_symbolTableInitializeEntryList(melf, sect);
245 break;
246 case SHT_DYNAMIC:
247 @@ -511,6 +512,7 @@
248 case SHT_REL:
249 case SHT_RELA:
250 case SHT_SYMTAB:
251 + case SHT_DYNSYM:
252 case SHT_DYNAMIC:
253 case SHT_NOTE:
254 case SHT_RES:
255 @@ -534,6 +536,7 @@
256 melf_relocSynchronizeRelaEntryList(melf, sect);
257 break;
258 case SHT_SYMTAB:
259 + case SHT_DYNSYM:
260 melf_symbolTableSynchronizeEntryList(melf, sect);
261 break;
262 case SHT_DYNAMIC:
263 diff -Nuar --exclude enum_sym --exclude configure libmelf-0.4.0.orig//stdelf.h.in elfsign-0.2.2/melf//stdelf.h.in
264 --- libmelf-0.4.0.orig//stdelf.h.in 2003-06-01 11:13:56.000000000 -0700
265 +++ elfsign-0.2.2/melf//stdelf.h.in 2004-05-11 07:38:17.000000000 -0700
266 @@ -919,8 +919,8 @@
267 #define AT_FLAGS 8 /* Flags */
268 #define AT_ENTRY 9 /* Entry point of program */
269 #define AT_NOTELF 10 /* Program is not ELF */
270 -#define AT_UID 11 /* Real uid */
271 -#define AT_EUID 12 /* Effective uid */
272 +#define E_AT_UID 11 /* Real uid */
273 +#define E_AT_EUID 12 /* Effective uid */
274 #define AT_GID 13 /* Real gid */
275 #define AT_EGID 14 /* Effective gid */
276 #define AT_CLKTCK 17 /* Frequency of times() */