1 2018-06-07 Mark Wielaard <mark@klomp.org>
3 * readelf.c (main): Lookup "no" for no_str.
4 (print_debug_abbrev_section): Use yes_str and no_str.
5 (print_form_data): Likewise.
7 2018-06-04 Mark Wielaard <mark@klomp.org>
9 * readelf (format_result): New static char pointer.
10 (format_result_size): New static size_t.
11 (format_dwarf_addr): Calculate max string size, reuse format_result
12 if possible, otherwise realloc. Use sprintf on result, not asprintf.
13 (print_ops): Don't free format_dwarf_addr, make sure result is
14 printed before calling format_dwarf_addr again.
15 (print_debug_addr_section): Likewise.
16 (print_debug_aranges_section): Likewise.
17 (print_debug_rnglists_section): Likewise.
18 (print_debug_ranges_section): Likewise.
19 (print_debug_frame_section): Likewise.
20 (attr_callback): Likewise.
21 (print_decoded_line_section): Likewise.
22 (print_debug_line_section): Likewise.
23 (print_debug_loclists_section): Likewise.
24 (print_debug_loc_section): Likewise.
25 (print_gdb_index_section): Likewsie.
27 2018-06-04 Mark Wielaard <mark@klomp.org>
29 * readelf.c (yes_str): New static char pointer.
31 (main): Set yes_str and no_str using gettext.
32 (attr_callback): Use yes_str and no_str instead of calling gettext.
34 2018-06-04 Mark Wielaard <mark@klomp.org>
36 * readelf.c (main): Call __fsetlocking (stdout, FSETLOCKING_BYCALLER).
38 2018-05-31 Mark Wielaard <mark@klomp.org>
40 * readelf.c (print_debug_units): Print the dwo name and id when
41 unable to find a .dwo file.
43 2018-05-31 Mark Wielaard <mark@klomp.org>
45 * readelf.c (enum section_e): Make section_types not an alias of
47 (section_all): Add section_types.
48 (parse_opt): Add both section_info and section_types for "info"
50 (print_debug_units): Don't be silent for debug_types.
52 2018-05-31 Mark Wielaard <mark@klomp.org>
54 * readelf.c (attr_callback): Only register section_loc when not
55 looking at a split dwarf from a skeleton.
57 2018-05-30 Mark Wielaard <mark@klomp.org>
59 * readelf.c (print_debug_loc_section): Use correct listptr for
62 2018-05-31 Mark Wielaard <mark@klomp.org>
64 * readelf.c (print_debug_units): Check offset against -1 not ~0ul.
66 2018-05-29 Mark Wielaard <mark@klomp.org>
68 * readelf.c (print_debug_loc_section): Handle GNU DebugFission list
71 2018-05-29 Mark Wielaard <mark@klomp.org>
73 * readelf.c (print_debug): Record and reset section_info status in
74 implicit_debug_sections and print_debug_sections.
76 2018-05-28 Mark Wielaard <mark@klomp.org>
78 * readelf.c (print_debug_units): Turn "Could not find split compile
79 unit" into an Warning instead of an error.
81 2018-04-29 Mark Wielaard <mark@klomp.org>
83 * readelf.c (parse_opt): Request implicit section_info for "str".
84 (known_stroffbases): New static variable.
85 (attr_callbackattr_callback): Handle DW_AT_str_offets_base.
86 (print_debug_str_offsets_section): New function.
87 (print_debug): Handle .debug_str_offsets as section_str. Reset
90 2018-04-27 Mark Wielaard <mark@klomp.org>
92 * readelf.c (options): Add addr.
93 (enum section_e): Add section_addr.
94 (section_all): Add section_addr.
95 (parse_opt): Parse "addr".
96 (known_addrbases): New static variable.
97 (get_listptr): New function.
98 (print_debug_addr_section): Likewise.
99 (attr_callback): Handle DW_AT_addr_base and DW_AT_GNU_addr_base.
100 (print_debug): Add NEW_SECTION (addr). Reset known_addrbases.
102 2018-04-07 Mark Wielaard <mark@klomp.org>
104 * readelf.c (attr_callback): Handle DW_FORM_loclistx and
107 2018-04-12 Mark Wielaard <mark@klomp.org>
109 * readelf.c (dwarf_loc_list_encoding_string): New functions.
110 (dwarf_loc_list_encoding_name): Likewise.
111 (known_loclistptr): Renamed and split in two...
112 (known_locsptr): this and ...
113 (known_loclistsptr): this.
114 (listptr_base): Split out...
115 (cudie_base): ...this.
116 (is_split_dwarf): New function.
117 (attr_callback): Handle DW_AT_loclists_base and notice sec_offset
119 (print_debug_rnglists_section): Use spit_dwarf_cu_base.
120 (print_debug_loclists_section): New function.
121 (print_debug_loc_section): Use known_locsptr instead of
123 (print_debug): Recognize .debug_loclists. Reset known_locsptr and
126 2018-05-25 Mark Wielaard <mark@klomp.org>
128 * readelf.c (DWARF_SKELETON): New constant.
129 (do_not_close_dwfl): New bool.
130 (options): Add dwarf-skeleton.
131 (dwarf_skeleton): New static variable.
132 (parse_opt): Handle DWARF_SKELETON, set dwarf_skeleton.
133 (create_dwfl): New function, with code extracted from...
134 (process_file): ...here. Check do_not_close_dwfl.
135 (is_split_darf): New function.
136 (getone_dwflmod): Likewise.
137 (print_debug): Use new functions to find skeleton DWARF file to use
138 when inspecting .dwo split DWARF file.
140 2018-04-11 Mark Wielaard <mark@klomp.org>
142 * readelf.c (dwarf_range_list_encoding_string): New function.
143 (dwarf_range_list_encoding_name): Likewise.
144 (known_rnglistptr): New static variable.
145 (listptr_cu): New function.
146 (print_debug_rnglists_section): Likewise.
147 (attr_callback): Call notice_listptr for DW_AT_ranges. Handle
148 DW_AT_rnglists_base. Handle DW_FORM_rnglistx. DW_AT_start_scope
149 can also have a rnglist.
150 (print_debug_units): Do (silently) scan split DWARF also for
151 debug_ranges before DWARF5 to catch all rangelistptrs.
152 (print_debug): Recognize .debug_rnglists. Reset known_rnglistptr.
154 2018-01-21 Mark Wielaard <mark@klomp.org>
156 * readelf.c (get_indexed_addr): New function.
157 (print_ops): Handle DW_OP_addrx, DW_OP_GNU_addr_index,
158 DW_OP_constx, DW_OP_GNU_const_index separately and resolve
160 (attr_callback): Print index and address for
161 DW_FORM_GNU_addr_index and DW_FORM_addrx[1234].
163 2018-01-19 Mark Wielaard <mark@klomp.org>
165 * readelf.c (options): Add info+.
166 (show_split_units): New static boolean defaulting to false.
167 (parse_opt): For all (no arg) --debug-dump set show_split_units
168 to yes. For "info+" enable section_info and show_split_units.
169 (attrcb_args): Add is_split field.
170 (attr_callback): Use is_split to format DIE offsets differently.
171 (print_debug_units): Likewise. Get subdie (type or split) only
172 when needed. When not silent reiterate over split DIEs when
175 2018-05-15 Mark Wielaard <mark@klomp.org>
177 * readelf.c (print_debug_units): Print unit type and id for any
178 unit type that has it even when version < 5.
180 2018-05-14 Mark Wielaard <mark@klomp.org>
182 * readelf.c (print_ops): Handle DW_OP_GNU_addr_index and
183 DW_OP_GNU_const_index.
184 (attr_callback): Handle DW_FORM_GNU_addr_index as DW_FORM_addrx.
185 Handle DW_FORM_GNU_str_index as DW_FORM_constx. Add as_hex_id.
186 Handle DW_AT_GNU_dwo_id as_hex_id.
187 (print_form_data): Handle DW_FORM_GNU_str_index as DW_FORM_strx.
189 2018-05-12 Mark Wielaard <mark@klomp.org>
191 * readelf.c (print_debug): Also recognize .dwo section name variants.
193 2018-05-15 Dmitry V. Levin <ldv@altlinux.org>
195 * elflint.c (check_elf_header): Fix typo in error diagnostics.
197 2018-05-15 Mark Wielaard <mark@klomp.org>
199 * readelf.c (print_form_data): Cast comparisons against offset_len to
201 (print_debug_line_section): Print uint64_t as PRIu64.
203 2018-05-11 Mark Wielaard <mark@klomp.org>
205 * readelf.c (print_debug_macro_section): Use libdw_valid_user_form.
206 Use print_form_data for strx and sup strings.
208 2018-05-09 Mark Wielaard <mark@klomp.org>
210 * readelf.c (dwarf_line_content_description_string): New function.
211 (dwarf_line_content_description_name): Likewise.
212 (print_bytes): Likewise.
213 (print_form_data): Likewise. Based on code taken from...
214 (print_debug_macro_section): ...here. Now calls print_form_data
215 and str_offsets_base_off.
216 (print_debug_line_section): Parse DWARF5 header, directory and file
219 2018-05-12 Mark Wielaard <mark@klomp.org>
221 * addr2line.c (main): Add fflush (stdout) after handle_address ()
222 when reading from stdin.
224 2018-04-24 Mark Wielaard <mark@klomp.org>
226 * readelf.c (print_debug_aranges_section): Try elf_rawdata if no
228 (print_debug_ranges_section): Likewise.
229 (print_debug_frame_section): Likewise.
230 (print_debug_line_section): Likewise. Check for data == NULL.
231 (print_debug_loc_section): Likewise.
232 (print_debug_macinfo_section): Likewise.
233 (print_debug_macro_section): Likewise.
235 2018-04-28 Mark Wielaard <mark@klomp.org>
237 * readelf.c (print_debug): If .debug_info is needed implicitly by
238 then handle it first before handling any other debug section.
239 (parse_opt): Set implicit_debug_sections to section_info when
240 showing all debug sections.
242 2018-05-05 Mark Wielaard <mark@klomp.org>
244 * readelf.c (attr_callback): Handle DW_FORM_ref_sup4 and
245 DW_FORM_ref_sup8 as references.
247 2018-04-24 Mark Wielaard <mark@klomp.org>
249 * readelf.c (print_debug_str_section): Take raw section data. Don't
250 use dwarf_getstring, but determine start and end of string from
251 offset and section data directly.
252 (print_debug): Handle ".debug_line_str" like ".debug_str".
254 2018-04-19 Andreas Schwab <schwab@suse.de>
256 * elflint.c (valid_e_machine): Add EM_RISCV.
258 2018-04-16 Mark Wielaard <mark@klomp.org>
260 * readelf.c (print_debug_line_section). In advance_pc, advance
261 using op_addr_advance, not op_advance.
263 2018-04-14 Mark Wielaard <mark@klomp.org>
265 * readelf.c (attr_callback): Only show errors when not silent.
267 2018-03-23 Mark Wielaard <mark@klomp.org>
269 * readelf.c (attr_callback): Handle DW_FORM_strx[1234].
271 2018-03-22 Mark Wielaard <mark@klomp.org>
273 * readelf.c (attr_callback): Handle DW_FORM_addrx[1234].
275 2018-03-28 Mark Wielaard <mark@klomp.org>
277 * readelf.c (handle_sysv_hash): Break bucket chain after nchain
279 (handle_sysv_hash64): Likewise.
281 2018-03-27 Mark Wielaard <mark@klomp.org>
283 * readelf.c (attr_callback): Print dwarf_dieoffset as %PRIx64,
286 2018-03-20 Mark Wielaard <mark@klomp.org>
288 * readelf.c (attr_callback): Report error when DW_AT_decl_file or
289 DW_AT_call_file cannot be resolved.
291 2018-03-06 Mark Wielaard <mark@klomp.org>
293 * readelf.c (print_ops): Handle DW_OP_addrx, DW_OP_constx,
294 DW_OP_implicit_pointer, DW_OP_entry_value, DW_OP_const_type,
295 DW_OP_regval_type, DW_OP_deref_type, DW_OP_xderef_type,
296 DW_OP_convert, DW_OP_reinterpret.
298 2018-03-01 Mark Wielaard <mark@klomp.org>
300 * readelf.c (struct listptr): Add attr field.
301 (compare_listptr): Warn when two listptrs for the same offset have
302 different attributes.
303 (notice_listptr): Take attr as argument and add it to listptr.
304 (skip_listptr_hole): New attr argument.
305 (next_listptr_offset): New function.
306 (print_debug_ranges_section): Pass NULL attr to skip_listptr_hole.
307 (attr_callback): Handle DW_AT_GNU_locviews. Call notice_listptr with
309 (print_debug_loc_section): Keep track of which attr is associated with
310 a listptr. If the attr is DW_AT_GNU_locview print view pairs till the
313 2018-02-09 Mark Wielaard <mark@klomp.org>
315 * elflint.c (check_group): Make sure we can read a complete
316 element when iterating over the group.
318 2018-02-09 Mark Wielaard <mark@klomp.org>
320 * readelf.c (attr_callback): Handle DW_FORM_data16 as Dwarf_Block.
322 2018-02-09 Mark Wielaard <mark@klomp.org>
324 * readelf.c (print_debug_abbrev_section): Print the value of a
325 DW_FORM_implicit_const using dwarf_getabbrevattr_data.
326 (attr_callback): Handle DW_FORM_implicit_const.
328 2018-01-30 Mark Wielaard <mark@klomp.org>
330 * readelf.c (dwarf_unit_string): New function.
331 (dwarf_unit_name): Likewise.
332 (print_debug_units): Use dwarf_get_units and dwarf_cu_die instead
333 of dwarf_next_unit. Print unit type, id and subdie if available.
335 2018-02-09 Joshua Watt <JPEWhacker@gmail.com>
337 * addr2line.c (handle_address): Use FALLTHROUGH macro instead of
339 * elfcompress.c (parse_opt): Likewise.
340 * elflint.c (check_dynamic): Likewise.
341 (check_sections): Likewise.
342 (check_note_data): Likewise.
343 * objdump.c (parse_opt): Likewise.
344 * readelf.c (parse_opt): Likewise.
345 (attr_callback): Likewise.
346 (handle_auxv_note): Likewise.
347 * strings.c (parse_opt): Likewise.
348 * backtrace.c (callback_verify): Likewise.
350 2018-01-25 Mark Wielaard <mark@klomp.org>
352 * readelf.c (print_debug_ranges_section): Initialize cu to last_cu.
353 (print_debug_loc_section): Likewise.
355 2018-01-01 Mark Wielaard <mark@klomp.org>
357 * readelf.c (attr_callback): Use dwarf_form_name for unknown forms.
358 (print_debug_macro_section): Print form using dwarf_form_name.
360 2017-12-28 Mark Wielaard <mark@klomp.org>
362 * readelf.c (print_debug_units): Print DIE offset in error message
365 2017-12-18 Mark Wielaard <mark@klomp.org>
367 * readelf.c (handle_notes_data): Don't use EXIT_FAILURE in error.
368 Adjust error message depending on whether or not we got data.
370 2017-12-07 Mark Wielaard <mark@klomp.org>
372 * readelf.c (print_ops): Update data pointer and print arguments
373 to DW_OP_call2 and DW_OP_call4 as DIE offsets.
375 2017-11-29 Mark Wielaard <mark@klomp.org>
377 * readelf.c (argp_options): Add "section-groups", 'g'.
379 2017-11-29 Mark Wielaard <mark@klomp.org>
381 * readelf.c (print_debug_loc_section): Print CU base and unresolved
382 addresses. Adjust formatting.
384 2017-11-29 Mark Wielaard <mark@klomp.org>
386 * readelf.c (print_debug_ranges_section): Print CU base and unresolved
387 addresses. Adjust formatting.
389 2017-11-29 Mark Wielaard <mark@klomp.org>
391 * readelf.c (attr_callback): Set valuestr to resolved file name
392 for DW_AT_decl_file and DW_AT_call_file.
394 2017-11-29 Mark Wielaard <mark@klomp.org>
396 * readelf.c (print_debug_units): Print abbrev code after DIE tag.
398 2017-11-29 Mark Wielaard <mark@klomp.org>
400 * readelf.c (print_ops): Use only2 space for index. re-indent +5
401 for DW_OP_GNU_entry_value.
403 2017-11-21 Mark Wielaard <mark@klomp.org>
405 * readelf.c (attr_callback): Print attribute name and form in error
406 message. If only the value cannot be retrieved/resolved don't abort.
408 2017-10-03 Mark Wielaard <mark@klomp.org>
410 * readelf.c (attr_callback): Print DIE offset in error messages.
412 2017-11-03 Mark Wielaard <mark@klomp.org>
414 * readelf.c (print_ops): Handle DW_OP_GNU_variable_value. Print
415 referenced DIE as offset.
417 2017-09-10 Mark Wielaard <mark@klomp.org>
419 * ar.c (do_oper_delete): Remove DEBUG conditional check.
420 (no0print): Return bool. Check snprintf return value.
421 (do_oper_insert): Initialize elf. Remove DEBUG conditional check.
422 Check no0print calls succeed. Explicitly elf_end found elfs.
423 (do_oper_extract): Make sure we don't create an empty variable
426 2017-09-01 Mark Wielaard <mark@klomp.org>
428 * stack.c (main): Replace \v in doc string with \n\n.
429 * unstrip.c (main): Likewise.
431 2017-05-04 Ulf Hermann <ulf.hermann@qt.io>
433 * stack.c: Print pid_t using %lld.
435 2017-08-18 Ulf Hermann <ulf.hermann@qt.io>
437 * readelf.c: Hardcode the signal numbers for non-linux systems.
439 2017-07-26 Mark Wielaard <mark@klomp.org>
441 * readelf.c (print_debug_macro_section): Accept either version 4 or
442 version 5. Use DW_MACRO names instead of DW_MACRO_GNU names. Add
443 minimal support for DW_MACRO_define_sup, DW_MACRO_undef_sup,
444 DW_MACRO_import_sup, DW_MACRO_define_strx and DW_MACRO_undef_strx.
446 2017-07-26 Mark Wielaard <mark@klomp.org>
448 * readelf.c (dwarf_defaulted_string): New function.
449 (dwarf_defaulted_name): Likewise.
450 (attr_callback): Use dwarf_defaulted_name to get value of
453 2017-07-20 Mark Wielaard <mark@klomp.org>
455 * strip.c (handle_elf): Deal with data marker symbols pointing to
456 debug sections (they can be removed).
458 2017-07-14 Mark Wielaard <mark@klomp.org>
460 * strip (OPT_KEEP_SECTION): New define.
461 (options): Add documentation for remove-section. Add keep-section.
462 (struct section_pattern): New data type.
463 (keep_secs, remove_secs): New globals.
464 (add_pattern, free_sec_patterns, free_patterns, section_name_matches):
466 (main): Call free_patterns.
467 (parse_opt): Handle 'R' and OPT_KEEP_SECTION. Check remove_comment
469 (handle_elf): Handle and sanity check keep_secs and remove_secs.
471 2017-06-07 Mark Wielaard <mark@klomp.org>
473 * strip.c (handle_elf): Introduce new handle_elf boolean. Use it to
474 determine whether to create an output and/or debug file. Remove new
475 output file on error.
477 2017-06-06 Mark Wielaard <mark@klomp.org>
479 * strip.c (handle_elf): Assume e_shstrndx section can be removed.
481 2017-04-20 Ulf Hermann <ulf.hermann@qt.io>
483 * readelf.c: Include strings.h.
485 2017-04-20 Ulf Hermann <ulf.hermann@qt.io>
487 * unstrip.c: Check shnum for 0 before subtracting from it.
489 2017-04-20 Ulf Hermann <ulf.hermann@qt.io>
491 * readelf.c: Replace YESSTR and NOSTR with gettext ("yes") and
492 gettext ("no"), respectively.
494 2017-04-05 Mark Wielaard <mark@klomp.org>
496 * elflint.c (check_elf_header): Decompress all sections.
498 2017-03-28 Mark Wielaard <mark@klomp.org>
500 * elflint (check_group): Don't check if there is no flag word.
502 2017-03-27 Mark Wielaard <mark@klomp.org>
504 * elflint.c (check_elf_header): Sanity check phnum and shnum.
506 2017-03-27 Mark Wielaard <mark@klomp.org>
508 * elflint.c (check_sysv_hash): Return early if section size is
510 (check_sysv_hash64): Likewise.
511 (check_hash): Calculate expect_entsize to check section size.
513 2017-03-27 Mark Wielaard <mark@klomp.org>
515 * elflint.c (check_symtab_shndx): Check data->d_size.
517 2017-03-24 Mark Wielaard <mjw@redhat.com>
519 * elfcmp.c (main): If n_namesz == 0 then the note name data is the
521 * readelf.c (handle_notes_data): Likewise.
523 2017-03-24 Mark Wielaard <mjw@redhat.com>
525 * readelf.c (handle_gnu_hash): Check inner < max_nsyms before
526 indexing into chain array.
528 2017-02-16 Ulf Hermann <ulf.hermann@qt.io>
530 * addr2line.c: Include printversion.h
532 * elflint.c: Likewise.
534 * objdump.c: Likewise.
535 * ranlib.c: Likewise.
536 * readelf.c: Likewise.
539 * strings.c: Likewise.
541 * elfcmp.c: Include printversion.h, remove system.h include.
542 * elfcompress.c: Likewise.
543 * findtextrel.c: Likewise.
544 * unstrip.c: Likewise.
546 2017-02-14 Ulf Hermann <ulf.hermann@qt.io>
548 * nm.c: Include color.h.
549 * objdump.c: Likewise.
551 2016-12-24 Mark Wielaard <mark@klomp.org>
553 * Makefile.am (findtextrel_LDADD): Add $(libeu).
554 (addr2line_LDADD): Likewise.
555 (elfcmp_LDADD): Likewise.
556 * addr2line.c (print_version): Removed.
557 * ar.c (print_version): Likewise.
558 * elfcmp.c (print_version): Likewise.
559 * elfcompress.c (print_version): Likewise.
560 * elflint.c (print_version): Likewise.
561 * findtextrel.c (print_version): Likewise.
562 * nm.c (print_version): Likewise.
563 * objdump.c: Likewise.
564 * ranlib.c: Likewise.
565 * readelf.c: Likewise.
568 * strings.c: Likewise.
570 * unstrip.c: Likewise.
572 2016-11-17 Mark Wielaard <mjw@redhat.com>
574 * readelf.c (options): Add optional arg SECTION for symbols.
575 (symbol_table_section): New static variable.
576 (parse_opt): Set symbol_table_section on 's'.
577 (print_symtab): Filter on symbol_table_section name is set.
579 2016-11-10 Mark Wielaard <mjw@redhat.com>
581 * ar.c (write_member): Make sure tmpbuf is large enough to contain
582 a starting '/' and ending '\0' char.
583 (do_oper_insert): Likewise.
584 * arlib.c (arlib_finalize): Format tmpbuf as PRId32 decimal.
586 2016-11-02 Mark Wielaard <mjw@redhat.com>
588 * addr2line.c (handle_address): Add fallthrough comment.
589 * elfcompress.c (parse_opt): Adjust fallthrough comment.
590 * elflint.c (parse_opt): Add missing break after 'd' case.
591 (check_sections): Add fallthrough comments.
592 * objdump.c (parse_opt): Add explantion for fallthrough comment.
594 2016-10-22 Kevin Cernekee <cernekee@chromium.org>
596 * unstrip.c: Fix "invalid string offset" error caused by using the
597 unstripped .symtab with the stripped .strtab.
599 2016-10-11 Akihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>
601 * arlib.c: Remove system.h include, add libeu.h include.
602 * arlib2.c: Remove sys/param.h include.
603 * elfcompress.c: Add libeu.h include.
604 * elflint.c: Remove sys/param.h include, add libeu.h include.
606 * objdump.c: Likewise.
607 * ranlib.c: Likewise.
608 * readelf.c: Likewise.
609 * size.c: Remove sys/param.h include.
610 * strings.c: Likewise, add libeu.h include.
612 * unstrip.c: Likewise.
614 2016-10-06 Mark Wielaard <mjw@redhat.com>
616 * strip.c (handle_elf): Don't remove real symbols from allocated
619 2016-08-25 Mark Wielaard <mjw@redhat.com>
621 * strip.c (handle_elf): Recompress with ELF_CHF_FORCE.
623 2016-08-06 Mark Wielaard <mjw@redhat.com>
625 * strip.c (handle_elf): Uncompress and recompress relocation target
626 section if necessary.
628 2016-07-08 Mark Wielaard <mjw@redhat.com>
630 * Makefile.am (strip_LDADD): Add libdw.
631 * elfcompress.c (process_file): Use dwelf_strtab functions instead of
633 * strip.c (handle_elf): Likewise.
634 * unstrip.c (new_shstrtab): Likewise.
636 2016-07-06 Mark Wielaard <mjw@redhat.com>
638 * elf32-i386.script, i386_ld.c, ld.c, ld.h, ldgeneric.c, ldlex.l,
639 ldscript.y, libld_elf_i386.map, none_ld.c, sectionhash.c,
640 sectionhash.h, symbolhash.c, symbolhash.h, unaligned.h,
641 versionhash.c, versionhash.h, xelf.h: Removed.
642 * Makefile.am (YACC): Removed.
643 (AM_YFLAGS): Removed.
644 (AM_LFLAGS): Removed.
645 (native_ld): Removed.
647 (bin_PROGRAMS): Removed ld.
649 (ld_SOURCES): Removed.
650 (noinst_LIBRARIES): Only libar.a.
651 (EXTRA_DIST): Just arlib.h and debugpred.h.
653 (ld_LDFLAGS): Removed.
655 (ldscript.h): Removed.
657 (CLEANFILES): Just *.gconv.
658 (MAINTAINERCLEANFILES): Removed.
660 2016-07-06 Mark Wielaard <mjw@redhat.com>
662 * unstrip.c (copy_elided_sections): Use unstripped_strent[] from
663 index zero, instead of one.
665 2016-06-28 Richard Henderson <rth@redhat.com>
667 * elflint.c (valid_e_machine): Add EM_BPF.
669 2016-04-11 David Abdurachmanov <davidlt@cern.ch>
671 * elfcmp.c (main): Fix self-comparison error with GCC 6.
673 2016-03-21 Mark Wielaard <mjw@redhat.com>
675 * nm.c (show_symbols): Check for malloc size argument overflow.
677 2016-02-13 Mark Wielaard <mjw@redhat.com>
679 * readelf.c (print_scngrp): Call error when gelf_getshdr fails.
680 (print_symtab): Likewise.
681 (handle_hash): Likewise.
682 (dump_data_section): Print a warning if decompressing fails.
683 (print_string_section): Likewise.
685 2016-02-13 Mark Wielaard <mjw@redhat.com>
687 * elfcompress.c (parse_opt): Don't fallthrough after processing -q.
689 2016-02-12 Mark Wielaard <mjw@redhat.com>
691 * strip.c (handle_elf): Correct elf_assert shndxdata check.
693 2016-02-09 Mark Wielaard <mjw@redhat.com>
695 * readelf.c (read_encoded): Move up.
696 (print_cfa_program): Add encoding argument. Use it for read_encoded
697 when reading DW_CFA_set_loc op.
698 (print_debug_frame_section): Pass fde_encoding to print_cfa_program.
700 2016-02-09 Mark Wielaard <mjw@redhat.com>
702 * elflint.c (compare_hash_gnu_hash): Check hash sh_entsize against
703 sizeof (Elf64_Xword). Correct invalid sh_entsize error message
704 section idx and name.
706 2016-01-13 Mark Wielaard <mjw@redhat.com>
708 * elflint.c (check_elf_header): Recognize ELFOSABI_FREEBSD.
710 2016-01-08 Mark Wielaard <mjw@redhat.com>
712 * elfcompress.c (compress_section): Use %zu to print size_t.
713 * readelf.c (print_shdr): Use %zx to print size_t.
715 2015-12-16 Mark Wielaard <mjw@redhat.com>
717 * elfcompress.c: New file.
718 * Makefile.am (bin_PROGRAMS): Add elfcompress.
719 (elfcompress_LDADD): New variable.
721 2015-12-18 Mark Wielaard <mjw@redhat.com>
723 * elflint.c (section_flags_string): Add NEWFLAG COMPRESSED.
724 (check_sections): SHF_COMPRESSED can be on any special section.
725 SHF_COMPRESSED is a valid section flag. SHF_COMPRESSED cannot
726 be used together with SHF_ALLOC or with SHT_NOBITS. Should have
729 2015-10-20 Mark Wielaard <mjw@redhat.com>
731 * readelf.c (options): Expand -z help text.
732 (dump_data_section): Check whether we need and can decompress section
733 data and call elf_rawzdata if so,
734 (print_string_section): Likewise.
735 (elf_contains_chdrs): New function.
736 (process_elf_file): Rename print_unrelocated to print_unchanged,
737 use elf_contains_chdrs.
738 (print_scngrp): Check whether section is compressed before use.
739 (print_symtab): Likewise.
740 (handle_hash): Likewise.
742 2015-10-16 Mark Wielaard <mjw@redhat.com>
744 * readelf.c (argp_option): Describe --decompress,-z.
745 (print_decompress): New bool.
746 (parse_opt): Handle -z.
747 (elf_ch_type_name): New function.
748 (print_shdr): Print section compress information.
750 2015-12-31 Mark Wielaard <mjw@redhat.com>
752 * elflint.c (check_symtab): Add _edata and _end (plus extra underscore
753 variants) to to the list of possibly dangling symbols.
755 2015-12-02 Mark Wielaard <mjw@redhat.com>
757 * nm.c (process_file): Accept fd and pass it on.
758 (handle_elf): Likewise.
759 (find_no_debuginfo): New.
760 (struct getdbg): Likewise.
761 (getdbg_dwflmod): Likewise.
762 (show_symbols): Take fd. If the file is ET_REL use libdwfl to get
765 2015-12-02 Mark Wielaard <mjw@redhat.com>
767 * nm.c (get_local_names): Check for duplicates in local_root tree.
769 2015-12-02 Mark Wielaard <mjw@redhat.com>
771 * unstrip.c (struct data_list): New.
772 (new_data_list): Likewise.
773 (record_new_data): Likewise.
774 (free_new_data): Likewise.
775 (adjust_relocs): Call record_new_data.
776 (add_new_section_symbols): Likewise.
777 (copy_elided_sections): Call free_new_data.
779 2015-12-01 Mark Wielaard <mjw@redhat.com>
781 * elfcmp.c (main): Close ebl1 and ebl2 backends.
783 2015-10-16 Mark Wielaard <mjw@redhat.com>
785 * Makefile.am [BUILD_STATIC](libdw): Add -lz.
786 [BUILD_STATIC](libelf): Likewise.
788 2015-10-16 Mark Wielaard <mjw@redhat.com>
790 * elflint.c (check_symtab): Don't check TLS symbol value against TLS
791 phdr offset in debuginfo files.
792 (check_sections): Don't try to match section offsets to phdrs offsets
795 2015-10-16 Mark Wielaard <mjw@redhat.com>
797 * elflint.c (check_reloc_shdr): Reject only desthdrs if they have both
798 SHF_MERGE and SHF_STRINGS set.
800 2015-10-13 Jose E. Marchesi <jose.marchesi@oracle.com>
802 * elflint.c (check_sections): Do not rely on
803 ebl_check_special_section when checking debuginfo files. Also
804 check that the type of WE sections in debuginfo files is NOBITS.
806 2015-10-13 Mark Wielaard <mjw@redhat.com>
808 * elflint.c (check_program_header): Check relro flags are a subset
809 of the load segment if they don't fully overlap.
811 2015-10-07 Mark Wielaard <mjw@redhat.com>
813 * Makefile.am (ldlex_no_Wstack_usage): New.
814 * ldlex.l ([RWX]): Make cnt unsigned.
816 2015-10-09 Josh Stone <jistone@redhat.com>
818 * elflint.c (main): Replace stat64 and fstat64 with stat and fstat.
819 * readelf.c (process_file): Likewise.
820 (process_elf_file): Replace off64_t with off_t.
821 * findtextrel.c (process_file): Replace open64 with open.
822 * ld.c (main): Replace sizeof (off64_t) with 8.
823 * strings.c: Replace off64_t with off_t throughout.
824 (main): Replace stat64 and fstat64 with stat and fstat.
825 (map_file): Replace mmap64 with mmap.
826 (read_block): Likewise, and replace lseek64 with lseek.
827 * strip.c (handle_elf): Replace ftruncate64 with ftruncate.
828 (process_file): Replace stat64 and fstat64 with stat and fstat.
829 * unstrip.c (parse_opt): Replace stat64 with stat.
830 (handle_file): Replace open64 with open.
831 (open_file): Likewise.
833 2015-10-08 Chih-Hung Hsieh <chh@google.com>
835 * ld.c (determine_output_format): Move recursive nested
836 function "try" to file scope.
838 2015-10-04 Mark Wielaard <mjw@redhat.com>
840 * strip.c (handle_elf): Only sanity check section symbols to not
841 kept discarded sections if we are creating a debug file.
843 2015-10-07 Mark Wielaard <mjw@redhat.com>
845 * unstrip.c (MAX): Removed.
846 (find_alloc_sections_prelink): Allocate exact amount of bytes for
849 2015-10-05 Chih-Hung Hsieh <chh@google.com>
851 * unstrip.c (find_alloc_sections_prelink): Do not allocate
852 on stack union types with variable length arrays; use xmalloc
853 for such dynamic sized objects.
854 * readelf.c (handle_core_item): Likewise, but use alloca
855 for small variable size data object and add assert(count < 128).
857 2015-10-05 Josh Stone <jistone@redhat.com>
859 * Makefile.am (libld_elf_i386.so): Add AM_V_CCLD silencer.
860 (.deps/none_ld.Po): Always silence the dummy command.
861 (make-debug-archive): Add AM_V_GEN and AM_V_at silencers.
863 2015-10-02 Mark Wielaard <mjw@redhat.com>
865 * unstrip.c (copy_elided_sections): Use SH_INFO_LINK_P, not just
868 2015-10-02 Mark Wielaard <mjw@redhat.com>
870 * strip.c (handle_elf): Don't move around allocated NOBITS sections.
871 Don't just mark the section header string table as unused.
872 * unstrip.c (copy_elided_sections): Add header names to strtab if
873 shstrndx equals the symtab strtabndx.
875 2015-09-22 Mark Wielaard <mjw@redhat.com>
877 * strip.c (cleanup_debug): Remove old-style function definitions.
879 2015-09-09 Chih-Hung Hsieh <chh@google.com>
881 * readelf.c (print_debug_exception_table): Initialize variable before
882 it is used, because compiler does not know that error never returns.
883 (dump_arhive_index): Likewise.
885 2015-09-04 Chih-Hung Hsieh <chh@google.com>
887 * elflint.c (check_group): Replace %Z length modifier with %z.
888 (check_note_data): Likewise.
889 * findtextrel.c (process_file): Likewise.
890 * readelf.c (handle_dynamic): Likewise.
891 (handle_symtab): Likewise.
892 (handle_verneed): Likewise.
893 (handle_verdef): Likewise.
894 (handle_versym): Likewise.
895 (print_hash_info): Likewise.
896 (print_decoded_aranges_section): Likewise.
897 (print_debug_aranges_section): Likewise.
898 (print_debug_line_section): Likewise.
899 (hex_dump): Likewise.
900 (dump_data_section): Likewise.
901 (print_string_section): Likewise.
902 (dump_archive_index): Likewise.
903 * unstrip.c (adjust_relocs): Likewise.
904 (collect_symbols): likewise.
905 (get_section_name): Likewise.
906 (find_alloc_sections_prelink): Likewise.
907 (copy_elided_sections): Likewise.
908 * ldscript.y (add_id_list): Add missing '%s'.
910 2015-09-03 Mark Wielaard <mjw@redhat.com>
912 * readelf.c (handle_core_item): Handle right shift >= 32 bits.
914 2015-08-11 Mark Wielaard <mjw@redhat.com>
916 * elflint.c (check_sections): When gnuld and a NOBITS section falls
917 inside a segment make sure any ELF file contents is zero.
919 2015-07-29 Mark Wielaard <mjw@redhat.com>
921 * unstrip.c (sections_flags_match): New function.
922 (sections_match): Use sections_flags_match.
923 (find_alloc_sections_prelink): Only clear matched sections if there
925 (copy_elided_sections): Add SHF_INFO_LINK to shdr_mem.sh_flags if
928 2015-06-27 Pino Toscano <toscano.pino@tiscali.it>
930 * src/strings.c: Define MAP_POPULATE if not defined already.
932 2015-06-27 Mark Wielaard <mjw@redhat.com>
934 * nm.c (show_symbols): First call elf_getdata, then allocate memory.
936 2015-06-18 Mark Wielaard <mjw@redhat.com>
938 * findtextrel.c (process_file): Free segments after use.
940 2015-06-18 Mark Wielaard <mjw@redhat.com>
942 * readelf.c (print_phdr): Make sure phdr2_mem lifetime/scope equals
945 2015-06-18 Mark Wielaard <mjw@redhat.com>
947 * readelf.c (handle_gnu_hash): Free lengths on invalid_data.
949 2015-06-18 Mark Wielaard <mjw@redhat.com>
951 * elflint.c (check_symtab): Only check the PT_TLS phdr if it actually
952 exists. Warn otherwise.
954 2015-06-18 Mark Wielaard <mjw@redhat.com>
956 * nm.c (show_symbols): Check sizeof (sym_mem[0]), not GElf_Sym to
957 known whether or not we stack allocated memory.
959 2015-06-18 Mark Wielaard <mjw@redhat.com>
961 * strings.c (readelf): Use "<unknown>" if we cannot retrieve section
964 2015-06-09 Mark Wielaard <mjw@redhat.com>
966 * addr2line.c (print_dwarf_function): Always free scopes before
969 2015-06-09 Mark Wielaard <mjw@redhat.com>
971 * strip.c (handle_ar): Mark as unused.
972 (process_file): Produce an error when trying to handle an ar.
974 2015-05-30 Mark Wielaard <mjw@redhat.com>
976 * elfcmp.c (main): Only call memcmp when d_size != 0.
978 2015-05-23 Mark Wielaard <mjw@redhat.com>
980 * Makefile.am: Define ldgeneric, readelf, nm, size, strip, elflint,
981 findtextrel, elfcmp objdump, ranlib, ar and unstrip no_Wstack_usage.
983 2015-05-21 Mark Wielaard <mjw@redhat.com>
985 * addr2line.c (handle_address): Set scopes to NULL after free.
987 2015-05-20 Mark Wielaard <mjw@redhat.com>
989 * addr2line.c (OPT_PRETTY): New constant define.
990 (argp_option): Add "pretty-print".
991 (pretty): New static bool.
992 (parse_opt): Set pretty.
993 (print_dwarf_function): Adjust output when pretty is set.
994 (print_addrsym): Likewise.
995 (handle_address): Likewise.
997 2015-05-20 Mark Wielaard <mjw@redhat.com>
999 * Makefile.am (addr2line_LDADD): Add demanglelib.
1000 * addr2line.c (argp_option): Move demangle under output format.
1001 (demangle): New static bool.
1002 (demangle_buffer_len): New static size_t.
1003 (demangle_buffer): New static char *.
1004 (main): free demangle_buffer.
1005 (parse_opt): Set demangle.
1006 (symname): New static function.
1007 (get_diename): Use symname.
1008 (print_dwarf_function): Likewise.
1009 (print_addrsym): Likewise.
1010 (handle_address): Likewise.
1012 2015-05-20 Mark Wielaard <mjw@redhat.com>
1014 * addr2line.c (argp_option): Add "addresses", 'a'.
1015 (print_addresses): New static bool.
1016 (parse_opt): Set print_addresses.
1017 (get_addr_width): New static function.
1018 (handle_address): Print address if print_addresses is true.
1020 2015-05-20 Mark Wielaard <mjw@redhat.com>
1022 * addr2line.c (handle_address): Call strtoumax with base 16. Make
1023 sure all input has been processed.
1025 2015-05-20 Mark Wielaard <mjw@redhat.com>
1027 * addr2line (argp_option): Group 'section' under "Input format
1030 2015-05-12 Mark Wielaard <mjw@redhat.com>
1032 * strip.c (debug_fd): New static variable.
1033 (tmp_debug_fname): Likewise.
1034 (cleanup_debug): New function using the above to clean up temporary
1036 (INTERNAL_ERROR): Call cleanup_debug.
1037 (handle_elf): Use debug_fd and tmp_debug_fname statics and call
1038 cleanup_debug before any error. Use output_fname instead of fname in
1039 error messages when it exists (-o was given). SHT_NOBITS sections
1040 can also be moved freely even if SHF_ALLOC is set. Add various
1041 sanity checks. Use elf_assert instead of plain assert.
1043 2015-05-08 Mark Wielaard <mjw@redhat.com>
1045 * nm.c (show_symbols): Call gelf_fsize with EV_CURRENT.
1046 * strip.c (handle_elf): Likewise.
1048 2015-05-06 Mark Wielaard <mjw@redhat.com>
1050 * elflint.c (check_gnu_hash): Return early when 2nd hash function
1051 shift too big. Check there is enough data available. Make sure
1052 bitmask_words is not zero.
1053 (check_verdef): Use Elf64_Word for shdr->sh_info cnt.
1054 (check_verneed): Likewise.
1055 (check_attributes): Break when vendor name isn't terminated.
1056 Add overflow check for subsection_len.
1058 2015-05-05 Mark Wielaard <mjw@redhat.com>
1060 * nm.c (show_symbols): Handle dwarf_linesrc returning NULL.
1062 2015-05-04 Max Filippov <jcmvbkbc@gmail.com>
1064 * ar.c (do_oper_extract): Replace struct timeval with struct timespec
1065 and futimes with futimens.
1066 * strip.c (process_file): Replace struct timeval with struct timespec.
1067 (handle_elf, handle_ar): Replace struct timeval with struct timespec
1068 in prototype. Replace futimes with futimens.
1070 2015-05-04 Max Filippov <jcmvbkbc@gmail.com>
1072 * addr2line.c (main): Drop mtrace() call and #include <mcheck.h>.
1076 * objdump.c: Likewise.
1077 * ranlib.c: Likewise.
1079 * strip.c: Likewise.
1080 * unstrip.c: Likewise.
1082 2015-05-04 Anthony G. Basile <blueness@gentoo.org>
1084 * Makefile.am (readelf_LDADD, nm_LDADD, size_LDADD, strip_LDADD)
1085 (ld_LDADD, elflint_LDADD, findtextrel_LDADD, addr2line_LDADD)
1086 (elfcmp_LDADD, objdump_LDADD, ranlib_LDADD, strings_LDADD)
1087 (ar_LDADD, unstrip_LDADD, stack_LDADD): Append $(argp_LDADD).
1089 2015-03-22 Mark Wielaard <mjw@redhat.com>
1091 * readelf.c (print_debug_frame_section): Cast start to Dwarf_Off
1092 before subtracting cie_id. And cast cie_offset to Dwarf_Off before
1095 2015-03-22 Mark Wielaard <mjw@redhat.com>
1097 * readelf.c (print_gdb_index_section): Check all offsets used
1098 against section d_size.
1100 2015-03-17 Mark Wielaard <mjw@redhat.com>
1102 * readelf.c (print_debug): Don't return, but always use dummy_dbg.
1104 2015-03-17 Mark Wielaard <mjw@redhat.com>
1106 * readelf.c (print_gdb_index_section): Add overflow checking for
1109 2015-03-14 Mark Wielaard <mjw@redhat.com>
1111 * nm.c (INTERNAL_ERROR): Remove __DATE__.
1112 * objdump.c (INTERNAL_ERROR): Likewise.
1113 * size.c (INTERNAL_ERROR): Likewise.
1114 * strip.c (INTERNAL_ERROR): Likewise.
1116 2015-03-18 Petr Machata <pmachata@redhat.com>
1118 * readelf.c (dwarf_tag_string, dwarf_attr_string)
1119 (dwarf_form_string, dwarf_lang_string, dwarf_inline_string)
1120 (dwarf_encoding_string, dwarf_access_string)
1121 (dwarf_visibility_string, dwarf_virtuality_string)
1122 (dwarf_identifier_case_string, dwarf_calling_convention_string)
1123 (dwarf_ordering_string, dwarf_discr_list_string)
1124 (dwarf_locexpr_opcode_string): Adjust uses of know-dwarf.h macros
1125 to match the API changes.
1127 2015-03-09 Mark Wielaard <mjw@redhat.com>
1129 * elflint.c (compare_hash_gnu_hash): Correct gnu_symbias usage.
1131 2015-01-03 Mark Wielaard <mjw@redhat.com>
1133 * elfcmp (main): Check section name is not NULL. Check sh_entsize
1134 is not zero for symbol tables. Check phdrs are not NULL.
1135 (search_for_copy_reloc): Check sh_entsize is not zero.
1137 2014-12-30 Mark Wielaard <mjw@redhat.com>
1139 * elflint.c (check_scn_group): Check d_buf and name are not NULL.
1140 (is_rel_dyn): Check d is not NULL. Check shdr->sh_entsize is not
1142 (check_dynamic): Check strshdr is not NULL. Check d_tag is positive.
1143 (check_symtab_shndx): Check symshdr and data->d_buf are not NULL.
1144 Check shdr and symshdr sh_entsize are not zero.
1145 (check_gnu_hash): Make sure maskidx is smaller than bitmask_words.
1146 Check symshdr->sh_entsize is not zero. Check data->d_buf is not
1148 (compare_hash_gnu_hash): Check sections d_buf are not NULL.
1149 Check section data is large enough. Use gnu_symbias.
1150 (check_group): Check section val is valid.
1151 (has_copy_reloc): Check sh_entsize is not zero.
1152 (check_versym): Likewise.
1153 (unknown_dependency_p): Likewise.
1154 (check_verneed): Break on invalid ref or offset. Don't assert.
1155 Report error when next offset is zero, but more vers expected.
1156 (check_verdef): Likewise.
1157 (check_attributes): Make sure d_buf is not NULL.
1158 (check_note): Likewise.
1159 (check_note_section): Likewise.
1160 (check_program_header): Make sure section name is not NULL.
1162 2014-12-26 Mark Wielaard <mjw@redhat.com>
1164 * strings.c (read_elf): Produce error when section data falls outside
1167 2014-12-26 Mark Wielaard <mjw@redhat.com>
1169 * nm.c (show_symbols): Guard against divide by zero in error check.
1170 Add section index number in error message.
1172 2014-12-26 Mark Wielaard <mjw@redhat.com>
1174 * nm.c (handle_ar): Skip over /SYM64/ entries.
1176 2014-12-26 Mark Wielaard <mjw@redhat.com>
1178 * nm.c (handle_ar): Break on arsym with invalid offset.
1180 2014-12-20 Mark Wielaard <mjw@redhat.com>
1182 * readelf.c (print_debug_macinfo_section): Mark cus sentinel files
1183 as -1 non-existent. Check macoff against sentinel cus.
1185 2014-12-20 Mark Wielaard <mjw@redhat.com>
1187 * readelf.c (print_debug_exception_table): Add max_action overflow
1188 check. Check action_table_end before reading slib128. Check
1189 max_ar_filter underflow.
1191 2014-12-18 Ulrich Drepper <drepper@gmail.com>
1193 * Makefile.am: Suppress output of textrel_check command.
1195 2014-12-17 Mark Wielaard <mjw@redhat.com>
1197 * readelf.c (print_cfa_program): Add bounds check before each op that
1198 takes at least one argument.
1200 2014-12-16 Mark Wielaard <mjw@redhat.com>
1202 * readelf.c (print_decoded_line_section): Print dwarf_errmsg if
1203 dwarf_onesrcline or dwarf_linesrc fails.
1205 2014-12-16 Mark Wielaard <mjw@redhat.com>
1207 * readelf.c (print_debug_line_section): Correct overflow check for
1209 (print_debug_aranges_section): Correct overflow check for length.
1211 2014-12-15 Mark Wielaard <mjw@redhat.com>
1213 * readelf.c (notice_listptr): Return false if offset doesn't fit
1215 (attr_callback): Warn if loclist or rangelist offset doesn't fit.
1217 2014-12-15 Mark Wielaard <mjw@redhat.com>
1219 * readelf.c (print_ops): Don't assert when addr_size or ref_size
1220 is not 4 or 8, just report invalid data.
1222 2014-12-15 Mark Wielaard <mjw@redhat.com>
1224 * readelf.c (print_gdb_index_section): Add more bounds checks.
1226 2014-12-15 Mark Wielaard <mjw@redhat.com>
1228 * readelf.c (print_debug_line_section): Check there is enough room
1229 for DW_LNE_set_address argument. Make sure there is enough room
1230 for the the initial unit_length.
1232 2014-12-14 Mark Wielaard <mjw@redhat.com>
1234 * elflint.c (check_attributes): Call get_uleb128 with end pointer.
1235 * readelf.c (print_attributes): Likewise.
1236 (print_ops): Likewise and also for get_sleb128.
1237 (print_cfa_program): Likewise and add more readp bounds checks.
1238 (read_encoded): Likewise.
1239 (print_debug_frame_section): Likewise.
1240 (print_debug_line_section): Likewise.
1241 (print_debug_macinfo_section): Likewise.
1242 (print_debug_macro_section): Likewise.
1243 (print_debug_exception_table): Likewise.
1245 2014-12-16 Mark Wielaard <mjw@redhat.com>
1247 * elfcmp.c (compare_Elf32_Word): Make sure (unsigned) Elf32_Word
1248 difference doesn't wrap around before returning as int.
1250 2014-12-11 Mark Wielaard <mjw@redhat.com>
1252 * readelf.c (print_debug_exception_table): Check TType base offset
1253 and Action table are sane.
1255 2014-12-11 Mark Wielaard <mjw@redhat.com>
1257 * readelf.c (print_debug_frame_section): Check number of augmentation
1260 2014-12-09 Mark Wielaard <mjw@redhat.com>
1262 * readelf.c (handle_file_note): Check count fits data section and
1263 doesn't overflow fptr.
1265 2014-12-08 Mark Wielaard <mjw@redhat.com>
1267 * readelf.c (print_debug_exception_table): Report invalid data if
1268 action table doesn't immediately follow call site table.
1270 2014-12-10 Josh Stone <jistone@redhat.com>
1272 * addr2line.c (get_diename): New, get linkage_name or name.
1273 * addr2line.c (print_dwarf_function): Use get_diename.
1274 * addr2line.c (handle_address): Likewise.
1275 * addr2line.c (print_diesym): Removed.
1277 2014-12-10 Josh Stone <jistone@redhat.com>
1279 * addr2line.c (handle_address): Find the proper inline parents.
1281 2014-12-07 Mark Wielaard <mjw@redhat.com>
1283 * readelf.c (print_debug_line_section): max_ops_per_instr cannot
1286 2014-12-07 Mark Wielaard <mjw@redhat.com>
1288 * readelf.c (print_ops): Handle zero ref_size for DW_OP_call_ref
1289 and DW_OP_GNU_implicit_pointer.
1291 2014-12-04 Mark Wielaard <mjw@redhat.com>
1293 * objdump.c (show_relocs_x): Make sure destshdr exists.
1294 (show_relocs_rel): Don't rely on shdr->sh_entsize, use gelf_fsize.
1295 (show_relocs_rela): Likewise.
1296 (show_relocs): Make sure destshdr, symshdr and symdata exists.
1298 2014-11-30 Mark Wielaard <mjw@redhat.com>
1300 * readelf.c (handle_sysv_hash64): Fix overflow check.
1302 2014-11-28 Mark Wielaard <mjw@redhat.com>
1304 * readelf.c (handle_relocs_rel): Don't reuse destshdr to store
1305 section header of a relocation against a STT_SECTION symbol. Use
1306 a new local variable secshdr.
1307 (handle_relocs_rela): Likewise.
1309 2014-11-26 Mark Wielaard <mjw@redhat.com>
1311 * readelf.c (print_debug_aranges_section): Cast Dwarf_Word length
1312 to ptrdiff_t for comparison.
1314 2014-11-24 Mark Wielaard <mjw@redhat.com>
1316 * readelf.c (print_debug_line_section): Check line_range is not zero
1319 2014-11-23 Mark Wielaard <mjw@redhat.com>
1321 * readelf.c (print_debug_aranges_section): Check length to catch
1324 2014-11-21 Mark Wielaard <mjw@redhat.com>
1326 * readelf.c (print_attributes): Guard against empty section.
1327 Document attribute format. Break when vendor name isn't terminated.
1328 Add overflow check for subsection_len. Handle both gnu and non-gnu
1331 2014-11-22 Mark Wielaard <mjw@redhat.com>
1333 * elflint.c (check_sections): Call ebl_bss_plt_p without ehdr.
1334 * findtextrel.c (process_file): Use elf_getphdrnum.
1335 * readelf.c (process_elf_file): Remove redundant ehdr->e_phoff check.
1336 (print_phdr): Check phnum.
1337 * size.c (show_segments): Use elf_getphdrnum.
1338 * strip.c (handle_elf): Likewise.
1339 * unstrip.c (copy_elf): Likewise.
1340 (copy_elided_sections): Likewise.
1341 (handle_file): Likewise.
1343 2014-11-18 Mark Wielaard <mjw@redhat.com>
1345 * readelf.c (print_cfa_program): Fix sanity check of DW_FORM_block
1348 2014-11-17 Mark Wielaard <mjw@redhat.com>
1350 * readelf.c (handle_verneed): Check vna_next and vn_next exist.
1351 (handle_verdef): Check vda_next and vd_next exist.
1352 (handle_versym): Check vd_next, vna_next and vn_next exist.
1353 Check vername and filename are not NULL before use.
1355 2014-11-17 Mark Wielaard <mjw@redhat.com>
1357 * elfcmp.c (main): Check section names are NULL before use.
1358 * objdump.c (section_match): Likewise.
1359 * size.c (show_sysv): Likewise.
1361 2014-11-17 Mark Wielaard <mjw@redhat.com>
1363 * readelf.c (print_debug_frame_section): Warn if ptr_size is not 4
1364 or 8 instead of just calling print_cfa_program.
1366 2014-11-16 Mark Wielaard <mjw@redhat.com>
1368 * readelf (process_elf_file): Set phnum to zero if there aren't
1369 actually any pheaders.
1370 (print_phdr): Check there actually is a phdr.
1372 2014-11-16 Mark Wielaard <mjw@redhat.com>
1374 * readelf.c (print_cfa_program): Check block len before calling
1377 2014-11-14 Mark Wielaard <mjw@redhat.com>
1379 * readelf.c (print_debug_frame_section): Sanity Check CIE
1380 unit_length and augmentationlen.
1382 2014-11-14 Mark Wielaard <mjw@redhat.com>
1384 * readelf.c (handle_versym): Check def == NULL before use.
1386 2014-11-08 Mark Wielaard <mjw@redhat.com>
1388 * readelf.c (handle_versym): Initialize vername and filename array
1391 2014-11-07 Mark Wielaard <mjw@redhat.com>
1393 * readelf.c (handle_sysv_hash): Sanity check section contents.
1394 (handle_sysv_hash64): Likewise.
1395 (handle_gnu_hash): Likewise.
1397 2014-09-14 Petr Machata <pmachata@redhat.com>
1399 * readelf.c (handle_relocs_rela): Typo fix, test DESTSHDR properly.
1401 2014-09-12 Petr Machata <pmachata@redhat.com>
1403 * readelf.c (encoded_ptr_size): In the switch statement, change
1404 magic constants 3 and 4 to DW_EH_PE_* counterparts. Still accept
1405 0. Print diagnostic for anything else.
1407 2014-08-25 Josh Stone <jistone@redhat.com>
1409 * Makefile.am: Prevent premature @AR@ replacement in a sed expression.
1411 2014-07-04 Menanteau Guy <menantea@linux.vnet.ibm.com>
1412 Mark Wielaard <mjw@redhat.com>
1414 * elflint (check_symtab): Add ".TOC." to the list of possibly
1415 dangling symbols because of sourceware PR13621.
1417 2014-06-14 Mark Wielaard <mjw@redhat.com>
1419 * elflint (check_symtab): Use ebl_func_addr_mask on st_value.
1421 2014-05-27 Mark Wielaard <mjw@redhat.com>
1423 * readelf.c (print_debug): Skip section if name is NULL.
1425 2014-05-26 Mark Wielaard <mjw@redhat.com>
1427 * readelf.c (handle_relocs_rela): Print header like handle_relocs_rel
1428 does, when sh_info == 0.
1430 2014-05-26 Mark Wielaard <mjw@redhat.com>
1432 * unstrip.c (find_alloc_sections_prelink): Allow non-split .bss
1433 section when sh_size of the original and undo .bss section are equal.
1435 2014-05-26 Mark Wielaard <mjw@redhat.com>
1437 * unstrip.c (options): Add --force, -F.
1438 (struct arg_info): Add bool force.
1439 (parse_opt): Handle 'F', set force.
1440 (handle_explicit_files): Add force argument, add warn function,
1441 separate check ehdr field checks, use warn.
1442 (handle_dwfl_module): Add force argument, pass on to
1443 handle_explicit_files.
1444 (handle_output_dir_module): Add force argument, pass on to
1446 (handle_implicit_modules): Pass info->force to handle_dwfl_module and
1447 handle_output_dir_module.
1448 (main): Pass info.force to handle_explicit_files.
1450 2014-05-19 Mark Wielaard <mjw@redhat.com>
1452 * elflint.c (check_reloc_shdr): Check ebl_check_reloc_target_type.
1454 2014-05-01 Mark Wielaard <mjw@redhat.com>
1456 * readelf.c (find_no_debuginfo): Call dwfl_standard_find_debuginfo
1457 if looking for alternate debug file.
1459 2014-04-11 Mark Wielaard <mjw@redhat.com>
1461 * Makefile.am (AM_CPPFLAGS): Add -I libdwelf.
1463 2014-04-22 Mark Wielaard <mjw@redhat.com>
1465 * readelf.c (handle_core_item): Make sure variable length array
1466 contains at least enough space for terminating zero char.
1468 2014-04-22 Mark Wielaard <mjw@redhat.com>
1470 * readelf.c (print_gdb_index_section): Use unsigned int for 31 bits
1473 2014-03-13 Mark Wielaard <mjw@redhat.com>
1475 * Makefile.am: Remove no_mudflap.os. Remove libmudflap from all
1477 * strings.c (process_chunk): Remove _MUDFLAP condition.
1479 2014-04-09 Mark Wielaard <mjw@redhat.com>
1481 * readelf.c (print_debug_aranges_section): Don't get the raw section
1482 data, use the possibly decompressed .[z]debug sectiondata.
1483 (print_debug_ranges_section): Likewise.
1484 (print_debug_frame_section): Likewise.
1485 (print_debug_line_section): Likewise.
1486 (print_debug_loc_section): Likewise.
1487 (print_debug_macinfo_section): Likewise.
1488 (print_debug_macro_section): Likewise.
1490 2014-04-10 Mark Wielaard <mjw@redhat.com>
1492 * readelf.c (buf_read_ulong): Pass actual long size to convert.
1494 2014-03-05 Mark Wielaard <mjw@redhat.com>
1496 * readelf.c (attr_callback): Print DW_FORM_sdata values as signed
1499 2014-02-24 Mark Wielaard <mjw@redhat.com>
1501 * readelf (print_phdr): Check there is a SHT_PROGBITS section at the
1502 offset given by p_offsets for a PT_INTERP segment before trying to
1503 display the interpreter string.
1505 2014-02-07 Mark Wielaard <mjw@redhat.com>
1507 * readelf.c (print_phdr): Check phdr->p_filesz and make sure
1508 interpreter string is zero terminated before calling printf.
1510 2014-01-22 Mark Wielaard <mjw@redhat.com>
1512 * Makefile.am (nm_no_Wformat): Removed.
1513 (size_no_Wformat): Likewise.
1514 (strings_no_Wformat): Likewise.
1515 (addr2line_no_Wformat): Likewise.
1516 * size.c (show_sysv): Use fmtstr directly as literal in printf.
1517 (show_sysv_one_line): Likewise.
1518 * strings.c (locfmt): Removed.
1519 (radix): New static enum.
1520 (parse_opt): Set radix, not locfmt.
1521 (process_chunk_mb): Use fmtstr directly as literal in printf based
1523 (process_chunk): Likewise.
1524 * nm.c (show_symbols_sysv): Use fmtstr directly as literal in printf.
1525 (show_symbols_bsd): Likewise.
1526 (show_symbols_posix): Likewise.
1528 2014-01-21 Mark Wielaard <mjw@redhat.com>
1530 * stack.c (show_inlines): New static boolean.
1531 (print_frame): New function split out from...
1532 (print_frames): ..here. If show_inlines is true and we found a
1533 DIE for the frame address, call print_inline_frames otherwise
1534 call print_frame. Keep track of and track frame_nr.
1535 (print_inline_frames): New function.
1536 (parse_opt): Handle '-i'.
1537 (main): Add 'i' to options.
1539 2014-01-27 Mark Wielaard <mjw@redhat.com>
1541 * stack.c (maxframes): Initialize to 256.
1542 (main): Document new default in options. Document magic number
1543 used in frames.allocated initialization.
1545 2014-01-20 Mark Wielaard <mjw@redhat.com>
1547 * stack.c (show_debugname): New static boolean.
1548 (die_name): New function.
1549 (print_frames): If show_debugname is true set symname to the
1550 first function-like DIE with a name in scope for the address in
1552 (parse_opt): Handle '-d'.
1553 (main): Add 'd' to options.
1555 2014-01-20 Mark Wielaard <mjw@redhat.com>
1557 * addr2line.c (handle_address): Initialize scopes to NULL.
1559 2014-01-17 Roland McGrath <roland@redhat.com>
1561 * strip.c (handle_elf): Check for bogus values in sh_link, sh_info,
1562 st_shndx, e_shstrndx, and SHT_GROUP or SHT_SYMTAB_SHNDX data.
1563 Don't use assert on input values, instead bail with "illformed" error.
1565 2014-01-17 Roland McGrath <roland@redhat.com>
1567 * readelf.c (handle_dynamic, handle_symtab): Check for bogus sh_link.
1568 (handle_verneed, handle_verdef, handle_versym, handle_hash): Likewise.
1569 (handle_scngrp): Check for bogus sh_info.
1571 2014-01-17 Jakub Jelinek <jakub@redhat.com>
1573 * elflint.c (section_name): Return "<invalid>" instead of
1574 crashing on invalid section name.
1575 (check_symtab, is_rel_dyn, check_rela, check_rel, check_dynamic,
1576 check_symtab_shndx, check_hash, check_versym): Robustify.
1577 (check_hash): Don't check entries beyond end of section.
1578 (check_note): Don't crash if gelf_rawchunk fails.
1580 2014-01-17 Petr Machata <pmachata@redhat.com>
1582 * readelf.c (handle_dynamic, handle_relocs_rel)
1583 (handle_relocs_rela, handle_versym, print_liblist):
1584 Use gelf_fsize instead of relying on shdr->sh_entsize.
1586 2014-01-14 Mark Wielaard <mjw@redhat.com>
1588 * readelf.c (print_debug_macro_section): Clear vendor array before
1591 2014-01-15 Jan Kratochvil <jan.kratochvil@redhat.com>
1593 Fix corruption of non-C++ symbols by the demangler.
1594 * nm.c (show_symbols_sysv, show_symbols_bsd, show_symbols_posix)
1595 (show_symbols): Check for _Z.
1596 * stack.c (print_frames) <USE_DEMANGLE>: Check for _Z.
1598 2014-01-02 Mark Wielaard <mjw@redhat.com>
1600 * stack.c (show_raw): Declare unconditionally.
1601 (parse_opt): Handle '-r' unconditionally.
1602 (main): Show "raw" option even without USE_DEMANGLE.
1604 2014-01-02 Mark Wielaard <mjw@redhat.com>
1606 * stack.c (print_frames): Print 0x before build-id hex-offset.
1608 2014-01-02 Mark Wielaard <mjw@redhat.com>
1610 * stack.c (maxframes): Increase to 2048.
1611 (struct frames): Add allocated field.
1612 (frame_callback): If frames used is frames allocated, realloc.
1613 (print_frames): Show an error if maxframes has been reached.
1614 (parse_opt): Allow -n 0 for unlimited frames.
1615 (main): Document -n 0 and new default 2048 frames. Allocate initial
1616 number of frames with malloc.
1618 2013-12-30 Mark Wielaard <mjw@redhat.com>
1620 * stack.c (parse_opt): Explicitly call dwfl_linux_proc_attach
1621 or dwfl_core_file_attach and check for errors.
1623 2013-12-28 Mark Wielaard <mjw@redhat.com>
1625 * stack.c (print_frames): Remove address width code and use...
1626 (get_addr_width): ...this new function.
1627 (show_modules): New static boolean.
1628 (module_callback): New static function.
1629 (parse_opt): Handle '-l'.
1630 (main): Add 'l' to options. If show_modules then use dwfl_getmodules
1631 with module_callback to show all detected modules and possible
1632 build_id, elf and dwarf files.
1634 2013-12-27 Mark Wielaard <mjw@redhat.com>
1636 * stack.c (frames_shown): New static boolean.
1637 (EXIT_OK,EXIT_ERROR,EXIT_BAD,EXIT_USAGES): New defines.
1638 (frame_callback): Return -1 on error. Don't print error.
1639 (print_frames): Add arguments, tid, dwflerr and what. Print tid.
1640 If there was an error report it with address and module if possible.
1641 Record whether any frames were actually printed.
1642 (thread_callback): Collect tid and err, pass it to print_frames.
1643 (parse_opt): Use EXIT_BAD for errors. On ARGP_KEY_END print errno
1644 if dwfl_linux_proc_report returned it. Check whether we are properly
1645 attached with dwfl_pid.
1646 (main): Document exit status. Don't report DWARF_CB_ABORT from
1647 callbacks as error. Pass real errors to print_frames. Return
1648 EXIT_BAD if no frames could be shown. Return EXIT_ERROR if there
1649 were any non-fatal errors.
1651 2013-12-23 Mark Wielaard <mjw@redhat.com>
1653 * Makefile.am (stack_LDADD): Add demanglelib.
1654 * stack.c (show_quiet): New static boolean, default false.
1655 (show_raw): Likewise.
1656 (demangle_buffer_len): New static size_t.
1657 (demangle_buffer): New static char *.
1658 (print_frames): Don't resolve pc name if show_quiet. Demangle name
1660 (parse_opt): Handle '-q' and '-r'.
1661 (main): Add 'q' and 'r' to options. Free demangle_buffer.
1663 2013-12-23 Mark Wielaard <mjw@redhat.com>
1665 * stack.c (OPT_DEBUGINFO): New define.
1666 (OPT_COREFILE): Likewise.
1668 (core_fd): Likewise.
1671 (debuginfo_path): Likewise.
1672 (parse_opt): Handle '-p', '--core', '-e' and '--debuginfo-path'.
1673 Do argument sanity checking. Setup Dwfl.
1674 (main): Add 'p', 'core', 'e' and 'debuginfo-path' to options.
1675 Remove argp_child children, simplify argp doc, remove custom
1676 usage message and construction of dwfl with dwfl_standard_argp.
1677 Use pid directly as tid. close core and core_fd if opened. Print
1678 pid of process or core.
1680 2013-12-23 Mark Wielaard <mjw@redhat.com>
1682 * stack.c (show_build_id): New static boolean.
1683 (print_frames): Print module build-id, load address and pc offset
1684 if show_build_id is true.
1685 (parse_opt): Handle '-b'.
1686 (main): Add -b to options.
1688 2013-12-22 Mark Wielaard <mjw@redhat.com>
1690 * stack.c (maxframes): New static unsigned. Initialize to 64.
1691 (struct frame): New struct.
1692 (struct frames): Likewise.
1693 (dwfl): New static Dwfl pointer.
1694 (frame_callback): Use arg as struct frames and fill it next frame.
1695 Return DWARF_CB_ABORT when maxframes has been reached. Move
1696 printing of frame to...
1697 (print_frames): ...here. New function.
1698 (thread_callback): Use arg as struct frames and set frames to zero.
1700 (parse_opt): Handle '-n'.
1701 (main): Add -n to options. Allocate frames using maxframes. Pass
1702 frames to frame_callback and thread_callback.
1704 2013-12-20 Mark Wielaard <mjw@redhat.com>
1706 * stack.c (show_one_tid): New static boolean.
1707 (parse_opt): Handle '-1'.
1708 (main): Add -1 to options. Call dwfl_getthread_frames when
1709 show_one_tid is true.
1711 2013-12-18 Mark Wielaard <mjw@redhat.com>
1713 * addr2line.c (options): Add symbol-sections, 'x'.
1714 (show_symbol_sections): New static bool.
1715 (parse_opt): Handle 'x'.
1716 (print_addrsym): Use dwfl_module_addrinfo value.r
1717 Also show section of address with show_symbol_sections.
1718 (find_symbol): Use dwfl_module_getsym_info and set value.
1719 (handle_address): Request value and use it instead of sym.st_value.
1720 * readelf.c (format_dwarf_addr): Use dwfl_module_addrinfo to get
1723 2013-12-17 Masatake YAMATO <yamato@redhat.com>
1724 Mark Wielaard <mjw@redhat.com>
1726 * stack.c (show_activation, show_module, show_source): New variables.
1727 (parse_opt): Set show_activation if -a option is given.
1728 Set show_module if -m option is given. Set show_source if -s option
1729 is given. Set all show booleans when -v option is given.
1730 (main): Added `-a', `-m', `-s', and `-v' to the help message.
1731 (frame_callback): Print module and source file information.
1733 2013-11-25 Petr Machata <pmachata@redhat.com>
1735 * elflint.c (valid_e_machine): Add EM_AARCH64.
1737 2013-11-14 Petr Machata <pmachata@redhat.com>
1739 * readelf.c (handle_core_item) <'h'>: New branch for handling
1740 fields that shouldn't be displayed.
1742 2013-11-10 Mark Wielaard <mjw@redhat.com>
1744 * stack.c: Use ARGP_PROGRAM_VERSION_HOOK_DEF and
1745 ARGP_PROGRAM_BUG_ADDRESS_DEF.
1746 (print_version): New function.
1748 2013-11-09 Mark Wielaard <mjw@redhat.com>
1750 * arlib.c (arlib_init): Call snprintf before using the result
1752 (arlib_finalize): Likewise.
1753 * nm.c (show_symbols_sysv): Don't modify cnt inside assert.
1755 2013-11-07 Jan Kratochvil <jan.kratochvil@redhat.com>
1757 * Makefile.am (bin_PROGRAMS): Add stack.
1759 * stack.c: New file.
1761 2013-11-05 Mark Wielaard <mjw@redhat.com>
1763 * readelf.c (print_debug_ranges_section): Cast address to size_t
1765 (print_debug_loc_section): Likewise.
1767 2013-10-18 Mark Wielaard <mjw@redhat.com>
1769 * ar.c (main): Correct operation check when instance_specifed is set.
1771 2013-09-26 Petr Machata <pmachata@redhat.com>
1773 * readelf.c (handle_file_note): New function.
1774 (handle_notes_data): Call it to handle NT_FILE notes.
1776 2013-09-26 Petr Machata <pmachata@redhat.com>
1778 * readelf.c (handle_siginfo_note): New function.
1779 (handle_notes_data): Call it to handle NT_SIGINFO notes.
1780 (buf_read_int, buf_read_ulong, buf_has_data): New functions.
1782 2013-08-13 Mark Wielaard <mjw@redhat.com>
1784 * addr2line.c (options): Add "inlines", 'i'.
1785 (show_inlines): New bool.
1786 (parse_opt): Handle 'i'.
1787 (print_diesym): New static function.
1788 (print_src): New function taking code from...
1789 (handle_address): here. Call print_src. Print inlines.
1791 2013-08-12 Mark Wielaard <mjw@redhat.com>
1793 * addr2line.c (main): If there is a newline char at end of buf,
1796 2013-07-05 Mark Wielaard <mjw@redhat.com>
1798 * readelf.c (print_ops): Take CU as argument, use it to print
1799 parameter_ref DIE offset.
1800 (struct listptr): Replace base field with cu.
1801 (listptr_base): New function.
1802 (compare_listptr): Use listptr_base.
1803 (notice_listptr): Take CU as argument.
1804 (skip_listptr_hole): Likewise.
1805 (print_debug_ranges_section): Pass NULL as CU to skip_listptr_hole.
1806 (print_cfa_program): Pass NULL as CU to print_ops.
1807 (struct attrcb_args): Replace cu_base field with cu.
1808 (attr_callback): Pass cu not cu_base to notice_listptr.
1809 (print_debug_units): Don't calculate base, just set cu.
1810 (print_debug_loc_section): Pass cu to skip_listptr_hole and
1813 2013-05-06 Mark Wielaard <mjw@redhat.com>
1815 * readelf.c (print_ops): Format first DW_OP_GNU_implicit_pointer
1816 argument as DIE offset.
1818 2013-04-24 Mark Wielaard <mjw@redhat.com>
1820 * Makefile.am: Use AM_CPPFLAGS instead of INCLUDES.
1822 2013-03-25 Mark Wielaard <mjw@redhat.com>
1824 * readelf.c (argp_options): Add decodedline.
1825 (decodedline): New boolean initialized to false.
1826 (parse_opt): Set decodedline when arg is decodedline.
1827 (print_decoded_line_section): New function.
1828 (print_debug_line_section): Call print_decoded_line_section when
1829 decodedline is true.
1831 2013-03-25 Mark Wielaard <mjw@redhat.com>
1833 * readelf.c (argp_option): Add decodedaranges.
1834 (decodedaranges): New boolean initialized to false.
1835 (parse_opt): Set decodedaranges when arg is decodedaranges.
1836 (print_debug_aranges_section): Reimplemented and original
1837 implementation renamed to...
1838 (print_decoded_aranges_section): this.
1840 2013-03-25 Mark Wielaard <mjw@redhat.com>
1842 * readelf.c (attrcb_args): Add Dwarf_Die.
1843 (attr_callback): When highpc is in constant form also print as
1845 (print_debug_units): Set args.die.
1847 2013-03-19 Mark Wielaard <mjw@redhat.com>
1849 * readelf.c (print_gdb_index_section): Free format_dwarf_addr results.
1851 2013-03-18 Mark Wielaard <mjw@redhat.com>
1853 * readelf.c (print_gdb_index_section): Accept version 8.
1855 2013-03-01 Mark Wielaard <mjw@redhat.com>
1857 * findtextrel.c (process_file): Release ELF and close file when not
1858 text relocations are found.
1859 * strip.c (handle_elf): Track memory used for .debuglink section data
1862 2013-02-24 Mark Wielaard <mjw@redhat.com>
1864 * elflint.c (check_symtab): Add __bss_start__ to the list of symbols
1865 allowed to have out of section values because of GNU ld bugs.
1867 2013-02-06 Mark Wielaard <mjw@redhat.com>
1869 * elflint.c (check_symtab): Add __bss_start and __TMC_END__ to the
1870 list of symbols allowed to have out of section values because of
1871 GNU ld bugs in either .symtab or .dynsym, but only when they are
1874 2013-01-24 Mark Wielaard <mjw@redhat.com>
1876 * readelf.c (argp_option): Add unresolved-address-offsets, U.
1877 (print_unresolved_addresses): New static.
1878 (parse_opt): Handle 'U', set print_unprocessed_values.
1879 (format_dwarf_addr): Take and handle new raw argument.
1880 (print_ops): Call format_dwarf_addr with raw offset values.
1881 (print_debug_ranges_section): Likewise.
1882 (print_debug_frame_section): Likewise.
1883 (attr_callback): Likewise.
1884 (print_debug_line_section): Likewise.
1885 (print_debug_loc_section): Likewise.
1886 (print_gdb_index_section): Likewise.
1888 2013-01-18 Mark Wielaard <mjw@redhat.com>
1890 * readelf.c (struct listptr): Add base Dwarf_Addr field.
1891 (compare_listptr): Warn for same offset with different base.
1892 (notice_listptr): Take base argument and set it.
1893 (skip_listptr_hole): Likewise.
1894 (struct attrcb_args): Removed unused cu_offset field.
1895 Add cu_base Dwarf_Addr field.
1896 (attr_callback): Call notice_listptr with cbargs->cu_base.
1897 (print_debug_units): Set args.cu_base.
1898 (print_debug_ranges_section): Get base and use for format_dwarf_addr.
1899 (print_debug_loc_section): Likewise.
1901 2013-01-29 Jan Kratochvil <jan.kratochvil@redhat.com>
1903 * readelf.c (handle_core_items): Limit special repeated items handling
1904 to single-item formats '\n', 'b' and 'B', assert OFFSET 0 there.
1906 2012-12-18 Mark Wielaard <mark@bordewijk.wildebeest.org>
1908 * readelf.c (ELF_INPUT_SECTION): New argp key value.
1909 (argp_option): Add elf-section.
1910 (elf_input_section): New static.
1911 (parse_opt): Handle ELF_INPUT_SECTION and set elf_input_section.
1912 (open_input_section): New function.
1913 (process_file): Call open_input_section if elf_input_section set.
1915 2013-01-13 David Abdurachmanov <David.Abdurachmanov@cern.ch>
1917 ar.c (do_oper_delete): Fix num passed to memset.
1919 2012-12-21 Mark Wielaard <mjw@redhat.com>
1921 * readelf.c (print_debug_frame_section): Adjust FDE start address
1922 if pcrel before feeding it to format_dwarf_addr.
1924 2012-12-21 Mark Wielaard <mjw@redhat.com>
1926 * addr2line.c (main): Call dwfl_end.
1928 2012-12-11 Roland McGrath <roland@hack.frob.com>
1930 * nm.c (show_symbols_sysv): Fix size passed to snprintf for invalid
1932 Reported by David Abdurachmanov <David.Abdurachmanov@cern.ch>.
1934 2012-10-16 Mark Wielaard <mjw@redhat.com>
1936 * readelf.c (print_ops): DW_OP_skip and DW_OP_bra targets are
1937 calculated beginning after the operand and 2-byte constant.
1939 2012-10-12 Jan Kratochvil <jan.kratochvil@redhat.com>
1941 * readelf.c (ITEM_WRAP_COLUMN, REGISTER_WRAP_COLUMN): Merge to ...
1942 (WRAP_COLUMN): ... here.
1943 (print_core_item): Remove parameter format_max. Update function
1944 comment. Replace FORMAT_MAX by the real output width.
1945 (handle_core_item): Remove the FORMAT_MAX values in TYPES, DO_TYPE,
1946 calls of print_core_item, remove variable maxfmt, change
1947 ITEM_WRAP_COLUMN to WRAP_COLUMN.
1948 (handle_core_register): Remove the FORMAT_MAX values in TYPES, BITS,
1949 calls of print_core_item, change REGISTER_WRAP_COLUMN to WRAP_COLUMN.
1951 2012-10-11 Jan Kratochvil <jan.kratochvil@redhat.com>
1953 * readelf.c (handle_core_item) <b>: Make run an outer block variable.
1954 Increase run only if LASTBIT != 0. Print last element only if RUN > 0.
1956 2012-08-27 Mark Wielaard <mjw@redhat.com>
1958 * readelf.c (print_debug_macro_section): Print offset as PRIx64.
1960 2012-08-27 Mark Wielaard <mjw@redhat.com>
1962 * readelf.c (register_info): Handle loc == NULL.
1964 2012-08-22 Jeff Kenton <jkenton@tilera.com>
1966 * elflint.c (valid_e_machine): Add EM_TILEGX and EM_TILEPRO.
1968 2012-08-16 Mark Wielaard <mjw@redhat.com>
1970 * readelf.c (dwarf_tag_name): Renamed from dwarf_tag_string.
1971 Uses new dwarf_tag_string or adds ??? or lo_user+%#x when
1973 (dwarf_attr_name): Likewise.
1974 (dwarf_form_name): Likewise.
1975 (dwarf_lang_name): Likewise.
1976 (dwarf_inline_name): Likewise.
1977 (dwarf_encoding_name): Likewise.
1978 (dwarf_access_name): Likewise.
1979 (dwarf_visibility_name): Likewise.
1980 (dwarf_virtuality_name): Likewise.
1981 (dwarf_identifier_case_name): Likewise.
1982 (dwarf_calling_convention_name): Likewise.
1983 (dwarf_ordering_name): Likewise.
1984 (dwarf_discr_list_name): Likewise.
1985 (print_ops): Remove KNOWN. Use dwarf_locexpr_opcode_string.
1986 (attr_callback): Call new dwarf_foobar_name instead of old
1987 dwarf_foobar_string functions.
1988 (dwarf_tag_string): New function using known-dwarf.h macros.
1989 (dwarf_attr_string): Likewise.
1990 (dwarf_form_string): Likewise.
1991 (dwarf_lang_string): Likewise.
1992 (dwarf_inline_string): Likewise.
1993 (dwarf_encoding_string): Likewise.
1994 (dwarf_access_string): Likewise.
1995 (dwarf_visibility_string): Likewise.
1996 (dwarf_virtuality_string): Likewise.
1997 (dwarf_identifier_case_string): Likewise.
1998 (dwarf_calling_convention_string): Likewise.
1999 (dwarf_ordering_string): Likewise.
2000 (dwarf_discr_list_string): Likewise.
2001 (dwarf_locexpr_opcode_string): Likewise.
2003 2012-06-27 Mark Wielaard <mjw@redhat.com>
2005 * readelf.c (dwarf_form_string): Handle DW_FORM_GNU_ref_alt and
2006 DW_FORM_GNU_strp_alt.
2007 (attr_callback): Likewise.
2009 2012-07-30 Petr Machata <pmachata@redhat.com>
2011 * nm.c (show_symbols_bsd): Reorder arguments in {S,}FMTSTRS (and
2012 corresponding printf) so that those that are referenced by only
2013 one of the formatting strings are at the end.
2015 2012-07-29 Mark Wielaard <mjw@redhat.com>
2017 * readelf.c (dwarf_lang_string): Use DW_LANG_ObjC, not DW_LANG_Objc.
2018 (print_ops): Use known[op], not op_name, for DW_OP_GNU_parameter_ref.
2020 2012-07-19 Mark Wielaard <mjw@redhat.com>
2022 * readelf.c (print_ops): Handle DW_OP_GNU_parameter_ref.
2024 2012-07-11 Mark Wielaard <mjw@redhat.com>
2026 * readelf.c (options): Add macro to help of debug-dump.
2027 (section_e): Add section_macro.
2028 (section_all): Add section_macro.
2029 (parse_opt): Handle macro.
2030 (print_debug_macro_section): New function.
2031 (print_debug): Add NEW_SECTION (macro).
2033 2012-07-10 Mark Wielaard <mjw@redhat.com>
2035 * readelf.c (print_gdb_index_section): Add version 7 support.
2036 Keep track of cu_nr. Print kind and static/global flag for each
2037 symbol. When a symbol is in the TU list add 'T'.
2039 2012-06-26 Mark Wielaard <mjw@redhat.com>
2041 * readelf.c (dwarf_attr_string): Add DW_AT_GNU_macros.
2043 2012-06-22 Mark Wielaard <mjw@redhat.com>
2045 * readelf.c (print_ops): Cast printf PRIu/x64 arguments to uint64_t
2046 for gcc 4.7 -Wformat.
2048 2012-05-09 Roland McGrath <roland@hack.frob.com>
2050 * elflint (check_sections): Allow zero sized sections at (filesz) end
2051 of segment. And make check overflow-proofed.
2053 2012-04-24 Mark Wielaard <mjw@redhat.com>
2055 * readelf.c (print_ops): Add DW_OP_GNU_push_tls_address,
2056 DW_OP_GNU_uinit and DW_OP_GNU_encoded_addr.
2058 2012-03-28 Roland McGrath <roland@hack.frob.com>
2060 * elflint.c (special_sections): Accept SHF_INFO_LINK for reloc sections.
2062 2012-03-28 Mark Wielaard <mjw@redhat.com>
2064 * readelf.c (print_debug_abbrev_section): Check there is Dwarf
2066 (print_debug_str_section): Likewise.
2068 2012-03-21 Mark Wielaard <mjw@redhat.com>
2070 * readelf.c (print_gdb_index_section): Accept version 6.
2072 2012-01-31 Mark Wielaard <mjw@redhat.com>
2074 * readelf.c (attr_callback): Don't special case DW_FORM_sec_offset.
2076 2012-01-21 Ulrich Drepper <drepper@gmail.com>
2078 * addr2line.c: Update copyright year.
2080 * elfcmp.c: Likewise.
2081 * elflint.c: Likewise.
2082 * findtextrel.c: Likewise.
2085 * objdump.c: Likewise.
2086 * ranlib.c: Likewise.
2087 * readelf.c: Likewise.
2089 * strings.c: Likewise.
2090 * strip.c: Likewise.
2091 * unstrip.c: Likewise.
2093 * nm.c (argp_children): Define.
2094 (argp): Hook up argp_children.
2095 (handle_ar): Optimize puts call.
2096 (show_symbols_bsd): Use positional parameters to also print color
2097 codes. Don't print STT_FILE symbols.
2098 * objdump.c (options): Improve help text.
2099 (argp_children): Define.
2100 (argp): Hook up argp_children.
2101 (disasm_info): Add elements for color codes.
2102 (disasm_output): Print color codes as well.
2103 (show_disasm): Set up disasm_info data for callback.
2105 2012-01-20 Roland McGrath <roland@hack.frob.com>
2107 * arlib-argp.c (arlib_deterministic_output): Initialize from
2109 (help_filter): New function.
2112 * ar.c (main): Handle oper_none as usage error.
2114 * arlib-argp.c (options, parse_opt): Grok -U as inverse of -D.
2116 * ranlib.c (argp): Use arlib_argp_children.
2118 * arlib.c (arlib_init): Obey arlib_deterministic_output.
2120 * arlib-argp.c: New file.
2121 * Makefile.am (libar_a_SOURCES): Add it.
2122 * arlib.h (arlib_deterministic_output, arlib_argp_children):
2123 Declare new variables.
2124 * ar.c (deterministic_output): Variable removed.
2125 (do_oper_insert): Use arlib_deterministic_output instead.
2126 (options, parse_opt): Don't handle -D here. Add group numbers.
2127 (argp): Use arlib_argp_children.
2129 2011-12-20 Roland McGrath <roland@hack.frob.com>
2131 * readelf.c (print_debug): Initialize DUMMY_DBG.elf.
2132 Reported by Karel Klic <kklic@redhat.com>.
2134 2011-11-05 Roland McGrath <roland@hack.frob.com>
2136 * ar.c (deterministic_output): New flag variable.
2137 (options, parse_opt): Grok -D to set it.
2138 (do_oper_insert): When set, use zero from mtime, uid, and gid.
2140 * ar.c (do_oper_insert): Fix check on elf_rawfile return value.
2142 2011-10-04 Marek Polacek <mpolacek@redhat.com>
2144 * readelf.c (register_info): Assume the right size of an array.
2146 2011-10-03 Ulrich Drepper <drepper@gmail.com>
2148 * nm.c: Recognize option --mark-special. Still recognize --mark-weak
2149 but don't show it in help anymore.
2150 (mark_special): Renamed from mark_weak.
2151 (parse_opt): Adjust.
2152 (class_type_char): Take additional parameters for ELF file and ELF
2153 header. Treat TLS symbols like objects.
2154 In case of D symbols, show u for unique symbols, R for symbols in
2155 read-only sections, B for symbols in BSS sections.
2156 (show_symbols_bsd): Take additional parameters for ELF file and ELF
2157 header. Adjust for class_type_char change. Show TLS symbols with
2158 @ after them in case --mark-special is selected.
2159 (show_symbols_posix): Likewise.
2160 (show_symbols): Adjust calls to show_symbols_bsd and
2162 (show_symbols_sysv): Avoid printing adress and size for undefined
2163 symbols. Don't print initial special entry and section entries.
2165 2011-10-02 Ulrich Drepper <drepper@gmail.com>
2167 * Makefile.am (demanglelib): Define.
2168 (nm_LDADD): Add demanglelib.
2169 * nm.c (options): Add -C option.
2170 (demangle): Define as global variable.
2171 (parse_opt): Recognize -C.
2172 (show_symbols_sysv): Handle demangling.
2173 (show_symbols_bad): Likewise.
2174 (show_symbols_posix): Likewise.
2175 (show_symbols): Likewise.
2177 2011-07-09 Roland McGrath <roland@hack.frob.com>
2179 * readelf.c (options, parse_opt): Grok -W/--wide and ignore it.
2181 * ar.c (parse_opt): Grok -u.
2183 2011-05-30 Mark Wielaard <mjw@redhat.com>
2185 * strip.c (relocate): Make offset check overflow-proof.
2187 2011-05-23 Mark Wielaard <mjw@redhat.com>
2189 * strip.c (relocate): Take new arguments is_rela to indicate
2190 whether the relocation is from a SHT_REL or SHT_RELA section.
2191 Relocate against any debug section symbol, not just STT_SECTION
2192 symbols. For SHT_REL relocations, fetch addend from offset and
2193 add it to symbol value if not zero.
2195 2011-05-23 Mark Wielaard <mjw@redhat.com>
2197 * strip.c (OPT_RELOC_DEBUG): New option.
2198 (argp_option): Add new --reloc-debug-sections option.
2199 (main): Check new option.
2200 (parse_opt): Likewise.
2201 (handle_elf): Remove any relocations between debug sections
2202 in ET_REL for the debug file when requested.
2204 2011-05-18 Mark Wielaard <mjw@redhat.com>
2206 * strip.c (handle_elf): Make sure all sections of a removed group
2207 section are removed too. Don't discard SHT_GROUP sections, copy
2208 section table before it gets modified. Section group signature
2209 symbols don't have to be retained.
2211 2011-05-16 Jakub Jelinek <jakub@redhat.com>
2213 * readelf.c (print_ops): Handle DW_OP_GNU_const_type,
2214 DW_OP_GNU_regval_type, DW_OP_GNU_deref_type, DW_OP_GNU_convert
2215 and DW_OP_GNU_reinterpret.
2217 2011-05-17 Mark Wielaard <mjw@redhat.com>
2219 * readelf.c (dwarf_tag_string): Fixup DW_TAG_GNU_call_site and
2220 DW_TAG_GNU_call_site_parameter return strings.
2222 2011-05-11 Marek Polacek <mpolacek@redhat.com>
2224 * nm.c (show_symbols_sysv): Remove unused if/else, remove
2225 unused `prefix' and `fname' parameters.
2227 2011-05-07 Marek Polacek <mpolacek@redhat.com>
2229 * unstrip.c (compare_sections_nonrel): Mark this function as static.
2231 2011-04-26 Mark Wielaard <mjw@redhat.com>
2233 * readelf.c (handle_notes_data): Call ebl_object_note_type_name
2236 2011-04-14 Mark Wielaard <mjw@redhat.com>
2238 * readelf.c (options): Add gdb_index.
2239 (section_e): Define section_gdb_index.
2240 (parse_opt): Recognize gdb_index debug-dump argument.
2241 (print_gdb_index_section): New function.
2242 (print_debug): Add gdb_index to debug_sections.
2244 2011-03-24 Petr Machata <pmachata@redhat.com>
2246 * readelf.c (print_debug_line_section): Emit initial space for all
2247 opcode lines. Print offset in front of each opcode.
2249 2011-03-22 Marek Polacek <mpolacek@redhat.com>
2251 * readelf.c (handle_dynamic): Don't segfault at DT_PLTREL case.
2253 2011-03-22 Mark Wielaard <mjw@redhat.com>
2255 * readelf.c (dwarf_tag_string): Support DW_TAG_GNU_call_site
2256 and DW_TAG_GNU_call_site_parameter.
2257 (dwarf_attr_string): Support DW_AT_GNU_call_site_value,
2258 DW_AT_GNU_call_site_data_value,
2259 DW_AT_GNU_call_site_target,
2260 DW_AT_GNU_call_site_target_clobbered,
2261 DW_AT_GNU_tail_call,
2262 DW_AT_GNU_all_tail_call_sites,
2263 DW_AT_GNU_all_call_sites,
2264 and DW_AT_GNU_all_source_call_sites.
2265 (print_ops): Handle DW_OP_GNU_entry_value.
2266 (attr_callback): Handle DW_AT_GNU_call_site_value,
2267 DW_AT_GNU_call_site_data_value,
2268 DW_AT_GNU_call_site_target,
2269 and DW_AT_GNU_call_site_target_clobbered.
2271 2011-03-10 Mark Wielaard <mjw@redhat.com>
2273 * elflint.c (check_symtab): Use ebl_check_st_other_bits.
2275 2011-02-27 Jan Kratochvil <jan.kratochvil@redhat.com>
2277 * readelf.c (reset_listptr): Clear TABLE->TABLE.
2279 2011-02-25 Mark Wielaard <mjw@redhat.com>
2281 * readelf.c (dwarf_attr_string): Add DW_AT_GNU_* handling.
2282 (dwarf_form_string): Properly format and return unknown form.
2284 2011-02-23 Roland McGrath <roland@redhat.com>
2286 * readelf.c (section_name): New function.
2287 (print_debug_abbrev_section): Use it instead of constant.
2288 (print_debug_aranges_section): Likewise.
2289 (print_debug_ranges_section): Likewise.
2290 (print_debug_units): Likewise.
2291 (print_debug_line_section): Likewise.
2292 (print_debug_loc_section): Likewise.
2293 (print_debug_macinfo_section): Likewise.
2294 (print_debug_pubnames_section): Likewise.
2295 (print_debug_str_section): Likewise.
2296 (print_debug) [USE_ZLIB]: Match .zdebug_* sections too.
2297 (print_debug_abbrev_section): Use decoded d_size, not sh_size.
2298 (print_debug_str_section): Likewise.
2300 * readelf.c (dwarf_attr_string): Grok DW_AT_GNU_odr_signature.
2302 2011-02-11 Roland McGrath <roland@redhat.com>
2304 * elfcmp.c (verbose): New variable.
2305 (options, parse_opt): Grok -l/--verbose to set it.
2306 (main): Under -l, keep going after first difference.
2308 * elfcmp.c (ignore_build_id): New variable.
2309 (options, parse_opt): Grok --ignore-build-id to set it.
2310 (main): For SHT_NOTE sections, compare note details rather than raw
2311 bytes. Under --ignore-build-id, don't complain about differing build
2312 ID contents if lengths match.
2314 2011-02-08 Roland McGrath <roland@redhat.com>
2316 * ldscript.y (filename_id_star): Remove unused variable.
2318 * unstrip.c (copy_elided_sections): Remove unused variable.
2320 * elflint.c (check_dynamic): Remove unused variables.
2322 * elflint.c (check_symtab): Warn about missing xndx section only once.
2324 * ldgeneric.c (check_for_duplicate2): Remove unused variable.
2326 2011-01-06 Roland McGrath <roland@redhat.com>
2328 * strip.c (handle_elf): Under --strip-sections, remove all
2329 non-allocated sections and never generate .gnu_debuglink.
2331 2011-01-04 Roland McGrath <roland@redhat.com>
2333 * strip.c (remove_shdrs): New variable.
2334 (options, parse_opt): Grok --strip-sections to set it.
2335 (handle_elf): When that's set, truncate off .shstrtab and shdrs.
2337 2010-11-10 Roland McGrath <roland@redhat.com>
2339 * findtextrel.c (process_file): Don't assume order of sections.
2340 Reported by Mike Hommey <mh@glandium.org>.
2342 2010-07-26 Roland McGrath <roland@redhat.com>
2344 * readelf.c (print_ops): Handle DW_OP_GNU_implicit_pointer.
2346 2010-08-30 Roland McGrath <roland@redhat.com>
2348 Print .debug_loc/.debug_ranges with cognizance of actual DIE uses.
2349 * readelf.c (parse_opt): Add section_info to implicit_debug_sections
2351 (struct listptr, struct listptr_table): New types.
2352 (compare_listptr, reset_listptr, sort_listptr): New functions.
2353 (notice_listptr, skip_listptr_hole): New functions.
2354 (struct attrcb_args): Add silent member.
2355 (attr_callback): Call notice_listptr for loclistptr and rangelistptr.
2356 Suppress output if silent, but still call notice_listptr.
2357 (print_debug_units): Suppress output if section_info not requested.
2358 (print_debug_loc_section): Call sort_listptr, skip_listptr_hole.
2359 (print_debug_ranges_section): Likewise.
2360 (print_debug): Call reset_listptr on both tables.
2362 * readelf.c (print_debug_ranges_section): Print empty list.
2363 (print_debug_loc_section): Likewise.
2365 * readelf.c (print_debug_loc_section): Check for bogus length
2366 before calling print_ops.
2367 (print_ops): Check harder for bogus data that would read off end.
2369 2010-08-11 Roland McGrath <roland@redhat.com>
2371 * readelf.c (for_each_section_argument): Process all sections with
2372 matching name, not just the first.
2374 2010-07-26 Roland McGrath <roland@redhat.com>
2376 * readelf.c (print_ops): Take new argument for CU version.
2377 Fix DW_OP_call_ref decoding to depend on it.
2378 (print_debug_loc_section): Update caller.
2379 (print_cfa_program): Take new argument, pass it down.
2380 (print_debug_frame_section): Update caller.
2381 (struct attrcb_args): New member version.
2382 (print_debug_units): Initialize it.
2384 2010-07-02 Roland McGrath <roland@redhat.com>
2386 * readelf.c (print_debug_frame_section): Use format_dwarf_addr for
2389 2010-06-30 Roland McGrath <roland@redhat.com>
2391 * strings.c (main): Use STDIN_FILENO, not STDOUT_FILENO.
2392 Ignore st_size for a non-S_ISREG file descriptor.
2393 (read_block): Move assert after no-mmap bail-out.
2394 (read_block_no_mmap): Fix size calculations for moving buffer remnant.
2396 2010-06-22 Roland McGrath <roland@redhat.com>
2398 * readelf.c (print_debug_line_section): Fix braino in DW_LNS_set_isa.
2400 2010-06-21 Roland McGrath <roland@redhat.com>
2402 * readelf.c (dwarf_tag_string): Handle new v4 tags.
2403 (dwarf_attr_string): Add new attributes.
2404 (dwarf_tag_string): Handle DW_TAG_GNU_*.
2406 * readelf.c (print_ops): Use 64-bit types for LEB128 operands.
2407 (print_cfa_program): Likewise.
2409 2010-06-20 Roland McGrath <roland@redhat.com>
2411 * readelf.c (print_debug_units): New function, broken out of ...
2412 (print_debug_info_section): ... here. Call it.
2413 (print_debug_types_section): New function.
2414 (enum section_e): Add section_types alias for section_info.
2415 (print_debug): Add types to the sections table.
2417 * readelf.c (print_debug_frame_section): Handle version 4 format.
2419 * readelf.c (print_debug_line_section): Handle version 4 format.
2421 2010-06-14 Roland McGrath <roland@redhat.com>
2423 * unstrip.c (copy_elided_sections): Make sure all sections' data have
2424 been read in before we write anything out.
2426 2010-06-04 Roland McGrath <roland@redhat.com>
2428 * unstrip.c (update_shdr): New function.
2429 (update_sh_size): Call it instead of gelf_update_shdr.
2430 (adjust_relocs, add_new_section_symbols): Likewise.
2431 (new_shstrtab, copy_elided_sections): Likewise.
2433 * unstrip.c (copy_elided_sections): Bail if stripped file has more
2434 sections than unstripped file, rather than getting confused later.
2436 2010-06-01 Roland McGrath <roland@redhat.com>
2438 * readelf.c (dwarf_form_string): Handle DWARF 4 forms.
2439 (attr_callback): Handle DW_FORM_flag_present, DW_FORM_exprloc,
2440 DW_FORM_sec_offset, DW_FORM_ref_sig8.
2442 * readelf.c (print_debug): Don't bail if libdw setup fails.
2443 Suppress complaint if we only want .eh_frame anyway.
2445 2010-05-28 Ulrich Drepper <drepper@redhat.com>
2447 * readelf.c (attr_callback): Also print form information.
2449 2010-05-19 Roland McGrath <roland@redhat.com>
2451 * addr2line.c (find_symbol): Short-circuit on empty name.
2452 (handle_address): Handle SYMBOL with no +OFFSET.
2454 2010-05-08 Roland McGrath <roland@redhat.com>
2456 * readelf.c (print_ops): Take new arg OFFSET_SIZE.
2457 Use that for DW_OP_call_ref, not ADDRSIZE.
2458 (print_cfa_program): Update caller.
2459 (struct attrcb_args): Add offset_size field.
2460 (attr_callback): Use it for print_ops call.
2461 (print_debug_info_section): Initialize it.
2462 (print_ops): Likewise.
2464 2010-04-14 Roland McGrath <roland@redhat.com>
2466 * readelf.c (handle_core_item): Fix bitmask printing.
2468 2010-04-06 Roland McGrath <roland@redhat.com>
2470 * ld.c (options): Fix some typos in messages.
2471 * elflint.c (check_scn_group, check_group): Likewise.
2472 * ldscript.y (add_id_list): Likewise.
2473 * readelf.c (print_hash_info): Add xgettext:no-c-format magic comment
2474 before translated string containing a literal %.
2476 2010-02-26 Roland McGrath <roland@redhat.com>
2478 * readelf.c (process_file): Don't leak an fd in failure case.
2480 2010-02-15 Roland McGrath <roland@redhat.com>
2482 * Makefile.am: Use config/eu.am for common stuff.
2484 * readelf.c (print_debug_frame_section): Add a cast to avoid sign
2485 mismatch in comparison.
2487 2010-02-02 Roland McGrath <roland@redhat.com>
2489 * readelf.c (print_encoding_base): Handle DW_EH_PE_absptr (zero).
2490 (read_encoded): Likewise.
2491 (print_debug_frame_section): Check for bogus augmentation length.
2492 For P augmentation, use read_encoded, print the encoding description,
2493 and use hex for unsigned values.
2495 2010-01-15 Roland McGrath <roland@redhat.com>
2497 * ar.c: Include <sys/stat.h>.
2498 * elflint.c: Likewise.
2499 * readelf.c: Likewise.
2500 * strip.c: Likewise.
2501 * unstrip.c: Likewise
2503 2010-01-07 Roland McGrath <roland@redhat.com>
2505 * readelf.c (print_ehdr): Handle PN_XNUM.
2506 (phnum): New static variable.
2507 (process_elf_file): Set it with elf_getphdrnum.
2508 (print_phdr): Use phnum instead of EHDR->e_phnum.
2509 (print_dynamic, handle_notes): Likewise.
2510 (handle_relocs_rel, handle_relocs_rela): Likewise.
2512 * elfcmp.c (main): Use elf_getshdrnum and elf_getphdrnum.
2514 * elflint.c (phnum): New static variable.
2515 (check_elf_header): Set it, handling PN_XNUM.
2516 Use that in place of EHDR->e_phnum throughout.
2517 (check_symtab, check_reloc_shdr, check_dynamic): Likewise.
2518 (unknown_dependency_p, check_sections, check_program_header): Likewise.
2520 2010-01-05 Roland McGrath <roland@redhat.com>
2522 * readelf.c (dwarf_attr_string): Match DW_AT_GNU_vector and
2523 DW_AT_GNU_template_name.
2525 2010-01-04 Roland McGrath <roland@redhat.com>
2527 * readelf.c (handle_notes_data): Grab NT_AUXV only for name "CORE".
2528 (handle_core_note): Pass NHDR and NAME to ebl_core_note.
2529 (handle_core_item): Handle .format of '\n' as \n-separated strings.
2531 * readelf.c (implicit_debug_sections): New variable.
2532 (parse_opt): Set it instead of print_debug_sections for -a.
2533 OR them together for print_debug check.
2534 (print_debug): OR them together for section check.
2536 * readelf.c (options): Repartition into set implied by -a and others.
2537 Correct -a text to match reality.
2539 * readelf.c (struct section_argument): Add bool member 'implicit'.
2540 (parse_opt): Set it for -a cases, clear it for -x args.
2541 (for_each_section_argument): Don't complain about a missing section by
2542 name if it's implicit.
2544 2009-11-16 Roland McGrath <roland@redhat.com>
2546 * readelf.c (print_string_section): Punt SHT_NOBITS like empty
2547 sections, just as dump_data_section already does.
2549 2009-09-21 Ulrich Drepper <drepper@redhat.com>
2551 * elflint.c (special_sections): Allow MERGE and STRINGS flags to be
2552 set for .comment section.
2553 Patch by Mark Wielaard <mjw@redhat.com>.
2555 2009-09-08 Roland McGrath <roland@redhat.com>
2557 * ar.c (main): Fix typo in message format.
2559 2009-08-21 Roland McGrath <roland@redhat.com>
2561 * readelf.c (attr_callback): Use print_block only when we don't use
2564 2009-08-14 Roland McGrath <roland@redhat.com>
2566 * ar.c (do_oper_extract): Use pathconf instead of statfs.
2568 2009-08-01 Ulrich Drepper <drepper@redhat.com>
2570 * debugpred.h: Add two most const.
2572 2009-07-26 Mark Wielaard <mjw@redhat.com>
2574 * elflint.c (check_note_data): Recognize NT_GNU_GOLD_VERSION.
2576 2009-07-25 Mark Wielaard <mjw@redhat.com>
2578 * Makefile.am (addr2line_LDADD): Add $(libelf).
2580 2009-07-24 Roland McGrath <roland@redhat.com>
2582 * readelf.c (print_block): New function.
2583 (print_ops): Use it.
2584 (attr_callback): Use it for DW_FORM_block* forms.
2586 2009-07-20 Mark Wielaard <mjw@redhat.com>
2588 * readelf.c (print_ops): Add handling of DW_OP_implicit_value
2589 and DW_OP_stack_value.
2591 2009-07-14 Ulrich Drepper <drepper@redhat.com>
2593 * elflint.c (check_elf_header): Allow Linux ABI.
2594 (check_symtab): Handle STB_GNU_UNIQUE.
2596 2009-07-08 Mark Wielaard <mjw@redhat.com>
2598 * readelf.c (attr_callback): Handle DW_Form constants for
2599 DW_AT_data_member_location.
2601 2009-07-06 Roland McGrath <roland@redhat.com>
2603 * readelf.c (register_info): New function. Handle unknown register #s.
2604 (print_cfa_program): Use it.
2605 (handle_core_register, handle_core_registers): Likewise.
2607 2009-06-28 Roland McGrath <roland@redhat.com>
2609 * readelf.c (print_address_names): New static variable.
2610 (options, parse_opt): Grok -N/--numeric-addresses to clear it.
2611 (format_dwarf_addr): Don't look up name if !print_address_names.
2613 2009-06-13 Ulrich Drepper <drepper@redhat.com>
2615 * ldgeneric.c: Don't use deprecated libelf functions.
2617 * objdump.c: Likewise.
2618 * readelf.c: Likewise.
2620 * strip.c: Likewise.
2621 * unstrip.c: Likewise.
2622 * ld.h: Fix up comment.
2624 2009-06-01 Ulrich Drepper <drepper@redhat.com>
2626 * readelf.c (print_relocs): Expect ELF header argument and pass on
2627 to handle_relocs_rel* functions. Adjust caller.
2628 (handle_relocs_rel): Add ELF header argument. Add special case for
2629 the IRELATIVE relocations in statically linked executables.
2630 (handle_relocs_rela): Likewise.
2632 2009-04-29 Ulrich Drepper <drepper@redhat.com>
2634 * elflint.c (check_symtab): Add tests of st_other field.
2636 2009-04-23 Ulrich Drepper <drepper@redhat.com>
2638 * Makefile [BUILD_STATIC] (libdw): Add $(zip_LIBS).
2640 2009-04-20 Roland McGrath <roland@redhat.com>
2642 * addr2line.c (print_dwarf_function): Honor -s and -A for file names
2643 of inline call sites.
2645 * addr2line.c (just_section): New variable.
2646 (adjust_to_section): New function, broken out of ...
2647 (handle_address): ... here.
2648 (options, parse_opt): Add -j/--section=NAME to set it.
2650 2009-04-15 Roland McGrath <roland@redhat.com>
2652 * readelf.c (print_debug_frame_section): Check for DW_CIE_ID_64 in
2653 64-bit format header, DW_CIE_ID_32 in 32-bit format header.
2655 2009-04-14 Roland McGrath <roland@redhat.com>
2657 * readelf.c (print_attributes): Treat SHT_ARM_ATTRIBUTES on EM_ARM
2658 like SHT_GNU_ATTRIBUTES.
2660 * readelf.c (handle_core_registers): Fix error message.
2662 * strip.c (handle_elf: check_preserved): Don't note any change when
2663 .debug_data is already filled from a previous pass.
2665 2009-02-05 Ulrich Drepper <drepper@redhat.com>
2667 * objdump.c (show_relocs_x): Minor cleanups.
2669 * readelf.c (print_cfa_program): Correct a few labels.
2670 Print first DW_CFA_expression and DW_CFA_val_expression parameter
2673 2009-02-01 Ulrich Drepper <drepper@redhat.com>
2675 * objdump.c (show_relocs_rel, show_relocs_rela): Split common parts
2677 (show_relocs_x): ...here. New function.
2678 (show_relocs): Better spacing in output.
2680 * objdump.c (show_relocs_rela): Show offsets as signed values.
2682 * ar.c (main): Fix recognition of invalid modes for a, b, i modifiers.
2683 Improve some error messages.
2684 Use program_invocation_short_name instead of AR macro.
2685 * Makefile.am (CFLAGS_ar): Remove.
2686 * elflint.c (parse_opt): ARGP_HELP_EXIT_ERR does nothing for argp_help.
2687 * objdump.c (parse_opt): Likewise.
2688 * readelf.c (parse_opt): Likewise.
2690 2009-01-27 Roland McGrath <roland@redhat.com>
2692 * readelf.c (print_ops): Notice short length, don't overrun buffer
2693 (still need to fix LEB128).
2695 * readelf.c (print_ops): Fix DW_OP_call[24] decoding.
2697 * readelf.c (print_ops): Print (empty)\n when LEN == 0.
2699 2009-01-24 Ulrich Drepper <drepper@redhat.com>
2701 * readelf.c (print_debug_frame_section): Fix computation of vma_base
2702 for PC-relative mode.
2704 2009-01-23 Ulrich Drepper <drepper@redhat.com>
2706 * size.c (process_file): When handling archive, close file descriptor
2707 here. For unknown file format also close file descriptor.
2708 (handle_ar): Don't close file descriptor here.
2710 * readelf.c (parse_opt): Move code to add to dump_data_sections and
2711 string_sections list in local function add_dump_section. Adjust 'x'
2712 key handling. For 'a' key add .strtab, .dynstr, and .comment section
2713 to string_sections list.
2715 2009-01-22 Roland McGrath <roland@redhat.com>
2717 * readelf.c (print_phdr): Don't print section mapping when no sections.
2719 * Makefile.am (AM_CFLAGS): Pass -Wno-format for *_no_Wformat.
2721 * readelf.c (print_debug_frame_section): Initialize IS_SIGNED to false
2722 and reset it only for the 'true' cases.
2724 * Makefile.am (addr2line_no_Wformat): New variable.
2726 * readelf.c (print_debug_frame_section): Use t instead of j formats
2727 for ptrdiff_t OFFSET.
2729 2009-01-21 Ulrich Drepper <drepper@redhat.com>
2731 * elflint.c (check_program_header): Fix typo in .eh_frame_hdr section
2732 test. Handle debuginfo files.
2733 (check_exception_data): First sanity test.
2735 2009-01-17 Ulrich Drepper <drepper@redhat.com>
2737 * readelf.c (print_debug_exception_table): Show target of ar_disp
2740 * elflint.c (check_program_header): Add most consistency checks for
2741 PT_GNU_EH_FRAME entry.
2743 * addr2line.c: Use ARGP_PROGRAM_VERSION_HOOK_DEF and
2744 ARGP_PROGRAM_BUG_ADDRESS_DEF.
2746 * elfcmp.c: Likewise.
2747 * elflint.c: Likewise.
2748 * findtextrel.c: Likewise.
2751 * objdump.c: Likewise.
2752 * ranlib.c: Likewise.
2753 * readelf.c: Likewise.
2756 * strings.c: Likewise.
2757 * strip.c: Likewise.
2758 * unstrip.c: Likewise.
2760 2009-01-16 Ulrich Drepper <drepper@redhat.com>
2762 * elflint.c (check_program_header): Check that PT_GNU_EH_FRAME entry
2763 matches .eh_frame_hdr section, if it is available. Also check that
2764 the segment is allocated, not writable, not executable.
2766 * readelf.c: Add -e option. Dump exception and unwind related
2767 sections. Add -e to -a.
2768 (print_encoding_base): Handle DW_EH_PE_omit.
2769 (print_debug_exception_table): Beginning of support.
2770 (print_debug): Hook up print_debug_exception_table for
2771 .gcc_except_table sections.
2773 * readelf.c (print_debug_frame_section): Some fixes for last change.
2775 2009-01-15 Ulrich Drepper <drepper@redhat.com>
2777 * readelf.c (print_encoding): Now a toplevel function.
2778 (print_relinfo): Likewise.
2779 (print_encoding_base): Broken out of print_debug_frame_section.
2780 (print_debug_frame_section): Print different header for .eh_frame
2781 sections. Fix recognition of matching CIEs in .debug_frame sections.
2782 Print absolute offset for PC-relative FDE locations. Don't print
2783 table header for FDEs if the table is empty.
2784 (read_encoded): New function.
2785 (print_debug_frame_hdr_section): New function.
2786 (print_debug): Hook up print_debug_frame_hdr_section for .eh_frame_hdr
2789 * readelf.c (handle_relocs_rel): Print section number.
2790 (print_debug_abbrev_section): Likewise.
2791 (print_debug_aranges_section): Likewise.
2792 (print_debug_ranges_section): Likewise.
2793 (print_debug_info_section): Likewise.
2794 (print_debug_line_section): Likewise.
2795 (print_debug_loc_section): Likewise.
2796 (print_debug_macinfo_section): Likewise.
2797 (print_debug_pubnames_section): Likewise.
2798 (print_debug_str_section): Likewise.
2800 2009-01-10 Ulrich Drepper <drepper@redhat.com>
2802 * strings.c (read_block): Fix typo in error message string.
2804 2009-01-07 Ulrich Drepper <drepper@redhat.com>
2806 * ld.c (ld_new_searchdir): Fix adding to search path list.
2808 2009-01-06 Ulrich Drepper <drepper@redhat.com>
2810 * readelf.c: Implement call frame debug section dumping.
2812 2009-01-05 Roland McGrath <roland@redhat.com>
2814 * elfcmp.c: Exit with status 2 for errors (like cmp, diff, grep).
2815 Status 1 (aka EXIT_FAILURE) is only for completed OK but not equal.
2817 2009-01-01 Ulrich Drepper <drepper@redhat.com>
2819 * addr2line.c: Update copyright year.
2821 * elfcmp.c: Likewise.
2822 * elflint.c: Likewise.
2823 * findtextrel.c: Likewise.
2826 * objdump.c: Likewise.
2827 * ranlib.c: Likewise.
2828 * readelf.c: Likewise.
2830 * strings.c: Likewise.
2831 * strip.c: Likewise.
2832 * unstrip.c: Likewise.
2834 2008-12-11 Roland McGrath <roland@redhat.com>
2836 * nm.c (sym_name): New function.
2837 (show_symbols_sysv): Use it in place of elf_strptr.
2838 (show_symbols_bsd, show_symbols_posix): Likewise.
2841 * nm.c (show_symbols_sysv): Use an alloca'd backup section name when
2844 2008-12-02 Roland McGrath <roland@redhat.com>
2846 * readelf.c (count_dwflmod, process_file): Don't presume encoding of
2847 nonzero OFFSET argument to dwfl_getmodules.
2849 2008-08-07 Roland McGrath <roland@redhat.com>
2851 * addr2line.c (main): Pass string to handle_address.
2852 (see_one_module): New function, subroutine of handle_address.
2853 (find_symbol): Likewise.
2854 (handle_address): Take string argument rather than address.
2855 Convert plain number, or handle strings like "(section)+offset"
2858 2008-08-01 Roland McGrath <roland@redhat.com>
2860 * readelf.c (handle_core_item): Handle 'B' type for 1-origin bitset.
2861 For 'b' and 'B', print <x-y,z> or ~<x,y-z> rather than 1/0 string.
2863 * readelf.c (convert): Take new argument SIZE.
2864 (handle_core_register, handle_core_item): Update callers.
2865 (handle_core_item): Take new arg REPEATED_SIZE.
2866 (handle_core_items): Special case for a singleton item,
2867 let handle_core_item handle repeats if it wants to.
2869 * readelf.c (handle_core_items): Give abridged output
2870 for identical groups repeated more than twice.
2872 2008-07-04 Roland McGrath <roland@redhat.com>
2874 * readelf.c (handle_core_items): Handle ELF_T_ADDR.
2876 2008-04-10 Roland McGrath <roland@redhat.com>
2878 * strip.c (handle_elf): Don't keep sections that kept symbol tables
2879 refer to. Instead, just be sure to preserve the original symbol
2880 table in the debug file so those symbols go with their sections and
2881 can be elided from the stripped version of the symbol table.
2883 * strip.c (handle_elf): When a discarded section kept in the debug
2884 file refers to a nondiscard section via sh_link/sh_info, preserve
2885 that nondiscarded section unmodified in the debug file as well.
2886 Skip adjustment of discarded sections symbol table references when
2887 that symbol table is copied in this way.
2889 * elflint.c (check_symtab): Don't crash from missing symbol names
2890 after diagnosing bogus strtab.
2892 * strip.c (handle_elf): Cosmetic cleanup in special section contents
2893 adjustment for symtab changes.
2895 2008-03-31 Roland McGrath <roland@redhat.com>
2897 * elflint.c (check_sections): Add checks on SHF_EXECINSTR sections:
2898 must be SHT_PROGBITS, must not be SHF_WRITE. Let backend hook
2899 excuse a special section.
2901 2008-03-27 Roland McGrath <roland@redhat.com>
2903 * elflint.c (check_sections): Check that executability and writability
2904 of sections is reflected in segment p_flags.
2906 2008-03-26 Roland McGrath <roland@redhat.com>
2908 * elflint.c (check_program_header): Accept PT_GNU_RELRO p_flags
2909 that matches its PT_LOAD's p_flags &~ PF_W. On sparc, PF_X really
2912 2008-02-29 Roland McGrath <roland@redhat.com>
2914 * readelf.c (print_attributes): Add a cast.
2915 * elflint.c (check_attributes): Likewise.
2917 * unaligned.h (add_8ubyte_unaligned): Cast PTR argument for parity
2918 with [UNALIGNED_ACCESS_CLASS == BYTE_ORDER] definition.
2919 (add_4ubyte_unaligned, add_2ubyte_unaligned): Likewise.
2921 2008-02-03 Ulrich Drepper <drepper@redhat.com>
2923 * i386_ld.c (elf_i386_count_relocations): Implement R_386_TLS_GD
2924 when linked into executable.
2925 (elf_i386_create_relocations): Likewise.
2927 2008-02-20 Roland McGrath <roland@redhat.com>
2929 * readelf.c (print_attributes): New function.
2930 (process_elf_file): Call it under -A.
2932 * elflint.c (check_attributes): Implement it for real.
2934 2008-02-19 Roland McGrath <roland@redhat.com>
2936 * elflint.c (special_sections): Handle .gnu.attributes section.
2937 (check_sections): Likewise.
2938 (check_attributes): New function.
2940 2008-02-10 Roland McGrath <roland@redhat.com>
2942 * elfcmp.c (main): Ignore sh_offset differences in non-SHF_ALLOC
2943 sections and ET_REL files.
2945 2008-02-02 Ulrich Drepper <drepper@redhat.com>
2947 * elf32-i386.script: Add .eh_frame_hdr, .tdata, and .tbss sections.
2948 * i386_ld.c (elf_i386_count_relocations): Handle R_386_TLS_LDO_32
2950 (elf_i386_create_relocations): Likewise.
2951 * ld.h (struct ld_state): Add need_tls, tls_start, and tls_tcb
2953 * ldgeneric.c (add_section): If TLS section is used, set need_tls flag.
2954 (ld_generic_create_outfile): Add PT_TLS entry to program header.
2955 Fix generation of PT_GNU_STACK entry.
2957 2008-02-01 Ulrich Drepper <drepper@redhat.com>
2959 * ld.c (replace_args): Prevent loop over replacements if the parameter
2960 is only two characters long.
2962 * ld.c: Recognize sha1 argument for --build-id parameter.
2963 * ldgeneric.c (create_build_id_section): Handle sha1.
2964 (compute_hash_sum): New function. Broken out of compute_build_id.
2965 Take hash function and context as parameters.
2966 (compute_build_id): Use compute_hash_sum for md5 and the new sha1
2969 2008-01-31 Ulrich Drepper <drepper@redhat.com>
2971 * elf32-i386.script: Add .note.ABI-tag and .note.gnu.build-id sections.
2972 * ld.c: Recognize --build-id command line parameter.
2973 * ld.h: Define scn_dot_note_gnu_build_id.
2974 (struct ld_state): Add build_id and buildidscnidx elements.
2975 * ldgeneric.c: Implement --build-id command line parameter.
2976 * ldlex.l (ID): Recognize - as valid character after the first one.
2978 2008-01-29 Ulrich Drepper <drepper@redhat.com>
2980 * ld.c (replace_args): New function.
2981 (main): Use it to rewrite old-style parameters.
2983 * elf32-i386.script: Add .gnu.hash section.
2984 * ldgeneric.c (optimal_bucket_size): A tiny bit more efficient.
2985 (fillin_special_symbol): Initialize st_size.
2986 (sortfct_hashval): New function.
2987 (create_gnu_hash): New function.
2988 (create_hash): New function.
2989 (ld_generic_create_outfile): Use the new functions to create the
2992 * elflint.c (check_gnu_hash): Fix index value printed in error message.
2994 2008-01-24 Ulrich Drepper <drepper@redhat.com>
2996 * elflint.c (check_group): Check that signature symbol for section
2997 group is not an empty string.
2998 * ldgeneric.c: Remove magic assignment of indeces in the dynsym
2999 section. Start implementation of --hash-style.
3000 * i386_ld.c: Likewise.
3001 * ld.c: Recognize --hash-style.
3002 * ld.h (struct scninfo): Add comdat_group.
3003 Add additional parameter to finalize_plt callback.
3005 2008-01-22 Ulrich Drepper <drepper@redhat.com>
3007 * ld.h (struct callbacks): Add initialize_gotplt.
3008 (struct scnhead): Add scn_dot_gotplt.
3009 (struct ld_state): Add gotpltscnidx.
3010 * i386_ld.c (elf_i386_initialize_plt): Minor optimization.
3011 (elf_i386_initialize_pltrel): Likewise.
3012 (elf_i386_initialize_got): There is now a separate .got.plt, so
3013 don't do the PLT-related work here. Initialize d_type.
3014 (elf_i386_initialize_gotplt): New function.
3015 (elf_i386_plt0): Use ud2a after indirect jump.
3016 (elf_i386_pic_plt0_entry): Likewise.
3017 (elf_i386_finalize_plt): Reference now .got.plt.
3018 (elf_i386_count_relocations): For GOT entries which need no relocation
3019 don't bump nrel_got.
3020 (elf_i386_create_relocations): Also get .got.plt. Rewrite R-386_GOT32
3021 handling for split .got/.got.plt.
3022 (elf_i386_ld_init): Initialize callbacks.initialize_gotplt.
3023 * elf32-i386.script: Sort sections for security. There are no .got
3024 input sections. Add .got.plt.
3025 * ldgeneric.c (ld_generic_generate_sections): Add .got.plt section.
3026 (ld_generic_create_outfile): Initialize .got.plt section.
3027 Use .got.plt address for _GLOBAL_OFFSET_TABLE_ symbol and DT_PLTGOT.
3029 2008-01-19 Ulrich Drepper <drepper@redhat.com>
3031 * i386_ld.c (elf_i386_count_relocations): PLT relocations for undefined
3032 symbols are not carried over into statically linked output files.
3033 Add dummy entries for more TLS relocations.
3035 * ld.c (options): Add long names for -( and -).
3037 * ldgeneric.c (check_definition): For newly found definitions don't
3038 mark section as used if symbol is absolute.
3039 (extract_from_archive): Only assign archive sequence number the first
3040 time the archive is handled. Update ld_state.last_archive_used
3041 if any symbol was used. Remove nround variable.
3042 (file_process2): When using symbol from an archive, update
3043 ld_state.group_start_archive, ld_state.archives, and
3044 ld_state.tailarchives.
3045 (ld_generic_file_process): If group is not handled anymore, after
3046 freeing ELF handles for the archives, clear ld_state.archives and
3047 *nextp. Fix wrong logic in recognizing first iteration of group
3048 loop. When clearing flags, also clear ld_state.group_start_archive.
3050 2008-01-11 Ulrich Drepper <drepper@redhat.com>
3052 * objdump.c (show_disasm): Adjust disassembler format string for
3055 2008-01-04 Roland McGrath <roland@redhat.com>
3057 * readelf.c (handle_core_items): Take new arg DESCSZ; if nonzero,
3058 a size greater than the items cover means multiple sets of items.
3059 (handle_core_note): Update caller.
3061 2008-01-04 Roland McGrath <roland@redhat.com>
3063 * strip.c (handle_elf): Move SHDRIDX defn to silence gcc warning.
3065 2008-01-03 Roland McGrath <roland@redhat.com>
3067 * ld.h (linked_from_dso_p): Use __attribute__ ((__gnu_inline__)).
3069 * elflint.c (check_dynamic): Remove duplicate initializer.
3071 2008-01-02 Ulrich Drepper <drepper@redhat.com>
3073 * addr2line.c: Update copyright year.
3075 * elfcmp.c: Likewise.
3076 * elflint.c: Likewise.
3077 * findtextrel.c: Likewise.
3080 * objdump.c: Likewise.
3081 * ranlib.c: Likewise.
3082 * readelf.c: Likewise.
3084 * strings.c: Likewise.
3085 * strip.c: Likewise.
3086 * unstrip.c: Likewise.
3088 2007-12-30 Ulrich Drepper <drepper@redhat.com>
3090 * objdump (show_disasm): Use %e after third parameter.
3092 2007-12-21 Ulrich Drepper <drepper@redhat.com>
3094 * strip.c: Fix wrong parenthesis in a few branch predictions.
3095 * strings.c: Likewise.
3097 2007-12-20 Ulrich Drepper <drepper@redhat.com>
3099 * Makefile.am (DEFS): Add DEBUGPRED.
3100 * addr2line.c: Include debugpred.h.
3102 * elfcmp.c: Likewise.
3103 * elflint.c: Likewise.
3104 * findtextrel.c: Likewise.
3106 * objdump.c: Likewise.
3107 * ranlib.c: Likewise.
3108 * readelf.c: Likewise.
3110 * strings.c: Likewise.
3111 * strip.c: Likewise.
3112 * unstrip.c: Likewise.
3113 * debugpred.h: New file.
3115 * readelf.c (handle_relocs_rel): Use elf_scnshndx.
3116 (handle_relocs_rela): Likewise.
3118 * readelf.c: Add lots of likely/unlikely.
3120 * elflint.c: Minor cleanups.
3122 2007-11-19 Roland McGrath <roland@redhat.com>
3124 * readelf.c (print_ops): Handle all bad op codes gracefully.
3125 Print their numbers instead of just ???.
3127 2007-11-09 Roland McGrath <roland@redhat.com>
3129 * readelf.c (attr_callback): Handle DW_AT_data_location.
3130 Handle block forms to mean a DWARF expression for DW_AT_allocated,
3131 DW_AT_associated, DW_AT_bit_size, DW_AT_bit_offset, DW_AT_bit_stride,
3132 DW_AT_byte_size, DW_AT_byte_stride, DW_AT_count, DW_AT_lower_bound,
3135 2007-10-20 Roland McGrath <roland@redhat.com>
3137 * unstrip.c (options): Update -R description.
3138 (struct symbol): Put symbol details a union with a size_t pointer
3140 (compare_symbols_output): Use null ->name as marker for discard
3141 symbols, not zero *->map.
3142 (copy_elided_sections): Record forwarding pointers for discarded
3143 duplicates and fill SYMNDX_MAP elements through them.
3145 * readelf.c (process_file): Set offline_next_address to 0 at start.
3146 (struct process_dwflmod_args): New type.
3147 (process_dwflmod): Take args in it, pass fd to process_elf_file.
3148 (process_file): Update caller; dup FD for passing to libdwfl.
3149 (process_elf_file): Take new arg FD. For ET_REL file when
3150 displaying data affected by libdwfl relocation, open a new Elf handle.
3152 2007-10-17 Roland McGrath <roland@redhat.com>
3154 * readelf.c (print_debug_line_section): For invalid data inside a
3155 unit with plausible length, keep printing at the next unit boundary.
3157 * readelf.c (attr_callback): Use dwarf_formref_die, not dwarf_formref.
3159 2007-10-16 Roland McGrath <roland@redhat.com>
3161 * readelf.c (hex_dump): Fix rounding error in whitespace calculation.
3163 2007-10-15 Roland McGrath <roland@redhat.com>
3165 * make-debug-archive.in: New file.
3166 * Makefile.am (EXTRA_DIST): Add it.
3167 (make-debug-archive): New target.
3168 (bin_SCRIPTS, CLEANFILES): Add it.
3170 2007-10-10 Roland McGrath <roland@redhat.com>
3172 * elflint.c (special_sections): Add new attrflag value exact_or_gnuld.
3173 Use it to check MERGE|STRINGS for .debug_str.
3174 (check_sections): Handle exact_or_gnuld.
3176 2007-10-08 Roland McGrath <roland@redhat.com>
3178 * readelf.c (handle_core_item): Handle 'T'|0x80 to indicate
3179 64-bit struct timeval with 32-bit tv_usec.
3181 2007-10-07 Roland McGrath <roland@redhat.com>
3183 * readelf.c (check_archive_index): New function.
3184 (process_file): Call it. Change signature to take only fd and name.
3185 Use libdwfl to open the file, then iterate on its modules (multiple
3186 for an archive) to print file name and call process_elf_file.
3187 (main): Update caller. Let process_file do elf_begin.
3188 (count_dwflmod, process_dwflmod, find_no_debuginfo): New functions.
3189 (process_elf_file): Take only Dwfl_Module * argument.
3190 Don't print the file name here.
3191 (print_debug_*_section): Take Dwfl_Module * argument.
3192 (print_debug): Likewise. Update caller.
3193 (format_dwarf_addr): New function.
3194 (print_debug_ranges_section): Use it.
3195 (attr_callback): Likewise.
3196 (print_debug_line_section, print_debug_loc_section): Likewise.
3198 * readelf.c (print_debug_ranges_section): Translate all strings.
3199 (print_debug_loc_section): Likewise.
3201 * unstrip.c (copy_elided_sections): Initialize SEC.
3203 * ar.c (do_oper_insert): Put trailing / on short names.
3205 * arlib.h (MAX_AR_NAME_LEN): Decrease by one.
3207 * arlib2.c (arlib_add_long_name): Adjust for header size.
3209 * arlib.c (arlib_finalize): Pad long name table to keep size even.
3211 * ar.c (do_oper_insert): Use write_retry for padding write.
3213 * ar.c (do_oper_insert): Initialize CUR_OFF in no_old case.
3214 Unconditionally set FOUND[CNT]->elf when setting ->mem.
3215 (remember_long_name): New function.
3216 (do_oper_insert): Call it. Correctly use length of basename,
3217 not original name. Don't store long name twice for new member.
3219 2007-10-06 Roland McGrath <roland@redhat.com>
3221 * elflint.c (check_note): Skip empty segment.
3222 (check_note_section): Skip empty section.
3224 * unstrip.c (options, parse_opt, struct arg_info): Grok -R/--relocate.
3225 (handle_output_dir_module, handle_implicit_modules): Pass it down.
3226 (handle_dwfl_module): When set, use ET_REL already loaded by Dwfl.
3227 (compare_alloc_sections): Take new arg REL, ignore address if true.
3228 (compare_sections): Likewise, pass it down.
3229 (compare_sections_rel, compare_sections_nonrel): New functions.
3230 (find_alloc_sections_prelink, copy_elided_sections): Use them
3231 instead of compare_sections.
3232 (sections_match): New function, broken out of ...
3233 (find_alloc_section): ... here.
3234 (copy_elided_sections): Reorganize section match-up logic.
3235 Use sections_match for SHF_ALLOC in ET_REL.
3236 For ET_REL, let the nonzero sh_addr from the debug file dominate.
3238 * unstrip.c (add_new_section_symbols): Take new arg REL.
3239 When true, do not update section symbol values.
3240 (collect_symbols): Likewise. Update section symbols with address
3241 of chosen output section, not original section.
3242 (check_symtab_section_symbols, copy_elided_sections): Update callers.
3244 * unstrip.c (compare_alloc_sections): At the same address, preserve
3245 original section order.
3247 * elflint.c (special_sections): Don't require MERGE|STRINGS for
3248 .debug_str, it didn't always have them with older tools.
3250 * elflint.c (check_symtab, check_one_reloc): Ignore sh_addr in ET_REL.
3252 2007-10-05 Roland McGrath <roland@redhat.com>
3254 * elflint.c (check_symtab): Allow SHN_UNDEF _GLOBAL_OFFSET_TABLE_ in
3257 * elflint.c (check_symtab): For _GLOBAL_OFFSET_TABLE_, diagnose
3258 SHN_UNDEF as "bad section". Use shndx value in messages.
3260 * elflint.c (special_sections): Add ".debug_str". Decrement namelen
3261 for ".debug" so it matches as a prefix.
3262 (IS_KNOWN_SPECIAL): New macro.
3263 (check_sections): Use it for ".plt" match. Cite wrong SHT_NOBITS
3264 type even under -d, for a .debug* or .shstrtab section.
3266 * readelf.c (print_ops): Use hex for address operand.
3268 2007-10-04 Roland McGrath <roland@redhat.com>
3270 * unstrip.c (copy_elided_sections): Initialize NDX_SECTION element for
3271 .gnu_debuglink section to SHN_UNDEF. Drop STT_SECTION symbols for
3272 sections mapped to SHN_UNDEF.
3274 2007-10-04 Ulrich Drepper <drepper@redhat.com>
3276 * readelf.c (dump_archive_index): Avoid warning about uninitialized
3277 variable with older glibc versions.
3278 Add some branch prediction.
3280 2007-10-04 Roland McGrath <roland@redhat.com>
3282 * readelf.c (print_archive_index): New variable.
3283 (options, parse_opt): Accept -c/--archive-index to set it.
3284 (dump_archive_index): New function.
3285 (process_file): Take new arg WILL_PRINT_ARCHIVE_INDEX.
3286 Call dump_archive_index on archives if set.
3287 (main): Update caller.
3288 (any_control_option): Give it file scope, moved out of ...
3289 (parse_opt): ... here.
3291 2007-10-03 Roland McGrath <roland@redhat.com>
3293 * unstrip.c (struct arg_info): Add `list' flag.
3294 (options, parse_opt): Grok -n/--list to set it.
3295 (list_module): New function.
3296 (handle_implicit_modules): Call it under -n.
3298 * elflint.c (check_note_section): New function.
3299 (check_sections): Call it for SHT_NOTE.
3301 * readelf.c (handle_notes): Use sections when available.
3303 * elflint.c (check_note_data): New function, broken out of ...
3304 (check_note): ... here. Call it and elf_getdata_rawchunk.
3306 * readelf.c (handle_auxv_note): Take offset as argument, not buffer.
3307 Use elf_getdata_rawchunk and gelf_getauxv.
3308 (handle_notes_data): New function, broken out of ...
3309 (handle_notes): ... here. Call it and elf_getdata_rawchunk.
3311 2007-10-01 Roland McGrath <roland@redhat.com>
3313 * readelf.c (hex_dump): Fix transposed subtraction generating spaces.
3315 * readelf.c (hex_dump): Fix line header to be hex instead of decimal.
3317 2007-09-10 Roland McGrath <roland@redhat.com>
3319 * readelf.c (options): Give -p optional argument, alias --string-dump.
3320 (string_sections, string_sections_tail): New static variables.
3321 (parse_opt): Set them when -p has an argument.
3322 (print_string_section): New function, broken out of ...
3323 (print_strings): ... here. Call it.
3324 (dump_data_section): New function, broken out of ...
3325 (dump_data): ... here. Call it.
3326 (for_each_section_argument): New function, broken out of ...
3327 (dump_data): ... here. Call it.
3328 (dump_strings): New function.
3330 2007-08-31 Roland McGrath <roland@redhat.com>
3332 * readelf.c (print_strings): Typo fix.
3334 2007-08-23 Roland McGrath <roland@redhat.com>
3336 * readelf.c (printf_with_wrap): Function removed.
3337 (REGISTER_WRAP_COLUMN): New macro.
3338 (handle_core_register): Use print_core_item instead.
3339 (struct register_info): New type.
3340 (compare_registers, compare_register_sets): New functions.
3341 (register_bitpos, compare_sets_by_info): New functions.
3342 (handle_core_registers): Use those to segregate and sort registers
3345 * readelf.c (ITEM_WRAP_COLUMN): New macro.
3346 (print_core_item): New function.
3347 (handle_core_item): Use it instead of printf_with_wrap.
3348 (compare_core_items, compare_core_item_groups): New functions.
3349 (handle_core_items): Use them. Sort by group and force line breaks
3352 * readelf.c (handle_core_registers, handle_core_items): New functions,
3354 (handle_core_note): ... here. Call them.
3356 2007-08-22 Roland McGrath <roland@redhat.com>
3358 * unstrip.c (new_shstrtab): New function, broken out of ...
3359 (copy_elided_sections): ... here.
3361 2007-08-20 Roland McGrath <roland@redhat.com>
3363 Avoid local function trampolines in nm binary.
3364 * nm.c (sort_by_address): Move to a static function instead of local
3365 inside show_symbols.
3366 (sort_by_name_strtab): New static variable.
3367 (sort_by_name): Use it. Move to a static function instead of local
3368 inside show_symbols.
3369 (show_symbols): Set sort_by_name_strtab.
3371 2007-08-19 Roland McGrath <roland@redhat.com>
3373 * readelf.c (handle_auxv_note): New function.
3374 (handle_notes): Call it.
3376 * readelf.c (printf_with_wrap, convert): New functions.
3377 (handle_core_item, (handle_core_register): New functions.
3378 (handle_notes): Call those with details from ebl_core_note.
3380 2007-08-12 Roland McGrath <roland@redhat.com>
3382 * elflint.c (check_note): Accept type 0 with name "Linux".
3384 * elflint.c (special_sections): Accept SHF_ALLOC for ".note".
3386 * elflint.c (section_flags_string): Return "none" for 0, not "".
3388 2007-08-11 Roland McGrath <roland@redhat.com>
3390 * elflint.c (check_note): Accept NT_GNU_HWCAP, NT_GNU_BUILD_ID.
3392 2007-08-04 Ulrich Drepper <drepper@redhat.com>
3394 * readelf.c (hex_dump): Use isprint to determine whether to print
3395 character itself or full stop character.
3396 (dump_data): No need to check endp for NULL after strtol call.
3398 2007-08-03 Roland McGrath <roland@redhat.com>
3400 * readelf.c (print_string_sections): New variable.
3401 (options, parse_opt): Handle --strings/-p to set it.
3402 (print_strings): New function.
3403 (process_elf_file): Call it under -p.
3405 * readelf.c (options): Add hidden aliases --segments, --sections,
3406 as taken by binutils readelf.
3408 2007-08-01 Roland McGrath <roland@redhat.com>
3410 * readelf.c (dump_data_sections, dump_data_sections_tail):
3412 (options, parse_opt): Handle --hex-dump/-x, set them.
3413 (hex_dump): New function.
3414 (dump_data): New function, call it.
3415 (process_elf_file): Call it.
3417 2007-07-25 Roland McGrath <roland@redhat.com>
3419 * addr2line.c (show_symbols): New variable.
3420 (print_addrsym): New function.
3421 (handle_address): Call it.
3422 (options, parse_opt): Handle -S/--symbols.
3424 2007-06-05 Ulrich Drepper <drepper@redhat.com>
3426 * addr2line.c: Update for latest autoconf header.
3428 * elfcmp.c: Likewise.
3429 * elflint.c: Likewise.
3430 * findtextrel.c: Likewise.
3432 * ldgeneric.c: Likewise.
3434 * objdump.c: Likewise.
3435 * ranlib.c: Likewise.
3436 * readelf.c: Likewise.
3438 * strings.c: Likewise.
3439 * strip.c: Likewise.
3440 * unstrip.c: Likewise.
3442 2007-05-18 Roland McGrath <roland@redhat.com>
3444 * unstrip.c (copy_elided_sections): Match up non-NOBITS sections with
3445 stripped file, so as not to duplicate a section copied in both.
3447 * strip.c (handle_elf): Keep SHT_NOTE section copies in the debug file.
3449 2007-05-17 Roland McGrath <roland@redhat.com>
3451 * unstrip.c (copy_elided_sections): Don't call gelf_newphdr for 0.
3453 * unstrip.c (handle_file): Tweak BIAS != 0 warning.
3455 * unstrip.c (handle_file): Take new arg CREATE_DIRS. If set,
3456 call make_directories here.
3457 (handle_explicit_files): Take new arg CREATE_DIRS, pass it down.
3458 (handle_dwfl_module): Likewise.
3459 (handle_implicit_modules): Update callers.
3460 (handle_output_dir_module): Likewise. Don't do make_directories here.
3462 * unstrip.c (get_section_name): New function, broken out of ...
3463 (copy_elided_sections): here. Update callers.
3464 (find_alloc_section): Broken out of ...
3465 (copy_elided_sections): ... here. Update caller.
3466 (symtab_count_leading_section_symbols): Take new arg NEWSYMDATA,
3467 update STT_SECTION symbols' st_value fields as a side effect.
3468 (check_symtab_section_symbols): Update caller.
3469 (add_new_section_symbols): Set st_value in symbols added.
3470 (collect_symbols): Reset S->value for STT_SECTION symbols recorded.
3471 Take new arg SPLIT_BSS. Adjust S->shndx recorded for symbols moved
3472 from .bss to .dynbss.
3473 (find_alloc_sections_prelink): New function. Associate debug file
3474 allocated SHT_NOBITS shdrs with stripped moved by prelink via
3475 .gnu.prelink_undo information.
3476 (copy_elided_sections): Call it when we couldn't find every allocated
3477 section. Don't use a debug file non-NOBITS section if SHF_ALLOC.
3478 Take STRIPPED_EHDR arg instead of E_TYPE and PHNUM.
3479 (handle_file): Update callers.
3481 * unstrip.c (copy_elided_sections): Ignore unfound unallocated section
3484 * elflint.c (check_sections): Fix association of segments with
3485 sections when p_memsz > p_filesz.
3487 2007-04-29 Roland McGrath <roland@redhat.com>
3489 * addr2line.c (options, main): Tweak argp group settings to fix
3492 2007-04-28 Roland McGrath <roland@redhat.com>
3494 * strip.c (handle_elf): Update debug file's SHT_NOBITS sections'
3495 sizes to match sections adjusted in the stripped file.
3497 2007-04-24 Roland McGrath <roland@redhat.com>
3499 * elfcmp.c (OPT_HASH_INEXACT): New macro.
3500 (hash_inexact): New variable.
3501 (options, parse_opt): Add --hash-inexact option to set it.
3502 (hash_content_equivalent): New function.
3503 (main): Call it for differing SHT_HASH sections under --hash-inexact.
3505 2007-04-23 Roland McGrath <roland@redhat.com>
3507 * unstrip.c: New file.
3508 * Makefile.am (bin_PROGRAMS): Add it.
3509 (unstrip_LDADD): New variable.
3511 * strip.c (options): Allow --output for -o.
3513 2007-02-15 Ulrich Drepper <drepper@redhat.com>
3515 * readelf.c: Remove unused code. Add a few consts.
3517 2007-02-15 Roland McGrath <roland@redhat.com>
3519 * readelf.c (print_debug): Fix brainos in SHDR test.
3521 2007-02-05 Roland McGrath <roland@redhat.com>
3523 * ar.c: Include <limits.h>, since we use LONG_MAX.
3525 2007-02-05 Ulrich Drepper <drepper@redhat.com>
3527 * ar.c: Add ugly hack to work around gcc complaining that we
3528 ignore fchown's return value.
3529 (do_oper_insert): Handle error when writing padding.
3530 * ranlib.c: Add fchown complain work around.
3532 * arlib.c: Make symtab a global variable. Change all users.
3533 * arlib2.c: Likewise.
3534 * ranlib.c: Likewise.
3536 * arlib.h: Declare it.
3538 2007-01-11 Roland McGrath <roland@redhat.com>
3540 * elflint.c (check_sections): Use ebl_machine_section_flag_check on
3541 SHF_MASKPROC bits separately from generic sh_flags validation.
3543 2007-02-04 Ulrich Drepper <drepper@redhat.com>
3546 * arlib.c: New file.
3547 * arlib2.c: New file.
3548 * arlib.h: New file.
3549 * Makefile (noinst_LIBRARIES): Add libar.
3550 (libar_a_SOURCES): Define.
3552 (CFLAGS_ar): Define.
3553 * ranlib.c: Change to use arlib.
3555 * elflint.c (check_symtab): Work around GNU ld bug which omits
3556 sections but not symbols in those sections.
3558 2007-01-10 Ulrich Drepper <drepper@redhat.com>
3560 * addr2line.c: Update copyright year.
3561 * elfcmp.c: Likewise.
3562 * elflint.c: Likewise.
3563 * findtextrel.c: Likewise.
3566 * objdump.c: Likewise.
3567 * ranlib.c: Likewise.
3568 * readelf.c: Likewise.
3570 * strings.c: Likewise.
3571 * strip.c: Likewise.
3573 2006-12-09 Ulrich Drepper <drepper@redhat.com>
3575 * elflint.c (compare_hash_gnu_hash): New function. Report if the
3576 two hash tables have different content (module expected omission
3577 of undefined symbols).
3579 2006-10-31 Roland McGrath <roland@redhat.com>
3581 * elflint.c (check_program_header): Don't complain about
3582 p_filesz > p_memsz if p_memsz is zero and p_type is PT_NOTE.
3584 2006-09-19 Jakub Jelinek <jakub@redhat.com>
3586 * strip.c (process_file): Disallow -f on archives.
3588 2006-10-09 Roland McGrath <roland@redhat.com>
3590 * Makefile.am (libld_elf_i386.so): Use $(LINK), not $(CC).
3592 2006-08-29 Roland McGrath <roland@redhat.com>
3594 * Makefile.am (MAINTAINERCLEANFILES): New variable.
3596 * readelf.c (handle_relocs_rel): Typo fix, test DESTSHDR properly.
3597 Reported by Christian Aichinger <Greek0@gmx.net>.
3599 * elflint.c (valid_e_machine): Add EM_ALPHA.
3600 Reported by Christian Aichinger <Greek0@gmx.net>.
3602 2006-08-08 Ulrich Drepper <drepper@redhat.com>
3604 * elflint.c (check_dynamic): Don't require DT_HASH for DT_SYMTAB.
3605 Keep track of which "high DT" entries are present.
3606 Check that either old or GNU-style hash table is present.
3607 If GNU-style hash table is used a symbol table is mandatory.
3608 Check that if any prelink entry is present all of them are.
3609 (check_gnu_hash): Only fail for undefined symbols in GNU-style hash
3610 table if they don't refer to functions.
3612 2006-07-17 Roland McGrath <roland@redhat.com>
3614 * elflint.c (struct version_namelist): Use GElf_Versym for `ndx' field.
3615 (add_version): Likewise for argument.
3616 (check_versym): Cast constant to GElf_Versym for comparison.
3618 2006-07-12 Roland McGrath <roland@redhat.com>
3620 * readelf.c (handle_gnu_hash): Add casts for machines where
3621 Elf32_Word != unsigned int.
3623 2006-07-12 Ulrich Drepper <drepper@redhat.com>
3625 * elflint.c (check_sysv_hash64): Fix printf format.
3627 2006-07-11 Roland McGrath <roland@redhat.com>
3629 * addr2line.c (options): English fix in -f doc string.
3631 * addr2line.c (use_comp_dir): New variable.
3632 (options, parse_opt): Grok -A/--absolute to set it.
3633 (handle_address): If set, prepend dwfl_line_comp_dir results to
3634 relative file names.
3636 2006-07-06 Ulrich Drepper <drepper@redhat.com>
3638 * elflint.c: Adjust for latest new hash table format.
3639 * readelf.c: Likewise.
3641 * elflint.c (check_versym): Ignore hidden bit when comparing version
3644 2006-07-05 Ulrich Drepper <drepper@redhat.com>
3646 * ldgeneric.c (ld_generic_create_outfile): Correctly recognize
3647 discarded COMDAT symbols.
3649 * i386_ld.c (elf_i386_count_relocations): Lot of corrections.
3650 (elf_i386_create_relocations): Likewise.
3651 * ld.h (struct symbol): Add local and hidden bits.
3652 * ld.c (create_special_section_symbol): These synthsized symbols
3653 are local and hidden.
3654 * ldgeneric.c (file_process2): Check whether input file matches
3656 (fillin_special_symbol): Create symbols as local and/or hidden
3658 (ld_generic_create_outfile): Make local copy of symbol.
3659 Don't hide global, defined symbols in dynamic symbol table unless
3660 requested. Synthetic symbols have no version information.
3662 * elflint.c: Add support for checking 64-bit SysV-style hash tables.
3663 * readelf.c: Add support for printing 64-bit SysV-style hash tables.
3665 2006-07-04 Ulrich Drepper <drepper@redhat.com>
3667 * elflint.c (is_rel_dyn): Fix and extend DT_RELCOUNT/DT_RELACOUNT
3670 2006-07-03 Ulrich Drepper <drepper@redhat.com>
3672 * elflint.c: Add testing of DT_GNU_HASH.
3673 * readelf.c: Implement showing histogram for DT_GNU_HASH section.
3675 * Makefile.am: Add hacks to create dependency files for non-generic
3678 2006-06-12 Ulrich Drepper <drepper@redhat.com>
3680 * ldgeneric.c (ld_generic_generate_sections): Don't create .interp
3681 section if creating a DSO and no interpreter is given.
3682 (ld_generic_create_outfile): Don't store reference to symbols in
3683 discarded COMDAT groups. Don't create PHDR and INTERP program header
3684 for DSO if no interpreter is specified.
3685 (create_verneed_data): Pretty printing.
3687 * ldscript.y (content): If a DSO is created don't set default
3688 interpreter from linker script.
3690 * i386_ld.c (elf_i386_count_relocations): Do not add relocations
3691 for symbols in discarded COMDAT groups.
3692 (elf_i386_create_relocations): Likewise.
3693 * ld.h (struct scninfo): Add unused_comdat.
3694 * ldgeneric.c (add_section): Also check group signature when
3695 matching COMDAT sections.
3696 (add_relocatable_file): Ignore symbols in COMDAT group which are
3699 * elflint.c (check_one_reloc): For *_NONE relocs only check type
3700 and symbol reference.
3702 2006-06-11 Ulrich Drepper <drepper@redhat.com>
3704 * elflint.c (check_dynamic): Fix checking value of tags which are
3705 offsets in the string section. Make sure DT_STRTAB points to the
3706 section referenced in sh_link.
3708 * ld.c (options): Add headers. Add short option 'R' for '--rpath'.
3710 * ld.c: Recognize --eh-frame-hdr option.
3711 * ld.h (struct ld_state): Add eh_frame_hdr field.
3712 * ldgeneric.c (struct unw_eh_frame_hdr): Define.
3714 * ldgeneric.c (add_section): Use ebl_sh_flags_combine instead of
3716 (add_relocatable_file): Minor optimization of last change.
3717 (match_section): Don't preserve SHF_GROUP flag any longer.
3719 2006-06-10 Ulrich Drepper <drepper@redhat.com>
3721 * ld.c (parse_z_option): Recognize execstack and noexecstack.
3722 Handle record and ignore as position dependent options.
3723 (parse_z_option_2): Handle ignore and record here.
3724 * ld.h (struct ld_state): Add execstack field.
3725 * ldgeneric.c (add_relocatable_file): Recognize .note.GNU-stack
3727 (ld_generic_create_outfile): Fix program header creation in native
3728 linker. Add PT_GNU_STACK program header.
3730 2006-06-09 Ulrich Drepper <drepper@redhat.com>
3732 * i386_ld.c (elf_i386_finalize_plt): Don't change symbol table entries
3733 for PLT entries if there is no local definition.
3735 * ld.c (parse_option): Handle -z ignore like --as-needed and
3736 -z record like --no-as-needed.
3737 * ld.h (struct ld_state): Remove ignore_unused_dsos field.
3738 * ldgeneric.c (new_generated_scn): Always compute ndt_needed by
3739 looping over DSOs. When deciding about adding DT_NEEDED entries
3740 use ->as_needed instead of ignore_unused_dsos.
3742 2006-05-31 Ulrich Drepper <drepper@redhat.com>
3744 * ld.c: Recognize --as-needed and --no-as-needed options.
3745 * ld.h (struct usedfile): Add as_needed field.
3746 (struct ld_state): Likewise.
3747 * ldgeneric.c (ld_handle_filename_list): Copy as_needed flag from
3749 * ldscript.y (filename_id_list): Split to correctly parse all
3751 (mark_as_needed): Fix loop.
3753 2006-05-28 Ulrich Drepper <drepper@redhat.com>
3755 * addr2line.c (print_dwarf_function): Use unsigned type for lineno
3758 2006-05-27 Ulrich Drepper <drepper@redhat.com>
3760 * readelf.c (handle_relocs_rela): Better notations for addon value.
3761 (print_ehdr): Distinguish e_ident[EI_VERSION] from e_version.
3763 2006-04-04 Ulrich Drepper <drepper@redhat.com>
3765 * addr2line.c: Update copyright year.
3766 * elfcmp.c: Likewise.
3767 * elflint.c: Likewise.
3768 * findtextrel.c: Likewise.
3771 * objdump.c: Likewise.
3772 * ranlib.c: Likewise.
3773 * readelf.c: Likewise.
3775 * strings.c: Likewise.
3776 * strip.c: Likewise.
3778 2006-03-09 Roland McGrath <roland@redhat.com>
3780 * Makefile.am (AM_LDFLAGS): New variable.
3782 2006-03-01 Roland McGrath <roland@redhat.com>
3784 * readelf.c (dwarf_tag_string, dwarf_attr_string): Update name tables
3785 for dwarf.h changes matching 3.0 spec.
3786 (dwarf_encoding_string, dwarf_lang_string, print_ops): Likewise.
3788 2005-12-04 Ulrich Drepper <drepper@redhat.com>
3790 * elflint.c (check_one_reloc): If relocation section is not loaded,
3791 don't check whether the relocations modify read-only sections or
3792 loaded and unloaded sections.
3794 2005-11-28 Ulrich Drepper <drepper@redhat.com>
3796 * elflint.c (check_one_reloc): Take additional parameters. Use
3797 them to determine whether relocation is valid in this type of
3798 file. DSOs and executables can contain relocation sections in
3799 unloaded sections which just show the relocations the linker
3800 applied. Adjust all callers.
3801 (check_program_header): Check that PT_PHDR is loaded and that offset
3802 matches the one in the ELF header.
3804 2005-10-26 Roland McGrath <roland@redhat.com>
3806 * nm.c (get_var_range): dwarf_getloclist -> dwarf_getlocation.
3808 2005-09-03 Ulrich Drepper <drepper@redhat.com>
3810 * strip.c (handle_elf): Unify some error messages.
3811 * ld.c (main): Likewise.
3812 * ldgeneric.c (open_elf): Likewise.
3813 * elfcmp.c (main): Likewise.
3814 * elflint.c (check_elf_header): Likewise.
3816 * size.c (process_file): Fix typo in error message.
3818 * readelf.c: Lots of little cleanups. Use _unlocked functions.
3820 2005-09-02 Ulrich Drepper <drepper@redhat.com>
3822 * strings.c (main): Reset elfmap variable after munmap call.
3823 [_MUDFLAP] (map_file): Simplify mudflap debugging by not using mmap.
3825 2005-08-28 Ulrich Drepper <drepper@redhat.com>
3827 * ranlib.c: Don't define pread_retry and write_retry here.
3829 * Makefile.an [BUILD_STATIC] (libdw): Add -ldl.
3830 (CLEANFILES): Add *.gcno *.gcda *.gconv.
3832 * strings.c (process_chunk): Reorder expressions in conditional
3833 (process_chunk_mb): Likewise.
3835 * strings.c: New file.
3836 * Makefile.am (bin_PROGRAMS): Add strings.
3837 (strings_no_Wstring): Define.
3838 (strings_LDADD): Define.
3840 2005-08-27 Roland McGrath <roland@redhat.com>
3842 * addr2line.c (dwarf_diename_integrate): Function removed.
3843 (print_dwarf_function): Use plain dwarf_diename.
3845 2005-08-24 Ulrich Drepper <drepper@redhat.com>
3847 * elflint.c (check_versym): Versioned symbols should not have
3850 2005-08-15 Ulrich Drepper <drepper@redhat.com>
3852 * elflint.c (check_versym): Allow VER_NDX_LOCAL symbols to be
3855 * Makefile.am: Add rules to build ranlib.
3856 * ranlib.c: New file.
3858 2005-08-14 Roland McGrath <roland@redhat.com>
3860 * elflint.c (check_sections): Use ebl_section_type_name and allow any
3861 sh_type it recognizes.
3863 * elflint.c (check_sections): Print unknown flags in hex, don't
3864 truncate high bits. Print section number and name for unknown type.
3866 2005-08-13 Roland McGrath <roland@redhat.com>
3868 * elflint.c (check_program_header): Use ebl_segment_type_name and
3869 allow any p_type it recognizes. Include p_type value in error
3870 message for unknown type.
3872 2005-08-13 Ulrich Drepper <drepper@redhat.com>
3874 * elflint.c (check_symtab): Simplify last change a bit. Pass ehdr
3875 to ebl_check_special_symbol.
3876 (check_sections): Pass ehdr to ebl_bss_plt_p.
3878 2005-08-12 Roland McGrath <roland@redhat.com>
3880 * elflint.c (check_symtab): Check that _GLOBAL_OFFSET_TABLE_ st_shndx
3881 refers to the right section if it's not SHN_ABS.
3882 Let ebl_check_special_symbol override _G_O_T_ value and size checks.
3884 * elflint.c (check_sections): Don't complain about a non-NOBITS
3885 section taking no segment space, if it's sh_size is 0.
3887 * elflint.c (check_sections): Use ebl_bss_plt_p to see if .plt should
3888 be PROGBITS or NOBITS.
3890 * elflint.c (check_symtab): Use ebl_check_special_symbol to override
3891 standard st_value and st_size checks.
3893 2005-07-28 Roland McGrath <roland@redhat.com>
3895 * addr2line.c (options, parse_opt): Don't handle -e here.
3896 (executable): Variable removed.
3897 (argp_children): New static variable.
3898 (argp): Use it. Make const.
3899 (main): Fill in argp_children from dwfl_standard_argp ().
3900 Let libdwfl handle file selection, pass Dwfl handle to handle_address.
3901 (print_dwarf_function): New function. Try to figure out inline chain.
3902 (elf_getname): Function removed, libdwfl does it for us.
3903 (handle_address): Take Dwfl handle instead of Elf, Dwarf handles.
3904 Use dwfl_module_addrname instead of elf_getname.
3905 Use dwfl_module_getsrc and dwfl_lineinfo instead of libdw calls.
3906 * Makefile.am (INCLUDES): Add libdwfl directory to path.
3908 2005-08-10 Ulrich Drepper <drepper@redhat.com>
3910 * strip.c (parse_opt): STATE parameter is now used.
3911 Various little cleanups.
3913 * readelf.c (print_debug_line_section): Correct fallout of renaming
3914 of DW_LNS_set_epilog_begin.
3916 2005-08-08 Roland McGrath <roland@redhat.com>
3918 * strip.c (options, parse_opt): Grok -R .comment for compatibility
3919 with binutils strip. Likewise -d, -S, as aliases for -g.
3920 Likewise ignore -s/--strip-all.
3922 2005-08-07 Roland McGrath <roland@redhat.com>
3924 * strip.c (process_file): Open read-only when using a different output
3927 2005-08-06 Ulrich Drepper <drepper@redhat.com>
3929 * elflint.c (in_nobits_scn): New function.
3930 (check_versym): Allow references for defined symbols against versions
3931 of other DSOs also for symbols in nobits sections.
3932 Move a few variables around.
3934 * Makefile.am (AM_CFLAGS): Avoid duplication.
3935 Link with statis libs if BUILD_STATIC.
3937 2005-08-05 Ulrich Drepper <drepper@redhat.com>
3939 * elflint.c: Many, many more tests. Mostly related to symbol
3940 versioning. Those sections should now be completely checked.
3942 * readelf.c (print_dynamic): Use gelf_offscn.
3944 2005-08-04 Ulrich Drepper <drepper@redhat.com>
3946 * elflint.c: Add lots more tests: more extension symbol table sanity,
3947 versioning section tests, hash table tests. General cleanup.
3949 2005-08-02 Ulrich Drepper <drepper@redhat.com>
3951 * objdump.c: New file.
3952 * Makefile.am (bin_PROGRAMS): Add objdump.
3953 (objdump_LDADD): Define.
3955 * elflint.c (check_reloc_shdr): New function split out from check_rela
3957 (check_one_reloc): New function. Likewise.
3958 (check_rela): Use check_reloc_shdr and check_one_reloc.
3959 (check_rel): Likewise.
3960 (check_program_header): Check that PT_DYNAMIC entry matches .dynamic
3962 Add checks that relocations against read-only segments are flagged,
3963 that the text relocation flag is not set unnecessarily, and that
3964 relocations in one section are either against loaded or not-loaded
3967 2005-08-01 Ulrich Drepper <drepper@redhat.com>
3969 * elfcmp.c (main): Ignore section count and section name string table
3972 2005-07-27 Roland McGrath <roland@redhat.com>
3974 * elfcmp.c: Include <locale.h>.
3976 2005-07-27 Ulrich Drepper <drepper@redhat.com>
3978 * elfcmp.c: Print name and index of differing section.
3980 2005-07-24 Ulrich Drepper <drepper@redhat.com>
3982 * elfcmp.c: Implement comparing gaps between sections.
3984 2005-07-23 Ulrich Drepper <drepper@redhat.com>
3986 * elflint.c: Include libeblP.h instead of libebl.h.
3988 * readelf.c: Likewise.
3989 * elfcmp.c: Likewise.
3991 * elfcmp.c (main): Compare individual ELF header fields, excluding
3992 e_shoff instead of the whole struct at once.
3993 Use ebl_section_strip_p instead of SECTION_STRIP_P.
3994 * strip.c: Use ebl_section_strip_p instead of SECTION_STRIP_P.
3996 2005-07-22 Ulrich Drepper <drepper@redhat.com>
3998 * elfcmp.c (main): Take empty section into account when comparing
4001 * elflint.c (check_dynamic): Check that d_tag value is >= 0 before
4004 2005-07-21 Ulrich Drepper <drepper@redhat.com>
4006 * elfcmp.c: New file.
4007 * Makefile.am (bin_PROGRAMS): Add elfcmp.
4008 (elfcmp_LDADD): Define.
4010 * elflint.c (check_rela): Check that copy relocations only reference
4011 object symbols or symbols with unknown type.
4012 (check_rel): Likewise.
4014 2005-06-08 Roland McGrath <roland@redhat.com>
4016 * readelf.c (print_ops): Add consts.
4018 2005-05-31 Roland McGrath <roland@redhat.com>
4020 * readelf.c (print_debug_abbrev_section): Don't bail after first CU's
4021 abbreviations. Print a header line before each CU section.
4023 * readelf.c (print_debug_loc_section): Fix indentation for larger
4026 2005-05-30 Roland McGrath <roland@redhat.com>
4028 * readelf.c (print_debug_line_section): Print section offset of each
4029 CU's table, so they are easy to find from seeing the stmt_list value.
4031 * readelf.c (dwarf_attr_string): Add all attributes in <dwarf.h>.
4032 (attr_callback): Grok DW_AT_ranges and print offset in hex.
4034 * readelf.c (attr_callback): Add 2 to addrsize * 2 for %#0* format.
4035 (print_debug_ranges_section, print_debug_loc_section): Likewise.
4037 * readelf.c (print_ops): Take different args for indentation control.
4038 (attr_callback): Caller updated.
4039 Grok several more block-form attributes as being location expressions.
4040 For those same attributes with udata forms, format output differently
4041 for location list offset.
4042 (print_debug_loc_section): Implement it for real.
4044 * readelf.c (options): Mention ranges for --debug-dump.
4045 (enum section_e): Add section_ranges.
4046 (parse_opt): Grok "ranges" for -w/--debug-dump.
4047 (print_debug_ranges_section): New function.
4048 (print_debug): Handle .debug_ranges section.
4050 2005-05-30 Ulrich Drepper <drepper@redhat.com>
4052 * readelf.c (handle_notes): At least x86-64 need not have the note
4053 section values aligned to 8 bytes.
4055 2005-05-18 Ulrich Drepper <drepper@redhat.com>
4057 * readelf.c (dwarf_tag_string): Add new tags.
4059 2005-05-08 Roland McGrath <roland@redhat.com>
4061 * strip.c (handle_elf): Don't translate hash and versym data formats,
4062 elf_getdata already did it for us.
4064 2005-05-07 Ulrich Drepper <drepper@redhat.com>
4066 * Makefile.am (findtextrel_LDADD): Add $(libmudflap).
4067 (addr2line_LDADD): Likewise.
4069 2005-05-03 Roland McGrath <roland@redhat.com>
4071 * strip.c (handle_elf): Apply symbol table fixups to discarded
4072 relocation sections when they are being saved in the debug file.
4074 * strip.c (handle_elf): Pass EHDR->e_ident[EI_DATA] to gelf_xlatetom
4075 and gelf_xlatetof, not the native byte order.
4077 * strip.c (parse_opt): Give error if -f or -o is repeated.
4078 (main): Exit if argp_parse returns nonzero.
4080 * strip.c (debug_fname_embed): New variable.
4081 (options, parse_opt): New option -F to set it.
4083 2005-05-07 Ulrich Drepper <drepper@redhat.com>
4085 * readelf.c (parse_opt): Make any_control_option variable
4086 local. Simplify some tests.
4088 2005-05-03 Roland McGrath <roland@redhat.com>
4090 * strip.c (crc32_file): Function removed (now in ../lib).
4092 2005-05-03 Roland McGrath <roland@redhat.com>
4094 * elflint.c (is_debuginfo): New variable.
4095 (options, parse_opt): New option --debuginfo/-d to set it.
4096 (check_sections): If is_debuginfo, don't complain about SHT_NOBITS.
4097 (check_note): If is_debuginfo, don't try to get note contents.
4099 2005-04-24 Ulrich Drepper <drepper@redhat.com>
4101 * readelf.c (print_debug_abbrev_section): Don't print error when end of
4104 2005-04-14 Ulrich Drepper <drepper@redhat.com>
4106 * readelf.c (dwarf_encoding_string): New function.
4107 (dwarf_inline_string): New function.
4108 (dwarf_access_string): New function.
4109 (dwarf_visibility_string): New function.
4110 (dwarf_virtuality_string): New function.
4111 (dwarf_identifier_case_string): New function.
4112 (dwarf_calling_convention_string): New function.
4113 (dwarf_ordering_string): New function.
4114 (dwarf_discr_list_string): New function.
4115 (attr_callback): Decode man more attribute values.
4117 2005-04-01 Ulrich Drepper <drepper@redhat.com>
4119 * addr2line.c: Finish implementation of -f option.
4121 2005-03-29 Ulrich Drepper <drepper@redhat.com>
4123 * addr2line.c: New file.
4124 * Makefile.am (bin_PROGRAMS): Add addr2line.
4125 Define addr2line_LDADD.
4127 * findtextrel.c: Use new dwarf_addrdie function.
4129 * findtextrel.c: Fix usage message and re-add accidentally removed
4132 2005-03-28 Ulrich Drepper <drepper@redhat.com>
4134 * findtextrel.c: New file.
4135 * Makefile: Add rules to build findtextrel.
4137 2005-02-15 Ulrich Drepper <drepper@redhat.com>
4139 * ldlex.l: Provide ECHO definition to avoid warning.
4141 * elflint.c (check_program_header): Fix typo in RELRO test.
4143 * Makefile.am (AM_CFLAGS): Add more warning options.
4144 * elflint.c: Fix warnings introduced by the new warning options.
4145 * i386_ld.c: Likewise.
4148 * ldgeneric.c: Likewise.
4150 * readelf.c: Likewise.
4151 * sectionhash.c: Likewise.
4153 * string.c: Likewise.
4155 2005-02-05 Ulrich Drepper <drepper@redhat.com>
4157 * Makefile.am: Check for text relocations in constructed DSOs.
4159 * Makefile.am [MUDFLAP] (AM_CFLAGS): Add -fmudflap. Link all apps
4162 * ldscript.y: Add as_needed handling.
4163 * ldlex.l: Recognize AS_NEEDED token.
4164 * ld.h (struct filename_list): Add as_needed flag.
4166 2005-02-04 Ulrich Drepper <drepper@redhat.com>
4168 * elflint.c (check_symtab): Correctly determine size of GOT section.
4170 2005-01-19 Ulrich Drepper <drepper@redhat.com>
4172 * ld.c: Remove unnecessary more_help function. Print bug report
4174 * strip.c: Likewise.
4177 * readelf.c: Likewise.
4178 * elflint.c: Likewise.
4180 * elflint.c (main): Don't check for parameter problems here.
4181 (parse_opt): Do it here, where we get informed about some of them
4184 * readelf.c (main): Don't check for parameter problems here.
4185 (parse_opt): Do it here, where we get informed about some of them
4188 2005-01-11 Ulrich Drepper <drepper@redhat.com>
4190 * strip.c: Update copyright year.
4191 * readelf.c: Likewise.
4195 * elflint.c: Likewise.
4197 * elflint.c (check_symtab): Don't warn about wrong size for
4198 _DYNAMIC and __GLOBAL_OFFSET_TABLE__ for --gnu-ld.
4200 2004-10-05 Ulrich Drepper <drepper@redhat.com>
4202 * readelf.c (print_phdr): In section mapping, also indicate
4203 sections in read-only segments.
4205 2004-09-25 Ulrich Drepper <drepper@redhat.com>
4207 * readelf.c: Make compile with gcc 4.0.
4208 * strip.c: Likewise.
4210 2004-08-16 Ulrich Drepper <drepper@redhat.com>
4212 * strip.c (handle_elf): Rewrite dynamic memory handling to use of
4213 allocate to work around gcc 3.4 bug.
4215 2004-01-25 Ulrich Drepper <drepper@redhat.com>
4217 * ldlex.l (invalid_char): Better error message.
4219 2004-01-23 Ulrich Drepper <drepper@redhat.com>
4221 * readelf.c: Print SHT_GNU_LIBLIST sections.
4223 * none_ld.c: New file.
4225 2004-01-21 Ulrich Drepper <drepper@redhat.com>
4227 * Makefile.am: Enable building of machine specific linker.
4229 2004-01-20 Ulrich Drepper <drepper@redhat.com>
4231 * Makefile.am: Support building with mudflap.
4233 * i386_ld.c: Fix warnings gcc 3.4 spits out.
4234 * ldgeneric.c: Likewise.
4235 * ldscript.y: Likewise.
4236 * readelf.c: Likewise.
4237 * strip.c: Likewise.
4239 * readelf.c (print_debug_line_section): Determine address size
4242 2004-01-19 Ulrich Drepper <drepper@redhat.com>
4244 * readelf.c (print_phdr): Show which sections are covered by the
4247 * elflint.c (check_program_header): Check PT_GNU_RELRO entry.
4249 * readelf.c (print_debug_macinfo_section): Implement.
4251 2004-01-18 Ulrich Drepper <drepper@redhat.com>
4253 * readelf.c (print_debug_line_section): Implement.
4255 2004-01-17 Ulrich Drepper <drepper@redhat.com>
4257 * src/elflint.c: Use PACKAGE_NAME instead of PACKAGE.
4258 * src/ld.c: Likewise.
4259 * src/nm.c: Likewise.
4260 * src/readelf.c: Likewise.
4261 * src/size.c: Likewise.
4262 * src/strip.c: Likewise.
4264 * strip.c: Add a few more unlikely. Reduce scope of some variables.
4266 * Makefile.am: Support building with mudflap.
4268 2004-01-16 Ulrich Drepper <drepper@redhat.com>
4270 * readelf.c (print_debug_info_section): Free dies memory.
4272 * readelf.c: Print .debug_info section content.
4274 2004-01-13 Ulrich Drepper <drepper@redhat.com>
4276 * readelf.c (print_shdr): Add support for SHF_ORDERED and SHF_EXCLUDE.
4278 2004-01-12 Ulrich Drepper <drepper@redhat.com>
4280 * readelf.c (print_debug_aranges): Implement using libdw.
4282 2004-01-11 Ulrich Drepper <drepper@redhat.com>
4284 * nm.c: Adjust for Dwarf_Files type and dwarf_lineno interface change.
4286 * readelf.c: Use libdw instead of libdwarf. Not all of the old
4287 behavior is available yet.
4288 * Makefile.am: Link readelf with libdw. Remove libdwarf include path.
4290 2004-01-09 Ulrich Drepper <drepper@redhat.com>
4292 * nm.c (get_local_names): Adjust call to dwarf_nextcu.
4294 * nm.c: Implement getting information about local variables.
4296 2004-01-07 Ulrich Drepper <drepper@redhat.com>
4298 * nm.c: Read also debug information for local symbols.
4300 2004-01-05 Ulrich Drepper <drepper@redhat.com>
4302 * nm.c: Shuffle dwarf handling code around so the maximum column
4303 width can be computed ahead of printing. Avoid collection symbols
4304 which are not printed anyway.
4306 * nm.c: Rewrite dwarf handling to use libdw.
4307 * Makefile.am (AM_CFLAGS): Add -std parameter.
4308 (INCLUDES): Find header in libdw subdir.
4309 (nm_LDADD): Replace libdwarf with libdw.
4311 * elflint.c: Update copyright year.
4312 * readelf.c: Likewise.
4314 * strip.c: Likewise.
4317 2003-12-31 Ulrich Drepper <drepper@redhat.com>
4319 * strip.c (process_file): Close file before returning.
4321 2003-11-19 Ulrich Drepper <drepper@redhat.com>
4323 * readelf.c (handle_dynamic): Make column for tag name wider.
4325 2003-09-29 Ulrich Drepper <drepper@redhat.com>
4327 * readelf.c (handle_dynamic): Always terminate tag name with a space.
4329 2003-09-25 Ulrich Drepper <drepper@redhat.com>
4331 * strip.c (process_file): Don't mmap the input file, we modify the
4332 data structures and don't want the change end up on disk.
4334 2003-09-23 Jakub Jelinek <jakub@redhat.com>
4336 * unaligned.h (union u_2ubyte_unaligned,
4337 union u_4ubyte_unaligned, union u_8ubyte_unaligned): Add
4339 (add_2ubyte_unaligned, add_4ubyte_unaligned,
4340 add_8ubyte_unaligned): Avoid nesting bswap_NN macros.
4341 Read/store value through _ptr->u instead of *_ptr.
4343 2003-09-22 Ulrich Drepper <drepper@redhat.com>
4345 * size.c (show_sysv): Change type of maxlen to int.
4347 * strip.c (handle_elf): Handle the 64-bit archs which is 64-bit
4350 * i386_ld.c: Many many fixes and extensions.
4352 * ldgeneric.c: Likewise.
4354 2003-08-16 Ulrich Drepper <drepper@redhat.com>
4356 * ldgeneric.c (check_definition): Don't add symbol on dso_list if
4357 the reference is from another DSO.
4359 2003-08-15 Ulrich Drepper <drepper@redhat.com>
4361 * ldgeneric.c (find_entry_point): It is no fatal error if no entry
4362 point is found when creating a DSO.
4364 2003-08-14 Ulrich Drepper <drepper@redhat.com>
4366 * ld.c (main): Always call FLAG_UNRESOLVED.
4367 * ldgeneric.c (ld_generic_flag_unresolved): Only complain about
4368 undefined symbols if not creating DSO or ld_state.nodefs is not set.
4370 2003-08-13 Ulrich Drepper <drepper@redhat.com>
4372 * Makefile.in: Depend on libebl.a, not libebl.so.
4374 * ld.c (main): Mark stream for linker script as locked by caller.
4375 (read_version_script): Likewise.
4376 * ldlex.c: Define fread and fwrite to _unlocked variant.
4378 * i386_ld.c (elf_i386_finalize_plt): Replace #ifdefs with uses of
4380 * unaligned.h: Define target_bswap_16, target_bswap_32, and
4382 (store_2ubyte_unaligned, store_4ubyte_unaligned,
4383 store_8ubyte_unaligned): Define using new macros.
4385 2003-08-12 Ulrich Drepper <drepper@redhat.com>
4387 * i386_ld.c (elf_i386_finalize_plt): Use packed structs to access
4388 possibly unaligned memory. Support use of big endian machines.
4390 2003-08-11 Ulrich Drepper <drepper@redhat.com>
4392 * Moved to CVS archive.