1 2023-01-10 Mark Wielaard <mark@klomp.org>
3 * readelf.c (get_debug_elf_data): New function.
4 (print_debug_abbrev_section): Use get_debug_elf_data.
5 (print_debug_addr_section): Likewise.
6 (print_debug_aranges_section): Likewise.
7 (print_debug_rnglists_section): Likewise.
8 (print_debug_ranges_section): Likewise.
9 (print_debug_frame_section): Likewise.
10 (print_debug_units): Likewise.
11 (print_debug_line_section): Likewise.
12 (print_debug_loclists_section): Likewise.
13 (print_debug_loc_section): Likewise.
14 (print_debug_macinfo_section): Likewise.
15 (print_debug_macro_section): Likewise.
16 (print_debug_str_section): Likewise.
17 (print_debug_str_offsets_section): Likewise.
18 (print_debug_pubnames_section): Likewise.
20 2022-12-21 Shahab Vahedi <shahab@synopsys.email>
22 * elflint.c (valid_e_machine): Add EM_ARCV2.
24 2022-12-02 Hengqi Chen <hengqi.chen@gmail.com>
26 * elflint.c (valid_e_machine): Add EM_LOONGARCH.
28 2022-11-03 Mark Wielaard <mark@klomp.org>
30 * readelf.c (get_dynscn_addrs): Check gelf_getdyn doesn't
33 2022-11-03 Mark Wielaard <mark@klomp.org>
35 * readelf.c (handle_dynamic): Check phdr != NULL when
36 use_dynamic_segment, otherwise check shdr != NULL.
38 2022-10-28 Arsen Arsenović <arsen@aarsen.me>
40 * readelf.c (options): Add Binutils-style --syms alias.
42 2022-10-19 Mark Wielaard <mark@klomp.org>
44 * readelf.c (dwarf_loc_list_encoding_string): Handle
46 (print_debug_loclists_section): Likewise.
48 2022-09-20 Yonggang Luo <luoyonggang@gmail.com>
50 * arlib.h: Use BYTE_ORDER, LITTLE_ENDIAN and BIG_ENDIAN.
52 2022-08-28 Mark Wielaard <mark@klomp.org>
54 * ar.c (do_oper_extract): Predecrement instance before compare
56 (do_oper_delete): Likewise.
58 2022-08-10 Andreas Schwab <schwab@suse.de>
60 * readelf.c (print_attributes): Also handle SHT_RISCV_ATTRIBUTES.
62 2022-08-09 Andreas Schwab <schwab@suse.de>
64 * elflint.c (check_program_header): Don't complain about p_filesz
65 > p_memsz if p_memsz is zero and p_type is PT_RISCV_ATTRIBUTES.
67 2022-08-01 Mark Wielaard <mark@klomp.org>
69 * readelf.c (handle_dynamic): Pass start of buffer to memrchr.
70 Use dyn->d_un.d_val for offsets instead of d_ptr.
72 2022-04-28 Di Chen <dichen@redhat.com>
74 * readelf.c (options): Add use-dynamic 'D'.
75 (use_dynamic_segment): New static bool.
77 (get_dynscn_strtab): New function.
78 (get_dynscn_addrs): Likewise.
79 (find_offsets): Likewise.
80 (parse_opt): Handle 'D'.
81 (handle_dynamic): New argument phdr. Get data either through the shdr
82 or phdr. Print segment info when use_dynamic_segment. Use
83 get_dynscn_strtab. Get library name and paths through strtab_data.
85 2022-05-09 Mark Wielaard <mark@klomp.org>
87 * strip.c (remove_debug_relocations): Check gelf_getshdr, gelf_getrela,
88 gelf_getrel and gelf_getsymshndx don't return NULL.
90 2022-05-10 Mark Wielaard <mark@klomp.org>
92 * elfcompress.c (process_file): Sanity check shstrtab_name,
93 shstrtab_newname and symstrents are only set once.
95 2022-04-24 Mark Wielaard <mark@klomp.org>
97 * elfclassify.c (main): Use classify_flag_no_stdin for no-std in options.
99 2022-04-19 Mark Wielaard <mark@klomp.org>
101 * readelf.c (get_dyn_ents): Define dyn_mem outside the while loop.
103 2022-03-01 Di Chen <dichen@redhat.com>
105 * readelf.c (get_dyn_ents): New function.
106 (handle_dynamic): Use get_dyn_ents to get the actual number of
107 Dynamic entries in the section.
109 2022-03-27 Mark Wielaard <mark@klomp.org>
111 * addr2line.c: Replace error (EXIT_FAILURE, ...) with error_exit(...).
114 * elfcompress.c: Likewise.
116 * objdump.c: Likewise.
117 * readelf.c: Likewise.
119 * strings.c: Likewise.
121 * unstrip.c: Likewise.
123 2022-03-24 Mark Wielaard <mark@klomp.org>
125 * elflint.c (check_note_data): Recognize NT_FDO_PACKAGING_METADATA.
127 2022-03-11 Mark Wielaard <mark@klomp.org>
129 * addr2line.c (OPT_RELATIVE): New constant.
130 (options): Add --relative.
131 (use_comp_dir): Initialize to true.
132 (parse_opt): Handle OPT_RELATIVE.
134 2021-12-04 Mark Wielaard <mark@klomp.org>
136 * readelf.c (print_ehdr): Pass sizeof (buf) - 1 to strncpy.
138 2021-10-20 John M Mellor-Crummey <johnmc@rice.edu>
140 * readelf.c (print_debug_line_section): Try to read
141 debug_str_offset if available. Handle DW_LNE_NVIDIA_inlined_call
142 and DW_LNE_NVIDIA_set_function_name.
144 2021-10-06 Mark Wielaard <mark@klomp.org>
146 * elflint.c (check_sections): Don't dereference databits if bad.
148 2021-09-09 Dmitry V. Levin <ldv@altlinux.org>
150 * findtextrel.c: Include "libeu.h".
151 (open_rootdir_file): New function.
152 (process_file): Use it to open file inside rootdir.
153 * Makefile.am (findtextrel_no_Wstack_usage): Remove.
155 2021-09-06 Dmitry V. Levin <ldv@altlinux.org>
157 * objdump.c (show_disasm): Replace asprintf followed by
158 error(EXIT_FAILURE) with xasprintf.
159 * readelf.c (handle_gnu_hash): Likewise.
160 * unstrip.c (handle_output_dir_module, main): Likewise.
162 * elflint.c (check_sections): Remove cast of xcalloc return value.
163 * findtextrel.c (process_file): Remove casts of malloc and realloc
165 * nm.c (get_local_names, show_symbols_sysv, show_symbols): Remove
166 casts of xmalloc return values.
167 * readelf.c (print_hash_info, handle_sysv_hash, handle_sysv_hash64,
168 handle_gnu_hash): Remove cast of xcalloc return value.
169 (print_debug_units): Remove casts of xmalloc return values.
170 * strip.c (handle_elf): Remove casts of xcalloc and xmalloc return
173 2021-09-05 Dmitry V. Levin <ldv@altlinux.org>
175 * Makefile.am (AM_LDFLAGS): Add $(STACK_USAGE_NO_ERROR).
177 2021-08-20 Saleem Abdulrasool <abdulras@google.com>
179 * elfclassify.c: Remove error.h include.
181 2021-03-18 Timm Bäder <tbaeder@redhat.com>
183 * readelf.c (run_advance_pc): New static inline function
185 (print_debug_line_section): ... here. Define advance_pc
186 using run_advance_pc.
188 2021-07-03 Mark Wielaard <mark@klomp.org>
190 * readelf.c (compare_listptr): Fix dwarf_attr_name argument.
192 2021-06-18 Mark Wielaard <mark@klomp.org>
194 * unstrip.c (adjust_relocs): Check gelf_getrel and geld_getrela.
196 2021-06-18 Mark Wielaard <mark@klomp.org>
198 * strip.c (remove_debug_relocations): Check gelf_update results.
199 (update_section_size): Likewise.
201 2021-06-06 Sergei Trofimovich <slyfox@gentoo.org>
203 * elflint.c (buffer_left): Mark as 'static' to avoid external linkage
206 2021-05-12 Dmitry V. Levin <ldv@altlinux.org>
208 * elfcompress.c (process_file): Return 1 instead of -1 in case of an
211 * elfcompress.c (process_file): Remove redundant assignment in case of
214 * elfcompress.c (process_file): Set res to 0 in case of "Nothing to do".
216 2021-04-19 Martin Liska <mliska@suse.cz>
218 * elfclassify.c (run_classify): Use startswith.
219 * elfcompress.c (process_file): Likewise.
220 * nm.c (show_symbols_sysv): Likewise.
221 * readelf.c (print_debug): Likewise.
222 (handle_notes_data): Likewise.
223 (dump_data_section): Likewise.
224 (print_string_section): Likewise.
225 * strip.c (remove_debug_relocations): Likewise.
227 2021-04-03 Mark Wielaard <mark@klomp.org>
229 * nm.c (show_symbols): close dwfl_fd if dwfl_begin fails.
231 2021-04-03 Mark Wielaard <mark@klomp.org>
233 * unstrip.c (handle_output_dir_module): Free output_file when done.
235 2021-04-03 Mark Wielaard <mark@klomp.org>
237 * ar.c (do_oper_insert): Always close newfd.
239 2021-03-03 Mark Wielaard <mark@klomp.org>
241 * readelf.c (handle_symtab): Sanity check verneed vna_next,
242 vn_next and verdef vd_next offsets.
244 2021-03-02 Timm Bäder <tbaeder@redhat.com>
246 * elfcompress.c (process_file): Remove cleanup() function and
247 replace it with a cleanup label at the end of the function.
248 Initialize res to -1.
250 2021-02-17 Timm Bäder <tbaeder@redhat.com>
252 * elfcompress.c (process_file): Move get_sections function...
253 (get_section): ...to top-level static function taking an
254 sections array and shnum.
256 2021-02-17 Timm Bäder <tbaeder@redhat.com>
258 * elfcompress.c (process_file): Move get_section function...
259 (get_section): ...to top-level static function taking an
262 2021-02-17 Timm Bäder <tbaeder@redhat.com>
264 * elfcompress.c (process_file): Move set_section function...
265 (set_section): ...to top-level static function taking a
268 2021-02-17 Timm Bäder <tbaeder@redhat.com>
270 * unstrip.c (handle_implicit_modules): Inline the next function
271 in three places. This is simply dwfl_getmodules with match_module
272 callback providing mmi.
274 2021-02-17 Timm Bäder <tbaeder@redhat.com>
276 * unstrip.c (handle_explicit_files): Move warn function...
277 (warn): ...here as top-level static function taking stripped,
278 unstripped files and force flag as extra arguments.
280 2021-02-17 Timm Bäder <tbaeder@redhat.com>
282 * unstrip.c (copy_elided_sections): Inline find_unalloc_section
283 function into calling location. The sec pointer is set to NULL
284 before the if-else statement and only set when match is found.
286 2021-02-17 Timm Bäder <tbaeder@redhat.com>
288 * unstrip.c (find_alloc_sections_prelink): Move check_match to...
289 (check_match): Adjusted to return whether there was no match,
290 which indicates a failure. So callers are adjusted to or the
291 result into a local fail boolean.
293 2021-02-17 Timm Bäder <tbaeder@redhat.com>
295 * unstrip.c (adjust_relocs): Move adjust_reloc function to...
296 (adjust_reloc): ... here as static top-level function taking
297 a map array and size as extra arguments.
299 2021-02-17 Timm Bäder <tbaeder@redhat.com>
301 * elflint.c (check_attributes): Rename and move left function...
302 (buffer_left): ...as static toplevel function taking both an
303 Elf_Data pointer argument and the unsigned char pointer p.
305 2021-02-17 Timm Bäder <tbaeder@redhat.com>
307 * elflint.c (check_attributes): Rename and move pos function...
308 (buffer_pos): ...as static toplevel function taking an extra
309 Elf_Data pointer argument.
311 2021-02-12 Mark Wielaard <mark@klomp.org>
313 * readelf.c (print_debug_units): Type DIE offset is from start CU.
315 2021-02-12 Mark Wielaard <mark@klomp.org>
317 * readelf.c (attr_callback): Don't handle blocks as expression
318 blocks for DWARF version 4 or higher.
320 2021-02-03 Timm Bäder <tbaeder@redhat.com>
322 * ar.c (do_oper_extract): Extract should_truncate_fname function
324 (should_truncate_fname): ...here. New file scope function taking
325 size_t pointer to be read and/or set.
327 2021-02-02 Timm Bäder <tbaeder@redhat.com>
329 * readelf.c (print_debug_line_section): Remove unnecessary
330 show_op_index variable, replace with (op_index > 0).
332 2021-01-08 Timm Bäder <tbaeder@redhat.com>
334 * readelf.c (print_cfa_program): Lift regname function to...
335 (regname): ...here. New file scope function add ebl and regnamebuf
338 2021-01-08 Timm Bäder <tbaeder@redhat.com>
340 * readelf.c (print_attributes): Lift left function to...
341 (left): ...here. New file scope function taking Elf_Data and char
344 2021-01-08 Timm Bäder <tbaeder@redhat.com>
346 * readelf.c (handle_core_registers): Lift same_set function to...
347 (same_set): ...here. New file scope function adding regs and
350 2021-01-08 Timm Bäder <tbaeder@redhat.com>
352 * readelf.c (parse_opt): Lift add_dump_section function to...
353 (add_dump_section): ...here. New top level function. Added key
356 2021-01-08 Timm Bäder <tbaeder@redhat.com>
358 * arlib-argp.c (help_filter): Lift text_for_default function to...
359 (text_for_default): ... here. New file scope function taking text
362 2021-01-08 Timm Bäder <tbaeder@redhat.com>
364 * addr2line.c (handle_address): Move show_note and show_int up to
366 (show_note: New static inline function.
367 (show_int): Likewise.
369 2021-01-08 Timm Bäder <tbaeder@redhat.com>
371 * strip.c (handle_elf): Remove no_symtab_updates function and
372 calls inside the switch statement. Add checks and (possibly)
373 continue, before switch statement is called.
375 2021-01-08 Timm Bäder <tbaeder@redhat.com>
377 * strip.c (handle_elf): Move inlined update_section_size function
379 (update_section_size): ...here. New static function that takes as
380 extra arguments the Elf_Scn, debug_elf, section cnt and fname.
382 2021-01-08 Timm Bäder <tbaeder@redhat.com>
384 * strip.c (remove_debug_relocations): Rewrite inlined relocate
385 function to file static. Do R_*_NONE, reloc_simple_type and
386 ebl_debug_scn_p checks before calling new relocate function.
387 (relocate): New file static function from
388 remove_debug_relocate. Remove R_*_NONE, reloc_simple_type and
389 ebl_debugscn_p checks.
391 2021-01-08 Timm Bäder <tbaeder@redhat.com>
393 * strip.c (handle_elf): Expand inlined function check_preserved.
395 2021-01-12 Mark Wielaard <mark@klomp.org>
397 * elflint.c (EXTRA_SHFLAGS): New define.
398 (check_sections): Use EXTRA_SHFLAGS. Add SHF_GNU_RETAIN to
401 2020-12-31 Sergei Trofimovich <slyfox@gentoo.org>
403 * elflint.c (section_flags_string): Add NEWFLAG for GNU_RETAIN,
406 2020-12-31 Sergei Trofimovich <slyfox@gentoo.org>
408 * elflint.c (section_flags_string): Update cp pointer after
409 snprintf for unknown flags.
411 2020-12-16 Érico Nogueira <ericonr@disroot.org>
413 * readelf.c (qsort_r): Use qsort for improved portability.
415 2020-12-20 Dmitry V. Levin <ldv@altlinux.org>
417 * .gitignore: New file.
419 2020-12-12 Mark Wielaard <mark@klomp.org>
421 * elflint.c (check_sections): Handle SHF_GNU_RETAIN.
422 * readelf.c (print_shdr): Likewise.
424 2020-12-16 Dmitry V. Levin <ldv@altlinux.org>
426 * *.c: Replace gettext(...) with _(...).
428 * unstrip.c (_): Remove.
430 2020-12-15 Mark Wielaard <mark@klomp.org>
432 * elflint.c (check_symtab): Always print symbol name (if known)
435 2020-12-12 Dmitry V. Levin <ldv@altlinux.org>
437 * ar.c (write_member, do_oper_insert): Fix spelling typo in comment.
438 * elfclassify.c (issue, elf_issue, is_unstripped): Likewise.
439 * elfcompress.c (process_file): Likewise.
440 * elflint.c (be_quiet, check_gnu_hash): Likewise.
441 * readelf.c (print_phdr, handle_gnu_hash,
442 dwarf_locexpr_opcode_string): Likewise.
443 * size.c (totals_class): Likewise.
444 * strings.c (read_elf): Likewise.
445 * strip.c (handle_elf): Likewise.
447 * readelf.c (print_debug_addr_section): Fix spelling typo in error
449 * strip.c (options): Fix spelling typos in argp help text.
450 * strings.c (options): Likewise.
451 * stack.c (options): Likewise.
453 2020-11-01 Érico N. Rolim <erico.erc@gmail.com>
455 * unstrip.c (make_directories): Use ACCESSPERMS for mkdir.
456 (handle_file): Use DEFFILEMODE for open with O_CREAT for ET_REL
457 files, ACCESSPERMS otherwise.
459 2020-11-01 Érico N. Rolim <erico.erc@gmail.com>
461 * Makefile.am (nm_LDADD): Add obstack_LIBS.
462 (ranlib_LDADD): Likewise.
463 (ar_LDADD): Likewise.
465 2020-10-27 Érico N. Rolim <erico.erc@gmail.com>
467 * unstrip.c (make_directories): Use strndup, not strndupa.
469 2020-09-28 Mark Wielaard <mark@klomp.org>
471 * readelf.c (next_listptr_offset): Take idx as pointer, to be updated
472 and use new Dwarf_Off as offset to match.
473 (listptr_attr): New function.
474 (print_debug_loclists_section): Check for DW_AT_GNU_locviews to show
476 (print_debug_loc_section): Adjust next_listptr_offset call.
478 2020-09-03 Mark Wielaard <mark@klomp.org>
480 * readelf.c (print_cfa_program): Take ehdr as argument. Use it to
481 recognize DW_CFA_AARCH64_negate_ra_state.
482 (print_debug_frame_section): Pass ehdr to print_cfa_program.
483 (print_debug): Don't warn if we dump frames, but cannot get dbg.
485 2020-09-01 Mark Wielaard <mark@klomp.org>
487 * readelf.c (print_debug_ranges_section): Base address entry can
489 (print_debug_loc_section): Likewise.
491 2020-09-04 Mark Wielaard <mark@klomp.org>
493 * elflint.c (special_sections): Add .debug_line_str.
495 2020-08-26 Mark Wielaard <mark@klomp.org>
497 * readelf.c (print_debug_line_section): It is not an error if there
498 are no line number statements at the end of a debug line section.
500 2020-07-19 Mark Wielaard <mark@klomp.org>
502 * elfclassify.c (process_current_path): Handle fwrite failing.
504 2020-07-05 Mark Wielaard <mark@klomp.org>
506 * stack.c (module_callback): Don't assert if dwfl_module_info fails.
507 * unstrip.c (adjust_relocs): Produce a proper error when HAS
508 section has inconsistent size or entsize.
509 (match_module): Don't assert if dwfl_module_info fails.
511 2020-06-16 Mark Wielaard <mark@klomp.org>
513 * ar.c (do_oper_extract): Split large if statement. Call fchown
514 before fchmod and explicitly ignore the return value.
515 (do_oper_delete): Likewise.
516 (do_oper_insert): Likewise.
517 * ranlib.c (handle_file): Likewise.
519 2020-06-16 Mark Wielaard <mark@klomp.org>
521 * elflint.c (check_elf_header): Explicitly check and ignore
522 any error from elf_compress.
524 2020-06-07 Mark Wielaard <mark@klomp.org>
526 * nm.c (sort_by_name_strtab): Replace by...
527 (sort_by_name_elf): New static Elf pointer and ...
528 (sort_by_name_ndx): New static size_t index.
529 (sort_by_name): Use elf_strptr to get symbol string.
530 (show_symbols): Set sort_by_name_elf and sort_by_name_ndx.
532 2020-06-06 Mark Wielaard <mark@klomp.org>
534 * nm.c (show_symbols_sysv): Skip no name and STT_FILE symbols.
535 When not printing address and size pad strings. Strip "GNU_"
536 prefix from binding name.
537 (class_type_char): Use 'V' for weak symbols, 'C' for common
538 symbols and 'T' for weak functions.
539 (show_symbols_posix): Skip STT_FILE symbols. Don't print value and
542 2020-06-04 Mark Wielaard <mark@klomp.org>
544 * elflint.c (check_program_header): Remove PT_GNU_PROPERTY define.
546 2020-05-14 Mark Wielaard <mark@klomp.org>
548 * size.c (show_bsd): Set printf format based on radix.
550 2020-05-09 Mark Wielaard <mark@klomp.org>
552 * elflint.c (process_elf_file): Error out if ebl_openbackend fails.
553 * objdump.c (handle_elf): Likewise.
554 * nm.c (handle_elf): Likewise. Move full name string construction
555 forward, so it can be used in the error message.
557 2020-04-17 Mark Wielaard <mark@klomp.org>
559 * readelf.c (print_debug): Check .gnu.debuglto_ prefix.
561 2020-04-16 Mark Wielaard <mark@klomp.org>
563 * elflint.c (check_sections): Mask out SHF_EXCLUDE from processor
564 specific section flags when --gnu is given.
566 2020-02-08 Mark Wielaard <mark@klomp.org>
568 * elflint.c (check_program_header): Handle PT_GNU_PROPERTY.
570 2020-02-07 Mark Wielaard <mark@klomp.org>
572 * elflint.c (check_symtab): Check st_info isn't too big.
574 2020-01-16 Mark Wielaard <mark@klomp.org>
576 * nm.c (show_symbols_sysv): Iterate over all symbols starting
579 2019-11-26 Mark Wielaard <mark@klomp.org>
581 * Makefile.am (BUILD_STATIC): Add libraries needed for libdw.
583 2019-10-26 Mark Wielaard <mark@klomp.org>
585 * unstrip.c (collect_symbols): Check symbol strings are
588 2019-10-18 Mark Wielaard <mark@klomp.org>
590 * unstrip.c (adjust_relocs): Set versym data d_size to the actual
593 2019-10-20 Mark Wielaard <mark@klomp.org>
595 * unstrip.c (copy_elided_sections): Set and check max_off.
597 2019-10-21 Mark Wielaard <mark@klomp.org>
599 * unstrip.c (adjust_relocs): Add map_size argument and check ndx
601 (adjust_all_relocs): Add map_size argument and pass it to
603 (add_new_section_symbols): Call adjust_all_relocs with symndx_map
605 (collect)symbols): Check sym and string data can be found.
606 (compare_symbols_output): Call error when (different) symbols are
608 (new_shstrtab): Make unstripped_strent array one larger. Check
609 stripped_shnum isn't zero.
610 (copy_elided_sections): Add ndx_sec_num as size of ndx_section
611 array. Check sh_link and sh_info are not larger than ndx_sec_num.
612 Allocate symbols and symndx_map arrays on heap, not stack. Pass
613 map sizes to adjust_all_relocs.
615 2019-09-28 Dmitry V. Levin <ldv@altlinux.org>
617 * elflint.c (main): When an input file cannot be opened,
618 include its name into the error diagnostics.
619 * readelf.c (main): Likewise.
621 2019-09-02 Mark Wielaard <mark@klomp.org>
623 * readelf.c (PRINT_DYNSYM_TABLE): New argp key value.
624 (argp_opt): Add syn-sym.
625 (print_dynsym_table): New static bool.
626 (parse_opt): Handle PRINT_DYNSYM_TABLE.
627 (process_elf_file): Check print_dynsym_table.
629 2019-08-27 Mark Wielaard <mark@klomp.org>
631 * readelf.c (for_each_section_argument): Call (*dump) also for
634 2019-08-26 Mark Wielaard <mark@klomp.org>
636 * nm.c (show_symbols): Remember nentries_orig and check before
639 2019-07-05 Omar Sandoval <osandov@fb.com>
641 * Makefile.am: Remove -ldl.
642 (elflint_LDADD): Add $(libdw).
643 (elfcmp_LDADD): Add $(libdw).
644 (objdump_LDADD): Add $(libdw).
646 2019-08-26 Mark Wielaard <mark@klomp.org>
648 * readelf (options): Add OPTION_ARG_OPTIONAL "SECTION" for notes.
649 (notes_section): New global variable.
650 (parse_opt): Set notes_section.
651 (handle_notes): Check if notes_section is set.
653 2019-07-26 Florian Weimer <fweimer@redhat.com>
654 Mark Wielaard <mark@klomp.org>
656 * Makefile.am (bin_PROGRAMS): Add elfclassify.
657 (elfclassify_LDADD): New variable.
658 * elfclassify.c: New tool.
660 2019-07-13 Mao Han <han_mao@c-sky.com>
662 * elflint.c: Add C-SKY.
664 2019-06-28 Mark Wielaard <mark@klomp.org>
666 * readelf.c (print_ehdr): Use dwelf_elf_e_machine_string instead of
667 ebl->name. If unknown print hex value.
669 2019-06-25 Mark Wielaard <mark@klomp.org>
671 * stack.c (parse_opt): Fix dwfl_core_file_attach error message.
673 2019-06-18 Mark Wielaard <mark@klomp.org>
675 * strip.c (handle_elf): Use elf_begin ELF_C_WRITE, instead of
678 2019-05-10 Mark Wielaard <mark@klomp.org>
680 * readelf.c (struct attrcb_args): Rename die to dies.
681 (attr_callback): Get current current die using dies[level].
682 Handle DW_AT_discr_list as block, not as constant.
683 (print_debug_units): pass dies, not dies[level] as args.
685 2019-05-09 Mark Wielaard <mark@klomp.org>
687 * readelf.c (cleanup_list): New function.
688 (main): Call cleanup_list for dump_data_sections and string_sections.
690 2019-04-28 Mark Wielaard <mark@klomp.org>
692 * unstrip.c (add_new_section_symbols): Call ELF_CHECK after
694 (new_shstrtab): Call ELF_CHECK after gelf_getshdr.
696 2019-04-28 Mark Wielaard <mark@klomp.org>
698 * size.c (show_sysv): Call INTERNAL_ERROR if gelf_getshdr
700 (show_sysv_one_line): Call error with EXIT_FAILURE if
701 gelf_getshdr returns NULL.
703 2019-04-28 Mark Wielaard <mark@klomp.org>
705 * nm.c (show_symbols_sysv): Check gelf_getshdr doesn't return
706 NULL. Simplify naming of invalid sections, don't use alloca.
708 2019-04-28 Mark Wielaard <mark@klomp.org>
710 * elfcmp.c (main): Check shdr1 and shdr2 are not NULL.
712 2019-04-03 Mark Wielaard <mark@klomp.org>
714 * readelf.c (attr_callback): Print DW_AT_data_member_location as
715 decimal offset, not hex number.
717 2019-03-29 Mark Wielaard <mark@klomp.org>
719 * readelf.c (print_debug_macinfo_section): Check cus[0] is not the
722 2019-03-27 Mark Wielaard <mark@klomp.org>
724 * strip.c (handle_elf): Assert that symbol section number exists.
726 2019-01-24 Mark Wielaard <mark@klomp.org>
728 * strip.c (handle_elf): Fix check test for SHN_XINDEX symbol.
730 2019-01-22 Mark Wielaard <mark@klomp.org>
732 * readelf.c (print_debug_line_section): Check we are not at end of
733 line data when reading parameters for unknown opcodes.
735 2019-01-20 Mark Wielaard <mark@klomp.org>
737 * readelf.c (print_debug_line_section): Check terminating NUL byte
738 for dir and file tables.
740 2019-01-16 Mark Wielaard <mark@klomp.org>
742 * readelf (handle_core_note): Pass desc to ebl_core_note.
744 2018-11-10 Mark Wielaard <mark@klomp.org>
746 * elflint.c (check_program_header): Allow PT_GNU_EH_FRAME segment
747 to be matched against SHT_X86_64_UNWIND section.
749 2018-11-09 Mark Wielaard <mark@klomp.org>
751 * strip.c (remove_debug_relocations): Check if section is gnu
752 compressed and decompress and recompress it.
754 2018-11-12 Mark Wielaard <mark@klomp.org>
756 * elflint.c (check_note_data): Recognize NT_GNU_BUILD_ATTRIBUTE_OPEN
757 and NT_GNU_BUILD_ATTRIBUTE_OPEN.
758 * readelf.c (handle_notes_data): Handle
759 ELF_NOTE_GNU_BUILD_ATTRIBUTE_PREFIX. Pass nhdr.n_namesz to
762 2018-11-11 Mark Wielaard <mark@klomp.org>
764 * readelf.c (handle_notes_data): Pass n_descsz to
765 ebl_object_note_type_name.
766 * elflint.c (check_note_data): Recognize NT_VERSION, add owner
767 name to unknown note error.
769 2018-10-20 Mark Wielaard <mark@klomp.org>
771 * readelf.c (process_elf_file): Use dwelf_elf_begin to open pure_elf.
773 2018-10-26 Mark Wielaard <mark@klomp.org>
775 * strip.c (OPT_RELOC_DEBUG_ONLY): New define.
776 (options): Add reloc-debug-sections-only.
777 (reloc_debug_only): New static bool.
778 (main): Check reloc_debug_only is the only strip option used.
779 (parse_opt): Handle OPT_RELOC_DEBUG_ONLY.
780 (handle_debug_relocs): New function.
781 (handle_elf): Add local variables lastsec_offset and lastsec_size.
782 Handle reloc_debug_only.
784 2018-10-24 Mark Wielaard <mark@klomp.org>
786 * strip.c (handle_elf): Extract code to update shdrstrndx into...
787 (update_shdrstrndx): ... this new function.
789 2018-10-24 Mark Wielaard <mark@klomp.org>
791 * strip.c (handle_elf): Extract code into separate functions...
792 (secndx_name): ... new function.
793 (get_xndxdata): Likewise.
794 (remove_debug_relocations): Likewise.
796 2018-10-24 Mark Wielaard <mark@klomp.org>
798 * strip.c (handle_elf): Always copy over phdrs if there are any
799 and check phnum instead of e_type to determine whether to move
802 2018-11-02 Mark Wielaard <mark@klomp.org>
804 * unstrip.c (copy_elf): Add ELF_CHECK to make sure gelf_getehdr ()
807 2018-10-18 Mark Wielaard <mark@klomp.org>
809 * elflint.c (check_note_data): Recognize NT_GNU_PROPERTY_TYPE_0.
810 (check_note): Use p_align to pass either ELF_T_NHDR or ELF_T_NHDR8 to
811 elf_getdata_rawchunk.
812 * readelf (handle_notes): Likewise.
814 2018-10-24 Mark Wielaard <mark@klomp.org>
816 * addr2line.c (print_addrsym): Use elf_getshdrstrndx instead of
819 2018-10-24 Mark Wielaard <mark@klomp.org>
821 * readelf.c (section_name): Remove ehdr argument, lookup shstrndx.
822 (print_debug_abbrev_section): Don't pass ehdr.
823 (print_debug_addr_section): Likewise.
824 (print_decoded_aranges_section): Likewise.
825 (print_debug_aranges_section): Likewise.
826 (print_debug_rnglists_section): Likewise.
827 (print_debug_ranges_section): Likewise.
828 (print_debug_units): Likewise.
829 (print_decoded_line_section): Likewise.
830 (print_debug_line_section): Likewise.
831 (print_debug_loclists_section): Likewise.
832 (print_debug_loc_section): Likewise.
833 (print_debug_macinfo_section): Likewise.
834 (print_debug_macro_section): Likewise.
835 (print_debug_pubnames_section): Likewise.
836 (print_debug_str_section): Liekwise.
837 (print_debug_str_offsets_section): Likewise.
838 (print_gdb_index_section): Likewise.
840 2018-10-16 Mark Wielaard <mark@klomp.org>
842 * readelf.c (print_debug_frame_section): Make sure readp is never
845 2018-10-19 Mark Wielaard <mark@klomp.org>
847 * dwfl_module_getdwarf.c (adjust_relocs): Check sh_entsize is not
849 (add_new_section_symbols): Likewise.
850 (copy_elided_sections): Likewise.
852 2018-10-18 Mark Wielaard <mark@klomp.org>
854 * size.c (handle_ar): Only close elf if prefix was NULL.
856 2018-10-18 Mark Wielaard <mark@klomp.org>
858 * arlib.c (arlib_add_symbols): Check that sh_entsize is not zero.
860 2018-10-14 Mark Wielaard <mark@klomp.org>
862 * ar.c (do_oper_extract): Assume epoch if ar_date is bogus.
864 2018-10-14 Mark Wielaard <mark@klomp.org>
866 * findtextrel.c (process_file): Check that sh_entsize is not zero.
868 2018-10-13 Mark Wielaard <mark@klomp.org>
870 * readelf.c (print_debug_macro_section): Use elf_getdata. Print
873 2018-10-19 Mark Wielaard <mark@klomp.org>
875 * unstrip.c (copy_elided_sections): Renumber group section indexes.
877 2018-10-12 Mark Wielaard <mark@klomp.org>
879 * strip.c (handle_elf): Don't remove SHF_GROUP flag from sections.
880 Skip group section flag when renumbering section indexes.
881 * unstrip.c (struct section): Add sig field.
882 (compare_unalloc_sections): Take and use sig1 and sig2 as arguments.
883 (compare_sections): Pass signatures to compare_unalloc_sections.
884 (get_group_sig): New function.
885 (find_alloc_sections_prelink): Set signature.
886 (copy_elided_sections): Likewise and pass them on.
887 (find_unalloc_section): Take and pass signatures.
889 2018-10-02 Andreas Schwab <schwab@suse.de>
891 * strip.c (handle_elf): Handle ADD/SUB relocation.
893 2018-09-13 Mark Wielaard <mark@klomp.org>
895 * readelf.c (print_shdr): Get number of section with elf_getshdrnum.
896 (print_phdr): Likewise.
898 2018-09-13 Mark Wielaard <mark@klomp.org>
900 * strip.c (handle_elf): Check against shstrndx, not e_shstrndx.
901 Explicitly set shdrstrndx for debug file.
902 * unstrip.c (copy_elf): Explicitly copy shstrndx.
903 (find_alloc_sections_prelink): Document shnum usage.
905 2018-09-13 Mark Wielaard <mark@klomp.org>
907 * elflint.c (check_elf_header): Use shnum instead of e_shnum for all
909 (check_symtab): Use shstrndx instead of e_shstrndx to get section
912 2018-09-13 Mark Wielaard <mark@klomp.org>
914 * elfcmp.c (main): Get, check and shdrstrndx for section names.
916 2018-09-12 Mark Wielaard <mark@klomp.org>
918 * elfcmp.c (main): Call ebl_section_strip_p without ehdr.
919 * strip.c (handle_elf): Likewise.
921 2018-09-12 Mark Wielaard <mark@klomp.org>
923 * elflint.c (check_symtab): Call ebl_check_special_symbol without
926 2018-07-30 Mark Wielaard <mark@klomp.org>
928 * strip.c (handle_elf): Track allocated/unallocated sections seen. Set
929 section offset of unallocated sections after handling all allocated
932 2018-08-18 Mark Wielaard <mark@klomp.org>
934 * readelf.c (print_debug_aranges_section): Make sure there is enough
935 data to read the header segment size.
937 2018-08-18 Mark Wielaard <mark@klomp.org>
939 * elflint.c (check_sysv_hash): Calculate needed size using unsigned
940 long long int to prevent overflow.
941 (check_sysv_hash64): Calculate maxwords used separately before
942 comparison to prevent overflow.
944 2018-07-24 Mark Wielaard <mark@klomp.org>
946 * unstrip.c (compare_unalloc_sections): Also compare sh_size.
948 2018-07-21 Mark Wielaard <mark@klomp.org>
950 * unstrip.c (adjust_all_relocs): Skip SHT_GROUP sections.
952 2018-07-21 Mark Wielaard <mark@klomp.org>
954 * elfcompress.c (get_sections): New function.
955 (process_file): Check whether section needs to change. Don't rewrite
956 file if no section data needs changing.
957 (main): Update 'force' help text.
959 2018-07-21 Mark Wielaard <mark@klomp.org>
961 * elfcompress.c (process_file): Swap fchmod and fchown calls.
963 2018-07-04 Mark Wielaard <mark@klomp.org>
965 * readelf.c (print_debug_addr_section): Rename index var to uidx.
966 (attr_callback): Rename index var to word.
967 (print_debug_str_offsets_section): Rename index var to uidx.
969 2018-07-04 Ross Burton <ross.burton@intel.com>
971 * addr2line.c: Remove error.h include.
973 * arlib.c: Likewise and add system.h include.
974 * arlib2.c: Likewise.
975 * elfcmp.c: Likewise.
976 * elfcompress.c: Likewise.
977 * elflint.c: Likewise.
978 * findtextrel.c: Likewise.
980 * objdump.c: Likewise.
981 * ranlib.c: Likewise.
982 * readelf.c: Likewise.
984 * strings.c: Likewise.
986 * unstrip.c: Likewise.
988 2018-06-25 Mark Wielaard <mark@klomp.org>
990 * readelf.c (print_decoded_line_section): Use dwarf_next_lines
991 instead of dwarf_nextcu.
992 (print_debug_line_section): Don't explicitly lookup CU.
994 2018-06-15 Mark Wielaard <mark@klomp.org>
996 * readelf.c (attr_callback): Only print block as expressions if it
997 isn't DW_FORM_data16.
999 2018-06-12 Mark Wielaard <mark@klomp.org>
1001 * readelf.c (print_form_data): Check we have 4, not 2, bytes
1002 available for DW_FORM_block4.
1004 2018-06-12 Mark Wielaard <mark@klomp.org>
1006 * readelf.c (print_form_data): Don't increase strreadp after use.
1007 Do increase readp for DW_FORM_strx[1234].
1009 2018-06-16 Mark Wielaard <mark@klomp.org>
1011 * readelf.c (print_debug_loc_section): Make sure next_off doesn't
1014 2018-06-13 Mark Wielaard <mark@klomp.org>
1016 * readelf.c (die_type_sign_bytes): New function.
1017 (attr_callback): Recognized DW_FORM_implicit_cost as signed. Use
1018 die_type_sign_bytes to lookup the signedness and size of const
1021 2018-06-11 Mark Wielaard <mark@klomp.org>
1023 * readelf.c (print_form_data): Don't reuse readp and readendp when
1024 reading str_offsets section.
1026 2018-06-10 Mark Wielaard <mark@klomp.org>
1028 * readelf.c (print_form_data): Don't cast value to ptrdiff_t, cast
1029 ptrdiff_t to size_t.
1031 2018-06-08 Mark Wielaard <mark@klomp.org>
1033 * readelf.c (print_debug_rnglists_section): Calculate max_entries
1034 instead of needed bytes to prevent overflowing. Always print
1035 max_entries (but not more).
1036 (print_debug_loclists_section): Likewise.
1038 2018-06-08 Mark Wielaard <mark@klomp.org>
1040 * readelf.c (print_debug_line_section): Stop printing directories
1041 and files when we are at the end of the unit data.
1043 2018-06-07 Mark Wielaard <mark@klomp.org>
1045 * readelf.c (format_result): Removed.
1046 (format_result_size): Removed.
1047 (format_dwarf_addr): Renamed to...
1048 (print_dwarf_addr): ...this. Simply call printf, don't setup buffer,
1050 (print_ops): Use print_dwarf_addr instead of format_dwarf_addr.
1051 (print_debug_addr_section): Likewise.
1052 (print_debug_aranges_section): Likewise.
1053 (print_debug_rnglists_section): Likewise.
1054 (print_debug_ranges_section): Likewise.
1055 (print_debug_frame_section): Likewise.
1056 (attr_callback): Likewise.
1057 (print_decoded_line_section): Likewise.
1058 (print_debug_line_section): Likewise.
1059 (print_debug_loclists_section): Likewise.
1060 (print_debug_loc_section): Likewise.
1061 (print_gdb_index_section): Likewsie.
1063 2018-06-05 Mark Wielaard <mark@klomp.org>
1065 * readelf.c (print_debug_addr_section): Set unit_length always to
1066 (next_unitp - readp) in case we don't have a real header.
1068 2018-06-05 Mark Wielaard <mark@klomp.org>
1070 * readelf.c (print_debug_loc_section): Set begin to idx when failing
1071 to read the start address if DW_LLE_GNU_start_end_entry.
1073 2018-06-05 Mark Wielaard <mark@klomp.org>
1075 * readelf.c (handle_sysv_hash): Don't leak lengths array when
1076 detecting an invalid chain.
1077 (handle_sysv_hash64): Likewise.
1079 2018-06-05 Mark Wielaard <mark@klomp.org>
1081 * readelf.c (print_debug_macro_section): Extend vendor array by one
1082 to include max DW_MACRO_hi_user opcode.
1084 2018-06-07 Mark Wielaard <mark@klomp.org>
1086 * readelf.c (main): Lookup "no" for no_str.
1087 (print_debug_abbrev_section): Use yes_str and no_str.
1088 (print_form_data): Likewise.
1090 2018-06-04 Mark Wielaard <mark@klomp.org>
1092 * readelf (format_result): New static char pointer.
1093 (format_result_size): New static size_t.
1094 (format_dwarf_addr): Calculate max string size, reuse format_result
1095 if possible, otherwise realloc. Use sprintf on result, not asprintf.
1096 (print_ops): Don't free format_dwarf_addr, make sure result is
1097 printed before calling format_dwarf_addr again.
1098 (print_debug_addr_section): Likewise.
1099 (print_debug_aranges_section): Likewise.
1100 (print_debug_rnglists_section): Likewise.
1101 (print_debug_ranges_section): Likewise.
1102 (print_debug_frame_section): Likewise.
1103 (attr_callback): Likewise.
1104 (print_decoded_line_section): Likewise.
1105 (print_debug_line_section): Likewise.
1106 (print_debug_loclists_section): Likewise.
1107 (print_debug_loc_section): Likewise.
1108 (print_gdb_index_section): Likewsie.
1110 2018-06-04 Mark Wielaard <mark@klomp.org>
1112 * readelf.c (yes_str): New static char pointer.
1114 (main): Set yes_str and no_str using gettext.
1115 (attr_callback): Use yes_str and no_str instead of calling gettext.
1117 2018-06-04 Mark Wielaard <mark@klomp.org>
1119 * readelf.c (main): Call __fsetlocking (stdout, FSETLOCKING_BYCALLER).
1121 2018-05-31 Mark Wielaard <mark@klomp.org>
1123 * readelf.c (print_debug_units): Print the dwo name and id when
1124 unable to find a .dwo file.
1126 2018-05-31 Mark Wielaard <mark@klomp.org>
1128 * readelf.c (enum section_e): Make section_types not an alias of
1130 (section_all): Add section_types.
1131 (parse_opt): Add both section_info and section_types for "info"
1133 (print_debug_units): Don't be silent for debug_types.
1135 2018-05-31 Mark Wielaard <mark@klomp.org>
1137 * readelf.c (attr_callback): Only register section_loc when not
1138 looking at a split dwarf from a skeleton.
1140 2018-05-30 Mark Wielaard <mark@klomp.org>
1142 * readelf.c (print_debug_loc_section): Use correct listptr for
1145 2018-05-31 Mark Wielaard <mark@klomp.org>
1147 * readelf.c (print_debug_units): Check offset against -1 not ~0ul.
1149 2018-05-29 Mark Wielaard <mark@klomp.org>
1151 * readelf.c (print_debug_loc_section): Handle GNU DebugFission list
1154 2018-05-29 Mark Wielaard <mark@klomp.org>
1156 * readelf.c (print_debug): Record and reset section_info status in
1157 implicit_debug_sections and print_debug_sections.
1159 2018-05-28 Mark Wielaard <mark@klomp.org>
1161 * readelf.c (print_debug_units): Turn "Could not find split compile
1162 unit" into an Warning instead of an error.
1164 2018-04-29 Mark Wielaard <mark@klomp.org>
1166 * readelf.c (parse_opt): Request implicit section_info for "str".
1167 (known_stroffbases): New static variable.
1168 (attr_callbackattr_callback): Handle DW_AT_str_offets_base.
1169 (print_debug_str_offsets_section): New function.
1170 (print_debug): Handle .debug_str_offsets as section_str. Reset
1173 2018-04-27 Mark Wielaard <mark@klomp.org>
1175 * readelf.c (options): Add addr.
1176 (enum section_e): Add section_addr.
1177 (section_all): Add section_addr.
1178 (parse_opt): Parse "addr".
1179 (known_addrbases): New static variable.
1180 (get_listptr): New function.
1181 (print_debug_addr_section): Likewise.
1182 (attr_callback): Handle DW_AT_addr_base and DW_AT_GNU_addr_base.
1183 (print_debug): Add NEW_SECTION (addr). Reset known_addrbases.
1185 2018-04-07 Mark Wielaard <mark@klomp.org>
1187 * readelf.c (attr_callback): Handle DW_FORM_loclistx and
1190 2018-04-12 Mark Wielaard <mark@klomp.org>
1192 * readelf.c (dwarf_loc_list_encoding_string): New functions.
1193 (dwarf_loc_list_encoding_name): Likewise.
1194 (known_loclistptr): Renamed and split in two...
1195 (known_locsptr): this and ...
1196 (known_loclistsptr): this.
1197 (listptr_base): Split out...
1198 (cudie_base): ...this.
1199 (is_split_dwarf): New function.
1200 (attr_callback): Handle DW_AT_loclists_base and notice sec_offset
1202 (print_debug_rnglists_section): Use spit_dwarf_cu_base.
1203 (print_debug_loclists_section): New function.
1204 (print_debug_loc_section): Use known_locsptr instead of
1206 (print_debug): Recognize .debug_loclists. Reset known_locsptr and
1209 2018-05-25 Mark Wielaard <mark@klomp.org>
1211 * readelf.c (DWARF_SKELETON): New constant.
1212 (do_not_close_dwfl): New bool.
1213 (options): Add dwarf-skeleton.
1214 (dwarf_skeleton): New static variable.
1215 (parse_opt): Handle DWARF_SKELETON, set dwarf_skeleton.
1216 (create_dwfl): New function, with code extracted from...
1217 (process_file): ...here. Check do_not_close_dwfl.
1218 (is_split_darf): New function.
1219 (getone_dwflmod): Likewise.
1220 (print_debug): Use new functions to find skeleton DWARF file to use
1221 when inspecting .dwo split DWARF file.
1223 2018-04-11 Mark Wielaard <mark@klomp.org>
1225 * readelf.c (dwarf_range_list_encoding_string): New function.
1226 (dwarf_range_list_encoding_name): Likewise.
1227 (known_rnglistptr): New static variable.
1228 (listptr_cu): New function.
1229 (print_debug_rnglists_section): Likewise.
1230 (attr_callback): Call notice_listptr for DW_AT_ranges. Handle
1231 DW_AT_rnglists_base. Handle DW_FORM_rnglistx. DW_AT_start_scope
1232 can also have a rnglist.
1233 (print_debug_units): Do (silently) scan split DWARF also for
1234 debug_ranges before DWARF5 to catch all rangelistptrs.
1235 (print_debug): Recognize .debug_rnglists. Reset known_rnglistptr.
1237 2018-01-21 Mark Wielaard <mark@klomp.org>
1239 * readelf.c (get_indexed_addr): New function.
1240 (print_ops): Handle DW_OP_addrx, DW_OP_GNU_addr_index,
1241 DW_OP_constx, DW_OP_GNU_const_index separately and resolve
1243 (attr_callback): Print index and address for
1244 DW_FORM_GNU_addr_index and DW_FORM_addrx[1234].
1246 2018-01-19 Mark Wielaard <mark@klomp.org>
1248 * readelf.c (options): Add info+.
1249 (show_split_units): New static boolean defaulting to false.
1250 (parse_opt): For all (no arg) --debug-dump set show_split_units
1251 to yes. For "info+" enable section_info and show_split_units.
1252 (attrcb_args): Add is_split field.
1253 (attr_callback): Use is_split to format DIE offsets differently.
1254 (print_debug_units): Likewise. Get subdie (type or split) only
1255 when needed. When not silent reiterate over split DIEs when
1258 2018-05-15 Mark Wielaard <mark@klomp.org>
1260 * readelf.c (print_debug_units): Print unit type and id for any
1261 unit type that has it even when version < 5.
1263 2018-05-14 Mark Wielaard <mark@klomp.org>
1265 * readelf.c (print_ops): Handle DW_OP_GNU_addr_index and
1266 DW_OP_GNU_const_index.
1267 (attr_callback): Handle DW_FORM_GNU_addr_index as DW_FORM_addrx.
1268 Handle DW_FORM_GNU_str_index as DW_FORM_constx. Add as_hex_id.
1269 Handle DW_AT_GNU_dwo_id as_hex_id.
1270 (print_form_data): Handle DW_FORM_GNU_str_index as DW_FORM_strx.
1272 2018-05-12 Mark Wielaard <mark@klomp.org>
1274 * readelf.c (print_debug): Also recognize .dwo section name variants.
1276 2018-05-15 Dmitry V. Levin <ldv@altlinux.org>
1278 * elflint.c (check_elf_header): Fix typo in error diagnostics.
1280 2018-05-15 Mark Wielaard <mark@klomp.org>
1282 * readelf.c (print_form_data): Cast comparisons against offset_len to
1284 (print_debug_line_section): Print uint64_t as PRIu64.
1286 2018-05-11 Mark Wielaard <mark@klomp.org>
1288 * readelf.c (print_debug_macro_section): Use libdw_valid_user_form.
1289 Use print_form_data for strx and sup strings.
1291 2018-05-09 Mark Wielaard <mark@klomp.org>
1293 * readelf.c (dwarf_line_content_description_string): New function.
1294 (dwarf_line_content_description_name): Likewise.
1295 (print_bytes): Likewise.
1296 (print_form_data): Likewise. Based on code taken from...
1297 (print_debug_macro_section): ...here. Now calls print_form_data
1298 and str_offsets_base_off.
1299 (print_debug_line_section): Parse DWARF5 header, directory and file
1302 2018-05-12 Mark Wielaard <mark@klomp.org>
1304 * addr2line.c (main): Add fflush (stdout) after handle_address ()
1305 when reading from stdin.
1307 2018-04-24 Mark Wielaard <mark@klomp.org>
1309 * readelf.c (print_debug_aranges_section): Try elf_rawdata if no
1311 (print_debug_ranges_section): Likewise.
1312 (print_debug_frame_section): Likewise.
1313 (print_debug_line_section): Likewise. Check for data == NULL.
1314 (print_debug_loc_section): Likewise.
1315 (print_debug_macinfo_section): Likewise.
1316 (print_debug_macro_section): Likewise.
1318 2018-04-28 Mark Wielaard <mark@klomp.org>
1320 * readelf.c (print_debug): If .debug_info is needed implicitly by
1321 then handle it first before handling any other debug section.
1322 (parse_opt): Set implicit_debug_sections to section_info when
1323 showing all debug sections.
1325 2018-05-05 Mark Wielaard <mark@klomp.org>
1327 * readelf.c (attr_callback): Handle DW_FORM_ref_sup4 and
1328 DW_FORM_ref_sup8 as references.
1330 2018-04-24 Mark Wielaard <mark@klomp.org>
1332 * readelf.c (print_debug_str_section): Take raw section data. Don't
1333 use dwarf_getstring, but determine start and end of string from
1334 offset and section data directly.
1335 (print_debug): Handle ".debug_line_str" like ".debug_str".
1337 2018-04-19 Andreas Schwab <schwab@suse.de>
1339 * elflint.c (valid_e_machine): Add EM_RISCV.
1341 2018-04-16 Mark Wielaard <mark@klomp.org>
1343 * readelf.c (print_debug_line_section). In advance_pc, advance
1344 using op_addr_advance, not op_advance.
1346 2018-04-14 Mark Wielaard <mark@klomp.org>
1348 * readelf.c (attr_callback): Only show errors when not silent.
1350 2018-03-23 Mark Wielaard <mark@klomp.org>
1352 * readelf.c (attr_callback): Handle DW_FORM_strx[1234].
1354 2018-03-22 Mark Wielaard <mark@klomp.org>
1356 * readelf.c (attr_callback): Handle DW_FORM_addrx[1234].
1358 2018-03-28 Mark Wielaard <mark@klomp.org>
1360 * readelf.c (handle_sysv_hash): Break bucket chain after nchain
1362 (handle_sysv_hash64): Likewise.
1364 2018-03-27 Mark Wielaard <mark@klomp.org>
1366 * readelf.c (attr_callback): Print dwarf_dieoffset as %PRIx64,
1369 2018-03-20 Mark Wielaard <mark@klomp.org>
1371 * readelf.c (attr_callback): Report error when DW_AT_decl_file or
1372 DW_AT_call_file cannot be resolved.
1374 2018-03-06 Mark Wielaard <mark@klomp.org>
1376 * readelf.c (print_ops): Handle DW_OP_addrx, DW_OP_constx,
1377 DW_OP_implicit_pointer, DW_OP_entry_value, DW_OP_const_type,
1378 DW_OP_regval_type, DW_OP_deref_type, DW_OP_xderef_type,
1379 DW_OP_convert, DW_OP_reinterpret.
1381 2018-03-01 Mark Wielaard <mark@klomp.org>
1383 * readelf.c (struct listptr): Add attr field.
1384 (compare_listptr): Warn when two listptrs for the same offset have
1385 different attributes.
1386 (notice_listptr): Take attr as argument and add it to listptr.
1387 (skip_listptr_hole): New attr argument.
1388 (next_listptr_offset): New function.
1389 (print_debug_ranges_section): Pass NULL attr to skip_listptr_hole.
1390 (attr_callback): Handle DW_AT_GNU_locviews. Call notice_listptr with
1392 (print_debug_loc_section): Keep track of which attr is associated with
1393 a listptr. If the attr is DW_AT_GNU_locview print view pairs till the
1394 next listptr offset.
1396 2018-02-09 Mark Wielaard <mark@klomp.org>
1398 * elflint.c (check_group): Make sure we can read a complete
1399 element when iterating over the group.
1401 2018-02-09 Mark Wielaard <mark@klomp.org>
1403 * readelf.c (attr_callback): Handle DW_FORM_data16 as Dwarf_Block.
1405 2018-02-09 Mark Wielaard <mark@klomp.org>
1407 * readelf.c (print_debug_abbrev_section): Print the value of a
1408 DW_FORM_implicit_const using dwarf_getabbrevattr_data.
1409 (attr_callback): Handle DW_FORM_implicit_const.
1411 2018-01-30 Mark Wielaard <mark@klomp.org>
1413 * readelf.c (dwarf_unit_string): New function.
1414 (dwarf_unit_name): Likewise.
1415 (print_debug_units): Use dwarf_get_units and dwarf_cu_die instead
1416 of dwarf_next_unit. Print unit type, id and subdie if available.
1418 2018-02-09 Joshua Watt <JPEWhacker@gmail.com>
1420 * addr2line.c (handle_address): Use FALLTHROUGH macro instead of
1422 * elfcompress.c (parse_opt): Likewise.
1423 * elflint.c (check_dynamic): Likewise.
1424 (check_sections): Likewise.
1425 (check_note_data): Likewise.
1426 * objdump.c (parse_opt): Likewise.
1427 * readelf.c (parse_opt): Likewise.
1428 (attr_callback): Likewise.
1429 (handle_auxv_note): Likewise.
1430 * strings.c (parse_opt): Likewise.
1431 * backtrace.c (callback_verify): Likewise.
1433 2018-01-25 Mark Wielaard <mark@klomp.org>
1435 * readelf.c (print_debug_ranges_section): Initialize cu to last_cu.
1436 (print_debug_loc_section): Likewise.
1438 2018-01-01 Mark Wielaard <mark@klomp.org>
1440 * readelf.c (attr_callback): Use dwarf_form_name for unknown forms.
1441 (print_debug_macro_section): Print form using dwarf_form_name.
1443 2017-12-28 Mark Wielaard <mark@klomp.org>
1445 * readelf.c (print_debug_units): Print DIE offset in error message
1448 2017-12-18 Mark Wielaard <mark@klomp.org>
1450 * readelf.c (handle_notes_data): Don't use EXIT_FAILURE in error.
1451 Adjust error message depending on whether or not we got data.
1453 2017-12-07 Mark Wielaard <mark@klomp.org>
1455 * readelf.c (print_ops): Update data pointer and print arguments
1456 to DW_OP_call2 and DW_OP_call4 as DIE offsets.
1458 2017-11-29 Mark Wielaard <mark@klomp.org>
1460 * readelf.c (argp_options): Add "section-groups", 'g'.
1462 2017-11-29 Mark Wielaard <mark@klomp.org>
1464 * readelf.c (print_debug_loc_section): Print CU base and unresolved
1465 addresses. Adjust formatting.
1467 2017-11-29 Mark Wielaard <mark@klomp.org>
1469 * readelf.c (print_debug_ranges_section): Print CU base and unresolved
1470 addresses. Adjust formatting.
1472 2017-11-29 Mark Wielaard <mark@klomp.org>
1474 * readelf.c (attr_callback): Set valuestr to resolved file name
1475 for DW_AT_decl_file and DW_AT_call_file.
1477 2017-11-29 Mark Wielaard <mark@klomp.org>
1479 * readelf.c (print_debug_units): Print abbrev code after DIE tag.
1481 2017-11-29 Mark Wielaard <mark@klomp.org>
1483 * readelf.c (print_ops): Use only2 space for index. re-indent +5
1484 for DW_OP_GNU_entry_value.
1486 2017-11-21 Mark Wielaard <mark@klomp.org>
1488 * readelf.c (attr_callback): Print attribute name and form in error
1489 message. If only the value cannot be retrieved/resolved don't abort.
1491 2017-10-03 Mark Wielaard <mark@klomp.org>
1493 * readelf.c (attr_callback): Print DIE offset in error messages.
1495 2017-11-03 Mark Wielaard <mark@klomp.org>
1497 * readelf.c (print_ops): Handle DW_OP_GNU_variable_value. Print
1498 referenced DIE as offset.
1500 2017-09-10 Mark Wielaard <mark@klomp.org>
1502 * ar.c (do_oper_delete): Remove DEBUG conditional check.
1503 (no0print): Return bool. Check snprintf return value.
1504 (do_oper_insert): Initialize elf. Remove DEBUG conditional check.
1505 Check no0print calls succeed. Explicitly elf_end found elfs.
1506 (do_oper_extract): Make sure we don't create an empty variable
1509 2017-09-01 Mark Wielaard <mark@klomp.org>
1511 * stack.c (main): Replace \v in doc string with \n\n.
1512 * unstrip.c (main): Likewise.
1514 2017-05-04 Ulf Hermann <ulf.hermann@qt.io>
1516 * stack.c: Print pid_t using %lld.
1518 2017-08-18 Ulf Hermann <ulf.hermann@qt.io>
1520 * readelf.c: Hardcode the signal numbers for non-linux systems.
1522 2017-07-26 Mark Wielaard <mark@klomp.org>
1524 * readelf.c (print_debug_macro_section): Accept either version 4 or
1525 version 5. Use DW_MACRO names instead of DW_MACRO_GNU names. Add
1526 minimal support for DW_MACRO_define_sup, DW_MACRO_undef_sup,
1527 DW_MACRO_import_sup, DW_MACRO_define_strx and DW_MACRO_undef_strx.
1529 2017-07-26 Mark Wielaard <mark@klomp.org>
1531 * readelf.c (dwarf_defaulted_string): New function.
1532 (dwarf_defaulted_name): Likewise.
1533 (attr_callback): Use dwarf_defaulted_name to get value of
1536 2017-07-20 Mark Wielaard <mark@klomp.org>
1538 * strip.c (handle_elf): Deal with data marker symbols pointing to
1539 debug sections (they can be removed).
1541 2017-07-14 Mark Wielaard <mark@klomp.org>
1543 * strip (OPT_KEEP_SECTION): New define.
1544 (options): Add documentation for remove-section. Add keep-section.
1545 (struct section_pattern): New data type.
1546 (keep_secs, remove_secs): New globals.
1547 (add_pattern, free_sec_patterns, free_patterns, section_name_matches):
1549 (main): Call free_patterns.
1550 (parse_opt): Handle 'R' and OPT_KEEP_SECTION. Check remove_comment
1551 on ARGP_KEY_SUCCESS.
1552 (handle_elf): Handle and sanity check keep_secs and remove_secs.
1554 2017-06-07 Mark Wielaard <mark@klomp.org>
1556 * strip.c (handle_elf): Introduce new handle_elf boolean. Use it to
1557 determine whether to create an output and/or debug file. Remove new
1558 output file on error.
1560 2017-06-06 Mark Wielaard <mark@klomp.org>
1562 * strip.c (handle_elf): Assume e_shstrndx section can be removed.
1564 2017-04-20 Ulf Hermann <ulf.hermann@qt.io>
1566 * readelf.c: Include strings.h.
1568 2017-04-20 Ulf Hermann <ulf.hermann@qt.io>
1570 * unstrip.c: Check shnum for 0 before subtracting from it.
1572 2017-04-20 Ulf Hermann <ulf.hermann@qt.io>
1574 * readelf.c: Replace YESSTR and NOSTR with gettext ("yes") and
1575 gettext ("no"), respectively.
1577 2017-04-05 Mark Wielaard <mark@klomp.org>
1579 * elflint.c (check_elf_header): Decompress all sections.
1581 2017-03-28 Mark Wielaard <mark@klomp.org>
1583 * elflint (check_group): Don't check if there is no flag word.
1585 2017-03-27 Mark Wielaard <mark@klomp.org>
1587 * elflint.c (check_elf_header): Sanity check phnum and shnum.
1589 2017-03-27 Mark Wielaard <mark@klomp.org>
1591 * elflint.c (check_sysv_hash): Return early if section size is
1593 (check_sysv_hash64): Likewise.
1594 (check_hash): Calculate expect_entsize to check section size.
1596 2017-03-27 Mark Wielaard <mark@klomp.org>
1598 * elflint.c (check_symtab_shndx): Check data->d_size.
1600 2017-03-24 Mark Wielaard <mjw@redhat.com>
1602 * elfcmp.c (main): If n_namesz == 0 then the note name data is the
1604 * readelf.c (handle_notes_data): Likewise.
1606 2017-03-24 Mark Wielaard <mjw@redhat.com>
1608 * readelf.c (handle_gnu_hash): Check inner < max_nsyms before
1609 indexing into chain array.
1611 2017-02-16 Ulf Hermann <ulf.hermann@qt.io>
1613 * addr2line.c: Include printversion.h
1615 * elflint.c: Likewise.
1617 * objdump.c: Likewise.
1618 * ranlib.c: Likewise.
1619 * readelf.c: Likewise.
1621 * stack.c: Likewise.
1622 * strings.c: Likewise.
1623 * strip.c: Likewise.
1624 * elfcmp.c: Include printversion.h, remove system.h include.
1625 * elfcompress.c: Likewise.
1626 * findtextrel.c: Likewise.
1627 * unstrip.c: Likewise.
1629 2017-02-14 Ulf Hermann <ulf.hermann@qt.io>
1631 * nm.c: Include color.h.
1632 * objdump.c: Likewise.
1634 2016-12-24 Mark Wielaard <mark@klomp.org>
1636 * Makefile.am (findtextrel_LDADD): Add $(libeu).
1637 (addr2line_LDADD): Likewise.
1638 (elfcmp_LDADD): Likewise.
1639 * addr2line.c (print_version): Removed.
1640 * ar.c (print_version): Likewise.
1641 * elfcmp.c (print_version): Likewise.
1642 * elfcompress.c (print_version): Likewise.
1643 * elflint.c (print_version): Likewise.
1644 * findtextrel.c (print_version): Likewise.
1645 * nm.c (print_version): Likewise.
1646 * objdump.c: Likewise.
1647 * ranlib.c: Likewise.
1648 * readelf.c: Likewise.
1650 * stack.c: Likewise.
1651 * strings.c: Likewise.
1652 * strip.c: Likewise.
1653 * unstrip.c: Likewise.
1655 2016-11-17 Mark Wielaard <mjw@redhat.com>
1657 * readelf.c (options): Add optional arg SECTION for symbols.
1658 (symbol_table_section): New static variable.
1659 (parse_opt): Set symbol_table_section on 's'.
1660 (print_symtab): Filter on symbol_table_section name is set.
1662 2016-11-10 Mark Wielaard <mjw@redhat.com>
1664 * ar.c (write_member): Make sure tmpbuf is large enough to contain
1665 a starting '/' and ending '\0' char.
1666 (do_oper_insert): Likewise.
1667 * arlib.c (arlib_finalize): Format tmpbuf as PRId32 decimal.
1669 2016-11-02 Mark Wielaard <mjw@redhat.com>
1671 * addr2line.c (handle_address): Add fallthrough comment.
1672 * elfcompress.c (parse_opt): Adjust fallthrough comment.
1673 * elflint.c (parse_opt): Add missing break after 'd' case.
1674 (check_sections): Add fallthrough comments.
1675 * objdump.c (parse_opt): Add explantion for fallthrough comment.
1677 2016-10-22 Kevin Cernekee <cernekee@chromium.org>
1679 * unstrip.c: Fix "invalid string offset" error caused by using the
1680 unstripped .symtab with the stripped .strtab.
1682 2016-10-11 Akihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>
1684 * arlib.c: Remove system.h include, add libeu.h include.
1685 * arlib2.c: Remove sys/param.h include.
1686 * elfcompress.c: Add libeu.h include.
1687 * elflint.c: Remove sys/param.h include, add libeu.h include.
1689 * objdump.c: Likewise.
1690 * ranlib.c: Likewise.
1691 * readelf.c: Likewise.
1692 * size.c: Remove sys/param.h include.
1693 * strings.c: Likewise, add libeu.h include.
1694 * strip.c: Likewise.
1695 * unstrip.c: Likewise.
1697 2016-10-06 Mark Wielaard <mjw@redhat.com>
1699 * strip.c (handle_elf): Don't remove real symbols from allocated
1702 2016-08-25 Mark Wielaard <mjw@redhat.com>
1704 * strip.c (handle_elf): Recompress with ELF_CHF_FORCE.
1706 2016-08-06 Mark Wielaard <mjw@redhat.com>
1708 * strip.c (handle_elf): Uncompress and recompress relocation target
1709 section if necessary.
1711 2016-07-08 Mark Wielaard <mjw@redhat.com>
1713 * Makefile.am (strip_LDADD): Add libdw.
1714 * elfcompress.c (process_file): Use dwelf_strtab functions instead of
1716 * strip.c (handle_elf): Likewise.
1717 * unstrip.c (new_shstrtab): Likewise.
1719 2016-07-06 Mark Wielaard <mjw@redhat.com>
1721 * elf32-i386.script, i386_ld.c, ld.c, ld.h, ldgeneric.c, ldlex.l,
1722 ldscript.y, libld_elf_i386.map, none_ld.c, sectionhash.c,
1723 sectionhash.h, symbolhash.c, symbolhash.h, unaligned.h,
1724 versionhash.c, versionhash.h, xelf.h: Removed.
1725 * Makefile.am (YACC): Removed.
1726 (AM_YFLAGS): Removed.
1727 (AM_LFLAGS): Removed.
1728 (native_ld): Removed.
1729 (base_cpu): Removed.
1730 (bin_PROGRAMS): Removed ld.
1732 (ld_SOURCES): Removed.
1733 (noinst_LIBRARIES): Only libar.a.
1734 (EXTRA_DIST): Just arlib.h and debugpred.h.
1735 (ld_LDADD): Removed.
1736 (ld_LDFLAGS): Removed.
1738 (ldscript.h): Removed.
1740 (CLEANFILES): Just *.gconv.
1741 (MAINTAINERCLEANFILES): Removed.
1743 2016-07-06 Mark Wielaard <mjw@redhat.com>
1745 * unstrip.c (copy_elided_sections): Use unstripped_strent[] from
1746 index zero, instead of one.
1748 2016-06-28 Richard Henderson <rth@redhat.com>
1750 * elflint.c (valid_e_machine): Add EM_BPF.
1752 2016-04-11 David Abdurachmanov <davidlt@cern.ch>
1754 * elfcmp.c (main): Fix self-comparison error with GCC 6.
1756 2016-03-21 Mark Wielaard <mjw@redhat.com>
1758 * nm.c (show_symbols): Check for malloc size argument overflow.
1760 2016-02-13 Mark Wielaard <mjw@redhat.com>
1762 * readelf.c (print_scngrp): Call error when gelf_getshdr fails.
1763 (print_symtab): Likewise.
1764 (handle_hash): Likewise.
1765 (dump_data_section): Print a warning if decompressing fails.
1766 (print_string_section): Likewise.
1768 2016-02-13 Mark Wielaard <mjw@redhat.com>
1770 * elfcompress.c (parse_opt): Don't fallthrough after processing -q.
1772 2016-02-12 Mark Wielaard <mjw@redhat.com>
1774 * strip.c (handle_elf): Correct elf_assert shndxdata check.
1776 2016-02-09 Mark Wielaard <mjw@redhat.com>
1778 * readelf.c (read_encoded): Move up.
1779 (print_cfa_program): Add encoding argument. Use it for read_encoded
1780 when reading DW_CFA_set_loc op.
1781 (print_debug_frame_section): Pass fde_encoding to print_cfa_program.
1783 2016-02-09 Mark Wielaard <mjw@redhat.com>
1785 * elflint.c (compare_hash_gnu_hash): Check hash sh_entsize against
1786 sizeof (Elf64_Xword). Correct invalid sh_entsize error message
1787 section idx and name.
1789 2016-01-13 Mark Wielaard <mjw@redhat.com>
1791 * elflint.c (check_elf_header): Recognize ELFOSABI_FREEBSD.
1793 2016-01-08 Mark Wielaard <mjw@redhat.com>
1795 * elfcompress.c (compress_section): Use %zu to print size_t.
1796 * readelf.c (print_shdr): Use %zx to print size_t.
1798 2015-12-16 Mark Wielaard <mjw@redhat.com>
1800 * elfcompress.c: New file.
1801 * Makefile.am (bin_PROGRAMS): Add elfcompress.
1802 (elfcompress_LDADD): New variable.
1804 2015-12-18 Mark Wielaard <mjw@redhat.com>
1806 * elflint.c (section_flags_string): Add NEWFLAG COMPRESSED.
1807 (check_sections): SHF_COMPRESSED can be on any special section.
1808 SHF_COMPRESSED is a valid section flag. SHF_COMPRESSED cannot
1809 be used together with SHF_ALLOC or with SHT_NOBITS. Should have
1812 2015-10-20 Mark Wielaard <mjw@redhat.com>
1814 * readelf.c (options): Expand -z help text.
1815 (dump_data_section): Check whether we need and can decompress section
1816 data and call elf_rawzdata if so,
1817 (print_string_section): Likewise.
1818 (elf_contains_chdrs): New function.
1819 (process_elf_file): Rename print_unrelocated to print_unchanged,
1820 use elf_contains_chdrs.
1821 (print_scngrp): Check whether section is compressed before use.
1822 (print_symtab): Likewise.
1823 (handle_hash): Likewise.
1825 2015-10-16 Mark Wielaard <mjw@redhat.com>
1827 * readelf.c (argp_option): Describe --decompress,-z.
1828 (print_decompress): New bool.
1829 (parse_opt): Handle -z.
1830 (elf_ch_type_name): New function.
1831 (print_shdr): Print section compress information.
1833 2015-12-31 Mark Wielaard <mjw@redhat.com>
1835 * elflint.c (check_symtab): Add _edata and _end (plus extra underscore
1836 variants) to to the list of possibly dangling symbols.
1838 2015-12-02 Mark Wielaard <mjw@redhat.com>
1840 * nm.c (process_file): Accept fd and pass it on.
1841 (handle_elf): Likewise.
1842 (find_no_debuginfo): New.
1843 (struct getdbg): Likewise.
1844 (getdbg_dwflmod): Likewise.
1845 (show_symbols): Take fd. If the file is ET_REL use libdwfl to get
1846 the relocated Dwarf.
1848 2015-12-02 Mark Wielaard <mjw@redhat.com>
1850 * nm.c (get_local_names): Check for duplicates in local_root tree.
1852 2015-12-02 Mark Wielaard <mjw@redhat.com>
1854 * unstrip.c (struct data_list): New.
1855 (new_data_list): Likewise.
1856 (record_new_data): Likewise.
1857 (free_new_data): Likewise.
1858 (adjust_relocs): Call record_new_data.
1859 (add_new_section_symbols): Likewise.
1860 (copy_elided_sections): Call free_new_data.
1862 2015-12-01 Mark Wielaard <mjw@redhat.com>
1864 * elfcmp.c (main): Close ebl1 and ebl2 backends.
1866 2015-10-16 Mark Wielaard <mjw@redhat.com>
1868 * Makefile.am [BUILD_STATIC](libdw): Add -lz.
1869 [BUILD_STATIC](libelf): Likewise.
1871 2015-10-16 Mark Wielaard <mjw@redhat.com>
1873 * elflint.c (check_symtab): Don't check TLS symbol value against TLS
1874 phdr offset in debuginfo files.
1875 (check_sections): Don't try to match section offsets to phdrs offsets
1878 2015-10-16 Mark Wielaard <mjw@redhat.com>
1880 * elflint.c (check_reloc_shdr): Reject only desthdrs if they have both
1881 SHF_MERGE and SHF_STRINGS set.
1883 2015-10-13 Jose E. Marchesi <jose.marchesi@oracle.com>
1885 * elflint.c (check_sections): Do not rely on
1886 ebl_check_special_section when checking debuginfo files. Also
1887 check that the type of WE sections in debuginfo files is NOBITS.
1889 2015-10-13 Mark Wielaard <mjw@redhat.com>
1891 * elflint.c (check_program_header): Check relro flags are a subset
1892 of the load segment if they don't fully overlap.
1894 2015-10-07 Mark Wielaard <mjw@redhat.com>
1896 * Makefile.am (ldlex_no_Wstack_usage): New.
1897 * ldlex.l ([RWX]): Make cnt unsigned.
1899 2015-10-09 Josh Stone <jistone@redhat.com>
1901 * elflint.c (main): Replace stat64 and fstat64 with stat and fstat.
1902 * readelf.c (process_file): Likewise.
1903 (process_elf_file): Replace off64_t with off_t.
1904 * findtextrel.c (process_file): Replace open64 with open.
1905 * ld.c (main): Replace sizeof (off64_t) with 8.
1906 * strings.c: Replace off64_t with off_t throughout.
1907 (main): Replace stat64 and fstat64 with stat and fstat.
1908 (map_file): Replace mmap64 with mmap.
1909 (read_block): Likewise, and replace lseek64 with lseek.
1910 * strip.c (handle_elf): Replace ftruncate64 with ftruncate.
1911 (process_file): Replace stat64 and fstat64 with stat and fstat.
1912 * unstrip.c (parse_opt): Replace stat64 with stat.
1913 (handle_file): Replace open64 with open.
1914 (open_file): Likewise.
1916 2015-10-08 Chih-Hung Hsieh <chh@google.com>
1918 * ld.c (determine_output_format): Move recursive nested
1919 function "try" to file scope.
1921 2015-10-04 Mark Wielaard <mjw@redhat.com>
1923 * strip.c (handle_elf): Only sanity check section symbols to not
1924 kept discarded sections if we are creating a debug file.
1926 2015-10-07 Mark Wielaard <mjw@redhat.com>
1928 * unstrip.c (MAX): Removed.
1929 (find_alloc_sections_prelink): Allocate exact amount of bytes for
1932 2015-10-05 Chih-Hung Hsieh <chh@google.com>
1934 * unstrip.c (find_alloc_sections_prelink): Do not allocate
1935 on stack union types with variable length arrays; use xmalloc
1936 for such dynamic sized objects.
1937 * readelf.c (handle_core_item): Likewise, but use alloca
1938 for small variable size data object and add assert(count < 128).
1940 2015-10-05 Josh Stone <jistone@redhat.com>
1942 * Makefile.am (libld_elf_i386.so): Add AM_V_CCLD silencer.
1943 (.deps/none_ld.Po): Always silence the dummy command.
1944 (make-debug-archive): Add AM_V_GEN and AM_V_at silencers.
1946 2015-10-02 Mark Wielaard <mjw@redhat.com>
1948 * unstrip.c (copy_elided_sections): Use SH_INFO_LINK_P, not just
1951 2015-10-02 Mark Wielaard <mjw@redhat.com>
1953 * strip.c (handle_elf): Don't move around allocated NOBITS sections.
1954 Don't just mark the section header string table as unused.
1955 * unstrip.c (copy_elided_sections): Add header names to strtab if
1956 shstrndx equals the symtab strtabndx.
1958 2015-09-22 Mark Wielaard <mjw@redhat.com>
1960 * strip.c (cleanup_debug): Remove old-style function definitions.
1962 2015-09-09 Chih-Hung Hsieh <chh@google.com>
1964 * readelf.c (print_debug_exception_table): Initialize variable before
1965 it is used, because compiler does not know that error never returns.
1966 (dump_arhive_index): Likewise.
1968 2015-09-04 Chih-Hung Hsieh <chh@google.com>
1970 * elflint.c (check_group): Replace %Z length modifier with %z.
1971 (check_note_data): Likewise.
1972 * findtextrel.c (process_file): Likewise.
1973 * readelf.c (handle_dynamic): Likewise.
1974 (handle_symtab): Likewise.
1975 (handle_verneed): Likewise.
1976 (handle_verdef): Likewise.
1977 (handle_versym): Likewise.
1978 (print_hash_info): Likewise.
1979 (print_decoded_aranges_section): Likewise.
1980 (print_debug_aranges_section): Likewise.
1981 (print_debug_line_section): Likewise.
1982 (hex_dump): Likewise.
1983 (dump_data_section): Likewise.
1984 (print_string_section): Likewise.
1985 (dump_archive_index): Likewise.
1986 * unstrip.c (adjust_relocs): Likewise.
1987 (collect_symbols): likewise.
1988 (get_section_name): Likewise.
1989 (find_alloc_sections_prelink): Likewise.
1990 (copy_elided_sections): Likewise.
1991 * ldscript.y (add_id_list): Add missing '%s'.
1993 2015-09-03 Mark Wielaard <mjw@redhat.com>
1995 * readelf.c (handle_core_item): Handle right shift >= 32 bits.
1997 2015-08-11 Mark Wielaard <mjw@redhat.com>
1999 * elflint.c (check_sections): When gnuld and a NOBITS section falls
2000 inside a segment make sure any ELF file contents is zero.
2002 2015-07-29 Mark Wielaard <mjw@redhat.com>
2004 * unstrip.c (sections_flags_match): New function.
2005 (sections_match): Use sections_flags_match.
2006 (find_alloc_sections_prelink): Only clear matched sections if there
2008 (copy_elided_sections): Add SHF_INFO_LINK to shdr_mem.sh_flags if
2011 2015-06-27 Pino Toscano <toscano.pino@tiscali.it>
2013 * src/strings.c: Define MAP_POPULATE if not defined already.
2015 2015-06-27 Mark Wielaard <mjw@redhat.com>
2017 * nm.c (show_symbols): First call elf_getdata, then allocate memory.
2019 2015-06-18 Mark Wielaard <mjw@redhat.com>
2021 * findtextrel.c (process_file): Free segments after use.
2023 2015-06-18 Mark Wielaard <mjw@redhat.com>
2025 * readelf.c (print_phdr): Make sure phdr2_mem lifetime/scope equals
2028 2015-06-18 Mark Wielaard <mjw@redhat.com>
2030 * readelf.c (handle_gnu_hash): Free lengths on invalid_data.
2032 2015-06-18 Mark Wielaard <mjw@redhat.com>
2034 * elflint.c (check_symtab): Only check the PT_TLS phdr if it actually
2035 exists. Warn otherwise.
2037 2015-06-18 Mark Wielaard <mjw@redhat.com>
2039 * nm.c (show_symbols): Check sizeof (sym_mem[0]), not GElf_Sym to
2040 known whether or not we stack allocated memory.
2042 2015-06-18 Mark Wielaard <mjw@redhat.com>
2044 * strings.c (readelf): Use "<unknown>" if we cannot retrieve section
2047 2015-06-09 Mark Wielaard <mjw@redhat.com>
2049 * addr2line.c (print_dwarf_function): Always free scopes before
2052 2015-06-09 Mark Wielaard <mjw@redhat.com>
2054 * strip.c (handle_ar): Mark as unused.
2055 (process_file): Produce an error when trying to handle an ar.
2057 2015-05-30 Mark Wielaard <mjw@redhat.com>
2059 * elfcmp.c (main): Only call memcmp when d_size != 0.
2061 2015-05-23 Mark Wielaard <mjw@redhat.com>
2063 * Makefile.am: Define ldgeneric, readelf, nm, size, strip, elflint,
2064 findtextrel, elfcmp objdump, ranlib, ar and unstrip no_Wstack_usage.
2066 2015-05-21 Mark Wielaard <mjw@redhat.com>
2068 * addr2line.c (handle_address): Set scopes to NULL after free.
2070 2015-05-20 Mark Wielaard <mjw@redhat.com>
2072 * addr2line.c (OPT_PRETTY): New constant define.
2073 (argp_option): Add "pretty-print".
2074 (pretty): New static bool.
2075 (parse_opt): Set pretty.
2076 (print_dwarf_function): Adjust output when pretty is set.
2077 (print_addrsym): Likewise.
2078 (handle_address): Likewise.
2080 2015-05-20 Mark Wielaard <mjw@redhat.com>
2082 * Makefile.am (addr2line_LDADD): Add demanglelib.
2083 * addr2line.c (argp_option): Move demangle under output format.
2084 (demangle): New static bool.
2085 (demangle_buffer_len): New static size_t.
2086 (demangle_buffer): New static char *.
2087 (main): free demangle_buffer.
2088 (parse_opt): Set demangle.
2089 (symname): New static function.
2090 (get_diename): Use symname.
2091 (print_dwarf_function): Likewise.
2092 (print_addrsym): Likewise.
2093 (handle_address): Likewise.
2095 2015-05-20 Mark Wielaard <mjw@redhat.com>
2097 * addr2line.c (argp_option): Add "addresses", 'a'.
2098 (print_addresses): New static bool.
2099 (parse_opt): Set print_addresses.
2100 (get_addr_width): New static function.
2101 (handle_address): Print address if print_addresses is true.
2103 2015-05-20 Mark Wielaard <mjw@redhat.com>
2105 * addr2line.c (handle_address): Call strtoumax with base 16. Make
2106 sure all input has been processed.
2108 2015-05-20 Mark Wielaard <mjw@redhat.com>
2110 * addr2line (argp_option): Group 'section' under "Input format
2113 2015-05-12 Mark Wielaard <mjw@redhat.com>
2115 * strip.c (debug_fd): New static variable.
2116 (tmp_debug_fname): Likewise.
2117 (cleanup_debug): New function using the above to clean up temporary
2119 (INTERNAL_ERROR): Call cleanup_debug.
2120 (handle_elf): Use debug_fd and tmp_debug_fname statics and call
2121 cleanup_debug before any error. Use output_fname instead of fname in
2122 error messages when it exists (-o was given). SHT_NOBITS sections
2123 can also be moved freely even if SHF_ALLOC is set. Add various
2124 sanity checks. Use elf_assert instead of plain assert.
2126 2015-05-08 Mark Wielaard <mjw@redhat.com>
2128 * nm.c (show_symbols): Call gelf_fsize with EV_CURRENT.
2129 * strip.c (handle_elf): Likewise.
2131 2015-05-06 Mark Wielaard <mjw@redhat.com>
2133 * elflint.c (check_gnu_hash): Return early when 2nd hash function
2134 shift too big. Check there is enough data available. Make sure
2135 bitmask_words is not zero.
2136 (check_verdef): Use Elf64_Word for shdr->sh_info cnt.
2137 (check_verneed): Likewise.
2138 (check_attributes): Break when vendor name isn't terminated.
2139 Add overflow check for subsection_len.
2141 2015-05-05 Mark Wielaard <mjw@redhat.com>
2143 * nm.c (show_symbols): Handle dwarf_linesrc returning NULL.
2145 2015-05-04 Max Filippov <jcmvbkbc@gmail.com>
2147 * ar.c (do_oper_extract): Replace struct timeval with struct timespec
2148 and futimes with futimens.
2149 * strip.c (process_file): Replace struct timeval with struct timespec.
2150 (handle_elf, handle_ar): Replace struct timeval with struct timespec
2151 in prototype. Replace futimes with futimens.
2153 2015-05-04 Max Filippov <jcmvbkbc@gmail.com>
2155 * addr2line.c (main): Drop mtrace() call and #include <mcheck.h>.
2159 * objdump.c: Likewise.
2160 * ranlib.c: Likewise.
2162 * strip.c: Likewise.
2163 * unstrip.c: Likewise.
2165 2015-05-04 Anthony G. Basile <blueness@gentoo.org>
2167 * Makefile.am (readelf_LDADD, nm_LDADD, size_LDADD, strip_LDADD)
2168 (ld_LDADD, elflint_LDADD, findtextrel_LDADD, addr2line_LDADD)
2169 (elfcmp_LDADD, objdump_LDADD, ranlib_LDADD, strings_LDADD)
2170 (ar_LDADD, unstrip_LDADD, stack_LDADD): Append $(argp_LDADD).
2172 2015-03-22 Mark Wielaard <mjw@redhat.com>
2174 * readelf.c (print_debug_frame_section): Cast start to Dwarf_Off
2175 before subtracting cie_id. And cast cie_offset to Dwarf_Off before
2178 2015-03-22 Mark Wielaard <mjw@redhat.com>
2180 * readelf.c (print_gdb_index_section): Check all offsets used
2181 against section d_size.
2183 2015-03-17 Mark Wielaard <mjw@redhat.com>
2185 * readelf.c (print_debug): Don't return, but always use dummy_dbg.
2187 2015-03-17 Mark Wielaard <mjw@redhat.com>
2189 * readelf.c (print_gdb_index_section): Add overflow checking for
2192 2015-03-14 Mark Wielaard <mjw@redhat.com>
2194 * nm.c (INTERNAL_ERROR): Remove __DATE__.
2195 * objdump.c (INTERNAL_ERROR): Likewise.
2196 * size.c (INTERNAL_ERROR): Likewise.
2197 * strip.c (INTERNAL_ERROR): Likewise.
2199 2015-03-18 Petr Machata <pmachata@redhat.com>
2201 * readelf.c (dwarf_tag_string, dwarf_attr_string)
2202 (dwarf_form_string, dwarf_lang_string, dwarf_inline_string)
2203 (dwarf_encoding_string, dwarf_access_string)
2204 (dwarf_visibility_string, dwarf_virtuality_string)
2205 (dwarf_identifier_case_string, dwarf_calling_convention_string)
2206 (dwarf_ordering_string, dwarf_discr_list_string)
2207 (dwarf_locexpr_opcode_string): Adjust uses of know-dwarf.h macros
2208 to match the API changes.
2210 2015-03-09 Mark Wielaard <mjw@redhat.com>
2212 * elflint.c (compare_hash_gnu_hash): Correct gnu_symbias usage.
2214 2015-01-03 Mark Wielaard <mjw@redhat.com>
2216 * elfcmp (main): Check section name is not NULL. Check sh_entsize
2217 is not zero for symbol tables. Check phdrs are not NULL.
2218 (search_for_copy_reloc): Check sh_entsize is not zero.
2220 2014-12-30 Mark Wielaard <mjw@redhat.com>
2222 * elflint.c (check_scn_group): Check d_buf and name are not NULL.
2223 (is_rel_dyn): Check d is not NULL. Check shdr->sh_entsize is not
2225 (check_dynamic): Check strshdr is not NULL. Check d_tag is positive.
2226 (check_symtab_shndx): Check symshdr and data->d_buf are not NULL.
2227 Check shdr and symshdr sh_entsize are not zero.
2228 (check_gnu_hash): Make sure maskidx is smaller than bitmask_words.
2229 Check symshdr->sh_entsize is not zero. Check data->d_buf is not
2231 (compare_hash_gnu_hash): Check sections d_buf are not NULL.
2232 Check section data is large enough. Use gnu_symbias.
2233 (check_group): Check section val is valid.
2234 (has_copy_reloc): Check sh_entsize is not zero.
2235 (check_versym): Likewise.
2236 (unknown_dependency_p): Likewise.
2237 (check_verneed): Break on invalid ref or offset. Don't assert.
2238 Report error when next offset is zero, but more vers expected.
2239 (check_verdef): Likewise.
2240 (check_attributes): Make sure d_buf is not NULL.
2241 (check_note): Likewise.
2242 (check_note_section): Likewise.
2243 (check_program_header): Make sure section name is not NULL.
2245 2014-12-26 Mark Wielaard <mjw@redhat.com>
2247 * strings.c (read_elf): Produce error when section data falls outside
2250 2014-12-26 Mark Wielaard <mjw@redhat.com>
2252 * nm.c (show_symbols): Guard against divide by zero in error check.
2253 Add section index number in error message.
2255 2014-12-26 Mark Wielaard <mjw@redhat.com>
2257 * nm.c (handle_ar): Skip over /SYM64/ entries.
2259 2014-12-26 Mark Wielaard <mjw@redhat.com>
2261 * nm.c (handle_ar): Break on arsym with invalid offset.
2263 2014-12-20 Mark Wielaard <mjw@redhat.com>
2265 * readelf.c (print_debug_macinfo_section): Mark cus sentinel files
2266 as -1 non-existent. Check macoff against sentinel cus.
2268 2014-12-20 Mark Wielaard <mjw@redhat.com>
2270 * readelf.c (print_debug_exception_table): Add max_action overflow
2271 check. Check action_table_end before reading slib128. Check
2272 max_ar_filter underflow.
2274 2014-12-18 Ulrich Drepper <drepper@gmail.com>
2276 * Makefile.am: Suppress output of textrel_check command.
2278 2014-12-17 Mark Wielaard <mjw@redhat.com>
2280 * readelf.c (print_cfa_program): Add bounds check before each op that
2281 takes at least one argument.
2283 2014-12-16 Mark Wielaard <mjw@redhat.com>
2285 * readelf.c (print_decoded_line_section): Print dwarf_errmsg if
2286 dwarf_onesrcline or dwarf_linesrc fails.
2288 2014-12-16 Mark Wielaard <mjw@redhat.com>
2290 * readelf.c (print_debug_line_section): Correct overflow check for
2292 (print_debug_aranges_section): Correct overflow check for length.
2294 2014-12-15 Mark Wielaard <mjw@redhat.com>
2296 * readelf.c (notice_listptr): Return false if offset doesn't fit
2298 (attr_callback): Warn if loclist or rangelist offset doesn't fit.
2300 2014-12-15 Mark Wielaard <mjw@redhat.com>
2302 * readelf.c (print_ops): Don't assert when addr_size or ref_size
2303 is not 4 or 8, just report invalid data.
2305 2014-12-15 Mark Wielaard <mjw@redhat.com>
2307 * readelf.c (print_gdb_index_section): Add more bounds checks.
2309 2014-12-15 Mark Wielaard <mjw@redhat.com>
2311 * readelf.c (print_debug_line_section): Check there is enough room
2312 for DW_LNE_set_address argument. Make sure there is enough room
2313 for the the initial unit_length.
2315 2014-12-14 Mark Wielaard <mjw@redhat.com>
2317 * elflint.c (check_attributes): Call get_uleb128 with end pointer.
2318 * readelf.c (print_attributes): Likewise.
2319 (print_ops): Likewise and also for get_sleb128.
2320 (print_cfa_program): Likewise and add more readp bounds checks.
2321 (read_encoded): Likewise.
2322 (print_debug_frame_section): Likewise.
2323 (print_debug_line_section): Likewise.
2324 (print_debug_macinfo_section): Likewise.
2325 (print_debug_macro_section): Likewise.
2326 (print_debug_exception_table): Likewise.
2328 2014-12-16 Mark Wielaard <mjw@redhat.com>
2330 * elfcmp.c (compare_Elf32_Word): Make sure (unsigned) Elf32_Word
2331 difference doesn't wrap around before returning as int.
2333 2014-12-11 Mark Wielaard <mjw@redhat.com>
2335 * readelf.c (print_debug_exception_table): Check TType base offset
2336 and Action table are sane.
2338 2014-12-11 Mark Wielaard <mjw@redhat.com>
2340 * readelf.c (print_debug_frame_section): Check number of augmentation
2343 2014-12-09 Mark Wielaard <mjw@redhat.com>
2345 * readelf.c (handle_file_note): Check count fits data section and
2346 doesn't overflow fptr.
2348 2014-12-08 Mark Wielaard <mjw@redhat.com>
2350 * readelf.c (print_debug_exception_table): Report invalid data if
2351 action table doesn't immediately follow call site table.
2353 2014-12-10 Josh Stone <jistone@redhat.com>
2355 * addr2line.c (get_diename): New, get linkage_name or name.
2356 * addr2line.c (print_dwarf_function): Use get_diename.
2357 * addr2line.c (handle_address): Likewise.
2358 * addr2line.c (print_diesym): Removed.
2360 2014-12-10 Josh Stone <jistone@redhat.com>
2362 * addr2line.c (handle_address): Find the proper inline parents.
2364 2014-12-07 Mark Wielaard <mjw@redhat.com>
2366 * readelf.c (print_debug_line_section): max_ops_per_instr cannot
2369 2014-12-07 Mark Wielaard <mjw@redhat.com>
2371 * readelf.c (print_ops): Handle zero ref_size for DW_OP_call_ref
2372 and DW_OP_GNU_implicit_pointer.
2374 2014-12-04 Mark Wielaard <mjw@redhat.com>
2376 * objdump.c (show_relocs_x): Make sure destshdr exists.
2377 (show_relocs_rel): Don't rely on shdr->sh_entsize, use gelf_fsize.
2378 (show_relocs_rela): Likewise.
2379 (show_relocs): Make sure destshdr, symshdr and symdata exists.
2381 2014-11-30 Mark Wielaard <mjw@redhat.com>
2383 * readelf.c (handle_sysv_hash64): Fix overflow check.
2385 2014-11-28 Mark Wielaard <mjw@redhat.com>
2387 * readelf.c (handle_relocs_rel): Don't reuse destshdr to store
2388 section header of a relocation against a STT_SECTION symbol. Use
2389 a new local variable secshdr.
2390 (handle_relocs_rela): Likewise.
2392 2014-11-26 Mark Wielaard <mjw@redhat.com>
2394 * readelf.c (print_debug_aranges_section): Cast Dwarf_Word length
2395 to ptrdiff_t for comparison.
2397 2014-11-24 Mark Wielaard <mjw@redhat.com>
2399 * readelf.c (print_debug_line_section): Check line_range is not zero
2402 2014-11-23 Mark Wielaard <mjw@redhat.com>
2404 * readelf.c (print_debug_aranges_section): Check length to catch
2407 2014-11-21 Mark Wielaard <mjw@redhat.com>
2409 * readelf.c (print_attributes): Guard against empty section.
2410 Document attribute format. Break when vendor name isn't terminated.
2411 Add overflow check for subsection_len. Handle both gnu and non-gnu
2414 2014-11-22 Mark Wielaard <mjw@redhat.com>
2416 * elflint.c (check_sections): Call ebl_bss_plt_p without ehdr.
2417 * findtextrel.c (process_file): Use elf_getphdrnum.
2418 * readelf.c (process_elf_file): Remove redundant ehdr->e_phoff check.
2419 (print_phdr): Check phnum.
2420 * size.c (show_segments): Use elf_getphdrnum.
2421 * strip.c (handle_elf): Likewise.
2422 * unstrip.c (copy_elf): Likewise.
2423 (copy_elided_sections): Likewise.
2424 (handle_file): Likewise.
2426 2014-11-18 Mark Wielaard <mjw@redhat.com>
2428 * readelf.c (print_cfa_program): Fix sanity check of DW_FORM_block
2431 2014-11-17 Mark Wielaard <mjw@redhat.com>
2433 * readelf.c (handle_verneed): Check vna_next and vn_next exist.
2434 (handle_verdef): Check vda_next and vd_next exist.
2435 (handle_versym): Check vd_next, vna_next and vn_next exist.
2436 Check vername and filename are not NULL before use.
2438 2014-11-17 Mark Wielaard <mjw@redhat.com>
2440 * elfcmp.c (main): Check section names are NULL before use.
2441 * objdump.c (section_match): Likewise.
2442 * size.c (show_sysv): Likewise.
2444 2014-11-17 Mark Wielaard <mjw@redhat.com>
2446 * readelf.c (print_debug_frame_section): Warn if ptr_size is not 4
2447 or 8 instead of just calling print_cfa_program.
2449 2014-11-16 Mark Wielaard <mjw@redhat.com>
2451 * readelf (process_elf_file): Set phnum to zero if there aren't
2452 actually any pheaders.
2453 (print_phdr): Check there actually is a phdr.
2455 2014-11-16 Mark Wielaard <mjw@redhat.com>
2457 * readelf.c (print_cfa_program): Check block len before calling
2460 2014-11-14 Mark Wielaard <mjw@redhat.com>
2462 * readelf.c (print_debug_frame_section): Sanity Check CIE
2463 unit_length and augmentationlen.
2465 2014-11-14 Mark Wielaard <mjw@redhat.com>
2467 * readelf.c (handle_versym): Check def == NULL before use.
2469 2014-11-08 Mark Wielaard <mjw@redhat.com>
2471 * readelf.c (handle_versym): Initialize vername and filename array
2474 2014-11-07 Mark Wielaard <mjw@redhat.com>
2476 * readelf.c (handle_sysv_hash): Sanity check section contents.
2477 (handle_sysv_hash64): Likewise.
2478 (handle_gnu_hash): Likewise.
2480 2014-09-14 Petr Machata <pmachata@redhat.com>
2482 * readelf.c (handle_relocs_rela): Typo fix, test DESTSHDR properly.
2484 2014-09-12 Petr Machata <pmachata@redhat.com>
2486 * readelf.c (encoded_ptr_size): In the switch statement, change
2487 magic constants 3 and 4 to DW_EH_PE_* counterparts. Still accept
2488 0. Print diagnostic for anything else.
2490 2014-08-25 Josh Stone <jistone@redhat.com>
2492 * Makefile.am: Prevent premature @AR@ replacement in a sed expression.
2494 2014-07-04 Menanteau Guy <menantea@linux.vnet.ibm.com>
2495 Mark Wielaard <mjw@redhat.com>
2497 * elflint (check_symtab): Add ".TOC." to the list of possibly
2498 dangling symbols because of sourceware PR13621.
2500 2014-06-14 Mark Wielaard <mjw@redhat.com>
2502 * elflint (check_symtab): Use ebl_func_addr_mask on st_value.
2504 2014-05-27 Mark Wielaard <mjw@redhat.com>
2506 * readelf.c (print_debug): Skip section if name is NULL.
2508 2014-05-26 Mark Wielaard <mjw@redhat.com>
2510 * readelf.c (handle_relocs_rela): Print header like handle_relocs_rel
2511 does, when sh_info == 0.
2513 2014-05-26 Mark Wielaard <mjw@redhat.com>
2515 * unstrip.c (find_alloc_sections_prelink): Allow non-split .bss
2516 section when sh_size of the original and undo .bss section are equal.
2518 2014-05-26 Mark Wielaard <mjw@redhat.com>
2520 * unstrip.c (options): Add --force, -F.
2521 (struct arg_info): Add bool force.
2522 (parse_opt): Handle 'F', set force.
2523 (handle_explicit_files): Add force argument, add warn function,
2524 separate check ehdr field checks, use warn.
2525 (handle_dwfl_module): Add force argument, pass on to
2526 handle_explicit_files.
2527 (handle_output_dir_module): Add force argument, pass on to
2529 (handle_implicit_modules): Pass info->force to handle_dwfl_module and
2530 handle_output_dir_module.
2531 (main): Pass info.force to handle_explicit_files.
2533 2014-05-19 Mark Wielaard <mjw@redhat.com>
2535 * elflint.c (check_reloc_shdr): Check ebl_check_reloc_target_type.
2537 2014-05-01 Mark Wielaard <mjw@redhat.com>
2539 * readelf.c (find_no_debuginfo): Call dwfl_standard_find_debuginfo
2540 if looking for alternate debug file.
2542 2014-04-11 Mark Wielaard <mjw@redhat.com>
2544 * Makefile.am (AM_CPPFLAGS): Add -I libdwelf.
2546 2014-04-22 Mark Wielaard <mjw@redhat.com>
2548 * readelf.c (handle_core_item): Make sure variable length array
2549 contains at least enough space for terminating zero char.
2551 2014-04-22 Mark Wielaard <mjw@redhat.com>
2553 * readelf.c (print_gdb_index_section): Use unsigned int for 31 bits
2556 2014-03-13 Mark Wielaard <mjw@redhat.com>
2558 * Makefile.am: Remove no_mudflap.os. Remove libmudflap from all
2560 * strings.c (process_chunk): Remove _MUDFLAP condition.
2562 2014-04-09 Mark Wielaard <mjw@redhat.com>
2564 * readelf.c (print_debug_aranges_section): Don't get the raw section
2565 data, use the possibly decompressed .[z]debug sectiondata.
2566 (print_debug_ranges_section): Likewise.
2567 (print_debug_frame_section): Likewise.
2568 (print_debug_line_section): Likewise.
2569 (print_debug_loc_section): Likewise.
2570 (print_debug_macinfo_section): Likewise.
2571 (print_debug_macro_section): Likewise.
2573 2014-04-10 Mark Wielaard <mjw@redhat.com>
2575 * readelf.c (buf_read_ulong): Pass actual long size to convert.
2577 2014-03-05 Mark Wielaard <mjw@redhat.com>
2579 * readelf.c (attr_callback): Print DW_FORM_sdata values as signed
2582 2014-02-24 Mark Wielaard <mjw@redhat.com>
2584 * readelf (print_phdr): Check there is a SHT_PROGBITS section at the
2585 offset given by p_offsets for a PT_INTERP segment before trying to
2586 display the interpreter string.
2588 2014-02-07 Mark Wielaard <mjw@redhat.com>
2590 * readelf.c (print_phdr): Check phdr->p_filesz and make sure
2591 interpreter string is zero terminated before calling printf.
2593 2014-01-22 Mark Wielaard <mjw@redhat.com>
2595 * Makefile.am (nm_no_Wformat): Removed.
2596 (size_no_Wformat): Likewise.
2597 (strings_no_Wformat): Likewise.
2598 (addr2line_no_Wformat): Likewise.
2599 * size.c (show_sysv): Use fmtstr directly as literal in printf.
2600 (show_sysv_one_line): Likewise.
2601 * strings.c (locfmt): Removed.
2602 (radix): New static enum.
2603 (parse_opt): Set radix, not locfmt.
2604 (process_chunk_mb): Use fmtstr directly as literal in printf based
2606 (process_chunk): Likewise.
2607 * nm.c (show_symbols_sysv): Use fmtstr directly as literal in printf.
2608 (show_symbols_bsd): Likewise.
2609 (show_symbols_posix): Likewise.
2611 2014-01-21 Mark Wielaard <mjw@redhat.com>
2613 * stack.c (show_inlines): New static boolean.
2614 (print_frame): New function split out from...
2615 (print_frames): ..here. If show_inlines is true and we found a
2616 DIE for the frame address, call print_inline_frames otherwise
2617 call print_frame. Keep track of and track frame_nr.
2618 (print_inline_frames): New function.
2619 (parse_opt): Handle '-i'.
2620 (main): Add 'i' to options.
2622 2014-01-27 Mark Wielaard <mjw@redhat.com>
2624 * stack.c (maxframes): Initialize to 256.
2625 (main): Document new default in options. Document magic number
2626 used in frames.allocated initialization.
2628 2014-01-20 Mark Wielaard <mjw@redhat.com>
2630 * stack.c (show_debugname): New static boolean.
2631 (die_name): New function.
2632 (print_frames): If show_debugname is true set symname to the
2633 first function-like DIE with a name in scope for the address in
2635 (parse_opt): Handle '-d'.
2636 (main): Add 'd' to options.
2638 2014-01-20 Mark Wielaard <mjw@redhat.com>
2640 * addr2line.c (handle_address): Initialize scopes to NULL.
2642 2014-01-17 Roland McGrath <roland@redhat.com>
2644 * strip.c (handle_elf): Check for bogus values in sh_link, sh_info,
2645 st_shndx, e_shstrndx, and SHT_GROUP or SHT_SYMTAB_SHNDX data.
2646 Don't use assert on input values, instead bail with "illformed" error.
2648 2014-01-17 Roland McGrath <roland@redhat.com>
2650 * readelf.c (handle_dynamic, handle_symtab): Check for bogus sh_link.
2651 (handle_verneed, handle_verdef, handle_versym, handle_hash): Likewise.
2652 (handle_scngrp): Check for bogus sh_info.
2654 2014-01-17 Jakub Jelinek <jakub@redhat.com>
2656 * elflint.c (section_name): Return "<invalid>" instead of
2657 crashing on invalid section name.
2658 (check_symtab, is_rel_dyn, check_rela, check_rel, check_dynamic,
2659 check_symtab_shndx, check_hash, check_versym): Robustify.
2660 (check_hash): Don't check entries beyond end of section.
2661 (check_note): Don't crash if gelf_rawchunk fails.
2663 2014-01-17 Petr Machata <pmachata@redhat.com>
2665 * readelf.c (handle_dynamic, handle_relocs_rel)
2666 (handle_relocs_rela, handle_versym, print_liblist):
2667 Use gelf_fsize instead of relying on shdr->sh_entsize.
2669 2014-01-14 Mark Wielaard <mjw@redhat.com>
2671 * readelf.c (print_debug_macro_section): Clear vendor array before
2674 2014-01-15 Jan Kratochvil <jan.kratochvil@redhat.com>
2676 Fix corruption of non-C++ symbols by the demangler.
2677 * nm.c (show_symbols_sysv, show_symbols_bsd, show_symbols_posix)
2678 (show_symbols): Check for _Z.
2679 * stack.c (print_frames) <USE_DEMANGLE>: Check for _Z.
2681 2014-01-02 Mark Wielaard <mjw@redhat.com>
2683 * stack.c (show_raw): Declare unconditionally.
2684 (parse_opt): Handle '-r' unconditionally.
2685 (main): Show "raw" option even without USE_DEMANGLE.
2687 2014-01-02 Mark Wielaard <mjw@redhat.com>
2689 * stack.c (print_frames): Print 0x before build-id hex-offset.
2691 2014-01-02 Mark Wielaard <mjw@redhat.com>
2693 * stack.c (maxframes): Increase to 2048.
2694 (struct frames): Add allocated field.
2695 (frame_callback): If frames used is frames allocated, realloc.
2696 (print_frames): Show an error if maxframes has been reached.
2697 (parse_opt): Allow -n 0 for unlimited frames.
2698 (main): Document -n 0 and new default 2048 frames. Allocate initial
2699 number of frames with malloc.
2701 2013-12-30 Mark Wielaard <mjw@redhat.com>
2703 * stack.c (parse_opt): Explicitly call dwfl_linux_proc_attach
2704 or dwfl_core_file_attach and check for errors.
2706 2013-12-28 Mark Wielaard <mjw@redhat.com>
2708 * stack.c (print_frames): Remove address width code and use...
2709 (get_addr_width): ...this new function.
2710 (show_modules): New static boolean.
2711 (module_callback): New static function.
2712 (parse_opt): Handle '-l'.
2713 (main): Add 'l' to options. If show_modules then use dwfl_getmodules
2714 with module_callback to show all detected modules and possible
2715 build_id, elf and dwarf files.
2717 2013-12-27 Mark Wielaard <mjw@redhat.com>
2719 * stack.c (frames_shown): New static boolean.
2720 (EXIT_OK,EXIT_ERROR,EXIT_BAD,EXIT_USAGES): New defines.
2721 (frame_callback): Return -1 on error. Don't print error.
2722 (print_frames): Add arguments, tid, dwflerr and what. Print tid.
2723 If there was an error report it with address and module if possible.
2724 Record whether any frames were actually printed.
2725 (thread_callback): Collect tid and err, pass it to print_frames.
2726 (parse_opt): Use EXIT_BAD for errors. On ARGP_KEY_END print errno
2727 if dwfl_linux_proc_report returned it. Check whether we are properly
2728 attached with dwfl_pid.
2729 (main): Document exit status. Don't report DWARF_CB_ABORT from
2730 callbacks as error. Pass real errors to print_frames. Return
2731 EXIT_BAD if no frames could be shown. Return EXIT_ERROR if there
2732 were any non-fatal errors.
2734 2013-12-23 Mark Wielaard <mjw@redhat.com>
2736 * Makefile.am (stack_LDADD): Add demanglelib.
2737 * stack.c (show_quiet): New static boolean, default false.
2738 (show_raw): Likewise.
2739 (demangle_buffer_len): New static size_t.
2740 (demangle_buffer): New static char *.
2741 (print_frames): Don't resolve pc name if show_quiet. Demangle name
2743 (parse_opt): Handle '-q' and '-r'.
2744 (main): Add 'q' and 'r' to options. Free demangle_buffer.
2746 2013-12-23 Mark Wielaard <mjw@redhat.com>
2748 * stack.c (OPT_DEBUGINFO): New define.
2749 (OPT_COREFILE): Likewise.
2751 (core_fd): Likewise.
2754 (debuginfo_path): Likewise.
2755 (parse_opt): Handle '-p', '--core', '-e' and '--debuginfo-path'.
2756 Do argument sanity checking. Setup Dwfl.
2757 (main): Add 'p', 'core', 'e' and 'debuginfo-path' to options.
2758 Remove argp_child children, simplify argp doc, remove custom
2759 usage message and construction of dwfl with dwfl_standard_argp.
2760 Use pid directly as tid. close core and core_fd if opened. Print
2761 pid of process or core.
2763 2013-12-23 Mark Wielaard <mjw@redhat.com>
2765 * stack.c (show_build_id): New static boolean.
2766 (print_frames): Print module build-id, load address and pc offset
2767 if show_build_id is true.
2768 (parse_opt): Handle '-b'.
2769 (main): Add -b to options.
2771 2013-12-22 Mark Wielaard <mjw@redhat.com>
2773 * stack.c (maxframes): New static unsigned. Initialize to 64.
2774 (struct frame): New struct.
2775 (struct frames): Likewise.
2776 (dwfl): New static Dwfl pointer.
2777 (frame_callback): Use arg as struct frames and fill it next frame.
2778 Return DWARF_CB_ABORT when maxframes has been reached. Move
2779 printing of frame to...
2780 (print_frames): ...here. New function.
2781 (thread_callback): Use arg as struct frames and set frames to zero.
2783 (parse_opt): Handle '-n'.
2784 (main): Add -n to options. Allocate frames using maxframes. Pass
2785 frames to frame_callback and thread_callback.
2787 2013-12-20 Mark Wielaard <mjw@redhat.com>
2789 * stack.c (show_one_tid): New static boolean.
2790 (parse_opt): Handle '-1'.
2791 (main): Add -1 to options. Call dwfl_getthread_frames when
2792 show_one_tid is true.
2794 2013-12-18 Mark Wielaard <mjw@redhat.com>
2796 * addr2line.c (options): Add symbol-sections, 'x'.
2797 (show_symbol_sections): New static bool.
2798 (parse_opt): Handle 'x'.
2799 (print_addrsym): Use dwfl_module_addrinfo value.r
2800 Also show section of address with show_symbol_sections.
2801 (find_symbol): Use dwfl_module_getsym_info and set value.
2802 (handle_address): Request value and use it instead of sym.st_value.
2803 * readelf.c (format_dwarf_addr): Use dwfl_module_addrinfo to get
2806 2013-12-17 Masatake YAMATO <yamato@redhat.com>
2807 Mark Wielaard <mjw@redhat.com>
2809 * stack.c (show_activation, show_module, show_source): New variables.
2810 (parse_opt): Set show_activation if -a option is given.
2811 Set show_module if -m option is given. Set show_source if -s option
2812 is given. Set all show booleans when -v option is given.
2813 (main): Added `-a', `-m', `-s', and `-v' to the help message.
2814 (frame_callback): Print module and source file information.
2816 2013-11-25 Petr Machata <pmachata@redhat.com>
2818 * elflint.c (valid_e_machine): Add EM_AARCH64.
2820 2013-11-14 Petr Machata <pmachata@redhat.com>
2822 * readelf.c (handle_core_item) <'h'>: New branch for handling
2823 fields that shouldn't be displayed.
2825 2013-11-10 Mark Wielaard <mjw@redhat.com>
2827 * stack.c: Use ARGP_PROGRAM_VERSION_HOOK_DEF and
2828 ARGP_PROGRAM_BUG_ADDRESS_DEF.
2829 (print_version): New function.
2831 2013-11-09 Mark Wielaard <mjw@redhat.com>
2833 * arlib.c (arlib_init): Call snprintf before using the result
2835 (arlib_finalize): Likewise.
2836 * nm.c (show_symbols_sysv): Don't modify cnt inside assert.
2838 2013-11-07 Jan Kratochvil <jan.kratochvil@redhat.com>
2840 * Makefile.am (bin_PROGRAMS): Add stack.
2842 * stack.c: New file.
2844 2013-11-05 Mark Wielaard <mjw@redhat.com>
2846 * readelf.c (print_debug_ranges_section): Cast address to size_t
2848 (print_debug_loc_section): Likewise.
2850 2013-10-18 Mark Wielaard <mjw@redhat.com>
2852 * ar.c (main): Correct operation check when instance_specifed is set.
2854 2013-09-26 Petr Machata <pmachata@redhat.com>
2856 * readelf.c (handle_file_note): New function.
2857 (handle_notes_data): Call it to handle NT_FILE notes.
2859 2013-09-26 Petr Machata <pmachata@redhat.com>
2861 * readelf.c (handle_siginfo_note): New function.
2862 (handle_notes_data): Call it to handle NT_SIGINFO notes.
2863 (buf_read_int, buf_read_ulong, buf_has_data): New functions.
2865 2013-08-13 Mark Wielaard <mjw@redhat.com>
2867 * addr2line.c (options): Add "inlines", 'i'.
2868 (show_inlines): New bool.
2869 (parse_opt): Handle 'i'.
2870 (print_diesym): New static function.
2871 (print_src): New function taking code from...
2872 (handle_address): here. Call print_src. Print inlines.
2874 2013-08-12 Mark Wielaard <mjw@redhat.com>
2876 * addr2line.c (main): If there is a newline char at end of buf,
2879 2013-07-05 Mark Wielaard <mjw@redhat.com>
2881 * readelf.c (print_ops): Take CU as argument, use it to print
2882 parameter_ref DIE offset.
2883 (struct listptr): Replace base field with cu.
2884 (listptr_base): New function.
2885 (compare_listptr): Use listptr_base.
2886 (notice_listptr): Take CU as argument.
2887 (skip_listptr_hole): Likewise.
2888 (print_debug_ranges_section): Pass NULL as CU to skip_listptr_hole.
2889 (print_cfa_program): Pass NULL as CU to print_ops.
2890 (struct attrcb_args): Replace cu_base field with cu.
2891 (attr_callback): Pass cu not cu_base to notice_listptr.
2892 (print_debug_units): Don't calculate base, just set cu.
2893 (print_debug_loc_section): Pass cu to skip_listptr_hole and
2896 2013-05-06 Mark Wielaard <mjw@redhat.com>
2898 * readelf.c (print_ops): Format first DW_OP_GNU_implicit_pointer
2899 argument as DIE offset.
2901 2013-04-24 Mark Wielaard <mjw@redhat.com>
2903 * Makefile.am: Use AM_CPPFLAGS instead of INCLUDES.
2905 2013-03-25 Mark Wielaard <mjw@redhat.com>
2907 * readelf.c (argp_options): Add decodedline.
2908 (decodedline): New boolean initialized to false.
2909 (parse_opt): Set decodedline when arg is decodedline.
2910 (print_decoded_line_section): New function.
2911 (print_debug_line_section): Call print_decoded_line_section when
2912 decodedline is true.
2914 2013-03-25 Mark Wielaard <mjw@redhat.com>
2916 * readelf.c (argp_option): Add decodedaranges.
2917 (decodedaranges): New boolean initialized to false.
2918 (parse_opt): Set decodedaranges when arg is decodedaranges.
2919 (print_debug_aranges_section): Reimplemented and original
2920 implementation renamed to...
2921 (print_decoded_aranges_section): this.
2923 2013-03-25 Mark Wielaard <mjw@redhat.com>
2925 * readelf.c (attrcb_args): Add Dwarf_Die.
2926 (attr_callback): When highpc is in constant form also print as
2928 (print_debug_units): Set args.die.
2930 2013-03-19 Mark Wielaard <mjw@redhat.com>
2932 * readelf.c (print_gdb_index_section): Free format_dwarf_addr results.
2934 2013-03-18 Mark Wielaard <mjw@redhat.com>
2936 * readelf.c (print_gdb_index_section): Accept version 8.
2938 2013-03-01 Mark Wielaard <mjw@redhat.com>
2940 * findtextrel.c (process_file): Release ELF and close file when not
2941 text relocations are found.
2942 * strip.c (handle_elf): Track memory used for .debuglink section data
2945 2013-02-24 Mark Wielaard <mjw@redhat.com>
2947 * elflint.c (check_symtab): Add __bss_start__ to the list of symbols
2948 allowed to have out of section values because of GNU ld bugs.
2950 2013-02-06 Mark Wielaard <mjw@redhat.com>
2952 * elflint.c (check_symtab): Add __bss_start and __TMC_END__ to the
2953 list of symbols allowed to have out of section values because of
2954 GNU ld bugs in either .symtab or .dynsym, but only when they are
2957 2013-01-24 Mark Wielaard <mjw@redhat.com>
2959 * readelf.c (argp_option): Add unresolved-address-offsets, U.
2960 (print_unresolved_addresses): New static.
2961 (parse_opt): Handle 'U', set print_unprocessed_values.
2962 (format_dwarf_addr): Take and handle new raw argument.
2963 (print_ops): Call format_dwarf_addr with raw offset values.
2964 (print_debug_ranges_section): Likewise.
2965 (print_debug_frame_section): Likewise.
2966 (attr_callback): Likewise.
2967 (print_debug_line_section): Likewise.
2968 (print_debug_loc_section): Likewise.
2969 (print_gdb_index_section): Likewise.
2971 2013-01-18 Mark Wielaard <mjw@redhat.com>
2973 * readelf.c (struct listptr): Add base Dwarf_Addr field.
2974 (compare_listptr): Warn for same offset with different base.
2975 (notice_listptr): Take base argument and set it.
2976 (skip_listptr_hole): Likewise.
2977 (struct attrcb_args): Removed unused cu_offset field.
2978 Add cu_base Dwarf_Addr field.
2979 (attr_callback): Call notice_listptr with cbargs->cu_base.
2980 (print_debug_units): Set args.cu_base.
2981 (print_debug_ranges_section): Get base and use for format_dwarf_addr.
2982 (print_debug_loc_section): Likewise.
2984 2013-01-29 Jan Kratochvil <jan.kratochvil@redhat.com>
2986 * readelf.c (handle_core_items): Limit special repeated items handling
2987 to single-item formats '\n', 'b' and 'B', assert OFFSET 0 there.
2989 2012-12-18 Mark Wielaard <mark@bordewijk.wildebeest.org>
2991 * readelf.c (ELF_INPUT_SECTION): New argp key value.
2992 (argp_option): Add elf-section.
2993 (elf_input_section): New static.
2994 (parse_opt): Handle ELF_INPUT_SECTION and set elf_input_section.
2995 (open_input_section): New function.
2996 (process_file): Call open_input_section if elf_input_section set.
2998 2013-01-13 David Abdurachmanov <David.Abdurachmanov@cern.ch>
3000 ar.c (do_oper_delete): Fix num passed to memset.
3002 2012-12-21 Mark Wielaard <mjw@redhat.com>
3004 * readelf.c (print_debug_frame_section): Adjust FDE start address
3005 if pcrel before feeding it to format_dwarf_addr.
3007 2012-12-21 Mark Wielaard <mjw@redhat.com>
3009 * addr2line.c (main): Call dwfl_end.
3011 2012-12-11 Roland McGrath <roland@hack.frob.com>
3013 * nm.c (show_symbols_sysv): Fix size passed to snprintf for invalid
3015 Reported by David Abdurachmanov <David.Abdurachmanov@cern.ch>.
3017 2012-10-16 Mark Wielaard <mjw@redhat.com>
3019 * readelf.c (print_ops): DW_OP_skip and DW_OP_bra targets are
3020 calculated beginning after the operand and 2-byte constant.
3022 2012-10-12 Jan Kratochvil <jan.kratochvil@redhat.com>
3024 * readelf.c (ITEM_WRAP_COLUMN, REGISTER_WRAP_COLUMN): Merge to ...
3025 (WRAP_COLUMN): ... here.
3026 (print_core_item): Remove parameter format_max. Update function
3027 comment. Replace FORMAT_MAX by the real output width.
3028 (handle_core_item): Remove the FORMAT_MAX values in TYPES, DO_TYPE,
3029 calls of print_core_item, remove variable maxfmt, change
3030 ITEM_WRAP_COLUMN to WRAP_COLUMN.
3031 (handle_core_register): Remove the FORMAT_MAX values in TYPES, BITS,
3032 calls of print_core_item, change REGISTER_WRAP_COLUMN to WRAP_COLUMN.
3034 2012-10-11 Jan Kratochvil <jan.kratochvil@redhat.com>
3036 * readelf.c (handle_core_item) <b>: Make run an outer block variable.
3037 Increase run only if LASTBIT != 0. Print last element only if RUN > 0.
3039 2012-08-27 Mark Wielaard <mjw@redhat.com>
3041 * readelf.c (print_debug_macro_section): Print offset as PRIx64.
3043 2012-08-27 Mark Wielaard <mjw@redhat.com>
3045 * readelf.c (register_info): Handle loc == NULL.
3047 2012-08-22 Jeff Kenton <jkenton@tilera.com>
3049 * elflint.c (valid_e_machine): Add EM_TILEGX and EM_TILEPRO.
3051 2012-08-16 Mark Wielaard <mjw@redhat.com>
3053 * readelf.c (dwarf_tag_name): Renamed from dwarf_tag_string.
3054 Uses new dwarf_tag_string or adds ??? or lo_user+%#x when
3056 (dwarf_attr_name): Likewise.
3057 (dwarf_form_name): Likewise.
3058 (dwarf_lang_name): Likewise.
3059 (dwarf_inline_name): Likewise.
3060 (dwarf_encoding_name): Likewise.
3061 (dwarf_access_name): Likewise.
3062 (dwarf_visibility_name): Likewise.
3063 (dwarf_virtuality_name): Likewise.
3064 (dwarf_identifier_case_name): Likewise.
3065 (dwarf_calling_convention_name): Likewise.
3066 (dwarf_ordering_name): Likewise.
3067 (dwarf_discr_list_name): Likewise.
3068 (print_ops): Remove KNOWN. Use dwarf_locexpr_opcode_string.
3069 (attr_callback): Call new dwarf_foobar_name instead of old
3070 dwarf_foobar_string functions.
3071 (dwarf_tag_string): New function using known-dwarf.h macros.
3072 (dwarf_attr_string): Likewise.
3073 (dwarf_form_string): Likewise.
3074 (dwarf_lang_string): Likewise.
3075 (dwarf_inline_string): Likewise.
3076 (dwarf_encoding_string): Likewise.
3077 (dwarf_access_string): Likewise.
3078 (dwarf_visibility_string): Likewise.
3079 (dwarf_virtuality_string): Likewise.
3080 (dwarf_identifier_case_string): Likewise.
3081 (dwarf_calling_convention_string): Likewise.
3082 (dwarf_ordering_string): Likewise.
3083 (dwarf_discr_list_string): Likewise.
3084 (dwarf_locexpr_opcode_string): Likewise.
3086 2012-06-27 Mark Wielaard <mjw@redhat.com>
3088 * readelf.c (dwarf_form_string): Handle DW_FORM_GNU_ref_alt and
3089 DW_FORM_GNU_strp_alt.
3090 (attr_callback): Likewise.
3092 2012-07-30 Petr Machata <pmachata@redhat.com>
3094 * nm.c (show_symbols_bsd): Reorder arguments in {S,}FMTSTRS (and
3095 corresponding printf) so that those that are referenced by only
3096 one of the formatting strings are at the end.
3098 2012-07-29 Mark Wielaard <mjw@redhat.com>
3100 * readelf.c (dwarf_lang_string): Use DW_LANG_ObjC, not DW_LANG_Objc.
3101 (print_ops): Use known[op], not op_name, for DW_OP_GNU_parameter_ref.
3103 2012-07-19 Mark Wielaard <mjw@redhat.com>
3105 * readelf.c (print_ops): Handle DW_OP_GNU_parameter_ref.
3107 2012-07-11 Mark Wielaard <mjw@redhat.com>
3109 * readelf.c (options): Add macro to help of debug-dump.
3110 (section_e): Add section_macro.
3111 (section_all): Add section_macro.
3112 (parse_opt): Handle macro.
3113 (print_debug_macro_section): New function.
3114 (print_debug): Add NEW_SECTION (macro).
3116 2012-07-10 Mark Wielaard <mjw@redhat.com>
3118 * readelf.c (print_gdb_index_section): Add version 7 support.
3119 Keep track of cu_nr. Print kind and static/global flag for each
3120 symbol. When a symbol is in the TU list add 'T'.
3122 2012-06-26 Mark Wielaard <mjw@redhat.com>
3124 * readelf.c (dwarf_attr_string): Add DW_AT_GNU_macros.
3126 2012-06-22 Mark Wielaard <mjw@redhat.com>
3128 * readelf.c (print_ops): Cast printf PRIu/x64 arguments to uint64_t
3129 for gcc 4.7 -Wformat.
3131 2012-05-09 Roland McGrath <roland@hack.frob.com>
3133 * elflint (check_sections): Allow zero sized sections at (filesz) end
3134 of segment. And make check overflow-proofed.
3136 2012-04-24 Mark Wielaard <mjw@redhat.com>
3138 * readelf.c (print_ops): Add DW_OP_GNU_push_tls_address,
3139 DW_OP_GNU_uinit and DW_OP_GNU_encoded_addr.
3141 2012-03-28 Roland McGrath <roland@hack.frob.com>
3143 * elflint.c (special_sections): Accept SHF_INFO_LINK for reloc sections.
3145 2012-03-28 Mark Wielaard <mjw@redhat.com>
3147 * readelf.c (print_debug_abbrev_section): Check there is Dwarf
3149 (print_debug_str_section): Likewise.
3151 2012-03-21 Mark Wielaard <mjw@redhat.com>
3153 * readelf.c (print_gdb_index_section): Accept version 6.
3155 2012-01-31 Mark Wielaard <mjw@redhat.com>
3157 * readelf.c (attr_callback): Don't special case DW_FORM_sec_offset.
3159 2012-01-21 Ulrich Drepper <drepper@gmail.com>
3161 * addr2line.c: Update copyright year.
3163 * elfcmp.c: Likewise.
3164 * elflint.c: Likewise.
3165 * findtextrel.c: Likewise.
3168 * objdump.c: Likewise.
3169 * ranlib.c: Likewise.
3170 * readelf.c: Likewise.
3172 * strings.c: Likewise.
3173 * strip.c: Likewise.
3174 * unstrip.c: Likewise.
3176 * nm.c (argp_children): Define.
3177 (argp): Hook up argp_children.
3178 (handle_ar): Optimize puts call.
3179 (show_symbols_bsd): Use positional parameters to also print color
3180 codes. Don't print STT_FILE symbols.
3181 * objdump.c (options): Improve help text.
3182 (argp_children): Define.
3183 (argp): Hook up argp_children.
3184 (disasm_info): Add elements for color codes.
3185 (disasm_output): Print color codes as well.
3186 (show_disasm): Set up disasm_info data for callback.
3188 2012-01-20 Roland McGrath <roland@hack.frob.com>
3190 * arlib-argp.c (arlib_deterministic_output): Initialize from
3192 (help_filter): New function.
3195 * ar.c (main): Handle oper_none as usage error.
3197 * arlib-argp.c (options, parse_opt): Grok -U as inverse of -D.
3199 * ranlib.c (argp): Use arlib_argp_children.
3201 * arlib.c (arlib_init): Obey arlib_deterministic_output.
3203 * arlib-argp.c: New file.
3204 * Makefile.am (libar_a_SOURCES): Add it.
3205 * arlib.h (arlib_deterministic_output, arlib_argp_children):
3206 Declare new variables.
3207 * ar.c (deterministic_output): Variable removed.
3208 (do_oper_insert): Use arlib_deterministic_output instead.
3209 (options, parse_opt): Don't handle -D here. Add group numbers.
3210 (argp): Use arlib_argp_children.
3212 2011-12-20 Roland McGrath <roland@hack.frob.com>
3214 * readelf.c (print_debug): Initialize DUMMY_DBG.elf.
3215 Reported by Karel Klic <kklic@redhat.com>.
3217 2011-11-05 Roland McGrath <roland@hack.frob.com>
3219 * ar.c (deterministic_output): New flag variable.
3220 (options, parse_opt): Grok -D to set it.
3221 (do_oper_insert): When set, use zero from mtime, uid, and gid.
3223 * ar.c (do_oper_insert): Fix check on elf_rawfile return value.
3225 2011-10-04 Marek Polacek <mpolacek@redhat.com>
3227 * readelf.c (register_info): Assume the right size of an array.
3229 2011-10-03 Ulrich Drepper <drepper@gmail.com>
3231 * nm.c: Recognize option --mark-special. Still recognize --mark-weak
3232 but don't show it in help anymore.
3233 (mark_special): Renamed from mark_weak.
3234 (parse_opt): Adjust.
3235 (class_type_char): Take additional parameters for ELF file and ELF
3236 header. Treat TLS symbols like objects.
3237 In case of D symbols, show u for unique symbols, R for symbols in
3238 read-only sections, B for symbols in BSS sections.
3239 (show_symbols_bsd): Take additional parameters for ELF file and ELF
3240 header. Adjust for class_type_char change. Show TLS symbols with
3241 @ after them in case --mark-special is selected.
3242 (show_symbols_posix): Likewise.
3243 (show_symbols): Adjust calls to show_symbols_bsd and
3245 (show_symbols_sysv): Avoid printing address and size for undefined
3246 symbols. Don't print initial special entry and section entries.
3248 2011-10-02 Ulrich Drepper <drepper@gmail.com>
3250 * Makefile.am (demanglelib): Define.
3251 (nm_LDADD): Add demanglelib.
3252 * nm.c (options): Add -C option.
3253 (demangle): Define as global variable.
3254 (parse_opt): Recognize -C.
3255 (show_symbols_sysv): Handle demangling.
3256 (show_symbols_bad): Likewise.
3257 (show_symbols_posix): Likewise.
3258 (show_symbols): Likewise.
3260 2011-07-09 Roland McGrath <roland@hack.frob.com>
3262 * readelf.c (options, parse_opt): Grok -W/--wide and ignore it.
3264 * ar.c (parse_opt): Grok -u.
3266 2011-05-30 Mark Wielaard <mjw@redhat.com>
3268 * strip.c (relocate): Make offset check overflow-proof.
3270 2011-05-23 Mark Wielaard <mjw@redhat.com>
3272 * strip.c (relocate): Take new arguments is_rela to indicate
3273 whether the relocation is from a SHT_REL or SHT_RELA section.
3274 Relocate against any debug section symbol, not just STT_SECTION
3275 symbols. For SHT_REL relocations, fetch addend from offset and
3276 add it to symbol value if not zero.
3278 2011-05-23 Mark Wielaard <mjw@redhat.com>
3280 * strip.c (OPT_RELOC_DEBUG): New option.
3281 (argp_option): Add new --reloc-debug-sections option.
3282 (main): Check new option.
3283 (parse_opt): Likewise.
3284 (handle_elf): Remove any relocations between debug sections
3285 in ET_REL for the debug file when requested.
3287 2011-05-18 Mark Wielaard <mjw@redhat.com>
3289 * strip.c (handle_elf): Make sure all sections of a removed group
3290 section are removed too. Don't discard SHT_GROUP sections, copy
3291 section table before it gets modified. Section group signature
3292 symbols don't have to be retained.
3294 2011-05-16 Jakub Jelinek <jakub@redhat.com>
3296 * readelf.c (print_ops): Handle DW_OP_GNU_const_type,
3297 DW_OP_GNU_regval_type, DW_OP_GNU_deref_type, DW_OP_GNU_convert
3298 and DW_OP_GNU_reinterpret.
3300 2011-05-17 Mark Wielaard <mjw@redhat.com>
3302 * readelf.c (dwarf_tag_string): Fixup DW_TAG_GNU_call_site and
3303 DW_TAG_GNU_call_site_parameter return strings.
3305 2011-05-11 Marek Polacek <mpolacek@redhat.com>
3307 * nm.c (show_symbols_sysv): Remove unused if/else, remove
3308 unused `prefix' and `fname' parameters.
3310 2011-05-07 Marek Polacek <mpolacek@redhat.com>
3312 * unstrip.c (compare_sections_nonrel): Mark this function as static.
3314 2011-04-26 Mark Wielaard <mjw@redhat.com>
3316 * readelf.c (handle_notes_data): Call ebl_object_note_type_name
3319 2011-04-14 Mark Wielaard <mjw@redhat.com>
3321 * readelf.c (options): Add gdb_index.
3322 (section_e): Define section_gdb_index.
3323 (parse_opt): Recognize gdb_index debug-dump argument.
3324 (print_gdb_index_section): New function.
3325 (print_debug): Add gdb_index to debug_sections.
3327 2011-03-24 Petr Machata <pmachata@redhat.com>
3329 * readelf.c (print_debug_line_section): Emit initial space for all
3330 opcode lines. Print offset in front of each opcode.
3332 2011-03-22 Marek Polacek <mpolacek@redhat.com>
3334 * readelf.c (handle_dynamic): Don't segfault at DT_PLTREL case.
3336 2011-03-22 Mark Wielaard <mjw@redhat.com>
3338 * readelf.c (dwarf_tag_string): Support DW_TAG_GNU_call_site
3339 and DW_TAG_GNU_call_site_parameter.
3340 (dwarf_attr_string): Support DW_AT_GNU_call_site_value,
3341 DW_AT_GNU_call_site_data_value,
3342 DW_AT_GNU_call_site_target,
3343 DW_AT_GNU_call_site_target_clobbered,
3344 DW_AT_GNU_tail_call,
3345 DW_AT_GNU_all_tail_call_sites,
3346 DW_AT_GNU_all_call_sites,
3347 and DW_AT_GNU_all_source_call_sites.
3348 (print_ops): Handle DW_OP_GNU_entry_value.
3349 (attr_callback): Handle DW_AT_GNU_call_site_value,
3350 DW_AT_GNU_call_site_data_value,
3351 DW_AT_GNU_call_site_target,
3352 and DW_AT_GNU_call_site_target_clobbered.
3354 2011-03-10 Mark Wielaard <mjw@redhat.com>
3356 * elflint.c (check_symtab): Use ebl_check_st_other_bits.
3358 2011-02-27 Jan Kratochvil <jan.kratochvil@redhat.com>
3360 * readelf.c (reset_listptr): Clear TABLE->TABLE.
3362 2011-02-25 Mark Wielaard <mjw@redhat.com>
3364 * readelf.c (dwarf_attr_string): Add DW_AT_GNU_* handling.
3365 (dwarf_form_string): Properly format and return unknown form.
3367 2011-02-23 Roland McGrath <roland@redhat.com>
3369 * readelf.c (section_name): New function.
3370 (print_debug_abbrev_section): Use it instead of constant.
3371 (print_debug_aranges_section): Likewise.
3372 (print_debug_ranges_section): Likewise.
3373 (print_debug_units): Likewise.
3374 (print_debug_line_section): Likewise.
3375 (print_debug_loc_section): Likewise.
3376 (print_debug_macinfo_section): Likewise.
3377 (print_debug_pubnames_section): Likewise.
3378 (print_debug_str_section): Likewise.
3379 (print_debug) [USE_ZLIB]: Match .zdebug_* sections too.
3380 (print_debug_abbrev_section): Use decoded d_size, not sh_size.
3381 (print_debug_str_section): Likewise.
3383 * readelf.c (dwarf_attr_string): Grok DW_AT_GNU_odr_signature.
3385 2011-02-11 Roland McGrath <roland@redhat.com>
3387 * elfcmp.c (verbose): New variable.
3388 (options, parse_opt): Grok -l/--verbose to set it.
3389 (main): Under -l, keep going after first difference.
3391 * elfcmp.c (ignore_build_id): New variable.
3392 (options, parse_opt): Grok --ignore-build-id to set it.
3393 (main): For SHT_NOTE sections, compare note details rather than raw
3394 bytes. Under --ignore-build-id, don't complain about differing build
3395 ID contents if lengths match.
3397 2011-02-08 Roland McGrath <roland@redhat.com>
3399 * ldscript.y (filename_id_star): Remove unused variable.
3401 * unstrip.c (copy_elided_sections): Remove unused variable.
3403 * elflint.c (check_dynamic): Remove unused variables.
3405 * elflint.c (check_symtab): Warn about missing xndx section only once.
3407 * ldgeneric.c (check_for_duplicate2): Remove unused variable.
3409 2011-01-06 Roland McGrath <roland@redhat.com>
3411 * strip.c (handle_elf): Under --strip-sections, remove all
3412 non-allocated sections and never generate .gnu_debuglink.
3414 2011-01-04 Roland McGrath <roland@redhat.com>
3416 * strip.c (remove_shdrs): New variable.
3417 (options, parse_opt): Grok --strip-sections to set it.
3418 (handle_elf): When that's set, truncate off .shstrtab and shdrs.
3420 2010-11-10 Roland McGrath <roland@redhat.com>
3422 * findtextrel.c (process_file): Don't assume order of sections.
3423 Reported by Mike Hommey <mh@glandium.org>.
3425 2010-07-26 Roland McGrath <roland@redhat.com>
3427 * readelf.c (print_ops): Handle DW_OP_GNU_implicit_pointer.
3429 2010-08-30 Roland McGrath <roland@redhat.com>
3431 Print .debug_loc/.debug_ranges with cognizance of actual DIE uses.
3432 * readelf.c (parse_opt): Add section_info to implicit_debug_sections
3434 (struct listptr, struct listptr_table): New types.
3435 (compare_listptr, reset_listptr, sort_listptr): New functions.
3436 (notice_listptr, skip_listptr_hole): New functions.
3437 (struct attrcb_args): Add silent member.
3438 (attr_callback): Call notice_listptr for loclistptr and rangelistptr.
3439 Suppress output if silent, but still call notice_listptr.
3440 (print_debug_units): Suppress output if section_info not requested.
3441 (print_debug_loc_section): Call sort_listptr, skip_listptr_hole.
3442 (print_debug_ranges_section): Likewise.
3443 (print_debug): Call reset_listptr on both tables.
3445 * readelf.c (print_debug_ranges_section): Print empty list.
3446 (print_debug_loc_section): Likewise.
3448 * readelf.c (print_debug_loc_section): Check for bogus length
3449 before calling print_ops.
3450 (print_ops): Check harder for bogus data that would read off end.
3452 2010-08-11 Roland McGrath <roland@redhat.com>
3454 * readelf.c (for_each_section_argument): Process all sections with
3455 matching name, not just the first.
3457 2010-07-26 Roland McGrath <roland@redhat.com>
3459 * readelf.c (print_ops): Take new argument for CU version.
3460 Fix DW_OP_call_ref decoding to depend on it.
3461 (print_debug_loc_section): Update caller.
3462 (print_cfa_program): Take new argument, pass it down.
3463 (print_debug_frame_section): Update caller.
3464 (struct attrcb_args): New member version.
3465 (print_debug_units): Initialize it.
3467 2010-07-02 Roland McGrath <roland@redhat.com>
3469 * readelf.c (print_debug_frame_section): Use format_dwarf_addr for
3472 2010-06-30 Roland McGrath <roland@redhat.com>
3474 * strings.c (main): Use STDIN_FILENO, not STDOUT_FILENO.
3475 Ignore st_size for a non-S_ISREG file descriptor.
3476 (read_block): Move assert after no-mmap bail-out.
3477 (read_block_no_mmap): Fix size calculations for moving buffer remnant.
3479 2010-06-22 Roland McGrath <roland@redhat.com>
3481 * readelf.c (print_debug_line_section): Fix braino in DW_LNS_set_isa.
3483 2010-06-21 Roland McGrath <roland@redhat.com>
3485 * readelf.c (dwarf_tag_string): Handle new v4 tags.
3486 (dwarf_attr_string): Add new attributes.
3487 (dwarf_tag_string): Handle DW_TAG_GNU_*.
3489 * readelf.c (print_ops): Use 64-bit types for LEB128 operands.
3490 (print_cfa_program): Likewise.
3492 2010-06-20 Roland McGrath <roland@redhat.com>
3494 * readelf.c (print_debug_units): New function, broken out of ...
3495 (print_debug_info_section): ... here. Call it.
3496 (print_debug_types_section): New function.
3497 (enum section_e): Add section_types alias for section_info.
3498 (print_debug): Add types to the sections table.
3500 * readelf.c (print_debug_frame_section): Handle version 4 format.
3502 * readelf.c (print_debug_line_section): Handle version 4 format.
3504 2010-06-14 Roland McGrath <roland@redhat.com>
3506 * unstrip.c (copy_elided_sections): Make sure all sections' data have
3507 been read in before we write anything out.
3509 2010-06-04 Roland McGrath <roland@redhat.com>
3511 * unstrip.c (update_shdr): New function.
3512 (update_sh_size): Call it instead of gelf_update_shdr.
3513 (adjust_relocs, add_new_section_symbols): Likewise.
3514 (new_shstrtab, copy_elided_sections): Likewise.
3516 * unstrip.c (copy_elided_sections): Bail if stripped file has more
3517 sections than unstripped file, rather than getting confused later.
3519 2010-06-01 Roland McGrath <roland@redhat.com>
3521 * readelf.c (dwarf_form_string): Handle DWARF 4 forms.
3522 (attr_callback): Handle DW_FORM_flag_present, DW_FORM_exprloc,
3523 DW_FORM_sec_offset, DW_FORM_ref_sig8.
3525 * readelf.c (print_debug): Don't bail if libdw setup fails.
3526 Suppress complaint if we only want .eh_frame anyway.
3528 2010-05-28 Ulrich Drepper <drepper@redhat.com>
3530 * readelf.c (attr_callback): Also print form information.
3532 2010-05-19 Roland McGrath <roland@redhat.com>
3534 * addr2line.c (find_symbol): Short-circuit on empty name.
3535 (handle_address): Handle SYMBOL with no +OFFSET.
3537 2010-05-08 Roland McGrath <roland@redhat.com>
3539 * readelf.c (print_ops): Take new arg OFFSET_SIZE.
3540 Use that for DW_OP_call_ref, not ADDRSIZE.
3541 (print_cfa_program): Update caller.
3542 (struct attrcb_args): Add offset_size field.
3543 (attr_callback): Use it for print_ops call.
3544 (print_debug_info_section): Initialize it.
3545 (print_ops): Likewise.
3547 2010-04-14 Roland McGrath <roland@redhat.com>
3549 * readelf.c (handle_core_item): Fix bitmask printing.
3551 2010-04-06 Roland McGrath <roland@redhat.com>
3553 * ld.c (options): Fix some typos in messages.
3554 * elflint.c (check_scn_group, check_group): Likewise.
3555 * ldscript.y (add_id_list): Likewise.
3556 * readelf.c (print_hash_info): Add xgettext:no-c-format magic comment
3557 before translated string containing a literal %.
3559 2010-02-26 Roland McGrath <roland@redhat.com>
3561 * readelf.c (process_file): Don't leak an fd in failure case.
3563 2010-02-15 Roland McGrath <roland@redhat.com>
3565 * Makefile.am: Use config/eu.am for common stuff.
3567 * readelf.c (print_debug_frame_section): Add a cast to avoid sign
3568 mismatch in comparison.
3570 2010-02-02 Roland McGrath <roland@redhat.com>
3572 * readelf.c (print_encoding_base): Handle DW_EH_PE_absptr (zero).
3573 (read_encoded): Likewise.
3574 (print_debug_frame_section): Check for bogus augmentation length.
3575 For P augmentation, use read_encoded, print the encoding description,
3576 and use hex for unsigned values.
3578 2010-01-15 Roland McGrath <roland@redhat.com>
3580 * ar.c: Include <sys/stat.h>.
3581 * elflint.c: Likewise.
3582 * readelf.c: Likewise.
3583 * strip.c: Likewise.
3584 * unstrip.c: Likewise
3586 2010-01-07 Roland McGrath <roland@redhat.com>
3588 * readelf.c (print_ehdr): Handle PN_XNUM.
3589 (phnum): New static variable.
3590 (process_elf_file): Set it with elf_getphdrnum.
3591 (print_phdr): Use phnum instead of EHDR->e_phnum.
3592 (print_dynamic, handle_notes): Likewise.
3593 (handle_relocs_rel, handle_relocs_rela): Likewise.
3595 * elfcmp.c (main): Use elf_getshdrnum and elf_getphdrnum.
3597 * elflint.c (phnum): New static variable.
3598 (check_elf_header): Set it, handling PN_XNUM.
3599 Use that in place of EHDR->e_phnum throughout.
3600 (check_symtab, check_reloc_shdr, check_dynamic): Likewise.
3601 (unknown_dependency_p, check_sections, check_program_header): Likewise.
3603 2010-01-05 Roland McGrath <roland@redhat.com>
3605 * readelf.c (dwarf_attr_string): Match DW_AT_GNU_vector and
3606 DW_AT_GNU_template_name.
3608 2010-01-04 Roland McGrath <roland@redhat.com>
3610 * readelf.c (handle_notes_data): Grab NT_AUXV only for name "CORE".
3611 (handle_core_note): Pass NHDR and NAME to ebl_core_note.
3612 (handle_core_item): Handle .format of '\n' as \n-separated strings.
3614 * readelf.c (implicit_debug_sections): New variable.
3615 (parse_opt): Set it instead of print_debug_sections for -a.
3616 OR them together for print_debug check.
3617 (print_debug): OR them together for section check.
3619 * readelf.c (options): Repartition into set implied by -a and others.
3620 Correct -a text to match reality.
3622 * readelf.c (struct section_argument): Add bool member 'implicit'.
3623 (parse_opt): Set it for -a cases, clear it for -x args.
3624 (for_each_section_argument): Don't complain about a missing section by
3625 name if it's implicit.
3627 2009-11-16 Roland McGrath <roland@redhat.com>
3629 * readelf.c (print_string_section): Punt SHT_NOBITS like empty
3630 sections, just as dump_data_section already does.
3632 2009-09-21 Ulrich Drepper <drepper@redhat.com>
3634 * elflint.c (special_sections): Allow MERGE and STRINGS flags to be
3635 set for .comment section.
3636 Patch by Mark Wielaard <mjw@redhat.com>.
3638 2009-09-08 Roland McGrath <roland@redhat.com>
3640 * ar.c (main): Fix typo in message format.
3642 2009-08-21 Roland McGrath <roland@redhat.com>
3644 * readelf.c (attr_callback): Use print_block only when we don't use
3647 2009-08-14 Roland McGrath <roland@redhat.com>
3649 * ar.c (do_oper_extract): Use pathconf instead of statfs.
3651 2009-08-01 Ulrich Drepper <drepper@redhat.com>
3653 * debugpred.h: Add two most const.
3655 2009-07-26 Mark Wielaard <mjw@redhat.com>
3657 * elflint.c (check_note_data): Recognize NT_GNU_GOLD_VERSION.
3659 2009-07-25 Mark Wielaard <mjw@redhat.com>
3661 * Makefile.am (addr2line_LDADD): Add $(libelf).
3663 2009-07-24 Roland McGrath <roland@redhat.com>
3665 * readelf.c (print_block): New function.
3666 (print_ops): Use it.
3667 (attr_callback): Use it for DW_FORM_block* forms.
3669 2009-07-20 Mark Wielaard <mjw@redhat.com>
3671 * readelf.c (print_ops): Add handling of DW_OP_implicit_value
3672 and DW_OP_stack_value.
3674 2009-07-14 Ulrich Drepper <drepper@redhat.com>
3676 * elflint.c (check_elf_header): Allow Linux ABI.
3677 (check_symtab): Handle STB_GNU_UNIQUE.
3679 2009-07-08 Mark Wielaard <mjw@redhat.com>
3681 * readelf.c (attr_callback): Handle DW_Form constants for
3682 DW_AT_data_member_location.
3684 2009-07-06 Roland McGrath <roland@redhat.com>
3686 * readelf.c (register_info): New function. Handle unknown register #s.
3687 (print_cfa_program): Use it.
3688 (handle_core_register, handle_core_registers): Likewise.
3690 2009-06-28 Roland McGrath <roland@redhat.com>
3692 * readelf.c (print_address_names): New static variable.
3693 (options, parse_opt): Grok -N/--numeric-addresses to clear it.
3694 (format_dwarf_addr): Don't look up name if !print_address_names.
3696 2009-06-13 Ulrich Drepper <drepper@redhat.com>
3698 * ldgeneric.c: Don't use deprecated libelf functions.
3700 * objdump.c: Likewise.
3701 * readelf.c: Likewise.
3703 * strip.c: Likewise.
3704 * unstrip.c: Likewise.
3705 * ld.h: Fix up comment.
3707 2009-06-01 Ulrich Drepper <drepper@redhat.com>
3709 * readelf.c (print_relocs): Expect ELF header argument and pass on
3710 to handle_relocs_rel* functions. Adjust caller.
3711 (handle_relocs_rel): Add ELF header argument. Add special case for
3712 the IRELATIVE relocations in statically linked executables.
3713 (handle_relocs_rela): Likewise.
3715 2009-04-29 Ulrich Drepper <drepper@redhat.com>
3717 * elflint.c (check_symtab): Add tests of st_other field.
3719 2009-04-23 Ulrich Drepper <drepper@redhat.com>
3721 * Makefile [BUILD_STATIC] (libdw): Add $(zip_LIBS).
3723 2009-04-20 Roland McGrath <roland@redhat.com>
3725 * addr2line.c (print_dwarf_function): Honor -s and -A for file names
3726 of inline call sites.
3728 * addr2line.c (just_section): New variable.
3729 (adjust_to_section): New function, broken out of ...
3730 (handle_address): ... here.
3731 (options, parse_opt): Add -j/--section=NAME to set it.
3733 2009-04-15 Roland McGrath <roland@redhat.com>
3735 * readelf.c (print_debug_frame_section): Check for DW_CIE_ID_64 in
3736 64-bit format header, DW_CIE_ID_32 in 32-bit format header.
3738 2009-04-14 Roland McGrath <roland@redhat.com>
3740 * readelf.c (print_attributes): Treat SHT_ARM_ATTRIBUTES on EM_ARM
3741 like SHT_GNU_ATTRIBUTES.
3743 * readelf.c (handle_core_registers): Fix error message.
3745 * strip.c (handle_elf: check_preserved): Don't note any change when
3746 .debug_data is already filled from a previous pass.
3748 2009-02-05 Ulrich Drepper <drepper@redhat.com>
3750 * objdump.c (show_relocs_x): Minor cleanups.
3752 * readelf.c (print_cfa_program): Correct a few labels.
3753 Print first DW_CFA_expression and DW_CFA_val_expression parameter
3756 2009-02-01 Ulrich Drepper <drepper@redhat.com>
3758 * objdump.c (show_relocs_rel, show_relocs_rela): Split common parts
3760 (show_relocs_x): ...here. New function.
3761 (show_relocs): Better spacing in output.
3763 * objdump.c (show_relocs_rela): Show offsets as signed values.
3765 * ar.c (main): Fix recognition of invalid modes for a, b, i modifiers.
3766 Improve some error messages.
3767 Use program_invocation_short_name instead of AR macro.
3768 * Makefile.am (CFLAGS_ar): Remove.
3769 * elflint.c (parse_opt): ARGP_HELP_EXIT_ERR does nothing for argp_help.
3770 * objdump.c (parse_opt): Likewise.
3771 * readelf.c (parse_opt): Likewise.
3773 2009-01-27 Roland McGrath <roland@redhat.com>
3775 * readelf.c (print_ops): Notice short length, don't overrun buffer
3776 (still need to fix LEB128).
3778 * readelf.c (print_ops): Fix DW_OP_call[24] decoding.
3780 * readelf.c (print_ops): Print (empty)\n when LEN == 0.
3782 2009-01-24 Ulrich Drepper <drepper@redhat.com>
3784 * readelf.c (print_debug_frame_section): Fix computation of vma_base
3785 for PC-relative mode.
3787 2009-01-23 Ulrich Drepper <drepper@redhat.com>
3789 * size.c (process_file): When handling archive, close file descriptor
3790 here. For unknown file format also close file descriptor.
3791 (handle_ar): Don't close file descriptor here.
3793 * readelf.c (parse_opt): Move code to add to dump_data_sections and
3794 string_sections list in local function add_dump_section. Adjust 'x'
3795 key handling. For 'a' key add .strtab, .dynstr, and .comment section
3796 to string_sections list.
3798 2009-01-22 Roland McGrath <roland@redhat.com>
3800 * readelf.c (print_phdr): Don't print section mapping when no sections.
3802 * Makefile.am (AM_CFLAGS): Pass -Wno-format for *_no_Wformat.
3804 * readelf.c (print_debug_frame_section): Initialize IS_SIGNED to false
3805 and reset it only for the 'true' cases.
3807 * Makefile.am (addr2line_no_Wformat): New variable.
3809 * readelf.c (print_debug_frame_section): Use t instead of j formats
3810 for ptrdiff_t OFFSET.
3812 2009-01-21 Ulrich Drepper <drepper@redhat.com>
3814 * elflint.c (check_program_header): Fix typo in .eh_frame_hdr section
3815 test. Handle debuginfo files.
3816 (check_exception_data): First sanity test.
3818 2009-01-17 Ulrich Drepper <drepper@redhat.com>
3820 * readelf.c (print_debug_exception_table): Show target of ar_disp
3823 * elflint.c (check_program_header): Add most consistency checks for
3824 PT_GNU_EH_FRAME entry.
3826 * addr2line.c: Use ARGP_PROGRAM_VERSION_HOOK_DEF and
3827 ARGP_PROGRAM_BUG_ADDRESS_DEF.
3829 * elfcmp.c: Likewise.
3830 * elflint.c: Likewise.
3831 * findtextrel.c: Likewise.
3834 * objdump.c: Likewise.
3835 * ranlib.c: Likewise.
3836 * readelf.c: Likewise.
3839 * strings.c: Likewise.
3840 * strip.c: Likewise.
3841 * unstrip.c: Likewise.
3843 2009-01-16 Ulrich Drepper <drepper@redhat.com>
3845 * elflint.c (check_program_header): Check that PT_GNU_EH_FRAME entry
3846 matches .eh_frame_hdr section, if it is available. Also check that
3847 the segment is allocated, not writable, not executable.
3849 * readelf.c: Add -e option. Dump exception and unwind related
3850 sections. Add -e to -a.
3851 (print_encoding_base): Handle DW_EH_PE_omit.
3852 (print_debug_exception_table): Beginning of support.
3853 (print_debug): Hook up print_debug_exception_table for
3854 .gcc_except_table sections.
3856 * readelf.c (print_debug_frame_section): Some fixes for last change.
3858 2009-01-15 Ulrich Drepper <drepper@redhat.com>
3860 * readelf.c (print_encoding): Now a toplevel function.
3861 (print_relinfo): Likewise.
3862 (print_encoding_base): Broken out of print_debug_frame_section.
3863 (print_debug_frame_section): Print different header for .eh_frame
3864 sections. Fix recognition of matching CIEs in .debug_frame sections.
3865 Print absolute offset for PC-relative FDE locations. Don't print
3866 table header for FDEs if the table is empty.
3867 (read_encoded): New function.
3868 (print_debug_frame_hdr_section): New function.
3869 (print_debug): Hook up print_debug_frame_hdr_section for .eh_frame_hdr
3872 * readelf.c (handle_relocs_rel): Print section number.
3873 (print_debug_abbrev_section): Likewise.
3874 (print_debug_aranges_section): Likewise.
3875 (print_debug_ranges_section): Likewise.
3876 (print_debug_info_section): Likewise.
3877 (print_debug_line_section): Likewise.
3878 (print_debug_loc_section): Likewise.
3879 (print_debug_macinfo_section): Likewise.
3880 (print_debug_pubnames_section): Likewise.
3881 (print_debug_str_section): Likewise.
3883 2009-01-10 Ulrich Drepper <drepper@redhat.com>
3885 * strings.c (read_block): Fix typo in error message string.
3887 2009-01-07 Ulrich Drepper <drepper@redhat.com>
3889 * ld.c (ld_new_searchdir): Fix adding to search path list.
3891 2009-01-06 Ulrich Drepper <drepper@redhat.com>
3893 * readelf.c: Implement call frame debug section dumping.
3895 2009-01-05 Roland McGrath <roland@redhat.com>
3897 * elfcmp.c: Exit with status 2 for errors (like cmp, diff, grep).
3898 Status 1 (aka EXIT_FAILURE) is only for completed OK but not equal.
3900 2009-01-01 Ulrich Drepper <drepper@redhat.com>
3902 * addr2line.c: Update copyright year.
3904 * elfcmp.c: Likewise.
3905 * elflint.c: Likewise.
3906 * findtextrel.c: Likewise.
3909 * objdump.c: Likewise.
3910 * ranlib.c: Likewise.
3911 * readelf.c: Likewise.
3913 * strings.c: Likewise.
3914 * strip.c: Likewise.
3915 * unstrip.c: Likewise.
3917 2008-12-11 Roland McGrath <roland@redhat.com>
3919 * nm.c (sym_name): New function.
3920 (show_symbols_sysv): Use it in place of elf_strptr.
3921 (show_symbols_bsd, show_symbols_posix): Likewise.
3924 * nm.c (show_symbols_sysv): Use an alloca'd backup section name when
3927 2008-12-02 Roland McGrath <roland@redhat.com>
3929 * readelf.c (count_dwflmod, process_file): Don't presume encoding of
3930 nonzero OFFSET argument to dwfl_getmodules.
3932 2008-08-07 Roland McGrath <roland@redhat.com>
3934 * addr2line.c (main): Pass string to handle_address.
3935 (see_one_module): New function, subroutine of handle_address.
3936 (find_symbol): Likewise.
3937 (handle_address): Take string argument rather than address.
3938 Convert plain number, or handle strings like "(section)+offset"
3941 2008-08-01 Roland McGrath <roland@redhat.com>
3943 * readelf.c (handle_core_item): Handle 'B' type for 1-origin bitset.
3944 For 'b' and 'B', print <x-y,z> or ~<x,y-z> rather than 1/0 string.
3946 * readelf.c (convert): Take new argument SIZE.
3947 (handle_core_register, handle_core_item): Update callers.
3948 (handle_core_item): Take new arg REPEATED_SIZE.
3949 (handle_core_items): Special case for a singleton item,
3950 let handle_core_item handle repeats if it wants to.
3952 * readelf.c (handle_core_items): Give abridged output
3953 for identical groups repeated more than twice.
3955 2008-07-04 Roland McGrath <roland@redhat.com>
3957 * readelf.c (handle_core_items): Handle ELF_T_ADDR.
3959 2008-04-10 Roland McGrath <roland@redhat.com>
3961 * strip.c (handle_elf): Don't keep sections that kept symbol tables
3962 refer to. Instead, just be sure to preserve the original symbol
3963 table in the debug file so those symbols go with their sections and
3964 can be elided from the stripped version of the symbol table.
3966 * strip.c (handle_elf): When a discarded section kept in the debug
3967 file refers to a nondiscard section via sh_link/sh_info, preserve
3968 that nondiscarded section unmodified in the debug file as well.
3969 Skip adjustment of discarded sections symbol table references when
3970 that symbol table is copied in this way.
3972 * elflint.c (check_symtab): Don't crash from missing symbol names
3973 after diagnosing bogus strtab.
3975 * strip.c (handle_elf): Cosmetic cleanup in special section contents
3976 adjustment for symtab changes.
3978 2008-03-31 Roland McGrath <roland@redhat.com>
3980 * elflint.c (check_sections): Add checks on SHF_EXECINSTR sections:
3981 must be SHT_PROGBITS, must not be SHF_WRITE. Let backend hook
3982 excuse a special section.
3984 2008-03-27 Roland McGrath <roland@redhat.com>
3986 * elflint.c (check_sections): Check that executability and writability
3987 of sections is reflected in segment p_flags.
3989 2008-03-26 Roland McGrath <roland@redhat.com>
3991 * elflint.c (check_program_header): Accept PT_GNU_RELRO p_flags
3992 that matches its PT_LOAD's p_flags &~ PF_W. On sparc, PF_X really
3995 2008-02-29 Roland McGrath <roland@redhat.com>
3997 * readelf.c (print_attributes): Add a cast.
3998 * elflint.c (check_attributes): Likewise.
4000 * unaligned.h (add_8ubyte_unaligned): Cast PTR argument for parity
4001 with [UNALIGNED_ACCESS_CLASS == BYTE_ORDER] definition.
4002 (add_4ubyte_unaligned, add_2ubyte_unaligned): Likewise.
4004 2008-02-03 Ulrich Drepper <drepper@redhat.com>
4006 * i386_ld.c (elf_i386_count_relocations): Implement R_386_TLS_GD
4007 when linked into executable.
4008 (elf_i386_create_relocations): Likewise.
4010 2008-02-20 Roland McGrath <roland@redhat.com>
4012 * readelf.c (print_attributes): New function.
4013 (process_elf_file): Call it under -A.
4015 * elflint.c (check_attributes): Implement it for real.
4017 2008-02-19 Roland McGrath <roland@redhat.com>
4019 * elflint.c (special_sections): Handle .gnu.attributes section.
4020 (check_sections): Likewise.
4021 (check_attributes): New function.
4023 2008-02-10 Roland McGrath <roland@redhat.com>
4025 * elfcmp.c (main): Ignore sh_offset differences in non-SHF_ALLOC
4026 sections and ET_REL files.
4028 2008-02-02 Ulrich Drepper <drepper@redhat.com>
4030 * elf32-i386.script: Add .eh_frame_hdr, .tdata, and .tbss sections.
4031 * i386_ld.c (elf_i386_count_relocations): Handle R_386_TLS_LDO_32
4033 (elf_i386_create_relocations): Likewise.
4034 * ld.h (struct ld_state): Add need_tls, tls_start, and tls_tcb
4036 * ldgeneric.c (add_section): If TLS section is used, set need_tls flag.
4037 (ld_generic_create_outfile): Add PT_TLS entry to program header.
4038 Fix generation of PT_GNU_STACK entry.
4040 2008-02-01 Ulrich Drepper <drepper@redhat.com>
4042 * ld.c (replace_args): Prevent loop over replacements if the parameter
4043 is only two characters long.
4045 * ld.c: Recognize sha1 argument for --build-id parameter.
4046 * ldgeneric.c (create_build_id_section): Handle sha1.
4047 (compute_hash_sum): New function. Broken out of compute_build_id.
4048 Take hash function and context as parameters.
4049 (compute_build_id): Use compute_hash_sum for md5 and the new sha1
4052 2008-01-31 Ulrich Drepper <drepper@redhat.com>
4054 * elf32-i386.script: Add .note.ABI-tag and .note.gnu.build-id sections.
4055 * ld.c: Recognize --build-id command line parameter.
4056 * ld.h: Define scn_dot_note_gnu_build_id.
4057 (struct ld_state): Add build_id and buildidscnidx elements.
4058 * ldgeneric.c: Implement --build-id command line parameter.
4059 * ldlex.l (ID): Recognize - as valid character after the first one.
4061 2008-01-29 Ulrich Drepper <drepper@redhat.com>
4063 * ld.c (replace_args): New function.
4064 (main): Use it to rewrite old-style parameters.
4066 * elf32-i386.script: Add .gnu.hash section.
4067 * ldgeneric.c (optimal_bucket_size): A tiny bit more efficient.
4068 (fillin_special_symbol): Initialize st_size.
4069 (sortfct_hashval): New function.
4070 (create_gnu_hash): New function.
4071 (create_hash): New function.
4072 (ld_generic_create_outfile): Use the new functions to create the
4075 * elflint.c (check_gnu_hash): Fix index value printed in error message.
4077 2008-01-24 Ulrich Drepper <drepper@redhat.com>
4079 * elflint.c (check_group): Check that signature symbol for section
4080 group is not an empty string.
4081 * ldgeneric.c: Remove magic assignment of indices in the dynsym
4082 section. Start implementation of --hash-style.
4083 * i386_ld.c: Likewise.
4084 * ld.c: Recognize --hash-style.
4085 * ld.h (struct scninfo): Add comdat_group.
4086 Add additional parameter to finalize_plt callback.
4088 2008-01-22 Ulrich Drepper <drepper@redhat.com>
4090 * ld.h (struct callbacks): Add initialize_gotplt.
4091 (struct scnhead): Add scn_dot_gotplt.
4092 (struct ld_state): Add gotpltscnidx.
4093 * i386_ld.c (elf_i386_initialize_plt): Minor optimization.
4094 (elf_i386_initialize_pltrel): Likewise.
4095 (elf_i386_initialize_got): There is now a separate .got.plt, so
4096 don't do the PLT-related work here. Initialize d_type.
4097 (elf_i386_initialize_gotplt): New function.
4098 (elf_i386_plt0): Use ud2a after indirect jump.
4099 (elf_i386_pic_plt0_entry): Likewise.
4100 (elf_i386_finalize_plt): Reference now .got.plt.
4101 (elf_i386_count_relocations): For GOT entries which need no relocation
4102 don't bump nrel_got.
4103 (elf_i386_create_relocations): Also get .got.plt. Rewrite R-386_GOT32
4104 handling for split .got/.got.plt.
4105 (elf_i386_ld_init): Initialize callbacks.initialize_gotplt.
4106 * elf32-i386.script: Sort sections for security. There are no .got
4107 input sections. Add .got.plt.
4108 * ldgeneric.c (ld_generic_generate_sections): Add .got.plt section.
4109 (ld_generic_create_outfile): Initialize .got.plt section.
4110 Use .got.plt address for _GLOBAL_OFFSET_TABLE_ symbol and DT_PLTGOT.
4112 2008-01-19 Ulrich Drepper <drepper@redhat.com>
4114 * i386_ld.c (elf_i386_count_relocations): PLT relocations for undefined
4115 symbols are not carried over into statically linked output files.
4116 Add dummy entries for more TLS relocations.
4118 * ld.c (options): Add long names for -( and -).
4120 * ldgeneric.c (check_definition): For newly found definitions don't
4121 mark section as used if symbol is absolute.
4122 (extract_from_archive): Only assign archive sequence number the first
4123 time the archive is handled. Update ld_state.last_archive_used
4124 if any symbol was used. Remove nround variable.
4125 (file_process2): When using symbol from an archive, update
4126 ld_state.group_start_archive, ld_state.archives, and
4127 ld_state.tailarchives.
4128 (ld_generic_file_process): If group is not handled anymore, after
4129 freeing ELF handles for the archives, clear ld_state.archives and
4130 *nextp. Fix wrong logic in recognizing first iteration of group
4131 loop. When clearing flags, also clear ld_state.group_start_archive.
4133 2008-01-11 Ulrich Drepper <drepper@redhat.com>
4135 * objdump.c (show_disasm): Adjust disassembler format string for
4138 2008-01-04 Roland McGrath <roland@redhat.com>
4140 * readelf.c (handle_core_items): Take new arg DESCSZ; if nonzero,
4141 a size greater than the items cover means multiple sets of items.
4142 (handle_core_note): Update caller.
4144 2008-01-04 Roland McGrath <roland@redhat.com>
4146 * strip.c (handle_elf): Move SHDRIDX defn to silence gcc warning.
4148 2008-01-03 Roland McGrath <roland@redhat.com>
4150 * ld.h (linked_from_dso_p): Use __attribute__ ((__gnu_inline__)).
4152 * elflint.c (check_dynamic): Remove duplicate initializer.
4154 2008-01-02 Ulrich Drepper <drepper@redhat.com>
4156 * addr2line.c: Update copyright year.
4158 * elfcmp.c: Likewise.
4159 * elflint.c: Likewise.
4160 * findtextrel.c: Likewise.
4163 * objdump.c: Likewise.
4164 * ranlib.c: Likewise.
4165 * readelf.c: Likewise.
4167 * strings.c: Likewise.
4168 * strip.c: Likewise.
4169 * unstrip.c: Likewise.
4171 2007-12-30 Ulrich Drepper <drepper@redhat.com>
4173 * objdump (show_disasm): Use %e after third parameter.
4175 2007-12-21 Ulrich Drepper <drepper@redhat.com>
4177 * strip.c: Fix wrong parenthesis in a few branch predictions.
4178 * strings.c: Likewise.
4180 2007-12-20 Ulrich Drepper <drepper@redhat.com>
4182 * Makefile.am (DEFS): Add DEBUGPRED.
4183 * addr2line.c: Include debugpred.h.
4185 * elfcmp.c: Likewise.
4186 * elflint.c: Likewise.
4187 * findtextrel.c: Likewise.
4189 * objdump.c: Likewise.
4190 * ranlib.c: Likewise.
4191 * readelf.c: Likewise.
4193 * strings.c: Likewise.
4194 * strip.c: Likewise.
4195 * unstrip.c: Likewise.
4196 * debugpred.h: New file.
4198 * readelf.c (handle_relocs_rel): Use elf_scnshndx.
4199 (handle_relocs_rela): Likewise.
4201 * readelf.c: Add lots of likely/unlikely.
4203 * elflint.c: Minor cleanups.
4205 2007-11-19 Roland McGrath <roland@redhat.com>
4207 * readelf.c (print_ops): Handle all bad op codes gracefully.
4208 Print their numbers instead of just ???.
4210 2007-11-09 Roland McGrath <roland@redhat.com>
4212 * readelf.c (attr_callback): Handle DW_AT_data_location.
4213 Handle block forms to mean a DWARF expression for DW_AT_allocated,
4214 DW_AT_associated, DW_AT_bit_size, DW_AT_bit_offset, DW_AT_bit_stride,
4215 DW_AT_byte_size, DW_AT_byte_stride, DW_AT_count, DW_AT_lower_bound,
4218 2007-10-20 Roland McGrath <roland@redhat.com>
4220 * unstrip.c (options): Update -R description.
4221 (struct symbol): Put symbol details a union with a size_t pointer
4223 (compare_symbols_output): Use null ->name as marker for discard
4224 symbols, not zero *->map.
4225 (copy_elided_sections): Record forwarding pointers for discarded
4226 duplicates and fill SYMNDX_MAP elements through them.
4228 * readelf.c (process_file): Set offline_next_address to 0 at start.
4229 (struct process_dwflmod_args): New type.
4230 (process_dwflmod): Take args in it, pass fd to process_elf_file.
4231 (process_file): Update caller; dup FD for passing to libdwfl.
4232 (process_elf_file): Take new arg FD. For ET_REL file when
4233 displaying data affected by libdwfl relocation, open a new Elf handle.
4235 2007-10-17 Roland McGrath <roland@redhat.com>
4237 * readelf.c (print_debug_line_section): For invalid data inside a
4238 unit with plausible length, keep printing at the next unit boundary.
4240 * readelf.c (attr_callback): Use dwarf_formref_die, not dwarf_formref.
4242 2007-10-16 Roland McGrath <roland@redhat.com>
4244 * readelf.c (hex_dump): Fix rounding error in whitespace calculation.
4246 2007-10-15 Roland McGrath <roland@redhat.com>
4248 * make-debug-archive.in: New file.
4249 * Makefile.am (EXTRA_DIST): Add it.
4250 (make-debug-archive): New target.
4251 (bin_SCRIPTS, CLEANFILES): Add it.
4253 2007-10-10 Roland McGrath <roland@redhat.com>
4255 * elflint.c (special_sections): Add new attrflag value exact_or_gnuld.
4256 Use it to check MERGE|STRINGS for .debug_str.
4257 (check_sections): Handle exact_or_gnuld.
4259 2007-10-08 Roland McGrath <roland@redhat.com>
4261 * readelf.c (handle_core_item): Handle 'T'|0x80 to indicate
4262 64-bit struct timeval with 32-bit tv_usec.
4264 2007-10-07 Roland McGrath <roland@redhat.com>
4266 * readelf.c (check_archive_index): New function.
4267 (process_file): Call it. Change signature to take only fd and name.
4268 Use libdwfl to open the file, then iterate on its modules (multiple
4269 for an archive) to print file name and call process_elf_file.
4270 (main): Update caller. Let process_file do elf_begin.
4271 (count_dwflmod, process_dwflmod, find_no_debuginfo): New functions.
4272 (process_elf_file): Take only Dwfl_Module * argument.
4273 Don't print the file name here.
4274 (print_debug_*_section): Take Dwfl_Module * argument.
4275 (print_debug): Likewise. Update caller.
4276 (format_dwarf_addr): New function.
4277 (print_debug_ranges_section): Use it.
4278 (attr_callback): Likewise.
4279 (print_debug_line_section, print_debug_loc_section): Likewise.
4281 * readelf.c (print_debug_ranges_section): Translate all strings.
4282 (print_debug_loc_section): Likewise.
4284 * unstrip.c (copy_elided_sections): Initialize SEC.
4286 * ar.c (do_oper_insert): Put trailing / on short names.
4288 * arlib.h (MAX_AR_NAME_LEN): Decrease by one.
4290 * arlib2.c (arlib_add_long_name): Adjust for header size.
4292 * arlib.c (arlib_finalize): Pad long name table to keep size even.
4294 * ar.c (do_oper_insert): Use write_retry for padding write.
4296 * ar.c (do_oper_insert): Initialize CUR_OFF in no_old case.
4297 Unconditionally set FOUND[CNT]->elf when setting ->mem.
4298 (remember_long_name): New function.
4299 (do_oper_insert): Call it. Correctly use length of basename,
4300 not original name. Don't store long name twice for new member.
4302 2007-10-06 Roland McGrath <roland@redhat.com>
4304 * elflint.c (check_note): Skip empty segment.
4305 (check_note_section): Skip empty section.
4307 * unstrip.c (options, parse_opt, struct arg_info): Grok -R/--relocate.
4308 (handle_output_dir_module, handle_implicit_modules): Pass it down.
4309 (handle_dwfl_module): When set, use ET_REL already loaded by Dwfl.
4310 (compare_alloc_sections): Take new arg REL, ignore address if true.
4311 (compare_sections): Likewise, pass it down.
4312 (compare_sections_rel, compare_sections_nonrel): New functions.
4313 (find_alloc_sections_prelink, copy_elided_sections): Use them
4314 instead of compare_sections.
4315 (sections_match): New function, broken out of ...
4316 (find_alloc_section): ... here.
4317 (copy_elided_sections): Reorganize section match-up logic.
4318 Use sections_match for SHF_ALLOC in ET_REL.
4319 For ET_REL, let the nonzero sh_addr from the debug file dominate.
4321 * unstrip.c (add_new_section_symbols): Take new arg REL.
4322 When true, do not update section symbol values.
4323 (collect_symbols): Likewise. Update section symbols with address
4324 of chosen output section, not original section.
4325 (check_symtab_section_symbols, copy_elided_sections): Update callers.
4327 * unstrip.c (compare_alloc_sections): At the same address, preserve
4328 original section order.
4330 * elflint.c (special_sections): Don't require MERGE|STRINGS for
4331 .debug_str, it didn't always have them with older tools.
4333 * elflint.c (check_symtab, check_one_reloc): Ignore sh_addr in ET_REL.
4335 2007-10-05 Roland McGrath <roland@redhat.com>
4337 * elflint.c (check_symtab): Allow SHN_UNDEF _GLOBAL_OFFSET_TABLE_ in
4340 * elflint.c (check_symtab): For _GLOBAL_OFFSET_TABLE_, diagnose
4341 SHN_UNDEF as "bad section". Use shndx value in messages.
4343 * elflint.c (special_sections): Add ".debug_str". Decrement namelen
4344 for ".debug" so it matches as a prefix.
4345 (IS_KNOWN_SPECIAL): New macro.
4346 (check_sections): Use it for ".plt" match. Cite wrong SHT_NOBITS
4347 type even under -d, for a .debug* or .shstrtab section.
4349 * readelf.c (print_ops): Use hex for address operand.
4351 2007-10-04 Roland McGrath <roland@redhat.com>
4353 * unstrip.c (copy_elided_sections): Initialize NDX_SECTION element for
4354 .gnu_debuglink section to SHN_UNDEF. Drop STT_SECTION symbols for
4355 sections mapped to SHN_UNDEF.
4357 2007-10-04 Ulrich Drepper <drepper@redhat.com>
4359 * readelf.c (dump_archive_index): Avoid warning about uninitialized
4360 variable with older glibc versions.
4361 Add some branch prediction.
4363 2007-10-04 Roland McGrath <roland@redhat.com>
4365 * readelf.c (print_archive_index): New variable.
4366 (options, parse_opt): Accept -c/--archive-index to set it.
4367 (dump_archive_index): New function.
4368 (process_file): Take new arg WILL_PRINT_ARCHIVE_INDEX.
4369 Call dump_archive_index on archives if set.
4370 (main): Update caller.
4371 (any_control_option): Give it file scope, moved out of ...
4372 (parse_opt): ... here.
4374 2007-10-03 Roland McGrath <roland@redhat.com>
4376 * unstrip.c (struct arg_info): Add `list' flag.
4377 (options, parse_opt): Grok -n/--list to set it.
4378 (list_module): New function.
4379 (handle_implicit_modules): Call it under -n.
4381 * elflint.c (check_note_section): New function.
4382 (check_sections): Call it for SHT_NOTE.
4384 * readelf.c (handle_notes): Use sections when available.
4386 * elflint.c (check_note_data): New function, broken out of ...
4387 (check_note): ... here. Call it and elf_getdata_rawchunk.
4389 * readelf.c (handle_auxv_note): Take offset as argument, not buffer.
4390 Use elf_getdata_rawchunk and gelf_getauxv.
4391 (handle_notes_data): New function, broken out of ...
4392 (handle_notes): ... here. Call it and elf_getdata_rawchunk.
4394 2007-10-01 Roland McGrath <roland@redhat.com>
4396 * readelf.c (hex_dump): Fix transposed subtraction generating spaces.
4398 * readelf.c (hex_dump): Fix line header to be hex instead of decimal.
4400 2007-09-10 Roland McGrath <roland@redhat.com>
4402 * readelf.c (options): Give -p optional argument, alias --string-dump.
4403 (string_sections, string_sections_tail): New static variables.
4404 (parse_opt): Set them when -p has an argument.
4405 (print_string_section): New function, broken out of ...
4406 (print_strings): ... here. Call it.
4407 (dump_data_section): New function, broken out of ...
4408 (dump_data): ... here. Call it.
4409 (for_each_section_argument): New function, broken out of ...
4410 (dump_data): ... here. Call it.
4411 (dump_strings): New function.
4413 2007-08-31 Roland McGrath <roland@redhat.com>
4415 * readelf.c (print_strings): Typo fix.
4417 2007-08-23 Roland McGrath <roland@redhat.com>
4419 * readelf.c (printf_with_wrap): Function removed.
4420 (REGISTER_WRAP_COLUMN): New macro.
4421 (handle_core_register): Use print_core_item instead.
4422 (struct register_info): New type.
4423 (compare_registers, compare_register_sets): New functions.
4424 (register_bitpos, compare_sets_by_info): New functions.
4425 (handle_core_registers): Use those to segregate and sort registers
4428 * readelf.c (ITEM_WRAP_COLUMN): New macro.
4429 (print_core_item): New function.
4430 (handle_core_item): Use it instead of printf_with_wrap.
4431 (compare_core_items, compare_core_item_groups): New functions.
4432 (handle_core_items): Use them. Sort by group and force line breaks
4435 * readelf.c (handle_core_registers, handle_core_items): New functions,
4437 (handle_core_note): ... here. Call them.
4439 2007-08-22 Roland McGrath <roland@redhat.com>
4441 * unstrip.c (new_shstrtab): New function, broken out of ...
4442 (copy_elided_sections): ... here.
4444 2007-08-20 Roland McGrath <roland@redhat.com>
4446 Avoid local function trampolines in nm binary.
4447 * nm.c (sort_by_address): Move to a static function instead of local
4448 inside show_symbols.
4449 (sort_by_name_strtab): New static variable.
4450 (sort_by_name): Use it. Move to a static function instead of local
4451 inside show_symbols.
4452 (show_symbols): Set sort_by_name_strtab.
4454 2007-08-19 Roland McGrath <roland@redhat.com>
4456 * readelf.c (handle_auxv_note): New function.
4457 (handle_notes): Call it.
4459 * readelf.c (printf_with_wrap, convert): New functions.
4460 (handle_core_item, (handle_core_register): New functions.
4461 (handle_notes): Call those with details from ebl_core_note.
4463 2007-08-12 Roland McGrath <roland@redhat.com>
4465 * elflint.c (check_note): Accept type 0 with name "Linux".
4467 * elflint.c (special_sections): Accept SHF_ALLOC for ".note".
4469 * elflint.c (section_flags_string): Return "none" for 0, not "".
4471 2007-08-11 Roland McGrath <roland@redhat.com>
4473 * elflint.c (check_note): Accept NT_GNU_HWCAP, NT_GNU_BUILD_ID.
4475 2007-08-04 Ulrich Drepper <drepper@redhat.com>
4477 * readelf.c (hex_dump): Use isprint to determine whether to print
4478 character itself or full stop character.
4479 (dump_data): No need to check endp for NULL after strtol call.
4481 2007-08-03 Roland McGrath <roland@redhat.com>
4483 * readelf.c (print_string_sections): New variable.
4484 (options, parse_opt): Handle --strings/-p to set it.
4485 (print_strings): New function.
4486 (process_elf_file): Call it under -p.
4488 * readelf.c (options): Add hidden aliases --segments, --sections,
4489 as taken by binutils readelf.
4491 2007-08-01 Roland McGrath <roland@redhat.com>
4493 * readelf.c (dump_data_sections, dump_data_sections_tail):
4495 (options, parse_opt): Handle --hex-dump/-x, set them.
4496 (hex_dump): New function.
4497 (dump_data): New function, call it.
4498 (process_elf_file): Call it.
4500 2007-07-25 Roland McGrath <roland@redhat.com>
4502 * addr2line.c (show_symbols): New variable.
4503 (print_addrsym): New function.
4504 (handle_address): Call it.
4505 (options, parse_opt): Handle -S/--symbols.
4507 2007-06-05 Ulrich Drepper <drepper@redhat.com>
4509 * addr2line.c: Update for latest autoconf header.
4511 * elfcmp.c: Likewise.
4512 * elflint.c: Likewise.
4513 * findtextrel.c: Likewise.
4515 * ldgeneric.c: Likewise.
4517 * objdump.c: Likewise.
4518 * ranlib.c: Likewise.
4519 * readelf.c: Likewise.
4521 * strings.c: Likewise.
4522 * strip.c: Likewise.
4523 * unstrip.c: Likewise.
4525 2007-05-18 Roland McGrath <roland@redhat.com>
4527 * unstrip.c (copy_elided_sections): Match up non-NOBITS sections with
4528 stripped file, so as not to duplicate a section copied in both.
4530 * strip.c (handle_elf): Keep SHT_NOTE section copies in the debug file.
4532 2007-05-17 Roland McGrath <roland@redhat.com>
4534 * unstrip.c (copy_elided_sections): Don't call gelf_newphdr for 0.
4536 * unstrip.c (handle_file): Tweak BIAS != 0 warning.
4538 * unstrip.c (handle_file): Take new arg CREATE_DIRS. If set,
4539 call make_directories here.
4540 (handle_explicit_files): Take new arg CREATE_DIRS, pass it down.
4541 (handle_dwfl_module): Likewise.
4542 (handle_implicit_modules): Update callers.
4543 (handle_output_dir_module): Likewise. Don't do make_directories here.
4545 * unstrip.c (get_section_name): New function, broken out of ...
4546 (copy_elided_sections): here. Update callers.
4547 (find_alloc_section): Broken out of ...
4548 (copy_elided_sections): ... here. Update caller.
4549 (symtab_count_leading_section_symbols): Take new arg NEWSYMDATA,
4550 update STT_SECTION symbols' st_value fields as a side effect.
4551 (check_symtab_section_symbols): Update caller.
4552 (add_new_section_symbols): Set st_value in symbols added.
4553 (collect_symbols): Reset S->value for STT_SECTION symbols recorded.
4554 Take new arg SPLIT_BSS. Adjust S->shndx recorded for symbols moved
4555 from .bss to .dynbss.
4556 (find_alloc_sections_prelink): New function. Associate debug file
4557 allocated SHT_NOBITS shdrs with stripped moved by prelink via
4558 .gnu.prelink_undo information.
4559 (copy_elided_sections): Call it when we couldn't find every allocated
4560 section. Don't use a debug file non-NOBITS section if SHF_ALLOC.
4561 Take STRIPPED_EHDR arg instead of E_TYPE and PHNUM.
4562 (handle_file): Update callers.
4564 * unstrip.c (copy_elided_sections): Ignore unfound unallocated section
4567 * elflint.c (check_sections): Fix association of segments with
4568 sections when p_memsz > p_filesz.
4570 2007-04-29 Roland McGrath <roland@redhat.com>
4572 * addr2line.c (options, main): Tweak argp group settings to fix
4575 2007-04-28 Roland McGrath <roland@redhat.com>
4577 * strip.c (handle_elf): Update debug file's SHT_NOBITS sections'
4578 sizes to match sections adjusted in the stripped file.
4580 2007-04-24 Roland McGrath <roland@redhat.com>
4582 * elfcmp.c (OPT_HASH_INEXACT): New macro.
4583 (hash_inexact): New variable.
4584 (options, parse_opt): Add --hash-inexact option to set it.
4585 (hash_content_equivalent): New function.
4586 (main): Call it for differing SHT_HASH sections under --hash-inexact.
4588 2007-04-23 Roland McGrath <roland@redhat.com>
4590 * unstrip.c: New file.
4591 * Makefile.am (bin_PROGRAMS): Add it.
4592 (unstrip_LDADD): New variable.
4594 * strip.c (options): Allow --output for -o.
4596 2007-02-15 Ulrich Drepper <drepper@redhat.com>
4598 * readelf.c: Remove unused code. Add a few consts.
4600 2007-02-15 Roland McGrath <roland@redhat.com>
4602 * readelf.c (print_debug): Fix brainos in SHDR test.
4604 2007-02-05 Roland McGrath <roland@redhat.com>
4606 * ar.c: Include <limits.h>, since we use LONG_MAX.
4608 2007-02-05 Ulrich Drepper <drepper@redhat.com>
4610 * ar.c: Add ugly hack to work around gcc complaining that we
4611 ignore fchown's return value.
4612 (do_oper_insert): Handle error when writing padding.
4613 * ranlib.c: Add fchown complain work around.
4615 * arlib.c: Make symtab a global variable. Change all users.
4616 * arlib2.c: Likewise.
4617 * ranlib.c: Likewise.
4619 * arlib.h: Declare it.
4621 2007-01-11 Roland McGrath <roland@redhat.com>
4623 * elflint.c (check_sections): Use ebl_machine_section_flag_check on
4624 SHF_MASKPROC bits separately from generic sh_flags validation.
4626 2007-02-04 Ulrich Drepper <drepper@redhat.com>
4629 * arlib.c: New file.
4630 * arlib2.c: New file.
4631 * arlib.h: New file.
4632 * Makefile (noinst_LIBRARIES): Add libar.
4633 (libar_a_SOURCES): Define.
4635 (CFLAGS_ar): Define.
4636 * ranlib.c: Change to use arlib.
4638 * elflint.c (check_symtab): Work around GNU ld bug which omits
4639 sections but not symbols in those sections.
4641 2007-01-10 Ulrich Drepper <drepper@redhat.com>
4643 * addr2line.c: Update copyright year.
4644 * elfcmp.c: Likewise.
4645 * elflint.c: Likewise.
4646 * findtextrel.c: Likewise.
4649 * objdump.c: Likewise.
4650 * ranlib.c: Likewise.
4651 * readelf.c: Likewise.
4653 * strings.c: Likewise.
4654 * strip.c: Likewise.
4656 2006-12-09 Ulrich Drepper <drepper@redhat.com>
4658 * elflint.c (compare_hash_gnu_hash): New function. Report if the
4659 two hash tables have different content (module expected omission
4660 of undefined symbols).
4662 2006-10-31 Roland McGrath <roland@redhat.com>
4664 * elflint.c (check_program_header): Don't complain about
4665 p_filesz > p_memsz if p_memsz is zero and p_type is PT_NOTE.
4667 2006-09-19 Jakub Jelinek <jakub@redhat.com>
4669 * strip.c (process_file): Disallow -f on archives.
4671 2006-10-09 Roland McGrath <roland@redhat.com>
4673 * Makefile.am (libld_elf_i386.so): Use $(LINK), not $(CC).
4675 2006-08-29 Roland McGrath <roland@redhat.com>
4677 * Makefile.am (MAINTAINERCLEANFILES): New variable.
4679 * readelf.c (handle_relocs_rel): Typo fix, test DESTSHDR properly.
4680 Reported by Christian Aichinger <Greek0@gmx.net>.
4682 * elflint.c (valid_e_machine): Add EM_ALPHA.
4683 Reported by Christian Aichinger <Greek0@gmx.net>.
4685 2006-08-08 Ulrich Drepper <drepper@redhat.com>
4687 * elflint.c (check_dynamic): Don't require DT_HASH for DT_SYMTAB.
4688 Keep track of which "high DT" entries are present.
4689 Check that either old or GNU-style hash table is present.
4690 If GNU-style hash table is used a symbol table is mandatory.
4691 Check that if any prelink entry is present all of them are.
4692 (check_gnu_hash): Only fail for undefined symbols in GNU-style hash
4693 table if they don't refer to functions.
4695 2006-07-17 Roland McGrath <roland@redhat.com>
4697 * elflint.c (struct version_namelist): Use GElf_Versym for `ndx' field.
4698 (add_version): Likewise for argument.
4699 (check_versym): Cast constant to GElf_Versym for comparison.
4701 2006-07-12 Roland McGrath <roland@redhat.com>
4703 * readelf.c (handle_gnu_hash): Add casts for machines where
4704 Elf32_Word != unsigned int.
4706 2006-07-12 Ulrich Drepper <drepper@redhat.com>
4708 * elflint.c (check_sysv_hash64): Fix printf format.
4710 2006-07-11 Roland McGrath <roland@redhat.com>
4712 * addr2line.c (options): English fix in -f doc string.
4714 * addr2line.c (use_comp_dir): New variable.
4715 (options, parse_opt): Grok -A/--absolute to set it.
4716 (handle_address): If set, prepend dwfl_line_comp_dir results to
4717 relative file names.
4719 2006-07-06 Ulrich Drepper <drepper@redhat.com>
4721 * elflint.c: Adjust for latest new hash table format.
4722 * readelf.c: Likewise.
4724 * elflint.c (check_versym): Ignore hidden bit when comparing version
4727 2006-07-05 Ulrich Drepper <drepper@redhat.com>
4729 * ldgeneric.c (ld_generic_create_outfile): Correctly recognize
4730 discarded COMDAT symbols.
4732 * i386_ld.c (elf_i386_count_relocations): Lot of corrections.
4733 (elf_i386_create_relocations): Likewise.
4734 * ld.h (struct symbol): Add local and hidden bits.
4735 * ld.c (create_special_section_symbol): These synthsized symbols
4736 are local and hidden.
4737 * ldgeneric.c (file_process2): Check whether input file matches
4739 (fillin_special_symbol): Create symbols as local and/or hidden
4741 (ld_generic_create_outfile): Make local copy of symbol.
4742 Don't hide global, defined symbols in dynamic symbol table unless
4743 requested. Synthetic symbols have no version information.
4745 * elflint.c: Add support for checking 64-bit SysV-style hash tables.
4746 * readelf.c: Add support for printing 64-bit SysV-style hash tables.
4748 2006-07-04 Ulrich Drepper <drepper@redhat.com>
4750 * elflint.c (is_rel_dyn): Fix and extend DT_RELCOUNT/DT_RELACOUNT
4753 2006-07-03 Ulrich Drepper <drepper@redhat.com>
4755 * elflint.c: Add testing of DT_GNU_HASH.
4756 * readelf.c: Implement showing histogram for DT_GNU_HASH section.
4758 * Makefile.am: Add hacks to create dependency files for non-generic
4761 2006-06-12 Ulrich Drepper <drepper@redhat.com>
4763 * ldgeneric.c (ld_generic_generate_sections): Don't create .interp
4764 section if creating a DSO and no interpreter is given.
4765 (ld_generic_create_outfile): Don't store reference to symbols in
4766 discarded COMDAT groups. Don't create PHDR and INTERP program header
4767 for DSO if no interpreter is specified.
4768 (create_verneed_data): Pretty printing.
4770 * ldscript.y (content): If a DSO is created don't set default
4771 interpreter from linker script.
4773 * i386_ld.c (elf_i386_count_relocations): Do not add relocations
4774 for symbols in discarded COMDAT groups.
4775 (elf_i386_create_relocations): Likewise.
4776 * ld.h (struct scninfo): Add unused_comdat.
4777 * ldgeneric.c (add_section): Also check group signature when
4778 matching COMDAT sections.
4779 (add_relocatable_file): Ignore symbols in COMDAT group which are
4782 * elflint.c (check_one_reloc): For *_NONE relocs only check type
4783 and symbol reference.
4785 2006-06-11 Ulrich Drepper <drepper@redhat.com>
4787 * elflint.c (check_dynamic): Fix checking value of tags which are
4788 offsets in the string section. Make sure DT_STRTAB points to the
4789 section referenced in sh_link.
4791 * ld.c (options): Add headers. Add short option 'R' for '--rpath'.
4793 * ld.c: Recognize --eh-frame-hdr option.
4794 * ld.h (struct ld_state): Add eh_frame_hdr field.
4795 * ldgeneric.c (struct unw_eh_frame_hdr): Define.
4797 * ldgeneric.c (add_section): Use ebl_sh_flags_combine instead of
4799 (add_relocatable_file): Minor optimization of last change.
4800 (match_section): Don't preserve SHF_GROUP flag any longer.
4802 2006-06-10 Ulrich Drepper <drepper@redhat.com>
4804 * ld.c (parse_z_option): Recognize execstack and noexecstack.
4805 Handle record and ignore as position dependent options.
4806 (parse_z_option_2): Handle ignore and record here.
4807 * ld.h (struct ld_state): Add execstack field.
4808 * ldgeneric.c (add_relocatable_file): Recognize .note.GNU-stack
4810 (ld_generic_create_outfile): Fix program header creation in native
4811 linker. Add PT_GNU_STACK program header.
4813 2006-06-09 Ulrich Drepper <drepper@redhat.com>
4815 * i386_ld.c (elf_i386_finalize_plt): Don't change symbol table entries
4816 for PLT entries if there is no local definition.
4818 * ld.c (parse_option): Handle -z ignore like --as-needed and
4819 -z record like --no-as-needed.
4820 * ld.h (struct ld_state): Remove ignore_unused_dsos field.
4821 * ldgeneric.c (new_generated_scn): Always compute ndt_needed by
4822 looping over DSOs. When deciding about adding DT_NEEDED entries
4823 use ->as_needed instead of ignore_unused_dsos.
4825 2006-05-31 Ulrich Drepper <drepper@redhat.com>
4827 * ld.c: Recognize --as-needed and --no-as-needed options.
4828 * ld.h (struct usedfile): Add as_needed field.
4829 (struct ld_state): Likewise.
4830 * ldgeneric.c (ld_handle_filename_list): Copy as_needed flag from
4832 * ldscript.y (filename_id_list): Split to correctly parse all
4834 (mark_as_needed): Fix loop.
4836 2006-05-28 Ulrich Drepper <drepper@redhat.com>
4838 * addr2line.c (print_dwarf_function): Use unsigned type for lineno
4841 2006-05-27 Ulrich Drepper <drepper@redhat.com>
4843 * readelf.c (handle_relocs_rela): Better notations for addon value.
4844 (print_ehdr): Distinguish e_ident[EI_VERSION] from e_version.
4846 2006-04-04 Ulrich Drepper <drepper@redhat.com>
4848 * addr2line.c: Update copyright year.
4849 * elfcmp.c: Likewise.
4850 * elflint.c: Likewise.
4851 * findtextrel.c: Likewise.
4854 * objdump.c: Likewise.
4855 * ranlib.c: Likewise.
4856 * readelf.c: Likewise.
4858 * strings.c: Likewise.
4859 * strip.c: Likewise.
4861 2006-03-09 Roland McGrath <roland@redhat.com>
4863 * Makefile.am (AM_LDFLAGS): New variable.
4865 2006-03-01 Roland McGrath <roland@redhat.com>
4867 * readelf.c (dwarf_tag_string, dwarf_attr_string): Update name tables
4868 for dwarf.h changes matching 3.0 spec.
4869 (dwarf_encoding_string, dwarf_lang_string, print_ops): Likewise.
4871 2005-12-04 Ulrich Drepper <drepper@redhat.com>
4873 * elflint.c (check_one_reloc): If relocation section is not loaded,
4874 don't check whether the relocations modify read-only sections or
4875 loaded and unloaded sections.
4877 2005-11-28 Ulrich Drepper <drepper@redhat.com>
4879 * elflint.c (check_one_reloc): Take additional parameters. Use
4880 them to determine whether relocation is valid in this type of
4881 file. DSOs and executables can contain relocation sections in
4882 unloaded sections which just show the relocations the linker
4883 applied. Adjust all callers.
4884 (check_program_header): Check that PT_PHDR is loaded and that offset
4885 matches the one in the ELF header.
4887 2005-10-26 Roland McGrath <roland@redhat.com>
4889 * nm.c (get_var_range): dwarf_getloclist -> dwarf_getlocation.
4891 2005-09-03 Ulrich Drepper <drepper@redhat.com>
4893 * strip.c (handle_elf): Unify some error messages.
4894 * ld.c (main): Likewise.
4895 * ldgeneric.c (open_elf): Likewise.
4896 * elfcmp.c (main): Likewise.
4897 * elflint.c (check_elf_header): Likewise.
4899 * size.c (process_file): Fix typo in error message.
4901 * readelf.c: Lots of little cleanups. Use _unlocked functions.
4903 2005-09-02 Ulrich Drepper <drepper@redhat.com>
4905 * strings.c (main): Reset elfmap variable after munmap call.
4906 [_MUDFLAP] (map_file): Simplify mudflap debugging by not using mmap.
4908 2005-08-28 Ulrich Drepper <drepper@redhat.com>
4910 * ranlib.c: Don't define pread_retry and write_retry here.
4912 * Makefile.an [BUILD_STATIC] (libdw): Add -ldl.
4913 (CLEANFILES): Add *.gcno *.gcda *.gconv.
4915 * strings.c (process_chunk): Reorder expressions in conditional
4916 (process_chunk_mb): Likewise.
4918 * strings.c: New file.
4919 * Makefile.am (bin_PROGRAMS): Add strings.
4920 (strings_no_Wstring): Define.
4921 (strings_LDADD): Define.
4923 2005-08-27 Roland McGrath <roland@redhat.com>
4925 * addr2line.c (dwarf_diename_integrate): Function removed.
4926 (print_dwarf_function): Use plain dwarf_diename.
4928 2005-08-24 Ulrich Drepper <drepper@redhat.com>
4930 * elflint.c (check_versym): Versioned symbols should not have
4933 2005-08-15 Ulrich Drepper <drepper@redhat.com>
4935 * elflint.c (check_versym): Allow VER_NDX_LOCAL symbols to be
4938 * Makefile.am: Add rules to build ranlib.
4939 * ranlib.c: New file.
4941 2005-08-14 Roland McGrath <roland@redhat.com>
4943 * elflint.c (check_sections): Use ebl_section_type_name and allow any
4944 sh_type it recognizes.
4946 * elflint.c (check_sections): Print unknown flags in hex, don't
4947 truncate high bits. Print section number and name for unknown type.
4949 2005-08-13 Roland McGrath <roland@redhat.com>
4951 * elflint.c (check_program_header): Use ebl_segment_type_name and
4952 allow any p_type it recognizes. Include p_type value in error
4953 message for unknown type.
4955 2005-08-13 Ulrich Drepper <drepper@redhat.com>
4957 * elflint.c (check_symtab): Simplify last change a bit. Pass ehdr
4958 to ebl_check_special_symbol.
4959 (check_sections): Pass ehdr to ebl_bss_plt_p.
4961 2005-08-12 Roland McGrath <roland@redhat.com>
4963 * elflint.c (check_symtab): Check that _GLOBAL_OFFSET_TABLE_ st_shndx
4964 refers to the right section if it's not SHN_ABS.
4965 Let ebl_check_special_symbol override _G_O_T_ value and size checks.
4967 * elflint.c (check_sections): Don't complain about a non-NOBITS
4968 section taking no segment space, if it's sh_size is 0.
4970 * elflint.c (check_sections): Use ebl_bss_plt_p to see if .plt should
4971 be PROGBITS or NOBITS.
4973 * elflint.c (check_symtab): Use ebl_check_special_symbol to override
4974 standard st_value and st_size checks.
4976 2005-07-28 Roland McGrath <roland@redhat.com>
4978 * addr2line.c (options, parse_opt): Don't handle -e here.
4979 (executable): Variable removed.
4980 (argp_children): New static variable.
4981 (argp): Use it. Make const.
4982 (main): Fill in argp_children from dwfl_standard_argp ().
4983 Let libdwfl handle file selection, pass Dwfl handle to handle_address.
4984 (print_dwarf_function): New function. Try to figure out inline chain.
4985 (elf_getname): Function removed, libdwfl does it for us.
4986 (handle_address): Take Dwfl handle instead of Elf, Dwarf handles.
4987 Use dwfl_module_addrname instead of elf_getname.
4988 Use dwfl_module_getsrc and dwfl_lineinfo instead of libdw calls.
4989 * Makefile.am (INCLUDES): Add libdwfl directory to path.
4991 2005-08-10 Ulrich Drepper <drepper@redhat.com>
4993 * strip.c (parse_opt): STATE parameter is now used.
4994 Various little cleanups.
4996 * readelf.c (print_debug_line_section): Correct fallout of renaming
4997 of DW_LNS_set_epilog_begin.
4999 2005-08-08 Roland McGrath <roland@redhat.com>
5001 * strip.c (options, parse_opt): Grok -R .comment for compatibility
5002 with binutils strip. Likewise -d, -S, as aliases for -g.
5003 Likewise ignore -s/--strip-all.
5005 2005-08-07 Roland McGrath <roland@redhat.com>
5007 * strip.c (process_file): Open read-only when using a different output
5010 2005-08-06 Ulrich Drepper <drepper@redhat.com>
5012 * elflint.c (in_nobits_scn): New function.
5013 (check_versym): Allow references for defined symbols against versions
5014 of other DSOs also for symbols in nobits sections.
5015 Move a few variables around.
5017 * Makefile.am (AM_CFLAGS): Avoid duplication.
5018 Link with statis libs if BUILD_STATIC.
5020 2005-08-05 Ulrich Drepper <drepper@redhat.com>
5022 * elflint.c: Many, many more tests. Mostly related to symbol
5023 versioning. Those sections should now be completely checked.
5025 * readelf.c (print_dynamic): Use gelf_offscn.
5027 2005-08-04 Ulrich Drepper <drepper@redhat.com>
5029 * elflint.c: Add lots more tests: more extension symbol table sanity,
5030 versioning section tests, hash table tests. General cleanup.
5032 2005-08-02 Ulrich Drepper <drepper@redhat.com>
5034 * objdump.c: New file.
5035 * Makefile.am (bin_PROGRAMS): Add objdump.
5036 (objdump_LDADD): Define.
5038 * elflint.c (check_reloc_shdr): New function split out from check_rela
5040 (check_one_reloc): New function. Likewise.
5041 (check_rela): Use check_reloc_shdr and check_one_reloc.
5042 (check_rel): Likewise.
5043 (check_program_header): Check that PT_DYNAMIC entry matches .dynamic
5045 Add checks that relocations against read-only segments are flagged,
5046 that the text relocation flag is not set unnecessarily, and that
5047 relocations in one section are either against loaded or not-loaded
5050 2005-08-01 Ulrich Drepper <drepper@redhat.com>
5052 * elfcmp.c (main): Ignore section count and section name string table
5055 2005-07-27 Roland McGrath <roland@redhat.com>
5057 * elfcmp.c: Include <locale.h>.
5059 2005-07-27 Ulrich Drepper <drepper@redhat.com>
5061 * elfcmp.c: Print name and index of differing section.
5063 2005-07-24 Ulrich Drepper <drepper@redhat.com>
5065 * elfcmp.c: Implement comparing gaps between sections.
5067 2005-07-23 Ulrich Drepper <drepper@redhat.com>
5069 * elflint.c: Include libeblP.h instead of libebl.h.
5071 * readelf.c: Likewise.
5072 * elfcmp.c: Likewise.
5074 * elfcmp.c (main): Compare individual ELF header fields, excluding
5075 e_shoff instead of the whole struct at once.
5076 Use ebl_section_strip_p instead of SECTION_STRIP_P.
5077 * strip.c: Use ebl_section_strip_p instead of SECTION_STRIP_P.
5079 2005-07-22 Ulrich Drepper <drepper@redhat.com>
5081 * elfcmp.c (main): Take empty section into account when comparing
5084 * elflint.c (check_dynamic): Check that d_tag value is >= 0 before
5087 2005-07-21 Ulrich Drepper <drepper@redhat.com>
5089 * elfcmp.c: New file.
5090 * Makefile.am (bin_PROGRAMS): Add elfcmp.
5091 (elfcmp_LDADD): Define.
5093 * elflint.c (check_rela): Check that copy relocations only reference
5094 object symbols or symbols with unknown type.
5095 (check_rel): Likewise.
5097 2005-06-08 Roland McGrath <roland@redhat.com>
5099 * readelf.c (print_ops): Add consts.
5101 2005-05-31 Roland McGrath <roland@redhat.com>
5103 * readelf.c (print_debug_abbrev_section): Don't bail after first CU's
5104 abbreviations. Print a header line before each CU section.
5106 * readelf.c (print_debug_loc_section): Fix indentation for larger
5109 2005-05-30 Roland McGrath <roland@redhat.com>
5111 * readelf.c (print_debug_line_section): Print section offset of each
5112 CU's table, so they are easy to find from seeing the stmt_list value.
5114 * readelf.c (dwarf_attr_string): Add all attributes in <dwarf.h>.
5115 (attr_callback): Grok DW_AT_ranges and print offset in hex.
5117 * readelf.c (attr_callback): Add 2 to addrsize * 2 for %#0* format.
5118 (print_debug_ranges_section, print_debug_loc_section): Likewise.
5120 * readelf.c (print_ops): Take different args for indentation control.
5121 (attr_callback): Caller updated.
5122 Grok several more block-form attributes as being location expressions.
5123 For those same attributes with udata forms, format output differently
5124 for location list offset.
5125 (print_debug_loc_section): Implement it for real.
5127 * readelf.c (options): Mention ranges for --debug-dump.
5128 (enum section_e): Add section_ranges.
5129 (parse_opt): Grok "ranges" for -w/--debug-dump.
5130 (print_debug_ranges_section): New function.
5131 (print_debug): Handle .debug_ranges section.
5133 2005-05-30 Ulrich Drepper <drepper@redhat.com>
5135 * readelf.c (handle_notes): At least x86-64 need not have the note
5136 section values aligned to 8 bytes.
5138 2005-05-18 Ulrich Drepper <drepper@redhat.com>
5140 * readelf.c (dwarf_tag_string): Add new tags.
5142 2005-05-08 Roland McGrath <roland@redhat.com>
5144 * strip.c (handle_elf): Don't translate hash and versym data formats,
5145 elf_getdata already did it for us.
5147 2005-05-07 Ulrich Drepper <drepper@redhat.com>
5149 * Makefile.am (findtextrel_LDADD): Add $(libmudflap).
5150 (addr2line_LDADD): Likewise.
5152 2005-05-03 Roland McGrath <roland@redhat.com>
5154 * strip.c (handle_elf): Apply symbol table fixups to discarded
5155 relocation sections when they are being saved in the debug file.
5157 * strip.c (handle_elf): Pass EHDR->e_ident[EI_DATA] to gelf_xlatetom
5158 and gelf_xlatetof, not the native byte order.
5160 * strip.c (parse_opt): Give error if -f or -o is repeated.
5161 (main): Exit if argp_parse returns nonzero.
5163 * strip.c (debug_fname_embed): New variable.
5164 (options, parse_opt): New option -F to set it.
5166 2005-05-07 Ulrich Drepper <drepper@redhat.com>
5168 * readelf.c (parse_opt): Make any_control_option variable
5169 local. Simplify some tests.
5171 2005-05-03 Roland McGrath <roland@redhat.com>
5173 * strip.c (crc32_file): Function removed (now in ../lib).
5175 2005-05-03 Roland McGrath <roland@redhat.com>
5177 * elflint.c (is_debuginfo): New variable.
5178 (options, parse_opt): New option --debuginfo/-d to set it.
5179 (check_sections): If is_debuginfo, don't complain about SHT_NOBITS.
5180 (check_note): If is_debuginfo, don't try to get note contents.
5182 2005-04-24 Ulrich Drepper <drepper@redhat.com>
5184 * readelf.c (print_debug_abbrev_section): Don't print error when end of
5187 2005-04-14 Ulrich Drepper <drepper@redhat.com>
5189 * readelf.c (dwarf_encoding_string): New function.
5190 (dwarf_inline_string): New function.
5191 (dwarf_access_string): New function.
5192 (dwarf_visibility_string): New function.
5193 (dwarf_virtuality_string): New function.
5194 (dwarf_identifier_case_string): New function.
5195 (dwarf_calling_convention_string): New function.
5196 (dwarf_ordering_string): New function.
5197 (dwarf_discr_list_string): New function.
5198 (attr_callback): Decode man more attribute values.
5200 2005-04-01 Ulrich Drepper <drepper@redhat.com>
5202 * addr2line.c: Finish implementation of -f option.
5204 2005-03-29 Ulrich Drepper <drepper@redhat.com>
5206 * addr2line.c: New file.
5207 * Makefile.am (bin_PROGRAMS): Add addr2line.
5208 Define addr2line_LDADD.
5210 * findtextrel.c: Use new dwarf_addrdie function.
5212 * findtextrel.c: Fix usage message and re-add accidentally removed
5215 2005-03-28 Ulrich Drepper <drepper@redhat.com>
5217 * findtextrel.c: New file.
5218 * Makefile: Add rules to build findtextrel.
5220 2005-02-15 Ulrich Drepper <drepper@redhat.com>
5222 * ldlex.l: Provide ECHO definition to avoid warning.
5224 * elflint.c (check_program_header): Fix typo in RELRO test.
5226 * Makefile.am (AM_CFLAGS): Add more warning options.
5227 * elflint.c: Fix warnings introduced by the new warning options.
5228 * i386_ld.c: Likewise.
5231 * ldgeneric.c: Likewise.
5233 * readelf.c: Likewise.
5234 * sectionhash.c: Likewise.
5236 * string.c: Likewise.
5238 2005-02-05 Ulrich Drepper <drepper@redhat.com>
5240 * Makefile.am: Check for text relocations in constructed DSOs.
5242 * Makefile.am [MUDFLAP] (AM_CFLAGS): Add -fmudflap. Link all apps
5245 * ldscript.y: Add as_needed handling.
5246 * ldlex.l: Recognize AS_NEEDED token.
5247 * ld.h (struct filename_list): Add as_needed flag.
5249 2005-02-04 Ulrich Drepper <drepper@redhat.com>
5251 * elflint.c (check_symtab): Correctly determine size of GOT section.
5253 2005-01-19 Ulrich Drepper <drepper@redhat.com>
5255 * ld.c: Remove unnecessary more_help function. Print bug report
5257 * strip.c: Likewise.
5260 * readelf.c: Likewise.
5261 * elflint.c: Likewise.
5263 * elflint.c (main): Don't check for parameter problems here.
5264 (parse_opt): Do it here, where we get informed about some of them
5267 * readelf.c (main): Don't check for parameter problems here.
5268 (parse_opt): Do it here, where we get informed about some of them
5271 2005-01-11 Ulrich Drepper <drepper@redhat.com>
5273 * strip.c: Update copyright year.
5274 * readelf.c: Likewise.
5278 * elflint.c: Likewise.
5280 * elflint.c (check_symtab): Don't warn about wrong size for
5281 _DYNAMIC and __GLOBAL_OFFSET_TABLE__ for --gnu-ld.
5283 2004-10-05 Ulrich Drepper <drepper@redhat.com>
5285 * readelf.c (print_phdr): In section mapping, also indicate
5286 sections in read-only segments.
5288 2004-09-25 Ulrich Drepper <drepper@redhat.com>
5290 * readelf.c: Make compile with gcc 4.0.
5291 * strip.c: Likewise.
5293 2004-08-16 Ulrich Drepper <drepper@redhat.com>
5295 * strip.c (handle_elf): Rewrite dynamic memory handling to use of
5296 allocate to work around gcc 3.4 bug.
5298 2004-01-25 Ulrich Drepper <drepper@redhat.com>
5300 * ldlex.l (invalid_char): Better error message.
5302 2004-01-23 Ulrich Drepper <drepper@redhat.com>
5304 * readelf.c: Print SHT_GNU_LIBLIST sections.
5306 * none_ld.c: New file.
5308 2004-01-21 Ulrich Drepper <drepper@redhat.com>
5310 * Makefile.am: Enable building of machine specific linker.
5312 2004-01-20 Ulrich Drepper <drepper@redhat.com>
5314 * Makefile.am: Support building with mudflap.
5316 * i386_ld.c: Fix warnings gcc 3.4 spits out.
5317 * ldgeneric.c: Likewise.
5318 * ldscript.y: Likewise.
5319 * readelf.c: Likewise.
5320 * strip.c: Likewise.
5322 * readelf.c (print_debug_line_section): Determine address size
5325 2004-01-19 Ulrich Drepper <drepper@redhat.com>
5327 * readelf.c (print_phdr): Show which sections are covered by the
5330 * elflint.c (check_program_header): Check PT_GNU_RELRO entry.
5332 * readelf.c (print_debug_macinfo_section): Implement.
5334 2004-01-18 Ulrich Drepper <drepper@redhat.com>
5336 * readelf.c (print_debug_line_section): Implement.
5338 2004-01-17 Ulrich Drepper <drepper@redhat.com>
5340 * src/elflint.c: Use PACKAGE_NAME instead of PACKAGE.
5341 * src/ld.c: Likewise.
5342 * src/nm.c: Likewise.
5343 * src/readelf.c: Likewise.
5344 * src/size.c: Likewise.
5345 * src/strip.c: Likewise.
5347 * strip.c: Add a few more unlikely. Reduce scope of some variables.
5349 * Makefile.am: Support building with mudflap.
5351 2004-01-16 Ulrich Drepper <drepper@redhat.com>
5353 * readelf.c (print_debug_info_section): Free dies memory.
5355 * readelf.c: Print .debug_info section content.
5357 2004-01-13 Ulrich Drepper <drepper@redhat.com>
5359 * readelf.c (print_shdr): Add support for SHF_ORDERED and SHF_EXCLUDE.
5361 2004-01-12 Ulrich Drepper <drepper@redhat.com>
5363 * readelf.c (print_debug_aranges): Implement using libdw.
5365 2004-01-11 Ulrich Drepper <drepper@redhat.com>
5367 * nm.c: Adjust for Dwarf_Files type and dwarf_lineno interface change.
5369 * readelf.c: Use libdw instead of libdwarf. Not all of the old
5370 behavior is available yet.
5371 * Makefile.am: Link readelf with libdw. Remove libdwarf include path.
5373 2004-01-09 Ulrich Drepper <drepper@redhat.com>
5375 * nm.c (get_local_names): Adjust call to dwarf_nextcu.
5377 * nm.c: Implement getting information about local variables.
5379 2004-01-07 Ulrich Drepper <drepper@redhat.com>
5381 * nm.c: Read also debug information for local symbols.
5383 2004-01-05 Ulrich Drepper <drepper@redhat.com>
5385 * nm.c: Shuffle dwarf handling code around so the maximum column
5386 width can be computed ahead of printing. Avoid collection symbols
5387 which are not printed anyway.
5389 * nm.c: Rewrite dwarf handling to use libdw.
5390 * Makefile.am (AM_CFLAGS): Add -std parameter.
5391 (INCLUDES): Find header in libdw subdir.
5392 (nm_LDADD): Replace libdwarf with libdw.
5394 * elflint.c: Update copyright year.
5395 * readelf.c: Likewise.
5397 * strip.c: Likewise.
5400 2003-12-31 Ulrich Drepper <drepper@redhat.com>
5402 * strip.c (process_file): Close file before returning.
5404 2003-11-19 Ulrich Drepper <drepper@redhat.com>
5406 * readelf.c (handle_dynamic): Make column for tag name wider.
5408 2003-09-29 Ulrich Drepper <drepper@redhat.com>
5410 * readelf.c (handle_dynamic): Always terminate tag name with a space.
5412 2003-09-25 Ulrich Drepper <drepper@redhat.com>
5414 * strip.c (process_file): Don't mmap the input file, we modify the
5415 data structures and don't want the change end up on disk.
5417 2003-09-23 Jakub Jelinek <jakub@redhat.com>
5419 * unaligned.h (union u_2ubyte_unaligned,
5420 union u_4ubyte_unaligned, union u_8ubyte_unaligned): Add
5422 (add_2ubyte_unaligned, add_4ubyte_unaligned,
5423 add_8ubyte_unaligned): Avoid nesting bswap_NN macros.
5424 Read/store value through _ptr->u instead of *_ptr.
5426 2003-09-22 Ulrich Drepper <drepper@redhat.com>
5428 * size.c (show_sysv): Change type of maxlen to int.
5430 * strip.c (handle_elf): Handle the 64-bit archs which is 64-bit
5433 * i386_ld.c: Many many fixes and extensions.
5435 * ldgeneric.c: Likewise.
5437 2003-08-16 Ulrich Drepper <drepper@redhat.com>
5439 * ldgeneric.c (check_definition): Don't add symbol on dso_list if
5440 the reference is from another DSO.
5442 2003-08-15 Ulrich Drepper <drepper@redhat.com>
5444 * ldgeneric.c (find_entry_point): It is no fatal error if no entry
5445 point is found when creating a DSO.
5447 2003-08-14 Ulrich Drepper <drepper@redhat.com>
5449 * ld.c (main): Always call FLAG_UNRESOLVED.
5450 * ldgeneric.c (ld_generic_flag_unresolved): Only complain about
5451 undefined symbols if not creating DSO or ld_state.nodefs is not set.
5453 2003-08-13 Ulrich Drepper <drepper@redhat.com>
5455 * Makefile.in: Depend on libebl.a, not libebl.so.
5457 * ld.c (main): Mark stream for linker script as locked by caller.
5458 (read_version_script): Likewise.
5459 * ldlex.c: Define fread and fwrite to _unlocked variant.
5461 * i386_ld.c (elf_i386_finalize_plt): Replace #ifdefs with uses of
5463 * unaligned.h: Define target_bswap_16, target_bswap_32, and
5465 (store_2ubyte_unaligned, store_4ubyte_unaligned,
5466 store_8ubyte_unaligned): Define using new macros.
5468 2003-08-12 Ulrich Drepper <drepper@redhat.com>
5470 * i386_ld.c (elf_i386_finalize_plt): Use packed structs to access
5471 possibly unaligned memory. Support use of big endian machines.
5473 2003-08-11 Ulrich Drepper <drepper@redhat.com>
5475 * Moved to CVS archive.