• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
12020-12-12  Mark Wielaard  <mark@klomp.org>
2
3	* elf.h: Update from glibc.
4
52020-12-16  Dmitry V. Levin  <ldv@altlinux.org>
6
7	* libelfP.h (_): Remove.
8
92020-12-15  Mark Wielaard  <mark@klomp.org>
10
11	* elf_begin.c (get_shnum): Make sure the full Ehdr is available.
12
132020-12-12  Dmitry V. Levin  <ldv@altlinux.org>
14
15	* common.h: Fix spelling typo in comment.
16	* gelf.h: Likewise.
17	* libelf.h: Likewise.
18	* libelfP.h: Likewise.
19	* elf32_checksum.c (elfw2): Likewise.
20	* elf_begin.c (dup_elf, write_file): Likewise.
21	* elf_compress.c (__libelf_compress): Likewise.
22	* elf_compress_gnu.c (elf_compress_gnu): Likewise.
23
242020-12-11  Dmitry V. Levin  <ldv@altlinux.org>
25
26	* Makefile.am (GCC_INCLUDE): Remove.
27
282020-12-09  Dmitry V. Levin  <ldv@altlinux.org>
29
30	* Makefile.am (noinst_PROGRAMS): Rename to noinst_DATA.
31	(libelf_so_SOURCES): Remove.
32	(CLEANFILES): Add libelf.so.
33
342020-11-30  Dmitry V. Levin  <ldv@altlinux.org>
35
36	* Makefile.am (libelf.so$(EXEEXT)): Drop $(EXEEXT) suffix.
37
382020-11-06  Mark Wielaard  <mark@klomp.org>
39
40	* elf-knowledge.h (SH_ENTSIZE_HASH): Update comment.
41
422020-11-01  Mark Wielaard  <mark@klomp.org>
43
44	* elf_strptr.c (elf_strptr): Check shdr is not NULL.
45
462020-11-01  Mark Wielaard  <mark@klomp.org>
47
48	* elf_getphdrnum.c (__elf_getphdrnum_rdlock): Set *dst to zero on
49	error.
50
512020-11-01  Mark Wielaard  <mark@klomp.org>
52
53	* libelfP.h (__libelf_data_type): Take an GElf_Ehdr instead of an
54	Elf handle.
55	* elf_getdata.c (__libelf_data_type): Likewise. And check ehdr
56	directly instead of fetching a new one.
57	(__libelf_set_rawdata_wrlock): Fetch Ehdr, report an error when that
58	fails, otherwise call __libelf_data_type.
59
602020-10-28  Mark Wielaard  <mark@klomp.org>
61
62	* elf.h: Update from glibc.
63
642020-08-28  Mark Wielaard  <mark@klomp.org>
65
66	* elf.h: Update from glibc.
67
682020-08-19  Mark Wielaard  <mark@klomp.org>
69
70	* elf32_updatenull.c (updatenull_wrlock): Fixup the sh_addralign
71	of an SHF_COMPRESSED section if necessary.
72
732020-06-04  Mark Wielaard  <mark@klomp.org>
74
75	* elf.h: Update from glibc.
76
772020-05-08  Mark Wielaard  <mark@klomp.org>
78
79	* elf_strptr.c (elf_strptr): Check shdr is not NULL.
80
812020-05-08  Mark Wielaard  <mark@klomp.org>
82
83	* elf_getdata.c (__libelf_set_rawdata_wrlock): Check
84	__gelf_getehdr_rdlock return value.
85
862020-04-25  Mark Wielaard  <mark@klomp.org>
87
88	* elf_compress.c (__libelf_compress): Remove free (out_buf).
89
902020-03-18  Omar Sandoval  <osandov@fb.com>
91
92	* elf_getphdrnum.c (__elf_getphdrnum_rdlock): Call
93	__elf{32,64}_getshdr_rdlock if the shdr is not cached.
94
952019-03-20  Matthias Maennich  <maennich@google.com>
96
97	* elf_compress.c (__libelf_compress): Always call deflate_cleanup
98	in failure path. Call deflateEnd only once.
99	(__libelf_decompress): Call inflateEnd only once.
100
1012019-06-18  Mark Wielaard  <mark@klomp.org>
102
103	* common.h (allocate_elf): Use int64_t instead of off_t for offset.
104	* elf32_newphdr.c (newphdr): Document why Elf32/64_Word is correct.
105	* elf32_updatefile.c (fill): Use int64_t instead of off_t for pos.
106	(updatefile): Define last_offset, shdr_offset and scn_start as
107	int64_t instead of off_t.
108	* elf32_updatenull.c: Define Elf32_SizeWord and Elf64_SizeWord.
109	(updatenull_wrlock): Return int64_t instead of off_t. Define size,
110	sh_entsize, sh_align and sh_size as SizeWords. Define offset as
111	int64_t.  Cast data->d_off to SizeWord instead of GElf_Word. Drop
112	size GElf_Word cast. Cast offset to SizeWord instead of GElf_Word
113	when comparing with sh_size.
114	* elf_begin.c (get_shnum): Define offset as int64_t instead of
115	off_t. Document why use GElf_Word is correct.
116	(file_read_elf): Define offset as int64_t instead of off_t.
117	(__libelf_read_mmaped_file): Likewise.
118	(read_unmmaped_file): Likewise.
119	(read_file): Likewise.
120	* elf_getaroff.c (elf_getaroff): Return int64_t.
121	* elf_getbase.c (elf_getbase): Likewise.
122	* elf_getdata_rawchunk.c (elf_getdata_rawchunk): Define offset as
123	int64_t instead of off_t.
124	* elf_update.c (write_file): Return int64_t instead of off_t,
125	define size as int64_t instead of off_t.
126	(elf_update): Likewise.
127	* libelfP.h (struct Elf): Define start_offset, sizestr_offset and
128	offset as int64_t.
129	(__libelf_read_mmaped_file): Define offset as int64_t.
130	(__elf32_updatenull_wrlock): Return int64_t.
131	(__elf64_updatenull_wrlock): Return int64_t.
132
1332019-05-12  Mark Wielaard  <mark@klomp.org>
134
135	* elf32_updatenull.c (updatenull_wrlock): Mark shdr_flags dirty if
136	either offset or size changed.
137
1382019-05-01  Mark Wielaard  <mark@klomp.org>
139
140	* gelf_getnote.c (gelf_getnote): Check n_namesz doesn't overflow
141	offset.
142
1432019-04-30  Mark Wielaard  <mark@klomp.org>
144
145	* note_xlate.h (elf_cvt_note): Indicate we only translated the note
146	header if we ran out of data by updating len, src and dest.
147
1482019-04-01  Mao Han  <han_mao@c-sky.com>
149
150	* elf.h: Update from glibc.
151
1522019-03-07  Mark Wielaard  <mark@klomp.org>
153
154	* elf32_updatefile.c (updatemmap): Use posix_memalign instead of
155	aligned_alloc.
156
1572019-03-06  Mark Wielaard  <mark@klomp.org>
158
159	* elf32_updatefile.c (updatemmap): Free scns before returning
160	allocation failure.
161
1622019-02-24  Mark Wielaard  <mark@klomp.org>
163
164	* gelf_xlate.c (__elf_xfctstof): Remove alias.
165	* libelfP.h (__elf_xfctstof): Remove definition.
166
1672019-02-24  Mark Wielaard  <mark@klomp.org>
168
169	* elf32_fsize.c (local_strong_alias): Remove definition.
170	(msize): Remove alias.
171	* libelfP.h (__elf32_msize): Remove definition.
172	(__elf64_msize): Likewise.
173
1742019-02-21  Mark Wielaard  <mark@klomp.org>
175
176	* common.h (determine_kind): Only accept EV_CURRENT.
177	* elf32_fsize.c (fsize): Just check version is EV_CURRENT.
178	Use __libelf_type_size without version dimension.
179	* elf32_updatefile.c (updatemmap): Define fctp from __elf_xfctstom
180	without version dimension.
181	(updatefile): Likewise.
182	* elf32_updatenull.c (default_ehdr): Check e_version is EV_CURRENT.
183	(updatenull_wrlock): Check d_version is EV_CURRENT.
184	(elf32_xlatetof): Likewise. And get recsize without version
185	dimension from __elf_xfctstom.
186	(elf32_xlatetom): Likewise.
187	* elf_begin.c (elf_begin): Check __libelf_version is EV_CURRENT.
188	* elf_compress.c (__libelf_reset_rawdata): Set d_version to
189	EV_CURRENT.
190	* elf_getdata.c (shtype_map): Remove version dimension.
191	(__libelf_type_aligns): Likewise.
192	(__libelf_data_type): Use shtype_map without version dimension.
193	(convert_data): Remove unused version argument. Get fp from
194	__elf_xfctstom without version dimensions.
195	(__libelf_set_data_list_rdlock): Call convert_data without version.
196	* elf_getdata_rawchunk.c (elf_getdata_rawchunk): Call __elfcfctstom
197	conversion function without version dimensions. Set d_version to
198	EV_CURRENT.
199	* elf_newdata.c (elf_newdata): Set d_version to EV_CURRENT.
200	* elf_version.c (__libelf_version_initialized): Removed.
201	(__libelf_version): Initialized to EV_NONE.
202	(elf_version): Always return EV_CURRENT for EV_NONE version.
203	Only accept (and return) EV_CURRENT as version.
204	* gelf_fsize.c (__libelf_type_sizes): Remove version dimension.
205	(gelf_fsize): Only accept EV_CURRENT as version.
206	Use __libelf_type_sizes without version dimension.
207	* gelf_xlate.c (__elf_xftstom): Remove version dimensions.
208	* libelfP.h (__elf_xfctstom): Defined without version dimensions.
209	(__elf_xfctstof): Likewise.
210	(__libelf_type_sizes): Define without version dimension.
211	(elf_typesize): Define using __libelf_type_sizes without version
212	dimension.
213	(__libelf_version_initialized): Remove definition.
214	(__libelf_version): Add definition.
215	(LIBELF_EV_IDX): Removed define.
216	(__libelf_type_aligns): Remove version dimension.
217	* nlist.c (nlist): Call elf_version unconditionally.
218
2192019-02-19  Mark Wielaard  <mark@klomp.org>
220
221	* elf_compress.c (do_deflate_cleanup): Remove ei_data argument,
222	check cdatap is not NULL before calling free.
223	(deflate_cleanup): Add cdata as argument.
224	(__libelf_compress): Also check whether the d_size is not zero
225	before converting data. Call deflate_cleanup with an extra
226	argument depending on whether there is converted data to free.
227	Always allocate allocate at least one byte for buf_out.
228
2292019-02-14  Mark Wielaard  <mark@klomp.org>
230
231	* elf_begin.c (read_long_names): Make sure ar_size is properly
232	terminated. Sanity check len early if we can.
233
2342019-01-18  Mark Wielaard  <mark@klomp.org>
235
236	* Makefile.am (INSTALL_ELFH): Add elf.h to include_HEADERS when
237	defined, otherwise (the default) add elf.h to noinst_HEADERS.
238
2392019-01-16  Mark Wielaard  <mark@klomp.org>
240
241	* note_xlate.h (elf_cvt_note): Check n_namesz and n_descsz don't
242	overflow note_len into note header.
243
2442018-11-17  Mark Wielaard  <mark@klomp.org>
245
246	* elf32_updatefile.c (updatemmap): Make sure to call convert
247	function on a properly aligned destination.
248
2492018-11-16  Mark Wielaard  <mark@klomp.org>
250
251	* libebl.h (__elf32_msize): Mark with const attribute.
252	(__elf64_msize): Likewise.
253
2542018-11-13  Mark Wielaard  <mark@klomp.org>
255
256	* elf_getdata.c (__libelf_set_rawdata_wrlock): Explicitly set the
257	alignment of SHF_COMPRESSED data to the alignment of ELF_T_CHDR.
258	* elf_compress.c (elf_compress): After compression set sh_addralign
259	to the alignment of ELF_T_CHDR.
260
2612018-11-09  Mark Wielaard  <mark@klomp.org>
262
263	* elf_compress_gnu.c (elf_compress_gnu): Use elf_getdata.
264
2652018-11-12  Mark Wielaard  <mark@klomp.org>
266
267	* elf-knowledge.c (ELF_NOTE_GNU_BUILD_ATTRIBUTE_PREFIX): New define.
268	(NT_GNU_BUILD_ATTRIBUTE_{OPEN,FUNC}): Likewise.
269	(GNU_BUILD_ATTRIBUTE_TYPE_{NUMERIC,STRING,BOOL_TRUE,BOOL_FALSE}):
270	Likewise.
271	(GNU_BUILD_ATTRIBUTE_{VERSION,STACK_PROT,RELRO,STACK_SIZE,TOOL,ABI,
272	PIC,SHORT_ENUM}): Likewise.
273
2742018-11-09  Mark Wielaard  <mark@klomp.org>
275
276	* elf_compress.c (__libelf_reset_rawdata): Make rawdata change
277	explicit by calling __libelf_set_data_list.
278	* elf_getdata.c (convert_data): Don't convert if type is ELF_T_BYTE
279	even if endianness is different.
280
2812018-10-18  Mark Wielaard  <mark@klomp.org>
282
283	* libelf.h (Elf_Type): Add ELF_T_NHDR8.
284	* libelfP.h (__libelf_data_type): Add align argument.
285	(NOTE_ALIGN): Split into...
286	(NOTE_ALIGN4): ... and ...
287	(NOTE_ALIGN8): this.
288	* elf32_xlatetom.c (xlatetom): Recognize both ELF_T_NHDR and
289	ELF_T_NHDR8.
290	* elf_compress.c (elf_compress): Pass zdata_align to
291	__libelf_data_type.
292	* elf_compress_gnu.c (elf_compress_gnu): Pass sh_addralign to
293	__libelf_data_type.
294	* elf_getdata.c (shtype_map): Add ELF_T_NHDR8.
295	(__libelf_data_type): Take align as extra argument, use it to
296	determine Elf_Type.
297	(__libelf_set_rawdata_wrlock): Recognize ELF_T_NHDR8. Pass align to
298	__libelf_data_type.
299	* gelf_fsize.c (__libelf_type_sizes): Add ELF_T_NHDR8.
300	* gelf_getnote.c (gelf_getnote): Use Elf_Type of Elf_Data to calculate
301	padding.
302	* gelf_xlate.c (__elf_xfctstom): Set ELF_T_NHDR to elf_cvt_note4,
303	add ELF_T_NHDR8.
304	* note_xlate.h (elf_cvt_note): Take nhdr8 argument and use it to
305	determine padding.
306	(elf_cvt_note4): New function.
307	(elf_cvt_note8): Likewise.
308
3092018-09-13  Mark Wielaard  <mark@klomp.org>
310
311	* elf32_updatefile.c (updatemmap): Use shnum, not ehdr->e_shnum.
312	* elf_getscn.c (elf_getscn): Create section zero if it is requested,
313	but doesn't exist yet.
314
3152018-09-12  Mark Wielaard  <mark@klomp.org>
316
317	* elf32_updatefile.c (updatemmap): Use memmove, not memcpy.
318	* elf_update.c (write_file): Try to mremap if file needs to be
319	extended.
320
3212018-08-18  Mark Wielaard  <mark@klomp.org>
322
323	* libelf.h (elf_compress_gnu): Add documentation about
324	interaction between SHF_COMPRESED and elf_compress_gnu.
325	* elf_compress_gnu.c (elf_compress_gnu): Return error if section
326	sh_flags has SHF_COMPRESSED set.
327
3282018-07-27  Mark Wielaard  <mark@klomp.org>
329
330	* libelf.h (elf_getshdrstrndx): Fix documentation.
331	(elf_getshstrndx): Likewise.
332
3332018-06-19  Mark Wielaard  <mark@klomp.org>
334
335	* libelfP.h (__libelf_type_align): Remove !ALLOW_UNALIGNED guard.
336	* elf_getdata.c (__libelf_type_aligns): Likewise.
337	(convert_data): Remove ALLOW_UNALIGNED check.
338	* elf_getdata_rawchunk.c (elf_getdata_rawchunk): Likewise.
339
3402018-06-21  Mark Wielaard  <mark@klomp.org>
341
342	* elf.h: Update from glibc.
343
3442018-04-19  Andreas Schwab  <schwab@suse.de>
345
346	* elf.h: Update from glibc.
347
3482018-02-16  Mark Wielaard  <mark@klomp.org>
349
350	* elf.h: Update from glibc.
351
3522018-02-09  Joshua Watt  <JPEWhacker@gmail.com>
353
354	* elf32_updatenull.c (updatenull_wrlock): Use FALLTHROUGH macro
355	instead of comment.
356	* elf_begin.c (read_unmmaped_file): Likewise.
357	(elf_begin): Likewise.
358	* elf_cntl.c (elf_cntl): Likewise.
359
3602017-10-04  Mark Wielaard  <mark@klomp.org>
361
362	* elf_begin.c (file_read_elf): Skip sanity checking e_shoff if scncnt
363	is zero, we won't use it then.
364
3652017-10-04  Mark Wielaard  <mark@klomp.org>
366
367	* libelfP.h: Add ELF_E_INVALID_ELF to error values enum.
368	* elf_error.c (ELF_E_INVALID_ELF_IDX): New define. Use it as value
369	for ELF_E_INVALID_ELF in msgidx.
370	* elf_getshdrstrndx.c (elf_getshdrstrndx): Distinquish between pread
371	failing and not having enough data.
372	* elf_begin.c (get_shnum): Likewise. Explicitly set libelf errno on
373	too large value.
374	(file_read_elf): Make sure to always set libelf errno when returning
375	NULL. Distinquish between i/o file and elf data errors.
376
3772017-08-18  Ulf Hermann  <ulf.hermann@qt.io>
378
379	* gelf_xlate.c: Use attribute_packed.
380
3812017-04-27  Ulf Hermann  <ulf.hermann@qt.io>
382
383	* libelfP.h: Use attribute_hidden.
384
3852017-04-27  Ulf Hermann  <ulf.hermann@qt.io>
386
387	* Makefile.am: Use fpic_CFLAGS and dso_LDFLAGS.
388
3892017-08-15  Mark Wielaard  <mark@klomp.org>
390
391	* elf.h: Update from glibc. Add new powerpc note descriptors.
392
3932017-07-19  Gustavo Romero <gromero@linux.vnet.ibm.com>
394
395	* elf.h: Add known type in notes segment descriptor for HTM SPRs.
396
3972017-02-17  Ulf hermann  <ulf.hermann@qt.io>
398
399	* Makefile.am: Add libelf_so_DEPS, which include libeu.a,
400	libelf_so_LIBS.
401	(libelf_so_LDLIBS): Add $(libelf_so_DEPS).
402	(libelf.so$(EXEEXT): Use $(libelf_so_LIBS), require libelf.map
403	from the right directory.
404
4052017-04-20  Ulf Hermann  <ulf.hermann@qt.io>
406
407	* libelfP.h: Don't include config.h.
408
4092017-04-20  Ulf Hermann  <ulf.hermann@qt.io>
410
411	* elf_begin.c: Use F_GETFD rather than F_GETFL.
412
4132017-04-20  Ulf Hermann  <ulf.hermann@qt.io>
414
415	* libelf.h: Define macros for various function attributes and use
416	them.
417
4182017-04-20  Ulf Hermann  <ulf.hermann@qt.io>
419
420	* elf_update.c: Set ELF_F_MMAPPED flag if we mmap from elf_update.
421
4222017-04-19  Mark Wielaard  <mark@klomp.org>
423
424	* elf_getarsym.c (elf_getarsym): Initialize n to zero.
425
4262017-03-27  Mark Wielaard  <mark@klomp.org>
427
428	* elf32_updatefile.c (updatemmap): Always update last_positition.
429	(updatefile): Likewise.
430
4312017-03-24  Mark Wielaard  <mark@klomp.org>
432
433	* elf_compress.c (__libelf_decompress): Check insane compression
434	ratios before trying to allocate output buffer.
435
4362016-10-11  Akihiko Odaki  <akihiko.odaki.4i@stu.hosei.ac.jp>
437	    Mark Wielaard  <mjw@redhat.com>
438
439	* gelf.h (gelf_newehdr): Change return type to void *.
440	(gelf_newphdr): Likewise.
441	* gelf_newehdr.c (gelf_newehdr): Likewise.
442	* gelf_newphdr.c (gelf_newphdr): Likewise.
443
4442016-10-21  Mark Wielaard  <mjw@redhat.com>
445
446	* elf_getdata.c (__libelf_set_rawdata_wrlock): Sanity check
447	offset and size before trying to malloc and read data.
448
4492016-10-26  Mark Wielaard  <mjw@redhat.com>
450
451	* elf_begin.c (read_file): Always set maxsize when parent == NULL.
452
4532016-10-11  Akihiko Odaki  <akihiko.odaki.4i@stu.hosei.ac.jp>
454
455	* elf_getarsym.c (elf_getarsym): Open code rawmemchr when not
456	available.
457	* elf_strptr.c: Include stdbool.h.
458	(validate_str): New function.
459	(elf_strptr): Use validate_str instead of memrchr.
460
4612016-10-11  Akihiko Odaki  <akihiko.odaki.4i@stu.hosei.ac.jp>
462
463	* elf32_updatefile.c: Remove sys/param.h include.
464	* elf32_updatenull.c: Likewise. Add system.h include.
465	* elf_begin.c: Remove sys/param.h.
466	* elf_compress: Likewise. Add system.h include.
467	(MAX): Remove definition.
468
4692016-08-07  Mark Wielaard  <mjw@redhat.com>
470
471	* elf_compress.c (__libelf_reset_rawdata): Check scn->flags and
472	free rawdata_base when malloced. Set ELF_F_MALLOCED for scn->flags.
473	* elf_end.c (elf_end): Check scn->flags and free rawdata_base if
474	malloced.
475	* libelfP.h (struct Elf_Scn): Document flags ELF_F_MALLOCED usage.
476
4772016-07-06  Mark Wielaard  <mjw@redhat.com>
478
479	* elf-knowledge.h (SH_FLAGS_COMBINE): Removed.
480	(SH_FLAGS_IMPORTANT): Likewise.
481
4822016-07-06  Mark Wielaard  <mjw@redhat.com>
483
484	* elf32_updatenull.c (updatenull_wrlock): Ignore e_type when
485	updating phdrs.
486	* elf_getphdrnum.c (__elf_getphdrnum_chk_rdlock): Only do sanity
487	checking if phdrs haven't been read in yet.
488
4892016-06-24  John Ogness  <john.ogness@linutronix.de>
490
491	* elf32_updatenull.c (updatenull_wrlock): Find first section.
492	* elf_nextscn.c (elf_nextscn): When scn is NULL start from 0th
493	section.
494
4952016-06-28  Richard Henderson  <rth@redhat.com>
496
497	* elf.h: Update from glibc.  Add lots of new EM_* definitions.
498
4992016-04-14  Mark Wielaard  <mjw@redhat.com>
500
501	* elf_compress.c (__libelf_compress): Free out_buf if deflateInit
502	fails.
503
5042016-02-13  Mark Wielaard  <mjw@redhat.com>
505
506	* elf32_updatefile.c (updatemmap): Free scns when out of memory.
507
5082016-01-28  Mark Wielaard  <mjw@redhat.com>
509
510	* elf.h: Update from glibc. Add new i386 and x86_64 relocations.
511
5122016-02-12  Mark Wielaard  <mjw@redhat.com>
513
514	* elf.h: Update from glibc. Add NT_ARM_SYSTEM_CALL.
515
5162016-02-04  Mark Wielaard  <mjw@redhat.com>
517
518	* elf_getdata.c (__libelf_set_rawdata_wrlock): Don't adjust align
519	for SHT_NOBITS sections.
520
5212016-01-22  Chih-Hung Hsieh <chh@google.com>
522
523	* elf_compress.c (__libelf_compress): Move nested function
524	'do_deflate_cleanup' to file scope to compile with clang.
525	* elf_strptr.c (elf_strptr): Move nested function 'get_zdata'
526	to file scope to compile with clang.
527
5282016-01-13  Mark Wielaard  <mjw@redhat.com>
529
530	* libelf.h: Check SHF_COMPRESSED is defined. If not define it and the
531	associated ELF compression types/defines.
532
5332015-11-26  Mark Wielaard  <mjw@redhat.com>
534
535	* elf_compress.c (__libelf_decompress_elf): New function, extracted
536	from...
537	(elf_compress): here. Check zdata_base use __libelf_decompress_elf.
538	* elf_strptr.c (elf_strptr): If SHF_COMPRESSED check, uncompress and
539	use zdata.
540	* libelfP.h (struct Elf_Scn): Add zdata_size and zdata_align.
541	(__libelf_decompress_elf): New internal function definition.
542
5432015-10-21  Mark Wielaard  <mjw@redhat.com>
544
545	* Makefile.am (libelf_a_SOURCES): Add elf_compress.c and
546	elf_compress_gnu.c.
547	* elf_compress.c: New file.
548	* elf_compress_gnu.c: Likewise.
549	* elf_begin.c (file_read_elf): Make a writable copy of the shdrs
550	for ELF_C_READ_MMAP.
551	* elf_end.c (elf_end): Free zdata_base.
552	* elf_error.c: Add ELF_E_ALREADY_COMPRESSED,
553	ELF_E_UNKNOWN_COMPRESSION_TYPE, ELF_E_COMPRESS_ERROR and
554	ELF_E_DECOMPRESS_ERROR.
555	* elf_data.c (__libelf_data_type): New internal function extracted
556	from convert_data.
557	(convert_data): Handle SHF_COMPRESSED.
558	* elf32_updatenull.c (updatenull_wrlock): Check sh_entsize against
559	uncompressed section data size if SHF_COMPRESSED.
560	* elf32_getshdr.c (load_shdr_wrlock): Adjust assert to account for
561	ELF_C_READ_MMAP.
562	* libelf.h: Define elf_compress and elf_compress_gnu.
563	* libelf.map (ELFUTILS_1.7): Add elf_compress and elf_compress_gnu.
564	* libelfP.h: Add ELF_E_ALREADY_COMPRESSED,
565	ELF_E_UNKNOWN_COMPRESSION_TYPE, ELF_E_COMPRESS_ERROR and
566	ELF_E_DECOMPRESS_ERROR. Define __libelf_data_type.
567	(__libelf_compress): New internal function definition.
568	(__libelf_decompress): Likewise.
569	(__libelf_reset_rawdata): Likewise.
570	(__libelf_data_type): Likewise.
571	(struct Elf_Scn): Add zdata_base.
572
5732015-11-19  Mark Wielaard  <mjw@redhat.com>
574
575	* Makefile.am (libelf_a_SOURCES): Add elf32_getchdr.c,
576	elf64_getchdr.c and gelf_getchdr.c.
577	(noinst_HEADERS): Add chdr_xlate.h.
578	* abstract.h: Define Chdr32 and Chdr64.
579	* chdr_xlate.h: New file.
580	* elf32_getchdr.c: New file.
581	* elf64_getchdr.c: New file.
582	* elf_error.c: Add ELF_E_NOT_COMPRESSED, ELF_E_INVALID_SECTION_TYPE
583	and ELF_E_INVALID_SECTION_FLAGS.
584	* elf_getdata.c (__libelf_set_rawdata_wrlock): Set d_type to
585	ELF_T_CHDR for SHF_COMPRESSED sections.
586	* exttypes.h: Add Chdr32 and Chdr64.
587	* gelf.h (GElf_Chdr): New typedef.
588	(gelf_getchdr): New function definition.
589	* gelf_fsize.c (__libelf_type_sizes): Add ELF_T_CHDR.
590	* gelf_getchdr.c: New file.
591	* gelf_xlate.c (__elf_xfctstom): Add ELF_T_CHDR cvt_chdr.
592	* gelf_xlate.h: Add Chdr.
593	* libelf.h (Elf_Type): Add ELF_T_CHDR.
594	(elf32_getchdr): New function definition.
595	(elf64_getchdr): Likewise.
596	* libelf.map (ELFUTILS_1.7): New sections add elf32_getchdr,
597	elf64_getchdr and gelf_getchdr.
598	* libelfP.h: Add ELF_E_NOT_COMPRESSED, ELF_E_INVALID_SECTION_TYPE
599	and ELF_E_INVALID_SECTION_FLAGS.
600
6012015-10-16  Mark Wielaard  <mjw@redhat.com>
602
603	* Makefile.am (libelf_so_LDLIBS): Add -lz.
604
6052015-10-14  Mark Wielaard  <mjw@redhat.com>
606
607	* elf.h: Update from glibc. Add section compression constants and
608	structures.
609
6102015-10-20  Jose E. Marchesi  <jose.marchesi@oracle.com>
611
612	* elf_begin.c (get_shnum): Elf64_Shdr.sh_size is an Elf64_Xword.
613	Fix the size argument to pread_retry.
614
6152015-10-13  Chih-Hung Hsieh  <chh@google.com>
616
617	* elf32_updatefile.c (__elfw2(LIBELFBITS,updatemmap)): Move nested
618	function 'fill_mmap' to file scope.
619	* elf_begin.c (elf_begin): Move nested function 'lock_dup_elf'
620	to file scope.
621
6222015-10-09  Josh Stone  <jistone@redhat.com>
623
624	* libelf.h: Replace loff_t with int64_t throughout.
625
6262015-10-05  Mark Wielaard  <mjw@redhat.com>
627
628	* elf_update.c (write_file): Only use posix_fallocate when using
629	mmap. Only report failure when errno is ENOSPC.
630
6312015-10-09  Josh Stone  <jistone@redhat.com>
632
633	* libelfP.h (struct Elf): Replace off64_t with off_t.
634	* elf_getdata_rawchunk.c (elf_getdata_rawchunk): Likewise.
635
6362015-10-05  Chih-Hung Hsieh <chh@google.com>
637
638	* elf_getarsym.c (elf_getarsym): Do not use
639	union of variable length arrays.
640
6412015-10-05  Josh Stone  <jistone@redhat.com>
642
643	* Makefile.am (libelf.so): Add AM_V_CCLD and AM_V_at silencers.
644
6452015-09-24  Jose E. Marchesi  <jose.marchesi@oracle.com>
646
647	* Makefile.am (AM_CFLAGS): Use -fPIC instead of -fpic to avoid
648	relocation overflows in some platforms.
649
6502015-09-29  Mark Wielaard  <mjw@redhat.com>
651
652	* elf32_updatenull.c (default_ehdr): Set e_version when EV_NONE.
653	(updatenull_wrlock): Always set e_shentsize.
654
6552015-09-23  Mark Wielaard  <mjw@redhat.com>
656
657	* elf32_getehdr.c (getehdr_wrlock): Mark as internal_function.
658	* elf32_getshdr.c (getshdr_rdlock): Likewise.
659	(getshdr_wrlock): Likewise.
660	* elf_error.c (__libelf_seterrno): Likewise.
661	* elf_getphdrnum.c (__elf_getphdrnum_rdlock): Likewise.
662	(__elf_getphdrnum_chk_rdlock): Likewise.
663	* elf_getshdrnum.c (__elf_getphdrnum_rdlock): Likewise.
664	(__elf_getphdrnum_chk_rdlock): Likewise.
665	* elf_getshdrnum.c (__elf_getshdrnum_rdlock): Likewise.
666	* elf_readall.c (__libelf_readall): Likewise.
667	* gelf_getehdr.c (__gelf_getehdr_rdlock): Likewise.
668
6692015-09-22  Mark Wielaard  <mjw@redhat.com>
670
671	* *.c: Remove old-style function definitions.
672
6732015-06-22  Mark Wielaard  <mjw@redhat.com>
674
675	* dl-hash.h: Update from glibc.
676
6772015-06-18  Mark Wielaard  <mjw@redhat.com>
678
679	* elf32_updatefile.c (updatefile): Always free shdr_data and scns
680	when allocated on failure paths.
681
6822015-06-18  Mark Wielaard  <mjw@redhat.com>
683
684	* nlist.c (nlist): Check symscn shdr exists before use.
685
6862015-06-16  Mark Wielaard  <mjw@redhat.com>
687
688	* elf_update.c (write_file): Always also use ftruncate before
689	posix_fallocate to make sure file has the right size.
690
6912015-06-04  Mark Wielaard  <mjw@redhat.com>
692
693	* elf_getdata.c (__libelf_type_aligns): Add entries for ELF_T_EHDR,
694	ELF_T_OFF, ELF_T_PHDR, ELF_T_SHDR, ELF_T_SWORD, ELF_T_XWORD,
695	ELF_T_SXWORD, ELF_T_GNUHASH, ELF_T_AUXV.
696	* elf_getdata_rawchunk.c (elf_getdata_rawchunk): Check alignment
697	of rawdata against requested type.
698
6992015-06-02  Mark Wielaard  <mjw@redhat.com>
700
701	* elf_getdata.c (convert_data): Make sure source data is properly
702	aligned for type before calling actual conversion function.
703
7042015-06-04  Mark Wielaard  <mjw@redhat.com>
705
706	* elf_begin.c (get_shnum): Check alignment of Shdr, not Ehdr before
707	direct access.
708
7092015-06-02  Mark Wielaard  <mjw@redhat.com>
710
711	* elf_begin.c (file_read_elf): Split checks for ehdr and shdr
712	alignment, drop phdr alignment check.
713
7142015-05-31  Mark Wielaard  <mjw@redhat.com>
715
716	* elf32_getshdr.c (load_shdr_wrlock): Allocate shdrs with malloc,
717	not alloca and free after conversion when a copy needs to be made.
718
7192015-05-31  Mark Wielaard  <mjw@redhat.com>
720
721	* elf32_getphdr.c (getphdr_wrlock): Allocate phdrs with malloc, not
722	alloca and free after conversion when a copy needs to be made.
723
7242015-05-31  Mark Wielaard  <mjw@redhat.com>
725
726	* elf_getarsym.c (elf_getarsym): Allocate temporary file_date with
727	malloc, not alloca also in !ALLOW_UNALIGNED case.
728
7292015-05-30  Mark Wielaard  <mjw@redhat.com>
730
731	* gelf_xlate.c (elf_cvt_Byte): Only call memmove with non-zero size.
732
7332015-05-30  Mark Wielaard  <mjw@redhat.com>
734
735	* elf32_updatefile.c (updatemmap): Only call mempcpy and update
736	last_position when d_size is non-zero.
737
7382015-05-17  Mark Wielaard  <mjw@redhat.com>
739
740	* elf32_updatefile.c (updatefile): Allocate shdr_data and scns
741	with malloc, not alloca. Free after writing section headers.
742
7432015-05-16  Mark Wielaard  <mjw@redhat.com>
744
745	* elf32_updatefile.c (updatemmap): Allocate temporary shdr storage
746	with malloc, not alloca. Free after writing section header.
747
7482015-05-16  Mark Wielaard  <mjw@redhat.com>
749
750	* elf_getarsym.c (elf_getarsym): Allocate temporary file_date with
751	malloc, not alloca. Call free after out.
752
7532015-05-14  Mark Wielaard  <mjw@redhat.com>
754
755	* elf_update.c (write_file): Use posix_fallocate instead of
756	ftruncate to extend file if necessary.
757
7582015-05-13  Mark Wielaard  <mjw@redhat.com>
759
760	* elf32_updatenull.c (default_ehdr): If e_phnum is zero then set
761	e_phoff also to zero.
762
7632015-05-12  Mark Wielaard  <mjw@redhat.com>
764
765	* elf32_updatenull.c (updatenull_wrlock): Check that sh_addralign
766	is a powerof2.
767	* elf_getdata.c (__libelf_set_rawdata_wrlock): Clamp large d_aligns
768	to the elf image offset.
769
7702015-05-12  Mark Wielaard  <mjw@redhat.com>
771
772	* elf32_newphdr.c (newphdr): Call __libelf_seterrno with
773	ELF_E_INVALID_INDEX before failing. Check whether section zero shdr
774	actually exists if we need to put extended phnum in section zero.
775
7762015-05-08  Mark Wielaard  <mjw@redhat.com>
777
778	* nlist.c (nlist): Call gelf_fsize with EV_CURRENT.
779
7802015-01-03  Mark Wielaard  <mjw@redhat.com>
781
782	* version_xlate.h (elf_cvt_Verdef): Use memmove to copy src to dest.
783	(elf_cvt_Verneed): Likewise.
784
7852015-03-28  Mark Wielaard  <mjw@redhat.com>
786
787	* elf.h: Update from glibc.
788
7892015-03-23  Mark Wielaard  <mjw@redhat.com>
790
791	* elf32_updatenull.c (updatenull_wrlock): Don't extend size with
792	SHT_NOBITS sh_offset.
793
7942015-02-18  Mark Wielaard  <mjw@redhat.com>
795
796	* libelfP.h (__libelf_set_data_list_rdlock): Make internal_function.
797
7982015-02-07  Jan Kratochvil  <jan.kratochvil@redhat.com>
799
800	* elf32_updatenull.c (__elfw2(LIBELFBITS,updatenull_wrlock)): Consider
801	sh_addralign 0 as 1.
802
8032015-01-22  Mark Wielaard  <mjw@redhat.com>
804
805	* elf_strptr (elf_strptr): Make sure returned string is NUL
806	terminated.
807
8082015-01-21  Mark Wielaard  <mjw@redhat.com>
809
810	* elf_strptr.c (elf_strptr): Check data_list_rear == NULL instead
811	of rawdata_base != NULL before using rawdata directly.
812
8132015-01-20  Mark Wielaard  <mjw@redhat.com>
814
815	* libelfP.h (__elf_strptr_internal): New function declaration.
816	* elf_getdata.c (__libelf_set_data_list_rdlock): New internal
817	function extracted from...
818	(__elf_getdata_rdlock): ... here.
819	* elf_newdata.c (elf_newdata): Check scn->rawdata_base and update
820	datalist if necessary.
821
8222015-01-20  Mark Wielaard  <mjw@redhat.com>
823
824	* elf_strptr.c (elf_strptr): Call __elf[32|64]_getshdr_rdlock if
825	necessary.
826
8272014-12-30  Mark Wielaard  <mjw@redhat.com>
828
829	* elf_getphdrnum.c (__elf_getphdrnum_chk_rdlock): New function.
830	(elf_getphdrnum): Call __elf_getphdrnum_chk_rdlock.
831	* gelf_getphdr (gelf_getphdr): Call __elf_getphdrnum_chk_rdlock
832	and always check ndx against phnum.
833	* libelfP.h (__elf_getphdrnum_chk_rdlock): New internal function.
834
8352014-12-25  Mark Wielaard  <mjw@redhat.com>
836
837	* elf_begin.c (__libelf_next_arhdr_wrlock): ar_size cannot be
838	negative. Include start_offset in maxsize.
839
8402014-12-28  Alexander Cherepanov  <cherepan@mccme.ru>
841
842	* elf_begin.c (read_long_names): Don't miss '/' right after
843	another '/'. Fixes a dir traversal vuln in ar extraction.
844
8452014-12-18  Ulrich Drepper  <drepper@gmail.com>
846
847	* Makefile.am: Suppress output of textrel_check command.
848
8492014-12-16  Mark Wielaard  <mjw@redhat.com>
850
851	* elf_begin.c (read_long_names): Make sure long_names len fits
852	in mapped ELF file.
853
8542014-12-15  Mark Wielaard  <mjw@redhat.com>
855
856	* elf_getarsym.c (elf_getarsym): Check index_size doesn't overflow.
857
8582014-12-15  Mark Wielaard  <mjw@redhat.com>
859
860	* elf_begin.c (read_long_names): Clear any garbage left in the
861	name table.
862
8632014-12-11  Mark Wielaard  <mjw@redhat.com>
864
865	* elf_begin.c (file_read_elf): Correct ELF64 section offset check.
866
8672014-12-11  Mark Wielaard  <mjw@redhat.com>
868
869	* elf_begin.c (read_long_names): Check for offset overflow.
870	(__libelf_next_arhdr_wrlock): Likewise. Sanity check the ar_size.
871	Don't allow it to go beyond end of file.
872
8732014-12-09  Mark Wielaard  <mjw@redhat.com>
874
875	* elf_getarsym.c (elf_getarsym): Make sure n * w doesn't overflow.
876
8772014-11-27  Mark Wielaard  <mjw@redhat.com>
878
879	* Makefile.am (libelf.so): Use textrel_check.
880
8812014-11-23  Mark Wielaard  <mjw@redhat.com>
882
883	* elf_getdata_rawchunk.c (elf_getdata_rawchunk): Change signed
884	overflow check to unsigned.
885
8862014-11-23  Mark Wielaard  <mjw@redhat.com>
887
888	* note_xlate.h (elf_cvt_note): Copy over any leftover data if
889	src != dest. The data is probably part of truncated name/desc.
890
8912014-11-22  Mark Wielaard  <mjw@redhat.com>
892
893	* elf_getphdrnum.c (elf_getphdrnum): Sanity check the
894	__elf_getphdrnum_rdlock result.
895
8962014-11-18  Mark Wielaard  <mjw@redhat.com>
897
898	* version_xlate.h (elf_cvt_Verdef): Check for overflow.
899	(elf_cvt_Verneed): Likewise.
900
9012014-11-17  Mark Wielaard  <mjw@redhat.com>
902
903	* elf-knowledge.h (SECTION_STRIP_P): Check name is not NULL.
904
9052014-11-16  Mark Wielaard  <mjw@redhat.com>
906
907	* elf_getshdrstrndx.c: Check there are section headers before
908	handling SHN_XINDEX.
909
9102014-11-16  Mark Wielaard  <mjw@redhat.com>
911
912	* elf32_getphdr.c (getphdr_wrlock): Check e_phoff isn't zero.
913	Check for too many pheaders.
914	* elf_getphdrnum.c (__elf_getphdrnum_rdlock): Check section zero
915	actually exists before handling PN_XNUM.
916
9172014-11-16  Mark Wielaard  <mjw@redhat.com>
918
919	* gelf_getnote.c (gelf_getnote): Check padding overflow.
920
9212014-11-16  Mark Wielaard  <mjw@redhat.com>
922
923	* elf_getdata.c (__libelf_set_rawdata_wrlock): Declare offset, size
924	and align as Elf64_Off and Elf64_Xword not size_t.
925
9262014-11-14  Mark Wielaard  <mjw@redhat.com>
927
928	* gelf_getnote.c (gelf_getnote): Check offset overflow.
929
9302014-11-13  Mark Wielaard  <mjw@redhat.com>
931
932	* elf_getdata.c (__libelf_set_rawdata_wrlock): Fix unsigned overflow
933	check.
934
9352014-11-08  Mark Wielaard  <mjw@redhat.com>
936
937	* elf_begin.c (__libelf_next_arhdr_wrlock): Use mempcpy not __mempcpy.
938
9392014-11-07  Mark Wielaard  <mjw@redhat.com>
940
941	* elf_begin.c (file_read_elf): Correct sh_size check.
942	* elf_getdata.c (__libelf_set_rawdata_wrlock): Check for unsigned
943	overflow.
944
9452014-09-10  Petr Machata  <pmachata@redhat.com>
946
947	* elf_begin (read_unmmaped_file): Call __libelf_seterrno if the
948	file is unreadable.
949
9502014-07-07  Mark Wielaard  <mjw@redhat.com>
951
952	* elf.h: Update from glibc.
953
9542014-04-13  Mark Wielaard  <mjw@redhat.com>
955
956	* Makefile.am: Remove !MUDFLAP conditions.
957	* elf_begin.c (read_file): Don't clear use_mmap when _MUDFLAP is
958	defined.
959	* elf_update.c (write_file): Remove _MUDFLAP condition.
960
9612014-01-17  Jakub Jelinek  <jakub@redhat.com>
962	    Roland McGrath  <roland@redhat.com>
963
964	* libelfP.h (INVALID_NDX): Define.
965	* gelf_getdyn.c (gelf_getdyn): Use it.  Remove ndx < 0 test if any.
966	* gelf_getlib.c (gelf_getlib): Likewise.
967	* gelf_getmove.c (gelf_getmove): Likewise.
968	* gelf_getrel.c (gelf_getrel): Likewise.
969	* gelf_getrela.c (gelf_getrela): Likewise.
970	* gelf_getsym.c (gelf_getsym): Likewise.
971	* gelf_getsyminfo.c (gelf_getsyminfo): Likewise.
972	* gelf_getsymshndx.c (gelf_getsymshndx): Likewise.
973	* gelf_getversym.c (gelf_getversym): Likewise.
974	* gelf_update_dyn.c (gelf_update_dyn): Likewise.
975	* gelf_update_lib.c (gelf_update_lib): Likewise.
976	* gelf_update_move.c (gelf_update_move): Likewise.
977	* gelf_update_rel.c (gelf_update_rel): Likewise.
978	* gelf_update_rela.c (gelf_update_rela): Likewise.
979	* gelf_update_sym.c (gelf_update_sym): Likewise.
980	* gelf_update_syminfo.c (gelf_update_syminfo): Likewise.
981	* gelf_update_symshndx.c (gelf_update_symshndx): Likewise.
982	* gelf_update_versym.c (gelf_update_versym): Likewise.
983
9842014-01-17  Jakub Jelinek  <jakub@redhat.com>
985
986	* elf32_getphdr.c (elfw2(LIBELFBITS,getphdr)): Check if program header
987	table fits into object's bounds.
988	* elf_getshdrstrndx.c (elf_getshstrndx): Add elf->start_offset to
989	elf->map_address.  Check if first section header fits into object's
990	bounds.
991	* elf32_getshdr.c (elfw2(LIBELFBITS,getshdr)):
992	Check if section header table fits into object's bounds.
993	* elf_begin.c (get_shnum): Ensure section headers fits into
994	object's bounds.
995	(file_read_elf): Make sure scncnt is small enough to allocate both
996	ElfXX_Shdr and Elf_Scn array.  Make sure section and program header
997	tables fit into object's bounds.  Avoid memory leak on failure.
998	* elf_newscn.c (elf_newscn): Check for overflow.
999	* elf32_updatefile.c (__elfw2(LIBELFBITS,updatemmap)): Likewise.
1000	(__elfw2(LIBELFBITS,updatefile)): Likewise.
1001	* elf32_newphdr.c (elfw2(LIBELFBITS,newphdr)): Likewise.
1002	* elf_getarsym.c (elf_getarsym): Likewise.
1003
10042013-11-08  Mark Wielaard  <mjw@redhat.com>
1005
1006	* elf32_updatefile.c (elfXX_updatemmap): Only memcpy ehdr when not
1007	already directly mmapped.
1008
10092013-11-05  Mark Wielaard  <mjw@redhat.com>
1010
1011	* elf32_updatefile.c (elfXX_updatefile): Copy all section headers
1012	if elf->flags dirty.
1013
10142013-11-01  Michael Forney  <mforney@mforney.org>
1015
1016	* Makefile.am: Use READELF.
1017
10182013-10-01  Petr Machata  <pmachata@redhat.com>
1019
1020	* elf.h: Update from glibc.
1021
10222013-06-17  Petr Machata  <pmachata@redhat.com>
1023
1024	* elf.h: Update from glibc.
1025
10262013-08-28  Namhyung Kim  <namhyung@gmail.com>
1027
1028	* gelf.h (gelf_fsize): Fix typo in comment.
1029
10302013-08-28  Mark Wielaard  <mjw@redhat.com>
1031
1032	* gelf_getauxv.c (gelf_getauxv): Add missing whitespace.
1033
10342013-08-27  Mark Wielaard  <mjw@redhat.com>
1035
1036	* gelf_getauxv.c (gelf_getauxv): Remove unnecessary casts to char *.
1037
10382013-08-25  Kurt Roeckx  <kurt@roeckx.be>
1039
1040	* gelf_getauxv.c (gelf_getauxv): Use memcpy instead of pointer
1041	dereference to avoid alignment problems.
1042
10432013-01-07  Roland McGrath  <roland@hack.frob.com>
1044
1045	* elf_getarsym.c (elf_getarsym): Copy FILE_DATA into stack space if it
1046	would be unaligned and !ALLOW_UNALIGNED.
1047
1048	* elf_getarsym.c (read_number_entries): Use memcpy instead of pointer
1049	dereference so as not to assume the field is naturally aligned.
1050
10512012-09-17  Petr Machata  <pmachata@redhat.com>
1052
1053	* elf.h: Update from glibc.
1054
10552012-08-16  Roland McGrath  <roland@hack.frob.com>
1056
1057	* elf.h: Update from glibc.
1058
10592012-08-14  Mark Wielaard  <mjw@redhat.com>
1060
1061	* elf32_checksum.c (ebl_debugscn_p): Removed unused define and
1062	confusing outdated comment.
1063
10642012-08-01  Petr Machata  <pmachata@redhat.com>
1065
1066	* elf_getarsym (read_number_entries): New function.
1067	(elf_getarsym): Handle 64-bit symbol table, stored in special
1068	entry named "/SYM64/".
1069	* elf_begin.c (__libelf_next_arhdr_wrlock): Don't reject archive
1070	because it contains 64-bit symbol table.
1071
10722012-07-19  Mark Wielaard  <mjw@redhat.com>
1073
1074	* elf32_getshdr.c (load_shdr_wrlock): Add elf->flags & ELF_F_MALLOCED
1075	to asserts.
1076
10772012-07-17  Petr Machata  <pmachata@redhat.com>
1078
1079	* elf32_xlatetom.c (elfw2(LIBELFBITS, xlatetom)): Do not check for
1080	integer number of records in case of ELF_T_NHDR.
1081
10822012-04-02  Mark Wielaard  <mjw@redhat.com>
1083
1084	* elf32_offscn.c: Do not match SHT_NOBITS sections at OFFSET unless
1085	there are no nonempty sections at that offset.
1086
10872012-03-21  Roland McGrath  <roland@hack.frob.com>
1088
1089	* elf-knowledge.h (SECTION_STRIP_P): Remove < SHT_NUM check.
1090
10912011-02-26  Mark Wielaard  <mjw@redhat.com>
1092
1093	* elf_end.c (elf_end): Call rwlock_unlock before rwlock_fini.
1094
10952011-01-05  Jan Kratochvil  <jan.kratochvil@redhat.com>
1096
1097	* elf_getdata_rawchunk.c (elf_getdata_rawchunk): Fix off64_t overflow
1098	when MAXIMUM_SIZE == ~0.
1099
11002010-08-18  Roland McGrath  <roland@redhat.com>
1101
1102	* gelf_fsize.c (__libelf_type_sizes): Add entries for ELF_T_LIB
1103	and ELF_T_GNUHASH.
1104	Reported by Mark Hatle <mark.hatle@windriver.com>.
1105
1106	* exttypes.h: Add cases for ElfNN_Lib.
1107	Reported by Mark Hatle <mark.hatle@windriver.com>.
1108
11092010-06-14  Ulrich Drepper  <drepper@redhat.com>
1110
1111	* gelf_update_shdr.c: Implicitly set ELF_F_DIRTY bit.
1112	* gelf_update_phdr.c: Likewise.
1113	* gelf_update_ehdr.c: Likewise.
1114
11152010-04-14  Roland McGrath  <roland@redhat.com>
1116
1117	* elf32_getphdr.c: Check for e_phoff/size outside the file bounds.
1118	* elf_begin.c (file_read_elf): Don't set .phdr here.
1119
11202010-04-13  Roland McGrath  <roland@redhat.com>
1121
1122	* elf.h: Update from glibc.
1123
11242010-04-06  Roland McGrath  <roland@redhat.com>
1125
1126	* elf_error.c (ELF_E_FD_MISMATCH_IDX): Avoid nonobvious abbreviation
1127	in error message.
1128
11292010-04-01  Petr Machata  <pmachata@redhat.com>
1130
1131	* elf_getdata.c (__elf_getdata_rdlock): Initialize data.s for data
1132	that do not need a conversion.
1133
11342010-03-11  Roland McGrath  <roland@redhat.com>
1135
1136	* elf.h: Update from glibc.
1137
11382010-03-04  Ulrich Drepper  <drepper@redhat.com>
1139
1140	* elf.h: Update from glibc.
1141
11422010-02-17  Roland McGrath  <roland@redhat.com>
1143
1144	* elf_begin.c (file_read_elf): Leave section rawdata_base and
1145	data_base pointers null when [sh_offset,sh_size) points outside
1146	the mapped file.
1147
11482010-02-15  Roland McGrath  <roland@redhat.com>
1149
1150	* Makefile.am: Use config/eu.am for common stuff.
1151
11522010-01-07  Roland McGrath  <roland@redhat.com>
1153
1154	* elf32_getphdr.c: Use __elf_getphdrnum_rdlock.
1155	* gelf_getphdr.c: Likewise.
1156	* gelf_update_phdr.c: Likewise.
1157	* elf32_updatefile.c (__elf32_updatemmap, __elf32_updatefile): Likewise.
1158	* elf32_updatenull.c (__elf32_updatenull_wrlock): Likewise.
1159	* elf32_newphdr.c: Clear section 0's sh_info when resetting e_phnum.
1160	If COUNT is too large, use store PN_XNUM instead and set sh_info.
1161	* elf_begin.c (file_read_elf): Always allocate space we can use later
1162	for section 0 if doing RDWR.
1163
1164	* elf_getphdrnum.c: New file.
1165	* Makefile.am (libelf_a_SOURCES): Add it.
1166	* libelf.h: Declare elf_getphdrnum.
1167	* libelfP.h: Declare __elf_getphdrnum_rdlock.
1168	* libelf.map (ELFUTILS_1.6): New set, add elf_getphdrnum.
1169
1170	* elf.h: Update from glibc.
1171
11722009-10-23  Lubomir Rintel  <lkundrak@v3.sk>
1173
1174	* elf32_updatefile.c (fill_mmap): When starting past shdr_end, start
1175	filling from section start, not shdr_end.
1176
11772009-11-10  Roland McGrath  <roland@redhat.com>
1178
1179	* elf_readall.c (__libelf_readall): Fetch file size if not yet known.
1180
11812009-11-06  Mark Wielaard  <mjw@redhat.com>
1182
1183	* elf_next.c (elf_next): Mark the archive header as unusable when
1184	there is no next ar element.
1185
11862009-08-12  Mark Wielaard  <mjw@redhat.com>
1187
1188	* Makefile.am (libelf.so): Use -Wl,-z,defs not -defs.
1189
11902009-07-26  Ulrich Drepper  <drepper@redhat.com>
1191
1192	* elf.h: Update from glibc.
1193
11942009-07-21  Ulrich Drepper  <drepper@redhat.com>
1195
1196	* elf32_updatefile.c (__elfXX_updatemmap): Fix handling of gaps between
1197	sections.  Patch by Lubomir Rintel <lkundrak@v3.sk>.
1198
11992009-07-08  Roland McGrath  <roland@redhat.com>
1200
1201	* libelfP.h (struct Elf): Remove unused ar.has_index field.
1202	Reorder various members for optimal packing.
1203
12042009-07-08  Ulrich Drepper  <drepper@redhat.com>
1205
1206	* elf.h: Update from glibc.
1207
12082009-06-13  Ulrich Drepper  <drepper@redhat.com>
1209
1210	* Makefile.am (libelf_a_SOURCES): Replace elf_getshnum.c and
1211	elf_getshstrndx.c with elf_getshdrnum.c and elf_getshdrstrndx.c.
1212	* elf_getshnum.c: Renamed to...
1213	* elf_getshdrnum.c: ...this.  Rename function and add old name as
1214	alias.  Likewise for internal functions with derived names.
1215	* elf_getshstrndx.c: Renamed to...
1216	* elf_getshdrstrndx.c: ...this.  Rename function and add old name as
1217	alias.  Likewise for internal functions with derived names.
1218	* libelf.h: Add prototypes for new names.  Make old names as
1219	deprecated.
1220	* libelfP.h: Rename internal function prototypes.
1221	* libelf.map: Export for names.
1222	* elf32_checksum.c: Don't use deprecated functions.
1223	* elf32_getshdr.c: Likewise.
1224
12252009-06-01  Ulrich Drepper  <drepper@redhat.com>
1226
1227	* elf.h: Update from glibc.
1228
12292009-04-14  Roland McGrath  <roland@redhat.com>
1230
1231	* elf.h: Update from glibc.
1232
12332009-04-01  Roland McGrath  <roland@redhat.com>
1234
1235	* elf.h: Update from glibc.
1236
12372009-02-10  Ulrich Drepper  <drepper@redhat.com>
1238
1239	* elf32_updatefile.c (updatefile): For the zeroth section we still
1240	have to copy the section header.
1241
12422009-02-01  Ulrich Drepper  <drepper@redhat.com>
1243
1244	* elf_strptr.c: Add comment re possible problem.
1245
12462009-01-26  Ulrich Drepper  <drepper@redhat.com>
1247
1248	* elf32_updatenull.c (updatenull_wrlock): Fix comment of
1249	ELF_F_LAYOUT behaviour re section header table.
1250
12512009-01-22  Ulrich Drepper  <drepper@redhat.com>
1252
1253	* elf32_updatefile.c (__elfXX_updatemmap): Fill the gap between
1254	sections even if only the section at the start of the gap has been
1255	changed.
1256	(__elfXX_updatefile): Likewise.
1257
12582009-01-21  Ulrich Drepper  <drepper@redhat.com>
1259
1260	* elf32_updatefile.c (__elfXX_updatemmap): Skip most of the loop to
1261	handle sections for NOBITS sections.
1262	(elfXX_updatefile): Likewise.
1263
1264	* elf32_updatefile.c (__elfXX_updatemmap): When skipping non-NOBITS
1265	sections we haven't loaded, update last_position based on scn_start,
1266	not based on old value.  Don't run the loop for the dummy section 0.
1267	(elfXX_updatefile): Don't run the loop for the dummy section 0.
1268
12692009-01-10  Ulrich Drepper  <drepper@redhat.com>
1270
1271	* libelfP.h (_): We only have one translation domain, elfutils.
1272
1273	* Makefile.am: Use USE_LOCKS instead of USE_TLS.
1274	* elf_error.c: Always use __thread.  Remove all !USE_TLS code.
1275
12762009-01-04  Roland McGrath  <roland@redhat.com>
1277
1278	* note_xlate.h (elf_cvt_note): Don't examine a size too small to
1279	container a note header.
1280
12812008-12-11  Roland McGrath  <roland@redhat.com>
1282
1283	* elf32_updatefile.c (__elfw2(LIBELFBITS,updatemmap)): Handle
1284	placement offset going backwards, for out-of-order or overlapping
1285	(bogus) sh_offset layouts.  It's a dumb use, but should not crash.
1286	(__elfw2(LIBELFBITS,updatefile)): Likewise.
1287	Fixes RHBZ#476136.
1288
1289	* libelf.h (Elf_Data): Whitespace fix.
1290
12912008-12-10  Roland McGrath  <roland@redhat.com>
1292
1293	* elf_getarhdr.c (elf_getarhdr): Fix missing rename in last change.
1294
12952008-10-22  Petr Machata  <pmachata@redhat.com>
1296
1297	* elf_rawfile.c (elf_rawfile): Lock around elf-> references.
1298
12992008-10-21  Petr Machata  <pmachata@redhat.com>
1300
1301	* libelfP.h: Rename getehdr_rdlock to getehdr_wrlock.
1302	* elf32_getehdr.c (getehdr_rdlock): Move the code to new function
1303	getehdr_impl and make it a wrapper.  Rename to getehdr_wrlock.
1304	(getehdr_impl): Guard elf->class init with wrlock.
1305	(getehdr): Also make it a wrapper of getehdr_impl.
1306	* elf32_updatenull.c (updatenull_wrlock): Call getehdr_wrlock.
1307
13082008-10-20  Petr Machata  <pmachata@redhat.com>
1309
1310	* elf_getdata_rawchunk.c (elf_getdata_rawchunk): Lock around the
1311	code that reads mutable elf state.  Relock to write lock to chain
1312	the new chunk on the elf rawchunks list.
1313
13142008-10-20  Petr Machata  <pmachata@redhat.com>
1315
1316	* elf32_checksum.c (checksum): Place a lock around the code that
1317	processes data.  Make it wrlock if the code needs to xlate the
1318	data before processing.
1319
13202008-10-16  Petr Machata  <pmachata@redhat.com>
1321
1322	* elf_begin.c
1323	(__libelf_next_arhdr): Rename to __libelf_next_arhdr_wrlock.
1324	(dup_elf): Adjust the call.
1325	(elf_begin): New local function lock_dup_elf.  Relocks the elf if
1326	necessary before calling dup.  Call this instead of dup_elf.
1327	* elf_getarhdr.c
1328	(elf_getarhdr): Lock before calling __libelf_next_arhdr_wrlock.
1329	* elf_next.c (elf_next): Likewise.
1330	* elf_rand.c (elf_rand): Likewise.
1331
13322008-10-14  Petr Machata  <pmachata@redhat.com>
1333
1334	* elf_getdata.c (__elf_getdata_rdlock): Lock before converting.
1335
13362008-11-26  Roland McGrath  <roland@redhat.com>
1337
1338	* elf.h: Update from glibc.
1339
13402008-10-06  Roland McGrath  <roland@redhat.com>
1341
1342	* elf_getarhdr.c (elf_getarhdr): Return NULL when passed NULL.
1343
13442008-08-27  Roland McGrath  <roland@redhat.com>
1345
1346	* elf_begin.c (get_shnum): Avoid misaligned reads for matching endian.
1347
1348	* libelfP.h [!ALLOW_UNALIGNED] (__libelf_type_align): Fix CLASS index.
1349
13502008-08-25  Roland McGrath  <roland@redhat.com>
1351
1352	* Makefile.am (libelf_so_LDLIBS): New variable.
1353	(libelf.so): Use it in the link.
1354
13552008-08-21  Petr Machata  <pmachata@redhat.com>
1356
1357	* elf_getdata.c, libelfP.h
1358	(__elf_getdata_internal): Rename to __elf_getdata_rdlock.
1359	(__libelf_set_rawdata_wrlock): New function.
1360	(__libelf_set_rawdata): Make it a wrapper that calls *_wrlock.
1361	* elf32_updatenull.c, libelfP.h
1362	(__elfNN_updatenull): Rename to __elfNN_updatenull_wrlock.
1363
13642008-08-21  Petr Machata  <pmachata@redhat.com>
1365
1366	* elf32_getphdr.c, libelfP.h
1367	(__elfNN_getphdr_internal): Drop.  Move __elfNN_getphdr_internal
1368	code to __elfNN_getphdr_wrlock.
1369	(__elfNN_getphdr_rdlock, __elfNN_getphdr_wrlock): New functions.
1370	(__elfNN_getphdr_rdlock, __elfNN_getphdr_wrlock): Make these
1371	wrappers of getphdr_impl.
1372
13732008-08-21  Petr Machata  <pmachata@redhat.com>
1374
1375	* elf32_getehdr.c, libelfP.h
1376	(__elfNN_getehdr_internal): Rename to __elfNN_getehdr_rdlock.
1377	* gelf_getehdr, libelfP.h:
1378	(__gelf_getehdr_internal): Rename to __gelf_getehdr_rdlock.
1379
13802008-08-21  Petr Machata  <pmachata@redhat.com>
1381
1382	* elf32_getshdr.c
1383	(__elfNN_getshdr_internal): Drop.
1384	(load_shdr_wrlock, scn_valid): New functions, contain bits of
1385	behaviour from __elfNN_getshdr_internal.
1386	(__elfNN_getshdr_rdlock, __elfNN_getshdr_wrlock): Replacements for
1387	dropped _internal functions above.
1388	* elf_getshnum.c
1389	(__elf_getshnum_internal): Rename to __elf_getshnum_rdlock.
1390
13912008-08-04  Petr Machata  <pmachata@redhat.com>
1392
1393	* libelfP.h (RWLOCK_RDLOCK, RWLOCK_WRLOCK, RWLOCK_UNLOCK): New macros.
1394
13952008-07-28  Roland McGrath  <roland@redhat.com>
1396
1397	* elf.h: Update from glibc.
1398
13992008-03-31  Roland McGrath  <roland@redhat.com>
1400
1401	* elf32_offscn.c: Make sure shdrs have been read in.
1402
14032008-02-19  Roland McGrath  <roland@redhat.com>
1404
1405	* elf.h: Update from glibc.
1406
14072008-02-08  Roland McGrath  <roland@redhat.com>
1408
1409	* elf.h: Update from glibc.
1410
14112008-01-31  Ulrich Drepper  <drepper@redhat.com>
1412
1413	* elf_strptr.c (elf_strptr): Don't fail if the ELF file is currently
1414	under construction and no raw data can be read from disk.
1415
14162008-01-30  Roland McGrath  <roland@redhat.com>
1417
1418	* elf.h: Update from glibc.
1419
14202008-01-26  Roland McGrath  <roland@redhat.com>
1421
1422	* elf_begin.c (__libelf_next_arhdr): Rewrite conversions using a macro.
1423	Fixes various pastos in wrong type in sizeof, wrong string parsed.
1424
14252008-01-20  Roland McGrath  <roland@redhat.com>
1426
1427	* elf_getaroff.c: Calculate from start_offset, instead of using
1428	parent's state.ar.offset field.
1429
14302008-01-08  Roland McGrath  <roland@redhat.com>
1431
1432	* Makefile.am (euinclude): Variable removed.
1433	(pkginclude_HEADERS): Set this instead of euinclude_HEADERS.
1434
14352008-01-03  Roland McGrath  <roland@redhat.com>
1436
1437	* common.h: Add __attribute__ ((unused)) to static functions.
1438
14392007-12-20  Ulrich Drepper  <drepper@redhat.com>
1440
1441	* Makefile.am (libelf_a_SOURCES): Add elf_scnshndx.
1442	* libelfP.h (struct Elf_Scn): Add shndx_index field.
1443	Declare __elf_scnshndx_internal.
1444	* elf32_getshdr.c: Record location of extended section header.
1445	* elf_begin.c (file_read_elf): Likewise.
1446	* elf_scnshndx.c: New file.
1447	* libelf.h: Declare elf_scnshndx.
1448	* libelf.map: Add elf_scnshndx to version ELFUTILS_1.4.
1449
14502007-11-12  Roland McGrath  <roland@redhat.com>
1451
1452	* libelf.h: Replace off64_t with loff_t throughout.
1453	Only that type name is unconditionally defined by <sys/types.h>
1454
14552007-11-03  Roland McGrath  <roland@redhat.com>
1456
1457	* libelf.h (Elf_Data): Comment fix.
1458
14592007-10-18  Roland McGrath  <roland@redhat.com>
1460
1461	* elf.h: Update from glibc.
1462
14632007-10-07  Roland McGrath  <roland@redhat.com>
1464
1465	* elf_begin.c (__libelf_next_arhdr): Fix fencepost error and wrong
1466	member access in terminating name with no trailing /.  Trim trailing
1467	spaces when there is no /.
1468
14692007-10-04  Roland McGrath  <roland@redhat.com>
1470
1471	* elf_end.c (elf_end): Don't free ELF->state.ar.ar_sym when it's -1l.
1472
14732007-10-03  Roland McGrath  <roland@redhat.com>
1474
1475	* libelf.h (Elf_Data): Use off64_t for d_off.
1476	(Elf_Arhdr): Use off64_t for ar_size.
1477	(elf_update, elf_getbase, elf_getaroff): Return off64_t.
1478
1479	* gelf_rawchunk.c: File removed.
1480	* gelf_freechunk.c: File removed.
1481	* Makefile.am (libelf_a_SOURCES): Remove them.
1482	* libelf.map (ELFUTILS_1.0): Remove exports.
1483	* gelf.h: Remove decls.
1484
1485	* elf_getdata_rawchunk.c: New file.
1486	* Makefile.am (libelf_a_SOURCES): Add it.
1487	* libelf.map (ELFUTILS_1.3): Add elf_getdata_rawchunk.
1488	* libelf.h: Declare it.
1489	* libelfP.h (Elf_Data_Chunk): New type.
1490	(struct Elf.elf): New member `rawchunks'.
1491	* elf_end.c (elf_end): Free recorded rawchunk buffers.
1492
14932007-08-24  Roland McGrath  <roland@redhat.com>
1494
1495	* gelf_getnote.c: New file.
1496	* Makefile.am (libelf_a_SOURCES): Add it.
1497	* gelf.h: Declare gelf_getnote.
1498	* libelf.map (ELFUTILS_1.3): Add gelf_getnote.
1499
1500	* libelfP.h (NOTE_ALIGN): New macro.
1501	* note_xlate.h: New file.
1502	* Makefile.am (noinst_HEADERS): Add it.
1503	* gelf_xlate.c: Include it.
1504	(__elf_xfctstom): Use elf_cvt_note.
1505	* elf_getdata.c (shtype_map, __libelf_type_align): Handle SHT_NOTE.
1506	(__libelf_set_rawdata): Likewise.
1507
15082007-08-19  Roland McGrath  <roland@redhat.com>
1509
1510	* gelf_update_auxv.c: New file.
1511	* gelf_getauxv.c: New file.
1512	* Makefile.am (libelf_a_SOURCES): Add them.
1513	* gelf.h: Declare gelf_getauxv, gelf_update_auxv.
1514	* libelf.map (ELFUTILS_1.3): New set, inherits fom ELFUTILS_1.2.
1515	Export gelf_getauxv, gelf_update_auxv.
1516
1517	* libelf.h (Elf_Type): Add ELF_T_AUXV.
1518	* abstract.h: Add auxv_t entries.
1519	* exttypes.h: Likewise.
1520	* gelf_xlate.h: Likewise.
1521	* gelf_xlate.c (__elf_xfctstom): Add ELF_T_AUXV entries.
1522	* gelf_fsize.c (__libelf_type_sizes): Likewise.
1523
15242007-08-12  Roland McGrath  <roland@redhat.com>
1525
1526	* elf32_updatefile.c (compare_sections): Sort secondarily on sh_size,
1527	and only tertiarily on index.
1528
15292007-07-09  Roland McGrath  <roland@redhat.com>
1530
1531	* elf.h: Update from glibc.
1532
15332007-04-22  Roland McGrath  <roland@redhat.com>
1534
1535	* elf.h: Update from glibc.
1536
15372007-03-18  Roland McGrath  <roland@redhat.com>
1538
1539	* elf_begin.c (get_shnum): Fix test for e_shoff being out of bounds.
1540	Return zero when the section headers do not fit within MAXSIZE.
1541
15422007-03-09  Roland McGrath  <roland@redhat.com>
1543
1544	* libelfP.h (LIBELF_EV_IDX): New macro.
1545	(__libelf_type_align): New macro.
1546	[! ALLOW_UNALIGNED]: Declare __libc_type_aligns array.
1547	* elf_getdata.c (shtype_map): Convert to just Elf_Type[][].
1548	(convert_data, __libelf_set_rawdata): Use that, __libelf_type_align,
1549	and __libelf_type_sizes, in place of old table.
1550	(__libc_type_aligns): New const variable.
1551
15522007-02-04  Ulrich Drepper  <drepper@redhat.com>
1553
1554	* Makefile (libelf.so): Build with -z relro.
1555
1556	* elf_begin.c (read_file): When using ELF_C_READ_MMAP use MAP_PRIVATE.
1557
15582007-01-30  Ulrich Drepper  <drepper@redhat.com>
1559
1560	* nlist.c: Close file descriptor before returning.
1561
15622007-01-20  Roland McGrath  <roland@redhat.com>
1563
1564	* gnuhash_xlate.h (elf_cvt_gnuhash): Fix fence-post error so we
1565	convert the final word.
1566
1567	* elf32_getshdr.c: Don't byteswap shdr fields when EI_DATA matches
1568	MY_ELFDATA on !ALLOW_UNALIGNED machines.
1569
15702007-01-18  Roland McGrath  <roland@redhat.com>
1571
1572	* gelf_rawchunk.c (gelf_rawchunk): Clear RESULT pointer after freeing
1573	it on read error.
1574
15752006-10-13  Roland McGrath  <roland@redhat.com>
1576
1577	* elf32_updatenull.c: Look for and accept phdr also for ET_CORE.
1578	* elf_error.c (msgstr): Change ELF_E_INVALID_PHDR string.
1579
15802006-08-29  Roland McGrath  <roland@redhat.com>
1581
1582	* elf32_getphdr.c: Don't byteswap phdr fields when EI_DATA matches
1583	MY_ELFDATA on !ALLOW_UNALIGNED machines.
1584	Reported by Christian Aichinger <Greek0@gmx.net>.
1585
1586	* Makefile.am (CLEANFILES): Add libelf.so.$(VERSION).
1587
15882006-08-08  Ulrich Drepper  <drepper@redhat.com>
1589
1590	* elf.h (DT_VALNUM): Update.
1591	(DT_ADDRNUM): Likewise.
1592
15932006-07-12  Ulrich Drepper  <drepper@redhat.com>
1594
1595	* elf32_updatefile.c: Adjust for internal_function_def removal.
1596	* elf32_updatenull.c: Likewise.
1597	* elf_begin.c: Likewise.
1598	* elf_getdata.c: Likewise.
1599
16002006-07-11  Ulrich Drepper  <drepper@redhat.com>
1601
1602	* libelf.h: Define ELF_T_GNUHASH.
1603	* elf_getdata.c (TYPEIDX): Handle SHT_GNU_HASH.
1604	(shtype_map): Add SHT_GNU_HASH entries.
1605	* gelf_xlate.c (__elf_xfctstom): Add ELF_T_GNUHASH entries.
1606	* gnuhash_xlate.h: New file.
1607	* Makefile.am (noinst_HEADERS): Add gnuhash_xlate.h.
1608
16092006-07-06  Ulrich Drepper  <drepper@redhat.com>
1610
1611	* elf_gnu_hash.c: New file.
1612	* libelf.h: Declare elf_gnu_hash.
1613	* Makefile.am (libelf_a_SOURCES): Add elf_gnu_hash.
1614	* libelf.map: Add elf_gnu_map for version ELFUTILS_1.2.
1615
16162006-06-15  Roland McGrath  <roland@redhat.com>
1617
1618	* libelf.h (elf_getarsym): Fix comment typo.
1619	Rename second parameter to be more explanatory.
1620	(elf_getident, elf_rawhide): Likewise.
1621
16222006-05-28  Ulrich Drepper  <drepper@redhat.com>
1623
1624	* elf32_updatefile.c (updatemmap): Preserve section content if
1625	copying would overwrite them.
1626	Fix msync paramters.
1627
16282006-04-04  Roland McGrath  <roland@redhat.com>
1629
1630	* elf32_updatefile.c (updatemmap): Handle other-endian case.
1631
16322006-04-04  Ulrich Drepper  <drepper@redhat.com>
1633
1634	* elf32_updatefile.c (updatemmap): Cleanups.  Remove shdr_dest
1635	variable.  Before writing sections, make a copy of the section
1636	header data if necessary.  Don't write section header while
1637	writing the section constent, it might overwrite some sections.
1638	Restore the pointer afterwards.
1639	* elf32_updatenull.c (updatenull): If the offset of a section in a
1640	file changed make sure we read the section so that it'll be written
1641	out.
1642
1643	* elf_update.c: Remove debug message.
1644
16452005-12-07  Roland McGrath  <roland@redhat.com>
1646
1647	* gelf_xlate.c [! ALLOW_UNALIGNED] (union unaligned): New type.
1648	(FETCH, STORE): New macros.
1649	(INLINE3): Use those to do alignment-friendly conversion.
1650
1651	* elf32_getshdr.c: Include map_address and start_offset in alignment
1652	calculations.
1653	* elf32_getphdr.c: Likewise.
1654
16552005-11-19  Roland McGrath  <roland@redhat.com>
1656
1657	* elf.h: Update from glibc.
1658
16592005-11-17  Roland McGrath  <roland@redhat.com>
1660
1661	* elf.h: Update from glibc.
1662
16632005-11-10  Roland McGrath  <roland@redhat.com>
1664
1665	* elf.h: Update from glibc.
1666
16672005-09-09  Roland McGrath  <roland@redhat.com>
1668
1669	* elf_update.c (write_file): Stat the file and fchmod it after update
1670	if its mode had S_ISUID or S_ISGID bits set.
1671
16722005-08-28  Ulrich Drepper  <drepper@redhat.com>
1673
1674	* elf32_getphdr.c: Include <system.h>.  Use pread_retry instead of
1675	pread.  And branch prediction where useful.
1676	* elf_begin.c: Likewise.
1677	* elf_getdata.c: Likewise.
1678	* elf_getshstrndx.c: Likewise.
1679	* elf_readall.c: Likewise.
1680	* gelf_rawchunk.c: Likewise.
1681	* elf32_updatefile.c: Include <system.h>.  Use pread_retry instead of
1682	pread.  And branch prediction where useful.
1683	* elf_getarsym.c: Don't define pread_retry here.
1684
1685	* Makefile.am: Use $(LINK) not $(CC) when creating DSO.
1686	(%.os): Use COMPILE.os.
1687	(COMPILE.os): Filter out gconv options.
1688
16892005-08-27  Ulrich Drepper  <drepper@redhat.com>
1690
1691	* elf_begin.c (file_read_elf): Avoid reading ELF header from file
1692	again.  Instead accept additional parameter which points to it if we
1693	don't use mmap.
1694	(get_shnum): Use passed in e_ident value as source of ELF header.
1695
16962005-08-15  Ulrich Drepper  <drepper@redhat.com>
1697
1698	* elf_begin.c (__libelf_next_arhdr): Use TEMP_FAILURE_RETRY.
1699
1700	* Makefile (libelf_a_SOURCES): Add elf_getaroff.c.
1701	* libelf.map: Export elf_getaroff.
1702	* libelf.h: Declare elf_getaroff.
1703	* elf_getaroff.c: New file.
1704
17052005-08-13  Ulrich Drepper  <drepper@redhat.com>
1706
1707	* elf_begin.c (get_shnum): Optimize memory handling.  Always read from
1708	mapped file if available.  Fix access to 64-bit sh_size.  Recognize
1709	overflow.
1710	(file_read_elf): Likewise.
1711
17122005-08-12  Roland McGrath  <roland@redhat.com>
1713
1714	* elf32_offscn.c: Do not match empty sections at OFFSET unless
1715	there are no nonempty sections at that offset.
1716
17172005-08-07  Ulrich Drepper  <drepper@redhat.com>
1718
1719	* elf.h: Update from glibc.
1720
17212005-08-06  Ulrich Drepper  <drepper@redhat.com>
1722
1723	* Makefile.am (AM_CFLAGS): Add -fpic when BUILD_STATIC.
1724
17252005-08-03  Ulrich Drepper  <drepper@redhat.com>
1726
1727	* libelf.map: Move elf32_offscn, elf64_offscn, and gelf_offscn in
1728	new version ELFUTILS_1.1.1.
1729
17302005-08-02  Ulrich Drepper  <drepper@redhat.com>
1731
1732	* elf_error.c: Add handling of ELF_E_INVALID_OFFSET.
1733	* elf32_offscn.c: New file.
1734	* elf64_offscn.c: New file.
1735	* gelf_offscn.c: New file.
1736	* Makefile.am (libelf_a_SOURCES): Add elf32_offscn.c, elf64_offscn.c,
1737	and gelf_offscn.c.
1738	* libelf.sym: Export new symbols.
1739
17402005-07-23  Ulrich Drepper  <drepper@redhat.com>
1741
1742	* elf-knowledge.h (SECTION_STRIP_P): Don't handle removal of debug
1743	sections here anymore.
1744	* elf32_checksum.c: Adjust for change in SECTION_STRIP_P interface.
1745
1746	* elf_update.c (elf_update): Get write lock, not read lock.
1747
1748	* elf32_updatenull.c (updatenull): Get section headers if necessary
1749	and possible.
1750
17512005-07-22  Ulrich Drepper  <drepper@redhat.com>
1752
1753	* elf32_updatenull.c (updatenull): If program header hasn't been loaded
1754	yet, try to do it now.
1755	Don't unnecessarily update overflow of section count in zeroth section
1756	sh_size field.
1757	If section content hasn't been read yet, do it before looking for the
1758	block size.  If no section data present, infer size of section header.
1759
17602005-05-11  Ulrich Drepper  <drepper@redhat.com>
1761
1762	* elf.h: Update again.
1763
17642005-05-09  Ulrich Drepper  <drepper@redhat.com>
1765
1766	* elf.h: Update from glibc.
1767
17682005-05-08  Roland McGrath  <roland@redhat.com>
1769
1770	* elf_begin.c (read_file) [_MUDFLAP]: Don't use mmap for now.
1771	* elf_update.c (write_file) [_MUDFLAP]: Likewise.
1772
17732005-03-29  Ulrich Drepper  <drepper@redhat.com>
1774
1775	* elf32_checksum.c: Use INTUSE and INTDEF to avoid PLTs.
1776	* elf_end.c: Likewise.
1777	* elf_getdata.c: Likewise.
1778	* gelf_getehdr.c: Likewise.
1779	* nlist.c: Likewise.
1780	* libelfP.h: Add declarations of internal functions.
1781
17822005-02-15  Ulrich Drepper  <drepper@redhat.com>
1783
1784	* common.h (CONVERT): Make sure all values are unsigned.
1785	(CONVERT_TO): Likewise.
1786
1787	* Makefile.am (AM_CFLAGS): Add -Wformat=2.
1788	Fix rule to build libelf.so.
1789
17902005-02-06  Ulrich Drepper  <drepper@redhat.com>
1791
1792	* Makefile.am: Cleanup AM_CFLAGS handling.  Add -Wunused -Wextra.
1793	Remove lint handling.
1794	* elf32_getphdr.c: Minor cleanups.
1795	* elf32_getshdr.c: Likewise.
1796	* elf32_updatefile.c: Likewise.
1797	* elf32_updatenull.c: Likewise.
1798	* elf_begin.c: Likewise.
1799	* elf_error.c: Likewise.
1800	* elf_getarsym.c: Likewise.
1801	* elf_getdata.c: Likewise.
1802	* elf_update.c: Likewise.
1803	* gelf_xlate.c: Likewise.
1804
18052005-02-05  Ulrich Drepper  <drepper@redhat.com>
1806
1807	* Makefile.am: Check for text relocations in constructed DSO.
1808
1809	* Makefile.am [MUDFLAP] (AM_CFLAGS): Add -Werror -fpic -fmudflap.
1810
18112005-02-04  Ulrich Drepper  <drepper@redhat.com>
1812
1813	* gelf_getehdr.c (gelf_getehdr): Slight optimization.
1814
1815	* elf32_checksum.c (checksum): Do not look at NOBITS sections.
1816
1817	* gelf.h: Add gelf_checksum prototype.
1818
18192004-09-25  Ulrich Drepper  <drepper@redhat.com>
1820
1821	* elf32_checksum.c: Make compile with gcc 4.0.
1822	* elf32_updatefile.c: Likewise.
1823	* elf32_updatenull.c: Likewise.
1824	* elf_begin.c: Likewise.
1825	* elf_error.c: Likewise.
1826	* elf_getdata.c: Likewise.
1827	* elf_getident.c: Likewise.
1828
18292004-04-01  Ulrich Drepper  <drepper@redhat.com>
1830
1831	* elf.h: Update from glibc.
1832
18332004-01-23  Ulrich Drepper  <drepper@redhat.com>
1834
1835	* elf_update.c: Fix locking.
1836	* elf_clone.c: Likewise.
1837
1838	* libelf.h: Define ELF_T_LIB.
1839	* gelf_getlib.c: New file.
1840	* gelf_update_lib.c: New file.
1841	* gelf.h: Declare the new functions.  Define GElf_Lib.
1842	* abstract.h: Define Lib, Lib32, Lib64.
1843	* gelf_xlate.c (__elf_xfctstom): Add ELF_T_LIB entry.
1844	* gelf_xlate.h: Add entry for ElfXX_Lib.
1845	* elf_getdata.c: Recognize SHT_GNU_LIBLIST as a known section type.
1846	* libelf.map: Add new symbols to ELFUTILS_1.1.
1847	* Makefile.am (libelf_a_SOURCES): Add gelf_getlib.c and
1848	gelf_update_lib.c.
1849
18502004-01-17  Ulrich Drepper  <drepper@redhat.com>
1851
1852	* Makefile.am: Support building with mudflap.
1853
1854	* gelf_xlate.c (INLINE3): Avoid using cast as lvalue.
1855	* dl-hash.h (_dl_elf_hash): Likewise.
1856
18572004-01-05  Ulrich Drepper  <drepper@redhat.com>
1858
1859	* elf-knowledge.h: New file.  From libelf subdir.
1860	* Makefile.am (euincludedir): Define.
1861	(euinclude_HEADERS): Add elf-knowledge.h.
1862
18632003-09-24  Ulrich Drepper  <drepper@redhat.com>
1864
1865	* elf.h: Define some PT_IA_64_HP_* constants.
1866
18672003-09-23  Jakub Jelinek  <jakub@redhat.com>
1868
1869	* libelfP.h (struct Elf): Move state.elf64.sizestr_offset after
1870	state.elf64.scnincr to match state.elf{,32}.
1871
18722003-08-12  Ulrich Drepper  <drepper@redhat.com>
1873
1874	* elf32_updatefile.c (__updatemmap): When writing back file where
1875	some sections have not been read in, count their sizes based on
1876	the section header.
1877
18782003-08-11  Ulrich Drepper  <drepper@redhat.com>
1879
1880	* Moved to CVS archive.
1881