8a664daebb53adfd44acecf0d1fde4b3bd2761b3
[platform/upstream/elfutils.git] / src / ChangeLog
1 2018-05-15  Dmitry V. Levin  <ldv@altlinux.org>
2
3         * elflint.c (check_elf_header): Fix typo in error diagnostics.
4
5 2018-05-15  Mark Wielaard  <mark@klomp.org>
6
7         * readelf.c (print_form_data): Cast comparisons against offset_len to
8         ptrdiff_t.
9         (print_debug_line_section): Print uint64_t as PRIu64.
10
11 2018-05-11  Mark Wielaard  <mark@klomp.org>
12
13         * readelf.c (print_debug_macro_section): Use libdw_valid_user_form.
14         Use print_form_data for strx and sup strings.
15
16 2018-05-09  Mark Wielaard  <mark@klomp.org>
17
18         * readelf.c (dwarf_line_content_description_string): New function.
19         (dwarf_line_content_description_name): Likewise.
20         (print_bytes): Likewise.
21         (print_form_data): Likewise. Based on code taken from...
22         (print_debug_macro_section): ...here. Now calls print_form_data
23         and str_offsets_base_off.
24         (print_debug_line_section): Parse DWARF5 header, directory and file
25         name tables.
26
27 2018-05-12  Mark Wielaard  <mark@klomp.org>
28
29         * addr2line.c (main): Add fflush (stdout) after handle_address ()
30         when reading from stdin.
31
32 2018-04-24  Mark Wielaard  <mark@klomp.org>
33
34         * readelf.c (print_debug_aranges_section): Try elf_rawdata if no
35         sectiondata.
36         (print_debug_ranges_section): Likewise.
37         (print_debug_frame_section): Likewise.
38         (print_debug_line_section): Likewise. Check for data == NULL.
39         (print_debug_loc_section): Likewise.
40         (print_debug_macinfo_section): Likewise.
41         (print_debug_macro_section): Likewise.
42
43 2018-04-28  Mark Wielaard  <mark@klomp.org>
44
45         * readelf.c (print_debug): If .debug_info is needed implicitly by
46         then handle it first before handling any other debug section.
47         (parse_opt): Set implicit_debug_sections to section_info when
48         showing all debug sections.
49
50 2018-05-05  Mark Wielaard  <mark@klomp.org>
51
52         * readelf.c (attr_callback): Handle DW_FORM_ref_sup4 and
53         DW_FORM_ref_sup8 as references.
54
55 2018-04-24  Mark Wielaard  <mark@klomp.org>
56
57         * readelf.c (print_debug_str_section): Take raw section data. Don't
58         use dwarf_getstring, but determine start and end of string from
59         offset and section data directly.
60         (print_debug): Handle ".debug_line_str" like ".debug_str".
61
62 2018-04-19  Andreas Schwab  <schwab@suse.de>
63
64         * elflint.c (valid_e_machine): Add EM_RISCV.
65
66 2018-04-16  Mark Wielaard  <mark@klomp.org>
67
68         * readelf.c (print_debug_line_section). In advance_pc, advance
69         using op_addr_advance, not op_advance.
70
71 2018-04-14  Mark Wielaard  <mark@klomp.org>
72
73         * readelf.c (attr_callback): Only show errors when not silent.
74
75 2018-03-23  Mark Wielaard  <mark@klomp.org>
76
77         * readelf.c (attr_callback): Handle DW_FORM_strx[1234].
78
79 2018-03-22  Mark Wielaard  <mark@klomp.org>
80
81         * readelf.c (attr_callback): Handle DW_FORM_addrx[1234].
82
83 2018-03-28  Mark Wielaard  <mark@klomp.org>
84
85         * readelf.c (handle_sysv_hash): Break bucket chain after nchain
86         entries are found.
87         (handle_sysv_hash64): Likewise.
88
89 2018-03-27  Mark Wielaard  <mark@klomp.org>
90
91         * readelf.c (attr_callback): Print dwarf_dieoffset as %PRIx64,
92         not %zx.
93
94 2018-03-20  Mark Wielaard  <mark@klomp.org>
95
96         * readelf.c (attr_callback): Report error when DW_AT_decl_file or
97         DW_AT_call_file cannot be resolved.
98
99 2018-03-06  Mark Wielaard  <mark@klomp.org>
100
101         * readelf.c (print_ops): Handle DW_OP_addrx, DW_OP_constx,
102         DW_OP_implicit_pointer, DW_OP_entry_value, DW_OP_const_type,
103         DW_OP_regval_type, DW_OP_deref_type, DW_OP_xderef_type,
104         DW_OP_convert, DW_OP_reinterpret.
105
106 2018-03-01  Mark Wielaard  <mark@klomp.org>
107
108         * readelf.c (struct listptr): Add attr field.
109         (compare_listptr): Warn when two listptrs for the same offset have
110         different attributes.
111         (notice_listptr): Take attr as argument and add it to listptr.
112         (skip_listptr_hole): New attr argument.
113         (next_listptr_offset): New function.
114         (print_debug_ranges_section): Pass NULL attr to skip_listptr_hole.
115         (attr_callback): Handle DW_AT_GNU_locviews. Call notice_listptr with
116         attr.
117         (print_debug_loc_section): Keep track of which attr is associated with
118         a listptr. If the attr is DW_AT_GNU_locview print view pairs till the
119         next listptr offset.
120
121 2018-02-09  Mark Wielaard  <mark@klomp.org>
122
123         * elflint.c (check_group): Make sure we can read a complete
124         element when iterating over the group.
125
126 2018-02-09  Mark Wielaard  <mark@klomp.org>
127
128         * readelf.c (attr_callback): Handle DW_FORM_data16 as Dwarf_Block.
129
130 2018-02-09  Mark Wielaard  <mark@klomp.org>
131
132         * readelf.c (print_debug_abbrev_section): Print the value of a
133         DW_FORM_implicit_const using dwarf_getabbrevattr_data.
134         (attr_callback): Handle DW_FORM_implicit_const.
135
136 2018-01-30  Mark Wielaard  <mark@klomp.org>
137
138         * readelf.c (dwarf_unit_string): New function.
139         (dwarf_unit_name): Likewise.
140         (print_debug_units): Use dwarf_get_units and dwarf_cu_die instead
141         of dwarf_next_unit. Print unit type, id and subdie if available.
142
143 2018-02-09  Joshua Watt  <JPEWhacker@gmail.com>
144
145         * addr2line.c (handle_address): Use FALLTHROUGH macro instead of
146         comment.
147         * elfcompress.c (parse_opt): Likewise.
148         * elflint.c (check_dynamic): Likewise.
149         (check_sections): Likewise.
150         (check_note_data): Likewise.
151         * objdump.c (parse_opt): Likewise.
152         * readelf.c (parse_opt): Likewise.
153         (attr_callback): Likewise.
154         (handle_auxv_note): Likewise.
155         * strings.c (parse_opt): Likewise.
156         * backtrace.c (callback_verify): Likewise.
157
158 2018-01-25  Mark Wielaard  <mark@klomp.org>
159
160         * readelf.c (print_debug_ranges_section): Initialize cu to last_cu.
161         (print_debug_loc_section): Likewise.
162
163 2018-01-01  Mark Wielaard  <mark@klomp.org>
164
165         * readelf.c (attr_callback): Use dwarf_form_name for unknown forms.
166         (print_debug_macro_section): Print form using dwarf_form_name.
167
168 2017-12-28  Mark Wielaard  <mark@klomp.org>
169
170         * readelf.c (print_debug_units): Print DIE offset in error message
171         as hex.
172
173 2017-12-18  Mark Wielaard  <mark@klomp.org>
174
175         * readelf.c (handle_notes_data): Don't use EXIT_FAILURE in error.
176         Adjust error message depending on whether or not we got data.
177
178 2017-12-07  Mark Wielaard  <mark@klomp.org>
179
180         * readelf.c (print_ops): Update data pointer and print arguments
181         to DW_OP_call2 and DW_OP_call4 as DIE offsets.
182
183 2017-11-29  Mark Wielaard  <mark@klomp.org>
184
185         * readelf.c (argp_options): Add "section-groups", 'g'.
186
187 2017-11-29  Mark Wielaard  <mark@klomp.org>
188
189         * readelf.c (print_debug_loc_section): Print CU base and unresolved
190         addresses. Adjust formatting.
191
192 2017-11-29  Mark Wielaard  <mark@klomp.org>
193
194         * readelf.c (print_debug_ranges_section): Print CU base and unresolved
195         addresses. Adjust formatting.
196
197 2017-11-29  Mark Wielaard  <mark@klomp.org>
198
199         * readelf.c (attr_callback): Set valuestr to resolved file name
200         for DW_AT_decl_file and DW_AT_call_file.
201
202 2017-11-29  Mark Wielaard  <mark@klomp.org>
203
204         * readelf.c (print_debug_units): Print abbrev code after DIE tag.
205
206 2017-11-29  Mark Wielaard  <mark@klomp.org>
207
208         * readelf.c (print_ops): Use only2 space for index. re-indent +5
209         for DW_OP_GNU_entry_value.
210
211 2017-11-21  Mark Wielaard  <mark@klomp.org>
212
213         * readelf.c (attr_callback): Print attribute name and form in error
214         message. If only the value cannot be retrieved/resolved don't abort.
215
216 2017-10-03  Mark Wielaard  <mark@klomp.org>
217
218         * readelf.c (attr_callback): Print DIE offset in error messages.
219
220 2017-11-03  Mark Wielaard  <mark@klomp.org>
221
222         * readelf.c (print_ops): Handle DW_OP_GNU_variable_value. Print
223         referenced DIE as offset.
224
225 2017-09-10  Mark Wielaard  <mark@klomp.org>
226
227         * ar.c (do_oper_delete): Remove DEBUG conditional check.
228         (no0print): Return bool. Check snprintf return value.
229         (do_oper_insert): Initialize elf. Remove DEBUG conditional check.
230         Check no0print calls succeed. Explicitly elf_end found elfs.
231         (do_oper_extract): Make sure we don't create an empty variable
232         length array.
233
234 2017-09-01  Mark Wielaard  <mark@klomp.org>
235
236         * stack.c (main): Replace \v in doc string with \n\n.
237         * unstrip.c (main): Likewise.
238
239 2017-05-04  Ulf Hermann  <ulf.hermann@qt.io>
240
241         * stack.c: Print pid_t using %lld.
242
243 2017-08-18  Ulf Hermann  <ulf.hermann@qt.io>
244
245         * readelf.c: Hardcode the signal numbers for non-linux systems.
246
247 2017-07-26  Mark Wielaard  <mark@klomp.org>
248
249         * readelf.c (print_debug_macro_section): Accept either version 4 or
250         version 5. Use DW_MACRO names instead of DW_MACRO_GNU names. Add
251         minimal support for DW_MACRO_define_sup, DW_MACRO_undef_sup,
252         DW_MACRO_import_sup, DW_MACRO_define_strx and DW_MACRO_undef_strx.
253
254 2017-07-26  Mark Wielaard  <mark@klomp.org>
255
256         * readelf.c (dwarf_defaulted_string): New function.
257         (dwarf_defaulted_name): Likewise.
258         (attr_callback): Use dwarf_defaulted_name to get value of
259         DW_AT_defaulted.
260
261 2017-07-20  Mark Wielaard  <mark@klomp.org>
262
263         * strip.c (handle_elf): Deal with data marker symbols pointing to
264         debug sections (they can be removed).
265
266 2017-07-14  Mark Wielaard  <mark@klomp.org>
267
268         * strip (OPT_KEEP_SECTION): New define.
269         (options): Add documentation for remove-section. Add keep-section.
270         (struct section_pattern): New data type.
271         (keep_secs, remove_secs): New globals.
272         (add_pattern, free_sec_patterns, free_patterns, section_name_matches):
273         New functions.
274         (main): Call free_patterns.
275         (parse_opt): Handle 'R' and OPT_KEEP_SECTION. Check remove_comment
276         on ARGP_KEY_SUCCESS.
277         (handle_elf): Handle and sanity check keep_secs and remove_secs.
278
279 2017-06-07  Mark Wielaard  <mark@klomp.org>
280
281         * strip.c (handle_elf): Introduce new handle_elf boolean. Use it to
282         determine whether to create an output and/or debug file. Remove new
283         output file on error.
284
285 2017-06-06  Mark Wielaard  <mark@klomp.org>
286
287         * strip.c (handle_elf): Assume e_shstrndx section can be removed.
288
289 2017-04-20  Ulf Hermann  <ulf.hermann@qt.io>
290
291         * readelf.c: Include strings.h.
292
293 2017-04-20  Ulf Hermann  <ulf.hermann@qt.io>
294
295         * unstrip.c: Check shnum for 0 before subtracting from it.
296
297 2017-04-20  Ulf Hermann <ulf.hermann@qt.io>
298
299         * readelf.c: Replace YESSTR and NOSTR with gettext ("yes") and
300         gettext ("no"), respectively.
301
302 2017-04-05  Mark Wielaard  <mark@klomp.org>
303
304         * elflint.c (check_elf_header): Decompress all sections.
305
306 2017-03-28  Mark Wielaard  <mark@klomp.org>
307
308         * elflint (check_group): Don't check if there is no flag word.
309
310 2017-03-27  Mark Wielaard  <mark@klomp.org>
311
312         * elflint.c (check_elf_header): Sanity check phnum and shnum.
313
314 2017-03-27  Mark Wielaard  <mark@klomp.org>
315
316         * elflint.c (check_sysv_hash): Return early if section size is
317         too small.
318         (check_sysv_hash64): Likewise.
319         (check_hash): Calculate expect_entsize to check section size.
320
321 2017-03-27  Mark Wielaard  <mark@klomp.org>
322
323         * elflint.c (check_symtab_shndx): Check data->d_size.
324
325 2017-03-24  Mark Wielaard  <mjw@redhat.com>
326
327         * elfcmp.c (main): If n_namesz == 0 then the note name data is the
328         empty string.
329         * readelf.c (handle_notes_data): Likewise.
330
331 2017-03-24  Mark Wielaard  <mjw@redhat.com>
332
333         * readelf.c (handle_gnu_hash): Check inner < max_nsyms before
334         indexing into chain array.
335
336 2017-02-16  Ulf Hermann  <ulf.hermann@qt.io>
337
338         * addr2line.c: Include printversion.h
339         * ar.c: Likewise.
340         * elflint.c: Likewise.
341         * nm.c: Likewise.
342         * objdump.c: Likewise.
343         * ranlib.c: Likewise.
344         * readelf.c: Likewise.
345         * size.c: Likewise.
346         * stack.c: Likewise.
347         * strings.c: Likewise.
348         * strip.c: Likewise.
349         * elfcmp.c: Include printversion.h, remove system.h include.
350         * elfcompress.c: Likewise.
351         * findtextrel.c: Likewise.
352         * unstrip.c: Likewise.
353
354 2017-02-14  Ulf Hermann  <ulf.hermann@qt.io>
355
356         * nm.c: Include color.h.
357         * objdump.c: Likewise.
358
359 2016-12-24  Mark Wielaard  <mark@klomp.org>
360
361         * Makefile.am (findtextrel_LDADD): Add $(libeu).
362         (addr2line_LDADD): Likewise.
363         (elfcmp_LDADD): Likewise.
364         * addr2line.c (print_version): Removed.
365         * ar.c (print_version): Likewise.
366         * elfcmp.c (print_version): Likewise.
367         * elfcompress.c (print_version): Likewise.
368         * elflint.c (print_version): Likewise.
369         * findtextrel.c (print_version): Likewise.
370         * nm.c (print_version): Likewise.
371         * objdump.c: Likewise.
372         * ranlib.c: Likewise.
373         * readelf.c: Likewise.
374         * size.c: Likewise.
375         * stack.c: Likewise.
376         * strings.c: Likewise.
377         * strip.c: Likewise.
378         * unstrip.c: Likewise.
379
380 2016-11-17  Mark Wielaard  <mjw@redhat.com>
381
382         * readelf.c (options): Add optional arg SECTION for symbols.
383         (symbol_table_section): New static variable.
384         (parse_opt): Set symbol_table_section on 's'.
385         (print_symtab): Filter on symbol_table_section name is set.
386
387 2016-11-10  Mark Wielaard  <mjw@redhat.com>
388
389         * ar.c (write_member): Make sure tmpbuf is large enough to contain
390         a starting '/' and ending '\0' char.
391         (do_oper_insert): Likewise.
392         * arlib.c (arlib_finalize): Format tmpbuf as PRId32 decimal.
393
394 2016-11-02  Mark Wielaard  <mjw@redhat.com>
395
396         * addr2line.c (handle_address): Add fallthrough comment.
397         * elfcompress.c (parse_opt): Adjust fallthrough comment.
398         * elflint.c (parse_opt): Add missing break after 'd' case.
399         (check_sections): Add fallthrough comments.
400         * objdump.c (parse_opt): Add explantion for fallthrough comment.
401
402 2016-10-22  Kevin Cernekee  <cernekee@chromium.org>
403
404         * unstrip.c: Fix "invalid string offset" error caused by using the
405           unstripped .symtab with the stripped .strtab.
406
407 2016-10-11  Akihiko Odaki  <akihiko.odaki.4i@stu.hosei.ac.jp>
408
409         * arlib.c: Remove system.h include, add libeu.h include.
410         * arlib2.c: Remove sys/param.h include.
411         * elfcompress.c: Add libeu.h include.
412         * elflint.c: Remove sys/param.h include, add libeu.h include.
413         * nm.c: Likewise.
414         * objdump.c: Likewise.
415         * ranlib.c: Likewise.
416         * readelf.c: Likewise.
417         * size.c: Remove sys/param.h include.
418         * strings.c: Likewise, add libeu.h include.
419         * strip.c: Likewise.
420         * unstrip.c: Likewise.
421
422 2016-10-06  Mark Wielaard  <mjw@redhat.com>
423
424         * strip.c (handle_elf): Don't remove real symbols from allocated
425         symbol tables.
426
427 2016-08-25  Mark Wielaard  <mjw@redhat.com>
428
429         * strip.c (handle_elf): Recompress with ELF_CHF_FORCE.
430
431 2016-08-06  Mark Wielaard  <mjw@redhat.com>
432
433         * strip.c (handle_elf): Uncompress and recompress relocation target
434         section if necessary.
435
436 2016-07-08  Mark Wielaard  <mjw@redhat.com>
437
438         * Makefile.am (strip_LDADD): Add libdw.
439         * elfcompress.c (process_file): Use dwelf_strtab functions instead of
440         ebl_strtab.
441         * strip.c (handle_elf): Likewise.
442         * unstrip.c (new_shstrtab): Likewise.
443
444 2016-07-06  Mark Wielaard  <mjw@redhat.com>
445
446         * elf32-i386.script, i386_ld.c, ld.c, ld.h, ldgeneric.c, ldlex.l,
447         ldscript.y, libld_elf_i386.map, none_ld.c, sectionhash.c,
448         sectionhash.h, symbolhash.c, symbolhash.h, unaligned.h,
449         versionhash.c, versionhash.h, xelf.h: Removed.
450         * Makefile.am (YACC): Removed.
451         (AM_YFLAGS): Removed.
452         (AM_LFLAGS): Removed.
453         (native_ld): Removed.
454         (base_cpu): Removed.
455         (bin_PROGRAMS): Removed ld.
456         (ld_dsos): Removed.
457         (ld_SOURCES): Removed.
458         (noinst_LIBRARIES): Only libar.a.
459         (EXTRA_DIST): Just arlib.h and debugpred.h.
460         (ld_LDADD): Removed.
461         (ld_LDFLAGS): Removed.
462         (ldlex.o): Removed.
463         (ldscript.h): Removed.
464         (libld*): Removed.
465         (CLEANFILES): Just *.gconv.
466         (MAINTAINERCLEANFILES): Removed.
467
468 2016-07-06  Mark Wielaard  <mjw@redhat.com>
469
470         * unstrip.c (copy_elided_sections): Use unstripped_strent[] from
471         index zero, instead of one.
472
473 2016-06-28  Richard Henderson <rth@redhat.com>
474
475         * elflint.c (valid_e_machine): Add EM_BPF.
476
477 2016-04-11  David Abdurachmanov  <davidlt@cern.ch>
478
479         * elfcmp.c (main): Fix self-comparison error with GCC 6.
480
481 2016-03-21  Mark Wielaard  <mjw@redhat.com>
482
483         * nm.c (show_symbols): Check for malloc size argument overflow.
484
485 2016-02-13  Mark Wielaard  <mjw@redhat.com>
486
487         * readelf.c (print_scngrp): Call error when gelf_getshdr fails.
488         (print_symtab): Likewise.
489         (handle_hash): Likewise.
490         (dump_data_section): Print a warning if decompressing fails.
491         (print_string_section): Likewise.
492
493 2016-02-13  Mark Wielaard  <mjw@redhat.com>
494
495         * elfcompress.c (parse_opt): Don't fallthrough after processing -q.
496
497 2016-02-12  Mark Wielaard  <mjw@redhat.com>
498
499         * strip.c (handle_elf): Correct elf_assert shndxdata check.
500
501 2016-02-09  Mark Wielaard  <mjw@redhat.com>
502
503         * readelf.c (read_encoded): Move up.
504         (print_cfa_program): Add encoding argument. Use it for read_encoded
505         when reading DW_CFA_set_loc op.
506         (print_debug_frame_section): Pass fde_encoding to print_cfa_program.
507
508 2016-02-09  Mark Wielaard  <mjw@redhat.com>
509
510         * elflint.c (compare_hash_gnu_hash): Check hash sh_entsize against
511         sizeof (Elf64_Xword). Correct invalid sh_entsize error message
512         section idx and name.
513
514 2016-01-13  Mark Wielaard  <mjw@redhat.com>
515
516         * elflint.c (check_elf_header): Recognize ELFOSABI_FREEBSD.
517
518 2016-01-08  Mark Wielaard  <mjw@redhat.com>
519
520         * elfcompress.c (compress_section): Use %zu to print size_t.
521         * readelf.c (print_shdr): Use %zx to print size_t.
522
523 2015-12-16  Mark Wielaard  <mjw@redhat.com>
524
525         * elfcompress.c: New file.
526         * Makefile.am (bin_PROGRAMS): Add elfcompress.
527         (elfcompress_LDADD): New variable.
528
529 2015-12-18  Mark Wielaard  <mjw@redhat.com>
530
531         * elflint.c (section_flags_string): Add NEWFLAG COMPRESSED.
532         (check_sections): SHF_COMPRESSED can be on any special section.
533         SHF_COMPRESSED is a valid section flag. SHF_COMPRESSED cannot
534         be used together with SHF_ALLOC or with SHT_NOBITS. Should have
535         a valid Chdr.
536
537 2015-10-20  Mark Wielaard  <mjw@redhat.com>
538
539         * readelf.c (options): Expand -z help text.
540         (dump_data_section): Check whether we need and can decompress section
541         data and call elf_rawzdata if so,
542         (print_string_section): Likewise.
543         (elf_contains_chdrs): New function.
544         (process_elf_file): Rename print_unrelocated to print_unchanged,
545         use elf_contains_chdrs.
546         (print_scngrp): Check whether section is compressed before use.
547         (print_symtab): Likewise.
548         (handle_hash): Likewise.
549
550 2015-10-16  Mark Wielaard  <mjw@redhat.com>
551
552         * readelf.c (argp_option): Describe --decompress,-z.
553         (print_decompress): New bool.
554         (parse_opt): Handle -z.
555         (elf_ch_type_name): New function.
556         (print_shdr): Print section compress information.
557
558 2015-12-31  Mark Wielaard  <mjw@redhat.com>
559
560         * elflint.c (check_symtab): Add _edata and _end (plus extra underscore
561         variants) to to the list of possibly dangling symbols.
562
563 2015-12-02  Mark Wielaard  <mjw@redhat.com>
564
565         * nm.c (process_file): Accept fd and pass it on.
566         (handle_elf): Likewise.
567         (find_no_debuginfo): New.
568         (struct getdbg): Likewise.
569         (getdbg_dwflmod): Likewise.
570         (show_symbols): Take fd. If the file is ET_REL use libdwfl to get
571         the relocated Dwarf.
572
573 2015-12-02  Mark Wielaard  <mjw@redhat.com>
574
575         * nm.c (get_local_names): Check for duplicates in local_root tree.
576
577 2015-12-02  Mark Wielaard  <mjw@redhat.com>
578
579         * unstrip.c (struct data_list): New.
580         (new_data_list): Likewise.
581         (record_new_data): Likewise.
582         (free_new_data): Likewise.
583         (adjust_relocs): Call record_new_data.
584         (add_new_section_symbols): Likewise.
585         (copy_elided_sections): Call free_new_data.
586
587 2015-12-01  Mark Wielaard  <mjw@redhat.com>
588
589         * elfcmp.c (main): Close ebl1 and ebl2 backends.
590
591 2015-10-16  Mark Wielaard  <mjw@redhat.com>
592
593         * Makefile.am [BUILD_STATIC](libdw): Add -lz.
594         [BUILD_STATIC](libelf): Likewise.
595
596 2015-10-16  Mark Wielaard  <mjw@redhat.com>
597
598         * elflint.c (check_symtab): Don't check TLS symbol value against TLS
599         phdr offset in debuginfo files.
600         (check_sections): Don't try to match section offsets to phdrs offsets
601         in debuginfo files.
602
603 2015-10-16  Mark Wielaard  <mjw@redhat.com>
604
605         * elflint.c (check_reloc_shdr): Reject only desthdrs if they have both
606         SHF_MERGE and SHF_STRINGS set.
607
608 2015-10-13  Jose E. Marchesi  <jose.marchesi@oracle.com>
609
610         * elflint.c (check_sections): Do not rely on
611         ebl_check_special_section when checking debuginfo files.  Also
612         check that the type of WE sections in debuginfo files is NOBITS.
613
614 2015-10-13  Mark Wielaard  <mjw@redhat.com>
615
616         * elflint.c (check_program_header): Check relro flags are a subset
617         of the load segment if they don't fully overlap.
618
619 2015-10-07  Mark Wielaard  <mjw@redhat.com>
620
621         * Makefile.am (ldlex_no_Wstack_usage): New.
622         * ldlex.l ([RWX]): Make cnt unsigned.
623
624 2015-10-09  Josh Stone  <jistone@redhat.com>
625
626         * elflint.c (main): Replace stat64 and fstat64 with stat and fstat.
627         * readelf.c (process_file): Likewise.
628         (process_elf_file): Replace off64_t with off_t.
629         * findtextrel.c (process_file): Replace open64 with open.
630         * ld.c (main): Replace sizeof (off64_t) with 8.
631         * strings.c: Replace off64_t with off_t throughout.
632         (main): Replace stat64 and fstat64 with stat and fstat.
633         (map_file): Replace mmap64 with mmap.
634         (read_block): Likewise, and replace lseek64 with lseek.
635         * strip.c (handle_elf): Replace ftruncate64 with ftruncate.
636         (process_file): Replace stat64 and fstat64 with stat and fstat.
637         * unstrip.c (parse_opt): Replace stat64 with stat.
638         (handle_file): Replace open64 with open.
639         (open_file): Likewise.
640
641 2015-10-08  Chih-Hung Hsieh  <chh@google.com>
642
643         * ld.c (determine_output_format): Move recursive nested
644         function "try" to file scope.
645
646 2015-10-04  Mark Wielaard  <mjw@redhat.com>
647
648         * strip.c (handle_elf): Only sanity check section symbols to not
649         kept discarded sections if we are creating a debug file.
650
651 2015-10-07  Mark Wielaard  <mjw@redhat.com>
652
653         * unstrip.c (MAX): Removed.
654         (find_alloc_sections_prelink): Allocate exact amount of bytes for
655         shdrs.
656
657 2015-10-05  Chih-Hung Hsieh <chh@google.com>
658
659         * unstrip.c (find_alloc_sections_prelink): Do not allocate
660         on stack union types with variable length arrays; use xmalloc
661         for such dynamic sized objects.
662         * readelf.c (handle_core_item): Likewise, but use alloca
663         for small variable size data object and add assert(count < 128).
664
665 2015-10-05  Josh Stone  <jistone@redhat.com>
666
667         * Makefile.am (libld_elf_i386.so): Add AM_V_CCLD silencer.
668         (.deps/none_ld.Po): Always silence the dummy command.
669         (make-debug-archive): Add AM_V_GEN and AM_V_at silencers.
670
671 2015-10-02  Mark Wielaard  <mjw@redhat.com>
672
673         * unstrip.c (copy_elided_sections): Use SH_INFO_LINK_P, not just
674         SHF_INFO_LINK.
675
676 2015-10-02  Mark Wielaard  <mjw@redhat.com>
677
678         * strip.c (handle_elf): Don't move around allocated NOBITS sections.
679         Don't just mark the section header string table as unused.
680         * unstrip.c (copy_elided_sections): Add header names to strtab if
681         shstrndx equals the symtab strtabndx.
682
683 2015-09-22  Mark Wielaard  <mjw@redhat.com>
684
685         * strip.c (cleanup_debug): Remove old-style function definitions.
686
687 2015-09-09  Chih-Hung Hsieh  <chh@google.com>
688
689         * readelf.c (print_debug_exception_table): Initialize variable before
690         it is used, because compiler does not know that error never returns.
691         (dump_arhive_index): Likewise.
692
693 2015-09-04  Chih-Hung Hsieh  <chh@google.com>
694
695         * elflint.c (check_group): Replace %Z length modifier with %z.
696         (check_note_data): Likewise.
697         * findtextrel.c (process_file): Likewise.
698         * readelf.c (handle_dynamic): Likewise.
699         (handle_symtab): Likewise.
700         (handle_verneed): Likewise.
701         (handle_verdef): Likewise.
702         (handle_versym): Likewise.
703         (print_hash_info): Likewise.
704         (print_decoded_aranges_section): Likewise.
705         (print_debug_aranges_section): Likewise.
706         (print_debug_line_section): Likewise.
707         (hex_dump): Likewise.
708         (dump_data_section): Likewise.
709         (print_string_section): Likewise.
710         (dump_archive_index): Likewise.
711         * unstrip.c (adjust_relocs): Likewise.
712         (collect_symbols): likewise.
713         (get_section_name): Likewise.
714         (find_alloc_sections_prelink): Likewise.
715         (copy_elided_sections): Likewise.
716         * ldscript.y (add_id_list): Add missing '%s'.
717
718 2015-09-03  Mark Wielaard  <mjw@redhat.com>
719
720         * readelf.c (handle_core_item): Handle right shift >= 32 bits.
721
722 2015-08-11  Mark Wielaard  <mjw@redhat.com>
723
724         * elflint.c (check_sections): When gnuld and a NOBITS section falls
725         inside a segment make sure any ELF file contents is zero.
726
727 2015-07-29  Mark Wielaard  <mjw@redhat.com>
728
729         * unstrip.c (sections_flags_match): New function.
730         (sections_match): Use sections_flags_match.
731         (find_alloc_sections_prelink): Only clear matched sections if there
732         is an undo section.
733         (copy_elided_sections): Add SHF_INFO_LINK to shdr_mem.sh_flags if
734         necessary.
735
736 2015-06-27  Pino Toscano  <toscano.pino@tiscali.it>
737
738         * src/strings.c: Define MAP_POPULATE if not defined already.
739
740 2015-06-27  Mark Wielaard  <mjw@redhat.com>
741
742         * nm.c (show_symbols): First call elf_getdata, then allocate memory.
743
744 2015-06-18  Mark Wielaard  <mjw@redhat.com>
745
746         * findtextrel.c (process_file): Free segments after use.
747
748 2015-06-18  Mark Wielaard  <mjw@redhat.com>
749
750         * readelf.c (print_phdr): Make sure phdr2_mem lifetime/scope equals
751         phdr2 pointer.
752
753 2015-06-18  Mark Wielaard  <mjw@redhat.com>
754
755         * readelf.c (handle_gnu_hash): Free lengths on invalid_data.
756
757 2015-06-18  Mark Wielaard  <mjw@redhat.com>
758
759         * elflint.c (check_symtab): Only check the PT_TLS phdr if it actually
760         exists. Warn otherwise.
761
762 2015-06-18  Mark Wielaard  <mjw@redhat.com>
763
764         * nm.c (show_symbols): Check sizeof (sym_mem[0]), not GElf_Sym to
765         known whether or not we stack allocated memory.
766
767 2015-06-18  Mark Wielaard  <mjw@redhat.com>
768
769         * strings.c (readelf): Use "<unknown>" if we cannot retrieve section
770         name.
771
772 2015-06-09  Mark Wielaard  <mjw@redhat.com>
773
774         * addr2line.c (print_dwarf_function): Always free scopes before
775         returning.
776
777 2015-06-09  Mark Wielaard  <mjw@redhat.com>
778
779         * strip.c (handle_ar): Mark as unused.
780         (process_file): Produce an error when trying to handle an ar.
781
782 2015-05-30  Mark Wielaard  <mjw@redhat.com>
783
784         * elfcmp.c (main): Only call memcmp when d_size != 0.
785
786 2015-05-23  Mark Wielaard  <mjw@redhat.com>
787
788         * Makefile.am: Define ldgeneric, readelf, nm, size, strip, elflint,
789         findtextrel, elfcmp objdump, ranlib, ar and unstrip no_Wstack_usage.
790
791 2015-05-21  Mark Wielaard  <mjw@redhat.com>
792
793         * addr2line.c (handle_address): Set scopes to NULL after free.
794
795 2015-05-20  Mark Wielaard  <mjw@redhat.com>
796
797         * addr2line.c (OPT_PRETTY): New constant define.
798         (argp_option): Add "pretty-print".
799         (pretty): New static bool.
800         (parse_opt): Set pretty.
801         (print_dwarf_function): Adjust output when pretty is set.
802         (print_addrsym): Likewise.
803         (handle_address): Likewise.
804
805 2015-05-20  Mark Wielaard  <mjw@redhat.com>
806
807         * Makefile.am (addr2line_LDADD): Add demanglelib.
808         * addr2line.c (argp_option): Move demangle under output format.
809         (demangle): New static bool.
810         (demangle_buffer_len): New static size_t.
811         (demangle_buffer): New static char *.
812         (main): free demangle_buffer.
813         (parse_opt): Set demangle.
814         (symname): New static function.
815         (get_diename): Use symname.
816         (print_dwarf_function): Likewise.
817         (print_addrsym): Likewise.
818         (handle_address): Likewise.
819
820 2015-05-20  Mark Wielaard  <mjw@redhat.com>
821
822         * addr2line.c (argp_option): Add "addresses", 'a'.
823         (print_addresses): New static bool.
824         (parse_opt): Set print_addresses.
825         (get_addr_width): New static function.
826         (handle_address): Print address if print_addresses is true.
827
828 2015-05-20  Mark Wielaard  <mjw@redhat.com>
829
830         * addr2line.c (handle_address): Call strtoumax with base 16. Make
831         sure all input has been processed.
832
833 2015-05-20  Mark Wielaard  <mjw@redhat.com>
834
835         * addr2line (argp_option): Group 'section' under "Input format
836         options".
837
838 2015-05-12  Mark Wielaard  <mjw@redhat.com>
839
840         * strip.c (debug_fd): New static variable.
841         (tmp_debug_fname): Likewise.
842         (cleanup_debug): New function using the above to clean up temporary
843         debug file.
844         (INTERNAL_ERROR): Call cleanup_debug.
845         (handle_elf): Use debug_fd and tmp_debug_fname statics and call
846         cleanup_debug before any error. Use output_fname instead of fname in
847         error messages when it exists (-o was given). SHT_NOBITS sections
848         can also be moved freely even if SHF_ALLOC is set. Add various
849         sanity checks. Use elf_assert instead of plain assert.
850
851 2015-05-08  Mark Wielaard  <mjw@redhat.com>
852
853         * nm.c (show_symbols): Call gelf_fsize with EV_CURRENT.
854         * strip.c (handle_elf): Likewise.
855
856 2015-05-06  Mark Wielaard  <mjw@redhat.com>
857
858         * elflint.c (check_gnu_hash): Return early when 2nd hash function
859         shift too big. Check there is enough data available. Make sure
860         bitmask_words is not zero.
861         (check_verdef): Use Elf64_Word for shdr->sh_info cnt.
862         (check_verneed): Likewise.
863         (check_attributes): Break when vendor name isn't terminated.
864         Add overflow check for subsection_len.
865
866 2015-05-05  Mark Wielaard  <mjw@redhat.com>
867
868         * nm.c (show_symbols): Handle dwarf_linesrc returning NULL.
869
870 2015-05-04  Max Filippov  <jcmvbkbc@gmail.com>
871
872         * ar.c (do_oper_extract): Replace struct timeval with struct timespec
873         and futimes with futimens.
874         * strip.c (process_file): Replace struct timeval with struct timespec.
875         (handle_elf, handle_ar): Replace struct timeval with struct timespec
876         in prototype. Replace futimes with futimens.
877
878 2015-05-04  Max Filippov  <jcmvbkbc@gmail.com>
879
880         * addr2line.c (main): Drop mtrace() call and #include <mcheck.h>.
881         * ar.c: Likewise.
882         * ld.c: Likewise.
883         * nm.c: Likewise.
884         * objdump.c: Likewise.
885         * ranlib.c: Likewise.
886         * size.c: Likewise.
887         * strip.c: Likewise.
888         * unstrip.c: Likewise.
889
890 2015-05-04  Anthony G. Basile  <blueness@gentoo.org>
891
892         * Makefile.am (readelf_LDADD, nm_LDADD, size_LDADD, strip_LDADD)
893         (ld_LDADD, elflint_LDADD, findtextrel_LDADD, addr2line_LDADD)
894         (elfcmp_LDADD, objdump_LDADD, ranlib_LDADD, strings_LDADD)
895         (ar_LDADD, unstrip_LDADD, stack_LDADD): Append $(argp_LDADD).
896
897 2015-03-22  Mark Wielaard  <mjw@redhat.com>
898
899         * readelf.c (print_debug_frame_section): Cast start to Dwarf_Off
900         before subtracting cie_id. And cast cie_offset to Dwarf_Off before
901         comparison.
902
903 2015-03-22  Mark Wielaard  <mjw@redhat.com>
904
905         * readelf.c (print_gdb_index_section): Check all offsets used
906         against section d_size.
907
908 2015-03-17  Mark Wielaard  <mjw@redhat.com>
909
910         * readelf.c (print_debug): Don't return, but always use dummy_dbg.
911
912 2015-03-17  Mark Wielaard  <mjw@redhat.com>
913
914         * readelf.c (print_gdb_index_section): Add overflow checking for
915         dataend checks.
916
917 2015-03-14  Mark Wielaard  <mjw@redhat.com>
918
919         * nm.c (INTERNAL_ERROR): Remove __DATE__.
920         * objdump.c (INTERNAL_ERROR): Likewise.
921         * size.c (INTERNAL_ERROR): Likewise.
922         * strip.c (INTERNAL_ERROR): Likewise.
923
924 2015-03-18  Petr Machata  <pmachata@redhat.com>
925
926         * readelf.c (dwarf_tag_string, dwarf_attr_string)
927         (dwarf_form_string, dwarf_lang_string, dwarf_inline_string)
928         (dwarf_encoding_string, dwarf_access_string)
929         (dwarf_visibility_string, dwarf_virtuality_string)
930         (dwarf_identifier_case_string, dwarf_calling_convention_string)
931         (dwarf_ordering_string, dwarf_discr_list_string)
932         (dwarf_locexpr_opcode_string): Adjust uses of know-dwarf.h macros
933         to match the API changes.
934
935 2015-03-09  Mark Wielaard  <mjw@redhat.com>
936
937         * elflint.c (compare_hash_gnu_hash): Correct gnu_symbias usage.
938
939 2015-01-03  Mark Wielaard  <mjw@redhat.com>
940
941         * elfcmp (main): Check section name is not NULL. Check sh_entsize
942         is not zero for symbol tables. Check phdrs are not NULL.
943         (search_for_copy_reloc): Check sh_entsize is not zero.
944
945 2014-12-30  Mark Wielaard  <mjw@redhat.com>
946
947         * elflint.c (check_scn_group): Check d_buf and name are not NULL.
948         (is_rel_dyn): Check d is not NULL. Check shdr->sh_entsize is not
949         zero.
950         (check_dynamic): Check strshdr is not NULL. Check d_tag is positive.
951         (check_symtab_shndx): Check symshdr and data->d_buf are not NULL.
952         Check shdr and symshdr sh_entsize are not zero.
953         (check_gnu_hash): Make sure maskidx is smaller than bitmask_words.
954         Check symshdr->sh_entsize is not zero. Check data->d_buf is not
955         NULL.
956         (compare_hash_gnu_hash): Check sections d_buf are not NULL.
957         Check section data is large enough. Use gnu_symbias.
958         (check_group): Check section val is valid.
959         (has_copy_reloc): Check sh_entsize is not zero.
960         (check_versym): Likewise.
961         (unknown_dependency_p): Likewise.
962         (check_verneed): Break on invalid ref or offset. Don't assert.
963         Report error when next offset is zero, but more vers expected.
964         (check_verdef): Likewise.
965         (check_attributes): Make sure d_buf is not NULL.
966         (check_note): Likewise.
967         (check_note_section): Likewise.
968         (check_program_header): Make sure section name is not NULL.
969
970 2014-12-26  Mark Wielaard  <mjw@redhat.com>
971
972         * strings.c (read_elf): Produce error when section data falls outside
973         file.
974
975 2014-12-26  Mark Wielaard  <mjw@redhat.com>
976
977         * nm.c (show_symbols): Guard against divide by zero in error check.
978         Add section index number in error message.
979
980 2014-12-26  Mark Wielaard  <mjw@redhat.com>
981
982         * nm.c (handle_ar): Skip over /SYM64/ entries.
983
984 2014-12-26  Mark Wielaard  <mjw@redhat.com>
985
986         * nm.c (handle_ar): Break on arsym with invalid offset.
987
988 2014-12-20  Mark Wielaard  <mjw@redhat.com>
989
990         * readelf.c (print_debug_macinfo_section): Mark cus sentinel files
991         as -1 non-existent. Check macoff against sentinel cus.
992
993 2014-12-20  Mark Wielaard  <mjw@redhat.com>
994
995         * readelf.c (print_debug_exception_table): Add max_action overflow
996         check. Check action_table_end before reading slib128. Check
997         max_ar_filter underflow.
998
999 2014-12-18  Ulrich Drepper  <drepper@gmail.com>
1000
1001         * Makefile.am: Suppress output of textrel_check command.
1002
1003 2014-12-17  Mark Wielaard  <mjw@redhat.com>
1004
1005         * readelf.c (print_cfa_program): Add bounds check before each op that
1006         takes at least one argument.
1007
1008 2014-12-16  Mark Wielaard  <mjw@redhat.com>
1009
1010         * readelf.c (print_decoded_line_section): Print dwarf_errmsg if
1011         dwarf_onesrcline or dwarf_linesrc fails.
1012
1013 2014-12-16  Mark Wielaard  <mjw@redhat.com>
1014
1015         * readelf.c (print_debug_line_section): Correct overflow check for
1016         unit_length.
1017         (print_debug_aranges_section): Correct overflow check for length.
1018
1019 2014-12-15  Mark Wielaard  <mjw@redhat.com>
1020
1021         * readelf.c (notice_listptr): Return false if offset doesn't fit
1022         in 61-bits.
1023         (attr_callback): Warn if loclist or rangelist offset doesn't fit.
1024
1025 2014-12-15  Mark Wielaard  <mjw@redhat.com>
1026
1027         * readelf.c (print_ops): Don't assert when addr_size or ref_size
1028         is not 4 or 8, just report invalid data.
1029
1030 2014-12-15  Mark Wielaard  <mjw@redhat.com>
1031
1032         * readelf.c (print_gdb_index_section): Add more bounds checks.
1033
1034 2014-12-15  Mark Wielaard  <mjw@redhat.com>
1035
1036         * readelf.c (print_debug_line_section): Check there is enough room
1037         for DW_LNE_set_address argument. Make sure there is enough room
1038         for the the initial unit_length.
1039
1040 2014-12-14  Mark Wielaard  <mjw@redhat.com>
1041
1042         * elflint.c (check_attributes): Call get_uleb128 with end pointer.
1043         * readelf.c (print_attributes): Likewise.
1044         (print_ops): Likewise and also for get_sleb128.
1045         (print_cfa_program): Likewise and add more readp bounds checks.
1046         (read_encoded): Likewise.
1047         (print_debug_frame_section): Likewise.
1048         (print_debug_line_section): Likewise.
1049         (print_debug_macinfo_section): Likewise.
1050         (print_debug_macro_section): Likewise.
1051         (print_debug_exception_table): Likewise.
1052
1053 2014-12-16  Mark Wielaard  <mjw@redhat.com>
1054
1055         * elfcmp.c (compare_Elf32_Word): Make sure (unsigned) Elf32_Word
1056         difference doesn't wrap around before returning as int.
1057
1058 2014-12-11  Mark Wielaard  <mjw@redhat.com>
1059
1060         * readelf.c (print_debug_exception_table): Check TType base offset
1061         and Action table are sane.
1062
1063 2014-12-11  Mark Wielaard  <mjw@redhat.com>
1064
1065         * readelf.c (print_debug_frame_section): Check number of augmentation
1066         chars to print.
1067
1068 2014-12-09  Mark Wielaard  <mjw@redhat.com>
1069
1070         * readelf.c (handle_file_note): Check count fits data section and
1071         doesn't overflow fptr.
1072
1073 2014-12-08  Mark Wielaard  <mjw@redhat.com>
1074
1075         * readelf.c (print_debug_exception_table): Report invalid data if
1076         action table doesn't immediately follow call site table.
1077
1078 2014-12-10  Josh Stone  <jistone@redhat.com>
1079
1080         * addr2line.c (get_diename): New, get linkage_name or name.
1081         * addr2line.c (print_dwarf_function): Use get_diename.
1082         * addr2line.c (handle_address): Likewise.
1083         * addr2line.c (print_diesym): Removed.
1084
1085 2014-12-10  Josh Stone  <jistone@redhat.com>
1086
1087         * addr2line.c (handle_address): Find the proper inline parents.
1088
1089 2014-12-07  Mark Wielaard  <mjw@redhat.com>
1090
1091         * readelf.c (print_debug_line_section): max_ops_per_instr cannot
1092         be zero.
1093
1094 2014-12-07  Mark Wielaard  <mjw@redhat.com>
1095
1096         * readelf.c (print_ops): Handle zero ref_size for DW_OP_call_ref
1097         and DW_OP_GNU_implicit_pointer.
1098
1099 2014-12-04  Mark Wielaard  <mjw@redhat.com>
1100
1101         * objdump.c (show_relocs_x): Make sure destshdr exists.
1102         (show_relocs_rel): Don't rely on shdr->sh_entsize, use gelf_fsize.
1103         (show_relocs_rela): Likewise.
1104         (show_relocs): Make sure destshdr, symshdr and symdata exists.
1105
1106 2014-11-30  Mark Wielaard  <mjw@redhat.com>
1107
1108         * readelf.c (handle_sysv_hash64): Fix overflow check.
1109
1110 2014-11-28  Mark Wielaard  <mjw@redhat.com>
1111
1112         * readelf.c (handle_relocs_rel): Don't reuse destshdr to store
1113         section header of a relocation against a STT_SECTION symbol. Use
1114         a new local variable secshdr.
1115         (handle_relocs_rela): Likewise.
1116
1117 2014-11-26  Mark Wielaard  <mjw@redhat.com>
1118
1119         * readelf.c (print_debug_aranges_section): Cast Dwarf_Word length
1120         to ptrdiff_t for comparison.
1121
1122 2014-11-24  Mark Wielaard  <mjw@redhat.com>
1123
1124         * readelf.c (print_debug_line_section): Check line_range is not zero
1125         before usage.
1126
1127 2014-11-23  Mark Wielaard  <mjw@redhat.com>
1128
1129         * readelf.c (print_debug_aranges_section): Check length to catch
1130         nexthdr overflow.
1131
1132 2014-11-21  Mark Wielaard  <mjw@redhat.com>
1133
1134         * readelf.c (print_attributes): Guard against empty section.
1135         Document attribute format. Break when vendor name isn't terminated.
1136         Add overflow check for subsection_len. Handle both gnu and non-gnu
1137         attribute tags.
1138
1139 2014-11-22  Mark Wielaard  <mjw@redhat.com>
1140
1141         * elflint.c (check_sections): Call ebl_bss_plt_p without ehdr.
1142         * findtextrel.c (process_file): Use elf_getphdrnum.
1143         * readelf.c (process_elf_file): Remove redundant ehdr->e_phoff check.
1144         (print_phdr): Check phnum.
1145         * size.c (show_segments): Use elf_getphdrnum.
1146         * strip.c (handle_elf): Likewise.
1147         * unstrip.c (copy_elf): Likewise.
1148         (copy_elided_sections): Likewise.
1149         (handle_file): Likewise.
1150
1151 2014-11-18  Mark Wielaard  <mjw@redhat.com>
1152
1153         * readelf.c (print_cfa_program): Fix sanity check of DW_FORM_block
1154         length.
1155
1156 2014-11-17  Mark Wielaard  <mjw@redhat.com>
1157
1158         * readelf.c (handle_verneed): Check vna_next and vn_next exist.
1159         (handle_verdef): Check vda_next and vd_next exist.
1160         (handle_versym): Check vd_next, vna_next and vn_next exist.
1161         Check vername and filename are not NULL before use.
1162
1163 2014-11-17  Mark Wielaard  <mjw@redhat.com>
1164
1165         * elfcmp.c (main): Check section names are NULL before use.
1166         * objdump.c (section_match): Likewise.
1167         * size.c (show_sysv): Likewise.
1168
1169 2014-11-17  Mark Wielaard  <mjw@redhat.com>
1170
1171         * readelf.c (print_debug_frame_section): Warn if ptr_size is not 4
1172         or 8 instead of just calling print_cfa_program.
1173
1174 2014-11-16  Mark Wielaard  <mjw@redhat.com>
1175
1176         * readelf (process_elf_file): Set phnum to zero if there aren't
1177         actually any pheaders.
1178         (print_phdr): Check there actually is a phdr.
1179
1180 2014-11-16  Mark Wielaard  <mjw@redhat.com>
1181
1182         * readelf.c (print_cfa_program): Check block len before calling
1183         print_ops.
1184
1185 2014-11-14  Mark Wielaard  <mjw@redhat.com>
1186
1187         * readelf.c (print_debug_frame_section): Sanity Check CIE
1188         unit_length and augmentationlen.
1189
1190 2014-11-14  Mark Wielaard  <mjw@redhat.com>
1191
1192         * readelf.c (handle_versym): Check def == NULL before use.
1193
1194 2014-11-08  Mark Wielaard  <mjw@redhat.com>
1195
1196         * readelf.c (handle_versym): Initialize vername and filename array
1197         elements.
1198
1199 2014-11-07  Mark Wielaard  <mjw@redhat.com>
1200
1201         * readelf.c (handle_sysv_hash): Sanity check section contents.
1202         (handle_sysv_hash64): Likewise.
1203         (handle_gnu_hash): Likewise.
1204
1205 2014-09-14  Petr Machata  <pmachata@redhat.com>
1206
1207         * readelf.c (handle_relocs_rela): Typo fix, test DESTSHDR properly.
1208
1209 2014-09-12  Petr Machata  <pmachata@redhat.com>
1210
1211         * readelf.c (encoded_ptr_size): In the switch statement, change
1212         magic constants 3 and 4 to DW_EH_PE_* counterparts.  Still accept
1213         0.  Print diagnostic for anything else.
1214
1215 2014-08-25  Josh Stone  <jistone@redhat.com>
1216
1217         * Makefile.am: Prevent premature @AR@ replacement in a sed expression.
1218
1219 2014-07-04  Menanteau Guy  <menantea@linux.vnet.ibm.com>
1220             Mark Wielaard  <mjw@redhat.com>
1221
1222         * elflint (check_symtab): Add ".TOC." to the list of possibly
1223         dangling symbols because of sourceware PR13621.
1224
1225 2014-06-14  Mark Wielaard  <mjw@redhat.com>
1226
1227         * elflint (check_symtab): Use ebl_func_addr_mask on st_value.
1228
1229 2014-05-27  Mark Wielaard  <mjw@redhat.com>
1230
1231         * readelf.c (print_debug): Skip section if name is NULL.
1232
1233 2014-05-26  Mark Wielaard  <mjw@redhat.com>
1234
1235         * readelf.c (handle_relocs_rela): Print header like handle_relocs_rel
1236         does, when sh_info == 0.
1237
1238 2014-05-26  Mark Wielaard  <mjw@redhat.com>
1239
1240         * unstrip.c (find_alloc_sections_prelink): Allow non-split .bss
1241         section when sh_size of the original and undo .bss section are equal.
1242
1243 2014-05-26  Mark Wielaard  <mjw@redhat.com>
1244
1245         * unstrip.c (options): Add --force, -F.
1246         (struct arg_info): Add bool force.
1247         (parse_opt): Handle 'F', set force.
1248         (handle_explicit_files): Add force argument, add warn function,
1249         separate check ehdr field checks, use warn.
1250         (handle_dwfl_module): Add force argument, pass on to
1251         handle_explicit_files.
1252         (handle_output_dir_module): Add force argument, pass on to
1253         handle_dwfl_module.
1254         (handle_implicit_modules): Pass info->force to handle_dwfl_module and
1255         handle_output_dir_module.
1256         (main): Pass info.force to handle_explicit_files.
1257
1258 2014-05-19  Mark Wielaard  <mjw@redhat.com>
1259
1260         * elflint.c (check_reloc_shdr): Check ebl_check_reloc_target_type.
1261
1262 2014-05-01  Mark Wielaard  <mjw@redhat.com>
1263
1264         * readelf.c (find_no_debuginfo): Call dwfl_standard_find_debuginfo
1265         if looking for alternate debug file.
1266
1267 2014-04-11  Mark Wielaard  <mjw@redhat.com>
1268
1269         * Makefile.am (AM_CPPFLAGS): Add -I libdwelf.
1270
1271 2014-04-22  Mark Wielaard  <mjw@redhat.com>
1272
1273         * readelf.c (handle_core_item): Make sure variable length array
1274         contains at least enough space for terminating zero char.
1275
1276 2014-04-22  Mark Wielaard  <mjw@redhat.com>
1277
1278         * readelf.c (print_gdb_index_section): Use unsigned int for 31 bits
1279         left shift.
1280
1281 2014-03-13  Mark Wielaard  <mjw@redhat.com>
1282
1283         * Makefile.am: Remove no_mudflap.os. Remove libmudflap from all
1284         LDADD lines.
1285         * strings.c (process_chunk): Remove _MUDFLAP condition.
1286
1287 2014-04-09  Mark Wielaard  <mjw@redhat.com>
1288
1289         * readelf.c (print_debug_aranges_section): Don't get the raw section
1290         data, use the possibly decompressed .[z]debug sectiondata.
1291         (print_debug_ranges_section): Likewise.
1292         (print_debug_frame_section): Likewise.
1293         (print_debug_line_section): Likewise.
1294         (print_debug_loc_section): Likewise.
1295         (print_debug_macinfo_section): Likewise.
1296         (print_debug_macro_section): Likewise.
1297
1298 2014-04-10  Mark Wielaard  <mjw@redhat.com>
1299
1300         * readelf.c (buf_read_ulong): Pass actual long size to convert.
1301
1302 2014-03-05  Mark Wielaard  <mjw@redhat.com>
1303
1304         * readelf.c (attr_callback): Print DW_FORM_sdata values as signed
1305         numbers.
1306
1307 2014-02-24  Mark Wielaard  <mjw@redhat.com>
1308
1309         * readelf (print_phdr): Check there is a SHT_PROGBITS section at the
1310         offset given by p_offsets for a PT_INTERP segment before trying to
1311         display the interpreter string.
1312
1313 2014-02-07  Mark Wielaard  <mjw@redhat.com>
1314
1315         * readelf.c (print_phdr): Check phdr->p_filesz and make sure
1316         interpreter string is zero terminated before calling printf.
1317
1318 2014-01-22  Mark Wielaard  <mjw@redhat.com>
1319
1320         * Makefile.am (nm_no_Wformat): Removed.
1321         (size_no_Wformat): Likewise.
1322         (strings_no_Wformat): Likewise.
1323         (addr2line_no_Wformat): Likewise.
1324         * size.c (show_sysv): Use fmtstr directly as literal in printf.
1325         (show_sysv_one_line): Likewise.
1326         * strings.c (locfmt): Removed.
1327         (radix): New static enum.
1328         (parse_opt): Set radix, not locfmt.
1329         (process_chunk_mb): Use fmtstr directly as literal in printf based
1330         on radix.
1331         (process_chunk): Likewise.
1332         * nm.c (show_symbols_sysv): Use fmtstr directly as literal in printf.
1333         (show_symbols_bsd): Likewise.
1334         (show_symbols_posix): Likewise.
1335
1336 2014-01-21  Mark Wielaard  <mjw@redhat.com>
1337
1338         * stack.c (show_inlines): New static boolean.
1339         (print_frame): New function split out from...
1340         (print_frames): ..here. If show_inlines is true and we found a
1341         DIE for the frame address, call print_inline_frames otherwise
1342         call print_frame. Keep track of and track frame_nr.
1343         (print_inline_frames): New function.
1344         (parse_opt): Handle '-i'.
1345         (main): Add 'i' to options.
1346
1347 2014-01-27  Mark Wielaard  <mjw@redhat.com>
1348
1349         * stack.c (maxframes): Initialize to 256.
1350         (main): Document new default in options. Document magic number
1351         used in frames.allocated initialization.
1352
1353 2014-01-20  Mark Wielaard  <mjw@redhat.com>
1354
1355         * stack.c (show_debugname): New static boolean.
1356         (die_name): New function.
1357         (print_frames): If show_debugname is true set symname to the
1358         first function-like DIE with a name in scope for the address in
1359         the debuginfo.
1360         (parse_opt): Handle '-d'.
1361         (main): Add 'd' to options.
1362
1363 2014-01-20  Mark Wielaard  <mjw@redhat.com>
1364
1365         * addr2line.c (handle_address): Initialize scopes to NULL.
1366
1367 2014-01-17  Roland McGrath  <roland@redhat.com>
1368
1369         * strip.c (handle_elf): Check for bogus values in sh_link, sh_info,
1370         st_shndx, e_shstrndx, and SHT_GROUP or SHT_SYMTAB_SHNDX data.
1371         Don't use assert on input values, instead bail with "illformed" error.
1372
1373 2014-01-17  Roland McGrath  <roland@redhat.com>
1374
1375         * readelf.c (handle_dynamic, handle_symtab): Check for bogus sh_link.
1376         (handle_verneed, handle_verdef, handle_versym, handle_hash): Likewise.
1377         (handle_scngrp): Check for bogus sh_info.
1378
1379 2014-01-17  Jakub Jelinek  <jakub@redhat.com>
1380
1381         * elflint.c (section_name): Return "<invalid>" instead of
1382         crashing on invalid section name.
1383         (check_symtab, is_rel_dyn, check_rela, check_rel, check_dynamic,
1384         check_symtab_shndx, check_hash, check_versym): Robustify.
1385         (check_hash): Don't check entries beyond end of section.
1386         (check_note): Don't crash if gelf_rawchunk fails.
1387
1388 2014-01-17  Petr Machata  <pmachata@redhat.com>
1389
1390         * readelf.c (handle_dynamic, handle_relocs_rel)
1391         (handle_relocs_rela, handle_versym, print_liblist):
1392         Use gelf_fsize instead of relying on shdr->sh_entsize.
1393
1394 2014-01-14  Mark Wielaard  <mjw@redhat.com>
1395
1396         * readelf.c (print_debug_macro_section): Clear vendor array before
1397         use.
1398
1399 2014-01-15  Jan Kratochvil  <jan.kratochvil@redhat.com>
1400
1401         Fix corruption of non-C++ symbols by the demangler.
1402         * nm.c (show_symbols_sysv, show_symbols_bsd, show_symbols_posix)
1403         (show_symbols): Check for _Z.
1404         * stack.c (print_frames) <USE_DEMANGLE>: Check for _Z.
1405
1406 2014-01-02  Mark Wielaard  <mjw@redhat.com>
1407
1408         * stack.c (show_raw): Declare unconditionally.
1409         (parse_opt): Handle '-r' unconditionally.
1410         (main): Show "raw" option even without USE_DEMANGLE.
1411
1412 2014-01-02  Mark Wielaard  <mjw@redhat.com>
1413
1414         * stack.c (print_frames): Print 0x before build-id hex-offset.
1415
1416 2014-01-02  Mark Wielaard  <mjw@redhat.com>
1417
1418         * stack.c (maxframes): Increase to 2048.
1419         (struct frames): Add allocated field.
1420         (frame_callback): If frames used is frames allocated, realloc.
1421         (print_frames): Show an error if maxframes has been reached.
1422         (parse_opt): Allow -n 0 for unlimited frames.
1423         (main): Document -n 0 and new default 2048 frames. Allocate initial
1424         number of frames with malloc.
1425
1426 2013-12-30  Mark Wielaard  <mjw@redhat.com>
1427
1428         * stack.c (parse_opt): Explicitly call dwfl_linux_proc_attach
1429         or dwfl_core_file_attach and check for errors.
1430
1431 2013-12-28  Mark Wielaard  <mjw@redhat.com>
1432
1433         * stack.c (print_frames): Remove address width code and use...
1434         (get_addr_width): ...this new function.
1435         (show_modules): New static boolean.
1436         (module_callback): New static function.
1437         (parse_opt): Handle '-l'.
1438         (main): Add 'l' to options. If show_modules then use dwfl_getmodules
1439         with module_callback to show all detected modules and possible
1440         build_id, elf and dwarf files.
1441
1442 2013-12-27  Mark Wielaard  <mjw@redhat.com>
1443
1444         * stack.c (frames_shown): New static boolean.
1445         (EXIT_OK,EXIT_ERROR,EXIT_BAD,EXIT_USAGES): New defines.
1446         (frame_callback): Return -1 on error. Don't print error.
1447         (print_frames): Add arguments, tid, dwflerr and what. Print tid.
1448         If there was an error report it with address and module if possible.
1449         Record whether any frames were actually printed.
1450         (thread_callback): Collect tid and err, pass it to print_frames.
1451         (parse_opt): Use EXIT_BAD for errors. On ARGP_KEY_END print errno
1452         if dwfl_linux_proc_report returned it. Check whether we are properly
1453         attached with dwfl_pid.
1454         (main): Document exit status. Don't report DWARF_CB_ABORT from
1455         callbacks as error. Pass real errors to print_frames. Return
1456         EXIT_BAD if no frames could be shown. Return EXIT_ERROR if there
1457         were any non-fatal errors.
1458
1459 2013-12-23  Mark Wielaard  <mjw@redhat.com>
1460
1461         * Makefile.am (stack_LDADD): Add demanglelib.
1462         * stack.c (show_quiet): New static boolean, default false.
1463         (show_raw): Likewise.
1464         (demangle_buffer_len): New static size_t.
1465         (demangle_buffer): New static char *.
1466         (print_frames): Don't resolve pc name if show_quiet. Demangle name
1467         unless show_raw.
1468         (parse_opt): Handle '-q' and '-r'.
1469         (main): Add 'q' and 'r' to options. Free demangle_buffer.
1470
1471 2013-12-23  Mark Wielaard  <mjw@redhat.com>
1472
1473         * stack.c (OPT_DEBUGINFO): New define.
1474         (OPT_COREFILE): Likewise.
1475         (pid): New static.
1476         (core_fd): Likewise.
1477         (core): Likewise.
1478         (exec): Likewise.
1479         (debuginfo_path): Likewise.
1480         (parse_opt): Handle '-p', '--core', '-e' and '--debuginfo-path'.
1481         Do argument sanity checking. Setup Dwfl.
1482         (main): Add 'p', 'core', 'e' and 'debuginfo-path' to options.
1483         Remove argp_child children, simplify argp doc, remove custom
1484         usage message and construction of dwfl with dwfl_standard_argp.
1485         Use pid directly as tid. close core and core_fd if opened. Print
1486         pid of process or core.
1487
1488 2013-12-23  Mark Wielaard  <mjw@redhat.com>
1489
1490         * stack.c (show_build_id): New static boolean.
1491         (print_frames): Print module build-id, load address and pc offset
1492         if show_build_id is true.
1493         (parse_opt): Handle '-b'.
1494         (main): Add -b to options.
1495
1496 2013-12-22  Mark Wielaard  <mjw@redhat.com>
1497
1498         * stack.c (maxframes): New static unsigned. Initialize to 64.
1499         (struct frame): New struct.
1500         (struct frames): Likewise.
1501         (dwfl): New static Dwfl pointer.
1502         (frame_callback): Use arg as struct frames and fill it next frame.
1503         Return DWARF_CB_ABORT when maxframes has been reached. Move
1504         printing of frame to...
1505         (print_frames): ...here. New function.
1506         (thread_callback): Use arg as struct frames and set frames to zero.
1507         Call print_frames.
1508         (parse_opt): Handle '-n'.
1509         (main): Add -n to options. Allocate frames using maxframes. Pass
1510         frames to frame_callback and thread_callback.
1511
1512 2013-12-20  Mark Wielaard  <mjw@redhat.com>
1513
1514         * stack.c (show_one_tid): New static boolean.
1515         (parse_opt): Handle '-1'.
1516         (main): Add -1 to options. Call dwfl_getthread_frames when
1517         show_one_tid is true.
1518
1519 2013-12-18  Mark Wielaard  <mjw@redhat.com>
1520
1521         * addr2line.c (options): Add symbol-sections, 'x'.
1522         (show_symbol_sections): New static bool.
1523         (parse_opt): Handle 'x'.
1524         (print_addrsym): Use dwfl_module_addrinfo value.r
1525         Also show section of address with show_symbol_sections.
1526         (find_symbol): Use dwfl_module_getsym_info and set value.
1527         (handle_address): Request value and use it instead of sym.st_value.
1528         * readelf.c (format_dwarf_addr): Use dwfl_module_addrinfo to get
1529         name and offset.
1530
1531 2013-12-17  Masatake YAMATO  <yamato@redhat.com>
1532             Mark Wielaard  <mjw@redhat.com>
1533
1534         * stack.c (show_activation, show_module, show_source): New variables.
1535         (parse_opt): Set show_activation if -a option is given.
1536         Set show_module if -m option is given. Set show_source if -s option
1537         is given. Set all show booleans when -v option is given.
1538         (main): Added `-a', `-m', `-s', and `-v' to the help message.
1539         (frame_callback): Print module and source file information.
1540
1541 2013-11-25  Petr Machata  <pmachata@redhat.com>
1542
1543         * elflint.c (valid_e_machine): Add EM_AARCH64.
1544
1545 2013-11-14  Petr Machata  <pmachata@redhat.com>
1546
1547         * readelf.c (handle_core_item) <'h'>: New branch for handling
1548         fields that shouldn't be displayed.
1549
1550 2013-11-10  Mark Wielaard  <mjw@redhat.com>
1551
1552         * stack.c: Use ARGP_PROGRAM_VERSION_HOOK_DEF and
1553         ARGP_PROGRAM_BUG_ADDRESS_DEF.
1554         (print_version): New function.
1555
1556 2013-11-09  Mark Wielaard  <mjw@redhat.com>
1557
1558         * arlib.c (arlib_init): Call snprintf before using the result
1559         with memcpy.
1560         (arlib_finalize): Likewise.
1561         * nm.c (show_symbols_sysv): Don't modify cnt inside assert.
1562
1563 2013-11-07  Jan Kratochvil  <jan.kratochvil@redhat.com>
1564
1565         * Makefile.am (bin_PROGRAMS): Add stack.
1566         (stack_LDADD): New.
1567         * stack.c: New file.
1568
1569 2013-11-05  Mark Wielaard  <mjw@redhat.com>
1570
1571         * readelf.c (print_debug_ranges_section): Cast address to size_t
1572         before comparison.
1573         (print_debug_loc_section): Likewise.
1574
1575 2013-10-18  Mark Wielaard  <mjw@redhat.com>
1576
1577         * ar.c (main): Correct operation check when instance_specifed is set.
1578
1579 2013-09-26  Petr Machata  <pmachata@redhat.com>
1580
1581         * readelf.c (handle_file_note): New function.
1582         (handle_notes_data): Call it to handle NT_FILE notes.
1583
1584 2013-09-26  Petr Machata  <pmachata@redhat.com>
1585
1586         * readelf.c (handle_siginfo_note): New function.
1587         (handle_notes_data): Call it to handle NT_SIGINFO notes.
1588         (buf_read_int, buf_read_ulong, buf_has_data): New functions.
1589
1590 2013-08-13  Mark Wielaard  <mjw@redhat.com>
1591
1592         * addr2line.c (options): Add "inlines", 'i'.
1593         (show_inlines): New bool.
1594         (parse_opt): Handle 'i'.
1595         (print_diesym): New static function.
1596         (print_src): New function taking code from...
1597         (handle_address): here. Call print_src. Print inlines.
1598
1599 2013-08-12  Mark Wielaard  <mjw@redhat.com>
1600
1601         * addr2line.c (main): If there is a newline char at end of buf,
1602         then remove it.
1603
1604 2013-07-05  Mark Wielaard  <mjw@redhat.com>
1605
1606         * readelf.c (print_ops): Take CU as argument, use it to print
1607         parameter_ref DIE offset.
1608         (struct listptr): Replace base field with cu.
1609         (listptr_base): New function.
1610         (compare_listptr): Use listptr_base.
1611         (notice_listptr): Take CU as argument.
1612         (skip_listptr_hole): Likewise.
1613         (print_debug_ranges_section): Pass NULL as CU to skip_listptr_hole.
1614         (print_cfa_program): Pass NULL as CU to print_ops.
1615         (struct attrcb_args): Replace cu_base field with cu.
1616         (attr_callback): Pass cu not cu_base to notice_listptr.
1617         (print_debug_units): Don't calculate base, just set cu.
1618         (print_debug_loc_section): Pass cu to skip_listptr_hole and
1619         print_ops.
1620
1621 2013-05-06  Mark Wielaard  <mjw@redhat.com>
1622
1623         * readelf.c (print_ops): Format first DW_OP_GNU_implicit_pointer
1624         argument as DIE offset.
1625
1626 2013-04-24  Mark Wielaard  <mjw@redhat.com>
1627
1628         * Makefile.am: Use AM_CPPFLAGS instead of INCLUDES.
1629
1630 2013-03-25  Mark Wielaard  <mjw@redhat.com>
1631
1632         * readelf.c (argp_options): Add decodedline.
1633         (decodedline): New boolean initialized to false.
1634         (parse_opt): Set decodedline when arg is decodedline.
1635         (print_decoded_line_section): New function.
1636         (print_debug_line_section): Call print_decoded_line_section when
1637         decodedline is true.
1638
1639 2013-03-25  Mark Wielaard  <mjw@redhat.com>
1640
1641         * readelf.c (argp_option): Add decodedaranges.
1642         (decodedaranges): New boolean initialized to false.
1643         (parse_opt): Set decodedaranges when arg is decodedaranges.
1644         (print_debug_aranges_section): Reimplemented and original
1645         implementation renamed to...
1646         (print_decoded_aranges_section): this.
1647
1648 2013-03-25  Mark Wielaard  <mjw@redhat.com>
1649
1650         * readelf.c (attrcb_args): Add Dwarf_Die.
1651         (attr_callback): When highpc is in constant form also print as
1652         address.
1653         (print_debug_units): Set args.die.
1654
1655 2013-03-19  Mark Wielaard  <mjw@redhat.com>
1656
1657         * readelf.c (print_gdb_index_section): Free format_dwarf_addr results.
1658
1659 2013-03-18  Mark Wielaard  <mjw@redhat.com>
1660
1661         * readelf.c (print_gdb_index_section): Accept version 8.
1662
1663 2013-03-01  Mark Wielaard  <mjw@redhat.com>
1664
1665         * findtextrel.c (process_file): Release ELF and close file when not
1666         text relocations are found.
1667         * strip.c (handle_elf): Track memory used for .debuglink section data
1668         and free when done.
1669
1670 2013-02-24  Mark Wielaard  <mjw@redhat.com>
1671
1672         * elflint.c (check_symtab): Add __bss_start__ to the list of symbols
1673         allowed to have out of section values because of GNU ld bugs.
1674
1675 2013-02-06  Mark Wielaard  <mjw@redhat.com>
1676
1677         * elflint.c (check_symtab): Add __bss_start and __TMC_END__ to the
1678         list of symbols allowed to have out of section values because of
1679         GNU ld bugs in either .symtab or .dynsym, but only when they are
1680         zero sized.
1681
1682 2013-01-24  Mark Wielaard  <mjw@redhat.com>
1683
1684         * readelf.c (argp_option): Add unresolved-address-offsets, U.
1685         (print_unresolved_addresses): New static.
1686         (parse_opt): Handle 'U', set print_unprocessed_values.
1687         (format_dwarf_addr): Take and handle new raw argument.
1688         (print_ops): Call format_dwarf_addr with raw offset values.
1689         (print_debug_ranges_section): Likewise.
1690         (print_debug_frame_section): Likewise.
1691         (attr_callback): Likewise.
1692         (print_debug_line_section): Likewise.
1693         (print_debug_loc_section): Likewise.
1694         (print_gdb_index_section): Likewise.
1695
1696 2013-01-18  Mark Wielaard  <mjw@redhat.com>
1697
1698         * readelf.c (struct listptr): Add base Dwarf_Addr field.
1699         (compare_listptr): Warn for same offset with different base.
1700         (notice_listptr): Take base argument and set it.
1701         (skip_listptr_hole): Likewise.
1702         (struct attrcb_args): Removed unused cu_offset field.
1703         Add cu_base Dwarf_Addr field.
1704         (attr_callback): Call notice_listptr with cbargs->cu_base.
1705         (print_debug_units): Set args.cu_base.
1706         (print_debug_ranges_section): Get base and use for format_dwarf_addr.
1707         (print_debug_loc_section): Likewise.
1708
1709 2013-01-29  Jan Kratochvil  <jan.kratochvil@redhat.com>
1710
1711         * readelf.c (handle_core_items): Limit special repeated items handling
1712         to single-item formats '\n', 'b' and 'B', assert OFFSET 0 there.
1713
1714 2012-12-18  Mark Wielaard  <mark@bordewijk.wildebeest.org>
1715
1716         * readelf.c (ELF_INPUT_SECTION): New argp key value.
1717         (argp_option): Add elf-section.
1718         (elf_input_section): New static.
1719         (parse_opt): Handle ELF_INPUT_SECTION and set elf_input_section.
1720         (open_input_section): New function.
1721         (process_file): Call open_input_section if elf_input_section set.
1722
1723 2013-01-13  David Abdurachmanov  <David.Abdurachmanov@cern.ch>
1724
1725         ar.c (do_oper_delete): Fix num passed to memset.
1726
1727 2012-12-21  Mark Wielaard  <mjw@redhat.com>
1728
1729         * readelf.c (print_debug_frame_section): Adjust FDE start address
1730         if pcrel before feeding it to format_dwarf_addr.
1731
1732 2012-12-21  Mark Wielaard  <mjw@redhat.com>
1733
1734         * addr2line.c (main): Call dwfl_end.
1735
1736 2012-12-11  Roland McGrath  <roland@hack.frob.com>
1737
1738         * nm.c (show_symbols_sysv): Fix size passed to snprintf for invalid
1739         sh_name case.
1740         Reported by David Abdurachmanov <David.Abdurachmanov@cern.ch>.
1741
1742 2012-10-16  Mark Wielaard  <mjw@redhat.com>
1743
1744         * readelf.c (print_ops): DW_OP_skip and DW_OP_bra targets are
1745         calculated beginning after the operand and 2-byte constant.
1746
1747 2012-10-12  Jan Kratochvil  <jan.kratochvil@redhat.com>
1748
1749         * readelf.c (ITEM_WRAP_COLUMN, REGISTER_WRAP_COLUMN): Merge to ...
1750         (WRAP_COLUMN): ... here.
1751         (print_core_item): Remove parameter format_max.  Update function
1752         comment.  Replace FORMAT_MAX by the real output width.
1753         (handle_core_item): Remove the FORMAT_MAX values in TYPES, DO_TYPE,
1754         calls of print_core_item, remove variable maxfmt, change
1755         ITEM_WRAP_COLUMN to WRAP_COLUMN.
1756         (handle_core_register): Remove the FORMAT_MAX values in TYPES, BITS,
1757         calls of print_core_item, change REGISTER_WRAP_COLUMN to WRAP_COLUMN.
1758
1759 2012-10-11  Jan Kratochvil  <jan.kratochvil@redhat.com>
1760
1761         * readelf.c (handle_core_item) <b>: Make run an outer block variable.
1762         Increase run only if LASTBIT != 0.  Print last element only if RUN > 0.
1763
1764 2012-08-27  Mark Wielaard  <mjw@redhat.com>
1765
1766         * readelf.c (print_debug_macro_section): Print offset as PRIx64.
1767
1768 2012-08-27  Mark Wielaard  <mjw@redhat.com>
1769
1770         * readelf.c (register_info): Handle loc == NULL.
1771
1772 2012-08-22  Jeff Kenton  <jkenton@tilera.com>
1773
1774         * elflint.c (valid_e_machine): Add EM_TILEGX and EM_TILEPRO.
1775
1776 2012-08-16  Mark Wielaard  <mjw@redhat.com>
1777
1778         * readelf.c (dwarf_tag_name): Renamed from dwarf_tag_string.
1779         Uses new dwarf_tag_string or adds ??? or lo_user+%#x when
1780         appropriate.
1781         (dwarf_attr_name): Likewise.
1782         (dwarf_form_name): Likewise.
1783         (dwarf_lang_name): Likewise.
1784         (dwarf_inline_name): Likewise.
1785         (dwarf_encoding_name): Likewise.
1786         (dwarf_access_name): Likewise.
1787         (dwarf_visibility_name): Likewise.
1788         (dwarf_virtuality_name): Likewise.
1789         (dwarf_identifier_case_name): Likewise.
1790         (dwarf_calling_convention_name): Likewise.
1791         (dwarf_ordering_name): Likewise.
1792         (dwarf_discr_list_name): Likewise.
1793         (print_ops): Remove KNOWN.  Use dwarf_locexpr_opcode_string.
1794         (attr_callback): Call new dwarf_foobar_name instead of old
1795         dwarf_foobar_string functions.
1796         (dwarf_tag_string): New function using known-dwarf.h macros.
1797         (dwarf_attr_string): Likewise.
1798         (dwarf_form_string): Likewise.
1799         (dwarf_lang_string): Likewise.
1800         (dwarf_inline_string): Likewise.
1801         (dwarf_encoding_string): Likewise.
1802         (dwarf_access_string): Likewise.
1803         (dwarf_visibility_string): Likewise.
1804         (dwarf_virtuality_string): Likewise.
1805         (dwarf_identifier_case_string): Likewise.
1806         (dwarf_calling_convention_string): Likewise.
1807         (dwarf_ordering_string): Likewise.
1808         (dwarf_discr_list_string): Likewise.
1809         (dwarf_locexpr_opcode_string): Likewise.
1810
1811 2012-06-27  Mark Wielaard  <mjw@redhat.com>
1812
1813         * readelf.c (dwarf_form_string): Handle DW_FORM_GNU_ref_alt and
1814         DW_FORM_GNU_strp_alt.
1815         (attr_callback): Likewise.
1816
1817 2012-07-30  Petr Machata  <pmachata@redhat.com>
1818
1819         * nm.c (show_symbols_bsd): Reorder arguments in {S,}FMTSTRS (and
1820         corresponding printf) so that those that are referenced by only
1821         one of the formatting strings are at the end.
1822
1823 2012-07-29  Mark Wielaard  <mjw@redhat.com>
1824
1825         * readelf.c (dwarf_lang_string): Use DW_LANG_ObjC, not DW_LANG_Objc.
1826         (print_ops): Use known[op], not op_name, for DW_OP_GNU_parameter_ref.
1827
1828 2012-07-19  Mark Wielaard  <mjw@redhat.com>
1829
1830         * readelf.c (print_ops): Handle DW_OP_GNU_parameter_ref.
1831
1832 2012-07-11  Mark Wielaard  <mjw@redhat.com>
1833
1834         * readelf.c (options): Add macro to help of debug-dump.
1835         (section_e): Add section_macro.
1836         (section_all): Add section_macro.
1837         (parse_opt): Handle macro.
1838         (print_debug_macro_section): New function.
1839         (print_debug): Add NEW_SECTION (macro).
1840
1841 2012-07-10  Mark Wielaard  <mjw@redhat.com>
1842
1843         * readelf.c (print_gdb_index_section): Add version 7 support.
1844         Keep track of cu_nr. Print kind and static/global flag for each
1845         symbol. When a symbol is in the TU list add 'T'.
1846
1847 2012-06-26  Mark Wielaard  <mjw@redhat.com>
1848
1849         * readelf.c (dwarf_attr_string): Add DW_AT_GNU_macros.
1850
1851 2012-06-22  Mark Wielaard  <mjw@redhat.com>
1852
1853         * readelf.c (print_ops): Cast printf PRIu/x64 arguments to uint64_t
1854         for gcc 4.7 -Wformat.
1855
1856 2012-05-09  Roland McGrath  <roland@hack.frob.com>
1857
1858         * elflint (check_sections): Allow zero sized sections at (filesz) end
1859         of segment. And make check overflow-proofed.
1860
1861 2012-04-24  Mark Wielaard  <mjw@redhat.com>
1862
1863         * readelf.c (print_ops): Add DW_OP_GNU_push_tls_address,
1864         DW_OP_GNU_uinit and DW_OP_GNU_encoded_addr.
1865
1866 2012-03-28  Roland McGrath  <roland@hack.frob.com>
1867
1868         * elflint.c (special_sections): Accept SHF_INFO_LINK for reloc sections.
1869
1870 2012-03-28  Mark Wielaard  <mjw@redhat.com>
1871
1872         * readelf.c (print_debug_abbrev_section): Check there is Dwarf
1873         section data.
1874         (print_debug_str_section): Likewise.
1875
1876 2012-03-21  Mark Wielaard  <mjw@redhat.com>
1877
1878         * readelf.c (print_gdb_index_section): Accept version 6.
1879
1880 2012-01-31  Mark Wielaard  <mjw@redhat.com>
1881
1882         * readelf.c (attr_callback): Don't special case DW_FORM_sec_offset.
1883
1884 2012-01-21  Ulrich Drepper  <drepper@gmail.com>
1885
1886         * addr2line.c: Update copyright year.
1887         * ar.c: Likewise.
1888         * elfcmp.c: Likewise.
1889         * elflint.c: Likewise.
1890         * findtextrel.c: Likewise.
1891         * ld.c: Likewise.
1892         * nm.c: Likewise.
1893         * objdump.c: Likewise.
1894         * ranlib.c: Likewise.
1895         * readelf.c: Likewise.
1896         * size.c: Likewise.
1897         * strings.c: Likewise.
1898         * strip.c: Likewise.
1899         * unstrip.c: Likewise.
1900
1901         * nm.c (argp_children): Define.
1902         (argp): Hook up argp_children.
1903         (handle_ar): Optimize puts call.
1904         (show_symbols_bsd): Use positional parameters to also print color
1905         codes.  Don't print STT_FILE symbols.
1906         * objdump.c (options): Improve help text.
1907         (argp_children): Define.
1908         (argp): Hook up argp_children.
1909         (disasm_info): Add elements for color codes.
1910         (disasm_output): Print color codes as well.
1911         (show_disasm): Set up disasm_info data for callback.
1912
1913 2012-01-20  Roland McGrath  <roland@hack.frob.com>
1914
1915         * arlib-argp.c (arlib_deterministic_output): Initialize from
1916         configured value.
1917         (help_filter): New function.
1918         (argp): Use it.
1919
1920         * ar.c (main): Handle oper_none as usage error.
1921
1922         * arlib-argp.c (options, parse_opt): Grok -U as inverse of -D.
1923
1924         * ranlib.c (argp): Use arlib_argp_children.
1925
1926         * arlib.c (arlib_init): Obey arlib_deterministic_output.
1927
1928         * arlib-argp.c: New file.
1929         * Makefile.am (libar_a_SOURCES): Add it.
1930         * arlib.h (arlib_deterministic_output, arlib_argp_children):
1931         Declare new variables.
1932         * ar.c (deterministic_output): Variable removed.
1933         (do_oper_insert): Use arlib_deterministic_output instead.
1934         (options, parse_opt): Don't handle -D here.  Add group numbers.
1935         (argp): Use arlib_argp_children.
1936
1937 2011-12-20  Roland McGrath  <roland@hack.frob.com>
1938
1939         * readelf.c (print_debug): Initialize DUMMY_DBG.elf.
1940         Reported by Karel Klic <kklic@redhat.com>.
1941
1942 2011-11-05  Roland McGrath  <roland@hack.frob.com>
1943
1944         * ar.c (deterministic_output): New flag variable.
1945         (options, parse_opt): Grok -D to set it.
1946         (do_oper_insert): When set, use zero from mtime, uid, and gid.
1947
1948         * ar.c (do_oper_insert): Fix check on elf_rawfile return value.
1949
1950 2011-10-04  Marek Polacek  <mpolacek@redhat.com>
1951
1952         * readelf.c (register_info): Assume the right size of an array.
1953
1954 2011-10-03  Ulrich Drepper  <drepper@gmail.com>
1955
1956         * nm.c: Recognize option --mark-special.  Still recognize --mark-weak
1957         but don't show it in help anymore.
1958         (mark_special): Renamed from mark_weak.
1959         (parse_opt): Adjust.
1960         (class_type_char): Take additional parameters for ELF file and ELF
1961         header.  Treat TLS symbols like objects.
1962         In case of D symbols, show u for unique symbols, R for symbols in
1963         read-only sections, B for symbols in BSS sections.
1964         (show_symbols_bsd): Take additional parameters for ELF file and ELF
1965         header.  Adjust for class_type_char change.  Show TLS symbols with
1966         @ after them in case --mark-special is selected.
1967         (show_symbols_posix): Likewise.
1968         (show_symbols): Adjust calls to show_symbols_bsd and
1969         show_symbols_posix.
1970         (show_symbols_sysv): Avoid printing adress and size for undefined
1971         symbols.  Don't print initial special entry and section entries.
1972
1973 2011-10-02  Ulrich Drepper  <drepper@gmail.com>
1974
1975         * Makefile.am (demanglelib): Define.
1976         (nm_LDADD): Add demanglelib.
1977         * nm.c (options): Add -C option.
1978         (demangle): Define as global variable.
1979         (parse_opt): Recognize -C.
1980         (show_symbols_sysv): Handle demangling.
1981         (show_symbols_bad): Likewise.
1982         (show_symbols_posix): Likewise.
1983         (show_symbols): Likewise.
1984
1985 2011-07-09  Roland McGrath  <roland@hack.frob.com>
1986
1987         * readelf.c (options, parse_opt): Grok -W/--wide and ignore it.
1988
1989         * ar.c (parse_opt): Grok -u.
1990
1991 2011-05-30  Mark Wielaard  <mjw@redhat.com>
1992
1993         * strip.c (relocate): Make offset check overflow-proof.
1994
1995 2011-05-23  Mark Wielaard  <mjw@redhat.com>
1996
1997         * strip.c (relocate): Take new arguments is_rela to indicate
1998         whether the relocation is from a SHT_REL or SHT_RELA section.
1999         Relocate against any debug section symbol, not just STT_SECTION
2000         symbols. For SHT_REL relocations, fetch addend from offset and
2001         add it to symbol value if not zero.
2002
2003 2011-05-23  Mark Wielaard  <mjw@redhat.com>
2004
2005         * strip.c (OPT_RELOC_DEBUG): New option.
2006         (argp_option): Add new --reloc-debug-sections option.
2007         (main): Check new option.
2008         (parse_opt): Likewise.
2009         (handle_elf): Remove any relocations between debug sections
2010         in ET_REL for the debug file when requested.
2011
2012 2011-05-18  Mark Wielaard  <mjw@redhat.com>
2013
2014         * strip.c (handle_elf): Make sure all sections of a removed group
2015         section are removed too. Don't discard SHT_GROUP sections, copy
2016         section table before it gets modified. Section group signature
2017         symbols don't have to be retained.
2018
2019 2011-05-16  Jakub Jelinek  <jakub@redhat.com>
2020
2021         * readelf.c (print_ops): Handle DW_OP_GNU_const_type,
2022         DW_OP_GNU_regval_type, DW_OP_GNU_deref_type, DW_OP_GNU_convert
2023         and DW_OP_GNU_reinterpret.
2024
2025 2011-05-17  Mark Wielaard  <mjw@redhat.com>
2026
2027         * readelf.c (dwarf_tag_string): Fixup DW_TAG_GNU_call_site and
2028         DW_TAG_GNU_call_site_parameter return strings.
2029
2030 2011-05-11  Marek Polacek  <mpolacek@redhat.com>
2031
2032         * nm.c (show_symbols_sysv): Remove unused if/else, remove
2033         unused `prefix' and `fname' parameters.
2034
2035 2011-05-07  Marek Polacek  <mpolacek@redhat.com>
2036
2037         * unstrip.c (compare_sections_nonrel): Mark this function as static.
2038
2039 2011-04-26  Mark Wielaard  <mjw@redhat.com>
2040
2041         * readelf.c (handle_notes_data): Call ebl_object_note_type_name
2042         with note name.
2043
2044 2011-04-14  Mark Wielaard  <mjw@redhat.com>
2045
2046         * readelf.c (options): Add gdb_index.
2047         (section_e): Define section_gdb_index.
2048         (parse_opt): Recognize gdb_index debug-dump argument.
2049         (print_gdb_index_section): New function.
2050         (print_debug): Add gdb_index to debug_sections.
2051
2052 2011-03-24  Petr Machata  <pmachata@redhat.com>
2053
2054         * readelf.c (print_debug_line_section): Emit initial space for all
2055         opcode lines.  Print offset in front of each opcode.
2056
2057 2011-03-22  Marek Polacek  <mpolacek@redhat.com>
2058
2059         * readelf.c (handle_dynamic): Don't segfault at DT_PLTREL case.
2060
2061 2011-03-22  Mark Wielaard  <mjw@redhat.com>
2062
2063         * readelf.c (dwarf_tag_string): Support DW_TAG_GNU_call_site
2064         and DW_TAG_GNU_call_site_parameter.
2065         (dwarf_attr_string): Support DW_AT_GNU_call_site_value,
2066         DW_AT_GNU_call_site_data_value,
2067         DW_AT_GNU_call_site_target,
2068         DW_AT_GNU_call_site_target_clobbered,
2069         DW_AT_GNU_tail_call,
2070         DW_AT_GNU_all_tail_call_sites,
2071         DW_AT_GNU_all_call_sites,
2072         and DW_AT_GNU_all_source_call_sites.
2073         (print_ops): Handle DW_OP_GNU_entry_value.
2074         (attr_callback): Handle DW_AT_GNU_call_site_value,
2075         DW_AT_GNU_call_site_data_value,
2076         DW_AT_GNU_call_site_target,
2077         and DW_AT_GNU_call_site_target_clobbered.
2078
2079 2011-03-10  Mark Wielaard  <mjw@redhat.com>
2080
2081         * elflint.c (check_symtab): Use ebl_check_st_other_bits.
2082
2083 2011-02-27  Jan Kratochvil  <jan.kratochvil@redhat.com>
2084
2085         * readelf.c (reset_listptr): Clear TABLE->TABLE.
2086
2087 2011-02-25  Mark Wielaard  <mjw@redhat.com>
2088
2089         * readelf.c (dwarf_attr_string): Add DW_AT_GNU_* handling.
2090         (dwarf_form_string): Properly format and return unknown form.
2091
2092 2011-02-23  Roland McGrath  <roland@redhat.com>
2093
2094         * readelf.c (section_name): New function.
2095         (print_debug_abbrev_section): Use it instead of constant.
2096         (print_debug_aranges_section): Likewise.
2097         (print_debug_ranges_section): Likewise.
2098         (print_debug_units): Likewise.
2099         (print_debug_line_section): Likewise.
2100         (print_debug_loc_section): Likewise.
2101         (print_debug_macinfo_section): Likewise.
2102         (print_debug_pubnames_section): Likewise.
2103         (print_debug_str_section): Likewise.
2104         (print_debug) [USE_ZLIB]: Match .zdebug_* sections too.
2105         (print_debug_abbrev_section): Use decoded d_size, not sh_size.
2106         (print_debug_str_section): Likewise.
2107
2108         * readelf.c (dwarf_attr_string): Grok DW_AT_GNU_odr_signature.
2109
2110 2011-02-11  Roland McGrath  <roland@redhat.com>
2111
2112         * elfcmp.c (verbose): New variable.
2113         (options, parse_opt): Grok -l/--verbose to set it.
2114         (main): Under -l, keep going after first difference.
2115
2116         * elfcmp.c (ignore_build_id): New variable.
2117         (options, parse_opt): Grok --ignore-build-id to set it.
2118         (main): For SHT_NOTE sections, compare note details rather than raw
2119         bytes.  Under --ignore-build-id, don't complain about differing build
2120         ID contents if lengths match.
2121
2122 2011-02-08  Roland McGrath  <roland@redhat.com>
2123
2124         * ldscript.y (filename_id_star): Remove unused variable.
2125
2126         * unstrip.c (copy_elided_sections): Remove unused variable.
2127
2128         * elflint.c (check_dynamic): Remove unused variables.
2129
2130         * elflint.c (check_symtab): Warn about missing xndx section only once.
2131
2132         * ldgeneric.c (check_for_duplicate2): Remove unused variable.
2133
2134 2011-01-06  Roland McGrath  <roland@redhat.com>
2135
2136         * strip.c (handle_elf): Under --strip-sections, remove all
2137         non-allocated sections and never generate .gnu_debuglink.
2138
2139 2011-01-04  Roland McGrath  <roland@redhat.com>
2140
2141         * strip.c (remove_shdrs): New variable.
2142         (options, parse_opt): Grok --strip-sections to set it.
2143         (handle_elf): When that's set, truncate off .shstrtab and shdrs.
2144
2145 2010-11-10  Roland McGrath  <roland@redhat.com>
2146
2147         * findtextrel.c (process_file): Don't assume order of sections.
2148         Reported by Mike Hommey <mh@glandium.org>.
2149
2150 2010-07-26  Roland McGrath  <roland@redhat.com>
2151
2152         * readelf.c (print_ops): Handle DW_OP_GNU_implicit_pointer.
2153
2154 2010-08-30  Roland McGrath  <roland@redhat.com>
2155
2156         Print .debug_loc/.debug_ranges with cognizance of actual DIE uses.
2157         * readelf.c (parse_opt): Add section_info to implicit_debug_sections
2158         for ranges, loc.
2159         (struct listptr, struct listptr_table): New types.
2160         (compare_listptr, reset_listptr, sort_listptr): New functions.
2161         (notice_listptr, skip_listptr_hole): New functions.
2162         (struct attrcb_args): Add silent member.
2163         (attr_callback): Call notice_listptr for loclistptr and rangelistptr.
2164         Suppress output if silent, but still call notice_listptr.
2165         (print_debug_units): Suppress output if section_info not requested.
2166         (print_debug_loc_section): Call sort_listptr, skip_listptr_hole.
2167         (print_debug_ranges_section): Likewise.
2168         (print_debug): Call reset_listptr on both tables.
2169
2170         * readelf.c (print_debug_ranges_section): Print empty list.
2171         (print_debug_loc_section): Likewise.
2172
2173         * readelf.c (print_debug_loc_section): Check for bogus length
2174         before calling print_ops.
2175         (print_ops): Check harder for bogus data that would read off end.
2176
2177 2010-08-11  Roland McGrath  <roland@redhat.com>
2178
2179         * readelf.c (for_each_section_argument): Process all sections with
2180         matching name, not just the first.
2181
2182 2010-07-26  Roland McGrath  <roland@redhat.com>
2183
2184         * readelf.c (print_ops): Take new argument for CU version.
2185         Fix DW_OP_call_ref decoding to depend on it.
2186         (print_debug_loc_section): Update caller.
2187         (print_cfa_program): Take new argument, pass it down.
2188         (print_debug_frame_section): Update caller.
2189         (struct attrcb_args): New member version.
2190         (print_debug_units): Initialize it.
2191
2192 2010-07-02  Roland McGrath  <roland@redhat.com>
2193
2194         * readelf.c (print_debug_frame_section): Use format_dwarf_addr for
2195         initial_location.
2196
2197 2010-06-30  Roland McGrath  <roland@redhat.com>
2198
2199         * strings.c (main): Use STDIN_FILENO, not STDOUT_FILENO.
2200         Ignore st_size for a non-S_ISREG file descriptor.
2201         (read_block): Move assert after no-mmap bail-out.
2202         (read_block_no_mmap): Fix size calculations for moving buffer remnant.
2203
2204 2010-06-22  Roland McGrath  <roland@redhat.com>
2205
2206         * readelf.c (print_debug_line_section): Fix braino in DW_LNS_set_isa.
2207
2208 2010-06-21  Roland McGrath  <roland@redhat.com>
2209
2210         * readelf.c (dwarf_tag_string): Handle new v4 tags.
2211         (dwarf_attr_string): Add new attributes.
2212         (dwarf_tag_string): Handle DW_TAG_GNU_*.
2213
2214         * readelf.c (print_ops): Use 64-bit types for LEB128 operands.
2215         (print_cfa_program): Likewise.
2216
2217 2010-06-20  Roland McGrath  <roland@redhat.com>
2218
2219         * readelf.c (print_debug_units): New function, broken out of ...
2220         (print_debug_info_section): ... here.  Call it.
2221         (print_debug_types_section): New function.
2222         (enum section_e): Add section_types alias for section_info.
2223         (print_debug): Add types to the sections table.
2224
2225         * readelf.c (print_debug_frame_section): Handle version 4 format.
2226
2227         * readelf.c (print_debug_line_section): Handle version 4 format.
2228
2229 2010-06-14  Roland McGrath  <roland@redhat.com>
2230
2231         * unstrip.c (copy_elided_sections): Make sure all sections' data have
2232         been read in before we write anything out.
2233
2234 2010-06-04  Roland McGrath  <roland@redhat.com>
2235
2236         * unstrip.c (update_shdr): New function.
2237         (update_sh_size): Call it instead of gelf_update_shdr.
2238         (adjust_relocs, add_new_section_symbols): Likewise.
2239         (new_shstrtab, copy_elided_sections): Likewise.
2240
2241         * unstrip.c (copy_elided_sections): Bail if stripped file has more
2242         sections than unstripped file, rather than getting confused later.
2243
2244 2010-06-01  Roland McGrath  <roland@redhat.com>
2245
2246         * readelf.c (dwarf_form_string): Handle DWARF 4 forms.
2247         (attr_callback): Handle DW_FORM_flag_present, DW_FORM_exprloc,
2248         DW_FORM_sec_offset, DW_FORM_ref_sig8.
2249
2250         * readelf.c (print_debug): Don't bail if libdw setup fails.
2251         Suppress complaint if we only want .eh_frame anyway.
2252
2253 2010-05-28  Ulrich Drepper  <drepper@redhat.com>
2254
2255         * readelf.c (attr_callback): Also print form information.
2256
2257 2010-05-19  Roland McGrath  <roland@redhat.com>
2258
2259         * addr2line.c (find_symbol): Short-circuit on empty name.
2260         (handle_address): Handle SYMBOL with no +OFFSET.
2261
2262 2010-05-08  Roland McGrath  <roland@redhat.com>
2263
2264         * readelf.c (print_ops): Take new arg OFFSET_SIZE.
2265         Use that for DW_OP_call_ref, not ADDRSIZE.
2266         (print_cfa_program): Update caller.
2267         (struct attrcb_args): Add offset_size field.
2268         (attr_callback): Use it for print_ops call.
2269         (print_debug_info_section): Initialize it.
2270         (print_ops): Likewise.
2271
2272 2010-04-14  Roland McGrath  <roland@redhat.com>
2273
2274         * readelf.c (handle_core_item): Fix bitmask printing.
2275
2276 2010-04-06  Roland McGrath  <roland@redhat.com>
2277
2278         * ld.c (options): Fix some typos in messages.
2279         * elflint.c (check_scn_group, check_group): Likewise.
2280         * ldscript.y (add_id_list): Likewise.
2281         * readelf.c (print_hash_info): Add xgettext:no-c-format magic comment
2282         before translated string containing a literal %.
2283
2284 2010-02-26  Roland McGrath  <roland@redhat.com>
2285
2286         * readelf.c (process_file): Don't leak an fd in failure case.
2287
2288 2010-02-15  Roland McGrath  <roland@redhat.com>
2289
2290         * Makefile.am: Use config/eu.am for common stuff.
2291
2292         * readelf.c (print_debug_frame_section): Add a cast to avoid sign
2293         mismatch in comparison.
2294
2295 2010-02-02  Roland McGrath  <roland@redhat.com>
2296
2297         * readelf.c (print_encoding_base): Handle DW_EH_PE_absptr (zero).
2298         (read_encoded): Likewise.
2299         (print_debug_frame_section): Check for bogus augmentation length.
2300         For P augmentation, use read_encoded, print the encoding description,
2301         and use hex for unsigned values.
2302
2303 2010-01-15  Roland McGrath  <roland@redhat.com>
2304
2305         * ar.c: Include <sys/stat.h>.
2306         * elflint.c: Likewise.
2307         * readelf.c: Likewise.
2308         * strip.c: Likewise.
2309         * unstrip.c: Likewise
2310
2311 2010-01-07  Roland McGrath  <roland@redhat.com>
2312
2313         * readelf.c (print_ehdr): Handle PN_XNUM.
2314         (phnum): New static variable.
2315         (process_elf_file): Set it with elf_getphdrnum.
2316         (print_phdr): Use phnum instead of EHDR->e_phnum.
2317         (print_dynamic, handle_notes): Likewise.
2318         (handle_relocs_rel, handle_relocs_rela): Likewise.
2319
2320         * elfcmp.c (main): Use elf_getshdrnum and elf_getphdrnum.
2321
2322         * elflint.c (phnum): New static variable.
2323         (check_elf_header): Set it, handling PN_XNUM.
2324         Use that in place of EHDR->e_phnum throughout.
2325         (check_symtab, check_reloc_shdr, check_dynamic): Likewise.
2326         (unknown_dependency_p, check_sections, check_program_header): Likewise.
2327
2328 2010-01-05  Roland McGrath  <roland@redhat.com>
2329
2330         * readelf.c (dwarf_attr_string): Match DW_AT_GNU_vector and
2331         DW_AT_GNU_template_name.
2332
2333 2010-01-04  Roland McGrath  <roland@redhat.com>
2334
2335         * readelf.c (handle_notes_data): Grab NT_AUXV only for name "CORE".
2336         (handle_core_note): Pass NHDR and NAME to ebl_core_note.
2337         (handle_core_item): Handle .format of '\n' as \n-separated strings.
2338
2339         * readelf.c (implicit_debug_sections): New variable.
2340         (parse_opt): Set it instead of print_debug_sections for -a.
2341         OR them together for print_debug check.
2342         (print_debug): OR them together for section check.
2343
2344         * readelf.c (options): Repartition into set implied by -a and others.
2345         Correct -a text to match reality.
2346
2347         * readelf.c (struct section_argument): Add bool member 'implicit'.
2348         (parse_opt): Set it for -a cases, clear it for -x args.
2349         (for_each_section_argument): Don't complain about a missing section by
2350         name if it's implicit.
2351
2352 2009-11-16  Roland McGrath  <roland@redhat.com>
2353
2354         * readelf.c (print_string_section): Punt SHT_NOBITS like empty
2355         sections, just as dump_data_section already does.
2356
2357 2009-09-21  Ulrich Drepper  <drepper@redhat.com>
2358
2359         * elflint.c (special_sections): Allow MERGE and STRINGS flags to be
2360         set for .comment section.
2361         Patch by Mark Wielaard <mjw@redhat.com>.
2362
2363 2009-09-08  Roland McGrath  <roland@redhat.com>
2364
2365         * ar.c (main): Fix typo in message format.
2366
2367 2009-08-21  Roland McGrath  <roland@redhat.com>
2368
2369         * readelf.c (attr_callback): Use print_block only when we don't use
2370         print_ops.
2371
2372 2009-08-14  Roland McGrath  <roland@redhat.com>
2373
2374         * ar.c (do_oper_extract): Use pathconf instead of statfs.
2375
2376 2009-08-01  Ulrich Drepper  <drepper@redhat.com>
2377
2378         * debugpred.h: Add two most const.
2379
2380 2009-07-26  Mark Wielaard  <mjw@redhat.com>
2381
2382         * elflint.c (check_note_data): Recognize NT_GNU_GOLD_VERSION.
2383
2384 2009-07-25  Mark Wielaard  <mjw@redhat.com>
2385
2386         * Makefile.am (addr2line_LDADD): Add $(libelf).
2387
2388 2009-07-24  Roland McGrath  <roland@redhat.com>
2389
2390         * readelf.c (print_block): New function.
2391         (print_ops): Use it.
2392         (attr_callback): Use it for DW_FORM_block* forms.
2393
2394 2009-07-20  Mark Wielaard  <mjw@redhat.com>
2395
2396         * readelf.c (print_ops): Add handling of DW_OP_implicit_value
2397         and DW_OP_stack_value.
2398
2399 2009-07-14  Ulrich Drepper  <drepper@redhat.com>
2400
2401         * elflint.c (check_elf_header): Allow Linux ABI.
2402         (check_symtab): Handle STB_GNU_UNIQUE.
2403
2404 2009-07-08  Mark Wielaard  <mjw@redhat.com>
2405
2406         * readelf.c (attr_callback): Handle DW_Form constants for
2407         DW_AT_data_member_location.
2408
2409 2009-07-06  Roland McGrath  <roland@redhat.com>
2410
2411         * readelf.c (register_info): New function.  Handle unknown register #s.
2412         (print_cfa_program): Use it.
2413         (handle_core_register, handle_core_registers): Likewise.
2414
2415 2009-06-28  Roland McGrath  <roland@redhat.com>
2416
2417         * readelf.c (print_address_names): New static variable.
2418         (options, parse_opt): Grok -N/--numeric-addresses to clear it.
2419         (format_dwarf_addr): Don't look up name if !print_address_names.
2420
2421 2009-06-13  Ulrich Drepper  <drepper@redhat.com>
2422
2423         * ldgeneric.c: Don't use deprecated libelf functions.
2424         * nm.c: Likewise.
2425         * objdump.c: Likewise.
2426         * readelf.c: Likewise.
2427         * size.c: Likewise.
2428         * strip.c: Likewise.
2429         * unstrip.c: Likewise.
2430         * ld.h: Fix up comment.
2431
2432 2009-06-01  Ulrich Drepper  <drepper@redhat.com>
2433
2434         * readelf.c (print_relocs): Expect ELF header argument and pass on
2435         to handle_relocs_rel* functions. Adjust caller.
2436         (handle_relocs_rel): Add ELF header argument.  Add special case for
2437         the IRELATIVE relocations in statically linked executables.
2438         (handle_relocs_rela): Likewise.
2439
2440 2009-04-29  Ulrich Drepper  <drepper@redhat.com>
2441
2442         * elflint.c (check_symtab): Add tests of st_other field.
2443
2444 2009-04-23  Ulrich Drepper  <drepper@redhat.com>
2445
2446         * Makefile [BUILD_STATIC] (libdw): Add $(zip_LIBS).
2447
2448 2009-04-20  Roland McGrath  <roland@redhat.com>
2449
2450         * addr2line.c (print_dwarf_function): Honor -s and -A for file names
2451         of inline call sites.
2452
2453         * addr2line.c (just_section): New variable.
2454         (adjust_to_section): New function, broken out of ...
2455         (handle_address): ... here.
2456         (options, parse_opt): Add -j/--section=NAME to set it.
2457
2458 2009-04-15  Roland McGrath  <roland@redhat.com>
2459
2460         * readelf.c (print_debug_frame_section): Check for DW_CIE_ID_64 in
2461         64-bit format header, DW_CIE_ID_32 in 32-bit format header.
2462
2463 2009-04-14  Roland McGrath  <roland@redhat.com>
2464
2465         * readelf.c (print_attributes): Treat SHT_ARM_ATTRIBUTES on EM_ARM
2466         like SHT_GNU_ATTRIBUTES.
2467
2468         * readelf.c (handle_core_registers): Fix error message.
2469
2470         * strip.c (handle_elf: check_preserved): Don't note any change when
2471         .debug_data is already filled from a previous pass.
2472
2473 2009-02-05  Ulrich Drepper  <drepper@redhat.com>
2474
2475         * objdump.c (show_relocs_x): Minor cleanups.
2476
2477         * readelf.c (print_cfa_program): Correct a few labels.
2478         Print first DW_CFA_expression and DW_CFA_val_expression parameter
2479         as register.
2480
2481 2009-02-01  Ulrich Drepper  <drepper@redhat.com>
2482
2483         * objdump.c (show_relocs_rel, show_relocs_rela): Split common parts
2484         into ...
2485         (show_relocs_x): ...here.  New function.
2486         (show_relocs): Better spacing in output.
2487
2488         * objdump.c (show_relocs_rela): Show offsets as signed values.
2489
2490         * ar.c (main): Fix recognition of invalid modes for a, b, i modifiers.
2491         Improve some error messages.
2492         Use program_invocation_short_name instead of AR macro.
2493         * Makefile.am (CFLAGS_ar): Remove.
2494         * elflint.c (parse_opt): ARGP_HELP_EXIT_ERR does nothing for argp_help.
2495         * objdump.c (parse_opt): Likewise.
2496         * readelf.c (parse_opt): Likewise.
2497
2498 2009-01-27  Roland McGrath  <roland@redhat.com>
2499
2500         * readelf.c (print_ops): Notice short length, don't overrun buffer
2501         (still need to fix LEB128).
2502
2503         * readelf.c (print_ops): Fix DW_OP_call[24] decoding.
2504
2505         * readelf.c (print_ops): Print (empty)\n when LEN == 0.
2506
2507 2009-01-24  Ulrich Drepper  <drepper@redhat.com>
2508
2509         * readelf.c (print_debug_frame_section): Fix computation of vma_base
2510         for PC-relative mode.
2511
2512 2009-01-23  Ulrich Drepper  <drepper@redhat.com>
2513
2514         * size.c (process_file): When handling archive, close file descriptor
2515         here.  For unknown file format also close file descriptor.
2516         (handle_ar): Don't close file descriptor here.
2517
2518         * readelf.c (parse_opt): Move code to add to dump_data_sections and
2519         string_sections list in local function add_dump_section.  Adjust 'x'
2520         key handling.  For 'a' key add .strtab, .dynstr, and .comment section
2521         to string_sections list.
2522
2523 2009-01-22  Roland McGrath  <roland@redhat.com>
2524
2525         * readelf.c (print_phdr): Don't print section mapping when no sections.
2526
2527         * Makefile.am (AM_CFLAGS): Pass -Wno-format for *_no_Wformat.
2528
2529         * readelf.c (print_debug_frame_section): Initialize IS_SIGNED to false
2530         and reset it only for the 'true' cases.
2531
2532         * Makefile.am (addr2line_no_Wformat): New variable.
2533
2534         * readelf.c (print_debug_frame_section): Use t instead of j formats
2535         for ptrdiff_t OFFSET.
2536
2537 2009-01-21  Ulrich Drepper  <drepper@redhat.com>
2538
2539         * elflint.c (check_program_header): Fix typo in .eh_frame_hdr section
2540         test.  Handle debuginfo files.
2541         (check_exception_data): First sanity test.
2542
2543 2009-01-17  Ulrich Drepper  <drepper@redhat.com>
2544
2545         * readelf.c (print_debug_exception_table): Show target of ar_disp
2546         field.
2547
2548         * elflint.c (check_program_header): Add most consistency checks for
2549         PT_GNU_EH_FRAME entry.
2550
2551         * addr2line.c: Use ARGP_PROGRAM_VERSION_HOOK_DEF and
2552         ARGP_PROGRAM_BUG_ADDRESS_DEF.
2553         * ar.c: Likewise.
2554         * elfcmp.c: Likewise.
2555         * elflint.c: Likewise.
2556         * findtextrel.c: Likewise.
2557         * ld.c: Likewise.
2558         * nm.c: Likewise.
2559         * objdump.c: Likewise.
2560         * ranlib.c: Likewise.
2561         * readelf.c: Likewise.
2562
2563         * size.c: Likewise.
2564         * strings.c: Likewise.
2565         * strip.c: Likewise.
2566         * unstrip.c: Likewise.
2567
2568 2009-01-16  Ulrich Drepper  <drepper@redhat.com>
2569
2570         * elflint.c (check_program_header): Check that PT_GNU_EH_FRAME entry
2571         matches .eh_frame_hdr section, if it is available.  Also check that
2572         the segment is allocated, not writable, not executable.
2573
2574         * readelf.c: Add -e option.  Dump exception and unwind related
2575         sections.  Add -e to -a.
2576         (print_encoding_base): Handle DW_EH_PE_omit.
2577         (print_debug_exception_table): Beginning of support.
2578         (print_debug): Hook up print_debug_exception_table for
2579         .gcc_except_table sections.
2580
2581         * readelf.c (print_debug_frame_section): Some fixes for last change.
2582
2583 2009-01-15  Ulrich Drepper  <drepper@redhat.com>
2584
2585         * readelf.c (print_encoding): Now a toplevel function.
2586         (print_relinfo): Likewise.
2587         (print_encoding_base): Broken out of print_debug_frame_section.
2588         (print_debug_frame_section): Print different header for .eh_frame
2589         sections.  Fix recognition of matching CIEs in .debug_frame sections.
2590         Print absolute offset for PC-relative FDE locations.  Don't print
2591         table header for FDEs if the table is empty.
2592         (read_encoded): New function.
2593         (print_debug_frame_hdr_section): New function.
2594         (print_debug): Hook up print_debug_frame_hdr_section for .eh_frame_hdr
2595         sections.
2596
2597         * readelf.c (handle_relocs_rel): Print section number.
2598         (print_debug_abbrev_section): Likewise.
2599         (print_debug_aranges_section): Likewise.
2600         (print_debug_ranges_section): Likewise.
2601         (print_debug_info_section): Likewise.
2602         (print_debug_line_section): Likewise.
2603         (print_debug_loc_section): Likewise.
2604         (print_debug_macinfo_section): Likewise.
2605         (print_debug_pubnames_section): Likewise.
2606         (print_debug_str_section): Likewise.
2607
2608 2009-01-10  Ulrich Drepper  <drepper@redhat.com>
2609
2610         * strings.c (read_block): Fix typo in error message string.
2611
2612 2009-01-07  Ulrich Drepper  <drepper@redhat.com>
2613
2614         * ld.c (ld_new_searchdir): Fix adding to search path list.
2615
2616 2009-01-06  Ulrich Drepper  <drepper@redhat.com>
2617
2618         * readelf.c: Implement call frame debug section dumping.
2619
2620 2009-01-05  Roland McGrath  <roland@redhat.com>
2621
2622         * elfcmp.c: Exit with status 2 for errors (like cmp, diff, grep).
2623         Status 1 (aka EXIT_FAILURE) is only for completed OK but not equal.
2624
2625 2009-01-01  Ulrich Drepper  <drepper@redhat.com>
2626
2627         * addr2line.c: Update copyright year.
2628         * ar.c: Likewise.
2629         * elfcmp.c: Likewise.
2630         * elflint.c: Likewise.
2631         * findtextrel.c: Likewise.
2632         * ld.c: Likewise.
2633         * nm.c: Likewise.
2634         * objdump.c: Likewise.
2635         * ranlib.c: Likewise.
2636         * readelf.c: Likewise.
2637         * size.c: Likewise.
2638         * strings.c: Likewise.
2639         * strip.c: Likewise.
2640         * unstrip.c: Likewise.
2641
2642 2008-12-11  Roland McGrath  <roland@redhat.com>
2643
2644         * nm.c (sym_name): New function.
2645         (show_symbols_sysv): Use it in place of elf_strptr.
2646         (show_symbols_bsd, show_symbols_posix): Likewise.
2647         Fixes RHBZ#476136.
2648
2649         * nm.c (show_symbols_sysv): Use an alloca'd backup section name when
2650         elf_strptr fails.
2651
2652 2008-12-02  Roland McGrath  <roland@redhat.com>
2653
2654         * readelf.c (count_dwflmod, process_file): Don't presume encoding of
2655         nonzero OFFSET argument to dwfl_getmodules.
2656
2657 2008-08-07  Roland McGrath  <roland@redhat.com>
2658
2659         * addr2line.c (main): Pass string to handle_address.
2660         (see_one_module): New function, subroutine of handle_address.
2661         (find_symbol): Likewise.
2662         (handle_address): Take string argument rather than address.
2663         Convert plain number, or handle strings like "(section)+offset"
2664         or "symbol+offset".
2665
2666 2008-08-01  Roland McGrath  <roland@redhat.com>
2667
2668         * readelf.c (handle_core_item): Handle 'B' type for 1-origin bitset.
2669         For 'b' and 'B', print <x-y,z> or ~<x,y-z> rather than 1/0 string.
2670
2671         * readelf.c (convert): Take new argument SIZE.
2672         (handle_core_register, handle_core_item): Update callers.
2673         (handle_core_item): Take new arg REPEATED_SIZE.
2674         (handle_core_items): Special case for a singleton item,
2675         let handle_core_item handle repeats if it wants to.
2676
2677         * readelf.c (handle_core_items): Give abridged output
2678         for identical groups repeated more than twice.
2679
2680 2008-07-04  Roland McGrath  <roland@redhat.com>
2681
2682         * readelf.c (handle_core_items): Handle ELF_T_ADDR.
2683
2684 2008-04-10  Roland McGrath  <roland@redhat.com>
2685
2686         * strip.c (handle_elf): Don't keep sections that kept symbol tables
2687         refer to.  Instead, just be sure to preserve the original symbol
2688         table in the debug file so those symbols go with their sections and
2689         can be elided from the stripped version of the symbol table.
2690
2691         * strip.c (handle_elf): When a discarded section kept in the debug
2692         file refers to a nondiscard section via sh_link/sh_info, preserve
2693         that nondiscarded section unmodified in the debug file as well.
2694         Skip adjustment of discarded sections symbol table references when
2695         that symbol table is copied in this way.
2696
2697         * elflint.c (check_symtab): Don't crash from missing symbol names
2698         after diagnosing bogus strtab.
2699
2700         * strip.c (handle_elf): Cosmetic cleanup in special section contents
2701         adjustment for symtab changes.
2702
2703 2008-03-31  Roland McGrath  <roland@redhat.com>
2704
2705         * elflint.c (check_sections): Add checks on SHF_EXECINSTR sections:
2706         must be SHT_PROGBITS, must not be SHF_WRITE.  Let backend hook
2707         excuse a special section.
2708
2709 2008-03-27  Roland McGrath  <roland@redhat.com>
2710
2711         * elflint.c (check_sections): Check that executability and writability
2712         of sections is reflected in segment p_flags.
2713
2714 2008-03-26  Roland McGrath  <roland@redhat.com>
2715
2716         * elflint.c (check_program_header): Accept PT_GNU_RELRO p_flags
2717         that matches its PT_LOAD's p_flags &~ PF_W.  On sparc, PF_X really
2718         is valid in RELRO.
2719
2720 2008-02-29  Roland McGrath  <roland@redhat.com>
2721
2722         * readelf.c (print_attributes): Add a cast.
2723         * elflint.c (check_attributes): Likewise.
2724
2725         * unaligned.h (add_8ubyte_unaligned): Cast PTR argument for parity
2726         with [UNALIGNED_ACCESS_CLASS == BYTE_ORDER] definition.
2727         (add_4ubyte_unaligned, add_2ubyte_unaligned): Likewise.
2728
2729 2008-02-03  Ulrich Drepper  <drepper@redhat.com>
2730
2731         * i386_ld.c (elf_i386_count_relocations): Implement R_386_TLS_GD
2732         when linked into executable.
2733         (elf_i386_create_relocations): Likewise.
2734
2735 2008-02-20  Roland McGrath  <roland@redhat.com>
2736
2737         * readelf.c (print_attributes): New function.
2738         (process_elf_file): Call it under -A.
2739
2740         * elflint.c (check_attributes): Implement it for real.
2741
2742 2008-02-19  Roland McGrath  <roland@redhat.com>
2743
2744         * elflint.c (special_sections): Handle .gnu.attributes section.
2745         (check_sections): Likewise.
2746         (check_attributes): New function.
2747
2748 2008-02-10  Roland McGrath  <roland@redhat.com>
2749
2750         * elfcmp.c (main): Ignore sh_offset differences in non-SHF_ALLOC
2751         sections and ET_REL files.
2752
2753 2008-02-02  Ulrich Drepper  <drepper@redhat.com>
2754
2755         * elf32-i386.script: Add .eh_frame_hdr, .tdata, and .tbss sections.
2756         * i386_ld.c (elf_i386_count_relocations): Handle R_386_TLS_LDO_32
2757         and R_386_TLS_LE.
2758         (elf_i386_create_relocations): Likewise.
2759         * ld.h (struct ld_state): Add need_tls, tls_start, and tls_tcb
2760         elements.
2761         * ldgeneric.c (add_section): If TLS section is used, set need_tls flag.
2762         (ld_generic_create_outfile): Add PT_TLS entry to program  header.
2763         Fix generation of PT_GNU_STACK entry.
2764
2765 2008-02-01  Ulrich Drepper  <drepper@redhat.com>
2766
2767         * ld.c (replace_args): Prevent loop over replacements if the parameter
2768         is only two characters long.
2769
2770         * ld.c: Recognize sha1 argument for --build-id parameter.
2771         * ldgeneric.c (create_build_id_section): Handle sha1.
2772         (compute_hash_sum): New function.  Broken out of compute_build_id.
2773         Take hash function and context as parameters.
2774         (compute_build_id): Use compute_hash_sum for md5 and the new sha1
2775         implementation.
2776
2777 2008-01-31  Ulrich Drepper  <drepper@redhat.com>
2778
2779         * elf32-i386.script: Add .note.ABI-tag and .note.gnu.build-id sections.
2780         * ld.c: Recognize --build-id command line parameter.
2781         * ld.h: Define scn_dot_note_gnu_build_id.
2782         (struct ld_state): Add build_id and buildidscnidx elements.
2783         * ldgeneric.c: Implement --build-id command line parameter.
2784         * ldlex.l (ID): Recognize - as valid character after the first one.
2785
2786 2008-01-29  Ulrich Drepper  <drepper@redhat.com>
2787
2788         * ld.c (replace_args): New function.
2789         (main): Use it to rewrite old-style parameters.
2790
2791         * elf32-i386.script: Add .gnu.hash section.
2792         * ldgeneric.c (optimal_bucket_size): A tiny bit more efficient.
2793         (fillin_special_symbol): Initialize st_size.
2794         (sortfct_hashval): New function.
2795         (create_gnu_hash): New function.
2796         (create_hash): New function.
2797         (ld_generic_create_outfile): Use the new functions to create the
2798         hash tables.
2799
2800         * elflint.c (check_gnu_hash): Fix index value printed in error message.
2801
2802 2008-01-24  Ulrich Drepper  <drepper@redhat.com>
2803
2804         * elflint.c (check_group): Check that signature symbol for section
2805         group is not an empty string.
2806         * ldgeneric.c: Remove magic assignment of indeces in the dynsym
2807         section.  Start implementation of --hash-style.
2808         * i386_ld.c: Likewise.
2809         * ld.c: Recognize --hash-style.
2810         * ld.h (struct scninfo): Add comdat_group.
2811         Add additional parameter to finalize_plt callback.
2812
2813 2008-01-22  Ulrich Drepper  <drepper@redhat.com>
2814
2815         * ld.h (struct callbacks): Add initialize_gotplt.
2816         (struct scnhead): Add scn_dot_gotplt.
2817         (struct ld_state): Add gotpltscnidx.
2818         * i386_ld.c (elf_i386_initialize_plt): Minor optimization.
2819         (elf_i386_initialize_pltrel): Likewise.
2820         (elf_i386_initialize_got): There is now a separate .got.plt, so
2821         don't do the PLT-related work here.  Initialize d_type.
2822         (elf_i386_initialize_gotplt): New function.
2823         (elf_i386_plt0): Use ud2a after indirect jump.
2824         (elf_i386_pic_plt0_entry): Likewise.
2825         (elf_i386_finalize_plt): Reference now .got.plt.
2826         (elf_i386_count_relocations): For GOT entries which need no relocation
2827         don't bump nrel_got.
2828         (elf_i386_create_relocations): Also get .got.plt.  Rewrite R-386_GOT32
2829         handling for split .got/.got.plt.
2830         (elf_i386_ld_init): Initialize callbacks.initialize_gotplt.
2831         * elf32-i386.script: Sort sections for security.  There are no .got
2832         input sections.  Add .got.plt.
2833         * ldgeneric.c (ld_generic_generate_sections): Add .got.plt section.
2834         (ld_generic_create_outfile): Initialize .got.plt section.
2835         Use .got.plt address for _GLOBAL_OFFSET_TABLE_ symbol and DT_PLTGOT.
2836
2837 2008-01-19  Ulrich Drepper  <drepper@redhat.com>
2838
2839         * i386_ld.c (elf_i386_count_relocations): PLT relocations for undefined
2840         symbols are not carried over into statically linked output files.
2841         Add dummy entries for more TLS relocations.
2842
2843         * ld.c (options): Add long names for -( and -).
2844
2845         * ldgeneric.c (check_definition): For newly found definitions don't
2846         mark section as used if symbol is absolute.
2847         (extract_from_archive): Only assign archive sequence number the first
2848         time the archive is handled.  Update ld_state.last_archive_used
2849         if any symbol was used.  Remove nround variable.
2850         (file_process2): When using symbol from an archive, update
2851         ld_state.group_start_archive, ld_state.archives, and
2852         ld_state.tailarchives.
2853         (ld_generic_file_process): If group is not handled anymore, after
2854         freeing ELF handles for the archives, clear ld_state.archives and
2855         *nextp.  Fix wrong logic in recognizing first iteration of group
2856         loop.  When clearing flags, also clear ld_state.group_start_archive.
2857
2858 2008-01-11  Ulrich Drepper  <drepper@redhat.com>
2859
2860         * objdump.c (show_disasm): Adjust disassembler format string for
2861         removal of %e.
2862
2863 2008-01-04  Roland McGrath  <roland@redhat.com>
2864
2865         * readelf.c (handle_core_items): Take new arg DESCSZ; if nonzero,
2866         a size greater than the items cover means multiple sets of items.
2867         (handle_core_note): Update caller.
2868
2869 2008-01-04  Roland McGrath  <roland@redhat.com>
2870
2871         * strip.c (handle_elf): Move SHDRIDX defn to silence gcc warning.
2872
2873 2008-01-03  Roland McGrath  <roland@redhat.com>
2874
2875         * ld.h (linked_from_dso_p): Use __attribute__ ((__gnu_inline__)).
2876
2877         * elflint.c (check_dynamic): Remove duplicate initializer.
2878
2879 2008-01-02  Ulrich Drepper  <drepper@redhat.com>
2880
2881         * addr2line.c: Update copyright year.
2882         * ar.c: Likewise.
2883         * elfcmp.c: Likewise.
2884         * elflint.c: Likewise.
2885         * findtextrel.c: Likewise.
2886         * ld.c: Likewise.
2887         * nm.c: Likewise.
2888         * objdump.c: Likewise.
2889         * ranlib.c: Likewise.
2890         * readelf.c: Likewise.
2891         * size.c: Likewise.
2892         * strings.c: Likewise.
2893         * strip.c: Likewise.
2894         * unstrip.c: Likewise.
2895
2896 2007-12-30  Ulrich Drepper  <drepper@redhat.com>
2897
2898         * objdump (show_disasm): Use %e after third parameter.
2899
2900 2007-12-21  Ulrich Drepper  <drepper@redhat.com>
2901
2902         * strip.c: Fix wrong parenthesis in a few branch predictions.
2903         * strings.c: Likewise.
2904
2905 2007-12-20  Ulrich Drepper  <drepper@redhat.com>
2906
2907         * Makefile.am (DEFS): Add DEBUGPRED.
2908         * addr2line.c: Include debugpred.h.
2909         * ar.c: Likewise.
2910         * elfcmp.c: Likewise.
2911         * elflint.c: Likewise.
2912         * findtextrel.c: Likewise.
2913         * nm.c: Likewise.
2914         * objdump.c: Likewise.
2915         * ranlib.c: Likewise.
2916         * readelf.c: Likewise.
2917         * size.c: Likewise.
2918         * strings.c: Likewise.
2919         * strip.c: Likewise.
2920         * unstrip.c: Likewise.
2921         * debugpred.h: New file.
2922
2923         * readelf.c (handle_relocs_rel): Use elf_scnshndx.
2924         (handle_relocs_rela): Likewise.
2925
2926         * readelf.c: Add lots of likely/unlikely.
2927
2928         * elflint.c: Minor cleanups.
2929
2930 2007-11-19  Roland McGrath  <roland@redhat.com>
2931
2932         * readelf.c (print_ops): Handle all bad op codes gracefully.
2933         Print their numbers instead of just ???.
2934
2935 2007-11-09  Roland McGrath  <roland@redhat.com>
2936
2937         * readelf.c (attr_callback): Handle DW_AT_data_location.
2938         Handle block forms to mean a DWARF expression for DW_AT_allocated,
2939         DW_AT_associated, DW_AT_bit_size, DW_AT_bit_offset, DW_AT_bit_stride,
2940         DW_AT_byte_size, DW_AT_byte_stride, DW_AT_count, DW_AT_lower_bound,
2941         DW_AT_upper_bound.
2942
2943 2007-10-20  Roland McGrath  <roland@redhat.com>
2944
2945         * unstrip.c (options): Update -R description.
2946         (struct symbol): Put symbol details a union with a size_t pointer
2947         `duplicate'.
2948         (compare_symbols_output): Use null ->name as marker for discard
2949         symbols, not zero *->map.
2950         (copy_elided_sections): Record forwarding pointers for discarded
2951         duplicates and fill SYMNDX_MAP elements through them.
2952
2953         * readelf.c (process_file): Set offline_next_address to 0 at start.
2954         (struct process_dwflmod_args): New type.
2955         (process_dwflmod): Take args in it, pass fd to process_elf_file.
2956         (process_file): Update caller; dup FD for passing to libdwfl.
2957         (process_elf_file): Take new arg FD.  For ET_REL file when
2958         displaying data affected by libdwfl relocation, open a new Elf handle.
2959
2960 2007-10-17  Roland McGrath  <roland@redhat.com>
2961
2962         * readelf.c (print_debug_line_section): For invalid data inside a
2963         unit with plausible length, keep printing at the next unit boundary.
2964
2965         * readelf.c (attr_callback): Use dwarf_formref_die, not dwarf_formref.
2966
2967 2007-10-16  Roland McGrath  <roland@redhat.com>
2968
2969         * readelf.c (hex_dump): Fix rounding error in whitespace calculation.
2970
2971 2007-10-15  Roland McGrath  <roland@redhat.com>
2972
2973         * make-debug-archive.in: New file.
2974         * Makefile.am (EXTRA_DIST): Add it.
2975         (make-debug-archive): New target.
2976         (bin_SCRIPTS, CLEANFILES): Add it.
2977
2978 2007-10-10  Roland McGrath  <roland@redhat.com>
2979
2980         * elflint.c (special_sections): Add new attrflag value exact_or_gnuld.
2981         Use it to check MERGE|STRINGS for .debug_str.
2982         (check_sections): Handle exact_or_gnuld.
2983
2984 2007-10-08  Roland McGrath  <roland@redhat.com>
2985
2986         * readelf.c (handle_core_item): Handle 'T'|0x80 to indicate
2987         64-bit struct timeval with 32-bit tv_usec.
2988
2989 2007-10-07  Roland McGrath  <roland@redhat.com>
2990
2991         * readelf.c (check_archive_index): New function.
2992         (process_file): Call it.  Change signature to take only fd and name.
2993         Use libdwfl to open the file, then iterate on its modules (multiple
2994         for an archive) to print file name and call process_elf_file.
2995         (main): Update caller.  Let process_file do elf_begin.
2996         (count_dwflmod, process_dwflmod, find_no_debuginfo): New functions.
2997         (process_elf_file): Take only Dwfl_Module * argument.
2998         Don't print the file name here.
2999         (print_debug_*_section): Take Dwfl_Module * argument.
3000         (print_debug): Likewise.  Update caller.
3001         (format_dwarf_addr): New function.
3002         (print_debug_ranges_section): Use it.
3003         (attr_callback): Likewise.
3004         (print_debug_line_section, print_debug_loc_section): Likewise.
3005
3006         * readelf.c (print_debug_ranges_section): Translate all strings.
3007         (print_debug_loc_section): Likewise.
3008
3009         * unstrip.c (copy_elided_sections): Initialize SEC.
3010
3011         * ar.c (do_oper_insert): Put trailing / on short names.
3012
3013         * arlib.h (MAX_AR_NAME_LEN): Decrease by one.
3014
3015         * arlib2.c (arlib_add_long_name): Adjust for header size.
3016
3017         * arlib.c (arlib_finalize): Pad long name table to keep size even.
3018
3019         * ar.c (do_oper_insert): Use write_retry for padding write.
3020
3021         * ar.c (do_oper_insert): Initialize CUR_OFF in no_old case.
3022         Unconditionally set FOUND[CNT]->elf when setting ->mem.
3023         (remember_long_name): New function.
3024         (do_oper_insert): Call it.  Correctly use length of basename,
3025         not original name.  Don't store long name twice for new member.
3026
3027 2007-10-06  Roland McGrath  <roland@redhat.com>
3028
3029         * elflint.c (check_note): Skip empty segment.
3030         (check_note_section): Skip empty section.
3031
3032         * unstrip.c (options, parse_opt, struct arg_info): Grok -R/--relocate.
3033         (handle_output_dir_module, handle_implicit_modules): Pass it down.
3034         (handle_dwfl_module): When set, use ET_REL already loaded by Dwfl.
3035         (compare_alloc_sections): Take new arg REL, ignore address if true.
3036         (compare_sections): Likewise, pass it down.
3037         (compare_sections_rel, compare_sections_nonrel): New functions.
3038         (find_alloc_sections_prelink, copy_elided_sections): Use them
3039         instead of compare_sections.
3040         (sections_match): New function, broken out of ...
3041         (find_alloc_section): ... here.
3042         (copy_elided_sections): Reorganize section match-up logic.
3043         Use sections_match for SHF_ALLOC in ET_REL.
3044         For ET_REL, let the nonzero sh_addr from the debug file dominate.
3045
3046         * unstrip.c (add_new_section_symbols): Take new arg REL.
3047         When true, do not update section symbol values.
3048         (collect_symbols): Likewise.  Update section symbols with address
3049         of chosen output section, not original section.
3050         (check_symtab_section_symbols, copy_elided_sections): Update callers.
3051
3052         * unstrip.c (compare_alloc_sections): At the same address, preserve
3053         original section order.
3054
3055         * elflint.c (special_sections): Don't require MERGE|STRINGS for
3056         .debug_str, it didn't always have them with older tools.
3057
3058         * elflint.c (check_symtab, check_one_reloc): Ignore sh_addr in ET_REL.
3059
3060 2007-10-05  Roland McGrath  <roland@redhat.com>
3061
3062         * elflint.c (check_symtab): Allow SHN_UNDEF _GLOBAL_OFFSET_TABLE_ in
3063         ET_REL file.
3064
3065         * elflint.c (check_symtab): For _GLOBAL_OFFSET_TABLE_, diagnose
3066         SHN_UNDEF as "bad section".  Use shndx value in messages.
3067
3068         * elflint.c (special_sections): Add ".debug_str".  Decrement namelen
3069         for ".debug" so it matches as a prefix.
3070         (IS_KNOWN_SPECIAL): New macro.
3071         (check_sections): Use it for ".plt" match.  Cite wrong SHT_NOBITS
3072         type even under -d, for a .debug* or .shstrtab section.
3073
3074         * readelf.c (print_ops): Use hex for address operand.
3075
3076 2007-10-04  Roland McGrath  <roland@redhat.com>
3077
3078         * unstrip.c (copy_elided_sections): Initialize NDX_SECTION element for
3079         .gnu_debuglink section to SHN_UNDEF.  Drop STT_SECTION symbols for
3080         sections mapped to SHN_UNDEF.
3081
3082 2007-10-04  Ulrich Drepper  <drepper@redhat.com>
3083
3084         * readelf.c (dump_archive_index): Avoid warning about uninitialized
3085         variable with older glibc versions.
3086         Add some branch prediction.
3087
3088 2007-10-04  Roland McGrath  <roland@redhat.com>
3089
3090         * readelf.c (print_archive_index): New variable.
3091         (options, parse_opt): Accept -c/--archive-index to set it.
3092         (dump_archive_index): New function.
3093         (process_file): Take new arg WILL_PRINT_ARCHIVE_INDEX.
3094         Call dump_archive_index on archives if set.
3095         (main): Update caller.
3096         (any_control_option): Give it file scope, moved out of ...
3097         (parse_opt): ... here.
3098
3099 2007-10-03  Roland McGrath  <roland@redhat.com>
3100
3101         * unstrip.c (struct arg_info): Add `list' flag.
3102         (options, parse_opt): Grok -n/--list to set it.
3103         (list_module): New function.
3104         (handle_implicit_modules): Call it under -n.
3105
3106         * elflint.c (check_note_section): New function.
3107         (check_sections): Call it for SHT_NOTE.
3108
3109         * readelf.c (handle_notes): Use sections when available.
3110
3111         * elflint.c (check_note_data): New function, broken out of ...
3112         (check_note): ... here.  Call it and elf_getdata_rawchunk.
3113
3114         * readelf.c (handle_auxv_note): Take offset as argument, not buffer.
3115         Use elf_getdata_rawchunk and gelf_getauxv.
3116         (handle_notes_data): New function, broken out of ...
3117         (handle_notes): ... here.  Call it and elf_getdata_rawchunk.
3118
3119 2007-10-01  Roland McGrath  <roland@redhat.com>
3120
3121         * readelf.c (hex_dump): Fix transposed subtraction generating spaces.
3122
3123         * readelf.c (hex_dump): Fix line header to be hex instead of decimal.
3124
3125 2007-09-10  Roland McGrath  <roland@redhat.com>
3126
3127         * readelf.c (options): Give -p optional argument, alias --string-dump.
3128         (string_sections, string_sections_tail): New static variables.
3129         (parse_opt): Set them when -p has an argument.
3130         (print_string_section): New function, broken out of ...
3131         (print_strings): ... here.  Call it.
3132         (dump_data_section): New function, broken out of ...
3133         (dump_data): ... here.  Call it.
3134         (for_each_section_argument): New function, broken out of ...
3135         (dump_data): ... here.  Call it.
3136         (dump_strings): New function.
3137
3138 2007-08-31  Roland McGrath  <roland@redhat.com>
3139
3140         * readelf.c (print_strings): Typo fix.
3141
3142 2007-08-23  Roland McGrath  <roland@redhat.com>
3143
3144         * readelf.c (printf_with_wrap): Function removed.
3145         (REGISTER_WRAP_COLUMN): New macro.
3146         (handle_core_register): Use print_core_item instead.
3147         (struct register_info): New type.
3148         (compare_registers, compare_register_sets): New functions.
3149         (register_bitpos, compare_sets_by_info): New functions.
3150         (handle_core_registers): Use those to segregate and sort registers
3151         for display.
3152
3153         * readelf.c (ITEM_WRAP_COLUMN): New macro.
3154         (print_core_item): New function.
3155         (handle_core_item): Use it instead of printf_with_wrap.
3156         (compare_core_items, compare_core_item_groups): New functions.
3157         (handle_core_items): Use them.  Sort by group and force line breaks
3158         between groups.
3159
3160         * readelf.c (handle_core_registers, handle_core_items): New functions,
3161         broken out of ...
3162         (handle_core_note): ... here.   Call them.
3163
3164 2007-08-22  Roland McGrath  <roland@redhat.com>
3165
3166         * unstrip.c (new_shstrtab): New function, broken out of ...
3167         (copy_elided_sections): ... here.
3168
3169 2007-08-20  Roland McGrath  <roland@redhat.com>
3170
3171         Avoid local function trampolines in nm binary.
3172         * nm.c (sort_by_address): Move to a static function instead of local
3173         inside show_symbols.
3174         (sort_by_name_strtab): New static variable.
3175         (sort_by_name): Use it.  Move to a static function instead of local
3176         inside show_symbols.
3177         (show_symbols): Set sort_by_name_strtab.
3178
3179 2007-08-19  Roland McGrath  <roland@redhat.com>
3180
3181         * readelf.c (handle_auxv_note): New function.
3182         (handle_notes): Call it.
3183
3184         * readelf.c (printf_with_wrap, convert): New functions.
3185         (handle_core_item, (handle_core_register): New functions.
3186         (handle_notes): Call those with details from ebl_core_note.
3187
3188 2007-08-12  Roland McGrath  <roland@redhat.com>
3189
3190         * elflint.c (check_note): Accept type 0 with name "Linux".
3191
3192         * elflint.c (special_sections): Accept SHF_ALLOC for ".note".
3193
3194         * elflint.c (section_flags_string): Return "none" for 0, not "".
3195
3196 2007-08-11  Roland McGrath  <roland@redhat.com>
3197
3198         * elflint.c (check_note): Accept NT_GNU_HWCAP, NT_GNU_BUILD_ID.
3199
3200 2007-08-04  Ulrich Drepper  <drepper@redhat.com>
3201
3202         * readelf.c (hex_dump): Use isprint to determine whether to print
3203         character itself or full stop character.
3204         (dump_data): No need to check endp for NULL after strtol call.
3205
3206 2007-08-03  Roland McGrath  <roland@redhat.com>
3207
3208         * readelf.c (print_string_sections): New variable.
3209         (options, parse_opt): Handle --strings/-p to set it.
3210         (print_strings): New function.
3211         (process_elf_file): Call it under -p.
3212
3213         * readelf.c (options): Add hidden aliases --segments, --sections,
3214         as taken by binutils readelf.
3215
3216 2007-08-01  Roland McGrath  <roland@redhat.com>
3217
3218         * readelf.c (dump_data_sections, dump_data_sections_tail):
3219         New variables.
3220         (options, parse_opt): Handle --hex-dump/-x, set them.
3221         (hex_dump): New function.
3222         (dump_data): New function, call it.
3223         (process_elf_file): Call it.
3224
3225 2007-07-25  Roland McGrath  <roland@redhat.com>
3226
3227         * addr2line.c (show_symbols): New variable.
3228         (print_addrsym): New function.
3229         (handle_address): Call it.
3230         (options, parse_opt): Handle -S/--symbols.
3231
3232 2007-06-05  Ulrich Drepper  <drepper@redhat.com>
3233
3234         * addr2line.c: Update for latest autoconf header.
3235         * ar.c: Likewise.
3236         * elfcmp.c: Likewise.
3237         * elflint.c: Likewise.
3238         * findtextrel.c: Likewise.
3239         * ld.c: Likewise.
3240         * ldgeneric.c: Likewise.
3241         * nm.c: Likewise.
3242         * objdump.c: Likewise.
3243         * ranlib.c: Likewise.
3244         * readelf.c: Likewise.
3245         * size.c: Likewise.
3246         * strings.c: Likewise.
3247         * strip.c: Likewise.
3248         * unstrip.c: Likewise.
3249
3250 2007-05-18  Roland McGrath  <roland@redhat.com>
3251
3252         * unstrip.c (copy_elided_sections): Match up non-NOBITS sections with
3253         stripped file, so as not to duplicate a section copied in both.
3254
3255         * strip.c (handle_elf): Keep SHT_NOTE section copies in the debug file.
3256
3257 2007-05-17  Roland McGrath  <roland@redhat.com>
3258
3259         * unstrip.c (copy_elided_sections): Don't call gelf_newphdr for 0.
3260
3261         * unstrip.c (handle_file): Tweak BIAS != 0 warning.
3262
3263         * unstrip.c (handle_file): Take new arg CREATE_DIRS.  If set,
3264         call make_directories here.
3265         (handle_explicit_files): Take new arg CREATE_DIRS, pass it down.
3266         (handle_dwfl_module): Likewise.
3267         (handle_implicit_modules): Update callers.
3268         (handle_output_dir_module): Likewise.  Don't do make_directories here.
3269
3270         * unstrip.c (get_section_name): New function, broken out of ...
3271         (copy_elided_sections): here.  Update callers.
3272         (find_alloc_section): Broken out of ...
3273         (copy_elided_sections): ... here.  Update caller.
3274         (symtab_count_leading_section_symbols): Take new arg NEWSYMDATA,
3275         update STT_SECTION symbols' st_value fields as a side effect.
3276         (check_symtab_section_symbols): Update caller.
3277         (add_new_section_symbols): Set st_value in symbols added.
3278         (collect_symbols): Reset S->value for STT_SECTION symbols recorded.
3279         Take new arg SPLIT_BSS.  Adjust S->shndx recorded for symbols moved
3280         from .bss to .dynbss.
3281         (find_alloc_sections_prelink): New function.  Associate debug file
3282         allocated SHT_NOBITS shdrs with stripped moved by prelink via
3283         .gnu.prelink_undo information.
3284         (copy_elided_sections): Call it when we couldn't find every allocated
3285         section.  Don't use a debug file non-NOBITS section if SHF_ALLOC.
3286         Take STRIPPED_EHDR arg instead of E_TYPE and PHNUM.
3287         (handle_file): Update callers.
3288
3289         * unstrip.c (copy_elided_sections): Ignore unfound unallocated section
3290         named ".comment".
3291
3292         * elflint.c (check_sections): Fix association of segments with
3293         sections when p_memsz > p_filesz.
3294
3295 2007-04-29  Roland McGrath  <roland@redhat.com>
3296
3297         * addr2line.c (options, main): Tweak argp group settings to fix
3298         usage output.
3299
3300 2007-04-28  Roland McGrath  <roland@redhat.com>
3301
3302         * strip.c (handle_elf): Update debug file's SHT_NOBITS sections'
3303         sizes to match sections adjusted in the stripped file.
3304
3305 2007-04-24  Roland McGrath  <roland@redhat.com>
3306
3307         * elfcmp.c (OPT_HASH_INEXACT): New macro.
3308         (hash_inexact): New variable.
3309         (options, parse_opt): Add --hash-inexact option to set it.
3310         (hash_content_equivalent): New function.
3311         (main): Call it for differing SHT_HASH sections under --hash-inexact.
3312
3313 2007-04-23  Roland McGrath  <roland@redhat.com>
3314
3315         * unstrip.c: New file.
3316         * Makefile.am (bin_PROGRAMS): Add it.
3317         (unstrip_LDADD): New variable.
3318
3319         * strip.c (options): Allow --output for -o.
3320
3321 2007-02-15  Ulrich Drepper  <drepper@redhat.com>
3322
3323         * readelf.c: Remove unused code.  Add a few consts.
3324
3325 2007-02-15  Roland McGrath  <roland@redhat.com>
3326
3327         * readelf.c (print_debug): Fix brainos in SHDR test.
3328
3329 2007-02-05  Roland McGrath  <roland@redhat.com>
3330
3331         * ar.c: Include <limits.h>, since we use LONG_MAX.
3332
3333 2007-02-05  Ulrich Drepper  <drepper@redhat.com>
3334
3335         * ar.c: Add ugly hack to work around gcc complaining that we
3336         ignore fchown's return value.
3337         (do_oper_insert): Handle error when writing padding.
3338         * ranlib.c: Add fchown complain work around.
3339
3340         * arlib.c: Make symtab a global variable.  Change all users.
3341         * arlib2.c: Likewise.
3342         * ranlib.c: Likewise.
3343         * ar.c: Likewise.
3344         * arlib.h: Declare it.
3345
3346 2007-01-11  Roland McGrath  <roland@redhat.com>
3347
3348         * elflint.c (check_sections): Use ebl_machine_section_flag_check on
3349         SHF_MASKPROC bits separately from generic sh_flags validation.
3350
3351 2007-02-04  Ulrich Drepper  <drepper@redhat.com>
3352
3353         * ar.c: New file.
3354         * arlib.c: New file.
3355         * arlib2.c: New file.
3356         * arlib.h: New file.
3357         * Makefile (noinst_LIBRARIES): Add libar.
3358         (libar_a_SOURCES): Define.
3359         (ar_LDADD): Define.
3360         (CFLAGS_ar): Define.
3361         * ranlib.c: Change to use arlib.
3362
3363         * elflint.c (check_symtab): Work around GNU ld bug which omits
3364         sections but not symbols in those sections.
3365
3366 2007-01-10  Ulrich Drepper  <drepper@redhat.com>
3367
3368         * addr2line.c: Update copyright year.
3369         * elfcmp.c: Likewise.
3370         * elflint.c: Likewise.
3371         * findtextrel.c: Likewise.
3372         * ld.c: Likewise.
3373         * nm.c: Likewise.
3374         * objdump.c: Likewise.
3375         * ranlib.c:  Likewise.
3376         * readelf.c: Likewise.
3377         * size.c: Likewise.
3378         * strings.c: Likewise.
3379         * strip.c: Likewise.
3380
3381 2006-12-09  Ulrich Drepper  <drepper@redhat.com>
3382
3383         * elflint.c (compare_hash_gnu_hash): New function.  Report if the
3384         two hash tables have different content (module expected omission
3385         of undefined symbols).
3386
3387 2006-10-31  Roland McGrath  <roland@redhat.com>
3388
3389         * elflint.c (check_program_header): Don't complain about
3390         p_filesz > p_memsz if p_memsz is zero and p_type is PT_NOTE.
3391
3392 2006-09-19  Jakub Jelinek  <jakub@redhat.com>
3393
3394         * strip.c (process_file): Disallow -f on archives.
3395
3396 2006-10-09  Roland McGrath  <roland@redhat.com>
3397
3398         * Makefile.am (libld_elf_i386.so): Use $(LINK), not $(CC).
3399
3400 2006-08-29  Roland McGrath  <roland@redhat.com>
3401
3402         * Makefile.am (MAINTAINERCLEANFILES): New variable.
3403
3404         * readelf.c (handle_relocs_rel): Typo fix, test DESTSHDR properly.
3405         Reported by Christian Aichinger <Greek0@gmx.net>.
3406
3407         * elflint.c (valid_e_machine): Add EM_ALPHA.
3408         Reported by Christian Aichinger <Greek0@gmx.net>.
3409
3410 2006-08-08  Ulrich Drepper  <drepper@redhat.com>
3411
3412         * elflint.c (check_dynamic): Don't require DT_HASH for DT_SYMTAB.
3413         Keep track of which "high DT" entries are present.
3414         Check that either old or GNU-style hash table is present.
3415         If GNU-style hash table is used a symbol table is mandatory.
3416         Check that if any prelink entry is present all of them are.
3417         (check_gnu_hash): Only fail for undefined symbols in GNU-style hash
3418         table if they don't refer to functions.
3419
3420 2006-07-17  Roland McGrath  <roland@redhat.com>
3421
3422         * elflint.c (struct version_namelist): Use GElf_Versym for `ndx' field.
3423         (add_version): Likewise for argument.
3424         (check_versym): Cast constant to GElf_Versym for comparison.
3425
3426 2006-07-12  Roland McGrath  <roland@redhat.com>
3427
3428         * readelf.c (handle_gnu_hash): Add casts for machines where
3429         Elf32_Word != unsigned int.
3430
3431 2006-07-12  Ulrich Drepper  <drepper@redhat.com>
3432
3433         * elflint.c (check_sysv_hash64): Fix printf format.
3434
3435 2006-07-11  Roland McGrath  <roland@redhat.com>
3436
3437         * addr2line.c (options): English fix in -f doc string.
3438
3439         * addr2line.c (use_comp_dir): New variable.
3440         (options, parse_opt): Grok -A/--absolute to set it.
3441         (handle_address): If set, prepend dwfl_line_comp_dir results to
3442         relative file names.
3443
3444 2006-07-06  Ulrich Drepper  <drepper@redhat.com>
3445
3446         * elflint.c: Adjust for latest new hash table format.
3447         * readelf.c: Likewise.
3448
3449         * elflint.c (check_versym): Ignore hidden bit when comparing version
3450         numbers.
3451
3452 2006-07-05  Ulrich Drepper  <drepper@redhat.com>
3453
3454         * ldgeneric.c (ld_generic_create_outfile): Correctly recognize
3455         discarded COMDAT symbols.
3456
3457         * i386_ld.c (elf_i386_count_relocations): Lot of corrections.
3458         (elf_i386_create_relocations): Likewise.
3459         * ld.h (struct symbol): Add local and hidden bits.
3460         * ld.c (create_special_section_symbol): These synthsized symbols
3461         are local and hidden.
3462         * ldgeneric.c (file_process2): Check whether input file matches
3463         the emulation.
3464         (fillin_special_symbol): Create symbols as local and/or hidden
3465         if requested.
3466         (ld_generic_create_outfile): Make local copy of symbol.
3467         Don't hide global, defined symbols in dynamic symbol table unless
3468         requested.  Synthetic symbols have no version information.
3469
3470         * elflint.c: Add support for checking 64-bit SysV-style hash tables.
3471         * readelf.c: Add support for printing 64-bit SysV-style hash tables.
3472
3473 2006-07-04  Ulrich Drepper  <drepper@redhat.com>
3474
3475         * elflint.c (is_rel_dyn): Fix and extend DT_RELCOUNT/DT_RELACOUNT
3476         testing.
3477
3478 2006-07-03  Ulrich Drepper  <drepper@redhat.com>
3479
3480         * elflint.c: Add testing of DT_GNU_HASH.
3481         * readelf.c: Implement showing histogram for DT_GNU_HASH section.
3482
3483         * Makefile.am: Add hacks to create dependency files for non-generic
3484         linker.
3485
3486 2006-06-12  Ulrich Drepper  <drepper@redhat.com>
3487
3488         * ldgeneric.c (ld_generic_generate_sections): Don't create .interp
3489         section if creating a DSO and no interpreter is given.
3490         (ld_generic_create_outfile): Don't store reference to symbols in
3491         discarded COMDAT groups.  Don't create PHDR and INTERP program header
3492         for DSO if no interpreter is specified.
3493         (create_verneed_data): Pretty printing.
3494
3495         * ldscript.y (content): If a DSO is created don't set default
3496         interpreter from linker script.
3497
3498         * i386_ld.c (elf_i386_count_relocations): Do not add relocations
3499         for symbols in discarded COMDAT groups.
3500         (elf_i386_create_relocations): Likewise.
3501         * ld.h (struct scninfo): Add unused_comdat.
3502         * ldgeneric.c (add_section): Also check group signature when
3503         matching COMDAT sections.
3504         (add_relocatable_file): Ignore symbols in COMDAT group which are
3505         discarded.
3506
3507         * elflint.c (check_one_reloc): For *_NONE relocs only check type
3508         and symbol reference.
3509
3510 2006-06-11  Ulrich Drepper  <drepper@redhat.com>
3511
3512         * elflint.c (check_dynamic): Fix checking value of tags which are
3513         offsets in the string section.  Make sure DT_STRTAB points to the
3514         section referenced in sh_link.
3515
3516         * ld.c (options): Add headers.  Add short option 'R' for '--rpath'.
3517
3518         * ld.c: Recognize --eh-frame-hdr option.
3519         * ld.h (struct ld_state): Add eh_frame_hdr field.
3520         * ldgeneric.c (struct unw_eh_frame_hdr): Define.
3521
3522         * ldgeneric.c (add_section): Use ebl_sh_flags_combine instead of
3523         SH_FLAGS_COMBINE.
3524         (add_relocatable_file): Minor optimization of last change.
3525         (match_section): Don't preserve SHF_GROUP flag any longer.
3526
3527 2006-06-10  Ulrich Drepper  <drepper@redhat.com>
3528
3529         * ld.c (parse_z_option): Recognize execstack and noexecstack.
3530         Handle record and ignore as position dependent options.
3531         (parse_z_option_2): Handle ignore and record here.
3532         * ld.h (struct ld_state): Add execstack field.
3533         * ldgeneric.c (add_relocatable_file): Recognize .note.GNU-stack
3534         sections.
3535         (ld_generic_create_outfile): Fix program header creation in native
3536         linker.  Add PT_GNU_STACK program header.
3537
3538 2006-06-09  Ulrich Drepper  <drepper@redhat.com>
3539
3540         * i386_ld.c (elf_i386_finalize_plt): Don't change symbol table entries
3541         for PLT entries if there is no local definition.
3542
3543         * ld.c (parse_option): Handle -z ignore like --as-needed and
3544         -z record like --no-as-needed.
3545         * ld.h (struct ld_state): Remove ignore_unused_dsos field.
3546         * ldgeneric.c (new_generated_scn): Always compute ndt_needed by
3547         looping over DSOs.  When deciding about adding DT_NEEDED entries
3548         use ->as_needed instead of ignore_unused_dsos.
3549
3550 2006-05-31  Ulrich Drepper  <drepper@redhat.com>
3551
3552         * ld.c: Recognize --as-needed and --no-as-needed options.
3553         * ld.h (struct usedfile): Add as_needed field.
3554         (struct ld_state): Likewise.
3555         * ldgeneric.c (ld_handle_filename_list): Copy as_needed flag from
3556         the list.
3557         * ldscript.y (filename_id_list): Split to correctly parse all
3558         combinations.
3559         (mark_as_needed): Fix loop.
3560
3561 2006-05-28  Ulrich Drepper  <drepper@redhat.com>
3562
3563         * addr2line.c (print_dwarf_function): Use unsigned type for lineno
3564         and colno.
3565
3566 2006-05-27  Ulrich Drepper  <drepper@redhat.com>
3567
3568         * readelf.c (handle_relocs_rela): Better notations for addon value.
3569         (print_ehdr): Distinguish e_ident[EI_VERSION] from e_version.
3570
3571 2006-04-04  Ulrich Drepper  <drepper@redhat.com>
3572
3573         * addr2line.c: Update copyright year.
3574         * elfcmp.c: Likewise.
3575         * elflint.c: Likewise.
3576         * findtextrel.c: Likewise.
3577         * ld.c: Likewise.
3578         * nm.c: Likewise.
3579         * objdump.c: Likewise.
3580         * ranlib.c: Likewise.
3581         * readelf.c: Likewise.
3582         * size.c: Likewise.
3583         * strings.c: Likewise.
3584         * strip.c: Likewise.
3585
3586 2006-03-09  Roland McGrath  <roland@redhat.com>
3587
3588         * Makefile.am (AM_LDFLAGS): New variable.
3589
3590 2006-03-01  Roland McGrath  <roland@redhat.com>
3591
3592         * readelf.c (dwarf_tag_string, dwarf_attr_string): Update name tables
3593         for dwarf.h changes matching 3.0 spec.
3594         (dwarf_encoding_string, dwarf_lang_string, print_ops): Likewise.
3595
3596 2005-12-04  Ulrich Drepper  <drepper@redhat.com>
3597
3598         * elflint.c (check_one_reloc): If relocation section is not loaded,
3599         don't check whether the relocations modify read-only sections or
3600         loaded and unloaded sections.
3601
3602 2005-11-28  Ulrich Drepper  <drepper@redhat.com>
3603
3604         * elflint.c (check_one_reloc): Take additional parameters.  Use
3605         them to determine whether relocation is valid in this type of
3606         file.  DSOs and executables can contain relocation sections in
3607         unloaded sections which just show the relocations the linker
3608         applied.  Adjust all callers.
3609         (check_program_header): Check that PT_PHDR is loaded and that offset
3610         matches the one in the ELF header.
3611
3612 2005-10-26  Roland McGrath  <roland@redhat.com>
3613
3614         * nm.c (get_var_range): dwarf_getloclist -> dwarf_getlocation.
3615
3616 2005-09-03  Ulrich Drepper  <drepper@redhat.com>
3617
3618         * strip.c (handle_elf): Unify some error messages.
3619         * ld.c (main): Likewise.
3620         * ldgeneric.c (open_elf): Likewise.
3621         * elfcmp.c (main): Likewise.
3622         * elflint.c (check_elf_header): Likewise.
3623
3624         * size.c (process_file): Fix typo in error message.
3625
3626         * readelf.c: Lots of little cleanups.  Use _unlocked functions.
3627
3628 2005-09-02  Ulrich Drepper  <drepper@redhat.com>
3629
3630         * strings.c (main): Reset elfmap variable after munmap call.
3631         [_MUDFLAP] (map_file): Simplify mudflap debugging by not using mmap.
3632
3633 2005-08-28  Ulrich Drepper  <drepper@redhat.com>
3634
3635         * ranlib.c: Don't define pread_retry and write_retry here.
3636
3637         * Makefile.an [BUILD_STATIC] (libdw): Add -ldl.
3638         (CLEANFILES): Add *.gcno *.gcda *.gconv.
3639
3640         * strings.c (process_chunk): Reorder expressions in conditional
3641         (process_chunk_mb): Likewise.
3642
3643         * strings.c: New file.
3644         * Makefile.am (bin_PROGRAMS): Add strings.
3645         (strings_no_Wstring): Define.
3646         (strings_LDADD): Define.
3647
3648 2005-08-27  Roland McGrath  <roland@redhat.com>
3649
3650         * addr2line.c (dwarf_diename_integrate): Function removed.
3651         (print_dwarf_function): Use plain dwarf_diename.
3652
3653 2005-08-24  Ulrich Drepper  <drepper@redhat.com>
3654
3655         * elflint.c (check_versym): Versioned symbols should not have
3656         local binding.
3657
3658 2005-08-15  Ulrich Drepper  <drepper@redhat.com>
3659
3660         * elflint.c (check_versym): Allow VER_NDX_LOCAL symbols to be
3661         undefined.
3662
3663         * Makefile.am: Add rules to build ranlib.
3664         * ranlib.c: New file.
3665
3666 2005-08-14  Roland McGrath  <roland@redhat.com>
3667
3668         * elflint.c (check_sections): Use ebl_section_type_name and allow any
3669         sh_type it recognizes.
3670
3671         * elflint.c (check_sections): Print unknown flags in hex, don't
3672         truncate high bits.  Print section number and name for unknown type.
3673
3674 2005-08-13  Roland McGrath  <roland@redhat.com>
3675
3676         * elflint.c (check_program_header): Use ebl_segment_type_name and
3677         allow any p_type it recognizes.  Include p_type value in error
3678         message for unknown type.
3679
3680 2005-08-13  Ulrich Drepper  <drepper@redhat.com>
3681
3682         * elflint.c (check_symtab): Simplify last change a bit.  Pass ehdr
3683         to ebl_check_special_symbol.
3684         (check_sections): Pass ehdr to ebl_bss_plt_p.
3685
3686 2005-08-12  Roland McGrath  <roland@redhat.com>
3687
3688         * elflint.c (check_symtab): Check that _GLOBAL_OFFSET_TABLE_ st_shndx
3689         refers to the right section if it's not SHN_ABS.
3690         Let ebl_check_special_symbol override _G_O_T_ value and size checks.
3691
3692         * elflint.c (check_sections): Don't complain about a non-NOBITS
3693         section taking no segment space, if it's sh_size is 0.
3694
3695         * elflint.c (check_sections): Use ebl_bss_plt_p to see if .plt should
3696         be PROGBITS or NOBITS.
3697
3698         * elflint.c (check_symtab): Use ebl_check_special_symbol to override
3699         standard st_value and st_size checks.
3700
3701 2005-07-28  Roland McGrath  <roland@redhat.com>
3702
3703         * addr2line.c (options, parse_opt): Don't handle -e here.
3704         (executable): Variable removed.
3705         (argp_children): New static variable.
3706         (argp): Use it.  Make const.
3707         (main): Fill in argp_children from dwfl_standard_argp ().
3708         Let libdwfl handle file selection, pass Dwfl handle to handle_address.
3709         (print_dwarf_function): New function.  Try to figure out inline chain.
3710         (elf_getname): Function removed, libdwfl does it for us.
3711         (handle_address): Take Dwfl handle instead of Elf, Dwarf handles.
3712         Use dwfl_module_addrname instead of elf_getname.
3713         Use dwfl_module_getsrc and dwfl_lineinfo instead of libdw calls.
3714         * Makefile.am (INCLUDES): Add libdwfl directory to path.
3715
3716 2005-08-10  Ulrich Drepper  <drepper@redhat.com>
3717
3718         * strip.c (parse_opt): STATE parameter is now used.
3719         Various little cleanups.
3720
3721         * readelf.c (print_debug_line_section): Correct fallout of renaming
3722         of DW_LNS_set_epilog_begin.
3723
3724 2005-08-08  Roland McGrath  <roland@redhat.com>
3725
3726         * strip.c (options, parse_opt): Grok -R .comment for compatibility
3727         with binutils strip.  Likewise -d, -S, as aliases for -g.
3728         Likewise ignore -s/--strip-all.
3729
3730 2005-08-07  Roland McGrath  <roland@redhat.com>
3731
3732         * strip.c (process_file): Open read-only when using a different output
3733         file.
3734
3735 2005-08-06  Ulrich Drepper  <drepper@redhat.com>
3736
3737         * elflint.c (in_nobits_scn): New function.
3738         (check_versym): Allow references for defined symbols against versions
3739         of other DSOs also for symbols in nobits sections.
3740         Move a few variables around.
3741
3742         * Makefile.am (AM_CFLAGS): Avoid duplication.
3743         Link with statis libs if BUILD_STATIC.
3744
3745 2005-08-05  Ulrich Drepper  <drepper@redhat.com>
3746
3747         * elflint.c: Many, many more tests.  Mostly related to symbol
3748         versioning.  Those sections should now be completely checked.
3749
3750         * readelf.c (print_dynamic): Use gelf_offscn.
3751
3752 2005-08-04  Ulrich Drepper  <drepper@redhat.com>
3753
3754         * elflint.c: Add lots more tests: more extension symbol table sanity,
3755         versioning section tests, hash table tests.  General cleanup.
3756
3757 2005-08-02  Ulrich Drepper  <drepper@redhat.com>
3758
3759         * objdump.c: New file.
3760         * Makefile.am (bin_PROGRAMS): Add objdump.
3761         (objdump_LDADD): Define.
3762
3763         * elflint.c (check_reloc_shdr): New function split out from check_rela
3764         and check_rel.
3765         (check_one_reloc): New function.  Likewise.
3766         (check_rela): Use check_reloc_shdr and check_one_reloc.
3767         (check_rel): Likewise.
3768         (check_program_header): Check that PT_DYNAMIC entry matches .dynamic
3769         section.
3770         Add checks that relocations against read-only segments are flagged,
3771         that the text relocation flag is not set unnecessarily, and that
3772         relocations in one section are either against loaded or not-loaded
3773         segments.
3774
3775 2005-08-01  Ulrich Drepper  <drepper@redhat.com>
3776
3777         * elfcmp.c (main): Ignore section count and section name string table
3778         section index.
3779
3780 2005-07-27  Roland McGrath  <roland@redhat.com>
3781
3782         * elfcmp.c: Include <locale.h>.
3783
3784 2005-07-27  Ulrich Drepper  <drepper@redhat.com>
3785
3786         * elfcmp.c: Print name and index of differing section.
3787
3788 2005-07-24  Ulrich Drepper  <drepper@redhat.com>
3789
3790         * elfcmp.c: Implement comparing gaps between sections.
3791
3792 2005-07-23  Ulrich Drepper  <drepper@redhat.com>
3793
3794         * elflint.c: Include libeblP.h instead of libebl.h.
3795         * nm.c: Likewise.
3796         * readelf.c: Likewise.
3797         * elfcmp.c: Likewise.
3798
3799         * elfcmp.c (main): Compare individual ELF header fields, excluding
3800         e_shoff instead of the whole struct at once.
3801         Use ebl_section_strip_p instead of SECTION_STRIP_P.
3802         * strip.c: Use ebl_section_strip_p instead of SECTION_STRIP_P.
3803
3804 2005-07-22  Ulrich Drepper  <drepper@redhat.com>
3805
3806         * elfcmp.c (main): Take empty section into account when comparing
3807         section content.
3808
3809         * elflint.c (check_dynamic): Check that d_tag value is >= 0 before
3810         using it.
3811
3812 2005-07-21  Ulrich Drepper  <drepper@redhat.com>
3813
3814         * elfcmp.c: New file.
3815         * Makefile.am (bin_PROGRAMS): Add elfcmp.
3816         (elfcmp_LDADD): Define.
3817
3818         * elflint.c (check_rela): Check that copy relocations only reference
3819         object symbols or symbols with unknown type.
3820         (check_rel): Likewise.
3821
3822 2005-06-08  Roland McGrath  <roland@redhat.com>
3823
3824         * readelf.c (print_ops): Add consts.
3825
3826 2005-05-31  Roland McGrath  <roland@redhat.com>
3827
3828         * readelf.c (print_debug_abbrev_section): Don't bail after first CU's
3829         abbreviations.  Print a header line before each CU section.
3830
3831         * readelf.c (print_debug_loc_section): Fix indentation for larger
3832         address size.
3833
3834 2005-05-30  Roland McGrath  <roland@redhat.com>
3835
3836         * readelf.c (print_debug_line_section): Print section offset of each
3837         CU's table, so they are easy to find from seeing the stmt_list value.
3838
3839         * readelf.c (dwarf_attr_string): Add all attributes in <dwarf.h>.
3840         (attr_callback): Grok DW_AT_ranges and print offset in hex.
3841
3842         * readelf.c (attr_callback): Add 2 to addrsize * 2 for %#0* format.
3843         (print_debug_ranges_section, print_debug_loc_section): Likewise.
3844
3845         * readelf.c (print_ops): Take different args for indentation control.
3846         (attr_callback): Caller updated.
3847         Grok several more block-form attributes as being location expressions.
3848         For those same attributes with udata forms, format output differently
3849         for location list offset.
3850         (print_debug_loc_section): Implement it for real.
3851
3852         * readelf.c (options): Mention ranges for --debug-dump.
3853         (enum section_e): Add section_ranges.
3854         (parse_opt): Grok "ranges" for -w/--debug-dump.
3855         (print_debug_ranges_section): New function.
3856         (print_debug): Handle .debug_ranges section.
3857
3858 2005-05-30  Ulrich Drepper  <drepper@redhat.com>
3859
3860         * readelf.c (handle_notes): At least x86-64 need not have the note
3861         section values aligned to 8 bytes.
3862
3863 2005-05-18  Ulrich Drepper  <drepper@redhat.com>
3864
3865         * readelf.c (dwarf_tag_string): Add new tags.
3866
3867 2005-05-08  Roland McGrath  <roland@redhat.com>
3868
3869         * strip.c (handle_elf): Don't translate hash and versym data formats,
3870         elf_getdata already did it for us.
3871
3872 2005-05-07  Ulrich Drepper  <drepper@redhat.com>
3873
3874         * Makefile.am (findtextrel_LDADD): Add $(libmudflap).
3875         (addr2line_LDADD): Likewise.
3876
3877 2005-05-03  Roland McGrath  <roland@redhat.com>
3878
3879         * strip.c (handle_elf): Apply symbol table fixups to discarded
3880         relocation sections when they are being saved in the debug file.
3881
3882         * strip.c (handle_elf): Pass EHDR->e_ident[EI_DATA] to gelf_xlatetom
3883         and gelf_xlatetof, not the native byte order.
3884
3885         * strip.c (parse_opt): Give error if -f or -o is repeated.
3886         (main): Exit if argp_parse returns nonzero.
3887
3888         * strip.c (debug_fname_embed): New variable.
3889         (options, parse_opt): New option -F to set it.
3890
3891 2005-05-07  Ulrich Drepper  <drepper@redhat.com>
3892
3893         * readelf.c (parse_opt): Make any_control_option variable
3894         local.  Simplify some tests.
3895
3896 2005-05-03  Roland McGrath  <roland@redhat.com>
3897
3898         * strip.c (crc32_file): Function removed (now in ../lib).
3899
3900 2005-05-03  Roland McGrath  <roland@redhat.com>
3901
3902         * elflint.c (is_debuginfo): New variable.
3903         (options, parse_opt): New option --debuginfo/-d to set it.
3904         (check_sections): If is_debuginfo, don't complain about SHT_NOBITS.
3905         (check_note): If is_debuginfo, don't try to get note contents.
3906
3907 2005-04-24  Ulrich Drepper  <drepper@redhat.com>
3908
3909         * readelf.c (print_debug_abbrev_section): Don't print error when end of
3910         section reached.
3911
3912 2005-04-14  Ulrich Drepper  <drepper@redhat.com>
3913
3914         * readelf.c (dwarf_encoding_string): New function.
3915         (dwarf_inline_string): New function.
3916         (dwarf_access_string): New function.
3917         (dwarf_visibility_string): New function.
3918         (dwarf_virtuality_string): New function.
3919         (dwarf_identifier_case_string): New function.
3920         (dwarf_calling_convention_string): New function.
3921         (dwarf_ordering_string): New function.
3922         (dwarf_discr_list_string): New function.
3923         (attr_callback): Decode man more attribute values.
3924
3925 2005-04-01  Ulrich Drepper  <drepper@redhat.com>
3926
3927         * addr2line.c: Finish implementation of -f option.
3928
3929 2005-03-29  Ulrich Drepper  <drepper@redhat.com>
3930
3931         * addr2line.c: New file.
3932         * Makefile.am (bin_PROGRAMS): Add addr2line.
3933         Define addr2line_LDADD.
3934
3935         * findtextrel.c: Use new dwarf_addrdie function.
3936
3937         * findtextrel.c: Fix usage message and re-add accidentally removed
3938         line.
3939
3940 2005-03-28  Ulrich Drepper  <drepper@redhat.com>
3941
3942         * findtextrel.c: New file.
3943         * Makefile: Add rules to build findtextrel.
3944
3945 2005-02-15  Ulrich Drepper  <drepper@redhat.com>
3946
3947         * ldlex.l: Provide ECHO definition to avoid warning.
3948
3949         * elflint.c (check_program_header): Fix typo in RELRO test.
3950
3951         * Makefile.am (AM_CFLAGS): Add more warning options.
3952         * elflint.c: Fix warnings introduced by the new warning options.
3953         * i386_ld.c: Likewise.
3954         * ld.c: Likewise.
3955         * ld.h: Likewise.
3956         * ldgeneric.c: Likewise.
3957         * nm.c: Likewise.
3958         * readelf.c: Likewise.
3959         * sectionhash.c: Likewise.
3960         * size.c: Likewise.
3961         * string.c: Likewise.
3962
3963 2005-02-05  Ulrich Drepper  <drepper@redhat.com>
3964
3965         * Makefile.am: Check for text relocations in constructed DSOs.
3966
3967         * Makefile.am [MUDFLAP] (AM_CFLAGS): Add -fmudflap.  Link all apps
3968         with -lmudflap.
3969
3970         * ldscript.y: Add as_needed handling.
3971         * ldlex.l: Recognize AS_NEEDED token.
3972         * ld.h (struct filename_list): Add as_needed flag.
3973
3974 2005-02-04  Ulrich Drepper  <drepper@redhat.com>
3975
3976         * elflint.c (check_symtab): Correctly determine size of GOT section.
3977
3978 2005-01-19  Ulrich Drepper  <drepper@redhat.com>
3979
3980         * ld.c: Remove unnecessary more_help function.  Print bug report
3981         address using argp.
3982         * strip.c: Likewise.
3983         * size.c: Likewise.
3984         * nm.c: Likewise.
3985         * readelf.c: Likewise.
3986         * elflint.c: Likewise.
3987
3988         * elflint.c (main): Don't check for parameter problems here.
3989         (parse_opt): Do it here, where we get informed about some of them
3990         anyway.
3991
3992         * readelf.c (main): Don't check for parameter problems here.
3993         (parse_opt): Do it here, where we get informed about some of them
3994         anyway.
3995
3996 2005-01-11  Ulrich Drepper  <drepper@redhat.com>
3997
3998         * strip.c: Update copyright year.
3999         * readelf.c: Likewise.
4000         * size.c: Likewise.
4001         * nm.c: Likewise.
4002         * ld.c: Likewise.
4003         * elflint.c: Likewise.
4004
4005         * elflint.c (check_symtab): Don't warn about wrong size for
4006         _DYNAMIC and __GLOBAL_OFFSET_TABLE__ for --gnu-ld.
4007
4008 2004-10-05  Ulrich Drepper  <drepper@redhat.com>
4009
4010         * readelf.c (print_phdr): In section mapping, also indicate
4011         sections in read-only segments.
4012
4013 2004-09-25  Ulrich Drepper  <drepper@redhat.com>
4014
4015         * readelf.c: Make compile with gcc 4.0.
4016         * strip.c: Likewise.
4017
4018 2004-08-16  Ulrich Drepper  <drepper@redhat.com>
4019
4020         * strip.c (handle_elf): Rewrite dynamic memory handling to use of
4021         allocate to work around gcc 3.4 bug.
4022
4023 2004-01-25  Ulrich Drepper  <drepper@redhat.com>
4024
4025         * ldlex.l (invalid_char): Better error message.
4026
4027 2004-01-23  Ulrich Drepper  <drepper@redhat.com>
4028
4029         * readelf.c: Print SHT_GNU_LIBLIST sections.
4030
4031         * none_ld.c: New file.
4032
4033 2004-01-21  Ulrich Drepper  <drepper@redhat.com>
4034
4035         * Makefile.am: Enable building of machine specific linker.
4036
4037 2004-01-20  Ulrich Drepper  <drepper@redhat.com>
4038
4039         * Makefile.am: Support building with mudflap.
4040
4041         * i386_ld.c: Fix warnings gcc 3.4 spits out.
4042         * ldgeneric.c: Likewise.
4043         * ldscript.y: Likewise.
4044         * readelf.c: Likewise.
4045         * strip.c: Likewise.
4046
4047         * readelf.c (print_debug_line_section): Determine address size
4048         correctly.
4049
4050 2004-01-19  Ulrich Drepper  <drepper@redhat.com>
4051
4052         * readelf.c (print_phdr): Show which sections are covered by the
4053         PT_GNU_RELRO entry.
4054
4055         * elflint.c (check_program_header): Check PT_GNU_RELRO entry.
4056
4057         * readelf.c (print_debug_macinfo_section): Implement.
4058
4059 2004-01-18  Ulrich Drepper  <drepper@redhat.com>
4060
4061         * readelf.c (print_debug_line_section): Implement.
4062
4063 2004-01-17  Ulrich Drepper  <drepper@redhat.com>
4064
4065         * src/elflint.c: Use PACKAGE_NAME instead of PACKAGE.
4066         * src/ld.c: Likewise.
4067         * src/nm.c: Likewise.
4068         * src/readelf.c: Likewise.
4069         * src/size.c: Likewise.
4070         * src/strip.c: Likewise.
4071
4072         * strip.c: Add a few more unlikely.  Reduce scope of some variables.
4073
4074         * Makefile.am: Support building with mudflap.
4075
4076 2004-01-16  Ulrich Drepper  <drepper@redhat.com>
4077
4078         * readelf.c (print_debug_info_section): Free dies memory.
4079
4080         * readelf.c: Print .debug_info section content.
4081
4082 2004-01-13  Ulrich Drepper  <drepper@redhat.com>
4083
4084         * readelf.c (print_shdr): Add support for SHF_ORDERED and SHF_EXCLUDE.
4085
4086 2004-01-12  Ulrich Drepper  <drepper@redhat.com>
4087
4088         * readelf.c (print_debug_aranges): Implement using libdw.
4089
4090 2004-01-11  Ulrich Drepper  <drepper@redhat.com>
4091
4092         * nm.c: Adjust for Dwarf_Files type and dwarf_lineno interface change.
4093
4094         * readelf.c: Use libdw instead of libdwarf.  Not all of the old
4095         behavior is available yet.
4096         * Makefile.am: Link readelf with libdw.  Remove libdwarf include path.
4097
4098 2004-01-09  Ulrich Drepper  <drepper@redhat.com>
4099
4100         * nm.c (get_local_names): Adjust call to dwarf_nextcu.
4101
4102         * nm.c: Implement getting information about local variables.
4103
4104 2004-01-07  Ulrich Drepper  <drepper@redhat.com>
4105
4106         * nm.c: Read also debug information for local symbols.
4107
4108 2004-01-05  Ulrich Drepper  <drepper@redhat.com>
4109
4110         * nm.c: Shuffle dwarf handling code around so the maximum column
4111         width can be computed ahead of printing.  Avoid collection symbols
4112         which are not printed anyway.
4113
4114         * nm.c: Rewrite dwarf handling to use libdw.
4115         * Makefile.am (AM_CFLAGS): Add -std parameter.
4116         (INCLUDES): Find header in libdw subdir.
4117         (nm_LDADD): Replace libdwarf with libdw.
4118
4119         * elflint.c: Update copyright year.
4120         * readelf.c: Likewise.
4121         * size.c: Likewise.
4122         * strip.c: Likewise.
4123         * nm.c: Likewise.
4124
4125 2003-12-31  Ulrich Drepper  <drepper@redhat.com>
4126
4127         * strip.c (process_file): Close file before returning.
4128
4129 2003-11-19  Ulrich Drepper  <drepper@redhat.com>
4130
4131         * readelf.c (handle_dynamic): Make column for tag name wider.
4132
4133 2003-09-29  Ulrich Drepper  <drepper@redhat.com>
4134
4135         * readelf.c (handle_dynamic): Always terminate tag name with a space.
4136
4137 2003-09-25  Ulrich Drepper  <drepper@redhat.com>
4138
4139         * strip.c (process_file): Don't mmap the input file, we modify the
4140         data structures and don't want the change end up on disk.
4141
4142 2003-09-23  Jakub Jelinek  <jakub@redhat.com>
4143
4144         * unaligned.h (union u_2ubyte_unaligned,
4145         union u_4ubyte_unaligned, union u_8ubyte_unaligned): Add
4146         packed attribute.
4147         (add_2ubyte_unaligned, add_4ubyte_unaligned,
4148         add_8ubyte_unaligned): Avoid nesting bswap_NN macros.
4149         Read/store value through _ptr->u instead of *_ptr.
4150
4151 2003-09-22  Ulrich Drepper  <drepper@redhat.com>
4152
4153         * size.c (show_sysv): Change type of maxlen to int.
4154
4155         * strip.c (handle_elf): Handle the 64-bit archs which is 64-bit
4156         buckets.
4157
4158         * i386_ld.c: Many many fixes and extensions.
4159         * ld.c: Likewise.
4160         * ldgeneric.c: Likewise.
4161
4162 2003-08-16  Ulrich Drepper  <drepper@redhat.com>
4163
4164         * ldgeneric.c (check_definition): Don't add symbol on dso_list if
4165         the reference is from another DSO.
4166
4167 2003-08-15  Ulrich Drepper  <drepper@redhat.com>
4168
4169         * ldgeneric.c (find_entry_point): It is no fatal error if no entry
4170         point is found when creating a DSO.
4171
4172 2003-08-14  Ulrich Drepper  <drepper@redhat.com>
4173
4174         * ld.c (main): Always call FLAG_UNRESOLVED.
4175         * ldgeneric.c (ld_generic_flag_unresolved): Only complain about
4176         undefined symbols if not creating DSO or ld_state.nodefs is not set.
4177
4178 2003-08-13  Ulrich Drepper  <drepper@redhat.com>
4179
4180         * Makefile.in: Depend on libebl.a, not libebl.so.
4181
4182         * ld.c (main): Mark stream for linker script as locked by caller.
4183         (read_version_script): Likewise.
4184         * ldlex.c: Define fread and fwrite to _unlocked variant.
4185
4186         * i386_ld.c (elf_i386_finalize_plt): Replace #ifdefs with uses of
4187         target_bswap_32.
4188         * unaligned.h: Define target_bswap_16, target_bswap_32, and
4189         target_bswap_64.
4190         (store_2ubyte_unaligned, store_4ubyte_unaligned,
4191         store_8ubyte_unaligned): Define using new macros.
4192
4193 2003-08-12  Ulrich Drepper  <drepper@redhat.com>
4194
4195         * i386_ld.c (elf_i386_finalize_plt): Use packed structs to access
4196         possibly unaligned memory.  Support use of big endian machines.
4197
4198 2003-08-11  Ulrich Drepper  <drepper@redhat.com>
4199
4200         * Moved to CVS archive.