1 2018-10-02 Andreas Schwab <schwab@suse.de>
3 * strip.c (handle_elf): Handle ADD/SUB relocation.
5 2018-09-13 Mark Wielaard <mark@klomp.org>
7 * readelf.c (print_shdr): Get number of section with elf_getshdrnum.
8 (print_phdr): Likewise.
10 2018-09-13 Mark Wielaard <mark@klomp.org>
12 * strip.c (handle_elf): Check against shstrndx, not e_shstrndx.
13 Explicitly set shdrstrndx for debug file.
14 * unstrip.c (copy_elf): Explicitly copy shstrndx.
15 (find_alloc_sections_prelink): Document shnum usage.
17 2018-09-13 Mark Wielaard <mark@klomp.org>
19 * elflint.c (check_elf_header): Use shnum instead of e_shnum for all
21 (check_symtab): Use shstrndx instead of e_shstrndx to get section
24 2018-09-13 Mark Wielaard <mark@klomp.org>
26 * elfcmp.c (main): Get, check and shdrstrndx for section names.
28 2018-09-12 Mark Wielaard <mark@klomp.org>
30 * elfcmp.c (main): Call ebl_section_strip_p without ehdr.
31 * strip.c (handle_elf): Likewise.
33 2018-09-12 Mark Wielaard <mark@klomp.org>
35 * elflint.c (check_symtab): Call ebl_check_special_symbol without
38 2018-07-30 Mark Wielaard <mark@klomp.org>
40 * strip.c (handle_elf): Track allocated/unallocated sections seen. Set
41 section offset of unallocated sections after handling all allocated
44 2018-08-18 Mark Wielaard <mark@klomp.org>
46 * readelf.c (print_debug_aranges_section): Make sure there is enough
47 data to read the header segment size.
49 2018-08-18 Mark Wielaard <mark@klomp.org>
51 * elflint.c (check_sysv_hash): Calculate needed size using unsigned
52 long long int to prevent overflow.
53 (check_sysv_hash64): Calculate maxwords used separately before
54 comparison to prevent overflow.
56 2018-07-24 Mark Wielaard <mark@klomp.org>
58 * unstrip.c (compare_unalloc_sections): Also compare sh_size.
60 2018-07-21 Mark Wielaard <mark@klomp.org>
62 * unstrip.c (adjust_all_relocs): Skip SHT_GROUP sections.
64 2018-07-21 Mark Wielaard <mark@klomp.org>
66 * elfcompress.c (get_sections): New function.
67 (process_file): Check whether section needs to change. Don't rewrite
68 file if no section data needs changing.
69 (main): Update 'force' help text.
71 2018-07-21 Mark Wielaard <mark@klomp.org>
73 * elfcompress.c (process_file): Swap fchmod and fchown calls.
75 2018-07-04 Mark Wielaard <mark@klomp.org>
77 * readelf.c (print_debug_addr_section): Rename index var to uidx.
78 (attr_callback): Rename index var to word.
79 (print_debug_str_offsets_section): Rename index var to uidx.
81 2018-07-04 Ross Burton <ross.burton@intel.com>
83 * addr2line.c: Remove error.h include.
85 * arlib.c: Likewise and add system.h include.
88 * elfcompress.c: Likewise.
89 * elflint.c: Likewise.
90 * findtextrel.c: Likewise.
92 * objdump.c: Likewise.
94 * readelf.c: Likewise.
96 * strings.c: Likewise.
98 * unstrip.c: Likewise.
100 2018-06-25 Mark Wielaard <mark@klomp.org>
102 * readelf.c (print_decoded_line_section): Use dwarf_next_lines
103 instead of dwarf_nextcu.
104 (print_debug_line_section): Don't explicitly lookup CU.
106 2018-06-15 Mark Wielaard <mark@klomp.org>
108 * readelf.c (attr_callback): Only print block as expressions if it
109 isn't DW_FORM_data16.
111 2018-06-12 Mark Wielaard <mark@klomp.org>
113 * readelf.c (print_form_data): Check we have 4, not 2, bytes
114 available for DW_FORM_block4.
116 2018-06-12 Mark Wielaard <mark@klomp.org>
118 * readelf.c (print_form_data): Don't increase strreadp after use.
119 Do increase readp for DW_FORM_strx[1234].
121 2018-06-16 Mark Wielaard <mark@klomp.org>
123 * readelf.c (print_debug_loc_section): Make sure next_off doesn't
126 2018-06-13 Mark Wielaard <mark@klomp.org>
128 * readelf.c (die_type_sign_bytes): New function.
129 (attr_callback): Recognized DW_FORM_implicit_cost as signed. Use
130 die_type_sign_bytes to lookup the signedness and size of const
133 2018-06-11 Mark Wielaard <mark@klomp.org>
135 * readelf.c (print_form_data): Don't reuse readp and readendp when
136 reading str_offsets section.
138 2018-06-10 Mark Wielaard <mark@klomp.org>
140 * readelf.c (print_form_data): Don't cast value to ptrdiff_t, cast
143 2018-06-08 Mark Wielaard <mark@klomp.org>
145 * readelf.c (print_debug_rnglists_section): Calculate max_entries
146 instead of needed bytes to prevent overflowing. Always print
147 max_entries (but not more).
148 (print_debug_loclists_section): Likewise.
150 2018-06-08 Mark Wielaard <mark@klomp.org>
152 * readelf.c (print_debug_line_section): Stop printing directories
153 and files when we are at the end of the unit data.
155 2018-06-07 Mark Wielaard <mark@klomp.org>
157 * readelf.c (format_result): Removed.
158 (format_result_size): Removed.
159 (format_dwarf_addr): Renamed to...
160 (print_dwarf_addr): ...this. Simply call printf, don't setup buffer,
162 (print_ops): Use print_dwarf_addr instead of format_dwarf_addr.
163 (print_debug_addr_section): Likewise.
164 (print_debug_aranges_section): Likewise.
165 (print_debug_rnglists_section): Likewise.
166 (print_debug_ranges_section): Likewise.
167 (print_debug_frame_section): Likewise.
168 (attr_callback): Likewise.
169 (print_decoded_line_section): Likewise.
170 (print_debug_line_section): Likewise.
171 (print_debug_loclists_section): Likewise.
172 (print_debug_loc_section): Likewise.
173 (print_gdb_index_section): Likewsie.
175 2018-06-05 Mark Wielaard <mark@klomp.org>
177 * readelf.c (print_debug_addr_section): Set unit_length always to
178 (next_unitp - readp) in case we don't have a real header.
180 2018-06-05 Mark Wielaard <mark@klomp.org>
182 * readelf.c (print_debug_loc_section): Set begin to idx when failing
183 to read the start address if DW_LLE_GNU_start_end_entry.
185 2018-06-05 Mark Wielaard <mark@klomp.org>
187 * readelf.c (handle_sysv_hash): Don't leak lengths array when
188 detecting an invalid chain.
189 (handle_sysv_hash64): Likewise.
191 2018-06-05 Mark Wielaard <mark@klomp.org>
193 * readelf.c (print_debug_macro_section): Extend vendor array by one
194 to include max DW_MACRO_hi_user opcode.
196 2018-06-07 Mark Wielaard <mark@klomp.org>
198 * readelf.c (main): Lookup "no" for no_str.
199 (print_debug_abbrev_section): Use yes_str and no_str.
200 (print_form_data): Likewise.
202 2018-06-04 Mark Wielaard <mark@klomp.org>
204 * readelf (format_result): New static char pointer.
205 (format_result_size): New static size_t.
206 (format_dwarf_addr): Calculate max string size, reuse format_result
207 if possible, otherwise realloc. Use sprintf on result, not asprintf.
208 (print_ops): Don't free format_dwarf_addr, make sure result is
209 printed before calling format_dwarf_addr again.
210 (print_debug_addr_section): Likewise.
211 (print_debug_aranges_section): Likewise.
212 (print_debug_rnglists_section): Likewise.
213 (print_debug_ranges_section): Likewise.
214 (print_debug_frame_section): Likewise.
215 (attr_callback): Likewise.
216 (print_decoded_line_section): Likewise.
217 (print_debug_line_section): Likewise.
218 (print_debug_loclists_section): Likewise.
219 (print_debug_loc_section): Likewise.
220 (print_gdb_index_section): Likewsie.
222 2018-06-04 Mark Wielaard <mark@klomp.org>
224 * readelf.c (yes_str): New static char pointer.
226 (main): Set yes_str and no_str using gettext.
227 (attr_callback): Use yes_str and no_str instead of calling gettext.
229 2018-06-04 Mark Wielaard <mark@klomp.org>
231 * readelf.c (main): Call __fsetlocking (stdout, FSETLOCKING_BYCALLER).
233 2018-05-31 Mark Wielaard <mark@klomp.org>
235 * readelf.c (print_debug_units): Print the dwo name and id when
236 unable to find a .dwo file.
238 2018-05-31 Mark Wielaard <mark@klomp.org>
240 * readelf.c (enum section_e): Make section_types not an alias of
242 (section_all): Add section_types.
243 (parse_opt): Add both section_info and section_types for "info"
245 (print_debug_units): Don't be silent for debug_types.
247 2018-05-31 Mark Wielaard <mark@klomp.org>
249 * readelf.c (attr_callback): Only register section_loc when not
250 looking at a split dwarf from a skeleton.
252 2018-05-30 Mark Wielaard <mark@klomp.org>
254 * readelf.c (print_debug_loc_section): Use correct listptr for
257 2018-05-31 Mark Wielaard <mark@klomp.org>
259 * readelf.c (print_debug_units): Check offset against -1 not ~0ul.
261 2018-05-29 Mark Wielaard <mark@klomp.org>
263 * readelf.c (print_debug_loc_section): Handle GNU DebugFission list
266 2018-05-29 Mark Wielaard <mark@klomp.org>
268 * readelf.c (print_debug): Record and reset section_info status in
269 implicit_debug_sections and print_debug_sections.
271 2018-05-28 Mark Wielaard <mark@klomp.org>
273 * readelf.c (print_debug_units): Turn "Could not find split compile
274 unit" into an Warning instead of an error.
276 2018-04-29 Mark Wielaard <mark@klomp.org>
278 * readelf.c (parse_opt): Request implicit section_info for "str".
279 (known_stroffbases): New static variable.
280 (attr_callbackattr_callback): Handle DW_AT_str_offets_base.
281 (print_debug_str_offsets_section): New function.
282 (print_debug): Handle .debug_str_offsets as section_str. Reset
285 2018-04-27 Mark Wielaard <mark@klomp.org>
287 * readelf.c (options): Add addr.
288 (enum section_e): Add section_addr.
289 (section_all): Add section_addr.
290 (parse_opt): Parse "addr".
291 (known_addrbases): New static variable.
292 (get_listptr): New function.
293 (print_debug_addr_section): Likewise.
294 (attr_callback): Handle DW_AT_addr_base and DW_AT_GNU_addr_base.
295 (print_debug): Add NEW_SECTION (addr). Reset known_addrbases.
297 2018-04-07 Mark Wielaard <mark@klomp.org>
299 * readelf.c (attr_callback): Handle DW_FORM_loclistx and
302 2018-04-12 Mark Wielaard <mark@klomp.org>
304 * readelf.c (dwarf_loc_list_encoding_string): New functions.
305 (dwarf_loc_list_encoding_name): Likewise.
306 (known_loclistptr): Renamed and split in two...
307 (known_locsptr): this and ...
308 (known_loclistsptr): this.
309 (listptr_base): Split out...
310 (cudie_base): ...this.
311 (is_split_dwarf): New function.
312 (attr_callback): Handle DW_AT_loclists_base and notice sec_offset
314 (print_debug_rnglists_section): Use spit_dwarf_cu_base.
315 (print_debug_loclists_section): New function.
316 (print_debug_loc_section): Use known_locsptr instead of
318 (print_debug): Recognize .debug_loclists. Reset known_locsptr and
321 2018-05-25 Mark Wielaard <mark@klomp.org>
323 * readelf.c (DWARF_SKELETON): New constant.
324 (do_not_close_dwfl): New bool.
325 (options): Add dwarf-skeleton.
326 (dwarf_skeleton): New static variable.
327 (parse_opt): Handle DWARF_SKELETON, set dwarf_skeleton.
328 (create_dwfl): New function, with code extracted from...
329 (process_file): ...here. Check do_not_close_dwfl.
330 (is_split_darf): New function.
331 (getone_dwflmod): Likewise.
332 (print_debug): Use new functions to find skeleton DWARF file to use
333 when inspecting .dwo split DWARF file.
335 2018-04-11 Mark Wielaard <mark@klomp.org>
337 * readelf.c (dwarf_range_list_encoding_string): New function.
338 (dwarf_range_list_encoding_name): Likewise.
339 (known_rnglistptr): New static variable.
340 (listptr_cu): New function.
341 (print_debug_rnglists_section): Likewise.
342 (attr_callback): Call notice_listptr for DW_AT_ranges. Handle
343 DW_AT_rnglists_base. Handle DW_FORM_rnglistx. DW_AT_start_scope
344 can also have a rnglist.
345 (print_debug_units): Do (silently) scan split DWARF also for
346 debug_ranges before DWARF5 to catch all rangelistptrs.
347 (print_debug): Recognize .debug_rnglists. Reset known_rnglistptr.
349 2018-01-21 Mark Wielaard <mark@klomp.org>
351 * readelf.c (get_indexed_addr): New function.
352 (print_ops): Handle DW_OP_addrx, DW_OP_GNU_addr_index,
353 DW_OP_constx, DW_OP_GNU_const_index separately and resolve
355 (attr_callback): Print index and address for
356 DW_FORM_GNU_addr_index and DW_FORM_addrx[1234].
358 2018-01-19 Mark Wielaard <mark@klomp.org>
360 * readelf.c (options): Add info+.
361 (show_split_units): New static boolean defaulting to false.
362 (parse_opt): For all (no arg) --debug-dump set show_split_units
363 to yes. For "info+" enable section_info and show_split_units.
364 (attrcb_args): Add is_split field.
365 (attr_callback): Use is_split to format DIE offsets differently.
366 (print_debug_units): Likewise. Get subdie (type or split) only
367 when needed. When not silent reiterate over split DIEs when
370 2018-05-15 Mark Wielaard <mark@klomp.org>
372 * readelf.c (print_debug_units): Print unit type and id for any
373 unit type that has it even when version < 5.
375 2018-05-14 Mark Wielaard <mark@klomp.org>
377 * readelf.c (print_ops): Handle DW_OP_GNU_addr_index and
378 DW_OP_GNU_const_index.
379 (attr_callback): Handle DW_FORM_GNU_addr_index as DW_FORM_addrx.
380 Handle DW_FORM_GNU_str_index as DW_FORM_constx. Add as_hex_id.
381 Handle DW_AT_GNU_dwo_id as_hex_id.
382 (print_form_data): Handle DW_FORM_GNU_str_index as DW_FORM_strx.
384 2018-05-12 Mark Wielaard <mark@klomp.org>
386 * readelf.c (print_debug): Also recognize .dwo section name variants.
388 2018-05-15 Dmitry V. Levin <ldv@altlinux.org>
390 * elflint.c (check_elf_header): Fix typo in error diagnostics.
392 2018-05-15 Mark Wielaard <mark@klomp.org>
394 * readelf.c (print_form_data): Cast comparisons against offset_len to
396 (print_debug_line_section): Print uint64_t as PRIu64.
398 2018-05-11 Mark Wielaard <mark@klomp.org>
400 * readelf.c (print_debug_macro_section): Use libdw_valid_user_form.
401 Use print_form_data for strx and sup strings.
403 2018-05-09 Mark Wielaard <mark@klomp.org>
405 * readelf.c (dwarf_line_content_description_string): New function.
406 (dwarf_line_content_description_name): Likewise.
407 (print_bytes): Likewise.
408 (print_form_data): Likewise. Based on code taken from...
409 (print_debug_macro_section): ...here. Now calls print_form_data
410 and str_offsets_base_off.
411 (print_debug_line_section): Parse DWARF5 header, directory and file
414 2018-05-12 Mark Wielaard <mark@klomp.org>
416 * addr2line.c (main): Add fflush (stdout) after handle_address ()
417 when reading from stdin.
419 2018-04-24 Mark Wielaard <mark@klomp.org>
421 * readelf.c (print_debug_aranges_section): Try elf_rawdata if no
423 (print_debug_ranges_section): Likewise.
424 (print_debug_frame_section): Likewise.
425 (print_debug_line_section): Likewise. Check for data == NULL.
426 (print_debug_loc_section): Likewise.
427 (print_debug_macinfo_section): Likewise.
428 (print_debug_macro_section): Likewise.
430 2018-04-28 Mark Wielaard <mark@klomp.org>
432 * readelf.c (print_debug): If .debug_info is needed implicitly by
433 then handle it first before handling any other debug section.
434 (parse_opt): Set implicit_debug_sections to section_info when
435 showing all debug sections.
437 2018-05-05 Mark Wielaard <mark@klomp.org>
439 * readelf.c (attr_callback): Handle DW_FORM_ref_sup4 and
440 DW_FORM_ref_sup8 as references.
442 2018-04-24 Mark Wielaard <mark@klomp.org>
444 * readelf.c (print_debug_str_section): Take raw section data. Don't
445 use dwarf_getstring, but determine start and end of string from
446 offset and section data directly.
447 (print_debug): Handle ".debug_line_str" like ".debug_str".
449 2018-04-19 Andreas Schwab <schwab@suse.de>
451 * elflint.c (valid_e_machine): Add EM_RISCV.
453 2018-04-16 Mark Wielaard <mark@klomp.org>
455 * readelf.c (print_debug_line_section). In advance_pc, advance
456 using op_addr_advance, not op_advance.
458 2018-04-14 Mark Wielaard <mark@klomp.org>
460 * readelf.c (attr_callback): Only show errors when not silent.
462 2018-03-23 Mark Wielaard <mark@klomp.org>
464 * readelf.c (attr_callback): Handle DW_FORM_strx[1234].
466 2018-03-22 Mark Wielaard <mark@klomp.org>
468 * readelf.c (attr_callback): Handle DW_FORM_addrx[1234].
470 2018-03-28 Mark Wielaard <mark@klomp.org>
472 * readelf.c (handle_sysv_hash): Break bucket chain after nchain
474 (handle_sysv_hash64): Likewise.
476 2018-03-27 Mark Wielaard <mark@klomp.org>
478 * readelf.c (attr_callback): Print dwarf_dieoffset as %PRIx64,
481 2018-03-20 Mark Wielaard <mark@klomp.org>
483 * readelf.c (attr_callback): Report error when DW_AT_decl_file or
484 DW_AT_call_file cannot be resolved.
486 2018-03-06 Mark Wielaard <mark@klomp.org>
488 * readelf.c (print_ops): Handle DW_OP_addrx, DW_OP_constx,
489 DW_OP_implicit_pointer, DW_OP_entry_value, DW_OP_const_type,
490 DW_OP_regval_type, DW_OP_deref_type, DW_OP_xderef_type,
491 DW_OP_convert, DW_OP_reinterpret.
493 2018-03-01 Mark Wielaard <mark@klomp.org>
495 * readelf.c (struct listptr): Add attr field.
496 (compare_listptr): Warn when two listptrs for the same offset have
497 different attributes.
498 (notice_listptr): Take attr as argument and add it to listptr.
499 (skip_listptr_hole): New attr argument.
500 (next_listptr_offset): New function.
501 (print_debug_ranges_section): Pass NULL attr to skip_listptr_hole.
502 (attr_callback): Handle DW_AT_GNU_locviews. Call notice_listptr with
504 (print_debug_loc_section): Keep track of which attr is associated with
505 a listptr. If the attr is DW_AT_GNU_locview print view pairs till the
508 2018-02-09 Mark Wielaard <mark@klomp.org>
510 * elflint.c (check_group): Make sure we can read a complete
511 element when iterating over the group.
513 2018-02-09 Mark Wielaard <mark@klomp.org>
515 * readelf.c (attr_callback): Handle DW_FORM_data16 as Dwarf_Block.
517 2018-02-09 Mark Wielaard <mark@klomp.org>
519 * readelf.c (print_debug_abbrev_section): Print the value of a
520 DW_FORM_implicit_const using dwarf_getabbrevattr_data.
521 (attr_callback): Handle DW_FORM_implicit_const.
523 2018-01-30 Mark Wielaard <mark@klomp.org>
525 * readelf.c (dwarf_unit_string): New function.
526 (dwarf_unit_name): Likewise.
527 (print_debug_units): Use dwarf_get_units and dwarf_cu_die instead
528 of dwarf_next_unit. Print unit type, id and subdie if available.
530 2018-02-09 Joshua Watt <JPEWhacker@gmail.com>
532 * addr2line.c (handle_address): Use FALLTHROUGH macro instead of
534 * elfcompress.c (parse_opt): Likewise.
535 * elflint.c (check_dynamic): Likewise.
536 (check_sections): Likewise.
537 (check_note_data): Likewise.
538 * objdump.c (parse_opt): Likewise.
539 * readelf.c (parse_opt): Likewise.
540 (attr_callback): Likewise.
541 (handle_auxv_note): Likewise.
542 * strings.c (parse_opt): Likewise.
543 * backtrace.c (callback_verify): Likewise.
545 2018-01-25 Mark Wielaard <mark@klomp.org>
547 * readelf.c (print_debug_ranges_section): Initialize cu to last_cu.
548 (print_debug_loc_section): Likewise.
550 2018-01-01 Mark Wielaard <mark@klomp.org>
552 * readelf.c (attr_callback): Use dwarf_form_name for unknown forms.
553 (print_debug_macro_section): Print form using dwarf_form_name.
555 2017-12-28 Mark Wielaard <mark@klomp.org>
557 * readelf.c (print_debug_units): Print DIE offset in error message
560 2017-12-18 Mark Wielaard <mark@klomp.org>
562 * readelf.c (handle_notes_data): Don't use EXIT_FAILURE in error.
563 Adjust error message depending on whether or not we got data.
565 2017-12-07 Mark Wielaard <mark@klomp.org>
567 * readelf.c (print_ops): Update data pointer and print arguments
568 to DW_OP_call2 and DW_OP_call4 as DIE offsets.
570 2017-11-29 Mark Wielaard <mark@klomp.org>
572 * readelf.c (argp_options): Add "section-groups", 'g'.
574 2017-11-29 Mark Wielaard <mark@klomp.org>
576 * readelf.c (print_debug_loc_section): Print CU base and unresolved
577 addresses. Adjust formatting.
579 2017-11-29 Mark Wielaard <mark@klomp.org>
581 * readelf.c (print_debug_ranges_section): Print CU base and unresolved
582 addresses. Adjust formatting.
584 2017-11-29 Mark Wielaard <mark@klomp.org>
586 * readelf.c (attr_callback): Set valuestr to resolved file name
587 for DW_AT_decl_file and DW_AT_call_file.
589 2017-11-29 Mark Wielaard <mark@klomp.org>
591 * readelf.c (print_debug_units): Print abbrev code after DIE tag.
593 2017-11-29 Mark Wielaard <mark@klomp.org>
595 * readelf.c (print_ops): Use only2 space for index. re-indent +5
596 for DW_OP_GNU_entry_value.
598 2017-11-21 Mark Wielaard <mark@klomp.org>
600 * readelf.c (attr_callback): Print attribute name and form in error
601 message. If only the value cannot be retrieved/resolved don't abort.
603 2017-10-03 Mark Wielaard <mark@klomp.org>
605 * readelf.c (attr_callback): Print DIE offset in error messages.
607 2017-11-03 Mark Wielaard <mark@klomp.org>
609 * readelf.c (print_ops): Handle DW_OP_GNU_variable_value. Print
610 referenced DIE as offset.
612 2017-09-10 Mark Wielaard <mark@klomp.org>
614 * ar.c (do_oper_delete): Remove DEBUG conditional check.
615 (no0print): Return bool. Check snprintf return value.
616 (do_oper_insert): Initialize elf. Remove DEBUG conditional check.
617 Check no0print calls succeed. Explicitly elf_end found elfs.
618 (do_oper_extract): Make sure we don't create an empty variable
621 2017-09-01 Mark Wielaard <mark@klomp.org>
623 * stack.c (main): Replace \v in doc string with \n\n.
624 * unstrip.c (main): Likewise.
626 2017-05-04 Ulf Hermann <ulf.hermann@qt.io>
628 * stack.c: Print pid_t using %lld.
630 2017-08-18 Ulf Hermann <ulf.hermann@qt.io>
632 * readelf.c: Hardcode the signal numbers for non-linux systems.
634 2017-07-26 Mark Wielaard <mark@klomp.org>
636 * readelf.c (print_debug_macro_section): Accept either version 4 or
637 version 5. Use DW_MACRO names instead of DW_MACRO_GNU names. Add
638 minimal support for DW_MACRO_define_sup, DW_MACRO_undef_sup,
639 DW_MACRO_import_sup, DW_MACRO_define_strx and DW_MACRO_undef_strx.
641 2017-07-26 Mark Wielaard <mark@klomp.org>
643 * readelf.c (dwarf_defaulted_string): New function.
644 (dwarf_defaulted_name): Likewise.
645 (attr_callback): Use dwarf_defaulted_name to get value of
648 2017-07-20 Mark Wielaard <mark@klomp.org>
650 * strip.c (handle_elf): Deal with data marker symbols pointing to
651 debug sections (they can be removed).
653 2017-07-14 Mark Wielaard <mark@klomp.org>
655 * strip (OPT_KEEP_SECTION): New define.
656 (options): Add documentation for remove-section. Add keep-section.
657 (struct section_pattern): New data type.
658 (keep_secs, remove_secs): New globals.
659 (add_pattern, free_sec_patterns, free_patterns, section_name_matches):
661 (main): Call free_patterns.
662 (parse_opt): Handle 'R' and OPT_KEEP_SECTION. Check remove_comment
664 (handle_elf): Handle and sanity check keep_secs and remove_secs.
666 2017-06-07 Mark Wielaard <mark@klomp.org>
668 * strip.c (handle_elf): Introduce new handle_elf boolean. Use it to
669 determine whether to create an output and/or debug file. Remove new
670 output file on error.
672 2017-06-06 Mark Wielaard <mark@klomp.org>
674 * strip.c (handle_elf): Assume e_shstrndx section can be removed.
676 2017-04-20 Ulf Hermann <ulf.hermann@qt.io>
678 * readelf.c: Include strings.h.
680 2017-04-20 Ulf Hermann <ulf.hermann@qt.io>
682 * unstrip.c: Check shnum for 0 before subtracting from it.
684 2017-04-20 Ulf Hermann <ulf.hermann@qt.io>
686 * readelf.c: Replace YESSTR and NOSTR with gettext ("yes") and
687 gettext ("no"), respectively.
689 2017-04-05 Mark Wielaard <mark@klomp.org>
691 * elflint.c (check_elf_header): Decompress all sections.
693 2017-03-28 Mark Wielaard <mark@klomp.org>
695 * elflint (check_group): Don't check if there is no flag word.
697 2017-03-27 Mark Wielaard <mark@klomp.org>
699 * elflint.c (check_elf_header): Sanity check phnum and shnum.
701 2017-03-27 Mark Wielaard <mark@klomp.org>
703 * elflint.c (check_sysv_hash): Return early if section size is
705 (check_sysv_hash64): Likewise.
706 (check_hash): Calculate expect_entsize to check section size.
708 2017-03-27 Mark Wielaard <mark@klomp.org>
710 * elflint.c (check_symtab_shndx): Check data->d_size.
712 2017-03-24 Mark Wielaard <mjw@redhat.com>
714 * elfcmp.c (main): If n_namesz == 0 then the note name data is the
716 * readelf.c (handle_notes_data): Likewise.
718 2017-03-24 Mark Wielaard <mjw@redhat.com>
720 * readelf.c (handle_gnu_hash): Check inner < max_nsyms before
721 indexing into chain array.
723 2017-02-16 Ulf Hermann <ulf.hermann@qt.io>
725 * addr2line.c: Include printversion.h
727 * elflint.c: Likewise.
729 * objdump.c: Likewise.
730 * ranlib.c: Likewise.
731 * readelf.c: Likewise.
734 * strings.c: Likewise.
736 * elfcmp.c: Include printversion.h, remove system.h include.
737 * elfcompress.c: Likewise.
738 * findtextrel.c: Likewise.
739 * unstrip.c: Likewise.
741 2017-02-14 Ulf Hermann <ulf.hermann@qt.io>
743 * nm.c: Include color.h.
744 * objdump.c: Likewise.
746 2016-12-24 Mark Wielaard <mark@klomp.org>
748 * Makefile.am (findtextrel_LDADD): Add $(libeu).
749 (addr2line_LDADD): Likewise.
750 (elfcmp_LDADD): Likewise.
751 * addr2line.c (print_version): Removed.
752 * ar.c (print_version): Likewise.
753 * elfcmp.c (print_version): Likewise.
754 * elfcompress.c (print_version): Likewise.
755 * elflint.c (print_version): Likewise.
756 * findtextrel.c (print_version): Likewise.
757 * nm.c (print_version): Likewise.
758 * objdump.c: Likewise.
759 * ranlib.c: Likewise.
760 * readelf.c: Likewise.
763 * strings.c: Likewise.
765 * unstrip.c: Likewise.
767 2016-11-17 Mark Wielaard <mjw@redhat.com>
769 * readelf.c (options): Add optional arg SECTION for symbols.
770 (symbol_table_section): New static variable.
771 (parse_opt): Set symbol_table_section on 's'.
772 (print_symtab): Filter on symbol_table_section name is set.
774 2016-11-10 Mark Wielaard <mjw@redhat.com>
776 * ar.c (write_member): Make sure tmpbuf is large enough to contain
777 a starting '/' and ending '\0' char.
778 (do_oper_insert): Likewise.
779 * arlib.c (arlib_finalize): Format tmpbuf as PRId32 decimal.
781 2016-11-02 Mark Wielaard <mjw@redhat.com>
783 * addr2line.c (handle_address): Add fallthrough comment.
784 * elfcompress.c (parse_opt): Adjust fallthrough comment.
785 * elflint.c (parse_opt): Add missing break after 'd' case.
786 (check_sections): Add fallthrough comments.
787 * objdump.c (parse_opt): Add explantion for fallthrough comment.
789 2016-10-22 Kevin Cernekee <cernekee@chromium.org>
791 * unstrip.c: Fix "invalid string offset" error caused by using the
792 unstripped .symtab with the stripped .strtab.
794 2016-10-11 Akihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>
796 * arlib.c: Remove system.h include, add libeu.h include.
797 * arlib2.c: Remove sys/param.h include.
798 * elfcompress.c: Add libeu.h include.
799 * elflint.c: Remove sys/param.h include, add libeu.h include.
801 * objdump.c: Likewise.
802 * ranlib.c: Likewise.
803 * readelf.c: Likewise.
804 * size.c: Remove sys/param.h include.
805 * strings.c: Likewise, add libeu.h include.
807 * unstrip.c: Likewise.
809 2016-10-06 Mark Wielaard <mjw@redhat.com>
811 * strip.c (handle_elf): Don't remove real symbols from allocated
814 2016-08-25 Mark Wielaard <mjw@redhat.com>
816 * strip.c (handle_elf): Recompress with ELF_CHF_FORCE.
818 2016-08-06 Mark Wielaard <mjw@redhat.com>
820 * strip.c (handle_elf): Uncompress and recompress relocation target
821 section if necessary.
823 2016-07-08 Mark Wielaard <mjw@redhat.com>
825 * Makefile.am (strip_LDADD): Add libdw.
826 * elfcompress.c (process_file): Use dwelf_strtab functions instead of
828 * strip.c (handle_elf): Likewise.
829 * unstrip.c (new_shstrtab): Likewise.
831 2016-07-06 Mark Wielaard <mjw@redhat.com>
833 * elf32-i386.script, i386_ld.c, ld.c, ld.h, ldgeneric.c, ldlex.l,
834 ldscript.y, libld_elf_i386.map, none_ld.c, sectionhash.c,
835 sectionhash.h, symbolhash.c, symbolhash.h, unaligned.h,
836 versionhash.c, versionhash.h, xelf.h: Removed.
837 * Makefile.am (YACC): Removed.
838 (AM_YFLAGS): Removed.
839 (AM_LFLAGS): Removed.
840 (native_ld): Removed.
842 (bin_PROGRAMS): Removed ld.
844 (ld_SOURCES): Removed.
845 (noinst_LIBRARIES): Only libar.a.
846 (EXTRA_DIST): Just arlib.h and debugpred.h.
848 (ld_LDFLAGS): Removed.
850 (ldscript.h): Removed.
852 (CLEANFILES): Just *.gconv.
853 (MAINTAINERCLEANFILES): Removed.
855 2016-07-06 Mark Wielaard <mjw@redhat.com>
857 * unstrip.c (copy_elided_sections): Use unstripped_strent[] from
858 index zero, instead of one.
860 2016-06-28 Richard Henderson <rth@redhat.com>
862 * elflint.c (valid_e_machine): Add EM_BPF.
864 2016-04-11 David Abdurachmanov <davidlt@cern.ch>
866 * elfcmp.c (main): Fix self-comparison error with GCC 6.
868 2016-03-21 Mark Wielaard <mjw@redhat.com>
870 * nm.c (show_symbols): Check for malloc size argument overflow.
872 2016-02-13 Mark Wielaard <mjw@redhat.com>
874 * readelf.c (print_scngrp): Call error when gelf_getshdr fails.
875 (print_symtab): Likewise.
876 (handle_hash): Likewise.
877 (dump_data_section): Print a warning if decompressing fails.
878 (print_string_section): Likewise.
880 2016-02-13 Mark Wielaard <mjw@redhat.com>
882 * elfcompress.c (parse_opt): Don't fallthrough after processing -q.
884 2016-02-12 Mark Wielaard <mjw@redhat.com>
886 * strip.c (handle_elf): Correct elf_assert shndxdata check.
888 2016-02-09 Mark Wielaard <mjw@redhat.com>
890 * readelf.c (read_encoded): Move up.
891 (print_cfa_program): Add encoding argument. Use it for read_encoded
892 when reading DW_CFA_set_loc op.
893 (print_debug_frame_section): Pass fde_encoding to print_cfa_program.
895 2016-02-09 Mark Wielaard <mjw@redhat.com>
897 * elflint.c (compare_hash_gnu_hash): Check hash sh_entsize against
898 sizeof (Elf64_Xword). Correct invalid sh_entsize error message
899 section idx and name.
901 2016-01-13 Mark Wielaard <mjw@redhat.com>
903 * elflint.c (check_elf_header): Recognize ELFOSABI_FREEBSD.
905 2016-01-08 Mark Wielaard <mjw@redhat.com>
907 * elfcompress.c (compress_section): Use %zu to print size_t.
908 * readelf.c (print_shdr): Use %zx to print size_t.
910 2015-12-16 Mark Wielaard <mjw@redhat.com>
912 * elfcompress.c: New file.
913 * Makefile.am (bin_PROGRAMS): Add elfcompress.
914 (elfcompress_LDADD): New variable.
916 2015-12-18 Mark Wielaard <mjw@redhat.com>
918 * elflint.c (section_flags_string): Add NEWFLAG COMPRESSED.
919 (check_sections): SHF_COMPRESSED can be on any special section.
920 SHF_COMPRESSED is a valid section flag. SHF_COMPRESSED cannot
921 be used together with SHF_ALLOC or with SHT_NOBITS. Should have
924 2015-10-20 Mark Wielaard <mjw@redhat.com>
926 * readelf.c (options): Expand -z help text.
927 (dump_data_section): Check whether we need and can decompress section
928 data and call elf_rawzdata if so,
929 (print_string_section): Likewise.
930 (elf_contains_chdrs): New function.
931 (process_elf_file): Rename print_unrelocated to print_unchanged,
932 use elf_contains_chdrs.
933 (print_scngrp): Check whether section is compressed before use.
934 (print_symtab): Likewise.
935 (handle_hash): Likewise.
937 2015-10-16 Mark Wielaard <mjw@redhat.com>
939 * readelf.c (argp_option): Describe --decompress,-z.
940 (print_decompress): New bool.
941 (parse_opt): Handle -z.
942 (elf_ch_type_name): New function.
943 (print_shdr): Print section compress information.
945 2015-12-31 Mark Wielaard <mjw@redhat.com>
947 * elflint.c (check_symtab): Add _edata and _end (plus extra underscore
948 variants) to to the list of possibly dangling symbols.
950 2015-12-02 Mark Wielaard <mjw@redhat.com>
952 * nm.c (process_file): Accept fd and pass it on.
953 (handle_elf): Likewise.
954 (find_no_debuginfo): New.
955 (struct getdbg): Likewise.
956 (getdbg_dwflmod): Likewise.
957 (show_symbols): Take fd. If the file is ET_REL use libdwfl to get
960 2015-12-02 Mark Wielaard <mjw@redhat.com>
962 * nm.c (get_local_names): Check for duplicates in local_root tree.
964 2015-12-02 Mark Wielaard <mjw@redhat.com>
966 * unstrip.c (struct data_list): New.
967 (new_data_list): Likewise.
968 (record_new_data): Likewise.
969 (free_new_data): Likewise.
970 (adjust_relocs): Call record_new_data.
971 (add_new_section_symbols): Likewise.
972 (copy_elided_sections): Call free_new_data.
974 2015-12-01 Mark Wielaard <mjw@redhat.com>
976 * elfcmp.c (main): Close ebl1 and ebl2 backends.
978 2015-10-16 Mark Wielaard <mjw@redhat.com>
980 * Makefile.am [BUILD_STATIC](libdw): Add -lz.
981 [BUILD_STATIC](libelf): Likewise.
983 2015-10-16 Mark Wielaard <mjw@redhat.com>
985 * elflint.c (check_symtab): Don't check TLS symbol value against TLS
986 phdr offset in debuginfo files.
987 (check_sections): Don't try to match section offsets to phdrs offsets
990 2015-10-16 Mark Wielaard <mjw@redhat.com>
992 * elflint.c (check_reloc_shdr): Reject only desthdrs if they have both
993 SHF_MERGE and SHF_STRINGS set.
995 2015-10-13 Jose E. Marchesi <jose.marchesi@oracle.com>
997 * elflint.c (check_sections): Do not rely on
998 ebl_check_special_section when checking debuginfo files. Also
999 check that the type of WE sections in debuginfo files is NOBITS.
1001 2015-10-13 Mark Wielaard <mjw@redhat.com>
1003 * elflint.c (check_program_header): Check relro flags are a subset
1004 of the load segment if they don't fully overlap.
1006 2015-10-07 Mark Wielaard <mjw@redhat.com>
1008 * Makefile.am (ldlex_no_Wstack_usage): New.
1009 * ldlex.l ([RWX]): Make cnt unsigned.
1011 2015-10-09 Josh Stone <jistone@redhat.com>
1013 * elflint.c (main): Replace stat64 and fstat64 with stat and fstat.
1014 * readelf.c (process_file): Likewise.
1015 (process_elf_file): Replace off64_t with off_t.
1016 * findtextrel.c (process_file): Replace open64 with open.
1017 * ld.c (main): Replace sizeof (off64_t) with 8.
1018 * strings.c: Replace off64_t with off_t throughout.
1019 (main): Replace stat64 and fstat64 with stat and fstat.
1020 (map_file): Replace mmap64 with mmap.
1021 (read_block): Likewise, and replace lseek64 with lseek.
1022 * strip.c (handle_elf): Replace ftruncate64 with ftruncate.
1023 (process_file): Replace stat64 and fstat64 with stat and fstat.
1024 * unstrip.c (parse_opt): Replace stat64 with stat.
1025 (handle_file): Replace open64 with open.
1026 (open_file): Likewise.
1028 2015-10-08 Chih-Hung Hsieh <chh@google.com>
1030 * ld.c (determine_output_format): Move recursive nested
1031 function "try" to file scope.
1033 2015-10-04 Mark Wielaard <mjw@redhat.com>
1035 * strip.c (handle_elf): Only sanity check section symbols to not
1036 kept discarded sections if we are creating a debug file.
1038 2015-10-07 Mark Wielaard <mjw@redhat.com>
1040 * unstrip.c (MAX): Removed.
1041 (find_alloc_sections_prelink): Allocate exact amount of bytes for
1044 2015-10-05 Chih-Hung Hsieh <chh@google.com>
1046 * unstrip.c (find_alloc_sections_prelink): Do not allocate
1047 on stack union types with variable length arrays; use xmalloc
1048 for such dynamic sized objects.
1049 * readelf.c (handle_core_item): Likewise, but use alloca
1050 for small variable size data object and add assert(count < 128).
1052 2015-10-05 Josh Stone <jistone@redhat.com>
1054 * Makefile.am (libld_elf_i386.so): Add AM_V_CCLD silencer.
1055 (.deps/none_ld.Po): Always silence the dummy command.
1056 (make-debug-archive): Add AM_V_GEN and AM_V_at silencers.
1058 2015-10-02 Mark Wielaard <mjw@redhat.com>
1060 * unstrip.c (copy_elided_sections): Use SH_INFO_LINK_P, not just
1063 2015-10-02 Mark Wielaard <mjw@redhat.com>
1065 * strip.c (handle_elf): Don't move around allocated NOBITS sections.
1066 Don't just mark the section header string table as unused.
1067 * unstrip.c (copy_elided_sections): Add header names to strtab if
1068 shstrndx equals the symtab strtabndx.
1070 2015-09-22 Mark Wielaard <mjw@redhat.com>
1072 * strip.c (cleanup_debug): Remove old-style function definitions.
1074 2015-09-09 Chih-Hung Hsieh <chh@google.com>
1076 * readelf.c (print_debug_exception_table): Initialize variable before
1077 it is used, because compiler does not know that error never returns.
1078 (dump_arhive_index): Likewise.
1080 2015-09-04 Chih-Hung Hsieh <chh@google.com>
1082 * elflint.c (check_group): Replace %Z length modifier with %z.
1083 (check_note_data): Likewise.
1084 * findtextrel.c (process_file): Likewise.
1085 * readelf.c (handle_dynamic): Likewise.
1086 (handle_symtab): Likewise.
1087 (handle_verneed): Likewise.
1088 (handle_verdef): Likewise.
1089 (handle_versym): Likewise.
1090 (print_hash_info): Likewise.
1091 (print_decoded_aranges_section): Likewise.
1092 (print_debug_aranges_section): Likewise.
1093 (print_debug_line_section): Likewise.
1094 (hex_dump): Likewise.
1095 (dump_data_section): Likewise.
1096 (print_string_section): Likewise.
1097 (dump_archive_index): Likewise.
1098 * unstrip.c (adjust_relocs): Likewise.
1099 (collect_symbols): likewise.
1100 (get_section_name): Likewise.
1101 (find_alloc_sections_prelink): Likewise.
1102 (copy_elided_sections): Likewise.
1103 * ldscript.y (add_id_list): Add missing '%s'.
1105 2015-09-03 Mark Wielaard <mjw@redhat.com>
1107 * readelf.c (handle_core_item): Handle right shift >= 32 bits.
1109 2015-08-11 Mark Wielaard <mjw@redhat.com>
1111 * elflint.c (check_sections): When gnuld and a NOBITS section falls
1112 inside a segment make sure any ELF file contents is zero.
1114 2015-07-29 Mark Wielaard <mjw@redhat.com>
1116 * unstrip.c (sections_flags_match): New function.
1117 (sections_match): Use sections_flags_match.
1118 (find_alloc_sections_prelink): Only clear matched sections if there
1120 (copy_elided_sections): Add SHF_INFO_LINK to shdr_mem.sh_flags if
1123 2015-06-27 Pino Toscano <toscano.pino@tiscali.it>
1125 * src/strings.c: Define MAP_POPULATE if not defined already.
1127 2015-06-27 Mark Wielaard <mjw@redhat.com>
1129 * nm.c (show_symbols): First call elf_getdata, then allocate memory.
1131 2015-06-18 Mark Wielaard <mjw@redhat.com>
1133 * findtextrel.c (process_file): Free segments after use.
1135 2015-06-18 Mark Wielaard <mjw@redhat.com>
1137 * readelf.c (print_phdr): Make sure phdr2_mem lifetime/scope equals
1140 2015-06-18 Mark Wielaard <mjw@redhat.com>
1142 * readelf.c (handle_gnu_hash): Free lengths on invalid_data.
1144 2015-06-18 Mark Wielaard <mjw@redhat.com>
1146 * elflint.c (check_symtab): Only check the PT_TLS phdr if it actually
1147 exists. Warn otherwise.
1149 2015-06-18 Mark Wielaard <mjw@redhat.com>
1151 * nm.c (show_symbols): Check sizeof (sym_mem[0]), not GElf_Sym to
1152 known whether or not we stack allocated memory.
1154 2015-06-18 Mark Wielaard <mjw@redhat.com>
1156 * strings.c (readelf): Use "<unknown>" if we cannot retrieve section
1159 2015-06-09 Mark Wielaard <mjw@redhat.com>
1161 * addr2line.c (print_dwarf_function): Always free scopes before
1164 2015-06-09 Mark Wielaard <mjw@redhat.com>
1166 * strip.c (handle_ar): Mark as unused.
1167 (process_file): Produce an error when trying to handle an ar.
1169 2015-05-30 Mark Wielaard <mjw@redhat.com>
1171 * elfcmp.c (main): Only call memcmp when d_size != 0.
1173 2015-05-23 Mark Wielaard <mjw@redhat.com>
1175 * Makefile.am: Define ldgeneric, readelf, nm, size, strip, elflint,
1176 findtextrel, elfcmp objdump, ranlib, ar and unstrip no_Wstack_usage.
1178 2015-05-21 Mark Wielaard <mjw@redhat.com>
1180 * addr2line.c (handle_address): Set scopes to NULL after free.
1182 2015-05-20 Mark Wielaard <mjw@redhat.com>
1184 * addr2line.c (OPT_PRETTY): New constant define.
1185 (argp_option): Add "pretty-print".
1186 (pretty): New static bool.
1187 (parse_opt): Set pretty.
1188 (print_dwarf_function): Adjust output when pretty is set.
1189 (print_addrsym): Likewise.
1190 (handle_address): Likewise.
1192 2015-05-20 Mark Wielaard <mjw@redhat.com>
1194 * Makefile.am (addr2line_LDADD): Add demanglelib.
1195 * addr2line.c (argp_option): Move demangle under output format.
1196 (demangle): New static bool.
1197 (demangle_buffer_len): New static size_t.
1198 (demangle_buffer): New static char *.
1199 (main): free demangle_buffer.
1200 (parse_opt): Set demangle.
1201 (symname): New static function.
1202 (get_diename): Use symname.
1203 (print_dwarf_function): Likewise.
1204 (print_addrsym): Likewise.
1205 (handle_address): Likewise.
1207 2015-05-20 Mark Wielaard <mjw@redhat.com>
1209 * addr2line.c (argp_option): Add "addresses", 'a'.
1210 (print_addresses): New static bool.
1211 (parse_opt): Set print_addresses.
1212 (get_addr_width): New static function.
1213 (handle_address): Print address if print_addresses is true.
1215 2015-05-20 Mark Wielaard <mjw@redhat.com>
1217 * addr2line.c (handle_address): Call strtoumax with base 16. Make
1218 sure all input has been processed.
1220 2015-05-20 Mark Wielaard <mjw@redhat.com>
1222 * addr2line (argp_option): Group 'section' under "Input format
1225 2015-05-12 Mark Wielaard <mjw@redhat.com>
1227 * strip.c (debug_fd): New static variable.
1228 (tmp_debug_fname): Likewise.
1229 (cleanup_debug): New function using the above to clean up temporary
1231 (INTERNAL_ERROR): Call cleanup_debug.
1232 (handle_elf): Use debug_fd and tmp_debug_fname statics and call
1233 cleanup_debug before any error. Use output_fname instead of fname in
1234 error messages when it exists (-o was given). SHT_NOBITS sections
1235 can also be moved freely even if SHF_ALLOC is set. Add various
1236 sanity checks. Use elf_assert instead of plain assert.
1238 2015-05-08 Mark Wielaard <mjw@redhat.com>
1240 * nm.c (show_symbols): Call gelf_fsize with EV_CURRENT.
1241 * strip.c (handle_elf): Likewise.
1243 2015-05-06 Mark Wielaard <mjw@redhat.com>
1245 * elflint.c (check_gnu_hash): Return early when 2nd hash function
1246 shift too big. Check there is enough data available. Make sure
1247 bitmask_words is not zero.
1248 (check_verdef): Use Elf64_Word for shdr->sh_info cnt.
1249 (check_verneed): Likewise.
1250 (check_attributes): Break when vendor name isn't terminated.
1251 Add overflow check for subsection_len.
1253 2015-05-05 Mark Wielaard <mjw@redhat.com>
1255 * nm.c (show_symbols): Handle dwarf_linesrc returning NULL.
1257 2015-05-04 Max Filippov <jcmvbkbc@gmail.com>
1259 * ar.c (do_oper_extract): Replace struct timeval with struct timespec
1260 and futimes with futimens.
1261 * strip.c (process_file): Replace struct timeval with struct timespec.
1262 (handle_elf, handle_ar): Replace struct timeval with struct timespec
1263 in prototype. Replace futimes with futimens.
1265 2015-05-04 Max Filippov <jcmvbkbc@gmail.com>
1267 * addr2line.c (main): Drop mtrace() call and #include <mcheck.h>.
1271 * objdump.c: Likewise.
1272 * ranlib.c: Likewise.
1274 * strip.c: Likewise.
1275 * unstrip.c: Likewise.
1277 2015-05-04 Anthony G. Basile <blueness@gentoo.org>
1279 * Makefile.am (readelf_LDADD, nm_LDADD, size_LDADD, strip_LDADD)
1280 (ld_LDADD, elflint_LDADD, findtextrel_LDADD, addr2line_LDADD)
1281 (elfcmp_LDADD, objdump_LDADD, ranlib_LDADD, strings_LDADD)
1282 (ar_LDADD, unstrip_LDADD, stack_LDADD): Append $(argp_LDADD).
1284 2015-03-22 Mark Wielaard <mjw@redhat.com>
1286 * readelf.c (print_debug_frame_section): Cast start to Dwarf_Off
1287 before subtracting cie_id. And cast cie_offset to Dwarf_Off before
1290 2015-03-22 Mark Wielaard <mjw@redhat.com>
1292 * readelf.c (print_gdb_index_section): Check all offsets used
1293 against section d_size.
1295 2015-03-17 Mark Wielaard <mjw@redhat.com>
1297 * readelf.c (print_debug): Don't return, but always use dummy_dbg.
1299 2015-03-17 Mark Wielaard <mjw@redhat.com>
1301 * readelf.c (print_gdb_index_section): Add overflow checking for
1304 2015-03-14 Mark Wielaard <mjw@redhat.com>
1306 * nm.c (INTERNAL_ERROR): Remove __DATE__.
1307 * objdump.c (INTERNAL_ERROR): Likewise.
1308 * size.c (INTERNAL_ERROR): Likewise.
1309 * strip.c (INTERNAL_ERROR): Likewise.
1311 2015-03-18 Petr Machata <pmachata@redhat.com>
1313 * readelf.c (dwarf_tag_string, dwarf_attr_string)
1314 (dwarf_form_string, dwarf_lang_string, dwarf_inline_string)
1315 (dwarf_encoding_string, dwarf_access_string)
1316 (dwarf_visibility_string, dwarf_virtuality_string)
1317 (dwarf_identifier_case_string, dwarf_calling_convention_string)
1318 (dwarf_ordering_string, dwarf_discr_list_string)
1319 (dwarf_locexpr_opcode_string): Adjust uses of know-dwarf.h macros
1320 to match the API changes.
1322 2015-03-09 Mark Wielaard <mjw@redhat.com>
1324 * elflint.c (compare_hash_gnu_hash): Correct gnu_symbias usage.
1326 2015-01-03 Mark Wielaard <mjw@redhat.com>
1328 * elfcmp (main): Check section name is not NULL. Check sh_entsize
1329 is not zero for symbol tables. Check phdrs are not NULL.
1330 (search_for_copy_reloc): Check sh_entsize is not zero.
1332 2014-12-30 Mark Wielaard <mjw@redhat.com>
1334 * elflint.c (check_scn_group): Check d_buf and name are not NULL.
1335 (is_rel_dyn): Check d is not NULL. Check shdr->sh_entsize is not
1337 (check_dynamic): Check strshdr is not NULL. Check d_tag is positive.
1338 (check_symtab_shndx): Check symshdr and data->d_buf are not NULL.
1339 Check shdr and symshdr sh_entsize are not zero.
1340 (check_gnu_hash): Make sure maskidx is smaller than bitmask_words.
1341 Check symshdr->sh_entsize is not zero. Check data->d_buf is not
1343 (compare_hash_gnu_hash): Check sections d_buf are not NULL.
1344 Check section data is large enough. Use gnu_symbias.
1345 (check_group): Check section val is valid.
1346 (has_copy_reloc): Check sh_entsize is not zero.
1347 (check_versym): Likewise.
1348 (unknown_dependency_p): Likewise.
1349 (check_verneed): Break on invalid ref or offset. Don't assert.
1350 Report error when next offset is zero, but more vers expected.
1351 (check_verdef): Likewise.
1352 (check_attributes): Make sure d_buf is not NULL.
1353 (check_note): Likewise.
1354 (check_note_section): Likewise.
1355 (check_program_header): Make sure section name is not NULL.
1357 2014-12-26 Mark Wielaard <mjw@redhat.com>
1359 * strings.c (read_elf): Produce error when section data falls outside
1362 2014-12-26 Mark Wielaard <mjw@redhat.com>
1364 * nm.c (show_symbols): Guard against divide by zero in error check.
1365 Add section index number in error message.
1367 2014-12-26 Mark Wielaard <mjw@redhat.com>
1369 * nm.c (handle_ar): Skip over /SYM64/ entries.
1371 2014-12-26 Mark Wielaard <mjw@redhat.com>
1373 * nm.c (handle_ar): Break on arsym with invalid offset.
1375 2014-12-20 Mark Wielaard <mjw@redhat.com>
1377 * readelf.c (print_debug_macinfo_section): Mark cus sentinel files
1378 as -1 non-existent. Check macoff against sentinel cus.
1380 2014-12-20 Mark Wielaard <mjw@redhat.com>
1382 * readelf.c (print_debug_exception_table): Add max_action overflow
1383 check. Check action_table_end before reading slib128. Check
1384 max_ar_filter underflow.
1386 2014-12-18 Ulrich Drepper <drepper@gmail.com>
1388 * Makefile.am: Suppress output of textrel_check command.
1390 2014-12-17 Mark Wielaard <mjw@redhat.com>
1392 * readelf.c (print_cfa_program): Add bounds check before each op that
1393 takes at least one argument.
1395 2014-12-16 Mark Wielaard <mjw@redhat.com>
1397 * readelf.c (print_decoded_line_section): Print dwarf_errmsg if
1398 dwarf_onesrcline or dwarf_linesrc fails.
1400 2014-12-16 Mark Wielaard <mjw@redhat.com>
1402 * readelf.c (print_debug_line_section): Correct overflow check for
1404 (print_debug_aranges_section): Correct overflow check for length.
1406 2014-12-15 Mark Wielaard <mjw@redhat.com>
1408 * readelf.c (notice_listptr): Return false if offset doesn't fit
1410 (attr_callback): Warn if loclist or rangelist offset doesn't fit.
1412 2014-12-15 Mark Wielaard <mjw@redhat.com>
1414 * readelf.c (print_ops): Don't assert when addr_size or ref_size
1415 is not 4 or 8, just report invalid data.
1417 2014-12-15 Mark Wielaard <mjw@redhat.com>
1419 * readelf.c (print_gdb_index_section): Add more bounds checks.
1421 2014-12-15 Mark Wielaard <mjw@redhat.com>
1423 * readelf.c (print_debug_line_section): Check there is enough room
1424 for DW_LNE_set_address argument. Make sure there is enough room
1425 for the the initial unit_length.
1427 2014-12-14 Mark Wielaard <mjw@redhat.com>
1429 * elflint.c (check_attributes): Call get_uleb128 with end pointer.
1430 * readelf.c (print_attributes): Likewise.
1431 (print_ops): Likewise and also for get_sleb128.
1432 (print_cfa_program): Likewise and add more readp bounds checks.
1433 (read_encoded): Likewise.
1434 (print_debug_frame_section): Likewise.
1435 (print_debug_line_section): Likewise.
1436 (print_debug_macinfo_section): Likewise.
1437 (print_debug_macro_section): Likewise.
1438 (print_debug_exception_table): Likewise.
1440 2014-12-16 Mark Wielaard <mjw@redhat.com>
1442 * elfcmp.c (compare_Elf32_Word): Make sure (unsigned) Elf32_Word
1443 difference doesn't wrap around before returning as int.
1445 2014-12-11 Mark Wielaard <mjw@redhat.com>
1447 * readelf.c (print_debug_exception_table): Check TType base offset
1448 and Action table are sane.
1450 2014-12-11 Mark Wielaard <mjw@redhat.com>
1452 * readelf.c (print_debug_frame_section): Check number of augmentation
1455 2014-12-09 Mark Wielaard <mjw@redhat.com>
1457 * readelf.c (handle_file_note): Check count fits data section and
1458 doesn't overflow fptr.
1460 2014-12-08 Mark Wielaard <mjw@redhat.com>
1462 * readelf.c (print_debug_exception_table): Report invalid data if
1463 action table doesn't immediately follow call site table.
1465 2014-12-10 Josh Stone <jistone@redhat.com>
1467 * addr2line.c (get_diename): New, get linkage_name or name.
1468 * addr2line.c (print_dwarf_function): Use get_diename.
1469 * addr2line.c (handle_address): Likewise.
1470 * addr2line.c (print_diesym): Removed.
1472 2014-12-10 Josh Stone <jistone@redhat.com>
1474 * addr2line.c (handle_address): Find the proper inline parents.
1476 2014-12-07 Mark Wielaard <mjw@redhat.com>
1478 * readelf.c (print_debug_line_section): max_ops_per_instr cannot
1481 2014-12-07 Mark Wielaard <mjw@redhat.com>
1483 * readelf.c (print_ops): Handle zero ref_size for DW_OP_call_ref
1484 and DW_OP_GNU_implicit_pointer.
1486 2014-12-04 Mark Wielaard <mjw@redhat.com>
1488 * objdump.c (show_relocs_x): Make sure destshdr exists.
1489 (show_relocs_rel): Don't rely on shdr->sh_entsize, use gelf_fsize.
1490 (show_relocs_rela): Likewise.
1491 (show_relocs): Make sure destshdr, symshdr and symdata exists.
1493 2014-11-30 Mark Wielaard <mjw@redhat.com>
1495 * readelf.c (handle_sysv_hash64): Fix overflow check.
1497 2014-11-28 Mark Wielaard <mjw@redhat.com>
1499 * readelf.c (handle_relocs_rel): Don't reuse destshdr to store
1500 section header of a relocation against a STT_SECTION symbol. Use
1501 a new local variable secshdr.
1502 (handle_relocs_rela): Likewise.
1504 2014-11-26 Mark Wielaard <mjw@redhat.com>
1506 * readelf.c (print_debug_aranges_section): Cast Dwarf_Word length
1507 to ptrdiff_t for comparison.
1509 2014-11-24 Mark Wielaard <mjw@redhat.com>
1511 * readelf.c (print_debug_line_section): Check line_range is not zero
1514 2014-11-23 Mark Wielaard <mjw@redhat.com>
1516 * readelf.c (print_debug_aranges_section): Check length to catch
1519 2014-11-21 Mark Wielaard <mjw@redhat.com>
1521 * readelf.c (print_attributes): Guard against empty section.
1522 Document attribute format. Break when vendor name isn't terminated.
1523 Add overflow check for subsection_len. Handle both gnu and non-gnu
1526 2014-11-22 Mark Wielaard <mjw@redhat.com>
1528 * elflint.c (check_sections): Call ebl_bss_plt_p without ehdr.
1529 * findtextrel.c (process_file): Use elf_getphdrnum.
1530 * readelf.c (process_elf_file): Remove redundant ehdr->e_phoff check.
1531 (print_phdr): Check phnum.
1532 * size.c (show_segments): Use elf_getphdrnum.
1533 * strip.c (handle_elf): Likewise.
1534 * unstrip.c (copy_elf): Likewise.
1535 (copy_elided_sections): Likewise.
1536 (handle_file): Likewise.
1538 2014-11-18 Mark Wielaard <mjw@redhat.com>
1540 * readelf.c (print_cfa_program): Fix sanity check of DW_FORM_block
1543 2014-11-17 Mark Wielaard <mjw@redhat.com>
1545 * readelf.c (handle_verneed): Check vna_next and vn_next exist.
1546 (handle_verdef): Check vda_next and vd_next exist.
1547 (handle_versym): Check vd_next, vna_next and vn_next exist.
1548 Check vername and filename are not NULL before use.
1550 2014-11-17 Mark Wielaard <mjw@redhat.com>
1552 * elfcmp.c (main): Check section names are NULL before use.
1553 * objdump.c (section_match): Likewise.
1554 * size.c (show_sysv): Likewise.
1556 2014-11-17 Mark Wielaard <mjw@redhat.com>
1558 * readelf.c (print_debug_frame_section): Warn if ptr_size is not 4
1559 or 8 instead of just calling print_cfa_program.
1561 2014-11-16 Mark Wielaard <mjw@redhat.com>
1563 * readelf (process_elf_file): Set phnum to zero if there aren't
1564 actually any pheaders.
1565 (print_phdr): Check there actually is a phdr.
1567 2014-11-16 Mark Wielaard <mjw@redhat.com>
1569 * readelf.c (print_cfa_program): Check block len before calling
1572 2014-11-14 Mark Wielaard <mjw@redhat.com>
1574 * readelf.c (print_debug_frame_section): Sanity Check CIE
1575 unit_length and augmentationlen.
1577 2014-11-14 Mark Wielaard <mjw@redhat.com>
1579 * readelf.c (handle_versym): Check def == NULL before use.
1581 2014-11-08 Mark Wielaard <mjw@redhat.com>
1583 * readelf.c (handle_versym): Initialize vername and filename array
1586 2014-11-07 Mark Wielaard <mjw@redhat.com>
1588 * readelf.c (handle_sysv_hash): Sanity check section contents.
1589 (handle_sysv_hash64): Likewise.
1590 (handle_gnu_hash): Likewise.
1592 2014-09-14 Petr Machata <pmachata@redhat.com>
1594 * readelf.c (handle_relocs_rela): Typo fix, test DESTSHDR properly.
1596 2014-09-12 Petr Machata <pmachata@redhat.com>
1598 * readelf.c (encoded_ptr_size): In the switch statement, change
1599 magic constants 3 and 4 to DW_EH_PE_* counterparts. Still accept
1600 0. Print diagnostic for anything else.
1602 2014-08-25 Josh Stone <jistone@redhat.com>
1604 * Makefile.am: Prevent premature @AR@ replacement in a sed expression.
1606 2014-07-04 Menanteau Guy <menantea@linux.vnet.ibm.com>
1607 Mark Wielaard <mjw@redhat.com>
1609 * elflint (check_symtab): Add ".TOC." to the list of possibly
1610 dangling symbols because of sourceware PR13621.
1612 2014-06-14 Mark Wielaard <mjw@redhat.com>
1614 * elflint (check_symtab): Use ebl_func_addr_mask on st_value.
1616 2014-05-27 Mark Wielaard <mjw@redhat.com>
1618 * readelf.c (print_debug): Skip section if name is NULL.
1620 2014-05-26 Mark Wielaard <mjw@redhat.com>
1622 * readelf.c (handle_relocs_rela): Print header like handle_relocs_rel
1623 does, when sh_info == 0.
1625 2014-05-26 Mark Wielaard <mjw@redhat.com>
1627 * unstrip.c (find_alloc_sections_prelink): Allow non-split .bss
1628 section when sh_size of the original and undo .bss section are equal.
1630 2014-05-26 Mark Wielaard <mjw@redhat.com>
1632 * unstrip.c (options): Add --force, -F.
1633 (struct arg_info): Add bool force.
1634 (parse_opt): Handle 'F', set force.
1635 (handle_explicit_files): Add force argument, add warn function,
1636 separate check ehdr field checks, use warn.
1637 (handle_dwfl_module): Add force argument, pass on to
1638 handle_explicit_files.
1639 (handle_output_dir_module): Add force argument, pass on to
1641 (handle_implicit_modules): Pass info->force to handle_dwfl_module and
1642 handle_output_dir_module.
1643 (main): Pass info.force to handle_explicit_files.
1645 2014-05-19 Mark Wielaard <mjw@redhat.com>
1647 * elflint.c (check_reloc_shdr): Check ebl_check_reloc_target_type.
1649 2014-05-01 Mark Wielaard <mjw@redhat.com>
1651 * readelf.c (find_no_debuginfo): Call dwfl_standard_find_debuginfo
1652 if looking for alternate debug file.
1654 2014-04-11 Mark Wielaard <mjw@redhat.com>
1656 * Makefile.am (AM_CPPFLAGS): Add -I libdwelf.
1658 2014-04-22 Mark Wielaard <mjw@redhat.com>
1660 * readelf.c (handle_core_item): Make sure variable length array
1661 contains at least enough space for terminating zero char.
1663 2014-04-22 Mark Wielaard <mjw@redhat.com>
1665 * readelf.c (print_gdb_index_section): Use unsigned int for 31 bits
1668 2014-03-13 Mark Wielaard <mjw@redhat.com>
1670 * Makefile.am: Remove no_mudflap.os. Remove libmudflap from all
1672 * strings.c (process_chunk): Remove _MUDFLAP condition.
1674 2014-04-09 Mark Wielaard <mjw@redhat.com>
1676 * readelf.c (print_debug_aranges_section): Don't get the raw section
1677 data, use the possibly decompressed .[z]debug sectiondata.
1678 (print_debug_ranges_section): Likewise.
1679 (print_debug_frame_section): Likewise.
1680 (print_debug_line_section): Likewise.
1681 (print_debug_loc_section): Likewise.
1682 (print_debug_macinfo_section): Likewise.
1683 (print_debug_macro_section): Likewise.
1685 2014-04-10 Mark Wielaard <mjw@redhat.com>
1687 * readelf.c (buf_read_ulong): Pass actual long size to convert.
1689 2014-03-05 Mark Wielaard <mjw@redhat.com>
1691 * readelf.c (attr_callback): Print DW_FORM_sdata values as signed
1694 2014-02-24 Mark Wielaard <mjw@redhat.com>
1696 * readelf (print_phdr): Check there is a SHT_PROGBITS section at the
1697 offset given by p_offsets for a PT_INTERP segment before trying to
1698 display the interpreter string.
1700 2014-02-07 Mark Wielaard <mjw@redhat.com>
1702 * readelf.c (print_phdr): Check phdr->p_filesz and make sure
1703 interpreter string is zero terminated before calling printf.
1705 2014-01-22 Mark Wielaard <mjw@redhat.com>
1707 * Makefile.am (nm_no_Wformat): Removed.
1708 (size_no_Wformat): Likewise.
1709 (strings_no_Wformat): Likewise.
1710 (addr2line_no_Wformat): Likewise.
1711 * size.c (show_sysv): Use fmtstr directly as literal in printf.
1712 (show_sysv_one_line): Likewise.
1713 * strings.c (locfmt): Removed.
1714 (radix): New static enum.
1715 (parse_opt): Set radix, not locfmt.
1716 (process_chunk_mb): Use fmtstr directly as literal in printf based
1718 (process_chunk): Likewise.
1719 * nm.c (show_symbols_sysv): Use fmtstr directly as literal in printf.
1720 (show_symbols_bsd): Likewise.
1721 (show_symbols_posix): Likewise.
1723 2014-01-21 Mark Wielaard <mjw@redhat.com>
1725 * stack.c (show_inlines): New static boolean.
1726 (print_frame): New function split out from...
1727 (print_frames): ..here. If show_inlines is true and we found a
1728 DIE for the frame address, call print_inline_frames otherwise
1729 call print_frame. Keep track of and track frame_nr.
1730 (print_inline_frames): New function.
1731 (parse_opt): Handle '-i'.
1732 (main): Add 'i' to options.
1734 2014-01-27 Mark Wielaard <mjw@redhat.com>
1736 * stack.c (maxframes): Initialize to 256.
1737 (main): Document new default in options. Document magic number
1738 used in frames.allocated initialization.
1740 2014-01-20 Mark Wielaard <mjw@redhat.com>
1742 * stack.c (show_debugname): New static boolean.
1743 (die_name): New function.
1744 (print_frames): If show_debugname is true set symname to the
1745 first function-like DIE with a name in scope for the address in
1747 (parse_opt): Handle '-d'.
1748 (main): Add 'd' to options.
1750 2014-01-20 Mark Wielaard <mjw@redhat.com>
1752 * addr2line.c (handle_address): Initialize scopes to NULL.
1754 2014-01-17 Roland McGrath <roland@redhat.com>
1756 * strip.c (handle_elf): Check for bogus values in sh_link, sh_info,
1757 st_shndx, e_shstrndx, and SHT_GROUP or SHT_SYMTAB_SHNDX data.
1758 Don't use assert on input values, instead bail with "illformed" error.
1760 2014-01-17 Roland McGrath <roland@redhat.com>
1762 * readelf.c (handle_dynamic, handle_symtab): Check for bogus sh_link.
1763 (handle_verneed, handle_verdef, handle_versym, handle_hash): Likewise.
1764 (handle_scngrp): Check for bogus sh_info.
1766 2014-01-17 Jakub Jelinek <jakub@redhat.com>
1768 * elflint.c (section_name): Return "<invalid>" instead of
1769 crashing on invalid section name.
1770 (check_symtab, is_rel_dyn, check_rela, check_rel, check_dynamic,
1771 check_symtab_shndx, check_hash, check_versym): Robustify.
1772 (check_hash): Don't check entries beyond end of section.
1773 (check_note): Don't crash if gelf_rawchunk fails.
1775 2014-01-17 Petr Machata <pmachata@redhat.com>
1777 * readelf.c (handle_dynamic, handle_relocs_rel)
1778 (handle_relocs_rela, handle_versym, print_liblist):
1779 Use gelf_fsize instead of relying on shdr->sh_entsize.
1781 2014-01-14 Mark Wielaard <mjw@redhat.com>
1783 * readelf.c (print_debug_macro_section): Clear vendor array before
1786 2014-01-15 Jan Kratochvil <jan.kratochvil@redhat.com>
1788 Fix corruption of non-C++ symbols by the demangler.
1789 * nm.c (show_symbols_sysv, show_symbols_bsd, show_symbols_posix)
1790 (show_symbols): Check for _Z.
1791 * stack.c (print_frames) <USE_DEMANGLE>: Check for _Z.
1793 2014-01-02 Mark Wielaard <mjw@redhat.com>
1795 * stack.c (show_raw): Declare unconditionally.
1796 (parse_opt): Handle '-r' unconditionally.
1797 (main): Show "raw" option even without USE_DEMANGLE.
1799 2014-01-02 Mark Wielaard <mjw@redhat.com>
1801 * stack.c (print_frames): Print 0x before build-id hex-offset.
1803 2014-01-02 Mark Wielaard <mjw@redhat.com>
1805 * stack.c (maxframes): Increase to 2048.
1806 (struct frames): Add allocated field.
1807 (frame_callback): If frames used is frames allocated, realloc.
1808 (print_frames): Show an error if maxframes has been reached.
1809 (parse_opt): Allow -n 0 for unlimited frames.
1810 (main): Document -n 0 and new default 2048 frames. Allocate initial
1811 number of frames with malloc.
1813 2013-12-30 Mark Wielaard <mjw@redhat.com>
1815 * stack.c (parse_opt): Explicitly call dwfl_linux_proc_attach
1816 or dwfl_core_file_attach and check for errors.
1818 2013-12-28 Mark Wielaard <mjw@redhat.com>
1820 * stack.c (print_frames): Remove address width code and use...
1821 (get_addr_width): ...this new function.
1822 (show_modules): New static boolean.
1823 (module_callback): New static function.
1824 (parse_opt): Handle '-l'.
1825 (main): Add 'l' to options. If show_modules then use dwfl_getmodules
1826 with module_callback to show all detected modules and possible
1827 build_id, elf and dwarf files.
1829 2013-12-27 Mark Wielaard <mjw@redhat.com>
1831 * stack.c (frames_shown): New static boolean.
1832 (EXIT_OK,EXIT_ERROR,EXIT_BAD,EXIT_USAGES): New defines.
1833 (frame_callback): Return -1 on error. Don't print error.
1834 (print_frames): Add arguments, tid, dwflerr and what. Print tid.
1835 If there was an error report it with address and module if possible.
1836 Record whether any frames were actually printed.
1837 (thread_callback): Collect tid and err, pass it to print_frames.
1838 (parse_opt): Use EXIT_BAD for errors. On ARGP_KEY_END print errno
1839 if dwfl_linux_proc_report returned it. Check whether we are properly
1840 attached with dwfl_pid.
1841 (main): Document exit status. Don't report DWARF_CB_ABORT from
1842 callbacks as error. Pass real errors to print_frames. Return
1843 EXIT_BAD if no frames could be shown. Return EXIT_ERROR if there
1844 were any non-fatal errors.
1846 2013-12-23 Mark Wielaard <mjw@redhat.com>
1848 * Makefile.am (stack_LDADD): Add demanglelib.
1849 * stack.c (show_quiet): New static boolean, default false.
1850 (show_raw): Likewise.
1851 (demangle_buffer_len): New static size_t.
1852 (demangle_buffer): New static char *.
1853 (print_frames): Don't resolve pc name if show_quiet. Demangle name
1855 (parse_opt): Handle '-q' and '-r'.
1856 (main): Add 'q' and 'r' to options. Free demangle_buffer.
1858 2013-12-23 Mark Wielaard <mjw@redhat.com>
1860 * stack.c (OPT_DEBUGINFO): New define.
1861 (OPT_COREFILE): Likewise.
1863 (core_fd): Likewise.
1866 (debuginfo_path): Likewise.
1867 (parse_opt): Handle '-p', '--core', '-e' and '--debuginfo-path'.
1868 Do argument sanity checking. Setup Dwfl.
1869 (main): Add 'p', 'core', 'e' and 'debuginfo-path' to options.
1870 Remove argp_child children, simplify argp doc, remove custom
1871 usage message and construction of dwfl with dwfl_standard_argp.
1872 Use pid directly as tid. close core and core_fd if opened. Print
1873 pid of process or core.
1875 2013-12-23 Mark Wielaard <mjw@redhat.com>
1877 * stack.c (show_build_id): New static boolean.
1878 (print_frames): Print module build-id, load address and pc offset
1879 if show_build_id is true.
1880 (parse_opt): Handle '-b'.
1881 (main): Add -b to options.
1883 2013-12-22 Mark Wielaard <mjw@redhat.com>
1885 * stack.c (maxframes): New static unsigned. Initialize to 64.
1886 (struct frame): New struct.
1887 (struct frames): Likewise.
1888 (dwfl): New static Dwfl pointer.
1889 (frame_callback): Use arg as struct frames and fill it next frame.
1890 Return DWARF_CB_ABORT when maxframes has been reached. Move
1891 printing of frame to...
1892 (print_frames): ...here. New function.
1893 (thread_callback): Use arg as struct frames and set frames to zero.
1895 (parse_opt): Handle '-n'.
1896 (main): Add -n to options. Allocate frames using maxframes. Pass
1897 frames to frame_callback and thread_callback.
1899 2013-12-20 Mark Wielaard <mjw@redhat.com>
1901 * stack.c (show_one_tid): New static boolean.
1902 (parse_opt): Handle '-1'.
1903 (main): Add -1 to options. Call dwfl_getthread_frames when
1904 show_one_tid is true.
1906 2013-12-18 Mark Wielaard <mjw@redhat.com>
1908 * addr2line.c (options): Add symbol-sections, 'x'.
1909 (show_symbol_sections): New static bool.
1910 (parse_opt): Handle 'x'.
1911 (print_addrsym): Use dwfl_module_addrinfo value.r
1912 Also show section of address with show_symbol_sections.
1913 (find_symbol): Use dwfl_module_getsym_info and set value.
1914 (handle_address): Request value and use it instead of sym.st_value.
1915 * readelf.c (format_dwarf_addr): Use dwfl_module_addrinfo to get
1918 2013-12-17 Masatake YAMATO <yamato@redhat.com>
1919 Mark Wielaard <mjw@redhat.com>
1921 * stack.c (show_activation, show_module, show_source): New variables.
1922 (parse_opt): Set show_activation if -a option is given.
1923 Set show_module if -m option is given. Set show_source if -s option
1924 is given. Set all show booleans when -v option is given.
1925 (main): Added `-a', `-m', `-s', and `-v' to the help message.
1926 (frame_callback): Print module and source file information.
1928 2013-11-25 Petr Machata <pmachata@redhat.com>
1930 * elflint.c (valid_e_machine): Add EM_AARCH64.
1932 2013-11-14 Petr Machata <pmachata@redhat.com>
1934 * readelf.c (handle_core_item) <'h'>: New branch for handling
1935 fields that shouldn't be displayed.
1937 2013-11-10 Mark Wielaard <mjw@redhat.com>
1939 * stack.c: Use ARGP_PROGRAM_VERSION_HOOK_DEF and
1940 ARGP_PROGRAM_BUG_ADDRESS_DEF.
1941 (print_version): New function.
1943 2013-11-09 Mark Wielaard <mjw@redhat.com>
1945 * arlib.c (arlib_init): Call snprintf before using the result
1947 (arlib_finalize): Likewise.
1948 * nm.c (show_symbols_sysv): Don't modify cnt inside assert.
1950 2013-11-07 Jan Kratochvil <jan.kratochvil@redhat.com>
1952 * Makefile.am (bin_PROGRAMS): Add stack.
1954 * stack.c: New file.
1956 2013-11-05 Mark Wielaard <mjw@redhat.com>
1958 * readelf.c (print_debug_ranges_section): Cast address to size_t
1960 (print_debug_loc_section): Likewise.
1962 2013-10-18 Mark Wielaard <mjw@redhat.com>
1964 * ar.c (main): Correct operation check when instance_specifed is set.
1966 2013-09-26 Petr Machata <pmachata@redhat.com>
1968 * readelf.c (handle_file_note): New function.
1969 (handle_notes_data): Call it to handle NT_FILE notes.
1971 2013-09-26 Petr Machata <pmachata@redhat.com>
1973 * readelf.c (handle_siginfo_note): New function.
1974 (handle_notes_data): Call it to handle NT_SIGINFO notes.
1975 (buf_read_int, buf_read_ulong, buf_has_data): New functions.
1977 2013-08-13 Mark Wielaard <mjw@redhat.com>
1979 * addr2line.c (options): Add "inlines", 'i'.
1980 (show_inlines): New bool.
1981 (parse_opt): Handle 'i'.
1982 (print_diesym): New static function.
1983 (print_src): New function taking code from...
1984 (handle_address): here. Call print_src. Print inlines.
1986 2013-08-12 Mark Wielaard <mjw@redhat.com>
1988 * addr2line.c (main): If there is a newline char at end of buf,
1991 2013-07-05 Mark Wielaard <mjw@redhat.com>
1993 * readelf.c (print_ops): Take CU as argument, use it to print
1994 parameter_ref DIE offset.
1995 (struct listptr): Replace base field with cu.
1996 (listptr_base): New function.
1997 (compare_listptr): Use listptr_base.
1998 (notice_listptr): Take CU as argument.
1999 (skip_listptr_hole): Likewise.
2000 (print_debug_ranges_section): Pass NULL as CU to skip_listptr_hole.
2001 (print_cfa_program): Pass NULL as CU to print_ops.
2002 (struct attrcb_args): Replace cu_base field with cu.
2003 (attr_callback): Pass cu not cu_base to notice_listptr.
2004 (print_debug_units): Don't calculate base, just set cu.
2005 (print_debug_loc_section): Pass cu to skip_listptr_hole and
2008 2013-05-06 Mark Wielaard <mjw@redhat.com>
2010 * readelf.c (print_ops): Format first DW_OP_GNU_implicit_pointer
2011 argument as DIE offset.
2013 2013-04-24 Mark Wielaard <mjw@redhat.com>
2015 * Makefile.am: Use AM_CPPFLAGS instead of INCLUDES.
2017 2013-03-25 Mark Wielaard <mjw@redhat.com>
2019 * readelf.c (argp_options): Add decodedline.
2020 (decodedline): New boolean initialized to false.
2021 (parse_opt): Set decodedline when arg is decodedline.
2022 (print_decoded_line_section): New function.
2023 (print_debug_line_section): Call print_decoded_line_section when
2024 decodedline is true.
2026 2013-03-25 Mark Wielaard <mjw@redhat.com>
2028 * readelf.c (argp_option): Add decodedaranges.
2029 (decodedaranges): New boolean initialized to false.
2030 (parse_opt): Set decodedaranges when arg is decodedaranges.
2031 (print_debug_aranges_section): Reimplemented and original
2032 implementation renamed to...
2033 (print_decoded_aranges_section): this.
2035 2013-03-25 Mark Wielaard <mjw@redhat.com>
2037 * readelf.c (attrcb_args): Add Dwarf_Die.
2038 (attr_callback): When highpc is in constant form also print as
2040 (print_debug_units): Set args.die.
2042 2013-03-19 Mark Wielaard <mjw@redhat.com>
2044 * readelf.c (print_gdb_index_section): Free format_dwarf_addr results.
2046 2013-03-18 Mark Wielaard <mjw@redhat.com>
2048 * readelf.c (print_gdb_index_section): Accept version 8.
2050 2013-03-01 Mark Wielaard <mjw@redhat.com>
2052 * findtextrel.c (process_file): Release ELF and close file when not
2053 text relocations are found.
2054 * strip.c (handle_elf): Track memory used for .debuglink section data
2057 2013-02-24 Mark Wielaard <mjw@redhat.com>
2059 * elflint.c (check_symtab): Add __bss_start__ to the list of symbols
2060 allowed to have out of section values because of GNU ld bugs.
2062 2013-02-06 Mark Wielaard <mjw@redhat.com>
2064 * elflint.c (check_symtab): Add __bss_start and __TMC_END__ to the
2065 list of symbols allowed to have out of section values because of
2066 GNU ld bugs in either .symtab or .dynsym, but only when they are
2069 2013-01-24 Mark Wielaard <mjw@redhat.com>
2071 * readelf.c (argp_option): Add unresolved-address-offsets, U.
2072 (print_unresolved_addresses): New static.
2073 (parse_opt): Handle 'U', set print_unprocessed_values.
2074 (format_dwarf_addr): Take and handle new raw argument.
2075 (print_ops): Call format_dwarf_addr with raw offset values.
2076 (print_debug_ranges_section): Likewise.
2077 (print_debug_frame_section): Likewise.
2078 (attr_callback): Likewise.
2079 (print_debug_line_section): Likewise.
2080 (print_debug_loc_section): Likewise.
2081 (print_gdb_index_section): Likewise.
2083 2013-01-18 Mark Wielaard <mjw@redhat.com>
2085 * readelf.c (struct listptr): Add base Dwarf_Addr field.
2086 (compare_listptr): Warn for same offset with different base.
2087 (notice_listptr): Take base argument and set it.
2088 (skip_listptr_hole): Likewise.
2089 (struct attrcb_args): Removed unused cu_offset field.
2090 Add cu_base Dwarf_Addr field.
2091 (attr_callback): Call notice_listptr with cbargs->cu_base.
2092 (print_debug_units): Set args.cu_base.
2093 (print_debug_ranges_section): Get base and use for format_dwarf_addr.
2094 (print_debug_loc_section): Likewise.
2096 2013-01-29 Jan Kratochvil <jan.kratochvil@redhat.com>
2098 * readelf.c (handle_core_items): Limit special repeated items handling
2099 to single-item formats '\n', 'b' and 'B', assert OFFSET 0 there.
2101 2012-12-18 Mark Wielaard <mark@bordewijk.wildebeest.org>
2103 * readelf.c (ELF_INPUT_SECTION): New argp key value.
2104 (argp_option): Add elf-section.
2105 (elf_input_section): New static.
2106 (parse_opt): Handle ELF_INPUT_SECTION and set elf_input_section.
2107 (open_input_section): New function.
2108 (process_file): Call open_input_section if elf_input_section set.
2110 2013-01-13 David Abdurachmanov <David.Abdurachmanov@cern.ch>
2112 ar.c (do_oper_delete): Fix num passed to memset.
2114 2012-12-21 Mark Wielaard <mjw@redhat.com>
2116 * readelf.c (print_debug_frame_section): Adjust FDE start address
2117 if pcrel before feeding it to format_dwarf_addr.
2119 2012-12-21 Mark Wielaard <mjw@redhat.com>
2121 * addr2line.c (main): Call dwfl_end.
2123 2012-12-11 Roland McGrath <roland@hack.frob.com>
2125 * nm.c (show_symbols_sysv): Fix size passed to snprintf for invalid
2127 Reported by David Abdurachmanov <David.Abdurachmanov@cern.ch>.
2129 2012-10-16 Mark Wielaard <mjw@redhat.com>
2131 * readelf.c (print_ops): DW_OP_skip and DW_OP_bra targets are
2132 calculated beginning after the operand and 2-byte constant.
2134 2012-10-12 Jan Kratochvil <jan.kratochvil@redhat.com>
2136 * readelf.c (ITEM_WRAP_COLUMN, REGISTER_WRAP_COLUMN): Merge to ...
2137 (WRAP_COLUMN): ... here.
2138 (print_core_item): Remove parameter format_max. Update function
2139 comment. Replace FORMAT_MAX by the real output width.
2140 (handle_core_item): Remove the FORMAT_MAX values in TYPES, DO_TYPE,
2141 calls of print_core_item, remove variable maxfmt, change
2142 ITEM_WRAP_COLUMN to WRAP_COLUMN.
2143 (handle_core_register): Remove the FORMAT_MAX values in TYPES, BITS,
2144 calls of print_core_item, change REGISTER_WRAP_COLUMN to WRAP_COLUMN.
2146 2012-10-11 Jan Kratochvil <jan.kratochvil@redhat.com>
2148 * readelf.c (handle_core_item) <b>: Make run an outer block variable.
2149 Increase run only if LASTBIT != 0. Print last element only if RUN > 0.
2151 2012-08-27 Mark Wielaard <mjw@redhat.com>
2153 * readelf.c (print_debug_macro_section): Print offset as PRIx64.
2155 2012-08-27 Mark Wielaard <mjw@redhat.com>
2157 * readelf.c (register_info): Handle loc == NULL.
2159 2012-08-22 Jeff Kenton <jkenton@tilera.com>
2161 * elflint.c (valid_e_machine): Add EM_TILEGX and EM_TILEPRO.
2163 2012-08-16 Mark Wielaard <mjw@redhat.com>
2165 * readelf.c (dwarf_tag_name): Renamed from dwarf_tag_string.
2166 Uses new dwarf_tag_string or adds ??? or lo_user+%#x when
2168 (dwarf_attr_name): Likewise.
2169 (dwarf_form_name): Likewise.
2170 (dwarf_lang_name): Likewise.
2171 (dwarf_inline_name): Likewise.
2172 (dwarf_encoding_name): Likewise.
2173 (dwarf_access_name): Likewise.
2174 (dwarf_visibility_name): Likewise.
2175 (dwarf_virtuality_name): Likewise.
2176 (dwarf_identifier_case_name): Likewise.
2177 (dwarf_calling_convention_name): Likewise.
2178 (dwarf_ordering_name): Likewise.
2179 (dwarf_discr_list_name): Likewise.
2180 (print_ops): Remove KNOWN. Use dwarf_locexpr_opcode_string.
2181 (attr_callback): Call new dwarf_foobar_name instead of old
2182 dwarf_foobar_string functions.
2183 (dwarf_tag_string): New function using known-dwarf.h macros.
2184 (dwarf_attr_string): Likewise.
2185 (dwarf_form_string): Likewise.
2186 (dwarf_lang_string): Likewise.
2187 (dwarf_inline_string): Likewise.
2188 (dwarf_encoding_string): Likewise.
2189 (dwarf_access_string): Likewise.
2190 (dwarf_visibility_string): Likewise.
2191 (dwarf_virtuality_string): Likewise.
2192 (dwarf_identifier_case_string): Likewise.
2193 (dwarf_calling_convention_string): Likewise.
2194 (dwarf_ordering_string): Likewise.
2195 (dwarf_discr_list_string): Likewise.
2196 (dwarf_locexpr_opcode_string): Likewise.
2198 2012-06-27 Mark Wielaard <mjw@redhat.com>
2200 * readelf.c (dwarf_form_string): Handle DW_FORM_GNU_ref_alt and
2201 DW_FORM_GNU_strp_alt.
2202 (attr_callback): Likewise.
2204 2012-07-30 Petr Machata <pmachata@redhat.com>
2206 * nm.c (show_symbols_bsd): Reorder arguments in {S,}FMTSTRS (and
2207 corresponding printf) so that those that are referenced by only
2208 one of the formatting strings are at the end.
2210 2012-07-29 Mark Wielaard <mjw@redhat.com>
2212 * readelf.c (dwarf_lang_string): Use DW_LANG_ObjC, not DW_LANG_Objc.
2213 (print_ops): Use known[op], not op_name, for DW_OP_GNU_parameter_ref.
2215 2012-07-19 Mark Wielaard <mjw@redhat.com>
2217 * readelf.c (print_ops): Handle DW_OP_GNU_parameter_ref.
2219 2012-07-11 Mark Wielaard <mjw@redhat.com>
2221 * readelf.c (options): Add macro to help of debug-dump.
2222 (section_e): Add section_macro.
2223 (section_all): Add section_macro.
2224 (parse_opt): Handle macro.
2225 (print_debug_macro_section): New function.
2226 (print_debug): Add NEW_SECTION (macro).
2228 2012-07-10 Mark Wielaard <mjw@redhat.com>
2230 * readelf.c (print_gdb_index_section): Add version 7 support.
2231 Keep track of cu_nr. Print kind and static/global flag for each
2232 symbol. When a symbol is in the TU list add 'T'.
2234 2012-06-26 Mark Wielaard <mjw@redhat.com>
2236 * readelf.c (dwarf_attr_string): Add DW_AT_GNU_macros.
2238 2012-06-22 Mark Wielaard <mjw@redhat.com>
2240 * readelf.c (print_ops): Cast printf PRIu/x64 arguments to uint64_t
2241 for gcc 4.7 -Wformat.
2243 2012-05-09 Roland McGrath <roland@hack.frob.com>
2245 * elflint (check_sections): Allow zero sized sections at (filesz) end
2246 of segment. And make check overflow-proofed.
2248 2012-04-24 Mark Wielaard <mjw@redhat.com>
2250 * readelf.c (print_ops): Add DW_OP_GNU_push_tls_address,
2251 DW_OP_GNU_uinit and DW_OP_GNU_encoded_addr.
2253 2012-03-28 Roland McGrath <roland@hack.frob.com>
2255 * elflint.c (special_sections): Accept SHF_INFO_LINK for reloc sections.
2257 2012-03-28 Mark Wielaard <mjw@redhat.com>
2259 * readelf.c (print_debug_abbrev_section): Check there is Dwarf
2261 (print_debug_str_section): Likewise.
2263 2012-03-21 Mark Wielaard <mjw@redhat.com>
2265 * readelf.c (print_gdb_index_section): Accept version 6.
2267 2012-01-31 Mark Wielaard <mjw@redhat.com>
2269 * readelf.c (attr_callback): Don't special case DW_FORM_sec_offset.
2271 2012-01-21 Ulrich Drepper <drepper@gmail.com>
2273 * addr2line.c: Update copyright year.
2275 * elfcmp.c: Likewise.
2276 * elflint.c: Likewise.
2277 * findtextrel.c: Likewise.
2280 * objdump.c: Likewise.
2281 * ranlib.c: Likewise.
2282 * readelf.c: Likewise.
2284 * strings.c: Likewise.
2285 * strip.c: Likewise.
2286 * unstrip.c: Likewise.
2288 * nm.c (argp_children): Define.
2289 (argp): Hook up argp_children.
2290 (handle_ar): Optimize puts call.
2291 (show_symbols_bsd): Use positional parameters to also print color
2292 codes. Don't print STT_FILE symbols.
2293 * objdump.c (options): Improve help text.
2294 (argp_children): Define.
2295 (argp): Hook up argp_children.
2296 (disasm_info): Add elements for color codes.
2297 (disasm_output): Print color codes as well.
2298 (show_disasm): Set up disasm_info data for callback.
2300 2012-01-20 Roland McGrath <roland@hack.frob.com>
2302 * arlib-argp.c (arlib_deterministic_output): Initialize from
2304 (help_filter): New function.
2307 * ar.c (main): Handle oper_none as usage error.
2309 * arlib-argp.c (options, parse_opt): Grok -U as inverse of -D.
2311 * ranlib.c (argp): Use arlib_argp_children.
2313 * arlib.c (arlib_init): Obey arlib_deterministic_output.
2315 * arlib-argp.c: New file.
2316 * Makefile.am (libar_a_SOURCES): Add it.
2317 * arlib.h (arlib_deterministic_output, arlib_argp_children):
2318 Declare new variables.
2319 * ar.c (deterministic_output): Variable removed.
2320 (do_oper_insert): Use arlib_deterministic_output instead.
2321 (options, parse_opt): Don't handle -D here. Add group numbers.
2322 (argp): Use arlib_argp_children.
2324 2011-12-20 Roland McGrath <roland@hack.frob.com>
2326 * readelf.c (print_debug): Initialize DUMMY_DBG.elf.
2327 Reported by Karel Klic <kklic@redhat.com>.
2329 2011-11-05 Roland McGrath <roland@hack.frob.com>
2331 * ar.c (deterministic_output): New flag variable.
2332 (options, parse_opt): Grok -D to set it.
2333 (do_oper_insert): When set, use zero from mtime, uid, and gid.
2335 * ar.c (do_oper_insert): Fix check on elf_rawfile return value.
2337 2011-10-04 Marek Polacek <mpolacek@redhat.com>
2339 * readelf.c (register_info): Assume the right size of an array.
2341 2011-10-03 Ulrich Drepper <drepper@gmail.com>
2343 * nm.c: Recognize option --mark-special. Still recognize --mark-weak
2344 but don't show it in help anymore.
2345 (mark_special): Renamed from mark_weak.
2346 (parse_opt): Adjust.
2347 (class_type_char): Take additional parameters for ELF file and ELF
2348 header. Treat TLS symbols like objects.
2349 In case of D symbols, show u for unique symbols, R for symbols in
2350 read-only sections, B for symbols in BSS sections.
2351 (show_symbols_bsd): Take additional parameters for ELF file and ELF
2352 header. Adjust for class_type_char change. Show TLS symbols with
2353 @ after them in case --mark-special is selected.
2354 (show_symbols_posix): Likewise.
2355 (show_symbols): Adjust calls to show_symbols_bsd and
2357 (show_symbols_sysv): Avoid printing adress and size for undefined
2358 symbols. Don't print initial special entry and section entries.
2360 2011-10-02 Ulrich Drepper <drepper@gmail.com>
2362 * Makefile.am (demanglelib): Define.
2363 (nm_LDADD): Add demanglelib.
2364 * nm.c (options): Add -C option.
2365 (demangle): Define as global variable.
2366 (parse_opt): Recognize -C.
2367 (show_symbols_sysv): Handle demangling.
2368 (show_symbols_bad): Likewise.
2369 (show_symbols_posix): Likewise.
2370 (show_symbols): Likewise.
2372 2011-07-09 Roland McGrath <roland@hack.frob.com>
2374 * readelf.c (options, parse_opt): Grok -W/--wide and ignore it.
2376 * ar.c (parse_opt): Grok -u.
2378 2011-05-30 Mark Wielaard <mjw@redhat.com>
2380 * strip.c (relocate): Make offset check overflow-proof.
2382 2011-05-23 Mark Wielaard <mjw@redhat.com>
2384 * strip.c (relocate): Take new arguments is_rela to indicate
2385 whether the relocation is from a SHT_REL or SHT_RELA section.
2386 Relocate against any debug section symbol, not just STT_SECTION
2387 symbols. For SHT_REL relocations, fetch addend from offset and
2388 add it to symbol value if not zero.
2390 2011-05-23 Mark Wielaard <mjw@redhat.com>
2392 * strip.c (OPT_RELOC_DEBUG): New option.
2393 (argp_option): Add new --reloc-debug-sections option.
2394 (main): Check new option.
2395 (parse_opt): Likewise.
2396 (handle_elf): Remove any relocations between debug sections
2397 in ET_REL for the debug file when requested.
2399 2011-05-18 Mark Wielaard <mjw@redhat.com>
2401 * strip.c (handle_elf): Make sure all sections of a removed group
2402 section are removed too. Don't discard SHT_GROUP sections, copy
2403 section table before it gets modified. Section group signature
2404 symbols don't have to be retained.
2406 2011-05-16 Jakub Jelinek <jakub@redhat.com>
2408 * readelf.c (print_ops): Handle DW_OP_GNU_const_type,
2409 DW_OP_GNU_regval_type, DW_OP_GNU_deref_type, DW_OP_GNU_convert
2410 and DW_OP_GNU_reinterpret.
2412 2011-05-17 Mark Wielaard <mjw@redhat.com>
2414 * readelf.c (dwarf_tag_string): Fixup DW_TAG_GNU_call_site and
2415 DW_TAG_GNU_call_site_parameter return strings.
2417 2011-05-11 Marek Polacek <mpolacek@redhat.com>
2419 * nm.c (show_symbols_sysv): Remove unused if/else, remove
2420 unused `prefix' and `fname' parameters.
2422 2011-05-07 Marek Polacek <mpolacek@redhat.com>
2424 * unstrip.c (compare_sections_nonrel): Mark this function as static.
2426 2011-04-26 Mark Wielaard <mjw@redhat.com>
2428 * readelf.c (handle_notes_data): Call ebl_object_note_type_name
2431 2011-04-14 Mark Wielaard <mjw@redhat.com>
2433 * readelf.c (options): Add gdb_index.
2434 (section_e): Define section_gdb_index.
2435 (parse_opt): Recognize gdb_index debug-dump argument.
2436 (print_gdb_index_section): New function.
2437 (print_debug): Add gdb_index to debug_sections.
2439 2011-03-24 Petr Machata <pmachata@redhat.com>
2441 * readelf.c (print_debug_line_section): Emit initial space for all
2442 opcode lines. Print offset in front of each opcode.
2444 2011-03-22 Marek Polacek <mpolacek@redhat.com>
2446 * readelf.c (handle_dynamic): Don't segfault at DT_PLTREL case.
2448 2011-03-22 Mark Wielaard <mjw@redhat.com>
2450 * readelf.c (dwarf_tag_string): Support DW_TAG_GNU_call_site
2451 and DW_TAG_GNU_call_site_parameter.
2452 (dwarf_attr_string): Support DW_AT_GNU_call_site_value,
2453 DW_AT_GNU_call_site_data_value,
2454 DW_AT_GNU_call_site_target,
2455 DW_AT_GNU_call_site_target_clobbered,
2456 DW_AT_GNU_tail_call,
2457 DW_AT_GNU_all_tail_call_sites,
2458 DW_AT_GNU_all_call_sites,
2459 and DW_AT_GNU_all_source_call_sites.
2460 (print_ops): Handle DW_OP_GNU_entry_value.
2461 (attr_callback): Handle DW_AT_GNU_call_site_value,
2462 DW_AT_GNU_call_site_data_value,
2463 DW_AT_GNU_call_site_target,
2464 and DW_AT_GNU_call_site_target_clobbered.
2466 2011-03-10 Mark Wielaard <mjw@redhat.com>
2468 * elflint.c (check_symtab): Use ebl_check_st_other_bits.
2470 2011-02-27 Jan Kratochvil <jan.kratochvil@redhat.com>
2472 * readelf.c (reset_listptr): Clear TABLE->TABLE.
2474 2011-02-25 Mark Wielaard <mjw@redhat.com>
2476 * readelf.c (dwarf_attr_string): Add DW_AT_GNU_* handling.
2477 (dwarf_form_string): Properly format and return unknown form.
2479 2011-02-23 Roland McGrath <roland@redhat.com>
2481 * readelf.c (section_name): New function.
2482 (print_debug_abbrev_section): Use it instead of constant.
2483 (print_debug_aranges_section): Likewise.
2484 (print_debug_ranges_section): Likewise.
2485 (print_debug_units): Likewise.
2486 (print_debug_line_section): Likewise.
2487 (print_debug_loc_section): Likewise.
2488 (print_debug_macinfo_section): Likewise.
2489 (print_debug_pubnames_section): Likewise.
2490 (print_debug_str_section): Likewise.
2491 (print_debug) [USE_ZLIB]: Match .zdebug_* sections too.
2492 (print_debug_abbrev_section): Use decoded d_size, not sh_size.
2493 (print_debug_str_section): Likewise.
2495 * readelf.c (dwarf_attr_string): Grok DW_AT_GNU_odr_signature.
2497 2011-02-11 Roland McGrath <roland@redhat.com>
2499 * elfcmp.c (verbose): New variable.
2500 (options, parse_opt): Grok -l/--verbose to set it.
2501 (main): Under -l, keep going after first difference.
2503 * elfcmp.c (ignore_build_id): New variable.
2504 (options, parse_opt): Grok --ignore-build-id to set it.
2505 (main): For SHT_NOTE sections, compare note details rather than raw
2506 bytes. Under --ignore-build-id, don't complain about differing build
2507 ID contents if lengths match.
2509 2011-02-08 Roland McGrath <roland@redhat.com>
2511 * ldscript.y (filename_id_star): Remove unused variable.
2513 * unstrip.c (copy_elided_sections): Remove unused variable.
2515 * elflint.c (check_dynamic): Remove unused variables.
2517 * elflint.c (check_symtab): Warn about missing xndx section only once.
2519 * ldgeneric.c (check_for_duplicate2): Remove unused variable.
2521 2011-01-06 Roland McGrath <roland@redhat.com>
2523 * strip.c (handle_elf): Under --strip-sections, remove all
2524 non-allocated sections and never generate .gnu_debuglink.
2526 2011-01-04 Roland McGrath <roland@redhat.com>
2528 * strip.c (remove_shdrs): New variable.
2529 (options, parse_opt): Grok --strip-sections to set it.
2530 (handle_elf): When that's set, truncate off .shstrtab and shdrs.
2532 2010-11-10 Roland McGrath <roland@redhat.com>
2534 * findtextrel.c (process_file): Don't assume order of sections.
2535 Reported by Mike Hommey <mh@glandium.org>.
2537 2010-07-26 Roland McGrath <roland@redhat.com>
2539 * readelf.c (print_ops): Handle DW_OP_GNU_implicit_pointer.
2541 2010-08-30 Roland McGrath <roland@redhat.com>
2543 Print .debug_loc/.debug_ranges with cognizance of actual DIE uses.
2544 * readelf.c (parse_opt): Add section_info to implicit_debug_sections
2546 (struct listptr, struct listptr_table): New types.
2547 (compare_listptr, reset_listptr, sort_listptr): New functions.
2548 (notice_listptr, skip_listptr_hole): New functions.
2549 (struct attrcb_args): Add silent member.
2550 (attr_callback): Call notice_listptr for loclistptr and rangelistptr.
2551 Suppress output if silent, but still call notice_listptr.
2552 (print_debug_units): Suppress output if section_info not requested.
2553 (print_debug_loc_section): Call sort_listptr, skip_listptr_hole.
2554 (print_debug_ranges_section): Likewise.
2555 (print_debug): Call reset_listptr on both tables.
2557 * readelf.c (print_debug_ranges_section): Print empty list.
2558 (print_debug_loc_section): Likewise.
2560 * readelf.c (print_debug_loc_section): Check for bogus length
2561 before calling print_ops.
2562 (print_ops): Check harder for bogus data that would read off end.
2564 2010-08-11 Roland McGrath <roland@redhat.com>
2566 * readelf.c (for_each_section_argument): Process all sections with
2567 matching name, not just the first.
2569 2010-07-26 Roland McGrath <roland@redhat.com>
2571 * readelf.c (print_ops): Take new argument for CU version.
2572 Fix DW_OP_call_ref decoding to depend on it.
2573 (print_debug_loc_section): Update caller.
2574 (print_cfa_program): Take new argument, pass it down.
2575 (print_debug_frame_section): Update caller.
2576 (struct attrcb_args): New member version.
2577 (print_debug_units): Initialize it.
2579 2010-07-02 Roland McGrath <roland@redhat.com>
2581 * readelf.c (print_debug_frame_section): Use format_dwarf_addr for
2584 2010-06-30 Roland McGrath <roland@redhat.com>
2586 * strings.c (main): Use STDIN_FILENO, not STDOUT_FILENO.
2587 Ignore st_size for a non-S_ISREG file descriptor.
2588 (read_block): Move assert after no-mmap bail-out.
2589 (read_block_no_mmap): Fix size calculations for moving buffer remnant.
2591 2010-06-22 Roland McGrath <roland@redhat.com>
2593 * readelf.c (print_debug_line_section): Fix braino in DW_LNS_set_isa.
2595 2010-06-21 Roland McGrath <roland@redhat.com>
2597 * readelf.c (dwarf_tag_string): Handle new v4 tags.
2598 (dwarf_attr_string): Add new attributes.
2599 (dwarf_tag_string): Handle DW_TAG_GNU_*.
2601 * readelf.c (print_ops): Use 64-bit types for LEB128 operands.
2602 (print_cfa_program): Likewise.
2604 2010-06-20 Roland McGrath <roland@redhat.com>
2606 * readelf.c (print_debug_units): New function, broken out of ...
2607 (print_debug_info_section): ... here. Call it.
2608 (print_debug_types_section): New function.
2609 (enum section_e): Add section_types alias for section_info.
2610 (print_debug): Add types to the sections table.
2612 * readelf.c (print_debug_frame_section): Handle version 4 format.
2614 * readelf.c (print_debug_line_section): Handle version 4 format.
2616 2010-06-14 Roland McGrath <roland@redhat.com>
2618 * unstrip.c (copy_elided_sections): Make sure all sections' data have
2619 been read in before we write anything out.
2621 2010-06-04 Roland McGrath <roland@redhat.com>
2623 * unstrip.c (update_shdr): New function.
2624 (update_sh_size): Call it instead of gelf_update_shdr.
2625 (adjust_relocs, add_new_section_symbols): Likewise.
2626 (new_shstrtab, copy_elided_sections): Likewise.
2628 * unstrip.c (copy_elided_sections): Bail if stripped file has more
2629 sections than unstripped file, rather than getting confused later.
2631 2010-06-01 Roland McGrath <roland@redhat.com>
2633 * readelf.c (dwarf_form_string): Handle DWARF 4 forms.
2634 (attr_callback): Handle DW_FORM_flag_present, DW_FORM_exprloc,
2635 DW_FORM_sec_offset, DW_FORM_ref_sig8.
2637 * readelf.c (print_debug): Don't bail if libdw setup fails.
2638 Suppress complaint if we only want .eh_frame anyway.
2640 2010-05-28 Ulrich Drepper <drepper@redhat.com>
2642 * readelf.c (attr_callback): Also print form information.
2644 2010-05-19 Roland McGrath <roland@redhat.com>
2646 * addr2line.c (find_symbol): Short-circuit on empty name.
2647 (handle_address): Handle SYMBOL with no +OFFSET.
2649 2010-05-08 Roland McGrath <roland@redhat.com>
2651 * readelf.c (print_ops): Take new arg OFFSET_SIZE.
2652 Use that for DW_OP_call_ref, not ADDRSIZE.
2653 (print_cfa_program): Update caller.
2654 (struct attrcb_args): Add offset_size field.
2655 (attr_callback): Use it for print_ops call.
2656 (print_debug_info_section): Initialize it.
2657 (print_ops): Likewise.
2659 2010-04-14 Roland McGrath <roland@redhat.com>
2661 * readelf.c (handle_core_item): Fix bitmask printing.
2663 2010-04-06 Roland McGrath <roland@redhat.com>
2665 * ld.c (options): Fix some typos in messages.
2666 * elflint.c (check_scn_group, check_group): Likewise.
2667 * ldscript.y (add_id_list): Likewise.
2668 * readelf.c (print_hash_info): Add xgettext:no-c-format magic comment
2669 before translated string containing a literal %.
2671 2010-02-26 Roland McGrath <roland@redhat.com>
2673 * readelf.c (process_file): Don't leak an fd in failure case.
2675 2010-02-15 Roland McGrath <roland@redhat.com>
2677 * Makefile.am: Use config/eu.am for common stuff.
2679 * readelf.c (print_debug_frame_section): Add a cast to avoid sign
2680 mismatch in comparison.
2682 2010-02-02 Roland McGrath <roland@redhat.com>
2684 * readelf.c (print_encoding_base): Handle DW_EH_PE_absptr (zero).
2685 (read_encoded): Likewise.
2686 (print_debug_frame_section): Check for bogus augmentation length.
2687 For P augmentation, use read_encoded, print the encoding description,
2688 and use hex for unsigned values.
2690 2010-01-15 Roland McGrath <roland@redhat.com>
2692 * ar.c: Include <sys/stat.h>.
2693 * elflint.c: Likewise.
2694 * readelf.c: Likewise.
2695 * strip.c: Likewise.
2696 * unstrip.c: Likewise
2698 2010-01-07 Roland McGrath <roland@redhat.com>
2700 * readelf.c (print_ehdr): Handle PN_XNUM.
2701 (phnum): New static variable.
2702 (process_elf_file): Set it with elf_getphdrnum.
2703 (print_phdr): Use phnum instead of EHDR->e_phnum.
2704 (print_dynamic, handle_notes): Likewise.
2705 (handle_relocs_rel, handle_relocs_rela): Likewise.
2707 * elfcmp.c (main): Use elf_getshdrnum and elf_getphdrnum.
2709 * elflint.c (phnum): New static variable.
2710 (check_elf_header): Set it, handling PN_XNUM.
2711 Use that in place of EHDR->e_phnum throughout.
2712 (check_symtab, check_reloc_shdr, check_dynamic): Likewise.
2713 (unknown_dependency_p, check_sections, check_program_header): Likewise.
2715 2010-01-05 Roland McGrath <roland@redhat.com>
2717 * readelf.c (dwarf_attr_string): Match DW_AT_GNU_vector and
2718 DW_AT_GNU_template_name.
2720 2010-01-04 Roland McGrath <roland@redhat.com>
2722 * readelf.c (handle_notes_data): Grab NT_AUXV only for name "CORE".
2723 (handle_core_note): Pass NHDR and NAME to ebl_core_note.
2724 (handle_core_item): Handle .format of '\n' as \n-separated strings.
2726 * readelf.c (implicit_debug_sections): New variable.
2727 (parse_opt): Set it instead of print_debug_sections for -a.
2728 OR them together for print_debug check.
2729 (print_debug): OR them together for section check.
2731 * readelf.c (options): Repartition into set implied by -a and others.
2732 Correct -a text to match reality.
2734 * readelf.c (struct section_argument): Add bool member 'implicit'.
2735 (parse_opt): Set it for -a cases, clear it for -x args.
2736 (for_each_section_argument): Don't complain about a missing section by
2737 name if it's implicit.
2739 2009-11-16 Roland McGrath <roland@redhat.com>
2741 * readelf.c (print_string_section): Punt SHT_NOBITS like empty
2742 sections, just as dump_data_section already does.
2744 2009-09-21 Ulrich Drepper <drepper@redhat.com>
2746 * elflint.c (special_sections): Allow MERGE and STRINGS flags to be
2747 set for .comment section.
2748 Patch by Mark Wielaard <mjw@redhat.com>.
2750 2009-09-08 Roland McGrath <roland@redhat.com>
2752 * ar.c (main): Fix typo in message format.
2754 2009-08-21 Roland McGrath <roland@redhat.com>
2756 * readelf.c (attr_callback): Use print_block only when we don't use
2759 2009-08-14 Roland McGrath <roland@redhat.com>
2761 * ar.c (do_oper_extract): Use pathconf instead of statfs.
2763 2009-08-01 Ulrich Drepper <drepper@redhat.com>
2765 * debugpred.h: Add two most const.
2767 2009-07-26 Mark Wielaard <mjw@redhat.com>
2769 * elflint.c (check_note_data): Recognize NT_GNU_GOLD_VERSION.
2771 2009-07-25 Mark Wielaard <mjw@redhat.com>
2773 * Makefile.am (addr2line_LDADD): Add $(libelf).
2775 2009-07-24 Roland McGrath <roland@redhat.com>
2777 * readelf.c (print_block): New function.
2778 (print_ops): Use it.
2779 (attr_callback): Use it for DW_FORM_block* forms.
2781 2009-07-20 Mark Wielaard <mjw@redhat.com>
2783 * readelf.c (print_ops): Add handling of DW_OP_implicit_value
2784 and DW_OP_stack_value.
2786 2009-07-14 Ulrich Drepper <drepper@redhat.com>
2788 * elflint.c (check_elf_header): Allow Linux ABI.
2789 (check_symtab): Handle STB_GNU_UNIQUE.
2791 2009-07-08 Mark Wielaard <mjw@redhat.com>
2793 * readelf.c (attr_callback): Handle DW_Form constants for
2794 DW_AT_data_member_location.
2796 2009-07-06 Roland McGrath <roland@redhat.com>
2798 * readelf.c (register_info): New function. Handle unknown register #s.
2799 (print_cfa_program): Use it.
2800 (handle_core_register, handle_core_registers): Likewise.
2802 2009-06-28 Roland McGrath <roland@redhat.com>
2804 * readelf.c (print_address_names): New static variable.
2805 (options, parse_opt): Grok -N/--numeric-addresses to clear it.
2806 (format_dwarf_addr): Don't look up name if !print_address_names.
2808 2009-06-13 Ulrich Drepper <drepper@redhat.com>
2810 * ldgeneric.c: Don't use deprecated libelf functions.
2812 * objdump.c: Likewise.
2813 * readelf.c: Likewise.
2815 * strip.c: Likewise.
2816 * unstrip.c: Likewise.
2817 * ld.h: Fix up comment.
2819 2009-06-01 Ulrich Drepper <drepper@redhat.com>
2821 * readelf.c (print_relocs): Expect ELF header argument and pass on
2822 to handle_relocs_rel* functions. Adjust caller.
2823 (handle_relocs_rel): Add ELF header argument. Add special case for
2824 the IRELATIVE relocations in statically linked executables.
2825 (handle_relocs_rela): Likewise.
2827 2009-04-29 Ulrich Drepper <drepper@redhat.com>
2829 * elflint.c (check_symtab): Add tests of st_other field.
2831 2009-04-23 Ulrich Drepper <drepper@redhat.com>
2833 * Makefile [BUILD_STATIC] (libdw): Add $(zip_LIBS).
2835 2009-04-20 Roland McGrath <roland@redhat.com>
2837 * addr2line.c (print_dwarf_function): Honor -s and -A for file names
2838 of inline call sites.
2840 * addr2line.c (just_section): New variable.
2841 (adjust_to_section): New function, broken out of ...
2842 (handle_address): ... here.
2843 (options, parse_opt): Add -j/--section=NAME to set it.
2845 2009-04-15 Roland McGrath <roland@redhat.com>
2847 * readelf.c (print_debug_frame_section): Check for DW_CIE_ID_64 in
2848 64-bit format header, DW_CIE_ID_32 in 32-bit format header.
2850 2009-04-14 Roland McGrath <roland@redhat.com>
2852 * readelf.c (print_attributes): Treat SHT_ARM_ATTRIBUTES on EM_ARM
2853 like SHT_GNU_ATTRIBUTES.
2855 * readelf.c (handle_core_registers): Fix error message.
2857 * strip.c (handle_elf: check_preserved): Don't note any change when
2858 .debug_data is already filled from a previous pass.
2860 2009-02-05 Ulrich Drepper <drepper@redhat.com>
2862 * objdump.c (show_relocs_x): Minor cleanups.
2864 * readelf.c (print_cfa_program): Correct a few labels.
2865 Print first DW_CFA_expression and DW_CFA_val_expression parameter
2868 2009-02-01 Ulrich Drepper <drepper@redhat.com>
2870 * objdump.c (show_relocs_rel, show_relocs_rela): Split common parts
2872 (show_relocs_x): ...here. New function.
2873 (show_relocs): Better spacing in output.
2875 * objdump.c (show_relocs_rela): Show offsets as signed values.
2877 * ar.c (main): Fix recognition of invalid modes for a, b, i modifiers.
2878 Improve some error messages.
2879 Use program_invocation_short_name instead of AR macro.
2880 * Makefile.am (CFLAGS_ar): Remove.
2881 * elflint.c (parse_opt): ARGP_HELP_EXIT_ERR does nothing for argp_help.
2882 * objdump.c (parse_opt): Likewise.
2883 * readelf.c (parse_opt): Likewise.
2885 2009-01-27 Roland McGrath <roland@redhat.com>
2887 * readelf.c (print_ops): Notice short length, don't overrun buffer
2888 (still need to fix LEB128).
2890 * readelf.c (print_ops): Fix DW_OP_call[24] decoding.
2892 * readelf.c (print_ops): Print (empty)\n when LEN == 0.
2894 2009-01-24 Ulrich Drepper <drepper@redhat.com>
2896 * readelf.c (print_debug_frame_section): Fix computation of vma_base
2897 for PC-relative mode.
2899 2009-01-23 Ulrich Drepper <drepper@redhat.com>
2901 * size.c (process_file): When handling archive, close file descriptor
2902 here. For unknown file format also close file descriptor.
2903 (handle_ar): Don't close file descriptor here.
2905 * readelf.c (parse_opt): Move code to add to dump_data_sections and
2906 string_sections list in local function add_dump_section. Adjust 'x'
2907 key handling. For 'a' key add .strtab, .dynstr, and .comment section
2908 to string_sections list.
2910 2009-01-22 Roland McGrath <roland@redhat.com>
2912 * readelf.c (print_phdr): Don't print section mapping when no sections.
2914 * Makefile.am (AM_CFLAGS): Pass -Wno-format for *_no_Wformat.
2916 * readelf.c (print_debug_frame_section): Initialize IS_SIGNED to false
2917 and reset it only for the 'true' cases.
2919 * Makefile.am (addr2line_no_Wformat): New variable.
2921 * readelf.c (print_debug_frame_section): Use t instead of j formats
2922 for ptrdiff_t OFFSET.
2924 2009-01-21 Ulrich Drepper <drepper@redhat.com>
2926 * elflint.c (check_program_header): Fix typo in .eh_frame_hdr section
2927 test. Handle debuginfo files.
2928 (check_exception_data): First sanity test.
2930 2009-01-17 Ulrich Drepper <drepper@redhat.com>
2932 * readelf.c (print_debug_exception_table): Show target of ar_disp
2935 * elflint.c (check_program_header): Add most consistency checks for
2936 PT_GNU_EH_FRAME entry.
2938 * addr2line.c: Use ARGP_PROGRAM_VERSION_HOOK_DEF and
2939 ARGP_PROGRAM_BUG_ADDRESS_DEF.
2941 * elfcmp.c: Likewise.
2942 * elflint.c: Likewise.
2943 * findtextrel.c: Likewise.
2946 * objdump.c: Likewise.
2947 * ranlib.c: Likewise.
2948 * readelf.c: Likewise.
2951 * strings.c: Likewise.
2952 * strip.c: Likewise.
2953 * unstrip.c: Likewise.
2955 2009-01-16 Ulrich Drepper <drepper@redhat.com>
2957 * elflint.c (check_program_header): Check that PT_GNU_EH_FRAME entry
2958 matches .eh_frame_hdr section, if it is available. Also check that
2959 the segment is allocated, not writable, not executable.
2961 * readelf.c: Add -e option. Dump exception and unwind related
2962 sections. Add -e to -a.
2963 (print_encoding_base): Handle DW_EH_PE_omit.
2964 (print_debug_exception_table): Beginning of support.
2965 (print_debug): Hook up print_debug_exception_table for
2966 .gcc_except_table sections.
2968 * readelf.c (print_debug_frame_section): Some fixes for last change.
2970 2009-01-15 Ulrich Drepper <drepper@redhat.com>
2972 * readelf.c (print_encoding): Now a toplevel function.
2973 (print_relinfo): Likewise.
2974 (print_encoding_base): Broken out of print_debug_frame_section.
2975 (print_debug_frame_section): Print different header for .eh_frame
2976 sections. Fix recognition of matching CIEs in .debug_frame sections.
2977 Print absolute offset for PC-relative FDE locations. Don't print
2978 table header for FDEs if the table is empty.
2979 (read_encoded): New function.
2980 (print_debug_frame_hdr_section): New function.
2981 (print_debug): Hook up print_debug_frame_hdr_section for .eh_frame_hdr
2984 * readelf.c (handle_relocs_rel): Print section number.
2985 (print_debug_abbrev_section): Likewise.
2986 (print_debug_aranges_section): Likewise.
2987 (print_debug_ranges_section): Likewise.
2988 (print_debug_info_section): Likewise.
2989 (print_debug_line_section): Likewise.
2990 (print_debug_loc_section): Likewise.
2991 (print_debug_macinfo_section): Likewise.
2992 (print_debug_pubnames_section): Likewise.
2993 (print_debug_str_section): Likewise.
2995 2009-01-10 Ulrich Drepper <drepper@redhat.com>
2997 * strings.c (read_block): Fix typo in error message string.
2999 2009-01-07 Ulrich Drepper <drepper@redhat.com>
3001 * ld.c (ld_new_searchdir): Fix adding to search path list.
3003 2009-01-06 Ulrich Drepper <drepper@redhat.com>
3005 * readelf.c: Implement call frame debug section dumping.
3007 2009-01-05 Roland McGrath <roland@redhat.com>
3009 * elfcmp.c: Exit with status 2 for errors (like cmp, diff, grep).
3010 Status 1 (aka EXIT_FAILURE) is only for completed OK but not equal.
3012 2009-01-01 Ulrich Drepper <drepper@redhat.com>
3014 * addr2line.c: Update copyright year.
3016 * elfcmp.c: Likewise.
3017 * elflint.c: Likewise.
3018 * findtextrel.c: Likewise.
3021 * objdump.c: Likewise.
3022 * ranlib.c: Likewise.
3023 * readelf.c: Likewise.
3025 * strings.c: Likewise.
3026 * strip.c: Likewise.
3027 * unstrip.c: Likewise.
3029 2008-12-11 Roland McGrath <roland@redhat.com>
3031 * nm.c (sym_name): New function.
3032 (show_symbols_sysv): Use it in place of elf_strptr.
3033 (show_symbols_bsd, show_symbols_posix): Likewise.
3036 * nm.c (show_symbols_sysv): Use an alloca'd backup section name when
3039 2008-12-02 Roland McGrath <roland@redhat.com>
3041 * readelf.c (count_dwflmod, process_file): Don't presume encoding of
3042 nonzero OFFSET argument to dwfl_getmodules.
3044 2008-08-07 Roland McGrath <roland@redhat.com>
3046 * addr2line.c (main): Pass string to handle_address.
3047 (see_one_module): New function, subroutine of handle_address.
3048 (find_symbol): Likewise.
3049 (handle_address): Take string argument rather than address.
3050 Convert plain number, or handle strings like "(section)+offset"
3053 2008-08-01 Roland McGrath <roland@redhat.com>
3055 * readelf.c (handle_core_item): Handle 'B' type for 1-origin bitset.
3056 For 'b' and 'B', print <x-y,z> or ~<x,y-z> rather than 1/0 string.
3058 * readelf.c (convert): Take new argument SIZE.
3059 (handle_core_register, handle_core_item): Update callers.
3060 (handle_core_item): Take new arg REPEATED_SIZE.
3061 (handle_core_items): Special case for a singleton item,
3062 let handle_core_item handle repeats if it wants to.
3064 * readelf.c (handle_core_items): Give abridged output
3065 for identical groups repeated more than twice.
3067 2008-07-04 Roland McGrath <roland@redhat.com>
3069 * readelf.c (handle_core_items): Handle ELF_T_ADDR.
3071 2008-04-10 Roland McGrath <roland@redhat.com>
3073 * strip.c (handle_elf): Don't keep sections that kept symbol tables
3074 refer to. Instead, just be sure to preserve the original symbol
3075 table in the debug file so those symbols go with their sections and
3076 can be elided from the stripped version of the symbol table.
3078 * strip.c (handle_elf): When a discarded section kept in the debug
3079 file refers to a nondiscard section via sh_link/sh_info, preserve
3080 that nondiscarded section unmodified in the debug file as well.
3081 Skip adjustment of discarded sections symbol table references when
3082 that symbol table is copied in this way.
3084 * elflint.c (check_symtab): Don't crash from missing symbol names
3085 after diagnosing bogus strtab.
3087 * strip.c (handle_elf): Cosmetic cleanup in special section contents
3088 adjustment for symtab changes.
3090 2008-03-31 Roland McGrath <roland@redhat.com>
3092 * elflint.c (check_sections): Add checks on SHF_EXECINSTR sections:
3093 must be SHT_PROGBITS, must not be SHF_WRITE. Let backend hook
3094 excuse a special section.
3096 2008-03-27 Roland McGrath <roland@redhat.com>
3098 * elflint.c (check_sections): Check that executability and writability
3099 of sections is reflected in segment p_flags.
3101 2008-03-26 Roland McGrath <roland@redhat.com>
3103 * elflint.c (check_program_header): Accept PT_GNU_RELRO p_flags
3104 that matches its PT_LOAD's p_flags &~ PF_W. On sparc, PF_X really
3107 2008-02-29 Roland McGrath <roland@redhat.com>
3109 * readelf.c (print_attributes): Add a cast.
3110 * elflint.c (check_attributes): Likewise.
3112 * unaligned.h (add_8ubyte_unaligned): Cast PTR argument for parity
3113 with [UNALIGNED_ACCESS_CLASS == BYTE_ORDER] definition.
3114 (add_4ubyte_unaligned, add_2ubyte_unaligned): Likewise.
3116 2008-02-03 Ulrich Drepper <drepper@redhat.com>
3118 * i386_ld.c (elf_i386_count_relocations): Implement R_386_TLS_GD
3119 when linked into executable.
3120 (elf_i386_create_relocations): Likewise.
3122 2008-02-20 Roland McGrath <roland@redhat.com>
3124 * readelf.c (print_attributes): New function.
3125 (process_elf_file): Call it under -A.
3127 * elflint.c (check_attributes): Implement it for real.
3129 2008-02-19 Roland McGrath <roland@redhat.com>
3131 * elflint.c (special_sections): Handle .gnu.attributes section.
3132 (check_sections): Likewise.
3133 (check_attributes): New function.
3135 2008-02-10 Roland McGrath <roland@redhat.com>
3137 * elfcmp.c (main): Ignore sh_offset differences in non-SHF_ALLOC
3138 sections and ET_REL files.
3140 2008-02-02 Ulrich Drepper <drepper@redhat.com>
3142 * elf32-i386.script: Add .eh_frame_hdr, .tdata, and .tbss sections.
3143 * i386_ld.c (elf_i386_count_relocations): Handle R_386_TLS_LDO_32
3145 (elf_i386_create_relocations): Likewise.
3146 * ld.h (struct ld_state): Add need_tls, tls_start, and tls_tcb
3148 * ldgeneric.c (add_section): If TLS section is used, set need_tls flag.
3149 (ld_generic_create_outfile): Add PT_TLS entry to program header.
3150 Fix generation of PT_GNU_STACK entry.
3152 2008-02-01 Ulrich Drepper <drepper@redhat.com>
3154 * ld.c (replace_args): Prevent loop over replacements if the parameter
3155 is only two characters long.
3157 * ld.c: Recognize sha1 argument for --build-id parameter.
3158 * ldgeneric.c (create_build_id_section): Handle sha1.
3159 (compute_hash_sum): New function. Broken out of compute_build_id.
3160 Take hash function and context as parameters.
3161 (compute_build_id): Use compute_hash_sum for md5 and the new sha1
3164 2008-01-31 Ulrich Drepper <drepper@redhat.com>
3166 * elf32-i386.script: Add .note.ABI-tag and .note.gnu.build-id sections.
3167 * ld.c: Recognize --build-id command line parameter.
3168 * ld.h: Define scn_dot_note_gnu_build_id.
3169 (struct ld_state): Add build_id and buildidscnidx elements.
3170 * ldgeneric.c: Implement --build-id command line parameter.
3171 * ldlex.l (ID): Recognize - as valid character after the first one.
3173 2008-01-29 Ulrich Drepper <drepper@redhat.com>
3175 * ld.c (replace_args): New function.
3176 (main): Use it to rewrite old-style parameters.
3178 * elf32-i386.script: Add .gnu.hash section.
3179 * ldgeneric.c (optimal_bucket_size): A tiny bit more efficient.
3180 (fillin_special_symbol): Initialize st_size.
3181 (sortfct_hashval): New function.
3182 (create_gnu_hash): New function.
3183 (create_hash): New function.
3184 (ld_generic_create_outfile): Use the new functions to create the
3187 * elflint.c (check_gnu_hash): Fix index value printed in error message.
3189 2008-01-24 Ulrich Drepper <drepper@redhat.com>
3191 * elflint.c (check_group): Check that signature symbol for section
3192 group is not an empty string.
3193 * ldgeneric.c: Remove magic assignment of indeces in the dynsym
3194 section. Start implementation of --hash-style.
3195 * i386_ld.c: Likewise.
3196 * ld.c: Recognize --hash-style.
3197 * ld.h (struct scninfo): Add comdat_group.
3198 Add additional parameter to finalize_plt callback.
3200 2008-01-22 Ulrich Drepper <drepper@redhat.com>
3202 * ld.h (struct callbacks): Add initialize_gotplt.
3203 (struct scnhead): Add scn_dot_gotplt.
3204 (struct ld_state): Add gotpltscnidx.
3205 * i386_ld.c (elf_i386_initialize_plt): Minor optimization.
3206 (elf_i386_initialize_pltrel): Likewise.
3207 (elf_i386_initialize_got): There is now a separate .got.plt, so
3208 don't do the PLT-related work here. Initialize d_type.
3209 (elf_i386_initialize_gotplt): New function.
3210 (elf_i386_plt0): Use ud2a after indirect jump.
3211 (elf_i386_pic_plt0_entry): Likewise.
3212 (elf_i386_finalize_plt): Reference now .got.plt.
3213 (elf_i386_count_relocations): For GOT entries which need no relocation
3214 don't bump nrel_got.
3215 (elf_i386_create_relocations): Also get .got.plt. Rewrite R-386_GOT32
3216 handling for split .got/.got.plt.
3217 (elf_i386_ld_init): Initialize callbacks.initialize_gotplt.
3218 * elf32-i386.script: Sort sections for security. There are no .got
3219 input sections. Add .got.plt.
3220 * ldgeneric.c (ld_generic_generate_sections): Add .got.plt section.
3221 (ld_generic_create_outfile): Initialize .got.plt section.
3222 Use .got.plt address for _GLOBAL_OFFSET_TABLE_ symbol and DT_PLTGOT.
3224 2008-01-19 Ulrich Drepper <drepper@redhat.com>
3226 * i386_ld.c (elf_i386_count_relocations): PLT relocations for undefined
3227 symbols are not carried over into statically linked output files.
3228 Add dummy entries for more TLS relocations.
3230 * ld.c (options): Add long names for -( and -).
3232 * ldgeneric.c (check_definition): For newly found definitions don't
3233 mark section as used if symbol is absolute.
3234 (extract_from_archive): Only assign archive sequence number the first
3235 time the archive is handled. Update ld_state.last_archive_used
3236 if any symbol was used. Remove nround variable.
3237 (file_process2): When using symbol from an archive, update
3238 ld_state.group_start_archive, ld_state.archives, and
3239 ld_state.tailarchives.
3240 (ld_generic_file_process): If group is not handled anymore, after
3241 freeing ELF handles for the archives, clear ld_state.archives and
3242 *nextp. Fix wrong logic in recognizing first iteration of group
3243 loop. When clearing flags, also clear ld_state.group_start_archive.
3245 2008-01-11 Ulrich Drepper <drepper@redhat.com>
3247 * objdump.c (show_disasm): Adjust disassembler format string for
3250 2008-01-04 Roland McGrath <roland@redhat.com>
3252 * readelf.c (handle_core_items): Take new arg DESCSZ; if nonzero,
3253 a size greater than the items cover means multiple sets of items.
3254 (handle_core_note): Update caller.
3256 2008-01-04 Roland McGrath <roland@redhat.com>
3258 * strip.c (handle_elf): Move SHDRIDX defn to silence gcc warning.
3260 2008-01-03 Roland McGrath <roland@redhat.com>
3262 * ld.h (linked_from_dso_p): Use __attribute__ ((__gnu_inline__)).
3264 * elflint.c (check_dynamic): Remove duplicate initializer.
3266 2008-01-02 Ulrich Drepper <drepper@redhat.com>
3268 * addr2line.c: Update copyright year.
3270 * elfcmp.c: Likewise.
3271 * elflint.c: Likewise.
3272 * findtextrel.c: Likewise.
3275 * objdump.c: Likewise.
3276 * ranlib.c: Likewise.
3277 * readelf.c: Likewise.
3279 * strings.c: Likewise.
3280 * strip.c: Likewise.
3281 * unstrip.c: Likewise.
3283 2007-12-30 Ulrich Drepper <drepper@redhat.com>
3285 * objdump (show_disasm): Use %e after third parameter.
3287 2007-12-21 Ulrich Drepper <drepper@redhat.com>
3289 * strip.c: Fix wrong parenthesis in a few branch predictions.
3290 * strings.c: Likewise.
3292 2007-12-20 Ulrich Drepper <drepper@redhat.com>
3294 * Makefile.am (DEFS): Add DEBUGPRED.
3295 * addr2line.c: Include debugpred.h.
3297 * elfcmp.c: Likewise.
3298 * elflint.c: Likewise.
3299 * findtextrel.c: Likewise.
3301 * objdump.c: Likewise.
3302 * ranlib.c: Likewise.
3303 * readelf.c: Likewise.
3305 * strings.c: Likewise.
3306 * strip.c: Likewise.
3307 * unstrip.c: Likewise.
3308 * debugpred.h: New file.
3310 * readelf.c (handle_relocs_rel): Use elf_scnshndx.
3311 (handle_relocs_rela): Likewise.
3313 * readelf.c: Add lots of likely/unlikely.
3315 * elflint.c: Minor cleanups.
3317 2007-11-19 Roland McGrath <roland@redhat.com>
3319 * readelf.c (print_ops): Handle all bad op codes gracefully.
3320 Print their numbers instead of just ???.
3322 2007-11-09 Roland McGrath <roland@redhat.com>
3324 * readelf.c (attr_callback): Handle DW_AT_data_location.
3325 Handle block forms to mean a DWARF expression for DW_AT_allocated,
3326 DW_AT_associated, DW_AT_bit_size, DW_AT_bit_offset, DW_AT_bit_stride,
3327 DW_AT_byte_size, DW_AT_byte_stride, DW_AT_count, DW_AT_lower_bound,
3330 2007-10-20 Roland McGrath <roland@redhat.com>
3332 * unstrip.c (options): Update -R description.
3333 (struct symbol): Put symbol details a union with a size_t pointer
3335 (compare_symbols_output): Use null ->name as marker for discard
3336 symbols, not zero *->map.
3337 (copy_elided_sections): Record forwarding pointers for discarded
3338 duplicates and fill SYMNDX_MAP elements through them.
3340 * readelf.c (process_file): Set offline_next_address to 0 at start.
3341 (struct process_dwflmod_args): New type.
3342 (process_dwflmod): Take args in it, pass fd to process_elf_file.
3343 (process_file): Update caller; dup FD for passing to libdwfl.
3344 (process_elf_file): Take new arg FD. For ET_REL file when
3345 displaying data affected by libdwfl relocation, open a new Elf handle.
3347 2007-10-17 Roland McGrath <roland@redhat.com>
3349 * readelf.c (print_debug_line_section): For invalid data inside a
3350 unit with plausible length, keep printing at the next unit boundary.
3352 * readelf.c (attr_callback): Use dwarf_formref_die, not dwarf_formref.
3354 2007-10-16 Roland McGrath <roland@redhat.com>
3356 * readelf.c (hex_dump): Fix rounding error in whitespace calculation.
3358 2007-10-15 Roland McGrath <roland@redhat.com>
3360 * make-debug-archive.in: New file.
3361 * Makefile.am (EXTRA_DIST): Add it.
3362 (make-debug-archive): New target.
3363 (bin_SCRIPTS, CLEANFILES): Add it.
3365 2007-10-10 Roland McGrath <roland@redhat.com>
3367 * elflint.c (special_sections): Add new attrflag value exact_or_gnuld.
3368 Use it to check MERGE|STRINGS for .debug_str.
3369 (check_sections): Handle exact_or_gnuld.
3371 2007-10-08 Roland McGrath <roland@redhat.com>
3373 * readelf.c (handle_core_item): Handle 'T'|0x80 to indicate
3374 64-bit struct timeval with 32-bit tv_usec.
3376 2007-10-07 Roland McGrath <roland@redhat.com>
3378 * readelf.c (check_archive_index): New function.
3379 (process_file): Call it. Change signature to take only fd and name.
3380 Use libdwfl to open the file, then iterate on its modules (multiple
3381 for an archive) to print file name and call process_elf_file.
3382 (main): Update caller. Let process_file do elf_begin.
3383 (count_dwflmod, process_dwflmod, find_no_debuginfo): New functions.
3384 (process_elf_file): Take only Dwfl_Module * argument.
3385 Don't print the file name here.
3386 (print_debug_*_section): Take Dwfl_Module * argument.
3387 (print_debug): Likewise. Update caller.
3388 (format_dwarf_addr): New function.
3389 (print_debug_ranges_section): Use it.
3390 (attr_callback): Likewise.
3391 (print_debug_line_section, print_debug_loc_section): Likewise.
3393 * readelf.c (print_debug_ranges_section): Translate all strings.
3394 (print_debug_loc_section): Likewise.
3396 * unstrip.c (copy_elided_sections): Initialize SEC.
3398 * ar.c (do_oper_insert): Put trailing / on short names.
3400 * arlib.h (MAX_AR_NAME_LEN): Decrease by one.
3402 * arlib2.c (arlib_add_long_name): Adjust for header size.
3404 * arlib.c (arlib_finalize): Pad long name table to keep size even.
3406 * ar.c (do_oper_insert): Use write_retry for padding write.
3408 * ar.c (do_oper_insert): Initialize CUR_OFF in no_old case.
3409 Unconditionally set FOUND[CNT]->elf when setting ->mem.
3410 (remember_long_name): New function.
3411 (do_oper_insert): Call it. Correctly use length of basename,
3412 not original name. Don't store long name twice for new member.
3414 2007-10-06 Roland McGrath <roland@redhat.com>
3416 * elflint.c (check_note): Skip empty segment.
3417 (check_note_section): Skip empty section.
3419 * unstrip.c (options, parse_opt, struct arg_info): Grok -R/--relocate.
3420 (handle_output_dir_module, handle_implicit_modules): Pass it down.
3421 (handle_dwfl_module): When set, use ET_REL already loaded by Dwfl.
3422 (compare_alloc_sections): Take new arg REL, ignore address if true.
3423 (compare_sections): Likewise, pass it down.
3424 (compare_sections_rel, compare_sections_nonrel): New functions.
3425 (find_alloc_sections_prelink, copy_elided_sections): Use them
3426 instead of compare_sections.
3427 (sections_match): New function, broken out of ...
3428 (find_alloc_section): ... here.
3429 (copy_elided_sections): Reorganize section match-up logic.
3430 Use sections_match for SHF_ALLOC in ET_REL.
3431 For ET_REL, let the nonzero sh_addr from the debug file dominate.
3433 * unstrip.c (add_new_section_symbols): Take new arg REL.
3434 When true, do not update section symbol values.
3435 (collect_symbols): Likewise. Update section symbols with address
3436 of chosen output section, not original section.
3437 (check_symtab_section_symbols, copy_elided_sections): Update callers.
3439 * unstrip.c (compare_alloc_sections): At the same address, preserve
3440 original section order.
3442 * elflint.c (special_sections): Don't require MERGE|STRINGS for
3443 .debug_str, it didn't always have them with older tools.
3445 * elflint.c (check_symtab, check_one_reloc): Ignore sh_addr in ET_REL.
3447 2007-10-05 Roland McGrath <roland@redhat.com>
3449 * elflint.c (check_symtab): Allow SHN_UNDEF _GLOBAL_OFFSET_TABLE_ in
3452 * elflint.c (check_symtab): For _GLOBAL_OFFSET_TABLE_, diagnose
3453 SHN_UNDEF as "bad section". Use shndx value in messages.
3455 * elflint.c (special_sections): Add ".debug_str". Decrement namelen
3456 for ".debug" so it matches as a prefix.
3457 (IS_KNOWN_SPECIAL): New macro.
3458 (check_sections): Use it for ".plt" match. Cite wrong SHT_NOBITS
3459 type even under -d, for a .debug* or .shstrtab section.
3461 * readelf.c (print_ops): Use hex for address operand.
3463 2007-10-04 Roland McGrath <roland@redhat.com>
3465 * unstrip.c (copy_elided_sections): Initialize NDX_SECTION element for
3466 .gnu_debuglink section to SHN_UNDEF. Drop STT_SECTION symbols for
3467 sections mapped to SHN_UNDEF.
3469 2007-10-04 Ulrich Drepper <drepper@redhat.com>
3471 * readelf.c (dump_archive_index): Avoid warning about uninitialized
3472 variable with older glibc versions.
3473 Add some branch prediction.
3475 2007-10-04 Roland McGrath <roland@redhat.com>
3477 * readelf.c (print_archive_index): New variable.
3478 (options, parse_opt): Accept -c/--archive-index to set it.
3479 (dump_archive_index): New function.
3480 (process_file): Take new arg WILL_PRINT_ARCHIVE_INDEX.
3481 Call dump_archive_index on archives if set.
3482 (main): Update caller.
3483 (any_control_option): Give it file scope, moved out of ...
3484 (parse_opt): ... here.
3486 2007-10-03 Roland McGrath <roland@redhat.com>
3488 * unstrip.c (struct arg_info): Add `list' flag.
3489 (options, parse_opt): Grok -n/--list to set it.
3490 (list_module): New function.
3491 (handle_implicit_modules): Call it under -n.
3493 * elflint.c (check_note_section): New function.
3494 (check_sections): Call it for SHT_NOTE.
3496 * readelf.c (handle_notes): Use sections when available.
3498 * elflint.c (check_note_data): New function, broken out of ...
3499 (check_note): ... here. Call it and elf_getdata_rawchunk.
3501 * readelf.c (handle_auxv_note): Take offset as argument, not buffer.
3502 Use elf_getdata_rawchunk and gelf_getauxv.
3503 (handle_notes_data): New function, broken out of ...
3504 (handle_notes): ... here. Call it and elf_getdata_rawchunk.
3506 2007-10-01 Roland McGrath <roland@redhat.com>
3508 * readelf.c (hex_dump): Fix transposed subtraction generating spaces.
3510 * readelf.c (hex_dump): Fix line header to be hex instead of decimal.
3512 2007-09-10 Roland McGrath <roland@redhat.com>
3514 * readelf.c (options): Give -p optional argument, alias --string-dump.
3515 (string_sections, string_sections_tail): New static variables.
3516 (parse_opt): Set them when -p has an argument.
3517 (print_string_section): New function, broken out of ...
3518 (print_strings): ... here. Call it.
3519 (dump_data_section): New function, broken out of ...
3520 (dump_data): ... here. Call it.
3521 (for_each_section_argument): New function, broken out of ...
3522 (dump_data): ... here. Call it.
3523 (dump_strings): New function.
3525 2007-08-31 Roland McGrath <roland@redhat.com>
3527 * readelf.c (print_strings): Typo fix.
3529 2007-08-23 Roland McGrath <roland@redhat.com>
3531 * readelf.c (printf_with_wrap): Function removed.
3532 (REGISTER_WRAP_COLUMN): New macro.
3533 (handle_core_register): Use print_core_item instead.
3534 (struct register_info): New type.
3535 (compare_registers, compare_register_sets): New functions.
3536 (register_bitpos, compare_sets_by_info): New functions.
3537 (handle_core_registers): Use those to segregate and sort registers
3540 * readelf.c (ITEM_WRAP_COLUMN): New macro.
3541 (print_core_item): New function.
3542 (handle_core_item): Use it instead of printf_with_wrap.
3543 (compare_core_items, compare_core_item_groups): New functions.
3544 (handle_core_items): Use them. Sort by group and force line breaks
3547 * readelf.c (handle_core_registers, handle_core_items): New functions,
3549 (handle_core_note): ... here. Call them.
3551 2007-08-22 Roland McGrath <roland@redhat.com>
3553 * unstrip.c (new_shstrtab): New function, broken out of ...
3554 (copy_elided_sections): ... here.
3556 2007-08-20 Roland McGrath <roland@redhat.com>
3558 Avoid local function trampolines in nm binary.
3559 * nm.c (sort_by_address): Move to a static function instead of local
3560 inside show_symbols.
3561 (sort_by_name_strtab): New static variable.
3562 (sort_by_name): Use it. Move to a static function instead of local
3563 inside show_symbols.
3564 (show_symbols): Set sort_by_name_strtab.
3566 2007-08-19 Roland McGrath <roland@redhat.com>
3568 * readelf.c (handle_auxv_note): New function.
3569 (handle_notes): Call it.
3571 * readelf.c (printf_with_wrap, convert): New functions.
3572 (handle_core_item, (handle_core_register): New functions.
3573 (handle_notes): Call those with details from ebl_core_note.
3575 2007-08-12 Roland McGrath <roland@redhat.com>
3577 * elflint.c (check_note): Accept type 0 with name "Linux".
3579 * elflint.c (special_sections): Accept SHF_ALLOC for ".note".
3581 * elflint.c (section_flags_string): Return "none" for 0, not "".
3583 2007-08-11 Roland McGrath <roland@redhat.com>
3585 * elflint.c (check_note): Accept NT_GNU_HWCAP, NT_GNU_BUILD_ID.
3587 2007-08-04 Ulrich Drepper <drepper@redhat.com>
3589 * readelf.c (hex_dump): Use isprint to determine whether to print
3590 character itself or full stop character.
3591 (dump_data): No need to check endp for NULL after strtol call.
3593 2007-08-03 Roland McGrath <roland@redhat.com>
3595 * readelf.c (print_string_sections): New variable.
3596 (options, parse_opt): Handle --strings/-p to set it.
3597 (print_strings): New function.
3598 (process_elf_file): Call it under -p.
3600 * readelf.c (options): Add hidden aliases --segments, --sections,
3601 as taken by binutils readelf.
3603 2007-08-01 Roland McGrath <roland@redhat.com>
3605 * readelf.c (dump_data_sections, dump_data_sections_tail):
3607 (options, parse_opt): Handle --hex-dump/-x, set them.
3608 (hex_dump): New function.
3609 (dump_data): New function, call it.
3610 (process_elf_file): Call it.
3612 2007-07-25 Roland McGrath <roland@redhat.com>
3614 * addr2line.c (show_symbols): New variable.
3615 (print_addrsym): New function.
3616 (handle_address): Call it.
3617 (options, parse_opt): Handle -S/--symbols.
3619 2007-06-05 Ulrich Drepper <drepper@redhat.com>
3621 * addr2line.c: Update for latest autoconf header.
3623 * elfcmp.c: Likewise.
3624 * elflint.c: Likewise.
3625 * findtextrel.c: Likewise.
3627 * ldgeneric.c: Likewise.
3629 * objdump.c: Likewise.
3630 * ranlib.c: Likewise.
3631 * readelf.c: Likewise.
3633 * strings.c: Likewise.
3634 * strip.c: Likewise.
3635 * unstrip.c: Likewise.
3637 2007-05-18 Roland McGrath <roland@redhat.com>
3639 * unstrip.c (copy_elided_sections): Match up non-NOBITS sections with
3640 stripped file, so as not to duplicate a section copied in both.
3642 * strip.c (handle_elf): Keep SHT_NOTE section copies in the debug file.
3644 2007-05-17 Roland McGrath <roland@redhat.com>
3646 * unstrip.c (copy_elided_sections): Don't call gelf_newphdr for 0.
3648 * unstrip.c (handle_file): Tweak BIAS != 0 warning.
3650 * unstrip.c (handle_file): Take new arg CREATE_DIRS. If set,
3651 call make_directories here.
3652 (handle_explicit_files): Take new arg CREATE_DIRS, pass it down.
3653 (handle_dwfl_module): Likewise.
3654 (handle_implicit_modules): Update callers.
3655 (handle_output_dir_module): Likewise. Don't do make_directories here.
3657 * unstrip.c (get_section_name): New function, broken out of ...
3658 (copy_elided_sections): here. Update callers.
3659 (find_alloc_section): Broken out of ...
3660 (copy_elided_sections): ... here. Update caller.
3661 (symtab_count_leading_section_symbols): Take new arg NEWSYMDATA,
3662 update STT_SECTION symbols' st_value fields as a side effect.
3663 (check_symtab_section_symbols): Update caller.
3664 (add_new_section_symbols): Set st_value in symbols added.
3665 (collect_symbols): Reset S->value for STT_SECTION symbols recorded.
3666 Take new arg SPLIT_BSS. Adjust S->shndx recorded for symbols moved
3667 from .bss to .dynbss.
3668 (find_alloc_sections_prelink): New function. Associate debug file
3669 allocated SHT_NOBITS shdrs with stripped moved by prelink via
3670 .gnu.prelink_undo information.
3671 (copy_elided_sections): Call it when we couldn't find every allocated
3672 section. Don't use a debug file non-NOBITS section if SHF_ALLOC.
3673 Take STRIPPED_EHDR arg instead of E_TYPE and PHNUM.
3674 (handle_file): Update callers.
3676 * unstrip.c (copy_elided_sections): Ignore unfound unallocated section
3679 * elflint.c (check_sections): Fix association of segments with
3680 sections when p_memsz > p_filesz.
3682 2007-04-29 Roland McGrath <roland@redhat.com>
3684 * addr2line.c (options, main): Tweak argp group settings to fix
3687 2007-04-28 Roland McGrath <roland@redhat.com>
3689 * strip.c (handle_elf): Update debug file's SHT_NOBITS sections'
3690 sizes to match sections adjusted in the stripped file.
3692 2007-04-24 Roland McGrath <roland@redhat.com>
3694 * elfcmp.c (OPT_HASH_INEXACT): New macro.
3695 (hash_inexact): New variable.
3696 (options, parse_opt): Add --hash-inexact option to set it.
3697 (hash_content_equivalent): New function.
3698 (main): Call it for differing SHT_HASH sections under --hash-inexact.
3700 2007-04-23 Roland McGrath <roland@redhat.com>
3702 * unstrip.c: New file.
3703 * Makefile.am (bin_PROGRAMS): Add it.
3704 (unstrip_LDADD): New variable.
3706 * strip.c (options): Allow --output for -o.
3708 2007-02-15 Ulrich Drepper <drepper@redhat.com>
3710 * readelf.c: Remove unused code. Add a few consts.
3712 2007-02-15 Roland McGrath <roland@redhat.com>
3714 * readelf.c (print_debug): Fix brainos in SHDR test.
3716 2007-02-05 Roland McGrath <roland@redhat.com>
3718 * ar.c: Include <limits.h>, since we use LONG_MAX.
3720 2007-02-05 Ulrich Drepper <drepper@redhat.com>
3722 * ar.c: Add ugly hack to work around gcc complaining that we
3723 ignore fchown's return value.
3724 (do_oper_insert): Handle error when writing padding.
3725 * ranlib.c: Add fchown complain work around.
3727 * arlib.c: Make symtab a global variable. Change all users.
3728 * arlib2.c: Likewise.
3729 * ranlib.c: Likewise.
3731 * arlib.h: Declare it.
3733 2007-01-11 Roland McGrath <roland@redhat.com>
3735 * elflint.c (check_sections): Use ebl_machine_section_flag_check on
3736 SHF_MASKPROC bits separately from generic sh_flags validation.
3738 2007-02-04 Ulrich Drepper <drepper@redhat.com>
3741 * arlib.c: New file.
3742 * arlib2.c: New file.
3743 * arlib.h: New file.
3744 * Makefile (noinst_LIBRARIES): Add libar.
3745 (libar_a_SOURCES): Define.
3747 (CFLAGS_ar): Define.
3748 * ranlib.c: Change to use arlib.
3750 * elflint.c (check_symtab): Work around GNU ld bug which omits
3751 sections but not symbols in those sections.
3753 2007-01-10 Ulrich Drepper <drepper@redhat.com>
3755 * addr2line.c: Update copyright year.
3756 * elfcmp.c: Likewise.
3757 * elflint.c: Likewise.
3758 * findtextrel.c: Likewise.
3761 * objdump.c: Likewise.
3762 * ranlib.c: Likewise.
3763 * readelf.c: Likewise.
3765 * strings.c: Likewise.
3766 * strip.c: Likewise.
3768 2006-12-09 Ulrich Drepper <drepper@redhat.com>
3770 * elflint.c (compare_hash_gnu_hash): New function. Report if the
3771 two hash tables have different content (module expected omission
3772 of undefined symbols).
3774 2006-10-31 Roland McGrath <roland@redhat.com>
3776 * elflint.c (check_program_header): Don't complain about
3777 p_filesz > p_memsz if p_memsz is zero and p_type is PT_NOTE.
3779 2006-09-19 Jakub Jelinek <jakub@redhat.com>
3781 * strip.c (process_file): Disallow -f on archives.
3783 2006-10-09 Roland McGrath <roland@redhat.com>
3785 * Makefile.am (libld_elf_i386.so): Use $(LINK), not $(CC).
3787 2006-08-29 Roland McGrath <roland@redhat.com>
3789 * Makefile.am (MAINTAINERCLEANFILES): New variable.
3791 * readelf.c (handle_relocs_rel): Typo fix, test DESTSHDR properly.
3792 Reported by Christian Aichinger <Greek0@gmx.net>.
3794 * elflint.c (valid_e_machine): Add EM_ALPHA.
3795 Reported by Christian Aichinger <Greek0@gmx.net>.
3797 2006-08-08 Ulrich Drepper <drepper@redhat.com>
3799 * elflint.c (check_dynamic): Don't require DT_HASH for DT_SYMTAB.
3800 Keep track of which "high DT" entries are present.
3801 Check that either old or GNU-style hash table is present.
3802 If GNU-style hash table is used a symbol table is mandatory.
3803 Check that if any prelink entry is present all of them are.
3804 (check_gnu_hash): Only fail for undefined symbols in GNU-style hash
3805 table if they don't refer to functions.
3807 2006-07-17 Roland McGrath <roland@redhat.com>
3809 * elflint.c (struct version_namelist): Use GElf_Versym for `ndx' field.
3810 (add_version): Likewise for argument.
3811 (check_versym): Cast constant to GElf_Versym for comparison.
3813 2006-07-12 Roland McGrath <roland@redhat.com>
3815 * readelf.c (handle_gnu_hash): Add casts for machines where
3816 Elf32_Word != unsigned int.
3818 2006-07-12 Ulrich Drepper <drepper@redhat.com>
3820 * elflint.c (check_sysv_hash64): Fix printf format.
3822 2006-07-11 Roland McGrath <roland@redhat.com>
3824 * addr2line.c (options): English fix in -f doc string.
3826 * addr2line.c (use_comp_dir): New variable.
3827 (options, parse_opt): Grok -A/--absolute to set it.
3828 (handle_address): If set, prepend dwfl_line_comp_dir results to
3829 relative file names.
3831 2006-07-06 Ulrich Drepper <drepper@redhat.com>
3833 * elflint.c: Adjust for latest new hash table format.
3834 * readelf.c: Likewise.
3836 * elflint.c (check_versym): Ignore hidden bit when comparing version
3839 2006-07-05 Ulrich Drepper <drepper@redhat.com>
3841 * ldgeneric.c (ld_generic_create_outfile): Correctly recognize
3842 discarded COMDAT symbols.
3844 * i386_ld.c (elf_i386_count_relocations): Lot of corrections.
3845 (elf_i386_create_relocations): Likewise.
3846 * ld.h (struct symbol): Add local and hidden bits.
3847 * ld.c (create_special_section_symbol): These synthsized symbols
3848 are local and hidden.
3849 * ldgeneric.c (file_process2): Check whether input file matches
3851 (fillin_special_symbol): Create symbols as local and/or hidden
3853 (ld_generic_create_outfile): Make local copy of symbol.
3854 Don't hide global, defined symbols in dynamic symbol table unless
3855 requested. Synthetic symbols have no version information.
3857 * elflint.c: Add support for checking 64-bit SysV-style hash tables.
3858 * readelf.c: Add support for printing 64-bit SysV-style hash tables.
3860 2006-07-04 Ulrich Drepper <drepper@redhat.com>
3862 * elflint.c (is_rel_dyn): Fix and extend DT_RELCOUNT/DT_RELACOUNT
3865 2006-07-03 Ulrich Drepper <drepper@redhat.com>
3867 * elflint.c: Add testing of DT_GNU_HASH.
3868 * readelf.c: Implement showing histogram for DT_GNU_HASH section.
3870 * Makefile.am: Add hacks to create dependency files for non-generic
3873 2006-06-12 Ulrich Drepper <drepper@redhat.com>
3875 * ldgeneric.c (ld_generic_generate_sections): Don't create .interp
3876 section if creating a DSO and no interpreter is given.
3877 (ld_generic_create_outfile): Don't store reference to symbols in
3878 discarded COMDAT groups. Don't create PHDR and INTERP program header
3879 for DSO if no interpreter is specified.
3880 (create_verneed_data): Pretty printing.
3882 * ldscript.y (content): If a DSO is created don't set default
3883 interpreter from linker script.
3885 * i386_ld.c (elf_i386_count_relocations): Do not add relocations
3886 for symbols in discarded COMDAT groups.
3887 (elf_i386_create_relocations): Likewise.
3888 * ld.h (struct scninfo): Add unused_comdat.
3889 * ldgeneric.c (add_section): Also check group signature when
3890 matching COMDAT sections.
3891 (add_relocatable_file): Ignore symbols in COMDAT group which are
3894 * elflint.c (check_one_reloc): For *_NONE relocs only check type
3895 and symbol reference.
3897 2006-06-11 Ulrich Drepper <drepper@redhat.com>
3899 * elflint.c (check_dynamic): Fix checking value of tags which are
3900 offsets in the string section. Make sure DT_STRTAB points to the
3901 section referenced in sh_link.
3903 * ld.c (options): Add headers. Add short option 'R' for '--rpath'.
3905 * ld.c: Recognize --eh-frame-hdr option.
3906 * ld.h (struct ld_state): Add eh_frame_hdr field.
3907 * ldgeneric.c (struct unw_eh_frame_hdr): Define.
3909 * ldgeneric.c (add_section): Use ebl_sh_flags_combine instead of
3911 (add_relocatable_file): Minor optimization of last change.
3912 (match_section): Don't preserve SHF_GROUP flag any longer.
3914 2006-06-10 Ulrich Drepper <drepper@redhat.com>
3916 * ld.c (parse_z_option): Recognize execstack and noexecstack.
3917 Handle record and ignore as position dependent options.
3918 (parse_z_option_2): Handle ignore and record here.
3919 * ld.h (struct ld_state): Add execstack field.
3920 * ldgeneric.c (add_relocatable_file): Recognize .note.GNU-stack
3922 (ld_generic_create_outfile): Fix program header creation in native
3923 linker. Add PT_GNU_STACK program header.
3925 2006-06-09 Ulrich Drepper <drepper@redhat.com>
3927 * i386_ld.c (elf_i386_finalize_plt): Don't change symbol table entries
3928 for PLT entries if there is no local definition.
3930 * ld.c (parse_option): Handle -z ignore like --as-needed and
3931 -z record like --no-as-needed.
3932 * ld.h (struct ld_state): Remove ignore_unused_dsos field.
3933 * ldgeneric.c (new_generated_scn): Always compute ndt_needed by
3934 looping over DSOs. When deciding about adding DT_NEEDED entries
3935 use ->as_needed instead of ignore_unused_dsos.
3937 2006-05-31 Ulrich Drepper <drepper@redhat.com>
3939 * ld.c: Recognize --as-needed and --no-as-needed options.
3940 * ld.h (struct usedfile): Add as_needed field.
3941 (struct ld_state): Likewise.
3942 * ldgeneric.c (ld_handle_filename_list): Copy as_needed flag from
3944 * ldscript.y (filename_id_list): Split to correctly parse all
3946 (mark_as_needed): Fix loop.
3948 2006-05-28 Ulrich Drepper <drepper@redhat.com>
3950 * addr2line.c (print_dwarf_function): Use unsigned type for lineno
3953 2006-05-27 Ulrich Drepper <drepper@redhat.com>
3955 * readelf.c (handle_relocs_rela): Better notations for addon value.
3956 (print_ehdr): Distinguish e_ident[EI_VERSION] from e_version.
3958 2006-04-04 Ulrich Drepper <drepper@redhat.com>
3960 * addr2line.c: Update copyright year.
3961 * elfcmp.c: Likewise.
3962 * elflint.c: Likewise.
3963 * findtextrel.c: Likewise.
3966 * objdump.c: Likewise.
3967 * ranlib.c: Likewise.
3968 * readelf.c: Likewise.
3970 * strings.c: Likewise.
3971 * strip.c: Likewise.
3973 2006-03-09 Roland McGrath <roland@redhat.com>
3975 * Makefile.am (AM_LDFLAGS): New variable.
3977 2006-03-01 Roland McGrath <roland@redhat.com>
3979 * readelf.c (dwarf_tag_string, dwarf_attr_string): Update name tables
3980 for dwarf.h changes matching 3.0 spec.
3981 (dwarf_encoding_string, dwarf_lang_string, print_ops): Likewise.
3983 2005-12-04 Ulrich Drepper <drepper@redhat.com>
3985 * elflint.c (check_one_reloc): If relocation section is not loaded,
3986 don't check whether the relocations modify read-only sections or
3987 loaded and unloaded sections.
3989 2005-11-28 Ulrich Drepper <drepper@redhat.com>
3991 * elflint.c (check_one_reloc): Take additional parameters. Use
3992 them to determine whether relocation is valid in this type of
3993 file. DSOs and executables can contain relocation sections in
3994 unloaded sections which just show the relocations the linker
3995 applied. Adjust all callers.
3996 (check_program_header): Check that PT_PHDR is loaded and that offset
3997 matches the one in the ELF header.
3999 2005-10-26 Roland McGrath <roland@redhat.com>
4001 * nm.c (get_var_range): dwarf_getloclist -> dwarf_getlocation.
4003 2005-09-03 Ulrich Drepper <drepper@redhat.com>
4005 * strip.c (handle_elf): Unify some error messages.
4006 * ld.c (main): Likewise.
4007 * ldgeneric.c (open_elf): Likewise.
4008 * elfcmp.c (main): Likewise.
4009 * elflint.c (check_elf_header): Likewise.
4011 * size.c (process_file): Fix typo in error message.
4013 * readelf.c: Lots of little cleanups. Use _unlocked functions.
4015 2005-09-02 Ulrich Drepper <drepper@redhat.com>
4017 * strings.c (main): Reset elfmap variable after munmap call.
4018 [_MUDFLAP] (map_file): Simplify mudflap debugging by not using mmap.
4020 2005-08-28 Ulrich Drepper <drepper@redhat.com>
4022 * ranlib.c: Don't define pread_retry and write_retry here.
4024 * Makefile.an [BUILD_STATIC] (libdw): Add -ldl.
4025 (CLEANFILES): Add *.gcno *.gcda *.gconv.
4027 * strings.c (process_chunk): Reorder expressions in conditional
4028 (process_chunk_mb): Likewise.
4030 * strings.c: New file.
4031 * Makefile.am (bin_PROGRAMS): Add strings.
4032 (strings_no_Wstring): Define.
4033 (strings_LDADD): Define.
4035 2005-08-27 Roland McGrath <roland@redhat.com>
4037 * addr2line.c (dwarf_diename_integrate): Function removed.
4038 (print_dwarf_function): Use plain dwarf_diename.
4040 2005-08-24 Ulrich Drepper <drepper@redhat.com>
4042 * elflint.c (check_versym): Versioned symbols should not have
4045 2005-08-15 Ulrich Drepper <drepper@redhat.com>
4047 * elflint.c (check_versym): Allow VER_NDX_LOCAL symbols to be
4050 * Makefile.am: Add rules to build ranlib.
4051 * ranlib.c: New file.
4053 2005-08-14 Roland McGrath <roland@redhat.com>
4055 * elflint.c (check_sections): Use ebl_section_type_name and allow any
4056 sh_type it recognizes.
4058 * elflint.c (check_sections): Print unknown flags in hex, don't
4059 truncate high bits. Print section number and name for unknown type.
4061 2005-08-13 Roland McGrath <roland@redhat.com>
4063 * elflint.c (check_program_header): Use ebl_segment_type_name and
4064 allow any p_type it recognizes. Include p_type value in error
4065 message for unknown type.
4067 2005-08-13 Ulrich Drepper <drepper@redhat.com>
4069 * elflint.c (check_symtab): Simplify last change a bit. Pass ehdr
4070 to ebl_check_special_symbol.
4071 (check_sections): Pass ehdr to ebl_bss_plt_p.
4073 2005-08-12 Roland McGrath <roland@redhat.com>
4075 * elflint.c (check_symtab): Check that _GLOBAL_OFFSET_TABLE_ st_shndx
4076 refers to the right section if it's not SHN_ABS.
4077 Let ebl_check_special_symbol override _G_O_T_ value and size checks.
4079 * elflint.c (check_sections): Don't complain about a non-NOBITS
4080 section taking no segment space, if it's sh_size is 0.
4082 * elflint.c (check_sections): Use ebl_bss_plt_p to see if .plt should
4083 be PROGBITS or NOBITS.
4085 * elflint.c (check_symtab): Use ebl_check_special_symbol to override
4086 standard st_value and st_size checks.
4088 2005-07-28 Roland McGrath <roland@redhat.com>
4090 * addr2line.c (options, parse_opt): Don't handle -e here.
4091 (executable): Variable removed.
4092 (argp_children): New static variable.
4093 (argp): Use it. Make const.
4094 (main): Fill in argp_children from dwfl_standard_argp ().
4095 Let libdwfl handle file selection, pass Dwfl handle to handle_address.
4096 (print_dwarf_function): New function. Try to figure out inline chain.
4097 (elf_getname): Function removed, libdwfl does it for us.
4098 (handle_address): Take Dwfl handle instead of Elf, Dwarf handles.
4099 Use dwfl_module_addrname instead of elf_getname.
4100 Use dwfl_module_getsrc and dwfl_lineinfo instead of libdw calls.
4101 * Makefile.am (INCLUDES): Add libdwfl directory to path.
4103 2005-08-10 Ulrich Drepper <drepper@redhat.com>
4105 * strip.c (parse_opt): STATE parameter is now used.
4106 Various little cleanups.
4108 * readelf.c (print_debug_line_section): Correct fallout of renaming
4109 of DW_LNS_set_epilog_begin.
4111 2005-08-08 Roland McGrath <roland@redhat.com>
4113 * strip.c (options, parse_opt): Grok -R .comment for compatibility
4114 with binutils strip. Likewise -d, -S, as aliases for -g.
4115 Likewise ignore -s/--strip-all.
4117 2005-08-07 Roland McGrath <roland@redhat.com>
4119 * strip.c (process_file): Open read-only when using a different output
4122 2005-08-06 Ulrich Drepper <drepper@redhat.com>
4124 * elflint.c (in_nobits_scn): New function.
4125 (check_versym): Allow references for defined symbols against versions
4126 of other DSOs also for symbols in nobits sections.
4127 Move a few variables around.
4129 * Makefile.am (AM_CFLAGS): Avoid duplication.
4130 Link with statis libs if BUILD_STATIC.
4132 2005-08-05 Ulrich Drepper <drepper@redhat.com>
4134 * elflint.c: Many, many more tests. Mostly related to symbol
4135 versioning. Those sections should now be completely checked.
4137 * readelf.c (print_dynamic): Use gelf_offscn.
4139 2005-08-04 Ulrich Drepper <drepper@redhat.com>
4141 * elflint.c: Add lots more tests: more extension symbol table sanity,
4142 versioning section tests, hash table tests. General cleanup.
4144 2005-08-02 Ulrich Drepper <drepper@redhat.com>
4146 * objdump.c: New file.
4147 * Makefile.am (bin_PROGRAMS): Add objdump.
4148 (objdump_LDADD): Define.
4150 * elflint.c (check_reloc_shdr): New function split out from check_rela
4152 (check_one_reloc): New function. Likewise.
4153 (check_rela): Use check_reloc_shdr and check_one_reloc.
4154 (check_rel): Likewise.
4155 (check_program_header): Check that PT_DYNAMIC entry matches .dynamic
4157 Add checks that relocations against read-only segments are flagged,
4158 that the text relocation flag is not set unnecessarily, and that
4159 relocations in one section are either against loaded or not-loaded
4162 2005-08-01 Ulrich Drepper <drepper@redhat.com>
4164 * elfcmp.c (main): Ignore section count and section name string table
4167 2005-07-27 Roland McGrath <roland@redhat.com>
4169 * elfcmp.c: Include <locale.h>.
4171 2005-07-27 Ulrich Drepper <drepper@redhat.com>
4173 * elfcmp.c: Print name and index of differing section.
4175 2005-07-24 Ulrich Drepper <drepper@redhat.com>
4177 * elfcmp.c: Implement comparing gaps between sections.
4179 2005-07-23 Ulrich Drepper <drepper@redhat.com>
4181 * elflint.c: Include libeblP.h instead of libebl.h.
4183 * readelf.c: Likewise.
4184 * elfcmp.c: Likewise.
4186 * elfcmp.c (main): Compare individual ELF header fields, excluding
4187 e_shoff instead of the whole struct at once.
4188 Use ebl_section_strip_p instead of SECTION_STRIP_P.
4189 * strip.c: Use ebl_section_strip_p instead of SECTION_STRIP_P.
4191 2005-07-22 Ulrich Drepper <drepper@redhat.com>
4193 * elfcmp.c (main): Take empty section into account when comparing
4196 * elflint.c (check_dynamic): Check that d_tag value is >= 0 before
4199 2005-07-21 Ulrich Drepper <drepper@redhat.com>
4201 * elfcmp.c: New file.
4202 * Makefile.am (bin_PROGRAMS): Add elfcmp.
4203 (elfcmp_LDADD): Define.
4205 * elflint.c (check_rela): Check that copy relocations only reference
4206 object symbols or symbols with unknown type.
4207 (check_rel): Likewise.
4209 2005-06-08 Roland McGrath <roland@redhat.com>
4211 * readelf.c (print_ops): Add consts.
4213 2005-05-31 Roland McGrath <roland@redhat.com>
4215 * readelf.c (print_debug_abbrev_section): Don't bail after first CU's
4216 abbreviations. Print a header line before each CU section.
4218 * readelf.c (print_debug_loc_section): Fix indentation for larger
4221 2005-05-30 Roland McGrath <roland@redhat.com>
4223 * readelf.c (print_debug_line_section): Print section offset of each
4224 CU's table, so they are easy to find from seeing the stmt_list value.
4226 * readelf.c (dwarf_attr_string): Add all attributes in <dwarf.h>.
4227 (attr_callback): Grok DW_AT_ranges and print offset in hex.
4229 * readelf.c (attr_callback): Add 2 to addrsize * 2 for %#0* format.
4230 (print_debug_ranges_section, print_debug_loc_section): Likewise.
4232 * readelf.c (print_ops): Take different args for indentation control.
4233 (attr_callback): Caller updated.
4234 Grok several more block-form attributes as being location expressions.
4235 For those same attributes with udata forms, format output differently
4236 for location list offset.
4237 (print_debug_loc_section): Implement it for real.
4239 * readelf.c (options): Mention ranges for --debug-dump.
4240 (enum section_e): Add section_ranges.
4241 (parse_opt): Grok "ranges" for -w/--debug-dump.
4242 (print_debug_ranges_section): New function.
4243 (print_debug): Handle .debug_ranges section.
4245 2005-05-30 Ulrich Drepper <drepper@redhat.com>
4247 * readelf.c (handle_notes): At least x86-64 need not have the note
4248 section values aligned to 8 bytes.
4250 2005-05-18 Ulrich Drepper <drepper@redhat.com>
4252 * readelf.c (dwarf_tag_string): Add new tags.
4254 2005-05-08 Roland McGrath <roland@redhat.com>
4256 * strip.c (handle_elf): Don't translate hash and versym data formats,
4257 elf_getdata already did it for us.
4259 2005-05-07 Ulrich Drepper <drepper@redhat.com>
4261 * Makefile.am (findtextrel_LDADD): Add $(libmudflap).
4262 (addr2line_LDADD): Likewise.
4264 2005-05-03 Roland McGrath <roland@redhat.com>
4266 * strip.c (handle_elf): Apply symbol table fixups to discarded
4267 relocation sections when they are being saved in the debug file.
4269 * strip.c (handle_elf): Pass EHDR->e_ident[EI_DATA] to gelf_xlatetom
4270 and gelf_xlatetof, not the native byte order.
4272 * strip.c (parse_opt): Give error if -f or -o is repeated.
4273 (main): Exit if argp_parse returns nonzero.
4275 * strip.c (debug_fname_embed): New variable.
4276 (options, parse_opt): New option -F to set it.
4278 2005-05-07 Ulrich Drepper <drepper@redhat.com>
4280 * readelf.c (parse_opt): Make any_control_option variable
4281 local. Simplify some tests.
4283 2005-05-03 Roland McGrath <roland@redhat.com>
4285 * strip.c (crc32_file): Function removed (now in ../lib).
4287 2005-05-03 Roland McGrath <roland@redhat.com>
4289 * elflint.c (is_debuginfo): New variable.
4290 (options, parse_opt): New option --debuginfo/-d to set it.
4291 (check_sections): If is_debuginfo, don't complain about SHT_NOBITS.
4292 (check_note): If is_debuginfo, don't try to get note contents.
4294 2005-04-24 Ulrich Drepper <drepper@redhat.com>
4296 * readelf.c (print_debug_abbrev_section): Don't print error when end of
4299 2005-04-14 Ulrich Drepper <drepper@redhat.com>
4301 * readelf.c (dwarf_encoding_string): New function.
4302 (dwarf_inline_string): New function.
4303 (dwarf_access_string): New function.
4304 (dwarf_visibility_string): New function.
4305 (dwarf_virtuality_string): New function.
4306 (dwarf_identifier_case_string): New function.
4307 (dwarf_calling_convention_string): New function.
4308 (dwarf_ordering_string): New function.
4309 (dwarf_discr_list_string): New function.
4310 (attr_callback): Decode man more attribute values.
4312 2005-04-01 Ulrich Drepper <drepper@redhat.com>
4314 * addr2line.c: Finish implementation of -f option.
4316 2005-03-29 Ulrich Drepper <drepper@redhat.com>
4318 * addr2line.c: New file.
4319 * Makefile.am (bin_PROGRAMS): Add addr2line.
4320 Define addr2line_LDADD.
4322 * findtextrel.c: Use new dwarf_addrdie function.
4324 * findtextrel.c: Fix usage message and re-add accidentally removed
4327 2005-03-28 Ulrich Drepper <drepper@redhat.com>
4329 * findtextrel.c: New file.
4330 * Makefile: Add rules to build findtextrel.
4332 2005-02-15 Ulrich Drepper <drepper@redhat.com>
4334 * ldlex.l: Provide ECHO definition to avoid warning.
4336 * elflint.c (check_program_header): Fix typo in RELRO test.
4338 * Makefile.am (AM_CFLAGS): Add more warning options.
4339 * elflint.c: Fix warnings introduced by the new warning options.
4340 * i386_ld.c: Likewise.
4343 * ldgeneric.c: Likewise.
4345 * readelf.c: Likewise.
4346 * sectionhash.c: Likewise.
4348 * string.c: Likewise.
4350 2005-02-05 Ulrich Drepper <drepper@redhat.com>
4352 * Makefile.am: Check for text relocations in constructed DSOs.
4354 * Makefile.am [MUDFLAP] (AM_CFLAGS): Add -fmudflap. Link all apps
4357 * ldscript.y: Add as_needed handling.
4358 * ldlex.l: Recognize AS_NEEDED token.
4359 * ld.h (struct filename_list): Add as_needed flag.
4361 2005-02-04 Ulrich Drepper <drepper@redhat.com>
4363 * elflint.c (check_symtab): Correctly determine size of GOT section.
4365 2005-01-19 Ulrich Drepper <drepper@redhat.com>
4367 * ld.c: Remove unnecessary more_help function. Print bug report
4369 * strip.c: Likewise.
4372 * readelf.c: Likewise.
4373 * elflint.c: Likewise.
4375 * elflint.c (main): Don't check for parameter problems here.
4376 (parse_opt): Do it here, where we get informed about some of them
4379 * readelf.c (main): Don't check for parameter problems here.
4380 (parse_opt): Do it here, where we get informed about some of them
4383 2005-01-11 Ulrich Drepper <drepper@redhat.com>
4385 * strip.c: Update copyright year.
4386 * readelf.c: Likewise.
4390 * elflint.c: Likewise.
4392 * elflint.c (check_symtab): Don't warn about wrong size for
4393 _DYNAMIC and __GLOBAL_OFFSET_TABLE__ for --gnu-ld.
4395 2004-10-05 Ulrich Drepper <drepper@redhat.com>
4397 * readelf.c (print_phdr): In section mapping, also indicate
4398 sections in read-only segments.
4400 2004-09-25 Ulrich Drepper <drepper@redhat.com>
4402 * readelf.c: Make compile with gcc 4.0.
4403 * strip.c: Likewise.
4405 2004-08-16 Ulrich Drepper <drepper@redhat.com>
4407 * strip.c (handle_elf): Rewrite dynamic memory handling to use of
4408 allocate to work around gcc 3.4 bug.
4410 2004-01-25 Ulrich Drepper <drepper@redhat.com>
4412 * ldlex.l (invalid_char): Better error message.
4414 2004-01-23 Ulrich Drepper <drepper@redhat.com>
4416 * readelf.c: Print SHT_GNU_LIBLIST sections.
4418 * none_ld.c: New file.
4420 2004-01-21 Ulrich Drepper <drepper@redhat.com>
4422 * Makefile.am: Enable building of machine specific linker.
4424 2004-01-20 Ulrich Drepper <drepper@redhat.com>
4426 * Makefile.am: Support building with mudflap.
4428 * i386_ld.c: Fix warnings gcc 3.4 spits out.
4429 * ldgeneric.c: Likewise.
4430 * ldscript.y: Likewise.
4431 * readelf.c: Likewise.
4432 * strip.c: Likewise.
4434 * readelf.c (print_debug_line_section): Determine address size
4437 2004-01-19 Ulrich Drepper <drepper@redhat.com>
4439 * readelf.c (print_phdr): Show which sections are covered by the
4442 * elflint.c (check_program_header): Check PT_GNU_RELRO entry.
4444 * readelf.c (print_debug_macinfo_section): Implement.
4446 2004-01-18 Ulrich Drepper <drepper@redhat.com>
4448 * readelf.c (print_debug_line_section): Implement.
4450 2004-01-17 Ulrich Drepper <drepper@redhat.com>
4452 * src/elflint.c: Use PACKAGE_NAME instead of PACKAGE.
4453 * src/ld.c: Likewise.
4454 * src/nm.c: Likewise.
4455 * src/readelf.c: Likewise.
4456 * src/size.c: Likewise.
4457 * src/strip.c: Likewise.
4459 * strip.c: Add a few more unlikely. Reduce scope of some variables.
4461 * Makefile.am: Support building with mudflap.
4463 2004-01-16 Ulrich Drepper <drepper@redhat.com>
4465 * readelf.c (print_debug_info_section): Free dies memory.
4467 * readelf.c: Print .debug_info section content.
4469 2004-01-13 Ulrich Drepper <drepper@redhat.com>
4471 * readelf.c (print_shdr): Add support for SHF_ORDERED and SHF_EXCLUDE.
4473 2004-01-12 Ulrich Drepper <drepper@redhat.com>
4475 * readelf.c (print_debug_aranges): Implement using libdw.
4477 2004-01-11 Ulrich Drepper <drepper@redhat.com>
4479 * nm.c: Adjust for Dwarf_Files type and dwarf_lineno interface change.
4481 * readelf.c: Use libdw instead of libdwarf. Not all of the old
4482 behavior is available yet.
4483 * Makefile.am: Link readelf with libdw. Remove libdwarf include path.
4485 2004-01-09 Ulrich Drepper <drepper@redhat.com>
4487 * nm.c (get_local_names): Adjust call to dwarf_nextcu.
4489 * nm.c: Implement getting information about local variables.
4491 2004-01-07 Ulrich Drepper <drepper@redhat.com>
4493 * nm.c: Read also debug information for local symbols.
4495 2004-01-05 Ulrich Drepper <drepper@redhat.com>
4497 * nm.c: Shuffle dwarf handling code around so the maximum column
4498 width can be computed ahead of printing. Avoid collection symbols
4499 which are not printed anyway.
4501 * nm.c: Rewrite dwarf handling to use libdw.
4502 * Makefile.am (AM_CFLAGS): Add -std parameter.
4503 (INCLUDES): Find header in libdw subdir.
4504 (nm_LDADD): Replace libdwarf with libdw.
4506 * elflint.c: Update copyright year.
4507 * readelf.c: Likewise.
4509 * strip.c: Likewise.
4512 2003-12-31 Ulrich Drepper <drepper@redhat.com>
4514 * strip.c (process_file): Close file before returning.
4516 2003-11-19 Ulrich Drepper <drepper@redhat.com>
4518 * readelf.c (handle_dynamic): Make column for tag name wider.
4520 2003-09-29 Ulrich Drepper <drepper@redhat.com>
4522 * readelf.c (handle_dynamic): Always terminate tag name with a space.
4524 2003-09-25 Ulrich Drepper <drepper@redhat.com>
4526 * strip.c (process_file): Don't mmap the input file, we modify the
4527 data structures and don't want the change end up on disk.
4529 2003-09-23 Jakub Jelinek <jakub@redhat.com>
4531 * unaligned.h (union u_2ubyte_unaligned,
4532 union u_4ubyte_unaligned, union u_8ubyte_unaligned): Add
4534 (add_2ubyte_unaligned, add_4ubyte_unaligned,
4535 add_8ubyte_unaligned): Avoid nesting bswap_NN macros.
4536 Read/store value through _ptr->u instead of *_ptr.
4538 2003-09-22 Ulrich Drepper <drepper@redhat.com>
4540 * size.c (show_sysv): Change type of maxlen to int.
4542 * strip.c (handle_elf): Handle the 64-bit archs which is 64-bit
4545 * i386_ld.c: Many many fixes and extensions.
4547 * ldgeneric.c: Likewise.
4549 2003-08-16 Ulrich Drepper <drepper@redhat.com>
4551 * ldgeneric.c (check_definition): Don't add symbol on dso_list if
4552 the reference is from another DSO.
4554 2003-08-15 Ulrich Drepper <drepper@redhat.com>
4556 * ldgeneric.c (find_entry_point): It is no fatal error if no entry
4557 point is found when creating a DSO.
4559 2003-08-14 Ulrich Drepper <drepper@redhat.com>
4561 * ld.c (main): Always call FLAG_UNRESOLVED.
4562 * ldgeneric.c (ld_generic_flag_unresolved): Only complain about
4563 undefined symbols if not creating DSO or ld_state.nodefs is not set.
4565 2003-08-13 Ulrich Drepper <drepper@redhat.com>
4567 * Makefile.in: Depend on libebl.a, not libebl.so.
4569 * ld.c (main): Mark stream for linker script as locked by caller.
4570 (read_version_script): Likewise.
4571 * ldlex.c: Define fread and fwrite to _unlocked variant.
4573 * i386_ld.c (elf_i386_finalize_plt): Replace #ifdefs with uses of
4575 * unaligned.h: Define target_bswap_16, target_bswap_32, and
4577 (store_2ubyte_unaligned, store_4ubyte_unaligned,
4578 store_8ubyte_unaligned): Define using new macros.
4580 2003-08-12 Ulrich Drepper <drepper@redhat.com>
4582 * i386_ld.c (elf_i386_finalize_plt): Use packed structs to access
4583 possibly unaligned memory. Support use of big endian machines.
4585 2003-08-11 Ulrich Drepper <drepper@redhat.com>
4587 * Moved to CVS archive.