b17e1c5e52cb59d38282cc04875011ac83852e70
[platform/upstream/elfutils.git] / libelf / ChangeLog
1 2017-07-19  Gustavo Romero <gromero@linux.vnet.ibm.com>
2
3         * elf.h: Add known type in notes segment descriptor for HTM SPRs.
4
5 2017-02-17  Ulf hermann  <ulf.hermann@qt.io>
6
7         * Makefile.am: Add libelf_so_DEPS, which include libeu.a,
8         libelf_so_LIBS.
9         (libelf_so_LDLIBS): Add $(libelf_so_DEPS).
10         (libelf.so$(EXEEXT): Use $(libelf_so_LIBS), require libelf.map
11         from the right directory.
12
13 2017-04-20  Ulf Hermann  <ulf.hermann@qt.io>
14
15         * libelfP.h: Don't include config.h.
16
17 2017-04-20  Ulf Hermann  <ulf.hermann@qt.io>
18
19         * elf_begin.c: Use F_GETFD rather than F_GETFL.
20
21 2017-04-20  Ulf Hermann  <ulf.hermann@qt.io>
22
23         * libelf.h: Define macros for various function attributes and use
24         them.
25
26 2017-04-20  Ulf Hermann  <ulf.hermann@qt.io>
27
28         * elf_update.c: Set ELF_F_MMAPPED flag if we mmap from elf_update.
29
30 2017-04-19  Mark Wielaard  <mark@klomp.org>
31
32         * elf_getarsym.c (elf_getarsym): Initialize n to zero.
33
34 2017-03-27  Mark Wielaard  <mark@klomp.org>
35
36         * elf32_updatefile.c (updatemmap): Always update last_positition.
37         (updatefile): Likewise.
38
39 2017-03-24  Mark Wielaard  <mark@klomp.org>
40
41         * elf_compress.c (__libelf_decompress): Check insane compression
42         ratios before trying to allocate output buffer.
43
44 2016-10-11  Akihiko Odaki  <akihiko.odaki.4i@stu.hosei.ac.jp>
45             Mark Wielaard  <mjw@redhat.com>
46
47         * gelf.h (gelf_newehdr): Change return type to void *.
48         (gelf_newphdr): Likewise.
49         * gelf_newehdr.c (gelf_newehdr): Likewise.
50         * gelf_newphdr.c (gelf_newphdr): Likewise.
51
52 2016-10-21  Mark Wielaard  <mjw@redhat.com>
53
54         * elf_getdata.c (__libelf_set_rawdata_wrlock): Sanity check
55         offset and size before trying to malloc and read data.
56
57 2016-10-26  Mark Wielaard  <mjw@redhat.com>
58
59         * elf_begin.c (read_file): Always set maxsize when parent == NULL.
60
61 2016-10-11  Akihiko Odaki  <akihiko.odaki.4i@stu.hosei.ac.jp>
62
63         * elf_getarsym.c (elf_getarsym): Open code rawmemchr when not
64         available.
65         * elf_strptr.c: Include stdbool.h.
66         (validate_str): New function.
67         (elf_strptr): Use validate_str instead of memrchr.
68
69 2016-10-11  Akihiko Odaki  <akihiko.odaki.4i@stu.hosei.ac.jp>
70
71         * elf32_updatefile.c: Remove sys/param.h include.
72         * elf32_updatenull.c: Likewise. Add system.h include.
73         * elf_begin.c: Remove sys/param.h.
74         * elf_compress: Likewise. Add system.h include.
75         (MAX): Remove definition.
76
77 2016-08-07  Mark Wielaard  <mjw@redhat.com>
78
79         * elf_compress.c (__libelf_reset_rawdata): Check scn->flags and
80         free rawdata_base when malloced. Set ELF_F_MALLOCED for scn->flags.
81         * elf_end.c (elf_end): Check scn->flags and free rawdata_base if
82         malloced.
83         * libelfP.h (struct Elf_Scn): Document flags ELF_F_MALLOCED usage.
84
85 2016-07-06  Mark Wielaard  <mjw@redhat.com>
86
87         * elf-knowledge.h (SH_FLAGS_COMBINE): Removed.
88         (SH_FLAGS_IMPORTANT): Likewise.
89
90 2016-07-06  Mark Wielaard  <mjw@redhat.com>
91
92         * elf32_updatenull.c (updatenull_wrlock): Ignore e_type when
93         updating phdrs.
94         * elf_getphdrnum.c (__elf_getphdrnum_chk_rdlock): Only do sanity
95         checking if phdrs haven't been read in yet.
96
97 2016-06-24  John Ogness  <john.ogness@linutronix.de>
98
99         * elf32_updatenull.c (updatenull_wrlock): Find first section.
100         * elf_nextscn.c (elf_nextscn): When scn is NULL start from 0th
101         section.
102
103 2016-06-28  Richard Henderson  <rth@redhat.com>
104
105         * elf.h: Update from glibc.  Add lots of new EM_* definitions.
106
107 2016-04-14  Mark Wielaard  <mjw@redhat.com>
108
109         * elf_compress.c (__libelf_compress): Free out_buf if deflateInit
110         fails.
111
112 2016-02-13  Mark Wielaard  <mjw@redhat.com>
113
114         * elf32_updatefile.c (updatemmap): Free scns when out of memory.
115
116 2016-01-28  Mark Wielaard  <mjw@redhat.com>
117
118         * elf.h: Update from glibc. Add new i386 and x86_64 relocations.
119
120 2016-02-12  Mark Wielaard  <mjw@redhat.com>
121
122         * elf.h: Update from glibc. Add NT_ARM_SYSTEM_CALL.
123
124 2016-02-04  Mark Wielaard  <mjw@redhat.com>
125
126         * elf_getdata.c (__libelf_set_rawdata_wrlock): Don't adjust align
127         for SHT_NOBITS sections.
128
129 2016-01-22  Chih-Hung Hsieh <chh@google.com>
130
131         * elf_compress.c (__libelf_compress): Move nested function
132         'do_deflate_cleanup' to file scope to compile with clang.
133         * elf_strptr.c (elf_strptr): Move nested function 'get_zdata'
134         to file scope to compile with clang.
135
136 2016-01-13  Mark Wielaard  <mjw@redhat.com>
137
138         * libelf.h: Check SHF_COMPRESSED is defined. If not define it and the
139         associated ELF compression types/defines.
140
141 2015-11-26  Mark Wielaard  <mjw@redhat.com>
142
143         * elf_compress.c (__libelf_decompress_elf): New function, extracted
144         from...
145         (elf_compress): here. Check zdata_base use __libelf_decompress_elf.
146         * elf_strptr.c (elf_strptr): If SHF_COMPRESSED check, uncompress and
147         use zdata.
148         * libelfP.h (struct Elf_Scn): Add zdata_size and zdata_align.
149         (__libelf_decompress_elf): New internal function definition.
150
151 2015-10-21  Mark Wielaard  <mjw@redhat.com>
152
153         * Makefile.am (libelf_a_SOURCES): Add elf_compress.c and
154         elf_compress_gnu.c.
155         * elf_compress.c: New file.
156         * elf_compress_gnu.c: Likewise.
157         * elf_begin.c (file_read_elf): Make a writable copy of the shdrs
158         for ELF_C_READ_MMAP.
159         * elf_end.c (elf_end): Free zdata_base.
160         * elf_error.c: Add ELF_E_ALREADY_COMPRESSED,
161         ELF_E_UNKNOWN_COMPRESSION_TYPE, ELF_E_COMPRESS_ERROR and
162         ELF_E_DECOMPRESS_ERROR.
163         * elf_data.c (__libelf_data_type): New internal function extracted
164         from convert_data.
165         (convert_data): Handle SHF_COMPRESSED.
166         * elf32_updatenull.c (updatenull_wrlock): Check sh_entsize against
167         uncompressed section data size if SHF_COMPRESSED.
168         * elf32_getshdr.c (load_shdr_wrlock): Adjust assert to account for
169         ELF_C_READ_MMAP.
170         * libelf.h: Define elf_compress and elf_compress_gnu.
171         * libelf.map (ELFUTILS_1.7): Add elf_compress and elf_compress_gnu.
172         * libelfP.h: Add ELF_E_ALREADY_COMPRESSED,
173         ELF_E_UNKNOWN_COMPRESSION_TYPE, ELF_E_COMPRESS_ERROR and
174         ELF_E_DECOMPRESS_ERROR. Define __libelf_data_type.
175         (__libelf_compress): New internal function definition.
176         (__libelf_decompress): Likewise.
177         (__libelf_reset_rawdata): Likewise.
178         (__libelf_data_type): Likewise.
179         (struct Elf_Scn): Add zdata_base.
180
181 2015-11-19  Mark Wielaard  <mjw@redhat.com>
182
183         * Makefile.am (libelf_a_SOURCES): Add elf32_getchdr.c,
184         elf64_getchdr.c and gelf_getchdr.c.
185         (noinst_HEADERS): Add chdr_xlate.h.
186         * abstract.h: Define Chdr32 and Chdr64.
187         * chdr_xlate.h: New file.
188         * elf32_getchdr.c: New file.
189         * elf64_getchdr.c: New file.
190         * elf_error.c: Add ELF_E_NOT_COMPRESSED, ELF_E_INVALID_SECTION_TYPE
191         and ELF_E_INVALID_SECTION_FLAGS.
192         * elf_getdata.c (__libelf_set_rawdata_wrlock): Set d_type to
193         ELF_T_CHDR for SHF_COMPRESSED sections.
194         * exttypes.h: Add Chdr32 and Chdr64.
195         * gelf.h (GElf_Chdr): New typedef.
196         (gelf_getchdr): New function definition.
197         * gelf_fsize.c (__libelf_type_sizes): Add ELF_T_CHDR.
198         * gelf_getchdr.c: New file.
199         * gelf_xlate.c (__elf_xfctstom): Add ELF_T_CHDR cvt_chdr.
200         * gelf_xlate.h: Add Chdr.
201         * libelf.h (Elf_Type): Add ELF_T_CHDR.
202         (elf32_getchdr): New function definition.
203         (elf64_getchdr): Likewise.
204         * libelf.map (ELFUTILS_1.7): New sections add elf32_getchdr,
205         elf64_getchdr and gelf_getchdr.
206         * libelfP.h: Add ELF_E_NOT_COMPRESSED, ELF_E_INVALID_SECTION_TYPE
207         and ELF_E_INVALID_SECTION_FLAGS.
208
209 2015-10-16  Mark Wielaard  <mjw@redhat.com>
210
211         * Makefile.am (libelf_so_LDLIBS): Add -lz.
212
213 2015-10-14  Mark Wielaard  <mjw@redhat.com>
214
215         * elf.h: Update from glibc. Add section compression constants and
216         structures.
217
218 2015-10-20  Jose E. Marchesi  <jose.marchesi@oracle.com>
219
220         * elf_begin.c (get_shnum): Elf64_Shdr.sh_size is an Elf64_Xword.
221         Fix the size argument to pread_retry.
222
223 2015-10-13  Chih-Hung Hsieh  <chh@google.com>
224
225         * elf32_updatefile.c (__elfw2(LIBELFBITS,updatemmap)): Move nested
226         function 'fill_mmap' to file scope.
227         * elf_begin.c (elf_begin): Move nested function 'lock_dup_elf'
228         to file scope.
229
230 2015-10-09  Josh Stone  <jistone@redhat.com>
231
232         * libelf.h: Replace loff_t with int64_t throughout.
233
234 2015-10-05  Mark Wielaard  <mjw@redhat.com>
235
236         * elf_update.c (write_file): Only use posix_fallocate when using
237         mmap. Only report failure when errno is ENOSPC.
238
239 2015-10-09  Josh Stone  <jistone@redhat.com>
240
241         * libelfP.h (struct Elf): Replace off64_t with off_t.
242         * elf_getdata_rawchunk.c (elf_getdata_rawchunk): Likewise.
243
244 2015-10-05  Chih-Hung Hsieh <chh@google.com>
245
246         * elf_getarsym.c (elf_getarsym): Do not use
247         union of variable length arrays.
248
249 2015-10-05  Josh Stone  <jistone@redhat.com>
250
251         * Makefile.am (libelf.so): Add AM_V_CCLD and AM_V_at silencers.
252
253 2015-09-24  Jose E. Marchesi  <jose.marchesi@oracle.com>
254
255         * Makefile.am (AM_CFLAGS): Use -fPIC instead of -fpic to avoid
256         relocation overflows in some platforms.
257
258 2015-09-29  Mark Wielaard  <mjw@redhat.com>
259
260         * elf32_updatenull.c (default_ehdr): Set e_version when EV_NONE.
261         (updatenull_wrlock): Always set e_shentsize.
262
263 2015-09-23  Mark Wielaard  <mjw@redhat.com>
264
265         * elf32_getehdr.c (getehdr_wrlock): Mark as internal_function.
266         * elf32_getshdr.c (getshdr_rdlock): Likewise.
267         (getshdr_wrlock): Likewise.
268         * elf_error.c (__libelf_seterrno): Likewise.
269         * elf_getphdrnum.c (__elf_getphdrnum_rdlock): Likewise.
270         (__elf_getphdrnum_chk_rdlock): Likewise.
271         * elf_getshdrnum.c (__elf_getphdrnum_rdlock): Likewise.
272         (__elf_getphdrnum_chk_rdlock): Likewise.
273         * elf_getshdrnum.c (__elf_getshdrnum_rdlock): Likewise.
274         * elf_readall.c (__libelf_readall): Likewise.
275         * gelf_getehdr.c (__gelf_getehdr_rdlock): Likewise.
276
277 2015-09-22  Mark Wielaard  <mjw@redhat.com>
278
279         * *.c: Remove old-style function definitions.
280
281 2015-06-22  Mark Wielaard  <mjw@redhat.com>
282
283         * dl-hash.h: Update from glibc.
284
285 2015-06-18  Mark Wielaard  <mjw@redhat.com>
286
287         * elf32_updatefile.c (updatefile): Always free shdr_data and scns
288         when allocated on failure paths.
289
290 2015-06-18  Mark Wielaard  <mjw@redhat.com>
291
292         * nlist.c (nlist): Check symscn shdr exists before use.
293
294 2015-06-16  Mark Wielaard  <mjw@redhat.com>
295
296         * elf_update.c (write_file): Always also use ftruncate before
297         posix_fallocate to make sure file has the right size.
298
299 2015-06-04  Mark Wielaard  <mjw@redhat.com>
300
301         * elf_getdata.c (__libelf_type_aligns): Add entries for ELF_T_EHDR,
302         ELF_T_OFF, ELF_T_PHDR, ELF_T_SHDR, ELF_T_SWORD, ELF_T_XWORD,
303         ELF_T_SXWORD, ELF_T_GNUHASH, ELF_T_AUXV.
304         * elf_getdata_rawchunk.c (elf_getdata_rawchunk): Check alignment
305         of rawdata against requested type.
306
307 2015-06-02  Mark Wielaard  <mjw@redhat.com>
308
309         * elf_getdata.c (convert_data): Make sure source data is properly
310         aligned for type before calling actual conversion function.
311
312 2015-06-04  Mark Wielaard  <mjw@redhat.com>
313
314         * elf_begin.c (get_shnum): Check alignment of Shdr, not Ehdr before
315         direct access.
316
317 2015-06-02  Mark Wielaard  <mjw@redhat.com>
318
319         * elf_begin.c (file_read_elf): Split checks for ehdr and shdr
320         alignment, drop phdr alignment check.
321
322 2015-05-31  Mark Wielaard  <mjw@redhat.com>
323
324         * elf32_getshdr.c (load_shdr_wrlock): Allocate shdrs with malloc,
325         not alloca and free after conversion when a copy needs to be made.
326
327 2015-05-31  Mark Wielaard  <mjw@redhat.com>
328
329         * elf32_getphdr.c (getphdr_wrlock): Allocate phdrs with malloc, not
330         alloca and free after conversion when a copy needs to be made.
331
332 2015-05-31  Mark Wielaard  <mjw@redhat.com>
333
334         * elf_getarsym.c (elf_getarsym): Allocate temporary file_date with
335         malloc, not alloca also in !ALLOW_UNALIGNED case.
336
337 2015-05-30  Mark Wielaard  <mjw@redhat.com>
338
339         * gelf_xlate.c (elf_cvt_Byte): Only call memmove with non-zero size.
340
341 2015-05-30  Mark Wielaard  <mjw@redhat.com>
342
343         * elf32_updatefile.c (updatemmap): Only call mempcpy and update
344         last_position when d_size is non-zero.
345
346 2015-05-17  Mark Wielaard  <mjw@redhat.com>
347
348         * elf32_updatefile.c (updatefile): Allocate shdr_data and scns
349         with malloc, not alloca. Free after writing section headers.
350
351 2015-05-16  Mark Wielaard  <mjw@redhat.com>
352
353         * elf32_updatefile.c (updatemmap): Allocate temporary shdr storage
354         with malloc, not alloca. Free after writing section header.
355
356 2015-05-16  Mark Wielaard  <mjw@redhat.com>
357
358         * elf_getarsym.c (elf_getarsym): Allocate temporary file_date with
359         malloc, not alloca. Call free after out.
360
361 2015-05-14  Mark Wielaard  <mjw@redhat.com>
362
363         * elf_update.c (write_file): Use posix_fallocate instead of
364         ftruncate to extend file if necessary.
365
366 2015-05-13  Mark Wielaard  <mjw@redhat.com>
367
368         * elf32_updatenull.c (default_ehdr): If e_phnum is zero then set
369         e_phoff also to zero.
370
371 2015-05-12  Mark Wielaard  <mjw@redhat.com>
372
373         * elf32_updatenull.c (updatenull_wrlock): Check that sh_addralign
374         is a powerof2.
375         * elf_getdata.c (__libelf_set_rawdata_wrlock): Clamp large d_aligns
376         to the elf image offset.
377
378 2015-05-12  Mark Wielaard  <mjw@redhat.com>
379
380         * elf32_newphdr.c (newphdr): Call __libelf_seterrno with
381         ELF_E_INVALID_INDEX before failing. Check whether section zero shdr
382         actually exists if we need to put extended phnum in section zero.
383
384 2015-05-08  Mark Wielaard  <mjw@redhat.com>
385
386         * nlist.c (nlist): Call gelf_fsize with EV_CURRENT.
387
388 2015-01-03  Mark Wielaard  <mjw@redhat.com>
389
390         * version_xlate.h (elf_cvt_Verdef): Use memmove to copy src to dest.
391         (elf_cvt_Verneed): Likewise.
392
393 2015-03-28  Mark Wielaard  <mjw@redhat.com>
394
395         * elf.h: Update from glibc.
396
397 2015-03-23  Mark Wielaard  <mjw@redhat.com>
398
399         * elf32_updatenull.c (updatenull_wrlock): Don't extend size with
400         SHT_NOBITS sh_offset.
401
402 2015-02-18  Mark Wielaard  <mjw@redhat.com>
403
404         * libelfP.h (__libelf_set_data_list_rdlock): Make internal_function.
405
406 2015-02-07  Jan Kratochvil  <jan.kratochvil@redhat.com>
407
408         * elf32_updatenull.c (__elfw2(LIBELFBITS,updatenull_wrlock)): Consider
409         sh_addralign 0 as 1.
410
411 2015-01-22  Mark Wielaard  <mjw@redhat.com>
412
413         * elf_strptr (elf_strptr): Make sure returned string is NUL
414         terminated.
415
416 2015-01-21  Mark Wielaard  <mjw@redhat.com>
417
418         * elf_strptr.c (elf_strptr): Check data_list_rear == NULL instead
419         of rawdata_base != NULL before using rawdata directly.
420
421 2015-01-20  Mark Wielaard  <mjw@redhat.com>
422
423         * libelfP.h (__elf_strptr_internal): New function declaration.
424         * elf_getdata.c (__libelf_set_data_list_rdlock): New internal
425         function extracted from...
426         (__elf_getdata_rdlock): ... here.
427         * elf_newdata.c (elf_newdata): Check scn->rawdata_base and update
428         datalist if necessary.
429
430 2015-01-20  Mark Wielaard  <mjw@redhat.com>
431
432         * elf_strptr.c (elf_strptr): Call __elf[32|64]_getshdr_rdlock if
433         necessary.
434
435 2014-12-30  Mark Wielaard  <mjw@redhat.com>
436
437         * elf_getphdrnum.c (__elf_getphdrnum_chk_rdlock): New function.
438         (elf_getphdrnum): Call __elf_getphdrnum_chk_rdlock.
439         * gelf_getphdr (gelf_getphdr): Call __elf_getphdrnum_chk_rdlock
440         and always check ndx against phnum.
441         * libelfP.h (__elf_getphdrnum_chk_rdlock): New internal function.
442
443 2014-12-25  Mark Wielaard  <mjw@redhat.com>
444
445         * elf_begin.c (__libelf_next_arhdr_wrlock): ar_size cannot be
446         negative. Include start_offset in maxsize.
447
448 2014-12-28  Alexander Cherepanov  <cherepan@mccme.ru>
449
450         * elf_begin.c (read_long_names): Don't miss '/' right after
451         another '/'. Fixes a dir traversal vuln in ar extraction.
452
453 2014-12-18  Ulrich Drepper  <drepper@gmail.com>
454
455         * Makefile.am: Suppress output of textrel_check command.
456
457 2014-12-16  Mark Wielaard  <mjw@redhat.com>
458
459         * elf_begin.c (read_long_names): Make sure long_names len fits
460         in mapped ELF file.
461
462 2014-12-15  Mark Wielaard  <mjw@redhat.com>
463
464         * elf_getarsym.c (elf_getarsym): Check index_size doesn't overflow.
465
466 2014-12-15  Mark Wielaard  <mjw@redhat.com>
467
468         * elf_begin.c (read_long_names): Clear any garbage left in the
469         name table.
470
471 2014-12-11  Mark Wielaard  <mjw@redhat.com>
472
473         * elf_begin.c (file_read_elf): Correct ELF64 section offset check.
474
475 2014-12-11  Mark Wielaard  <mjw@redhat.com>
476
477         * elf_begin.c (read_long_names): Check for offset overflow.
478         (__libelf_next_arhdr_wrlock): Likewise. Sanity check the ar_size.
479         Don't allow it to go beyond end of file.
480
481 2014-12-09  Mark Wielaard  <mjw@redhat.com>
482
483         * elf_getarsym.c (elf_getarsym): Make sure n * w doesn't overflow.
484
485 2014-11-27  Mark Wielaard  <mjw@redhat.com>
486
487         * Makefile.am (libelf.so): Use textrel_check.
488
489 2014-11-23  Mark Wielaard  <mjw@redhat.com>
490
491         * elf_getdata_rawchunk.c (elf_getdata_rawchunk): Change signed
492         overflow check to unsigned.
493
494 2014-11-23  Mark Wielaard  <mjw@redhat.com>
495
496         * note_xlate.h (elf_cvt_note): Copy over any leftover data if
497         src != dest. The data is probably part of truncated name/desc.
498
499 2014-11-22  Mark Wielaard  <mjw@redhat.com>
500
501         * elf_getphdrnum.c (elf_getphdrnum): Sanity check the
502         __elf_getphdrnum_rdlock result.
503
504 2014-11-18  Mark Wielaard  <mjw@redhat.com>
505
506         * version_xlate.h (elf_cvt_Verdef): Check for overflow.
507         (elf_cvt_Verneed): Likewise.
508
509 2014-11-17  Mark Wielaard  <mjw@redhat.com>
510
511         * elf-knowledge.h (SECTION_STRIP_P): Check name is not NULL.
512
513 2014-11-16  Mark Wielaard  <mjw@redhat.com>
514
515         * elf_getshdrstrndx.c: Check there are section headers before
516         handling SHN_XINDEX.
517
518 2014-11-16  Mark Wielaard  <mjw@redhat.com>
519
520         * elf32_getphdr.c (getphdr_wrlock): Check e_phoff isn't zero.
521         Check for too many pheaders.
522         * elf_getphdrnum.c (__elf_getphdrnum_rdlock): Check section zero
523         actually exists before handling PN_XNUM.
524
525 2014-11-16  Mark Wielaard  <mjw@redhat.com>
526
527         * gelf_getnote.c (gelf_getnote): Check padding overflow.
528
529 2014-11-16  Mark Wielaard  <mjw@redhat.com>
530
531         * elf_getdata.c (__libelf_set_rawdata_wrlock): Declare offset, size
532         and align as Elf64_Off and Elf64_Xword not size_t.
533
534 2014-11-14  Mark Wielaard  <mjw@redhat.com>
535
536         * gelf_getnote.c (gelf_getnote): Check offset overflow.
537
538 2014-11-13  Mark Wielaard  <mjw@redhat.com>
539
540         * elf_getdata.c (__libelf_set_rawdata_wrlock): Fix unsigned overflow
541         check.
542
543 2014-11-08  Mark Wielaard  <mjw@redhat.com>
544
545         * elf_begin.c (__libelf_next_arhdr_wrlock): Use mempcpy not __mempcpy.
546
547 2014-11-07  Mark Wielaard  <mjw@redhat.com>
548
549         * elf_begin.c (file_read_elf): Correct sh_size check.
550         * elf_getdata.c (__libelf_set_rawdata_wrlock): Check for unsigned
551         overflow.
552
553 2014-09-10  Petr Machata  <pmachata@redhat.com>
554
555         * elf_begin (read_unmmaped_file): Call __libelf_seterrno if the
556         file is unreadable.
557
558 2014-07-07  Mark Wielaard  <mjw@redhat.com>
559
560         * elf.h: Update from glibc.
561
562 2014-04-13  Mark Wielaard  <mjw@redhat.com>
563
564         * Makefile.am: Remove !MUDFLAP conditions.
565         * elf_begin.c (read_file): Don't clear use_mmap when _MUDFLAP is
566         defined.
567         * elf_update.c (write_file): Remove _MUDFLAP condition.
568
569 2014-01-17  Jakub Jelinek  <jakub@redhat.com>
570             Roland McGrath  <roland@redhat.com>
571
572         * libelfP.h (INVALID_NDX): Define.
573         * gelf_getdyn.c (gelf_getdyn): Use it.  Remove ndx < 0 test if any.
574         * gelf_getlib.c (gelf_getlib): Likewise.
575         * gelf_getmove.c (gelf_getmove): Likewise.
576         * gelf_getrel.c (gelf_getrel): Likewise.
577         * gelf_getrela.c (gelf_getrela): Likewise.
578         * gelf_getsym.c (gelf_getsym): Likewise.
579         * gelf_getsyminfo.c (gelf_getsyminfo): Likewise.
580         * gelf_getsymshndx.c (gelf_getsymshndx): Likewise.
581         * gelf_getversym.c (gelf_getversym): Likewise.
582         * gelf_update_dyn.c (gelf_update_dyn): Likewise.
583         * gelf_update_lib.c (gelf_update_lib): Likewise.
584         * gelf_update_move.c (gelf_update_move): Likewise.
585         * gelf_update_rel.c (gelf_update_rel): Likewise.
586         * gelf_update_rela.c (gelf_update_rela): Likewise.
587         * gelf_update_sym.c (gelf_update_sym): Likewise.
588         * gelf_update_syminfo.c (gelf_update_syminfo): Likewise.
589         * gelf_update_symshndx.c (gelf_update_symshndx): Likewise.
590         * gelf_update_versym.c (gelf_update_versym): Likewise.
591
592 2014-01-17  Jakub Jelinek  <jakub@redhat.com>
593
594         * elf32_getphdr.c (elfw2(LIBELFBITS,getphdr)): Check if program header
595         table fits into object's bounds.
596         * elf_getshdrstrndx.c (elf_getshstrndx): Add elf->start_offset to
597         elf->map_address.  Check if first section header fits into object's
598         bounds.
599         * elf32_getshdr.c (elfw2(LIBELFBITS,getshdr)):
600         Check if section header table fits into object's bounds.
601         * elf_begin.c (get_shnum): Ensure section headers fits into
602         object's bounds.
603         (file_read_elf): Make sure scncnt is small enough to allocate both
604         ElfXX_Shdr and Elf_Scn array.  Make sure section and program header
605         tables fit into object's bounds.  Avoid memory leak on failure.
606         * elf_newscn.c (elf_newscn): Check for overflow.
607         * elf32_updatefile.c (__elfw2(LIBELFBITS,updatemmap)): Likewise.
608         (__elfw2(LIBELFBITS,updatefile)): Likewise.
609         * elf32_newphdr.c (elfw2(LIBELFBITS,newphdr)): Likewise.
610         * elf_getarsym.c (elf_getarsym): Likewise.
611
612 2013-11-08  Mark Wielaard  <mjw@redhat.com>
613
614         * elf32_updatefile.c (elfXX_updatemmap): Only memcpy ehdr when not
615         already directly mmapped.
616
617 2013-11-05  Mark Wielaard  <mjw@redhat.com>
618
619         * elf32_updatefile.c (elfXX_updatefile): Copy all section headers
620         if elf->flags dirty.
621
622 2013-11-01  Michael Forney  <mforney@mforney.org>
623
624         * Makefile.am: Use READELF.
625
626 2013-10-01  Petr Machata  <pmachata@redhat.com>
627
628         * elf.h: Update from glibc.
629
630 2013-06-17  Petr Machata  <pmachata@redhat.com>
631
632         * elf.h: Update from glibc.
633
634 2013-08-28  Namhyung Kim  <namhyung@gmail.com>
635
636         * gelf.h (gelf_fsize): Fix typo in comment.
637
638 2013-08-28  Mark Wielaard  <mjw@redhat.com>
639
640         * gelf_getauxv.c (gelf_getauxv): Add missing whitespace.
641
642 2013-08-27  Mark Wielaard  <mjw@redhat.com>
643
644         * gelf_getauxv.c (gelf_getauxv): Remove unnecessary casts to char *.
645
646 2013-08-25  Kurt Roeckx  <kurt@roeckx.be>
647
648         * gelf_getauxv.c (gelf_getauxv): Use memcpy instead of pointer
649         dereference to avoid alignment problems.
650
651 2013-01-07  Roland McGrath  <roland@hack.frob.com>
652
653         * elf_getarsym.c (elf_getarsym): Copy FILE_DATA into stack space if it
654         would be unaligned and !ALLOW_UNALIGNED.
655
656         * elf_getarsym.c (read_number_entries): Use memcpy instead of pointer
657         dereference so as not to assume the field is naturally aligned.
658
659 2012-09-17  Petr Machata  <pmachata@redhat.com>
660
661         * elf.h: Update from glibc.
662
663 2012-08-16  Roland McGrath  <roland@hack.frob.com>
664
665         * elf.h: Update from glibc.
666
667 2012-08-14  Mark Wielaard  <mjw@redhat.com>
668
669         * elf32_checksum.c (ebl_debugscn_p): Removed unused define and
670         confusing outdated comment.
671
672 2012-08-01  Petr Machata  <pmachata@redhat.com>
673
674         * elf_getarsym (read_number_entries): New function.
675         (elf_getarsym): Handle 64-bit symbol table, stored in special
676         entry named "/SYM64/".
677         * elf_begin.c (__libelf_next_arhdr_wrlock): Don't reject archive
678         because it contains 64-bit symbol table.
679
680 2012-07-19  Mark Wielaard  <mjw@redhat.com>
681
682         * elf32_getshdr.c (load_shdr_wrlock): Add elf->flags & ELF_F_MALLOCED
683         to asserts.
684
685 2012-07-17  Petr Machata  <pmachata@redhat.com>
686
687         * elf32_xlatetom.c (elfw2(LIBELFBITS, xlatetom)): Do not check for
688         integer number of records in case of ELF_T_NHDR.
689
690 2012-04-02  Mark Wielaard  <mjw@redhat.com>
691
692         * elf32_offscn.c: Do not match SHT_NOBITS sections at OFFSET unless
693         there are no nonempty sections at that offset.
694
695 2012-03-21  Roland McGrath  <roland@hack.frob.com>
696
697         * elf-knowledge.h (SECTION_STRIP_P): Remove < SHT_NUM check.
698
699 2011-02-26  Mark Wielaard  <mjw@redhat.com>
700
701         * elf_end.c (elf_end): Call rwlock_unlock before rwlock_fini.
702
703 2011-01-05  Jan Kratochvil  <jan.kratochvil@redhat.com>
704
705         * elf_getdata_rawchunk.c (elf_getdata_rawchunk): Fix off64_t overflow
706         when MAXIMUM_SIZE == ~0.
707
708 2010-08-18  Roland McGrath  <roland@redhat.com>
709
710         * gelf_fsize.c (__libelf_type_sizes): Add entries for ELF_T_LIB
711         and ELF_T_GNUHASH.
712         Reported by Mark Hatle <mark.hatle@windriver.com>.
713
714         * exttypes.h: Add cases for ElfNN_Lib.
715         Reported by Mark Hatle <mark.hatle@windriver.com>.
716
717 2010-06-14  Ulrich Drepper  <drepper@redhat.com>
718
719         * gelf_update_shdr.c: Implicitly set ELF_F_DIRTY bit.
720         * gelf_update_phdr.c: Likewise.
721         * gelf_update_ehdr.c: Likewise.
722
723 2010-04-14  Roland McGrath  <roland@redhat.com>
724
725         * elf32_getphdr.c: Check for e_phoff/size outside the file bounds.
726         * elf_begin.c (file_read_elf): Don't set .phdr here.
727
728 2010-04-13  Roland McGrath  <roland@redhat.com>
729
730         * elf.h: Update from glibc.
731
732 2010-04-06  Roland McGrath  <roland@redhat.com>
733
734         * elf_error.c (ELF_E_FD_MISMATCH_IDX): Avoid nonobvious abbreviation
735         in error message.
736
737 2010-04-01  Petr Machata  <pmachata@redhat.com>
738
739         * elf_getdata.c (__elf_getdata_rdlock): Initialize data.s for data
740         that do not need a conversion.
741
742 2010-03-11  Roland McGrath  <roland@redhat.com>
743
744         * elf.h: Update from glibc.
745
746 2010-03-04  Ulrich Drepper  <drepper@redhat.com>
747
748         * elf.h: Update from glibc.
749
750 2010-02-17  Roland McGrath  <roland@redhat.com>
751
752         * elf_begin.c (file_read_elf): Leave section rawdata_base and
753         data_base pointers null when [sh_offset,sh_size) points outside
754         the mapped file.
755
756 2010-02-15  Roland McGrath  <roland@redhat.com>
757
758         * Makefile.am: Use config/eu.am for common stuff.
759
760 2010-01-07  Roland McGrath  <roland@redhat.com>
761
762         * elf32_getphdr.c: Use __elf_getphdrnum_rdlock.
763         * gelf_getphdr.c: Likewise.
764         * gelf_update_phdr.c: Likewise.
765         * elf32_updatefile.c (__elf32_updatemmap, __elf32_updatefile): Likewise.
766         * elf32_updatenull.c (__elf32_updatenull_wrlock): Likewise.
767         * elf32_newphdr.c: Clear section 0's sh_info when resetting e_phnum.
768         If COUNT is too large, use store PN_XNUM instead and set sh_info.
769         * elf_begin.c (file_read_elf): Always allocate space we can use later
770         for section 0 if doing RDWR.
771
772         * elf_getphdrnum.c: New file.
773         * Makefile.am (libelf_a_SOURCES): Add it.
774         * libelf.h: Declare elf_getphdrnum.
775         * libelfP.h: Declare __elf_getphdrnum_rdlock.
776         * libelf.map (ELFUTILS_1.6): New set, add elf_getphdrnum.
777
778         * elf.h: Update from glibc.
779
780 2009-10-23  Lubomir Rintel  <lkundrak@v3.sk>
781
782         * elf32_updatefile.c (fill_mmap): When starting past shdr_end, start
783         filling from section start, not shdr_end.
784
785 2009-11-10  Roland McGrath  <roland@redhat.com>
786
787         * elf_readall.c (__libelf_readall): Fetch file size if not yet known.
788
789 2009-11-06  Mark Wielaard  <mjw@redhat.com>
790
791         * elf_next.c (elf_next): Mark the archive header as unusable when
792         there is no next ar element.
793
794 2009-08-12  Mark Wielaard  <mjw@redhat.com>
795
796         * Makefile.am (libelf.so): Use -Wl,-z,defs not -defs.
797
798 2009-07-26  Ulrich Drepper  <drepper@redhat.com>
799
800         * elf.h: Update from glibc.
801
802 2009-07-21  Ulrich Drepper  <drepper@redhat.com>
803
804         * elf32_updatefile.c (__elfXX_updatemmap): Fix handling of gaps between
805         sections.  Patch by Lubomir Rintel <lkundrak@v3.sk>.
806
807 2009-07-08  Roland McGrath  <roland@redhat.com>
808
809         * libelfP.h (struct Elf): Remove unused ar.has_index field.
810         Reorder various members for optimal packing.
811
812 2009-07-08  Ulrich Drepper  <drepper@redhat.com>
813
814         * elf.h: Update from glibc.
815
816 2009-06-13  Ulrich Drepper  <drepper@redhat.com>
817
818         * Makefile.am (libelf_a_SOURCES): Replace elf_getshnum.c and
819         elf_getshstrndx.c with elf_getshdrnum.c and elf_getshdrstrndx.c.
820         * elf_getshnum.c: Renamed to...
821         * elf_getshdrnum.c: ...this.  Rename function and add old name as
822         alias.  Likewise for internal functions with derived names.
823         * elf_getshstrndx.c: Renamed to...
824         * elf_getshdrstrndx.c: ...this.  Rename function and add old name as
825         alias.  Likewise for internal functions with derived names.
826         * libelf.h: Add prototypes for new names.  Make old names as
827         deprecated.
828         * libelfP.h: Rename internal function prototypes.
829         * libelf.map: Export for names.
830         * elf32_checksum.c: Don't use deprecated functions.
831         * elf32_getshdr.c: Likewise.
832
833 2009-06-01  Ulrich Drepper  <drepper@redhat.com>
834
835         * elf.h: Update from glibc.
836
837 2009-04-14  Roland McGrath  <roland@redhat.com>
838
839         * elf.h: Update from glibc.
840
841 2009-04-01  Roland McGrath  <roland@redhat.com>
842
843         * elf.h: Update from glibc.
844
845 2009-02-10  Ulrich Drepper  <drepper@redhat.com>
846
847         * elf32_updatefile.c (updatefile): For the zeroth section we still
848         have to copy the section header.
849
850 2009-02-01  Ulrich Drepper  <drepper@redhat.com>
851
852         * elf_strptr.c: Add comment re possible problem.
853
854 2009-01-26  Ulrich Drepper  <drepper@redhat.com>
855
856         * elf32_updatenull.c (updatenull_wrlock): Fix comment of
857         ELF_F_LAYOUT behaviour re section header table.
858
859 2009-01-22  Ulrich Drepper  <drepper@redhat.com>
860
861         * elf32_updatefile.c (__elfXX_updatemmap): Fill the gap between
862         sections even if only the section at the start of the gap has been
863         changed.
864         (__elfXX_updatefile): Likewise.
865
866 2009-01-21  Ulrich Drepper  <drepper@redhat.com>
867
868         * elf32_updatefile.c (__elfXX_updatemmap): Skip most of the loop to
869         handle sections for NOBITS sections.
870         (elfXX_updatefile): Likewise.
871
872         * elf32_updatefile.c (__elfXX_updatemmap): When skipping non-NOBITS
873         sections we haven't loaded, update last_position based on scn_start,
874         not based on old value.  Don't run the loop for the dummy section 0.
875         (elfXX_updatefile): Don't run the loop for the dummy section 0.
876
877 2009-01-10  Ulrich Drepper  <drepper@redhat.com>
878
879         * libelfP.h (_): We only have one translation domain, elfutils.
880
881         * Makefile.am: Use USE_LOCKS instead of USE_TLS.
882         * elf_error.c: Always use __thread.  Remove all !USE_TLS code.
883
884 2009-01-04  Roland McGrath  <roland@redhat.com>
885
886         * note_xlate.h (elf_cvt_note): Don't examine a size too small to
887         container a note header.
888
889 2008-12-11  Roland McGrath  <roland@redhat.com>
890
891         * elf32_updatefile.c (__elfw2(LIBELFBITS,updatemmap)): Handle
892         placement offset going backwards, for out-of-order or overlapping
893         (bogus) sh_offset layouts.  It's a dumb use, but should not crash.
894         (__elfw2(LIBELFBITS,updatefile)): Likewise.
895         Fixes RHBZ#476136.
896
897         * libelf.h (Elf_Data): Whitespace fix.
898
899 2008-12-10  Roland McGrath  <roland@redhat.com>
900
901         * elf_getarhdr.c (elf_getarhdr): Fix missing rename in last change.
902
903 2008-10-22  Petr Machata  <pmachata@redhat.com>
904
905         * elf_rawfile.c (elf_rawfile): Lock around elf-> references.
906
907 2008-10-21  Petr Machata  <pmachata@redhat.com>
908
909         * libelfP.h: Rename getehdr_rdlock to getehdr_wrlock.
910         * elf32_getehdr.c (getehdr_rdlock): Move the code to new function
911         getehdr_impl and make it a wrapper.  Rename to getehdr_wrlock.
912         (getehdr_impl): Guard elf->class init with wrlock.
913         (getehdr): Also make it a wrapper of getehdr_impl.
914         * elf32_updatenull.c (updatenull_wrlock): Call getehdr_wrlock.
915
916 2008-10-20  Petr Machata  <pmachata@redhat.com>
917
918         * elf_getdata_rawchunk.c (elf_getdata_rawchunk): Lock around the
919         code that reads mutable elf state.  Relock to write lock to chain
920         the new chunk on the elf rawchunks list.
921
922 2008-10-20  Petr Machata  <pmachata@redhat.com>
923
924         * elf32_checksum.c (checksum): Place a lock around the code that
925         processes data.  Make it wrlock if the code needs to xlate the
926         data before processing.
927
928 2008-10-16  Petr Machata  <pmachata@redhat.com>
929
930         * elf_begin.c
931         (__libelf_next_arhdr): Rename to __libelf_next_arhdr_wrlock.
932         (dup_elf): Adjust the call.
933         (elf_begin): New local function lock_dup_elf.  Relocks the elf if
934         necessary before calling dup.  Call this instead of dup_elf.
935         * elf_getarhdr.c
936         (elf_getarhdr): Lock before calling __libelf_next_arhdr_wrlock.
937         * elf_next.c (elf_next): Likewise.
938         * elf_rand.c (elf_rand): Likewise.
939
940 2008-10-14  Petr Machata  <pmachata@redhat.com>
941
942         * elf_getdata.c (__elf_getdata_rdlock): Lock before converting.
943
944 2008-11-26  Roland McGrath  <roland@redhat.com>
945
946         * elf.h: Update from glibc.
947
948 2008-10-06  Roland McGrath  <roland@redhat.com>
949
950         * elf_getarhdr.c (elf_getarhdr): Return NULL when passed NULL.
951
952 2008-08-27  Roland McGrath  <roland@redhat.com>
953
954         * elf_begin.c (get_shnum): Avoid misaligned reads for matching endian.
955
956         * libelfP.h [!ALLOW_UNALIGNED] (__libelf_type_align): Fix CLASS index.
957
958 2008-08-25  Roland McGrath  <roland@redhat.com>
959
960         * Makefile.am (libelf_so_LDLIBS): New variable.
961         (libelf.so): Use it in the link.
962
963 2008-08-21  Petr Machata  <pmachata@redhat.com>
964
965         * elf_getdata.c, libelfP.h
966         (__elf_getdata_internal): Rename to __elf_getdata_rdlock.
967         (__libelf_set_rawdata_wrlock): New function.
968         (__libelf_set_rawdata): Make it a wrapper that calls *_wrlock.
969         * elf32_updatenull.c, libelfP.h
970         (__elfNN_updatenull): Rename to __elfNN_updatenull_wrlock.
971
972 2008-08-21  Petr Machata  <pmachata@redhat.com>
973
974         * elf32_getphdr.c, libelfP.h
975         (__elfNN_getphdr_internal): Drop.  Move __elfNN_getphdr_internal
976         code to __elfNN_getphdr_wrlock.
977         (__elfNN_getphdr_rdlock, __elfNN_getphdr_wrlock): New functions.
978         (__elfNN_getphdr_rdlock, __elfNN_getphdr_wrlock): Make these
979         wrappers of getphdr_impl.
980
981 2008-08-21  Petr Machata  <pmachata@redhat.com>
982
983         * elf32_getehdr.c, libelfP.h
984         (__elfNN_getehdr_internal): Rename to __elfNN_getehdr_rdlock.
985         * gelf_getehdr, libelfP.h:
986         (__gelf_getehdr_internal): Rename to __gelf_getehdr_rdlock.
987
988 2008-08-21  Petr Machata  <pmachata@redhat.com>
989
990         * elf32_getshdr.c
991         (__elfNN_getshdr_internal): Drop.
992         (load_shdr_wrlock, scn_valid): New functions, contain bits of
993         behaviour from __elfNN_getshdr_internal.
994         (__elfNN_getshdr_rdlock, __elfNN_getshdr_wrlock): Replacements for
995         dropped _internal functions above.
996         * elf_getshnum.c
997         (__elf_getshnum_internal): Rename to __elf_getshnum_rdlock.
998
999 2008-08-04  Petr Machata  <pmachata@redhat.com>
1000
1001         * libelfP.h (RWLOCK_RDLOCK, RWLOCK_WRLOCK, RWLOCK_UNLOCK): New macros.
1002
1003 2008-07-28  Roland McGrath  <roland@redhat.com>
1004
1005         * elf.h: Update from glibc.
1006
1007 2008-03-31  Roland McGrath  <roland@redhat.com>
1008
1009         * elf32_offscn.c: Make sure shdrs have been read in.
1010
1011 2008-02-19  Roland McGrath  <roland@redhat.com>
1012
1013         * elf.h: Update from glibc.
1014
1015 2008-02-08  Roland McGrath  <roland@redhat.com>
1016
1017         * elf.h: Update from glibc.
1018
1019 2008-01-31  Ulrich Drepper  <drepper@redhat.com>
1020
1021         * elf_strptr.c (elf_strptr): Don't fail if the ELF file is currently
1022         under construction and no raw data can be read from disk.
1023
1024 2008-01-30  Roland McGrath  <roland@redhat.com>
1025
1026         * elf.h: Update from glibc.
1027
1028 2008-01-26  Roland McGrath  <roland@redhat.com>
1029
1030         * elf_begin.c (__libelf_next_arhdr): Rewrite conversions using a macro.
1031         Fixes various pastos in wrong type in sizeof, wrong string parsed.
1032
1033 2008-01-20  Roland McGrath  <roland@redhat.com>
1034
1035         * elf_getaroff.c: Calculate from start_offset, instead of using
1036         parent's state.ar.offset field.
1037
1038 2008-01-08  Roland McGrath  <roland@redhat.com>
1039
1040         * Makefile.am (euinclude): Variable removed.
1041         (pkginclude_HEADERS): Set this instead of euinclude_HEADERS.
1042
1043 2008-01-03  Roland McGrath  <roland@redhat.com>
1044
1045         * common.h: Add __attribute__ ((unused)) to static functions.
1046
1047 2007-12-20  Ulrich Drepper  <drepper@redhat.com>
1048
1049         * Makefile.am (libelf_a_SOURCES): Add elf_scnshndx.
1050         * libelfP.h (struct Elf_Scn): Add shndx_index field.
1051         Declare __elf_scnshndx_internal.
1052         * elf32_getshdr.c: Record location of extended section header.
1053         * elf_begin.c (file_read_elf): Likewise.
1054         * elf_scnshndx.c: New file.
1055         * libelf.h: Declare elf_scnshndx.
1056         * libelf.map: Add elf_scnshndx to version ELFUTILS_1.4.
1057
1058 2007-11-12  Roland McGrath  <roland@redhat.com>
1059
1060         * libelf.h: Replace off64_t with loff_t throughout.
1061         Only that type name is unconditionally defined by <sys/types.h>
1062
1063 2007-11-03  Roland McGrath  <roland@redhat.com>
1064
1065         * libelf.h (Elf_Data): Comment fix.
1066
1067 2007-10-18  Roland McGrath  <roland@redhat.com>
1068
1069         * elf.h: Update from glibc.
1070
1071 2007-10-07  Roland McGrath  <roland@redhat.com>
1072
1073         * elf_begin.c (__libelf_next_arhdr): Fix fencepost error and wrong
1074         member access in terminating name with no trailing /.  Trim trailing
1075         spaces when there is no /.
1076
1077 2007-10-04  Roland McGrath  <roland@redhat.com>
1078
1079         * elf_end.c (elf_end): Don't free ELF->state.ar.ar_sym when it's -1l.
1080
1081 2007-10-03  Roland McGrath  <roland@redhat.com>
1082
1083         * libelf.h (Elf_Data): Use off64_t for d_off.
1084         (Elf_Arhdr): Use off64_t for ar_size.
1085         (elf_update, elf_getbase, elf_getaroff): Return off64_t.
1086
1087         * gelf_rawchunk.c: File removed.
1088         * gelf_freechunk.c: File removed.
1089         * Makefile.am (libelf_a_SOURCES): Remove them.
1090         * libelf.map (ELFUTILS_1.0): Remove exports.
1091         * gelf.h: Remove decls.
1092
1093         * elf_getdata_rawchunk.c: New file.
1094         * Makefile.am (libelf_a_SOURCES): Add it.
1095         * libelf.map (ELFUTILS_1.3): Add elf_getdata_rawchunk.
1096         * libelf.h: Declare it.
1097         * libelfP.h (Elf_Data_Chunk): New type.
1098         (struct Elf.elf): New member `rawchunks'.
1099         * elf_end.c (elf_end): Free recorded rawchunk buffers.
1100
1101 2007-08-24  Roland McGrath  <roland@redhat.com>
1102
1103         * gelf_getnote.c: New file.
1104         * Makefile.am (libelf_a_SOURCES): Add it.
1105         * gelf.h: Declare gelf_getnote.
1106         * libelf.map (ELFUTILS_1.3): Add gelf_getnote.
1107
1108         * libelfP.h (NOTE_ALIGN): New macro.
1109         * note_xlate.h: New file.
1110         * Makefile.am (noinst_HEADERS): Add it.
1111         * gelf_xlate.c: Include it.
1112         (__elf_xfctstom): Use elf_cvt_note.
1113         * elf_getdata.c (shtype_map, __libelf_type_align): Handle SHT_NOTE.
1114         (__libelf_set_rawdata): Likewise.
1115
1116 2007-08-19  Roland McGrath  <roland@redhat.com>
1117
1118         * gelf_update_auxv.c: New file.
1119         * gelf_getauxv.c: New file.
1120         * Makefile.am (libelf_a_SOURCES): Add them.
1121         * gelf.h: Declare gelf_getauxv, gelf_update_auxv.
1122         * libelf.map (ELFUTILS_1.3): New set, inherits fom ELFUTILS_1.2.
1123         Export gelf_getauxv, gelf_update_auxv.
1124
1125         * libelf.h (Elf_Type): Add ELF_T_AUXV.
1126         * abstract.h: Add auxv_t entries.
1127         * exttypes.h: Likewise.
1128         * gelf_xlate.h: Likewise.
1129         * gelf_xlate.c (__elf_xfctstom): Add ELF_T_AUXV entries.
1130         * gelf_fsize.c (__libelf_type_sizes): Likewise.
1131
1132 2007-08-12  Roland McGrath  <roland@redhat.com>
1133
1134         * elf32_updatefile.c (compare_sections): Sort secondarily on sh_size,
1135         and only tertiarily on index.
1136
1137 2007-07-09  Roland McGrath  <roland@redhat.com>
1138
1139         * elf.h: Update from glibc.
1140
1141 2007-04-22  Roland McGrath  <roland@redhat.com>
1142
1143         * elf.h: Update from glibc.
1144
1145 2007-03-18  Roland McGrath  <roland@redhat.com>
1146
1147         * elf_begin.c (get_shnum): Fix test for e_shoff being out of bounds.
1148         Return zero when the section headers do not fit within MAXSIZE.
1149
1150 2007-03-09  Roland McGrath  <roland@redhat.com>
1151
1152         * libelfP.h (LIBELF_EV_IDX): New macro.
1153         (__libelf_type_align): New macro.
1154         [! ALLOW_UNALIGNED]: Declare __libc_type_aligns array.
1155         * elf_getdata.c (shtype_map): Convert to just Elf_Type[][].
1156         (convert_data, __libelf_set_rawdata): Use that, __libelf_type_align,
1157         and __libelf_type_sizes, in place of old table.
1158         (__libc_type_aligns): New const variable.
1159
1160 2007-02-04  Ulrich Drepper  <drepper@redhat.com>
1161
1162         * Makefile (libelf.so): Build with -z relro.
1163
1164         * elf_begin.c (read_file): When using ELF_C_READ_MMAP use MAP_PRIVATE.
1165
1166 2007-01-30  Ulrich Drepper  <drepper@redhat.com>
1167
1168         * nlist.c: Close file descriptor before returning.
1169
1170 2007-01-20  Roland McGrath  <roland@redhat.com>
1171
1172         * gnuhash_xlate.h (elf_cvt_gnuhash): Fix fence-post error so we
1173         convert the final word.
1174
1175         * elf32_getshdr.c: Don't byteswap shdr fields when EI_DATA matches
1176         MY_ELFDATA on !ALLOW_UNALIGNED machines.
1177
1178 2007-01-18  Roland McGrath  <roland@redhat.com>
1179
1180         * gelf_rawchunk.c (gelf_rawchunk): Clear RESULT pointer after freeing
1181         it on read error.
1182
1183 2006-10-13  Roland McGrath  <roland@redhat.com>
1184
1185         * elf32_updatenull.c: Look for and accept phdr also for ET_CORE.
1186         * elf_error.c (msgstr): Change ELF_E_INVALID_PHDR string.
1187
1188 2006-08-29  Roland McGrath  <roland@redhat.com>
1189
1190         * elf32_getphdr.c: Don't byteswap phdr fields when EI_DATA matches
1191         MY_ELFDATA on !ALLOW_UNALIGNED machines.
1192         Reported by Christian Aichinger <Greek0@gmx.net>.
1193
1194         * Makefile.am (CLEANFILES): Add libelf.so.$(VERSION).
1195
1196 2006-08-08  Ulrich Drepper  <drepper@redhat.com>
1197
1198         * elf.h (DT_VALNUM): Update.
1199         (DT_ADDRNUM): Likewise.
1200
1201 2006-07-12  Ulrich Drepper  <drepper@redhat.com>
1202
1203         * elf32_updatefile.c: Adjust for internal_function_def removal.
1204         * elf32_updatenull.c: Likewise.
1205         * elf_begin.c: Likewise.
1206         * elf_getdata.c: Likewise.
1207
1208 2006-07-11  Ulrich Drepper  <drepper@redhat.com>
1209
1210         * libelf.h: Define ELF_T_GNUHASH.
1211         * elf_getdata.c (TYPEIDX): Handle SHT_GNU_HASH.
1212         (shtype_map): Add SHT_GNU_HASH entries.
1213         * gelf_xlate.c (__elf_xfctstom): Add ELF_T_GNUHASH entries.
1214         * gnuhash_xlate.h: New file.
1215         * Makefile.am (noinst_HEADERS): Add gnuhash_xlate.h.
1216
1217 2006-07-06  Ulrich Drepper  <drepper@redhat.com>
1218
1219         * elf_gnu_hash.c: New file.
1220         * libelf.h: Declare elf_gnu_hash.
1221         * Makefile.am (libelf_a_SOURCES): Add elf_gnu_hash.
1222         * libelf.map: Add elf_gnu_map for version ELFUTILS_1.2.
1223
1224 2006-06-15  Roland McGrath  <roland@redhat.com>
1225
1226         * libelf.h (elf_getarsym): Fix comment typo.
1227         Rename second parameter to be more explanatory.
1228         (elf_getident, elf_rawhide): Likewise.
1229
1230 2006-05-28  Ulrich Drepper  <drepper@redhat.com>
1231
1232         * elf32_updatefile.c (updatemmap): Preserve section content if
1233         copying would overwrite them.
1234         Fix msync paramters.
1235
1236 2006-04-04  Roland McGrath  <roland@redhat.com>
1237
1238         * elf32_updatefile.c (updatemmap): Handle other-endian case.
1239
1240 2006-04-04  Ulrich Drepper  <drepper@redhat.com>
1241
1242         * elf32_updatefile.c (updatemmap): Cleanups.  Remove shdr_dest
1243         variable.  Before writing sections, make a copy of the section
1244         header data if necessary.  Don't write section header while
1245         writing the section constent, it might overwrite some sections.
1246         Restore the pointer afterwards.
1247         * elf32_updatenull.c (updatenull): If the offset of a section in a
1248         file changed make sure we read the section so that it'll be written
1249         out.
1250
1251         * elf_update.c: Remove debug message.
1252
1253 2005-12-07  Roland McGrath  <roland@redhat.com>
1254
1255         * gelf_xlate.c [! ALLOW_UNALIGNED] (union unaligned): New type.
1256         (FETCH, STORE): New macros.
1257         (INLINE3): Use those to do alignment-friendly conversion.
1258
1259         * elf32_getshdr.c: Include map_address and start_offset in alignment
1260         calculations.
1261         * elf32_getphdr.c: Likewise.
1262
1263 2005-11-19  Roland McGrath  <roland@redhat.com>
1264
1265         * elf.h: Update from glibc.
1266
1267 2005-11-17  Roland McGrath  <roland@redhat.com>
1268
1269         * elf.h: Update from glibc.
1270
1271 2005-11-10  Roland McGrath  <roland@redhat.com>
1272
1273         * elf.h: Update from glibc.
1274
1275 2005-09-09  Roland McGrath  <roland@redhat.com>
1276
1277         * elf_update.c (write_file): Stat the file and fchmod it after update
1278         if its mode had S_ISUID or S_ISGID bits set.
1279
1280 2005-08-28  Ulrich Drepper  <drepper@redhat.com>
1281
1282         * elf32_getphdr.c: Include <system.h>.  Use pread_retry instead of
1283         pread.  And branch prediction where useful.
1284         * elf_begin.c: Likewise.
1285         * elf_getdata.c: Likewise.
1286         * elf_getshstrndx.c: Likewise.
1287         * elf_readall.c: Likewise.
1288         * gelf_rawchunk.c: Likewise.
1289         * elf32_updatefile.c: Include <system.h>.  Use pread_retry instead of
1290         pread.  And branch prediction where useful.
1291         * elf_getarsym.c: Don't define pread_retry here.
1292
1293         * Makefile.am: Use $(LINK) not $(CC) when creating DSO.
1294         (%.os): Use COMPILE.os.
1295         (COMPILE.os): Filter out gconv options.
1296
1297 2005-08-27  Ulrich Drepper  <drepper@redhat.com>
1298
1299         * elf_begin.c (file_read_elf): Avoid reading ELF header from file
1300         again.  Instead accept additional parameter which points to it if we
1301         don't use mmap.
1302         (get_shnum): Use passed in e_ident value as source of ELF header.
1303
1304 2005-08-15  Ulrich Drepper  <drepper@redhat.com>
1305
1306         * elf_begin.c (__libelf_next_arhdr): Use TEMP_FAILURE_RETRY.
1307
1308         * Makefile (libelf_a_SOURCES): Add elf_getaroff.c.
1309         * libelf.map: Export elf_getaroff.
1310         * libelf.h: Declare elf_getaroff.
1311         * elf_getaroff.c: New file.
1312
1313 2005-08-13  Ulrich Drepper  <drepper@redhat.com>
1314
1315         * elf_begin.c (get_shnum): Optimize memory handling.  Always read from
1316         mapped file if available.  Fix access to 64-bit sh_size.  Recognize
1317         overflow.
1318         (file_read_elf): Likewise.
1319
1320 2005-08-12  Roland McGrath  <roland@redhat.com>
1321
1322         * elf32_offscn.c: Do not match empty sections at OFFSET unless
1323         there are no nonempty sections at that offset.
1324
1325 2005-08-07  Ulrich Drepper  <drepper@redhat.com>
1326
1327         * elf.h: Update from glibc.
1328
1329 2005-08-06  Ulrich Drepper  <drepper@redhat.com>
1330
1331         * Makefile.am (AM_CFLAGS): Add -fpic when BUILD_STATIC.
1332
1333 2005-08-03  Ulrich Drepper  <drepper@redhat.com>
1334
1335         * libelf.map: Move elf32_offscn, elf64_offscn, and gelf_offscn in
1336         new version ELFUTILS_1.1.1.
1337
1338 2005-08-02  Ulrich Drepper  <drepper@redhat.com>
1339
1340         * elf_error.c: Add handling of ELF_E_INVALID_OFFSET.
1341         * elf32_offscn.c: New file.
1342         * elf64_offscn.c: New file.
1343         * gelf_offscn.c: New file.
1344         * Makefile.am (libelf_a_SOURCES): Add elf32_offscn.c, elf64_offscn.c,
1345         and gelf_offscn.c.
1346         * libelf.sym: Export new symbols.
1347
1348 2005-07-23  Ulrich Drepper  <drepper@redhat.com>
1349
1350         * elf-knowledge.h (SECTION_STRIP_P): Don't handle removal of debug
1351         sections here anymore.
1352         * elf32_checksum.c: Adjust for change in SECTION_STRIP_P interface.
1353
1354         * elf_update.c (elf_update): Get write lock, not read lock.
1355
1356         * elf32_updatenull.c (updatenull): Get section headers if necessary
1357         and possible.
1358
1359 2005-07-22  Ulrich Drepper  <drepper@redhat.com>
1360
1361         * elf32_updatenull.c (updatenull): If program header hasn't been loaded
1362         yet, try to do it now.
1363         Don't unnecessarily update overflow of section count in zeroth section
1364         sh_size field.
1365         If section content hasn't been read yet, do it before looking for the
1366         block size.  If no section data present, infer size of section header.
1367
1368 2005-05-11  Ulrich Drepper  <drepper@redhat.com>
1369
1370         * elf.h: Update again.
1371
1372 2005-05-09  Ulrich Drepper  <drepper@redhat.com>
1373
1374         * elf.h: Update from glibc.
1375
1376 2005-05-08  Roland McGrath  <roland@redhat.com>
1377
1378         * elf_begin.c (read_file) [_MUDFLAP]: Don't use mmap for now.
1379         * elf_update.c (write_file) [_MUDFLAP]: Likewise.
1380
1381 2005-03-29  Ulrich Drepper  <drepper@redhat.com>
1382
1383         * elf32_checksum.c: Use INTUSE and INTDEF to avoid PLTs.
1384         * elf_end.c: Likewise.
1385         * elf_getdata.c: Likewise.
1386         * gelf_getehdr.c: Likewise.
1387         * nlist.c: Likewise.
1388         * libelfP.h: Add declarations of internal functions.
1389
1390 2005-02-15  Ulrich Drepper  <drepper@redhat.com>
1391
1392         * common.h (CONVERT): Make sure all values are unsigned.
1393         (CONVERT_TO): Likewise.
1394
1395         * Makefile.am (AM_CFLAGS): Add -Wformat=2.
1396         Fix rule to build libelf.so.
1397
1398 2005-02-06  Ulrich Drepper  <drepper@redhat.com>
1399
1400         * Makefile.am: Cleanup AM_CFLAGS handling.  Add -Wunused -Wextra.
1401         Remove lint handling.
1402         * elf32_getphdr.c: Minor cleanups.
1403         * elf32_getshdr.c: Likewise.
1404         * elf32_updatefile.c: Likewise.
1405         * elf32_updatenull.c: Likewise.
1406         * elf_begin.c: Likewise.
1407         * elf_error.c: Likewise.
1408         * elf_getarsym.c: Likewise.
1409         * elf_getdata.c: Likewise.
1410         * elf_update.c: Likewise.
1411         * gelf_xlate.c: Likewise.
1412
1413 2005-02-05  Ulrich Drepper  <drepper@redhat.com>
1414
1415         * Makefile.am: Check for text relocations in constructed DSO.
1416
1417         * Makefile.am [MUDFLAP] (AM_CFLAGS): Add -Werror -fpic -fmudflap.
1418
1419 2005-02-04  Ulrich Drepper  <drepper@redhat.com>
1420
1421         * gelf_getehdr.c (gelf_getehdr): Slight optimization.
1422
1423         * elf32_checksum.c (checksum): Do not look at NOBITS sections.
1424
1425         * gelf.h: Add gelf_checksum prototype.
1426
1427 2004-09-25  Ulrich Drepper  <drepper@redhat.com>
1428
1429         * elf32_checksum.c: Make compile with gcc 4.0.
1430         * elf32_updatefile.c: Likewise.
1431         * elf32_updatenull.c: Likewise.
1432         * elf_begin.c: Likewise.
1433         * elf_error.c: Likewise.
1434         * elf_getdata.c: Likewise.
1435         * elf_getident.c: Likewise.
1436
1437 2004-04-01  Ulrich Drepper  <drepper@redhat.com>
1438
1439         * elf.h: Update from glibc.
1440
1441 2004-01-23  Ulrich Drepper  <drepper@redhat.com>
1442
1443         * elf_update.c: Fix locking.
1444         * elf_clone.c: Likewise.
1445
1446         * libelf.h: Define ELF_T_LIB.
1447         * gelf_getlib.c: New file.
1448         * gelf_update_lib.c: New file.
1449         * gelf.h: Declare the new functions.  Define GElf_Lib.
1450         * abstract.h: Define Lib, Lib32, Lib64.
1451         * gelf_xlate.c (__elf_xfctstom): Add ELF_T_LIB entry.
1452         * gelf_xlate.h: Add entry for ElfXX_Lib.
1453         * elf_getdata.c: Recognize SHT_GNU_LIBLIST as a known section type.
1454         * libelf.map: Add new symbols to ELFUTILS_1.1.
1455         * Makefile.am (libelf_a_SOURCES): Add gelf_getlib.c and
1456         gelf_update_lib.c.
1457
1458 2004-01-17  Ulrich Drepper  <drepper@redhat.com>
1459
1460         * Makefile.am: Support building with mudflap.
1461
1462         * gelf_xlate.c (INLINE3): Avoid using cast as lvalue.
1463         * dl-hash.h (_dl_elf_hash): Likewise.
1464
1465 2004-01-05  Ulrich Drepper  <drepper@redhat.com>
1466
1467         * elf-knowledge.h: New file.  From libelf subdir.
1468         * Makefile.am (euincludedir): Define.
1469         (euinclude_HEADERS): Add elf-knowledge.h.
1470
1471 2003-09-24  Ulrich Drepper  <drepper@redhat.com>
1472
1473         * elf.h: Define some PT_IA_64_HP_* constants.
1474
1475 2003-09-23  Jakub Jelinek  <jakub@redhat.com>
1476
1477         * libelfP.h (struct Elf): Move state.elf64.sizestr_offset after
1478         state.elf64.scnincr to match state.elf{,32}.
1479
1480 2003-08-12  Ulrich Drepper  <drepper@redhat.com>
1481
1482         * elf32_updatefile.c (__updatemmap): When writing back file where
1483         some sections have not been read in, count their sizes based on
1484         the section header.
1485
1486 2003-08-11  Ulrich Drepper  <drepper@redhat.com>
1487
1488         * Moved to CVS archive.