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