1 2018-09-13 Mark Wielaard <mark@klomp.org>
3 * elfcmp.c (main): Get, check and shdrstrndx for section names.
5 2018-09-12 Mark Wielaard <mark@klomp.org>
7 * elfcmp.c (main): Call ebl_section_strip_p without ehdr.
8 * strip.c (handle_elf): Likewise.
10 2018-09-12 Mark Wielaard <mark@klomp.org>
12 * elflint.c (check_symtab): Call ebl_check_special_symbol without
15 2018-07-30 Mark Wielaard <mark@klomp.org>
17 * strip.c (handle_elf): Track allocated/unallocated sections seen. Set
18 section offset of unallocated sections after handling all allocated
21 2018-08-18 Mark Wielaard <mark@klomp.org>
23 * readelf.c (print_debug_aranges_section): Make sure there is enough
24 data to read the header segment size.
26 2018-08-18 Mark Wielaard <mark@klomp.org>
28 * elflint.c (check_sysv_hash): Calculate needed size using unsigned
29 long long int to prevent overflow.
30 (check_sysv_hash64): Calculate maxwords used separately before
31 comparison to prevent overflow.
33 2018-07-24 Mark Wielaard <mark@klomp.org>
35 * unstrip.c (compare_unalloc_sections): Also compare sh_size.
37 2018-07-21 Mark Wielaard <mark@klomp.org>
39 * unstrip.c (adjust_all_relocs): Skip SHT_GROUP sections.
41 2018-07-21 Mark Wielaard <mark@klomp.org>
43 * elfcompress.c (get_sections): New function.
44 (process_file): Check whether section needs to change. Don't rewrite
45 file if no section data needs changing.
46 (main): Update 'force' help text.
48 2018-07-21 Mark Wielaard <mark@klomp.org>
50 * elfcompress.c (process_file): Swap fchmod and fchown calls.
52 2018-07-04 Mark Wielaard <mark@klomp.org>
54 * readelf.c (print_debug_addr_section): Rename index var to uidx.
55 (attr_callback): Rename index var to word.
56 (print_debug_str_offsets_section): Rename index var to uidx.
58 2018-07-04 Ross Burton <ross.burton@intel.com>
60 * addr2line.c: Remove error.h include.
62 * arlib.c: Likewise and add system.h include.
65 * elfcompress.c: Likewise.
66 * elflint.c: Likewise.
67 * findtextrel.c: Likewise.
69 * objdump.c: Likewise.
71 * readelf.c: Likewise.
73 * strings.c: Likewise.
75 * unstrip.c: Likewise.
77 2018-06-25 Mark Wielaard <mark@klomp.org>
79 * readelf.c (print_decoded_line_section): Use dwarf_next_lines
80 instead of dwarf_nextcu.
81 (print_debug_line_section): Don't explicitly lookup CU.
83 2018-06-15 Mark Wielaard <mark@klomp.org>
85 * readelf.c (attr_callback): Only print block as expressions if it
88 2018-06-12 Mark Wielaard <mark@klomp.org>
90 * readelf.c (print_form_data): Check we have 4, not 2, bytes
91 available for DW_FORM_block4.
93 2018-06-12 Mark Wielaard <mark@klomp.org>
95 * readelf.c (print_form_data): Don't increase strreadp after use.
96 Do increase readp for DW_FORM_strx[1234].
98 2018-06-16 Mark Wielaard <mark@klomp.org>
100 * readelf.c (print_debug_loc_section): Make sure next_off doesn't
103 2018-06-13 Mark Wielaard <mark@klomp.org>
105 * readelf.c (die_type_sign_bytes): New function.
106 (attr_callback): Recognized DW_FORM_implicit_cost as signed. Use
107 die_type_sign_bytes to lookup the signedness and size of const
110 2018-06-11 Mark Wielaard <mark@klomp.org>
112 * readelf.c (print_form_data): Don't reuse readp and readendp when
113 reading str_offsets section.
115 2018-06-10 Mark Wielaard <mark@klomp.org>
117 * readelf.c (print_form_data): Don't cast value to ptrdiff_t, cast
120 2018-06-08 Mark Wielaard <mark@klomp.org>
122 * readelf.c (print_debug_rnglists_section): Calculate max_entries
123 instead of needed bytes to prevent overflowing. Always print
124 max_entries (but not more).
125 (print_debug_loclists_section): Likewise.
127 2018-06-08 Mark Wielaard <mark@klomp.org>
129 * readelf.c (print_debug_line_section): Stop printing directories
130 and files when we are at the end of the unit data.
132 2018-06-07 Mark Wielaard <mark@klomp.org>
134 * readelf.c (format_result): Removed.
135 (format_result_size): Removed.
136 (format_dwarf_addr): Renamed to...
137 (print_dwarf_addr): ...this. Simply call printf, don't setup buffer,
139 (print_ops): Use print_dwarf_addr instead of format_dwarf_addr.
140 (print_debug_addr_section): Likewise.
141 (print_debug_aranges_section): Likewise.
142 (print_debug_rnglists_section): Likewise.
143 (print_debug_ranges_section): Likewise.
144 (print_debug_frame_section): Likewise.
145 (attr_callback): Likewise.
146 (print_decoded_line_section): Likewise.
147 (print_debug_line_section): Likewise.
148 (print_debug_loclists_section): Likewise.
149 (print_debug_loc_section): Likewise.
150 (print_gdb_index_section): Likewsie.
152 2018-06-05 Mark Wielaard <mark@klomp.org>
154 * readelf.c (print_debug_addr_section): Set unit_length always to
155 (next_unitp - readp) in case we don't have a real header.
157 2018-06-05 Mark Wielaard <mark@klomp.org>
159 * readelf.c (print_debug_loc_section): Set begin to idx when failing
160 to read the start address if DW_LLE_GNU_start_end_entry.
162 2018-06-05 Mark Wielaard <mark@klomp.org>
164 * readelf.c (handle_sysv_hash): Don't leak lengths array when
165 detecting an invalid chain.
166 (handle_sysv_hash64): Likewise.
168 2018-06-05 Mark Wielaard <mark@klomp.org>
170 * readelf.c (print_debug_macro_section): Extend vendor array by one
171 to include max DW_MACRO_hi_user opcode.
173 2018-06-07 Mark Wielaard <mark@klomp.org>
175 * readelf.c (main): Lookup "no" for no_str.
176 (print_debug_abbrev_section): Use yes_str and no_str.
177 (print_form_data): Likewise.
179 2018-06-04 Mark Wielaard <mark@klomp.org>
181 * readelf (format_result): New static char pointer.
182 (format_result_size): New static size_t.
183 (format_dwarf_addr): Calculate max string size, reuse format_result
184 if possible, otherwise realloc. Use sprintf on result, not asprintf.
185 (print_ops): Don't free format_dwarf_addr, make sure result is
186 printed before calling format_dwarf_addr again.
187 (print_debug_addr_section): Likewise.
188 (print_debug_aranges_section): Likewise.
189 (print_debug_rnglists_section): Likewise.
190 (print_debug_ranges_section): Likewise.
191 (print_debug_frame_section): Likewise.
192 (attr_callback): Likewise.
193 (print_decoded_line_section): Likewise.
194 (print_debug_line_section): Likewise.
195 (print_debug_loclists_section): Likewise.
196 (print_debug_loc_section): Likewise.
197 (print_gdb_index_section): Likewsie.
199 2018-06-04 Mark Wielaard <mark@klomp.org>
201 * readelf.c (yes_str): New static char pointer.
203 (main): Set yes_str and no_str using gettext.
204 (attr_callback): Use yes_str and no_str instead of calling gettext.
206 2018-06-04 Mark Wielaard <mark@klomp.org>
208 * readelf.c (main): Call __fsetlocking (stdout, FSETLOCKING_BYCALLER).
210 2018-05-31 Mark Wielaard <mark@klomp.org>
212 * readelf.c (print_debug_units): Print the dwo name and id when
213 unable to find a .dwo file.
215 2018-05-31 Mark Wielaard <mark@klomp.org>
217 * readelf.c (enum section_e): Make section_types not an alias of
219 (section_all): Add section_types.
220 (parse_opt): Add both section_info and section_types for "info"
222 (print_debug_units): Don't be silent for debug_types.
224 2018-05-31 Mark Wielaard <mark@klomp.org>
226 * readelf.c (attr_callback): Only register section_loc when not
227 looking at a split dwarf from a skeleton.
229 2018-05-30 Mark Wielaard <mark@klomp.org>
231 * readelf.c (print_debug_loc_section): Use correct listptr for
234 2018-05-31 Mark Wielaard <mark@klomp.org>
236 * readelf.c (print_debug_units): Check offset against -1 not ~0ul.
238 2018-05-29 Mark Wielaard <mark@klomp.org>
240 * readelf.c (print_debug_loc_section): Handle GNU DebugFission list
243 2018-05-29 Mark Wielaard <mark@klomp.org>
245 * readelf.c (print_debug): Record and reset section_info status in
246 implicit_debug_sections and print_debug_sections.
248 2018-05-28 Mark Wielaard <mark@klomp.org>
250 * readelf.c (print_debug_units): Turn "Could not find split compile
251 unit" into an Warning instead of an error.
253 2018-04-29 Mark Wielaard <mark@klomp.org>
255 * readelf.c (parse_opt): Request implicit section_info for "str".
256 (known_stroffbases): New static variable.
257 (attr_callbackattr_callback): Handle DW_AT_str_offets_base.
258 (print_debug_str_offsets_section): New function.
259 (print_debug): Handle .debug_str_offsets as section_str. Reset
262 2018-04-27 Mark Wielaard <mark@klomp.org>
264 * readelf.c (options): Add addr.
265 (enum section_e): Add section_addr.
266 (section_all): Add section_addr.
267 (parse_opt): Parse "addr".
268 (known_addrbases): New static variable.
269 (get_listptr): New function.
270 (print_debug_addr_section): Likewise.
271 (attr_callback): Handle DW_AT_addr_base and DW_AT_GNU_addr_base.
272 (print_debug): Add NEW_SECTION (addr). Reset known_addrbases.
274 2018-04-07 Mark Wielaard <mark@klomp.org>
276 * readelf.c (attr_callback): Handle DW_FORM_loclistx and
279 2018-04-12 Mark Wielaard <mark@klomp.org>
281 * readelf.c (dwarf_loc_list_encoding_string): New functions.
282 (dwarf_loc_list_encoding_name): Likewise.
283 (known_loclistptr): Renamed and split in two...
284 (known_locsptr): this and ...
285 (known_loclistsptr): this.
286 (listptr_base): Split out...
287 (cudie_base): ...this.
288 (is_split_dwarf): New function.
289 (attr_callback): Handle DW_AT_loclists_base and notice sec_offset
291 (print_debug_rnglists_section): Use spit_dwarf_cu_base.
292 (print_debug_loclists_section): New function.
293 (print_debug_loc_section): Use known_locsptr instead of
295 (print_debug): Recognize .debug_loclists. Reset known_locsptr and
298 2018-05-25 Mark Wielaard <mark@klomp.org>
300 * readelf.c (DWARF_SKELETON): New constant.
301 (do_not_close_dwfl): New bool.
302 (options): Add dwarf-skeleton.
303 (dwarf_skeleton): New static variable.
304 (parse_opt): Handle DWARF_SKELETON, set dwarf_skeleton.
305 (create_dwfl): New function, with code extracted from...
306 (process_file): ...here. Check do_not_close_dwfl.
307 (is_split_darf): New function.
308 (getone_dwflmod): Likewise.
309 (print_debug): Use new functions to find skeleton DWARF file to use
310 when inspecting .dwo split DWARF file.
312 2018-04-11 Mark Wielaard <mark@klomp.org>
314 * readelf.c (dwarf_range_list_encoding_string): New function.
315 (dwarf_range_list_encoding_name): Likewise.
316 (known_rnglistptr): New static variable.
317 (listptr_cu): New function.
318 (print_debug_rnglists_section): Likewise.
319 (attr_callback): Call notice_listptr for DW_AT_ranges. Handle
320 DW_AT_rnglists_base. Handle DW_FORM_rnglistx. DW_AT_start_scope
321 can also have a rnglist.
322 (print_debug_units): Do (silently) scan split DWARF also for
323 debug_ranges before DWARF5 to catch all rangelistptrs.
324 (print_debug): Recognize .debug_rnglists. Reset known_rnglistptr.
326 2018-01-21 Mark Wielaard <mark@klomp.org>
328 * readelf.c (get_indexed_addr): New function.
329 (print_ops): Handle DW_OP_addrx, DW_OP_GNU_addr_index,
330 DW_OP_constx, DW_OP_GNU_const_index separately and resolve
332 (attr_callback): Print index and address for
333 DW_FORM_GNU_addr_index and DW_FORM_addrx[1234].
335 2018-01-19 Mark Wielaard <mark@klomp.org>
337 * readelf.c (options): Add info+.
338 (show_split_units): New static boolean defaulting to false.
339 (parse_opt): For all (no arg) --debug-dump set show_split_units
340 to yes. For "info+" enable section_info and show_split_units.
341 (attrcb_args): Add is_split field.
342 (attr_callback): Use is_split to format DIE offsets differently.
343 (print_debug_units): Likewise. Get subdie (type or split) only
344 when needed. When not silent reiterate over split DIEs when
347 2018-05-15 Mark Wielaard <mark@klomp.org>
349 * readelf.c (print_debug_units): Print unit type and id for any
350 unit type that has it even when version < 5.
352 2018-05-14 Mark Wielaard <mark@klomp.org>
354 * readelf.c (print_ops): Handle DW_OP_GNU_addr_index and
355 DW_OP_GNU_const_index.
356 (attr_callback): Handle DW_FORM_GNU_addr_index as DW_FORM_addrx.
357 Handle DW_FORM_GNU_str_index as DW_FORM_constx. Add as_hex_id.
358 Handle DW_AT_GNU_dwo_id as_hex_id.
359 (print_form_data): Handle DW_FORM_GNU_str_index as DW_FORM_strx.
361 2018-05-12 Mark Wielaard <mark@klomp.org>
363 * readelf.c (print_debug): Also recognize .dwo section name variants.
365 2018-05-15 Dmitry V. Levin <ldv@altlinux.org>
367 * elflint.c (check_elf_header): Fix typo in error diagnostics.
369 2018-05-15 Mark Wielaard <mark@klomp.org>
371 * readelf.c (print_form_data): Cast comparisons against offset_len to
373 (print_debug_line_section): Print uint64_t as PRIu64.
375 2018-05-11 Mark Wielaard <mark@klomp.org>
377 * readelf.c (print_debug_macro_section): Use libdw_valid_user_form.
378 Use print_form_data for strx and sup strings.
380 2018-05-09 Mark Wielaard <mark@klomp.org>
382 * readelf.c (dwarf_line_content_description_string): New function.
383 (dwarf_line_content_description_name): Likewise.
384 (print_bytes): Likewise.
385 (print_form_data): Likewise. Based on code taken from...
386 (print_debug_macro_section): ...here. Now calls print_form_data
387 and str_offsets_base_off.
388 (print_debug_line_section): Parse DWARF5 header, directory and file
391 2018-05-12 Mark Wielaard <mark@klomp.org>
393 * addr2line.c (main): Add fflush (stdout) after handle_address ()
394 when reading from stdin.
396 2018-04-24 Mark Wielaard <mark@klomp.org>
398 * readelf.c (print_debug_aranges_section): Try elf_rawdata if no
400 (print_debug_ranges_section): Likewise.
401 (print_debug_frame_section): Likewise.
402 (print_debug_line_section): Likewise. Check for data == NULL.
403 (print_debug_loc_section): Likewise.
404 (print_debug_macinfo_section): Likewise.
405 (print_debug_macro_section): Likewise.
407 2018-04-28 Mark Wielaard <mark@klomp.org>
409 * readelf.c (print_debug): If .debug_info is needed implicitly by
410 then handle it first before handling any other debug section.
411 (parse_opt): Set implicit_debug_sections to section_info when
412 showing all debug sections.
414 2018-05-05 Mark Wielaard <mark@klomp.org>
416 * readelf.c (attr_callback): Handle DW_FORM_ref_sup4 and
417 DW_FORM_ref_sup8 as references.
419 2018-04-24 Mark Wielaard <mark@klomp.org>
421 * readelf.c (print_debug_str_section): Take raw section data. Don't
422 use dwarf_getstring, but determine start and end of string from
423 offset and section data directly.
424 (print_debug): Handle ".debug_line_str" like ".debug_str".
426 2018-04-19 Andreas Schwab <schwab@suse.de>
428 * elflint.c (valid_e_machine): Add EM_RISCV.
430 2018-04-16 Mark Wielaard <mark@klomp.org>
432 * readelf.c (print_debug_line_section). In advance_pc, advance
433 using op_addr_advance, not op_advance.
435 2018-04-14 Mark Wielaard <mark@klomp.org>
437 * readelf.c (attr_callback): Only show errors when not silent.
439 2018-03-23 Mark Wielaard <mark@klomp.org>
441 * readelf.c (attr_callback): Handle DW_FORM_strx[1234].
443 2018-03-22 Mark Wielaard <mark@klomp.org>
445 * readelf.c (attr_callback): Handle DW_FORM_addrx[1234].
447 2018-03-28 Mark Wielaard <mark@klomp.org>
449 * readelf.c (handle_sysv_hash): Break bucket chain after nchain
451 (handle_sysv_hash64): Likewise.
453 2018-03-27 Mark Wielaard <mark@klomp.org>
455 * readelf.c (attr_callback): Print dwarf_dieoffset as %PRIx64,
458 2018-03-20 Mark Wielaard <mark@klomp.org>
460 * readelf.c (attr_callback): Report error when DW_AT_decl_file or
461 DW_AT_call_file cannot be resolved.
463 2018-03-06 Mark Wielaard <mark@klomp.org>
465 * readelf.c (print_ops): Handle DW_OP_addrx, DW_OP_constx,
466 DW_OP_implicit_pointer, DW_OP_entry_value, DW_OP_const_type,
467 DW_OP_regval_type, DW_OP_deref_type, DW_OP_xderef_type,
468 DW_OP_convert, DW_OP_reinterpret.
470 2018-03-01 Mark Wielaard <mark@klomp.org>
472 * readelf.c (struct listptr): Add attr field.
473 (compare_listptr): Warn when two listptrs for the same offset have
474 different attributes.
475 (notice_listptr): Take attr as argument and add it to listptr.
476 (skip_listptr_hole): New attr argument.
477 (next_listptr_offset): New function.
478 (print_debug_ranges_section): Pass NULL attr to skip_listptr_hole.
479 (attr_callback): Handle DW_AT_GNU_locviews. Call notice_listptr with
481 (print_debug_loc_section): Keep track of which attr is associated with
482 a listptr. If the attr is DW_AT_GNU_locview print view pairs till the
485 2018-02-09 Mark Wielaard <mark@klomp.org>
487 * elflint.c (check_group): Make sure we can read a complete
488 element when iterating over the group.
490 2018-02-09 Mark Wielaard <mark@klomp.org>
492 * readelf.c (attr_callback): Handle DW_FORM_data16 as Dwarf_Block.
494 2018-02-09 Mark Wielaard <mark@klomp.org>
496 * readelf.c (print_debug_abbrev_section): Print the value of a
497 DW_FORM_implicit_const using dwarf_getabbrevattr_data.
498 (attr_callback): Handle DW_FORM_implicit_const.
500 2018-01-30 Mark Wielaard <mark@klomp.org>
502 * readelf.c (dwarf_unit_string): New function.
503 (dwarf_unit_name): Likewise.
504 (print_debug_units): Use dwarf_get_units and dwarf_cu_die instead
505 of dwarf_next_unit. Print unit type, id and subdie if available.
507 2018-02-09 Joshua Watt <JPEWhacker@gmail.com>
509 * addr2line.c (handle_address): Use FALLTHROUGH macro instead of
511 * elfcompress.c (parse_opt): Likewise.
512 * elflint.c (check_dynamic): Likewise.
513 (check_sections): Likewise.
514 (check_note_data): Likewise.
515 * objdump.c (parse_opt): Likewise.
516 * readelf.c (parse_opt): Likewise.
517 (attr_callback): Likewise.
518 (handle_auxv_note): Likewise.
519 * strings.c (parse_opt): Likewise.
520 * backtrace.c (callback_verify): Likewise.
522 2018-01-25 Mark Wielaard <mark@klomp.org>
524 * readelf.c (print_debug_ranges_section): Initialize cu to last_cu.
525 (print_debug_loc_section): Likewise.
527 2018-01-01 Mark Wielaard <mark@klomp.org>
529 * readelf.c (attr_callback): Use dwarf_form_name for unknown forms.
530 (print_debug_macro_section): Print form using dwarf_form_name.
532 2017-12-28 Mark Wielaard <mark@klomp.org>
534 * readelf.c (print_debug_units): Print DIE offset in error message
537 2017-12-18 Mark Wielaard <mark@klomp.org>
539 * readelf.c (handle_notes_data): Don't use EXIT_FAILURE in error.
540 Adjust error message depending on whether or not we got data.
542 2017-12-07 Mark Wielaard <mark@klomp.org>
544 * readelf.c (print_ops): Update data pointer and print arguments
545 to DW_OP_call2 and DW_OP_call4 as DIE offsets.
547 2017-11-29 Mark Wielaard <mark@klomp.org>
549 * readelf.c (argp_options): Add "section-groups", 'g'.
551 2017-11-29 Mark Wielaard <mark@klomp.org>
553 * readelf.c (print_debug_loc_section): Print CU base and unresolved
554 addresses. Adjust formatting.
556 2017-11-29 Mark Wielaard <mark@klomp.org>
558 * readelf.c (print_debug_ranges_section): Print CU base and unresolved
559 addresses. Adjust formatting.
561 2017-11-29 Mark Wielaard <mark@klomp.org>
563 * readelf.c (attr_callback): Set valuestr to resolved file name
564 for DW_AT_decl_file and DW_AT_call_file.
566 2017-11-29 Mark Wielaard <mark@klomp.org>
568 * readelf.c (print_debug_units): Print abbrev code after DIE tag.
570 2017-11-29 Mark Wielaard <mark@klomp.org>
572 * readelf.c (print_ops): Use only2 space for index. re-indent +5
573 for DW_OP_GNU_entry_value.
575 2017-11-21 Mark Wielaard <mark@klomp.org>
577 * readelf.c (attr_callback): Print attribute name and form in error
578 message. If only the value cannot be retrieved/resolved don't abort.
580 2017-10-03 Mark Wielaard <mark@klomp.org>
582 * readelf.c (attr_callback): Print DIE offset in error messages.
584 2017-11-03 Mark Wielaard <mark@klomp.org>
586 * readelf.c (print_ops): Handle DW_OP_GNU_variable_value. Print
587 referenced DIE as offset.
589 2017-09-10 Mark Wielaard <mark@klomp.org>
591 * ar.c (do_oper_delete): Remove DEBUG conditional check.
592 (no0print): Return bool. Check snprintf return value.
593 (do_oper_insert): Initialize elf. Remove DEBUG conditional check.
594 Check no0print calls succeed. Explicitly elf_end found elfs.
595 (do_oper_extract): Make sure we don't create an empty variable
598 2017-09-01 Mark Wielaard <mark@klomp.org>
600 * stack.c (main): Replace \v in doc string with \n\n.
601 * unstrip.c (main): Likewise.
603 2017-05-04 Ulf Hermann <ulf.hermann@qt.io>
605 * stack.c: Print pid_t using %lld.
607 2017-08-18 Ulf Hermann <ulf.hermann@qt.io>
609 * readelf.c: Hardcode the signal numbers for non-linux systems.
611 2017-07-26 Mark Wielaard <mark@klomp.org>
613 * readelf.c (print_debug_macro_section): Accept either version 4 or
614 version 5. Use DW_MACRO names instead of DW_MACRO_GNU names. Add
615 minimal support for DW_MACRO_define_sup, DW_MACRO_undef_sup,
616 DW_MACRO_import_sup, DW_MACRO_define_strx and DW_MACRO_undef_strx.
618 2017-07-26 Mark Wielaard <mark@klomp.org>
620 * readelf.c (dwarf_defaulted_string): New function.
621 (dwarf_defaulted_name): Likewise.
622 (attr_callback): Use dwarf_defaulted_name to get value of
625 2017-07-20 Mark Wielaard <mark@klomp.org>
627 * strip.c (handle_elf): Deal with data marker symbols pointing to
628 debug sections (they can be removed).
630 2017-07-14 Mark Wielaard <mark@klomp.org>
632 * strip (OPT_KEEP_SECTION): New define.
633 (options): Add documentation for remove-section. Add keep-section.
634 (struct section_pattern): New data type.
635 (keep_secs, remove_secs): New globals.
636 (add_pattern, free_sec_patterns, free_patterns, section_name_matches):
638 (main): Call free_patterns.
639 (parse_opt): Handle 'R' and OPT_KEEP_SECTION. Check remove_comment
641 (handle_elf): Handle and sanity check keep_secs and remove_secs.
643 2017-06-07 Mark Wielaard <mark@klomp.org>
645 * strip.c (handle_elf): Introduce new handle_elf boolean. Use it to
646 determine whether to create an output and/or debug file. Remove new
647 output file on error.
649 2017-06-06 Mark Wielaard <mark@klomp.org>
651 * strip.c (handle_elf): Assume e_shstrndx section can be removed.
653 2017-04-20 Ulf Hermann <ulf.hermann@qt.io>
655 * readelf.c: Include strings.h.
657 2017-04-20 Ulf Hermann <ulf.hermann@qt.io>
659 * unstrip.c: Check shnum for 0 before subtracting from it.
661 2017-04-20 Ulf Hermann <ulf.hermann@qt.io>
663 * readelf.c: Replace YESSTR and NOSTR with gettext ("yes") and
664 gettext ("no"), respectively.
666 2017-04-05 Mark Wielaard <mark@klomp.org>
668 * elflint.c (check_elf_header): Decompress all sections.
670 2017-03-28 Mark Wielaard <mark@klomp.org>
672 * elflint (check_group): Don't check if there is no flag word.
674 2017-03-27 Mark Wielaard <mark@klomp.org>
676 * elflint.c (check_elf_header): Sanity check phnum and shnum.
678 2017-03-27 Mark Wielaard <mark@klomp.org>
680 * elflint.c (check_sysv_hash): Return early if section size is
682 (check_sysv_hash64): Likewise.
683 (check_hash): Calculate expect_entsize to check section size.
685 2017-03-27 Mark Wielaard <mark@klomp.org>
687 * elflint.c (check_symtab_shndx): Check data->d_size.
689 2017-03-24 Mark Wielaard <mjw@redhat.com>
691 * elfcmp.c (main): If n_namesz == 0 then the note name data is the
693 * readelf.c (handle_notes_data): Likewise.
695 2017-03-24 Mark Wielaard <mjw@redhat.com>
697 * readelf.c (handle_gnu_hash): Check inner < max_nsyms before
698 indexing into chain array.
700 2017-02-16 Ulf Hermann <ulf.hermann@qt.io>
702 * addr2line.c: Include printversion.h
704 * elflint.c: Likewise.
706 * objdump.c: Likewise.
707 * ranlib.c: Likewise.
708 * readelf.c: Likewise.
711 * strings.c: Likewise.
713 * elfcmp.c: Include printversion.h, remove system.h include.
714 * elfcompress.c: Likewise.
715 * findtextrel.c: Likewise.
716 * unstrip.c: Likewise.
718 2017-02-14 Ulf Hermann <ulf.hermann@qt.io>
720 * nm.c: Include color.h.
721 * objdump.c: Likewise.
723 2016-12-24 Mark Wielaard <mark@klomp.org>
725 * Makefile.am (findtextrel_LDADD): Add $(libeu).
726 (addr2line_LDADD): Likewise.
727 (elfcmp_LDADD): Likewise.
728 * addr2line.c (print_version): Removed.
729 * ar.c (print_version): Likewise.
730 * elfcmp.c (print_version): Likewise.
731 * elfcompress.c (print_version): Likewise.
732 * elflint.c (print_version): Likewise.
733 * findtextrel.c (print_version): Likewise.
734 * nm.c (print_version): Likewise.
735 * objdump.c: Likewise.
736 * ranlib.c: Likewise.
737 * readelf.c: Likewise.
740 * strings.c: Likewise.
742 * unstrip.c: Likewise.
744 2016-11-17 Mark Wielaard <mjw@redhat.com>
746 * readelf.c (options): Add optional arg SECTION for symbols.
747 (symbol_table_section): New static variable.
748 (parse_opt): Set symbol_table_section on 's'.
749 (print_symtab): Filter on symbol_table_section name is set.
751 2016-11-10 Mark Wielaard <mjw@redhat.com>
753 * ar.c (write_member): Make sure tmpbuf is large enough to contain
754 a starting '/' and ending '\0' char.
755 (do_oper_insert): Likewise.
756 * arlib.c (arlib_finalize): Format tmpbuf as PRId32 decimal.
758 2016-11-02 Mark Wielaard <mjw@redhat.com>
760 * addr2line.c (handle_address): Add fallthrough comment.
761 * elfcompress.c (parse_opt): Adjust fallthrough comment.
762 * elflint.c (parse_opt): Add missing break after 'd' case.
763 (check_sections): Add fallthrough comments.
764 * objdump.c (parse_opt): Add explantion for fallthrough comment.
766 2016-10-22 Kevin Cernekee <cernekee@chromium.org>
768 * unstrip.c: Fix "invalid string offset" error caused by using the
769 unstripped .symtab with the stripped .strtab.
771 2016-10-11 Akihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>
773 * arlib.c: Remove system.h include, add libeu.h include.
774 * arlib2.c: Remove sys/param.h include.
775 * elfcompress.c: Add libeu.h include.
776 * elflint.c: Remove sys/param.h include, add libeu.h include.
778 * objdump.c: Likewise.
779 * ranlib.c: Likewise.
780 * readelf.c: Likewise.
781 * size.c: Remove sys/param.h include.
782 * strings.c: Likewise, add libeu.h include.
784 * unstrip.c: Likewise.
786 2016-10-06 Mark Wielaard <mjw@redhat.com>
788 * strip.c (handle_elf): Don't remove real symbols from allocated
791 2016-08-25 Mark Wielaard <mjw@redhat.com>
793 * strip.c (handle_elf): Recompress with ELF_CHF_FORCE.
795 2016-08-06 Mark Wielaard <mjw@redhat.com>
797 * strip.c (handle_elf): Uncompress and recompress relocation target
798 section if necessary.
800 2016-07-08 Mark Wielaard <mjw@redhat.com>
802 * Makefile.am (strip_LDADD): Add libdw.
803 * elfcompress.c (process_file): Use dwelf_strtab functions instead of
805 * strip.c (handle_elf): Likewise.
806 * unstrip.c (new_shstrtab): Likewise.
808 2016-07-06 Mark Wielaard <mjw@redhat.com>
810 * elf32-i386.script, i386_ld.c, ld.c, ld.h, ldgeneric.c, ldlex.l,
811 ldscript.y, libld_elf_i386.map, none_ld.c, sectionhash.c,
812 sectionhash.h, symbolhash.c, symbolhash.h, unaligned.h,
813 versionhash.c, versionhash.h, xelf.h: Removed.
814 * Makefile.am (YACC): Removed.
815 (AM_YFLAGS): Removed.
816 (AM_LFLAGS): Removed.
817 (native_ld): Removed.
819 (bin_PROGRAMS): Removed ld.
821 (ld_SOURCES): Removed.
822 (noinst_LIBRARIES): Only libar.a.
823 (EXTRA_DIST): Just arlib.h and debugpred.h.
825 (ld_LDFLAGS): Removed.
827 (ldscript.h): Removed.
829 (CLEANFILES): Just *.gconv.
830 (MAINTAINERCLEANFILES): Removed.
832 2016-07-06 Mark Wielaard <mjw@redhat.com>
834 * unstrip.c (copy_elided_sections): Use unstripped_strent[] from
835 index zero, instead of one.
837 2016-06-28 Richard Henderson <rth@redhat.com>
839 * elflint.c (valid_e_machine): Add EM_BPF.
841 2016-04-11 David Abdurachmanov <davidlt@cern.ch>
843 * elfcmp.c (main): Fix self-comparison error with GCC 6.
845 2016-03-21 Mark Wielaard <mjw@redhat.com>
847 * nm.c (show_symbols): Check for malloc size argument overflow.
849 2016-02-13 Mark Wielaard <mjw@redhat.com>
851 * readelf.c (print_scngrp): Call error when gelf_getshdr fails.
852 (print_symtab): Likewise.
853 (handle_hash): Likewise.
854 (dump_data_section): Print a warning if decompressing fails.
855 (print_string_section): Likewise.
857 2016-02-13 Mark Wielaard <mjw@redhat.com>
859 * elfcompress.c (parse_opt): Don't fallthrough after processing -q.
861 2016-02-12 Mark Wielaard <mjw@redhat.com>
863 * strip.c (handle_elf): Correct elf_assert shndxdata check.
865 2016-02-09 Mark Wielaard <mjw@redhat.com>
867 * readelf.c (read_encoded): Move up.
868 (print_cfa_program): Add encoding argument. Use it for read_encoded
869 when reading DW_CFA_set_loc op.
870 (print_debug_frame_section): Pass fde_encoding to print_cfa_program.
872 2016-02-09 Mark Wielaard <mjw@redhat.com>
874 * elflint.c (compare_hash_gnu_hash): Check hash sh_entsize against
875 sizeof (Elf64_Xword). Correct invalid sh_entsize error message
876 section idx and name.
878 2016-01-13 Mark Wielaard <mjw@redhat.com>
880 * elflint.c (check_elf_header): Recognize ELFOSABI_FREEBSD.
882 2016-01-08 Mark Wielaard <mjw@redhat.com>
884 * elfcompress.c (compress_section): Use %zu to print size_t.
885 * readelf.c (print_shdr): Use %zx to print size_t.
887 2015-12-16 Mark Wielaard <mjw@redhat.com>
889 * elfcompress.c: New file.
890 * Makefile.am (bin_PROGRAMS): Add elfcompress.
891 (elfcompress_LDADD): New variable.
893 2015-12-18 Mark Wielaard <mjw@redhat.com>
895 * elflint.c (section_flags_string): Add NEWFLAG COMPRESSED.
896 (check_sections): SHF_COMPRESSED can be on any special section.
897 SHF_COMPRESSED is a valid section flag. SHF_COMPRESSED cannot
898 be used together with SHF_ALLOC or with SHT_NOBITS. Should have
901 2015-10-20 Mark Wielaard <mjw@redhat.com>
903 * readelf.c (options): Expand -z help text.
904 (dump_data_section): Check whether we need and can decompress section
905 data and call elf_rawzdata if so,
906 (print_string_section): Likewise.
907 (elf_contains_chdrs): New function.
908 (process_elf_file): Rename print_unrelocated to print_unchanged,
909 use elf_contains_chdrs.
910 (print_scngrp): Check whether section is compressed before use.
911 (print_symtab): Likewise.
912 (handle_hash): Likewise.
914 2015-10-16 Mark Wielaard <mjw@redhat.com>
916 * readelf.c (argp_option): Describe --decompress,-z.
917 (print_decompress): New bool.
918 (parse_opt): Handle -z.
919 (elf_ch_type_name): New function.
920 (print_shdr): Print section compress information.
922 2015-12-31 Mark Wielaard <mjw@redhat.com>
924 * elflint.c (check_symtab): Add _edata and _end (plus extra underscore
925 variants) to to the list of possibly dangling symbols.
927 2015-12-02 Mark Wielaard <mjw@redhat.com>
929 * nm.c (process_file): Accept fd and pass it on.
930 (handle_elf): Likewise.
931 (find_no_debuginfo): New.
932 (struct getdbg): Likewise.
933 (getdbg_dwflmod): Likewise.
934 (show_symbols): Take fd. If the file is ET_REL use libdwfl to get
937 2015-12-02 Mark Wielaard <mjw@redhat.com>
939 * nm.c (get_local_names): Check for duplicates in local_root tree.
941 2015-12-02 Mark Wielaard <mjw@redhat.com>
943 * unstrip.c (struct data_list): New.
944 (new_data_list): Likewise.
945 (record_new_data): Likewise.
946 (free_new_data): Likewise.
947 (adjust_relocs): Call record_new_data.
948 (add_new_section_symbols): Likewise.
949 (copy_elided_sections): Call free_new_data.
951 2015-12-01 Mark Wielaard <mjw@redhat.com>
953 * elfcmp.c (main): Close ebl1 and ebl2 backends.
955 2015-10-16 Mark Wielaard <mjw@redhat.com>
957 * Makefile.am [BUILD_STATIC](libdw): Add -lz.
958 [BUILD_STATIC](libelf): Likewise.
960 2015-10-16 Mark Wielaard <mjw@redhat.com>
962 * elflint.c (check_symtab): Don't check TLS symbol value against TLS
963 phdr offset in debuginfo files.
964 (check_sections): Don't try to match section offsets to phdrs offsets
967 2015-10-16 Mark Wielaard <mjw@redhat.com>
969 * elflint.c (check_reloc_shdr): Reject only desthdrs if they have both
970 SHF_MERGE and SHF_STRINGS set.
972 2015-10-13 Jose E. Marchesi <jose.marchesi@oracle.com>
974 * elflint.c (check_sections): Do not rely on
975 ebl_check_special_section when checking debuginfo files. Also
976 check that the type of WE sections in debuginfo files is NOBITS.
978 2015-10-13 Mark Wielaard <mjw@redhat.com>
980 * elflint.c (check_program_header): Check relro flags are a subset
981 of the load segment if they don't fully overlap.
983 2015-10-07 Mark Wielaard <mjw@redhat.com>
985 * Makefile.am (ldlex_no_Wstack_usage): New.
986 * ldlex.l ([RWX]): Make cnt unsigned.
988 2015-10-09 Josh Stone <jistone@redhat.com>
990 * elflint.c (main): Replace stat64 and fstat64 with stat and fstat.
991 * readelf.c (process_file): Likewise.
992 (process_elf_file): Replace off64_t with off_t.
993 * findtextrel.c (process_file): Replace open64 with open.
994 * ld.c (main): Replace sizeof (off64_t) with 8.
995 * strings.c: Replace off64_t with off_t throughout.
996 (main): Replace stat64 and fstat64 with stat and fstat.
997 (map_file): Replace mmap64 with mmap.
998 (read_block): Likewise, and replace lseek64 with lseek.
999 * strip.c (handle_elf): Replace ftruncate64 with ftruncate.
1000 (process_file): Replace stat64 and fstat64 with stat and fstat.
1001 * unstrip.c (parse_opt): Replace stat64 with stat.
1002 (handle_file): Replace open64 with open.
1003 (open_file): Likewise.
1005 2015-10-08 Chih-Hung Hsieh <chh@google.com>
1007 * ld.c (determine_output_format): Move recursive nested
1008 function "try" to file scope.
1010 2015-10-04 Mark Wielaard <mjw@redhat.com>
1012 * strip.c (handle_elf): Only sanity check section symbols to not
1013 kept discarded sections if we are creating a debug file.
1015 2015-10-07 Mark Wielaard <mjw@redhat.com>
1017 * unstrip.c (MAX): Removed.
1018 (find_alloc_sections_prelink): Allocate exact amount of bytes for
1021 2015-10-05 Chih-Hung Hsieh <chh@google.com>
1023 * unstrip.c (find_alloc_sections_prelink): Do not allocate
1024 on stack union types with variable length arrays; use xmalloc
1025 for such dynamic sized objects.
1026 * readelf.c (handle_core_item): Likewise, but use alloca
1027 for small variable size data object and add assert(count < 128).
1029 2015-10-05 Josh Stone <jistone@redhat.com>
1031 * Makefile.am (libld_elf_i386.so): Add AM_V_CCLD silencer.
1032 (.deps/none_ld.Po): Always silence the dummy command.
1033 (make-debug-archive): Add AM_V_GEN and AM_V_at silencers.
1035 2015-10-02 Mark Wielaard <mjw@redhat.com>
1037 * unstrip.c (copy_elided_sections): Use SH_INFO_LINK_P, not just
1040 2015-10-02 Mark Wielaard <mjw@redhat.com>
1042 * strip.c (handle_elf): Don't move around allocated NOBITS sections.
1043 Don't just mark the section header string table as unused.
1044 * unstrip.c (copy_elided_sections): Add header names to strtab if
1045 shstrndx equals the symtab strtabndx.
1047 2015-09-22 Mark Wielaard <mjw@redhat.com>
1049 * strip.c (cleanup_debug): Remove old-style function definitions.
1051 2015-09-09 Chih-Hung Hsieh <chh@google.com>
1053 * readelf.c (print_debug_exception_table): Initialize variable before
1054 it is used, because compiler does not know that error never returns.
1055 (dump_arhive_index): Likewise.
1057 2015-09-04 Chih-Hung Hsieh <chh@google.com>
1059 * elflint.c (check_group): Replace %Z length modifier with %z.
1060 (check_note_data): Likewise.
1061 * findtextrel.c (process_file): Likewise.
1062 * readelf.c (handle_dynamic): Likewise.
1063 (handle_symtab): Likewise.
1064 (handle_verneed): Likewise.
1065 (handle_verdef): Likewise.
1066 (handle_versym): Likewise.
1067 (print_hash_info): Likewise.
1068 (print_decoded_aranges_section): Likewise.
1069 (print_debug_aranges_section): Likewise.
1070 (print_debug_line_section): Likewise.
1071 (hex_dump): Likewise.
1072 (dump_data_section): Likewise.
1073 (print_string_section): Likewise.
1074 (dump_archive_index): Likewise.
1075 * unstrip.c (adjust_relocs): Likewise.
1076 (collect_symbols): likewise.
1077 (get_section_name): Likewise.
1078 (find_alloc_sections_prelink): Likewise.
1079 (copy_elided_sections): Likewise.
1080 * ldscript.y (add_id_list): Add missing '%s'.
1082 2015-09-03 Mark Wielaard <mjw@redhat.com>
1084 * readelf.c (handle_core_item): Handle right shift >= 32 bits.
1086 2015-08-11 Mark Wielaard <mjw@redhat.com>
1088 * elflint.c (check_sections): When gnuld and a NOBITS section falls
1089 inside a segment make sure any ELF file contents is zero.
1091 2015-07-29 Mark Wielaard <mjw@redhat.com>
1093 * unstrip.c (sections_flags_match): New function.
1094 (sections_match): Use sections_flags_match.
1095 (find_alloc_sections_prelink): Only clear matched sections if there
1097 (copy_elided_sections): Add SHF_INFO_LINK to shdr_mem.sh_flags if
1100 2015-06-27 Pino Toscano <toscano.pino@tiscali.it>
1102 * src/strings.c: Define MAP_POPULATE if not defined already.
1104 2015-06-27 Mark Wielaard <mjw@redhat.com>
1106 * nm.c (show_symbols): First call elf_getdata, then allocate memory.
1108 2015-06-18 Mark Wielaard <mjw@redhat.com>
1110 * findtextrel.c (process_file): Free segments after use.
1112 2015-06-18 Mark Wielaard <mjw@redhat.com>
1114 * readelf.c (print_phdr): Make sure phdr2_mem lifetime/scope equals
1117 2015-06-18 Mark Wielaard <mjw@redhat.com>
1119 * readelf.c (handle_gnu_hash): Free lengths on invalid_data.
1121 2015-06-18 Mark Wielaard <mjw@redhat.com>
1123 * elflint.c (check_symtab): Only check the PT_TLS phdr if it actually
1124 exists. Warn otherwise.
1126 2015-06-18 Mark Wielaard <mjw@redhat.com>
1128 * nm.c (show_symbols): Check sizeof (sym_mem[0]), not GElf_Sym to
1129 known whether or not we stack allocated memory.
1131 2015-06-18 Mark Wielaard <mjw@redhat.com>
1133 * strings.c (readelf): Use "<unknown>" if we cannot retrieve section
1136 2015-06-09 Mark Wielaard <mjw@redhat.com>
1138 * addr2line.c (print_dwarf_function): Always free scopes before
1141 2015-06-09 Mark Wielaard <mjw@redhat.com>
1143 * strip.c (handle_ar): Mark as unused.
1144 (process_file): Produce an error when trying to handle an ar.
1146 2015-05-30 Mark Wielaard <mjw@redhat.com>
1148 * elfcmp.c (main): Only call memcmp when d_size != 0.
1150 2015-05-23 Mark Wielaard <mjw@redhat.com>
1152 * Makefile.am: Define ldgeneric, readelf, nm, size, strip, elflint,
1153 findtextrel, elfcmp objdump, ranlib, ar and unstrip no_Wstack_usage.
1155 2015-05-21 Mark Wielaard <mjw@redhat.com>
1157 * addr2line.c (handle_address): Set scopes to NULL after free.
1159 2015-05-20 Mark Wielaard <mjw@redhat.com>
1161 * addr2line.c (OPT_PRETTY): New constant define.
1162 (argp_option): Add "pretty-print".
1163 (pretty): New static bool.
1164 (parse_opt): Set pretty.
1165 (print_dwarf_function): Adjust output when pretty is set.
1166 (print_addrsym): Likewise.
1167 (handle_address): Likewise.
1169 2015-05-20 Mark Wielaard <mjw@redhat.com>
1171 * Makefile.am (addr2line_LDADD): Add demanglelib.
1172 * addr2line.c (argp_option): Move demangle under output format.
1173 (demangle): New static bool.
1174 (demangle_buffer_len): New static size_t.
1175 (demangle_buffer): New static char *.
1176 (main): free demangle_buffer.
1177 (parse_opt): Set demangle.
1178 (symname): New static function.
1179 (get_diename): Use symname.
1180 (print_dwarf_function): Likewise.
1181 (print_addrsym): Likewise.
1182 (handle_address): Likewise.
1184 2015-05-20 Mark Wielaard <mjw@redhat.com>
1186 * addr2line.c (argp_option): Add "addresses", 'a'.
1187 (print_addresses): New static bool.
1188 (parse_opt): Set print_addresses.
1189 (get_addr_width): New static function.
1190 (handle_address): Print address if print_addresses is true.
1192 2015-05-20 Mark Wielaard <mjw@redhat.com>
1194 * addr2line.c (handle_address): Call strtoumax with base 16. Make
1195 sure all input has been processed.
1197 2015-05-20 Mark Wielaard <mjw@redhat.com>
1199 * addr2line (argp_option): Group 'section' under "Input format
1202 2015-05-12 Mark Wielaard <mjw@redhat.com>
1204 * strip.c (debug_fd): New static variable.
1205 (tmp_debug_fname): Likewise.
1206 (cleanup_debug): New function using the above to clean up temporary
1208 (INTERNAL_ERROR): Call cleanup_debug.
1209 (handle_elf): Use debug_fd and tmp_debug_fname statics and call
1210 cleanup_debug before any error. Use output_fname instead of fname in
1211 error messages when it exists (-o was given). SHT_NOBITS sections
1212 can also be moved freely even if SHF_ALLOC is set. Add various
1213 sanity checks. Use elf_assert instead of plain assert.
1215 2015-05-08 Mark Wielaard <mjw@redhat.com>
1217 * nm.c (show_symbols): Call gelf_fsize with EV_CURRENT.
1218 * strip.c (handle_elf): Likewise.
1220 2015-05-06 Mark Wielaard <mjw@redhat.com>
1222 * elflint.c (check_gnu_hash): Return early when 2nd hash function
1223 shift too big. Check there is enough data available. Make sure
1224 bitmask_words is not zero.
1225 (check_verdef): Use Elf64_Word for shdr->sh_info cnt.
1226 (check_verneed): Likewise.
1227 (check_attributes): Break when vendor name isn't terminated.
1228 Add overflow check for subsection_len.
1230 2015-05-05 Mark Wielaard <mjw@redhat.com>
1232 * nm.c (show_symbols): Handle dwarf_linesrc returning NULL.
1234 2015-05-04 Max Filippov <jcmvbkbc@gmail.com>
1236 * ar.c (do_oper_extract): Replace struct timeval with struct timespec
1237 and futimes with futimens.
1238 * strip.c (process_file): Replace struct timeval with struct timespec.
1239 (handle_elf, handle_ar): Replace struct timeval with struct timespec
1240 in prototype. Replace futimes with futimens.
1242 2015-05-04 Max Filippov <jcmvbkbc@gmail.com>
1244 * addr2line.c (main): Drop mtrace() call and #include <mcheck.h>.
1248 * objdump.c: Likewise.
1249 * ranlib.c: Likewise.
1251 * strip.c: Likewise.
1252 * unstrip.c: Likewise.
1254 2015-05-04 Anthony G. Basile <blueness@gentoo.org>
1256 * Makefile.am (readelf_LDADD, nm_LDADD, size_LDADD, strip_LDADD)
1257 (ld_LDADD, elflint_LDADD, findtextrel_LDADD, addr2line_LDADD)
1258 (elfcmp_LDADD, objdump_LDADD, ranlib_LDADD, strings_LDADD)
1259 (ar_LDADD, unstrip_LDADD, stack_LDADD): Append $(argp_LDADD).
1261 2015-03-22 Mark Wielaard <mjw@redhat.com>
1263 * readelf.c (print_debug_frame_section): Cast start to Dwarf_Off
1264 before subtracting cie_id. And cast cie_offset to Dwarf_Off before
1267 2015-03-22 Mark Wielaard <mjw@redhat.com>
1269 * readelf.c (print_gdb_index_section): Check all offsets used
1270 against section d_size.
1272 2015-03-17 Mark Wielaard <mjw@redhat.com>
1274 * readelf.c (print_debug): Don't return, but always use dummy_dbg.
1276 2015-03-17 Mark Wielaard <mjw@redhat.com>
1278 * readelf.c (print_gdb_index_section): Add overflow checking for
1281 2015-03-14 Mark Wielaard <mjw@redhat.com>
1283 * nm.c (INTERNAL_ERROR): Remove __DATE__.
1284 * objdump.c (INTERNAL_ERROR): Likewise.
1285 * size.c (INTERNAL_ERROR): Likewise.
1286 * strip.c (INTERNAL_ERROR): Likewise.
1288 2015-03-18 Petr Machata <pmachata@redhat.com>
1290 * readelf.c (dwarf_tag_string, dwarf_attr_string)
1291 (dwarf_form_string, dwarf_lang_string, dwarf_inline_string)
1292 (dwarf_encoding_string, dwarf_access_string)
1293 (dwarf_visibility_string, dwarf_virtuality_string)
1294 (dwarf_identifier_case_string, dwarf_calling_convention_string)
1295 (dwarf_ordering_string, dwarf_discr_list_string)
1296 (dwarf_locexpr_opcode_string): Adjust uses of know-dwarf.h macros
1297 to match the API changes.
1299 2015-03-09 Mark Wielaard <mjw@redhat.com>
1301 * elflint.c (compare_hash_gnu_hash): Correct gnu_symbias usage.
1303 2015-01-03 Mark Wielaard <mjw@redhat.com>
1305 * elfcmp (main): Check section name is not NULL. Check sh_entsize
1306 is not zero for symbol tables. Check phdrs are not NULL.
1307 (search_for_copy_reloc): Check sh_entsize is not zero.
1309 2014-12-30 Mark Wielaard <mjw@redhat.com>
1311 * elflint.c (check_scn_group): Check d_buf and name are not NULL.
1312 (is_rel_dyn): Check d is not NULL. Check shdr->sh_entsize is not
1314 (check_dynamic): Check strshdr is not NULL. Check d_tag is positive.
1315 (check_symtab_shndx): Check symshdr and data->d_buf are not NULL.
1316 Check shdr and symshdr sh_entsize are not zero.
1317 (check_gnu_hash): Make sure maskidx is smaller than bitmask_words.
1318 Check symshdr->sh_entsize is not zero. Check data->d_buf is not
1320 (compare_hash_gnu_hash): Check sections d_buf are not NULL.
1321 Check section data is large enough. Use gnu_symbias.
1322 (check_group): Check section val is valid.
1323 (has_copy_reloc): Check sh_entsize is not zero.
1324 (check_versym): Likewise.
1325 (unknown_dependency_p): Likewise.
1326 (check_verneed): Break on invalid ref or offset. Don't assert.
1327 Report error when next offset is zero, but more vers expected.
1328 (check_verdef): Likewise.
1329 (check_attributes): Make sure d_buf is not NULL.
1330 (check_note): Likewise.
1331 (check_note_section): Likewise.
1332 (check_program_header): Make sure section name is not NULL.
1334 2014-12-26 Mark Wielaard <mjw@redhat.com>
1336 * strings.c (read_elf): Produce error when section data falls outside
1339 2014-12-26 Mark Wielaard <mjw@redhat.com>
1341 * nm.c (show_symbols): Guard against divide by zero in error check.
1342 Add section index number in error message.
1344 2014-12-26 Mark Wielaard <mjw@redhat.com>
1346 * nm.c (handle_ar): Skip over /SYM64/ entries.
1348 2014-12-26 Mark Wielaard <mjw@redhat.com>
1350 * nm.c (handle_ar): Break on arsym with invalid offset.
1352 2014-12-20 Mark Wielaard <mjw@redhat.com>
1354 * readelf.c (print_debug_macinfo_section): Mark cus sentinel files
1355 as -1 non-existent. Check macoff against sentinel cus.
1357 2014-12-20 Mark Wielaard <mjw@redhat.com>
1359 * readelf.c (print_debug_exception_table): Add max_action overflow
1360 check. Check action_table_end before reading slib128. Check
1361 max_ar_filter underflow.
1363 2014-12-18 Ulrich Drepper <drepper@gmail.com>
1365 * Makefile.am: Suppress output of textrel_check command.
1367 2014-12-17 Mark Wielaard <mjw@redhat.com>
1369 * readelf.c (print_cfa_program): Add bounds check before each op that
1370 takes at least one argument.
1372 2014-12-16 Mark Wielaard <mjw@redhat.com>
1374 * readelf.c (print_decoded_line_section): Print dwarf_errmsg if
1375 dwarf_onesrcline or dwarf_linesrc fails.
1377 2014-12-16 Mark Wielaard <mjw@redhat.com>
1379 * readelf.c (print_debug_line_section): Correct overflow check for
1381 (print_debug_aranges_section): Correct overflow check for length.
1383 2014-12-15 Mark Wielaard <mjw@redhat.com>
1385 * readelf.c (notice_listptr): Return false if offset doesn't fit
1387 (attr_callback): Warn if loclist or rangelist offset doesn't fit.
1389 2014-12-15 Mark Wielaard <mjw@redhat.com>
1391 * readelf.c (print_ops): Don't assert when addr_size or ref_size
1392 is not 4 or 8, just report invalid data.
1394 2014-12-15 Mark Wielaard <mjw@redhat.com>
1396 * readelf.c (print_gdb_index_section): Add more bounds checks.
1398 2014-12-15 Mark Wielaard <mjw@redhat.com>
1400 * readelf.c (print_debug_line_section): Check there is enough room
1401 for DW_LNE_set_address argument. Make sure there is enough room
1402 for the the initial unit_length.
1404 2014-12-14 Mark Wielaard <mjw@redhat.com>
1406 * elflint.c (check_attributes): Call get_uleb128 with end pointer.
1407 * readelf.c (print_attributes): Likewise.
1408 (print_ops): Likewise and also for get_sleb128.
1409 (print_cfa_program): Likewise and add more readp bounds checks.
1410 (read_encoded): Likewise.
1411 (print_debug_frame_section): Likewise.
1412 (print_debug_line_section): Likewise.
1413 (print_debug_macinfo_section): Likewise.
1414 (print_debug_macro_section): Likewise.
1415 (print_debug_exception_table): Likewise.
1417 2014-12-16 Mark Wielaard <mjw@redhat.com>
1419 * elfcmp.c (compare_Elf32_Word): Make sure (unsigned) Elf32_Word
1420 difference doesn't wrap around before returning as int.
1422 2014-12-11 Mark Wielaard <mjw@redhat.com>
1424 * readelf.c (print_debug_exception_table): Check TType base offset
1425 and Action table are sane.
1427 2014-12-11 Mark Wielaard <mjw@redhat.com>
1429 * readelf.c (print_debug_frame_section): Check number of augmentation
1432 2014-12-09 Mark Wielaard <mjw@redhat.com>
1434 * readelf.c (handle_file_note): Check count fits data section and
1435 doesn't overflow fptr.
1437 2014-12-08 Mark Wielaard <mjw@redhat.com>
1439 * readelf.c (print_debug_exception_table): Report invalid data if
1440 action table doesn't immediately follow call site table.
1442 2014-12-10 Josh Stone <jistone@redhat.com>
1444 * addr2line.c (get_diename): New, get linkage_name or name.
1445 * addr2line.c (print_dwarf_function): Use get_diename.
1446 * addr2line.c (handle_address): Likewise.
1447 * addr2line.c (print_diesym): Removed.
1449 2014-12-10 Josh Stone <jistone@redhat.com>
1451 * addr2line.c (handle_address): Find the proper inline parents.
1453 2014-12-07 Mark Wielaard <mjw@redhat.com>
1455 * readelf.c (print_debug_line_section): max_ops_per_instr cannot
1458 2014-12-07 Mark Wielaard <mjw@redhat.com>
1460 * readelf.c (print_ops): Handle zero ref_size for DW_OP_call_ref
1461 and DW_OP_GNU_implicit_pointer.
1463 2014-12-04 Mark Wielaard <mjw@redhat.com>
1465 * objdump.c (show_relocs_x): Make sure destshdr exists.
1466 (show_relocs_rel): Don't rely on shdr->sh_entsize, use gelf_fsize.
1467 (show_relocs_rela): Likewise.
1468 (show_relocs): Make sure destshdr, symshdr and symdata exists.
1470 2014-11-30 Mark Wielaard <mjw@redhat.com>
1472 * readelf.c (handle_sysv_hash64): Fix overflow check.
1474 2014-11-28 Mark Wielaard <mjw@redhat.com>
1476 * readelf.c (handle_relocs_rel): Don't reuse destshdr to store
1477 section header of a relocation against a STT_SECTION symbol. Use
1478 a new local variable secshdr.
1479 (handle_relocs_rela): Likewise.
1481 2014-11-26 Mark Wielaard <mjw@redhat.com>
1483 * readelf.c (print_debug_aranges_section): Cast Dwarf_Word length
1484 to ptrdiff_t for comparison.
1486 2014-11-24 Mark Wielaard <mjw@redhat.com>
1488 * readelf.c (print_debug_line_section): Check line_range is not zero
1491 2014-11-23 Mark Wielaard <mjw@redhat.com>
1493 * readelf.c (print_debug_aranges_section): Check length to catch
1496 2014-11-21 Mark Wielaard <mjw@redhat.com>
1498 * readelf.c (print_attributes): Guard against empty section.
1499 Document attribute format. Break when vendor name isn't terminated.
1500 Add overflow check for subsection_len. Handle both gnu and non-gnu
1503 2014-11-22 Mark Wielaard <mjw@redhat.com>
1505 * elflint.c (check_sections): Call ebl_bss_plt_p without ehdr.
1506 * findtextrel.c (process_file): Use elf_getphdrnum.
1507 * readelf.c (process_elf_file): Remove redundant ehdr->e_phoff check.
1508 (print_phdr): Check phnum.
1509 * size.c (show_segments): Use elf_getphdrnum.
1510 * strip.c (handle_elf): Likewise.
1511 * unstrip.c (copy_elf): Likewise.
1512 (copy_elided_sections): Likewise.
1513 (handle_file): Likewise.
1515 2014-11-18 Mark Wielaard <mjw@redhat.com>
1517 * readelf.c (print_cfa_program): Fix sanity check of DW_FORM_block
1520 2014-11-17 Mark Wielaard <mjw@redhat.com>
1522 * readelf.c (handle_verneed): Check vna_next and vn_next exist.
1523 (handle_verdef): Check vda_next and vd_next exist.
1524 (handle_versym): Check vd_next, vna_next and vn_next exist.
1525 Check vername and filename are not NULL before use.
1527 2014-11-17 Mark Wielaard <mjw@redhat.com>
1529 * elfcmp.c (main): Check section names are NULL before use.
1530 * objdump.c (section_match): Likewise.
1531 * size.c (show_sysv): Likewise.
1533 2014-11-17 Mark Wielaard <mjw@redhat.com>
1535 * readelf.c (print_debug_frame_section): Warn if ptr_size is not 4
1536 or 8 instead of just calling print_cfa_program.
1538 2014-11-16 Mark Wielaard <mjw@redhat.com>
1540 * readelf (process_elf_file): Set phnum to zero if there aren't
1541 actually any pheaders.
1542 (print_phdr): Check there actually is a phdr.
1544 2014-11-16 Mark Wielaard <mjw@redhat.com>
1546 * readelf.c (print_cfa_program): Check block len before calling
1549 2014-11-14 Mark Wielaard <mjw@redhat.com>
1551 * readelf.c (print_debug_frame_section): Sanity Check CIE
1552 unit_length and augmentationlen.
1554 2014-11-14 Mark Wielaard <mjw@redhat.com>
1556 * readelf.c (handle_versym): Check def == NULL before use.
1558 2014-11-08 Mark Wielaard <mjw@redhat.com>
1560 * readelf.c (handle_versym): Initialize vername and filename array
1563 2014-11-07 Mark Wielaard <mjw@redhat.com>
1565 * readelf.c (handle_sysv_hash): Sanity check section contents.
1566 (handle_sysv_hash64): Likewise.
1567 (handle_gnu_hash): Likewise.
1569 2014-09-14 Petr Machata <pmachata@redhat.com>
1571 * readelf.c (handle_relocs_rela): Typo fix, test DESTSHDR properly.
1573 2014-09-12 Petr Machata <pmachata@redhat.com>
1575 * readelf.c (encoded_ptr_size): In the switch statement, change
1576 magic constants 3 and 4 to DW_EH_PE_* counterparts. Still accept
1577 0. Print diagnostic for anything else.
1579 2014-08-25 Josh Stone <jistone@redhat.com>
1581 * Makefile.am: Prevent premature @AR@ replacement in a sed expression.
1583 2014-07-04 Menanteau Guy <menantea@linux.vnet.ibm.com>
1584 Mark Wielaard <mjw@redhat.com>
1586 * elflint (check_symtab): Add ".TOC." to the list of possibly
1587 dangling symbols because of sourceware PR13621.
1589 2014-06-14 Mark Wielaard <mjw@redhat.com>
1591 * elflint (check_symtab): Use ebl_func_addr_mask on st_value.
1593 2014-05-27 Mark Wielaard <mjw@redhat.com>
1595 * readelf.c (print_debug): Skip section if name is NULL.
1597 2014-05-26 Mark Wielaard <mjw@redhat.com>
1599 * readelf.c (handle_relocs_rela): Print header like handle_relocs_rel
1600 does, when sh_info == 0.
1602 2014-05-26 Mark Wielaard <mjw@redhat.com>
1604 * unstrip.c (find_alloc_sections_prelink): Allow non-split .bss
1605 section when sh_size of the original and undo .bss section are equal.
1607 2014-05-26 Mark Wielaard <mjw@redhat.com>
1609 * unstrip.c (options): Add --force, -F.
1610 (struct arg_info): Add bool force.
1611 (parse_opt): Handle 'F', set force.
1612 (handle_explicit_files): Add force argument, add warn function,
1613 separate check ehdr field checks, use warn.
1614 (handle_dwfl_module): Add force argument, pass on to
1615 handle_explicit_files.
1616 (handle_output_dir_module): Add force argument, pass on to
1618 (handle_implicit_modules): Pass info->force to handle_dwfl_module and
1619 handle_output_dir_module.
1620 (main): Pass info.force to handle_explicit_files.
1622 2014-05-19 Mark Wielaard <mjw@redhat.com>
1624 * elflint.c (check_reloc_shdr): Check ebl_check_reloc_target_type.
1626 2014-05-01 Mark Wielaard <mjw@redhat.com>
1628 * readelf.c (find_no_debuginfo): Call dwfl_standard_find_debuginfo
1629 if looking for alternate debug file.
1631 2014-04-11 Mark Wielaard <mjw@redhat.com>
1633 * Makefile.am (AM_CPPFLAGS): Add -I libdwelf.
1635 2014-04-22 Mark Wielaard <mjw@redhat.com>
1637 * readelf.c (handle_core_item): Make sure variable length array
1638 contains at least enough space for terminating zero char.
1640 2014-04-22 Mark Wielaard <mjw@redhat.com>
1642 * readelf.c (print_gdb_index_section): Use unsigned int for 31 bits
1645 2014-03-13 Mark Wielaard <mjw@redhat.com>
1647 * Makefile.am: Remove no_mudflap.os. Remove libmudflap from all
1649 * strings.c (process_chunk): Remove _MUDFLAP condition.
1651 2014-04-09 Mark Wielaard <mjw@redhat.com>
1653 * readelf.c (print_debug_aranges_section): Don't get the raw section
1654 data, use the possibly decompressed .[z]debug sectiondata.
1655 (print_debug_ranges_section): Likewise.
1656 (print_debug_frame_section): Likewise.
1657 (print_debug_line_section): Likewise.
1658 (print_debug_loc_section): Likewise.
1659 (print_debug_macinfo_section): Likewise.
1660 (print_debug_macro_section): Likewise.
1662 2014-04-10 Mark Wielaard <mjw@redhat.com>
1664 * readelf.c (buf_read_ulong): Pass actual long size to convert.
1666 2014-03-05 Mark Wielaard <mjw@redhat.com>
1668 * readelf.c (attr_callback): Print DW_FORM_sdata values as signed
1671 2014-02-24 Mark Wielaard <mjw@redhat.com>
1673 * readelf (print_phdr): Check there is a SHT_PROGBITS section at the
1674 offset given by p_offsets for a PT_INTERP segment before trying to
1675 display the interpreter string.
1677 2014-02-07 Mark Wielaard <mjw@redhat.com>
1679 * readelf.c (print_phdr): Check phdr->p_filesz and make sure
1680 interpreter string is zero terminated before calling printf.
1682 2014-01-22 Mark Wielaard <mjw@redhat.com>
1684 * Makefile.am (nm_no_Wformat): Removed.
1685 (size_no_Wformat): Likewise.
1686 (strings_no_Wformat): Likewise.
1687 (addr2line_no_Wformat): Likewise.
1688 * size.c (show_sysv): Use fmtstr directly as literal in printf.
1689 (show_sysv_one_line): Likewise.
1690 * strings.c (locfmt): Removed.
1691 (radix): New static enum.
1692 (parse_opt): Set radix, not locfmt.
1693 (process_chunk_mb): Use fmtstr directly as literal in printf based
1695 (process_chunk): Likewise.
1696 * nm.c (show_symbols_sysv): Use fmtstr directly as literal in printf.
1697 (show_symbols_bsd): Likewise.
1698 (show_symbols_posix): Likewise.
1700 2014-01-21 Mark Wielaard <mjw@redhat.com>
1702 * stack.c (show_inlines): New static boolean.
1703 (print_frame): New function split out from...
1704 (print_frames): ..here. If show_inlines is true and we found a
1705 DIE for the frame address, call print_inline_frames otherwise
1706 call print_frame. Keep track of and track frame_nr.
1707 (print_inline_frames): New function.
1708 (parse_opt): Handle '-i'.
1709 (main): Add 'i' to options.
1711 2014-01-27 Mark Wielaard <mjw@redhat.com>
1713 * stack.c (maxframes): Initialize to 256.
1714 (main): Document new default in options. Document magic number
1715 used in frames.allocated initialization.
1717 2014-01-20 Mark Wielaard <mjw@redhat.com>
1719 * stack.c (show_debugname): New static boolean.
1720 (die_name): New function.
1721 (print_frames): If show_debugname is true set symname to the
1722 first function-like DIE with a name in scope for the address in
1724 (parse_opt): Handle '-d'.
1725 (main): Add 'd' to options.
1727 2014-01-20 Mark Wielaard <mjw@redhat.com>
1729 * addr2line.c (handle_address): Initialize scopes to NULL.
1731 2014-01-17 Roland McGrath <roland@redhat.com>
1733 * strip.c (handle_elf): Check for bogus values in sh_link, sh_info,
1734 st_shndx, e_shstrndx, and SHT_GROUP or SHT_SYMTAB_SHNDX data.
1735 Don't use assert on input values, instead bail with "illformed" error.
1737 2014-01-17 Roland McGrath <roland@redhat.com>
1739 * readelf.c (handle_dynamic, handle_symtab): Check for bogus sh_link.
1740 (handle_verneed, handle_verdef, handle_versym, handle_hash): Likewise.
1741 (handle_scngrp): Check for bogus sh_info.
1743 2014-01-17 Jakub Jelinek <jakub@redhat.com>
1745 * elflint.c (section_name): Return "<invalid>" instead of
1746 crashing on invalid section name.
1747 (check_symtab, is_rel_dyn, check_rela, check_rel, check_dynamic,
1748 check_symtab_shndx, check_hash, check_versym): Robustify.
1749 (check_hash): Don't check entries beyond end of section.
1750 (check_note): Don't crash if gelf_rawchunk fails.
1752 2014-01-17 Petr Machata <pmachata@redhat.com>
1754 * readelf.c (handle_dynamic, handle_relocs_rel)
1755 (handle_relocs_rela, handle_versym, print_liblist):
1756 Use gelf_fsize instead of relying on shdr->sh_entsize.
1758 2014-01-14 Mark Wielaard <mjw@redhat.com>
1760 * readelf.c (print_debug_macro_section): Clear vendor array before
1763 2014-01-15 Jan Kratochvil <jan.kratochvil@redhat.com>
1765 Fix corruption of non-C++ symbols by the demangler.
1766 * nm.c (show_symbols_sysv, show_symbols_bsd, show_symbols_posix)
1767 (show_symbols): Check for _Z.
1768 * stack.c (print_frames) <USE_DEMANGLE>: Check for _Z.
1770 2014-01-02 Mark Wielaard <mjw@redhat.com>
1772 * stack.c (show_raw): Declare unconditionally.
1773 (parse_opt): Handle '-r' unconditionally.
1774 (main): Show "raw" option even without USE_DEMANGLE.
1776 2014-01-02 Mark Wielaard <mjw@redhat.com>
1778 * stack.c (print_frames): Print 0x before build-id hex-offset.
1780 2014-01-02 Mark Wielaard <mjw@redhat.com>
1782 * stack.c (maxframes): Increase to 2048.
1783 (struct frames): Add allocated field.
1784 (frame_callback): If frames used is frames allocated, realloc.
1785 (print_frames): Show an error if maxframes has been reached.
1786 (parse_opt): Allow -n 0 for unlimited frames.
1787 (main): Document -n 0 and new default 2048 frames. Allocate initial
1788 number of frames with malloc.
1790 2013-12-30 Mark Wielaard <mjw@redhat.com>
1792 * stack.c (parse_opt): Explicitly call dwfl_linux_proc_attach
1793 or dwfl_core_file_attach and check for errors.
1795 2013-12-28 Mark Wielaard <mjw@redhat.com>
1797 * stack.c (print_frames): Remove address width code and use...
1798 (get_addr_width): ...this new function.
1799 (show_modules): New static boolean.
1800 (module_callback): New static function.
1801 (parse_opt): Handle '-l'.
1802 (main): Add 'l' to options. If show_modules then use dwfl_getmodules
1803 with module_callback to show all detected modules and possible
1804 build_id, elf and dwarf files.
1806 2013-12-27 Mark Wielaard <mjw@redhat.com>
1808 * stack.c (frames_shown): New static boolean.
1809 (EXIT_OK,EXIT_ERROR,EXIT_BAD,EXIT_USAGES): New defines.
1810 (frame_callback): Return -1 on error. Don't print error.
1811 (print_frames): Add arguments, tid, dwflerr and what. Print tid.
1812 If there was an error report it with address and module if possible.
1813 Record whether any frames were actually printed.
1814 (thread_callback): Collect tid and err, pass it to print_frames.
1815 (parse_opt): Use EXIT_BAD for errors. On ARGP_KEY_END print errno
1816 if dwfl_linux_proc_report returned it. Check whether we are properly
1817 attached with dwfl_pid.
1818 (main): Document exit status. Don't report DWARF_CB_ABORT from
1819 callbacks as error. Pass real errors to print_frames. Return
1820 EXIT_BAD if no frames could be shown. Return EXIT_ERROR if there
1821 were any non-fatal errors.
1823 2013-12-23 Mark Wielaard <mjw@redhat.com>
1825 * Makefile.am (stack_LDADD): Add demanglelib.
1826 * stack.c (show_quiet): New static boolean, default false.
1827 (show_raw): Likewise.
1828 (demangle_buffer_len): New static size_t.
1829 (demangle_buffer): New static char *.
1830 (print_frames): Don't resolve pc name if show_quiet. Demangle name
1832 (parse_opt): Handle '-q' and '-r'.
1833 (main): Add 'q' and 'r' to options. Free demangle_buffer.
1835 2013-12-23 Mark Wielaard <mjw@redhat.com>
1837 * stack.c (OPT_DEBUGINFO): New define.
1838 (OPT_COREFILE): Likewise.
1840 (core_fd): Likewise.
1843 (debuginfo_path): Likewise.
1844 (parse_opt): Handle '-p', '--core', '-e' and '--debuginfo-path'.
1845 Do argument sanity checking. Setup Dwfl.
1846 (main): Add 'p', 'core', 'e' and 'debuginfo-path' to options.
1847 Remove argp_child children, simplify argp doc, remove custom
1848 usage message and construction of dwfl with dwfl_standard_argp.
1849 Use pid directly as tid. close core and core_fd if opened. Print
1850 pid of process or core.
1852 2013-12-23 Mark Wielaard <mjw@redhat.com>
1854 * stack.c (show_build_id): New static boolean.
1855 (print_frames): Print module build-id, load address and pc offset
1856 if show_build_id is true.
1857 (parse_opt): Handle '-b'.
1858 (main): Add -b to options.
1860 2013-12-22 Mark Wielaard <mjw@redhat.com>
1862 * stack.c (maxframes): New static unsigned. Initialize to 64.
1863 (struct frame): New struct.
1864 (struct frames): Likewise.
1865 (dwfl): New static Dwfl pointer.
1866 (frame_callback): Use arg as struct frames and fill it next frame.
1867 Return DWARF_CB_ABORT when maxframes has been reached. Move
1868 printing of frame to...
1869 (print_frames): ...here. New function.
1870 (thread_callback): Use arg as struct frames and set frames to zero.
1872 (parse_opt): Handle '-n'.
1873 (main): Add -n to options. Allocate frames using maxframes. Pass
1874 frames to frame_callback and thread_callback.
1876 2013-12-20 Mark Wielaard <mjw@redhat.com>
1878 * stack.c (show_one_tid): New static boolean.
1879 (parse_opt): Handle '-1'.
1880 (main): Add -1 to options. Call dwfl_getthread_frames when
1881 show_one_tid is true.
1883 2013-12-18 Mark Wielaard <mjw@redhat.com>
1885 * addr2line.c (options): Add symbol-sections, 'x'.
1886 (show_symbol_sections): New static bool.
1887 (parse_opt): Handle 'x'.
1888 (print_addrsym): Use dwfl_module_addrinfo value.r
1889 Also show section of address with show_symbol_sections.
1890 (find_symbol): Use dwfl_module_getsym_info and set value.
1891 (handle_address): Request value and use it instead of sym.st_value.
1892 * readelf.c (format_dwarf_addr): Use dwfl_module_addrinfo to get
1895 2013-12-17 Masatake YAMATO <yamato@redhat.com>
1896 Mark Wielaard <mjw@redhat.com>
1898 * stack.c (show_activation, show_module, show_source): New variables.
1899 (parse_opt): Set show_activation if -a option is given.
1900 Set show_module if -m option is given. Set show_source if -s option
1901 is given. Set all show booleans when -v option is given.
1902 (main): Added `-a', `-m', `-s', and `-v' to the help message.
1903 (frame_callback): Print module and source file information.
1905 2013-11-25 Petr Machata <pmachata@redhat.com>
1907 * elflint.c (valid_e_machine): Add EM_AARCH64.
1909 2013-11-14 Petr Machata <pmachata@redhat.com>
1911 * readelf.c (handle_core_item) <'h'>: New branch for handling
1912 fields that shouldn't be displayed.
1914 2013-11-10 Mark Wielaard <mjw@redhat.com>
1916 * stack.c: Use ARGP_PROGRAM_VERSION_HOOK_DEF and
1917 ARGP_PROGRAM_BUG_ADDRESS_DEF.
1918 (print_version): New function.
1920 2013-11-09 Mark Wielaard <mjw@redhat.com>
1922 * arlib.c (arlib_init): Call snprintf before using the result
1924 (arlib_finalize): Likewise.
1925 * nm.c (show_symbols_sysv): Don't modify cnt inside assert.
1927 2013-11-07 Jan Kratochvil <jan.kratochvil@redhat.com>
1929 * Makefile.am (bin_PROGRAMS): Add stack.
1931 * stack.c: New file.
1933 2013-11-05 Mark Wielaard <mjw@redhat.com>
1935 * readelf.c (print_debug_ranges_section): Cast address to size_t
1937 (print_debug_loc_section): Likewise.
1939 2013-10-18 Mark Wielaard <mjw@redhat.com>
1941 * ar.c (main): Correct operation check when instance_specifed is set.
1943 2013-09-26 Petr Machata <pmachata@redhat.com>
1945 * readelf.c (handle_file_note): New function.
1946 (handle_notes_data): Call it to handle NT_FILE notes.
1948 2013-09-26 Petr Machata <pmachata@redhat.com>
1950 * readelf.c (handle_siginfo_note): New function.
1951 (handle_notes_data): Call it to handle NT_SIGINFO notes.
1952 (buf_read_int, buf_read_ulong, buf_has_data): New functions.
1954 2013-08-13 Mark Wielaard <mjw@redhat.com>
1956 * addr2line.c (options): Add "inlines", 'i'.
1957 (show_inlines): New bool.
1958 (parse_opt): Handle 'i'.
1959 (print_diesym): New static function.
1960 (print_src): New function taking code from...
1961 (handle_address): here. Call print_src. Print inlines.
1963 2013-08-12 Mark Wielaard <mjw@redhat.com>
1965 * addr2line.c (main): If there is a newline char at end of buf,
1968 2013-07-05 Mark Wielaard <mjw@redhat.com>
1970 * readelf.c (print_ops): Take CU as argument, use it to print
1971 parameter_ref DIE offset.
1972 (struct listptr): Replace base field with cu.
1973 (listptr_base): New function.
1974 (compare_listptr): Use listptr_base.
1975 (notice_listptr): Take CU as argument.
1976 (skip_listptr_hole): Likewise.
1977 (print_debug_ranges_section): Pass NULL as CU to skip_listptr_hole.
1978 (print_cfa_program): Pass NULL as CU to print_ops.
1979 (struct attrcb_args): Replace cu_base field with cu.
1980 (attr_callback): Pass cu not cu_base to notice_listptr.
1981 (print_debug_units): Don't calculate base, just set cu.
1982 (print_debug_loc_section): Pass cu to skip_listptr_hole and
1985 2013-05-06 Mark Wielaard <mjw@redhat.com>
1987 * readelf.c (print_ops): Format first DW_OP_GNU_implicit_pointer
1988 argument as DIE offset.
1990 2013-04-24 Mark Wielaard <mjw@redhat.com>
1992 * Makefile.am: Use AM_CPPFLAGS instead of INCLUDES.
1994 2013-03-25 Mark Wielaard <mjw@redhat.com>
1996 * readelf.c (argp_options): Add decodedline.
1997 (decodedline): New boolean initialized to false.
1998 (parse_opt): Set decodedline when arg is decodedline.
1999 (print_decoded_line_section): New function.
2000 (print_debug_line_section): Call print_decoded_line_section when
2001 decodedline is true.
2003 2013-03-25 Mark Wielaard <mjw@redhat.com>
2005 * readelf.c (argp_option): Add decodedaranges.
2006 (decodedaranges): New boolean initialized to false.
2007 (parse_opt): Set decodedaranges when arg is decodedaranges.
2008 (print_debug_aranges_section): Reimplemented and original
2009 implementation renamed to...
2010 (print_decoded_aranges_section): this.
2012 2013-03-25 Mark Wielaard <mjw@redhat.com>
2014 * readelf.c (attrcb_args): Add Dwarf_Die.
2015 (attr_callback): When highpc is in constant form also print as
2017 (print_debug_units): Set args.die.
2019 2013-03-19 Mark Wielaard <mjw@redhat.com>
2021 * readelf.c (print_gdb_index_section): Free format_dwarf_addr results.
2023 2013-03-18 Mark Wielaard <mjw@redhat.com>
2025 * readelf.c (print_gdb_index_section): Accept version 8.
2027 2013-03-01 Mark Wielaard <mjw@redhat.com>
2029 * findtextrel.c (process_file): Release ELF and close file when not
2030 text relocations are found.
2031 * strip.c (handle_elf): Track memory used for .debuglink section data
2034 2013-02-24 Mark Wielaard <mjw@redhat.com>
2036 * elflint.c (check_symtab): Add __bss_start__ to the list of symbols
2037 allowed to have out of section values because of GNU ld bugs.
2039 2013-02-06 Mark Wielaard <mjw@redhat.com>
2041 * elflint.c (check_symtab): Add __bss_start and __TMC_END__ to the
2042 list of symbols allowed to have out of section values because of
2043 GNU ld bugs in either .symtab or .dynsym, but only when they are
2046 2013-01-24 Mark Wielaard <mjw@redhat.com>
2048 * readelf.c (argp_option): Add unresolved-address-offsets, U.
2049 (print_unresolved_addresses): New static.
2050 (parse_opt): Handle 'U', set print_unprocessed_values.
2051 (format_dwarf_addr): Take and handle new raw argument.
2052 (print_ops): Call format_dwarf_addr with raw offset values.
2053 (print_debug_ranges_section): Likewise.
2054 (print_debug_frame_section): Likewise.
2055 (attr_callback): Likewise.
2056 (print_debug_line_section): Likewise.
2057 (print_debug_loc_section): Likewise.
2058 (print_gdb_index_section): Likewise.
2060 2013-01-18 Mark Wielaard <mjw@redhat.com>
2062 * readelf.c (struct listptr): Add base Dwarf_Addr field.
2063 (compare_listptr): Warn for same offset with different base.
2064 (notice_listptr): Take base argument and set it.
2065 (skip_listptr_hole): Likewise.
2066 (struct attrcb_args): Removed unused cu_offset field.
2067 Add cu_base Dwarf_Addr field.
2068 (attr_callback): Call notice_listptr with cbargs->cu_base.
2069 (print_debug_units): Set args.cu_base.
2070 (print_debug_ranges_section): Get base and use for format_dwarf_addr.
2071 (print_debug_loc_section): Likewise.
2073 2013-01-29 Jan Kratochvil <jan.kratochvil@redhat.com>
2075 * readelf.c (handle_core_items): Limit special repeated items handling
2076 to single-item formats '\n', 'b' and 'B', assert OFFSET 0 there.
2078 2012-12-18 Mark Wielaard <mark@bordewijk.wildebeest.org>
2080 * readelf.c (ELF_INPUT_SECTION): New argp key value.
2081 (argp_option): Add elf-section.
2082 (elf_input_section): New static.
2083 (parse_opt): Handle ELF_INPUT_SECTION and set elf_input_section.
2084 (open_input_section): New function.
2085 (process_file): Call open_input_section if elf_input_section set.
2087 2013-01-13 David Abdurachmanov <David.Abdurachmanov@cern.ch>
2089 ar.c (do_oper_delete): Fix num passed to memset.
2091 2012-12-21 Mark Wielaard <mjw@redhat.com>
2093 * readelf.c (print_debug_frame_section): Adjust FDE start address
2094 if pcrel before feeding it to format_dwarf_addr.
2096 2012-12-21 Mark Wielaard <mjw@redhat.com>
2098 * addr2line.c (main): Call dwfl_end.
2100 2012-12-11 Roland McGrath <roland@hack.frob.com>
2102 * nm.c (show_symbols_sysv): Fix size passed to snprintf for invalid
2104 Reported by David Abdurachmanov <David.Abdurachmanov@cern.ch>.
2106 2012-10-16 Mark Wielaard <mjw@redhat.com>
2108 * readelf.c (print_ops): DW_OP_skip and DW_OP_bra targets are
2109 calculated beginning after the operand and 2-byte constant.
2111 2012-10-12 Jan Kratochvil <jan.kratochvil@redhat.com>
2113 * readelf.c (ITEM_WRAP_COLUMN, REGISTER_WRAP_COLUMN): Merge to ...
2114 (WRAP_COLUMN): ... here.
2115 (print_core_item): Remove parameter format_max. Update function
2116 comment. Replace FORMAT_MAX by the real output width.
2117 (handle_core_item): Remove the FORMAT_MAX values in TYPES, DO_TYPE,
2118 calls of print_core_item, remove variable maxfmt, change
2119 ITEM_WRAP_COLUMN to WRAP_COLUMN.
2120 (handle_core_register): Remove the FORMAT_MAX values in TYPES, BITS,
2121 calls of print_core_item, change REGISTER_WRAP_COLUMN to WRAP_COLUMN.
2123 2012-10-11 Jan Kratochvil <jan.kratochvil@redhat.com>
2125 * readelf.c (handle_core_item) <b>: Make run an outer block variable.
2126 Increase run only if LASTBIT != 0. Print last element only if RUN > 0.
2128 2012-08-27 Mark Wielaard <mjw@redhat.com>
2130 * readelf.c (print_debug_macro_section): Print offset as PRIx64.
2132 2012-08-27 Mark Wielaard <mjw@redhat.com>
2134 * readelf.c (register_info): Handle loc == NULL.
2136 2012-08-22 Jeff Kenton <jkenton@tilera.com>
2138 * elflint.c (valid_e_machine): Add EM_TILEGX and EM_TILEPRO.
2140 2012-08-16 Mark Wielaard <mjw@redhat.com>
2142 * readelf.c (dwarf_tag_name): Renamed from dwarf_tag_string.
2143 Uses new dwarf_tag_string or adds ??? or lo_user+%#x when
2145 (dwarf_attr_name): Likewise.
2146 (dwarf_form_name): Likewise.
2147 (dwarf_lang_name): Likewise.
2148 (dwarf_inline_name): Likewise.
2149 (dwarf_encoding_name): Likewise.
2150 (dwarf_access_name): Likewise.
2151 (dwarf_visibility_name): Likewise.
2152 (dwarf_virtuality_name): Likewise.
2153 (dwarf_identifier_case_name): Likewise.
2154 (dwarf_calling_convention_name): Likewise.
2155 (dwarf_ordering_name): Likewise.
2156 (dwarf_discr_list_name): Likewise.
2157 (print_ops): Remove KNOWN. Use dwarf_locexpr_opcode_string.
2158 (attr_callback): Call new dwarf_foobar_name instead of old
2159 dwarf_foobar_string functions.
2160 (dwarf_tag_string): New function using known-dwarf.h macros.
2161 (dwarf_attr_string): Likewise.
2162 (dwarf_form_string): Likewise.
2163 (dwarf_lang_string): Likewise.
2164 (dwarf_inline_string): Likewise.
2165 (dwarf_encoding_string): Likewise.
2166 (dwarf_access_string): Likewise.
2167 (dwarf_visibility_string): Likewise.
2168 (dwarf_virtuality_string): Likewise.
2169 (dwarf_identifier_case_string): Likewise.
2170 (dwarf_calling_convention_string): Likewise.
2171 (dwarf_ordering_string): Likewise.
2172 (dwarf_discr_list_string): Likewise.
2173 (dwarf_locexpr_opcode_string): Likewise.
2175 2012-06-27 Mark Wielaard <mjw@redhat.com>
2177 * readelf.c (dwarf_form_string): Handle DW_FORM_GNU_ref_alt and
2178 DW_FORM_GNU_strp_alt.
2179 (attr_callback): Likewise.
2181 2012-07-30 Petr Machata <pmachata@redhat.com>
2183 * nm.c (show_symbols_bsd): Reorder arguments in {S,}FMTSTRS (and
2184 corresponding printf) so that those that are referenced by only
2185 one of the formatting strings are at the end.
2187 2012-07-29 Mark Wielaard <mjw@redhat.com>
2189 * readelf.c (dwarf_lang_string): Use DW_LANG_ObjC, not DW_LANG_Objc.
2190 (print_ops): Use known[op], not op_name, for DW_OP_GNU_parameter_ref.
2192 2012-07-19 Mark Wielaard <mjw@redhat.com>
2194 * readelf.c (print_ops): Handle DW_OP_GNU_parameter_ref.
2196 2012-07-11 Mark Wielaard <mjw@redhat.com>
2198 * readelf.c (options): Add macro to help of debug-dump.
2199 (section_e): Add section_macro.
2200 (section_all): Add section_macro.
2201 (parse_opt): Handle macro.
2202 (print_debug_macro_section): New function.
2203 (print_debug): Add NEW_SECTION (macro).
2205 2012-07-10 Mark Wielaard <mjw@redhat.com>
2207 * readelf.c (print_gdb_index_section): Add version 7 support.
2208 Keep track of cu_nr. Print kind and static/global flag for each
2209 symbol. When a symbol is in the TU list add 'T'.
2211 2012-06-26 Mark Wielaard <mjw@redhat.com>
2213 * readelf.c (dwarf_attr_string): Add DW_AT_GNU_macros.
2215 2012-06-22 Mark Wielaard <mjw@redhat.com>
2217 * readelf.c (print_ops): Cast printf PRIu/x64 arguments to uint64_t
2218 for gcc 4.7 -Wformat.
2220 2012-05-09 Roland McGrath <roland@hack.frob.com>
2222 * elflint (check_sections): Allow zero sized sections at (filesz) end
2223 of segment. And make check overflow-proofed.
2225 2012-04-24 Mark Wielaard <mjw@redhat.com>
2227 * readelf.c (print_ops): Add DW_OP_GNU_push_tls_address,
2228 DW_OP_GNU_uinit and DW_OP_GNU_encoded_addr.
2230 2012-03-28 Roland McGrath <roland@hack.frob.com>
2232 * elflint.c (special_sections): Accept SHF_INFO_LINK for reloc sections.
2234 2012-03-28 Mark Wielaard <mjw@redhat.com>
2236 * readelf.c (print_debug_abbrev_section): Check there is Dwarf
2238 (print_debug_str_section): Likewise.
2240 2012-03-21 Mark Wielaard <mjw@redhat.com>
2242 * readelf.c (print_gdb_index_section): Accept version 6.
2244 2012-01-31 Mark Wielaard <mjw@redhat.com>
2246 * readelf.c (attr_callback): Don't special case DW_FORM_sec_offset.
2248 2012-01-21 Ulrich Drepper <drepper@gmail.com>
2250 * addr2line.c: Update copyright year.
2252 * elfcmp.c: Likewise.
2253 * elflint.c: Likewise.
2254 * findtextrel.c: Likewise.
2257 * objdump.c: Likewise.
2258 * ranlib.c: Likewise.
2259 * readelf.c: Likewise.
2261 * strings.c: Likewise.
2262 * strip.c: Likewise.
2263 * unstrip.c: Likewise.
2265 * nm.c (argp_children): Define.
2266 (argp): Hook up argp_children.
2267 (handle_ar): Optimize puts call.
2268 (show_symbols_bsd): Use positional parameters to also print color
2269 codes. Don't print STT_FILE symbols.
2270 * objdump.c (options): Improve help text.
2271 (argp_children): Define.
2272 (argp): Hook up argp_children.
2273 (disasm_info): Add elements for color codes.
2274 (disasm_output): Print color codes as well.
2275 (show_disasm): Set up disasm_info data for callback.
2277 2012-01-20 Roland McGrath <roland@hack.frob.com>
2279 * arlib-argp.c (arlib_deterministic_output): Initialize from
2281 (help_filter): New function.
2284 * ar.c (main): Handle oper_none as usage error.
2286 * arlib-argp.c (options, parse_opt): Grok -U as inverse of -D.
2288 * ranlib.c (argp): Use arlib_argp_children.
2290 * arlib.c (arlib_init): Obey arlib_deterministic_output.
2292 * arlib-argp.c: New file.
2293 * Makefile.am (libar_a_SOURCES): Add it.
2294 * arlib.h (arlib_deterministic_output, arlib_argp_children):
2295 Declare new variables.
2296 * ar.c (deterministic_output): Variable removed.
2297 (do_oper_insert): Use arlib_deterministic_output instead.
2298 (options, parse_opt): Don't handle -D here. Add group numbers.
2299 (argp): Use arlib_argp_children.
2301 2011-12-20 Roland McGrath <roland@hack.frob.com>
2303 * readelf.c (print_debug): Initialize DUMMY_DBG.elf.
2304 Reported by Karel Klic <kklic@redhat.com>.
2306 2011-11-05 Roland McGrath <roland@hack.frob.com>
2308 * ar.c (deterministic_output): New flag variable.
2309 (options, parse_opt): Grok -D to set it.
2310 (do_oper_insert): When set, use zero from mtime, uid, and gid.
2312 * ar.c (do_oper_insert): Fix check on elf_rawfile return value.
2314 2011-10-04 Marek Polacek <mpolacek@redhat.com>
2316 * readelf.c (register_info): Assume the right size of an array.
2318 2011-10-03 Ulrich Drepper <drepper@gmail.com>
2320 * nm.c: Recognize option --mark-special. Still recognize --mark-weak
2321 but don't show it in help anymore.
2322 (mark_special): Renamed from mark_weak.
2323 (parse_opt): Adjust.
2324 (class_type_char): Take additional parameters for ELF file and ELF
2325 header. Treat TLS symbols like objects.
2326 In case of D symbols, show u for unique symbols, R for symbols in
2327 read-only sections, B for symbols in BSS sections.
2328 (show_symbols_bsd): Take additional parameters for ELF file and ELF
2329 header. Adjust for class_type_char change. Show TLS symbols with
2330 @ after them in case --mark-special is selected.
2331 (show_symbols_posix): Likewise.
2332 (show_symbols): Adjust calls to show_symbols_bsd and
2334 (show_symbols_sysv): Avoid printing adress and size for undefined
2335 symbols. Don't print initial special entry and section entries.
2337 2011-10-02 Ulrich Drepper <drepper@gmail.com>
2339 * Makefile.am (demanglelib): Define.
2340 (nm_LDADD): Add demanglelib.
2341 * nm.c (options): Add -C option.
2342 (demangle): Define as global variable.
2343 (parse_opt): Recognize -C.
2344 (show_symbols_sysv): Handle demangling.
2345 (show_symbols_bad): Likewise.
2346 (show_symbols_posix): Likewise.
2347 (show_symbols): Likewise.
2349 2011-07-09 Roland McGrath <roland@hack.frob.com>
2351 * readelf.c (options, parse_opt): Grok -W/--wide and ignore it.
2353 * ar.c (parse_opt): Grok -u.
2355 2011-05-30 Mark Wielaard <mjw@redhat.com>
2357 * strip.c (relocate): Make offset check overflow-proof.
2359 2011-05-23 Mark Wielaard <mjw@redhat.com>
2361 * strip.c (relocate): Take new arguments is_rela to indicate
2362 whether the relocation is from a SHT_REL or SHT_RELA section.
2363 Relocate against any debug section symbol, not just STT_SECTION
2364 symbols. For SHT_REL relocations, fetch addend from offset and
2365 add it to symbol value if not zero.
2367 2011-05-23 Mark Wielaard <mjw@redhat.com>
2369 * strip.c (OPT_RELOC_DEBUG): New option.
2370 (argp_option): Add new --reloc-debug-sections option.
2371 (main): Check new option.
2372 (parse_opt): Likewise.
2373 (handle_elf): Remove any relocations between debug sections
2374 in ET_REL for the debug file when requested.
2376 2011-05-18 Mark Wielaard <mjw@redhat.com>
2378 * strip.c (handle_elf): Make sure all sections of a removed group
2379 section are removed too. Don't discard SHT_GROUP sections, copy
2380 section table before it gets modified. Section group signature
2381 symbols don't have to be retained.
2383 2011-05-16 Jakub Jelinek <jakub@redhat.com>
2385 * readelf.c (print_ops): Handle DW_OP_GNU_const_type,
2386 DW_OP_GNU_regval_type, DW_OP_GNU_deref_type, DW_OP_GNU_convert
2387 and DW_OP_GNU_reinterpret.
2389 2011-05-17 Mark Wielaard <mjw@redhat.com>
2391 * readelf.c (dwarf_tag_string): Fixup DW_TAG_GNU_call_site and
2392 DW_TAG_GNU_call_site_parameter return strings.
2394 2011-05-11 Marek Polacek <mpolacek@redhat.com>
2396 * nm.c (show_symbols_sysv): Remove unused if/else, remove
2397 unused `prefix' and `fname' parameters.
2399 2011-05-07 Marek Polacek <mpolacek@redhat.com>
2401 * unstrip.c (compare_sections_nonrel): Mark this function as static.
2403 2011-04-26 Mark Wielaard <mjw@redhat.com>
2405 * readelf.c (handle_notes_data): Call ebl_object_note_type_name
2408 2011-04-14 Mark Wielaard <mjw@redhat.com>
2410 * readelf.c (options): Add gdb_index.
2411 (section_e): Define section_gdb_index.
2412 (parse_opt): Recognize gdb_index debug-dump argument.
2413 (print_gdb_index_section): New function.
2414 (print_debug): Add gdb_index to debug_sections.
2416 2011-03-24 Petr Machata <pmachata@redhat.com>
2418 * readelf.c (print_debug_line_section): Emit initial space for all
2419 opcode lines. Print offset in front of each opcode.
2421 2011-03-22 Marek Polacek <mpolacek@redhat.com>
2423 * readelf.c (handle_dynamic): Don't segfault at DT_PLTREL case.
2425 2011-03-22 Mark Wielaard <mjw@redhat.com>
2427 * readelf.c (dwarf_tag_string): Support DW_TAG_GNU_call_site
2428 and DW_TAG_GNU_call_site_parameter.
2429 (dwarf_attr_string): Support DW_AT_GNU_call_site_value,
2430 DW_AT_GNU_call_site_data_value,
2431 DW_AT_GNU_call_site_target,
2432 DW_AT_GNU_call_site_target_clobbered,
2433 DW_AT_GNU_tail_call,
2434 DW_AT_GNU_all_tail_call_sites,
2435 DW_AT_GNU_all_call_sites,
2436 and DW_AT_GNU_all_source_call_sites.
2437 (print_ops): Handle DW_OP_GNU_entry_value.
2438 (attr_callback): Handle DW_AT_GNU_call_site_value,
2439 DW_AT_GNU_call_site_data_value,
2440 DW_AT_GNU_call_site_target,
2441 and DW_AT_GNU_call_site_target_clobbered.
2443 2011-03-10 Mark Wielaard <mjw@redhat.com>
2445 * elflint.c (check_symtab): Use ebl_check_st_other_bits.
2447 2011-02-27 Jan Kratochvil <jan.kratochvil@redhat.com>
2449 * readelf.c (reset_listptr): Clear TABLE->TABLE.
2451 2011-02-25 Mark Wielaard <mjw@redhat.com>
2453 * readelf.c (dwarf_attr_string): Add DW_AT_GNU_* handling.
2454 (dwarf_form_string): Properly format and return unknown form.
2456 2011-02-23 Roland McGrath <roland@redhat.com>
2458 * readelf.c (section_name): New function.
2459 (print_debug_abbrev_section): Use it instead of constant.
2460 (print_debug_aranges_section): Likewise.
2461 (print_debug_ranges_section): Likewise.
2462 (print_debug_units): Likewise.
2463 (print_debug_line_section): Likewise.
2464 (print_debug_loc_section): Likewise.
2465 (print_debug_macinfo_section): Likewise.
2466 (print_debug_pubnames_section): Likewise.
2467 (print_debug_str_section): Likewise.
2468 (print_debug) [USE_ZLIB]: Match .zdebug_* sections too.
2469 (print_debug_abbrev_section): Use decoded d_size, not sh_size.
2470 (print_debug_str_section): Likewise.
2472 * readelf.c (dwarf_attr_string): Grok DW_AT_GNU_odr_signature.
2474 2011-02-11 Roland McGrath <roland@redhat.com>
2476 * elfcmp.c (verbose): New variable.
2477 (options, parse_opt): Grok -l/--verbose to set it.
2478 (main): Under -l, keep going after first difference.
2480 * elfcmp.c (ignore_build_id): New variable.
2481 (options, parse_opt): Grok --ignore-build-id to set it.
2482 (main): For SHT_NOTE sections, compare note details rather than raw
2483 bytes. Under --ignore-build-id, don't complain about differing build
2484 ID contents if lengths match.
2486 2011-02-08 Roland McGrath <roland@redhat.com>
2488 * ldscript.y (filename_id_star): Remove unused variable.
2490 * unstrip.c (copy_elided_sections): Remove unused variable.
2492 * elflint.c (check_dynamic): Remove unused variables.
2494 * elflint.c (check_symtab): Warn about missing xndx section only once.
2496 * ldgeneric.c (check_for_duplicate2): Remove unused variable.
2498 2011-01-06 Roland McGrath <roland@redhat.com>
2500 * strip.c (handle_elf): Under --strip-sections, remove all
2501 non-allocated sections and never generate .gnu_debuglink.
2503 2011-01-04 Roland McGrath <roland@redhat.com>
2505 * strip.c (remove_shdrs): New variable.
2506 (options, parse_opt): Grok --strip-sections to set it.
2507 (handle_elf): When that's set, truncate off .shstrtab and shdrs.
2509 2010-11-10 Roland McGrath <roland@redhat.com>
2511 * findtextrel.c (process_file): Don't assume order of sections.
2512 Reported by Mike Hommey <mh@glandium.org>.
2514 2010-07-26 Roland McGrath <roland@redhat.com>
2516 * readelf.c (print_ops): Handle DW_OP_GNU_implicit_pointer.
2518 2010-08-30 Roland McGrath <roland@redhat.com>
2520 Print .debug_loc/.debug_ranges with cognizance of actual DIE uses.
2521 * readelf.c (parse_opt): Add section_info to implicit_debug_sections
2523 (struct listptr, struct listptr_table): New types.
2524 (compare_listptr, reset_listptr, sort_listptr): New functions.
2525 (notice_listptr, skip_listptr_hole): New functions.
2526 (struct attrcb_args): Add silent member.
2527 (attr_callback): Call notice_listptr for loclistptr and rangelistptr.
2528 Suppress output if silent, but still call notice_listptr.
2529 (print_debug_units): Suppress output if section_info not requested.
2530 (print_debug_loc_section): Call sort_listptr, skip_listptr_hole.
2531 (print_debug_ranges_section): Likewise.
2532 (print_debug): Call reset_listptr on both tables.
2534 * readelf.c (print_debug_ranges_section): Print empty list.
2535 (print_debug_loc_section): Likewise.
2537 * readelf.c (print_debug_loc_section): Check for bogus length
2538 before calling print_ops.
2539 (print_ops): Check harder for bogus data that would read off end.
2541 2010-08-11 Roland McGrath <roland@redhat.com>
2543 * readelf.c (for_each_section_argument): Process all sections with
2544 matching name, not just the first.
2546 2010-07-26 Roland McGrath <roland@redhat.com>
2548 * readelf.c (print_ops): Take new argument for CU version.
2549 Fix DW_OP_call_ref decoding to depend on it.
2550 (print_debug_loc_section): Update caller.
2551 (print_cfa_program): Take new argument, pass it down.
2552 (print_debug_frame_section): Update caller.
2553 (struct attrcb_args): New member version.
2554 (print_debug_units): Initialize it.
2556 2010-07-02 Roland McGrath <roland@redhat.com>
2558 * readelf.c (print_debug_frame_section): Use format_dwarf_addr for
2561 2010-06-30 Roland McGrath <roland@redhat.com>
2563 * strings.c (main): Use STDIN_FILENO, not STDOUT_FILENO.
2564 Ignore st_size for a non-S_ISREG file descriptor.
2565 (read_block): Move assert after no-mmap bail-out.
2566 (read_block_no_mmap): Fix size calculations for moving buffer remnant.
2568 2010-06-22 Roland McGrath <roland@redhat.com>
2570 * readelf.c (print_debug_line_section): Fix braino in DW_LNS_set_isa.
2572 2010-06-21 Roland McGrath <roland@redhat.com>
2574 * readelf.c (dwarf_tag_string): Handle new v4 tags.
2575 (dwarf_attr_string): Add new attributes.
2576 (dwarf_tag_string): Handle DW_TAG_GNU_*.
2578 * readelf.c (print_ops): Use 64-bit types for LEB128 operands.
2579 (print_cfa_program): Likewise.
2581 2010-06-20 Roland McGrath <roland@redhat.com>
2583 * readelf.c (print_debug_units): New function, broken out of ...
2584 (print_debug_info_section): ... here. Call it.
2585 (print_debug_types_section): New function.
2586 (enum section_e): Add section_types alias for section_info.
2587 (print_debug): Add types to the sections table.
2589 * readelf.c (print_debug_frame_section): Handle version 4 format.
2591 * readelf.c (print_debug_line_section): Handle version 4 format.
2593 2010-06-14 Roland McGrath <roland@redhat.com>
2595 * unstrip.c (copy_elided_sections): Make sure all sections' data have
2596 been read in before we write anything out.
2598 2010-06-04 Roland McGrath <roland@redhat.com>
2600 * unstrip.c (update_shdr): New function.
2601 (update_sh_size): Call it instead of gelf_update_shdr.
2602 (adjust_relocs, add_new_section_symbols): Likewise.
2603 (new_shstrtab, copy_elided_sections): Likewise.
2605 * unstrip.c (copy_elided_sections): Bail if stripped file has more
2606 sections than unstripped file, rather than getting confused later.
2608 2010-06-01 Roland McGrath <roland@redhat.com>
2610 * readelf.c (dwarf_form_string): Handle DWARF 4 forms.
2611 (attr_callback): Handle DW_FORM_flag_present, DW_FORM_exprloc,
2612 DW_FORM_sec_offset, DW_FORM_ref_sig8.
2614 * readelf.c (print_debug): Don't bail if libdw setup fails.
2615 Suppress complaint if we only want .eh_frame anyway.
2617 2010-05-28 Ulrich Drepper <drepper@redhat.com>
2619 * readelf.c (attr_callback): Also print form information.
2621 2010-05-19 Roland McGrath <roland@redhat.com>
2623 * addr2line.c (find_symbol): Short-circuit on empty name.
2624 (handle_address): Handle SYMBOL with no +OFFSET.
2626 2010-05-08 Roland McGrath <roland@redhat.com>
2628 * readelf.c (print_ops): Take new arg OFFSET_SIZE.
2629 Use that for DW_OP_call_ref, not ADDRSIZE.
2630 (print_cfa_program): Update caller.
2631 (struct attrcb_args): Add offset_size field.
2632 (attr_callback): Use it for print_ops call.
2633 (print_debug_info_section): Initialize it.
2634 (print_ops): Likewise.
2636 2010-04-14 Roland McGrath <roland@redhat.com>
2638 * readelf.c (handle_core_item): Fix bitmask printing.
2640 2010-04-06 Roland McGrath <roland@redhat.com>
2642 * ld.c (options): Fix some typos in messages.
2643 * elflint.c (check_scn_group, check_group): Likewise.
2644 * ldscript.y (add_id_list): Likewise.
2645 * readelf.c (print_hash_info): Add xgettext:no-c-format magic comment
2646 before translated string containing a literal %.
2648 2010-02-26 Roland McGrath <roland@redhat.com>
2650 * readelf.c (process_file): Don't leak an fd in failure case.
2652 2010-02-15 Roland McGrath <roland@redhat.com>
2654 * Makefile.am: Use config/eu.am for common stuff.
2656 * readelf.c (print_debug_frame_section): Add a cast to avoid sign
2657 mismatch in comparison.
2659 2010-02-02 Roland McGrath <roland@redhat.com>
2661 * readelf.c (print_encoding_base): Handle DW_EH_PE_absptr (zero).
2662 (read_encoded): Likewise.
2663 (print_debug_frame_section): Check for bogus augmentation length.
2664 For P augmentation, use read_encoded, print the encoding description,
2665 and use hex for unsigned values.
2667 2010-01-15 Roland McGrath <roland@redhat.com>
2669 * ar.c: Include <sys/stat.h>.
2670 * elflint.c: Likewise.
2671 * readelf.c: Likewise.
2672 * strip.c: Likewise.
2673 * unstrip.c: Likewise
2675 2010-01-07 Roland McGrath <roland@redhat.com>
2677 * readelf.c (print_ehdr): Handle PN_XNUM.
2678 (phnum): New static variable.
2679 (process_elf_file): Set it with elf_getphdrnum.
2680 (print_phdr): Use phnum instead of EHDR->e_phnum.
2681 (print_dynamic, handle_notes): Likewise.
2682 (handle_relocs_rel, handle_relocs_rela): Likewise.
2684 * elfcmp.c (main): Use elf_getshdrnum and elf_getphdrnum.
2686 * elflint.c (phnum): New static variable.
2687 (check_elf_header): Set it, handling PN_XNUM.
2688 Use that in place of EHDR->e_phnum throughout.
2689 (check_symtab, check_reloc_shdr, check_dynamic): Likewise.
2690 (unknown_dependency_p, check_sections, check_program_header): Likewise.
2692 2010-01-05 Roland McGrath <roland@redhat.com>
2694 * readelf.c (dwarf_attr_string): Match DW_AT_GNU_vector and
2695 DW_AT_GNU_template_name.
2697 2010-01-04 Roland McGrath <roland@redhat.com>
2699 * readelf.c (handle_notes_data): Grab NT_AUXV only for name "CORE".
2700 (handle_core_note): Pass NHDR and NAME to ebl_core_note.
2701 (handle_core_item): Handle .format of '\n' as \n-separated strings.
2703 * readelf.c (implicit_debug_sections): New variable.
2704 (parse_opt): Set it instead of print_debug_sections for -a.
2705 OR them together for print_debug check.
2706 (print_debug): OR them together for section check.
2708 * readelf.c (options): Repartition into set implied by -a and others.
2709 Correct -a text to match reality.
2711 * readelf.c (struct section_argument): Add bool member 'implicit'.
2712 (parse_opt): Set it for -a cases, clear it for -x args.
2713 (for_each_section_argument): Don't complain about a missing section by
2714 name if it's implicit.
2716 2009-11-16 Roland McGrath <roland@redhat.com>
2718 * readelf.c (print_string_section): Punt SHT_NOBITS like empty
2719 sections, just as dump_data_section already does.
2721 2009-09-21 Ulrich Drepper <drepper@redhat.com>
2723 * elflint.c (special_sections): Allow MERGE and STRINGS flags to be
2724 set for .comment section.
2725 Patch by Mark Wielaard <mjw@redhat.com>.
2727 2009-09-08 Roland McGrath <roland@redhat.com>
2729 * ar.c (main): Fix typo in message format.
2731 2009-08-21 Roland McGrath <roland@redhat.com>
2733 * readelf.c (attr_callback): Use print_block only when we don't use
2736 2009-08-14 Roland McGrath <roland@redhat.com>
2738 * ar.c (do_oper_extract): Use pathconf instead of statfs.
2740 2009-08-01 Ulrich Drepper <drepper@redhat.com>
2742 * debugpred.h: Add two most const.
2744 2009-07-26 Mark Wielaard <mjw@redhat.com>
2746 * elflint.c (check_note_data): Recognize NT_GNU_GOLD_VERSION.
2748 2009-07-25 Mark Wielaard <mjw@redhat.com>
2750 * Makefile.am (addr2line_LDADD): Add $(libelf).
2752 2009-07-24 Roland McGrath <roland@redhat.com>
2754 * readelf.c (print_block): New function.
2755 (print_ops): Use it.
2756 (attr_callback): Use it for DW_FORM_block* forms.
2758 2009-07-20 Mark Wielaard <mjw@redhat.com>
2760 * readelf.c (print_ops): Add handling of DW_OP_implicit_value
2761 and DW_OP_stack_value.
2763 2009-07-14 Ulrich Drepper <drepper@redhat.com>
2765 * elflint.c (check_elf_header): Allow Linux ABI.
2766 (check_symtab): Handle STB_GNU_UNIQUE.
2768 2009-07-08 Mark Wielaard <mjw@redhat.com>
2770 * readelf.c (attr_callback): Handle DW_Form constants for
2771 DW_AT_data_member_location.
2773 2009-07-06 Roland McGrath <roland@redhat.com>
2775 * readelf.c (register_info): New function. Handle unknown register #s.
2776 (print_cfa_program): Use it.
2777 (handle_core_register, handle_core_registers): Likewise.
2779 2009-06-28 Roland McGrath <roland@redhat.com>
2781 * readelf.c (print_address_names): New static variable.
2782 (options, parse_opt): Grok -N/--numeric-addresses to clear it.
2783 (format_dwarf_addr): Don't look up name if !print_address_names.
2785 2009-06-13 Ulrich Drepper <drepper@redhat.com>
2787 * ldgeneric.c: Don't use deprecated libelf functions.
2789 * objdump.c: Likewise.
2790 * readelf.c: Likewise.
2792 * strip.c: Likewise.
2793 * unstrip.c: Likewise.
2794 * ld.h: Fix up comment.
2796 2009-06-01 Ulrich Drepper <drepper@redhat.com>
2798 * readelf.c (print_relocs): Expect ELF header argument and pass on
2799 to handle_relocs_rel* functions. Adjust caller.
2800 (handle_relocs_rel): Add ELF header argument. Add special case for
2801 the IRELATIVE relocations in statically linked executables.
2802 (handle_relocs_rela): Likewise.
2804 2009-04-29 Ulrich Drepper <drepper@redhat.com>
2806 * elflint.c (check_symtab): Add tests of st_other field.
2808 2009-04-23 Ulrich Drepper <drepper@redhat.com>
2810 * Makefile [BUILD_STATIC] (libdw): Add $(zip_LIBS).
2812 2009-04-20 Roland McGrath <roland@redhat.com>
2814 * addr2line.c (print_dwarf_function): Honor -s and -A for file names
2815 of inline call sites.
2817 * addr2line.c (just_section): New variable.
2818 (adjust_to_section): New function, broken out of ...
2819 (handle_address): ... here.
2820 (options, parse_opt): Add -j/--section=NAME to set it.
2822 2009-04-15 Roland McGrath <roland@redhat.com>
2824 * readelf.c (print_debug_frame_section): Check for DW_CIE_ID_64 in
2825 64-bit format header, DW_CIE_ID_32 in 32-bit format header.
2827 2009-04-14 Roland McGrath <roland@redhat.com>
2829 * readelf.c (print_attributes): Treat SHT_ARM_ATTRIBUTES on EM_ARM
2830 like SHT_GNU_ATTRIBUTES.
2832 * readelf.c (handle_core_registers): Fix error message.
2834 * strip.c (handle_elf: check_preserved): Don't note any change when
2835 .debug_data is already filled from a previous pass.
2837 2009-02-05 Ulrich Drepper <drepper@redhat.com>
2839 * objdump.c (show_relocs_x): Minor cleanups.
2841 * readelf.c (print_cfa_program): Correct a few labels.
2842 Print first DW_CFA_expression and DW_CFA_val_expression parameter
2845 2009-02-01 Ulrich Drepper <drepper@redhat.com>
2847 * objdump.c (show_relocs_rel, show_relocs_rela): Split common parts
2849 (show_relocs_x): ...here. New function.
2850 (show_relocs): Better spacing in output.
2852 * objdump.c (show_relocs_rela): Show offsets as signed values.
2854 * ar.c (main): Fix recognition of invalid modes for a, b, i modifiers.
2855 Improve some error messages.
2856 Use program_invocation_short_name instead of AR macro.
2857 * Makefile.am (CFLAGS_ar): Remove.
2858 * elflint.c (parse_opt): ARGP_HELP_EXIT_ERR does nothing for argp_help.
2859 * objdump.c (parse_opt): Likewise.
2860 * readelf.c (parse_opt): Likewise.
2862 2009-01-27 Roland McGrath <roland@redhat.com>
2864 * readelf.c (print_ops): Notice short length, don't overrun buffer
2865 (still need to fix LEB128).
2867 * readelf.c (print_ops): Fix DW_OP_call[24] decoding.
2869 * readelf.c (print_ops): Print (empty)\n when LEN == 0.
2871 2009-01-24 Ulrich Drepper <drepper@redhat.com>
2873 * readelf.c (print_debug_frame_section): Fix computation of vma_base
2874 for PC-relative mode.
2876 2009-01-23 Ulrich Drepper <drepper@redhat.com>
2878 * size.c (process_file): When handling archive, close file descriptor
2879 here. For unknown file format also close file descriptor.
2880 (handle_ar): Don't close file descriptor here.
2882 * readelf.c (parse_opt): Move code to add to dump_data_sections and
2883 string_sections list in local function add_dump_section. Adjust 'x'
2884 key handling. For 'a' key add .strtab, .dynstr, and .comment section
2885 to string_sections list.
2887 2009-01-22 Roland McGrath <roland@redhat.com>
2889 * readelf.c (print_phdr): Don't print section mapping when no sections.
2891 * Makefile.am (AM_CFLAGS): Pass -Wno-format for *_no_Wformat.
2893 * readelf.c (print_debug_frame_section): Initialize IS_SIGNED to false
2894 and reset it only for the 'true' cases.
2896 * Makefile.am (addr2line_no_Wformat): New variable.
2898 * readelf.c (print_debug_frame_section): Use t instead of j formats
2899 for ptrdiff_t OFFSET.
2901 2009-01-21 Ulrich Drepper <drepper@redhat.com>
2903 * elflint.c (check_program_header): Fix typo in .eh_frame_hdr section
2904 test. Handle debuginfo files.
2905 (check_exception_data): First sanity test.
2907 2009-01-17 Ulrich Drepper <drepper@redhat.com>
2909 * readelf.c (print_debug_exception_table): Show target of ar_disp
2912 * elflint.c (check_program_header): Add most consistency checks for
2913 PT_GNU_EH_FRAME entry.
2915 * addr2line.c: Use ARGP_PROGRAM_VERSION_HOOK_DEF and
2916 ARGP_PROGRAM_BUG_ADDRESS_DEF.
2918 * elfcmp.c: Likewise.
2919 * elflint.c: Likewise.
2920 * findtextrel.c: Likewise.
2923 * objdump.c: Likewise.
2924 * ranlib.c: Likewise.
2925 * readelf.c: Likewise.
2928 * strings.c: Likewise.
2929 * strip.c: Likewise.
2930 * unstrip.c: Likewise.
2932 2009-01-16 Ulrich Drepper <drepper@redhat.com>
2934 * elflint.c (check_program_header): Check that PT_GNU_EH_FRAME entry
2935 matches .eh_frame_hdr section, if it is available. Also check that
2936 the segment is allocated, not writable, not executable.
2938 * readelf.c: Add -e option. Dump exception and unwind related
2939 sections. Add -e to -a.
2940 (print_encoding_base): Handle DW_EH_PE_omit.
2941 (print_debug_exception_table): Beginning of support.
2942 (print_debug): Hook up print_debug_exception_table for
2943 .gcc_except_table sections.
2945 * readelf.c (print_debug_frame_section): Some fixes for last change.
2947 2009-01-15 Ulrich Drepper <drepper@redhat.com>
2949 * readelf.c (print_encoding): Now a toplevel function.
2950 (print_relinfo): Likewise.
2951 (print_encoding_base): Broken out of print_debug_frame_section.
2952 (print_debug_frame_section): Print different header for .eh_frame
2953 sections. Fix recognition of matching CIEs in .debug_frame sections.
2954 Print absolute offset for PC-relative FDE locations. Don't print
2955 table header for FDEs if the table is empty.
2956 (read_encoded): New function.
2957 (print_debug_frame_hdr_section): New function.
2958 (print_debug): Hook up print_debug_frame_hdr_section for .eh_frame_hdr
2961 * readelf.c (handle_relocs_rel): Print section number.
2962 (print_debug_abbrev_section): Likewise.
2963 (print_debug_aranges_section): Likewise.
2964 (print_debug_ranges_section): Likewise.
2965 (print_debug_info_section): Likewise.
2966 (print_debug_line_section): Likewise.
2967 (print_debug_loc_section): Likewise.
2968 (print_debug_macinfo_section): Likewise.
2969 (print_debug_pubnames_section): Likewise.
2970 (print_debug_str_section): Likewise.
2972 2009-01-10 Ulrich Drepper <drepper@redhat.com>
2974 * strings.c (read_block): Fix typo in error message string.
2976 2009-01-07 Ulrich Drepper <drepper@redhat.com>
2978 * ld.c (ld_new_searchdir): Fix adding to search path list.
2980 2009-01-06 Ulrich Drepper <drepper@redhat.com>
2982 * readelf.c: Implement call frame debug section dumping.
2984 2009-01-05 Roland McGrath <roland@redhat.com>
2986 * elfcmp.c: Exit with status 2 for errors (like cmp, diff, grep).
2987 Status 1 (aka EXIT_FAILURE) is only for completed OK but not equal.
2989 2009-01-01 Ulrich Drepper <drepper@redhat.com>
2991 * addr2line.c: Update copyright year.
2993 * elfcmp.c: Likewise.
2994 * elflint.c: Likewise.
2995 * findtextrel.c: Likewise.
2998 * objdump.c: Likewise.
2999 * ranlib.c: Likewise.
3000 * readelf.c: Likewise.
3002 * strings.c: Likewise.
3003 * strip.c: Likewise.
3004 * unstrip.c: Likewise.
3006 2008-12-11 Roland McGrath <roland@redhat.com>
3008 * nm.c (sym_name): New function.
3009 (show_symbols_sysv): Use it in place of elf_strptr.
3010 (show_symbols_bsd, show_symbols_posix): Likewise.
3013 * nm.c (show_symbols_sysv): Use an alloca'd backup section name when
3016 2008-12-02 Roland McGrath <roland@redhat.com>
3018 * readelf.c (count_dwflmod, process_file): Don't presume encoding of
3019 nonzero OFFSET argument to dwfl_getmodules.
3021 2008-08-07 Roland McGrath <roland@redhat.com>
3023 * addr2line.c (main): Pass string to handle_address.
3024 (see_one_module): New function, subroutine of handle_address.
3025 (find_symbol): Likewise.
3026 (handle_address): Take string argument rather than address.
3027 Convert plain number, or handle strings like "(section)+offset"
3030 2008-08-01 Roland McGrath <roland@redhat.com>
3032 * readelf.c (handle_core_item): Handle 'B' type for 1-origin bitset.
3033 For 'b' and 'B', print <x-y,z> or ~<x,y-z> rather than 1/0 string.
3035 * readelf.c (convert): Take new argument SIZE.
3036 (handle_core_register, handle_core_item): Update callers.
3037 (handle_core_item): Take new arg REPEATED_SIZE.
3038 (handle_core_items): Special case for a singleton item,
3039 let handle_core_item handle repeats if it wants to.
3041 * readelf.c (handle_core_items): Give abridged output
3042 for identical groups repeated more than twice.
3044 2008-07-04 Roland McGrath <roland@redhat.com>
3046 * readelf.c (handle_core_items): Handle ELF_T_ADDR.
3048 2008-04-10 Roland McGrath <roland@redhat.com>
3050 * strip.c (handle_elf): Don't keep sections that kept symbol tables
3051 refer to. Instead, just be sure to preserve the original symbol
3052 table in the debug file so those symbols go with their sections and
3053 can be elided from the stripped version of the symbol table.
3055 * strip.c (handle_elf): When a discarded section kept in the debug
3056 file refers to a nondiscard section via sh_link/sh_info, preserve
3057 that nondiscarded section unmodified in the debug file as well.
3058 Skip adjustment of discarded sections symbol table references when
3059 that symbol table is copied in this way.
3061 * elflint.c (check_symtab): Don't crash from missing symbol names
3062 after diagnosing bogus strtab.
3064 * strip.c (handle_elf): Cosmetic cleanup in special section contents
3065 adjustment for symtab changes.
3067 2008-03-31 Roland McGrath <roland@redhat.com>
3069 * elflint.c (check_sections): Add checks on SHF_EXECINSTR sections:
3070 must be SHT_PROGBITS, must not be SHF_WRITE. Let backend hook
3071 excuse a special section.
3073 2008-03-27 Roland McGrath <roland@redhat.com>
3075 * elflint.c (check_sections): Check that executability and writability
3076 of sections is reflected in segment p_flags.
3078 2008-03-26 Roland McGrath <roland@redhat.com>
3080 * elflint.c (check_program_header): Accept PT_GNU_RELRO p_flags
3081 that matches its PT_LOAD's p_flags &~ PF_W. On sparc, PF_X really
3084 2008-02-29 Roland McGrath <roland@redhat.com>
3086 * readelf.c (print_attributes): Add a cast.
3087 * elflint.c (check_attributes): Likewise.
3089 * unaligned.h (add_8ubyte_unaligned): Cast PTR argument for parity
3090 with [UNALIGNED_ACCESS_CLASS == BYTE_ORDER] definition.
3091 (add_4ubyte_unaligned, add_2ubyte_unaligned): Likewise.
3093 2008-02-03 Ulrich Drepper <drepper@redhat.com>
3095 * i386_ld.c (elf_i386_count_relocations): Implement R_386_TLS_GD
3096 when linked into executable.
3097 (elf_i386_create_relocations): Likewise.
3099 2008-02-20 Roland McGrath <roland@redhat.com>
3101 * readelf.c (print_attributes): New function.
3102 (process_elf_file): Call it under -A.
3104 * elflint.c (check_attributes): Implement it for real.
3106 2008-02-19 Roland McGrath <roland@redhat.com>
3108 * elflint.c (special_sections): Handle .gnu.attributes section.
3109 (check_sections): Likewise.
3110 (check_attributes): New function.
3112 2008-02-10 Roland McGrath <roland@redhat.com>
3114 * elfcmp.c (main): Ignore sh_offset differences in non-SHF_ALLOC
3115 sections and ET_REL files.
3117 2008-02-02 Ulrich Drepper <drepper@redhat.com>
3119 * elf32-i386.script: Add .eh_frame_hdr, .tdata, and .tbss sections.
3120 * i386_ld.c (elf_i386_count_relocations): Handle R_386_TLS_LDO_32
3122 (elf_i386_create_relocations): Likewise.
3123 * ld.h (struct ld_state): Add need_tls, tls_start, and tls_tcb
3125 * ldgeneric.c (add_section): If TLS section is used, set need_tls flag.
3126 (ld_generic_create_outfile): Add PT_TLS entry to program header.
3127 Fix generation of PT_GNU_STACK entry.
3129 2008-02-01 Ulrich Drepper <drepper@redhat.com>
3131 * ld.c (replace_args): Prevent loop over replacements if the parameter
3132 is only two characters long.
3134 * ld.c: Recognize sha1 argument for --build-id parameter.
3135 * ldgeneric.c (create_build_id_section): Handle sha1.
3136 (compute_hash_sum): New function. Broken out of compute_build_id.
3137 Take hash function and context as parameters.
3138 (compute_build_id): Use compute_hash_sum for md5 and the new sha1
3141 2008-01-31 Ulrich Drepper <drepper@redhat.com>
3143 * elf32-i386.script: Add .note.ABI-tag and .note.gnu.build-id sections.
3144 * ld.c: Recognize --build-id command line parameter.
3145 * ld.h: Define scn_dot_note_gnu_build_id.
3146 (struct ld_state): Add build_id and buildidscnidx elements.
3147 * ldgeneric.c: Implement --build-id command line parameter.
3148 * ldlex.l (ID): Recognize - as valid character after the first one.
3150 2008-01-29 Ulrich Drepper <drepper@redhat.com>
3152 * ld.c (replace_args): New function.
3153 (main): Use it to rewrite old-style parameters.
3155 * elf32-i386.script: Add .gnu.hash section.
3156 * ldgeneric.c (optimal_bucket_size): A tiny bit more efficient.
3157 (fillin_special_symbol): Initialize st_size.
3158 (sortfct_hashval): New function.
3159 (create_gnu_hash): New function.
3160 (create_hash): New function.
3161 (ld_generic_create_outfile): Use the new functions to create the
3164 * elflint.c (check_gnu_hash): Fix index value printed in error message.
3166 2008-01-24 Ulrich Drepper <drepper@redhat.com>
3168 * elflint.c (check_group): Check that signature symbol for section
3169 group is not an empty string.
3170 * ldgeneric.c: Remove magic assignment of indeces in the dynsym
3171 section. Start implementation of --hash-style.
3172 * i386_ld.c: Likewise.
3173 * ld.c: Recognize --hash-style.
3174 * ld.h (struct scninfo): Add comdat_group.
3175 Add additional parameter to finalize_plt callback.
3177 2008-01-22 Ulrich Drepper <drepper@redhat.com>
3179 * ld.h (struct callbacks): Add initialize_gotplt.
3180 (struct scnhead): Add scn_dot_gotplt.
3181 (struct ld_state): Add gotpltscnidx.
3182 * i386_ld.c (elf_i386_initialize_plt): Minor optimization.
3183 (elf_i386_initialize_pltrel): Likewise.
3184 (elf_i386_initialize_got): There is now a separate .got.plt, so
3185 don't do the PLT-related work here. Initialize d_type.
3186 (elf_i386_initialize_gotplt): New function.
3187 (elf_i386_plt0): Use ud2a after indirect jump.
3188 (elf_i386_pic_plt0_entry): Likewise.
3189 (elf_i386_finalize_plt): Reference now .got.plt.
3190 (elf_i386_count_relocations): For GOT entries which need no relocation
3191 don't bump nrel_got.
3192 (elf_i386_create_relocations): Also get .got.plt. Rewrite R-386_GOT32
3193 handling for split .got/.got.plt.
3194 (elf_i386_ld_init): Initialize callbacks.initialize_gotplt.
3195 * elf32-i386.script: Sort sections for security. There are no .got
3196 input sections. Add .got.plt.
3197 * ldgeneric.c (ld_generic_generate_sections): Add .got.plt section.
3198 (ld_generic_create_outfile): Initialize .got.plt section.
3199 Use .got.plt address for _GLOBAL_OFFSET_TABLE_ symbol and DT_PLTGOT.
3201 2008-01-19 Ulrich Drepper <drepper@redhat.com>
3203 * i386_ld.c (elf_i386_count_relocations): PLT relocations for undefined
3204 symbols are not carried over into statically linked output files.
3205 Add dummy entries for more TLS relocations.
3207 * ld.c (options): Add long names for -( and -).
3209 * ldgeneric.c (check_definition): For newly found definitions don't
3210 mark section as used if symbol is absolute.
3211 (extract_from_archive): Only assign archive sequence number the first
3212 time the archive is handled. Update ld_state.last_archive_used
3213 if any symbol was used. Remove nround variable.
3214 (file_process2): When using symbol from an archive, update
3215 ld_state.group_start_archive, ld_state.archives, and
3216 ld_state.tailarchives.
3217 (ld_generic_file_process): If group is not handled anymore, after
3218 freeing ELF handles for the archives, clear ld_state.archives and
3219 *nextp. Fix wrong logic in recognizing first iteration of group
3220 loop. When clearing flags, also clear ld_state.group_start_archive.
3222 2008-01-11 Ulrich Drepper <drepper@redhat.com>
3224 * objdump.c (show_disasm): Adjust disassembler format string for
3227 2008-01-04 Roland McGrath <roland@redhat.com>
3229 * readelf.c (handle_core_items): Take new arg DESCSZ; if nonzero,
3230 a size greater than the items cover means multiple sets of items.
3231 (handle_core_note): Update caller.
3233 2008-01-04 Roland McGrath <roland@redhat.com>
3235 * strip.c (handle_elf): Move SHDRIDX defn to silence gcc warning.
3237 2008-01-03 Roland McGrath <roland@redhat.com>
3239 * ld.h (linked_from_dso_p): Use __attribute__ ((__gnu_inline__)).
3241 * elflint.c (check_dynamic): Remove duplicate initializer.
3243 2008-01-02 Ulrich Drepper <drepper@redhat.com>
3245 * addr2line.c: Update copyright year.
3247 * elfcmp.c: Likewise.
3248 * elflint.c: Likewise.
3249 * findtextrel.c: Likewise.
3252 * objdump.c: Likewise.
3253 * ranlib.c: Likewise.
3254 * readelf.c: Likewise.
3256 * strings.c: Likewise.
3257 * strip.c: Likewise.
3258 * unstrip.c: Likewise.
3260 2007-12-30 Ulrich Drepper <drepper@redhat.com>
3262 * objdump (show_disasm): Use %e after third parameter.
3264 2007-12-21 Ulrich Drepper <drepper@redhat.com>
3266 * strip.c: Fix wrong parenthesis in a few branch predictions.
3267 * strings.c: Likewise.
3269 2007-12-20 Ulrich Drepper <drepper@redhat.com>
3271 * Makefile.am (DEFS): Add DEBUGPRED.
3272 * addr2line.c: Include debugpred.h.
3274 * elfcmp.c: Likewise.
3275 * elflint.c: Likewise.
3276 * findtextrel.c: Likewise.
3278 * objdump.c: Likewise.
3279 * ranlib.c: Likewise.
3280 * readelf.c: Likewise.
3282 * strings.c: Likewise.
3283 * strip.c: Likewise.
3284 * unstrip.c: Likewise.
3285 * debugpred.h: New file.
3287 * readelf.c (handle_relocs_rel): Use elf_scnshndx.
3288 (handle_relocs_rela): Likewise.
3290 * readelf.c: Add lots of likely/unlikely.
3292 * elflint.c: Minor cleanups.
3294 2007-11-19 Roland McGrath <roland@redhat.com>
3296 * readelf.c (print_ops): Handle all bad op codes gracefully.
3297 Print their numbers instead of just ???.
3299 2007-11-09 Roland McGrath <roland@redhat.com>
3301 * readelf.c (attr_callback): Handle DW_AT_data_location.
3302 Handle block forms to mean a DWARF expression for DW_AT_allocated,
3303 DW_AT_associated, DW_AT_bit_size, DW_AT_bit_offset, DW_AT_bit_stride,
3304 DW_AT_byte_size, DW_AT_byte_stride, DW_AT_count, DW_AT_lower_bound,
3307 2007-10-20 Roland McGrath <roland@redhat.com>
3309 * unstrip.c (options): Update -R description.
3310 (struct symbol): Put symbol details a union with a size_t pointer
3312 (compare_symbols_output): Use null ->name as marker for discard
3313 symbols, not zero *->map.
3314 (copy_elided_sections): Record forwarding pointers for discarded
3315 duplicates and fill SYMNDX_MAP elements through them.
3317 * readelf.c (process_file): Set offline_next_address to 0 at start.
3318 (struct process_dwflmod_args): New type.
3319 (process_dwflmod): Take args in it, pass fd to process_elf_file.
3320 (process_file): Update caller; dup FD for passing to libdwfl.
3321 (process_elf_file): Take new arg FD. For ET_REL file when
3322 displaying data affected by libdwfl relocation, open a new Elf handle.
3324 2007-10-17 Roland McGrath <roland@redhat.com>
3326 * readelf.c (print_debug_line_section): For invalid data inside a
3327 unit with plausible length, keep printing at the next unit boundary.
3329 * readelf.c (attr_callback): Use dwarf_formref_die, not dwarf_formref.
3331 2007-10-16 Roland McGrath <roland@redhat.com>
3333 * readelf.c (hex_dump): Fix rounding error in whitespace calculation.
3335 2007-10-15 Roland McGrath <roland@redhat.com>
3337 * make-debug-archive.in: New file.
3338 * Makefile.am (EXTRA_DIST): Add it.
3339 (make-debug-archive): New target.
3340 (bin_SCRIPTS, CLEANFILES): Add it.
3342 2007-10-10 Roland McGrath <roland@redhat.com>
3344 * elflint.c (special_sections): Add new attrflag value exact_or_gnuld.
3345 Use it to check MERGE|STRINGS for .debug_str.
3346 (check_sections): Handle exact_or_gnuld.
3348 2007-10-08 Roland McGrath <roland@redhat.com>
3350 * readelf.c (handle_core_item): Handle 'T'|0x80 to indicate
3351 64-bit struct timeval with 32-bit tv_usec.
3353 2007-10-07 Roland McGrath <roland@redhat.com>
3355 * readelf.c (check_archive_index): New function.
3356 (process_file): Call it. Change signature to take only fd and name.
3357 Use libdwfl to open the file, then iterate on its modules (multiple
3358 for an archive) to print file name and call process_elf_file.
3359 (main): Update caller. Let process_file do elf_begin.
3360 (count_dwflmod, process_dwflmod, find_no_debuginfo): New functions.
3361 (process_elf_file): Take only Dwfl_Module * argument.
3362 Don't print the file name here.
3363 (print_debug_*_section): Take Dwfl_Module * argument.
3364 (print_debug): Likewise. Update caller.
3365 (format_dwarf_addr): New function.
3366 (print_debug_ranges_section): Use it.
3367 (attr_callback): Likewise.
3368 (print_debug_line_section, print_debug_loc_section): Likewise.
3370 * readelf.c (print_debug_ranges_section): Translate all strings.
3371 (print_debug_loc_section): Likewise.
3373 * unstrip.c (copy_elided_sections): Initialize SEC.
3375 * ar.c (do_oper_insert): Put trailing / on short names.
3377 * arlib.h (MAX_AR_NAME_LEN): Decrease by one.
3379 * arlib2.c (arlib_add_long_name): Adjust for header size.
3381 * arlib.c (arlib_finalize): Pad long name table to keep size even.
3383 * ar.c (do_oper_insert): Use write_retry for padding write.
3385 * ar.c (do_oper_insert): Initialize CUR_OFF in no_old case.
3386 Unconditionally set FOUND[CNT]->elf when setting ->mem.
3387 (remember_long_name): New function.
3388 (do_oper_insert): Call it. Correctly use length of basename,
3389 not original name. Don't store long name twice for new member.
3391 2007-10-06 Roland McGrath <roland@redhat.com>
3393 * elflint.c (check_note): Skip empty segment.
3394 (check_note_section): Skip empty section.
3396 * unstrip.c (options, parse_opt, struct arg_info): Grok -R/--relocate.
3397 (handle_output_dir_module, handle_implicit_modules): Pass it down.
3398 (handle_dwfl_module): When set, use ET_REL already loaded by Dwfl.
3399 (compare_alloc_sections): Take new arg REL, ignore address if true.
3400 (compare_sections): Likewise, pass it down.
3401 (compare_sections_rel, compare_sections_nonrel): New functions.
3402 (find_alloc_sections_prelink, copy_elided_sections): Use them
3403 instead of compare_sections.
3404 (sections_match): New function, broken out of ...
3405 (find_alloc_section): ... here.
3406 (copy_elided_sections): Reorganize section match-up logic.
3407 Use sections_match for SHF_ALLOC in ET_REL.
3408 For ET_REL, let the nonzero sh_addr from the debug file dominate.
3410 * unstrip.c (add_new_section_symbols): Take new arg REL.
3411 When true, do not update section symbol values.
3412 (collect_symbols): Likewise. Update section symbols with address
3413 of chosen output section, not original section.
3414 (check_symtab_section_symbols, copy_elided_sections): Update callers.
3416 * unstrip.c (compare_alloc_sections): At the same address, preserve
3417 original section order.
3419 * elflint.c (special_sections): Don't require MERGE|STRINGS for
3420 .debug_str, it didn't always have them with older tools.
3422 * elflint.c (check_symtab, check_one_reloc): Ignore sh_addr in ET_REL.
3424 2007-10-05 Roland McGrath <roland@redhat.com>
3426 * elflint.c (check_symtab): Allow SHN_UNDEF _GLOBAL_OFFSET_TABLE_ in
3429 * elflint.c (check_symtab): For _GLOBAL_OFFSET_TABLE_, diagnose
3430 SHN_UNDEF as "bad section". Use shndx value in messages.
3432 * elflint.c (special_sections): Add ".debug_str". Decrement namelen
3433 for ".debug" so it matches as a prefix.
3434 (IS_KNOWN_SPECIAL): New macro.
3435 (check_sections): Use it for ".plt" match. Cite wrong SHT_NOBITS
3436 type even under -d, for a .debug* or .shstrtab section.
3438 * readelf.c (print_ops): Use hex for address operand.
3440 2007-10-04 Roland McGrath <roland@redhat.com>
3442 * unstrip.c (copy_elided_sections): Initialize NDX_SECTION element for
3443 .gnu_debuglink section to SHN_UNDEF. Drop STT_SECTION symbols for
3444 sections mapped to SHN_UNDEF.
3446 2007-10-04 Ulrich Drepper <drepper@redhat.com>
3448 * readelf.c (dump_archive_index): Avoid warning about uninitialized
3449 variable with older glibc versions.
3450 Add some branch prediction.
3452 2007-10-04 Roland McGrath <roland@redhat.com>
3454 * readelf.c (print_archive_index): New variable.
3455 (options, parse_opt): Accept -c/--archive-index to set it.
3456 (dump_archive_index): New function.
3457 (process_file): Take new arg WILL_PRINT_ARCHIVE_INDEX.
3458 Call dump_archive_index on archives if set.
3459 (main): Update caller.
3460 (any_control_option): Give it file scope, moved out of ...
3461 (parse_opt): ... here.
3463 2007-10-03 Roland McGrath <roland@redhat.com>
3465 * unstrip.c (struct arg_info): Add `list' flag.
3466 (options, parse_opt): Grok -n/--list to set it.
3467 (list_module): New function.
3468 (handle_implicit_modules): Call it under -n.
3470 * elflint.c (check_note_section): New function.
3471 (check_sections): Call it for SHT_NOTE.
3473 * readelf.c (handle_notes): Use sections when available.
3475 * elflint.c (check_note_data): New function, broken out of ...
3476 (check_note): ... here. Call it and elf_getdata_rawchunk.
3478 * readelf.c (handle_auxv_note): Take offset as argument, not buffer.
3479 Use elf_getdata_rawchunk and gelf_getauxv.
3480 (handle_notes_data): New function, broken out of ...
3481 (handle_notes): ... here. Call it and elf_getdata_rawchunk.
3483 2007-10-01 Roland McGrath <roland@redhat.com>
3485 * readelf.c (hex_dump): Fix transposed subtraction generating spaces.
3487 * readelf.c (hex_dump): Fix line header to be hex instead of decimal.
3489 2007-09-10 Roland McGrath <roland@redhat.com>
3491 * readelf.c (options): Give -p optional argument, alias --string-dump.
3492 (string_sections, string_sections_tail): New static variables.
3493 (parse_opt): Set them when -p has an argument.
3494 (print_string_section): New function, broken out of ...
3495 (print_strings): ... here. Call it.
3496 (dump_data_section): New function, broken out of ...
3497 (dump_data): ... here. Call it.
3498 (for_each_section_argument): New function, broken out of ...
3499 (dump_data): ... here. Call it.
3500 (dump_strings): New function.
3502 2007-08-31 Roland McGrath <roland@redhat.com>
3504 * readelf.c (print_strings): Typo fix.
3506 2007-08-23 Roland McGrath <roland@redhat.com>
3508 * readelf.c (printf_with_wrap): Function removed.
3509 (REGISTER_WRAP_COLUMN): New macro.
3510 (handle_core_register): Use print_core_item instead.
3511 (struct register_info): New type.
3512 (compare_registers, compare_register_sets): New functions.
3513 (register_bitpos, compare_sets_by_info): New functions.
3514 (handle_core_registers): Use those to segregate and sort registers
3517 * readelf.c (ITEM_WRAP_COLUMN): New macro.
3518 (print_core_item): New function.
3519 (handle_core_item): Use it instead of printf_with_wrap.
3520 (compare_core_items, compare_core_item_groups): New functions.
3521 (handle_core_items): Use them. Sort by group and force line breaks
3524 * readelf.c (handle_core_registers, handle_core_items): New functions,
3526 (handle_core_note): ... here. Call them.
3528 2007-08-22 Roland McGrath <roland@redhat.com>
3530 * unstrip.c (new_shstrtab): New function, broken out of ...
3531 (copy_elided_sections): ... here.
3533 2007-08-20 Roland McGrath <roland@redhat.com>
3535 Avoid local function trampolines in nm binary.
3536 * nm.c (sort_by_address): Move to a static function instead of local
3537 inside show_symbols.
3538 (sort_by_name_strtab): New static variable.
3539 (sort_by_name): Use it. Move to a static function instead of local
3540 inside show_symbols.
3541 (show_symbols): Set sort_by_name_strtab.
3543 2007-08-19 Roland McGrath <roland@redhat.com>
3545 * readelf.c (handle_auxv_note): New function.
3546 (handle_notes): Call it.
3548 * readelf.c (printf_with_wrap, convert): New functions.
3549 (handle_core_item, (handle_core_register): New functions.
3550 (handle_notes): Call those with details from ebl_core_note.
3552 2007-08-12 Roland McGrath <roland@redhat.com>
3554 * elflint.c (check_note): Accept type 0 with name "Linux".
3556 * elflint.c (special_sections): Accept SHF_ALLOC for ".note".
3558 * elflint.c (section_flags_string): Return "none" for 0, not "".
3560 2007-08-11 Roland McGrath <roland@redhat.com>
3562 * elflint.c (check_note): Accept NT_GNU_HWCAP, NT_GNU_BUILD_ID.
3564 2007-08-04 Ulrich Drepper <drepper@redhat.com>
3566 * readelf.c (hex_dump): Use isprint to determine whether to print
3567 character itself or full stop character.
3568 (dump_data): No need to check endp for NULL after strtol call.
3570 2007-08-03 Roland McGrath <roland@redhat.com>
3572 * readelf.c (print_string_sections): New variable.
3573 (options, parse_opt): Handle --strings/-p to set it.
3574 (print_strings): New function.
3575 (process_elf_file): Call it under -p.
3577 * readelf.c (options): Add hidden aliases --segments, --sections,
3578 as taken by binutils readelf.
3580 2007-08-01 Roland McGrath <roland@redhat.com>
3582 * readelf.c (dump_data_sections, dump_data_sections_tail):
3584 (options, parse_opt): Handle --hex-dump/-x, set them.
3585 (hex_dump): New function.
3586 (dump_data): New function, call it.
3587 (process_elf_file): Call it.
3589 2007-07-25 Roland McGrath <roland@redhat.com>
3591 * addr2line.c (show_symbols): New variable.
3592 (print_addrsym): New function.
3593 (handle_address): Call it.
3594 (options, parse_opt): Handle -S/--symbols.
3596 2007-06-05 Ulrich Drepper <drepper@redhat.com>
3598 * addr2line.c: Update for latest autoconf header.
3600 * elfcmp.c: Likewise.
3601 * elflint.c: Likewise.
3602 * findtextrel.c: Likewise.
3604 * ldgeneric.c: Likewise.
3606 * objdump.c: Likewise.
3607 * ranlib.c: Likewise.
3608 * readelf.c: Likewise.
3610 * strings.c: Likewise.
3611 * strip.c: Likewise.
3612 * unstrip.c: Likewise.
3614 2007-05-18 Roland McGrath <roland@redhat.com>
3616 * unstrip.c (copy_elided_sections): Match up non-NOBITS sections with
3617 stripped file, so as not to duplicate a section copied in both.
3619 * strip.c (handle_elf): Keep SHT_NOTE section copies in the debug file.
3621 2007-05-17 Roland McGrath <roland@redhat.com>
3623 * unstrip.c (copy_elided_sections): Don't call gelf_newphdr for 0.
3625 * unstrip.c (handle_file): Tweak BIAS != 0 warning.
3627 * unstrip.c (handle_file): Take new arg CREATE_DIRS. If set,
3628 call make_directories here.
3629 (handle_explicit_files): Take new arg CREATE_DIRS, pass it down.
3630 (handle_dwfl_module): Likewise.
3631 (handle_implicit_modules): Update callers.
3632 (handle_output_dir_module): Likewise. Don't do make_directories here.
3634 * unstrip.c (get_section_name): New function, broken out of ...
3635 (copy_elided_sections): here. Update callers.
3636 (find_alloc_section): Broken out of ...
3637 (copy_elided_sections): ... here. Update caller.
3638 (symtab_count_leading_section_symbols): Take new arg NEWSYMDATA,
3639 update STT_SECTION symbols' st_value fields as a side effect.
3640 (check_symtab_section_symbols): Update caller.
3641 (add_new_section_symbols): Set st_value in symbols added.
3642 (collect_symbols): Reset S->value for STT_SECTION symbols recorded.
3643 Take new arg SPLIT_BSS. Adjust S->shndx recorded for symbols moved
3644 from .bss to .dynbss.
3645 (find_alloc_sections_prelink): New function. Associate debug file
3646 allocated SHT_NOBITS shdrs with stripped moved by prelink via
3647 .gnu.prelink_undo information.
3648 (copy_elided_sections): Call it when we couldn't find every allocated
3649 section. Don't use a debug file non-NOBITS section if SHF_ALLOC.
3650 Take STRIPPED_EHDR arg instead of E_TYPE and PHNUM.
3651 (handle_file): Update callers.
3653 * unstrip.c (copy_elided_sections): Ignore unfound unallocated section
3656 * elflint.c (check_sections): Fix association of segments with
3657 sections when p_memsz > p_filesz.
3659 2007-04-29 Roland McGrath <roland@redhat.com>
3661 * addr2line.c (options, main): Tweak argp group settings to fix
3664 2007-04-28 Roland McGrath <roland@redhat.com>
3666 * strip.c (handle_elf): Update debug file's SHT_NOBITS sections'
3667 sizes to match sections adjusted in the stripped file.
3669 2007-04-24 Roland McGrath <roland@redhat.com>
3671 * elfcmp.c (OPT_HASH_INEXACT): New macro.
3672 (hash_inexact): New variable.
3673 (options, parse_opt): Add --hash-inexact option to set it.
3674 (hash_content_equivalent): New function.
3675 (main): Call it for differing SHT_HASH sections under --hash-inexact.
3677 2007-04-23 Roland McGrath <roland@redhat.com>
3679 * unstrip.c: New file.
3680 * Makefile.am (bin_PROGRAMS): Add it.
3681 (unstrip_LDADD): New variable.
3683 * strip.c (options): Allow --output for -o.
3685 2007-02-15 Ulrich Drepper <drepper@redhat.com>
3687 * readelf.c: Remove unused code. Add a few consts.
3689 2007-02-15 Roland McGrath <roland@redhat.com>
3691 * readelf.c (print_debug): Fix brainos in SHDR test.
3693 2007-02-05 Roland McGrath <roland@redhat.com>
3695 * ar.c: Include <limits.h>, since we use LONG_MAX.
3697 2007-02-05 Ulrich Drepper <drepper@redhat.com>
3699 * ar.c: Add ugly hack to work around gcc complaining that we
3700 ignore fchown's return value.
3701 (do_oper_insert): Handle error when writing padding.
3702 * ranlib.c: Add fchown complain work around.
3704 * arlib.c: Make symtab a global variable. Change all users.
3705 * arlib2.c: Likewise.
3706 * ranlib.c: Likewise.
3708 * arlib.h: Declare it.
3710 2007-01-11 Roland McGrath <roland@redhat.com>
3712 * elflint.c (check_sections): Use ebl_machine_section_flag_check on
3713 SHF_MASKPROC bits separately from generic sh_flags validation.
3715 2007-02-04 Ulrich Drepper <drepper@redhat.com>
3718 * arlib.c: New file.
3719 * arlib2.c: New file.
3720 * arlib.h: New file.
3721 * Makefile (noinst_LIBRARIES): Add libar.
3722 (libar_a_SOURCES): Define.
3724 (CFLAGS_ar): Define.
3725 * ranlib.c: Change to use arlib.
3727 * elflint.c (check_symtab): Work around GNU ld bug which omits
3728 sections but not symbols in those sections.
3730 2007-01-10 Ulrich Drepper <drepper@redhat.com>
3732 * addr2line.c: Update copyright year.
3733 * elfcmp.c: Likewise.
3734 * elflint.c: Likewise.
3735 * findtextrel.c: Likewise.
3738 * objdump.c: Likewise.
3739 * ranlib.c: Likewise.
3740 * readelf.c: Likewise.
3742 * strings.c: Likewise.
3743 * strip.c: Likewise.
3745 2006-12-09 Ulrich Drepper <drepper@redhat.com>
3747 * elflint.c (compare_hash_gnu_hash): New function. Report if the
3748 two hash tables have different content (module expected omission
3749 of undefined symbols).
3751 2006-10-31 Roland McGrath <roland@redhat.com>
3753 * elflint.c (check_program_header): Don't complain about
3754 p_filesz > p_memsz if p_memsz is zero and p_type is PT_NOTE.
3756 2006-09-19 Jakub Jelinek <jakub@redhat.com>
3758 * strip.c (process_file): Disallow -f on archives.
3760 2006-10-09 Roland McGrath <roland@redhat.com>
3762 * Makefile.am (libld_elf_i386.so): Use $(LINK), not $(CC).
3764 2006-08-29 Roland McGrath <roland@redhat.com>
3766 * Makefile.am (MAINTAINERCLEANFILES): New variable.
3768 * readelf.c (handle_relocs_rel): Typo fix, test DESTSHDR properly.
3769 Reported by Christian Aichinger <Greek0@gmx.net>.
3771 * elflint.c (valid_e_machine): Add EM_ALPHA.
3772 Reported by Christian Aichinger <Greek0@gmx.net>.
3774 2006-08-08 Ulrich Drepper <drepper@redhat.com>
3776 * elflint.c (check_dynamic): Don't require DT_HASH for DT_SYMTAB.
3777 Keep track of which "high DT" entries are present.
3778 Check that either old or GNU-style hash table is present.
3779 If GNU-style hash table is used a symbol table is mandatory.
3780 Check that if any prelink entry is present all of them are.
3781 (check_gnu_hash): Only fail for undefined symbols in GNU-style hash
3782 table if they don't refer to functions.
3784 2006-07-17 Roland McGrath <roland@redhat.com>
3786 * elflint.c (struct version_namelist): Use GElf_Versym for `ndx' field.
3787 (add_version): Likewise for argument.
3788 (check_versym): Cast constant to GElf_Versym for comparison.
3790 2006-07-12 Roland McGrath <roland@redhat.com>
3792 * readelf.c (handle_gnu_hash): Add casts for machines where
3793 Elf32_Word != unsigned int.
3795 2006-07-12 Ulrich Drepper <drepper@redhat.com>
3797 * elflint.c (check_sysv_hash64): Fix printf format.
3799 2006-07-11 Roland McGrath <roland@redhat.com>
3801 * addr2line.c (options): English fix in -f doc string.
3803 * addr2line.c (use_comp_dir): New variable.
3804 (options, parse_opt): Grok -A/--absolute to set it.
3805 (handle_address): If set, prepend dwfl_line_comp_dir results to
3806 relative file names.
3808 2006-07-06 Ulrich Drepper <drepper@redhat.com>
3810 * elflint.c: Adjust for latest new hash table format.
3811 * readelf.c: Likewise.
3813 * elflint.c (check_versym): Ignore hidden bit when comparing version
3816 2006-07-05 Ulrich Drepper <drepper@redhat.com>
3818 * ldgeneric.c (ld_generic_create_outfile): Correctly recognize
3819 discarded COMDAT symbols.
3821 * i386_ld.c (elf_i386_count_relocations): Lot of corrections.
3822 (elf_i386_create_relocations): Likewise.
3823 * ld.h (struct symbol): Add local and hidden bits.
3824 * ld.c (create_special_section_symbol): These synthsized symbols
3825 are local and hidden.
3826 * ldgeneric.c (file_process2): Check whether input file matches
3828 (fillin_special_symbol): Create symbols as local and/or hidden
3830 (ld_generic_create_outfile): Make local copy of symbol.
3831 Don't hide global, defined symbols in dynamic symbol table unless
3832 requested. Synthetic symbols have no version information.
3834 * elflint.c: Add support for checking 64-bit SysV-style hash tables.
3835 * readelf.c: Add support for printing 64-bit SysV-style hash tables.
3837 2006-07-04 Ulrich Drepper <drepper@redhat.com>
3839 * elflint.c (is_rel_dyn): Fix and extend DT_RELCOUNT/DT_RELACOUNT
3842 2006-07-03 Ulrich Drepper <drepper@redhat.com>
3844 * elflint.c: Add testing of DT_GNU_HASH.
3845 * readelf.c: Implement showing histogram for DT_GNU_HASH section.
3847 * Makefile.am: Add hacks to create dependency files for non-generic
3850 2006-06-12 Ulrich Drepper <drepper@redhat.com>
3852 * ldgeneric.c (ld_generic_generate_sections): Don't create .interp
3853 section if creating a DSO and no interpreter is given.
3854 (ld_generic_create_outfile): Don't store reference to symbols in
3855 discarded COMDAT groups. Don't create PHDR and INTERP program header
3856 for DSO if no interpreter is specified.
3857 (create_verneed_data): Pretty printing.
3859 * ldscript.y (content): If a DSO is created don't set default
3860 interpreter from linker script.
3862 * i386_ld.c (elf_i386_count_relocations): Do not add relocations
3863 for symbols in discarded COMDAT groups.
3864 (elf_i386_create_relocations): Likewise.
3865 * ld.h (struct scninfo): Add unused_comdat.
3866 * ldgeneric.c (add_section): Also check group signature when
3867 matching COMDAT sections.
3868 (add_relocatable_file): Ignore symbols in COMDAT group which are
3871 * elflint.c (check_one_reloc): For *_NONE relocs only check type
3872 and symbol reference.
3874 2006-06-11 Ulrich Drepper <drepper@redhat.com>
3876 * elflint.c (check_dynamic): Fix checking value of tags which are
3877 offsets in the string section. Make sure DT_STRTAB points to the
3878 section referenced in sh_link.
3880 * ld.c (options): Add headers. Add short option 'R' for '--rpath'.
3882 * ld.c: Recognize --eh-frame-hdr option.
3883 * ld.h (struct ld_state): Add eh_frame_hdr field.
3884 * ldgeneric.c (struct unw_eh_frame_hdr): Define.
3886 * ldgeneric.c (add_section): Use ebl_sh_flags_combine instead of
3888 (add_relocatable_file): Minor optimization of last change.
3889 (match_section): Don't preserve SHF_GROUP flag any longer.
3891 2006-06-10 Ulrich Drepper <drepper@redhat.com>
3893 * ld.c (parse_z_option): Recognize execstack and noexecstack.
3894 Handle record and ignore as position dependent options.
3895 (parse_z_option_2): Handle ignore and record here.
3896 * ld.h (struct ld_state): Add execstack field.
3897 * ldgeneric.c (add_relocatable_file): Recognize .note.GNU-stack
3899 (ld_generic_create_outfile): Fix program header creation in native
3900 linker. Add PT_GNU_STACK program header.
3902 2006-06-09 Ulrich Drepper <drepper@redhat.com>
3904 * i386_ld.c (elf_i386_finalize_plt): Don't change symbol table entries
3905 for PLT entries if there is no local definition.
3907 * ld.c (parse_option): Handle -z ignore like --as-needed and
3908 -z record like --no-as-needed.
3909 * ld.h (struct ld_state): Remove ignore_unused_dsos field.
3910 * ldgeneric.c (new_generated_scn): Always compute ndt_needed by
3911 looping over DSOs. When deciding about adding DT_NEEDED entries
3912 use ->as_needed instead of ignore_unused_dsos.
3914 2006-05-31 Ulrich Drepper <drepper@redhat.com>
3916 * ld.c: Recognize --as-needed and --no-as-needed options.
3917 * ld.h (struct usedfile): Add as_needed field.
3918 (struct ld_state): Likewise.
3919 * ldgeneric.c (ld_handle_filename_list): Copy as_needed flag from
3921 * ldscript.y (filename_id_list): Split to correctly parse all
3923 (mark_as_needed): Fix loop.
3925 2006-05-28 Ulrich Drepper <drepper@redhat.com>
3927 * addr2line.c (print_dwarf_function): Use unsigned type for lineno
3930 2006-05-27 Ulrich Drepper <drepper@redhat.com>
3932 * readelf.c (handle_relocs_rela): Better notations for addon value.
3933 (print_ehdr): Distinguish e_ident[EI_VERSION] from e_version.
3935 2006-04-04 Ulrich Drepper <drepper@redhat.com>
3937 * addr2line.c: Update copyright year.
3938 * elfcmp.c: Likewise.
3939 * elflint.c: Likewise.
3940 * findtextrel.c: Likewise.
3943 * objdump.c: Likewise.
3944 * ranlib.c: Likewise.
3945 * readelf.c: Likewise.
3947 * strings.c: Likewise.
3948 * strip.c: Likewise.
3950 2006-03-09 Roland McGrath <roland@redhat.com>
3952 * Makefile.am (AM_LDFLAGS): New variable.
3954 2006-03-01 Roland McGrath <roland@redhat.com>
3956 * readelf.c (dwarf_tag_string, dwarf_attr_string): Update name tables
3957 for dwarf.h changes matching 3.0 spec.
3958 (dwarf_encoding_string, dwarf_lang_string, print_ops): Likewise.
3960 2005-12-04 Ulrich Drepper <drepper@redhat.com>
3962 * elflint.c (check_one_reloc): If relocation section is not loaded,
3963 don't check whether the relocations modify read-only sections or
3964 loaded and unloaded sections.
3966 2005-11-28 Ulrich Drepper <drepper@redhat.com>
3968 * elflint.c (check_one_reloc): Take additional parameters. Use
3969 them to determine whether relocation is valid in this type of
3970 file. DSOs and executables can contain relocation sections in
3971 unloaded sections which just show the relocations the linker
3972 applied. Adjust all callers.
3973 (check_program_header): Check that PT_PHDR is loaded and that offset
3974 matches the one in the ELF header.
3976 2005-10-26 Roland McGrath <roland@redhat.com>
3978 * nm.c (get_var_range): dwarf_getloclist -> dwarf_getlocation.
3980 2005-09-03 Ulrich Drepper <drepper@redhat.com>
3982 * strip.c (handle_elf): Unify some error messages.
3983 * ld.c (main): Likewise.
3984 * ldgeneric.c (open_elf): Likewise.
3985 * elfcmp.c (main): Likewise.
3986 * elflint.c (check_elf_header): Likewise.
3988 * size.c (process_file): Fix typo in error message.
3990 * readelf.c: Lots of little cleanups. Use _unlocked functions.
3992 2005-09-02 Ulrich Drepper <drepper@redhat.com>
3994 * strings.c (main): Reset elfmap variable after munmap call.
3995 [_MUDFLAP] (map_file): Simplify mudflap debugging by not using mmap.
3997 2005-08-28 Ulrich Drepper <drepper@redhat.com>
3999 * ranlib.c: Don't define pread_retry and write_retry here.
4001 * Makefile.an [BUILD_STATIC] (libdw): Add -ldl.
4002 (CLEANFILES): Add *.gcno *.gcda *.gconv.
4004 * strings.c (process_chunk): Reorder expressions in conditional
4005 (process_chunk_mb): Likewise.
4007 * strings.c: New file.
4008 * Makefile.am (bin_PROGRAMS): Add strings.
4009 (strings_no_Wstring): Define.
4010 (strings_LDADD): Define.
4012 2005-08-27 Roland McGrath <roland@redhat.com>
4014 * addr2line.c (dwarf_diename_integrate): Function removed.
4015 (print_dwarf_function): Use plain dwarf_diename.
4017 2005-08-24 Ulrich Drepper <drepper@redhat.com>
4019 * elflint.c (check_versym): Versioned symbols should not have
4022 2005-08-15 Ulrich Drepper <drepper@redhat.com>
4024 * elflint.c (check_versym): Allow VER_NDX_LOCAL symbols to be
4027 * Makefile.am: Add rules to build ranlib.
4028 * ranlib.c: New file.
4030 2005-08-14 Roland McGrath <roland@redhat.com>
4032 * elflint.c (check_sections): Use ebl_section_type_name and allow any
4033 sh_type it recognizes.
4035 * elflint.c (check_sections): Print unknown flags in hex, don't
4036 truncate high bits. Print section number and name for unknown type.
4038 2005-08-13 Roland McGrath <roland@redhat.com>
4040 * elflint.c (check_program_header): Use ebl_segment_type_name and
4041 allow any p_type it recognizes. Include p_type value in error
4042 message for unknown type.
4044 2005-08-13 Ulrich Drepper <drepper@redhat.com>
4046 * elflint.c (check_symtab): Simplify last change a bit. Pass ehdr
4047 to ebl_check_special_symbol.
4048 (check_sections): Pass ehdr to ebl_bss_plt_p.
4050 2005-08-12 Roland McGrath <roland@redhat.com>
4052 * elflint.c (check_symtab): Check that _GLOBAL_OFFSET_TABLE_ st_shndx
4053 refers to the right section if it's not SHN_ABS.
4054 Let ebl_check_special_symbol override _G_O_T_ value and size checks.
4056 * elflint.c (check_sections): Don't complain about a non-NOBITS
4057 section taking no segment space, if it's sh_size is 0.
4059 * elflint.c (check_sections): Use ebl_bss_plt_p to see if .plt should
4060 be PROGBITS or NOBITS.
4062 * elflint.c (check_symtab): Use ebl_check_special_symbol to override
4063 standard st_value and st_size checks.
4065 2005-07-28 Roland McGrath <roland@redhat.com>
4067 * addr2line.c (options, parse_opt): Don't handle -e here.
4068 (executable): Variable removed.
4069 (argp_children): New static variable.
4070 (argp): Use it. Make const.
4071 (main): Fill in argp_children from dwfl_standard_argp ().
4072 Let libdwfl handle file selection, pass Dwfl handle to handle_address.
4073 (print_dwarf_function): New function. Try to figure out inline chain.
4074 (elf_getname): Function removed, libdwfl does it for us.
4075 (handle_address): Take Dwfl handle instead of Elf, Dwarf handles.
4076 Use dwfl_module_addrname instead of elf_getname.
4077 Use dwfl_module_getsrc and dwfl_lineinfo instead of libdw calls.
4078 * Makefile.am (INCLUDES): Add libdwfl directory to path.
4080 2005-08-10 Ulrich Drepper <drepper@redhat.com>
4082 * strip.c (parse_opt): STATE parameter is now used.
4083 Various little cleanups.
4085 * readelf.c (print_debug_line_section): Correct fallout of renaming
4086 of DW_LNS_set_epilog_begin.
4088 2005-08-08 Roland McGrath <roland@redhat.com>
4090 * strip.c (options, parse_opt): Grok -R .comment for compatibility
4091 with binutils strip. Likewise -d, -S, as aliases for -g.
4092 Likewise ignore -s/--strip-all.
4094 2005-08-07 Roland McGrath <roland@redhat.com>
4096 * strip.c (process_file): Open read-only when using a different output
4099 2005-08-06 Ulrich Drepper <drepper@redhat.com>
4101 * elflint.c (in_nobits_scn): New function.
4102 (check_versym): Allow references for defined symbols against versions
4103 of other DSOs also for symbols in nobits sections.
4104 Move a few variables around.
4106 * Makefile.am (AM_CFLAGS): Avoid duplication.
4107 Link with statis libs if BUILD_STATIC.
4109 2005-08-05 Ulrich Drepper <drepper@redhat.com>
4111 * elflint.c: Many, many more tests. Mostly related to symbol
4112 versioning. Those sections should now be completely checked.
4114 * readelf.c (print_dynamic): Use gelf_offscn.
4116 2005-08-04 Ulrich Drepper <drepper@redhat.com>
4118 * elflint.c: Add lots more tests: more extension symbol table sanity,
4119 versioning section tests, hash table tests. General cleanup.
4121 2005-08-02 Ulrich Drepper <drepper@redhat.com>
4123 * objdump.c: New file.
4124 * Makefile.am (bin_PROGRAMS): Add objdump.
4125 (objdump_LDADD): Define.
4127 * elflint.c (check_reloc_shdr): New function split out from check_rela
4129 (check_one_reloc): New function. Likewise.
4130 (check_rela): Use check_reloc_shdr and check_one_reloc.
4131 (check_rel): Likewise.
4132 (check_program_header): Check that PT_DYNAMIC entry matches .dynamic
4134 Add checks that relocations against read-only segments are flagged,
4135 that the text relocation flag is not set unnecessarily, and that
4136 relocations in one section are either against loaded or not-loaded
4139 2005-08-01 Ulrich Drepper <drepper@redhat.com>
4141 * elfcmp.c (main): Ignore section count and section name string table
4144 2005-07-27 Roland McGrath <roland@redhat.com>
4146 * elfcmp.c: Include <locale.h>.
4148 2005-07-27 Ulrich Drepper <drepper@redhat.com>
4150 * elfcmp.c: Print name and index of differing section.
4152 2005-07-24 Ulrich Drepper <drepper@redhat.com>
4154 * elfcmp.c: Implement comparing gaps between sections.
4156 2005-07-23 Ulrich Drepper <drepper@redhat.com>
4158 * elflint.c: Include libeblP.h instead of libebl.h.
4160 * readelf.c: Likewise.
4161 * elfcmp.c: Likewise.
4163 * elfcmp.c (main): Compare individual ELF header fields, excluding
4164 e_shoff instead of the whole struct at once.
4165 Use ebl_section_strip_p instead of SECTION_STRIP_P.
4166 * strip.c: Use ebl_section_strip_p instead of SECTION_STRIP_P.
4168 2005-07-22 Ulrich Drepper <drepper@redhat.com>
4170 * elfcmp.c (main): Take empty section into account when comparing
4173 * elflint.c (check_dynamic): Check that d_tag value is >= 0 before
4176 2005-07-21 Ulrich Drepper <drepper@redhat.com>
4178 * elfcmp.c: New file.
4179 * Makefile.am (bin_PROGRAMS): Add elfcmp.
4180 (elfcmp_LDADD): Define.
4182 * elflint.c (check_rela): Check that copy relocations only reference
4183 object symbols or symbols with unknown type.
4184 (check_rel): Likewise.
4186 2005-06-08 Roland McGrath <roland@redhat.com>
4188 * readelf.c (print_ops): Add consts.
4190 2005-05-31 Roland McGrath <roland@redhat.com>
4192 * readelf.c (print_debug_abbrev_section): Don't bail after first CU's
4193 abbreviations. Print a header line before each CU section.
4195 * readelf.c (print_debug_loc_section): Fix indentation for larger
4198 2005-05-30 Roland McGrath <roland@redhat.com>
4200 * readelf.c (print_debug_line_section): Print section offset of each
4201 CU's table, so they are easy to find from seeing the stmt_list value.
4203 * readelf.c (dwarf_attr_string): Add all attributes in <dwarf.h>.
4204 (attr_callback): Grok DW_AT_ranges and print offset in hex.
4206 * readelf.c (attr_callback): Add 2 to addrsize * 2 for %#0* format.
4207 (print_debug_ranges_section, print_debug_loc_section): Likewise.
4209 * readelf.c (print_ops): Take different args for indentation control.
4210 (attr_callback): Caller updated.
4211 Grok several more block-form attributes as being location expressions.
4212 For those same attributes with udata forms, format output differently
4213 for location list offset.
4214 (print_debug_loc_section): Implement it for real.
4216 * readelf.c (options): Mention ranges for --debug-dump.
4217 (enum section_e): Add section_ranges.
4218 (parse_opt): Grok "ranges" for -w/--debug-dump.
4219 (print_debug_ranges_section): New function.
4220 (print_debug): Handle .debug_ranges section.
4222 2005-05-30 Ulrich Drepper <drepper@redhat.com>
4224 * readelf.c (handle_notes): At least x86-64 need not have the note
4225 section values aligned to 8 bytes.
4227 2005-05-18 Ulrich Drepper <drepper@redhat.com>
4229 * readelf.c (dwarf_tag_string): Add new tags.
4231 2005-05-08 Roland McGrath <roland@redhat.com>
4233 * strip.c (handle_elf): Don't translate hash and versym data formats,
4234 elf_getdata already did it for us.
4236 2005-05-07 Ulrich Drepper <drepper@redhat.com>
4238 * Makefile.am (findtextrel_LDADD): Add $(libmudflap).
4239 (addr2line_LDADD): Likewise.
4241 2005-05-03 Roland McGrath <roland@redhat.com>
4243 * strip.c (handle_elf): Apply symbol table fixups to discarded
4244 relocation sections when they are being saved in the debug file.
4246 * strip.c (handle_elf): Pass EHDR->e_ident[EI_DATA] to gelf_xlatetom
4247 and gelf_xlatetof, not the native byte order.
4249 * strip.c (parse_opt): Give error if -f or -o is repeated.
4250 (main): Exit if argp_parse returns nonzero.
4252 * strip.c (debug_fname_embed): New variable.
4253 (options, parse_opt): New option -F to set it.
4255 2005-05-07 Ulrich Drepper <drepper@redhat.com>
4257 * readelf.c (parse_opt): Make any_control_option variable
4258 local. Simplify some tests.
4260 2005-05-03 Roland McGrath <roland@redhat.com>
4262 * strip.c (crc32_file): Function removed (now in ../lib).
4264 2005-05-03 Roland McGrath <roland@redhat.com>
4266 * elflint.c (is_debuginfo): New variable.
4267 (options, parse_opt): New option --debuginfo/-d to set it.
4268 (check_sections): If is_debuginfo, don't complain about SHT_NOBITS.
4269 (check_note): If is_debuginfo, don't try to get note contents.
4271 2005-04-24 Ulrich Drepper <drepper@redhat.com>
4273 * readelf.c (print_debug_abbrev_section): Don't print error when end of
4276 2005-04-14 Ulrich Drepper <drepper@redhat.com>
4278 * readelf.c (dwarf_encoding_string): New function.
4279 (dwarf_inline_string): New function.
4280 (dwarf_access_string): New function.
4281 (dwarf_visibility_string): New function.
4282 (dwarf_virtuality_string): New function.
4283 (dwarf_identifier_case_string): New function.
4284 (dwarf_calling_convention_string): New function.
4285 (dwarf_ordering_string): New function.
4286 (dwarf_discr_list_string): New function.
4287 (attr_callback): Decode man more attribute values.
4289 2005-04-01 Ulrich Drepper <drepper@redhat.com>
4291 * addr2line.c: Finish implementation of -f option.
4293 2005-03-29 Ulrich Drepper <drepper@redhat.com>
4295 * addr2line.c: New file.
4296 * Makefile.am (bin_PROGRAMS): Add addr2line.
4297 Define addr2line_LDADD.
4299 * findtextrel.c: Use new dwarf_addrdie function.
4301 * findtextrel.c: Fix usage message and re-add accidentally removed
4304 2005-03-28 Ulrich Drepper <drepper@redhat.com>
4306 * findtextrel.c: New file.
4307 * Makefile: Add rules to build findtextrel.
4309 2005-02-15 Ulrich Drepper <drepper@redhat.com>
4311 * ldlex.l: Provide ECHO definition to avoid warning.
4313 * elflint.c (check_program_header): Fix typo in RELRO test.
4315 * Makefile.am (AM_CFLAGS): Add more warning options.
4316 * elflint.c: Fix warnings introduced by the new warning options.
4317 * i386_ld.c: Likewise.
4320 * ldgeneric.c: Likewise.
4322 * readelf.c: Likewise.
4323 * sectionhash.c: Likewise.
4325 * string.c: Likewise.
4327 2005-02-05 Ulrich Drepper <drepper@redhat.com>
4329 * Makefile.am: Check for text relocations in constructed DSOs.
4331 * Makefile.am [MUDFLAP] (AM_CFLAGS): Add -fmudflap. Link all apps
4334 * ldscript.y: Add as_needed handling.
4335 * ldlex.l: Recognize AS_NEEDED token.
4336 * ld.h (struct filename_list): Add as_needed flag.
4338 2005-02-04 Ulrich Drepper <drepper@redhat.com>
4340 * elflint.c (check_symtab): Correctly determine size of GOT section.
4342 2005-01-19 Ulrich Drepper <drepper@redhat.com>
4344 * ld.c: Remove unnecessary more_help function. Print bug report
4346 * strip.c: Likewise.
4349 * readelf.c: Likewise.
4350 * elflint.c: Likewise.
4352 * elflint.c (main): Don't check for parameter problems here.
4353 (parse_opt): Do it here, where we get informed about some of them
4356 * readelf.c (main): Don't check for parameter problems here.
4357 (parse_opt): Do it here, where we get informed about some of them
4360 2005-01-11 Ulrich Drepper <drepper@redhat.com>
4362 * strip.c: Update copyright year.
4363 * readelf.c: Likewise.
4367 * elflint.c: Likewise.
4369 * elflint.c (check_symtab): Don't warn about wrong size for
4370 _DYNAMIC and __GLOBAL_OFFSET_TABLE__ for --gnu-ld.
4372 2004-10-05 Ulrich Drepper <drepper@redhat.com>
4374 * readelf.c (print_phdr): In section mapping, also indicate
4375 sections in read-only segments.
4377 2004-09-25 Ulrich Drepper <drepper@redhat.com>
4379 * readelf.c: Make compile with gcc 4.0.
4380 * strip.c: Likewise.
4382 2004-08-16 Ulrich Drepper <drepper@redhat.com>
4384 * strip.c (handle_elf): Rewrite dynamic memory handling to use of
4385 allocate to work around gcc 3.4 bug.
4387 2004-01-25 Ulrich Drepper <drepper@redhat.com>
4389 * ldlex.l (invalid_char): Better error message.
4391 2004-01-23 Ulrich Drepper <drepper@redhat.com>
4393 * readelf.c: Print SHT_GNU_LIBLIST sections.
4395 * none_ld.c: New file.
4397 2004-01-21 Ulrich Drepper <drepper@redhat.com>
4399 * Makefile.am: Enable building of machine specific linker.
4401 2004-01-20 Ulrich Drepper <drepper@redhat.com>
4403 * Makefile.am: Support building with mudflap.
4405 * i386_ld.c: Fix warnings gcc 3.4 spits out.
4406 * ldgeneric.c: Likewise.
4407 * ldscript.y: Likewise.
4408 * readelf.c: Likewise.
4409 * strip.c: Likewise.
4411 * readelf.c (print_debug_line_section): Determine address size
4414 2004-01-19 Ulrich Drepper <drepper@redhat.com>
4416 * readelf.c (print_phdr): Show which sections are covered by the
4419 * elflint.c (check_program_header): Check PT_GNU_RELRO entry.
4421 * readelf.c (print_debug_macinfo_section): Implement.
4423 2004-01-18 Ulrich Drepper <drepper@redhat.com>
4425 * readelf.c (print_debug_line_section): Implement.
4427 2004-01-17 Ulrich Drepper <drepper@redhat.com>
4429 * src/elflint.c: Use PACKAGE_NAME instead of PACKAGE.
4430 * src/ld.c: Likewise.
4431 * src/nm.c: Likewise.
4432 * src/readelf.c: Likewise.
4433 * src/size.c: Likewise.
4434 * src/strip.c: Likewise.
4436 * strip.c: Add a few more unlikely. Reduce scope of some variables.
4438 * Makefile.am: Support building with mudflap.
4440 2004-01-16 Ulrich Drepper <drepper@redhat.com>
4442 * readelf.c (print_debug_info_section): Free dies memory.
4444 * readelf.c: Print .debug_info section content.
4446 2004-01-13 Ulrich Drepper <drepper@redhat.com>
4448 * readelf.c (print_shdr): Add support for SHF_ORDERED and SHF_EXCLUDE.
4450 2004-01-12 Ulrich Drepper <drepper@redhat.com>
4452 * readelf.c (print_debug_aranges): Implement using libdw.
4454 2004-01-11 Ulrich Drepper <drepper@redhat.com>
4456 * nm.c: Adjust for Dwarf_Files type and dwarf_lineno interface change.
4458 * readelf.c: Use libdw instead of libdwarf. Not all of the old
4459 behavior is available yet.
4460 * Makefile.am: Link readelf with libdw. Remove libdwarf include path.
4462 2004-01-09 Ulrich Drepper <drepper@redhat.com>
4464 * nm.c (get_local_names): Adjust call to dwarf_nextcu.
4466 * nm.c: Implement getting information about local variables.
4468 2004-01-07 Ulrich Drepper <drepper@redhat.com>
4470 * nm.c: Read also debug information for local symbols.
4472 2004-01-05 Ulrich Drepper <drepper@redhat.com>
4474 * nm.c: Shuffle dwarf handling code around so the maximum column
4475 width can be computed ahead of printing. Avoid collection symbols
4476 which are not printed anyway.
4478 * nm.c: Rewrite dwarf handling to use libdw.
4479 * Makefile.am (AM_CFLAGS): Add -std parameter.
4480 (INCLUDES): Find header in libdw subdir.
4481 (nm_LDADD): Replace libdwarf with libdw.
4483 * elflint.c: Update copyright year.
4484 * readelf.c: Likewise.
4486 * strip.c: Likewise.
4489 2003-12-31 Ulrich Drepper <drepper@redhat.com>
4491 * strip.c (process_file): Close file before returning.
4493 2003-11-19 Ulrich Drepper <drepper@redhat.com>
4495 * readelf.c (handle_dynamic): Make column for tag name wider.
4497 2003-09-29 Ulrich Drepper <drepper@redhat.com>
4499 * readelf.c (handle_dynamic): Always terminate tag name with a space.
4501 2003-09-25 Ulrich Drepper <drepper@redhat.com>
4503 * strip.c (process_file): Don't mmap the input file, we modify the
4504 data structures and don't want the change end up on disk.
4506 2003-09-23 Jakub Jelinek <jakub@redhat.com>
4508 * unaligned.h (union u_2ubyte_unaligned,
4509 union u_4ubyte_unaligned, union u_8ubyte_unaligned): Add
4511 (add_2ubyte_unaligned, add_4ubyte_unaligned,
4512 add_8ubyte_unaligned): Avoid nesting bswap_NN macros.
4513 Read/store value through _ptr->u instead of *_ptr.
4515 2003-09-22 Ulrich Drepper <drepper@redhat.com>
4517 * size.c (show_sysv): Change type of maxlen to int.
4519 * strip.c (handle_elf): Handle the 64-bit archs which is 64-bit
4522 * i386_ld.c: Many many fixes and extensions.
4524 * ldgeneric.c: Likewise.
4526 2003-08-16 Ulrich Drepper <drepper@redhat.com>
4528 * ldgeneric.c (check_definition): Don't add symbol on dso_list if
4529 the reference is from another DSO.
4531 2003-08-15 Ulrich Drepper <drepper@redhat.com>
4533 * ldgeneric.c (find_entry_point): It is no fatal error if no entry
4534 point is found when creating a DSO.
4536 2003-08-14 Ulrich Drepper <drepper@redhat.com>
4538 * ld.c (main): Always call FLAG_UNRESOLVED.
4539 * ldgeneric.c (ld_generic_flag_unresolved): Only complain about
4540 undefined symbols if not creating DSO or ld_state.nodefs is not set.
4542 2003-08-13 Ulrich Drepper <drepper@redhat.com>
4544 * Makefile.in: Depend on libebl.a, not libebl.so.
4546 * ld.c (main): Mark stream for linker script as locked by caller.
4547 (read_version_script): Likewise.
4548 * ldlex.c: Define fread and fwrite to _unlocked variant.
4550 * i386_ld.c (elf_i386_finalize_plt): Replace #ifdefs with uses of
4552 * unaligned.h: Define target_bswap_16, target_bswap_32, and
4554 (store_2ubyte_unaligned, store_4ubyte_unaligned,
4555 store_8ubyte_unaligned): Define using new macros.
4557 2003-08-12 Ulrich Drepper <drepper@redhat.com>
4559 * i386_ld.c (elf_i386_finalize_plt): Use packed structs to access
4560 possibly unaligned memory. Support use of big endian machines.
4562 2003-08-11 Ulrich Drepper <drepper@redhat.com>
4564 * Moved to CVS archive.