• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
12022-10-28  Arsen Arsenović  <arsen@aarsen.me>
2
3	* readelf.c (options): Add Binutils-style --syms alias.
4
52022-10-19  Mark Wielaard  <mark@klomp.org>
6
7	* readelf.c (dwarf_loc_list_encoding_string): Handle
8	DW_LLE_GNU_view_pair.
9	(print_debug_loclists_section): Likewise.
10
112022-09-20  Yonggang Luo  <luoyonggang@gmail.com>
12
13	* arlib.h: Use BYTE_ORDER, LITTLE_ENDIAN and BIG_ENDIAN.
14
152022-08-28  Mark Wielaard  <mark@klomp.org>
16
17	* ar.c (do_oper_extract): Predecrement instance before compare
18	to zero.
19	(do_oper_delete): Likewise.
20
212022-08-10  Andreas Schwab  <schwab@suse.de>
22
23	* readelf.c (print_attributes): Also handle SHT_RISCV_ATTRIBUTES.
24
252022-08-09  Andreas Schwab  <schwab@suse.de>
26
27	* elflint.c (check_program_header): Don't complain about p_filesz
28	> p_memsz if p_memsz is zero and p_type is PT_RISCV_ATTRIBUTES.
29
302022-08-01  Mark Wielaard  <mark@klomp.org>
31
32	* readelf.c (handle_dynamic): Pass start of buffer to memrchr.
33	Use dyn->d_un.d_val for offsets instead of d_ptr.
34
352022-04-28  Di Chen  <dichen@redhat.com>
36
37	* readelf.c (options): Add use-dynamic 'D'.
38	(use_dynamic_segment): New static bool.
39	(enum dyn_idx): New.
40	(get_dynscn_strtab): New function.
41	(get_dynscn_addrs): Likewise.
42	(find_offsets): Likewise.
43	(parse_opt): Handle 'D'.
44	(handle_dynamic): New argument phdr. Get data either through the shdr
45	or phdr.  Print segment info when use_dynamic_segment. Use
46	get_dynscn_strtab. Get library name and paths through strtab_data.
47
482022-05-09  Mark Wielaard  <mark@klomp.org>
49
50	* strip.c (remove_debug_relocations): Check gelf_getshdr, gelf_getrela,
51	gelf_getrel and gelf_getsymshndx don't return NULL.
52
532022-05-10  Mark Wielaard  <mark@klomp.org>
54
55	* elfcompress.c (process_file): Sanity check shstrtab_name,
56	shstrtab_newname and symstrents are only set once.
57
582022-04-24  Mark Wielaard  <mark@klomp.org>
59
60	* elfclassify.c (main): Use classify_flag_no_stdin for no-std in options.
61
622022-04-19  Mark Wielaard  <mark@klomp.org>
63
64	* readelf.c (get_dyn_ents): Define dyn_mem outside the while loop.
65
662022-03-01  Di Chen  <dichen@redhat.com>
67
68	* readelf.c (get_dyn_ents): New function.
69	(handle_dynamic): Use get_dyn_ents to get the actual number of
70	Dynamic entries in the section.
71
722022-03-27  Mark Wielaard  <mark@klomp.org>
73
74	* addr2line.c: Replace error (EXIT_FAILURE, ...) with error_exit(...).
75	* ar.c: Likewise.
76	* arlib.c: Likewise.
77	* elfcompress.c: Likewise.
78	* nm.c: Likewise.
79	* objdump.c: Likewise.
80	* readelf.c: Likewise.
81	* size.c: Likewise.
82	* strings.c: Likewise.
83	* strip.c: Likewise.
84	* unstrip.c: Likewise.
85
862022-03-24  Mark Wielaard  <mark@klomp.org>
87
88	* elflint.c (check_note_data): Recognize NT_FDO_PACKAGING_METADATA.
89
902022-03-11  Mark Wielaard  <mark@klomp.org>
91
92	* addr2line.c (OPT_RELATIVE): New constant.
93	(options): Add --relative.
94	(use_comp_dir): Initialize to true.
95	(parse_opt): Handle OPT_RELATIVE.
96
972021-12-04  Mark Wielaard  <mark@klomp.org>
98
99	* readelf.c (print_ehdr): Pass sizeof (buf) - 1 to strncpy.
100
1012021-10-20  John M Mellor-Crummey  <johnmc@rice.edu>
102
103	* readelf.c (print_debug_line_section): Try to read
104	debug_str_offset if available.  Handle DW_LNE_NVIDIA_inlined_call
105	and DW_LNE_NVIDIA_set_function_name.
106
1072021-10-06  Mark Wielaard  <mark@klomp.org>
108
109	* elflint.c (check_sections): Don't dereference databits if bad.
110
1112021-09-09  Dmitry V. Levin  <ldv@altlinux.org>
112
113	* findtextrel.c: Include "libeu.h".
114	(open_rootdir_file): New function.
115	(process_file): Use it to open file inside rootdir.
116	* Makefile.am (findtextrel_no_Wstack_usage): Remove.
117
1182021-09-06  Dmitry V. Levin  <ldv@altlinux.org>
119
120	* objdump.c (show_disasm): Replace asprintf followed by
121	error(EXIT_FAILURE) with xasprintf.
122	* readelf.c (handle_gnu_hash): Likewise.
123	* unstrip.c (handle_output_dir_module, main): Likewise.
124
125	* elflint.c (check_sections): Remove cast of xcalloc return value.
126	* findtextrel.c (process_file): Remove casts of malloc and realloc
127	return values.
128	* nm.c (get_local_names, show_symbols_sysv, show_symbols): Remove
129	casts of xmalloc return values.
130	* readelf.c (print_hash_info, handle_sysv_hash, handle_sysv_hash64,
131	handle_gnu_hash): Remove cast of xcalloc return value.
132	(print_debug_units): Remove casts of xmalloc return values.
133	* strip.c (handle_elf): Remove casts of xcalloc and xmalloc return
134	values.
135
1362021-09-05  Dmitry V. Levin  <ldv@altlinux.org>
137
138	* Makefile.am (AM_LDFLAGS): Add $(STACK_USAGE_NO_ERROR).
139
1402021-08-20  Saleem Abdulrasool  <abdulras@google.com>
141
142	* elfclassify.c: Remove error.h include.
143
1442021-03-18  Timm Bäder  <tbaeder@redhat.com>
145
146	* readelf.c (run_advance_pc): New static inline function
147	lifted from...
148	(print_debug_line_section): ... here. Define advance_pc
149	using run_advance_pc.
150
1512021-07-03  Mark Wielaard  <mark@klomp.org>
152
153	* readelf.c (compare_listptr): Fix dwarf_attr_name argument.
154
1552021-06-18  Mark Wielaard  <mark@klomp.org>
156
157	* unstrip.c (adjust_relocs): Check gelf_getrel and geld_getrela.
158
1592021-06-18  Mark Wielaard  <mark@klomp.org>
160
161	* strip.c (remove_debug_relocations): Check gelf_update results.
162	(update_section_size): Likewise.
163
1642021-06-06  Sergei Trofimovich  <slyfox@gentoo.org>
165
166	* elflint.c (buffer_left): Mark as 'static' to avoid external linkage
167	failure.
168
1692021-05-12  Dmitry V. Levin  <ldv@altlinux.org>
170
171	* elfcompress.c (process_file): Return 1 instead of -1 in case of an
172	error.
173
174	* elfcompress.c (process_file): Remove redundant assignment in case of
175	"Nothing to do".
176
177	* elfcompress.c (process_file): Set res to 0 in case of "Nothing to do".
178
1792021-04-19  Martin Liska  <mliska@suse.cz>
180
181	* elfclassify.c (run_classify): Use startswith.
182	* elfcompress.c (process_file): Likewise.
183	* nm.c (show_symbols_sysv): Likewise.
184	* readelf.c (print_debug): Likewise.
185	(handle_notes_data): Likewise.
186	(dump_data_section): Likewise.
187	(print_string_section): Likewise.
188	* strip.c (remove_debug_relocations): Likewise.
189
1902021-04-03  Mark Wielaard  <mark@klomp.org>
191
192	* nm.c (show_symbols): close dwfl_fd if dwfl_begin fails.
193
1942021-04-03  Mark Wielaard  <mark@klomp.org>
195
196	* unstrip.c (handle_output_dir_module): Free output_file when done.
197
1982021-04-03  Mark Wielaard  <mark@klomp.org>
199
200	* ar.c (do_oper_insert): Always close newfd.
201
2022021-03-03  Mark Wielaard  <mark@klomp.org>
203
204	* readelf.c (handle_symtab): Sanity check verneed vna_next,
205	vn_next and verdef vd_next offsets.
206
2072021-03-02  Timm Bäder  <tbaeder@redhat.com>
208
209	* elfcompress.c (process_file): Remove cleanup() function and
210	replace it with a cleanup label at the end of the function.
211	Initialize res to -1.
212
2132021-02-17  Timm Bäder  <tbaeder@redhat.com>
214
215	* elfcompress.c (process_file): Move get_sections function...
216	(get_section): ...to top-level static function taking an
217	sections array and shnum.
218
2192021-02-17  Timm Bäder  <tbaeder@redhat.com>
220
221	* elfcompress.c (process_file): Move get_section function...
222	(get_section): ...to top-level static function taking an
223	sections array.
224
2252021-02-17  Timm Bäder  <tbaeder@redhat.com>
226
227	* elfcompress.c (process_file): Move set_section function...
228	(set_section): ...to top-level static function taking a
229	section array.
230
2312021-02-17  Timm Bäder  <tbaeder@redhat.com>
232
233	* unstrip.c (handle_implicit_modules): Inline the next function
234	in three places. This is simply dwfl_getmodules with match_module
235	callback providing mmi.
236
2372021-02-17  Timm Bäder  <tbaeder@redhat.com>
238
239	* unstrip.c (handle_explicit_files): Move warn function...
240	(warn): ...here as top-level static function taking stripped,
241	unstripped files and force flag as extra arguments.
242
2432021-02-17  Timm Bäder  <tbaeder@redhat.com>
244
245	* unstrip.c (copy_elided_sections): Inline find_unalloc_section
246	function into calling location. The sec pointer is set to NULL
247	before the if-else statement and only set when match is found.
248
2492021-02-17  Timm Bäder  <tbaeder@redhat.com>
250
251	* unstrip.c (find_alloc_sections_prelink): Move check_match to...
252	(check_match): Adjusted to return whether there was no match,
253	which indicates a failure. So callers are adjusted to or the
254	result into a local fail boolean.
255
2562021-02-17  Timm Bäder  <tbaeder@redhat.com>
257
258	* unstrip.c (adjust_relocs): Move adjust_reloc function to...
259	(adjust_reloc): ... here as static top-level function taking
260	a map array and size as extra arguments.
261
2622021-02-17  Timm Bäder  <tbaeder@redhat.com>
263
264	* elflint.c (check_attributes): Rename and move left function...
265	(buffer_left): ...as static toplevel function taking both an
266	Elf_Data pointer argument and the unsigned char pointer p.
267
2682021-02-17  Timm Bäder  <tbaeder@redhat.com>
269
270	* elflint.c (check_attributes): Rename and move pos function...
271	(buffer_pos): ...as static toplevel function taking an extra
272	Elf_Data pointer argument.
273
2742021-02-12  Mark Wielaard  <mark@klomp.org>
275
276	* readelf.c (print_debug_units): Type DIE offset is from start CU.
277
2782021-02-12  Mark Wielaard  <mark@klomp.org>
279
280	* readelf.c (attr_callback): Don't handle blocks as expression
281	blocks for DWARF version 4 or higher.
282
2832021-02-03 Timm Bäder <tbaeder@redhat.com>
284
285	* ar.c (do_oper_extract): Extract should_truncate_fname function
286	to...
287	(should_truncate_fname): ...here. New file scope function taking
288	size_t pointer to be read and/or set.
289
2902021-02-02 Timm Bäder <tbaeder@redhat.com>
291
292	* readelf.c (print_debug_line_section): Remove unnecessary
293	show_op_index variable, replace with (op_index > 0).
294
2952021-01-08  Timm Bäder  <tbaeder@redhat.com>
296
297	* readelf.c (print_cfa_program): Lift regname function to...
298	(regname): ...here. New file scope function add ebl and regnamebuf
299	as arguments.
300
3012021-01-08  Timm Bäder  <tbaeder@redhat.com>
302
303	* readelf.c (print_attributes): Lift left function to...
304	(left): ...here. New file scope function taking Elf_Data and char
305	pointers.
306
3072021-01-08  Timm Bäder  <tbaeder@redhat.com>
308
309	* readelf.c (handle_core_registers): Lift same_set function to...
310	(same_set): ...here. New file scope function adding regs and
311	maxnreg arguments.
312
3132021-01-08  Timm Bäder  <tbaeder@redhat.com>
314
315	* readelf.c (parse_opt): Lift add_dump_section function to...
316	(add_dump_section): ...here. New top level function. Added key
317	argument.
318
3192021-01-08  Timm Bäder  <tbaeder@redhat.com>
320
321	* arlib-argp.c (help_filter): Lift text_for_default function to...
322	(text_for_default): ... here. New file scope function taking text
323	as argument.
324
3252021-01-08  Timm Bäder  <tbaeder@redhat.com>
326
327	* addr2line.c (handle_address): Move show_note and show_int up to
328	file scope.
329	(show_note: New static inline function.
330	(show_int): Likewise.
331
3322021-01-08  Timm Bäder  <tbaeder@redhat.com>
333
334	* strip.c (handle_elf): Remove no_symtab_updates function and
335	calls inside the switch statement. Add checks and (possibly)
336	continue, before switch statement is called.
337
3382021-01-08  Timm Bäder  <tbaeder@redhat.com>
339
340	* strip.c (handle_elf): Move inlined update_section_size function
341	to...
342	(update_section_size): ...here. New static function that takes as
343	extra arguments the Elf_Scn, debug_elf, section cnt and fname.
344
3452021-01-08  Timm Bäder  <tbaeder@redhat.com>
346
347	* strip.c (remove_debug_relocations): Rewrite inlined relocate
348	function to file static. Do R_*_NONE, reloc_simple_type and
349	ebl_debug_scn_p checks before calling new relocate function.
350	(relocate): New file static function from
351	remove_debug_relocate. Remove R_*_NONE, reloc_simple_type and
352	ebl_debugscn_p checks.
353
3542021-01-08  Timm Bäder  <tbaeder@redhat.com>
355
356	* strip.c (handle_elf): Expand inlined function check_preserved.
357
3582021-01-12  Mark Wielaard  <mark@klomp.org>
359
360	* elflint.c (EXTRA_SHFLAGS): New define.
361	(check_sections): Use EXTRA_SHFLAGS. Add SHF_GNU_RETAIN to
362	ALL_SH_FLAGS.
363
3642020-12-31  Sergei Trofimovich  <slyfox@gentoo.org>
365
366	* elflint.c (section_flags_string): Add NEWFLAG for GNU_RETAIN,
367	ORDERED and EXCLUDE.
368
3692020-12-31  Sergei Trofimovich  <slyfox@gentoo.org>
370
371	* elflint.c (section_flags_string): Update cp pointer after
372	snprintf for unknown flags.
373
3742020-12-16  Érico Nogueira  <ericonr@disroot.org>
375
376	* readelf.c (qsort_r): Use qsort for improved portability.
377
3782020-12-20  Dmitry V. Levin  <ldv@altlinux.org>
379
380	* .gitignore: New file.
381
3822020-12-12  Mark Wielaard  <mark@klomp.org>
383
384	* elflint.c (check_sections): Handle SHF_GNU_RETAIN.
385	* readelf.c (print_shdr): Likewise.
386
3872020-12-16  Dmitry V. Levin  <ldv@altlinux.org>
388
389	* *.c: Replace gettext(...) with _(...).
390
391	* unstrip.c (_): Remove.
392
3932020-12-15  Mark Wielaard  <mark@klomp.org>
394
395	* elflint.c (check_symtab): Always print symbol name (if known)
396	in error messages.
397
3982020-12-12  Dmitry V. Levin  <ldv@altlinux.org>
399
400	* ar.c (write_member, do_oper_insert): Fix spelling typo in comment.
401	* elfclassify.c (issue, elf_issue, is_unstripped): Likewise.
402	* elfcompress.c (process_file): Likewise.
403	* elflint.c (be_quiet, check_gnu_hash): Likewise.
404	* readelf.c (print_phdr, handle_gnu_hash,
405	dwarf_locexpr_opcode_string): Likewise.
406	* size.c (totals_class): Likewise.
407	* strings.c (read_elf): Likewise.
408	* strip.c (handle_elf): Likewise.
409
410	* readelf.c (print_debug_addr_section): Fix spelling typo in error
411	diagnostics.
412	* strip.c (options): Fix spelling typos in argp help text.
413	* strings.c (options): Likewise.
414	* stack.c (options): Likewise.
415
4162020-11-01  Érico N. Rolim  <erico.erc@gmail.com>
417
418	* unstrip.c (make_directories): Use ACCESSPERMS for mkdir.
419	(handle_file): Use DEFFILEMODE for open with O_CREAT for ET_REL
420	files, ACCESSPERMS otherwise.
421
4222020-11-01  Érico N. Rolim  <erico.erc@gmail.com>
423
424	* Makefile.am (nm_LDADD): Add obstack_LIBS.
425	(ranlib_LDADD): Likewise.
426	(ar_LDADD): Likewise.
427
4282020-10-27  Érico N. Rolim  <erico.erc@gmail.com>
429
430	* unstrip.c (make_directories): Use strndup, not strndupa.
431
4322020-09-28  Mark Wielaard  <mark@klomp.org>
433
434	* readelf.c (next_listptr_offset): Take idx as pointer, to be updated
435	and use new Dwarf_Off as offset to match.
436	(listptr_attr): New function.
437	(print_debug_loclists_section): Check for DW_AT_GNU_locviews to show
438	view pairs.
439	(print_debug_loc_section): Adjust next_listptr_offset call.
440
4412020-09-03  Mark Wielaard  <mark@klomp.org>
442
443	* readelf.c (print_cfa_program): Take ehdr as argument. Use it to
444	recognize DW_CFA_AARCH64_negate_ra_state.
445	(print_debug_frame_section): Pass ehdr to print_cfa_program.
446	(print_debug): Don't warn if we dump frames, but cannot get dbg.
447
4482020-09-01  Mark Wielaard  <mark@klomp.org>
449
450	* readelf.c (print_debug_ranges_section): Base address entry can
451	be first.
452	(print_debug_loc_section): Likewise.
453
4542020-09-04  Mark Wielaard  <mark@klomp.org>
455
456	* elflint.c (special_sections): Add .debug_line_str.
457
4582020-08-26  Mark Wielaard  <mark@klomp.org>
459
460	* readelf.c (print_debug_line_section): It is not an error if there
461	are no line number statements at the end of a debug line section.
462
4632020-07-19  Mark Wielaard  <mark@klomp.org>
464
465	* elfclassify.c (process_current_path): Handle fwrite failing.
466
4672020-07-05  Mark Wielaard  <mark@klomp.org>
468
469	* stack.c (module_callback): Don't assert if dwfl_module_info fails.
470	* unstrip.c (adjust_relocs): Produce a proper error when HAS
471	section has inconsistent size or entsize.
472	(match_module): Don't assert if dwfl_module_info fails.
473
4742020-06-16  Mark Wielaard  <mark@klomp.org>
475
476	* ar.c (do_oper_extract): Split large if statement. Call fchown
477	before fchmod and explicitly ignore the return value.
478	(do_oper_delete): Likewise.
479	(do_oper_insert): Likewise.
480	* ranlib.c (handle_file): Likewise.
481
4822020-06-16  Mark Wielaard  <mark@klomp.org>
483
484	* elflint.c (check_elf_header): Explicitly check and ignore
485	any error from elf_compress.
486
4872020-06-07  Mark Wielaard  <mark@klomp.org>
488
489	* nm.c (sort_by_name_strtab): Replace by...
490	(sort_by_name_elf): New static Elf pointer and ...
491	(sort_by_name_ndx): New static size_t index.
492	(sort_by_name): Use elf_strptr to get symbol string.
493	(show_symbols): Set sort_by_name_elf and sort_by_name_ndx.
494
4952020-06-06  Mark Wielaard  <mark@klomp.org>
496
497	* nm.c (show_symbols_sysv): Skip no name and STT_FILE symbols.
498	When not printing address and size pad strings. Strip "GNU_"
499	prefix from binding name.
500	(class_type_char): Use 'V' for weak symbols, 'C' for common
501	symbols and 'T' for weak functions.
502	(show_symbols_posix): Skip STT_FILE symbols. Don't print value and
503	size when undefined.
504
5052020-06-04  Mark Wielaard  <mark@klomp.org>
506
507	* elflint.c (check_program_header): Remove PT_GNU_PROPERTY define.
508
5092020-05-14  Mark Wielaard  <mark@klomp.org>
510
511	* size.c (show_bsd): Set printf format based on radix.
512
5132020-05-09  Mark Wielaard  <mark@klomp.org>
514
515	* elflint.c (process_elf_file): Error out if ebl_openbackend fails.
516	* objdump.c (handle_elf): Likewise.
517	* nm.c (handle_elf): Likewise. Move full name string construction
518	forward, so it can be used in the error message.
519
5202020-04-17  Mark Wielaard  <mark@klomp.org>
521
522	* readelf.c (print_debug): Check .gnu.debuglto_ prefix.
523
5242020-04-16  Mark Wielaard  <mark@klomp.org>
525
526	* elflint.c (check_sections): Mask out SHF_EXCLUDE from processor
527	specific section flags when --gnu is given.
528
5292020-02-08  Mark Wielaard  <mark@klomp.org>
530
531	* elflint.c (check_program_header): Handle PT_GNU_PROPERTY.
532
5332020-02-07  Mark Wielaard  <mark@klomp.org>
534
535	* elflint.c (check_symtab): Check st_info isn't too big.
536
5372020-01-16  Mark Wielaard  <mark@klomp.org>
538
539	* nm.c (show_symbols_sysv): Iterate over all symbols starting
540	at index zero.
541
5422019-11-26  Mark Wielaard  <mark@klomp.org>
543
544	* Makefile.am (BUILD_STATIC): Add libraries needed for libdw.
545
5462019-10-26  Mark Wielaard  <mark@klomp.org>
547
548	* unstrip.c (collect_symbols): Check symbol strings are
549	terminated.
550
5512019-10-18  Mark Wielaard  <mark@klomp.org>
552
553	* unstrip.c (adjust_relocs): Set versym data d_size to the actual
554	size allocated.
555
5562019-10-20  Mark Wielaard  <mark@klomp.org>
557
558	* unstrip.c (copy_elided_sections): Set and check max_off.
559
5602019-10-21  Mark Wielaard  <mark@klomp.org>
561
562	* unstrip.c (adjust_relocs): Add map_size argument and check ndx
563	against it.
564	(adjust_all_relocs): Add map_size argument and pass it to
565	adjust_relocs.
566	(add_new_section_symbols): Call adjust_all_relocs with symndx_map
567	size.
568	(collect)symbols): Check sym and string data can be found.
569	(compare_symbols_output): Call error when (different) symbols are
570	equal.
571	(new_shstrtab): Make unstripped_strent array one larger. Check
572	stripped_shnum isn't zero.
573	(copy_elided_sections): Add ndx_sec_num as size of ndx_section
574	array. Check sh_link and sh_info are not larger than ndx_sec_num.
575	Allocate symbols and symndx_map arrays on heap, not stack. Pass
576	map sizes to adjust_all_relocs.
577
5782019-09-28  Dmitry V. Levin  <ldv@altlinux.org>
579
580	* elflint.c (main): When an input file cannot be opened,
581	include its name into the error diagnostics.
582	* readelf.c (main): Likewise.
583
5842019-09-02  Mark Wielaard  <mark@klomp.org>
585
586	* readelf.c (PRINT_DYNSYM_TABLE): New argp key value.
587	(argp_opt): Add syn-sym.
588	(print_dynsym_table): New static bool.
589	(parse_opt): Handle PRINT_DYNSYM_TABLE.
590	(process_elf_file): Check print_dynsym_table.
591
5922019-08-27  Mark Wielaard  <mark@klomp.org>
593
594	* readelf.c (for_each_section_argument): Call (*dump) also for
595	section numbers.
596
5972019-08-26  Mark Wielaard  <mark@klomp.org>
598
599	* nm.c (show_symbols): Remember nentries_orig and check before
600	freeing sym_mem.
601
6022019-07-05  Omar Sandoval  <osandov@fb.com>
603
604	* Makefile.am: Remove -ldl.
605	(elflint_LDADD): Add $(libdw).
606	(elfcmp_LDADD): Add $(libdw).
607	(objdump_LDADD): Add $(libdw).
608
6092019-08-26  Mark Wielaard  <mark@klomp.org>
610
611	* readelf (options): Add OPTION_ARG_OPTIONAL "SECTION" for notes.
612	(notes_section): New global variable.
613	(parse_opt): Set notes_section.
614	(handle_notes): Check if notes_section is set.
615
6162019-07-26  Florian Weimer  <fweimer@redhat.com>
617	    Mark Wielaard  <mark@klomp.org>
618
619	* Makefile.am (bin_PROGRAMS): Add elfclassify.
620	(elfclassify_LDADD): New variable.
621	* elfclassify.c: New tool.
622
6232019-07-13  Mao Han  <han_mao@c-sky.com>
624
625	* elflint.c: Add C-SKY.
626
6272019-06-28  Mark Wielaard  <mark@klomp.org>
628
629	* readelf.c (print_ehdr): Use dwelf_elf_e_machine_string instead of
630	ebl->name. If unknown print hex value.
631
6322019-06-25  Mark Wielaard  <mark@klomp.org>
633
634	* stack.c (parse_opt): Fix dwfl_core_file_attach error message.
635
6362019-06-18  Mark Wielaard  <mark@klomp.org>
637
638	* strip.c (handle_elf): Use elf_begin ELF_C_WRITE, instead of
639	ELF_C_WRITE_MMAP.
640
6412019-05-10  Mark Wielaard  <mark@klomp.org>
642
643	* readelf.c (struct attrcb_args): Rename die to dies.
644	(attr_callback): Get current current die using dies[level].
645	Handle DW_AT_discr_list as block, not as constant.
646	(print_debug_units): pass dies, not dies[level] as args.
647
6482019-05-09  Mark Wielaard  <mark@klomp.org>
649
650	* readelf.c (cleanup_list): New function.
651	(main): Call cleanup_list for dump_data_sections and string_sections.
652
6532019-04-28  Mark Wielaard  <mark@klomp.org>
654
655	* unstrip.c (add_new_section_symbols): Call ELF_CHECK after
656	gelf_getsymshndx.
657	(new_shstrtab): Call ELF_CHECK after gelf_getshdr.
658
6592019-04-28  Mark Wielaard  <mark@klomp.org>
660
661	* size.c (show_sysv): Call INTERNAL_ERROR if gelf_getshdr
662	returns NULL.
663	(show_sysv_one_line): Call error with EXIT_FAILURE if
664	gelf_getshdr returns NULL.
665
6662019-04-28  Mark Wielaard  <mark@klomp.org>
667
668	* nm.c (show_symbols_sysv): Check gelf_getshdr doesn't return
669	NULL. Simplify naming of invalid sections, don't use alloca.
670
6712019-04-28  Mark Wielaard  <mark@klomp.org>
672
673	* elfcmp.c (main): Check shdr1 and shdr2 are not NULL.
674
6752019-04-03  Mark Wielaard  <mark@klomp.org>
676
677	* readelf.c (attr_callback): Print DW_AT_data_member_location as
678	decimal offset, not hex number.
679
6802019-03-29  Mark Wielaard  <mark@klomp.org>
681
682	* readelf.c (print_debug_macinfo_section): Check cus[0] is not the
683	sentinel.
684
6852019-03-27  Mark Wielaard  <mark@klomp.org>
686
687	* strip.c (handle_elf): Assert that symbol section number exists.
688
6892019-01-24  Mark Wielaard  <mark@klomp.org>
690
691	* strip.c (handle_elf): Fix check test for SHN_XINDEX symbol.
692
6932019-01-22  Mark Wielaard  <mark@klomp.org>
694
695	* readelf.c (print_debug_line_section): Check we are not at end of
696	line data when reading parameters for unknown opcodes.
697
6982019-01-20  Mark Wielaard  <mark@klomp.org>
699
700	* readelf.c (print_debug_line_section): Check terminating NUL byte
701	for dir and file tables.
702
7032019-01-16  Mark Wielaard  <mark@klomp.org>
704
705	* readelf (handle_core_note): Pass desc to ebl_core_note.
706
7072018-11-10  Mark Wielaard  <mark@klomp.org>
708
709	* elflint.c (check_program_header): Allow PT_GNU_EH_FRAME segment
710	to be matched against SHT_X86_64_UNWIND section.
711
7122018-11-09  Mark Wielaard  <mark@klomp.org>
713
714	* strip.c (remove_debug_relocations): Check if section is gnu
715	compressed and decompress and recompress it.
716
7172018-11-12  Mark Wielaard  <mark@klomp.org>
718
719	* elflint.c (check_note_data): Recognize NT_GNU_BUILD_ATTRIBUTE_OPEN
720	and NT_GNU_BUILD_ATTRIBUTE_OPEN.
721	* readelf.c (handle_notes_data): Handle
722	ELF_NOTE_GNU_BUILD_ATTRIBUTE_PREFIX. Pass nhdr.n_namesz to
723	ebl_object_note.
724
7252018-11-11  Mark Wielaard  <mark@klomp.org>
726
727	* readelf.c (handle_notes_data): Pass n_descsz to
728	ebl_object_note_type_name.
729	* elflint.c (check_note_data): Recognize NT_VERSION, add owner
730	name to unknown note error.
731
7322018-10-20  Mark Wielaard  <mark@klomp.org>
733
734	* readelf.c (process_elf_file): Use dwelf_elf_begin to open pure_elf.
735
7362018-10-26  Mark Wielaard  <mark@klomp.org>
737
738	* strip.c (OPT_RELOC_DEBUG_ONLY): New define.
739	(options): Add reloc-debug-sections-only.
740	(reloc_debug_only): New static bool.
741	(main): Check reloc_debug_only is the only strip option used.
742	(parse_opt): Handle OPT_RELOC_DEBUG_ONLY.
743	(handle_debug_relocs): New function.
744	(handle_elf): Add local variables lastsec_offset and lastsec_size.
745	Handle reloc_debug_only.
746
7472018-10-24  Mark Wielaard  <mark@klomp.org>
748
749	* strip.c (handle_elf): Extract code to update shdrstrndx into...
750	(update_shdrstrndx): ... this new function.
751
7522018-10-24  Mark Wielaard  <mark@klomp.org>
753
754	* strip.c (handle_elf): Extract code into separate functions...
755	(secndx_name): ... new function.
756	(get_xndxdata): Likewise.
757	(remove_debug_relocations): Likewise.
758
7592018-10-24  Mark Wielaard  <mark@klomp.org>
760
761	* strip.c (handle_elf): Always copy over phdrs if there are any
762	and check phnum instead of e_type to determine whether to move
763	allocated sections.
764
7652018-11-02  Mark Wielaard  <mark@klomp.org>
766
767	* unstrip.c (copy_elf): Add ELF_CHECK to make sure gelf_getehdr ()
768	doesn't return NULL.
769
7702018-10-18  Mark Wielaard  <mark@klomp.org>
771
772	* elflint.c (check_note_data): Recognize NT_GNU_PROPERTY_TYPE_0.
773	(check_note): Use p_align to pass either ELF_T_NHDR or ELF_T_NHDR8 to
774	elf_getdata_rawchunk.
775	* readelf (handle_notes): Likewise.
776
7772018-10-24  Mark Wielaard  <mark@klomp.org>
778
779	* addr2line.c (print_addrsym): Use elf_getshdrstrndx instead of
780	Ehdr field.
781
7822018-10-24  Mark Wielaard  <mark@klomp.org>
783
784	* readelf.c (section_name): Remove ehdr argument, lookup shstrndx.
785	(print_debug_abbrev_section): Don't pass ehdr.
786	(print_debug_addr_section): Likewise.
787	(print_decoded_aranges_section): Likewise.
788	(print_debug_aranges_section): Likewise.
789	(print_debug_rnglists_section): Likewise.
790	(print_debug_ranges_section): Likewise.
791	(print_debug_units): Likewise.
792	(print_decoded_line_section): Likewise.
793	(print_debug_line_section): Likewise.
794	(print_debug_loclists_section): Likewise.
795	(print_debug_loc_section): Likewise.
796	(print_debug_macinfo_section): Likewise.
797	(print_debug_macro_section): Likewise.
798	(print_debug_pubnames_section): Likewise.
799	(print_debug_str_section): Liekwise.
800	(print_debug_str_offsets_section): Likewise.
801	(print_gdb_index_section): Likewise.
802
8032018-10-16  Mark Wielaard  <mark@klomp.org>
804
805	* readelf.c (print_debug_frame_section): Make sure readp is never
806	greater than cieend.
807
8082018-10-19  Mark Wielaard  <mark@klomp.org>
809
810	* dwfl_module_getdwarf.c (adjust_relocs): Check sh_entsize is not
811	zero.
812	(add_new_section_symbols): Likewise.
813	(copy_elided_sections): Likewise.
814
8152018-10-18  Mark Wielaard  <mark@klomp.org>
816
817	* size.c (handle_ar): Only close elf if prefix was NULL.
818
8192018-10-18  Mark Wielaard  <mark@klomp.org>
820
821	* arlib.c (arlib_add_symbols): Check that sh_entsize is not zero.
822
8232018-10-14  Mark Wielaard  <mark@klomp.org>
824
825	* ar.c (do_oper_extract): Assume epoch if ar_date is bogus.
826
8272018-10-14  Mark Wielaard  <mark@klomp.org>
828
829	* findtextrel.c (process_file): Check that sh_entsize is not zero.
830
8312018-10-13  Mark Wielaard  <mark@klomp.org>
832
833	* readelf.c (print_debug_macro_section): Use elf_getdata. Print
834	decoded flag string.
835
8362018-10-19  Mark Wielaard  <mark@klomp.org>
837
838	* unstrip.c (copy_elided_sections): Renumber group section indexes.
839
8402018-10-12  Mark Wielaard  <mark@klomp.org>
841
842	* strip.c (handle_elf): Don't remove SHF_GROUP flag from sections.
843	Skip group section flag when renumbering section indexes.
844	* unstrip.c (struct section): Add sig field.
845	(compare_unalloc_sections): Take and use sig1 and sig2 as arguments.
846	(compare_sections): Pass signatures to compare_unalloc_sections.
847	(get_group_sig): New function.
848	(find_alloc_sections_prelink): Set signature.
849	(copy_elided_sections): Likewise and pass them on.
850	(find_unalloc_section): Take and pass signatures.
851
8522018-10-02  Andreas Schwab  <schwab@suse.de>
853
854	* strip.c (handle_elf): Handle ADD/SUB relocation.
855
8562018-09-13  Mark Wielaard  <mark@klomp.org>
857
858	* readelf.c (print_shdr): Get number of section with elf_getshdrnum.
859	(print_phdr): Likewise.
860
8612018-09-13  Mark Wielaard  <mark@klomp.org>
862
863	* strip.c (handle_elf): Check against shstrndx, not e_shstrndx.
864	Explicitly set shdrstrndx for debug file.
865	* unstrip.c (copy_elf): Explicitly copy shstrndx.
866	(find_alloc_sections_prelink): Document shnum usage.
867
8682018-09-13  Mark Wielaard  <mark@klomp.org>
869
870	* elflint.c (check_elf_header): Use shnum instead of e_shnum for all
871	checks.
872	(check_symtab): Use shstrndx instead of e_shstrndx to get section
873	names.
874
8752018-09-13  Mark Wielaard  <mark@klomp.org>
876
877	* elfcmp.c (main): Get, check and shdrstrndx for section names.
878
8792018-09-12  Mark Wielaard  <mark@klomp.org>
880
881	* elfcmp.c (main): Call ebl_section_strip_p without ehdr.
882	* strip.c (handle_elf): Likewise.
883
8842018-09-12  Mark Wielaard  <mark@klomp.org>
885
886	* elflint.c (check_symtab): Call ebl_check_special_symbol without
887	ehdr.
888
8892018-07-30  Mark Wielaard  <mark@klomp.org>
890
891	* strip.c (handle_elf): Track allocated/unallocated sections seen. Set
892	section offset of unallocated sections after handling all allocated
893	sections.
894
8952018-08-18  Mark Wielaard  <mark@klomp.org>
896
897	* readelf.c (print_debug_aranges_section): Make sure there is enough
898	data to read the header segment size.
899
9002018-08-18  Mark Wielaard  <mark@klomp.org>
901
902	* elflint.c (check_sysv_hash): Calculate needed size using unsigned
903	long long int to prevent overflow.
904	(check_sysv_hash64): Calculate maxwords used separately before
905	comparison to prevent overflow.
906
9072018-07-24  Mark Wielaard  <mark@klomp.org>
908
909	* unstrip.c (compare_unalloc_sections): Also compare sh_size.
910
9112018-07-21  Mark Wielaard  <mark@klomp.org>
912
913	* unstrip.c (adjust_all_relocs): Skip SHT_GROUP sections.
914
9152018-07-21  Mark Wielaard  <mark@klomp.org>
916
917	* elfcompress.c (get_sections): New function.
918	(process_file): Check whether section needs to change. Don't rewrite
919	file if no section data needs changing.
920	(main): Update 'force' help text.
921
9222018-07-21  Mark Wielaard  <mark@klomp.org>
923
924	* elfcompress.c (process_file): Swap fchmod and fchown calls.
925
9262018-07-04  Mark Wielaard  <mark@klomp.org>
927
928	* readelf.c (print_debug_addr_section): Rename index var to uidx.
929	(attr_callback): Rename index var to word.
930	(print_debug_str_offsets_section): Rename index var to uidx.
931
9322018-07-04  Ross Burton <ross.burton@intel.com>
933
934	* addr2line.c: Remove error.h include.
935	* ar.c: Likewise.
936	* arlib.c: Likewise and add system.h include.
937	* arlib2.c: Likewise.
938	* elfcmp.c: Likewise.
939	* elfcompress.c: Likewise.
940	* elflint.c: Likewise.
941	* findtextrel.c: Likewise.
942	* nm.c: Likewise.
943	* objdump.c: Likewise.
944	* ranlib.c: Likewise.
945	* readelf.c: Likewise.
946	* stack.c: Likewise.
947	* strings.c: Likewise.
948	* strip.c: Likewise.
949	* unstrip.c: Likewise.
950
9512018-06-25  Mark Wielaard  <mark@klomp.org>
952
953	* readelf.c (print_decoded_line_section): Use dwarf_next_lines
954	instead of dwarf_nextcu.
955	(print_debug_line_section): Don't explicitly lookup CU.
956
9572018-06-15  Mark Wielaard  <mark@klomp.org>
958
959	* readelf.c (attr_callback): Only print block as expressions if it
960	isn't DW_FORM_data16.
961
9622018-06-12  Mark Wielaard  <mark@klomp.org>
963
964	* readelf.c (print_form_data): Check we have 4, not 2, bytes
965	available for DW_FORM_block4.
966
9672018-06-12  Mark Wielaard  <mark@klomp.org>
968
969	* readelf.c (print_form_data): Don't increase strreadp after use.
970	Do increase readp for DW_FORM_strx[1234].
971
9722018-06-16  Mark Wielaard  <mark@klomp.org>
973
974	* readelf.c (print_debug_loc_section): Make sure next_off doesn't
975	overflow d_buf.
976
9772018-06-13  Mark Wielaard  <mark@klomp.org>
978
979	* readelf.c (die_type_sign_bytes): New function.
980	(attr_callback): Recognized DW_FORM_implicit_cost as signed. Use
981	die_type_sign_bytes to lookup the signedness and size of const
982	values.
983
9842018-06-11  Mark Wielaard  <mark@klomp.org>
985
986	* readelf.c (print_form_data): Don't reuse readp and readendp when
987	reading str_offsets section.
988
9892018-06-10  Mark Wielaard  <mark@klomp.org>
990
991	* readelf.c (print_form_data): Don't cast value to ptrdiff_t, cast
992	ptrdiff_t to size_t.
993
9942018-06-08  Mark Wielaard  <mark@klomp.org>
995
996	* readelf.c (print_debug_rnglists_section): Calculate max_entries
997	instead of needed bytes to prevent overflowing. Always print
998	max_entries (but not more).
999	(print_debug_loclists_section): Likewise.
1000
10012018-06-08  Mark Wielaard  <mark@klomp.org>
1002
1003	* readelf.c (print_debug_line_section): Stop printing directories
1004	and files when we are at the end of the unit data.
1005
10062018-06-07  Mark Wielaard  <mark@klomp.org>
1007
1008	* readelf.c (format_result): Removed.
1009	(format_result_size): Removed.
1010	(format_dwarf_addr): Renamed to...
1011	(print_dwarf_addr): ...this. Simply call printf, don't setup buffer,
1012	don't call sprintf.
1013	(print_ops): Use print_dwarf_addr instead of format_dwarf_addr.
1014	(print_debug_addr_section): Likewise.
1015	(print_debug_aranges_section): Likewise.
1016	(print_debug_rnglists_section): Likewise.
1017	(print_debug_ranges_section): Likewise.
1018	(print_debug_frame_section): Likewise.
1019	(attr_callback): Likewise.
1020	(print_decoded_line_section): Likewise.
1021	(print_debug_line_section): Likewise.
1022	(print_debug_loclists_section): Likewise.
1023	(print_debug_loc_section): Likewise.
1024	(print_gdb_index_section): Likewsie.
1025
10262018-06-05  Mark Wielaard  <mark@klomp.org>
1027
1028	* readelf.c (print_debug_addr_section): Set unit_length always to
1029	(next_unitp - readp) in case we don't have a real header.
1030
10312018-06-05  Mark Wielaard  <mark@klomp.org>
1032
1033	* readelf.c (print_debug_loc_section): Set begin to idx when failing
1034	to read the start address if DW_LLE_GNU_start_end_entry.
1035
10362018-06-05  Mark Wielaard  <mark@klomp.org>
1037
1038	* readelf.c (handle_sysv_hash): Don't leak lengths array when
1039	detecting an invalid chain.
1040	(handle_sysv_hash64): Likewise.
1041
10422018-06-05  Mark Wielaard  <mark@klomp.org>
1043
1044	* readelf.c (print_debug_macro_section): Extend vendor array by one
1045	to include max DW_MACRO_hi_user opcode.
1046
10472018-06-07  Mark Wielaard  <mark@klomp.org>
1048
1049	* readelf.c (main): Lookup "no" for no_str.
1050	(print_debug_abbrev_section): Use yes_str and no_str.
1051	(print_form_data): Likewise.
1052
10532018-06-04  Mark Wielaard  <mark@klomp.org>
1054
1055	* readelf (format_result): New static char pointer.
1056	(format_result_size): New static size_t.
1057	(format_dwarf_addr): Calculate max string size, reuse format_result
1058	if possible, otherwise realloc. Use sprintf on result, not asprintf.
1059	(print_ops): Don't free format_dwarf_addr, make sure result is
1060	printed before calling format_dwarf_addr again.
1061	(print_debug_addr_section): Likewise.
1062	(print_debug_aranges_section): Likewise.
1063	(print_debug_rnglists_section): Likewise.
1064	(print_debug_ranges_section): Likewise.
1065	(print_debug_frame_section): Likewise.
1066	(attr_callback): Likewise.
1067	(print_decoded_line_section): Likewise.
1068	(print_debug_line_section): Likewise.
1069	(print_debug_loclists_section): Likewise.
1070	(print_debug_loc_section): Likewise.
1071	(print_gdb_index_section): Likewsie.
1072
10732018-06-04  Mark Wielaard  <mark@klomp.org>
1074
1075	* readelf.c (yes_str): New static char pointer.
1076	(no_str): Likewise.
1077	(main): Set yes_str and no_str using gettext.
1078	(attr_callback): Use yes_str and no_str instead of calling gettext.
1079
10802018-06-04  Mark Wielaard  <mark@klomp.org>
1081
1082	* readelf.c (main): Call __fsetlocking (stdout, FSETLOCKING_BYCALLER).
1083
10842018-05-31  Mark Wielaard  <mark@klomp.org>
1085
1086	* readelf.c (print_debug_units): Print the dwo name and id when
1087	unable to find a .dwo file.
1088
10892018-05-31  Mark Wielaard  <mark@klomp.org>
1090
1091	* readelf.c (enum section_e): Make section_types not an alias of
1092	section_info.
1093	(section_all): Add section_types.
1094	(parse_opt): Add both section_info and section_types for "info"
1095	and "info+".
1096	(print_debug_units): Don't be silent for debug_types.
1097
10982018-05-31  Mark Wielaard  <mark@klomp.org>
1099
1100	* readelf.c (attr_callback): Only register section_loc when not
1101	looking at a split dwarf from a skeleton.
1102
11032018-05-30  Mark Wielaard  <mark@klomp.org>
1104
1105	* readelf.c (print_debug_loc_section): Use correct listptr for
1106	locview attribute.
1107
11082018-05-31  Mark Wielaard  <mark@klomp.org>
1109
1110	* readelf.c (print_debug_units): Check offset against -1 not ~0ul.
1111
11122018-05-29  Mark Wielaard  <mark@klomp.org>
1113
1114	* readelf.c (print_debug_loc_section): Handle GNU DebugFission list
1115	entries.
1116
11172018-05-29  Mark Wielaard  <mark@klomp.org>
1118
1119	* readelf.c (print_debug): Record and reset section_info status in
1120	implicit_debug_sections and print_debug_sections.
1121
11222018-05-28  Mark Wielaard  <mark@klomp.org>
1123
1124	* readelf.c (print_debug_units): Turn "Could not find split compile
1125	unit" into an Warning instead of an error.
1126
11272018-04-29  Mark Wielaard  <mark@klomp.org>
1128
1129	* readelf.c (parse_opt): Request implicit section_info for "str".
1130	(known_stroffbases): New static variable.
1131	(attr_callbackattr_callback): Handle DW_AT_str_offets_base.
1132	(print_debug_str_offsets_section): New function.
1133	(print_debug): Handle .debug_str_offsets as section_str. Reset
1134	known_stroffbases.
1135
11362018-04-27  Mark Wielaard  <mark@klomp.org>
1137
1138	* readelf.c (options): Add addr.
1139	(enum section_e): Add section_addr.
1140	(section_all): Add section_addr.
1141	(parse_opt): Parse "addr".
1142	(known_addrbases): New static variable.
1143	(get_listptr): New function.
1144	(print_debug_addr_section): Likewise.
1145	(attr_callback): Handle DW_AT_addr_base and DW_AT_GNU_addr_base.
1146	(print_debug): Add NEW_SECTION (addr). Reset known_addrbases.
1147
11482018-04-07  Mark Wielaard  <mark@klomp.org>
1149
1150	* readelf.c (attr_callback): Handle DW_FORM_loclistx and
1151	DW_AT_segment.
1152
11532018-04-12  Mark Wielaard  <mark@klomp.org>
1154
1155	* readelf.c (dwarf_loc_list_encoding_string): New functions.
1156	(dwarf_loc_list_encoding_name): Likewise.
1157	(known_loclistptr): Renamed and split in two...
1158	(known_locsptr): this and ...
1159	(known_loclistsptr): this.
1160	(listptr_base): Split out...
1161	(cudie_base): ...this.
1162	(is_split_dwarf): New function.
1163	(attr_callback): Handle DW_AT_loclists_base and notice sec_offset
1164	in correct list.
1165	(print_debug_rnglists_section): Use spit_dwarf_cu_base.
1166	(print_debug_loclists_section): New function.
1167	(print_debug_loc_section): Use known_locsptr instead of
1168	known_loclistptr.
1169	(print_debug): Recognize .debug_loclists. Reset known_locsptr and
1170	known_loclistsptr.
1171
11722018-05-25  Mark Wielaard  <mark@klomp.org>
1173
1174	* readelf.c (DWARF_SKELETON): New constant.
1175	(do_not_close_dwfl): New bool.
1176	(options): Add dwarf-skeleton.
1177	(dwarf_skeleton): New static variable.
1178	(parse_opt): Handle DWARF_SKELETON, set dwarf_skeleton.
1179	(create_dwfl): New function, with code extracted from...
1180	(process_file): ...here. Check do_not_close_dwfl.
1181	(is_split_darf): New function.
1182	(getone_dwflmod): Likewise.
1183	(print_debug): Use new functions to find skeleton DWARF file to use
1184	when inspecting .dwo split DWARF file.
1185
11862018-04-11  Mark Wielaard  <mark@klomp.org>
1187
1188	* readelf.c (dwarf_range_list_encoding_string): New function.
1189	(dwarf_range_list_encoding_name): Likewise.
1190	(known_rnglistptr): New static variable.
1191	(listptr_cu): New function.
1192	(print_debug_rnglists_section): Likewise.
1193	(attr_callback): Call notice_listptr for DW_AT_ranges. Handle
1194	DW_AT_rnglists_base. Handle DW_FORM_rnglistx. DW_AT_start_scope
1195	can also have a rnglist.
1196	(print_debug_units): Do (silently) scan split DWARF also for
1197	debug_ranges before DWARF5 to catch all rangelistptrs.
1198	(print_debug): Recognize .debug_rnglists. Reset known_rnglistptr.
1199
12002018-01-21  Mark Wielaard  <mark@klomp.org>
1201
1202	* readelf.c (get_indexed_addr): New function.
1203	(print_ops): Handle DW_OP_addrx, DW_OP_GNU_addr_index,
1204	DW_OP_constx, DW_OP_GNU_const_index separately and resolve
1205	address.
1206	(attr_callback): Print index and address for
1207	DW_FORM_GNU_addr_index and DW_FORM_addrx[1234].
1208
12092018-01-19  Mark Wielaard  <mark@klomp.org>
1210
1211	* readelf.c (options): Add info+.
1212	(show_split_units): New static boolean defaulting to false.
1213	(parse_opt): For all (no arg) --debug-dump set show_split_units
1214	to yes. For "info+" enable section_info and show_split_units.
1215	(attrcb_args): Add is_split field.
1216	(attr_callback): Use is_split to format DIE offsets differently.
1217	(print_debug_units): Likewise. Get subdie (type or split) only
1218	when needed. When not silent reiterate over split DIEs when
1219	found.
1220
12212018-05-15  Mark Wielaard  <mark@klomp.org>
1222
1223	* readelf.c (print_debug_units): Print unit type and id for any
1224	unit type that has it even when version < 5.
1225
12262018-05-14  Mark Wielaard  <mark@klomp.org>
1227
1228	* readelf.c (print_ops): Handle DW_OP_GNU_addr_index and
1229	DW_OP_GNU_const_index.
1230	(attr_callback): Handle DW_FORM_GNU_addr_index as DW_FORM_addrx.
1231	Handle DW_FORM_GNU_str_index as DW_FORM_constx. Add as_hex_id.
1232	Handle DW_AT_GNU_dwo_id as_hex_id.
1233	(print_form_data): Handle DW_FORM_GNU_str_index as DW_FORM_strx.
1234
12352018-05-12  Mark Wielaard  <mark@klomp.org>
1236
1237	* readelf.c (print_debug): Also recognize .dwo section name variants.
1238
12392018-05-15  Dmitry V. Levin  <ldv@altlinux.org>
1240
1241	* elflint.c (check_elf_header): Fix typo in error diagnostics.
1242
12432018-05-15  Mark Wielaard  <mark@klomp.org>
1244
1245	* readelf.c (print_form_data): Cast comparisons against offset_len to
1246	ptrdiff_t.
1247	(print_debug_line_section): Print uint64_t as PRIu64.
1248
12492018-05-11  Mark Wielaard  <mark@klomp.org>
1250
1251	* readelf.c (print_debug_macro_section): Use libdw_valid_user_form.
1252	Use print_form_data for strx and sup strings.
1253
12542018-05-09  Mark Wielaard  <mark@klomp.org>
1255
1256	* readelf.c (dwarf_line_content_description_string): New function.
1257	(dwarf_line_content_description_name): Likewise.
1258	(print_bytes): Likewise.
1259	(print_form_data): Likewise. Based on code taken from...
1260	(print_debug_macro_section): ...here. Now calls print_form_data
1261	and str_offsets_base_off.
1262	(print_debug_line_section): Parse DWARF5 header, directory and file
1263	name tables.
1264
12652018-05-12  Mark Wielaard  <mark@klomp.org>
1266
1267	* addr2line.c (main): Add fflush (stdout) after handle_address ()
1268	when reading from stdin.
1269
12702018-04-24  Mark Wielaard  <mark@klomp.org>
1271
1272	* readelf.c (print_debug_aranges_section): Try elf_rawdata if no
1273	sectiondata.
1274	(print_debug_ranges_section): Likewise.
1275	(print_debug_frame_section): Likewise.
1276	(print_debug_line_section): Likewise. Check for data == NULL.
1277	(print_debug_loc_section): Likewise.
1278	(print_debug_macinfo_section): Likewise.
1279	(print_debug_macro_section): Likewise.
1280
12812018-04-28  Mark Wielaard  <mark@klomp.org>
1282
1283	* readelf.c (print_debug): If .debug_info is needed implicitly by
1284	then handle it first before handling any other debug section.
1285	(parse_opt): Set implicit_debug_sections to section_info when
1286	showing all debug sections.
1287
12882018-05-05  Mark Wielaard  <mark@klomp.org>
1289
1290	* readelf.c (attr_callback): Handle DW_FORM_ref_sup4 and
1291	DW_FORM_ref_sup8 as references.
1292
12932018-04-24  Mark Wielaard  <mark@klomp.org>
1294
1295	* readelf.c (print_debug_str_section): Take raw section data. Don't
1296	use dwarf_getstring, but determine start and end of string from
1297	offset and section data directly.
1298	(print_debug): Handle ".debug_line_str" like ".debug_str".
1299
13002018-04-19  Andreas Schwab  <schwab@suse.de>
1301
1302	* elflint.c (valid_e_machine): Add EM_RISCV.
1303
13042018-04-16  Mark Wielaard  <mark@klomp.org>
1305
1306	* readelf.c (print_debug_line_section). In advance_pc, advance
1307	using op_addr_advance, not op_advance.
1308
13092018-04-14  Mark Wielaard  <mark@klomp.org>
1310
1311	* readelf.c (attr_callback): Only show errors when not silent.
1312
13132018-03-23  Mark Wielaard  <mark@klomp.org>
1314
1315	* readelf.c (attr_callback): Handle DW_FORM_strx[1234].
1316
13172018-03-22  Mark Wielaard  <mark@klomp.org>
1318
1319	* readelf.c (attr_callback): Handle DW_FORM_addrx[1234].
1320
13212018-03-28  Mark Wielaard  <mark@klomp.org>
1322
1323	* readelf.c (handle_sysv_hash): Break bucket chain after nchain
1324	entries are found.
1325	(handle_sysv_hash64): Likewise.
1326
13272018-03-27  Mark Wielaard  <mark@klomp.org>
1328
1329	* readelf.c (attr_callback): Print dwarf_dieoffset as %PRIx64,
1330	not %zx.
1331
13322018-03-20  Mark Wielaard  <mark@klomp.org>
1333
1334	* readelf.c (attr_callback): Report error when DW_AT_decl_file or
1335	DW_AT_call_file cannot be resolved.
1336
13372018-03-06  Mark Wielaard  <mark@klomp.org>
1338
1339	* readelf.c (print_ops): Handle DW_OP_addrx, DW_OP_constx,
1340	DW_OP_implicit_pointer, DW_OP_entry_value, DW_OP_const_type,
1341	DW_OP_regval_type, DW_OP_deref_type, DW_OP_xderef_type,
1342	DW_OP_convert, DW_OP_reinterpret.
1343
13442018-03-01  Mark Wielaard  <mark@klomp.org>
1345
1346	* readelf.c (struct listptr): Add attr field.
1347	(compare_listptr): Warn when two listptrs for the same offset have
1348	different attributes.
1349	(notice_listptr): Take attr as argument and add it to listptr.
1350	(skip_listptr_hole): New attr argument.
1351	(next_listptr_offset): New function.
1352	(print_debug_ranges_section): Pass NULL attr to skip_listptr_hole.
1353	(attr_callback): Handle DW_AT_GNU_locviews. Call notice_listptr with
1354	attr.
1355	(print_debug_loc_section): Keep track of which attr is associated with
1356	a listptr. If the attr is DW_AT_GNU_locview print view pairs till the
1357	next listptr offset.
1358
13592018-02-09  Mark Wielaard  <mark@klomp.org>
1360
1361	* elflint.c (check_group): Make sure we can read a complete
1362	element when iterating over the group.
1363
13642018-02-09  Mark Wielaard  <mark@klomp.org>
1365
1366	* readelf.c (attr_callback): Handle DW_FORM_data16 as Dwarf_Block.
1367
13682018-02-09  Mark Wielaard  <mark@klomp.org>
1369
1370	* readelf.c (print_debug_abbrev_section): Print the value of a
1371	DW_FORM_implicit_const using dwarf_getabbrevattr_data.
1372	(attr_callback): Handle DW_FORM_implicit_const.
1373
13742018-01-30  Mark Wielaard  <mark@klomp.org>
1375
1376	* readelf.c (dwarf_unit_string): New function.
1377	(dwarf_unit_name): Likewise.
1378	(print_debug_units): Use dwarf_get_units and dwarf_cu_die instead
1379	of dwarf_next_unit. Print unit type, id and subdie if available.
1380
13812018-02-09  Joshua Watt  <JPEWhacker@gmail.com>
1382
1383	* addr2line.c (handle_address): Use FALLTHROUGH macro instead of
1384	comment.
1385	* elfcompress.c (parse_opt): Likewise.
1386	* elflint.c (check_dynamic): Likewise.
1387	(check_sections): Likewise.
1388	(check_note_data): Likewise.
1389	* objdump.c (parse_opt): Likewise.
1390	* readelf.c (parse_opt): Likewise.
1391	(attr_callback): Likewise.
1392	(handle_auxv_note): Likewise.
1393	* strings.c (parse_opt): Likewise.
1394	* backtrace.c (callback_verify): Likewise.
1395
13962018-01-25  Mark Wielaard  <mark@klomp.org>
1397
1398	* readelf.c (print_debug_ranges_section): Initialize cu to last_cu.
1399	(print_debug_loc_section): Likewise.
1400
14012018-01-01  Mark Wielaard  <mark@klomp.org>
1402
1403	* readelf.c (attr_callback): Use dwarf_form_name for unknown forms.
1404	(print_debug_macro_section): Print form using dwarf_form_name.
1405
14062017-12-28  Mark Wielaard  <mark@klomp.org>
1407
1408	* readelf.c (print_debug_units): Print DIE offset in error message
1409	as hex.
1410
14112017-12-18  Mark Wielaard  <mark@klomp.org>
1412
1413	* readelf.c (handle_notes_data): Don't use EXIT_FAILURE in error.
1414	Adjust error message depending on whether or not we got data.
1415
14162017-12-07  Mark Wielaard  <mark@klomp.org>
1417
1418	* readelf.c (print_ops): Update data pointer and print arguments
1419	to DW_OP_call2 and DW_OP_call4 as DIE offsets.
1420
14212017-11-29  Mark Wielaard  <mark@klomp.org>
1422
1423	* readelf.c (argp_options): Add "section-groups", 'g'.
1424
14252017-11-29  Mark Wielaard  <mark@klomp.org>
1426
1427	* readelf.c (print_debug_loc_section): Print CU base and unresolved
1428	addresses. Adjust formatting.
1429
14302017-11-29  Mark Wielaard  <mark@klomp.org>
1431
1432	* readelf.c (print_debug_ranges_section): Print CU base and unresolved
1433	addresses. Adjust formatting.
1434
14352017-11-29  Mark Wielaard  <mark@klomp.org>
1436
1437	* readelf.c (attr_callback): Set valuestr to resolved file name
1438	for DW_AT_decl_file and DW_AT_call_file.
1439
14402017-11-29  Mark Wielaard  <mark@klomp.org>
1441
1442	* readelf.c (print_debug_units): Print abbrev code after DIE tag.
1443
14442017-11-29  Mark Wielaard  <mark@klomp.org>
1445
1446	* readelf.c (print_ops): Use only2 space for index. re-indent +5
1447	for DW_OP_GNU_entry_value.
1448
14492017-11-21  Mark Wielaard  <mark@klomp.org>
1450
1451	* readelf.c (attr_callback): Print attribute name and form in error
1452	message. If only the value cannot be retrieved/resolved don't abort.
1453
14542017-10-03  Mark Wielaard  <mark@klomp.org>
1455
1456	* readelf.c (attr_callback): Print DIE offset in error messages.
1457
14582017-11-03  Mark Wielaard  <mark@klomp.org>
1459
1460	* readelf.c (print_ops): Handle DW_OP_GNU_variable_value. Print
1461	referenced DIE as offset.
1462
14632017-09-10  Mark Wielaard  <mark@klomp.org>
1464
1465	* ar.c (do_oper_delete): Remove DEBUG conditional check.
1466	(no0print): Return bool. Check snprintf return value.
1467	(do_oper_insert): Initialize elf. Remove DEBUG conditional check.
1468	Check no0print calls succeed. Explicitly elf_end found elfs.
1469	(do_oper_extract): Make sure we don't create an empty variable
1470	length array.
1471
14722017-09-01  Mark Wielaard  <mark@klomp.org>
1473
1474	* stack.c (main): Replace \v in doc string with \n\n.
1475	* unstrip.c (main): Likewise.
1476
14772017-05-04  Ulf Hermann  <ulf.hermann@qt.io>
1478
1479	* stack.c: Print pid_t using %lld.
1480
14812017-08-18  Ulf Hermann  <ulf.hermann@qt.io>
1482
1483	* readelf.c: Hardcode the signal numbers for non-linux systems.
1484
14852017-07-26  Mark Wielaard  <mark@klomp.org>
1486
1487	* readelf.c (print_debug_macro_section): Accept either version 4 or
1488	version 5. Use DW_MACRO names instead of DW_MACRO_GNU names. Add
1489	minimal support for DW_MACRO_define_sup, DW_MACRO_undef_sup,
1490	DW_MACRO_import_sup, DW_MACRO_define_strx and DW_MACRO_undef_strx.
1491
14922017-07-26  Mark Wielaard  <mark@klomp.org>
1493
1494	* readelf.c (dwarf_defaulted_string): New function.
1495	(dwarf_defaulted_name): Likewise.
1496	(attr_callback): Use dwarf_defaulted_name to get value of
1497	DW_AT_defaulted.
1498
14992017-07-20  Mark Wielaard  <mark@klomp.org>
1500
1501	* strip.c (handle_elf): Deal with data marker symbols pointing to
1502	debug sections (they can be removed).
1503
15042017-07-14  Mark Wielaard  <mark@klomp.org>
1505
1506	* strip (OPT_KEEP_SECTION): New define.
1507	(options): Add documentation for remove-section. Add keep-section.
1508	(struct section_pattern): New data type.
1509	(keep_secs, remove_secs): New globals.
1510	(add_pattern, free_sec_patterns, free_patterns, section_name_matches):
1511	New functions.
1512	(main): Call free_patterns.
1513	(parse_opt): Handle 'R' and OPT_KEEP_SECTION. Check remove_comment
1514	on ARGP_KEY_SUCCESS.
1515	(handle_elf): Handle and sanity check keep_secs and remove_secs.
1516
15172017-06-07  Mark Wielaard  <mark@klomp.org>
1518
1519	* strip.c (handle_elf): Introduce new handle_elf boolean. Use it to
1520	determine whether to create an output and/or debug file. Remove new
1521	output file on error.
1522
15232017-06-06  Mark Wielaard  <mark@klomp.org>
1524
1525	* strip.c (handle_elf): Assume e_shstrndx section can be removed.
1526
15272017-04-20  Ulf Hermann  <ulf.hermann@qt.io>
1528
1529	* readelf.c: Include strings.h.
1530
15312017-04-20  Ulf Hermann  <ulf.hermann@qt.io>
1532
1533	* unstrip.c: Check shnum for 0 before subtracting from it.
1534
15352017-04-20  Ulf Hermann <ulf.hermann@qt.io>
1536
1537	* readelf.c: Replace YESSTR and NOSTR with gettext ("yes") and
1538	gettext ("no"), respectively.
1539
15402017-04-05  Mark Wielaard  <mark@klomp.org>
1541
1542	* elflint.c (check_elf_header): Decompress all sections.
1543
15442017-03-28  Mark Wielaard  <mark@klomp.org>
1545
1546	* elflint (check_group): Don't check if there is no flag word.
1547
15482017-03-27  Mark Wielaard  <mark@klomp.org>
1549
1550	* elflint.c (check_elf_header): Sanity check phnum and shnum.
1551
15522017-03-27  Mark Wielaard  <mark@klomp.org>
1553
1554	* elflint.c (check_sysv_hash): Return early if section size is
1555	too small.
1556	(check_sysv_hash64): Likewise.
1557	(check_hash): Calculate expect_entsize to check section size.
1558
15592017-03-27  Mark Wielaard  <mark@klomp.org>
1560
1561	* elflint.c (check_symtab_shndx): Check data->d_size.
1562
15632017-03-24  Mark Wielaard  <mjw@redhat.com>
1564
1565	* elfcmp.c (main): If n_namesz == 0 then the note name data is the
1566	empty string.
1567	* readelf.c (handle_notes_data): Likewise.
1568
15692017-03-24  Mark Wielaard  <mjw@redhat.com>
1570
1571	* readelf.c (handle_gnu_hash): Check inner < max_nsyms before
1572	indexing into chain array.
1573
15742017-02-16  Ulf Hermann  <ulf.hermann@qt.io>
1575
1576	* addr2line.c: Include printversion.h
1577	* ar.c: Likewise.
1578	* elflint.c: Likewise.
1579	* nm.c: Likewise.
1580	* objdump.c: Likewise.
1581	* ranlib.c: Likewise.
1582	* readelf.c: Likewise.
1583	* size.c: Likewise.
1584	* stack.c: Likewise.
1585	* strings.c: Likewise.
1586	* strip.c: Likewise.
1587	* elfcmp.c: Include printversion.h, remove system.h include.
1588	* elfcompress.c: Likewise.
1589	* findtextrel.c: Likewise.
1590	* unstrip.c: Likewise.
1591
15922017-02-14  Ulf Hermann  <ulf.hermann@qt.io>
1593
1594	* nm.c: Include color.h.
1595	* objdump.c: Likewise.
1596
15972016-12-24  Mark Wielaard  <mark@klomp.org>
1598
1599	* Makefile.am (findtextrel_LDADD): Add $(libeu).
1600	(addr2line_LDADD): Likewise.
1601	(elfcmp_LDADD): Likewise.
1602	* addr2line.c (print_version): Removed.
1603	* ar.c (print_version): Likewise.
1604	* elfcmp.c (print_version): Likewise.
1605	* elfcompress.c (print_version): Likewise.
1606	* elflint.c (print_version): Likewise.
1607	* findtextrel.c (print_version): Likewise.
1608	* nm.c (print_version): Likewise.
1609	* objdump.c: Likewise.
1610	* ranlib.c: Likewise.
1611	* readelf.c: Likewise.
1612	* size.c: Likewise.
1613	* stack.c: Likewise.
1614	* strings.c: Likewise.
1615	* strip.c: Likewise.
1616	* unstrip.c: Likewise.
1617
16182016-11-17  Mark Wielaard  <mjw@redhat.com>
1619
1620	* readelf.c (options): Add optional arg SECTION for symbols.
1621	(symbol_table_section): New static variable.
1622	(parse_opt): Set symbol_table_section on 's'.
1623	(print_symtab): Filter on symbol_table_section name is set.
1624
16252016-11-10  Mark Wielaard  <mjw@redhat.com>
1626
1627	* ar.c (write_member): Make sure tmpbuf is large enough to contain
1628	a starting '/' and ending '\0' char.
1629	(do_oper_insert): Likewise.
1630	* arlib.c (arlib_finalize): Format tmpbuf as PRId32 decimal.
1631
16322016-11-02  Mark Wielaard  <mjw@redhat.com>
1633
1634	* addr2line.c (handle_address): Add fallthrough comment.
1635	* elfcompress.c (parse_opt): Adjust fallthrough comment.
1636	* elflint.c (parse_opt): Add missing break after 'd' case.
1637	(check_sections): Add fallthrough comments.
1638	* objdump.c (parse_opt): Add explantion for fallthrough comment.
1639
16402016-10-22  Kevin Cernekee  <cernekee@chromium.org>
1641
1642	* unstrip.c: Fix "invalid string offset" error caused by using the
1643	  unstripped .symtab with the stripped .strtab.
1644
16452016-10-11  Akihiko Odaki  <akihiko.odaki.4i@stu.hosei.ac.jp>
1646
1647	* arlib.c: Remove system.h include, add libeu.h include.
1648	* arlib2.c: Remove sys/param.h include.
1649	* elfcompress.c: Add libeu.h include.
1650	* elflint.c: Remove sys/param.h include, add libeu.h include.
1651	* nm.c: Likewise.
1652	* objdump.c: Likewise.
1653	* ranlib.c: Likewise.
1654	* readelf.c: Likewise.
1655	* size.c: Remove sys/param.h include.
1656	* strings.c: Likewise, add libeu.h include.
1657	* strip.c: Likewise.
1658	* unstrip.c: Likewise.
1659
16602016-10-06  Mark Wielaard  <mjw@redhat.com>
1661
1662	* strip.c (handle_elf): Don't remove real symbols from allocated
1663	symbol tables.
1664
16652016-08-25  Mark Wielaard  <mjw@redhat.com>
1666
1667	* strip.c (handle_elf): Recompress with ELF_CHF_FORCE.
1668
16692016-08-06  Mark Wielaard  <mjw@redhat.com>
1670
1671	* strip.c (handle_elf): Uncompress and recompress relocation target
1672	section if necessary.
1673
16742016-07-08  Mark Wielaard  <mjw@redhat.com>
1675
1676	* Makefile.am (strip_LDADD): Add libdw.
1677	* elfcompress.c (process_file): Use dwelf_strtab functions instead of
1678	ebl_strtab.
1679	* strip.c (handle_elf): Likewise.
1680	* unstrip.c (new_shstrtab): Likewise.
1681
16822016-07-06  Mark Wielaard  <mjw@redhat.com>
1683
1684	* elf32-i386.script, i386_ld.c, ld.c, ld.h, ldgeneric.c, ldlex.l,
1685	ldscript.y, libld_elf_i386.map, none_ld.c, sectionhash.c,
1686	sectionhash.h, symbolhash.c, symbolhash.h, unaligned.h,
1687	versionhash.c, versionhash.h, xelf.h: Removed.
1688	* Makefile.am (YACC): Removed.
1689	(AM_YFLAGS): Removed.
1690	(AM_LFLAGS): Removed.
1691	(native_ld): Removed.
1692	(base_cpu): Removed.
1693	(bin_PROGRAMS): Removed ld.
1694	(ld_dsos): Removed.
1695	(ld_SOURCES): Removed.
1696	(noinst_LIBRARIES): Only libar.a.
1697	(EXTRA_DIST): Just arlib.h and debugpred.h.
1698	(ld_LDADD): Removed.
1699	(ld_LDFLAGS): Removed.
1700	(ldlex.o): Removed.
1701	(ldscript.h): Removed.
1702	(libld*): Removed.
1703	(CLEANFILES): Just *.gconv.
1704	(MAINTAINERCLEANFILES): Removed.
1705
17062016-07-06  Mark Wielaard  <mjw@redhat.com>
1707
1708	* unstrip.c (copy_elided_sections): Use unstripped_strent[] from
1709	index zero, instead of one.
1710
17112016-06-28  Richard Henderson <rth@redhat.com>
1712
1713	* elflint.c (valid_e_machine): Add EM_BPF.
1714
17152016-04-11  David Abdurachmanov  <davidlt@cern.ch>
1716
1717	* elfcmp.c (main): Fix self-comparison error with GCC 6.
1718
17192016-03-21  Mark Wielaard  <mjw@redhat.com>
1720
1721	* nm.c (show_symbols): Check for malloc size argument overflow.
1722
17232016-02-13  Mark Wielaard  <mjw@redhat.com>
1724
1725	* readelf.c (print_scngrp): Call error when gelf_getshdr fails.
1726	(print_symtab): Likewise.
1727	(handle_hash): Likewise.
1728	(dump_data_section): Print a warning if decompressing fails.
1729	(print_string_section): Likewise.
1730
17312016-02-13  Mark Wielaard  <mjw@redhat.com>
1732
1733	* elfcompress.c (parse_opt): Don't fallthrough after processing -q.
1734
17352016-02-12  Mark Wielaard  <mjw@redhat.com>
1736
1737	* strip.c (handle_elf): Correct elf_assert shndxdata check.
1738
17392016-02-09  Mark Wielaard  <mjw@redhat.com>
1740
1741	* readelf.c (read_encoded): Move up.
1742	(print_cfa_program): Add encoding argument. Use it for read_encoded
1743	when reading DW_CFA_set_loc op.
1744	(print_debug_frame_section): Pass fde_encoding to print_cfa_program.
1745
17462016-02-09  Mark Wielaard  <mjw@redhat.com>
1747
1748	* elflint.c (compare_hash_gnu_hash): Check hash sh_entsize against
1749	sizeof (Elf64_Xword). Correct invalid sh_entsize error message
1750	section idx and name.
1751
17522016-01-13  Mark Wielaard  <mjw@redhat.com>
1753
1754	* elflint.c (check_elf_header): Recognize ELFOSABI_FREEBSD.
1755
17562016-01-08  Mark Wielaard  <mjw@redhat.com>
1757
1758	* elfcompress.c (compress_section): Use %zu to print size_t.
1759	* readelf.c (print_shdr): Use %zx to print size_t.
1760
17612015-12-16  Mark Wielaard  <mjw@redhat.com>
1762
1763	* elfcompress.c: New file.
1764	* Makefile.am (bin_PROGRAMS): Add elfcompress.
1765	(elfcompress_LDADD): New variable.
1766
17672015-12-18  Mark Wielaard  <mjw@redhat.com>
1768
1769	* elflint.c (section_flags_string): Add NEWFLAG COMPRESSED.
1770	(check_sections): SHF_COMPRESSED can be on any special section.
1771	SHF_COMPRESSED is a valid section flag. SHF_COMPRESSED cannot
1772	be used together with SHF_ALLOC or with SHT_NOBITS. Should have
1773	a valid Chdr.
1774
17752015-10-20  Mark Wielaard  <mjw@redhat.com>
1776
1777	* readelf.c (options): Expand -z help text.
1778	(dump_data_section): Check whether we need and can decompress section
1779	data and call elf_rawzdata if so,
1780	(print_string_section): Likewise.
1781	(elf_contains_chdrs): New function.
1782	(process_elf_file): Rename print_unrelocated to print_unchanged,
1783	use elf_contains_chdrs.
1784	(print_scngrp): Check whether section is compressed before use.
1785	(print_symtab): Likewise.
1786	(handle_hash): Likewise.
1787
17882015-10-16  Mark Wielaard  <mjw@redhat.com>
1789
1790	* readelf.c (argp_option): Describe --decompress,-z.
1791	(print_decompress): New bool.
1792	(parse_opt): Handle -z.
1793	(elf_ch_type_name): New function.
1794	(print_shdr): Print section compress information.
1795
17962015-12-31  Mark Wielaard  <mjw@redhat.com>
1797
1798	* elflint.c (check_symtab): Add _edata and _end (plus extra underscore
1799	variants) to to the list of possibly dangling symbols.
1800
18012015-12-02  Mark Wielaard  <mjw@redhat.com>
1802
1803	* nm.c (process_file): Accept fd and pass it on.
1804	(handle_elf): Likewise.
1805	(find_no_debuginfo): New.
1806	(struct getdbg): Likewise.
1807	(getdbg_dwflmod): Likewise.
1808	(show_symbols): Take fd. If the file is ET_REL use libdwfl to get
1809	the relocated Dwarf.
1810
18112015-12-02  Mark Wielaard  <mjw@redhat.com>
1812
1813	* nm.c (get_local_names): Check for duplicates in local_root tree.
1814
18152015-12-02  Mark Wielaard  <mjw@redhat.com>
1816
1817	* unstrip.c (struct data_list): New.
1818	(new_data_list): Likewise.
1819	(record_new_data): Likewise.
1820	(free_new_data): Likewise.
1821	(adjust_relocs): Call record_new_data.
1822	(add_new_section_symbols): Likewise.
1823	(copy_elided_sections): Call free_new_data.
1824
18252015-12-01  Mark Wielaard  <mjw@redhat.com>
1826
1827	* elfcmp.c (main): Close ebl1 and ebl2 backends.
1828
18292015-10-16  Mark Wielaard  <mjw@redhat.com>
1830
1831	* Makefile.am [BUILD_STATIC](libdw): Add -lz.
1832	[BUILD_STATIC](libelf): Likewise.
1833
18342015-10-16  Mark Wielaard  <mjw@redhat.com>
1835
1836	* elflint.c (check_symtab): Don't check TLS symbol value against TLS
1837	phdr offset in debuginfo files.
1838	(check_sections): Don't try to match section offsets to phdrs offsets
1839	in debuginfo files.
1840
18412015-10-16  Mark Wielaard  <mjw@redhat.com>
1842
1843	* elflint.c (check_reloc_shdr): Reject only desthdrs if they have both
1844	SHF_MERGE and SHF_STRINGS set.
1845
18462015-10-13  Jose E. Marchesi  <jose.marchesi@oracle.com>
1847
1848	* elflint.c (check_sections): Do not rely on
1849	ebl_check_special_section when checking debuginfo files.  Also
1850	check that the type of WE sections in debuginfo files is NOBITS.
1851
18522015-10-13  Mark Wielaard  <mjw@redhat.com>
1853
1854	* elflint.c (check_program_header): Check relro flags are a subset
1855	of the load segment if they don't fully overlap.
1856
18572015-10-07  Mark Wielaard  <mjw@redhat.com>
1858
1859	* Makefile.am (ldlex_no_Wstack_usage): New.
1860	* ldlex.l ([RWX]): Make cnt unsigned.
1861
18622015-10-09  Josh Stone  <jistone@redhat.com>
1863
1864	* elflint.c (main): Replace stat64 and fstat64 with stat and fstat.
1865	* readelf.c (process_file): Likewise.
1866	(process_elf_file): Replace off64_t with off_t.
1867	* findtextrel.c (process_file): Replace open64 with open.
1868	* ld.c (main): Replace sizeof (off64_t) with 8.
1869	* strings.c: Replace off64_t with off_t throughout.
1870	(main): Replace stat64 and fstat64 with stat and fstat.
1871	(map_file): Replace mmap64 with mmap.
1872	(read_block): Likewise, and replace lseek64 with lseek.
1873	* strip.c (handle_elf): Replace ftruncate64 with ftruncate.
1874	(process_file): Replace stat64 and fstat64 with stat and fstat.
1875	* unstrip.c (parse_opt): Replace stat64 with stat.
1876	(handle_file): Replace open64 with open.
1877	(open_file): Likewise.
1878
18792015-10-08  Chih-Hung Hsieh  <chh@google.com>
1880
1881	* ld.c (determine_output_format): Move recursive nested
1882	function "try" to file scope.
1883
18842015-10-04  Mark Wielaard  <mjw@redhat.com>
1885
1886	* strip.c (handle_elf): Only sanity check section symbols to not
1887	kept discarded sections if we are creating a debug file.
1888
18892015-10-07  Mark Wielaard  <mjw@redhat.com>
1890
1891	* unstrip.c (MAX): Removed.
1892	(find_alloc_sections_prelink): Allocate exact amount of bytes for
1893	shdrs.
1894
18952015-10-05  Chih-Hung Hsieh <chh@google.com>
1896
1897	* unstrip.c (find_alloc_sections_prelink): Do not allocate
1898	on stack union types with variable length arrays; use xmalloc
1899	for such dynamic sized objects.
1900	* readelf.c (handle_core_item): Likewise, but use alloca
1901	for small variable size data object and add assert(count < 128).
1902
19032015-10-05  Josh Stone  <jistone@redhat.com>
1904
1905	* Makefile.am (libld_elf_i386.so): Add AM_V_CCLD silencer.
1906	(.deps/none_ld.Po): Always silence the dummy command.
1907	(make-debug-archive): Add AM_V_GEN and AM_V_at silencers.
1908
19092015-10-02  Mark Wielaard  <mjw@redhat.com>
1910
1911	* unstrip.c (copy_elided_sections): Use SH_INFO_LINK_P, not just
1912	SHF_INFO_LINK.
1913
19142015-10-02  Mark Wielaard  <mjw@redhat.com>
1915
1916	* strip.c (handle_elf): Don't move around allocated NOBITS sections.
1917	Don't just mark the section header string table as unused.
1918	* unstrip.c (copy_elided_sections): Add header names to strtab if
1919	shstrndx equals the symtab strtabndx.
1920
19212015-09-22  Mark Wielaard  <mjw@redhat.com>
1922
1923	* strip.c (cleanup_debug): Remove old-style function definitions.
1924
19252015-09-09  Chih-Hung Hsieh  <chh@google.com>
1926
1927	* readelf.c (print_debug_exception_table): Initialize variable before
1928	it is used, because compiler does not know that error never returns.
1929	(dump_arhive_index): Likewise.
1930
19312015-09-04  Chih-Hung Hsieh  <chh@google.com>
1932
1933	* elflint.c (check_group): Replace %Z length modifier with %z.
1934	(check_note_data): Likewise.
1935	* findtextrel.c (process_file): Likewise.
1936	* readelf.c (handle_dynamic): Likewise.
1937	(handle_symtab): Likewise.
1938	(handle_verneed): Likewise.
1939	(handle_verdef): Likewise.
1940	(handle_versym): Likewise.
1941	(print_hash_info): Likewise.
1942	(print_decoded_aranges_section): Likewise.
1943	(print_debug_aranges_section): Likewise.
1944	(print_debug_line_section): Likewise.
1945	(hex_dump): Likewise.
1946	(dump_data_section): Likewise.
1947	(print_string_section): Likewise.
1948	(dump_archive_index): Likewise.
1949	* unstrip.c (adjust_relocs): Likewise.
1950	(collect_symbols): likewise.
1951	(get_section_name): Likewise.
1952	(find_alloc_sections_prelink): Likewise.
1953	(copy_elided_sections): Likewise.
1954	* ldscript.y (add_id_list): Add missing '%s'.
1955
19562015-09-03  Mark Wielaard  <mjw@redhat.com>
1957
1958	* readelf.c (handle_core_item): Handle right shift >= 32 bits.
1959
19602015-08-11  Mark Wielaard  <mjw@redhat.com>
1961
1962	* elflint.c (check_sections): When gnuld and a NOBITS section falls
1963	inside a segment make sure any ELF file contents is zero.
1964
19652015-07-29  Mark Wielaard  <mjw@redhat.com>
1966
1967	* unstrip.c (sections_flags_match): New function.
1968	(sections_match): Use sections_flags_match.
1969	(find_alloc_sections_prelink): Only clear matched sections if there
1970	is an undo section.
1971	(copy_elided_sections): Add SHF_INFO_LINK to shdr_mem.sh_flags if
1972	necessary.
1973
19742015-06-27  Pino Toscano  <toscano.pino@tiscali.it>
1975
1976	* src/strings.c: Define MAP_POPULATE if not defined already.
1977
19782015-06-27  Mark Wielaard  <mjw@redhat.com>
1979
1980	* nm.c (show_symbols): First call elf_getdata, then allocate memory.
1981
19822015-06-18  Mark Wielaard  <mjw@redhat.com>
1983
1984	* findtextrel.c (process_file): Free segments after use.
1985
19862015-06-18  Mark Wielaard  <mjw@redhat.com>
1987
1988	* readelf.c (print_phdr): Make sure phdr2_mem lifetime/scope equals
1989	phdr2 pointer.
1990
19912015-06-18  Mark Wielaard  <mjw@redhat.com>
1992
1993	* readelf.c (handle_gnu_hash): Free lengths on invalid_data.
1994
19952015-06-18  Mark Wielaard  <mjw@redhat.com>
1996
1997	* elflint.c (check_symtab): Only check the PT_TLS phdr if it actually
1998	exists. Warn otherwise.
1999
20002015-06-18  Mark Wielaard  <mjw@redhat.com>
2001
2002	* nm.c (show_symbols): Check sizeof (sym_mem[0]), not GElf_Sym to
2003	known whether or not we stack allocated memory.
2004
20052015-06-18  Mark Wielaard  <mjw@redhat.com>
2006
2007	* strings.c (readelf): Use "<unknown>" if we cannot retrieve section
2008	name.
2009
20102015-06-09  Mark Wielaard  <mjw@redhat.com>
2011
2012	* addr2line.c (print_dwarf_function): Always free scopes before
2013	returning.
2014
20152015-06-09  Mark Wielaard  <mjw@redhat.com>
2016
2017	* strip.c (handle_ar): Mark as unused.
2018	(process_file): Produce an error when trying to handle an ar.
2019
20202015-05-30  Mark Wielaard  <mjw@redhat.com>
2021
2022	* elfcmp.c (main): Only call memcmp when d_size != 0.
2023
20242015-05-23  Mark Wielaard  <mjw@redhat.com>
2025
2026	* Makefile.am: Define ldgeneric, readelf, nm, size, strip, elflint,
2027	findtextrel, elfcmp objdump, ranlib, ar and unstrip no_Wstack_usage.
2028
20292015-05-21  Mark Wielaard  <mjw@redhat.com>
2030
2031	* addr2line.c (handle_address): Set scopes to NULL after free.
2032
20332015-05-20  Mark Wielaard  <mjw@redhat.com>
2034
2035	* addr2line.c (OPT_PRETTY): New constant define.
2036	(argp_option): Add "pretty-print".
2037	(pretty): New static bool.
2038	(parse_opt): Set pretty.
2039	(print_dwarf_function): Adjust output when pretty is set.
2040	(print_addrsym): Likewise.
2041	(handle_address): Likewise.
2042
20432015-05-20  Mark Wielaard  <mjw@redhat.com>
2044
2045	* Makefile.am (addr2line_LDADD): Add demanglelib.
2046	* addr2line.c (argp_option): Move demangle under output format.
2047	(demangle): New static bool.
2048	(demangle_buffer_len): New static size_t.
2049	(demangle_buffer): New static char *.
2050	(main): free demangle_buffer.
2051	(parse_opt): Set demangle.
2052	(symname): New static function.
2053	(get_diename): Use symname.
2054	(print_dwarf_function): Likewise.
2055	(print_addrsym): Likewise.
2056	(handle_address): Likewise.
2057
20582015-05-20  Mark Wielaard  <mjw@redhat.com>
2059
2060	* addr2line.c (argp_option): Add "addresses", 'a'.
2061	(print_addresses): New static bool.
2062	(parse_opt): Set print_addresses.
2063	(get_addr_width): New static function.
2064	(handle_address): Print address if print_addresses is true.
2065
20662015-05-20  Mark Wielaard  <mjw@redhat.com>
2067
2068	* addr2line.c (handle_address): Call strtoumax with base 16. Make
2069	sure all input has been processed.
2070
20712015-05-20  Mark Wielaard  <mjw@redhat.com>
2072
2073	* addr2line (argp_option): Group 'section' under "Input format
2074	options".
2075
20762015-05-12  Mark Wielaard  <mjw@redhat.com>
2077
2078	* strip.c (debug_fd): New static variable.
2079	(tmp_debug_fname): Likewise.
2080	(cleanup_debug): New function using the above to clean up temporary
2081	debug file.
2082	(INTERNAL_ERROR): Call cleanup_debug.
2083	(handle_elf): Use debug_fd and tmp_debug_fname statics and call
2084	cleanup_debug before any error. Use output_fname instead of fname in
2085	error messages when it exists (-o was given). SHT_NOBITS sections
2086	can also be moved freely even if SHF_ALLOC is set. Add various
2087	sanity checks. Use elf_assert instead of plain assert.
2088
20892015-05-08  Mark Wielaard  <mjw@redhat.com>
2090
2091	* nm.c (show_symbols): Call gelf_fsize with EV_CURRENT.
2092	* strip.c (handle_elf): Likewise.
2093
20942015-05-06  Mark Wielaard  <mjw@redhat.com>
2095
2096	* elflint.c (check_gnu_hash): Return early when 2nd hash function
2097	shift too big. Check there is enough data available. Make sure
2098	bitmask_words is not zero.
2099	(check_verdef): Use Elf64_Word for shdr->sh_info cnt.
2100	(check_verneed): Likewise.
2101	(check_attributes): Break when vendor name isn't terminated.
2102	Add overflow check for subsection_len.
2103
21042015-05-05  Mark Wielaard  <mjw@redhat.com>
2105
2106	* nm.c (show_symbols): Handle dwarf_linesrc returning NULL.
2107
21082015-05-04  Max Filippov  <jcmvbkbc@gmail.com>
2109
2110	* ar.c (do_oper_extract): Replace struct timeval with struct timespec
2111	and futimes with futimens.
2112	* strip.c (process_file): Replace struct timeval with struct timespec.
2113	(handle_elf, handle_ar): Replace struct timeval with struct timespec
2114	in prototype. Replace futimes with futimens.
2115
21162015-05-04  Max Filippov  <jcmvbkbc@gmail.com>
2117
2118	* addr2line.c (main): Drop mtrace() call and #include <mcheck.h>.
2119	* ar.c: Likewise.
2120	* ld.c: Likewise.
2121	* nm.c: Likewise.
2122	* objdump.c: Likewise.
2123	* ranlib.c: Likewise.
2124	* size.c: Likewise.
2125	* strip.c: Likewise.
2126	* unstrip.c: Likewise.
2127
21282015-05-04  Anthony G. Basile  <blueness@gentoo.org>
2129
2130	* Makefile.am (readelf_LDADD, nm_LDADD, size_LDADD, strip_LDADD)
2131	(ld_LDADD, elflint_LDADD, findtextrel_LDADD, addr2line_LDADD)
2132	(elfcmp_LDADD, objdump_LDADD, ranlib_LDADD, strings_LDADD)
2133	(ar_LDADD, unstrip_LDADD, stack_LDADD): Append $(argp_LDADD).
2134
21352015-03-22  Mark Wielaard  <mjw@redhat.com>
2136
2137	* readelf.c (print_debug_frame_section): Cast start to Dwarf_Off
2138	before subtracting cie_id. And cast cie_offset to Dwarf_Off before
2139	comparison.
2140
21412015-03-22  Mark Wielaard  <mjw@redhat.com>
2142
2143	* readelf.c (print_gdb_index_section): Check all offsets used
2144	against section d_size.
2145
21462015-03-17  Mark Wielaard  <mjw@redhat.com>
2147
2148	* readelf.c (print_debug): Don't return, but always use dummy_dbg.
2149
21502015-03-17  Mark Wielaard  <mjw@redhat.com>
2151
2152	* readelf.c (print_gdb_index_section): Add overflow checking for
2153	dataend checks.
2154
21552015-03-14  Mark Wielaard  <mjw@redhat.com>
2156
2157	* nm.c (INTERNAL_ERROR): Remove __DATE__.
2158	* objdump.c (INTERNAL_ERROR): Likewise.
2159	* size.c (INTERNAL_ERROR): Likewise.
2160	* strip.c (INTERNAL_ERROR): Likewise.
2161
21622015-03-18  Petr Machata  <pmachata@redhat.com>
2163
2164	* readelf.c (dwarf_tag_string, dwarf_attr_string)
2165	(dwarf_form_string, dwarf_lang_string, dwarf_inline_string)
2166	(dwarf_encoding_string, dwarf_access_string)
2167	(dwarf_visibility_string, dwarf_virtuality_string)
2168	(dwarf_identifier_case_string, dwarf_calling_convention_string)
2169	(dwarf_ordering_string, dwarf_discr_list_string)
2170	(dwarf_locexpr_opcode_string): Adjust uses of know-dwarf.h macros
2171	to match the API changes.
2172
21732015-03-09  Mark Wielaard  <mjw@redhat.com>
2174
2175	* elflint.c (compare_hash_gnu_hash): Correct gnu_symbias usage.
2176
21772015-01-03  Mark Wielaard  <mjw@redhat.com>
2178
2179	* elfcmp (main): Check section name is not NULL. Check sh_entsize
2180	is not zero for symbol tables. Check phdrs are not NULL.
2181	(search_for_copy_reloc): Check sh_entsize is not zero.
2182
21832014-12-30  Mark Wielaard  <mjw@redhat.com>
2184
2185	* elflint.c (check_scn_group): Check d_buf and name are not NULL.
2186	(is_rel_dyn): Check d is not NULL. Check shdr->sh_entsize is not
2187	zero.
2188	(check_dynamic): Check strshdr is not NULL. Check d_tag is positive.
2189	(check_symtab_shndx): Check symshdr and data->d_buf are not NULL.
2190	Check shdr and symshdr sh_entsize are not zero.
2191	(check_gnu_hash): Make sure maskidx is smaller than bitmask_words.
2192	Check symshdr->sh_entsize is not zero. Check data->d_buf is not
2193	NULL.
2194	(compare_hash_gnu_hash): Check sections d_buf are not NULL.
2195	Check section data is large enough. Use gnu_symbias.
2196	(check_group): Check section val is valid.
2197	(has_copy_reloc): Check sh_entsize is not zero.
2198	(check_versym): Likewise.
2199	(unknown_dependency_p): Likewise.
2200	(check_verneed): Break on invalid ref or offset. Don't assert.
2201	Report error when next offset is zero, but more vers expected.
2202	(check_verdef): Likewise.
2203	(check_attributes): Make sure d_buf is not NULL.
2204	(check_note): Likewise.
2205	(check_note_section): Likewise.
2206	(check_program_header): Make sure section name is not NULL.
2207
22082014-12-26  Mark Wielaard  <mjw@redhat.com>
2209
2210	* strings.c (read_elf): Produce error when section data falls outside
2211	file.
2212
22132014-12-26  Mark Wielaard  <mjw@redhat.com>
2214
2215	* nm.c (show_symbols): Guard against divide by zero in error check.
2216	Add section index number in error message.
2217
22182014-12-26  Mark Wielaard  <mjw@redhat.com>
2219
2220	* nm.c (handle_ar): Skip over /SYM64/ entries.
2221
22222014-12-26  Mark Wielaard  <mjw@redhat.com>
2223
2224	* nm.c (handle_ar): Break on arsym with invalid offset.
2225
22262014-12-20  Mark Wielaard  <mjw@redhat.com>
2227
2228	* readelf.c (print_debug_macinfo_section): Mark cus sentinel files
2229	as -1 non-existent. Check macoff against sentinel cus.
2230
22312014-12-20  Mark Wielaard  <mjw@redhat.com>
2232
2233	* readelf.c (print_debug_exception_table): Add max_action overflow
2234	check. Check action_table_end before reading slib128. Check
2235	max_ar_filter underflow.
2236
22372014-12-18  Ulrich Drepper  <drepper@gmail.com>
2238
2239	* Makefile.am: Suppress output of textrel_check command.
2240
22412014-12-17  Mark Wielaard  <mjw@redhat.com>
2242
2243	* readelf.c (print_cfa_program): Add bounds check before each op that
2244	takes at least one argument.
2245
22462014-12-16  Mark Wielaard  <mjw@redhat.com>
2247
2248	* readelf.c (print_decoded_line_section): Print dwarf_errmsg if
2249	dwarf_onesrcline or dwarf_linesrc fails.
2250
22512014-12-16  Mark Wielaard  <mjw@redhat.com>
2252
2253	* readelf.c (print_debug_line_section): Correct overflow check for
2254	unit_length.
2255	(print_debug_aranges_section): Correct overflow check for length.
2256
22572014-12-15  Mark Wielaard  <mjw@redhat.com>
2258
2259	* readelf.c (notice_listptr): Return false if offset doesn't fit
2260	in 61-bits.
2261	(attr_callback): Warn if loclist or rangelist offset doesn't fit.
2262
22632014-12-15  Mark Wielaard  <mjw@redhat.com>
2264
2265	* readelf.c (print_ops): Don't assert when addr_size or ref_size
2266	is not 4 or 8, just report invalid data.
2267
22682014-12-15  Mark Wielaard  <mjw@redhat.com>
2269
2270	* readelf.c (print_gdb_index_section): Add more bounds checks.
2271
22722014-12-15  Mark Wielaard  <mjw@redhat.com>
2273
2274	* readelf.c (print_debug_line_section): Check there is enough room
2275	for DW_LNE_set_address argument. Make sure there is enough room
2276	for the the initial unit_length.
2277
22782014-12-14  Mark Wielaard  <mjw@redhat.com>
2279
2280	* elflint.c (check_attributes): Call get_uleb128 with end pointer.
2281	* readelf.c (print_attributes): Likewise.
2282	(print_ops): Likewise and also for get_sleb128.
2283	(print_cfa_program): Likewise and add more readp bounds checks.
2284	(read_encoded): Likewise.
2285	(print_debug_frame_section): Likewise.
2286	(print_debug_line_section): Likewise.
2287	(print_debug_macinfo_section): Likewise.
2288	(print_debug_macro_section): Likewise.
2289	(print_debug_exception_table): Likewise.
2290
22912014-12-16  Mark Wielaard  <mjw@redhat.com>
2292
2293	* elfcmp.c (compare_Elf32_Word): Make sure (unsigned) Elf32_Word
2294	difference doesn't wrap around before returning as int.
2295
22962014-12-11  Mark Wielaard  <mjw@redhat.com>
2297
2298	* readelf.c (print_debug_exception_table): Check TType base offset
2299	and Action table are sane.
2300
23012014-12-11  Mark Wielaard  <mjw@redhat.com>
2302
2303	* readelf.c (print_debug_frame_section): Check number of augmentation
2304	chars to print.
2305
23062014-12-09  Mark Wielaard  <mjw@redhat.com>
2307
2308	* readelf.c (handle_file_note): Check count fits data section and
2309	doesn't overflow fptr.
2310
23112014-12-08  Mark Wielaard  <mjw@redhat.com>
2312
2313	* readelf.c (print_debug_exception_table): Report invalid data if
2314	action table doesn't immediately follow call site table.
2315
23162014-12-10  Josh Stone  <jistone@redhat.com>
2317
2318	* addr2line.c (get_diename): New, get linkage_name or name.
2319	* addr2line.c (print_dwarf_function): Use get_diename.
2320	* addr2line.c (handle_address): Likewise.
2321	* addr2line.c (print_diesym): Removed.
2322
23232014-12-10  Josh Stone  <jistone@redhat.com>
2324
2325	* addr2line.c (handle_address): Find the proper inline parents.
2326
23272014-12-07  Mark Wielaard  <mjw@redhat.com>
2328
2329	* readelf.c (print_debug_line_section): max_ops_per_instr cannot
2330	be zero.
2331
23322014-12-07  Mark Wielaard  <mjw@redhat.com>
2333
2334	* readelf.c (print_ops): Handle zero ref_size for DW_OP_call_ref
2335	and DW_OP_GNU_implicit_pointer.
2336
23372014-12-04  Mark Wielaard  <mjw@redhat.com>
2338
2339	* objdump.c (show_relocs_x): Make sure destshdr exists.
2340	(show_relocs_rel): Don't rely on shdr->sh_entsize, use gelf_fsize.
2341	(show_relocs_rela): Likewise.
2342	(show_relocs): Make sure destshdr, symshdr and symdata exists.
2343
23442014-11-30  Mark Wielaard  <mjw@redhat.com>
2345
2346	* readelf.c (handle_sysv_hash64): Fix overflow check.
2347
23482014-11-28  Mark Wielaard  <mjw@redhat.com>
2349
2350	* readelf.c (handle_relocs_rel): Don't reuse destshdr to store
2351	section header of a relocation against a STT_SECTION symbol. Use
2352	a new local variable secshdr.
2353	(handle_relocs_rela): Likewise.
2354
23552014-11-26  Mark Wielaard  <mjw@redhat.com>
2356
2357	* readelf.c (print_debug_aranges_section): Cast Dwarf_Word length
2358	to ptrdiff_t for comparison.
2359
23602014-11-24  Mark Wielaard  <mjw@redhat.com>
2361
2362	* readelf.c (print_debug_line_section): Check line_range is not zero
2363	before usage.
2364
23652014-11-23  Mark Wielaard  <mjw@redhat.com>
2366
2367	* readelf.c (print_debug_aranges_section): Check length to catch
2368	nexthdr overflow.
2369
23702014-11-21  Mark Wielaard  <mjw@redhat.com>
2371
2372	* readelf.c (print_attributes): Guard against empty section.
2373	Document attribute format. Break when vendor name isn't terminated.
2374	Add overflow check for subsection_len. Handle both gnu and non-gnu
2375	attribute tags.
2376
23772014-11-22  Mark Wielaard  <mjw@redhat.com>
2378
2379	* elflint.c (check_sections): Call ebl_bss_plt_p without ehdr.
2380	* findtextrel.c (process_file): Use elf_getphdrnum.
2381	* readelf.c (process_elf_file): Remove redundant ehdr->e_phoff check.
2382	(print_phdr): Check phnum.
2383	* size.c (show_segments): Use elf_getphdrnum.
2384	* strip.c (handle_elf): Likewise.
2385	* unstrip.c (copy_elf): Likewise.
2386	(copy_elided_sections): Likewise.
2387	(handle_file): Likewise.
2388
23892014-11-18  Mark Wielaard  <mjw@redhat.com>
2390
2391	* readelf.c (print_cfa_program): Fix sanity check of DW_FORM_block
2392	length.
2393
23942014-11-17  Mark Wielaard  <mjw@redhat.com>
2395
2396	* readelf.c (handle_verneed): Check vna_next and vn_next exist.
2397	(handle_verdef): Check vda_next and vd_next exist.
2398	(handle_versym): Check vd_next, vna_next and vn_next exist.
2399	Check vername and filename are not NULL before use.
2400
24012014-11-17  Mark Wielaard  <mjw@redhat.com>
2402
2403	* elfcmp.c (main): Check section names are NULL before use.
2404	* objdump.c (section_match): Likewise.
2405	* size.c (show_sysv): Likewise.
2406
24072014-11-17  Mark Wielaard  <mjw@redhat.com>
2408
2409	* readelf.c (print_debug_frame_section): Warn if ptr_size is not 4
2410	or 8 instead of just calling print_cfa_program.
2411
24122014-11-16  Mark Wielaard  <mjw@redhat.com>
2413
2414	* readelf (process_elf_file): Set phnum to zero if there aren't
2415	actually any pheaders.
2416	(print_phdr): Check there actually is a phdr.
2417
24182014-11-16  Mark Wielaard  <mjw@redhat.com>
2419
2420	* readelf.c (print_cfa_program): Check block len before calling
2421	print_ops.
2422
24232014-11-14  Mark Wielaard  <mjw@redhat.com>
2424
2425	* readelf.c (print_debug_frame_section): Sanity Check CIE
2426	unit_length and augmentationlen.
2427
24282014-11-14  Mark Wielaard  <mjw@redhat.com>
2429
2430	* readelf.c (handle_versym): Check def == NULL before use.
2431
24322014-11-08  Mark Wielaard  <mjw@redhat.com>
2433
2434	* readelf.c (handle_versym): Initialize vername and filename array
2435	elements.
2436
24372014-11-07  Mark Wielaard  <mjw@redhat.com>
2438
2439	* readelf.c (handle_sysv_hash): Sanity check section contents.
2440	(handle_sysv_hash64): Likewise.
2441	(handle_gnu_hash): Likewise.
2442
24432014-09-14  Petr Machata  <pmachata@redhat.com>
2444
2445	* readelf.c (handle_relocs_rela): Typo fix, test DESTSHDR properly.
2446
24472014-09-12  Petr Machata  <pmachata@redhat.com>
2448
2449	* readelf.c (encoded_ptr_size): In the switch statement, change
2450	magic constants 3 and 4 to DW_EH_PE_* counterparts.  Still accept
2451	0.  Print diagnostic for anything else.
2452
24532014-08-25  Josh Stone  <jistone@redhat.com>
2454
2455	* Makefile.am: Prevent premature @AR@ replacement in a sed expression.
2456
24572014-07-04  Menanteau Guy  <menantea@linux.vnet.ibm.com>
2458	    Mark Wielaard  <mjw@redhat.com>
2459
2460	* elflint (check_symtab): Add ".TOC." to the list of possibly
2461	dangling symbols because of sourceware PR13621.
2462
24632014-06-14  Mark Wielaard  <mjw@redhat.com>
2464
2465	* elflint (check_symtab): Use ebl_func_addr_mask on st_value.
2466
24672014-05-27  Mark Wielaard  <mjw@redhat.com>
2468
2469	* readelf.c (print_debug): Skip section if name is NULL.
2470
24712014-05-26  Mark Wielaard  <mjw@redhat.com>
2472
2473	* readelf.c (handle_relocs_rela): Print header like handle_relocs_rel
2474	does, when sh_info == 0.
2475
24762014-05-26  Mark Wielaard  <mjw@redhat.com>
2477
2478	* unstrip.c (find_alloc_sections_prelink): Allow non-split .bss
2479	section when sh_size of the original and undo .bss section are equal.
2480
24812014-05-26  Mark Wielaard  <mjw@redhat.com>
2482
2483	* unstrip.c (options): Add --force, -F.
2484	(struct arg_info): Add bool force.
2485	(parse_opt): Handle 'F', set force.
2486	(handle_explicit_files): Add force argument, add warn function,
2487	separate check ehdr field checks, use warn.
2488	(handle_dwfl_module): Add force argument, pass on to
2489	handle_explicit_files.
2490	(handle_output_dir_module): Add force argument, pass on to
2491	handle_dwfl_module.
2492	(handle_implicit_modules): Pass info->force to handle_dwfl_module and
2493	handle_output_dir_module.
2494	(main): Pass info.force to handle_explicit_files.
2495
24962014-05-19  Mark Wielaard  <mjw@redhat.com>
2497
2498	* elflint.c (check_reloc_shdr): Check ebl_check_reloc_target_type.
2499
25002014-05-01  Mark Wielaard  <mjw@redhat.com>
2501
2502	* readelf.c (find_no_debuginfo): Call dwfl_standard_find_debuginfo
2503	if looking for alternate debug file.
2504
25052014-04-11  Mark Wielaard  <mjw@redhat.com>
2506
2507	* Makefile.am (AM_CPPFLAGS): Add -I libdwelf.
2508
25092014-04-22  Mark Wielaard  <mjw@redhat.com>
2510
2511	* readelf.c (handle_core_item): Make sure variable length array
2512	contains at least enough space for terminating zero char.
2513
25142014-04-22  Mark Wielaard  <mjw@redhat.com>
2515
2516	* readelf.c (print_gdb_index_section): Use unsigned int for 31 bits
2517	left shift.
2518
25192014-03-13  Mark Wielaard  <mjw@redhat.com>
2520
2521	* Makefile.am: Remove no_mudflap.os. Remove libmudflap from all
2522	LDADD lines.
2523	* strings.c (process_chunk): Remove _MUDFLAP condition.
2524
25252014-04-09  Mark Wielaard  <mjw@redhat.com>
2526
2527	* readelf.c (print_debug_aranges_section): Don't get the raw section
2528	data, use the possibly decompressed .[z]debug sectiondata.
2529	(print_debug_ranges_section): Likewise.
2530	(print_debug_frame_section): Likewise.
2531	(print_debug_line_section): Likewise.
2532	(print_debug_loc_section): Likewise.
2533	(print_debug_macinfo_section): Likewise.
2534	(print_debug_macro_section): Likewise.
2535
25362014-04-10  Mark Wielaard  <mjw@redhat.com>
2537
2538	* readelf.c (buf_read_ulong): Pass actual long size to convert.
2539
25402014-03-05  Mark Wielaard  <mjw@redhat.com>
2541
2542	* readelf.c (attr_callback): Print DW_FORM_sdata values as signed
2543	numbers.
2544
25452014-02-24  Mark Wielaard  <mjw@redhat.com>
2546
2547	* readelf (print_phdr): Check there is a SHT_PROGBITS section at the
2548	offset given by p_offsets for a PT_INTERP segment before trying to
2549	display the interpreter string.
2550
25512014-02-07  Mark Wielaard  <mjw@redhat.com>
2552
2553	* readelf.c (print_phdr): Check phdr->p_filesz and make sure
2554	interpreter string is zero terminated before calling printf.
2555
25562014-01-22  Mark Wielaard  <mjw@redhat.com>
2557
2558	* Makefile.am (nm_no_Wformat): Removed.
2559	(size_no_Wformat): Likewise.
2560	(strings_no_Wformat): Likewise.
2561	(addr2line_no_Wformat): Likewise.
2562	* size.c (show_sysv): Use fmtstr directly as literal in printf.
2563	(show_sysv_one_line): Likewise.
2564	* strings.c (locfmt): Removed.
2565	(radix): New static enum.
2566	(parse_opt): Set radix, not locfmt.
2567	(process_chunk_mb): Use fmtstr directly as literal in printf based
2568	on radix.
2569	(process_chunk): Likewise.
2570	* nm.c (show_symbols_sysv): Use fmtstr directly as literal in printf.
2571	(show_symbols_bsd): Likewise.
2572	(show_symbols_posix): Likewise.
2573
25742014-01-21  Mark Wielaard  <mjw@redhat.com>
2575
2576	* stack.c (show_inlines): New static boolean.
2577	(print_frame): New function split out from...
2578	(print_frames): ..here. If show_inlines is true and we found a
2579	DIE for the frame address, call print_inline_frames otherwise
2580	call print_frame. Keep track of and track frame_nr.
2581	(print_inline_frames): New function.
2582	(parse_opt): Handle '-i'.
2583	(main): Add 'i' to options.
2584
25852014-01-27  Mark Wielaard  <mjw@redhat.com>
2586
2587	* stack.c (maxframes): Initialize to 256.
2588	(main): Document new default in options. Document magic number
2589	used in frames.allocated initialization.
2590
25912014-01-20  Mark Wielaard  <mjw@redhat.com>
2592
2593	* stack.c (show_debugname): New static boolean.
2594	(die_name): New function.
2595	(print_frames): If show_debugname is true set symname to the
2596	first function-like DIE with a name in scope for the address in
2597	the debuginfo.
2598	(parse_opt): Handle '-d'.
2599	(main): Add 'd' to options.
2600
26012014-01-20  Mark Wielaard  <mjw@redhat.com>
2602
2603	* addr2line.c (handle_address): Initialize scopes to NULL.
2604
26052014-01-17  Roland McGrath  <roland@redhat.com>
2606
2607	* strip.c (handle_elf): Check for bogus values in sh_link, sh_info,
2608	st_shndx, e_shstrndx, and SHT_GROUP or SHT_SYMTAB_SHNDX data.
2609	Don't use assert on input values, instead bail with "illformed" error.
2610
26112014-01-17  Roland McGrath  <roland@redhat.com>
2612
2613	* readelf.c (handle_dynamic, handle_symtab): Check for bogus sh_link.
2614	(handle_verneed, handle_verdef, handle_versym, handle_hash): Likewise.
2615	(handle_scngrp): Check for bogus sh_info.
2616
26172014-01-17  Jakub Jelinek  <jakub@redhat.com>
2618
2619	* elflint.c (section_name): Return "<invalid>" instead of
2620	crashing on invalid section name.
2621	(check_symtab, is_rel_dyn, check_rela, check_rel, check_dynamic,
2622	check_symtab_shndx, check_hash, check_versym): Robustify.
2623	(check_hash): Don't check entries beyond end of section.
2624	(check_note): Don't crash if gelf_rawchunk fails.
2625
26262014-01-17  Petr Machata  <pmachata@redhat.com>
2627
2628	* readelf.c (handle_dynamic, handle_relocs_rel)
2629	(handle_relocs_rela, handle_versym, print_liblist):
2630	Use gelf_fsize instead of relying on shdr->sh_entsize.
2631
26322014-01-14  Mark Wielaard  <mjw@redhat.com>
2633
2634	* readelf.c (print_debug_macro_section): Clear vendor array before
2635	use.
2636
26372014-01-15  Jan Kratochvil  <jan.kratochvil@redhat.com>
2638
2639	Fix corruption of non-C++ symbols by the demangler.
2640	* nm.c (show_symbols_sysv, show_symbols_bsd, show_symbols_posix)
2641	(show_symbols): Check for _Z.
2642	* stack.c (print_frames) <USE_DEMANGLE>: Check for _Z.
2643
26442014-01-02  Mark Wielaard  <mjw@redhat.com>
2645
2646	* stack.c (show_raw): Declare unconditionally.
2647	(parse_opt): Handle '-r' unconditionally.
2648	(main): Show "raw" option even without USE_DEMANGLE.
2649
26502014-01-02  Mark Wielaard  <mjw@redhat.com>
2651
2652	* stack.c (print_frames): Print 0x before build-id hex-offset.
2653
26542014-01-02  Mark Wielaard  <mjw@redhat.com>
2655
2656	* stack.c (maxframes): Increase to 2048.
2657	(struct frames): Add allocated field.
2658	(frame_callback): If frames used is frames allocated, realloc.
2659	(print_frames): Show an error if maxframes has been reached.
2660	(parse_opt): Allow -n 0 for unlimited frames.
2661	(main): Document -n 0 and new default 2048 frames. Allocate initial
2662	number of frames with malloc.
2663
26642013-12-30  Mark Wielaard  <mjw@redhat.com>
2665
2666	* stack.c (parse_opt): Explicitly call dwfl_linux_proc_attach
2667	or dwfl_core_file_attach and check for errors.
2668
26692013-12-28  Mark Wielaard  <mjw@redhat.com>
2670
2671	* stack.c (print_frames): Remove address width code and use...
2672	(get_addr_width): ...this new function.
2673	(show_modules): New static boolean.
2674	(module_callback): New static function.
2675	(parse_opt): Handle '-l'.
2676	(main): Add 'l' to options. If show_modules then use dwfl_getmodules
2677	with module_callback to show all detected modules and possible
2678	build_id, elf and dwarf files.
2679
26802013-12-27  Mark Wielaard  <mjw@redhat.com>
2681
2682	* stack.c (frames_shown): New static boolean.
2683	(EXIT_OK,EXIT_ERROR,EXIT_BAD,EXIT_USAGES): New defines.
2684	(frame_callback): Return -1 on error. Don't print error.
2685	(print_frames): Add arguments, tid, dwflerr and what. Print tid.
2686	If there was an error report it with address and module if possible.
2687	Record whether any frames were actually printed.
2688	(thread_callback): Collect tid and err, pass it to print_frames.
2689	(parse_opt): Use EXIT_BAD for errors. On ARGP_KEY_END print errno
2690	if dwfl_linux_proc_report returned it. Check whether we are properly
2691	attached with dwfl_pid.
2692	(main): Document exit status. Don't report DWARF_CB_ABORT from
2693	callbacks as error. Pass real errors to print_frames. Return
2694	EXIT_BAD if no frames could be shown. Return EXIT_ERROR if there
2695	were any non-fatal errors.
2696
26972013-12-23  Mark Wielaard  <mjw@redhat.com>
2698
2699	* Makefile.am (stack_LDADD): Add demanglelib.
2700	* stack.c (show_quiet): New static boolean, default false.
2701	(show_raw): Likewise.
2702	(demangle_buffer_len): New static size_t.
2703	(demangle_buffer): New static char *.
2704	(print_frames): Don't resolve pc name if show_quiet. Demangle name
2705	unless show_raw.
2706	(parse_opt): Handle '-q' and '-r'.
2707	(main): Add 'q' and 'r' to options. Free demangle_buffer.
2708
27092013-12-23  Mark Wielaard  <mjw@redhat.com>
2710
2711	* stack.c (OPT_DEBUGINFO): New define.
2712	(OPT_COREFILE): Likewise.
2713	(pid): New static.
2714	(core_fd): Likewise.
2715	(core): Likewise.
2716	(exec): Likewise.
2717	(debuginfo_path): Likewise.
2718	(parse_opt): Handle '-p', '--core', '-e' and '--debuginfo-path'.
2719	Do argument sanity checking. Setup Dwfl.
2720	(main): Add 'p', 'core', 'e' and 'debuginfo-path' to options.
2721	Remove argp_child children, simplify argp doc, remove custom
2722	usage message and construction of dwfl with dwfl_standard_argp.
2723	Use pid directly as tid. close core and core_fd if opened. Print
2724	pid of process or core.
2725
27262013-12-23  Mark Wielaard  <mjw@redhat.com>
2727
2728	* stack.c (show_build_id): New static boolean.
2729	(print_frames): Print module build-id, load address and pc offset
2730	if show_build_id is true.
2731	(parse_opt): Handle '-b'.
2732	(main): Add -b to options.
2733
27342013-12-22  Mark Wielaard  <mjw@redhat.com>
2735
2736	* stack.c (maxframes): New static unsigned. Initialize to 64.
2737	(struct frame): New struct.
2738	(struct frames): Likewise.
2739	(dwfl): New static Dwfl pointer.
2740	(frame_callback): Use arg as struct frames and fill it next frame.
2741	Return DWARF_CB_ABORT when maxframes has been reached. Move
2742	printing of frame to...
2743	(print_frames): ...here. New function.
2744	(thread_callback): Use arg as struct frames and set frames to zero.
2745	Call print_frames.
2746	(parse_opt): Handle '-n'.
2747	(main): Add -n to options. Allocate frames using maxframes. Pass
2748	frames to frame_callback and thread_callback.
2749
27502013-12-20  Mark Wielaard  <mjw@redhat.com>
2751
2752	* stack.c (show_one_tid): New static boolean.
2753	(parse_opt): Handle '-1'.
2754	(main): Add -1 to options. Call dwfl_getthread_frames when
2755	show_one_tid is true.
2756
27572013-12-18  Mark Wielaard  <mjw@redhat.com>
2758
2759	* addr2line.c (options): Add symbol-sections, 'x'.
2760	(show_symbol_sections): New static bool.
2761	(parse_opt): Handle 'x'.
2762	(print_addrsym): Use dwfl_module_addrinfo value.r
2763	Also show section of address with show_symbol_sections.
2764	(find_symbol): Use dwfl_module_getsym_info and set value.
2765	(handle_address): Request value and use it instead of sym.st_value.
2766	* readelf.c (format_dwarf_addr): Use dwfl_module_addrinfo to get
2767	name and offset.
2768
27692013-12-17  Masatake YAMATO  <yamato@redhat.com>
2770	    Mark Wielaard  <mjw@redhat.com>
2771
2772	* stack.c (show_activation, show_module, show_source): New variables.
2773	(parse_opt): Set show_activation if -a option is given.
2774	Set show_module if -m option is given. Set show_source if -s option
2775	is given. Set all show booleans when -v option is given.
2776	(main): Added `-a', `-m', `-s', and `-v' to the help message.
2777	(frame_callback): Print module and source file information.
2778
27792013-11-25  Petr Machata  <pmachata@redhat.com>
2780
2781	* elflint.c (valid_e_machine): Add EM_AARCH64.
2782
27832013-11-14  Petr Machata  <pmachata@redhat.com>
2784
2785	* readelf.c (handle_core_item) <'h'>: New branch for handling
2786	fields that shouldn't be displayed.
2787
27882013-11-10  Mark Wielaard  <mjw@redhat.com>
2789
2790	* stack.c: Use ARGP_PROGRAM_VERSION_HOOK_DEF and
2791	ARGP_PROGRAM_BUG_ADDRESS_DEF.
2792	(print_version): New function.
2793
27942013-11-09  Mark Wielaard  <mjw@redhat.com>
2795
2796	* arlib.c (arlib_init): Call snprintf before using the result
2797	with memcpy.
2798	(arlib_finalize): Likewise.
2799	* nm.c (show_symbols_sysv): Don't modify cnt inside assert.
2800
28012013-11-07  Jan Kratochvil  <jan.kratochvil@redhat.com>
2802
2803	* Makefile.am (bin_PROGRAMS): Add stack.
2804	(stack_LDADD): New.
2805	* stack.c: New file.
2806
28072013-11-05  Mark Wielaard  <mjw@redhat.com>
2808
2809	* readelf.c (print_debug_ranges_section): Cast address to size_t
2810	before comparison.
2811	(print_debug_loc_section): Likewise.
2812
28132013-10-18  Mark Wielaard  <mjw@redhat.com>
2814
2815	* ar.c (main): Correct operation check when instance_specifed is set.
2816
28172013-09-26  Petr Machata  <pmachata@redhat.com>
2818
2819	* readelf.c (handle_file_note): New function.
2820	(handle_notes_data): Call it to handle NT_FILE notes.
2821
28222013-09-26  Petr Machata  <pmachata@redhat.com>
2823
2824	* readelf.c (handle_siginfo_note): New function.
2825	(handle_notes_data): Call it to handle NT_SIGINFO notes.
2826	(buf_read_int, buf_read_ulong, buf_has_data): New functions.
2827
28282013-08-13  Mark Wielaard  <mjw@redhat.com>
2829
2830	* addr2line.c (options): Add "inlines", 'i'.
2831	(show_inlines): New bool.
2832	(parse_opt): Handle 'i'.
2833	(print_diesym): New static function.
2834	(print_src): New function taking code from...
2835	(handle_address): here. Call print_src. Print inlines.
2836
28372013-08-12  Mark Wielaard  <mjw@redhat.com>
2838
2839	* addr2line.c (main): If there is a newline char at end of buf,
2840	then remove it.
2841
28422013-07-05  Mark Wielaard  <mjw@redhat.com>
2843
2844	* readelf.c (print_ops): Take CU as argument, use it to print
2845	parameter_ref DIE offset.
2846	(struct listptr): Replace base field with cu.
2847	(listptr_base): New function.
2848	(compare_listptr): Use listptr_base.
2849	(notice_listptr): Take CU as argument.
2850	(skip_listptr_hole): Likewise.
2851	(print_debug_ranges_section): Pass NULL as CU to skip_listptr_hole.
2852	(print_cfa_program): Pass NULL as CU to print_ops.
2853	(struct attrcb_args): Replace cu_base field with cu.
2854	(attr_callback): Pass cu not cu_base to notice_listptr.
2855	(print_debug_units): Don't calculate base, just set cu.
2856	(print_debug_loc_section): Pass cu to skip_listptr_hole and
2857	print_ops.
2858
28592013-05-06  Mark Wielaard  <mjw@redhat.com>
2860
2861	* readelf.c (print_ops): Format first DW_OP_GNU_implicit_pointer
2862	argument as DIE offset.
2863
28642013-04-24  Mark Wielaard  <mjw@redhat.com>
2865
2866	* Makefile.am: Use AM_CPPFLAGS instead of INCLUDES.
2867
28682013-03-25  Mark Wielaard  <mjw@redhat.com>
2869
2870	* readelf.c (argp_options): Add decodedline.
2871	(decodedline): New boolean initialized to false.
2872	(parse_opt): Set decodedline when arg is decodedline.
2873	(print_decoded_line_section): New function.
2874	(print_debug_line_section): Call print_decoded_line_section when
2875	decodedline is true.
2876
28772013-03-25  Mark Wielaard  <mjw@redhat.com>
2878
2879	* readelf.c (argp_option): Add decodedaranges.
2880	(decodedaranges): New boolean initialized to false.
2881	(parse_opt): Set decodedaranges when arg is decodedaranges.
2882	(print_debug_aranges_section): Reimplemented and original
2883	implementation renamed to...
2884	(print_decoded_aranges_section): this.
2885
28862013-03-25  Mark Wielaard  <mjw@redhat.com>
2887
2888	* readelf.c (attrcb_args): Add Dwarf_Die.
2889	(attr_callback): When highpc is in constant form also print as
2890	address.
2891	(print_debug_units): Set args.die.
2892
28932013-03-19  Mark Wielaard  <mjw@redhat.com>
2894
2895	* readelf.c (print_gdb_index_section): Free format_dwarf_addr results.
2896
28972013-03-18  Mark Wielaard  <mjw@redhat.com>
2898
2899	* readelf.c (print_gdb_index_section): Accept version 8.
2900
29012013-03-01  Mark Wielaard  <mjw@redhat.com>
2902
2903	* findtextrel.c (process_file): Release ELF and close file when not
2904	text relocations are found.
2905	* strip.c (handle_elf): Track memory used for .debuglink section data
2906	and free when done.
2907
29082013-02-24  Mark Wielaard  <mjw@redhat.com>
2909
2910	* elflint.c (check_symtab): Add __bss_start__ to the list of symbols
2911	allowed to have out of section values because of GNU ld bugs.
2912
29132013-02-06  Mark Wielaard  <mjw@redhat.com>
2914
2915	* elflint.c (check_symtab): Add __bss_start and __TMC_END__ to the
2916	list of symbols allowed to have out of section values because of
2917	GNU ld bugs in either .symtab or .dynsym, but only when they are
2918	zero sized.
2919
29202013-01-24  Mark Wielaard  <mjw@redhat.com>
2921
2922	* readelf.c (argp_option): Add unresolved-address-offsets, U.
2923	(print_unresolved_addresses): New static.
2924	(parse_opt): Handle 'U', set print_unprocessed_values.
2925	(format_dwarf_addr): Take and handle new raw argument.
2926	(print_ops): Call format_dwarf_addr with raw offset values.
2927	(print_debug_ranges_section): Likewise.
2928	(print_debug_frame_section): Likewise.
2929	(attr_callback): Likewise.
2930	(print_debug_line_section): Likewise.
2931	(print_debug_loc_section): Likewise.
2932	(print_gdb_index_section): Likewise.
2933
29342013-01-18  Mark Wielaard  <mjw@redhat.com>
2935
2936	* readelf.c (struct listptr): Add base Dwarf_Addr field.
2937	(compare_listptr): Warn for same offset with different base.
2938	(notice_listptr): Take base argument and set it.
2939	(skip_listptr_hole): Likewise.
2940	(struct attrcb_args): Removed unused cu_offset field.
2941	Add cu_base Dwarf_Addr field.
2942	(attr_callback): Call notice_listptr with cbargs->cu_base.
2943	(print_debug_units): Set args.cu_base.
2944	(print_debug_ranges_section): Get base and use for format_dwarf_addr.
2945	(print_debug_loc_section): Likewise.
2946
29472013-01-29  Jan Kratochvil  <jan.kratochvil@redhat.com>
2948
2949	* readelf.c (handle_core_items): Limit special repeated items handling
2950	to single-item formats '\n', 'b' and 'B', assert OFFSET 0 there.
2951
29522012-12-18  Mark Wielaard  <mark@bordewijk.wildebeest.org>
2953
2954	* readelf.c (ELF_INPUT_SECTION): New argp key value.
2955	(argp_option): Add elf-section.
2956	(elf_input_section): New static.
2957	(parse_opt): Handle ELF_INPUT_SECTION and set elf_input_section.
2958	(open_input_section): New function.
2959	(process_file): Call open_input_section if elf_input_section set.
2960
29612013-01-13  David Abdurachmanov  <David.Abdurachmanov@cern.ch>
2962
2963	ar.c (do_oper_delete): Fix num passed to memset.
2964
29652012-12-21  Mark Wielaard  <mjw@redhat.com>
2966
2967	* readelf.c (print_debug_frame_section): Adjust FDE start address
2968	if pcrel before feeding it to format_dwarf_addr.
2969
29702012-12-21  Mark Wielaard  <mjw@redhat.com>
2971
2972	* addr2line.c (main): Call dwfl_end.
2973
29742012-12-11  Roland McGrath  <roland@hack.frob.com>
2975
2976	* nm.c (show_symbols_sysv): Fix size passed to snprintf for invalid
2977	sh_name case.
2978	Reported by David Abdurachmanov <David.Abdurachmanov@cern.ch>.
2979
29802012-10-16  Mark Wielaard  <mjw@redhat.com>
2981
2982	* readelf.c (print_ops): DW_OP_skip and DW_OP_bra targets are
2983	calculated beginning after the operand and 2-byte constant.
2984
29852012-10-12  Jan Kratochvil  <jan.kratochvil@redhat.com>
2986
2987	* readelf.c (ITEM_WRAP_COLUMN, REGISTER_WRAP_COLUMN): Merge to ...
2988	(WRAP_COLUMN): ... here.
2989	(print_core_item): Remove parameter format_max.  Update function
2990	comment.  Replace FORMAT_MAX by the real output width.
2991	(handle_core_item): Remove the FORMAT_MAX values in TYPES, DO_TYPE,
2992	calls of print_core_item, remove variable maxfmt, change
2993	ITEM_WRAP_COLUMN to WRAP_COLUMN.
2994	(handle_core_register): Remove the FORMAT_MAX values in TYPES, BITS,
2995	calls of print_core_item, change REGISTER_WRAP_COLUMN to WRAP_COLUMN.
2996
29972012-10-11  Jan Kratochvil  <jan.kratochvil@redhat.com>
2998
2999	* readelf.c (handle_core_item) <b>: Make run an outer block variable.
3000	Increase run only if LASTBIT != 0.  Print last element only if RUN > 0.
3001
30022012-08-27  Mark Wielaard  <mjw@redhat.com>
3003
3004	* readelf.c (print_debug_macro_section): Print offset as PRIx64.
3005
30062012-08-27  Mark Wielaard  <mjw@redhat.com>
3007
3008	* readelf.c (register_info): Handle loc == NULL.
3009
30102012-08-22  Jeff Kenton  <jkenton@tilera.com>
3011
3012	* elflint.c (valid_e_machine): Add EM_TILEGX and EM_TILEPRO.
3013
30142012-08-16  Mark Wielaard  <mjw@redhat.com>
3015
3016	* readelf.c (dwarf_tag_name): Renamed from dwarf_tag_string.
3017	Uses new dwarf_tag_string or adds ??? or lo_user+%#x when
3018	appropriate.
3019	(dwarf_attr_name): Likewise.
3020	(dwarf_form_name): Likewise.
3021	(dwarf_lang_name): Likewise.
3022	(dwarf_inline_name): Likewise.
3023	(dwarf_encoding_name): Likewise.
3024	(dwarf_access_name): Likewise.
3025	(dwarf_visibility_name): Likewise.
3026	(dwarf_virtuality_name): Likewise.
3027	(dwarf_identifier_case_name): Likewise.
3028	(dwarf_calling_convention_name): Likewise.
3029	(dwarf_ordering_name): Likewise.
3030	(dwarf_discr_list_name): Likewise.
3031	(print_ops): Remove KNOWN.  Use dwarf_locexpr_opcode_string.
3032	(attr_callback): Call new dwarf_foobar_name instead of old
3033	dwarf_foobar_string functions.
3034	(dwarf_tag_string): New function using known-dwarf.h macros.
3035	(dwarf_attr_string): Likewise.
3036	(dwarf_form_string): Likewise.
3037	(dwarf_lang_string): Likewise.
3038	(dwarf_inline_string): Likewise.
3039	(dwarf_encoding_string): Likewise.
3040	(dwarf_access_string): Likewise.
3041	(dwarf_visibility_string): Likewise.
3042	(dwarf_virtuality_string): Likewise.
3043	(dwarf_identifier_case_string): Likewise.
3044	(dwarf_calling_convention_string): Likewise.
3045	(dwarf_ordering_string): Likewise.
3046	(dwarf_discr_list_string): Likewise.
3047	(dwarf_locexpr_opcode_string): Likewise.
3048
30492012-06-27  Mark Wielaard  <mjw@redhat.com>
3050
3051	* readelf.c (dwarf_form_string): Handle DW_FORM_GNU_ref_alt and
3052	DW_FORM_GNU_strp_alt.
3053	(attr_callback): Likewise.
3054
30552012-07-30  Petr Machata  <pmachata@redhat.com>
3056
3057	* nm.c (show_symbols_bsd): Reorder arguments in {S,}FMTSTRS (and
3058	corresponding printf) so that those that are referenced by only
3059	one of the formatting strings are at the end.
3060
30612012-07-29  Mark Wielaard  <mjw@redhat.com>
3062
3063	* readelf.c (dwarf_lang_string): Use DW_LANG_ObjC, not DW_LANG_Objc.
3064	(print_ops): Use known[op], not op_name, for DW_OP_GNU_parameter_ref.
3065
30662012-07-19  Mark Wielaard  <mjw@redhat.com>
3067
3068	* readelf.c (print_ops): Handle DW_OP_GNU_parameter_ref.
3069
30702012-07-11  Mark Wielaard  <mjw@redhat.com>
3071
3072	* readelf.c (options): Add macro to help of debug-dump.
3073	(section_e): Add section_macro.
3074	(section_all): Add section_macro.
3075	(parse_opt): Handle macro.
3076	(print_debug_macro_section): New function.
3077	(print_debug): Add NEW_SECTION (macro).
3078
30792012-07-10  Mark Wielaard  <mjw@redhat.com>
3080
3081	* readelf.c (print_gdb_index_section): Add version 7 support.
3082	Keep track of cu_nr. Print kind and static/global flag for each
3083	symbol. When a symbol is in the TU list add 'T'.
3084
30852012-06-26  Mark Wielaard  <mjw@redhat.com>
3086
3087	* readelf.c (dwarf_attr_string): Add DW_AT_GNU_macros.
3088
30892012-06-22  Mark Wielaard  <mjw@redhat.com>
3090
3091	* readelf.c (print_ops): Cast printf PRIu/x64 arguments to uint64_t
3092	for gcc 4.7 -Wformat.
3093
30942012-05-09  Roland McGrath  <roland@hack.frob.com>
3095
3096	* elflint (check_sections): Allow zero sized sections at (filesz) end
3097	of segment. And make check overflow-proofed.
3098
30992012-04-24  Mark Wielaard  <mjw@redhat.com>
3100
3101	* readelf.c (print_ops): Add DW_OP_GNU_push_tls_address,
3102	DW_OP_GNU_uinit and DW_OP_GNU_encoded_addr.
3103
31042012-03-28  Roland McGrath  <roland@hack.frob.com>
3105
3106	* elflint.c (special_sections): Accept SHF_INFO_LINK for reloc sections.
3107
31082012-03-28  Mark Wielaard  <mjw@redhat.com>
3109
3110	* readelf.c (print_debug_abbrev_section): Check there is Dwarf
3111	section data.
3112	(print_debug_str_section): Likewise.
3113
31142012-03-21  Mark Wielaard  <mjw@redhat.com>
3115
3116	* readelf.c (print_gdb_index_section): Accept version 6.
3117
31182012-01-31  Mark Wielaard  <mjw@redhat.com>
3119
3120	* readelf.c (attr_callback): Don't special case DW_FORM_sec_offset.
3121
31222012-01-21  Ulrich Drepper  <drepper@gmail.com>
3123
3124	* addr2line.c: Update copyright year.
3125	* ar.c: Likewise.
3126	* elfcmp.c: Likewise.
3127	* elflint.c: Likewise.
3128	* findtextrel.c: Likewise.
3129	* ld.c: Likewise.
3130	* nm.c: Likewise.
3131	* objdump.c: Likewise.
3132	* ranlib.c: Likewise.
3133	* readelf.c: Likewise.
3134	* size.c: Likewise.
3135	* strings.c: Likewise.
3136	* strip.c: Likewise.
3137	* unstrip.c: Likewise.
3138
3139	* nm.c (argp_children): Define.
3140	(argp): Hook up argp_children.
3141	(handle_ar): Optimize puts call.
3142	(show_symbols_bsd): Use positional parameters to also print color
3143	codes.  Don't print STT_FILE symbols.
3144	* objdump.c (options): Improve help text.
3145	(argp_children): Define.
3146	(argp): Hook up argp_children.
3147	(disasm_info): Add elements for color codes.
3148	(disasm_output): Print color codes as well.
3149	(show_disasm): Set up disasm_info data for callback.
3150
31512012-01-20  Roland McGrath  <roland@hack.frob.com>
3152
3153	* arlib-argp.c (arlib_deterministic_output): Initialize from
3154	configured value.
3155	(help_filter): New function.
3156	(argp): Use it.
3157
3158	* ar.c (main): Handle oper_none as usage error.
3159
3160	* arlib-argp.c (options, parse_opt): Grok -U as inverse of -D.
3161
3162	* ranlib.c (argp): Use arlib_argp_children.
3163
3164	* arlib.c (arlib_init): Obey arlib_deterministic_output.
3165
3166	* arlib-argp.c: New file.
3167	* Makefile.am (libar_a_SOURCES): Add it.
3168	* arlib.h (arlib_deterministic_output, arlib_argp_children):
3169	Declare new variables.
3170	* ar.c (deterministic_output): Variable removed.
3171	(do_oper_insert): Use arlib_deterministic_output instead.
3172	(options, parse_opt): Don't handle -D here.  Add group numbers.
3173	(argp): Use arlib_argp_children.
3174
31752011-12-20  Roland McGrath  <roland@hack.frob.com>
3176
3177	* readelf.c (print_debug): Initialize DUMMY_DBG.elf.
3178	Reported by Karel Klic <kklic@redhat.com>.
3179
31802011-11-05  Roland McGrath  <roland@hack.frob.com>
3181
3182	* ar.c (deterministic_output): New flag variable.
3183	(options, parse_opt): Grok -D to set it.
3184	(do_oper_insert): When set, use zero from mtime, uid, and gid.
3185
3186	* ar.c (do_oper_insert): Fix check on elf_rawfile return value.
3187
31882011-10-04  Marek Polacek  <mpolacek@redhat.com>
3189
3190	* readelf.c (register_info): Assume the right size of an array.
3191
31922011-10-03  Ulrich Drepper  <drepper@gmail.com>
3193
3194	* nm.c: Recognize option --mark-special.  Still recognize --mark-weak
3195	but don't show it in help anymore.
3196	(mark_special): Renamed from mark_weak.
3197	(parse_opt): Adjust.
3198	(class_type_char): Take additional parameters for ELF file and ELF
3199	header.  Treat TLS symbols like objects.
3200	In case of D symbols, show u for unique symbols, R for symbols in
3201	read-only sections, B for symbols in BSS sections.
3202	(show_symbols_bsd): Take additional parameters for ELF file and ELF
3203	header.  Adjust for class_type_char change.  Show TLS symbols with
3204	@ after them in case --mark-special is selected.
3205	(show_symbols_posix): Likewise.
3206	(show_symbols): Adjust calls to show_symbols_bsd and
3207	show_symbols_posix.
3208	(show_symbols_sysv): Avoid printing address and size for undefined
3209	symbols.  Don't print initial special entry and section entries.
3210
32112011-10-02  Ulrich Drepper  <drepper@gmail.com>
3212
3213	* Makefile.am (demanglelib): Define.
3214	(nm_LDADD): Add demanglelib.
3215	* nm.c (options): Add -C option.
3216	(demangle): Define as global variable.
3217	(parse_opt): Recognize -C.
3218	(show_symbols_sysv): Handle demangling.
3219	(show_symbols_bad): Likewise.
3220	(show_symbols_posix): Likewise.
3221	(show_symbols): Likewise.
3222
32232011-07-09  Roland McGrath  <roland@hack.frob.com>
3224
3225	* readelf.c (options, parse_opt): Grok -W/--wide and ignore it.
3226
3227	* ar.c (parse_opt): Grok -u.
3228
32292011-05-30  Mark Wielaard  <mjw@redhat.com>
3230
3231	* strip.c (relocate): Make offset check overflow-proof.
3232
32332011-05-23  Mark Wielaard  <mjw@redhat.com>
3234
3235	* strip.c (relocate): Take new arguments is_rela to indicate
3236	whether the relocation is from a SHT_REL or SHT_RELA section.
3237	Relocate against any debug section symbol, not just STT_SECTION
3238	symbols. For SHT_REL relocations, fetch addend from offset and
3239	add it to symbol value if not zero.
3240
32412011-05-23  Mark Wielaard  <mjw@redhat.com>
3242
3243	* strip.c (OPT_RELOC_DEBUG): New option.
3244	(argp_option): Add new --reloc-debug-sections option.
3245	(main): Check new option.
3246	(parse_opt): Likewise.
3247	(handle_elf): Remove any relocations between debug sections
3248	in ET_REL for the debug file when requested.
3249
32502011-05-18  Mark Wielaard  <mjw@redhat.com>
3251
3252	* strip.c (handle_elf): Make sure all sections of a removed group
3253	section are removed too. Don't discard SHT_GROUP sections, copy
3254	section table before it gets modified. Section group signature
3255	symbols don't have to be retained.
3256
32572011-05-16  Jakub Jelinek  <jakub@redhat.com>
3258
3259	* readelf.c (print_ops): Handle DW_OP_GNU_const_type,
3260	DW_OP_GNU_regval_type, DW_OP_GNU_deref_type, DW_OP_GNU_convert
3261	and DW_OP_GNU_reinterpret.
3262
32632011-05-17  Mark Wielaard  <mjw@redhat.com>
3264
3265	* readelf.c (dwarf_tag_string): Fixup DW_TAG_GNU_call_site and
3266	DW_TAG_GNU_call_site_parameter return strings.
3267
32682011-05-11  Marek Polacek  <mpolacek@redhat.com>
3269
3270	* nm.c (show_symbols_sysv): Remove unused if/else, remove
3271	unused `prefix' and `fname' parameters.
3272
32732011-05-07  Marek Polacek  <mpolacek@redhat.com>
3274
3275	* unstrip.c (compare_sections_nonrel): Mark this function as static.
3276
32772011-04-26  Mark Wielaard  <mjw@redhat.com>
3278
3279	* readelf.c (handle_notes_data): Call ebl_object_note_type_name
3280	with note name.
3281
32822011-04-14  Mark Wielaard  <mjw@redhat.com>
3283
3284	* readelf.c (options): Add gdb_index.
3285	(section_e): Define section_gdb_index.
3286	(parse_opt): Recognize gdb_index debug-dump argument.
3287	(print_gdb_index_section): New function.
3288	(print_debug): Add gdb_index to debug_sections.
3289
32902011-03-24  Petr Machata  <pmachata@redhat.com>
3291
3292	* readelf.c (print_debug_line_section): Emit initial space for all
3293	opcode lines.  Print offset in front of each opcode.
3294
32952011-03-22  Marek Polacek  <mpolacek@redhat.com>
3296
3297	* readelf.c (handle_dynamic): Don't segfault at DT_PLTREL case.
3298
32992011-03-22  Mark Wielaard  <mjw@redhat.com>
3300
3301	* readelf.c (dwarf_tag_string): Support DW_TAG_GNU_call_site
3302	and DW_TAG_GNU_call_site_parameter.
3303	(dwarf_attr_string): Support DW_AT_GNU_call_site_value,
3304	DW_AT_GNU_call_site_data_value,
3305	DW_AT_GNU_call_site_target,
3306	DW_AT_GNU_call_site_target_clobbered,
3307	DW_AT_GNU_tail_call,
3308	DW_AT_GNU_all_tail_call_sites,
3309	DW_AT_GNU_all_call_sites,
3310	and DW_AT_GNU_all_source_call_sites.
3311	(print_ops): Handle DW_OP_GNU_entry_value.
3312	(attr_callback): Handle DW_AT_GNU_call_site_value,
3313	DW_AT_GNU_call_site_data_value,
3314	DW_AT_GNU_call_site_target,
3315	and DW_AT_GNU_call_site_target_clobbered.
3316
33172011-03-10  Mark Wielaard  <mjw@redhat.com>
3318
3319	* elflint.c (check_symtab): Use ebl_check_st_other_bits.
3320
33212011-02-27  Jan Kratochvil  <jan.kratochvil@redhat.com>
3322
3323	* readelf.c (reset_listptr): Clear TABLE->TABLE.
3324
33252011-02-25  Mark Wielaard  <mjw@redhat.com>
3326
3327	* readelf.c (dwarf_attr_string): Add DW_AT_GNU_* handling.
3328	(dwarf_form_string): Properly format and return unknown form.
3329
33302011-02-23  Roland McGrath  <roland@redhat.com>
3331
3332	* readelf.c (section_name): New function.
3333	(print_debug_abbrev_section): Use it instead of constant.
3334	(print_debug_aranges_section): Likewise.
3335	(print_debug_ranges_section): Likewise.
3336	(print_debug_units): Likewise.
3337	(print_debug_line_section): Likewise.
3338	(print_debug_loc_section): Likewise.
3339	(print_debug_macinfo_section): Likewise.
3340	(print_debug_pubnames_section): Likewise.
3341	(print_debug_str_section): Likewise.
3342	(print_debug) [USE_ZLIB]: Match .zdebug_* sections too.
3343	(print_debug_abbrev_section): Use decoded d_size, not sh_size.
3344	(print_debug_str_section): Likewise.
3345
3346	* readelf.c (dwarf_attr_string): Grok DW_AT_GNU_odr_signature.
3347
33482011-02-11  Roland McGrath  <roland@redhat.com>
3349
3350	* elfcmp.c (verbose): New variable.
3351	(options, parse_opt): Grok -l/--verbose to set it.
3352	(main): Under -l, keep going after first difference.
3353
3354	* elfcmp.c (ignore_build_id): New variable.
3355	(options, parse_opt): Grok --ignore-build-id to set it.
3356	(main): For SHT_NOTE sections, compare note details rather than raw
3357	bytes.  Under --ignore-build-id, don't complain about differing build
3358	ID contents if lengths match.
3359
33602011-02-08  Roland McGrath  <roland@redhat.com>
3361
3362	* ldscript.y (filename_id_star): Remove unused variable.
3363
3364	* unstrip.c (copy_elided_sections): Remove unused variable.
3365
3366	* elflint.c (check_dynamic): Remove unused variables.
3367
3368	* elflint.c (check_symtab): Warn about missing xndx section only once.
3369
3370	* ldgeneric.c (check_for_duplicate2): Remove unused variable.
3371
33722011-01-06  Roland McGrath  <roland@redhat.com>
3373
3374	* strip.c (handle_elf): Under --strip-sections, remove all
3375	non-allocated sections and never generate .gnu_debuglink.
3376
33772011-01-04  Roland McGrath  <roland@redhat.com>
3378
3379	* strip.c (remove_shdrs): New variable.
3380	(options, parse_opt): Grok --strip-sections to set it.
3381	(handle_elf): When that's set, truncate off .shstrtab and shdrs.
3382
33832010-11-10  Roland McGrath  <roland@redhat.com>
3384
3385	* findtextrel.c (process_file): Don't assume order of sections.
3386	Reported by Mike Hommey <mh@glandium.org>.
3387
33882010-07-26  Roland McGrath  <roland@redhat.com>
3389
3390	* readelf.c (print_ops): Handle DW_OP_GNU_implicit_pointer.
3391
33922010-08-30  Roland McGrath  <roland@redhat.com>
3393
3394	Print .debug_loc/.debug_ranges with cognizance of actual DIE uses.
3395	* readelf.c (parse_opt): Add section_info to implicit_debug_sections
3396	for ranges, loc.
3397	(struct listptr, struct listptr_table): New types.
3398	(compare_listptr, reset_listptr, sort_listptr): New functions.
3399	(notice_listptr, skip_listptr_hole): New functions.
3400	(struct attrcb_args): Add silent member.
3401	(attr_callback): Call notice_listptr for loclistptr and rangelistptr.
3402	Suppress output if silent, but still call notice_listptr.
3403	(print_debug_units): Suppress output if section_info not requested.
3404	(print_debug_loc_section): Call sort_listptr, skip_listptr_hole.
3405	(print_debug_ranges_section): Likewise.
3406	(print_debug): Call reset_listptr on both tables.
3407
3408	* readelf.c (print_debug_ranges_section): Print empty list.
3409	(print_debug_loc_section): Likewise.
3410
3411	* readelf.c (print_debug_loc_section): Check for bogus length
3412	before calling print_ops.
3413	(print_ops): Check harder for bogus data that would read off end.
3414
34152010-08-11  Roland McGrath  <roland@redhat.com>
3416
3417	* readelf.c (for_each_section_argument): Process all sections with
3418	matching name, not just the first.
3419
34202010-07-26  Roland McGrath  <roland@redhat.com>
3421
3422	* readelf.c (print_ops): Take new argument for CU version.
3423	Fix DW_OP_call_ref decoding to depend on it.
3424	(print_debug_loc_section): Update caller.
3425	(print_cfa_program): Take new argument, pass it down.
3426	(print_debug_frame_section): Update caller.
3427	(struct attrcb_args): New member version.
3428	(print_debug_units): Initialize it.
3429
34302010-07-02  Roland McGrath  <roland@redhat.com>
3431
3432	* readelf.c (print_debug_frame_section): Use format_dwarf_addr for
3433	initial_location.
3434
34352010-06-30  Roland McGrath  <roland@redhat.com>
3436
3437	* strings.c (main): Use STDIN_FILENO, not STDOUT_FILENO.
3438	Ignore st_size for a non-S_ISREG file descriptor.
3439	(read_block): Move assert after no-mmap bail-out.
3440	(read_block_no_mmap): Fix size calculations for moving buffer remnant.
3441
34422010-06-22  Roland McGrath  <roland@redhat.com>
3443
3444	* readelf.c (print_debug_line_section): Fix braino in DW_LNS_set_isa.
3445
34462010-06-21  Roland McGrath  <roland@redhat.com>
3447
3448	* readelf.c (dwarf_tag_string): Handle new v4 tags.
3449	(dwarf_attr_string): Add new attributes.
3450	(dwarf_tag_string): Handle DW_TAG_GNU_*.
3451
3452	* readelf.c (print_ops): Use 64-bit types for LEB128 operands.
3453	(print_cfa_program): Likewise.
3454
34552010-06-20  Roland McGrath  <roland@redhat.com>
3456
3457	* readelf.c (print_debug_units): New function, broken out of ...
3458	(print_debug_info_section): ... here.  Call it.
3459	(print_debug_types_section): New function.
3460	(enum section_e): Add section_types alias for section_info.
3461	(print_debug): Add types to the sections table.
3462
3463	* readelf.c (print_debug_frame_section): Handle version 4 format.
3464
3465	* readelf.c (print_debug_line_section): Handle version 4 format.
3466
34672010-06-14  Roland McGrath  <roland@redhat.com>
3468
3469	* unstrip.c (copy_elided_sections): Make sure all sections' data have
3470	been read in before we write anything out.
3471
34722010-06-04  Roland McGrath  <roland@redhat.com>
3473
3474	* unstrip.c (update_shdr): New function.
3475	(update_sh_size): Call it instead of gelf_update_shdr.
3476	(adjust_relocs, add_new_section_symbols): Likewise.
3477	(new_shstrtab, copy_elided_sections): Likewise.
3478
3479	* unstrip.c (copy_elided_sections): Bail if stripped file has more
3480	sections than unstripped file, rather than getting confused later.
3481
34822010-06-01  Roland McGrath  <roland@redhat.com>
3483
3484	* readelf.c (dwarf_form_string): Handle DWARF 4 forms.
3485	(attr_callback): Handle DW_FORM_flag_present, DW_FORM_exprloc,
3486	DW_FORM_sec_offset, DW_FORM_ref_sig8.
3487
3488	* readelf.c (print_debug): Don't bail if libdw setup fails.
3489	Suppress complaint if we only want .eh_frame anyway.
3490
34912010-05-28  Ulrich Drepper  <drepper@redhat.com>
3492
3493	* readelf.c (attr_callback): Also print form information.
3494
34952010-05-19  Roland McGrath  <roland@redhat.com>
3496
3497	* addr2line.c (find_symbol): Short-circuit on empty name.
3498	(handle_address): Handle SYMBOL with no +OFFSET.
3499
35002010-05-08  Roland McGrath  <roland@redhat.com>
3501
3502	* readelf.c (print_ops): Take new arg OFFSET_SIZE.
3503	Use that for DW_OP_call_ref, not ADDRSIZE.
3504	(print_cfa_program): Update caller.
3505	(struct attrcb_args): Add offset_size field.
3506	(attr_callback): Use it for print_ops call.
3507	(print_debug_info_section): Initialize it.
3508	(print_ops): Likewise.
3509
35102010-04-14  Roland McGrath  <roland@redhat.com>
3511
3512	* readelf.c (handle_core_item): Fix bitmask printing.
3513
35142010-04-06  Roland McGrath  <roland@redhat.com>
3515
3516	* ld.c (options): Fix some typos in messages.
3517	* elflint.c (check_scn_group, check_group): Likewise.
3518	* ldscript.y (add_id_list): Likewise.
3519	* readelf.c (print_hash_info): Add xgettext:no-c-format magic comment
3520	before translated string containing a literal %.
3521
35222010-02-26  Roland McGrath  <roland@redhat.com>
3523
3524	* readelf.c (process_file): Don't leak an fd in failure case.
3525
35262010-02-15  Roland McGrath  <roland@redhat.com>
3527
3528	* Makefile.am: Use config/eu.am for common stuff.
3529
3530	* readelf.c (print_debug_frame_section): Add a cast to avoid sign
3531	mismatch in comparison.
3532
35332010-02-02  Roland McGrath  <roland@redhat.com>
3534
3535	* readelf.c (print_encoding_base): Handle DW_EH_PE_absptr (zero).
3536	(read_encoded): Likewise.
3537	(print_debug_frame_section): Check for bogus augmentation length.
3538	For P augmentation, use read_encoded, print the encoding description,
3539	and use hex for unsigned values.
3540
35412010-01-15  Roland McGrath  <roland@redhat.com>
3542
3543	* ar.c: Include <sys/stat.h>.
3544	* elflint.c: Likewise.
3545	* readelf.c: Likewise.
3546	* strip.c: Likewise.
3547	* unstrip.c: Likewise
3548
35492010-01-07  Roland McGrath  <roland@redhat.com>
3550
3551	* readelf.c (print_ehdr): Handle PN_XNUM.
3552	(phnum): New static variable.
3553	(process_elf_file): Set it with elf_getphdrnum.
3554	(print_phdr): Use phnum instead of EHDR->e_phnum.
3555	(print_dynamic, handle_notes): Likewise.
3556	(handle_relocs_rel, handle_relocs_rela): Likewise.
3557
3558	* elfcmp.c (main): Use elf_getshdrnum and elf_getphdrnum.
3559
3560	* elflint.c (phnum): New static variable.
3561	(check_elf_header): Set it, handling PN_XNUM.
3562	Use that in place of EHDR->e_phnum throughout.
3563	(check_symtab, check_reloc_shdr, check_dynamic): Likewise.
3564	(unknown_dependency_p, check_sections, check_program_header): Likewise.
3565
35662010-01-05  Roland McGrath  <roland@redhat.com>
3567
3568	* readelf.c (dwarf_attr_string): Match DW_AT_GNU_vector and
3569	DW_AT_GNU_template_name.
3570
35712010-01-04  Roland McGrath  <roland@redhat.com>
3572
3573	* readelf.c (handle_notes_data): Grab NT_AUXV only for name "CORE".
3574	(handle_core_note): Pass NHDR and NAME to ebl_core_note.
3575	(handle_core_item): Handle .format of '\n' as \n-separated strings.
3576
3577	* readelf.c (implicit_debug_sections): New variable.
3578	(parse_opt): Set it instead of print_debug_sections for -a.
3579	OR them together for print_debug check.
3580	(print_debug): OR them together for section check.
3581
3582	* readelf.c (options): Repartition into set implied by -a and others.
3583	Correct -a text to match reality.
3584
3585	* readelf.c (struct section_argument): Add bool member 'implicit'.
3586	(parse_opt): Set it for -a cases, clear it for -x args.
3587	(for_each_section_argument): Don't complain about a missing section by
3588	name if it's implicit.
3589
35902009-11-16  Roland McGrath  <roland@redhat.com>
3591
3592	* readelf.c (print_string_section): Punt SHT_NOBITS like empty
3593	sections, just as dump_data_section already does.
3594
35952009-09-21  Ulrich Drepper  <drepper@redhat.com>
3596
3597	* elflint.c (special_sections): Allow MERGE and STRINGS flags to be
3598	set for .comment section.
3599	Patch by Mark Wielaard <mjw@redhat.com>.
3600
36012009-09-08  Roland McGrath  <roland@redhat.com>
3602
3603	* ar.c (main): Fix typo in message format.
3604
36052009-08-21  Roland McGrath  <roland@redhat.com>
3606
3607	* readelf.c (attr_callback): Use print_block only when we don't use
3608	print_ops.
3609
36102009-08-14  Roland McGrath  <roland@redhat.com>
3611
3612	* ar.c (do_oper_extract): Use pathconf instead of statfs.
3613
36142009-08-01  Ulrich Drepper  <drepper@redhat.com>
3615
3616	* debugpred.h: Add two most const.
3617
36182009-07-26  Mark Wielaard  <mjw@redhat.com>
3619
3620	* elflint.c (check_note_data): Recognize NT_GNU_GOLD_VERSION.
3621
36222009-07-25  Mark Wielaard  <mjw@redhat.com>
3623
3624	* Makefile.am (addr2line_LDADD): Add $(libelf).
3625
36262009-07-24  Roland McGrath  <roland@redhat.com>
3627
3628	* readelf.c (print_block): New function.
3629	(print_ops): Use it.
3630	(attr_callback): Use it for DW_FORM_block* forms.
3631
36322009-07-20  Mark Wielaard  <mjw@redhat.com>
3633
3634	* readelf.c (print_ops): Add handling of DW_OP_implicit_value
3635	and DW_OP_stack_value.
3636
36372009-07-14  Ulrich Drepper  <drepper@redhat.com>
3638
3639	* elflint.c (check_elf_header): Allow Linux ABI.
3640	(check_symtab): Handle STB_GNU_UNIQUE.
3641
36422009-07-08  Mark Wielaard  <mjw@redhat.com>
3643
3644	* readelf.c (attr_callback): Handle DW_Form constants for
3645	DW_AT_data_member_location.
3646
36472009-07-06  Roland McGrath  <roland@redhat.com>
3648
3649	* readelf.c (register_info): New function.  Handle unknown register #s.
3650	(print_cfa_program): Use it.
3651	(handle_core_register, handle_core_registers): Likewise.
3652
36532009-06-28  Roland McGrath  <roland@redhat.com>
3654
3655	* readelf.c (print_address_names): New static variable.
3656	(options, parse_opt): Grok -N/--numeric-addresses to clear it.
3657	(format_dwarf_addr): Don't look up name if !print_address_names.
3658
36592009-06-13  Ulrich Drepper  <drepper@redhat.com>
3660
3661	* ldgeneric.c: Don't use deprecated libelf functions.
3662	* nm.c: Likewise.
3663	* objdump.c: Likewise.
3664	* readelf.c: Likewise.
3665	* size.c: Likewise.
3666	* strip.c: Likewise.
3667	* unstrip.c: Likewise.
3668	* ld.h: Fix up comment.
3669
36702009-06-01  Ulrich Drepper  <drepper@redhat.com>
3671
3672	* readelf.c (print_relocs): Expect ELF header argument and pass on
3673	to handle_relocs_rel* functions. Adjust caller.
3674	(handle_relocs_rel): Add ELF header argument.  Add special case for
3675	the IRELATIVE relocations in statically linked executables.
3676	(handle_relocs_rela): Likewise.
3677
36782009-04-29  Ulrich Drepper  <drepper@redhat.com>
3679
3680	* elflint.c (check_symtab): Add tests of st_other field.
3681
36822009-04-23  Ulrich Drepper  <drepper@redhat.com>
3683
3684	* Makefile [BUILD_STATIC] (libdw): Add $(zip_LIBS).
3685
36862009-04-20  Roland McGrath  <roland@redhat.com>
3687
3688	* addr2line.c (print_dwarf_function): Honor -s and -A for file names
3689	of inline call sites.
3690
3691	* addr2line.c (just_section): New variable.
3692	(adjust_to_section): New function, broken out of ...
3693	(handle_address): ... here.
3694	(options, parse_opt): Add -j/--section=NAME to set it.
3695
36962009-04-15  Roland McGrath  <roland@redhat.com>
3697
3698	* readelf.c (print_debug_frame_section): Check for DW_CIE_ID_64 in
3699	64-bit format header, DW_CIE_ID_32 in 32-bit format header.
3700
37012009-04-14  Roland McGrath  <roland@redhat.com>
3702
3703	* readelf.c (print_attributes): Treat SHT_ARM_ATTRIBUTES on EM_ARM
3704	like SHT_GNU_ATTRIBUTES.
3705
3706	* readelf.c (handle_core_registers): Fix error message.
3707
3708	* strip.c (handle_elf: check_preserved): Don't note any change when
3709	.debug_data is already filled from a previous pass.
3710
37112009-02-05  Ulrich Drepper  <drepper@redhat.com>
3712
3713	* objdump.c (show_relocs_x): Minor cleanups.
3714
3715	* readelf.c (print_cfa_program): Correct a few labels.
3716	Print first DW_CFA_expression and DW_CFA_val_expression parameter
3717	as register.
3718
37192009-02-01  Ulrich Drepper  <drepper@redhat.com>
3720
3721	* objdump.c (show_relocs_rel, show_relocs_rela): Split common parts
3722	into ...
3723	(show_relocs_x): ...here.  New function.
3724	(show_relocs): Better spacing in output.
3725
3726	* objdump.c (show_relocs_rela): Show offsets as signed values.
3727
3728	* ar.c (main): Fix recognition of invalid modes for a, b, i modifiers.
3729	Improve some error messages.
3730	Use program_invocation_short_name instead of AR macro.
3731	* Makefile.am (CFLAGS_ar): Remove.
3732	* elflint.c (parse_opt): ARGP_HELP_EXIT_ERR does nothing for argp_help.
3733	* objdump.c (parse_opt): Likewise.
3734	* readelf.c (parse_opt): Likewise.
3735
37362009-01-27  Roland McGrath  <roland@redhat.com>
3737
3738	* readelf.c (print_ops): Notice short length, don't overrun buffer
3739	(still need to fix LEB128).
3740
3741	* readelf.c (print_ops): Fix DW_OP_call[24] decoding.
3742
3743	* readelf.c (print_ops): Print (empty)\n when LEN == 0.
3744
37452009-01-24  Ulrich Drepper  <drepper@redhat.com>
3746
3747	* readelf.c (print_debug_frame_section): Fix computation of vma_base
3748	for PC-relative mode.
3749
37502009-01-23  Ulrich Drepper  <drepper@redhat.com>
3751
3752	* size.c (process_file): When handling archive, close file descriptor
3753	here.  For unknown file format also close file descriptor.
3754	(handle_ar): Don't close file descriptor here.
3755
3756	* readelf.c (parse_opt): Move code to add to dump_data_sections and
3757	string_sections list in local function add_dump_section.  Adjust 'x'
3758	key handling.  For 'a' key add .strtab, .dynstr, and .comment section
3759	to string_sections list.
3760
37612009-01-22  Roland McGrath  <roland@redhat.com>
3762
3763	* readelf.c (print_phdr): Don't print section mapping when no sections.
3764
3765	* Makefile.am (AM_CFLAGS): Pass -Wno-format for *_no_Wformat.
3766
3767	* readelf.c (print_debug_frame_section): Initialize IS_SIGNED to false
3768	and reset it only for the 'true' cases.
3769
3770	* Makefile.am (addr2line_no_Wformat): New variable.
3771
3772	* readelf.c (print_debug_frame_section): Use t instead of j formats
3773	for ptrdiff_t OFFSET.
3774
37752009-01-21  Ulrich Drepper  <drepper@redhat.com>
3776
3777	* elflint.c (check_program_header): Fix typo in .eh_frame_hdr section
3778	test.  Handle debuginfo files.
3779	(check_exception_data): First sanity test.
3780
37812009-01-17  Ulrich Drepper  <drepper@redhat.com>
3782
3783	* readelf.c (print_debug_exception_table): Show target of ar_disp
3784	field.
3785
3786	* elflint.c (check_program_header): Add most consistency checks for
3787	PT_GNU_EH_FRAME entry.
3788
3789	* addr2line.c: Use ARGP_PROGRAM_VERSION_HOOK_DEF and
3790	ARGP_PROGRAM_BUG_ADDRESS_DEF.
3791	* ar.c: Likewise.
3792	* elfcmp.c: Likewise.
3793	* elflint.c: Likewise.
3794	* findtextrel.c: Likewise.
3795	* ld.c: Likewise.
3796	* nm.c: Likewise.
3797	* objdump.c: Likewise.
3798	* ranlib.c: Likewise.
3799	* readelf.c: Likewise.
3800
3801	* size.c: Likewise.
3802	* strings.c: Likewise.
3803	* strip.c: Likewise.
3804	* unstrip.c: Likewise.
3805
38062009-01-16  Ulrich Drepper  <drepper@redhat.com>
3807
3808	* elflint.c (check_program_header): Check that PT_GNU_EH_FRAME entry
3809	matches .eh_frame_hdr section, if it is available.  Also check that
3810	the segment is allocated, not writable, not executable.
3811
3812	* readelf.c: Add -e option.  Dump exception and unwind related
3813	sections.  Add -e to -a.
3814	(print_encoding_base): Handle DW_EH_PE_omit.
3815	(print_debug_exception_table): Beginning of support.
3816	(print_debug): Hook up print_debug_exception_table for
3817	.gcc_except_table sections.
3818
3819	* readelf.c (print_debug_frame_section): Some fixes for last change.
3820
38212009-01-15  Ulrich Drepper  <drepper@redhat.com>
3822
3823	* readelf.c (print_encoding): Now a toplevel function.
3824	(print_relinfo): Likewise.
3825	(print_encoding_base): Broken out of print_debug_frame_section.
3826	(print_debug_frame_section): Print different header for .eh_frame
3827	sections.  Fix recognition of matching CIEs in .debug_frame sections.
3828	Print absolute offset for PC-relative FDE locations.  Don't print
3829	table header for FDEs if the table is empty.
3830	(read_encoded): New function.
3831	(print_debug_frame_hdr_section): New function.
3832	(print_debug): Hook up print_debug_frame_hdr_section for .eh_frame_hdr
3833	sections.
3834
3835	* readelf.c (handle_relocs_rel): Print section number.
3836	(print_debug_abbrev_section): Likewise.
3837	(print_debug_aranges_section): Likewise.
3838	(print_debug_ranges_section): Likewise.
3839	(print_debug_info_section): Likewise.
3840	(print_debug_line_section): Likewise.
3841	(print_debug_loc_section): Likewise.
3842	(print_debug_macinfo_section): Likewise.
3843	(print_debug_pubnames_section): Likewise.
3844	(print_debug_str_section): Likewise.
3845
38462009-01-10  Ulrich Drepper  <drepper@redhat.com>
3847
3848	* strings.c (read_block): Fix typo in error message string.
3849
38502009-01-07  Ulrich Drepper  <drepper@redhat.com>
3851
3852	* ld.c (ld_new_searchdir): Fix adding to search path list.
3853
38542009-01-06  Ulrich Drepper  <drepper@redhat.com>
3855
3856	* readelf.c: Implement call frame debug section dumping.
3857
38582009-01-05  Roland McGrath  <roland@redhat.com>
3859
3860	* elfcmp.c: Exit with status 2 for errors (like cmp, diff, grep).
3861	Status 1 (aka EXIT_FAILURE) is only for completed OK but not equal.
3862
38632009-01-01  Ulrich Drepper  <drepper@redhat.com>
3864
3865	* addr2line.c: Update copyright year.
3866	* ar.c: Likewise.
3867	* elfcmp.c: Likewise.
3868	* elflint.c: Likewise.
3869	* findtextrel.c: Likewise.
3870	* ld.c: Likewise.
3871	* nm.c: Likewise.
3872	* objdump.c: Likewise.
3873	* ranlib.c: Likewise.
3874	* readelf.c: Likewise.
3875	* size.c: Likewise.
3876	* strings.c: Likewise.
3877	* strip.c: Likewise.
3878	* unstrip.c: Likewise.
3879
38802008-12-11  Roland McGrath  <roland@redhat.com>
3881
3882	* nm.c (sym_name): New function.
3883	(show_symbols_sysv): Use it in place of elf_strptr.
3884	(show_symbols_bsd, show_symbols_posix): Likewise.
3885	Fixes RHBZ#476136.
3886
3887	* nm.c (show_symbols_sysv): Use an alloca'd backup section name when
3888	elf_strptr fails.
3889
38902008-12-02  Roland McGrath  <roland@redhat.com>
3891
3892	* readelf.c (count_dwflmod, process_file): Don't presume encoding of
3893	nonzero OFFSET argument to dwfl_getmodules.
3894
38952008-08-07  Roland McGrath  <roland@redhat.com>
3896
3897	* addr2line.c (main): Pass string to handle_address.
3898	(see_one_module): New function, subroutine of handle_address.
3899	(find_symbol): Likewise.
3900	(handle_address): Take string argument rather than address.
3901	Convert plain number, or handle strings like "(section)+offset"
3902	or "symbol+offset".
3903
39042008-08-01  Roland McGrath  <roland@redhat.com>
3905
3906	* readelf.c (handle_core_item): Handle 'B' type for 1-origin bitset.
3907	For 'b' and 'B', print <x-y,z> or ~<x,y-z> rather than 1/0 string.
3908
3909	* readelf.c (convert): Take new argument SIZE.
3910	(handle_core_register, handle_core_item): Update callers.
3911	(handle_core_item): Take new arg REPEATED_SIZE.
3912	(handle_core_items): Special case for a singleton item,
3913	let handle_core_item handle repeats if it wants to.
3914
3915	* readelf.c (handle_core_items): Give abridged output
3916	for identical groups repeated more than twice.
3917
39182008-07-04  Roland McGrath  <roland@redhat.com>
3919
3920	* readelf.c (handle_core_items): Handle ELF_T_ADDR.
3921
39222008-04-10  Roland McGrath  <roland@redhat.com>
3923
3924	* strip.c (handle_elf): Don't keep sections that kept symbol tables
3925	refer to.  Instead, just be sure to preserve the original symbol
3926	table in the debug file so those symbols go with their sections and
3927	can be elided from the stripped version of the symbol table.
3928
3929	* strip.c (handle_elf): When a discarded section kept in the debug
3930	file refers to a nondiscard section via sh_link/sh_info, preserve
3931	that nondiscarded section unmodified in the debug file as well.
3932	Skip adjustment of discarded sections symbol table references when
3933	that symbol table is copied in this way.
3934
3935	* elflint.c (check_symtab): Don't crash from missing symbol names
3936	after diagnosing bogus strtab.
3937
3938	* strip.c (handle_elf): Cosmetic cleanup in special section contents
3939	adjustment for symtab changes.
3940
39412008-03-31  Roland McGrath  <roland@redhat.com>
3942
3943	* elflint.c (check_sections): Add checks on SHF_EXECINSTR sections:
3944	must be SHT_PROGBITS, must not be SHF_WRITE.  Let backend hook
3945	excuse a special section.
3946
39472008-03-27  Roland McGrath  <roland@redhat.com>
3948
3949	* elflint.c (check_sections): Check that executability and writability
3950	of sections is reflected in segment p_flags.
3951
39522008-03-26  Roland McGrath  <roland@redhat.com>
3953
3954	* elflint.c (check_program_header): Accept PT_GNU_RELRO p_flags
3955	that matches its PT_LOAD's p_flags &~ PF_W.  On sparc, PF_X really
3956	is valid in RELRO.
3957
39582008-02-29  Roland McGrath  <roland@redhat.com>
3959
3960	* readelf.c (print_attributes): Add a cast.
3961	* elflint.c (check_attributes): Likewise.
3962
3963	* unaligned.h (add_8ubyte_unaligned): Cast PTR argument for parity
3964	with [UNALIGNED_ACCESS_CLASS == BYTE_ORDER] definition.
3965	(add_4ubyte_unaligned, add_2ubyte_unaligned): Likewise.
3966
39672008-02-03  Ulrich Drepper  <drepper@redhat.com>
3968
3969	* i386_ld.c (elf_i386_count_relocations): Implement R_386_TLS_GD
3970	when linked into executable.
3971	(elf_i386_create_relocations): Likewise.
3972
39732008-02-20  Roland McGrath  <roland@redhat.com>
3974
3975	* readelf.c (print_attributes): New function.
3976	(process_elf_file): Call it under -A.
3977
3978	* elflint.c (check_attributes): Implement it for real.
3979
39802008-02-19  Roland McGrath  <roland@redhat.com>
3981
3982	* elflint.c (special_sections): Handle .gnu.attributes section.
3983	(check_sections): Likewise.
3984	(check_attributes): New function.
3985
39862008-02-10  Roland McGrath  <roland@redhat.com>
3987
3988	* elfcmp.c (main): Ignore sh_offset differences in non-SHF_ALLOC
3989	sections and ET_REL files.
3990
39912008-02-02  Ulrich Drepper  <drepper@redhat.com>
3992
3993	* elf32-i386.script: Add .eh_frame_hdr, .tdata, and .tbss sections.
3994	* i386_ld.c (elf_i386_count_relocations): Handle R_386_TLS_LDO_32
3995	and R_386_TLS_LE.
3996	(elf_i386_create_relocations): Likewise.
3997	* ld.h (struct ld_state): Add need_tls, tls_start, and tls_tcb
3998	elements.
3999	* ldgeneric.c (add_section): If TLS section is used, set need_tls flag.
4000	(ld_generic_create_outfile): Add PT_TLS entry to program  header.
4001	Fix generation of PT_GNU_STACK entry.
4002
40032008-02-01  Ulrich Drepper  <drepper@redhat.com>
4004
4005	* ld.c (replace_args): Prevent loop over replacements if the parameter
4006	is only two characters long.
4007
4008	* ld.c: Recognize sha1 argument for --build-id parameter.
4009	* ldgeneric.c (create_build_id_section): Handle sha1.
4010	(compute_hash_sum): New function.  Broken out of compute_build_id.
4011	Take hash function and context as parameters.
4012	(compute_build_id): Use compute_hash_sum for md5 and the new sha1
4013	implementation.
4014
40152008-01-31  Ulrich Drepper  <drepper@redhat.com>
4016
4017	* elf32-i386.script: Add .note.ABI-tag and .note.gnu.build-id sections.
4018	* ld.c: Recognize --build-id command line parameter.
4019	* ld.h: Define scn_dot_note_gnu_build_id.
4020	(struct ld_state): Add build_id and buildidscnidx elements.
4021	* ldgeneric.c: Implement --build-id command line parameter.
4022	* ldlex.l (ID): Recognize - as valid character after the first one.
4023
40242008-01-29  Ulrich Drepper  <drepper@redhat.com>
4025
4026	* ld.c (replace_args): New function.
4027	(main): Use it to rewrite old-style parameters.
4028
4029	* elf32-i386.script: Add .gnu.hash section.
4030	* ldgeneric.c (optimal_bucket_size): A tiny bit more efficient.
4031	(fillin_special_symbol): Initialize st_size.
4032	(sortfct_hashval): New function.
4033	(create_gnu_hash): New function.
4034	(create_hash): New function.
4035	(ld_generic_create_outfile): Use the new functions to create the
4036	hash tables.
4037
4038	* elflint.c (check_gnu_hash): Fix index value printed in error message.
4039
40402008-01-24  Ulrich Drepper  <drepper@redhat.com>
4041
4042	* elflint.c (check_group): Check that signature symbol for section
4043	group is not an empty string.
4044	* ldgeneric.c: Remove magic assignment of indices in the dynsym
4045	section.  Start implementation of --hash-style.
4046	* i386_ld.c: Likewise.
4047	* ld.c: Recognize --hash-style.
4048	* ld.h (struct scninfo): Add comdat_group.
4049	Add additional parameter to finalize_plt callback.
4050
40512008-01-22  Ulrich Drepper  <drepper@redhat.com>
4052
4053	* ld.h (struct callbacks): Add initialize_gotplt.
4054	(struct scnhead): Add scn_dot_gotplt.
4055	(struct ld_state): Add gotpltscnidx.
4056	* i386_ld.c (elf_i386_initialize_plt): Minor optimization.
4057	(elf_i386_initialize_pltrel): Likewise.
4058	(elf_i386_initialize_got): There is now a separate .got.plt, so
4059	don't do the PLT-related work here.  Initialize d_type.
4060	(elf_i386_initialize_gotplt): New function.
4061	(elf_i386_plt0): Use ud2a after indirect jump.
4062	(elf_i386_pic_plt0_entry): Likewise.
4063	(elf_i386_finalize_plt): Reference now .got.plt.
4064	(elf_i386_count_relocations): For GOT entries which need no relocation
4065	don't bump nrel_got.
4066	(elf_i386_create_relocations): Also get .got.plt.  Rewrite R-386_GOT32
4067	handling for split .got/.got.plt.
4068	(elf_i386_ld_init): Initialize callbacks.initialize_gotplt.
4069	* elf32-i386.script: Sort sections for security.  There are no .got
4070	input sections.  Add .got.plt.
4071	* ldgeneric.c (ld_generic_generate_sections): Add .got.plt section.
4072	(ld_generic_create_outfile): Initialize .got.plt section.
4073	Use .got.plt address for _GLOBAL_OFFSET_TABLE_ symbol and DT_PLTGOT.
4074
40752008-01-19  Ulrich Drepper  <drepper@redhat.com>
4076
4077	* i386_ld.c (elf_i386_count_relocations): PLT relocations for undefined
4078	symbols are not carried over into statically linked output files.
4079	Add dummy entries for more TLS relocations.
4080
4081	* ld.c (options): Add long names for -( and -).
4082
4083	* ldgeneric.c (check_definition): For newly found definitions don't
4084	mark section as used if symbol is absolute.
4085	(extract_from_archive): Only assign archive sequence number the first
4086	time the archive is handled.  Update ld_state.last_archive_used
4087	if any symbol was used.  Remove nround variable.
4088	(file_process2): When using symbol from an archive, update
4089	ld_state.group_start_archive, ld_state.archives, and
4090	ld_state.tailarchives.
4091	(ld_generic_file_process): If group is not handled anymore, after
4092	freeing ELF handles for the archives, clear ld_state.archives and
4093	*nextp.  Fix wrong logic in recognizing first iteration of group
4094	loop.  When clearing flags, also clear ld_state.group_start_archive.
4095
40962008-01-11  Ulrich Drepper  <drepper@redhat.com>
4097
4098	* objdump.c (show_disasm): Adjust disassembler format string for
4099	removal of %e.
4100
41012008-01-04  Roland McGrath  <roland@redhat.com>
4102
4103	* readelf.c (handle_core_items): Take new arg DESCSZ; if nonzero,
4104	a size greater than the items cover means multiple sets of items.
4105	(handle_core_note): Update caller.
4106
41072008-01-04  Roland McGrath  <roland@redhat.com>
4108
4109	* strip.c (handle_elf): Move SHDRIDX defn to silence gcc warning.
4110
41112008-01-03  Roland McGrath  <roland@redhat.com>
4112
4113	* ld.h (linked_from_dso_p): Use __attribute__ ((__gnu_inline__)).
4114
4115	* elflint.c (check_dynamic): Remove duplicate initializer.
4116
41172008-01-02  Ulrich Drepper  <drepper@redhat.com>
4118
4119	* addr2line.c: Update copyright year.
4120	* ar.c: Likewise.
4121	* elfcmp.c: Likewise.
4122	* elflint.c: Likewise.
4123	* findtextrel.c: Likewise.
4124	* ld.c: Likewise.
4125	* nm.c: Likewise.
4126	* objdump.c: Likewise.
4127	* ranlib.c: Likewise.
4128	* readelf.c: Likewise.
4129	* size.c: Likewise.
4130	* strings.c: Likewise.
4131	* strip.c: Likewise.
4132	* unstrip.c: Likewise.
4133
41342007-12-30  Ulrich Drepper  <drepper@redhat.com>
4135
4136	* objdump (show_disasm): Use %e after third parameter.
4137
41382007-12-21  Ulrich Drepper  <drepper@redhat.com>
4139
4140	* strip.c: Fix wrong parenthesis in a few branch predictions.
4141	* strings.c: Likewise.
4142
41432007-12-20  Ulrich Drepper  <drepper@redhat.com>
4144
4145	* Makefile.am (DEFS): Add DEBUGPRED.
4146	* addr2line.c: Include debugpred.h.
4147	* ar.c: Likewise.
4148	* elfcmp.c: Likewise.
4149	* elflint.c: Likewise.
4150	* findtextrel.c: Likewise.
4151	* nm.c: Likewise.
4152	* objdump.c: Likewise.
4153	* ranlib.c: Likewise.
4154	* readelf.c: Likewise.
4155	* size.c: Likewise.
4156	* strings.c: Likewise.
4157	* strip.c: Likewise.
4158	* unstrip.c: Likewise.
4159	* debugpred.h: New file.
4160
4161	* readelf.c (handle_relocs_rel): Use elf_scnshndx.
4162	(handle_relocs_rela): Likewise.
4163
4164	* readelf.c: Add lots of likely/unlikely.
4165
4166	* elflint.c: Minor cleanups.
4167
41682007-11-19  Roland McGrath  <roland@redhat.com>
4169
4170	* readelf.c (print_ops): Handle all bad op codes gracefully.
4171	Print their numbers instead of just ???.
4172
41732007-11-09  Roland McGrath  <roland@redhat.com>
4174
4175	* readelf.c (attr_callback): Handle DW_AT_data_location.
4176	Handle block forms to mean a DWARF expression for DW_AT_allocated,
4177	DW_AT_associated, DW_AT_bit_size, DW_AT_bit_offset, DW_AT_bit_stride,
4178	DW_AT_byte_size, DW_AT_byte_stride, DW_AT_count, DW_AT_lower_bound,
4179	DW_AT_upper_bound.
4180
41812007-10-20  Roland McGrath  <roland@redhat.com>
4182
4183	* unstrip.c (options): Update -R description.
4184	(struct symbol): Put symbol details a union with a size_t pointer
4185	`duplicate'.
4186	(compare_symbols_output): Use null ->name as marker for discard
4187	symbols, not zero *->map.
4188	(copy_elided_sections): Record forwarding pointers for discarded
4189	duplicates and fill SYMNDX_MAP elements through them.
4190
4191	* readelf.c (process_file): Set offline_next_address to 0 at start.
4192	(struct process_dwflmod_args): New type.
4193	(process_dwflmod): Take args in it, pass fd to process_elf_file.
4194	(process_file): Update caller; dup FD for passing to libdwfl.
4195	(process_elf_file): Take new arg FD.  For ET_REL file when
4196	displaying data affected by libdwfl relocation, open a new Elf handle.
4197
41982007-10-17  Roland McGrath  <roland@redhat.com>
4199
4200	* readelf.c (print_debug_line_section): For invalid data inside a
4201	unit with plausible length, keep printing at the next unit boundary.
4202
4203	* readelf.c (attr_callback): Use dwarf_formref_die, not dwarf_formref.
4204
42052007-10-16  Roland McGrath  <roland@redhat.com>
4206
4207	* readelf.c (hex_dump): Fix rounding error in whitespace calculation.
4208
42092007-10-15  Roland McGrath  <roland@redhat.com>
4210
4211	* make-debug-archive.in: New file.
4212	* Makefile.am (EXTRA_DIST): Add it.
4213	(make-debug-archive): New target.
4214	(bin_SCRIPTS, CLEANFILES): Add it.
4215
42162007-10-10  Roland McGrath  <roland@redhat.com>
4217
4218	* elflint.c (special_sections): Add new attrflag value exact_or_gnuld.
4219	Use it to check MERGE|STRINGS for .debug_str.
4220	(check_sections): Handle exact_or_gnuld.
4221
42222007-10-08  Roland McGrath  <roland@redhat.com>
4223
4224	* readelf.c (handle_core_item): Handle 'T'|0x80 to indicate
4225	64-bit struct timeval with 32-bit tv_usec.
4226
42272007-10-07  Roland McGrath  <roland@redhat.com>
4228
4229	* readelf.c (check_archive_index): New function.
4230	(process_file): Call it.  Change signature to take only fd and name.
4231	Use libdwfl to open the file, then iterate on its modules (multiple
4232	for an archive) to print file name and call process_elf_file.
4233	(main): Update caller.  Let process_file do elf_begin.
4234	(count_dwflmod, process_dwflmod, find_no_debuginfo): New functions.
4235	(process_elf_file): Take only Dwfl_Module * argument.
4236	Don't print the file name here.
4237	(print_debug_*_section): Take Dwfl_Module * argument.
4238	(print_debug): Likewise.  Update caller.
4239	(format_dwarf_addr): New function.
4240	(print_debug_ranges_section): Use it.
4241	(attr_callback): Likewise.
4242	(print_debug_line_section, print_debug_loc_section): Likewise.
4243
4244	* readelf.c (print_debug_ranges_section): Translate all strings.
4245	(print_debug_loc_section): Likewise.
4246
4247	* unstrip.c (copy_elided_sections): Initialize SEC.
4248
4249	* ar.c (do_oper_insert): Put trailing / on short names.
4250
4251	* arlib.h (MAX_AR_NAME_LEN): Decrease by one.
4252
4253	* arlib2.c (arlib_add_long_name): Adjust for header size.
4254
4255	* arlib.c (arlib_finalize): Pad long name table to keep size even.
4256
4257	* ar.c (do_oper_insert): Use write_retry for padding write.
4258
4259	* ar.c (do_oper_insert): Initialize CUR_OFF in no_old case.
4260	Unconditionally set FOUND[CNT]->elf when setting ->mem.
4261	(remember_long_name): New function.
4262	(do_oper_insert): Call it.  Correctly use length of basename,
4263	not original name.  Don't store long name twice for new member.
4264
42652007-10-06  Roland McGrath  <roland@redhat.com>
4266
4267	* elflint.c (check_note): Skip empty segment.
4268	(check_note_section): Skip empty section.
4269
4270	* unstrip.c (options, parse_opt, struct arg_info): Grok -R/--relocate.
4271	(handle_output_dir_module, handle_implicit_modules): Pass it down.
4272	(handle_dwfl_module): When set, use ET_REL already loaded by Dwfl.
4273	(compare_alloc_sections): Take new arg REL, ignore address if true.
4274	(compare_sections): Likewise, pass it down.
4275	(compare_sections_rel, compare_sections_nonrel): New functions.
4276	(find_alloc_sections_prelink, copy_elided_sections): Use them
4277	instead of compare_sections.
4278	(sections_match): New function, broken out of ...
4279	(find_alloc_section): ... here.
4280	(copy_elided_sections): Reorganize section match-up logic.
4281	Use sections_match for SHF_ALLOC in ET_REL.
4282	For ET_REL, let the nonzero sh_addr from the debug file dominate.
4283
4284	* unstrip.c (add_new_section_symbols): Take new arg REL.
4285	When true, do not update section symbol values.
4286	(collect_symbols): Likewise.  Update section symbols with address
4287	of chosen output section, not original section.
4288	(check_symtab_section_symbols, copy_elided_sections): Update callers.
4289
4290	* unstrip.c (compare_alloc_sections): At the same address, preserve
4291	original section order.
4292
4293	* elflint.c (special_sections): Don't require MERGE|STRINGS for
4294	.debug_str, it didn't always have them with older tools.
4295
4296	* elflint.c (check_symtab, check_one_reloc): Ignore sh_addr in ET_REL.
4297
42982007-10-05  Roland McGrath  <roland@redhat.com>
4299
4300	* elflint.c (check_symtab): Allow SHN_UNDEF _GLOBAL_OFFSET_TABLE_ in
4301	ET_REL file.
4302
4303	* elflint.c (check_symtab): For _GLOBAL_OFFSET_TABLE_, diagnose
4304	SHN_UNDEF as "bad section".  Use shndx value in messages.
4305
4306	* elflint.c (special_sections): Add ".debug_str".  Decrement namelen
4307	for ".debug" so it matches as a prefix.
4308	(IS_KNOWN_SPECIAL): New macro.
4309	(check_sections): Use it for ".plt" match.  Cite wrong SHT_NOBITS
4310	type even under -d, for a .debug* or .shstrtab section.
4311
4312	* readelf.c (print_ops): Use hex for address operand.
4313
43142007-10-04  Roland McGrath  <roland@redhat.com>
4315
4316	* unstrip.c (copy_elided_sections): Initialize NDX_SECTION element for
4317	.gnu_debuglink section to SHN_UNDEF.  Drop STT_SECTION symbols for
4318	sections mapped to SHN_UNDEF.
4319
43202007-10-04  Ulrich Drepper  <drepper@redhat.com>
4321
4322	* readelf.c (dump_archive_index): Avoid warning about uninitialized
4323	variable with older glibc versions.
4324	Add some branch prediction.
4325
43262007-10-04  Roland McGrath  <roland@redhat.com>
4327
4328	* readelf.c (print_archive_index): New variable.
4329	(options, parse_opt): Accept -c/--archive-index to set it.
4330	(dump_archive_index): New function.
4331	(process_file): Take new arg WILL_PRINT_ARCHIVE_INDEX.
4332	Call dump_archive_index on archives if set.
4333	(main): Update caller.
4334	(any_control_option): Give it file scope, moved out of ...
4335	(parse_opt): ... here.
4336
43372007-10-03  Roland McGrath  <roland@redhat.com>
4338
4339	* unstrip.c (struct arg_info): Add `list' flag.
4340	(options, parse_opt): Grok -n/--list to set it.
4341	(list_module): New function.
4342	(handle_implicit_modules): Call it under -n.
4343
4344	* elflint.c (check_note_section): New function.
4345	(check_sections): Call it for SHT_NOTE.
4346
4347	* readelf.c (handle_notes): Use sections when available.
4348
4349	* elflint.c (check_note_data): New function, broken out of ...
4350	(check_note): ... here.  Call it and elf_getdata_rawchunk.
4351
4352	* readelf.c (handle_auxv_note): Take offset as argument, not buffer.
4353	Use elf_getdata_rawchunk and gelf_getauxv.
4354	(handle_notes_data): New function, broken out of ...
4355	(handle_notes): ... here.  Call it and elf_getdata_rawchunk.
4356
43572007-10-01  Roland McGrath  <roland@redhat.com>
4358
4359	* readelf.c (hex_dump): Fix transposed subtraction generating spaces.
4360
4361	* readelf.c (hex_dump): Fix line header to be hex instead of decimal.
4362
43632007-09-10  Roland McGrath  <roland@redhat.com>
4364
4365	* readelf.c (options): Give -p optional argument, alias --string-dump.
4366	(string_sections, string_sections_tail): New static variables.
4367	(parse_opt): Set them when -p has an argument.
4368	(print_string_section): New function, broken out of ...
4369	(print_strings): ... here.  Call it.
4370	(dump_data_section): New function, broken out of ...
4371	(dump_data): ... here.  Call it.
4372	(for_each_section_argument): New function, broken out of ...
4373	(dump_data): ... here.  Call it.
4374	(dump_strings): New function.
4375
43762007-08-31  Roland McGrath  <roland@redhat.com>
4377
4378	* readelf.c (print_strings): Typo fix.
4379
43802007-08-23  Roland McGrath  <roland@redhat.com>
4381
4382	* readelf.c (printf_with_wrap): Function removed.
4383	(REGISTER_WRAP_COLUMN): New macro.
4384	(handle_core_register): Use print_core_item instead.
4385	(struct register_info): New type.
4386	(compare_registers, compare_register_sets): New functions.
4387	(register_bitpos, compare_sets_by_info): New functions.
4388	(handle_core_registers): Use those to segregate and sort registers
4389	for display.
4390
4391	* readelf.c (ITEM_WRAP_COLUMN): New macro.
4392	(print_core_item): New function.
4393	(handle_core_item): Use it instead of printf_with_wrap.
4394	(compare_core_items, compare_core_item_groups): New functions.
4395	(handle_core_items): Use them.  Sort by group and force line breaks
4396	between groups.
4397
4398	* readelf.c (handle_core_registers, handle_core_items): New functions,
4399	broken out of ...
4400	(handle_core_note): ... here.   Call them.
4401
44022007-08-22  Roland McGrath  <roland@redhat.com>
4403
4404	* unstrip.c (new_shstrtab): New function, broken out of ...
4405	(copy_elided_sections): ... here.
4406
44072007-08-20  Roland McGrath  <roland@redhat.com>
4408
4409	Avoid local function trampolines in nm binary.
4410	* nm.c (sort_by_address): Move to a static function instead of local
4411	inside show_symbols.
4412	(sort_by_name_strtab): New static variable.
4413	(sort_by_name): Use it.  Move to a static function instead of local
4414	inside show_symbols.
4415	(show_symbols): Set sort_by_name_strtab.
4416
44172007-08-19  Roland McGrath  <roland@redhat.com>
4418
4419	* readelf.c (handle_auxv_note): New function.
4420	(handle_notes): Call it.
4421
4422	* readelf.c (printf_with_wrap, convert): New functions.
4423	(handle_core_item, (handle_core_register): New functions.
4424	(handle_notes): Call those with details from ebl_core_note.
4425
44262007-08-12  Roland McGrath  <roland@redhat.com>
4427
4428	* elflint.c (check_note): Accept type 0 with name "Linux".
4429
4430	* elflint.c (special_sections): Accept SHF_ALLOC for ".note".
4431
4432	* elflint.c (section_flags_string): Return "none" for 0, not "".
4433
44342007-08-11  Roland McGrath  <roland@redhat.com>
4435
4436	* elflint.c (check_note): Accept NT_GNU_HWCAP, NT_GNU_BUILD_ID.
4437
44382007-08-04  Ulrich Drepper  <drepper@redhat.com>
4439
4440	* readelf.c (hex_dump): Use isprint to determine whether to print
4441	character itself or full stop character.
4442	(dump_data): No need to check endp for NULL after strtol call.
4443
44442007-08-03  Roland McGrath  <roland@redhat.com>
4445
4446	* readelf.c (print_string_sections): New variable.
4447	(options, parse_opt): Handle --strings/-p to set it.
4448	(print_strings): New function.
4449	(process_elf_file): Call it under -p.
4450
4451	* readelf.c (options): Add hidden aliases --segments, --sections,
4452	as taken by binutils readelf.
4453
44542007-08-01  Roland McGrath  <roland@redhat.com>
4455
4456	* readelf.c (dump_data_sections, dump_data_sections_tail):
4457	New variables.
4458	(options, parse_opt): Handle --hex-dump/-x, set them.
4459	(hex_dump): New function.
4460	(dump_data): New function, call it.
4461	(process_elf_file): Call it.
4462
44632007-07-25  Roland McGrath  <roland@redhat.com>
4464
4465	* addr2line.c (show_symbols): New variable.
4466	(print_addrsym): New function.
4467	(handle_address): Call it.
4468	(options, parse_opt): Handle -S/--symbols.
4469
44702007-06-05  Ulrich Drepper  <drepper@redhat.com>
4471
4472	* addr2line.c: Update for latest autoconf header.
4473	* ar.c: Likewise.
4474	* elfcmp.c: Likewise.
4475	* elflint.c: Likewise.
4476	* findtextrel.c: Likewise.
4477	* ld.c: Likewise.
4478	* ldgeneric.c: Likewise.
4479	* nm.c: Likewise.
4480	* objdump.c: Likewise.
4481	* ranlib.c: Likewise.
4482	* readelf.c: Likewise.
4483	* size.c: Likewise.
4484	* strings.c: Likewise.
4485	* strip.c: Likewise.
4486	* unstrip.c: Likewise.
4487
44882007-05-18  Roland McGrath  <roland@redhat.com>
4489
4490	* unstrip.c (copy_elided_sections): Match up non-NOBITS sections with
4491	stripped file, so as not to duplicate a section copied in both.
4492
4493	* strip.c (handle_elf): Keep SHT_NOTE section copies in the debug file.
4494
44952007-05-17  Roland McGrath  <roland@redhat.com>
4496
4497	* unstrip.c (copy_elided_sections): Don't call gelf_newphdr for 0.
4498
4499	* unstrip.c (handle_file): Tweak BIAS != 0 warning.
4500
4501	* unstrip.c (handle_file): Take new arg CREATE_DIRS.  If set,
4502	call make_directories here.
4503	(handle_explicit_files): Take new arg CREATE_DIRS, pass it down.
4504	(handle_dwfl_module): Likewise.
4505	(handle_implicit_modules): Update callers.
4506	(handle_output_dir_module): Likewise.  Don't do make_directories here.
4507
4508	* unstrip.c (get_section_name): New function, broken out of ...
4509	(copy_elided_sections): here.  Update callers.
4510	(find_alloc_section): Broken out of ...
4511	(copy_elided_sections): ... here.  Update caller.
4512	(symtab_count_leading_section_symbols): Take new arg NEWSYMDATA,
4513	update STT_SECTION symbols' st_value fields as a side effect.
4514	(check_symtab_section_symbols): Update caller.
4515	(add_new_section_symbols): Set st_value in symbols added.
4516	(collect_symbols): Reset S->value for STT_SECTION symbols recorded.
4517	Take new arg SPLIT_BSS.  Adjust S->shndx recorded for symbols moved
4518	from .bss to .dynbss.
4519	(find_alloc_sections_prelink): New function.  Associate debug file
4520	allocated SHT_NOBITS shdrs with stripped moved by prelink via
4521	.gnu.prelink_undo information.
4522	(copy_elided_sections): Call it when we couldn't find every allocated
4523	section.  Don't use a debug file non-NOBITS section if SHF_ALLOC.
4524	Take STRIPPED_EHDR arg instead of E_TYPE and PHNUM.
4525	(handle_file): Update callers.
4526
4527	* unstrip.c (copy_elided_sections): Ignore unfound unallocated section
4528	named ".comment".
4529
4530	* elflint.c (check_sections): Fix association of segments with
4531	sections when p_memsz > p_filesz.
4532
45332007-04-29  Roland McGrath  <roland@redhat.com>
4534
4535	* addr2line.c (options, main): Tweak argp group settings to fix
4536	usage output.
4537
45382007-04-28  Roland McGrath  <roland@redhat.com>
4539
4540	* strip.c (handle_elf): Update debug file's SHT_NOBITS sections'
4541	sizes to match sections adjusted in the stripped file.
4542
45432007-04-24  Roland McGrath  <roland@redhat.com>
4544
4545	* elfcmp.c (OPT_HASH_INEXACT): New macro.
4546	(hash_inexact): New variable.
4547	(options, parse_opt): Add --hash-inexact option to set it.
4548	(hash_content_equivalent): New function.
4549	(main): Call it for differing SHT_HASH sections under --hash-inexact.
4550
45512007-04-23  Roland McGrath  <roland@redhat.com>
4552
4553	* unstrip.c: New file.
4554	* Makefile.am (bin_PROGRAMS): Add it.
4555	(unstrip_LDADD): New variable.
4556
4557	* strip.c (options): Allow --output for -o.
4558
45592007-02-15  Ulrich Drepper  <drepper@redhat.com>
4560
4561	* readelf.c: Remove unused code.  Add a few consts.
4562
45632007-02-15  Roland McGrath  <roland@redhat.com>
4564
4565	* readelf.c (print_debug): Fix brainos in SHDR test.
4566
45672007-02-05  Roland McGrath  <roland@redhat.com>
4568
4569	* ar.c: Include <limits.h>, since we use LONG_MAX.
4570
45712007-02-05  Ulrich Drepper  <drepper@redhat.com>
4572
4573	* ar.c: Add ugly hack to work around gcc complaining that we
4574	ignore fchown's return value.
4575	(do_oper_insert): Handle error when writing padding.
4576	* ranlib.c: Add fchown complain work around.
4577
4578	* arlib.c: Make symtab a global variable.  Change all users.
4579	* arlib2.c: Likewise.
4580	* ranlib.c: Likewise.
4581	* ar.c: Likewise.
4582	* arlib.h: Declare it.
4583
45842007-01-11  Roland McGrath  <roland@redhat.com>
4585
4586	* elflint.c (check_sections): Use ebl_machine_section_flag_check on
4587	SHF_MASKPROC bits separately from generic sh_flags validation.
4588
45892007-02-04  Ulrich Drepper  <drepper@redhat.com>
4590
4591	* ar.c: New file.
4592	* arlib.c: New file.
4593	* arlib2.c: New file.
4594	* arlib.h: New file.
4595	* Makefile (noinst_LIBRARIES): Add libar.
4596	(libar_a_SOURCES): Define.
4597	(ar_LDADD): Define.
4598	(CFLAGS_ar): Define.
4599	* ranlib.c: Change to use arlib.
4600
4601	* elflint.c (check_symtab): Work around GNU ld bug which omits
4602	sections but not symbols in those sections.
4603
46042007-01-10  Ulrich Drepper  <drepper@redhat.com>
4605
4606	* addr2line.c: Update copyright year.
4607	* elfcmp.c: Likewise.
4608	* elflint.c: Likewise.
4609	* findtextrel.c: Likewise.
4610	* ld.c: Likewise.
4611	* nm.c: Likewise.
4612	* objdump.c: Likewise.
4613	* ranlib.c:  Likewise.
4614	* readelf.c: Likewise.
4615	* size.c: Likewise.
4616	* strings.c: Likewise.
4617	* strip.c: Likewise.
4618
46192006-12-09  Ulrich Drepper  <drepper@redhat.com>
4620
4621	* elflint.c (compare_hash_gnu_hash): New function.  Report if the
4622	two hash tables have different content (module expected omission
4623	of undefined symbols).
4624
46252006-10-31  Roland McGrath  <roland@redhat.com>
4626
4627	* elflint.c (check_program_header): Don't complain about
4628	p_filesz > p_memsz if p_memsz is zero and p_type is PT_NOTE.
4629
46302006-09-19  Jakub Jelinek  <jakub@redhat.com>
4631
4632	* strip.c (process_file): Disallow -f on archives.
4633
46342006-10-09  Roland McGrath  <roland@redhat.com>
4635
4636	* Makefile.am (libld_elf_i386.so): Use $(LINK), not $(CC).
4637
46382006-08-29  Roland McGrath  <roland@redhat.com>
4639
4640	* Makefile.am (MAINTAINERCLEANFILES): New variable.
4641
4642	* readelf.c (handle_relocs_rel): Typo fix, test DESTSHDR properly.
4643	Reported by Christian Aichinger <Greek0@gmx.net>.
4644
4645	* elflint.c (valid_e_machine): Add EM_ALPHA.
4646	Reported by Christian Aichinger <Greek0@gmx.net>.
4647
46482006-08-08  Ulrich Drepper  <drepper@redhat.com>
4649
4650	* elflint.c (check_dynamic): Don't require DT_HASH for DT_SYMTAB.
4651	Keep track of which "high DT" entries are present.
4652	Check that either old or GNU-style hash table is present.
4653	If GNU-style hash table is used a symbol table is mandatory.
4654	Check that if any prelink entry is present all of them are.
4655	(check_gnu_hash): Only fail for undefined symbols in GNU-style hash
4656	table if they don't refer to functions.
4657
46582006-07-17  Roland McGrath  <roland@redhat.com>
4659
4660	* elflint.c (struct version_namelist): Use GElf_Versym for `ndx' field.
4661	(add_version): Likewise for argument.
4662	(check_versym): Cast constant to GElf_Versym for comparison.
4663
46642006-07-12  Roland McGrath  <roland@redhat.com>
4665
4666	* readelf.c (handle_gnu_hash): Add casts for machines where
4667	Elf32_Word != unsigned int.
4668
46692006-07-12  Ulrich Drepper  <drepper@redhat.com>
4670
4671	* elflint.c (check_sysv_hash64): Fix printf format.
4672
46732006-07-11  Roland McGrath  <roland@redhat.com>
4674
4675	* addr2line.c (options): English fix in -f doc string.
4676
4677	* addr2line.c (use_comp_dir): New variable.
4678	(options, parse_opt): Grok -A/--absolute to set it.
4679	(handle_address): If set, prepend dwfl_line_comp_dir results to
4680	relative file names.
4681
46822006-07-06  Ulrich Drepper  <drepper@redhat.com>
4683
4684	* elflint.c: Adjust for latest new hash table format.
4685	* readelf.c: Likewise.
4686
4687	* elflint.c (check_versym): Ignore hidden bit when comparing version
4688	numbers.
4689
46902006-07-05  Ulrich Drepper  <drepper@redhat.com>
4691
4692	* ldgeneric.c (ld_generic_create_outfile): Correctly recognize
4693	discarded COMDAT symbols.
4694
4695	* i386_ld.c (elf_i386_count_relocations): Lot of corrections.
4696	(elf_i386_create_relocations): Likewise.
4697	* ld.h (struct symbol): Add local and hidden bits.
4698	* ld.c (create_special_section_symbol): These synthsized symbols
4699	are local and hidden.
4700	* ldgeneric.c (file_process2): Check whether input file matches
4701	the emulation.
4702	(fillin_special_symbol): Create symbols as local and/or hidden
4703	if requested.
4704	(ld_generic_create_outfile): Make local copy of symbol.
4705	Don't hide global, defined symbols in dynamic symbol table unless
4706	requested.  Synthetic symbols have no version information.
4707
4708	* elflint.c: Add support for checking 64-bit SysV-style hash tables.
4709	* readelf.c: Add support for printing 64-bit SysV-style hash tables.
4710
47112006-07-04  Ulrich Drepper  <drepper@redhat.com>
4712
4713	* elflint.c (is_rel_dyn): Fix and extend DT_RELCOUNT/DT_RELACOUNT
4714	testing.
4715
47162006-07-03  Ulrich Drepper  <drepper@redhat.com>
4717
4718	* elflint.c: Add testing of DT_GNU_HASH.
4719	* readelf.c: Implement showing histogram for DT_GNU_HASH section.
4720
4721	* Makefile.am: Add hacks to create dependency files for non-generic
4722	linker.
4723
47242006-06-12  Ulrich Drepper  <drepper@redhat.com>
4725
4726	* ldgeneric.c (ld_generic_generate_sections): Don't create .interp
4727	section if creating a DSO and no interpreter is given.
4728	(ld_generic_create_outfile): Don't store reference to symbols in
4729	discarded COMDAT groups.  Don't create PHDR and INTERP program header
4730	for DSO if no interpreter is specified.
4731	(create_verneed_data): Pretty printing.
4732
4733	* ldscript.y (content): If a DSO is created don't set default
4734	interpreter from linker script.
4735
4736	* i386_ld.c (elf_i386_count_relocations): Do not add relocations
4737	for symbols in discarded COMDAT groups.
4738	(elf_i386_create_relocations): Likewise.
4739	* ld.h (struct scninfo): Add unused_comdat.
4740	* ldgeneric.c (add_section): Also check group signature when
4741	matching COMDAT sections.
4742	(add_relocatable_file): Ignore symbols in COMDAT group which are
4743	discarded.
4744
4745	* elflint.c (check_one_reloc): For *_NONE relocs only check type
4746	and symbol reference.
4747
47482006-06-11  Ulrich Drepper  <drepper@redhat.com>
4749
4750	* elflint.c (check_dynamic): Fix checking value of tags which are
4751	offsets in the string section.  Make sure DT_STRTAB points to the
4752	section referenced in sh_link.
4753
4754	* ld.c (options): Add headers.  Add short option 'R' for '--rpath'.
4755
4756	* ld.c: Recognize --eh-frame-hdr option.
4757	* ld.h (struct ld_state): Add eh_frame_hdr field.
4758	* ldgeneric.c (struct unw_eh_frame_hdr): Define.
4759
4760	* ldgeneric.c (add_section): Use ebl_sh_flags_combine instead of
4761	SH_FLAGS_COMBINE.
4762	(add_relocatable_file): Minor optimization of last change.
4763	(match_section): Don't preserve SHF_GROUP flag any longer.
4764
47652006-06-10  Ulrich Drepper  <drepper@redhat.com>
4766
4767	* ld.c (parse_z_option): Recognize execstack and noexecstack.
4768	Handle record and ignore as position dependent options.
4769	(parse_z_option_2): Handle ignore and record here.
4770	* ld.h (struct ld_state): Add execstack field.
4771	* ldgeneric.c (add_relocatable_file): Recognize .note.GNU-stack
4772	sections.
4773	(ld_generic_create_outfile): Fix program header creation in native
4774	linker.  Add PT_GNU_STACK program header.
4775
47762006-06-09  Ulrich Drepper  <drepper@redhat.com>
4777
4778	* i386_ld.c (elf_i386_finalize_plt): Don't change symbol table entries
4779	for PLT entries if there is no local definition.
4780
4781	* ld.c (parse_option): Handle -z ignore like --as-needed and
4782	-z record like --no-as-needed.
4783	* ld.h (struct ld_state): Remove ignore_unused_dsos field.
4784	* ldgeneric.c (new_generated_scn): Always compute ndt_needed by
4785	looping over DSOs.  When deciding about adding DT_NEEDED entries
4786	use ->as_needed instead of ignore_unused_dsos.
4787
47882006-05-31  Ulrich Drepper  <drepper@redhat.com>
4789
4790	* ld.c: Recognize --as-needed and --no-as-needed options.
4791	* ld.h (struct usedfile): Add as_needed field.
4792	(struct ld_state): Likewise.
4793	* ldgeneric.c (ld_handle_filename_list): Copy as_needed flag from
4794	the list.
4795	* ldscript.y (filename_id_list): Split to correctly parse all
4796	combinations.
4797	(mark_as_needed): Fix loop.
4798
47992006-05-28  Ulrich Drepper  <drepper@redhat.com>
4800
4801	* addr2line.c (print_dwarf_function): Use unsigned type for lineno
4802	and colno.
4803
48042006-05-27  Ulrich Drepper  <drepper@redhat.com>
4805
4806	* readelf.c (handle_relocs_rela): Better notations for addon value.
4807	(print_ehdr): Distinguish e_ident[EI_VERSION] from e_version.
4808
48092006-04-04  Ulrich Drepper  <drepper@redhat.com>
4810
4811	* addr2line.c: Update copyright year.
4812	* elfcmp.c: Likewise.
4813	* elflint.c: Likewise.
4814	* findtextrel.c: Likewise.
4815	* ld.c: Likewise.
4816	* nm.c: Likewise.
4817	* objdump.c: Likewise.
4818	* ranlib.c: Likewise.
4819	* readelf.c: Likewise.
4820	* size.c: Likewise.
4821	* strings.c: Likewise.
4822	* strip.c: Likewise.
4823
48242006-03-09  Roland McGrath  <roland@redhat.com>
4825
4826	* Makefile.am (AM_LDFLAGS): New variable.
4827
48282006-03-01  Roland McGrath  <roland@redhat.com>
4829
4830	* readelf.c (dwarf_tag_string, dwarf_attr_string): Update name tables
4831	for dwarf.h changes matching 3.0 spec.
4832	(dwarf_encoding_string, dwarf_lang_string, print_ops): Likewise.
4833
48342005-12-04  Ulrich Drepper  <drepper@redhat.com>
4835
4836	* elflint.c (check_one_reloc): If relocation section is not loaded,
4837	don't check whether the relocations modify read-only sections or
4838	loaded and unloaded sections.
4839
48402005-11-28  Ulrich Drepper  <drepper@redhat.com>
4841
4842	* elflint.c (check_one_reloc): Take additional parameters.  Use
4843	them to determine whether relocation is valid in this type of
4844	file.  DSOs and executables can contain relocation sections in
4845	unloaded sections which just show the relocations the linker
4846	applied.  Adjust all callers.
4847	(check_program_header): Check that PT_PHDR is loaded and that offset
4848	matches the one in the ELF header.
4849
48502005-10-26  Roland McGrath  <roland@redhat.com>
4851
4852	* nm.c (get_var_range): dwarf_getloclist -> dwarf_getlocation.
4853
48542005-09-03  Ulrich Drepper  <drepper@redhat.com>
4855
4856	* strip.c (handle_elf): Unify some error messages.
4857	* ld.c (main): Likewise.
4858	* ldgeneric.c (open_elf): Likewise.
4859	* elfcmp.c (main): Likewise.
4860	* elflint.c (check_elf_header): Likewise.
4861
4862	* size.c (process_file): Fix typo in error message.
4863
4864	* readelf.c: Lots of little cleanups.  Use _unlocked functions.
4865
48662005-09-02  Ulrich Drepper  <drepper@redhat.com>
4867
4868	* strings.c (main): Reset elfmap variable after munmap call.
4869	[_MUDFLAP] (map_file): Simplify mudflap debugging by not using mmap.
4870
48712005-08-28  Ulrich Drepper  <drepper@redhat.com>
4872
4873	* ranlib.c: Don't define pread_retry and write_retry here.
4874
4875	* Makefile.an [BUILD_STATIC] (libdw): Add -ldl.
4876	(CLEANFILES): Add *.gcno *.gcda *.gconv.
4877
4878	* strings.c (process_chunk): Reorder expressions in conditional
4879	(process_chunk_mb): Likewise.
4880
4881	* strings.c: New file.
4882	* Makefile.am (bin_PROGRAMS): Add strings.
4883	(strings_no_Wstring): Define.
4884	(strings_LDADD): Define.
4885
48862005-08-27  Roland McGrath  <roland@redhat.com>
4887
4888	* addr2line.c (dwarf_diename_integrate): Function removed.
4889	(print_dwarf_function): Use plain dwarf_diename.
4890
48912005-08-24  Ulrich Drepper  <drepper@redhat.com>
4892
4893	* elflint.c (check_versym): Versioned symbols should not have
4894	local binding.
4895
48962005-08-15  Ulrich Drepper  <drepper@redhat.com>
4897
4898	* elflint.c (check_versym): Allow VER_NDX_LOCAL symbols to be
4899	undefined.
4900
4901	* Makefile.am: Add rules to build ranlib.
4902	* ranlib.c: New file.
4903
49042005-08-14  Roland McGrath  <roland@redhat.com>
4905
4906	* elflint.c (check_sections): Use ebl_section_type_name and allow any
4907	sh_type it recognizes.
4908
4909	* elflint.c (check_sections): Print unknown flags in hex, don't
4910	truncate high bits.  Print section number and name for unknown type.
4911
49122005-08-13  Roland McGrath  <roland@redhat.com>
4913
4914	* elflint.c (check_program_header): Use ebl_segment_type_name and
4915	allow any p_type it recognizes.  Include p_type value in error
4916	message for unknown type.
4917
49182005-08-13  Ulrich Drepper  <drepper@redhat.com>
4919
4920	* elflint.c (check_symtab): Simplify last change a bit.  Pass ehdr
4921	to ebl_check_special_symbol.
4922	(check_sections): Pass ehdr to ebl_bss_plt_p.
4923
49242005-08-12  Roland McGrath  <roland@redhat.com>
4925
4926	* elflint.c (check_symtab): Check that _GLOBAL_OFFSET_TABLE_ st_shndx
4927	refers to the right section if it's not SHN_ABS.
4928	Let ebl_check_special_symbol override _G_O_T_ value and size checks.
4929
4930	* elflint.c (check_sections): Don't complain about a non-NOBITS
4931	section taking no segment space, if it's sh_size is 0.
4932
4933	* elflint.c (check_sections): Use ebl_bss_plt_p to see if .plt should
4934	be PROGBITS or NOBITS.
4935
4936	* elflint.c (check_symtab): Use ebl_check_special_symbol to override
4937	standard st_value and st_size checks.
4938
49392005-07-28  Roland McGrath  <roland@redhat.com>
4940
4941	* addr2line.c (options, parse_opt): Don't handle -e here.
4942	(executable): Variable removed.
4943	(argp_children): New static variable.
4944	(argp): Use it.  Make const.
4945	(main): Fill in argp_children from dwfl_standard_argp ().
4946	Let libdwfl handle file selection, pass Dwfl handle to handle_address.
4947	(print_dwarf_function): New function.  Try to figure out inline chain.
4948	(elf_getname): Function removed, libdwfl does it for us.
4949	(handle_address): Take Dwfl handle instead of Elf, Dwarf handles.
4950	Use dwfl_module_addrname instead of elf_getname.
4951	Use dwfl_module_getsrc and dwfl_lineinfo instead of libdw calls.
4952	* Makefile.am (INCLUDES): Add libdwfl directory to path.
4953
49542005-08-10  Ulrich Drepper  <drepper@redhat.com>
4955
4956	* strip.c (parse_opt): STATE parameter is now used.
4957	Various little cleanups.
4958
4959	* readelf.c (print_debug_line_section): Correct fallout of renaming
4960	of DW_LNS_set_epilog_begin.
4961
49622005-08-08  Roland McGrath  <roland@redhat.com>
4963
4964	* strip.c (options, parse_opt): Grok -R .comment for compatibility
4965	with binutils strip.  Likewise -d, -S, as aliases for -g.
4966	Likewise ignore -s/--strip-all.
4967
49682005-08-07  Roland McGrath  <roland@redhat.com>
4969
4970	* strip.c (process_file): Open read-only when using a different output
4971	file.
4972
49732005-08-06  Ulrich Drepper  <drepper@redhat.com>
4974
4975	* elflint.c (in_nobits_scn): New function.
4976	(check_versym): Allow references for defined symbols against versions
4977	of other DSOs also for symbols in nobits sections.
4978	Move a few variables around.
4979
4980	* Makefile.am (AM_CFLAGS): Avoid duplication.
4981	Link with statis libs if BUILD_STATIC.
4982
49832005-08-05  Ulrich Drepper  <drepper@redhat.com>
4984
4985	* elflint.c: Many, many more tests.  Mostly related to symbol
4986	versioning.  Those sections should now be completely checked.
4987
4988	* readelf.c (print_dynamic): Use gelf_offscn.
4989
49902005-08-04  Ulrich Drepper  <drepper@redhat.com>
4991
4992	* elflint.c: Add lots more tests: more extension symbol table sanity,
4993	versioning section tests, hash table tests.  General cleanup.
4994
49952005-08-02  Ulrich Drepper  <drepper@redhat.com>
4996
4997	* objdump.c: New file.
4998	* Makefile.am (bin_PROGRAMS): Add objdump.
4999	(objdump_LDADD): Define.
5000
5001	* elflint.c (check_reloc_shdr): New function split out from check_rela
5002	and check_rel.
5003	(check_one_reloc): New function.  Likewise.
5004	(check_rela): Use check_reloc_shdr and check_one_reloc.
5005	(check_rel): Likewise.
5006	(check_program_header): Check that PT_DYNAMIC entry matches .dynamic
5007	section.
5008	Add checks that relocations against read-only segments are flagged,
5009	that the text relocation flag is not set unnecessarily, and that
5010	relocations in one section are either against loaded or not-loaded
5011	segments.
5012
50132005-08-01  Ulrich Drepper  <drepper@redhat.com>
5014
5015	* elfcmp.c (main): Ignore section count and section name string table
5016	section index.
5017
50182005-07-27  Roland McGrath  <roland@redhat.com>
5019
5020	* elfcmp.c: Include <locale.h>.
5021
50222005-07-27  Ulrich Drepper  <drepper@redhat.com>
5023
5024	* elfcmp.c: Print name and index of differing section.
5025
50262005-07-24  Ulrich Drepper  <drepper@redhat.com>
5027
5028	* elfcmp.c: Implement comparing gaps between sections.
5029
50302005-07-23  Ulrich Drepper  <drepper@redhat.com>
5031
5032	* elflint.c: Include libeblP.h instead of libebl.h.
5033	* nm.c: Likewise.
5034	* readelf.c: Likewise.
5035	* elfcmp.c: Likewise.
5036
5037	* elfcmp.c (main): Compare individual ELF header fields, excluding
5038	e_shoff instead of the whole struct at once.
5039	Use ebl_section_strip_p instead of SECTION_STRIP_P.
5040	* strip.c: Use ebl_section_strip_p instead of SECTION_STRIP_P.
5041
50422005-07-22  Ulrich Drepper  <drepper@redhat.com>
5043
5044	* elfcmp.c (main): Take empty section into account when comparing
5045	section content.
5046
5047	* elflint.c (check_dynamic): Check that d_tag value is >= 0 before
5048	using it.
5049
50502005-07-21  Ulrich Drepper  <drepper@redhat.com>
5051
5052	* elfcmp.c: New file.
5053	* Makefile.am (bin_PROGRAMS): Add elfcmp.
5054	(elfcmp_LDADD): Define.
5055
5056	* elflint.c (check_rela): Check that copy relocations only reference
5057	object symbols or symbols with unknown type.
5058	(check_rel): Likewise.
5059
50602005-06-08  Roland McGrath  <roland@redhat.com>
5061
5062	* readelf.c (print_ops): Add consts.
5063
50642005-05-31  Roland McGrath  <roland@redhat.com>
5065
5066	* readelf.c (print_debug_abbrev_section): Don't bail after first CU's
5067	abbreviations.  Print a header line before each CU section.
5068
5069	* readelf.c (print_debug_loc_section): Fix indentation for larger
5070	address size.
5071
50722005-05-30  Roland McGrath  <roland@redhat.com>
5073
5074	* readelf.c (print_debug_line_section): Print section offset of each
5075	CU's table, so they are easy to find from seeing the stmt_list value.
5076
5077	* readelf.c (dwarf_attr_string): Add all attributes in <dwarf.h>.
5078	(attr_callback): Grok DW_AT_ranges and print offset in hex.
5079
5080	* readelf.c (attr_callback): Add 2 to addrsize * 2 for %#0* format.
5081	(print_debug_ranges_section, print_debug_loc_section): Likewise.
5082
5083	* readelf.c (print_ops): Take different args for indentation control.
5084	(attr_callback): Caller updated.
5085	Grok several more block-form attributes as being location expressions.
5086	For those same attributes with udata forms, format output differently
5087	for location list offset.
5088	(print_debug_loc_section): Implement it for real.
5089
5090	* readelf.c (options): Mention ranges for --debug-dump.
5091	(enum section_e): Add section_ranges.
5092	(parse_opt): Grok "ranges" for -w/--debug-dump.
5093	(print_debug_ranges_section): New function.
5094	(print_debug): Handle .debug_ranges section.
5095
50962005-05-30  Ulrich Drepper  <drepper@redhat.com>
5097
5098	* readelf.c (handle_notes): At least x86-64 need not have the note
5099	section values aligned to 8 bytes.
5100
51012005-05-18  Ulrich Drepper  <drepper@redhat.com>
5102
5103	* readelf.c (dwarf_tag_string): Add new tags.
5104
51052005-05-08  Roland McGrath  <roland@redhat.com>
5106
5107	* strip.c (handle_elf): Don't translate hash and versym data formats,
5108	elf_getdata already did it for us.
5109
51102005-05-07  Ulrich Drepper  <drepper@redhat.com>
5111
5112	* Makefile.am (findtextrel_LDADD): Add $(libmudflap).
5113	(addr2line_LDADD): Likewise.
5114
51152005-05-03  Roland McGrath  <roland@redhat.com>
5116
5117	* strip.c (handle_elf): Apply symbol table fixups to discarded
5118	relocation sections when they are being saved in the debug file.
5119
5120	* strip.c (handle_elf): Pass EHDR->e_ident[EI_DATA] to gelf_xlatetom
5121	and gelf_xlatetof, not the native byte order.
5122
5123	* strip.c (parse_opt): Give error if -f or -o is repeated.
5124	(main): Exit if argp_parse returns nonzero.
5125
5126	* strip.c (debug_fname_embed): New variable.
5127	(options, parse_opt): New option -F to set it.
5128
51292005-05-07  Ulrich Drepper  <drepper@redhat.com>
5130
5131	* readelf.c (parse_opt): Make any_control_option variable
5132	local.  Simplify some tests.
5133
51342005-05-03  Roland McGrath  <roland@redhat.com>
5135
5136	* strip.c (crc32_file): Function removed (now in ../lib).
5137
51382005-05-03  Roland McGrath  <roland@redhat.com>
5139
5140	* elflint.c (is_debuginfo): New variable.
5141	(options, parse_opt): New option --debuginfo/-d to set it.
5142	(check_sections): If is_debuginfo, don't complain about SHT_NOBITS.
5143	(check_note): If is_debuginfo, don't try to get note contents.
5144
51452005-04-24  Ulrich Drepper  <drepper@redhat.com>
5146
5147	* readelf.c (print_debug_abbrev_section): Don't print error when end of
5148	section reached.
5149
51502005-04-14  Ulrich Drepper  <drepper@redhat.com>
5151
5152	* readelf.c (dwarf_encoding_string): New function.
5153	(dwarf_inline_string): New function.
5154	(dwarf_access_string): New function.
5155	(dwarf_visibility_string): New function.
5156	(dwarf_virtuality_string): New function.
5157	(dwarf_identifier_case_string): New function.
5158	(dwarf_calling_convention_string): New function.
5159	(dwarf_ordering_string): New function.
5160	(dwarf_discr_list_string): New function.
5161	(attr_callback): Decode man more attribute values.
5162
51632005-04-01  Ulrich Drepper  <drepper@redhat.com>
5164
5165	* addr2line.c: Finish implementation of -f option.
5166
51672005-03-29  Ulrich Drepper  <drepper@redhat.com>
5168
5169	* addr2line.c: New file.
5170	* Makefile.am (bin_PROGRAMS): Add addr2line.
5171	Define addr2line_LDADD.
5172
5173	* findtextrel.c: Use new dwarf_addrdie function.
5174
5175	* findtextrel.c: Fix usage message and re-add accidentally removed
5176	line.
5177
51782005-03-28  Ulrich Drepper  <drepper@redhat.com>
5179
5180	* findtextrel.c: New file.
5181	* Makefile: Add rules to build findtextrel.
5182
51832005-02-15  Ulrich Drepper  <drepper@redhat.com>
5184
5185	* ldlex.l: Provide ECHO definition to avoid warning.
5186
5187	* elflint.c (check_program_header): Fix typo in RELRO test.
5188
5189	* Makefile.am (AM_CFLAGS): Add more warning options.
5190	* elflint.c: Fix warnings introduced by the new warning options.
5191	* i386_ld.c: Likewise.
5192	* ld.c: Likewise.
5193	* ld.h: Likewise.
5194	* ldgeneric.c: Likewise.
5195	* nm.c: Likewise.
5196	* readelf.c: Likewise.
5197	* sectionhash.c: Likewise.
5198	* size.c: Likewise.
5199	* string.c: Likewise.
5200
52012005-02-05  Ulrich Drepper  <drepper@redhat.com>
5202
5203	* Makefile.am: Check for text relocations in constructed DSOs.
5204
5205	* Makefile.am [MUDFLAP] (AM_CFLAGS): Add -fmudflap.  Link all apps
5206	with -lmudflap.
5207
5208	* ldscript.y: Add as_needed handling.
5209	* ldlex.l: Recognize AS_NEEDED token.
5210	* ld.h (struct filename_list): Add as_needed flag.
5211
52122005-02-04  Ulrich Drepper  <drepper@redhat.com>
5213
5214	* elflint.c (check_symtab): Correctly determine size of GOT section.
5215
52162005-01-19  Ulrich Drepper  <drepper@redhat.com>
5217
5218	* ld.c: Remove unnecessary more_help function.  Print bug report
5219	address using argp.
5220	* strip.c: Likewise.
5221	* size.c: Likewise.
5222	* nm.c: Likewise.
5223	* readelf.c: Likewise.
5224	* elflint.c: Likewise.
5225
5226	* elflint.c (main): Don't check for parameter problems here.
5227	(parse_opt): Do it here, where we get informed about some of them
5228	anyway.
5229
5230	* readelf.c (main): Don't check for parameter problems here.
5231	(parse_opt): Do it here, where we get informed about some of them
5232	anyway.
5233
52342005-01-11  Ulrich Drepper  <drepper@redhat.com>
5235
5236	* strip.c: Update copyright year.
5237	* readelf.c: Likewise.
5238	* size.c: Likewise.
5239	* nm.c: Likewise.
5240	* ld.c: Likewise.
5241	* elflint.c: Likewise.
5242
5243	* elflint.c (check_symtab): Don't warn about wrong size for
5244	_DYNAMIC and __GLOBAL_OFFSET_TABLE__ for --gnu-ld.
5245
52462004-10-05  Ulrich Drepper  <drepper@redhat.com>
5247
5248	* readelf.c (print_phdr): In section mapping, also indicate
5249	sections in read-only segments.
5250
52512004-09-25  Ulrich Drepper  <drepper@redhat.com>
5252
5253	* readelf.c: Make compile with gcc 4.0.
5254	* strip.c: Likewise.
5255
52562004-08-16  Ulrich Drepper  <drepper@redhat.com>
5257
5258	* strip.c (handle_elf): Rewrite dynamic memory handling to use of
5259	allocate to work around gcc 3.4 bug.
5260
52612004-01-25  Ulrich Drepper  <drepper@redhat.com>
5262
5263	* ldlex.l (invalid_char): Better error message.
5264
52652004-01-23  Ulrich Drepper  <drepper@redhat.com>
5266
5267	* readelf.c: Print SHT_GNU_LIBLIST sections.
5268
5269	* none_ld.c: New file.
5270
52712004-01-21  Ulrich Drepper  <drepper@redhat.com>
5272
5273	* Makefile.am: Enable building of machine specific linker.
5274
52752004-01-20  Ulrich Drepper  <drepper@redhat.com>
5276
5277	* Makefile.am: Support building with mudflap.
5278
5279	* i386_ld.c: Fix warnings gcc 3.4 spits out.
5280	* ldgeneric.c: Likewise.
5281	* ldscript.y: Likewise.
5282	* readelf.c: Likewise.
5283	* strip.c: Likewise.
5284
5285	* readelf.c (print_debug_line_section): Determine address size
5286	correctly.
5287
52882004-01-19  Ulrich Drepper  <drepper@redhat.com>
5289
5290	* readelf.c (print_phdr): Show which sections are covered by the
5291	PT_GNU_RELRO entry.
5292
5293	* elflint.c (check_program_header): Check PT_GNU_RELRO entry.
5294
5295	* readelf.c (print_debug_macinfo_section): Implement.
5296
52972004-01-18  Ulrich Drepper  <drepper@redhat.com>
5298
5299	* readelf.c (print_debug_line_section): Implement.
5300
53012004-01-17  Ulrich Drepper  <drepper@redhat.com>
5302
5303	* src/elflint.c: Use PACKAGE_NAME instead of PACKAGE.
5304	* src/ld.c: Likewise.
5305	* src/nm.c: Likewise.
5306	* src/readelf.c: Likewise.
5307	* src/size.c: Likewise.
5308	* src/strip.c: Likewise.
5309
5310	* strip.c: Add a few more unlikely.  Reduce scope of some variables.
5311
5312	* Makefile.am: Support building with mudflap.
5313
53142004-01-16  Ulrich Drepper  <drepper@redhat.com>
5315
5316	* readelf.c (print_debug_info_section): Free dies memory.
5317
5318	* readelf.c: Print .debug_info section content.
5319
53202004-01-13  Ulrich Drepper  <drepper@redhat.com>
5321
5322	* readelf.c (print_shdr): Add support for SHF_ORDERED and SHF_EXCLUDE.
5323
53242004-01-12  Ulrich Drepper  <drepper@redhat.com>
5325
5326	* readelf.c (print_debug_aranges): Implement using libdw.
5327
53282004-01-11  Ulrich Drepper  <drepper@redhat.com>
5329
5330	* nm.c: Adjust for Dwarf_Files type and dwarf_lineno interface change.
5331
5332	* readelf.c: Use libdw instead of libdwarf.  Not all of the old
5333	behavior is available yet.
5334	* Makefile.am: Link readelf with libdw.  Remove libdwarf include path.
5335
53362004-01-09  Ulrich Drepper  <drepper@redhat.com>
5337
5338	* nm.c (get_local_names): Adjust call to dwarf_nextcu.
5339
5340	* nm.c: Implement getting information about local variables.
5341
53422004-01-07  Ulrich Drepper  <drepper@redhat.com>
5343
5344	* nm.c: Read also debug information for local symbols.
5345
53462004-01-05  Ulrich Drepper  <drepper@redhat.com>
5347
5348	* nm.c: Shuffle dwarf handling code around so the maximum column
5349	width can be computed ahead of printing.  Avoid collection symbols
5350	which are not printed anyway.
5351
5352	* nm.c: Rewrite dwarf handling to use libdw.
5353	* Makefile.am (AM_CFLAGS): Add -std parameter.
5354	(INCLUDES): Find header in libdw subdir.
5355	(nm_LDADD): Replace libdwarf with libdw.
5356
5357	* elflint.c: Update copyright year.
5358	* readelf.c: Likewise.
5359	* size.c: Likewise.
5360	* strip.c: Likewise.
5361	* nm.c: Likewise.
5362
53632003-12-31  Ulrich Drepper  <drepper@redhat.com>
5364
5365	* strip.c (process_file): Close file before returning.
5366
53672003-11-19  Ulrich Drepper  <drepper@redhat.com>
5368
5369	* readelf.c (handle_dynamic): Make column for tag name wider.
5370
53712003-09-29  Ulrich Drepper  <drepper@redhat.com>
5372
5373	* readelf.c (handle_dynamic): Always terminate tag name with a space.
5374
53752003-09-25  Ulrich Drepper  <drepper@redhat.com>
5376
5377	* strip.c (process_file): Don't mmap the input file, we modify the
5378	data structures and don't want the change end up on disk.
5379
53802003-09-23  Jakub Jelinek  <jakub@redhat.com>
5381
5382	* unaligned.h (union u_2ubyte_unaligned,
5383	union u_4ubyte_unaligned, union u_8ubyte_unaligned): Add
5384	packed attribute.
5385	(add_2ubyte_unaligned, add_4ubyte_unaligned,
5386	add_8ubyte_unaligned): Avoid nesting bswap_NN macros.
5387	Read/store value through _ptr->u instead of *_ptr.
5388
53892003-09-22  Ulrich Drepper  <drepper@redhat.com>
5390
5391	* size.c (show_sysv): Change type of maxlen to int.
5392
5393	* strip.c (handle_elf): Handle the 64-bit archs which is 64-bit
5394	buckets.
5395
5396	* i386_ld.c: Many many fixes and extensions.
5397	* ld.c: Likewise.
5398	* ldgeneric.c: Likewise.
5399
54002003-08-16  Ulrich Drepper  <drepper@redhat.com>
5401
5402	* ldgeneric.c (check_definition): Don't add symbol on dso_list if
5403	the reference is from another DSO.
5404
54052003-08-15  Ulrich Drepper  <drepper@redhat.com>
5406
5407	* ldgeneric.c (find_entry_point): It is no fatal error if no entry
5408	point is found when creating a DSO.
5409
54102003-08-14  Ulrich Drepper  <drepper@redhat.com>
5411
5412	* ld.c (main): Always call FLAG_UNRESOLVED.
5413	* ldgeneric.c (ld_generic_flag_unresolved): Only complain about
5414	undefined symbols if not creating DSO or ld_state.nodefs is not set.
5415
54162003-08-13  Ulrich Drepper  <drepper@redhat.com>
5417
5418	* Makefile.in: Depend on libebl.a, not libebl.so.
5419
5420	* ld.c (main): Mark stream for linker script as locked by caller.
5421	(read_version_script): Likewise.
5422	* ldlex.c: Define fread and fwrite to _unlocked variant.
5423
5424	* i386_ld.c (elf_i386_finalize_plt): Replace #ifdefs with uses of
5425	target_bswap_32.
5426	* unaligned.h: Define target_bswap_16, target_bswap_32, and
5427	target_bswap_64.
5428	(store_2ubyte_unaligned, store_4ubyte_unaligned,
5429	store_8ubyte_unaligned): Define using new macros.
5430
54312003-08-12  Ulrich Drepper  <drepper@redhat.com>
5432
5433	* i386_ld.c (elf_i386_finalize_plt): Use packed structs to access
5434	possibly unaligned memory.  Support use of big endian machines.
5435
54362003-08-11  Ulrich Drepper  <drepper@redhat.com>
5437
5438	* Moved to CVS archive.
5439