1 2018-05-15 Dmitry V. Levin <ldv@altlinux.org>
3 * elflint.c (check_elf_header): Fix typo in error diagnostics.
5 2018-05-15 Mark Wielaard <mark@klomp.org>
7 * readelf.c (print_form_data): Cast comparisons against offset_len to
9 (print_debug_line_section): Print uint64_t as PRIu64.
11 2018-05-11 Mark Wielaard <mark@klomp.org>
13 * readelf.c (print_debug_macro_section): Use libdw_valid_user_form.
14 Use print_form_data for strx and sup strings.
16 2018-05-09 Mark Wielaard <mark@klomp.org>
18 * readelf.c (dwarf_line_content_description_string): New function.
19 (dwarf_line_content_description_name): Likewise.
20 (print_bytes): Likewise.
21 (print_form_data): Likewise. Based on code taken from...
22 (print_debug_macro_section): ...here. Now calls print_form_data
23 and str_offsets_base_off.
24 (print_debug_line_section): Parse DWARF5 header, directory and file
27 2018-05-12 Mark Wielaard <mark@klomp.org>
29 * addr2line.c (main): Add fflush (stdout) after handle_address ()
30 when reading from stdin.
32 2018-04-24 Mark Wielaard <mark@klomp.org>
34 * readelf.c (print_debug_aranges_section): Try elf_rawdata if no
36 (print_debug_ranges_section): Likewise.
37 (print_debug_frame_section): Likewise.
38 (print_debug_line_section): Likewise. Check for data == NULL.
39 (print_debug_loc_section): Likewise.
40 (print_debug_macinfo_section): Likewise.
41 (print_debug_macro_section): Likewise.
43 2018-04-28 Mark Wielaard <mark@klomp.org>
45 * readelf.c (print_debug): If .debug_info is needed implicitly by
46 then handle it first before handling any other debug section.
47 (parse_opt): Set implicit_debug_sections to section_info when
48 showing all debug sections.
50 2018-05-05 Mark Wielaard <mark@klomp.org>
52 * readelf.c (attr_callback): Handle DW_FORM_ref_sup4 and
53 DW_FORM_ref_sup8 as references.
55 2018-04-24 Mark Wielaard <mark@klomp.org>
57 * readelf.c (print_debug_str_section): Take raw section data. Don't
58 use dwarf_getstring, but determine start and end of string from
59 offset and section data directly.
60 (print_debug): Handle ".debug_line_str" like ".debug_str".
62 2018-04-19 Andreas Schwab <schwab@suse.de>
64 * elflint.c (valid_e_machine): Add EM_RISCV.
66 2018-04-16 Mark Wielaard <mark@klomp.org>
68 * readelf.c (print_debug_line_section). In advance_pc, advance
69 using op_addr_advance, not op_advance.
71 2018-04-14 Mark Wielaard <mark@klomp.org>
73 * readelf.c (attr_callback): Only show errors when not silent.
75 2018-03-23 Mark Wielaard <mark@klomp.org>
77 * readelf.c (attr_callback): Handle DW_FORM_strx[1234].
79 2018-03-22 Mark Wielaard <mark@klomp.org>
81 * readelf.c (attr_callback): Handle DW_FORM_addrx[1234].
83 2018-03-28 Mark Wielaard <mark@klomp.org>
85 * readelf.c (handle_sysv_hash): Break bucket chain after nchain
87 (handle_sysv_hash64): Likewise.
89 2018-03-27 Mark Wielaard <mark@klomp.org>
91 * readelf.c (attr_callback): Print dwarf_dieoffset as %PRIx64,
94 2018-03-20 Mark Wielaard <mark@klomp.org>
96 * readelf.c (attr_callback): Report error when DW_AT_decl_file or
97 DW_AT_call_file cannot be resolved.
99 2018-03-06 Mark Wielaard <mark@klomp.org>
101 * readelf.c (print_ops): Handle DW_OP_addrx, DW_OP_constx,
102 DW_OP_implicit_pointer, DW_OP_entry_value, DW_OP_const_type,
103 DW_OP_regval_type, DW_OP_deref_type, DW_OP_xderef_type,
104 DW_OP_convert, DW_OP_reinterpret.
106 2018-03-01 Mark Wielaard <mark@klomp.org>
108 * readelf.c (struct listptr): Add attr field.
109 (compare_listptr): Warn when two listptrs for the same offset have
110 different attributes.
111 (notice_listptr): Take attr as argument and add it to listptr.
112 (skip_listptr_hole): New attr argument.
113 (next_listptr_offset): New function.
114 (print_debug_ranges_section): Pass NULL attr to skip_listptr_hole.
115 (attr_callback): Handle DW_AT_GNU_locviews. Call notice_listptr with
117 (print_debug_loc_section): Keep track of which attr is associated with
118 a listptr. If the attr is DW_AT_GNU_locview print view pairs till the
121 2018-02-09 Mark Wielaard <mark@klomp.org>
123 * elflint.c (check_group): Make sure we can read a complete
124 element when iterating over the group.
126 2018-02-09 Mark Wielaard <mark@klomp.org>
128 * readelf.c (attr_callback): Handle DW_FORM_data16 as Dwarf_Block.
130 2018-02-09 Mark Wielaard <mark@klomp.org>
132 * readelf.c (print_debug_abbrev_section): Print the value of a
133 DW_FORM_implicit_const using dwarf_getabbrevattr_data.
134 (attr_callback): Handle DW_FORM_implicit_const.
136 2018-01-30 Mark Wielaard <mark@klomp.org>
138 * readelf.c (dwarf_unit_string): New function.
139 (dwarf_unit_name): Likewise.
140 (print_debug_units): Use dwarf_get_units and dwarf_cu_die instead
141 of dwarf_next_unit. Print unit type, id and subdie if available.
143 2018-02-09 Joshua Watt <JPEWhacker@gmail.com>
145 * addr2line.c (handle_address): Use FALLTHROUGH macro instead of
147 * elfcompress.c (parse_opt): Likewise.
148 * elflint.c (check_dynamic): Likewise.
149 (check_sections): Likewise.
150 (check_note_data): Likewise.
151 * objdump.c (parse_opt): Likewise.
152 * readelf.c (parse_opt): Likewise.
153 (attr_callback): Likewise.
154 (handle_auxv_note): Likewise.
155 * strings.c (parse_opt): Likewise.
156 * backtrace.c (callback_verify): Likewise.
158 2018-01-25 Mark Wielaard <mark@klomp.org>
160 * readelf.c (print_debug_ranges_section): Initialize cu to last_cu.
161 (print_debug_loc_section): Likewise.
163 2018-01-01 Mark Wielaard <mark@klomp.org>
165 * readelf.c (attr_callback): Use dwarf_form_name for unknown forms.
166 (print_debug_macro_section): Print form using dwarf_form_name.
168 2017-12-28 Mark Wielaard <mark@klomp.org>
170 * readelf.c (print_debug_units): Print DIE offset in error message
173 2017-12-18 Mark Wielaard <mark@klomp.org>
175 * readelf.c (handle_notes_data): Don't use EXIT_FAILURE in error.
176 Adjust error message depending on whether or not we got data.
178 2017-12-07 Mark Wielaard <mark@klomp.org>
180 * readelf.c (print_ops): Update data pointer and print arguments
181 to DW_OP_call2 and DW_OP_call4 as DIE offsets.
183 2017-11-29 Mark Wielaard <mark@klomp.org>
185 * readelf.c (argp_options): Add "section-groups", 'g'.
187 2017-11-29 Mark Wielaard <mark@klomp.org>
189 * readelf.c (print_debug_loc_section): Print CU base and unresolved
190 addresses. Adjust formatting.
192 2017-11-29 Mark Wielaard <mark@klomp.org>
194 * readelf.c (print_debug_ranges_section): Print CU base and unresolved
195 addresses. Adjust formatting.
197 2017-11-29 Mark Wielaard <mark@klomp.org>
199 * readelf.c (attr_callback): Set valuestr to resolved file name
200 for DW_AT_decl_file and DW_AT_call_file.
202 2017-11-29 Mark Wielaard <mark@klomp.org>
204 * readelf.c (print_debug_units): Print abbrev code after DIE tag.
206 2017-11-29 Mark Wielaard <mark@klomp.org>
208 * readelf.c (print_ops): Use only2 space for index. re-indent +5
209 for DW_OP_GNU_entry_value.
211 2017-11-21 Mark Wielaard <mark@klomp.org>
213 * readelf.c (attr_callback): Print attribute name and form in error
214 message. If only the value cannot be retrieved/resolved don't abort.
216 2017-10-03 Mark Wielaard <mark@klomp.org>
218 * readelf.c (attr_callback): Print DIE offset in error messages.
220 2017-11-03 Mark Wielaard <mark@klomp.org>
222 * readelf.c (print_ops): Handle DW_OP_GNU_variable_value. Print
223 referenced DIE as offset.
225 2017-09-10 Mark Wielaard <mark@klomp.org>
227 * ar.c (do_oper_delete): Remove DEBUG conditional check.
228 (no0print): Return bool. Check snprintf return value.
229 (do_oper_insert): Initialize elf. Remove DEBUG conditional check.
230 Check no0print calls succeed. Explicitly elf_end found elfs.
231 (do_oper_extract): Make sure we don't create an empty variable
234 2017-09-01 Mark Wielaard <mark@klomp.org>
236 * stack.c (main): Replace \v in doc string with \n\n.
237 * unstrip.c (main): Likewise.
239 2017-05-04 Ulf Hermann <ulf.hermann@qt.io>
241 * stack.c: Print pid_t using %lld.
243 2017-08-18 Ulf Hermann <ulf.hermann@qt.io>
245 * readelf.c: Hardcode the signal numbers for non-linux systems.
247 2017-07-26 Mark Wielaard <mark@klomp.org>
249 * readelf.c (print_debug_macro_section): Accept either version 4 or
250 version 5. Use DW_MACRO names instead of DW_MACRO_GNU names. Add
251 minimal support for DW_MACRO_define_sup, DW_MACRO_undef_sup,
252 DW_MACRO_import_sup, DW_MACRO_define_strx and DW_MACRO_undef_strx.
254 2017-07-26 Mark Wielaard <mark@klomp.org>
256 * readelf.c (dwarf_defaulted_string): New function.
257 (dwarf_defaulted_name): Likewise.
258 (attr_callback): Use dwarf_defaulted_name to get value of
261 2017-07-20 Mark Wielaard <mark@klomp.org>
263 * strip.c (handle_elf): Deal with data marker symbols pointing to
264 debug sections (they can be removed).
266 2017-07-14 Mark Wielaard <mark@klomp.org>
268 * strip (OPT_KEEP_SECTION): New define.
269 (options): Add documentation for remove-section. Add keep-section.
270 (struct section_pattern): New data type.
271 (keep_secs, remove_secs): New globals.
272 (add_pattern, free_sec_patterns, free_patterns, section_name_matches):
274 (main): Call free_patterns.
275 (parse_opt): Handle 'R' and OPT_KEEP_SECTION. Check remove_comment
277 (handle_elf): Handle and sanity check keep_secs and remove_secs.
279 2017-06-07 Mark Wielaard <mark@klomp.org>
281 * strip.c (handle_elf): Introduce new handle_elf boolean. Use it to
282 determine whether to create an output and/or debug file. Remove new
283 output file on error.
285 2017-06-06 Mark Wielaard <mark@klomp.org>
287 * strip.c (handle_elf): Assume e_shstrndx section can be removed.
289 2017-04-20 Ulf Hermann <ulf.hermann@qt.io>
291 * readelf.c: Include strings.h.
293 2017-04-20 Ulf Hermann <ulf.hermann@qt.io>
295 * unstrip.c: Check shnum for 0 before subtracting from it.
297 2017-04-20 Ulf Hermann <ulf.hermann@qt.io>
299 * readelf.c: Replace YESSTR and NOSTR with gettext ("yes") and
300 gettext ("no"), respectively.
302 2017-04-05 Mark Wielaard <mark@klomp.org>
304 * elflint.c (check_elf_header): Decompress all sections.
306 2017-03-28 Mark Wielaard <mark@klomp.org>
308 * elflint (check_group): Don't check if there is no flag word.
310 2017-03-27 Mark Wielaard <mark@klomp.org>
312 * elflint.c (check_elf_header): Sanity check phnum and shnum.
314 2017-03-27 Mark Wielaard <mark@klomp.org>
316 * elflint.c (check_sysv_hash): Return early if section size is
318 (check_sysv_hash64): Likewise.
319 (check_hash): Calculate expect_entsize to check section size.
321 2017-03-27 Mark Wielaard <mark@klomp.org>
323 * elflint.c (check_symtab_shndx): Check data->d_size.
325 2017-03-24 Mark Wielaard <mjw@redhat.com>
327 * elfcmp.c (main): If n_namesz == 0 then the note name data is the
329 * readelf.c (handle_notes_data): Likewise.
331 2017-03-24 Mark Wielaard <mjw@redhat.com>
333 * readelf.c (handle_gnu_hash): Check inner < max_nsyms before
334 indexing into chain array.
336 2017-02-16 Ulf Hermann <ulf.hermann@qt.io>
338 * addr2line.c: Include printversion.h
340 * elflint.c: Likewise.
342 * objdump.c: Likewise.
343 * ranlib.c: Likewise.
344 * readelf.c: Likewise.
347 * strings.c: Likewise.
349 * elfcmp.c: Include printversion.h, remove system.h include.
350 * elfcompress.c: Likewise.
351 * findtextrel.c: Likewise.
352 * unstrip.c: Likewise.
354 2017-02-14 Ulf Hermann <ulf.hermann@qt.io>
356 * nm.c: Include color.h.
357 * objdump.c: Likewise.
359 2016-12-24 Mark Wielaard <mark@klomp.org>
361 * Makefile.am (findtextrel_LDADD): Add $(libeu).
362 (addr2line_LDADD): Likewise.
363 (elfcmp_LDADD): Likewise.
364 * addr2line.c (print_version): Removed.
365 * ar.c (print_version): Likewise.
366 * elfcmp.c (print_version): Likewise.
367 * elfcompress.c (print_version): Likewise.
368 * elflint.c (print_version): Likewise.
369 * findtextrel.c (print_version): Likewise.
370 * nm.c (print_version): Likewise.
371 * objdump.c: Likewise.
372 * ranlib.c: Likewise.
373 * readelf.c: Likewise.
376 * strings.c: Likewise.
378 * unstrip.c: Likewise.
380 2016-11-17 Mark Wielaard <mjw@redhat.com>
382 * readelf.c (options): Add optional arg SECTION for symbols.
383 (symbol_table_section): New static variable.
384 (parse_opt): Set symbol_table_section on 's'.
385 (print_symtab): Filter on symbol_table_section name is set.
387 2016-11-10 Mark Wielaard <mjw@redhat.com>
389 * ar.c (write_member): Make sure tmpbuf is large enough to contain
390 a starting '/' and ending '\0' char.
391 (do_oper_insert): Likewise.
392 * arlib.c (arlib_finalize): Format tmpbuf as PRId32 decimal.
394 2016-11-02 Mark Wielaard <mjw@redhat.com>
396 * addr2line.c (handle_address): Add fallthrough comment.
397 * elfcompress.c (parse_opt): Adjust fallthrough comment.
398 * elflint.c (parse_opt): Add missing break after 'd' case.
399 (check_sections): Add fallthrough comments.
400 * objdump.c (parse_opt): Add explantion for fallthrough comment.
402 2016-10-22 Kevin Cernekee <cernekee@chromium.org>
404 * unstrip.c: Fix "invalid string offset" error caused by using the
405 unstripped .symtab with the stripped .strtab.
407 2016-10-11 Akihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>
409 * arlib.c: Remove system.h include, add libeu.h include.
410 * arlib2.c: Remove sys/param.h include.
411 * elfcompress.c: Add libeu.h include.
412 * elflint.c: Remove sys/param.h include, add libeu.h include.
414 * objdump.c: Likewise.
415 * ranlib.c: Likewise.
416 * readelf.c: Likewise.
417 * size.c: Remove sys/param.h include.
418 * strings.c: Likewise, add libeu.h include.
420 * unstrip.c: Likewise.
422 2016-10-06 Mark Wielaard <mjw@redhat.com>
424 * strip.c (handle_elf): Don't remove real symbols from allocated
427 2016-08-25 Mark Wielaard <mjw@redhat.com>
429 * strip.c (handle_elf): Recompress with ELF_CHF_FORCE.
431 2016-08-06 Mark Wielaard <mjw@redhat.com>
433 * strip.c (handle_elf): Uncompress and recompress relocation target
434 section if necessary.
436 2016-07-08 Mark Wielaard <mjw@redhat.com>
438 * Makefile.am (strip_LDADD): Add libdw.
439 * elfcompress.c (process_file): Use dwelf_strtab functions instead of
441 * strip.c (handle_elf): Likewise.
442 * unstrip.c (new_shstrtab): Likewise.
444 2016-07-06 Mark Wielaard <mjw@redhat.com>
446 * elf32-i386.script, i386_ld.c, ld.c, ld.h, ldgeneric.c, ldlex.l,
447 ldscript.y, libld_elf_i386.map, none_ld.c, sectionhash.c,
448 sectionhash.h, symbolhash.c, symbolhash.h, unaligned.h,
449 versionhash.c, versionhash.h, xelf.h: Removed.
450 * Makefile.am (YACC): Removed.
451 (AM_YFLAGS): Removed.
452 (AM_LFLAGS): Removed.
453 (native_ld): Removed.
455 (bin_PROGRAMS): Removed ld.
457 (ld_SOURCES): Removed.
458 (noinst_LIBRARIES): Only libar.a.
459 (EXTRA_DIST): Just arlib.h and debugpred.h.
461 (ld_LDFLAGS): Removed.
463 (ldscript.h): Removed.
465 (CLEANFILES): Just *.gconv.
466 (MAINTAINERCLEANFILES): Removed.
468 2016-07-06 Mark Wielaard <mjw@redhat.com>
470 * unstrip.c (copy_elided_sections): Use unstripped_strent[] from
471 index zero, instead of one.
473 2016-06-28 Richard Henderson <rth@redhat.com>
475 * elflint.c (valid_e_machine): Add EM_BPF.
477 2016-04-11 David Abdurachmanov <davidlt@cern.ch>
479 * elfcmp.c (main): Fix self-comparison error with GCC 6.
481 2016-03-21 Mark Wielaard <mjw@redhat.com>
483 * nm.c (show_symbols): Check for malloc size argument overflow.
485 2016-02-13 Mark Wielaard <mjw@redhat.com>
487 * readelf.c (print_scngrp): Call error when gelf_getshdr fails.
488 (print_symtab): Likewise.
489 (handle_hash): Likewise.
490 (dump_data_section): Print a warning if decompressing fails.
491 (print_string_section): Likewise.
493 2016-02-13 Mark Wielaard <mjw@redhat.com>
495 * elfcompress.c (parse_opt): Don't fallthrough after processing -q.
497 2016-02-12 Mark Wielaard <mjw@redhat.com>
499 * strip.c (handle_elf): Correct elf_assert shndxdata check.
501 2016-02-09 Mark Wielaard <mjw@redhat.com>
503 * readelf.c (read_encoded): Move up.
504 (print_cfa_program): Add encoding argument. Use it for read_encoded
505 when reading DW_CFA_set_loc op.
506 (print_debug_frame_section): Pass fde_encoding to print_cfa_program.
508 2016-02-09 Mark Wielaard <mjw@redhat.com>
510 * elflint.c (compare_hash_gnu_hash): Check hash sh_entsize against
511 sizeof (Elf64_Xword). Correct invalid sh_entsize error message
512 section idx and name.
514 2016-01-13 Mark Wielaard <mjw@redhat.com>
516 * elflint.c (check_elf_header): Recognize ELFOSABI_FREEBSD.
518 2016-01-08 Mark Wielaard <mjw@redhat.com>
520 * elfcompress.c (compress_section): Use %zu to print size_t.
521 * readelf.c (print_shdr): Use %zx to print size_t.
523 2015-12-16 Mark Wielaard <mjw@redhat.com>
525 * elfcompress.c: New file.
526 * Makefile.am (bin_PROGRAMS): Add elfcompress.
527 (elfcompress_LDADD): New variable.
529 2015-12-18 Mark Wielaard <mjw@redhat.com>
531 * elflint.c (section_flags_string): Add NEWFLAG COMPRESSED.
532 (check_sections): SHF_COMPRESSED can be on any special section.
533 SHF_COMPRESSED is a valid section flag. SHF_COMPRESSED cannot
534 be used together with SHF_ALLOC or with SHT_NOBITS. Should have
537 2015-10-20 Mark Wielaard <mjw@redhat.com>
539 * readelf.c (options): Expand -z help text.
540 (dump_data_section): Check whether we need and can decompress section
541 data and call elf_rawzdata if so,
542 (print_string_section): Likewise.
543 (elf_contains_chdrs): New function.
544 (process_elf_file): Rename print_unrelocated to print_unchanged,
545 use elf_contains_chdrs.
546 (print_scngrp): Check whether section is compressed before use.
547 (print_symtab): Likewise.
548 (handle_hash): Likewise.
550 2015-10-16 Mark Wielaard <mjw@redhat.com>
552 * readelf.c (argp_option): Describe --decompress,-z.
553 (print_decompress): New bool.
554 (parse_opt): Handle -z.
555 (elf_ch_type_name): New function.
556 (print_shdr): Print section compress information.
558 2015-12-31 Mark Wielaard <mjw@redhat.com>
560 * elflint.c (check_symtab): Add _edata and _end (plus extra underscore
561 variants) to to the list of possibly dangling symbols.
563 2015-12-02 Mark Wielaard <mjw@redhat.com>
565 * nm.c (process_file): Accept fd and pass it on.
566 (handle_elf): Likewise.
567 (find_no_debuginfo): New.
568 (struct getdbg): Likewise.
569 (getdbg_dwflmod): Likewise.
570 (show_symbols): Take fd. If the file is ET_REL use libdwfl to get
573 2015-12-02 Mark Wielaard <mjw@redhat.com>
575 * nm.c (get_local_names): Check for duplicates in local_root tree.
577 2015-12-02 Mark Wielaard <mjw@redhat.com>
579 * unstrip.c (struct data_list): New.
580 (new_data_list): Likewise.
581 (record_new_data): Likewise.
582 (free_new_data): Likewise.
583 (adjust_relocs): Call record_new_data.
584 (add_new_section_symbols): Likewise.
585 (copy_elided_sections): Call free_new_data.
587 2015-12-01 Mark Wielaard <mjw@redhat.com>
589 * elfcmp.c (main): Close ebl1 and ebl2 backends.
591 2015-10-16 Mark Wielaard <mjw@redhat.com>
593 * Makefile.am [BUILD_STATIC](libdw): Add -lz.
594 [BUILD_STATIC](libelf): Likewise.
596 2015-10-16 Mark Wielaard <mjw@redhat.com>
598 * elflint.c (check_symtab): Don't check TLS symbol value against TLS
599 phdr offset in debuginfo files.
600 (check_sections): Don't try to match section offsets to phdrs offsets
603 2015-10-16 Mark Wielaard <mjw@redhat.com>
605 * elflint.c (check_reloc_shdr): Reject only desthdrs if they have both
606 SHF_MERGE and SHF_STRINGS set.
608 2015-10-13 Jose E. Marchesi <jose.marchesi@oracle.com>
610 * elflint.c (check_sections): Do not rely on
611 ebl_check_special_section when checking debuginfo files. Also
612 check that the type of WE sections in debuginfo files is NOBITS.
614 2015-10-13 Mark Wielaard <mjw@redhat.com>
616 * elflint.c (check_program_header): Check relro flags are a subset
617 of the load segment if they don't fully overlap.
619 2015-10-07 Mark Wielaard <mjw@redhat.com>
621 * Makefile.am (ldlex_no_Wstack_usage): New.
622 * ldlex.l ([RWX]): Make cnt unsigned.
624 2015-10-09 Josh Stone <jistone@redhat.com>
626 * elflint.c (main): Replace stat64 and fstat64 with stat and fstat.
627 * readelf.c (process_file): Likewise.
628 (process_elf_file): Replace off64_t with off_t.
629 * findtextrel.c (process_file): Replace open64 with open.
630 * ld.c (main): Replace sizeof (off64_t) with 8.
631 * strings.c: Replace off64_t with off_t throughout.
632 (main): Replace stat64 and fstat64 with stat and fstat.
633 (map_file): Replace mmap64 with mmap.
634 (read_block): Likewise, and replace lseek64 with lseek.
635 * strip.c (handle_elf): Replace ftruncate64 with ftruncate.
636 (process_file): Replace stat64 and fstat64 with stat and fstat.
637 * unstrip.c (parse_opt): Replace stat64 with stat.
638 (handle_file): Replace open64 with open.
639 (open_file): Likewise.
641 2015-10-08 Chih-Hung Hsieh <chh@google.com>
643 * ld.c (determine_output_format): Move recursive nested
644 function "try" to file scope.
646 2015-10-04 Mark Wielaard <mjw@redhat.com>
648 * strip.c (handle_elf): Only sanity check section symbols to not
649 kept discarded sections if we are creating a debug file.
651 2015-10-07 Mark Wielaard <mjw@redhat.com>
653 * unstrip.c (MAX): Removed.
654 (find_alloc_sections_prelink): Allocate exact amount of bytes for
657 2015-10-05 Chih-Hung Hsieh <chh@google.com>
659 * unstrip.c (find_alloc_sections_prelink): Do not allocate
660 on stack union types with variable length arrays; use xmalloc
661 for such dynamic sized objects.
662 * readelf.c (handle_core_item): Likewise, but use alloca
663 for small variable size data object and add assert(count < 128).
665 2015-10-05 Josh Stone <jistone@redhat.com>
667 * Makefile.am (libld_elf_i386.so): Add AM_V_CCLD silencer.
668 (.deps/none_ld.Po): Always silence the dummy command.
669 (make-debug-archive): Add AM_V_GEN and AM_V_at silencers.
671 2015-10-02 Mark Wielaard <mjw@redhat.com>
673 * unstrip.c (copy_elided_sections): Use SH_INFO_LINK_P, not just
676 2015-10-02 Mark Wielaard <mjw@redhat.com>
678 * strip.c (handle_elf): Don't move around allocated NOBITS sections.
679 Don't just mark the section header string table as unused.
680 * unstrip.c (copy_elided_sections): Add header names to strtab if
681 shstrndx equals the symtab strtabndx.
683 2015-09-22 Mark Wielaard <mjw@redhat.com>
685 * strip.c (cleanup_debug): Remove old-style function definitions.
687 2015-09-09 Chih-Hung Hsieh <chh@google.com>
689 * readelf.c (print_debug_exception_table): Initialize variable before
690 it is used, because compiler does not know that error never returns.
691 (dump_arhive_index): Likewise.
693 2015-09-04 Chih-Hung Hsieh <chh@google.com>
695 * elflint.c (check_group): Replace %Z length modifier with %z.
696 (check_note_data): Likewise.
697 * findtextrel.c (process_file): Likewise.
698 * readelf.c (handle_dynamic): Likewise.
699 (handle_symtab): Likewise.
700 (handle_verneed): Likewise.
701 (handle_verdef): Likewise.
702 (handle_versym): Likewise.
703 (print_hash_info): Likewise.
704 (print_decoded_aranges_section): Likewise.
705 (print_debug_aranges_section): Likewise.
706 (print_debug_line_section): Likewise.
707 (hex_dump): Likewise.
708 (dump_data_section): Likewise.
709 (print_string_section): Likewise.
710 (dump_archive_index): Likewise.
711 * unstrip.c (adjust_relocs): Likewise.
712 (collect_symbols): likewise.
713 (get_section_name): Likewise.
714 (find_alloc_sections_prelink): Likewise.
715 (copy_elided_sections): Likewise.
716 * ldscript.y (add_id_list): Add missing '%s'.
718 2015-09-03 Mark Wielaard <mjw@redhat.com>
720 * readelf.c (handle_core_item): Handle right shift >= 32 bits.
722 2015-08-11 Mark Wielaard <mjw@redhat.com>
724 * elflint.c (check_sections): When gnuld and a NOBITS section falls
725 inside a segment make sure any ELF file contents is zero.
727 2015-07-29 Mark Wielaard <mjw@redhat.com>
729 * unstrip.c (sections_flags_match): New function.
730 (sections_match): Use sections_flags_match.
731 (find_alloc_sections_prelink): Only clear matched sections if there
733 (copy_elided_sections): Add SHF_INFO_LINK to shdr_mem.sh_flags if
736 2015-06-27 Pino Toscano <toscano.pino@tiscali.it>
738 * src/strings.c: Define MAP_POPULATE if not defined already.
740 2015-06-27 Mark Wielaard <mjw@redhat.com>
742 * nm.c (show_symbols): First call elf_getdata, then allocate memory.
744 2015-06-18 Mark Wielaard <mjw@redhat.com>
746 * findtextrel.c (process_file): Free segments after use.
748 2015-06-18 Mark Wielaard <mjw@redhat.com>
750 * readelf.c (print_phdr): Make sure phdr2_mem lifetime/scope equals
753 2015-06-18 Mark Wielaard <mjw@redhat.com>
755 * readelf.c (handle_gnu_hash): Free lengths on invalid_data.
757 2015-06-18 Mark Wielaard <mjw@redhat.com>
759 * elflint.c (check_symtab): Only check the PT_TLS phdr if it actually
760 exists. Warn otherwise.
762 2015-06-18 Mark Wielaard <mjw@redhat.com>
764 * nm.c (show_symbols): Check sizeof (sym_mem[0]), not GElf_Sym to
765 known whether or not we stack allocated memory.
767 2015-06-18 Mark Wielaard <mjw@redhat.com>
769 * strings.c (readelf): Use "<unknown>" if we cannot retrieve section
772 2015-06-09 Mark Wielaard <mjw@redhat.com>
774 * addr2line.c (print_dwarf_function): Always free scopes before
777 2015-06-09 Mark Wielaard <mjw@redhat.com>
779 * strip.c (handle_ar): Mark as unused.
780 (process_file): Produce an error when trying to handle an ar.
782 2015-05-30 Mark Wielaard <mjw@redhat.com>
784 * elfcmp.c (main): Only call memcmp when d_size != 0.
786 2015-05-23 Mark Wielaard <mjw@redhat.com>
788 * Makefile.am: Define ldgeneric, readelf, nm, size, strip, elflint,
789 findtextrel, elfcmp objdump, ranlib, ar and unstrip no_Wstack_usage.
791 2015-05-21 Mark Wielaard <mjw@redhat.com>
793 * addr2line.c (handle_address): Set scopes to NULL after free.
795 2015-05-20 Mark Wielaard <mjw@redhat.com>
797 * addr2line.c (OPT_PRETTY): New constant define.
798 (argp_option): Add "pretty-print".
799 (pretty): New static bool.
800 (parse_opt): Set pretty.
801 (print_dwarf_function): Adjust output when pretty is set.
802 (print_addrsym): Likewise.
803 (handle_address): Likewise.
805 2015-05-20 Mark Wielaard <mjw@redhat.com>
807 * Makefile.am (addr2line_LDADD): Add demanglelib.
808 * addr2line.c (argp_option): Move demangle under output format.
809 (demangle): New static bool.
810 (demangle_buffer_len): New static size_t.
811 (demangle_buffer): New static char *.
812 (main): free demangle_buffer.
813 (parse_opt): Set demangle.
814 (symname): New static function.
815 (get_diename): Use symname.
816 (print_dwarf_function): Likewise.
817 (print_addrsym): Likewise.
818 (handle_address): Likewise.
820 2015-05-20 Mark Wielaard <mjw@redhat.com>
822 * addr2line.c (argp_option): Add "addresses", 'a'.
823 (print_addresses): New static bool.
824 (parse_opt): Set print_addresses.
825 (get_addr_width): New static function.
826 (handle_address): Print address if print_addresses is true.
828 2015-05-20 Mark Wielaard <mjw@redhat.com>
830 * addr2line.c (handle_address): Call strtoumax with base 16. Make
831 sure all input has been processed.
833 2015-05-20 Mark Wielaard <mjw@redhat.com>
835 * addr2line (argp_option): Group 'section' under "Input format
838 2015-05-12 Mark Wielaard <mjw@redhat.com>
840 * strip.c (debug_fd): New static variable.
841 (tmp_debug_fname): Likewise.
842 (cleanup_debug): New function using the above to clean up temporary
844 (INTERNAL_ERROR): Call cleanup_debug.
845 (handle_elf): Use debug_fd and tmp_debug_fname statics and call
846 cleanup_debug before any error. Use output_fname instead of fname in
847 error messages when it exists (-o was given). SHT_NOBITS sections
848 can also be moved freely even if SHF_ALLOC is set. Add various
849 sanity checks. Use elf_assert instead of plain assert.
851 2015-05-08 Mark Wielaard <mjw@redhat.com>
853 * nm.c (show_symbols): Call gelf_fsize with EV_CURRENT.
854 * strip.c (handle_elf): Likewise.
856 2015-05-06 Mark Wielaard <mjw@redhat.com>
858 * elflint.c (check_gnu_hash): Return early when 2nd hash function
859 shift too big. Check there is enough data available. Make sure
860 bitmask_words is not zero.
861 (check_verdef): Use Elf64_Word for shdr->sh_info cnt.
862 (check_verneed): Likewise.
863 (check_attributes): Break when vendor name isn't terminated.
864 Add overflow check for subsection_len.
866 2015-05-05 Mark Wielaard <mjw@redhat.com>
868 * nm.c (show_symbols): Handle dwarf_linesrc returning NULL.
870 2015-05-04 Max Filippov <jcmvbkbc@gmail.com>
872 * ar.c (do_oper_extract): Replace struct timeval with struct timespec
873 and futimes with futimens.
874 * strip.c (process_file): Replace struct timeval with struct timespec.
875 (handle_elf, handle_ar): Replace struct timeval with struct timespec
876 in prototype. Replace futimes with futimens.
878 2015-05-04 Max Filippov <jcmvbkbc@gmail.com>
880 * addr2line.c (main): Drop mtrace() call and #include <mcheck.h>.
884 * objdump.c: Likewise.
885 * ranlib.c: Likewise.
888 * unstrip.c: Likewise.
890 2015-05-04 Anthony G. Basile <blueness@gentoo.org>
892 * Makefile.am (readelf_LDADD, nm_LDADD, size_LDADD, strip_LDADD)
893 (ld_LDADD, elflint_LDADD, findtextrel_LDADD, addr2line_LDADD)
894 (elfcmp_LDADD, objdump_LDADD, ranlib_LDADD, strings_LDADD)
895 (ar_LDADD, unstrip_LDADD, stack_LDADD): Append $(argp_LDADD).
897 2015-03-22 Mark Wielaard <mjw@redhat.com>
899 * readelf.c (print_debug_frame_section): Cast start to Dwarf_Off
900 before subtracting cie_id. And cast cie_offset to Dwarf_Off before
903 2015-03-22 Mark Wielaard <mjw@redhat.com>
905 * readelf.c (print_gdb_index_section): Check all offsets used
906 against section d_size.
908 2015-03-17 Mark Wielaard <mjw@redhat.com>
910 * readelf.c (print_debug): Don't return, but always use dummy_dbg.
912 2015-03-17 Mark Wielaard <mjw@redhat.com>
914 * readelf.c (print_gdb_index_section): Add overflow checking for
917 2015-03-14 Mark Wielaard <mjw@redhat.com>
919 * nm.c (INTERNAL_ERROR): Remove __DATE__.
920 * objdump.c (INTERNAL_ERROR): Likewise.
921 * size.c (INTERNAL_ERROR): Likewise.
922 * strip.c (INTERNAL_ERROR): Likewise.
924 2015-03-18 Petr Machata <pmachata@redhat.com>
926 * readelf.c (dwarf_tag_string, dwarf_attr_string)
927 (dwarf_form_string, dwarf_lang_string, dwarf_inline_string)
928 (dwarf_encoding_string, dwarf_access_string)
929 (dwarf_visibility_string, dwarf_virtuality_string)
930 (dwarf_identifier_case_string, dwarf_calling_convention_string)
931 (dwarf_ordering_string, dwarf_discr_list_string)
932 (dwarf_locexpr_opcode_string): Adjust uses of know-dwarf.h macros
933 to match the API changes.
935 2015-03-09 Mark Wielaard <mjw@redhat.com>
937 * elflint.c (compare_hash_gnu_hash): Correct gnu_symbias usage.
939 2015-01-03 Mark Wielaard <mjw@redhat.com>
941 * elfcmp (main): Check section name is not NULL. Check sh_entsize
942 is not zero for symbol tables. Check phdrs are not NULL.
943 (search_for_copy_reloc): Check sh_entsize is not zero.
945 2014-12-30 Mark Wielaard <mjw@redhat.com>
947 * elflint.c (check_scn_group): Check d_buf and name are not NULL.
948 (is_rel_dyn): Check d is not NULL. Check shdr->sh_entsize is not
950 (check_dynamic): Check strshdr is not NULL. Check d_tag is positive.
951 (check_symtab_shndx): Check symshdr and data->d_buf are not NULL.
952 Check shdr and symshdr sh_entsize are not zero.
953 (check_gnu_hash): Make sure maskidx is smaller than bitmask_words.
954 Check symshdr->sh_entsize is not zero. Check data->d_buf is not
956 (compare_hash_gnu_hash): Check sections d_buf are not NULL.
957 Check section data is large enough. Use gnu_symbias.
958 (check_group): Check section val is valid.
959 (has_copy_reloc): Check sh_entsize is not zero.
960 (check_versym): Likewise.
961 (unknown_dependency_p): Likewise.
962 (check_verneed): Break on invalid ref or offset. Don't assert.
963 Report error when next offset is zero, but more vers expected.
964 (check_verdef): Likewise.
965 (check_attributes): Make sure d_buf is not NULL.
966 (check_note): Likewise.
967 (check_note_section): Likewise.
968 (check_program_header): Make sure section name is not NULL.
970 2014-12-26 Mark Wielaard <mjw@redhat.com>
972 * strings.c (read_elf): Produce error when section data falls outside
975 2014-12-26 Mark Wielaard <mjw@redhat.com>
977 * nm.c (show_symbols): Guard against divide by zero in error check.
978 Add section index number in error message.
980 2014-12-26 Mark Wielaard <mjw@redhat.com>
982 * nm.c (handle_ar): Skip over /SYM64/ entries.
984 2014-12-26 Mark Wielaard <mjw@redhat.com>
986 * nm.c (handle_ar): Break on arsym with invalid offset.
988 2014-12-20 Mark Wielaard <mjw@redhat.com>
990 * readelf.c (print_debug_macinfo_section): Mark cus sentinel files
991 as -1 non-existent. Check macoff against sentinel cus.
993 2014-12-20 Mark Wielaard <mjw@redhat.com>
995 * readelf.c (print_debug_exception_table): Add max_action overflow
996 check. Check action_table_end before reading slib128. Check
997 max_ar_filter underflow.
999 2014-12-18 Ulrich Drepper <drepper@gmail.com>
1001 * Makefile.am: Suppress output of textrel_check command.
1003 2014-12-17 Mark Wielaard <mjw@redhat.com>
1005 * readelf.c (print_cfa_program): Add bounds check before each op that
1006 takes at least one argument.
1008 2014-12-16 Mark Wielaard <mjw@redhat.com>
1010 * readelf.c (print_decoded_line_section): Print dwarf_errmsg if
1011 dwarf_onesrcline or dwarf_linesrc fails.
1013 2014-12-16 Mark Wielaard <mjw@redhat.com>
1015 * readelf.c (print_debug_line_section): Correct overflow check for
1017 (print_debug_aranges_section): Correct overflow check for length.
1019 2014-12-15 Mark Wielaard <mjw@redhat.com>
1021 * readelf.c (notice_listptr): Return false if offset doesn't fit
1023 (attr_callback): Warn if loclist or rangelist offset doesn't fit.
1025 2014-12-15 Mark Wielaard <mjw@redhat.com>
1027 * readelf.c (print_ops): Don't assert when addr_size or ref_size
1028 is not 4 or 8, just report invalid data.
1030 2014-12-15 Mark Wielaard <mjw@redhat.com>
1032 * readelf.c (print_gdb_index_section): Add more bounds checks.
1034 2014-12-15 Mark Wielaard <mjw@redhat.com>
1036 * readelf.c (print_debug_line_section): Check there is enough room
1037 for DW_LNE_set_address argument. Make sure there is enough room
1038 for the the initial unit_length.
1040 2014-12-14 Mark Wielaard <mjw@redhat.com>
1042 * elflint.c (check_attributes): Call get_uleb128 with end pointer.
1043 * readelf.c (print_attributes): Likewise.
1044 (print_ops): Likewise and also for get_sleb128.
1045 (print_cfa_program): Likewise and add more readp bounds checks.
1046 (read_encoded): Likewise.
1047 (print_debug_frame_section): Likewise.
1048 (print_debug_line_section): Likewise.
1049 (print_debug_macinfo_section): Likewise.
1050 (print_debug_macro_section): Likewise.
1051 (print_debug_exception_table): Likewise.
1053 2014-12-16 Mark Wielaard <mjw@redhat.com>
1055 * elfcmp.c (compare_Elf32_Word): Make sure (unsigned) Elf32_Word
1056 difference doesn't wrap around before returning as int.
1058 2014-12-11 Mark Wielaard <mjw@redhat.com>
1060 * readelf.c (print_debug_exception_table): Check TType base offset
1061 and Action table are sane.
1063 2014-12-11 Mark Wielaard <mjw@redhat.com>
1065 * readelf.c (print_debug_frame_section): Check number of augmentation
1068 2014-12-09 Mark Wielaard <mjw@redhat.com>
1070 * readelf.c (handle_file_note): Check count fits data section and
1071 doesn't overflow fptr.
1073 2014-12-08 Mark Wielaard <mjw@redhat.com>
1075 * readelf.c (print_debug_exception_table): Report invalid data if
1076 action table doesn't immediately follow call site table.
1078 2014-12-10 Josh Stone <jistone@redhat.com>
1080 * addr2line.c (get_diename): New, get linkage_name or name.
1081 * addr2line.c (print_dwarf_function): Use get_diename.
1082 * addr2line.c (handle_address): Likewise.
1083 * addr2line.c (print_diesym): Removed.
1085 2014-12-10 Josh Stone <jistone@redhat.com>
1087 * addr2line.c (handle_address): Find the proper inline parents.
1089 2014-12-07 Mark Wielaard <mjw@redhat.com>
1091 * readelf.c (print_debug_line_section): max_ops_per_instr cannot
1094 2014-12-07 Mark Wielaard <mjw@redhat.com>
1096 * readelf.c (print_ops): Handle zero ref_size for DW_OP_call_ref
1097 and DW_OP_GNU_implicit_pointer.
1099 2014-12-04 Mark Wielaard <mjw@redhat.com>
1101 * objdump.c (show_relocs_x): Make sure destshdr exists.
1102 (show_relocs_rel): Don't rely on shdr->sh_entsize, use gelf_fsize.
1103 (show_relocs_rela): Likewise.
1104 (show_relocs): Make sure destshdr, symshdr and symdata exists.
1106 2014-11-30 Mark Wielaard <mjw@redhat.com>
1108 * readelf.c (handle_sysv_hash64): Fix overflow check.
1110 2014-11-28 Mark Wielaard <mjw@redhat.com>
1112 * readelf.c (handle_relocs_rel): Don't reuse destshdr to store
1113 section header of a relocation against a STT_SECTION symbol. Use
1114 a new local variable secshdr.
1115 (handle_relocs_rela): Likewise.
1117 2014-11-26 Mark Wielaard <mjw@redhat.com>
1119 * readelf.c (print_debug_aranges_section): Cast Dwarf_Word length
1120 to ptrdiff_t for comparison.
1122 2014-11-24 Mark Wielaard <mjw@redhat.com>
1124 * readelf.c (print_debug_line_section): Check line_range is not zero
1127 2014-11-23 Mark Wielaard <mjw@redhat.com>
1129 * readelf.c (print_debug_aranges_section): Check length to catch
1132 2014-11-21 Mark Wielaard <mjw@redhat.com>
1134 * readelf.c (print_attributes): Guard against empty section.
1135 Document attribute format. Break when vendor name isn't terminated.
1136 Add overflow check for subsection_len. Handle both gnu and non-gnu
1139 2014-11-22 Mark Wielaard <mjw@redhat.com>
1141 * elflint.c (check_sections): Call ebl_bss_plt_p without ehdr.
1142 * findtextrel.c (process_file): Use elf_getphdrnum.
1143 * readelf.c (process_elf_file): Remove redundant ehdr->e_phoff check.
1144 (print_phdr): Check phnum.
1145 * size.c (show_segments): Use elf_getphdrnum.
1146 * strip.c (handle_elf): Likewise.
1147 * unstrip.c (copy_elf): Likewise.
1148 (copy_elided_sections): Likewise.
1149 (handle_file): Likewise.
1151 2014-11-18 Mark Wielaard <mjw@redhat.com>
1153 * readelf.c (print_cfa_program): Fix sanity check of DW_FORM_block
1156 2014-11-17 Mark Wielaard <mjw@redhat.com>
1158 * readelf.c (handle_verneed): Check vna_next and vn_next exist.
1159 (handle_verdef): Check vda_next and vd_next exist.
1160 (handle_versym): Check vd_next, vna_next and vn_next exist.
1161 Check vername and filename are not NULL before use.
1163 2014-11-17 Mark Wielaard <mjw@redhat.com>
1165 * elfcmp.c (main): Check section names are NULL before use.
1166 * objdump.c (section_match): Likewise.
1167 * size.c (show_sysv): Likewise.
1169 2014-11-17 Mark Wielaard <mjw@redhat.com>
1171 * readelf.c (print_debug_frame_section): Warn if ptr_size is not 4
1172 or 8 instead of just calling print_cfa_program.
1174 2014-11-16 Mark Wielaard <mjw@redhat.com>
1176 * readelf (process_elf_file): Set phnum to zero if there aren't
1177 actually any pheaders.
1178 (print_phdr): Check there actually is a phdr.
1180 2014-11-16 Mark Wielaard <mjw@redhat.com>
1182 * readelf.c (print_cfa_program): Check block len before calling
1185 2014-11-14 Mark Wielaard <mjw@redhat.com>
1187 * readelf.c (print_debug_frame_section): Sanity Check CIE
1188 unit_length and augmentationlen.
1190 2014-11-14 Mark Wielaard <mjw@redhat.com>
1192 * readelf.c (handle_versym): Check def == NULL before use.
1194 2014-11-08 Mark Wielaard <mjw@redhat.com>
1196 * readelf.c (handle_versym): Initialize vername and filename array
1199 2014-11-07 Mark Wielaard <mjw@redhat.com>
1201 * readelf.c (handle_sysv_hash): Sanity check section contents.
1202 (handle_sysv_hash64): Likewise.
1203 (handle_gnu_hash): Likewise.
1205 2014-09-14 Petr Machata <pmachata@redhat.com>
1207 * readelf.c (handle_relocs_rela): Typo fix, test DESTSHDR properly.
1209 2014-09-12 Petr Machata <pmachata@redhat.com>
1211 * readelf.c (encoded_ptr_size): In the switch statement, change
1212 magic constants 3 and 4 to DW_EH_PE_* counterparts. Still accept
1213 0. Print diagnostic for anything else.
1215 2014-08-25 Josh Stone <jistone@redhat.com>
1217 * Makefile.am: Prevent premature @AR@ replacement in a sed expression.
1219 2014-07-04 Menanteau Guy <menantea@linux.vnet.ibm.com>
1220 Mark Wielaard <mjw@redhat.com>
1222 * elflint (check_symtab): Add ".TOC." to the list of possibly
1223 dangling symbols because of sourceware PR13621.
1225 2014-06-14 Mark Wielaard <mjw@redhat.com>
1227 * elflint (check_symtab): Use ebl_func_addr_mask on st_value.
1229 2014-05-27 Mark Wielaard <mjw@redhat.com>
1231 * readelf.c (print_debug): Skip section if name is NULL.
1233 2014-05-26 Mark Wielaard <mjw@redhat.com>
1235 * readelf.c (handle_relocs_rela): Print header like handle_relocs_rel
1236 does, when sh_info == 0.
1238 2014-05-26 Mark Wielaard <mjw@redhat.com>
1240 * unstrip.c (find_alloc_sections_prelink): Allow non-split .bss
1241 section when sh_size of the original and undo .bss section are equal.
1243 2014-05-26 Mark Wielaard <mjw@redhat.com>
1245 * unstrip.c (options): Add --force, -F.
1246 (struct arg_info): Add bool force.
1247 (parse_opt): Handle 'F', set force.
1248 (handle_explicit_files): Add force argument, add warn function,
1249 separate check ehdr field checks, use warn.
1250 (handle_dwfl_module): Add force argument, pass on to
1251 handle_explicit_files.
1252 (handle_output_dir_module): Add force argument, pass on to
1254 (handle_implicit_modules): Pass info->force to handle_dwfl_module and
1255 handle_output_dir_module.
1256 (main): Pass info.force to handle_explicit_files.
1258 2014-05-19 Mark Wielaard <mjw@redhat.com>
1260 * elflint.c (check_reloc_shdr): Check ebl_check_reloc_target_type.
1262 2014-05-01 Mark Wielaard <mjw@redhat.com>
1264 * readelf.c (find_no_debuginfo): Call dwfl_standard_find_debuginfo
1265 if looking for alternate debug file.
1267 2014-04-11 Mark Wielaard <mjw@redhat.com>
1269 * Makefile.am (AM_CPPFLAGS): Add -I libdwelf.
1271 2014-04-22 Mark Wielaard <mjw@redhat.com>
1273 * readelf.c (handle_core_item): Make sure variable length array
1274 contains at least enough space for terminating zero char.
1276 2014-04-22 Mark Wielaard <mjw@redhat.com>
1278 * readelf.c (print_gdb_index_section): Use unsigned int for 31 bits
1281 2014-03-13 Mark Wielaard <mjw@redhat.com>
1283 * Makefile.am: Remove no_mudflap.os. Remove libmudflap from all
1285 * strings.c (process_chunk): Remove _MUDFLAP condition.
1287 2014-04-09 Mark Wielaard <mjw@redhat.com>
1289 * readelf.c (print_debug_aranges_section): Don't get the raw section
1290 data, use the possibly decompressed .[z]debug sectiondata.
1291 (print_debug_ranges_section): Likewise.
1292 (print_debug_frame_section): Likewise.
1293 (print_debug_line_section): Likewise.
1294 (print_debug_loc_section): Likewise.
1295 (print_debug_macinfo_section): Likewise.
1296 (print_debug_macro_section): Likewise.
1298 2014-04-10 Mark Wielaard <mjw@redhat.com>
1300 * readelf.c (buf_read_ulong): Pass actual long size to convert.
1302 2014-03-05 Mark Wielaard <mjw@redhat.com>
1304 * readelf.c (attr_callback): Print DW_FORM_sdata values as signed
1307 2014-02-24 Mark Wielaard <mjw@redhat.com>
1309 * readelf (print_phdr): Check there is a SHT_PROGBITS section at the
1310 offset given by p_offsets for a PT_INTERP segment before trying to
1311 display the interpreter string.
1313 2014-02-07 Mark Wielaard <mjw@redhat.com>
1315 * readelf.c (print_phdr): Check phdr->p_filesz and make sure
1316 interpreter string is zero terminated before calling printf.
1318 2014-01-22 Mark Wielaard <mjw@redhat.com>
1320 * Makefile.am (nm_no_Wformat): Removed.
1321 (size_no_Wformat): Likewise.
1322 (strings_no_Wformat): Likewise.
1323 (addr2line_no_Wformat): Likewise.
1324 * size.c (show_sysv): Use fmtstr directly as literal in printf.
1325 (show_sysv_one_line): Likewise.
1326 * strings.c (locfmt): Removed.
1327 (radix): New static enum.
1328 (parse_opt): Set radix, not locfmt.
1329 (process_chunk_mb): Use fmtstr directly as literal in printf based
1331 (process_chunk): Likewise.
1332 * nm.c (show_symbols_sysv): Use fmtstr directly as literal in printf.
1333 (show_symbols_bsd): Likewise.
1334 (show_symbols_posix): Likewise.
1336 2014-01-21 Mark Wielaard <mjw@redhat.com>
1338 * stack.c (show_inlines): New static boolean.
1339 (print_frame): New function split out from...
1340 (print_frames): ..here. If show_inlines is true and we found a
1341 DIE for the frame address, call print_inline_frames otherwise
1342 call print_frame. Keep track of and track frame_nr.
1343 (print_inline_frames): New function.
1344 (parse_opt): Handle '-i'.
1345 (main): Add 'i' to options.
1347 2014-01-27 Mark Wielaard <mjw@redhat.com>
1349 * stack.c (maxframes): Initialize to 256.
1350 (main): Document new default in options. Document magic number
1351 used in frames.allocated initialization.
1353 2014-01-20 Mark Wielaard <mjw@redhat.com>
1355 * stack.c (show_debugname): New static boolean.
1356 (die_name): New function.
1357 (print_frames): If show_debugname is true set symname to the
1358 first function-like DIE with a name in scope for the address in
1360 (parse_opt): Handle '-d'.
1361 (main): Add 'd' to options.
1363 2014-01-20 Mark Wielaard <mjw@redhat.com>
1365 * addr2line.c (handle_address): Initialize scopes to NULL.
1367 2014-01-17 Roland McGrath <roland@redhat.com>
1369 * strip.c (handle_elf): Check for bogus values in sh_link, sh_info,
1370 st_shndx, e_shstrndx, and SHT_GROUP or SHT_SYMTAB_SHNDX data.
1371 Don't use assert on input values, instead bail with "illformed" error.
1373 2014-01-17 Roland McGrath <roland@redhat.com>
1375 * readelf.c (handle_dynamic, handle_symtab): Check for bogus sh_link.
1376 (handle_verneed, handle_verdef, handle_versym, handle_hash): Likewise.
1377 (handle_scngrp): Check for bogus sh_info.
1379 2014-01-17 Jakub Jelinek <jakub@redhat.com>
1381 * elflint.c (section_name): Return "<invalid>" instead of
1382 crashing on invalid section name.
1383 (check_symtab, is_rel_dyn, check_rela, check_rel, check_dynamic,
1384 check_symtab_shndx, check_hash, check_versym): Robustify.
1385 (check_hash): Don't check entries beyond end of section.
1386 (check_note): Don't crash if gelf_rawchunk fails.
1388 2014-01-17 Petr Machata <pmachata@redhat.com>
1390 * readelf.c (handle_dynamic, handle_relocs_rel)
1391 (handle_relocs_rela, handle_versym, print_liblist):
1392 Use gelf_fsize instead of relying on shdr->sh_entsize.
1394 2014-01-14 Mark Wielaard <mjw@redhat.com>
1396 * readelf.c (print_debug_macro_section): Clear vendor array before
1399 2014-01-15 Jan Kratochvil <jan.kratochvil@redhat.com>
1401 Fix corruption of non-C++ symbols by the demangler.
1402 * nm.c (show_symbols_sysv, show_symbols_bsd, show_symbols_posix)
1403 (show_symbols): Check for _Z.
1404 * stack.c (print_frames) <USE_DEMANGLE>: Check for _Z.
1406 2014-01-02 Mark Wielaard <mjw@redhat.com>
1408 * stack.c (show_raw): Declare unconditionally.
1409 (parse_opt): Handle '-r' unconditionally.
1410 (main): Show "raw" option even without USE_DEMANGLE.
1412 2014-01-02 Mark Wielaard <mjw@redhat.com>
1414 * stack.c (print_frames): Print 0x before build-id hex-offset.
1416 2014-01-02 Mark Wielaard <mjw@redhat.com>
1418 * stack.c (maxframes): Increase to 2048.
1419 (struct frames): Add allocated field.
1420 (frame_callback): If frames used is frames allocated, realloc.
1421 (print_frames): Show an error if maxframes has been reached.
1422 (parse_opt): Allow -n 0 for unlimited frames.
1423 (main): Document -n 0 and new default 2048 frames. Allocate initial
1424 number of frames with malloc.
1426 2013-12-30 Mark Wielaard <mjw@redhat.com>
1428 * stack.c (parse_opt): Explicitly call dwfl_linux_proc_attach
1429 or dwfl_core_file_attach and check for errors.
1431 2013-12-28 Mark Wielaard <mjw@redhat.com>
1433 * stack.c (print_frames): Remove address width code and use...
1434 (get_addr_width): ...this new function.
1435 (show_modules): New static boolean.
1436 (module_callback): New static function.
1437 (parse_opt): Handle '-l'.
1438 (main): Add 'l' to options. If show_modules then use dwfl_getmodules
1439 with module_callback to show all detected modules and possible
1440 build_id, elf and dwarf files.
1442 2013-12-27 Mark Wielaard <mjw@redhat.com>
1444 * stack.c (frames_shown): New static boolean.
1445 (EXIT_OK,EXIT_ERROR,EXIT_BAD,EXIT_USAGES): New defines.
1446 (frame_callback): Return -1 on error. Don't print error.
1447 (print_frames): Add arguments, tid, dwflerr and what. Print tid.
1448 If there was an error report it with address and module if possible.
1449 Record whether any frames were actually printed.
1450 (thread_callback): Collect tid and err, pass it to print_frames.
1451 (parse_opt): Use EXIT_BAD for errors. On ARGP_KEY_END print errno
1452 if dwfl_linux_proc_report returned it. Check whether we are properly
1453 attached with dwfl_pid.
1454 (main): Document exit status. Don't report DWARF_CB_ABORT from
1455 callbacks as error. Pass real errors to print_frames. Return
1456 EXIT_BAD if no frames could be shown. Return EXIT_ERROR if there
1457 were any non-fatal errors.
1459 2013-12-23 Mark Wielaard <mjw@redhat.com>
1461 * Makefile.am (stack_LDADD): Add demanglelib.
1462 * stack.c (show_quiet): New static boolean, default false.
1463 (show_raw): Likewise.
1464 (demangle_buffer_len): New static size_t.
1465 (demangle_buffer): New static char *.
1466 (print_frames): Don't resolve pc name if show_quiet. Demangle name
1468 (parse_opt): Handle '-q' and '-r'.
1469 (main): Add 'q' and 'r' to options. Free demangle_buffer.
1471 2013-12-23 Mark Wielaard <mjw@redhat.com>
1473 * stack.c (OPT_DEBUGINFO): New define.
1474 (OPT_COREFILE): Likewise.
1476 (core_fd): Likewise.
1479 (debuginfo_path): Likewise.
1480 (parse_opt): Handle '-p', '--core', '-e' and '--debuginfo-path'.
1481 Do argument sanity checking. Setup Dwfl.
1482 (main): Add 'p', 'core', 'e' and 'debuginfo-path' to options.
1483 Remove argp_child children, simplify argp doc, remove custom
1484 usage message and construction of dwfl with dwfl_standard_argp.
1485 Use pid directly as tid. close core and core_fd if opened. Print
1486 pid of process or core.
1488 2013-12-23 Mark Wielaard <mjw@redhat.com>
1490 * stack.c (show_build_id): New static boolean.
1491 (print_frames): Print module build-id, load address and pc offset
1492 if show_build_id is true.
1493 (parse_opt): Handle '-b'.
1494 (main): Add -b to options.
1496 2013-12-22 Mark Wielaard <mjw@redhat.com>
1498 * stack.c (maxframes): New static unsigned. Initialize to 64.
1499 (struct frame): New struct.
1500 (struct frames): Likewise.
1501 (dwfl): New static Dwfl pointer.
1502 (frame_callback): Use arg as struct frames and fill it next frame.
1503 Return DWARF_CB_ABORT when maxframes has been reached. Move
1504 printing of frame to...
1505 (print_frames): ...here. New function.
1506 (thread_callback): Use arg as struct frames and set frames to zero.
1508 (parse_opt): Handle '-n'.
1509 (main): Add -n to options. Allocate frames using maxframes. Pass
1510 frames to frame_callback and thread_callback.
1512 2013-12-20 Mark Wielaard <mjw@redhat.com>
1514 * stack.c (show_one_tid): New static boolean.
1515 (parse_opt): Handle '-1'.
1516 (main): Add -1 to options. Call dwfl_getthread_frames when
1517 show_one_tid is true.
1519 2013-12-18 Mark Wielaard <mjw@redhat.com>
1521 * addr2line.c (options): Add symbol-sections, 'x'.
1522 (show_symbol_sections): New static bool.
1523 (parse_opt): Handle 'x'.
1524 (print_addrsym): Use dwfl_module_addrinfo value.r
1525 Also show section of address with show_symbol_sections.
1526 (find_symbol): Use dwfl_module_getsym_info and set value.
1527 (handle_address): Request value and use it instead of sym.st_value.
1528 * readelf.c (format_dwarf_addr): Use dwfl_module_addrinfo to get
1531 2013-12-17 Masatake YAMATO <yamato@redhat.com>
1532 Mark Wielaard <mjw@redhat.com>
1534 * stack.c (show_activation, show_module, show_source): New variables.
1535 (parse_opt): Set show_activation if -a option is given.
1536 Set show_module if -m option is given. Set show_source if -s option
1537 is given. Set all show booleans when -v option is given.
1538 (main): Added `-a', `-m', `-s', and `-v' to the help message.
1539 (frame_callback): Print module and source file information.
1541 2013-11-25 Petr Machata <pmachata@redhat.com>
1543 * elflint.c (valid_e_machine): Add EM_AARCH64.
1545 2013-11-14 Petr Machata <pmachata@redhat.com>
1547 * readelf.c (handle_core_item) <'h'>: New branch for handling
1548 fields that shouldn't be displayed.
1550 2013-11-10 Mark Wielaard <mjw@redhat.com>
1552 * stack.c: Use ARGP_PROGRAM_VERSION_HOOK_DEF and
1553 ARGP_PROGRAM_BUG_ADDRESS_DEF.
1554 (print_version): New function.
1556 2013-11-09 Mark Wielaard <mjw@redhat.com>
1558 * arlib.c (arlib_init): Call snprintf before using the result
1560 (arlib_finalize): Likewise.
1561 * nm.c (show_symbols_sysv): Don't modify cnt inside assert.
1563 2013-11-07 Jan Kratochvil <jan.kratochvil@redhat.com>
1565 * Makefile.am (bin_PROGRAMS): Add stack.
1567 * stack.c: New file.
1569 2013-11-05 Mark Wielaard <mjw@redhat.com>
1571 * readelf.c (print_debug_ranges_section): Cast address to size_t
1573 (print_debug_loc_section): Likewise.
1575 2013-10-18 Mark Wielaard <mjw@redhat.com>
1577 * ar.c (main): Correct operation check when instance_specifed is set.
1579 2013-09-26 Petr Machata <pmachata@redhat.com>
1581 * readelf.c (handle_file_note): New function.
1582 (handle_notes_data): Call it to handle NT_FILE notes.
1584 2013-09-26 Petr Machata <pmachata@redhat.com>
1586 * readelf.c (handle_siginfo_note): New function.
1587 (handle_notes_data): Call it to handle NT_SIGINFO notes.
1588 (buf_read_int, buf_read_ulong, buf_has_data): New functions.
1590 2013-08-13 Mark Wielaard <mjw@redhat.com>
1592 * addr2line.c (options): Add "inlines", 'i'.
1593 (show_inlines): New bool.
1594 (parse_opt): Handle 'i'.
1595 (print_diesym): New static function.
1596 (print_src): New function taking code from...
1597 (handle_address): here. Call print_src. Print inlines.
1599 2013-08-12 Mark Wielaard <mjw@redhat.com>
1601 * addr2line.c (main): If there is a newline char at end of buf,
1604 2013-07-05 Mark Wielaard <mjw@redhat.com>
1606 * readelf.c (print_ops): Take CU as argument, use it to print
1607 parameter_ref DIE offset.
1608 (struct listptr): Replace base field with cu.
1609 (listptr_base): New function.
1610 (compare_listptr): Use listptr_base.
1611 (notice_listptr): Take CU as argument.
1612 (skip_listptr_hole): Likewise.
1613 (print_debug_ranges_section): Pass NULL as CU to skip_listptr_hole.
1614 (print_cfa_program): Pass NULL as CU to print_ops.
1615 (struct attrcb_args): Replace cu_base field with cu.
1616 (attr_callback): Pass cu not cu_base to notice_listptr.
1617 (print_debug_units): Don't calculate base, just set cu.
1618 (print_debug_loc_section): Pass cu to skip_listptr_hole and
1621 2013-05-06 Mark Wielaard <mjw@redhat.com>
1623 * readelf.c (print_ops): Format first DW_OP_GNU_implicit_pointer
1624 argument as DIE offset.
1626 2013-04-24 Mark Wielaard <mjw@redhat.com>
1628 * Makefile.am: Use AM_CPPFLAGS instead of INCLUDES.
1630 2013-03-25 Mark Wielaard <mjw@redhat.com>
1632 * readelf.c (argp_options): Add decodedline.
1633 (decodedline): New boolean initialized to false.
1634 (parse_opt): Set decodedline when arg is decodedline.
1635 (print_decoded_line_section): New function.
1636 (print_debug_line_section): Call print_decoded_line_section when
1637 decodedline is true.
1639 2013-03-25 Mark Wielaard <mjw@redhat.com>
1641 * readelf.c (argp_option): Add decodedaranges.
1642 (decodedaranges): New boolean initialized to false.
1643 (parse_opt): Set decodedaranges when arg is decodedaranges.
1644 (print_debug_aranges_section): Reimplemented and original
1645 implementation renamed to...
1646 (print_decoded_aranges_section): this.
1648 2013-03-25 Mark Wielaard <mjw@redhat.com>
1650 * readelf.c (attrcb_args): Add Dwarf_Die.
1651 (attr_callback): When highpc is in constant form also print as
1653 (print_debug_units): Set args.die.
1655 2013-03-19 Mark Wielaard <mjw@redhat.com>
1657 * readelf.c (print_gdb_index_section): Free format_dwarf_addr results.
1659 2013-03-18 Mark Wielaard <mjw@redhat.com>
1661 * readelf.c (print_gdb_index_section): Accept version 8.
1663 2013-03-01 Mark Wielaard <mjw@redhat.com>
1665 * findtextrel.c (process_file): Release ELF and close file when not
1666 text relocations are found.
1667 * strip.c (handle_elf): Track memory used for .debuglink section data
1670 2013-02-24 Mark Wielaard <mjw@redhat.com>
1672 * elflint.c (check_symtab): Add __bss_start__ to the list of symbols
1673 allowed to have out of section values because of GNU ld bugs.
1675 2013-02-06 Mark Wielaard <mjw@redhat.com>
1677 * elflint.c (check_symtab): Add __bss_start and __TMC_END__ to the
1678 list of symbols allowed to have out of section values because of
1679 GNU ld bugs in either .symtab or .dynsym, but only when they are
1682 2013-01-24 Mark Wielaard <mjw@redhat.com>
1684 * readelf.c (argp_option): Add unresolved-address-offsets, U.
1685 (print_unresolved_addresses): New static.
1686 (parse_opt): Handle 'U', set print_unprocessed_values.
1687 (format_dwarf_addr): Take and handle new raw argument.
1688 (print_ops): Call format_dwarf_addr with raw offset values.
1689 (print_debug_ranges_section): Likewise.
1690 (print_debug_frame_section): Likewise.
1691 (attr_callback): Likewise.
1692 (print_debug_line_section): Likewise.
1693 (print_debug_loc_section): Likewise.
1694 (print_gdb_index_section): Likewise.
1696 2013-01-18 Mark Wielaard <mjw@redhat.com>
1698 * readelf.c (struct listptr): Add base Dwarf_Addr field.
1699 (compare_listptr): Warn for same offset with different base.
1700 (notice_listptr): Take base argument and set it.
1701 (skip_listptr_hole): Likewise.
1702 (struct attrcb_args): Removed unused cu_offset field.
1703 Add cu_base Dwarf_Addr field.
1704 (attr_callback): Call notice_listptr with cbargs->cu_base.
1705 (print_debug_units): Set args.cu_base.
1706 (print_debug_ranges_section): Get base and use for format_dwarf_addr.
1707 (print_debug_loc_section): Likewise.
1709 2013-01-29 Jan Kratochvil <jan.kratochvil@redhat.com>
1711 * readelf.c (handle_core_items): Limit special repeated items handling
1712 to single-item formats '\n', 'b' and 'B', assert OFFSET 0 there.
1714 2012-12-18 Mark Wielaard <mark@bordewijk.wildebeest.org>
1716 * readelf.c (ELF_INPUT_SECTION): New argp key value.
1717 (argp_option): Add elf-section.
1718 (elf_input_section): New static.
1719 (parse_opt): Handle ELF_INPUT_SECTION and set elf_input_section.
1720 (open_input_section): New function.
1721 (process_file): Call open_input_section if elf_input_section set.
1723 2013-01-13 David Abdurachmanov <David.Abdurachmanov@cern.ch>
1725 ar.c (do_oper_delete): Fix num passed to memset.
1727 2012-12-21 Mark Wielaard <mjw@redhat.com>
1729 * readelf.c (print_debug_frame_section): Adjust FDE start address
1730 if pcrel before feeding it to format_dwarf_addr.
1732 2012-12-21 Mark Wielaard <mjw@redhat.com>
1734 * addr2line.c (main): Call dwfl_end.
1736 2012-12-11 Roland McGrath <roland@hack.frob.com>
1738 * nm.c (show_symbols_sysv): Fix size passed to snprintf for invalid
1740 Reported by David Abdurachmanov <David.Abdurachmanov@cern.ch>.
1742 2012-10-16 Mark Wielaard <mjw@redhat.com>
1744 * readelf.c (print_ops): DW_OP_skip and DW_OP_bra targets are
1745 calculated beginning after the operand and 2-byte constant.
1747 2012-10-12 Jan Kratochvil <jan.kratochvil@redhat.com>
1749 * readelf.c (ITEM_WRAP_COLUMN, REGISTER_WRAP_COLUMN): Merge to ...
1750 (WRAP_COLUMN): ... here.
1751 (print_core_item): Remove parameter format_max. Update function
1752 comment. Replace FORMAT_MAX by the real output width.
1753 (handle_core_item): Remove the FORMAT_MAX values in TYPES, DO_TYPE,
1754 calls of print_core_item, remove variable maxfmt, change
1755 ITEM_WRAP_COLUMN to WRAP_COLUMN.
1756 (handle_core_register): Remove the FORMAT_MAX values in TYPES, BITS,
1757 calls of print_core_item, change REGISTER_WRAP_COLUMN to WRAP_COLUMN.
1759 2012-10-11 Jan Kratochvil <jan.kratochvil@redhat.com>
1761 * readelf.c (handle_core_item) <b>: Make run an outer block variable.
1762 Increase run only if LASTBIT != 0. Print last element only if RUN > 0.
1764 2012-08-27 Mark Wielaard <mjw@redhat.com>
1766 * readelf.c (print_debug_macro_section): Print offset as PRIx64.
1768 2012-08-27 Mark Wielaard <mjw@redhat.com>
1770 * readelf.c (register_info): Handle loc == NULL.
1772 2012-08-22 Jeff Kenton <jkenton@tilera.com>
1774 * elflint.c (valid_e_machine): Add EM_TILEGX and EM_TILEPRO.
1776 2012-08-16 Mark Wielaard <mjw@redhat.com>
1778 * readelf.c (dwarf_tag_name): Renamed from dwarf_tag_string.
1779 Uses new dwarf_tag_string or adds ??? or lo_user+%#x when
1781 (dwarf_attr_name): Likewise.
1782 (dwarf_form_name): Likewise.
1783 (dwarf_lang_name): Likewise.
1784 (dwarf_inline_name): Likewise.
1785 (dwarf_encoding_name): Likewise.
1786 (dwarf_access_name): Likewise.
1787 (dwarf_visibility_name): Likewise.
1788 (dwarf_virtuality_name): Likewise.
1789 (dwarf_identifier_case_name): Likewise.
1790 (dwarf_calling_convention_name): Likewise.
1791 (dwarf_ordering_name): Likewise.
1792 (dwarf_discr_list_name): Likewise.
1793 (print_ops): Remove KNOWN. Use dwarf_locexpr_opcode_string.
1794 (attr_callback): Call new dwarf_foobar_name instead of old
1795 dwarf_foobar_string functions.
1796 (dwarf_tag_string): New function using known-dwarf.h macros.
1797 (dwarf_attr_string): Likewise.
1798 (dwarf_form_string): Likewise.
1799 (dwarf_lang_string): Likewise.
1800 (dwarf_inline_string): Likewise.
1801 (dwarf_encoding_string): Likewise.
1802 (dwarf_access_string): Likewise.
1803 (dwarf_visibility_string): Likewise.
1804 (dwarf_virtuality_string): Likewise.
1805 (dwarf_identifier_case_string): Likewise.
1806 (dwarf_calling_convention_string): Likewise.
1807 (dwarf_ordering_string): Likewise.
1808 (dwarf_discr_list_string): Likewise.
1809 (dwarf_locexpr_opcode_string): Likewise.
1811 2012-06-27 Mark Wielaard <mjw@redhat.com>
1813 * readelf.c (dwarf_form_string): Handle DW_FORM_GNU_ref_alt and
1814 DW_FORM_GNU_strp_alt.
1815 (attr_callback): Likewise.
1817 2012-07-30 Petr Machata <pmachata@redhat.com>
1819 * nm.c (show_symbols_bsd): Reorder arguments in {S,}FMTSTRS (and
1820 corresponding printf) so that those that are referenced by only
1821 one of the formatting strings are at the end.
1823 2012-07-29 Mark Wielaard <mjw@redhat.com>
1825 * readelf.c (dwarf_lang_string): Use DW_LANG_ObjC, not DW_LANG_Objc.
1826 (print_ops): Use known[op], not op_name, for DW_OP_GNU_parameter_ref.
1828 2012-07-19 Mark Wielaard <mjw@redhat.com>
1830 * readelf.c (print_ops): Handle DW_OP_GNU_parameter_ref.
1832 2012-07-11 Mark Wielaard <mjw@redhat.com>
1834 * readelf.c (options): Add macro to help of debug-dump.
1835 (section_e): Add section_macro.
1836 (section_all): Add section_macro.
1837 (parse_opt): Handle macro.
1838 (print_debug_macro_section): New function.
1839 (print_debug): Add NEW_SECTION (macro).
1841 2012-07-10 Mark Wielaard <mjw@redhat.com>
1843 * readelf.c (print_gdb_index_section): Add version 7 support.
1844 Keep track of cu_nr. Print kind and static/global flag for each
1845 symbol. When a symbol is in the TU list add 'T'.
1847 2012-06-26 Mark Wielaard <mjw@redhat.com>
1849 * readelf.c (dwarf_attr_string): Add DW_AT_GNU_macros.
1851 2012-06-22 Mark Wielaard <mjw@redhat.com>
1853 * readelf.c (print_ops): Cast printf PRIu/x64 arguments to uint64_t
1854 for gcc 4.7 -Wformat.
1856 2012-05-09 Roland McGrath <roland@hack.frob.com>
1858 * elflint (check_sections): Allow zero sized sections at (filesz) end
1859 of segment. And make check overflow-proofed.
1861 2012-04-24 Mark Wielaard <mjw@redhat.com>
1863 * readelf.c (print_ops): Add DW_OP_GNU_push_tls_address,
1864 DW_OP_GNU_uinit and DW_OP_GNU_encoded_addr.
1866 2012-03-28 Roland McGrath <roland@hack.frob.com>
1868 * elflint.c (special_sections): Accept SHF_INFO_LINK for reloc sections.
1870 2012-03-28 Mark Wielaard <mjw@redhat.com>
1872 * readelf.c (print_debug_abbrev_section): Check there is Dwarf
1874 (print_debug_str_section): Likewise.
1876 2012-03-21 Mark Wielaard <mjw@redhat.com>
1878 * readelf.c (print_gdb_index_section): Accept version 6.
1880 2012-01-31 Mark Wielaard <mjw@redhat.com>
1882 * readelf.c (attr_callback): Don't special case DW_FORM_sec_offset.
1884 2012-01-21 Ulrich Drepper <drepper@gmail.com>
1886 * addr2line.c: Update copyright year.
1888 * elfcmp.c: Likewise.
1889 * elflint.c: Likewise.
1890 * findtextrel.c: Likewise.
1893 * objdump.c: Likewise.
1894 * ranlib.c: Likewise.
1895 * readelf.c: Likewise.
1897 * strings.c: Likewise.
1898 * strip.c: Likewise.
1899 * unstrip.c: Likewise.
1901 * nm.c (argp_children): Define.
1902 (argp): Hook up argp_children.
1903 (handle_ar): Optimize puts call.
1904 (show_symbols_bsd): Use positional parameters to also print color
1905 codes. Don't print STT_FILE symbols.
1906 * objdump.c (options): Improve help text.
1907 (argp_children): Define.
1908 (argp): Hook up argp_children.
1909 (disasm_info): Add elements for color codes.
1910 (disasm_output): Print color codes as well.
1911 (show_disasm): Set up disasm_info data for callback.
1913 2012-01-20 Roland McGrath <roland@hack.frob.com>
1915 * arlib-argp.c (arlib_deterministic_output): Initialize from
1917 (help_filter): New function.
1920 * ar.c (main): Handle oper_none as usage error.
1922 * arlib-argp.c (options, parse_opt): Grok -U as inverse of -D.
1924 * ranlib.c (argp): Use arlib_argp_children.
1926 * arlib.c (arlib_init): Obey arlib_deterministic_output.
1928 * arlib-argp.c: New file.
1929 * Makefile.am (libar_a_SOURCES): Add it.
1930 * arlib.h (arlib_deterministic_output, arlib_argp_children):
1931 Declare new variables.
1932 * ar.c (deterministic_output): Variable removed.
1933 (do_oper_insert): Use arlib_deterministic_output instead.
1934 (options, parse_opt): Don't handle -D here. Add group numbers.
1935 (argp): Use arlib_argp_children.
1937 2011-12-20 Roland McGrath <roland@hack.frob.com>
1939 * readelf.c (print_debug): Initialize DUMMY_DBG.elf.
1940 Reported by Karel Klic <kklic@redhat.com>.
1942 2011-11-05 Roland McGrath <roland@hack.frob.com>
1944 * ar.c (deterministic_output): New flag variable.
1945 (options, parse_opt): Grok -D to set it.
1946 (do_oper_insert): When set, use zero from mtime, uid, and gid.
1948 * ar.c (do_oper_insert): Fix check on elf_rawfile return value.
1950 2011-10-04 Marek Polacek <mpolacek@redhat.com>
1952 * readelf.c (register_info): Assume the right size of an array.
1954 2011-10-03 Ulrich Drepper <drepper@gmail.com>
1956 * nm.c: Recognize option --mark-special. Still recognize --mark-weak
1957 but don't show it in help anymore.
1958 (mark_special): Renamed from mark_weak.
1959 (parse_opt): Adjust.
1960 (class_type_char): Take additional parameters for ELF file and ELF
1961 header. Treat TLS symbols like objects.
1962 In case of D symbols, show u for unique symbols, R for symbols in
1963 read-only sections, B for symbols in BSS sections.
1964 (show_symbols_bsd): Take additional parameters for ELF file and ELF
1965 header. Adjust for class_type_char change. Show TLS symbols with
1966 @ after them in case --mark-special is selected.
1967 (show_symbols_posix): Likewise.
1968 (show_symbols): Adjust calls to show_symbols_bsd and
1970 (show_symbols_sysv): Avoid printing adress and size for undefined
1971 symbols. Don't print initial special entry and section entries.
1973 2011-10-02 Ulrich Drepper <drepper@gmail.com>
1975 * Makefile.am (demanglelib): Define.
1976 (nm_LDADD): Add demanglelib.
1977 * nm.c (options): Add -C option.
1978 (demangle): Define as global variable.
1979 (parse_opt): Recognize -C.
1980 (show_symbols_sysv): Handle demangling.
1981 (show_symbols_bad): Likewise.
1982 (show_symbols_posix): Likewise.
1983 (show_symbols): Likewise.
1985 2011-07-09 Roland McGrath <roland@hack.frob.com>
1987 * readelf.c (options, parse_opt): Grok -W/--wide and ignore it.
1989 * ar.c (parse_opt): Grok -u.
1991 2011-05-30 Mark Wielaard <mjw@redhat.com>
1993 * strip.c (relocate): Make offset check overflow-proof.
1995 2011-05-23 Mark Wielaard <mjw@redhat.com>
1997 * strip.c (relocate): Take new arguments is_rela to indicate
1998 whether the relocation is from a SHT_REL or SHT_RELA section.
1999 Relocate against any debug section symbol, not just STT_SECTION
2000 symbols. For SHT_REL relocations, fetch addend from offset and
2001 add it to symbol value if not zero.
2003 2011-05-23 Mark Wielaard <mjw@redhat.com>
2005 * strip.c (OPT_RELOC_DEBUG): New option.
2006 (argp_option): Add new --reloc-debug-sections option.
2007 (main): Check new option.
2008 (parse_opt): Likewise.
2009 (handle_elf): Remove any relocations between debug sections
2010 in ET_REL for the debug file when requested.
2012 2011-05-18 Mark Wielaard <mjw@redhat.com>
2014 * strip.c (handle_elf): Make sure all sections of a removed group
2015 section are removed too. Don't discard SHT_GROUP sections, copy
2016 section table before it gets modified. Section group signature
2017 symbols don't have to be retained.
2019 2011-05-16 Jakub Jelinek <jakub@redhat.com>
2021 * readelf.c (print_ops): Handle DW_OP_GNU_const_type,
2022 DW_OP_GNU_regval_type, DW_OP_GNU_deref_type, DW_OP_GNU_convert
2023 and DW_OP_GNU_reinterpret.
2025 2011-05-17 Mark Wielaard <mjw@redhat.com>
2027 * readelf.c (dwarf_tag_string): Fixup DW_TAG_GNU_call_site and
2028 DW_TAG_GNU_call_site_parameter return strings.
2030 2011-05-11 Marek Polacek <mpolacek@redhat.com>
2032 * nm.c (show_symbols_sysv): Remove unused if/else, remove
2033 unused `prefix' and `fname' parameters.
2035 2011-05-07 Marek Polacek <mpolacek@redhat.com>
2037 * unstrip.c (compare_sections_nonrel): Mark this function as static.
2039 2011-04-26 Mark Wielaard <mjw@redhat.com>
2041 * readelf.c (handle_notes_data): Call ebl_object_note_type_name
2044 2011-04-14 Mark Wielaard <mjw@redhat.com>
2046 * readelf.c (options): Add gdb_index.
2047 (section_e): Define section_gdb_index.
2048 (parse_opt): Recognize gdb_index debug-dump argument.
2049 (print_gdb_index_section): New function.
2050 (print_debug): Add gdb_index to debug_sections.
2052 2011-03-24 Petr Machata <pmachata@redhat.com>
2054 * readelf.c (print_debug_line_section): Emit initial space for all
2055 opcode lines. Print offset in front of each opcode.
2057 2011-03-22 Marek Polacek <mpolacek@redhat.com>
2059 * readelf.c (handle_dynamic): Don't segfault at DT_PLTREL case.
2061 2011-03-22 Mark Wielaard <mjw@redhat.com>
2063 * readelf.c (dwarf_tag_string): Support DW_TAG_GNU_call_site
2064 and DW_TAG_GNU_call_site_parameter.
2065 (dwarf_attr_string): Support DW_AT_GNU_call_site_value,
2066 DW_AT_GNU_call_site_data_value,
2067 DW_AT_GNU_call_site_target,
2068 DW_AT_GNU_call_site_target_clobbered,
2069 DW_AT_GNU_tail_call,
2070 DW_AT_GNU_all_tail_call_sites,
2071 DW_AT_GNU_all_call_sites,
2072 and DW_AT_GNU_all_source_call_sites.
2073 (print_ops): Handle DW_OP_GNU_entry_value.
2074 (attr_callback): Handle DW_AT_GNU_call_site_value,
2075 DW_AT_GNU_call_site_data_value,
2076 DW_AT_GNU_call_site_target,
2077 and DW_AT_GNU_call_site_target_clobbered.
2079 2011-03-10 Mark Wielaard <mjw@redhat.com>
2081 * elflint.c (check_symtab): Use ebl_check_st_other_bits.
2083 2011-02-27 Jan Kratochvil <jan.kratochvil@redhat.com>
2085 * readelf.c (reset_listptr): Clear TABLE->TABLE.
2087 2011-02-25 Mark Wielaard <mjw@redhat.com>
2089 * readelf.c (dwarf_attr_string): Add DW_AT_GNU_* handling.
2090 (dwarf_form_string): Properly format and return unknown form.
2092 2011-02-23 Roland McGrath <roland@redhat.com>
2094 * readelf.c (section_name): New function.
2095 (print_debug_abbrev_section): Use it instead of constant.
2096 (print_debug_aranges_section): Likewise.
2097 (print_debug_ranges_section): Likewise.
2098 (print_debug_units): Likewise.
2099 (print_debug_line_section): Likewise.
2100 (print_debug_loc_section): Likewise.
2101 (print_debug_macinfo_section): Likewise.
2102 (print_debug_pubnames_section): Likewise.
2103 (print_debug_str_section): Likewise.
2104 (print_debug) [USE_ZLIB]: Match .zdebug_* sections too.
2105 (print_debug_abbrev_section): Use decoded d_size, not sh_size.
2106 (print_debug_str_section): Likewise.
2108 * readelf.c (dwarf_attr_string): Grok DW_AT_GNU_odr_signature.
2110 2011-02-11 Roland McGrath <roland@redhat.com>
2112 * elfcmp.c (verbose): New variable.
2113 (options, parse_opt): Grok -l/--verbose to set it.
2114 (main): Under -l, keep going after first difference.
2116 * elfcmp.c (ignore_build_id): New variable.
2117 (options, parse_opt): Grok --ignore-build-id to set it.
2118 (main): For SHT_NOTE sections, compare note details rather than raw
2119 bytes. Under --ignore-build-id, don't complain about differing build
2120 ID contents if lengths match.
2122 2011-02-08 Roland McGrath <roland@redhat.com>
2124 * ldscript.y (filename_id_star): Remove unused variable.
2126 * unstrip.c (copy_elided_sections): Remove unused variable.
2128 * elflint.c (check_dynamic): Remove unused variables.
2130 * elflint.c (check_symtab): Warn about missing xndx section only once.
2132 * ldgeneric.c (check_for_duplicate2): Remove unused variable.
2134 2011-01-06 Roland McGrath <roland@redhat.com>
2136 * strip.c (handle_elf): Under --strip-sections, remove all
2137 non-allocated sections and never generate .gnu_debuglink.
2139 2011-01-04 Roland McGrath <roland@redhat.com>
2141 * strip.c (remove_shdrs): New variable.
2142 (options, parse_opt): Grok --strip-sections to set it.
2143 (handle_elf): When that's set, truncate off .shstrtab and shdrs.
2145 2010-11-10 Roland McGrath <roland@redhat.com>
2147 * findtextrel.c (process_file): Don't assume order of sections.
2148 Reported by Mike Hommey <mh@glandium.org>.
2150 2010-07-26 Roland McGrath <roland@redhat.com>
2152 * readelf.c (print_ops): Handle DW_OP_GNU_implicit_pointer.
2154 2010-08-30 Roland McGrath <roland@redhat.com>
2156 Print .debug_loc/.debug_ranges with cognizance of actual DIE uses.
2157 * readelf.c (parse_opt): Add section_info to implicit_debug_sections
2159 (struct listptr, struct listptr_table): New types.
2160 (compare_listptr, reset_listptr, sort_listptr): New functions.
2161 (notice_listptr, skip_listptr_hole): New functions.
2162 (struct attrcb_args): Add silent member.
2163 (attr_callback): Call notice_listptr for loclistptr and rangelistptr.
2164 Suppress output if silent, but still call notice_listptr.
2165 (print_debug_units): Suppress output if section_info not requested.
2166 (print_debug_loc_section): Call sort_listptr, skip_listptr_hole.
2167 (print_debug_ranges_section): Likewise.
2168 (print_debug): Call reset_listptr on both tables.
2170 * readelf.c (print_debug_ranges_section): Print empty list.
2171 (print_debug_loc_section): Likewise.
2173 * readelf.c (print_debug_loc_section): Check for bogus length
2174 before calling print_ops.
2175 (print_ops): Check harder for bogus data that would read off end.
2177 2010-08-11 Roland McGrath <roland@redhat.com>
2179 * readelf.c (for_each_section_argument): Process all sections with
2180 matching name, not just the first.
2182 2010-07-26 Roland McGrath <roland@redhat.com>
2184 * readelf.c (print_ops): Take new argument for CU version.
2185 Fix DW_OP_call_ref decoding to depend on it.
2186 (print_debug_loc_section): Update caller.
2187 (print_cfa_program): Take new argument, pass it down.
2188 (print_debug_frame_section): Update caller.
2189 (struct attrcb_args): New member version.
2190 (print_debug_units): Initialize it.
2192 2010-07-02 Roland McGrath <roland@redhat.com>
2194 * readelf.c (print_debug_frame_section): Use format_dwarf_addr for
2197 2010-06-30 Roland McGrath <roland@redhat.com>
2199 * strings.c (main): Use STDIN_FILENO, not STDOUT_FILENO.
2200 Ignore st_size for a non-S_ISREG file descriptor.
2201 (read_block): Move assert after no-mmap bail-out.
2202 (read_block_no_mmap): Fix size calculations for moving buffer remnant.
2204 2010-06-22 Roland McGrath <roland@redhat.com>
2206 * readelf.c (print_debug_line_section): Fix braino in DW_LNS_set_isa.
2208 2010-06-21 Roland McGrath <roland@redhat.com>
2210 * readelf.c (dwarf_tag_string): Handle new v4 tags.
2211 (dwarf_attr_string): Add new attributes.
2212 (dwarf_tag_string): Handle DW_TAG_GNU_*.
2214 * readelf.c (print_ops): Use 64-bit types for LEB128 operands.
2215 (print_cfa_program): Likewise.
2217 2010-06-20 Roland McGrath <roland@redhat.com>
2219 * readelf.c (print_debug_units): New function, broken out of ...
2220 (print_debug_info_section): ... here. Call it.
2221 (print_debug_types_section): New function.
2222 (enum section_e): Add section_types alias for section_info.
2223 (print_debug): Add types to the sections table.
2225 * readelf.c (print_debug_frame_section): Handle version 4 format.
2227 * readelf.c (print_debug_line_section): Handle version 4 format.
2229 2010-06-14 Roland McGrath <roland@redhat.com>
2231 * unstrip.c (copy_elided_sections): Make sure all sections' data have
2232 been read in before we write anything out.
2234 2010-06-04 Roland McGrath <roland@redhat.com>
2236 * unstrip.c (update_shdr): New function.
2237 (update_sh_size): Call it instead of gelf_update_shdr.
2238 (adjust_relocs, add_new_section_symbols): Likewise.
2239 (new_shstrtab, copy_elided_sections): Likewise.
2241 * unstrip.c (copy_elided_sections): Bail if stripped file has more
2242 sections than unstripped file, rather than getting confused later.
2244 2010-06-01 Roland McGrath <roland@redhat.com>
2246 * readelf.c (dwarf_form_string): Handle DWARF 4 forms.
2247 (attr_callback): Handle DW_FORM_flag_present, DW_FORM_exprloc,
2248 DW_FORM_sec_offset, DW_FORM_ref_sig8.
2250 * readelf.c (print_debug): Don't bail if libdw setup fails.
2251 Suppress complaint if we only want .eh_frame anyway.
2253 2010-05-28 Ulrich Drepper <drepper@redhat.com>
2255 * readelf.c (attr_callback): Also print form information.
2257 2010-05-19 Roland McGrath <roland@redhat.com>
2259 * addr2line.c (find_symbol): Short-circuit on empty name.
2260 (handle_address): Handle SYMBOL with no +OFFSET.
2262 2010-05-08 Roland McGrath <roland@redhat.com>
2264 * readelf.c (print_ops): Take new arg OFFSET_SIZE.
2265 Use that for DW_OP_call_ref, not ADDRSIZE.
2266 (print_cfa_program): Update caller.
2267 (struct attrcb_args): Add offset_size field.
2268 (attr_callback): Use it for print_ops call.
2269 (print_debug_info_section): Initialize it.
2270 (print_ops): Likewise.
2272 2010-04-14 Roland McGrath <roland@redhat.com>
2274 * readelf.c (handle_core_item): Fix bitmask printing.
2276 2010-04-06 Roland McGrath <roland@redhat.com>
2278 * ld.c (options): Fix some typos in messages.
2279 * elflint.c (check_scn_group, check_group): Likewise.
2280 * ldscript.y (add_id_list): Likewise.
2281 * readelf.c (print_hash_info): Add xgettext:no-c-format magic comment
2282 before translated string containing a literal %.
2284 2010-02-26 Roland McGrath <roland@redhat.com>
2286 * readelf.c (process_file): Don't leak an fd in failure case.
2288 2010-02-15 Roland McGrath <roland@redhat.com>
2290 * Makefile.am: Use config/eu.am for common stuff.
2292 * readelf.c (print_debug_frame_section): Add a cast to avoid sign
2293 mismatch in comparison.
2295 2010-02-02 Roland McGrath <roland@redhat.com>
2297 * readelf.c (print_encoding_base): Handle DW_EH_PE_absptr (zero).
2298 (read_encoded): Likewise.
2299 (print_debug_frame_section): Check for bogus augmentation length.
2300 For P augmentation, use read_encoded, print the encoding description,
2301 and use hex for unsigned values.
2303 2010-01-15 Roland McGrath <roland@redhat.com>
2305 * ar.c: Include <sys/stat.h>.
2306 * elflint.c: Likewise.
2307 * readelf.c: Likewise.
2308 * strip.c: Likewise.
2309 * unstrip.c: Likewise
2311 2010-01-07 Roland McGrath <roland@redhat.com>
2313 * readelf.c (print_ehdr): Handle PN_XNUM.
2314 (phnum): New static variable.
2315 (process_elf_file): Set it with elf_getphdrnum.
2316 (print_phdr): Use phnum instead of EHDR->e_phnum.
2317 (print_dynamic, handle_notes): Likewise.
2318 (handle_relocs_rel, handle_relocs_rela): Likewise.
2320 * elfcmp.c (main): Use elf_getshdrnum and elf_getphdrnum.
2322 * elflint.c (phnum): New static variable.
2323 (check_elf_header): Set it, handling PN_XNUM.
2324 Use that in place of EHDR->e_phnum throughout.
2325 (check_symtab, check_reloc_shdr, check_dynamic): Likewise.
2326 (unknown_dependency_p, check_sections, check_program_header): Likewise.
2328 2010-01-05 Roland McGrath <roland@redhat.com>
2330 * readelf.c (dwarf_attr_string): Match DW_AT_GNU_vector and
2331 DW_AT_GNU_template_name.
2333 2010-01-04 Roland McGrath <roland@redhat.com>
2335 * readelf.c (handle_notes_data): Grab NT_AUXV only for name "CORE".
2336 (handle_core_note): Pass NHDR and NAME to ebl_core_note.
2337 (handle_core_item): Handle .format of '\n' as \n-separated strings.
2339 * readelf.c (implicit_debug_sections): New variable.
2340 (parse_opt): Set it instead of print_debug_sections for -a.
2341 OR them together for print_debug check.
2342 (print_debug): OR them together for section check.
2344 * readelf.c (options): Repartition into set implied by -a and others.
2345 Correct -a text to match reality.
2347 * readelf.c (struct section_argument): Add bool member 'implicit'.
2348 (parse_opt): Set it for -a cases, clear it for -x args.
2349 (for_each_section_argument): Don't complain about a missing section by
2350 name if it's implicit.
2352 2009-11-16 Roland McGrath <roland@redhat.com>
2354 * readelf.c (print_string_section): Punt SHT_NOBITS like empty
2355 sections, just as dump_data_section already does.
2357 2009-09-21 Ulrich Drepper <drepper@redhat.com>
2359 * elflint.c (special_sections): Allow MERGE and STRINGS flags to be
2360 set for .comment section.
2361 Patch by Mark Wielaard <mjw@redhat.com>.
2363 2009-09-08 Roland McGrath <roland@redhat.com>
2365 * ar.c (main): Fix typo in message format.
2367 2009-08-21 Roland McGrath <roland@redhat.com>
2369 * readelf.c (attr_callback): Use print_block only when we don't use
2372 2009-08-14 Roland McGrath <roland@redhat.com>
2374 * ar.c (do_oper_extract): Use pathconf instead of statfs.
2376 2009-08-01 Ulrich Drepper <drepper@redhat.com>
2378 * debugpred.h: Add two most const.
2380 2009-07-26 Mark Wielaard <mjw@redhat.com>
2382 * elflint.c (check_note_data): Recognize NT_GNU_GOLD_VERSION.
2384 2009-07-25 Mark Wielaard <mjw@redhat.com>
2386 * Makefile.am (addr2line_LDADD): Add $(libelf).
2388 2009-07-24 Roland McGrath <roland@redhat.com>
2390 * readelf.c (print_block): New function.
2391 (print_ops): Use it.
2392 (attr_callback): Use it for DW_FORM_block* forms.
2394 2009-07-20 Mark Wielaard <mjw@redhat.com>
2396 * readelf.c (print_ops): Add handling of DW_OP_implicit_value
2397 and DW_OP_stack_value.
2399 2009-07-14 Ulrich Drepper <drepper@redhat.com>
2401 * elflint.c (check_elf_header): Allow Linux ABI.
2402 (check_symtab): Handle STB_GNU_UNIQUE.
2404 2009-07-08 Mark Wielaard <mjw@redhat.com>
2406 * readelf.c (attr_callback): Handle DW_Form constants for
2407 DW_AT_data_member_location.
2409 2009-07-06 Roland McGrath <roland@redhat.com>
2411 * readelf.c (register_info): New function. Handle unknown register #s.
2412 (print_cfa_program): Use it.
2413 (handle_core_register, handle_core_registers): Likewise.
2415 2009-06-28 Roland McGrath <roland@redhat.com>
2417 * readelf.c (print_address_names): New static variable.
2418 (options, parse_opt): Grok -N/--numeric-addresses to clear it.
2419 (format_dwarf_addr): Don't look up name if !print_address_names.
2421 2009-06-13 Ulrich Drepper <drepper@redhat.com>
2423 * ldgeneric.c: Don't use deprecated libelf functions.
2425 * objdump.c: Likewise.
2426 * readelf.c: Likewise.
2428 * strip.c: Likewise.
2429 * unstrip.c: Likewise.
2430 * ld.h: Fix up comment.
2432 2009-06-01 Ulrich Drepper <drepper@redhat.com>
2434 * readelf.c (print_relocs): Expect ELF header argument and pass on
2435 to handle_relocs_rel* functions. Adjust caller.
2436 (handle_relocs_rel): Add ELF header argument. Add special case for
2437 the IRELATIVE relocations in statically linked executables.
2438 (handle_relocs_rela): Likewise.
2440 2009-04-29 Ulrich Drepper <drepper@redhat.com>
2442 * elflint.c (check_symtab): Add tests of st_other field.
2444 2009-04-23 Ulrich Drepper <drepper@redhat.com>
2446 * Makefile [BUILD_STATIC] (libdw): Add $(zip_LIBS).
2448 2009-04-20 Roland McGrath <roland@redhat.com>
2450 * addr2line.c (print_dwarf_function): Honor -s and -A for file names
2451 of inline call sites.
2453 * addr2line.c (just_section): New variable.
2454 (adjust_to_section): New function, broken out of ...
2455 (handle_address): ... here.
2456 (options, parse_opt): Add -j/--section=NAME to set it.
2458 2009-04-15 Roland McGrath <roland@redhat.com>
2460 * readelf.c (print_debug_frame_section): Check for DW_CIE_ID_64 in
2461 64-bit format header, DW_CIE_ID_32 in 32-bit format header.
2463 2009-04-14 Roland McGrath <roland@redhat.com>
2465 * readelf.c (print_attributes): Treat SHT_ARM_ATTRIBUTES on EM_ARM
2466 like SHT_GNU_ATTRIBUTES.
2468 * readelf.c (handle_core_registers): Fix error message.
2470 * strip.c (handle_elf: check_preserved): Don't note any change when
2471 .debug_data is already filled from a previous pass.
2473 2009-02-05 Ulrich Drepper <drepper@redhat.com>
2475 * objdump.c (show_relocs_x): Minor cleanups.
2477 * readelf.c (print_cfa_program): Correct a few labels.
2478 Print first DW_CFA_expression and DW_CFA_val_expression parameter
2481 2009-02-01 Ulrich Drepper <drepper@redhat.com>
2483 * objdump.c (show_relocs_rel, show_relocs_rela): Split common parts
2485 (show_relocs_x): ...here. New function.
2486 (show_relocs): Better spacing in output.
2488 * objdump.c (show_relocs_rela): Show offsets as signed values.
2490 * ar.c (main): Fix recognition of invalid modes for a, b, i modifiers.
2491 Improve some error messages.
2492 Use program_invocation_short_name instead of AR macro.
2493 * Makefile.am (CFLAGS_ar): Remove.
2494 * elflint.c (parse_opt): ARGP_HELP_EXIT_ERR does nothing for argp_help.
2495 * objdump.c (parse_opt): Likewise.
2496 * readelf.c (parse_opt): Likewise.
2498 2009-01-27 Roland McGrath <roland@redhat.com>
2500 * readelf.c (print_ops): Notice short length, don't overrun buffer
2501 (still need to fix LEB128).
2503 * readelf.c (print_ops): Fix DW_OP_call[24] decoding.
2505 * readelf.c (print_ops): Print (empty)\n when LEN == 0.
2507 2009-01-24 Ulrich Drepper <drepper@redhat.com>
2509 * readelf.c (print_debug_frame_section): Fix computation of vma_base
2510 for PC-relative mode.
2512 2009-01-23 Ulrich Drepper <drepper@redhat.com>
2514 * size.c (process_file): When handling archive, close file descriptor
2515 here. For unknown file format also close file descriptor.
2516 (handle_ar): Don't close file descriptor here.
2518 * readelf.c (parse_opt): Move code to add to dump_data_sections and
2519 string_sections list in local function add_dump_section. Adjust 'x'
2520 key handling. For 'a' key add .strtab, .dynstr, and .comment section
2521 to string_sections list.
2523 2009-01-22 Roland McGrath <roland@redhat.com>
2525 * readelf.c (print_phdr): Don't print section mapping when no sections.
2527 * Makefile.am (AM_CFLAGS): Pass -Wno-format for *_no_Wformat.
2529 * readelf.c (print_debug_frame_section): Initialize IS_SIGNED to false
2530 and reset it only for the 'true' cases.
2532 * Makefile.am (addr2line_no_Wformat): New variable.
2534 * readelf.c (print_debug_frame_section): Use t instead of j formats
2535 for ptrdiff_t OFFSET.
2537 2009-01-21 Ulrich Drepper <drepper@redhat.com>
2539 * elflint.c (check_program_header): Fix typo in .eh_frame_hdr section
2540 test. Handle debuginfo files.
2541 (check_exception_data): First sanity test.
2543 2009-01-17 Ulrich Drepper <drepper@redhat.com>
2545 * readelf.c (print_debug_exception_table): Show target of ar_disp
2548 * elflint.c (check_program_header): Add most consistency checks for
2549 PT_GNU_EH_FRAME entry.
2551 * addr2line.c: Use ARGP_PROGRAM_VERSION_HOOK_DEF and
2552 ARGP_PROGRAM_BUG_ADDRESS_DEF.
2554 * elfcmp.c: Likewise.
2555 * elflint.c: Likewise.
2556 * findtextrel.c: Likewise.
2559 * objdump.c: Likewise.
2560 * ranlib.c: Likewise.
2561 * readelf.c: Likewise.
2564 * strings.c: Likewise.
2565 * strip.c: Likewise.
2566 * unstrip.c: Likewise.
2568 2009-01-16 Ulrich Drepper <drepper@redhat.com>
2570 * elflint.c (check_program_header): Check that PT_GNU_EH_FRAME entry
2571 matches .eh_frame_hdr section, if it is available. Also check that
2572 the segment is allocated, not writable, not executable.
2574 * readelf.c: Add -e option. Dump exception and unwind related
2575 sections. Add -e to -a.
2576 (print_encoding_base): Handle DW_EH_PE_omit.
2577 (print_debug_exception_table): Beginning of support.
2578 (print_debug): Hook up print_debug_exception_table for
2579 .gcc_except_table sections.
2581 * readelf.c (print_debug_frame_section): Some fixes for last change.
2583 2009-01-15 Ulrich Drepper <drepper@redhat.com>
2585 * readelf.c (print_encoding): Now a toplevel function.
2586 (print_relinfo): Likewise.
2587 (print_encoding_base): Broken out of print_debug_frame_section.
2588 (print_debug_frame_section): Print different header for .eh_frame
2589 sections. Fix recognition of matching CIEs in .debug_frame sections.
2590 Print absolute offset for PC-relative FDE locations. Don't print
2591 table header for FDEs if the table is empty.
2592 (read_encoded): New function.
2593 (print_debug_frame_hdr_section): New function.
2594 (print_debug): Hook up print_debug_frame_hdr_section for .eh_frame_hdr
2597 * readelf.c (handle_relocs_rel): Print section number.
2598 (print_debug_abbrev_section): Likewise.
2599 (print_debug_aranges_section): Likewise.
2600 (print_debug_ranges_section): Likewise.
2601 (print_debug_info_section): Likewise.
2602 (print_debug_line_section): Likewise.
2603 (print_debug_loc_section): Likewise.
2604 (print_debug_macinfo_section): Likewise.
2605 (print_debug_pubnames_section): Likewise.
2606 (print_debug_str_section): Likewise.
2608 2009-01-10 Ulrich Drepper <drepper@redhat.com>
2610 * strings.c (read_block): Fix typo in error message string.
2612 2009-01-07 Ulrich Drepper <drepper@redhat.com>
2614 * ld.c (ld_new_searchdir): Fix adding to search path list.
2616 2009-01-06 Ulrich Drepper <drepper@redhat.com>
2618 * readelf.c: Implement call frame debug section dumping.
2620 2009-01-05 Roland McGrath <roland@redhat.com>
2622 * elfcmp.c: Exit with status 2 for errors (like cmp, diff, grep).
2623 Status 1 (aka EXIT_FAILURE) is only for completed OK but not equal.
2625 2009-01-01 Ulrich Drepper <drepper@redhat.com>
2627 * addr2line.c: Update copyright year.
2629 * elfcmp.c: Likewise.
2630 * elflint.c: Likewise.
2631 * findtextrel.c: Likewise.
2634 * objdump.c: Likewise.
2635 * ranlib.c: Likewise.
2636 * readelf.c: Likewise.
2638 * strings.c: Likewise.
2639 * strip.c: Likewise.
2640 * unstrip.c: Likewise.
2642 2008-12-11 Roland McGrath <roland@redhat.com>
2644 * nm.c (sym_name): New function.
2645 (show_symbols_sysv): Use it in place of elf_strptr.
2646 (show_symbols_bsd, show_symbols_posix): Likewise.
2649 * nm.c (show_symbols_sysv): Use an alloca'd backup section name when
2652 2008-12-02 Roland McGrath <roland@redhat.com>
2654 * readelf.c (count_dwflmod, process_file): Don't presume encoding of
2655 nonzero OFFSET argument to dwfl_getmodules.
2657 2008-08-07 Roland McGrath <roland@redhat.com>
2659 * addr2line.c (main): Pass string to handle_address.
2660 (see_one_module): New function, subroutine of handle_address.
2661 (find_symbol): Likewise.
2662 (handle_address): Take string argument rather than address.
2663 Convert plain number, or handle strings like "(section)+offset"
2666 2008-08-01 Roland McGrath <roland@redhat.com>
2668 * readelf.c (handle_core_item): Handle 'B' type for 1-origin bitset.
2669 For 'b' and 'B', print <x-y,z> or ~<x,y-z> rather than 1/0 string.
2671 * readelf.c (convert): Take new argument SIZE.
2672 (handle_core_register, handle_core_item): Update callers.
2673 (handle_core_item): Take new arg REPEATED_SIZE.
2674 (handle_core_items): Special case for a singleton item,
2675 let handle_core_item handle repeats if it wants to.
2677 * readelf.c (handle_core_items): Give abridged output
2678 for identical groups repeated more than twice.
2680 2008-07-04 Roland McGrath <roland@redhat.com>
2682 * readelf.c (handle_core_items): Handle ELF_T_ADDR.
2684 2008-04-10 Roland McGrath <roland@redhat.com>
2686 * strip.c (handle_elf): Don't keep sections that kept symbol tables
2687 refer to. Instead, just be sure to preserve the original symbol
2688 table in the debug file so those symbols go with their sections and
2689 can be elided from the stripped version of the symbol table.
2691 * strip.c (handle_elf): When a discarded section kept in the debug
2692 file refers to a nondiscard section via sh_link/sh_info, preserve
2693 that nondiscarded section unmodified in the debug file as well.
2694 Skip adjustment of discarded sections symbol table references when
2695 that symbol table is copied in this way.
2697 * elflint.c (check_symtab): Don't crash from missing symbol names
2698 after diagnosing bogus strtab.
2700 * strip.c (handle_elf): Cosmetic cleanup in special section contents
2701 adjustment for symtab changes.
2703 2008-03-31 Roland McGrath <roland@redhat.com>
2705 * elflint.c (check_sections): Add checks on SHF_EXECINSTR sections:
2706 must be SHT_PROGBITS, must not be SHF_WRITE. Let backend hook
2707 excuse a special section.
2709 2008-03-27 Roland McGrath <roland@redhat.com>
2711 * elflint.c (check_sections): Check that executability and writability
2712 of sections is reflected in segment p_flags.
2714 2008-03-26 Roland McGrath <roland@redhat.com>
2716 * elflint.c (check_program_header): Accept PT_GNU_RELRO p_flags
2717 that matches its PT_LOAD's p_flags &~ PF_W. On sparc, PF_X really
2720 2008-02-29 Roland McGrath <roland@redhat.com>
2722 * readelf.c (print_attributes): Add a cast.
2723 * elflint.c (check_attributes): Likewise.
2725 * unaligned.h (add_8ubyte_unaligned): Cast PTR argument for parity
2726 with [UNALIGNED_ACCESS_CLASS == BYTE_ORDER] definition.
2727 (add_4ubyte_unaligned, add_2ubyte_unaligned): Likewise.
2729 2008-02-03 Ulrich Drepper <drepper@redhat.com>
2731 * i386_ld.c (elf_i386_count_relocations): Implement R_386_TLS_GD
2732 when linked into executable.
2733 (elf_i386_create_relocations): Likewise.
2735 2008-02-20 Roland McGrath <roland@redhat.com>
2737 * readelf.c (print_attributes): New function.
2738 (process_elf_file): Call it under -A.
2740 * elflint.c (check_attributes): Implement it for real.
2742 2008-02-19 Roland McGrath <roland@redhat.com>
2744 * elflint.c (special_sections): Handle .gnu.attributes section.
2745 (check_sections): Likewise.
2746 (check_attributes): New function.
2748 2008-02-10 Roland McGrath <roland@redhat.com>
2750 * elfcmp.c (main): Ignore sh_offset differences in non-SHF_ALLOC
2751 sections and ET_REL files.
2753 2008-02-02 Ulrich Drepper <drepper@redhat.com>
2755 * elf32-i386.script: Add .eh_frame_hdr, .tdata, and .tbss sections.
2756 * i386_ld.c (elf_i386_count_relocations): Handle R_386_TLS_LDO_32
2758 (elf_i386_create_relocations): Likewise.
2759 * ld.h (struct ld_state): Add need_tls, tls_start, and tls_tcb
2761 * ldgeneric.c (add_section): If TLS section is used, set need_tls flag.
2762 (ld_generic_create_outfile): Add PT_TLS entry to program header.
2763 Fix generation of PT_GNU_STACK entry.
2765 2008-02-01 Ulrich Drepper <drepper@redhat.com>
2767 * ld.c (replace_args): Prevent loop over replacements if the parameter
2768 is only two characters long.
2770 * ld.c: Recognize sha1 argument for --build-id parameter.
2771 * ldgeneric.c (create_build_id_section): Handle sha1.
2772 (compute_hash_sum): New function. Broken out of compute_build_id.
2773 Take hash function and context as parameters.
2774 (compute_build_id): Use compute_hash_sum for md5 and the new sha1
2777 2008-01-31 Ulrich Drepper <drepper@redhat.com>
2779 * elf32-i386.script: Add .note.ABI-tag and .note.gnu.build-id sections.
2780 * ld.c: Recognize --build-id command line parameter.
2781 * ld.h: Define scn_dot_note_gnu_build_id.
2782 (struct ld_state): Add build_id and buildidscnidx elements.
2783 * ldgeneric.c: Implement --build-id command line parameter.
2784 * ldlex.l (ID): Recognize - as valid character after the first one.
2786 2008-01-29 Ulrich Drepper <drepper@redhat.com>
2788 * ld.c (replace_args): New function.
2789 (main): Use it to rewrite old-style parameters.
2791 * elf32-i386.script: Add .gnu.hash section.
2792 * ldgeneric.c (optimal_bucket_size): A tiny bit more efficient.
2793 (fillin_special_symbol): Initialize st_size.
2794 (sortfct_hashval): New function.
2795 (create_gnu_hash): New function.
2796 (create_hash): New function.
2797 (ld_generic_create_outfile): Use the new functions to create the
2800 * elflint.c (check_gnu_hash): Fix index value printed in error message.
2802 2008-01-24 Ulrich Drepper <drepper@redhat.com>
2804 * elflint.c (check_group): Check that signature symbol for section
2805 group is not an empty string.
2806 * ldgeneric.c: Remove magic assignment of indeces in the dynsym
2807 section. Start implementation of --hash-style.
2808 * i386_ld.c: Likewise.
2809 * ld.c: Recognize --hash-style.
2810 * ld.h (struct scninfo): Add comdat_group.
2811 Add additional parameter to finalize_plt callback.
2813 2008-01-22 Ulrich Drepper <drepper@redhat.com>
2815 * ld.h (struct callbacks): Add initialize_gotplt.
2816 (struct scnhead): Add scn_dot_gotplt.
2817 (struct ld_state): Add gotpltscnidx.
2818 * i386_ld.c (elf_i386_initialize_plt): Minor optimization.
2819 (elf_i386_initialize_pltrel): Likewise.
2820 (elf_i386_initialize_got): There is now a separate .got.plt, so
2821 don't do the PLT-related work here. Initialize d_type.
2822 (elf_i386_initialize_gotplt): New function.
2823 (elf_i386_plt0): Use ud2a after indirect jump.
2824 (elf_i386_pic_plt0_entry): Likewise.
2825 (elf_i386_finalize_plt): Reference now .got.plt.
2826 (elf_i386_count_relocations): For GOT entries which need no relocation
2827 don't bump nrel_got.
2828 (elf_i386_create_relocations): Also get .got.plt. Rewrite R-386_GOT32
2829 handling for split .got/.got.plt.
2830 (elf_i386_ld_init): Initialize callbacks.initialize_gotplt.
2831 * elf32-i386.script: Sort sections for security. There are no .got
2832 input sections. Add .got.plt.
2833 * ldgeneric.c (ld_generic_generate_sections): Add .got.plt section.
2834 (ld_generic_create_outfile): Initialize .got.plt section.
2835 Use .got.plt address for _GLOBAL_OFFSET_TABLE_ symbol and DT_PLTGOT.
2837 2008-01-19 Ulrich Drepper <drepper@redhat.com>
2839 * i386_ld.c (elf_i386_count_relocations): PLT relocations for undefined
2840 symbols are not carried over into statically linked output files.
2841 Add dummy entries for more TLS relocations.
2843 * ld.c (options): Add long names for -( and -).
2845 * ldgeneric.c (check_definition): For newly found definitions don't
2846 mark section as used if symbol is absolute.
2847 (extract_from_archive): Only assign archive sequence number the first
2848 time the archive is handled. Update ld_state.last_archive_used
2849 if any symbol was used. Remove nround variable.
2850 (file_process2): When using symbol from an archive, update
2851 ld_state.group_start_archive, ld_state.archives, and
2852 ld_state.tailarchives.
2853 (ld_generic_file_process): If group is not handled anymore, after
2854 freeing ELF handles for the archives, clear ld_state.archives and
2855 *nextp. Fix wrong logic in recognizing first iteration of group
2856 loop. When clearing flags, also clear ld_state.group_start_archive.
2858 2008-01-11 Ulrich Drepper <drepper@redhat.com>
2860 * objdump.c (show_disasm): Adjust disassembler format string for
2863 2008-01-04 Roland McGrath <roland@redhat.com>
2865 * readelf.c (handle_core_items): Take new arg DESCSZ; if nonzero,
2866 a size greater than the items cover means multiple sets of items.
2867 (handle_core_note): Update caller.
2869 2008-01-04 Roland McGrath <roland@redhat.com>
2871 * strip.c (handle_elf): Move SHDRIDX defn to silence gcc warning.
2873 2008-01-03 Roland McGrath <roland@redhat.com>
2875 * ld.h (linked_from_dso_p): Use __attribute__ ((__gnu_inline__)).
2877 * elflint.c (check_dynamic): Remove duplicate initializer.
2879 2008-01-02 Ulrich Drepper <drepper@redhat.com>
2881 * addr2line.c: Update copyright year.
2883 * elfcmp.c: Likewise.
2884 * elflint.c: Likewise.
2885 * findtextrel.c: Likewise.
2888 * objdump.c: Likewise.
2889 * ranlib.c: Likewise.
2890 * readelf.c: Likewise.
2892 * strings.c: Likewise.
2893 * strip.c: Likewise.
2894 * unstrip.c: Likewise.
2896 2007-12-30 Ulrich Drepper <drepper@redhat.com>
2898 * objdump (show_disasm): Use %e after third parameter.
2900 2007-12-21 Ulrich Drepper <drepper@redhat.com>
2902 * strip.c: Fix wrong parenthesis in a few branch predictions.
2903 * strings.c: Likewise.
2905 2007-12-20 Ulrich Drepper <drepper@redhat.com>
2907 * Makefile.am (DEFS): Add DEBUGPRED.
2908 * addr2line.c: Include debugpred.h.
2910 * elfcmp.c: Likewise.
2911 * elflint.c: Likewise.
2912 * findtextrel.c: Likewise.
2914 * objdump.c: Likewise.
2915 * ranlib.c: Likewise.
2916 * readelf.c: Likewise.
2918 * strings.c: Likewise.
2919 * strip.c: Likewise.
2920 * unstrip.c: Likewise.
2921 * debugpred.h: New file.
2923 * readelf.c (handle_relocs_rel): Use elf_scnshndx.
2924 (handle_relocs_rela): Likewise.
2926 * readelf.c: Add lots of likely/unlikely.
2928 * elflint.c: Minor cleanups.
2930 2007-11-19 Roland McGrath <roland@redhat.com>
2932 * readelf.c (print_ops): Handle all bad op codes gracefully.
2933 Print their numbers instead of just ???.
2935 2007-11-09 Roland McGrath <roland@redhat.com>
2937 * readelf.c (attr_callback): Handle DW_AT_data_location.
2938 Handle block forms to mean a DWARF expression for DW_AT_allocated,
2939 DW_AT_associated, DW_AT_bit_size, DW_AT_bit_offset, DW_AT_bit_stride,
2940 DW_AT_byte_size, DW_AT_byte_stride, DW_AT_count, DW_AT_lower_bound,
2943 2007-10-20 Roland McGrath <roland@redhat.com>
2945 * unstrip.c (options): Update -R description.
2946 (struct symbol): Put symbol details a union with a size_t pointer
2948 (compare_symbols_output): Use null ->name as marker for discard
2949 symbols, not zero *->map.
2950 (copy_elided_sections): Record forwarding pointers for discarded
2951 duplicates and fill SYMNDX_MAP elements through them.
2953 * readelf.c (process_file): Set offline_next_address to 0 at start.
2954 (struct process_dwflmod_args): New type.
2955 (process_dwflmod): Take args in it, pass fd to process_elf_file.
2956 (process_file): Update caller; dup FD for passing to libdwfl.
2957 (process_elf_file): Take new arg FD. For ET_REL file when
2958 displaying data affected by libdwfl relocation, open a new Elf handle.
2960 2007-10-17 Roland McGrath <roland@redhat.com>
2962 * readelf.c (print_debug_line_section): For invalid data inside a
2963 unit with plausible length, keep printing at the next unit boundary.
2965 * readelf.c (attr_callback): Use dwarf_formref_die, not dwarf_formref.
2967 2007-10-16 Roland McGrath <roland@redhat.com>
2969 * readelf.c (hex_dump): Fix rounding error in whitespace calculation.
2971 2007-10-15 Roland McGrath <roland@redhat.com>
2973 * make-debug-archive.in: New file.
2974 * Makefile.am (EXTRA_DIST): Add it.
2975 (make-debug-archive): New target.
2976 (bin_SCRIPTS, CLEANFILES): Add it.
2978 2007-10-10 Roland McGrath <roland@redhat.com>
2980 * elflint.c (special_sections): Add new attrflag value exact_or_gnuld.
2981 Use it to check MERGE|STRINGS for .debug_str.
2982 (check_sections): Handle exact_or_gnuld.
2984 2007-10-08 Roland McGrath <roland@redhat.com>
2986 * readelf.c (handle_core_item): Handle 'T'|0x80 to indicate
2987 64-bit struct timeval with 32-bit tv_usec.
2989 2007-10-07 Roland McGrath <roland@redhat.com>
2991 * readelf.c (check_archive_index): New function.
2992 (process_file): Call it. Change signature to take only fd and name.
2993 Use libdwfl to open the file, then iterate on its modules (multiple
2994 for an archive) to print file name and call process_elf_file.
2995 (main): Update caller. Let process_file do elf_begin.
2996 (count_dwflmod, process_dwflmod, find_no_debuginfo): New functions.
2997 (process_elf_file): Take only Dwfl_Module * argument.
2998 Don't print the file name here.
2999 (print_debug_*_section): Take Dwfl_Module * argument.
3000 (print_debug): Likewise. Update caller.
3001 (format_dwarf_addr): New function.
3002 (print_debug_ranges_section): Use it.
3003 (attr_callback): Likewise.
3004 (print_debug_line_section, print_debug_loc_section): Likewise.
3006 * readelf.c (print_debug_ranges_section): Translate all strings.
3007 (print_debug_loc_section): Likewise.
3009 * unstrip.c (copy_elided_sections): Initialize SEC.
3011 * ar.c (do_oper_insert): Put trailing / on short names.
3013 * arlib.h (MAX_AR_NAME_LEN): Decrease by one.
3015 * arlib2.c (arlib_add_long_name): Adjust for header size.
3017 * arlib.c (arlib_finalize): Pad long name table to keep size even.
3019 * ar.c (do_oper_insert): Use write_retry for padding write.
3021 * ar.c (do_oper_insert): Initialize CUR_OFF in no_old case.
3022 Unconditionally set FOUND[CNT]->elf when setting ->mem.
3023 (remember_long_name): New function.
3024 (do_oper_insert): Call it. Correctly use length of basename,
3025 not original name. Don't store long name twice for new member.
3027 2007-10-06 Roland McGrath <roland@redhat.com>
3029 * elflint.c (check_note): Skip empty segment.
3030 (check_note_section): Skip empty section.
3032 * unstrip.c (options, parse_opt, struct arg_info): Grok -R/--relocate.
3033 (handle_output_dir_module, handle_implicit_modules): Pass it down.
3034 (handle_dwfl_module): When set, use ET_REL already loaded by Dwfl.
3035 (compare_alloc_sections): Take new arg REL, ignore address if true.
3036 (compare_sections): Likewise, pass it down.
3037 (compare_sections_rel, compare_sections_nonrel): New functions.
3038 (find_alloc_sections_prelink, copy_elided_sections): Use them
3039 instead of compare_sections.
3040 (sections_match): New function, broken out of ...
3041 (find_alloc_section): ... here.
3042 (copy_elided_sections): Reorganize section match-up logic.
3043 Use sections_match for SHF_ALLOC in ET_REL.
3044 For ET_REL, let the nonzero sh_addr from the debug file dominate.
3046 * unstrip.c (add_new_section_symbols): Take new arg REL.
3047 When true, do not update section symbol values.
3048 (collect_symbols): Likewise. Update section symbols with address
3049 of chosen output section, not original section.
3050 (check_symtab_section_symbols, copy_elided_sections): Update callers.
3052 * unstrip.c (compare_alloc_sections): At the same address, preserve
3053 original section order.
3055 * elflint.c (special_sections): Don't require MERGE|STRINGS for
3056 .debug_str, it didn't always have them with older tools.
3058 * elflint.c (check_symtab, check_one_reloc): Ignore sh_addr in ET_REL.
3060 2007-10-05 Roland McGrath <roland@redhat.com>
3062 * elflint.c (check_symtab): Allow SHN_UNDEF _GLOBAL_OFFSET_TABLE_ in
3065 * elflint.c (check_symtab): For _GLOBAL_OFFSET_TABLE_, diagnose
3066 SHN_UNDEF as "bad section". Use shndx value in messages.
3068 * elflint.c (special_sections): Add ".debug_str". Decrement namelen
3069 for ".debug" so it matches as a prefix.
3070 (IS_KNOWN_SPECIAL): New macro.
3071 (check_sections): Use it for ".plt" match. Cite wrong SHT_NOBITS
3072 type even under -d, for a .debug* or .shstrtab section.
3074 * readelf.c (print_ops): Use hex for address operand.
3076 2007-10-04 Roland McGrath <roland@redhat.com>
3078 * unstrip.c (copy_elided_sections): Initialize NDX_SECTION element for
3079 .gnu_debuglink section to SHN_UNDEF. Drop STT_SECTION symbols for
3080 sections mapped to SHN_UNDEF.
3082 2007-10-04 Ulrich Drepper <drepper@redhat.com>
3084 * readelf.c (dump_archive_index): Avoid warning about uninitialized
3085 variable with older glibc versions.
3086 Add some branch prediction.
3088 2007-10-04 Roland McGrath <roland@redhat.com>
3090 * readelf.c (print_archive_index): New variable.
3091 (options, parse_opt): Accept -c/--archive-index to set it.
3092 (dump_archive_index): New function.
3093 (process_file): Take new arg WILL_PRINT_ARCHIVE_INDEX.
3094 Call dump_archive_index on archives if set.
3095 (main): Update caller.
3096 (any_control_option): Give it file scope, moved out of ...
3097 (parse_opt): ... here.
3099 2007-10-03 Roland McGrath <roland@redhat.com>
3101 * unstrip.c (struct arg_info): Add `list' flag.
3102 (options, parse_opt): Grok -n/--list to set it.
3103 (list_module): New function.
3104 (handle_implicit_modules): Call it under -n.
3106 * elflint.c (check_note_section): New function.
3107 (check_sections): Call it for SHT_NOTE.
3109 * readelf.c (handle_notes): Use sections when available.
3111 * elflint.c (check_note_data): New function, broken out of ...
3112 (check_note): ... here. Call it and elf_getdata_rawchunk.
3114 * readelf.c (handle_auxv_note): Take offset as argument, not buffer.
3115 Use elf_getdata_rawchunk and gelf_getauxv.
3116 (handle_notes_data): New function, broken out of ...
3117 (handle_notes): ... here. Call it and elf_getdata_rawchunk.
3119 2007-10-01 Roland McGrath <roland@redhat.com>
3121 * readelf.c (hex_dump): Fix transposed subtraction generating spaces.
3123 * readelf.c (hex_dump): Fix line header to be hex instead of decimal.
3125 2007-09-10 Roland McGrath <roland@redhat.com>
3127 * readelf.c (options): Give -p optional argument, alias --string-dump.
3128 (string_sections, string_sections_tail): New static variables.
3129 (parse_opt): Set them when -p has an argument.
3130 (print_string_section): New function, broken out of ...
3131 (print_strings): ... here. Call it.
3132 (dump_data_section): New function, broken out of ...
3133 (dump_data): ... here. Call it.
3134 (for_each_section_argument): New function, broken out of ...
3135 (dump_data): ... here. Call it.
3136 (dump_strings): New function.
3138 2007-08-31 Roland McGrath <roland@redhat.com>
3140 * readelf.c (print_strings): Typo fix.
3142 2007-08-23 Roland McGrath <roland@redhat.com>
3144 * readelf.c (printf_with_wrap): Function removed.
3145 (REGISTER_WRAP_COLUMN): New macro.
3146 (handle_core_register): Use print_core_item instead.
3147 (struct register_info): New type.
3148 (compare_registers, compare_register_sets): New functions.
3149 (register_bitpos, compare_sets_by_info): New functions.
3150 (handle_core_registers): Use those to segregate and sort registers
3153 * readelf.c (ITEM_WRAP_COLUMN): New macro.
3154 (print_core_item): New function.
3155 (handle_core_item): Use it instead of printf_with_wrap.
3156 (compare_core_items, compare_core_item_groups): New functions.
3157 (handle_core_items): Use them. Sort by group and force line breaks
3160 * readelf.c (handle_core_registers, handle_core_items): New functions,
3162 (handle_core_note): ... here. Call them.
3164 2007-08-22 Roland McGrath <roland@redhat.com>
3166 * unstrip.c (new_shstrtab): New function, broken out of ...
3167 (copy_elided_sections): ... here.
3169 2007-08-20 Roland McGrath <roland@redhat.com>
3171 Avoid local function trampolines in nm binary.
3172 * nm.c (sort_by_address): Move to a static function instead of local
3173 inside show_symbols.
3174 (sort_by_name_strtab): New static variable.
3175 (sort_by_name): Use it. Move to a static function instead of local
3176 inside show_symbols.
3177 (show_symbols): Set sort_by_name_strtab.
3179 2007-08-19 Roland McGrath <roland@redhat.com>
3181 * readelf.c (handle_auxv_note): New function.
3182 (handle_notes): Call it.
3184 * readelf.c (printf_with_wrap, convert): New functions.
3185 (handle_core_item, (handle_core_register): New functions.
3186 (handle_notes): Call those with details from ebl_core_note.
3188 2007-08-12 Roland McGrath <roland@redhat.com>
3190 * elflint.c (check_note): Accept type 0 with name "Linux".
3192 * elflint.c (special_sections): Accept SHF_ALLOC for ".note".
3194 * elflint.c (section_flags_string): Return "none" for 0, not "".
3196 2007-08-11 Roland McGrath <roland@redhat.com>
3198 * elflint.c (check_note): Accept NT_GNU_HWCAP, NT_GNU_BUILD_ID.
3200 2007-08-04 Ulrich Drepper <drepper@redhat.com>
3202 * readelf.c (hex_dump): Use isprint to determine whether to print
3203 character itself or full stop character.
3204 (dump_data): No need to check endp for NULL after strtol call.
3206 2007-08-03 Roland McGrath <roland@redhat.com>
3208 * readelf.c (print_string_sections): New variable.
3209 (options, parse_opt): Handle --strings/-p to set it.
3210 (print_strings): New function.
3211 (process_elf_file): Call it under -p.
3213 * readelf.c (options): Add hidden aliases --segments, --sections,
3214 as taken by binutils readelf.
3216 2007-08-01 Roland McGrath <roland@redhat.com>
3218 * readelf.c (dump_data_sections, dump_data_sections_tail):
3220 (options, parse_opt): Handle --hex-dump/-x, set them.
3221 (hex_dump): New function.
3222 (dump_data): New function, call it.
3223 (process_elf_file): Call it.
3225 2007-07-25 Roland McGrath <roland@redhat.com>
3227 * addr2line.c (show_symbols): New variable.
3228 (print_addrsym): New function.
3229 (handle_address): Call it.
3230 (options, parse_opt): Handle -S/--symbols.
3232 2007-06-05 Ulrich Drepper <drepper@redhat.com>
3234 * addr2line.c: Update for latest autoconf header.
3236 * elfcmp.c: Likewise.
3237 * elflint.c: Likewise.
3238 * findtextrel.c: Likewise.
3240 * ldgeneric.c: Likewise.
3242 * objdump.c: Likewise.
3243 * ranlib.c: Likewise.
3244 * readelf.c: Likewise.
3246 * strings.c: Likewise.
3247 * strip.c: Likewise.
3248 * unstrip.c: Likewise.
3250 2007-05-18 Roland McGrath <roland@redhat.com>
3252 * unstrip.c (copy_elided_sections): Match up non-NOBITS sections with
3253 stripped file, so as not to duplicate a section copied in both.
3255 * strip.c (handle_elf): Keep SHT_NOTE section copies in the debug file.
3257 2007-05-17 Roland McGrath <roland@redhat.com>
3259 * unstrip.c (copy_elided_sections): Don't call gelf_newphdr for 0.
3261 * unstrip.c (handle_file): Tweak BIAS != 0 warning.
3263 * unstrip.c (handle_file): Take new arg CREATE_DIRS. If set,
3264 call make_directories here.
3265 (handle_explicit_files): Take new arg CREATE_DIRS, pass it down.
3266 (handle_dwfl_module): Likewise.
3267 (handle_implicit_modules): Update callers.
3268 (handle_output_dir_module): Likewise. Don't do make_directories here.
3270 * unstrip.c (get_section_name): New function, broken out of ...
3271 (copy_elided_sections): here. Update callers.
3272 (find_alloc_section): Broken out of ...
3273 (copy_elided_sections): ... here. Update caller.
3274 (symtab_count_leading_section_symbols): Take new arg NEWSYMDATA,
3275 update STT_SECTION symbols' st_value fields as a side effect.
3276 (check_symtab_section_symbols): Update caller.
3277 (add_new_section_symbols): Set st_value in symbols added.
3278 (collect_symbols): Reset S->value for STT_SECTION symbols recorded.
3279 Take new arg SPLIT_BSS. Adjust S->shndx recorded for symbols moved
3280 from .bss to .dynbss.
3281 (find_alloc_sections_prelink): New function. Associate debug file
3282 allocated SHT_NOBITS shdrs with stripped moved by prelink via
3283 .gnu.prelink_undo information.
3284 (copy_elided_sections): Call it when we couldn't find every allocated
3285 section. Don't use a debug file non-NOBITS section if SHF_ALLOC.
3286 Take STRIPPED_EHDR arg instead of E_TYPE and PHNUM.
3287 (handle_file): Update callers.
3289 * unstrip.c (copy_elided_sections): Ignore unfound unallocated section
3292 * elflint.c (check_sections): Fix association of segments with
3293 sections when p_memsz > p_filesz.
3295 2007-04-29 Roland McGrath <roland@redhat.com>
3297 * addr2line.c (options, main): Tweak argp group settings to fix
3300 2007-04-28 Roland McGrath <roland@redhat.com>
3302 * strip.c (handle_elf): Update debug file's SHT_NOBITS sections'
3303 sizes to match sections adjusted in the stripped file.
3305 2007-04-24 Roland McGrath <roland@redhat.com>
3307 * elfcmp.c (OPT_HASH_INEXACT): New macro.
3308 (hash_inexact): New variable.
3309 (options, parse_opt): Add --hash-inexact option to set it.
3310 (hash_content_equivalent): New function.
3311 (main): Call it for differing SHT_HASH sections under --hash-inexact.
3313 2007-04-23 Roland McGrath <roland@redhat.com>
3315 * unstrip.c: New file.
3316 * Makefile.am (bin_PROGRAMS): Add it.
3317 (unstrip_LDADD): New variable.
3319 * strip.c (options): Allow --output for -o.
3321 2007-02-15 Ulrich Drepper <drepper@redhat.com>
3323 * readelf.c: Remove unused code. Add a few consts.
3325 2007-02-15 Roland McGrath <roland@redhat.com>
3327 * readelf.c (print_debug): Fix brainos in SHDR test.
3329 2007-02-05 Roland McGrath <roland@redhat.com>
3331 * ar.c: Include <limits.h>, since we use LONG_MAX.
3333 2007-02-05 Ulrich Drepper <drepper@redhat.com>
3335 * ar.c: Add ugly hack to work around gcc complaining that we
3336 ignore fchown's return value.
3337 (do_oper_insert): Handle error when writing padding.
3338 * ranlib.c: Add fchown complain work around.
3340 * arlib.c: Make symtab a global variable. Change all users.
3341 * arlib2.c: Likewise.
3342 * ranlib.c: Likewise.
3344 * arlib.h: Declare it.
3346 2007-01-11 Roland McGrath <roland@redhat.com>
3348 * elflint.c (check_sections): Use ebl_machine_section_flag_check on
3349 SHF_MASKPROC bits separately from generic sh_flags validation.
3351 2007-02-04 Ulrich Drepper <drepper@redhat.com>
3354 * arlib.c: New file.
3355 * arlib2.c: New file.
3356 * arlib.h: New file.
3357 * Makefile (noinst_LIBRARIES): Add libar.
3358 (libar_a_SOURCES): Define.
3360 (CFLAGS_ar): Define.
3361 * ranlib.c: Change to use arlib.
3363 * elflint.c (check_symtab): Work around GNU ld bug which omits
3364 sections but not symbols in those sections.
3366 2007-01-10 Ulrich Drepper <drepper@redhat.com>
3368 * addr2line.c: Update copyright year.
3369 * elfcmp.c: Likewise.
3370 * elflint.c: Likewise.
3371 * findtextrel.c: Likewise.
3374 * objdump.c: Likewise.
3375 * ranlib.c: Likewise.
3376 * readelf.c: Likewise.
3378 * strings.c: Likewise.
3379 * strip.c: Likewise.
3381 2006-12-09 Ulrich Drepper <drepper@redhat.com>
3383 * elflint.c (compare_hash_gnu_hash): New function. Report if the
3384 two hash tables have different content (module expected omission
3385 of undefined symbols).
3387 2006-10-31 Roland McGrath <roland@redhat.com>
3389 * elflint.c (check_program_header): Don't complain about
3390 p_filesz > p_memsz if p_memsz is zero and p_type is PT_NOTE.
3392 2006-09-19 Jakub Jelinek <jakub@redhat.com>
3394 * strip.c (process_file): Disallow -f on archives.
3396 2006-10-09 Roland McGrath <roland@redhat.com>
3398 * Makefile.am (libld_elf_i386.so): Use $(LINK), not $(CC).
3400 2006-08-29 Roland McGrath <roland@redhat.com>
3402 * Makefile.am (MAINTAINERCLEANFILES): New variable.
3404 * readelf.c (handle_relocs_rel): Typo fix, test DESTSHDR properly.
3405 Reported by Christian Aichinger <Greek0@gmx.net>.
3407 * elflint.c (valid_e_machine): Add EM_ALPHA.
3408 Reported by Christian Aichinger <Greek0@gmx.net>.
3410 2006-08-08 Ulrich Drepper <drepper@redhat.com>
3412 * elflint.c (check_dynamic): Don't require DT_HASH for DT_SYMTAB.
3413 Keep track of which "high DT" entries are present.
3414 Check that either old or GNU-style hash table is present.
3415 If GNU-style hash table is used a symbol table is mandatory.
3416 Check that if any prelink entry is present all of them are.
3417 (check_gnu_hash): Only fail for undefined symbols in GNU-style hash
3418 table if they don't refer to functions.
3420 2006-07-17 Roland McGrath <roland@redhat.com>
3422 * elflint.c (struct version_namelist): Use GElf_Versym for `ndx' field.
3423 (add_version): Likewise for argument.
3424 (check_versym): Cast constant to GElf_Versym for comparison.
3426 2006-07-12 Roland McGrath <roland@redhat.com>
3428 * readelf.c (handle_gnu_hash): Add casts for machines where
3429 Elf32_Word != unsigned int.
3431 2006-07-12 Ulrich Drepper <drepper@redhat.com>
3433 * elflint.c (check_sysv_hash64): Fix printf format.
3435 2006-07-11 Roland McGrath <roland@redhat.com>
3437 * addr2line.c (options): English fix in -f doc string.
3439 * addr2line.c (use_comp_dir): New variable.
3440 (options, parse_opt): Grok -A/--absolute to set it.
3441 (handle_address): If set, prepend dwfl_line_comp_dir results to
3442 relative file names.
3444 2006-07-06 Ulrich Drepper <drepper@redhat.com>
3446 * elflint.c: Adjust for latest new hash table format.
3447 * readelf.c: Likewise.
3449 * elflint.c (check_versym): Ignore hidden bit when comparing version
3452 2006-07-05 Ulrich Drepper <drepper@redhat.com>
3454 * ldgeneric.c (ld_generic_create_outfile): Correctly recognize
3455 discarded COMDAT symbols.
3457 * i386_ld.c (elf_i386_count_relocations): Lot of corrections.
3458 (elf_i386_create_relocations): Likewise.
3459 * ld.h (struct symbol): Add local and hidden bits.
3460 * ld.c (create_special_section_symbol): These synthsized symbols
3461 are local and hidden.
3462 * ldgeneric.c (file_process2): Check whether input file matches
3464 (fillin_special_symbol): Create symbols as local and/or hidden
3466 (ld_generic_create_outfile): Make local copy of symbol.
3467 Don't hide global, defined symbols in dynamic symbol table unless
3468 requested. Synthetic symbols have no version information.
3470 * elflint.c: Add support for checking 64-bit SysV-style hash tables.
3471 * readelf.c: Add support for printing 64-bit SysV-style hash tables.
3473 2006-07-04 Ulrich Drepper <drepper@redhat.com>
3475 * elflint.c (is_rel_dyn): Fix and extend DT_RELCOUNT/DT_RELACOUNT
3478 2006-07-03 Ulrich Drepper <drepper@redhat.com>
3480 * elflint.c: Add testing of DT_GNU_HASH.
3481 * readelf.c: Implement showing histogram for DT_GNU_HASH section.
3483 * Makefile.am: Add hacks to create dependency files for non-generic
3486 2006-06-12 Ulrich Drepper <drepper@redhat.com>
3488 * ldgeneric.c (ld_generic_generate_sections): Don't create .interp
3489 section if creating a DSO and no interpreter is given.
3490 (ld_generic_create_outfile): Don't store reference to symbols in
3491 discarded COMDAT groups. Don't create PHDR and INTERP program header
3492 for DSO if no interpreter is specified.
3493 (create_verneed_data): Pretty printing.
3495 * ldscript.y (content): If a DSO is created don't set default
3496 interpreter from linker script.
3498 * i386_ld.c (elf_i386_count_relocations): Do not add relocations
3499 for symbols in discarded COMDAT groups.
3500 (elf_i386_create_relocations): Likewise.
3501 * ld.h (struct scninfo): Add unused_comdat.
3502 * ldgeneric.c (add_section): Also check group signature when
3503 matching COMDAT sections.
3504 (add_relocatable_file): Ignore symbols in COMDAT group which are
3507 * elflint.c (check_one_reloc): For *_NONE relocs only check type
3508 and symbol reference.
3510 2006-06-11 Ulrich Drepper <drepper@redhat.com>
3512 * elflint.c (check_dynamic): Fix checking value of tags which are
3513 offsets in the string section. Make sure DT_STRTAB points to the
3514 section referenced in sh_link.
3516 * ld.c (options): Add headers. Add short option 'R' for '--rpath'.
3518 * ld.c: Recognize --eh-frame-hdr option.
3519 * ld.h (struct ld_state): Add eh_frame_hdr field.
3520 * ldgeneric.c (struct unw_eh_frame_hdr): Define.
3522 * ldgeneric.c (add_section): Use ebl_sh_flags_combine instead of
3524 (add_relocatable_file): Minor optimization of last change.
3525 (match_section): Don't preserve SHF_GROUP flag any longer.
3527 2006-06-10 Ulrich Drepper <drepper@redhat.com>
3529 * ld.c (parse_z_option): Recognize execstack and noexecstack.
3530 Handle record and ignore as position dependent options.
3531 (parse_z_option_2): Handle ignore and record here.
3532 * ld.h (struct ld_state): Add execstack field.
3533 * ldgeneric.c (add_relocatable_file): Recognize .note.GNU-stack
3535 (ld_generic_create_outfile): Fix program header creation in native
3536 linker. Add PT_GNU_STACK program header.
3538 2006-06-09 Ulrich Drepper <drepper@redhat.com>
3540 * i386_ld.c (elf_i386_finalize_plt): Don't change symbol table entries
3541 for PLT entries if there is no local definition.
3543 * ld.c (parse_option): Handle -z ignore like --as-needed and
3544 -z record like --no-as-needed.
3545 * ld.h (struct ld_state): Remove ignore_unused_dsos field.
3546 * ldgeneric.c (new_generated_scn): Always compute ndt_needed by
3547 looping over DSOs. When deciding about adding DT_NEEDED entries
3548 use ->as_needed instead of ignore_unused_dsos.
3550 2006-05-31 Ulrich Drepper <drepper@redhat.com>
3552 * ld.c: Recognize --as-needed and --no-as-needed options.
3553 * ld.h (struct usedfile): Add as_needed field.
3554 (struct ld_state): Likewise.
3555 * ldgeneric.c (ld_handle_filename_list): Copy as_needed flag from
3557 * ldscript.y (filename_id_list): Split to correctly parse all
3559 (mark_as_needed): Fix loop.
3561 2006-05-28 Ulrich Drepper <drepper@redhat.com>
3563 * addr2line.c (print_dwarf_function): Use unsigned type for lineno
3566 2006-05-27 Ulrich Drepper <drepper@redhat.com>
3568 * readelf.c (handle_relocs_rela): Better notations for addon value.
3569 (print_ehdr): Distinguish e_ident[EI_VERSION] from e_version.
3571 2006-04-04 Ulrich Drepper <drepper@redhat.com>
3573 * addr2line.c: Update copyright year.
3574 * elfcmp.c: Likewise.
3575 * elflint.c: Likewise.
3576 * findtextrel.c: Likewise.
3579 * objdump.c: Likewise.
3580 * ranlib.c: Likewise.
3581 * readelf.c: Likewise.
3583 * strings.c: Likewise.
3584 * strip.c: Likewise.
3586 2006-03-09 Roland McGrath <roland@redhat.com>
3588 * Makefile.am (AM_LDFLAGS): New variable.
3590 2006-03-01 Roland McGrath <roland@redhat.com>
3592 * readelf.c (dwarf_tag_string, dwarf_attr_string): Update name tables
3593 for dwarf.h changes matching 3.0 spec.
3594 (dwarf_encoding_string, dwarf_lang_string, print_ops): Likewise.
3596 2005-12-04 Ulrich Drepper <drepper@redhat.com>
3598 * elflint.c (check_one_reloc): If relocation section is not loaded,
3599 don't check whether the relocations modify read-only sections or
3600 loaded and unloaded sections.
3602 2005-11-28 Ulrich Drepper <drepper@redhat.com>
3604 * elflint.c (check_one_reloc): Take additional parameters. Use
3605 them to determine whether relocation is valid in this type of
3606 file. DSOs and executables can contain relocation sections in
3607 unloaded sections which just show the relocations the linker
3608 applied. Adjust all callers.
3609 (check_program_header): Check that PT_PHDR is loaded and that offset
3610 matches the one in the ELF header.
3612 2005-10-26 Roland McGrath <roland@redhat.com>
3614 * nm.c (get_var_range): dwarf_getloclist -> dwarf_getlocation.
3616 2005-09-03 Ulrich Drepper <drepper@redhat.com>
3618 * strip.c (handle_elf): Unify some error messages.
3619 * ld.c (main): Likewise.
3620 * ldgeneric.c (open_elf): Likewise.
3621 * elfcmp.c (main): Likewise.
3622 * elflint.c (check_elf_header): Likewise.
3624 * size.c (process_file): Fix typo in error message.
3626 * readelf.c: Lots of little cleanups. Use _unlocked functions.
3628 2005-09-02 Ulrich Drepper <drepper@redhat.com>
3630 * strings.c (main): Reset elfmap variable after munmap call.
3631 [_MUDFLAP] (map_file): Simplify mudflap debugging by not using mmap.
3633 2005-08-28 Ulrich Drepper <drepper@redhat.com>
3635 * ranlib.c: Don't define pread_retry and write_retry here.
3637 * Makefile.an [BUILD_STATIC] (libdw): Add -ldl.
3638 (CLEANFILES): Add *.gcno *.gcda *.gconv.
3640 * strings.c (process_chunk): Reorder expressions in conditional
3641 (process_chunk_mb): Likewise.
3643 * strings.c: New file.
3644 * Makefile.am (bin_PROGRAMS): Add strings.
3645 (strings_no_Wstring): Define.
3646 (strings_LDADD): Define.
3648 2005-08-27 Roland McGrath <roland@redhat.com>
3650 * addr2line.c (dwarf_diename_integrate): Function removed.
3651 (print_dwarf_function): Use plain dwarf_diename.
3653 2005-08-24 Ulrich Drepper <drepper@redhat.com>
3655 * elflint.c (check_versym): Versioned symbols should not have
3658 2005-08-15 Ulrich Drepper <drepper@redhat.com>
3660 * elflint.c (check_versym): Allow VER_NDX_LOCAL symbols to be
3663 * Makefile.am: Add rules to build ranlib.
3664 * ranlib.c: New file.
3666 2005-08-14 Roland McGrath <roland@redhat.com>
3668 * elflint.c (check_sections): Use ebl_section_type_name and allow any
3669 sh_type it recognizes.
3671 * elflint.c (check_sections): Print unknown flags in hex, don't
3672 truncate high bits. Print section number and name for unknown type.
3674 2005-08-13 Roland McGrath <roland@redhat.com>
3676 * elflint.c (check_program_header): Use ebl_segment_type_name and
3677 allow any p_type it recognizes. Include p_type value in error
3678 message for unknown type.
3680 2005-08-13 Ulrich Drepper <drepper@redhat.com>
3682 * elflint.c (check_symtab): Simplify last change a bit. Pass ehdr
3683 to ebl_check_special_symbol.
3684 (check_sections): Pass ehdr to ebl_bss_plt_p.
3686 2005-08-12 Roland McGrath <roland@redhat.com>
3688 * elflint.c (check_symtab): Check that _GLOBAL_OFFSET_TABLE_ st_shndx
3689 refers to the right section if it's not SHN_ABS.
3690 Let ebl_check_special_symbol override _G_O_T_ value and size checks.
3692 * elflint.c (check_sections): Don't complain about a non-NOBITS
3693 section taking no segment space, if it's sh_size is 0.
3695 * elflint.c (check_sections): Use ebl_bss_plt_p to see if .plt should
3696 be PROGBITS or NOBITS.
3698 * elflint.c (check_symtab): Use ebl_check_special_symbol to override
3699 standard st_value and st_size checks.
3701 2005-07-28 Roland McGrath <roland@redhat.com>
3703 * addr2line.c (options, parse_opt): Don't handle -e here.
3704 (executable): Variable removed.
3705 (argp_children): New static variable.
3706 (argp): Use it. Make const.
3707 (main): Fill in argp_children from dwfl_standard_argp ().
3708 Let libdwfl handle file selection, pass Dwfl handle to handle_address.
3709 (print_dwarf_function): New function. Try to figure out inline chain.
3710 (elf_getname): Function removed, libdwfl does it for us.
3711 (handle_address): Take Dwfl handle instead of Elf, Dwarf handles.
3712 Use dwfl_module_addrname instead of elf_getname.
3713 Use dwfl_module_getsrc and dwfl_lineinfo instead of libdw calls.
3714 * Makefile.am (INCLUDES): Add libdwfl directory to path.
3716 2005-08-10 Ulrich Drepper <drepper@redhat.com>
3718 * strip.c (parse_opt): STATE parameter is now used.
3719 Various little cleanups.
3721 * readelf.c (print_debug_line_section): Correct fallout of renaming
3722 of DW_LNS_set_epilog_begin.
3724 2005-08-08 Roland McGrath <roland@redhat.com>
3726 * strip.c (options, parse_opt): Grok -R .comment for compatibility
3727 with binutils strip. Likewise -d, -S, as aliases for -g.
3728 Likewise ignore -s/--strip-all.
3730 2005-08-07 Roland McGrath <roland@redhat.com>
3732 * strip.c (process_file): Open read-only when using a different output
3735 2005-08-06 Ulrich Drepper <drepper@redhat.com>
3737 * elflint.c (in_nobits_scn): New function.
3738 (check_versym): Allow references for defined symbols against versions
3739 of other DSOs also for symbols in nobits sections.
3740 Move a few variables around.
3742 * Makefile.am (AM_CFLAGS): Avoid duplication.
3743 Link with statis libs if BUILD_STATIC.
3745 2005-08-05 Ulrich Drepper <drepper@redhat.com>
3747 * elflint.c: Many, many more tests. Mostly related to symbol
3748 versioning. Those sections should now be completely checked.
3750 * readelf.c (print_dynamic): Use gelf_offscn.
3752 2005-08-04 Ulrich Drepper <drepper@redhat.com>
3754 * elflint.c: Add lots more tests: more extension symbol table sanity,
3755 versioning section tests, hash table tests. General cleanup.
3757 2005-08-02 Ulrich Drepper <drepper@redhat.com>
3759 * objdump.c: New file.
3760 * Makefile.am (bin_PROGRAMS): Add objdump.
3761 (objdump_LDADD): Define.
3763 * elflint.c (check_reloc_shdr): New function split out from check_rela
3765 (check_one_reloc): New function. Likewise.
3766 (check_rela): Use check_reloc_shdr and check_one_reloc.
3767 (check_rel): Likewise.
3768 (check_program_header): Check that PT_DYNAMIC entry matches .dynamic
3770 Add checks that relocations against read-only segments are flagged,
3771 that the text relocation flag is not set unnecessarily, and that
3772 relocations in one section are either against loaded or not-loaded
3775 2005-08-01 Ulrich Drepper <drepper@redhat.com>
3777 * elfcmp.c (main): Ignore section count and section name string table
3780 2005-07-27 Roland McGrath <roland@redhat.com>
3782 * elfcmp.c: Include <locale.h>.
3784 2005-07-27 Ulrich Drepper <drepper@redhat.com>
3786 * elfcmp.c: Print name and index of differing section.
3788 2005-07-24 Ulrich Drepper <drepper@redhat.com>
3790 * elfcmp.c: Implement comparing gaps between sections.
3792 2005-07-23 Ulrich Drepper <drepper@redhat.com>
3794 * elflint.c: Include libeblP.h instead of libebl.h.
3796 * readelf.c: Likewise.
3797 * elfcmp.c: Likewise.
3799 * elfcmp.c (main): Compare individual ELF header fields, excluding
3800 e_shoff instead of the whole struct at once.
3801 Use ebl_section_strip_p instead of SECTION_STRIP_P.
3802 * strip.c: Use ebl_section_strip_p instead of SECTION_STRIP_P.
3804 2005-07-22 Ulrich Drepper <drepper@redhat.com>
3806 * elfcmp.c (main): Take empty section into account when comparing
3809 * elflint.c (check_dynamic): Check that d_tag value is >= 0 before
3812 2005-07-21 Ulrich Drepper <drepper@redhat.com>
3814 * elfcmp.c: New file.
3815 * Makefile.am (bin_PROGRAMS): Add elfcmp.
3816 (elfcmp_LDADD): Define.
3818 * elflint.c (check_rela): Check that copy relocations only reference
3819 object symbols or symbols with unknown type.
3820 (check_rel): Likewise.
3822 2005-06-08 Roland McGrath <roland@redhat.com>
3824 * readelf.c (print_ops): Add consts.
3826 2005-05-31 Roland McGrath <roland@redhat.com>
3828 * readelf.c (print_debug_abbrev_section): Don't bail after first CU's
3829 abbreviations. Print a header line before each CU section.
3831 * readelf.c (print_debug_loc_section): Fix indentation for larger
3834 2005-05-30 Roland McGrath <roland@redhat.com>
3836 * readelf.c (print_debug_line_section): Print section offset of each
3837 CU's table, so they are easy to find from seeing the stmt_list value.
3839 * readelf.c (dwarf_attr_string): Add all attributes in <dwarf.h>.
3840 (attr_callback): Grok DW_AT_ranges and print offset in hex.
3842 * readelf.c (attr_callback): Add 2 to addrsize * 2 for %#0* format.
3843 (print_debug_ranges_section, print_debug_loc_section): Likewise.
3845 * readelf.c (print_ops): Take different args for indentation control.
3846 (attr_callback): Caller updated.
3847 Grok several more block-form attributes as being location expressions.
3848 For those same attributes with udata forms, format output differently
3849 for location list offset.
3850 (print_debug_loc_section): Implement it for real.
3852 * readelf.c (options): Mention ranges for --debug-dump.
3853 (enum section_e): Add section_ranges.
3854 (parse_opt): Grok "ranges" for -w/--debug-dump.
3855 (print_debug_ranges_section): New function.
3856 (print_debug): Handle .debug_ranges section.
3858 2005-05-30 Ulrich Drepper <drepper@redhat.com>
3860 * readelf.c (handle_notes): At least x86-64 need not have the note
3861 section values aligned to 8 bytes.
3863 2005-05-18 Ulrich Drepper <drepper@redhat.com>
3865 * readelf.c (dwarf_tag_string): Add new tags.
3867 2005-05-08 Roland McGrath <roland@redhat.com>
3869 * strip.c (handle_elf): Don't translate hash and versym data formats,
3870 elf_getdata already did it for us.
3872 2005-05-07 Ulrich Drepper <drepper@redhat.com>
3874 * Makefile.am (findtextrel_LDADD): Add $(libmudflap).
3875 (addr2line_LDADD): Likewise.
3877 2005-05-03 Roland McGrath <roland@redhat.com>
3879 * strip.c (handle_elf): Apply symbol table fixups to discarded
3880 relocation sections when they are being saved in the debug file.
3882 * strip.c (handle_elf): Pass EHDR->e_ident[EI_DATA] to gelf_xlatetom
3883 and gelf_xlatetof, not the native byte order.
3885 * strip.c (parse_opt): Give error if -f or -o is repeated.
3886 (main): Exit if argp_parse returns nonzero.
3888 * strip.c (debug_fname_embed): New variable.
3889 (options, parse_opt): New option -F to set it.
3891 2005-05-07 Ulrich Drepper <drepper@redhat.com>
3893 * readelf.c (parse_opt): Make any_control_option variable
3894 local. Simplify some tests.
3896 2005-05-03 Roland McGrath <roland@redhat.com>
3898 * strip.c (crc32_file): Function removed (now in ../lib).
3900 2005-05-03 Roland McGrath <roland@redhat.com>
3902 * elflint.c (is_debuginfo): New variable.
3903 (options, parse_opt): New option --debuginfo/-d to set it.
3904 (check_sections): If is_debuginfo, don't complain about SHT_NOBITS.
3905 (check_note): If is_debuginfo, don't try to get note contents.
3907 2005-04-24 Ulrich Drepper <drepper@redhat.com>
3909 * readelf.c (print_debug_abbrev_section): Don't print error when end of
3912 2005-04-14 Ulrich Drepper <drepper@redhat.com>
3914 * readelf.c (dwarf_encoding_string): New function.
3915 (dwarf_inline_string): New function.
3916 (dwarf_access_string): New function.
3917 (dwarf_visibility_string): New function.
3918 (dwarf_virtuality_string): New function.
3919 (dwarf_identifier_case_string): New function.
3920 (dwarf_calling_convention_string): New function.
3921 (dwarf_ordering_string): New function.
3922 (dwarf_discr_list_string): New function.
3923 (attr_callback): Decode man more attribute values.
3925 2005-04-01 Ulrich Drepper <drepper@redhat.com>
3927 * addr2line.c: Finish implementation of -f option.
3929 2005-03-29 Ulrich Drepper <drepper@redhat.com>
3931 * addr2line.c: New file.
3932 * Makefile.am (bin_PROGRAMS): Add addr2line.
3933 Define addr2line_LDADD.
3935 * findtextrel.c: Use new dwarf_addrdie function.
3937 * findtextrel.c: Fix usage message and re-add accidentally removed
3940 2005-03-28 Ulrich Drepper <drepper@redhat.com>
3942 * findtextrel.c: New file.
3943 * Makefile: Add rules to build findtextrel.
3945 2005-02-15 Ulrich Drepper <drepper@redhat.com>
3947 * ldlex.l: Provide ECHO definition to avoid warning.
3949 * elflint.c (check_program_header): Fix typo in RELRO test.
3951 * Makefile.am (AM_CFLAGS): Add more warning options.
3952 * elflint.c: Fix warnings introduced by the new warning options.
3953 * i386_ld.c: Likewise.
3956 * ldgeneric.c: Likewise.
3958 * readelf.c: Likewise.
3959 * sectionhash.c: Likewise.
3961 * string.c: Likewise.
3963 2005-02-05 Ulrich Drepper <drepper@redhat.com>
3965 * Makefile.am: Check for text relocations in constructed DSOs.
3967 * Makefile.am [MUDFLAP] (AM_CFLAGS): Add -fmudflap. Link all apps
3970 * ldscript.y: Add as_needed handling.
3971 * ldlex.l: Recognize AS_NEEDED token.
3972 * ld.h (struct filename_list): Add as_needed flag.
3974 2005-02-04 Ulrich Drepper <drepper@redhat.com>
3976 * elflint.c (check_symtab): Correctly determine size of GOT section.
3978 2005-01-19 Ulrich Drepper <drepper@redhat.com>
3980 * ld.c: Remove unnecessary more_help function. Print bug report
3982 * strip.c: Likewise.
3985 * readelf.c: Likewise.
3986 * elflint.c: Likewise.
3988 * elflint.c (main): Don't check for parameter problems here.
3989 (parse_opt): Do it here, where we get informed about some of them
3992 * readelf.c (main): Don't check for parameter problems here.
3993 (parse_opt): Do it here, where we get informed about some of them
3996 2005-01-11 Ulrich Drepper <drepper@redhat.com>
3998 * strip.c: Update copyright year.
3999 * readelf.c: Likewise.
4003 * elflint.c: Likewise.
4005 * elflint.c (check_symtab): Don't warn about wrong size for
4006 _DYNAMIC and __GLOBAL_OFFSET_TABLE__ for --gnu-ld.
4008 2004-10-05 Ulrich Drepper <drepper@redhat.com>
4010 * readelf.c (print_phdr): In section mapping, also indicate
4011 sections in read-only segments.
4013 2004-09-25 Ulrich Drepper <drepper@redhat.com>
4015 * readelf.c: Make compile with gcc 4.0.
4016 * strip.c: Likewise.
4018 2004-08-16 Ulrich Drepper <drepper@redhat.com>
4020 * strip.c (handle_elf): Rewrite dynamic memory handling to use of
4021 allocate to work around gcc 3.4 bug.
4023 2004-01-25 Ulrich Drepper <drepper@redhat.com>
4025 * ldlex.l (invalid_char): Better error message.
4027 2004-01-23 Ulrich Drepper <drepper@redhat.com>
4029 * readelf.c: Print SHT_GNU_LIBLIST sections.
4031 * none_ld.c: New file.
4033 2004-01-21 Ulrich Drepper <drepper@redhat.com>
4035 * Makefile.am: Enable building of machine specific linker.
4037 2004-01-20 Ulrich Drepper <drepper@redhat.com>
4039 * Makefile.am: Support building with mudflap.
4041 * i386_ld.c: Fix warnings gcc 3.4 spits out.
4042 * ldgeneric.c: Likewise.
4043 * ldscript.y: Likewise.
4044 * readelf.c: Likewise.
4045 * strip.c: Likewise.
4047 * readelf.c (print_debug_line_section): Determine address size
4050 2004-01-19 Ulrich Drepper <drepper@redhat.com>
4052 * readelf.c (print_phdr): Show which sections are covered by the
4055 * elflint.c (check_program_header): Check PT_GNU_RELRO entry.
4057 * readelf.c (print_debug_macinfo_section): Implement.
4059 2004-01-18 Ulrich Drepper <drepper@redhat.com>
4061 * readelf.c (print_debug_line_section): Implement.
4063 2004-01-17 Ulrich Drepper <drepper@redhat.com>
4065 * src/elflint.c: Use PACKAGE_NAME instead of PACKAGE.
4066 * src/ld.c: Likewise.
4067 * src/nm.c: Likewise.
4068 * src/readelf.c: Likewise.
4069 * src/size.c: Likewise.
4070 * src/strip.c: Likewise.
4072 * strip.c: Add a few more unlikely. Reduce scope of some variables.
4074 * Makefile.am: Support building with mudflap.
4076 2004-01-16 Ulrich Drepper <drepper@redhat.com>
4078 * readelf.c (print_debug_info_section): Free dies memory.
4080 * readelf.c: Print .debug_info section content.
4082 2004-01-13 Ulrich Drepper <drepper@redhat.com>
4084 * readelf.c (print_shdr): Add support for SHF_ORDERED and SHF_EXCLUDE.
4086 2004-01-12 Ulrich Drepper <drepper@redhat.com>
4088 * readelf.c (print_debug_aranges): Implement using libdw.
4090 2004-01-11 Ulrich Drepper <drepper@redhat.com>
4092 * nm.c: Adjust for Dwarf_Files type and dwarf_lineno interface change.
4094 * readelf.c: Use libdw instead of libdwarf. Not all of the old
4095 behavior is available yet.
4096 * Makefile.am: Link readelf with libdw. Remove libdwarf include path.
4098 2004-01-09 Ulrich Drepper <drepper@redhat.com>
4100 * nm.c (get_local_names): Adjust call to dwarf_nextcu.
4102 * nm.c: Implement getting information about local variables.
4104 2004-01-07 Ulrich Drepper <drepper@redhat.com>
4106 * nm.c: Read also debug information for local symbols.
4108 2004-01-05 Ulrich Drepper <drepper@redhat.com>
4110 * nm.c: Shuffle dwarf handling code around so the maximum column
4111 width can be computed ahead of printing. Avoid collection symbols
4112 which are not printed anyway.
4114 * nm.c: Rewrite dwarf handling to use libdw.
4115 * Makefile.am (AM_CFLAGS): Add -std parameter.
4116 (INCLUDES): Find header in libdw subdir.
4117 (nm_LDADD): Replace libdwarf with libdw.
4119 * elflint.c: Update copyright year.
4120 * readelf.c: Likewise.
4122 * strip.c: Likewise.
4125 2003-12-31 Ulrich Drepper <drepper@redhat.com>
4127 * strip.c (process_file): Close file before returning.
4129 2003-11-19 Ulrich Drepper <drepper@redhat.com>
4131 * readelf.c (handle_dynamic): Make column for tag name wider.
4133 2003-09-29 Ulrich Drepper <drepper@redhat.com>
4135 * readelf.c (handle_dynamic): Always terminate tag name with a space.
4137 2003-09-25 Ulrich Drepper <drepper@redhat.com>
4139 * strip.c (process_file): Don't mmap the input file, we modify the
4140 data structures and don't want the change end up on disk.
4142 2003-09-23 Jakub Jelinek <jakub@redhat.com>
4144 * unaligned.h (union u_2ubyte_unaligned,
4145 union u_4ubyte_unaligned, union u_8ubyte_unaligned): Add
4147 (add_2ubyte_unaligned, add_4ubyte_unaligned,
4148 add_8ubyte_unaligned): Avoid nesting bswap_NN macros.
4149 Read/store value through _ptr->u instead of *_ptr.
4151 2003-09-22 Ulrich Drepper <drepper@redhat.com>
4153 * size.c (show_sysv): Change type of maxlen to int.
4155 * strip.c (handle_elf): Handle the 64-bit archs which is 64-bit
4158 * i386_ld.c: Many many fixes and extensions.
4160 * ldgeneric.c: Likewise.
4162 2003-08-16 Ulrich Drepper <drepper@redhat.com>
4164 * ldgeneric.c (check_definition): Don't add symbol on dso_list if
4165 the reference is from another DSO.
4167 2003-08-15 Ulrich Drepper <drepper@redhat.com>
4169 * ldgeneric.c (find_entry_point): It is no fatal error if no entry
4170 point is found when creating a DSO.
4172 2003-08-14 Ulrich Drepper <drepper@redhat.com>
4174 * ld.c (main): Always call FLAG_UNRESOLVED.
4175 * ldgeneric.c (ld_generic_flag_unresolved): Only complain about
4176 undefined symbols if not creating DSO or ld_state.nodefs is not set.
4178 2003-08-13 Ulrich Drepper <drepper@redhat.com>
4180 * Makefile.in: Depend on libebl.a, not libebl.so.
4182 * ld.c (main): Mark stream for linker script as locked by caller.
4183 (read_version_script): Likewise.
4184 * ldlex.c: Define fread and fwrite to _unlocked variant.
4186 * i386_ld.c (elf_i386_finalize_plt): Replace #ifdefs with uses of
4188 * unaligned.h: Define target_bswap_16, target_bswap_32, and
4190 (store_2ubyte_unaligned, store_4ubyte_unaligned,
4191 store_8ubyte_unaligned): Define using new macros.
4193 2003-08-12 Ulrich Drepper <drepper@redhat.com>
4195 * i386_ld.c (elf_i386_finalize_plt): Use packed structs to access
4196 possibly unaligned memory. Support use of big endian machines.
4198 2003-08-11 Ulrich Drepper <drepper@redhat.com>
4200 * Moved to CVS archive.