12021-10-20 John M Mellor-Crummey <johnmc@rice.edu> 2 3 * readelf.c (print_debug_line_section): Try to read 4 debug_str_offset if available. Handle DW_LNE_NVIDIA_inlined_call 5 and DW_LNE_NVIDIA_set_function_name. 6 72021-10-06 Mark Wielaard <mark@klomp.org> 8 9 * elflint.c (check_sections): Don't dereference databits if bad. 10 112021-09-09 Dmitry V. Levin <ldv@altlinux.org> 12 13 * findtextrel.c: Include "libeu.h". 14 (open_rootdir_file): New function. 15 (process_file): Use it to open file inside rootdir. 16 * Makefile.am (findtextrel_no_Wstack_usage): Remove. 17 182021-09-06 Dmitry V. Levin <ldv@altlinux.org> 19 20 * objdump.c (show_disasm): Replace asprintf followed by 21 error(EXIT_FAILURE) with xasprintf. 22 * readelf.c (handle_gnu_hash): Likewise. 23 * unstrip.c (handle_output_dir_module, main): Likewise. 24 25 * elflint.c (check_sections): Remove cast of xcalloc return value. 26 * findtextrel.c (process_file): Remove casts of malloc and realloc 27 return values. 28 * nm.c (get_local_names, show_symbols_sysv, show_symbols): Remove 29 casts of xmalloc return values. 30 * readelf.c (print_hash_info, handle_sysv_hash, handle_sysv_hash64, 31 handle_gnu_hash): Remove cast of xcalloc return value. 32 (print_debug_units): Remove casts of xmalloc return values. 33 * strip.c (handle_elf): Remove casts of xcalloc and xmalloc return 34 values. 35 362021-09-05 Dmitry V. Levin <ldv@altlinux.org> 37 38 * Makefile.am (AM_LDFLAGS): Add $(STACK_USAGE_NO_ERROR). 39 402021-08-20 Saleem Abdulrasool <abdulras@google.com> 41 42 * elfclassify.c: Remove error.h include. 43 442021-03-18 Timm Bäder <tbaeder@redhat.com> 45 46 * readelf.c (run_advance_pc): New static inline function 47 lifted from... 48 (print_debug_line_section): ... here. Define advance_pc 49 using run_advance_pc. 50 512021-07-03 Mark Wielaard <mark@klomp.org> 52 53 * readelf.c (compare_listptr): Fix dwarf_attr_name argument. 54 552021-06-18 Mark Wielaard <mark@klomp.org> 56 57 * unstrip.c (adjust_relocs): Check gelf_getrel and geld_getrela. 58 592021-06-18 Mark Wielaard <mark@klomp.org> 60 61 * strip.c (remove_debug_relocations): Check gelf_update results. 62 (update_section_size): Likewise. 63 642021-06-06 Sergei Trofimovich <slyfox@gentoo.org> 65 66 * elflint.c (buffer_left): Mark as 'static' to avoid external linkage 67 failure. 68 692021-05-12 Dmitry V. Levin <ldv@altlinux.org> 70 71 * elfcompress.c (process_file): Return 1 instead of -1 in case of an 72 error. 73 74 * elfcompress.c (process_file): Remove redundant assignment in case of 75 "Nothing to do". 76 77 * elfcompress.c (process_file): Set res to 0 in case of "Nothing to do". 78 792021-04-19 Martin Liska <mliska@suse.cz> 80 81 * elfclassify.c (run_classify): Use startswith. 82 * elfcompress.c (process_file): Likewise. 83 * nm.c (show_symbols_sysv): Likewise. 84 * readelf.c (print_debug): Likewise. 85 (handle_notes_data): Likewise. 86 (dump_data_section): Likewise. 87 (print_string_section): Likewise. 88 * strip.c (remove_debug_relocations): Likewise. 89 902021-04-03 Mark Wielaard <mark@klomp.org> 91 92 * nm.c (show_symbols): close dwfl_fd if dwfl_begin fails. 93 942021-04-03 Mark Wielaard <mark@klomp.org> 95 96 * unstrip.c (handle_output_dir_module): Free output_file when done. 97 982021-04-03 Mark Wielaard <mark@klomp.org> 99 100 * ar.c (do_oper_insert): Always close newfd. 101 1022021-03-03 Mark Wielaard <mark@klomp.org> 103 104 * readelf.c (handle_symtab): Sanity check verneed vna_next, 105 vn_next and verdef vd_next offsets. 106 1072021-03-02 Timm Bäder <tbaeder@redhat.com> 108 109 * elfcompress.c (process_file): Remove cleanup() function and 110 replace it with a cleanup label at the end of the function. 111 Initialize res to -1. 112 1132021-02-17 Timm Bäder <tbaeder@redhat.com> 114 115 * elfcompress.c (process_file): Move get_sections function... 116 (get_section): ...to top-level static function taking an 117 sections array and shnum. 118 1192021-02-17 Timm Bäder <tbaeder@redhat.com> 120 121 * elfcompress.c (process_file): Move get_section function... 122 (get_section): ...to top-level static function taking an 123 sections array. 124 1252021-02-17 Timm Bäder <tbaeder@redhat.com> 126 127 * elfcompress.c (process_file): Move set_section function... 128 (set_section): ...to top-level static function taking a 129 section array. 130 1312021-02-17 Timm Bäder <tbaeder@redhat.com> 132 133 * unstrip.c (handle_implicit_modules): Inline the next function 134 in three places. This is simply dwfl_getmodules with match_module 135 callback providing mmi. 136 1372021-02-17 Timm Bäder <tbaeder@redhat.com> 138 139 * unstrip.c (handle_explicit_files): Move warn function... 140 (warn): ...here as top-level static function taking stripped, 141 unstripped files and force flag as extra arguments. 142 1432021-02-17 Timm Bäder <tbaeder@redhat.com> 144 145 * unstrip.c (copy_elided_sections): Inline find_unalloc_section 146 function into calling location. The sec pointer is set to NULL 147 before the if-else statement and only set when match is found. 148 1492021-02-17 Timm Bäder <tbaeder@redhat.com> 150 151 * unstrip.c (find_alloc_sections_prelink): Move check_match to... 152 (check_match): Adjusted to return whether there was no match, 153 which indicates a failure. So callers are adjusted to or the 154 result into a local fail boolean. 155 1562021-02-17 Timm Bäder <tbaeder@redhat.com> 157 158 * unstrip.c (adjust_relocs): Move adjust_reloc function to... 159 (adjust_reloc): ... here as static top-level function taking 160 a map array and size as extra arguments. 161 1622021-02-17 Timm Bäder <tbaeder@redhat.com> 163 164 * elflint.c (check_attributes): Rename and move left function... 165 (buffer_left): ...as static toplevel function taking both an 166 Elf_Data pointer argument and the unsigned char pointer p. 167 1682021-02-17 Timm Bäder <tbaeder@redhat.com> 169 170 * elflint.c (check_attributes): Rename and move pos function... 171 (buffer_pos): ...as static toplevel function taking an extra 172 Elf_Data pointer argument. 173 1742021-02-12 Mark Wielaard <mark@klomp.org> 175 176 * readelf.c (print_debug_units): Type DIE offset is from start CU. 177 1782021-02-12 Mark Wielaard <mark@klomp.org> 179 180 * readelf.c (attr_callback): Don't handle blocks as expression 181 blocks for DWARF version 4 or higher. 182 1832021-02-03 Timm Bäder <tbaeder@redhat.com> 184 185 * ar.c (do_oper_extract): Extract should_truncate_fname function 186 to... 187 (should_truncate_fname): ...here. New file scope function taking 188 size_t pointer to be read and/or set. 189 1902021-02-02 Timm Bäder <tbaeder@redhat.com> 191 192 * readelf.c (print_debug_line_section): Remove unnecessary 193 show_op_index variable, replace with (op_index > 0). 194 1952021-01-08 Timm Bäder <tbaeder@redhat.com> 196 197 * readelf.c (print_cfa_program): Lift regname function to... 198 (regname): ...here. New file scope function add ebl and regnamebuf 199 as arguments. 200 2012021-01-08 Timm Bäder <tbaeder@redhat.com> 202 203 * readelf.c (print_attributes): Lift left function to... 204 (left): ...here. New file scope function taking Elf_Data and char 205 pointers. 206 2072021-01-08 Timm Bäder <tbaeder@redhat.com> 208 209 * readelf.c (handle_core_registers): Lift same_set function to... 210 (same_set): ...here. New file scope function adding regs and 211 maxnreg arguments. 212 2132021-01-08 Timm Bäder <tbaeder@redhat.com> 214 215 * readelf.c (parse_opt): Lift add_dump_section function to... 216 (add_dump_section): ...here. New top level function. Added key 217 argument. 218 2192021-01-08 Timm Bäder <tbaeder@redhat.com> 220 221 * arlib-argp.c (help_filter): Lift text_for_default function to... 222 (text_for_default): ... here. New file scope function taking text 223 as argument. 224 2252021-01-08 Timm Bäder <tbaeder@redhat.com> 226 227 * addr2line.c (handle_address): Move show_note and show_int up to 228 file scope. 229 (show_note: New static inline function. 230 (show_int): Likewise. 231 2322021-01-08 Timm Bäder <tbaeder@redhat.com> 233 234 * strip.c (handle_elf): Remove no_symtab_updates function and 235 calls inside the switch statement. Add checks and (possibly) 236 continue, before switch statement is called. 237 2382021-01-08 Timm Bäder <tbaeder@redhat.com> 239 240 * strip.c (handle_elf): Move inlined update_section_size function 241 to... 242 (update_section_size): ...here. New static function that takes as 243 extra arguments the Elf_Scn, debug_elf, section cnt and fname. 244 2452021-01-08 Timm Bäder <tbaeder@redhat.com> 246 247 * strip.c (remove_debug_relocations): Rewrite inlined relocate 248 function to file static. Do R_*_NONE, reloc_simple_type and 249 ebl_debug_scn_p checks before calling new relocate function. 250 (relocate): New file static function from 251 remove_debug_relocate. Remove R_*_NONE, reloc_simple_type and 252 ebl_debugscn_p checks. 253 2542021-01-08 Timm Bäder <tbaeder@redhat.com> 255 256 * strip.c (handle_elf): Expand inlined function check_preserved. 257 2582021-01-12 Mark Wielaard <mark@klomp.org> 259 260 * elflint.c (EXTRA_SHFLAGS): New define. 261 (check_sections): Use EXTRA_SHFLAGS. Add SHF_GNU_RETAIN to 262 ALL_SH_FLAGS. 263 2642020-12-31 Sergei Trofimovich <slyfox@gentoo.org> 265 266 * elflint.c (section_flags_string): Add NEWFLAG for GNU_RETAIN, 267 ORDERED and EXCLUDE. 268 2692020-12-31 Sergei Trofimovich <slyfox@gentoo.org> 270 271 * elflint.c (section_flags_string): Update cp pointer after 272 snprintf for unknown flags. 273 2742020-12-16 Érico Nogueira <ericonr@disroot.org> 275 276 * readelf.c (qsort_r): Use qsort for improved portability. 277 2782020-12-20 Dmitry V. Levin <ldv@altlinux.org> 279 280 * .gitignore: New file. 281 2822020-12-12 Mark Wielaard <mark@klomp.org> 283 284 * elflint.c (check_sections): Handle SHF_GNU_RETAIN. 285 * readelf.c (print_shdr): Likewise. 286 2872020-12-16 Dmitry V. Levin <ldv@altlinux.org> 288 289 * *.c: Replace gettext(...) with _(...). 290 291 * unstrip.c (_): Remove. 292 2932020-12-15 Mark Wielaard <mark@klomp.org> 294 295 * elflint.c (check_symtab): Always print symbol name (if known) 296 in error messages. 297 2982020-12-12 Dmitry V. Levin <ldv@altlinux.org> 299 300 * ar.c (write_member, do_oper_insert): Fix spelling typo in comment. 301 * elfclassify.c (issue, elf_issue, is_unstripped): Likewise. 302 * elfcompress.c (process_file): Likewise. 303 * elflint.c (be_quiet, check_gnu_hash): Likewise. 304 * readelf.c (print_phdr, handle_gnu_hash, 305 dwarf_locexpr_opcode_string): Likewise. 306 * size.c (totals_class): Likewise. 307 * strings.c (read_elf): Likewise. 308 * strip.c (handle_elf): Likewise. 309 310 * readelf.c (print_debug_addr_section): Fix spelling typo in error 311 diagnostics. 312 * strip.c (options): Fix spelling typos in argp help text. 313 * strings.c (options): Likewise. 314 * stack.c (options): Likewise. 315 3162020-11-01 Érico N. Rolim <erico.erc@gmail.com> 317 318 * unstrip.c (make_directories): Use ACCESSPERMS for mkdir. 319 (handle_file): Use DEFFILEMODE for open with O_CREAT for ET_REL 320 files, ACCESSPERMS otherwise. 321 3222020-11-01 Érico N. Rolim <erico.erc@gmail.com> 323 324 * Makefile.am (nm_LDADD): Add obstack_LIBS. 325 (ranlib_LDADD): Likewise. 326 (ar_LDADD): Likewise. 327 3282020-10-27 Érico N. Rolim <erico.erc@gmail.com> 329 330 * unstrip.c (make_directories): Use strndup, not strndupa. 331 3322020-09-28 Mark Wielaard <mark@klomp.org> 333 334 * readelf.c (next_listptr_offset): Take idx as pointer, to be updated 335 and use new Dwarf_Off as offset to match. 336 (listptr_attr): New function. 337 (print_debug_loclists_section): Check for DW_AT_GNU_locviews to show 338 view pairs. 339 (print_debug_loc_section): Adjust next_listptr_offset call. 340 3412020-09-03 Mark Wielaard <mark@klomp.org> 342 343 * readelf.c (print_cfa_program): Take ehdr as argument. Use it to 344 recognize DW_CFA_AARCH64_negate_ra_state. 345 (print_debug_frame_section): Pass ehdr to print_cfa_program. 346 (print_debug): Don't warn if we dump frames, but cannot get dbg. 347 3482020-09-01 Mark Wielaard <mark@klomp.org> 349 350 * readelf.c (print_debug_ranges_section): Base address entry can 351 be first. 352 (print_debug_loc_section): Likewise. 353 3542020-09-04 Mark Wielaard <mark@klomp.org> 355 356 * elflint.c (special_sections): Add .debug_line_str. 357 3582020-08-26 Mark Wielaard <mark@klomp.org> 359 360 * readelf.c (print_debug_line_section): It is not an error if there 361 are no line number statements at the end of a debug line section. 362 3632020-07-19 Mark Wielaard <mark@klomp.org> 364 365 * elfclassify.c (process_current_path): Handle fwrite failing. 366 3672020-07-05 Mark Wielaard <mark@klomp.org> 368 369 * stack.c (module_callback): Don't assert if dwfl_module_info fails. 370 * unstrip.c (adjust_relocs): Produce a proper error when HAS 371 section has inconsistent size or entsize. 372 (match_module): Don't assert if dwfl_module_info fails. 373 3742020-06-16 Mark Wielaard <mark@klomp.org> 375 376 * ar.c (do_oper_extract): Split large if statement. Call fchown 377 before fchmod and explicitly ignore the return value. 378 (do_oper_delete): Likewise. 379 (do_oper_insert): Likewise. 380 * ranlib.c (handle_file): Likewise. 381 3822020-06-16 Mark Wielaard <mark@klomp.org> 383 384 * elflint.c (check_elf_header): Explicitly check and ignore 385 any error from elf_compress. 386 3872020-06-07 Mark Wielaard <mark@klomp.org> 388 389 * nm.c (sort_by_name_strtab): Replace by... 390 (sort_by_name_elf): New static Elf pointer and ... 391 (sort_by_name_ndx): New static size_t index. 392 (sort_by_name): Use elf_strptr to get symbol string. 393 (show_symbols): Set sort_by_name_elf and sort_by_name_ndx. 394 3952020-06-06 Mark Wielaard <mark@klomp.org> 396 397 * nm.c (show_symbols_sysv): Skip no name and STT_FILE symbols. 398 When not printing address and size pad strings. Strip "GNU_" 399 prefix from binding name. 400 (class_type_char): Use 'V' for weak symbols, 'C' for common 401 symbols and 'T' for weak functions. 402 (show_symbols_posix): Skip STT_FILE symbols. Don't print value and 403 size when undefined. 404 4052020-06-04 Mark Wielaard <mark@klomp.org> 406 407 * elflint.c (check_program_header): Remove PT_GNU_PROPERTY define. 408 4092020-05-14 Mark Wielaard <mark@klomp.org> 410 411 * size.c (show_bsd): Set printf format based on radix. 412 4132020-05-09 Mark Wielaard <mark@klomp.org> 414 415 * elflint.c (process_elf_file): Error out if ebl_openbackend fails. 416 * objdump.c (handle_elf): Likewise. 417 * nm.c (handle_elf): Likewise. Move full name string construction 418 forward, so it can be used in the error message. 419 4202020-04-17 Mark Wielaard <mark@klomp.org> 421 422 * readelf.c (print_debug): Check .gnu.debuglto_ prefix. 423 4242020-04-16 Mark Wielaard <mark@klomp.org> 425 426 * elflint.c (check_sections): Mask out SHF_EXCLUDE from processor 427 specific section flags when --gnu is given. 428 4292020-02-08 Mark Wielaard <mark@klomp.org> 430 431 * elflint.c (check_program_header): Handle PT_GNU_PROPERTY. 432 4332020-02-07 Mark Wielaard <mark@klomp.org> 434 435 * elflint.c (check_symtab): Check st_info isn't too big. 436 4372020-01-16 Mark Wielaard <mark@klomp.org> 438 439 * nm.c (show_symbols_sysv): Iterate over all symbols starting 440 at index zero. 441 4422019-11-26 Mark Wielaard <mark@klomp.org> 443 444 * Makefile.am (BUILD_STATIC): Add libraries needed for libdw. 445 4462019-10-26 Mark Wielaard <mark@klomp.org> 447 448 * unstrip.c (collect_symbols): Check symbol strings are 449 terminated. 450 4512019-10-18 Mark Wielaard <mark@klomp.org> 452 453 * unstrip.c (adjust_relocs): Set versym data d_size to the actual 454 size allocated. 455 4562019-10-20 Mark Wielaard <mark@klomp.org> 457 458 * unstrip.c (copy_elided_sections): Set and check max_off. 459 4602019-10-21 Mark Wielaard <mark@klomp.org> 461 462 * unstrip.c (adjust_relocs): Add map_size argument and check ndx 463 against it. 464 (adjust_all_relocs): Add map_size argument and pass it to 465 adjust_relocs. 466 (add_new_section_symbols): Call adjust_all_relocs with symndx_map 467 size. 468 (collect)symbols): Check sym and string data can be found. 469 (compare_symbols_output): Call error when (different) symbols are 470 equal. 471 (new_shstrtab): Make unstripped_strent array one larger. Check 472 stripped_shnum isn't zero. 473 (copy_elided_sections): Add ndx_sec_num as size of ndx_section 474 array. Check sh_link and sh_info are not larger than ndx_sec_num. 475 Allocate symbols and symndx_map arrays on heap, not stack. Pass 476 map sizes to adjust_all_relocs. 477 4782019-09-28 Dmitry V. Levin <ldv@altlinux.org> 479 480 * elflint.c (main): When an input file cannot be opened, 481 include its name into the error diagnostics. 482 * readelf.c (main): Likewise. 483 4842019-09-02 Mark Wielaard <mark@klomp.org> 485 486 * readelf.c (PRINT_DYNSYM_TABLE): New argp key value. 487 (argp_opt): Add syn-sym. 488 (print_dynsym_table): New static bool. 489 (parse_opt): Handle PRINT_DYNSYM_TABLE. 490 (process_elf_file): Check print_dynsym_table. 491 4922019-08-27 Mark Wielaard <mark@klomp.org> 493 494 * readelf.c (for_each_section_argument): Call (*dump) also for 495 section numbers. 496 4972019-08-26 Mark Wielaard <mark@klomp.org> 498 499 * nm.c (show_symbols): Remember nentries_orig and check before 500 freeing sym_mem. 501 5022019-07-05 Omar Sandoval <osandov@fb.com> 503 504 * Makefile.am: Remove -ldl. 505 (elflint_LDADD): Add $(libdw). 506 (elfcmp_LDADD): Add $(libdw). 507 (objdump_LDADD): Add $(libdw). 508 5092019-08-26 Mark Wielaard <mark@klomp.org> 510 511 * readelf (options): Add OPTION_ARG_OPTIONAL "SECTION" for notes. 512 (notes_section): New global variable. 513 (parse_opt): Set notes_section. 514 (handle_notes): Check if notes_section is set. 515 5162019-07-26 Florian Weimer <fweimer@redhat.com> 517 Mark Wielaard <mark@klomp.org> 518 519 * Makefile.am (bin_PROGRAMS): Add elfclassify. 520 (elfclassify_LDADD): New variable. 521 * elfclassify.c: New tool. 522 5232019-07-13 Mao Han <han_mao@c-sky.com> 524 525 * elflint.c: Add C-SKY. 526 5272019-06-28 Mark Wielaard <mark@klomp.org> 528 529 * readelf.c (print_ehdr): Use dwelf_elf_e_machine_string instead of 530 ebl->name. If unknown print hex value. 531 5322019-06-25 Mark Wielaard <mark@klomp.org> 533 534 * stack.c (parse_opt): Fix dwfl_core_file_attach error message. 535 5362019-06-18 Mark Wielaard <mark@klomp.org> 537 538 * strip.c (handle_elf): Use elf_begin ELF_C_WRITE, instead of 539 ELF_C_WRITE_MMAP. 540 5412019-05-10 Mark Wielaard <mark@klomp.org> 542 543 * readelf.c (struct attrcb_args): Rename die to dies. 544 (attr_callback): Get current current die using dies[level]. 545 Handle DW_AT_discr_list as block, not as constant. 546 (print_debug_units): pass dies, not dies[level] as args. 547 5482019-05-09 Mark Wielaard <mark@klomp.org> 549 550 * readelf.c (cleanup_list): New function. 551 (main): Call cleanup_list for dump_data_sections and string_sections. 552 5532019-04-28 Mark Wielaard <mark@klomp.org> 554 555 * unstrip.c (add_new_section_symbols): Call ELF_CHECK after 556 gelf_getsymshndx. 557 (new_shstrtab): Call ELF_CHECK after gelf_getshdr. 558 5592019-04-28 Mark Wielaard <mark@klomp.org> 560 561 * size.c (show_sysv): Call INTERNAL_ERROR if gelf_getshdr 562 returns NULL. 563 (show_sysv_one_line): Call error with EXIT_FAILURE if 564 gelf_getshdr returns NULL. 565 5662019-04-28 Mark Wielaard <mark@klomp.org> 567 568 * nm.c (show_symbols_sysv): Check gelf_getshdr doesn't return 569 NULL. Simplify naming of invalid sections, don't use alloca. 570 5712019-04-28 Mark Wielaard <mark@klomp.org> 572 573 * elfcmp.c (main): Check shdr1 and shdr2 are not NULL. 574 5752019-04-03 Mark Wielaard <mark@klomp.org> 576 577 * readelf.c (attr_callback): Print DW_AT_data_member_location as 578 decimal offset, not hex number. 579 5802019-03-29 Mark Wielaard <mark@klomp.org> 581 582 * readelf.c (print_debug_macinfo_section): Check cus[0] is not the 583 sentinel. 584 5852019-03-27 Mark Wielaard <mark@klomp.org> 586 587 * strip.c (handle_elf): Assert that symbol section number exists. 588 5892019-01-24 Mark Wielaard <mark@klomp.org> 590 591 * strip.c (handle_elf): Fix check test for SHN_XINDEX symbol. 592 5932019-01-22 Mark Wielaard <mark@klomp.org> 594 595 * readelf.c (print_debug_line_section): Check we are not at end of 596 line data when reading parameters for unknown opcodes. 597 5982019-01-20 Mark Wielaard <mark@klomp.org> 599 600 * readelf.c (print_debug_line_section): Check terminating NUL byte 601 for dir and file tables. 602 6032019-01-16 Mark Wielaard <mark@klomp.org> 604 605 * readelf (handle_core_note): Pass desc to ebl_core_note. 606 6072018-11-10 Mark Wielaard <mark@klomp.org> 608 609 * elflint.c (check_program_header): Allow PT_GNU_EH_FRAME segment 610 to be matched against SHT_X86_64_UNWIND section. 611 6122018-11-09 Mark Wielaard <mark@klomp.org> 613 614 * strip.c (remove_debug_relocations): Check if section is gnu 615 compressed and decompress and recompress it. 616 6172018-11-12 Mark Wielaard <mark@klomp.org> 618 619 * elflint.c (check_note_data): Recognize NT_GNU_BUILD_ATTRIBUTE_OPEN 620 and NT_GNU_BUILD_ATTRIBUTE_OPEN. 621 * readelf.c (handle_notes_data): Handle 622 ELF_NOTE_GNU_BUILD_ATTRIBUTE_PREFIX. Pass nhdr.n_namesz to 623 ebl_object_note. 624 6252018-11-11 Mark Wielaard <mark@klomp.org> 626 627 * readelf.c (handle_notes_data): Pass n_descsz to 628 ebl_object_note_type_name. 629 * elflint.c (check_note_data): Recognize NT_VERSION, add owner 630 name to unknown note error. 631 6322018-10-20 Mark Wielaard <mark@klomp.org> 633 634 * readelf.c (process_elf_file): Use dwelf_elf_begin to open pure_elf. 635 6362018-10-26 Mark Wielaard <mark@klomp.org> 637 638 * strip.c (OPT_RELOC_DEBUG_ONLY): New define. 639 (options): Add reloc-debug-sections-only. 640 (reloc_debug_only): New static bool. 641 (main): Check reloc_debug_only is the only strip option used. 642 (parse_opt): Handle OPT_RELOC_DEBUG_ONLY. 643 (handle_debug_relocs): New function. 644 (handle_elf): Add local variables lastsec_offset and lastsec_size. 645 Handle reloc_debug_only. 646 6472018-10-24 Mark Wielaard <mark@klomp.org> 648 649 * strip.c (handle_elf): Extract code to update shdrstrndx into... 650 (update_shdrstrndx): ... this new function. 651 6522018-10-24 Mark Wielaard <mark@klomp.org> 653 654 * strip.c (handle_elf): Extract code into separate functions... 655 (secndx_name): ... new function. 656 (get_xndxdata): Likewise. 657 (remove_debug_relocations): Likewise. 658 6592018-10-24 Mark Wielaard <mark@klomp.org> 660 661 * strip.c (handle_elf): Always copy over phdrs if there are any 662 and check phnum instead of e_type to determine whether to move 663 allocated sections. 664 6652018-11-02 Mark Wielaard <mark@klomp.org> 666 667 * unstrip.c (copy_elf): Add ELF_CHECK to make sure gelf_getehdr () 668 doesn't return NULL. 669 6702018-10-18 Mark Wielaard <mark@klomp.org> 671 672 * elflint.c (check_note_data): Recognize NT_GNU_PROPERTY_TYPE_0. 673 (check_note): Use p_align to pass either ELF_T_NHDR or ELF_T_NHDR8 to 674 elf_getdata_rawchunk. 675 * readelf (handle_notes): Likewise. 676 6772018-10-24 Mark Wielaard <mark@klomp.org> 678 679 * addr2line.c (print_addrsym): Use elf_getshdrstrndx instead of 680 Ehdr field. 681 6822018-10-24 Mark Wielaard <mark@klomp.org> 683 684 * readelf.c (section_name): Remove ehdr argument, lookup shstrndx. 685 (print_debug_abbrev_section): Don't pass ehdr. 686 (print_debug_addr_section): Likewise. 687 (print_decoded_aranges_section): Likewise. 688 (print_debug_aranges_section): Likewise. 689 (print_debug_rnglists_section): Likewise. 690 (print_debug_ranges_section): Likewise. 691 (print_debug_units): Likewise. 692 (print_decoded_line_section): Likewise. 693 (print_debug_line_section): Likewise. 694 (print_debug_loclists_section): Likewise. 695 (print_debug_loc_section): Likewise. 696 (print_debug_macinfo_section): Likewise. 697 (print_debug_macro_section): Likewise. 698 (print_debug_pubnames_section): Likewise. 699 (print_debug_str_section): Liekwise. 700 (print_debug_str_offsets_section): Likewise. 701 (print_gdb_index_section): Likewise. 702 7032018-10-16 Mark Wielaard <mark@klomp.org> 704 705 * readelf.c (print_debug_frame_section): Make sure readp is never 706 greater than cieend. 707 7082018-10-19 Mark Wielaard <mark@klomp.org> 709 710 * dwfl_module_getdwarf.c (adjust_relocs): Check sh_entsize is not 711 zero. 712 (add_new_section_symbols): Likewise. 713 (copy_elided_sections): Likewise. 714 7152018-10-18 Mark Wielaard <mark@klomp.org> 716 717 * size.c (handle_ar): Only close elf if prefix was NULL. 718 7192018-10-18 Mark Wielaard <mark@klomp.org> 720 721 * arlib.c (arlib_add_symbols): Check that sh_entsize is not zero. 722 7232018-10-14 Mark Wielaard <mark@klomp.org> 724 725 * ar.c (do_oper_extract): Assume epoch if ar_date is bogus. 726 7272018-10-14 Mark Wielaard <mark@klomp.org> 728 729 * findtextrel.c (process_file): Check that sh_entsize is not zero. 730 7312018-10-13 Mark Wielaard <mark@klomp.org> 732 733 * readelf.c (print_debug_macro_section): Use elf_getdata. Print 734 decoded flag string. 735 7362018-10-19 Mark Wielaard <mark@klomp.org> 737 738 * unstrip.c (copy_elided_sections): Renumber group section indexes. 739 7402018-10-12 Mark Wielaard <mark@klomp.org> 741 742 * strip.c (handle_elf): Don't remove SHF_GROUP flag from sections. 743 Skip group section flag when renumbering section indexes. 744 * unstrip.c (struct section): Add sig field. 745 (compare_unalloc_sections): Take and use sig1 and sig2 as arguments. 746 (compare_sections): Pass signatures to compare_unalloc_sections. 747 (get_group_sig): New function. 748 (find_alloc_sections_prelink): Set signature. 749 (copy_elided_sections): Likewise and pass them on. 750 (find_unalloc_section): Take and pass signatures. 751 7522018-10-02 Andreas Schwab <schwab@suse.de> 753 754 * strip.c (handle_elf): Handle ADD/SUB relocation. 755 7562018-09-13 Mark Wielaard <mark@klomp.org> 757 758 * readelf.c (print_shdr): Get number of section with elf_getshdrnum. 759 (print_phdr): Likewise. 760 7612018-09-13 Mark Wielaard <mark@klomp.org> 762 763 * strip.c (handle_elf): Check against shstrndx, not e_shstrndx. 764 Explicitly set shdrstrndx for debug file. 765 * unstrip.c (copy_elf): Explicitly copy shstrndx. 766 (find_alloc_sections_prelink): Document shnum usage. 767 7682018-09-13 Mark Wielaard <mark@klomp.org> 769 770 * elflint.c (check_elf_header): Use shnum instead of e_shnum for all 771 checks. 772 (check_symtab): Use shstrndx instead of e_shstrndx to get section 773 names. 774 7752018-09-13 Mark Wielaard <mark@klomp.org> 776 777 * elfcmp.c (main): Get, check and shdrstrndx for section names. 778 7792018-09-12 Mark Wielaard <mark@klomp.org> 780 781 * elfcmp.c (main): Call ebl_section_strip_p without ehdr. 782 * strip.c (handle_elf): Likewise. 783 7842018-09-12 Mark Wielaard <mark@klomp.org> 785 786 * elflint.c (check_symtab): Call ebl_check_special_symbol without 787 ehdr. 788 7892018-07-30 Mark Wielaard <mark@klomp.org> 790 791 * strip.c (handle_elf): Track allocated/unallocated sections seen. Set 792 section offset of unallocated sections after handling all allocated 793 sections. 794 7952018-08-18 Mark Wielaard <mark@klomp.org> 796 797 * readelf.c (print_debug_aranges_section): Make sure there is enough 798 data to read the header segment size. 799 8002018-08-18 Mark Wielaard <mark@klomp.org> 801 802 * elflint.c (check_sysv_hash): Calculate needed size using unsigned 803 long long int to prevent overflow. 804 (check_sysv_hash64): Calculate maxwords used separately before 805 comparison to prevent overflow. 806 8072018-07-24 Mark Wielaard <mark@klomp.org> 808 809 * unstrip.c (compare_unalloc_sections): Also compare sh_size. 810 8112018-07-21 Mark Wielaard <mark@klomp.org> 812 813 * unstrip.c (adjust_all_relocs): Skip SHT_GROUP sections. 814 8152018-07-21 Mark Wielaard <mark@klomp.org> 816 817 * elfcompress.c (get_sections): New function. 818 (process_file): Check whether section needs to change. Don't rewrite 819 file if no section data needs changing. 820 (main): Update 'force' help text. 821 8222018-07-21 Mark Wielaard <mark@klomp.org> 823 824 * elfcompress.c (process_file): Swap fchmod and fchown calls. 825 8262018-07-04 Mark Wielaard <mark@klomp.org> 827 828 * readelf.c (print_debug_addr_section): Rename index var to uidx. 829 (attr_callback): Rename index var to word. 830 (print_debug_str_offsets_section): Rename index var to uidx. 831 8322018-07-04 Ross Burton <ross.burton@intel.com> 833 834 * addr2line.c: Remove error.h include. 835 * ar.c: Likewise. 836 * arlib.c: Likewise and add system.h include. 837 * arlib2.c: Likewise. 838 * elfcmp.c: Likewise. 839 * elfcompress.c: Likewise. 840 * elflint.c: Likewise. 841 * findtextrel.c: Likewise. 842 * nm.c: Likewise. 843 * objdump.c: Likewise. 844 * ranlib.c: Likewise. 845 * readelf.c: Likewise. 846 * stack.c: Likewise. 847 * strings.c: Likewise. 848 * strip.c: Likewise. 849 * unstrip.c: Likewise. 850 8512018-06-25 Mark Wielaard <mark@klomp.org> 852 853 * readelf.c (print_decoded_line_section): Use dwarf_next_lines 854 instead of dwarf_nextcu. 855 (print_debug_line_section): Don't explicitly lookup CU. 856 8572018-06-15 Mark Wielaard <mark@klomp.org> 858 859 * readelf.c (attr_callback): Only print block as expressions if it 860 isn't DW_FORM_data16. 861 8622018-06-12 Mark Wielaard <mark@klomp.org> 863 864 * readelf.c (print_form_data): Check we have 4, not 2, bytes 865 available for DW_FORM_block4. 866 8672018-06-12 Mark Wielaard <mark@klomp.org> 868 869 * readelf.c (print_form_data): Don't increase strreadp after use. 870 Do increase readp for DW_FORM_strx[1234]. 871 8722018-06-16 Mark Wielaard <mark@klomp.org> 873 874 * readelf.c (print_debug_loc_section): Make sure next_off doesn't 875 overflow d_buf. 876 8772018-06-13 Mark Wielaard <mark@klomp.org> 878 879 * readelf.c (die_type_sign_bytes): New function. 880 (attr_callback): Recognized DW_FORM_implicit_cost as signed. Use 881 die_type_sign_bytes to lookup the signedness and size of const 882 values. 883 8842018-06-11 Mark Wielaard <mark@klomp.org> 885 886 * readelf.c (print_form_data): Don't reuse readp and readendp when 887 reading str_offsets section. 888 8892018-06-10 Mark Wielaard <mark@klomp.org> 890 891 * readelf.c (print_form_data): Don't cast value to ptrdiff_t, cast 892 ptrdiff_t to size_t. 893 8942018-06-08 Mark Wielaard <mark@klomp.org> 895 896 * readelf.c (print_debug_rnglists_section): Calculate max_entries 897 instead of needed bytes to prevent overflowing. Always print 898 max_entries (but not more). 899 (print_debug_loclists_section): Likewise. 900 9012018-06-08 Mark Wielaard <mark@klomp.org> 902 903 * readelf.c (print_debug_line_section): Stop printing directories 904 and files when we are at the end of the unit data. 905 9062018-06-07 Mark Wielaard <mark@klomp.org> 907 908 * readelf.c (format_result): Removed. 909 (format_result_size): Removed. 910 (format_dwarf_addr): Renamed to... 911 (print_dwarf_addr): ...this. Simply call printf, don't setup buffer, 912 don't call sprintf. 913 (print_ops): Use print_dwarf_addr instead of format_dwarf_addr. 914 (print_debug_addr_section): Likewise. 915 (print_debug_aranges_section): Likewise. 916 (print_debug_rnglists_section): Likewise. 917 (print_debug_ranges_section): Likewise. 918 (print_debug_frame_section): Likewise. 919 (attr_callback): Likewise. 920 (print_decoded_line_section): Likewise. 921 (print_debug_line_section): Likewise. 922 (print_debug_loclists_section): Likewise. 923 (print_debug_loc_section): Likewise. 924 (print_gdb_index_section): Likewsie. 925 9262018-06-05 Mark Wielaard <mark@klomp.org> 927 928 * readelf.c (print_debug_addr_section): Set unit_length always to 929 (next_unitp - readp) in case we don't have a real header. 930 9312018-06-05 Mark Wielaard <mark@klomp.org> 932 933 * readelf.c (print_debug_loc_section): Set begin to idx when failing 934 to read the start address if DW_LLE_GNU_start_end_entry. 935 9362018-06-05 Mark Wielaard <mark@klomp.org> 937 938 * readelf.c (handle_sysv_hash): Don't leak lengths array when 939 detecting an invalid chain. 940 (handle_sysv_hash64): Likewise. 941 9422018-06-05 Mark Wielaard <mark@klomp.org> 943 944 * readelf.c (print_debug_macro_section): Extend vendor array by one 945 to include max DW_MACRO_hi_user opcode. 946 9472018-06-07 Mark Wielaard <mark@klomp.org> 948 949 * readelf.c (main): Lookup "no" for no_str. 950 (print_debug_abbrev_section): Use yes_str and no_str. 951 (print_form_data): Likewise. 952 9532018-06-04 Mark Wielaard <mark@klomp.org> 954 955 * readelf (format_result): New static char pointer. 956 (format_result_size): New static size_t. 957 (format_dwarf_addr): Calculate max string size, reuse format_result 958 if possible, otherwise realloc. Use sprintf on result, not asprintf. 959 (print_ops): Don't free format_dwarf_addr, make sure result is 960 printed before calling format_dwarf_addr again. 961 (print_debug_addr_section): Likewise. 962 (print_debug_aranges_section): Likewise. 963 (print_debug_rnglists_section): Likewise. 964 (print_debug_ranges_section): Likewise. 965 (print_debug_frame_section): Likewise. 966 (attr_callback): Likewise. 967 (print_decoded_line_section): Likewise. 968 (print_debug_line_section): Likewise. 969 (print_debug_loclists_section): Likewise. 970 (print_debug_loc_section): Likewise. 971 (print_gdb_index_section): Likewsie. 972 9732018-06-04 Mark Wielaard <mark@klomp.org> 974 975 * readelf.c (yes_str): New static char pointer. 976 (no_str): Likewise. 977 (main): Set yes_str and no_str using gettext. 978 (attr_callback): Use yes_str and no_str instead of calling gettext. 979 9802018-06-04 Mark Wielaard <mark@klomp.org> 981 982 * readelf.c (main): Call __fsetlocking (stdout, FSETLOCKING_BYCALLER). 983 9842018-05-31 Mark Wielaard <mark@klomp.org> 985 986 * readelf.c (print_debug_units): Print the dwo name and id when 987 unable to find a .dwo file. 988 9892018-05-31 Mark Wielaard <mark@klomp.org> 990 991 * readelf.c (enum section_e): Make section_types not an alias of 992 section_info. 993 (section_all): Add section_types. 994 (parse_opt): Add both section_info and section_types for "info" 995 and "info+". 996 (print_debug_units): Don't be silent for debug_types. 997 9982018-05-31 Mark Wielaard <mark@klomp.org> 999 1000 * readelf.c (attr_callback): Only register section_loc when not 1001 looking at a split dwarf from a skeleton. 1002 10032018-05-30 Mark Wielaard <mark@klomp.org> 1004 1005 * readelf.c (print_debug_loc_section): Use correct listptr for 1006 locview attribute. 1007 10082018-05-31 Mark Wielaard <mark@klomp.org> 1009 1010 * readelf.c (print_debug_units): Check offset against -1 not ~0ul. 1011 10122018-05-29 Mark Wielaard <mark@klomp.org> 1013 1014 * readelf.c (print_debug_loc_section): Handle GNU DebugFission list 1015 entries. 1016 10172018-05-29 Mark Wielaard <mark@klomp.org> 1018 1019 * readelf.c (print_debug): Record and reset section_info status in 1020 implicit_debug_sections and print_debug_sections. 1021 10222018-05-28 Mark Wielaard <mark@klomp.org> 1023 1024 * readelf.c (print_debug_units): Turn "Could not find split compile 1025 unit" into an Warning instead of an error. 1026 10272018-04-29 Mark Wielaard <mark@klomp.org> 1028 1029 * readelf.c (parse_opt): Request implicit section_info for "str". 1030 (known_stroffbases): New static variable. 1031 (attr_callbackattr_callback): Handle DW_AT_str_offets_base. 1032 (print_debug_str_offsets_section): New function. 1033 (print_debug): Handle .debug_str_offsets as section_str. Reset 1034 known_stroffbases. 1035 10362018-04-27 Mark Wielaard <mark@klomp.org> 1037 1038 * readelf.c (options): Add addr. 1039 (enum section_e): Add section_addr. 1040 (section_all): Add section_addr. 1041 (parse_opt): Parse "addr". 1042 (known_addrbases): New static variable. 1043 (get_listptr): New function. 1044 (print_debug_addr_section): Likewise. 1045 (attr_callback): Handle DW_AT_addr_base and DW_AT_GNU_addr_base. 1046 (print_debug): Add NEW_SECTION (addr). Reset known_addrbases. 1047 10482018-04-07 Mark Wielaard <mark@klomp.org> 1049 1050 * readelf.c (attr_callback): Handle DW_FORM_loclistx and 1051 DW_AT_segment. 1052 10532018-04-12 Mark Wielaard <mark@klomp.org> 1054 1055 * readelf.c (dwarf_loc_list_encoding_string): New functions. 1056 (dwarf_loc_list_encoding_name): Likewise. 1057 (known_loclistptr): Renamed and split in two... 1058 (known_locsptr): this and ... 1059 (known_loclistsptr): this. 1060 (listptr_base): Split out... 1061 (cudie_base): ...this. 1062 (is_split_dwarf): New function. 1063 (attr_callback): Handle DW_AT_loclists_base and notice sec_offset 1064 in correct list. 1065 (print_debug_rnglists_section): Use spit_dwarf_cu_base. 1066 (print_debug_loclists_section): New function. 1067 (print_debug_loc_section): Use known_locsptr instead of 1068 known_loclistptr. 1069 (print_debug): Recognize .debug_loclists. Reset known_locsptr and 1070 known_loclistsptr. 1071 10722018-05-25 Mark Wielaard <mark@klomp.org> 1073 1074 * readelf.c (DWARF_SKELETON): New constant. 1075 (do_not_close_dwfl): New bool. 1076 (options): Add dwarf-skeleton. 1077 (dwarf_skeleton): New static variable. 1078 (parse_opt): Handle DWARF_SKELETON, set dwarf_skeleton. 1079 (create_dwfl): New function, with code extracted from... 1080 (process_file): ...here. Check do_not_close_dwfl. 1081 (is_split_darf): New function. 1082 (getone_dwflmod): Likewise. 1083 (print_debug): Use new functions to find skeleton DWARF file to use 1084 when inspecting .dwo split DWARF file. 1085 10862018-04-11 Mark Wielaard <mark@klomp.org> 1087 1088 * readelf.c (dwarf_range_list_encoding_string): New function. 1089 (dwarf_range_list_encoding_name): Likewise. 1090 (known_rnglistptr): New static variable. 1091 (listptr_cu): New function. 1092 (print_debug_rnglists_section): Likewise. 1093 (attr_callback): Call notice_listptr for DW_AT_ranges. Handle 1094 DW_AT_rnglists_base. Handle DW_FORM_rnglistx. DW_AT_start_scope 1095 can also have a rnglist. 1096 (print_debug_units): Do (silently) scan split DWARF also for 1097 debug_ranges before DWARF5 to catch all rangelistptrs. 1098 (print_debug): Recognize .debug_rnglists. Reset known_rnglistptr. 1099 11002018-01-21 Mark Wielaard <mark@klomp.org> 1101 1102 * readelf.c (get_indexed_addr): New function. 1103 (print_ops): Handle DW_OP_addrx, DW_OP_GNU_addr_index, 1104 DW_OP_constx, DW_OP_GNU_const_index separately and resolve 1105 address. 1106 (attr_callback): Print index and address for 1107 DW_FORM_GNU_addr_index and DW_FORM_addrx[1234]. 1108 11092018-01-19 Mark Wielaard <mark@klomp.org> 1110 1111 * readelf.c (options): Add info+. 1112 (show_split_units): New static boolean defaulting to false. 1113 (parse_opt): For all (no arg) --debug-dump set show_split_units 1114 to yes. For "info+" enable section_info and show_split_units. 1115 (attrcb_args): Add is_split field. 1116 (attr_callback): Use is_split to format DIE offsets differently. 1117 (print_debug_units): Likewise. Get subdie (type or split) only 1118 when needed. When not silent reiterate over split DIEs when 1119 found. 1120 11212018-05-15 Mark Wielaard <mark@klomp.org> 1122 1123 * readelf.c (print_debug_units): Print unit type and id for any 1124 unit type that has it even when version < 5. 1125 11262018-05-14 Mark Wielaard <mark@klomp.org> 1127 1128 * readelf.c (print_ops): Handle DW_OP_GNU_addr_index and 1129 DW_OP_GNU_const_index. 1130 (attr_callback): Handle DW_FORM_GNU_addr_index as DW_FORM_addrx. 1131 Handle DW_FORM_GNU_str_index as DW_FORM_constx. Add as_hex_id. 1132 Handle DW_AT_GNU_dwo_id as_hex_id. 1133 (print_form_data): Handle DW_FORM_GNU_str_index as DW_FORM_strx. 1134 11352018-05-12 Mark Wielaard <mark@klomp.org> 1136 1137 * readelf.c (print_debug): Also recognize .dwo section name variants. 1138 11392018-05-15 Dmitry V. Levin <ldv@altlinux.org> 1140 1141 * elflint.c (check_elf_header): Fix typo in error diagnostics. 1142 11432018-05-15 Mark Wielaard <mark@klomp.org> 1144 1145 * readelf.c (print_form_data): Cast comparisons against offset_len to 1146 ptrdiff_t. 1147 (print_debug_line_section): Print uint64_t as PRIu64. 1148 11492018-05-11 Mark Wielaard <mark@klomp.org> 1150 1151 * readelf.c (print_debug_macro_section): Use libdw_valid_user_form. 1152 Use print_form_data for strx and sup strings. 1153 11542018-05-09 Mark Wielaard <mark@klomp.org> 1155 1156 * readelf.c (dwarf_line_content_description_string): New function. 1157 (dwarf_line_content_description_name): Likewise. 1158 (print_bytes): Likewise. 1159 (print_form_data): Likewise. Based on code taken from... 1160 (print_debug_macro_section): ...here. Now calls print_form_data 1161 and str_offsets_base_off. 1162 (print_debug_line_section): Parse DWARF5 header, directory and file 1163 name tables. 1164 11652018-05-12 Mark Wielaard <mark@klomp.org> 1166 1167 * addr2line.c (main): Add fflush (stdout) after handle_address () 1168 when reading from stdin. 1169 11702018-04-24 Mark Wielaard <mark@klomp.org> 1171 1172 * readelf.c (print_debug_aranges_section): Try elf_rawdata if no 1173 sectiondata. 1174 (print_debug_ranges_section): Likewise. 1175 (print_debug_frame_section): Likewise. 1176 (print_debug_line_section): Likewise. Check for data == NULL. 1177 (print_debug_loc_section): Likewise. 1178 (print_debug_macinfo_section): Likewise. 1179 (print_debug_macro_section): Likewise. 1180 11812018-04-28 Mark Wielaard <mark@klomp.org> 1182 1183 * readelf.c (print_debug): If .debug_info is needed implicitly by 1184 then handle it first before handling any other debug section. 1185 (parse_opt): Set implicit_debug_sections to section_info when 1186 showing all debug sections. 1187 11882018-05-05 Mark Wielaard <mark@klomp.org> 1189 1190 * readelf.c (attr_callback): Handle DW_FORM_ref_sup4 and 1191 DW_FORM_ref_sup8 as references. 1192 11932018-04-24 Mark Wielaard <mark@klomp.org> 1194 1195 * readelf.c (print_debug_str_section): Take raw section data. Don't 1196 use dwarf_getstring, but determine start and end of string from 1197 offset and section data directly. 1198 (print_debug): Handle ".debug_line_str" like ".debug_str". 1199 12002018-04-19 Andreas Schwab <schwab@suse.de> 1201 1202 * elflint.c (valid_e_machine): Add EM_RISCV. 1203 12042018-04-16 Mark Wielaard <mark@klomp.org> 1205 1206 * readelf.c (print_debug_line_section). In advance_pc, advance 1207 using op_addr_advance, not op_advance. 1208 12092018-04-14 Mark Wielaard <mark@klomp.org> 1210 1211 * readelf.c (attr_callback): Only show errors when not silent. 1212 12132018-03-23 Mark Wielaard <mark@klomp.org> 1214 1215 * readelf.c (attr_callback): Handle DW_FORM_strx[1234]. 1216 12172018-03-22 Mark Wielaard <mark@klomp.org> 1218 1219 * readelf.c (attr_callback): Handle DW_FORM_addrx[1234]. 1220 12212018-03-28 Mark Wielaard <mark@klomp.org> 1222 1223 * readelf.c (handle_sysv_hash): Break bucket chain after nchain 1224 entries are found. 1225 (handle_sysv_hash64): Likewise. 1226 12272018-03-27 Mark Wielaard <mark@klomp.org> 1228 1229 * readelf.c (attr_callback): Print dwarf_dieoffset as %PRIx64, 1230 not %zx. 1231 12322018-03-20 Mark Wielaard <mark@klomp.org> 1233 1234 * readelf.c (attr_callback): Report error when DW_AT_decl_file or 1235 DW_AT_call_file cannot be resolved. 1236 12372018-03-06 Mark Wielaard <mark@klomp.org> 1238 1239 * readelf.c (print_ops): Handle DW_OP_addrx, DW_OP_constx, 1240 DW_OP_implicit_pointer, DW_OP_entry_value, DW_OP_const_type, 1241 DW_OP_regval_type, DW_OP_deref_type, DW_OP_xderef_type, 1242 DW_OP_convert, DW_OP_reinterpret. 1243 12442018-03-01 Mark Wielaard <mark@klomp.org> 1245 1246 * readelf.c (struct listptr): Add attr field. 1247 (compare_listptr): Warn when two listptrs for the same offset have 1248 different attributes. 1249 (notice_listptr): Take attr as argument and add it to listptr. 1250 (skip_listptr_hole): New attr argument. 1251 (next_listptr_offset): New function. 1252 (print_debug_ranges_section): Pass NULL attr to skip_listptr_hole. 1253 (attr_callback): Handle DW_AT_GNU_locviews. Call notice_listptr with 1254 attr. 1255 (print_debug_loc_section): Keep track of which attr is associated with 1256 a listptr. If the attr is DW_AT_GNU_locview print view pairs till the 1257 next listptr offset. 1258 12592018-02-09 Mark Wielaard <mark@klomp.org> 1260 1261 * elflint.c (check_group): Make sure we can read a complete 1262 element when iterating over the group. 1263 12642018-02-09 Mark Wielaard <mark@klomp.org> 1265 1266 * readelf.c (attr_callback): Handle DW_FORM_data16 as Dwarf_Block. 1267 12682018-02-09 Mark Wielaard <mark@klomp.org> 1269 1270 * readelf.c (print_debug_abbrev_section): Print the value of a 1271 DW_FORM_implicit_const using dwarf_getabbrevattr_data. 1272 (attr_callback): Handle DW_FORM_implicit_const. 1273 12742018-01-30 Mark Wielaard <mark@klomp.org> 1275 1276 * readelf.c (dwarf_unit_string): New function. 1277 (dwarf_unit_name): Likewise. 1278 (print_debug_units): Use dwarf_get_units and dwarf_cu_die instead 1279 of dwarf_next_unit. Print unit type, id and subdie if available. 1280 12812018-02-09 Joshua Watt <JPEWhacker@gmail.com> 1282 1283 * addr2line.c (handle_address): Use FALLTHROUGH macro instead of 1284 comment. 1285 * elfcompress.c (parse_opt): Likewise. 1286 * elflint.c (check_dynamic): Likewise. 1287 (check_sections): Likewise. 1288 (check_note_data): Likewise. 1289 * objdump.c (parse_opt): Likewise. 1290 * readelf.c (parse_opt): Likewise. 1291 (attr_callback): Likewise. 1292 (handle_auxv_note): Likewise. 1293 * strings.c (parse_opt): Likewise. 1294 * backtrace.c (callback_verify): Likewise. 1295 12962018-01-25 Mark Wielaard <mark@klomp.org> 1297 1298 * readelf.c (print_debug_ranges_section): Initialize cu to last_cu. 1299 (print_debug_loc_section): Likewise. 1300 13012018-01-01 Mark Wielaard <mark@klomp.org> 1302 1303 * readelf.c (attr_callback): Use dwarf_form_name for unknown forms. 1304 (print_debug_macro_section): Print form using dwarf_form_name. 1305 13062017-12-28 Mark Wielaard <mark@klomp.org> 1307 1308 * readelf.c (print_debug_units): Print DIE offset in error message 1309 as hex. 1310 13112017-12-18 Mark Wielaard <mark@klomp.org> 1312 1313 * readelf.c (handle_notes_data): Don't use EXIT_FAILURE in error. 1314 Adjust error message depending on whether or not we got data. 1315 13162017-12-07 Mark Wielaard <mark@klomp.org> 1317 1318 * readelf.c (print_ops): Update data pointer and print arguments 1319 to DW_OP_call2 and DW_OP_call4 as DIE offsets. 1320 13212017-11-29 Mark Wielaard <mark@klomp.org> 1322 1323 * readelf.c (argp_options): Add "section-groups", 'g'. 1324 13252017-11-29 Mark Wielaard <mark@klomp.org> 1326 1327 * readelf.c (print_debug_loc_section): Print CU base and unresolved 1328 addresses. Adjust formatting. 1329 13302017-11-29 Mark Wielaard <mark@klomp.org> 1331 1332 * readelf.c (print_debug_ranges_section): Print CU base and unresolved 1333 addresses. Adjust formatting. 1334 13352017-11-29 Mark Wielaard <mark@klomp.org> 1336 1337 * readelf.c (attr_callback): Set valuestr to resolved file name 1338 for DW_AT_decl_file and DW_AT_call_file. 1339 13402017-11-29 Mark Wielaard <mark@klomp.org> 1341 1342 * readelf.c (print_debug_units): Print abbrev code after DIE tag. 1343 13442017-11-29 Mark Wielaard <mark@klomp.org> 1345 1346 * readelf.c (print_ops): Use only2 space for index. re-indent +5 1347 for DW_OP_GNU_entry_value. 1348 13492017-11-21 Mark Wielaard <mark@klomp.org> 1350 1351 * readelf.c (attr_callback): Print attribute name and form in error 1352 message. If only the value cannot be retrieved/resolved don't abort. 1353 13542017-10-03 Mark Wielaard <mark@klomp.org> 1355 1356 * readelf.c (attr_callback): Print DIE offset in error messages. 1357 13582017-11-03 Mark Wielaard <mark@klomp.org> 1359 1360 * readelf.c (print_ops): Handle DW_OP_GNU_variable_value. Print 1361 referenced DIE as offset. 1362 13632017-09-10 Mark Wielaard <mark@klomp.org> 1364 1365 * ar.c (do_oper_delete): Remove DEBUG conditional check. 1366 (no0print): Return bool. Check snprintf return value. 1367 (do_oper_insert): Initialize elf. Remove DEBUG conditional check. 1368 Check no0print calls succeed. Explicitly elf_end found elfs. 1369 (do_oper_extract): Make sure we don't create an empty variable 1370 length array. 1371 13722017-09-01 Mark Wielaard <mark@klomp.org> 1373 1374 * stack.c (main): Replace \v in doc string with \n\n. 1375 * unstrip.c (main): Likewise. 1376 13772017-05-04 Ulf Hermann <ulf.hermann@qt.io> 1378 1379 * stack.c: Print pid_t using %lld. 1380 13812017-08-18 Ulf Hermann <ulf.hermann@qt.io> 1382 1383 * readelf.c: Hardcode the signal numbers for non-linux systems. 1384 13852017-07-26 Mark Wielaard <mark@klomp.org> 1386 1387 * readelf.c (print_debug_macro_section): Accept either version 4 or 1388 version 5. Use DW_MACRO names instead of DW_MACRO_GNU names. Add 1389 minimal support for DW_MACRO_define_sup, DW_MACRO_undef_sup, 1390 DW_MACRO_import_sup, DW_MACRO_define_strx and DW_MACRO_undef_strx. 1391 13922017-07-26 Mark Wielaard <mark@klomp.org> 1393 1394 * readelf.c (dwarf_defaulted_string): New function. 1395 (dwarf_defaulted_name): Likewise. 1396 (attr_callback): Use dwarf_defaulted_name to get value of 1397 DW_AT_defaulted. 1398 13992017-07-20 Mark Wielaard <mark@klomp.org> 1400 1401 * strip.c (handle_elf): Deal with data marker symbols pointing to 1402 debug sections (they can be removed). 1403 14042017-07-14 Mark Wielaard <mark@klomp.org> 1405 1406 * strip (OPT_KEEP_SECTION): New define. 1407 (options): Add documentation for remove-section. Add keep-section. 1408 (struct section_pattern): New data type. 1409 (keep_secs, remove_secs): New globals. 1410 (add_pattern, free_sec_patterns, free_patterns, section_name_matches): 1411 New functions. 1412 (main): Call free_patterns. 1413 (parse_opt): Handle 'R' and OPT_KEEP_SECTION. Check remove_comment 1414 on ARGP_KEY_SUCCESS. 1415 (handle_elf): Handle and sanity check keep_secs and remove_secs. 1416 14172017-06-07 Mark Wielaard <mark@klomp.org> 1418 1419 * strip.c (handle_elf): Introduce new handle_elf boolean. Use it to 1420 determine whether to create an output and/or debug file. Remove new 1421 output file on error. 1422 14232017-06-06 Mark Wielaard <mark@klomp.org> 1424 1425 * strip.c (handle_elf): Assume e_shstrndx section can be removed. 1426 14272017-04-20 Ulf Hermann <ulf.hermann@qt.io> 1428 1429 * readelf.c: Include strings.h. 1430 14312017-04-20 Ulf Hermann <ulf.hermann@qt.io> 1432 1433 * unstrip.c: Check shnum for 0 before subtracting from it. 1434 14352017-04-20 Ulf Hermann <ulf.hermann@qt.io> 1436 1437 * readelf.c: Replace YESSTR and NOSTR with gettext ("yes") and 1438 gettext ("no"), respectively. 1439 14402017-04-05 Mark Wielaard <mark@klomp.org> 1441 1442 * elflint.c (check_elf_header): Decompress all sections. 1443 14442017-03-28 Mark Wielaard <mark@klomp.org> 1445 1446 * elflint (check_group): Don't check if there is no flag word. 1447 14482017-03-27 Mark Wielaard <mark@klomp.org> 1449 1450 * elflint.c (check_elf_header): Sanity check phnum and shnum. 1451 14522017-03-27 Mark Wielaard <mark@klomp.org> 1453 1454 * elflint.c (check_sysv_hash): Return early if section size is 1455 too small. 1456 (check_sysv_hash64): Likewise. 1457 (check_hash): Calculate expect_entsize to check section size. 1458 14592017-03-27 Mark Wielaard <mark@klomp.org> 1460 1461 * elflint.c (check_symtab_shndx): Check data->d_size. 1462 14632017-03-24 Mark Wielaard <mjw@redhat.com> 1464 1465 * elfcmp.c (main): If n_namesz == 0 then the note name data is the 1466 empty string. 1467 * readelf.c (handle_notes_data): Likewise. 1468 14692017-03-24 Mark Wielaard <mjw@redhat.com> 1470 1471 * readelf.c (handle_gnu_hash): Check inner < max_nsyms before 1472 indexing into chain array. 1473 14742017-02-16 Ulf Hermann <ulf.hermann@qt.io> 1475 1476 * addr2line.c: Include printversion.h 1477 * ar.c: Likewise. 1478 * elflint.c: Likewise. 1479 * nm.c: Likewise. 1480 * objdump.c: Likewise. 1481 * ranlib.c: Likewise. 1482 * readelf.c: Likewise. 1483 * size.c: Likewise. 1484 * stack.c: Likewise. 1485 * strings.c: Likewise. 1486 * strip.c: Likewise. 1487 * elfcmp.c: Include printversion.h, remove system.h include. 1488 * elfcompress.c: Likewise. 1489 * findtextrel.c: Likewise. 1490 * unstrip.c: Likewise. 1491 14922017-02-14 Ulf Hermann <ulf.hermann@qt.io> 1493 1494 * nm.c: Include color.h. 1495 * objdump.c: Likewise. 1496 14972016-12-24 Mark Wielaard <mark@klomp.org> 1498 1499 * Makefile.am (findtextrel_LDADD): Add $(libeu). 1500 (addr2line_LDADD): Likewise. 1501 (elfcmp_LDADD): Likewise. 1502 * addr2line.c (print_version): Removed. 1503 * ar.c (print_version): Likewise. 1504 * elfcmp.c (print_version): Likewise. 1505 * elfcompress.c (print_version): Likewise. 1506 * elflint.c (print_version): Likewise. 1507 * findtextrel.c (print_version): Likewise. 1508 * nm.c (print_version): Likewise. 1509 * objdump.c: Likewise. 1510 * ranlib.c: Likewise. 1511 * readelf.c: Likewise. 1512 * size.c: Likewise. 1513 * stack.c: Likewise. 1514 * strings.c: Likewise. 1515 * strip.c: Likewise. 1516 * unstrip.c: Likewise. 1517 15182016-11-17 Mark Wielaard <mjw@redhat.com> 1519 1520 * readelf.c (options): Add optional arg SECTION for symbols. 1521 (symbol_table_section): New static variable. 1522 (parse_opt): Set symbol_table_section on 's'. 1523 (print_symtab): Filter on symbol_table_section name is set. 1524 15252016-11-10 Mark Wielaard <mjw@redhat.com> 1526 1527 * ar.c (write_member): Make sure tmpbuf is large enough to contain 1528 a starting '/' and ending '\0' char. 1529 (do_oper_insert): Likewise. 1530 * arlib.c (arlib_finalize): Format tmpbuf as PRId32 decimal. 1531 15322016-11-02 Mark Wielaard <mjw@redhat.com> 1533 1534 * addr2line.c (handle_address): Add fallthrough comment. 1535 * elfcompress.c (parse_opt): Adjust fallthrough comment. 1536 * elflint.c (parse_opt): Add missing break after 'd' case. 1537 (check_sections): Add fallthrough comments. 1538 * objdump.c (parse_opt): Add explantion for fallthrough comment. 1539 15402016-10-22 Kevin Cernekee <cernekee@chromium.org> 1541 1542 * unstrip.c: Fix "invalid string offset" error caused by using the 1543 unstripped .symtab with the stripped .strtab. 1544 15452016-10-11 Akihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp> 1546 1547 * arlib.c: Remove system.h include, add libeu.h include. 1548 * arlib2.c: Remove sys/param.h include. 1549 * elfcompress.c: Add libeu.h include. 1550 * elflint.c: Remove sys/param.h include, add libeu.h include. 1551 * nm.c: Likewise. 1552 * objdump.c: Likewise. 1553 * ranlib.c: Likewise. 1554 * readelf.c: Likewise. 1555 * size.c: Remove sys/param.h include. 1556 * strings.c: Likewise, add libeu.h include. 1557 * strip.c: Likewise. 1558 * unstrip.c: Likewise. 1559 15602016-10-06 Mark Wielaard <mjw@redhat.com> 1561 1562 * strip.c (handle_elf): Don't remove real symbols from allocated 1563 symbol tables. 1564 15652016-08-25 Mark Wielaard <mjw@redhat.com> 1566 1567 * strip.c (handle_elf): Recompress with ELF_CHF_FORCE. 1568 15692016-08-06 Mark Wielaard <mjw@redhat.com> 1570 1571 * strip.c (handle_elf): Uncompress and recompress relocation target 1572 section if necessary. 1573 15742016-07-08 Mark Wielaard <mjw@redhat.com> 1575 1576 * Makefile.am (strip_LDADD): Add libdw. 1577 * elfcompress.c (process_file): Use dwelf_strtab functions instead of 1578 ebl_strtab. 1579 * strip.c (handle_elf): Likewise. 1580 * unstrip.c (new_shstrtab): Likewise. 1581 15822016-07-06 Mark Wielaard <mjw@redhat.com> 1583 1584 * elf32-i386.script, i386_ld.c, ld.c, ld.h, ldgeneric.c, ldlex.l, 1585 ldscript.y, libld_elf_i386.map, none_ld.c, sectionhash.c, 1586 sectionhash.h, symbolhash.c, symbolhash.h, unaligned.h, 1587 versionhash.c, versionhash.h, xelf.h: Removed. 1588 * Makefile.am (YACC): Removed. 1589 (AM_YFLAGS): Removed. 1590 (AM_LFLAGS): Removed. 1591 (native_ld): Removed. 1592 (base_cpu): Removed. 1593 (bin_PROGRAMS): Removed ld. 1594 (ld_dsos): Removed. 1595 (ld_SOURCES): Removed. 1596 (noinst_LIBRARIES): Only libar.a. 1597 (EXTRA_DIST): Just arlib.h and debugpred.h. 1598 (ld_LDADD): Removed. 1599 (ld_LDFLAGS): Removed. 1600 (ldlex.o): Removed. 1601 (ldscript.h): Removed. 1602 (libld*): Removed. 1603 (CLEANFILES): Just *.gconv. 1604 (MAINTAINERCLEANFILES): Removed. 1605 16062016-07-06 Mark Wielaard <mjw@redhat.com> 1607 1608 * unstrip.c (copy_elided_sections): Use unstripped_strent[] from 1609 index zero, instead of one. 1610 16112016-06-28 Richard Henderson <rth@redhat.com> 1612 1613 * elflint.c (valid_e_machine): Add EM_BPF. 1614 16152016-04-11 David Abdurachmanov <davidlt@cern.ch> 1616 1617 * elfcmp.c (main): Fix self-comparison error with GCC 6. 1618 16192016-03-21 Mark Wielaard <mjw@redhat.com> 1620 1621 * nm.c (show_symbols): Check for malloc size argument overflow. 1622 16232016-02-13 Mark Wielaard <mjw@redhat.com> 1624 1625 * readelf.c (print_scngrp): Call error when gelf_getshdr fails. 1626 (print_symtab): Likewise. 1627 (handle_hash): Likewise. 1628 (dump_data_section): Print a warning if decompressing fails. 1629 (print_string_section): Likewise. 1630 16312016-02-13 Mark Wielaard <mjw@redhat.com> 1632 1633 * elfcompress.c (parse_opt): Don't fallthrough after processing -q. 1634 16352016-02-12 Mark Wielaard <mjw@redhat.com> 1636 1637 * strip.c (handle_elf): Correct elf_assert shndxdata check. 1638 16392016-02-09 Mark Wielaard <mjw@redhat.com> 1640 1641 * readelf.c (read_encoded): Move up. 1642 (print_cfa_program): Add encoding argument. Use it for read_encoded 1643 when reading DW_CFA_set_loc op. 1644 (print_debug_frame_section): Pass fde_encoding to print_cfa_program. 1645 16462016-02-09 Mark Wielaard <mjw@redhat.com> 1647 1648 * elflint.c (compare_hash_gnu_hash): Check hash sh_entsize against 1649 sizeof (Elf64_Xword). Correct invalid sh_entsize error message 1650 section idx and name. 1651 16522016-01-13 Mark Wielaard <mjw@redhat.com> 1653 1654 * elflint.c (check_elf_header): Recognize ELFOSABI_FREEBSD. 1655 16562016-01-08 Mark Wielaard <mjw@redhat.com> 1657 1658 * elfcompress.c (compress_section): Use %zu to print size_t. 1659 * readelf.c (print_shdr): Use %zx to print size_t. 1660 16612015-12-16 Mark Wielaard <mjw@redhat.com> 1662 1663 * elfcompress.c: New file. 1664 * Makefile.am (bin_PROGRAMS): Add elfcompress. 1665 (elfcompress_LDADD): New variable. 1666 16672015-12-18 Mark Wielaard <mjw@redhat.com> 1668 1669 * elflint.c (section_flags_string): Add NEWFLAG COMPRESSED. 1670 (check_sections): SHF_COMPRESSED can be on any special section. 1671 SHF_COMPRESSED is a valid section flag. SHF_COMPRESSED cannot 1672 be used together with SHF_ALLOC or with SHT_NOBITS. Should have 1673 a valid Chdr. 1674 16752015-10-20 Mark Wielaard <mjw@redhat.com> 1676 1677 * readelf.c (options): Expand -z help text. 1678 (dump_data_section): Check whether we need and can decompress section 1679 data and call elf_rawzdata if so, 1680 (print_string_section): Likewise. 1681 (elf_contains_chdrs): New function. 1682 (process_elf_file): Rename print_unrelocated to print_unchanged, 1683 use elf_contains_chdrs. 1684 (print_scngrp): Check whether section is compressed before use. 1685 (print_symtab): Likewise. 1686 (handle_hash): Likewise. 1687 16882015-10-16 Mark Wielaard <mjw@redhat.com> 1689 1690 * readelf.c (argp_option): Describe --decompress,-z. 1691 (print_decompress): New bool. 1692 (parse_opt): Handle -z. 1693 (elf_ch_type_name): New function. 1694 (print_shdr): Print section compress information. 1695 16962015-12-31 Mark Wielaard <mjw@redhat.com> 1697 1698 * elflint.c (check_symtab): Add _edata and _end (plus extra underscore 1699 variants) to to the list of possibly dangling symbols. 1700 17012015-12-02 Mark Wielaard <mjw@redhat.com> 1702 1703 * nm.c (process_file): Accept fd and pass it on. 1704 (handle_elf): Likewise. 1705 (find_no_debuginfo): New. 1706 (struct getdbg): Likewise. 1707 (getdbg_dwflmod): Likewise. 1708 (show_symbols): Take fd. If the file is ET_REL use libdwfl to get 1709 the relocated Dwarf. 1710 17112015-12-02 Mark Wielaard <mjw@redhat.com> 1712 1713 * nm.c (get_local_names): Check for duplicates in local_root tree. 1714 17152015-12-02 Mark Wielaard <mjw@redhat.com> 1716 1717 * unstrip.c (struct data_list): New. 1718 (new_data_list): Likewise. 1719 (record_new_data): Likewise. 1720 (free_new_data): Likewise. 1721 (adjust_relocs): Call record_new_data. 1722 (add_new_section_symbols): Likewise. 1723 (copy_elided_sections): Call free_new_data. 1724 17252015-12-01 Mark Wielaard <mjw@redhat.com> 1726 1727 * elfcmp.c (main): Close ebl1 and ebl2 backends. 1728 17292015-10-16 Mark Wielaard <mjw@redhat.com> 1730 1731 * Makefile.am [BUILD_STATIC](libdw): Add -lz. 1732 [BUILD_STATIC](libelf): Likewise. 1733 17342015-10-16 Mark Wielaard <mjw@redhat.com> 1735 1736 * elflint.c (check_symtab): Don't check TLS symbol value against TLS 1737 phdr offset in debuginfo files. 1738 (check_sections): Don't try to match section offsets to phdrs offsets 1739 in debuginfo files. 1740 17412015-10-16 Mark Wielaard <mjw@redhat.com> 1742 1743 * elflint.c (check_reloc_shdr): Reject only desthdrs if they have both 1744 SHF_MERGE and SHF_STRINGS set. 1745 17462015-10-13 Jose E. Marchesi <jose.marchesi@oracle.com> 1747 1748 * elflint.c (check_sections): Do not rely on 1749 ebl_check_special_section when checking debuginfo files. Also 1750 check that the type of WE sections in debuginfo files is NOBITS. 1751 17522015-10-13 Mark Wielaard <mjw@redhat.com> 1753 1754 * elflint.c (check_program_header): Check relro flags are a subset 1755 of the load segment if they don't fully overlap. 1756 17572015-10-07 Mark Wielaard <mjw@redhat.com> 1758 1759 * Makefile.am (ldlex_no_Wstack_usage): New. 1760 * ldlex.l ([RWX]): Make cnt unsigned. 1761 17622015-10-09 Josh Stone <jistone@redhat.com> 1763 1764 * elflint.c (main): Replace stat64 and fstat64 with stat and fstat. 1765 * readelf.c (process_file): Likewise. 1766 (process_elf_file): Replace off64_t with off_t. 1767 * findtextrel.c (process_file): Replace open64 with open. 1768 * ld.c (main): Replace sizeof (off64_t) with 8. 1769 * strings.c: Replace off64_t with off_t throughout. 1770 (main): Replace stat64 and fstat64 with stat and fstat. 1771 (map_file): Replace mmap64 with mmap. 1772 (read_block): Likewise, and replace lseek64 with lseek. 1773 * strip.c (handle_elf): Replace ftruncate64 with ftruncate. 1774 (process_file): Replace stat64 and fstat64 with stat and fstat. 1775 * unstrip.c (parse_opt): Replace stat64 with stat. 1776 (handle_file): Replace open64 with open. 1777 (open_file): Likewise. 1778 17792015-10-08 Chih-Hung Hsieh <chh@google.com> 1780 1781 * ld.c (determine_output_format): Move recursive nested 1782 function "try" to file scope. 1783 17842015-10-04 Mark Wielaard <mjw@redhat.com> 1785 1786 * strip.c (handle_elf): Only sanity check section symbols to not 1787 kept discarded sections if we are creating a debug file. 1788 17892015-10-07 Mark Wielaard <mjw@redhat.com> 1790 1791 * unstrip.c (MAX): Removed. 1792 (find_alloc_sections_prelink): Allocate exact amount of bytes for 1793 shdrs. 1794 17952015-10-05 Chih-Hung Hsieh <chh@google.com> 1796 1797 * unstrip.c (find_alloc_sections_prelink): Do not allocate 1798 on stack union types with variable length arrays; use xmalloc 1799 for such dynamic sized objects. 1800 * readelf.c (handle_core_item): Likewise, but use alloca 1801 for small variable size data object and add assert(count < 128). 1802 18032015-10-05 Josh Stone <jistone@redhat.com> 1804 1805 * Makefile.am (libld_elf_i386.so): Add AM_V_CCLD silencer. 1806 (.deps/none_ld.Po): Always silence the dummy command. 1807 (make-debug-archive): Add AM_V_GEN and AM_V_at silencers. 1808 18092015-10-02 Mark Wielaard <mjw@redhat.com> 1810 1811 * unstrip.c (copy_elided_sections): Use SH_INFO_LINK_P, not just 1812 SHF_INFO_LINK. 1813 18142015-10-02 Mark Wielaard <mjw@redhat.com> 1815 1816 * strip.c (handle_elf): Don't move around allocated NOBITS sections. 1817 Don't just mark the section header string table as unused. 1818 * unstrip.c (copy_elided_sections): Add header names to strtab if 1819 shstrndx equals the symtab strtabndx. 1820 18212015-09-22 Mark Wielaard <mjw@redhat.com> 1822 1823 * strip.c (cleanup_debug): Remove old-style function definitions. 1824 18252015-09-09 Chih-Hung Hsieh <chh@google.com> 1826 1827 * readelf.c (print_debug_exception_table): Initialize variable before 1828 it is used, because compiler does not know that error never returns. 1829 (dump_arhive_index): Likewise. 1830 18312015-09-04 Chih-Hung Hsieh <chh@google.com> 1832 1833 * elflint.c (check_group): Replace %Z length modifier with %z. 1834 (check_note_data): Likewise. 1835 * findtextrel.c (process_file): Likewise. 1836 * readelf.c (handle_dynamic): Likewise. 1837 (handle_symtab): Likewise. 1838 (handle_verneed): Likewise. 1839 (handle_verdef): Likewise. 1840 (handle_versym): Likewise. 1841 (print_hash_info): Likewise. 1842 (print_decoded_aranges_section): Likewise. 1843 (print_debug_aranges_section): Likewise. 1844 (print_debug_line_section): Likewise. 1845 (hex_dump): Likewise. 1846 (dump_data_section): Likewise. 1847 (print_string_section): Likewise. 1848 (dump_archive_index): Likewise. 1849 * unstrip.c (adjust_relocs): Likewise. 1850 (collect_symbols): likewise. 1851 (get_section_name): Likewise. 1852 (find_alloc_sections_prelink): Likewise. 1853 (copy_elided_sections): Likewise. 1854 * ldscript.y (add_id_list): Add missing '%s'. 1855 18562015-09-03 Mark Wielaard <mjw@redhat.com> 1857 1858 * readelf.c (handle_core_item): Handle right shift >= 32 bits. 1859 18602015-08-11 Mark Wielaard <mjw@redhat.com> 1861 1862 * elflint.c (check_sections): When gnuld and a NOBITS section falls 1863 inside a segment make sure any ELF file contents is zero. 1864 18652015-07-29 Mark Wielaard <mjw@redhat.com> 1866 1867 * unstrip.c (sections_flags_match): New function. 1868 (sections_match): Use sections_flags_match. 1869 (find_alloc_sections_prelink): Only clear matched sections if there 1870 is an undo section. 1871 (copy_elided_sections): Add SHF_INFO_LINK to shdr_mem.sh_flags if 1872 necessary. 1873 18742015-06-27 Pino Toscano <toscano.pino@tiscali.it> 1875 1876 * src/strings.c: Define MAP_POPULATE if not defined already. 1877 18782015-06-27 Mark Wielaard <mjw@redhat.com> 1879 1880 * nm.c (show_symbols): First call elf_getdata, then allocate memory. 1881 18822015-06-18 Mark Wielaard <mjw@redhat.com> 1883 1884 * findtextrel.c (process_file): Free segments after use. 1885 18862015-06-18 Mark Wielaard <mjw@redhat.com> 1887 1888 * readelf.c (print_phdr): Make sure phdr2_mem lifetime/scope equals 1889 phdr2 pointer. 1890 18912015-06-18 Mark Wielaard <mjw@redhat.com> 1892 1893 * readelf.c (handle_gnu_hash): Free lengths on invalid_data. 1894 18952015-06-18 Mark Wielaard <mjw@redhat.com> 1896 1897 * elflint.c (check_symtab): Only check the PT_TLS phdr if it actually 1898 exists. Warn otherwise. 1899 19002015-06-18 Mark Wielaard <mjw@redhat.com> 1901 1902 * nm.c (show_symbols): Check sizeof (sym_mem[0]), not GElf_Sym to 1903 known whether or not we stack allocated memory. 1904 19052015-06-18 Mark Wielaard <mjw@redhat.com> 1906 1907 * strings.c (readelf): Use "<unknown>" if we cannot retrieve section 1908 name. 1909 19102015-06-09 Mark Wielaard <mjw@redhat.com> 1911 1912 * addr2line.c (print_dwarf_function): Always free scopes before 1913 returning. 1914 19152015-06-09 Mark Wielaard <mjw@redhat.com> 1916 1917 * strip.c (handle_ar): Mark as unused. 1918 (process_file): Produce an error when trying to handle an ar. 1919 19202015-05-30 Mark Wielaard <mjw@redhat.com> 1921 1922 * elfcmp.c (main): Only call memcmp when d_size != 0. 1923 19242015-05-23 Mark Wielaard <mjw@redhat.com> 1925 1926 * Makefile.am: Define ldgeneric, readelf, nm, size, strip, elflint, 1927 findtextrel, elfcmp objdump, ranlib, ar and unstrip no_Wstack_usage. 1928 19292015-05-21 Mark Wielaard <mjw@redhat.com> 1930 1931 * addr2line.c (handle_address): Set scopes to NULL after free. 1932 19332015-05-20 Mark Wielaard <mjw@redhat.com> 1934 1935 * addr2line.c (OPT_PRETTY): New constant define. 1936 (argp_option): Add "pretty-print". 1937 (pretty): New static bool. 1938 (parse_opt): Set pretty. 1939 (print_dwarf_function): Adjust output when pretty is set. 1940 (print_addrsym): Likewise. 1941 (handle_address): Likewise. 1942 19432015-05-20 Mark Wielaard <mjw@redhat.com> 1944 1945 * Makefile.am (addr2line_LDADD): Add demanglelib. 1946 * addr2line.c (argp_option): Move demangle under output format. 1947 (demangle): New static bool. 1948 (demangle_buffer_len): New static size_t. 1949 (demangle_buffer): New static char *. 1950 (main): free demangle_buffer. 1951 (parse_opt): Set demangle. 1952 (symname): New static function. 1953 (get_diename): Use symname. 1954 (print_dwarf_function): Likewise. 1955 (print_addrsym): Likewise. 1956 (handle_address): Likewise. 1957 19582015-05-20 Mark Wielaard <mjw@redhat.com> 1959 1960 * addr2line.c (argp_option): Add "addresses", 'a'. 1961 (print_addresses): New static bool. 1962 (parse_opt): Set print_addresses. 1963 (get_addr_width): New static function. 1964 (handle_address): Print address if print_addresses is true. 1965 19662015-05-20 Mark Wielaard <mjw@redhat.com> 1967 1968 * addr2line.c (handle_address): Call strtoumax with base 16. Make 1969 sure all input has been processed. 1970 19712015-05-20 Mark Wielaard <mjw@redhat.com> 1972 1973 * addr2line (argp_option): Group 'section' under "Input format 1974 options". 1975 19762015-05-12 Mark Wielaard <mjw@redhat.com> 1977 1978 * strip.c (debug_fd): New static variable. 1979 (tmp_debug_fname): Likewise. 1980 (cleanup_debug): New function using the above to clean up temporary 1981 debug file. 1982 (INTERNAL_ERROR): Call cleanup_debug. 1983 (handle_elf): Use debug_fd and tmp_debug_fname statics and call 1984 cleanup_debug before any error. Use output_fname instead of fname in 1985 error messages when it exists (-o was given). SHT_NOBITS sections 1986 can also be moved freely even if SHF_ALLOC is set. Add various 1987 sanity checks. Use elf_assert instead of plain assert. 1988 19892015-05-08 Mark Wielaard <mjw@redhat.com> 1990 1991 * nm.c (show_symbols): Call gelf_fsize with EV_CURRENT. 1992 * strip.c (handle_elf): Likewise. 1993 19942015-05-06 Mark Wielaard <mjw@redhat.com> 1995 1996 * elflint.c (check_gnu_hash): Return early when 2nd hash function 1997 shift too big. Check there is enough data available. Make sure 1998 bitmask_words is not zero. 1999 (check_verdef): Use Elf64_Word for shdr->sh_info cnt. 2000 (check_verneed): Likewise. 2001 (check_attributes): Break when vendor name isn't terminated. 2002 Add overflow check for subsection_len. 2003 20042015-05-05 Mark Wielaard <mjw@redhat.com> 2005 2006 * nm.c (show_symbols): Handle dwarf_linesrc returning NULL. 2007 20082015-05-04 Max Filippov <jcmvbkbc@gmail.com> 2009 2010 * ar.c (do_oper_extract): Replace struct timeval with struct timespec 2011 and futimes with futimens. 2012 * strip.c (process_file): Replace struct timeval with struct timespec. 2013 (handle_elf, handle_ar): Replace struct timeval with struct timespec 2014 in prototype. Replace futimes with futimens. 2015 20162015-05-04 Max Filippov <jcmvbkbc@gmail.com> 2017 2018 * addr2line.c (main): Drop mtrace() call and #include <mcheck.h>. 2019 * ar.c: Likewise. 2020 * ld.c: Likewise. 2021 * nm.c: Likewise. 2022 * objdump.c: Likewise. 2023 * ranlib.c: Likewise. 2024 * size.c: Likewise. 2025 * strip.c: Likewise. 2026 * unstrip.c: Likewise. 2027 20282015-05-04 Anthony G. Basile <blueness@gentoo.org> 2029 2030 * Makefile.am (readelf_LDADD, nm_LDADD, size_LDADD, strip_LDADD) 2031 (ld_LDADD, elflint_LDADD, findtextrel_LDADD, addr2line_LDADD) 2032 (elfcmp_LDADD, objdump_LDADD, ranlib_LDADD, strings_LDADD) 2033 (ar_LDADD, unstrip_LDADD, stack_LDADD): Append $(argp_LDADD). 2034 20352015-03-22 Mark Wielaard <mjw@redhat.com> 2036 2037 * readelf.c (print_debug_frame_section): Cast start to Dwarf_Off 2038 before subtracting cie_id. And cast cie_offset to Dwarf_Off before 2039 comparison. 2040 20412015-03-22 Mark Wielaard <mjw@redhat.com> 2042 2043 * readelf.c (print_gdb_index_section): Check all offsets used 2044 against section d_size. 2045 20462015-03-17 Mark Wielaard <mjw@redhat.com> 2047 2048 * readelf.c (print_debug): Don't return, but always use dummy_dbg. 2049 20502015-03-17 Mark Wielaard <mjw@redhat.com> 2051 2052 * readelf.c (print_gdb_index_section): Add overflow checking for 2053 dataend checks. 2054 20552015-03-14 Mark Wielaard <mjw@redhat.com> 2056 2057 * nm.c (INTERNAL_ERROR): Remove __DATE__. 2058 * objdump.c (INTERNAL_ERROR): Likewise. 2059 * size.c (INTERNAL_ERROR): Likewise. 2060 * strip.c (INTERNAL_ERROR): Likewise. 2061 20622015-03-18 Petr Machata <pmachata@redhat.com> 2063 2064 * readelf.c (dwarf_tag_string, dwarf_attr_string) 2065 (dwarf_form_string, dwarf_lang_string, dwarf_inline_string) 2066 (dwarf_encoding_string, dwarf_access_string) 2067 (dwarf_visibility_string, dwarf_virtuality_string) 2068 (dwarf_identifier_case_string, dwarf_calling_convention_string) 2069 (dwarf_ordering_string, dwarf_discr_list_string) 2070 (dwarf_locexpr_opcode_string): Adjust uses of know-dwarf.h macros 2071 to match the API changes. 2072 20732015-03-09 Mark Wielaard <mjw@redhat.com> 2074 2075 * elflint.c (compare_hash_gnu_hash): Correct gnu_symbias usage. 2076 20772015-01-03 Mark Wielaard <mjw@redhat.com> 2078 2079 * elfcmp (main): Check section name is not NULL. Check sh_entsize 2080 is not zero for symbol tables. Check phdrs are not NULL. 2081 (search_for_copy_reloc): Check sh_entsize is not zero. 2082 20832014-12-30 Mark Wielaard <mjw@redhat.com> 2084 2085 * elflint.c (check_scn_group): Check d_buf and name are not NULL. 2086 (is_rel_dyn): Check d is not NULL. Check shdr->sh_entsize is not 2087 zero. 2088 (check_dynamic): Check strshdr is not NULL. Check d_tag is positive. 2089 (check_symtab_shndx): Check symshdr and data->d_buf are not NULL. 2090 Check shdr and symshdr sh_entsize are not zero. 2091 (check_gnu_hash): Make sure maskidx is smaller than bitmask_words. 2092 Check symshdr->sh_entsize is not zero. Check data->d_buf is not 2093 NULL. 2094 (compare_hash_gnu_hash): Check sections d_buf are not NULL. 2095 Check section data is large enough. Use gnu_symbias. 2096 (check_group): Check section val is valid. 2097 (has_copy_reloc): Check sh_entsize is not zero. 2098 (check_versym): Likewise. 2099 (unknown_dependency_p): Likewise. 2100 (check_verneed): Break on invalid ref or offset. Don't assert. 2101 Report error when next offset is zero, but more vers expected. 2102 (check_verdef): Likewise. 2103 (check_attributes): Make sure d_buf is not NULL. 2104 (check_note): Likewise. 2105 (check_note_section): Likewise. 2106 (check_program_header): Make sure section name is not NULL. 2107 21082014-12-26 Mark Wielaard <mjw@redhat.com> 2109 2110 * strings.c (read_elf): Produce error when section data falls outside 2111 file. 2112 21132014-12-26 Mark Wielaard <mjw@redhat.com> 2114 2115 * nm.c (show_symbols): Guard against divide by zero in error check. 2116 Add section index number in error message. 2117 21182014-12-26 Mark Wielaard <mjw@redhat.com> 2119 2120 * nm.c (handle_ar): Skip over /SYM64/ entries. 2121 21222014-12-26 Mark Wielaard <mjw@redhat.com> 2123 2124 * nm.c (handle_ar): Break on arsym with invalid offset. 2125 21262014-12-20 Mark Wielaard <mjw@redhat.com> 2127 2128 * readelf.c (print_debug_macinfo_section): Mark cus sentinel files 2129 as -1 non-existent. Check macoff against sentinel cus. 2130 21312014-12-20 Mark Wielaard <mjw@redhat.com> 2132 2133 * readelf.c (print_debug_exception_table): Add max_action overflow 2134 check. Check action_table_end before reading slib128. Check 2135 max_ar_filter underflow. 2136 21372014-12-18 Ulrich Drepper <drepper@gmail.com> 2138 2139 * Makefile.am: Suppress output of textrel_check command. 2140 21412014-12-17 Mark Wielaard <mjw@redhat.com> 2142 2143 * readelf.c (print_cfa_program): Add bounds check before each op that 2144 takes at least one argument. 2145 21462014-12-16 Mark Wielaard <mjw@redhat.com> 2147 2148 * readelf.c (print_decoded_line_section): Print dwarf_errmsg if 2149 dwarf_onesrcline or dwarf_linesrc fails. 2150 21512014-12-16 Mark Wielaard <mjw@redhat.com> 2152 2153 * readelf.c (print_debug_line_section): Correct overflow check for 2154 unit_length. 2155 (print_debug_aranges_section): Correct overflow check for length. 2156 21572014-12-15 Mark Wielaard <mjw@redhat.com> 2158 2159 * readelf.c (notice_listptr): Return false if offset doesn't fit 2160 in 61-bits. 2161 (attr_callback): Warn if loclist or rangelist offset doesn't fit. 2162 21632014-12-15 Mark Wielaard <mjw@redhat.com> 2164 2165 * readelf.c (print_ops): Don't assert when addr_size or ref_size 2166 is not 4 or 8, just report invalid data. 2167 21682014-12-15 Mark Wielaard <mjw@redhat.com> 2169 2170 * readelf.c (print_gdb_index_section): Add more bounds checks. 2171 21722014-12-15 Mark Wielaard <mjw@redhat.com> 2173 2174 * readelf.c (print_debug_line_section): Check there is enough room 2175 for DW_LNE_set_address argument. Make sure there is enough room 2176 for the the initial unit_length. 2177 21782014-12-14 Mark Wielaard <mjw@redhat.com> 2179 2180 * elflint.c (check_attributes): Call get_uleb128 with end pointer. 2181 * readelf.c (print_attributes): Likewise. 2182 (print_ops): Likewise and also for get_sleb128. 2183 (print_cfa_program): Likewise and add more readp bounds checks. 2184 (read_encoded): Likewise. 2185 (print_debug_frame_section): Likewise. 2186 (print_debug_line_section): Likewise. 2187 (print_debug_macinfo_section): Likewise. 2188 (print_debug_macro_section): Likewise. 2189 (print_debug_exception_table): Likewise. 2190 21912014-12-16 Mark Wielaard <mjw@redhat.com> 2192 2193 * elfcmp.c (compare_Elf32_Word): Make sure (unsigned) Elf32_Word 2194 difference doesn't wrap around before returning as int. 2195 21962014-12-11 Mark Wielaard <mjw@redhat.com> 2197 2198 * readelf.c (print_debug_exception_table): Check TType base offset 2199 and Action table are sane. 2200 22012014-12-11 Mark Wielaard <mjw@redhat.com> 2202 2203 * readelf.c (print_debug_frame_section): Check number of augmentation 2204 chars to print. 2205 22062014-12-09 Mark Wielaard <mjw@redhat.com> 2207 2208 * readelf.c (handle_file_note): Check count fits data section and 2209 doesn't overflow fptr. 2210 22112014-12-08 Mark Wielaard <mjw@redhat.com> 2212 2213 * readelf.c (print_debug_exception_table): Report invalid data if 2214 action table doesn't immediately follow call site table. 2215 22162014-12-10 Josh Stone <jistone@redhat.com> 2217 2218 * addr2line.c (get_diename): New, get linkage_name or name. 2219 * addr2line.c (print_dwarf_function): Use get_diename. 2220 * addr2line.c (handle_address): Likewise. 2221 * addr2line.c (print_diesym): Removed. 2222 22232014-12-10 Josh Stone <jistone@redhat.com> 2224 2225 * addr2line.c (handle_address): Find the proper inline parents. 2226 22272014-12-07 Mark Wielaard <mjw@redhat.com> 2228 2229 * readelf.c (print_debug_line_section): max_ops_per_instr cannot 2230 be zero. 2231 22322014-12-07 Mark Wielaard <mjw@redhat.com> 2233 2234 * readelf.c (print_ops): Handle zero ref_size for DW_OP_call_ref 2235 and DW_OP_GNU_implicit_pointer. 2236 22372014-12-04 Mark Wielaard <mjw@redhat.com> 2238 2239 * objdump.c (show_relocs_x): Make sure destshdr exists. 2240 (show_relocs_rel): Don't rely on shdr->sh_entsize, use gelf_fsize. 2241 (show_relocs_rela): Likewise. 2242 (show_relocs): Make sure destshdr, symshdr and symdata exists. 2243 22442014-11-30 Mark Wielaard <mjw@redhat.com> 2245 2246 * readelf.c (handle_sysv_hash64): Fix overflow check. 2247 22482014-11-28 Mark Wielaard <mjw@redhat.com> 2249 2250 * readelf.c (handle_relocs_rel): Don't reuse destshdr to store 2251 section header of a relocation against a STT_SECTION symbol. Use 2252 a new local variable secshdr. 2253 (handle_relocs_rela): Likewise. 2254 22552014-11-26 Mark Wielaard <mjw@redhat.com> 2256 2257 * readelf.c (print_debug_aranges_section): Cast Dwarf_Word length 2258 to ptrdiff_t for comparison. 2259 22602014-11-24 Mark Wielaard <mjw@redhat.com> 2261 2262 * readelf.c (print_debug_line_section): Check line_range is not zero 2263 before usage. 2264 22652014-11-23 Mark Wielaard <mjw@redhat.com> 2266 2267 * readelf.c (print_debug_aranges_section): Check length to catch 2268 nexthdr overflow. 2269 22702014-11-21 Mark Wielaard <mjw@redhat.com> 2271 2272 * readelf.c (print_attributes): Guard against empty section. 2273 Document attribute format. Break when vendor name isn't terminated. 2274 Add overflow check for subsection_len. Handle both gnu and non-gnu 2275 attribute tags. 2276 22772014-11-22 Mark Wielaard <mjw@redhat.com> 2278 2279 * elflint.c (check_sections): Call ebl_bss_plt_p without ehdr. 2280 * findtextrel.c (process_file): Use elf_getphdrnum. 2281 * readelf.c (process_elf_file): Remove redundant ehdr->e_phoff check. 2282 (print_phdr): Check phnum. 2283 * size.c (show_segments): Use elf_getphdrnum. 2284 * strip.c (handle_elf): Likewise. 2285 * unstrip.c (copy_elf): Likewise. 2286 (copy_elided_sections): Likewise. 2287 (handle_file): Likewise. 2288 22892014-11-18 Mark Wielaard <mjw@redhat.com> 2290 2291 * readelf.c (print_cfa_program): Fix sanity check of DW_FORM_block 2292 length. 2293 22942014-11-17 Mark Wielaard <mjw@redhat.com> 2295 2296 * readelf.c (handle_verneed): Check vna_next and vn_next exist. 2297 (handle_verdef): Check vda_next and vd_next exist. 2298 (handle_versym): Check vd_next, vna_next and vn_next exist. 2299 Check vername and filename are not NULL before use. 2300 23012014-11-17 Mark Wielaard <mjw@redhat.com> 2302 2303 * elfcmp.c (main): Check section names are NULL before use. 2304 * objdump.c (section_match): Likewise. 2305 * size.c (show_sysv): Likewise. 2306 23072014-11-17 Mark Wielaard <mjw@redhat.com> 2308 2309 * readelf.c (print_debug_frame_section): Warn if ptr_size is not 4 2310 or 8 instead of just calling print_cfa_program. 2311 23122014-11-16 Mark Wielaard <mjw@redhat.com> 2313 2314 * readelf (process_elf_file): Set phnum to zero if there aren't 2315 actually any pheaders. 2316 (print_phdr): Check there actually is a phdr. 2317 23182014-11-16 Mark Wielaard <mjw@redhat.com> 2319 2320 * readelf.c (print_cfa_program): Check block len before calling 2321 print_ops. 2322 23232014-11-14 Mark Wielaard <mjw@redhat.com> 2324 2325 * readelf.c (print_debug_frame_section): Sanity Check CIE 2326 unit_length and augmentationlen. 2327 23282014-11-14 Mark Wielaard <mjw@redhat.com> 2329 2330 * readelf.c (handle_versym): Check def == NULL before use. 2331 23322014-11-08 Mark Wielaard <mjw@redhat.com> 2333 2334 * readelf.c (handle_versym): Initialize vername and filename array 2335 elements. 2336 23372014-11-07 Mark Wielaard <mjw@redhat.com> 2338 2339 * readelf.c (handle_sysv_hash): Sanity check section contents. 2340 (handle_sysv_hash64): Likewise. 2341 (handle_gnu_hash): Likewise. 2342 23432014-09-14 Petr Machata <pmachata@redhat.com> 2344 2345 * readelf.c (handle_relocs_rela): Typo fix, test DESTSHDR properly. 2346 23472014-09-12 Petr Machata <pmachata@redhat.com> 2348 2349 * readelf.c (encoded_ptr_size): In the switch statement, change 2350 magic constants 3 and 4 to DW_EH_PE_* counterparts. Still accept 2351 0. Print diagnostic for anything else. 2352 23532014-08-25 Josh Stone <jistone@redhat.com> 2354 2355 * Makefile.am: Prevent premature @AR@ replacement in a sed expression. 2356 23572014-07-04 Menanteau Guy <menantea@linux.vnet.ibm.com> 2358 Mark Wielaard <mjw@redhat.com> 2359 2360 * elflint (check_symtab): Add ".TOC." to the list of possibly 2361 dangling symbols because of sourceware PR13621. 2362 23632014-06-14 Mark Wielaard <mjw@redhat.com> 2364 2365 * elflint (check_symtab): Use ebl_func_addr_mask on st_value. 2366 23672014-05-27 Mark Wielaard <mjw@redhat.com> 2368 2369 * readelf.c (print_debug): Skip section if name is NULL. 2370 23712014-05-26 Mark Wielaard <mjw@redhat.com> 2372 2373 * readelf.c (handle_relocs_rela): Print header like handle_relocs_rel 2374 does, when sh_info == 0. 2375 23762014-05-26 Mark Wielaard <mjw@redhat.com> 2377 2378 * unstrip.c (find_alloc_sections_prelink): Allow non-split .bss 2379 section when sh_size of the original and undo .bss section are equal. 2380 23812014-05-26 Mark Wielaard <mjw@redhat.com> 2382 2383 * unstrip.c (options): Add --force, -F. 2384 (struct arg_info): Add bool force. 2385 (parse_opt): Handle 'F', set force. 2386 (handle_explicit_files): Add force argument, add warn function, 2387 separate check ehdr field checks, use warn. 2388 (handle_dwfl_module): Add force argument, pass on to 2389 handle_explicit_files. 2390 (handle_output_dir_module): Add force argument, pass on to 2391 handle_dwfl_module. 2392 (handle_implicit_modules): Pass info->force to handle_dwfl_module and 2393 handle_output_dir_module. 2394 (main): Pass info.force to handle_explicit_files. 2395 23962014-05-19 Mark Wielaard <mjw@redhat.com> 2397 2398 * elflint.c (check_reloc_shdr): Check ebl_check_reloc_target_type. 2399 24002014-05-01 Mark Wielaard <mjw@redhat.com> 2401 2402 * readelf.c (find_no_debuginfo): Call dwfl_standard_find_debuginfo 2403 if looking for alternate debug file. 2404 24052014-04-11 Mark Wielaard <mjw@redhat.com> 2406 2407 * Makefile.am (AM_CPPFLAGS): Add -I libdwelf. 2408 24092014-04-22 Mark Wielaard <mjw@redhat.com> 2410 2411 * readelf.c (handle_core_item): Make sure variable length array 2412 contains at least enough space for terminating zero char. 2413 24142014-04-22 Mark Wielaard <mjw@redhat.com> 2415 2416 * readelf.c (print_gdb_index_section): Use unsigned int for 31 bits 2417 left shift. 2418 24192014-03-13 Mark Wielaard <mjw@redhat.com> 2420 2421 * Makefile.am: Remove no_mudflap.os. Remove libmudflap from all 2422 LDADD lines. 2423 * strings.c (process_chunk): Remove _MUDFLAP condition. 2424 24252014-04-09 Mark Wielaard <mjw@redhat.com> 2426 2427 * readelf.c (print_debug_aranges_section): Don't get the raw section 2428 data, use the possibly decompressed .[z]debug sectiondata. 2429 (print_debug_ranges_section): Likewise. 2430 (print_debug_frame_section): Likewise. 2431 (print_debug_line_section): Likewise. 2432 (print_debug_loc_section): Likewise. 2433 (print_debug_macinfo_section): Likewise. 2434 (print_debug_macro_section): Likewise. 2435 24362014-04-10 Mark Wielaard <mjw@redhat.com> 2437 2438 * readelf.c (buf_read_ulong): Pass actual long size to convert. 2439 24402014-03-05 Mark Wielaard <mjw@redhat.com> 2441 2442 * readelf.c (attr_callback): Print DW_FORM_sdata values as signed 2443 numbers. 2444 24452014-02-24 Mark Wielaard <mjw@redhat.com> 2446 2447 * readelf (print_phdr): Check there is a SHT_PROGBITS section at the 2448 offset given by p_offsets for a PT_INTERP segment before trying to 2449 display the interpreter string. 2450 24512014-02-07 Mark Wielaard <mjw@redhat.com> 2452 2453 * readelf.c (print_phdr): Check phdr->p_filesz and make sure 2454 interpreter string is zero terminated before calling printf. 2455 24562014-01-22 Mark Wielaard <mjw@redhat.com> 2457 2458 * Makefile.am (nm_no_Wformat): Removed. 2459 (size_no_Wformat): Likewise. 2460 (strings_no_Wformat): Likewise. 2461 (addr2line_no_Wformat): Likewise. 2462 * size.c (show_sysv): Use fmtstr directly as literal in printf. 2463 (show_sysv_one_line): Likewise. 2464 * strings.c (locfmt): Removed. 2465 (radix): New static enum. 2466 (parse_opt): Set radix, not locfmt. 2467 (process_chunk_mb): Use fmtstr directly as literal in printf based 2468 on radix. 2469 (process_chunk): Likewise. 2470 * nm.c (show_symbols_sysv): Use fmtstr directly as literal in printf. 2471 (show_symbols_bsd): Likewise. 2472 (show_symbols_posix): Likewise. 2473 24742014-01-21 Mark Wielaard <mjw@redhat.com> 2475 2476 * stack.c (show_inlines): New static boolean. 2477 (print_frame): New function split out from... 2478 (print_frames): ..here. If show_inlines is true and we found a 2479 DIE for the frame address, call print_inline_frames otherwise 2480 call print_frame. Keep track of and track frame_nr. 2481 (print_inline_frames): New function. 2482 (parse_opt): Handle '-i'. 2483 (main): Add 'i' to options. 2484 24852014-01-27 Mark Wielaard <mjw@redhat.com> 2486 2487 * stack.c (maxframes): Initialize to 256. 2488 (main): Document new default in options. Document magic number 2489 used in frames.allocated initialization. 2490 24912014-01-20 Mark Wielaard <mjw@redhat.com> 2492 2493 * stack.c (show_debugname): New static boolean. 2494 (die_name): New function. 2495 (print_frames): If show_debugname is true set symname to the 2496 first function-like DIE with a name in scope for the address in 2497 the debuginfo. 2498 (parse_opt): Handle '-d'. 2499 (main): Add 'd' to options. 2500 25012014-01-20 Mark Wielaard <mjw@redhat.com> 2502 2503 * addr2line.c (handle_address): Initialize scopes to NULL. 2504 25052014-01-17 Roland McGrath <roland@redhat.com> 2506 2507 * strip.c (handle_elf): Check for bogus values in sh_link, sh_info, 2508 st_shndx, e_shstrndx, and SHT_GROUP or SHT_SYMTAB_SHNDX data. 2509 Don't use assert on input values, instead bail with "illformed" error. 2510 25112014-01-17 Roland McGrath <roland@redhat.com> 2512 2513 * readelf.c (handle_dynamic, handle_symtab): Check for bogus sh_link. 2514 (handle_verneed, handle_verdef, handle_versym, handle_hash): Likewise. 2515 (handle_scngrp): Check for bogus sh_info. 2516 25172014-01-17 Jakub Jelinek <jakub@redhat.com> 2518 2519 * elflint.c (section_name): Return "<invalid>" instead of 2520 crashing on invalid section name. 2521 (check_symtab, is_rel_dyn, check_rela, check_rel, check_dynamic, 2522 check_symtab_shndx, check_hash, check_versym): Robustify. 2523 (check_hash): Don't check entries beyond end of section. 2524 (check_note): Don't crash if gelf_rawchunk fails. 2525 25262014-01-17 Petr Machata <pmachata@redhat.com> 2527 2528 * readelf.c (handle_dynamic, handle_relocs_rel) 2529 (handle_relocs_rela, handle_versym, print_liblist): 2530 Use gelf_fsize instead of relying on shdr->sh_entsize. 2531 25322014-01-14 Mark Wielaard <mjw@redhat.com> 2533 2534 * readelf.c (print_debug_macro_section): Clear vendor array before 2535 use. 2536 25372014-01-15 Jan Kratochvil <jan.kratochvil@redhat.com> 2538 2539 Fix corruption of non-C++ symbols by the demangler. 2540 * nm.c (show_symbols_sysv, show_symbols_bsd, show_symbols_posix) 2541 (show_symbols): Check for _Z. 2542 * stack.c (print_frames) <USE_DEMANGLE>: Check for _Z. 2543 25442014-01-02 Mark Wielaard <mjw@redhat.com> 2545 2546 * stack.c (show_raw): Declare unconditionally. 2547 (parse_opt): Handle '-r' unconditionally. 2548 (main): Show "raw" option even without USE_DEMANGLE. 2549 25502014-01-02 Mark Wielaard <mjw@redhat.com> 2551 2552 * stack.c (print_frames): Print 0x before build-id hex-offset. 2553 25542014-01-02 Mark Wielaard <mjw@redhat.com> 2555 2556 * stack.c (maxframes): Increase to 2048. 2557 (struct frames): Add allocated field. 2558 (frame_callback): If frames used is frames allocated, realloc. 2559 (print_frames): Show an error if maxframes has been reached. 2560 (parse_opt): Allow -n 0 for unlimited frames. 2561 (main): Document -n 0 and new default 2048 frames. Allocate initial 2562 number of frames with malloc. 2563 25642013-12-30 Mark Wielaard <mjw@redhat.com> 2565 2566 * stack.c (parse_opt): Explicitly call dwfl_linux_proc_attach 2567 or dwfl_core_file_attach and check for errors. 2568 25692013-12-28 Mark Wielaard <mjw@redhat.com> 2570 2571 * stack.c (print_frames): Remove address width code and use... 2572 (get_addr_width): ...this new function. 2573 (show_modules): New static boolean. 2574 (module_callback): New static function. 2575 (parse_opt): Handle '-l'. 2576 (main): Add 'l' to options. If show_modules then use dwfl_getmodules 2577 with module_callback to show all detected modules and possible 2578 build_id, elf and dwarf files. 2579 25802013-12-27 Mark Wielaard <mjw@redhat.com> 2581 2582 * stack.c (frames_shown): New static boolean. 2583 (EXIT_OK,EXIT_ERROR,EXIT_BAD,EXIT_USAGES): New defines. 2584 (frame_callback): Return -1 on error. Don't print error. 2585 (print_frames): Add arguments, tid, dwflerr and what. Print tid. 2586 If there was an error report it with address and module if possible. 2587 Record whether any frames were actually printed. 2588 (thread_callback): Collect tid and err, pass it to print_frames. 2589 (parse_opt): Use EXIT_BAD for errors. On ARGP_KEY_END print errno 2590 if dwfl_linux_proc_report returned it. Check whether we are properly 2591 attached with dwfl_pid. 2592 (main): Document exit status. Don't report DWARF_CB_ABORT from 2593 callbacks as error. Pass real errors to print_frames. Return 2594 EXIT_BAD if no frames could be shown. Return EXIT_ERROR if there 2595 were any non-fatal errors. 2596 25972013-12-23 Mark Wielaard <mjw@redhat.com> 2598 2599 * Makefile.am (stack_LDADD): Add demanglelib. 2600 * stack.c (show_quiet): New static boolean, default false. 2601 (show_raw): Likewise. 2602 (demangle_buffer_len): New static size_t. 2603 (demangle_buffer): New static char *. 2604 (print_frames): Don't resolve pc name if show_quiet. Demangle name 2605 unless show_raw. 2606 (parse_opt): Handle '-q' and '-r'. 2607 (main): Add 'q' and 'r' to options. Free demangle_buffer. 2608 26092013-12-23 Mark Wielaard <mjw@redhat.com> 2610 2611 * stack.c (OPT_DEBUGINFO): New define. 2612 (OPT_COREFILE): Likewise. 2613 (pid): New static. 2614 (core_fd): Likewise. 2615 (core): Likewise. 2616 (exec): Likewise. 2617 (debuginfo_path): Likewise. 2618 (parse_opt): Handle '-p', '--core', '-e' and '--debuginfo-path'. 2619 Do argument sanity checking. Setup Dwfl. 2620 (main): Add 'p', 'core', 'e' and 'debuginfo-path' to options. 2621 Remove argp_child children, simplify argp doc, remove custom 2622 usage message and construction of dwfl with dwfl_standard_argp. 2623 Use pid directly as tid. close core and core_fd if opened. Print 2624 pid of process or core. 2625 26262013-12-23 Mark Wielaard <mjw@redhat.com> 2627 2628 * stack.c (show_build_id): New static boolean. 2629 (print_frames): Print module build-id, load address and pc offset 2630 if show_build_id is true. 2631 (parse_opt): Handle '-b'. 2632 (main): Add -b to options. 2633 26342013-12-22 Mark Wielaard <mjw@redhat.com> 2635 2636 * stack.c (maxframes): New static unsigned. Initialize to 64. 2637 (struct frame): New struct. 2638 (struct frames): Likewise. 2639 (dwfl): New static Dwfl pointer. 2640 (frame_callback): Use arg as struct frames and fill it next frame. 2641 Return DWARF_CB_ABORT when maxframes has been reached. Move 2642 printing of frame to... 2643 (print_frames): ...here. New function. 2644 (thread_callback): Use arg as struct frames and set frames to zero. 2645 Call print_frames. 2646 (parse_opt): Handle '-n'. 2647 (main): Add -n to options. Allocate frames using maxframes. Pass 2648 frames to frame_callback and thread_callback. 2649 26502013-12-20 Mark Wielaard <mjw@redhat.com> 2651 2652 * stack.c (show_one_tid): New static boolean. 2653 (parse_opt): Handle '-1'. 2654 (main): Add -1 to options. Call dwfl_getthread_frames when 2655 show_one_tid is true. 2656 26572013-12-18 Mark Wielaard <mjw@redhat.com> 2658 2659 * addr2line.c (options): Add symbol-sections, 'x'. 2660 (show_symbol_sections): New static bool. 2661 (parse_opt): Handle 'x'. 2662 (print_addrsym): Use dwfl_module_addrinfo value.r 2663 Also show section of address with show_symbol_sections. 2664 (find_symbol): Use dwfl_module_getsym_info and set value. 2665 (handle_address): Request value and use it instead of sym.st_value. 2666 * readelf.c (format_dwarf_addr): Use dwfl_module_addrinfo to get 2667 name and offset. 2668 26692013-12-17 Masatake YAMATO <yamato@redhat.com> 2670 Mark Wielaard <mjw@redhat.com> 2671 2672 * stack.c (show_activation, show_module, show_source): New variables. 2673 (parse_opt): Set show_activation if -a option is given. 2674 Set show_module if -m option is given. Set show_source if -s option 2675 is given. Set all show booleans when -v option is given. 2676 (main): Added `-a', `-m', `-s', and `-v' to the help message. 2677 (frame_callback): Print module and source file information. 2678 26792013-11-25 Petr Machata <pmachata@redhat.com> 2680 2681 * elflint.c (valid_e_machine): Add EM_AARCH64. 2682 26832013-11-14 Petr Machata <pmachata@redhat.com> 2684 2685 * readelf.c (handle_core_item) <'h'>: New branch for handling 2686 fields that shouldn't be displayed. 2687 26882013-11-10 Mark Wielaard <mjw@redhat.com> 2689 2690 * stack.c: Use ARGP_PROGRAM_VERSION_HOOK_DEF and 2691 ARGP_PROGRAM_BUG_ADDRESS_DEF. 2692 (print_version): New function. 2693 26942013-11-09 Mark Wielaard <mjw@redhat.com> 2695 2696 * arlib.c (arlib_init): Call snprintf before using the result 2697 with memcpy. 2698 (arlib_finalize): Likewise. 2699 * nm.c (show_symbols_sysv): Don't modify cnt inside assert. 2700 27012013-11-07 Jan Kratochvil <jan.kratochvil@redhat.com> 2702 2703 * Makefile.am (bin_PROGRAMS): Add stack. 2704 (stack_LDADD): New. 2705 * stack.c: New file. 2706 27072013-11-05 Mark Wielaard <mjw@redhat.com> 2708 2709 * readelf.c (print_debug_ranges_section): Cast address to size_t 2710 before comparison. 2711 (print_debug_loc_section): Likewise. 2712 27132013-10-18 Mark Wielaard <mjw@redhat.com> 2714 2715 * ar.c (main): Correct operation check when instance_specifed is set. 2716 27172013-09-26 Petr Machata <pmachata@redhat.com> 2718 2719 * readelf.c (handle_file_note): New function. 2720 (handle_notes_data): Call it to handle NT_FILE notes. 2721 27222013-09-26 Petr Machata <pmachata@redhat.com> 2723 2724 * readelf.c (handle_siginfo_note): New function. 2725 (handle_notes_data): Call it to handle NT_SIGINFO notes. 2726 (buf_read_int, buf_read_ulong, buf_has_data): New functions. 2727 27282013-08-13 Mark Wielaard <mjw@redhat.com> 2729 2730 * addr2line.c (options): Add "inlines", 'i'. 2731 (show_inlines): New bool. 2732 (parse_opt): Handle 'i'. 2733 (print_diesym): New static function. 2734 (print_src): New function taking code from... 2735 (handle_address): here. Call print_src. Print inlines. 2736 27372013-08-12 Mark Wielaard <mjw@redhat.com> 2738 2739 * addr2line.c (main): If there is a newline char at end of buf, 2740 then remove it. 2741 27422013-07-05 Mark Wielaard <mjw@redhat.com> 2743 2744 * readelf.c (print_ops): Take CU as argument, use it to print 2745 parameter_ref DIE offset. 2746 (struct listptr): Replace base field with cu. 2747 (listptr_base): New function. 2748 (compare_listptr): Use listptr_base. 2749 (notice_listptr): Take CU as argument. 2750 (skip_listptr_hole): Likewise. 2751 (print_debug_ranges_section): Pass NULL as CU to skip_listptr_hole. 2752 (print_cfa_program): Pass NULL as CU to print_ops. 2753 (struct attrcb_args): Replace cu_base field with cu. 2754 (attr_callback): Pass cu not cu_base to notice_listptr. 2755 (print_debug_units): Don't calculate base, just set cu. 2756 (print_debug_loc_section): Pass cu to skip_listptr_hole and 2757 print_ops. 2758 27592013-05-06 Mark Wielaard <mjw@redhat.com> 2760 2761 * readelf.c (print_ops): Format first DW_OP_GNU_implicit_pointer 2762 argument as DIE offset. 2763 27642013-04-24 Mark Wielaard <mjw@redhat.com> 2765 2766 * Makefile.am: Use AM_CPPFLAGS instead of INCLUDES. 2767 27682013-03-25 Mark Wielaard <mjw@redhat.com> 2769 2770 * readelf.c (argp_options): Add decodedline. 2771 (decodedline): New boolean initialized to false. 2772 (parse_opt): Set decodedline when arg is decodedline. 2773 (print_decoded_line_section): New function. 2774 (print_debug_line_section): Call print_decoded_line_section when 2775 decodedline is true. 2776 27772013-03-25 Mark Wielaard <mjw@redhat.com> 2778 2779 * readelf.c (argp_option): Add decodedaranges. 2780 (decodedaranges): New boolean initialized to false. 2781 (parse_opt): Set decodedaranges when arg is decodedaranges. 2782 (print_debug_aranges_section): Reimplemented and original 2783 implementation renamed to... 2784 (print_decoded_aranges_section): this. 2785 27862013-03-25 Mark Wielaard <mjw@redhat.com> 2787 2788 * readelf.c (attrcb_args): Add Dwarf_Die. 2789 (attr_callback): When highpc is in constant form also print as 2790 address. 2791 (print_debug_units): Set args.die. 2792 27932013-03-19 Mark Wielaard <mjw@redhat.com> 2794 2795 * readelf.c (print_gdb_index_section): Free format_dwarf_addr results. 2796 27972013-03-18 Mark Wielaard <mjw@redhat.com> 2798 2799 * readelf.c (print_gdb_index_section): Accept version 8. 2800 28012013-03-01 Mark Wielaard <mjw@redhat.com> 2802 2803 * findtextrel.c (process_file): Release ELF and close file when not 2804 text relocations are found. 2805 * strip.c (handle_elf): Track memory used for .debuglink section data 2806 and free when done. 2807 28082013-02-24 Mark Wielaard <mjw@redhat.com> 2809 2810 * elflint.c (check_symtab): Add __bss_start__ to the list of symbols 2811 allowed to have out of section values because of GNU ld bugs. 2812 28132013-02-06 Mark Wielaard <mjw@redhat.com> 2814 2815 * elflint.c (check_symtab): Add __bss_start and __TMC_END__ to the 2816 list of symbols allowed to have out of section values because of 2817 GNU ld bugs in either .symtab or .dynsym, but only when they are 2818 zero sized. 2819 28202013-01-24 Mark Wielaard <mjw@redhat.com> 2821 2822 * readelf.c (argp_option): Add unresolved-address-offsets, U. 2823 (print_unresolved_addresses): New static. 2824 (parse_opt): Handle 'U', set print_unprocessed_values. 2825 (format_dwarf_addr): Take and handle new raw argument. 2826 (print_ops): Call format_dwarf_addr with raw offset values. 2827 (print_debug_ranges_section): Likewise. 2828 (print_debug_frame_section): Likewise. 2829 (attr_callback): Likewise. 2830 (print_debug_line_section): Likewise. 2831 (print_debug_loc_section): Likewise. 2832 (print_gdb_index_section): Likewise. 2833 28342013-01-18 Mark Wielaard <mjw@redhat.com> 2835 2836 * readelf.c (struct listptr): Add base Dwarf_Addr field. 2837 (compare_listptr): Warn for same offset with different base. 2838 (notice_listptr): Take base argument and set it. 2839 (skip_listptr_hole): Likewise. 2840 (struct attrcb_args): Removed unused cu_offset field. 2841 Add cu_base Dwarf_Addr field. 2842 (attr_callback): Call notice_listptr with cbargs->cu_base. 2843 (print_debug_units): Set args.cu_base. 2844 (print_debug_ranges_section): Get base and use for format_dwarf_addr. 2845 (print_debug_loc_section): Likewise. 2846 28472013-01-29 Jan Kratochvil <jan.kratochvil@redhat.com> 2848 2849 * readelf.c (handle_core_items): Limit special repeated items handling 2850 to single-item formats '\n', 'b' and 'B', assert OFFSET 0 there. 2851 28522012-12-18 Mark Wielaard <mark@bordewijk.wildebeest.org> 2853 2854 * readelf.c (ELF_INPUT_SECTION): New argp key value. 2855 (argp_option): Add elf-section. 2856 (elf_input_section): New static. 2857 (parse_opt): Handle ELF_INPUT_SECTION and set elf_input_section. 2858 (open_input_section): New function. 2859 (process_file): Call open_input_section if elf_input_section set. 2860 28612013-01-13 David Abdurachmanov <David.Abdurachmanov@cern.ch> 2862 2863 ar.c (do_oper_delete): Fix num passed to memset. 2864 28652012-12-21 Mark Wielaard <mjw@redhat.com> 2866 2867 * readelf.c (print_debug_frame_section): Adjust FDE start address 2868 if pcrel before feeding it to format_dwarf_addr. 2869 28702012-12-21 Mark Wielaard <mjw@redhat.com> 2871 2872 * addr2line.c (main): Call dwfl_end. 2873 28742012-12-11 Roland McGrath <roland@hack.frob.com> 2875 2876 * nm.c (show_symbols_sysv): Fix size passed to snprintf for invalid 2877 sh_name case. 2878 Reported by David Abdurachmanov <David.Abdurachmanov@cern.ch>. 2879 28802012-10-16 Mark Wielaard <mjw@redhat.com> 2881 2882 * readelf.c (print_ops): DW_OP_skip and DW_OP_bra targets are 2883 calculated beginning after the operand and 2-byte constant. 2884 28852012-10-12 Jan Kratochvil <jan.kratochvil@redhat.com> 2886 2887 * readelf.c (ITEM_WRAP_COLUMN, REGISTER_WRAP_COLUMN): Merge to ... 2888 (WRAP_COLUMN): ... here. 2889 (print_core_item): Remove parameter format_max. Update function 2890 comment. Replace FORMAT_MAX by the real output width. 2891 (handle_core_item): Remove the FORMAT_MAX values in TYPES, DO_TYPE, 2892 calls of print_core_item, remove variable maxfmt, change 2893 ITEM_WRAP_COLUMN to WRAP_COLUMN. 2894 (handle_core_register): Remove the FORMAT_MAX values in TYPES, BITS, 2895 calls of print_core_item, change REGISTER_WRAP_COLUMN to WRAP_COLUMN. 2896 28972012-10-11 Jan Kratochvil <jan.kratochvil@redhat.com> 2898 2899 * readelf.c (handle_core_item) <b>: Make run an outer block variable. 2900 Increase run only if LASTBIT != 0. Print last element only if RUN > 0. 2901 29022012-08-27 Mark Wielaard <mjw@redhat.com> 2903 2904 * readelf.c (print_debug_macro_section): Print offset as PRIx64. 2905 29062012-08-27 Mark Wielaard <mjw@redhat.com> 2907 2908 * readelf.c (register_info): Handle loc == NULL. 2909 29102012-08-22 Jeff Kenton <jkenton@tilera.com> 2911 2912 * elflint.c (valid_e_machine): Add EM_TILEGX and EM_TILEPRO. 2913 29142012-08-16 Mark Wielaard <mjw@redhat.com> 2915 2916 * readelf.c (dwarf_tag_name): Renamed from dwarf_tag_string. 2917 Uses new dwarf_tag_string or adds ??? or lo_user+%#x when 2918 appropriate. 2919 (dwarf_attr_name): Likewise. 2920 (dwarf_form_name): Likewise. 2921 (dwarf_lang_name): Likewise. 2922 (dwarf_inline_name): Likewise. 2923 (dwarf_encoding_name): Likewise. 2924 (dwarf_access_name): Likewise. 2925 (dwarf_visibility_name): Likewise. 2926 (dwarf_virtuality_name): Likewise. 2927 (dwarf_identifier_case_name): Likewise. 2928 (dwarf_calling_convention_name): Likewise. 2929 (dwarf_ordering_name): Likewise. 2930 (dwarf_discr_list_name): Likewise. 2931 (print_ops): Remove KNOWN. Use dwarf_locexpr_opcode_string. 2932 (attr_callback): Call new dwarf_foobar_name instead of old 2933 dwarf_foobar_string functions. 2934 (dwarf_tag_string): New function using known-dwarf.h macros. 2935 (dwarf_attr_string): Likewise. 2936 (dwarf_form_string): Likewise. 2937 (dwarf_lang_string): Likewise. 2938 (dwarf_inline_string): Likewise. 2939 (dwarf_encoding_string): Likewise. 2940 (dwarf_access_string): Likewise. 2941 (dwarf_visibility_string): Likewise. 2942 (dwarf_virtuality_string): Likewise. 2943 (dwarf_identifier_case_string): Likewise. 2944 (dwarf_calling_convention_string): Likewise. 2945 (dwarf_ordering_string): Likewise. 2946 (dwarf_discr_list_string): Likewise. 2947 (dwarf_locexpr_opcode_string): Likewise. 2948 29492012-06-27 Mark Wielaard <mjw@redhat.com> 2950 2951 * readelf.c (dwarf_form_string): Handle DW_FORM_GNU_ref_alt and 2952 DW_FORM_GNU_strp_alt. 2953 (attr_callback): Likewise. 2954 29552012-07-30 Petr Machata <pmachata@redhat.com> 2956 2957 * nm.c (show_symbols_bsd): Reorder arguments in {S,}FMTSTRS (and 2958 corresponding printf) so that those that are referenced by only 2959 one of the formatting strings are at the end. 2960 29612012-07-29 Mark Wielaard <mjw@redhat.com> 2962 2963 * readelf.c (dwarf_lang_string): Use DW_LANG_ObjC, not DW_LANG_Objc. 2964 (print_ops): Use known[op], not op_name, for DW_OP_GNU_parameter_ref. 2965 29662012-07-19 Mark Wielaard <mjw@redhat.com> 2967 2968 * readelf.c (print_ops): Handle DW_OP_GNU_parameter_ref. 2969 29702012-07-11 Mark Wielaard <mjw@redhat.com> 2971 2972 * readelf.c (options): Add macro to help of debug-dump. 2973 (section_e): Add section_macro. 2974 (section_all): Add section_macro. 2975 (parse_opt): Handle macro. 2976 (print_debug_macro_section): New function. 2977 (print_debug): Add NEW_SECTION (macro). 2978 29792012-07-10 Mark Wielaard <mjw@redhat.com> 2980 2981 * readelf.c (print_gdb_index_section): Add version 7 support. 2982 Keep track of cu_nr. Print kind and static/global flag for each 2983 symbol. When a symbol is in the TU list add 'T'. 2984 29852012-06-26 Mark Wielaard <mjw@redhat.com> 2986 2987 * readelf.c (dwarf_attr_string): Add DW_AT_GNU_macros. 2988 29892012-06-22 Mark Wielaard <mjw@redhat.com> 2990 2991 * readelf.c (print_ops): Cast printf PRIu/x64 arguments to uint64_t 2992 for gcc 4.7 -Wformat. 2993 29942012-05-09 Roland McGrath <roland@hack.frob.com> 2995 2996 * elflint (check_sections): Allow zero sized sections at (filesz) end 2997 of segment. And make check overflow-proofed. 2998 29992012-04-24 Mark Wielaard <mjw@redhat.com> 3000 3001 * readelf.c (print_ops): Add DW_OP_GNU_push_tls_address, 3002 DW_OP_GNU_uinit and DW_OP_GNU_encoded_addr. 3003 30042012-03-28 Roland McGrath <roland@hack.frob.com> 3005 3006 * elflint.c (special_sections): Accept SHF_INFO_LINK for reloc sections. 3007 30082012-03-28 Mark Wielaard <mjw@redhat.com> 3009 3010 * readelf.c (print_debug_abbrev_section): Check there is Dwarf 3011 section data. 3012 (print_debug_str_section): Likewise. 3013 30142012-03-21 Mark Wielaard <mjw@redhat.com> 3015 3016 * readelf.c (print_gdb_index_section): Accept version 6. 3017 30182012-01-31 Mark Wielaard <mjw@redhat.com> 3019 3020 * readelf.c (attr_callback): Don't special case DW_FORM_sec_offset. 3021 30222012-01-21 Ulrich Drepper <drepper@gmail.com> 3023 3024 * addr2line.c: Update copyright year. 3025 * ar.c: Likewise. 3026 * elfcmp.c: Likewise. 3027 * elflint.c: Likewise. 3028 * findtextrel.c: Likewise. 3029 * ld.c: Likewise. 3030 * nm.c: Likewise. 3031 * objdump.c: Likewise. 3032 * ranlib.c: Likewise. 3033 * readelf.c: Likewise. 3034 * size.c: Likewise. 3035 * strings.c: Likewise. 3036 * strip.c: Likewise. 3037 * unstrip.c: Likewise. 3038 3039 * nm.c (argp_children): Define. 3040 (argp): Hook up argp_children. 3041 (handle_ar): Optimize puts call. 3042 (show_symbols_bsd): Use positional parameters to also print color 3043 codes. Don't print STT_FILE symbols. 3044 * objdump.c (options): Improve help text. 3045 (argp_children): Define. 3046 (argp): Hook up argp_children. 3047 (disasm_info): Add elements for color codes. 3048 (disasm_output): Print color codes as well. 3049 (show_disasm): Set up disasm_info data for callback. 3050 30512012-01-20 Roland McGrath <roland@hack.frob.com> 3052 3053 * arlib-argp.c (arlib_deterministic_output): Initialize from 3054 configured value. 3055 (help_filter): New function. 3056 (argp): Use it. 3057 3058 * ar.c (main): Handle oper_none as usage error. 3059 3060 * arlib-argp.c (options, parse_opt): Grok -U as inverse of -D. 3061 3062 * ranlib.c (argp): Use arlib_argp_children. 3063 3064 * arlib.c (arlib_init): Obey arlib_deterministic_output. 3065 3066 * arlib-argp.c: New file. 3067 * Makefile.am (libar_a_SOURCES): Add it. 3068 * arlib.h (arlib_deterministic_output, arlib_argp_children): 3069 Declare new variables. 3070 * ar.c (deterministic_output): Variable removed. 3071 (do_oper_insert): Use arlib_deterministic_output instead. 3072 (options, parse_opt): Don't handle -D here. Add group numbers. 3073 (argp): Use arlib_argp_children. 3074 30752011-12-20 Roland McGrath <roland@hack.frob.com> 3076 3077 * readelf.c (print_debug): Initialize DUMMY_DBG.elf. 3078 Reported by Karel Klic <kklic@redhat.com>. 3079 30802011-11-05 Roland McGrath <roland@hack.frob.com> 3081 3082 * ar.c (deterministic_output): New flag variable. 3083 (options, parse_opt): Grok -D to set it. 3084 (do_oper_insert): When set, use zero from mtime, uid, and gid. 3085 3086 * ar.c (do_oper_insert): Fix check on elf_rawfile return value. 3087 30882011-10-04 Marek Polacek <mpolacek@redhat.com> 3089 3090 * readelf.c (register_info): Assume the right size of an array. 3091 30922011-10-03 Ulrich Drepper <drepper@gmail.com> 3093 3094 * nm.c: Recognize option --mark-special. Still recognize --mark-weak 3095 but don't show it in help anymore. 3096 (mark_special): Renamed from mark_weak. 3097 (parse_opt): Adjust. 3098 (class_type_char): Take additional parameters for ELF file and ELF 3099 header. Treat TLS symbols like objects. 3100 In case of D symbols, show u for unique symbols, R for symbols in 3101 read-only sections, B for symbols in BSS sections. 3102 (show_symbols_bsd): Take additional parameters for ELF file and ELF 3103 header. Adjust for class_type_char change. Show TLS symbols with 3104 @ after them in case --mark-special is selected. 3105 (show_symbols_posix): Likewise. 3106 (show_symbols): Adjust calls to show_symbols_bsd and 3107 show_symbols_posix. 3108 (show_symbols_sysv): Avoid printing address and size for undefined 3109 symbols. Don't print initial special entry and section entries. 3110 31112011-10-02 Ulrich Drepper <drepper@gmail.com> 3112 3113 * Makefile.am (demanglelib): Define. 3114 (nm_LDADD): Add demanglelib. 3115 * nm.c (options): Add -C option. 3116 (demangle): Define as global variable. 3117 (parse_opt): Recognize -C. 3118 (show_symbols_sysv): Handle demangling. 3119 (show_symbols_bad): Likewise. 3120 (show_symbols_posix): Likewise. 3121 (show_symbols): Likewise. 3122 31232011-07-09 Roland McGrath <roland@hack.frob.com> 3124 3125 * readelf.c (options, parse_opt): Grok -W/--wide and ignore it. 3126 3127 * ar.c (parse_opt): Grok -u. 3128 31292011-05-30 Mark Wielaard <mjw@redhat.com> 3130 3131 * strip.c (relocate): Make offset check overflow-proof. 3132 31332011-05-23 Mark Wielaard <mjw@redhat.com> 3134 3135 * strip.c (relocate): Take new arguments is_rela to indicate 3136 whether the relocation is from a SHT_REL or SHT_RELA section. 3137 Relocate against any debug section symbol, not just STT_SECTION 3138 symbols. For SHT_REL relocations, fetch addend from offset and 3139 add it to symbol value if not zero. 3140 31412011-05-23 Mark Wielaard <mjw@redhat.com> 3142 3143 * strip.c (OPT_RELOC_DEBUG): New option. 3144 (argp_option): Add new --reloc-debug-sections option. 3145 (main): Check new option. 3146 (parse_opt): Likewise. 3147 (handle_elf): Remove any relocations between debug sections 3148 in ET_REL for the debug file when requested. 3149 31502011-05-18 Mark Wielaard <mjw@redhat.com> 3151 3152 * strip.c (handle_elf): Make sure all sections of a removed group 3153 section are removed too. Don't discard SHT_GROUP sections, copy 3154 section table before it gets modified. Section group signature 3155 symbols don't have to be retained. 3156 31572011-05-16 Jakub Jelinek <jakub@redhat.com> 3158 3159 * readelf.c (print_ops): Handle DW_OP_GNU_const_type, 3160 DW_OP_GNU_regval_type, DW_OP_GNU_deref_type, DW_OP_GNU_convert 3161 and DW_OP_GNU_reinterpret. 3162 31632011-05-17 Mark Wielaard <mjw@redhat.com> 3164 3165 * readelf.c (dwarf_tag_string): Fixup DW_TAG_GNU_call_site and 3166 DW_TAG_GNU_call_site_parameter return strings. 3167 31682011-05-11 Marek Polacek <mpolacek@redhat.com> 3169 3170 * nm.c (show_symbols_sysv): Remove unused if/else, remove 3171 unused `prefix' and `fname' parameters. 3172 31732011-05-07 Marek Polacek <mpolacek@redhat.com> 3174 3175 * unstrip.c (compare_sections_nonrel): Mark this function as static. 3176 31772011-04-26 Mark Wielaard <mjw@redhat.com> 3178 3179 * readelf.c (handle_notes_data): Call ebl_object_note_type_name 3180 with note name. 3181 31822011-04-14 Mark Wielaard <mjw@redhat.com> 3183 3184 * readelf.c (options): Add gdb_index. 3185 (section_e): Define section_gdb_index. 3186 (parse_opt): Recognize gdb_index debug-dump argument. 3187 (print_gdb_index_section): New function. 3188 (print_debug): Add gdb_index to debug_sections. 3189 31902011-03-24 Petr Machata <pmachata@redhat.com> 3191 3192 * readelf.c (print_debug_line_section): Emit initial space for all 3193 opcode lines. Print offset in front of each opcode. 3194 31952011-03-22 Marek Polacek <mpolacek@redhat.com> 3196 3197 * readelf.c (handle_dynamic): Don't segfault at DT_PLTREL case. 3198 31992011-03-22 Mark Wielaard <mjw@redhat.com> 3200 3201 * readelf.c (dwarf_tag_string): Support DW_TAG_GNU_call_site 3202 and DW_TAG_GNU_call_site_parameter. 3203 (dwarf_attr_string): Support DW_AT_GNU_call_site_value, 3204 DW_AT_GNU_call_site_data_value, 3205 DW_AT_GNU_call_site_target, 3206 DW_AT_GNU_call_site_target_clobbered, 3207 DW_AT_GNU_tail_call, 3208 DW_AT_GNU_all_tail_call_sites, 3209 DW_AT_GNU_all_call_sites, 3210 and DW_AT_GNU_all_source_call_sites. 3211 (print_ops): Handle DW_OP_GNU_entry_value. 3212 (attr_callback): Handle DW_AT_GNU_call_site_value, 3213 DW_AT_GNU_call_site_data_value, 3214 DW_AT_GNU_call_site_target, 3215 and DW_AT_GNU_call_site_target_clobbered. 3216 32172011-03-10 Mark Wielaard <mjw@redhat.com> 3218 3219 * elflint.c (check_symtab): Use ebl_check_st_other_bits. 3220 32212011-02-27 Jan Kratochvil <jan.kratochvil@redhat.com> 3222 3223 * readelf.c (reset_listptr): Clear TABLE->TABLE. 3224 32252011-02-25 Mark Wielaard <mjw@redhat.com> 3226 3227 * readelf.c (dwarf_attr_string): Add DW_AT_GNU_* handling. 3228 (dwarf_form_string): Properly format and return unknown form. 3229 32302011-02-23 Roland McGrath <roland@redhat.com> 3231 3232 * readelf.c (section_name): New function. 3233 (print_debug_abbrev_section): Use it instead of constant. 3234 (print_debug_aranges_section): Likewise. 3235 (print_debug_ranges_section): Likewise. 3236 (print_debug_units): Likewise. 3237 (print_debug_line_section): Likewise. 3238 (print_debug_loc_section): Likewise. 3239 (print_debug_macinfo_section): Likewise. 3240 (print_debug_pubnames_section): Likewise. 3241 (print_debug_str_section): Likewise. 3242 (print_debug) [USE_ZLIB]: Match .zdebug_* sections too. 3243 (print_debug_abbrev_section): Use decoded d_size, not sh_size. 3244 (print_debug_str_section): Likewise. 3245 3246 * readelf.c (dwarf_attr_string): Grok DW_AT_GNU_odr_signature. 3247 32482011-02-11 Roland McGrath <roland@redhat.com> 3249 3250 * elfcmp.c (verbose): New variable. 3251 (options, parse_opt): Grok -l/--verbose to set it. 3252 (main): Under -l, keep going after first difference. 3253 3254 * elfcmp.c (ignore_build_id): New variable. 3255 (options, parse_opt): Grok --ignore-build-id to set it. 3256 (main): For SHT_NOTE sections, compare note details rather than raw 3257 bytes. Under --ignore-build-id, don't complain about differing build 3258 ID contents if lengths match. 3259 32602011-02-08 Roland McGrath <roland@redhat.com> 3261 3262 * ldscript.y (filename_id_star): Remove unused variable. 3263 3264 * unstrip.c (copy_elided_sections): Remove unused variable. 3265 3266 * elflint.c (check_dynamic): Remove unused variables. 3267 3268 * elflint.c (check_symtab): Warn about missing xndx section only once. 3269 3270 * ldgeneric.c (check_for_duplicate2): Remove unused variable. 3271 32722011-01-06 Roland McGrath <roland@redhat.com> 3273 3274 * strip.c (handle_elf): Under --strip-sections, remove all 3275 non-allocated sections and never generate .gnu_debuglink. 3276 32772011-01-04 Roland McGrath <roland@redhat.com> 3278 3279 * strip.c (remove_shdrs): New variable. 3280 (options, parse_opt): Grok --strip-sections to set it. 3281 (handle_elf): When that's set, truncate off .shstrtab and shdrs. 3282 32832010-11-10 Roland McGrath <roland@redhat.com> 3284 3285 * findtextrel.c (process_file): Don't assume order of sections. 3286 Reported by Mike Hommey <mh@glandium.org>. 3287 32882010-07-26 Roland McGrath <roland@redhat.com> 3289 3290 * readelf.c (print_ops): Handle DW_OP_GNU_implicit_pointer. 3291 32922010-08-30 Roland McGrath <roland@redhat.com> 3293 3294 Print .debug_loc/.debug_ranges with cognizance of actual DIE uses. 3295 * readelf.c (parse_opt): Add section_info to implicit_debug_sections 3296 for ranges, loc. 3297 (struct listptr, struct listptr_table): New types. 3298 (compare_listptr, reset_listptr, sort_listptr): New functions. 3299 (notice_listptr, skip_listptr_hole): New functions. 3300 (struct attrcb_args): Add silent member. 3301 (attr_callback): Call notice_listptr for loclistptr and rangelistptr. 3302 Suppress output if silent, but still call notice_listptr. 3303 (print_debug_units): Suppress output if section_info not requested. 3304 (print_debug_loc_section): Call sort_listptr, skip_listptr_hole. 3305 (print_debug_ranges_section): Likewise. 3306 (print_debug): Call reset_listptr on both tables. 3307 3308 * readelf.c (print_debug_ranges_section): Print empty list. 3309 (print_debug_loc_section): Likewise. 3310 3311 * readelf.c (print_debug_loc_section): Check for bogus length 3312 before calling print_ops. 3313 (print_ops): Check harder for bogus data that would read off end. 3314 33152010-08-11 Roland McGrath <roland@redhat.com> 3316 3317 * readelf.c (for_each_section_argument): Process all sections with 3318 matching name, not just the first. 3319 33202010-07-26 Roland McGrath <roland@redhat.com> 3321 3322 * readelf.c (print_ops): Take new argument for CU version. 3323 Fix DW_OP_call_ref decoding to depend on it. 3324 (print_debug_loc_section): Update caller. 3325 (print_cfa_program): Take new argument, pass it down. 3326 (print_debug_frame_section): Update caller. 3327 (struct attrcb_args): New member version. 3328 (print_debug_units): Initialize it. 3329 33302010-07-02 Roland McGrath <roland@redhat.com> 3331 3332 * readelf.c (print_debug_frame_section): Use format_dwarf_addr for 3333 initial_location. 3334 33352010-06-30 Roland McGrath <roland@redhat.com> 3336 3337 * strings.c (main): Use STDIN_FILENO, not STDOUT_FILENO. 3338 Ignore st_size for a non-S_ISREG file descriptor. 3339 (read_block): Move assert after no-mmap bail-out. 3340 (read_block_no_mmap): Fix size calculations for moving buffer remnant. 3341 33422010-06-22 Roland McGrath <roland@redhat.com> 3343 3344 * readelf.c (print_debug_line_section): Fix braino in DW_LNS_set_isa. 3345 33462010-06-21 Roland McGrath <roland@redhat.com> 3347 3348 * readelf.c (dwarf_tag_string): Handle new v4 tags. 3349 (dwarf_attr_string): Add new attributes. 3350 (dwarf_tag_string): Handle DW_TAG_GNU_*. 3351 3352 * readelf.c (print_ops): Use 64-bit types for LEB128 operands. 3353 (print_cfa_program): Likewise. 3354 33552010-06-20 Roland McGrath <roland@redhat.com> 3356 3357 * readelf.c (print_debug_units): New function, broken out of ... 3358 (print_debug_info_section): ... here. Call it. 3359 (print_debug_types_section): New function. 3360 (enum section_e): Add section_types alias for section_info. 3361 (print_debug): Add types to the sections table. 3362 3363 * readelf.c (print_debug_frame_section): Handle version 4 format. 3364 3365 * readelf.c (print_debug_line_section): Handle version 4 format. 3366 33672010-06-14 Roland McGrath <roland@redhat.com> 3368 3369 * unstrip.c (copy_elided_sections): Make sure all sections' data have 3370 been read in before we write anything out. 3371 33722010-06-04 Roland McGrath <roland@redhat.com> 3373 3374 * unstrip.c (update_shdr): New function. 3375 (update_sh_size): Call it instead of gelf_update_shdr. 3376 (adjust_relocs, add_new_section_symbols): Likewise. 3377 (new_shstrtab, copy_elided_sections): Likewise. 3378 3379 * unstrip.c (copy_elided_sections): Bail if stripped file has more 3380 sections than unstripped file, rather than getting confused later. 3381 33822010-06-01 Roland McGrath <roland@redhat.com> 3383 3384 * readelf.c (dwarf_form_string): Handle DWARF 4 forms. 3385 (attr_callback): Handle DW_FORM_flag_present, DW_FORM_exprloc, 3386 DW_FORM_sec_offset, DW_FORM_ref_sig8. 3387 3388 * readelf.c (print_debug): Don't bail if libdw setup fails. 3389 Suppress complaint if we only want .eh_frame anyway. 3390 33912010-05-28 Ulrich Drepper <drepper@redhat.com> 3392 3393 * readelf.c (attr_callback): Also print form information. 3394 33952010-05-19 Roland McGrath <roland@redhat.com> 3396 3397 * addr2line.c (find_symbol): Short-circuit on empty name. 3398 (handle_address): Handle SYMBOL with no +OFFSET. 3399 34002010-05-08 Roland McGrath <roland@redhat.com> 3401 3402 * readelf.c (print_ops): Take new arg OFFSET_SIZE. 3403 Use that for DW_OP_call_ref, not ADDRSIZE. 3404 (print_cfa_program): Update caller. 3405 (struct attrcb_args): Add offset_size field. 3406 (attr_callback): Use it for print_ops call. 3407 (print_debug_info_section): Initialize it. 3408 (print_ops): Likewise. 3409 34102010-04-14 Roland McGrath <roland@redhat.com> 3411 3412 * readelf.c (handle_core_item): Fix bitmask printing. 3413 34142010-04-06 Roland McGrath <roland@redhat.com> 3415 3416 * ld.c (options): Fix some typos in messages. 3417 * elflint.c (check_scn_group, check_group): Likewise. 3418 * ldscript.y (add_id_list): Likewise. 3419 * readelf.c (print_hash_info): Add xgettext:no-c-format magic comment 3420 before translated string containing a literal %. 3421 34222010-02-26 Roland McGrath <roland@redhat.com> 3423 3424 * readelf.c (process_file): Don't leak an fd in failure case. 3425 34262010-02-15 Roland McGrath <roland@redhat.com> 3427 3428 * Makefile.am: Use config/eu.am for common stuff. 3429 3430 * readelf.c (print_debug_frame_section): Add a cast to avoid sign 3431 mismatch in comparison. 3432 34332010-02-02 Roland McGrath <roland@redhat.com> 3434 3435 * readelf.c (print_encoding_base): Handle DW_EH_PE_absptr (zero). 3436 (read_encoded): Likewise. 3437 (print_debug_frame_section): Check for bogus augmentation length. 3438 For P augmentation, use read_encoded, print the encoding description, 3439 and use hex for unsigned values. 3440 34412010-01-15 Roland McGrath <roland@redhat.com> 3442 3443 * ar.c: Include <sys/stat.h>. 3444 * elflint.c: Likewise. 3445 * readelf.c: Likewise. 3446 * strip.c: Likewise. 3447 * unstrip.c: Likewise 3448 34492010-01-07 Roland McGrath <roland@redhat.com> 3450 3451 * readelf.c (print_ehdr): Handle PN_XNUM. 3452 (phnum): New static variable. 3453 (process_elf_file): Set it with elf_getphdrnum. 3454 (print_phdr): Use phnum instead of EHDR->e_phnum. 3455 (print_dynamic, handle_notes): Likewise. 3456 (handle_relocs_rel, handle_relocs_rela): Likewise. 3457 3458 * elfcmp.c (main): Use elf_getshdrnum and elf_getphdrnum. 3459 3460 * elflint.c (phnum): New static variable. 3461 (check_elf_header): Set it, handling PN_XNUM. 3462 Use that in place of EHDR->e_phnum throughout. 3463 (check_symtab, check_reloc_shdr, check_dynamic): Likewise. 3464 (unknown_dependency_p, check_sections, check_program_header): Likewise. 3465 34662010-01-05 Roland McGrath <roland@redhat.com> 3467 3468 * readelf.c (dwarf_attr_string): Match DW_AT_GNU_vector and 3469 DW_AT_GNU_template_name. 3470 34712010-01-04 Roland McGrath <roland@redhat.com> 3472 3473 * readelf.c (handle_notes_data): Grab NT_AUXV only for name "CORE". 3474 (handle_core_note): Pass NHDR and NAME to ebl_core_note. 3475 (handle_core_item): Handle .format of '\n' as \n-separated strings. 3476 3477 * readelf.c (implicit_debug_sections): New variable. 3478 (parse_opt): Set it instead of print_debug_sections for -a. 3479 OR them together for print_debug check. 3480 (print_debug): OR them together for section check. 3481 3482 * readelf.c (options): Repartition into set implied by -a and others. 3483 Correct -a text to match reality. 3484 3485 * readelf.c (struct section_argument): Add bool member 'implicit'. 3486 (parse_opt): Set it for -a cases, clear it for -x args. 3487 (for_each_section_argument): Don't complain about a missing section by 3488 name if it's implicit. 3489 34902009-11-16 Roland McGrath <roland@redhat.com> 3491 3492 * readelf.c (print_string_section): Punt SHT_NOBITS like empty 3493 sections, just as dump_data_section already does. 3494 34952009-09-21 Ulrich Drepper <drepper@redhat.com> 3496 3497 * elflint.c (special_sections): Allow MERGE and STRINGS flags to be 3498 set for .comment section. 3499 Patch by Mark Wielaard <mjw@redhat.com>. 3500 35012009-09-08 Roland McGrath <roland@redhat.com> 3502 3503 * ar.c (main): Fix typo in message format. 3504 35052009-08-21 Roland McGrath <roland@redhat.com> 3506 3507 * readelf.c (attr_callback): Use print_block only when we don't use 3508 print_ops. 3509 35102009-08-14 Roland McGrath <roland@redhat.com> 3511 3512 * ar.c (do_oper_extract): Use pathconf instead of statfs. 3513 35142009-08-01 Ulrich Drepper <drepper@redhat.com> 3515 3516 * debugpred.h: Add two most const. 3517 35182009-07-26 Mark Wielaard <mjw@redhat.com> 3519 3520 * elflint.c (check_note_data): Recognize NT_GNU_GOLD_VERSION. 3521 35222009-07-25 Mark Wielaard <mjw@redhat.com> 3523 3524 * Makefile.am (addr2line_LDADD): Add $(libelf). 3525 35262009-07-24 Roland McGrath <roland@redhat.com> 3527 3528 * readelf.c (print_block): New function. 3529 (print_ops): Use it. 3530 (attr_callback): Use it for DW_FORM_block* forms. 3531 35322009-07-20 Mark Wielaard <mjw@redhat.com> 3533 3534 * readelf.c (print_ops): Add handling of DW_OP_implicit_value 3535 and DW_OP_stack_value. 3536 35372009-07-14 Ulrich Drepper <drepper@redhat.com> 3538 3539 * elflint.c (check_elf_header): Allow Linux ABI. 3540 (check_symtab): Handle STB_GNU_UNIQUE. 3541 35422009-07-08 Mark Wielaard <mjw@redhat.com> 3543 3544 * readelf.c (attr_callback): Handle DW_Form constants for 3545 DW_AT_data_member_location. 3546 35472009-07-06 Roland McGrath <roland@redhat.com> 3548 3549 * readelf.c (register_info): New function. Handle unknown register #s. 3550 (print_cfa_program): Use it. 3551 (handle_core_register, handle_core_registers): Likewise. 3552 35532009-06-28 Roland McGrath <roland@redhat.com> 3554 3555 * readelf.c (print_address_names): New static variable. 3556 (options, parse_opt): Grok -N/--numeric-addresses to clear it. 3557 (format_dwarf_addr): Don't look up name if !print_address_names. 3558 35592009-06-13 Ulrich Drepper <drepper@redhat.com> 3560 3561 * ldgeneric.c: Don't use deprecated libelf functions. 3562 * nm.c: Likewise. 3563 * objdump.c: Likewise. 3564 * readelf.c: Likewise. 3565 * size.c: Likewise. 3566 * strip.c: Likewise. 3567 * unstrip.c: Likewise. 3568 * ld.h: Fix up comment. 3569 35702009-06-01 Ulrich Drepper <drepper@redhat.com> 3571 3572 * readelf.c (print_relocs): Expect ELF header argument and pass on 3573 to handle_relocs_rel* functions. Adjust caller. 3574 (handle_relocs_rel): Add ELF header argument. Add special case for 3575 the IRELATIVE relocations in statically linked executables. 3576 (handle_relocs_rela): Likewise. 3577 35782009-04-29 Ulrich Drepper <drepper@redhat.com> 3579 3580 * elflint.c (check_symtab): Add tests of st_other field. 3581 35822009-04-23 Ulrich Drepper <drepper@redhat.com> 3583 3584 * Makefile [BUILD_STATIC] (libdw): Add $(zip_LIBS). 3585 35862009-04-20 Roland McGrath <roland@redhat.com> 3587 3588 * addr2line.c (print_dwarf_function): Honor -s and -A for file names 3589 of inline call sites. 3590 3591 * addr2line.c (just_section): New variable. 3592 (adjust_to_section): New function, broken out of ... 3593 (handle_address): ... here. 3594 (options, parse_opt): Add -j/--section=NAME to set it. 3595 35962009-04-15 Roland McGrath <roland@redhat.com> 3597 3598 * readelf.c (print_debug_frame_section): Check for DW_CIE_ID_64 in 3599 64-bit format header, DW_CIE_ID_32 in 32-bit format header. 3600 36012009-04-14 Roland McGrath <roland@redhat.com> 3602 3603 * readelf.c (print_attributes): Treat SHT_ARM_ATTRIBUTES on EM_ARM 3604 like SHT_GNU_ATTRIBUTES. 3605 3606 * readelf.c (handle_core_registers): Fix error message. 3607 3608 * strip.c (handle_elf: check_preserved): Don't note any change when 3609 .debug_data is already filled from a previous pass. 3610 36112009-02-05 Ulrich Drepper <drepper@redhat.com> 3612 3613 * objdump.c (show_relocs_x): Minor cleanups. 3614 3615 * readelf.c (print_cfa_program): Correct a few labels. 3616 Print first DW_CFA_expression and DW_CFA_val_expression parameter 3617 as register. 3618 36192009-02-01 Ulrich Drepper <drepper@redhat.com> 3620 3621 * objdump.c (show_relocs_rel, show_relocs_rela): Split common parts 3622 into ... 3623 (show_relocs_x): ...here. New function. 3624 (show_relocs): Better spacing in output. 3625 3626 * objdump.c (show_relocs_rela): Show offsets as signed values. 3627 3628 * ar.c (main): Fix recognition of invalid modes for a, b, i modifiers. 3629 Improve some error messages. 3630 Use program_invocation_short_name instead of AR macro. 3631 * Makefile.am (CFLAGS_ar): Remove. 3632 * elflint.c (parse_opt): ARGP_HELP_EXIT_ERR does nothing for argp_help. 3633 * objdump.c (parse_opt): Likewise. 3634 * readelf.c (parse_opt): Likewise. 3635 36362009-01-27 Roland McGrath <roland@redhat.com> 3637 3638 * readelf.c (print_ops): Notice short length, don't overrun buffer 3639 (still need to fix LEB128). 3640 3641 * readelf.c (print_ops): Fix DW_OP_call[24] decoding. 3642 3643 * readelf.c (print_ops): Print (empty)\n when LEN == 0. 3644 36452009-01-24 Ulrich Drepper <drepper@redhat.com> 3646 3647 * readelf.c (print_debug_frame_section): Fix computation of vma_base 3648 for PC-relative mode. 3649 36502009-01-23 Ulrich Drepper <drepper@redhat.com> 3651 3652 * size.c (process_file): When handling archive, close file descriptor 3653 here. For unknown file format also close file descriptor. 3654 (handle_ar): Don't close file descriptor here. 3655 3656 * readelf.c (parse_opt): Move code to add to dump_data_sections and 3657 string_sections list in local function add_dump_section. Adjust 'x' 3658 key handling. For 'a' key add .strtab, .dynstr, and .comment section 3659 to string_sections list. 3660 36612009-01-22 Roland McGrath <roland@redhat.com> 3662 3663 * readelf.c (print_phdr): Don't print section mapping when no sections. 3664 3665 * Makefile.am (AM_CFLAGS): Pass -Wno-format for *_no_Wformat. 3666 3667 * readelf.c (print_debug_frame_section): Initialize IS_SIGNED to false 3668 and reset it only for the 'true' cases. 3669 3670 * Makefile.am (addr2line_no_Wformat): New variable. 3671 3672 * readelf.c (print_debug_frame_section): Use t instead of j formats 3673 for ptrdiff_t OFFSET. 3674 36752009-01-21 Ulrich Drepper <drepper@redhat.com> 3676 3677 * elflint.c (check_program_header): Fix typo in .eh_frame_hdr section 3678 test. Handle debuginfo files. 3679 (check_exception_data): First sanity test. 3680 36812009-01-17 Ulrich Drepper <drepper@redhat.com> 3682 3683 * readelf.c (print_debug_exception_table): Show target of ar_disp 3684 field. 3685 3686 * elflint.c (check_program_header): Add most consistency checks for 3687 PT_GNU_EH_FRAME entry. 3688 3689 * addr2line.c: Use ARGP_PROGRAM_VERSION_HOOK_DEF and 3690 ARGP_PROGRAM_BUG_ADDRESS_DEF. 3691 * ar.c: Likewise. 3692 * elfcmp.c: Likewise. 3693 * elflint.c: Likewise. 3694 * findtextrel.c: Likewise. 3695 * ld.c: Likewise. 3696 * nm.c: Likewise. 3697 * objdump.c: Likewise. 3698 * ranlib.c: Likewise. 3699 * readelf.c: Likewise. 3700 3701 * size.c: Likewise. 3702 * strings.c: Likewise. 3703 * strip.c: Likewise. 3704 * unstrip.c: Likewise. 3705 37062009-01-16 Ulrich Drepper <drepper@redhat.com> 3707 3708 * elflint.c (check_program_header): Check that PT_GNU_EH_FRAME entry 3709 matches .eh_frame_hdr section, if it is available. Also check that 3710 the segment is allocated, not writable, not executable. 3711 3712 * readelf.c: Add -e option. Dump exception and unwind related 3713 sections. Add -e to -a. 3714 (print_encoding_base): Handle DW_EH_PE_omit. 3715 (print_debug_exception_table): Beginning of support. 3716 (print_debug): Hook up print_debug_exception_table for 3717 .gcc_except_table sections. 3718 3719 * readelf.c (print_debug_frame_section): Some fixes for last change. 3720 37212009-01-15 Ulrich Drepper <drepper@redhat.com> 3722 3723 * readelf.c (print_encoding): Now a toplevel function. 3724 (print_relinfo): Likewise. 3725 (print_encoding_base): Broken out of print_debug_frame_section. 3726 (print_debug_frame_section): Print different header for .eh_frame 3727 sections. Fix recognition of matching CIEs in .debug_frame sections. 3728 Print absolute offset for PC-relative FDE locations. Don't print 3729 table header for FDEs if the table is empty. 3730 (read_encoded): New function. 3731 (print_debug_frame_hdr_section): New function. 3732 (print_debug): Hook up print_debug_frame_hdr_section for .eh_frame_hdr 3733 sections. 3734 3735 * readelf.c (handle_relocs_rel): Print section number. 3736 (print_debug_abbrev_section): Likewise. 3737 (print_debug_aranges_section): Likewise. 3738 (print_debug_ranges_section): Likewise. 3739 (print_debug_info_section): Likewise. 3740 (print_debug_line_section): Likewise. 3741 (print_debug_loc_section): Likewise. 3742 (print_debug_macinfo_section): Likewise. 3743 (print_debug_pubnames_section): Likewise. 3744 (print_debug_str_section): Likewise. 3745 37462009-01-10 Ulrich Drepper <drepper@redhat.com> 3747 3748 * strings.c (read_block): Fix typo in error message string. 3749 37502009-01-07 Ulrich Drepper <drepper@redhat.com> 3751 3752 * ld.c (ld_new_searchdir): Fix adding to search path list. 3753 37542009-01-06 Ulrich Drepper <drepper@redhat.com> 3755 3756 * readelf.c: Implement call frame debug section dumping. 3757 37582009-01-05 Roland McGrath <roland@redhat.com> 3759 3760 * elfcmp.c: Exit with status 2 for errors (like cmp, diff, grep). 3761 Status 1 (aka EXIT_FAILURE) is only for completed OK but not equal. 3762 37632009-01-01 Ulrich Drepper <drepper@redhat.com> 3764 3765 * addr2line.c: Update copyright year. 3766 * ar.c: Likewise. 3767 * elfcmp.c: Likewise. 3768 * elflint.c: Likewise. 3769 * findtextrel.c: Likewise. 3770 * ld.c: Likewise. 3771 * nm.c: Likewise. 3772 * objdump.c: Likewise. 3773 * ranlib.c: Likewise. 3774 * readelf.c: Likewise. 3775 * size.c: Likewise. 3776 * strings.c: Likewise. 3777 * strip.c: Likewise. 3778 * unstrip.c: Likewise. 3779 37802008-12-11 Roland McGrath <roland@redhat.com> 3781 3782 * nm.c (sym_name): New function. 3783 (show_symbols_sysv): Use it in place of elf_strptr. 3784 (show_symbols_bsd, show_symbols_posix): Likewise. 3785 Fixes RHBZ#476136. 3786 3787 * nm.c (show_symbols_sysv): Use an alloca'd backup section name when 3788 elf_strptr fails. 3789 37902008-12-02 Roland McGrath <roland@redhat.com> 3791 3792 * readelf.c (count_dwflmod, process_file): Don't presume encoding of 3793 nonzero OFFSET argument to dwfl_getmodules. 3794 37952008-08-07 Roland McGrath <roland@redhat.com> 3796 3797 * addr2line.c (main): Pass string to handle_address. 3798 (see_one_module): New function, subroutine of handle_address. 3799 (find_symbol): Likewise. 3800 (handle_address): Take string argument rather than address. 3801 Convert plain number, or handle strings like "(section)+offset" 3802 or "symbol+offset". 3803 38042008-08-01 Roland McGrath <roland@redhat.com> 3805 3806 * readelf.c (handle_core_item): Handle 'B' type for 1-origin bitset. 3807 For 'b' and 'B', print <x-y,z> or ~<x,y-z> rather than 1/0 string. 3808 3809 * readelf.c (convert): Take new argument SIZE. 3810 (handle_core_register, handle_core_item): Update callers. 3811 (handle_core_item): Take new arg REPEATED_SIZE. 3812 (handle_core_items): Special case for a singleton item, 3813 let handle_core_item handle repeats if it wants to. 3814 3815 * readelf.c (handle_core_items): Give abridged output 3816 for identical groups repeated more than twice. 3817 38182008-07-04 Roland McGrath <roland@redhat.com> 3819 3820 * readelf.c (handle_core_items): Handle ELF_T_ADDR. 3821 38222008-04-10 Roland McGrath <roland@redhat.com> 3823 3824 * strip.c (handle_elf): Don't keep sections that kept symbol tables 3825 refer to. Instead, just be sure to preserve the original symbol 3826 table in the debug file so those symbols go with their sections and 3827 can be elided from the stripped version of the symbol table. 3828 3829 * strip.c (handle_elf): When a discarded section kept in the debug 3830 file refers to a nondiscard section via sh_link/sh_info, preserve 3831 that nondiscarded section unmodified in the debug file as well. 3832 Skip adjustment of discarded sections symbol table references when 3833 that symbol table is copied in this way. 3834 3835 * elflint.c (check_symtab): Don't crash from missing symbol names 3836 after diagnosing bogus strtab. 3837 3838 * strip.c (handle_elf): Cosmetic cleanup in special section contents 3839 adjustment for symtab changes. 3840 38412008-03-31 Roland McGrath <roland@redhat.com> 3842 3843 * elflint.c (check_sections): Add checks on SHF_EXECINSTR sections: 3844 must be SHT_PROGBITS, must not be SHF_WRITE. Let backend hook 3845 excuse a special section. 3846 38472008-03-27 Roland McGrath <roland@redhat.com> 3848 3849 * elflint.c (check_sections): Check that executability and writability 3850 of sections is reflected in segment p_flags. 3851 38522008-03-26 Roland McGrath <roland@redhat.com> 3853 3854 * elflint.c (check_program_header): Accept PT_GNU_RELRO p_flags 3855 that matches its PT_LOAD's p_flags &~ PF_W. On sparc, PF_X really 3856 is valid in RELRO. 3857 38582008-02-29 Roland McGrath <roland@redhat.com> 3859 3860 * readelf.c (print_attributes): Add a cast. 3861 * elflint.c (check_attributes): Likewise. 3862 3863 * unaligned.h (add_8ubyte_unaligned): Cast PTR argument for parity 3864 with [UNALIGNED_ACCESS_CLASS == BYTE_ORDER] definition. 3865 (add_4ubyte_unaligned, add_2ubyte_unaligned): Likewise. 3866 38672008-02-03 Ulrich Drepper <drepper@redhat.com> 3868 3869 * i386_ld.c (elf_i386_count_relocations): Implement R_386_TLS_GD 3870 when linked into executable. 3871 (elf_i386_create_relocations): Likewise. 3872 38732008-02-20 Roland McGrath <roland@redhat.com> 3874 3875 * readelf.c (print_attributes): New function. 3876 (process_elf_file): Call it under -A. 3877 3878 * elflint.c (check_attributes): Implement it for real. 3879 38802008-02-19 Roland McGrath <roland@redhat.com> 3881 3882 * elflint.c (special_sections): Handle .gnu.attributes section. 3883 (check_sections): Likewise. 3884 (check_attributes): New function. 3885 38862008-02-10 Roland McGrath <roland@redhat.com> 3887 3888 * elfcmp.c (main): Ignore sh_offset differences in non-SHF_ALLOC 3889 sections and ET_REL files. 3890 38912008-02-02 Ulrich Drepper <drepper@redhat.com> 3892 3893 * elf32-i386.script: Add .eh_frame_hdr, .tdata, and .tbss sections. 3894 * i386_ld.c (elf_i386_count_relocations): Handle R_386_TLS_LDO_32 3895 and R_386_TLS_LE. 3896 (elf_i386_create_relocations): Likewise. 3897 * ld.h (struct ld_state): Add need_tls, tls_start, and tls_tcb 3898 elements. 3899 * ldgeneric.c (add_section): If TLS section is used, set need_tls flag. 3900 (ld_generic_create_outfile): Add PT_TLS entry to program header. 3901 Fix generation of PT_GNU_STACK entry. 3902 39032008-02-01 Ulrich Drepper <drepper@redhat.com> 3904 3905 * ld.c (replace_args): Prevent loop over replacements if the parameter 3906 is only two characters long. 3907 3908 * ld.c: Recognize sha1 argument for --build-id parameter. 3909 * ldgeneric.c (create_build_id_section): Handle sha1. 3910 (compute_hash_sum): New function. Broken out of compute_build_id. 3911 Take hash function and context as parameters. 3912 (compute_build_id): Use compute_hash_sum for md5 and the new sha1 3913 implementation. 3914 39152008-01-31 Ulrich Drepper <drepper@redhat.com> 3916 3917 * elf32-i386.script: Add .note.ABI-tag and .note.gnu.build-id sections. 3918 * ld.c: Recognize --build-id command line parameter. 3919 * ld.h: Define scn_dot_note_gnu_build_id. 3920 (struct ld_state): Add build_id and buildidscnidx elements. 3921 * ldgeneric.c: Implement --build-id command line parameter. 3922 * ldlex.l (ID): Recognize - as valid character after the first one. 3923 39242008-01-29 Ulrich Drepper <drepper@redhat.com> 3925 3926 * ld.c (replace_args): New function. 3927 (main): Use it to rewrite old-style parameters. 3928 3929 * elf32-i386.script: Add .gnu.hash section. 3930 * ldgeneric.c (optimal_bucket_size): A tiny bit more efficient. 3931 (fillin_special_symbol): Initialize st_size. 3932 (sortfct_hashval): New function. 3933 (create_gnu_hash): New function. 3934 (create_hash): New function. 3935 (ld_generic_create_outfile): Use the new functions to create the 3936 hash tables. 3937 3938 * elflint.c (check_gnu_hash): Fix index value printed in error message. 3939 39402008-01-24 Ulrich Drepper <drepper@redhat.com> 3941 3942 * elflint.c (check_group): Check that signature symbol for section 3943 group is not an empty string. 3944 * ldgeneric.c: Remove magic assignment of indices in the dynsym 3945 section. Start implementation of --hash-style. 3946 * i386_ld.c: Likewise. 3947 * ld.c: Recognize --hash-style. 3948 * ld.h (struct scninfo): Add comdat_group. 3949 Add additional parameter to finalize_plt callback. 3950 39512008-01-22 Ulrich Drepper <drepper@redhat.com> 3952 3953 * ld.h (struct callbacks): Add initialize_gotplt. 3954 (struct scnhead): Add scn_dot_gotplt. 3955 (struct ld_state): Add gotpltscnidx. 3956 * i386_ld.c (elf_i386_initialize_plt): Minor optimization. 3957 (elf_i386_initialize_pltrel): Likewise. 3958 (elf_i386_initialize_got): There is now a separate .got.plt, so 3959 don't do the PLT-related work here. Initialize d_type. 3960 (elf_i386_initialize_gotplt): New function. 3961 (elf_i386_plt0): Use ud2a after indirect jump. 3962 (elf_i386_pic_plt0_entry): Likewise. 3963 (elf_i386_finalize_plt): Reference now .got.plt. 3964 (elf_i386_count_relocations): For GOT entries which need no relocation 3965 don't bump nrel_got. 3966 (elf_i386_create_relocations): Also get .got.plt. Rewrite R-386_GOT32 3967 handling for split .got/.got.plt. 3968 (elf_i386_ld_init): Initialize callbacks.initialize_gotplt. 3969 * elf32-i386.script: Sort sections for security. There are no .got 3970 input sections. Add .got.plt. 3971 * ldgeneric.c (ld_generic_generate_sections): Add .got.plt section. 3972 (ld_generic_create_outfile): Initialize .got.plt section. 3973 Use .got.plt address for _GLOBAL_OFFSET_TABLE_ symbol and DT_PLTGOT. 3974 39752008-01-19 Ulrich Drepper <drepper@redhat.com> 3976 3977 * i386_ld.c (elf_i386_count_relocations): PLT relocations for undefined 3978 symbols are not carried over into statically linked output files. 3979 Add dummy entries for more TLS relocations. 3980 3981 * ld.c (options): Add long names for -( and -). 3982 3983 * ldgeneric.c (check_definition): For newly found definitions don't 3984 mark section as used if symbol is absolute. 3985 (extract_from_archive): Only assign archive sequence number the first 3986 time the archive is handled. Update ld_state.last_archive_used 3987 if any symbol was used. Remove nround variable. 3988 (file_process2): When using symbol from an archive, update 3989 ld_state.group_start_archive, ld_state.archives, and 3990 ld_state.tailarchives. 3991 (ld_generic_file_process): If group is not handled anymore, after 3992 freeing ELF handles for the archives, clear ld_state.archives and 3993 *nextp. Fix wrong logic in recognizing first iteration of group 3994 loop. When clearing flags, also clear ld_state.group_start_archive. 3995 39962008-01-11 Ulrich Drepper <drepper@redhat.com> 3997 3998 * objdump.c (show_disasm): Adjust disassembler format string for 3999 removal of %e. 4000 40012008-01-04 Roland McGrath <roland@redhat.com> 4002 4003 * readelf.c (handle_core_items): Take new arg DESCSZ; if nonzero, 4004 a size greater than the items cover means multiple sets of items. 4005 (handle_core_note): Update caller. 4006 40072008-01-04 Roland McGrath <roland@redhat.com> 4008 4009 * strip.c (handle_elf): Move SHDRIDX defn to silence gcc warning. 4010 40112008-01-03 Roland McGrath <roland@redhat.com> 4012 4013 * ld.h (linked_from_dso_p): Use __attribute__ ((__gnu_inline__)). 4014 4015 * elflint.c (check_dynamic): Remove duplicate initializer. 4016 40172008-01-02 Ulrich Drepper <drepper@redhat.com> 4018 4019 * addr2line.c: Update copyright year. 4020 * ar.c: Likewise. 4021 * elfcmp.c: Likewise. 4022 * elflint.c: Likewise. 4023 * findtextrel.c: Likewise. 4024 * ld.c: Likewise. 4025 * nm.c: Likewise. 4026 * objdump.c: Likewise. 4027 * ranlib.c: Likewise. 4028 * readelf.c: Likewise. 4029 * size.c: Likewise. 4030 * strings.c: Likewise. 4031 * strip.c: Likewise. 4032 * unstrip.c: Likewise. 4033 40342007-12-30 Ulrich Drepper <drepper@redhat.com> 4035 4036 * objdump (show_disasm): Use %e after third parameter. 4037 40382007-12-21 Ulrich Drepper <drepper@redhat.com> 4039 4040 * strip.c: Fix wrong parenthesis in a few branch predictions. 4041 * strings.c: Likewise. 4042 40432007-12-20 Ulrich Drepper <drepper@redhat.com> 4044 4045 * Makefile.am (DEFS): Add DEBUGPRED. 4046 * addr2line.c: Include debugpred.h. 4047 * ar.c: Likewise. 4048 * elfcmp.c: Likewise. 4049 * elflint.c: Likewise. 4050 * findtextrel.c: Likewise. 4051 * nm.c: Likewise. 4052 * objdump.c: Likewise. 4053 * ranlib.c: Likewise. 4054 * readelf.c: Likewise. 4055 * size.c: Likewise. 4056 * strings.c: Likewise. 4057 * strip.c: Likewise. 4058 * unstrip.c: Likewise. 4059 * debugpred.h: New file. 4060 4061 * readelf.c (handle_relocs_rel): Use elf_scnshndx. 4062 (handle_relocs_rela): Likewise. 4063 4064 * readelf.c: Add lots of likely/unlikely. 4065 4066 * elflint.c: Minor cleanups. 4067 40682007-11-19 Roland McGrath <roland@redhat.com> 4069 4070 * readelf.c (print_ops): Handle all bad op codes gracefully. 4071 Print their numbers instead of just ???. 4072 40732007-11-09 Roland McGrath <roland@redhat.com> 4074 4075 * readelf.c (attr_callback): Handle DW_AT_data_location. 4076 Handle block forms to mean a DWARF expression for DW_AT_allocated, 4077 DW_AT_associated, DW_AT_bit_size, DW_AT_bit_offset, DW_AT_bit_stride, 4078 DW_AT_byte_size, DW_AT_byte_stride, DW_AT_count, DW_AT_lower_bound, 4079 DW_AT_upper_bound. 4080 40812007-10-20 Roland McGrath <roland@redhat.com> 4082 4083 * unstrip.c (options): Update -R description. 4084 (struct symbol): Put symbol details a union with a size_t pointer 4085 `duplicate'. 4086 (compare_symbols_output): Use null ->name as marker for discard 4087 symbols, not zero *->map. 4088 (copy_elided_sections): Record forwarding pointers for discarded 4089 duplicates and fill SYMNDX_MAP elements through them. 4090 4091 * readelf.c (process_file): Set offline_next_address to 0 at start. 4092 (struct process_dwflmod_args): New type. 4093 (process_dwflmod): Take args in it, pass fd to process_elf_file. 4094 (process_file): Update caller; dup FD for passing to libdwfl. 4095 (process_elf_file): Take new arg FD. For ET_REL file when 4096 displaying data affected by libdwfl relocation, open a new Elf handle. 4097 40982007-10-17 Roland McGrath <roland@redhat.com> 4099 4100 * readelf.c (print_debug_line_section): For invalid data inside a 4101 unit with plausible length, keep printing at the next unit boundary. 4102 4103 * readelf.c (attr_callback): Use dwarf_formref_die, not dwarf_formref. 4104 41052007-10-16 Roland McGrath <roland@redhat.com> 4106 4107 * readelf.c (hex_dump): Fix rounding error in whitespace calculation. 4108 41092007-10-15 Roland McGrath <roland@redhat.com> 4110 4111 * make-debug-archive.in: New file. 4112 * Makefile.am (EXTRA_DIST): Add it. 4113 (make-debug-archive): New target. 4114 (bin_SCRIPTS, CLEANFILES): Add it. 4115 41162007-10-10 Roland McGrath <roland@redhat.com> 4117 4118 * elflint.c (special_sections): Add new attrflag value exact_or_gnuld. 4119 Use it to check MERGE|STRINGS for .debug_str. 4120 (check_sections): Handle exact_or_gnuld. 4121 41222007-10-08 Roland McGrath <roland@redhat.com> 4123 4124 * readelf.c (handle_core_item): Handle 'T'|0x80 to indicate 4125 64-bit struct timeval with 32-bit tv_usec. 4126 41272007-10-07 Roland McGrath <roland@redhat.com> 4128 4129 * readelf.c (check_archive_index): New function. 4130 (process_file): Call it. Change signature to take only fd and name. 4131 Use libdwfl to open the file, then iterate on its modules (multiple 4132 for an archive) to print file name and call process_elf_file. 4133 (main): Update caller. Let process_file do elf_begin. 4134 (count_dwflmod, process_dwflmod, find_no_debuginfo): New functions. 4135 (process_elf_file): Take only Dwfl_Module * argument. 4136 Don't print the file name here. 4137 (print_debug_*_section): Take Dwfl_Module * argument. 4138 (print_debug): Likewise. Update caller. 4139 (format_dwarf_addr): New function. 4140 (print_debug_ranges_section): Use it. 4141 (attr_callback): Likewise. 4142 (print_debug_line_section, print_debug_loc_section): Likewise. 4143 4144 * readelf.c (print_debug_ranges_section): Translate all strings. 4145 (print_debug_loc_section): Likewise. 4146 4147 * unstrip.c (copy_elided_sections): Initialize SEC. 4148 4149 * ar.c (do_oper_insert): Put trailing / on short names. 4150 4151 * arlib.h (MAX_AR_NAME_LEN): Decrease by one. 4152 4153 * arlib2.c (arlib_add_long_name): Adjust for header size. 4154 4155 * arlib.c (arlib_finalize): Pad long name table to keep size even. 4156 4157 * ar.c (do_oper_insert): Use write_retry for padding write. 4158 4159 * ar.c (do_oper_insert): Initialize CUR_OFF in no_old case. 4160 Unconditionally set FOUND[CNT]->elf when setting ->mem. 4161 (remember_long_name): New function. 4162 (do_oper_insert): Call it. Correctly use length of basename, 4163 not original name. Don't store long name twice for new member. 4164 41652007-10-06 Roland McGrath <roland@redhat.com> 4166 4167 * elflint.c (check_note): Skip empty segment. 4168 (check_note_section): Skip empty section. 4169 4170 * unstrip.c (options, parse_opt, struct arg_info): Grok -R/--relocate. 4171 (handle_output_dir_module, handle_implicit_modules): Pass it down. 4172 (handle_dwfl_module): When set, use ET_REL already loaded by Dwfl. 4173 (compare_alloc_sections): Take new arg REL, ignore address if true. 4174 (compare_sections): Likewise, pass it down. 4175 (compare_sections_rel, compare_sections_nonrel): New functions. 4176 (find_alloc_sections_prelink, copy_elided_sections): Use them 4177 instead of compare_sections. 4178 (sections_match): New function, broken out of ... 4179 (find_alloc_section): ... here. 4180 (copy_elided_sections): Reorganize section match-up logic. 4181 Use sections_match for SHF_ALLOC in ET_REL. 4182 For ET_REL, let the nonzero sh_addr from the debug file dominate. 4183 4184 * unstrip.c (add_new_section_symbols): Take new arg REL. 4185 When true, do not update section symbol values. 4186 (collect_symbols): Likewise. Update section symbols with address 4187 of chosen output section, not original section. 4188 (check_symtab_section_symbols, copy_elided_sections): Update callers. 4189 4190 * unstrip.c (compare_alloc_sections): At the same address, preserve 4191 original section order. 4192 4193 * elflint.c (special_sections): Don't require MERGE|STRINGS for 4194 .debug_str, it didn't always have them with older tools. 4195 4196 * elflint.c (check_symtab, check_one_reloc): Ignore sh_addr in ET_REL. 4197 41982007-10-05 Roland McGrath <roland@redhat.com> 4199 4200 * elflint.c (check_symtab): Allow SHN_UNDEF _GLOBAL_OFFSET_TABLE_ in 4201 ET_REL file. 4202 4203 * elflint.c (check_symtab): For _GLOBAL_OFFSET_TABLE_, diagnose 4204 SHN_UNDEF as "bad section". Use shndx value in messages. 4205 4206 * elflint.c (special_sections): Add ".debug_str". Decrement namelen 4207 for ".debug" so it matches as a prefix. 4208 (IS_KNOWN_SPECIAL): New macro. 4209 (check_sections): Use it for ".plt" match. Cite wrong SHT_NOBITS 4210 type even under -d, for a .debug* or .shstrtab section. 4211 4212 * readelf.c (print_ops): Use hex for address operand. 4213 42142007-10-04 Roland McGrath <roland@redhat.com> 4215 4216 * unstrip.c (copy_elided_sections): Initialize NDX_SECTION element for 4217 .gnu_debuglink section to SHN_UNDEF. Drop STT_SECTION symbols for 4218 sections mapped to SHN_UNDEF. 4219 42202007-10-04 Ulrich Drepper <drepper@redhat.com> 4221 4222 * readelf.c (dump_archive_index): Avoid warning about uninitialized 4223 variable with older glibc versions. 4224 Add some branch prediction. 4225 42262007-10-04 Roland McGrath <roland@redhat.com> 4227 4228 * readelf.c (print_archive_index): New variable. 4229 (options, parse_opt): Accept -c/--archive-index to set it. 4230 (dump_archive_index): New function. 4231 (process_file): Take new arg WILL_PRINT_ARCHIVE_INDEX. 4232 Call dump_archive_index on archives if set. 4233 (main): Update caller. 4234 (any_control_option): Give it file scope, moved out of ... 4235 (parse_opt): ... here. 4236 42372007-10-03 Roland McGrath <roland@redhat.com> 4238 4239 * unstrip.c (struct arg_info): Add `list' flag. 4240 (options, parse_opt): Grok -n/--list to set it. 4241 (list_module): New function. 4242 (handle_implicit_modules): Call it under -n. 4243 4244 * elflint.c (check_note_section): New function. 4245 (check_sections): Call it for SHT_NOTE. 4246 4247 * readelf.c (handle_notes): Use sections when available. 4248 4249 * elflint.c (check_note_data): New function, broken out of ... 4250 (check_note): ... here. Call it and elf_getdata_rawchunk. 4251 4252 * readelf.c (handle_auxv_note): Take offset as argument, not buffer. 4253 Use elf_getdata_rawchunk and gelf_getauxv. 4254 (handle_notes_data): New function, broken out of ... 4255 (handle_notes): ... here. Call it and elf_getdata_rawchunk. 4256 42572007-10-01 Roland McGrath <roland@redhat.com> 4258 4259 * readelf.c (hex_dump): Fix transposed subtraction generating spaces. 4260 4261 * readelf.c (hex_dump): Fix line header to be hex instead of decimal. 4262 42632007-09-10 Roland McGrath <roland@redhat.com> 4264 4265 * readelf.c (options): Give -p optional argument, alias --string-dump. 4266 (string_sections, string_sections_tail): New static variables. 4267 (parse_opt): Set them when -p has an argument. 4268 (print_string_section): New function, broken out of ... 4269 (print_strings): ... here. Call it. 4270 (dump_data_section): New function, broken out of ... 4271 (dump_data): ... here. Call it. 4272 (for_each_section_argument): New function, broken out of ... 4273 (dump_data): ... here. Call it. 4274 (dump_strings): New function. 4275 42762007-08-31 Roland McGrath <roland@redhat.com> 4277 4278 * readelf.c (print_strings): Typo fix. 4279 42802007-08-23 Roland McGrath <roland@redhat.com> 4281 4282 * readelf.c (printf_with_wrap): Function removed. 4283 (REGISTER_WRAP_COLUMN): New macro. 4284 (handle_core_register): Use print_core_item instead. 4285 (struct register_info): New type. 4286 (compare_registers, compare_register_sets): New functions. 4287 (register_bitpos, compare_sets_by_info): New functions. 4288 (handle_core_registers): Use those to segregate and sort registers 4289 for display. 4290 4291 * readelf.c (ITEM_WRAP_COLUMN): New macro. 4292 (print_core_item): New function. 4293 (handle_core_item): Use it instead of printf_with_wrap. 4294 (compare_core_items, compare_core_item_groups): New functions. 4295 (handle_core_items): Use them. Sort by group and force line breaks 4296 between groups. 4297 4298 * readelf.c (handle_core_registers, handle_core_items): New functions, 4299 broken out of ... 4300 (handle_core_note): ... here. Call them. 4301 43022007-08-22 Roland McGrath <roland@redhat.com> 4303 4304 * unstrip.c (new_shstrtab): New function, broken out of ... 4305 (copy_elided_sections): ... here. 4306 43072007-08-20 Roland McGrath <roland@redhat.com> 4308 4309 Avoid local function trampolines in nm binary. 4310 * nm.c (sort_by_address): Move to a static function instead of local 4311 inside show_symbols. 4312 (sort_by_name_strtab): New static variable. 4313 (sort_by_name): Use it. Move to a static function instead of local 4314 inside show_symbols. 4315 (show_symbols): Set sort_by_name_strtab. 4316 43172007-08-19 Roland McGrath <roland@redhat.com> 4318 4319 * readelf.c (handle_auxv_note): New function. 4320 (handle_notes): Call it. 4321 4322 * readelf.c (printf_with_wrap, convert): New functions. 4323 (handle_core_item, (handle_core_register): New functions. 4324 (handle_notes): Call those with details from ebl_core_note. 4325 43262007-08-12 Roland McGrath <roland@redhat.com> 4327 4328 * elflint.c (check_note): Accept type 0 with name "Linux". 4329 4330 * elflint.c (special_sections): Accept SHF_ALLOC for ".note". 4331 4332 * elflint.c (section_flags_string): Return "none" for 0, not "". 4333 43342007-08-11 Roland McGrath <roland@redhat.com> 4335 4336 * elflint.c (check_note): Accept NT_GNU_HWCAP, NT_GNU_BUILD_ID. 4337 43382007-08-04 Ulrich Drepper <drepper@redhat.com> 4339 4340 * readelf.c (hex_dump): Use isprint to determine whether to print 4341 character itself or full stop character. 4342 (dump_data): No need to check endp for NULL after strtol call. 4343 43442007-08-03 Roland McGrath <roland@redhat.com> 4345 4346 * readelf.c (print_string_sections): New variable. 4347 (options, parse_opt): Handle --strings/-p to set it. 4348 (print_strings): New function. 4349 (process_elf_file): Call it under -p. 4350 4351 * readelf.c (options): Add hidden aliases --segments, --sections, 4352 as taken by binutils readelf. 4353 43542007-08-01 Roland McGrath <roland@redhat.com> 4355 4356 * readelf.c (dump_data_sections, dump_data_sections_tail): 4357 New variables. 4358 (options, parse_opt): Handle --hex-dump/-x, set them. 4359 (hex_dump): New function. 4360 (dump_data): New function, call it. 4361 (process_elf_file): Call it. 4362 43632007-07-25 Roland McGrath <roland@redhat.com> 4364 4365 * addr2line.c (show_symbols): New variable. 4366 (print_addrsym): New function. 4367 (handle_address): Call it. 4368 (options, parse_opt): Handle -S/--symbols. 4369 43702007-06-05 Ulrich Drepper <drepper@redhat.com> 4371 4372 * addr2line.c: Update for latest autoconf header. 4373 * ar.c: Likewise. 4374 * elfcmp.c: Likewise. 4375 * elflint.c: Likewise. 4376 * findtextrel.c: Likewise. 4377 * ld.c: Likewise. 4378 * ldgeneric.c: Likewise. 4379 * nm.c: Likewise. 4380 * objdump.c: Likewise. 4381 * ranlib.c: Likewise. 4382 * readelf.c: Likewise. 4383 * size.c: Likewise. 4384 * strings.c: Likewise. 4385 * strip.c: Likewise. 4386 * unstrip.c: Likewise. 4387 43882007-05-18 Roland McGrath <roland@redhat.com> 4389 4390 * unstrip.c (copy_elided_sections): Match up non-NOBITS sections with 4391 stripped file, so as not to duplicate a section copied in both. 4392 4393 * strip.c (handle_elf): Keep SHT_NOTE section copies in the debug file. 4394 43952007-05-17 Roland McGrath <roland@redhat.com> 4396 4397 * unstrip.c (copy_elided_sections): Don't call gelf_newphdr for 0. 4398 4399 * unstrip.c (handle_file): Tweak BIAS != 0 warning. 4400 4401 * unstrip.c (handle_file): Take new arg CREATE_DIRS. If set, 4402 call make_directories here. 4403 (handle_explicit_files): Take new arg CREATE_DIRS, pass it down. 4404 (handle_dwfl_module): Likewise. 4405 (handle_implicit_modules): Update callers. 4406 (handle_output_dir_module): Likewise. Don't do make_directories here. 4407 4408 * unstrip.c (get_section_name): New function, broken out of ... 4409 (copy_elided_sections): here. Update callers. 4410 (find_alloc_section): Broken out of ... 4411 (copy_elided_sections): ... here. Update caller. 4412 (symtab_count_leading_section_symbols): Take new arg NEWSYMDATA, 4413 update STT_SECTION symbols' st_value fields as a side effect. 4414 (check_symtab_section_symbols): Update caller. 4415 (add_new_section_symbols): Set st_value in symbols added. 4416 (collect_symbols): Reset S->value for STT_SECTION symbols recorded. 4417 Take new arg SPLIT_BSS. Adjust S->shndx recorded for symbols moved 4418 from .bss to .dynbss. 4419 (find_alloc_sections_prelink): New function. Associate debug file 4420 allocated SHT_NOBITS shdrs with stripped moved by prelink via 4421 .gnu.prelink_undo information. 4422 (copy_elided_sections): Call it when we couldn't find every allocated 4423 section. Don't use a debug file non-NOBITS section if SHF_ALLOC. 4424 Take STRIPPED_EHDR arg instead of E_TYPE and PHNUM. 4425 (handle_file): Update callers. 4426 4427 * unstrip.c (copy_elided_sections): Ignore unfound unallocated section 4428 named ".comment". 4429 4430 * elflint.c (check_sections): Fix association of segments with 4431 sections when p_memsz > p_filesz. 4432 44332007-04-29 Roland McGrath <roland@redhat.com> 4434 4435 * addr2line.c (options, main): Tweak argp group settings to fix 4436 usage output. 4437 44382007-04-28 Roland McGrath <roland@redhat.com> 4439 4440 * strip.c (handle_elf): Update debug file's SHT_NOBITS sections' 4441 sizes to match sections adjusted in the stripped file. 4442 44432007-04-24 Roland McGrath <roland@redhat.com> 4444 4445 * elfcmp.c (OPT_HASH_INEXACT): New macro. 4446 (hash_inexact): New variable. 4447 (options, parse_opt): Add --hash-inexact option to set it. 4448 (hash_content_equivalent): New function. 4449 (main): Call it for differing SHT_HASH sections under --hash-inexact. 4450 44512007-04-23 Roland McGrath <roland@redhat.com> 4452 4453 * unstrip.c: New file. 4454 * Makefile.am (bin_PROGRAMS): Add it. 4455 (unstrip_LDADD): New variable. 4456 4457 * strip.c (options): Allow --output for -o. 4458 44592007-02-15 Ulrich Drepper <drepper@redhat.com> 4460 4461 * readelf.c: Remove unused code. Add a few consts. 4462 44632007-02-15 Roland McGrath <roland@redhat.com> 4464 4465 * readelf.c (print_debug): Fix brainos in SHDR test. 4466 44672007-02-05 Roland McGrath <roland@redhat.com> 4468 4469 * ar.c: Include <limits.h>, since we use LONG_MAX. 4470 44712007-02-05 Ulrich Drepper <drepper@redhat.com> 4472 4473 * ar.c: Add ugly hack to work around gcc complaining that we 4474 ignore fchown's return value. 4475 (do_oper_insert): Handle error when writing padding. 4476 * ranlib.c: Add fchown complain work around. 4477 4478 * arlib.c: Make symtab a global variable. Change all users. 4479 * arlib2.c: Likewise. 4480 * ranlib.c: Likewise. 4481 * ar.c: Likewise. 4482 * arlib.h: Declare it. 4483 44842007-01-11 Roland McGrath <roland@redhat.com> 4485 4486 * elflint.c (check_sections): Use ebl_machine_section_flag_check on 4487 SHF_MASKPROC bits separately from generic sh_flags validation. 4488 44892007-02-04 Ulrich Drepper <drepper@redhat.com> 4490 4491 * ar.c: New file. 4492 * arlib.c: New file. 4493 * arlib2.c: New file. 4494 * arlib.h: New file. 4495 * Makefile (noinst_LIBRARIES): Add libar. 4496 (libar_a_SOURCES): Define. 4497 (ar_LDADD): Define. 4498 (CFLAGS_ar): Define. 4499 * ranlib.c: Change to use arlib. 4500 4501 * elflint.c (check_symtab): Work around GNU ld bug which omits 4502 sections but not symbols in those sections. 4503 45042007-01-10 Ulrich Drepper <drepper@redhat.com> 4505 4506 * addr2line.c: Update copyright year. 4507 * elfcmp.c: Likewise. 4508 * elflint.c: Likewise. 4509 * findtextrel.c: Likewise. 4510 * ld.c: Likewise. 4511 * nm.c: Likewise. 4512 * objdump.c: Likewise. 4513 * ranlib.c: Likewise. 4514 * readelf.c: Likewise. 4515 * size.c: Likewise. 4516 * strings.c: Likewise. 4517 * strip.c: Likewise. 4518 45192006-12-09 Ulrich Drepper <drepper@redhat.com> 4520 4521 * elflint.c (compare_hash_gnu_hash): New function. Report if the 4522 two hash tables have different content (module expected omission 4523 of undefined symbols). 4524 45252006-10-31 Roland McGrath <roland@redhat.com> 4526 4527 * elflint.c (check_program_header): Don't complain about 4528 p_filesz > p_memsz if p_memsz is zero and p_type is PT_NOTE. 4529 45302006-09-19 Jakub Jelinek <jakub@redhat.com> 4531 4532 * strip.c (process_file): Disallow -f on archives. 4533 45342006-10-09 Roland McGrath <roland@redhat.com> 4535 4536 * Makefile.am (libld_elf_i386.so): Use $(LINK), not $(CC). 4537 45382006-08-29 Roland McGrath <roland@redhat.com> 4539 4540 * Makefile.am (MAINTAINERCLEANFILES): New variable. 4541 4542 * readelf.c (handle_relocs_rel): Typo fix, test DESTSHDR properly. 4543 Reported by Christian Aichinger <Greek0@gmx.net>. 4544 4545 * elflint.c (valid_e_machine): Add EM_ALPHA. 4546 Reported by Christian Aichinger <Greek0@gmx.net>. 4547 45482006-08-08 Ulrich Drepper <drepper@redhat.com> 4549 4550 * elflint.c (check_dynamic): Don't require DT_HASH for DT_SYMTAB. 4551 Keep track of which "high DT" entries are present. 4552 Check that either old or GNU-style hash table is present. 4553 If GNU-style hash table is used a symbol table is mandatory. 4554 Check that if any prelink entry is present all of them are. 4555 (check_gnu_hash): Only fail for undefined symbols in GNU-style hash 4556 table if they don't refer to functions. 4557 45582006-07-17 Roland McGrath <roland@redhat.com> 4559 4560 * elflint.c (struct version_namelist): Use GElf_Versym for `ndx' field. 4561 (add_version): Likewise for argument. 4562 (check_versym): Cast constant to GElf_Versym for comparison. 4563 45642006-07-12 Roland McGrath <roland@redhat.com> 4565 4566 * readelf.c (handle_gnu_hash): Add casts for machines where 4567 Elf32_Word != unsigned int. 4568 45692006-07-12 Ulrich Drepper <drepper@redhat.com> 4570 4571 * elflint.c (check_sysv_hash64): Fix printf format. 4572 45732006-07-11 Roland McGrath <roland@redhat.com> 4574 4575 * addr2line.c (options): English fix in -f doc string. 4576 4577 * addr2line.c (use_comp_dir): New variable. 4578 (options, parse_opt): Grok -A/--absolute to set it. 4579 (handle_address): If set, prepend dwfl_line_comp_dir results to 4580 relative file names. 4581 45822006-07-06 Ulrich Drepper <drepper@redhat.com> 4583 4584 * elflint.c: Adjust for latest new hash table format. 4585 * readelf.c: Likewise. 4586 4587 * elflint.c (check_versym): Ignore hidden bit when comparing version 4588 numbers. 4589 45902006-07-05 Ulrich Drepper <drepper@redhat.com> 4591 4592 * ldgeneric.c (ld_generic_create_outfile): Correctly recognize 4593 discarded COMDAT symbols. 4594 4595 * i386_ld.c (elf_i386_count_relocations): Lot of corrections. 4596 (elf_i386_create_relocations): Likewise. 4597 * ld.h (struct symbol): Add local and hidden bits. 4598 * ld.c (create_special_section_symbol): These synthsized symbols 4599 are local and hidden. 4600 * ldgeneric.c (file_process2): Check whether input file matches 4601 the emulation. 4602 (fillin_special_symbol): Create symbols as local and/or hidden 4603 if requested. 4604 (ld_generic_create_outfile): Make local copy of symbol. 4605 Don't hide global, defined symbols in dynamic symbol table unless 4606 requested. Synthetic symbols have no version information. 4607 4608 * elflint.c: Add support for checking 64-bit SysV-style hash tables. 4609 * readelf.c: Add support for printing 64-bit SysV-style hash tables. 4610 46112006-07-04 Ulrich Drepper <drepper@redhat.com> 4612 4613 * elflint.c (is_rel_dyn): Fix and extend DT_RELCOUNT/DT_RELACOUNT 4614 testing. 4615 46162006-07-03 Ulrich Drepper <drepper@redhat.com> 4617 4618 * elflint.c: Add testing of DT_GNU_HASH. 4619 * readelf.c: Implement showing histogram for DT_GNU_HASH section. 4620 4621 * Makefile.am: Add hacks to create dependency files for non-generic 4622 linker. 4623 46242006-06-12 Ulrich Drepper <drepper@redhat.com> 4625 4626 * ldgeneric.c (ld_generic_generate_sections): Don't create .interp 4627 section if creating a DSO and no interpreter is given. 4628 (ld_generic_create_outfile): Don't store reference to symbols in 4629 discarded COMDAT groups. Don't create PHDR and INTERP program header 4630 for DSO if no interpreter is specified. 4631 (create_verneed_data): Pretty printing. 4632 4633 * ldscript.y (content): If a DSO is created don't set default 4634 interpreter from linker script. 4635 4636 * i386_ld.c (elf_i386_count_relocations): Do not add relocations 4637 for symbols in discarded COMDAT groups. 4638 (elf_i386_create_relocations): Likewise. 4639 * ld.h (struct scninfo): Add unused_comdat. 4640 * ldgeneric.c (add_section): Also check group signature when 4641 matching COMDAT sections. 4642 (add_relocatable_file): Ignore symbols in COMDAT group which are 4643 discarded. 4644 4645 * elflint.c (check_one_reloc): For *_NONE relocs only check type 4646 and symbol reference. 4647 46482006-06-11 Ulrich Drepper <drepper@redhat.com> 4649 4650 * elflint.c (check_dynamic): Fix checking value of tags which are 4651 offsets in the string section. Make sure DT_STRTAB points to the 4652 section referenced in sh_link. 4653 4654 * ld.c (options): Add headers. Add short option 'R' for '--rpath'. 4655 4656 * ld.c: Recognize --eh-frame-hdr option. 4657 * ld.h (struct ld_state): Add eh_frame_hdr field. 4658 * ldgeneric.c (struct unw_eh_frame_hdr): Define. 4659 4660 * ldgeneric.c (add_section): Use ebl_sh_flags_combine instead of 4661 SH_FLAGS_COMBINE. 4662 (add_relocatable_file): Minor optimization of last change. 4663 (match_section): Don't preserve SHF_GROUP flag any longer. 4664 46652006-06-10 Ulrich Drepper <drepper@redhat.com> 4666 4667 * ld.c (parse_z_option): Recognize execstack and noexecstack. 4668 Handle record and ignore as position dependent options. 4669 (parse_z_option_2): Handle ignore and record here. 4670 * ld.h (struct ld_state): Add execstack field. 4671 * ldgeneric.c (add_relocatable_file): Recognize .note.GNU-stack 4672 sections. 4673 (ld_generic_create_outfile): Fix program header creation in native 4674 linker. Add PT_GNU_STACK program header. 4675 46762006-06-09 Ulrich Drepper <drepper@redhat.com> 4677 4678 * i386_ld.c (elf_i386_finalize_plt): Don't change symbol table entries 4679 for PLT entries if there is no local definition. 4680 4681 * ld.c (parse_option): Handle -z ignore like --as-needed and 4682 -z record like --no-as-needed. 4683 * ld.h (struct ld_state): Remove ignore_unused_dsos field. 4684 * ldgeneric.c (new_generated_scn): Always compute ndt_needed by 4685 looping over DSOs. When deciding about adding DT_NEEDED entries 4686 use ->as_needed instead of ignore_unused_dsos. 4687 46882006-05-31 Ulrich Drepper <drepper@redhat.com> 4689 4690 * ld.c: Recognize --as-needed and --no-as-needed options. 4691 * ld.h (struct usedfile): Add as_needed field. 4692 (struct ld_state): Likewise. 4693 * ldgeneric.c (ld_handle_filename_list): Copy as_needed flag from 4694 the list. 4695 * ldscript.y (filename_id_list): Split to correctly parse all 4696 combinations. 4697 (mark_as_needed): Fix loop. 4698 46992006-05-28 Ulrich Drepper <drepper@redhat.com> 4700 4701 * addr2line.c (print_dwarf_function): Use unsigned type for lineno 4702 and colno. 4703 47042006-05-27 Ulrich Drepper <drepper@redhat.com> 4705 4706 * readelf.c (handle_relocs_rela): Better notations for addon value. 4707 (print_ehdr): Distinguish e_ident[EI_VERSION] from e_version. 4708 47092006-04-04 Ulrich Drepper <drepper@redhat.com> 4710 4711 * addr2line.c: Update copyright year. 4712 * elfcmp.c: Likewise. 4713 * elflint.c: Likewise. 4714 * findtextrel.c: Likewise. 4715 * ld.c: Likewise. 4716 * nm.c: Likewise. 4717 * objdump.c: Likewise. 4718 * ranlib.c: Likewise. 4719 * readelf.c: Likewise. 4720 * size.c: Likewise. 4721 * strings.c: Likewise. 4722 * strip.c: Likewise. 4723 47242006-03-09 Roland McGrath <roland@redhat.com> 4725 4726 * Makefile.am (AM_LDFLAGS): New variable. 4727 47282006-03-01 Roland McGrath <roland@redhat.com> 4729 4730 * readelf.c (dwarf_tag_string, dwarf_attr_string): Update name tables 4731 for dwarf.h changes matching 3.0 spec. 4732 (dwarf_encoding_string, dwarf_lang_string, print_ops): Likewise. 4733 47342005-12-04 Ulrich Drepper <drepper@redhat.com> 4735 4736 * elflint.c (check_one_reloc): If relocation section is not loaded, 4737 don't check whether the relocations modify read-only sections or 4738 loaded and unloaded sections. 4739 47402005-11-28 Ulrich Drepper <drepper@redhat.com> 4741 4742 * elflint.c (check_one_reloc): Take additional parameters. Use 4743 them to determine whether relocation is valid in this type of 4744 file. DSOs and executables can contain relocation sections in 4745 unloaded sections which just show the relocations the linker 4746 applied. Adjust all callers. 4747 (check_program_header): Check that PT_PHDR is loaded and that offset 4748 matches the one in the ELF header. 4749 47502005-10-26 Roland McGrath <roland@redhat.com> 4751 4752 * nm.c (get_var_range): dwarf_getloclist -> dwarf_getlocation. 4753 47542005-09-03 Ulrich Drepper <drepper@redhat.com> 4755 4756 * strip.c (handle_elf): Unify some error messages. 4757 * ld.c (main): Likewise. 4758 * ldgeneric.c (open_elf): Likewise. 4759 * elfcmp.c (main): Likewise. 4760 * elflint.c (check_elf_header): Likewise. 4761 4762 * size.c (process_file): Fix typo in error message. 4763 4764 * readelf.c: Lots of little cleanups. Use _unlocked functions. 4765 47662005-09-02 Ulrich Drepper <drepper@redhat.com> 4767 4768 * strings.c (main): Reset elfmap variable after munmap call. 4769 [_MUDFLAP] (map_file): Simplify mudflap debugging by not using mmap. 4770 47712005-08-28 Ulrich Drepper <drepper@redhat.com> 4772 4773 * ranlib.c: Don't define pread_retry and write_retry here. 4774 4775 * Makefile.an [BUILD_STATIC] (libdw): Add -ldl. 4776 (CLEANFILES): Add *.gcno *.gcda *.gconv. 4777 4778 * strings.c (process_chunk): Reorder expressions in conditional 4779 (process_chunk_mb): Likewise. 4780 4781 * strings.c: New file. 4782 * Makefile.am (bin_PROGRAMS): Add strings. 4783 (strings_no_Wstring): Define. 4784 (strings_LDADD): Define. 4785 47862005-08-27 Roland McGrath <roland@redhat.com> 4787 4788 * addr2line.c (dwarf_diename_integrate): Function removed. 4789 (print_dwarf_function): Use plain dwarf_diename. 4790 47912005-08-24 Ulrich Drepper <drepper@redhat.com> 4792 4793 * elflint.c (check_versym): Versioned symbols should not have 4794 local binding. 4795 47962005-08-15 Ulrich Drepper <drepper@redhat.com> 4797 4798 * elflint.c (check_versym): Allow VER_NDX_LOCAL symbols to be 4799 undefined. 4800 4801 * Makefile.am: Add rules to build ranlib. 4802 * ranlib.c: New file. 4803 48042005-08-14 Roland McGrath <roland@redhat.com> 4805 4806 * elflint.c (check_sections): Use ebl_section_type_name and allow any 4807 sh_type it recognizes. 4808 4809 * elflint.c (check_sections): Print unknown flags in hex, don't 4810 truncate high bits. Print section number and name for unknown type. 4811 48122005-08-13 Roland McGrath <roland@redhat.com> 4813 4814 * elflint.c (check_program_header): Use ebl_segment_type_name and 4815 allow any p_type it recognizes. Include p_type value in error 4816 message for unknown type. 4817 48182005-08-13 Ulrich Drepper <drepper@redhat.com> 4819 4820 * elflint.c (check_symtab): Simplify last change a bit. Pass ehdr 4821 to ebl_check_special_symbol. 4822 (check_sections): Pass ehdr to ebl_bss_plt_p. 4823 48242005-08-12 Roland McGrath <roland@redhat.com> 4825 4826 * elflint.c (check_symtab): Check that _GLOBAL_OFFSET_TABLE_ st_shndx 4827 refers to the right section if it's not SHN_ABS. 4828 Let ebl_check_special_symbol override _G_O_T_ value and size checks. 4829 4830 * elflint.c (check_sections): Don't complain about a non-NOBITS 4831 section taking no segment space, if it's sh_size is 0. 4832 4833 * elflint.c (check_sections): Use ebl_bss_plt_p to see if .plt should 4834 be PROGBITS or NOBITS. 4835 4836 * elflint.c (check_symtab): Use ebl_check_special_symbol to override 4837 standard st_value and st_size checks. 4838 48392005-07-28 Roland McGrath <roland@redhat.com> 4840 4841 * addr2line.c (options, parse_opt): Don't handle -e here. 4842 (executable): Variable removed. 4843 (argp_children): New static variable. 4844 (argp): Use it. Make const. 4845 (main): Fill in argp_children from dwfl_standard_argp (). 4846 Let libdwfl handle file selection, pass Dwfl handle to handle_address. 4847 (print_dwarf_function): New function. Try to figure out inline chain. 4848 (elf_getname): Function removed, libdwfl does it for us. 4849 (handle_address): Take Dwfl handle instead of Elf, Dwarf handles. 4850 Use dwfl_module_addrname instead of elf_getname. 4851 Use dwfl_module_getsrc and dwfl_lineinfo instead of libdw calls. 4852 * Makefile.am (INCLUDES): Add libdwfl directory to path. 4853 48542005-08-10 Ulrich Drepper <drepper@redhat.com> 4855 4856 * strip.c (parse_opt): STATE parameter is now used. 4857 Various little cleanups. 4858 4859 * readelf.c (print_debug_line_section): Correct fallout of renaming 4860 of DW_LNS_set_epilog_begin. 4861 48622005-08-08 Roland McGrath <roland@redhat.com> 4863 4864 * strip.c (options, parse_opt): Grok -R .comment for compatibility 4865 with binutils strip. Likewise -d, -S, as aliases for -g. 4866 Likewise ignore -s/--strip-all. 4867 48682005-08-07 Roland McGrath <roland@redhat.com> 4869 4870 * strip.c (process_file): Open read-only when using a different output 4871 file. 4872 48732005-08-06 Ulrich Drepper <drepper@redhat.com> 4874 4875 * elflint.c (in_nobits_scn): New function. 4876 (check_versym): Allow references for defined symbols against versions 4877 of other DSOs also for symbols in nobits sections. 4878 Move a few variables around. 4879 4880 * Makefile.am (AM_CFLAGS): Avoid duplication. 4881 Link with statis libs if BUILD_STATIC. 4882 48832005-08-05 Ulrich Drepper <drepper@redhat.com> 4884 4885 * elflint.c: Many, many more tests. Mostly related to symbol 4886 versioning. Those sections should now be completely checked. 4887 4888 * readelf.c (print_dynamic): Use gelf_offscn. 4889 48902005-08-04 Ulrich Drepper <drepper@redhat.com> 4891 4892 * elflint.c: Add lots more tests: more extension symbol table sanity, 4893 versioning section tests, hash table tests. General cleanup. 4894 48952005-08-02 Ulrich Drepper <drepper@redhat.com> 4896 4897 * objdump.c: New file. 4898 * Makefile.am (bin_PROGRAMS): Add objdump. 4899 (objdump_LDADD): Define. 4900 4901 * elflint.c (check_reloc_shdr): New function split out from check_rela 4902 and check_rel. 4903 (check_one_reloc): New function. Likewise. 4904 (check_rela): Use check_reloc_shdr and check_one_reloc. 4905 (check_rel): Likewise. 4906 (check_program_header): Check that PT_DYNAMIC entry matches .dynamic 4907 section. 4908 Add checks that relocations against read-only segments are flagged, 4909 that the text relocation flag is not set unnecessarily, and that 4910 relocations in one section are either against loaded or not-loaded 4911 segments. 4912 49132005-08-01 Ulrich Drepper <drepper@redhat.com> 4914 4915 * elfcmp.c (main): Ignore section count and section name string table 4916 section index. 4917 49182005-07-27 Roland McGrath <roland@redhat.com> 4919 4920 * elfcmp.c: Include <locale.h>. 4921 49222005-07-27 Ulrich Drepper <drepper@redhat.com> 4923 4924 * elfcmp.c: Print name and index of differing section. 4925 49262005-07-24 Ulrich Drepper <drepper@redhat.com> 4927 4928 * elfcmp.c: Implement comparing gaps between sections. 4929 49302005-07-23 Ulrich Drepper <drepper@redhat.com> 4931 4932 * elflint.c: Include libeblP.h instead of libebl.h. 4933 * nm.c: Likewise. 4934 * readelf.c: Likewise. 4935 * elfcmp.c: Likewise. 4936 4937 * elfcmp.c (main): Compare individual ELF header fields, excluding 4938 e_shoff instead of the whole struct at once. 4939 Use ebl_section_strip_p instead of SECTION_STRIP_P. 4940 * strip.c: Use ebl_section_strip_p instead of SECTION_STRIP_P. 4941 49422005-07-22 Ulrich Drepper <drepper@redhat.com> 4943 4944 * elfcmp.c (main): Take empty section into account when comparing 4945 section content. 4946 4947 * elflint.c (check_dynamic): Check that d_tag value is >= 0 before 4948 using it. 4949 49502005-07-21 Ulrich Drepper <drepper@redhat.com> 4951 4952 * elfcmp.c: New file. 4953 * Makefile.am (bin_PROGRAMS): Add elfcmp. 4954 (elfcmp_LDADD): Define. 4955 4956 * elflint.c (check_rela): Check that copy relocations only reference 4957 object symbols or symbols with unknown type. 4958 (check_rel): Likewise. 4959 49602005-06-08 Roland McGrath <roland@redhat.com> 4961 4962 * readelf.c (print_ops): Add consts. 4963 49642005-05-31 Roland McGrath <roland@redhat.com> 4965 4966 * readelf.c (print_debug_abbrev_section): Don't bail after first CU's 4967 abbreviations. Print a header line before each CU section. 4968 4969 * readelf.c (print_debug_loc_section): Fix indentation for larger 4970 address size. 4971 49722005-05-30 Roland McGrath <roland@redhat.com> 4973 4974 * readelf.c (print_debug_line_section): Print section offset of each 4975 CU's table, so they are easy to find from seeing the stmt_list value. 4976 4977 * readelf.c (dwarf_attr_string): Add all attributes in <dwarf.h>. 4978 (attr_callback): Grok DW_AT_ranges and print offset in hex. 4979 4980 * readelf.c (attr_callback): Add 2 to addrsize * 2 for %#0* format. 4981 (print_debug_ranges_section, print_debug_loc_section): Likewise. 4982 4983 * readelf.c (print_ops): Take different args for indentation control. 4984 (attr_callback): Caller updated. 4985 Grok several more block-form attributes as being location expressions. 4986 For those same attributes with udata forms, format output differently 4987 for location list offset. 4988 (print_debug_loc_section): Implement it for real. 4989 4990 * readelf.c (options): Mention ranges for --debug-dump. 4991 (enum section_e): Add section_ranges. 4992 (parse_opt): Grok "ranges" for -w/--debug-dump. 4993 (print_debug_ranges_section): New function. 4994 (print_debug): Handle .debug_ranges section. 4995 49962005-05-30 Ulrich Drepper <drepper@redhat.com> 4997 4998 * readelf.c (handle_notes): At least x86-64 need not have the note 4999 section values aligned to 8 bytes. 5000 50012005-05-18 Ulrich Drepper <drepper@redhat.com> 5002 5003 * readelf.c (dwarf_tag_string): Add new tags. 5004 50052005-05-08 Roland McGrath <roland@redhat.com> 5006 5007 * strip.c (handle_elf): Don't translate hash and versym data formats, 5008 elf_getdata already did it for us. 5009 50102005-05-07 Ulrich Drepper <drepper@redhat.com> 5011 5012 * Makefile.am (findtextrel_LDADD): Add $(libmudflap). 5013 (addr2line_LDADD): Likewise. 5014 50152005-05-03 Roland McGrath <roland@redhat.com> 5016 5017 * strip.c (handle_elf): Apply symbol table fixups to discarded 5018 relocation sections when they are being saved in the debug file. 5019 5020 * strip.c (handle_elf): Pass EHDR->e_ident[EI_DATA] to gelf_xlatetom 5021 and gelf_xlatetof, not the native byte order. 5022 5023 * strip.c (parse_opt): Give error if -f or -o is repeated. 5024 (main): Exit if argp_parse returns nonzero. 5025 5026 * strip.c (debug_fname_embed): New variable. 5027 (options, parse_opt): New option -F to set it. 5028 50292005-05-07 Ulrich Drepper <drepper@redhat.com> 5030 5031 * readelf.c (parse_opt): Make any_control_option variable 5032 local. Simplify some tests. 5033 50342005-05-03 Roland McGrath <roland@redhat.com> 5035 5036 * strip.c (crc32_file): Function removed (now in ../lib). 5037 50382005-05-03 Roland McGrath <roland@redhat.com> 5039 5040 * elflint.c (is_debuginfo): New variable. 5041 (options, parse_opt): New option --debuginfo/-d to set it. 5042 (check_sections): If is_debuginfo, don't complain about SHT_NOBITS. 5043 (check_note): If is_debuginfo, don't try to get note contents. 5044 50452005-04-24 Ulrich Drepper <drepper@redhat.com> 5046 5047 * readelf.c (print_debug_abbrev_section): Don't print error when end of 5048 section reached. 5049 50502005-04-14 Ulrich Drepper <drepper@redhat.com> 5051 5052 * readelf.c (dwarf_encoding_string): New function. 5053 (dwarf_inline_string): New function. 5054 (dwarf_access_string): New function. 5055 (dwarf_visibility_string): New function. 5056 (dwarf_virtuality_string): New function. 5057 (dwarf_identifier_case_string): New function. 5058 (dwarf_calling_convention_string): New function. 5059 (dwarf_ordering_string): New function. 5060 (dwarf_discr_list_string): New function. 5061 (attr_callback): Decode man more attribute values. 5062 50632005-04-01 Ulrich Drepper <drepper@redhat.com> 5064 5065 * addr2line.c: Finish implementation of -f option. 5066 50672005-03-29 Ulrich Drepper <drepper@redhat.com> 5068 5069 * addr2line.c: New file. 5070 * Makefile.am (bin_PROGRAMS): Add addr2line. 5071 Define addr2line_LDADD. 5072 5073 * findtextrel.c: Use new dwarf_addrdie function. 5074 5075 * findtextrel.c: Fix usage message and re-add accidentally removed 5076 line. 5077 50782005-03-28 Ulrich Drepper <drepper@redhat.com> 5079 5080 * findtextrel.c: New file. 5081 * Makefile: Add rules to build findtextrel. 5082 50832005-02-15 Ulrich Drepper <drepper@redhat.com> 5084 5085 * ldlex.l: Provide ECHO definition to avoid warning. 5086 5087 * elflint.c (check_program_header): Fix typo in RELRO test. 5088 5089 * Makefile.am (AM_CFLAGS): Add more warning options. 5090 * elflint.c: Fix warnings introduced by the new warning options. 5091 * i386_ld.c: Likewise. 5092 * ld.c: Likewise. 5093 * ld.h: Likewise. 5094 * ldgeneric.c: Likewise. 5095 * nm.c: Likewise. 5096 * readelf.c: Likewise. 5097 * sectionhash.c: Likewise. 5098 * size.c: Likewise. 5099 * string.c: Likewise. 5100 51012005-02-05 Ulrich Drepper <drepper@redhat.com> 5102 5103 * Makefile.am: Check for text relocations in constructed DSOs. 5104 5105 * Makefile.am [MUDFLAP] (AM_CFLAGS): Add -fmudflap. Link all apps 5106 with -lmudflap. 5107 5108 * ldscript.y: Add as_needed handling. 5109 * ldlex.l: Recognize AS_NEEDED token. 5110 * ld.h (struct filename_list): Add as_needed flag. 5111 51122005-02-04 Ulrich Drepper <drepper@redhat.com> 5113 5114 * elflint.c (check_symtab): Correctly determine size of GOT section. 5115 51162005-01-19 Ulrich Drepper <drepper@redhat.com> 5117 5118 * ld.c: Remove unnecessary more_help function. Print bug report 5119 address using argp. 5120 * strip.c: Likewise. 5121 * size.c: Likewise. 5122 * nm.c: Likewise. 5123 * readelf.c: Likewise. 5124 * elflint.c: Likewise. 5125 5126 * elflint.c (main): Don't check for parameter problems here. 5127 (parse_opt): Do it here, where we get informed about some of them 5128 anyway. 5129 5130 * readelf.c (main): Don't check for parameter problems here. 5131 (parse_opt): Do it here, where we get informed about some of them 5132 anyway. 5133 51342005-01-11 Ulrich Drepper <drepper@redhat.com> 5135 5136 * strip.c: Update copyright year. 5137 * readelf.c: Likewise. 5138 * size.c: Likewise. 5139 * nm.c: Likewise. 5140 * ld.c: Likewise. 5141 * elflint.c: Likewise. 5142 5143 * elflint.c (check_symtab): Don't warn about wrong size for 5144 _DYNAMIC and __GLOBAL_OFFSET_TABLE__ for --gnu-ld. 5145 51462004-10-05 Ulrich Drepper <drepper@redhat.com> 5147 5148 * readelf.c (print_phdr): In section mapping, also indicate 5149 sections in read-only segments. 5150 51512004-09-25 Ulrich Drepper <drepper@redhat.com> 5152 5153 * readelf.c: Make compile with gcc 4.0. 5154 * strip.c: Likewise. 5155 51562004-08-16 Ulrich Drepper <drepper@redhat.com> 5157 5158 * strip.c (handle_elf): Rewrite dynamic memory handling to use of 5159 allocate to work around gcc 3.4 bug. 5160 51612004-01-25 Ulrich Drepper <drepper@redhat.com> 5162 5163 * ldlex.l (invalid_char): Better error message. 5164 51652004-01-23 Ulrich Drepper <drepper@redhat.com> 5166 5167 * readelf.c: Print SHT_GNU_LIBLIST sections. 5168 5169 * none_ld.c: New file. 5170 51712004-01-21 Ulrich Drepper <drepper@redhat.com> 5172 5173 * Makefile.am: Enable building of machine specific linker. 5174 51752004-01-20 Ulrich Drepper <drepper@redhat.com> 5176 5177 * Makefile.am: Support building with mudflap. 5178 5179 * i386_ld.c: Fix warnings gcc 3.4 spits out. 5180 * ldgeneric.c: Likewise. 5181 * ldscript.y: Likewise. 5182 * readelf.c: Likewise. 5183 * strip.c: Likewise. 5184 5185 * readelf.c (print_debug_line_section): Determine address size 5186 correctly. 5187 51882004-01-19 Ulrich Drepper <drepper@redhat.com> 5189 5190 * readelf.c (print_phdr): Show which sections are covered by the 5191 PT_GNU_RELRO entry. 5192 5193 * elflint.c (check_program_header): Check PT_GNU_RELRO entry. 5194 5195 * readelf.c (print_debug_macinfo_section): Implement. 5196 51972004-01-18 Ulrich Drepper <drepper@redhat.com> 5198 5199 * readelf.c (print_debug_line_section): Implement. 5200 52012004-01-17 Ulrich Drepper <drepper@redhat.com> 5202 5203 * src/elflint.c: Use PACKAGE_NAME instead of PACKAGE. 5204 * src/ld.c: Likewise. 5205 * src/nm.c: Likewise. 5206 * src/readelf.c: Likewise. 5207 * src/size.c: Likewise. 5208 * src/strip.c: Likewise. 5209 5210 * strip.c: Add a few more unlikely. Reduce scope of some variables. 5211 5212 * Makefile.am: Support building with mudflap. 5213 52142004-01-16 Ulrich Drepper <drepper@redhat.com> 5215 5216 * readelf.c (print_debug_info_section): Free dies memory. 5217 5218 * readelf.c: Print .debug_info section content. 5219 52202004-01-13 Ulrich Drepper <drepper@redhat.com> 5221 5222 * readelf.c (print_shdr): Add support for SHF_ORDERED and SHF_EXCLUDE. 5223 52242004-01-12 Ulrich Drepper <drepper@redhat.com> 5225 5226 * readelf.c (print_debug_aranges): Implement using libdw. 5227 52282004-01-11 Ulrich Drepper <drepper@redhat.com> 5229 5230 * nm.c: Adjust for Dwarf_Files type and dwarf_lineno interface change. 5231 5232 * readelf.c: Use libdw instead of libdwarf. Not all of the old 5233 behavior is available yet. 5234 * Makefile.am: Link readelf with libdw. Remove libdwarf include path. 5235 52362004-01-09 Ulrich Drepper <drepper@redhat.com> 5237 5238 * nm.c (get_local_names): Adjust call to dwarf_nextcu. 5239 5240 * nm.c: Implement getting information about local variables. 5241 52422004-01-07 Ulrich Drepper <drepper@redhat.com> 5243 5244 * nm.c: Read also debug information for local symbols. 5245 52462004-01-05 Ulrich Drepper <drepper@redhat.com> 5247 5248 * nm.c: Shuffle dwarf handling code around so the maximum column 5249 width can be computed ahead of printing. Avoid collection symbols 5250 which are not printed anyway. 5251 5252 * nm.c: Rewrite dwarf handling to use libdw. 5253 * Makefile.am (AM_CFLAGS): Add -std parameter. 5254 (INCLUDES): Find header in libdw subdir. 5255 (nm_LDADD): Replace libdwarf with libdw. 5256 5257 * elflint.c: Update copyright year. 5258 * readelf.c: Likewise. 5259 * size.c: Likewise. 5260 * strip.c: Likewise. 5261 * nm.c: Likewise. 5262 52632003-12-31 Ulrich Drepper <drepper@redhat.com> 5264 5265 * strip.c (process_file): Close file before returning. 5266 52672003-11-19 Ulrich Drepper <drepper@redhat.com> 5268 5269 * readelf.c (handle_dynamic): Make column for tag name wider. 5270 52712003-09-29 Ulrich Drepper <drepper@redhat.com> 5272 5273 * readelf.c (handle_dynamic): Always terminate tag name with a space. 5274 52752003-09-25 Ulrich Drepper <drepper@redhat.com> 5276 5277 * strip.c (process_file): Don't mmap the input file, we modify the 5278 data structures and don't want the change end up on disk. 5279 52802003-09-23 Jakub Jelinek <jakub@redhat.com> 5281 5282 * unaligned.h (union u_2ubyte_unaligned, 5283 union u_4ubyte_unaligned, union u_8ubyte_unaligned): Add 5284 packed attribute. 5285 (add_2ubyte_unaligned, add_4ubyte_unaligned, 5286 add_8ubyte_unaligned): Avoid nesting bswap_NN macros. 5287 Read/store value through _ptr->u instead of *_ptr. 5288 52892003-09-22 Ulrich Drepper <drepper@redhat.com> 5290 5291 * size.c (show_sysv): Change type of maxlen to int. 5292 5293 * strip.c (handle_elf): Handle the 64-bit archs which is 64-bit 5294 buckets. 5295 5296 * i386_ld.c: Many many fixes and extensions. 5297 * ld.c: Likewise. 5298 * ldgeneric.c: Likewise. 5299 53002003-08-16 Ulrich Drepper <drepper@redhat.com> 5301 5302 * ldgeneric.c (check_definition): Don't add symbol on dso_list if 5303 the reference is from another DSO. 5304 53052003-08-15 Ulrich Drepper <drepper@redhat.com> 5306 5307 * ldgeneric.c (find_entry_point): It is no fatal error if no entry 5308 point is found when creating a DSO. 5309 53102003-08-14 Ulrich Drepper <drepper@redhat.com> 5311 5312 * ld.c (main): Always call FLAG_UNRESOLVED. 5313 * ldgeneric.c (ld_generic_flag_unresolved): Only complain about 5314 undefined symbols if not creating DSO or ld_state.nodefs is not set. 5315 53162003-08-13 Ulrich Drepper <drepper@redhat.com> 5317 5318 * Makefile.in: Depend on libebl.a, not libebl.so. 5319 5320 * ld.c (main): Mark stream for linker script as locked by caller. 5321 (read_version_script): Likewise. 5322 * ldlex.c: Define fread and fwrite to _unlocked variant. 5323 5324 * i386_ld.c (elf_i386_finalize_plt): Replace #ifdefs with uses of 5325 target_bswap_32. 5326 * unaligned.h: Define target_bswap_16, target_bswap_32, and 5327 target_bswap_64. 5328 (store_2ubyte_unaligned, store_4ubyte_unaligned, 5329 store_8ubyte_unaligned): Define using new macros. 5330 53312003-08-12 Ulrich Drepper <drepper@redhat.com> 5332 5333 * i386_ld.c (elf_i386_finalize_plt): Use packed structs to access 5334 possibly unaligned memory. Support use of big endian machines. 5335 53362003-08-11 Ulrich Drepper <drepper@redhat.com> 5337 5338 * Moved to CVS archive. 5339