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