1 2018-10-24 Mark Wielaard <mark@klomp.org>
3 * strip.c (handle_elf): Always copy over phdrs if there are any
4 and check phnum instead of e_type to determine whether to move
7 2018-11-02 Mark Wielaard <mark@klomp.org>
9 * unstrip.c (copy_elf): Add ELF_CHECK to make sure gelf_getehdr ()
12 2018-10-18 Mark Wielaard <mark@klomp.org>
14 * elflint.c (check_note_data): Recognize NT_GNU_PROPERTY_TYPE_0.
15 (check_note): Use p_align to pass either ELF_T_NHDR or ELF_T_NHDR8 to
17 * readelf (handle_notes): Likewise.
19 2018-10-24 Mark Wielaard <mark@klomp.org>
21 * addr2line.c (print_addrsym): Use elf_getshdrstrndx instead of
24 2018-10-24 Mark Wielaard <mark@klomp.org>
26 * readelf.c (section_name): Remove ehdr argument, lookup shstrndx.
27 (print_debug_abbrev_section): Don't pass ehdr.
28 (print_debug_addr_section): Likewise.
29 (print_decoded_aranges_section): Likewise.
30 (print_debug_aranges_section): Likewise.
31 (print_debug_rnglists_section): Likewise.
32 (print_debug_ranges_section): Likewise.
33 (print_debug_units): Likewise.
34 (print_decoded_line_section): Likewise.
35 (print_debug_line_section): Likewise.
36 (print_debug_loclists_section): Likewise.
37 (print_debug_loc_section): Likewise.
38 (print_debug_macinfo_section): Likewise.
39 (print_debug_macro_section): Likewise.
40 (print_debug_pubnames_section): Likewise.
41 (print_debug_str_section): Liekwise.
42 (print_debug_str_offsets_section): Likewise.
43 (print_gdb_index_section): Likewise.
45 2018-10-16 Mark Wielaard <mark@klomp.org>
47 * readelf.c (print_debug_frame_section): Make sure readp is never
50 2018-10-19 Mark Wielaard <mark@klomp.org>
52 * dwfl_module_getdwarf.c (adjust_relocs): Check sh_entsize is not
54 (add_new_section_symbols): Likewise.
55 (copy_elided_sections): Likewise.
57 2018-10-18 Mark Wielaard <mark@klomp.org>
59 * size.c (handle_ar): Only close elf if prefix was NULL.
61 2018-10-18 Mark Wielaard <mark@klomp.org>
63 * arlib.c (arlib_add_symbols): Check that sh_entsize is not zero.
65 2018-10-14 Mark Wielaard <mark@klomp.org>
67 * ar.c (do_oper_extract): Assume epoch if ar_date is bogus.
69 2018-10-14 Mark Wielaard <mark@klomp.org>
71 * findtextrel.c (process_file): Check that sh_entsize is not zero.
73 2018-09-13 Mark Wielaard <mark@klomp.org>
75 * readelf.c (print_debug_macro_section): Use elf_getdata. Print
77 2018-09-13 Mark Wielaard <mark@klomp.org>
79 2018-10-19 Mark Wielaard <mark@klomp.org>
81 * unstrip.c (copy_elided_sections): Renumber group section indexes.
83 2018-10-12 Mark Wielaard <mark@klomp.org>
85 * strip.c (handle_elf): Don't remove SHF_GROUP flag from sections.
86 Skip group section flag when renumbering section indexes.
87 * unstrip.c (struct section): Add sig field.
88 (compare_unalloc_sections): Take and use sig1 and sig2 as arguments.
89 (compare_sections): Pass signatures to compare_unalloc_sections.
90 (get_group_sig): New function.
91 (find_alloc_sections_prelink): Set signature.
92 (copy_elided_sections): Likewise and pass them on.
93 (find_unalloc_section): Take and pass signatures.
95 2018-10-02 Andreas Schwab <schwab@suse.de>
97 * strip.c (handle_elf): Handle ADD/SUB relocation.
99 2018-09-13 Mark Wielaard <mark@klomp.org>
101 * readelf.c (print_shdr): Get number of section with elf_getshdrnum.
102 (print_phdr): Likewise.
104 2018-09-13 Mark Wielaard <mark@klomp.org>
106 * strip.c (handle_elf): Check against shstrndx, not e_shstrndx.
107 Explicitly set shdrstrndx for debug file.
108 * unstrip.c (copy_elf): Explicitly copy shstrndx.
109 (find_alloc_sections_prelink): Document shnum usage.
111 2018-09-13 Mark Wielaard <mark@klomp.org>
113 * elflint.c (check_elf_header): Use shnum instead of e_shnum for all
115 (check_symtab): Use shstrndx instead of e_shstrndx to get section
118 2018-09-13 Mark Wielaard <mark@klomp.org>
120 * elfcmp.c (main): Get, check and shdrstrndx for section names.
122 2018-09-12 Mark Wielaard <mark@klomp.org>
124 * elfcmp.c (main): Call ebl_section_strip_p without ehdr.
125 * strip.c (handle_elf): Likewise.
127 2018-09-12 Mark Wielaard <mark@klomp.org>
129 * elflint.c (check_symtab): Call ebl_check_special_symbol without
132 2018-07-30 Mark Wielaard <mark@klomp.org>
134 * strip.c (handle_elf): Track allocated/unallocated sections seen. Set
135 section offset of unallocated sections after handling all allocated
138 2018-08-18 Mark Wielaard <mark@klomp.org>
140 * readelf.c (print_debug_aranges_section): Make sure there is enough
141 data to read the header segment size.
143 2018-08-18 Mark Wielaard <mark@klomp.org>
145 * elflint.c (check_sysv_hash): Calculate needed size using unsigned
146 long long int to prevent overflow.
147 (check_sysv_hash64): Calculate maxwords used separately before
148 comparison to prevent overflow.
150 2018-07-24 Mark Wielaard <mark@klomp.org>
152 * unstrip.c (compare_unalloc_sections): Also compare sh_size.
154 2018-07-21 Mark Wielaard <mark@klomp.org>
156 * unstrip.c (adjust_all_relocs): Skip SHT_GROUP sections.
158 2018-07-21 Mark Wielaard <mark@klomp.org>
160 * elfcompress.c (get_sections): New function.
161 (process_file): Check whether section needs to change. Don't rewrite
162 file if no section data needs changing.
163 (main): Update 'force' help text.
165 2018-07-21 Mark Wielaard <mark@klomp.org>
167 * elfcompress.c (process_file): Swap fchmod and fchown calls.
169 2018-07-04 Mark Wielaard <mark@klomp.org>
171 * readelf.c (print_debug_addr_section): Rename index var to uidx.
172 (attr_callback): Rename index var to word.
173 (print_debug_str_offsets_section): Rename index var to uidx.
175 2018-07-04 Ross Burton <ross.burton@intel.com>
177 * addr2line.c: Remove error.h include.
179 * arlib.c: Likewise and add system.h include.
180 * arlib2.c: Likewise.
181 * elfcmp.c: Likewise.
182 * elfcompress.c: Likewise.
183 * elflint.c: Likewise.
184 * findtextrel.c: Likewise.
186 * objdump.c: Likewise.
187 * ranlib.c: Likewise.
188 * readelf.c: Likewise.
190 * strings.c: Likewise.
192 * unstrip.c: Likewise.
194 2018-06-25 Mark Wielaard <mark@klomp.org>
196 * readelf.c (print_decoded_line_section): Use dwarf_next_lines
197 instead of dwarf_nextcu.
198 (print_debug_line_section): Don't explicitly lookup CU.
200 2018-06-15 Mark Wielaard <mark@klomp.org>
202 * readelf.c (attr_callback): Only print block as expressions if it
203 isn't DW_FORM_data16.
205 2018-06-12 Mark Wielaard <mark@klomp.org>
207 * readelf.c (print_form_data): Check we have 4, not 2, bytes
208 available for DW_FORM_block4.
210 2018-06-12 Mark Wielaard <mark@klomp.org>
212 * readelf.c (print_form_data): Don't increase strreadp after use.
213 Do increase readp for DW_FORM_strx[1234].
215 2018-06-16 Mark Wielaard <mark@klomp.org>
217 * readelf.c (print_debug_loc_section): Make sure next_off doesn't
220 2018-06-13 Mark Wielaard <mark@klomp.org>
222 * readelf.c (die_type_sign_bytes): New function.
223 (attr_callback): Recognized DW_FORM_implicit_cost as signed. Use
224 die_type_sign_bytes to lookup the signedness and size of const
227 2018-06-11 Mark Wielaard <mark@klomp.org>
229 * readelf.c (print_form_data): Don't reuse readp and readendp when
230 reading str_offsets section.
232 2018-06-10 Mark Wielaard <mark@klomp.org>
234 * readelf.c (print_form_data): Don't cast value to ptrdiff_t, cast
237 2018-06-08 Mark Wielaard <mark@klomp.org>
239 * readelf.c (print_debug_rnglists_section): Calculate max_entries
240 instead of needed bytes to prevent overflowing. Always print
241 max_entries (but not more).
242 (print_debug_loclists_section): Likewise.
244 2018-06-08 Mark Wielaard <mark@klomp.org>
246 * readelf.c (print_debug_line_section): Stop printing directories
247 and files when we are at the end of the unit data.
249 2018-06-07 Mark Wielaard <mark@klomp.org>
251 * readelf.c (format_result): Removed.
252 (format_result_size): Removed.
253 (format_dwarf_addr): Renamed to...
254 (print_dwarf_addr): ...this. Simply call printf, don't setup buffer,
256 (print_ops): Use print_dwarf_addr instead of format_dwarf_addr.
257 (print_debug_addr_section): Likewise.
258 (print_debug_aranges_section): Likewise.
259 (print_debug_rnglists_section): Likewise.
260 (print_debug_ranges_section): Likewise.
261 (print_debug_frame_section): Likewise.
262 (attr_callback): Likewise.
263 (print_decoded_line_section): Likewise.
264 (print_debug_line_section): Likewise.
265 (print_debug_loclists_section): Likewise.
266 (print_debug_loc_section): Likewise.
267 (print_gdb_index_section): Likewsie.
269 2018-06-05 Mark Wielaard <mark@klomp.org>
271 * readelf.c (print_debug_addr_section): Set unit_length always to
272 (next_unitp - readp) in case we don't have a real header.
274 2018-06-05 Mark Wielaard <mark@klomp.org>
276 * readelf.c (print_debug_loc_section): Set begin to idx when failing
277 to read the start address if DW_LLE_GNU_start_end_entry.
279 2018-06-05 Mark Wielaard <mark@klomp.org>
281 * readelf.c (handle_sysv_hash): Don't leak lengths array when
282 detecting an invalid chain.
283 (handle_sysv_hash64): Likewise.
285 2018-06-05 Mark Wielaard <mark@klomp.org>
287 * readelf.c (print_debug_macro_section): Extend vendor array by one
288 to include max DW_MACRO_hi_user opcode.
290 2018-06-07 Mark Wielaard <mark@klomp.org>
292 * readelf.c (main): Lookup "no" for no_str.
293 (print_debug_abbrev_section): Use yes_str and no_str.
294 (print_form_data): Likewise.
296 2018-06-04 Mark Wielaard <mark@klomp.org>
298 * readelf (format_result): New static char pointer.
299 (format_result_size): New static size_t.
300 (format_dwarf_addr): Calculate max string size, reuse format_result
301 if possible, otherwise realloc. Use sprintf on result, not asprintf.
302 (print_ops): Don't free format_dwarf_addr, make sure result is
303 printed before calling format_dwarf_addr again.
304 (print_debug_addr_section): Likewise.
305 (print_debug_aranges_section): Likewise.
306 (print_debug_rnglists_section): Likewise.
307 (print_debug_ranges_section): Likewise.
308 (print_debug_frame_section): Likewise.
309 (attr_callback): Likewise.
310 (print_decoded_line_section): Likewise.
311 (print_debug_line_section): Likewise.
312 (print_debug_loclists_section): Likewise.
313 (print_debug_loc_section): Likewise.
314 (print_gdb_index_section): Likewsie.
316 2018-06-04 Mark Wielaard <mark@klomp.org>
318 * readelf.c (yes_str): New static char pointer.
320 (main): Set yes_str and no_str using gettext.
321 (attr_callback): Use yes_str and no_str instead of calling gettext.
323 2018-06-04 Mark Wielaard <mark@klomp.org>
325 * readelf.c (main): Call __fsetlocking (stdout, FSETLOCKING_BYCALLER).
327 2018-05-31 Mark Wielaard <mark@klomp.org>
329 * readelf.c (print_debug_units): Print the dwo name and id when
330 unable to find a .dwo file.
332 2018-05-31 Mark Wielaard <mark@klomp.org>
334 * readelf.c (enum section_e): Make section_types not an alias of
336 (section_all): Add section_types.
337 (parse_opt): Add both section_info and section_types for "info"
339 (print_debug_units): Don't be silent for debug_types.
341 2018-05-31 Mark Wielaard <mark@klomp.org>
343 * readelf.c (attr_callback): Only register section_loc when not
344 looking at a split dwarf from a skeleton.
346 2018-05-30 Mark Wielaard <mark@klomp.org>
348 * readelf.c (print_debug_loc_section): Use correct listptr for
351 2018-05-31 Mark Wielaard <mark@klomp.org>
353 * readelf.c (print_debug_units): Check offset against -1 not ~0ul.
355 2018-05-29 Mark Wielaard <mark@klomp.org>
357 * readelf.c (print_debug_loc_section): Handle GNU DebugFission list
360 2018-05-29 Mark Wielaard <mark@klomp.org>
362 * readelf.c (print_debug): Record and reset section_info status in
363 implicit_debug_sections and print_debug_sections.
365 2018-05-28 Mark Wielaard <mark@klomp.org>
367 * readelf.c (print_debug_units): Turn "Could not find split compile
368 unit" into an Warning instead of an error.
370 2018-04-29 Mark Wielaard <mark@klomp.org>
372 * readelf.c (parse_opt): Request implicit section_info for "str".
373 (known_stroffbases): New static variable.
374 (attr_callbackattr_callback): Handle DW_AT_str_offets_base.
375 (print_debug_str_offsets_section): New function.
376 (print_debug): Handle .debug_str_offsets as section_str. Reset
379 2018-04-27 Mark Wielaard <mark@klomp.org>
381 * readelf.c (options): Add addr.
382 (enum section_e): Add section_addr.
383 (section_all): Add section_addr.
384 (parse_opt): Parse "addr".
385 (known_addrbases): New static variable.
386 (get_listptr): New function.
387 (print_debug_addr_section): Likewise.
388 (attr_callback): Handle DW_AT_addr_base and DW_AT_GNU_addr_base.
389 (print_debug): Add NEW_SECTION (addr). Reset known_addrbases.
391 2018-04-07 Mark Wielaard <mark@klomp.org>
393 * readelf.c (attr_callback): Handle DW_FORM_loclistx and
396 2018-04-12 Mark Wielaard <mark@klomp.org>
398 * readelf.c (dwarf_loc_list_encoding_string): New functions.
399 (dwarf_loc_list_encoding_name): Likewise.
400 (known_loclistptr): Renamed and split in two...
401 (known_locsptr): this and ...
402 (known_loclistsptr): this.
403 (listptr_base): Split out...
404 (cudie_base): ...this.
405 (is_split_dwarf): New function.
406 (attr_callback): Handle DW_AT_loclists_base and notice sec_offset
408 (print_debug_rnglists_section): Use spit_dwarf_cu_base.
409 (print_debug_loclists_section): New function.
410 (print_debug_loc_section): Use known_locsptr instead of
412 (print_debug): Recognize .debug_loclists. Reset known_locsptr and
415 2018-05-25 Mark Wielaard <mark@klomp.org>
417 * readelf.c (DWARF_SKELETON): New constant.
418 (do_not_close_dwfl): New bool.
419 (options): Add dwarf-skeleton.
420 (dwarf_skeleton): New static variable.
421 (parse_opt): Handle DWARF_SKELETON, set dwarf_skeleton.
422 (create_dwfl): New function, with code extracted from...
423 (process_file): ...here. Check do_not_close_dwfl.
424 (is_split_darf): New function.
425 (getone_dwflmod): Likewise.
426 (print_debug): Use new functions to find skeleton DWARF file to use
427 when inspecting .dwo split DWARF file.
429 2018-04-11 Mark Wielaard <mark@klomp.org>
431 * readelf.c (dwarf_range_list_encoding_string): New function.
432 (dwarf_range_list_encoding_name): Likewise.
433 (known_rnglistptr): New static variable.
434 (listptr_cu): New function.
435 (print_debug_rnglists_section): Likewise.
436 (attr_callback): Call notice_listptr for DW_AT_ranges. Handle
437 DW_AT_rnglists_base. Handle DW_FORM_rnglistx. DW_AT_start_scope
438 can also have a rnglist.
439 (print_debug_units): Do (silently) scan split DWARF also for
440 debug_ranges before DWARF5 to catch all rangelistptrs.
441 (print_debug): Recognize .debug_rnglists. Reset known_rnglistptr.
443 2018-01-21 Mark Wielaard <mark@klomp.org>
445 * readelf.c (get_indexed_addr): New function.
446 (print_ops): Handle DW_OP_addrx, DW_OP_GNU_addr_index,
447 DW_OP_constx, DW_OP_GNU_const_index separately and resolve
449 (attr_callback): Print index and address for
450 DW_FORM_GNU_addr_index and DW_FORM_addrx[1234].
452 2018-01-19 Mark Wielaard <mark@klomp.org>
454 * readelf.c (options): Add info+.
455 (show_split_units): New static boolean defaulting to false.
456 (parse_opt): For all (no arg) --debug-dump set show_split_units
457 to yes. For "info+" enable section_info and show_split_units.
458 (attrcb_args): Add is_split field.
459 (attr_callback): Use is_split to format DIE offsets differently.
460 (print_debug_units): Likewise. Get subdie (type or split) only
461 when needed. When not silent reiterate over split DIEs when
464 2018-05-15 Mark Wielaard <mark@klomp.org>
466 * readelf.c (print_debug_units): Print unit type and id for any
467 unit type that has it even when version < 5.
469 2018-05-14 Mark Wielaard <mark@klomp.org>
471 * readelf.c (print_ops): Handle DW_OP_GNU_addr_index and
472 DW_OP_GNU_const_index.
473 (attr_callback): Handle DW_FORM_GNU_addr_index as DW_FORM_addrx.
474 Handle DW_FORM_GNU_str_index as DW_FORM_constx. Add as_hex_id.
475 Handle DW_AT_GNU_dwo_id as_hex_id.
476 (print_form_data): Handle DW_FORM_GNU_str_index as DW_FORM_strx.
478 2018-05-12 Mark Wielaard <mark@klomp.org>
480 * readelf.c (print_debug): Also recognize .dwo section name variants.
482 2018-05-15 Dmitry V. Levin <ldv@altlinux.org>
484 * elflint.c (check_elf_header): Fix typo in error diagnostics.
486 2018-05-15 Mark Wielaard <mark@klomp.org>
488 * readelf.c (print_form_data): Cast comparisons against offset_len to
490 (print_debug_line_section): Print uint64_t as PRIu64.
492 2018-05-11 Mark Wielaard <mark@klomp.org>
494 * readelf.c (print_debug_macro_section): Use libdw_valid_user_form.
495 Use print_form_data for strx and sup strings.
497 2018-05-09 Mark Wielaard <mark@klomp.org>
499 * readelf.c (dwarf_line_content_description_string): New function.
500 (dwarf_line_content_description_name): Likewise.
501 (print_bytes): Likewise.
502 (print_form_data): Likewise. Based on code taken from...
503 (print_debug_macro_section): ...here. Now calls print_form_data
504 and str_offsets_base_off.
505 (print_debug_line_section): Parse DWARF5 header, directory and file
508 2018-05-12 Mark Wielaard <mark@klomp.org>
510 * addr2line.c (main): Add fflush (stdout) after handle_address ()
511 when reading from stdin.
513 2018-04-24 Mark Wielaard <mark@klomp.org>
515 * readelf.c (print_debug_aranges_section): Try elf_rawdata if no
517 (print_debug_ranges_section): Likewise.
518 (print_debug_frame_section): Likewise.
519 (print_debug_line_section): Likewise. Check for data == NULL.
520 (print_debug_loc_section): Likewise.
521 (print_debug_macinfo_section): Likewise.
522 (print_debug_macro_section): Likewise.
524 2018-04-28 Mark Wielaard <mark@klomp.org>
526 * readelf.c (print_debug): If .debug_info is needed implicitly by
527 then handle it first before handling any other debug section.
528 (parse_opt): Set implicit_debug_sections to section_info when
529 showing all debug sections.
531 2018-05-05 Mark Wielaard <mark@klomp.org>
533 * readelf.c (attr_callback): Handle DW_FORM_ref_sup4 and
534 DW_FORM_ref_sup8 as references.
536 2018-04-24 Mark Wielaard <mark@klomp.org>
538 * readelf.c (print_debug_str_section): Take raw section data. Don't
539 use dwarf_getstring, but determine start and end of string from
540 offset and section data directly.
541 (print_debug): Handle ".debug_line_str" like ".debug_str".
543 2018-04-19 Andreas Schwab <schwab@suse.de>
545 * elflint.c (valid_e_machine): Add EM_RISCV.
547 2018-04-16 Mark Wielaard <mark@klomp.org>
549 * readelf.c (print_debug_line_section). In advance_pc, advance
550 using op_addr_advance, not op_advance.
552 2018-04-14 Mark Wielaard <mark@klomp.org>
554 * readelf.c (attr_callback): Only show errors when not silent.
556 2018-03-23 Mark Wielaard <mark@klomp.org>
558 * readelf.c (attr_callback): Handle DW_FORM_strx[1234].
560 2018-03-22 Mark Wielaard <mark@klomp.org>
562 * readelf.c (attr_callback): Handle DW_FORM_addrx[1234].
564 2018-03-28 Mark Wielaard <mark@klomp.org>
566 * readelf.c (handle_sysv_hash): Break bucket chain after nchain
568 (handle_sysv_hash64): Likewise.
570 2018-03-27 Mark Wielaard <mark@klomp.org>
572 * readelf.c (attr_callback): Print dwarf_dieoffset as %PRIx64,
575 2018-03-20 Mark Wielaard <mark@klomp.org>
577 * readelf.c (attr_callback): Report error when DW_AT_decl_file or
578 DW_AT_call_file cannot be resolved.
580 2018-03-06 Mark Wielaard <mark@klomp.org>
582 * readelf.c (print_ops): Handle DW_OP_addrx, DW_OP_constx,
583 DW_OP_implicit_pointer, DW_OP_entry_value, DW_OP_const_type,
584 DW_OP_regval_type, DW_OP_deref_type, DW_OP_xderef_type,
585 DW_OP_convert, DW_OP_reinterpret.
587 2018-03-01 Mark Wielaard <mark@klomp.org>
589 * readelf.c (struct listptr): Add attr field.
590 (compare_listptr): Warn when two listptrs for the same offset have
591 different attributes.
592 (notice_listptr): Take attr as argument and add it to listptr.
593 (skip_listptr_hole): New attr argument.
594 (next_listptr_offset): New function.
595 (print_debug_ranges_section): Pass NULL attr to skip_listptr_hole.
596 (attr_callback): Handle DW_AT_GNU_locviews. Call notice_listptr with
598 (print_debug_loc_section): Keep track of which attr is associated with
599 a listptr. If the attr is DW_AT_GNU_locview print view pairs till the
602 2018-02-09 Mark Wielaard <mark@klomp.org>
604 * elflint.c (check_group): Make sure we can read a complete
605 element when iterating over the group.
607 2018-02-09 Mark Wielaard <mark@klomp.org>
609 * readelf.c (attr_callback): Handle DW_FORM_data16 as Dwarf_Block.
611 2018-02-09 Mark Wielaard <mark@klomp.org>
613 * readelf.c (print_debug_abbrev_section): Print the value of a
614 DW_FORM_implicit_const using dwarf_getabbrevattr_data.
615 (attr_callback): Handle DW_FORM_implicit_const.
617 2018-01-30 Mark Wielaard <mark@klomp.org>
619 * readelf.c (dwarf_unit_string): New function.
620 (dwarf_unit_name): Likewise.
621 (print_debug_units): Use dwarf_get_units and dwarf_cu_die instead
622 of dwarf_next_unit. Print unit type, id and subdie if available.
624 2018-02-09 Joshua Watt <JPEWhacker@gmail.com>
626 * addr2line.c (handle_address): Use FALLTHROUGH macro instead of
628 * elfcompress.c (parse_opt): Likewise.
629 * elflint.c (check_dynamic): Likewise.
630 (check_sections): Likewise.
631 (check_note_data): Likewise.
632 * objdump.c (parse_opt): Likewise.
633 * readelf.c (parse_opt): Likewise.
634 (attr_callback): Likewise.
635 (handle_auxv_note): Likewise.
636 * strings.c (parse_opt): Likewise.
637 * backtrace.c (callback_verify): Likewise.
639 2018-01-25 Mark Wielaard <mark@klomp.org>
641 * readelf.c (print_debug_ranges_section): Initialize cu to last_cu.
642 (print_debug_loc_section): Likewise.
644 2018-01-01 Mark Wielaard <mark@klomp.org>
646 * readelf.c (attr_callback): Use dwarf_form_name for unknown forms.
647 (print_debug_macro_section): Print form using dwarf_form_name.
649 2017-12-28 Mark Wielaard <mark@klomp.org>
651 * readelf.c (print_debug_units): Print DIE offset in error message
654 2017-12-18 Mark Wielaard <mark@klomp.org>
656 * readelf.c (handle_notes_data): Don't use EXIT_FAILURE in error.
657 Adjust error message depending on whether or not we got data.
659 2017-12-07 Mark Wielaard <mark@klomp.org>
661 * readelf.c (print_ops): Update data pointer and print arguments
662 to DW_OP_call2 and DW_OP_call4 as DIE offsets.
664 2017-11-29 Mark Wielaard <mark@klomp.org>
666 * readelf.c (argp_options): Add "section-groups", 'g'.
668 2017-11-29 Mark Wielaard <mark@klomp.org>
670 * readelf.c (print_debug_loc_section): Print CU base and unresolved
671 addresses. Adjust formatting.
673 2017-11-29 Mark Wielaard <mark@klomp.org>
675 * readelf.c (print_debug_ranges_section): Print CU base and unresolved
676 addresses. Adjust formatting.
678 2017-11-29 Mark Wielaard <mark@klomp.org>
680 * readelf.c (attr_callback): Set valuestr to resolved file name
681 for DW_AT_decl_file and DW_AT_call_file.
683 2017-11-29 Mark Wielaard <mark@klomp.org>
685 * readelf.c (print_debug_units): Print abbrev code after DIE tag.
687 2017-11-29 Mark Wielaard <mark@klomp.org>
689 * readelf.c (print_ops): Use only2 space for index. re-indent +5
690 for DW_OP_GNU_entry_value.
692 2017-11-21 Mark Wielaard <mark@klomp.org>
694 * readelf.c (attr_callback): Print attribute name and form in error
695 message. If only the value cannot be retrieved/resolved don't abort.
697 2017-10-03 Mark Wielaard <mark@klomp.org>
699 * readelf.c (attr_callback): Print DIE offset in error messages.
701 2017-11-03 Mark Wielaard <mark@klomp.org>
703 * readelf.c (print_ops): Handle DW_OP_GNU_variable_value. Print
704 referenced DIE as offset.
706 2017-09-10 Mark Wielaard <mark@klomp.org>
708 * ar.c (do_oper_delete): Remove DEBUG conditional check.
709 (no0print): Return bool. Check snprintf return value.
710 (do_oper_insert): Initialize elf. Remove DEBUG conditional check.
711 Check no0print calls succeed. Explicitly elf_end found elfs.
712 (do_oper_extract): Make sure we don't create an empty variable
715 2017-09-01 Mark Wielaard <mark@klomp.org>
717 * stack.c (main): Replace \v in doc string with \n\n.
718 * unstrip.c (main): Likewise.
720 2017-05-04 Ulf Hermann <ulf.hermann@qt.io>
722 * stack.c: Print pid_t using %lld.
724 2017-08-18 Ulf Hermann <ulf.hermann@qt.io>
726 * readelf.c: Hardcode the signal numbers for non-linux systems.
728 2017-07-26 Mark Wielaard <mark@klomp.org>
730 * readelf.c (print_debug_macro_section): Accept either version 4 or
731 version 5. Use DW_MACRO names instead of DW_MACRO_GNU names. Add
732 minimal support for DW_MACRO_define_sup, DW_MACRO_undef_sup,
733 DW_MACRO_import_sup, DW_MACRO_define_strx and DW_MACRO_undef_strx.
735 2017-07-26 Mark Wielaard <mark@klomp.org>
737 * readelf.c (dwarf_defaulted_string): New function.
738 (dwarf_defaulted_name): Likewise.
739 (attr_callback): Use dwarf_defaulted_name to get value of
742 2017-07-20 Mark Wielaard <mark@klomp.org>
744 * strip.c (handle_elf): Deal with data marker symbols pointing to
745 debug sections (they can be removed).
747 2017-07-14 Mark Wielaard <mark@klomp.org>
749 * strip (OPT_KEEP_SECTION): New define.
750 (options): Add documentation for remove-section. Add keep-section.
751 (struct section_pattern): New data type.
752 (keep_secs, remove_secs): New globals.
753 (add_pattern, free_sec_patterns, free_patterns, section_name_matches):
755 (main): Call free_patterns.
756 (parse_opt): Handle 'R' and OPT_KEEP_SECTION. Check remove_comment
758 (handle_elf): Handle and sanity check keep_secs and remove_secs.
760 2017-06-07 Mark Wielaard <mark@klomp.org>
762 * strip.c (handle_elf): Introduce new handle_elf boolean. Use it to
763 determine whether to create an output and/or debug file. Remove new
764 output file on error.
766 2017-06-06 Mark Wielaard <mark@klomp.org>
768 * strip.c (handle_elf): Assume e_shstrndx section can be removed.
770 2017-04-20 Ulf Hermann <ulf.hermann@qt.io>
772 * readelf.c: Include strings.h.
774 2017-04-20 Ulf Hermann <ulf.hermann@qt.io>
776 * unstrip.c: Check shnum for 0 before subtracting from it.
778 2017-04-20 Ulf Hermann <ulf.hermann@qt.io>
780 * readelf.c: Replace YESSTR and NOSTR with gettext ("yes") and
781 gettext ("no"), respectively.
783 2017-04-05 Mark Wielaard <mark@klomp.org>
785 * elflint.c (check_elf_header): Decompress all sections.
787 2017-03-28 Mark Wielaard <mark@klomp.org>
789 * elflint (check_group): Don't check if there is no flag word.
791 2017-03-27 Mark Wielaard <mark@klomp.org>
793 * elflint.c (check_elf_header): Sanity check phnum and shnum.
795 2017-03-27 Mark Wielaard <mark@klomp.org>
797 * elflint.c (check_sysv_hash): Return early if section size is
799 (check_sysv_hash64): Likewise.
800 (check_hash): Calculate expect_entsize to check section size.
802 2017-03-27 Mark Wielaard <mark@klomp.org>
804 * elflint.c (check_symtab_shndx): Check data->d_size.
806 2017-03-24 Mark Wielaard <mjw@redhat.com>
808 * elfcmp.c (main): If n_namesz == 0 then the note name data is the
810 * readelf.c (handle_notes_data): Likewise.
812 2017-03-24 Mark Wielaard <mjw@redhat.com>
814 * readelf.c (handle_gnu_hash): Check inner < max_nsyms before
815 indexing into chain array.
817 2017-02-16 Ulf Hermann <ulf.hermann@qt.io>
819 * addr2line.c: Include printversion.h
821 * elflint.c: Likewise.
823 * objdump.c: Likewise.
824 * ranlib.c: Likewise.
825 * readelf.c: Likewise.
828 * strings.c: Likewise.
830 * elfcmp.c: Include printversion.h, remove system.h include.
831 * elfcompress.c: Likewise.
832 * findtextrel.c: Likewise.
833 * unstrip.c: Likewise.
835 2017-02-14 Ulf Hermann <ulf.hermann@qt.io>
837 * nm.c: Include color.h.
838 * objdump.c: Likewise.
840 2016-12-24 Mark Wielaard <mark@klomp.org>
842 * Makefile.am (findtextrel_LDADD): Add $(libeu).
843 (addr2line_LDADD): Likewise.
844 (elfcmp_LDADD): Likewise.
845 * addr2line.c (print_version): Removed.
846 * ar.c (print_version): Likewise.
847 * elfcmp.c (print_version): Likewise.
848 * elfcompress.c (print_version): Likewise.
849 * elflint.c (print_version): Likewise.
850 * findtextrel.c (print_version): Likewise.
851 * nm.c (print_version): Likewise.
852 * objdump.c: Likewise.
853 * ranlib.c: Likewise.
854 * readelf.c: Likewise.
857 * strings.c: Likewise.
859 * unstrip.c: Likewise.
861 2016-11-17 Mark Wielaard <mjw@redhat.com>
863 * readelf.c (options): Add optional arg SECTION for symbols.
864 (symbol_table_section): New static variable.
865 (parse_opt): Set symbol_table_section on 's'.
866 (print_symtab): Filter on symbol_table_section name is set.
868 2016-11-10 Mark Wielaard <mjw@redhat.com>
870 * ar.c (write_member): Make sure tmpbuf is large enough to contain
871 a starting '/' and ending '\0' char.
872 (do_oper_insert): Likewise.
873 * arlib.c (arlib_finalize): Format tmpbuf as PRId32 decimal.
875 2016-11-02 Mark Wielaard <mjw@redhat.com>
877 * addr2line.c (handle_address): Add fallthrough comment.
878 * elfcompress.c (parse_opt): Adjust fallthrough comment.
879 * elflint.c (parse_opt): Add missing break after 'd' case.
880 (check_sections): Add fallthrough comments.
881 * objdump.c (parse_opt): Add explantion for fallthrough comment.
883 2016-10-22 Kevin Cernekee <cernekee@chromium.org>
885 * unstrip.c: Fix "invalid string offset" error caused by using the
886 unstripped .symtab with the stripped .strtab.
888 2016-10-11 Akihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>
890 * arlib.c: Remove system.h include, add libeu.h include.
891 * arlib2.c: Remove sys/param.h include.
892 * elfcompress.c: Add libeu.h include.
893 * elflint.c: Remove sys/param.h include, add libeu.h include.
895 * objdump.c: Likewise.
896 * ranlib.c: Likewise.
897 * readelf.c: Likewise.
898 * size.c: Remove sys/param.h include.
899 * strings.c: Likewise, add libeu.h include.
901 * unstrip.c: Likewise.
903 2016-10-06 Mark Wielaard <mjw@redhat.com>
905 * strip.c (handle_elf): Don't remove real symbols from allocated
908 2016-08-25 Mark Wielaard <mjw@redhat.com>
910 * strip.c (handle_elf): Recompress with ELF_CHF_FORCE.
912 2016-08-06 Mark Wielaard <mjw@redhat.com>
914 * strip.c (handle_elf): Uncompress and recompress relocation target
915 section if necessary.
917 2016-07-08 Mark Wielaard <mjw@redhat.com>
919 * Makefile.am (strip_LDADD): Add libdw.
920 * elfcompress.c (process_file): Use dwelf_strtab functions instead of
922 * strip.c (handle_elf): Likewise.
923 * unstrip.c (new_shstrtab): Likewise.
925 2016-07-06 Mark Wielaard <mjw@redhat.com>
927 * elf32-i386.script, i386_ld.c, ld.c, ld.h, ldgeneric.c, ldlex.l,
928 ldscript.y, libld_elf_i386.map, none_ld.c, sectionhash.c,
929 sectionhash.h, symbolhash.c, symbolhash.h, unaligned.h,
930 versionhash.c, versionhash.h, xelf.h: Removed.
931 * Makefile.am (YACC): Removed.
932 (AM_YFLAGS): Removed.
933 (AM_LFLAGS): Removed.
934 (native_ld): Removed.
936 (bin_PROGRAMS): Removed ld.
938 (ld_SOURCES): Removed.
939 (noinst_LIBRARIES): Only libar.a.
940 (EXTRA_DIST): Just arlib.h and debugpred.h.
942 (ld_LDFLAGS): Removed.
944 (ldscript.h): Removed.
946 (CLEANFILES): Just *.gconv.
947 (MAINTAINERCLEANFILES): Removed.
949 2016-07-06 Mark Wielaard <mjw@redhat.com>
951 * unstrip.c (copy_elided_sections): Use unstripped_strent[] from
952 index zero, instead of one.
954 2016-06-28 Richard Henderson <rth@redhat.com>
956 * elflint.c (valid_e_machine): Add EM_BPF.
958 2016-04-11 David Abdurachmanov <davidlt@cern.ch>
960 * elfcmp.c (main): Fix self-comparison error with GCC 6.
962 2016-03-21 Mark Wielaard <mjw@redhat.com>
964 * nm.c (show_symbols): Check for malloc size argument overflow.
966 2016-02-13 Mark Wielaard <mjw@redhat.com>
968 * readelf.c (print_scngrp): Call error when gelf_getshdr fails.
969 (print_symtab): Likewise.
970 (handle_hash): Likewise.
971 (dump_data_section): Print a warning if decompressing fails.
972 (print_string_section): Likewise.
974 2016-02-13 Mark Wielaard <mjw@redhat.com>
976 * elfcompress.c (parse_opt): Don't fallthrough after processing -q.
978 2016-02-12 Mark Wielaard <mjw@redhat.com>
980 * strip.c (handle_elf): Correct elf_assert shndxdata check.
982 2016-02-09 Mark Wielaard <mjw@redhat.com>
984 * readelf.c (read_encoded): Move up.
985 (print_cfa_program): Add encoding argument. Use it for read_encoded
986 when reading DW_CFA_set_loc op.
987 (print_debug_frame_section): Pass fde_encoding to print_cfa_program.
989 2016-02-09 Mark Wielaard <mjw@redhat.com>
991 * elflint.c (compare_hash_gnu_hash): Check hash sh_entsize against
992 sizeof (Elf64_Xword). Correct invalid sh_entsize error message
993 section idx and name.
995 2016-01-13 Mark Wielaard <mjw@redhat.com>
997 * elflint.c (check_elf_header): Recognize ELFOSABI_FREEBSD.
999 2016-01-08 Mark Wielaard <mjw@redhat.com>
1001 * elfcompress.c (compress_section): Use %zu to print size_t.
1002 * readelf.c (print_shdr): Use %zx to print size_t.
1004 2015-12-16 Mark Wielaard <mjw@redhat.com>
1006 * elfcompress.c: New file.
1007 * Makefile.am (bin_PROGRAMS): Add elfcompress.
1008 (elfcompress_LDADD): New variable.
1010 2015-12-18 Mark Wielaard <mjw@redhat.com>
1012 * elflint.c (section_flags_string): Add NEWFLAG COMPRESSED.
1013 (check_sections): SHF_COMPRESSED can be on any special section.
1014 SHF_COMPRESSED is a valid section flag. SHF_COMPRESSED cannot
1015 be used together with SHF_ALLOC or with SHT_NOBITS. Should have
1018 2015-10-20 Mark Wielaard <mjw@redhat.com>
1020 * readelf.c (options): Expand -z help text.
1021 (dump_data_section): Check whether we need and can decompress section
1022 data and call elf_rawzdata if so,
1023 (print_string_section): Likewise.
1024 (elf_contains_chdrs): New function.
1025 (process_elf_file): Rename print_unrelocated to print_unchanged,
1026 use elf_contains_chdrs.
1027 (print_scngrp): Check whether section is compressed before use.
1028 (print_symtab): Likewise.
1029 (handle_hash): Likewise.
1031 2015-10-16 Mark Wielaard <mjw@redhat.com>
1033 * readelf.c (argp_option): Describe --decompress,-z.
1034 (print_decompress): New bool.
1035 (parse_opt): Handle -z.
1036 (elf_ch_type_name): New function.
1037 (print_shdr): Print section compress information.
1039 2015-12-31 Mark Wielaard <mjw@redhat.com>
1041 * elflint.c (check_symtab): Add _edata and _end (plus extra underscore
1042 variants) to to the list of possibly dangling symbols.
1044 2015-12-02 Mark Wielaard <mjw@redhat.com>
1046 * nm.c (process_file): Accept fd and pass it on.
1047 (handle_elf): Likewise.
1048 (find_no_debuginfo): New.
1049 (struct getdbg): Likewise.
1050 (getdbg_dwflmod): Likewise.
1051 (show_symbols): Take fd. If the file is ET_REL use libdwfl to get
1052 the relocated Dwarf.
1054 2015-12-02 Mark Wielaard <mjw@redhat.com>
1056 * nm.c (get_local_names): Check for duplicates in local_root tree.
1058 2015-12-02 Mark Wielaard <mjw@redhat.com>
1060 * unstrip.c (struct data_list): New.
1061 (new_data_list): Likewise.
1062 (record_new_data): Likewise.
1063 (free_new_data): Likewise.
1064 (adjust_relocs): Call record_new_data.
1065 (add_new_section_symbols): Likewise.
1066 (copy_elided_sections): Call free_new_data.
1068 2015-12-01 Mark Wielaard <mjw@redhat.com>
1070 * elfcmp.c (main): Close ebl1 and ebl2 backends.
1072 2015-10-16 Mark Wielaard <mjw@redhat.com>
1074 * Makefile.am [BUILD_STATIC](libdw): Add -lz.
1075 [BUILD_STATIC](libelf): Likewise.
1077 2015-10-16 Mark Wielaard <mjw@redhat.com>
1079 * elflint.c (check_symtab): Don't check TLS symbol value against TLS
1080 phdr offset in debuginfo files.
1081 (check_sections): Don't try to match section offsets to phdrs offsets
1084 2015-10-16 Mark Wielaard <mjw@redhat.com>
1086 * elflint.c (check_reloc_shdr): Reject only desthdrs if they have both
1087 SHF_MERGE and SHF_STRINGS set.
1089 2015-10-13 Jose E. Marchesi <jose.marchesi@oracle.com>
1091 * elflint.c (check_sections): Do not rely on
1092 ebl_check_special_section when checking debuginfo files. Also
1093 check that the type of WE sections in debuginfo files is NOBITS.
1095 2015-10-13 Mark Wielaard <mjw@redhat.com>
1097 * elflint.c (check_program_header): Check relro flags are a subset
1098 of the load segment if they don't fully overlap.
1100 2015-10-07 Mark Wielaard <mjw@redhat.com>
1102 * Makefile.am (ldlex_no_Wstack_usage): New.
1103 * ldlex.l ([RWX]): Make cnt unsigned.
1105 2015-10-09 Josh Stone <jistone@redhat.com>
1107 * elflint.c (main): Replace stat64 and fstat64 with stat and fstat.
1108 * readelf.c (process_file): Likewise.
1109 (process_elf_file): Replace off64_t with off_t.
1110 * findtextrel.c (process_file): Replace open64 with open.
1111 * ld.c (main): Replace sizeof (off64_t) with 8.
1112 * strings.c: Replace off64_t with off_t throughout.
1113 (main): Replace stat64 and fstat64 with stat and fstat.
1114 (map_file): Replace mmap64 with mmap.
1115 (read_block): Likewise, and replace lseek64 with lseek.
1116 * strip.c (handle_elf): Replace ftruncate64 with ftruncate.
1117 (process_file): Replace stat64 and fstat64 with stat and fstat.
1118 * unstrip.c (parse_opt): Replace stat64 with stat.
1119 (handle_file): Replace open64 with open.
1120 (open_file): Likewise.
1122 2015-10-08 Chih-Hung Hsieh <chh@google.com>
1124 * ld.c (determine_output_format): Move recursive nested
1125 function "try" to file scope.
1127 2015-10-04 Mark Wielaard <mjw@redhat.com>
1129 * strip.c (handle_elf): Only sanity check section symbols to not
1130 kept discarded sections if we are creating a debug file.
1132 2015-10-07 Mark Wielaard <mjw@redhat.com>
1134 * unstrip.c (MAX): Removed.
1135 (find_alloc_sections_prelink): Allocate exact amount of bytes for
1138 2015-10-05 Chih-Hung Hsieh <chh@google.com>
1140 * unstrip.c (find_alloc_sections_prelink): Do not allocate
1141 on stack union types with variable length arrays; use xmalloc
1142 for such dynamic sized objects.
1143 * readelf.c (handle_core_item): Likewise, but use alloca
1144 for small variable size data object and add assert(count < 128).
1146 2015-10-05 Josh Stone <jistone@redhat.com>
1148 * Makefile.am (libld_elf_i386.so): Add AM_V_CCLD silencer.
1149 (.deps/none_ld.Po): Always silence the dummy command.
1150 (make-debug-archive): Add AM_V_GEN and AM_V_at silencers.
1152 2015-10-02 Mark Wielaard <mjw@redhat.com>
1154 * unstrip.c (copy_elided_sections): Use SH_INFO_LINK_P, not just
1157 2015-10-02 Mark Wielaard <mjw@redhat.com>
1159 * strip.c (handle_elf): Don't move around allocated NOBITS sections.
1160 Don't just mark the section header string table as unused.
1161 * unstrip.c (copy_elided_sections): Add header names to strtab if
1162 shstrndx equals the symtab strtabndx.
1164 2015-09-22 Mark Wielaard <mjw@redhat.com>
1166 * strip.c (cleanup_debug): Remove old-style function definitions.
1168 2015-09-09 Chih-Hung Hsieh <chh@google.com>
1170 * readelf.c (print_debug_exception_table): Initialize variable before
1171 it is used, because compiler does not know that error never returns.
1172 (dump_arhive_index): Likewise.
1174 2015-09-04 Chih-Hung Hsieh <chh@google.com>
1176 * elflint.c (check_group): Replace %Z length modifier with %z.
1177 (check_note_data): Likewise.
1178 * findtextrel.c (process_file): Likewise.
1179 * readelf.c (handle_dynamic): Likewise.
1180 (handle_symtab): Likewise.
1181 (handle_verneed): Likewise.
1182 (handle_verdef): Likewise.
1183 (handle_versym): Likewise.
1184 (print_hash_info): Likewise.
1185 (print_decoded_aranges_section): Likewise.
1186 (print_debug_aranges_section): Likewise.
1187 (print_debug_line_section): Likewise.
1188 (hex_dump): Likewise.
1189 (dump_data_section): Likewise.
1190 (print_string_section): Likewise.
1191 (dump_archive_index): Likewise.
1192 * unstrip.c (adjust_relocs): Likewise.
1193 (collect_symbols): likewise.
1194 (get_section_name): Likewise.
1195 (find_alloc_sections_prelink): Likewise.
1196 (copy_elided_sections): Likewise.
1197 * ldscript.y (add_id_list): Add missing '%s'.
1199 2015-09-03 Mark Wielaard <mjw@redhat.com>
1201 * readelf.c (handle_core_item): Handle right shift >= 32 bits.
1203 2015-08-11 Mark Wielaard <mjw@redhat.com>
1205 * elflint.c (check_sections): When gnuld and a NOBITS section falls
1206 inside a segment make sure any ELF file contents is zero.
1208 2015-07-29 Mark Wielaard <mjw@redhat.com>
1210 * unstrip.c (sections_flags_match): New function.
1211 (sections_match): Use sections_flags_match.
1212 (find_alloc_sections_prelink): Only clear matched sections if there
1214 (copy_elided_sections): Add SHF_INFO_LINK to shdr_mem.sh_flags if
1217 2015-06-27 Pino Toscano <toscano.pino@tiscali.it>
1219 * src/strings.c: Define MAP_POPULATE if not defined already.
1221 2015-06-27 Mark Wielaard <mjw@redhat.com>
1223 * nm.c (show_symbols): First call elf_getdata, then allocate memory.
1225 2015-06-18 Mark Wielaard <mjw@redhat.com>
1227 * findtextrel.c (process_file): Free segments after use.
1229 2015-06-18 Mark Wielaard <mjw@redhat.com>
1231 * readelf.c (print_phdr): Make sure phdr2_mem lifetime/scope equals
1234 2015-06-18 Mark Wielaard <mjw@redhat.com>
1236 * readelf.c (handle_gnu_hash): Free lengths on invalid_data.
1238 2015-06-18 Mark Wielaard <mjw@redhat.com>
1240 * elflint.c (check_symtab): Only check the PT_TLS phdr if it actually
1241 exists. Warn otherwise.
1243 2015-06-18 Mark Wielaard <mjw@redhat.com>
1245 * nm.c (show_symbols): Check sizeof (sym_mem[0]), not GElf_Sym to
1246 known whether or not we stack allocated memory.
1248 2015-06-18 Mark Wielaard <mjw@redhat.com>
1250 * strings.c (readelf): Use "<unknown>" if we cannot retrieve section
1253 2015-06-09 Mark Wielaard <mjw@redhat.com>
1255 * addr2line.c (print_dwarf_function): Always free scopes before
1258 2015-06-09 Mark Wielaard <mjw@redhat.com>
1260 * strip.c (handle_ar): Mark as unused.
1261 (process_file): Produce an error when trying to handle an ar.
1263 2015-05-30 Mark Wielaard <mjw@redhat.com>
1265 * elfcmp.c (main): Only call memcmp when d_size != 0.
1267 2015-05-23 Mark Wielaard <mjw@redhat.com>
1269 * Makefile.am: Define ldgeneric, readelf, nm, size, strip, elflint,
1270 findtextrel, elfcmp objdump, ranlib, ar and unstrip no_Wstack_usage.
1272 2015-05-21 Mark Wielaard <mjw@redhat.com>
1274 * addr2line.c (handle_address): Set scopes to NULL after free.
1276 2015-05-20 Mark Wielaard <mjw@redhat.com>
1278 * addr2line.c (OPT_PRETTY): New constant define.
1279 (argp_option): Add "pretty-print".
1280 (pretty): New static bool.
1281 (parse_opt): Set pretty.
1282 (print_dwarf_function): Adjust output when pretty is set.
1283 (print_addrsym): Likewise.
1284 (handle_address): Likewise.
1286 2015-05-20 Mark Wielaard <mjw@redhat.com>
1288 * Makefile.am (addr2line_LDADD): Add demanglelib.
1289 * addr2line.c (argp_option): Move demangle under output format.
1290 (demangle): New static bool.
1291 (demangle_buffer_len): New static size_t.
1292 (demangle_buffer): New static char *.
1293 (main): free demangle_buffer.
1294 (parse_opt): Set demangle.
1295 (symname): New static function.
1296 (get_diename): Use symname.
1297 (print_dwarf_function): Likewise.
1298 (print_addrsym): Likewise.
1299 (handle_address): Likewise.
1301 2015-05-20 Mark Wielaard <mjw@redhat.com>
1303 * addr2line.c (argp_option): Add "addresses", 'a'.
1304 (print_addresses): New static bool.
1305 (parse_opt): Set print_addresses.
1306 (get_addr_width): New static function.
1307 (handle_address): Print address if print_addresses is true.
1309 2015-05-20 Mark Wielaard <mjw@redhat.com>
1311 * addr2line.c (handle_address): Call strtoumax with base 16. Make
1312 sure all input has been processed.
1314 2015-05-20 Mark Wielaard <mjw@redhat.com>
1316 * addr2line (argp_option): Group 'section' under "Input format
1319 2015-05-12 Mark Wielaard <mjw@redhat.com>
1321 * strip.c (debug_fd): New static variable.
1322 (tmp_debug_fname): Likewise.
1323 (cleanup_debug): New function using the above to clean up temporary
1325 (INTERNAL_ERROR): Call cleanup_debug.
1326 (handle_elf): Use debug_fd and tmp_debug_fname statics and call
1327 cleanup_debug before any error. Use output_fname instead of fname in
1328 error messages when it exists (-o was given). SHT_NOBITS sections
1329 can also be moved freely even if SHF_ALLOC is set. Add various
1330 sanity checks. Use elf_assert instead of plain assert.
1332 2015-05-08 Mark Wielaard <mjw@redhat.com>
1334 * nm.c (show_symbols): Call gelf_fsize with EV_CURRENT.
1335 * strip.c (handle_elf): Likewise.
1337 2015-05-06 Mark Wielaard <mjw@redhat.com>
1339 * elflint.c (check_gnu_hash): Return early when 2nd hash function
1340 shift too big. Check there is enough data available. Make sure
1341 bitmask_words is not zero.
1342 (check_verdef): Use Elf64_Word for shdr->sh_info cnt.
1343 (check_verneed): Likewise.
1344 (check_attributes): Break when vendor name isn't terminated.
1345 Add overflow check for subsection_len.
1347 2015-05-05 Mark Wielaard <mjw@redhat.com>
1349 * nm.c (show_symbols): Handle dwarf_linesrc returning NULL.
1351 2015-05-04 Max Filippov <jcmvbkbc@gmail.com>
1353 * ar.c (do_oper_extract): Replace struct timeval with struct timespec
1354 and futimes with futimens.
1355 * strip.c (process_file): Replace struct timeval with struct timespec.
1356 (handle_elf, handle_ar): Replace struct timeval with struct timespec
1357 in prototype. Replace futimes with futimens.
1359 2015-05-04 Max Filippov <jcmvbkbc@gmail.com>
1361 * addr2line.c (main): Drop mtrace() call and #include <mcheck.h>.
1365 * objdump.c: Likewise.
1366 * ranlib.c: Likewise.
1368 * strip.c: Likewise.
1369 * unstrip.c: Likewise.
1371 2015-05-04 Anthony G. Basile <blueness@gentoo.org>
1373 * Makefile.am (readelf_LDADD, nm_LDADD, size_LDADD, strip_LDADD)
1374 (ld_LDADD, elflint_LDADD, findtextrel_LDADD, addr2line_LDADD)
1375 (elfcmp_LDADD, objdump_LDADD, ranlib_LDADD, strings_LDADD)
1376 (ar_LDADD, unstrip_LDADD, stack_LDADD): Append $(argp_LDADD).
1378 2015-03-22 Mark Wielaard <mjw@redhat.com>
1380 * readelf.c (print_debug_frame_section): Cast start to Dwarf_Off
1381 before subtracting cie_id. And cast cie_offset to Dwarf_Off before
1384 2015-03-22 Mark Wielaard <mjw@redhat.com>
1386 * readelf.c (print_gdb_index_section): Check all offsets used
1387 against section d_size.
1389 2015-03-17 Mark Wielaard <mjw@redhat.com>
1391 * readelf.c (print_debug): Don't return, but always use dummy_dbg.
1393 2015-03-17 Mark Wielaard <mjw@redhat.com>
1395 * readelf.c (print_gdb_index_section): Add overflow checking for
1398 2015-03-14 Mark Wielaard <mjw@redhat.com>
1400 * nm.c (INTERNAL_ERROR): Remove __DATE__.
1401 * objdump.c (INTERNAL_ERROR): Likewise.
1402 * size.c (INTERNAL_ERROR): Likewise.
1403 * strip.c (INTERNAL_ERROR): Likewise.
1405 2015-03-18 Petr Machata <pmachata@redhat.com>
1407 * readelf.c (dwarf_tag_string, dwarf_attr_string)
1408 (dwarf_form_string, dwarf_lang_string, dwarf_inline_string)
1409 (dwarf_encoding_string, dwarf_access_string)
1410 (dwarf_visibility_string, dwarf_virtuality_string)
1411 (dwarf_identifier_case_string, dwarf_calling_convention_string)
1412 (dwarf_ordering_string, dwarf_discr_list_string)
1413 (dwarf_locexpr_opcode_string): Adjust uses of know-dwarf.h macros
1414 to match the API changes.
1416 2015-03-09 Mark Wielaard <mjw@redhat.com>
1418 * elflint.c (compare_hash_gnu_hash): Correct gnu_symbias usage.
1420 2015-01-03 Mark Wielaard <mjw@redhat.com>
1422 * elfcmp (main): Check section name is not NULL. Check sh_entsize
1423 is not zero for symbol tables. Check phdrs are not NULL.
1424 (search_for_copy_reloc): Check sh_entsize is not zero.
1426 2014-12-30 Mark Wielaard <mjw@redhat.com>
1428 * elflint.c (check_scn_group): Check d_buf and name are not NULL.
1429 (is_rel_dyn): Check d is not NULL. Check shdr->sh_entsize is not
1431 (check_dynamic): Check strshdr is not NULL. Check d_tag is positive.
1432 (check_symtab_shndx): Check symshdr and data->d_buf are not NULL.
1433 Check shdr and symshdr sh_entsize are not zero.
1434 (check_gnu_hash): Make sure maskidx is smaller than bitmask_words.
1435 Check symshdr->sh_entsize is not zero. Check data->d_buf is not
1437 (compare_hash_gnu_hash): Check sections d_buf are not NULL.
1438 Check section data is large enough. Use gnu_symbias.
1439 (check_group): Check section val is valid.
1440 (has_copy_reloc): Check sh_entsize is not zero.
1441 (check_versym): Likewise.
1442 (unknown_dependency_p): Likewise.
1443 (check_verneed): Break on invalid ref or offset. Don't assert.
1444 Report error when next offset is zero, but more vers expected.
1445 (check_verdef): Likewise.
1446 (check_attributes): Make sure d_buf is not NULL.
1447 (check_note): Likewise.
1448 (check_note_section): Likewise.
1449 (check_program_header): Make sure section name is not NULL.
1451 2014-12-26 Mark Wielaard <mjw@redhat.com>
1453 * strings.c (read_elf): Produce error when section data falls outside
1456 2014-12-26 Mark Wielaard <mjw@redhat.com>
1458 * nm.c (show_symbols): Guard against divide by zero in error check.
1459 Add section index number in error message.
1461 2014-12-26 Mark Wielaard <mjw@redhat.com>
1463 * nm.c (handle_ar): Skip over /SYM64/ entries.
1465 2014-12-26 Mark Wielaard <mjw@redhat.com>
1467 * nm.c (handle_ar): Break on arsym with invalid offset.
1469 2014-12-20 Mark Wielaard <mjw@redhat.com>
1471 * readelf.c (print_debug_macinfo_section): Mark cus sentinel files
1472 as -1 non-existent. Check macoff against sentinel cus.
1474 2014-12-20 Mark Wielaard <mjw@redhat.com>
1476 * readelf.c (print_debug_exception_table): Add max_action overflow
1477 check. Check action_table_end before reading slib128. Check
1478 max_ar_filter underflow.
1480 2014-12-18 Ulrich Drepper <drepper@gmail.com>
1482 * Makefile.am: Suppress output of textrel_check command.
1484 2014-12-17 Mark Wielaard <mjw@redhat.com>
1486 * readelf.c (print_cfa_program): Add bounds check before each op that
1487 takes at least one argument.
1489 2014-12-16 Mark Wielaard <mjw@redhat.com>
1491 * readelf.c (print_decoded_line_section): Print dwarf_errmsg if
1492 dwarf_onesrcline or dwarf_linesrc fails.
1494 2014-12-16 Mark Wielaard <mjw@redhat.com>
1496 * readelf.c (print_debug_line_section): Correct overflow check for
1498 (print_debug_aranges_section): Correct overflow check for length.
1500 2014-12-15 Mark Wielaard <mjw@redhat.com>
1502 * readelf.c (notice_listptr): Return false if offset doesn't fit
1504 (attr_callback): Warn if loclist or rangelist offset doesn't fit.
1506 2014-12-15 Mark Wielaard <mjw@redhat.com>
1508 * readelf.c (print_ops): Don't assert when addr_size or ref_size
1509 is not 4 or 8, just report invalid data.
1511 2014-12-15 Mark Wielaard <mjw@redhat.com>
1513 * readelf.c (print_gdb_index_section): Add more bounds checks.
1515 2014-12-15 Mark Wielaard <mjw@redhat.com>
1517 * readelf.c (print_debug_line_section): Check there is enough room
1518 for DW_LNE_set_address argument. Make sure there is enough room
1519 for the the initial unit_length.
1521 2014-12-14 Mark Wielaard <mjw@redhat.com>
1523 * elflint.c (check_attributes): Call get_uleb128 with end pointer.
1524 * readelf.c (print_attributes): Likewise.
1525 (print_ops): Likewise and also for get_sleb128.
1526 (print_cfa_program): Likewise and add more readp bounds checks.
1527 (read_encoded): Likewise.
1528 (print_debug_frame_section): Likewise.
1529 (print_debug_line_section): Likewise.
1530 (print_debug_macinfo_section): Likewise.
1531 (print_debug_macro_section): Likewise.
1532 (print_debug_exception_table): Likewise.
1534 2014-12-16 Mark Wielaard <mjw@redhat.com>
1536 * elfcmp.c (compare_Elf32_Word): Make sure (unsigned) Elf32_Word
1537 difference doesn't wrap around before returning as int.
1539 2014-12-11 Mark Wielaard <mjw@redhat.com>
1541 * readelf.c (print_debug_exception_table): Check TType base offset
1542 and Action table are sane.
1544 2014-12-11 Mark Wielaard <mjw@redhat.com>
1546 * readelf.c (print_debug_frame_section): Check number of augmentation
1549 2014-12-09 Mark Wielaard <mjw@redhat.com>
1551 * readelf.c (handle_file_note): Check count fits data section and
1552 doesn't overflow fptr.
1554 2014-12-08 Mark Wielaard <mjw@redhat.com>
1556 * readelf.c (print_debug_exception_table): Report invalid data if
1557 action table doesn't immediately follow call site table.
1559 2014-12-10 Josh Stone <jistone@redhat.com>
1561 * addr2line.c (get_diename): New, get linkage_name or name.
1562 * addr2line.c (print_dwarf_function): Use get_diename.
1563 * addr2line.c (handle_address): Likewise.
1564 * addr2line.c (print_diesym): Removed.
1566 2014-12-10 Josh Stone <jistone@redhat.com>
1568 * addr2line.c (handle_address): Find the proper inline parents.
1570 2014-12-07 Mark Wielaard <mjw@redhat.com>
1572 * readelf.c (print_debug_line_section): max_ops_per_instr cannot
1575 2014-12-07 Mark Wielaard <mjw@redhat.com>
1577 * readelf.c (print_ops): Handle zero ref_size for DW_OP_call_ref
1578 and DW_OP_GNU_implicit_pointer.
1580 2014-12-04 Mark Wielaard <mjw@redhat.com>
1582 * objdump.c (show_relocs_x): Make sure destshdr exists.
1583 (show_relocs_rel): Don't rely on shdr->sh_entsize, use gelf_fsize.
1584 (show_relocs_rela): Likewise.
1585 (show_relocs): Make sure destshdr, symshdr and symdata exists.
1587 2014-11-30 Mark Wielaard <mjw@redhat.com>
1589 * readelf.c (handle_sysv_hash64): Fix overflow check.
1591 2014-11-28 Mark Wielaard <mjw@redhat.com>
1593 * readelf.c (handle_relocs_rel): Don't reuse destshdr to store
1594 section header of a relocation against a STT_SECTION symbol. Use
1595 a new local variable secshdr.
1596 (handle_relocs_rela): Likewise.
1598 2014-11-26 Mark Wielaard <mjw@redhat.com>
1600 * readelf.c (print_debug_aranges_section): Cast Dwarf_Word length
1601 to ptrdiff_t for comparison.
1603 2014-11-24 Mark Wielaard <mjw@redhat.com>
1605 * readelf.c (print_debug_line_section): Check line_range is not zero
1608 2014-11-23 Mark Wielaard <mjw@redhat.com>
1610 * readelf.c (print_debug_aranges_section): Check length to catch
1613 2014-11-21 Mark Wielaard <mjw@redhat.com>
1615 * readelf.c (print_attributes): Guard against empty section.
1616 Document attribute format. Break when vendor name isn't terminated.
1617 Add overflow check for subsection_len. Handle both gnu and non-gnu
1620 2014-11-22 Mark Wielaard <mjw@redhat.com>
1622 * elflint.c (check_sections): Call ebl_bss_plt_p without ehdr.
1623 * findtextrel.c (process_file): Use elf_getphdrnum.
1624 * readelf.c (process_elf_file): Remove redundant ehdr->e_phoff check.
1625 (print_phdr): Check phnum.
1626 * size.c (show_segments): Use elf_getphdrnum.
1627 * strip.c (handle_elf): Likewise.
1628 * unstrip.c (copy_elf): Likewise.
1629 (copy_elided_sections): Likewise.
1630 (handle_file): Likewise.
1632 2014-11-18 Mark Wielaard <mjw@redhat.com>
1634 * readelf.c (print_cfa_program): Fix sanity check of DW_FORM_block
1637 2014-11-17 Mark Wielaard <mjw@redhat.com>
1639 * readelf.c (handle_verneed): Check vna_next and vn_next exist.
1640 (handle_verdef): Check vda_next and vd_next exist.
1641 (handle_versym): Check vd_next, vna_next and vn_next exist.
1642 Check vername and filename are not NULL before use.
1644 2014-11-17 Mark Wielaard <mjw@redhat.com>
1646 * elfcmp.c (main): Check section names are NULL before use.
1647 * objdump.c (section_match): Likewise.
1648 * size.c (show_sysv): Likewise.
1650 2014-11-17 Mark Wielaard <mjw@redhat.com>
1652 * readelf.c (print_debug_frame_section): Warn if ptr_size is not 4
1653 or 8 instead of just calling print_cfa_program.
1655 2014-11-16 Mark Wielaard <mjw@redhat.com>
1657 * readelf (process_elf_file): Set phnum to zero if there aren't
1658 actually any pheaders.
1659 (print_phdr): Check there actually is a phdr.
1661 2014-11-16 Mark Wielaard <mjw@redhat.com>
1663 * readelf.c (print_cfa_program): Check block len before calling
1666 2014-11-14 Mark Wielaard <mjw@redhat.com>
1668 * readelf.c (print_debug_frame_section): Sanity Check CIE
1669 unit_length and augmentationlen.
1671 2014-11-14 Mark Wielaard <mjw@redhat.com>
1673 * readelf.c (handle_versym): Check def == NULL before use.
1675 2014-11-08 Mark Wielaard <mjw@redhat.com>
1677 * readelf.c (handle_versym): Initialize vername and filename array
1680 2014-11-07 Mark Wielaard <mjw@redhat.com>
1682 * readelf.c (handle_sysv_hash): Sanity check section contents.
1683 (handle_sysv_hash64): Likewise.
1684 (handle_gnu_hash): Likewise.
1686 2014-09-14 Petr Machata <pmachata@redhat.com>
1688 * readelf.c (handle_relocs_rela): Typo fix, test DESTSHDR properly.
1690 2014-09-12 Petr Machata <pmachata@redhat.com>
1692 * readelf.c (encoded_ptr_size): In the switch statement, change
1693 magic constants 3 and 4 to DW_EH_PE_* counterparts. Still accept
1694 0. Print diagnostic for anything else.
1696 2014-08-25 Josh Stone <jistone@redhat.com>
1698 * Makefile.am: Prevent premature @AR@ replacement in a sed expression.
1700 2014-07-04 Menanteau Guy <menantea@linux.vnet.ibm.com>
1701 Mark Wielaard <mjw@redhat.com>
1703 * elflint (check_symtab): Add ".TOC." to the list of possibly
1704 dangling symbols because of sourceware PR13621.
1706 2014-06-14 Mark Wielaard <mjw@redhat.com>
1708 * elflint (check_symtab): Use ebl_func_addr_mask on st_value.
1710 2014-05-27 Mark Wielaard <mjw@redhat.com>
1712 * readelf.c (print_debug): Skip section if name is NULL.
1714 2014-05-26 Mark Wielaard <mjw@redhat.com>
1716 * readelf.c (handle_relocs_rela): Print header like handle_relocs_rel
1717 does, when sh_info == 0.
1719 2014-05-26 Mark Wielaard <mjw@redhat.com>
1721 * unstrip.c (find_alloc_sections_prelink): Allow non-split .bss
1722 section when sh_size of the original and undo .bss section are equal.
1724 2014-05-26 Mark Wielaard <mjw@redhat.com>
1726 * unstrip.c (options): Add --force, -F.
1727 (struct arg_info): Add bool force.
1728 (parse_opt): Handle 'F', set force.
1729 (handle_explicit_files): Add force argument, add warn function,
1730 separate check ehdr field checks, use warn.
1731 (handle_dwfl_module): Add force argument, pass on to
1732 handle_explicit_files.
1733 (handle_output_dir_module): Add force argument, pass on to
1735 (handle_implicit_modules): Pass info->force to handle_dwfl_module and
1736 handle_output_dir_module.
1737 (main): Pass info.force to handle_explicit_files.
1739 2014-05-19 Mark Wielaard <mjw@redhat.com>
1741 * elflint.c (check_reloc_shdr): Check ebl_check_reloc_target_type.
1743 2014-05-01 Mark Wielaard <mjw@redhat.com>
1745 * readelf.c (find_no_debuginfo): Call dwfl_standard_find_debuginfo
1746 if looking for alternate debug file.
1748 2014-04-11 Mark Wielaard <mjw@redhat.com>
1750 * Makefile.am (AM_CPPFLAGS): Add -I libdwelf.
1752 2014-04-22 Mark Wielaard <mjw@redhat.com>
1754 * readelf.c (handle_core_item): Make sure variable length array
1755 contains at least enough space for terminating zero char.
1757 2014-04-22 Mark Wielaard <mjw@redhat.com>
1759 * readelf.c (print_gdb_index_section): Use unsigned int for 31 bits
1762 2014-03-13 Mark Wielaard <mjw@redhat.com>
1764 * Makefile.am: Remove no_mudflap.os. Remove libmudflap from all
1766 * strings.c (process_chunk): Remove _MUDFLAP condition.
1768 2014-04-09 Mark Wielaard <mjw@redhat.com>
1770 * readelf.c (print_debug_aranges_section): Don't get the raw section
1771 data, use the possibly decompressed .[z]debug sectiondata.
1772 (print_debug_ranges_section): Likewise.
1773 (print_debug_frame_section): Likewise.
1774 (print_debug_line_section): Likewise.
1775 (print_debug_loc_section): Likewise.
1776 (print_debug_macinfo_section): Likewise.
1777 (print_debug_macro_section): Likewise.
1779 2014-04-10 Mark Wielaard <mjw@redhat.com>
1781 * readelf.c (buf_read_ulong): Pass actual long size to convert.
1783 2014-03-05 Mark Wielaard <mjw@redhat.com>
1785 * readelf.c (attr_callback): Print DW_FORM_sdata values as signed
1788 2014-02-24 Mark Wielaard <mjw@redhat.com>
1790 * readelf (print_phdr): Check there is a SHT_PROGBITS section at the
1791 offset given by p_offsets for a PT_INTERP segment before trying to
1792 display the interpreter string.
1794 2014-02-07 Mark Wielaard <mjw@redhat.com>
1796 * readelf.c (print_phdr): Check phdr->p_filesz and make sure
1797 interpreter string is zero terminated before calling printf.
1799 2014-01-22 Mark Wielaard <mjw@redhat.com>
1801 * Makefile.am (nm_no_Wformat): Removed.
1802 (size_no_Wformat): Likewise.
1803 (strings_no_Wformat): Likewise.
1804 (addr2line_no_Wformat): Likewise.
1805 * size.c (show_sysv): Use fmtstr directly as literal in printf.
1806 (show_sysv_one_line): Likewise.
1807 * strings.c (locfmt): Removed.
1808 (radix): New static enum.
1809 (parse_opt): Set radix, not locfmt.
1810 (process_chunk_mb): Use fmtstr directly as literal in printf based
1812 (process_chunk): Likewise.
1813 * nm.c (show_symbols_sysv): Use fmtstr directly as literal in printf.
1814 (show_symbols_bsd): Likewise.
1815 (show_symbols_posix): Likewise.
1817 2014-01-21 Mark Wielaard <mjw@redhat.com>
1819 * stack.c (show_inlines): New static boolean.
1820 (print_frame): New function split out from...
1821 (print_frames): ..here. If show_inlines is true and we found a
1822 DIE for the frame address, call print_inline_frames otherwise
1823 call print_frame. Keep track of and track frame_nr.
1824 (print_inline_frames): New function.
1825 (parse_opt): Handle '-i'.
1826 (main): Add 'i' to options.
1828 2014-01-27 Mark Wielaard <mjw@redhat.com>
1830 * stack.c (maxframes): Initialize to 256.
1831 (main): Document new default in options. Document magic number
1832 used in frames.allocated initialization.
1834 2014-01-20 Mark Wielaard <mjw@redhat.com>
1836 * stack.c (show_debugname): New static boolean.
1837 (die_name): New function.
1838 (print_frames): If show_debugname is true set symname to the
1839 first function-like DIE with a name in scope for the address in
1841 (parse_opt): Handle '-d'.
1842 (main): Add 'd' to options.
1844 2014-01-20 Mark Wielaard <mjw@redhat.com>
1846 * addr2line.c (handle_address): Initialize scopes to NULL.
1848 2014-01-17 Roland McGrath <roland@redhat.com>
1850 * strip.c (handle_elf): Check for bogus values in sh_link, sh_info,
1851 st_shndx, e_shstrndx, and SHT_GROUP or SHT_SYMTAB_SHNDX data.
1852 Don't use assert on input values, instead bail with "illformed" error.
1854 2014-01-17 Roland McGrath <roland@redhat.com>
1856 * readelf.c (handle_dynamic, handle_symtab): Check for bogus sh_link.
1857 (handle_verneed, handle_verdef, handle_versym, handle_hash): Likewise.
1858 (handle_scngrp): Check for bogus sh_info.
1860 2014-01-17 Jakub Jelinek <jakub@redhat.com>
1862 * elflint.c (section_name): Return "<invalid>" instead of
1863 crashing on invalid section name.
1864 (check_symtab, is_rel_dyn, check_rela, check_rel, check_dynamic,
1865 check_symtab_shndx, check_hash, check_versym): Robustify.
1866 (check_hash): Don't check entries beyond end of section.
1867 (check_note): Don't crash if gelf_rawchunk fails.
1869 2014-01-17 Petr Machata <pmachata@redhat.com>
1871 * readelf.c (handle_dynamic, handle_relocs_rel)
1872 (handle_relocs_rela, handle_versym, print_liblist):
1873 Use gelf_fsize instead of relying on shdr->sh_entsize.
1875 2014-01-14 Mark Wielaard <mjw@redhat.com>
1877 * readelf.c (print_debug_macro_section): Clear vendor array before
1880 2014-01-15 Jan Kratochvil <jan.kratochvil@redhat.com>
1882 Fix corruption of non-C++ symbols by the demangler.
1883 * nm.c (show_symbols_sysv, show_symbols_bsd, show_symbols_posix)
1884 (show_symbols): Check for _Z.
1885 * stack.c (print_frames) <USE_DEMANGLE>: Check for _Z.
1887 2014-01-02 Mark Wielaard <mjw@redhat.com>
1889 * stack.c (show_raw): Declare unconditionally.
1890 (parse_opt): Handle '-r' unconditionally.
1891 (main): Show "raw" option even without USE_DEMANGLE.
1893 2014-01-02 Mark Wielaard <mjw@redhat.com>
1895 * stack.c (print_frames): Print 0x before build-id hex-offset.
1897 2014-01-02 Mark Wielaard <mjw@redhat.com>
1899 * stack.c (maxframes): Increase to 2048.
1900 (struct frames): Add allocated field.
1901 (frame_callback): If frames used is frames allocated, realloc.
1902 (print_frames): Show an error if maxframes has been reached.
1903 (parse_opt): Allow -n 0 for unlimited frames.
1904 (main): Document -n 0 and new default 2048 frames. Allocate initial
1905 number of frames with malloc.
1907 2013-12-30 Mark Wielaard <mjw@redhat.com>
1909 * stack.c (parse_opt): Explicitly call dwfl_linux_proc_attach
1910 or dwfl_core_file_attach and check for errors.
1912 2013-12-28 Mark Wielaard <mjw@redhat.com>
1914 * stack.c (print_frames): Remove address width code and use...
1915 (get_addr_width): ...this new function.
1916 (show_modules): New static boolean.
1917 (module_callback): New static function.
1918 (parse_opt): Handle '-l'.
1919 (main): Add 'l' to options. If show_modules then use dwfl_getmodules
1920 with module_callback to show all detected modules and possible
1921 build_id, elf and dwarf files.
1923 2013-12-27 Mark Wielaard <mjw@redhat.com>
1925 * stack.c (frames_shown): New static boolean.
1926 (EXIT_OK,EXIT_ERROR,EXIT_BAD,EXIT_USAGES): New defines.
1927 (frame_callback): Return -1 on error. Don't print error.
1928 (print_frames): Add arguments, tid, dwflerr and what. Print tid.
1929 If there was an error report it with address and module if possible.
1930 Record whether any frames were actually printed.
1931 (thread_callback): Collect tid and err, pass it to print_frames.
1932 (parse_opt): Use EXIT_BAD for errors. On ARGP_KEY_END print errno
1933 if dwfl_linux_proc_report returned it. Check whether we are properly
1934 attached with dwfl_pid.
1935 (main): Document exit status. Don't report DWARF_CB_ABORT from
1936 callbacks as error. Pass real errors to print_frames. Return
1937 EXIT_BAD if no frames could be shown. Return EXIT_ERROR if there
1938 were any non-fatal errors.
1940 2013-12-23 Mark Wielaard <mjw@redhat.com>
1942 * Makefile.am (stack_LDADD): Add demanglelib.
1943 * stack.c (show_quiet): New static boolean, default false.
1944 (show_raw): Likewise.
1945 (demangle_buffer_len): New static size_t.
1946 (demangle_buffer): New static char *.
1947 (print_frames): Don't resolve pc name if show_quiet. Demangle name
1949 (parse_opt): Handle '-q' and '-r'.
1950 (main): Add 'q' and 'r' to options. Free demangle_buffer.
1952 2013-12-23 Mark Wielaard <mjw@redhat.com>
1954 * stack.c (OPT_DEBUGINFO): New define.
1955 (OPT_COREFILE): Likewise.
1957 (core_fd): Likewise.
1960 (debuginfo_path): Likewise.
1961 (parse_opt): Handle '-p', '--core', '-e' and '--debuginfo-path'.
1962 Do argument sanity checking. Setup Dwfl.
1963 (main): Add 'p', 'core', 'e' and 'debuginfo-path' to options.
1964 Remove argp_child children, simplify argp doc, remove custom
1965 usage message and construction of dwfl with dwfl_standard_argp.
1966 Use pid directly as tid. close core and core_fd if opened. Print
1967 pid of process or core.
1969 2013-12-23 Mark Wielaard <mjw@redhat.com>
1971 * stack.c (show_build_id): New static boolean.
1972 (print_frames): Print module build-id, load address and pc offset
1973 if show_build_id is true.
1974 (parse_opt): Handle '-b'.
1975 (main): Add -b to options.
1977 2013-12-22 Mark Wielaard <mjw@redhat.com>
1979 * stack.c (maxframes): New static unsigned. Initialize to 64.
1980 (struct frame): New struct.
1981 (struct frames): Likewise.
1982 (dwfl): New static Dwfl pointer.
1983 (frame_callback): Use arg as struct frames and fill it next frame.
1984 Return DWARF_CB_ABORT when maxframes has been reached. Move
1985 printing of frame to...
1986 (print_frames): ...here. New function.
1987 (thread_callback): Use arg as struct frames and set frames to zero.
1989 (parse_opt): Handle '-n'.
1990 (main): Add -n to options. Allocate frames using maxframes. Pass
1991 frames to frame_callback and thread_callback.
1993 2013-12-20 Mark Wielaard <mjw@redhat.com>
1995 * stack.c (show_one_tid): New static boolean.
1996 (parse_opt): Handle '-1'.
1997 (main): Add -1 to options. Call dwfl_getthread_frames when
1998 show_one_tid is true.
2000 2013-12-18 Mark Wielaard <mjw@redhat.com>
2002 * addr2line.c (options): Add symbol-sections, 'x'.
2003 (show_symbol_sections): New static bool.
2004 (parse_opt): Handle 'x'.
2005 (print_addrsym): Use dwfl_module_addrinfo value.r
2006 Also show section of address with show_symbol_sections.
2007 (find_symbol): Use dwfl_module_getsym_info and set value.
2008 (handle_address): Request value and use it instead of sym.st_value.
2009 * readelf.c (format_dwarf_addr): Use dwfl_module_addrinfo to get
2012 2013-12-17 Masatake YAMATO <yamato@redhat.com>
2013 Mark Wielaard <mjw@redhat.com>
2015 * stack.c (show_activation, show_module, show_source): New variables.
2016 (parse_opt): Set show_activation if -a option is given.
2017 Set show_module if -m option is given. Set show_source if -s option
2018 is given. Set all show booleans when -v option is given.
2019 (main): Added `-a', `-m', `-s', and `-v' to the help message.
2020 (frame_callback): Print module and source file information.
2022 2013-11-25 Petr Machata <pmachata@redhat.com>
2024 * elflint.c (valid_e_machine): Add EM_AARCH64.
2026 2013-11-14 Petr Machata <pmachata@redhat.com>
2028 * readelf.c (handle_core_item) <'h'>: New branch for handling
2029 fields that shouldn't be displayed.
2031 2013-11-10 Mark Wielaard <mjw@redhat.com>
2033 * stack.c: Use ARGP_PROGRAM_VERSION_HOOK_DEF and
2034 ARGP_PROGRAM_BUG_ADDRESS_DEF.
2035 (print_version): New function.
2037 2013-11-09 Mark Wielaard <mjw@redhat.com>
2039 * arlib.c (arlib_init): Call snprintf before using the result
2041 (arlib_finalize): Likewise.
2042 * nm.c (show_symbols_sysv): Don't modify cnt inside assert.
2044 2013-11-07 Jan Kratochvil <jan.kratochvil@redhat.com>
2046 * Makefile.am (bin_PROGRAMS): Add stack.
2048 * stack.c: New file.
2050 2013-11-05 Mark Wielaard <mjw@redhat.com>
2052 * readelf.c (print_debug_ranges_section): Cast address to size_t
2054 (print_debug_loc_section): Likewise.
2056 2013-10-18 Mark Wielaard <mjw@redhat.com>
2058 * ar.c (main): Correct operation check when instance_specifed is set.
2060 2013-09-26 Petr Machata <pmachata@redhat.com>
2062 * readelf.c (handle_file_note): New function.
2063 (handle_notes_data): Call it to handle NT_FILE notes.
2065 2013-09-26 Petr Machata <pmachata@redhat.com>
2067 * readelf.c (handle_siginfo_note): New function.
2068 (handle_notes_data): Call it to handle NT_SIGINFO notes.
2069 (buf_read_int, buf_read_ulong, buf_has_data): New functions.
2071 2013-08-13 Mark Wielaard <mjw@redhat.com>
2073 * addr2line.c (options): Add "inlines", 'i'.
2074 (show_inlines): New bool.
2075 (parse_opt): Handle 'i'.
2076 (print_diesym): New static function.
2077 (print_src): New function taking code from...
2078 (handle_address): here. Call print_src. Print inlines.
2080 2013-08-12 Mark Wielaard <mjw@redhat.com>
2082 * addr2line.c (main): If there is a newline char at end of buf,
2085 2013-07-05 Mark Wielaard <mjw@redhat.com>
2087 * readelf.c (print_ops): Take CU as argument, use it to print
2088 parameter_ref DIE offset.
2089 (struct listptr): Replace base field with cu.
2090 (listptr_base): New function.
2091 (compare_listptr): Use listptr_base.
2092 (notice_listptr): Take CU as argument.
2093 (skip_listptr_hole): Likewise.
2094 (print_debug_ranges_section): Pass NULL as CU to skip_listptr_hole.
2095 (print_cfa_program): Pass NULL as CU to print_ops.
2096 (struct attrcb_args): Replace cu_base field with cu.
2097 (attr_callback): Pass cu not cu_base to notice_listptr.
2098 (print_debug_units): Don't calculate base, just set cu.
2099 (print_debug_loc_section): Pass cu to skip_listptr_hole and
2102 2013-05-06 Mark Wielaard <mjw@redhat.com>
2104 * readelf.c (print_ops): Format first DW_OP_GNU_implicit_pointer
2105 argument as DIE offset.
2107 2013-04-24 Mark Wielaard <mjw@redhat.com>
2109 * Makefile.am: Use AM_CPPFLAGS instead of INCLUDES.
2111 2013-03-25 Mark Wielaard <mjw@redhat.com>
2113 * readelf.c (argp_options): Add decodedline.
2114 (decodedline): New boolean initialized to false.
2115 (parse_opt): Set decodedline when arg is decodedline.
2116 (print_decoded_line_section): New function.
2117 (print_debug_line_section): Call print_decoded_line_section when
2118 decodedline is true.
2120 2013-03-25 Mark Wielaard <mjw@redhat.com>
2122 * readelf.c (argp_option): Add decodedaranges.
2123 (decodedaranges): New boolean initialized to false.
2124 (parse_opt): Set decodedaranges when arg is decodedaranges.
2125 (print_debug_aranges_section): Reimplemented and original
2126 implementation renamed to...
2127 (print_decoded_aranges_section): this.
2129 2013-03-25 Mark Wielaard <mjw@redhat.com>
2131 * readelf.c (attrcb_args): Add Dwarf_Die.
2132 (attr_callback): When highpc is in constant form also print as
2134 (print_debug_units): Set args.die.
2136 2013-03-19 Mark Wielaard <mjw@redhat.com>
2138 * readelf.c (print_gdb_index_section): Free format_dwarf_addr results.
2140 2013-03-18 Mark Wielaard <mjw@redhat.com>
2142 * readelf.c (print_gdb_index_section): Accept version 8.
2144 2013-03-01 Mark Wielaard <mjw@redhat.com>
2146 * findtextrel.c (process_file): Release ELF and close file when not
2147 text relocations are found.
2148 * strip.c (handle_elf): Track memory used for .debuglink section data
2151 2013-02-24 Mark Wielaard <mjw@redhat.com>
2153 * elflint.c (check_symtab): Add __bss_start__ to the list of symbols
2154 allowed to have out of section values because of GNU ld bugs.
2156 2013-02-06 Mark Wielaard <mjw@redhat.com>
2158 * elflint.c (check_symtab): Add __bss_start and __TMC_END__ to the
2159 list of symbols allowed to have out of section values because of
2160 GNU ld bugs in either .symtab or .dynsym, but only when they are
2163 2013-01-24 Mark Wielaard <mjw@redhat.com>
2165 * readelf.c (argp_option): Add unresolved-address-offsets, U.
2166 (print_unresolved_addresses): New static.
2167 (parse_opt): Handle 'U', set print_unprocessed_values.
2168 (format_dwarf_addr): Take and handle new raw argument.
2169 (print_ops): Call format_dwarf_addr with raw offset values.
2170 (print_debug_ranges_section): Likewise.
2171 (print_debug_frame_section): Likewise.
2172 (attr_callback): Likewise.
2173 (print_debug_line_section): Likewise.
2174 (print_debug_loc_section): Likewise.
2175 (print_gdb_index_section): Likewise.
2177 2013-01-18 Mark Wielaard <mjw@redhat.com>
2179 * readelf.c (struct listptr): Add base Dwarf_Addr field.
2180 (compare_listptr): Warn for same offset with different base.
2181 (notice_listptr): Take base argument and set it.
2182 (skip_listptr_hole): Likewise.
2183 (struct attrcb_args): Removed unused cu_offset field.
2184 Add cu_base Dwarf_Addr field.
2185 (attr_callback): Call notice_listptr with cbargs->cu_base.
2186 (print_debug_units): Set args.cu_base.
2187 (print_debug_ranges_section): Get base and use for format_dwarf_addr.
2188 (print_debug_loc_section): Likewise.
2190 2013-01-29 Jan Kratochvil <jan.kratochvil@redhat.com>
2192 * readelf.c (handle_core_items): Limit special repeated items handling
2193 to single-item formats '\n', 'b' and 'B', assert OFFSET 0 there.
2195 2012-12-18 Mark Wielaard <mark@bordewijk.wildebeest.org>
2197 * readelf.c (ELF_INPUT_SECTION): New argp key value.
2198 (argp_option): Add elf-section.
2199 (elf_input_section): New static.
2200 (parse_opt): Handle ELF_INPUT_SECTION and set elf_input_section.
2201 (open_input_section): New function.
2202 (process_file): Call open_input_section if elf_input_section set.
2204 2013-01-13 David Abdurachmanov <David.Abdurachmanov@cern.ch>
2206 ar.c (do_oper_delete): Fix num passed to memset.
2208 2012-12-21 Mark Wielaard <mjw@redhat.com>
2210 * readelf.c (print_debug_frame_section): Adjust FDE start address
2211 if pcrel before feeding it to format_dwarf_addr.
2213 2012-12-21 Mark Wielaard <mjw@redhat.com>
2215 * addr2line.c (main): Call dwfl_end.
2217 2012-12-11 Roland McGrath <roland@hack.frob.com>
2219 * nm.c (show_symbols_sysv): Fix size passed to snprintf for invalid
2221 Reported by David Abdurachmanov <David.Abdurachmanov@cern.ch>.
2223 2012-10-16 Mark Wielaard <mjw@redhat.com>
2225 * readelf.c (print_ops): DW_OP_skip and DW_OP_bra targets are
2226 calculated beginning after the operand and 2-byte constant.
2228 2012-10-12 Jan Kratochvil <jan.kratochvil@redhat.com>
2230 * readelf.c (ITEM_WRAP_COLUMN, REGISTER_WRAP_COLUMN): Merge to ...
2231 (WRAP_COLUMN): ... here.
2232 (print_core_item): Remove parameter format_max. Update function
2233 comment. Replace FORMAT_MAX by the real output width.
2234 (handle_core_item): Remove the FORMAT_MAX values in TYPES, DO_TYPE,
2235 calls of print_core_item, remove variable maxfmt, change
2236 ITEM_WRAP_COLUMN to WRAP_COLUMN.
2237 (handle_core_register): Remove the FORMAT_MAX values in TYPES, BITS,
2238 calls of print_core_item, change REGISTER_WRAP_COLUMN to WRAP_COLUMN.
2240 2012-10-11 Jan Kratochvil <jan.kratochvil@redhat.com>
2242 * readelf.c (handle_core_item) <b>: Make run an outer block variable.
2243 Increase run only if LASTBIT != 0. Print last element only if RUN > 0.
2245 2012-08-27 Mark Wielaard <mjw@redhat.com>
2247 * readelf.c (print_debug_macro_section): Print offset as PRIx64.
2249 2012-08-27 Mark Wielaard <mjw@redhat.com>
2251 * readelf.c (register_info): Handle loc == NULL.
2253 2012-08-22 Jeff Kenton <jkenton@tilera.com>
2255 * elflint.c (valid_e_machine): Add EM_TILEGX and EM_TILEPRO.
2257 2012-08-16 Mark Wielaard <mjw@redhat.com>
2259 * readelf.c (dwarf_tag_name): Renamed from dwarf_tag_string.
2260 Uses new dwarf_tag_string or adds ??? or lo_user+%#x when
2262 (dwarf_attr_name): Likewise.
2263 (dwarf_form_name): Likewise.
2264 (dwarf_lang_name): Likewise.
2265 (dwarf_inline_name): Likewise.
2266 (dwarf_encoding_name): Likewise.
2267 (dwarf_access_name): Likewise.
2268 (dwarf_visibility_name): Likewise.
2269 (dwarf_virtuality_name): Likewise.
2270 (dwarf_identifier_case_name): Likewise.
2271 (dwarf_calling_convention_name): Likewise.
2272 (dwarf_ordering_name): Likewise.
2273 (dwarf_discr_list_name): Likewise.
2274 (print_ops): Remove KNOWN. Use dwarf_locexpr_opcode_string.
2275 (attr_callback): Call new dwarf_foobar_name instead of old
2276 dwarf_foobar_string functions.
2277 (dwarf_tag_string): New function using known-dwarf.h macros.
2278 (dwarf_attr_string): Likewise.
2279 (dwarf_form_string): Likewise.
2280 (dwarf_lang_string): Likewise.
2281 (dwarf_inline_string): Likewise.
2282 (dwarf_encoding_string): Likewise.
2283 (dwarf_access_string): Likewise.
2284 (dwarf_visibility_string): Likewise.
2285 (dwarf_virtuality_string): Likewise.
2286 (dwarf_identifier_case_string): Likewise.
2287 (dwarf_calling_convention_string): Likewise.
2288 (dwarf_ordering_string): Likewise.
2289 (dwarf_discr_list_string): Likewise.
2290 (dwarf_locexpr_opcode_string): Likewise.
2292 2012-06-27 Mark Wielaard <mjw@redhat.com>
2294 * readelf.c (dwarf_form_string): Handle DW_FORM_GNU_ref_alt and
2295 DW_FORM_GNU_strp_alt.
2296 (attr_callback): Likewise.
2298 2012-07-30 Petr Machata <pmachata@redhat.com>
2300 * nm.c (show_symbols_bsd): Reorder arguments in {S,}FMTSTRS (and
2301 corresponding printf) so that those that are referenced by only
2302 one of the formatting strings are at the end.
2304 2012-07-29 Mark Wielaard <mjw@redhat.com>
2306 * readelf.c (dwarf_lang_string): Use DW_LANG_ObjC, not DW_LANG_Objc.
2307 (print_ops): Use known[op], not op_name, for DW_OP_GNU_parameter_ref.
2309 2012-07-19 Mark Wielaard <mjw@redhat.com>
2311 * readelf.c (print_ops): Handle DW_OP_GNU_parameter_ref.
2313 2012-07-11 Mark Wielaard <mjw@redhat.com>
2315 * readelf.c (options): Add macro to help of debug-dump.
2316 (section_e): Add section_macro.
2317 (section_all): Add section_macro.
2318 (parse_opt): Handle macro.
2319 (print_debug_macro_section): New function.
2320 (print_debug): Add NEW_SECTION (macro).
2322 2012-07-10 Mark Wielaard <mjw@redhat.com>
2324 * readelf.c (print_gdb_index_section): Add version 7 support.
2325 Keep track of cu_nr. Print kind and static/global flag for each
2326 symbol. When a symbol is in the TU list add 'T'.
2328 2012-06-26 Mark Wielaard <mjw@redhat.com>
2330 * readelf.c (dwarf_attr_string): Add DW_AT_GNU_macros.
2332 2012-06-22 Mark Wielaard <mjw@redhat.com>
2334 * readelf.c (print_ops): Cast printf PRIu/x64 arguments to uint64_t
2335 for gcc 4.7 -Wformat.
2337 2012-05-09 Roland McGrath <roland@hack.frob.com>
2339 * elflint (check_sections): Allow zero sized sections at (filesz) end
2340 of segment. And make check overflow-proofed.
2342 2012-04-24 Mark Wielaard <mjw@redhat.com>
2344 * readelf.c (print_ops): Add DW_OP_GNU_push_tls_address,
2345 DW_OP_GNU_uinit and DW_OP_GNU_encoded_addr.
2347 2012-03-28 Roland McGrath <roland@hack.frob.com>
2349 * elflint.c (special_sections): Accept SHF_INFO_LINK for reloc sections.
2351 2012-03-28 Mark Wielaard <mjw@redhat.com>
2353 * readelf.c (print_debug_abbrev_section): Check there is Dwarf
2355 (print_debug_str_section): Likewise.
2357 2012-03-21 Mark Wielaard <mjw@redhat.com>
2359 * readelf.c (print_gdb_index_section): Accept version 6.
2361 2012-01-31 Mark Wielaard <mjw@redhat.com>
2363 * readelf.c (attr_callback): Don't special case DW_FORM_sec_offset.
2365 2012-01-21 Ulrich Drepper <drepper@gmail.com>
2367 * addr2line.c: Update copyright year.
2369 * elfcmp.c: Likewise.
2370 * elflint.c: Likewise.
2371 * findtextrel.c: Likewise.
2374 * objdump.c: Likewise.
2375 * ranlib.c: Likewise.
2376 * readelf.c: Likewise.
2378 * strings.c: Likewise.
2379 * strip.c: Likewise.
2380 * unstrip.c: Likewise.
2382 * nm.c (argp_children): Define.
2383 (argp): Hook up argp_children.
2384 (handle_ar): Optimize puts call.
2385 (show_symbols_bsd): Use positional parameters to also print color
2386 codes. Don't print STT_FILE symbols.
2387 * objdump.c (options): Improve help text.
2388 (argp_children): Define.
2389 (argp): Hook up argp_children.
2390 (disasm_info): Add elements for color codes.
2391 (disasm_output): Print color codes as well.
2392 (show_disasm): Set up disasm_info data for callback.
2394 2012-01-20 Roland McGrath <roland@hack.frob.com>
2396 * arlib-argp.c (arlib_deterministic_output): Initialize from
2398 (help_filter): New function.
2401 * ar.c (main): Handle oper_none as usage error.
2403 * arlib-argp.c (options, parse_opt): Grok -U as inverse of -D.
2405 * ranlib.c (argp): Use arlib_argp_children.
2407 * arlib.c (arlib_init): Obey arlib_deterministic_output.
2409 * arlib-argp.c: New file.
2410 * Makefile.am (libar_a_SOURCES): Add it.
2411 * arlib.h (arlib_deterministic_output, arlib_argp_children):
2412 Declare new variables.
2413 * ar.c (deterministic_output): Variable removed.
2414 (do_oper_insert): Use arlib_deterministic_output instead.
2415 (options, parse_opt): Don't handle -D here. Add group numbers.
2416 (argp): Use arlib_argp_children.
2418 2011-12-20 Roland McGrath <roland@hack.frob.com>
2420 * readelf.c (print_debug): Initialize DUMMY_DBG.elf.
2421 Reported by Karel Klic <kklic@redhat.com>.
2423 2011-11-05 Roland McGrath <roland@hack.frob.com>
2425 * ar.c (deterministic_output): New flag variable.
2426 (options, parse_opt): Grok -D to set it.
2427 (do_oper_insert): When set, use zero from mtime, uid, and gid.
2429 * ar.c (do_oper_insert): Fix check on elf_rawfile return value.
2431 2011-10-04 Marek Polacek <mpolacek@redhat.com>
2433 * readelf.c (register_info): Assume the right size of an array.
2435 2011-10-03 Ulrich Drepper <drepper@gmail.com>
2437 * nm.c: Recognize option --mark-special. Still recognize --mark-weak
2438 but don't show it in help anymore.
2439 (mark_special): Renamed from mark_weak.
2440 (parse_opt): Adjust.
2441 (class_type_char): Take additional parameters for ELF file and ELF
2442 header. Treat TLS symbols like objects.
2443 In case of D symbols, show u for unique symbols, R for symbols in
2444 read-only sections, B for symbols in BSS sections.
2445 (show_symbols_bsd): Take additional parameters for ELF file and ELF
2446 header. Adjust for class_type_char change. Show TLS symbols with
2447 @ after them in case --mark-special is selected.
2448 (show_symbols_posix): Likewise.
2449 (show_symbols): Adjust calls to show_symbols_bsd and
2451 (show_symbols_sysv): Avoid printing adress and size for undefined
2452 symbols. Don't print initial special entry and section entries.
2454 2011-10-02 Ulrich Drepper <drepper@gmail.com>
2456 * Makefile.am (demanglelib): Define.
2457 (nm_LDADD): Add demanglelib.
2458 * nm.c (options): Add -C option.
2459 (demangle): Define as global variable.
2460 (parse_opt): Recognize -C.
2461 (show_symbols_sysv): Handle demangling.
2462 (show_symbols_bad): Likewise.
2463 (show_symbols_posix): Likewise.
2464 (show_symbols): Likewise.
2466 2011-07-09 Roland McGrath <roland@hack.frob.com>
2468 * readelf.c (options, parse_opt): Grok -W/--wide and ignore it.
2470 * ar.c (parse_opt): Grok -u.
2472 2011-05-30 Mark Wielaard <mjw@redhat.com>
2474 * strip.c (relocate): Make offset check overflow-proof.
2476 2011-05-23 Mark Wielaard <mjw@redhat.com>
2478 * strip.c (relocate): Take new arguments is_rela to indicate
2479 whether the relocation is from a SHT_REL or SHT_RELA section.
2480 Relocate against any debug section symbol, not just STT_SECTION
2481 symbols. For SHT_REL relocations, fetch addend from offset and
2482 add it to symbol value if not zero.
2484 2011-05-23 Mark Wielaard <mjw@redhat.com>
2486 * strip.c (OPT_RELOC_DEBUG): New option.
2487 (argp_option): Add new --reloc-debug-sections option.
2488 (main): Check new option.
2489 (parse_opt): Likewise.
2490 (handle_elf): Remove any relocations between debug sections
2491 in ET_REL for the debug file when requested.
2493 2011-05-18 Mark Wielaard <mjw@redhat.com>
2495 * strip.c (handle_elf): Make sure all sections of a removed group
2496 section are removed too. Don't discard SHT_GROUP sections, copy
2497 section table before it gets modified. Section group signature
2498 symbols don't have to be retained.
2500 2011-05-16 Jakub Jelinek <jakub@redhat.com>
2502 * readelf.c (print_ops): Handle DW_OP_GNU_const_type,
2503 DW_OP_GNU_regval_type, DW_OP_GNU_deref_type, DW_OP_GNU_convert
2504 and DW_OP_GNU_reinterpret.
2506 2011-05-17 Mark Wielaard <mjw@redhat.com>
2508 * readelf.c (dwarf_tag_string): Fixup DW_TAG_GNU_call_site and
2509 DW_TAG_GNU_call_site_parameter return strings.
2511 2011-05-11 Marek Polacek <mpolacek@redhat.com>
2513 * nm.c (show_symbols_sysv): Remove unused if/else, remove
2514 unused `prefix' and `fname' parameters.
2516 2011-05-07 Marek Polacek <mpolacek@redhat.com>
2518 * unstrip.c (compare_sections_nonrel): Mark this function as static.
2520 2011-04-26 Mark Wielaard <mjw@redhat.com>
2522 * readelf.c (handle_notes_data): Call ebl_object_note_type_name
2525 2011-04-14 Mark Wielaard <mjw@redhat.com>
2527 * readelf.c (options): Add gdb_index.
2528 (section_e): Define section_gdb_index.
2529 (parse_opt): Recognize gdb_index debug-dump argument.
2530 (print_gdb_index_section): New function.
2531 (print_debug): Add gdb_index to debug_sections.
2533 2011-03-24 Petr Machata <pmachata@redhat.com>
2535 * readelf.c (print_debug_line_section): Emit initial space for all
2536 opcode lines. Print offset in front of each opcode.
2538 2011-03-22 Marek Polacek <mpolacek@redhat.com>
2540 * readelf.c (handle_dynamic): Don't segfault at DT_PLTREL case.
2542 2011-03-22 Mark Wielaard <mjw@redhat.com>
2544 * readelf.c (dwarf_tag_string): Support DW_TAG_GNU_call_site
2545 and DW_TAG_GNU_call_site_parameter.
2546 (dwarf_attr_string): Support DW_AT_GNU_call_site_value,
2547 DW_AT_GNU_call_site_data_value,
2548 DW_AT_GNU_call_site_target,
2549 DW_AT_GNU_call_site_target_clobbered,
2550 DW_AT_GNU_tail_call,
2551 DW_AT_GNU_all_tail_call_sites,
2552 DW_AT_GNU_all_call_sites,
2553 and DW_AT_GNU_all_source_call_sites.
2554 (print_ops): Handle DW_OP_GNU_entry_value.
2555 (attr_callback): Handle DW_AT_GNU_call_site_value,
2556 DW_AT_GNU_call_site_data_value,
2557 DW_AT_GNU_call_site_target,
2558 and DW_AT_GNU_call_site_target_clobbered.
2560 2011-03-10 Mark Wielaard <mjw@redhat.com>
2562 * elflint.c (check_symtab): Use ebl_check_st_other_bits.
2564 2011-02-27 Jan Kratochvil <jan.kratochvil@redhat.com>
2566 * readelf.c (reset_listptr): Clear TABLE->TABLE.
2568 2011-02-25 Mark Wielaard <mjw@redhat.com>
2570 * readelf.c (dwarf_attr_string): Add DW_AT_GNU_* handling.
2571 (dwarf_form_string): Properly format and return unknown form.
2573 2011-02-23 Roland McGrath <roland@redhat.com>
2575 * readelf.c (section_name): New function.
2576 (print_debug_abbrev_section): Use it instead of constant.
2577 (print_debug_aranges_section): Likewise.
2578 (print_debug_ranges_section): Likewise.
2579 (print_debug_units): Likewise.
2580 (print_debug_line_section): Likewise.
2581 (print_debug_loc_section): Likewise.
2582 (print_debug_macinfo_section): Likewise.
2583 (print_debug_pubnames_section): Likewise.
2584 (print_debug_str_section): Likewise.
2585 (print_debug) [USE_ZLIB]: Match .zdebug_* sections too.
2586 (print_debug_abbrev_section): Use decoded d_size, not sh_size.
2587 (print_debug_str_section): Likewise.
2589 * readelf.c (dwarf_attr_string): Grok DW_AT_GNU_odr_signature.
2591 2011-02-11 Roland McGrath <roland@redhat.com>
2593 * elfcmp.c (verbose): New variable.
2594 (options, parse_opt): Grok -l/--verbose to set it.
2595 (main): Under -l, keep going after first difference.
2597 * elfcmp.c (ignore_build_id): New variable.
2598 (options, parse_opt): Grok --ignore-build-id to set it.
2599 (main): For SHT_NOTE sections, compare note details rather than raw
2600 bytes. Under --ignore-build-id, don't complain about differing build
2601 ID contents if lengths match.
2603 2011-02-08 Roland McGrath <roland@redhat.com>
2605 * ldscript.y (filename_id_star): Remove unused variable.
2607 * unstrip.c (copy_elided_sections): Remove unused variable.
2609 * elflint.c (check_dynamic): Remove unused variables.
2611 * elflint.c (check_symtab): Warn about missing xndx section only once.
2613 * ldgeneric.c (check_for_duplicate2): Remove unused variable.
2615 2011-01-06 Roland McGrath <roland@redhat.com>
2617 * strip.c (handle_elf): Under --strip-sections, remove all
2618 non-allocated sections and never generate .gnu_debuglink.
2620 2011-01-04 Roland McGrath <roland@redhat.com>
2622 * strip.c (remove_shdrs): New variable.
2623 (options, parse_opt): Grok --strip-sections to set it.
2624 (handle_elf): When that's set, truncate off .shstrtab and shdrs.
2626 2010-11-10 Roland McGrath <roland@redhat.com>
2628 * findtextrel.c (process_file): Don't assume order of sections.
2629 Reported by Mike Hommey <mh@glandium.org>.
2631 2010-07-26 Roland McGrath <roland@redhat.com>
2633 * readelf.c (print_ops): Handle DW_OP_GNU_implicit_pointer.
2635 2010-08-30 Roland McGrath <roland@redhat.com>
2637 Print .debug_loc/.debug_ranges with cognizance of actual DIE uses.
2638 * readelf.c (parse_opt): Add section_info to implicit_debug_sections
2640 (struct listptr, struct listptr_table): New types.
2641 (compare_listptr, reset_listptr, sort_listptr): New functions.
2642 (notice_listptr, skip_listptr_hole): New functions.
2643 (struct attrcb_args): Add silent member.
2644 (attr_callback): Call notice_listptr for loclistptr and rangelistptr.
2645 Suppress output if silent, but still call notice_listptr.
2646 (print_debug_units): Suppress output if section_info not requested.
2647 (print_debug_loc_section): Call sort_listptr, skip_listptr_hole.
2648 (print_debug_ranges_section): Likewise.
2649 (print_debug): Call reset_listptr on both tables.
2651 * readelf.c (print_debug_ranges_section): Print empty list.
2652 (print_debug_loc_section): Likewise.
2654 * readelf.c (print_debug_loc_section): Check for bogus length
2655 before calling print_ops.
2656 (print_ops): Check harder for bogus data that would read off end.
2658 2010-08-11 Roland McGrath <roland@redhat.com>
2660 * readelf.c (for_each_section_argument): Process all sections with
2661 matching name, not just the first.
2663 2010-07-26 Roland McGrath <roland@redhat.com>
2665 * readelf.c (print_ops): Take new argument for CU version.
2666 Fix DW_OP_call_ref decoding to depend on it.
2667 (print_debug_loc_section): Update caller.
2668 (print_cfa_program): Take new argument, pass it down.
2669 (print_debug_frame_section): Update caller.
2670 (struct attrcb_args): New member version.
2671 (print_debug_units): Initialize it.
2673 2010-07-02 Roland McGrath <roland@redhat.com>
2675 * readelf.c (print_debug_frame_section): Use format_dwarf_addr for
2678 2010-06-30 Roland McGrath <roland@redhat.com>
2680 * strings.c (main): Use STDIN_FILENO, not STDOUT_FILENO.
2681 Ignore st_size for a non-S_ISREG file descriptor.
2682 (read_block): Move assert after no-mmap bail-out.
2683 (read_block_no_mmap): Fix size calculations for moving buffer remnant.
2685 2010-06-22 Roland McGrath <roland@redhat.com>
2687 * readelf.c (print_debug_line_section): Fix braino in DW_LNS_set_isa.
2689 2010-06-21 Roland McGrath <roland@redhat.com>
2691 * readelf.c (dwarf_tag_string): Handle new v4 tags.
2692 (dwarf_attr_string): Add new attributes.
2693 (dwarf_tag_string): Handle DW_TAG_GNU_*.
2695 * readelf.c (print_ops): Use 64-bit types for LEB128 operands.
2696 (print_cfa_program): Likewise.
2698 2010-06-20 Roland McGrath <roland@redhat.com>
2700 * readelf.c (print_debug_units): New function, broken out of ...
2701 (print_debug_info_section): ... here. Call it.
2702 (print_debug_types_section): New function.
2703 (enum section_e): Add section_types alias for section_info.
2704 (print_debug): Add types to the sections table.
2706 * readelf.c (print_debug_frame_section): Handle version 4 format.
2708 * readelf.c (print_debug_line_section): Handle version 4 format.
2710 2010-06-14 Roland McGrath <roland@redhat.com>
2712 * unstrip.c (copy_elided_sections): Make sure all sections' data have
2713 been read in before we write anything out.
2715 2010-06-04 Roland McGrath <roland@redhat.com>
2717 * unstrip.c (update_shdr): New function.
2718 (update_sh_size): Call it instead of gelf_update_shdr.
2719 (adjust_relocs, add_new_section_symbols): Likewise.
2720 (new_shstrtab, copy_elided_sections): Likewise.
2722 * unstrip.c (copy_elided_sections): Bail if stripped file has more
2723 sections than unstripped file, rather than getting confused later.
2725 2010-06-01 Roland McGrath <roland@redhat.com>
2727 * readelf.c (dwarf_form_string): Handle DWARF 4 forms.
2728 (attr_callback): Handle DW_FORM_flag_present, DW_FORM_exprloc,
2729 DW_FORM_sec_offset, DW_FORM_ref_sig8.
2731 * readelf.c (print_debug): Don't bail if libdw setup fails.
2732 Suppress complaint if we only want .eh_frame anyway.
2734 2010-05-28 Ulrich Drepper <drepper@redhat.com>
2736 * readelf.c (attr_callback): Also print form information.
2738 2010-05-19 Roland McGrath <roland@redhat.com>
2740 * addr2line.c (find_symbol): Short-circuit on empty name.
2741 (handle_address): Handle SYMBOL with no +OFFSET.
2743 2010-05-08 Roland McGrath <roland@redhat.com>
2745 * readelf.c (print_ops): Take new arg OFFSET_SIZE.
2746 Use that for DW_OP_call_ref, not ADDRSIZE.
2747 (print_cfa_program): Update caller.
2748 (struct attrcb_args): Add offset_size field.
2749 (attr_callback): Use it for print_ops call.
2750 (print_debug_info_section): Initialize it.
2751 (print_ops): Likewise.
2753 2010-04-14 Roland McGrath <roland@redhat.com>
2755 * readelf.c (handle_core_item): Fix bitmask printing.
2757 2010-04-06 Roland McGrath <roland@redhat.com>
2759 * ld.c (options): Fix some typos in messages.
2760 * elflint.c (check_scn_group, check_group): Likewise.
2761 * ldscript.y (add_id_list): Likewise.
2762 * readelf.c (print_hash_info): Add xgettext:no-c-format magic comment
2763 before translated string containing a literal %.
2765 2010-02-26 Roland McGrath <roland@redhat.com>
2767 * readelf.c (process_file): Don't leak an fd in failure case.
2769 2010-02-15 Roland McGrath <roland@redhat.com>
2771 * Makefile.am: Use config/eu.am for common stuff.
2773 * readelf.c (print_debug_frame_section): Add a cast to avoid sign
2774 mismatch in comparison.
2776 2010-02-02 Roland McGrath <roland@redhat.com>
2778 * readelf.c (print_encoding_base): Handle DW_EH_PE_absptr (zero).
2779 (read_encoded): Likewise.
2780 (print_debug_frame_section): Check for bogus augmentation length.
2781 For P augmentation, use read_encoded, print the encoding description,
2782 and use hex for unsigned values.
2784 2010-01-15 Roland McGrath <roland@redhat.com>
2786 * ar.c: Include <sys/stat.h>.
2787 * elflint.c: Likewise.
2788 * readelf.c: Likewise.
2789 * strip.c: Likewise.
2790 * unstrip.c: Likewise
2792 2010-01-07 Roland McGrath <roland@redhat.com>
2794 * readelf.c (print_ehdr): Handle PN_XNUM.
2795 (phnum): New static variable.
2796 (process_elf_file): Set it with elf_getphdrnum.
2797 (print_phdr): Use phnum instead of EHDR->e_phnum.
2798 (print_dynamic, handle_notes): Likewise.
2799 (handle_relocs_rel, handle_relocs_rela): Likewise.
2801 * elfcmp.c (main): Use elf_getshdrnum and elf_getphdrnum.
2803 * elflint.c (phnum): New static variable.
2804 (check_elf_header): Set it, handling PN_XNUM.
2805 Use that in place of EHDR->e_phnum throughout.
2806 (check_symtab, check_reloc_shdr, check_dynamic): Likewise.
2807 (unknown_dependency_p, check_sections, check_program_header): Likewise.
2809 2010-01-05 Roland McGrath <roland@redhat.com>
2811 * readelf.c (dwarf_attr_string): Match DW_AT_GNU_vector and
2812 DW_AT_GNU_template_name.
2814 2010-01-04 Roland McGrath <roland@redhat.com>
2816 * readelf.c (handle_notes_data): Grab NT_AUXV only for name "CORE".
2817 (handle_core_note): Pass NHDR and NAME to ebl_core_note.
2818 (handle_core_item): Handle .format of '\n' as \n-separated strings.
2820 * readelf.c (implicit_debug_sections): New variable.
2821 (parse_opt): Set it instead of print_debug_sections for -a.
2822 OR them together for print_debug check.
2823 (print_debug): OR them together for section check.
2825 * readelf.c (options): Repartition into set implied by -a and others.
2826 Correct -a text to match reality.
2828 * readelf.c (struct section_argument): Add bool member 'implicit'.
2829 (parse_opt): Set it for -a cases, clear it for -x args.
2830 (for_each_section_argument): Don't complain about a missing section by
2831 name if it's implicit.
2833 2009-11-16 Roland McGrath <roland@redhat.com>
2835 * readelf.c (print_string_section): Punt SHT_NOBITS like empty
2836 sections, just as dump_data_section already does.
2838 2009-09-21 Ulrich Drepper <drepper@redhat.com>
2840 * elflint.c (special_sections): Allow MERGE and STRINGS flags to be
2841 set for .comment section.
2842 Patch by Mark Wielaard <mjw@redhat.com>.
2844 2009-09-08 Roland McGrath <roland@redhat.com>
2846 * ar.c (main): Fix typo in message format.
2848 2009-08-21 Roland McGrath <roland@redhat.com>
2850 * readelf.c (attr_callback): Use print_block only when we don't use
2853 2009-08-14 Roland McGrath <roland@redhat.com>
2855 * ar.c (do_oper_extract): Use pathconf instead of statfs.
2857 2009-08-01 Ulrich Drepper <drepper@redhat.com>
2859 * debugpred.h: Add two most const.
2861 2009-07-26 Mark Wielaard <mjw@redhat.com>
2863 * elflint.c (check_note_data): Recognize NT_GNU_GOLD_VERSION.
2865 2009-07-25 Mark Wielaard <mjw@redhat.com>
2867 * Makefile.am (addr2line_LDADD): Add $(libelf).
2869 2009-07-24 Roland McGrath <roland@redhat.com>
2871 * readelf.c (print_block): New function.
2872 (print_ops): Use it.
2873 (attr_callback): Use it for DW_FORM_block* forms.
2875 2009-07-20 Mark Wielaard <mjw@redhat.com>
2877 * readelf.c (print_ops): Add handling of DW_OP_implicit_value
2878 and DW_OP_stack_value.
2880 2009-07-14 Ulrich Drepper <drepper@redhat.com>
2882 * elflint.c (check_elf_header): Allow Linux ABI.
2883 (check_symtab): Handle STB_GNU_UNIQUE.
2885 2009-07-08 Mark Wielaard <mjw@redhat.com>
2887 * readelf.c (attr_callback): Handle DW_Form constants for
2888 DW_AT_data_member_location.
2890 2009-07-06 Roland McGrath <roland@redhat.com>
2892 * readelf.c (register_info): New function. Handle unknown register #s.
2893 (print_cfa_program): Use it.
2894 (handle_core_register, handle_core_registers): Likewise.
2896 2009-06-28 Roland McGrath <roland@redhat.com>
2898 * readelf.c (print_address_names): New static variable.
2899 (options, parse_opt): Grok -N/--numeric-addresses to clear it.
2900 (format_dwarf_addr): Don't look up name if !print_address_names.
2902 2009-06-13 Ulrich Drepper <drepper@redhat.com>
2904 * ldgeneric.c: Don't use deprecated libelf functions.
2906 * objdump.c: Likewise.
2907 * readelf.c: Likewise.
2909 * strip.c: Likewise.
2910 * unstrip.c: Likewise.
2911 * ld.h: Fix up comment.
2913 2009-06-01 Ulrich Drepper <drepper@redhat.com>
2915 * readelf.c (print_relocs): Expect ELF header argument and pass on
2916 to handle_relocs_rel* functions. Adjust caller.
2917 (handle_relocs_rel): Add ELF header argument. Add special case for
2918 the IRELATIVE relocations in statically linked executables.
2919 (handle_relocs_rela): Likewise.
2921 2009-04-29 Ulrich Drepper <drepper@redhat.com>
2923 * elflint.c (check_symtab): Add tests of st_other field.
2925 2009-04-23 Ulrich Drepper <drepper@redhat.com>
2927 * Makefile [BUILD_STATIC] (libdw): Add $(zip_LIBS).
2929 2009-04-20 Roland McGrath <roland@redhat.com>
2931 * addr2line.c (print_dwarf_function): Honor -s and -A for file names
2932 of inline call sites.
2934 * addr2line.c (just_section): New variable.
2935 (adjust_to_section): New function, broken out of ...
2936 (handle_address): ... here.
2937 (options, parse_opt): Add -j/--section=NAME to set it.
2939 2009-04-15 Roland McGrath <roland@redhat.com>
2941 * readelf.c (print_debug_frame_section): Check for DW_CIE_ID_64 in
2942 64-bit format header, DW_CIE_ID_32 in 32-bit format header.
2944 2009-04-14 Roland McGrath <roland@redhat.com>
2946 * readelf.c (print_attributes): Treat SHT_ARM_ATTRIBUTES on EM_ARM
2947 like SHT_GNU_ATTRIBUTES.
2949 * readelf.c (handle_core_registers): Fix error message.
2951 * strip.c (handle_elf: check_preserved): Don't note any change when
2952 .debug_data is already filled from a previous pass.
2954 2009-02-05 Ulrich Drepper <drepper@redhat.com>
2956 * objdump.c (show_relocs_x): Minor cleanups.
2958 * readelf.c (print_cfa_program): Correct a few labels.
2959 Print first DW_CFA_expression and DW_CFA_val_expression parameter
2962 2009-02-01 Ulrich Drepper <drepper@redhat.com>
2964 * objdump.c (show_relocs_rel, show_relocs_rela): Split common parts
2966 (show_relocs_x): ...here. New function.
2967 (show_relocs): Better spacing in output.
2969 * objdump.c (show_relocs_rela): Show offsets as signed values.
2971 * ar.c (main): Fix recognition of invalid modes for a, b, i modifiers.
2972 Improve some error messages.
2973 Use program_invocation_short_name instead of AR macro.
2974 * Makefile.am (CFLAGS_ar): Remove.
2975 * elflint.c (parse_opt): ARGP_HELP_EXIT_ERR does nothing for argp_help.
2976 * objdump.c (parse_opt): Likewise.
2977 * readelf.c (parse_opt): Likewise.
2979 2009-01-27 Roland McGrath <roland@redhat.com>
2981 * readelf.c (print_ops): Notice short length, don't overrun buffer
2982 (still need to fix LEB128).
2984 * readelf.c (print_ops): Fix DW_OP_call[24] decoding.
2986 * readelf.c (print_ops): Print (empty)\n when LEN == 0.
2988 2009-01-24 Ulrich Drepper <drepper@redhat.com>
2990 * readelf.c (print_debug_frame_section): Fix computation of vma_base
2991 for PC-relative mode.
2993 2009-01-23 Ulrich Drepper <drepper@redhat.com>
2995 * size.c (process_file): When handling archive, close file descriptor
2996 here. For unknown file format also close file descriptor.
2997 (handle_ar): Don't close file descriptor here.
2999 * readelf.c (parse_opt): Move code to add to dump_data_sections and
3000 string_sections list in local function add_dump_section. Adjust 'x'
3001 key handling. For 'a' key add .strtab, .dynstr, and .comment section
3002 to string_sections list.
3004 2009-01-22 Roland McGrath <roland@redhat.com>
3006 * readelf.c (print_phdr): Don't print section mapping when no sections.
3008 * Makefile.am (AM_CFLAGS): Pass -Wno-format for *_no_Wformat.
3010 * readelf.c (print_debug_frame_section): Initialize IS_SIGNED to false
3011 and reset it only for the 'true' cases.
3013 * Makefile.am (addr2line_no_Wformat): New variable.
3015 * readelf.c (print_debug_frame_section): Use t instead of j formats
3016 for ptrdiff_t OFFSET.
3018 2009-01-21 Ulrich Drepper <drepper@redhat.com>
3020 * elflint.c (check_program_header): Fix typo in .eh_frame_hdr section
3021 test. Handle debuginfo files.
3022 (check_exception_data): First sanity test.
3024 2009-01-17 Ulrich Drepper <drepper@redhat.com>
3026 * readelf.c (print_debug_exception_table): Show target of ar_disp
3029 * elflint.c (check_program_header): Add most consistency checks for
3030 PT_GNU_EH_FRAME entry.
3032 * addr2line.c: Use ARGP_PROGRAM_VERSION_HOOK_DEF and
3033 ARGP_PROGRAM_BUG_ADDRESS_DEF.
3035 * elfcmp.c: Likewise.
3036 * elflint.c: Likewise.
3037 * findtextrel.c: Likewise.
3040 * objdump.c: Likewise.
3041 * ranlib.c: Likewise.
3042 * readelf.c: Likewise.
3045 * strings.c: Likewise.
3046 * strip.c: Likewise.
3047 * unstrip.c: Likewise.
3049 2009-01-16 Ulrich Drepper <drepper@redhat.com>
3051 * elflint.c (check_program_header): Check that PT_GNU_EH_FRAME entry
3052 matches .eh_frame_hdr section, if it is available. Also check that
3053 the segment is allocated, not writable, not executable.
3055 * readelf.c: Add -e option. Dump exception and unwind related
3056 sections. Add -e to -a.
3057 (print_encoding_base): Handle DW_EH_PE_omit.
3058 (print_debug_exception_table): Beginning of support.
3059 (print_debug): Hook up print_debug_exception_table for
3060 .gcc_except_table sections.
3062 * readelf.c (print_debug_frame_section): Some fixes for last change.
3064 2009-01-15 Ulrich Drepper <drepper@redhat.com>
3066 * readelf.c (print_encoding): Now a toplevel function.
3067 (print_relinfo): Likewise.
3068 (print_encoding_base): Broken out of print_debug_frame_section.
3069 (print_debug_frame_section): Print different header for .eh_frame
3070 sections. Fix recognition of matching CIEs in .debug_frame sections.
3071 Print absolute offset for PC-relative FDE locations. Don't print
3072 table header for FDEs if the table is empty.
3073 (read_encoded): New function.
3074 (print_debug_frame_hdr_section): New function.
3075 (print_debug): Hook up print_debug_frame_hdr_section for .eh_frame_hdr
3078 * readelf.c (handle_relocs_rel): Print section number.
3079 (print_debug_abbrev_section): Likewise.
3080 (print_debug_aranges_section): Likewise.
3081 (print_debug_ranges_section): Likewise.
3082 (print_debug_info_section): Likewise.
3083 (print_debug_line_section): Likewise.
3084 (print_debug_loc_section): Likewise.
3085 (print_debug_macinfo_section): Likewise.
3086 (print_debug_pubnames_section): Likewise.
3087 (print_debug_str_section): Likewise.
3089 2009-01-10 Ulrich Drepper <drepper@redhat.com>
3091 * strings.c (read_block): Fix typo in error message string.
3093 2009-01-07 Ulrich Drepper <drepper@redhat.com>
3095 * ld.c (ld_new_searchdir): Fix adding to search path list.
3097 2009-01-06 Ulrich Drepper <drepper@redhat.com>
3099 * readelf.c: Implement call frame debug section dumping.
3101 2009-01-05 Roland McGrath <roland@redhat.com>
3103 * elfcmp.c: Exit with status 2 for errors (like cmp, diff, grep).
3104 Status 1 (aka EXIT_FAILURE) is only for completed OK but not equal.
3106 2009-01-01 Ulrich Drepper <drepper@redhat.com>
3108 * addr2line.c: Update copyright year.
3110 * elfcmp.c: Likewise.
3111 * elflint.c: Likewise.
3112 * findtextrel.c: Likewise.
3115 * objdump.c: Likewise.
3116 * ranlib.c: Likewise.
3117 * readelf.c: Likewise.
3119 * strings.c: Likewise.
3120 * strip.c: Likewise.
3121 * unstrip.c: Likewise.
3123 2008-12-11 Roland McGrath <roland@redhat.com>
3125 * nm.c (sym_name): New function.
3126 (show_symbols_sysv): Use it in place of elf_strptr.
3127 (show_symbols_bsd, show_symbols_posix): Likewise.
3130 * nm.c (show_symbols_sysv): Use an alloca'd backup section name when
3133 2008-12-02 Roland McGrath <roland@redhat.com>
3135 * readelf.c (count_dwflmod, process_file): Don't presume encoding of
3136 nonzero OFFSET argument to dwfl_getmodules.
3138 2008-08-07 Roland McGrath <roland@redhat.com>
3140 * addr2line.c (main): Pass string to handle_address.
3141 (see_one_module): New function, subroutine of handle_address.
3142 (find_symbol): Likewise.
3143 (handle_address): Take string argument rather than address.
3144 Convert plain number, or handle strings like "(section)+offset"
3147 2008-08-01 Roland McGrath <roland@redhat.com>
3149 * readelf.c (handle_core_item): Handle 'B' type for 1-origin bitset.
3150 For 'b' and 'B', print <x-y,z> or ~<x,y-z> rather than 1/0 string.
3152 * readelf.c (convert): Take new argument SIZE.
3153 (handle_core_register, handle_core_item): Update callers.
3154 (handle_core_item): Take new arg REPEATED_SIZE.
3155 (handle_core_items): Special case for a singleton item,
3156 let handle_core_item handle repeats if it wants to.
3158 * readelf.c (handle_core_items): Give abridged output
3159 for identical groups repeated more than twice.
3161 2008-07-04 Roland McGrath <roland@redhat.com>
3163 * readelf.c (handle_core_items): Handle ELF_T_ADDR.
3165 2008-04-10 Roland McGrath <roland@redhat.com>
3167 * strip.c (handle_elf): Don't keep sections that kept symbol tables
3168 refer to. Instead, just be sure to preserve the original symbol
3169 table in the debug file so those symbols go with their sections and
3170 can be elided from the stripped version of the symbol table.
3172 * strip.c (handle_elf): When a discarded section kept in the debug
3173 file refers to a nondiscard section via sh_link/sh_info, preserve
3174 that nondiscarded section unmodified in the debug file as well.
3175 Skip adjustment of discarded sections symbol table references when
3176 that symbol table is copied in this way.
3178 * elflint.c (check_symtab): Don't crash from missing symbol names
3179 after diagnosing bogus strtab.
3181 * strip.c (handle_elf): Cosmetic cleanup in special section contents
3182 adjustment for symtab changes.
3184 2008-03-31 Roland McGrath <roland@redhat.com>
3186 * elflint.c (check_sections): Add checks on SHF_EXECINSTR sections:
3187 must be SHT_PROGBITS, must not be SHF_WRITE. Let backend hook
3188 excuse a special section.
3190 2008-03-27 Roland McGrath <roland@redhat.com>
3192 * elflint.c (check_sections): Check that executability and writability
3193 of sections is reflected in segment p_flags.
3195 2008-03-26 Roland McGrath <roland@redhat.com>
3197 * elflint.c (check_program_header): Accept PT_GNU_RELRO p_flags
3198 that matches its PT_LOAD's p_flags &~ PF_W. On sparc, PF_X really
3201 2008-02-29 Roland McGrath <roland@redhat.com>
3203 * readelf.c (print_attributes): Add a cast.
3204 * elflint.c (check_attributes): Likewise.
3206 * unaligned.h (add_8ubyte_unaligned): Cast PTR argument for parity
3207 with [UNALIGNED_ACCESS_CLASS == BYTE_ORDER] definition.
3208 (add_4ubyte_unaligned, add_2ubyte_unaligned): Likewise.
3210 2008-02-03 Ulrich Drepper <drepper@redhat.com>
3212 * i386_ld.c (elf_i386_count_relocations): Implement R_386_TLS_GD
3213 when linked into executable.
3214 (elf_i386_create_relocations): Likewise.
3216 2008-02-20 Roland McGrath <roland@redhat.com>
3218 * readelf.c (print_attributes): New function.
3219 (process_elf_file): Call it under -A.
3221 * elflint.c (check_attributes): Implement it for real.
3223 2008-02-19 Roland McGrath <roland@redhat.com>
3225 * elflint.c (special_sections): Handle .gnu.attributes section.
3226 (check_sections): Likewise.
3227 (check_attributes): New function.
3229 2008-02-10 Roland McGrath <roland@redhat.com>
3231 * elfcmp.c (main): Ignore sh_offset differences in non-SHF_ALLOC
3232 sections and ET_REL files.
3234 2008-02-02 Ulrich Drepper <drepper@redhat.com>
3236 * elf32-i386.script: Add .eh_frame_hdr, .tdata, and .tbss sections.
3237 * i386_ld.c (elf_i386_count_relocations): Handle R_386_TLS_LDO_32
3239 (elf_i386_create_relocations): Likewise.
3240 * ld.h (struct ld_state): Add need_tls, tls_start, and tls_tcb
3242 * ldgeneric.c (add_section): If TLS section is used, set need_tls flag.
3243 (ld_generic_create_outfile): Add PT_TLS entry to program header.
3244 Fix generation of PT_GNU_STACK entry.
3246 2008-02-01 Ulrich Drepper <drepper@redhat.com>
3248 * ld.c (replace_args): Prevent loop over replacements if the parameter
3249 is only two characters long.
3251 * ld.c: Recognize sha1 argument for --build-id parameter.
3252 * ldgeneric.c (create_build_id_section): Handle sha1.
3253 (compute_hash_sum): New function. Broken out of compute_build_id.
3254 Take hash function and context as parameters.
3255 (compute_build_id): Use compute_hash_sum for md5 and the new sha1
3258 2008-01-31 Ulrich Drepper <drepper@redhat.com>
3260 * elf32-i386.script: Add .note.ABI-tag and .note.gnu.build-id sections.
3261 * ld.c: Recognize --build-id command line parameter.
3262 * ld.h: Define scn_dot_note_gnu_build_id.
3263 (struct ld_state): Add build_id and buildidscnidx elements.
3264 * ldgeneric.c: Implement --build-id command line parameter.
3265 * ldlex.l (ID): Recognize - as valid character after the first one.
3267 2008-01-29 Ulrich Drepper <drepper@redhat.com>
3269 * ld.c (replace_args): New function.
3270 (main): Use it to rewrite old-style parameters.
3272 * elf32-i386.script: Add .gnu.hash section.
3273 * ldgeneric.c (optimal_bucket_size): A tiny bit more efficient.
3274 (fillin_special_symbol): Initialize st_size.
3275 (sortfct_hashval): New function.
3276 (create_gnu_hash): New function.
3277 (create_hash): New function.
3278 (ld_generic_create_outfile): Use the new functions to create the
3281 * elflint.c (check_gnu_hash): Fix index value printed in error message.
3283 2008-01-24 Ulrich Drepper <drepper@redhat.com>
3285 * elflint.c (check_group): Check that signature symbol for section
3286 group is not an empty string.
3287 * ldgeneric.c: Remove magic assignment of indeces in the dynsym
3288 section. Start implementation of --hash-style.
3289 * i386_ld.c: Likewise.
3290 * ld.c: Recognize --hash-style.
3291 * ld.h (struct scninfo): Add comdat_group.
3292 Add additional parameter to finalize_plt callback.
3294 2008-01-22 Ulrich Drepper <drepper@redhat.com>
3296 * ld.h (struct callbacks): Add initialize_gotplt.
3297 (struct scnhead): Add scn_dot_gotplt.
3298 (struct ld_state): Add gotpltscnidx.
3299 * i386_ld.c (elf_i386_initialize_plt): Minor optimization.
3300 (elf_i386_initialize_pltrel): Likewise.
3301 (elf_i386_initialize_got): There is now a separate .got.plt, so
3302 don't do the PLT-related work here. Initialize d_type.
3303 (elf_i386_initialize_gotplt): New function.
3304 (elf_i386_plt0): Use ud2a after indirect jump.
3305 (elf_i386_pic_plt0_entry): Likewise.
3306 (elf_i386_finalize_plt): Reference now .got.plt.
3307 (elf_i386_count_relocations): For GOT entries which need no relocation
3308 don't bump nrel_got.
3309 (elf_i386_create_relocations): Also get .got.plt. Rewrite R-386_GOT32
3310 handling for split .got/.got.plt.
3311 (elf_i386_ld_init): Initialize callbacks.initialize_gotplt.
3312 * elf32-i386.script: Sort sections for security. There are no .got
3313 input sections. Add .got.plt.
3314 * ldgeneric.c (ld_generic_generate_sections): Add .got.plt section.
3315 (ld_generic_create_outfile): Initialize .got.plt section.
3316 Use .got.plt address for _GLOBAL_OFFSET_TABLE_ symbol and DT_PLTGOT.
3318 2008-01-19 Ulrich Drepper <drepper@redhat.com>
3320 * i386_ld.c (elf_i386_count_relocations): PLT relocations for undefined
3321 symbols are not carried over into statically linked output files.
3322 Add dummy entries for more TLS relocations.
3324 * ld.c (options): Add long names for -( and -).
3326 * ldgeneric.c (check_definition): For newly found definitions don't
3327 mark section as used if symbol is absolute.
3328 (extract_from_archive): Only assign archive sequence number the first
3329 time the archive is handled. Update ld_state.last_archive_used
3330 if any symbol was used. Remove nround variable.
3331 (file_process2): When using symbol from an archive, update
3332 ld_state.group_start_archive, ld_state.archives, and
3333 ld_state.tailarchives.
3334 (ld_generic_file_process): If group is not handled anymore, after
3335 freeing ELF handles for the archives, clear ld_state.archives and
3336 *nextp. Fix wrong logic in recognizing first iteration of group
3337 loop. When clearing flags, also clear ld_state.group_start_archive.
3339 2008-01-11 Ulrich Drepper <drepper@redhat.com>
3341 * objdump.c (show_disasm): Adjust disassembler format string for
3344 2008-01-04 Roland McGrath <roland@redhat.com>
3346 * readelf.c (handle_core_items): Take new arg DESCSZ; if nonzero,
3347 a size greater than the items cover means multiple sets of items.
3348 (handle_core_note): Update caller.
3350 2008-01-04 Roland McGrath <roland@redhat.com>
3352 * strip.c (handle_elf): Move SHDRIDX defn to silence gcc warning.
3354 2008-01-03 Roland McGrath <roland@redhat.com>
3356 * ld.h (linked_from_dso_p): Use __attribute__ ((__gnu_inline__)).
3358 * elflint.c (check_dynamic): Remove duplicate initializer.
3360 2008-01-02 Ulrich Drepper <drepper@redhat.com>
3362 * addr2line.c: Update copyright year.
3364 * elfcmp.c: Likewise.
3365 * elflint.c: Likewise.
3366 * findtextrel.c: Likewise.
3369 * objdump.c: Likewise.
3370 * ranlib.c: Likewise.
3371 * readelf.c: Likewise.
3373 * strings.c: Likewise.
3374 * strip.c: Likewise.
3375 * unstrip.c: Likewise.
3377 2007-12-30 Ulrich Drepper <drepper@redhat.com>
3379 * objdump (show_disasm): Use %e after third parameter.
3381 2007-12-21 Ulrich Drepper <drepper@redhat.com>
3383 * strip.c: Fix wrong parenthesis in a few branch predictions.
3384 * strings.c: Likewise.
3386 2007-12-20 Ulrich Drepper <drepper@redhat.com>
3388 * Makefile.am (DEFS): Add DEBUGPRED.
3389 * addr2line.c: Include debugpred.h.
3391 * elfcmp.c: Likewise.
3392 * elflint.c: Likewise.
3393 * findtextrel.c: Likewise.
3395 * objdump.c: Likewise.
3396 * ranlib.c: Likewise.
3397 * readelf.c: Likewise.
3399 * strings.c: Likewise.
3400 * strip.c: Likewise.
3401 * unstrip.c: Likewise.
3402 * debugpred.h: New file.
3404 * readelf.c (handle_relocs_rel): Use elf_scnshndx.
3405 (handle_relocs_rela): Likewise.
3407 * readelf.c: Add lots of likely/unlikely.
3409 * elflint.c: Minor cleanups.
3411 2007-11-19 Roland McGrath <roland@redhat.com>
3413 * readelf.c (print_ops): Handle all bad op codes gracefully.
3414 Print their numbers instead of just ???.
3416 2007-11-09 Roland McGrath <roland@redhat.com>
3418 * readelf.c (attr_callback): Handle DW_AT_data_location.
3419 Handle block forms to mean a DWARF expression for DW_AT_allocated,
3420 DW_AT_associated, DW_AT_bit_size, DW_AT_bit_offset, DW_AT_bit_stride,
3421 DW_AT_byte_size, DW_AT_byte_stride, DW_AT_count, DW_AT_lower_bound,
3424 2007-10-20 Roland McGrath <roland@redhat.com>
3426 * unstrip.c (options): Update -R description.
3427 (struct symbol): Put symbol details a union with a size_t pointer
3429 (compare_symbols_output): Use null ->name as marker for discard
3430 symbols, not zero *->map.
3431 (copy_elided_sections): Record forwarding pointers for discarded
3432 duplicates and fill SYMNDX_MAP elements through them.
3434 * readelf.c (process_file): Set offline_next_address to 0 at start.
3435 (struct process_dwflmod_args): New type.
3436 (process_dwflmod): Take args in it, pass fd to process_elf_file.
3437 (process_file): Update caller; dup FD for passing to libdwfl.
3438 (process_elf_file): Take new arg FD. For ET_REL file when
3439 displaying data affected by libdwfl relocation, open a new Elf handle.
3441 2007-10-17 Roland McGrath <roland@redhat.com>
3443 * readelf.c (print_debug_line_section): For invalid data inside a
3444 unit with plausible length, keep printing at the next unit boundary.
3446 * readelf.c (attr_callback): Use dwarf_formref_die, not dwarf_formref.
3448 2007-10-16 Roland McGrath <roland@redhat.com>
3450 * readelf.c (hex_dump): Fix rounding error in whitespace calculation.
3452 2007-10-15 Roland McGrath <roland@redhat.com>
3454 * make-debug-archive.in: New file.
3455 * Makefile.am (EXTRA_DIST): Add it.
3456 (make-debug-archive): New target.
3457 (bin_SCRIPTS, CLEANFILES): Add it.
3459 2007-10-10 Roland McGrath <roland@redhat.com>
3461 * elflint.c (special_sections): Add new attrflag value exact_or_gnuld.
3462 Use it to check MERGE|STRINGS for .debug_str.
3463 (check_sections): Handle exact_or_gnuld.
3465 2007-10-08 Roland McGrath <roland@redhat.com>
3467 * readelf.c (handle_core_item): Handle 'T'|0x80 to indicate
3468 64-bit struct timeval with 32-bit tv_usec.
3470 2007-10-07 Roland McGrath <roland@redhat.com>
3472 * readelf.c (check_archive_index): New function.
3473 (process_file): Call it. Change signature to take only fd and name.
3474 Use libdwfl to open the file, then iterate on its modules (multiple
3475 for an archive) to print file name and call process_elf_file.
3476 (main): Update caller. Let process_file do elf_begin.
3477 (count_dwflmod, process_dwflmod, find_no_debuginfo): New functions.
3478 (process_elf_file): Take only Dwfl_Module * argument.
3479 Don't print the file name here.
3480 (print_debug_*_section): Take Dwfl_Module * argument.
3481 (print_debug): Likewise. Update caller.
3482 (format_dwarf_addr): New function.
3483 (print_debug_ranges_section): Use it.
3484 (attr_callback): Likewise.
3485 (print_debug_line_section, print_debug_loc_section): Likewise.
3487 * readelf.c (print_debug_ranges_section): Translate all strings.
3488 (print_debug_loc_section): Likewise.
3490 * unstrip.c (copy_elided_sections): Initialize SEC.
3492 * ar.c (do_oper_insert): Put trailing / on short names.
3494 * arlib.h (MAX_AR_NAME_LEN): Decrease by one.
3496 * arlib2.c (arlib_add_long_name): Adjust for header size.
3498 * arlib.c (arlib_finalize): Pad long name table to keep size even.
3500 * ar.c (do_oper_insert): Use write_retry for padding write.
3502 * ar.c (do_oper_insert): Initialize CUR_OFF in no_old case.
3503 Unconditionally set FOUND[CNT]->elf when setting ->mem.
3504 (remember_long_name): New function.
3505 (do_oper_insert): Call it. Correctly use length of basename,
3506 not original name. Don't store long name twice for new member.
3508 2007-10-06 Roland McGrath <roland@redhat.com>
3510 * elflint.c (check_note): Skip empty segment.
3511 (check_note_section): Skip empty section.
3513 * unstrip.c (options, parse_opt, struct arg_info): Grok -R/--relocate.
3514 (handle_output_dir_module, handle_implicit_modules): Pass it down.
3515 (handle_dwfl_module): When set, use ET_REL already loaded by Dwfl.
3516 (compare_alloc_sections): Take new arg REL, ignore address if true.
3517 (compare_sections): Likewise, pass it down.
3518 (compare_sections_rel, compare_sections_nonrel): New functions.
3519 (find_alloc_sections_prelink, copy_elided_sections): Use them
3520 instead of compare_sections.
3521 (sections_match): New function, broken out of ...
3522 (find_alloc_section): ... here.
3523 (copy_elided_sections): Reorganize section match-up logic.
3524 Use sections_match for SHF_ALLOC in ET_REL.
3525 For ET_REL, let the nonzero sh_addr from the debug file dominate.
3527 * unstrip.c (add_new_section_symbols): Take new arg REL.
3528 When true, do not update section symbol values.
3529 (collect_symbols): Likewise. Update section symbols with address
3530 of chosen output section, not original section.
3531 (check_symtab_section_symbols, copy_elided_sections): Update callers.
3533 * unstrip.c (compare_alloc_sections): At the same address, preserve
3534 original section order.
3536 * elflint.c (special_sections): Don't require MERGE|STRINGS for
3537 .debug_str, it didn't always have them with older tools.
3539 * elflint.c (check_symtab, check_one_reloc): Ignore sh_addr in ET_REL.
3541 2007-10-05 Roland McGrath <roland@redhat.com>
3543 * elflint.c (check_symtab): Allow SHN_UNDEF _GLOBAL_OFFSET_TABLE_ in
3546 * elflint.c (check_symtab): For _GLOBAL_OFFSET_TABLE_, diagnose
3547 SHN_UNDEF as "bad section". Use shndx value in messages.
3549 * elflint.c (special_sections): Add ".debug_str". Decrement namelen
3550 for ".debug" so it matches as a prefix.
3551 (IS_KNOWN_SPECIAL): New macro.
3552 (check_sections): Use it for ".plt" match. Cite wrong SHT_NOBITS
3553 type even under -d, for a .debug* or .shstrtab section.
3555 * readelf.c (print_ops): Use hex for address operand.
3557 2007-10-04 Roland McGrath <roland@redhat.com>
3559 * unstrip.c (copy_elided_sections): Initialize NDX_SECTION element for
3560 .gnu_debuglink section to SHN_UNDEF. Drop STT_SECTION symbols for
3561 sections mapped to SHN_UNDEF.
3563 2007-10-04 Ulrich Drepper <drepper@redhat.com>
3565 * readelf.c (dump_archive_index): Avoid warning about uninitialized
3566 variable with older glibc versions.
3567 Add some branch prediction.
3569 2007-10-04 Roland McGrath <roland@redhat.com>
3571 * readelf.c (print_archive_index): New variable.
3572 (options, parse_opt): Accept -c/--archive-index to set it.
3573 (dump_archive_index): New function.
3574 (process_file): Take new arg WILL_PRINT_ARCHIVE_INDEX.
3575 Call dump_archive_index on archives if set.
3576 (main): Update caller.
3577 (any_control_option): Give it file scope, moved out of ...
3578 (parse_opt): ... here.
3580 2007-10-03 Roland McGrath <roland@redhat.com>
3582 * unstrip.c (struct arg_info): Add `list' flag.
3583 (options, parse_opt): Grok -n/--list to set it.
3584 (list_module): New function.
3585 (handle_implicit_modules): Call it under -n.
3587 * elflint.c (check_note_section): New function.
3588 (check_sections): Call it for SHT_NOTE.
3590 * readelf.c (handle_notes): Use sections when available.
3592 * elflint.c (check_note_data): New function, broken out of ...
3593 (check_note): ... here. Call it and elf_getdata_rawchunk.
3595 * readelf.c (handle_auxv_note): Take offset as argument, not buffer.
3596 Use elf_getdata_rawchunk and gelf_getauxv.
3597 (handle_notes_data): New function, broken out of ...
3598 (handle_notes): ... here. Call it and elf_getdata_rawchunk.
3600 2007-10-01 Roland McGrath <roland@redhat.com>
3602 * readelf.c (hex_dump): Fix transposed subtraction generating spaces.
3604 * readelf.c (hex_dump): Fix line header to be hex instead of decimal.
3606 2007-09-10 Roland McGrath <roland@redhat.com>
3608 * readelf.c (options): Give -p optional argument, alias --string-dump.
3609 (string_sections, string_sections_tail): New static variables.
3610 (parse_opt): Set them when -p has an argument.
3611 (print_string_section): New function, broken out of ...
3612 (print_strings): ... here. Call it.
3613 (dump_data_section): New function, broken out of ...
3614 (dump_data): ... here. Call it.
3615 (for_each_section_argument): New function, broken out of ...
3616 (dump_data): ... here. Call it.
3617 (dump_strings): New function.
3619 2007-08-31 Roland McGrath <roland@redhat.com>
3621 * readelf.c (print_strings): Typo fix.
3623 2007-08-23 Roland McGrath <roland@redhat.com>
3625 * readelf.c (printf_with_wrap): Function removed.
3626 (REGISTER_WRAP_COLUMN): New macro.
3627 (handle_core_register): Use print_core_item instead.
3628 (struct register_info): New type.
3629 (compare_registers, compare_register_sets): New functions.
3630 (register_bitpos, compare_sets_by_info): New functions.
3631 (handle_core_registers): Use those to segregate and sort registers
3634 * readelf.c (ITEM_WRAP_COLUMN): New macro.
3635 (print_core_item): New function.
3636 (handle_core_item): Use it instead of printf_with_wrap.
3637 (compare_core_items, compare_core_item_groups): New functions.
3638 (handle_core_items): Use them. Sort by group and force line breaks
3641 * readelf.c (handle_core_registers, handle_core_items): New functions,
3643 (handle_core_note): ... here. Call them.
3645 2007-08-22 Roland McGrath <roland@redhat.com>
3647 * unstrip.c (new_shstrtab): New function, broken out of ...
3648 (copy_elided_sections): ... here.
3650 2007-08-20 Roland McGrath <roland@redhat.com>
3652 Avoid local function trampolines in nm binary.
3653 * nm.c (sort_by_address): Move to a static function instead of local
3654 inside show_symbols.
3655 (sort_by_name_strtab): New static variable.
3656 (sort_by_name): Use it. Move to a static function instead of local
3657 inside show_symbols.
3658 (show_symbols): Set sort_by_name_strtab.
3660 2007-08-19 Roland McGrath <roland@redhat.com>
3662 * readelf.c (handle_auxv_note): New function.
3663 (handle_notes): Call it.
3665 * readelf.c (printf_with_wrap, convert): New functions.
3666 (handle_core_item, (handle_core_register): New functions.
3667 (handle_notes): Call those with details from ebl_core_note.
3669 2007-08-12 Roland McGrath <roland@redhat.com>
3671 * elflint.c (check_note): Accept type 0 with name "Linux".
3673 * elflint.c (special_sections): Accept SHF_ALLOC for ".note".
3675 * elflint.c (section_flags_string): Return "none" for 0, not "".
3677 2007-08-11 Roland McGrath <roland@redhat.com>
3679 * elflint.c (check_note): Accept NT_GNU_HWCAP, NT_GNU_BUILD_ID.
3681 2007-08-04 Ulrich Drepper <drepper@redhat.com>
3683 * readelf.c (hex_dump): Use isprint to determine whether to print
3684 character itself or full stop character.
3685 (dump_data): No need to check endp for NULL after strtol call.
3687 2007-08-03 Roland McGrath <roland@redhat.com>
3689 * readelf.c (print_string_sections): New variable.
3690 (options, parse_opt): Handle --strings/-p to set it.
3691 (print_strings): New function.
3692 (process_elf_file): Call it under -p.
3694 * readelf.c (options): Add hidden aliases --segments, --sections,
3695 as taken by binutils readelf.
3697 2007-08-01 Roland McGrath <roland@redhat.com>
3699 * readelf.c (dump_data_sections, dump_data_sections_tail):
3701 (options, parse_opt): Handle --hex-dump/-x, set them.
3702 (hex_dump): New function.
3703 (dump_data): New function, call it.
3704 (process_elf_file): Call it.
3706 2007-07-25 Roland McGrath <roland@redhat.com>
3708 * addr2line.c (show_symbols): New variable.
3709 (print_addrsym): New function.
3710 (handle_address): Call it.
3711 (options, parse_opt): Handle -S/--symbols.
3713 2007-06-05 Ulrich Drepper <drepper@redhat.com>
3715 * addr2line.c: Update for latest autoconf header.
3717 * elfcmp.c: Likewise.
3718 * elflint.c: Likewise.
3719 * findtextrel.c: Likewise.
3721 * ldgeneric.c: Likewise.
3723 * objdump.c: Likewise.
3724 * ranlib.c: Likewise.
3725 * readelf.c: Likewise.
3727 * strings.c: Likewise.
3728 * strip.c: Likewise.
3729 * unstrip.c: Likewise.
3731 2007-05-18 Roland McGrath <roland@redhat.com>
3733 * unstrip.c (copy_elided_sections): Match up non-NOBITS sections with
3734 stripped file, so as not to duplicate a section copied in both.
3736 * strip.c (handle_elf): Keep SHT_NOTE section copies in the debug file.
3738 2007-05-17 Roland McGrath <roland@redhat.com>
3740 * unstrip.c (copy_elided_sections): Don't call gelf_newphdr for 0.
3742 * unstrip.c (handle_file): Tweak BIAS != 0 warning.
3744 * unstrip.c (handle_file): Take new arg CREATE_DIRS. If set,
3745 call make_directories here.
3746 (handle_explicit_files): Take new arg CREATE_DIRS, pass it down.
3747 (handle_dwfl_module): Likewise.
3748 (handle_implicit_modules): Update callers.
3749 (handle_output_dir_module): Likewise. Don't do make_directories here.
3751 * unstrip.c (get_section_name): New function, broken out of ...
3752 (copy_elided_sections): here. Update callers.
3753 (find_alloc_section): Broken out of ...
3754 (copy_elided_sections): ... here. Update caller.
3755 (symtab_count_leading_section_symbols): Take new arg NEWSYMDATA,
3756 update STT_SECTION symbols' st_value fields as a side effect.
3757 (check_symtab_section_symbols): Update caller.
3758 (add_new_section_symbols): Set st_value in symbols added.
3759 (collect_symbols): Reset S->value for STT_SECTION symbols recorded.
3760 Take new arg SPLIT_BSS. Adjust S->shndx recorded for symbols moved
3761 from .bss to .dynbss.
3762 (find_alloc_sections_prelink): New function. Associate debug file
3763 allocated SHT_NOBITS shdrs with stripped moved by prelink via
3764 .gnu.prelink_undo information.
3765 (copy_elided_sections): Call it when we couldn't find every allocated
3766 section. Don't use a debug file non-NOBITS section if SHF_ALLOC.
3767 Take STRIPPED_EHDR arg instead of E_TYPE and PHNUM.
3768 (handle_file): Update callers.
3770 * unstrip.c (copy_elided_sections): Ignore unfound unallocated section
3773 * elflint.c (check_sections): Fix association of segments with
3774 sections when p_memsz > p_filesz.
3776 2007-04-29 Roland McGrath <roland@redhat.com>
3778 * addr2line.c (options, main): Tweak argp group settings to fix
3781 2007-04-28 Roland McGrath <roland@redhat.com>
3783 * strip.c (handle_elf): Update debug file's SHT_NOBITS sections'
3784 sizes to match sections adjusted in the stripped file.
3786 2007-04-24 Roland McGrath <roland@redhat.com>
3788 * elfcmp.c (OPT_HASH_INEXACT): New macro.
3789 (hash_inexact): New variable.
3790 (options, parse_opt): Add --hash-inexact option to set it.
3791 (hash_content_equivalent): New function.
3792 (main): Call it for differing SHT_HASH sections under --hash-inexact.
3794 2007-04-23 Roland McGrath <roland@redhat.com>
3796 * unstrip.c: New file.
3797 * Makefile.am (bin_PROGRAMS): Add it.
3798 (unstrip_LDADD): New variable.
3800 * strip.c (options): Allow --output for -o.
3802 2007-02-15 Ulrich Drepper <drepper@redhat.com>
3804 * readelf.c: Remove unused code. Add a few consts.
3806 2007-02-15 Roland McGrath <roland@redhat.com>
3808 * readelf.c (print_debug): Fix brainos in SHDR test.
3810 2007-02-05 Roland McGrath <roland@redhat.com>
3812 * ar.c: Include <limits.h>, since we use LONG_MAX.
3814 2007-02-05 Ulrich Drepper <drepper@redhat.com>
3816 * ar.c: Add ugly hack to work around gcc complaining that we
3817 ignore fchown's return value.
3818 (do_oper_insert): Handle error when writing padding.
3819 * ranlib.c: Add fchown complain work around.
3821 * arlib.c: Make symtab a global variable. Change all users.
3822 * arlib2.c: Likewise.
3823 * ranlib.c: Likewise.
3825 * arlib.h: Declare it.
3827 2007-01-11 Roland McGrath <roland@redhat.com>
3829 * elflint.c (check_sections): Use ebl_machine_section_flag_check on
3830 SHF_MASKPROC bits separately from generic sh_flags validation.
3832 2007-02-04 Ulrich Drepper <drepper@redhat.com>
3835 * arlib.c: New file.
3836 * arlib2.c: New file.
3837 * arlib.h: New file.
3838 * Makefile (noinst_LIBRARIES): Add libar.
3839 (libar_a_SOURCES): Define.
3841 (CFLAGS_ar): Define.
3842 * ranlib.c: Change to use arlib.
3844 * elflint.c (check_symtab): Work around GNU ld bug which omits
3845 sections but not symbols in those sections.
3847 2007-01-10 Ulrich Drepper <drepper@redhat.com>
3849 * addr2line.c: Update copyright year.
3850 * elfcmp.c: Likewise.
3851 * elflint.c: Likewise.
3852 * findtextrel.c: Likewise.
3855 * objdump.c: Likewise.
3856 * ranlib.c: Likewise.
3857 * readelf.c: Likewise.
3859 * strings.c: Likewise.
3860 * strip.c: Likewise.
3862 2006-12-09 Ulrich Drepper <drepper@redhat.com>
3864 * elflint.c (compare_hash_gnu_hash): New function. Report if the
3865 two hash tables have different content (module expected omission
3866 of undefined symbols).
3868 2006-10-31 Roland McGrath <roland@redhat.com>
3870 * elflint.c (check_program_header): Don't complain about
3871 p_filesz > p_memsz if p_memsz is zero and p_type is PT_NOTE.
3873 2006-09-19 Jakub Jelinek <jakub@redhat.com>
3875 * strip.c (process_file): Disallow -f on archives.
3877 2006-10-09 Roland McGrath <roland@redhat.com>
3879 * Makefile.am (libld_elf_i386.so): Use $(LINK), not $(CC).
3881 2006-08-29 Roland McGrath <roland@redhat.com>
3883 * Makefile.am (MAINTAINERCLEANFILES): New variable.
3885 * readelf.c (handle_relocs_rel): Typo fix, test DESTSHDR properly.
3886 Reported by Christian Aichinger <Greek0@gmx.net>.
3888 * elflint.c (valid_e_machine): Add EM_ALPHA.
3889 Reported by Christian Aichinger <Greek0@gmx.net>.
3891 2006-08-08 Ulrich Drepper <drepper@redhat.com>
3893 * elflint.c (check_dynamic): Don't require DT_HASH for DT_SYMTAB.
3894 Keep track of which "high DT" entries are present.
3895 Check that either old or GNU-style hash table is present.
3896 If GNU-style hash table is used a symbol table is mandatory.
3897 Check that if any prelink entry is present all of them are.
3898 (check_gnu_hash): Only fail for undefined symbols in GNU-style hash
3899 table if they don't refer to functions.
3901 2006-07-17 Roland McGrath <roland@redhat.com>
3903 * elflint.c (struct version_namelist): Use GElf_Versym for `ndx' field.
3904 (add_version): Likewise for argument.
3905 (check_versym): Cast constant to GElf_Versym for comparison.
3907 2006-07-12 Roland McGrath <roland@redhat.com>
3909 * readelf.c (handle_gnu_hash): Add casts for machines where
3910 Elf32_Word != unsigned int.
3912 2006-07-12 Ulrich Drepper <drepper@redhat.com>
3914 * elflint.c (check_sysv_hash64): Fix printf format.
3916 2006-07-11 Roland McGrath <roland@redhat.com>
3918 * addr2line.c (options): English fix in -f doc string.
3920 * addr2line.c (use_comp_dir): New variable.
3921 (options, parse_opt): Grok -A/--absolute to set it.
3922 (handle_address): If set, prepend dwfl_line_comp_dir results to
3923 relative file names.
3925 2006-07-06 Ulrich Drepper <drepper@redhat.com>
3927 * elflint.c: Adjust for latest new hash table format.
3928 * readelf.c: Likewise.
3930 * elflint.c (check_versym): Ignore hidden bit when comparing version
3933 2006-07-05 Ulrich Drepper <drepper@redhat.com>
3935 * ldgeneric.c (ld_generic_create_outfile): Correctly recognize
3936 discarded COMDAT symbols.
3938 * i386_ld.c (elf_i386_count_relocations): Lot of corrections.
3939 (elf_i386_create_relocations): Likewise.
3940 * ld.h (struct symbol): Add local and hidden bits.
3941 * ld.c (create_special_section_symbol): These synthsized symbols
3942 are local and hidden.
3943 * ldgeneric.c (file_process2): Check whether input file matches
3945 (fillin_special_symbol): Create symbols as local and/or hidden
3947 (ld_generic_create_outfile): Make local copy of symbol.
3948 Don't hide global, defined symbols in dynamic symbol table unless
3949 requested. Synthetic symbols have no version information.
3951 * elflint.c: Add support for checking 64-bit SysV-style hash tables.
3952 * readelf.c: Add support for printing 64-bit SysV-style hash tables.
3954 2006-07-04 Ulrich Drepper <drepper@redhat.com>
3956 * elflint.c (is_rel_dyn): Fix and extend DT_RELCOUNT/DT_RELACOUNT
3959 2006-07-03 Ulrich Drepper <drepper@redhat.com>
3961 * elflint.c: Add testing of DT_GNU_HASH.
3962 * readelf.c: Implement showing histogram for DT_GNU_HASH section.
3964 * Makefile.am: Add hacks to create dependency files for non-generic
3967 2006-06-12 Ulrich Drepper <drepper@redhat.com>
3969 * ldgeneric.c (ld_generic_generate_sections): Don't create .interp
3970 section if creating a DSO and no interpreter is given.
3971 (ld_generic_create_outfile): Don't store reference to symbols in
3972 discarded COMDAT groups. Don't create PHDR and INTERP program header
3973 for DSO if no interpreter is specified.
3974 (create_verneed_data): Pretty printing.
3976 * ldscript.y (content): If a DSO is created don't set default
3977 interpreter from linker script.
3979 * i386_ld.c (elf_i386_count_relocations): Do not add relocations
3980 for symbols in discarded COMDAT groups.
3981 (elf_i386_create_relocations): Likewise.
3982 * ld.h (struct scninfo): Add unused_comdat.
3983 * ldgeneric.c (add_section): Also check group signature when
3984 matching COMDAT sections.
3985 (add_relocatable_file): Ignore symbols in COMDAT group which are
3988 * elflint.c (check_one_reloc): For *_NONE relocs only check type
3989 and symbol reference.
3991 2006-06-11 Ulrich Drepper <drepper@redhat.com>
3993 * elflint.c (check_dynamic): Fix checking value of tags which are
3994 offsets in the string section. Make sure DT_STRTAB points to the
3995 section referenced in sh_link.
3997 * ld.c (options): Add headers. Add short option 'R' for '--rpath'.
3999 * ld.c: Recognize --eh-frame-hdr option.
4000 * ld.h (struct ld_state): Add eh_frame_hdr field.
4001 * ldgeneric.c (struct unw_eh_frame_hdr): Define.
4003 * ldgeneric.c (add_section): Use ebl_sh_flags_combine instead of
4005 (add_relocatable_file): Minor optimization of last change.
4006 (match_section): Don't preserve SHF_GROUP flag any longer.
4008 2006-06-10 Ulrich Drepper <drepper@redhat.com>
4010 * ld.c (parse_z_option): Recognize execstack and noexecstack.
4011 Handle record and ignore as position dependent options.
4012 (parse_z_option_2): Handle ignore and record here.
4013 * ld.h (struct ld_state): Add execstack field.
4014 * ldgeneric.c (add_relocatable_file): Recognize .note.GNU-stack
4016 (ld_generic_create_outfile): Fix program header creation in native
4017 linker. Add PT_GNU_STACK program header.
4019 2006-06-09 Ulrich Drepper <drepper@redhat.com>
4021 * i386_ld.c (elf_i386_finalize_plt): Don't change symbol table entries
4022 for PLT entries if there is no local definition.
4024 * ld.c (parse_option): Handle -z ignore like --as-needed and
4025 -z record like --no-as-needed.
4026 * ld.h (struct ld_state): Remove ignore_unused_dsos field.
4027 * ldgeneric.c (new_generated_scn): Always compute ndt_needed by
4028 looping over DSOs. When deciding about adding DT_NEEDED entries
4029 use ->as_needed instead of ignore_unused_dsos.
4031 2006-05-31 Ulrich Drepper <drepper@redhat.com>
4033 * ld.c: Recognize --as-needed and --no-as-needed options.
4034 * ld.h (struct usedfile): Add as_needed field.
4035 (struct ld_state): Likewise.
4036 * ldgeneric.c (ld_handle_filename_list): Copy as_needed flag from
4038 * ldscript.y (filename_id_list): Split to correctly parse all
4040 (mark_as_needed): Fix loop.
4042 2006-05-28 Ulrich Drepper <drepper@redhat.com>
4044 * addr2line.c (print_dwarf_function): Use unsigned type for lineno
4047 2006-05-27 Ulrich Drepper <drepper@redhat.com>
4049 * readelf.c (handle_relocs_rela): Better notations for addon value.
4050 (print_ehdr): Distinguish e_ident[EI_VERSION] from e_version.
4052 2006-04-04 Ulrich Drepper <drepper@redhat.com>
4054 * addr2line.c: Update copyright year.
4055 * elfcmp.c: Likewise.
4056 * elflint.c: Likewise.
4057 * findtextrel.c: Likewise.
4060 * objdump.c: Likewise.
4061 * ranlib.c: Likewise.
4062 * readelf.c: Likewise.
4064 * strings.c: Likewise.
4065 * strip.c: Likewise.
4067 2006-03-09 Roland McGrath <roland@redhat.com>
4069 * Makefile.am (AM_LDFLAGS): New variable.
4071 2006-03-01 Roland McGrath <roland@redhat.com>
4073 * readelf.c (dwarf_tag_string, dwarf_attr_string): Update name tables
4074 for dwarf.h changes matching 3.0 spec.
4075 (dwarf_encoding_string, dwarf_lang_string, print_ops): Likewise.
4077 2005-12-04 Ulrich Drepper <drepper@redhat.com>
4079 * elflint.c (check_one_reloc): If relocation section is not loaded,
4080 don't check whether the relocations modify read-only sections or
4081 loaded and unloaded sections.
4083 2005-11-28 Ulrich Drepper <drepper@redhat.com>
4085 * elflint.c (check_one_reloc): Take additional parameters. Use
4086 them to determine whether relocation is valid in this type of
4087 file. DSOs and executables can contain relocation sections in
4088 unloaded sections which just show the relocations the linker
4089 applied. Adjust all callers.
4090 (check_program_header): Check that PT_PHDR is loaded and that offset
4091 matches the one in the ELF header.
4093 2005-10-26 Roland McGrath <roland@redhat.com>
4095 * nm.c (get_var_range): dwarf_getloclist -> dwarf_getlocation.
4097 2005-09-03 Ulrich Drepper <drepper@redhat.com>
4099 * strip.c (handle_elf): Unify some error messages.
4100 * ld.c (main): Likewise.
4101 * ldgeneric.c (open_elf): Likewise.
4102 * elfcmp.c (main): Likewise.
4103 * elflint.c (check_elf_header): Likewise.
4105 * size.c (process_file): Fix typo in error message.
4107 * readelf.c: Lots of little cleanups. Use _unlocked functions.
4109 2005-09-02 Ulrich Drepper <drepper@redhat.com>
4111 * strings.c (main): Reset elfmap variable after munmap call.
4112 [_MUDFLAP] (map_file): Simplify mudflap debugging by not using mmap.
4114 2005-08-28 Ulrich Drepper <drepper@redhat.com>
4116 * ranlib.c: Don't define pread_retry and write_retry here.
4118 * Makefile.an [BUILD_STATIC] (libdw): Add -ldl.
4119 (CLEANFILES): Add *.gcno *.gcda *.gconv.
4121 * strings.c (process_chunk): Reorder expressions in conditional
4122 (process_chunk_mb): Likewise.
4124 * strings.c: New file.
4125 * Makefile.am (bin_PROGRAMS): Add strings.
4126 (strings_no_Wstring): Define.
4127 (strings_LDADD): Define.
4129 2005-08-27 Roland McGrath <roland@redhat.com>
4131 * addr2line.c (dwarf_diename_integrate): Function removed.
4132 (print_dwarf_function): Use plain dwarf_diename.
4134 2005-08-24 Ulrich Drepper <drepper@redhat.com>
4136 * elflint.c (check_versym): Versioned symbols should not have
4139 2005-08-15 Ulrich Drepper <drepper@redhat.com>
4141 * elflint.c (check_versym): Allow VER_NDX_LOCAL symbols to be
4144 * Makefile.am: Add rules to build ranlib.
4145 * ranlib.c: New file.
4147 2005-08-14 Roland McGrath <roland@redhat.com>
4149 * elflint.c (check_sections): Use ebl_section_type_name and allow any
4150 sh_type it recognizes.
4152 * elflint.c (check_sections): Print unknown flags in hex, don't
4153 truncate high bits. Print section number and name for unknown type.
4155 2005-08-13 Roland McGrath <roland@redhat.com>
4157 * elflint.c (check_program_header): Use ebl_segment_type_name and
4158 allow any p_type it recognizes. Include p_type value in error
4159 message for unknown type.
4161 2005-08-13 Ulrich Drepper <drepper@redhat.com>
4163 * elflint.c (check_symtab): Simplify last change a bit. Pass ehdr
4164 to ebl_check_special_symbol.
4165 (check_sections): Pass ehdr to ebl_bss_plt_p.
4167 2005-08-12 Roland McGrath <roland@redhat.com>
4169 * elflint.c (check_symtab): Check that _GLOBAL_OFFSET_TABLE_ st_shndx
4170 refers to the right section if it's not SHN_ABS.
4171 Let ebl_check_special_symbol override _G_O_T_ value and size checks.
4173 * elflint.c (check_sections): Don't complain about a non-NOBITS
4174 section taking no segment space, if it's sh_size is 0.
4176 * elflint.c (check_sections): Use ebl_bss_plt_p to see if .plt should
4177 be PROGBITS or NOBITS.
4179 * elflint.c (check_symtab): Use ebl_check_special_symbol to override
4180 standard st_value and st_size checks.
4182 2005-07-28 Roland McGrath <roland@redhat.com>
4184 * addr2line.c (options, parse_opt): Don't handle -e here.
4185 (executable): Variable removed.
4186 (argp_children): New static variable.
4187 (argp): Use it. Make const.
4188 (main): Fill in argp_children from dwfl_standard_argp ().
4189 Let libdwfl handle file selection, pass Dwfl handle to handle_address.
4190 (print_dwarf_function): New function. Try to figure out inline chain.
4191 (elf_getname): Function removed, libdwfl does it for us.
4192 (handle_address): Take Dwfl handle instead of Elf, Dwarf handles.
4193 Use dwfl_module_addrname instead of elf_getname.
4194 Use dwfl_module_getsrc and dwfl_lineinfo instead of libdw calls.
4195 * Makefile.am (INCLUDES): Add libdwfl directory to path.
4197 2005-08-10 Ulrich Drepper <drepper@redhat.com>
4199 * strip.c (parse_opt): STATE parameter is now used.
4200 Various little cleanups.
4202 * readelf.c (print_debug_line_section): Correct fallout of renaming
4203 of DW_LNS_set_epilog_begin.
4205 2005-08-08 Roland McGrath <roland@redhat.com>
4207 * strip.c (options, parse_opt): Grok -R .comment for compatibility
4208 with binutils strip. Likewise -d, -S, as aliases for -g.
4209 Likewise ignore -s/--strip-all.
4211 2005-08-07 Roland McGrath <roland@redhat.com>
4213 * strip.c (process_file): Open read-only when using a different output
4216 2005-08-06 Ulrich Drepper <drepper@redhat.com>
4218 * elflint.c (in_nobits_scn): New function.
4219 (check_versym): Allow references for defined symbols against versions
4220 of other DSOs also for symbols in nobits sections.
4221 Move a few variables around.
4223 * Makefile.am (AM_CFLAGS): Avoid duplication.
4224 Link with statis libs if BUILD_STATIC.
4226 2005-08-05 Ulrich Drepper <drepper@redhat.com>
4228 * elflint.c: Many, many more tests. Mostly related to symbol
4229 versioning. Those sections should now be completely checked.
4231 * readelf.c (print_dynamic): Use gelf_offscn.
4233 2005-08-04 Ulrich Drepper <drepper@redhat.com>
4235 * elflint.c: Add lots more tests: more extension symbol table sanity,
4236 versioning section tests, hash table tests. General cleanup.
4238 2005-08-02 Ulrich Drepper <drepper@redhat.com>
4240 * objdump.c: New file.
4241 * Makefile.am (bin_PROGRAMS): Add objdump.
4242 (objdump_LDADD): Define.
4244 * elflint.c (check_reloc_shdr): New function split out from check_rela
4246 (check_one_reloc): New function. Likewise.
4247 (check_rela): Use check_reloc_shdr and check_one_reloc.
4248 (check_rel): Likewise.
4249 (check_program_header): Check that PT_DYNAMIC entry matches .dynamic
4251 Add checks that relocations against read-only segments are flagged,
4252 that the text relocation flag is not set unnecessarily, and that
4253 relocations in one section are either against loaded or not-loaded
4256 2005-08-01 Ulrich Drepper <drepper@redhat.com>
4258 * elfcmp.c (main): Ignore section count and section name string table
4261 2005-07-27 Roland McGrath <roland@redhat.com>
4263 * elfcmp.c: Include <locale.h>.
4265 2005-07-27 Ulrich Drepper <drepper@redhat.com>
4267 * elfcmp.c: Print name and index of differing section.
4269 2005-07-24 Ulrich Drepper <drepper@redhat.com>
4271 * elfcmp.c: Implement comparing gaps between sections.
4273 2005-07-23 Ulrich Drepper <drepper@redhat.com>
4275 * elflint.c: Include libeblP.h instead of libebl.h.
4277 * readelf.c: Likewise.
4278 * elfcmp.c: Likewise.
4280 * elfcmp.c (main): Compare individual ELF header fields, excluding
4281 e_shoff instead of the whole struct at once.
4282 Use ebl_section_strip_p instead of SECTION_STRIP_P.
4283 * strip.c: Use ebl_section_strip_p instead of SECTION_STRIP_P.
4285 2005-07-22 Ulrich Drepper <drepper@redhat.com>
4287 * elfcmp.c (main): Take empty section into account when comparing
4290 * elflint.c (check_dynamic): Check that d_tag value is >= 0 before
4293 2005-07-21 Ulrich Drepper <drepper@redhat.com>
4295 * elfcmp.c: New file.
4296 * Makefile.am (bin_PROGRAMS): Add elfcmp.
4297 (elfcmp_LDADD): Define.
4299 * elflint.c (check_rela): Check that copy relocations only reference
4300 object symbols or symbols with unknown type.
4301 (check_rel): Likewise.
4303 2005-06-08 Roland McGrath <roland@redhat.com>
4305 * readelf.c (print_ops): Add consts.
4307 2005-05-31 Roland McGrath <roland@redhat.com>
4309 * readelf.c (print_debug_abbrev_section): Don't bail after first CU's
4310 abbreviations. Print a header line before each CU section.
4312 * readelf.c (print_debug_loc_section): Fix indentation for larger
4315 2005-05-30 Roland McGrath <roland@redhat.com>
4317 * readelf.c (print_debug_line_section): Print section offset of each
4318 CU's table, so they are easy to find from seeing the stmt_list value.
4320 * readelf.c (dwarf_attr_string): Add all attributes in <dwarf.h>.
4321 (attr_callback): Grok DW_AT_ranges and print offset in hex.
4323 * readelf.c (attr_callback): Add 2 to addrsize * 2 for %#0* format.
4324 (print_debug_ranges_section, print_debug_loc_section): Likewise.
4326 * readelf.c (print_ops): Take different args for indentation control.
4327 (attr_callback): Caller updated.
4328 Grok several more block-form attributes as being location expressions.
4329 For those same attributes with udata forms, format output differently
4330 for location list offset.
4331 (print_debug_loc_section): Implement it for real.
4333 * readelf.c (options): Mention ranges for --debug-dump.
4334 (enum section_e): Add section_ranges.
4335 (parse_opt): Grok "ranges" for -w/--debug-dump.
4336 (print_debug_ranges_section): New function.
4337 (print_debug): Handle .debug_ranges section.
4339 2005-05-30 Ulrich Drepper <drepper@redhat.com>
4341 * readelf.c (handle_notes): At least x86-64 need not have the note
4342 section values aligned to 8 bytes.
4344 2005-05-18 Ulrich Drepper <drepper@redhat.com>
4346 * readelf.c (dwarf_tag_string): Add new tags.
4348 2005-05-08 Roland McGrath <roland@redhat.com>
4350 * strip.c (handle_elf): Don't translate hash and versym data formats,
4351 elf_getdata already did it for us.
4353 2005-05-07 Ulrich Drepper <drepper@redhat.com>
4355 * Makefile.am (findtextrel_LDADD): Add $(libmudflap).
4356 (addr2line_LDADD): Likewise.
4358 2005-05-03 Roland McGrath <roland@redhat.com>
4360 * strip.c (handle_elf): Apply symbol table fixups to discarded
4361 relocation sections when they are being saved in the debug file.
4363 * strip.c (handle_elf): Pass EHDR->e_ident[EI_DATA] to gelf_xlatetom
4364 and gelf_xlatetof, not the native byte order.
4366 * strip.c (parse_opt): Give error if -f or -o is repeated.
4367 (main): Exit if argp_parse returns nonzero.
4369 * strip.c (debug_fname_embed): New variable.
4370 (options, parse_opt): New option -F to set it.
4372 2005-05-07 Ulrich Drepper <drepper@redhat.com>
4374 * readelf.c (parse_opt): Make any_control_option variable
4375 local. Simplify some tests.
4377 2005-05-03 Roland McGrath <roland@redhat.com>
4379 * strip.c (crc32_file): Function removed (now in ../lib).
4381 2005-05-03 Roland McGrath <roland@redhat.com>
4383 * elflint.c (is_debuginfo): New variable.
4384 (options, parse_opt): New option --debuginfo/-d to set it.
4385 (check_sections): If is_debuginfo, don't complain about SHT_NOBITS.
4386 (check_note): If is_debuginfo, don't try to get note contents.
4388 2005-04-24 Ulrich Drepper <drepper@redhat.com>
4390 * readelf.c (print_debug_abbrev_section): Don't print error when end of
4393 2005-04-14 Ulrich Drepper <drepper@redhat.com>
4395 * readelf.c (dwarf_encoding_string): New function.
4396 (dwarf_inline_string): New function.
4397 (dwarf_access_string): New function.
4398 (dwarf_visibility_string): New function.
4399 (dwarf_virtuality_string): New function.
4400 (dwarf_identifier_case_string): New function.
4401 (dwarf_calling_convention_string): New function.
4402 (dwarf_ordering_string): New function.
4403 (dwarf_discr_list_string): New function.
4404 (attr_callback): Decode man more attribute values.
4406 2005-04-01 Ulrich Drepper <drepper@redhat.com>
4408 * addr2line.c: Finish implementation of -f option.
4410 2005-03-29 Ulrich Drepper <drepper@redhat.com>
4412 * addr2line.c: New file.
4413 * Makefile.am (bin_PROGRAMS): Add addr2line.
4414 Define addr2line_LDADD.
4416 * findtextrel.c: Use new dwarf_addrdie function.
4418 * findtextrel.c: Fix usage message and re-add accidentally removed
4421 2005-03-28 Ulrich Drepper <drepper@redhat.com>
4423 * findtextrel.c: New file.
4424 * Makefile: Add rules to build findtextrel.
4426 2005-02-15 Ulrich Drepper <drepper@redhat.com>
4428 * ldlex.l: Provide ECHO definition to avoid warning.
4430 * elflint.c (check_program_header): Fix typo in RELRO test.
4432 * Makefile.am (AM_CFLAGS): Add more warning options.
4433 * elflint.c: Fix warnings introduced by the new warning options.
4434 * i386_ld.c: Likewise.
4437 * ldgeneric.c: Likewise.
4439 * readelf.c: Likewise.
4440 * sectionhash.c: Likewise.
4442 * string.c: Likewise.
4444 2005-02-05 Ulrich Drepper <drepper@redhat.com>
4446 * Makefile.am: Check for text relocations in constructed DSOs.
4448 * Makefile.am [MUDFLAP] (AM_CFLAGS): Add -fmudflap. Link all apps
4451 * ldscript.y: Add as_needed handling.
4452 * ldlex.l: Recognize AS_NEEDED token.
4453 * ld.h (struct filename_list): Add as_needed flag.
4455 2005-02-04 Ulrich Drepper <drepper@redhat.com>
4457 * elflint.c (check_symtab): Correctly determine size of GOT section.
4459 2005-01-19 Ulrich Drepper <drepper@redhat.com>
4461 * ld.c: Remove unnecessary more_help function. Print bug report
4463 * strip.c: Likewise.
4466 * readelf.c: Likewise.
4467 * elflint.c: Likewise.
4469 * elflint.c (main): Don't check for parameter problems here.
4470 (parse_opt): Do it here, where we get informed about some of them
4473 * readelf.c (main): Don't check for parameter problems here.
4474 (parse_opt): Do it here, where we get informed about some of them
4477 2005-01-11 Ulrich Drepper <drepper@redhat.com>
4479 * strip.c: Update copyright year.
4480 * readelf.c: Likewise.
4484 * elflint.c: Likewise.
4486 * elflint.c (check_symtab): Don't warn about wrong size for
4487 _DYNAMIC and __GLOBAL_OFFSET_TABLE__ for --gnu-ld.
4489 2004-10-05 Ulrich Drepper <drepper@redhat.com>
4491 * readelf.c (print_phdr): In section mapping, also indicate
4492 sections in read-only segments.
4494 2004-09-25 Ulrich Drepper <drepper@redhat.com>
4496 * readelf.c: Make compile with gcc 4.0.
4497 * strip.c: Likewise.
4499 2004-08-16 Ulrich Drepper <drepper@redhat.com>
4501 * strip.c (handle_elf): Rewrite dynamic memory handling to use of
4502 allocate to work around gcc 3.4 bug.
4504 2004-01-25 Ulrich Drepper <drepper@redhat.com>
4506 * ldlex.l (invalid_char): Better error message.
4508 2004-01-23 Ulrich Drepper <drepper@redhat.com>
4510 * readelf.c: Print SHT_GNU_LIBLIST sections.
4512 * none_ld.c: New file.
4514 2004-01-21 Ulrich Drepper <drepper@redhat.com>
4516 * Makefile.am: Enable building of machine specific linker.
4518 2004-01-20 Ulrich Drepper <drepper@redhat.com>
4520 * Makefile.am: Support building with mudflap.
4522 * i386_ld.c: Fix warnings gcc 3.4 spits out.
4523 * ldgeneric.c: Likewise.
4524 * ldscript.y: Likewise.
4525 * readelf.c: Likewise.
4526 * strip.c: Likewise.
4528 * readelf.c (print_debug_line_section): Determine address size
4531 2004-01-19 Ulrich Drepper <drepper@redhat.com>
4533 * readelf.c (print_phdr): Show which sections are covered by the
4536 * elflint.c (check_program_header): Check PT_GNU_RELRO entry.
4538 * readelf.c (print_debug_macinfo_section): Implement.
4540 2004-01-18 Ulrich Drepper <drepper@redhat.com>
4542 * readelf.c (print_debug_line_section): Implement.
4544 2004-01-17 Ulrich Drepper <drepper@redhat.com>
4546 * src/elflint.c: Use PACKAGE_NAME instead of PACKAGE.
4547 * src/ld.c: Likewise.
4548 * src/nm.c: Likewise.
4549 * src/readelf.c: Likewise.
4550 * src/size.c: Likewise.
4551 * src/strip.c: Likewise.
4553 * strip.c: Add a few more unlikely. Reduce scope of some variables.
4555 * Makefile.am: Support building with mudflap.
4557 2004-01-16 Ulrich Drepper <drepper@redhat.com>
4559 * readelf.c (print_debug_info_section): Free dies memory.
4561 * readelf.c: Print .debug_info section content.
4563 2004-01-13 Ulrich Drepper <drepper@redhat.com>
4565 * readelf.c (print_shdr): Add support for SHF_ORDERED and SHF_EXCLUDE.
4567 2004-01-12 Ulrich Drepper <drepper@redhat.com>
4569 * readelf.c (print_debug_aranges): Implement using libdw.
4571 2004-01-11 Ulrich Drepper <drepper@redhat.com>
4573 * nm.c: Adjust for Dwarf_Files type and dwarf_lineno interface change.
4575 * readelf.c: Use libdw instead of libdwarf. Not all of the old
4576 behavior is available yet.
4577 * Makefile.am: Link readelf with libdw. Remove libdwarf include path.
4579 2004-01-09 Ulrich Drepper <drepper@redhat.com>
4581 * nm.c (get_local_names): Adjust call to dwarf_nextcu.
4583 * nm.c: Implement getting information about local variables.
4585 2004-01-07 Ulrich Drepper <drepper@redhat.com>
4587 * nm.c: Read also debug information for local symbols.
4589 2004-01-05 Ulrich Drepper <drepper@redhat.com>
4591 * nm.c: Shuffle dwarf handling code around so the maximum column
4592 width can be computed ahead of printing. Avoid collection symbols
4593 which are not printed anyway.
4595 * nm.c: Rewrite dwarf handling to use libdw.
4596 * Makefile.am (AM_CFLAGS): Add -std parameter.
4597 (INCLUDES): Find header in libdw subdir.
4598 (nm_LDADD): Replace libdwarf with libdw.
4600 * elflint.c: Update copyright year.
4601 * readelf.c: Likewise.
4603 * strip.c: Likewise.
4606 2003-12-31 Ulrich Drepper <drepper@redhat.com>
4608 * strip.c (process_file): Close file before returning.
4610 2003-11-19 Ulrich Drepper <drepper@redhat.com>
4612 * readelf.c (handle_dynamic): Make column for tag name wider.
4614 2003-09-29 Ulrich Drepper <drepper@redhat.com>
4616 * readelf.c (handle_dynamic): Always terminate tag name with a space.
4618 2003-09-25 Ulrich Drepper <drepper@redhat.com>
4620 * strip.c (process_file): Don't mmap the input file, we modify the
4621 data structures and don't want the change end up on disk.
4623 2003-09-23 Jakub Jelinek <jakub@redhat.com>
4625 * unaligned.h (union u_2ubyte_unaligned,
4626 union u_4ubyte_unaligned, union u_8ubyte_unaligned): Add
4628 (add_2ubyte_unaligned, add_4ubyte_unaligned,
4629 add_8ubyte_unaligned): Avoid nesting bswap_NN macros.
4630 Read/store value through _ptr->u instead of *_ptr.
4632 2003-09-22 Ulrich Drepper <drepper@redhat.com>
4634 * size.c (show_sysv): Change type of maxlen to int.
4636 * strip.c (handle_elf): Handle the 64-bit archs which is 64-bit
4639 * i386_ld.c: Many many fixes and extensions.
4641 * ldgeneric.c: Likewise.
4643 2003-08-16 Ulrich Drepper <drepper@redhat.com>
4645 * ldgeneric.c (check_definition): Don't add symbol on dso_list if
4646 the reference is from another DSO.
4648 2003-08-15 Ulrich Drepper <drepper@redhat.com>
4650 * ldgeneric.c (find_entry_point): It is no fatal error if no entry
4651 point is found when creating a DSO.
4653 2003-08-14 Ulrich Drepper <drepper@redhat.com>
4655 * ld.c (main): Always call FLAG_UNRESOLVED.
4656 * ldgeneric.c (ld_generic_flag_unresolved): Only complain about
4657 undefined symbols if not creating DSO or ld_state.nodefs is not set.
4659 2003-08-13 Ulrich Drepper <drepper@redhat.com>
4661 * Makefile.in: Depend on libebl.a, not libebl.so.
4663 * ld.c (main): Mark stream for linker script as locked by caller.
4664 (read_version_script): Likewise.
4665 * ldlex.c: Define fread and fwrite to _unlocked variant.
4667 * i386_ld.c (elf_i386_finalize_plt): Replace #ifdefs with uses of
4669 * unaligned.h: Define target_bswap_16, target_bswap_32, and
4671 (store_2ubyte_unaligned, store_4ubyte_unaligned,
4672 store_8ubyte_unaligned): Define using new macros.
4674 2003-08-12 Ulrich Drepper <drepper@redhat.com>
4676 * i386_ld.c (elf_i386_finalize_plt): Use packed structs to access
4677 possibly unaligned memory. Support use of big endian machines.
4679 2003-08-11 Ulrich Drepper <drepper@redhat.com>
4681 * Moved to CVS archive.