12022-10-28 Mark Wielaard <mark@klomp.org> 2 3 * elf.h: Update from glibc. 4 52022-10-21 Yonggang Luo <luoyonggang@gmail.com> 6 7 * libelf_crc32.c: Remove LIB_SYSTEM_H define. 8 92022-09-20 Yonggang Luo <luoyonggang@gmail.com> 10 11 * elf32_checksum.c: Use BYTE_ORDER, LITTLE_ENDIAN and BIG_ENDIAN. 12 * elf32_xlatetof.c: Likewise. 13 * elf_getarsym.c: Likewise. 14 152022-10-16 Yonggang Luo <luoyonggang@gmail.com> 16 17 * common.h: Remove ar.h, byteswap.h and endian.h. 18 * elf32_checksum.c: Remove endian.h. 19 * elf32_getphdr.c: Remove unistd.h and system.h. 20 * elf32_getshdr.c: Remove unistd.h.h and system.h. 21 * elf32_updatefile.c: Remove unistd.h, sys/mman.h and system.h. 22 * elf32_updatenull.c: Remove endian.h and system.h. 23 * elf32_xlatetof.c: Remove endian.h. 24 * elf32_xlatetom.c: Likewise. 25 * elf_begin.c: Remove unistd.h, sys/mman.h and system.h. 26 * elf_cntl.c: Remove unistd.h. 27 * elf_compress.c: Remove system.h and unistd.h. 28 * elf_end.c: Remove sys.mman.h. 29 * elf_getarsym.c: Remove byteswap.h, endian.h, unistd.h and 30 system.h. 31 * elf_getdata.c: Remove unistd.h and system.h. 32 * elf_getdata_rawchunk.c: Remove unistd.h and system.h. 33 * elf_getshdrstrndx.c: Likewise. 34 * elf_readall.c: Likewise. 35 * elf_update.c: Remove unistd.h and sys/mman.h. 36 * gelf_xlate.c: Remove byteswap.h. 37 * libelfP.h: Add system.h. 38 * nlist.c: Remove unistd.h. 39 402022-08-28 Mark Wielaard <mark@klomp.org> 41 42 * elf_begin.c (__libelf_next_arhdr_wrlock): Add OCT_FIELD macro, 43 like INT_FIELD but use strtol with octal base 8. Use for ar_mode. 44 452022-08-08 Andreas Schwab <schwab@suse.de> 46 47 * elf.h: Update from glibc. 48 492022-04-24 Mark Wielaard <mark@klomp.org> 50 51 * elf_update.c (write_file): Check HAVE_MREMAP. 52 532022-04-01 Mark Wielaard <mark@klomp.org> 54 55 * libelfP.h (struct Elf_Data_Chunk): Add an int64_t offset field. 56 * elf_getdata_rawchunk.c (elf_getdata_rawchunk): Check whether the 57 requested chunk, offset, size and type, was already handed out. 58 Set new Elf_Data_Chunk offset field. 59 602022-03-29 Mark Wielaard <mark@klomp.org> 61 62 * gelf_xlate.c (START): Define and use sz variable. 63 (END): Use sz variable to decide whether to do a memmove. 64 652022-03-24 Mark Wielaard <mark@klomp.org> 66 67 * elf.h: Update from glibc. 68 692022-03-22 Mark Wielaard <mark@klomp.org> 70 71 * elf_getdata.c (__libelf_type_aligns): ELF_T_GNUHASH has different 72 alignment for ELFCLASS32 and ELFCLASS64. 73 742022-03-20 Mark Wielaard <mark@klomp.org> 75 76 * version_xlate.h (elf_cvt_Verdef): Make sure aux_offset and 77 def_offset don't overflow. 78 (elf_cvt_Verneed): Make sure aux_offset and need_offset don't 79 overflow. 80 812022-03-18 Mark Wielaard <mark@klomp.org> 82 83 * version_xlate.h (elf_cvt_Verdef): Check alignment of def_offset 84 and aux_offset. 85 (elf_cvt_Verneed): Check alignment of need_offset and aux_offset. 86 872022-03-17 Mark Wielaard <mark@klomp.org> 88 89 * elf_begin.c (read_long_names): Check ar_size starts with a digit. 90 912022-03-17 Mark Wielaard <mark@klomp.org> 92 93 * elf_begin.c (get_shnum): Take offset into account for Shdr 94 alignment check. 95 962021-12-19 Mark Wielaard <mark@klomp.org> 97 98 * elf_begin.c (file_read_elf): Cast ehdr to uintptr_t before e_shoff 99 alignment check. Only set shdr state when scncnt is larger than zero. 100 1012021-12-16 Mark Wielaard <mark@klomp.org> 102 103 * libelfP.h (NOTE_ALIGN4): And with negative unsigned long. 104 (NOTE_ALIGN8): Likewise. 105 1062021-12-15 Mark Wielaard <mark@klomp.org> 107 108 * elf_begin.c (get_shnum): Use offsetof to get field of unaligned 109 struct. 110 1112021-09-06 Dmitry V. Levin <ldv@altlinux.org> 112 113 * common.h (allocate_elf): Remove cast of calloc return value. 114 * elf_newdata.c (elf_newdata): Likewise. 115 * elf_getscn.c (elf_getscn): Remove casts of calloc return values. 116 * elf_newscn.c (elf_newscn): Likewise. 117 * elf32_updatefile.c (__elfw2): Remove casts of malloc return values. 118 * elf_getdata.c (convert_data): Likewise. 119 (__libelf_set_rawdata_wrlock): Remove cast of malloc return value. 120 * elf_begin.c (read_long_names): Remove cast of malloc return value. 121 * elf_readall.c (__libelf_readall): Likewise. 122 * elf_getarsym.c (elf_getarsym): Remove casts of malloc and realloc 123 return values. 124 1252021-07-19 Mark Wielaard <mark@klomp.org> 126 127 * elf_strptr.c (validate_str): Check last char is zero first before 128 calling memrchr on the whole block. 129 1302021-06-09 Andrei Homescu <ah@immunant.com> 131 132 * elf_getdata.c: Fix d_align for sections where alignment is larger 133 than offset. 134 1352020-12-12 Mark Wielaard <mark@klomp.org> 136 137 * elf.h: Update from glibc. 138 1392020-12-16 Dmitry V. Levin <ldv@altlinux.org> 140 141 * libelfP.h (_): Remove. 142 1432020-12-15 Mark Wielaard <mark@klomp.org> 144 145 * elf_begin.c (get_shnum): Make sure the full Ehdr is available. 146 1472020-12-12 Dmitry V. Levin <ldv@altlinux.org> 148 149 * common.h: Fix spelling typo in comment. 150 * gelf.h: Likewise. 151 * libelf.h: Likewise. 152 * libelfP.h: Likewise. 153 * elf32_checksum.c (elfw2): Likewise. 154 * elf_begin.c (dup_elf, write_file): Likewise. 155 * elf_compress.c (__libelf_compress): Likewise. 156 * elf_compress_gnu.c (elf_compress_gnu): Likewise. 157 1582020-12-11 Dmitry V. Levin <ldv@altlinux.org> 159 160 * Makefile.am (GCC_INCLUDE): Remove. 161 1622020-12-09 Dmitry V. Levin <ldv@altlinux.org> 163 164 * Makefile.am (noinst_PROGRAMS): Rename to noinst_DATA. 165 (libelf_so_SOURCES): Remove. 166 (CLEANFILES): Add libelf.so. 167 1682020-11-30 Dmitry V. Levin <ldv@altlinux.org> 169 170 * Makefile.am (libelf.so$(EXEEXT)): Drop $(EXEEXT) suffix. 171 1722020-11-06 Mark Wielaard <mark@klomp.org> 173 174 * elf-knowledge.h (SH_ENTSIZE_HASH): Update comment. 175 1762020-11-01 Mark Wielaard <mark@klomp.org> 177 178 * elf_strptr.c (elf_strptr): Check shdr is not NULL. 179 1802020-11-01 Mark Wielaard <mark@klomp.org> 181 182 * elf_getphdrnum.c (__elf_getphdrnum_rdlock): Set *dst to zero on 183 error. 184 1852020-11-01 Mark Wielaard <mark@klomp.org> 186 187 * libelfP.h (__libelf_data_type): Take an GElf_Ehdr instead of an 188 Elf handle. 189 * elf_getdata.c (__libelf_data_type): Likewise. And check ehdr 190 directly instead of fetching a new one. 191 (__libelf_set_rawdata_wrlock): Fetch Ehdr, report an error when that 192 fails, otherwise call __libelf_data_type. 193 1942020-10-28 Mark Wielaard <mark@klomp.org> 195 196 * elf.h: Update from glibc. 197 1982020-08-28 Mark Wielaard <mark@klomp.org> 199 200 * elf.h: Update from glibc. 201 2022020-08-19 Mark Wielaard <mark@klomp.org> 203 204 * elf32_updatenull.c (updatenull_wrlock): Fixup the sh_addralign 205 of an SHF_COMPRESSED section if necessary. 206 2072020-06-04 Mark Wielaard <mark@klomp.org> 208 209 * elf.h: Update from glibc. 210 2112020-05-08 Mark Wielaard <mark@klomp.org> 212 213 * elf_strptr.c (elf_strptr): Check shdr is not NULL. 214 2152020-05-08 Mark Wielaard <mark@klomp.org> 216 217 * elf_getdata.c (__libelf_set_rawdata_wrlock): Check 218 __gelf_getehdr_rdlock return value. 219 2202020-04-25 Mark Wielaard <mark@klomp.org> 221 222 * elf_compress.c (__libelf_compress): Remove free (out_buf). 223 2242020-03-18 Omar Sandoval <osandov@fb.com> 225 226 * elf_getphdrnum.c (__elf_getphdrnum_rdlock): Call 227 __elf{32,64}_getshdr_rdlock if the shdr is not cached. 228 2292019-03-20 Matthias Maennich <maennich@google.com> 230 231 * elf_compress.c (__libelf_compress): Always call deflate_cleanup 232 in failure path. Call deflateEnd only once. 233 (__libelf_decompress): Call inflateEnd only once. 234 2352019-06-18 Mark Wielaard <mark@klomp.org> 236 237 * common.h (allocate_elf): Use int64_t instead of off_t for offset. 238 * elf32_newphdr.c (newphdr): Document why Elf32/64_Word is correct. 239 * elf32_updatefile.c (fill): Use int64_t instead of off_t for pos. 240 (updatefile): Define last_offset, shdr_offset and scn_start as 241 int64_t instead of off_t. 242 * elf32_updatenull.c: Define Elf32_SizeWord and Elf64_SizeWord. 243 (updatenull_wrlock): Return int64_t instead of off_t. Define size, 244 sh_entsize, sh_align and sh_size as SizeWords. Define offset as 245 int64_t. Cast data->d_off to SizeWord instead of GElf_Word. Drop 246 size GElf_Word cast. Cast offset to SizeWord instead of GElf_Word 247 when comparing with sh_size. 248 * elf_begin.c (get_shnum): Define offset as int64_t instead of 249 off_t. Document why use GElf_Word is correct. 250 (file_read_elf): Define offset as int64_t instead of off_t. 251 (__libelf_read_mmaped_file): Likewise. 252 (read_unmmaped_file): Likewise. 253 (read_file): Likewise. 254 * elf_getaroff.c (elf_getaroff): Return int64_t. 255 * elf_getbase.c (elf_getbase): Likewise. 256 * elf_getdata_rawchunk.c (elf_getdata_rawchunk): Define offset as 257 int64_t instead of off_t. 258 * elf_update.c (write_file): Return int64_t instead of off_t, 259 define size as int64_t instead of off_t. 260 (elf_update): Likewise. 261 * libelfP.h (struct Elf): Define start_offset, sizestr_offset and 262 offset as int64_t. 263 (__libelf_read_mmaped_file): Define offset as int64_t. 264 (__elf32_updatenull_wrlock): Return int64_t. 265 (__elf64_updatenull_wrlock): Return int64_t. 266 2672019-05-12 Mark Wielaard <mark@klomp.org> 268 269 * elf32_updatenull.c (updatenull_wrlock): Mark shdr_flags dirty if 270 either offset or size changed. 271 2722019-05-01 Mark Wielaard <mark@klomp.org> 273 274 * gelf_getnote.c (gelf_getnote): Check n_namesz doesn't overflow 275 offset. 276 2772019-04-30 Mark Wielaard <mark@klomp.org> 278 279 * note_xlate.h (elf_cvt_note): Indicate we only translated the note 280 header if we ran out of data by updating len, src and dest. 281 2822019-04-01 Mao Han <han_mao@c-sky.com> 283 284 * elf.h: Update from glibc. 285 2862019-03-07 Mark Wielaard <mark@klomp.org> 287 288 * elf32_updatefile.c (updatemmap): Use posix_memalign instead of 289 aligned_alloc. 290 2912019-03-06 Mark Wielaard <mark@klomp.org> 292 293 * elf32_updatefile.c (updatemmap): Free scns before returning 294 allocation failure. 295 2962019-02-24 Mark Wielaard <mark@klomp.org> 297 298 * gelf_xlate.c (__elf_xfctstof): Remove alias. 299 * libelfP.h (__elf_xfctstof): Remove definition. 300 3012019-02-24 Mark Wielaard <mark@klomp.org> 302 303 * elf32_fsize.c (local_strong_alias): Remove definition. 304 (msize): Remove alias. 305 * libelfP.h (__elf32_msize): Remove definition. 306 (__elf64_msize): Likewise. 307 3082019-02-21 Mark Wielaard <mark@klomp.org> 309 310 * common.h (determine_kind): Only accept EV_CURRENT. 311 * elf32_fsize.c (fsize): Just check version is EV_CURRENT. 312 Use __libelf_type_size without version dimension. 313 * elf32_updatefile.c (updatemmap): Define fctp from __elf_xfctstom 314 without version dimension. 315 (updatefile): Likewise. 316 * elf32_updatenull.c (default_ehdr): Check e_version is EV_CURRENT. 317 (updatenull_wrlock): Check d_version is EV_CURRENT. 318 (elf32_xlatetof): Likewise. And get recsize without version 319 dimension from __elf_xfctstom. 320 (elf32_xlatetom): Likewise. 321 * elf_begin.c (elf_begin): Check __libelf_version is EV_CURRENT. 322 * elf_compress.c (__libelf_reset_rawdata): Set d_version to 323 EV_CURRENT. 324 * elf_getdata.c (shtype_map): Remove version dimension. 325 (__libelf_type_aligns): Likewise. 326 (__libelf_data_type): Use shtype_map without version dimension. 327 (convert_data): Remove unused version argument. Get fp from 328 __elf_xfctstom without version dimensions. 329 (__libelf_set_data_list_rdlock): Call convert_data without version. 330 * elf_getdata_rawchunk.c (elf_getdata_rawchunk): Call __elfcfctstom 331 conversion function without version dimensions. Set d_version to 332 EV_CURRENT. 333 * elf_newdata.c (elf_newdata): Set d_version to EV_CURRENT. 334 * elf_version.c (__libelf_version_initialized): Removed. 335 (__libelf_version): Initialized to EV_NONE. 336 (elf_version): Always return EV_CURRENT for EV_NONE version. 337 Only accept (and return) EV_CURRENT as version. 338 * gelf_fsize.c (__libelf_type_sizes): Remove version dimension. 339 (gelf_fsize): Only accept EV_CURRENT as version. 340 Use __libelf_type_sizes without version dimension. 341 * gelf_xlate.c (__elf_xftstom): Remove version dimensions. 342 * libelfP.h (__elf_xfctstom): Defined without version dimensions. 343 (__elf_xfctstof): Likewise. 344 (__libelf_type_sizes): Define without version dimension. 345 (elf_typesize): Define using __libelf_type_sizes without version 346 dimension. 347 (__libelf_version_initialized): Remove definition. 348 (__libelf_version): Add definition. 349 (LIBELF_EV_IDX): Removed define. 350 (__libelf_type_aligns): Remove version dimension. 351 * nlist.c (nlist): Call elf_version unconditionally. 352 3532019-02-19 Mark Wielaard <mark@klomp.org> 354 355 * elf_compress.c (do_deflate_cleanup): Remove ei_data argument, 356 check cdatap is not NULL before calling free. 357 (deflate_cleanup): Add cdata as argument. 358 (__libelf_compress): Also check whether the d_size is not zero 359 before converting data. Call deflate_cleanup with an extra 360 argument depending on whether there is converted data to free. 361 Always allocate allocate at least one byte for buf_out. 362 3632019-02-14 Mark Wielaard <mark@klomp.org> 364 365 * elf_begin.c (read_long_names): Make sure ar_size is properly 366 terminated. Sanity check len early if we can. 367 3682019-01-18 Mark Wielaard <mark@klomp.org> 369 370 * Makefile.am (INSTALL_ELFH): Add elf.h to include_HEADERS when 371 defined, otherwise (the default) add elf.h to noinst_HEADERS. 372 3732019-01-16 Mark Wielaard <mark@klomp.org> 374 375 * note_xlate.h (elf_cvt_note): Check n_namesz and n_descsz don't 376 overflow note_len into note header. 377 3782018-11-17 Mark Wielaard <mark@klomp.org> 379 380 * elf32_updatefile.c (updatemmap): Make sure to call convert 381 function on a properly aligned destination. 382 3832018-11-16 Mark Wielaard <mark@klomp.org> 384 385 * libebl.h (__elf32_msize): Mark with const attribute. 386 (__elf64_msize): Likewise. 387 3882018-11-13 Mark Wielaard <mark@klomp.org> 389 390 * elf_getdata.c (__libelf_set_rawdata_wrlock): Explicitly set the 391 alignment of SHF_COMPRESSED data to the alignment of ELF_T_CHDR. 392 * elf_compress.c (elf_compress): After compression set sh_addralign 393 to the alignment of ELF_T_CHDR. 394 3952018-11-09 Mark Wielaard <mark@klomp.org> 396 397 * elf_compress_gnu.c (elf_compress_gnu): Use elf_getdata. 398 3992018-11-12 Mark Wielaard <mark@klomp.org> 400 401 * elf-knowledge.c (ELF_NOTE_GNU_BUILD_ATTRIBUTE_PREFIX): New define. 402 (NT_GNU_BUILD_ATTRIBUTE_{OPEN,FUNC}): Likewise. 403 (GNU_BUILD_ATTRIBUTE_TYPE_{NUMERIC,STRING,BOOL_TRUE,BOOL_FALSE}): 404 Likewise. 405 (GNU_BUILD_ATTRIBUTE_{VERSION,STACK_PROT,RELRO,STACK_SIZE,TOOL,ABI, 406 PIC,SHORT_ENUM}): Likewise. 407 4082018-11-09 Mark Wielaard <mark@klomp.org> 409 410 * elf_compress.c (__libelf_reset_rawdata): Make rawdata change 411 explicit by calling __libelf_set_data_list. 412 * elf_getdata.c (convert_data): Don't convert if type is ELF_T_BYTE 413 even if endianness is different. 414 4152018-10-18 Mark Wielaard <mark@klomp.org> 416 417 * libelf.h (Elf_Type): Add ELF_T_NHDR8. 418 * libelfP.h (__libelf_data_type): Add align argument. 419 (NOTE_ALIGN): Split into... 420 (NOTE_ALIGN4): ... and ... 421 (NOTE_ALIGN8): this. 422 * elf32_xlatetom.c (xlatetom): Recognize both ELF_T_NHDR and 423 ELF_T_NHDR8. 424 * elf_compress.c (elf_compress): Pass zdata_align to 425 __libelf_data_type. 426 * elf_compress_gnu.c (elf_compress_gnu): Pass sh_addralign to 427 __libelf_data_type. 428 * elf_getdata.c (shtype_map): Add ELF_T_NHDR8. 429 (__libelf_data_type): Take align as extra argument, use it to 430 determine Elf_Type. 431 (__libelf_set_rawdata_wrlock): Recognize ELF_T_NHDR8. Pass align to 432 __libelf_data_type. 433 * gelf_fsize.c (__libelf_type_sizes): Add ELF_T_NHDR8. 434 * gelf_getnote.c (gelf_getnote): Use Elf_Type of Elf_Data to calculate 435 padding. 436 * gelf_xlate.c (__elf_xfctstom): Set ELF_T_NHDR to elf_cvt_note4, 437 add ELF_T_NHDR8. 438 * note_xlate.h (elf_cvt_note): Take nhdr8 argument and use it to 439 determine padding. 440 (elf_cvt_note4): New function. 441 (elf_cvt_note8): Likewise. 442 4432018-09-13 Mark Wielaard <mark@klomp.org> 444 445 * elf32_updatefile.c (updatemmap): Use shnum, not ehdr->e_shnum. 446 * elf_getscn.c (elf_getscn): Create section zero if it is requested, 447 but doesn't exist yet. 448 4492018-09-12 Mark Wielaard <mark@klomp.org> 450 451 * elf32_updatefile.c (updatemmap): Use memmove, not memcpy. 452 * elf_update.c (write_file): Try to mremap if file needs to be 453 extended. 454 4552018-08-18 Mark Wielaard <mark@klomp.org> 456 457 * libelf.h (elf_compress_gnu): Add documentation about 458 interaction between SHF_COMPRESED and elf_compress_gnu. 459 * elf_compress_gnu.c (elf_compress_gnu): Return error if section 460 sh_flags has SHF_COMPRESSED set. 461 4622018-07-27 Mark Wielaard <mark@klomp.org> 463 464 * libelf.h (elf_getshdrstrndx): Fix documentation. 465 (elf_getshstrndx): Likewise. 466 4672018-06-19 Mark Wielaard <mark@klomp.org> 468 469 * libelfP.h (__libelf_type_align): Remove !ALLOW_UNALIGNED guard. 470 * elf_getdata.c (__libelf_type_aligns): Likewise. 471 (convert_data): Remove ALLOW_UNALIGNED check. 472 * elf_getdata_rawchunk.c (elf_getdata_rawchunk): Likewise. 473 4742018-06-21 Mark Wielaard <mark@klomp.org> 475 476 * elf.h: Update from glibc. 477 4782018-04-19 Andreas Schwab <schwab@suse.de> 479 480 * elf.h: Update from glibc. 481 4822018-02-16 Mark Wielaard <mark@klomp.org> 483 484 * elf.h: Update from glibc. 485 4862018-02-09 Joshua Watt <JPEWhacker@gmail.com> 487 488 * elf32_updatenull.c (updatenull_wrlock): Use FALLTHROUGH macro 489 instead of comment. 490 * elf_begin.c (read_unmmaped_file): Likewise. 491 (elf_begin): Likewise. 492 * elf_cntl.c (elf_cntl): Likewise. 493 4942017-10-04 Mark Wielaard <mark@klomp.org> 495 496 * elf_begin.c (file_read_elf): Skip sanity checking e_shoff if scncnt 497 is zero, we won't use it then. 498 4992017-10-04 Mark Wielaard <mark@klomp.org> 500 501 * libelfP.h: Add ELF_E_INVALID_ELF to error values enum. 502 * elf_error.c (ELF_E_INVALID_ELF_IDX): New define. Use it as value 503 for ELF_E_INVALID_ELF in msgidx. 504 * elf_getshdrstrndx.c (elf_getshdrstrndx): Distinquish between pread 505 failing and not having enough data. 506 * elf_begin.c (get_shnum): Likewise. Explicitly set libelf errno on 507 too large value. 508 (file_read_elf): Make sure to always set libelf errno when returning 509 NULL. Distinquish between i/o file and elf data errors. 510 5112017-08-18 Ulf Hermann <ulf.hermann@qt.io> 512 513 * gelf_xlate.c: Use attribute_packed. 514 5152017-04-27 Ulf Hermann <ulf.hermann@qt.io> 516 517 * libelfP.h: Use attribute_hidden. 518 5192017-04-27 Ulf Hermann <ulf.hermann@qt.io> 520 521 * Makefile.am: Use fpic_CFLAGS and dso_LDFLAGS. 522 5232017-08-15 Mark Wielaard <mark@klomp.org> 524 525 * elf.h: Update from glibc. Add new powerpc note descriptors. 526 5272017-07-19 Gustavo Romero <gromero@linux.vnet.ibm.com> 528 529 * elf.h: Add known type in notes segment descriptor for HTM SPRs. 530 5312017-02-17 Ulf hermann <ulf.hermann@qt.io> 532 533 * Makefile.am: Add libelf_so_DEPS, which include libeu.a, 534 libelf_so_LIBS. 535 (libelf_so_LDLIBS): Add $(libelf_so_DEPS). 536 (libelf.so$(EXEEXT): Use $(libelf_so_LIBS), require libelf.map 537 from the right directory. 538 5392017-04-20 Ulf Hermann <ulf.hermann@qt.io> 540 541 * libelfP.h: Don't include config.h. 542 5432017-04-20 Ulf Hermann <ulf.hermann@qt.io> 544 545 * elf_begin.c: Use F_GETFD rather than F_GETFL. 546 5472017-04-20 Ulf Hermann <ulf.hermann@qt.io> 548 549 * libelf.h: Define macros for various function attributes and use 550 them. 551 5522017-04-20 Ulf Hermann <ulf.hermann@qt.io> 553 554 * elf_update.c: Set ELF_F_MMAPPED flag if we mmap from elf_update. 555 5562017-04-19 Mark Wielaard <mark@klomp.org> 557 558 * elf_getarsym.c (elf_getarsym): Initialize n to zero. 559 5602017-03-27 Mark Wielaard <mark@klomp.org> 561 562 * elf32_updatefile.c (updatemmap): Always update last_positition. 563 (updatefile): Likewise. 564 5652017-03-24 Mark Wielaard <mark@klomp.org> 566 567 * elf_compress.c (__libelf_decompress): Check insane compression 568 ratios before trying to allocate output buffer. 569 5702016-10-11 Akihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp> 571 Mark Wielaard <mjw@redhat.com> 572 573 * gelf.h (gelf_newehdr): Change return type to void *. 574 (gelf_newphdr): Likewise. 575 * gelf_newehdr.c (gelf_newehdr): Likewise. 576 * gelf_newphdr.c (gelf_newphdr): Likewise. 577 5782016-10-21 Mark Wielaard <mjw@redhat.com> 579 580 * elf_getdata.c (__libelf_set_rawdata_wrlock): Sanity check 581 offset and size before trying to malloc and read data. 582 5832016-10-26 Mark Wielaard <mjw@redhat.com> 584 585 * elf_begin.c (read_file): Always set maxsize when parent == NULL. 586 5872016-10-11 Akihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp> 588 589 * elf_getarsym.c (elf_getarsym): Open code rawmemchr when not 590 available. 591 * elf_strptr.c: Include stdbool.h. 592 (validate_str): New function. 593 (elf_strptr): Use validate_str instead of memrchr. 594 5952016-10-11 Akihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp> 596 597 * elf32_updatefile.c: Remove sys/param.h include. 598 * elf32_updatenull.c: Likewise. Add system.h include. 599 * elf_begin.c: Remove sys/param.h. 600 * elf_compress: Likewise. Add system.h include. 601 (MAX): Remove definition. 602 6032016-08-07 Mark Wielaard <mjw@redhat.com> 604 605 * elf_compress.c (__libelf_reset_rawdata): Check scn->flags and 606 free rawdata_base when malloced. Set ELF_F_MALLOCED for scn->flags. 607 * elf_end.c (elf_end): Check scn->flags and free rawdata_base if 608 malloced. 609 * libelfP.h (struct Elf_Scn): Document flags ELF_F_MALLOCED usage. 610 6112016-07-06 Mark Wielaard <mjw@redhat.com> 612 613 * elf-knowledge.h (SH_FLAGS_COMBINE): Removed. 614 (SH_FLAGS_IMPORTANT): Likewise. 615 6162016-07-06 Mark Wielaard <mjw@redhat.com> 617 618 * elf32_updatenull.c (updatenull_wrlock): Ignore e_type when 619 updating phdrs. 620 * elf_getphdrnum.c (__elf_getphdrnum_chk_rdlock): Only do sanity 621 checking if phdrs haven't been read in yet. 622 6232016-06-24 John Ogness <john.ogness@linutronix.de> 624 625 * elf32_updatenull.c (updatenull_wrlock): Find first section. 626 * elf_nextscn.c (elf_nextscn): When scn is NULL start from 0th 627 section. 628 6292016-06-28 Richard Henderson <rth@redhat.com> 630 631 * elf.h: Update from glibc. Add lots of new EM_* definitions. 632 6332016-04-14 Mark Wielaard <mjw@redhat.com> 634 635 * elf_compress.c (__libelf_compress): Free out_buf if deflateInit 636 fails. 637 6382016-02-13 Mark Wielaard <mjw@redhat.com> 639 640 * elf32_updatefile.c (updatemmap): Free scns when out of memory. 641 6422016-01-28 Mark Wielaard <mjw@redhat.com> 643 644 * elf.h: Update from glibc. Add new i386 and x86_64 relocations. 645 6462016-02-12 Mark Wielaard <mjw@redhat.com> 647 648 * elf.h: Update from glibc. Add NT_ARM_SYSTEM_CALL. 649 6502016-02-04 Mark Wielaard <mjw@redhat.com> 651 652 * elf_getdata.c (__libelf_set_rawdata_wrlock): Don't adjust align 653 for SHT_NOBITS sections. 654 6552016-01-22 Chih-Hung Hsieh <chh@google.com> 656 657 * elf_compress.c (__libelf_compress): Move nested function 658 'do_deflate_cleanup' to file scope to compile with clang. 659 * elf_strptr.c (elf_strptr): Move nested function 'get_zdata' 660 to file scope to compile with clang. 661 6622016-01-13 Mark Wielaard <mjw@redhat.com> 663 664 * libelf.h: Check SHF_COMPRESSED is defined. If not define it and the 665 associated ELF compression types/defines. 666 6672015-11-26 Mark Wielaard <mjw@redhat.com> 668 669 * elf_compress.c (__libelf_decompress_elf): New function, extracted 670 from... 671 (elf_compress): here. Check zdata_base use __libelf_decompress_elf. 672 * elf_strptr.c (elf_strptr): If SHF_COMPRESSED check, uncompress and 673 use zdata. 674 * libelfP.h (struct Elf_Scn): Add zdata_size and zdata_align. 675 (__libelf_decompress_elf): New internal function definition. 676 6772015-10-21 Mark Wielaard <mjw@redhat.com> 678 679 * Makefile.am (libelf_a_SOURCES): Add elf_compress.c and 680 elf_compress_gnu.c. 681 * elf_compress.c: New file. 682 * elf_compress_gnu.c: Likewise. 683 * elf_begin.c (file_read_elf): Make a writable copy of the shdrs 684 for ELF_C_READ_MMAP. 685 * elf_end.c (elf_end): Free zdata_base. 686 * elf_error.c: Add ELF_E_ALREADY_COMPRESSED, 687 ELF_E_UNKNOWN_COMPRESSION_TYPE, ELF_E_COMPRESS_ERROR and 688 ELF_E_DECOMPRESS_ERROR. 689 * elf_data.c (__libelf_data_type): New internal function extracted 690 from convert_data. 691 (convert_data): Handle SHF_COMPRESSED. 692 * elf32_updatenull.c (updatenull_wrlock): Check sh_entsize against 693 uncompressed section data size if SHF_COMPRESSED. 694 * elf32_getshdr.c (load_shdr_wrlock): Adjust assert to account for 695 ELF_C_READ_MMAP. 696 * libelf.h: Define elf_compress and elf_compress_gnu. 697 * libelf.map (ELFUTILS_1.7): Add elf_compress and elf_compress_gnu. 698 * libelfP.h: Add ELF_E_ALREADY_COMPRESSED, 699 ELF_E_UNKNOWN_COMPRESSION_TYPE, ELF_E_COMPRESS_ERROR and 700 ELF_E_DECOMPRESS_ERROR. Define __libelf_data_type. 701 (__libelf_compress): New internal function definition. 702 (__libelf_decompress): Likewise. 703 (__libelf_reset_rawdata): Likewise. 704 (__libelf_data_type): Likewise. 705 (struct Elf_Scn): Add zdata_base. 706 7072015-11-19 Mark Wielaard <mjw@redhat.com> 708 709 * Makefile.am (libelf_a_SOURCES): Add elf32_getchdr.c, 710 elf64_getchdr.c and gelf_getchdr.c. 711 (noinst_HEADERS): Add chdr_xlate.h. 712 * abstract.h: Define Chdr32 and Chdr64. 713 * chdr_xlate.h: New file. 714 * elf32_getchdr.c: New file. 715 * elf64_getchdr.c: New file. 716 * elf_error.c: Add ELF_E_NOT_COMPRESSED, ELF_E_INVALID_SECTION_TYPE 717 and ELF_E_INVALID_SECTION_FLAGS. 718 * elf_getdata.c (__libelf_set_rawdata_wrlock): Set d_type to 719 ELF_T_CHDR for SHF_COMPRESSED sections. 720 * exttypes.h: Add Chdr32 and Chdr64. 721 * gelf.h (GElf_Chdr): New typedef. 722 (gelf_getchdr): New function definition. 723 * gelf_fsize.c (__libelf_type_sizes): Add ELF_T_CHDR. 724 * gelf_getchdr.c: New file. 725 * gelf_xlate.c (__elf_xfctstom): Add ELF_T_CHDR cvt_chdr. 726 * gelf_xlate.h: Add Chdr. 727 * libelf.h (Elf_Type): Add ELF_T_CHDR. 728 (elf32_getchdr): New function definition. 729 (elf64_getchdr): Likewise. 730 * libelf.map (ELFUTILS_1.7): New sections add elf32_getchdr, 731 elf64_getchdr and gelf_getchdr. 732 * libelfP.h: Add ELF_E_NOT_COMPRESSED, ELF_E_INVALID_SECTION_TYPE 733 and ELF_E_INVALID_SECTION_FLAGS. 734 7352015-10-16 Mark Wielaard <mjw@redhat.com> 736 737 * Makefile.am (libelf_so_LDLIBS): Add -lz. 738 7392015-10-14 Mark Wielaard <mjw@redhat.com> 740 741 * elf.h: Update from glibc. Add section compression constants and 742 structures. 743 7442015-10-20 Jose E. Marchesi <jose.marchesi@oracle.com> 745 746 * elf_begin.c (get_shnum): Elf64_Shdr.sh_size is an Elf64_Xword. 747 Fix the size argument to pread_retry. 748 7492015-10-13 Chih-Hung Hsieh <chh@google.com> 750 751 * elf32_updatefile.c (__elfw2(LIBELFBITS,updatemmap)): Move nested 752 function 'fill_mmap' to file scope. 753 * elf_begin.c (elf_begin): Move nested function 'lock_dup_elf' 754 to file scope. 755 7562015-10-09 Josh Stone <jistone@redhat.com> 757 758 * libelf.h: Replace loff_t with int64_t throughout. 759 7602015-10-05 Mark Wielaard <mjw@redhat.com> 761 762 * elf_update.c (write_file): Only use posix_fallocate when using 763 mmap. Only report failure when errno is ENOSPC. 764 7652015-10-09 Josh Stone <jistone@redhat.com> 766 767 * libelfP.h (struct Elf): Replace off64_t with off_t. 768 * elf_getdata_rawchunk.c (elf_getdata_rawchunk): Likewise. 769 7702015-10-05 Chih-Hung Hsieh <chh@google.com> 771 772 * elf_getarsym.c (elf_getarsym): Do not use 773 union of variable length arrays. 774 7752015-10-05 Josh Stone <jistone@redhat.com> 776 777 * Makefile.am (libelf.so): Add AM_V_CCLD and AM_V_at silencers. 778 7792015-09-24 Jose E. Marchesi <jose.marchesi@oracle.com> 780 781 * Makefile.am (AM_CFLAGS): Use -fPIC instead of -fpic to avoid 782 relocation overflows in some platforms. 783 7842015-09-29 Mark Wielaard <mjw@redhat.com> 785 786 * elf32_updatenull.c (default_ehdr): Set e_version when EV_NONE. 787 (updatenull_wrlock): Always set e_shentsize. 788 7892015-09-23 Mark Wielaard <mjw@redhat.com> 790 791 * elf32_getehdr.c (getehdr_wrlock): Mark as internal_function. 792 * elf32_getshdr.c (getshdr_rdlock): Likewise. 793 (getshdr_wrlock): Likewise. 794 * elf_error.c (__libelf_seterrno): Likewise. 795 * elf_getphdrnum.c (__elf_getphdrnum_rdlock): Likewise. 796 (__elf_getphdrnum_chk_rdlock): Likewise. 797 * elf_getshdrnum.c (__elf_getphdrnum_rdlock): Likewise. 798 (__elf_getphdrnum_chk_rdlock): Likewise. 799 * elf_getshdrnum.c (__elf_getshdrnum_rdlock): Likewise. 800 * elf_readall.c (__libelf_readall): Likewise. 801 * gelf_getehdr.c (__gelf_getehdr_rdlock): Likewise. 802 8032015-09-22 Mark Wielaard <mjw@redhat.com> 804 805 * *.c: Remove old-style function definitions. 806 8072015-06-22 Mark Wielaard <mjw@redhat.com> 808 809 * dl-hash.h: Update from glibc. 810 8112015-06-18 Mark Wielaard <mjw@redhat.com> 812 813 * elf32_updatefile.c (updatefile): Always free shdr_data and scns 814 when allocated on failure paths. 815 8162015-06-18 Mark Wielaard <mjw@redhat.com> 817 818 * nlist.c (nlist): Check symscn shdr exists before use. 819 8202015-06-16 Mark Wielaard <mjw@redhat.com> 821 822 * elf_update.c (write_file): Always also use ftruncate before 823 posix_fallocate to make sure file has the right size. 824 8252015-06-04 Mark Wielaard <mjw@redhat.com> 826 827 * elf_getdata.c (__libelf_type_aligns): Add entries for ELF_T_EHDR, 828 ELF_T_OFF, ELF_T_PHDR, ELF_T_SHDR, ELF_T_SWORD, ELF_T_XWORD, 829 ELF_T_SXWORD, ELF_T_GNUHASH, ELF_T_AUXV. 830 * elf_getdata_rawchunk.c (elf_getdata_rawchunk): Check alignment 831 of rawdata against requested type. 832 8332015-06-02 Mark Wielaard <mjw@redhat.com> 834 835 * elf_getdata.c (convert_data): Make sure source data is properly 836 aligned for type before calling actual conversion function. 837 8382015-06-04 Mark Wielaard <mjw@redhat.com> 839 840 * elf_begin.c (get_shnum): Check alignment of Shdr, not Ehdr before 841 direct access. 842 8432015-06-02 Mark Wielaard <mjw@redhat.com> 844 845 * elf_begin.c (file_read_elf): Split checks for ehdr and shdr 846 alignment, drop phdr alignment check. 847 8482015-05-31 Mark Wielaard <mjw@redhat.com> 849 850 * elf32_getshdr.c (load_shdr_wrlock): Allocate shdrs with malloc, 851 not alloca and free after conversion when a copy needs to be made. 852 8532015-05-31 Mark Wielaard <mjw@redhat.com> 854 855 * elf32_getphdr.c (getphdr_wrlock): Allocate phdrs with malloc, not 856 alloca and free after conversion when a copy needs to be made. 857 8582015-05-31 Mark Wielaard <mjw@redhat.com> 859 860 * elf_getarsym.c (elf_getarsym): Allocate temporary file_date with 861 malloc, not alloca also in !ALLOW_UNALIGNED case. 862 8632015-05-30 Mark Wielaard <mjw@redhat.com> 864 865 * gelf_xlate.c (elf_cvt_Byte): Only call memmove with non-zero size. 866 8672015-05-30 Mark Wielaard <mjw@redhat.com> 868 869 * elf32_updatefile.c (updatemmap): Only call mempcpy and update 870 last_position when d_size is non-zero. 871 8722015-05-17 Mark Wielaard <mjw@redhat.com> 873 874 * elf32_updatefile.c (updatefile): Allocate shdr_data and scns 875 with malloc, not alloca. Free after writing section headers. 876 8772015-05-16 Mark Wielaard <mjw@redhat.com> 878 879 * elf32_updatefile.c (updatemmap): Allocate temporary shdr storage 880 with malloc, not alloca. Free after writing section header. 881 8822015-05-16 Mark Wielaard <mjw@redhat.com> 883 884 * elf_getarsym.c (elf_getarsym): Allocate temporary file_date with 885 malloc, not alloca. Call free after out. 886 8872015-05-14 Mark Wielaard <mjw@redhat.com> 888 889 * elf_update.c (write_file): Use posix_fallocate instead of 890 ftruncate to extend file if necessary. 891 8922015-05-13 Mark Wielaard <mjw@redhat.com> 893 894 * elf32_updatenull.c (default_ehdr): If e_phnum is zero then set 895 e_phoff also to zero. 896 8972015-05-12 Mark Wielaard <mjw@redhat.com> 898 899 * elf32_updatenull.c (updatenull_wrlock): Check that sh_addralign 900 is a powerof2. 901 * elf_getdata.c (__libelf_set_rawdata_wrlock): Clamp large d_aligns 902 to the elf image offset. 903 9042015-05-12 Mark Wielaard <mjw@redhat.com> 905 906 * elf32_newphdr.c (newphdr): Call __libelf_seterrno with 907 ELF_E_INVALID_INDEX before failing. Check whether section zero shdr 908 actually exists if we need to put extended phnum in section zero. 909 9102015-05-08 Mark Wielaard <mjw@redhat.com> 911 912 * nlist.c (nlist): Call gelf_fsize with EV_CURRENT. 913 9142015-01-03 Mark Wielaard <mjw@redhat.com> 915 916 * version_xlate.h (elf_cvt_Verdef): Use memmove to copy src to dest. 917 (elf_cvt_Verneed): Likewise. 918 9192015-03-28 Mark Wielaard <mjw@redhat.com> 920 921 * elf.h: Update from glibc. 922 9232015-03-23 Mark Wielaard <mjw@redhat.com> 924 925 * elf32_updatenull.c (updatenull_wrlock): Don't extend size with 926 SHT_NOBITS sh_offset. 927 9282015-02-18 Mark Wielaard <mjw@redhat.com> 929 930 * libelfP.h (__libelf_set_data_list_rdlock): Make internal_function. 931 9322015-02-07 Jan Kratochvil <jan.kratochvil@redhat.com> 933 934 * elf32_updatenull.c (__elfw2(LIBELFBITS,updatenull_wrlock)): Consider 935 sh_addralign 0 as 1. 936 9372015-01-22 Mark Wielaard <mjw@redhat.com> 938 939 * elf_strptr (elf_strptr): Make sure returned string is NUL 940 terminated. 941 9422015-01-21 Mark Wielaard <mjw@redhat.com> 943 944 * elf_strptr.c (elf_strptr): Check data_list_rear == NULL instead 945 of rawdata_base != NULL before using rawdata directly. 946 9472015-01-20 Mark Wielaard <mjw@redhat.com> 948 949 * libelfP.h (__elf_strptr_internal): New function declaration. 950 * elf_getdata.c (__libelf_set_data_list_rdlock): New internal 951 function extracted from... 952 (__elf_getdata_rdlock): ... here. 953 * elf_newdata.c (elf_newdata): Check scn->rawdata_base and update 954 datalist if necessary. 955 9562015-01-20 Mark Wielaard <mjw@redhat.com> 957 958 * elf_strptr.c (elf_strptr): Call __elf[32|64]_getshdr_rdlock if 959 necessary. 960 9612014-12-30 Mark Wielaard <mjw@redhat.com> 962 963 * elf_getphdrnum.c (__elf_getphdrnum_chk_rdlock): New function. 964 (elf_getphdrnum): Call __elf_getphdrnum_chk_rdlock. 965 * gelf_getphdr (gelf_getphdr): Call __elf_getphdrnum_chk_rdlock 966 and always check ndx against phnum. 967 * libelfP.h (__elf_getphdrnum_chk_rdlock): New internal function. 968 9692014-12-25 Mark Wielaard <mjw@redhat.com> 970 971 * elf_begin.c (__libelf_next_arhdr_wrlock): ar_size cannot be 972 negative. Include start_offset in maxsize. 973 9742014-12-28 Alexander Cherepanov <cherepan@mccme.ru> 975 976 * elf_begin.c (read_long_names): Don't miss '/' right after 977 another '/'. Fixes a dir traversal vuln in ar extraction. 978 9792014-12-18 Ulrich Drepper <drepper@gmail.com> 980 981 * Makefile.am: Suppress output of textrel_check command. 982 9832014-12-16 Mark Wielaard <mjw@redhat.com> 984 985 * elf_begin.c (read_long_names): Make sure long_names len fits 986 in mapped ELF file. 987 9882014-12-15 Mark Wielaard <mjw@redhat.com> 989 990 * elf_getarsym.c (elf_getarsym): Check index_size doesn't overflow. 991 9922014-12-15 Mark Wielaard <mjw@redhat.com> 993 994 * elf_begin.c (read_long_names): Clear any garbage left in the 995 name table. 996 9972014-12-11 Mark Wielaard <mjw@redhat.com> 998 999 * elf_begin.c (file_read_elf): Correct ELF64 section offset check. 1000 10012014-12-11 Mark Wielaard <mjw@redhat.com> 1002 1003 * elf_begin.c (read_long_names): Check for offset overflow. 1004 (__libelf_next_arhdr_wrlock): Likewise. Sanity check the ar_size. 1005 Don't allow it to go beyond end of file. 1006 10072014-12-09 Mark Wielaard <mjw@redhat.com> 1008 1009 * elf_getarsym.c (elf_getarsym): Make sure n * w doesn't overflow. 1010 10112014-11-27 Mark Wielaard <mjw@redhat.com> 1012 1013 * Makefile.am (libelf.so): Use textrel_check. 1014 10152014-11-23 Mark Wielaard <mjw@redhat.com> 1016 1017 * elf_getdata_rawchunk.c (elf_getdata_rawchunk): Change signed 1018 overflow check to unsigned. 1019 10202014-11-23 Mark Wielaard <mjw@redhat.com> 1021 1022 * note_xlate.h (elf_cvt_note): Copy over any leftover data if 1023 src != dest. The data is probably part of truncated name/desc. 1024 10252014-11-22 Mark Wielaard <mjw@redhat.com> 1026 1027 * elf_getphdrnum.c (elf_getphdrnum): Sanity check the 1028 __elf_getphdrnum_rdlock result. 1029 10302014-11-18 Mark Wielaard <mjw@redhat.com> 1031 1032 * version_xlate.h (elf_cvt_Verdef): Check for overflow. 1033 (elf_cvt_Verneed): Likewise. 1034 10352014-11-17 Mark Wielaard <mjw@redhat.com> 1036 1037 * elf-knowledge.h (SECTION_STRIP_P): Check name is not NULL. 1038 10392014-11-16 Mark Wielaard <mjw@redhat.com> 1040 1041 * elf_getshdrstrndx.c: Check there are section headers before 1042 handling SHN_XINDEX. 1043 10442014-11-16 Mark Wielaard <mjw@redhat.com> 1045 1046 * elf32_getphdr.c (getphdr_wrlock): Check e_phoff isn't zero. 1047 Check for too many pheaders. 1048 * elf_getphdrnum.c (__elf_getphdrnum_rdlock): Check section zero 1049 actually exists before handling PN_XNUM. 1050 10512014-11-16 Mark Wielaard <mjw@redhat.com> 1052 1053 * gelf_getnote.c (gelf_getnote): Check padding overflow. 1054 10552014-11-16 Mark Wielaard <mjw@redhat.com> 1056 1057 * elf_getdata.c (__libelf_set_rawdata_wrlock): Declare offset, size 1058 and align as Elf64_Off and Elf64_Xword not size_t. 1059 10602014-11-14 Mark Wielaard <mjw@redhat.com> 1061 1062 * gelf_getnote.c (gelf_getnote): Check offset overflow. 1063 10642014-11-13 Mark Wielaard <mjw@redhat.com> 1065 1066 * elf_getdata.c (__libelf_set_rawdata_wrlock): Fix unsigned overflow 1067 check. 1068 10692014-11-08 Mark Wielaard <mjw@redhat.com> 1070 1071 * elf_begin.c (__libelf_next_arhdr_wrlock): Use mempcpy not __mempcpy. 1072 10732014-11-07 Mark Wielaard <mjw@redhat.com> 1074 1075 * elf_begin.c (file_read_elf): Correct sh_size check. 1076 * elf_getdata.c (__libelf_set_rawdata_wrlock): Check for unsigned 1077 overflow. 1078 10792014-09-10 Petr Machata <pmachata@redhat.com> 1080 1081 * elf_begin (read_unmmaped_file): Call __libelf_seterrno if the 1082 file is unreadable. 1083 10842014-07-07 Mark Wielaard <mjw@redhat.com> 1085 1086 * elf.h: Update from glibc. 1087 10882014-04-13 Mark Wielaard <mjw@redhat.com> 1089 1090 * Makefile.am: Remove !MUDFLAP conditions. 1091 * elf_begin.c (read_file): Don't clear use_mmap when _MUDFLAP is 1092 defined. 1093 * elf_update.c (write_file): Remove _MUDFLAP condition. 1094 10952014-01-17 Jakub Jelinek <jakub@redhat.com> 1096 Roland McGrath <roland@redhat.com> 1097 1098 * libelfP.h (INVALID_NDX): Define. 1099 * gelf_getdyn.c (gelf_getdyn): Use it. Remove ndx < 0 test if any. 1100 * gelf_getlib.c (gelf_getlib): Likewise. 1101 * gelf_getmove.c (gelf_getmove): Likewise. 1102 * gelf_getrel.c (gelf_getrel): Likewise. 1103 * gelf_getrela.c (gelf_getrela): Likewise. 1104 * gelf_getsym.c (gelf_getsym): Likewise. 1105 * gelf_getsyminfo.c (gelf_getsyminfo): Likewise. 1106 * gelf_getsymshndx.c (gelf_getsymshndx): Likewise. 1107 * gelf_getversym.c (gelf_getversym): Likewise. 1108 * gelf_update_dyn.c (gelf_update_dyn): Likewise. 1109 * gelf_update_lib.c (gelf_update_lib): Likewise. 1110 * gelf_update_move.c (gelf_update_move): Likewise. 1111 * gelf_update_rel.c (gelf_update_rel): Likewise. 1112 * gelf_update_rela.c (gelf_update_rela): Likewise. 1113 * gelf_update_sym.c (gelf_update_sym): Likewise. 1114 * gelf_update_syminfo.c (gelf_update_syminfo): Likewise. 1115 * gelf_update_symshndx.c (gelf_update_symshndx): Likewise. 1116 * gelf_update_versym.c (gelf_update_versym): Likewise. 1117 11182014-01-17 Jakub Jelinek <jakub@redhat.com> 1119 1120 * elf32_getphdr.c (elfw2(LIBELFBITS,getphdr)): Check if program header 1121 table fits into object's bounds. 1122 * elf_getshdrstrndx.c (elf_getshstrndx): Add elf->start_offset to 1123 elf->map_address. Check if first section header fits into object's 1124 bounds. 1125 * elf32_getshdr.c (elfw2(LIBELFBITS,getshdr)): 1126 Check if section header table fits into object's bounds. 1127 * elf_begin.c (get_shnum): Ensure section headers fits into 1128 object's bounds. 1129 (file_read_elf): Make sure scncnt is small enough to allocate both 1130 ElfXX_Shdr and Elf_Scn array. Make sure section and program header 1131 tables fit into object's bounds. Avoid memory leak on failure. 1132 * elf_newscn.c (elf_newscn): Check for overflow. 1133 * elf32_updatefile.c (__elfw2(LIBELFBITS,updatemmap)): Likewise. 1134 (__elfw2(LIBELFBITS,updatefile)): Likewise. 1135 * elf32_newphdr.c (elfw2(LIBELFBITS,newphdr)): Likewise. 1136 * elf_getarsym.c (elf_getarsym): Likewise. 1137 11382013-11-08 Mark Wielaard <mjw@redhat.com> 1139 1140 * elf32_updatefile.c (elfXX_updatemmap): Only memcpy ehdr when not 1141 already directly mmapped. 1142 11432013-11-05 Mark Wielaard <mjw@redhat.com> 1144 1145 * elf32_updatefile.c (elfXX_updatefile): Copy all section headers 1146 if elf->flags dirty. 1147 11482013-11-01 Michael Forney <mforney@mforney.org> 1149 1150 * Makefile.am: Use READELF. 1151 11522013-10-01 Petr Machata <pmachata@redhat.com> 1153 1154 * elf.h: Update from glibc. 1155 11562013-06-17 Petr Machata <pmachata@redhat.com> 1157 1158 * elf.h: Update from glibc. 1159 11602013-08-28 Namhyung Kim <namhyung@gmail.com> 1161 1162 * gelf.h (gelf_fsize): Fix typo in comment. 1163 11642013-08-28 Mark Wielaard <mjw@redhat.com> 1165 1166 * gelf_getauxv.c (gelf_getauxv): Add missing whitespace. 1167 11682013-08-27 Mark Wielaard <mjw@redhat.com> 1169 1170 * gelf_getauxv.c (gelf_getauxv): Remove unnecessary casts to char *. 1171 11722013-08-25 Kurt Roeckx <kurt@roeckx.be> 1173 1174 * gelf_getauxv.c (gelf_getauxv): Use memcpy instead of pointer 1175 dereference to avoid alignment problems. 1176 11772013-01-07 Roland McGrath <roland@hack.frob.com> 1178 1179 * elf_getarsym.c (elf_getarsym): Copy FILE_DATA into stack space if it 1180 would be unaligned and !ALLOW_UNALIGNED. 1181 1182 * elf_getarsym.c (read_number_entries): Use memcpy instead of pointer 1183 dereference so as not to assume the field is naturally aligned. 1184 11852012-09-17 Petr Machata <pmachata@redhat.com> 1186 1187 * elf.h: Update from glibc. 1188 11892012-08-16 Roland McGrath <roland@hack.frob.com> 1190 1191 * elf.h: Update from glibc. 1192 11932012-08-14 Mark Wielaard <mjw@redhat.com> 1194 1195 * elf32_checksum.c (ebl_debugscn_p): Removed unused define and 1196 confusing outdated comment. 1197 11982012-08-01 Petr Machata <pmachata@redhat.com> 1199 1200 * elf_getarsym (read_number_entries): New function. 1201 (elf_getarsym): Handle 64-bit symbol table, stored in special 1202 entry named "/SYM64/". 1203 * elf_begin.c (__libelf_next_arhdr_wrlock): Don't reject archive 1204 because it contains 64-bit symbol table. 1205 12062012-07-19 Mark Wielaard <mjw@redhat.com> 1207 1208 * elf32_getshdr.c (load_shdr_wrlock): Add elf->flags & ELF_F_MALLOCED 1209 to asserts. 1210 12112012-07-17 Petr Machata <pmachata@redhat.com> 1212 1213 * elf32_xlatetom.c (elfw2(LIBELFBITS, xlatetom)): Do not check for 1214 integer number of records in case of ELF_T_NHDR. 1215 12162012-04-02 Mark Wielaard <mjw@redhat.com> 1217 1218 * elf32_offscn.c: Do not match SHT_NOBITS sections at OFFSET unless 1219 there are no nonempty sections at that offset. 1220 12212012-03-21 Roland McGrath <roland@hack.frob.com> 1222 1223 * elf-knowledge.h (SECTION_STRIP_P): Remove < SHT_NUM check. 1224 12252011-02-26 Mark Wielaard <mjw@redhat.com> 1226 1227 * elf_end.c (elf_end): Call rwlock_unlock before rwlock_fini. 1228 12292011-01-05 Jan Kratochvil <jan.kratochvil@redhat.com> 1230 1231 * elf_getdata_rawchunk.c (elf_getdata_rawchunk): Fix off64_t overflow 1232 when MAXIMUM_SIZE == ~0. 1233 12342010-08-18 Roland McGrath <roland@redhat.com> 1235 1236 * gelf_fsize.c (__libelf_type_sizes): Add entries for ELF_T_LIB 1237 and ELF_T_GNUHASH. 1238 Reported by Mark Hatle <mark.hatle@windriver.com>. 1239 1240 * exttypes.h: Add cases for ElfNN_Lib. 1241 Reported by Mark Hatle <mark.hatle@windriver.com>. 1242 12432010-06-14 Ulrich Drepper <drepper@redhat.com> 1244 1245 * gelf_update_shdr.c: Implicitly set ELF_F_DIRTY bit. 1246 * gelf_update_phdr.c: Likewise. 1247 * gelf_update_ehdr.c: Likewise. 1248 12492010-04-14 Roland McGrath <roland@redhat.com> 1250 1251 * elf32_getphdr.c: Check for e_phoff/size outside the file bounds. 1252 * elf_begin.c (file_read_elf): Don't set .phdr here. 1253 12542010-04-13 Roland McGrath <roland@redhat.com> 1255 1256 * elf.h: Update from glibc. 1257 12582010-04-06 Roland McGrath <roland@redhat.com> 1259 1260 * elf_error.c (ELF_E_FD_MISMATCH_IDX): Avoid nonobvious abbreviation 1261 in error message. 1262 12632010-04-01 Petr Machata <pmachata@redhat.com> 1264 1265 * elf_getdata.c (__elf_getdata_rdlock): Initialize data.s for data 1266 that do not need a conversion. 1267 12682010-03-11 Roland McGrath <roland@redhat.com> 1269 1270 * elf.h: Update from glibc. 1271 12722010-03-04 Ulrich Drepper <drepper@redhat.com> 1273 1274 * elf.h: Update from glibc. 1275 12762010-02-17 Roland McGrath <roland@redhat.com> 1277 1278 * elf_begin.c (file_read_elf): Leave section rawdata_base and 1279 data_base pointers null when [sh_offset,sh_size) points outside 1280 the mapped file. 1281 12822010-02-15 Roland McGrath <roland@redhat.com> 1283 1284 * Makefile.am: Use config/eu.am for common stuff. 1285 12862010-01-07 Roland McGrath <roland@redhat.com> 1287 1288 * elf32_getphdr.c: Use __elf_getphdrnum_rdlock. 1289 * gelf_getphdr.c: Likewise. 1290 * gelf_update_phdr.c: Likewise. 1291 * elf32_updatefile.c (__elf32_updatemmap, __elf32_updatefile): Likewise. 1292 * elf32_updatenull.c (__elf32_updatenull_wrlock): Likewise. 1293 * elf32_newphdr.c: Clear section 0's sh_info when resetting e_phnum. 1294 If COUNT is too large, use store PN_XNUM instead and set sh_info. 1295 * elf_begin.c (file_read_elf): Always allocate space we can use later 1296 for section 0 if doing RDWR. 1297 1298 * elf_getphdrnum.c: New file. 1299 * Makefile.am (libelf_a_SOURCES): Add it. 1300 * libelf.h: Declare elf_getphdrnum. 1301 * libelfP.h: Declare __elf_getphdrnum_rdlock. 1302 * libelf.map (ELFUTILS_1.6): New set, add elf_getphdrnum. 1303 1304 * elf.h: Update from glibc. 1305 13062009-10-23 Lubomir Rintel <lkundrak@v3.sk> 1307 1308 * elf32_updatefile.c (fill_mmap): When starting past shdr_end, start 1309 filling from section start, not shdr_end. 1310 13112009-11-10 Roland McGrath <roland@redhat.com> 1312 1313 * elf_readall.c (__libelf_readall): Fetch file size if not yet known. 1314 13152009-11-06 Mark Wielaard <mjw@redhat.com> 1316 1317 * elf_next.c (elf_next): Mark the archive header as unusable when 1318 there is no next ar element. 1319 13202009-08-12 Mark Wielaard <mjw@redhat.com> 1321 1322 * Makefile.am (libelf.so): Use -Wl,-z,defs not -defs. 1323 13242009-07-26 Ulrich Drepper <drepper@redhat.com> 1325 1326 * elf.h: Update from glibc. 1327 13282009-07-21 Ulrich Drepper <drepper@redhat.com> 1329 1330 * elf32_updatefile.c (__elfXX_updatemmap): Fix handling of gaps between 1331 sections. Patch by Lubomir Rintel <lkundrak@v3.sk>. 1332 13332009-07-08 Roland McGrath <roland@redhat.com> 1334 1335 * libelfP.h (struct Elf): Remove unused ar.has_index field. 1336 Reorder various members for optimal packing. 1337 13382009-07-08 Ulrich Drepper <drepper@redhat.com> 1339 1340 * elf.h: Update from glibc. 1341 13422009-06-13 Ulrich Drepper <drepper@redhat.com> 1343 1344 * Makefile.am (libelf_a_SOURCES): Replace elf_getshnum.c and 1345 elf_getshstrndx.c with elf_getshdrnum.c and elf_getshdrstrndx.c. 1346 * elf_getshnum.c: Renamed to... 1347 * elf_getshdrnum.c: ...this. Rename function and add old name as 1348 alias. Likewise for internal functions with derived names. 1349 * elf_getshstrndx.c: Renamed to... 1350 * elf_getshdrstrndx.c: ...this. Rename function and add old name as 1351 alias. Likewise for internal functions with derived names. 1352 * libelf.h: Add prototypes for new names. Make old names as 1353 deprecated. 1354 * libelfP.h: Rename internal function prototypes. 1355 * libelf.map: Export for names. 1356 * elf32_checksum.c: Don't use deprecated functions. 1357 * elf32_getshdr.c: Likewise. 1358 13592009-06-01 Ulrich Drepper <drepper@redhat.com> 1360 1361 * elf.h: Update from glibc. 1362 13632009-04-14 Roland McGrath <roland@redhat.com> 1364 1365 * elf.h: Update from glibc. 1366 13672009-04-01 Roland McGrath <roland@redhat.com> 1368 1369 * elf.h: Update from glibc. 1370 13712009-02-10 Ulrich Drepper <drepper@redhat.com> 1372 1373 * elf32_updatefile.c (updatefile): For the zeroth section we still 1374 have to copy the section header. 1375 13762009-02-01 Ulrich Drepper <drepper@redhat.com> 1377 1378 * elf_strptr.c: Add comment re possible problem. 1379 13802009-01-26 Ulrich Drepper <drepper@redhat.com> 1381 1382 * elf32_updatenull.c (updatenull_wrlock): Fix comment of 1383 ELF_F_LAYOUT behaviour re section header table. 1384 13852009-01-22 Ulrich Drepper <drepper@redhat.com> 1386 1387 * elf32_updatefile.c (__elfXX_updatemmap): Fill the gap between 1388 sections even if only the section at the start of the gap has been 1389 changed. 1390 (__elfXX_updatefile): Likewise. 1391 13922009-01-21 Ulrich Drepper <drepper@redhat.com> 1393 1394 * elf32_updatefile.c (__elfXX_updatemmap): Skip most of the loop to 1395 handle sections for NOBITS sections. 1396 (elfXX_updatefile): Likewise. 1397 1398 * elf32_updatefile.c (__elfXX_updatemmap): When skipping non-NOBITS 1399 sections we haven't loaded, update last_position based on scn_start, 1400 not based on old value. Don't run the loop for the dummy section 0. 1401 (elfXX_updatefile): Don't run the loop for the dummy section 0. 1402 14032009-01-10 Ulrich Drepper <drepper@redhat.com> 1404 1405 * libelfP.h (_): We only have one translation domain, elfutils. 1406 1407 * Makefile.am: Use USE_LOCKS instead of USE_TLS. 1408 * elf_error.c: Always use __thread. Remove all !USE_TLS code. 1409 14102009-01-04 Roland McGrath <roland@redhat.com> 1411 1412 * note_xlate.h (elf_cvt_note): Don't examine a size too small to 1413 container a note header. 1414 14152008-12-11 Roland McGrath <roland@redhat.com> 1416 1417 * elf32_updatefile.c (__elfw2(LIBELFBITS,updatemmap)): Handle 1418 placement offset going backwards, for out-of-order or overlapping 1419 (bogus) sh_offset layouts. It's a dumb use, but should not crash. 1420 (__elfw2(LIBELFBITS,updatefile)): Likewise. 1421 Fixes RHBZ#476136. 1422 1423 * libelf.h (Elf_Data): Whitespace fix. 1424 14252008-12-10 Roland McGrath <roland@redhat.com> 1426 1427 * elf_getarhdr.c (elf_getarhdr): Fix missing rename in last change. 1428 14292008-10-22 Petr Machata <pmachata@redhat.com> 1430 1431 * elf_rawfile.c (elf_rawfile): Lock around elf-> references. 1432 14332008-10-21 Petr Machata <pmachata@redhat.com> 1434 1435 * libelfP.h: Rename getehdr_rdlock to getehdr_wrlock. 1436 * elf32_getehdr.c (getehdr_rdlock): Move the code to new function 1437 getehdr_impl and make it a wrapper. Rename to getehdr_wrlock. 1438 (getehdr_impl): Guard elf->class init with wrlock. 1439 (getehdr): Also make it a wrapper of getehdr_impl. 1440 * elf32_updatenull.c (updatenull_wrlock): Call getehdr_wrlock. 1441 14422008-10-20 Petr Machata <pmachata@redhat.com> 1443 1444 * elf_getdata_rawchunk.c (elf_getdata_rawchunk): Lock around the 1445 code that reads mutable elf state. Relock to write lock to chain 1446 the new chunk on the elf rawchunks list. 1447 14482008-10-20 Petr Machata <pmachata@redhat.com> 1449 1450 * elf32_checksum.c (checksum): Place a lock around the code that 1451 processes data. Make it wrlock if the code needs to xlate the 1452 data before processing. 1453 14542008-10-16 Petr Machata <pmachata@redhat.com> 1455 1456 * elf_begin.c 1457 (__libelf_next_arhdr): Rename to __libelf_next_arhdr_wrlock. 1458 (dup_elf): Adjust the call. 1459 (elf_begin): New local function lock_dup_elf. Relocks the elf if 1460 necessary before calling dup. Call this instead of dup_elf. 1461 * elf_getarhdr.c 1462 (elf_getarhdr): Lock before calling __libelf_next_arhdr_wrlock. 1463 * elf_next.c (elf_next): Likewise. 1464 * elf_rand.c (elf_rand): Likewise. 1465 14662008-10-14 Petr Machata <pmachata@redhat.com> 1467 1468 * elf_getdata.c (__elf_getdata_rdlock): Lock before converting. 1469 14702008-11-26 Roland McGrath <roland@redhat.com> 1471 1472 * elf.h: Update from glibc. 1473 14742008-10-06 Roland McGrath <roland@redhat.com> 1475 1476 * elf_getarhdr.c (elf_getarhdr): Return NULL when passed NULL. 1477 14782008-08-27 Roland McGrath <roland@redhat.com> 1479 1480 * elf_begin.c (get_shnum): Avoid misaligned reads for matching endian. 1481 1482 * libelfP.h [!ALLOW_UNALIGNED] (__libelf_type_align): Fix CLASS index. 1483 14842008-08-25 Roland McGrath <roland@redhat.com> 1485 1486 * Makefile.am (libelf_so_LDLIBS): New variable. 1487 (libelf.so): Use it in the link. 1488 14892008-08-21 Petr Machata <pmachata@redhat.com> 1490 1491 * elf_getdata.c, libelfP.h 1492 (__elf_getdata_internal): Rename to __elf_getdata_rdlock. 1493 (__libelf_set_rawdata_wrlock): New function. 1494 (__libelf_set_rawdata): Make it a wrapper that calls *_wrlock. 1495 * elf32_updatenull.c, libelfP.h 1496 (__elfNN_updatenull): Rename to __elfNN_updatenull_wrlock. 1497 14982008-08-21 Petr Machata <pmachata@redhat.com> 1499 1500 * elf32_getphdr.c, libelfP.h 1501 (__elfNN_getphdr_internal): Drop. Move __elfNN_getphdr_internal 1502 code to __elfNN_getphdr_wrlock. 1503 (__elfNN_getphdr_rdlock, __elfNN_getphdr_wrlock): New functions. 1504 (__elfNN_getphdr_rdlock, __elfNN_getphdr_wrlock): Make these 1505 wrappers of getphdr_impl. 1506 15072008-08-21 Petr Machata <pmachata@redhat.com> 1508 1509 * elf32_getehdr.c, libelfP.h 1510 (__elfNN_getehdr_internal): Rename to __elfNN_getehdr_rdlock. 1511 * gelf_getehdr, libelfP.h: 1512 (__gelf_getehdr_internal): Rename to __gelf_getehdr_rdlock. 1513 15142008-08-21 Petr Machata <pmachata@redhat.com> 1515 1516 * elf32_getshdr.c 1517 (__elfNN_getshdr_internal): Drop. 1518 (load_shdr_wrlock, scn_valid): New functions, contain bits of 1519 behaviour from __elfNN_getshdr_internal. 1520 (__elfNN_getshdr_rdlock, __elfNN_getshdr_wrlock): Replacements for 1521 dropped _internal functions above. 1522 * elf_getshnum.c 1523 (__elf_getshnum_internal): Rename to __elf_getshnum_rdlock. 1524 15252008-08-04 Petr Machata <pmachata@redhat.com> 1526 1527 * libelfP.h (RWLOCK_RDLOCK, RWLOCK_WRLOCK, RWLOCK_UNLOCK): New macros. 1528 15292008-07-28 Roland McGrath <roland@redhat.com> 1530 1531 * elf.h: Update from glibc. 1532 15332008-03-31 Roland McGrath <roland@redhat.com> 1534 1535 * elf32_offscn.c: Make sure shdrs have been read in. 1536 15372008-02-19 Roland McGrath <roland@redhat.com> 1538 1539 * elf.h: Update from glibc. 1540 15412008-02-08 Roland McGrath <roland@redhat.com> 1542 1543 * elf.h: Update from glibc. 1544 15452008-01-31 Ulrich Drepper <drepper@redhat.com> 1546 1547 * elf_strptr.c (elf_strptr): Don't fail if the ELF file is currently 1548 under construction and no raw data can be read from disk. 1549 15502008-01-30 Roland McGrath <roland@redhat.com> 1551 1552 * elf.h: Update from glibc. 1553 15542008-01-26 Roland McGrath <roland@redhat.com> 1555 1556 * elf_begin.c (__libelf_next_arhdr): Rewrite conversions using a macro. 1557 Fixes various pastos in wrong type in sizeof, wrong string parsed. 1558 15592008-01-20 Roland McGrath <roland@redhat.com> 1560 1561 * elf_getaroff.c: Calculate from start_offset, instead of using 1562 parent's state.ar.offset field. 1563 15642008-01-08 Roland McGrath <roland@redhat.com> 1565 1566 * Makefile.am (euinclude): Variable removed. 1567 (pkginclude_HEADERS): Set this instead of euinclude_HEADERS. 1568 15692008-01-03 Roland McGrath <roland@redhat.com> 1570 1571 * common.h: Add __attribute__ ((unused)) to static functions. 1572 15732007-12-20 Ulrich Drepper <drepper@redhat.com> 1574 1575 * Makefile.am (libelf_a_SOURCES): Add elf_scnshndx. 1576 * libelfP.h (struct Elf_Scn): Add shndx_index field. 1577 Declare __elf_scnshndx_internal. 1578 * elf32_getshdr.c: Record location of extended section header. 1579 * elf_begin.c (file_read_elf): Likewise. 1580 * elf_scnshndx.c: New file. 1581 * libelf.h: Declare elf_scnshndx. 1582 * libelf.map: Add elf_scnshndx to version ELFUTILS_1.4. 1583 15842007-11-12 Roland McGrath <roland@redhat.com> 1585 1586 * libelf.h: Replace off64_t with loff_t throughout. 1587 Only that type name is unconditionally defined by <sys/types.h> 1588 15892007-11-03 Roland McGrath <roland@redhat.com> 1590 1591 * libelf.h (Elf_Data): Comment fix. 1592 15932007-10-18 Roland McGrath <roland@redhat.com> 1594 1595 * elf.h: Update from glibc. 1596 15972007-10-07 Roland McGrath <roland@redhat.com> 1598 1599 * elf_begin.c (__libelf_next_arhdr): Fix fencepost error and wrong 1600 member access in terminating name with no trailing /. Trim trailing 1601 spaces when there is no /. 1602 16032007-10-04 Roland McGrath <roland@redhat.com> 1604 1605 * elf_end.c (elf_end): Don't free ELF->state.ar.ar_sym when it's -1l. 1606 16072007-10-03 Roland McGrath <roland@redhat.com> 1608 1609 * libelf.h (Elf_Data): Use off64_t for d_off. 1610 (Elf_Arhdr): Use off64_t for ar_size. 1611 (elf_update, elf_getbase, elf_getaroff): Return off64_t. 1612 1613 * gelf_rawchunk.c: File removed. 1614 * gelf_freechunk.c: File removed. 1615 * Makefile.am (libelf_a_SOURCES): Remove them. 1616 * libelf.map (ELFUTILS_1.0): Remove exports. 1617 * gelf.h: Remove decls. 1618 1619 * elf_getdata_rawchunk.c: New file. 1620 * Makefile.am (libelf_a_SOURCES): Add it. 1621 * libelf.map (ELFUTILS_1.3): Add elf_getdata_rawchunk. 1622 * libelf.h: Declare it. 1623 * libelfP.h (Elf_Data_Chunk): New type. 1624 (struct Elf.elf): New member `rawchunks'. 1625 * elf_end.c (elf_end): Free recorded rawchunk buffers. 1626 16272007-08-24 Roland McGrath <roland@redhat.com> 1628 1629 * gelf_getnote.c: New file. 1630 * Makefile.am (libelf_a_SOURCES): Add it. 1631 * gelf.h: Declare gelf_getnote. 1632 * libelf.map (ELFUTILS_1.3): Add gelf_getnote. 1633 1634 * libelfP.h (NOTE_ALIGN): New macro. 1635 * note_xlate.h: New file. 1636 * Makefile.am (noinst_HEADERS): Add it. 1637 * gelf_xlate.c: Include it. 1638 (__elf_xfctstom): Use elf_cvt_note. 1639 * elf_getdata.c (shtype_map, __libelf_type_align): Handle SHT_NOTE. 1640 (__libelf_set_rawdata): Likewise. 1641 16422007-08-19 Roland McGrath <roland@redhat.com> 1643 1644 * gelf_update_auxv.c: New file. 1645 * gelf_getauxv.c: New file. 1646 * Makefile.am (libelf_a_SOURCES): Add them. 1647 * gelf.h: Declare gelf_getauxv, gelf_update_auxv. 1648 * libelf.map (ELFUTILS_1.3): New set, inherits fom ELFUTILS_1.2. 1649 Export gelf_getauxv, gelf_update_auxv. 1650 1651 * libelf.h (Elf_Type): Add ELF_T_AUXV. 1652 * abstract.h: Add auxv_t entries. 1653 * exttypes.h: Likewise. 1654 * gelf_xlate.h: Likewise. 1655 * gelf_xlate.c (__elf_xfctstom): Add ELF_T_AUXV entries. 1656 * gelf_fsize.c (__libelf_type_sizes): Likewise. 1657 16582007-08-12 Roland McGrath <roland@redhat.com> 1659 1660 * elf32_updatefile.c (compare_sections): Sort secondarily on sh_size, 1661 and only tertiarily on index. 1662 16632007-07-09 Roland McGrath <roland@redhat.com> 1664 1665 * elf.h: Update from glibc. 1666 16672007-04-22 Roland McGrath <roland@redhat.com> 1668 1669 * elf.h: Update from glibc. 1670 16712007-03-18 Roland McGrath <roland@redhat.com> 1672 1673 * elf_begin.c (get_shnum): Fix test for e_shoff being out of bounds. 1674 Return zero when the section headers do not fit within MAXSIZE. 1675 16762007-03-09 Roland McGrath <roland@redhat.com> 1677 1678 * libelfP.h (LIBELF_EV_IDX): New macro. 1679 (__libelf_type_align): New macro. 1680 [! ALLOW_UNALIGNED]: Declare __libc_type_aligns array. 1681 * elf_getdata.c (shtype_map): Convert to just Elf_Type[][]. 1682 (convert_data, __libelf_set_rawdata): Use that, __libelf_type_align, 1683 and __libelf_type_sizes, in place of old table. 1684 (__libc_type_aligns): New const variable. 1685 16862007-02-04 Ulrich Drepper <drepper@redhat.com> 1687 1688 * Makefile (libelf.so): Build with -z relro. 1689 1690 * elf_begin.c (read_file): When using ELF_C_READ_MMAP use MAP_PRIVATE. 1691 16922007-01-30 Ulrich Drepper <drepper@redhat.com> 1693 1694 * nlist.c: Close file descriptor before returning. 1695 16962007-01-20 Roland McGrath <roland@redhat.com> 1697 1698 * gnuhash_xlate.h (elf_cvt_gnuhash): Fix fence-post error so we 1699 convert the final word. 1700 1701 * elf32_getshdr.c: Don't byteswap shdr fields when EI_DATA matches 1702 MY_ELFDATA on !ALLOW_UNALIGNED machines. 1703 17042007-01-18 Roland McGrath <roland@redhat.com> 1705 1706 * gelf_rawchunk.c (gelf_rawchunk): Clear RESULT pointer after freeing 1707 it on read error. 1708 17092006-10-13 Roland McGrath <roland@redhat.com> 1710 1711 * elf32_updatenull.c: Look for and accept phdr also for ET_CORE. 1712 * elf_error.c (msgstr): Change ELF_E_INVALID_PHDR string. 1713 17142006-08-29 Roland McGrath <roland@redhat.com> 1715 1716 * elf32_getphdr.c: Don't byteswap phdr fields when EI_DATA matches 1717 MY_ELFDATA on !ALLOW_UNALIGNED machines. 1718 Reported by Christian Aichinger <Greek0@gmx.net>. 1719 1720 * Makefile.am (CLEANFILES): Add libelf.so.$(VERSION). 1721 17222006-08-08 Ulrich Drepper <drepper@redhat.com> 1723 1724 * elf.h (DT_VALNUM): Update. 1725 (DT_ADDRNUM): Likewise. 1726 17272006-07-12 Ulrich Drepper <drepper@redhat.com> 1728 1729 * elf32_updatefile.c: Adjust for internal_function_def removal. 1730 * elf32_updatenull.c: Likewise. 1731 * elf_begin.c: Likewise. 1732 * elf_getdata.c: Likewise. 1733 17342006-07-11 Ulrich Drepper <drepper@redhat.com> 1735 1736 * libelf.h: Define ELF_T_GNUHASH. 1737 * elf_getdata.c (TYPEIDX): Handle SHT_GNU_HASH. 1738 (shtype_map): Add SHT_GNU_HASH entries. 1739 * gelf_xlate.c (__elf_xfctstom): Add ELF_T_GNUHASH entries. 1740 * gnuhash_xlate.h: New file. 1741 * Makefile.am (noinst_HEADERS): Add gnuhash_xlate.h. 1742 17432006-07-06 Ulrich Drepper <drepper@redhat.com> 1744 1745 * elf_gnu_hash.c: New file. 1746 * libelf.h: Declare elf_gnu_hash. 1747 * Makefile.am (libelf_a_SOURCES): Add elf_gnu_hash. 1748 * libelf.map: Add elf_gnu_map for version ELFUTILS_1.2. 1749 17502006-06-15 Roland McGrath <roland@redhat.com> 1751 1752 * libelf.h (elf_getarsym): Fix comment typo. 1753 Rename second parameter to be more explanatory. 1754 (elf_getident, elf_rawhide): Likewise. 1755 17562006-05-28 Ulrich Drepper <drepper@redhat.com> 1757 1758 * elf32_updatefile.c (updatemmap): Preserve section content if 1759 copying would overwrite them. 1760 Fix msync paramters. 1761 17622006-04-04 Roland McGrath <roland@redhat.com> 1763 1764 * elf32_updatefile.c (updatemmap): Handle other-endian case. 1765 17662006-04-04 Ulrich Drepper <drepper@redhat.com> 1767 1768 * elf32_updatefile.c (updatemmap): Cleanups. Remove shdr_dest 1769 variable. Before writing sections, make a copy of the section 1770 header data if necessary. Don't write section header while 1771 writing the section constent, it might overwrite some sections. 1772 Restore the pointer afterwards. 1773 * elf32_updatenull.c (updatenull): If the offset of a section in a 1774 file changed make sure we read the section so that it'll be written 1775 out. 1776 1777 * elf_update.c: Remove debug message. 1778 17792005-12-07 Roland McGrath <roland@redhat.com> 1780 1781 * gelf_xlate.c [! ALLOW_UNALIGNED] (union unaligned): New type. 1782 (FETCH, STORE): New macros. 1783 (INLINE3): Use those to do alignment-friendly conversion. 1784 1785 * elf32_getshdr.c: Include map_address and start_offset in alignment 1786 calculations. 1787 * elf32_getphdr.c: Likewise. 1788 17892005-11-19 Roland McGrath <roland@redhat.com> 1790 1791 * elf.h: Update from glibc. 1792 17932005-11-17 Roland McGrath <roland@redhat.com> 1794 1795 * elf.h: Update from glibc. 1796 17972005-11-10 Roland McGrath <roland@redhat.com> 1798 1799 * elf.h: Update from glibc. 1800 18012005-09-09 Roland McGrath <roland@redhat.com> 1802 1803 * elf_update.c (write_file): Stat the file and fchmod it after update 1804 if its mode had S_ISUID or S_ISGID bits set. 1805 18062005-08-28 Ulrich Drepper <drepper@redhat.com> 1807 1808 * elf32_getphdr.c: Include <system.h>. Use pread_retry instead of 1809 pread. And branch prediction where useful. 1810 * elf_begin.c: Likewise. 1811 * elf_getdata.c: Likewise. 1812 * elf_getshstrndx.c: Likewise. 1813 * elf_readall.c: Likewise. 1814 * gelf_rawchunk.c: Likewise. 1815 * elf32_updatefile.c: Include <system.h>. Use pread_retry instead of 1816 pread. And branch prediction where useful. 1817 * elf_getarsym.c: Don't define pread_retry here. 1818 1819 * Makefile.am: Use $(LINK) not $(CC) when creating DSO. 1820 (%.os): Use COMPILE.os. 1821 (COMPILE.os): Filter out gconv options. 1822 18232005-08-27 Ulrich Drepper <drepper@redhat.com> 1824 1825 * elf_begin.c (file_read_elf): Avoid reading ELF header from file 1826 again. Instead accept additional parameter which points to it if we 1827 don't use mmap. 1828 (get_shnum): Use passed in e_ident value as source of ELF header. 1829 18302005-08-15 Ulrich Drepper <drepper@redhat.com> 1831 1832 * elf_begin.c (__libelf_next_arhdr): Use TEMP_FAILURE_RETRY. 1833 1834 * Makefile (libelf_a_SOURCES): Add elf_getaroff.c. 1835 * libelf.map: Export elf_getaroff. 1836 * libelf.h: Declare elf_getaroff. 1837 * elf_getaroff.c: New file. 1838 18392005-08-13 Ulrich Drepper <drepper@redhat.com> 1840 1841 * elf_begin.c (get_shnum): Optimize memory handling. Always read from 1842 mapped file if available. Fix access to 64-bit sh_size. Recognize 1843 overflow. 1844 (file_read_elf): Likewise. 1845 18462005-08-12 Roland McGrath <roland@redhat.com> 1847 1848 * elf32_offscn.c: Do not match empty sections at OFFSET unless 1849 there are no nonempty sections at that offset. 1850 18512005-08-07 Ulrich Drepper <drepper@redhat.com> 1852 1853 * elf.h: Update from glibc. 1854 18552005-08-06 Ulrich Drepper <drepper@redhat.com> 1856 1857 * Makefile.am (AM_CFLAGS): Add -fpic when BUILD_STATIC. 1858 18592005-08-03 Ulrich Drepper <drepper@redhat.com> 1860 1861 * libelf.map: Move elf32_offscn, elf64_offscn, and gelf_offscn in 1862 new version ELFUTILS_1.1.1. 1863 18642005-08-02 Ulrich Drepper <drepper@redhat.com> 1865 1866 * elf_error.c: Add handling of ELF_E_INVALID_OFFSET. 1867 * elf32_offscn.c: New file. 1868 * elf64_offscn.c: New file. 1869 * gelf_offscn.c: New file. 1870 * Makefile.am (libelf_a_SOURCES): Add elf32_offscn.c, elf64_offscn.c, 1871 and gelf_offscn.c. 1872 * libelf.sym: Export new symbols. 1873 18742005-07-23 Ulrich Drepper <drepper@redhat.com> 1875 1876 * elf-knowledge.h (SECTION_STRIP_P): Don't handle removal of debug 1877 sections here anymore. 1878 * elf32_checksum.c: Adjust for change in SECTION_STRIP_P interface. 1879 1880 * elf_update.c (elf_update): Get write lock, not read lock. 1881 1882 * elf32_updatenull.c (updatenull): Get section headers if necessary 1883 and possible. 1884 18852005-07-22 Ulrich Drepper <drepper@redhat.com> 1886 1887 * elf32_updatenull.c (updatenull): If program header hasn't been loaded 1888 yet, try to do it now. 1889 Don't unnecessarily update overflow of section count in zeroth section 1890 sh_size field. 1891 If section content hasn't been read yet, do it before looking for the 1892 block size. If no section data present, infer size of section header. 1893 18942005-05-11 Ulrich Drepper <drepper@redhat.com> 1895 1896 * elf.h: Update again. 1897 18982005-05-09 Ulrich Drepper <drepper@redhat.com> 1899 1900 * elf.h: Update from glibc. 1901 19022005-05-08 Roland McGrath <roland@redhat.com> 1903 1904 * elf_begin.c (read_file) [_MUDFLAP]: Don't use mmap for now. 1905 * elf_update.c (write_file) [_MUDFLAP]: Likewise. 1906 19072005-03-29 Ulrich Drepper <drepper@redhat.com> 1908 1909 * elf32_checksum.c: Use INTUSE and INTDEF to avoid PLTs. 1910 * elf_end.c: Likewise. 1911 * elf_getdata.c: Likewise. 1912 * gelf_getehdr.c: Likewise. 1913 * nlist.c: Likewise. 1914 * libelfP.h: Add declarations of internal functions. 1915 19162005-02-15 Ulrich Drepper <drepper@redhat.com> 1917 1918 * common.h (CONVERT): Make sure all values are unsigned. 1919 (CONVERT_TO): Likewise. 1920 1921 * Makefile.am (AM_CFLAGS): Add -Wformat=2. 1922 Fix rule to build libelf.so. 1923 19242005-02-06 Ulrich Drepper <drepper@redhat.com> 1925 1926 * Makefile.am: Cleanup AM_CFLAGS handling. Add -Wunused -Wextra. 1927 Remove lint handling. 1928 * elf32_getphdr.c: Minor cleanups. 1929 * elf32_getshdr.c: Likewise. 1930 * elf32_updatefile.c: Likewise. 1931 * elf32_updatenull.c: Likewise. 1932 * elf_begin.c: Likewise. 1933 * elf_error.c: Likewise. 1934 * elf_getarsym.c: Likewise. 1935 * elf_getdata.c: Likewise. 1936 * elf_update.c: Likewise. 1937 * gelf_xlate.c: Likewise. 1938 19392005-02-05 Ulrich Drepper <drepper@redhat.com> 1940 1941 * Makefile.am: Check for text relocations in constructed DSO. 1942 1943 * Makefile.am [MUDFLAP] (AM_CFLAGS): Add -Werror -fpic -fmudflap. 1944 19452005-02-04 Ulrich Drepper <drepper@redhat.com> 1946 1947 * gelf_getehdr.c (gelf_getehdr): Slight optimization. 1948 1949 * elf32_checksum.c (checksum): Do not look at NOBITS sections. 1950 1951 * gelf.h: Add gelf_checksum prototype. 1952 19532004-09-25 Ulrich Drepper <drepper@redhat.com> 1954 1955 * elf32_checksum.c: Make compile with gcc 4.0. 1956 * elf32_updatefile.c: Likewise. 1957 * elf32_updatenull.c: Likewise. 1958 * elf_begin.c: Likewise. 1959 * elf_error.c: Likewise. 1960 * elf_getdata.c: Likewise. 1961 * elf_getident.c: Likewise. 1962 19632004-04-01 Ulrich Drepper <drepper@redhat.com> 1964 1965 * elf.h: Update from glibc. 1966 19672004-01-23 Ulrich Drepper <drepper@redhat.com> 1968 1969 * elf_update.c: Fix locking. 1970 * elf_clone.c: Likewise. 1971 1972 * libelf.h: Define ELF_T_LIB. 1973 * gelf_getlib.c: New file. 1974 * gelf_update_lib.c: New file. 1975 * gelf.h: Declare the new functions. Define GElf_Lib. 1976 * abstract.h: Define Lib, Lib32, Lib64. 1977 * gelf_xlate.c (__elf_xfctstom): Add ELF_T_LIB entry. 1978 * gelf_xlate.h: Add entry for ElfXX_Lib. 1979 * elf_getdata.c: Recognize SHT_GNU_LIBLIST as a known section type. 1980 * libelf.map: Add new symbols to ELFUTILS_1.1. 1981 * Makefile.am (libelf_a_SOURCES): Add gelf_getlib.c and 1982 gelf_update_lib.c. 1983 19842004-01-17 Ulrich Drepper <drepper@redhat.com> 1985 1986 * Makefile.am: Support building with mudflap. 1987 1988 * gelf_xlate.c (INLINE3): Avoid using cast as lvalue. 1989 * dl-hash.h (_dl_elf_hash): Likewise. 1990 19912004-01-05 Ulrich Drepper <drepper@redhat.com> 1992 1993 * elf-knowledge.h: New file. From libelf subdir. 1994 * Makefile.am (euincludedir): Define. 1995 (euinclude_HEADERS): Add elf-knowledge.h. 1996 19972003-09-24 Ulrich Drepper <drepper@redhat.com> 1998 1999 * elf.h: Define some PT_IA_64_HP_* constants. 2000 20012003-09-23 Jakub Jelinek <jakub@redhat.com> 2002 2003 * libelfP.h (struct Elf): Move state.elf64.sizestr_offset after 2004 state.elf64.scnincr to match state.elf{,32}. 2005 20062003-08-12 Ulrich Drepper <drepper@redhat.com> 2007 2008 * elf32_updatefile.c (__updatemmap): When writing back file where 2009 some sections have not been read in, count their sizes based on 2010 the section header. 2011 20122003-08-11 Ulrich Drepper <drepper@redhat.com> 2013 2014 * Moved to CVS archive. 2015