1 2019-01-18 Mark Wielaard <mark@klomp.org>
3 * Makefile.am (INSTALL_ELFH): Add elf.h to include_HEADERS when
4 defined, otherwise (the default) add elf.h to noinst_HEADERS.
6 2019-01-16 Mark Wielaard <mark@klomp.org>
8 * note_xlate.h (elf_cvt_note): Check n_namesz and n_descsz don't
9 overflow note_len into note header.
11 2018-11-17 Mark Wielaard <mark@klomp.org>
13 * elf32_updatefile.c (updatemmap): Make sure to call convert
14 function on a properly aligned destination.
16 2018-11-16 Mark Wielaard <mark@klomp.org>
18 * libebl.h (__elf32_msize): Mark with const attribute.
19 (__elf64_msize): Likewise.
21 2018-11-13 Mark Wielaard <mark@klomp.org>
23 * elf_getdata.c (__libelf_set_rawdata_wrlock): Explicitly set the
24 alignment of SHF_COMPRESSED data to the alignment of ELF_T_CHDR.
25 * elf_compress.c (elf_compress): After compression set sh_addralign
26 to the alignment of ELF_T_CHDR.
28 2018-11-09 Mark Wielaard <mark@klomp.org>
30 * elf_compress_gnu.c (elf_compress_gnu): Use elf_getdata.
32 2018-11-12 Mark Wielaard <mark@klomp.org>
34 * elf-knowledge.c (ELF_NOTE_GNU_BUILD_ATTRIBUTE_PREFIX): New define.
35 (NT_GNU_BUILD_ATTRIBUTE_{OPEN,FUNC}): Likewise.
36 (GNU_BUILD_ATTRIBUTE_TYPE_{NUMERIC,STRING,BOOL_TRUE,BOOL_FALSE}):
38 (GNU_BUILD_ATTRIBUTE_{VERSION,STACK_PROT,RELRO,STACK_SIZE,TOOL,ABI,
39 PIC,SHORT_ENUM}): Likewise.
41 2018-11-09 Mark Wielaard <mark@klomp.org>
43 * elf_compress.c (__libelf_reset_rawdata): Make rawdata change
44 explicit by calling __libelf_set_data_list.
45 * elf_getdata.c (convert_data): Don't convert if type is ELF_T_BYTE
46 even if endianness is different.
48 2018-10-18 Mark Wielaard <mark@klomp.org>
50 * libelf.h (Elf_Type): Add ELF_T_NHDR8.
51 * libelfP.h (__libelf_data_type): Add align argument.
52 (NOTE_ALIGN): Split into...
53 (NOTE_ALIGN4): ... and ...
55 * elf32_xlatetom.c (xlatetom): Recognize both ELF_T_NHDR and
57 * elf_compress.c (elf_compress): Pass zdata_align to
59 * elf_compress_gnu.c (elf_compress_gnu): Pass sh_addralign to
61 * elf_getdata.c (shtype_map): Add ELF_T_NHDR8.
62 (__libelf_data_type): Take align as extra argument, use it to
64 (__libelf_set_rawdata_wrlock): Recognize ELF_T_NHDR8. Pass align to
66 * gelf_fsize.c (__libelf_type_sizes): Add ELF_T_NHDR8.
67 * gelf_getnote.c (gelf_getnote): Use Elf_Type of Elf_Data to calculate
69 * gelf_xlate.c (__elf_xfctstom): Set ELF_T_NHDR to elf_cvt_note4,
71 * note_xlate.h (elf_cvt_note): Take nhdr8 argument and use it to
73 (elf_cvt_note4): New function.
74 (elf_cvt_note8): Likewise.
76 2018-09-13 Mark Wielaard <mark@klomp.org>
78 * elf32_updatefile.c (updatemmap): Use shnum, not ehdr->e_shnum.
79 * elf_getscn.c (elf_getscn): Create section zero if it is requested,
80 but doesn't exist yet.
82 2018-09-12 Mark Wielaard <mark@klomp.org>
84 * elf32_updatefile.c (updatemmap): Use memmove, not memcpy.
85 * elf_update.c (write_file): Try to mremap if file needs to be
88 2018-08-18 Mark Wielaard <mark@klomp.org>
90 * libelf.h (elf_compress_gnu): Add documentation about
91 interaction between SHF_COMPRESED and elf_compress_gnu.
92 * elf_compress_gnu.c (elf_compress_gnu): Return error if section
93 sh_flags has SHF_COMPRESSED set.
95 2018-07-27 Mark Wielaard <mark@klomp.org>
97 * libelf.h (elf_getshdrstrndx): Fix documentation.
98 (elf_getshstrndx): Likewise.
100 2018-06-19 Mark Wielaard <mark@klomp.org>
102 * libelfP.h (__libelf_type_align): Remove !ALLOW_UNALIGNED guard.
103 * elf_getdata.c (__libelf_type_aligns): Likewise.
104 (convert_data): Remove ALLOW_UNALIGNED check.
105 * elf_getdata_rawchunk.c (elf_getdata_rawchunk): Likewise.
107 2018-06-21 Mark Wielaard <mark@klomp.org>
109 * elf.h: Update from glibc.
111 2018-04-19 Andreas Schwab <schwab@suse.de>
113 * elf.h: Update from glibc.
115 2018-02-16 Mark Wielaard <mark@klomp.org>
117 * elf.h: Update from glibc.
119 2018-02-09 Joshua Watt <JPEWhacker@gmail.com>
121 * elf32_updatenull.c (updatenull_wrlock): Use FALLTHROUGH macro
123 * elf_begin.c (read_unmmaped_file): Likewise.
124 (elf_begin): Likewise.
125 * elf_cntl.c (elf_cntl): Likewise.
127 2017-10-04 Mark Wielaard <mark@klomp.org>
129 * elf_begin.c (file_read_elf): Skip sanity checking e_shoff if scncnt
130 is zero, we won't use it then.
132 2017-10-04 Mark Wielaard <mark@klomp.org>
134 * libelfP.h: Add ELF_E_INVALID_ELF to error values enum.
135 * elf_error.c (ELF_E_INVALID_ELF_IDX): New define. Use it as value
136 for ELF_E_INVALID_ELF in msgidx.
137 * elf_getshdrstrndx.c (elf_getshdrstrndx): Distinquish between pread
138 failing and not having enough data.
139 * elf_begin.c (get_shnum): Likewise. Explicitly set libelf errno on
141 (file_read_elf): Make sure to always set libelf errno when returning
142 NULL. Distinquish between i/o file and elf data errors.
144 2017-08-18 Ulf Hermann <ulf.hermann@qt.io>
146 * gelf_xlate.c: Use attribute_packed.
148 2017-04-27 Ulf Hermann <ulf.hermann@qt.io>
150 * libelfP.h: Use attribute_hidden.
152 2017-04-27 Ulf Hermann <ulf.hermann@qt.io>
154 * Makefile.am: Use fpic_CFLAGS and dso_LDFLAGS.
156 2017-08-15 Mark Wielaard <mark@klomp.org>
158 * elf.h: Update from glibc. Add new powerpc note descriptors.
160 2017-07-19 Gustavo Romero <gromero@linux.vnet.ibm.com>
162 * elf.h: Add known type in notes segment descriptor for HTM SPRs.
164 2017-02-17 Ulf hermann <ulf.hermann@qt.io>
166 * Makefile.am: Add libelf_so_DEPS, which include libeu.a,
168 (libelf_so_LDLIBS): Add $(libelf_so_DEPS).
169 (libelf.so$(EXEEXT): Use $(libelf_so_LIBS), require libelf.map
170 from the right directory.
172 2017-04-20 Ulf Hermann <ulf.hermann@qt.io>
174 * libelfP.h: Don't include config.h.
176 2017-04-20 Ulf Hermann <ulf.hermann@qt.io>
178 * elf_begin.c: Use F_GETFD rather than F_GETFL.
180 2017-04-20 Ulf Hermann <ulf.hermann@qt.io>
182 * libelf.h: Define macros for various function attributes and use
185 2017-04-20 Ulf Hermann <ulf.hermann@qt.io>
187 * elf_update.c: Set ELF_F_MMAPPED flag if we mmap from elf_update.
189 2017-04-19 Mark Wielaard <mark@klomp.org>
191 * elf_getarsym.c (elf_getarsym): Initialize n to zero.
193 2017-03-27 Mark Wielaard <mark@klomp.org>
195 * elf32_updatefile.c (updatemmap): Always update last_positition.
196 (updatefile): Likewise.
198 2017-03-24 Mark Wielaard <mark@klomp.org>
200 * elf_compress.c (__libelf_decompress): Check insane compression
201 ratios before trying to allocate output buffer.
203 2016-10-11 Akihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>
204 Mark Wielaard <mjw@redhat.com>
206 * gelf.h (gelf_newehdr): Change return type to void *.
207 (gelf_newphdr): Likewise.
208 * gelf_newehdr.c (gelf_newehdr): Likewise.
209 * gelf_newphdr.c (gelf_newphdr): Likewise.
211 2016-10-21 Mark Wielaard <mjw@redhat.com>
213 * elf_getdata.c (__libelf_set_rawdata_wrlock): Sanity check
214 offset and size before trying to malloc and read data.
216 2016-10-26 Mark Wielaard <mjw@redhat.com>
218 * elf_begin.c (read_file): Always set maxsize when parent == NULL.
220 2016-10-11 Akihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>
222 * elf_getarsym.c (elf_getarsym): Open code rawmemchr when not
224 * elf_strptr.c: Include stdbool.h.
225 (validate_str): New function.
226 (elf_strptr): Use validate_str instead of memrchr.
228 2016-10-11 Akihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>
230 * elf32_updatefile.c: Remove sys/param.h include.
231 * elf32_updatenull.c: Likewise. Add system.h include.
232 * elf_begin.c: Remove sys/param.h.
233 * elf_compress: Likewise. Add system.h include.
234 (MAX): Remove definition.
236 2016-08-07 Mark Wielaard <mjw@redhat.com>
238 * elf_compress.c (__libelf_reset_rawdata): Check scn->flags and
239 free rawdata_base when malloced. Set ELF_F_MALLOCED for scn->flags.
240 * elf_end.c (elf_end): Check scn->flags and free rawdata_base if
242 * libelfP.h (struct Elf_Scn): Document flags ELF_F_MALLOCED usage.
244 2016-07-06 Mark Wielaard <mjw@redhat.com>
246 * elf-knowledge.h (SH_FLAGS_COMBINE): Removed.
247 (SH_FLAGS_IMPORTANT): Likewise.
249 2016-07-06 Mark Wielaard <mjw@redhat.com>
251 * elf32_updatenull.c (updatenull_wrlock): Ignore e_type when
253 * elf_getphdrnum.c (__elf_getphdrnum_chk_rdlock): Only do sanity
254 checking if phdrs haven't been read in yet.
256 2016-06-24 John Ogness <john.ogness@linutronix.de>
258 * elf32_updatenull.c (updatenull_wrlock): Find first section.
259 * elf_nextscn.c (elf_nextscn): When scn is NULL start from 0th
262 2016-06-28 Richard Henderson <rth@redhat.com>
264 * elf.h: Update from glibc. Add lots of new EM_* definitions.
266 2016-04-14 Mark Wielaard <mjw@redhat.com>
268 * elf_compress.c (__libelf_compress): Free out_buf if deflateInit
271 2016-02-13 Mark Wielaard <mjw@redhat.com>
273 * elf32_updatefile.c (updatemmap): Free scns when out of memory.
275 2016-01-28 Mark Wielaard <mjw@redhat.com>
277 * elf.h: Update from glibc. Add new i386 and x86_64 relocations.
279 2016-02-12 Mark Wielaard <mjw@redhat.com>
281 * elf.h: Update from glibc. Add NT_ARM_SYSTEM_CALL.
283 2016-02-04 Mark Wielaard <mjw@redhat.com>
285 * elf_getdata.c (__libelf_set_rawdata_wrlock): Don't adjust align
286 for SHT_NOBITS sections.
288 2016-01-22 Chih-Hung Hsieh <chh@google.com>
290 * elf_compress.c (__libelf_compress): Move nested function
291 'do_deflate_cleanup' to file scope to compile with clang.
292 * elf_strptr.c (elf_strptr): Move nested function 'get_zdata'
293 to file scope to compile with clang.
295 2016-01-13 Mark Wielaard <mjw@redhat.com>
297 * libelf.h: Check SHF_COMPRESSED is defined. If not define it and the
298 associated ELF compression types/defines.
300 2015-11-26 Mark Wielaard <mjw@redhat.com>
302 * elf_compress.c (__libelf_decompress_elf): New function, extracted
304 (elf_compress): here. Check zdata_base use __libelf_decompress_elf.
305 * elf_strptr.c (elf_strptr): If SHF_COMPRESSED check, uncompress and
307 * libelfP.h (struct Elf_Scn): Add zdata_size and zdata_align.
308 (__libelf_decompress_elf): New internal function definition.
310 2015-10-21 Mark Wielaard <mjw@redhat.com>
312 * Makefile.am (libelf_a_SOURCES): Add elf_compress.c and
314 * elf_compress.c: New file.
315 * elf_compress_gnu.c: Likewise.
316 * elf_begin.c (file_read_elf): Make a writable copy of the shdrs
318 * elf_end.c (elf_end): Free zdata_base.
319 * elf_error.c: Add ELF_E_ALREADY_COMPRESSED,
320 ELF_E_UNKNOWN_COMPRESSION_TYPE, ELF_E_COMPRESS_ERROR and
321 ELF_E_DECOMPRESS_ERROR.
322 * elf_data.c (__libelf_data_type): New internal function extracted
324 (convert_data): Handle SHF_COMPRESSED.
325 * elf32_updatenull.c (updatenull_wrlock): Check sh_entsize against
326 uncompressed section data size if SHF_COMPRESSED.
327 * elf32_getshdr.c (load_shdr_wrlock): Adjust assert to account for
329 * libelf.h: Define elf_compress and elf_compress_gnu.
330 * libelf.map (ELFUTILS_1.7): Add elf_compress and elf_compress_gnu.
331 * libelfP.h: Add ELF_E_ALREADY_COMPRESSED,
332 ELF_E_UNKNOWN_COMPRESSION_TYPE, ELF_E_COMPRESS_ERROR and
333 ELF_E_DECOMPRESS_ERROR. Define __libelf_data_type.
334 (__libelf_compress): New internal function definition.
335 (__libelf_decompress): Likewise.
336 (__libelf_reset_rawdata): Likewise.
337 (__libelf_data_type): Likewise.
338 (struct Elf_Scn): Add zdata_base.
340 2015-11-19 Mark Wielaard <mjw@redhat.com>
342 * Makefile.am (libelf_a_SOURCES): Add elf32_getchdr.c,
343 elf64_getchdr.c and gelf_getchdr.c.
344 (noinst_HEADERS): Add chdr_xlate.h.
345 * abstract.h: Define Chdr32 and Chdr64.
346 * chdr_xlate.h: New file.
347 * elf32_getchdr.c: New file.
348 * elf64_getchdr.c: New file.
349 * elf_error.c: Add ELF_E_NOT_COMPRESSED, ELF_E_INVALID_SECTION_TYPE
350 and ELF_E_INVALID_SECTION_FLAGS.
351 * elf_getdata.c (__libelf_set_rawdata_wrlock): Set d_type to
352 ELF_T_CHDR for SHF_COMPRESSED sections.
353 * exttypes.h: Add Chdr32 and Chdr64.
354 * gelf.h (GElf_Chdr): New typedef.
355 (gelf_getchdr): New function definition.
356 * gelf_fsize.c (__libelf_type_sizes): Add ELF_T_CHDR.
357 * gelf_getchdr.c: New file.
358 * gelf_xlate.c (__elf_xfctstom): Add ELF_T_CHDR cvt_chdr.
359 * gelf_xlate.h: Add Chdr.
360 * libelf.h (Elf_Type): Add ELF_T_CHDR.
361 (elf32_getchdr): New function definition.
362 (elf64_getchdr): Likewise.
363 * libelf.map (ELFUTILS_1.7): New sections add elf32_getchdr,
364 elf64_getchdr and gelf_getchdr.
365 * libelfP.h: Add ELF_E_NOT_COMPRESSED, ELF_E_INVALID_SECTION_TYPE
366 and ELF_E_INVALID_SECTION_FLAGS.
368 2015-10-16 Mark Wielaard <mjw@redhat.com>
370 * Makefile.am (libelf_so_LDLIBS): Add -lz.
372 2015-10-14 Mark Wielaard <mjw@redhat.com>
374 * elf.h: Update from glibc. Add section compression constants and
377 2015-10-20 Jose E. Marchesi <jose.marchesi@oracle.com>
379 * elf_begin.c (get_shnum): Elf64_Shdr.sh_size is an Elf64_Xword.
380 Fix the size argument to pread_retry.
382 2015-10-13 Chih-Hung Hsieh <chh@google.com>
384 * elf32_updatefile.c (__elfw2(LIBELFBITS,updatemmap)): Move nested
385 function 'fill_mmap' to file scope.
386 * elf_begin.c (elf_begin): Move nested function 'lock_dup_elf'
389 2015-10-09 Josh Stone <jistone@redhat.com>
391 * libelf.h: Replace loff_t with int64_t throughout.
393 2015-10-05 Mark Wielaard <mjw@redhat.com>
395 * elf_update.c (write_file): Only use posix_fallocate when using
396 mmap. Only report failure when errno is ENOSPC.
398 2015-10-09 Josh Stone <jistone@redhat.com>
400 * libelfP.h (struct Elf): Replace off64_t with off_t.
401 * elf_getdata_rawchunk.c (elf_getdata_rawchunk): Likewise.
403 2015-10-05 Chih-Hung Hsieh <chh@google.com>
405 * elf_getarsym.c (elf_getarsym): Do not use
406 union of variable length arrays.
408 2015-10-05 Josh Stone <jistone@redhat.com>
410 * Makefile.am (libelf.so): Add AM_V_CCLD and AM_V_at silencers.
412 2015-09-24 Jose E. Marchesi <jose.marchesi@oracle.com>
414 * Makefile.am (AM_CFLAGS): Use -fPIC instead of -fpic to avoid
415 relocation overflows in some platforms.
417 2015-09-29 Mark Wielaard <mjw@redhat.com>
419 * elf32_updatenull.c (default_ehdr): Set e_version when EV_NONE.
420 (updatenull_wrlock): Always set e_shentsize.
422 2015-09-23 Mark Wielaard <mjw@redhat.com>
424 * elf32_getehdr.c (getehdr_wrlock): Mark as internal_function.
425 * elf32_getshdr.c (getshdr_rdlock): Likewise.
426 (getshdr_wrlock): Likewise.
427 * elf_error.c (__libelf_seterrno): Likewise.
428 * elf_getphdrnum.c (__elf_getphdrnum_rdlock): Likewise.
429 (__elf_getphdrnum_chk_rdlock): Likewise.
430 * elf_getshdrnum.c (__elf_getphdrnum_rdlock): Likewise.
431 (__elf_getphdrnum_chk_rdlock): Likewise.
432 * elf_getshdrnum.c (__elf_getshdrnum_rdlock): Likewise.
433 * elf_readall.c (__libelf_readall): Likewise.
434 * gelf_getehdr.c (__gelf_getehdr_rdlock): Likewise.
436 2015-09-22 Mark Wielaard <mjw@redhat.com>
438 * *.c: Remove old-style function definitions.
440 2015-06-22 Mark Wielaard <mjw@redhat.com>
442 * dl-hash.h: Update from glibc.
444 2015-06-18 Mark Wielaard <mjw@redhat.com>
446 * elf32_updatefile.c (updatefile): Always free shdr_data and scns
447 when allocated on failure paths.
449 2015-06-18 Mark Wielaard <mjw@redhat.com>
451 * nlist.c (nlist): Check symscn shdr exists before use.
453 2015-06-16 Mark Wielaard <mjw@redhat.com>
455 * elf_update.c (write_file): Always also use ftruncate before
456 posix_fallocate to make sure file has the right size.
458 2015-06-04 Mark Wielaard <mjw@redhat.com>
460 * elf_getdata.c (__libelf_type_aligns): Add entries for ELF_T_EHDR,
461 ELF_T_OFF, ELF_T_PHDR, ELF_T_SHDR, ELF_T_SWORD, ELF_T_XWORD,
462 ELF_T_SXWORD, ELF_T_GNUHASH, ELF_T_AUXV.
463 * elf_getdata_rawchunk.c (elf_getdata_rawchunk): Check alignment
464 of rawdata against requested type.
466 2015-06-02 Mark Wielaard <mjw@redhat.com>
468 * elf_getdata.c (convert_data): Make sure source data is properly
469 aligned for type before calling actual conversion function.
471 2015-06-04 Mark Wielaard <mjw@redhat.com>
473 * elf_begin.c (get_shnum): Check alignment of Shdr, not Ehdr before
476 2015-06-02 Mark Wielaard <mjw@redhat.com>
478 * elf_begin.c (file_read_elf): Split checks for ehdr and shdr
479 alignment, drop phdr alignment check.
481 2015-05-31 Mark Wielaard <mjw@redhat.com>
483 * elf32_getshdr.c (load_shdr_wrlock): Allocate shdrs with malloc,
484 not alloca and free after conversion when a copy needs to be made.
486 2015-05-31 Mark Wielaard <mjw@redhat.com>
488 * elf32_getphdr.c (getphdr_wrlock): Allocate phdrs with malloc, not
489 alloca and free after conversion when a copy needs to be made.
491 2015-05-31 Mark Wielaard <mjw@redhat.com>
493 * elf_getarsym.c (elf_getarsym): Allocate temporary file_date with
494 malloc, not alloca also in !ALLOW_UNALIGNED case.
496 2015-05-30 Mark Wielaard <mjw@redhat.com>
498 * gelf_xlate.c (elf_cvt_Byte): Only call memmove with non-zero size.
500 2015-05-30 Mark Wielaard <mjw@redhat.com>
502 * elf32_updatefile.c (updatemmap): Only call mempcpy and update
503 last_position when d_size is non-zero.
505 2015-05-17 Mark Wielaard <mjw@redhat.com>
507 * elf32_updatefile.c (updatefile): Allocate shdr_data and scns
508 with malloc, not alloca. Free after writing section headers.
510 2015-05-16 Mark Wielaard <mjw@redhat.com>
512 * elf32_updatefile.c (updatemmap): Allocate temporary shdr storage
513 with malloc, not alloca. Free after writing section header.
515 2015-05-16 Mark Wielaard <mjw@redhat.com>
517 * elf_getarsym.c (elf_getarsym): Allocate temporary file_date with
518 malloc, not alloca. Call free after out.
520 2015-05-14 Mark Wielaard <mjw@redhat.com>
522 * elf_update.c (write_file): Use posix_fallocate instead of
523 ftruncate to extend file if necessary.
525 2015-05-13 Mark Wielaard <mjw@redhat.com>
527 * elf32_updatenull.c (default_ehdr): If e_phnum is zero then set
528 e_phoff also to zero.
530 2015-05-12 Mark Wielaard <mjw@redhat.com>
532 * elf32_updatenull.c (updatenull_wrlock): Check that sh_addralign
534 * elf_getdata.c (__libelf_set_rawdata_wrlock): Clamp large d_aligns
535 to the elf image offset.
537 2015-05-12 Mark Wielaard <mjw@redhat.com>
539 * elf32_newphdr.c (newphdr): Call __libelf_seterrno with
540 ELF_E_INVALID_INDEX before failing. Check whether section zero shdr
541 actually exists if we need to put extended phnum in section zero.
543 2015-05-08 Mark Wielaard <mjw@redhat.com>
545 * nlist.c (nlist): Call gelf_fsize with EV_CURRENT.
547 2015-01-03 Mark Wielaard <mjw@redhat.com>
549 * version_xlate.h (elf_cvt_Verdef): Use memmove to copy src to dest.
550 (elf_cvt_Verneed): Likewise.
552 2015-03-28 Mark Wielaard <mjw@redhat.com>
554 * elf.h: Update from glibc.
556 2015-03-23 Mark Wielaard <mjw@redhat.com>
558 * elf32_updatenull.c (updatenull_wrlock): Don't extend size with
559 SHT_NOBITS sh_offset.
561 2015-02-18 Mark Wielaard <mjw@redhat.com>
563 * libelfP.h (__libelf_set_data_list_rdlock): Make internal_function.
565 2015-02-07 Jan Kratochvil <jan.kratochvil@redhat.com>
567 * elf32_updatenull.c (__elfw2(LIBELFBITS,updatenull_wrlock)): Consider
570 2015-01-22 Mark Wielaard <mjw@redhat.com>
572 * elf_strptr (elf_strptr): Make sure returned string is NUL
575 2015-01-21 Mark Wielaard <mjw@redhat.com>
577 * elf_strptr.c (elf_strptr): Check data_list_rear == NULL instead
578 of rawdata_base != NULL before using rawdata directly.
580 2015-01-20 Mark Wielaard <mjw@redhat.com>
582 * libelfP.h (__elf_strptr_internal): New function declaration.
583 * elf_getdata.c (__libelf_set_data_list_rdlock): New internal
584 function extracted from...
585 (__elf_getdata_rdlock): ... here.
586 * elf_newdata.c (elf_newdata): Check scn->rawdata_base and update
587 datalist if necessary.
589 2015-01-20 Mark Wielaard <mjw@redhat.com>
591 * elf_strptr.c (elf_strptr): Call __elf[32|64]_getshdr_rdlock if
594 2014-12-30 Mark Wielaard <mjw@redhat.com>
596 * elf_getphdrnum.c (__elf_getphdrnum_chk_rdlock): New function.
597 (elf_getphdrnum): Call __elf_getphdrnum_chk_rdlock.
598 * gelf_getphdr (gelf_getphdr): Call __elf_getphdrnum_chk_rdlock
599 and always check ndx against phnum.
600 * libelfP.h (__elf_getphdrnum_chk_rdlock): New internal function.
602 2014-12-25 Mark Wielaard <mjw@redhat.com>
604 * elf_begin.c (__libelf_next_arhdr_wrlock): ar_size cannot be
605 negative. Include start_offset in maxsize.
607 2014-12-28 Alexander Cherepanov <cherepan@mccme.ru>
609 * elf_begin.c (read_long_names): Don't miss '/' right after
610 another '/'. Fixes a dir traversal vuln in ar extraction.
612 2014-12-18 Ulrich Drepper <drepper@gmail.com>
614 * Makefile.am: Suppress output of textrel_check command.
616 2014-12-16 Mark Wielaard <mjw@redhat.com>
618 * elf_begin.c (read_long_names): Make sure long_names len fits
621 2014-12-15 Mark Wielaard <mjw@redhat.com>
623 * elf_getarsym.c (elf_getarsym): Check index_size doesn't overflow.
625 2014-12-15 Mark Wielaard <mjw@redhat.com>
627 * elf_begin.c (read_long_names): Clear any garbage left in the
630 2014-12-11 Mark Wielaard <mjw@redhat.com>
632 * elf_begin.c (file_read_elf): Correct ELF64 section offset check.
634 2014-12-11 Mark Wielaard <mjw@redhat.com>
636 * elf_begin.c (read_long_names): Check for offset overflow.
637 (__libelf_next_arhdr_wrlock): Likewise. Sanity check the ar_size.
638 Don't allow it to go beyond end of file.
640 2014-12-09 Mark Wielaard <mjw@redhat.com>
642 * elf_getarsym.c (elf_getarsym): Make sure n * w doesn't overflow.
644 2014-11-27 Mark Wielaard <mjw@redhat.com>
646 * Makefile.am (libelf.so): Use textrel_check.
648 2014-11-23 Mark Wielaard <mjw@redhat.com>
650 * elf_getdata_rawchunk.c (elf_getdata_rawchunk): Change signed
651 overflow check to unsigned.
653 2014-11-23 Mark Wielaard <mjw@redhat.com>
655 * note_xlate.h (elf_cvt_note): Copy over any leftover data if
656 src != dest. The data is probably part of truncated name/desc.
658 2014-11-22 Mark Wielaard <mjw@redhat.com>
660 * elf_getphdrnum.c (elf_getphdrnum): Sanity check the
661 __elf_getphdrnum_rdlock result.
663 2014-11-18 Mark Wielaard <mjw@redhat.com>
665 * version_xlate.h (elf_cvt_Verdef): Check for overflow.
666 (elf_cvt_Verneed): Likewise.
668 2014-11-17 Mark Wielaard <mjw@redhat.com>
670 * elf-knowledge.h (SECTION_STRIP_P): Check name is not NULL.
672 2014-11-16 Mark Wielaard <mjw@redhat.com>
674 * elf_getshdrstrndx.c: Check there are section headers before
677 2014-11-16 Mark Wielaard <mjw@redhat.com>
679 * elf32_getphdr.c (getphdr_wrlock): Check e_phoff isn't zero.
680 Check for too many pheaders.
681 * elf_getphdrnum.c (__elf_getphdrnum_rdlock): Check section zero
682 actually exists before handling PN_XNUM.
684 2014-11-16 Mark Wielaard <mjw@redhat.com>
686 * gelf_getnote.c (gelf_getnote): Check padding overflow.
688 2014-11-16 Mark Wielaard <mjw@redhat.com>
690 * elf_getdata.c (__libelf_set_rawdata_wrlock): Declare offset, size
691 and align as Elf64_Off and Elf64_Xword not size_t.
693 2014-11-14 Mark Wielaard <mjw@redhat.com>
695 * gelf_getnote.c (gelf_getnote): Check offset overflow.
697 2014-11-13 Mark Wielaard <mjw@redhat.com>
699 * elf_getdata.c (__libelf_set_rawdata_wrlock): Fix unsigned overflow
702 2014-11-08 Mark Wielaard <mjw@redhat.com>
704 * elf_begin.c (__libelf_next_arhdr_wrlock): Use mempcpy not __mempcpy.
706 2014-11-07 Mark Wielaard <mjw@redhat.com>
708 * elf_begin.c (file_read_elf): Correct sh_size check.
709 * elf_getdata.c (__libelf_set_rawdata_wrlock): Check for unsigned
712 2014-09-10 Petr Machata <pmachata@redhat.com>
714 * elf_begin (read_unmmaped_file): Call __libelf_seterrno if the
717 2014-07-07 Mark Wielaard <mjw@redhat.com>
719 * elf.h: Update from glibc.
721 2014-04-13 Mark Wielaard <mjw@redhat.com>
723 * Makefile.am: Remove !MUDFLAP conditions.
724 * elf_begin.c (read_file): Don't clear use_mmap when _MUDFLAP is
726 * elf_update.c (write_file): Remove _MUDFLAP condition.
728 2014-01-17 Jakub Jelinek <jakub@redhat.com>
729 Roland McGrath <roland@redhat.com>
731 * libelfP.h (INVALID_NDX): Define.
732 * gelf_getdyn.c (gelf_getdyn): Use it. Remove ndx < 0 test if any.
733 * gelf_getlib.c (gelf_getlib): Likewise.
734 * gelf_getmove.c (gelf_getmove): Likewise.
735 * gelf_getrel.c (gelf_getrel): Likewise.
736 * gelf_getrela.c (gelf_getrela): Likewise.
737 * gelf_getsym.c (gelf_getsym): Likewise.
738 * gelf_getsyminfo.c (gelf_getsyminfo): Likewise.
739 * gelf_getsymshndx.c (gelf_getsymshndx): Likewise.
740 * gelf_getversym.c (gelf_getversym): Likewise.
741 * gelf_update_dyn.c (gelf_update_dyn): Likewise.
742 * gelf_update_lib.c (gelf_update_lib): Likewise.
743 * gelf_update_move.c (gelf_update_move): Likewise.
744 * gelf_update_rel.c (gelf_update_rel): Likewise.
745 * gelf_update_rela.c (gelf_update_rela): Likewise.
746 * gelf_update_sym.c (gelf_update_sym): Likewise.
747 * gelf_update_syminfo.c (gelf_update_syminfo): Likewise.
748 * gelf_update_symshndx.c (gelf_update_symshndx): Likewise.
749 * gelf_update_versym.c (gelf_update_versym): Likewise.
751 2014-01-17 Jakub Jelinek <jakub@redhat.com>
753 * elf32_getphdr.c (elfw2(LIBELFBITS,getphdr)): Check if program header
754 table fits into object's bounds.
755 * elf_getshdrstrndx.c (elf_getshstrndx): Add elf->start_offset to
756 elf->map_address. Check if first section header fits into object's
758 * elf32_getshdr.c (elfw2(LIBELFBITS,getshdr)):
759 Check if section header table fits into object's bounds.
760 * elf_begin.c (get_shnum): Ensure section headers fits into
762 (file_read_elf): Make sure scncnt is small enough to allocate both
763 ElfXX_Shdr and Elf_Scn array. Make sure section and program header
764 tables fit into object's bounds. Avoid memory leak on failure.
765 * elf_newscn.c (elf_newscn): Check for overflow.
766 * elf32_updatefile.c (__elfw2(LIBELFBITS,updatemmap)): Likewise.
767 (__elfw2(LIBELFBITS,updatefile)): Likewise.
768 * elf32_newphdr.c (elfw2(LIBELFBITS,newphdr)): Likewise.
769 * elf_getarsym.c (elf_getarsym): Likewise.
771 2013-11-08 Mark Wielaard <mjw@redhat.com>
773 * elf32_updatefile.c (elfXX_updatemmap): Only memcpy ehdr when not
774 already directly mmapped.
776 2013-11-05 Mark Wielaard <mjw@redhat.com>
778 * elf32_updatefile.c (elfXX_updatefile): Copy all section headers
781 2013-11-01 Michael Forney <mforney@mforney.org>
783 * Makefile.am: Use READELF.
785 2013-10-01 Petr Machata <pmachata@redhat.com>
787 * elf.h: Update from glibc.
789 2013-06-17 Petr Machata <pmachata@redhat.com>
791 * elf.h: Update from glibc.
793 2013-08-28 Namhyung Kim <namhyung@gmail.com>
795 * gelf.h (gelf_fsize): Fix typo in comment.
797 2013-08-28 Mark Wielaard <mjw@redhat.com>
799 * gelf_getauxv.c (gelf_getauxv): Add missing whitespace.
801 2013-08-27 Mark Wielaard <mjw@redhat.com>
803 * gelf_getauxv.c (gelf_getauxv): Remove unnecessary casts to char *.
805 2013-08-25 Kurt Roeckx <kurt@roeckx.be>
807 * gelf_getauxv.c (gelf_getauxv): Use memcpy instead of pointer
808 dereference to avoid alignment problems.
810 2013-01-07 Roland McGrath <roland@hack.frob.com>
812 * elf_getarsym.c (elf_getarsym): Copy FILE_DATA into stack space if it
813 would be unaligned and !ALLOW_UNALIGNED.
815 * elf_getarsym.c (read_number_entries): Use memcpy instead of pointer
816 dereference so as not to assume the field is naturally aligned.
818 2012-09-17 Petr Machata <pmachata@redhat.com>
820 * elf.h: Update from glibc.
822 2012-08-16 Roland McGrath <roland@hack.frob.com>
824 * elf.h: Update from glibc.
826 2012-08-14 Mark Wielaard <mjw@redhat.com>
828 * elf32_checksum.c (ebl_debugscn_p): Removed unused define and
829 confusing outdated comment.
831 2012-08-01 Petr Machata <pmachata@redhat.com>
833 * elf_getarsym (read_number_entries): New function.
834 (elf_getarsym): Handle 64-bit symbol table, stored in special
835 entry named "/SYM64/".
836 * elf_begin.c (__libelf_next_arhdr_wrlock): Don't reject archive
837 because it contains 64-bit symbol table.
839 2012-07-19 Mark Wielaard <mjw@redhat.com>
841 * elf32_getshdr.c (load_shdr_wrlock): Add elf->flags & ELF_F_MALLOCED
844 2012-07-17 Petr Machata <pmachata@redhat.com>
846 * elf32_xlatetom.c (elfw2(LIBELFBITS, xlatetom)): Do not check for
847 integer number of records in case of ELF_T_NHDR.
849 2012-04-02 Mark Wielaard <mjw@redhat.com>
851 * elf32_offscn.c: Do not match SHT_NOBITS sections at OFFSET unless
852 there are no nonempty sections at that offset.
854 2012-03-21 Roland McGrath <roland@hack.frob.com>
856 * elf-knowledge.h (SECTION_STRIP_P): Remove < SHT_NUM check.
858 2011-02-26 Mark Wielaard <mjw@redhat.com>
860 * elf_end.c (elf_end): Call rwlock_unlock before rwlock_fini.
862 2011-01-05 Jan Kratochvil <jan.kratochvil@redhat.com>
864 * elf_getdata_rawchunk.c (elf_getdata_rawchunk): Fix off64_t overflow
865 when MAXIMUM_SIZE == ~0.
867 2010-08-18 Roland McGrath <roland@redhat.com>
869 * gelf_fsize.c (__libelf_type_sizes): Add entries for ELF_T_LIB
871 Reported by Mark Hatle <mark.hatle@windriver.com>.
873 * exttypes.h: Add cases for ElfNN_Lib.
874 Reported by Mark Hatle <mark.hatle@windriver.com>.
876 2010-06-14 Ulrich Drepper <drepper@redhat.com>
878 * gelf_update_shdr.c: Implicitly set ELF_F_DIRTY bit.
879 * gelf_update_phdr.c: Likewise.
880 * gelf_update_ehdr.c: Likewise.
882 2010-04-14 Roland McGrath <roland@redhat.com>
884 * elf32_getphdr.c: Check for e_phoff/size outside the file bounds.
885 * elf_begin.c (file_read_elf): Don't set .phdr here.
887 2010-04-13 Roland McGrath <roland@redhat.com>
889 * elf.h: Update from glibc.
891 2010-04-06 Roland McGrath <roland@redhat.com>
893 * elf_error.c (ELF_E_FD_MISMATCH_IDX): Avoid nonobvious abbreviation
896 2010-04-01 Petr Machata <pmachata@redhat.com>
898 * elf_getdata.c (__elf_getdata_rdlock): Initialize data.s for data
899 that do not need a conversion.
901 2010-03-11 Roland McGrath <roland@redhat.com>
903 * elf.h: Update from glibc.
905 2010-03-04 Ulrich Drepper <drepper@redhat.com>
907 * elf.h: Update from glibc.
909 2010-02-17 Roland McGrath <roland@redhat.com>
911 * elf_begin.c (file_read_elf): Leave section rawdata_base and
912 data_base pointers null when [sh_offset,sh_size) points outside
915 2010-02-15 Roland McGrath <roland@redhat.com>
917 * Makefile.am: Use config/eu.am for common stuff.
919 2010-01-07 Roland McGrath <roland@redhat.com>
921 * elf32_getphdr.c: Use __elf_getphdrnum_rdlock.
922 * gelf_getphdr.c: Likewise.
923 * gelf_update_phdr.c: Likewise.
924 * elf32_updatefile.c (__elf32_updatemmap, __elf32_updatefile): Likewise.
925 * elf32_updatenull.c (__elf32_updatenull_wrlock): Likewise.
926 * elf32_newphdr.c: Clear section 0's sh_info when resetting e_phnum.
927 If COUNT is too large, use store PN_XNUM instead and set sh_info.
928 * elf_begin.c (file_read_elf): Always allocate space we can use later
929 for section 0 if doing RDWR.
931 * elf_getphdrnum.c: New file.
932 * Makefile.am (libelf_a_SOURCES): Add it.
933 * libelf.h: Declare elf_getphdrnum.
934 * libelfP.h: Declare __elf_getphdrnum_rdlock.
935 * libelf.map (ELFUTILS_1.6): New set, add elf_getphdrnum.
937 * elf.h: Update from glibc.
939 2009-10-23 Lubomir Rintel <lkundrak@v3.sk>
941 * elf32_updatefile.c (fill_mmap): When starting past shdr_end, start
942 filling from section start, not shdr_end.
944 2009-11-10 Roland McGrath <roland@redhat.com>
946 * elf_readall.c (__libelf_readall): Fetch file size if not yet known.
948 2009-11-06 Mark Wielaard <mjw@redhat.com>
950 * elf_next.c (elf_next): Mark the archive header as unusable when
951 there is no next ar element.
953 2009-08-12 Mark Wielaard <mjw@redhat.com>
955 * Makefile.am (libelf.so): Use -Wl,-z,defs not -defs.
957 2009-07-26 Ulrich Drepper <drepper@redhat.com>
959 * elf.h: Update from glibc.
961 2009-07-21 Ulrich Drepper <drepper@redhat.com>
963 * elf32_updatefile.c (__elfXX_updatemmap): Fix handling of gaps between
964 sections. Patch by Lubomir Rintel <lkundrak@v3.sk>.
966 2009-07-08 Roland McGrath <roland@redhat.com>
968 * libelfP.h (struct Elf): Remove unused ar.has_index field.
969 Reorder various members for optimal packing.
971 2009-07-08 Ulrich Drepper <drepper@redhat.com>
973 * elf.h: Update from glibc.
975 2009-06-13 Ulrich Drepper <drepper@redhat.com>
977 * Makefile.am (libelf_a_SOURCES): Replace elf_getshnum.c and
978 elf_getshstrndx.c with elf_getshdrnum.c and elf_getshdrstrndx.c.
979 * elf_getshnum.c: Renamed to...
980 * elf_getshdrnum.c: ...this. Rename function and add old name as
981 alias. Likewise for internal functions with derived names.
982 * elf_getshstrndx.c: Renamed to...
983 * elf_getshdrstrndx.c: ...this. Rename function and add old name as
984 alias. Likewise for internal functions with derived names.
985 * libelf.h: Add prototypes for new names. Make old names as
987 * libelfP.h: Rename internal function prototypes.
988 * libelf.map: Export for names.
989 * elf32_checksum.c: Don't use deprecated functions.
990 * elf32_getshdr.c: Likewise.
992 2009-06-01 Ulrich Drepper <drepper@redhat.com>
994 * elf.h: Update from glibc.
996 2009-04-14 Roland McGrath <roland@redhat.com>
998 * elf.h: Update from glibc.
1000 2009-04-01 Roland McGrath <roland@redhat.com>
1002 * elf.h: Update from glibc.
1004 2009-02-10 Ulrich Drepper <drepper@redhat.com>
1006 * elf32_updatefile.c (updatefile): For the zeroth section we still
1007 have to copy the section header.
1009 2009-02-01 Ulrich Drepper <drepper@redhat.com>
1011 * elf_strptr.c: Add comment re possible problem.
1013 2009-01-26 Ulrich Drepper <drepper@redhat.com>
1015 * elf32_updatenull.c (updatenull_wrlock): Fix comment of
1016 ELF_F_LAYOUT behaviour re section header table.
1018 2009-01-22 Ulrich Drepper <drepper@redhat.com>
1020 * elf32_updatefile.c (__elfXX_updatemmap): Fill the gap between
1021 sections even if only the section at the start of the gap has been
1023 (__elfXX_updatefile): Likewise.
1025 2009-01-21 Ulrich Drepper <drepper@redhat.com>
1027 * elf32_updatefile.c (__elfXX_updatemmap): Skip most of the loop to
1028 handle sections for NOBITS sections.
1029 (elfXX_updatefile): Likewise.
1031 * elf32_updatefile.c (__elfXX_updatemmap): When skipping non-NOBITS
1032 sections we haven't loaded, update last_position based on scn_start,
1033 not based on old value. Don't run the loop for the dummy section 0.
1034 (elfXX_updatefile): Don't run the loop for the dummy section 0.
1036 2009-01-10 Ulrich Drepper <drepper@redhat.com>
1038 * libelfP.h (_): We only have one translation domain, elfutils.
1040 * Makefile.am: Use USE_LOCKS instead of USE_TLS.
1041 * elf_error.c: Always use __thread. Remove all !USE_TLS code.
1043 2009-01-04 Roland McGrath <roland@redhat.com>
1045 * note_xlate.h (elf_cvt_note): Don't examine a size too small to
1046 container a note header.
1048 2008-12-11 Roland McGrath <roland@redhat.com>
1050 * elf32_updatefile.c (__elfw2(LIBELFBITS,updatemmap)): Handle
1051 placement offset going backwards, for out-of-order or overlapping
1052 (bogus) sh_offset layouts. It's a dumb use, but should not crash.
1053 (__elfw2(LIBELFBITS,updatefile)): Likewise.
1056 * libelf.h (Elf_Data): Whitespace fix.
1058 2008-12-10 Roland McGrath <roland@redhat.com>
1060 * elf_getarhdr.c (elf_getarhdr): Fix missing rename in last change.
1062 2008-10-22 Petr Machata <pmachata@redhat.com>
1064 * elf_rawfile.c (elf_rawfile): Lock around elf-> references.
1066 2008-10-21 Petr Machata <pmachata@redhat.com>
1068 * libelfP.h: Rename getehdr_rdlock to getehdr_wrlock.
1069 * elf32_getehdr.c (getehdr_rdlock): Move the code to new function
1070 getehdr_impl and make it a wrapper. Rename to getehdr_wrlock.
1071 (getehdr_impl): Guard elf->class init with wrlock.
1072 (getehdr): Also make it a wrapper of getehdr_impl.
1073 * elf32_updatenull.c (updatenull_wrlock): Call getehdr_wrlock.
1075 2008-10-20 Petr Machata <pmachata@redhat.com>
1077 * elf_getdata_rawchunk.c (elf_getdata_rawchunk): Lock around the
1078 code that reads mutable elf state. Relock to write lock to chain
1079 the new chunk on the elf rawchunks list.
1081 2008-10-20 Petr Machata <pmachata@redhat.com>
1083 * elf32_checksum.c (checksum): Place a lock around the code that
1084 processes data. Make it wrlock if the code needs to xlate the
1085 data before processing.
1087 2008-10-16 Petr Machata <pmachata@redhat.com>
1090 (__libelf_next_arhdr): Rename to __libelf_next_arhdr_wrlock.
1091 (dup_elf): Adjust the call.
1092 (elf_begin): New local function lock_dup_elf. Relocks the elf if
1093 necessary before calling dup. Call this instead of dup_elf.
1095 (elf_getarhdr): Lock before calling __libelf_next_arhdr_wrlock.
1096 * elf_next.c (elf_next): Likewise.
1097 * elf_rand.c (elf_rand): Likewise.
1099 2008-10-14 Petr Machata <pmachata@redhat.com>
1101 * elf_getdata.c (__elf_getdata_rdlock): Lock before converting.
1103 2008-11-26 Roland McGrath <roland@redhat.com>
1105 * elf.h: Update from glibc.
1107 2008-10-06 Roland McGrath <roland@redhat.com>
1109 * elf_getarhdr.c (elf_getarhdr): Return NULL when passed NULL.
1111 2008-08-27 Roland McGrath <roland@redhat.com>
1113 * elf_begin.c (get_shnum): Avoid misaligned reads for matching endian.
1115 * libelfP.h [!ALLOW_UNALIGNED] (__libelf_type_align): Fix CLASS index.
1117 2008-08-25 Roland McGrath <roland@redhat.com>
1119 * Makefile.am (libelf_so_LDLIBS): New variable.
1120 (libelf.so): Use it in the link.
1122 2008-08-21 Petr Machata <pmachata@redhat.com>
1124 * elf_getdata.c, libelfP.h
1125 (__elf_getdata_internal): Rename to __elf_getdata_rdlock.
1126 (__libelf_set_rawdata_wrlock): New function.
1127 (__libelf_set_rawdata): Make it a wrapper that calls *_wrlock.
1128 * elf32_updatenull.c, libelfP.h
1129 (__elfNN_updatenull): Rename to __elfNN_updatenull_wrlock.
1131 2008-08-21 Petr Machata <pmachata@redhat.com>
1133 * elf32_getphdr.c, libelfP.h
1134 (__elfNN_getphdr_internal): Drop. Move __elfNN_getphdr_internal
1135 code to __elfNN_getphdr_wrlock.
1136 (__elfNN_getphdr_rdlock, __elfNN_getphdr_wrlock): New functions.
1137 (__elfNN_getphdr_rdlock, __elfNN_getphdr_wrlock): Make these
1138 wrappers of getphdr_impl.
1140 2008-08-21 Petr Machata <pmachata@redhat.com>
1142 * elf32_getehdr.c, libelfP.h
1143 (__elfNN_getehdr_internal): Rename to __elfNN_getehdr_rdlock.
1144 * gelf_getehdr, libelfP.h:
1145 (__gelf_getehdr_internal): Rename to __gelf_getehdr_rdlock.
1147 2008-08-21 Petr Machata <pmachata@redhat.com>
1150 (__elfNN_getshdr_internal): Drop.
1151 (load_shdr_wrlock, scn_valid): New functions, contain bits of
1152 behaviour from __elfNN_getshdr_internal.
1153 (__elfNN_getshdr_rdlock, __elfNN_getshdr_wrlock): Replacements for
1154 dropped _internal functions above.
1156 (__elf_getshnum_internal): Rename to __elf_getshnum_rdlock.
1158 2008-08-04 Petr Machata <pmachata@redhat.com>
1160 * libelfP.h (RWLOCK_RDLOCK, RWLOCK_WRLOCK, RWLOCK_UNLOCK): New macros.
1162 2008-07-28 Roland McGrath <roland@redhat.com>
1164 * elf.h: Update from glibc.
1166 2008-03-31 Roland McGrath <roland@redhat.com>
1168 * elf32_offscn.c: Make sure shdrs have been read in.
1170 2008-02-19 Roland McGrath <roland@redhat.com>
1172 * elf.h: Update from glibc.
1174 2008-02-08 Roland McGrath <roland@redhat.com>
1176 * elf.h: Update from glibc.
1178 2008-01-31 Ulrich Drepper <drepper@redhat.com>
1180 * elf_strptr.c (elf_strptr): Don't fail if the ELF file is currently
1181 under construction and no raw data can be read from disk.
1183 2008-01-30 Roland McGrath <roland@redhat.com>
1185 * elf.h: Update from glibc.
1187 2008-01-26 Roland McGrath <roland@redhat.com>
1189 * elf_begin.c (__libelf_next_arhdr): Rewrite conversions using a macro.
1190 Fixes various pastos in wrong type in sizeof, wrong string parsed.
1192 2008-01-20 Roland McGrath <roland@redhat.com>
1194 * elf_getaroff.c: Calculate from start_offset, instead of using
1195 parent's state.ar.offset field.
1197 2008-01-08 Roland McGrath <roland@redhat.com>
1199 * Makefile.am (euinclude): Variable removed.
1200 (pkginclude_HEADERS): Set this instead of euinclude_HEADERS.
1202 2008-01-03 Roland McGrath <roland@redhat.com>
1204 * common.h: Add __attribute__ ((unused)) to static functions.
1206 2007-12-20 Ulrich Drepper <drepper@redhat.com>
1208 * Makefile.am (libelf_a_SOURCES): Add elf_scnshndx.
1209 * libelfP.h (struct Elf_Scn): Add shndx_index field.
1210 Declare __elf_scnshndx_internal.
1211 * elf32_getshdr.c: Record location of extended section header.
1212 * elf_begin.c (file_read_elf): Likewise.
1213 * elf_scnshndx.c: New file.
1214 * libelf.h: Declare elf_scnshndx.
1215 * libelf.map: Add elf_scnshndx to version ELFUTILS_1.4.
1217 2007-11-12 Roland McGrath <roland@redhat.com>
1219 * libelf.h: Replace off64_t with loff_t throughout.
1220 Only that type name is unconditionally defined by <sys/types.h>
1222 2007-11-03 Roland McGrath <roland@redhat.com>
1224 * libelf.h (Elf_Data): Comment fix.
1226 2007-10-18 Roland McGrath <roland@redhat.com>
1228 * elf.h: Update from glibc.
1230 2007-10-07 Roland McGrath <roland@redhat.com>
1232 * elf_begin.c (__libelf_next_arhdr): Fix fencepost error and wrong
1233 member access in terminating name with no trailing /. Trim trailing
1234 spaces when there is no /.
1236 2007-10-04 Roland McGrath <roland@redhat.com>
1238 * elf_end.c (elf_end): Don't free ELF->state.ar.ar_sym when it's -1l.
1240 2007-10-03 Roland McGrath <roland@redhat.com>
1242 * libelf.h (Elf_Data): Use off64_t for d_off.
1243 (Elf_Arhdr): Use off64_t for ar_size.
1244 (elf_update, elf_getbase, elf_getaroff): Return off64_t.
1246 * gelf_rawchunk.c: File removed.
1247 * gelf_freechunk.c: File removed.
1248 * Makefile.am (libelf_a_SOURCES): Remove them.
1249 * libelf.map (ELFUTILS_1.0): Remove exports.
1250 * gelf.h: Remove decls.
1252 * elf_getdata_rawchunk.c: New file.
1253 * Makefile.am (libelf_a_SOURCES): Add it.
1254 * libelf.map (ELFUTILS_1.3): Add elf_getdata_rawchunk.
1255 * libelf.h: Declare it.
1256 * libelfP.h (Elf_Data_Chunk): New type.
1257 (struct Elf.elf): New member `rawchunks'.
1258 * elf_end.c (elf_end): Free recorded rawchunk buffers.
1260 2007-08-24 Roland McGrath <roland@redhat.com>
1262 * gelf_getnote.c: New file.
1263 * Makefile.am (libelf_a_SOURCES): Add it.
1264 * gelf.h: Declare gelf_getnote.
1265 * libelf.map (ELFUTILS_1.3): Add gelf_getnote.
1267 * libelfP.h (NOTE_ALIGN): New macro.
1268 * note_xlate.h: New file.
1269 * Makefile.am (noinst_HEADERS): Add it.
1270 * gelf_xlate.c: Include it.
1271 (__elf_xfctstom): Use elf_cvt_note.
1272 * elf_getdata.c (shtype_map, __libelf_type_align): Handle SHT_NOTE.
1273 (__libelf_set_rawdata): Likewise.
1275 2007-08-19 Roland McGrath <roland@redhat.com>
1277 * gelf_update_auxv.c: New file.
1278 * gelf_getauxv.c: New file.
1279 * Makefile.am (libelf_a_SOURCES): Add them.
1280 * gelf.h: Declare gelf_getauxv, gelf_update_auxv.
1281 * libelf.map (ELFUTILS_1.3): New set, inherits fom ELFUTILS_1.2.
1282 Export gelf_getauxv, gelf_update_auxv.
1284 * libelf.h (Elf_Type): Add ELF_T_AUXV.
1285 * abstract.h: Add auxv_t entries.
1286 * exttypes.h: Likewise.
1287 * gelf_xlate.h: Likewise.
1288 * gelf_xlate.c (__elf_xfctstom): Add ELF_T_AUXV entries.
1289 * gelf_fsize.c (__libelf_type_sizes): Likewise.
1291 2007-08-12 Roland McGrath <roland@redhat.com>
1293 * elf32_updatefile.c (compare_sections): Sort secondarily on sh_size,
1294 and only tertiarily on index.
1296 2007-07-09 Roland McGrath <roland@redhat.com>
1298 * elf.h: Update from glibc.
1300 2007-04-22 Roland McGrath <roland@redhat.com>
1302 * elf.h: Update from glibc.
1304 2007-03-18 Roland McGrath <roland@redhat.com>
1306 * elf_begin.c (get_shnum): Fix test for e_shoff being out of bounds.
1307 Return zero when the section headers do not fit within MAXSIZE.
1309 2007-03-09 Roland McGrath <roland@redhat.com>
1311 * libelfP.h (LIBELF_EV_IDX): New macro.
1312 (__libelf_type_align): New macro.
1313 [! ALLOW_UNALIGNED]: Declare __libc_type_aligns array.
1314 * elf_getdata.c (shtype_map): Convert to just Elf_Type[][].
1315 (convert_data, __libelf_set_rawdata): Use that, __libelf_type_align,
1316 and __libelf_type_sizes, in place of old table.
1317 (__libc_type_aligns): New const variable.
1319 2007-02-04 Ulrich Drepper <drepper@redhat.com>
1321 * Makefile (libelf.so): Build with -z relro.
1323 * elf_begin.c (read_file): When using ELF_C_READ_MMAP use MAP_PRIVATE.
1325 2007-01-30 Ulrich Drepper <drepper@redhat.com>
1327 * nlist.c: Close file descriptor before returning.
1329 2007-01-20 Roland McGrath <roland@redhat.com>
1331 * gnuhash_xlate.h (elf_cvt_gnuhash): Fix fence-post error so we
1332 convert the final word.
1334 * elf32_getshdr.c: Don't byteswap shdr fields when EI_DATA matches
1335 MY_ELFDATA on !ALLOW_UNALIGNED machines.
1337 2007-01-18 Roland McGrath <roland@redhat.com>
1339 * gelf_rawchunk.c (gelf_rawchunk): Clear RESULT pointer after freeing
1342 2006-10-13 Roland McGrath <roland@redhat.com>
1344 * elf32_updatenull.c: Look for and accept phdr also for ET_CORE.
1345 * elf_error.c (msgstr): Change ELF_E_INVALID_PHDR string.
1347 2006-08-29 Roland McGrath <roland@redhat.com>
1349 * elf32_getphdr.c: Don't byteswap phdr fields when EI_DATA matches
1350 MY_ELFDATA on !ALLOW_UNALIGNED machines.
1351 Reported by Christian Aichinger <Greek0@gmx.net>.
1353 * Makefile.am (CLEANFILES): Add libelf.so.$(VERSION).
1355 2006-08-08 Ulrich Drepper <drepper@redhat.com>
1357 * elf.h (DT_VALNUM): Update.
1358 (DT_ADDRNUM): Likewise.
1360 2006-07-12 Ulrich Drepper <drepper@redhat.com>
1362 * elf32_updatefile.c: Adjust for internal_function_def removal.
1363 * elf32_updatenull.c: Likewise.
1364 * elf_begin.c: Likewise.
1365 * elf_getdata.c: Likewise.
1367 2006-07-11 Ulrich Drepper <drepper@redhat.com>
1369 * libelf.h: Define ELF_T_GNUHASH.
1370 * elf_getdata.c (TYPEIDX): Handle SHT_GNU_HASH.
1371 (shtype_map): Add SHT_GNU_HASH entries.
1372 * gelf_xlate.c (__elf_xfctstom): Add ELF_T_GNUHASH entries.
1373 * gnuhash_xlate.h: New file.
1374 * Makefile.am (noinst_HEADERS): Add gnuhash_xlate.h.
1376 2006-07-06 Ulrich Drepper <drepper@redhat.com>
1378 * elf_gnu_hash.c: New file.
1379 * libelf.h: Declare elf_gnu_hash.
1380 * Makefile.am (libelf_a_SOURCES): Add elf_gnu_hash.
1381 * libelf.map: Add elf_gnu_map for version ELFUTILS_1.2.
1383 2006-06-15 Roland McGrath <roland@redhat.com>
1385 * libelf.h (elf_getarsym): Fix comment typo.
1386 Rename second parameter to be more explanatory.
1387 (elf_getident, elf_rawhide): Likewise.
1389 2006-05-28 Ulrich Drepper <drepper@redhat.com>
1391 * elf32_updatefile.c (updatemmap): Preserve section content if
1392 copying would overwrite them.
1393 Fix msync paramters.
1395 2006-04-04 Roland McGrath <roland@redhat.com>
1397 * elf32_updatefile.c (updatemmap): Handle other-endian case.
1399 2006-04-04 Ulrich Drepper <drepper@redhat.com>
1401 * elf32_updatefile.c (updatemmap): Cleanups. Remove shdr_dest
1402 variable. Before writing sections, make a copy of the section
1403 header data if necessary. Don't write section header while
1404 writing the section constent, it might overwrite some sections.
1405 Restore the pointer afterwards.
1406 * elf32_updatenull.c (updatenull): If the offset of a section in a
1407 file changed make sure we read the section so that it'll be written
1410 * elf_update.c: Remove debug message.
1412 2005-12-07 Roland McGrath <roland@redhat.com>
1414 * gelf_xlate.c [! ALLOW_UNALIGNED] (union unaligned): New type.
1415 (FETCH, STORE): New macros.
1416 (INLINE3): Use those to do alignment-friendly conversion.
1418 * elf32_getshdr.c: Include map_address and start_offset in alignment
1420 * elf32_getphdr.c: Likewise.
1422 2005-11-19 Roland McGrath <roland@redhat.com>
1424 * elf.h: Update from glibc.
1426 2005-11-17 Roland McGrath <roland@redhat.com>
1428 * elf.h: Update from glibc.
1430 2005-11-10 Roland McGrath <roland@redhat.com>
1432 * elf.h: Update from glibc.
1434 2005-09-09 Roland McGrath <roland@redhat.com>
1436 * elf_update.c (write_file): Stat the file and fchmod it after update
1437 if its mode had S_ISUID or S_ISGID bits set.
1439 2005-08-28 Ulrich Drepper <drepper@redhat.com>
1441 * elf32_getphdr.c: Include <system.h>. Use pread_retry instead of
1442 pread. And branch prediction where useful.
1443 * elf_begin.c: Likewise.
1444 * elf_getdata.c: Likewise.
1445 * elf_getshstrndx.c: Likewise.
1446 * elf_readall.c: Likewise.
1447 * gelf_rawchunk.c: Likewise.
1448 * elf32_updatefile.c: Include <system.h>. Use pread_retry instead of
1449 pread. And branch prediction where useful.
1450 * elf_getarsym.c: Don't define pread_retry here.
1452 * Makefile.am: Use $(LINK) not $(CC) when creating DSO.
1453 (%.os): Use COMPILE.os.
1454 (COMPILE.os): Filter out gconv options.
1456 2005-08-27 Ulrich Drepper <drepper@redhat.com>
1458 * elf_begin.c (file_read_elf): Avoid reading ELF header from file
1459 again. Instead accept additional parameter which points to it if we
1461 (get_shnum): Use passed in e_ident value as source of ELF header.
1463 2005-08-15 Ulrich Drepper <drepper@redhat.com>
1465 * elf_begin.c (__libelf_next_arhdr): Use TEMP_FAILURE_RETRY.
1467 * Makefile (libelf_a_SOURCES): Add elf_getaroff.c.
1468 * libelf.map: Export elf_getaroff.
1469 * libelf.h: Declare elf_getaroff.
1470 * elf_getaroff.c: New file.
1472 2005-08-13 Ulrich Drepper <drepper@redhat.com>
1474 * elf_begin.c (get_shnum): Optimize memory handling. Always read from
1475 mapped file if available. Fix access to 64-bit sh_size. Recognize
1477 (file_read_elf): Likewise.
1479 2005-08-12 Roland McGrath <roland@redhat.com>
1481 * elf32_offscn.c: Do not match empty sections at OFFSET unless
1482 there are no nonempty sections at that offset.
1484 2005-08-07 Ulrich Drepper <drepper@redhat.com>
1486 * elf.h: Update from glibc.
1488 2005-08-06 Ulrich Drepper <drepper@redhat.com>
1490 * Makefile.am (AM_CFLAGS): Add -fpic when BUILD_STATIC.
1492 2005-08-03 Ulrich Drepper <drepper@redhat.com>
1494 * libelf.map: Move elf32_offscn, elf64_offscn, and gelf_offscn in
1495 new version ELFUTILS_1.1.1.
1497 2005-08-02 Ulrich Drepper <drepper@redhat.com>
1499 * elf_error.c: Add handling of ELF_E_INVALID_OFFSET.
1500 * elf32_offscn.c: New file.
1501 * elf64_offscn.c: New file.
1502 * gelf_offscn.c: New file.
1503 * Makefile.am (libelf_a_SOURCES): Add elf32_offscn.c, elf64_offscn.c,
1505 * libelf.sym: Export new symbols.
1507 2005-07-23 Ulrich Drepper <drepper@redhat.com>
1509 * elf-knowledge.h (SECTION_STRIP_P): Don't handle removal of debug
1510 sections here anymore.
1511 * elf32_checksum.c: Adjust for change in SECTION_STRIP_P interface.
1513 * elf_update.c (elf_update): Get write lock, not read lock.
1515 * elf32_updatenull.c (updatenull): Get section headers if necessary
1518 2005-07-22 Ulrich Drepper <drepper@redhat.com>
1520 * elf32_updatenull.c (updatenull): If program header hasn't been loaded
1521 yet, try to do it now.
1522 Don't unnecessarily update overflow of section count in zeroth section
1524 If section content hasn't been read yet, do it before looking for the
1525 block size. If no section data present, infer size of section header.
1527 2005-05-11 Ulrich Drepper <drepper@redhat.com>
1529 * elf.h: Update again.
1531 2005-05-09 Ulrich Drepper <drepper@redhat.com>
1533 * elf.h: Update from glibc.
1535 2005-05-08 Roland McGrath <roland@redhat.com>
1537 * elf_begin.c (read_file) [_MUDFLAP]: Don't use mmap for now.
1538 * elf_update.c (write_file) [_MUDFLAP]: Likewise.
1540 2005-03-29 Ulrich Drepper <drepper@redhat.com>
1542 * elf32_checksum.c: Use INTUSE and INTDEF to avoid PLTs.
1543 * elf_end.c: Likewise.
1544 * elf_getdata.c: Likewise.
1545 * gelf_getehdr.c: Likewise.
1546 * nlist.c: Likewise.
1547 * libelfP.h: Add declarations of internal functions.
1549 2005-02-15 Ulrich Drepper <drepper@redhat.com>
1551 * common.h (CONVERT): Make sure all values are unsigned.
1552 (CONVERT_TO): Likewise.
1554 * Makefile.am (AM_CFLAGS): Add -Wformat=2.
1555 Fix rule to build libelf.so.
1557 2005-02-06 Ulrich Drepper <drepper@redhat.com>
1559 * Makefile.am: Cleanup AM_CFLAGS handling. Add -Wunused -Wextra.
1560 Remove lint handling.
1561 * elf32_getphdr.c: Minor cleanups.
1562 * elf32_getshdr.c: Likewise.
1563 * elf32_updatefile.c: Likewise.
1564 * elf32_updatenull.c: Likewise.
1565 * elf_begin.c: Likewise.
1566 * elf_error.c: Likewise.
1567 * elf_getarsym.c: Likewise.
1568 * elf_getdata.c: Likewise.
1569 * elf_update.c: Likewise.
1570 * gelf_xlate.c: Likewise.
1572 2005-02-05 Ulrich Drepper <drepper@redhat.com>
1574 * Makefile.am: Check for text relocations in constructed DSO.
1576 * Makefile.am [MUDFLAP] (AM_CFLAGS): Add -Werror -fpic -fmudflap.
1578 2005-02-04 Ulrich Drepper <drepper@redhat.com>
1580 * gelf_getehdr.c (gelf_getehdr): Slight optimization.
1582 * elf32_checksum.c (checksum): Do not look at NOBITS sections.
1584 * gelf.h: Add gelf_checksum prototype.
1586 2004-09-25 Ulrich Drepper <drepper@redhat.com>
1588 * elf32_checksum.c: Make compile with gcc 4.0.
1589 * elf32_updatefile.c: Likewise.
1590 * elf32_updatenull.c: Likewise.
1591 * elf_begin.c: Likewise.
1592 * elf_error.c: Likewise.
1593 * elf_getdata.c: Likewise.
1594 * elf_getident.c: Likewise.
1596 2004-04-01 Ulrich Drepper <drepper@redhat.com>
1598 * elf.h: Update from glibc.
1600 2004-01-23 Ulrich Drepper <drepper@redhat.com>
1602 * elf_update.c: Fix locking.
1603 * elf_clone.c: Likewise.
1605 * libelf.h: Define ELF_T_LIB.
1606 * gelf_getlib.c: New file.
1607 * gelf_update_lib.c: New file.
1608 * gelf.h: Declare the new functions. Define GElf_Lib.
1609 * abstract.h: Define Lib, Lib32, Lib64.
1610 * gelf_xlate.c (__elf_xfctstom): Add ELF_T_LIB entry.
1611 * gelf_xlate.h: Add entry for ElfXX_Lib.
1612 * elf_getdata.c: Recognize SHT_GNU_LIBLIST as a known section type.
1613 * libelf.map: Add new symbols to ELFUTILS_1.1.
1614 * Makefile.am (libelf_a_SOURCES): Add gelf_getlib.c and
1617 2004-01-17 Ulrich Drepper <drepper@redhat.com>
1619 * Makefile.am: Support building with mudflap.
1621 * gelf_xlate.c (INLINE3): Avoid using cast as lvalue.
1622 * dl-hash.h (_dl_elf_hash): Likewise.
1624 2004-01-05 Ulrich Drepper <drepper@redhat.com>
1626 * elf-knowledge.h: New file. From libelf subdir.
1627 * Makefile.am (euincludedir): Define.
1628 (euinclude_HEADERS): Add elf-knowledge.h.
1630 2003-09-24 Ulrich Drepper <drepper@redhat.com>
1632 * elf.h: Define some PT_IA_64_HP_* constants.
1634 2003-09-23 Jakub Jelinek <jakub@redhat.com>
1636 * libelfP.h (struct Elf): Move state.elf64.sizestr_offset after
1637 state.elf64.scnincr to match state.elf{,32}.
1639 2003-08-12 Ulrich Drepper <drepper@redhat.com>
1641 * elf32_updatefile.c (__updatemmap): When writing back file where
1642 some sections have not been read in, count their sizes based on
1645 2003-08-11 Ulrich Drepper <drepper@redhat.com>
1647 * Moved to CVS archive.