1 2014-12-18 Ulrich Drepper <drepper (a] gmail.com> 2 3 * Makefile.am: Suppress output of textrel_check command. 4 5 2014-12-16 Mark Wielaard <mjw (a] redhat.com> 6 7 * elf_begin.c (read_long_names): Make sure long_names len fits 8 in mapped ELF file. 9 10 2014-12-15 Mark Wielaard <mjw (a] redhat.com> 11 12 * elf_getarsym.c (elf_getarsym): Check index_size doesn't overflow. 13 14 2014-12-15 Mark Wielaard <mjw (a] redhat.com> 15 16 * elf_begin.c (read_long_names): Clear any garbage left in the 17 name table. 18 19 2014-12-11 Mark Wielaard <mjw (a] redhat.com> 20 21 * elf_begin.c (file_read_elf): Correct ELF64 section offset check. 22 23 2014-12-11 Mark Wielaard <mjw (a] redhat.com> 24 25 * elf_begin.c (read_long_names): Check for offset overflow. 26 (__libelf_next_arhdr_wrlock): Likewise. Sanity check the ar_size. 27 Don't allow it to go beyond end of file. 28 29 2014-12-09 Mark Wielaard <mjw (a] redhat.com> 30 31 * elf_getarsym.c (elf_getarsym): Make sure n * w doesn't overflow. 32 33 2014-11-27 Mark Wielaard <mjw (a] redhat.com> 34 35 * Makefile.am (libelf.so): Use textrel_check. 36 37 2014-11-23 Mark Wielaard <mjw (a] redhat.com> 38 39 * elf_getdata_rawchunk.c (elf_getdata_rawchunk): Change signed 40 overflow check to unsigned. 41 42 2014-11-23 Mark Wielaard <mjw (a] redhat.com> 43 44 * note_xlate.h (elf_cvt_note): Copy over any leftover data if 45 src != dest. The data is probably part of truncated name/desc. 46 47 2014-11-22 Mark Wielaard <mjw (a] redhat.com> 48 49 * elf_getphdrnum.c (elf_getphdrnum): Sanity check the 50 __elf_getphdrnum_rdlock result. 51 52 2014-11-18 Mark Wielaard <mjw (a] redhat.com> 53 54 * version_xlate.h (elf_cvt_Verdef): Check for overflow. 55 (elf_cvt_Verneed): Likewise. 56 57 2014-11-17 Mark Wielaard <mjw (a] redhat.com> 58 59 * elf-knowledge.h (SECTION_STRIP_P): Check name is not NULL. 60 61 2014-11-16 Mark Wielaard <mjw (a] redhat.com> 62 63 * elf_getshdrstrndx.c: Check there are section headers before 64 handling SHN_XINDEX. 65 66 2014-11-16 Mark Wielaard <mjw (a] redhat.com> 67 68 * elf32_getphdr.c (getphdr_wrlock): Check e_phoff isn't zero. 69 Check for too many pheaders. 70 * elf_getphdrnum.c (__elf_getphdrnum_rdlock): Check section zero 71 actually exists before handling PN_XNUM. 72 73 2014-11-16 Mark Wielaard <mjw (a] redhat.com> 74 75 * gelf_getnote.c (gelf_getnote): Check padding overflow. 76 77 2014-11-16 Mark Wielaard <mjw (a] redhat.com> 78 79 * elf_getdata.c (__libelf_set_rawdata_wrlock): Declare offset, size 80 and align as Elf64_Off and Elf64_Xword not size_t. 81 82 2014-11-14 Mark Wielaard <mjw (a] redhat.com> 83 84 * gelf_getnote.c (gelf_getnote): Check offset overflow. 85 86 2014-11-13 Mark Wielaard <mjw (a] redhat.com> 87 88 * elf_getdata.c (__libelf_set_rawdata_wrlock): Fix unsigned overflow 89 check. 90 91 2014-11-08 Mark Wielaard <mjw (a] redhat.com> 92 93 * elf_begin.c (__libelf_next_arhdr_wrlock): Use mempcpy not __mempcpy. 94 95 2014-11-07 Mark Wielaard <mjw (a] redhat.com> 96 97 * elf_begin.c (file_read_elf): Correct sh_size check. 98 * elf_getdata.c (__libelf_set_rawdata_wrlock): Check for unsigned 99 overflow. 100 101 2014-09-10 Petr Machata <pmachata (a] redhat.com> 102 103 * elf_begin (read_unmmaped_file): Call __libelf_seterrno if the 104 file is unreadable. 105 106 2014-07-07 Mark Wielaard <mjw (a] redhat.com> 107 108 * elf.h: Update from glibc. 109 110 2014-04-13 Mark Wielaard <mjw (a] redhat.com> 111 112 * Makefile.am: Remove !MUDFLAP conditions. 113 * elf_begin.c (read_file): Don't clear use_mmap when _MUDFLAP is 114 defined. 115 * elf_update.c (write_file): Remove _MUDFLAP condition. 116 117 2014-01-17 Jakub Jelinek <jakub (a] redhat.com> 118 Roland McGrath <roland (a] redhat.com> 119 120 * libelfP.h (INVALID_NDX): Define. 121 * gelf_getdyn.c (gelf_getdyn): Use it. Remove ndx < 0 test if any. 122 * gelf_getlib.c (gelf_getlib): Likewise. 123 * gelf_getmove.c (gelf_getmove): Likewise. 124 * gelf_getrel.c (gelf_getrel): Likewise. 125 * gelf_getrela.c (gelf_getrela): Likewise. 126 * gelf_getsym.c (gelf_getsym): Likewise. 127 * gelf_getsyminfo.c (gelf_getsyminfo): Likewise. 128 * gelf_getsymshndx.c (gelf_getsymshndx): Likewise. 129 * gelf_getversym.c (gelf_getversym): Likewise. 130 * gelf_update_dyn.c (gelf_update_dyn): Likewise. 131 * gelf_update_lib.c (gelf_update_lib): Likewise. 132 * gelf_update_move.c (gelf_update_move): Likewise. 133 * gelf_update_rel.c (gelf_update_rel): Likewise. 134 * gelf_update_rela.c (gelf_update_rela): Likewise. 135 * gelf_update_sym.c (gelf_update_sym): Likewise. 136 * gelf_update_syminfo.c (gelf_update_syminfo): Likewise. 137 * gelf_update_symshndx.c (gelf_update_symshndx): Likewise. 138 * gelf_update_versym.c (gelf_update_versym): Likewise. 139 140 2014-01-17 Jakub Jelinek <jakub (a] redhat.com> 141 142 * elf32_getphdr.c (elfw2(LIBELFBITS,getphdr)): Check if program header 143 table fits into object's bounds. 144 * elf_getshdrstrndx.c (elf_getshstrndx): Add elf->start_offset to 145 elf->map_address. Check if first section header fits into object's 146 bounds. 147 * elf32_getshdr.c (elfw2(LIBELFBITS,getshdr)): 148 Check if section header table fits into object's bounds. 149 * elf_begin.c (get_shnum): Ensure section headers fits into 150 object's bounds. 151 (file_read_elf): Make sure scncnt is small enough to allocate both 152 ElfXX_Shdr and Elf_Scn array. Make sure section and program header 153 tables fit into object's bounds. Avoid memory leak on failure. 154 * elf_newscn.c (elf_newscn): Check for overflow. 155 * elf32_updatefile.c (__elfw2(LIBELFBITS,updatemmap)): Likewise. 156 (__elfw2(LIBELFBITS,updatefile)): Likewise. 157 * elf32_newphdr.c (elfw2(LIBELFBITS,newphdr)): Likewise. 158 * elf_getarsym.c (elf_getarsym): Likewise. 159 160 2013-11-08 Mark Wielaard <mjw (a] redhat.com> 161 162 * elf32_updatefile.c (elfXX_updatemmap): Only memcpy ehdr when not 163 already directly mmapped. 164 165 2013-11-05 Mark Wielaard <mjw (a] redhat.com> 166 167 * elf32_updatefile.c (elfXX_updatefile): Copy all section headers 168 if elf->flags dirty. 169 170 2013-11-01 Michael Forney <mforney (a] mforney.org> 171 172 * Makefile.am: Use READELF. 173 174 2013-10-01 Petr Machata <pmachata (a] redhat.com> 175 176 * elf.h: Update from glibc. 177 178 2013-06-17 Petr Machata <pmachata (a] redhat.com> 179 180 * elf.h: Update from glibc. 181 182 2013-08-28 Namhyung Kim <namhyung (a] gmail.com> 183 184 * gelf.h (gelf_fsize): Fix typo in comment. 185 186 2013-08-28 Mark Wielaard <mjw (a] redhat.com> 187 188 * gelf_getauxv.c (gelf_getauxv): Add missing whitespace. 189 190 2013-08-27 Mark Wielaard <mjw (a] redhat.com> 191 192 * gelf_getauxv.c (gelf_getauxv): Remove unnecessary casts to char *. 193 194 2013-08-25 Kurt Roeckx <kurt (a] roeckx.be> 195 196 * gelf_getauxv.c (gelf_getauxv): Use memcpy instead of pointer 197 dereference to avoid alignment problems. 198 199 2013-01-07 Roland McGrath <roland (a] hack.frob.com> 200 201 * elf_getarsym.c (elf_getarsym): Copy FILE_DATA into stack space if it 202 would be unaligned and !ALLOW_UNALIGNED. 203 204 * elf_getarsym.c (read_number_entries): Use memcpy instead of pointer 205 dereference so as not to assume the field is naturally aligned. 206 207 2012-09-17 Petr Machata <pmachata (a] redhat.com> 208 209 * elf.h: Update from glibc. 210 211 2012-08-16 Roland McGrath <roland (a] hack.frob.com> 212 213 * elf.h: Update from glibc. 214 215 2012-08-14 Mark Wielaard <mjw (a] redhat.com> 216 217 * elf32_checksum.c (ebl_debugscn_p): Removed unused define and 218 confusing outdated comment. 219 220 2012-08-01 Petr Machata <pmachata (a] redhat.com> 221 222 * elf_getarsym (read_number_entries): New function. 223 (elf_getarsym): Handle 64-bit symbol table, stored in special 224 entry named "/SYM64/". 225 * elf_begin.c (__libelf_next_arhdr_wrlock): Don't reject archive 226 because it contains 64-bit symbol table. 227 228 2012-07-19 Mark Wielaard <mjw (a] redhat.com> 229 230 * elf32_getshdr.c (load_shdr_wrlock): Add elf->flags & ELF_F_MALLOCED 231 to asserts. 232 233 2012-07-17 Petr Machata <pmachata (a] redhat.com> 234 235 * elf32_xlatetom.c (elfw2(LIBELFBITS, xlatetom)): Do not check for 236 integer number of records in case of ELF_T_NHDR. 237 238 2012-04-02 Mark Wielaard <mjw (a] redhat.com> 239 240 * elf32_offscn.c: Do not match SHT_NOBITS sections at OFFSET unless 241 there are no nonempty sections at that offset. 242 243 2012-03-21 Roland McGrath <roland (a] hack.frob.com> 244 245 * elf-knowledge.h (SECTION_STRIP_P): Remove < SHT_NUM check. 246 247 2011-02-26 Mark Wielaard <mjw (a] redhat.com> 248 249 * elf_end.c (elf_end): Call rwlock_unlock before rwlock_fini. 250 251 2011-01-05 Jan Kratochvil <jan.kratochvil (a] redhat.com> 252 253 * elf_getdata_rawchunk.c (elf_getdata_rawchunk): Fix off64_t overflow 254 when MAXIMUM_SIZE == ~0. 255 256 2010-08-18 Roland McGrath <roland (a] redhat.com> 257 258 * gelf_fsize.c (__libelf_type_sizes): Add entries for ELF_T_LIB 259 and ELF_T_GNUHASH. 260 Reported by Mark Hatle <mark.hatle (a] windriver.com>. 261 262 * exttypes.h: Add cases for ElfNN_Lib. 263 Reported by Mark Hatle <mark.hatle (a] windriver.com>. 264 265 2010-06-14 Ulrich Drepper <drepper (a] redhat.com> 266 267 * gelf_update_shdr.c: Implicitly set ELF_F_DIRTY bit. 268 * gelf_update_phdr.c: Likewise. 269 * gelf_update_ehdr.c: Likewise. 270 271 2010-04-14 Roland McGrath <roland (a] redhat.com> 272 273 * elf32_getphdr.c: Check for e_phoff/size outside the file bounds. 274 * elf_begin.c (file_read_elf): Don't set .phdr here. 275 276 2010-04-13 Roland McGrath <roland (a] redhat.com> 277 278 * elf.h: Update from glibc. 279 280 2010-04-06 Roland McGrath <roland (a] redhat.com> 281 282 * elf_error.c (ELF_E_FD_MISMATCH_IDX): Avoid nonobvious abbreviation 283 in error message. 284 285 2010-04-01 Petr Machata <pmachata (a] redhat.com> 286 287 * elf_getdata.c (__elf_getdata_rdlock): Initialize data.s for data 288 that do not need a conversion. 289 290 2010-03-11 Roland McGrath <roland (a] redhat.com> 291 292 * elf.h: Update from glibc. 293 294 2010-03-04 Ulrich Drepper <drepper (a] redhat.com> 295 296 * elf.h: Update from glibc. 297 298 2010-02-17 Roland McGrath <roland (a] redhat.com> 299 300 * elf_begin.c (file_read_elf): Leave section rawdata_base and 301 data_base pointers null when [sh_offset,sh_size) points outside 302 the mapped file. 303 304 2010-02-15 Roland McGrath <roland (a] redhat.com> 305 306 * Makefile.am: Use config/eu.am for common stuff. 307 308 2010-01-07 Roland McGrath <roland (a] redhat.com> 309 310 * elf32_getphdr.c: Use __elf_getphdrnum_rdlock. 311 * gelf_getphdr.c: Likewise. 312 * gelf_update_phdr.c: Likewise. 313 * elf32_updatefile.c (__elf32_updatemmap, __elf32_updatefile): Likewise. 314 * elf32_updatenull.c (__elf32_updatenull_wrlock): Likewise. 315 * elf32_newphdr.c: Clear section 0's sh_info when resetting e_phnum. 316 If COUNT is too large, use store PN_XNUM instead and set sh_info. 317 * elf_begin.c (file_read_elf): Always allocate space we can use later 318 for section 0 if doing RDWR. 319 320 * elf_getphdrnum.c: New file. 321 * Makefile.am (libelf_a_SOURCES): Add it. 322 * libelf.h: Declare elf_getphdrnum. 323 * libelfP.h: Declare __elf_getphdrnum_rdlock. 324 * libelf.map (ELFUTILS_1.6): New set, add elf_getphdrnum. 325 326 * elf.h: Update from glibc. 327 328 2009-10-23 Lubomir Rintel <lkundrak (a] v3.sk> 329 330 * elf32_updatefile.c (fill_mmap): When starting past shdr_end, start 331 filling from section start, not shdr_end. 332 333 2009-11-10 Roland McGrath <roland (a] redhat.com> 334 335 * elf_readall.c (__libelf_readall): Fetch file size if not yet known. 336 337 2009-11-06 Mark Wielaard <mjw (a] redhat.com> 338 339 * elf_next.c (elf_next): Mark the archive header as unusable when 340 there is no next ar element. 341 342 2009-08-12 Mark Wielaard <mjw (a] redhat.com> 343 344 * Makefile.am (libelf.so): Use -Wl,-z,defs not -defs. 345 346 2009-07-26 Ulrich Drepper <drepper (a] redhat.com> 347 348 * elf.h: Update from glibc. 349 350 2009-07-21 Ulrich Drepper <drepper (a] redhat.com> 351 352 * elf32_updatefile.c (__elfXX_updatemmap): Fix handling of gaps between 353 sections. Patch by Lubomir Rintel <lkundrak (a] v3.sk>. 354 355 2009-07-08 Roland McGrath <roland (a] redhat.com> 356 357 * libelfP.h (struct Elf): Remove unused ar.has_index field. 358 Reorder various members for optimal packing. 359 360 2009-07-08 Ulrich Drepper <drepper (a] redhat.com> 361 362 * elf.h: Update from glibc. 363 364 2009-06-13 Ulrich Drepper <drepper (a] redhat.com> 365 366 * Makefile.am (libelf_a_SOURCES): Replace elf_getshnum.c and 367 elf_getshstrndx.c with elf_getshdrnum.c and elf_getshdrstrndx.c. 368 * elf_getshnum.c: Renamed to... 369 * elf_getshdrnum.c: ...this. Rename function and add old name as 370 alias. Likewise for internal functions with derived names. 371 * elf_getshstrndx.c: Renamed to... 372 * elf_getshdrstrndx.c: ...this. Rename function and add old name as 373 alias. Likewise for internal functions with derived names. 374 * libelf.h: Add prototypes for new names. Make old names as 375 deprecated. 376 * libelfP.h: Rename internal function prototypes. 377 * libelf.map: Export for names. 378 * elf32_checksum.c: Don't use deprecated functions. 379 * elf32_getshdr.c: Likewise. 380 381 2009-06-01 Ulrich Drepper <drepper (a] redhat.com> 382 383 * elf.h: Update from glibc. 384 385 2009-04-14 Roland McGrath <roland (a] redhat.com> 386 387 * elf.h: Update from glibc. 388 389 2009-04-01 Roland McGrath <roland (a] redhat.com> 390 391 * elf.h: Update from glibc. 392 393 2009-02-10 Ulrich Drepper <drepper (a] redhat.com> 394 395 * elf32_updatefile.c (updatefile): For the zeroth section we still 396 have to copy the section header. 397 398 2009-02-01 Ulrich Drepper <drepper (a] redhat.com> 399 400 * elf_strptr.c: Add comment re possible problem. 401 402 2009-01-26 Ulrich Drepper <drepper (a] redhat.com> 403 404 * elf32_updatenull.c (updatenull_wrlock): Fix comment of 405 ELF_F_LAYOUT behaviour re section header table. 406 407 2009-01-22 Ulrich Drepper <drepper (a] redhat.com> 408 409 * elf32_updatefile.c (__elfXX_updatemmap): Fill the gap between 410 sections even if only the section at the start of the gap has been 411 changed. 412 (__elfXX_updatefile): Likewise. 413 414 2009-01-21 Ulrich Drepper <drepper (a] redhat.com> 415 416 * elf32_updatefile.c (__elfXX_updatemmap): Skip most of the loop to 417 handle sections for NOBITS sections. 418 (elfXX_updatefile): Likewise. 419 420 * elf32_updatefile.c (__elfXX_updatemmap): When skipping non-NOBITS 421 sections we haven't loaded, update last_position based on scn_start, 422 not based on old value. Don't run the loop for the dummy section 0. 423 (elfXX_updatefile): Don't run the loop for the dummy section 0. 424 425 2009-01-10 Ulrich Drepper <drepper (a] redhat.com> 426 427 * libelfP.h (_): We only have one translation domain, elfutils. 428 429 * Makefile.am: Use USE_LOCKS instead of USE_TLS. 430 * elf_error.c: Always use __thread. Remove all !USE_TLS code. 431 432 2009-01-04 Roland McGrath <roland (a] redhat.com> 433 434 * note_xlate.h (elf_cvt_note): Don't examine a size too small to 435 container a note header. 436 437 2008-12-11 Roland McGrath <roland (a] redhat.com> 438 439 * elf32_updatefile.c (__elfw2(LIBELFBITS,updatemmap)): Handle 440 placement offset going backwards, for out-of-order or overlapping 441 (bogus) sh_offset layouts. It's a dumb use, but should not crash. 442 (__elfw2(LIBELFBITS,updatefile)): Likewise. 443 Fixes RHBZ#476136. 444 445 * libelf.h (Elf_Data): Whitespace fix. 446 447 2008-12-10 Roland McGrath <roland (a] redhat.com> 448 449 * elf_getarhdr.c (elf_getarhdr): Fix missing rename in last change. 450 451 2008-10-22 Petr Machata <pmachata (a] redhat.com> 452 453 * elf_rawfile.c (elf_rawfile): Lock around elf-> references. 454 455 2008-10-21 Petr Machata <pmachata (a] redhat.com> 456 457 * libelfP.h: Rename getehdr_rdlock to getehdr_wrlock. 458 * elf32_getehdr.c (getehdr_rdlock): Move the code to new function 459 getehdr_impl and make it a wrapper. Rename to getehdr_wrlock. 460 (getehdr_impl): Guard elf->class init with wrlock. 461 (getehdr): Also make it a wrapper of getehdr_impl. 462 * elf32_updatenull.c (updatenull_wrlock): Call getehdr_wrlock. 463 464 2008-10-20 Petr Machata <pmachata (a] redhat.com> 465 466 * elf_getdata_rawchunk.c (elf_getdata_rawchunk): Lock around the 467 code that reads mutable elf state. Relock to write lock to chain 468 the new chunk on the elf rawchunks list. 469 470 2008-10-20 Petr Machata <pmachata (a] redhat.com> 471 472 * elf32_checksum.c (checksum): Place a lock around the code that 473 processes data. Make it wrlock if the code needs to xlate the 474 data before processing. 475 476 2008-10-16 Petr Machata <pmachata (a] redhat.com> 477 478 * elf_begin.c 479 (__libelf_next_arhdr): Rename to __libelf_next_arhdr_wrlock. 480 (dup_elf): Adjust the call. 481 (elf_begin): New local function lock_dup_elf. Relocks the elf if 482 necessary before calling dup. Call this instead of dup_elf. 483 * elf_getarhdr.c 484 (elf_getarhdr): Lock before calling __libelf_next_arhdr_wrlock. 485 * elf_next.c (elf_next): Likewise. 486 * elf_rand.c (elf_rand): Likewise. 487 488 2008-10-14 Petr Machata <pmachata (a] redhat.com> 489 490 * elf_getdata.c (__elf_getdata_rdlock): Lock before converting. 491 492 2008-11-26 Roland McGrath <roland (a] redhat.com> 493 494 * elf.h: Update from glibc. 495 496 2008-10-06 Roland McGrath <roland (a] redhat.com> 497 498 * elf_getarhdr.c (elf_getarhdr): Return NULL when passed NULL. 499 500 2008-08-27 Roland McGrath <roland (a] redhat.com> 501 502 * elf_begin.c (get_shnum): Avoid misaligned reads for matching endian. 503 504 * libelfP.h [!ALLOW_UNALIGNED] (__libelf_type_align): Fix CLASS index. 505 506 2008-08-25 Roland McGrath <roland (a] redhat.com> 507 508 * Makefile.am (libelf_so_LDLIBS): New variable. 509 (libelf.so): Use it in the link. 510 511 2008-08-21 Petr Machata <pmachata (a] redhat.com> 512 513 * elf_getdata.c, libelfP.h 514 (__elf_getdata_internal): Rename to __elf_getdata_rdlock. 515 (__libelf_set_rawdata_wrlock): New function. 516 (__libelf_set_rawdata): Make it a wrapper that calls *_wrlock. 517 * elf32_updatenull.c, libelfP.h 518 (__elfNN_updatenull): Rename to __elfNN_updatenull_wrlock. 519 520 2008-08-21 Petr Machata <pmachata (a] redhat.com> 521 522 * elf32_getphdr.c, libelfP.h 523 (__elfNN_getphdr_internal): Drop. Move __elfNN_getphdr_internal 524 code to __elfNN_getphdr_wrlock. 525 (__elfNN_getphdr_rdlock, __elfNN_getphdr_wrlock): New functions. 526 (__elfNN_getphdr_rdlock, __elfNN_getphdr_wrlock): Make these 527 wrappers of getphdr_impl. 528 529 2008-08-21 Petr Machata <pmachata (a] redhat.com> 530 531 * elf32_getehdr.c, libelfP.h 532 (__elfNN_getehdr_internal): Rename to __elfNN_getehdr_rdlock. 533 * gelf_getehdr, libelfP.h: 534 (__gelf_getehdr_internal): Rename to __gelf_getehdr_rdlock. 535 536 2008-08-21 Petr Machata <pmachata (a] redhat.com> 537 538 * elf32_getshdr.c 539 (__elfNN_getshdr_internal): Drop. 540 (load_shdr_wrlock, scn_valid): New functions, contain bits of 541 behaviour from __elfNN_getshdr_internal. 542 (__elfNN_getshdr_rdlock, __elfNN_getshdr_wrlock): Replacements for 543 dropped _internal functions above. 544 * elf_getshnum.c 545 (__elf_getshnum_internal): Rename to __elf_getshnum_rdlock. 546 547 2008-08-04 Petr Machata <pmachata (a] redhat.com> 548 549 * libelfP.h (RWLOCK_RDLOCK, RWLOCK_WRLOCK, RWLOCK_UNLOCK): New macros. 550 551 2008-07-28 Roland McGrath <roland (a] redhat.com> 552 553 * elf.h: Update from glibc. 554 555 2008-03-31 Roland McGrath <roland (a] redhat.com> 556 557 * elf32_offscn.c: Make sure shdrs have been read in. 558 559 2008-02-19 Roland McGrath <roland (a] redhat.com> 560 561 * elf.h: Update from glibc. 562 563 2008-02-08 Roland McGrath <roland (a] redhat.com> 564 565 * elf.h: Update from glibc. 566 567 2008-01-31 Ulrich Drepper <drepper (a] redhat.com> 568 569 * elf_strptr.c (elf_strptr): Don't fail if the ELF file is currently 570 under construction and no raw data can be read from disk. 571 572 2008-01-30 Roland McGrath <roland (a] redhat.com> 573 574 * elf.h: Update from glibc. 575 576 2008-01-26 Roland McGrath <roland (a] redhat.com> 577 578 * elf_begin.c (__libelf_next_arhdr): Rewrite conversions using a macro. 579 Fixes various pastos in wrong type in sizeof, wrong string parsed. 580 581 2008-01-20 Roland McGrath <roland (a] redhat.com> 582 583 * elf_getaroff.c: Calculate from start_offset, instead of using 584 parent's state.ar.offset field. 585 586 2008-01-08 Roland McGrath <roland (a] redhat.com> 587 588 * Makefile.am (euinclude): Variable removed. 589 (pkginclude_HEADERS): Set this instead of euinclude_HEADERS. 590 591 2008-01-03 Roland McGrath <roland (a] redhat.com> 592 593 * common.h: Add __attribute__ ((unused)) to static functions. 594 595 2007-12-20 Ulrich Drepper <drepper (a] redhat.com> 596 597 * Makefile.am (libelf_a_SOURCES): Add elf_scnshndx. 598 * libelfP.h (struct Elf_Scn): Add shndx_index field. 599 Declare __elf_scnshndx_internal. 600 * elf32_getshdr.c: Record location of extended section header. 601 * elf_begin.c (file_read_elf): Likewise. 602 * elf_scnshndx.c: New file. 603 * libelf.h: Declare elf_scnshndx. 604 * libelf.map: Add elf_scnshndx to version ELFUTILS_1.4. 605 606 2007-11-12 Roland McGrath <roland (a] redhat.com> 607 608 * libelf.h: Replace off64_t with loff_t throughout. 609 Only that type name is unconditionally defined by <sys/types.h> 610 611 2007-11-03 Roland McGrath <roland (a] redhat.com> 612 613 * libelf.h (Elf_Data): Comment fix. 614 615 2007-10-18 Roland McGrath <roland (a] redhat.com> 616 617 * elf.h: Update from glibc. 618 619 2007-10-07 Roland McGrath <roland (a] redhat.com> 620 621 * elf_begin.c (__libelf_next_arhdr): Fix fencepost error and wrong 622 member access in terminating name with no trailing /. Trim trailing 623 spaces when there is no /. 624 625 2007-10-04 Roland McGrath <roland (a] redhat.com> 626 627 * elf_end.c (elf_end): Don't free ELF->state.ar.ar_sym when it's -1l. 628 629 2007-10-03 Roland McGrath <roland (a] redhat.com> 630 631 * libelf.h (Elf_Data): Use off64_t for d_off. 632 (Elf_Arhdr): Use off64_t for ar_size. 633 (elf_update, elf_getbase, elf_getaroff): Return off64_t. 634 635 * gelf_rawchunk.c: File removed. 636 * gelf_freechunk.c: File removed. 637 * Makefile.am (libelf_a_SOURCES): Remove them. 638 * libelf.map (ELFUTILS_1.0): Remove exports. 639 * gelf.h: Remove decls. 640 641 * elf_getdata_rawchunk.c: New file. 642 * Makefile.am (libelf_a_SOURCES): Add it. 643 * libelf.map (ELFUTILS_1.3): Add elf_getdata_rawchunk. 644 * libelf.h: Declare it. 645 * libelfP.h (Elf_Data_Chunk): New type. 646 (struct Elf.elf): New member `rawchunks'. 647 * elf_end.c (elf_end): Free recorded rawchunk buffers. 648 649 2007-08-24 Roland McGrath <roland (a] redhat.com> 650 651 * gelf_getnote.c: New file. 652 * Makefile.am (libelf_a_SOURCES): Add it. 653 * gelf.h: Declare gelf_getnote. 654 * libelf.map (ELFUTILS_1.3): Add gelf_getnote. 655 656 * libelfP.h (NOTE_ALIGN): New macro. 657 * note_xlate.h: New file. 658 * Makefile.am (noinst_HEADERS): Add it. 659 * gelf_xlate.c: Include it. 660 (__elf_xfctstom): Use elf_cvt_note. 661 * elf_getdata.c (shtype_map, __libelf_type_align): Handle SHT_NOTE. 662 (__libelf_set_rawdata): Likewise. 663 664 2007-08-19 Roland McGrath <roland (a] redhat.com> 665 666 * gelf_update_auxv.c: New file. 667 * gelf_getauxv.c: New file. 668 * Makefile.am (libelf_a_SOURCES): Add them. 669 * gelf.h: Declare gelf_getauxv, gelf_update_auxv. 670 * libelf.map (ELFUTILS_1.3): New set, inherits fom ELFUTILS_1.2. 671 Export gelf_getauxv, gelf_update_auxv. 672 673 * libelf.h (Elf_Type): Add ELF_T_AUXV. 674 * abstract.h: Add auxv_t entries. 675 * exttypes.h: Likewise. 676 * gelf_xlate.h: Likewise. 677 * gelf_xlate.c (__elf_xfctstom): Add ELF_T_AUXV entries. 678 * gelf_fsize.c (__libelf_type_sizes): Likewise. 679 680 2007-08-12 Roland McGrath <roland (a] redhat.com> 681 682 * elf32_updatefile.c (compare_sections): Sort secondarily on sh_size, 683 and only tertiarily on index. 684 685 2007-07-09 Roland McGrath <roland (a] redhat.com> 686 687 * elf.h: Update from glibc. 688 689 2007-04-22 Roland McGrath <roland (a] redhat.com> 690 691 * elf.h: Update from glibc. 692 693 2007-03-18 Roland McGrath <roland (a] redhat.com> 694 695 * elf_begin.c (get_shnum): Fix test for e_shoff being out of bounds. 696 Return zero when the section headers do not fit within MAXSIZE. 697 698 2007-03-09 Roland McGrath <roland (a] redhat.com> 699 700 * libelfP.h (LIBELF_EV_IDX): New macro. 701 (__libelf_type_align): New macro. 702 [! ALLOW_UNALIGNED]: Declare __libc_type_aligns array. 703 * elf_getdata.c (shtype_map): Convert to just Elf_Type[][]. 704 (convert_data, __libelf_set_rawdata): Use that, __libelf_type_align, 705 and __libelf_type_sizes, in place of old table. 706 (__libc_type_aligns): New const variable. 707 708 2007-02-04 Ulrich Drepper <drepper (a] redhat.com> 709 710 * Makefile (libelf.so): Build with -z relro. 711 712 * elf_begin.c (read_file): When using ELF_C_READ_MMAP use MAP_PRIVATE. 713 714 2007-01-30 Ulrich Drepper <drepper (a] redhat.com> 715 716 * nlist.c: Close file descriptor before returning. 717 718 2007-01-20 Roland McGrath <roland (a] redhat.com> 719 720 * gnuhash_xlate.h (elf_cvt_gnuhash): Fix fence-post error so we 721 convert the final word. 722 723 * elf32_getshdr.c: Don't byteswap shdr fields when EI_DATA matches 724 MY_ELFDATA on !ALLOW_UNALIGNED machines. 725 726 2007-01-18 Roland McGrath <roland (a] redhat.com> 727 728 * gelf_rawchunk.c (gelf_rawchunk): Clear RESULT pointer after freeing 729 it on read error. 730 731 2006-10-13 Roland McGrath <roland (a] redhat.com> 732 733 * elf32_updatenull.c: Look for and accept phdr also for ET_CORE. 734 * elf_error.c (msgstr): Change ELF_E_INVALID_PHDR string. 735 736 2006-08-29 Roland McGrath <roland (a] redhat.com> 737 738 * elf32_getphdr.c: Don't byteswap phdr fields when EI_DATA matches 739 MY_ELFDATA on !ALLOW_UNALIGNED machines. 740 Reported by Christian Aichinger <Greek0 (a] gmx.net>. 741 742 * Makefile.am (CLEANFILES): Add libelf.so.$(VERSION). 743 744 2006-08-08 Ulrich Drepper <drepper (a] redhat.com> 745 746 * elf.h (DT_VALNUM): Update. 747 (DT_ADDRNUM): Likewise. 748 749 2006-07-12 Ulrich Drepper <drepper (a] redhat.com> 750 751 * elf32_updatefile.c: Adjust for internal_function_def removal. 752 * elf32_updatenull.c: Likewise. 753 * elf_begin.c: Likewise. 754 * elf_getdata.c: Likewise. 755 756 2006-07-11 Ulrich Drepper <drepper (a] redhat.com> 757 758 * libelf.h: Define ELF_T_GNUHASH. 759 * elf_getdata.c (TYPEIDX): Handle SHT_GNU_HASH. 760 (shtype_map): Add SHT_GNU_HASH entries. 761 * gelf_xlate.c (__elf_xfctstom): Add ELF_T_GNUHASH entries. 762 * gnuhash_xlate.h: New file. 763 * Makefile.am (noinst_HEADERS): Add gnuhash_xlate.h. 764 765 2006-07-06 Ulrich Drepper <drepper (a] redhat.com> 766 767 * elf_gnu_hash.c: New file. 768 * libelf.h: Declare elf_gnu_hash. 769 * Makefile.am (libelf_a_SOURCES): Add elf_gnu_hash. 770 * libelf.map: Add elf_gnu_map for version ELFUTILS_1.2. 771 772 2006-06-15 Roland McGrath <roland (a] redhat.com> 773 774 * libelf.h (elf_getarsym): Fix comment typo. 775 Rename second parameter to be more explanatory. 776 (elf_getident, elf_rawhide): Likewise. 777 778 2006-05-28 Ulrich Drepper <drepper (a] redhat.com> 779 780 * elf32_updatefile.c (updatemmap): Preserve section content if 781 copying would overwrite them. 782 Fix msync paramters. 783 784 2006-04-04 Roland McGrath <roland (a] redhat.com> 785 786 * elf32_updatefile.c (updatemmap): Handle other-endian case. 787 788 2006-04-04 Ulrich Drepper <drepper (a] redhat.com> 789 790 * elf32_updatefile.c (updatemmap): Cleanups. Remove shdr_dest 791 variable. Before writing sections, make a copy of the section 792 header data if necessary. Don't write section header while 793 writing the section constent, it might overwrite some sections. 794 Restore the pointer afterwards. 795 * elf32_updatenull.c (updatenull): If the offset of a section in a 796 file changed make sure we read the section so that it'll be written 797 out. 798 799 * elf_update.c: Remove debug message. 800 801 2005-12-07 Roland McGrath <roland (a] redhat.com> 802 803 * gelf_xlate.c [! ALLOW_UNALIGNED] (union unaligned): New type. 804 (FETCH, STORE): New macros. 805 (INLINE3): Use those to do alignment-friendly conversion. 806 807 * elf32_getshdr.c: Include map_address and start_offset in alignment 808 calculations. 809 * elf32_getphdr.c: Likewise. 810 811 2005-11-19 Roland McGrath <roland (a] redhat.com> 812 813 * elf.h: Update from glibc. 814 815 2005-11-17 Roland McGrath <roland (a] redhat.com> 816 817 * elf.h: Update from glibc. 818 819 2005-11-10 Roland McGrath <roland (a] redhat.com> 820 821 * elf.h: Update from glibc. 822 823 2005-09-09 Roland McGrath <roland (a] redhat.com> 824 825 * elf_update.c (write_file): Stat the file and fchmod it after update 826 if its mode had S_ISUID or S_ISGID bits set. 827 828 2005-08-28 Ulrich Drepper <drepper (a] redhat.com> 829 830 * elf32_getphdr.c: Include <system.h>. Use pread_retry instead of 831 pread. And branch prediction where useful. 832 * elf_begin.c: Likewise. 833 * elf_getdata.c: Likewise. 834 * elf_getshstrndx.c: Likewise. 835 * elf_readall.c: Likewise. 836 * gelf_rawchunk.c: Likewise. 837 * elf32_updatefile.c: Include <system.h>. Use pread_retry instead of 838 pread. And branch prediction where useful. 839 * elf_getarsym.c: Don't define pread_retry here. 840 841 * Makefile.am: Use $(LINK) not $(CC) when creating DSO. 842 (%.os): Use COMPILE.os. 843 (COMPILE.os): Filter out gconv options. 844 845 2005-08-27 Ulrich Drepper <drepper (a] redhat.com> 846 847 * elf_begin.c (file_read_elf): Avoid reading ELF header from file 848 again. Instead accept additional parameter which points to it if we 849 don't use mmap. 850 (get_shnum): Use passed in e_ident value as source of ELF header. 851 852 2005-08-15 Ulrich Drepper <drepper (a] redhat.com> 853 854 * elf_begin.c (__libelf_next_arhdr): Use TEMP_FAILURE_RETRY. 855 856 * Makefile (libelf_a_SOURCES): Add elf_getaroff.c. 857 * libelf.map: Export elf_getaroff. 858 * libelf.h: Declare elf_getaroff. 859 * elf_getaroff.c: New file. 860 861 2005-08-13 Ulrich Drepper <drepper (a] redhat.com> 862 863 * elf_begin.c (get_shnum): Optimize memory handling. Always read from 864 mapped file if available. Fix access to 64-bit sh_size. Recognize 865 overflow. 866 (file_read_elf): Likewise. 867 868 2005-08-12 Roland McGrath <roland (a] redhat.com> 869 870 * elf32_offscn.c: Do not match empty sections at OFFSET unless 871 there are no nonempty sections at that offset. 872 873 2005-08-07 Ulrich Drepper <drepper (a] redhat.com> 874 875 * elf.h: Update from glibc. 876 877 2005-08-06 Ulrich Drepper <drepper (a] redhat.com> 878 879 * Makefile.am (AM_CFLAGS): Add -fpic when BUILD_STATIC. 880 881 2005-08-03 Ulrich Drepper <drepper (a] redhat.com> 882 883 * libelf.map: Move elf32_offscn, elf64_offscn, and gelf_offscn in 884 new version ELFUTILS_1.1.1. 885 886 2005-08-02 Ulrich Drepper <drepper (a] redhat.com> 887 888 * elf_error.c: Add handling of ELF_E_INVALID_OFFSET. 889 * elf32_offscn.c: New file. 890 * elf64_offscn.c: New file. 891 * gelf_offscn.c: New file. 892 * Makefile.am (libelf_a_SOURCES): Add elf32_offscn.c, elf64_offscn.c, 893 and gelf_offscn.c. 894 * libelf.sym: Export new symbols. 895 896 2005-07-23 Ulrich Drepper <drepper (a] redhat.com> 897 898 * elf-knowledge.h (SECTION_STRIP_P): Don't handle removal of debug 899 sections here anymore. 900 * elf32_checksum.c: Adjust for change in SECTION_STRIP_P interface. 901 902 * elf_update.c (elf_update): Get write lock, not read lock. 903 904 * elf32_updatenull.c (updatenull): Get section headers if necessary 905 and possible. 906 907 2005-07-22 Ulrich Drepper <drepper (a] redhat.com> 908 909 * elf32_updatenull.c (updatenull): If program header hasn't been loaded 910 yet, try to do it now. 911 Don't unnecessarily update overflow of section count in zeroth section 912 sh_size field. 913 If section content hasn't been read yet, do it before looking for the 914 block size. If no section data present, infer size of section header. 915 916 2005-05-11 Ulrich Drepper <drepper (a] redhat.com> 917 918 * elf.h: Update again. 919 920 2005-05-09 Ulrich Drepper <drepper (a] redhat.com> 921 922 * elf.h: Update from glibc. 923 924 2005-05-08 Roland McGrath <roland (a] redhat.com> 925 926 * elf_begin.c (read_file) [_MUDFLAP]: Don't use mmap for now. 927 * elf_update.c (write_file) [_MUDFLAP]: Likewise. 928 929 2005-03-29 Ulrich Drepper <drepper (a] redhat.com> 930 931 * elf32_checksum.c: Use INTUSE and INTDEF to avoid PLTs. 932 * elf_end.c: Likewise. 933 * elf_getdata.c: Likewise. 934 * gelf_getehdr.c: Likewise. 935 * nlist.c: Likewise. 936 * libelfP.h: Add declarations of internal functions. 937 938 2005-02-15 Ulrich Drepper <drepper (a] redhat.com> 939 940 * common.h (CONVERT): Make sure all values are unsigned. 941 (CONVERT_TO): Likewise. 942 943 * Makefile.am (AM_CFLAGS): Add -Wformat=2. 944 Fix rule to build libelf.so. 945 946 2005-02-06 Ulrich Drepper <drepper (a] redhat.com> 947 948 * Makefile.am: Cleanup AM_CFLAGS handling. Add -Wunused -Wextra. 949 Remove lint handling. 950 * elf32_getphdr.c: Minor cleanups. 951 * elf32_getshdr.c: Likewise. 952 * elf32_updatefile.c: Likewise. 953 * elf32_updatenull.c: Likewise. 954 * elf_begin.c: Likewise. 955 * elf_error.c: Likewise. 956 * elf_getarsym.c: Likewise. 957 * elf_getdata.c: Likewise. 958 * elf_update.c: Likewise. 959 * gelf_xlate.c: Likewise. 960 961 2005-02-05 Ulrich Drepper <drepper (a] redhat.com> 962 963 * Makefile.am: Check for text relocations in constructed DSO. 964 965 * Makefile.am [MUDFLAP] (AM_CFLAGS): Add -Werror -fpic -fmudflap. 966 967 2005-02-04 Ulrich Drepper <drepper (a] redhat.com> 968 969 * gelf_getehdr.c (gelf_getehdr): Slight optimization. 970 971 * elf32_checksum.c (checksum): Do not look at NOBITS sections. 972 973 * gelf.h: Add gelf_checksum prototype. 974 975 2004-09-25 Ulrich Drepper <drepper (a] redhat.com> 976 977 * elf32_checksum.c: Make compile with gcc 4.0. 978 * elf32_updatefile.c: Likewise. 979 * elf32_updatenull.c: Likewise. 980 * elf_begin.c: Likewise. 981 * elf_error.c: Likewise. 982 * elf_getdata.c: Likewise. 983 * elf_getident.c: Likewise. 984 985 2004-04-01 Ulrich Drepper <drepper (a] redhat.com> 986 987 * elf.h: Update from glibc. 988 989 2004-01-23 Ulrich Drepper <drepper (a] redhat.com> 990 991 * elf_update.c: Fix locking. 992 * elf_clone.c: Likewise. 993 994 * libelf.h: Define ELF_T_LIB. 995 * gelf_getlib.c: New file. 996 * gelf_update_lib.c: New file. 997 * gelf.h: Declare the new functions. Define GElf_Lib. 998 * abstract.h: Define Lib, Lib32, Lib64. 999 * gelf_xlate.c (__elf_xfctstom): Add ELF_T_LIB entry. 1000 * gelf_xlate.h: Add entry for ElfXX_Lib. 1001 * elf_getdata.c: Recognize SHT_GNU_LIBLIST as a known section type. 1002 * libelf.map: Add new symbols to ELFUTILS_1.1. 1003 * Makefile.am (libelf_a_SOURCES): Add gelf_getlib.c and 1004 gelf_update_lib.c. 1005 1006 2004-01-17 Ulrich Drepper <drepper (a] redhat.com> 1007 1008 * Makefile.am: Support building with mudflap. 1009 1010 * gelf_xlate.c (INLINE3): Avoid using cast as lvalue. 1011 * dl-hash.h (_dl_elf_hash): Likewise. 1012 1013 2004-01-05 Ulrich Drepper <drepper (a] redhat.com> 1014 1015 * elf-knowledge.h: New file. From libelf subdir. 1016 * Makefile.am (euincludedir): Define. 1017 (euinclude_HEADERS): Add elf-knowledge.h. 1018 1019 2003-09-24 Ulrich Drepper <drepper (a] redhat.com> 1020 1021 * elf.h: Define some PT_IA_64_HP_* constants. 1022 1023 2003-09-23 Jakub Jelinek <jakub (a] redhat.com> 1024 1025 * libelfP.h (struct Elf): Move state.elf64.sizestr_offset after 1026 state.elf64.scnincr to match state.elf{,32}. 1027 1028 2003-08-12 Ulrich Drepper <drepper (a] redhat.com> 1029 1030 * elf32_updatefile.c (__updatemmap): When writing back file where 1031 some sections have not been read in, count their sizes based on 1032 the section header. 1033 1034 2003-08-11 Ulrich Drepper <drepper (a] redhat.com> 1035 1036 * Moved to CVS archive. 1037