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