• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
12021-09-06  Dmitry V. Levin  <ldv@altlinux.org>
2
3	* common.h (allocate_elf): Remove cast of calloc return value.
4	* elf_newdata.c (elf_newdata): Likewise.
5	* elf_getscn.c (elf_getscn): Remove casts of calloc return values.
6	* elf_newscn.c (elf_newscn): Likewise.
7	* elf32_updatefile.c (__elfw2): Remove casts of malloc return values.
8	* elf_getdata.c (convert_data): Likewise.
9	(__libelf_set_rawdata_wrlock): Remove cast of malloc return value.
10	* elf_begin.c (read_long_names): Remove cast of malloc return value.
11	* elf_readall.c (__libelf_readall): Likewise.
12	* elf_getarsym.c (elf_getarsym): Remove casts of malloc and realloc
13	return values.
14
152021-07-19  Mark Wielaard  <mark@klomp.org>
16
17	* elf_strptr.c (validate_str): Check last char is zero first before
18	calling memrchr on the whole block.
19
202021-06-09  Andrei Homescu  <ah@immunant.com>
21
22	* elf_getdata.c: Fix d_align for sections where alignment is larger
23	than offset.
24
252020-12-12  Mark Wielaard  <mark@klomp.org>
26
27	* elf.h: Update from glibc.
28
292020-12-16  Dmitry V. Levin  <ldv@altlinux.org>
30
31	* libelfP.h (_): Remove.
32
332020-12-15  Mark Wielaard  <mark@klomp.org>
34
35	* elf_begin.c (get_shnum): Make sure the full Ehdr is available.
36
372020-12-12  Dmitry V. Levin  <ldv@altlinux.org>
38
39	* common.h: Fix spelling typo in comment.
40	* gelf.h: Likewise.
41	* libelf.h: Likewise.
42	* libelfP.h: Likewise.
43	* elf32_checksum.c (elfw2): Likewise.
44	* elf_begin.c (dup_elf, write_file): Likewise.
45	* elf_compress.c (__libelf_compress): Likewise.
46	* elf_compress_gnu.c (elf_compress_gnu): Likewise.
47
482020-12-11  Dmitry V. Levin  <ldv@altlinux.org>
49
50	* Makefile.am (GCC_INCLUDE): Remove.
51
522020-12-09  Dmitry V. Levin  <ldv@altlinux.org>
53
54	* Makefile.am (noinst_PROGRAMS): Rename to noinst_DATA.
55	(libelf_so_SOURCES): Remove.
56	(CLEANFILES): Add libelf.so.
57
582020-11-30  Dmitry V. Levin  <ldv@altlinux.org>
59
60	* Makefile.am (libelf.so$(EXEEXT)): Drop $(EXEEXT) suffix.
61
622020-11-06  Mark Wielaard  <mark@klomp.org>
63
64	* elf-knowledge.h (SH_ENTSIZE_HASH): Update comment.
65
662020-11-01  Mark Wielaard  <mark@klomp.org>
67
68	* elf_strptr.c (elf_strptr): Check shdr is not NULL.
69
702020-11-01  Mark Wielaard  <mark@klomp.org>
71
72	* elf_getphdrnum.c (__elf_getphdrnum_rdlock): Set *dst to zero on
73	error.
74
752020-11-01  Mark Wielaard  <mark@klomp.org>
76
77	* libelfP.h (__libelf_data_type): Take an GElf_Ehdr instead of an
78	Elf handle.
79	* elf_getdata.c (__libelf_data_type): Likewise. And check ehdr
80	directly instead of fetching a new one.
81	(__libelf_set_rawdata_wrlock): Fetch Ehdr, report an error when that
82	fails, otherwise call __libelf_data_type.
83
842020-10-28  Mark Wielaard  <mark@klomp.org>
85
86	* elf.h: Update from glibc.
87
882020-08-28  Mark Wielaard  <mark@klomp.org>
89
90	* elf.h: Update from glibc.
91
922020-08-19  Mark Wielaard  <mark@klomp.org>
93
94	* elf32_updatenull.c (updatenull_wrlock): Fixup the sh_addralign
95	of an SHF_COMPRESSED section if necessary.
96
972020-06-04  Mark Wielaard  <mark@klomp.org>
98
99	* elf.h: Update from glibc.
100
1012020-05-08  Mark Wielaard  <mark@klomp.org>
102
103	* elf_strptr.c (elf_strptr): Check shdr is not NULL.
104
1052020-05-08  Mark Wielaard  <mark@klomp.org>
106
107	* elf_getdata.c (__libelf_set_rawdata_wrlock): Check
108	__gelf_getehdr_rdlock return value.
109
1102020-04-25  Mark Wielaard  <mark@klomp.org>
111
112	* elf_compress.c (__libelf_compress): Remove free (out_buf).
113
1142020-03-18  Omar Sandoval  <osandov@fb.com>
115
116	* elf_getphdrnum.c (__elf_getphdrnum_rdlock): Call
117	__elf{32,64}_getshdr_rdlock if the shdr is not cached.
118
1192019-03-20  Matthias Maennich  <maennich@google.com>
120
121	* elf_compress.c (__libelf_compress): Always call deflate_cleanup
122	in failure path. Call deflateEnd only once.
123	(__libelf_decompress): Call inflateEnd only once.
124
1252019-06-18  Mark Wielaard  <mark@klomp.org>
126
127	* common.h (allocate_elf): Use int64_t instead of off_t for offset.
128	* elf32_newphdr.c (newphdr): Document why Elf32/64_Word is correct.
129	* elf32_updatefile.c (fill): Use int64_t instead of off_t for pos.
130	(updatefile): Define last_offset, shdr_offset and scn_start as
131	int64_t instead of off_t.
132	* elf32_updatenull.c: Define Elf32_SizeWord and Elf64_SizeWord.
133	(updatenull_wrlock): Return int64_t instead of off_t. Define size,
134	sh_entsize, sh_align and sh_size as SizeWords. Define offset as
135	int64_t.  Cast data->d_off to SizeWord instead of GElf_Word. Drop
136	size GElf_Word cast. Cast offset to SizeWord instead of GElf_Word
137	when comparing with sh_size.
138	* elf_begin.c (get_shnum): Define offset as int64_t instead of
139	off_t. Document why use GElf_Word is correct.
140	(file_read_elf): Define offset as int64_t instead of off_t.
141	(__libelf_read_mmaped_file): Likewise.
142	(read_unmmaped_file): Likewise.
143	(read_file): Likewise.
144	* elf_getaroff.c (elf_getaroff): Return int64_t.
145	* elf_getbase.c (elf_getbase): Likewise.
146	* elf_getdata_rawchunk.c (elf_getdata_rawchunk): Define offset as
147	int64_t instead of off_t.
148	* elf_update.c (write_file): Return int64_t instead of off_t,
149	define size as int64_t instead of off_t.
150	(elf_update): Likewise.
151	* libelfP.h (struct Elf): Define start_offset, sizestr_offset and
152	offset as int64_t.
153	(__libelf_read_mmaped_file): Define offset as int64_t.
154	(__elf32_updatenull_wrlock): Return int64_t.
155	(__elf64_updatenull_wrlock): Return int64_t.
156
1572019-05-12  Mark Wielaard  <mark@klomp.org>
158
159	* elf32_updatenull.c (updatenull_wrlock): Mark shdr_flags dirty if
160	either offset or size changed.
161
1622019-05-01  Mark Wielaard  <mark@klomp.org>
163
164	* gelf_getnote.c (gelf_getnote): Check n_namesz doesn't overflow
165	offset.
166
1672019-04-30  Mark Wielaard  <mark@klomp.org>
168
169	* note_xlate.h (elf_cvt_note): Indicate we only translated the note
170	header if we ran out of data by updating len, src and dest.
171
1722019-04-01  Mao Han  <han_mao@c-sky.com>
173
174	* elf.h: Update from glibc.
175
1762019-03-07  Mark Wielaard  <mark@klomp.org>
177
178	* elf32_updatefile.c (updatemmap): Use posix_memalign instead of
179	aligned_alloc.
180
1812019-03-06  Mark Wielaard  <mark@klomp.org>
182
183	* elf32_updatefile.c (updatemmap): Free scns before returning
184	allocation failure.
185
1862019-02-24  Mark Wielaard  <mark@klomp.org>
187
188	* gelf_xlate.c (__elf_xfctstof): Remove alias.
189	* libelfP.h (__elf_xfctstof): Remove definition.
190
1912019-02-24  Mark Wielaard  <mark@klomp.org>
192
193	* elf32_fsize.c (local_strong_alias): Remove definition.
194	(msize): Remove alias.
195	* libelfP.h (__elf32_msize): Remove definition.
196	(__elf64_msize): Likewise.
197
1982019-02-21  Mark Wielaard  <mark@klomp.org>
199
200	* common.h (determine_kind): Only accept EV_CURRENT.
201	* elf32_fsize.c (fsize): Just check version is EV_CURRENT.
202	Use __libelf_type_size without version dimension.
203	* elf32_updatefile.c (updatemmap): Define fctp from __elf_xfctstom
204	without version dimension.
205	(updatefile): Likewise.
206	* elf32_updatenull.c (default_ehdr): Check e_version is EV_CURRENT.
207	(updatenull_wrlock): Check d_version is EV_CURRENT.
208	(elf32_xlatetof): Likewise. And get recsize without version
209	dimension from __elf_xfctstom.
210	(elf32_xlatetom): Likewise.
211	* elf_begin.c (elf_begin): Check __libelf_version is EV_CURRENT.
212	* elf_compress.c (__libelf_reset_rawdata): Set d_version to
213	EV_CURRENT.
214	* elf_getdata.c (shtype_map): Remove version dimension.
215	(__libelf_type_aligns): Likewise.
216	(__libelf_data_type): Use shtype_map without version dimension.
217	(convert_data): Remove unused version argument. Get fp from
218	__elf_xfctstom without version dimensions.
219	(__libelf_set_data_list_rdlock): Call convert_data without version.
220	* elf_getdata_rawchunk.c (elf_getdata_rawchunk): Call __elfcfctstom
221	conversion function without version dimensions. Set d_version to
222	EV_CURRENT.
223	* elf_newdata.c (elf_newdata): Set d_version to EV_CURRENT.
224	* elf_version.c (__libelf_version_initialized): Removed.
225	(__libelf_version): Initialized to EV_NONE.
226	(elf_version): Always return EV_CURRENT for EV_NONE version.
227	Only accept (and return) EV_CURRENT as version.
228	* gelf_fsize.c (__libelf_type_sizes): Remove version dimension.
229	(gelf_fsize): Only accept EV_CURRENT as version.
230	Use __libelf_type_sizes without version dimension.
231	* gelf_xlate.c (__elf_xftstom): Remove version dimensions.
232	* libelfP.h (__elf_xfctstom): Defined without version dimensions.
233	(__elf_xfctstof): Likewise.
234	(__libelf_type_sizes): Define without version dimension.
235	(elf_typesize): Define using __libelf_type_sizes without version
236	dimension.
237	(__libelf_version_initialized): Remove definition.
238	(__libelf_version): Add definition.
239	(LIBELF_EV_IDX): Removed define.
240	(__libelf_type_aligns): Remove version dimension.
241	* nlist.c (nlist): Call elf_version unconditionally.
242
2432019-02-19  Mark Wielaard  <mark@klomp.org>
244
245	* elf_compress.c (do_deflate_cleanup): Remove ei_data argument,
246	check cdatap is not NULL before calling free.
247	(deflate_cleanup): Add cdata as argument.
248	(__libelf_compress): Also check whether the d_size is not zero
249	before converting data. Call deflate_cleanup with an extra
250	argument depending on whether there is converted data to free.
251	Always allocate allocate at least one byte for buf_out.
252
2532019-02-14  Mark Wielaard  <mark@klomp.org>
254
255	* elf_begin.c (read_long_names): Make sure ar_size is properly
256	terminated. Sanity check len early if we can.
257
2582019-01-18  Mark Wielaard  <mark@klomp.org>
259
260	* Makefile.am (INSTALL_ELFH): Add elf.h to include_HEADERS when
261	defined, otherwise (the default) add elf.h to noinst_HEADERS.
262
2632019-01-16  Mark Wielaard  <mark@klomp.org>
264
265	* note_xlate.h (elf_cvt_note): Check n_namesz and n_descsz don't
266	overflow note_len into note header.
267
2682018-11-17  Mark Wielaard  <mark@klomp.org>
269
270	* elf32_updatefile.c (updatemmap): Make sure to call convert
271	function on a properly aligned destination.
272
2732018-11-16  Mark Wielaard  <mark@klomp.org>
274
275	* libebl.h (__elf32_msize): Mark with const attribute.
276	(__elf64_msize): Likewise.
277
2782018-11-13  Mark Wielaard  <mark@klomp.org>
279
280	* elf_getdata.c (__libelf_set_rawdata_wrlock): Explicitly set the
281	alignment of SHF_COMPRESSED data to the alignment of ELF_T_CHDR.
282	* elf_compress.c (elf_compress): After compression set sh_addralign
283	to the alignment of ELF_T_CHDR.
284
2852018-11-09  Mark Wielaard  <mark@klomp.org>
286
287	* elf_compress_gnu.c (elf_compress_gnu): Use elf_getdata.
288
2892018-11-12  Mark Wielaard  <mark@klomp.org>
290
291	* elf-knowledge.c (ELF_NOTE_GNU_BUILD_ATTRIBUTE_PREFIX): New define.
292	(NT_GNU_BUILD_ATTRIBUTE_{OPEN,FUNC}): Likewise.
293	(GNU_BUILD_ATTRIBUTE_TYPE_{NUMERIC,STRING,BOOL_TRUE,BOOL_FALSE}):
294	Likewise.
295	(GNU_BUILD_ATTRIBUTE_{VERSION,STACK_PROT,RELRO,STACK_SIZE,TOOL,ABI,
296	PIC,SHORT_ENUM}): Likewise.
297
2982018-11-09  Mark Wielaard  <mark@klomp.org>
299
300	* elf_compress.c (__libelf_reset_rawdata): Make rawdata change
301	explicit by calling __libelf_set_data_list.
302	* elf_getdata.c (convert_data): Don't convert if type is ELF_T_BYTE
303	even if endianness is different.
304
3052018-10-18  Mark Wielaard  <mark@klomp.org>
306
307	* libelf.h (Elf_Type): Add ELF_T_NHDR8.
308	* libelfP.h (__libelf_data_type): Add align argument.
309	(NOTE_ALIGN): Split into...
310	(NOTE_ALIGN4): ... and ...
311	(NOTE_ALIGN8): this.
312	* elf32_xlatetom.c (xlatetom): Recognize both ELF_T_NHDR and
313	ELF_T_NHDR8.
314	* elf_compress.c (elf_compress): Pass zdata_align to
315	__libelf_data_type.
316	* elf_compress_gnu.c (elf_compress_gnu): Pass sh_addralign to
317	__libelf_data_type.
318	* elf_getdata.c (shtype_map): Add ELF_T_NHDR8.
319	(__libelf_data_type): Take align as extra argument, use it to
320	determine Elf_Type.
321	(__libelf_set_rawdata_wrlock): Recognize ELF_T_NHDR8. Pass align to
322	__libelf_data_type.
323	* gelf_fsize.c (__libelf_type_sizes): Add ELF_T_NHDR8.
324	* gelf_getnote.c (gelf_getnote): Use Elf_Type of Elf_Data to calculate
325	padding.
326	* gelf_xlate.c (__elf_xfctstom): Set ELF_T_NHDR to elf_cvt_note4,
327	add ELF_T_NHDR8.
328	* note_xlate.h (elf_cvt_note): Take nhdr8 argument and use it to
329	determine padding.
330	(elf_cvt_note4): New function.
331	(elf_cvt_note8): Likewise.
332
3332018-09-13  Mark Wielaard  <mark@klomp.org>
334
335	* elf32_updatefile.c (updatemmap): Use shnum, not ehdr->e_shnum.
336	* elf_getscn.c (elf_getscn): Create section zero if it is requested,
337	but doesn't exist yet.
338
3392018-09-12  Mark Wielaard  <mark@klomp.org>
340
341	* elf32_updatefile.c (updatemmap): Use memmove, not memcpy.
342	* elf_update.c (write_file): Try to mremap if file needs to be
343	extended.
344
3452018-08-18  Mark Wielaard  <mark@klomp.org>
346
347	* libelf.h (elf_compress_gnu): Add documentation about
348	interaction between SHF_COMPRESED and elf_compress_gnu.
349	* elf_compress_gnu.c (elf_compress_gnu): Return error if section
350	sh_flags has SHF_COMPRESSED set.
351
3522018-07-27  Mark Wielaard  <mark@klomp.org>
353
354	* libelf.h (elf_getshdrstrndx): Fix documentation.
355	(elf_getshstrndx): Likewise.
356
3572018-06-19  Mark Wielaard  <mark@klomp.org>
358
359	* libelfP.h (__libelf_type_align): Remove !ALLOW_UNALIGNED guard.
360	* elf_getdata.c (__libelf_type_aligns): Likewise.
361	(convert_data): Remove ALLOW_UNALIGNED check.
362	* elf_getdata_rawchunk.c (elf_getdata_rawchunk): Likewise.
363
3642018-06-21  Mark Wielaard  <mark@klomp.org>
365
366	* elf.h: Update from glibc.
367
3682018-04-19  Andreas Schwab  <schwab@suse.de>
369
370	* elf.h: Update from glibc.
371
3722018-02-16  Mark Wielaard  <mark@klomp.org>
373
374	* elf.h: Update from glibc.
375
3762018-02-09  Joshua Watt  <JPEWhacker@gmail.com>
377
378	* elf32_updatenull.c (updatenull_wrlock): Use FALLTHROUGH macro
379	instead of comment.
380	* elf_begin.c (read_unmmaped_file): Likewise.
381	(elf_begin): Likewise.
382	* elf_cntl.c (elf_cntl): Likewise.
383
3842017-10-04  Mark Wielaard  <mark@klomp.org>
385
386	* elf_begin.c (file_read_elf): Skip sanity checking e_shoff if scncnt
387	is zero, we won't use it then.
388
3892017-10-04  Mark Wielaard  <mark@klomp.org>
390
391	* libelfP.h: Add ELF_E_INVALID_ELF to error values enum.
392	* elf_error.c (ELF_E_INVALID_ELF_IDX): New define. Use it as value
393	for ELF_E_INVALID_ELF in msgidx.
394	* elf_getshdrstrndx.c (elf_getshdrstrndx): Distinquish between pread
395	failing and not having enough data.
396	* elf_begin.c (get_shnum): Likewise. Explicitly set libelf errno on
397	too large value.
398	(file_read_elf): Make sure to always set libelf errno when returning
399	NULL. Distinquish between i/o file and elf data errors.
400
4012017-08-18  Ulf Hermann  <ulf.hermann@qt.io>
402
403	* gelf_xlate.c: Use attribute_packed.
404
4052017-04-27  Ulf Hermann  <ulf.hermann@qt.io>
406
407	* libelfP.h: Use attribute_hidden.
408
4092017-04-27  Ulf Hermann  <ulf.hermann@qt.io>
410
411	* Makefile.am: Use fpic_CFLAGS and dso_LDFLAGS.
412
4132017-08-15  Mark Wielaard  <mark@klomp.org>
414
415	* elf.h: Update from glibc. Add new powerpc note descriptors.
416
4172017-07-19  Gustavo Romero <gromero@linux.vnet.ibm.com>
418
419	* elf.h: Add known type in notes segment descriptor for HTM SPRs.
420
4212017-02-17  Ulf hermann  <ulf.hermann@qt.io>
422
423	* Makefile.am: Add libelf_so_DEPS, which include libeu.a,
424	libelf_so_LIBS.
425	(libelf_so_LDLIBS): Add $(libelf_so_DEPS).
426	(libelf.so$(EXEEXT): Use $(libelf_so_LIBS), require libelf.map
427	from the right directory.
428
4292017-04-20  Ulf Hermann  <ulf.hermann@qt.io>
430
431	* libelfP.h: Don't include config.h.
432
4332017-04-20  Ulf Hermann  <ulf.hermann@qt.io>
434
435	* elf_begin.c: Use F_GETFD rather than F_GETFL.
436
4372017-04-20  Ulf Hermann  <ulf.hermann@qt.io>
438
439	* libelf.h: Define macros for various function attributes and use
440	them.
441
4422017-04-20  Ulf Hermann  <ulf.hermann@qt.io>
443
444	* elf_update.c: Set ELF_F_MMAPPED flag if we mmap from elf_update.
445
4462017-04-19  Mark Wielaard  <mark@klomp.org>
447
448	* elf_getarsym.c (elf_getarsym): Initialize n to zero.
449
4502017-03-27  Mark Wielaard  <mark@klomp.org>
451
452	* elf32_updatefile.c (updatemmap): Always update last_positition.
453	(updatefile): Likewise.
454
4552017-03-24  Mark Wielaard  <mark@klomp.org>
456
457	* elf_compress.c (__libelf_decompress): Check insane compression
458	ratios before trying to allocate output buffer.
459
4602016-10-11  Akihiko Odaki  <akihiko.odaki.4i@stu.hosei.ac.jp>
461	    Mark Wielaard  <mjw@redhat.com>
462
463	* gelf.h (gelf_newehdr): Change return type to void *.
464	(gelf_newphdr): Likewise.
465	* gelf_newehdr.c (gelf_newehdr): Likewise.
466	* gelf_newphdr.c (gelf_newphdr): Likewise.
467
4682016-10-21  Mark Wielaard  <mjw@redhat.com>
469
470	* elf_getdata.c (__libelf_set_rawdata_wrlock): Sanity check
471	offset and size before trying to malloc and read data.
472
4732016-10-26  Mark Wielaard  <mjw@redhat.com>
474
475	* elf_begin.c (read_file): Always set maxsize when parent == NULL.
476
4772016-10-11  Akihiko Odaki  <akihiko.odaki.4i@stu.hosei.ac.jp>
478
479	* elf_getarsym.c (elf_getarsym): Open code rawmemchr when not
480	available.
481	* elf_strptr.c: Include stdbool.h.
482	(validate_str): New function.
483	(elf_strptr): Use validate_str instead of memrchr.
484
4852016-10-11  Akihiko Odaki  <akihiko.odaki.4i@stu.hosei.ac.jp>
486
487	* elf32_updatefile.c: Remove sys/param.h include.
488	* elf32_updatenull.c: Likewise. Add system.h include.
489	* elf_begin.c: Remove sys/param.h.
490	* elf_compress: Likewise. Add system.h include.
491	(MAX): Remove definition.
492
4932016-08-07  Mark Wielaard  <mjw@redhat.com>
494
495	* elf_compress.c (__libelf_reset_rawdata): Check scn->flags and
496	free rawdata_base when malloced. Set ELF_F_MALLOCED for scn->flags.
497	* elf_end.c (elf_end): Check scn->flags and free rawdata_base if
498	malloced.
499	* libelfP.h (struct Elf_Scn): Document flags ELF_F_MALLOCED usage.
500
5012016-07-06  Mark Wielaard  <mjw@redhat.com>
502
503	* elf-knowledge.h (SH_FLAGS_COMBINE): Removed.
504	(SH_FLAGS_IMPORTANT): Likewise.
505
5062016-07-06  Mark Wielaard  <mjw@redhat.com>
507
508	* elf32_updatenull.c (updatenull_wrlock): Ignore e_type when
509	updating phdrs.
510	* elf_getphdrnum.c (__elf_getphdrnum_chk_rdlock): Only do sanity
511	checking if phdrs haven't been read in yet.
512
5132016-06-24  John Ogness  <john.ogness@linutronix.de>
514
515	* elf32_updatenull.c (updatenull_wrlock): Find first section.
516	* elf_nextscn.c (elf_nextscn): When scn is NULL start from 0th
517	section.
518
5192016-06-28  Richard Henderson  <rth@redhat.com>
520
521	* elf.h: Update from glibc.  Add lots of new EM_* definitions.
522
5232016-04-14  Mark Wielaard  <mjw@redhat.com>
524
525	* elf_compress.c (__libelf_compress): Free out_buf if deflateInit
526	fails.
527
5282016-02-13  Mark Wielaard  <mjw@redhat.com>
529
530	* elf32_updatefile.c (updatemmap): Free scns when out of memory.
531
5322016-01-28  Mark Wielaard  <mjw@redhat.com>
533
534	* elf.h: Update from glibc. Add new i386 and x86_64 relocations.
535
5362016-02-12  Mark Wielaard  <mjw@redhat.com>
537
538	* elf.h: Update from glibc. Add NT_ARM_SYSTEM_CALL.
539
5402016-02-04  Mark Wielaard  <mjw@redhat.com>
541
542	* elf_getdata.c (__libelf_set_rawdata_wrlock): Don't adjust align
543	for SHT_NOBITS sections.
544
5452016-01-22  Chih-Hung Hsieh <chh@google.com>
546
547	* elf_compress.c (__libelf_compress): Move nested function
548	'do_deflate_cleanup' to file scope to compile with clang.
549	* elf_strptr.c (elf_strptr): Move nested function 'get_zdata'
550	to file scope to compile with clang.
551
5522016-01-13  Mark Wielaard  <mjw@redhat.com>
553
554	* libelf.h: Check SHF_COMPRESSED is defined. If not define it and the
555	associated ELF compression types/defines.
556
5572015-11-26  Mark Wielaard  <mjw@redhat.com>
558
559	* elf_compress.c (__libelf_decompress_elf): New function, extracted
560	from...
561	(elf_compress): here. Check zdata_base use __libelf_decompress_elf.
562	* elf_strptr.c (elf_strptr): If SHF_COMPRESSED check, uncompress and
563	use zdata.
564	* libelfP.h (struct Elf_Scn): Add zdata_size and zdata_align.
565	(__libelf_decompress_elf): New internal function definition.
566
5672015-10-21  Mark Wielaard  <mjw@redhat.com>
568
569	* Makefile.am (libelf_a_SOURCES): Add elf_compress.c and
570	elf_compress_gnu.c.
571	* elf_compress.c: New file.
572	* elf_compress_gnu.c: Likewise.
573	* elf_begin.c (file_read_elf): Make a writable copy of the shdrs
574	for ELF_C_READ_MMAP.
575	* elf_end.c (elf_end): Free zdata_base.
576	* elf_error.c: Add ELF_E_ALREADY_COMPRESSED,
577	ELF_E_UNKNOWN_COMPRESSION_TYPE, ELF_E_COMPRESS_ERROR and
578	ELF_E_DECOMPRESS_ERROR.
579	* elf_data.c (__libelf_data_type): New internal function extracted
580	from convert_data.
581	(convert_data): Handle SHF_COMPRESSED.
582	* elf32_updatenull.c (updatenull_wrlock): Check sh_entsize against
583	uncompressed section data size if SHF_COMPRESSED.
584	* elf32_getshdr.c (load_shdr_wrlock): Adjust assert to account for
585	ELF_C_READ_MMAP.
586	* libelf.h: Define elf_compress and elf_compress_gnu.
587	* libelf.map (ELFUTILS_1.7): Add elf_compress and elf_compress_gnu.
588	* libelfP.h: Add ELF_E_ALREADY_COMPRESSED,
589	ELF_E_UNKNOWN_COMPRESSION_TYPE, ELF_E_COMPRESS_ERROR and
590	ELF_E_DECOMPRESS_ERROR. Define __libelf_data_type.
591	(__libelf_compress): New internal function definition.
592	(__libelf_decompress): Likewise.
593	(__libelf_reset_rawdata): Likewise.
594	(__libelf_data_type): Likewise.
595	(struct Elf_Scn): Add zdata_base.
596
5972015-11-19  Mark Wielaard  <mjw@redhat.com>
598
599	* Makefile.am (libelf_a_SOURCES): Add elf32_getchdr.c,
600	elf64_getchdr.c and gelf_getchdr.c.
601	(noinst_HEADERS): Add chdr_xlate.h.
602	* abstract.h: Define Chdr32 and Chdr64.
603	* chdr_xlate.h: New file.
604	* elf32_getchdr.c: New file.
605	* elf64_getchdr.c: New file.
606	* elf_error.c: Add ELF_E_NOT_COMPRESSED, ELF_E_INVALID_SECTION_TYPE
607	and ELF_E_INVALID_SECTION_FLAGS.
608	* elf_getdata.c (__libelf_set_rawdata_wrlock): Set d_type to
609	ELF_T_CHDR for SHF_COMPRESSED sections.
610	* exttypes.h: Add Chdr32 and Chdr64.
611	* gelf.h (GElf_Chdr): New typedef.
612	(gelf_getchdr): New function definition.
613	* gelf_fsize.c (__libelf_type_sizes): Add ELF_T_CHDR.
614	* gelf_getchdr.c: New file.
615	* gelf_xlate.c (__elf_xfctstom): Add ELF_T_CHDR cvt_chdr.
616	* gelf_xlate.h: Add Chdr.
617	* libelf.h (Elf_Type): Add ELF_T_CHDR.
618	(elf32_getchdr): New function definition.
619	(elf64_getchdr): Likewise.
620	* libelf.map (ELFUTILS_1.7): New sections add elf32_getchdr,
621	elf64_getchdr and gelf_getchdr.
622	* libelfP.h: Add ELF_E_NOT_COMPRESSED, ELF_E_INVALID_SECTION_TYPE
623	and ELF_E_INVALID_SECTION_FLAGS.
624
6252015-10-16  Mark Wielaard  <mjw@redhat.com>
626
627	* Makefile.am (libelf_so_LDLIBS): Add -lz.
628
6292015-10-14  Mark Wielaard  <mjw@redhat.com>
630
631	* elf.h: Update from glibc. Add section compression constants and
632	structures.
633
6342015-10-20  Jose E. Marchesi  <jose.marchesi@oracle.com>
635
636	* elf_begin.c (get_shnum): Elf64_Shdr.sh_size is an Elf64_Xword.
637	Fix the size argument to pread_retry.
638
6392015-10-13  Chih-Hung Hsieh  <chh@google.com>
640
641	* elf32_updatefile.c (__elfw2(LIBELFBITS,updatemmap)): Move nested
642	function 'fill_mmap' to file scope.
643	* elf_begin.c (elf_begin): Move nested function 'lock_dup_elf'
644	to file scope.
645
6462015-10-09  Josh Stone  <jistone@redhat.com>
647
648	* libelf.h: Replace loff_t with int64_t throughout.
649
6502015-10-05  Mark Wielaard  <mjw@redhat.com>
651
652	* elf_update.c (write_file): Only use posix_fallocate when using
653	mmap. Only report failure when errno is ENOSPC.
654
6552015-10-09  Josh Stone  <jistone@redhat.com>
656
657	* libelfP.h (struct Elf): Replace off64_t with off_t.
658	* elf_getdata_rawchunk.c (elf_getdata_rawchunk): Likewise.
659
6602015-10-05  Chih-Hung Hsieh <chh@google.com>
661
662	* elf_getarsym.c (elf_getarsym): Do not use
663	union of variable length arrays.
664
6652015-10-05  Josh Stone  <jistone@redhat.com>
666
667	* Makefile.am (libelf.so): Add AM_V_CCLD and AM_V_at silencers.
668
6692015-09-24  Jose E. Marchesi  <jose.marchesi@oracle.com>
670
671	* Makefile.am (AM_CFLAGS): Use -fPIC instead of -fpic to avoid
672	relocation overflows in some platforms.
673
6742015-09-29  Mark Wielaard  <mjw@redhat.com>
675
676	* elf32_updatenull.c (default_ehdr): Set e_version when EV_NONE.
677	(updatenull_wrlock): Always set e_shentsize.
678
6792015-09-23  Mark Wielaard  <mjw@redhat.com>
680
681	* elf32_getehdr.c (getehdr_wrlock): Mark as internal_function.
682	* elf32_getshdr.c (getshdr_rdlock): Likewise.
683	(getshdr_wrlock): Likewise.
684	* elf_error.c (__libelf_seterrno): Likewise.
685	* elf_getphdrnum.c (__elf_getphdrnum_rdlock): Likewise.
686	(__elf_getphdrnum_chk_rdlock): Likewise.
687	* elf_getshdrnum.c (__elf_getphdrnum_rdlock): Likewise.
688	(__elf_getphdrnum_chk_rdlock): Likewise.
689	* elf_getshdrnum.c (__elf_getshdrnum_rdlock): Likewise.
690	* elf_readall.c (__libelf_readall): Likewise.
691	* gelf_getehdr.c (__gelf_getehdr_rdlock): Likewise.
692
6932015-09-22  Mark Wielaard  <mjw@redhat.com>
694
695	* *.c: Remove old-style function definitions.
696
6972015-06-22  Mark Wielaard  <mjw@redhat.com>
698
699	* dl-hash.h: Update from glibc.
700
7012015-06-18  Mark Wielaard  <mjw@redhat.com>
702
703	* elf32_updatefile.c (updatefile): Always free shdr_data and scns
704	when allocated on failure paths.
705
7062015-06-18  Mark Wielaard  <mjw@redhat.com>
707
708	* nlist.c (nlist): Check symscn shdr exists before use.
709
7102015-06-16  Mark Wielaard  <mjw@redhat.com>
711
712	* elf_update.c (write_file): Always also use ftruncate before
713	posix_fallocate to make sure file has the right size.
714
7152015-06-04  Mark Wielaard  <mjw@redhat.com>
716
717	* elf_getdata.c (__libelf_type_aligns): Add entries for ELF_T_EHDR,
718	ELF_T_OFF, ELF_T_PHDR, ELF_T_SHDR, ELF_T_SWORD, ELF_T_XWORD,
719	ELF_T_SXWORD, ELF_T_GNUHASH, ELF_T_AUXV.
720	* elf_getdata_rawchunk.c (elf_getdata_rawchunk): Check alignment
721	of rawdata against requested type.
722
7232015-06-02  Mark Wielaard  <mjw@redhat.com>
724
725	* elf_getdata.c (convert_data): Make sure source data is properly
726	aligned for type before calling actual conversion function.
727
7282015-06-04  Mark Wielaard  <mjw@redhat.com>
729
730	* elf_begin.c (get_shnum): Check alignment of Shdr, not Ehdr before
731	direct access.
732
7332015-06-02  Mark Wielaard  <mjw@redhat.com>
734
735	* elf_begin.c (file_read_elf): Split checks for ehdr and shdr
736	alignment, drop phdr alignment check.
737
7382015-05-31  Mark Wielaard  <mjw@redhat.com>
739
740	* elf32_getshdr.c (load_shdr_wrlock): Allocate shdrs with malloc,
741	not alloca and free after conversion when a copy needs to be made.
742
7432015-05-31  Mark Wielaard  <mjw@redhat.com>
744
745	* elf32_getphdr.c (getphdr_wrlock): Allocate phdrs with malloc, not
746	alloca and free after conversion when a copy needs to be made.
747
7482015-05-31  Mark Wielaard  <mjw@redhat.com>
749
750	* elf_getarsym.c (elf_getarsym): Allocate temporary file_date with
751	malloc, not alloca also in !ALLOW_UNALIGNED case.
752
7532015-05-30  Mark Wielaard  <mjw@redhat.com>
754
755	* gelf_xlate.c (elf_cvt_Byte): Only call memmove with non-zero size.
756
7572015-05-30  Mark Wielaard  <mjw@redhat.com>
758
759	* elf32_updatefile.c (updatemmap): Only call mempcpy and update
760	last_position when d_size is non-zero.
761
7622015-05-17  Mark Wielaard  <mjw@redhat.com>
763
764	* elf32_updatefile.c (updatefile): Allocate shdr_data and scns
765	with malloc, not alloca. Free after writing section headers.
766
7672015-05-16  Mark Wielaard  <mjw@redhat.com>
768
769	* elf32_updatefile.c (updatemmap): Allocate temporary shdr storage
770	with malloc, not alloca. Free after writing section header.
771
7722015-05-16  Mark Wielaard  <mjw@redhat.com>
773
774	* elf_getarsym.c (elf_getarsym): Allocate temporary file_date with
775	malloc, not alloca. Call free after out.
776
7772015-05-14  Mark Wielaard  <mjw@redhat.com>
778
779	* elf_update.c (write_file): Use posix_fallocate instead of
780	ftruncate to extend file if necessary.
781
7822015-05-13  Mark Wielaard  <mjw@redhat.com>
783
784	* elf32_updatenull.c (default_ehdr): If e_phnum is zero then set
785	e_phoff also to zero.
786
7872015-05-12  Mark Wielaard  <mjw@redhat.com>
788
789	* elf32_updatenull.c (updatenull_wrlock): Check that sh_addralign
790	is a powerof2.
791	* elf_getdata.c (__libelf_set_rawdata_wrlock): Clamp large d_aligns
792	to the elf image offset.
793
7942015-05-12  Mark Wielaard  <mjw@redhat.com>
795
796	* elf32_newphdr.c (newphdr): Call __libelf_seterrno with
797	ELF_E_INVALID_INDEX before failing. Check whether section zero shdr
798	actually exists if we need to put extended phnum in section zero.
799
8002015-05-08  Mark Wielaard  <mjw@redhat.com>
801
802	* nlist.c (nlist): Call gelf_fsize with EV_CURRENT.
803
8042015-01-03  Mark Wielaard  <mjw@redhat.com>
805
806	* version_xlate.h (elf_cvt_Verdef): Use memmove to copy src to dest.
807	(elf_cvt_Verneed): Likewise.
808
8092015-03-28  Mark Wielaard  <mjw@redhat.com>
810
811	* elf.h: Update from glibc.
812
8132015-03-23  Mark Wielaard  <mjw@redhat.com>
814
815	* elf32_updatenull.c (updatenull_wrlock): Don't extend size with
816	SHT_NOBITS sh_offset.
817
8182015-02-18  Mark Wielaard  <mjw@redhat.com>
819
820	* libelfP.h (__libelf_set_data_list_rdlock): Make internal_function.
821
8222015-02-07  Jan Kratochvil  <jan.kratochvil@redhat.com>
823
824	* elf32_updatenull.c (__elfw2(LIBELFBITS,updatenull_wrlock)): Consider
825	sh_addralign 0 as 1.
826
8272015-01-22  Mark Wielaard  <mjw@redhat.com>
828
829	* elf_strptr (elf_strptr): Make sure returned string is NUL
830	terminated.
831
8322015-01-21  Mark Wielaard  <mjw@redhat.com>
833
834	* elf_strptr.c (elf_strptr): Check data_list_rear == NULL instead
835	of rawdata_base != NULL before using rawdata directly.
836
8372015-01-20  Mark Wielaard  <mjw@redhat.com>
838
839	* libelfP.h (__elf_strptr_internal): New function declaration.
840	* elf_getdata.c (__libelf_set_data_list_rdlock): New internal
841	function extracted from...
842	(__elf_getdata_rdlock): ... here.
843	* elf_newdata.c (elf_newdata): Check scn->rawdata_base and update
844	datalist if necessary.
845
8462015-01-20  Mark Wielaard  <mjw@redhat.com>
847
848	* elf_strptr.c (elf_strptr): Call __elf[32|64]_getshdr_rdlock if
849	necessary.
850
8512014-12-30  Mark Wielaard  <mjw@redhat.com>
852
853	* elf_getphdrnum.c (__elf_getphdrnum_chk_rdlock): New function.
854	(elf_getphdrnum): Call __elf_getphdrnum_chk_rdlock.
855	* gelf_getphdr (gelf_getphdr): Call __elf_getphdrnum_chk_rdlock
856	and always check ndx against phnum.
857	* libelfP.h (__elf_getphdrnum_chk_rdlock): New internal function.
858
8592014-12-25  Mark Wielaard  <mjw@redhat.com>
860
861	* elf_begin.c (__libelf_next_arhdr_wrlock): ar_size cannot be
862	negative. Include start_offset in maxsize.
863
8642014-12-28  Alexander Cherepanov  <cherepan@mccme.ru>
865
866	* elf_begin.c (read_long_names): Don't miss '/' right after
867	another '/'. Fixes a dir traversal vuln in ar extraction.
868
8692014-12-18  Ulrich Drepper  <drepper@gmail.com>
870
871	* Makefile.am: Suppress output of textrel_check command.
872
8732014-12-16  Mark Wielaard  <mjw@redhat.com>
874
875	* elf_begin.c (read_long_names): Make sure long_names len fits
876	in mapped ELF file.
877
8782014-12-15  Mark Wielaard  <mjw@redhat.com>
879
880	* elf_getarsym.c (elf_getarsym): Check index_size doesn't overflow.
881
8822014-12-15  Mark Wielaard  <mjw@redhat.com>
883
884	* elf_begin.c (read_long_names): Clear any garbage left in the
885	name table.
886
8872014-12-11  Mark Wielaard  <mjw@redhat.com>
888
889	* elf_begin.c (file_read_elf): Correct ELF64 section offset check.
890
8912014-12-11  Mark Wielaard  <mjw@redhat.com>
892
893	* elf_begin.c (read_long_names): Check for offset overflow.
894	(__libelf_next_arhdr_wrlock): Likewise. Sanity check the ar_size.
895	Don't allow it to go beyond end of file.
896
8972014-12-09  Mark Wielaard  <mjw@redhat.com>
898
899	* elf_getarsym.c (elf_getarsym): Make sure n * w doesn't overflow.
900
9012014-11-27  Mark Wielaard  <mjw@redhat.com>
902
903	* Makefile.am (libelf.so): Use textrel_check.
904
9052014-11-23  Mark Wielaard  <mjw@redhat.com>
906
907	* elf_getdata_rawchunk.c (elf_getdata_rawchunk): Change signed
908	overflow check to unsigned.
909
9102014-11-23  Mark Wielaard  <mjw@redhat.com>
911
912	* note_xlate.h (elf_cvt_note): Copy over any leftover data if
913	src != dest. The data is probably part of truncated name/desc.
914
9152014-11-22  Mark Wielaard  <mjw@redhat.com>
916
917	* elf_getphdrnum.c (elf_getphdrnum): Sanity check the
918	__elf_getphdrnum_rdlock result.
919
9202014-11-18  Mark Wielaard  <mjw@redhat.com>
921
922	* version_xlate.h (elf_cvt_Verdef): Check for overflow.
923	(elf_cvt_Verneed): Likewise.
924
9252014-11-17  Mark Wielaard  <mjw@redhat.com>
926
927	* elf-knowledge.h (SECTION_STRIP_P): Check name is not NULL.
928
9292014-11-16  Mark Wielaard  <mjw@redhat.com>
930
931	* elf_getshdrstrndx.c: Check there are section headers before
932	handling SHN_XINDEX.
933
9342014-11-16  Mark Wielaard  <mjw@redhat.com>
935
936	* elf32_getphdr.c (getphdr_wrlock): Check e_phoff isn't zero.
937	Check for too many pheaders.
938	* elf_getphdrnum.c (__elf_getphdrnum_rdlock): Check section zero
939	actually exists before handling PN_XNUM.
940
9412014-11-16  Mark Wielaard  <mjw@redhat.com>
942
943	* gelf_getnote.c (gelf_getnote): Check padding overflow.
944
9452014-11-16  Mark Wielaard  <mjw@redhat.com>
946
947	* elf_getdata.c (__libelf_set_rawdata_wrlock): Declare offset, size
948	and align as Elf64_Off and Elf64_Xword not size_t.
949
9502014-11-14  Mark Wielaard  <mjw@redhat.com>
951
952	* gelf_getnote.c (gelf_getnote): Check offset overflow.
953
9542014-11-13  Mark Wielaard  <mjw@redhat.com>
955
956	* elf_getdata.c (__libelf_set_rawdata_wrlock): Fix unsigned overflow
957	check.
958
9592014-11-08  Mark Wielaard  <mjw@redhat.com>
960
961	* elf_begin.c (__libelf_next_arhdr_wrlock): Use mempcpy not __mempcpy.
962
9632014-11-07  Mark Wielaard  <mjw@redhat.com>
964
965	* elf_begin.c (file_read_elf): Correct sh_size check.
966	* elf_getdata.c (__libelf_set_rawdata_wrlock): Check for unsigned
967	overflow.
968
9692014-09-10  Petr Machata  <pmachata@redhat.com>
970
971	* elf_begin (read_unmmaped_file): Call __libelf_seterrno if the
972	file is unreadable.
973
9742014-07-07  Mark Wielaard  <mjw@redhat.com>
975
976	* elf.h: Update from glibc.
977
9782014-04-13  Mark Wielaard  <mjw@redhat.com>
979
980	* Makefile.am: Remove !MUDFLAP conditions.
981	* elf_begin.c (read_file): Don't clear use_mmap when _MUDFLAP is
982	defined.
983	* elf_update.c (write_file): Remove _MUDFLAP condition.
984
9852014-01-17  Jakub Jelinek  <jakub@redhat.com>
986	    Roland McGrath  <roland@redhat.com>
987
988	* libelfP.h (INVALID_NDX): Define.
989	* gelf_getdyn.c (gelf_getdyn): Use it.  Remove ndx < 0 test if any.
990	* gelf_getlib.c (gelf_getlib): Likewise.
991	* gelf_getmove.c (gelf_getmove): Likewise.
992	* gelf_getrel.c (gelf_getrel): Likewise.
993	* gelf_getrela.c (gelf_getrela): Likewise.
994	* gelf_getsym.c (gelf_getsym): Likewise.
995	* gelf_getsyminfo.c (gelf_getsyminfo): Likewise.
996	* gelf_getsymshndx.c (gelf_getsymshndx): Likewise.
997	* gelf_getversym.c (gelf_getversym): Likewise.
998	* gelf_update_dyn.c (gelf_update_dyn): Likewise.
999	* gelf_update_lib.c (gelf_update_lib): Likewise.
1000	* gelf_update_move.c (gelf_update_move): Likewise.
1001	* gelf_update_rel.c (gelf_update_rel): Likewise.
1002	* gelf_update_rela.c (gelf_update_rela): Likewise.
1003	* gelf_update_sym.c (gelf_update_sym): Likewise.
1004	* gelf_update_syminfo.c (gelf_update_syminfo): Likewise.
1005	* gelf_update_symshndx.c (gelf_update_symshndx): Likewise.
1006	* gelf_update_versym.c (gelf_update_versym): Likewise.
1007
10082014-01-17  Jakub Jelinek  <jakub@redhat.com>
1009
1010	* elf32_getphdr.c (elfw2(LIBELFBITS,getphdr)): Check if program header
1011	table fits into object's bounds.
1012	* elf_getshdrstrndx.c (elf_getshstrndx): Add elf->start_offset to
1013	elf->map_address.  Check if first section header fits into object's
1014	bounds.
1015	* elf32_getshdr.c (elfw2(LIBELFBITS,getshdr)):
1016	Check if section header table fits into object's bounds.
1017	* elf_begin.c (get_shnum): Ensure section headers fits into
1018	object's bounds.
1019	(file_read_elf): Make sure scncnt is small enough to allocate both
1020	ElfXX_Shdr and Elf_Scn array.  Make sure section and program header
1021	tables fit into object's bounds.  Avoid memory leak on failure.
1022	* elf_newscn.c (elf_newscn): Check for overflow.
1023	* elf32_updatefile.c (__elfw2(LIBELFBITS,updatemmap)): Likewise.
1024	(__elfw2(LIBELFBITS,updatefile)): Likewise.
1025	* elf32_newphdr.c (elfw2(LIBELFBITS,newphdr)): Likewise.
1026	* elf_getarsym.c (elf_getarsym): Likewise.
1027
10282013-11-08  Mark Wielaard  <mjw@redhat.com>
1029
1030	* elf32_updatefile.c (elfXX_updatemmap): Only memcpy ehdr when not
1031	already directly mmapped.
1032
10332013-11-05  Mark Wielaard  <mjw@redhat.com>
1034
1035	* elf32_updatefile.c (elfXX_updatefile): Copy all section headers
1036	if elf->flags dirty.
1037
10382013-11-01  Michael Forney  <mforney@mforney.org>
1039
1040	* Makefile.am: Use READELF.
1041
10422013-10-01  Petr Machata  <pmachata@redhat.com>
1043
1044	* elf.h: Update from glibc.
1045
10462013-06-17  Petr Machata  <pmachata@redhat.com>
1047
1048	* elf.h: Update from glibc.
1049
10502013-08-28  Namhyung Kim  <namhyung@gmail.com>
1051
1052	* gelf.h (gelf_fsize): Fix typo in comment.
1053
10542013-08-28  Mark Wielaard  <mjw@redhat.com>
1055
1056	* gelf_getauxv.c (gelf_getauxv): Add missing whitespace.
1057
10582013-08-27  Mark Wielaard  <mjw@redhat.com>
1059
1060	* gelf_getauxv.c (gelf_getauxv): Remove unnecessary casts to char *.
1061
10622013-08-25  Kurt Roeckx  <kurt@roeckx.be>
1063
1064	* gelf_getauxv.c (gelf_getauxv): Use memcpy instead of pointer
1065	dereference to avoid alignment problems.
1066
10672013-01-07  Roland McGrath  <roland@hack.frob.com>
1068
1069	* elf_getarsym.c (elf_getarsym): Copy FILE_DATA into stack space if it
1070	would be unaligned and !ALLOW_UNALIGNED.
1071
1072	* elf_getarsym.c (read_number_entries): Use memcpy instead of pointer
1073	dereference so as not to assume the field is naturally aligned.
1074
10752012-09-17  Petr Machata  <pmachata@redhat.com>
1076
1077	* elf.h: Update from glibc.
1078
10792012-08-16  Roland McGrath  <roland@hack.frob.com>
1080
1081	* elf.h: Update from glibc.
1082
10832012-08-14  Mark Wielaard  <mjw@redhat.com>
1084
1085	* elf32_checksum.c (ebl_debugscn_p): Removed unused define and
1086	confusing outdated comment.
1087
10882012-08-01  Petr Machata  <pmachata@redhat.com>
1089
1090	* elf_getarsym (read_number_entries): New function.
1091	(elf_getarsym): Handle 64-bit symbol table, stored in special
1092	entry named "/SYM64/".
1093	* elf_begin.c (__libelf_next_arhdr_wrlock): Don't reject archive
1094	because it contains 64-bit symbol table.
1095
10962012-07-19  Mark Wielaard  <mjw@redhat.com>
1097
1098	* elf32_getshdr.c (load_shdr_wrlock): Add elf->flags & ELF_F_MALLOCED
1099	to asserts.
1100
11012012-07-17  Petr Machata  <pmachata@redhat.com>
1102
1103	* elf32_xlatetom.c (elfw2(LIBELFBITS, xlatetom)): Do not check for
1104	integer number of records in case of ELF_T_NHDR.
1105
11062012-04-02  Mark Wielaard  <mjw@redhat.com>
1107
1108	* elf32_offscn.c: Do not match SHT_NOBITS sections at OFFSET unless
1109	there are no nonempty sections at that offset.
1110
11112012-03-21  Roland McGrath  <roland@hack.frob.com>
1112
1113	* elf-knowledge.h (SECTION_STRIP_P): Remove < SHT_NUM check.
1114
11152011-02-26  Mark Wielaard  <mjw@redhat.com>
1116
1117	* elf_end.c (elf_end): Call rwlock_unlock before rwlock_fini.
1118
11192011-01-05  Jan Kratochvil  <jan.kratochvil@redhat.com>
1120
1121	* elf_getdata_rawchunk.c (elf_getdata_rawchunk): Fix off64_t overflow
1122	when MAXIMUM_SIZE == ~0.
1123
11242010-08-18  Roland McGrath  <roland@redhat.com>
1125
1126	* gelf_fsize.c (__libelf_type_sizes): Add entries for ELF_T_LIB
1127	and ELF_T_GNUHASH.
1128	Reported by Mark Hatle <mark.hatle@windriver.com>.
1129
1130	* exttypes.h: Add cases for ElfNN_Lib.
1131	Reported by Mark Hatle <mark.hatle@windriver.com>.
1132
11332010-06-14  Ulrich Drepper  <drepper@redhat.com>
1134
1135	* gelf_update_shdr.c: Implicitly set ELF_F_DIRTY bit.
1136	* gelf_update_phdr.c: Likewise.
1137	* gelf_update_ehdr.c: Likewise.
1138
11392010-04-14  Roland McGrath  <roland@redhat.com>
1140
1141	* elf32_getphdr.c: Check for e_phoff/size outside the file bounds.
1142	* elf_begin.c (file_read_elf): Don't set .phdr here.
1143
11442010-04-13  Roland McGrath  <roland@redhat.com>
1145
1146	* elf.h: Update from glibc.
1147
11482010-04-06  Roland McGrath  <roland@redhat.com>
1149
1150	* elf_error.c (ELF_E_FD_MISMATCH_IDX): Avoid nonobvious abbreviation
1151	in error message.
1152
11532010-04-01  Petr Machata  <pmachata@redhat.com>
1154
1155	* elf_getdata.c (__elf_getdata_rdlock): Initialize data.s for data
1156	that do not need a conversion.
1157
11582010-03-11  Roland McGrath  <roland@redhat.com>
1159
1160	* elf.h: Update from glibc.
1161
11622010-03-04  Ulrich Drepper  <drepper@redhat.com>
1163
1164	* elf.h: Update from glibc.
1165
11662010-02-17  Roland McGrath  <roland@redhat.com>
1167
1168	* elf_begin.c (file_read_elf): Leave section rawdata_base and
1169	data_base pointers null when [sh_offset,sh_size) points outside
1170	the mapped file.
1171
11722010-02-15  Roland McGrath  <roland@redhat.com>
1173
1174	* Makefile.am: Use config/eu.am for common stuff.
1175
11762010-01-07  Roland McGrath  <roland@redhat.com>
1177
1178	* elf32_getphdr.c: Use __elf_getphdrnum_rdlock.
1179	* gelf_getphdr.c: Likewise.
1180	* gelf_update_phdr.c: Likewise.
1181	* elf32_updatefile.c (__elf32_updatemmap, __elf32_updatefile): Likewise.
1182	* elf32_updatenull.c (__elf32_updatenull_wrlock): Likewise.
1183	* elf32_newphdr.c: Clear section 0's sh_info when resetting e_phnum.
1184	If COUNT is too large, use store PN_XNUM instead and set sh_info.
1185	* elf_begin.c (file_read_elf): Always allocate space we can use later
1186	for section 0 if doing RDWR.
1187
1188	* elf_getphdrnum.c: New file.
1189	* Makefile.am (libelf_a_SOURCES): Add it.
1190	* libelf.h: Declare elf_getphdrnum.
1191	* libelfP.h: Declare __elf_getphdrnum_rdlock.
1192	* libelf.map (ELFUTILS_1.6): New set, add elf_getphdrnum.
1193
1194	* elf.h: Update from glibc.
1195
11962009-10-23  Lubomir Rintel  <lkundrak@v3.sk>
1197
1198	* elf32_updatefile.c (fill_mmap): When starting past shdr_end, start
1199	filling from section start, not shdr_end.
1200
12012009-11-10  Roland McGrath  <roland@redhat.com>
1202
1203	* elf_readall.c (__libelf_readall): Fetch file size if not yet known.
1204
12052009-11-06  Mark Wielaard  <mjw@redhat.com>
1206
1207	* elf_next.c (elf_next): Mark the archive header as unusable when
1208	there is no next ar element.
1209
12102009-08-12  Mark Wielaard  <mjw@redhat.com>
1211
1212	* Makefile.am (libelf.so): Use -Wl,-z,defs not -defs.
1213
12142009-07-26  Ulrich Drepper  <drepper@redhat.com>
1215
1216	* elf.h: Update from glibc.
1217
12182009-07-21  Ulrich Drepper  <drepper@redhat.com>
1219
1220	* elf32_updatefile.c (__elfXX_updatemmap): Fix handling of gaps between
1221	sections.  Patch by Lubomir Rintel <lkundrak@v3.sk>.
1222
12232009-07-08  Roland McGrath  <roland@redhat.com>
1224
1225	* libelfP.h (struct Elf): Remove unused ar.has_index field.
1226	Reorder various members for optimal packing.
1227
12282009-07-08  Ulrich Drepper  <drepper@redhat.com>
1229
1230	* elf.h: Update from glibc.
1231
12322009-06-13  Ulrich Drepper  <drepper@redhat.com>
1233
1234	* Makefile.am (libelf_a_SOURCES): Replace elf_getshnum.c and
1235	elf_getshstrndx.c with elf_getshdrnum.c and elf_getshdrstrndx.c.
1236	* elf_getshnum.c: Renamed to...
1237	* elf_getshdrnum.c: ...this.  Rename function and add old name as
1238	alias.  Likewise for internal functions with derived names.
1239	* elf_getshstrndx.c: Renamed to...
1240	* elf_getshdrstrndx.c: ...this.  Rename function and add old name as
1241	alias.  Likewise for internal functions with derived names.
1242	* libelf.h: Add prototypes for new names.  Make old names as
1243	deprecated.
1244	* libelfP.h: Rename internal function prototypes.
1245	* libelf.map: Export for names.
1246	* elf32_checksum.c: Don't use deprecated functions.
1247	* elf32_getshdr.c: Likewise.
1248
12492009-06-01  Ulrich Drepper  <drepper@redhat.com>
1250
1251	* elf.h: Update from glibc.
1252
12532009-04-14  Roland McGrath  <roland@redhat.com>
1254
1255	* elf.h: Update from glibc.
1256
12572009-04-01  Roland McGrath  <roland@redhat.com>
1258
1259	* elf.h: Update from glibc.
1260
12612009-02-10  Ulrich Drepper  <drepper@redhat.com>
1262
1263	* elf32_updatefile.c (updatefile): For the zeroth section we still
1264	have to copy the section header.
1265
12662009-02-01  Ulrich Drepper  <drepper@redhat.com>
1267
1268	* elf_strptr.c: Add comment re possible problem.
1269
12702009-01-26  Ulrich Drepper  <drepper@redhat.com>
1271
1272	* elf32_updatenull.c (updatenull_wrlock): Fix comment of
1273	ELF_F_LAYOUT behaviour re section header table.
1274
12752009-01-22  Ulrich Drepper  <drepper@redhat.com>
1276
1277	* elf32_updatefile.c (__elfXX_updatemmap): Fill the gap between
1278	sections even if only the section at the start of the gap has been
1279	changed.
1280	(__elfXX_updatefile): Likewise.
1281
12822009-01-21  Ulrich Drepper  <drepper@redhat.com>
1283
1284	* elf32_updatefile.c (__elfXX_updatemmap): Skip most of the loop to
1285	handle sections for NOBITS sections.
1286	(elfXX_updatefile): Likewise.
1287
1288	* elf32_updatefile.c (__elfXX_updatemmap): When skipping non-NOBITS
1289	sections we haven't loaded, update last_position based on scn_start,
1290	not based on old value.  Don't run the loop for the dummy section 0.
1291	(elfXX_updatefile): Don't run the loop for the dummy section 0.
1292
12932009-01-10  Ulrich Drepper  <drepper@redhat.com>
1294
1295	* libelfP.h (_): We only have one translation domain, elfutils.
1296
1297	* Makefile.am: Use USE_LOCKS instead of USE_TLS.
1298	* elf_error.c: Always use __thread.  Remove all !USE_TLS code.
1299
13002009-01-04  Roland McGrath  <roland@redhat.com>
1301
1302	* note_xlate.h (elf_cvt_note): Don't examine a size too small to
1303	container a note header.
1304
13052008-12-11  Roland McGrath  <roland@redhat.com>
1306
1307	* elf32_updatefile.c (__elfw2(LIBELFBITS,updatemmap)): Handle
1308	placement offset going backwards, for out-of-order or overlapping
1309	(bogus) sh_offset layouts.  It's a dumb use, but should not crash.
1310	(__elfw2(LIBELFBITS,updatefile)): Likewise.
1311	Fixes RHBZ#476136.
1312
1313	* libelf.h (Elf_Data): Whitespace fix.
1314
13152008-12-10  Roland McGrath  <roland@redhat.com>
1316
1317	* elf_getarhdr.c (elf_getarhdr): Fix missing rename in last change.
1318
13192008-10-22  Petr Machata  <pmachata@redhat.com>
1320
1321	* elf_rawfile.c (elf_rawfile): Lock around elf-> references.
1322
13232008-10-21  Petr Machata  <pmachata@redhat.com>
1324
1325	* libelfP.h: Rename getehdr_rdlock to getehdr_wrlock.
1326	* elf32_getehdr.c (getehdr_rdlock): Move the code to new function
1327	getehdr_impl and make it a wrapper.  Rename to getehdr_wrlock.
1328	(getehdr_impl): Guard elf->class init with wrlock.
1329	(getehdr): Also make it a wrapper of getehdr_impl.
1330	* elf32_updatenull.c (updatenull_wrlock): Call getehdr_wrlock.
1331
13322008-10-20  Petr Machata  <pmachata@redhat.com>
1333
1334	* elf_getdata_rawchunk.c (elf_getdata_rawchunk): Lock around the
1335	code that reads mutable elf state.  Relock to write lock to chain
1336	the new chunk on the elf rawchunks list.
1337
13382008-10-20  Petr Machata  <pmachata@redhat.com>
1339
1340	* elf32_checksum.c (checksum): Place a lock around the code that
1341	processes data.  Make it wrlock if the code needs to xlate the
1342	data before processing.
1343
13442008-10-16  Petr Machata  <pmachata@redhat.com>
1345
1346	* elf_begin.c
1347	(__libelf_next_arhdr): Rename to __libelf_next_arhdr_wrlock.
1348	(dup_elf): Adjust the call.
1349	(elf_begin): New local function lock_dup_elf.  Relocks the elf if
1350	necessary before calling dup.  Call this instead of dup_elf.
1351	* elf_getarhdr.c
1352	(elf_getarhdr): Lock before calling __libelf_next_arhdr_wrlock.
1353	* elf_next.c (elf_next): Likewise.
1354	* elf_rand.c (elf_rand): Likewise.
1355
13562008-10-14  Petr Machata  <pmachata@redhat.com>
1357
1358	* elf_getdata.c (__elf_getdata_rdlock): Lock before converting.
1359
13602008-11-26  Roland McGrath  <roland@redhat.com>
1361
1362	* elf.h: Update from glibc.
1363
13642008-10-06  Roland McGrath  <roland@redhat.com>
1365
1366	* elf_getarhdr.c (elf_getarhdr): Return NULL when passed NULL.
1367
13682008-08-27  Roland McGrath  <roland@redhat.com>
1369
1370	* elf_begin.c (get_shnum): Avoid misaligned reads for matching endian.
1371
1372	* libelfP.h [!ALLOW_UNALIGNED] (__libelf_type_align): Fix CLASS index.
1373
13742008-08-25  Roland McGrath  <roland@redhat.com>
1375
1376	* Makefile.am (libelf_so_LDLIBS): New variable.
1377	(libelf.so): Use it in the link.
1378
13792008-08-21  Petr Machata  <pmachata@redhat.com>
1380
1381	* elf_getdata.c, libelfP.h
1382	(__elf_getdata_internal): Rename to __elf_getdata_rdlock.
1383	(__libelf_set_rawdata_wrlock): New function.
1384	(__libelf_set_rawdata): Make it a wrapper that calls *_wrlock.
1385	* elf32_updatenull.c, libelfP.h
1386	(__elfNN_updatenull): Rename to __elfNN_updatenull_wrlock.
1387
13882008-08-21  Petr Machata  <pmachata@redhat.com>
1389
1390	* elf32_getphdr.c, libelfP.h
1391	(__elfNN_getphdr_internal): Drop.  Move __elfNN_getphdr_internal
1392	code to __elfNN_getphdr_wrlock.
1393	(__elfNN_getphdr_rdlock, __elfNN_getphdr_wrlock): New functions.
1394	(__elfNN_getphdr_rdlock, __elfNN_getphdr_wrlock): Make these
1395	wrappers of getphdr_impl.
1396
13972008-08-21  Petr Machata  <pmachata@redhat.com>
1398
1399	* elf32_getehdr.c, libelfP.h
1400	(__elfNN_getehdr_internal): Rename to __elfNN_getehdr_rdlock.
1401	* gelf_getehdr, libelfP.h:
1402	(__gelf_getehdr_internal): Rename to __gelf_getehdr_rdlock.
1403
14042008-08-21  Petr Machata  <pmachata@redhat.com>
1405
1406	* elf32_getshdr.c
1407	(__elfNN_getshdr_internal): Drop.
1408	(load_shdr_wrlock, scn_valid): New functions, contain bits of
1409	behaviour from __elfNN_getshdr_internal.
1410	(__elfNN_getshdr_rdlock, __elfNN_getshdr_wrlock): Replacements for
1411	dropped _internal functions above.
1412	* elf_getshnum.c
1413	(__elf_getshnum_internal): Rename to __elf_getshnum_rdlock.
1414
14152008-08-04  Petr Machata  <pmachata@redhat.com>
1416
1417	* libelfP.h (RWLOCK_RDLOCK, RWLOCK_WRLOCK, RWLOCK_UNLOCK): New macros.
1418
14192008-07-28  Roland McGrath  <roland@redhat.com>
1420
1421	* elf.h: Update from glibc.
1422
14232008-03-31  Roland McGrath  <roland@redhat.com>
1424
1425	* elf32_offscn.c: Make sure shdrs have been read in.
1426
14272008-02-19  Roland McGrath  <roland@redhat.com>
1428
1429	* elf.h: Update from glibc.
1430
14312008-02-08  Roland McGrath  <roland@redhat.com>
1432
1433	* elf.h: Update from glibc.
1434
14352008-01-31  Ulrich Drepper  <drepper@redhat.com>
1436
1437	* elf_strptr.c (elf_strptr): Don't fail if the ELF file is currently
1438	under construction and no raw data can be read from disk.
1439
14402008-01-30  Roland McGrath  <roland@redhat.com>
1441
1442	* elf.h: Update from glibc.
1443
14442008-01-26  Roland McGrath  <roland@redhat.com>
1445
1446	* elf_begin.c (__libelf_next_arhdr): Rewrite conversions using a macro.
1447	Fixes various pastos in wrong type in sizeof, wrong string parsed.
1448
14492008-01-20  Roland McGrath  <roland@redhat.com>
1450
1451	* elf_getaroff.c: Calculate from start_offset, instead of using
1452	parent's state.ar.offset field.
1453
14542008-01-08  Roland McGrath  <roland@redhat.com>
1455
1456	* Makefile.am (euinclude): Variable removed.
1457	(pkginclude_HEADERS): Set this instead of euinclude_HEADERS.
1458
14592008-01-03  Roland McGrath  <roland@redhat.com>
1460
1461	* common.h: Add __attribute__ ((unused)) to static functions.
1462
14632007-12-20  Ulrich Drepper  <drepper@redhat.com>
1464
1465	* Makefile.am (libelf_a_SOURCES): Add elf_scnshndx.
1466	* libelfP.h (struct Elf_Scn): Add shndx_index field.
1467	Declare __elf_scnshndx_internal.
1468	* elf32_getshdr.c: Record location of extended section header.
1469	* elf_begin.c (file_read_elf): Likewise.
1470	* elf_scnshndx.c: New file.
1471	* libelf.h: Declare elf_scnshndx.
1472	* libelf.map: Add elf_scnshndx to version ELFUTILS_1.4.
1473
14742007-11-12  Roland McGrath  <roland@redhat.com>
1475
1476	* libelf.h: Replace off64_t with loff_t throughout.
1477	Only that type name is unconditionally defined by <sys/types.h>
1478
14792007-11-03  Roland McGrath  <roland@redhat.com>
1480
1481	* libelf.h (Elf_Data): Comment fix.
1482
14832007-10-18  Roland McGrath  <roland@redhat.com>
1484
1485	* elf.h: Update from glibc.
1486
14872007-10-07  Roland McGrath  <roland@redhat.com>
1488
1489	* elf_begin.c (__libelf_next_arhdr): Fix fencepost error and wrong
1490	member access in terminating name with no trailing /.  Trim trailing
1491	spaces when there is no /.
1492
14932007-10-04  Roland McGrath  <roland@redhat.com>
1494
1495	* elf_end.c (elf_end): Don't free ELF->state.ar.ar_sym when it's -1l.
1496
14972007-10-03  Roland McGrath  <roland@redhat.com>
1498
1499	* libelf.h (Elf_Data): Use off64_t for d_off.
1500	(Elf_Arhdr): Use off64_t for ar_size.
1501	(elf_update, elf_getbase, elf_getaroff): Return off64_t.
1502
1503	* gelf_rawchunk.c: File removed.
1504	* gelf_freechunk.c: File removed.
1505	* Makefile.am (libelf_a_SOURCES): Remove them.
1506	* libelf.map (ELFUTILS_1.0): Remove exports.
1507	* gelf.h: Remove decls.
1508
1509	* elf_getdata_rawchunk.c: New file.
1510	* Makefile.am (libelf_a_SOURCES): Add it.
1511	* libelf.map (ELFUTILS_1.3): Add elf_getdata_rawchunk.
1512	* libelf.h: Declare it.
1513	* libelfP.h (Elf_Data_Chunk): New type.
1514	(struct Elf.elf): New member `rawchunks'.
1515	* elf_end.c (elf_end): Free recorded rawchunk buffers.
1516
15172007-08-24  Roland McGrath  <roland@redhat.com>
1518
1519	* gelf_getnote.c: New file.
1520	* Makefile.am (libelf_a_SOURCES): Add it.
1521	* gelf.h: Declare gelf_getnote.
1522	* libelf.map (ELFUTILS_1.3): Add gelf_getnote.
1523
1524	* libelfP.h (NOTE_ALIGN): New macro.
1525	* note_xlate.h: New file.
1526	* Makefile.am (noinst_HEADERS): Add it.
1527	* gelf_xlate.c: Include it.
1528	(__elf_xfctstom): Use elf_cvt_note.
1529	* elf_getdata.c (shtype_map, __libelf_type_align): Handle SHT_NOTE.
1530	(__libelf_set_rawdata): Likewise.
1531
15322007-08-19  Roland McGrath  <roland@redhat.com>
1533
1534	* gelf_update_auxv.c: New file.
1535	* gelf_getauxv.c: New file.
1536	* Makefile.am (libelf_a_SOURCES): Add them.
1537	* gelf.h: Declare gelf_getauxv, gelf_update_auxv.
1538	* libelf.map (ELFUTILS_1.3): New set, inherits fom ELFUTILS_1.2.
1539	Export gelf_getauxv, gelf_update_auxv.
1540
1541	* libelf.h (Elf_Type): Add ELF_T_AUXV.
1542	* abstract.h: Add auxv_t entries.
1543	* exttypes.h: Likewise.
1544	* gelf_xlate.h: Likewise.
1545	* gelf_xlate.c (__elf_xfctstom): Add ELF_T_AUXV entries.
1546	* gelf_fsize.c (__libelf_type_sizes): Likewise.
1547
15482007-08-12  Roland McGrath  <roland@redhat.com>
1549
1550	* elf32_updatefile.c (compare_sections): Sort secondarily on sh_size,
1551	and only tertiarily on index.
1552
15532007-07-09  Roland McGrath  <roland@redhat.com>
1554
1555	* elf.h: Update from glibc.
1556
15572007-04-22  Roland McGrath  <roland@redhat.com>
1558
1559	* elf.h: Update from glibc.
1560
15612007-03-18  Roland McGrath  <roland@redhat.com>
1562
1563	* elf_begin.c (get_shnum): Fix test for e_shoff being out of bounds.
1564	Return zero when the section headers do not fit within MAXSIZE.
1565
15662007-03-09  Roland McGrath  <roland@redhat.com>
1567
1568	* libelfP.h (LIBELF_EV_IDX): New macro.
1569	(__libelf_type_align): New macro.
1570	[! ALLOW_UNALIGNED]: Declare __libc_type_aligns array.
1571	* elf_getdata.c (shtype_map): Convert to just Elf_Type[][].
1572	(convert_data, __libelf_set_rawdata): Use that, __libelf_type_align,
1573	and __libelf_type_sizes, in place of old table.
1574	(__libc_type_aligns): New const variable.
1575
15762007-02-04  Ulrich Drepper  <drepper@redhat.com>
1577
1578	* Makefile (libelf.so): Build with -z relro.
1579
1580	* elf_begin.c (read_file): When using ELF_C_READ_MMAP use MAP_PRIVATE.
1581
15822007-01-30  Ulrich Drepper  <drepper@redhat.com>
1583
1584	* nlist.c: Close file descriptor before returning.
1585
15862007-01-20  Roland McGrath  <roland@redhat.com>
1587
1588	* gnuhash_xlate.h (elf_cvt_gnuhash): Fix fence-post error so we
1589	convert the final word.
1590
1591	* elf32_getshdr.c: Don't byteswap shdr fields when EI_DATA matches
1592	MY_ELFDATA on !ALLOW_UNALIGNED machines.
1593
15942007-01-18  Roland McGrath  <roland@redhat.com>
1595
1596	* gelf_rawchunk.c (gelf_rawchunk): Clear RESULT pointer after freeing
1597	it on read error.
1598
15992006-10-13  Roland McGrath  <roland@redhat.com>
1600
1601	* elf32_updatenull.c: Look for and accept phdr also for ET_CORE.
1602	* elf_error.c (msgstr): Change ELF_E_INVALID_PHDR string.
1603
16042006-08-29  Roland McGrath  <roland@redhat.com>
1605
1606	* elf32_getphdr.c: Don't byteswap phdr fields when EI_DATA matches
1607	MY_ELFDATA on !ALLOW_UNALIGNED machines.
1608	Reported by Christian Aichinger <Greek0@gmx.net>.
1609
1610	* Makefile.am (CLEANFILES): Add libelf.so.$(VERSION).
1611
16122006-08-08  Ulrich Drepper  <drepper@redhat.com>
1613
1614	* elf.h (DT_VALNUM): Update.
1615	(DT_ADDRNUM): Likewise.
1616
16172006-07-12  Ulrich Drepper  <drepper@redhat.com>
1618
1619	* elf32_updatefile.c: Adjust for internal_function_def removal.
1620	* elf32_updatenull.c: Likewise.
1621	* elf_begin.c: Likewise.
1622	* elf_getdata.c: Likewise.
1623
16242006-07-11  Ulrich Drepper  <drepper@redhat.com>
1625
1626	* libelf.h: Define ELF_T_GNUHASH.
1627	* elf_getdata.c (TYPEIDX): Handle SHT_GNU_HASH.
1628	(shtype_map): Add SHT_GNU_HASH entries.
1629	* gelf_xlate.c (__elf_xfctstom): Add ELF_T_GNUHASH entries.
1630	* gnuhash_xlate.h: New file.
1631	* Makefile.am (noinst_HEADERS): Add gnuhash_xlate.h.
1632
16332006-07-06  Ulrich Drepper  <drepper@redhat.com>
1634
1635	* elf_gnu_hash.c: New file.
1636	* libelf.h: Declare elf_gnu_hash.
1637	* Makefile.am (libelf_a_SOURCES): Add elf_gnu_hash.
1638	* libelf.map: Add elf_gnu_map for version ELFUTILS_1.2.
1639
16402006-06-15  Roland McGrath  <roland@redhat.com>
1641
1642	* libelf.h (elf_getarsym): Fix comment typo.
1643	Rename second parameter to be more explanatory.
1644	(elf_getident, elf_rawhide): Likewise.
1645
16462006-05-28  Ulrich Drepper  <drepper@redhat.com>
1647
1648	* elf32_updatefile.c (updatemmap): Preserve section content if
1649	copying would overwrite them.
1650	Fix msync paramters.
1651
16522006-04-04  Roland McGrath  <roland@redhat.com>
1653
1654	* elf32_updatefile.c (updatemmap): Handle other-endian case.
1655
16562006-04-04  Ulrich Drepper  <drepper@redhat.com>
1657
1658	* elf32_updatefile.c (updatemmap): Cleanups.  Remove shdr_dest
1659	variable.  Before writing sections, make a copy of the section
1660	header data if necessary.  Don't write section header while
1661	writing the section constent, it might overwrite some sections.
1662	Restore the pointer afterwards.
1663	* elf32_updatenull.c (updatenull): If the offset of a section in a
1664	file changed make sure we read the section so that it'll be written
1665	out.
1666
1667	* elf_update.c: Remove debug message.
1668
16692005-12-07  Roland McGrath  <roland@redhat.com>
1670
1671	* gelf_xlate.c [! ALLOW_UNALIGNED] (union unaligned): New type.
1672	(FETCH, STORE): New macros.
1673	(INLINE3): Use those to do alignment-friendly conversion.
1674
1675	* elf32_getshdr.c: Include map_address and start_offset in alignment
1676	calculations.
1677	* elf32_getphdr.c: Likewise.
1678
16792005-11-19  Roland McGrath  <roland@redhat.com>
1680
1681	* elf.h: Update from glibc.
1682
16832005-11-17  Roland McGrath  <roland@redhat.com>
1684
1685	* elf.h: Update from glibc.
1686
16872005-11-10  Roland McGrath  <roland@redhat.com>
1688
1689	* elf.h: Update from glibc.
1690
16912005-09-09  Roland McGrath  <roland@redhat.com>
1692
1693	* elf_update.c (write_file): Stat the file and fchmod it after update
1694	if its mode had S_ISUID or S_ISGID bits set.
1695
16962005-08-28  Ulrich Drepper  <drepper@redhat.com>
1697
1698	* elf32_getphdr.c: Include <system.h>.  Use pread_retry instead of
1699	pread.  And branch prediction where useful.
1700	* elf_begin.c: Likewise.
1701	* elf_getdata.c: Likewise.
1702	* elf_getshstrndx.c: Likewise.
1703	* elf_readall.c: Likewise.
1704	* gelf_rawchunk.c: Likewise.
1705	* elf32_updatefile.c: Include <system.h>.  Use pread_retry instead of
1706	pread.  And branch prediction where useful.
1707	* elf_getarsym.c: Don't define pread_retry here.
1708
1709	* Makefile.am: Use $(LINK) not $(CC) when creating DSO.
1710	(%.os): Use COMPILE.os.
1711	(COMPILE.os): Filter out gconv options.
1712
17132005-08-27  Ulrich Drepper  <drepper@redhat.com>
1714
1715	* elf_begin.c (file_read_elf): Avoid reading ELF header from file
1716	again.  Instead accept additional parameter which points to it if we
1717	don't use mmap.
1718	(get_shnum): Use passed in e_ident value as source of ELF header.
1719
17202005-08-15  Ulrich Drepper  <drepper@redhat.com>
1721
1722	* elf_begin.c (__libelf_next_arhdr): Use TEMP_FAILURE_RETRY.
1723
1724	* Makefile (libelf_a_SOURCES): Add elf_getaroff.c.
1725	* libelf.map: Export elf_getaroff.
1726	* libelf.h: Declare elf_getaroff.
1727	* elf_getaroff.c: New file.
1728
17292005-08-13  Ulrich Drepper  <drepper@redhat.com>
1730
1731	* elf_begin.c (get_shnum): Optimize memory handling.  Always read from
1732	mapped file if available.  Fix access to 64-bit sh_size.  Recognize
1733	overflow.
1734	(file_read_elf): Likewise.
1735
17362005-08-12  Roland McGrath  <roland@redhat.com>
1737
1738	* elf32_offscn.c: Do not match empty sections at OFFSET unless
1739	there are no nonempty sections at that offset.
1740
17412005-08-07  Ulrich Drepper  <drepper@redhat.com>
1742
1743	* elf.h: Update from glibc.
1744
17452005-08-06  Ulrich Drepper  <drepper@redhat.com>
1746
1747	* Makefile.am (AM_CFLAGS): Add -fpic when BUILD_STATIC.
1748
17492005-08-03  Ulrich Drepper  <drepper@redhat.com>
1750
1751	* libelf.map: Move elf32_offscn, elf64_offscn, and gelf_offscn in
1752	new version ELFUTILS_1.1.1.
1753
17542005-08-02  Ulrich Drepper  <drepper@redhat.com>
1755
1756	* elf_error.c: Add handling of ELF_E_INVALID_OFFSET.
1757	* elf32_offscn.c: New file.
1758	* elf64_offscn.c: New file.
1759	* gelf_offscn.c: New file.
1760	* Makefile.am (libelf_a_SOURCES): Add elf32_offscn.c, elf64_offscn.c,
1761	and gelf_offscn.c.
1762	* libelf.sym: Export new symbols.
1763
17642005-07-23  Ulrich Drepper  <drepper@redhat.com>
1765
1766	* elf-knowledge.h (SECTION_STRIP_P): Don't handle removal of debug
1767	sections here anymore.
1768	* elf32_checksum.c: Adjust for change in SECTION_STRIP_P interface.
1769
1770	* elf_update.c (elf_update): Get write lock, not read lock.
1771
1772	* elf32_updatenull.c (updatenull): Get section headers if necessary
1773	and possible.
1774
17752005-07-22  Ulrich Drepper  <drepper@redhat.com>
1776
1777	* elf32_updatenull.c (updatenull): If program header hasn't been loaded
1778	yet, try to do it now.
1779	Don't unnecessarily update overflow of section count in zeroth section
1780	sh_size field.
1781	If section content hasn't been read yet, do it before looking for the
1782	block size.  If no section data present, infer size of section header.
1783
17842005-05-11  Ulrich Drepper  <drepper@redhat.com>
1785
1786	* elf.h: Update again.
1787
17882005-05-09  Ulrich Drepper  <drepper@redhat.com>
1789
1790	* elf.h: Update from glibc.
1791
17922005-05-08  Roland McGrath  <roland@redhat.com>
1793
1794	* elf_begin.c (read_file) [_MUDFLAP]: Don't use mmap for now.
1795	* elf_update.c (write_file) [_MUDFLAP]: Likewise.
1796
17972005-03-29  Ulrich Drepper  <drepper@redhat.com>
1798
1799	* elf32_checksum.c: Use INTUSE and INTDEF to avoid PLTs.
1800	* elf_end.c: Likewise.
1801	* elf_getdata.c: Likewise.
1802	* gelf_getehdr.c: Likewise.
1803	* nlist.c: Likewise.
1804	* libelfP.h: Add declarations of internal functions.
1805
18062005-02-15  Ulrich Drepper  <drepper@redhat.com>
1807
1808	* common.h (CONVERT): Make sure all values are unsigned.
1809	(CONVERT_TO): Likewise.
1810
1811	* Makefile.am (AM_CFLAGS): Add -Wformat=2.
1812	Fix rule to build libelf.so.
1813
18142005-02-06  Ulrich Drepper  <drepper@redhat.com>
1815
1816	* Makefile.am: Cleanup AM_CFLAGS handling.  Add -Wunused -Wextra.
1817	Remove lint handling.
1818	* elf32_getphdr.c: Minor cleanups.
1819	* elf32_getshdr.c: Likewise.
1820	* elf32_updatefile.c: Likewise.
1821	* elf32_updatenull.c: Likewise.
1822	* elf_begin.c: Likewise.
1823	* elf_error.c: Likewise.
1824	* elf_getarsym.c: Likewise.
1825	* elf_getdata.c: Likewise.
1826	* elf_update.c: Likewise.
1827	* gelf_xlate.c: Likewise.
1828
18292005-02-05  Ulrich Drepper  <drepper@redhat.com>
1830
1831	* Makefile.am: Check for text relocations in constructed DSO.
1832
1833	* Makefile.am [MUDFLAP] (AM_CFLAGS): Add -Werror -fpic -fmudflap.
1834
18352005-02-04  Ulrich Drepper  <drepper@redhat.com>
1836
1837	* gelf_getehdr.c (gelf_getehdr): Slight optimization.
1838
1839	* elf32_checksum.c (checksum): Do not look at NOBITS sections.
1840
1841	* gelf.h: Add gelf_checksum prototype.
1842
18432004-09-25  Ulrich Drepper  <drepper@redhat.com>
1844
1845	* elf32_checksum.c: Make compile with gcc 4.0.
1846	* elf32_updatefile.c: Likewise.
1847	* elf32_updatenull.c: Likewise.
1848	* elf_begin.c: Likewise.
1849	* elf_error.c: Likewise.
1850	* elf_getdata.c: Likewise.
1851	* elf_getident.c: Likewise.
1852
18532004-04-01  Ulrich Drepper  <drepper@redhat.com>
1854
1855	* elf.h: Update from glibc.
1856
18572004-01-23  Ulrich Drepper  <drepper@redhat.com>
1858
1859	* elf_update.c: Fix locking.
1860	* elf_clone.c: Likewise.
1861
1862	* libelf.h: Define ELF_T_LIB.
1863	* gelf_getlib.c: New file.
1864	* gelf_update_lib.c: New file.
1865	* gelf.h: Declare the new functions.  Define GElf_Lib.
1866	* abstract.h: Define Lib, Lib32, Lib64.
1867	* gelf_xlate.c (__elf_xfctstom): Add ELF_T_LIB entry.
1868	* gelf_xlate.h: Add entry for ElfXX_Lib.
1869	* elf_getdata.c: Recognize SHT_GNU_LIBLIST as a known section type.
1870	* libelf.map: Add new symbols to ELFUTILS_1.1.
1871	* Makefile.am (libelf_a_SOURCES): Add gelf_getlib.c and
1872	gelf_update_lib.c.
1873
18742004-01-17  Ulrich Drepper  <drepper@redhat.com>
1875
1876	* Makefile.am: Support building with mudflap.
1877
1878	* gelf_xlate.c (INLINE3): Avoid using cast as lvalue.
1879	* dl-hash.h (_dl_elf_hash): Likewise.
1880
18812004-01-05  Ulrich Drepper  <drepper@redhat.com>
1882
1883	* elf-knowledge.h: New file.  From libelf subdir.
1884	* Makefile.am (euincludedir): Define.
1885	(euinclude_HEADERS): Add elf-knowledge.h.
1886
18872003-09-24  Ulrich Drepper  <drepper@redhat.com>
1888
1889	* elf.h: Define some PT_IA_64_HP_* constants.
1890
18912003-09-23  Jakub Jelinek  <jakub@redhat.com>
1892
1893	* libelfP.h (struct Elf): Move state.elf64.sizestr_offset after
1894	state.elf64.scnincr to match state.elf{,32}.
1895
18962003-08-12  Ulrich Drepper  <drepper@redhat.com>
1897
1898	* elf32_updatefile.c (__updatemmap): When writing back file where
1899	some sections have not been read in, count their sizes based on
1900	the section header.
1901
19022003-08-11  Ulrich Drepper  <drepper@redhat.com>
1903
1904	* Moved to CVS archive.
1905