12019-11-26 Mark Wielaard <mark@klomp.org> 2 3 * Makefile.am (BUILD_STATIC): Add libraries needed for libdw. 4 52019-10-26 Mark Wielaard <mark@klomp.org> 6 7 * unstrip.c (collect_symbols): Check symbol strings are 8 terminated. 9 102019-10-18 Mark Wielaard <mark@klomp.org> 11 12 * unstrip.c (adjust_relocs): Set versym data d_size to the actual 13 size allocated. 14 152019-10-20 Mark Wielaard <mark@klomp.org> 16 17 * unstrip.c (copy_elided_sections): Set and check max_off. 18 192019-10-21 Mark Wielaard <mark@klomp.org> 20 21 * unstrip.c (adjust_relocs): Add map_size argument and check ndx 22 against it. 23 (adjust_all_relocs): Add map_size argument and pass it to 24 adjust_relocs. 25 (add_new_section_symbols): Call adjust_all_relocs with symndx_map 26 size. 27 (collect)symbols): Check sym and string data can be found. 28 (compare_symbols_output): Call error when (different) symbols are 29 equal. 30 (new_shstrtab): Make unstripped_strent array one larger. Check 31 stripped_shnum isn't zero. 32 (copy_elided_sections): Add ndx_sec_num as size of ndx_section 33 array. Check sh_link and sh_info are not larger than ndx_sec_num. 34 Allocate symbols and symndx_map arrays on heap, not stack. Pass 35 map sizes to adjust_all_relocs. 36 372019-09-28 Dmitry V. Levin <ldv@altlinux.org> 38 39 * elflint.c (main): When an input file cannot be opened, 40 include its name into the error diagnostics. 41 * readelf.c (main): Likewise. 42 432019-09-02 Mark Wielaard <mark@klomp.org> 44 45 * readelf.c (PRINT_DYNSYM_TABLE): New argp key value. 46 (argp_opt): Add syn-sym. 47 (print_dynsym_table): New static bool. 48 (parse_opt): Handle PRINT_DYNSYM_TABLE. 49 (process_elf_file): Check print_dynsym_table. 50 512019-08-27 Mark Wielaard <mark@klomp.org> 52 53 * readelf.c (for_each_section_argument): Call (*dump) also for 54 section numbers. 55 562019-08-26 Mark Wielaard <mark@klomp.org> 57 58 * nm.c (show_symbols): Remember nentries_orig and check before 59 freeing sym_mem. 60 612019-07-05 Omar Sandoval <osandov@fb.com> 62 63 * Makefile.am: Remove -ldl. 64 (elflint_LDADD): Add $(libdw). 65 (elfcmp_LDADD): Add $(libdw). 66 (objdump_LDADD): Add $(libdw). 67 682019-08-26 Mark Wielaard <mark@klomp.org> 69 70 * readelf (options): Add OPTION_ARG_OPTIONAL "SECTION" for notes. 71 (notes_section): New global variable. 72 (parse_opt): Set notes_section. 73 (handle_notes): Check if notes_section is set. 74 752019-07-26 Florian Weimer <fweimer@redhat.com> 76 Mark Wielaard <mark@klomp.org> 77 78 * Makefile.am (bin_PROGRAMS): Add elfclassify. 79 (elfclassify_LDADD): New variable. 80 * elfclassify.c: New tool. 81 822019-07-13 Mao Han <han_mao@c-sky.com> 83 84 * elflint.c: Add C-SKY. 85 862019-06-28 Mark Wielaard <mark@klomp.org> 87 88 * readelf.c (print_ehdr): Use dwelf_elf_e_machine_string instead of 89 ebl->name. If unknown print hex value. 90 912019-06-25 Mark Wielaard <mark@klomp.org> 92 93 * stack.c (parse_opt): Fix dwfl_core_file_attach error message. 94 952019-06-18 Mark Wielaard <mark@klomp.org> 96 97 * strip.c (handle_elf): Use elf_begin ELF_C_WRITE, instead of 98 ELF_C_WRITE_MMAP. 99 1002019-05-10 Mark Wielaard <mark@klomp.org> 101 102 * readelf.c (struct attrcb_args): Rename die to dies. 103 (attr_callback): Get current current die using dies[level]. 104 Handle DW_AT_discr_list as block, not as constant. 105 (print_debug_units): pass dies, not dies[level] as args. 106 1072019-05-09 Mark Wielaard <mark@klomp.org> 108 109 * readelf.c (cleanup_list): New function. 110 (main): Call cleanup_list for dump_data_sections and string_sections. 111 1122019-04-28 Mark Wielaard <mark@klomp.org> 113 114 * unstrip.c (add_new_section_symbols): Call ELF_CHECK after 115 gelf_getsymshndx. 116 (new_shstrtab): Call ELF_CHECK after gelf_getshdr. 117 1182019-04-28 Mark Wielaard <mark@klomp.org> 119 120 * size.c (show_sysv): Call INTERNAL_ERROR if gelf_getshdr 121 returns NULL. 122 (show_sysv_one_line): Call error with EXIT_FAILURE if 123 gelf_getshdr returns NULL. 124 1252019-04-28 Mark Wielaard <mark@klomp.org> 126 127 * nm.c (show_symbols_sysv): Check gelf_getshdr doesn't return 128 NULL. Simplify naming of invalid sections, don't use alloca. 129 1302019-04-28 Mark Wielaard <mark@klomp.org> 131 132 * elfcmp.c (main): Check shdr1 and shdr2 are not NULL. 133 1342019-04-03 Mark Wielaard <mark@klomp.org> 135 136 * readelf.c (attr_callback): Print DW_AT_data_member_location as 137 decimal offset, not hex number. 138 1392019-03-29 Mark Wielaard <mark@klomp.org> 140 141 * readelf.c (print_debug_macinfo_section): Check cus[0] is not the 142 sentinel. 143 1442019-03-27 Mark Wielaard <mark@klomp.org> 145 146 * strip.c (handle_elf): Assert that symbol section number exists. 147 1482019-01-24 Mark Wielaard <mark@klomp.org> 149 150 * strip.c (handle_elf): Fix check test for SHN_XINDEX symbol. 151 1522019-01-22 Mark Wielaard <mark@klomp.org> 153 154 * readelf.c (print_debug_line_section): Check we are not at end of 155 line data when reading parameters for unknown opcodes. 156 1572019-01-20 Mark Wielaard <mark@klomp.org> 158 159 * readelf.c (print_debug_line_section): Check terminating NUL byte 160 for dir and file tables. 161 1622019-01-16 Mark Wielaard <mark@klomp.org> 163 164 * readelf (handle_core_note): Pass desc to ebl_core_note. 165 1662018-11-10 Mark Wielaard <mark@klomp.org> 167 168 * elflint.c (check_program_header): Allow PT_GNU_EH_FRAME segment 169 to be matched against SHT_X86_64_UNWIND section. 170 1712018-11-09 Mark Wielaard <mark@klomp.org> 172 173 * strip.c (remove_debug_relocations): Check if section is gnu 174 compressed and decompress and recompress it. 175 1762018-11-12 Mark Wielaard <mark@klomp.org> 177 178 * elflint.c (check_note_data): Recognize NT_GNU_BUILD_ATTRIBUTE_OPEN 179 and NT_GNU_BUILD_ATTRIBUTE_OPEN. 180 * readelf.c (handle_notes_data): Handle 181 ELF_NOTE_GNU_BUILD_ATTRIBUTE_PREFIX. Pass nhdr.n_namesz to 182 ebl_object_note. 183 1842018-11-11 Mark Wielaard <mark@klomp.org> 185 186 * readelf.c (handle_notes_data): Pass n_descsz to 187 ebl_object_note_type_name. 188 * elflint.c (check_note_data): Recognize NT_VERSION, add owner 189 name to unknown note error. 190 1912018-10-20 Mark Wielaard <mark@klomp.org> 192 193 * readelf.c (process_elf_file): Use dwelf_elf_begin to open pure_elf. 194 1952018-10-26 Mark Wielaard <mark@klomp.org> 196 197 * strip.c (OPT_RELOC_DEBUG_ONLY): New define. 198 (options): Add reloc-debug-sections-only. 199 (reloc_debug_only): New static bool. 200 (main): Check reloc_debug_only is the only strip option used. 201 (parse_opt): Handle OPT_RELOC_DEBUG_ONLY. 202 (handle_debug_relocs): New function. 203 (handle_elf): Add local variables lastsec_offset and lastsec_size. 204 Handle reloc_debug_only. 205 2062018-10-24 Mark Wielaard <mark@klomp.org> 207 208 * strip.c (handle_elf): Extract code to update shdrstrndx into... 209 (update_shdrstrndx): ... this new function. 210 2112018-10-24 Mark Wielaard <mark@klomp.org> 212 213 * strip.c (handle_elf): Extract code into separate functions... 214 (secndx_name): ... new function. 215 (get_xndxdata): Likewise. 216 (remove_debug_relocations): Likewise. 217 2182018-10-24 Mark Wielaard <mark@klomp.org> 219 220 * strip.c (handle_elf): Always copy over phdrs if there are any 221 and check phnum instead of e_type to determine whether to move 222 allocated sections. 223 2242018-11-02 Mark Wielaard <mark@klomp.org> 225 226 * unstrip.c (copy_elf): Add ELF_CHECK to make sure gelf_getehdr () 227 doesn't return NULL. 228 2292018-10-18 Mark Wielaard <mark@klomp.org> 230 231 * elflint.c (check_note_data): Recognize NT_GNU_PROPERTY_TYPE_0. 232 (check_note): Use p_align to pass either ELF_T_NHDR or ELF_T_NHDR8 to 233 elf_getdata_rawchunk. 234 * readelf (handle_notes): Likewise. 235 2362018-10-24 Mark Wielaard <mark@klomp.org> 237 238 * addr2line.c (print_addrsym): Use elf_getshdrstrndx instead of 239 Ehdr field. 240 2412018-10-24 Mark Wielaard <mark@klomp.org> 242 243 * readelf.c (section_name): Remove ehdr argument, lookup shstrndx. 244 (print_debug_abbrev_section): Don't pass ehdr. 245 (print_debug_addr_section): Likewise. 246 (print_decoded_aranges_section): Likewise. 247 (print_debug_aranges_section): Likewise. 248 (print_debug_rnglists_section): Likewise. 249 (print_debug_ranges_section): Likewise. 250 (print_debug_units): Likewise. 251 (print_decoded_line_section): Likewise. 252 (print_debug_line_section): Likewise. 253 (print_debug_loclists_section): Likewise. 254 (print_debug_loc_section): Likewise. 255 (print_debug_macinfo_section): Likewise. 256 (print_debug_macro_section): Likewise. 257 (print_debug_pubnames_section): Likewise. 258 (print_debug_str_section): Liekwise. 259 (print_debug_str_offsets_section): Likewise. 260 (print_gdb_index_section): Likewise. 261 2622018-10-16 Mark Wielaard <mark@klomp.org> 263 264 * readelf.c (print_debug_frame_section): Make sure readp is never 265 greater than cieend. 266 2672018-10-19 Mark Wielaard <mark@klomp.org> 268 269 * dwfl_module_getdwarf.c (adjust_relocs): Check sh_entsize is not 270 zero. 271 (add_new_section_symbols): Likewise. 272 (copy_elided_sections): Likewise. 273 2742018-10-18 Mark Wielaard <mark@klomp.org> 275 276 * size.c (handle_ar): Only close elf if prefix was NULL. 277 2782018-10-18 Mark Wielaard <mark@klomp.org> 279 280 * arlib.c (arlib_add_symbols): Check that sh_entsize is not zero. 281 2822018-10-14 Mark Wielaard <mark@klomp.org> 283 284 * ar.c (do_oper_extract): Assume epoch if ar_date is bogus. 285 2862018-10-14 Mark Wielaard <mark@klomp.org> 287 288 * findtextrel.c (process_file): Check that sh_entsize is not zero. 289 2902018-10-13 Mark Wielaard <mark@klomp.org> 291 292 * readelf.c (print_debug_macro_section): Use elf_getdata. Print 293 decoded flag string. 294 2952018-10-19 Mark Wielaard <mark@klomp.org> 296 297 * unstrip.c (copy_elided_sections): Renumber group section indexes. 298 2992018-10-12 Mark Wielaard <mark@klomp.org> 300 301 * strip.c (handle_elf): Don't remove SHF_GROUP flag from sections. 302 Skip group section flag when renumbering section indexes. 303 * unstrip.c (struct section): Add sig field. 304 (compare_unalloc_sections): Take and use sig1 and sig2 as arguments. 305 (compare_sections): Pass signatures to compare_unalloc_sections. 306 (get_group_sig): New function. 307 (find_alloc_sections_prelink): Set signature. 308 (copy_elided_sections): Likewise and pass them on. 309 (find_unalloc_section): Take and pass signatures. 310 3112018-10-02 Andreas Schwab <schwab@suse.de> 312 313 * strip.c (handle_elf): Handle ADD/SUB relocation. 314 3152018-09-13 Mark Wielaard <mark@klomp.org> 316 317 * readelf.c (print_shdr): Get number of section with elf_getshdrnum. 318 (print_phdr): Likewise. 319 3202018-09-13 Mark Wielaard <mark@klomp.org> 321 322 * strip.c (handle_elf): Check against shstrndx, not e_shstrndx. 323 Explicitly set shdrstrndx for debug file. 324 * unstrip.c (copy_elf): Explicitly copy shstrndx. 325 (find_alloc_sections_prelink): Document shnum usage. 326 3272018-09-13 Mark Wielaard <mark@klomp.org> 328 329 * elflint.c (check_elf_header): Use shnum instead of e_shnum for all 330 checks. 331 (check_symtab): Use shstrndx instead of e_shstrndx to get section 332 names. 333 3342018-09-13 Mark Wielaard <mark@klomp.org> 335 336 * elfcmp.c (main): Get, check and shdrstrndx for section names. 337 3382018-09-12 Mark Wielaard <mark@klomp.org> 339 340 * elfcmp.c (main): Call ebl_section_strip_p without ehdr. 341 * strip.c (handle_elf): Likewise. 342 3432018-09-12 Mark Wielaard <mark@klomp.org> 344 345 * elflint.c (check_symtab): Call ebl_check_special_symbol without 346 ehdr. 347 3482018-07-30 Mark Wielaard <mark@klomp.org> 349 350 * strip.c (handle_elf): Track allocated/unallocated sections seen. Set 351 section offset of unallocated sections after handling all allocated 352 sections. 353 3542018-08-18 Mark Wielaard <mark@klomp.org> 355 356 * readelf.c (print_debug_aranges_section): Make sure there is enough 357 data to read the header segment size. 358 3592018-08-18 Mark Wielaard <mark@klomp.org> 360 361 * elflint.c (check_sysv_hash): Calculate needed size using unsigned 362 long long int to prevent overflow. 363 (check_sysv_hash64): Calculate maxwords used separately before 364 comparison to prevent overflow. 365 3662018-07-24 Mark Wielaard <mark@klomp.org> 367 368 * unstrip.c (compare_unalloc_sections): Also compare sh_size. 369 3702018-07-21 Mark Wielaard <mark@klomp.org> 371 372 * unstrip.c (adjust_all_relocs): Skip SHT_GROUP sections. 373 3742018-07-21 Mark Wielaard <mark@klomp.org> 375 376 * elfcompress.c (get_sections): New function. 377 (process_file): Check whether section needs to change. Don't rewrite 378 file if no section data needs changing. 379 (main): Update 'force' help text. 380 3812018-07-21 Mark Wielaard <mark@klomp.org> 382 383 * elfcompress.c (process_file): Swap fchmod and fchown calls. 384 3852018-07-04 Mark Wielaard <mark@klomp.org> 386 387 * readelf.c (print_debug_addr_section): Rename index var to uidx. 388 (attr_callback): Rename index var to word. 389 (print_debug_str_offsets_section): Rename index var to uidx. 390 3912018-07-04 Ross Burton <ross.burton@intel.com> 392 393 * addr2line.c: Remove error.h include. 394 * ar.c: Likewise. 395 * arlib.c: Likewise and add system.h include. 396 * arlib2.c: Likewise. 397 * elfcmp.c: Likewise. 398 * elfcompress.c: Likewise. 399 * elflint.c: Likewise. 400 * findtextrel.c: Likewise. 401 * nm.c: Likewise. 402 * objdump.c: Likewise. 403 * ranlib.c: Likewise. 404 * readelf.c: Likewise. 405 * stack.c: Likewise. 406 * strings.c: Likewise. 407 * strip.c: Likewise. 408 * unstrip.c: Likewise. 409 4102018-06-25 Mark Wielaard <mark@klomp.org> 411 412 * readelf.c (print_decoded_line_section): Use dwarf_next_lines 413 instead of dwarf_nextcu. 414 (print_debug_line_section): Don't explicitly lookup CU. 415 4162018-06-15 Mark Wielaard <mark@klomp.org> 417 418 * readelf.c (attr_callback): Only print block as expressions if it 419 isn't DW_FORM_data16. 420 4212018-06-12 Mark Wielaard <mark@klomp.org> 422 423 * readelf.c (print_form_data): Check we have 4, not 2, bytes 424 available for DW_FORM_block4. 425 4262018-06-12 Mark Wielaard <mark@klomp.org> 427 428 * readelf.c (print_form_data): Don't increase strreadp after use. 429 Do increase readp for DW_FORM_strx[1234]. 430 4312018-06-16 Mark Wielaard <mark@klomp.org> 432 433 * readelf.c (print_debug_loc_section): Make sure next_off doesn't 434 overflow d_buf. 435 4362018-06-13 Mark Wielaard <mark@klomp.org> 437 438 * readelf.c (die_type_sign_bytes): New function. 439 (attr_callback): Recognized DW_FORM_implicit_cost as signed. Use 440 die_type_sign_bytes to lookup the signedness and size of const 441 values. 442 4432018-06-11 Mark Wielaard <mark@klomp.org> 444 445 * readelf.c (print_form_data): Don't reuse readp and readendp when 446 reading str_offsets section. 447 4482018-06-10 Mark Wielaard <mark@klomp.org> 449 450 * readelf.c (print_form_data): Don't cast value to ptrdiff_t, cast 451 ptrdiff_t to size_t. 452 4532018-06-08 Mark Wielaard <mark@klomp.org> 454 455 * readelf.c (print_debug_rnglists_section): Calculate max_entries 456 instead of needed bytes to prevent overflowing. Always print 457 max_entries (but not more). 458 (print_debug_loclists_section): Likewise. 459 4602018-06-08 Mark Wielaard <mark@klomp.org> 461 462 * readelf.c (print_debug_line_section): Stop printing directories 463 and files when we are at the end of the unit data. 464 4652018-06-07 Mark Wielaard <mark@klomp.org> 466 467 * readelf.c (format_result): Removed. 468 (format_result_size): Removed. 469 (format_dwarf_addr): Renamed to... 470 (print_dwarf_addr): ...this. Simply call printf, don't setup buffer, 471 don't call sprintf. 472 (print_ops): Use print_dwarf_addr instead of format_dwarf_addr. 473 (print_debug_addr_section): Likewise. 474 (print_debug_aranges_section): Likewise. 475 (print_debug_rnglists_section): Likewise. 476 (print_debug_ranges_section): Likewise. 477 (print_debug_frame_section): Likewise. 478 (attr_callback): Likewise. 479 (print_decoded_line_section): Likewise. 480 (print_debug_line_section): Likewise. 481 (print_debug_loclists_section): Likewise. 482 (print_debug_loc_section): Likewise. 483 (print_gdb_index_section): Likewsie. 484 4852018-06-05 Mark Wielaard <mark@klomp.org> 486 487 * readelf.c (print_debug_addr_section): Set unit_length always to 488 (next_unitp - readp) in case we don't have a real header. 489 4902018-06-05 Mark Wielaard <mark@klomp.org> 491 492 * readelf.c (print_debug_loc_section): Set begin to idx when failing 493 to read the start address if DW_LLE_GNU_start_end_entry. 494 4952018-06-05 Mark Wielaard <mark@klomp.org> 496 497 * readelf.c (handle_sysv_hash): Don't leak lengths array when 498 detecting an invalid chain. 499 (handle_sysv_hash64): Likewise. 500 5012018-06-05 Mark Wielaard <mark@klomp.org> 502 503 * readelf.c (print_debug_macro_section): Extend vendor array by one 504 to include max DW_MACRO_hi_user opcode. 505 5062018-06-07 Mark Wielaard <mark@klomp.org> 507 508 * readelf.c (main): Lookup "no" for no_str. 509 (print_debug_abbrev_section): Use yes_str and no_str. 510 (print_form_data): Likewise. 511 5122018-06-04 Mark Wielaard <mark@klomp.org> 513 514 * readelf (format_result): New static char pointer. 515 (format_result_size): New static size_t. 516 (format_dwarf_addr): Calculate max string size, reuse format_result 517 if possible, otherwise realloc. Use sprintf on result, not asprintf. 518 (print_ops): Don't free format_dwarf_addr, make sure result is 519 printed before calling format_dwarf_addr again. 520 (print_debug_addr_section): Likewise. 521 (print_debug_aranges_section): Likewise. 522 (print_debug_rnglists_section): Likewise. 523 (print_debug_ranges_section): Likewise. 524 (print_debug_frame_section): Likewise. 525 (attr_callback): Likewise. 526 (print_decoded_line_section): Likewise. 527 (print_debug_line_section): Likewise. 528 (print_debug_loclists_section): Likewise. 529 (print_debug_loc_section): Likewise. 530 (print_gdb_index_section): Likewsie. 531 5322018-06-04 Mark Wielaard <mark@klomp.org> 533 534 * readelf.c (yes_str): New static char pointer. 535 (no_str): Likewise. 536 (main): Set yes_str and no_str using gettext. 537 (attr_callback): Use yes_str and no_str instead of calling gettext. 538 5392018-06-04 Mark Wielaard <mark@klomp.org> 540 541 * readelf.c (main): Call __fsetlocking (stdout, FSETLOCKING_BYCALLER). 542 5432018-05-31 Mark Wielaard <mark@klomp.org> 544 545 * readelf.c (print_debug_units): Print the dwo name and id when 546 unable to find a .dwo file. 547 5482018-05-31 Mark Wielaard <mark@klomp.org> 549 550 * readelf.c (enum section_e): Make section_types not an alias of 551 section_info. 552 (section_all): Add section_types. 553 (parse_opt): Add both section_info and section_types for "info" 554 and "info+". 555 (print_debug_units): Don't be silent for debug_types. 556 5572018-05-31 Mark Wielaard <mark@klomp.org> 558 559 * readelf.c (attr_callback): Only register section_loc when not 560 looking at a split dwarf from a skeleton. 561 5622018-05-30 Mark Wielaard <mark@klomp.org> 563 564 * readelf.c (print_debug_loc_section): Use correct listptr for 565 locview attribute. 566 5672018-05-31 Mark Wielaard <mark@klomp.org> 568 569 * readelf.c (print_debug_units): Check offset against -1 not ~0ul. 570 5712018-05-29 Mark Wielaard <mark@klomp.org> 572 573 * readelf.c (print_debug_loc_section): Handle GNU DebugFission list 574 entries. 575 5762018-05-29 Mark Wielaard <mark@klomp.org> 577 578 * readelf.c (print_debug): Record and reset section_info status in 579 implicit_debug_sections and print_debug_sections. 580 5812018-05-28 Mark Wielaard <mark@klomp.org> 582 583 * readelf.c (print_debug_units): Turn "Could not find split compile 584 unit" into an Warning instead of an error. 585 5862018-04-29 Mark Wielaard <mark@klomp.org> 587 588 * readelf.c (parse_opt): Request implicit section_info for "str". 589 (known_stroffbases): New static variable. 590 (attr_callbackattr_callback): Handle DW_AT_str_offets_base. 591 (print_debug_str_offsets_section): New function. 592 (print_debug): Handle .debug_str_offsets as section_str. Reset 593 known_stroffbases. 594 5952018-04-27 Mark Wielaard <mark@klomp.org> 596 597 * readelf.c (options): Add addr. 598 (enum section_e): Add section_addr. 599 (section_all): Add section_addr. 600 (parse_opt): Parse "addr". 601 (known_addrbases): New static variable. 602 (get_listptr): New function. 603 (print_debug_addr_section): Likewise. 604 (attr_callback): Handle DW_AT_addr_base and DW_AT_GNU_addr_base. 605 (print_debug): Add NEW_SECTION (addr). Reset known_addrbases. 606 6072018-04-07 Mark Wielaard <mark@klomp.org> 608 609 * readelf.c (attr_callback): Handle DW_FORM_loclistx and 610 DW_AT_segment. 611 6122018-04-12 Mark Wielaard <mark@klomp.org> 613 614 * readelf.c (dwarf_loc_list_encoding_string): New functions. 615 (dwarf_loc_list_encoding_name): Likewise. 616 (known_loclistptr): Renamed and split in two... 617 (known_locsptr): this and ... 618 (known_loclistsptr): this. 619 (listptr_base): Split out... 620 (cudie_base): ...this. 621 (is_split_dwarf): New function. 622 (attr_callback): Handle DW_AT_loclists_base and notice sec_offset 623 in correct list. 624 (print_debug_rnglists_section): Use spit_dwarf_cu_base. 625 (print_debug_loclists_section): New function. 626 (print_debug_loc_section): Use known_locsptr instead of 627 known_loclistptr. 628 (print_debug): Recognize .debug_loclists. Reset known_locsptr and 629 known_loclistsptr. 630 6312018-05-25 Mark Wielaard <mark@klomp.org> 632 633 * readelf.c (DWARF_SKELETON): New constant. 634 (do_not_close_dwfl): New bool. 635 (options): Add dwarf-skeleton. 636 (dwarf_skeleton): New static variable. 637 (parse_opt): Handle DWARF_SKELETON, set dwarf_skeleton. 638 (create_dwfl): New function, with code extracted from... 639 (process_file): ...here. Check do_not_close_dwfl. 640 (is_split_darf): New function. 641 (getone_dwflmod): Likewise. 642 (print_debug): Use new functions to find skeleton DWARF file to use 643 when inspecting .dwo split DWARF file. 644 6452018-04-11 Mark Wielaard <mark@klomp.org> 646 647 * readelf.c (dwarf_range_list_encoding_string): New function. 648 (dwarf_range_list_encoding_name): Likewise. 649 (known_rnglistptr): New static variable. 650 (listptr_cu): New function. 651 (print_debug_rnglists_section): Likewise. 652 (attr_callback): Call notice_listptr for DW_AT_ranges. Handle 653 DW_AT_rnglists_base. Handle DW_FORM_rnglistx. DW_AT_start_scope 654 can also have a rnglist. 655 (print_debug_units): Do (silently) scan split DWARF also for 656 debug_ranges before DWARF5 to catch all rangelistptrs. 657 (print_debug): Recognize .debug_rnglists. Reset known_rnglistptr. 658 6592018-01-21 Mark Wielaard <mark@klomp.org> 660 661 * readelf.c (get_indexed_addr): New function. 662 (print_ops): Handle DW_OP_addrx, DW_OP_GNU_addr_index, 663 DW_OP_constx, DW_OP_GNU_const_index separately and resolve 664 address. 665 (attr_callback): Print index and address for 666 DW_FORM_GNU_addr_index and DW_FORM_addrx[1234]. 667 6682018-01-19 Mark Wielaard <mark@klomp.org> 669 670 * readelf.c (options): Add info+. 671 (show_split_units): New static boolean defaulting to false. 672 (parse_opt): For all (no arg) --debug-dump set show_split_units 673 to yes. For "info+" enable section_info and show_split_units. 674 (attrcb_args): Add is_split field. 675 (attr_callback): Use is_split to format DIE offsets differently. 676 (print_debug_units): Likewise. Get subdie (type or split) only 677 when needed. When not silent reiterate over split DIEs when 678 found. 679 6802018-05-15 Mark Wielaard <mark@klomp.org> 681 682 * readelf.c (print_debug_units): Print unit type and id for any 683 unit type that has it even when version < 5. 684 6852018-05-14 Mark Wielaard <mark@klomp.org> 686 687 * readelf.c (print_ops): Handle DW_OP_GNU_addr_index and 688 DW_OP_GNU_const_index. 689 (attr_callback): Handle DW_FORM_GNU_addr_index as DW_FORM_addrx. 690 Handle DW_FORM_GNU_str_index as DW_FORM_constx. Add as_hex_id. 691 Handle DW_AT_GNU_dwo_id as_hex_id. 692 (print_form_data): Handle DW_FORM_GNU_str_index as DW_FORM_strx. 693 6942018-05-12 Mark Wielaard <mark@klomp.org> 695 696 * readelf.c (print_debug): Also recognize .dwo section name variants. 697 6982018-05-15 Dmitry V. Levin <ldv@altlinux.org> 699 700 * elflint.c (check_elf_header): Fix typo in error diagnostics. 701 7022018-05-15 Mark Wielaard <mark@klomp.org> 703 704 * readelf.c (print_form_data): Cast comparisons against offset_len to 705 ptrdiff_t. 706 (print_debug_line_section): Print uint64_t as PRIu64. 707 7082018-05-11 Mark Wielaard <mark@klomp.org> 709 710 * readelf.c (print_debug_macro_section): Use libdw_valid_user_form. 711 Use print_form_data for strx and sup strings. 712 7132018-05-09 Mark Wielaard <mark@klomp.org> 714 715 * readelf.c (dwarf_line_content_description_string): New function. 716 (dwarf_line_content_description_name): Likewise. 717 (print_bytes): Likewise. 718 (print_form_data): Likewise. Based on code taken from... 719 (print_debug_macro_section): ...here. Now calls print_form_data 720 and str_offsets_base_off. 721 (print_debug_line_section): Parse DWARF5 header, directory and file 722 name tables. 723 7242018-05-12 Mark Wielaard <mark@klomp.org> 725 726 * addr2line.c (main): Add fflush (stdout) after handle_address () 727 when reading from stdin. 728 7292018-04-24 Mark Wielaard <mark@klomp.org> 730 731 * readelf.c (print_debug_aranges_section): Try elf_rawdata if no 732 sectiondata. 733 (print_debug_ranges_section): Likewise. 734 (print_debug_frame_section): Likewise. 735 (print_debug_line_section): Likewise. Check for data == NULL. 736 (print_debug_loc_section): Likewise. 737 (print_debug_macinfo_section): Likewise. 738 (print_debug_macro_section): Likewise. 739 7402018-04-28 Mark Wielaard <mark@klomp.org> 741 742 * readelf.c (print_debug): If .debug_info is needed implicitly by 743 then handle it first before handling any other debug section. 744 (parse_opt): Set implicit_debug_sections to section_info when 745 showing all debug sections. 746 7472018-05-05 Mark Wielaard <mark@klomp.org> 748 749 * readelf.c (attr_callback): Handle DW_FORM_ref_sup4 and 750 DW_FORM_ref_sup8 as references. 751 7522018-04-24 Mark Wielaard <mark@klomp.org> 753 754 * readelf.c (print_debug_str_section): Take raw section data. Don't 755 use dwarf_getstring, but determine start and end of string from 756 offset and section data directly. 757 (print_debug): Handle ".debug_line_str" like ".debug_str". 758 7592018-04-19 Andreas Schwab <schwab@suse.de> 760 761 * elflint.c (valid_e_machine): Add EM_RISCV. 762 7632018-04-16 Mark Wielaard <mark@klomp.org> 764 765 * readelf.c (print_debug_line_section). In advance_pc, advance 766 using op_addr_advance, not op_advance. 767 7682018-04-14 Mark Wielaard <mark@klomp.org> 769 770 * readelf.c (attr_callback): Only show errors when not silent. 771 7722018-03-23 Mark Wielaard <mark@klomp.org> 773 774 * readelf.c (attr_callback): Handle DW_FORM_strx[1234]. 775 7762018-03-22 Mark Wielaard <mark@klomp.org> 777 778 * readelf.c (attr_callback): Handle DW_FORM_addrx[1234]. 779 7802018-03-28 Mark Wielaard <mark@klomp.org> 781 782 * readelf.c (handle_sysv_hash): Break bucket chain after nchain 783 entries are found. 784 (handle_sysv_hash64): Likewise. 785 7862018-03-27 Mark Wielaard <mark@klomp.org> 787 788 * readelf.c (attr_callback): Print dwarf_dieoffset as %PRIx64, 789 not %zx. 790 7912018-03-20 Mark Wielaard <mark@klomp.org> 792 793 * readelf.c (attr_callback): Report error when DW_AT_decl_file or 794 DW_AT_call_file cannot be resolved. 795 7962018-03-06 Mark Wielaard <mark@klomp.org> 797 798 * readelf.c (print_ops): Handle DW_OP_addrx, DW_OP_constx, 799 DW_OP_implicit_pointer, DW_OP_entry_value, DW_OP_const_type, 800 DW_OP_regval_type, DW_OP_deref_type, DW_OP_xderef_type, 801 DW_OP_convert, DW_OP_reinterpret. 802 8032018-03-01 Mark Wielaard <mark@klomp.org> 804 805 * readelf.c (struct listptr): Add attr field. 806 (compare_listptr): Warn when two listptrs for the same offset have 807 different attributes. 808 (notice_listptr): Take attr as argument and add it to listptr. 809 (skip_listptr_hole): New attr argument. 810 (next_listptr_offset): New function. 811 (print_debug_ranges_section): Pass NULL attr to skip_listptr_hole. 812 (attr_callback): Handle DW_AT_GNU_locviews. Call notice_listptr with 813 attr. 814 (print_debug_loc_section): Keep track of which attr is associated with 815 a listptr. If the attr is DW_AT_GNU_locview print view pairs till the 816 next listptr offset. 817 8182018-02-09 Mark Wielaard <mark@klomp.org> 819 820 * elflint.c (check_group): Make sure we can read a complete 821 element when iterating over the group. 822 8232018-02-09 Mark Wielaard <mark@klomp.org> 824 825 * readelf.c (attr_callback): Handle DW_FORM_data16 as Dwarf_Block. 826 8272018-02-09 Mark Wielaard <mark@klomp.org> 828 829 * readelf.c (print_debug_abbrev_section): Print the value of a 830 DW_FORM_implicit_const using dwarf_getabbrevattr_data. 831 (attr_callback): Handle DW_FORM_implicit_const. 832 8332018-01-30 Mark Wielaard <mark@klomp.org> 834 835 * readelf.c (dwarf_unit_string): New function. 836 (dwarf_unit_name): Likewise. 837 (print_debug_units): Use dwarf_get_units and dwarf_cu_die instead 838 of dwarf_next_unit. Print unit type, id and subdie if available. 839 8402018-02-09 Joshua Watt <JPEWhacker@gmail.com> 841 842 * addr2line.c (handle_address): Use FALLTHROUGH macro instead of 843 comment. 844 * elfcompress.c (parse_opt): Likewise. 845 * elflint.c (check_dynamic): Likewise. 846 (check_sections): Likewise. 847 (check_note_data): Likewise. 848 * objdump.c (parse_opt): Likewise. 849 * readelf.c (parse_opt): Likewise. 850 (attr_callback): Likewise. 851 (handle_auxv_note): Likewise. 852 * strings.c (parse_opt): Likewise. 853 * backtrace.c (callback_verify): Likewise. 854 8552018-01-25 Mark Wielaard <mark@klomp.org> 856 857 * readelf.c (print_debug_ranges_section): Initialize cu to last_cu. 858 (print_debug_loc_section): Likewise. 859 8602018-01-01 Mark Wielaard <mark@klomp.org> 861 862 * readelf.c (attr_callback): Use dwarf_form_name for unknown forms. 863 (print_debug_macro_section): Print form using dwarf_form_name. 864 8652017-12-28 Mark Wielaard <mark@klomp.org> 866 867 * readelf.c (print_debug_units): Print DIE offset in error message 868 as hex. 869 8702017-12-18 Mark Wielaard <mark@klomp.org> 871 872 * readelf.c (handle_notes_data): Don't use EXIT_FAILURE in error. 873 Adjust error message depending on whether or not we got data. 874 8752017-12-07 Mark Wielaard <mark@klomp.org> 876 877 * readelf.c (print_ops): Update data pointer and print arguments 878 to DW_OP_call2 and DW_OP_call4 as DIE offsets. 879 8802017-11-29 Mark Wielaard <mark@klomp.org> 881 882 * readelf.c (argp_options): Add "section-groups", 'g'. 883 8842017-11-29 Mark Wielaard <mark@klomp.org> 885 886 * readelf.c (print_debug_loc_section): Print CU base and unresolved 887 addresses. Adjust formatting. 888 8892017-11-29 Mark Wielaard <mark@klomp.org> 890 891 * readelf.c (print_debug_ranges_section): Print CU base and unresolved 892 addresses. Adjust formatting. 893 8942017-11-29 Mark Wielaard <mark@klomp.org> 895 896 * readelf.c (attr_callback): Set valuestr to resolved file name 897 for DW_AT_decl_file and DW_AT_call_file. 898 8992017-11-29 Mark Wielaard <mark@klomp.org> 900 901 * readelf.c (print_debug_units): Print abbrev code after DIE tag. 902 9032017-11-29 Mark Wielaard <mark@klomp.org> 904 905 * readelf.c (print_ops): Use only2 space for index. re-indent +5 906 for DW_OP_GNU_entry_value. 907 9082017-11-21 Mark Wielaard <mark@klomp.org> 909 910 * readelf.c (attr_callback): Print attribute name and form in error 911 message. If only the value cannot be retrieved/resolved don't abort. 912 9132017-10-03 Mark Wielaard <mark@klomp.org> 914 915 * readelf.c (attr_callback): Print DIE offset in error messages. 916 9172017-11-03 Mark Wielaard <mark@klomp.org> 918 919 * readelf.c (print_ops): Handle DW_OP_GNU_variable_value. Print 920 referenced DIE as offset. 921 9222017-09-10 Mark Wielaard <mark@klomp.org> 923 924 * ar.c (do_oper_delete): Remove DEBUG conditional check. 925 (no0print): Return bool. Check snprintf return value. 926 (do_oper_insert): Initialize elf. Remove DEBUG conditional check. 927 Check no0print calls succeed. Explicitly elf_end found elfs. 928 (do_oper_extract): Make sure we don't create an empty variable 929 length array. 930 9312017-09-01 Mark Wielaard <mark@klomp.org> 932 933 * stack.c (main): Replace \v in doc string with \n\n. 934 * unstrip.c (main): Likewise. 935 9362017-05-04 Ulf Hermann <ulf.hermann@qt.io> 937 938 * stack.c: Print pid_t using %lld. 939 9402017-08-18 Ulf Hermann <ulf.hermann@qt.io> 941 942 * readelf.c: Hardcode the signal numbers for non-linux systems. 943 9442017-07-26 Mark Wielaard <mark@klomp.org> 945 946 * readelf.c (print_debug_macro_section): Accept either version 4 or 947 version 5. Use DW_MACRO names instead of DW_MACRO_GNU names. Add 948 minimal support for DW_MACRO_define_sup, DW_MACRO_undef_sup, 949 DW_MACRO_import_sup, DW_MACRO_define_strx and DW_MACRO_undef_strx. 950 9512017-07-26 Mark Wielaard <mark@klomp.org> 952 953 * readelf.c (dwarf_defaulted_string): New function. 954 (dwarf_defaulted_name): Likewise. 955 (attr_callback): Use dwarf_defaulted_name to get value of 956 DW_AT_defaulted. 957 9582017-07-20 Mark Wielaard <mark@klomp.org> 959 960 * strip.c (handle_elf): Deal with data marker symbols pointing to 961 debug sections (they can be removed). 962 9632017-07-14 Mark Wielaard <mark@klomp.org> 964 965 * strip (OPT_KEEP_SECTION): New define. 966 (options): Add documentation for remove-section. Add keep-section. 967 (struct section_pattern): New data type. 968 (keep_secs, remove_secs): New globals. 969 (add_pattern, free_sec_patterns, free_patterns, section_name_matches): 970 New functions. 971 (main): Call free_patterns. 972 (parse_opt): Handle 'R' and OPT_KEEP_SECTION. Check remove_comment 973 on ARGP_KEY_SUCCESS. 974 (handle_elf): Handle and sanity check keep_secs and remove_secs. 975 9762017-06-07 Mark Wielaard <mark@klomp.org> 977 978 * strip.c (handle_elf): Introduce new handle_elf boolean. Use it to 979 determine whether to create an output and/or debug file. Remove new 980 output file on error. 981 9822017-06-06 Mark Wielaard <mark@klomp.org> 983 984 * strip.c (handle_elf): Assume e_shstrndx section can be removed. 985 9862017-04-20 Ulf Hermann <ulf.hermann@qt.io> 987 988 * readelf.c: Include strings.h. 989 9902017-04-20 Ulf Hermann <ulf.hermann@qt.io> 991 992 * unstrip.c: Check shnum for 0 before subtracting from it. 993 9942017-04-20 Ulf Hermann <ulf.hermann@qt.io> 995 996 * readelf.c: Replace YESSTR and NOSTR with gettext ("yes") and 997 gettext ("no"), respectively. 998 9992017-04-05 Mark Wielaard <mark@klomp.org> 1000 1001 * elflint.c (check_elf_header): Decompress all sections. 1002 10032017-03-28 Mark Wielaard <mark@klomp.org> 1004 1005 * elflint (check_group): Don't check if there is no flag word. 1006 10072017-03-27 Mark Wielaard <mark@klomp.org> 1008 1009 * elflint.c (check_elf_header): Sanity check phnum and shnum. 1010 10112017-03-27 Mark Wielaard <mark@klomp.org> 1012 1013 * elflint.c (check_sysv_hash): Return early if section size is 1014 too small. 1015 (check_sysv_hash64): Likewise. 1016 (check_hash): Calculate expect_entsize to check section size. 1017 10182017-03-27 Mark Wielaard <mark@klomp.org> 1019 1020 * elflint.c (check_symtab_shndx): Check data->d_size. 1021 10222017-03-24 Mark Wielaard <mjw@redhat.com> 1023 1024 * elfcmp.c (main): If n_namesz == 0 then the note name data is the 1025 empty string. 1026 * readelf.c (handle_notes_data): Likewise. 1027 10282017-03-24 Mark Wielaard <mjw@redhat.com> 1029 1030 * readelf.c (handle_gnu_hash): Check inner < max_nsyms before 1031 indexing into chain array. 1032 10332017-02-16 Ulf Hermann <ulf.hermann@qt.io> 1034 1035 * addr2line.c: Include printversion.h 1036 * ar.c: Likewise. 1037 * elflint.c: Likewise. 1038 * nm.c: Likewise. 1039 * objdump.c: Likewise. 1040 * ranlib.c: Likewise. 1041 * readelf.c: Likewise. 1042 * size.c: Likewise. 1043 * stack.c: Likewise. 1044 * strings.c: Likewise. 1045 * strip.c: Likewise. 1046 * elfcmp.c: Include printversion.h, remove system.h include. 1047 * elfcompress.c: Likewise. 1048 * findtextrel.c: Likewise. 1049 * unstrip.c: Likewise. 1050 10512017-02-14 Ulf Hermann <ulf.hermann@qt.io> 1052 1053 * nm.c: Include color.h. 1054 * objdump.c: Likewise. 1055 10562016-12-24 Mark Wielaard <mark@klomp.org> 1057 1058 * Makefile.am (findtextrel_LDADD): Add $(libeu). 1059 (addr2line_LDADD): Likewise. 1060 (elfcmp_LDADD): Likewise. 1061 * addr2line.c (print_version): Removed. 1062 * ar.c (print_version): Likewise. 1063 * elfcmp.c (print_version): Likewise. 1064 * elfcompress.c (print_version): Likewise. 1065 * elflint.c (print_version): Likewise. 1066 * findtextrel.c (print_version): Likewise. 1067 * nm.c (print_version): Likewise. 1068 * objdump.c: Likewise. 1069 * ranlib.c: Likewise. 1070 * readelf.c: Likewise. 1071 * size.c: Likewise. 1072 * stack.c: Likewise. 1073 * strings.c: Likewise. 1074 * strip.c: Likewise. 1075 * unstrip.c: Likewise. 1076 10772016-11-17 Mark Wielaard <mjw@redhat.com> 1078 1079 * readelf.c (options): Add optional arg SECTION for symbols. 1080 (symbol_table_section): New static variable. 1081 (parse_opt): Set symbol_table_section on 's'. 1082 (print_symtab): Filter on symbol_table_section name is set. 1083 10842016-11-10 Mark Wielaard <mjw@redhat.com> 1085 1086 * ar.c (write_member): Make sure tmpbuf is large enough to contain 1087 a starting '/' and ending '\0' char. 1088 (do_oper_insert): Likewise. 1089 * arlib.c (arlib_finalize): Format tmpbuf as PRId32 decimal. 1090 10912016-11-02 Mark Wielaard <mjw@redhat.com> 1092 1093 * addr2line.c (handle_address): Add fallthrough comment. 1094 * elfcompress.c (parse_opt): Adjust fallthrough comment. 1095 * elflint.c (parse_opt): Add missing break after 'd' case. 1096 (check_sections): Add fallthrough comments. 1097 * objdump.c (parse_opt): Add explantion for fallthrough comment. 1098 10992016-10-22 Kevin Cernekee <cernekee@chromium.org> 1100 1101 * unstrip.c: Fix "invalid string offset" error caused by using the 1102 unstripped .symtab with the stripped .strtab. 1103 11042016-10-11 Akihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp> 1105 1106 * arlib.c: Remove system.h include, add libeu.h include. 1107 * arlib2.c: Remove sys/param.h include. 1108 * elfcompress.c: Add libeu.h include. 1109 * elflint.c: Remove sys/param.h include, add libeu.h include. 1110 * nm.c: Likewise. 1111 * objdump.c: Likewise. 1112 * ranlib.c: Likewise. 1113 * readelf.c: Likewise. 1114 * size.c: Remove sys/param.h include. 1115 * strings.c: Likewise, add libeu.h include. 1116 * strip.c: Likewise. 1117 * unstrip.c: Likewise. 1118 11192016-10-06 Mark Wielaard <mjw@redhat.com> 1120 1121 * strip.c (handle_elf): Don't remove real symbols from allocated 1122 symbol tables. 1123 11242016-08-25 Mark Wielaard <mjw@redhat.com> 1125 1126 * strip.c (handle_elf): Recompress with ELF_CHF_FORCE. 1127 11282016-08-06 Mark Wielaard <mjw@redhat.com> 1129 1130 * strip.c (handle_elf): Uncompress and recompress relocation target 1131 section if necessary. 1132 11332016-07-08 Mark Wielaard <mjw@redhat.com> 1134 1135 * Makefile.am (strip_LDADD): Add libdw. 1136 * elfcompress.c (process_file): Use dwelf_strtab functions instead of 1137 ebl_strtab. 1138 * strip.c (handle_elf): Likewise. 1139 * unstrip.c (new_shstrtab): Likewise. 1140 11412016-07-06 Mark Wielaard <mjw@redhat.com> 1142 1143 * elf32-i386.script, i386_ld.c, ld.c, ld.h, ldgeneric.c, ldlex.l, 1144 ldscript.y, libld_elf_i386.map, none_ld.c, sectionhash.c, 1145 sectionhash.h, symbolhash.c, symbolhash.h, unaligned.h, 1146 versionhash.c, versionhash.h, xelf.h: Removed. 1147 * Makefile.am (YACC): Removed. 1148 (AM_YFLAGS): Removed. 1149 (AM_LFLAGS): Removed. 1150 (native_ld): Removed. 1151 (base_cpu): Removed. 1152 (bin_PROGRAMS): Removed ld. 1153 (ld_dsos): Removed. 1154 (ld_SOURCES): Removed. 1155 (noinst_LIBRARIES): Only libar.a. 1156 (EXTRA_DIST): Just arlib.h and debugpred.h. 1157 (ld_LDADD): Removed. 1158 (ld_LDFLAGS): Removed. 1159 (ldlex.o): Removed. 1160 (ldscript.h): Removed. 1161 (libld*): Removed. 1162 (CLEANFILES): Just *.gconv. 1163 (MAINTAINERCLEANFILES): Removed. 1164 11652016-07-06 Mark Wielaard <mjw@redhat.com> 1166 1167 * unstrip.c (copy_elided_sections): Use unstripped_strent[] from 1168 index zero, instead of one. 1169 11702016-06-28 Richard Henderson <rth@redhat.com> 1171 1172 * elflint.c (valid_e_machine): Add EM_BPF. 1173 11742016-04-11 David Abdurachmanov <davidlt@cern.ch> 1175 1176 * elfcmp.c (main): Fix self-comparison error with GCC 6. 1177 11782016-03-21 Mark Wielaard <mjw@redhat.com> 1179 1180 * nm.c (show_symbols): Check for malloc size argument overflow. 1181 11822016-02-13 Mark Wielaard <mjw@redhat.com> 1183 1184 * readelf.c (print_scngrp): Call error when gelf_getshdr fails. 1185 (print_symtab): Likewise. 1186 (handle_hash): Likewise. 1187 (dump_data_section): Print a warning if decompressing fails. 1188 (print_string_section): Likewise. 1189 11902016-02-13 Mark Wielaard <mjw@redhat.com> 1191 1192 * elfcompress.c (parse_opt): Don't fallthrough after processing -q. 1193 11942016-02-12 Mark Wielaard <mjw@redhat.com> 1195 1196 * strip.c (handle_elf): Correct elf_assert shndxdata check. 1197 11982016-02-09 Mark Wielaard <mjw@redhat.com> 1199 1200 * readelf.c (read_encoded): Move up. 1201 (print_cfa_program): Add encoding argument. Use it for read_encoded 1202 when reading DW_CFA_set_loc op. 1203 (print_debug_frame_section): Pass fde_encoding to print_cfa_program. 1204 12052016-02-09 Mark Wielaard <mjw@redhat.com> 1206 1207 * elflint.c (compare_hash_gnu_hash): Check hash sh_entsize against 1208 sizeof (Elf64_Xword). Correct invalid sh_entsize error message 1209 section idx and name. 1210 12112016-01-13 Mark Wielaard <mjw@redhat.com> 1212 1213 * elflint.c (check_elf_header): Recognize ELFOSABI_FREEBSD. 1214 12152016-01-08 Mark Wielaard <mjw@redhat.com> 1216 1217 * elfcompress.c (compress_section): Use %zu to print size_t. 1218 * readelf.c (print_shdr): Use %zx to print size_t. 1219 12202015-12-16 Mark Wielaard <mjw@redhat.com> 1221 1222 * elfcompress.c: New file. 1223 * Makefile.am (bin_PROGRAMS): Add elfcompress. 1224 (elfcompress_LDADD): New variable. 1225 12262015-12-18 Mark Wielaard <mjw@redhat.com> 1227 1228 * elflint.c (section_flags_string): Add NEWFLAG COMPRESSED. 1229 (check_sections): SHF_COMPRESSED can be on any special section. 1230 SHF_COMPRESSED is a valid section flag. SHF_COMPRESSED cannot 1231 be used together with SHF_ALLOC or with SHT_NOBITS. Should have 1232 a valid Chdr. 1233 12342015-10-20 Mark Wielaard <mjw@redhat.com> 1235 1236 * readelf.c (options): Expand -z help text. 1237 (dump_data_section): Check whether we need and can decompress section 1238 data and call elf_rawzdata if so, 1239 (print_string_section): Likewise. 1240 (elf_contains_chdrs): New function. 1241 (process_elf_file): Rename print_unrelocated to print_unchanged, 1242 use elf_contains_chdrs. 1243 (print_scngrp): Check whether section is compressed before use. 1244 (print_symtab): Likewise. 1245 (handle_hash): Likewise. 1246 12472015-10-16 Mark Wielaard <mjw@redhat.com> 1248 1249 * readelf.c (argp_option): Describe --decompress,-z. 1250 (print_decompress): New bool. 1251 (parse_opt): Handle -z. 1252 (elf_ch_type_name): New function. 1253 (print_shdr): Print section compress information. 1254 12552015-12-31 Mark Wielaard <mjw@redhat.com> 1256 1257 * elflint.c (check_symtab): Add _edata and _end (plus extra underscore 1258 variants) to to the list of possibly dangling symbols. 1259 12602015-12-02 Mark Wielaard <mjw@redhat.com> 1261 1262 * nm.c (process_file): Accept fd and pass it on. 1263 (handle_elf): Likewise. 1264 (find_no_debuginfo): New. 1265 (struct getdbg): Likewise. 1266 (getdbg_dwflmod): Likewise. 1267 (show_symbols): Take fd. If the file is ET_REL use libdwfl to get 1268 the relocated Dwarf. 1269 12702015-12-02 Mark Wielaard <mjw@redhat.com> 1271 1272 * nm.c (get_local_names): Check for duplicates in local_root tree. 1273 12742015-12-02 Mark Wielaard <mjw@redhat.com> 1275 1276 * unstrip.c (struct data_list): New. 1277 (new_data_list): Likewise. 1278 (record_new_data): Likewise. 1279 (free_new_data): Likewise. 1280 (adjust_relocs): Call record_new_data. 1281 (add_new_section_symbols): Likewise. 1282 (copy_elided_sections): Call free_new_data. 1283 12842015-12-01 Mark Wielaard <mjw@redhat.com> 1285 1286 * elfcmp.c (main): Close ebl1 and ebl2 backends. 1287 12882015-10-16 Mark Wielaard <mjw@redhat.com> 1289 1290 * Makefile.am [BUILD_STATIC](libdw): Add -lz. 1291 [BUILD_STATIC](libelf): Likewise. 1292 12932015-10-16 Mark Wielaard <mjw@redhat.com> 1294 1295 * elflint.c (check_symtab): Don't check TLS symbol value against TLS 1296 phdr offset in debuginfo files. 1297 (check_sections): Don't try to match section offsets to phdrs offsets 1298 in debuginfo files. 1299 13002015-10-16 Mark Wielaard <mjw@redhat.com> 1301 1302 * elflint.c (check_reloc_shdr): Reject only desthdrs if they have both 1303 SHF_MERGE and SHF_STRINGS set. 1304 13052015-10-13 Jose E. Marchesi <jose.marchesi@oracle.com> 1306 1307 * elflint.c (check_sections): Do not rely on 1308 ebl_check_special_section when checking debuginfo files. Also 1309 check that the type of WE sections in debuginfo files is NOBITS. 1310 13112015-10-13 Mark Wielaard <mjw@redhat.com> 1312 1313 * elflint.c (check_program_header): Check relro flags are a subset 1314 of the load segment if they don't fully overlap. 1315 13162015-10-07 Mark Wielaard <mjw@redhat.com> 1317 1318 * Makefile.am (ldlex_no_Wstack_usage): New. 1319 * ldlex.l ([RWX]): Make cnt unsigned. 1320 13212015-10-09 Josh Stone <jistone@redhat.com> 1322 1323 * elflint.c (main): Replace stat64 and fstat64 with stat and fstat. 1324 * readelf.c (process_file): Likewise. 1325 (process_elf_file): Replace off64_t with off_t. 1326 * findtextrel.c (process_file): Replace open64 with open. 1327 * ld.c (main): Replace sizeof (off64_t) with 8. 1328 * strings.c: Replace off64_t with off_t throughout. 1329 (main): Replace stat64 and fstat64 with stat and fstat. 1330 (map_file): Replace mmap64 with mmap. 1331 (read_block): Likewise, and replace lseek64 with lseek. 1332 * strip.c (handle_elf): Replace ftruncate64 with ftruncate. 1333 (process_file): Replace stat64 and fstat64 with stat and fstat. 1334 * unstrip.c (parse_opt): Replace stat64 with stat. 1335 (handle_file): Replace open64 with open. 1336 (open_file): Likewise. 1337 13382015-10-08 Chih-Hung Hsieh <chh@google.com> 1339 1340 * ld.c (determine_output_format): Move recursive nested 1341 function "try" to file scope. 1342 13432015-10-04 Mark Wielaard <mjw@redhat.com> 1344 1345 * strip.c (handle_elf): Only sanity check section symbols to not 1346 kept discarded sections if we are creating a debug file. 1347 13482015-10-07 Mark Wielaard <mjw@redhat.com> 1349 1350 * unstrip.c (MAX): Removed. 1351 (find_alloc_sections_prelink): Allocate exact amount of bytes for 1352 shdrs. 1353 13542015-10-05 Chih-Hung Hsieh <chh@google.com> 1355 1356 * unstrip.c (find_alloc_sections_prelink): Do not allocate 1357 on stack union types with variable length arrays; use xmalloc 1358 for such dynamic sized objects. 1359 * readelf.c (handle_core_item): Likewise, but use alloca 1360 for small variable size data object and add assert(count < 128). 1361 13622015-10-05 Josh Stone <jistone@redhat.com> 1363 1364 * Makefile.am (libld_elf_i386.so): Add AM_V_CCLD silencer. 1365 (.deps/none_ld.Po): Always silence the dummy command. 1366 (make-debug-archive): Add AM_V_GEN and AM_V_at silencers. 1367 13682015-10-02 Mark Wielaard <mjw@redhat.com> 1369 1370 * unstrip.c (copy_elided_sections): Use SH_INFO_LINK_P, not just 1371 SHF_INFO_LINK. 1372 13732015-10-02 Mark Wielaard <mjw@redhat.com> 1374 1375 * strip.c (handle_elf): Don't move around allocated NOBITS sections. 1376 Don't just mark the section header string table as unused. 1377 * unstrip.c (copy_elided_sections): Add header names to strtab if 1378 shstrndx equals the symtab strtabndx. 1379 13802015-09-22 Mark Wielaard <mjw@redhat.com> 1381 1382 * strip.c (cleanup_debug): Remove old-style function definitions. 1383 13842015-09-09 Chih-Hung Hsieh <chh@google.com> 1385 1386 * readelf.c (print_debug_exception_table): Initialize variable before 1387 it is used, because compiler does not know that error never returns. 1388 (dump_arhive_index): Likewise. 1389 13902015-09-04 Chih-Hung Hsieh <chh@google.com> 1391 1392 * elflint.c (check_group): Replace %Z length modifier with %z. 1393 (check_note_data): Likewise. 1394 * findtextrel.c (process_file): Likewise. 1395 * readelf.c (handle_dynamic): Likewise. 1396 (handle_symtab): Likewise. 1397 (handle_verneed): Likewise. 1398 (handle_verdef): Likewise. 1399 (handle_versym): Likewise. 1400 (print_hash_info): Likewise. 1401 (print_decoded_aranges_section): Likewise. 1402 (print_debug_aranges_section): Likewise. 1403 (print_debug_line_section): Likewise. 1404 (hex_dump): Likewise. 1405 (dump_data_section): Likewise. 1406 (print_string_section): Likewise. 1407 (dump_archive_index): Likewise. 1408 * unstrip.c (adjust_relocs): Likewise. 1409 (collect_symbols): likewise. 1410 (get_section_name): Likewise. 1411 (find_alloc_sections_prelink): Likewise. 1412 (copy_elided_sections): Likewise. 1413 * ldscript.y (add_id_list): Add missing '%s'. 1414 14152015-09-03 Mark Wielaard <mjw@redhat.com> 1416 1417 * readelf.c (handle_core_item): Handle right shift >= 32 bits. 1418 14192015-08-11 Mark Wielaard <mjw@redhat.com> 1420 1421 * elflint.c (check_sections): When gnuld and a NOBITS section falls 1422 inside a segment make sure any ELF file contents is zero. 1423 14242015-07-29 Mark Wielaard <mjw@redhat.com> 1425 1426 * unstrip.c (sections_flags_match): New function. 1427 (sections_match): Use sections_flags_match. 1428 (find_alloc_sections_prelink): Only clear matched sections if there 1429 is an undo section. 1430 (copy_elided_sections): Add SHF_INFO_LINK to shdr_mem.sh_flags if 1431 necessary. 1432 14332015-06-27 Pino Toscano <toscano.pino@tiscali.it> 1434 1435 * src/strings.c: Define MAP_POPULATE if not defined already. 1436 14372015-06-27 Mark Wielaard <mjw@redhat.com> 1438 1439 * nm.c (show_symbols): First call elf_getdata, then allocate memory. 1440 14412015-06-18 Mark Wielaard <mjw@redhat.com> 1442 1443 * findtextrel.c (process_file): Free segments after use. 1444 14452015-06-18 Mark Wielaard <mjw@redhat.com> 1446 1447 * readelf.c (print_phdr): Make sure phdr2_mem lifetime/scope equals 1448 phdr2 pointer. 1449 14502015-06-18 Mark Wielaard <mjw@redhat.com> 1451 1452 * readelf.c (handle_gnu_hash): Free lengths on invalid_data. 1453 14542015-06-18 Mark Wielaard <mjw@redhat.com> 1455 1456 * elflint.c (check_symtab): Only check the PT_TLS phdr if it actually 1457 exists. Warn otherwise. 1458 14592015-06-18 Mark Wielaard <mjw@redhat.com> 1460 1461 * nm.c (show_symbols): Check sizeof (sym_mem[0]), not GElf_Sym to 1462 known whether or not we stack allocated memory. 1463 14642015-06-18 Mark Wielaard <mjw@redhat.com> 1465 1466 * strings.c (readelf): Use "<unknown>" if we cannot retrieve section 1467 name. 1468 14692015-06-09 Mark Wielaard <mjw@redhat.com> 1470 1471 * addr2line.c (print_dwarf_function): Always free scopes before 1472 returning. 1473 14742015-06-09 Mark Wielaard <mjw@redhat.com> 1475 1476 * strip.c (handle_ar): Mark as unused. 1477 (process_file): Produce an error when trying to handle an ar. 1478 14792015-05-30 Mark Wielaard <mjw@redhat.com> 1480 1481 * elfcmp.c (main): Only call memcmp when d_size != 0. 1482 14832015-05-23 Mark Wielaard <mjw@redhat.com> 1484 1485 * Makefile.am: Define ldgeneric, readelf, nm, size, strip, elflint, 1486 findtextrel, elfcmp objdump, ranlib, ar and unstrip no_Wstack_usage. 1487 14882015-05-21 Mark Wielaard <mjw@redhat.com> 1489 1490 * addr2line.c (handle_address): Set scopes to NULL after free. 1491 14922015-05-20 Mark Wielaard <mjw@redhat.com> 1493 1494 * addr2line.c (OPT_PRETTY): New constant define. 1495 (argp_option): Add "pretty-print". 1496 (pretty): New static bool. 1497 (parse_opt): Set pretty. 1498 (print_dwarf_function): Adjust output when pretty is set. 1499 (print_addrsym): Likewise. 1500 (handle_address): Likewise. 1501 15022015-05-20 Mark Wielaard <mjw@redhat.com> 1503 1504 * Makefile.am (addr2line_LDADD): Add demanglelib. 1505 * addr2line.c (argp_option): Move demangle under output format. 1506 (demangle): New static bool. 1507 (demangle_buffer_len): New static size_t. 1508 (demangle_buffer): New static char *. 1509 (main): free demangle_buffer. 1510 (parse_opt): Set demangle. 1511 (symname): New static function. 1512 (get_diename): Use symname. 1513 (print_dwarf_function): Likewise. 1514 (print_addrsym): Likewise. 1515 (handle_address): Likewise. 1516 15172015-05-20 Mark Wielaard <mjw@redhat.com> 1518 1519 * addr2line.c (argp_option): Add "addresses", 'a'. 1520 (print_addresses): New static bool. 1521 (parse_opt): Set print_addresses. 1522 (get_addr_width): New static function. 1523 (handle_address): Print address if print_addresses is true. 1524 15252015-05-20 Mark Wielaard <mjw@redhat.com> 1526 1527 * addr2line.c (handle_address): Call strtoumax with base 16. Make 1528 sure all input has been processed. 1529 15302015-05-20 Mark Wielaard <mjw@redhat.com> 1531 1532 * addr2line (argp_option): Group 'section' under "Input format 1533 options". 1534 15352015-05-12 Mark Wielaard <mjw@redhat.com> 1536 1537 * strip.c (debug_fd): New static variable. 1538 (tmp_debug_fname): Likewise. 1539 (cleanup_debug): New function using the above to clean up temporary 1540 debug file. 1541 (INTERNAL_ERROR): Call cleanup_debug. 1542 (handle_elf): Use debug_fd and tmp_debug_fname statics and call 1543 cleanup_debug before any error. Use output_fname instead of fname in 1544 error messages when it exists (-o was given). SHT_NOBITS sections 1545 can also be moved freely even if SHF_ALLOC is set. Add various 1546 sanity checks. Use elf_assert instead of plain assert. 1547 15482015-05-08 Mark Wielaard <mjw@redhat.com> 1549 1550 * nm.c (show_symbols): Call gelf_fsize with EV_CURRENT. 1551 * strip.c (handle_elf): Likewise. 1552 15532015-05-06 Mark Wielaard <mjw@redhat.com> 1554 1555 * elflint.c (check_gnu_hash): Return early when 2nd hash function 1556 shift too big. Check there is enough data available. Make sure 1557 bitmask_words is not zero. 1558 (check_verdef): Use Elf64_Word for shdr->sh_info cnt. 1559 (check_verneed): Likewise. 1560 (check_attributes): Break when vendor name isn't terminated. 1561 Add overflow check for subsection_len. 1562 15632015-05-05 Mark Wielaard <mjw@redhat.com> 1564 1565 * nm.c (show_symbols): Handle dwarf_linesrc returning NULL. 1566 15672015-05-04 Max Filippov <jcmvbkbc@gmail.com> 1568 1569 * ar.c (do_oper_extract): Replace struct timeval with struct timespec 1570 and futimes with futimens. 1571 * strip.c (process_file): Replace struct timeval with struct timespec. 1572 (handle_elf, handle_ar): Replace struct timeval with struct timespec 1573 in prototype. Replace futimes with futimens. 1574 15752015-05-04 Max Filippov <jcmvbkbc@gmail.com> 1576 1577 * addr2line.c (main): Drop mtrace() call and #include <mcheck.h>. 1578 * ar.c: Likewise. 1579 * ld.c: Likewise. 1580 * nm.c: Likewise. 1581 * objdump.c: Likewise. 1582 * ranlib.c: Likewise. 1583 * size.c: Likewise. 1584 * strip.c: Likewise. 1585 * unstrip.c: Likewise. 1586 15872015-05-04 Anthony G. Basile <blueness@gentoo.org> 1588 1589 * Makefile.am (readelf_LDADD, nm_LDADD, size_LDADD, strip_LDADD) 1590 (ld_LDADD, elflint_LDADD, findtextrel_LDADD, addr2line_LDADD) 1591 (elfcmp_LDADD, objdump_LDADD, ranlib_LDADD, strings_LDADD) 1592 (ar_LDADD, unstrip_LDADD, stack_LDADD): Append $(argp_LDADD). 1593 15942015-03-22 Mark Wielaard <mjw@redhat.com> 1595 1596 * readelf.c (print_debug_frame_section): Cast start to Dwarf_Off 1597 before subtracting cie_id. And cast cie_offset to Dwarf_Off before 1598 comparison. 1599 16002015-03-22 Mark Wielaard <mjw@redhat.com> 1601 1602 * readelf.c (print_gdb_index_section): Check all offsets used 1603 against section d_size. 1604 16052015-03-17 Mark Wielaard <mjw@redhat.com> 1606 1607 * readelf.c (print_debug): Don't return, but always use dummy_dbg. 1608 16092015-03-17 Mark Wielaard <mjw@redhat.com> 1610 1611 * readelf.c (print_gdb_index_section): Add overflow checking for 1612 dataend checks. 1613 16142015-03-14 Mark Wielaard <mjw@redhat.com> 1615 1616 * nm.c (INTERNAL_ERROR): Remove __DATE__. 1617 * objdump.c (INTERNAL_ERROR): Likewise. 1618 * size.c (INTERNAL_ERROR): Likewise. 1619 * strip.c (INTERNAL_ERROR): Likewise. 1620 16212015-03-18 Petr Machata <pmachata@redhat.com> 1622 1623 * readelf.c (dwarf_tag_string, dwarf_attr_string) 1624 (dwarf_form_string, dwarf_lang_string, dwarf_inline_string) 1625 (dwarf_encoding_string, dwarf_access_string) 1626 (dwarf_visibility_string, dwarf_virtuality_string) 1627 (dwarf_identifier_case_string, dwarf_calling_convention_string) 1628 (dwarf_ordering_string, dwarf_discr_list_string) 1629 (dwarf_locexpr_opcode_string): Adjust uses of know-dwarf.h macros 1630 to match the API changes. 1631 16322015-03-09 Mark Wielaard <mjw@redhat.com> 1633 1634 * elflint.c (compare_hash_gnu_hash): Correct gnu_symbias usage. 1635 16362015-01-03 Mark Wielaard <mjw@redhat.com> 1637 1638 * elfcmp (main): Check section name is not NULL. Check sh_entsize 1639 is not zero for symbol tables. Check phdrs are not NULL. 1640 (search_for_copy_reloc): Check sh_entsize is not zero. 1641 16422014-12-30 Mark Wielaard <mjw@redhat.com> 1643 1644 * elflint.c (check_scn_group): Check d_buf and name are not NULL. 1645 (is_rel_dyn): Check d is not NULL. Check shdr->sh_entsize is not 1646 zero. 1647 (check_dynamic): Check strshdr is not NULL. Check d_tag is positive. 1648 (check_symtab_shndx): Check symshdr and data->d_buf are not NULL. 1649 Check shdr and symshdr sh_entsize are not zero. 1650 (check_gnu_hash): Make sure maskidx is smaller than bitmask_words. 1651 Check symshdr->sh_entsize is not zero. Check data->d_buf is not 1652 NULL. 1653 (compare_hash_gnu_hash): Check sections d_buf are not NULL. 1654 Check section data is large enough. Use gnu_symbias. 1655 (check_group): Check section val is valid. 1656 (has_copy_reloc): Check sh_entsize is not zero. 1657 (check_versym): Likewise. 1658 (unknown_dependency_p): Likewise. 1659 (check_verneed): Break on invalid ref or offset. Don't assert. 1660 Report error when next offset is zero, but more vers expected. 1661 (check_verdef): Likewise. 1662 (check_attributes): Make sure d_buf is not NULL. 1663 (check_note): Likewise. 1664 (check_note_section): Likewise. 1665 (check_program_header): Make sure section name is not NULL. 1666 16672014-12-26 Mark Wielaard <mjw@redhat.com> 1668 1669 * strings.c (read_elf): Produce error when section data falls outside 1670 file. 1671 16722014-12-26 Mark Wielaard <mjw@redhat.com> 1673 1674 * nm.c (show_symbols): Guard against divide by zero in error check. 1675 Add section index number in error message. 1676 16772014-12-26 Mark Wielaard <mjw@redhat.com> 1678 1679 * nm.c (handle_ar): Skip over /SYM64/ entries. 1680 16812014-12-26 Mark Wielaard <mjw@redhat.com> 1682 1683 * nm.c (handle_ar): Break on arsym with invalid offset. 1684 16852014-12-20 Mark Wielaard <mjw@redhat.com> 1686 1687 * readelf.c (print_debug_macinfo_section): Mark cus sentinel files 1688 as -1 non-existent. Check macoff against sentinel cus. 1689 16902014-12-20 Mark Wielaard <mjw@redhat.com> 1691 1692 * readelf.c (print_debug_exception_table): Add max_action overflow 1693 check. Check action_table_end before reading slib128. Check 1694 max_ar_filter underflow. 1695 16962014-12-18 Ulrich Drepper <drepper@gmail.com> 1697 1698 * Makefile.am: Suppress output of textrel_check command. 1699 17002014-12-17 Mark Wielaard <mjw@redhat.com> 1701 1702 * readelf.c (print_cfa_program): Add bounds check before each op that 1703 takes at least one argument. 1704 17052014-12-16 Mark Wielaard <mjw@redhat.com> 1706 1707 * readelf.c (print_decoded_line_section): Print dwarf_errmsg if 1708 dwarf_onesrcline or dwarf_linesrc fails. 1709 17102014-12-16 Mark Wielaard <mjw@redhat.com> 1711 1712 * readelf.c (print_debug_line_section): Correct overflow check for 1713 unit_length. 1714 (print_debug_aranges_section): Correct overflow check for length. 1715 17162014-12-15 Mark Wielaard <mjw@redhat.com> 1717 1718 * readelf.c (notice_listptr): Return false if offset doesn't fit 1719 in 61-bits. 1720 (attr_callback): Warn if loclist or rangelist offset doesn't fit. 1721 17222014-12-15 Mark Wielaard <mjw@redhat.com> 1723 1724 * readelf.c (print_ops): Don't assert when addr_size or ref_size 1725 is not 4 or 8, just report invalid data. 1726 17272014-12-15 Mark Wielaard <mjw@redhat.com> 1728 1729 * readelf.c (print_gdb_index_section): Add more bounds checks. 1730 17312014-12-15 Mark Wielaard <mjw@redhat.com> 1732 1733 * readelf.c (print_debug_line_section): Check there is enough room 1734 for DW_LNE_set_address argument. Make sure there is enough room 1735 for the the initial unit_length. 1736 17372014-12-14 Mark Wielaard <mjw@redhat.com> 1738 1739 * elflint.c (check_attributes): Call get_uleb128 with end pointer. 1740 * readelf.c (print_attributes): Likewise. 1741 (print_ops): Likewise and also for get_sleb128. 1742 (print_cfa_program): Likewise and add more readp bounds checks. 1743 (read_encoded): Likewise. 1744 (print_debug_frame_section): Likewise. 1745 (print_debug_line_section): Likewise. 1746 (print_debug_macinfo_section): Likewise. 1747 (print_debug_macro_section): Likewise. 1748 (print_debug_exception_table): Likewise. 1749 17502014-12-16 Mark Wielaard <mjw@redhat.com> 1751 1752 * elfcmp.c (compare_Elf32_Word): Make sure (unsigned) Elf32_Word 1753 difference doesn't wrap around before returning as int. 1754 17552014-12-11 Mark Wielaard <mjw@redhat.com> 1756 1757 * readelf.c (print_debug_exception_table): Check TType base offset 1758 and Action table are sane. 1759 17602014-12-11 Mark Wielaard <mjw@redhat.com> 1761 1762 * readelf.c (print_debug_frame_section): Check number of augmentation 1763 chars to print. 1764 17652014-12-09 Mark Wielaard <mjw@redhat.com> 1766 1767 * readelf.c (handle_file_note): Check count fits data section and 1768 doesn't overflow fptr. 1769 17702014-12-08 Mark Wielaard <mjw@redhat.com> 1771 1772 * readelf.c (print_debug_exception_table): Report invalid data if 1773 action table doesn't immediately follow call site table. 1774 17752014-12-10 Josh Stone <jistone@redhat.com> 1776 1777 * addr2line.c (get_diename): New, get linkage_name or name. 1778 * addr2line.c (print_dwarf_function): Use get_diename. 1779 * addr2line.c (handle_address): Likewise. 1780 * addr2line.c (print_diesym): Removed. 1781 17822014-12-10 Josh Stone <jistone@redhat.com> 1783 1784 * addr2line.c (handle_address): Find the proper inline parents. 1785 17862014-12-07 Mark Wielaard <mjw@redhat.com> 1787 1788 * readelf.c (print_debug_line_section): max_ops_per_instr cannot 1789 be zero. 1790 17912014-12-07 Mark Wielaard <mjw@redhat.com> 1792 1793 * readelf.c (print_ops): Handle zero ref_size for DW_OP_call_ref 1794 and DW_OP_GNU_implicit_pointer. 1795 17962014-12-04 Mark Wielaard <mjw@redhat.com> 1797 1798 * objdump.c (show_relocs_x): Make sure destshdr exists. 1799 (show_relocs_rel): Don't rely on shdr->sh_entsize, use gelf_fsize. 1800 (show_relocs_rela): Likewise. 1801 (show_relocs): Make sure destshdr, symshdr and symdata exists. 1802 18032014-11-30 Mark Wielaard <mjw@redhat.com> 1804 1805 * readelf.c (handle_sysv_hash64): Fix overflow check. 1806 18072014-11-28 Mark Wielaard <mjw@redhat.com> 1808 1809 * readelf.c (handle_relocs_rel): Don't reuse destshdr to store 1810 section header of a relocation against a STT_SECTION symbol. Use 1811 a new local variable secshdr. 1812 (handle_relocs_rela): Likewise. 1813 18142014-11-26 Mark Wielaard <mjw@redhat.com> 1815 1816 * readelf.c (print_debug_aranges_section): Cast Dwarf_Word length 1817 to ptrdiff_t for comparison. 1818 18192014-11-24 Mark Wielaard <mjw@redhat.com> 1820 1821 * readelf.c (print_debug_line_section): Check line_range is not zero 1822 before usage. 1823 18242014-11-23 Mark Wielaard <mjw@redhat.com> 1825 1826 * readelf.c (print_debug_aranges_section): Check length to catch 1827 nexthdr overflow. 1828 18292014-11-21 Mark Wielaard <mjw@redhat.com> 1830 1831 * readelf.c (print_attributes): Guard against empty section. 1832 Document attribute format. Break when vendor name isn't terminated. 1833 Add overflow check for subsection_len. Handle both gnu and non-gnu 1834 attribute tags. 1835 18362014-11-22 Mark Wielaard <mjw@redhat.com> 1837 1838 * elflint.c (check_sections): Call ebl_bss_plt_p without ehdr. 1839 * findtextrel.c (process_file): Use elf_getphdrnum. 1840 * readelf.c (process_elf_file): Remove redundant ehdr->e_phoff check. 1841 (print_phdr): Check phnum. 1842 * size.c (show_segments): Use elf_getphdrnum. 1843 * strip.c (handle_elf): Likewise. 1844 * unstrip.c (copy_elf): Likewise. 1845 (copy_elided_sections): Likewise. 1846 (handle_file): Likewise. 1847 18482014-11-18 Mark Wielaard <mjw@redhat.com> 1849 1850 * readelf.c (print_cfa_program): Fix sanity check of DW_FORM_block 1851 length. 1852 18532014-11-17 Mark Wielaard <mjw@redhat.com> 1854 1855 * readelf.c (handle_verneed): Check vna_next and vn_next exist. 1856 (handle_verdef): Check vda_next and vd_next exist. 1857 (handle_versym): Check vd_next, vna_next and vn_next exist. 1858 Check vername and filename are not NULL before use. 1859 18602014-11-17 Mark Wielaard <mjw@redhat.com> 1861 1862 * elfcmp.c (main): Check section names are NULL before use. 1863 * objdump.c (section_match): Likewise. 1864 * size.c (show_sysv): Likewise. 1865 18662014-11-17 Mark Wielaard <mjw@redhat.com> 1867 1868 * readelf.c (print_debug_frame_section): Warn if ptr_size is not 4 1869 or 8 instead of just calling print_cfa_program. 1870 18712014-11-16 Mark Wielaard <mjw@redhat.com> 1872 1873 * readelf (process_elf_file): Set phnum to zero if there aren't 1874 actually any pheaders. 1875 (print_phdr): Check there actually is a phdr. 1876 18772014-11-16 Mark Wielaard <mjw@redhat.com> 1878 1879 * readelf.c (print_cfa_program): Check block len before calling 1880 print_ops. 1881 18822014-11-14 Mark Wielaard <mjw@redhat.com> 1883 1884 * readelf.c (print_debug_frame_section): Sanity Check CIE 1885 unit_length and augmentationlen. 1886 18872014-11-14 Mark Wielaard <mjw@redhat.com> 1888 1889 * readelf.c (handle_versym): Check def == NULL before use. 1890 18912014-11-08 Mark Wielaard <mjw@redhat.com> 1892 1893 * readelf.c (handle_versym): Initialize vername and filename array 1894 elements. 1895 18962014-11-07 Mark Wielaard <mjw@redhat.com> 1897 1898 * readelf.c (handle_sysv_hash): Sanity check section contents. 1899 (handle_sysv_hash64): Likewise. 1900 (handle_gnu_hash): Likewise. 1901 19022014-09-14 Petr Machata <pmachata@redhat.com> 1903 1904 * readelf.c (handle_relocs_rela): Typo fix, test DESTSHDR properly. 1905 19062014-09-12 Petr Machata <pmachata@redhat.com> 1907 1908 * readelf.c (encoded_ptr_size): In the switch statement, change 1909 magic constants 3 and 4 to DW_EH_PE_* counterparts. Still accept 1910 0. Print diagnostic for anything else. 1911 19122014-08-25 Josh Stone <jistone@redhat.com> 1913 1914 * Makefile.am: Prevent premature @AR@ replacement in a sed expression. 1915 19162014-07-04 Menanteau Guy <menantea@linux.vnet.ibm.com> 1917 Mark Wielaard <mjw@redhat.com> 1918 1919 * elflint (check_symtab): Add ".TOC." to the list of possibly 1920 dangling symbols because of sourceware PR13621. 1921 19222014-06-14 Mark Wielaard <mjw@redhat.com> 1923 1924 * elflint (check_symtab): Use ebl_func_addr_mask on st_value. 1925 19262014-05-27 Mark Wielaard <mjw@redhat.com> 1927 1928 * readelf.c (print_debug): Skip section if name is NULL. 1929 19302014-05-26 Mark Wielaard <mjw@redhat.com> 1931 1932 * readelf.c (handle_relocs_rela): Print header like handle_relocs_rel 1933 does, when sh_info == 0. 1934 19352014-05-26 Mark Wielaard <mjw@redhat.com> 1936 1937 * unstrip.c (find_alloc_sections_prelink): Allow non-split .bss 1938 section when sh_size of the original and undo .bss section are equal. 1939 19402014-05-26 Mark Wielaard <mjw@redhat.com> 1941 1942 * unstrip.c (options): Add --force, -F. 1943 (struct arg_info): Add bool force. 1944 (parse_opt): Handle 'F', set force. 1945 (handle_explicit_files): Add force argument, add warn function, 1946 separate check ehdr field checks, use warn. 1947 (handle_dwfl_module): Add force argument, pass on to 1948 handle_explicit_files. 1949 (handle_output_dir_module): Add force argument, pass on to 1950 handle_dwfl_module. 1951 (handle_implicit_modules): Pass info->force to handle_dwfl_module and 1952 handle_output_dir_module. 1953 (main): Pass info.force to handle_explicit_files. 1954 19552014-05-19 Mark Wielaard <mjw@redhat.com> 1956 1957 * elflint.c (check_reloc_shdr): Check ebl_check_reloc_target_type. 1958 19592014-05-01 Mark Wielaard <mjw@redhat.com> 1960 1961 * readelf.c (find_no_debuginfo): Call dwfl_standard_find_debuginfo 1962 if looking for alternate debug file. 1963 19642014-04-11 Mark Wielaard <mjw@redhat.com> 1965 1966 * Makefile.am (AM_CPPFLAGS): Add -I libdwelf. 1967 19682014-04-22 Mark Wielaard <mjw@redhat.com> 1969 1970 * readelf.c (handle_core_item): Make sure variable length array 1971 contains at least enough space for terminating zero char. 1972 19732014-04-22 Mark Wielaard <mjw@redhat.com> 1974 1975 * readelf.c (print_gdb_index_section): Use unsigned int for 31 bits 1976 left shift. 1977 19782014-03-13 Mark Wielaard <mjw@redhat.com> 1979 1980 * Makefile.am: Remove no_mudflap.os. Remove libmudflap from all 1981 LDADD lines. 1982 * strings.c (process_chunk): Remove _MUDFLAP condition. 1983 19842014-04-09 Mark Wielaard <mjw@redhat.com> 1985 1986 * readelf.c (print_debug_aranges_section): Don't get the raw section 1987 data, use the possibly decompressed .[z]debug sectiondata. 1988 (print_debug_ranges_section): Likewise. 1989 (print_debug_frame_section): Likewise. 1990 (print_debug_line_section): Likewise. 1991 (print_debug_loc_section): Likewise. 1992 (print_debug_macinfo_section): Likewise. 1993 (print_debug_macro_section): Likewise. 1994 19952014-04-10 Mark Wielaard <mjw@redhat.com> 1996 1997 * readelf.c (buf_read_ulong): Pass actual long size to convert. 1998 19992014-03-05 Mark Wielaard <mjw@redhat.com> 2000 2001 * readelf.c (attr_callback): Print DW_FORM_sdata values as signed 2002 numbers. 2003 20042014-02-24 Mark Wielaard <mjw@redhat.com> 2005 2006 * readelf (print_phdr): Check there is a SHT_PROGBITS section at the 2007 offset given by p_offsets for a PT_INTERP segment before trying to 2008 display the interpreter string. 2009 20102014-02-07 Mark Wielaard <mjw@redhat.com> 2011 2012 * readelf.c (print_phdr): Check phdr->p_filesz and make sure 2013 interpreter string is zero terminated before calling printf. 2014 20152014-01-22 Mark Wielaard <mjw@redhat.com> 2016 2017 * Makefile.am (nm_no_Wformat): Removed. 2018 (size_no_Wformat): Likewise. 2019 (strings_no_Wformat): Likewise. 2020 (addr2line_no_Wformat): Likewise. 2021 * size.c (show_sysv): Use fmtstr directly as literal in printf. 2022 (show_sysv_one_line): Likewise. 2023 * strings.c (locfmt): Removed. 2024 (radix): New static enum. 2025 (parse_opt): Set radix, not locfmt. 2026 (process_chunk_mb): Use fmtstr directly as literal in printf based 2027 on radix. 2028 (process_chunk): Likewise. 2029 * nm.c (show_symbols_sysv): Use fmtstr directly as literal in printf. 2030 (show_symbols_bsd): Likewise. 2031 (show_symbols_posix): Likewise. 2032 20332014-01-21 Mark Wielaard <mjw@redhat.com> 2034 2035 * stack.c (show_inlines): New static boolean. 2036 (print_frame): New function split out from... 2037 (print_frames): ..here. If show_inlines is true and we found a 2038 DIE for the frame address, call print_inline_frames otherwise 2039 call print_frame. Keep track of and track frame_nr. 2040 (print_inline_frames): New function. 2041 (parse_opt): Handle '-i'. 2042 (main): Add 'i' to options. 2043 20442014-01-27 Mark Wielaard <mjw@redhat.com> 2045 2046 * stack.c (maxframes): Initialize to 256. 2047 (main): Document new default in options. Document magic number 2048 used in frames.allocated initialization. 2049 20502014-01-20 Mark Wielaard <mjw@redhat.com> 2051 2052 * stack.c (show_debugname): New static boolean. 2053 (die_name): New function. 2054 (print_frames): If show_debugname is true set symname to the 2055 first function-like DIE with a name in scope for the address in 2056 the debuginfo. 2057 (parse_opt): Handle '-d'. 2058 (main): Add 'd' to options. 2059 20602014-01-20 Mark Wielaard <mjw@redhat.com> 2061 2062 * addr2line.c (handle_address): Initialize scopes to NULL. 2063 20642014-01-17 Roland McGrath <roland@redhat.com> 2065 2066 * strip.c (handle_elf): Check for bogus values in sh_link, sh_info, 2067 st_shndx, e_shstrndx, and SHT_GROUP or SHT_SYMTAB_SHNDX data. 2068 Don't use assert on input values, instead bail with "illformed" error. 2069 20702014-01-17 Roland McGrath <roland@redhat.com> 2071 2072 * readelf.c (handle_dynamic, handle_symtab): Check for bogus sh_link. 2073 (handle_verneed, handle_verdef, handle_versym, handle_hash): Likewise. 2074 (handle_scngrp): Check for bogus sh_info. 2075 20762014-01-17 Jakub Jelinek <jakub@redhat.com> 2077 2078 * elflint.c (section_name): Return "<invalid>" instead of 2079 crashing on invalid section name. 2080 (check_symtab, is_rel_dyn, check_rela, check_rel, check_dynamic, 2081 check_symtab_shndx, check_hash, check_versym): Robustify. 2082 (check_hash): Don't check entries beyond end of section. 2083 (check_note): Don't crash if gelf_rawchunk fails. 2084 20852014-01-17 Petr Machata <pmachata@redhat.com> 2086 2087 * readelf.c (handle_dynamic, handle_relocs_rel) 2088 (handle_relocs_rela, handle_versym, print_liblist): 2089 Use gelf_fsize instead of relying on shdr->sh_entsize. 2090 20912014-01-14 Mark Wielaard <mjw@redhat.com> 2092 2093 * readelf.c (print_debug_macro_section): Clear vendor array before 2094 use. 2095 20962014-01-15 Jan Kratochvil <jan.kratochvil@redhat.com> 2097 2098 Fix corruption of non-C++ symbols by the demangler. 2099 * nm.c (show_symbols_sysv, show_symbols_bsd, show_symbols_posix) 2100 (show_symbols): Check for _Z. 2101 * stack.c (print_frames) <USE_DEMANGLE>: Check for _Z. 2102 21032014-01-02 Mark Wielaard <mjw@redhat.com> 2104 2105 * stack.c (show_raw): Declare unconditionally. 2106 (parse_opt): Handle '-r' unconditionally. 2107 (main): Show "raw" option even without USE_DEMANGLE. 2108 21092014-01-02 Mark Wielaard <mjw@redhat.com> 2110 2111 * stack.c (print_frames): Print 0x before build-id hex-offset. 2112 21132014-01-02 Mark Wielaard <mjw@redhat.com> 2114 2115 * stack.c (maxframes): Increase to 2048. 2116 (struct frames): Add allocated field. 2117 (frame_callback): If frames used is frames allocated, realloc. 2118 (print_frames): Show an error if maxframes has been reached. 2119 (parse_opt): Allow -n 0 for unlimited frames. 2120 (main): Document -n 0 and new default 2048 frames. Allocate initial 2121 number of frames with malloc. 2122 21232013-12-30 Mark Wielaard <mjw@redhat.com> 2124 2125 * stack.c (parse_opt): Explicitly call dwfl_linux_proc_attach 2126 or dwfl_core_file_attach and check for errors. 2127 21282013-12-28 Mark Wielaard <mjw@redhat.com> 2129 2130 * stack.c (print_frames): Remove address width code and use... 2131 (get_addr_width): ...this new function. 2132 (show_modules): New static boolean. 2133 (module_callback): New static function. 2134 (parse_opt): Handle '-l'. 2135 (main): Add 'l' to options. If show_modules then use dwfl_getmodules 2136 with module_callback to show all detected modules and possible 2137 build_id, elf and dwarf files. 2138 21392013-12-27 Mark Wielaard <mjw@redhat.com> 2140 2141 * stack.c (frames_shown): New static boolean. 2142 (EXIT_OK,EXIT_ERROR,EXIT_BAD,EXIT_USAGES): New defines. 2143 (frame_callback): Return -1 on error. Don't print error. 2144 (print_frames): Add arguments, tid, dwflerr and what. Print tid. 2145 If there was an error report it with address and module if possible. 2146 Record whether any frames were actually printed. 2147 (thread_callback): Collect tid and err, pass it to print_frames. 2148 (parse_opt): Use EXIT_BAD for errors. On ARGP_KEY_END print errno 2149 if dwfl_linux_proc_report returned it. Check whether we are properly 2150 attached with dwfl_pid. 2151 (main): Document exit status. Don't report DWARF_CB_ABORT from 2152 callbacks as error. Pass real errors to print_frames. Return 2153 EXIT_BAD if no frames could be shown. Return EXIT_ERROR if there 2154 were any non-fatal errors. 2155 21562013-12-23 Mark Wielaard <mjw@redhat.com> 2157 2158 * Makefile.am (stack_LDADD): Add demanglelib. 2159 * stack.c (show_quiet): New static boolean, default false. 2160 (show_raw): Likewise. 2161 (demangle_buffer_len): New static size_t. 2162 (demangle_buffer): New static char *. 2163 (print_frames): Don't resolve pc name if show_quiet. Demangle name 2164 unless show_raw. 2165 (parse_opt): Handle '-q' and '-r'. 2166 (main): Add 'q' and 'r' to options. Free demangle_buffer. 2167 21682013-12-23 Mark Wielaard <mjw@redhat.com> 2169 2170 * stack.c (OPT_DEBUGINFO): New define. 2171 (OPT_COREFILE): Likewise. 2172 (pid): New static. 2173 (core_fd): Likewise. 2174 (core): Likewise. 2175 (exec): Likewise. 2176 (debuginfo_path): Likewise. 2177 (parse_opt): Handle '-p', '--core', '-e' and '--debuginfo-path'. 2178 Do argument sanity checking. Setup Dwfl. 2179 (main): Add 'p', 'core', 'e' and 'debuginfo-path' to options. 2180 Remove argp_child children, simplify argp doc, remove custom 2181 usage message and construction of dwfl with dwfl_standard_argp. 2182 Use pid directly as tid. close core and core_fd if opened. Print 2183 pid of process or core. 2184 21852013-12-23 Mark Wielaard <mjw@redhat.com> 2186 2187 * stack.c (show_build_id): New static boolean. 2188 (print_frames): Print module build-id, load address and pc offset 2189 if show_build_id is true. 2190 (parse_opt): Handle '-b'. 2191 (main): Add -b to options. 2192 21932013-12-22 Mark Wielaard <mjw@redhat.com> 2194 2195 * stack.c (maxframes): New static unsigned. Initialize to 64. 2196 (struct frame): New struct. 2197 (struct frames): Likewise. 2198 (dwfl): New static Dwfl pointer. 2199 (frame_callback): Use arg as struct frames and fill it next frame. 2200 Return DWARF_CB_ABORT when maxframes has been reached. Move 2201 printing of frame to... 2202 (print_frames): ...here. New function. 2203 (thread_callback): Use arg as struct frames and set frames to zero. 2204 Call print_frames. 2205 (parse_opt): Handle '-n'. 2206 (main): Add -n to options. Allocate frames using maxframes. Pass 2207 frames to frame_callback and thread_callback. 2208 22092013-12-20 Mark Wielaard <mjw@redhat.com> 2210 2211 * stack.c (show_one_tid): New static boolean. 2212 (parse_opt): Handle '-1'. 2213 (main): Add -1 to options. Call dwfl_getthread_frames when 2214 show_one_tid is true. 2215 22162013-12-18 Mark Wielaard <mjw@redhat.com> 2217 2218 * addr2line.c (options): Add symbol-sections, 'x'. 2219 (show_symbol_sections): New static bool. 2220 (parse_opt): Handle 'x'. 2221 (print_addrsym): Use dwfl_module_addrinfo value.r 2222 Also show section of address with show_symbol_sections. 2223 (find_symbol): Use dwfl_module_getsym_info and set value. 2224 (handle_address): Request value and use it instead of sym.st_value. 2225 * readelf.c (format_dwarf_addr): Use dwfl_module_addrinfo to get 2226 name and offset. 2227 22282013-12-17 Masatake YAMATO <yamato@redhat.com> 2229 Mark Wielaard <mjw@redhat.com> 2230 2231 * stack.c (show_activation, show_module, show_source): New variables. 2232 (parse_opt): Set show_activation if -a option is given. 2233 Set show_module if -m option is given. Set show_source if -s option 2234 is given. Set all show booleans when -v option is given. 2235 (main): Added `-a', `-m', `-s', and `-v' to the help message. 2236 (frame_callback): Print module and source file information. 2237 22382013-11-25 Petr Machata <pmachata@redhat.com> 2239 2240 * elflint.c (valid_e_machine): Add EM_AARCH64. 2241 22422013-11-14 Petr Machata <pmachata@redhat.com> 2243 2244 * readelf.c (handle_core_item) <'h'>: New branch for handling 2245 fields that shouldn't be displayed. 2246 22472013-11-10 Mark Wielaard <mjw@redhat.com> 2248 2249 * stack.c: Use ARGP_PROGRAM_VERSION_HOOK_DEF and 2250 ARGP_PROGRAM_BUG_ADDRESS_DEF. 2251 (print_version): New function. 2252 22532013-11-09 Mark Wielaard <mjw@redhat.com> 2254 2255 * arlib.c (arlib_init): Call snprintf before using the result 2256 with memcpy. 2257 (arlib_finalize): Likewise. 2258 * nm.c (show_symbols_sysv): Don't modify cnt inside assert. 2259 22602013-11-07 Jan Kratochvil <jan.kratochvil@redhat.com> 2261 2262 * Makefile.am (bin_PROGRAMS): Add stack. 2263 (stack_LDADD): New. 2264 * stack.c: New file. 2265 22662013-11-05 Mark Wielaard <mjw@redhat.com> 2267 2268 * readelf.c (print_debug_ranges_section): Cast address to size_t 2269 before comparison. 2270 (print_debug_loc_section): Likewise. 2271 22722013-10-18 Mark Wielaard <mjw@redhat.com> 2273 2274 * ar.c (main): Correct operation check when instance_specifed is set. 2275 22762013-09-26 Petr Machata <pmachata@redhat.com> 2277 2278 * readelf.c (handle_file_note): New function. 2279 (handle_notes_data): Call it to handle NT_FILE notes. 2280 22812013-09-26 Petr Machata <pmachata@redhat.com> 2282 2283 * readelf.c (handle_siginfo_note): New function. 2284 (handle_notes_data): Call it to handle NT_SIGINFO notes. 2285 (buf_read_int, buf_read_ulong, buf_has_data): New functions. 2286 22872013-08-13 Mark Wielaard <mjw@redhat.com> 2288 2289 * addr2line.c (options): Add "inlines", 'i'. 2290 (show_inlines): New bool. 2291 (parse_opt): Handle 'i'. 2292 (print_diesym): New static function. 2293 (print_src): New function taking code from... 2294 (handle_address): here. Call print_src. Print inlines. 2295 22962013-08-12 Mark Wielaard <mjw@redhat.com> 2297 2298 * addr2line.c (main): If there is a newline char at end of buf, 2299 then remove it. 2300 23012013-07-05 Mark Wielaard <mjw@redhat.com> 2302 2303 * readelf.c (print_ops): Take CU as argument, use it to print 2304 parameter_ref DIE offset. 2305 (struct listptr): Replace base field with cu. 2306 (listptr_base): New function. 2307 (compare_listptr): Use listptr_base. 2308 (notice_listptr): Take CU as argument. 2309 (skip_listptr_hole): Likewise. 2310 (print_debug_ranges_section): Pass NULL as CU to skip_listptr_hole. 2311 (print_cfa_program): Pass NULL as CU to print_ops. 2312 (struct attrcb_args): Replace cu_base field with cu. 2313 (attr_callback): Pass cu not cu_base to notice_listptr. 2314 (print_debug_units): Don't calculate base, just set cu. 2315 (print_debug_loc_section): Pass cu to skip_listptr_hole and 2316 print_ops. 2317 23182013-05-06 Mark Wielaard <mjw@redhat.com> 2319 2320 * readelf.c (print_ops): Format first DW_OP_GNU_implicit_pointer 2321 argument as DIE offset. 2322 23232013-04-24 Mark Wielaard <mjw@redhat.com> 2324 2325 * Makefile.am: Use AM_CPPFLAGS instead of INCLUDES. 2326 23272013-03-25 Mark Wielaard <mjw@redhat.com> 2328 2329 * readelf.c (argp_options): Add decodedline. 2330 (decodedline): New boolean initialized to false. 2331 (parse_opt): Set decodedline when arg is decodedline. 2332 (print_decoded_line_section): New function. 2333 (print_debug_line_section): Call print_decoded_line_section when 2334 decodedline is true. 2335 23362013-03-25 Mark Wielaard <mjw@redhat.com> 2337 2338 * readelf.c (argp_option): Add decodedaranges. 2339 (decodedaranges): New boolean initialized to false. 2340 (parse_opt): Set decodedaranges when arg is decodedaranges. 2341 (print_debug_aranges_section): Reimplemented and original 2342 implementation renamed to... 2343 (print_decoded_aranges_section): this. 2344 23452013-03-25 Mark Wielaard <mjw@redhat.com> 2346 2347 * readelf.c (attrcb_args): Add Dwarf_Die. 2348 (attr_callback): When highpc is in constant form also print as 2349 address. 2350 (print_debug_units): Set args.die. 2351 23522013-03-19 Mark Wielaard <mjw@redhat.com> 2353 2354 * readelf.c (print_gdb_index_section): Free format_dwarf_addr results. 2355 23562013-03-18 Mark Wielaard <mjw@redhat.com> 2357 2358 * readelf.c (print_gdb_index_section): Accept version 8. 2359 23602013-03-01 Mark Wielaard <mjw@redhat.com> 2361 2362 * findtextrel.c (process_file): Release ELF and close file when not 2363 text relocations are found. 2364 * strip.c (handle_elf): Track memory used for .debuglink section data 2365 and free when done. 2366 23672013-02-24 Mark Wielaard <mjw@redhat.com> 2368 2369 * elflint.c (check_symtab): Add __bss_start__ to the list of symbols 2370 allowed to have out of section values because of GNU ld bugs. 2371 23722013-02-06 Mark Wielaard <mjw@redhat.com> 2373 2374 * elflint.c (check_symtab): Add __bss_start and __TMC_END__ to the 2375 list of symbols allowed to have out of section values because of 2376 GNU ld bugs in either .symtab or .dynsym, but only when they are 2377 zero sized. 2378 23792013-01-24 Mark Wielaard <mjw@redhat.com> 2380 2381 * readelf.c (argp_option): Add unresolved-address-offsets, U. 2382 (print_unresolved_addresses): New static. 2383 (parse_opt): Handle 'U', set print_unprocessed_values. 2384 (format_dwarf_addr): Take and handle new raw argument. 2385 (print_ops): Call format_dwarf_addr with raw offset values. 2386 (print_debug_ranges_section): Likewise. 2387 (print_debug_frame_section): Likewise. 2388 (attr_callback): Likewise. 2389 (print_debug_line_section): Likewise. 2390 (print_debug_loc_section): Likewise. 2391 (print_gdb_index_section): Likewise. 2392 23932013-01-18 Mark Wielaard <mjw@redhat.com> 2394 2395 * readelf.c (struct listptr): Add base Dwarf_Addr field. 2396 (compare_listptr): Warn for same offset with different base. 2397 (notice_listptr): Take base argument and set it. 2398 (skip_listptr_hole): Likewise. 2399 (struct attrcb_args): Removed unused cu_offset field. 2400 Add cu_base Dwarf_Addr field. 2401 (attr_callback): Call notice_listptr with cbargs->cu_base. 2402 (print_debug_units): Set args.cu_base. 2403 (print_debug_ranges_section): Get base and use for format_dwarf_addr. 2404 (print_debug_loc_section): Likewise. 2405 24062013-01-29 Jan Kratochvil <jan.kratochvil@redhat.com> 2407 2408 * readelf.c (handle_core_items): Limit special repeated items handling 2409 to single-item formats '\n', 'b' and 'B', assert OFFSET 0 there. 2410 24112012-12-18 Mark Wielaard <mark@bordewijk.wildebeest.org> 2412 2413 * readelf.c (ELF_INPUT_SECTION): New argp key value. 2414 (argp_option): Add elf-section. 2415 (elf_input_section): New static. 2416 (parse_opt): Handle ELF_INPUT_SECTION and set elf_input_section. 2417 (open_input_section): New function. 2418 (process_file): Call open_input_section if elf_input_section set. 2419 24202013-01-13 David Abdurachmanov <David.Abdurachmanov@cern.ch> 2421 2422 ar.c (do_oper_delete): Fix num passed to memset. 2423 24242012-12-21 Mark Wielaard <mjw@redhat.com> 2425 2426 * readelf.c (print_debug_frame_section): Adjust FDE start address 2427 if pcrel before feeding it to format_dwarf_addr. 2428 24292012-12-21 Mark Wielaard <mjw@redhat.com> 2430 2431 * addr2line.c (main): Call dwfl_end. 2432 24332012-12-11 Roland McGrath <roland@hack.frob.com> 2434 2435 * nm.c (show_symbols_sysv): Fix size passed to snprintf for invalid 2436 sh_name case. 2437 Reported by David Abdurachmanov <David.Abdurachmanov@cern.ch>. 2438 24392012-10-16 Mark Wielaard <mjw@redhat.com> 2440 2441 * readelf.c (print_ops): DW_OP_skip and DW_OP_bra targets are 2442 calculated beginning after the operand and 2-byte constant. 2443 24442012-10-12 Jan Kratochvil <jan.kratochvil@redhat.com> 2445 2446 * readelf.c (ITEM_WRAP_COLUMN, REGISTER_WRAP_COLUMN): Merge to ... 2447 (WRAP_COLUMN): ... here. 2448 (print_core_item): Remove parameter format_max. Update function 2449 comment. Replace FORMAT_MAX by the real output width. 2450 (handle_core_item): Remove the FORMAT_MAX values in TYPES, DO_TYPE, 2451 calls of print_core_item, remove variable maxfmt, change 2452 ITEM_WRAP_COLUMN to WRAP_COLUMN. 2453 (handle_core_register): Remove the FORMAT_MAX values in TYPES, BITS, 2454 calls of print_core_item, change REGISTER_WRAP_COLUMN to WRAP_COLUMN. 2455 24562012-10-11 Jan Kratochvil <jan.kratochvil@redhat.com> 2457 2458 * readelf.c (handle_core_item) <b>: Make run an outer block variable. 2459 Increase run only if LASTBIT != 0. Print last element only if RUN > 0. 2460 24612012-08-27 Mark Wielaard <mjw@redhat.com> 2462 2463 * readelf.c (print_debug_macro_section): Print offset as PRIx64. 2464 24652012-08-27 Mark Wielaard <mjw@redhat.com> 2466 2467 * readelf.c (register_info): Handle loc == NULL. 2468 24692012-08-22 Jeff Kenton <jkenton@tilera.com> 2470 2471 * elflint.c (valid_e_machine): Add EM_TILEGX and EM_TILEPRO. 2472 24732012-08-16 Mark Wielaard <mjw@redhat.com> 2474 2475 * readelf.c (dwarf_tag_name): Renamed from dwarf_tag_string. 2476 Uses new dwarf_tag_string or adds ??? or lo_user+%#x when 2477 appropriate. 2478 (dwarf_attr_name): Likewise. 2479 (dwarf_form_name): Likewise. 2480 (dwarf_lang_name): Likewise. 2481 (dwarf_inline_name): Likewise. 2482 (dwarf_encoding_name): Likewise. 2483 (dwarf_access_name): Likewise. 2484 (dwarf_visibility_name): Likewise. 2485 (dwarf_virtuality_name): Likewise. 2486 (dwarf_identifier_case_name): Likewise. 2487 (dwarf_calling_convention_name): Likewise. 2488 (dwarf_ordering_name): Likewise. 2489 (dwarf_discr_list_name): Likewise. 2490 (print_ops): Remove KNOWN. Use dwarf_locexpr_opcode_string. 2491 (attr_callback): Call new dwarf_foobar_name instead of old 2492 dwarf_foobar_string functions. 2493 (dwarf_tag_string): New function using known-dwarf.h macros. 2494 (dwarf_attr_string): Likewise. 2495 (dwarf_form_string): Likewise. 2496 (dwarf_lang_string): Likewise. 2497 (dwarf_inline_string): Likewise. 2498 (dwarf_encoding_string): Likewise. 2499 (dwarf_access_string): Likewise. 2500 (dwarf_visibility_string): Likewise. 2501 (dwarf_virtuality_string): Likewise. 2502 (dwarf_identifier_case_string): Likewise. 2503 (dwarf_calling_convention_string): Likewise. 2504 (dwarf_ordering_string): Likewise. 2505 (dwarf_discr_list_string): Likewise. 2506 (dwarf_locexpr_opcode_string): Likewise. 2507 25082012-06-27 Mark Wielaard <mjw@redhat.com> 2509 2510 * readelf.c (dwarf_form_string): Handle DW_FORM_GNU_ref_alt and 2511 DW_FORM_GNU_strp_alt. 2512 (attr_callback): Likewise. 2513 25142012-07-30 Petr Machata <pmachata@redhat.com> 2515 2516 * nm.c (show_symbols_bsd): Reorder arguments in {S,}FMTSTRS (and 2517 corresponding printf) so that those that are referenced by only 2518 one of the formatting strings are at the end. 2519 25202012-07-29 Mark Wielaard <mjw@redhat.com> 2521 2522 * readelf.c (dwarf_lang_string): Use DW_LANG_ObjC, not DW_LANG_Objc. 2523 (print_ops): Use known[op], not op_name, for DW_OP_GNU_parameter_ref. 2524 25252012-07-19 Mark Wielaard <mjw@redhat.com> 2526 2527 * readelf.c (print_ops): Handle DW_OP_GNU_parameter_ref. 2528 25292012-07-11 Mark Wielaard <mjw@redhat.com> 2530 2531 * readelf.c (options): Add macro to help of debug-dump. 2532 (section_e): Add section_macro. 2533 (section_all): Add section_macro. 2534 (parse_opt): Handle macro. 2535 (print_debug_macro_section): New function. 2536 (print_debug): Add NEW_SECTION (macro). 2537 25382012-07-10 Mark Wielaard <mjw@redhat.com> 2539 2540 * readelf.c (print_gdb_index_section): Add version 7 support. 2541 Keep track of cu_nr. Print kind and static/global flag for each 2542 symbol. When a symbol is in the TU list add 'T'. 2543 25442012-06-26 Mark Wielaard <mjw@redhat.com> 2545 2546 * readelf.c (dwarf_attr_string): Add DW_AT_GNU_macros. 2547 25482012-06-22 Mark Wielaard <mjw@redhat.com> 2549 2550 * readelf.c (print_ops): Cast printf PRIu/x64 arguments to uint64_t 2551 for gcc 4.7 -Wformat. 2552 25532012-05-09 Roland McGrath <roland@hack.frob.com> 2554 2555 * elflint (check_sections): Allow zero sized sections at (filesz) end 2556 of segment. And make check overflow-proofed. 2557 25582012-04-24 Mark Wielaard <mjw@redhat.com> 2559 2560 * readelf.c (print_ops): Add DW_OP_GNU_push_tls_address, 2561 DW_OP_GNU_uinit and DW_OP_GNU_encoded_addr. 2562 25632012-03-28 Roland McGrath <roland@hack.frob.com> 2564 2565 * elflint.c (special_sections): Accept SHF_INFO_LINK for reloc sections. 2566 25672012-03-28 Mark Wielaard <mjw@redhat.com> 2568 2569 * readelf.c (print_debug_abbrev_section): Check there is Dwarf 2570 section data. 2571 (print_debug_str_section): Likewise. 2572 25732012-03-21 Mark Wielaard <mjw@redhat.com> 2574 2575 * readelf.c (print_gdb_index_section): Accept version 6. 2576 25772012-01-31 Mark Wielaard <mjw@redhat.com> 2578 2579 * readelf.c (attr_callback): Don't special case DW_FORM_sec_offset. 2580 25812012-01-21 Ulrich Drepper <drepper@gmail.com> 2582 2583 * addr2line.c: Update copyright year. 2584 * ar.c: Likewise. 2585 * elfcmp.c: Likewise. 2586 * elflint.c: Likewise. 2587 * findtextrel.c: Likewise. 2588 * ld.c: Likewise. 2589 * nm.c: Likewise. 2590 * objdump.c: Likewise. 2591 * ranlib.c: Likewise. 2592 * readelf.c: Likewise. 2593 * size.c: Likewise. 2594 * strings.c: Likewise. 2595 * strip.c: Likewise. 2596 * unstrip.c: Likewise. 2597 2598 * nm.c (argp_children): Define. 2599 (argp): Hook up argp_children. 2600 (handle_ar): Optimize puts call. 2601 (show_symbols_bsd): Use positional parameters to also print color 2602 codes. Don't print STT_FILE symbols. 2603 * objdump.c (options): Improve help text. 2604 (argp_children): Define. 2605 (argp): Hook up argp_children. 2606 (disasm_info): Add elements for color codes. 2607 (disasm_output): Print color codes as well. 2608 (show_disasm): Set up disasm_info data for callback. 2609 26102012-01-20 Roland McGrath <roland@hack.frob.com> 2611 2612 * arlib-argp.c (arlib_deterministic_output): Initialize from 2613 configured value. 2614 (help_filter): New function. 2615 (argp): Use it. 2616 2617 * ar.c (main): Handle oper_none as usage error. 2618 2619 * arlib-argp.c (options, parse_opt): Grok -U as inverse of -D. 2620 2621 * ranlib.c (argp): Use arlib_argp_children. 2622 2623 * arlib.c (arlib_init): Obey arlib_deterministic_output. 2624 2625 * arlib-argp.c: New file. 2626 * Makefile.am (libar_a_SOURCES): Add it. 2627 * arlib.h (arlib_deterministic_output, arlib_argp_children): 2628 Declare new variables. 2629 * ar.c (deterministic_output): Variable removed. 2630 (do_oper_insert): Use arlib_deterministic_output instead. 2631 (options, parse_opt): Don't handle -D here. Add group numbers. 2632 (argp): Use arlib_argp_children. 2633 26342011-12-20 Roland McGrath <roland@hack.frob.com> 2635 2636 * readelf.c (print_debug): Initialize DUMMY_DBG.elf. 2637 Reported by Karel Klic <kklic@redhat.com>. 2638 26392011-11-05 Roland McGrath <roland@hack.frob.com> 2640 2641 * ar.c (deterministic_output): New flag variable. 2642 (options, parse_opt): Grok -D to set it. 2643 (do_oper_insert): When set, use zero from mtime, uid, and gid. 2644 2645 * ar.c (do_oper_insert): Fix check on elf_rawfile return value. 2646 26472011-10-04 Marek Polacek <mpolacek@redhat.com> 2648 2649 * readelf.c (register_info): Assume the right size of an array. 2650 26512011-10-03 Ulrich Drepper <drepper@gmail.com> 2652 2653 * nm.c: Recognize option --mark-special. Still recognize --mark-weak 2654 but don't show it in help anymore. 2655 (mark_special): Renamed from mark_weak. 2656 (parse_opt): Adjust. 2657 (class_type_char): Take additional parameters for ELF file and ELF 2658 header. Treat TLS symbols like objects. 2659 In case of D symbols, show u for unique symbols, R for symbols in 2660 read-only sections, B for symbols in BSS sections. 2661 (show_symbols_bsd): Take additional parameters for ELF file and ELF 2662 header. Adjust for class_type_char change. Show TLS symbols with 2663 @ after them in case --mark-special is selected. 2664 (show_symbols_posix): Likewise. 2665 (show_symbols): Adjust calls to show_symbols_bsd and 2666 show_symbols_posix. 2667 (show_symbols_sysv): Avoid printing adress and size for undefined 2668 symbols. Don't print initial special entry and section entries. 2669 26702011-10-02 Ulrich Drepper <drepper@gmail.com> 2671 2672 * Makefile.am (demanglelib): Define. 2673 (nm_LDADD): Add demanglelib. 2674 * nm.c (options): Add -C option. 2675 (demangle): Define as global variable. 2676 (parse_opt): Recognize -C. 2677 (show_symbols_sysv): Handle demangling. 2678 (show_symbols_bad): Likewise. 2679 (show_symbols_posix): Likewise. 2680 (show_symbols): Likewise. 2681 26822011-07-09 Roland McGrath <roland@hack.frob.com> 2683 2684 * readelf.c (options, parse_opt): Grok -W/--wide and ignore it. 2685 2686 * ar.c (parse_opt): Grok -u. 2687 26882011-05-30 Mark Wielaard <mjw@redhat.com> 2689 2690 * strip.c (relocate): Make offset check overflow-proof. 2691 26922011-05-23 Mark Wielaard <mjw@redhat.com> 2693 2694 * strip.c (relocate): Take new arguments is_rela to indicate 2695 whether the relocation is from a SHT_REL or SHT_RELA section. 2696 Relocate against any debug section symbol, not just STT_SECTION 2697 symbols. For SHT_REL relocations, fetch addend from offset and 2698 add it to symbol value if not zero. 2699 27002011-05-23 Mark Wielaard <mjw@redhat.com> 2701 2702 * strip.c (OPT_RELOC_DEBUG): New option. 2703 (argp_option): Add new --reloc-debug-sections option. 2704 (main): Check new option. 2705 (parse_opt): Likewise. 2706 (handle_elf): Remove any relocations between debug sections 2707 in ET_REL for the debug file when requested. 2708 27092011-05-18 Mark Wielaard <mjw@redhat.com> 2710 2711 * strip.c (handle_elf): Make sure all sections of a removed group 2712 section are removed too. Don't discard SHT_GROUP sections, copy 2713 section table before it gets modified. Section group signature 2714 symbols don't have to be retained. 2715 27162011-05-16 Jakub Jelinek <jakub@redhat.com> 2717 2718 * readelf.c (print_ops): Handle DW_OP_GNU_const_type, 2719 DW_OP_GNU_regval_type, DW_OP_GNU_deref_type, DW_OP_GNU_convert 2720 and DW_OP_GNU_reinterpret. 2721 27222011-05-17 Mark Wielaard <mjw@redhat.com> 2723 2724 * readelf.c (dwarf_tag_string): Fixup DW_TAG_GNU_call_site and 2725 DW_TAG_GNU_call_site_parameter return strings. 2726 27272011-05-11 Marek Polacek <mpolacek@redhat.com> 2728 2729 * nm.c (show_symbols_sysv): Remove unused if/else, remove 2730 unused `prefix' and `fname' parameters. 2731 27322011-05-07 Marek Polacek <mpolacek@redhat.com> 2733 2734 * unstrip.c (compare_sections_nonrel): Mark this function as static. 2735 27362011-04-26 Mark Wielaard <mjw@redhat.com> 2737 2738 * readelf.c (handle_notes_data): Call ebl_object_note_type_name 2739 with note name. 2740 27412011-04-14 Mark Wielaard <mjw@redhat.com> 2742 2743 * readelf.c (options): Add gdb_index. 2744 (section_e): Define section_gdb_index. 2745 (parse_opt): Recognize gdb_index debug-dump argument. 2746 (print_gdb_index_section): New function. 2747 (print_debug): Add gdb_index to debug_sections. 2748 27492011-03-24 Petr Machata <pmachata@redhat.com> 2750 2751 * readelf.c (print_debug_line_section): Emit initial space for all 2752 opcode lines. Print offset in front of each opcode. 2753 27542011-03-22 Marek Polacek <mpolacek@redhat.com> 2755 2756 * readelf.c (handle_dynamic): Don't segfault at DT_PLTREL case. 2757 27582011-03-22 Mark Wielaard <mjw@redhat.com> 2759 2760 * readelf.c (dwarf_tag_string): Support DW_TAG_GNU_call_site 2761 and DW_TAG_GNU_call_site_parameter. 2762 (dwarf_attr_string): Support DW_AT_GNU_call_site_value, 2763 DW_AT_GNU_call_site_data_value, 2764 DW_AT_GNU_call_site_target, 2765 DW_AT_GNU_call_site_target_clobbered, 2766 DW_AT_GNU_tail_call, 2767 DW_AT_GNU_all_tail_call_sites, 2768 DW_AT_GNU_all_call_sites, 2769 and DW_AT_GNU_all_source_call_sites. 2770 (print_ops): Handle DW_OP_GNU_entry_value. 2771 (attr_callback): Handle DW_AT_GNU_call_site_value, 2772 DW_AT_GNU_call_site_data_value, 2773 DW_AT_GNU_call_site_target, 2774 and DW_AT_GNU_call_site_target_clobbered. 2775 27762011-03-10 Mark Wielaard <mjw@redhat.com> 2777 2778 * elflint.c (check_symtab): Use ebl_check_st_other_bits. 2779 27802011-02-27 Jan Kratochvil <jan.kratochvil@redhat.com> 2781 2782 * readelf.c (reset_listptr): Clear TABLE->TABLE. 2783 27842011-02-25 Mark Wielaard <mjw@redhat.com> 2785 2786 * readelf.c (dwarf_attr_string): Add DW_AT_GNU_* handling. 2787 (dwarf_form_string): Properly format and return unknown form. 2788 27892011-02-23 Roland McGrath <roland@redhat.com> 2790 2791 * readelf.c (section_name): New function. 2792 (print_debug_abbrev_section): Use it instead of constant. 2793 (print_debug_aranges_section): Likewise. 2794 (print_debug_ranges_section): Likewise. 2795 (print_debug_units): Likewise. 2796 (print_debug_line_section): Likewise. 2797 (print_debug_loc_section): Likewise. 2798 (print_debug_macinfo_section): Likewise. 2799 (print_debug_pubnames_section): Likewise. 2800 (print_debug_str_section): Likewise. 2801 (print_debug) [USE_ZLIB]: Match .zdebug_* sections too. 2802 (print_debug_abbrev_section): Use decoded d_size, not sh_size. 2803 (print_debug_str_section): Likewise. 2804 2805 * readelf.c (dwarf_attr_string): Grok DW_AT_GNU_odr_signature. 2806 28072011-02-11 Roland McGrath <roland@redhat.com> 2808 2809 * elfcmp.c (verbose): New variable. 2810 (options, parse_opt): Grok -l/--verbose to set it. 2811 (main): Under -l, keep going after first difference. 2812 2813 * elfcmp.c (ignore_build_id): New variable. 2814 (options, parse_opt): Grok --ignore-build-id to set it. 2815 (main): For SHT_NOTE sections, compare note details rather than raw 2816 bytes. Under --ignore-build-id, don't complain about differing build 2817 ID contents if lengths match. 2818 28192011-02-08 Roland McGrath <roland@redhat.com> 2820 2821 * ldscript.y (filename_id_star): Remove unused variable. 2822 2823 * unstrip.c (copy_elided_sections): Remove unused variable. 2824 2825 * elflint.c (check_dynamic): Remove unused variables. 2826 2827 * elflint.c (check_symtab): Warn about missing xndx section only once. 2828 2829 * ldgeneric.c (check_for_duplicate2): Remove unused variable. 2830 28312011-01-06 Roland McGrath <roland@redhat.com> 2832 2833 * strip.c (handle_elf): Under --strip-sections, remove all 2834 non-allocated sections and never generate .gnu_debuglink. 2835 28362011-01-04 Roland McGrath <roland@redhat.com> 2837 2838 * strip.c (remove_shdrs): New variable. 2839 (options, parse_opt): Grok --strip-sections to set it. 2840 (handle_elf): When that's set, truncate off .shstrtab and shdrs. 2841 28422010-11-10 Roland McGrath <roland@redhat.com> 2843 2844 * findtextrel.c (process_file): Don't assume order of sections. 2845 Reported by Mike Hommey <mh@glandium.org>. 2846 28472010-07-26 Roland McGrath <roland@redhat.com> 2848 2849 * readelf.c (print_ops): Handle DW_OP_GNU_implicit_pointer. 2850 28512010-08-30 Roland McGrath <roland@redhat.com> 2852 2853 Print .debug_loc/.debug_ranges with cognizance of actual DIE uses. 2854 * readelf.c (parse_opt): Add section_info to implicit_debug_sections 2855 for ranges, loc. 2856 (struct listptr, struct listptr_table): New types. 2857 (compare_listptr, reset_listptr, sort_listptr): New functions. 2858 (notice_listptr, skip_listptr_hole): New functions. 2859 (struct attrcb_args): Add silent member. 2860 (attr_callback): Call notice_listptr for loclistptr and rangelistptr. 2861 Suppress output if silent, but still call notice_listptr. 2862 (print_debug_units): Suppress output if section_info not requested. 2863 (print_debug_loc_section): Call sort_listptr, skip_listptr_hole. 2864 (print_debug_ranges_section): Likewise. 2865 (print_debug): Call reset_listptr on both tables. 2866 2867 * readelf.c (print_debug_ranges_section): Print empty list. 2868 (print_debug_loc_section): Likewise. 2869 2870 * readelf.c (print_debug_loc_section): Check for bogus length 2871 before calling print_ops. 2872 (print_ops): Check harder for bogus data that would read off end. 2873 28742010-08-11 Roland McGrath <roland@redhat.com> 2875 2876 * readelf.c (for_each_section_argument): Process all sections with 2877 matching name, not just the first. 2878 28792010-07-26 Roland McGrath <roland@redhat.com> 2880 2881 * readelf.c (print_ops): Take new argument for CU version. 2882 Fix DW_OP_call_ref decoding to depend on it. 2883 (print_debug_loc_section): Update caller. 2884 (print_cfa_program): Take new argument, pass it down. 2885 (print_debug_frame_section): Update caller. 2886 (struct attrcb_args): New member version. 2887 (print_debug_units): Initialize it. 2888 28892010-07-02 Roland McGrath <roland@redhat.com> 2890 2891 * readelf.c (print_debug_frame_section): Use format_dwarf_addr for 2892 initial_location. 2893 28942010-06-30 Roland McGrath <roland@redhat.com> 2895 2896 * strings.c (main): Use STDIN_FILENO, not STDOUT_FILENO. 2897 Ignore st_size for a non-S_ISREG file descriptor. 2898 (read_block): Move assert after no-mmap bail-out. 2899 (read_block_no_mmap): Fix size calculations for moving buffer remnant. 2900 29012010-06-22 Roland McGrath <roland@redhat.com> 2902 2903 * readelf.c (print_debug_line_section): Fix braino in DW_LNS_set_isa. 2904 29052010-06-21 Roland McGrath <roland@redhat.com> 2906 2907 * readelf.c (dwarf_tag_string): Handle new v4 tags. 2908 (dwarf_attr_string): Add new attributes. 2909 (dwarf_tag_string): Handle DW_TAG_GNU_*. 2910 2911 * readelf.c (print_ops): Use 64-bit types for LEB128 operands. 2912 (print_cfa_program): Likewise. 2913 29142010-06-20 Roland McGrath <roland@redhat.com> 2915 2916 * readelf.c (print_debug_units): New function, broken out of ... 2917 (print_debug_info_section): ... here. Call it. 2918 (print_debug_types_section): New function. 2919 (enum section_e): Add section_types alias for section_info. 2920 (print_debug): Add types to the sections table. 2921 2922 * readelf.c (print_debug_frame_section): Handle version 4 format. 2923 2924 * readelf.c (print_debug_line_section): Handle version 4 format. 2925 29262010-06-14 Roland McGrath <roland@redhat.com> 2927 2928 * unstrip.c (copy_elided_sections): Make sure all sections' data have 2929 been read in before we write anything out. 2930 29312010-06-04 Roland McGrath <roland@redhat.com> 2932 2933 * unstrip.c (update_shdr): New function. 2934 (update_sh_size): Call it instead of gelf_update_shdr. 2935 (adjust_relocs, add_new_section_symbols): Likewise. 2936 (new_shstrtab, copy_elided_sections): Likewise. 2937 2938 * unstrip.c (copy_elided_sections): Bail if stripped file has more 2939 sections than unstripped file, rather than getting confused later. 2940 29412010-06-01 Roland McGrath <roland@redhat.com> 2942 2943 * readelf.c (dwarf_form_string): Handle DWARF 4 forms. 2944 (attr_callback): Handle DW_FORM_flag_present, DW_FORM_exprloc, 2945 DW_FORM_sec_offset, DW_FORM_ref_sig8. 2946 2947 * readelf.c (print_debug): Don't bail if libdw setup fails. 2948 Suppress complaint if we only want .eh_frame anyway. 2949 29502010-05-28 Ulrich Drepper <drepper@redhat.com> 2951 2952 * readelf.c (attr_callback): Also print form information. 2953 29542010-05-19 Roland McGrath <roland@redhat.com> 2955 2956 * addr2line.c (find_symbol): Short-circuit on empty name. 2957 (handle_address): Handle SYMBOL with no +OFFSET. 2958 29592010-05-08 Roland McGrath <roland@redhat.com> 2960 2961 * readelf.c (print_ops): Take new arg OFFSET_SIZE. 2962 Use that for DW_OP_call_ref, not ADDRSIZE. 2963 (print_cfa_program): Update caller. 2964 (struct attrcb_args): Add offset_size field. 2965 (attr_callback): Use it for print_ops call. 2966 (print_debug_info_section): Initialize it. 2967 (print_ops): Likewise. 2968 29692010-04-14 Roland McGrath <roland@redhat.com> 2970 2971 * readelf.c (handle_core_item): Fix bitmask printing. 2972 29732010-04-06 Roland McGrath <roland@redhat.com> 2974 2975 * ld.c (options): Fix some typos in messages. 2976 * elflint.c (check_scn_group, check_group): Likewise. 2977 * ldscript.y (add_id_list): Likewise. 2978 * readelf.c (print_hash_info): Add xgettext:no-c-format magic comment 2979 before translated string containing a literal %. 2980 29812010-02-26 Roland McGrath <roland@redhat.com> 2982 2983 * readelf.c (process_file): Don't leak an fd in failure case. 2984 29852010-02-15 Roland McGrath <roland@redhat.com> 2986 2987 * Makefile.am: Use config/eu.am for common stuff. 2988 2989 * readelf.c (print_debug_frame_section): Add a cast to avoid sign 2990 mismatch in comparison. 2991 29922010-02-02 Roland McGrath <roland@redhat.com> 2993 2994 * readelf.c (print_encoding_base): Handle DW_EH_PE_absptr (zero). 2995 (read_encoded): Likewise. 2996 (print_debug_frame_section): Check for bogus augmentation length. 2997 For P augmentation, use read_encoded, print the encoding description, 2998 and use hex for unsigned values. 2999 30002010-01-15 Roland McGrath <roland@redhat.com> 3001 3002 * ar.c: Include <sys/stat.h>. 3003 * elflint.c: Likewise. 3004 * readelf.c: Likewise. 3005 * strip.c: Likewise. 3006 * unstrip.c: Likewise 3007 30082010-01-07 Roland McGrath <roland@redhat.com> 3009 3010 * readelf.c (print_ehdr): Handle PN_XNUM. 3011 (phnum): New static variable. 3012 (process_elf_file): Set it with elf_getphdrnum. 3013 (print_phdr): Use phnum instead of EHDR->e_phnum. 3014 (print_dynamic, handle_notes): Likewise. 3015 (handle_relocs_rel, handle_relocs_rela): Likewise. 3016 3017 * elfcmp.c (main): Use elf_getshdrnum and elf_getphdrnum. 3018 3019 * elflint.c (phnum): New static variable. 3020 (check_elf_header): Set it, handling PN_XNUM. 3021 Use that in place of EHDR->e_phnum throughout. 3022 (check_symtab, check_reloc_shdr, check_dynamic): Likewise. 3023 (unknown_dependency_p, check_sections, check_program_header): Likewise. 3024 30252010-01-05 Roland McGrath <roland@redhat.com> 3026 3027 * readelf.c (dwarf_attr_string): Match DW_AT_GNU_vector and 3028 DW_AT_GNU_template_name. 3029 30302010-01-04 Roland McGrath <roland@redhat.com> 3031 3032 * readelf.c (handle_notes_data): Grab NT_AUXV only for name "CORE". 3033 (handle_core_note): Pass NHDR and NAME to ebl_core_note. 3034 (handle_core_item): Handle .format of '\n' as \n-separated strings. 3035 3036 * readelf.c (implicit_debug_sections): New variable. 3037 (parse_opt): Set it instead of print_debug_sections for -a. 3038 OR them together for print_debug check. 3039 (print_debug): OR them together for section check. 3040 3041 * readelf.c (options): Repartition into set implied by -a and others. 3042 Correct -a text to match reality. 3043 3044 * readelf.c (struct section_argument): Add bool member 'implicit'. 3045 (parse_opt): Set it for -a cases, clear it for -x args. 3046 (for_each_section_argument): Don't complain about a missing section by 3047 name if it's implicit. 3048 30492009-11-16 Roland McGrath <roland@redhat.com> 3050 3051 * readelf.c (print_string_section): Punt SHT_NOBITS like empty 3052 sections, just as dump_data_section already does. 3053 30542009-09-21 Ulrich Drepper <drepper@redhat.com> 3055 3056 * elflint.c (special_sections): Allow MERGE and STRINGS flags to be 3057 set for .comment section. 3058 Patch by Mark Wielaard <mjw@redhat.com>. 3059 30602009-09-08 Roland McGrath <roland@redhat.com> 3061 3062 * ar.c (main): Fix typo in message format. 3063 30642009-08-21 Roland McGrath <roland@redhat.com> 3065 3066 * readelf.c (attr_callback): Use print_block only when we don't use 3067 print_ops. 3068 30692009-08-14 Roland McGrath <roland@redhat.com> 3070 3071 * ar.c (do_oper_extract): Use pathconf instead of statfs. 3072 30732009-08-01 Ulrich Drepper <drepper@redhat.com> 3074 3075 * debugpred.h: Add two most const. 3076 30772009-07-26 Mark Wielaard <mjw@redhat.com> 3078 3079 * elflint.c (check_note_data): Recognize NT_GNU_GOLD_VERSION. 3080 30812009-07-25 Mark Wielaard <mjw@redhat.com> 3082 3083 * Makefile.am (addr2line_LDADD): Add $(libelf). 3084 30852009-07-24 Roland McGrath <roland@redhat.com> 3086 3087 * readelf.c (print_block): New function. 3088 (print_ops): Use it. 3089 (attr_callback): Use it for DW_FORM_block* forms. 3090 30912009-07-20 Mark Wielaard <mjw@redhat.com> 3092 3093 * readelf.c (print_ops): Add handling of DW_OP_implicit_value 3094 and DW_OP_stack_value. 3095 30962009-07-14 Ulrich Drepper <drepper@redhat.com> 3097 3098 * elflint.c (check_elf_header): Allow Linux ABI. 3099 (check_symtab): Handle STB_GNU_UNIQUE. 3100 31012009-07-08 Mark Wielaard <mjw@redhat.com> 3102 3103 * readelf.c (attr_callback): Handle DW_Form constants for 3104 DW_AT_data_member_location. 3105 31062009-07-06 Roland McGrath <roland@redhat.com> 3107 3108 * readelf.c (register_info): New function. Handle unknown register #s. 3109 (print_cfa_program): Use it. 3110 (handle_core_register, handle_core_registers): Likewise. 3111 31122009-06-28 Roland McGrath <roland@redhat.com> 3113 3114 * readelf.c (print_address_names): New static variable. 3115 (options, parse_opt): Grok -N/--numeric-addresses to clear it. 3116 (format_dwarf_addr): Don't look up name if !print_address_names. 3117 31182009-06-13 Ulrich Drepper <drepper@redhat.com> 3119 3120 * ldgeneric.c: Don't use deprecated libelf functions. 3121 * nm.c: Likewise. 3122 * objdump.c: Likewise. 3123 * readelf.c: Likewise. 3124 * size.c: Likewise. 3125 * strip.c: Likewise. 3126 * unstrip.c: Likewise. 3127 * ld.h: Fix up comment. 3128 31292009-06-01 Ulrich Drepper <drepper@redhat.com> 3130 3131 * readelf.c (print_relocs): Expect ELF header argument and pass on 3132 to handle_relocs_rel* functions. Adjust caller. 3133 (handle_relocs_rel): Add ELF header argument. Add special case for 3134 the IRELATIVE relocations in statically linked executables. 3135 (handle_relocs_rela): Likewise. 3136 31372009-04-29 Ulrich Drepper <drepper@redhat.com> 3138 3139 * elflint.c (check_symtab): Add tests of st_other field. 3140 31412009-04-23 Ulrich Drepper <drepper@redhat.com> 3142 3143 * Makefile [BUILD_STATIC] (libdw): Add $(zip_LIBS). 3144 31452009-04-20 Roland McGrath <roland@redhat.com> 3146 3147 * addr2line.c (print_dwarf_function): Honor -s and -A for file names 3148 of inline call sites. 3149 3150 * addr2line.c (just_section): New variable. 3151 (adjust_to_section): New function, broken out of ... 3152 (handle_address): ... here. 3153 (options, parse_opt): Add -j/--section=NAME to set it. 3154 31552009-04-15 Roland McGrath <roland@redhat.com> 3156 3157 * readelf.c (print_debug_frame_section): Check for DW_CIE_ID_64 in 3158 64-bit format header, DW_CIE_ID_32 in 32-bit format header. 3159 31602009-04-14 Roland McGrath <roland@redhat.com> 3161 3162 * readelf.c (print_attributes): Treat SHT_ARM_ATTRIBUTES on EM_ARM 3163 like SHT_GNU_ATTRIBUTES. 3164 3165 * readelf.c (handle_core_registers): Fix error message. 3166 3167 * strip.c (handle_elf: check_preserved): Don't note any change when 3168 .debug_data is already filled from a previous pass. 3169 31702009-02-05 Ulrich Drepper <drepper@redhat.com> 3171 3172 * objdump.c (show_relocs_x): Minor cleanups. 3173 3174 * readelf.c (print_cfa_program): Correct a few labels. 3175 Print first DW_CFA_expression and DW_CFA_val_expression parameter 3176 as register. 3177 31782009-02-01 Ulrich Drepper <drepper@redhat.com> 3179 3180 * objdump.c (show_relocs_rel, show_relocs_rela): Split common parts 3181 into ... 3182 (show_relocs_x): ...here. New function. 3183 (show_relocs): Better spacing in output. 3184 3185 * objdump.c (show_relocs_rela): Show offsets as signed values. 3186 3187 * ar.c (main): Fix recognition of invalid modes for a, b, i modifiers. 3188 Improve some error messages. 3189 Use program_invocation_short_name instead of AR macro. 3190 * Makefile.am (CFLAGS_ar): Remove. 3191 * elflint.c (parse_opt): ARGP_HELP_EXIT_ERR does nothing for argp_help. 3192 * objdump.c (parse_opt): Likewise. 3193 * readelf.c (parse_opt): Likewise. 3194 31952009-01-27 Roland McGrath <roland@redhat.com> 3196 3197 * readelf.c (print_ops): Notice short length, don't overrun buffer 3198 (still need to fix LEB128). 3199 3200 * readelf.c (print_ops): Fix DW_OP_call[24] decoding. 3201 3202 * readelf.c (print_ops): Print (empty)\n when LEN == 0. 3203 32042009-01-24 Ulrich Drepper <drepper@redhat.com> 3205 3206 * readelf.c (print_debug_frame_section): Fix computation of vma_base 3207 for PC-relative mode. 3208 32092009-01-23 Ulrich Drepper <drepper@redhat.com> 3210 3211 * size.c (process_file): When handling archive, close file descriptor 3212 here. For unknown file format also close file descriptor. 3213 (handle_ar): Don't close file descriptor here. 3214 3215 * readelf.c (parse_opt): Move code to add to dump_data_sections and 3216 string_sections list in local function add_dump_section. Adjust 'x' 3217 key handling. For 'a' key add .strtab, .dynstr, and .comment section 3218 to string_sections list. 3219 32202009-01-22 Roland McGrath <roland@redhat.com> 3221 3222 * readelf.c (print_phdr): Don't print section mapping when no sections. 3223 3224 * Makefile.am (AM_CFLAGS): Pass -Wno-format for *_no_Wformat. 3225 3226 * readelf.c (print_debug_frame_section): Initialize IS_SIGNED to false 3227 and reset it only for the 'true' cases. 3228 3229 * Makefile.am (addr2line_no_Wformat): New variable. 3230 3231 * readelf.c (print_debug_frame_section): Use t instead of j formats 3232 for ptrdiff_t OFFSET. 3233 32342009-01-21 Ulrich Drepper <drepper@redhat.com> 3235 3236 * elflint.c (check_program_header): Fix typo in .eh_frame_hdr section 3237 test. Handle debuginfo files. 3238 (check_exception_data): First sanity test. 3239 32402009-01-17 Ulrich Drepper <drepper@redhat.com> 3241 3242 * readelf.c (print_debug_exception_table): Show target of ar_disp 3243 field. 3244 3245 * elflint.c (check_program_header): Add most consistency checks for 3246 PT_GNU_EH_FRAME entry. 3247 3248 * addr2line.c: Use ARGP_PROGRAM_VERSION_HOOK_DEF and 3249 ARGP_PROGRAM_BUG_ADDRESS_DEF. 3250 * ar.c: Likewise. 3251 * elfcmp.c: Likewise. 3252 * elflint.c: Likewise. 3253 * findtextrel.c: Likewise. 3254 * ld.c: Likewise. 3255 * nm.c: Likewise. 3256 * objdump.c: Likewise. 3257 * ranlib.c: Likewise. 3258 * readelf.c: Likewise. 3259 3260 * size.c: Likewise. 3261 * strings.c: Likewise. 3262 * strip.c: Likewise. 3263 * unstrip.c: Likewise. 3264 32652009-01-16 Ulrich Drepper <drepper@redhat.com> 3266 3267 * elflint.c (check_program_header): Check that PT_GNU_EH_FRAME entry 3268 matches .eh_frame_hdr section, if it is available. Also check that 3269 the segment is allocated, not writable, not executable. 3270 3271 * readelf.c: Add -e option. Dump exception and unwind related 3272 sections. Add -e to -a. 3273 (print_encoding_base): Handle DW_EH_PE_omit. 3274 (print_debug_exception_table): Beginning of support. 3275 (print_debug): Hook up print_debug_exception_table for 3276 .gcc_except_table sections. 3277 3278 * readelf.c (print_debug_frame_section): Some fixes for last change. 3279 32802009-01-15 Ulrich Drepper <drepper@redhat.com> 3281 3282 * readelf.c (print_encoding): Now a toplevel function. 3283 (print_relinfo): Likewise. 3284 (print_encoding_base): Broken out of print_debug_frame_section. 3285 (print_debug_frame_section): Print different header for .eh_frame 3286 sections. Fix recognition of matching CIEs in .debug_frame sections. 3287 Print absolute offset for PC-relative FDE locations. Don't print 3288 table header for FDEs if the table is empty. 3289 (read_encoded): New function. 3290 (print_debug_frame_hdr_section): New function. 3291 (print_debug): Hook up print_debug_frame_hdr_section for .eh_frame_hdr 3292 sections. 3293 3294 * readelf.c (handle_relocs_rel): Print section number. 3295 (print_debug_abbrev_section): Likewise. 3296 (print_debug_aranges_section): Likewise. 3297 (print_debug_ranges_section): Likewise. 3298 (print_debug_info_section): Likewise. 3299 (print_debug_line_section): Likewise. 3300 (print_debug_loc_section): Likewise. 3301 (print_debug_macinfo_section): Likewise. 3302 (print_debug_pubnames_section): Likewise. 3303 (print_debug_str_section): Likewise. 3304 33052009-01-10 Ulrich Drepper <drepper@redhat.com> 3306 3307 * strings.c (read_block): Fix typo in error message string. 3308 33092009-01-07 Ulrich Drepper <drepper@redhat.com> 3310 3311 * ld.c (ld_new_searchdir): Fix adding to search path list. 3312 33132009-01-06 Ulrich Drepper <drepper@redhat.com> 3314 3315 * readelf.c: Implement call frame debug section dumping. 3316 33172009-01-05 Roland McGrath <roland@redhat.com> 3318 3319 * elfcmp.c: Exit with status 2 for errors (like cmp, diff, grep). 3320 Status 1 (aka EXIT_FAILURE) is only for completed OK but not equal. 3321 33222009-01-01 Ulrich Drepper <drepper@redhat.com> 3323 3324 * addr2line.c: Update copyright year. 3325 * ar.c: Likewise. 3326 * elfcmp.c: Likewise. 3327 * elflint.c: Likewise. 3328 * findtextrel.c: Likewise. 3329 * ld.c: Likewise. 3330 * nm.c: Likewise. 3331 * objdump.c: Likewise. 3332 * ranlib.c: Likewise. 3333 * readelf.c: Likewise. 3334 * size.c: Likewise. 3335 * strings.c: Likewise. 3336 * strip.c: Likewise. 3337 * unstrip.c: Likewise. 3338 33392008-12-11 Roland McGrath <roland@redhat.com> 3340 3341 * nm.c (sym_name): New function. 3342 (show_symbols_sysv): Use it in place of elf_strptr. 3343 (show_symbols_bsd, show_symbols_posix): Likewise. 3344 Fixes RHBZ#476136. 3345 3346 * nm.c (show_symbols_sysv): Use an alloca'd backup section name when 3347 elf_strptr fails. 3348 33492008-12-02 Roland McGrath <roland@redhat.com> 3350 3351 * readelf.c (count_dwflmod, process_file): Don't presume encoding of 3352 nonzero OFFSET argument to dwfl_getmodules. 3353 33542008-08-07 Roland McGrath <roland@redhat.com> 3355 3356 * addr2line.c (main): Pass string to handle_address. 3357 (see_one_module): New function, subroutine of handle_address. 3358 (find_symbol): Likewise. 3359 (handle_address): Take string argument rather than address. 3360 Convert plain number, or handle strings like "(section)+offset" 3361 or "symbol+offset". 3362 33632008-08-01 Roland McGrath <roland@redhat.com> 3364 3365 * readelf.c (handle_core_item): Handle 'B' type for 1-origin bitset. 3366 For 'b' and 'B', print <x-y,z> or ~<x,y-z> rather than 1/0 string. 3367 3368 * readelf.c (convert): Take new argument SIZE. 3369 (handle_core_register, handle_core_item): Update callers. 3370 (handle_core_item): Take new arg REPEATED_SIZE. 3371 (handle_core_items): Special case for a singleton item, 3372 let handle_core_item handle repeats if it wants to. 3373 3374 * readelf.c (handle_core_items): Give abridged output 3375 for identical groups repeated more than twice. 3376 33772008-07-04 Roland McGrath <roland@redhat.com> 3378 3379 * readelf.c (handle_core_items): Handle ELF_T_ADDR. 3380 33812008-04-10 Roland McGrath <roland@redhat.com> 3382 3383 * strip.c (handle_elf): Don't keep sections that kept symbol tables 3384 refer to. Instead, just be sure to preserve the original symbol 3385 table in the debug file so those symbols go with their sections and 3386 can be elided from the stripped version of the symbol table. 3387 3388 * strip.c (handle_elf): When a discarded section kept in the debug 3389 file refers to a nondiscard section via sh_link/sh_info, preserve 3390 that nondiscarded section unmodified in the debug file as well. 3391 Skip adjustment of discarded sections symbol table references when 3392 that symbol table is copied in this way. 3393 3394 * elflint.c (check_symtab): Don't crash from missing symbol names 3395 after diagnosing bogus strtab. 3396 3397 * strip.c (handle_elf): Cosmetic cleanup in special section contents 3398 adjustment for symtab changes. 3399 34002008-03-31 Roland McGrath <roland@redhat.com> 3401 3402 * elflint.c (check_sections): Add checks on SHF_EXECINSTR sections: 3403 must be SHT_PROGBITS, must not be SHF_WRITE. Let backend hook 3404 excuse a special section. 3405 34062008-03-27 Roland McGrath <roland@redhat.com> 3407 3408 * elflint.c (check_sections): Check that executability and writability 3409 of sections is reflected in segment p_flags. 3410 34112008-03-26 Roland McGrath <roland@redhat.com> 3412 3413 * elflint.c (check_program_header): Accept PT_GNU_RELRO p_flags 3414 that matches its PT_LOAD's p_flags &~ PF_W. On sparc, PF_X really 3415 is valid in RELRO. 3416 34172008-02-29 Roland McGrath <roland@redhat.com> 3418 3419 * readelf.c (print_attributes): Add a cast. 3420 * elflint.c (check_attributes): Likewise. 3421 3422 * unaligned.h (add_8ubyte_unaligned): Cast PTR argument for parity 3423 with [UNALIGNED_ACCESS_CLASS == BYTE_ORDER] definition. 3424 (add_4ubyte_unaligned, add_2ubyte_unaligned): Likewise. 3425 34262008-02-03 Ulrich Drepper <drepper@redhat.com> 3427 3428 * i386_ld.c (elf_i386_count_relocations): Implement R_386_TLS_GD 3429 when linked into executable. 3430 (elf_i386_create_relocations): Likewise. 3431 34322008-02-20 Roland McGrath <roland@redhat.com> 3433 3434 * readelf.c (print_attributes): New function. 3435 (process_elf_file): Call it under -A. 3436 3437 * elflint.c (check_attributes): Implement it for real. 3438 34392008-02-19 Roland McGrath <roland@redhat.com> 3440 3441 * elflint.c (special_sections): Handle .gnu.attributes section. 3442 (check_sections): Likewise. 3443 (check_attributes): New function. 3444 34452008-02-10 Roland McGrath <roland@redhat.com> 3446 3447 * elfcmp.c (main): Ignore sh_offset differences in non-SHF_ALLOC 3448 sections and ET_REL files. 3449 34502008-02-02 Ulrich Drepper <drepper@redhat.com> 3451 3452 * elf32-i386.script: Add .eh_frame_hdr, .tdata, and .tbss sections. 3453 * i386_ld.c (elf_i386_count_relocations): Handle R_386_TLS_LDO_32 3454 and R_386_TLS_LE. 3455 (elf_i386_create_relocations): Likewise. 3456 * ld.h (struct ld_state): Add need_tls, tls_start, and tls_tcb 3457 elements. 3458 * ldgeneric.c (add_section): If TLS section is used, set need_tls flag. 3459 (ld_generic_create_outfile): Add PT_TLS entry to program header. 3460 Fix generation of PT_GNU_STACK entry. 3461 34622008-02-01 Ulrich Drepper <drepper@redhat.com> 3463 3464 * ld.c (replace_args): Prevent loop over replacements if the parameter 3465 is only two characters long. 3466 3467 * ld.c: Recognize sha1 argument for --build-id parameter. 3468 * ldgeneric.c (create_build_id_section): Handle sha1. 3469 (compute_hash_sum): New function. Broken out of compute_build_id. 3470 Take hash function and context as parameters. 3471 (compute_build_id): Use compute_hash_sum for md5 and the new sha1 3472 implementation. 3473 34742008-01-31 Ulrich Drepper <drepper@redhat.com> 3475 3476 * elf32-i386.script: Add .note.ABI-tag and .note.gnu.build-id sections. 3477 * ld.c: Recognize --build-id command line parameter. 3478 * ld.h: Define scn_dot_note_gnu_build_id. 3479 (struct ld_state): Add build_id and buildidscnidx elements. 3480 * ldgeneric.c: Implement --build-id command line parameter. 3481 * ldlex.l (ID): Recognize - as valid character after the first one. 3482 34832008-01-29 Ulrich Drepper <drepper@redhat.com> 3484 3485 * ld.c (replace_args): New function. 3486 (main): Use it to rewrite old-style parameters. 3487 3488 * elf32-i386.script: Add .gnu.hash section. 3489 * ldgeneric.c (optimal_bucket_size): A tiny bit more efficient. 3490 (fillin_special_symbol): Initialize st_size. 3491 (sortfct_hashval): New function. 3492 (create_gnu_hash): New function. 3493 (create_hash): New function. 3494 (ld_generic_create_outfile): Use the new functions to create the 3495 hash tables. 3496 3497 * elflint.c (check_gnu_hash): Fix index value printed in error message. 3498 34992008-01-24 Ulrich Drepper <drepper@redhat.com> 3500 3501 * elflint.c (check_group): Check that signature symbol for section 3502 group is not an empty string. 3503 * ldgeneric.c: Remove magic assignment of indeces in the dynsym 3504 section. Start implementation of --hash-style. 3505 * i386_ld.c: Likewise. 3506 * ld.c: Recognize --hash-style. 3507 * ld.h (struct scninfo): Add comdat_group. 3508 Add additional parameter to finalize_plt callback. 3509 35102008-01-22 Ulrich Drepper <drepper@redhat.com> 3511 3512 * ld.h (struct callbacks): Add initialize_gotplt. 3513 (struct scnhead): Add scn_dot_gotplt. 3514 (struct ld_state): Add gotpltscnidx. 3515 * i386_ld.c (elf_i386_initialize_plt): Minor optimization. 3516 (elf_i386_initialize_pltrel): Likewise. 3517 (elf_i386_initialize_got): There is now a separate .got.plt, so 3518 don't do the PLT-related work here. Initialize d_type. 3519 (elf_i386_initialize_gotplt): New function. 3520 (elf_i386_plt0): Use ud2a after indirect jump. 3521 (elf_i386_pic_plt0_entry): Likewise. 3522 (elf_i386_finalize_plt): Reference now .got.plt. 3523 (elf_i386_count_relocations): For GOT entries which need no relocation 3524 don't bump nrel_got. 3525 (elf_i386_create_relocations): Also get .got.plt. Rewrite R-386_GOT32 3526 handling for split .got/.got.plt. 3527 (elf_i386_ld_init): Initialize callbacks.initialize_gotplt. 3528 * elf32-i386.script: Sort sections for security. There are no .got 3529 input sections. Add .got.plt. 3530 * ldgeneric.c (ld_generic_generate_sections): Add .got.plt section. 3531 (ld_generic_create_outfile): Initialize .got.plt section. 3532 Use .got.plt address for _GLOBAL_OFFSET_TABLE_ symbol and DT_PLTGOT. 3533 35342008-01-19 Ulrich Drepper <drepper@redhat.com> 3535 3536 * i386_ld.c (elf_i386_count_relocations): PLT relocations for undefined 3537 symbols are not carried over into statically linked output files. 3538 Add dummy entries for more TLS relocations. 3539 3540 * ld.c (options): Add long names for -( and -). 3541 3542 * ldgeneric.c (check_definition): For newly found definitions don't 3543 mark section as used if symbol is absolute. 3544 (extract_from_archive): Only assign archive sequence number the first 3545 time the archive is handled. Update ld_state.last_archive_used 3546 if any symbol was used. Remove nround variable. 3547 (file_process2): When using symbol from an archive, update 3548 ld_state.group_start_archive, ld_state.archives, and 3549 ld_state.tailarchives. 3550 (ld_generic_file_process): If group is not handled anymore, after 3551 freeing ELF handles for the archives, clear ld_state.archives and 3552 *nextp. Fix wrong logic in recognizing first iteration of group 3553 loop. When clearing flags, also clear ld_state.group_start_archive. 3554 35552008-01-11 Ulrich Drepper <drepper@redhat.com> 3556 3557 * objdump.c (show_disasm): Adjust disassembler format string for 3558 removal of %e. 3559 35602008-01-04 Roland McGrath <roland@redhat.com> 3561 3562 * readelf.c (handle_core_items): Take new arg DESCSZ; if nonzero, 3563 a size greater than the items cover means multiple sets of items. 3564 (handle_core_note): Update caller. 3565 35662008-01-04 Roland McGrath <roland@redhat.com> 3567 3568 * strip.c (handle_elf): Move SHDRIDX defn to silence gcc warning. 3569 35702008-01-03 Roland McGrath <roland@redhat.com> 3571 3572 * ld.h (linked_from_dso_p): Use __attribute__ ((__gnu_inline__)). 3573 3574 * elflint.c (check_dynamic): Remove duplicate initializer. 3575 35762008-01-02 Ulrich Drepper <drepper@redhat.com> 3577 3578 * addr2line.c: Update copyright year. 3579 * ar.c: Likewise. 3580 * elfcmp.c: Likewise. 3581 * elflint.c: Likewise. 3582 * findtextrel.c: Likewise. 3583 * ld.c: Likewise. 3584 * nm.c: Likewise. 3585 * objdump.c: Likewise. 3586 * ranlib.c: Likewise. 3587 * readelf.c: Likewise. 3588 * size.c: Likewise. 3589 * strings.c: Likewise. 3590 * strip.c: Likewise. 3591 * unstrip.c: Likewise. 3592 35932007-12-30 Ulrich Drepper <drepper@redhat.com> 3594 3595 * objdump (show_disasm): Use %e after third parameter. 3596 35972007-12-21 Ulrich Drepper <drepper@redhat.com> 3598 3599 * strip.c: Fix wrong parenthesis in a few branch predictions. 3600 * strings.c: Likewise. 3601 36022007-12-20 Ulrich Drepper <drepper@redhat.com> 3603 3604 * Makefile.am (DEFS): Add DEBUGPRED. 3605 * addr2line.c: Include debugpred.h. 3606 * ar.c: Likewise. 3607 * elfcmp.c: Likewise. 3608 * elflint.c: Likewise. 3609 * findtextrel.c: Likewise. 3610 * nm.c: Likewise. 3611 * objdump.c: Likewise. 3612 * ranlib.c: Likewise. 3613 * readelf.c: Likewise. 3614 * size.c: Likewise. 3615 * strings.c: Likewise. 3616 * strip.c: Likewise. 3617 * unstrip.c: Likewise. 3618 * debugpred.h: New file. 3619 3620 * readelf.c (handle_relocs_rel): Use elf_scnshndx. 3621 (handle_relocs_rela): Likewise. 3622 3623 * readelf.c: Add lots of likely/unlikely. 3624 3625 * elflint.c: Minor cleanups. 3626 36272007-11-19 Roland McGrath <roland@redhat.com> 3628 3629 * readelf.c (print_ops): Handle all bad op codes gracefully. 3630 Print their numbers instead of just ???. 3631 36322007-11-09 Roland McGrath <roland@redhat.com> 3633 3634 * readelf.c (attr_callback): Handle DW_AT_data_location. 3635 Handle block forms to mean a DWARF expression for DW_AT_allocated, 3636 DW_AT_associated, DW_AT_bit_size, DW_AT_bit_offset, DW_AT_bit_stride, 3637 DW_AT_byte_size, DW_AT_byte_stride, DW_AT_count, DW_AT_lower_bound, 3638 DW_AT_upper_bound. 3639 36402007-10-20 Roland McGrath <roland@redhat.com> 3641 3642 * unstrip.c (options): Update -R description. 3643 (struct symbol): Put symbol details a union with a size_t pointer 3644 `duplicate'. 3645 (compare_symbols_output): Use null ->name as marker for discard 3646 symbols, not zero *->map. 3647 (copy_elided_sections): Record forwarding pointers for discarded 3648 duplicates and fill SYMNDX_MAP elements through them. 3649 3650 * readelf.c (process_file): Set offline_next_address to 0 at start. 3651 (struct process_dwflmod_args): New type. 3652 (process_dwflmod): Take args in it, pass fd to process_elf_file. 3653 (process_file): Update caller; dup FD for passing to libdwfl. 3654 (process_elf_file): Take new arg FD. For ET_REL file when 3655 displaying data affected by libdwfl relocation, open a new Elf handle. 3656 36572007-10-17 Roland McGrath <roland@redhat.com> 3658 3659 * readelf.c (print_debug_line_section): For invalid data inside a 3660 unit with plausible length, keep printing at the next unit boundary. 3661 3662 * readelf.c (attr_callback): Use dwarf_formref_die, not dwarf_formref. 3663 36642007-10-16 Roland McGrath <roland@redhat.com> 3665 3666 * readelf.c (hex_dump): Fix rounding error in whitespace calculation. 3667 36682007-10-15 Roland McGrath <roland@redhat.com> 3669 3670 * make-debug-archive.in: New file. 3671 * Makefile.am (EXTRA_DIST): Add it. 3672 (make-debug-archive): New target. 3673 (bin_SCRIPTS, CLEANFILES): Add it. 3674 36752007-10-10 Roland McGrath <roland@redhat.com> 3676 3677 * elflint.c (special_sections): Add new attrflag value exact_or_gnuld. 3678 Use it to check MERGE|STRINGS for .debug_str. 3679 (check_sections): Handle exact_or_gnuld. 3680 36812007-10-08 Roland McGrath <roland@redhat.com> 3682 3683 * readelf.c (handle_core_item): Handle 'T'|0x80 to indicate 3684 64-bit struct timeval with 32-bit tv_usec. 3685 36862007-10-07 Roland McGrath <roland@redhat.com> 3687 3688 * readelf.c (check_archive_index): New function. 3689 (process_file): Call it. Change signature to take only fd and name. 3690 Use libdwfl to open the file, then iterate on its modules (multiple 3691 for an archive) to print file name and call process_elf_file. 3692 (main): Update caller. Let process_file do elf_begin. 3693 (count_dwflmod, process_dwflmod, find_no_debuginfo): New functions. 3694 (process_elf_file): Take only Dwfl_Module * argument. 3695 Don't print the file name here. 3696 (print_debug_*_section): Take Dwfl_Module * argument. 3697 (print_debug): Likewise. Update caller. 3698 (format_dwarf_addr): New function. 3699 (print_debug_ranges_section): Use it. 3700 (attr_callback): Likewise. 3701 (print_debug_line_section, print_debug_loc_section): Likewise. 3702 3703 * readelf.c (print_debug_ranges_section): Translate all strings. 3704 (print_debug_loc_section): Likewise. 3705 3706 * unstrip.c (copy_elided_sections): Initialize SEC. 3707 3708 * ar.c (do_oper_insert): Put trailing / on short names. 3709 3710 * arlib.h (MAX_AR_NAME_LEN): Decrease by one. 3711 3712 * arlib2.c (arlib_add_long_name): Adjust for header size. 3713 3714 * arlib.c (arlib_finalize): Pad long name table to keep size even. 3715 3716 * ar.c (do_oper_insert): Use write_retry for padding write. 3717 3718 * ar.c (do_oper_insert): Initialize CUR_OFF in no_old case. 3719 Unconditionally set FOUND[CNT]->elf when setting ->mem. 3720 (remember_long_name): New function. 3721 (do_oper_insert): Call it. Correctly use length of basename, 3722 not original name. Don't store long name twice for new member. 3723 37242007-10-06 Roland McGrath <roland@redhat.com> 3725 3726 * elflint.c (check_note): Skip empty segment. 3727 (check_note_section): Skip empty section. 3728 3729 * unstrip.c (options, parse_opt, struct arg_info): Grok -R/--relocate. 3730 (handle_output_dir_module, handle_implicit_modules): Pass it down. 3731 (handle_dwfl_module): When set, use ET_REL already loaded by Dwfl. 3732 (compare_alloc_sections): Take new arg REL, ignore address if true. 3733 (compare_sections): Likewise, pass it down. 3734 (compare_sections_rel, compare_sections_nonrel): New functions. 3735 (find_alloc_sections_prelink, copy_elided_sections): Use them 3736 instead of compare_sections. 3737 (sections_match): New function, broken out of ... 3738 (find_alloc_section): ... here. 3739 (copy_elided_sections): Reorganize section match-up logic. 3740 Use sections_match for SHF_ALLOC in ET_REL. 3741 For ET_REL, let the nonzero sh_addr from the debug file dominate. 3742 3743 * unstrip.c (add_new_section_symbols): Take new arg REL. 3744 When true, do not update section symbol values. 3745 (collect_symbols): Likewise. Update section symbols with address 3746 of chosen output section, not original section. 3747 (check_symtab_section_symbols, copy_elided_sections): Update callers. 3748 3749 * unstrip.c (compare_alloc_sections): At the same address, preserve 3750 original section order. 3751 3752 * elflint.c (special_sections): Don't require MERGE|STRINGS for 3753 .debug_str, it didn't always have them with older tools. 3754 3755 * elflint.c (check_symtab, check_one_reloc): Ignore sh_addr in ET_REL. 3756 37572007-10-05 Roland McGrath <roland@redhat.com> 3758 3759 * elflint.c (check_symtab): Allow SHN_UNDEF _GLOBAL_OFFSET_TABLE_ in 3760 ET_REL file. 3761 3762 * elflint.c (check_symtab): For _GLOBAL_OFFSET_TABLE_, diagnose 3763 SHN_UNDEF as "bad section". Use shndx value in messages. 3764 3765 * elflint.c (special_sections): Add ".debug_str". Decrement namelen 3766 for ".debug" so it matches as a prefix. 3767 (IS_KNOWN_SPECIAL): New macro. 3768 (check_sections): Use it for ".plt" match. Cite wrong SHT_NOBITS 3769 type even under -d, for a .debug* or .shstrtab section. 3770 3771 * readelf.c (print_ops): Use hex for address operand. 3772 37732007-10-04 Roland McGrath <roland@redhat.com> 3774 3775 * unstrip.c (copy_elided_sections): Initialize NDX_SECTION element for 3776 .gnu_debuglink section to SHN_UNDEF. Drop STT_SECTION symbols for 3777 sections mapped to SHN_UNDEF. 3778 37792007-10-04 Ulrich Drepper <drepper@redhat.com> 3780 3781 * readelf.c (dump_archive_index): Avoid warning about uninitialized 3782 variable with older glibc versions. 3783 Add some branch prediction. 3784 37852007-10-04 Roland McGrath <roland@redhat.com> 3786 3787 * readelf.c (print_archive_index): New variable. 3788 (options, parse_opt): Accept -c/--archive-index to set it. 3789 (dump_archive_index): New function. 3790 (process_file): Take new arg WILL_PRINT_ARCHIVE_INDEX. 3791 Call dump_archive_index on archives if set. 3792 (main): Update caller. 3793 (any_control_option): Give it file scope, moved out of ... 3794 (parse_opt): ... here. 3795 37962007-10-03 Roland McGrath <roland@redhat.com> 3797 3798 * unstrip.c (struct arg_info): Add `list' flag. 3799 (options, parse_opt): Grok -n/--list to set it. 3800 (list_module): New function. 3801 (handle_implicit_modules): Call it under -n. 3802 3803 * elflint.c (check_note_section): New function. 3804 (check_sections): Call it for SHT_NOTE. 3805 3806 * readelf.c (handle_notes): Use sections when available. 3807 3808 * elflint.c (check_note_data): New function, broken out of ... 3809 (check_note): ... here. Call it and elf_getdata_rawchunk. 3810 3811 * readelf.c (handle_auxv_note): Take offset as argument, not buffer. 3812 Use elf_getdata_rawchunk and gelf_getauxv. 3813 (handle_notes_data): New function, broken out of ... 3814 (handle_notes): ... here. Call it and elf_getdata_rawchunk. 3815 38162007-10-01 Roland McGrath <roland@redhat.com> 3817 3818 * readelf.c (hex_dump): Fix transposed subtraction generating spaces. 3819 3820 * readelf.c (hex_dump): Fix line header to be hex instead of decimal. 3821 38222007-09-10 Roland McGrath <roland@redhat.com> 3823 3824 * readelf.c (options): Give -p optional argument, alias --string-dump. 3825 (string_sections, string_sections_tail): New static variables. 3826 (parse_opt): Set them when -p has an argument. 3827 (print_string_section): New function, broken out of ... 3828 (print_strings): ... here. Call it. 3829 (dump_data_section): New function, broken out of ... 3830 (dump_data): ... here. Call it. 3831 (for_each_section_argument): New function, broken out of ... 3832 (dump_data): ... here. Call it. 3833 (dump_strings): New function. 3834 38352007-08-31 Roland McGrath <roland@redhat.com> 3836 3837 * readelf.c (print_strings): Typo fix. 3838 38392007-08-23 Roland McGrath <roland@redhat.com> 3840 3841 * readelf.c (printf_with_wrap): Function removed. 3842 (REGISTER_WRAP_COLUMN): New macro. 3843 (handle_core_register): Use print_core_item instead. 3844 (struct register_info): New type. 3845 (compare_registers, compare_register_sets): New functions. 3846 (register_bitpos, compare_sets_by_info): New functions. 3847 (handle_core_registers): Use those to segregate and sort registers 3848 for display. 3849 3850 * readelf.c (ITEM_WRAP_COLUMN): New macro. 3851 (print_core_item): New function. 3852 (handle_core_item): Use it instead of printf_with_wrap. 3853 (compare_core_items, compare_core_item_groups): New functions. 3854 (handle_core_items): Use them. Sort by group and force line breaks 3855 between groups. 3856 3857 * readelf.c (handle_core_registers, handle_core_items): New functions, 3858 broken out of ... 3859 (handle_core_note): ... here. Call them. 3860 38612007-08-22 Roland McGrath <roland@redhat.com> 3862 3863 * unstrip.c (new_shstrtab): New function, broken out of ... 3864 (copy_elided_sections): ... here. 3865 38662007-08-20 Roland McGrath <roland@redhat.com> 3867 3868 Avoid local function trampolines in nm binary. 3869 * nm.c (sort_by_address): Move to a static function instead of local 3870 inside show_symbols. 3871 (sort_by_name_strtab): New static variable. 3872 (sort_by_name): Use it. Move to a static function instead of local 3873 inside show_symbols. 3874 (show_symbols): Set sort_by_name_strtab. 3875 38762007-08-19 Roland McGrath <roland@redhat.com> 3877 3878 * readelf.c (handle_auxv_note): New function. 3879 (handle_notes): Call it. 3880 3881 * readelf.c (printf_with_wrap, convert): New functions. 3882 (handle_core_item, (handle_core_register): New functions. 3883 (handle_notes): Call those with details from ebl_core_note. 3884 38852007-08-12 Roland McGrath <roland@redhat.com> 3886 3887 * elflint.c (check_note): Accept type 0 with name "Linux". 3888 3889 * elflint.c (special_sections): Accept SHF_ALLOC for ".note". 3890 3891 * elflint.c (section_flags_string): Return "none" for 0, not "". 3892 38932007-08-11 Roland McGrath <roland@redhat.com> 3894 3895 * elflint.c (check_note): Accept NT_GNU_HWCAP, NT_GNU_BUILD_ID. 3896 38972007-08-04 Ulrich Drepper <drepper@redhat.com> 3898 3899 * readelf.c (hex_dump): Use isprint to determine whether to print 3900 character itself or full stop character. 3901 (dump_data): No need to check endp for NULL after strtol call. 3902 39032007-08-03 Roland McGrath <roland@redhat.com> 3904 3905 * readelf.c (print_string_sections): New variable. 3906 (options, parse_opt): Handle --strings/-p to set it. 3907 (print_strings): New function. 3908 (process_elf_file): Call it under -p. 3909 3910 * readelf.c (options): Add hidden aliases --segments, --sections, 3911 as taken by binutils readelf. 3912 39132007-08-01 Roland McGrath <roland@redhat.com> 3914 3915 * readelf.c (dump_data_sections, dump_data_sections_tail): 3916 New variables. 3917 (options, parse_opt): Handle --hex-dump/-x, set them. 3918 (hex_dump): New function. 3919 (dump_data): New function, call it. 3920 (process_elf_file): Call it. 3921 39222007-07-25 Roland McGrath <roland@redhat.com> 3923 3924 * addr2line.c (show_symbols): New variable. 3925 (print_addrsym): New function. 3926 (handle_address): Call it. 3927 (options, parse_opt): Handle -S/--symbols. 3928 39292007-06-05 Ulrich Drepper <drepper@redhat.com> 3930 3931 * addr2line.c: Update for latest autoconf header. 3932 * ar.c: Likewise. 3933 * elfcmp.c: Likewise. 3934 * elflint.c: Likewise. 3935 * findtextrel.c: Likewise. 3936 * ld.c: Likewise. 3937 * ldgeneric.c: Likewise. 3938 * nm.c: Likewise. 3939 * objdump.c: Likewise. 3940 * ranlib.c: Likewise. 3941 * readelf.c: Likewise. 3942 * size.c: Likewise. 3943 * strings.c: Likewise. 3944 * strip.c: Likewise. 3945 * unstrip.c: Likewise. 3946 39472007-05-18 Roland McGrath <roland@redhat.com> 3948 3949 * unstrip.c (copy_elided_sections): Match up non-NOBITS sections with 3950 stripped file, so as not to duplicate a section copied in both. 3951 3952 * strip.c (handle_elf): Keep SHT_NOTE section copies in the debug file. 3953 39542007-05-17 Roland McGrath <roland@redhat.com> 3955 3956 * unstrip.c (copy_elided_sections): Don't call gelf_newphdr for 0. 3957 3958 * unstrip.c (handle_file): Tweak BIAS != 0 warning. 3959 3960 * unstrip.c (handle_file): Take new arg CREATE_DIRS. If set, 3961 call make_directories here. 3962 (handle_explicit_files): Take new arg CREATE_DIRS, pass it down. 3963 (handle_dwfl_module): Likewise. 3964 (handle_implicit_modules): Update callers. 3965 (handle_output_dir_module): Likewise. Don't do make_directories here. 3966 3967 * unstrip.c (get_section_name): New function, broken out of ... 3968 (copy_elided_sections): here. Update callers. 3969 (find_alloc_section): Broken out of ... 3970 (copy_elided_sections): ... here. Update caller. 3971 (symtab_count_leading_section_symbols): Take new arg NEWSYMDATA, 3972 update STT_SECTION symbols' st_value fields as a side effect. 3973 (check_symtab_section_symbols): Update caller. 3974 (add_new_section_symbols): Set st_value in symbols added. 3975 (collect_symbols): Reset S->value for STT_SECTION symbols recorded. 3976 Take new arg SPLIT_BSS. Adjust S->shndx recorded for symbols moved 3977 from .bss to .dynbss. 3978 (find_alloc_sections_prelink): New function. Associate debug file 3979 allocated SHT_NOBITS shdrs with stripped moved by prelink via 3980 .gnu.prelink_undo information. 3981 (copy_elided_sections): Call it when we couldn't find every allocated 3982 section. Don't use a debug file non-NOBITS section if SHF_ALLOC. 3983 Take STRIPPED_EHDR arg instead of E_TYPE and PHNUM. 3984 (handle_file): Update callers. 3985 3986 * unstrip.c (copy_elided_sections): Ignore unfound unallocated section 3987 named ".comment". 3988 3989 * elflint.c (check_sections): Fix association of segments with 3990 sections when p_memsz > p_filesz. 3991 39922007-04-29 Roland McGrath <roland@redhat.com> 3993 3994 * addr2line.c (options, main): Tweak argp group settings to fix 3995 usage output. 3996 39972007-04-28 Roland McGrath <roland@redhat.com> 3998 3999 * strip.c (handle_elf): Update debug file's SHT_NOBITS sections' 4000 sizes to match sections adjusted in the stripped file. 4001 40022007-04-24 Roland McGrath <roland@redhat.com> 4003 4004 * elfcmp.c (OPT_HASH_INEXACT): New macro. 4005 (hash_inexact): New variable. 4006 (options, parse_opt): Add --hash-inexact option to set it. 4007 (hash_content_equivalent): New function. 4008 (main): Call it for differing SHT_HASH sections under --hash-inexact. 4009 40102007-04-23 Roland McGrath <roland@redhat.com> 4011 4012 * unstrip.c: New file. 4013 * Makefile.am (bin_PROGRAMS): Add it. 4014 (unstrip_LDADD): New variable. 4015 4016 * strip.c (options): Allow --output for -o. 4017 40182007-02-15 Ulrich Drepper <drepper@redhat.com> 4019 4020 * readelf.c: Remove unused code. Add a few consts. 4021 40222007-02-15 Roland McGrath <roland@redhat.com> 4023 4024 * readelf.c (print_debug): Fix brainos in SHDR test. 4025 40262007-02-05 Roland McGrath <roland@redhat.com> 4027 4028 * ar.c: Include <limits.h>, since we use LONG_MAX. 4029 40302007-02-05 Ulrich Drepper <drepper@redhat.com> 4031 4032 * ar.c: Add ugly hack to work around gcc complaining that we 4033 ignore fchown's return value. 4034 (do_oper_insert): Handle error when writing padding. 4035 * ranlib.c: Add fchown complain work around. 4036 4037 * arlib.c: Make symtab a global variable. Change all users. 4038 * arlib2.c: Likewise. 4039 * ranlib.c: Likewise. 4040 * ar.c: Likewise. 4041 * arlib.h: Declare it. 4042 40432007-01-11 Roland McGrath <roland@redhat.com> 4044 4045 * elflint.c (check_sections): Use ebl_machine_section_flag_check on 4046 SHF_MASKPROC bits separately from generic sh_flags validation. 4047 40482007-02-04 Ulrich Drepper <drepper@redhat.com> 4049 4050 * ar.c: New file. 4051 * arlib.c: New file. 4052 * arlib2.c: New file. 4053 * arlib.h: New file. 4054 * Makefile (noinst_LIBRARIES): Add libar. 4055 (libar_a_SOURCES): Define. 4056 (ar_LDADD): Define. 4057 (CFLAGS_ar): Define. 4058 * ranlib.c: Change to use arlib. 4059 4060 * elflint.c (check_symtab): Work around GNU ld bug which omits 4061 sections but not symbols in those sections. 4062 40632007-01-10 Ulrich Drepper <drepper@redhat.com> 4064 4065 * addr2line.c: Update copyright year. 4066 * elfcmp.c: Likewise. 4067 * elflint.c: Likewise. 4068 * findtextrel.c: Likewise. 4069 * ld.c: Likewise. 4070 * nm.c: Likewise. 4071 * objdump.c: Likewise. 4072 * ranlib.c: Likewise. 4073 * readelf.c: Likewise. 4074 * size.c: Likewise. 4075 * strings.c: Likewise. 4076 * strip.c: Likewise. 4077 40782006-12-09 Ulrich Drepper <drepper@redhat.com> 4079 4080 * elflint.c (compare_hash_gnu_hash): New function. Report if the 4081 two hash tables have different content (module expected omission 4082 of undefined symbols). 4083 40842006-10-31 Roland McGrath <roland@redhat.com> 4085 4086 * elflint.c (check_program_header): Don't complain about 4087 p_filesz > p_memsz if p_memsz is zero and p_type is PT_NOTE. 4088 40892006-09-19 Jakub Jelinek <jakub@redhat.com> 4090 4091 * strip.c (process_file): Disallow -f on archives. 4092 40932006-10-09 Roland McGrath <roland@redhat.com> 4094 4095 * Makefile.am (libld_elf_i386.so): Use $(LINK), not $(CC). 4096 40972006-08-29 Roland McGrath <roland@redhat.com> 4098 4099 * Makefile.am (MAINTAINERCLEANFILES): New variable. 4100 4101 * readelf.c (handle_relocs_rel): Typo fix, test DESTSHDR properly. 4102 Reported by Christian Aichinger <Greek0@gmx.net>. 4103 4104 * elflint.c (valid_e_machine): Add EM_ALPHA. 4105 Reported by Christian Aichinger <Greek0@gmx.net>. 4106 41072006-08-08 Ulrich Drepper <drepper@redhat.com> 4108 4109 * elflint.c (check_dynamic): Don't require DT_HASH for DT_SYMTAB. 4110 Keep track of which "high DT" entries are present. 4111 Check that either old or GNU-style hash table is present. 4112 If GNU-style hash table is used a symbol table is mandatory. 4113 Check that if any prelink entry is present all of them are. 4114 (check_gnu_hash): Only fail for undefined symbols in GNU-style hash 4115 table if they don't refer to functions. 4116 41172006-07-17 Roland McGrath <roland@redhat.com> 4118 4119 * elflint.c (struct version_namelist): Use GElf_Versym for `ndx' field. 4120 (add_version): Likewise for argument. 4121 (check_versym): Cast constant to GElf_Versym for comparison. 4122 41232006-07-12 Roland McGrath <roland@redhat.com> 4124 4125 * readelf.c (handle_gnu_hash): Add casts for machines where 4126 Elf32_Word != unsigned int. 4127 41282006-07-12 Ulrich Drepper <drepper@redhat.com> 4129 4130 * elflint.c (check_sysv_hash64): Fix printf format. 4131 41322006-07-11 Roland McGrath <roland@redhat.com> 4133 4134 * addr2line.c (options): English fix in -f doc string. 4135 4136 * addr2line.c (use_comp_dir): New variable. 4137 (options, parse_opt): Grok -A/--absolute to set it. 4138 (handle_address): If set, prepend dwfl_line_comp_dir results to 4139 relative file names. 4140 41412006-07-06 Ulrich Drepper <drepper@redhat.com> 4142 4143 * elflint.c: Adjust for latest new hash table format. 4144 * readelf.c: Likewise. 4145 4146 * elflint.c (check_versym): Ignore hidden bit when comparing version 4147 numbers. 4148 41492006-07-05 Ulrich Drepper <drepper@redhat.com> 4150 4151 * ldgeneric.c (ld_generic_create_outfile): Correctly recognize 4152 discarded COMDAT symbols. 4153 4154 * i386_ld.c (elf_i386_count_relocations): Lot of corrections. 4155 (elf_i386_create_relocations): Likewise. 4156 * ld.h (struct symbol): Add local and hidden bits. 4157 * ld.c (create_special_section_symbol): These synthsized symbols 4158 are local and hidden. 4159 * ldgeneric.c (file_process2): Check whether input file matches 4160 the emulation. 4161 (fillin_special_symbol): Create symbols as local and/or hidden 4162 if requested. 4163 (ld_generic_create_outfile): Make local copy of symbol. 4164 Don't hide global, defined symbols in dynamic symbol table unless 4165 requested. Synthetic symbols have no version information. 4166 4167 * elflint.c: Add support for checking 64-bit SysV-style hash tables. 4168 * readelf.c: Add support for printing 64-bit SysV-style hash tables. 4169 41702006-07-04 Ulrich Drepper <drepper@redhat.com> 4171 4172 * elflint.c (is_rel_dyn): Fix and extend DT_RELCOUNT/DT_RELACOUNT 4173 testing. 4174 41752006-07-03 Ulrich Drepper <drepper@redhat.com> 4176 4177 * elflint.c: Add testing of DT_GNU_HASH. 4178 * readelf.c: Implement showing histogram for DT_GNU_HASH section. 4179 4180 * Makefile.am: Add hacks to create dependency files for non-generic 4181 linker. 4182 41832006-06-12 Ulrich Drepper <drepper@redhat.com> 4184 4185 * ldgeneric.c (ld_generic_generate_sections): Don't create .interp 4186 section if creating a DSO and no interpreter is given. 4187 (ld_generic_create_outfile): Don't store reference to symbols in 4188 discarded COMDAT groups. Don't create PHDR and INTERP program header 4189 for DSO if no interpreter is specified. 4190 (create_verneed_data): Pretty printing. 4191 4192 * ldscript.y (content): If a DSO is created don't set default 4193 interpreter from linker script. 4194 4195 * i386_ld.c (elf_i386_count_relocations): Do not add relocations 4196 for symbols in discarded COMDAT groups. 4197 (elf_i386_create_relocations): Likewise. 4198 * ld.h (struct scninfo): Add unused_comdat. 4199 * ldgeneric.c (add_section): Also check group signature when 4200 matching COMDAT sections. 4201 (add_relocatable_file): Ignore symbols in COMDAT group which are 4202 discarded. 4203 4204 * elflint.c (check_one_reloc): For *_NONE relocs only check type 4205 and symbol reference. 4206 42072006-06-11 Ulrich Drepper <drepper@redhat.com> 4208 4209 * elflint.c (check_dynamic): Fix checking value of tags which are 4210 offsets in the string section. Make sure DT_STRTAB points to the 4211 section referenced in sh_link. 4212 4213 * ld.c (options): Add headers. Add short option 'R' for '--rpath'. 4214 4215 * ld.c: Recognize --eh-frame-hdr option. 4216 * ld.h (struct ld_state): Add eh_frame_hdr field. 4217 * ldgeneric.c (struct unw_eh_frame_hdr): Define. 4218 4219 * ldgeneric.c (add_section): Use ebl_sh_flags_combine instead of 4220 SH_FLAGS_COMBINE. 4221 (add_relocatable_file): Minor optimization of last change. 4222 (match_section): Don't preserve SHF_GROUP flag any longer. 4223 42242006-06-10 Ulrich Drepper <drepper@redhat.com> 4225 4226 * ld.c (parse_z_option): Recognize execstack and noexecstack. 4227 Handle record and ignore as position dependent options. 4228 (parse_z_option_2): Handle ignore and record here. 4229 * ld.h (struct ld_state): Add execstack field. 4230 * ldgeneric.c (add_relocatable_file): Recognize .note.GNU-stack 4231 sections. 4232 (ld_generic_create_outfile): Fix program header creation in native 4233 linker. Add PT_GNU_STACK program header. 4234 42352006-06-09 Ulrich Drepper <drepper@redhat.com> 4236 4237 * i386_ld.c (elf_i386_finalize_plt): Don't change symbol table entries 4238 for PLT entries if there is no local definition. 4239 4240 * ld.c (parse_option): Handle -z ignore like --as-needed and 4241 -z record like --no-as-needed. 4242 * ld.h (struct ld_state): Remove ignore_unused_dsos field. 4243 * ldgeneric.c (new_generated_scn): Always compute ndt_needed by 4244 looping over DSOs. When deciding about adding DT_NEEDED entries 4245 use ->as_needed instead of ignore_unused_dsos. 4246 42472006-05-31 Ulrich Drepper <drepper@redhat.com> 4248 4249 * ld.c: Recognize --as-needed and --no-as-needed options. 4250 * ld.h (struct usedfile): Add as_needed field. 4251 (struct ld_state): Likewise. 4252 * ldgeneric.c (ld_handle_filename_list): Copy as_needed flag from 4253 the list. 4254 * ldscript.y (filename_id_list): Split to correctly parse all 4255 combinations. 4256 (mark_as_needed): Fix loop. 4257 42582006-05-28 Ulrich Drepper <drepper@redhat.com> 4259 4260 * addr2line.c (print_dwarf_function): Use unsigned type for lineno 4261 and colno. 4262 42632006-05-27 Ulrich Drepper <drepper@redhat.com> 4264 4265 * readelf.c (handle_relocs_rela): Better notations for addon value. 4266 (print_ehdr): Distinguish e_ident[EI_VERSION] from e_version. 4267 42682006-04-04 Ulrich Drepper <drepper@redhat.com> 4269 4270 * addr2line.c: Update copyright year. 4271 * elfcmp.c: Likewise. 4272 * elflint.c: Likewise. 4273 * findtextrel.c: Likewise. 4274 * ld.c: Likewise. 4275 * nm.c: Likewise. 4276 * objdump.c: Likewise. 4277 * ranlib.c: Likewise. 4278 * readelf.c: Likewise. 4279 * size.c: Likewise. 4280 * strings.c: Likewise. 4281 * strip.c: Likewise. 4282 42832006-03-09 Roland McGrath <roland@redhat.com> 4284 4285 * Makefile.am (AM_LDFLAGS): New variable. 4286 42872006-03-01 Roland McGrath <roland@redhat.com> 4288 4289 * readelf.c (dwarf_tag_string, dwarf_attr_string): Update name tables 4290 for dwarf.h changes matching 3.0 spec. 4291 (dwarf_encoding_string, dwarf_lang_string, print_ops): Likewise. 4292 42932005-12-04 Ulrich Drepper <drepper@redhat.com> 4294 4295 * elflint.c (check_one_reloc): If relocation section is not loaded, 4296 don't check whether the relocations modify read-only sections or 4297 loaded and unloaded sections. 4298 42992005-11-28 Ulrich Drepper <drepper@redhat.com> 4300 4301 * elflint.c (check_one_reloc): Take additional parameters. Use 4302 them to determine whether relocation is valid in this type of 4303 file. DSOs and executables can contain relocation sections in 4304 unloaded sections which just show the relocations the linker 4305 applied. Adjust all callers. 4306 (check_program_header): Check that PT_PHDR is loaded and that offset 4307 matches the one in the ELF header. 4308 43092005-10-26 Roland McGrath <roland@redhat.com> 4310 4311 * nm.c (get_var_range): dwarf_getloclist -> dwarf_getlocation. 4312 43132005-09-03 Ulrich Drepper <drepper@redhat.com> 4314 4315 * strip.c (handle_elf): Unify some error messages. 4316 * ld.c (main): Likewise. 4317 * ldgeneric.c (open_elf): Likewise. 4318 * elfcmp.c (main): Likewise. 4319 * elflint.c (check_elf_header): Likewise. 4320 4321 * size.c (process_file): Fix typo in error message. 4322 4323 * readelf.c: Lots of little cleanups. Use _unlocked functions. 4324 43252005-09-02 Ulrich Drepper <drepper@redhat.com> 4326 4327 * strings.c (main): Reset elfmap variable after munmap call. 4328 [_MUDFLAP] (map_file): Simplify mudflap debugging by not using mmap. 4329 43302005-08-28 Ulrich Drepper <drepper@redhat.com> 4331 4332 * ranlib.c: Don't define pread_retry and write_retry here. 4333 4334 * Makefile.an [BUILD_STATIC] (libdw): Add -ldl. 4335 (CLEANFILES): Add *.gcno *.gcda *.gconv. 4336 4337 * strings.c (process_chunk): Reorder expressions in conditional 4338 (process_chunk_mb): Likewise. 4339 4340 * strings.c: New file. 4341 * Makefile.am (bin_PROGRAMS): Add strings. 4342 (strings_no_Wstring): Define. 4343 (strings_LDADD): Define. 4344 43452005-08-27 Roland McGrath <roland@redhat.com> 4346 4347 * addr2line.c (dwarf_diename_integrate): Function removed. 4348 (print_dwarf_function): Use plain dwarf_diename. 4349 43502005-08-24 Ulrich Drepper <drepper@redhat.com> 4351 4352 * elflint.c (check_versym): Versioned symbols should not have 4353 local binding. 4354 43552005-08-15 Ulrich Drepper <drepper@redhat.com> 4356 4357 * elflint.c (check_versym): Allow VER_NDX_LOCAL symbols to be 4358 undefined. 4359 4360 * Makefile.am: Add rules to build ranlib. 4361 * ranlib.c: New file. 4362 43632005-08-14 Roland McGrath <roland@redhat.com> 4364 4365 * elflint.c (check_sections): Use ebl_section_type_name and allow any 4366 sh_type it recognizes. 4367 4368 * elflint.c (check_sections): Print unknown flags in hex, don't 4369 truncate high bits. Print section number and name for unknown type. 4370 43712005-08-13 Roland McGrath <roland@redhat.com> 4372 4373 * elflint.c (check_program_header): Use ebl_segment_type_name and 4374 allow any p_type it recognizes. Include p_type value in error 4375 message for unknown type. 4376 43772005-08-13 Ulrich Drepper <drepper@redhat.com> 4378 4379 * elflint.c (check_symtab): Simplify last change a bit. Pass ehdr 4380 to ebl_check_special_symbol. 4381 (check_sections): Pass ehdr to ebl_bss_plt_p. 4382 43832005-08-12 Roland McGrath <roland@redhat.com> 4384 4385 * elflint.c (check_symtab): Check that _GLOBAL_OFFSET_TABLE_ st_shndx 4386 refers to the right section if it's not SHN_ABS. 4387 Let ebl_check_special_symbol override _G_O_T_ value and size checks. 4388 4389 * elflint.c (check_sections): Don't complain about a non-NOBITS 4390 section taking no segment space, if it's sh_size is 0. 4391 4392 * elflint.c (check_sections): Use ebl_bss_plt_p to see if .plt should 4393 be PROGBITS or NOBITS. 4394 4395 * elflint.c (check_symtab): Use ebl_check_special_symbol to override 4396 standard st_value and st_size checks. 4397 43982005-07-28 Roland McGrath <roland@redhat.com> 4399 4400 * addr2line.c (options, parse_opt): Don't handle -e here. 4401 (executable): Variable removed. 4402 (argp_children): New static variable. 4403 (argp): Use it. Make const. 4404 (main): Fill in argp_children from dwfl_standard_argp (). 4405 Let libdwfl handle file selection, pass Dwfl handle to handle_address. 4406 (print_dwarf_function): New function. Try to figure out inline chain. 4407 (elf_getname): Function removed, libdwfl does it for us. 4408 (handle_address): Take Dwfl handle instead of Elf, Dwarf handles. 4409 Use dwfl_module_addrname instead of elf_getname. 4410 Use dwfl_module_getsrc and dwfl_lineinfo instead of libdw calls. 4411 * Makefile.am (INCLUDES): Add libdwfl directory to path. 4412 44132005-08-10 Ulrich Drepper <drepper@redhat.com> 4414 4415 * strip.c (parse_opt): STATE parameter is now used. 4416 Various little cleanups. 4417 4418 * readelf.c (print_debug_line_section): Correct fallout of renaming 4419 of DW_LNS_set_epilog_begin. 4420 44212005-08-08 Roland McGrath <roland@redhat.com> 4422 4423 * strip.c (options, parse_opt): Grok -R .comment for compatibility 4424 with binutils strip. Likewise -d, -S, as aliases for -g. 4425 Likewise ignore -s/--strip-all. 4426 44272005-08-07 Roland McGrath <roland@redhat.com> 4428 4429 * strip.c (process_file): Open read-only when using a different output 4430 file. 4431 44322005-08-06 Ulrich Drepper <drepper@redhat.com> 4433 4434 * elflint.c (in_nobits_scn): New function. 4435 (check_versym): Allow references for defined symbols against versions 4436 of other DSOs also for symbols in nobits sections. 4437 Move a few variables around. 4438 4439 * Makefile.am (AM_CFLAGS): Avoid duplication. 4440 Link with statis libs if BUILD_STATIC. 4441 44422005-08-05 Ulrich Drepper <drepper@redhat.com> 4443 4444 * elflint.c: Many, many more tests. Mostly related to symbol 4445 versioning. Those sections should now be completely checked. 4446 4447 * readelf.c (print_dynamic): Use gelf_offscn. 4448 44492005-08-04 Ulrich Drepper <drepper@redhat.com> 4450 4451 * elflint.c: Add lots more tests: more extension symbol table sanity, 4452 versioning section tests, hash table tests. General cleanup. 4453 44542005-08-02 Ulrich Drepper <drepper@redhat.com> 4455 4456 * objdump.c: New file. 4457 * Makefile.am (bin_PROGRAMS): Add objdump. 4458 (objdump_LDADD): Define. 4459 4460 * elflint.c (check_reloc_shdr): New function split out from check_rela 4461 and check_rel. 4462 (check_one_reloc): New function. Likewise. 4463 (check_rela): Use check_reloc_shdr and check_one_reloc. 4464 (check_rel): Likewise. 4465 (check_program_header): Check that PT_DYNAMIC entry matches .dynamic 4466 section. 4467 Add checks that relocations against read-only segments are flagged, 4468 that the text relocation flag is not set unnecessarily, and that 4469 relocations in one section are either against loaded or not-loaded 4470 segments. 4471 44722005-08-01 Ulrich Drepper <drepper@redhat.com> 4473 4474 * elfcmp.c (main): Ignore section count and section name string table 4475 section index. 4476 44772005-07-27 Roland McGrath <roland@redhat.com> 4478 4479 * elfcmp.c: Include <locale.h>. 4480 44812005-07-27 Ulrich Drepper <drepper@redhat.com> 4482 4483 * elfcmp.c: Print name and index of differing section. 4484 44852005-07-24 Ulrich Drepper <drepper@redhat.com> 4486 4487 * elfcmp.c: Implement comparing gaps between sections. 4488 44892005-07-23 Ulrich Drepper <drepper@redhat.com> 4490 4491 * elflint.c: Include libeblP.h instead of libebl.h. 4492 * nm.c: Likewise. 4493 * readelf.c: Likewise. 4494 * elfcmp.c: Likewise. 4495 4496 * elfcmp.c (main): Compare individual ELF header fields, excluding 4497 e_shoff instead of the whole struct at once. 4498 Use ebl_section_strip_p instead of SECTION_STRIP_P. 4499 * strip.c: Use ebl_section_strip_p instead of SECTION_STRIP_P. 4500 45012005-07-22 Ulrich Drepper <drepper@redhat.com> 4502 4503 * elfcmp.c (main): Take empty section into account when comparing 4504 section content. 4505 4506 * elflint.c (check_dynamic): Check that d_tag value is >= 0 before 4507 using it. 4508 45092005-07-21 Ulrich Drepper <drepper@redhat.com> 4510 4511 * elfcmp.c: New file. 4512 * Makefile.am (bin_PROGRAMS): Add elfcmp. 4513 (elfcmp_LDADD): Define. 4514 4515 * elflint.c (check_rela): Check that copy relocations only reference 4516 object symbols or symbols with unknown type. 4517 (check_rel): Likewise. 4518 45192005-06-08 Roland McGrath <roland@redhat.com> 4520 4521 * readelf.c (print_ops): Add consts. 4522 45232005-05-31 Roland McGrath <roland@redhat.com> 4524 4525 * readelf.c (print_debug_abbrev_section): Don't bail after first CU's 4526 abbreviations. Print a header line before each CU section. 4527 4528 * readelf.c (print_debug_loc_section): Fix indentation for larger 4529 address size. 4530 45312005-05-30 Roland McGrath <roland@redhat.com> 4532 4533 * readelf.c (print_debug_line_section): Print section offset of each 4534 CU's table, so they are easy to find from seeing the stmt_list value. 4535 4536 * readelf.c (dwarf_attr_string): Add all attributes in <dwarf.h>. 4537 (attr_callback): Grok DW_AT_ranges and print offset in hex. 4538 4539 * readelf.c (attr_callback): Add 2 to addrsize * 2 for %#0* format. 4540 (print_debug_ranges_section, print_debug_loc_section): Likewise. 4541 4542 * readelf.c (print_ops): Take different args for indentation control. 4543 (attr_callback): Caller updated. 4544 Grok several more block-form attributes as being location expressions. 4545 For those same attributes with udata forms, format output differently 4546 for location list offset. 4547 (print_debug_loc_section): Implement it for real. 4548 4549 * readelf.c (options): Mention ranges for --debug-dump. 4550 (enum section_e): Add section_ranges. 4551 (parse_opt): Grok "ranges" for -w/--debug-dump. 4552 (print_debug_ranges_section): New function. 4553 (print_debug): Handle .debug_ranges section. 4554 45552005-05-30 Ulrich Drepper <drepper@redhat.com> 4556 4557 * readelf.c (handle_notes): At least x86-64 need not have the note 4558 section values aligned to 8 bytes. 4559 45602005-05-18 Ulrich Drepper <drepper@redhat.com> 4561 4562 * readelf.c (dwarf_tag_string): Add new tags. 4563 45642005-05-08 Roland McGrath <roland@redhat.com> 4565 4566 * strip.c (handle_elf): Don't translate hash and versym data formats, 4567 elf_getdata already did it for us. 4568 45692005-05-07 Ulrich Drepper <drepper@redhat.com> 4570 4571 * Makefile.am (findtextrel_LDADD): Add $(libmudflap). 4572 (addr2line_LDADD): Likewise. 4573 45742005-05-03 Roland McGrath <roland@redhat.com> 4575 4576 * strip.c (handle_elf): Apply symbol table fixups to discarded 4577 relocation sections when they are being saved in the debug file. 4578 4579 * strip.c (handle_elf): Pass EHDR->e_ident[EI_DATA] to gelf_xlatetom 4580 and gelf_xlatetof, not the native byte order. 4581 4582 * strip.c (parse_opt): Give error if -f or -o is repeated. 4583 (main): Exit if argp_parse returns nonzero. 4584 4585 * strip.c (debug_fname_embed): New variable. 4586 (options, parse_opt): New option -F to set it. 4587 45882005-05-07 Ulrich Drepper <drepper@redhat.com> 4589 4590 * readelf.c (parse_opt): Make any_control_option variable 4591 local. Simplify some tests. 4592 45932005-05-03 Roland McGrath <roland@redhat.com> 4594 4595 * strip.c (crc32_file): Function removed (now in ../lib). 4596 45972005-05-03 Roland McGrath <roland@redhat.com> 4598 4599 * elflint.c (is_debuginfo): New variable. 4600 (options, parse_opt): New option --debuginfo/-d to set it. 4601 (check_sections): If is_debuginfo, don't complain about SHT_NOBITS. 4602 (check_note): If is_debuginfo, don't try to get note contents. 4603 46042005-04-24 Ulrich Drepper <drepper@redhat.com> 4605 4606 * readelf.c (print_debug_abbrev_section): Don't print error when end of 4607 section reached. 4608 46092005-04-14 Ulrich Drepper <drepper@redhat.com> 4610 4611 * readelf.c (dwarf_encoding_string): New function. 4612 (dwarf_inline_string): New function. 4613 (dwarf_access_string): New function. 4614 (dwarf_visibility_string): New function. 4615 (dwarf_virtuality_string): New function. 4616 (dwarf_identifier_case_string): New function. 4617 (dwarf_calling_convention_string): New function. 4618 (dwarf_ordering_string): New function. 4619 (dwarf_discr_list_string): New function. 4620 (attr_callback): Decode man more attribute values. 4621 46222005-04-01 Ulrich Drepper <drepper@redhat.com> 4623 4624 * addr2line.c: Finish implementation of -f option. 4625 46262005-03-29 Ulrich Drepper <drepper@redhat.com> 4627 4628 * addr2line.c: New file. 4629 * Makefile.am (bin_PROGRAMS): Add addr2line. 4630 Define addr2line_LDADD. 4631 4632 * findtextrel.c: Use new dwarf_addrdie function. 4633 4634 * findtextrel.c: Fix usage message and re-add accidentally removed 4635 line. 4636 46372005-03-28 Ulrich Drepper <drepper@redhat.com> 4638 4639 * findtextrel.c: New file. 4640 * Makefile: Add rules to build findtextrel. 4641 46422005-02-15 Ulrich Drepper <drepper@redhat.com> 4643 4644 * ldlex.l: Provide ECHO definition to avoid warning. 4645 4646 * elflint.c (check_program_header): Fix typo in RELRO test. 4647 4648 * Makefile.am (AM_CFLAGS): Add more warning options. 4649 * elflint.c: Fix warnings introduced by the new warning options. 4650 * i386_ld.c: Likewise. 4651 * ld.c: Likewise. 4652 * ld.h: Likewise. 4653 * ldgeneric.c: Likewise. 4654 * nm.c: Likewise. 4655 * readelf.c: Likewise. 4656 * sectionhash.c: Likewise. 4657 * size.c: Likewise. 4658 * string.c: Likewise. 4659 46602005-02-05 Ulrich Drepper <drepper@redhat.com> 4661 4662 * Makefile.am: Check for text relocations in constructed DSOs. 4663 4664 * Makefile.am [MUDFLAP] (AM_CFLAGS): Add -fmudflap. Link all apps 4665 with -lmudflap. 4666 4667 * ldscript.y: Add as_needed handling. 4668 * ldlex.l: Recognize AS_NEEDED token. 4669 * ld.h (struct filename_list): Add as_needed flag. 4670 46712005-02-04 Ulrich Drepper <drepper@redhat.com> 4672 4673 * elflint.c (check_symtab): Correctly determine size of GOT section. 4674 46752005-01-19 Ulrich Drepper <drepper@redhat.com> 4676 4677 * ld.c: Remove unnecessary more_help function. Print bug report 4678 address using argp. 4679 * strip.c: Likewise. 4680 * size.c: Likewise. 4681 * nm.c: Likewise. 4682 * readelf.c: Likewise. 4683 * elflint.c: Likewise. 4684 4685 * elflint.c (main): Don't check for parameter problems here. 4686 (parse_opt): Do it here, where we get informed about some of them 4687 anyway. 4688 4689 * readelf.c (main): Don't check for parameter problems here. 4690 (parse_opt): Do it here, where we get informed about some of them 4691 anyway. 4692 46932005-01-11 Ulrich Drepper <drepper@redhat.com> 4694 4695 * strip.c: Update copyright year. 4696 * readelf.c: Likewise. 4697 * size.c: Likewise. 4698 * nm.c: Likewise. 4699 * ld.c: Likewise. 4700 * elflint.c: Likewise. 4701 4702 * elflint.c (check_symtab): Don't warn about wrong size for 4703 _DYNAMIC and __GLOBAL_OFFSET_TABLE__ for --gnu-ld. 4704 47052004-10-05 Ulrich Drepper <drepper@redhat.com> 4706 4707 * readelf.c (print_phdr): In section mapping, also indicate 4708 sections in read-only segments. 4709 47102004-09-25 Ulrich Drepper <drepper@redhat.com> 4711 4712 * readelf.c: Make compile with gcc 4.0. 4713 * strip.c: Likewise. 4714 47152004-08-16 Ulrich Drepper <drepper@redhat.com> 4716 4717 * strip.c (handle_elf): Rewrite dynamic memory handling to use of 4718 allocate to work around gcc 3.4 bug. 4719 47202004-01-25 Ulrich Drepper <drepper@redhat.com> 4721 4722 * ldlex.l (invalid_char): Better error message. 4723 47242004-01-23 Ulrich Drepper <drepper@redhat.com> 4725 4726 * readelf.c: Print SHT_GNU_LIBLIST sections. 4727 4728 * none_ld.c: New file. 4729 47302004-01-21 Ulrich Drepper <drepper@redhat.com> 4731 4732 * Makefile.am: Enable building of machine specific linker. 4733 47342004-01-20 Ulrich Drepper <drepper@redhat.com> 4735 4736 * Makefile.am: Support building with mudflap. 4737 4738 * i386_ld.c: Fix warnings gcc 3.4 spits out. 4739 * ldgeneric.c: Likewise. 4740 * ldscript.y: Likewise. 4741 * readelf.c: Likewise. 4742 * strip.c: Likewise. 4743 4744 * readelf.c (print_debug_line_section): Determine address size 4745 correctly. 4746 47472004-01-19 Ulrich Drepper <drepper@redhat.com> 4748 4749 * readelf.c (print_phdr): Show which sections are covered by the 4750 PT_GNU_RELRO entry. 4751 4752 * elflint.c (check_program_header): Check PT_GNU_RELRO entry. 4753 4754 * readelf.c (print_debug_macinfo_section): Implement. 4755 47562004-01-18 Ulrich Drepper <drepper@redhat.com> 4757 4758 * readelf.c (print_debug_line_section): Implement. 4759 47602004-01-17 Ulrich Drepper <drepper@redhat.com> 4761 4762 * src/elflint.c: Use PACKAGE_NAME instead of PACKAGE. 4763 * src/ld.c: Likewise. 4764 * src/nm.c: Likewise. 4765 * src/readelf.c: Likewise. 4766 * src/size.c: Likewise. 4767 * src/strip.c: Likewise. 4768 4769 * strip.c: Add a few more unlikely. Reduce scope of some variables. 4770 4771 * Makefile.am: Support building with mudflap. 4772 47732004-01-16 Ulrich Drepper <drepper@redhat.com> 4774 4775 * readelf.c (print_debug_info_section): Free dies memory. 4776 4777 * readelf.c: Print .debug_info section content. 4778 47792004-01-13 Ulrich Drepper <drepper@redhat.com> 4780 4781 * readelf.c (print_shdr): Add support for SHF_ORDERED and SHF_EXCLUDE. 4782 47832004-01-12 Ulrich Drepper <drepper@redhat.com> 4784 4785 * readelf.c (print_debug_aranges): Implement using libdw. 4786 47872004-01-11 Ulrich Drepper <drepper@redhat.com> 4788 4789 * nm.c: Adjust for Dwarf_Files type and dwarf_lineno interface change. 4790 4791 * readelf.c: Use libdw instead of libdwarf. Not all of the old 4792 behavior is available yet. 4793 * Makefile.am: Link readelf with libdw. Remove libdwarf include path. 4794 47952004-01-09 Ulrich Drepper <drepper@redhat.com> 4796 4797 * nm.c (get_local_names): Adjust call to dwarf_nextcu. 4798 4799 * nm.c: Implement getting information about local variables. 4800 48012004-01-07 Ulrich Drepper <drepper@redhat.com> 4802 4803 * nm.c: Read also debug information for local symbols. 4804 48052004-01-05 Ulrich Drepper <drepper@redhat.com> 4806 4807 * nm.c: Shuffle dwarf handling code around so the maximum column 4808 width can be computed ahead of printing. Avoid collection symbols 4809 which are not printed anyway. 4810 4811 * nm.c: Rewrite dwarf handling to use libdw. 4812 * Makefile.am (AM_CFLAGS): Add -std parameter. 4813 (INCLUDES): Find header in libdw subdir. 4814 (nm_LDADD): Replace libdwarf with libdw. 4815 4816 * elflint.c: Update copyright year. 4817 * readelf.c: Likewise. 4818 * size.c: Likewise. 4819 * strip.c: Likewise. 4820 * nm.c: Likewise. 4821 48222003-12-31 Ulrich Drepper <drepper@redhat.com> 4823 4824 * strip.c (process_file): Close file before returning. 4825 48262003-11-19 Ulrich Drepper <drepper@redhat.com> 4827 4828 * readelf.c (handle_dynamic): Make column for tag name wider. 4829 48302003-09-29 Ulrich Drepper <drepper@redhat.com> 4831 4832 * readelf.c (handle_dynamic): Always terminate tag name with a space. 4833 48342003-09-25 Ulrich Drepper <drepper@redhat.com> 4835 4836 * strip.c (process_file): Don't mmap the input file, we modify the 4837 data structures and don't want the change end up on disk. 4838 48392003-09-23 Jakub Jelinek <jakub@redhat.com> 4840 4841 * unaligned.h (union u_2ubyte_unaligned, 4842 union u_4ubyte_unaligned, union u_8ubyte_unaligned): Add 4843 packed attribute. 4844 (add_2ubyte_unaligned, add_4ubyte_unaligned, 4845 add_8ubyte_unaligned): Avoid nesting bswap_NN macros. 4846 Read/store value through _ptr->u instead of *_ptr. 4847 48482003-09-22 Ulrich Drepper <drepper@redhat.com> 4849 4850 * size.c (show_sysv): Change type of maxlen to int. 4851 4852 * strip.c (handle_elf): Handle the 64-bit archs which is 64-bit 4853 buckets. 4854 4855 * i386_ld.c: Many many fixes and extensions. 4856 * ld.c: Likewise. 4857 * ldgeneric.c: Likewise. 4858 48592003-08-16 Ulrich Drepper <drepper@redhat.com> 4860 4861 * ldgeneric.c (check_definition): Don't add symbol on dso_list if 4862 the reference is from another DSO. 4863 48642003-08-15 Ulrich Drepper <drepper@redhat.com> 4865 4866 * ldgeneric.c (find_entry_point): It is no fatal error if no entry 4867 point is found when creating a DSO. 4868 48692003-08-14 Ulrich Drepper <drepper@redhat.com> 4870 4871 * ld.c (main): Always call FLAG_UNRESOLVED. 4872 * ldgeneric.c (ld_generic_flag_unresolved): Only complain about 4873 undefined symbols if not creating DSO or ld_state.nodefs is not set. 4874 48752003-08-13 Ulrich Drepper <drepper@redhat.com> 4876 4877 * Makefile.in: Depend on libebl.a, not libebl.so. 4878 4879 * ld.c (main): Mark stream for linker script as locked by caller. 4880 (read_version_script): Likewise. 4881 * ldlex.c: Define fread and fwrite to _unlocked variant. 4882 4883 * i386_ld.c (elf_i386_finalize_plt): Replace #ifdefs with uses of 4884 target_bswap_32. 4885 * unaligned.h: Define target_bswap_16, target_bswap_32, and 4886 target_bswap_64. 4887 (store_2ubyte_unaligned, store_4ubyte_unaligned, 4888 store_8ubyte_unaligned): Define using new macros. 4889 48902003-08-12 Ulrich Drepper <drepper@redhat.com> 4891 4892 * i386_ld.c (elf_i386_finalize_plt): Use packed structs to access 4893 possibly unaligned memory. Support use of big endian machines. 4894 48952003-08-11 Ulrich Drepper <drepper@redhat.com> 4896 4897 * Moved to CVS archive. 4898