1 2021-01-08 Timm Bäder <tbaeder@redhat.com>
3 * strip.c (remove_debug_relocations): Rewrite inlined relocate
4 function to file static. Do R_*_NONE, reloc_simple_type and
5 ebl_debug_scn_p checks before calling new relocate function.
6 (relocate): New file static function from
7 remove_debug_relocate. Remove R_*_NONE, reloc_simple_type and
10 2021-01-08 Timm Bäder <tbaeder@redhat.com>
12 * strip.c (handle_elf): Expand inlined function check_preserved.
14 2021-01-12 Mark Wielaard <mark@klomp.org>
16 * elflint.c (EXTRA_SHFLAGS): New define.
17 (check_sections): Use EXTRA_SHFLAGS. Add SHF_GNU_RETAIN to
20 2020-12-31 Sergei Trofimovich <slyfox@gentoo.org>
22 * elflint.c (section_flags_string): Add NEWFLAG for GNU_RETAIN,
25 2020-12-31 Sergei Trofimovich <slyfox@gentoo.org>
27 * elflint.c (section_flags_string): Update cp pointer after
28 snprintf for unknown flags.
30 2020-12-16 Érico Nogueira <ericonr@disroot.org>
32 * readelf.c (qsort_r): Use qsort for improved portability.
34 2020-12-20 Dmitry V. Levin <ldv@altlinux.org>
36 * .gitignore: New file.
38 2020-12-12 Mark Wielaard <mark@klomp.org>
40 * elflint.c (check_sections): Handle SHF_GNU_RETAIN.
41 * readelf.c (print_shdr): Likewise.
43 2020-12-16 Dmitry V. Levin <ldv@altlinux.org>
45 * *.c: Replace gettext(...) with _(...).
47 * unstrip.c (_): Remove.
49 2020-12-15 Mark Wielaard <mark@klomp.org>
51 * elflint.c (check_symtab): Always print symbol name (if known)
54 2020-12-12 Dmitry V. Levin <ldv@altlinux.org>
56 * ar.c (write_member, do_oper_insert): Fix spelling typo in comment.
57 * elfclassify.c (issue, elf_issue, is_unstripped): Likewise.
58 * elfcompress.c (process_file): Likewise.
59 * elflint.c (be_quiet, check_gnu_hash): Likewise.
60 * readelf.c (print_phdr, handle_gnu_hash,
61 dwarf_locexpr_opcode_string): Likewise.
62 * size.c (totals_class): Likewise.
63 * strings.c (read_elf): Likewise.
64 * strip.c (handle_elf): Likewise.
66 * readelf.c (print_debug_addr_section): Fix spelling typo in error
68 * strip.c (options): Fix spelling typos in argp help text.
69 * strings.c (options): Likewise.
70 * stack.c (options): Likewise.
72 2020-11-01 Érico N. Rolim <erico.erc@gmail.com>
74 * unstrip.c (make_directories): Use ACCESSPERMS for mkdir.
75 (handle_file): Use DEFFILEMODE for open with O_CREAT for ET_REL
76 files, ACCESSPERMS otherwise.
78 2020-11-01 Érico N. Rolim <erico.erc@gmail.com>
80 * Makefile.am (nm_LDADD): Add obstack_LIBS.
81 (ranlib_LDADD): Likewise.
84 2020-10-27 Érico N. Rolim <erico.erc@gmail.com>
86 * unstrip.c (make_directories): Use strndup, not strndupa.
88 2020-09-28 Mark Wielaard <mark@klomp.org>
90 * readelf.c (next_listptr_offset): Take idx as pointer, to be updated
91 and use new Dwarf_Off as offset to match.
92 (listptr_attr): New function.
93 (print_debug_loclists_section): Check for DW_AT_GNU_locviews to show
95 (print_debug_loc_section): Adjust next_listptr_offset call.
97 2020-09-03 Mark Wielaard <mark@klomp.org>
99 * readelf.c (print_cfa_program): Take ehdr as argument. Use it to
100 recognize DW_CFA_AARCH64_negate_ra_state.
101 (print_debug_frame_section): Pass ehdr to print_cfa_program.
102 (print_debug): Don't warn if we dump frames, but cannot get dbg.
104 2020-09-01 Mark Wielaard <mark@klomp.org>
106 * readelf.c (print_debug_ranges_section): Base address entry can
108 (print_debug_loc_section): Likewise.
110 2020-09-04 Mark Wielaard <mark@klomp.org>
112 * elflint.c (special_sections): Add .debug_line_str.
114 2020-08-26 Mark Wielaard <mark@klomp.org>
116 * readelf.c (print_debug_line_section): It is not an error if there
117 are no line number statements at the end of a debug line section.
119 2020-07-19 Mark Wielaard <mark@klomp.org>
121 * elfclassify.c (process_current_path): Handle fwrite failing.
123 2020-07-05 Mark Wielaard <mark@klomp.org>
125 * stack.c (module_callback): Don't assert if dwfl_module_info fails.
126 * unstrip.c (adjust_relocs): Produce a proper error when HAS
127 section has inconsistent size or entsize.
128 (match_module): Don't assert if dwfl_module_info fails.
130 2020-06-16 Mark Wielaard <mark@klomp.org>
132 * ar.c (do_oper_extract): Split large if statement. Call fchown
133 before fchmod and explicitly ignore the return value.
134 (do_oper_delete): Likewise.
135 (do_oper_insert): Likewise.
136 * ranlib.c (handle_file): Likewise.
138 2020-06-16 Mark Wielaard <mark@klomp.org>
140 * elflint.c (check_elf_header): Explicitly check and ignore
141 any error from elf_compress.
143 2020-06-07 Mark Wielaard <mark@klomp.org>
145 * nm.c (sort_by_name_strtab): Replace by...
146 (sort_by_name_elf): New static Elf pointer and ...
147 (sort_by_name_ndx): New static size_t index.
148 (sort_by_name): Use elf_strptr to get symbol string.
149 (show_symbols): Set sort_by_name_elf and sort_by_name_ndx.
151 2020-06-06 Mark Wielaard <mark@klomp.org>
153 * nm.c (show_symbols_sysv): Skip no name and STT_FILE symbols.
154 When not printing address and size pad strings. Strip "GNU_"
155 prefix from binding name.
156 (class_type_char): Use 'V' for weak symbols, 'C' for common
157 symbols and 'T' for weak functions.
158 (show_symbols_posix): Skip STT_FILE symbols. Don't print value and
161 2020-06-04 Mark Wielaard <mark@klomp.org>
163 * elflint.c (check_program_header): Remove PT_GNU_PROPERTY define.
165 2020-05-14 Mark Wielaard <mark@klomp.org>
167 * size.c (show_bsd): Set printf format based on radix.
169 2020-05-09 Mark Wielaard <mark@klomp.org>
171 * elflint.c (process_elf_file): Error out if ebl_openbackend fails.
172 * objdump.c (handle_elf): Likewise.
173 * nm.c (handle_elf): Likewise. Move full name string construction
174 forward, so it can be used in the error message.
176 2020-04-17 Mark Wielaard <mark@klomp.org>
178 * readelf.c (print_debug): Check .gnu.debuglto_ prefix.
180 2020-04-16 Mark Wielaard <mark@klomp.org>
182 * elflint.c (check_sections): Mask out SHF_EXCLUDE from processor
183 specific section flags when --gnu is given.
185 2020-02-08 Mark Wielaard <mark@klomp.org>
187 * elflint.c (check_program_header): Handle PT_GNU_PROPERTY.
189 2020-02-07 Mark Wielaard <mark@klomp.org>
191 * elflint.c (check_symtab): Check st_info isn't too big.
193 2020-01-16 Mark Wielaard <mark@klomp.org>
195 * nm.c (show_symbols_sysv): Iterate over all symbols starting
198 2019-11-26 Mark Wielaard <mark@klomp.org>
200 * Makefile.am (BUILD_STATIC): Add libraries needed for libdw.
202 2019-10-26 Mark Wielaard <mark@klomp.org>
204 * unstrip.c (collect_symbols): Check symbol strings are
207 2019-10-18 Mark Wielaard <mark@klomp.org>
209 * unstrip.c (adjust_relocs): Set versym data d_size to the actual
212 2019-10-20 Mark Wielaard <mark@klomp.org>
214 * unstrip.c (copy_elided_sections): Set and check max_off.
216 2019-10-21 Mark Wielaard <mark@klomp.org>
218 * unstrip.c (adjust_relocs): Add map_size argument and check ndx
220 (adjust_all_relocs): Add map_size argument and pass it to
222 (add_new_section_symbols): Call adjust_all_relocs with symndx_map
224 (collect)symbols): Check sym and string data can be found.
225 (compare_symbols_output): Call error when (different) symbols are
227 (new_shstrtab): Make unstripped_strent array one larger. Check
228 stripped_shnum isn't zero.
229 (copy_elided_sections): Add ndx_sec_num as size of ndx_section
230 array. Check sh_link and sh_info are not larger than ndx_sec_num.
231 Allocate symbols and symndx_map arrays on heap, not stack. Pass
232 map sizes to adjust_all_relocs.
234 2019-09-28 Dmitry V. Levin <ldv@altlinux.org>
236 * elflint.c (main): When an input file cannot be opened,
237 include its name into the error diagnostics.
238 * readelf.c (main): Likewise.
240 2019-09-02 Mark Wielaard <mark@klomp.org>
242 * readelf.c (PRINT_DYNSYM_TABLE): New argp key value.
243 (argp_opt): Add syn-sym.
244 (print_dynsym_table): New static bool.
245 (parse_opt): Handle PRINT_DYNSYM_TABLE.
246 (process_elf_file): Check print_dynsym_table.
248 2019-08-27 Mark Wielaard <mark@klomp.org>
250 * readelf.c (for_each_section_argument): Call (*dump) also for
253 2019-08-26 Mark Wielaard <mark@klomp.org>
255 * nm.c (show_symbols): Remember nentries_orig and check before
258 2019-07-05 Omar Sandoval <osandov@fb.com>
260 * Makefile.am: Remove -ldl.
261 (elflint_LDADD): Add $(libdw).
262 (elfcmp_LDADD): Add $(libdw).
263 (objdump_LDADD): Add $(libdw).
265 2019-08-26 Mark Wielaard <mark@klomp.org>
267 * readelf (options): Add OPTION_ARG_OPTIONAL "SECTION" for notes.
268 (notes_section): New global variable.
269 (parse_opt): Set notes_section.
270 (handle_notes): Check if notes_section is set.
272 2019-07-26 Florian Weimer <fweimer@redhat.com>
273 Mark Wielaard <mark@klomp.org>
275 * Makefile.am (bin_PROGRAMS): Add elfclassify.
276 (elfclassify_LDADD): New variable.
277 * elfclassify.c: New tool.
279 2019-07-13 Mao Han <han_mao@c-sky.com>
281 * elflint.c: Add C-SKY.
283 2019-06-28 Mark Wielaard <mark@klomp.org>
285 * readelf.c (print_ehdr): Use dwelf_elf_e_machine_string instead of
286 ebl->name. If unknown print hex value.
288 2019-06-25 Mark Wielaard <mark@klomp.org>
290 * stack.c (parse_opt): Fix dwfl_core_file_attach error message.
292 2019-06-18 Mark Wielaard <mark@klomp.org>
294 * strip.c (handle_elf): Use elf_begin ELF_C_WRITE, instead of
297 2019-05-10 Mark Wielaard <mark@klomp.org>
299 * readelf.c (struct attrcb_args): Rename die to dies.
300 (attr_callback): Get current current die using dies[level].
301 Handle DW_AT_discr_list as block, not as constant.
302 (print_debug_units): pass dies, not dies[level] as args.
304 2019-05-09 Mark Wielaard <mark@klomp.org>
306 * readelf.c (cleanup_list): New function.
307 (main): Call cleanup_list for dump_data_sections and string_sections.
309 2019-04-28 Mark Wielaard <mark@klomp.org>
311 * unstrip.c (add_new_section_symbols): Call ELF_CHECK after
313 (new_shstrtab): Call ELF_CHECK after gelf_getshdr.
315 2019-04-28 Mark Wielaard <mark@klomp.org>
317 * size.c (show_sysv): Call INTERNAL_ERROR if gelf_getshdr
319 (show_sysv_one_line): Call error with EXIT_FAILURE if
320 gelf_getshdr returns NULL.
322 2019-04-28 Mark Wielaard <mark@klomp.org>
324 * nm.c (show_symbols_sysv): Check gelf_getshdr doesn't return
325 NULL. Simplify naming of invalid sections, don't use alloca.
327 2019-04-28 Mark Wielaard <mark@klomp.org>
329 * elfcmp.c (main): Check shdr1 and shdr2 are not NULL.
331 2019-04-03 Mark Wielaard <mark@klomp.org>
333 * readelf.c (attr_callback): Print DW_AT_data_member_location as
334 decimal offset, not hex number.
336 2019-03-29 Mark Wielaard <mark@klomp.org>
338 * readelf.c (print_debug_macinfo_section): Check cus[0] is not the
341 2019-03-27 Mark Wielaard <mark@klomp.org>
343 * strip.c (handle_elf): Assert that symbol section number exists.
345 2019-01-24 Mark Wielaard <mark@klomp.org>
347 * strip.c (handle_elf): Fix check test for SHN_XINDEX symbol.
349 2019-01-22 Mark Wielaard <mark@klomp.org>
351 * readelf.c (print_debug_line_section): Check we are not at end of
352 line data when reading parameters for unknown opcodes.
354 2019-01-20 Mark Wielaard <mark@klomp.org>
356 * readelf.c (print_debug_line_section): Check terminating NUL byte
357 for dir and file tables.
359 2019-01-16 Mark Wielaard <mark@klomp.org>
361 * readelf (handle_core_note): Pass desc to ebl_core_note.
363 2018-11-10 Mark Wielaard <mark@klomp.org>
365 * elflint.c (check_program_header): Allow PT_GNU_EH_FRAME segment
366 to be matched against SHT_X86_64_UNWIND section.
368 2018-11-09 Mark Wielaard <mark@klomp.org>
370 * strip.c (remove_debug_relocations): Check if section is gnu
371 compressed and decompress and recompress it.
373 2018-11-12 Mark Wielaard <mark@klomp.org>
375 * elflint.c (check_note_data): Recognize NT_GNU_BUILD_ATTRIBUTE_OPEN
376 and NT_GNU_BUILD_ATTRIBUTE_OPEN.
377 * readelf.c (handle_notes_data): Handle
378 ELF_NOTE_GNU_BUILD_ATTRIBUTE_PREFIX. Pass nhdr.n_namesz to
381 2018-11-11 Mark Wielaard <mark@klomp.org>
383 * readelf.c (handle_notes_data): Pass n_descsz to
384 ebl_object_note_type_name.
385 * elflint.c (check_note_data): Recognize NT_VERSION, add owner
386 name to unknown note error.
388 2018-10-20 Mark Wielaard <mark@klomp.org>
390 * readelf.c (process_elf_file): Use dwelf_elf_begin to open pure_elf.
392 2018-10-26 Mark Wielaard <mark@klomp.org>
394 * strip.c (OPT_RELOC_DEBUG_ONLY): New define.
395 (options): Add reloc-debug-sections-only.
396 (reloc_debug_only): New static bool.
397 (main): Check reloc_debug_only is the only strip option used.
398 (parse_opt): Handle OPT_RELOC_DEBUG_ONLY.
399 (handle_debug_relocs): New function.
400 (handle_elf): Add local variables lastsec_offset and lastsec_size.
401 Handle reloc_debug_only.
403 2018-10-24 Mark Wielaard <mark@klomp.org>
405 * strip.c (handle_elf): Extract code to update shdrstrndx into...
406 (update_shdrstrndx): ... this new function.
408 2018-10-24 Mark Wielaard <mark@klomp.org>
410 * strip.c (handle_elf): Extract code into separate functions...
411 (secndx_name): ... new function.
412 (get_xndxdata): Likewise.
413 (remove_debug_relocations): Likewise.
415 2018-10-24 Mark Wielaard <mark@klomp.org>
417 * strip.c (handle_elf): Always copy over phdrs if there are any
418 and check phnum instead of e_type to determine whether to move
421 2018-11-02 Mark Wielaard <mark@klomp.org>
423 * unstrip.c (copy_elf): Add ELF_CHECK to make sure gelf_getehdr ()
426 2018-10-18 Mark Wielaard <mark@klomp.org>
428 * elflint.c (check_note_data): Recognize NT_GNU_PROPERTY_TYPE_0.
429 (check_note): Use p_align to pass either ELF_T_NHDR or ELF_T_NHDR8 to
430 elf_getdata_rawchunk.
431 * readelf (handle_notes): Likewise.
433 2018-10-24 Mark Wielaard <mark@klomp.org>
435 * addr2line.c (print_addrsym): Use elf_getshdrstrndx instead of
438 2018-10-24 Mark Wielaard <mark@klomp.org>
440 * readelf.c (section_name): Remove ehdr argument, lookup shstrndx.
441 (print_debug_abbrev_section): Don't pass ehdr.
442 (print_debug_addr_section): Likewise.
443 (print_decoded_aranges_section): Likewise.
444 (print_debug_aranges_section): Likewise.
445 (print_debug_rnglists_section): Likewise.
446 (print_debug_ranges_section): Likewise.
447 (print_debug_units): Likewise.
448 (print_decoded_line_section): Likewise.
449 (print_debug_line_section): Likewise.
450 (print_debug_loclists_section): Likewise.
451 (print_debug_loc_section): Likewise.
452 (print_debug_macinfo_section): Likewise.
453 (print_debug_macro_section): Likewise.
454 (print_debug_pubnames_section): Likewise.
455 (print_debug_str_section): Liekwise.
456 (print_debug_str_offsets_section): Likewise.
457 (print_gdb_index_section): Likewise.
459 2018-10-16 Mark Wielaard <mark@klomp.org>
461 * readelf.c (print_debug_frame_section): Make sure readp is never
464 2018-10-19 Mark Wielaard <mark@klomp.org>
466 * dwfl_module_getdwarf.c (adjust_relocs): Check sh_entsize is not
468 (add_new_section_symbols): Likewise.
469 (copy_elided_sections): Likewise.
471 2018-10-18 Mark Wielaard <mark@klomp.org>
473 * size.c (handle_ar): Only close elf if prefix was NULL.
475 2018-10-18 Mark Wielaard <mark@klomp.org>
477 * arlib.c (arlib_add_symbols): Check that sh_entsize is not zero.
479 2018-10-14 Mark Wielaard <mark@klomp.org>
481 * ar.c (do_oper_extract): Assume epoch if ar_date is bogus.
483 2018-10-14 Mark Wielaard <mark@klomp.org>
485 * findtextrel.c (process_file): Check that sh_entsize is not zero.
487 2018-10-13 Mark Wielaard <mark@klomp.org>
489 * readelf.c (print_debug_macro_section): Use elf_getdata. Print
492 2018-10-19 Mark Wielaard <mark@klomp.org>
494 * unstrip.c (copy_elided_sections): Renumber group section indexes.
496 2018-10-12 Mark Wielaard <mark@klomp.org>
498 * strip.c (handle_elf): Don't remove SHF_GROUP flag from sections.
499 Skip group section flag when renumbering section indexes.
500 * unstrip.c (struct section): Add sig field.
501 (compare_unalloc_sections): Take and use sig1 and sig2 as arguments.
502 (compare_sections): Pass signatures to compare_unalloc_sections.
503 (get_group_sig): New function.
504 (find_alloc_sections_prelink): Set signature.
505 (copy_elided_sections): Likewise and pass them on.
506 (find_unalloc_section): Take and pass signatures.
508 2018-10-02 Andreas Schwab <schwab@suse.de>
510 * strip.c (handle_elf): Handle ADD/SUB relocation.
512 2018-09-13 Mark Wielaard <mark@klomp.org>
514 * readelf.c (print_shdr): Get number of section with elf_getshdrnum.
515 (print_phdr): Likewise.
517 2018-09-13 Mark Wielaard <mark@klomp.org>
519 * strip.c (handle_elf): Check against shstrndx, not e_shstrndx.
520 Explicitly set shdrstrndx for debug file.
521 * unstrip.c (copy_elf): Explicitly copy shstrndx.
522 (find_alloc_sections_prelink): Document shnum usage.
524 2018-09-13 Mark Wielaard <mark@klomp.org>
526 * elflint.c (check_elf_header): Use shnum instead of e_shnum for all
528 (check_symtab): Use shstrndx instead of e_shstrndx to get section
531 2018-09-13 Mark Wielaard <mark@klomp.org>
533 * elfcmp.c (main): Get, check and shdrstrndx for section names.
535 2018-09-12 Mark Wielaard <mark@klomp.org>
537 * elfcmp.c (main): Call ebl_section_strip_p without ehdr.
538 * strip.c (handle_elf): Likewise.
540 2018-09-12 Mark Wielaard <mark@klomp.org>
542 * elflint.c (check_symtab): Call ebl_check_special_symbol without
545 2018-07-30 Mark Wielaard <mark@klomp.org>
547 * strip.c (handle_elf): Track allocated/unallocated sections seen. Set
548 section offset of unallocated sections after handling all allocated
551 2018-08-18 Mark Wielaard <mark@klomp.org>
553 * readelf.c (print_debug_aranges_section): Make sure there is enough
554 data to read the header segment size.
556 2018-08-18 Mark Wielaard <mark@klomp.org>
558 * elflint.c (check_sysv_hash): Calculate needed size using unsigned
559 long long int to prevent overflow.
560 (check_sysv_hash64): Calculate maxwords used separately before
561 comparison to prevent overflow.
563 2018-07-24 Mark Wielaard <mark@klomp.org>
565 * unstrip.c (compare_unalloc_sections): Also compare sh_size.
567 2018-07-21 Mark Wielaard <mark@klomp.org>
569 * unstrip.c (adjust_all_relocs): Skip SHT_GROUP sections.
571 2018-07-21 Mark Wielaard <mark@klomp.org>
573 * elfcompress.c (get_sections): New function.
574 (process_file): Check whether section needs to change. Don't rewrite
575 file if no section data needs changing.
576 (main): Update 'force' help text.
578 2018-07-21 Mark Wielaard <mark@klomp.org>
580 * elfcompress.c (process_file): Swap fchmod and fchown calls.
582 2018-07-04 Mark Wielaard <mark@klomp.org>
584 * readelf.c (print_debug_addr_section): Rename index var to uidx.
585 (attr_callback): Rename index var to word.
586 (print_debug_str_offsets_section): Rename index var to uidx.
588 2018-07-04 Ross Burton <ross.burton@intel.com>
590 * addr2line.c: Remove error.h include.
592 * arlib.c: Likewise and add system.h include.
593 * arlib2.c: Likewise.
594 * elfcmp.c: Likewise.
595 * elfcompress.c: Likewise.
596 * elflint.c: Likewise.
597 * findtextrel.c: Likewise.
599 * objdump.c: Likewise.
600 * ranlib.c: Likewise.
601 * readelf.c: Likewise.
603 * strings.c: Likewise.
605 * unstrip.c: Likewise.
607 2018-06-25 Mark Wielaard <mark@klomp.org>
609 * readelf.c (print_decoded_line_section): Use dwarf_next_lines
610 instead of dwarf_nextcu.
611 (print_debug_line_section): Don't explicitly lookup CU.
613 2018-06-15 Mark Wielaard <mark@klomp.org>
615 * readelf.c (attr_callback): Only print block as expressions if it
616 isn't DW_FORM_data16.
618 2018-06-12 Mark Wielaard <mark@klomp.org>
620 * readelf.c (print_form_data): Check we have 4, not 2, bytes
621 available for DW_FORM_block4.
623 2018-06-12 Mark Wielaard <mark@klomp.org>
625 * readelf.c (print_form_data): Don't increase strreadp after use.
626 Do increase readp for DW_FORM_strx[1234].
628 2018-06-16 Mark Wielaard <mark@klomp.org>
630 * readelf.c (print_debug_loc_section): Make sure next_off doesn't
633 2018-06-13 Mark Wielaard <mark@klomp.org>
635 * readelf.c (die_type_sign_bytes): New function.
636 (attr_callback): Recognized DW_FORM_implicit_cost as signed. Use
637 die_type_sign_bytes to lookup the signedness and size of const
640 2018-06-11 Mark Wielaard <mark@klomp.org>
642 * readelf.c (print_form_data): Don't reuse readp and readendp when
643 reading str_offsets section.
645 2018-06-10 Mark Wielaard <mark@klomp.org>
647 * readelf.c (print_form_data): Don't cast value to ptrdiff_t, cast
650 2018-06-08 Mark Wielaard <mark@klomp.org>
652 * readelf.c (print_debug_rnglists_section): Calculate max_entries
653 instead of needed bytes to prevent overflowing. Always print
654 max_entries (but not more).
655 (print_debug_loclists_section): Likewise.
657 2018-06-08 Mark Wielaard <mark@klomp.org>
659 * readelf.c (print_debug_line_section): Stop printing directories
660 and files when we are at the end of the unit data.
662 2018-06-07 Mark Wielaard <mark@klomp.org>
664 * readelf.c (format_result): Removed.
665 (format_result_size): Removed.
666 (format_dwarf_addr): Renamed to...
667 (print_dwarf_addr): ...this. Simply call printf, don't setup buffer,
669 (print_ops): Use print_dwarf_addr instead of format_dwarf_addr.
670 (print_debug_addr_section): Likewise.
671 (print_debug_aranges_section): Likewise.
672 (print_debug_rnglists_section): Likewise.
673 (print_debug_ranges_section): Likewise.
674 (print_debug_frame_section): Likewise.
675 (attr_callback): Likewise.
676 (print_decoded_line_section): Likewise.
677 (print_debug_line_section): Likewise.
678 (print_debug_loclists_section): Likewise.
679 (print_debug_loc_section): Likewise.
680 (print_gdb_index_section): Likewsie.
682 2018-06-05 Mark Wielaard <mark@klomp.org>
684 * readelf.c (print_debug_addr_section): Set unit_length always to
685 (next_unitp - readp) in case we don't have a real header.
687 2018-06-05 Mark Wielaard <mark@klomp.org>
689 * readelf.c (print_debug_loc_section): Set begin to idx when failing
690 to read the start address if DW_LLE_GNU_start_end_entry.
692 2018-06-05 Mark Wielaard <mark@klomp.org>
694 * readelf.c (handle_sysv_hash): Don't leak lengths array when
695 detecting an invalid chain.
696 (handle_sysv_hash64): Likewise.
698 2018-06-05 Mark Wielaard <mark@klomp.org>
700 * readelf.c (print_debug_macro_section): Extend vendor array by one
701 to include max DW_MACRO_hi_user opcode.
703 2018-06-07 Mark Wielaard <mark@klomp.org>
705 * readelf.c (main): Lookup "no" for no_str.
706 (print_debug_abbrev_section): Use yes_str and no_str.
707 (print_form_data): Likewise.
709 2018-06-04 Mark Wielaard <mark@klomp.org>
711 * readelf (format_result): New static char pointer.
712 (format_result_size): New static size_t.
713 (format_dwarf_addr): Calculate max string size, reuse format_result
714 if possible, otherwise realloc. Use sprintf on result, not asprintf.
715 (print_ops): Don't free format_dwarf_addr, make sure result is
716 printed before calling format_dwarf_addr again.
717 (print_debug_addr_section): Likewise.
718 (print_debug_aranges_section): Likewise.
719 (print_debug_rnglists_section): Likewise.
720 (print_debug_ranges_section): Likewise.
721 (print_debug_frame_section): Likewise.
722 (attr_callback): Likewise.
723 (print_decoded_line_section): Likewise.
724 (print_debug_line_section): Likewise.
725 (print_debug_loclists_section): Likewise.
726 (print_debug_loc_section): Likewise.
727 (print_gdb_index_section): Likewsie.
729 2018-06-04 Mark Wielaard <mark@klomp.org>
731 * readelf.c (yes_str): New static char pointer.
733 (main): Set yes_str and no_str using gettext.
734 (attr_callback): Use yes_str and no_str instead of calling gettext.
736 2018-06-04 Mark Wielaard <mark@klomp.org>
738 * readelf.c (main): Call __fsetlocking (stdout, FSETLOCKING_BYCALLER).
740 2018-05-31 Mark Wielaard <mark@klomp.org>
742 * readelf.c (print_debug_units): Print the dwo name and id when
743 unable to find a .dwo file.
745 2018-05-31 Mark Wielaard <mark@klomp.org>
747 * readelf.c (enum section_e): Make section_types not an alias of
749 (section_all): Add section_types.
750 (parse_opt): Add both section_info and section_types for "info"
752 (print_debug_units): Don't be silent for debug_types.
754 2018-05-31 Mark Wielaard <mark@klomp.org>
756 * readelf.c (attr_callback): Only register section_loc when not
757 looking at a split dwarf from a skeleton.
759 2018-05-30 Mark Wielaard <mark@klomp.org>
761 * readelf.c (print_debug_loc_section): Use correct listptr for
764 2018-05-31 Mark Wielaard <mark@klomp.org>
766 * readelf.c (print_debug_units): Check offset against -1 not ~0ul.
768 2018-05-29 Mark Wielaard <mark@klomp.org>
770 * readelf.c (print_debug_loc_section): Handle GNU DebugFission list
773 2018-05-29 Mark Wielaard <mark@klomp.org>
775 * readelf.c (print_debug): Record and reset section_info status in
776 implicit_debug_sections and print_debug_sections.
778 2018-05-28 Mark Wielaard <mark@klomp.org>
780 * readelf.c (print_debug_units): Turn "Could not find split compile
781 unit" into an Warning instead of an error.
783 2018-04-29 Mark Wielaard <mark@klomp.org>
785 * readelf.c (parse_opt): Request implicit section_info for "str".
786 (known_stroffbases): New static variable.
787 (attr_callbackattr_callback): Handle DW_AT_str_offets_base.
788 (print_debug_str_offsets_section): New function.
789 (print_debug): Handle .debug_str_offsets as section_str. Reset
792 2018-04-27 Mark Wielaard <mark@klomp.org>
794 * readelf.c (options): Add addr.
795 (enum section_e): Add section_addr.
796 (section_all): Add section_addr.
797 (parse_opt): Parse "addr".
798 (known_addrbases): New static variable.
799 (get_listptr): New function.
800 (print_debug_addr_section): Likewise.
801 (attr_callback): Handle DW_AT_addr_base and DW_AT_GNU_addr_base.
802 (print_debug): Add NEW_SECTION (addr). Reset known_addrbases.
804 2018-04-07 Mark Wielaard <mark@klomp.org>
806 * readelf.c (attr_callback): Handle DW_FORM_loclistx and
809 2018-04-12 Mark Wielaard <mark@klomp.org>
811 * readelf.c (dwarf_loc_list_encoding_string): New functions.
812 (dwarf_loc_list_encoding_name): Likewise.
813 (known_loclistptr): Renamed and split in two...
814 (known_locsptr): this and ...
815 (known_loclistsptr): this.
816 (listptr_base): Split out...
817 (cudie_base): ...this.
818 (is_split_dwarf): New function.
819 (attr_callback): Handle DW_AT_loclists_base and notice sec_offset
821 (print_debug_rnglists_section): Use spit_dwarf_cu_base.
822 (print_debug_loclists_section): New function.
823 (print_debug_loc_section): Use known_locsptr instead of
825 (print_debug): Recognize .debug_loclists. Reset known_locsptr and
828 2018-05-25 Mark Wielaard <mark@klomp.org>
830 * readelf.c (DWARF_SKELETON): New constant.
831 (do_not_close_dwfl): New bool.
832 (options): Add dwarf-skeleton.
833 (dwarf_skeleton): New static variable.
834 (parse_opt): Handle DWARF_SKELETON, set dwarf_skeleton.
835 (create_dwfl): New function, with code extracted from...
836 (process_file): ...here. Check do_not_close_dwfl.
837 (is_split_darf): New function.
838 (getone_dwflmod): Likewise.
839 (print_debug): Use new functions to find skeleton DWARF file to use
840 when inspecting .dwo split DWARF file.
842 2018-04-11 Mark Wielaard <mark@klomp.org>
844 * readelf.c (dwarf_range_list_encoding_string): New function.
845 (dwarf_range_list_encoding_name): Likewise.
846 (known_rnglistptr): New static variable.
847 (listptr_cu): New function.
848 (print_debug_rnglists_section): Likewise.
849 (attr_callback): Call notice_listptr for DW_AT_ranges. Handle
850 DW_AT_rnglists_base. Handle DW_FORM_rnglistx. DW_AT_start_scope
851 can also have a rnglist.
852 (print_debug_units): Do (silently) scan split DWARF also for
853 debug_ranges before DWARF5 to catch all rangelistptrs.
854 (print_debug): Recognize .debug_rnglists. Reset known_rnglistptr.
856 2018-01-21 Mark Wielaard <mark@klomp.org>
858 * readelf.c (get_indexed_addr): New function.
859 (print_ops): Handle DW_OP_addrx, DW_OP_GNU_addr_index,
860 DW_OP_constx, DW_OP_GNU_const_index separately and resolve
862 (attr_callback): Print index and address for
863 DW_FORM_GNU_addr_index and DW_FORM_addrx[1234].
865 2018-01-19 Mark Wielaard <mark@klomp.org>
867 * readelf.c (options): Add info+.
868 (show_split_units): New static boolean defaulting to false.
869 (parse_opt): For all (no arg) --debug-dump set show_split_units
870 to yes. For "info+" enable section_info and show_split_units.
871 (attrcb_args): Add is_split field.
872 (attr_callback): Use is_split to format DIE offsets differently.
873 (print_debug_units): Likewise. Get subdie (type or split) only
874 when needed. When not silent reiterate over split DIEs when
877 2018-05-15 Mark Wielaard <mark@klomp.org>
879 * readelf.c (print_debug_units): Print unit type and id for any
880 unit type that has it even when version < 5.
882 2018-05-14 Mark Wielaard <mark@klomp.org>
884 * readelf.c (print_ops): Handle DW_OP_GNU_addr_index and
885 DW_OP_GNU_const_index.
886 (attr_callback): Handle DW_FORM_GNU_addr_index as DW_FORM_addrx.
887 Handle DW_FORM_GNU_str_index as DW_FORM_constx. Add as_hex_id.
888 Handle DW_AT_GNU_dwo_id as_hex_id.
889 (print_form_data): Handle DW_FORM_GNU_str_index as DW_FORM_strx.
891 2018-05-12 Mark Wielaard <mark@klomp.org>
893 * readelf.c (print_debug): Also recognize .dwo section name variants.
895 2018-05-15 Dmitry V. Levin <ldv@altlinux.org>
897 * elflint.c (check_elf_header): Fix typo in error diagnostics.
899 2018-05-15 Mark Wielaard <mark@klomp.org>
901 * readelf.c (print_form_data): Cast comparisons against offset_len to
903 (print_debug_line_section): Print uint64_t as PRIu64.
905 2018-05-11 Mark Wielaard <mark@klomp.org>
907 * readelf.c (print_debug_macro_section): Use libdw_valid_user_form.
908 Use print_form_data for strx and sup strings.
910 2018-05-09 Mark Wielaard <mark@klomp.org>
912 * readelf.c (dwarf_line_content_description_string): New function.
913 (dwarf_line_content_description_name): Likewise.
914 (print_bytes): Likewise.
915 (print_form_data): Likewise. Based on code taken from...
916 (print_debug_macro_section): ...here. Now calls print_form_data
917 and str_offsets_base_off.
918 (print_debug_line_section): Parse DWARF5 header, directory and file
921 2018-05-12 Mark Wielaard <mark@klomp.org>
923 * addr2line.c (main): Add fflush (stdout) after handle_address ()
924 when reading from stdin.
926 2018-04-24 Mark Wielaard <mark@klomp.org>
928 * readelf.c (print_debug_aranges_section): Try elf_rawdata if no
930 (print_debug_ranges_section): Likewise.
931 (print_debug_frame_section): Likewise.
932 (print_debug_line_section): Likewise. Check for data == NULL.
933 (print_debug_loc_section): Likewise.
934 (print_debug_macinfo_section): Likewise.
935 (print_debug_macro_section): Likewise.
937 2018-04-28 Mark Wielaard <mark@klomp.org>
939 * readelf.c (print_debug): If .debug_info is needed implicitly by
940 then handle it first before handling any other debug section.
941 (parse_opt): Set implicit_debug_sections to section_info when
942 showing all debug sections.
944 2018-05-05 Mark Wielaard <mark@klomp.org>
946 * readelf.c (attr_callback): Handle DW_FORM_ref_sup4 and
947 DW_FORM_ref_sup8 as references.
949 2018-04-24 Mark Wielaard <mark@klomp.org>
951 * readelf.c (print_debug_str_section): Take raw section data. Don't
952 use dwarf_getstring, but determine start and end of string from
953 offset and section data directly.
954 (print_debug): Handle ".debug_line_str" like ".debug_str".
956 2018-04-19 Andreas Schwab <schwab@suse.de>
958 * elflint.c (valid_e_machine): Add EM_RISCV.
960 2018-04-16 Mark Wielaard <mark@klomp.org>
962 * readelf.c (print_debug_line_section). In advance_pc, advance
963 using op_addr_advance, not op_advance.
965 2018-04-14 Mark Wielaard <mark@klomp.org>
967 * readelf.c (attr_callback): Only show errors when not silent.
969 2018-03-23 Mark Wielaard <mark@klomp.org>
971 * readelf.c (attr_callback): Handle DW_FORM_strx[1234].
973 2018-03-22 Mark Wielaard <mark@klomp.org>
975 * readelf.c (attr_callback): Handle DW_FORM_addrx[1234].
977 2018-03-28 Mark Wielaard <mark@klomp.org>
979 * readelf.c (handle_sysv_hash): Break bucket chain after nchain
981 (handle_sysv_hash64): Likewise.
983 2018-03-27 Mark Wielaard <mark@klomp.org>
985 * readelf.c (attr_callback): Print dwarf_dieoffset as %PRIx64,
988 2018-03-20 Mark Wielaard <mark@klomp.org>
990 * readelf.c (attr_callback): Report error when DW_AT_decl_file or
991 DW_AT_call_file cannot be resolved.
993 2018-03-06 Mark Wielaard <mark@klomp.org>
995 * readelf.c (print_ops): Handle DW_OP_addrx, DW_OP_constx,
996 DW_OP_implicit_pointer, DW_OP_entry_value, DW_OP_const_type,
997 DW_OP_regval_type, DW_OP_deref_type, DW_OP_xderef_type,
998 DW_OP_convert, DW_OP_reinterpret.
1000 2018-03-01 Mark Wielaard <mark@klomp.org>
1002 * readelf.c (struct listptr): Add attr field.
1003 (compare_listptr): Warn when two listptrs for the same offset have
1004 different attributes.
1005 (notice_listptr): Take attr as argument and add it to listptr.
1006 (skip_listptr_hole): New attr argument.
1007 (next_listptr_offset): New function.
1008 (print_debug_ranges_section): Pass NULL attr to skip_listptr_hole.
1009 (attr_callback): Handle DW_AT_GNU_locviews. Call notice_listptr with
1011 (print_debug_loc_section): Keep track of which attr is associated with
1012 a listptr. If the attr is DW_AT_GNU_locview print view pairs till the
1013 next listptr offset.
1015 2018-02-09 Mark Wielaard <mark@klomp.org>
1017 * elflint.c (check_group): Make sure we can read a complete
1018 element when iterating over the group.
1020 2018-02-09 Mark Wielaard <mark@klomp.org>
1022 * readelf.c (attr_callback): Handle DW_FORM_data16 as Dwarf_Block.
1024 2018-02-09 Mark Wielaard <mark@klomp.org>
1026 * readelf.c (print_debug_abbrev_section): Print the value of a
1027 DW_FORM_implicit_const using dwarf_getabbrevattr_data.
1028 (attr_callback): Handle DW_FORM_implicit_const.
1030 2018-01-30 Mark Wielaard <mark@klomp.org>
1032 * readelf.c (dwarf_unit_string): New function.
1033 (dwarf_unit_name): Likewise.
1034 (print_debug_units): Use dwarf_get_units and dwarf_cu_die instead
1035 of dwarf_next_unit. Print unit type, id and subdie if available.
1037 2018-02-09 Joshua Watt <JPEWhacker@gmail.com>
1039 * addr2line.c (handle_address): Use FALLTHROUGH macro instead of
1041 * elfcompress.c (parse_opt): Likewise.
1042 * elflint.c (check_dynamic): Likewise.
1043 (check_sections): Likewise.
1044 (check_note_data): Likewise.
1045 * objdump.c (parse_opt): Likewise.
1046 * readelf.c (parse_opt): Likewise.
1047 (attr_callback): Likewise.
1048 (handle_auxv_note): Likewise.
1049 * strings.c (parse_opt): Likewise.
1050 * backtrace.c (callback_verify): Likewise.
1052 2018-01-25 Mark Wielaard <mark@klomp.org>
1054 * readelf.c (print_debug_ranges_section): Initialize cu to last_cu.
1055 (print_debug_loc_section): Likewise.
1057 2018-01-01 Mark Wielaard <mark@klomp.org>
1059 * readelf.c (attr_callback): Use dwarf_form_name for unknown forms.
1060 (print_debug_macro_section): Print form using dwarf_form_name.
1062 2017-12-28 Mark Wielaard <mark@klomp.org>
1064 * readelf.c (print_debug_units): Print DIE offset in error message
1067 2017-12-18 Mark Wielaard <mark@klomp.org>
1069 * readelf.c (handle_notes_data): Don't use EXIT_FAILURE in error.
1070 Adjust error message depending on whether or not we got data.
1072 2017-12-07 Mark Wielaard <mark@klomp.org>
1074 * readelf.c (print_ops): Update data pointer and print arguments
1075 to DW_OP_call2 and DW_OP_call4 as DIE offsets.
1077 2017-11-29 Mark Wielaard <mark@klomp.org>
1079 * readelf.c (argp_options): Add "section-groups", 'g'.
1081 2017-11-29 Mark Wielaard <mark@klomp.org>
1083 * readelf.c (print_debug_loc_section): Print CU base and unresolved
1084 addresses. Adjust formatting.
1086 2017-11-29 Mark Wielaard <mark@klomp.org>
1088 * readelf.c (print_debug_ranges_section): Print CU base and unresolved
1089 addresses. Adjust formatting.
1091 2017-11-29 Mark Wielaard <mark@klomp.org>
1093 * readelf.c (attr_callback): Set valuestr to resolved file name
1094 for DW_AT_decl_file and DW_AT_call_file.
1096 2017-11-29 Mark Wielaard <mark@klomp.org>
1098 * readelf.c (print_debug_units): Print abbrev code after DIE tag.
1100 2017-11-29 Mark Wielaard <mark@klomp.org>
1102 * readelf.c (print_ops): Use only2 space for index. re-indent +5
1103 for DW_OP_GNU_entry_value.
1105 2017-11-21 Mark Wielaard <mark@klomp.org>
1107 * readelf.c (attr_callback): Print attribute name and form in error
1108 message. If only the value cannot be retrieved/resolved don't abort.
1110 2017-10-03 Mark Wielaard <mark@klomp.org>
1112 * readelf.c (attr_callback): Print DIE offset in error messages.
1114 2017-11-03 Mark Wielaard <mark@klomp.org>
1116 * readelf.c (print_ops): Handle DW_OP_GNU_variable_value. Print
1117 referenced DIE as offset.
1119 2017-09-10 Mark Wielaard <mark@klomp.org>
1121 * ar.c (do_oper_delete): Remove DEBUG conditional check.
1122 (no0print): Return bool. Check snprintf return value.
1123 (do_oper_insert): Initialize elf. Remove DEBUG conditional check.
1124 Check no0print calls succeed. Explicitly elf_end found elfs.
1125 (do_oper_extract): Make sure we don't create an empty variable
1128 2017-09-01 Mark Wielaard <mark@klomp.org>
1130 * stack.c (main): Replace \v in doc string with \n\n.
1131 * unstrip.c (main): Likewise.
1133 2017-05-04 Ulf Hermann <ulf.hermann@qt.io>
1135 * stack.c: Print pid_t using %lld.
1137 2017-08-18 Ulf Hermann <ulf.hermann@qt.io>
1139 * readelf.c: Hardcode the signal numbers for non-linux systems.
1141 2017-07-26 Mark Wielaard <mark@klomp.org>
1143 * readelf.c (print_debug_macro_section): Accept either version 4 or
1144 version 5. Use DW_MACRO names instead of DW_MACRO_GNU names. Add
1145 minimal support for DW_MACRO_define_sup, DW_MACRO_undef_sup,
1146 DW_MACRO_import_sup, DW_MACRO_define_strx and DW_MACRO_undef_strx.
1148 2017-07-26 Mark Wielaard <mark@klomp.org>
1150 * readelf.c (dwarf_defaulted_string): New function.
1151 (dwarf_defaulted_name): Likewise.
1152 (attr_callback): Use dwarf_defaulted_name to get value of
1155 2017-07-20 Mark Wielaard <mark@klomp.org>
1157 * strip.c (handle_elf): Deal with data marker symbols pointing to
1158 debug sections (they can be removed).
1160 2017-07-14 Mark Wielaard <mark@klomp.org>
1162 * strip (OPT_KEEP_SECTION): New define.
1163 (options): Add documentation for remove-section. Add keep-section.
1164 (struct section_pattern): New data type.
1165 (keep_secs, remove_secs): New globals.
1166 (add_pattern, free_sec_patterns, free_patterns, section_name_matches):
1168 (main): Call free_patterns.
1169 (parse_opt): Handle 'R' and OPT_KEEP_SECTION. Check remove_comment
1170 on ARGP_KEY_SUCCESS.
1171 (handle_elf): Handle and sanity check keep_secs and remove_secs.
1173 2017-06-07 Mark Wielaard <mark@klomp.org>
1175 * strip.c (handle_elf): Introduce new handle_elf boolean. Use it to
1176 determine whether to create an output and/or debug file. Remove new
1177 output file on error.
1179 2017-06-06 Mark Wielaard <mark@klomp.org>
1181 * strip.c (handle_elf): Assume e_shstrndx section can be removed.
1183 2017-04-20 Ulf Hermann <ulf.hermann@qt.io>
1185 * readelf.c: Include strings.h.
1187 2017-04-20 Ulf Hermann <ulf.hermann@qt.io>
1189 * unstrip.c: Check shnum for 0 before subtracting from it.
1191 2017-04-20 Ulf Hermann <ulf.hermann@qt.io>
1193 * readelf.c: Replace YESSTR and NOSTR with gettext ("yes") and
1194 gettext ("no"), respectively.
1196 2017-04-05 Mark Wielaard <mark@klomp.org>
1198 * elflint.c (check_elf_header): Decompress all sections.
1200 2017-03-28 Mark Wielaard <mark@klomp.org>
1202 * elflint (check_group): Don't check if there is no flag word.
1204 2017-03-27 Mark Wielaard <mark@klomp.org>
1206 * elflint.c (check_elf_header): Sanity check phnum and shnum.
1208 2017-03-27 Mark Wielaard <mark@klomp.org>
1210 * elflint.c (check_sysv_hash): Return early if section size is
1212 (check_sysv_hash64): Likewise.
1213 (check_hash): Calculate expect_entsize to check section size.
1215 2017-03-27 Mark Wielaard <mark@klomp.org>
1217 * elflint.c (check_symtab_shndx): Check data->d_size.
1219 2017-03-24 Mark Wielaard <mjw@redhat.com>
1221 * elfcmp.c (main): If n_namesz == 0 then the note name data is the
1223 * readelf.c (handle_notes_data): Likewise.
1225 2017-03-24 Mark Wielaard <mjw@redhat.com>
1227 * readelf.c (handle_gnu_hash): Check inner < max_nsyms before
1228 indexing into chain array.
1230 2017-02-16 Ulf Hermann <ulf.hermann@qt.io>
1232 * addr2line.c: Include printversion.h
1234 * elflint.c: Likewise.
1236 * objdump.c: Likewise.
1237 * ranlib.c: Likewise.
1238 * readelf.c: Likewise.
1240 * stack.c: Likewise.
1241 * strings.c: Likewise.
1242 * strip.c: Likewise.
1243 * elfcmp.c: Include printversion.h, remove system.h include.
1244 * elfcompress.c: Likewise.
1245 * findtextrel.c: Likewise.
1246 * unstrip.c: Likewise.
1248 2017-02-14 Ulf Hermann <ulf.hermann@qt.io>
1250 * nm.c: Include color.h.
1251 * objdump.c: Likewise.
1253 2016-12-24 Mark Wielaard <mark@klomp.org>
1255 * Makefile.am (findtextrel_LDADD): Add $(libeu).
1256 (addr2line_LDADD): Likewise.
1257 (elfcmp_LDADD): Likewise.
1258 * addr2line.c (print_version): Removed.
1259 * ar.c (print_version): Likewise.
1260 * elfcmp.c (print_version): Likewise.
1261 * elfcompress.c (print_version): Likewise.
1262 * elflint.c (print_version): Likewise.
1263 * findtextrel.c (print_version): Likewise.
1264 * nm.c (print_version): Likewise.
1265 * objdump.c: Likewise.
1266 * ranlib.c: Likewise.
1267 * readelf.c: Likewise.
1269 * stack.c: Likewise.
1270 * strings.c: Likewise.
1271 * strip.c: Likewise.
1272 * unstrip.c: Likewise.
1274 2016-11-17 Mark Wielaard <mjw@redhat.com>
1276 * readelf.c (options): Add optional arg SECTION for symbols.
1277 (symbol_table_section): New static variable.
1278 (parse_opt): Set symbol_table_section on 's'.
1279 (print_symtab): Filter on symbol_table_section name is set.
1281 2016-11-10 Mark Wielaard <mjw@redhat.com>
1283 * ar.c (write_member): Make sure tmpbuf is large enough to contain
1284 a starting '/' and ending '\0' char.
1285 (do_oper_insert): Likewise.
1286 * arlib.c (arlib_finalize): Format tmpbuf as PRId32 decimal.
1288 2016-11-02 Mark Wielaard <mjw@redhat.com>
1290 * addr2line.c (handle_address): Add fallthrough comment.
1291 * elfcompress.c (parse_opt): Adjust fallthrough comment.
1292 * elflint.c (parse_opt): Add missing break after 'd' case.
1293 (check_sections): Add fallthrough comments.
1294 * objdump.c (parse_opt): Add explantion for fallthrough comment.
1296 2016-10-22 Kevin Cernekee <cernekee@chromium.org>
1298 * unstrip.c: Fix "invalid string offset" error caused by using the
1299 unstripped .symtab with the stripped .strtab.
1301 2016-10-11 Akihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>
1303 * arlib.c: Remove system.h include, add libeu.h include.
1304 * arlib2.c: Remove sys/param.h include.
1305 * elfcompress.c: Add libeu.h include.
1306 * elflint.c: Remove sys/param.h include, add libeu.h include.
1308 * objdump.c: Likewise.
1309 * ranlib.c: Likewise.
1310 * readelf.c: Likewise.
1311 * size.c: Remove sys/param.h include.
1312 * strings.c: Likewise, add libeu.h include.
1313 * strip.c: Likewise.
1314 * unstrip.c: Likewise.
1316 2016-10-06 Mark Wielaard <mjw@redhat.com>
1318 * strip.c (handle_elf): Don't remove real symbols from allocated
1321 2016-08-25 Mark Wielaard <mjw@redhat.com>
1323 * strip.c (handle_elf): Recompress with ELF_CHF_FORCE.
1325 2016-08-06 Mark Wielaard <mjw@redhat.com>
1327 * strip.c (handle_elf): Uncompress and recompress relocation target
1328 section if necessary.
1330 2016-07-08 Mark Wielaard <mjw@redhat.com>
1332 * Makefile.am (strip_LDADD): Add libdw.
1333 * elfcompress.c (process_file): Use dwelf_strtab functions instead of
1335 * strip.c (handle_elf): Likewise.
1336 * unstrip.c (new_shstrtab): Likewise.
1338 2016-07-06 Mark Wielaard <mjw@redhat.com>
1340 * elf32-i386.script, i386_ld.c, ld.c, ld.h, ldgeneric.c, ldlex.l,
1341 ldscript.y, libld_elf_i386.map, none_ld.c, sectionhash.c,
1342 sectionhash.h, symbolhash.c, symbolhash.h, unaligned.h,
1343 versionhash.c, versionhash.h, xelf.h: Removed.
1344 * Makefile.am (YACC): Removed.
1345 (AM_YFLAGS): Removed.
1346 (AM_LFLAGS): Removed.
1347 (native_ld): Removed.
1348 (base_cpu): Removed.
1349 (bin_PROGRAMS): Removed ld.
1351 (ld_SOURCES): Removed.
1352 (noinst_LIBRARIES): Only libar.a.
1353 (EXTRA_DIST): Just arlib.h and debugpred.h.
1354 (ld_LDADD): Removed.
1355 (ld_LDFLAGS): Removed.
1357 (ldscript.h): Removed.
1359 (CLEANFILES): Just *.gconv.
1360 (MAINTAINERCLEANFILES): Removed.
1362 2016-07-06 Mark Wielaard <mjw@redhat.com>
1364 * unstrip.c (copy_elided_sections): Use unstripped_strent[] from
1365 index zero, instead of one.
1367 2016-06-28 Richard Henderson <rth@redhat.com>
1369 * elflint.c (valid_e_machine): Add EM_BPF.
1371 2016-04-11 David Abdurachmanov <davidlt@cern.ch>
1373 * elfcmp.c (main): Fix self-comparison error with GCC 6.
1375 2016-03-21 Mark Wielaard <mjw@redhat.com>
1377 * nm.c (show_symbols): Check for malloc size argument overflow.
1379 2016-02-13 Mark Wielaard <mjw@redhat.com>
1381 * readelf.c (print_scngrp): Call error when gelf_getshdr fails.
1382 (print_symtab): Likewise.
1383 (handle_hash): Likewise.
1384 (dump_data_section): Print a warning if decompressing fails.
1385 (print_string_section): Likewise.
1387 2016-02-13 Mark Wielaard <mjw@redhat.com>
1389 * elfcompress.c (parse_opt): Don't fallthrough after processing -q.
1391 2016-02-12 Mark Wielaard <mjw@redhat.com>
1393 * strip.c (handle_elf): Correct elf_assert shndxdata check.
1395 2016-02-09 Mark Wielaard <mjw@redhat.com>
1397 * readelf.c (read_encoded): Move up.
1398 (print_cfa_program): Add encoding argument. Use it for read_encoded
1399 when reading DW_CFA_set_loc op.
1400 (print_debug_frame_section): Pass fde_encoding to print_cfa_program.
1402 2016-02-09 Mark Wielaard <mjw@redhat.com>
1404 * elflint.c (compare_hash_gnu_hash): Check hash sh_entsize against
1405 sizeof (Elf64_Xword). Correct invalid sh_entsize error message
1406 section idx and name.
1408 2016-01-13 Mark Wielaard <mjw@redhat.com>
1410 * elflint.c (check_elf_header): Recognize ELFOSABI_FREEBSD.
1412 2016-01-08 Mark Wielaard <mjw@redhat.com>
1414 * elfcompress.c (compress_section): Use %zu to print size_t.
1415 * readelf.c (print_shdr): Use %zx to print size_t.
1417 2015-12-16 Mark Wielaard <mjw@redhat.com>
1419 * elfcompress.c: New file.
1420 * Makefile.am (bin_PROGRAMS): Add elfcompress.
1421 (elfcompress_LDADD): New variable.
1423 2015-12-18 Mark Wielaard <mjw@redhat.com>
1425 * elflint.c (section_flags_string): Add NEWFLAG COMPRESSED.
1426 (check_sections): SHF_COMPRESSED can be on any special section.
1427 SHF_COMPRESSED is a valid section flag. SHF_COMPRESSED cannot
1428 be used together with SHF_ALLOC or with SHT_NOBITS. Should have
1431 2015-10-20 Mark Wielaard <mjw@redhat.com>
1433 * readelf.c (options): Expand -z help text.
1434 (dump_data_section): Check whether we need and can decompress section
1435 data and call elf_rawzdata if so,
1436 (print_string_section): Likewise.
1437 (elf_contains_chdrs): New function.
1438 (process_elf_file): Rename print_unrelocated to print_unchanged,
1439 use elf_contains_chdrs.
1440 (print_scngrp): Check whether section is compressed before use.
1441 (print_symtab): Likewise.
1442 (handle_hash): Likewise.
1444 2015-10-16 Mark Wielaard <mjw@redhat.com>
1446 * readelf.c (argp_option): Describe --decompress,-z.
1447 (print_decompress): New bool.
1448 (parse_opt): Handle -z.
1449 (elf_ch_type_name): New function.
1450 (print_shdr): Print section compress information.
1452 2015-12-31 Mark Wielaard <mjw@redhat.com>
1454 * elflint.c (check_symtab): Add _edata and _end (plus extra underscore
1455 variants) to to the list of possibly dangling symbols.
1457 2015-12-02 Mark Wielaard <mjw@redhat.com>
1459 * nm.c (process_file): Accept fd and pass it on.
1460 (handle_elf): Likewise.
1461 (find_no_debuginfo): New.
1462 (struct getdbg): Likewise.
1463 (getdbg_dwflmod): Likewise.
1464 (show_symbols): Take fd. If the file is ET_REL use libdwfl to get
1465 the relocated Dwarf.
1467 2015-12-02 Mark Wielaard <mjw@redhat.com>
1469 * nm.c (get_local_names): Check for duplicates in local_root tree.
1471 2015-12-02 Mark Wielaard <mjw@redhat.com>
1473 * unstrip.c (struct data_list): New.
1474 (new_data_list): Likewise.
1475 (record_new_data): Likewise.
1476 (free_new_data): Likewise.
1477 (adjust_relocs): Call record_new_data.
1478 (add_new_section_symbols): Likewise.
1479 (copy_elided_sections): Call free_new_data.
1481 2015-12-01 Mark Wielaard <mjw@redhat.com>
1483 * elfcmp.c (main): Close ebl1 and ebl2 backends.
1485 2015-10-16 Mark Wielaard <mjw@redhat.com>
1487 * Makefile.am [BUILD_STATIC](libdw): Add -lz.
1488 [BUILD_STATIC](libelf): Likewise.
1490 2015-10-16 Mark Wielaard <mjw@redhat.com>
1492 * elflint.c (check_symtab): Don't check TLS symbol value against TLS
1493 phdr offset in debuginfo files.
1494 (check_sections): Don't try to match section offsets to phdrs offsets
1497 2015-10-16 Mark Wielaard <mjw@redhat.com>
1499 * elflint.c (check_reloc_shdr): Reject only desthdrs if they have both
1500 SHF_MERGE and SHF_STRINGS set.
1502 2015-10-13 Jose E. Marchesi <jose.marchesi@oracle.com>
1504 * elflint.c (check_sections): Do not rely on
1505 ebl_check_special_section when checking debuginfo files. Also
1506 check that the type of WE sections in debuginfo files is NOBITS.
1508 2015-10-13 Mark Wielaard <mjw@redhat.com>
1510 * elflint.c (check_program_header): Check relro flags are a subset
1511 of the load segment if they don't fully overlap.
1513 2015-10-07 Mark Wielaard <mjw@redhat.com>
1515 * Makefile.am (ldlex_no_Wstack_usage): New.
1516 * ldlex.l ([RWX]): Make cnt unsigned.
1518 2015-10-09 Josh Stone <jistone@redhat.com>
1520 * elflint.c (main): Replace stat64 and fstat64 with stat and fstat.
1521 * readelf.c (process_file): Likewise.
1522 (process_elf_file): Replace off64_t with off_t.
1523 * findtextrel.c (process_file): Replace open64 with open.
1524 * ld.c (main): Replace sizeof (off64_t) with 8.
1525 * strings.c: Replace off64_t with off_t throughout.
1526 (main): Replace stat64 and fstat64 with stat and fstat.
1527 (map_file): Replace mmap64 with mmap.
1528 (read_block): Likewise, and replace lseek64 with lseek.
1529 * strip.c (handle_elf): Replace ftruncate64 with ftruncate.
1530 (process_file): Replace stat64 and fstat64 with stat and fstat.
1531 * unstrip.c (parse_opt): Replace stat64 with stat.
1532 (handle_file): Replace open64 with open.
1533 (open_file): Likewise.
1535 2015-10-08 Chih-Hung Hsieh <chh@google.com>
1537 * ld.c (determine_output_format): Move recursive nested
1538 function "try" to file scope.
1540 2015-10-04 Mark Wielaard <mjw@redhat.com>
1542 * strip.c (handle_elf): Only sanity check section symbols to not
1543 kept discarded sections if we are creating a debug file.
1545 2015-10-07 Mark Wielaard <mjw@redhat.com>
1547 * unstrip.c (MAX): Removed.
1548 (find_alloc_sections_prelink): Allocate exact amount of bytes for
1551 2015-10-05 Chih-Hung Hsieh <chh@google.com>
1553 * unstrip.c (find_alloc_sections_prelink): Do not allocate
1554 on stack union types with variable length arrays; use xmalloc
1555 for such dynamic sized objects.
1556 * readelf.c (handle_core_item): Likewise, but use alloca
1557 for small variable size data object and add assert(count < 128).
1559 2015-10-05 Josh Stone <jistone@redhat.com>
1561 * Makefile.am (libld_elf_i386.so): Add AM_V_CCLD silencer.
1562 (.deps/none_ld.Po): Always silence the dummy command.
1563 (make-debug-archive): Add AM_V_GEN and AM_V_at silencers.
1565 2015-10-02 Mark Wielaard <mjw@redhat.com>
1567 * unstrip.c (copy_elided_sections): Use SH_INFO_LINK_P, not just
1570 2015-10-02 Mark Wielaard <mjw@redhat.com>
1572 * strip.c (handle_elf): Don't move around allocated NOBITS sections.
1573 Don't just mark the section header string table as unused.
1574 * unstrip.c (copy_elided_sections): Add header names to strtab if
1575 shstrndx equals the symtab strtabndx.
1577 2015-09-22 Mark Wielaard <mjw@redhat.com>
1579 * strip.c (cleanup_debug): Remove old-style function definitions.
1581 2015-09-09 Chih-Hung Hsieh <chh@google.com>
1583 * readelf.c (print_debug_exception_table): Initialize variable before
1584 it is used, because compiler does not know that error never returns.
1585 (dump_arhive_index): Likewise.
1587 2015-09-04 Chih-Hung Hsieh <chh@google.com>
1589 * elflint.c (check_group): Replace %Z length modifier with %z.
1590 (check_note_data): Likewise.
1591 * findtextrel.c (process_file): Likewise.
1592 * readelf.c (handle_dynamic): Likewise.
1593 (handle_symtab): Likewise.
1594 (handle_verneed): Likewise.
1595 (handle_verdef): Likewise.
1596 (handle_versym): Likewise.
1597 (print_hash_info): Likewise.
1598 (print_decoded_aranges_section): Likewise.
1599 (print_debug_aranges_section): Likewise.
1600 (print_debug_line_section): Likewise.
1601 (hex_dump): Likewise.
1602 (dump_data_section): Likewise.
1603 (print_string_section): Likewise.
1604 (dump_archive_index): Likewise.
1605 * unstrip.c (adjust_relocs): Likewise.
1606 (collect_symbols): likewise.
1607 (get_section_name): Likewise.
1608 (find_alloc_sections_prelink): Likewise.
1609 (copy_elided_sections): Likewise.
1610 * ldscript.y (add_id_list): Add missing '%s'.
1612 2015-09-03 Mark Wielaard <mjw@redhat.com>
1614 * readelf.c (handle_core_item): Handle right shift >= 32 bits.
1616 2015-08-11 Mark Wielaard <mjw@redhat.com>
1618 * elflint.c (check_sections): When gnuld and a NOBITS section falls
1619 inside a segment make sure any ELF file contents is zero.
1621 2015-07-29 Mark Wielaard <mjw@redhat.com>
1623 * unstrip.c (sections_flags_match): New function.
1624 (sections_match): Use sections_flags_match.
1625 (find_alloc_sections_prelink): Only clear matched sections if there
1627 (copy_elided_sections): Add SHF_INFO_LINK to shdr_mem.sh_flags if
1630 2015-06-27 Pino Toscano <toscano.pino@tiscali.it>
1632 * src/strings.c: Define MAP_POPULATE if not defined already.
1634 2015-06-27 Mark Wielaard <mjw@redhat.com>
1636 * nm.c (show_symbols): First call elf_getdata, then allocate memory.
1638 2015-06-18 Mark Wielaard <mjw@redhat.com>
1640 * findtextrel.c (process_file): Free segments after use.
1642 2015-06-18 Mark Wielaard <mjw@redhat.com>
1644 * readelf.c (print_phdr): Make sure phdr2_mem lifetime/scope equals
1647 2015-06-18 Mark Wielaard <mjw@redhat.com>
1649 * readelf.c (handle_gnu_hash): Free lengths on invalid_data.
1651 2015-06-18 Mark Wielaard <mjw@redhat.com>
1653 * elflint.c (check_symtab): Only check the PT_TLS phdr if it actually
1654 exists. Warn otherwise.
1656 2015-06-18 Mark Wielaard <mjw@redhat.com>
1658 * nm.c (show_symbols): Check sizeof (sym_mem[0]), not GElf_Sym to
1659 known whether or not we stack allocated memory.
1661 2015-06-18 Mark Wielaard <mjw@redhat.com>
1663 * strings.c (readelf): Use "<unknown>" if we cannot retrieve section
1666 2015-06-09 Mark Wielaard <mjw@redhat.com>
1668 * addr2line.c (print_dwarf_function): Always free scopes before
1671 2015-06-09 Mark Wielaard <mjw@redhat.com>
1673 * strip.c (handle_ar): Mark as unused.
1674 (process_file): Produce an error when trying to handle an ar.
1676 2015-05-30 Mark Wielaard <mjw@redhat.com>
1678 * elfcmp.c (main): Only call memcmp when d_size != 0.
1680 2015-05-23 Mark Wielaard <mjw@redhat.com>
1682 * Makefile.am: Define ldgeneric, readelf, nm, size, strip, elflint,
1683 findtextrel, elfcmp objdump, ranlib, ar and unstrip no_Wstack_usage.
1685 2015-05-21 Mark Wielaard <mjw@redhat.com>
1687 * addr2line.c (handle_address): Set scopes to NULL after free.
1689 2015-05-20 Mark Wielaard <mjw@redhat.com>
1691 * addr2line.c (OPT_PRETTY): New constant define.
1692 (argp_option): Add "pretty-print".
1693 (pretty): New static bool.
1694 (parse_opt): Set pretty.
1695 (print_dwarf_function): Adjust output when pretty is set.
1696 (print_addrsym): Likewise.
1697 (handle_address): Likewise.
1699 2015-05-20 Mark Wielaard <mjw@redhat.com>
1701 * Makefile.am (addr2line_LDADD): Add demanglelib.
1702 * addr2line.c (argp_option): Move demangle under output format.
1703 (demangle): New static bool.
1704 (demangle_buffer_len): New static size_t.
1705 (demangle_buffer): New static char *.
1706 (main): free demangle_buffer.
1707 (parse_opt): Set demangle.
1708 (symname): New static function.
1709 (get_diename): Use symname.
1710 (print_dwarf_function): Likewise.
1711 (print_addrsym): Likewise.
1712 (handle_address): Likewise.
1714 2015-05-20 Mark Wielaard <mjw@redhat.com>
1716 * addr2line.c (argp_option): Add "addresses", 'a'.
1717 (print_addresses): New static bool.
1718 (parse_opt): Set print_addresses.
1719 (get_addr_width): New static function.
1720 (handle_address): Print address if print_addresses is true.
1722 2015-05-20 Mark Wielaard <mjw@redhat.com>
1724 * addr2line.c (handle_address): Call strtoumax with base 16. Make
1725 sure all input has been processed.
1727 2015-05-20 Mark Wielaard <mjw@redhat.com>
1729 * addr2line (argp_option): Group 'section' under "Input format
1732 2015-05-12 Mark Wielaard <mjw@redhat.com>
1734 * strip.c (debug_fd): New static variable.
1735 (tmp_debug_fname): Likewise.
1736 (cleanup_debug): New function using the above to clean up temporary
1738 (INTERNAL_ERROR): Call cleanup_debug.
1739 (handle_elf): Use debug_fd and tmp_debug_fname statics and call
1740 cleanup_debug before any error. Use output_fname instead of fname in
1741 error messages when it exists (-o was given). SHT_NOBITS sections
1742 can also be moved freely even if SHF_ALLOC is set. Add various
1743 sanity checks. Use elf_assert instead of plain assert.
1745 2015-05-08 Mark Wielaard <mjw@redhat.com>
1747 * nm.c (show_symbols): Call gelf_fsize with EV_CURRENT.
1748 * strip.c (handle_elf): Likewise.
1750 2015-05-06 Mark Wielaard <mjw@redhat.com>
1752 * elflint.c (check_gnu_hash): Return early when 2nd hash function
1753 shift too big. Check there is enough data available. Make sure
1754 bitmask_words is not zero.
1755 (check_verdef): Use Elf64_Word for shdr->sh_info cnt.
1756 (check_verneed): Likewise.
1757 (check_attributes): Break when vendor name isn't terminated.
1758 Add overflow check for subsection_len.
1760 2015-05-05 Mark Wielaard <mjw@redhat.com>
1762 * nm.c (show_symbols): Handle dwarf_linesrc returning NULL.
1764 2015-05-04 Max Filippov <jcmvbkbc@gmail.com>
1766 * ar.c (do_oper_extract): Replace struct timeval with struct timespec
1767 and futimes with futimens.
1768 * strip.c (process_file): Replace struct timeval with struct timespec.
1769 (handle_elf, handle_ar): Replace struct timeval with struct timespec
1770 in prototype. Replace futimes with futimens.
1772 2015-05-04 Max Filippov <jcmvbkbc@gmail.com>
1774 * addr2line.c (main): Drop mtrace() call and #include <mcheck.h>.
1778 * objdump.c: Likewise.
1779 * ranlib.c: Likewise.
1781 * strip.c: Likewise.
1782 * unstrip.c: Likewise.
1784 2015-05-04 Anthony G. Basile <blueness@gentoo.org>
1786 * Makefile.am (readelf_LDADD, nm_LDADD, size_LDADD, strip_LDADD)
1787 (ld_LDADD, elflint_LDADD, findtextrel_LDADD, addr2line_LDADD)
1788 (elfcmp_LDADD, objdump_LDADD, ranlib_LDADD, strings_LDADD)
1789 (ar_LDADD, unstrip_LDADD, stack_LDADD): Append $(argp_LDADD).
1791 2015-03-22 Mark Wielaard <mjw@redhat.com>
1793 * readelf.c (print_debug_frame_section): Cast start to Dwarf_Off
1794 before subtracting cie_id. And cast cie_offset to Dwarf_Off before
1797 2015-03-22 Mark Wielaard <mjw@redhat.com>
1799 * readelf.c (print_gdb_index_section): Check all offsets used
1800 against section d_size.
1802 2015-03-17 Mark Wielaard <mjw@redhat.com>
1804 * readelf.c (print_debug): Don't return, but always use dummy_dbg.
1806 2015-03-17 Mark Wielaard <mjw@redhat.com>
1808 * readelf.c (print_gdb_index_section): Add overflow checking for
1811 2015-03-14 Mark Wielaard <mjw@redhat.com>
1813 * nm.c (INTERNAL_ERROR): Remove __DATE__.
1814 * objdump.c (INTERNAL_ERROR): Likewise.
1815 * size.c (INTERNAL_ERROR): Likewise.
1816 * strip.c (INTERNAL_ERROR): Likewise.
1818 2015-03-18 Petr Machata <pmachata@redhat.com>
1820 * readelf.c (dwarf_tag_string, dwarf_attr_string)
1821 (dwarf_form_string, dwarf_lang_string, dwarf_inline_string)
1822 (dwarf_encoding_string, dwarf_access_string)
1823 (dwarf_visibility_string, dwarf_virtuality_string)
1824 (dwarf_identifier_case_string, dwarf_calling_convention_string)
1825 (dwarf_ordering_string, dwarf_discr_list_string)
1826 (dwarf_locexpr_opcode_string): Adjust uses of know-dwarf.h macros
1827 to match the API changes.
1829 2015-03-09 Mark Wielaard <mjw@redhat.com>
1831 * elflint.c (compare_hash_gnu_hash): Correct gnu_symbias usage.
1833 2015-01-03 Mark Wielaard <mjw@redhat.com>
1835 * elfcmp (main): Check section name is not NULL. Check sh_entsize
1836 is not zero for symbol tables. Check phdrs are not NULL.
1837 (search_for_copy_reloc): Check sh_entsize is not zero.
1839 2014-12-30 Mark Wielaard <mjw@redhat.com>
1841 * elflint.c (check_scn_group): Check d_buf and name are not NULL.
1842 (is_rel_dyn): Check d is not NULL. Check shdr->sh_entsize is not
1844 (check_dynamic): Check strshdr is not NULL. Check d_tag is positive.
1845 (check_symtab_shndx): Check symshdr and data->d_buf are not NULL.
1846 Check shdr and symshdr sh_entsize are not zero.
1847 (check_gnu_hash): Make sure maskidx is smaller than bitmask_words.
1848 Check symshdr->sh_entsize is not zero. Check data->d_buf is not
1850 (compare_hash_gnu_hash): Check sections d_buf are not NULL.
1851 Check section data is large enough. Use gnu_symbias.
1852 (check_group): Check section val is valid.
1853 (has_copy_reloc): Check sh_entsize is not zero.
1854 (check_versym): Likewise.
1855 (unknown_dependency_p): Likewise.
1856 (check_verneed): Break on invalid ref or offset. Don't assert.
1857 Report error when next offset is zero, but more vers expected.
1858 (check_verdef): Likewise.
1859 (check_attributes): Make sure d_buf is not NULL.
1860 (check_note): Likewise.
1861 (check_note_section): Likewise.
1862 (check_program_header): Make sure section name is not NULL.
1864 2014-12-26 Mark Wielaard <mjw@redhat.com>
1866 * strings.c (read_elf): Produce error when section data falls outside
1869 2014-12-26 Mark Wielaard <mjw@redhat.com>
1871 * nm.c (show_symbols): Guard against divide by zero in error check.
1872 Add section index number in error message.
1874 2014-12-26 Mark Wielaard <mjw@redhat.com>
1876 * nm.c (handle_ar): Skip over /SYM64/ entries.
1878 2014-12-26 Mark Wielaard <mjw@redhat.com>
1880 * nm.c (handle_ar): Break on arsym with invalid offset.
1882 2014-12-20 Mark Wielaard <mjw@redhat.com>
1884 * readelf.c (print_debug_macinfo_section): Mark cus sentinel files
1885 as -1 non-existent. Check macoff against sentinel cus.
1887 2014-12-20 Mark Wielaard <mjw@redhat.com>
1889 * readelf.c (print_debug_exception_table): Add max_action overflow
1890 check. Check action_table_end before reading slib128. Check
1891 max_ar_filter underflow.
1893 2014-12-18 Ulrich Drepper <drepper@gmail.com>
1895 * Makefile.am: Suppress output of textrel_check command.
1897 2014-12-17 Mark Wielaard <mjw@redhat.com>
1899 * readelf.c (print_cfa_program): Add bounds check before each op that
1900 takes at least one argument.
1902 2014-12-16 Mark Wielaard <mjw@redhat.com>
1904 * readelf.c (print_decoded_line_section): Print dwarf_errmsg if
1905 dwarf_onesrcline or dwarf_linesrc fails.
1907 2014-12-16 Mark Wielaard <mjw@redhat.com>
1909 * readelf.c (print_debug_line_section): Correct overflow check for
1911 (print_debug_aranges_section): Correct overflow check for length.
1913 2014-12-15 Mark Wielaard <mjw@redhat.com>
1915 * readelf.c (notice_listptr): Return false if offset doesn't fit
1917 (attr_callback): Warn if loclist or rangelist offset doesn't fit.
1919 2014-12-15 Mark Wielaard <mjw@redhat.com>
1921 * readelf.c (print_ops): Don't assert when addr_size or ref_size
1922 is not 4 or 8, just report invalid data.
1924 2014-12-15 Mark Wielaard <mjw@redhat.com>
1926 * readelf.c (print_gdb_index_section): Add more bounds checks.
1928 2014-12-15 Mark Wielaard <mjw@redhat.com>
1930 * readelf.c (print_debug_line_section): Check there is enough room
1931 for DW_LNE_set_address argument. Make sure there is enough room
1932 for the the initial unit_length.
1934 2014-12-14 Mark Wielaard <mjw@redhat.com>
1936 * elflint.c (check_attributes): Call get_uleb128 with end pointer.
1937 * readelf.c (print_attributes): Likewise.
1938 (print_ops): Likewise and also for get_sleb128.
1939 (print_cfa_program): Likewise and add more readp bounds checks.
1940 (read_encoded): Likewise.
1941 (print_debug_frame_section): Likewise.
1942 (print_debug_line_section): Likewise.
1943 (print_debug_macinfo_section): Likewise.
1944 (print_debug_macro_section): Likewise.
1945 (print_debug_exception_table): Likewise.
1947 2014-12-16 Mark Wielaard <mjw@redhat.com>
1949 * elfcmp.c (compare_Elf32_Word): Make sure (unsigned) Elf32_Word
1950 difference doesn't wrap around before returning as int.
1952 2014-12-11 Mark Wielaard <mjw@redhat.com>
1954 * readelf.c (print_debug_exception_table): Check TType base offset
1955 and Action table are sane.
1957 2014-12-11 Mark Wielaard <mjw@redhat.com>
1959 * readelf.c (print_debug_frame_section): Check number of augmentation
1962 2014-12-09 Mark Wielaard <mjw@redhat.com>
1964 * readelf.c (handle_file_note): Check count fits data section and
1965 doesn't overflow fptr.
1967 2014-12-08 Mark Wielaard <mjw@redhat.com>
1969 * readelf.c (print_debug_exception_table): Report invalid data if
1970 action table doesn't immediately follow call site table.
1972 2014-12-10 Josh Stone <jistone@redhat.com>
1974 * addr2line.c (get_diename): New, get linkage_name or name.
1975 * addr2line.c (print_dwarf_function): Use get_diename.
1976 * addr2line.c (handle_address): Likewise.
1977 * addr2line.c (print_diesym): Removed.
1979 2014-12-10 Josh Stone <jistone@redhat.com>
1981 * addr2line.c (handle_address): Find the proper inline parents.
1983 2014-12-07 Mark Wielaard <mjw@redhat.com>
1985 * readelf.c (print_debug_line_section): max_ops_per_instr cannot
1988 2014-12-07 Mark Wielaard <mjw@redhat.com>
1990 * readelf.c (print_ops): Handle zero ref_size for DW_OP_call_ref
1991 and DW_OP_GNU_implicit_pointer.
1993 2014-12-04 Mark Wielaard <mjw@redhat.com>
1995 * objdump.c (show_relocs_x): Make sure destshdr exists.
1996 (show_relocs_rel): Don't rely on shdr->sh_entsize, use gelf_fsize.
1997 (show_relocs_rela): Likewise.
1998 (show_relocs): Make sure destshdr, symshdr and symdata exists.
2000 2014-11-30 Mark Wielaard <mjw@redhat.com>
2002 * readelf.c (handle_sysv_hash64): Fix overflow check.
2004 2014-11-28 Mark Wielaard <mjw@redhat.com>
2006 * readelf.c (handle_relocs_rel): Don't reuse destshdr to store
2007 section header of a relocation against a STT_SECTION symbol. Use
2008 a new local variable secshdr.
2009 (handle_relocs_rela): Likewise.
2011 2014-11-26 Mark Wielaard <mjw@redhat.com>
2013 * readelf.c (print_debug_aranges_section): Cast Dwarf_Word length
2014 to ptrdiff_t for comparison.
2016 2014-11-24 Mark Wielaard <mjw@redhat.com>
2018 * readelf.c (print_debug_line_section): Check line_range is not zero
2021 2014-11-23 Mark Wielaard <mjw@redhat.com>
2023 * readelf.c (print_debug_aranges_section): Check length to catch
2026 2014-11-21 Mark Wielaard <mjw@redhat.com>
2028 * readelf.c (print_attributes): Guard against empty section.
2029 Document attribute format. Break when vendor name isn't terminated.
2030 Add overflow check for subsection_len. Handle both gnu and non-gnu
2033 2014-11-22 Mark Wielaard <mjw@redhat.com>
2035 * elflint.c (check_sections): Call ebl_bss_plt_p without ehdr.
2036 * findtextrel.c (process_file): Use elf_getphdrnum.
2037 * readelf.c (process_elf_file): Remove redundant ehdr->e_phoff check.
2038 (print_phdr): Check phnum.
2039 * size.c (show_segments): Use elf_getphdrnum.
2040 * strip.c (handle_elf): Likewise.
2041 * unstrip.c (copy_elf): Likewise.
2042 (copy_elided_sections): Likewise.
2043 (handle_file): Likewise.
2045 2014-11-18 Mark Wielaard <mjw@redhat.com>
2047 * readelf.c (print_cfa_program): Fix sanity check of DW_FORM_block
2050 2014-11-17 Mark Wielaard <mjw@redhat.com>
2052 * readelf.c (handle_verneed): Check vna_next and vn_next exist.
2053 (handle_verdef): Check vda_next and vd_next exist.
2054 (handle_versym): Check vd_next, vna_next and vn_next exist.
2055 Check vername and filename are not NULL before use.
2057 2014-11-17 Mark Wielaard <mjw@redhat.com>
2059 * elfcmp.c (main): Check section names are NULL before use.
2060 * objdump.c (section_match): Likewise.
2061 * size.c (show_sysv): Likewise.
2063 2014-11-17 Mark Wielaard <mjw@redhat.com>
2065 * readelf.c (print_debug_frame_section): Warn if ptr_size is not 4
2066 or 8 instead of just calling print_cfa_program.
2068 2014-11-16 Mark Wielaard <mjw@redhat.com>
2070 * readelf (process_elf_file): Set phnum to zero if there aren't
2071 actually any pheaders.
2072 (print_phdr): Check there actually is a phdr.
2074 2014-11-16 Mark Wielaard <mjw@redhat.com>
2076 * readelf.c (print_cfa_program): Check block len before calling
2079 2014-11-14 Mark Wielaard <mjw@redhat.com>
2081 * readelf.c (print_debug_frame_section): Sanity Check CIE
2082 unit_length and augmentationlen.
2084 2014-11-14 Mark Wielaard <mjw@redhat.com>
2086 * readelf.c (handle_versym): Check def == NULL before use.
2088 2014-11-08 Mark Wielaard <mjw@redhat.com>
2090 * readelf.c (handle_versym): Initialize vername and filename array
2093 2014-11-07 Mark Wielaard <mjw@redhat.com>
2095 * readelf.c (handle_sysv_hash): Sanity check section contents.
2096 (handle_sysv_hash64): Likewise.
2097 (handle_gnu_hash): Likewise.
2099 2014-09-14 Petr Machata <pmachata@redhat.com>
2101 * readelf.c (handle_relocs_rela): Typo fix, test DESTSHDR properly.
2103 2014-09-12 Petr Machata <pmachata@redhat.com>
2105 * readelf.c (encoded_ptr_size): In the switch statement, change
2106 magic constants 3 and 4 to DW_EH_PE_* counterparts. Still accept
2107 0. Print diagnostic for anything else.
2109 2014-08-25 Josh Stone <jistone@redhat.com>
2111 * Makefile.am: Prevent premature @AR@ replacement in a sed expression.
2113 2014-07-04 Menanteau Guy <menantea@linux.vnet.ibm.com>
2114 Mark Wielaard <mjw@redhat.com>
2116 * elflint (check_symtab): Add ".TOC." to the list of possibly
2117 dangling symbols because of sourceware PR13621.
2119 2014-06-14 Mark Wielaard <mjw@redhat.com>
2121 * elflint (check_symtab): Use ebl_func_addr_mask on st_value.
2123 2014-05-27 Mark Wielaard <mjw@redhat.com>
2125 * readelf.c (print_debug): Skip section if name is NULL.
2127 2014-05-26 Mark Wielaard <mjw@redhat.com>
2129 * readelf.c (handle_relocs_rela): Print header like handle_relocs_rel
2130 does, when sh_info == 0.
2132 2014-05-26 Mark Wielaard <mjw@redhat.com>
2134 * unstrip.c (find_alloc_sections_prelink): Allow non-split .bss
2135 section when sh_size of the original and undo .bss section are equal.
2137 2014-05-26 Mark Wielaard <mjw@redhat.com>
2139 * unstrip.c (options): Add --force, -F.
2140 (struct arg_info): Add bool force.
2141 (parse_opt): Handle 'F', set force.
2142 (handle_explicit_files): Add force argument, add warn function,
2143 separate check ehdr field checks, use warn.
2144 (handle_dwfl_module): Add force argument, pass on to
2145 handle_explicit_files.
2146 (handle_output_dir_module): Add force argument, pass on to
2148 (handle_implicit_modules): Pass info->force to handle_dwfl_module and
2149 handle_output_dir_module.
2150 (main): Pass info.force to handle_explicit_files.
2152 2014-05-19 Mark Wielaard <mjw@redhat.com>
2154 * elflint.c (check_reloc_shdr): Check ebl_check_reloc_target_type.
2156 2014-05-01 Mark Wielaard <mjw@redhat.com>
2158 * readelf.c (find_no_debuginfo): Call dwfl_standard_find_debuginfo
2159 if looking for alternate debug file.
2161 2014-04-11 Mark Wielaard <mjw@redhat.com>
2163 * Makefile.am (AM_CPPFLAGS): Add -I libdwelf.
2165 2014-04-22 Mark Wielaard <mjw@redhat.com>
2167 * readelf.c (handle_core_item): Make sure variable length array
2168 contains at least enough space for terminating zero char.
2170 2014-04-22 Mark Wielaard <mjw@redhat.com>
2172 * readelf.c (print_gdb_index_section): Use unsigned int for 31 bits
2175 2014-03-13 Mark Wielaard <mjw@redhat.com>
2177 * Makefile.am: Remove no_mudflap.os. Remove libmudflap from all
2179 * strings.c (process_chunk): Remove _MUDFLAP condition.
2181 2014-04-09 Mark Wielaard <mjw@redhat.com>
2183 * readelf.c (print_debug_aranges_section): Don't get the raw section
2184 data, use the possibly decompressed .[z]debug sectiondata.
2185 (print_debug_ranges_section): Likewise.
2186 (print_debug_frame_section): Likewise.
2187 (print_debug_line_section): Likewise.
2188 (print_debug_loc_section): Likewise.
2189 (print_debug_macinfo_section): Likewise.
2190 (print_debug_macro_section): Likewise.
2192 2014-04-10 Mark Wielaard <mjw@redhat.com>
2194 * readelf.c (buf_read_ulong): Pass actual long size to convert.
2196 2014-03-05 Mark Wielaard <mjw@redhat.com>
2198 * readelf.c (attr_callback): Print DW_FORM_sdata values as signed
2201 2014-02-24 Mark Wielaard <mjw@redhat.com>
2203 * readelf (print_phdr): Check there is a SHT_PROGBITS section at the
2204 offset given by p_offsets for a PT_INTERP segment before trying to
2205 display the interpreter string.
2207 2014-02-07 Mark Wielaard <mjw@redhat.com>
2209 * readelf.c (print_phdr): Check phdr->p_filesz and make sure
2210 interpreter string is zero terminated before calling printf.
2212 2014-01-22 Mark Wielaard <mjw@redhat.com>
2214 * Makefile.am (nm_no_Wformat): Removed.
2215 (size_no_Wformat): Likewise.
2216 (strings_no_Wformat): Likewise.
2217 (addr2line_no_Wformat): Likewise.
2218 * size.c (show_sysv): Use fmtstr directly as literal in printf.
2219 (show_sysv_one_line): Likewise.
2220 * strings.c (locfmt): Removed.
2221 (radix): New static enum.
2222 (parse_opt): Set radix, not locfmt.
2223 (process_chunk_mb): Use fmtstr directly as literal in printf based
2225 (process_chunk): Likewise.
2226 * nm.c (show_symbols_sysv): Use fmtstr directly as literal in printf.
2227 (show_symbols_bsd): Likewise.
2228 (show_symbols_posix): Likewise.
2230 2014-01-21 Mark Wielaard <mjw@redhat.com>
2232 * stack.c (show_inlines): New static boolean.
2233 (print_frame): New function split out from...
2234 (print_frames): ..here. If show_inlines is true and we found a
2235 DIE for the frame address, call print_inline_frames otherwise
2236 call print_frame. Keep track of and track frame_nr.
2237 (print_inline_frames): New function.
2238 (parse_opt): Handle '-i'.
2239 (main): Add 'i' to options.
2241 2014-01-27 Mark Wielaard <mjw@redhat.com>
2243 * stack.c (maxframes): Initialize to 256.
2244 (main): Document new default in options. Document magic number
2245 used in frames.allocated initialization.
2247 2014-01-20 Mark Wielaard <mjw@redhat.com>
2249 * stack.c (show_debugname): New static boolean.
2250 (die_name): New function.
2251 (print_frames): If show_debugname is true set symname to the
2252 first function-like DIE with a name in scope for the address in
2254 (parse_opt): Handle '-d'.
2255 (main): Add 'd' to options.
2257 2014-01-20 Mark Wielaard <mjw@redhat.com>
2259 * addr2line.c (handle_address): Initialize scopes to NULL.
2261 2014-01-17 Roland McGrath <roland@redhat.com>
2263 * strip.c (handle_elf): Check for bogus values in sh_link, sh_info,
2264 st_shndx, e_shstrndx, and SHT_GROUP or SHT_SYMTAB_SHNDX data.
2265 Don't use assert on input values, instead bail with "illformed" error.
2267 2014-01-17 Roland McGrath <roland@redhat.com>
2269 * readelf.c (handle_dynamic, handle_symtab): Check for bogus sh_link.
2270 (handle_verneed, handle_verdef, handle_versym, handle_hash): Likewise.
2271 (handle_scngrp): Check for bogus sh_info.
2273 2014-01-17 Jakub Jelinek <jakub@redhat.com>
2275 * elflint.c (section_name): Return "<invalid>" instead of
2276 crashing on invalid section name.
2277 (check_symtab, is_rel_dyn, check_rela, check_rel, check_dynamic,
2278 check_symtab_shndx, check_hash, check_versym): Robustify.
2279 (check_hash): Don't check entries beyond end of section.
2280 (check_note): Don't crash if gelf_rawchunk fails.
2282 2014-01-17 Petr Machata <pmachata@redhat.com>
2284 * readelf.c (handle_dynamic, handle_relocs_rel)
2285 (handle_relocs_rela, handle_versym, print_liblist):
2286 Use gelf_fsize instead of relying on shdr->sh_entsize.
2288 2014-01-14 Mark Wielaard <mjw@redhat.com>
2290 * readelf.c (print_debug_macro_section): Clear vendor array before
2293 2014-01-15 Jan Kratochvil <jan.kratochvil@redhat.com>
2295 Fix corruption of non-C++ symbols by the demangler.
2296 * nm.c (show_symbols_sysv, show_symbols_bsd, show_symbols_posix)
2297 (show_symbols): Check for _Z.
2298 * stack.c (print_frames) <USE_DEMANGLE>: Check for _Z.
2300 2014-01-02 Mark Wielaard <mjw@redhat.com>
2302 * stack.c (show_raw): Declare unconditionally.
2303 (parse_opt): Handle '-r' unconditionally.
2304 (main): Show "raw" option even without USE_DEMANGLE.
2306 2014-01-02 Mark Wielaard <mjw@redhat.com>
2308 * stack.c (print_frames): Print 0x before build-id hex-offset.
2310 2014-01-02 Mark Wielaard <mjw@redhat.com>
2312 * stack.c (maxframes): Increase to 2048.
2313 (struct frames): Add allocated field.
2314 (frame_callback): If frames used is frames allocated, realloc.
2315 (print_frames): Show an error if maxframes has been reached.
2316 (parse_opt): Allow -n 0 for unlimited frames.
2317 (main): Document -n 0 and new default 2048 frames. Allocate initial
2318 number of frames with malloc.
2320 2013-12-30 Mark Wielaard <mjw@redhat.com>
2322 * stack.c (parse_opt): Explicitly call dwfl_linux_proc_attach
2323 or dwfl_core_file_attach and check for errors.
2325 2013-12-28 Mark Wielaard <mjw@redhat.com>
2327 * stack.c (print_frames): Remove address width code and use...
2328 (get_addr_width): ...this new function.
2329 (show_modules): New static boolean.
2330 (module_callback): New static function.
2331 (parse_opt): Handle '-l'.
2332 (main): Add 'l' to options. If show_modules then use dwfl_getmodules
2333 with module_callback to show all detected modules and possible
2334 build_id, elf and dwarf files.
2336 2013-12-27 Mark Wielaard <mjw@redhat.com>
2338 * stack.c (frames_shown): New static boolean.
2339 (EXIT_OK,EXIT_ERROR,EXIT_BAD,EXIT_USAGES): New defines.
2340 (frame_callback): Return -1 on error. Don't print error.
2341 (print_frames): Add arguments, tid, dwflerr and what. Print tid.
2342 If there was an error report it with address and module if possible.
2343 Record whether any frames were actually printed.
2344 (thread_callback): Collect tid and err, pass it to print_frames.
2345 (parse_opt): Use EXIT_BAD for errors. On ARGP_KEY_END print errno
2346 if dwfl_linux_proc_report returned it. Check whether we are properly
2347 attached with dwfl_pid.
2348 (main): Document exit status. Don't report DWARF_CB_ABORT from
2349 callbacks as error. Pass real errors to print_frames. Return
2350 EXIT_BAD if no frames could be shown. Return EXIT_ERROR if there
2351 were any non-fatal errors.
2353 2013-12-23 Mark Wielaard <mjw@redhat.com>
2355 * Makefile.am (stack_LDADD): Add demanglelib.
2356 * stack.c (show_quiet): New static boolean, default false.
2357 (show_raw): Likewise.
2358 (demangle_buffer_len): New static size_t.
2359 (demangle_buffer): New static char *.
2360 (print_frames): Don't resolve pc name if show_quiet. Demangle name
2362 (parse_opt): Handle '-q' and '-r'.
2363 (main): Add 'q' and 'r' to options. Free demangle_buffer.
2365 2013-12-23 Mark Wielaard <mjw@redhat.com>
2367 * stack.c (OPT_DEBUGINFO): New define.
2368 (OPT_COREFILE): Likewise.
2370 (core_fd): Likewise.
2373 (debuginfo_path): Likewise.
2374 (parse_opt): Handle '-p', '--core', '-e' and '--debuginfo-path'.
2375 Do argument sanity checking. Setup Dwfl.
2376 (main): Add 'p', 'core', 'e' and 'debuginfo-path' to options.
2377 Remove argp_child children, simplify argp doc, remove custom
2378 usage message and construction of dwfl with dwfl_standard_argp.
2379 Use pid directly as tid. close core and core_fd if opened. Print
2380 pid of process or core.
2382 2013-12-23 Mark Wielaard <mjw@redhat.com>
2384 * stack.c (show_build_id): New static boolean.
2385 (print_frames): Print module build-id, load address and pc offset
2386 if show_build_id is true.
2387 (parse_opt): Handle '-b'.
2388 (main): Add -b to options.
2390 2013-12-22 Mark Wielaard <mjw@redhat.com>
2392 * stack.c (maxframes): New static unsigned. Initialize to 64.
2393 (struct frame): New struct.
2394 (struct frames): Likewise.
2395 (dwfl): New static Dwfl pointer.
2396 (frame_callback): Use arg as struct frames and fill it next frame.
2397 Return DWARF_CB_ABORT when maxframes has been reached. Move
2398 printing of frame to...
2399 (print_frames): ...here. New function.
2400 (thread_callback): Use arg as struct frames and set frames to zero.
2402 (parse_opt): Handle '-n'.
2403 (main): Add -n to options. Allocate frames using maxframes. Pass
2404 frames to frame_callback and thread_callback.
2406 2013-12-20 Mark Wielaard <mjw@redhat.com>
2408 * stack.c (show_one_tid): New static boolean.
2409 (parse_opt): Handle '-1'.
2410 (main): Add -1 to options. Call dwfl_getthread_frames when
2411 show_one_tid is true.
2413 2013-12-18 Mark Wielaard <mjw@redhat.com>
2415 * addr2line.c (options): Add symbol-sections, 'x'.
2416 (show_symbol_sections): New static bool.
2417 (parse_opt): Handle 'x'.
2418 (print_addrsym): Use dwfl_module_addrinfo value.r
2419 Also show section of address with show_symbol_sections.
2420 (find_symbol): Use dwfl_module_getsym_info and set value.
2421 (handle_address): Request value and use it instead of sym.st_value.
2422 * readelf.c (format_dwarf_addr): Use dwfl_module_addrinfo to get
2425 2013-12-17 Masatake YAMATO <yamato@redhat.com>
2426 Mark Wielaard <mjw@redhat.com>
2428 * stack.c (show_activation, show_module, show_source): New variables.
2429 (parse_opt): Set show_activation if -a option is given.
2430 Set show_module if -m option is given. Set show_source if -s option
2431 is given. Set all show booleans when -v option is given.
2432 (main): Added `-a', `-m', `-s', and `-v' to the help message.
2433 (frame_callback): Print module and source file information.
2435 2013-11-25 Petr Machata <pmachata@redhat.com>
2437 * elflint.c (valid_e_machine): Add EM_AARCH64.
2439 2013-11-14 Petr Machata <pmachata@redhat.com>
2441 * readelf.c (handle_core_item) <'h'>: New branch for handling
2442 fields that shouldn't be displayed.
2444 2013-11-10 Mark Wielaard <mjw@redhat.com>
2446 * stack.c: Use ARGP_PROGRAM_VERSION_HOOK_DEF and
2447 ARGP_PROGRAM_BUG_ADDRESS_DEF.
2448 (print_version): New function.
2450 2013-11-09 Mark Wielaard <mjw@redhat.com>
2452 * arlib.c (arlib_init): Call snprintf before using the result
2454 (arlib_finalize): Likewise.
2455 * nm.c (show_symbols_sysv): Don't modify cnt inside assert.
2457 2013-11-07 Jan Kratochvil <jan.kratochvil@redhat.com>
2459 * Makefile.am (bin_PROGRAMS): Add stack.
2461 * stack.c: New file.
2463 2013-11-05 Mark Wielaard <mjw@redhat.com>
2465 * readelf.c (print_debug_ranges_section): Cast address to size_t
2467 (print_debug_loc_section): Likewise.
2469 2013-10-18 Mark Wielaard <mjw@redhat.com>
2471 * ar.c (main): Correct operation check when instance_specifed is set.
2473 2013-09-26 Petr Machata <pmachata@redhat.com>
2475 * readelf.c (handle_file_note): New function.
2476 (handle_notes_data): Call it to handle NT_FILE notes.
2478 2013-09-26 Petr Machata <pmachata@redhat.com>
2480 * readelf.c (handle_siginfo_note): New function.
2481 (handle_notes_data): Call it to handle NT_SIGINFO notes.
2482 (buf_read_int, buf_read_ulong, buf_has_data): New functions.
2484 2013-08-13 Mark Wielaard <mjw@redhat.com>
2486 * addr2line.c (options): Add "inlines", 'i'.
2487 (show_inlines): New bool.
2488 (parse_opt): Handle 'i'.
2489 (print_diesym): New static function.
2490 (print_src): New function taking code from...
2491 (handle_address): here. Call print_src. Print inlines.
2493 2013-08-12 Mark Wielaard <mjw@redhat.com>
2495 * addr2line.c (main): If there is a newline char at end of buf,
2498 2013-07-05 Mark Wielaard <mjw@redhat.com>
2500 * readelf.c (print_ops): Take CU as argument, use it to print
2501 parameter_ref DIE offset.
2502 (struct listptr): Replace base field with cu.
2503 (listptr_base): New function.
2504 (compare_listptr): Use listptr_base.
2505 (notice_listptr): Take CU as argument.
2506 (skip_listptr_hole): Likewise.
2507 (print_debug_ranges_section): Pass NULL as CU to skip_listptr_hole.
2508 (print_cfa_program): Pass NULL as CU to print_ops.
2509 (struct attrcb_args): Replace cu_base field with cu.
2510 (attr_callback): Pass cu not cu_base to notice_listptr.
2511 (print_debug_units): Don't calculate base, just set cu.
2512 (print_debug_loc_section): Pass cu to skip_listptr_hole and
2515 2013-05-06 Mark Wielaard <mjw@redhat.com>
2517 * readelf.c (print_ops): Format first DW_OP_GNU_implicit_pointer
2518 argument as DIE offset.
2520 2013-04-24 Mark Wielaard <mjw@redhat.com>
2522 * Makefile.am: Use AM_CPPFLAGS instead of INCLUDES.
2524 2013-03-25 Mark Wielaard <mjw@redhat.com>
2526 * readelf.c (argp_options): Add decodedline.
2527 (decodedline): New boolean initialized to false.
2528 (parse_opt): Set decodedline when arg is decodedline.
2529 (print_decoded_line_section): New function.
2530 (print_debug_line_section): Call print_decoded_line_section when
2531 decodedline is true.
2533 2013-03-25 Mark Wielaard <mjw@redhat.com>
2535 * readelf.c (argp_option): Add decodedaranges.
2536 (decodedaranges): New boolean initialized to false.
2537 (parse_opt): Set decodedaranges when arg is decodedaranges.
2538 (print_debug_aranges_section): Reimplemented and original
2539 implementation renamed to...
2540 (print_decoded_aranges_section): this.
2542 2013-03-25 Mark Wielaard <mjw@redhat.com>
2544 * readelf.c (attrcb_args): Add Dwarf_Die.
2545 (attr_callback): When highpc is in constant form also print as
2547 (print_debug_units): Set args.die.
2549 2013-03-19 Mark Wielaard <mjw@redhat.com>
2551 * readelf.c (print_gdb_index_section): Free format_dwarf_addr results.
2553 2013-03-18 Mark Wielaard <mjw@redhat.com>
2555 * readelf.c (print_gdb_index_section): Accept version 8.
2557 2013-03-01 Mark Wielaard <mjw@redhat.com>
2559 * findtextrel.c (process_file): Release ELF and close file when not
2560 text relocations are found.
2561 * strip.c (handle_elf): Track memory used for .debuglink section data
2564 2013-02-24 Mark Wielaard <mjw@redhat.com>
2566 * elflint.c (check_symtab): Add __bss_start__ to the list of symbols
2567 allowed to have out of section values because of GNU ld bugs.
2569 2013-02-06 Mark Wielaard <mjw@redhat.com>
2571 * elflint.c (check_symtab): Add __bss_start and __TMC_END__ to the
2572 list of symbols allowed to have out of section values because of
2573 GNU ld bugs in either .symtab or .dynsym, but only when they are
2576 2013-01-24 Mark Wielaard <mjw@redhat.com>
2578 * readelf.c (argp_option): Add unresolved-address-offsets, U.
2579 (print_unresolved_addresses): New static.
2580 (parse_opt): Handle 'U', set print_unprocessed_values.
2581 (format_dwarf_addr): Take and handle new raw argument.
2582 (print_ops): Call format_dwarf_addr with raw offset values.
2583 (print_debug_ranges_section): Likewise.
2584 (print_debug_frame_section): Likewise.
2585 (attr_callback): Likewise.
2586 (print_debug_line_section): Likewise.
2587 (print_debug_loc_section): Likewise.
2588 (print_gdb_index_section): Likewise.
2590 2013-01-18 Mark Wielaard <mjw@redhat.com>
2592 * readelf.c (struct listptr): Add base Dwarf_Addr field.
2593 (compare_listptr): Warn for same offset with different base.
2594 (notice_listptr): Take base argument and set it.
2595 (skip_listptr_hole): Likewise.
2596 (struct attrcb_args): Removed unused cu_offset field.
2597 Add cu_base Dwarf_Addr field.
2598 (attr_callback): Call notice_listptr with cbargs->cu_base.
2599 (print_debug_units): Set args.cu_base.
2600 (print_debug_ranges_section): Get base and use for format_dwarf_addr.
2601 (print_debug_loc_section): Likewise.
2603 2013-01-29 Jan Kratochvil <jan.kratochvil@redhat.com>
2605 * readelf.c (handle_core_items): Limit special repeated items handling
2606 to single-item formats '\n', 'b' and 'B', assert OFFSET 0 there.
2608 2012-12-18 Mark Wielaard <mark@bordewijk.wildebeest.org>
2610 * readelf.c (ELF_INPUT_SECTION): New argp key value.
2611 (argp_option): Add elf-section.
2612 (elf_input_section): New static.
2613 (parse_opt): Handle ELF_INPUT_SECTION and set elf_input_section.
2614 (open_input_section): New function.
2615 (process_file): Call open_input_section if elf_input_section set.
2617 2013-01-13 David Abdurachmanov <David.Abdurachmanov@cern.ch>
2619 ar.c (do_oper_delete): Fix num passed to memset.
2621 2012-12-21 Mark Wielaard <mjw@redhat.com>
2623 * readelf.c (print_debug_frame_section): Adjust FDE start address
2624 if pcrel before feeding it to format_dwarf_addr.
2626 2012-12-21 Mark Wielaard <mjw@redhat.com>
2628 * addr2line.c (main): Call dwfl_end.
2630 2012-12-11 Roland McGrath <roland@hack.frob.com>
2632 * nm.c (show_symbols_sysv): Fix size passed to snprintf for invalid
2634 Reported by David Abdurachmanov <David.Abdurachmanov@cern.ch>.
2636 2012-10-16 Mark Wielaard <mjw@redhat.com>
2638 * readelf.c (print_ops): DW_OP_skip and DW_OP_bra targets are
2639 calculated beginning after the operand and 2-byte constant.
2641 2012-10-12 Jan Kratochvil <jan.kratochvil@redhat.com>
2643 * readelf.c (ITEM_WRAP_COLUMN, REGISTER_WRAP_COLUMN): Merge to ...
2644 (WRAP_COLUMN): ... here.
2645 (print_core_item): Remove parameter format_max. Update function
2646 comment. Replace FORMAT_MAX by the real output width.
2647 (handle_core_item): Remove the FORMAT_MAX values in TYPES, DO_TYPE,
2648 calls of print_core_item, remove variable maxfmt, change
2649 ITEM_WRAP_COLUMN to WRAP_COLUMN.
2650 (handle_core_register): Remove the FORMAT_MAX values in TYPES, BITS,
2651 calls of print_core_item, change REGISTER_WRAP_COLUMN to WRAP_COLUMN.
2653 2012-10-11 Jan Kratochvil <jan.kratochvil@redhat.com>
2655 * readelf.c (handle_core_item) <b>: Make run an outer block variable.
2656 Increase run only if LASTBIT != 0. Print last element only if RUN > 0.
2658 2012-08-27 Mark Wielaard <mjw@redhat.com>
2660 * readelf.c (print_debug_macro_section): Print offset as PRIx64.
2662 2012-08-27 Mark Wielaard <mjw@redhat.com>
2664 * readelf.c (register_info): Handle loc == NULL.
2666 2012-08-22 Jeff Kenton <jkenton@tilera.com>
2668 * elflint.c (valid_e_machine): Add EM_TILEGX and EM_TILEPRO.
2670 2012-08-16 Mark Wielaard <mjw@redhat.com>
2672 * readelf.c (dwarf_tag_name): Renamed from dwarf_tag_string.
2673 Uses new dwarf_tag_string or adds ??? or lo_user+%#x when
2675 (dwarf_attr_name): Likewise.
2676 (dwarf_form_name): Likewise.
2677 (dwarf_lang_name): Likewise.
2678 (dwarf_inline_name): Likewise.
2679 (dwarf_encoding_name): Likewise.
2680 (dwarf_access_name): Likewise.
2681 (dwarf_visibility_name): Likewise.
2682 (dwarf_virtuality_name): Likewise.
2683 (dwarf_identifier_case_name): Likewise.
2684 (dwarf_calling_convention_name): Likewise.
2685 (dwarf_ordering_name): Likewise.
2686 (dwarf_discr_list_name): Likewise.
2687 (print_ops): Remove KNOWN. Use dwarf_locexpr_opcode_string.
2688 (attr_callback): Call new dwarf_foobar_name instead of old
2689 dwarf_foobar_string functions.
2690 (dwarf_tag_string): New function using known-dwarf.h macros.
2691 (dwarf_attr_string): Likewise.
2692 (dwarf_form_string): Likewise.
2693 (dwarf_lang_string): Likewise.
2694 (dwarf_inline_string): Likewise.
2695 (dwarf_encoding_string): Likewise.
2696 (dwarf_access_string): Likewise.
2697 (dwarf_visibility_string): Likewise.
2698 (dwarf_virtuality_string): Likewise.
2699 (dwarf_identifier_case_string): Likewise.
2700 (dwarf_calling_convention_string): Likewise.
2701 (dwarf_ordering_string): Likewise.
2702 (dwarf_discr_list_string): Likewise.
2703 (dwarf_locexpr_opcode_string): Likewise.
2705 2012-06-27 Mark Wielaard <mjw@redhat.com>
2707 * readelf.c (dwarf_form_string): Handle DW_FORM_GNU_ref_alt and
2708 DW_FORM_GNU_strp_alt.
2709 (attr_callback): Likewise.
2711 2012-07-30 Petr Machata <pmachata@redhat.com>
2713 * nm.c (show_symbols_bsd): Reorder arguments in {S,}FMTSTRS (and
2714 corresponding printf) so that those that are referenced by only
2715 one of the formatting strings are at the end.
2717 2012-07-29 Mark Wielaard <mjw@redhat.com>
2719 * readelf.c (dwarf_lang_string): Use DW_LANG_ObjC, not DW_LANG_Objc.
2720 (print_ops): Use known[op], not op_name, for DW_OP_GNU_parameter_ref.
2722 2012-07-19 Mark Wielaard <mjw@redhat.com>
2724 * readelf.c (print_ops): Handle DW_OP_GNU_parameter_ref.
2726 2012-07-11 Mark Wielaard <mjw@redhat.com>
2728 * readelf.c (options): Add macro to help of debug-dump.
2729 (section_e): Add section_macro.
2730 (section_all): Add section_macro.
2731 (parse_opt): Handle macro.
2732 (print_debug_macro_section): New function.
2733 (print_debug): Add NEW_SECTION (macro).
2735 2012-07-10 Mark Wielaard <mjw@redhat.com>
2737 * readelf.c (print_gdb_index_section): Add version 7 support.
2738 Keep track of cu_nr. Print kind and static/global flag for each
2739 symbol. When a symbol is in the TU list add 'T'.
2741 2012-06-26 Mark Wielaard <mjw@redhat.com>
2743 * readelf.c (dwarf_attr_string): Add DW_AT_GNU_macros.
2745 2012-06-22 Mark Wielaard <mjw@redhat.com>
2747 * readelf.c (print_ops): Cast printf PRIu/x64 arguments to uint64_t
2748 for gcc 4.7 -Wformat.
2750 2012-05-09 Roland McGrath <roland@hack.frob.com>
2752 * elflint (check_sections): Allow zero sized sections at (filesz) end
2753 of segment. And make check overflow-proofed.
2755 2012-04-24 Mark Wielaard <mjw@redhat.com>
2757 * readelf.c (print_ops): Add DW_OP_GNU_push_tls_address,
2758 DW_OP_GNU_uinit and DW_OP_GNU_encoded_addr.
2760 2012-03-28 Roland McGrath <roland@hack.frob.com>
2762 * elflint.c (special_sections): Accept SHF_INFO_LINK for reloc sections.
2764 2012-03-28 Mark Wielaard <mjw@redhat.com>
2766 * readelf.c (print_debug_abbrev_section): Check there is Dwarf
2768 (print_debug_str_section): Likewise.
2770 2012-03-21 Mark Wielaard <mjw@redhat.com>
2772 * readelf.c (print_gdb_index_section): Accept version 6.
2774 2012-01-31 Mark Wielaard <mjw@redhat.com>
2776 * readelf.c (attr_callback): Don't special case DW_FORM_sec_offset.
2778 2012-01-21 Ulrich Drepper <drepper@gmail.com>
2780 * addr2line.c: Update copyright year.
2782 * elfcmp.c: Likewise.
2783 * elflint.c: Likewise.
2784 * findtextrel.c: Likewise.
2787 * objdump.c: Likewise.
2788 * ranlib.c: Likewise.
2789 * readelf.c: Likewise.
2791 * strings.c: Likewise.
2792 * strip.c: Likewise.
2793 * unstrip.c: Likewise.
2795 * nm.c (argp_children): Define.
2796 (argp): Hook up argp_children.
2797 (handle_ar): Optimize puts call.
2798 (show_symbols_bsd): Use positional parameters to also print color
2799 codes. Don't print STT_FILE symbols.
2800 * objdump.c (options): Improve help text.
2801 (argp_children): Define.
2802 (argp): Hook up argp_children.
2803 (disasm_info): Add elements for color codes.
2804 (disasm_output): Print color codes as well.
2805 (show_disasm): Set up disasm_info data for callback.
2807 2012-01-20 Roland McGrath <roland@hack.frob.com>
2809 * arlib-argp.c (arlib_deterministic_output): Initialize from
2811 (help_filter): New function.
2814 * ar.c (main): Handle oper_none as usage error.
2816 * arlib-argp.c (options, parse_opt): Grok -U as inverse of -D.
2818 * ranlib.c (argp): Use arlib_argp_children.
2820 * arlib.c (arlib_init): Obey arlib_deterministic_output.
2822 * arlib-argp.c: New file.
2823 * Makefile.am (libar_a_SOURCES): Add it.
2824 * arlib.h (arlib_deterministic_output, arlib_argp_children):
2825 Declare new variables.
2826 * ar.c (deterministic_output): Variable removed.
2827 (do_oper_insert): Use arlib_deterministic_output instead.
2828 (options, parse_opt): Don't handle -D here. Add group numbers.
2829 (argp): Use arlib_argp_children.
2831 2011-12-20 Roland McGrath <roland@hack.frob.com>
2833 * readelf.c (print_debug): Initialize DUMMY_DBG.elf.
2834 Reported by Karel Klic <kklic@redhat.com>.
2836 2011-11-05 Roland McGrath <roland@hack.frob.com>
2838 * ar.c (deterministic_output): New flag variable.
2839 (options, parse_opt): Grok -D to set it.
2840 (do_oper_insert): When set, use zero from mtime, uid, and gid.
2842 * ar.c (do_oper_insert): Fix check on elf_rawfile return value.
2844 2011-10-04 Marek Polacek <mpolacek@redhat.com>
2846 * readelf.c (register_info): Assume the right size of an array.
2848 2011-10-03 Ulrich Drepper <drepper@gmail.com>
2850 * nm.c: Recognize option --mark-special. Still recognize --mark-weak
2851 but don't show it in help anymore.
2852 (mark_special): Renamed from mark_weak.
2853 (parse_opt): Adjust.
2854 (class_type_char): Take additional parameters for ELF file and ELF
2855 header. Treat TLS symbols like objects.
2856 In case of D symbols, show u for unique symbols, R for symbols in
2857 read-only sections, B for symbols in BSS sections.
2858 (show_symbols_bsd): Take additional parameters for ELF file and ELF
2859 header. Adjust for class_type_char change. Show TLS symbols with
2860 @ after them in case --mark-special is selected.
2861 (show_symbols_posix): Likewise.
2862 (show_symbols): Adjust calls to show_symbols_bsd and
2864 (show_symbols_sysv): Avoid printing address and size for undefined
2865 symbols. Don't print initial special entry and section entries.
2867 2011-10-02 Ulrich Drepper <drepper@gmail.com>
2869 * Makefile.am (demanglelib): Define.
2870 (nm_LDADD): Add demanglelib.
2871 * nm.c (options): Add -C option.
2872 (demangle): Define as global variable.
2873 (parse_opt): Recognize -C.
2874 (show_symbols_sysv): Handle demangling.
2875 (show_symbols_bad): Likewise.
2876 (show_symbols_posix): Likewise.
2877 (show_symbols): Likewise.
2879 2011-07-09 Roland McGrath <roland@hack.frob.com>
2881 * readelf.c (options, parse_opt): Grok -W/--wide and ignore it.
2883 * ar.c (parse_opt): Grok -u.
2885 2011-05-30 Mark Wielaard <mjw@redhat.com>
2887 * strip.c (relocate): Make offset check overflow-proof.
2889 2011-05-23 Mark Wielaard <mjw@redhat.com>
2891 * strip.c (relocate): Take new arguments is_rela to indicate
2892 whether the relocation is from a SHT_REL or SHT_RELA section.
2893 Relocate against any debug section symbol, not just STT_SECTION
2894 symbols. For SHT_REL relocations, fetch addend from offset and
2895 add it to symbol value if not zero.
2897 2011-05-23 Mark Wielaard <mjw@redhat.com>
2899 * strip.c (OPT_RELOC_DEBUG): New option.
2900 (argp_option): Add new --reloc-debug-sections option.
2901 (main): Check new option.
2902 (parse_opt): Likewise.
2903 (handle_elf): Remove any relocations between debug sections
2904 in ET_REL for the debug file when requested.
2906 2011-05-18 Mark Wielaard <mjw@redhat.com>
2908 * strip.c (handle_elf): Make sure all sections of a removed group
2909 section are removed too. Don't discard SHT_GROUP sections, copy
2910 section table before it gets modified. Section group signature
2911 symbols don't have to be retained.
2913 2011-05-16 Jakub Jelinek <jakub@redhat.com>
2915 * readelf.c (print_ops): Handle DW_OP_GNU_const_type,
2916 DW_OP_GNU_regval_type, DW_OP_GNU_deref_type, DW_OP_GNU_convert
2917 and DW_OP_GNU_reinterpret.
2919 2011-05-17 Mark Wielaard <mjw@redhat.com>
2921 * readelf.c (dwarf_tag_string): Fixup DW_TAG_GNU_call_site and
2922 DW_TAG_GNU_call_site_parameter return strings.
2924 2011-05-11 Marek Polacek <mpolacek@redhat.com>
2926 * nm.c (show_symbols_sysv): Remove unused if/else, remove
2927 unused `prefix' and `fname' parameters.
2929 2011-05-07 Marek Polacek <mpolacek@redhat.com>
2931 * unstrip.c (compare_sections_nonrel): Mark this function as static.
2933 2011-04-26 Mark Wielaard <mjw@redhat.com>
2935 * readelf.c (handle_notes_data): Call ebl_object_note_type_name
2938 2011-04-14 Mark Wielaard <mjw@redhat.com>
2940 * readelf.c (options): Add gdb_index.
2941 (section_e): Define section_gdb_index.
2942 (parse_opt): Recognize gdb_index debug-dump argument.
2943 (print_gdb_index_section): New function.
2944 (print_debug): Add gdb_index to debug_sections.
2946 2011-03-24 Petr Machata <pmachata@redhat.com>
2948 * readelf.c (print_debug_line_section): Emit initial space for all
2949 opcode lines. Print offset in front of each opcode.
2951 2011-03-22 Marek Polacek <mpolacek@redhat.com>
2953 * readelf.c (handle_dynamic): Don't segfault at DT_PLTREL case.
2955 2011-03-22 Mark Wielaard <mjw@redhat.com>
2957 * readelf.c (dwarf_tag_string): Support DW_TAG_GNU_call_site
2958 and DW_TAG_GNU_call_site_parameter.
2959 (dwarf_attr_string): Support DW_AT_GNU_call_site_value,
2960 DW_AT_GNU_call_site_data_value,
2961 DW_AT_GNU_call_site_target,
2962 DW_AT_GNU_call_site_target_clobbered,
2963 DW_AT_GNU_tail_call,
2964 DW_AT_GNU_all_tail_call_sites,
2965 DW_AT_GNU_all_call_sites,
2966 and DW_AT_GNU_all_source_call_sites.
2967 (print_ops): Handle DW_OP_GNU_entry_value.
2968 (attr_callback): Handle DW_AT_GNU_call_site_value,
2969 DW_AT_GNU_call_site_data_value,
2970 DW_AT_GNU_call_site_target,
2971 and DW_AT_GNU_call_site_target_clobbered.
2973 2011-03-10 Mark Wielaard <mjw@redhat.com>
2975 * elflint.c (check_symtab): Use ebl_check_st_other_bits.
2977 2011-02-27 Jan Kratochvil <jan.kratochvil@redhat.com>
2979 * readelf.c (reset_listptr): Clear TABLE->TABLE.
2981 2011-02-25 Mark Wielaard <mjw@redhat.com>
2983 * readelf.c (dwarf_attr_string): Add DW_AT_GNU_* handling.
2984 (dwarf_form_string): Properly format and return unknown form.
2986 2011-02-23 Roland McGrath <roland@redhat.com>
2988 * readelf.c (section_name): New function.
2989 (print_debug_abbrev_section): Use it instead of constant.
2990 (print_debug_aranges_section): Likewise.
2991 (print_debug_ranges_section): Likewise.
2992 (print_debug_units): Likewise.
2993 (print_debug_line_section): Likewise.
2994 (print_debug_loc_section): Likewise.
2995 (print_debug_macinfo_section): Likewise.
2996 (print_debug_pubnames_section): Likewise.
2997 (print_debug_str_section): Likewise.
2998 (print_debug) [USE_ZLIB]: Match .zdebug_* sections too.
2999 (print_debug_abbrev_section): Use decoded d_size, not sh_size.
3000 (print_debug_str_section): Likewise.
3002 * readelf.c (dwarf_attr_string): Grok DW_AT_GNU_odr_signature.
3004 2011-02-11 Roland McGrath <roland@redhat.com>
3006 * elfcmp.c (verbose): New variable.
3007 (options, parse_opt): Grok -l/--verbose to set it.
3008 (main): Under -l, keep going after first difference.
3010 * elfcmp.c (ignore_build_id): New variable.
3011 (options, parse_opt): Grok --ignore-build-id to set it.
3012 (main): For SHT_NOTE sections, compare note details rather than raw
3013 bytes. Under --ignore-build-id, don't complain about differing build
3014 ID contents if lengths match.
3016 2011-02-08 Roland McGrath <roland@redhat.com>
3018 * ldscript.y (filename_id_star): Remove unused variable.
3020 * unstrip.c (copy_elided_sections): Remove unused variable.
3022 * elflint.c (check_dynamic): Remove unused variables.
3024 * elflint.c (check_symtab): Warn about missing xndx section only once.
3026 * ldgeneric.c (check_for_duplicate2): Remove unused variable.
3028 2011-01-06 Roland McGrath <roland@redhat.com>
3030 * strip.c (handle_elf): Under --strip-sections, remove all
3031 non-allocated sections and never generate .gnu_debuglink.
3033 2011-01-04 Roland McGrath <roland@redhat.com>
3035 * strip.c (remove_shdrs): New variable.
3036 (options, parse_opt): Grok --strip-sections to set it.
3037 (handle_elf): When that's set, truncate off .shstrtab and shdrs.
3039 2010-11-10 Roland McGrath <roland@redhat.com>
3041 * findtextrel.c (process_file): Don't assume order of sections.
3042 Reported by Mike Hommey <mh@glandium.org>.
3044 2010-07-26 Roland McGrath <roland@redhat.com>
3046 * readelf.c (print_ops): Handle DW_OP_GNU_implicit_pointer.
3048 2010-08-30 Roland McGrath <roland@redhat.com>
3050 Print .debug_loc/.debug_ranges with cognizance of actual DIE uses.
3051 * readelf.c (parse_opt): Add section_info to implicit_debug_sections
3053 (struct listptr, struct listptr_table): New types.
3054 (compare_listptr, reset_listptr, sort_listptr): New functions.
3055 (notice_listptr, skip_listptr_hole): New functions.
3056 (struct attrcb_args): Add silent member.
3057 (attr_callback): Call notice_listptr for loclistptr and rangelistptr.
3058 Suppress output if silent, but still call notice_listptr.
3059 (print_debug_units): Suppress output if section_info not requested.
3060 (print_debug_loc_section): Call sort_listptr, skip_listptr_hole.
3061 (print_debug_ranges_section): Likewise.
3062 (print_debug): Call reset_listptr on both tables.
3064 * readelf.c (print_debug_ranges_section): Print empty list.
3065 (print_debug_loc_section): Likewise.
3067 * readelf.c (print_debug_loc_section): Check for bogus length
3068 before calling print_ops.
3069 (print_ops): Check harder for bogus data that would read off end.
3071 2010-08-11 Roland McGrath <roland@redhat.com>
3073 * readelf.c (for_each_section_argument): Process all sections with
3074 matching name, not just the first.
3076 2010-07-26 Roland McGrath <roland@redhat.com>
3078 * readelf.c (print_ops): Take new argument for CU version.
3079 Fix DW_OP_call_ref decoding to depend on it.
3080 (print_debug_loc_section): Update caller.
3081 (print_cfa_program): Take new argument, pass it down.
3082 (print_debug_frame_section): Update caller.
3083 (struct attrcb_args): New member version.
3084 (print_debug_units): Initialize it.
3086 2010-07-02 Roland McGrath <roland@redhat.com>
3088 * readelf.c (print_debug_frame_section): Use format_dwarf_addr for
3091 2010-06-30 Roland McGrath <roland@redhat.com>
3093 * strings.c (main): Use STDIN_FILENO, not STDOUT_FILENO.
3094 Ignore st_size for a non-S_ISREG file descriptor.
3095 (read_block): Move assert after no-mmap bail-out.
3096 (read_block_no_mmap): Fix size calculations for moving buffer remnant.
3098 2010-06-22 Roland McGrath <roland@redhat.com>
3100 * readelf.c (print_debug_line_section): Fix braino in DW_LNS_set_isa.
3102 2010-06-21 Roland McGrath <roland@redhat.com>
3104 * readelf.c (dwarf_tag_string): Handle new v4 tags.
3105 (dwarf_attr_string): Add new attributes.
3106 (dwarf_tag_string): Handle DW_TAG_GNU_*.
3108 * readelf.c (print_ops): Use 64-bit types for LEB128 operands.
3109 (print_cfa_program): Likewise.
3111 2010-06-20 Roland McGrath <roland@redhat.com>
3113 * readelf.c (print_debug_units): New function, broken out of ...
3114 (print_debug_info_section): ... here. Call it.
3115 (print_debug_types_section): New function.
3116 (enum section_e): Add section_types alias for section_info.
3117 (print_debug): Add types to the sections table.
3119 * readelf.c (print_debug_frame_section): Handle version 4 format.
3121 * readelf.c (print_debug_line_section): Handle version 4 format.
3123 2010-06-14 Roland McGrath <roland@redhat.com>
3125 * unstrip.c (copy_elided_sections): Make sure all sections' data have
3126 been read in before we write anything out.
3128 2010-06-04 Roland McGrath <roland@redhat.com>
3130 * unstrip.c (update_shdr): New function.
3131 (update_sh_size): Call it instead of gelf_update_shdr.
3132 (adjust_relocs, add_new_section_symbols): Likewise.
3133 (new_shstrtab, copy_elided_sections): Likewise.
3135 * unstrip.c (copy_elided_sections): Bail if stripped file has more
3136 sections than unstripped file, rather than getting confused later.
3138 2010-06-01 Roland McGrath <roland@redhat.com>
3140 * readelf.c (dwarf_form_string): Handle DWARF 4 forms.
3141 (attr_callback): Handle DW_FORM_flag_present, DW_FORM_exprloc,
3142 DW_FORM_sec_offset, DW_FORM_ref_sig8.
3144 * readelf.c (print_debug): Don't bail if libdw setup fails.
3145 Suppress complaint if we only want .eh_frame anyway.
3147 2010-05-28 Ulrich Drepper <drepper@redhat.com>
3149 * readelf.c (attr_callback): Also print form information.
3151 2010-05-19 Roland McGrath <roland@redhat.com>
3153 * addr2line.c (find_symbol): Short-circuit on empty name.
3154 (handle_address): Handle SYMBOL with no +OFFSET.
3156 2010-05-08 Roland McGrath <roland@redhat.com>
3158 * readelf.c (print_ops): Take new arg OFFSET_SIZE.
3159 Use that for DW_OP_call_ref, not ADDRSIZE.
3160 (print_cfa_program): Update caller.
3161 (struct attrcb_args): Add offset_size field.
3162 (attr_callback): Use it for print_ops call.
3163 (print_debug_info_section): Initialize it.
3164 (print_ops): Likewise.
3166 2010-04-14 Roland McGrath <roland@redhat.com>
3168 * readelf.c (handle_core_item): Fix bitmask printing.
3170 2010-04-06 Roland McGrath <roland@redhat.com>
3172 * ld.c (options): Fix some typos in messages.
3173 * elflint.c (check_scn_group, check_group): Likewise.
3174 * ldscript.y (add_id_list): Likewise.
3175 * readelf.c (print_hash_info): Add xgettext:no-c-format magic comment
3176 before translated string containing a literal %.
3178 2010-02-26 Roland McGrath <roland@redhat.com>
3180 * readelf.c (process_file): Don't leak an fd in failure case.
3182 2010-02-15 Roland McGrath <roland@redhat.com>
3184 * Makefile.am: Use config/eu.am for common stuff.
3186 * readelf.c (print_debug_frame_section): Add a cast to avoid sign
3187 mismatch in comparison.
3189 2010-02-02 Roland McGrath <roland@redhat.com>
3191 * readelf.c (print_encoding_base): Handle DW_EH_PE_absptr (zero).
3192 (read_encoded): Likewise.
3193 (print_debug_frame_section): Check for bogus augmentation length.
3194 For P augmentation, use read_encoded, print the encoding description,
3195 and use hex for unsigned values.
3197 2010-01-15 Roland McGrath <roland@redhat.com>
3199 * ar.c: Include <sys/stat.h>.
3200 * elflint.c: Likewise.
3201 * readelf.c: Likewise.
3202 * strip.c: Likewise.
3203 * unstrip.c: Likewise
3205 2010-01-07 Roland McGrath <roland@redhat.com>
3207 * readelf.c (print_ehdr): Handle PN_XNUM.
3208 (phnum): New static variable.
3209 (process_elf_file): Set it with elf_getphdrnum.
3210 (print_phdr): Use phnum instead of EHDR->e_phnum.
3211 (print_dynamic, handle_notes): Likewise.
3212 (handle_relocs_rel, handle_relocs_rela): Likewise.
3214 * elfcmp.c (main): Use elf_getshdrnum and elf_getphdrnum.
3216 * elflint.c (phnum): New static variable.
3217 (check_elf_header): Set it, handling PN_XNUM.
3218 Use that in place of EHDR->e_phnum throughout.
3219 (check_symtab, check_reloc_shdr, check_dynamic): Likewise.
3220 (unknown_dependency_p, check_sections, check_program_header): Likewise.
3222 2010-01-05 Roland McGrath <roland@redhat.com>
3224 * readelf.c (dwarf_attr_string): Match DW_AT_GNU_vector and
3225 DW_AT_GNU_template_name.
3227 2010-01-04 Roland McGrath <roland@redhat.com>
3229 * readelf.c (handle_notes_data): Grab NT_AUXV only for name "CORE".
3230 (handle_core_note): Pass NHDR and NAME to ebl_core_note.
3231 (handle_core_item): Handle .format of '\n' as \n-separated strings.
3233 * readelf.c (implicit_debug_sections): New variable.
3234 (parse_opt): Set it instead of print_debug_sections for -a.
3235 OR them together for print_debug check.
3236 (print_debug): OR them together for section check.
3238 * readelf.c (options): Repartition into set implied by -a and others.
3239 Correct -a text to match reality.
3241 * readelf.c (struct section_argument): Add bool member 'implicit'.
3242 (parse_opt): Set it for -a cases, clear it for -x args.
3243 (for_each_section_argument): Don't complain about a missing section by
3244 name if it's implicit.
3246 2009-11-16 Roland McGrath <roland@redhat.com>
3248 * readelf.c (print_string_section): Punt SHT_NOBITS like empty
3249 sections, just as dump_data_section already does.
3251 2009-09-21 Ulrich Drepper <drepper@redhat.com>
3253 * elflint.c (special_sections): Allow MERGE and STRINGS flags to be
3254 set for .comment section.
3255 Patch by Mark Wielaard <mjw@redhat.com>.
3257 2009-09-08 Roland McGrath <roland@redhat.com>
3259 * ar.c (main): Fix typo in message format.
3261 2009-08-21 Roland McGrath <roland@redhat.com>
3263 * readelf.c (attr_callback): Use print_block only when we don't use
3266 2009-08-14 Roland McGrath <roland@redhat.com>
3268 * ar.c (do_oper_extract): Use pathconf instead of statfs.
3270 2009-08-01 Ulrich Drepper <drepper@redhat.com>
3272 * debugpred.h: Add two most const.
3274 2009-07-26 Mark Wielaard <mjw@redhat.com>
3276 * elflint.c (check_note_data): Recognize NT_GNU_GOLD_VERSION.
3278 2009-07-25 Mark Wielaard <mjw@redhat.com>
3280 * Makefile.am (addr2line_LDADD): Add $(libelf).
3282 2009-07-24 Roland McGrath <roland@redhat.com>
3284 * readelf.c (print_block): New function.
3285 (print_ops): Use it.
3286 (attr_callback): Use it for DW_FORM_block* forms.
3288 2009-07-20 Mark Wielaard <mjw@redhat.com>
3290 * readelf.c (print_ops): Add handling of DW_OP_implicit_value
3291 and DW_OP_stack_value.
3293 2009-07-14 Ulrich Drepper <drepper@redhat.com>
3295 * elflint.c (check_elf_header): Allow Linux ABI.
3296 (check_symtab): Handle STB_GNU_UNIQUE.
3298 2009-07-08 Mark Wielaard <mjw@redhat.com>
3300 * readelf.c (attr_callback): Handle DW_Form constants for
3301 DW_AT_data_member_location.
3303 2009-07-06 Roland McGrath <roland@redhat.com>
3305 * readelf.c (register_info): New function. Handle unknown register #s.
3306 (print_cfa_program): Use it.
3307 (handle_core_register, handle_core_registers): Likewise.
3309 2009-06-28 Roland McGrath <roland@redhat.com>
3311 * readelf.c (print_address_names): New static variable.
3312 (options, parse_opt): Grok -N/--numeric-addresses to clear it.
3313 (format_dwarf_addr): Don't look up name if !print_address_names.
3315 2009-06-13 Ulrich Drepper <drepper@redhat.com>
3317 * ldgeneric.c: Don't use deprecated libelf functions.
3319 * objdump.c: Likewise.
3320 * readelf.c: Likewise.
3322 * strip.c: Likewise.
3323 * unstrip.c: Likewise.
3324 * ld.h: Fix up comment.
3326 2009-06-01 Ulrich Drepper <drepper@redhat.com>
3328 * readelf.c (print_relocs): Expect ELF header argument and pass on
3329 to handle_relocs_rel* functions. Adjust caller.
3330 (handle_relocs_rel): Add ELF header argument. Add special case for
3331 the IRELATIVE relocations in statically linked executables.
3332 (handle_relocs_rela): Likewise.
3334 2009-04-29 Ulrich Drepper <drepper@redhat.com>
3336 * elflint.c (check_symtab): Add tests of st_other field.
3338 2009-04-23 Ulrich Drepper <drepper@redhat.com>
3340 * Makefile [BUILD_STATIC] (libdw): Add $(zip_LIBS).
3342 2009-04-20 Roland McGrath <roland@redhat.com>
3344 * addr2line.c (print_dwarf_function): Honor -s and -A for file names
3345 of inline call sites.
3347 * addr2line.c (just_section): New variable.
3348 (adjust_to_section): New function, broken out of ...
3349 (handle_address): ... here.
3350 (options, parse_opt): Add -j/--section=NAME to set it.
3352 2009-04-15 Roland McGrath <roland@redhat.com>
3354 * readelf.c (print_debug_frame_section): Check for DW_CIE_ID_64 in
3355 64-bit format header, DW_CIE_ID_32 in 32-bit format header.
3357 2009-04-14 Roland McGrath <roland@redhat.com>
3359 * readelf.c (print_attributes): Treat SHT_ARM_ATTRIBUTES on EM_ARM
3360 like SHT_GNU_ATTRIBUTES.
3362 * readelf.c (handle_core_registers): Fix error message.
3364 * strip.c (handle_elf: check_preserved): Don't note any change when
3365 .debug_data is already filled from a previous pass.
3367 2009-02-05 Ulrich Drepper <drepper@redhat.com>
3369 * objdump.c (show_relocs_x): Minor cleanups.
3371 * readelf.c (print_cfa_program): Correct a few labels.
3372 Print first DW_CFA_expression and DW_CFA_val_expression parameter
3375 2009-02-01 Ulrich Drepper <drepper@redhat.com>
3377 * objdump.c (show_relocs_rel, show_relocs_rela): Split common parts
3379 (show_relocs_x): ...here. New function.
3380 (show_relocs): Better spacing in output.
3382 * objdump.c (show_relocs_rela): Show offsets as signed values.
3384 * ar.c (main): Fix recognition of invalid modes for a, b, i modifiers.
3385 Improve some error messages.
3386 Use program_invocation_short_name instead of AR macro.
3387 * Makefile.am (CFLAGS_ar): Remove.
3388 * elflint.c (parse_opt): ARGP_HELP_EXIT_ERR does nothing for argp_help.
3389 * objdump.c (parse_opt): Likewise.
3390 * readelf.c (parse_opt): Likewise.
3392 2009-01-27 Roland McGrath <roland@redhat.com>
3394 * readelf.c (print_ops): Notice short length, don't overrun buffer
3395 (still need to fix LEB128).
3397 * readelf.c (print_ops): Fix DW_OP_call[24] decoding.
3399 * readelf.c (print_ops): Print (empty)\n when LEN == 0.
3401 2009-01-24 Ulrich Drepper <drepper@redhat.com>
3403 * readelf.c (print_debug_frame_section): Fix computation of vma_base
3404 for PC-relative mode.
3406 2009-01-23 Ulrich Drepper <drepper@redhat.com>
3408 * size.c (process_file): When handling archive, close file descriptor
3409 here. For unknown file format also close file descriptor.
3410 (handle_ar): Don't close file descriptor here.
3412 * readelf.c (parse_opt): Move code to add to dump_data_sections and
3413 string_sections list in local function add_dump_section. Adjust 'x'
3414 key handling. For 'a' key add .strtab, .dynstr, and .comment section
3415 to string_sections list.
3417 2009-01-22 Roland McGrath <roland@redhat.com>
3419 * readelf.c (print_phdr): Don't print section mapping when no sections.
3421 * Makefile.am (AM_CFLAGS): Pass -Wno-format for *_no_Wformat.
3423 * readelf.c (print_debug_frame_section): Initialize IS_SIGNED to false
3424 and reset it only for the 'true' cases.
3426 * Makefile.am (addr2line_no_Wformat): New variable.
3428 * readelf.c (print_debug_frame_section): Use t instead of j formats
3429 for ptrdiff_t OFFSET.
3431 2009-01-21 Ulrich Drepper <drepper@redhat.com>
3433 * elflint.c (check_program_header): Fix typo in .eh_frame_hdr section
3434 test. Handle debuginfo files.
3435 (check_exception_data): First sanity test.
3437 2009-01-17 Ulrich Drepper <drepper@redhat.com>
3439 * readelf.c (print_debug_exception_table): Show target of ar_disp
3442 * elflint.c (check_program_header): Add most consistency checks for
3443 PT_GNU_EH_FRAME entry.
3445 * addr2line.c: Use ARGP_PROGRAM_VERSION_HOOK_DEF and
3446 ARGP_PROGRAM_BUG_ADDRESS_DEF.
3448 * elfcmp.c: Likewise.
3449 * elflint.c: Likewise.
3450 * findtextrel.c: Likewise.
3453 * objdump.c: Likewise.
3454 * ranlib.c: Likewise.
3455 * readelf.c: Likewise.
3458 * strings.c: Likewise.
3459 * strip.c: Likewise.
3460 * unstrip.c: Likewise.
3462 2009-01-16 Ulrich Drepper <drepper@redhat.com>
3464 * elflint.c (check_program_header): Check that PT_GNU_EH_FRAME entry
3465 matches .eh_frame_hdr section, if it is available. Also check that
3466 the segment is allocated, not writable, not executable.
3468 * readelf.c: Add -e option. Dump exception and unwind related
3469 sections. Add -e to -a.
3470 (print_encoding_base): Handle DW_EH_PE_omit.
3471 (print_debug_exception_table): Beginning of support.
3472 (print_debug): Hook up print_debug_exception_table for
3473 .gcc_except_table sections.
3475 * readelf.c (print_debug_frame_section): Some fixes for last change.
3477 2009-01-15 Ulrich Drepper <drepper@redhat.com>
3479 * readelf.c (print_encoding): Now a toplevel function.
3480 (print_relinfo): Likewise.
3481 (print_encoding_base): Broken out of print_debug_frame_section.
3482 (print_debug_frame_section): Print different header for .eh_frame
3483 sections. Fix recognition of matching CIEs in .debug_frame sections.
3484 Print absolute offset for PC-relative FDE locations. Don't print
3485 table header for FDEs if the table is empty.
3486 (read_encoded): New function.
3487 (print_debug_frame_hdr_section): New function.
3488 (print_debug): Hook up print_debug_frame_hdr_section for .eh_frame_hdr
3491 * readelf.c (handle_relocs_rel): Print section number.
3492 (print_debug_abbrev_section): Likewise.
3493 (print_debug_aranges_section): Likewise.
3494 (print_debug_ranges_section): Likewise.
3495 (print_debug_info_section): Likewise.
3496 (print_debug_line_section): Likewise.
3497 (print_debug_loc_section): Likewise.
3498 (print_debug_macinfo_section): Likewise.
3499 (print_debug_pubnames_section): Likewise.
3500 (print_debug_str_section): Likewise.
3502 2009-01-10 Ulrich Drepper <drepper@redhat.com>
3504 * strings.c (read_block): Fix typo in error message string.
3506 2009-01-07 Ulrich Drepper <drepper@redhat.com>
3508 * ld.c (ld_new_searchdir): Fix adding to search path list.
3510 2009-01-06 Ulrich Drepper <drepper@redhat.com>
3512 * readelf.c: Implement call frame debug section dumping.
3514 2009-01-05 Roland McGrath <roland@redhat.com>
3516 * elfcmp.c: Exit with status 2 for errors (like cmp, diff, grep).
3517 Status 1 (aka EXIT_FAILURE) is only for completed OK but not equal.
3519 2009-01-01 Ulrich Drepper <drepper@redhat.com>
3521 * addr2line.c: Update copyright year.
3523 * elfcmp.c: Likewise.
3524 * elflint.c: Likewise.
3525 * findtextrel.c: Likewise.
3528 * objdump.c: Likewise.
3529 * ranlib.c: Likewise.
3530 * readelf.c: Likewise.
3532 * strings.c: Likewise.
3533 * strip.c: Likewise.
3534 * unstrip.c: Likewise.
3536 2008-12-11 Roland McGrath <roland@redhat.com>
3538 * nm.c (sym_name): New function.
3539 (show_symbols_sysv): Use it in place of elf_strptr.
3540 (show_symbols_bsd, show_symbols_posix): Likewise.
3543 * nm.c (show_symbols_sysv): Use an alloca'd backup section name when
3546 2008-12-02 Roland McGrath <roland@redhat.com>
3548 * readelf.c (count_dwflmod, process_file): Don't presume encoding of
3549 nonzero OFFSET argument to dwfl_getmodules.
3551 2008-08-07 Roland McGrath <roland@redhat.com>
3553 * addr2line.c (main): Pass string to handle_address.
3554 (see_one_module): New function, subroutine of handle_address.
3555 (find_symbol): Likewise.
3556 (handle_address): Take string argument rather than address.
3557 Convert plain number, or handle strings like "(section)+offset"
3560 2008-08-01 Roland McGrath <roland@redhat.com>
3562 * readelf.c (handle_core_item): Handle 'B' type for 1-origin bitset.
3563 For 'b' and 'B', print <x-y,z> or ~<x,y-z> rather than 1/0 string.
3565 * readelf.c (convert): Take new argument SIZE.
3566 (handle_core_register, handle_core_item): Update callers.
3567 (handle_core_item): Take new arg REPEATED_SIZE.
3568 (handle_core_items): Special case for a singleton item,
3569 let handle_core_item handle repeats if it wants to.
3571 * readelf.c (handle_core_items): Give abridged output
3572 for identical groups repeated more than twice.
3574 2008-07-04 Roland McGrath <roland@redhat.com>
3576 * readelf.c (handle_core_items): Handle ELF_T_ADDR.
3578 2008-04-10 Roland McGrath <roland@redhat.com>
3580 * strip.c (handle_elf): Don't keep sections that kept symbol tables
3581 refer to. Instead, just be sure to preserve the original symbol
3582 table in the debug file so those symbols go with their sections and
3583 can be elided from the stripped version of the symbol table.
3585 * strip.c (handle_elf): When a discarded section kept in the debug
3586 file refers to a nondiscard section via sh_link/sh_info, preserve
3587 that nondiscarded section unmodified in the debug file as well.
3588 Skip adjustment of discarded sections symbol table references when
3589 that symbol table is copied in this way.
3591 * elflint.c (check_symtab): Don't crash from missing symbol names
3592 after diagnosing bogus strtab.
3594 * strip.c (handle_elf): Cosmetic cleanup in special section contents
3595 adjustment for symtab changes.
3597 2008-03-31 Roland McGrath <roland@redhat.com>
3599 * elflint.c (check_sections): Add checks on SHF_EXECINSTR sections:
3600 must be SHT_PROGBITS, must not be SHF_WRITE. Let backend hook
3601 excuse a special section.
3603 2008-03-27 Roland McGrath <roland@redhat.com>
3605 * elflint.c (check_sections): Check that executability and writability
3606 of sections is reflected in segment p_flags.
3608 2008-03-26 Roland McGrath <roland@redhat.com>
3610 * elflint.c (check_program_header): Accept PT_GNU_RELRO p_flags
3611 that matches its PT_LOAD's p_flags &~ PF_W. On sparc, PF_X really
3614 2008-02-29 Roland McGrath <roland@redhat.com>
3616 * readelf.c (print_attributes): Add a cast.
3617 * elflint.c (check_attributes): Likewise.
3619 * unaligned.h (add_8ubyte_unaligned): Cast PTR argument for parity
3620 with [UNALIGNED_ACCESS_CLASS == BYTE_ORDER] definition.
3621 (add_4ubyte_unaligned, add_2ubyte_unaligned): Likewise.
3623 2008-02-03 Ulrich Drepper <drepper@redhat.com>
3625 * i386_ld.c (elf_i386_count_relocations): Implement R_386_TLS_GD
3626 when linked into executable.
3627 (elf_i386_create_relocations): Likewise.
3629 2008-02-20 Roland McGrath <roland@redhat.com>
3631 * readelf.c (print_attributes): New function.
3632 (process_elf_file): Call it under -A.
3634 * elflint.c (check_attributes): Implement it for real.
3636 2008-02-19 Roland McGrath <roland@redhat.com>
3638 * elflint.c (special_sections): Handle .gnu.attributes section.
3639 (check_sections): Likewise.
3640 (check_attributes): New function.
3642 2008-02-10 Roland McGrath <roland@redhat.com>
3644 * elfcmp.c (main): Ignore sh_offset differences in non-SHF_ALLOC
3645 sections and ET_REL files.
3647 2008-02-02 Ulrich Drepper <drepper@redhat.com>
3649 * elf32-i386.script: Add .eh_frame_hdr, .tdata, and .tbss sections.
3650 * i386_ld.c (elf_i386_count_relocations): Handle R_386_TLS_LDO_32
3652 (elf_i386_create_relocations): Likewise.
3653 * ld.h (struct ld_state): Add need_tls, tls_start, and tls_tcb
3655 * ldgeneric.c (add_section): If TLS section is used, set need_tls flag.
3656 (ld_generic_create_outfile): Add PT_TLS entry to program header.
3657 Fix generation of PT_GNU_STACK entry.
3659 2008-02-01 Ulrich Drepper <drepper@redhat.com>
3661 * ld.c (replace_args): Prevent loop over replacements if the parameter
3662 is only two characters long.
3664 * ld.c: Recognize sha1 argument for --build-id parameter.
3665 * ldgeneric.c (create_build_id_section): Handle sha1.
3666 (compute_hash_sum): New function. Broken out of compute_build_id.
3667 Take hash function and context as parameters.
3668 (compute_build_id): Use compute_hash_sum for md5 and the new sha1
3671 2008-01-31 Ulrich Drepper <drepper@redhat.com>
3673 * elf32-i386.script: Add .note.ABI-tag and .note.gnu.build-id sections.
3674 * ld.c: Recognize --build-id command line parameter.
3675 * ld.h: Define scn_dot_note_gnu_build_id.
3676 (struct ld_state): Add build_id and buildidscnidx elements.
3677 * ldgeneric.c: Implement --build-id command line parameter.
3678 * ldlex.l (ID): Recognize - as valid character after the first one.
3680 2008-01-29 Ulrich Drepper <drepper@redhat.com>
3682 * ld.c (replace_args): New function.
3683 (main): Use it to rewrite old-style parameters.
3685 * elf32-i386.script: Add .gnu.hash section.
3686 * ldgeneric.c (optimal_bucket_size): A tiny bit more efficient.
3687 (fillin_special_symbol): Initialize st_size.
3688 (sortfct_hashval): New function.
3689 (create_gnu_hash): New function.
3690 (create_hash): New function.
3691 (ld_generic_create_outfile): Use the new functions to create the
3694 * elflint.c (check_gnu_hash): Fix index value printed in error message.
3696 2008-01-24 Ulrich Drepper <drepper@redhat.com>
3698 * elflint.c (check_group): Check that signature symbol for section
3699 group is not an empty string.
3700 * ldgeneric.c: Remove magic assignment of indices in the dynsym
3701 section. Start implementation of --hash-style.
3702 * i386_ld.c: Likewise.
3703 * ld.c: Recognize --hash-style.
3704 * ld.h (struct scninfo): Add comdat_group.
3705 Add additional parameter to finalize_plt callback.
3707 2008-01-22 Ulrich Drepper <drepper@redhat.com>
3709 * ld.h (struct callbacks): Add initialize_gotplt.
3710 (struct scnhead): Add scn_dot_gotplt.
3711 (struct ld_state): Add gotpltscnidx.
3712 * i386_ld.c (elf_i386_initialize_plt): Minor optimization.
3713 (elf_i386_initialize_pltrel): Likewise.
3714 (elf_i386_initialize_got): There is now a separate .got.plt, so
3715 don't do the PLT-related work here. Initialize d_type.
3716 (elf_i386_initialize_gotplt): New function.
3717 (elf_i386_plt0): Use ud2a after indirect jump.
3718 (elf_i386_pic_plt0_entry): Likewise.
3719 (elf_i386_finalize_plt): Reference now .got.plt.
3720 (elf_i386_count_relocations): For GOT entries which need no relocation
3721 don't bump nrel_got.
3722 (elf_i386_create_relocations): Also get .got.plt. Rewrite R-386_GOT32
3723 handling for split .got/.got.plt.
3724 (elf_i386_ld_init): Initialize callbacks.initialize_gotplt.
3725 * elf32-i386.script: Sort sections for security. There are no .got
3726 input sections. Add .got.plt.
3727 * ldgeneric.c (ld_generic_generate_sections): Add .got.plt section.
3728 (ld_generic_create_outfile): Initialize .got.plt section.
3729 Use .got.plt address for _GLOBAL_OFFSET_TABLE_ symbol and DT_PLTGOT.
3731 2008-01-19 Ulrich Drepper <drepper@redhat.com>
3733 * i386_ld.c (elf_i386_count_relocations): PLT relocations for undefined
3734 symbols are not carried over into statically linked output files.
3735 Add dummy entries for more TLS relocations.
3737 * ld.c (options): Add long names for -( and -).
3739 * ldgeneric.c (check_definition): For newly found definitions don't
3740 mark section as used if symbol is absolute.
3741 (extract_from_archive): Only assign archive sequence number the first
3742 time the archive is handled. Update ld_state.last_archive_used
3743 if any symbol was used. Remove nround variable.
3744 (file_process2): When using symbol from an archive, update
3745 ld_state.group_start_archive, ld_state.archives, and
3746 ld_state.tailarchives.
3747 (ld_generic_file_process): If group is not handled anymore, after
3748 freeing ELF handles for the archives, clear ld_state.archives and
3749 *nextp. Fix wrong logic in recognizing first iteration of group
3750 loop. When clearing flags, also clear ld_state.group_start_archive.
3752 2008-01-11 Ulrich Drepper <drepper@redhat.com>
3754 * objdump.c (show_disasm): Adjust disassembler format string for
3757 2008-01-04 Roland McGrath <roland@redhat.com>
3759 * readelf.c (handle_core_items): Take new arg DESCSZ; if nonzero,
3760 a size greater than the items cover means multiple sets of items.
3761 (handle_core_note): Update caller.
3763 2008-01-04 Roland McGrath <roland@redhat.com>
3765 * strip.c (handle_elf): Move SHDRIDX defn to silence gcc warning.
3767 2008-01-03 Roland McGrath <roland@redhat.com>
3769 * ld.h (linked_from_dso_p): Use __attribute__ ((__gnu_inline__)).
3771 * elflint.c (check_dynamic): Remove duplicate initializer.
3773 2008-01-02 Ulrich Drepper <drepper@redhat.com>
3775 * addr2line.c: Update copyright year.
3777 * elfcmp.c: Likewise.
3778 * elflint.c: Likewise.
3779 * findtextrel.c: Likewise.
3782 * objdump.c: Likewise.
3783 * ranlib.c: Likewise.
3784 * readelf.c: Likewise.
3786 * strings.c: Likewise.
3787 * strip.c: Likewise.
3788 * unstrip.c: Likewise.
3790 2007-12-30 Ulrich Drepper <drepper@redhat.com>
3792 * objdump (show_disasm): Use %e after third parameter.
3794 2007-12-21 Ulrich Drepper <drepper@redhat.com>
3796 * strip.c: Fix wrong parenthesis in a few branch predictions.
3797 * strings.c: Likewise.
3799 2007-12-20 Ulrich Drepper <drepper@redhat.com>
3801 * Makefile.am (DEFS): Add DEBUGPRED.
3802 * addr2line.c: Include debugpred.h.
3804 * elfcmp.c: Likewise.
3805 * elflint.c: Likewise.
3806 * findtextrel.c: Likewise.
3808 * objdump.c: Likewise.
3809 * ranlib.c: Likewise.
3810 * readelf.c: Likewise.
3812 * strings.c: Likewise.
3813 * strip.c: Likewise.
3814 * unstrip.c: Likewise.
3815 * debugpred.h: New file.
3817 * readelf.c (handle_relocs_rel): Use elf_scnshndx.
3818 (handle_relocs_rela): Likewise.
3820 * readelf.c: Add lots of likely/unlikely.
3822 * elflint.c: Minor cleanups.
3824 2007-11-19 Roland McGrath <roland@redhat.com>
3826 * readelf.c (print_ops): Handle all bad op codes gracefully.
3827 Print their numbers instead of just ???.
3829 2007-11-09 Roland McGrath <roland@redhat.com>
3831 * readelf.c (attr_callback): Handle DW_AT_data_location.
3832 Handle block forms to mean a DWARF expression for DW_AT_allocated,
3833 DW_AT_associated, DW_AT_bit_size, DW_AT_bit_offset, DW_AT_bit_stride,
3834 DW_AT_byte_size, DW_AT_byte_stride, DW_AT_count, DW_AT_lower_bound,
3837 2007-10-20 Roland McGrath <roland@redhat.com>
3839 * unstrip.c (options): Update -R description.
3840 (struct symbol): Put symbol details a union with a size_t pointer
3842 (compare_symbols_output): Use null ->name as marker for discard
3843 symbols, not zero *->map.
3844 (copy_elided_sections): Record forwarding pointers for discarded
3845 duplicates and fill SYMNDX_MAP elements through them.
3847 * readelf.c (process_file): Set offline_next_address to 0 at start.
3848 (struct process_dwflmod_args): New type.
3849 (process_dwflmod): Take args in it, pass fd to process_elf_file.
3850 (process_file): Update caller; dup FD for passing to libdwfl.
3851 (process_elf_file): Take new arg FD. For ET_REL file when
3852 displaying data affected by libdwfl relocation, open a new Elf handle.
3854 2007-10-17 Roland McGrath <roland@redhat.com>
3856 * readelf.c (print_debug_line_section): For invalid data inside a
3857 unit with plausible length, keep printing at the next unit boundary.
3859 * readelf.c (attr_callback): Use dwarf_formref_die, not dwarf_formref.
3861 2007-10-16 Roland McGrath <roland@redhat.com>
3863 * readelf.c (hex_dump): Fix rounding error in whitespace calculation.
3865 2007-10-15 Roland McGrath <roland@redhat.com>
3867 * make-debug-archive.in: New file.
3868 * Makefile.am (EXTRA_DIST): Add it.
3869 (make-debug-archive): New target.
3870 (bin_SCRIPTS, CLEANFILES): Add it.
3872 2007-10-10 Roland McGrath <roland@redhat.com>
3874 * elflint.c (special_sections): Add new attrflag value exact_or_gnuld.
3875 Use it to check MERGE|STRINGS for .debug_str.
3876 (check_sections): Handle exact_or_gnuld.
3878 2007-10-08 Roland McGrath <roland@redhat.com>
3880 * readelf.c (handle_core_item): Handle 'T'|0x80 to indicate
3881 64-bit struct timeval with 32-bit tv_usec.
3883 2007-10-07 Roland McGrath <roland@redhat.com>
3885 * readelf.c (check_archive_index): New function.
3886 (process_file): Call it. Change signature to take only fd and name.
3887 Use libdwfl to open the file, then iterate on its modules (multiple
3888 for an archive) to print file name and call process_elf_file.
3889 (main): Update caller. Let process_file do elf_begin.
3890 (count_dwflmod, process_dwflmod, find_no_debuginfo): New functions.
3891 (process_elf_file): Take only Dwfl_Module * argument.
3892 Don't print the file name here.
3893 (print_debug_*_section): Take Dwfl_Module * argument.
3894 (print_debug): Likewise. Update caller.
3895 (format_dwarf_addr): New function.
3896 (print_debug_ranges_section): Use it.
3897 (attr_callback): Likewise.
3898 (print_debug_line_section, print_debug_loc_section): Likewise.
3900 * readelf.c (print_debug_ranges_section): Translate all strings.
3901 (print_debug_loc_section): Likewise.
3903 * unstrip.c (copy_elided_sections): Initialize SEC.
3905 * ar.c (do_oper_insert): Put trailing / on short names.
3907 * arlib.h (MAX_AR_NAME_LEN): Decrease by one.
3909 * arlib2.c (arlib_add_long_name): Adjust for header size.
3911 * arlib.c (arlib_finalize): Pad long name table to keep size even.
3913 * ar.c (do_oper_insert): Use write_retry for padding write.
3915 * ar.c (do_oper_insert): Initialize CUR_OFF in no_old case.
3916 Unconditionally set FOUND[CNT]->elf when setting ->mem.
3917 (remember_long_name): New function.
3918 (do_oper_insert): Call it. Correctly use length of basename,
3919 not original name. Don't store long name twice for new member.
3921 2007-10-06 Roland McGrath <roland@redhat.com>
3923 * elflint.c (check_note): Skip empty segment.
3924 (check_note_section): Skip empty section.
3926 * unstrip.c (options, parse_opt, struct arg_info): Grok -R/--relocate.
3927 (handle_output_dir_module, handle_implicit_modules): Pass it down.
3928 (handle_dwfl_module): When set, use ET_REL already loaded by Dwfl.
3929 (compare_alloc_sections): Take new arg REL, ignore address if true.
3930 (compare_sections): Likewise, pass it down.
3931 (compare_sections_rel, compare_sections_nonrel): New functions.
3932 (find_alloc_sections_prelink, copy_elided_sections): Use them
3933 instead of compare_sections.
3934 (sections_match): New function, broken out of ...
3935 (find_alloc_section): ... here.
3936 (copy_elided_sections): Reorganize section match-up logic.
3937 Use sections_match for SHF_ALLOC in ET_REL.
3938 For ET_REL, let the nonzero sh_addr from the debug file dominate.
3940 * unstrip.c (add_new_section_symbols): Take new arg REL.
3941 When true, do not update section symbol values.
3942 (collect_symbols): Likewise. Update section symbols with address
3943 of chosen output section, not original section.
3944 (check_symtab_section_symbols, copy_elided_sections): Update callers.
3946 * unstrip.c (compare_alloc_sections): At the same address, preserve
3947 original section order.
3949 * elflint.c (special_sections): Don't require MERGE|STRINGS for
3950 .debug_str, it didn't always have them with older tools.
3952 * elflint.c (check_symtab, check_one_reloc): Ignore sh_addr in ET_REL.
3954 2007-10-05 Roland McGrath <roland@redhat.com>
3956 * elflint.c (check_symtab): Allow SHN_UNDEF _GLOBAL_OFFSET_TABLE_ in
3959 * elflint.c (check_symtab): For _GLOBAL_OFFSET_TABLE_, diagnose
3960 SHN_UNDEF as "bad section". Use shndx value in messages.
3962 * elflint.c (special_sections): Add ".debug_str". Decrement namelen
3963 for ".debug" so it matches as a prefix.
3964 (IS_KNOWN_SPECIAL): New macro.
3965 (check_sections): Use it for ".plt" match. Cite wrong SHT_NOBITS
3966 type even under -d, for a .debug* or .shstrtab section.
3968 * readelf.c (print_ops): Use hex for address operand.
3970 2007-10-04 Roland McGrath <roland@redhat.com>
3972 * unstrip.c (copy_elided_sections): Initialize NDX_SECTION element for
3973 .gnu_debuglink section to SHN_UNDEF. Drop STT_SECTION symbols for
3974 sections mapped to SHN_UNDEF.
3976 2007-10-04 Ulrich Drepper <drepper@redhat.com>
3978 * readelf.c (dump_archive_index): Avoid warning about uninitialized
3979 variable with older glibc versions.
3980 Add some branch prediction.
3982 2007-10-04 Roland McGrath <roland@redhat.com>
3984 * readelf.c (print_archive_index): New variable.
3985 (options, parse_opt): Accept -c/--archive-index to set it.
3986 (dump_archive_index): New function.
3987 (process_file): Take new arg WILL_PRINT_ARCHIVE_INDEX.
3988 Call dump_archive_index on archives if set.
3989 (main): Update caller.
3990 (any_control_option): Give it file scope, moved out of ...
3991 (parse_opt): ... here.
3993 2007-10-03 Roland McGrath <roland@redhat.com>
3995 * unstrip.c (struct arg_info): Add `list' flag.
3996 (options, parse_opt): Grok -n/--list to set it.
3997 (list_module): New function.
3998 (handle_implicit_modules): Call it under -n.
4000 * elflint.c (check_note_section): New function.
4001 (check_sections): Call it for SHT_NOTE.
4003 * readelf.c (handle_notes): Use sections when available.
4005 * elflint.c (check_note_data): New function, broken out of ...
4006 (check_note): ... here. Call it and elf_getdata_rawchunk.
4008 * readelf.c (handle_auxv_note): Take offset as argument, not buffer.
4009 Use elf_getdata_rawchunk and gelf_getauxv.
4010 (handle_notes_data): New function, broken out of ...
4011 (handle_notes): ... here. Call it and elf_getdata_rawchunk.
4013 2007-10-01 Roland McGrath <roland@redhat.com>
4015 * readelf.c (hex_dump): Fix transposed subtraction generating spaces.
4017 * readelf.c (hex_dump): Fix line header to be hex instead of decimal.
4019 2007-09-10 Roland McGrath <roland@redhat.com>
4021 * readelf.c (options): Give -p optional argument, alias --string-dump.
4022 (string_sections, string_sections_tail): New static variables.
4023 (parse_opt): Set them when -p has an argument.
4024 (print_string_section): New function, broken out of ...
4025 (print_strings): ... here. Call it.
4026 (dump_data_section): New function, broken out of ...
4027 (dump_data): ... here. Call it.
4028 (for_each_section_argument): New function, broken out of ...
4029 (dump_data): ... here. Call it.
4030 (dump_strings): New function.
4032 2007-08-31 Roland McGrath <roland@redhat.com>
4034 * readelf.c (print_strings): Typo fix.
4036 2007-08-23 Roland McGrath <roland@redhat.com>
4038 * readelf.c (printf_with_wrap): Function removed.
4039 (REGISTER_WRAP_COLUMN): New macro.
4040 (handle_core_register): Use print_core_item instead.
4041 (struct register_info): New type.
4042 (compare_registers, compare_register_sets): New functions.
4043 (register_bitpos, compare_sets_by_info): New functions.
4044 (handle_core_registers): Use those to segregate and sort registers
4047 * readelf.c (ITEM_WRAP_COLUMN): New macro.
4048 (print_core_item): New function.
4049 (handle_core_item): Use it instead of printf_with_wrap.
4050 (compare_core_items, compare_core_item_groups): New functions.
4051 (handle_core_items): Use them. Sort by group and force line breaks
4054 * readelf.c (handle_core_registers, handle_core_items): New functions,
4056 (handle_core_note): ... here. Call them.
4058 2007-08-22 Roland McGrath <roland@redhat.com>
4060 * unstrip.c (new_shstrtab): New function, broken out of ...
4061 (copy_elided_sections): ... here.
4063 2007-08-20 Roland McGrath <roland@redhat.com>
4065 Avoid local function trampolines in nm binary.
4066 * nm.c (sort_by_address): Move to a static function instead of local
4067 inside show_symbols.
4068 (sort_by_name_strtab): New static variable.
4069 (sort_by_name): Use it. Move to a static function instead of local
4070 inside show_symbols.
4071 (show_symbols): Set sort_by_name_strtab.
4073 2007-08-19 Roland McGrath <roland@redhat.com>
4075 * readelf.c (handle_auxv_note): New function.
4076 (handle_notes): Call it.
4078 * readelf.c (printf_with_wrap, convert): New functions.
4079 (handle_core_item, (handle_core_register): New functions.
4080 (handle_notes): Call those with details from ebl_core_note.
4082 2007-08-12 Roland McGrath <roland@redhat.com>
4084 * elflint.c (check_note): Accept type 0 with name "Linux".
4086 * elflint.c (special_sections): Accept SHF_ALLOC for ".note".
4088 * elflint.c (section_flags_string): Return "none" for 0, not "".
4090 2007-08-11 Roland McGrath <roland@redhat.com>
4092 * elflint.c (check_note): Accept NT_GNU_HWCAP, NT_GNU_BUILD_ID.
4094 2007-08-04 Ulrich Drepper <drepper@redhat.com>
4096 * readelf.c (hex_dump): Use isprint to determine whether to print
4097 character itself or full stop character.
4098 (dump_data): No need to check endp for NULL after strtol call.
4100 2007-08-03 Roland McGrath <roland@redhat.com>
4102 * readelf.c (print_string_sections): New variable.
4103 (options, parse_opt): Handle --strings/-p to set it.
4104 (print_strings): New function.
4105 (process_elf_file): Call it under -p.
4107 * readelf.c (options): Add hidden aliases --segments, --sections,
4108 as taken by binutils readelf.
4110 2007-08-01 Roland McGrath <roland@redhat.com>
4112 * readelf.c (dump_data_sections, dump_data_sections_tail):
4114 (options, parse_opt): Handle --hex-dump/-x, set them.
4115 (hex_dump): New function.
4116 (dump_data): New function, call it.
4117 (process_elf_file): Call it.
4119 2007-07-25 Roland McGrath <roland@redhat.com>
4121 * addr2line.c (show_symbols): New variable.
4122 (print_addrsym): New function.
4123 (handle_address): Call it.
4124 (options, parse_opt): Handle -S/--symbols.
4126 2007-06-05 Ulrich Drepper <drepper@redhat.com>
4128 * addr2line.c: Update for latest autoconf header.
4130 * elfcmp.c: Likewise.
4131 * elflint.c: Likewise.
4132 * findtextrel.c: Likewise.
4134 * ldgeneric.c: Likewise.
4136 * objdump.c: Likewise.
4137 * ranlib.c: Likewise.
4138 * readelf.c: Likewise.
4140 * strings.c: Likewise.
4141 * strip.c: Likewise.
4142 * unstrip.c: Likewise.
4144 2007-05-18 Roland McGrath <roland@redhat.com>
4146 * unstrip.c (copy_elided_sections): Match up non-NOBITS sections with
4147 stripped file, so as not to duplicate a section copied in both.
4149 * strip.c (handle_elf): Keep SHT_NOTE section copies in the debug file.
4151 2007-05-17 Roland McGrath <roland@redhat.com>
4153 * unstrip.c (copy_elided_sections): Don't call gelf_newphdr for 0.
4155 * unstrip.c (handle_file): Tweak BIAS != 0 warning.
4157 * unstrip.c (handle_file): Take new arg CREATE_DIRS. If set,
4158 call make_directories here.
4159 (handle_explicit_files): Take new arg CREATE_DIRS, pass it down.
4160 (handle_dwfl_module): Likewise.
4161 (handle_implicit_modules): Update callers.
4162 (handle_output_dir_module): Likewise. Don't do make_directories here.
4164 * unstrip.c (get_section_name): New function, broken out of ...
4165 (copy_elided_sections): here. Update callers.
4166 (find_alloc_section): Broken out of ...
4167 (copy_elided_sections): ... here. Update caller.
4168 (symtab_count_leading_section_symbols): Take new arg NEWSYMDATA,
4169 update STT_SECTION symbols' st_value fields as a side effect.
4170 (check_symtab_section_symbols): Update caller.
4171 (add_new_section_symbols): Set st_value in symbols added.
4172 (collect_symbols): Reset S->value for STT_SECTION symbols recorded.
4173 Take new arg SPLIT_BSS. Adjust S->shndx recorded for symbols moved
4174 from .bss to .dynbss.
4175 (find_alloc_sections_prelink): New function. Associate debug file
4176 allocated SHT_NOBITS shdrs with stripped moved by prelink via
4177 .gnu.prelink_undo information.
4178 (copy_elided_sections): Call it when we couldn't find every allocated
4179 section. Don't use a debug file non-NOBITS section if SHF_ALLOC.
4180 Take STRIPPED_EHDR arg instead of E_TYPE and PHNUM.
4181 (handle_file): Update callers.
4183 * unstrip.c (copy_elided_sections): Ignore unfound unallocated section
4186 * elflint.c (check_sections): Fix association of segments with
4187 sections when p_memsz > p_filesz.
4189 2007-04-29 Roland McGrath <roland@redhat.com>
4191 * addr2line.c (options, main): Tweak argp group settings to fix
4194 2007-04-28 Roland McGrath <roland@redhat.com>
4196 * strip.c (handle_elf): Update debug file's SHT_NOBITS sections'
4197 sizes to match sections adjusted in the stripped file.
4199 2007-04-24 Roland McGrath <roland@redhat.com>
4201 * elfcmp.c (OPT_HASH_INEXACT): New macro.
4202 (hash_inexact): New variable.
4203 (options, parse_opt): Add --hash-inexact option to set it.
4204 (hash_content_equivalent): New function.
4205 (main): Call it for differing SHT_HASH sections under --hash-inexact.
4207 2007-04-23 Roland McGrath <roland@redhat.com>
4209 * unstrip.c: New file.
4210 * Makefile.am (bin_PROGRAMS): Add it.
4211 (unstrip_LDADD): New variable.
4213 * strip.c (options): Allow --output for -o.
4215 2007-02-15 Ulrich Drepper <drepper@redhat.com>
4217 * readelf.c: Remove unused code. Add a few consts.
4219 2007-02-15 Roland McGrath <roland@redhat.com>
4221 * readelf.c (print_debug): Fix brainos in SHDR test.
4223 2007-02-05 Roland McGrath <roland@redhat.com>
4225 * ar.c: Include <limits.h>, since we use LONG_MAX.
4227 2007-02-05 Ulrich Drepper <drepper@redhat.com>
4229 * ar.c: Add ugly hack to work around gcc complaining that we
4230 ignore fchown's return value.
4231 (do_oper_insert): Handle error when writing padding.
4232 * ranlib.c: Add fchown complain work around.
4234 * arlib.c: Make symtab a global variable. Change all users.
4235 * arlib2.c: Likewise.
4236 * ranlib.c: Likewise.
4238 * arlib.h: Declare it.
4240 2007-01-11 Roland McGrath <roland@redhat.com>
4242 * elflint.c (check_sections): Use ebl_machine_section_flag_check on
4243 SHF_MASKPROC bits separately from generic sh_flags validation.
4245 2007-02-04 Ulrich Drepper <drepper@redhat.com>
4248 * arlib.c: New file.
4249 * arlib2.c: New file.
4250 * arlib.h: New file.
4251 * Makefile (noinst_LIBRARIES): Add libar.
4252 (libar_a_SOURCES): Define.
4254 (CFLAGS_ar): Define.
4255 * ranlib.c: Change to use arlib.
4257 * elflint.c (check_symtab): Work around GNU ld bug which omits
4258 sections but not symbols in those sections.
4260 2007-01-10 Ulrich Drepper <drepper@redhat.com>
4262 * addr2line.c: Update copyright year.
4263 * elfcmp.c: Likewise.
4264 * elflint.c: Likewise.
4265 * findtextrel.c: Likewise.
4268 * objdump.c: Likewise.
4269 * ranlib.c: Likewise.
4270 * readelf.c: Likewise.
4272 * strings.c: Likewise.
4273 * strip.c: Likewise.
4275 2006-12-09 Ulrich Drepper <drepper@redhat.com>
4277 * elflint.c (compare_hash_gnu_hash): New function. Report if the
4278 two hash tables have different content (module expected omission
4279 of undefined symbols).
4281 2006-10-31 Roland McGrath <roland@redhat.com>
4283 * elflint.c (check_program_header): Don't complain about
4284 p_filesz > p_memsz if p_memsz is zero and p_type is PT_NOTE.
4286 2006-09-19 Jakub Jelinek <jakub@redhat.com>
4288 * strip.c (process_file): Disallow -f on archives.
4290 2006-10-09 Roland McGrath <roland@redhat.com>
4292 * Makefile.am (libld_elf_i386.so): Use $(LINK), not $(CC).
4294 2006-08-29 Roland McGrath <roland@redhat.com>
4296 * Makefile.am (MAINTAINERCLEANFILES): New variable.
4298 * readelf.c (handle_relocs_rel): Typo fix, test DESTSHDR properly.
4299 Reported by Christian Aichinger <Greek0@gmx.net>.
4301 * elflint.c (valid_e_machine): Add EM_ALPHA.
4302 Reported by Christian Aichinger <Greek0@gmx.net>.
4304 2006-08-08 Ulrich Drepper <drepper@redhat.com>
4306 * elflint.c (check_dynamic): Don't require DT_HASH for DT_SYMTAB.
4307 Keep track of which "high DT" entries are present.
4308 Check that either old or GNU-style hash table is present.
4309 If GNU-style hash table is used a symbol table is mandatory.
4310 Check that if any prelink entry is present all of them are.
4311 (check_gnu_hash): Only fail for undefined symbols in GNU-style hash
4312 table if they don't refer to functions.
4314 2006-07-17 Roland McGrath <roland@redhat.com>
4316 * elflint.c (struct version_namelist): Use GElf_Versym for `ndx' field.
4317 (add_version): Likewise for argument.
4318 (check_versym): Cast constant to GElf_Versym for comparison.
4320 2006-07-12 Roland McGrath <roland@redhat.com>
4322 * readelf.c (handle_gnu_hash): Add casts for machines where
4323 Elf32_Word != unsigned int.
4325 2006-07-12 Ulrich Drepper <drepper@redhat.com>
4327 * elflint.c (check_sysv_hash64): Fix printf format.
4329 2006-07-11 Roland McGrath <roland@redhat.com>
4331 * addr2line.c (options): English fix in -f doc string.
4333 * addr2line.c (use_comp_dir): New variable.
4334 (options, parse_opt): Grok -A/--absolute to set it.
4335 (handle_address): If set, prepend dwfl_line_comp_dir results to
4336 relative file names.
4338 2006-07-06 Ulrich Drepper <drepper@redhat.com>
4340 * elflint.c: Adjust for latest new hash table format.
4341 * readelf.c: Likewise.
4343 * elflint.c (check_versym): Ignore hidden bit when comparing version
4346 2006-07-05 Ulrich Drepper <drepper@redhat.com>
4348 * ldgeneric.c (ld_generic_create_outfile): Correctly recognize
4349 discarded COMDAT symbols.
4351 * i386_ld.c (elf_i386_count_relocations): Lot of corrections.
4352 (elf_i386_create_relocations): Likewise.
4353 * ld.h (struct symbol): Add local and hidden bits.
4354 * ld.c (create_special_section_symbol): These synthsized symbols
4355 are local and hidden.
4356 * ldgeneric.c (file_process2): Check whether input file matches
4358 (fillin_special_symbol): Create symbols as local and/or hidden
4360 (ld_generic_create_outfile): Make local copy of symbol.
4361 Don't hide global, defined symbols in dynamic symbol table unless
4362 requested. Synthetic symbols have no version information.
4364 * elflint.c: Add support for checking 64-bit SysV-style hash tables.
4365 * readelf.c: Add support for printing 64-bit SysV-style hash tables.
4367 2006-07-04 Ulrich Drepper <drepper@redhat.com>
4369 * elflint.c (is_rel_dyn): Fix and extend DT_RELCOUNT/DT_RELACOUNT
4372 2006-07-03 Ulrich Drepper <drepper@redhat.com>
4374 * elflint.c: Add testing of DT_GNU_HASH.
4375 * readelf.c: Implement showing histogram for DT_GNU_HASH section.
4377 * Makefile.am: Add hacks to create dependency files for non-generic
4380 2006-06-12 Ulrich Drepper <drepper@redhat.com>
4382 * ldgeneric.c (ld_generic_generate_sections): Don't create .interp
4383 section if creating a DSO and no interpreter is given.
4384 (ld_generic_create_outfile): Don't store reference to symbols in
4385 discarded COMDAT groups. Don't create PHDR and INTERP program header
4386 for DSO if no interpreter is specified.
4387 (create_verneed_data): Pretty printing.
4389 * ldscript.y (content): If a DSO is created don't set default
4390 interpreter from linker script.
4392 * i386_ld.c (elf_i386_count_relocations): Do not add relocations
4393 for symbols in discarded COMDAT groups.
4394 (elf_i386_create_relocations): Likewise.
4395 * ld.h (struct scninfo): Add unused_comdat.
4396 * ldgeneric.c (add_section): Also check group signature when
4397 matching COMDAT sections.
4398 (add_relocatable_file): Ignore symbols in COMDAT group which are
4401 * elflint.c (check_one_reloc): For *_NONE relocs only check type
4402 and symbol reference.
4404 2006-06-11 Ulrich Drepper <drepper@redhat.com>
4406 * elflint.c (check_dynamic): Fix checking value of tags which are
4407 offsets in the string section. Make sure DT_STRTAB points to the
4408 section referenced in sh_link.
4410 * ld.c (options): Add headers. Add short option 'R' for '--rpath'.
4412 * ld.c: Recognize --eh-frame-hdr option.
4413 * ld.h (struct ld_state): Add eh_frame_hdr field.
4414 * ldgeneric.c (struct unw_eh_frame_hdr): Define.
4416 * ldgeneric.c (add_section): Use ebl_sh_flags_combine instead of
4418 (add_relocatable_file): Minor optimization of last change.
4419 (match_section): Don't preserve SHF_GROUP flag any longer.
4421 2006-06-10 Ulrich Drepper <drepper@redhat.com>
4423 * ld.c (parse_z_option): Recognize execstack and noexecstack.
4424 Handle record and ignore as position dependent options.
4425 (parse_z_option_2): Handle ignore and record here.
4426 * ld.h (struct ld_state): Add execstack field.
4427 * ldgeneric.c (add_relocatable_file): Recognize .note.GNU-stack
4429 (ld_generic_create_outfile): Fix program header creation in native
4430 linker. Add PT_GNU_STACK program header.
4432 2006-06-09 Ulrich Drepper <drepper@redhat.com>
4434 * i386_ld.c (elf_i386_finalize_plt): Don't change symbol table entries
4435 for PLT entries if there is no local definition.
4437 * ld.c (parse_option): Handle -z ignore like --as-needed and
4438 -z record like --no-as-needed.
4439 * ld.h (struct ld_state): Remove ignore_unused_dsos field.
4440 * ldgeneric.c (new_generated_scn): Always compute ndt_needed by
4441 looping over DSOs. When deciding about adding DT_NEEDED entries
4442 use ->as_needed instead of ignore_unused_dsos.
4444 2006-05-31 Ulrich Drepper <drepper@redhat.com>
4446 * ld.c: Recognize --as-needed and --no-as-needed options.
4447 * ld.h (struct usedfile): Add as_needed field.
4448 (struct ld_state): Likewise.
4449 * ldgeneric.c (ld_handle_filename_list): Copy as_needed flag from
4451 * ldscript.y (filename_id_list): Split to correctly parse all
4453 (mark_as_needed): Fix loop.
4455 2006-05-28 Ulrich Drepper <drepper@redhat.com>
4457 * addr2line.c (print_dwarf_function): Use unsigned type for lineno
4460 2006-05-27 Ulrich Drepper <drepper@redhat.com>
4462 * readelf.c (handle_relocs_rela): Better notations for addon value.
4463 (print_ehdr): Distinguish e_ident[EI_VERSION] from e_version.
4465 2006-04-04 Ulrich Drepper <drepper@redhat.com>
4467 * addr2line.c: Update copyright year.
4468 * elfcmp.c: Likewise.
4469 * elflint.c: Likewise.
4470 * findtextrel.c: Likewise.
4473 * objdump.c: Likewise.
4474 * ranlib.c: Likewise.
4475 * readelf.c: Likewise.
4477 * strings.c: Likewise.
4478 * strip.c: Likewise.
4480 2006-03-09 Roland McGrath <roland@redhat.com>
4482 * Makefile.am (AM_LDFLAGS): New variable.
4484 2006-03-01 Roland McGrath <roland@redhat.com>
4486 * readelf.c (dwarf_tag_string, dwarf_attr_string): Update name tables
4487 for dwarf.h changes matching 3.0 spec.
4488 (dwarf_encoding_string, dwarf_lang_string, print_ops): Likewise.
4490 2005-12-04 Ulrich Drepper <drepper@redhat.com>
4492 * elflint.c (check_one_reloc): If relocation section is not loaded,
4493 don't check whether the relocations modify read-only sections or
4494 loaded and unloaded sections.
4496 2005-11-28 Ulrich Drepper <drepper@redhat.com>
4498 * elflint.c (check_one_reloc): Take additional parameters. Use
4499 them to determine whether relocation is valid in this type of
4500 file. DSOs and executables can contain relocation sections in
4501 unloaded sections which just show the relocations the linker
4502 applied. Adjust all callers.
4503 (check_program_header): Check that PT_PHDR is loaded and that offset
4504 matches the one in the ELF header.
4506 2005-10-26 Roland McGrath <roland@redhat.com>
4508 * nm.c (get_var_range): dwarf_getloclist -> dwarf_getlocation.
4510 2005-09-03 Ulrich Drepper <drepper@redhat.com>
4512 * strip.c (handle_elf): Unify some error messages.
4513 * ld.c (main): Likewise.
4514 * ldgeneric.c (open_elf): Likewise.
4515 * elfcmp.c (main): Likewise.
4516 * elflint.c (check_elf_header): Likewise.
4518 * size.c (process_file): Fix typo in error message.
4520 * readelf.c: Lots of little cleanups. Use _unlocked functions.
4522 2005-09-02 Ulrich Drepper <drepper@redhat.com>
4524 * strings.c (main): Reset elfmap variable after munmap call.
4525 [_MUDFLAP] (map_file): Simplify mudflap debugging by not using mmap.
4527 2005-08-28 Ulrich Drepper <drepper@redhat.com>
4529 * ranlib.c: Don't define pread_retry and write_retry here.
4531 * Makefile.an [BUILD_STATIC] (libdw): Add -ldl.
4532 (CLEANFILES): Add *.gcno *.gcda *.gconv.
4534 * strings.c (process_chunk): Reorder expressions in conditional
4535 (process_chunk_mb): Likewise.
4537 * strings.c: New file.
4538 * Makefile.am (bin_PROGRAMS): Add strings.
4539 (strings_no_Wstring): Define.
4540 (strings_LDADD): Define.
4542 2005-08-27 Roland McGrath <roland@redhat.com>
4544 * addr2line.c (dwarf_diename_integrate): Function removed.
4545 (print_dwarf_function): Use plain dwarf_diename.
4547 2005-08-24 Ulrich Drepper <drepper@redhat.com>
4549 * elflint.c (check_versym): Versioned symbols should not have
4552 2005-08-15 Ulrich Drepper <drepper@redhat.com>
4554 * elflint.c (check_versym): Allow VER_NDX_LOCAL symbols to be
4557 * Makefile.am: Add rules to build ranlib.
4558 * ranlib.c: New file.
4560 2005-08-14 Roland McGrath <roland@redhat.com>
4562 * elflint.c (check_sections): Use ebl_section_type_name and allow any
4563 sh_type it recognizes.
4565 * elflint.c (check_sections): Print unknown flags in hex, don't
4566 truncate high bits. Print section number and name for unknown type.
4568 2005-08-13 Roland McGrath <roland@redhat.com>
4570 * elflint.c (check_program_header): Use ebl_segment_type_name and
4571 allow any p_type it recognizes. Include p_type value in error
4572 message for unknown type.
4574 2005-08-13 Ulrich Drepper <drepper@redhat.com>
4576 * elflint.c (check_symtab): Simplify last change a bit. Pass ehdr
4577 to ebl_check_special_symbol.
4578 (check_sections): Pass ehdr to ebl_bss_plt_p.
4580 2005-08-12 Roland McGrath <roland@redhat.com>
4582 * elflint.c (check_symtab): Check that _GLOBAL_OFFSET_TABLE_ st_shndx
4583 refers to the right section if it's not SHN_ABS.
4584 Let ebl_check_special_symbol override _G_O_T_ value and size checks.
4586 * elflint.c (check_sections): Don't complain about a non-NOBITS
4587 section taking no segment space, if it's sh_size is 0.
4589 * elflint.c (check_sections): Use ebl_bss_plt_p to see if .plt should
4590 be PROGBITS or NOBITS.
4592 * elflint.c (check_symtab): Use ebl_check_special_symbol to override
4593 standard st_value and st_size checks.
4595 2005-07-28 Roland McGrath <roland@redhat.com>
4597 * addr2line.c (options, parse_opt): Don't handle -e here.
4598 (executable): Variable removed.
4599 (argp_children): New static variable.
4600 (argp): Use it. Make const.
4601 (main): Fill in argp_children from dwfl_standard_argp ().
4602 Let libdwfl handle file selection, pass Dwfl handle to handle_address.
4603 (print_dwarf_function): New function. Try to figure out inline chain.
4604 (elf_getname): Function removed, libdwfl does it for us.
4605 (handle_address): Take Dwfl handle instead of Elf, Dwarf handles.
4606 Use dwfl_module_addrname instead of elf_getname.
4607 Use dwfl_module_getsrc and dwfl_lineinfo instead of libdw calls.
4608 * Makefile.am (INCLUDES): Add libdwfl directory to path.
4610 2005-08-10 Ulrich Drepper <drepper@redhat.com>
4612 * strip.c (parse_opt): STATE parameter is now used.
4613 Various little cleanups.
4615 * readelf.c (print_debug_line_section): Correct fallout of renaming
4616 of DW_LNS_set_epilog_begin.
4618 2005-08-08 Roland McGrath <roland@redhat.com>
4620 * strip.c (options, parse_opt): Grok -R .comment for compatibility
4621 with binutils strip. Likewise -d, -S, as aliases for -g.
4622 Likewise ignore -s/--strip-all.
4624 2005-08-07 Roland McGrath <roland@redhat.com>
4626 * strip.c (process_file): Open read-only when using a different output
4629 2005-08-06 Ulrich Drepper <drepper@redhat.com>
4631 * elflint.c (in_nobits_scn): New function.
4632 (check_versym): Allow references for defined symbols against versions
4633 of other DSOs also for symbols in nobits sections.
4634 Move a few variables around.
4636 * Makefile.am (AM_CFLAGS): Avoid duplication.
4637 Link with statis libs if BUILD_STATIC.
4639 2005-08-05 Ulrich Drepper <drepper@redhat.com>
4641 * elflint.c: Many, many more tests. Mostly related to symbol
4642 versioning. Those sections should now be completely checked.
4644 * readelf.c (print_dynamic): Use gelf_offscn.
4646 2005-08-04 Ulrich Drepper <drepper@redhat.com>
4648 * elflint.c: Add lots more tests: more extension symbol table sanity,
4649 versioning section tests, hash table tests. General cleanup.
4651 2005-08-02 Ulrich Drepper <drepper@redhat.com>
4653 * objdump.c: New file.
4654 * Makefile.am (bin_PROGRAMS): Add objdump.
4655 (objdump_LDADD): Define.
4657 * elflint.c (check_reloc_shdr): New function split out from check_rela
4659 (check_one_reloc): New function. Likewise.
4660 (check_rela): Use check_reloc_shdr and check_one_reloc.
4661 (check_rel): Likewise.
4662 (check_program_header): Check that PT_DYNAMIC entry matches .dynamic
4664 Add checks that relocations against read-only segments are flagged,
4665 that the text relocation flag is not set unnecessarily, and that
4666 relocations in one section are either against loaded or not-loaded
4669 2005-08-01 Ulrich Drepper <drepper@redhat.com>
4671 * elfcmp.c (main): Ignore section count and section name string table
4674 2005-07-27 Roland McGrath <roland@redhat.com>
4676 * elfcmp.c: Include <locale.h>.
4678 2005-07-27 Ulrich Drepper <drepper@redhat.com>
4680 * elfcmp.c: Print name and index of differing section.
4682 2005-07-24 Ulrich Drepper <drepper@redhat.com>
4684 * elfcmp.c: Implement comparing gaps between sections.
4686 2005-07-23 Ulrich Drepper <drepper@redhat.com>
4688 * elflint.c: Include libeblP.h instead of libebl.h.
4690 * readelf.c: Likewise.
4691 * elfcmp.c: Likewise.
4693 * elfcmp.c (main): Compare individual ELF header fields, excluding
4694 e_shoff instead of the whole struct at once.
4695 Use ebl_section_strip_p instead of SECTION_STRIP_P.
4696 * strip.c: Use ebl_section_strip_p instead of SECTION_STRIP_P.
4698 2005-07-22 Ulrich Drepper <drepper@redhat.com>
4700 * elfcmp.c (main): Take empty section into account when comparing
4703 * elflint.c (check_dynamic): Check that d_tag value is >= 0 before
4706 2005-07-21 Ulrich Drepper <drepper@redhat.com>
4708 * elfcmp.c: New file.
4709 * Makefile.am (bin_PROGRAMS): Add elfcmp.
4710 (elfcmp_LDADD): Define.
4712 * elflint.c (check_rela): Check that copy relocations only reference
4713 object symbols or symbols with unknown type.
4714 (check_rel): Likewise.
4716 2005-06-08 Roland McGrath <roland@redhat.com>
4718 * readelf.c (print_ops): Add consts.
4720 2005-05-31 Roland McGrath <roland@redhat.com>
4722 * readelf.c (print_debug_abbrev_section): Don't bail after first CU's
4723 abbreviations. Print a header line before each CU section.
4725 * readelf.c (print_debug_loc_section): Fix indentation for larger
4728 2005-05-30 Roland McGrath <roland@redhat.com>
4730 * readelf.c (print_debug_line_section): Print section offset of each
4731 CU's table, so they are easy to find from seeing the stmt_list value.
4733 * readelf.c (dwarf_attr_string): Add all attributes in <dwarf.h>.
4734 (attr_callback): Grok DW_AT_ranges and print offset in hex.
4736 * readelf.c (attr_callback): Add 2 to addrsize * 2 for %#0* format.
4737 (print_debug_ranges_section, print_debug_loc_section): Likewise.
4739 * readelf.c (print_ops): Take different args for indentation control.
4740 (attr_callback): Caller updated.
4741 Grok several more block-form attributes as being location expressions.
4742 For those same attributes with udata forms, format output differently
4743 for location list offset.
4744 (print_debug_loc_section): Implement it for real.
4746 * readelf.c (options): Mention ranges for --debug-dump.
4747 (enum section_e): Add section_ranges.
4748 (parse_opt): Grok "ranges" for -w/--debug-dump.
4749 (print_debug_ranges_section): New function.
4750 (print_debug): Handle .debug_ranges section.
4752 2005-05-30 Ulrich Drepper <drepper@redhat.com>
4754 * readelf.c (handle_notes): At least x86-64 need not have the note
4755 section values aligned to 8 bytes.
4757 2005-05-18 Ulrich Drepper <drepper@redhat.com>
4759 * readelf.c (dwarf_tag_string): Add new tags.
4761 2005-05-08 Roland McGrath <roland@redhat.com>
4763 * strip.c (handle_elf): Don't translate hash and versym data formats,
4764 elf_getdata already did it for us.
4766 2005-05-07 Ulrich Drepper <drepper@redhat.com>
4768 * Makefile.am (findtextrel_LDADD): Add $(libmudflap).
4769 (addr2line_LDADD): Likewise.
4771 2005-05-03 Roland McGrath <roland@redhat.com>
4773 * strip.c (handle_elf): Apply symbol table fixups to discarded
4774 relocation sections when they are being saved in the debug file.
4776 * strip.c (handle_elf): Pass EHDR->e_ident[EI_DATA] to gelf_xlatetom
4777 and gelf_xlatetof, not the native byte order.
4779 * strip.c (parse_opt): Give error if -f or -o is repeated.
4780 (main): Exit if argp_parse returns nonzero.
4782 * strip.c (debug_fname_embed): New variable.
4783 (options, parse_opt): New option -F to set it.
4785 2005-05-07 Ulrich Drepper <drepper@redhat.com>
4787 * readelf.c (parse_opt): Make any_control_option variable
4788 local. Simplify some tests.
4790 2005-05-03 Roland McGrath <roland@redhat.com>
4792 * strip.c (crc32_file): Function removed (now in ../lib).
4794 2005-05-03 Roland McGrath <roland@redhat.com>
4796 * elflint.c (is_debuginfo): New variable.
4797 (options, parse_opt): New option --debuginfo/-d to set it.
4798 (check_sections): If is_debuginfo, don't complain about SHT_NOBITS.
4799 (check_note): If is_debuginfo, don't try to get note contents.
4801 2005-04-24 Ulrich Drepper <drepper@redhat.com>
4803 * readelf.c (print_debug_abbrev_section): Don't print error when end of
4806 2005-04-14 Ulrich Drepper <drepper@redhat.com>
4808 * readelf.c (dwarf_encoding_string): New function.
4809 (dwarf_inline_string): New function.
4810 (dwarf_access_string): New function.
4811 (dwarf_visibility_string): New function.
4812 (dwarf_virtuality_string): New function.
4813 (dwarf_identifier_case_string): New function.
4814 (dwarf_calling_convention_string): New function.
4815 (dwarf_ordering_string): New function.
4816 (dwarf_discr_list_string): New function.
4817 (attr_callback): Decode man more attribute values.
4819 2005-04-01 Ulrich Drepper <drepper@redhat.com>
4821 * addr2line.c: Finish implementation of -f option.
4823 2005-03-29 Ulrich Drepper <drepper@redhat.com>
4825 * addr2line.c: New file.
4826 * Makefile.am (bin_PROGRAMS): Add addr2line.
4827 Define addr2line_LDADD.
4829 * findtextrel.c: Use new dwarf_addrdie function.
4831 * findtextrel.c: Fix usage message and re-add accidentally removed
4834 2005-03-28 Ulrich Drepper <drepper@redhat.com>
4836 * findtextrel.c: New file.
4837 * Makefile: Add rules to build findtextrel.
4839 2005-02-15 Ulrich Drepper <drepper@redhat.com>
4841 * ldlex.l: Provide ECHO definition to avoid warning.
4843 * elflint.c (check_program_header): Fix typo in RELRO test.
4845 * Makefile.am (AM_CFLAGS): Add more warning options.
4846 * elflint.c: Fix warnings introduced by the new warning options.
4847 * i386_ld.c: Likewise.
4850 * ldgeneric.c: Likewise.
4852 * readelf.c: Likewise.
4853 * sectionhash.c: Likewise.
4855 * string.c: Likewise.
4857 2005-02-05 Ulrich Drepper <drepper@redhat.com>
4859 * Makefile.am: Check for text relocations in constructed DSOs.
4861 * Makefile.am [MUDFLAP] (AM_CFLAGS): Add -fmudflap. Link all apps
4864 * ldscript.y: Add as_needed handling.
4865 * ldlex.l: Recognize AS_NEEDED token.
4866 * ld.h (struct filename_list): Add as_needed flag.
4868 2005-02-04 Ulrich Drepper <drepper@redhat.com>
4870 * elflint.c (check_symtab): Correctly determine size of GOT section.
4872 2005-01-19 Ulrich Drepper <drepper@redhat.com>
4874 * ld.c: Remove unnecessary more_help function. Print bug report
4876 * strip.c: Likewise.
4879 * readelf.c: Likewise.
4880 * elflint.c: Likewise.
4882 * elflint.c (main): Don't check for parameter problems here.
4883 (parse_opt): Do it here, where we get informed about some of them
4886 * readelf.c (main): Don't check for parameter problems here.
4887 (parse_opt): Do it here, where we get informed about some of them
4890 2005-01-11 Ulrich Drepper <drepper@redhat.com>
4892 * strip.c: Update copyright year.
4893 * readelf.c: Likewise.
4897 * elflint.c: Likewise.
4899 * elflint.c (check_symtab): Don't warn about wrong size for
4900 _DYNAMIC and __GLOBAL_OFFSET_TABLE__ for --gnu-ld.
4902 2004-10-05 Ulrich Drepper <drepper@redhat.com>
4904 * readelf.c (print_phdr): In section mapping, also indicate
4905 sections in read-only segments.
4907 2004-09-25 Ulrich Drepper <drepper@redhat.com>
4909 * readelf.c: Make compile with gcc 4.0.
4910 * strip.c: Likewise.
4912 2004-08-16 Ulrich Drepper <drepper@redhat.com>
4914 * strip.c (handle_elf): Rewrite dynamic memory handling to use of
4915 allocate to work around gcc 3.4 bug.
4917 2004-01-25 Ulrich Drepper <drepper@redhat.com>
4919 * ldlex.l (invalid_char): Better error message.
4921 2004-01-23 Ulrich Drepper <drepper@redhat.com>
4923 * readelf.c: Print SHT_GNU_LIBLIST sections.
4925 * none_ld.c: New file.
4927 2004-01-21 Ulrich Drepper <drepper@redhat.com>
4929 * Makefile.am: Enable building of machine specific linker.
4931 2004-01-20 Ulrich Drepper <drepper@redhat.com>
4933 * Makefile.am: Support building with mudflap.
4935 * i386_ld.c: Fix warnings gcc 3.4 spits out.
4936 * ldgeneric.c: Likewise.
4937 * ldscript.y: Likewise.
4938 * readelf.c: Likewise.
4939 * strip.c: Likewise.
4941 * readelf.c (print_debug_line_section): Determine address size
4944 2004-01-19 Ulrich Drepper <drepper@redhat.com>
4946 * readelf.c (print_phdr): Show which sections are covered by the
4949 * elflint.c (check_program_header): Check PT_GNU_RELRO entry.
4951 * readelf.c (print_debug_macinfo_section): Implement.
4953 2004-01-18 Ulrich Drepper <drepper@redhat.com>
4955 * readelf.c (print_debug_line_section): Implement.
4957 2004-01-17 Ulrich Drepper <drepper@redhat.com>
4959 * src/elflint.c: Use PACKAGE_NAME instead of PACKAGE.
4960 * src/ld.c: Likewise.
4961 * src/nm.c: Likewise.
4962 * src/readelf.c: Likewise.
4963 * src/size.c: Likewise.
4964 * src/strip.c: Likewise.
4966 * strip.c: Add a few more unlikely. Reduce scope of some variables.
4968 * Makefile.am: Support building with mudflap.
4970 2004-01-16 Ulrich Drepper <drepper@redhat.com>
4972 * readelf.c (print_debug_info_section): Free dies memory.
4974 * readelf.c: Print .debug_info section content.
4976 2004-01-13 Ulrich Drepper <drepper@redhat.com>
4978 * readelf.c (print_shdr): Add support for SHF_ORDERED and SHF_EXCLUDE.
4980 2004-01-12 Ulrich Drepper <drepper@redhat.com>
4982 * readelf.c (print_debug_aranges): Implement using libdw.
4984 2004-01-11 Ulrich Drepper <drepper@redhat.com>
4986 * nm.c: Adjust for Dwarf_Files type and dwarf_lineno interface change.
4988 * readelf.c: Use libdw instead of libdwarf. Not all of the old
4989 behavior is available yet.
4990 * Makefile.am: Link readelf with libdw. Remove libdwarf include path.
4992 2004-01-09 Ulrich Drepper <drepper@redhat.com>
4994 * nm.c (get_local_names): Adjust call to dwarf_nextcu.
4996 * nm.c: Implement getting information about local variables.
4998 2004-01-07 Ulrich Drepper <drepper@redhat.com>
5000 * nm.c: Read also debug information for local symbols.
5002 2004-01-05 Ulrich Drepper <drepper@redhat.com>
5004 * nm.c: Shuffle dwarf handling code around so the maximum column
5005 width can be computed ahead of printing. Avoid collection symbols
5006 which are not printed anyway.
5008 * nm.c: Rewrite dwarf handling to use libdw.
5009 * Makefile.am (AM_CFLAGS): Add -std parameter.
5010 (INCLUDES): Find header in libdw subdir.
5011 (nm_LDADD): Replace libdwarf with libdw.
5013 * elflint.c: Update copyright year.
5014 * readelf.c: Likewise.
5016 * strip.c: Likewise.
5019 2003-12-31 Ulrich Drepper <drepper@redhat.com>
5021 * strip.c (process_file): Close file before returning.
5023 2003-11-19 Ulrich Drepper <drepper@redhat.com>
5025 * readelf.c (handle_dynamic): Make column for tag name wider.
5027 2003-09-29 Ulrich Drepper <drepper@redhat.com>
5029 * readelf.c (handle_dynamic): Always terminate tag name with a space.
5031 2003-09-25 Ulrich Drepper <drepper@redhat.com>
5033 * strip.c (process_file): Don't mmap the input file, we modify the
5034 data structures and don't want the change end up on disk.
5036 2003-09-23 Jakub Jelinek <jakub@redhat.com>
5038 * unaligned.h (union u_2ubyte_unaligned,
5039 union u_4ubyte_unaligned, union u_8ubyte_unaligned): Add
5041 (add_2ubyte_unaligned, add_4ubyte_unaligned,
5042 add_8ubyte_unaligned): Avoid nesting bswap_NN macros.
5043 Read/store value through _ptr->u instead of *_ptr.
5045 2003-09-22 Ulrich Drepper <drepper@redhat.com>
5047 * size.c (show_sysv): Change type of maxlen to int.
5049 * strip.c (handle_elf): Handle the 64-bit archs which is 64-bit
5052 * i386_ld.c: Many many fixes and extensions.
5054 * ldgeneric.c: Likewise.
5056 2003-08-16 Ulrich Drepper <drepper@redhat.com>
5058 * ldgeneric.c (check_definition): Don't add symbol on dso_list if
5059 the reference is from another DSO.
5061 2003-08-15 Ulrich Drepper <drepper@redhat.com>
5063 * ldgeneric.c (find_entry_point): It is no fatal error if no entry
5064 point is found when creating a DSO.
5066 2003-08-14 Ulrich Drepper <drepper@redhat.com>
5068 * ld.c (main): Always call FLAG_UNRESOLVED.
5069 * ldgeneric.c (ld_generic_flag_unresolved): Only complain about
5070 undefined symbols if not creating DSO or ld_state.nodefs is not set.
5072 2003-08-13 Ulrich Drepper <drepper@redhat.com>
5074 * Makefile.in: Depend on libebl.a, not libebl.so.
5076 * ld.c (main): Mark stream for linker script as locked by caller.
5077 (read_version_script): Likewise.
5078 * ldlex.c: Define fread and fwrite to _unlocked variant.
5080 * i386_ld.c (elf_i386_finalize_plt): Replace #ifdefs with uses of
5082 * unaligned.h: Define target_bswap_16, target_bswap_32, and
5084 (store_2ubyte_unaligned, store_4ubyte_unaligned,
5085 store_8ubyte_unaligned): Define using new macros.
5087 2003-08-12 Ulrich Drepper <drepper@redhat.com>
5089 * i386_ld.c (elf_i386_finalize_plt): Use packed structs to access
5090 possibly unaligned memory. Support use of big endian machines.
5092 2003-08-11 Ulrich Drepper <drepper@redhat.com>
5094 * Moved to CVS archive.