1 2012-08-27 Mark Wielaard <mjw@redhat.com>
3 * readelf.c (print_debug_macro_section): Print offset as PRIx64.
5 2012-08-27 Mark Wielaard <mjw@redhat.com>
7 * readelf.c (register_info): Handle loc == NULL.
9 2012-08-22 Jeff Kenton <jkenton@tilera.com>
11 * elflint.c (valid_e_machine): Add EM_TILEGX and EM_TILEPRO.
13 2012-08-16 Mark Wielaard <mjw@redhat.com>
15 * readelf.c (dwarf_tag_name): Renamed from dwarf_tag_string.
16 Uses new dwarf_tag_string or adds ??? or lo_user+%#x when
18 (dwarf_attr_name): Likewise.
19 (dwarf_form_name): Likewise.
20 (dwarf_lang_name): Likewise.
21 (dwarf_inline_name): Likewise.
22 (dwarf_encoding_name): Likewise.
23 (dwarf_access_name): Likewise.
24 (dwarf_visibility_name): Likewise.
25 (dwarf_virtuality_name): Likewise.
26 (dwarf_identifier_case_name): Likewise.
27 (dwarf_calling_convention_name): Likewise.
28 (dwarf_ordering_name): Likewise.
29 (dwarf_discr_list_name): Likewise.
30 (print_ops): Remove KNOWN. Use dwarf_locexpr_opcode_string.
31 (attr_callback): Call new dwarf_foobar_name instead of old
32 dwarf_foobar_string functions.
33 (dwarf_tag_string): New function using known-dwarf.h macros.
34 (dwarf_attr_string): Likewise.
35 (dwarf_form_string): Likewise.
36 (dwarf_lang_string): Likewise.
37 (dwarf_inline_string): Likewise.
38 (dwarf_encoding_string): Likewise.
39 (dwarf_access_string): Likewise.
40 (dwarf_visibility_string): Likewise.
41 (dwarf_virtuality_string): Likewise.
42 (dwarf_identifier_case_string): Likewise.
43 (dwarf_calling_convention_string): Likewise.
44 (dwarf_ordering_string): Likewise.
45 (dwarf_discr_list_string): Likewise.
46 (dwarf_locexpr_opcode_string): Likewise.
48 2012-06-27 Mark Wielaard <mjw@redhat.com>
50 * readelf.c (dwarf_form_string): Handle DW_FORM_GNU_ref_alt and
52 (attr_callback): Likewise.
54 2012-07-30 Petr Machata <pmachata@redhat.com>
56 * nm.c (show_symbols_bsd): Reorder arguments in {S,}FMTSTRS (and
57 corresponding printf) so that those that are referenced by only
58 one of the formatting strings are at the end.
60 2012-07-29 Mark Wielaard <mjw@redhat.com>
62 * readelf.c (dwarf_lang_string): Use DW_LANG_ObjC, not DW_LANG_Objc.
63 (print_ops): Use known[op], not op_name, for DW_OP_GNU_parameter_ref.
65 2012-07-19 Mark Wielaard <mjw@redhat.com>
67 * readelf.c (print_ops): Handle DW_OP_GNU_parameter_ref.
69 2012-07-11 Mark Wielaard <mjw@redhat.com>
71 * readelf.c (options): Add macro to help of debug-dump.
72 (section_e): Add section_macro.
73 (section_all): Add section_macro.
74 (parse_opt): Handle macro.
75 (print_debug_macro_section): New function.
76 (print_debug): Add NEW_SECTION (macro).
78 2012-07-10 Mark Wielaard <mjw@redhat.com>
80 * readelf.c (print_gdb_index_section): Add version 7 support.
81 Keep track of cu_nr. Print kind and static/global flag for each
82 symbol. When a symbol is in the TU list add 'T'.
84 2012-06-26 Mark Wielaard <mjw@redhat.com>
86 * readelf.c (dwarf_attr_string): Add DW_AT_GNU_macros.
88 2012-06-22 Mark Wielaard <mjw@redhat.com>
90 * readelf.c (print_ops): Cast printf PRIu/x64 arguments to uint64_t
93 2012-05-09 Roland McGrath <roland@hack.frob.com>
95 * elflint (check_sections): Allow zero sized sections at (filesz) end
96 of segment. And make check overflow-proofed.
98 2012-04-24 Mark Wielaard <mjw@redhat.com>
100 * readelf.c (print_ops): Add DW_OP_GNU_push_tls_address,
101 DW_OP_GNU_uinit and DW_OP_GNU_encoded_addr.
103 2012-03-28 Roland McGrath <roland@hack.frob.com>
105 * elflint.c (special_sections): Accept SHF_INFO_LINK for reloc sections.
107 2012-03-28 Mark Wielaard <mjw@redhat.com>
109 * readelf.c (print_debug_abbrev_section): Check there is Dwarf
111 (print_debug_str_section): Likewise.
113 2012-03-21 Mark Wielaard <mjw@redhat.com>
115 * readelf.c (print_gdb_index_section): Accept version 6.
117 2012-01-31 Mark Wielaard <mjw@redhat.com>
119 * readelf.c (attr_callback): Don't special case DW_FORM_sec_offset.
121 2012-01-21 Ulrich Drepper <drepper@gmail.com>
123 * addr2line.c: Update copyright year.
125 * elfcmp.c: Likewise.
126 * elflint.c: Likewise.
127 * findtextrel.c: Likewise.
130 * objdump.c: Likewise.
131 * ranlib.c: Likewise.
132 * readelf.c: Likewise.
134 * strings.c: Likewise.
136 * unstrip.c: Likewise.
138 * nm.c (argp_children): Define.
139 (argp): Hook up argp_children.
140 (handle_ar): Optimize puts call.
141 (show_symbols_bsd): Use positional parameters to also print color
142 codes. Don't print STT_FILE symbols.
143 * objdump.c (options): Improve help text.
144 (argp_children): Define.
145 (argp): Hook up argp_children.
146 (disasm_info): Add elements for color codes.
147 (disasm_output): Print color codes as well.
148 (show_disasm): Set up disasm_info data for callback.
150 2012-01-20 Roland McGrath <roland@hack.frob.com>
152 * arlib-argp.c (arlib_deterministic_output): Initialize from
154 (help_filter): New function.
157 * ar.c (main): Handle oper_none as usage error.
159 * arlib-argp.c (options, parse_opt): Grok -U as inverse of -D.
161 * ranlib.c (argp): Use arlib_argp_children.
163 * arlib.c (arlib_init): Obey arlib_deterministic_output.
165 * arlib-argp.c: New file.
166 * Makefile.am (libar_a_SOURCES): Add it.
167 * arlib.h (arlib_deterministic_output, arlib_argp_children):
168 Declare new variables.
169 * ar.c (deterministic_output): Variable removed.
170 (do_oper_insert): Use arlib_deterministic_output instead.
171 (options, parse_opt): Don't handle -D here. Add group numbers.
172 (argp): Use arlib_argp_children.
174 2011-12-20 Roland McGrath <roland@hack.frob.com>
176 * readelf.c (print_debug): Initialize DUMMY_DBG.elf.
177 Reported by Karel Klic <kklic@redhat.com>.
179 2011-11-05 Roland McGrath <roland@hack.frob.com>
181 * ar.c (deterministic_output): New flag variable.
182 (options, parse_opt): Grok -D to set it.
183 (do_oper_insert): When set, use zero from mtime, uid, and gid.
185 * ar.c (do_oper_insert): Fix check on elf_rawfile return value.
187 2011-10-04 Marek Polacek <mpolacek@redhat.com>
189 * readelf.c (register_info): Assume the right size of an array.
191 2011-10-03 Ulrich Drepper <drepper@gmail.com>
193 * nm.c: Recognize option --mark-special. Still recognize --mark-weak
194 but don't show it in help anymore.
195 (mark_special): Renamed from mark_weak.
197 (class_type_char): Take additional parameters for ELF file and ELF
198 header. Treat TLS symbols like objects.
199 In case of D symbols, show u for unique symbols, R for symbols in
200 read-only sections, B for symbols in BSS sections.
201 (show_symbols_bsd): Take additional parameters for ELF file and ELF
202 header. Adjust for class_type_char change. Show TLS symbols with
203 @ after them in case --mark-special is selected.
204 (show_symbols_posix): Likewise.
205 (show_symbols): Adjust calls to show_symbols_bsd and
207 (show_symbols_sysv): Avoid printing adress and size for undefined
208 symbols. Don't print initial special entry and section entries.
210 2011-10-02 Ulrich Drepper <drepper@gmail.com>
212 * Makefile.am (demanglelib): Define.
213 (nm_LDADD): Add demanglelib.
214 * nm.c (options): Add -C option.
215 (demangle): Define as global variable.
216 (parse_opt): Recognize -C.
217 (show_symbols_sysv): Handle demangling.
218 (show_symbols_bad): Likewise.
219 (show_symbols_posix): Likewise.
220 (show_symbols): Likewise.
222 2011-07-09 Roland McGrath <roland@hack.frob.com>
224 * readelf.c (options, parse_opt): Grok -W/--wide and ignore it.
226 * ar.c (parse_opt): Grok -u.
228 2011-05-30 Mark Wielaard <mjw@redhat.com>
230 * strip.c (relocate): Make offset check overflow-proof.
232 2011-05-23 Mark Wielaard <mjw@redhat.com>
234 * strip.c (relocate): Take new arguments is_rela to indicate
235 whether the relocation is from a SHT_REL or SHT_RELA section.
236 Relocate against any debug section symbol, not just STT_SECTION
237 symbols. For SHT_REL relocations, fetch addend from offset and
238 add it to symbol value if not zero.
240 2011-05-23 Mark Wielaard <mjw@redhat.com>
242 * strip.c (OPT_RELOC_DEBUG): New option.
243 (argp_option): Add new --reloc-debug-sections option.
244 (main): Check new option.
245 (parse_opt): Likewise.
246 (handle_elf): Remove any relocations between debug sections
247 in ET_REL for the debug file when requested.
249 2011-05-18 Mark Wielaard <mjw@redhat.com>
251 * strip.c (handle_elf): Make sure all sections of a removed group
252 section are removed too. Don't discard SHT_GROUP sections, copy
253 section table before it gets modified. Section group signature
254 symbols don't have to be retained.
256 2011-05-16 Jakub Jelinek <jakub@redhat.com>
258 * readelf.c (print_ops): Handle DW_OP_GNU_const_type,
259 DW_OP_GNU_regval_type, DW_OP_GNU_deref_type, DW_OP_GNU_convert
260 and DW_OP_GNU_reinterpret.
262 2011-05-17 Mark Wielaard <mjw@redhat.com>
264 * readelf.c (dwarf_tag_string): Fixup DW_TAG_GNU_call_site and
265 DW_TAG_GNU_call_site_parameter return strings.
267 2011-05-11 Marek Polacek <mpolacek@redhat.com>
269 * nm.c (show_symbols_sysv): Remove unused if/else, remove
270 unused `prefix' and `fname' parameters.
272 2011-05-07 Marek Polacek <mpolacek@redhat.com>
274 * unstrip.c (compare_sections_nonrel): Mark this function as static.
276 2011-04-26 Mark Wielaard <mjw@redhat.com>
278 * readelf.c (handle_notes_data): Call ebl_object_note_type_name
281 2011-04-14 Mark Wielaard <mjw@redhat.com>
283 * readelf.c (options): Add gdb_index.
284 (section_e): Define section_gdb_index.
285 (parse_opt): Recognize gdb_index debug-dump argument.
286 (print_gdb_index_section): New function.
287 (print_debug): Add gdb_index to debug_sections.
289 2011-03-24 Petr Machata <pmachata@redhat.com>
291 * readelf.c (print_debug_line_section): Emit initial space for all
292 opcode lines. Print offset in front of each opcode.
294 2011-03-22 Marek Polacek <mpolacek@redhat.com>
296 * readelf.c (handle_dynamic): Don't segfault at DT_PLTREL case.
298 2011-03-22 Mark Wielaard <mjw@redhat.com>
300 * readelf.c (dwarf_tag_string): Support DW_TAG_GNU_call_site
301 and DW_TAG_GNU_call_site_parameter.
302 (dwarf_attr_string): Support DW_AT_GNU_call_site_value,
303 DW_AT_GNU_call_site_data_value,
304 DW_AT_GNU_call_site_target,
305 DW_AT_GNU_call_site_target_clobbered,
307 DW_AT_GNU_all_tail_call_sites,
308 DW_AT_GNU_all_call_sites,
309 and DW_AT_GNU_all_source_call_sites.
310 (print_ops): Handle DW_OP_GNU_entry_value.
311 (attr_callback): Handle DW_AT_GNU_call_site_value,
312 DW_AT_GNU_call_site_data_value,
313 DW_AT_GNU_call_site_target,
314 and DW_AT_GNU_call_site_target_clobbered.
316 2011-03-10 Mark Wielaard <mjw@redhat.com>
318 * elflint.c (check_symtab): Use ebl_check_st_other_bits.
320 2011-02-27 Jan Kratochvil <jan.kratochvil@redhat.com>
322 * readelf.c (reset_listptr): Clear TABLE->TABLE.
324 2011-02-25 Mark Wielaard <mjw@redhat.com>
326 * readelf.c (dwarf_attr_string): Add DW_AT_GNU_* handling.
327 (dwarf_form_string): Properly format and return unknown form.
329 2011-02-23 Roland McGrath <roland@redhat.com>
331 * readelf.c (section_name): New function.
332 (print_debug_abbrev_section): Use it instead of constant.
333 (print_debug_aranges_section): Likewise.
334 (print_debug_ranges_section): Likewise.
335 (print_debug_units): Likewise.
336 (print_debug_line_section): Likewise.
337 (print_debug_loc_section): Likewise.
338 (print_debug_macinfo_section): Likewise.
339 (print_debug_pubnames_section): Likewise.
340 (print_debug_str_section): Likewise.
341 (print_debug) [USE_ZLIB]: Match .zdebug_* sections too.
342 (print_debug_abbrev_section): Use decoded d_size, not sh_size.
343 (print_debug_str_section): Likewise.
345 * readelf.c (dwarf_attr_string): Grok DW_AT_GNU_odr_signature.
347 2011-02-11 Roland McGrath <roland@redhat.com>
349 * elfcmp.c (verbose): New variable.
350 (options, parse_opt): Grok -l/--verbose to set it.
351 (main): Under -l, keep going after first difference.
353 * elfcmp.c (ignore_build_id): New variable.
354 (options, parse_opt): Grok --ignore-build-id to set it.
355 (main): For SHT_NOTE sections, compare note details rather than raw
356 bytes. Under --ignore-build-id, don't complain about differing build
357 ID contents if lengths match.
359 2011-02-08 Roland McGrath <roland@redhat.com>
361 * ldscript.y (filename_id_star): Remove unused variable.
363 * unstrip.c (copy_elided_sections): Remove unused variable.
365 * elflint.c (check_dynamic): Remove unused variables.
367 * elflint.c (check_symtab): Warn about missing xndx section only once.
369 * ldgeneric.c (check_for_duplicate2): Remove unused variable.
371 2011-01-06 Roland McGrath <roland@redhat.com>
373 * strip.c (handle_elf): Under --strip-sections, remove all
374 non-allocated sections and never generate .gnu_debuglink.
376 2011-01-04 Roland McGrath <roland@redhat.com>
378 * strip.c (remove_shdrs): New variable.
379 (options, parse_opt): Grok --strip-sections to set it.
380 (handle_elf): When that's set, truncate off .shstrtab and shdrs.
382 2010-11-10 Roland McGrath <roland@redhat.com>
384 * findtextrel.c (process_file): Don't assume order of sections.
385 Reported by Mike Hommey <mh@glandium.org>.
387 2010-07-26 Roland McGrath <roland@redhat.com>
389 * readelf.c (print_ops): Handle DW_OP_GNU_implicit_pointer.
391 2010-08-30 Roland McGrath <roland@redhat.com>
393 Print .debug_loc/.debug_ranges with cognizance of actual DIE uses.
394 * readelf.c (parse_opt): Add section_info to implicit_debug_sections
396 (struct listptr, struct listptr_table): New types.
397 (compare_listptr, reset_listptr, sort_listptr): New functions.
398 (notice_listptr, skip_listptr_hole): New functions.
399 (struct attrcb_args): Add silent member.
400 (attr_callback): Call notice_listptr for loclistptr and rangelistptr.
401 Suppress output if silent, but still call notice_listptr.
402 (print_debug_units): Suppress output if section_info not requested.
403 (print_debug_loc_section): Call sort_listptr, skip_listptr_hole.
404 (print_debug_ranges_section): Likewise.
405 (print_debug): Call reset_listptr on both tables.
407 * readelf.c (print_debug_ranges_section): Print empty list.
408 (print_debug_loc_section): Likewise.
410 * readelf.c (print_debug_loc_section): Check for bogus length
411 before calling print_ops.
412 (print_ops): Check harder for bogus data that would read off end.
414 2010-08-11 Roland McGrath <roland@redhat.com>
416 * readelf.c (for_each_section_argument): Process all sections with
417 matching name, not just the first.
419 2010-07-26 Roland McGrath <roland@redhat.com>
421 * readelf.c (print_ops): Take new argument for CU version.
422 Fix DW_OP_call_ref decoding to depend on it.
423 (print_debug_loc_section): Update caller.
424 (print_cfa_program): Take new argument, pass it down.
425 (print_debug_frame_section): Update caller.
426 (struct attrcb_args): New member version.
427 (print_debug_units): Initialize it.
429 2010-07-02 Roland McGrath <roland@redhat.com>
431 * readelf.c (print_debug_frame_section): Use format_dwarf_addr for
434 2010-06-30 Roland McGrath <roland@redhat.com>
436 * strings.c (main): Use STDIN_FILENO, not STDOUT_FILENO.
437 Ignore st_size for a non-S_ISREG file descriptor.
438 (read_block): Move assert after no-mmap bail-out.
439 (read_block_no_mmap): Fix size calculations for moving buffer remnant.
441 2010-06-22 Roland McGrath <roland@redhat.com>
443 * readelf.c (print_debug_line_section): Fix braino in DW_LNS_set_isa.
445 2010-06-21 Roland McGrath <roland@redhat.com>
447 * readelf.c (dwarf_tag_string): Handle new v4 tags.
448 (dwarf_attr_string): Add new attributes.
449 (dwarf_tag_string): Handle DW_TAG_GNU_*.
451 * readelf.c (print_ops): Use 64-bit types for LEB128 operands.
452 (print_cfa_program): Likewise.
454 2010-06-20 Roland McGrath <roland@redhat.com>
456 * readelf.c (print_debug_units): New function, broken out of ...
457 (print_debug_info_section): ... here. Call it.
458 (print_debug_types_section): New function.
459 (enum section_e): Add section_types alias for section_info.
460 (print_debug): Add types to the sections table.
462 * readelf.c (print_debug_frame_section): Handle version 4 format.
464 * readelf.c (print_debug_line_section): Handle version 4 format.
466 2010-06-14 Roland McGrath <roland@redhat.com>
468 * unstrip.c (copy_elided_sections): Make sure all sections' data have
469 been read in before we write anything out.
471 2010-06-04 Roland McGrath <roland@redhat.com>
473 * unstrip.c (update_shdr): New function.
474 (update_sh_size): Call it instead of gelf_update_shdr.
475 (adjust_relocs, add_new_section_symbols): Likewise.
476 (new_shstrtab, copy_elided_sections): Likewise.
478 * unstrip.c (copy_elided_sections): Bail if stripped file has more
479 sections than unstripped file, rather than getting confused later.
481 2010-06-01 Roland McGrath <roland@redhat.com>
483 * readelf.c (dwarf_form_string): Handle DWARF 4 forms.
484 (attr_callback): Handle DW_FORM_flag_present, DW_FORM_exprloc,
485 DW_FORM_sec_offset, DW_FORM_ref_sig8.
487 * readelf.c (print_debug): Don't bail if libdw setup fails.
488 Suppress complaint if we only want .eh_frame anyway.
490 2010-05-28 Ulrich Drepper <drepper@redhat.com>
492 * readelf.c (attr_callback): Also print form information.
494 2010-05-19 Roland McGrath <roland@redhat.com>
496 * addr2line.c (find_symbol): Short-circuit on empty name.
497 (handle_address): Handle SYMBOL with no +OFFSET.
499 2010-05-08 Roland McGrath <roland@redhat.com>
501 * readelf.c (print_ops): Take new arg OFFSET_SIZE.
502 Use that for DW_OP_call_ref, not ADDRSIZE.
503 (print_cfa_program): Update caller.
504 (struct attrcb_args): Add offset_size field.
505 (attr_callback): Use it for print_ops call.
506 (print_debug_info_section): Initialize it.
507 (print_ops): Likewise.
509 2010-04-14 Roland McGrath <roland@redhat.com>
511 * readelf.c (handle_core_item): Fix bitmask printing.
513 2010-04-06 Roland McGrath <roland@redhat.com>
515 * ld.c (options): Fix some typos in messages.
516 * elflint.c (check_scn_group, check_group): Likewise.
517 * ldscript.y (add_id_list): Likewise.
518 * readelf.c (print_hash_info): Add xgettext:no-c-format magic comment
519 before translated string containing a literal %.
521 2010-02-26 Roland McGrath <roland@redhat.com>
523 * readelf.c (process_file): Don't leak an fd in failure case.
525 2010-02-15 Roland McGrath <roland@redhat.com>
527 * Makefile.am: Use config/eu.am for common stuff.
529 * readelf.c (print_debug_frame_section): Add a cast to avoid sign
530 mismatch in comparison.
532 2010-02-02 Roland McGrath <roland@redhat.com>
534 * readelf.c (print_encoding_base): Handle DW_EH_PE_absptr (zero).
535 (read_encoded): Likewise.
536 (print_debug_frame_section): Check for bogus augmentation length.
537 For P augmentation, use read_encoded, print the encoding description,
538 and use hex for unsigned values.
540 2010-01-15 Roland McGrath <roland@redhat.com>
542 * ar.c: Include <sys/stat.h>.
543 * elflint.c: Likewise.
544 * readelf.c: Likewise.
546 * unstrip.c: Likewise
548 2010-01-07 Roland McGrath <roland@redhat.com>
550 * readelf.c (print_ehdr): Handle PN_XNUM.
551 (phnum): New static variable.
552 (process_elf_file): Set it with elf_getphdrnum.
553 (print_phdr): Use phnum instead of EHDR->e_phnum.
554 (print_dynamic, handle_notes): Likewise.
555 (handle_relocs_rel, handle_relocs_rela): Likewise.
557 * elfcmp.c (main): Use elf_getshdrnum and elf_getphdrnum.
559 * elflint.c (phnum): New static variable.
560 (check_elf_header): Set it, handling PN_XNUM.
561 Use that in place of EHDR->e_phnum throughout.
562 (check_symtab, check_reloc_shdr, check_dynamic): Likewise.
563 (unknown_dependency_p, check_sections, check_program_header): Likewise.
565 2010-01-05 Roland McGrath <roland@redhat.com>
567 * readelf.c (dwarf_attr_string): Match DW_AT_GNU_vector and
568 DW_AT_GNU_template_name.
570 2010-01-04 Roland McGrath <roland@redhat.com>
572 * readelf.c (handle_notes_data): Grab NT_AUXV only for name "CORE".
573 (handle_core_note): Pass NHDR and NAME to ebl_core_note.
574 (handle_core_item): Handle .format of '\n' as \n-separated strings.
576 * readelf.c (implicit_debug_sections): New variable.
577 (parse_opt): Set it instead of print_debug_sections for -a.
578 OR them together for print_debug check.
579 (print_debug): OR them together for section check.
581 * readelf.c (options): Repartition into set implied by -a and others.
582 Correct -a text to match reality.
584 * readelf.c (struct section_argument): Add bool member 'implicit'.
585 (parse_opt): Set it for -a cases, clear it for -x args.
586 (for_each_section_argument): Don't complain about a missing section by
587 name if it's implicit.
589 2009-11-16 Roland McGrath <roland@redhat.com>
591 * readelf.c (print_string_section): Punt SHT_NOBITS like empty
592 sections, just as dump_data_section already does.
594 2009-09-21 Ulrich Drepper <drepper@redhat.com>
596 * elflint.c (special_sections): Allow MERGE and STRINGS flags to be
597 set for .comment section.
598 Patch by Mark Wielaard <mjw@redhat.com>.
600 2009-09-08 Roland McGrath <roland@redhat.com>
602 * ar.c (main): Fix typo in message format.
604 2009-08-21 Roland McGrath <roland@redhat.com>
606 * readelf.c (attr_callback): Use print_block only when we don't use
609 2009-08-14 Roland McGrath <roland@redhat.com>
611 * ar.c (do_oper_extract): Use pathconf instead of statfs.
613 2009-08-01 Ulrich Drepper <drepper@redhat.com>
615 * debugpred.h: Add two most const.
617 2009-07-26 Mark Wielaard <mjw@redhat.com>
619 * elflint.c (check_note_data): Recognize NT_GNU_GOLD_VERSION.
621 2009-07-25 Mark Wielaard <mjw@redhat.com>
623 * Makefile.am (addr2line_LDADD): Add $(libelf).
625 2009-07-24 Roland McGrath <roland@redhat.com>
627 * readelf.c (print_block): New function.
629 (attr_callback): Use it for DW_FORM_block* forms.
631 2009-07-20 Mark Wielaard <mjw@redhat.com>
633 * readelf.c (print_ops): Add handling of DW_OP_implicit_value
634 and DW_OP_stack_value.
636 2009-07-14 Ulrich Drepper <drepper@redhat.com>
638 * elflint.c (check_elf_header): Allow Linux ABI.
639 (check_symtab): Handle STB_GNU_UNIQUE.
641 2009-07-08 Mark Wielaard <mjw@redhat.com>
643 * readelf.c (attr_callback): Handle DW_Form constants for
644 DW_AT_data_member_location.
646 2009-07-06 Roland McGrath <roland@redhat.com>
648 * readelf.c (register_info): New function. Handle unknown register #s.
649 (print_cfa_program): Use it.
650 (handle_core_register, handle_core_registers): Likewise.
652 2009-06-28 Roland McGrath <roland@redhat.com>
654 * readelf.c (print_address_names): New static variable.
655 (options, parse_opt): Grok -N/--numeric-addresses to clear it.
656 (format_dwarf_addr): Don't look up name if !print_address_names.
658 2009-06-13 Ulrich Drepper <drepper@redhat.com>
660 * ldgeneric.c: Don't use deprecated libelf functions.
662 * objdump.c: Likewise.
663 * readelf.c: Likewise.
666 * unstrip.c: Likewise.
667 * ld.h: Fix up comment.
669 2009-06-01 Ulrich Drepper <drepper@redhat.com>
671 * readelf.c (print_relocs): Expect ELF header argument and pass on
672 to handle_relocs_rel* functions. Adjust caller.
673 (handle_relocs_rel): Add ELF header argument. Add special case for
674 the IRELATIVE relocations in statically linked executables.
675 (handle_relocs_rela): Likewise.
677 2009-04-29 Ulrich Drepper <drepper@redhat.com>
679 * elflint.c (check_symtab): Add tests of st_other field.
681 2009-04-23 Ulrich Drepper <drepper@redhat.com>
683 * Makefile [BUILD_STATIC] (libdw): Add $(zip_LIBS).
685 2009-04-20 Roland McGrath <roland@redhat.com>
687 * addr2line.c (print_dwarf_function): Honor -s and -A for file names
688 of inline call sites.
690 * addr2line.c (just_section): New variable.
691 (adjust_to_section): New function, broken out of ...
692 (handle_address): ... here.
693 (options, parse_opt): Add -j/--section=NAME to set it.
695 2009-04-15 Roland McGrath <roland@redhat.com>
697 * readelf.c (print_debug_frame_section): Check for DW_CIE_ID_64 in
698 64-bit format header, DW_CIE_ID_32 in 32-bit format header.
700 2009-04-14 Roland McGrath <roland@redhat.com>
702 * readelf.c (print_attributes): Treat SHT_ARM_ATTRIBUTES on EM_ARM
703 like SHT_GNU_ATTRIBUTES.
705 * readelf.c (handle_core_registers): Fix error message.
707 * strip.c (handle_elf: check_preserved): Don't note any change when
708 .debug_data is already filled from a previous pass.
710 2009-02-05 Ulrich Drepper <drepper@redhat.com>
712 * objdump.c (show_relocs_x): Minor cleanups.
714 * readelf.c (print_cfa_program): Correct a few labels.
715 Print first DW_CFA_expression and DW_CFA_val_expression parameter
718 2009-02-01 Ulrich Drepper <drepper@redhat.com>
720 * objdump.c (show_relocs_rel, show_relocs_rela): Split common parts
722 (show_relocs_x): ...here. New function.
723 (show_relocs): Better spacing in output.
725 * objdump.c (show_relocs_rela): Show offsets as signed values.
727 * ar.c (main): Fix recognition of invalid modes for a, b, i modifiers.
728 Improve some error messages.
729 Use program_invocation_short_name instead of AR macro.
730 * Makefile.am (CFLAGS_ar): Remove.
731 * elflint.c (parse_opt): ARGP_HELP_EXIT_ERR does nothing for argp_help.
732 * objdump.c (parse_opt): Likewise.
733 * readelf.c (parse_opt): Likewise.
735 2009-01-27 Roland McGrath <roland@redhat.com>
737 * readelf.c (print_ops): Notice short length, don't overrun buffer
738 (still need to fix LEB128).
740 * readelf.c (print_ops): Fix DW_OP_call[24] decoding.
742 * readelf.c (print_ops): Print (empty)\n when LEN == 0.
744 2009-01-24 Ulrich Drepper <drepper@redhat.com>
746 * readelf.c (print_debug_frame_section): Fix computation of vma_base
747 for PC-relative mode.
749 2009-01-23 Ulrich Drepper <drepper@redhat.com>
751 * size.c (process_file): When handling archive, close file descriptor
752 here. For unknown file format also close file descriptor.
753 (handle_ar): Don't close file descriptor here.
755 * readelf.c (parse_opt): Move code to add to dump_data_sections and
756 string_sections list in local function add_dump_section. Adjust 'x'
757 key handling. For 'a' key add .strtab, .dynstr, and .comment section
758 to string_sections list.
760 2009-01-22 Roland McGrath <roland@redhat.com>
762 * readelf.c (print_phdr): Don't print section mapping when no sections.
764 * Makefile.am (AM_CFLAGS): Pass -Wno-format for *_no_Wformat.
766 * readelf.c (print_debug_frame_section): Initialize IS_SIGNED to false
767 and reset it only for the 'true' cases.
769 * Makefile.am (addr2line_no_Wformat): New variable.
771 * readelf.c (print_debug_frame_section): Use t instead of j formats
772 for ptrdiff_t OFFSET.
774 2009-01-21 Ulrich Drepper <drepper@redhat.com>
776 * elflint.c (check_program_header): Fix typo in .eh_frame_hdr section
777 test. Handle debuginfo files.
778 (check_exception_data): First sanity test.
780 2009-01-17 Ulrich Drepper <drepper@redhat.com>
782 * readelf.c (print_debug_exception_table): Show target of ar_disp
785 * elflint.c (check_program_header): Add most consistency checks for
786 PT_GNU_EH_FRAME entry.
788 * addr2line.c: Use ARGP_PROGRAM_VERSION_HOOK_DEF and
789 ARGP_PROGRAM_BUG_ADDRESS_DEF.
791 * elfcmp.c: Likewise.
792 * elflint.c: Likewise.
793 * findtextrel.c: Likewise.
796 * objdump.c: Likewise.
797 * ranlib.c: Likewise.
798 * readelf.c: Likewise.
801 * strings.c: Likewise.
803 * unstrip.c: Likewise.
805 2009-01-16 Ulrich Drepper <drepper@redhat.com>
807 * elflint.c (check_program_header): Check that PT_GNU_EH_FRAME entry
808 matches .eh_frame_hdr section, if it is available. Also check that
809 the segment is allocated, not writable, not executable.
811 * readelf.c: Add -e option. Dump exception and unwind related
812 sections. Add -e to -a.
813 (print_encoding_base): Handle DW_EH_PE_omit.
814 (print_debug_exception_table): Beginning of support.
815 (print_debug): Hook up print_debug_exception_table for
816 .gcc_except_table sections.
818 * readelf.c (print_debug_frame_section): Some fixes for last change.
820 2009-01-15 Ulrich Drepper <drepper@redhat.com>
822 * readelf.c (print_encoding): Now a toplevel function.
823 (print_relinfo): Likewise.
824 (print_encoding_base): Broken out of print_debug_frame_section.
825 (print_debug_frame_section): Print different header for .eh_frame
826 sections. Fix recognition of matching CIEs in .debug_frame sections.
827 Print absolute offset for PC-relative FDE locations. Don't print
828 table header for FDEs if the table is empty.
829 (read_encoded): New function.
830 (print_debug_frame_hdr_section): New function.
831 (print_debug): Hook up print_debug_frame_hdr_section for .eh_frame_hdr
834 * readelf.c (handle_relocs_rel): Print section number.
835 (print_debug_abbrev_section): Likewise.
836 (print_debug_aranges_section): Likewise.
837 (print_debug_ranges_section): Likewise.
838 (print_debug_info_section): Likewise.
839 (print_debug_line_section): Likewise.
840 (print_debug_loc_section): Likewise.
841 (print_debug_macinfo_section): Likewise.
842 (print_debug_pubnames_section): Likewise.
843 (print_debug_str_section): Likewise.
845 2009-01-10 Ulrich Drepper <drepper@redhat.com>
847 * strings.c (read_block): Fix typo in error message string.
849 2009-01-07 Ulrich Drepper <drepper@redhat.com>
851 * ld.c (ld_new_searchdir): Fix adding to search path list.
853 2009-01-06 Ulrich Drepper <drepper@redhat.com>
855 * readelf.c: Implement call frame debug section dumping.
857 2009-01-05 Roland McGrath <roland@redhat.com>
859 * elfcmp.c: Exit with status 2 for errors (like cmp, diff, grep).
860 Status 1 (aka EXIT_FAILURE) is only for completed OK but not equal.
862 2009-01-01 Ulrich Drepper <drepper@redhat.com>
864 * addr2line.c: Update copyright year.
866 * elfcmp.c: Likewise.
867 * elflint.c: Likewise.
868 * findtextrel.c: Likewise.
871 * objdump.c: Likewise.
872 * ranlib.c: Likewise.
873 * readelf.c: Likewise.
875 * strings.c: Likewise.
877 * unstrip.c: Likewise.
879 2008-12-11 Roland McGrath <roland@redhat.com>
881 * nm.c (sym_name): New function.
882 (show_symbols_sysv): Use it in place of elf_strptr.
883 (show_symbols_bsd, show_symbols_posix): Likewise.
886 * nm.c (show_symbols_sysv): Use an alloca'd backup section name when
889 2008-12-02 Roland McGrath <roland@redhat.com>
891 * readelf.c (count_dwflmod, process_file): Don't presume encoding of
892 nonzero OFFSET argument to dwfl_getmodules.
894 2008-08-07 Roland McGrath <roland@redhat.com>
896 * addr2line.c (main): Pass string to handle_address.
897 (see_one_module): New function, subroutine of handle_address.
898 (find_symbol): Likewise.
899 (handle_address): Take string argument rather than address.
900 Convert plain number, or handle strings like "(section)+offset"
903 2008-08-01 Roland McGrath <roland@redhat.com>
905 * readelf.c (handle_core_item): Handle 'B' type for 1-origin bitset.
906 For 'b' and 'B', print <x-y,z> or ~<x,y-z> rather than 1/0 string.
908 * readelf.c (convert): Take new argument SIZE.
909 (handle_core_register, handle_core_item): Update callers.
910 (handle_core_item): Take new arg REPEATED_SIZE.
911 (handle_core_items): Special case for a singleton item,
912 let handle_core_item handle repeats if it wants to.
914 * readelf.c (handle_core_items): Give abridged output
915 for identical groups repeated more than twice.
917 2008-07-04 Roland McGrath <roland@redhat.com>
919 * readelf.c (handle_core_items): Handle ELF_T_ADDR.
921 2008-04-10 Roland McGrath <roland@redhat.com>
923 * strip.c (handle_elf): Don't keep sections that kept symbol tables
924 refer to. Instead, just be sure to preserve the original symbol
925 table in the debug file so those symbols go with their sections and
926 can be elided from the stripped version of the symbol table.
928 * strip.c (handle_elf): When a discarded section kept in the debug
929 file refers to a nondiscard section via sh_link/sh_info, preserve
930 that nondiscarded section unmodified in the debug file as well.
931 Skip adjustment of discarded sections symbol table references when
932 that symbol table is copied in this way.
934 * elflint.c (check_symtab): Don't crash from missing symbol names
935 after diagnosing bogus strtab.
937 * strip.c (handle_elf): Cosmetic cleanup in special section contents
938 adjustment for symtab changes.
940 2008-03-31 Roland McGrath <roland@redhat.com>
942 * elflint.c (check_sections): Add checks on SHF_EXECINSTR sections:
943 must be SHT_PROGBITS, must not be SHF_WRITE. Let backend hook
944 excuse a special section.
946 2008-03-27 Roland McGrath <roland@redhat.com>
948 * elflint.c (check_sections): Check that executability and writability
949 of sections is reflected in segment p_flags.
951 2008-03-26 Roland McGrath <roland@redhat.com>
953 * elflint.c (check_program_header): Accept PT_GNU_RELRO p_flags
954 that matches its PT_LOAD's p_flags &~ PF_W. On sparc, PF_X really
957 2008-02-29 Roland McGrath <roland@redhat.com>
959 * readelf.c (print_attributes): Add a cast.
960 * elflint.c (check_attributes): Likewise.
962 * unaligned.h (add_8ubyte_unaligned): Cast PTR argument for parity
963 with [UNALIGNED_ACCESS_CLASS == BYTE_ORDER] definition.
964 (add_4ubyte_unaligned, add_2ubyte_unaligned): Likewise.
966 2008-02-03 Ulrich Drepper <drepper@redhat.com>
968 * i386_ld.c (elf_i386_count_relocations): Implement R_386_TLS_GD
969 when linked into executable.
970 (elf_i386_create_relocations): Likewise.
972 2008-02-20 Roland McGrath <roland@redhat.com>
974 * readelf.c (print_attributes): New function.
975 (process_elf_file): Call it under -A.
977 * elflint.c (check_attributes): Implement it for real.
979 2008-02-19 Roland McGrath <roland@redhat.com>
981 * elflint.c (special_sections): Handle .gnu.attributes section.
982 (check_sections): Likewise.
983 (check_attributes): New function.
985 2008-02-10 Roland McGrath <roland@redhat.com>
987 * elfcmp.c (main): Ignore sh_offset differences in non-SHF_ALLOC
988 sections and ET_REL files.
990 2008-02-02 Ulrich Drepper <drepper@redhat.com>
992 * elf32-i386.script: Add .eh_frame_hdr, .tdata, and .tbss sections.
993 * i386_ld.c (elf_i386_count_relocations): Handle R_386_TLS_LDO_32
995 (elf_i386_create_relocations): Likewise.
996 * ld.h (struct ld_state): Add need_tls, tls_start, and tls_tcb
998 * ldgeneric.c (add_section): If TLS section is used, set need_tls flag.
999 (ld_generic_create_outfile): Add PT_TLS entry to program header.
1000 Fix generation of PT_GNU_STACK entry.
1002 2008-02-01 Ulrich Drepper <drepper@redhat.com>
1004 * ld.c (replace_args): Prevent loop over replacements if the parameter
1005 is only two characters long.
1007 * ld.c: Recognize sha1 argument for --build-id parameter.
1008 * ldgeneric.c (create_build_id_section): Handle sha1.
1009 (compute_hash_sum): New function. Broken out of compute_build_id.
1010 Take hash function and context as parameters.
1011 (compute_build_id): Use compute_hash_sum for md5 and the new sha1
1014 2008-01-31 Ulrich Drepper <drepper@redhat.com>
1016 * elf32-i386.script: Add .note.ABI-tag and .note.gnu.build-id sections.
1017 * ld.c: Recognize --build-id command line parameter.
1018 * ld.h: Define scn_dot_note_gnu_build_id.
1019 (struct ld_state): Add build_id and buildidscnidx elements.
1020 * ldgeneric.c: Implement --build-id command line parameter.
1021 * ldlex.l (ID): Recognize - as valid character after the first one.
1023 2008-01-29 Ulrich Drepper <drepper@redhat.com>
1025 * ld.c (replace_args): New function.
1026 (main): Use it to rewrite old-style parameters.
1028 * elf32-i386.script: Add .gnu.hash section.
1029 * ldgeneric.c (optimal_bucket_size): A tiny bit more efficient.
1030 (fillin_special_symbol): Initialize st_size.
1031 (sortfct_hashval): New function.
1032 (create_gnu_hash): New function.
1033 (create_hash): New function.
1034 (ld_generic_create_outfile): Use the new functions to create the
1037 * elflint.c (check_gnu_hash): Fix index value printed in error message.
1039 2008-01-24 Ulrich Drepper <drepper@redhat.com>
1041 * elflint.c (check_group): Check that signature symbol for section
1042 group is not an empty string.
1043 * ldgeneric.c: Remove magic assignment of indeces in the dynsym
1044 section. Start implementation of --hash-style.
1045 * i386_ld.c: Likewise.
1046 * ld.c: Recognize --hash-style.
1047 * ld.h (struct scninfo): Add comdat_group.
1048 Add additional parameter to finalize_plt callback.
1050 2008-01-22 Ulrich Drepper <drepper@redhat.com>
1052 * ld.h (struct callbacks): Add initialize_gotplt.
1053 (struct scnhead): Add scn_dot_gotplt.
1054 (struct ld_state): Add gotpltscnidx.
1055 * i386_ld.c (elf_i386_initialize_plt): Minor optimization.
1056 (elf_i386_initialize_pltrel): Likewise.
1057 (elf_i386_initialize_got): There is now a separate .got.plt, so
1058 don't do the PLT-related work here. Initialize d_type.
1059 (elf_i386_initialize_gotplt): New function.
1060 (elf_i386_plt0): Use ud2a after indirect jump.
1061 (elf_i386_pic_plt0_entry): Likewise.
1062 (elf_i386_finalize_plt): Reference now .got.plt.
1063 (elf_i386_count_relocations): For GOT entries which need no relocation
1064 don't bump nrel_got.
1065 (elf_i386_create_relocations): Also get .got.plt. Rewrite R-386_GOT32
1066 handling for split .got/.got.plt.
1067 (elf_i386_ld_init): Initialize callbacks.initialize_gotplt.
1068 * elf32-i386.script: Sort sections for security. There are no .got
1069 input sections. Add .got.plt.
1070 * ldgeneric.c (ld_generic_generate_sections): Add .got.plt section.
1071 (ld_generic_create_outfile): Initialize .got.plt section.
1072 Use .got.plt address for _GLOBAL_OFFSET_TABLE_ symbol and DT_PLTGOT.
1074 2008-01-19 Ulrich Drepper <drepper@redhat.com>
1076 * i386_ld.c (elf_i386_count_relocations): PLT relocations for undefined
1077 symbols are not carried over into statically linked output files.
1078 Add dummy entries for more TLS relocations.
1080 * ld.c (options): Add long names for -( and -).
1082 * ldgeneric.c (check_definition): For newly found definitions don't
1083 mark section as used if symbol is absolute.
1084 (extract_from_archive): Only assign archive sequence number the first
1085 time the archive is handled. Update ld_state.last_archive_used
1086 if any symbol was used. Remove nround variable.
1087 (file_process2): When using symbol from an archive, update
1088 ld_state.group_start_archive, ld_state.archives, and
1089 ld_state.tailarchives.
1090 (ld_generic_file_process): If group is not handled anymore, after
1091 freeing ELF handles for the archives, clear ld_state.archives and
1092 *nextp. Fix wrong logic in recognizing first iteration of group
1093 loop. When clearing flags, also clear ld_state.group_start_archive.
1095 2008-01-11 Ulrich Drepper <drepper@redhat.com>
1097 * objdump.c (show_disasm): Adjust disassembler format string for
1100 2008-01-04 Roland McGrath <roland@redhat.com>
1102 * readelf.c (handle_core_items): Take new arg DESCSZ; if nonzero,
1103 a size greater than the items cover means multiple sets of items.
1104 (handle_core_note): Update caller.
1106 2008-01-04 Roland McGrath <roland@redhat.com>
1108 * strip.c (handle_elf): Move SHDRIDX defn to silence gcc warning.
1110 2008-01-03 Roland McGrath <roland@redhat.com>
1112 * ld.h (linked_from_dso_p): Use __attribute__ ((__gnu_inline__)).
1114 * elflint.c (check_dynamic): Remove duplicate initializer.
1116 2008-01-02 Ulrich Drepper <drepper@redhat.com>
1118 * addr2line.c: Update copyright year.
1120 * elfcmp.c: Likewise.
1121 * elflint.c: Likewise.
1122 * findtextrel.c: Likewise.
1125 * objdump.c: Likewise.
1126 * ranlib.c: Likewise.
1127 * readelf.c: Likewise.
1129 * strings.c: Likewise.
1130 * strip.c: Likewise.
1131 * unstrip.c: Likewise.
1133 2007-12-30 Ulrich Drepper <drepper@redhat.com>
1135 * objdump (show_disasm): Use %e after third parameter.
1137 2007-12-21 Ulrich Drepper <drepper@redhat.com>
1139 * strip.c: Fix wrong parenthesis in a few branch predictions.
1140 * strings.c: Likewise.
1142 2007-12-20 Ulrich Drepper <drepper@redhat.com>
1144 * Makefile.am (DEFS): Add DEBUGPRED.
1145 * addr2line.c: Include debugpred.h.
1147 * elfcmp.c: Likewise.
1148 * elflint.c: Likewise.
1149 * findtextrel.c: Likewise.
1151 * objdump.c: Likewise.
1152 * ranlib.c: Likewise.
1153 * readelf.c: Likewise.
1155 * strings.c: Likewise.
1156 * strip.c: Likewise.
1157 * unstrip.c: Likewise.
1158 * debugpred.h: New file.
1160 * readelf.c (handle_relocs_rel): Use elf_scnshndx.
1161 (handle_relocs_rela): Likewise.
1163 * readelf.c: Add lots of likely/unlikely.
1165 * elflint.c: Minor cleanups.
1167 2007-11-19 Roland McGrath <roland@redhat.com>
1169 * readelf.c (print_ops): Handle all bad op codes gracefully.
1170 Print their numbers instead of just ???.
1172 2007-11-09 Roland McGrath <roland@redhat.com>
1174 * readelf.c (attr_callback): Handle DW_AT_data_location.
1175 Handle block forms to mean a DWARF expression for DW_AT_allocated,
1176 DW_AT_associated, DW_AT_bit_size, DW_AT_bit_offset, DW_AT_bit_stride,
1177 DW_AT_byte_size, DW_AT_byte_stride, DW_AT_count, DW_AT_lower_bound,
1180 2007-10-20 Roland McGrath <roland@redhat.com>
1182 * unstrip.c (options): Update -R description.
1183 (struct symbol): Put symbol details a union with a size_t pointer
1185 (compare_symbols_output): Use null ->name as marker for discard
1186 symbols, not zero *->map.
1187 (copy_elided_sections): Record forwarding pointers for discarded
1188 duplicates and fill SYMNDX_MAP elements through them.
1190 * readelf.c (process_file): Set offline_next_address to 0 at start.
1191 (struct process_dwflmod_args): New type.
1192 (process_dwflmod): Take args in it, pass fd to process_elf_file.
1193 (process_file): Update caller; dup FD for passing to libdwfl.
1194 (process_elf_file): Take new arg FD. For ET_REL file when
1195 displaying data affected by libdwfl relocation, open a new Elf handle.
1197 2007-10-17 Roland McGrath <roland@redhat.com>
1199 * readelf.c (print_debug_line_section): For invalid data inside a
1200 unit with plausible length, keep printing at the next unit boundary.
1202 * readelf.c (attr_callback): Use dwarf_formref_die, not dwarf_formref.
1204 2007-10-16 Roland McGrath <roland@redhat.com>
1206 * readelf.c (hex_dump): Fix rounding error in whitespace calculation.
1208 2007-10-15 Roland McGrath <roland@redhat.com>
1210 * make-debug-archive.in: New file.
1211 * Makefile.am (EXTRA_DIST): Add it.
1212 (make-debug-archive): New target.
1213 (bin_SCRIPTS, CLEANFILES): Add it.
1215 2007-10-10 Roland McGrath <roland@redhat.com>
1217 * elflint.c (special_sections): Add new attrflag value exact_or_gnuld.
1218 Use it to check MERGE|STRINGS for .debug_str.
1219 (check_sections): Handle exact_or_gnuld.
1221 2007-10-08 Roland McGrath <roland@redhat.com>
1223 * readelf.c (handle_core_item): Handle 'T'|0x80 to indicate
1224 64-bit struct timeval with 32-bit tv_usec.
1226 2007-10-07 Roland McGrath <roland@redhat.com>
1228 * readelf.c (check_archive_index): New function.
1229 (process_file): Call it. Change signature to take only fd and name.
1230 Use libdwfl to open the file, then iterate on its modules (multiple
1231 for an archive) to print file name and call process_elf_file.
1232 (main): Update caller. Let process_file do elf_begin.
1233 (count_dwflmod, process_dwflmod, find_no_debuginfo): New functions.
1234 (process_elf_file): Take only Dwfl_Module * argument.
1235 Don't print the file name here.
1236 (print_debug_*_section): Take Dwfl_Module * argument.
1237 (print_debug): Likewise. Update caller.
1238 (format_dwarf_addr): New function.
1239 (print_debug_ranges_section): Use it.
1240 (attr_callback): Likewise.
1241 (print_debug_line_section, print_debug_loc_section): Likewise.
1243 * readelf.c (print_debug_ranges_section): Translate all strings.
1244 (print_debug_loc_section): Likewise.
1246 * unstrip.c (copy_elided_sections): Initialize SEC.
1248 * ar.c (do_oper_insert): Put trailing / on short names.
1250 * arlib.h (MAX_AR_NAME_LEN): Decrease by one.
1252 * arlib2.c (arlib_add_long_name): Adjust for header size.
1254 * arlib.c (arlib_finalize): Pad long name table to keep size even.
1256 * ar.c (do_oper_insert): Use write_retry for padding write.
1258 * ar.c (do_oper_insert): Initialize CUR_OFF in no_old case.
1259 Unconditionally set FOUND[CNT]->elf when setting ->mem.
1260 (remember_long_name): New function.
1261 (do_oper_insert): Call it. Correctly use length of basename,
1262 not original name. Don't store long name twice for new member.
1264 2007-10-06 Roland McGrath <roland@redhat.com>
1266 * elflint.c (check_note): Skip empty segment.
1267 (check_note_section): Skip empty section.
1269 * unstrip.c (options, parse_opt, struct arg_info): Grok -R/--relocate.
1270 (handle_output_dir_module, handle_implicit_modules): Pass it down.
1271 (handle_dwfl_module): When set, use ET_REL already loaded by Dwfl.
1272 (compare_alloc_sections): Take new arg REL, ignore address if true.
1273 (compare_sections): Likewise, pass it down.
1274 (compare_sections_rel, compare_sections_nonrel): New functions.
1275 (find_alloc_sections_prelink, copy_elided_sections): Use them
1276 instead of compare_sections.
1277 (sections_match): New function, broken out of ...
1278 (find_alloc_section): ... here.
1279 (copy_elided_sections): Reorganize section match-up logic.
1280 Use sections_match for SHF_ALLOC in ET_REL.
1281 For ET_REL, let the nonzero sh_addr from the debug file dominate.
1283 * unstrip.c (add_new_section_symbols): Take new arg REL.
1284 When true, do not update section symbol values.
1285 (collect_symbols): Likewise. Update section symbols with address
1286 of chosen output section, not original section.
1287 (check_symtab_section_symbols, copy_elided_sections): Update callers.
1289 * unstrip.c (compare_alloc_sections): At the same address, preserve
1290 original section order.
1292 * elflint.c (special_sections): Don't require MERGE|STRINGS for
1293 .debug_str, it didn't always have them with older tools.
1295 * elflint.c (check_symtab, check_one_reloc): Ignore sh_addr in ET_REL.
1297 2007-10-05 Roland McGrath <roland@redhat.com>
1299 * elflint.c (check_symtab): Allow SHN_UNDEF _GLOBAL_OFFSET_TABLE_ in
1302 * elflint.c (check_symtab): For _GLOBAL_OFFSET_TABLE_, diagnose
1303 SHN_UNDEF as "bad section". Use shndx value in messages.
1305 * elflint.c (special_sections): Add ".debug_str". Decrement namelen
1306 for ".debug" so it matches as a prefix.
1307 (IS_KNOWN_SPECIAL): New macro.
1308 (check_sections): Use it for ".plt" match. Cite wrong SHT_NOBITS
1309 type even under -d, for a .debug* or .shstrtab section.
1311 * readelf.c (print_ops): Use hex for address operand.
1313 2007-10-04 Roland McGrath <roland@redhat.com>
1315 * unstrip.c (copy_elided_sections): Initialize NDX_SECTION element for
1316 .gnu_debuglink section to SHN_UNDEF. Drop STT_SECTION symbols for
1317 sections mapped to SHN_UNDEF.
1319 2007-10-04 Ulrich Drepper <drepper@redhat.com>
1321 * readelf.c (dump_archive_index): Avoid warning about uninitialized
1322 variable with older glibc versions.
1323 Add some branch prediction.
1325 2007-10-04 Roland McGrath <roland@redhat.com>
1327 * readelf.c (print_archive_index): New variable.
1328 (options, parse_opt): Accept -c/--archive-index to set it.
1329 (dump_archive_index): New function.
1330 (process_file): Take new arg WILL_PRINT_ARCHIVE_INDEX.
1331 Call dump_archive_index on archives if set.
1332 (main): Update caller.
1333 (any_control_option): Give it file scope, moved out of ...
1334 (parse_opt): ... here.
1336 2007-10-03 Roland McGrath <roland@redhat.com>
1338 * unstrip.c (struct arg_info): Add `list' flag.
1339 (options, parse_opt): Grok -n/--list to set it.
1340 (list_module): New function.
1341 (handle_implicit_modules): Call it under -n.
1343 * elflint.c (check_note_section): New function.
1344 (check_sections): Call it for SHT_NOTE.
1346 * readelf.c (handle_notes): Use sections when available.
1348 * elflint.c (check_note_data): New function, broken out of ...
1349 (check_note): ... here. Call it and elf_getdata_rawchunk.
1351 * readelf.c (handle_auxv_note): Take offset as argument, not buffer.
1352 Use elf_getdata_rawchunk and gelf_getauxv.
1353 (handle_notes_data): New function, broken out of ...
1354 (handle_notes): ... here. Call it and elf_getdata_rawchunk.
1356 2007-10-01 Roland McGrath <roland@redhat.com>
1358 * readelf.c (hex_dump): Fix transposed subtraction generating spaces.
1360 * readelf.c (hex_dump): Fix line header to be hex instead of decimal.
1362 2007-09-10 Roland McGrath <roland@redhat.com>
1364 * readelf.c (options): Give -p optional argument, alias --string-dump.
1365 (string_sections, string_sections_tail): New static variables.
1366 (parse_opt): Set them when -p has an argument.
1367 (print_string_section): New function, broken out of ...
1368 (print_strings): ... here. Call it.
1369 (dump_data_section): New function, broken out of ...
1370 (dump_data): ... here. Call it.
1371 (for_each_section_argument): New function, broken out of ...
1372 (dump_data): ... here. Call it.
1373 (dump_strings): New function.
1375 2007-08-31 Roland McGrath <roland@redhat.com>
1377 * readelf.c (print_strings): Typo fix.
1379 2007-08-23 Roland McGrath <roland@redhat.com>
1381 * readelf.c (printf_with_wrap): Function removed.
1382 (REGISTER_WRAP_COLUMN): New macro.
1383 (handle_core_register): Use print_core_item instead.
1384 (struct register_info): New type.
1385 (compare_registers, compare_register_sets): New functions.
1386 (register_bitpos, compare_sets_by_info): New functions.
1387 (handle_core_registers): Use those to segregate and sort registers
1390 * readelf.c (ITEM_WRAP_COLUMN): New macro.
1391 (print_core_item): New function.
1392 (handle_core_item): Use it instead of printf_with_wrap.
1393 (compare_core_items, compare_core_item_groups): New functions.
1394 (handle_core_items): Use them. Sort by group and force line breaks
1397 * readelf.c (handle_core_registers, handle_core_items): New functions,
1399 (handle_core_note): ... here. Call them.
1401 2007-08-22 Roland McGrath <roland@redhat.com>
1403 * unstrip.c (new_shstrtab): New function, broken out of ...
1404 (copy_elided_sections): ... here.
1406 2007-08-20 Roland McGrath <roland@redhat.com>
1408 Avoid local function trampolines in nm binary.
1409 * nm.c (sort_by_address): Move to a static function instead of local
1410 inside show_symbols.
1411 (sort_by_name_strtab): New static variable.
1412 (sort_by_name): Use it. Move to a static function instead of local
1413 inside show_symbols.
1414 (show_symbols): Set sort_by_name_strtab.
1416 2007-08-19 Roland McGrath <roland@redhat.com>
1418 * readelf.c (handle_auxv_note): New function.
1419 (handle_notes): Call it.
1421 * readelf.c (printf_with_wrap, convert): New functions.
1422 (handle_core_item, (handle_core_register): New functions.
1423 (handle_notes): Call those with details from ebl_core_note.
1425 2007-08-12 Roland McGrath <roland@redhat.com>
1427 * elflint.c (check_note): Accept type 0 with name "Linux".
1429 * elflint.c (special_sections): Accept SHF_ALLOC for ".note".
1431 * elflint.c (section_flags_string): Return "none" for 0, not "".
1433 2007-08-11 Roland McGrath <roland@redhat.com>
1435 * elflint.c (check_note): Accept NT_GNU_HWCAP, NT_GNU_BUILD_ID.
1437 2007-08-04 Ulrich Drepper <drepper@redhat.com>
1439 * readelf.c (hex_dump): Use isprint to determine whether to print
1440 character itself or full stop character.
1441 (dump_data): No need to check endp for NULL after strtol call.
1443 2007-08-03 Roland McGrath <roland@redhat.com>
1445 * readelf.c (print_string_sections): New variable.
1446 (options, parse_opt): Handle --strings/-p to set it.
1447 (print_strings): New function.
1448 (process_elf_file): Call it under -p.
1450 * readelf.c (options): Add hidden aliases --segments, --sections,
1451 as taken by binutils readelf.
1453 2007-08-01 Roland McGrath <roland@redhat.com>
1455 * readelf.c (dump_data_sections, dump_data_sections_tail):
1457 (options, parse_opt): Handle --hex-dump/-x, set them.
1458 (hex_dump): New function.
1459 (dump_data): New function, call it.
1460 (process_elf_file): Call it.
1462 2007-07-25 Roland McGrath <roland@redhat.com>
1464 * addr2line.c (show_symbols): New variable.
1465 (print_addrsym): New function.
1466 (handle_address): Call it.
1467 (options, parse_opt): Handle -S/--symbols.
1469 2007-06-05 Ulrich Drepper <drepper@redhat.com>
1471 * addr2line.c: Update for latest autoconf header.
1473 * elfcmp.c: Likewise.
1474 * elflint.c: Likewise.
1475 * findtextrel.c: Likewise.
1477 * ldgeneric.c: Likewise.
1479 * objdump.c: Likewise.
1480 * ranlib.c: Likewise.
1481 * readelf.c: Likewise.
1483 * strings.c: Likewise.
1484 * strip.c: Likewise.
1485 * unstrip.c: Likewise.
1487 2007-05-18 Roland McGrath <roland@redhat.com>
1489 * unstrip.c (copy_elided_sections): Match up non-NOBITS sections with
1490 stripped file, so as not to duplicate a section copied in both.
1492 * strip.c (handle_elf): Keep SHT_NOTE section copies in the debug file.
1494 2007-05-17 Roland McGrath <roland@redhat.com>
1496 * unstrip.c (copy_elided_sections): Don't call gelf_newphdr for 0.
1498 * unstrip.c (handle_file): Tweak BIAS != 0 warning.
1500 * unstrip.c (handle_file): Take new arg CREATE_DIRS. If set,
1501 call make_directories here.
1502 (handle_explicit_files): Take new arg CREATE_DIRS, pass it down.
1503 (handle_dwfl_module): Likewise.
1504 (handle_implicit_modules): Update callers.
1505 (handle_output_dir_module): Likewise. Don't do make_directories here.
1507 * unstrip.c (get_section_name): New function, broken out of ...
1508 (copy_elided_sections): here. Update callers.
1509 (find_alloc_section): Broken out of ...
1510 (copy_elided_sections): ... here. Update caller.
1511 (symtab_count_leading_section_symbols): Take new arg NEWSYMDATA,
1512 update STT_SECTION symbols' st_value fields as a side effect.
1513 (check_symtab_section_symbols): Update caller.
1514 (add_new_section_symbols): Set st_value in symbols added.
1515 (collect_symbols): Reset S->value for STT_SECTION symbols recorded.
1516 Take new arg SPLIT_BSS. Adjust S->shndx recorded for symbols moved
1517 from .bss to .dynbss.
1518 (find_alloc_sections_prelink): New function. Associate debug file
1519 allocated SHT_NOBITS shdrs with stripped moved by prelink via
1520 .gnu.prelink_undo information.
1521 (copy_elided_sections): Call it when we couldn't find every allocated
1522 section. Don't use a debug file non-NOBITS section if SHF_ALLOC.
1523 Take STRIPPED_EHDR arg instead of E_TYPE and PHNUM.
1524 (handle_file): Update callers.
1526 * unstrip.c (copy_elided_sections): Ignore unfound unallocated section
1529 * elflint.c (check_sections): Fix association of segments with
1530 sections when p_memsz > p_filesz.
1532 2007-04-29 Roland McGrath <roland@redhat.com>
1534 * addr2line.c (options, main): Tweak argp group settings to fix
1537 2007-04-28 Roland McGrath <roland@redhat.com>
1539 * strip.c (handle_elf): Update debug file's SHT_NOBITS sections'
1540 sizes to match sections adjusted in the stripped file.
1542 2007-04-24 Roland McGrath <roland@redhat.com>
1544 * elfcmp.c (OPT_HASH_INEXACT): New macro.
1545 (hash_inexact): New variable.
1546 (options, parse_opt): Add --hash-inexact option to set it.
1547 (hash_content_equivalent): New function.
1548 (main): Call it for differing SHT_HASH sections under --hash-inexact.
1550 2007-04-23 Roland McGrath <roland@redhat.com>
1552 * unstrip.c: New file.
1553 * Makefile.am (bin_PROGRAMS): Add it.
1554 (unstrip_LDADD): New variable.
1556 * strip.c (options): Allow --output for -o.
1558 2007-02-15 Ulrich Drepper <drepper@redhat.com>
1560 * readelf.c: Remove unused code. Add a few consts.
1562 2007-02-15 Roland McGrath <roland@redhat.com>
1564 * readelf.c (print_debug): Fix brainos in SHDR test.
1566 2007-02-05 Roland McGrath <roland@redhat.com>
1568 * ar.c: Include <limits.h>, since we use LONG_MAX.
1570 2007-02-05 Ulrich Drepper <drepper@redhat.com>
1572 * ar.c: Add ugly hack to work around gcc complaining that we
1573 ignore fchown's return value.
1574 (do_oper_insert): Handle error when writing padding.
1575 * ranlib.c: Add fchown complain work around.
1577 * arlib.c: Make symtab a global variable. Change all users.
1578 * arlib2.c: Likewise.
1579 * ranlib.c: Likewise.
1581 * arlib.h: Declare it.
1583 2007-01-11 Roland McGrath <roland@redhat.com>
1585 * elflint.c (check_sections): Use ebl_machine_section_flag_check on
1586 SHF_MASKPROC bits separately from generic sh_flags validation.
1588 2007-02-04 Ulrich Drepper <drepper@redhat.com>
1591 * arlib.c: New file.
1592 * arlib2.c: New file.
1593 * arlib.h: New file.
1594 * Makefile (noinst_LIBRARIES): Add libar.
1595 (libar_a_SOURCES): Define.
1597 (CFLAGS_ar): Define.
1598 * ranlib.c: Change to use arlib.
1600 * elflint.c (check_symtab): Work around GNU ld bug which omits
1601 sections but not symbols in those sections.
1603 2007-01-10 Ulrich Drepper <drepper@redhat.com>
1605 * addr2line.c: Update copyright year.
1606 * elfcmp.c: Likewise.
1607 * elflint.c: Likewise.
1608 * findtextrel.c: Likewise.
1611 * objdump.c: Likewise.
1612 * ranlib.c: Likewise.
1613 * readelf.c: Likewise.
1615 * strings.c: Likewise.
1616 * strip.c: Likewise.
1618 2006-12-09 Ulrich Drepper <drepper@redhat.com>
1620 * elflint.c (compare_hash_gnu_hash): New function. Report if the
1621 two hash tables have different content (module expected omission
1622 of undefined symbols).
1624 2006-10-31 Roland McGrath <roland@redhat.com>
1626 * elflint.c (check_program_header): Don't complain about
1627 p_filesz > p_memsz if p_memsz is zero and p_type is PT_NOTE.
1629 2006-09-19 Jakub Jelinek <jakub@redhat.com>
1631 * strip.c (process_file): Disallow -f on archives.
1633 2006-10-09 Roland McGrath <roland@redhat.com>
1635 * Makefile.am (libld_elf_i386.so): Use $(LINK), not $(CC).
1637 2006-08-29 Roland McGrath <roland@redhat.com>
1639 * Makefile.am (MAINTAINERCLEANFILES): New variable.
1641 * readelf.c (handle_relocs_rel): Typo fix, test DESTSHDR properly.
1642 Reported by Christian Aichinger <Greek0@gmx.net>.
1644 * elflint.c (valid_e_machine): Add EM_ALPHA.
1645 Reported by Christian Aichinger <Greek0@gmx.net>.
1647 2006-08-08 Ulrich Drepper <drepper@redhat.com>
1649 * elflint.c (check_dynamic): Don't require DT_HASH for DT_SYMTAB.
1650 Keep track of which "high DT" entries are present.
1651 Check that either old or GNU-style hash table is present.
1652 If GNU-style hash table is used a symbol table is mandatory.
1653 Check that if any prelink entry is present all of them are.
1654 (check_gnu_hash): Only fail for undefined symbols in GNU-style hash
1655 table if they don't refer to functions.
1657 2006-07-17 Roland McGrath <roland@redhat.com>
1659 * elflint.c (struct version_namelist): Use GElf_Versym for `ndx' field.
1660 (add_version): Likewise for argument.
1661 (check_versym): Cast constant to GElf_Versym for comparison.
1663 2006-07-12 Roland McGrath <roland@redhat.com>
1665 * readelf.c (handle_gnu_hash): Add casts for machines where
1666 Elf32_Word != unsigned int.
1668 2006-07-12 Ulrich Drepper <drepper@redhat.com>
1670 * elflint.c (check_sysv_hash64): Fix printf format.
1672 2006-07-11 Roland McGrath <roland@redhat.com>
1674 * addr2line.c (options): English fix in -f doc string.
1676 * addr2line.c (use_comp_dir): New variable.
1677 (options, parse_opt): Grok -A/--absolute to set it.
1678 (handle_address): If set, prepend dwfl_line_comp_dir results to
1679 relative file names.
1681 2006-07-06 Ulrich Drepper <drepper@redhat.com>
1683 * elflint.c: Adjust for latest new hash table format.
1684 * readelf.c: Likewise.
1686 * elflint.c (check_versym): Ignore hidden bit when comparing version
1689 2006-07-05 Ulrich Drepper <drepper@redhat.com>
1691 * ldgeneric.c (ld_generic_create_outfile): Correctly recognize
1692 discarded COMDAT symbols.
1694 * i386_ld.c (elf_i386_count_relocations): Lot of corrections.
1695 (elf_i386_create_relocations): Likewise.
1696 * ld.h (struct symbol): Add local and hidden bits.
1697 * ld.c (create_special_section_symbol): These synthsized symbols
1698 are local and hidden.
1699 * ldgeneric.c (file_process2): Check whether input file matches
1701 (fillin_special_symbol): Create symbols as local and/or hidden
1703 (ld_generic_create_outfile): Make local copy of symbol.
1704 Don't hide global, defined symbols in dynamic symbol table unless
1705 requested. Synthetic symbols have no version information.
1707 * elflint.c: Add support for checking 64-bit SysV-style hash tables.
1708 * readelf.c: Add support for printing 64-bit SysV-style hash tables.
1710 2006-07-04 Ulrich Drepper <drepper@redhat.com>
1712 * elflint.c (is_rel_dyn): Fix and extend DT_RELCOUNT/DT_RELACOUNT
1715 2006-07-03 Ulrich Drepper <drepper@redhat.com>
1717 * elflint.c: Add testing of DT_GNU_HASH.
1718 * readelf.c: Implement showing histogram for DT_GNU_HASH section.
1720 * Makefile.am: Add hacks to create dependency files for non-generic
1723 2006-06-12 Ulrich Drepper <drepper@redhat.com>
1725 * ldgeneric.c (ld_generic_generate_sections): Don't create .interp
1726 section if creating a DSO and no interpreter is given.
1727 (ld_generic_create_outfile): Don't store reference to symbols in
1728 discarded COMDAT groups. Don't create PHDR and INTERP program header
1729 for DSO if no interpreter is specified.
1730 (create_verneed_data): Pretty printing.
1732 * ldscript.y (content): If a DSO is created don't set default
1733 interpreter from linker script.
1735 * i386_ld.c (elf_i386_count_relocations): Do not add relocations
1736 for symbols in discarded COMDAT groups.
1737 (elf_i386_create_relocations): Likewise.
1738 * ld.h (struct scninfo): Add unused_comdat.
1739 * ldgeneric.c (add_section): Also check group signature when
1740 matching COMDAT sections.
1741 (add_relocatable_file): Ignore symbols in COMDAT group which are
1744 * elflint.c (check_one_reloc): For *_NONE relocs only check type
1745 and symbol reference.
1747 2006-06-11 Ulrich Drepper <drepper@redhat.com>
1749 * elflint.c (check_dynamic): Fix checking value of tags which are
1750 offsets in the string section. Make sure DT_STRTAB points to the
1751 section referenced in sh_link.
1753 * ld.c (options): Add headers. Add short option 'R' for '--rpath'.
1755 * ld.c: Recognize --eh-frame-hdr option.
1756 * ld.h (struct ld_state): Add eh_frame_hdr field.
1757 * ldgeneric.c (struct unw_eh_frame_hdr): Define.
1759 * ldgeneric.c (add_section): Use ebl_sh_flags_combine instead of
1761 (add_relocatable_file): Minor optimization of last change.
1762 (match_section): Don't preserve SHF_GROUP flag any longer.
1764 2006-06-10 Ulrich Drepper <drepper@redhat.com>
1766 * ld.c (parse_z_option): Recognize execstack and noexecstack.
1767 Handle record and ignore as position dependent options.
1768 (parse_z_option_2): Handle ignore and record here.
1769 * ld.h (struct ld_state): Add execstack field.
1770 * ldgeneric.c (add_relocatable_file): Recognize .note.GNU-stack
1772 (ld_generic_create_outfile): Fix program header creation in native
1773 linker. Add PT_GNU_STACK program header.
1775 2006-06-09 Ulrich Drepper <drepper@redhat.com>
1777 * i386_ld.c (elf_i386_finalize_plt): Don't change symbol table entries
1778 for PLT entries if there is no local definition.
1780 * ld.c (parse_option): Handle -z ignore like --as-needed and
1781 -z record like --no-as-needed.
1782 * ld.h (struct ld_state): Remove ignore_unused_dsos field.
1783 * ldgeneric.c (new_generated_scn): Always compute ndt_needed by
1784 looping over DSOs. When deciding about adding DT_NEEDED entries
1785 use ->as_needed instead of ignore_unused_dsos.
1787 2006-05-31 Ulrich Drepper <drepper@redhat.com>
1789 * ld.c: Recognize --as-needed and --no-as-needed options.
1790 * ld.h (struct usedfile): Add as_needed field.
1791 (struct ld_state): Likewise.
1792 * ldgeneric.c (ld_handle_filename_list): Copy as_needed flag from
1794 * ldscript.y (filename_id_list): Split to correctly parse all
1796 (mark_as_needed): Fix loop.
1798 2006-05-28 Ulrich Drepper <drepper@redhat.com>
1800 * addr2line.c (print_dwarf_function): Use unsigned type for lineno
1803 2006-05-27 Ulrich Drepper <drepper@redhat.com>
1805 * readelf.c (handle_relocs_rela): Better notations for addon value.
1806 (print_ehdr): Distinguish e_ident[EI_VERSION] from e_version.
1808 2006-04-04 Ulrich Drepper <drepper@redhat.com>
1810 * addr2line.c: Update copyright year.
1811 * elfcmp.c: Likewise.
1812 * elflint.c: Likewise.
1813 * findtextrel.c: Likewise.
1816 * objdump.c: Likewise.
1817 * ranlib.c: Likewise.
1818 * readelf.c: Likewise.
1820 * strings.c: Likewise.
1821 * strip.c: Likewise.
1823 2006-03-09 Roland McGrath <roland@redhat.com>
1825 * Makefile.am (AM_LDFLAGS): New variable.
1827 2006-03-01 Roland McGrath <roland@redhat.com>
1829 * readelf.c (dwarf_tag_string, dwarf_attr_string): Update name tables
1830 for dwarf.h changes matching 3.0 spec.
1831 (dwarf_encoding_string, dwarf_lang_string, print_ops): Likewise.
1833 2005-12-04 Ulrich Drepper <drepper@redhat.com>
1835 * elflint.c (check_one_reloc): If relocation section is not loaded,
1836 don't check whether the relocations modify read-only sections or
1837 loaded and unloaded sections.
1839 2005-11-28 Ulrich Drepper <drepper@redhat.com>
1841 * elflint.c (check_one_reloc): Take additional parameters. Use
1842 them to determine whether relocation is valid in this type of
1843 file. DSOs and executables can contain relocation sections in
1844 unloaded sections which just show the relocations the linker
1845 applied. Adjust all callers.
1846 (check_program_header): Check that PT_PHDR is loaded and that offset
1847 matches the one in the ELF header.
1849 2005-10-26 Roland McGrath <roland@redhat.com>
1851 * nm.c (get_var_range): dwarf_getloclist -> dwarf_getlocation.
1853 2005-09-03 Ulrich Drepper <drepper@redhat.com>
1855 * strip.c (handle_elf): Unify some error messages.
1856 * ld.c (main): Likewise.
1857 * ldgeneric.c (open_elf): Likewise.
1858 * elfcmp.c (main): Likewise.
1859 * elflint.c (check_elf_header): Likewise.
1861 * size.c (process_file): Fix typo in error message.
1863 * readelf.c: Lots of little cleanups. Use _unlocked functions.
1865 2005-09-02 Ulrich Drepper <drepper@redhat.com>
1867 * strings.c (main): Reset elfmap variable after munmap call.
1868 [_MUDFLAP] (map_file): Simplify mudflap debugging by not using mmap.
1870 2005-08-28 Ulrich Drepper <drepper@redhat.com>
1872 * ranlib.c: Don't define pread_retry and write_retry here.
1874 * Makefile.an [BUILD_STATIC] (libdw): Add -ldl.
1875 (CLEANFILES): Add *.gcno *.gcda *.gconv.
1877 * strings.c (process_chunk): Reorder expressions in conditional
1878 (process_chunk_mb): Likewise.
1880 * strings.c: New file.
1881 * Makefile.am (bin_PROGRAMS): Add strings.
1882 (strings_no_Wstring): Define.
1883 (strings_LDADD): Define.
1885 2005-08-27 Roland McGrath <roland@redhat.com>
1887 * addr2line.c (dwarf_diename_integrate): Function removed.
1888 (print_dwarf_function): Use plain dwarf_diename.
1890 2005-08-24 Ulrich Drepper <drepper@redhat.com>
1892 * elflint.c (check_versym): Versioned symbols should not have
1895 2005-08-15 Ulrich Drepper <drepper@redhat.com>
1897 * elflint.c (check_versym): Allow VER_NDX_LOCAL symbols to be
1900 * Makefile.am: Add rules to build ranlib.
1901 * ranlib.c: New file.
1903 2005-08-14 Roland McGrath <roland@redhat.com>
1905 * elflint.c (check_sections): Use ebl_section_type_name and allow any
1906 sh_type it recognizes.
1908 * elflint.c (check_sections): Print unknown flags in hex, don't
1909 truncate high bits. Print section number and name for unknown type.
1911 2005-08-13 Roland McGrath <roland@redhat.com>
1913 * elflint.c (check_program_header): Use ebl_segment_type_name and
1914 allow any p_type it recognizes. Include p_type value in error
1915 message for unknown type.
1917 2005-08-13 Ulrich Drepper <drepper@redhat.com>
1919 * elflint.c (check_symtab): Simplify last change a bit. Pass ehdr
1920 to ebl_check_special_symbol.
1921 (check_sections): Pass ehdr to ebl_bss_plt_p.
1923 2005-08-12 Roland McGrath <roland@redhat.com>
1925 * elflint.c (check_symtab): Check that _GLOBAL_OFFSET_TABLE_ st_shndx
1926 refers to the right section if it's not SHN_ABS.
1927 Let ebl_check_special_symbol override _G_O_T_ value and size checks.
1929 * elflint.c (check_sections): Don't complain about a non-NOBITS
1930 section taking no segment space, if it's sh_size is 0.
1932 * elflint.c (check_sections): Use ebl_bss_plt_p to see if .plt should
1933 be PROGBITS or NOBITS.
1935 * elflint.c (check_symtab): Use ebl_check_special_symbol to override
1936 standard st_value and st_size checks.
1938 2005-07-28 Roland McGrath <roland@redhat.com>
1940 * addr2line.c (options, parse_opt): Don't handle -e here.
1941 (executable): Variable removed.
1942 (argp_children): New static variable.
1943 (argp): Use it. Make const.
1944 (main): Fill in argp_children from dwfl_standard_argp ().
1945 Let libdwfl handle file selection, pass Dwfl handle to handle_address.
1946 (print_dwarf_function): New function. Try to figure out inline chain.
1947 (elf_getname): Function removed, libdwfl does it for us.
1948 (handle_address): Take Dwfl handle instead of Elf, Dwarf handles.
1949 Use dwfl_module_addrname instead of elf_getname.
1950 Use dwfl_module_getsrc and dwfl_lineinfo instead of libdw calls.
1951 * Makefile.am (INCLUDES): Add libdwfl directory to path.
1953 2005-08-10 Ulrich Drepper <drepper@redhat.com>
1955 * strip.c (parse_opt): STATE parameter is now used.
1956 Various little cleanups.
1958 * readelf.c (print_debug_line_section): Correct fallout of renaming
1959 of DW_LNS_set_epilog_begin.
1961 2005-08-08 Roland McGrath <roland@redhat.com>
1963 * strip.c (options, parse_opt): Grok -R .comment for compatibility
1964 with binutils strip. Likewise -d, -S, as aliases for -g.
1965 Likewise ignore -s/--strip-all.
1967 2005-08-07 Roland McGrath <roland@redhat.com>
1969 * strip.c (process_file): Open read-only when using a different output
1972 2005-08-06 Ulrich Drepper <drepper@redhat.com>
1974 * elflint.c (in_nobits_scn): New function.
1975 (check_versym): Allow references for defined symbols against versions
1976 of other DSOs also for symbols in nobits sections.
1977 Move a few variables around.
1979 * Makefile.am (AM_CFLAGS): Avoid duplication.
1980 Link with statis libs if BUILD_STATIC.
1982 2005-08-05 Ulrich Drepper <drepper@redhat.com>
1984 * elflint.c: Many, many more tests. Mostly related to symbol
1985 versioning. Those sections should now be completely checked.
1987 * readelf.c (print_dynamic): Use gelf_offscn.
1989 2005-08-04 Ulrich Drepper <drepper@redhat.com>
1991 * elflint.c: Add lots more tests: more extension symbol table sanity,
1992 versioning section tests, hash table tests. General cleanup.
1994 2005-08-02 Ulrich Drepper <drepper@redhat.com>
1996 * objdump.c: New file.
1997 * Makefile.am (bin_PROGRAMS): Add objdump.
1998 (objdump_LDADD): Define.
2000 * elflint.c (check_reloc_shdr): New function split out from check_rela
2002 (check_one_reloc): New function. Likewise.
2003 (check_rela): Use check_reloc_shdr and check_one_reloc.
2004 (check_rel): Likewise.
2005 (check_program_header): Check that PT_DYNAMIC entry matches .dynamic
2007 Add checks that relocations against read-only segments are flagged,
2008 that the text relocation flag is not set unnecessarily, and that
2009 relocations in one section are either against loaded or not-loaded
2012 2005-08-01 Ulrich Drepper <drepper@redhat.com>
2014 * elfcmp.c (main): Ignore section count and section name string table
2017 2005-07-27 Roland McGrath <roland@redhat.com>
2019 * elfcmp.c: Include <locale.h>.
2021 2005-07-27 Ulrich Drepper <drepper@redhat.com>
2023 * elfcmp.c: Print name and index of differing section.
2025 2005-07-24 Ulrich Drepper <drepper@redhat.com>
2027 * elfcmp.c: Implement comparing gaps between sections.
2029 2005-07-23 Ulrich Drepper <drepper@redhat.com>
2031 * elflint.c: Include libeblP.h instead of libebl.h.
2033 * readelf.c: Likewise.
2034 * elfcmp.c: Likewise.
2036 * elfcmp.c (main): Compare individual ELF header fields, excluding
2037 e_shoff instead of the whole struct at once.
2038 Use ebl_section_strip_p instead of SECTION_STRIP_P.
2039 * strip.c: Use ebl_section_strip_p instead of SECTION_STRIP_P.
2041 2005-07-22 Ulrich Drepper <drepper@redhat.com>
2043 * elfcmp.c (main): Take empty section into account when comparing
2046 * elflint.c (check_dynamic): Check that d_tag value is >= 0 before
2049 2005-07-21 Ulrich Drepper <drepper@redhat.com>
2051 * elfcmp.c: New file.
2052 * Makefile.am (bin_PROGRAMS): Add elfcmp.
2053 (elfcmp_LDADD): Define.
2055 * elflint.c (check_rela): Check that copy relocations only reference
2056 object symbols or symbols with unknown type.
2057 (check_rel): Likewise.
2059 2005-06-08 Roland McGrath <roland@redhat.com>
2061 * readelf.c (print_ops): Add consts.
2063 2005-05-31 Roland McGrath <roland@redhat.com>
2065 * readelf.c (print_debug_abbrev_section): Don't bail after first CU's
2066 abbreviations. Print a header line before each CU section.
2068 * readelf.c (print_debug_loc_section): Fix indentation for larger
2071 2005-05-30 Roland McGrath <roland@redhat.com>
2073 * readelf.c (print_debug_line_section): Print section offset of each
2074 CU's table, so they are easy to find from seeing the stmt_list value.
2076 * readelf.c (dwarf_attr_string): Add all attributes in <dwarf.h>.
2077 (attr_callback): Grok DW_AT_ranges and print offset in hex.
2079 * readelf.c (attr_callback): Add 2 to addrsize * 2 for %#0* format.
2080 (print_debug_ranges_section, print_debug_loc_section): Likewise.
2082 * readelf.c (print_ops): Take different args for indentation control.
2083 (attr_callback): Caller updated.
2084 Grok several more block-form attributes as being location expressions.
2085 For those same attributes with udata forms, format output differently
2086 for location list offset.
2087 (print_debug_loc_section): Implement it for real.
2089 * readelf.c (options): Mention ranges for --debug-dump.
2090 (enum section_e): Add section_ranges.
2091 (parse_opt): Grok "ranges" for -w/--debug-dump.
2092 (print_debug_ranges_section): New function.
2093 (print_debug): Handle .debug_ranges section.
2095 2005-05-30 Ulrich Drepper <drepper@redhat.com>
2097 * readelf.c (handle_notes): At least x86-64 need not have the note
2098 section values aligned to 8 bytes.
2100 2005-05-18 Ulrich Drepper <drepper@redhat.com>
2102 * readelf.c (dwarf_tag_string): Add new tags.
2104 2005-05-08 Roland McGrath <roland@redhat.com>
2106 * strip.c (handle_elf): Don't translate hash and versym data formats,
2107 elf_getdata already did it for us.
2109 2005-05-07 Ulrich Drepper <drepper@redhat.com>
2111 * Makefile.am (findtextrel_LDADD): Add $(libmudflap).
2112 (addr2line_LDADD): Likewise.
2114 2005-05-03 Roland McGrath <roland@redhat.com>
2116 * strip.c (handle_elf): Apply symbol table fixups to discarded
2117 relocation sections when they are being saved in the debug file.
2119 * strip.c (handle_elf): Pass EHDR->e_ident[EI_DATA] to gelf_xlatetom
2120 and gelf_xlatetof, not the native byte order.
2122 * strip.c (parse_opt): Give error if -f or -o is repeated.
2123 (main): Exit if argp_parse returns nonzero.
2125 * strip.c (debug_fname_embed): New variable.
2126 (options, parse_opt): New option -F to set it.
2128 2005-05-07 Ulrich Drepper <drepper@redhat.com>
2130 * readelf.c (parse_opt): Make any_control_option variable
2131 local. Simplify some tests.
2133 2005-05-03 Roland McGrath <roland@redhat.com>
2135 * strip.c (crc32_file): Function removed (now in ../lib).
2137 2005-05-03 Roland McGrath <roland@redhat.com>
2139 * elflint.c (is_debuginfo): New variable.
2140 (options, parse_opt): New option --debuginfo/-d to set it.
2141 (check_sections): If is_debuginfo, don't complain about SHT_NOBITS.
2142 (check_note): If is_debuginfo, don't try to get note contents.
2144 2005-04-24 Ulrich Drepper <drepper@redhat.com>
2146 * readelf.c (print_debug_abbrev_section): Don't print error when end of
2149 2005-04-14 Ulrich Drepper <drepper@redhat.com>
2151 * readelf.c (dwarf_encoding_string): New function.
2152 (dwarf_inline_string): New function.
2153 (dwarf_access_string): New function.
2154 (dwarf_visibility_string): New function.
2155 (dwarf_virtuality_string): New function.
2156 (dwarf_identifier_case_string): New function.
2157 (dwarf_calling_convention_string): New function.
2158 (dwarf_ordering_string): New function.
2159 (dwarf_discr_list_string): New function.
2160 (attr_callback): Decode man more attribute values.
2162 2005-04-01 Ulrich Drepper <drepper@redhat.com>
2164 * addr2line.c: Finish implementation of -f option.
2166 2005-03-29 Ulrich Drepper <drepper@redhat.com>
2168 * addr2line.c: New file.
2169 * Makefile.am (bin_PROGRAMS): Add addr2line.
2170 Define addr2line_LDADD.
2172 * findtextrel.c: Use new dwarf_addrdie function.
2174 * findtextrel.c: Fix usage message and re-add accidentally removed
2177 2005-03-28 Ulrich Drepper <drepper@redhat.com>
2179 * findtextrel.c: New file.
2180 * Makefile: Add rules to build findtextrel.
2182 2005-02-15 Ulrich Drepper <drepper@redhat.com>
2184 * ldlex.l: Provide ECHO definition to avoid warning.
2186 * elflint.c (check_program_header): Fix typo in RELRO test.
2188 * Makefile.am (AM_CFLAGS): Add more warning options.
2189 * elflint.c: Fix warnings introduced by the new warning options.
2190 * i386_ld.c: Likewise.
2193 * ldgeneric.c: Likewise.
2195 * readelf.c: Likewise.
2196 * sectionhash.c: Likewise.
2198 * string.c: Likewise.
2200 2005-02-05 Ulrich Drepper <drepper@redhat.com>
2202 * Makefile.am: Check for text relocations in constructed DSOs.
2204 * Makefile.am [MUDFLAP] (AM_CFLAGS): Add -fmudflap. Link all apps
2207 * ldscript.y: Add as_needed handling.
2208 * ldlex.l: Recognize AS_NEEDED token.
2209 * ld.h (struct filename_list): Add as_needed flag.
2211 2005-02-04 Ulrich Drepper <drepper@redhat.com>
2213 * elflint.c (check_symtab): Correctly determine size of GOT section.
2215 2005-01-19 Ulrich Drepper <drepper@redhat.com>
2217 * ld.c: Remove unnecessary more_help function. Print bug report
2219 * strip.c: Likewise.
2222 * readelf.c: Likewise.
2223 * elflint.c: Likewise.
2225 * elflint.c (main): Don't check for parameter problems here.
2226 (parse_opt): Do it here, where we get informed about some of them
2229 * readelf.c (main): Don't check for parameter problems here.
2230 (parse_opt): Do it here, where we get informed about some of them
2233 2005-01-11 Ulrich Drepper <drepper@redhat.com>
2235 * strip.c: Update copyright year.
2236 * readelf.c: Likewise.
2240 * elflint.c: Likewise.
2242 * elflint.c (check_symtab): Don't warn about wrong size for
2243 _DYNAMIC and __GLOBAL_OFFSET_TABLE__ for --gnu-ld.
2245 2004-10-05 Ulrich Drepper <drepper@redhat.com>
2247 * readelf.c (print_phdr): In section mapping, also indicate
2248 sections in read-only segments.
2250 2004-09-25 Ulrich Drepper <drepper@redhat.com>
2252 * readelf.c: Make compile with gcc 4.0.
2253 * strip.c: Likewise.
2255 2004-08-16 Ulrich Drepper <drepper@redhat.com>
2257 * strip.c (handle_elf): Rewrite dynamic memory handling to use of
2258 allocate to work around gcc 3.4 bug.
2260 2004-01-25 Ulrich Drepper <drepper@redhat.com>
2262 * ldlex.l (invalid_char): Better error message.
2264 2004-01-23 Ulrich Drepper <drepper@redhat.com>
2266 * readelf.c: Print SHT_GNU_LIBLIST sections.
2268 * none_ld.c: New file.
2270 2004-01-21 Ulrich Drepper <drepper@redhat.com>
2272 * Makefile.am: Enable building of machine specific linker.
2274 2004-01-20 Ulrich Drepper <drepper@redhat.com>
2276 * Makefile.am: Support building with mudflap.
2278 * i386_ld.c: Fix warnings gcc 3.4 spits out.
2279 * ldgeneric.c: Likewise.
2280 * ldscript.y: Likewise.
2281 * readelf.c: Likewise.
2282 * strip.c: Likewise.
2284 * readelf.c (print_debug_line_section): Determine address size
2287 2004-01-19 Ulrich Drepper <drepper@redhat.com>
2289 * readelf.c (print_phdr): Show which sections are covered by the
2292 * elflint.c (check_program_header): Check PT_GNU_RELRO entry.
2294 * readelf.c (print_debug_macinfo_section): Implement.
2296 2004-01-18 Ulrich Drepper <drepper@redhat.com>
2298 * readelf.c (print_debug_line_section): Implement.
2300 2004-01-17 Ulrich Drepper <drepper@redhat.com>
2302 * src/elflint.c: Use PACKAGE_NAME instead of PACKAGE.
2303 * src/ld.c: Likewise.
2304 * src/nm.c: Likewise.
2305 * src/readelf.c: Likewise.
2306 * src/size.c: Likewise.
2307 * src/strip.c: Likewise.
2309 * strip.c: Add a few more unlikely. Reduce scope of some variables.
2311 * Makefile.am: Support building with mudflap.
2313 2004-01-16 Ulrich Drepper <drepper@redhat.com>
2315 * readelf.c (print_debug_info_section): Free dies memory.
2317 * readelf.c: Print .debug_info section content.
2319 2004-01-13 Ulrich Drepper <drepper@redhat.com>
2321 * readelf.c (print_shdr): Add support for SHF_ORDERED and SHF_EXCLUDE.
2323 2004-01-12 Ulrich Drepper <drepper@redhat.com>
2325 * readelf.c (print_debug_aranges): Implement using libdw.
2327 2004-01-11 Ulrich Drepper <drepper@redhat.com>
2329 * nm.c: Adjust for Dwarf_Files type and dwarf_lineno interface change.
2331 * readelf.c: Use libdw instead of libdwarf. Not all of the old
2332 behavior is available yet.
2333 * Makefile.am: Link readelf with libdw. Remove libdwarf include path.
2335 2004-01-09 Ulrich Drepper <drepper@redhat.com>
2337 * nm.c (get_local_names): Adjust call to dwarf_nextcu.
2339 * nm.c: Implement getting information about local variables.
2341 2004-01-07 Ulrich Drepper <drepper@redhat.com>
2343 * nm.c: Read also debug information for local symbols.
2345 2004-01-05 Ulrich Drepper <drepper@redhat.com>
2347 * nm.c: Shuffle dwarf handling code around so the maximum column
2348 width can be computed ahead of printing. Avoid collection symbols
2349 which are not printed anyway.
2351 * nm.c: Rewrite dwarf handling to use libdw.
2352 * Makefile.am (AM_CFLAGS): Add -std parameter.
2353 (INCLUDES): Find header in libdw subdir.
2354 (nm_LDADD): Replace libdwarf with libdw.
2356 * elflint.c: Update copyright year.
2357 * readelf.c: Likewise.
2359 * strip.c: Likewise.
2362 2003-12-31 Ulrich Drepper <drepper@redhat.com>
2364 * strip.c (process_file): Close file before returning.
2366 2003-11-19 Ulrich Drepper <drepper@redhat.com>
2368 * readelf.c (handle_dynamic): Make column for tag name wider.
2370 2003-09-29 Ulrich Drepper <drepper@redhat.com>
2372 * readelf.c (handle_dynamic): Always terminate tag name with a space.
2374 2003-09-25 Ulrich Drepper <drepper@redhat.com>
2376 * strip.c (process_file): Don't mmap the input file, we modify the
2377 data structures and don't want the change end up on disk.
2379 2003-09-23 Jakub Jelinek <jakub@redhat.com>
2381 * unaligned.h (union u_2ubyte_unaligned,
2382 union u_4ubyte_unaligned, union u_8ubyte_unaligned): Add
2384 (add_2ubyte_unaligned, add_4ubyte_unaligned,
2385 add_8ubyte_unaligned): Avoid nesting bswap_NN macros.
2386 Read/store value through _ptr->u instead of *_ptr.
2388 2003-09-22 Ulrich Drepper <drepper@redhat.com>
2390 * size.c (show_sysv): Change type of maxlen to int.
2392 * strip.c (handle_elf): Handle the 64-bit archs which is 64-bit
2395 * i386_ld.c: Many many fixes and extensions.
2397 * ldgeneric.c: Likewise.
2399 2003-08-16 Ulrich Drepper <drepper@redhat.com>
2401 * ldgeneric.c (check_definition): Don't add symbol on dso_list if
2402 the reference is from another DSO.
2404 2003-08-15 Ulrich Drepper <drepper@redhat.com>
2406 * ldgeneric.c (find_entry_point): It is no fatal error if no entry
2407 point is found when creating a DSO.
2409 2003-08-14 Ulrich Drepper <drepper@redhat.com>
2411 * ld.c (main): Always call FLAG_UNRESOLVED.
2412 * ldgeneric.c (ld_generic_flag_unresolved): Only complain about
2413 undefined symbols if not creating DSO or ld_state.nodefs is not set.
2415 2003-08-13 Ulrich Drepper <drepper@redhat.com>
2417 * Makefile.in: Depend on libebl.a, not libebl.so.
2419 * ld.c (main): Mark stream for linker script as locked by caller.
2420 (read_version_script): Likewise.
2421 * ldlex.c: Define fread and fwrite to _unlocked variant.
2423 * i386_ld.c (elf_i386_finalize_plt): Replace #ifdefs with uses of
2425 * unaligned.h: Define target_bswap_16, target_bswap_32, and
2427 (store_2ubyte_unaligned, store_4ubyte_unaligned,
2428 store_8ubyte_unaligned): Define using new macros.
2430 2003-08-12 Ulrich Drepper <drepper@redhat.com>
2432 * i386_ld.c (elf_i386_finalize_plt): Use packed structs to access
2433 possibly unaligned memory. Support use of big endian machines.
2435 2003-08-11 Ulrich Drepper <drepper@redhat.com>
2437 * Moved to CVS archive.