1 2022-05-10 Mark Wielaard <mark@klomp.org>
3 * elfcompress.c (process_file): Sanity check shstrtab_name,
4 shstrtab_newname and symstrents are only set once.
6 2022-04-24 Mark Wielaard <mark@klomp.org>
8 * elfclassify.c (main): Use classify_flag_no_stdin for no-std in options.
10 2022-04-19 Mark Wielaard <mark@klomp.org>
12 * readelf.c (get_dyn_ents): Define dyn_mem outside the while loop.
14 2022-03-01 Di Chen <dichen@redhat.com>
16 * readelf.c (get_dyn_ents): New function.
17 (handle_dynamic): Use get_dyn_ents to get the actual number of
18 Dynamic entries in the section.
20 2022-03-27 Mark Wielaard <mark@klomp.org>
22 * addr2line.c: Replace error (EXIT_FAILURE, ...) with error_exit(...).
25 * elfcompress.c: Likewise.
27 * objdump.c: Likewise.
28 * readelf.c: Likewise.
30 * strings.c: Likewise.
32 * unstrip.c: Likewise.
34 2022-03-24 Mark Wielaard <mark@klomp.org>
36 * elflint.c (check_note_data): Recognize NT_FDO_PACKAGING_METADATA.
38 2022-03-11 Mark Wielaard <mark@klomp.org>
40 * addr2line.c (OPT_RELATIVE): New constant.
41 (options): Add --relative.
42 (use_comp_dir): Initialize to true.
43 (parse_opt): Handle OPT_RELATIVE.
45 2021-12-04 Mark Wielaard <mark@klomp.org>
47 * readelf.c (print_ehdr): Pass sizeof (buf) - 1 to strncpy.
49 2021-10-20 John M Mellor-Crummey <johnmc@rice.edu>
51 * readelf.c (print_debug_line_section): Try to read
52 debug_str_offset if available. Handle DW_LNE_NVIDIA_inlined_call
53 and DW_LNE_NVIDIA_set_function_name.
55 2021-10-06 Mark Wielaard <mark@klomp.org>
57 * elflint.c (check_sections): Don't dereference databits if bad.
59 2021-09-09 Dmitry V. Levin <ldv@altlinux.org>
61 * findtextrel.c: Include "libeu.h".
62 (open_rootdir_file): New function.
63 (process_file): Use it to open file inside rootdir.
64 * Makefile.am (findtextrel_no_Wstack_usage): Remove.
66 2021-09-06 Dmitry V. Levin <ldv@altlinux.org>
68 * objdump.c (show_disasm): Replace asprintf followed by
69 error(EXIT_FAILURE) with xasprintf.
70 * readelf.c (handle_gnu_hash): Likewise.
71 * unstrip.c (handle_output_dir_module, main): Likewise.
73 * elflint.c (check_sections): Remove cast of xcalloc return value.
74 * findtextrel.c (process_file): Remove casts of malloc and realloc
76 * nm.c (get_local_names, show_symbols_sysv, show_symbols): Remove
77 casts of xmalloc return values.
78 * readelf.c (print_hash_info, handle_sysv_hash, handle_sysv_hash64,
79 handle_gnu_hash): Remove cast of xcalloc return value.
80 (print_debug_units): Remove casts of xmalloc return values.
81 * strip.c (handle_elf): Remove casts of xcalloc and xmalloc return
84 2021-09-05 Dmitry V. Levin <ldv@altlinux.org>
86 * Makefile.am (AM_LDFLAGS): Add $(STACK_USAGE_NO_ERROR).
88 2021-08-20 Saleem Abdulrasool <abdulras@google.com>
90 * elfclassify.c: Remove error.h include.
92 2021-03-18 Timm Bäder <tbaeder@redhat.com>
94 * readelf.c (run_advance_pc): New static inline function
96 (print_debug_line_section): ... here. Define advance_pc
99 2021-07-03 Mark Wielaard <mark@klomp.org>
101 * readelf.c (compare_listptr): Fix dwarf_attr_name argument.
103 2021-06-18 Mark Wielaard <mark@klomp.org>
105 * unstrip.c (adjust_relocs): Check gelf_getrel and geld_getrela.
107 2021-06-18 Mark Wielaard <mark@klomp.org>
109 * strip.c (remove_debug_relocations): Check gelf_update results.
110 (update_section_size): Likewise.
112 2021-06-06 Sergei Trofimovich <slyfox@gentoo.org>
114 * elflint.c (buffer_left): Mark as 'static' to avoid external linkage
117 2021-05-12 Dmitry V. Levin <ldv@altlinux.org>
119 * elfcompress.c (process_file): Return 1 instead of -1 in case of an
122 * elfcompress.c (process_file): Remove redundant assignment in case of
125 * elfcompress.c (process_file): Set res to 0 in case of "Nothing to do".
127 2021-04-19 Martin Liska <mliska@suse.cz>
129 * elfclassify.c (run_classify): Use startswith.
130 * elfcompress.c (process_file): Likewise.
131 * nm.c (show_symbols_sysv): Likewise.
132 * readelf.c (print_debug): Likewise.
133 (handle_notes_data): Likewise.
134 (dump_data_section): Likewise.
135 (print_string_section): Likewise.
136 * strip.c (remove_debug_relocations): Likewise.
138 2021-04-03 Mark Wielaard <mark@klomp.org>
140 * nm.c (show_symbols): close dwfl_fd if dwfl_begin fails.
142 2021-04-03 Mark Wielaard <mark@klomp.org>
144 * unstrip.c (handle_output_dir_module): Free output_file when done.
146 2021-04-03 Mark Wielaard <mark@klomp.org>
148 * ar.c (do_oper_insert): Always close newfd.
150 2021-03-03 Mark Wielaard <mark@klomp.org>
152 * readelf.c (handle_symtab): Sanity check verneed vna_next,
153 vn_next and verdef vd_next offsets.
155 2021-03-02 Timm Bäder <tbaeder@redhat.com>
157 * elfcompress.c (process_file): Remove cleanup() function and
158 replace it with a cleanup label at the end of the function.
159 Initialize res to -1.
161 2021-02-17 Timm Bäder <tbaeder@redhat.com>
163 * elfcompress.c (process_file): Move get_sections function...
164 (get_section): ...to top-level static function taking an
165 sections array and shnum.
167 2021-02-17 Timm Bäder <tbaeder@redhat.com>
169 * elfcompress.c (process_file): Move get_section function...
170 (get_section): ...to top-level static function taking an
173 2021-02-17 Timm Bäder <tbaeder@redhat.com>
175 * elfcompress.c (process_file): Move set_section function...
176 (set_section): ...to top-level static function taking a
179 2021-02-17 Timm Bäder <tbaeder@redhat.com>
181 * unstrip.c (handle_implicit_modules): Inline the next function
182 in three places. This is simply dwfl_getmodules with match_module
183 callback providing mmi.
185 2021-02-17 Timm Bäder <tbaeder@redhat.com>
187 * unstrip.c (handle_explicit_files): Move warn function...
188 (warn): ...here as top-level static function taking stripped,
189 unstripped files and force flag as extra arguments.
191 2021-02-17 Timm Bäder <tbaeder@redhat.com>
193 * unstrip.c (copy_elided_sections): Inline find_unalloc_section
194 function into calling location. The sec pointer is set to NULL
195 before the if-else statement and only set when match is found.
197 2021-02-17 Timm Bäder <tbaeder@redhat.com>
199 * unstrip.c (find_alloc_sections_prelink): Move check_match to...
200 (check_match): Adjusted to return whether there was no match,
201 which indicates a failure. So callers are adjusted to or the
202 result into a local fail boolean.
204 2021-02-17 Timm Bäder <tbaeder@redhat.com>
206 * unstrip.c (adjust_relocs): Move adjust_reloc function to...
207 (adjust_reloc): ... here as static top-level function taking
208 a map array and size as extra arguments.
210 2021-02-17 Timm Bäder <tbaeder@redhat.com>
212 * elflint.c (check_attributes): Rename and move left function...
213 (buffer_left): ...as static toplevel function taking both an
214 Elf_Data pointer argument and the unsigned char pointer p.
216 2021-02-17 Timm Bäder <tbaeder@redhat.com>
218 * elflint.c (check_attributes): Rename and move pos function...
219 (buffer_pos): ...as static toplevel function taking an extra
220 Elf_Data pointer argument.
222 2021-02-12 Mark Wielaard <mark@klomp.org>
224 * readelf.c (print_debug_units): Type DIE offset is from start CU.
226 2021-02-12 Mark Wielaard <mark@klomp.org>
228 * readelf.c (attr_callback): Don't handle blocks as expression
229 blocks for DWARF version 4 or higher.
231 2021-02-03 Timm Bäder <tbaeder@redhat.com>
233 * ar.c (do_oper_extract): Extract should_truncate_fname function
235 (should_truncate_fname): ...here. New file scope function taking
236 size_t pointer to be read and/or set.
238 2021-02-02 Timm Bäder <tbaeder@redhat.com>
240 * readelf.c (print_debug_line_section): Remove unnecessary
241 show_op_index variable, replace with (op_index > 0).
243 2021-01-08 Timm Bäder <tbaeder@redhat.com>
245 * readelf.c (print_cfa_program): Lift regname function to...
246 (regname): ...here. New file scope function add ebl and regnamebuf
249 2021-01-08 Timm Bäder <tbaeder@redhat.com>
251 * readelf.c (print_attributes): Lift left function to...
252 (left): ...here. New file scope function taking Elf_Data and char
255 2021-01-08 Timm Bäder <tbaeder@redhat.com>
257 * readelf.c (handle_core_registers): Lift same_set function to...
258 (same_set): ...here. New file scope function adding regs and
261 2021-01-08 Timm Bäder <tbaeder@redhat.com>
263 * readelf.c (parse_opt): Lift add_dump_section function to...
264 (add_dump_section): ...here. New top level function. Added key
267 2021-01-08 Timm Bäder <tbaeder@redhat.com>
269 * arlib-argp.c (help_filter): Lift text_for_default function to...
270 (text_for_default): ... here. New file scope function taking text
273 2021-01-08 Timm Bäder <tbaeder@redhat.com>
275 * addr2line.c (handle_address): Move show_note and show_int up to
277 (show_note: New static inline function.
278 (show_int): Likewise.
280 2021-01-08 Timm Bäder <tbaeder@redhat.com>
282 * strip.c (handle_elf): Remove no_symtab_updates function and
283 calls inside the switch statement. Add checks and (possibly)
284 continue, before switch statement is called.
286 2021-01-08 Timm Bäder <tbaeder@redhat.com>
288 * strip.c (handle_elf): Move inlined update_section_size function
290 (update_section_size): ...here. New static function that takes as
291 extra arguments the Elf_Scn, debug_elf, section cnt and fname.
293 2021-01-08 Timm Bäder <tbaeder@redhat.com>
295 * strip.c (remove_debug_relocations): Rewrite inlined relocate
296 function to file static. Do R_*_NONE, reloc_simple_type and
297 ebl_debug_scn_p checks before calling new relocate function.
298 (relocate): New file static function from
299 remove_debug_relocate. Remove R_*_NONE, reloc_simple_type and
300 ebl_debugscn_p checks.
302 2021-01-08 Timm Bäder <tbaeder@redhat.com>
304 * strip.c (handle_elf): Expand inlined function check_preserved.
306 2021-01-12 Mark Wielaard <mark@klomp.org>
308 * elflint.c (EXTRA_SHFLAGS): New define.
309 (check_sections): Use EXTRA_SHFLAGS. Add SHF_GNU_RETAIN to
312 2020-12-31 Sergei Trofimovich <slyfox@gentoo.org>
314 * elflint.c (section_flags_string): Add NEWFLAG for GNU_RETAIN,
317 2020-12-31 Sergei Trofimovich <slyfox@gentoo.org>
319 * elflint.c (section_flags_string): Update cp pointer after
320 snprintf for unknown flags.
322 2020-12-16 Érico Nogueira <ericonr@disroot.org>
324 * readelf.c (qsort_r): Use qsort for improved portability.
326 2020-12-20 Dmitry V. Levin <ldv@altlinux.org>
328 * .gitignore: New file.
330 2020-12-12 Mark Wielaard <mark@klomp.org>
332 * elflint.c (check_sections): Handle SHF_GNU_RETAIN.
333 * readelf.c (print_shdr): Likewise.
335 2020-12-16 Dmitry V. Levin <ldv@altlinux.org>
337 * *.c: Replace gettext(...) with _(...).
339 * unstrip.c (_): Remove.
341 2020-12-15 Mark Wielaard <mark@klomp.org>
343 * elflint.c (check_symtab): Always print symbol name (if known)
346 2020-12-12 Dmitry V. Levin <ldv@altlinux.org>
348 * ar.c (write_member, do_oper_insert): Fix spelling typo in comment.
349 * elfclassify.c (issue, elf_issue, is_unstripped): Likewise.
350 * elfcompress.c (process_file): Likewise.
351 * elflint.c (be_quiet, check_gnu_hash): Likewise.
352 * readelf.c (print_phdr, handle_gnu_hash,
353 dwarf_locexpr_opcode_string): Likewise.
354 * size.c (totals_class): Likewise.
355 * strings.c (read_elf): Likewise.
356 * strip.c (handle_elf): Likewise.
358 * readelf.c (print_debug_addr_section): Fix spelling typo in error
360 * strip.c (options): Fix spelling typos in argp help text.
361 * strings.c (options): Likewise.
362 * stack.c (options): Likewise.
364 2020-11-01 Érico N. Rolim <erico.erc@gmail.com>
366 * unstrip.c (make_directories): Use ACCESSPERMS for mkdir.
367 (handle_file): Use DEFFILEMODE for open with O_CREAT for ET_REL
368 files, ACCESSPERMS otherwise.
370 2020-11-01 Érico N. Rolim <erico.erc@gmail.com>
372 * Makefile.am (nm_LDADD): Add obstack_LIBS.
373 (ranlib_LDADD): Likewise.
374 (ar_LDADD): Likewise.
376 2020-10-27 Érico N. Rolim <erico.erc@gmail.com>
378 * unstrip.c (make_directories): Use strndup, not strndupa.
380 2020-09-28 Mark Wielaard <mark@klomp.org>
382 * readelf.c (next_listptr_offset): Take idx as pointer, to be updated
383 and use new Dwarf_Off as offset to match.
384 (listptr_attr): New function.
385 (print_debug_loclists_section): Check for DW_AT_GNU_locviews to show
387 (print_debug_loc_section): Adjust next_listptr_offset call.
389 2020-09-03 Mark Wielaard <mark@klomp.org>
391 * readelf.c (print_cfa_program): Take ehdr as argument. Use it to
392 recognize DW_CFA_AARCH64_negate_ra_state.
393 (print_debug_frame_section): Pass ehdr to print_cfa_program.
394 (print_debug): Don't warn if we dump frames, but cannot get dbg.
396 2020-09-01 Mark Wielaard <mark@klomp.org>
398 * readelf.c (print_debug_ranges_section): Base address entry can
400 (print_debug_loc_section): Likewise.
402 2020-09-04 Mark Wielaard <mark@klomp.org>
404 * elflint.c (special_sections): Add .debug_line_str.
406 2020-08-26 Mark Wielaard <mark@klomp.org>
408 * readelf.c (print_debug_line_section): It is not an error if there
409 are no line number statements at the end of a debug line section.
411 2020-07-19 Mark Wielaard <mark@klomp.org>
413 * elfclassify.c (process_current_path): Handle fwrite failing.
415 2020-07-05 Mark Wielaard <mark@klomp.org>
417 * stack.c (module_callback): Don't assert if dwfl_module_info fails.
418 * unstrip.c (adjust_relocs): Produce a proper error when HAS
419 section has inconsistent size or entsize.
420 (match_module): Don't assert if dwfl_module_info fails.
422 2020-06-16 Mark Wielaard <mark@klomp.org>
424 * ar.c (do_oper_extract): Split large if statement. Call fchown
425 before fchmod and explicitly ignore the return value.
426 (do_oper_delete): Likewise.
427 (do_oper_insert): Likewise.
428 * ranlib.c (handle_file): Likewise.
430 2020-06-16 Mark Wielaard <mark@klomp.org>
432 * elflint.c (check_elf_header): Explicitly check and ignore
433 any error from elf_compress.
435 2020-06-07 Mark Wielaard <mark@klomp.org>
437 * nm.c (sort_by_name_strtab): Replace by...
438 (sort_by_name_elf): New static Elf pointer and ...
439 (sort_by_name_ndx): New static size_t index.
440 (sort_by_name): Use elf_strptr to get symbol string.
441 (show_symbols): Set sort_by_name_elf and sort_by_name_ndx.
443 2020-06-06 Mark Wielaard <mark@klomp.org>
445 * nm.c (show_symbols_sysv): Skip no name and STT_FILE symbols.
446 When not printing address and size pad strings. Strip "GNU_"
447 prefix from binding name.
448 (class_type_char): Use 'V' for weak symbols, 'C' for common
449 symbols and 'T' for weak functions.
450 (show_symbols_posix): Skip STT_FILE symbols. Don't print value and
453 2020-06-04 Mark Wielaard <mark@klomp.org>
455 * elflint.c (check_program_header): Remove PT_GNU_PROPERTY define.
457 2020-05-14 Mark Wielaard <mark@klomp.org>
459 * size.c (show_bsd): Set printf format based on radix.
461 2020-05-09 Mark Wielaard <mark@klomp.org>
463 * elflint.c (process_elf_file): Error out if ebl_openbackend fails.
464 * objdump.c (handle_elf): Likewise.
465 * nm.c (handle_elf): Likewise. Move full name string construction
466 forward, so it can be used in the error message.
468 2020-04-17 Mark Wielaard <mark@klomp.org>
470 * readelf.c (print_debug): Check .gnu.debuglto_ prefix.
472 2020-04-16 Mark Wielaard <mark@klomp.org>
474 * elflint.c (check_sections): Mask out SHF_EXCLUDE from processor
475 specific section flags when --gnu is given.
477 2020-02-08 Mark Wielaard <mark@klomp.org>
479 * elflint.c (check_program_header): Handle PT_GNU_PROPERTY.
481 2020-02-07 Mark Wielaard <mark@klomp.org>
483 * elflint.c (check_symtab): Check st_info isn't too big.
485 2020-01-16 Mark Wielaard <mark@klomp.org>
487 * nm.c (show_symbols_sysv): Iterate over all symbols starting
490 2019-11-26 Mark Wielaard <mark@klomp.org>
492 * Makefile.am (BUILD_STATIC): Add libraries needed for libdw.
494 2019-10-26 Mark Wielaard <mark@klomp.org>
496 * unstrip.c (collect_symbols): Check symbol strings are
499 2019-10-18 Mark Wielaard <mark@klomp.org>
501 * unstrip.c (adjust_relocs): Set versym data d_size to the actual
504 2019-10-20 Mark Wielaard <mark@klomp.org>
506 * unstrip.c (copy_elided_sections): Set and check max_off.
508 2019-10-21 Mark Wielaard <mark@klomp.org>
510 * unstrip.c (adjust_relocs): Add map_size argument and check ndx
512 (adjust_all_relocs): Add map_size argument and pass it to
514 (add_new_section_symbols): Call adjust_all_relocs with symndx_map
516 (collect)symbols): Check sym and string data can be found.
517 (compare_symbols_output): Call error when (different) symbols are
519 (new_shstrtab): Make unstripped_strent array one larger. Check
520 stripped_shnum isn't zero.
521 (copy_elided_sections): Add ndx_sec_num as size of ndx_section
522 array. Check sh_link and sh_info are not larger than ndx_sec_num.
523 Allocate symbols and symndx_map arrays on heap, not stack. Pass
524 map sizes to adjust_all_relocs.
526 2019-09-28 Dmitry V. Levin <ldv@altlinux.org>
528 * elflint.c (main): When an input file cannot be opened,
529 include its name into the error diagnostics.
530 * readelf.c (main): Likewise.
532 2019-09-02 Mark Wielaard <mark@klomp.org>
534 * readelf.c (PRINT_DYNSYM_TABLE): New argp key value.
535 (argp_opt): Add syn-sym.
536 (print_dynsym_table): New static bool.
537 (parse_opt): Handle PRINT_DYNSYM_TABLE.
538 (process_elf_file): Check print_dynsym_table.
540 2019-08-27 Mark Wielaard <mark@klomp.org>
542 * readelf.c (for_each_section_argument): Call (*dump) also for
545 2019-08-26 Mark Wielaard <mark@klomp.org>
547 * nm.c (show_symbols): Remember nentries_orig and check before
550 2019-07-05 Omar Sandoval <osandov@fb.com>
552 * Makefile.am: Remove -ldl.
553 (elflint_LDADD): Add $(libdw).
554 (elfcmp_LDADD): Add $(libdw).
555 (objdump_LDADD): Add $(libdw).
557 2019-08-26 Mark Wielaard <mark@klomp.org>
559 * readelf (options): Add OPTION_ARG_OPTIONAL "SECTION" for notes.
560 (notes_section): New global variable.
561 (parse_opt): Set notes_section.
562 (handle_notes): Check if notes_section is set.
564 2019-07-26 Florian Weimer <fweimer@redhat.com>
565 Mark Wielaard <mark@klomp.org>
567 * Makefile.am (bin_PROGRAMS): Add elfclassify.
568 (elfclassify_LDADD): New variable.
569 * elfclassify.c: New tool.
571 2019-07-13 Mao Han <han_mao@c-sky.com>
573 * elflint.c: Add C-SKY.
575 2019-06-28 Mark Wielaard <mark@klomp.org>
577 * readelf.c (print_ehdr): Use dwelf_elf_e_machine_string instead of
578 ebl->name. If unknown print hex value.
580 2019-06-25 Mark Wielaard <mark@klomp.org>
582 * stack.c (parse_opt): Fix dwfl_core_file_attach error message.
584 2019-06-18 Mark Wielaard <mark@klomp.org>
586 * strip.c (handle_elf): Use elf_begin ELF_C_WRITE, instead of
589 2019-05-10 Mark Wielaard <mark@klomp.org>
591 * readelf.c (struct attrcb_args): Rename die to dies.
592 (attr_callback): Get current current die using dies[level].
593 Handle DW_AT_discr_list as block, not as constant.
594 (print_debug_units): pass dies, not dies[level] as args.
596 2019-05-09 Mark Wielaard <mark@klomp.org>
598 * readelf.c (cleanup_list): New function.
599 (main): Call cleanup_list for dump_data_sections and string_sections.
601 2019-04-28 Mark Wielaard <mark@klomp.org>
603 * unstrip.c (add_new_section_symbols): Call ELF_CHECK after
605 (new_shstrtab): Call ELF_CHECK after gelf_getshdr.
607 2019-04-28 Mark Wielaard <mark@klomp.org>
609 * size.c (show_sysv): Call INTERNAL_ERROR if gelf_getshdr
611 (show_sysv_one_line): Call error with EXIT_FAILURE if
612 gelf_getshdr returns NULL.
614 2019-04-28 Mark Wielaard <mark@klomp.org>
616 * nm.c (show_symbols_sysv): Check gelf_getshdr doesn't return
617 NULL. Simplify naming of invalid sections, don't use alloca.
619 2019-04-28 Mark Wielaard <mark@klomp.org>
621 * elfcmp.c (main): Check shdr1 and shdr2 are not NULL.
623 2019-04-03 Mark Wielaard <mark@klomp.org>
625 * readelf.c (attr_callback): Print DW_AT_data_member_location as
626 decimal offset, not hex number.
628 2019-03-29 Mark Wielaard <mark@klomp.org>
630 * readelf.c (print_debug_macinfo_section): Check cus[0] is not the
633 2019-03-27 Mark Wielaard <mark@klomp.org>
635 * strip.c (handle_elf): Assert that symbol section number exists.
637 2019-01-24 Mark Wielaard <mark@klomp.org>
639 * strip.c (handle_elf): Fix check test for SHN_XINDEX symbol.
641 2019-01-22 Mark Wielaard <mark@klomp.org>
643 * readelf.c (print_debug_line_section): Check we are not at end of
644 line data when reading parameters for unknown opcodes.
646 2019-01-20 Mark Wielaard <mark@klomp.org>
648 * readelf.c (print_debug_line_section): Check terminating NUL byte
649 for dir and file tables.
651 2019-01-16 Mark Wielaard <mark@klomp.org>
653 * readelf (handle_core_note): Pass desc to ebl_core_note.
655 2018-11-10 Mark Wielaard <mark@klomp.org>
657 * elflint.c (check_program_header): Allow PT_GNU_EH_FRAME segment
658 to be matched against SHT_X86_64_UNWIND section.
660 2018-11-09 Mark Wielaard <mark@klomp.org>
662 * strip.c (remove_debug_relocations): Check if section is gnu
663 compressed and decompress and recompress it.
665 2018-11-12 Mark Wielaard <mark@klomp.org>
667 * elflint.c (check_note_data): Recognize NT_GNU_BUILD_ATTRIBUTE_OPEN
668 and NT_GNU_BUILD_ATTRIBUTE_OPEN.
669 * readelf.c (handle_notes_data): Handle
670 ELF_NOTE_GNU_BUILD_ATTRIBUTE_PREFIX. Pass nhdr.n_namesz to
673 2018-11-11 Mark Wielaard <mark@klomp.org>
675 * readelf.c (handle_notes_data): Pass n_descsz to
676 ebl_object_note_type_name.
677 * elflint.c (check_note_data): Recognize NT_VERSION, add owner
678 name to unknown note error.
680 2018-10-20 Mark Wielaard <mark@klomp.org>
682 * readelf.c (process_elf_file): Use dwelf_elf_begin to open pure_elf.
684 2018-10-26 Mark Wielaard <mark@klomp.org>
686 * strip.c (OPT_RELOC_DEBUG_ONLY): New define.
687 (options): Add reloc-debug-sections-only.
688 (reloc_debug_only): New static bool.
689 (main): Check reloc_debug_only is the only strip option used.
690 (parse_opt): Handle OPT_RELOC_DEBUG_ONLY.
691 (handle_debug_relocs): New function.
692 (handle_elf): Add local variables lastsec_offset and lastsec_size.
693 Handle reloc_debug_only.
695 2018-10-24 Mark Wielaard <mark@klomp.org>
697 * strip.c (handle_elf): Extract code to update shdrstrndx into...
698 (update_shdrstrndx): ... this new function.
700 2018-10-24 Mark Wielaard <mark@klomp.org>
702 * strip.c (handle_elf): Extract code into separate functions...
703 (secndx_name): ... new function.
704 (get_xndxdata): Likewise.
705 (remove_debug_relocations): Likewise.
707 2018-10-24 Mark Wielaard <mark@klomp.org>
709 * strip.c (handle_elf): Always copy over phdrs if there are any
710 and check phnum instead of e_type to determine whether to move
713 2018-11-02 Mark Wielaard <mark@klomp.org>
715 * unstrip.c (copy_elf): Add ELF_CHECK to make sure gelf_getehdr ()
718 2018-10-18 Mark Wielaard <mark@klomp.org>
720 * elflint.c (check_note_data): Recognize NT_GNU_PROPERTY_TYPE_0.
721 (check_note): Use p_align to pass either ELF_T_NHDR or ELF_T_NHDR8 to
722 elf_getdata_rawchunk.
723 * readelf (handle_notes): Likewise.
725 2018-10-24 Mark Wielaard <mark@klomp.org>
727 * addr2line.c (print_addrsym): Use elf_getshdrstrndx instead of
730 2018-10-24 Mark Wielaard <mark@klomp.org>
732 * readelf.c (section_name): Remove ehdr argument, lookup shstrndx.
733 (print_debug_abbrev_section): Don't pass ehdr.
734 (print_debug_addr_section): Likewise.
735 (print_decoded_aranges_section): Likewise.
736 (print_debug_aranges_section): Likewise.
737 (print_debug_rnglists_section): Likewise.
738 (print_debug_ranges_section): Likewise.
739 (print_debug_units): Likewise.
740 (print_decoded_line_section): Likewise.
741 (print_debug_line_section): Likewise.
742 (print_debug_loclists_section): Likewise.
743 (print_debug_loc_section): Likewise.
744 (print_debug_macinfo_section): Likewise.
745 (print_debug_macro_section): Likewise.
746 (print_debug_pubnames_section): Likewise.
747 (print_debug_str_section): Liekwise.
748 (print_debug_str_offsets_section): Likewise.
749 (print_gdb_index_section): Likewise.
751 2018-10-16 Mark Wielaard <mark@klomp.org>
753 * readelf.c (print_debug_frame_section): Make sure readp is never
756 2018-10-19 Mark Wielaard <mark@klomp.org>
758 * dwfl_module_getdwarf.c (adjust_relocs): Check sh_entsize is not
760 (add_new_section_symbols): Likewise.
761 (copy_elided_sections): Likewise.
763 2018-10-18 Mark Wielaard <mark@klomp.org>
765 * size.c (handle_ar): Only close elf if prefix was NULL.
767 2018-10-18 Mark Wielaard <mark@klomp.org>
769 * arlib.c (arlib_add_symbols): Check that sh_entsize is not zero.
771 2018-10-14 Mark Wielaard <mark@klomp.org>
773 * ar.c (do_oper_extract): Assume epoch if ar_date is bogus.
775 2018-10-14 Mark Wielaard <mark@klomp.org>
777 * findtextrel.c (process_file): Check that sh_entsize is not zero.
779 2018-10-13 Mark Wielaard <mark@klomp.org>
781 * readelf.c (print_debug_macro_section): Use elf_getdata. Print
784 2018-10-19 Mark Wielaard <mark@klomp.org>
786 * unstrip.c (copy_elided_sections): Renumber group section indexes.
788 2018-10-12 Mark Wielaard <mark@klomp.org>
790 * strip.c (handle_elf): Don't remove SHF_GROUP flag from sections.
791 Skip group section flag when renumbering section indexes.
792 * unstrip.c (struct section): Add sig field.
793 (compare_unalloc_sections): Take and use sig1 and sig2 as arguments.
794 (compare_sections): Pass signatures to compare_unalloc_sections.
795 (get_group_sig): New function.
796 (find_alloc_sections_prelink): Set signature.
797 (copy_elided_sections): Likewise and pass them on.
798 (find_unalloc_section): Take and pass signatures.
800 2018-10-02 Andreas Schwab <schwab@suse.de>
802 * strip.c (handle_elf): Handle ADD/SUB relocation.
804 2018-09-13 Mark Wielaard <mark@klomp.org>
806 * readelf.c (print_shdr): Get number of section with elf_getshdrnum.
807 (print_phdr): Likewise.
809 2018-09-13 Mark Wielaard <mark@klomp.org>
811 * strip.c (handle_elf): Check against shstrndx, not e_shstrndx.
812 Explicitly set shdrstrndx for debug file.
813 * unstrip.c (copy_elf): Explicitly copy shstrndx.
814 (find_alloc_sections_prelink): Document shnum usage.
816 2018-09-13 Mark Wielaard <mark@klomp.org>
818 * elflint.c (check_elf_header): Use shnum instead of e_shnum for all
820 (check_symtab): Use shstrndx instead of e_shstrndx to get section
823 2018-09-13 Mark Wielaard <mark@klomp.org>
825 * elfcmp.c (main): Get, check and shdrstrndx for section names.
827 2018-09-12 Mark Wielaard <mark@klomp.org>
829 * elfcmp.c (main): Call ebl_section_strip_p without ehdr.
830 * strip.c (handle_elf): Likewise.
832 2018-09-12 Mark Wielaard <mark@klomp.org>
834 * elflint.c (check_symtab): Call ebl_check_special_symbol without
837 2018-07-30 Mark Wielaard <mark@klomp.org>
839 * strip.c (handle_elf): Track allocated/unallocated sections seen. Set
840 section offset of unallocated sections after handling all allocated
843 2018-08-18 Mark Wielaard <mark@klomp.org>
845 * readelf.c (print_debug_aranges_section): Make sure there is enough
846 data to read the header segment size.
848 2018-08-18 Mark Wielaard <mark@klomp.org>
850 * elflint.c (check_sysv_hash): Calculate needed size using unsigned
851 long long int to prevent overflow.
852 (check_sysv_hash64): Calculate maxwords used separately before
853 comparison to prevent overflow.
855 2018-07-24 Mark Wielaard <mark@klomp.org>
857 * unstrip.c (compare_unalloc_sections): Also compare sh_size.
859 2018-07-21 Mark Wielaard <mark@klomp.org>
861 * unstrip.c (adjust_all_relocs): Skip SHT_GROUP sections.
863 2018-07-21 Mark Wielaard <mark@klomp.org>
865 * elfcompress.c (get_sections): New function.
866 (process_file): Check whether section needs to change. Don't rewrite
867 file if no section data needs changing.
868 (main): Update 'force' help text.
870 2018-07-21 Mark Wielaard <mark@klomp.org>
872 * elfcompress.c (process_file): Swap fchmod and fchown calls.
874 2018-07-04 Mark Wielaard <mark@klomp.org>
876 * readelf.c (print_debug_addr_section): Rename index var to uidx.
877 (attr_callback): Rename index var to word.
878 (print_debug_str_offsets_section): Rename index var to uidx.
880 2018-07-04 Ross Burton <ross.burton@intel.com>
882 * addr2line.c: Remove error.h include.
884 * arlib.c: Likewise and add system.h include.
885 * arlib2.c: Likewise.
886 * elfcmp.c: Likewise.
887 * elfcompress.c: Likewise.
888 * elflint.c: Likewise.
889 * findtextrel.c: Likewise.
891 * objdump.c: Likewise.
892 * ranlib.c: Likewise.
893 * readelf.c: Likewise.
895 * strings.c: Likewise.
897 * unstrip.c: Likewise.
899 2018-06-25 Mark Wielaard <mark@klomp.org>
901 * readelf.c (print_decoded_line_section): Use dwarf_next_lines
902 instead of dwarf_nextcu.
903 (print_debug_line_section): Don't explicitly lookup CU.
905 2018-06-15 Mark Wielaard <mark@klomp.org>
907 * readelf.c (attr_callback): Only print block as expressions if it
908 isn't DW_FORM_data16.
910 2018-06-12 Mark Wielaard <mark@klomp.org>
912 * readelf.c (print_form_data): Check we have 4, not 2, bytes
913 available for DW_FORM_block4.
915 2018-06-12 Mark Wielaard <mark@klomp.org>
917 * readelf.c (print_form_data): Don't increase strreadp after use.
918 Do increase readp for DW_FORM_strx[1234].
920 2018-06-16 Mark Wielaard <mark@klomp.org>
922 * readelf.c (print_debug_loc_section): Make sure next_off doesn't
925 2018-06-13 Mark Wielaard <mark@klomp.org>
927 * readelf.c (die_type_sign_bytes): New function.
928 (attr_callback): Recognized DW_FORM_implicit_cost as signed. Use
929 die_type_sign_bytes to lookup the signedness and size of const
932 2018-06-11 Mark Wielaard <mark@klomp.org>
934 * readelf.c (print_form_data): Don't reuse readp and readendp when
935 reading str_offsets section.
937 2018-06-10 Mark Wielaard <mark@klomp.org>
939 * readelf.c (print_form_data): Don't cast value to ptrdiff_t, cast
942 2018-06-08 Mark Wielaard <mark@klomp.org>
944 * readelf.c (print_debug_rnglists_section): Calculate max_entries
945 instead of needed bytes to prevent overflowing. Always print
946 max_entries (but not more).
947 (print_debug_loclists_section): Likewise.
949 2018-06-08 Mark Wielaard <mark@klomp.org>
951 * readelf.c (print_debug_line_section): Stop printing directories
952 and files when we are at the end of the unit data.
954 2018-06-07 Mark Wielaard <mark@klomp.org>
956 * readelf.c (format_result): Removed.
957 (format_result_size): Removed.
958 (format_dwarf_addr): Renamed to...
959 (print_dwarf_addr): ...this. Simply call printf, don't setup buffer,
961 (print_ops): Use print_dwarf_addr instead of format_dwarf_addr.
962 (print_debug_addr_section): Likewise.
963 (print_debug_aranges_section): Likewise.
964 (print_debug_rnglists_section): Likewise.
965 (print_debug_ranges_section): Likewise.
966 (print_debug_frame_section): Likewise.
967 (attr_callback): Likewise.
968 (print_decoded_line_section): Likewise.
969 (print_debug_line_section): Likewise.
970 (print_debug_loclists_section): Likewise.
971 (print_debug_loc_section): Likewise.
972 (print_gdb_index_section): Likewsie.
974 2018-06-05 Mark Wielaard <mark@klomp.org>
976 * readelf.c (print_debug_addr_section): Set unit_length always to
977 (next_unitp - readp) in case we don't have a real header.
979 2018-06-05 Mark Wielaard <mark@klomp.org>
981 * readelf.c (print_debug_loc_section): Set begin to idx when failing
982 to read the start address if DW_LLE_GNU_start_end_entry.
984 2018-06-05 Mark Wielaard <mark@klomp.org>
986 * readelf.c (handle_sysv_hash): Don't leak lengths array when
987 detecting an invalid chain.
988 (handle_sysv_hash64): Likewise.
990 2018-06-05 Mark Wielaard <mark@klomp.org>
992 * readelf.c (print_debug_macro_section): Extend vendor array by one
993 to include max DW_MACRO_hi_user opcode.
995 2018-06-07 Mark Wielaard <mark@klomp.org>
997 * readelf.c (main): Lookup "no" for no_str.
998 (print_debug_abbrev_section): Use yes_str and no_str.
999 (print_form_data): Likewise.
1001 2018-06-04 Mark Wielaard <mark@klomp.org>
1003 * readelf (format_result): New static char pointer.
1004 (format_result_size): New static size_t.
1005 (format_dwarf_addr): Calculate max string size, reuse format_result
1006 if possible, otherwise realloc. Use sprintf on result, not asprintf.
1007 (print_ops): Don't free format_dwarf_addr, make sure result is
1008 printed before calling format_dwarf_addr again.
1009 (print_debug_addr_section): Likewise.
1010 (print_debug_aranges_section): Likewise.
1011 (print_debug_rnglists_section): Likewise.
1012 (print_debug_ranges_section): Likewise.
1013 (print_debug_frame_section): Likewise.
1014 (attr_callback): Likewise.
1015 (print_decoded_line_section): Likewise.
1016 (print_debug_line_section): Likewise.
1017 (print_debug_loclists_section): Likewise.
1018 (print_debug_loc_section): Likewise.
1019 (print_gdb_index_section): Likewsie.
1021 2018-06-04 Mark Wielaard <mark@klomp.org>
1023 * readelf.c (yes_str): New static char pointer.
1025 (main): Set yes_str and no_str using gettext.
1026 (attr_callback): Use yes_str and no_str instead of calling gettext.
1028 2018-06-04 Mark Wielaard <mark@klomp.org>
1030 * readelf.c (main): Call __fsetlocking (stdout, FSETLOCKING_BYCALLER).
1032 2018-05-31 Mark Wielaard <mark@klomp.org>
1034 * readelf.c (print_debug_units): Print the dwo name and id when
1035 unable to find a .dwo file.
1037 2018-05-31 Mark Wielaard <mark@klomp.org>
1039 * readelf.c (enum section_e): Make section_types not an alias of
1041 (section_all): Add section_types.
1042 (parse_opt): Add both section_info and section_types for "info"
1044 (print_debug_units): Don't be silent for debug_types.
1046 2018-05-31 Mark Wielaard <mark@klomp.org>
1048 * readelf.c (attr_callback): Only register section_loc when not
1049 looking at a split dwarf from a skeleton.
1051 2018-05-30 Mark Wielaard <mark@klomp.org>
1053 * readelf.c (print_debug_loc_section): Use correct listptr for
1056 2018-05-31 Mark Wielaard <mark@klomp.org>
1058 * readelf.c (print_debug_units): Check offset against -1 not ~0ul.
1060 2018-05-29 Mark Wielaard <mark@klomp.org>
1062 * readelf.c (print_debug_loc_section): Handle GNU DebugFission list
1065 2018-05-29 Mark Wielaard <mark@klomp.org>
1067 * readelf.c (print_debug): Record and reset section_info status in
1068 implicit_debug_sections and print_debug_sections.
1070 2018-05-28 Mark Wielaard <mark@klomp.org>
1072 * readelf.c (print_debug_units): Turn "Could not find split compile
1073 unit" into an Warning instead of an error.
1075 2018-04-29 Mark Wielaard <mark@klomp.org>
1077 * readelf.c (parse_opt): Request implicit section_info for "str".
1078 (known_stroffbases): New static variable.
1079 (attr_callbackattr_callback): Handle DW_AT_str_offets_base.
1080 (print_debug_str_offsets_section): New function.
1081 (print_debug): Handle .debug_str_offsets as section_str. Reset
1084 2018-04-27 Mark Wielaard <mark@klomp.org>
1086 * readelf.c (options): Add addr.
1087 (enum section_e): Add section_addr.
1088 (section_all): Add section_addr.
1089 (parse_opt): Parse "addr".
1090 (known_addrbases): New static variable.
1091 (get_listptr): New function.
1092 (print_debug_addr_section): Likewise.
1093 (attr_callback): Handle DW_AT_addr_base and DW_AT_GNU_addr_base.
1094 (print_debug): Add NEW_SECTION (addr). Reset known_addrbases.
1096 2018-04-07 Mark Wielaard <mark@klomp.org>
1098 * readelf.c (attr_callback): Handle DW_FORM_loclistx and
1101 2018-04-12 Mark Wielaard <mark@klomp.org>
1103 * readelf.c (dwarf_loc_list_encoding_string): New functions.
1104 (dwarf_loc_list_encoding_name): Likewise.
1105 (known_loclistptr): Renamed and split in two...
1106 (known_locsptr): this and ...
1107 (known_loclistsptr): this.
1108 (listptr_base): Split out...
1109 (cudie_base): ...this.
1110 (is_split_dwarf): New function.
1111 (attr_callback): Handle DW_AT_loclists_base and notice sec_offset
1113 (print_debug_rnglists_section): Use spit_dwarf_cu_base.
1114 (print_debug_loclists_section): New function.
1115 (print_debug_loc_section): Use known_locsptr instead of
1117 (print_debug): Recognize .debug_loclists. Reset known_locsptr and
1120 2018-05-25 Mark Wielaard <mark@klomp.org>
1122 * readelf.c (DWARF_SKELETON): New constant.
1123 (do_not_close_dwfl): New bool.
1124 (options): Add dwarf-skeleton.
1125 (dwarf_skeleton): New static variable.
1126 (parse_opt): Handle DWARF_SKELETON, set dwarf_skeleton.
1127 (create_dwfl): New function, with code extracted from...
1128 (process_file): ...here. Check do_not_close_dwfl.
1129 (is_split_darf): New function.
1130 (getone_dwflmod): Likewise.
1131 (print_debug): Use new functions to find skeleton DWARF file to use
1132 when inspecting .dwo split DWARF file.
1134 2018-04-11 Mark Wielaard <mark@klomp.org>
1136 * readelf.c (dwarf_range_list_encoding_string): New function.
1137 (dwarf_range_list_encoding_name): Likewise.
1138 (known_rnglistptr): New static variable.
1139 (listptr_cu): New function.
1140 (print_debug_rnglists_section): Likewise.
1141 (attr_callback): Call notice_listptr for DW_AT_ranges. Handle
1142 DW_AT_rnglists_base. Handle DW_FORM_rnglistx. DW_AT_start_scope
1143 can also have a rnglist.
1144 (print_debug_units): Do (silently) scan split DWARF also for
1145 debug_ranges before DWARF5 to catch all rangelistptrs.
1146 (print_debug): Recognize .debug_rnglists. Reset known_rnglistptr.
1148 2018-01-21 Mark Wielaard <mark@klomp.org>
1150 * readelf.c (get_indexed_addr): New function.
1151 (print_ops): Handle DW_OP_addrx, DW_OP_GNU_addr_index,
1152 DW_OP_constx, DW_OP_GNU_const_index separately and resolve
1154 (attr_callback): Print index and address for
1155 DW_FORM_GNU_addr_index and DW_FORM_addrx[1234].
1157 2018-01-19 Mark Wielaard <mark@klomp.org>
1159 * readelf.c (options): Add info+.
1160 (show_split_units): New static boolean defaulting to false.
1161 (parse_opt): For all (no arg) --debug-dump set show_split_units
1162 to yes. For "info+" enable section_info and show_split_units.
1163 (attrcb_args): Add is_split field.
1164 (attr_callback): Use is_split to format DIE offsets differently.
1165 (print_debug_units): Likewise. Get subdie (type or split) only
1166 when needed. When not silent reiterate over split DIEs when
1169 2018-05-15 Mark Wielaard <mark@klomp.org>
1171 * readelf.c (print_debug_units): Print unit type and id for any
1172 unit type that has it even when version < 5.
1174 2018-05-14 Mark Wielaard <mark@klomp.org>
1176 * readelf.c (print_ops): Handle DW_OP_GNU_addr_index and
1177 DW_OP_GNU_const_index.
1178 (attr_callback): Handle DW_FORM_GNU_addr_index as DW_FORM_addrx.
1179 Handle DW_FORM_GNU_str_index as DW_FORM_constx. Add as_hex_id.
1180 Handle DW_AT_GNU_dwo_id as_hex_id.
1181 (print_form_data): Handle DW_FORM_GNU_str_index as DW_FORM_strx.
1183 2018-05-12 Mark Wielaard <mark@klomp.org>
1185 * readelf.c (print_debug): Also recognize .dwo section name variants.
1187 2018-05-15 Dmitry V. Levin <ldv@altlinux.org>
1189 * elflint.c (check_elf_header): Fix typo in error diagnostics.
1191 2018-05-15 Mark Wielaard <mark@klomp.org>
1193 * readelf.c (print_form_data): Cast comparisons against offset_len to
1195 (print_debug_line_section): Print uint64_t as PRIu64.
1197 2018-05-11 Mark Wielaard <mark@klomp.org>
1199 * readelf.c (print_debug_macro_section): Use libdw_valid_user_form.
1200 Use print_form_data for strx and sup strings.
1202 2018-05-09 Mark Wielaard <mark@klomp.org>
1204 * readelf.c (dwarf_line_content_description_string): New function.
1205 (dwarf_line_content_description_name): Likewise.
1206 (print_bytes): Likewise.
1207 (print_form_data): Likewise. Based on code taken from...
1208 (print_debug_macro_section): ...here. Now calls print_form_data
1209 and str_offsets_base_off.
1210 (print_debug_line_section): Parse DWARF5 header, directory and file
1213 2018-05-12 Mark Wielaard <mark@klomp.org>
1215 * addr2line.c (main): Add fflush (stdout) after handle_address ()
1216 when reading from stdin.
1218 2018-04-24 Mark Wielaard <mark@klomp.org>
1220 * readelf.c (print_debug_aranges_section): Try elf_rawdata if no
1222 (print_debug_ranges_section): Likewise.
1223 (print_debug_frame_section): Likewise.
1224 (print_debug_line_section): Likewise. Check for data == NULL.
1225 (print_debug_loc_section): Likewise.
1226 (print_debug_macinfo_section): Likewise.
1227 (print_debug_macro_section): Likewise.
1229 2018-04-28 Mark Wielaard <mark@klomp.org>
1231 * readelf.c (print_debug): If .debug_info is needed implicitly by
1232 then handle it first before handling any other debug section.
1233 (parse_opt): Set implicit_debug_sections to section_info when
1234 showing all debug sections.
1236 2018-05-05 Mark Wielaard <mark@klomp.org>
1238 * readelf.c (attr_callback): Handle DW_FORM_ref_sup4 and
1239 DW_FORM_ref_sup8 as references.
1241 2018-04-24 Mark Wielaard <mark@klomp.org>
1243 * readelf.c (print_debug_str_section): Take raw section data. Don't
1244 use dwarf_getstring, but determine start and end of string from
1245 offset and section data directly.
1246 (print_debug): Handle ".debug_line_str" like ".debug_str".
1248 2018-04-19 Andreas Schwab <schwab@suse.de>
1250 * elflint.c (valid_e_machine): Add EM_RISCV.
1252 2018-04-16 Mark Wielaard <mark@klomp.org>
1254 * readelf.c (print_debug_line_section). In advance_pc, advance
1255 using op_addr_advance, not op_advance.
1257 2018-04-14 Mark Wielaard <mark@klomp.org>
1259 * readelf.c (attr_callback): Only show errors when not silent.
1261 2018-03-23 Mark Wielaard <mark@klomp.org>
1263 * readelf.c (attr_callback): Handle DW_FORM_strx[1234].
1265 2018-03-22 Mark Wielaard <mark@klomp.org>
1267 * readelf.c (attr_callback): Handle DW_FORM_addrx[1234].
1269 2018-03-28 Mark Wielaard <mark@klomp.org>
1271 * readelf.c (handle_sysv_hash): Break bucket chain after nchain
1273 (handle_sysv_hash64): Likewise.
1275 2018-03-27 Mark Wielaard <mark@klomp.org>
1277 * readelf.c (attr_callback): Print dwarf_dieoffset as %PRIx64,
1280 2018-03-20 Mark Wielaard <mark@klomp.org>
1282 * readelf.c (attr_callback): Report error when DW_AT_decl_file or
1283 DW_AT_call_file cannot be resolved.
1285 2018-03-06 Mark Wielaard <mark@klomp.org>
1287 * readelf.c (print_ops): Handle DW_OP_addrx, DW_OP_constx,
1288 DW_OP_implicit_pointer, DW_OP_entry_value, DW_OP_const_type,
1289 DW_OP_regval_type, DW_OP_deref_type, DW_OP_xderef_type,
1290 DW_OP_convert, DW_OP_reinterpret.
1292 2018-03-01 Mark Wielaard <mark@klomp.org>
1294 * readelf.c (struct listptr): Add attr field.
1295 (compare_listptr): Warn when two listptrs for the same offset have
1296 different attributes.
1297 (notice_listptr): Take attr as argument and add it to listptr.
1298 (skip_listptr_hole): New attr argument.
1299 (next_listptr_offset): New function.
1300 (print_debug_ranges_section): Pass NULL attr to skip_listptr_hole.
1301 (attr_callback): Handle DW_AT_GNU_locviews. Call notice_listptr with
1303 (print_debug_loc_section): Keep track of which attr is associated with
1304 a listptr. If the attr is DW_AT_GNU_locview print view pairs till the
1305 next listptr offset.
1307 2018-02-09 Mark Wielaard <mark@klomp.org>
1309 * elflint.c (check_group): Make sure we can read a complete
1310 element when iterating over the group.
1312 2018-02-09 Mark Wielaard <mark@klomp.org>
1314 * readelf.c (attr_callback): Handle DW_FORM_data16 as Dwarf_Block.
1316 2018-02-09 Mark Wielaard <mark@klomp.org>
1318 * readelf.c (print_debug_abbrev_section): Print the value of a
1319 DW_FORM_implicit_const using dwarf_getabbrevattr_data.
1320 (attr_callback): Handle DW_FORM_implicit_const.
1322 2018-01-30 Mark Wielaard <mark@klomp.org>
1324 * readelf.c (dwarf_unit_string): New function.
1325 (dwarf_unit_name): Likewise.
1326 (print_debug_units): Use dwarf_get_units and dwarf_cu_die instead
1327 of dwarf_next_unit. Print unit type, id and subdie if available.
1329 2018-02-09 Joshua Watt <JPEWhacker@gmail.com>
1331 * addr2line.c (handle_address): Use FALLTHROUGH macro instead of
1333 * elfcompress.c (parse_opt): Likewise.
1334 * elflint.c (check_dynamic): Likewise.
1335 (check_sections): Likewise.
1336 (check_note_data): Likewise.
1337 * objdump.c (parse_opt): Likewise.
1338 * readelf.c (parse_opt): Likewise.
1339 (attr_callback): Likewise.
1340 (handle_auxv_note): Likewise.
1341 * strings.c (parse_opt): Likewise.
1342 * backtrace.c (callback_verify): Likewise.
1344 2018-01-25 Mark Wielaard <mark@klomp.org>
1346 * readelf.c (print_debug_ranges_section): Initialize cu to last_cu.
1347 (print_debug_loc_section): Likewise.
1349 2018-01-01 Mark Wielaard <mark@klomp.org>
1351 * readelf.c (attr_callback): Use dwarf_form_name for unknown forms.
1352 (print_debug_macro_section): Print form using dwarf_form_name.
1354 2017-12-28 Mark Wielaard <mark@klomp.org>
1356 * readelf.c (print_debug_units): Print DIE offset in error message
1359 2017-12-18 Mark Wielaard <mark@klomp.org>
1361 * readelf.c (handle_notes_data): Don't use EXIT_FAILURE in error.
1362 Adjust error message depending on whether or not we got data.
1364 2017-12-07 Mark Wielaard <mark@klomp.org>
1366 * readelf.c (print_ops): Update data pointer and print arguments
1367 to DW_OP_call2 and DW_OP_call4 as DIE offsets.
1369 2017-11-29 Mark Wielaard <mark@klomp.org>
1371 * readelf.c (argp_options): Add "section-groups", 'g'.
1373 2017-11-29 Mark Wielaard <mark@klomp.org>
1375 * readelf.c (print_debug_loc_section): Print CU base and unresolved
1376 addresses. Adjust formatting.
1378 2017-11-29 Mark Wielaard <mark@klomp.org>
1380 * readelf.c (print_debug_ranges_section): Print CU base and unresolved
1381 addresses. Adjust formatting.
1383 2017-11-29 Mark Wielaard <mark@klomp.org>
1385 * readelf.c (attr_callback): Set valuestr to resolved file name
1386 for DW_AT_decl_file and DW_AT_call_file.
1388 2017-11-29 Mark Wielaard <mark@klomp.org>
1390 * readelf.c (print_debug_units): Print abbrev code after DIE tag.
1392 2017-11-29 Mark Wielaard <mark@klomp.org>
1394 * readelf.c (print_ops): Use only2 space for index. re-indent +5
1395 for DW_OP_GNU_entry_value.
1397 2017-11-21 Mark Wielaard <mark@klomp.org>
1399 * readelf.c (attr_callback): Print attribute name and form in error
1400 message. If only the value cannot be retrieved/resolved don't abort.
1402 2017-10-03 Mark Wielaard <mark@klomp.org>
1404 * readelf.c (attr_callback): Print DIE offset in error messages.
1406 2017-11-03 Mark Wielaard <mark@klomp.org>
1408 * readelf.c (print_ops): Handle DW_OP_GNU_variable_value. Print
1409 referenced DIE as offset.
1411 2017-09-10 Mark Wielaard <mark@klomp.org>
1413 * ar.c (do_oper_delete): Remove DEBUG conditional check.
1414 (no0print): Return bool. Check snprintf return value.
1415 (do_oper_insert): Initialize elf. Remove DEBUG conditional check.
1416 Check no0print calls succeed. Explicitly elf_end found elfs.
1417 (do_oper_extract): Make sure we don't create an empty variable
1420 2017-09-01 Mark Wielaard <mark@klomp.org>
1422 * stack.c (main): Replace \v in doc string with \n\n.
1423 * unstrip.c (main): Likewise.
1425 2017-05-04 Ulf Hermann <ulf.hermann@qt.io>
1427 * stack.c: Print pid_t using %lld.
1429 2017-08-18 Ulf Hermann <ulf.hermann@qt.io>
1431 * readelf.c: Hardcode the signal numbers for non-linux systems.
1433 2017-07-26 Mark Wielaard <mark@klomp.org>
1435 * readelf.c (print_debug_macro_section): Accept either version 4 or
1436 version 5. Use DW_MACRO names instead of DW_MACRO_GNU names. Add
1437 minimal support for DW_MACRO_define_sup, DW_MACRO_undef_sup,
1438 DW_MACRO_import_sup, DW_MACRO_define_strx and DW_MACRO_undef_strx.
1440 2017-07-26 Mark Wielaard <mark@klomp.org>
1442 * readelf.c (dwarf_defaulted_string): New function.
1443 (dwarf_defaulted_name): Likewise.
1444 (attr_callback): Use dwarf_defaulted_name to get value of
1447 2017-07-20 Mark Wielaard <mark@klomp.org>
1449 * strip.c (handle_elf): Deal with data marker symbols pointing to
1450 debug sections (they can be removed).
1452 2017-07-14 Mark Wielaard <mark@klomp.org>
1454 * strip (OPT_KEEP_SECTION): New define.
1455 (options): Add documentation for remove-section. Add keep-section.
1456 (struct section_pattern): New data type.
1457 (keep_secs, remove_secs): New globals.
1458 (add_pattern, free_sec_patterns, free_patterns, section_name_matches):
1460 (main): Call free_patterns.
1461 (parse_opt): Handle 'R' and OPT_KEEP_SECTION. Check remove_comment
1462 on ARGP_KEY_SUCCESS.
1463 (handle_elf): Handle and sanity check keep_secs and remove_secs.
1465 2017-06-07 Mark Wielaard <mark@klomp.org>
1467 * strip.c (handle_elf): Introduce new handle_elf boolean. Use it to
1468 determine whether to create an output and/or debug file. Remove new
1469 output file on error.
1471 2017-06-06 Mark Wielaard <mark@klomp.org>
1473 * strip.c (handle_elf): Assume e_shstrndx section can be removed.
1475 2017-04-20 Ulf Hermann <ulf.hermann@qt.io>
1477 * readelf.c: Include strings.h.
1479 2017-04-20 Ulf Hermann <ulf.hermann@qt.io>
1481 * unstrip.c: Check shnum for 0 before subtracting from it.
1483 2017-04-20 Ulf Hermann <ulf.hermann@qt.io>
1485 * readelf.c: Replace YESSTR and NOSTR with gettext ("yes") and
1486 gettext ("no"), respectively.
1488 2017-04-05 Mark Wielaard <mark@klomp.org>
1490 * elflint.c (check_elf_header): Decompress all sections.
1492 2017-03-28 Mark Wielaard <mark@klomp.org>
1494 * elflint (check_group): Don't check if there is no flag word.
1496 2017-03-27 Mark Wielaard <mark@klomp.org>
1498 * elflint.c (check_elf_header): Sanity check phnum and shnum.
1500 2017-03-27 Mark Wielaard <mark@klomp.org>
1502 * elflint.c (check_sysv_hash): Return early if section size is
1504 (check_sysv_hash64): Likewise.
1505 (check_hash): Calculate expect_entsize to check section size.
1507 2017-03-27 Mark Wielaard <mark@klomp.org>
1509 * elflint.c (check_symtab_shndx): Check data->d_size.
1511 2017-03-24 Mark Wielaard <mjw@redhat.com>
1513 * elfcmp.c (main): If n_namesz == 0 then the note name data is the
1515 * readelf.c (handle_notes_data): Likewise.
1517 2017-03-24 Mark Wielaard <mjw@redhat.com>
1519 * readelf.c (handle_gnu_hash): Check inner < max_nsyms before
1520 indexing into chain array.
1522 2017-02-16 Ulf Hermann <ulf.hermann@qt.io>
1524 * addr2line.c: Include printversion.h
1526 * elflint.c: Likewise.
1528 * objdump.c: Likewise.
1529 * ranlib.c: Likewise.
1530 * readelf.c: Likewise.
1532 * stack.c: Likewise.
1533 * strings.c: Likewise.
1534 * strip.c: Likewise.
1535 * elfcmp.c: Include printversion.h, remove system.h include.
1536 * elfcompress.c: Likewise.
1537 * findtextrel.c: Likewise.
1538 * unstrip.c: Likewise.
1540 2017-02-14 Ulf Hermann <ulf.hermann@qt.io>
1542 * nm.c: Include color.h.
1543 * objdump.c: Likewise.
1545 2016-12-24 Mark Wielaard <mark@klomp.org>
1547 * Makefile.am (findtextrel_LDADD): Add $(libeu).
1548 (addr2line_LDADD): Likewise.
1549 (elfcmp_LDADD): Likewise.
1550 * addr2line.c (print_version): Removed.
1551 * ar.c (print_version): Likewise.
1552 * elfcmp.c (print_version): Likewise.
1553 * elfcompress.c (print_version): Likewise.
1554 * elflint.c (print_version): Likewise.
1555 * findtextrel.c (print_version): Likewise.
1556 * nm.c (print_version): Likewise.
1557 * objdump.c: Likewise.
1558 * ranlib.c: Likewise.
1559 * readelf.c: Likewise.
1561 * stack.c: Likewise.
1562 * strings.c: Likewise.
1563 * strip.c: Likewise.
1564 * unstrip.c: Likewise.
1566 2016-11-17 Mark Wielaard <mjw@redhat.com>
1568 * readelf.c (options): Add optional arg SECTION for symbols.
1569 (symbol_table_section): New static variable.
1570 (parse_opt): Set symbol_table_section on 's'.
1571 (print_symtab): Filter on symbol_table_section name is set.
1573 2016-11-10 Mark Wielaard <mjw@redhat.com>
1575 * ar.c (write_member): Make sure tmpbuf is large enough to contain
1576 a starting '/' and ending '\0' char.
1577 (do_oper_insert): Likewise.
1578 * arlib.c (arlib_finalize): Format tmpbuf as PRId32 decimal.
1580 2016-11-02 Mark Wielaard <mjw@redhat.com>
1582 * addr2line.c (handle_address): Add fallthrough comment.
1583 * elfcompress.c (parse_opt): Adjust fallthrough comment.
1584 * elflint.c (parse_opt): Add missing break after 'd' case.
1585 (check_sections): Add fallthrough comments.
1586 * objdump.c (parse_opt): Add explantion for fallthrough comment.
1588 2016-10-22 Kevin Cernekee <cernekee@chromium.org>
1590 * unstrip.c: Fix "invalid string offset" error caused by using the
1591 unstripped .symtab with the stripped .strtab.
1593 2016-10-11 Akihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>
1595 * arlib.c: Remove system.h include, add libeu.h include.
1596 * arlib2.c: Remove sys/param.h include.
1597 * elfcompress.c: Add libeu.h include.
1598 * elflint.c: Remove sys/param.h include, add libeu.h include.
1600 * objdump.c: Likewise.
1601 * ranlib.c: Likewise.
1602 * readelf.c: Likewise.
1603 * size.c: Remove sys/param.h include.
1604 * strings.c: Likewise, add libeu.h include.
1605 * strip.c: Likewise.
1606 * unstrip.c: Likewise.
1608 2016-10-06 Mark Wielaard <mjw@redhat.com>
1610 * strip.c (handle_elf): Don't remove real symbols from allocated
1613 2016-08-25 Mark Wielaard <mjw@redhat.com>
1615 * strip.c (handle_elf): Recompress with ELF_CHF_FORCE.
1617 2016-08-06 Mark Wielaard <mjw@redhat.com>
1619 * strip.c (handle_elf): Uncompress and recompress relocation target
1620 section if necessary.
1622 2016-07-08 Mark Wielaard <mjw@redhat.com>
1624 * Makefile.am (strip_LDADD): Add libdw.
1625 * elfcompress.c (process_file): Use dwelf_strtab functions instead of
1627 * strip.c (handle_elf): Likewise.
1628 * unstrip.c (new_shstrtab): Likewise.
1630 2016-07-06 Mark Wielaard <mjw@redhat.com>
1632 * elf32-i386.script, i386_ld.c, ld.c, ld.h, ldgeneric.c, ldlex.l,
1633 ldscript.y, libld_elf_i386.map, none_ld.c, sectionhash.c,
1634 sectionhash.h, symbolhash.c, symbolhash.h, unaligned.h,
1635 versionhash.c, versionhash.h, xelf.h: Removed.
1636 * Makefile.am (YACC): Removed.
1637 (AM_YFLAGS): Removed.
1638 (AM_LFLAGS): Removed.
1639 (native_ld): Removed.
1640 (base_cpu): Removed.
1641 (bin_PROGRAMS): Removed ld.
1643 (ld_SOURCES): Removed.
1644 (noinst_LIBRARIES): Only libar.a.
1645 (EXTRA_DIST): Just arlib.h and debugpred.h.
1646 (ld_LDADD): Removed.
1647 (ld_LDFLAGS): Removed.
1649 (ldscript.h): Removed.
1651 (CLEANFILES): Just *.gconv.
1652 (MAINTAINERCLEANFILES): Removed.
1654 2016-07-06 Mark Wielaard <mjw@redhat.com>
1656 * unstrip.c (copy_elided_sections): Use unstripped_strent[] from
1657 index zero, instead of one.
1659 2016-06-28 Richard Henderson <rth@redhat.com>
1661 * elflint.c (valid_e_machine): Add EM_BPF.
1663 2016-04-11 David Abdurachmanov <davidlt@cern.ch>
1665 * elfcmp.c (main): Fix self-comparison error with GCC 6.
1667 2016-03-21 Mark Wielaard <mjw@redhat.com>
1669 * nm.c (show_symbols): Check for malloc size argument overflow.
1671 2016-02-13 Mark Wielaard <mjw@redhat.com>
1673 * readelf.c (print_scngrp): Call error when gelf_getshdr fails.
1674 (print_symtab): Likewise.
1675 (handle_hash): Likewise.
1676 (dump_data_section): Print a warning if decompressing fails.
1677 (print_string_section): Likewise.
1679 2016-02-13 Mark Wielaard <mjw@redhat.com>
1681 * elfcompress.c (parse_opt): Don't fallthrough after processing -q.
1683 2016-02-12 Mark Wielaard <mjw@redhat.com>
1685 * strip.c (handle_elf): Correct elf_assert shndxdata check.
1687 2016-02-09 Mark Wielaard <mjw@redhat.com>
1689 * readelf.c (read_encoded): Move up.
1690 (print_cfa_program): Add encoding argument. Use it for read_encoded
1691 when reading DW_CFA_set_loc op.
1692 (print_debug_frame_section): Pass fde_encoding to print_cfa_program.
1694 2016-02-09 Mark Wielaard <mjw@redhat.com>
1696 * elflint.c (compare_hash_gnu_hash): Check hash sh_entsize against
1697 sizeof (Elf64_Xword). Correct invalid sh_entsize error message
1698 section idx and name.
1700 2016-01-13 Mark Wielaard <mjw@redhat.com>
1702 * elflint.c (check_elf_header): Recognize ELFOSABI_FREEBSD.
1704 2016-01-08 Mark Wielaard <mjw@redhat.com>
1706 * elfcompress.c (compress_section): Use %zu to print size_t.
1707 * readelf.c (print_shdr): Use %zx to print size_t.
1709 2015-12-16 Mark Wielaard <mjw@redhat.com>
1711 * elfcompress.c: New file.
1712 * Makefile.am (bin_PROGRAMS): Add elfcompress.
1713 (elfcompress_LDADD): New variable.
1715 2015-12-18 Mark Wielaard <mjw@redhat.com>
1717 * elflint.c (section_flags_string): Add NEWFLAG COMPRESSED.
1718 (check_sections): SHF_COMPRESSED can be on any special section.
1719 SHF_COMPRESSED is a valid section flag. SHF_COMPRESSED cannot
1720 be used together with SHF_ALLOC or with SHT_NOBITS. Should have
1723 2015-10-20 Mark Wielaard <mjw@redhat.com>
1725 * readelf.c (options): Expand -z help text.
1726 (dump_data_section): Check whether we need and can decompress section
1727 data and call elf_rawzdata if so,
1728 (print_string_section): Likewise.
1729 (elf_contains_chdrs): New function.
1730 (process_elf_file): Rename print_unrelocated to print_unchanged,
1731 use elf_contains_chdrs.
1732 (print_scngrp): Check whether section is compressed before use.
1733 (print_symtab): Likewise.
1734 (handle_hash): Likewise.
1736 2015-10-16 Mark Wielaard <mjw@redhat.com>
1738 * readelf.c (argp_option): Describe --decompress,-z.
1739 (print_decompress): New bool.
1740 (parse_opt): Handle -z.
1741 (elf_ch_type_name): New function.
1742 (print_shdr): Print section compress information.
1744 2015-12-31 Mark Wielaard <mjw@redhat.com>
1746 * elflint.c (check_symtab): Add _edata and _end (plus extra underscore
1747 variants) to to the list of possibly dangling symbols.
1749 2015-12-02 Mark Wielaard <mjw@redhat.com>
1751 * nm.c (process_file): Accept fd and pass it on.
1752 (handle_elf): Likewise.
1753 (find_no_debuginfo): New.
1754 (struct getdbg): Likewise.
1755 (getdbg_dwflmod): Likewise.
1756 (show_symbols): Take fd. If the file is ET_REL use libdwfl to get
1757 the relocated Dwarf.
1759 2015-12-02 Mark Wielaard <mjw@redhat.com>
1761 * nm.c (get_local_names): Check for duplicates in local_root tree.
1763 2015-12-02 Mark Wielaard <mjw@redhat.com>
1765 * unstrip.c (struct data_list): New.
1766 (new_data_list): Likewise.
1767 (record_new_data): Likewise.
1768 (free_new_data): Likewise.
1769 (adjust_relocs): Call record_new_data.
1770 (add_new_section_symbols): Likewise.
1771 (copy_elided_sections): Call free_new_data.
1773 2015-12-01 Mark Wielaard <mjw@redhat.com>
1775 * elfcmp.c (main): Close ebl1 and ebl2 backends.
1777 2015-10-16 Mark Wielaard <mjw@redhat.com>
1779 * Makefile.am [BUILD_STATIC](libdw): Add -lz.
1780 [BUILD_STATIC](libelf): Likewise.
1782 2015-10-16 Mark Wielaard <mjw@redhat.com>
1784 * elflint.c (check_symtab): Don't check TLS symbol value against TLS
1785 phdr offset in debuginfo files.
1786 (check_sections): Don't try to match section offsets to phdrs offsets
1789 2015-10-16 Mark Wielaard <mjw@redhat.com>
1791 * elflint.c (check_reloc_shdr): Reject only desthdrs if they have both
1792 SHF_MERGE and SHF_STRINGS set.
1794 2015-10-13 Jose E. Marchesi <jose.marchesi@oracle.com>
1796 * elflint.c (check_sections): Do not rely on
1797 ebl_check_special_section when checking debuginfo files. Also
1798 check that the type of WE sections in debuginfo files is NOBITS.
1800 2015-10-13 Mark Wielaard <mjw@redhat.com>
1802 * elflint.c (check_program_header): Check relro flags are a subset
1803 of the load segment if they don't fully overlap.
1805 2015-10-07 Mark Wielaard <mjw@redhat.com>
1807 * Makefile.am (ldlex_no_Wstack_usage): New.
1808 * ldlex.l ([RWX]): Make cnt unsigned.
1810 2015-10-09 Josh Stone <jistone@redhat.com>
1812 * elflint.c (main): Replace stat64 and fstat64 with stat and fstat.
1813 * readelf.c (process_file): Likewise.
1814 (process_elf_file): Replace off64_t with off_t.
1815 * findtextrel.c (process_file): Replace open64 with open.
1816 * ld.c (main): Replace sizeof (off64_t) with 8.
1817 * strings.c: Replace off64_t with off_t throughout.
1818 (main): Replace stat64 and fstat64 with stat and fstat.
1819 (map_file): Replace mmap64 with mmap.
1820 (read_block): Likewise, and replace lseek64 with lseek.
1821 * strip.c (handle_elf): Replace ftruncate64 with ftruncate.
1822 (process_file): Replace stat64 and fstat64 with stat and fstat.
1823 * unstrip.c (parse_opt): Replace stat64 with stat.
1824 (handle_file): Replace open64 with open.
1825 (open_file): Likewise.
1827 2015-10-08 Chih-Hung Hsieh <chh@google.com>
1829 * ld.c (determine_output_format): Move recursive nested
1830 function "try" to file scope.
1832 2015-10-04 Mark Wielaard <mjw@redhat.com>
1834 * strip.c (handle_elf): Only sanity check section symbols to not
1835 kept discarded sections if we are creating a debug file.
1837 2015-10-07 Mark Wielaard <mjw@redhat.com>
1839 * unstrip.c (MAX): Removed.
1840 (find_alloc_sections_prelink): Allocate exact amount of bytes for
1843 2015-10-05 Chih-Hung Hsieh <chh@google.com>
1845 * unstrip.c (find_alloc_sections_prelink): Do not allocate
1846 on stack union types with variable length arrays; use xmalloc
1847 for such dynamic sized objects.
1848 * readelf.c (handle_core_item): Likewise, but use alloca
1849 for small variable size data object and add assert(count < 128).
1851 2015-10-05 Josh Stone <jistone@redhat.com>
1853 * Makefile.am (libld_elf_i386.so): Add AM_V_CCLD silencer.
1854 (.deps/none_ld.Po): Always silence the dummy command.
1855 (make-debug-archive): Add AM_V_GEN and AM_V_at silencers.
1857 2015-10-02 Mark Wielaard <mjw@redhat.com>
1859 * unstrip.c (copy_elided_sections): Use SH_INFO_LINK_P, not just
1862 2015-10-02 Mark Wielaard <mjw@redhat.com>
1864 * strip.c (handle_elf): Don't move around allocated NOBITS sections.
1865 Don't just mark the section header string table as unused.
1866 * unstrip.c (copy_elided_sections): Add header names to strtab if
1867 shstrndx equals the symtab strtabndx.
1869 2015-09-22 Mark Wielaard <mjw@redhat.com>
1871 * strip.c (cleanup_debug): Remove old-style function definitions.
1873 2015-09-09 Chih-Hung Hsieh <chh@google.com>
1875 * readelf.c (print_debug_exception_table): Initialize variable before
1876 it is used, because compiler does not know that error never returns.
1877 (dump_arhive_index): Likewise.
1879 2015-09-04 Chih-Hung Hsieh <chh@google.com>
1881 * elflint.c (check_group): Replace %Z length modifier with %z.
1882 (check_note_data): Likewise.
1883 * findtextrel.c (process_file): Likewise.
1884 * readelf.c (handle_dynamic): Likewise.
1885 (handle_symtab): Likewise.
1886 (handle_verneed): Likewise.
1887 (handle_verdef): Likewise.
1888 (handle_versym): Likewise.
1889 (print_hash_info): Likewise.
1890 (print_decoded_aranges_section): Likewise.
1891 (print_debug_aranges_section): Likewise.
1892 (print_debug_line_section): Likewise.
1893 (hex_dump): Likewise.
1894 (dump_data_section): Likewise.
1895 (print_string_section): Likewise.
1896 (dump_archive_index): Likewise.
1897 * unstrip.c (adjust_relocs): Likewise.
1898 (collect_symbols): likewise.
1899 (get_section_name): Likewise.
1900 (find_alloc_sections_prelink): Likewise.
1901 (copy_elided_sections): Likewise.
1902 * ldscript.y (add_id_list): Add missing '%s'.
1904 2015-09-03 Mark Wielaard <mjw@redhat.com>
1906 * readelf.c (handle_core_item): Handle right shift >= 32 bits.
1908 2015-08-11 Mark Wielaard <mjw@redhat.com>
1910 * elflint.c (check_sections): When gnuld and a NOBITS section falls
1911 inside a segment make sure any ELF file contents is zero.
1913 2015-07-29 Mark Wielaard <mjw@redhat.com>
1915 * unstrip.c (sections_flags_match): New function.
1916 (sections_match): Use sections_flags_match.
1917 (find_alloc_sections_prelink): Only clear matched sections if there
1919 (copy_elided_sections): Add SHF_INFO_LINK to shdr_mem.sh_flags if
1922 2015-06-27 Pino Toscano <toscano.pino@tiscali.it>
1924 * src/strings.c: Define MAP_POPULATE if not defined already.
1926 2015-06-27 Mark Wielaard <mjw@redhat.com>
1928 * nm.c (show_symbols): First call elf_getdata, then allocate memory.
1930 2015-06-18 Mark Wielaard <mjw@redhat.com>
1932 * findtextrel.c (process_file): Free segments after use.
1934 2015-06-18 Mark Wielaard <mjw@redhat.com>
1936 * readelf.c (print_phdr): Make sure phdr2_mem lifetime/scope equals
1939 2015-06-18 Mark Wielaard <mjw@redhat.com>
1941 * readelf.c (handle_gnu_hash): Free lengths on invalid_data.
1943 2015-06-18 Mark Wielaard <mjw@redhat.com>
1945 * elflint.c (check_symtab): Only check the PT_TLS phdr if it actually
1946 exists. Warn otherwise.
1948 2015-06-18 Mark Wielaard <mjw@redhat.com>
1950 * nm.c (show_symbols): Check sizeof (sym_mem[0]), not GElf_Sym to
1951 known whether or not we stack allocated memory.
1953 2015-06-18 Mark Wielaard <mjw@redhat.com>
1955 * strings.c (readelf): Use "<unknown>" if we cannot retrieve section
1958 2015-06-09 Mark Wielaard <mjw@redhat.com>
1960 * addr2line.c (print_dwarf_function): Always free scopes before
1963 2015-06-09 Mark Wielaard <mjw@redhat.com>
1965 * strip.c (handle_ar): Mark as unused.
1966 (process_file): Produce an error when trying to handle an ar.
1968 2015-05-30 Mark Wielaard <mjw@redhat.com>
1970 * elfcmp.c (main): Only call memcmp when d_size != 0.
1972 2015-05-23 Mark Wielaard <mjw@redhat.com>
1974 * Makefile.am: Define ldgeneric, readelf, nm, size, strip, elflint,
1975 findtextrel, elfcmp objdump, ranlib, ar and unstrip no_Wstack_usage.
1977 2015-05-21 Mark Wielaard <mjw@redhat.com>
1979 * addr2line.c (handle_address): Set scopes to NULL after free.
1981 2015-05-20 Mark Wielaard <mjw@redhat.com>
1983 * addr2line.c (OPT_PRETTY): New constant define.
1984 (argp_option): Add "pretty-print".
1985 (pretty): New static bool.
1986 (parse_opt): Set pretty.
1987 (print_dwarf_function): Adjust output when pretty is set.
1988 (print_addrsym): Likewise.
1989 (handle_address): Likewise.
1991 2015-05-20 Mark Wielaard <mjw@redhat.com>
1993 * Makefile.am (addr2line_LDADD): Add demanglelib.
1994 * addr2line.c (argp_option): Move demangle under output format.
1995 (demangle): New static bool.
1996 (demangle_buffer_len): New static size_t.
1997 (demangle_buffer): New static char *.
1998 (main): free demangle_buffer.
1999 (parse_opt): Set demangle.
2000 (symname): New static function.
2001 (get_diename): Use symname.
2002 (print_dwarf_function): Likewise.
2003 (print_addrsym): Likewise.
2004 (handle_address): Likewise.
2006 2015-05-20 Mark Wielaard <mjw@redhat.com>
2008 * addr2line.c (argp_option): Add "addresses", 'a'.
2009 (print_addresses): New static bool.
2010 (parse_opt): Set print_addresses.
2011 (get_addr_width): New static function.
2012 (handle_address): Print address if print_addresses is true.
2014 2015-05-20 Mark Wielaard <mjw@redhat.com>
2016 * addr2line.c (handle_address): Call strtoumax with base 16. Make
2017 sure all input has been processed.
2019 2015-05-20 Mark Wielaard <mjw@redhat.com>
2021 * addr2line (argp_option): Group 'section' under "Input format
2024 2015-05-12 Mark Wielaard <mjw@redhat.com>
2026 * strip.c (debug_fd): New static variable.
2027 (tmp_debug_fname): Likewise.
2028 (cleanup_debug): New function using the above to clean up temporary
2030 (INTERNAL_ERROR): Call cleanup_debug.
2031 (handle_elf): Use debug_fd and tmp_debug_fname statics and call
2032 cleanup_debug before any error. Use output_fname instead of fname in
2033 error messages when it exists (-o was given). SHT_NOBITS sections
2034 can also be moved freely even if SHF_ALLOC is set. Add various
2035 sanity checks. Use elf_assert instead of plain assert.
2037 2015-05-08 Mark Wielaard <mjw@redhat.com>
2039 * nm.c (show_symbols): Call gelf_fsize with EV_CURRENT.
2040 * strip.c (handle_elf): Likewise.
2042 2015-05-06 Mark Wielaard <mjw@redhat.com>
2044 * elflint.c (check_gnu_hash): Return early when 2nd hash function
2045 shift too big. Check there is enough data available. Make sure
2046 bitmask_words is not zero.
2047 (check_verdef): Use Elf64_Word for shdr->sh_info cnt.
2048 (check_verneed): Likewise.
2049 (check_attributes): Break when vendor name isn't terminated.
2050 Add overflow check for subsection_len.
2052 2015-05-05 Mark Wielaard <mjw@redhat.com>
2054 * nm.c (show_symbols): Handle dwarf_linesrc returning NULL.
2056 2015-05-04 Max Filippov <jcmvbkbc@gmail.com>
2058 * ar.c (do_oper_extract): Replace struct timeval with struct timespec
2059 and futimes with futimens.
2060 * strip.c (process_file): Replace struct timeval with struct timespec.
2061 (handle_elf, handle_ar): Replace struct timeval with struct timespec
2062 in prototype. Replace futimes with futimens.
2064 2015-05-04 Max Filippov <jcmvbkbc@gmail.com>
2066 * addr2line.c (main): Drop mtrace() call and #include <mcheck.h>.
2070 * objdump.c: Likewise.
2071 * ranlib.c: Likewise.
2073 * strip.c: Likewise.
2074 * unstrip.c: Likewise.
2076 2015-05-04 Anthony G. Basile <blueness@gentoo.org>
2078 * Makefile.am (readelf_LDADD, nm_LDADD, size_LDADD, strip_LDADD)
2079 (ld_LDADD, elflint_LDADD, findtextrel_LDADD, addr2line_LDADD)
2080 (elfcmp_LDADD, objdump_LDADD, ranlib_LDADD, strings_LDADD)
2081 (ar_LDADD, unstrip_LDADD, stack_LDADD): Append $(argp_LDADD).
2083 2015-03-22 Mark Wielaard <mjw@redhat.com>
2085 * readelf.c (print_debug_frame_section): Cast start to Dwarf_Off
2086 before subtracting cie_id. And cast cie_offset to Dwarf_Off before
2089 2015-03-22 Mark Wielaard <mjw@redhat.com>
2091 * readelf.c (print_gdb_index_section): Check all offsets used
2092 against section d_size.
2094 2015-03-17 Mark Wielaard <mjw@redhat.com>
2096 * readelf.c (print_debug): Don't return, but always use dummy_dbg.
2098 2015-03-17 Mark Wielaard <mjw@redhat.com>
2100 * readelf.c (print_gdb_index_section): Add overflow checking for
2103 2015-03-14 Mark Wielaard <mjw@redhat.com>
2105 * nm.c (INTERNAL_ERROR): Remove __DATE__.
2106 * objdump.c (INTERNAL_ERROR): Likewise.
2107 * size.c (INTERNAL_ERROR): Likewise.
2108 * strip.c (INTERNAL_ERROR): Likewise.
2110 2015-03-18 Petr Machata <pmachata@redhat.com>
2112 * readelf.c (dwarf_tag_string, dwarf_attr_string)
2113 (dwarf_form_string, dwarf_lang_string, dwarf_inline_string)
2114 (dwarf_encoding_string, dwarf_access_string)
2115 (dwarf_visibility_string, dwarf_virtuality_string)
2116 (dwarf_identifier_case_string, dwarf_calling_convention_string)
2117 (dwarf_ordering_string, dwarf_discr_list_string)
2118 (dwarf_locexpr_opcode_string): Adjust uses of know-dwarf.h macros
2119 to match the API changes.
2121 2015-03-09 Mark Wielaard <mjw@redhat.com>
2123 * elflint.c (compare_hash_gnu_hash): Correct gnu_symbias usage.
2125 2015-01-03 Mark Wielaard <mjw@redhat.com>
2127 * elfcmp (main): Check section name is not NULL. Check sh_entsize
2128 is not zero for symbol tables. Check phdrs are not NULL.
2129 (search_for_copy_reloc): Check sh_entsize is not zero.
2131 2014-12-30 Mark Wielaard <mjw@redhat.com>
2133 * elflint.c (check_scn_group): Check d_buf and name are not NULL.
2134 (is_rel_dyn): Check d is not NULL. Check shdr->sh_entsize is not
2136 (check_dynamic): Check strshdr is not NULL. Check d_tag is positive.
2137 (check_symtab_shndx): Check symshdr and data->d_buf are not NULL.
2138 Check shdr and symshdr sh_entsize are not zero.
2139 (check_gnu_hash): Make sure maskidx is smaller than bitmask_words.
2140 Check symshdr->sh_entsize is not zero. Check data->d_buf is not
2142 (compare_hash_gnu_hash): Check sections d_buf are not NULL.
2143 Check section data is large enough. Use gnu_symbias.
2144 (check_group): Check section val is valid.
2145 (has_copy_reloc): Check sh_entsize is not zero.
2146 (check_versym): Likewise.
2147 (unknown_dependency_p): Likewise.
2148 (check_verneed): Break on invalid ref or offset. Don't assert.
2149 Report error when next offset is zero, but more vers expected.
2150 (check_verdef): Likewise.
2151 (check_attributes): Make sure d_buf is not NULL.
2152 (check_note): Likewise.
2153 (check_note_section): Likewise.
2154 (check_program_header): Make sure section name is not NULL.
2156 2014-12-26 Mark Wielaard <mjw@redhat.com>
2158 * strings.c (read_elf): Produce error when section data falls outside
2161 2014-12-26 Mark Wielaard <mjw@redhat.com>
2163 * nm.c (show_symbols): Guard against divide by zero in error check.
2164 Add section index number in error message.
2166 2014-12-26 Mark Wielaard <mjw@redhat.com>
2168 * nm.c (handle_ar): Skip over /SYM64/ entries.
2170 2014-12-26 Mark Wielaard <mjw@redhat.com>
2172 * nm.c (handle_ar): Break on arsym with invalid offset.
2174 2014-12-20 Mark Wielaard <mjw@redhat.com>
2176 * readelf.c (print_debug_macinfo_section): Mark cus sentinel files
2177 as -1 non-existent. Check macoff against sentinel cus.
2179 2014-12-20 Mark Wielaard <mjw@redhat.com>
2181 * readelf.c (print_debug_exception_table): Add max_action overflow
2182 check. Check action_table_end before reading slib128. Check
2183 max_ar_filter underflow.
2185 2014-12-18 Ulrich Drepper <drepper@gmail.com>
2187 * Makefile.am: Suppress output of textrel_check command.
2189 2014-12-17 Mark Wielaard <mjw@redhat.com>
2191 * readelf.c (print_cfa_program): Add bounds check before each op that
2192 takes at least one argument.
2194 2014-12-16 Mark Wielaard <mjw@redhat.com>
2196 * readelf.c (print_decoded_line_section): Print dwarf_errmsg if
2197 dwarf_onesrcline or dwarf_linesrc fails.
2199 2014-12-16 Mark Wielaard <mjw@redhat.com>
2201 * readelf.c (print_debug_line_section): Correct overflow check for
2203 (print_debug_aranges_section): Correct overflow check for length.
2205 2014-12-15 Mark Wielaard <mjw@redhat.com>
2207 * readelf.c (notice_listptr): Return false if offset doesn't fit
2209 (attr_callback): Warn if loclist or rangelist offset doesn't fit.
2211 2014-12-15 Mark Wielaard <mjw@redhat.com>
2213 * readelf.c (print_ops): Don't assert when addr_size or ref_size
2214 is not 4 or 8, just report invalid data.
2216 2014-12-15 Mark Wielaard <mjw@redhat.com>
2218 * readelf.c (print_gdb_index_section): Add more bounds checks.
2220 2014-12-15 Mark Wielaard <mjw@redhat.com>
2222 * readelf.c (print_debug_line_section): Check there is enough room
2223 for DW_LNE_set_address argument. Make sure there is enough room
2224 for the the initial unit_length.
2226 2014-12-14 Mark Wielaard <mjw@redhat.com>
2228 * elflint.c (check_attributes): Call get_uleb128 with end pointer.
2229 * readelf.c (print_attributes): Likewise.
2230 (print_ops): Likewise and also for get_sleb128.
2231 (print_cfa_program): Likewise and add more readp bounds checks.
2232 (read_encoded): Likewise.
2233 (print_debug_frame_section): Likewise.
2234 (print_debug_line_section): Likewise.
2235 (print_debug_macinfo_section): Likewise.
2236 (print_debug_macro_section): Likewise.
2237 (print_debug_exception_table): Likewise.
2239 2014-12-16 Mark Wielaard <mjw@redhat.com>
2241 * elfcmp.c (compare_Elf32_Word): Make sure (unsigned) Elf32_Word
2242 difference doesn't wrap around before returning as int.
2244 2014-12-11 Mark Wielaard <mjw@redhat.com>
2246 * readelf.c (print_debug_exception_table): Check TType base offset
2247 and Action table are sane.
2249 2014-12-11 Mark Wielaard <mjw@redhat.com>
2251 * readelf.c (print_debug_frame_section): Check number of augmentation
2254 2014-12-09 Mark Wielaard <mjw@redhat.com>
2256 * readelf.c (handle_file_note): Check count fits data section and
2257 doesn't overflow fptr.
2259 2014-12-08 Mark Wielaard <mjw@redhat.com>
2261 * readelf.c (print_debug_exception_table): Report invalid data if
2262 action table doesn't immediately follow call site table.
2264 2014-12-10 Josh Stone <jistone@redhat.com>
2266 * addr2line.c (get_diename): New, get linkage_name or name.
2267 * addr2line.c (print_dwarf_function): Use get_diename.
2268 * addr2line.c (handle_address): Likewise.
2269 * addr2line.c (print_diesym): Removed.
2271 2014-12-10 Josh Stone <jistone@redhat.com>
2273 * addr2line.c (handle_address): Find the proper inline parents.
2275 2014-12-07 Mark Wielaard <mjw@redhat.com>
2277 * readelf.c (print_debug_line_section): max_ops_per_instr cannot
2280 2014-12-07 Mark Wielaard <mjw@redhat.com>
2282 * readelf.c (print_ops): Handle zero ref_size for DW_OP_call_ref
2283 and DW_OP_GNU_implicit_pointer.
2285 2014-12-04 Mark Wielaard <mjw@redhat.com>
2287 * objdump.c (show_relocs_x): Make sure destshdr exists.
2288 (show_relocs_rel): Don't rely on shdr->sh_entsize, use gelf_fsize.
2289 (show_relocs_rela): Likewise.
2290 (show_relocs): Make sure destshdr, symshdr and symdata exists.
2292 2014-11-30 Mark Wielaard <mjw@redhat.com>
2294 * readelf.c (handle_sysv_hash64): Fix overflow check.
2296 2014-11-28 Mark Wielaard <mjw@redhat.com>
2298 * readelf.c (handle_relocs_rel): Don't reuse destshdr to store
2299 section header of a relocation against a STT_SECTION symbol. Use
2300 a new local variable secshdr.
2301 (handle_relocs_rela): Likewise.
2303 2014-11-26 Mark Wielaard <mjw@redhat.com>
2305 * readelf.c (print_debug_aranges_section): Cast Dwarf_Word length
2306 to ptrdiff_t for comparison.
2308 2014-11-24 Mark Wielaard <mjw@redhat.com>
2310 * readelf.c (print_debug_line_section): Check line_range is not zero
2313 2014-11-23 Mark Wielaard <mjw@redhat.com>
2315 * readelf.c (print_debug_aranges_section): Check length to catch
2318 2014-11-21 Mark Wielaard <mjw@redhat.com>
2320 * readelf.c (print_attributes): Guard against empty section.
2321 Document attribute format. Break when vendor name isn't terminated.
2322 Add overflow check for subsection_len. Handle both gnu and non-gnu
2325 2014-11-22 Mark Wielaard <mjw@redhat.com>
2327 * elflint.c (check_sections): Call ebl_bss_plt_p without ehdr.
2328 * findtextrel.c (process_file): Use elf_getphdrnum.
2329 * readelf.c (process_elf_file): Remove redundant ehdr->e_phoff check.
2330 (print_phdr): Check phnum.
2331 * size.c (show_segments): Use elf_getphdrnum.
2332 * strip.c (handle_elf): Likewise.
2333 * unstrip.c (copy_elf): Likewise.
2334 (copy_elided_sections): Likewise.
2335 (handle_file): Likewise.
2337 2014-11-18 Mark Wielaard <mjw@redhat.com>
2339 * readelf.c (print_cfa_program): Fix sanity check of DW_FORM_block
2342 2014-11-17 Mark Wielaard <mjw@redhat.com>
2344 * readelf.c (handle_verneed): Check vna_next and vn_next exist.
2345 (handle_verdef): Check vda_next and vd_next exist.
2346 (handle_versym): Check vd_next, vna_next and vn_next exist.
2347 Check vername and filename are not NULL before use.
2349 2014-11-17 Mark Wielaard <mjw@redhat.com>
2351 * elfcmp.c (main): Check section names are NULL before use.
2352 * objdump.c (section_match): Likewise.
2353 * size.c (show_sysv): Likewise.
2355 2014-11-17 Mark Wielaard <mjw@redhat.com>
2357 * readelf.c (print_debug_frame_section): Warn if ptr_size is not 4
2358 or 8 instead of just calling print_cfa_program.
2360 2014-11-16 Mark Wielaard <mjw@redhat.com>
2362 * readelf (process_elf_file): Set phnum to zero if there aren't
2363 actually any pheaders.
2364 (print_phdr): Check there actually is a phdr.
2366 2014-11-16 Mark Wielaard <mjw@redhat.com>
2368 * readelf.c (print_cfa_program): Check block len before calling
2371 2014-11-14 Mark Wielaard <mjw@redhat.com>
2373 * readelf.c (print_debug_frame_section): Sanity Check CIE
2374 unit_length and augmentationlen.
2376 2014-11-14 Mark Wielaard <mjw@redhat.com>
2378 * readelf.c (handle_versym): Check def == NULL before use.
2380 2014-11-08 Mark Wielaard <mjw@redhat.com>
2382 * readelf.c (handle_versym): Initialize vername and filename array
2385 2014-11-07 Mark Wielaard <mjw@redhat.com>
2387 * readelf.c (handle_sysv_hash): Sanity check section contents.
2388 (handle_sysv_hash64): Likewise.
2389 (handle_gnu_hash): Likewise.
2391 2014-09-14 Petr Machata <pmachata@redhat.com>
2393 * readelf.c (handle_relocs_rela): Typo fix, test DESTSHDR properly.
2395 2014-09-12 Petr Machata <pmachata@redhat.com>
2397 * readelf.c (encoded_ptr_size): In the switch statement, change
2398 magic constants 3 and 4 to DW_EH_PE_* counterparts. Still accept
2399 0. Print diagnostic for anything else.
2401 2014-08-25 Josh Stone <jistone@redhat.com>
2403 * Makefile.am: Prevent premature @AR@ replacement in a sed expression.
2405 2014-07-04 Menanteau Guy <menantea@linux.vnet.ibm.com>
2406 Mark Wielaard <mjw@redhat.com>
2408 * elflint (check_symtab): Add ".TOC." to the list of possibly
2409 dangling symbols because of sourceware PR13621.
2411 2014-06-14 Mark Wielaard <mjw@redhat.com>
2413 * elflint (check_symtab): Use ebl_func_addr_mask on st_value.
2415 2014-05-27 Mark Wielaard <mjw@redhat.com>
2417 * readelf.c (print_debug): Skip section if name is NULL.
2419 2014-05-26 Mark Wielaard <mjw@redhat.com>
2421 * readelf.c (handle_relocs_rela): Print header like handle_relocs_rel
2422 does, when sh_info == 0.
2424 2014-05-26 Mark Wielaard <mjw@redhat.com>
2426 * unstrip.c (find_alloc_sections_prelink): Allow non-split .bss
2427 section when sh_size of the original and undo .bss section are equal.
2429 2014-05-26 Mark Wielaard <mjw@redhat.com>
2431 * unstrip.c (options): Add --force, -F.
2432 (struct arg_info): Add bool force.
2433 (parse_opt): Handle 'F', set force.
2434 (handle_explicit_files): Add force argument, add warn function,
2435 separate check ehdr field checks, use warn.
2436 (handle_dwfl_module): Add force argument, pass on to
2437 handle_explicit_files.
2438 (handle_output_dir_module): Add force argument, pass on to
2440 (handle_implicit_modules): Pass info->force to handle_dwfl_module and
2441 handle_output_dir_module.
2442 (main): Pass info.force to handle_explicit_files.
2444 2014-05-19 Mark Wielaard <mjw@redhat.com>
2446 * elflint.c (check_reloc_shdr): Check ebl_check_reloc_target_type.
2448 2014-05-01 Mark Wielaard <mjw@redhat.com>
2450 * readelf.c (find_no_debuginfo): Call dwfl_standard_find_debuginfo
2451 if looking for alternate debug file.
2453 2014-04-11 Mark Wielaard <mjw@redhat.com>
2455 * Makefile.am (AM_CPPFLAGS): Add -I libdwelf.
2457 2014-04-22 Mark Wielaard <mjw@redhat.com>
2459 * readelf.c (handle_core_item): Make sure variable length array
2460 contains at least enough space for terminating zero char.
2462 2014-04-22 Mark Wielaard <mjw@redhat.com>
2464 * readelf.c (print_gdb_index_section): Use unsigned int for 31 bits
2467 2014-03-13 Mark Wielaard <mjw@redhat.com>
2469 * Makefile.am: Remove no_mudflap.os. Remove libmudflap from all
2471 * strings.c (process_chunk): Remove _MUDFLAP condition.
2473 2014-04-09 Mark Wielaard <mjw@redhat.com>
2475 * readelf.c (print_debug_aranges_section): Don't get the raw section
2476 data, use the possibly decompressed .[z]debug sectiondata.
2477 (print_debug_ranges_section): Likewise.
2478 (print_debug_frame_section): Likewise.
2479 (print_debug_line_section): Likewise.
2480 (print_debug_loc_section): Likewise.
2481 (print_debug_macinfo_section): Likewise.
2482 (print_debug_macro_section): Likewise.
2484 2014-04-10 Mark Wielaard <mjw@redhat.com>
2486 * readelf.c (buf_read_ulong): Pass actual long size to convert.
2488 2014-03-05 Mark Wielaard <mjw@redhat.com>
2490 * readelf.c (attr_callback): Print DW_FORM_sdata values as signed
2493 2014-02-24 Mark Wielaard <mjw@redhat.com>
2495 * readelf (print_phdr): Check there is a SHT_PROGBITS section at the
2496 offset given by p_offsets for a PT_INTERP segment before trying to
2497 display the interpreter string.
2499 2014-02-07 Mark Wielaard <mjw@redhat.com>
2501 * readelf.c (print_phdr): Check phdr->p_filesz and make sure
2502 interpreter string is zero terminated before calling printf.
2504 2014-01-22 Mark Wielaard <mjw@redhat.com>
2506 * Makefile.am (nm_no_Wformat): Removed.
2507 (size_no_Wformat): Likewise.
2508 (strings_no_Wformat): Likewise.
2509 (addr2line_no_Wformat): Likewise.
2510 * size.c (show_sysv): Use fmtstr directly as literal in printf.
2511 (show_sysv_one_line): Likewise.
2512 * strings.c (locfmt): Removed.
2513 (radix): New static enum.
2514 (parse_opt): Set radix, not locfmt.
2515 (process_chunk_mb): Use fmtstr directly as literal in printf based
2517 (process_chunk): Likewise.
2518 * nm.c (show_symbols_sysv): Use fmtstr directly as literal in printf.
2519 (show_symbols_bsd): Likewise.
2520 (show_symbols_posix): Likewise.
2522 2014-01-21 Mark Wielaard <mjw@redhat.com>
2524 * stack.c (show_inlines): New static boolean.
2525 (print_frame): New function split out from...
2526 (print_frames): ..here. If show_inlines is true and we found a
2527 DIE for the frame address, call print_inline_frames otherwise
2528 call print_frame. Keep track of and track frame_nr.
2529 (print_inline_frames): New function.
2530 (parse_opt): Handle '-i'.
2531 (main): Add 'i' to options.
2533 2014-01-27 Mark Wielaard <mjw@redhat.com>
2535 * stack.c (maxframes): Initialize to 256.
2536 (main): Document new default in options. Document magic number
2537 used in frames.allocated initialization.
2539 2014-01-20 Mark Wielaard <mjw@redhat.com>
2541 * stack.c (show_debugname): New static boolean.
2542 (die_name): New function.
2543 (print_frames): If show_debugname is true set symname to the
2544 first function-like DIE with a name in scope for the address in
2546 (parse_opt): Handle '-d'.
2547 (main): Add 'd' to options.
2549 2014-01-20 Mark Wielaard <mjw@redhat.com>
2551 * addr2line.c (handle_address): Initialize scopes to NULL.
2553 2014-01-17 Roland McGrath <roland@redhat.com>
2555 * strip.c (handle_elf): Check for bogus values in sh_link, sh_info,
2556 st_shndx, e_shstrndx, and SHT_GROUP or SHT_SYMTAB_SHNDX data.
2557 Don't use assert on input values, instead bail with "illformed" error.
2559 2014-01-17 Roland McGrath <roland@redhat.com>
2561 * readelf.c (handle_dynamic, handle_symtab): Check for bogus sh_link.
2562 (handle_verneed, handle_verdef, handle_versym, handle_hash): Likewise.
2563 (handle_scngrp): Check for bogus sh_info.
2565 2014-01-17 Jakub Jelinek <jakub@redhat.com>
2567 * elflint.c (section_name): Return "<invalid>" instead of
2568 crashing on invalid section name.
2569 (check_symtab, is_rel_dyn, check_rela, check_rel, check_dynamic,
2570 check_symtab_shndx, check_hash, check_versym): Robustify.
2571 (check_hash): Don't check entries beyond end of section.
2572 (check_note): Don't crash if gelf_rawchunk fails.
2574 2014-01-17 Petr Machata <pmachata@redhat.com>
2576 * readelf.c (handle_dynamic, handle_relocs_rel)
2577 (handle_relocs_rela, handle_versym, print_liblist):
2578 Use gelf_fsize instead of relying on shdr->sh_entsize.
2580 2014-01-14 Mark Wielaard <mjw@redhat.com>
2582 * readelf.c (print_debug_macro_section): Clear vendor array before
2585 2014-01-15 Jan Kratochvil <jan.kratochvil@redhat.com>
2587 Fix corruption of non-C++ symbols by the demangler.
2588 * nm.c (show_symbols_sysv, show_symbols_bsd, show_symbols_posix)
2589 (show_symbols): Check for _Z.
2590 * stack.c (print_frames) <USE_DEMANGLE>: Check for _Z.
2592 2014-01-02 Mark Wielaard <mjw@redhat.com>
2594 * stack.c (show_raw): Declare unconditionally.
2595 (parse_opt): Handle '-r' unconditionally.
2596 (main): Show "raw" option even without USE_DEMANGLE.
2598 2014-01-02 Mark Wielaard <mjw@redhat.com>
2600 * stack.c (print_frames): Print 0x before build-id hex-offset.
2602 2014-01-02 Mark Wielaard <mjw@redhat.com>
2604 * stack.c (maxframes): Increase to 2048.
2605 (struct frames): Add allocated field.
2606 (frame_callback): If frames used is frames allocated, realloc.
2607 (print_frames): Show an error if maxframes has been reached.
2608 (parse_opt): Allow -n 0 for unlimited frames.
2609 (main): Document -n 0 and new default 2048 frames. Allocate initial
2610 number of frames with malloc.
2612 2013-12-30 Mark Wielaard <mjw@redhat.com>
2614 * stack.c (parse_opt): Explicitly call dwfl_linux_proc_attach
2615 or dwfl_core_file_attach and check for errors.
2617 2013-12-28 Mark Wielaard <mjw@redhat.com>
2619 * stack.c (print_frames): Remove address width code and use...
2620 (get_addr_width): ...this new function.
2621 (show_modules): New static boolean.
2622 (module_callback): New static function.
2623 (parse_opt): Handle '-l'.
2624 (main): Add 'l' to options. If show_modules then use dwfl_getmodules
2625 with module_callback to show all detected modules and possible
2626 build_id, elf and dwarf files.
2628 2013-12-27 Mark Wielaard <mjw@redhat.com>
2630 * stack.c (frames_shown): New static boolean.
2631 (EXIT_OK,EXIT_ERROR,EXIT_BAD,EXIT_USAGES): New defines.
2632 (frame_callback): Return -1 on error. Don't print error.
2633 (print_frames): Add arguments, tid, dwflerr and what. Print tid.
2634 If there was an error report it with address and module if possible.
2635 Record whether any frames were actually printed.
2636 (thread_callback): Collect tid and err, pass it to print_frames.
2637 (parse_opt): Use EXIT_BAD for errors. On ARGP_KEY_END print errno
2638 if dwfl_linux_proc_report returned it. Check whether we are properly
2639 attached with dwfl_pid.
2640 (main): Document exit status. Don't report DWARF_CB_ABORT from
2641 callbacks as error. Pass real errors to print_frames. Return
2642 EXIT_BAD if no frames could be shown. Return EXIT_ERROR if there
2643 were any non-fatal errors.
2645 2013-12-23 Mark Wielaard <mjw@redhat.com>
2647 * Makefile.am (stack_LDADD): Add demanglelib.
2648 * stack.c (show_quiet): New static boolean, default false.
2649 (show_raw): Likewise.
2650 (demangle_buffer_len): New static size_t.
2651 (demangle_buffer): New static char *.
2652 (print_frames): Don't resolve pc name if show_quiet. Demangle name
2654 (parse_opt): Handle '-q' and '-r'.
2655 (main): Add 'q' and 'r' to options. Free demangle_buffer.
2657 2013-12-23 Mark Wielaard <mjw@redhat.com>
2659 * stack.c (OPT_DEBUGINFO): New define.
2660 (OPT_COREFILE): Likewise.
2662 (core_fd): Likewise.
2665 (debuginfo_path): Likewise.
2666 (parse_opt): Handle '-p', '--core', '-e' and '--debuginfo-path'.
2667 Do argument sanity checking. Setup Dwfl.
2668 (main): Add 'p', 'core', 'e' and 'debuginfo-path' to options.
2669 Remove argp_child children, simplify argp doc, remove custom
2670 usage message and construction of dwfl with dwfl_standard_argp.
2671 Use pid directly as tid. close core and core_fd if opened. Print
2672 pid of process or core.
2674 2013-12-23 Mark Wielaard <mjw@redhat.com>
2676 * stack.c (show_build_id): New static boolean.
2677 (print_frames): Print module build-id, load address and pc offset
2678 if show_build_id is true.
2679 (parse_opt): Handle '-b'.
2680 (main): Add -b to options.
2682 2013-12-22 Mark Wielaard <mjw@redhat.com>
2684 * stack.c (maxframes): New static unsigned. Initialize to 64.
2685 (struct frame): New struct.
2686 (struct frames): Likewise.
2687 (dwfl): New static Dwfl pointer.
2688 (frame_callback): Use arg as struct frames and fill it next frame.
2689 Return DWARF_CB_ABORT when maxframes has been reached. Move
2690 printing of frame to...
2691 (print_frames): ...here. New function.
2692 (thread_callback): Use arg as struct frames and set frames to zero.
2694 (parse_opt): Handle '-n'.
2695 (main): Add -n to options. Allocate frames using maxframes. Pass
2696 frames to frame_callback and thread_callback.
2698 2013-12-20 Mark Wielaard <mjw@redhat.com>
2700 * stack.c (show_one_tid): New static boolean.
2701 (parse_opt): Handle '-1'.
2702 (main): Add -1 to options. Call dwfl_getthread_frames when
2703 show_one_tid is true.
2705 2013-12-18 Mark Wielaard <mjw@redhat.com>
2707 * addr2line.c (options): Add symbol-sections, 'x'.
2708 (show_symbol_sections): New static bool.
2709 (parse_opt): Handle 'x'.
2710 (print_addrsym): Use dwfl_module_addrinfo value.r
2711 Also show section of address with show_symbol_sections.
2712 (find_symbol): Use dwfl_module_getsym_info and set value.
2713 (handle_address): Request value and use it instead of sym.st_value.
2714 * readelf.c (format_dwarf_addr): Use dwfl_module_addrinfo to get
2717 2013-12-17 Masatake YAMATO <yamato@redhat.com>
2718 Mark Wielaard <mjw@redhat.com>
2720 * stack.c (show_activation, show_module, show_source): New variables.
2721 (parse_opt): Set show_activation if -a option is given.
2722 Set show_module if -m option is given. Set show_source if -s option
2723 is given. Set all show booleans when -v option is given.
2724 (main): Added `-a', `-m', `-s', and `-v' to the help message.
2725 (frame_callback): Print module and source file information.
2727 2013-11-25 Petr Machata <pmachata@redhat.com>
2729 * elflint.c (valid_e_machine): Add EM_AARCH64.
2731 2013-11-14 Petr Machata <pmachata@redhat.com>
2733 * readelf.c (handle_core_item) <'h'>: New branch for handling
2734 fields that shouldn't be displayed.
2736 2013-11-10 Mark Wielaard <mjw@redhat.com>
2738 * stack.c: Use ARGP_PROGRAM_VERSION_HOOK_DEF and
2739 ARGP_PROGRAM_BUG_ADDRESS_DEF.
2740 (print_version): New function.
2742 2013-11-09 Mark Wielaard <mjw@redhat.com>
2744 * arlib.c (arlib_init): Call snprintf before using the result
2746 (arlib_finalize): Likewise.
2747 * nm.c (show_symbols_sysv): Don't modify cnt inside assert.
2749 2013-11-07 Jan Kratochvil <jan.kratochvil@redhat.com>
2751 * Makefile.am (bin_PROGRAMS): Add stack.
2753 * stack.c: New file.
2755 2013-11-05 Mark Wielaard <mjw@redhat.com>
2757 * readelf.c (print_debug_ranges_section): Cast address to size_t
2759 (print_debug_loc_section): Likewise.
2761 2013-10-18 Mark Wielaard <mjw@redhat.com>
2763 * ar.c (main): Correct operation check when instance_specifed is set.
2765 2013-09-26 Petr Machata <pmachata@redhat.com>
2767 * readelf.c (handle_file_note): New function.
2768 (handle_notes_data): Call it to handle NT_FILE notes.
2770 2013-09-26 Petr Machata <pmachata@redhat.com>
2772 * readelf.c (handle_siginfo_note): New function.
2773 (handle_notes_data): Call it to handle NT_SIGINFO notes.
2774 (buf_read_int, buf_read_ulong, buf_has_data): New functions.
2776 2013-08-13 Mark Wielaard <mjw@redhat.com>
2778 * addr2line.c (options): Add "inlines", 'i'.
2779 (show_inlines): New bool.
2780 (parse_opt): Handle 'i'.
2781 (print_diesym): New static function.
2782 (print_src): New function taking code from...
2783 (handle_address): here. Call print_src. Print inlines.
2785 2013-08-12 Mark Wielaard <mjw@redhat.com>
2787 * addr2line.c (main): If there is a newline char at end of buf,
2790 2013-07-05 Mark Wielaard <mjw@redhat.com>
2792 * readelf.c (print_ops): Take CU as argument, use it to print
2793 parameter_ref DIE offset.
2794 (struct listptr): Replace base field with cu.
2795 (listptr_base): New function.
2796 (compare_listptr): Use listptr_base.
2797 (notice_listptr): Take CU as argument.
2798 (skip_listptr_hole): Likewise.
2799 (print_debug_ranges_section): Pass NULL as CU to skip_listptr_hole.
2800 (print_cfa_program): Pass NULL as CU to print_ops.
2801 (struct attrcb_args): Replace cu_base field with cu.
2802 (attr_callback): Pass cu not cu_base to notice_listptr.
2803 (print_debug_units): Don't calculate base, just set cu.
2804 (print_debug_loc_section): Pass cu to skip_listptr_hole and
2807 2013-05-06 Mark Wielaard <mjw@redhat.com>
2809 * readelf.c (print_ops): Format first DW_OP_GNU_implicit_pointer
2810 argument as DIE offset.
2812 2013-04-24 Mark Wielaard <mjw@redhat.com>
2814 * Makefile.am: Use AM_CPPFLAGS instead of INCLUDES.
2816 2013-03-25 Mark Wielaard <mjw@redhat.com>
2818 * readelf.c (argp_options): Add decodedline.
2819 (decodedline): New boolean initialized to false.
2820 (parse_opt): Set decodedline when arg is decodedline.
2821 (print_decoded_line_section): New function.
2822 (print_debug_line_section): Call print_decoded_line_section when
2823 decodedline is true.
2825 2013-03-25 Mark Wielaard <mjw@redhat.com>
2827 * readelf.c (argp_option): Add decodedaranges.
2828 (decodedaranges): New boolean initialized to false.
2829 (parse_opt): Set decodedaranges when arg is decodedaranges.
2830 (print_debug_aranges_section): Reimplemented and original
2831 implementation renamed to...
2832 (print_decoded_aranges_section): this.
2834 2013-03-25 Mark Wielaard <mjw@redhat.com>
2836 * readelf.c (attrcb_args): Add Dwarf_Die.
2837 (attr_callback): When highpc is in constant form also print as
2839 (print_debug_units): Set args.die.
2841 2013-03-19 Mark Wielaard <mjw@redhat.com>
2843 * readelf.c (print_gdb_index_section): Free format_dwarf_addr results.
2845 2013-03-18 Mark Wielaard <mjw@redhat.com>
2847 * readelf.c (print_gdb_index_section): Accept version 8.
2849 2013-03-01 Mark Wielaard <mjw@redhat.com>
2851 * findtextrel.c (process_file): Release ELF and close file when not
2852 text relocations are found.
2853 * strip.c (handle_elf): Track memory used for .debuglink section data
2856 2013-02-24 Mark Wielaard <mjw@redhat.com>
2858 * elflint.c (check_symtab): Add __bss_start__ to the list of symbols
2859 allowed to have out of section values because of GNU ld bugs.
2861 2013-02-06 Mark Wielaard <mjw@redhat.com>
2863 * elflint.c (check_symtab): Add __bss_start and __TMC_END__ to the
2864 list of symbols allowed to have out of section values because of
2865 GNU ld bugs in either .symtab or .dynsym, but only when they are
2868 2013-01-24 Mark Wielaard <mjw@redhat.com>
2870 * readelf.c (argp_option): Add unresolved-address-offsets, U.
2871 (print_unresolved_addresses): New static.
2872 (parse_opt): Handle 'U', set print_unprocessed_values.
2873 (format_dwarf_addr): Take and handle new raw argument.
2874 (print_ops): Call format_dwarf_addr with raw offset values.
2875 (print_debug_ranges_section): Likewise.
2876 (print_debug_frame_section): Likewise.
2877 (attr_callback): Likewise.
2878 (print_debug_line_section): Likewise.
2879 (print_debug_loc_section): Likewise.
2880 (print_gdb_index_section): Likewise.
2882 2013-01-18 Mark Wielaard <mjw@redhat.com>
2884 * readelf.c (struct listptr): Add base Dwarf_Addr field.
2885 (compare_listptr): Warn for same offset with different base.
2886 (notice_listptr): Take base argument and set it.
2887 (skip_listptr_hole): Likewise.
2888 (struct attrcb_args): Removed unused cu_offset field.
2889 Add cu_base Dwarf_Addr field.
2890 (attr_callback): Call notice_listptr with cbargs->cu_base.
2891 (print_debug_units): Set args.cu_base.
2892 (print_debug_ranges_section): Get base and use for format_dwarf_addr.
2893 (print_debug_loc_section): Likewise.
2895 2013-01-29 Jan Kratochvil <jan.kratochvil@redhat.com>
2897 * readelf.c (handle_core_items): Limit special repeated items handling
2898 to single-item formats '\n', 'b' and 'B', assert OFFSET 0 there.
2900 2012-12-18 Mark Wielaard <mark@bordewijk.wildebeest.org>
2902 * readelf.c (ELF_INPUT_SECTION): New argp key value.
2903 (argp_option): Add elf-section.
2904 (elf_input_section): New static.
2905 (parse_opt): Handle ELF_INPUT_SECTION and set elf_input_section.
2906 (open_input_section): New function.
2907 (process_file): Call open_input_section if elf_input_section set.
2909 2013-01-13 David Abdurachmanov <David.Abdurachmanov@cern.ch>
2911 ar.c (do_oper_delete): Fix num passed to memset.
2913 2012-12-21 Mark Wielaard <mjw@redhat.com>
2915 * readelf.c (print_debug_frame_section): Adjust FDE start address
2916 if pcrel before feeding it to format_dwarf_addr.
2918 2012-12-21 Mark Wielaard <mjw@redhat.com>
2920 * addr2line.c (main): Call dwfl_end.
2922 2012-12-11 Roland McGrath <roland@hack.frob.com>
2924 * nm.c (show_symbols_sysv): Fix size passed to snprintf for invalid
2926 Reported by David Abdurachmanov <David.Abdurachmanov@cern.ch>.
2928 2012-10-16 Mark Wielaard <mjw@redhat.com>
2930 * readelf.c (print_ops): DW_OP_skip and DW_OP_bra targets are
2931 calculated beginning after the operand and 2-byte constant.
2933 2012-10-12 Jan Kratochvil <jan.kratochvil@redhat.com>
2935 * readelf.c (ITEM_WRAP_COLUMN, REGISTER_WRAP_COLUMN): Merge to ...
2936 (WRAP_COLUMN): ... here.
2937 (print_core_item): Remove parameter format_max. Update function
2938 comment. Replace FORMAT_MAX by the real output width.
2939 (handle_core_item): Remove the FORMAT_MAX values in TYPES, DO_TYPE,
2940 calls of print_core_item, remove variable maxfmt, change
2941 ITEM_WRAP_COLUMN to WRAP_COLUMN.
2942 (handle_core_register): Remove the FORMAT_MAX values in TYPES, BITS,
2943 calls of print_core_item, change REGISTER_WRAP_COLUMN to WRAP_COLUMN.
2945 2012-10-11 Jan Kratochvil <jan.kratochvil@redhat.com>
2947 * readelf.c (handle_core_item) <b>: Make run an outer block variable.
2948 Increase run only if LASTBIT != 0. Print last element only if RUN > 0.
2950 2012-08-27 Mark Wielaard <mjw@redhat.com>
2952 * readelf.c (print_debug_macro_section): Print offset as PRIx64.
2954 2012-08-27 Mark Wielaard <mjw@redhat.com>
2956 * readelf.c (register_info): Handle loc == NULL.
2958 2012-08-22 Jeff Kenton <jkenton@tilera.com>
2960 * elflint.c (valid_e_machine): Add EM_TILEGX and EM_TILEPRO.
2962 2012-08-16 Mark Wielaard <mjw@redhat.com>
2964 * readelf.c (dwarf_tag_name): Renamed from dwarf_tag_string.
2965 Uses new dwarf_tag_string or adds ??? or lo_user+%#x when
2967 (dwarf_attr_name): Likewise.
2968 (dwarf_form_name): Likewise.
2969 (dwarf_lang_name): Likewise.
2970 (dwarf_inline_name): Likewise.
2971 (dwarf_encoding_name): Likewise.
2972 (dwarf_access_name): Likewise.
2973 (dwarf_visibility_name): Likewise.
2974 (dwarf_virtuality_name): Likewise.
2975 (dwarf_identifier_case_name): Likewise.
2976 (dwarf_calling_convention_name): Likewise.
2977 (dwarf_ordering_name): Likewise.
2978 (dwarf_discr_list_name): Likewise.
2979 (print_ops): Remove KNOWN. Use dwarf_locexpr_opcode_string.
2980 (attr_callback): Call new dwarf_foobar_name instead of old
2981 dwarf_foobar_string functions.
2982 (dwarf_tag_string): New function using known-dwarf.h macros.
2983 (dwarf_attr_string): Likewise.
2984 (dwarf_form_string): Likewise.
2985 (dwarf_lang_string): Likewise.
2986 (dwarf_inline_string): Likewise.
2987 (dwarf_encoding_string): Likewise.
2988 (dwarf_access_string): Likewise.
2989 (dwarf_visibility_string): Likewise.
2990 (dwarf_virtuality_string): Likewise.
2991 (dwarf_identifier_case_string): Likewise.
2992 (dwarf_calling_convention_string): Likewise.
2993 (dwarf_ordering_string): Likewise.
2994 (dwarf_discr_list_string): Likewise.
2995 (dwarf_locexpr_opcode_string): Likewise.
2997 2012-06-27 Mark Wielaard <mjw@redhat.com>
2999 * readelf.c (dwarf_form_string): Handle DW_FORM_GNU_ref_alt and
3000 DW_FORM_GNU_strp_alt.
3001 (attr_callback): Likewise.
3003 2012-07-30 Petr Machata <pmachata@redhat.com>
3005 * nm.c (show_symbols_bsd): Reorder arguments in {S,}FMTSTRS (and
3006 corresponding printf) so that those that are referenced by only
3007 one of the formatting strings are at the end.
3009 2012-07-29 Mark Wielaard <mjw@redhat.com>
3011 * readelf.c (dwarf_lang_string): Use DW_LANG_ObjC, not DW_LANG_Objc.
3012 (print_ops): Use known[op], not op_name, for DW_OP_GNU_parameter_ref.
3014 2012-07-19 Mark Wielaard <mjw@redhat.com>
3016 * readelf.c (print_ops): Handle DW_OP_GNU_parameter_ref.
3018 2012-07-11 Mark Wielaard <mjw@redhat.com>
3020 * readelf.c (options): Add macro to help of debug-dump.
3021 (section_e): Add section_macro.
3022 (section_all): Add section_macro.
3023 (parse_opt): Handle macro.
3024 (print_debug_macro_section): New function.
3025 (print_debug): Add NEW_SECTION (macro).
3027 2012-07-10 Mark Wielaard <mjw@redhat.com>
3029 * readelf.c (print_gdb_index_section): Add version 7 support.
3030 Keep track of cu_nr. Print kind and static/global flag for each
3031 symbol. When a symbol is in the TU list add 'T'.
3033 2012-06-26 Mark Wielaard <mjw@redhat.com>
3035 * readelf.c (dwarf_attr_string): Add DW_AT_GNU_macros.
3037 2012-06-22 Mark Wielaard <mjw@redhat.com>
3039 * readelf.c (print_ops): Cast printf PRIu/x64 arguments to uint64_t
3040 for gcc 4.7 -Wformat.
3042 2012-05-09 Roland McGrath <roland@hack.frob.com>
3044 * elflint (check_sections): Allow zero sized sections at (filesz) end
3045 of segment. And make check overflow-proofed.
3047 2012-04-24 Mark Wielaard <mjw@redhat.com>
3049 * readelf.c (print_ops): Add DW_OP_GNU_push_tls_address,
3050 DW_OP_GNU_uinit and DW_OP_GNU_encoded_addr.
3052 2012-03-28 Roland McGrath <roland@hack.frob.com>
3054 * elflint.c (special_sections): Accept SHF_INFO_LINK for reloc sections.
3056 2012-03-28 Mark Wielaard <mjw@redhat.com>
3058 * readelf.c (print_debug_abbrev_section): Check there is Dwarf
3060 (print_debug_str_section): Likewise.
3062 2012-03-21 Mark Wielaard <mjw@redhat.com>
3064 * readelf.c (print_gdb_index_section): Accept version 6.
3066 2012-01-31 Mark Wielaard <mjw@redhat.com>
3068 * readelf.c (attr_callback): Don't special case DW_FORM_sec_offset.
3070 2012-01-21 Ulrich Drepper <drepper@gmail.com>
3072 * addr2line.c: Update copyright year.
3074 * elfcmp.c: Likewise.
3075 * elflint.c: Likewise.
3076 * findtextrel.c: Likewise.
3079 * objdump.c: Likewise.
3080 * ranlib.c: Likewise.
3081 * readelf.c: Likewise.
3083 * strings.c: Likewise.
3084 * strip.c: Likewise.
3085 * unstrip.c: Likewise.
3087 * nm.c (argp_children): Define.
3088 (argp): Hook up argp_children.
3089 (handle_ar): Optimize puts call.
3090 (show_symbols_bsd): Use positional parameters to also print color
3091 codes. Don't print STT_FILE symbols.
3092 * objdump.c (options): Improve help text.
3093 (argp_children): Define.
3094 (argp): Hook up argp_children.
3095 (disasm_info): Add elements for color codes.
3096 (disasm_output): Print color codes as well.
3097 (show_disasm): Set up disasm_info data for callback.
3099 2012-01-20 Roland McGrath <roland@hack.frob.com>
3101 * arlib-argp.c (arlib_deterministic_output): Initialize from
3103 (help_filter): New function.
3106 * ar.c (main): Handle oper_none as usage error.
3108 * arlib-argp.c (options, parse_opt): Grok -U as inverse of -D.
3110 * ranlib.c (argp): Use arlib_argp_children.
3112 * arlib.c (arlib_init): Obey arlib_deterministic_output.
3114 * arlib-argp.c: New file.
3115 * Makefile.am (libar_a_SOURCES): Add it.
3116 * arlib.h (arlib_deterministic_output, arlib_argp_children):
3117 Declare new variables.
3118 * ar.c (deterministic_output): Variable removed.
3119 (do_oper_insert): Use arlib_deterministic_output instead.
3120 (options, parse_opt): Don't handle -D here. Add group numbers.
3121 (argp): Use arlib_argp_children.
3123 2011-12-20 Roland McGrath <roland@hack.frob.com>
3125 * readelf.c (print_debug): Initialize DUMMY_DBG.elf.
3126 Reported by Karel Klic <kklic@redhat.com>.
3128 2011-11-05 Roland McGrath <roland@hack.frob.com>
3130 * ar.c (deterministic_output): New flag variable.
3131 (options, parse_opt): Grok -D to set it.
3132 (do_oper_insert): When set, use zero from mtime, uid, and gid.
3134 * ar.c (do_oper_insert): Fix check on elf_rawfile return value.
3136 2011-10-04 Marek Polacek <mpolacek@redhat.com>
3138 * readelf.c (register_info): Assume the right size of an array.
3140 2011-10-03 Ulrich Drepper <drepper@gmail.com>
3142 * nm.c: Recognize option --mark-special. Still recognize --mark-weak
3143 but don't show it in help anymore.
3144 (mark_special): Renamed from mark_weak.
3145 (parse_opt): Adjust.
3146 (class_type_char): Take additional parameters for ELF file and ELF
3147 header. Treat TLS symbols like objects.
3148 In case of D symbols, show u for unique symbols, R for symbols in
3149 read-only sections, B for symbols in BSS sections.
3150 (show_symbols_bsd): Take additional parameters for ELF file and ELF
3151 header. Adjust for class_type_char change. Show TLS symbols with
3152 @ after them in case --mark-special is selected.
3153 (show_symbols_posix): Likewise.
3154 (show_symbols): Adjust calls to show_symbols_bsd and
3156 (show_symbols_sysv): Avoid printing address and size for undefined
3157 symbols. Don't print initial special entry and section entries.
3159 2011-10-02 Ulrich Drepper <drepper@gmail.com>
3161 * Makefile.am (demanglelib): Define.
3162 (nm_LDADD): Add demanglelib.
3163 * nm.c (options): Add -C option.
3164 (demangle): Define as global variable.
3165 (parse_opt): Recognize -C.
3166 (show_symbols_sysv): Handle demangling.
3167 (show_symbols_bad): Likewise.
3168 (show_symbols_posix): Likewise.
3169 (show_symbols): Likewise.
3171 2011-07-09 Roland McGrath <roland@hack.frob.com>
3173 * readelf.c (options, parse_opt): Grok -W/--wide and ignore it.
3175 * ar.c (parse_opt): Grok -u.
3177 2011-05-30 Mark Wielaard <mjw@redhat.com>
3179 * strip.c (relocate): Make offset check overflow-proof.
3181 2011-05-23 Mark Wielaard <mjw@redhat.com>
3183 * strip.c (relocate): Take new arguments is_rela to indicate
3184 whether the relocation is from a SHT_REL or SHT_RELA section.
3185 Relocate against any debug section symbol, not just STT_SECTION
3186 symbols. For SHT_REL relocations, fetch addend from offset and
3187 add it to symbol value if not zero.
3189 2011-05-23 Mark Wielaard <mjw@redhat.com>
3191 * strip.c (OPT_RELOC_DEBUG): New option.
3192 (argp_option): Add new --reloc-debug-sections option.
3193 (main): Check new option.
3194 (parse_opt): Likewise.
3195 (handle_elf): Remove any relocations between debug sections
3196 in ET_REL for the debug file when requested.
3198 2011-05-18 Mark Wielaard <mjw@redhat.com>
3200 * strip.c (handle_elf): Make sure all sections of a removed group
3201 section are removed too. Don't discard SHT_GROUP sections, copy
3202 section table before it gets modified. Section group signature
3203 symbols don't have to be retained.
3205 2011-05-16 Jakub Jelinek <jakub@redhat.com>
3207 * readelf.c (print_ops): Handle DW_OP_GNU_const_type,
3208 DW_OP_GNU_regval_type, DW_OP_GNU_deref_type, DW_OP_GNU_convert
3209 and DW_OP_GNU_reinterpret.
3211 2011-05-17 Mark Wielaard <mjw@redhat.com>
3213 * readelf.c (dwarf_tag_string): Fixup DW_TAG_GNU_call_site and
3214 DW_TAG_GNU_call_site_parameter return strings.
3216 2011-05-11 Marek Polacek <mpolacek@redhat.com>
3218 * nm.c (show_symbols_sysv): Remove unused if/else, remove
3219 unused `prefix' and `fname' parameters.
3221 2011-05-07 Marek Polacek <mpolacek@redhat.com>
3223 * unstrip.c (compare_sections_nonrel): Mark this function as static.
3225 2011-04-26 Mark Wielaard <mjw@redhat.com>
3227 * readelf.c (handle_notes_data): Call ebl_object_note_type_name
3230 2011-04-14 Mark Wielaard <mjw@redhat.com>
3232 * readelf.c (options): Add gdb_index.
3233 (section_e): Define section_gdb_index.
3234 (parse_opt): Recognize gdb_index debug-dump argument.
3235 (print_gdb_index_section): New function.
3236 (print_debug): Add gdb_index to debug_sections.
3238 2011-03-24 Petr Machata <pmachata@redhat.com>
3240 * readelf.c (print_debug_line_section): Emit initial space for all
3241 opcode lines. Print offset in front of each opcode.
3243 2011-03-22 Marek Polacek <mpolacek@redhat.com>
3245 * readelf.c (handle_dynamic): Don't segfault at DT_PLTREL case.
3247 2011-03-22 Mark Wielaard <mjw@redhat.com>
3249 * readelf.c (dwarf_tag_string): Support DW_TAG_GNU_call_site
3250 and DW_TAG_GNU_call_site_parameter.
3251 (dwarf_attr_string): Support DW_AT_GNU_call_site_value,
3252 DW_AT_GNU_call_site_data_value,
3253 DW_AT_GNU_call_site_target,
3254 DW_AT_GNU_call_site_target_clobbered,
3255 DW_AT_GNU_tail_call,
3256 DW_AT_GNU_all_tail_call_sites,
3257 DW_AT_GNU_all_call_sites,
3258 and DW_AT_GNU_all_source_call_sites.
3259 (print_ops): Handle DW_OP_GNU_entry_value.
3260 (attr_callback): Handle DW_AT_GNU_call_site_value,
3261 DW_AT_GNU_call_site_data_value,
3262 DW_AT_GNU_call_site_target,
3263 and DW_AT_GNU_call_site_target_clobbered.
3265 2011-03-10 Mark Wielaard <mjw@redhat.com>
3267 * elflint.c (check_symtab): Use ebl_check_st_other_bits.
3269 2011-02-27 Jan Kratochvil <jan.kratochvil@redhat.com>
3271 * readelf.c (reset_listptr): Clear TABLE->TABLE.
3273 2011-02-25 Mark Wielaard <mjw@redhat.com>
3275 * readelf.c (dwarf_attr_string): Add DW_AT_GNU_* handling.
3276 (dwarf_form_string): Properly format and return unknown form.
3278 2011-02-23 Roland McGrath <roland@redhat.com>
3280 * readelf.c (section_name): New function.
3281 (print_debug_abbrev_section): Use it instead of constant.
3282 (print_debug_aranges_section): Likewise.
3283 (print_debug_ranges_section): Likewise.
3284 (print_debug_units): Likewise.
3285 (print_debug_line_section): Likewise.
3286 (print_debug_loc_section): Likewise.
3287 (print_debug_macinfo_section): Likewise.
3288 (print_debug_pubnames_section): Likewise.
3289 (print_debug_str_section): Likewise.
3290 (print_debug) [USE_ZLIB]: Match .zdebug_* sections too.
3291 (print_debug_abbrev_section): Use decoded d_size, not sh_size.
3292 (print_debug_str_section): Likewise.
3294 * readelf.c (dwarf_attr_string): Grok DW_AT_GNU_odr_signature.
3296 2011-02-11 Roland McGrath <roland@redhat.com>
3298 * elfcmp.c (verbose): New variable.
3299 (options, parse_opt): Grok -l/--verbose to set it.
3300 (main): Under -l, keep going after first difference.
3302 * elfcmp.c (ignore_build_id): New variable.
3303 (options, parse_opt): Grok --ignore-build-id to set it.
3304 (main): For SHT_NOTE sections, compare note details rather than raw
3305 bytes. Under --ignore-build-id, don't complain about differing build
3306 ID contents if lengths match.
3308 2011-02-08 Roland McGrath <roland@redhat.com>
3310 * ldscript.y (filename_id_star): Remove unused variable.
3312 * unstrip.c (copy_elided_sections): Remove unused variable.
3314 * elflint.c (check_dynamic): Remove unused variables.
3316 * elflint.c (check_symtab): Warn about missing xndx section only once.
3318 * ldgeneric.c (check_for_duplicate2): Remove unused variable.
3320 2011-01-06 Roland McGrath <roland@redhat.com>
3322 * strip.c (handle_elf): Under --strip-sections, remove all
3323 non-allocated sections and never generate .gnu_debuglink.
3325 2011-01-04 Roland McGrath <roland@redhat.com>
3327 * strip.c (remove_shdrs): New variable.
3328 (options, parse_opt): Grok --strip-sections to set it.
3329 (handle_elf): When that's set, truncate off .shstrtab and shdrs.
3331 2010-11-10 Roland McGrath <roland@redhat.com>
3333 * findtextrel.c (process_file): Don't assume order of sections.
3334 Reported by Mike Hommey <mh@glandium.org>.
3336 2010-07-26 Roland McGrath <roland@redhat.com>
3338 * readelf.c (print_ops): Handle DW_OP_GNU_implicit_pointer.
3340 2010-08-30 Roland McGrath <roland@redhat.com>
3342 Print .debug_loc/.debug_ranges with cognizance of actual DIE uses.
3343 * readelf.c (parse_opt): Add section_info to implicit_debug_sections
3345 (struct listptr, struct listptr_table): New types.
3346 (compare_listptr, reset_listptr, sort_listptr): New functions.
3347 (notice_listptr, skip_listptr_hole): New functions.
3348 (struct attrcb_args): Add silent member.
3349 (attr_callback): Call notice_listptr for loclistptr and rangelistptr.
3350 Suppress output if silent, but still call notice_listptr.
3351 (print_debug_units): Suppress output if section_info not requested.
3352 (print_debug_loc_section): Call sort_listptr, skip_listptr_hole.
3353 (print_debug_ranges_section): Likewise.
3354 (print_debug): Call reset_listptr on both tables.
3356 * readelf.c (print_debug_ranges_section): Print empty list.
3357 (print_debug_loc_section): Likewise.
3359 * readelf.c (print_debug_loc_section): Check for bogus length
3360 before calling print_ops.
3361 (print_ops): Check harder for bogus data that would read off end.
3363 2010-08-11 Roland McGrath <roland@redhat.com>
3365 * readelf.c (for_each_section_argument): Process all sections with
3366 matching name, not just the first.
3368 2010-07-26 Roland McGrath <roland@redhat.com>
3370 * readelf.c (print_ops): Take new argument for CU version.
3371 Fix DW_OP_call_ref decoding to depend on it.
3372 (print_debug_loc_section): Update caller.
3373 (print_cfa_program): Take new argument, pass it down.
3374 (print_debug_frame_section): Update caller.
3375 (struct attrcb_args): New member version.
3376 (print_debug_units): Initialize it.
3378 2010-07-02 Roland McGrath <roland@redhat.com>
3380 * readelf.c (print_debug_frame_section): Use format_dwarf_addr for
3383 2010-06-30 Roland McGrath <roland@redhat.com>
3385 * strings.c (main): Use STDIN_FILENO, not STDOUT_FILENO.
3386 Ignore st_size for a non-S_ISREG file descriptor.
3387 (read_block): Move assert after no-mmap bail-out.
3388 (read_block_no_mmap): Fix size calculations for moving buffer remnant.
3390 2010-06-22 Roland McGrath <roland@redhat.com>
3392 * readelf.c (print_debug_line_section): Fix braino in DW_LNS_set_isa.
3394 2010-06-21 Roland McGrath <roland@redhat.com>
3396 * readelf.c (dwarf_tag_string): Handle new v4 tags.
3397 (dwarf_attr_string): Add new attributes.
3398 (dwarf_tag_string): Handle DW_TAG_GNU_*.
3400 * readelf.c (print_ops): Use 64-bit types for LEB128 operands.
3401 (print_cfa_program): Likewise.
3403 2010-06-20 Roland McGrath <roland@redhat.com>
3405 * readelf.c (print_debug_units): New function, broken out of ...
3406 (print_debug_info_section): ... here. Call it.
3407 (print_debug_types_section): New function.
3408 (enum section_e): Add section_types alias for section_info.
3409 (print_debug): Add types to the sections table.
3411 * readelf.c (print_debug_frame_section): Handle version 4 format.
3413 * readelf.c (print_debug_line_section): Handle version 4 format.
3415 2010-06-14 Roland McGrath <roland@redhat.com>
3417 * unstrip.c (copy_elided_sections): Make sure all sections' data have
3418 been read in before we write anything out.
3420 2010-06-04 Roland McGrath <roland@redhat.com>
3422 * unstrip.c (update_shdr): New function.
3423 (update_sh_size): Call it instead of gelf_update_shdr.
3424 (adjust_relocs, add_new_section_symbols): Likewise.
3425 (new_shstrtab, copy_elided_sections): Likewise.
3427 * unstrip.c (copy_elided_sections): Bail if stripped file has more
3428 sections than unstripped file, rather than getting confused later.
3430 2010-06-01 Roland McGrath <roland@redhat.com>
3432 * readelf.c (dwarf_form_string): Handle DWARF 4 forms.
3433 (attr_callback): Handle DW_FORM_flag_present, DW_FORM_exprloc,
3434 DW_FORM_sec_offset, DW_FORM_ref_sig8.
3436 * readelf.c (print_debug): Don't bail if libdw setup fails.
3437 Suppress complaint if we only want .eh_frame anyway.
3439 2010-05-28 Ulrich Drepper <drepper@redhat.com>
3441 * readelf.c (attr_callback): Also print form information.
3443 2010-05-19 Roland McGrath <roland@redhat.com>
3445 * addr2line.c (find_symbol): Short-circuit on empty name.
3446 (handle_address): Handle SYMBOL with no +OFFSET.
3448 2010-05-08 Roland McGrath <roland@redhat.com>
3450 * readelf.c (print_ops): Take new arg OFFSET_SIZE.
3451 Use that for DW_OP_call_ref, not ADDRSIZE.
3452 (print_cfa_program): Update caller.
3453 (struct attrcb_args): Add offset_size field.
3454 (attr_callback): Use it for print_ops call.
3455 (print_debug_info_section): Initialize it.
3456 (print_ops): Likewise.
3458 2010-04-14 Roland McGrath <roland@redhat.com>
3460 * readelf.c (handle_core_item): Fix bitmask printing.
3462 2010-04-06 Roland McGrath <roland@redhat.com>
3464 * ld.c (options): Fix some typos in messages.
3465 * elflint.c (check_scn_group, check_group): Likewise.
3466 * ldscript.y (add_id_list): Likewise.
3467 * readelf.c (print_hash_info): Add xgettext:no-c-format magic comment
3468 before translated string containing a literal %.
3470 2010-02-26 Roland McGrath <roland@redhat.com>
3472 * readelf.c (process_file): Don't leak an fd in failure case.
3474 2010-02-15 Roland McGrath <roland@redhat.com>
3476 * Makefile.am: Use config/eu.am for common stuff.
3478 * readelf.c (print_debug_frame_section): Add a cast to avoid sign
3479 mismatch in comparison.
3481 2010-02-02 Roland McGrath <roland@redhat.com>
3483 * readelf.c (print_encoding_base): Handle DW_EH_PE_absptr (zero).
3484 (read_encoded): Likewise.
3485 (print_debug_frame_section): Check for bogus augmentation length.
3486 For P augmentation, use read_encoded, print the encoding description,
3487 and use hex for unsigned values.
3489 2010-01-15 Roland McGrath <roland@redhat.com>
3491 * ar.c: Include <sys/stat.h>.
3492 * elflint.c: Likewise.
3493 * readelf.c: Likewise.
3494 * strip.c: Likewise.
3495 * unstrip.c: Likewise
3497 2010-01-07 Roland McGrath <roland@redhat.com>
3499 * readelf.c (print_ehdr): Handle PN_XNUM.
3500 (phnum): New static variable.
3501 (process_elf_file): Set it with elf_getphdrnum.
3502 (print_phdr): Use phnum instead of EHDR->e_phnum.
3503 (print_dynamic, handle_notes): Likewise.
3504 (handle_relocs_rel, handle_relocs_rela): Likewise.
3506 * elfcmp.c (main): Use elf_getshdrnum and elf_getphdrnum.
3508 * elflint.c (phnum): New static variable.
3509 (check_elf_header): Set it, handling PN_XNUM.
3510 Use that in place of EHDR->e_phnum throughout.
3511 (check_symtab, check_reloc_shdr, check_dynamic): Likewise.
3512 (unknown_dependency_p, check_sections, check_program_header): Likewise.
3514 2010-01-05 Roland McGrath <roland@redhat.com>
3516 * readelf.c (dwarf_attr_string): Match DW_AT_GNU_vector and
3517 DW_AT_GNU_template_name.
3519 2010-01-04 Roland McGrath <roland@redhat.com>
3521 * readelf.c (handle_notes_data): Grab NT_AUXV only for name "CORE".
3522 (handle_core_note): Pass NHDR and NAME to ebl_core_note.
3523 (handle_core_item): Handle .format of '\n' as \n-separated strings.
3525 * readelf.c (implicit_debug_sections): New variable.
3526 (parse_opt): Set it instead of print_debug_sections for -a.
3527 OR them together for print_debug check.
3528 (print_debug): OR them together for section check.
3530 * readelf.c (options): Repartition into set implied by -a and others.
3531 Correct -a text to match reality.
3533 * readelf.c (struct section_argument): Add bool member 'implicit'.
3534 (parse_opt): Set it for -a cases, clear it for -x args.
3535 (for_each_section_argument): Don't complain about a missing section by
3536 name if it's implicit.
3538 2009-11-16 Roland McGrath <roland@redhat.com>
3540 * readelf.c (print_string_section): Punt SHT_NOBITS like empty
3541 sections, just as dump_data_section already does.
3543 2009-09-21 Ulrich Drepper <drepper@redhat.com>
3545 * elflint.c (special_sections): Allow MERGE and STRINGS flags to be
3546 set for .comment section.
3547 Patch by Mark Wielaard <mjw@redhat.com>.
3549 2009-09-08 Roland McGrath <roland@redhat.com>
3551 * ar.c (main): Fix typo in message format.
3553 2009-08-21 Roland McGrath <roland@redhat.com>
3555 * readelf.c (attr_callback): Use print_block only when we don't use
3558 2009-08-14 Roland McGrath <roland@redhat.com>
3560 * ar.c (do_oper_extract): Use pathconf instead of statfs.
3562 2009-08-01 Ulrich Drepper <drepper@redhat.com>
3564 * debugpred.h: Add two most const.
3566 2009-07-26 Mark Wielaard <mjw@redhat.com>
3568 * elflint.c (check_note_data): Recognize NT_GNU_GOLD_VERSION.
3570 2009-07-25 Mark Wielaard <mjw@redhat.com>
3572 * Makefile.am (addr2line_LDADD): Add $(libelf).
3574 2009-07-24 Roland McGrath <roland@redhat.com>
3576 * readelf.c (print_block): New function.
3577 (print_ops): Use it.
3578 (attr_callback): Use it for DW_FORM_block* forms.
3580 2009-07-20 Mark Wielaard <mjw@redhat.com>
3582 * readelf.c (print_ops): Add handling of DW_OP_implicit_value
3583 and DW_OP_stack_value.
3585 2009-07-14 Ulrich Drepper <drepper@redhat.com>
3587 * elflint.c (check_elf_header): Allow Linux ABI.
3588 (check_symtab): Handle STB_GNU_UNIQUE.
3590 2009-07-08 Mark Wielaard <mjw@redhat.com>
3592 * readelf.c (attr_callback): Handle DW_Form constants for
3593 DW_AT_data_member_location.
3595 2009-07-06 Roland McGrath <roland@redhat.com>
3597 * readelf.c (register_info): New function. Handle unknown register #s.
3598 (print_cfa_program): Use it.
3599 (handle_core_register, handle_core_registers): Likewise.
3601 2009-06-28 Roland McGrath <roland@redhat.com>
3603 * readelf.c (print_address_names): New static variable.
3604 (options, parse_opt): Grok -N/--numeric-addresses to clear it.
3605 (format_dwarf_addr): Don't look up name if !print_address_names.
3607 2009-06-13 Ulrich Drepper <drepper@redhat.com>
3609 * ldgeneric.c: Don't use deprecated libelf functions.
3611 * objdump.c: Likewise.
3612 * readelf.c: Likewise.
3614 * strip.c: Likewise.
3615 * unstrip.c: Likewise.
3616 * ld.h: Fix up comment.
3618 2009-06-01 Ulrich Drepper <drepper@redhat.com>
3620 * readelf.c (print_relocs): Expect ELF header argument and pass on
3621 to handle_relocs_rel* functions. Adjust caller.
3622 (handle_relocs_rel): Add ELF header argument. Add special case for
3623 the IRELATIVE relocations in statically linked executables.
3624 (handle_relocs_rela): Likewise.
3626 2009-04-29 Ulrich Drepper <drepper@redhat.com>
3628 * elflint.c (check_symtab): Add tests of st_other field.
3630 2009-04-23 Ulrich Drepper <drepper@redhat.com>
3632 * Makefile [BUILD_STATIC] (libdw): Add $(zip_LIBS).
3634 2009-04-20 Roland McGrath <roland@redhat.com>
3636 * addr2line.c (print_dwarf_function): Honor -s and -A for file names
3637 of inline call sites.
3639 * addr2line.c (just_section): New variable.
3640 (adjust_to_section): New function, broken out of ...
3641 (handle_address): ... here.
3642 (options, parse_opt): Add -j/--section=NAME to set it.
3644 2009-04-15 Roland McGrath <roland@redhat.com>
3646 * readelf.c (print_debug_frame_section): Check for DW_CIE_ID_64 in
3647 64-bit format header, DW_CIE_ID_32 in 32-bit format header.
3649 2009-04-14 Roland McGrath <roland@redhat.com>
3651 * readelf.c (print_attributes): Treat SHT_ARM_ATTRIBUTES on EM_ARM
3652 like SHT_GNU_ATTRIBUTES.
3654 * readelf.c (handle_core_registers): Fix error message.
3656 * strip.c (handle_elf: check_preserved): Don't note any change when
3657 .debug_data is already filled from a previous pass.
3659 2009-02-05 Ulrich Drepper <drepper@redhat.com>
3661 * objdump.c (show_relocs_x): Minor cleanups.
3663 * readelf.c (print_cfa_program): Correct a few labels.
3664 Print first DW_CFA_expression and DW_CFA_val_expression parameter
3667 2009-02-01 Ulrich Drepper <drepper@redhat.com>
3669 * objdump.c (show_relocs_rel, show_relocs_rela): Split common parts
3671 (show_relocs_x): ...here. New function.
3672 (show_relocs): Better spacing in output.
3674 * objdump.c (show_relocs_rela): Show offsets as signed values.
3676 * ar.c (main): Fix recognition of invalid modes for a, b, i modifiers.
3677 Improve some error messages.
3678 Use program_invocation_short_name instead of AR macro.
3679 * Makefile.am (CFLAGS_ar): Remove.
3680 * elflint.c (parse_opt): ARGP_HELP_EXIT_ERR does nothing for argp_help.
3681 * objdump.c (parse_opt): Likewise.
3682 * readelf.c (parse_opt): Likewise.
3684 2009-01-27 Roland McGrath <roland@redhat.com>
3686 * readelf.c (print_ops): Notice short length, don't overrun buffer
3687 (still need to fix LEB128).
3689 * readelf.c (print_ops): Fix DW_OP_call[24] decoding.
3691 * readelf.c (print_ops): Print (empty)\n when LEN == 0.
3693 2009-01-24 Ulrich Drepper <drepper@redhat.com>
3695 * readelf.c (print_debug_frame_section): Fix computation of vma_base
3696 for PC-relative mode.
3698 2009-01-23 Ulrich Drepper <drepper@redhat.com>
3700 * size.c (process_file): When handling archive, close file descriptor
3701 here. For unknown file format also close file descriptor.
3702 (handle_ar): Don't close file descriptor here.
3704 * readelf.c (parse_opt): Move code to add to dump_data_sections and
3705 string_sections list in local function add_dump_section. Adjust 'x'
3706 key handling. For 'a' key add .strtab, .dynstr, and .comment section
3707 to string_sections list.
3709 2009-01-22 Roland McGrath <roland@redhat.com>
3711 * readelf.c (print_phdr): Don't print section mapping when no sections.
3713 * Makefile.am (AM_CFLAGS): Pass -Wno-format for *_no_Wformat.
3715 * readelf.c (print_debug_frame_section): Initialize IS_SIGNED to false
3716 and reset it only for the 'true' cases.
3718 * Makefile.am (addr2line_no_Wformat): New variable.
3720 * readelf.c (print_debug_frame_section): Use t instead of j formats
3721 for ptrdiff_t OFFSET.
3723 2009-01-21 Ulrich Drepper <drepper@redhat.com>
3725 * elflint.c (check_program_header): Fix typo in .eh_frame_hdr section
3726 test. Handle debuginfo files.
3727 (check_exception_data): First sanity test.
3729 2009-01-17 Ulrich Drepper <drepper@redhat.com>
3731 * readelf.c (print_debug_exception_table): Show target of ar_disp
3734 * elflint.c (check_program_header): Add most consistency checks for
3735 PT_GNU_EH_FRAME entry.
3737 * addr2line.c: Use ARGP_PROGRAM_VERSION_HOOK_DEF and
3738 ARGP_PROGRAM_BUG_ADDRESS_DEF.
3740 * elfcmp.c: Likewise.
3741 * elflint.c: Likewise.
3742 * findtextrel.c: Likewise.
3745 * objdump.c: Likewise.
3746 * ranlib.c: Likewise.
3747 * readelf.c: Likewise.
3750 * strings.c: Likewise.
3751 * strip.c: Likewise.
3752 * unstrip.c: Likewise.
3754 2009-01-16 Ulrich Drepper <drepper@redhat.com>
3756 * elflint.c (check_program_header): Check that PT_GNU_EH_FRAME entry
3757 matches .eh_frame_hdr section, if it is available. Also check that
3758 the segment is allocated, not writable, not executable.
3760 * readelf.c: Add -e option. Dump exception and unwind related
3761 sections. Add -e to -a.
3762 (print_encoding_base): Handle DW_EH_PE_omit.
3763 (print_debug_exception_table): Beginning of support.
3764 (print_debug): Hook up print_debug_exception_table for
3765 .gcc_except_table sections.
3767 * readelf.c (print_debug_frame_section): Some fixes for last change.
3769 2009-01-15 Ulrich Drepper <drepper@redhat.com>
3771 * readelf.c (print_encoding): Now a toplevel function.
3772 (print_relinfo): Likewise.
3773 (print_encoding_base): Broken out of print_debug_frame_section.
3774 (print_debug_frame_section): Print different header for .eh_frame
3775 sections. Fix recognition of matching CIEs in .debug_frame sections.
3776 Print absolute offset for PC-relative FDE locations. Don't print
3777 table header for FDEs if the table is empty.
3778 (read_encoded): New function.
3779 (print_debug_frame_hdr_section): New function.
3780 (print_debug): Hook up print_debug_frame_hdr_section for .eh_frame_hdr
3783 * readelf.c (handle_relocs_rel): Print section number.
3784 (print_debug_abbrev_section): Likewise.
3785 (print_debug_aranges_section): Likewise.
3786 (print_debug_ranges_section): Likewise.
3787 (print_debug_info_section): Likewise.
3788 (print_debug_line_section): Likewise.
3789 (print_debug_loc_section): Likewise.
3790 (print_debug_macinfo_section): Likewise.
3791 (print_debug_pubnames_section): Likewise.
3792 (print_debug_str_section): Likewise.
3794 2009-01-10 Ulrich Drepper <drepper@redhat.com>
3796 * strings.c (read_block): Fix typo in error message string.
3798 2009-01-07 Ulrich Drepper <drepper@redhat.com>
3800 * ld.c (ld_new_searchdir): Fix adding to search path list.
3802 2009-01-06 Ulrich Drepper <drepper@redhat.com>
3804 * readelf.c: Implement call frame debug section dumping.
3806 2009-01-05 Roland McGrath <roland@redhat.com>
3808 * elfcmp.c: Exit with status 2 for errors (like cmp, diff, grep).
3809 Status 1 (aka EXIT_FAILURE) is only for completed OK but not equal.
3811 2009-01-01 Ulrich Drepper <drepper@redhat.com>
3813 * addr2line.c: Update copyright year.
3815 * elfcmp.c: Likewise.
3816 * elflint.c: Likewise.
3817 * findtextrel.c: Likewise.
3820 * objdump.c: Likewise.
3821 * ranlib.c: Likewise.
3822 * readelf.c: Likewise.
3824 * strings.c: Likewise.
3825 * strip.c: Likewise.
3826 * unstrip.c: Likewise.
3828 2008-12-11 Roland McGrath <roland@redhat.com>
3830 * nm.c (sym_name): New function.
3831 (show_symbols_sysv): Use it in place of elf_strptr.
3832 (show_symbols_bsd, show_symbols_posix): Likewise.
3835 * nm.c (show_symbols_sysv): Use an alloca'd backup section name when
3838 2008-12-02 Roland McGrath <roland@redhat.com>
3840 * readelf.c (count_dwflmod, process_file): Don't presume encoding of
3841 nonzero OFFSET argument to dwfl_getmodules.
3843 2008-08-07 Roland McGrath <roland@redhat.com>
3845 * addr2line.c (main): Pass string to handle_address.
3846 (see_one_module): New function, subroutine of handle_address.
3847 (find_symbol): Likewise.
3848 (handle_address): Take string argument rather than address.
3849 Convert plain number, or handle strings like "(section)+offset"
3852 2008-08-01 Roland McGrath <roland@redhat.com>
3854 * readelf.c (handle_core_item): Handle 'B' type for 1-origin bitset.
3855 For 'b' and 'B', print <x-y,z> or ~<x,y-z> rather than 1/0 string.
3857 * readelf.c (convert): Take new argument SIZE.
3858 (handle_core_register, handle_core_item): Update callers.
3859 (handle_core_item): Take new arg REPEATED_SIZE.
3860 (handle_core_items): Special case for a singleton item,
3861 let handle_core_item handle repeats if it wants to.
3863 * readelf.c (handle_core_items): Give abridged output
3864 for identical groups repeated more than twice.
3866 2008-07-04 Roland McGrath <roland@redhat.com>
3868 * readelf.c (handle_core_items): Handle ELF_T_ADDR.
3870 2008-04-10 Roland McGrath <roland@redhat.com>
3872 * strip.c (handle_elf): Don't keep sections that kept symbol tables
3873 refer to. Instead, just be sure to preserve the original symbol
3874 table in the debug file so those symbols go with their sections and
3875 can be elided from the stripped version of the symbol table.
3877 * strip.c (handle_elf): When a discarded section kept in the debug
3878 file refers to a nondiscard section via sh_link/sh_info, preserve
3879 that nondiscarded section unmodified in the debug file as well.
3880 Skip adjustment of discarded sections symbol table references when
3881 that symbol table is copied in this way.
3883 * elflint.c (check_symtab): Don't crash from missing symbol names
3884 after diagnosing bogus strtab.
3886 * strip.c (handle_elf): Cosmetic cleanup in special section contents
3887 adjustment for symtab changes.
3889 2008-03-31 Roland McGrath <roland@redhat.com>
3891 * elflint.c (check_sections): Add checks on SHF_EXECINSTR sections:
3892 must be SHT_PROGBITS, must not be SHF_WRITE. Let backend hook
3893 excuse a special section.
3895 2008-03-27 Roland McGrath <roland@redhat.com>
3897 * elflint.c (check_sections): Check that executability and writability
3898 of sections is reflected in segment p_flags.
3900 2008-03-26 Roland McGrath <roland@redhat.com>
3902 * elflint.c (check_program_header): Accept PT_GNU_RELRO p_flags
3903 that matches its PT_LOAD's p_flags &~ PF_W. On sparc, PF_X really
3906 2008-02-29 Roland McGrath <roland@redhat.com>
3908 * readelf.c (print_attributes): Add a cast.
3909 * elflint.c (check_attributes): Likewise.
3911 * unaligned.h (add_8ubyte_unaligned): Cast PTR argument for parity
3912 with [UNALIGNED_ACCESS_CLASS == BYTE_ORDER] definition.
3913 (add_4ubyte_unaligned, add_2ubyte_unaligned): Likewise.
3915 2008-02-03 Ulrich Drepper <drepper@redhat.com>
3917 * i386_ld.c (elf_i386_count_relocations): Implement R_386_TLS_GD
3918 when linked into executable.
3919 (elf_i386_create_relocations): Likewise.
3921 2008-02-20 Roland McGrath <roland@redhat.com>
3923 * readelf.c (print_attributes): New function.
3924 (process_elf_file): Call it under -A.
3926 * elflint.c (check_attributes): Implement it for real.
3928 2008-02-19 Roland McGrath <roland@redhat.com>
3930 * elflint.c (special_sections): Handle .gnu.attributes section.
3931 (check_sections): Likewise.
3932 (check_attributes): New function.
3934 2008-02-10 Roland McGrath <roland@redhat.com>
3936 * elfcmp.c (main): Ignore sh_offset differences in non-SHF_ALLOC
3937 sections and ET_REL files.
3939 2008-02-02 Ulrich Drepper <drepper@redhat.com>
3941 * elf32-i386.script: Add .eh_frame_hdr, .tdata, and .tbss sections.
3942 * i386_ld.c (elf_i386_count_relocations): Handle R_386_TLS_LDO_32
3944 (elf_i386_create_relocations): Likewise.
3945 * ld.h (struct ld_state): Add need_tls, tls_start, and tls_tcb
3947 * ldgeneric.c (add_section): If TLS section is used, set need_tls flag.
3948 (ld_generic_create_outfile): Add PT_TLS entry to program header.
3949 Fix generation of PT_GNU_STACK entry.
3951 2008-02-01 Ulrich Drepper <drepper@redhat.com>
3953 * ld.c (replace_args): Prevent loop over replacements if the parameter
3954 is only two characters long.
3956 * ld.c: Recognize sha1 argument for --build-id parameter.
3957 * ldgeneric.c (create_build_id_section): Handle sha1.
3958 (compute_hash_sum): New function. Broken out of compute_build_id.
3959 Take hash function and context as parameters.
3960 (compute_build_id): Use compute_hash_sum for md5 and the new sha1
3963 2008-01-31 Ulrich Drepper <drepper@redhat.com>
3965 * elf32-i386.script: Add .note.ABI-tag and .note.gnu.build-id sections.
3966 * ld.c: Recognize --build-id command line parameter.
3967 * ld.h: Define scn_dot_note_gnu_build_id.
3968 (struct ld_state): Add build_id and buildidscnidx elements.
3969 * ldgeneric.c: Implement --build-id command line parameter.
3970 * ldlex.l (ID): Recognize - as valid character after the first one.
3972 2008-01-29 Ulrich Drepper <drepper@redhat.com>
3974 * ld.c (replace_args): New function.
3975 (main): Use it to rewrite old-style parameters.
3977 * elf32-i386.script: Add .gnu.hash section.
3978 * ldgeneric.c (optimal_bucket_size): A tiny bit more efficient.
3979 (fillin_special_symbol): Initialize st_size.
3980 (sortfct_hashval): New function.
3981 (create_gnu_hash): New function.
3982 (create_hash): New function.
3983 (ld_generic_create_outfile): Use the new functions to create the
3986 * elflint.c (check_gnu_hash): Fix index value printed in error message.
3988 2008-01-24 Ulrich Drepper <drepper@redhat.com>
3990 * elflint.c (check_group): Check that signature symbol for section
3991 group is not an empty string.
3992 * ldgeneric.c: Remove magic assignment of indices in the dynsym
3993 section. Start implementation of --hash-style.
3994 * i386_ld.c: Likewise.
3995 * ld.c: Recognize --hash-style.
3996 * ld.h (struct scninfo): Add comdat_group.
3997 Add additional parameter to finalize_plt callback.
3999 2008-01-22 Ulrich Drepper <drepper@redhat.com>
4001 * ld.h (struct callbacks): Add initialize_gotplt.
4002 (struct scnhead): Add scn_dot_gotplt.
4003 (struct ld_state): Add gotpltscnidx.
4004 * i386_ld.c (elf_i386_initialize_plt): Minor optimization.
4005 (elf_i386_initialize_pltrel): Likewise.
4006 (elf_i386_initialize_got): There is now a separate .got.plt, so
4007 don't do the PLT-related work here. Initialize d_type.
4008 (elf_i386_initialize_gotplt): New function.
4009 (elf_i386_plt0): Use ud2a after indirect jump.
4010 (elf_i386_pic_plt0_entry): Likewise.
4011 (elf_i386_finalize_plt): Reference now .got.plt.
4012 (elf_i386_count_relocations): For GOT entries which need no relocation
4013 don't bump nrel_got.
4014 (elf_i386_create_relocations): Also get .got.plt. Rewrite R-386_GOT32
4015 handling for split .got/.got.plt.
4016 (elf_i386_ld_init): Initialize callbacks.initialize_gotplt.
4017 * elf32-i386.script: Sort sections for security. There are no .got
4018 input sections. Add .got.plt.
4019 * ldgeneric.c (ld_generic_generate_sections): Add .got.plt section.
4020 (ld_generic_create_outfile): Initialize .got.plt section.
4021 Use .got.plt address for _GLOBAL_OFFSET_TABLE_ symbol and DT_PLTGOT.
4023 2008-01-19 Ulrich Drepper <drepper@redhat.com>
4025 * i386_ld.c (elf_i386_count_relocations): PLT relocations for undefined
4026 symbols are not carried over into statically linked output files.
4027 Add dummy entries for more TLS relocations.
4029 * ld.c (options): Add long names for -( and -).
4031 * ldgeneric.c (check_definition): For newly found definitions don't
4032 mark section as used if symbol is absolute.
4033 (extract_from_archive): Only assign archive sequence number the first
4034 time the archive is handled. Update ld_state.last_archive_used
4035 if any symbol was used. Remove nround variable.
4036 (file_process2): When using symbol from an archive, update
4037 ld_state.group_start_archive, ld_state.archives, and
4038 ld_state.tailarchives.
4039 (ld_generic_file_process): If group is not handled anymore, after
4040 freeing ELF handles for the archives, clear ld_state.archives and
4041 *nextp. Fix wrong logic in recognizing first iteration of group
4042 loop. When clearing flags, also clear ld_state.group_start_archive.
4044 2008-01-11 Ulrich Drepper <drepper@redhat.com>
4046 * objdump.c (show_disasm): Adjust disassembler format string for
4049 2008-01-04 Roland McGrath <roland@redhat.com>
4051 * readelf.c (handle_core_items): Take new arg DESCSZ; if nonzero,
4052 a size greater than the items cover means multiple sets of items.
4053 (handle_core_note): Update caller.
4055 2008-01-04 Roland McGrath <roland@redhat.com>
4057 * strip.c (handle_elf): Move SHDRIDX defn to silence gcc warning.
4059 2008-01-03 Roland McGrath <roland@redhat.com>
4061 * ld.h (linked_from_dso_p): Use __attribute__ ((__gnu_inline__)).
4063 * elflint.c (check_dynamic): Remove duplicate initializer.
4065 2008-01-02 Ulrich Drepper <drepper@redhat.com>
4067 * addr2line.c: Update copyright year.
4069 * elfcmp.c: Likewise.
4070 * elflint.c: Likewise.
4071 * findtextrel.c: Likewise.
4074 * objdump.c: Likewise.
4075 * ranlib.c: Likewise.
4076 * readelf.c: Likewise.
4078 * strings.c: Likewise.
4079 * strip.c: Likewise.
4080 * unstrip.c: Likewise.
4082 2007-12-30 Ulrich Drepper <drepper@redhat.com>
4084 * objdump (show_disasm): Use %e after third parameter.
4086 2007-12-21 Ulrich Drepper <drepper@redhat.com>
4088 * strip.c: Fix wrong parenthesis in a few branch predictions.
4089 * strings.c: Likewise.
4091 2007-12-20 Ulrich Drepper <drepper@redhat.com>
4093 * Makefile.am (DEFS): Add DEBUGPRED.
4094 * addr2line.c: Include debugpred.h.
4096 * elfcmp.c: Likewise.
4097 * elflint.c: Likewise.
4098 * findtextrel.c: Likewise.
4100 * objdump.c: Likewise.
4101 * ranlib.c: Likewise.
4102 * readelf.c: Likewise.
4104 * strings.c: Likewise.
4105 * strip.c: Likewise.
4106 * unstrip.c: Likewise.
4107 * debugpred.h: New file.
4109 * readelf.c (handle_relocs_rel): Use elf_scnshndx.
4110 (handle_relocs_rela): Likewise.
4112 * readelf.c: Add lots of likely/unlikely.
4114 * elflint.c: Minor cleanups.
4116 2007-11-19 Roland McGrath <roland@redhat.com>
4118 * readelf.c (print_ops): Handle all bad op codes gracefully.
4119 Print their numbers instead of just ???.
4121 2007-11-09 Roland McGrath <roland@redhat.com>
4123 * readelf.c (attr_callback): Handle DW_AT_data_location.
4124 Handle block forms to mean a DWARF expression for DW_AT_allocated,
4125 DW_AT_associated, DW_AT_bit_size, DW_AT_bit_offset, DW_AT_bit_stride,
4126 DW_AT_byte_size, DW_AT_byte_stride, DW_AT_count, DW_AT_lower_bound,
4129 2007-10-20 Roland McGrath <roland@redhat.com>
4131 * unstrip.c (options): Update -R description.
4132 (struct symbol): Put symbol details a union with a size_t pointer
4134 (compare_symbols_output): Use null ->name as marker for discard
4135 symbols, not zero *->map.
4136 (copy_elided_sections): Record forwarding pointers for discarded
4137 duplicates and fill SYMNDX_MAP elements through them.
4139 * readelf.c (process_file): Set offline_next_address to 0 at start.
4140 (struct process_dwflmod_args): New type.
4141 (process_dwflmod): Take args in it, pass fd to process_elf_file.
4142 (process_file): Update caller; dup FD for passing to libdwfl.
4143 (process_elf_file): Take new arg FD. For ET_REL file when
4144 displaying data affected by libdwfl relocation, open a new Elf handle.
4146 2007-10-17 Roland McGrath <roland@redhat.com>
4148 * readelf.c (print_debug_line_section): For invalid data inside a
4149 unit with plausible length, keep printing at the next unit boundary.
4151 * readelf.c (attr_callback): Use dwarf_formref_die, not dwarf_formref.
4153 2007-10-16 Roland McGrath <roland@redhat.com>
4155 * readelf.c (hex_dump): Fix rounding error in whitespace calculation.
4157 2007-10-15 Roland McGrath <roland@redhat.com>
4159 * make-debug-archive.in: New file.
4160 * Makefile.am (EXTRA_DIST): Add it.
4161 (make-debug-archive): New target.
4162 (bin_SCRIPTS, CLEANFILES): Add it.
4164 2007-10-10 Roland McGrath <roland@redhat.com>
4166 * elflint.c (special_sections): Add new attrflag value exact_or_gnuld.
4167 Use it to check MERGE|STRINGS for .debug_str.
4168 (check_sections): Handle exact_or_gnuld.
4170 2007-10-08 Roland McGrath <roland@redhat.com>
4172 * readelf.c (handle_core_item): Handle 'T'|0x80 to indicate
4173 64-bit struct timeval with 32-bit tv_usec.
4175 2007-10-07 Roland McGrath <roland@redhat.com>
4177 * readelf.c (check_archive_index): New function.
4178 (process_file): Call it. Change signature to take only fd and name.
4179 Use libdwfl to open the file, then iterate on its modules (multiple
4180 for an archive) to print file name and call process_elf_file.
4181 (main): Update caller. Let process_file do elf_begin.
4182 (count_dwflmod, process_dwflmod, find_no_debuginfo): New functions.
4183 (process_elf_file): Take only Dwfl_Module * argument.
4184 Don't print the file name here.
4185 (print_debug_*_section): Take Dwfl_Module * argument.
4186 (print_debug): Likewise. Update caller.
4187 (format_dwarf_addr): New function.
4188 (print_debug_ranges_section): Use it.
4189 (attr_callback): Likewise.
4190 (print_debug_line_section, print_debug_loc_section): Likewise.
4192 * readelf.c (print_debug_ranges_section): Translate all strings.
4193 (print_debug_loc_section): Likewise.
4195 * unstrip.c (copy_elided_sections): Initialize SEC.
4197 * ar.c (do_oper_insert): Put trailing / on short names.
4199 * arlib.h (MAX_AR_NAME_LEN): Decrease by one.
4201 * arlib2.c (arlib_add_long_name): Adjust for header size.
4203 * arlib.c (arlib_finalize): Pad long name table to keep size even.
4205 * ar.c (do_oper_insert): Use write_retry for padding write.
4207 * ar.c (do_oper_insert): Initialize CUR_OFF in no_old case.
4208 Unconditionally set FOUND[CNT]->elf when setting ->mem.
4209 (remember_long_name): New function.
4210 (do_oper_insert): Call it. Correctly use length of basename,
4211 not original name. Don't store long name twice for new member.
4213 2007-10-06 Roland McGrath <roland@redhat.com>
4215 * elflint.c (check_note): Skip empty segment.
4216 (check_note_section): Skip empty section.
4218 * unstrip.c (options, parse_opt, struct arg_info): Grok -R/--relocate.
4219 (handle_output_dir_module, handle_implicit_modules): Pass it down.
4220 (handle_dwfl_module): When set, use ET_REL already loaded by Dwfl.
4221 (compare_alloc_sections): Take new arg REL, ignore address if true.
4222 (compare_sections): Likewise, pass it down.
4223 (compare_sections_rel, compare_sections_nonrel): New functions.
4224 (find_alloc_sections_prelink, copy_elided_sections): Use them
4225 instead of compare_sections.
4226 (sections_match): New function, broken out of ...
4227 (find_alloc_section): ... here.
4228 (copy_elided_sections): Reorganize section match-up logic.
4229 Use sections_match for SHF_ALLOC in ET_REL.
4230 For ET_REL, let the nonzero sh_addr from the debug file dominate.
4232 * unstrip.c (add_new_section_symbols): Take new arg REL.
4233 When true, do not update section symbol values.
4234 (collect_symbols): Likewise. Update section symbols with address
4235 of chosen output section, not original section.
4236 (check_symtab_section_symbols, copy_elided_sections): Update callers.
4238 * unstrip.c (compare_alloc_sections): At the same address, preserve
4239 original section order.
4241 * elflint.c (special_sections): Don't require MERGE|STRINGS for
4242 .debug_str, it didn't always have them with older tools.
4244 * elflint.c (check_symtab, check_one_reloc): Ignore sh_addr in ET_REL.
4246 2007-10-05 Roland McGrath <roland@redhat.com>
4248 * elflint.c (check_symtab): Allow SHN_UNDEF _GLOBAL_OFFSET_TABLE_ in
4251 * elflint.c (check_symtab): For _GLOBAL_OFFSET_TABLE_, diagnose
4252 SHN_UNDEF as "bad section". Use shndx value in messages.
4254 * elflint.c (special_sections): Add ".debug_str". Decrement namelen
4255 for ".debug" so it matches as a prefix.
4256 (IS_KNOWN_SPECIAL): New macro.
4257 (check_sections): Use it for ".plt" match. Cite wrong SHT_NOBITS
4258 type even under -d, for a .debug* or .shstrtab section.
4260 * readelf.c (print_ops): Use hex for address operand.
4262 2007-10-04 Roland McGrath <roland@redhat.com>
4264 * unstrip.c (copy_elided_sections): Initialize NDX_SECTION element for
4265 .gnu_debuglink section to SHN_UNDEF. Drop STT_SECTION symbols for
4266 sections mapped to SHN_UNDEF.
4268 2007-10-04 Ulrich Drepper <drepper@redhat.com>
4270 * readelf.c (dump_archive_index): Avoid warning about uninitialized
4271 variable with older glibc versions.
4272 Add some branch prediction.
4274 2007-10-04 Roland McGrath <roland@redhat.com>
4276 * readelf.c (print_archive_index): New variable.
4277 (options, parse_opt): Accept -c/--archive-index to set it.
4278 (dump_archive_index): New function.
4279 (process_file): Take new arg WILL_PRINT_ARCHIVE_INDEX.
4280 Call dump_archive_index on archives if set.
4281 (main): Update caller.
4282 (any_control_option): Give it file scope, moved out of ...
4283 (parse_opt): ... here.
4285 2007-10-03 Roland McGrath <roland@redhat.com>
4287 * unstrip.c (struct arg_info): Add `list' flag.
4288 (options, parse_opt): Grok -n/--list to set it.
4289 (list_module): New function.
4290 (handle_implicit_modules): Call it under -n.
4292 * elflint.c (check_note_section): New function.
4293 (check_sections): Call it for SHT_NOTE.
4295 * readelf.c (handle_notes): Use sections when available.
4297 * elflint.c (check_note_data): New function, broken out of ...
4298 (check_note): ... here. Call it and elf_getdata_rawchunk.
4300 * readelf.c (handle_auxv_note): Take offset as argument, not buffer.
4301 Use elf_getdata_rawchunk and gelf_getauxv.
4302 (handle_notes_data): New function, broken out of ...
4303 (handle_notes): ... here. Call it and elf_getdata_rawchunk.
4305 2007-10-01 Roland McGrath <roland@redhat.com>
4307 * readelf.c (hex_dump): Fix transposed subtraction generating spaces.
4309 * readelf.c (hex_dump): Fix line header to be hex instead of decimal.
4311 2007-09-10 Roland McGrath <roland@redhat.com>
4313 * readelf.c (options): Give -p optional argument, alias --string-dump.
4314 (string_sections, string_sections_tail): New static variables.
4315 (parse_opt): Set them when -p has an argument.
4316 (print_string_section): New function, broken out of ...
4317 (print_strings): ... here. Call it.
4318 (dump_data_section): New function, broken out of ...
4319 (dump_data): ... here. Call it.
4320 (for_each_section_argument): New function, broken out of ...
4321 (dump_data): ... here. Call it.
4322 (dump_strings): New function.
4324 2007-08-31 Roland McGrath <roland@redhat.com>
4326 * readelf.c (print_strings): Typo fix.
4328 2007-08-23 Roland McGrath <roland@redhat.com>
4330 * readelf.c (printf_with_wrap): Function removed.
4331 (REGISTER_WRAP_COLUMN): New macro.
4332 (handle_core_register): Use print_core_item instead.
4333 (struct register_info): New type.
4334 (compare_registers, compare_register_sets): New functions.
4335 (register_bitpos, compare_sets_by_info): New functions.
4336 (handle_core_registers): Use those to segregate and sort registers
4339 * readelf.c (ITEM_WRAP_COLUMN): New macro.
4340 (print_core_item): New function.
4341 (handle_core_item): Use it instead of printf_with_wrap.
4342 (compare_core_items, compare_core_item_groups): New functions.
4343 (handle_core_items): Use them. Sort by group and force line breaks
4346 * readelf.c (handle_core_registers, handle_core_items): New functions,
4348 (handle_core_note): ... here. Call them.
4350 2007-08-22 Roland McGrath <roland@redhat.com>
4352 * unstrip.c (new_shstrtab): New function, broken out of ...
4353 (copy_elided_sections): ... here.
4355 2007-08-20 Roland McGrath <roland@redhat.com>
4357 Avoid local function trampolines in nm binary.
4358 * nm.c (sort_by_address): Move to a static function instead of local
4359 inside show_symbols.
4360 (sort_by_name_strtab): New static variable.
4361 (sort_by_name): Use it. Move to a static function instead of local
4362 inside show_symbols.
4363 (show_symbols): Set sort_by_name_strtab.
4365 2007-08-19 Roland McGrath <roland@redhat.com>
4367 * readelf.c (handle_auxv_note): New function.
4368 (handle_notes): Call it.
4370 * readelf.c (printf_with_wrap, convert): New functions.
4371 (handle_core_item, (handle_core_register): New functions.
4372 (handle_notes): Call those with details from ebl_core_note.
4374 2007-08-12 Roland McGrath <roland@redhat.com>
4376 * elflint.c (check_note): Accept type 0 with name "Linux".
4378 * elflint.c (special_sections): Accept SHF_ALLOC for ".note".
4380 * elflint.c (section_flags_string): Return "none" for 0, not "".
4382 2007-08-11 Roland McGrath <roland@redhat.com>
4384 * elflint.c (check_note): Accept NT_GNU_HWCAP, NT_GNU_BUILD_ID.
4386 2007-08-04 Ulrich Drepper <drepper@redhat.com>
4388 * readelf.c (hex_dump): Use isprint to determine whether to print
4389 character itself or full stop character.
4390 (dump_data): No need to check endp for NULL after strtol call.
4392 2007-08-03 Roland McGrath <roland@redhat.com>
4394 * readelf.c (print_string_sections): New variable.
4395 (options, parse_opt): Handle --strings/-p to set it.
4396 (print_strings): New function.
4397 (process_elf_file): Call it under -p.
4399 * readelf.c (options): Add hidden aliases --segments, --sections,
4400 as taken by binutils readelf.
4402 2007-08-01 Roland McGrath <roland@redhat.com>
4404 * readelf.c (dump_data_sections, dump_data_sections_tail):
4406 (options, parse_opt): Handle --hex-dump/-x, set them.
4407 (hex_dump): New function.
4408 (dump_data): New function, call it.
4409 (process_elf_file): Call it.
4411 2007-07-25 Roland McGrath <roland@redhat.com>
4413 * addr2line.c (show_symbols): New variable.
4414 (print_addrsym): New function.
4415 (handle_address): Call it.
4416 (options, parse_opt): Handle -S/--symbols.
4418 2007-06-05 Ulrich Drepper <drepper@redhat.com>
4420 * addr2line.c: Update for latest autoconf header.
4422 * elfcmp.c: Likewise.
4423 * elflint.c: Likewise.
4424 * findtextrel.c: Likewise.
4426 * ldgeneric.c: Likewise.
4428 * objdump.c: Likewise.
4429 * ranlib.c: Likewise.
4430 * readelf.c: Likewise.
4432 * strings.c: Likewise.
4433 * strip.c: Likewise.
4434 * unstrip.c: Likewise.
4436 2007-05-18 Roland McGrath <roland@redhat.com>
4438 * unstrip.c (copy_elided_sections): Match up non-NOBITS sections with
4439 stripped file, so as not to duplicate a section copied in both.
4441 * strip.c (handle_elf): Keep SHT_NOTE section copies in the debug file.
4443 2007-05-17 Roland McGrath <roland@redhat.com>
4445 * unstrip.c (copy_elided_sections): Don't call gelf_newphdr for 0.
4447 * unstrip.c (handle_file): Tweak BIAS != 0 warning.
4449 * unstrip.c (handle_file): Take new arg CREATE_DIRS. If set,
4450 call make_directories here.
4451 (handle_explicit_files): Take new arg CREATE_DIRS, pass it down.
4452 (handle_dwfl_module): Likewise.
4453 (handle_implicit_modules): Update callers.
4454 (handle_output_dir_module): Likewise. Don't do make_directories here.
4456 * unstrip.c (get_section_name): New function, broken out of ...
4457 (copy_elided_sections): here. Update callers.
4458 (find_alloc_section): Broken out of ...
4459 (copy_elided_sections): ... here. Update caller.
4460 (symtab_count_leading_section_symbols): Take new arg NEWSYMDATA,
4461 update STT_SECTION symbols' st_value fields as a side effect.
4462 (check_symtab_section_symbols): Update caller.
4463 (add_new_section_symbols): Set st_value in symbols added.
4464 (collect_symbols): Reset S->value for STT_SECTION symbols recorded.
4465 Take new arg SPLIT_BSS. Adjust S->shndx recorded for symbols moved
4466 from .bss to .dynbss.
4467 (find_alloc_sections_prelink): New function. Associate debug file
4468 allocated SHT_NOBITS shdrs with stripped moved by prelink via
4469 .gnu.prelink_undo information.
4470 (copy_elided_sections): Call it when we couldn't find every allocated
4471 section. Don't use a debug file non-NOBITS section if SHF_ALLOC.
4472 Take STRIPPED_EHDR arg instead of E_TYPE and PHNUM.
4473 (handle_file): Update callers.
4475 * unstrip.c (copy_elided_sections): Ignore unfound unallocated section
4478 * elflint.c (check_sections): Fix association of segments with
4479 sections when p_memsz > p_filesz.
4481 2007-04-29 Roland McGrath <roland@redhat.com>
4483 * addr2line.c (options, main): Tweak argp group settings to fix
4486 2007-04-28 Roland McGrath <roland@redhat.com>
4488 * strip.c (handle_elf): Update debug file's SHT_NOBITS sections'
4489 sizes to match sections adjusted in the stripped file.
4491 2007-04-24 Roland McGrath <roland@redhat.com>
4493 * elfcmp.c (OPT_HASH_INEXACT): New macro.
4494 (hash_inexact): New variable.
4495 (options, parse_opt): Add --hash-inexact option to set it.
4496 (hash_content_equivalent): New function.
4497 (main): Call it for differing SHT_HASH sections under --hash-inexact.
4499 2007-04-23 Roland McGrath <roland@redhat.com>
4501 * unstrip.c: New file.
4502 * Makefile.am (bin_PROGRAMS): Add it.
4503 (unstrip_LDADD): New variable.
4505 * strip.c (options): Allow --output for -o.
4507 2007-02-15 Ulrich Drepper <drepper@redhat.com>
4509 * readelf.c: Remove unused code. Add a few consts.
4511 2007-02-15 Roland McGrath <roland@redhat.com>
4513 * readelf.c (print_debug): Fix brainos in SHDR test.
4515 2007-02-05 Roland McGrath <roland@redhat.com>
4517 * ar.c: Include <limits.h>, since we use LONG_MAX.
4519 2007-02-05 Ulrich Drepper <drepper@redhat.com>
4521 * ar.c: Add ugly hack to work around gcc complaining that we
4522 ignore fchown's return value.
4523 (do_oper_insert): Handle error when writing padding.
4524 * ranlib.c: Add fchown complain work around.
4526 * arlib.c: Make symtab a global variable. Change all users.
4527 * arlib2.c: Likewise.
4528 * ranlib.c: Likewise.
4530 * arlib.h: Declare it.
4532 2007-01-11 Roland McGrath <roland@redhat.com>
4534 * elflint.c (check_sections): Use ebl_machine_section_flag_check on
4535 SHF_MASKPROC bits separately from generic sh_flags validation.
4537 2007-02-04 Ulrich Drepper <drepper@redhat.com>
4540 * arlib.c: New file.
4541 * arlib2.c: New file.
4542 * arlib.h: New file.
4543 * Makefile (noinst_LIBRARIES): Add libar.
4544 (libar_a_SOURCES): Define.
4546 (CFLAGS_ar): Define.
4547 * ranlib.c: Change to use arlib.
4549 * elflint.c (check_symtab): Work around GNU ld bug which omits
4550 sections but not symbols in those sections.
4552 2007-01-10 Ulrich Drepper <drepper@redhat.com>
4554 * addr2line.c: Update copyright year.
4555 * elfcmp.c: Likewise.
4556 * elflint.c: Likewise.
4557 * findtextrel.c: Likewise.
4560 * objdump.c: Likewise.
4561 * ranlib.c: Likewise.
4562 * readelf.c: Likewise.
4564 * strings.c: Likewise.
4565 * strip.c: Likewise.
4567 2006-12-09 Ulrich Drepper <drepper@redhat.com>
4569 * elflint.c (compare_hash_gnu_hash): New function. Report if the
4570 two hash tables have different content (module expected omission
4571 of undefined symbols).
4573 2006-10-31 Roland McGrath <roland@redhat.com>
4575 * elflint.c (check_program_header): Don't complain about
4576 p_filesz > p_memsz if p_memsz is zero and p_type is PT_NOTE.
4578 2006-09-19 Jakub Jelinek <jakub@redhat.com>
4580 * strip.c (process_file): Disallow -f on archives.
4582 2006-10-09 Roland McGrath <roland@redhat.com>
4584 * Makefile.am (libld_elf_i386.so): Use $(LINK), not $(CC).
4586 2006-08-29 Roland McGrath <roland@redhat.com>
4588 * Makefile.am (MAINTAINERCLEANFILES): New variable.
4590 * readelf.c (handle_relocs_rel): Typo fix, test DESTSHDR properly.
4591 Reported by Christian Aichinger <Greek0@gmx.net>.
4593 * elflint.c (valid_e_machine): Add EM_ALPHA.
4594 Reported by Christian Aichinger <Greek0@gmx.net>.
4596 2006-08-08 Ulrich Drepper <drepper@redhat.com>
4598 * elflint.c (check_dynamic): Don't require DT_HASH for DT_SYMTAB.
4599 Keep track of which "high DT" entries are present.
4600 Check that either old or GNU-style hash table is present.
4601 If GNU-style hash table is used a symbol table is mandatory.
4602 Check that if any prelink entry is present all of them are.
4603 (check_gnu_hash): Only fail for undefined symbols in GNU-style hash
4604 table if they don't refer to functions.
4606 2006-07-17 Roland McGrath <roland@redhat.com>
4608 * elflint.c (struct version_namelist): Use GElf_Versym for `ndx' field.
4609 (add_version): Likewise for argument.
4610 (check_versym): Cast constant to GElf_Versym for comparison.
4612 2006-07-12 Roland McGrath <roland@redhat.com>
4614 * readelf.c (handle_gnu_hash): Add casts for machines where
4615 Elf32_Word != unsigned int.
4617 2006-07-12 Ulrich Drepper <drepper@redhat.com>
4619 * elflint.c (check_sysv_hash64): Fix printf format.
4621 2006-07-11 Roland McGrath <roland@redhat.com>
4623 * addr2line.c (options): English fix in -f doc string.
4625 * addr2line.c (use_comp_dir): New variable.
4626 (options, parse_opt): Grok -A/--absolute to set it.
4627 (handle_address): If set, prepend dwfl_line_comp_dir results to
4628 relative file names.
4630 2006-07-06 Ulrich Drepper <drepper@redhat.com>
4632 * elflint.c: Adjust for latest new hash table format.
4633 * readelf.c: Likewise.
4635 * elflint.c (check_versym): Ignore hidden bit when comparing version
4638 2006-07-05 Ulrich Drepper <drepper@redhat.com>
4640 * ldgeneric.c (ld_generic_create_outfile): Correctly recognize
4641 discarded COMDAT symbols.
4643 * i386_ld.c (elf_i386_count_relocations): Lot of corrections.
4644 (elf_i386_create_relocations): Likewise.
4645 * ld.h (struct symbol): Add local and hidden bits.
4646 * ld.c (create_special_section_symbol): These synthsized symbols
4647 are local and hidden.
4648 * ldgeneric.c (file_process2): Check whether input file matches
4650 (fillin_special_symbol): Create symbols as local and/or hidden
4652 (ld_generic_create_outfile): Make local copy of symbol.
4653 Don't hide global, defined symbols in dynamic symbol table unless
4654 requested. Synthetic symbols have no version information.
4656 * elflint.c: Add support for checking 64-bit SysV-style hash tables.
4657 * readelf.c: Add support for printing 64-bit SysV-style hash tables.
4659 2006-07-04 Ulrich Drepper <drepper@redhat.com>
4661 * elflint.c (is_rel_dyn): Fix and extend DT_RELCOUNT/DT_RELACOUNT
4664 2006-07-03 Ulrich Drepper <drepper@redhat.com>
4666 * elflint.c: Add testing of DT_GNU_HASH.
4667 * readelf.c: Implement showing histogram for DT_GNU_HASH section.
4669 * Makefile.am: Add hacks to create dependency files for non-generic
4672 2006-06-12 Ulrich Drepper <drepper@redhat.com>
4674 * ldgeneric.c (ld_generic_generate_sections): Don't create .interp
4675 section if creating a DSO and no interpreter is given.
4676 (ld_generic_create_outfile): Don't store reference to symbols in
4677 discarded COMDAT groups. Don't create PHDR and INTERP program header
4678 for DSO if no interpreter is specified.
4679 (create_verneed_data): Pretty printing.
4681 * ldscript.y (content): If a DSO is created don't set default
4682 interpreter from linker script.
4684 * i386_ld.c (elf_i386_count_relocations): Do not add relocations
4685 for symbols in discarded COMDAT groups.
4686 (elf_i386_create_relocations): Likewise.
4687 * ld.h (struct scninfo): Add unused_comdat.
4688 * ldgeneric.c (add_section): Also check group signature when
4689 matching COMDAT sections.
4690 (add_relocatable_file): Ignore symbols in COMDAT group which are
4693 * elflint.c (check_one_reloc): For *_NONE relocs only check type
4694 and symbol reference.
4696 2006-06-11 Ulrich Drepper <drepper@redhat.com>
4698 * elflint.c (check_dynamic): Fix checking value of tags which are
4699 offsets in the string section. Make sure DT_STRTAB points to the
4700 section referenced in sh_link.
4702 * ld.c (options): Add headers. Add short option 'R' for '--rpath'.
4704 * ld.c: Recognize --eh-frame-hdr option.
4705 * ld.h (struct ld_state): Add eh_frame_hdr field.
4706 * ldgeneric.c (struct unw_eh_frame_hdr): Define.
4708 * ldgeneric.c (add_section): Use ebl_sh_flags_combine instead of
4710 (add_relocatable_file): Minor optimization of last change.
4711 (match_section): Don't preserve SHF_GROUP flag any longer.
4713 2006-06-10 Ulrich Drepper <drepper@redhat.com>
4715 * ld.c (parse_z_option): Recognize execstack and noexecstack.
4716 Handle record and ignore as position dependent options.
4717 (parse_z_option_2): Handle ignore and record here.
4718 * ld.h (struct ld_state): Add execstack field.
4719 * ldgeneric.c (add_relocatable_file): Recognize .note.GNU-stack
4721 (ld_generic_create_outfile): Fix program header creation in native
4722 linker. Add PT_GNU_STACK program header.
4724 2006-06-09 Ulrich Drepper <drepper@redhat.com>
4726 * i386_ld.c (elf_i386_finalize_plt): Don't change symbol table entries
4727 for PLT entries if there is no local definition.
4729 * ld.c (parse_option): Handle -z ignore like --as-needed and
4730 -z record like --no-as-needed.
4731 * ld.h (struct ld_state): Remove ignore_unused_dsos field.
4732 * ldgeneric.c (new_generated_scn): Always compute ndt_needed by
4733 looping over DSOs. When deciding about adding DT_NEEDED entries
4734 use ->as_needed instead of ignore_unused_dsos.
4736 2006-05-31 Ulrich Drepper <drepper@redhat.com>
4738 * ld.c: Recognize --as-needed and --no-as-needed options.
4739 * ld.h (struct usedfile): Add as_needed field.
4740 (struct ld_state): Likewise.
4741 * ldgeneric.c (ld_handle_filename_list): Copy as_needed flag from
4743 * ldscript.y (filename_id_list): Split to correctly parse all
4745 (mark_as_needed): Fix loop.
4747 2006-05-28 Ulrich Drepper <drepper@redhat.com>
4749 * addr2line.c (print_dwarf_function): Use unsigned type for lineno
4752 2006-05-27 Ulrich Drepper <drepper@redhat.com>
4754 * readelf.c (handle_relocs_rela): Better notations for addon value.
4755 (print_ehdr): Distinguish e_ident[EI_VERSION] from e_version.
4757 2006-04-04 Ulrich Drepper <drepper@redhat.com>
4759 * addr2line.c: Update copyright year.
4760 * elfcmp.c: Likewise.
4761 * elflint.c: Likewise.
4762 * findtextrel.c: Likewise.
4765 * objdump.c: Likewise.
4766 * ranlib.c: Likewise.
4767 * readelf.c: Likewise.
4769 * strings.c: Likewise.
4770 * strip.c: Likewise.
4772 2006-03-09 Roland McGrath <roland@redhat.com>
4774 * Makefile.am (AM_LDFLAGS): New variable.
4776 2006-03-01 Roland McGrath <roland@redhat.com>
4778 * readelf.c (dwarf_tag_string, dwarf_attr_string): Update name tables
4779 for dwarf.h changes matching 3.0 spec.
4780 (dwarf_encoding_string, dwarf_lang_string, print_ops): Likewise.
4782 2005-12-04 Ulrich Drepper <drepper@redhat.com>
4784 * elflint.c (check_one_reloc): If relocation section is not loaded,
4785 don't check whether the relocations modify read-only sections or
4786 loaded and unloaded sections.
4788 2005-11-28 Ulrich Drepper <drepper@redhat.com>
4790 * elflint.c (check_one_reloc): Take additional parameters. Use
4791 them to determine whether relocation is valid in this type of
4792 file. DSOs and executables can contain relocation sections in
4793 unloaded sections which just show the relocations the linker
4794 applied. Adjust all callers.
4795 (check_program_header): Check that PT_PHDR is loaded and that offset
4796 matches the one in the ELF header.
4798 2005-10-26 Roland McGrath <roland@redhat.com>
4800 * nm.c (get_var_range): dwarf_getloclist -> dwarf_getlocation.
4802 2005-09-03 Ulrich Drepper <drepper@redhat.com>
4804 * strip.c (handle_elf): Unify some error messages.
4805 * ld.c (main): Likewise.
4806 * ldgeneric.c (open_elf): Likewise.
4807 * elfcmp.c (main): Likewise.
4808 * elflint.c (check_elf_header): Likewise.
4810 * size.c (process_file): Fix typo in error message.
4812 * readelf.c: Lots of little cleanups. Use _unlocked functions.
4814 2005-09-02 Ulrich Drepper <drepper@redhat.com>
4816 * strings.c (main): Reset elfmap variable after munmap call.
4817 [_MUDFLAP] (map_file): Simplify mudflap debugging by not using mmap.
4819 2005-08-28 Ulrich Drepper <drepper@redhat.com>
4821 * ranlib.c: Don't define pread_retry and write_retry here.
4823 * Makefile.an [BUILD_STATIC] (libdw): Add -ldl.
4824 (CLEANFILES): Add *.gcno *.gcda *.gconv.
4826 * strings.c (process_chunk): Reorder expressions in conditional
4827 (process_chunk_mb): Likewise.
4829 * strings.c: New file.
4830 * Makefile.am (bin_PROGRAMS): Add strings.
4831 (strings_no_Wstring): Define.
4832 (strings_LDADD): Define.
4834 2005-08-27 Roland McGrath <roland@redhat.com>
4836 * addr2line.c (dwarf_diename_integrate): Function removed.
4837 (print_dwarf_function): Use plain dwarf_diename.
4839 2005-08-24 Ulrich Drepper <drepper@redhat.com>
4841 * elflint.c (check_versym): Versioned symbols should not have
4844 2005-08-15 Ulrich Drepper <drepper@redhat.com>
4846 * elflint.c (check_versym): Allow VER_NDX_LOCAL symbols to be
4849 * Makefile.am: Add rules to build ranlib.
4850 * ranlib.c: New file.
4852 2005-08-14 Roland McGrath <roland@redhat.com>
4854 * elflint.c (check_sections): Use ebl_section_type_name and allow any
4855 sh_type it recognizes.
4857 * elflint.c (check_sections): Print unknown flags in hex, don't
4858 truncate high bits. Print section number and name for unknown type.
4860 2005-08-13 Roland McGrath <roland@redhat.com>
4862 * elflint.c (check_program_header): Use ebl_segment_type_name and
4863 allow any p_type it recognizes. Include p_type value in error
4864 message for unknown type.
4866 2005-08-13 Ulrich Drepper <drepper@redhat.com>
4868 * elflint.c (check_symtab): Simplify last change a bit. Pass ehdr
4869 to ebl_check_special_symbol.
4870 (check_sections): Pass ehdr to ebl_bss_plt_p.
4872 2005-08-12 Roland McGrath <roland@redhat.com>
4874 * elflint.c (check_symtab): Check that _GLOBAL_OFFSET_TABLE_ st_shndx
4875 refers to the right section if it's not SHN_ABS.
4876 Let ebl_check_special_symbol override _G_O_T_ value and size checks.
4878 * elflint.c (check_sections): Don't complain about a non-NOBITS
4879 section taking no segment space, if it's sh_size is 0.
4881 * elflint.c (check_sections): Use ebl_bss_plt_p to see if .plt should
4882 be PROGBITS or NOBITS.
4884 * elflint.c (check_symtab): Use ebl_check_special_symbol to override
4885 standard st_value and st_size checks.
4887 2005-07-28 Roland McGrath <roland@redhat.com>
4889 * addr2line.c (options, parse_opt): Don't handle -e here.
4890 (executable): Variable removed.
4891 (argp_children): New static variable.
4892 (argp): Use it. Make const.
4893 (main): Fill in argp_children from dwfl_standard_argp ().
4894 Let libdwfl handle file selection, pass Dwfl handle to handle_address.
4895 (print_dwarf_function): New function. Try to figure out inline chain.
4896 (elf_getname): Function removed, libdwfl does it for us.
4897 (handle_address): Take Dwfl handle instead of Elf, Dwarf handles.
4898 Use dwfl_module_addrname instead of elf_getname.
4899 Use dwfl_module_getsrc and dwfl_lineinfo instead of libdw calls.
4900 * Makefile.am (INCLUDES): Add libdwfl directory to path.
4902 2005-08-10 Ulrich Drepper <drepper@redhat.com>
4904 * strip.c (parse_opt): STATE parameter is now used.
4905 Various little cleanups.
4907 * readelf.c (print_debug_line_section): Correct fallout of renaming
4908 of DW_LNS_set_epilog_begin.
4910 2005-08-08 Roland McGrath <roland@redhat.com>
4912 * strip.c (options, parse_opt): Grok -R .comment for compatibility
4913 with binutils strip. Likewise -d, -S, as aliases for -g.
4914 Likewise ignore -s/--strip-all.
4916 2005-08-07 Roland McGrath <roland@redhat.com>
4918 * strip.c (process_file): Open read-only when using a different output
4921 2005-08-06 Ulrich Drepper <drepper@redhat.com>
4923 * elflint.c (in_nobits_scn): New function.
4924 (check_versym): Allow references for defined symbols against versions
4925 of other DSOs also for symbols in nobits sections.
4926 Move a few variables around.
4928 * Makefile.am (AM_CFLAGS): Avoid duplication.
4929 Link with statis libs if BUILD_STATIC.
4931 2005-08-05 Ulrich Drepper <drepper@redhat.com>
4933 * elflint.c: Many, many more tests. Mostly related to symbol
4934 versioning. Those sections should now be completely checked.
4936 * readelf.c (print_dynamic): Use gelf_offscn.
4938 2005-08-04 Ulrich Drepper <drepper@redhat.com>
4940 * elflint.c: Add lots more tests: more extension symbol table sanity,
4941 versioning section tests, hash table tests. General cleanup.
4943 2005-08-02 Ulrich Drepper <drepper@redhat.com>
4945 * objdump.c: New file.
4946 * Makefile.am (bin_PROGRAMS): Add objdump.
4947 (objdump_LDADD): Define.
4949 * elflint.c (check_reloc_shdr): New function split out from check_rela
4951 (check_one_reloc): New function. Likewise.
4952 (check_rela): Use check_reloc_shdr and check_one_reloc.
4953 (check_rel): Likewise.
4954 (check_program_header): Check that PT_DYNAMIC entry matches .dynamic
4956 Add checks that relocations against read-only segments are flagged,
4957 that the text relocation flag is not set unnecessarily, and that
4958 relocations in one section are either against loaded or not-loaded
4961 2005-08-01 Ulrich Drepper <drepper@redhat.com>
4963 * elfcmp.c (main): Ignore section count and section name string table
4966 2005-07-27 Roland McGrath <roland@redhat.com>
4968 * elfcmp.c: Include <locale.h>.
4970 2005-07-27 Ulrich Drepper <drepper@redhat.com>
4972 * elfcmp.c: Print name and index of differing section.
4974 2005-07-24 Ulrich Drepper <drepper@redhat.com>
4976 * elfcmp.c: Implement comparing gaps between sections.
4978 2005-07-23 Ulrich Drepper <drepper@redhat.com>
4980 * elflint.c: Include libeblP.h instead of libebl.h.
4982 * readelf.c: Likewise.
4983 * elfcmp.c: Likewise.
4985 * elfcmp.c (main): Compare individual ELF header fields, excluding
4986 e_shoff instead of the whole struct at once.
4987 Use ebl_section_strip_p instead of SECTION_STRIP_P.
4988 * strip.c: Use ebl_section_strip_p instead of SECTION_STRIP_P.
4990 2005-07-22 Ulrich Drepper <drepper@redhat.com>
4992 * elfcmp.c (main): Take empty section into account when comparing
4995 * elflint.c (check_dynamic): Check that d_tag value is >= 0 before
4998 2005-07-21 Ulrich Drepper <drepper@redhat.com>
5000 * elfcmp.c: New file.
5001 * Makefile.am (bin_PROGRAMS): Add elfcmp.
5002 (elfcmp_LDADD): Define.
5004 * elflint.c (check_rela): Check that copy relocations only reference
5005 object symbols or symbols with unknown type.
5006 (check_rel): Likewise.
5008 2005-06-08 Roland McGrath <roland@redhat.com>
5010 * readelf.c (print_ops): Add consts.
5012 2005-05-31 Roland McGrath <roland@redhat.com>
5014 * readelf.c (print_debug_abbrev_section): Don't bail after first CU's
5015 abbreviations. Print a header line before each CU section.
5017 * readelf.c (print_debug_loc_section): Fix indentation for larger
5020 2005-05-30 Roland McGrath <roland@redhat.com>
5022 * readelf.c (print_debug_line_section): Print section offset of each
5023 CU's table, so they are easy to find from seeing the stmt_list value.
5025 * readelf.c (dwarf_attr_string): Add all attributes in <dwarf.h>.
5026 (attr_callback): Grok DW_AT_ranges and print offset in hex.
5028 * readelf.c (attr_callback): Add 2 to addrsize * 2 for %#0* format.
5029 (print_debug_ranges_section, print_debug_loc_section): Likewise.
5031 * readelf.c (print_ops): Take different args for indentation control.
5032 (attr_callback): Caller updated.
5033 Grok several more block-form attributes as being location expressions.
5034 For those same attributes with udata forms, format output differently
5035 for location list offset.
5036 (print_debug_loc_section): Implement it for real.
5038 * readelf.c (options): Mention ranges for --debug-dump.
5039 (enum section_e): Add section_ranges.
5040 (parse_opt): Grok "ranges" for -w/--debug-dump.
5041 (print_debug_ranges_section): New function.
5042 (print_debug): Handle .debug_ranges section.
5044 2005-05-30 Ulrich Drepper <drepper@redhat.com>
5046 * readelf.c (handle_notes): At least x86-64 need not have the note
5047 section values aligned to 8 bytes.
5049 2005-05-18 Ulrich Drepper <drepper@redhat.com>
5051 * readelf.c (dwarf_tag_string): Add new tags.
5053 2005-05-08 Roland McGrath <roland@redhat.com>
5055 * strip.c (handle_elf): Don't translate hash and versym data formats,
5056 elf_getdata already did it for us.
5058 2005-05-07 Ulrich Drepper <drepper@redhat.com>
5060 * Makefile.am (findtextrel_LDADD): Add $(libmudflap).
5061 (addr2line_LDADD): Likewise.
5063 2005-05-03 Roland McGrath <roland@redhat.com>
5065 * strip.c (handle_elf): Apply symbol table fixups to discarded
5066 relocation sections when they are being saved in the debug file.
5068 * strip.c (handle_elf): Pass EHDR->e_ident[EI_DATA] to gelf_xlatetom
5069 and gelf_xlatetof, not the native byte order.
5071 * strip.c (parse_opt): Give error if -f or -o is repeated.
5072 (main): Exit if argp_parse returns nonzero.
5074 * strip.c (debug_fname_embed): New variable.
5075 (options, parse_opt): New option -F to set it.
5077 2005-05-07 Ulrich Drepper <drepper@redhat.com>
5079 * readelf.c (parse_opt): Make any_control_option variable
5080 local. Simplify some tests.
5082 2005-05-03 Roland McGrath <roland@redhat.com>
5084 * strip.c (crc32_file): Function removed (now in ../lib).
5086 2005-05-03 Roland McGrath <roland@redhat.com>
5088 * elflint.c (is_debuginfo): New variable.
5089 (options, parse_opt): New option --debuginfo/-d to set it.
5090 (check_sections): If is_debuginfo, don't complain about SHT_NOBITS.
5091 (check_note): If is_debuginfo, don't try to get note contents.
5093 2005-04-24 Ulrich Drepper <drepper@redhat.com>
5095 * readelf.c (print_debug_abbrev_section): Don't print error when end of
5098 2005-04-14 Ulrich Drepper <drepper@redhat.com>
5100 * readelf.c (dwarf_encoding_string): New function.
5101 (dwarf_inline_string): New function.
5102 (dwarf_access_string): New function.
5103 (dwarf_visibility_string): New function.
5104 (dwarf_virtuality_string): New function.
5105 (dwarf_identifier_case_string): New function.
5106 (dwarf_calling_convention_string): New function.
5107 (dwarf_ordering_string): New function.
5108 (dwarf_discr_list_string): New function.
5109 (attr_callback): Decode man more attribute values.
5111 2005-04-01 Ulrich Drepper <drepper@redhat.com>
5113 * addr2line.c: Finish implementation of -f option.
5115 2005-03-29 Ulrich Drepper <drepper@redhat.com>
5117 * addr2line.c: New file.
5118 * Makefile.am (bin_PROGRAMS): Add addr2line.
5119 Define addr2line_LDADD.
5121 * findtextrel.c: Use new dwarf_addrdie function.
5123 * findtextrel.c: Fix usage message and re-add accidentally removed
5126 2005-03-28 Ulrich Drepper <drepper@redhat.com>
5128 * findtextrel.c: New file.
5129 * Makefile: Add rules to build findtextrel.
5131 2005-02-15 Ulrich Drepper <drepper@redhat.com>
5133 * ldlex.l: Provide ECHO definition to avoid warning.
5135 * elflint.c (check_program_header): Fix typo in RELRO test.
5137 * Makefile.am (AM_CFLAGS): Add more warning options.
5138 * elflint.c: Fix warnings introduced by the new warning options.
5139 * i386_ld.c: Likewise.
5142 * ldgeneric.c: Likewise.
5144 * readelf.c: Likewise.
5145 * sectionhash.c: Likewise.
5147 * string.c: Likewise.
5149 2005-02-05 Ulrich Drepper <drepper@redhat.com>
5151 * Makefile.am: Check for text relocations in constructed DSOs.
5153 * Makefile.am [MUDFLAP] (AM_CFLAGS): Add -fmudflap. Link all apps
5156 * ldscript.y: Add as_needed handling.
5157 * ldlex.l: Recognize AS_NEEDED token.
5158 * ld.h (struct filename_list): Add as_needed flag.
5160 2005-02-04 Ulrich Drepper <drepper@redhat.com>
5162 * elflint.c (check_symtab): Correctly determine size of GOT section.
5164 2005-01-19 Ulrich Drepper <drepper@redhat.com>
5166 * ld.c: Remove unnecessary more_help function. Print bug report
5168 * strip.c: Likewise.
5171 * readelf.c: Likewise.
5172 * elflint.c: Likewise.
5174 * elflint.c (main): Don't check for parameter problems here.
5175 (parse_opt): Do it here, where we get informed about some of them
5178 * readelf.c (main): Don't check for parameter problems here.
5179 (parse_opt): Do it here, where we get informed about some of them
5182 2005-01-11 Ulrich Drepper <drepper@redhat.com>
5184 * strip.c: Update copyright year.
5185 * readelf.c: Likewise.
5189 * elflint.c: Likewise.
5191 * elflint.c (check_symtab): Don't warn about wrong size for
5192 _DYNAMIC and __GLOBAL_OFFSET_TABLE__ for --gnu-ld.
5194 2004-10-05 Ulrich Drepper <drepper@redhat.com>
5196 * readelf.c (print_phdr): In section mapping, also indicate
5197 sections in read-only segments.
5199 2004-09-25 Ulrich Drepper <drepper@redhat.com>
5201 * readelf.c: Make compile with gcc 4.0.
5202 * strip.c: Likewise.
5204 2004-08-16 Ulrich Drepper <drepper@redhat.com>
5206 * strip.c (handle_elf): Rewrite dynamic memory handling to use of
5207 allocate to work around gcc 3.4 bug.
5209 2004-01-25 Ulrich Drepper <drepper@redhat.com>
5211 * ldlex.l (invalid_char): Better error message.
5213 2004-01-23 Ulrich Drepper <drepper@redhat.com>
5215 * readelf.c: Print SHT_GNU_LIBLIST sections.
5217 * none_ld.c: New file.
5219 2004-01-21 Ulrich Drepper <drepper@redhat.com>
5221 * Makefile.am: Enable building of machine specific linker.
5223 2004-01-20 Ulrich Drepper <drepper@redhat.com>
5225 * Makefile.am: Support building with mudflap.
5227 * i386_ld.c: Fix warnings gcc 3.4 spits out.
5228 * ldgeneric.c: Likewise.
5229 * ldscript.y: Likewise.
5230 * readelf.c: Likewise.
5231 * strip.c: Likewise.
5233 * readelf.c (print_debug_line_section): Determine address size
5236 2004-01-19 Ulrich Drepper <drepper@redhat.com>
5238 * readelf.c (print_phdr): Show which sections are covered by the
5241 * elflint.c (check_program_header): Check PT_GNU_RELRO entry.
5243 * readelf.c (print_debug_macinfo_section): Implement.
5245 2004-01-18 Ulrich Drepper <drepper@redhat.com>
5247 * readelf.c (print_debug_line_section): Implement.
5249 2004-01-17 Ulrich Drepper <drepper@redhat.com>
5251 * src/elflint.c: Use PACKAGE_NAME instead of PACKAGE.
5252 * src/ld.c: Likewise.
5253 * src/nm.c: Likewise.
5254 * src/readelf.c: Likewise.
5255 * src/size.c: Likewise.
5256 * src/strip.c: Likewise.
5258 * strip.c: Add a few more unlikely. Reduce scope of some variables.
5260 * Makefile.am: Support building with mudflap.
5262 2004-01-16 Ulrich Drepper <drepper@redhat.com>
5264 * readelf.c (print_debug_info_section): Free dies memory.
5266 * readelf.c: Print .debug_info section content.
5268 2004-01-13 Ulrich Drepper <drepper@redhat.com>
5270 * readelf.c (print_shdr): Add support for SHF_ORDERED and SHF_EXCLUDE.
5272 2004-01-12 Ulrich Drepper <drepper@redhat.com>
5274 * readelf.c (print_debug_aranges): Implement using libdw.
5276 2004-01-11 Ulrich Drepper <drepper@redhat.com>
5278 * nm.c: Adjust for Dwarf_Files type and dwarf_lineno interface change.
5280 * readelf.c: Use libdw instead of libdwarf. Not all of the old
5281 behavior is available yet.
5282 * Makefile.am: Link readelf with libdw. Remove libdwarf include path.
5284 2004-01-09 Ulrich Drepper <drepper@redhat.com>
5286 * nm.c (get_local_names): Adjust call to dwarf_nextcu.
5288 * nm.c: Implement getting information about local variables.
5290 2004-01-07 Ulrich Drepper <drepper@redhat.com>
5292 * nm.c: Read also debug information for local symbols.
5294 2004-01-05 Ulrich Drepper <drepper@redhat.com>
5296 * nm.c: Shuffle dwarf handling code around so the maximum column
5297 width can be computed ahead of printing. Avoid collection symbols
5298 which are not printed anyway.
5300 * nm.c: Rewrite dwarf handling to use libdw.
5301 * Makefile.am (AM_CFLAGS): Add -std parameter.
5302 (INCLUDES): Find header in libdw subdir.
5303 (nm_LDADD): Replace libdwarf with libdw.
5305 * elflint.c: Update copyright year.
5306 * readelf.c: Likewise.
5308 * strip.c: Likewise.
5311 2003-12-31 Ulrich Drepper <drepper@redhat.com>
5313 * strip.c (process_file): Close file before returning.
5315 2003-11-19 Ulrich Drepper <drepper@redhat.com>
5317 * readelf.c (handle_dynamic): Make column for tag name wider.
5319 2003-09-29 Ulrich Drepper <drepper@redhat.com>
5321 * readelf.c (handle_dynamic): Always terminate tag name with a space.
5323 2003-09-25 Ulrich Drepper <drepper@redhat.com>
5325 * strip.c (process_file): Don't mmap the input file, we modify the
5326 data structures and don't want the change end up on disk.
5328 2003-09-23 Jakub Jelinek <jakub@redhat.com>
5330 * unaligned.h (union u_2ubyte_unaligned,
5331 union u_4ubyte_unaligned, union u_8ubyte_unaligned): Add
5333 (add_2ubyte_unaligned, add_4ubyte_unaligned,
5334 add_8ubyte_unaligned): Avoid nesting bswap_NN macros.
5335 Read/store value through _ptr->u instead of *_ptr.
5337 2003-09-22 Ulrich Drepper <drepper@redhat.com>
5339 * size.c (show_sysv): Change type of maxlen to int.
5341 * strip.c (handle_elf): Handle the 64-bit archs which is 64-bit
5344 * i386_ld.c: Many many fixes and extensions.
5346 * ldgeneric.c: Likewise.
5348 2003-08-16 Ulrich Drepper <drepper@redhat.com>
5350 * ldgeneric.c (check_definition): Don't add symbol on dso_list if
5351 the reference is from another DSO.
5353 2003-08-15 Ulrich Drepper <drepper@redhat.com>
5355 * ldgeneric.c (find_entry_point): It is no fatal error if no entry
5356 point is found when creating a DSO.
5358 2003-08-14 Ulrich Drepper <drepper@redhat.com>
5360 * ld.c (main): Always call FLAG_UNRESOLVED.
5361 * ldgeneric.c (ld_generic_flag_unresolved): Only complain about
5362 undefined symbols if not creating DSO or ld_state.nodefs is not set.
5364 2003-08-13 Ulrich Drepper <drepper@redhat.com>
5366 * Makefile.in: Depend on libebl.a, not libebl.so.
5368 * ld.c (main): Mark stream for linker script as locked by caller.
5369 (read_version_script): Likewise.
5370 * ldlex.c: Define fread and fwrite to _unlocked variant.
5372 * i386_ld.c (elf_i386_finalize_plt): Replace #ifdefs with uses of
5374 * unaligned.h: Define target_bswap_16, target_bswap_32, and
5376 (store_2ubyte_unaligned, store_4ubyte_unaligned,
5377 store_8ubyte_unaligned): Define using new macros.
5379 2003-08-12 Ulrich Drepper <drepper@redhat.com>
5381 * i386_ld.c (elf_i386_finalize_plt): Use packed structs to access
5382 possibly unaligned memory. Support use of big endian machines.
5384 2003-08-11 Ulrich Drepper <drepper@redhat.com>
5386 * Moved to CVS archive.