Add support to readelf for the PT_OPENBSD_NOBTCFI segment type.
[binutils-gdb.git] / binutils / ChangeLog
1 2023-09-28 Frederic Cambus <fred@statdns.com>
2
3 * readelf.c (get_segment_type): Handle PT_OPENBSD_NOBTCFI segment
4 type.
5
6 2023-09-26 Nick Clifton <nickc@redhat.com>
7
8 * testsuite/binutils-all/ar.exp: Remove assumption of the setting
9 of umask when creating test archive files.
10
11 2023-09-25 Vsevolod Alekseyev <sevaa@sprynet.com>
12
13 PR 30792
14 * dwarf.h (struct debug_info): Remove range_versions field.
15 * dwarf.c (fetch_indexed_offset): New function.
16 (read_and_display_attr_value): Use it for DW_FORM_rnglistx.
17 Remove code to initialise range_versions.
18 (skip_attribute): New function.
19 (read_bases): Read and reccord all range and address bases in a CU.
20 (process_debug_info): Call read_bases.
21 (display_debug_rnglists): Rename to display_debug_rnglists_unit_header
22 and only display the range list header information.
23 (display_debug_ranges): Adjust.
24
25 2023-09-05 Nick Clifton <nickc@redhat.com>
26
27 PR 30684
28 * readelf.c (extra_sym_info): New variable.
29 (section_name_valid): Also check for filedata being NULL.
30 (section_name_print): Delete.
31 (section_index_real): New function. Returns true if the given
32 section index references a real section.
33 (print_symbol): Rename to print_sumbol_name.
34 (printable_section_name): Use a rotating array of static buffers
35 for the return string.
36 (printable_section_name_from_index): Merge code from
37 dump_relocations and get_symbol_index_type into here.
38 (long_option_values): Add OPTION_NO_EXTRA_SYM_INFO.
39 (options): Add "extra-sym-info" and "no-extra-sym-info".
40 (usage): Mention new options.
41 (parse_args): Parse new options.
42 (get_symbol_index_type): Delete.
43 (print_dynamic_symbol_size): Rename to print_symbol_size.
44 (print_dynamic_symbol): Rename to print_symbol.
45 (print_symbol_table_heading): New function.
46 (process_symbol_table): Use new function.
47 * doc/binutils.texi: Document the new option.
48 * NEWS: Mention the new feature.
49
50 2023-08-23 Nick Clifton <nickc@redhat.com>
51
52 PR 30781
53 * dwarf.h (debug_info): Add range_versions field.
54 * dwarf.c (read_and_display_attr_value): When recording a range
55 arribute also ecord the dwarf version number.
56 (is_range_list_for_this_section): New function.
57 (display_debug_ranges): Only show debug ranges whose version is
58 suitable for the secction being displayed.
59
60 2023-07-30 Jose E. Marchesi <jose.marchesi@oracle.com>
61
62 * readelf.c (get_machine_flags): Recognize and pretty print BPF
63 machine flags.
64
65 2023-07-24 Johannes Schauer Marin Rodrigues <josch@debian.org>
66
67 * doc/binutils.texi (objcopy): Document change in behaviour of
68 objcopy's --preserve-dates command line option.
69
70 2023-07-09 Fangrui Song <maskray@google.com>
71
72 PR 30592
73 * NEWS: Mention the new feature for objcopy.
74 * doc/binutils.texi: Mention "large".
75 * objcopy.c (parse_flags): Parse "large".
76 (check_new_section_flags): Error if "large" is used with a
77 non-x86-64 ELF target.
78 * testsuite/binutils-all/x86-64/large-sections.d: New.
79 * testsuite/binutils-all/x86-64/large-sections.s: New.
80 * testsuite/binutils-all/x86-64/large-sections-i386.d: New.
81 * testsuite/binutils-all/x86-64/large-sections-2.d: New.
82 * testsuite/binutils-all/x86-64/large-sections-2-x32.d: New.
83
84 2023-07-03 Nick Clifton <nickc@redhat.com>
85
86 * README-how-to-make-a-release: Change some version numbers.
87 * configure: Regenerate.
88 * po/binutils.pot: Regenerate.
89
90 2023-07-03 Nick Clifton <nickc@redhat.com>
91
92 2.41 Branch Point.
93
94 2023-06-30 Nick Clifton <nickc@redhat.com>
95
96 PR 30598
97 * strings.c (set_string_min): New function.
98 (main): Use it.
99 (print_unicode_stream): Calculate buffer size using a size_t.
100
101 2023-06-30 Nick Clifton <nickc@redhat.com>
102
103 PR 30595
104 * strings.c (main): Check for an excessively large minimum string
105 length.
106
107 2023-06-21 Nick Clifton <nickc@redhat.com>
108
109 * testsuite/lib/binutils-common.exp (prune_warnings_extra): Prune
110 warnings about -z execstack creating an executable stack.
111
112 2023-05-30 Nick Clifton <nickc@redhat.com>
113
114 * od-pe.c (targ_info): New array.
115 (get_target_specific_info): New function
116 (decode_machine_number): Retire. Use get_target_specific_info
117 instead.
118 (is_pe_object_magic): Likewise.
119 (dump_pe_file_header): Display more information.
120 Rework layout to be similar to that from 'objdump -p'.
121 Add code to handle larger than normnal AOUT headers.
122
123 2023-05-30 Nick Clifton <nickc@redhat.com>
124
125 * od-pe.c (decode_machine_number): Add ARMMAGIC value of 0xa00.
126 (is_pe_object_magic): Likewise.
127
128 2023-05-26 Nick Clifton <nickc@redhat.com>
129
130 * od-pe.c: New file: Dumps fields in PE format headers.
131 * configure.ac (od_vectors): Add objdump_private_desc_pe for PE
132 format targets.
133 (od_files): Add od-pe for PE format targets.
134 * configure: Regenerate.
135 * Makefile.am (CFILES): Add od-pe.c
136 (EXTRA_objdump_SOURCE): Likewise.
137 * Makefile.in: Generate.
138 * NEWS: Mention the new feature.
139 * doc/binutils.texi: Document the new support.
140 * objdump.c (wide_output): Change from local to global.
141 * objdump.h (wide_output): Prototype.
142 (objdump_private_desc_pe): Prototype.
143 * testsuite/binutils-all/objdump.exp: Add a test of the new feature.
144
145 2023-05-09 Enze Li <enze.li@gmx.com>
146
147 * README: Correct a typo.
148
149 2023-05-02 Nick Clifton <nickc@redhat.com>
150
151 * MAINTAINERS: Remove Dimity Diky as MSP430 maintainer.
152
153 2023-04-20 Nick Clifton <nickc@redhat.com>
154
155 * SECURITY.txt: New file.
156
157 2023-04-19 Nick Clifton <nickc@redhat.com>
158
159 PR 30355
160 * dwarf.c (read_and_display_attr_value): Correctly handle
161 DW_loclistx attributes that index a version 5 .debug_loclists
162 section.
163
164 2023-04-17 Nick Clifton <nickc@redhat.com>
165
166 PR 30142
167 * rescoff.c (write_coff_file): Add the SEC_READONLY flag to the
168 .rsrc section.
169
170 2023-04-11 Nick Clifton <nickc@redhat.com>
171
172 PR 30327
173 * dwarf.c (read_and_display_attr_value): Warn if the number of
174 views is greater than the number of locations.
175
176 PR 30313
177 * dwarf.c (display_debug_lines_decoded): Check for an overlarge
178 number of files or directories.
179
180 PR 30312
181 * dwarf.c (prealloc_cu_tu_list): Always allocate at least one
182 entry.
183
184 PR 30311
185 * readelf.c (uncompress_section_contents): Check for a
186 suspiciously large uncompressed size.
187
188 2023-03-30 Nick Clifton <nickc@redhat.com>
189
190 PR 30284
191 * dwarf.c (read_and_display_attr_value): Detect and ignore
192 negative base values.
193
194 2023-03-23 Frederic Cambus <fred@statdns.com>
195
196 * readelf.c (get_segment_type): Handle PT_OPENBSD_MUTABLE segment
197 type.
198
199 2023-03-14 Nick Clifton <nickc@redhat.com>
200
201 PR 30227
202 * dwarf.c (process_cu_tu_index): Prevent excessive memory
203 allocation when nused is large and ncols is zero.
204
205 2023-02-09 Tom Tromey <tromey@adacore.com>
206
207 * dwarf-mode.el: Bump version to 1.8.
208 (dwarf-insert-substructure): Tighten regexp.
209 (dwarf-refresh-all): New defun.
210 (dwarf-mode-map): Bind "A" to dwarf-refresh-all.
211 (dwarf-mode): Remove old FIXME.
212
213 2023-02-07 Nick Clifton <nickc@redhat.com>
214
215 PR 30080
216 * doc/binutils.texi (nm): Update description of the 'n' symbol
217 type.
218
219 2023-01-31 Nick Clifton <nickc@redhat.com>
220
221 * po/sv.po: Updated Swedish translation.
222
223 2023-01-23 Nick Clifton <nickc@redhat.com>
224
225 * po/sv.po: Updated Swedish translation.
226
227 2023-01-18 Nick Clifton <nickc@redhat.com>
228
229 PR 29993
230 * objcopy.c (merge_gnu_build_notes): Remember the last non-deleted
231 note in order to speed up the scan for matching notes.
232
233 2023-01-16 Nick Clifton <nickc@redhat.com>
234
235 * po/sv.po: Updated Swedish translation.
236
237 2023-01-09 Nick Clifton <nickc@redhat.com>
238
239 * po/bg.po: Updated Bulgarian translation.
240 * po/ro.po: Updated Romainian translation.
241
242 2023-01-05 Nick Clifton <nickc@redhat.com>
243
244 * MAINTAINERS: Remove Stephen Casner as the PDP11 maintainer.
245
246 2023-01-03 Nick Clifton <nickc@redhat.com>
247
248 * po/fr.po: Updated French translation.
249 * po/uk.po: Updated Ukrainian translation.
250
251 2023-01-03 Luis Machado <luis.machado@arm.com>
252
253 * readelf.c (get_note_type): Add support for NT_ARM_SSVE and
254 NT_ARM_ZA note types.
255
256 2022-12-31 Nick Clifton <nickc@redhat.com>
257
258 * 2.40 branch created.
259
260 2022-12-31 Nick Clifton <nickc@redhat.com>
261
262 * po/ro.po: Updated Romanian translation.
263
264 2022-12-21 Nick Clifton <nickc@redhat.com>
265
266 PR 29924
267 * objdump.c (load_specific_debug_section): Check for excessively
268 large sections.
269
270 2022-12-19 Tom Tromey <tromey@adacore.com>
271
272 * dwarf-mode.el (dwarf-do-refresh): Avoid compiler warning.
273
274 2022-12-19 Nick Clifton <nickc@redhat.com>
275
276 PR 29914
277 * dwarf.c (fetch_indexed_value): Fail if the section is not big
278 enough to contain a header size field.
279 (display_debug_addr): Fail if the computed address size is too big
280 or too small.
281
282 2022-12-16 Nick Clifton <nickc@redhat.com>
283
284 PR 29908
285 * dwarf.c (display_debug_addr): Check for corrupt header lengths.
286
287 2022-12-01 Nick Clifton <nickc@redhat.com>
288
289 PR 25202
290 * objcopy.c (copy_object): Set VerilogDataEndianness to the
291 endianness of the input file.
292 (copy_main): Verifiy the value set by the --verilog-data-width
293 option.
294 * testsuite/binutils-all/objcopy.exp: Add tests of the new behaviour.
295 * testsuite/binutils-all/verilog-I4.hex: New file.
296
297 2022-11-21 Nick Clifton <nickc@redhat.com>
298
299 PR 29764
300 * doc/binutils.texi (objdump): Note that the -m option supports
301 the <architecture>:<machine> syntax.
302
303 2022-11-04 Nick Clifton <nickc@redhat.com>
304
305 * README-how-to-make-a-release: Add instructions for uploading the
306 gprofng documentation.
307
308 2022-10-31 Nick Clifton <nickc@redhat.com>
309
310 PR 29457
311 * configure.ac: Add --enable-colored-disassembly.
312 * objdump.c: Add --disassembler-color=terminal.
313 * doc/binutils.texi (objdump): Document the new option.
314 * NEWS: Mention new feature.
315 * config.in: Regenerate in.
316 * configure: Regenerate.
317
318 2022-10-19 Nick Clifton <nickc@redhat.com>
319
320 * MAINTAINERS: Add section on patches, copyright and DCO.
321
322 2022-10-12 Nick Clifton <nickc@redhat.com>
323
324 PR 29665
325 * objcopy.c (copy_object): Use the input filename when
326 reporting that a .gnu_debuglink section already exists.
327
328 2022-10-03 Nick Clifton <nickc@redhat.com>
329
330 * readelf.c (get_32bit_section_headers): Return false if the
331 e_shoff field is zero.
332 (get_64bit_section_headers): Likewise.
333
334 2022-09-28 Nick Clifton <nickc@redhat.com>
335
336 PR 29628
337 * size.c (usage): Add -f.
338 * doc/binutils.texi (size): Add -f.
339
340 2022-09-20 Nick Clifton <nickc@redhat.com>
341
342 * objcopy.c (copy_object): Do not issue a warning message when
343 encountering empty .gnu.build.attribute sections.
344
345 2022-09-14 Rupesh Potharla <Rupesh.Potharla@amd.com>
346
347 * testsuite/binutils-all/readelf.exp (readelf_wi_test): Extend
348 regexps to allow for output genreated by the Clang compiler.
349
350 2022-09-12 Aaron Merey <amerey@redhat.com>
351
352 * objcopy.c (might_need_separate_debug_info): Add with_source_code to
353 the options that cause this function to return true.
354 (main.c): Add with_source_code to the options that enable
355 dump_any_debugging.
356
357 2022-09-09 Nick Clifton <nickc@redhat.com>
358
359 PR 29532
360 * objcopy.c (setup_section): Leave group sections intact when
361 creating separate debuginfo files.
362
363 2022-09-08 Nick Clifton <nickc@redhat.com>
364
365 PR 29523
366 * dwarf.c (display_debug_lines_decoded): Correctly handle DWARF-5
367 directory and filename tables.
368
369 2022-09-02 Aaron Merey <amerey@redhat.com>
370
371 PR 29075
372 * objdump.c (find_separate_debug): New function. Finds the bfd
373 corresponding to the separate debuginfod of a given bfd.
374 (find_alt_debug): New function. Finds the bfd corresponding to the
375 .gnu_debugaltlink of a given bfd.
376 (slurp_file): Add bfd parameter. If a source file cannot be found
377 attempt to download it from debuginfod, if enabled.
378 (try_print_file_open): Add bfd parameter and pass it to slurp_file.
379 (show_line): If debuginfod is enabled, call
380 bfd_find_nearest_line_with_alt instead of bfd_find_nearest_line.
381
382 2022-09-01 Nick Clifton <nickc@redhat.com>
383
384 PR 29534
385 * dllwrap.c: Replace uses of choose_temp_base() with
386 make_temp_file().
387 * dlltool.c: Likewise.
388 * resrc.c: Likewise.
389
390 2022-08-23 Nick Clifton <nickc@redhat.com>
391
392 PR 29489
393 * dlltool.c (deterministic): New variable.
394 (gen_lib_file): If deterministic is true set the
395 BFD_DETERMINISTIC_OUTPUT flag.
396 (usage): Mention --deterministic-libraries and
397 --non-deterministic-libraries.
398 (long_options): Add new options.
399 (main): Parse new options.
400 * doc/binutils.texi: Document the new options.
401 * NEWS: Mention the new feature.
402
403 2022-08-22 Nick Clifton <nickc@redhat.com>
404
405 * readelf.c (check_magic_number): New function. Checks the magic
406 bytes at the start of a file. If they are not the ELF format
407 magic values, then attempts to generate a helpful error message.
408 (process_file_header): Call check_magic_number.
409
410 2022-08-09 Nick Clifton <nickc@redhat.com>
411
412 PR 29457
413 * objdump.c (disassembler_color): Change type to an enum.
414 (disassembler_extended_color): Remove.
415 (usage): Update.
416 (objdump_color_for_assembler_style): Update.
417 (main): Update initialisation of disassembler_color. If not
418 initialised via a command line option, set based upon terminal
419 output.
420 * doc/binutils.texi: Update description of disassmbler-color
421 option.
422 * testsuite/binutils-all/arc/objdump.exp: Add
423 --disassembler-color=off option when disassembling.
424 * testsuite/binutils-all/arm/objdump.exp: Likewise.
425
426 2022-08-08 Nick Clifton <nickc@redhat.com>
427
428 * README-how-to-make-a-release: Add a link to the NEWS files in
429 the release announcement email.
430
431 2022-07-08 Nick Clifton <nickc@redhat.com>
432
433 * 2.39 branch created.
434
435 2022-07-01 Nick Clifton <nickc@redhat.com>
436
437 * dwarf.c (display_debug_rnglists): Add newline at end of listing.
438
439 2022-06-30 Nick Clifton <nickc@redhat.com>
440
441 * dwarf.c (dwarf_select_sections_by_name): If the entry's value is
442 zero then clear the corresponding variable.
443 (dwarf_select_sections_by_letters): Likewise.
444 * testsuite/binutils-all/debuginfo.exp: Expect -WE and -wE
445 debuginfod tests to fail.
446
447 2022-06-28 Nick Clifton <nickc@redhat.com>
448
449 PR 29267
450 * dwarf.c (display_debug_rnglists): New function, broken out of..
451 (display_debug_ranges): ... here.
452 (read_and_display_attr_value): Correct calculation of index
453 displayed for DW_FORM_loclistx and DW_FORM_rnglistx.
454 * testsuite/binutils-all/x86-64/pr26808.dump: Update expected
455 output.
456
457 2022-06-27 Nick Clifton <nickc@redhat.com>
458
459 PR 29289
460 * dwarf.c (display_debug_names): Replace assert with a warning
461 message.
462
463 2022-06-27 Nick Clifton <nickc@redhat.com>
464
465 PR 29290
466 * dwarf.c (read_and_display_attr_value): Check that debug_info_p
467 is set before dereferencing it.
468
469 2022-06-27 Nick Clifton <nickc@redhat.com>
470
471 * dwarf.c (fetch_indexed_string): Do not use length of first table
472 in string section as the length of every table in the section.
473
474 * testsuite/binutils-all/pr26112.r: Update expected output.
475
476 2022-06-22 Kumar N, Bhuvanendra <Kavitha.Natarajan@amd.com>
477
478 * dwarf.c (fetch_indexed_string): Added new parameter
479 str_offsets_base to calculate the string offset.
480 (read_and_display_attr_value): Read DW_AT_str_offsets_base
481 attribute.
482 (process_debug_info): While allocating memory and initializing
483 debug_information, do it for do_debug_info also, if its true.
484 (load_separate_debug_files): Load .debug_str_offsets if exists.
485 * dwarf.h (struct debug_info): Add str_offsets_base field.
486
487 2022-06-22 Marcus Nilsson <brainbomb@gmail.com>
488
489 * readelf.c: (slurp_relr_relocs) Use malloc instead of xmalloc
490 when allocating space for relocations.
491
492 2022-06-21 Kumar N, Bhuvanendra <Kavitha.Natarajan@amd.com>
493
494 * dwarf.h (struct debug_info): Add rnglists_base field.
495 * dwarf.c (read_and_display_attr_value): Read attribute DW_AT_rnglists_base.
496 (display_debug_rnglists_list): While handling DW_RLE_base_addressx,
497 DW_RLE_startx_endx, DW_RLE_startx_length items, pass the proper parameter
498 value to fetch_indexed_addr(), i.e. fetch the proper entry in .debug_addr section.
499 (display_debug_ranges): Add rnglists_base to the .debug_rnglists base address.
500 (load_separate_debug_files): Load .debug_addr section, if exists.
501
502 2022-05-20 Nick Clifton <nickc@redhat.com>
503
504 * dwarf.c (dwarf_select_sections_by_names): Return zero if no
505 sections were selected.
506 (dwarf_select_sections_by_letters): Likewise.
507 * dwarf.h: (dwarf_select_sections_by_names): Update prototype.
508 (dwarf_select_sections_by_letters): Update prototype.
509 * objdump.c (might_need_separate_debug_info): New function.
510 (dump_bfd): Call new function before attempting to load separate
511 debug info files.
512 (main): Do not enable dwarf section dumping for -WK or -WN.
513 * readelf.c (parse_args): Do not enable dwarf section dumping for
514 -wK or -wN.
515 (might_need_separate_debug_info): New function.
516 (process_object): Call new function before attempting to load
517 separate debug info files.
518 * testsuite/binutils-all/debuginfo.exp: Expect -WE and -wE
519 debuginfod tests to pass.
520 * testsuite/binutils-all/objdump.Wk: Add extra regexps.
521 * testsuite/binutils-all/readelf.k: Add extra regexps.
522
523 2022-05-19 Nick Clifton <nickc@redhat.com>
524
525 * dlltool.c (run): Initialise errmsg_fmt.
526 * dllwrap.c (run): Likewise.
527 * resrc.c (run_cmd): Likewise.
528 * mclex.c (mc_add_keyword): Initialise usz.
529 * srconv.c (wd_hd): Initialise hd.spare2.
530 * windmc.c (mc_add_node_lang): Initialise s.
531 (mc_generate_bin_item): Initialise cvt_txt.
532 (main): Initialise u.
533
534 2022-05-18 Nick Clifton <nickc@redhat.com>
535
536 PR 29135
537 * nm.c (non_weak): New variable.
538 (filter_symbols): When non-weak is true, ignore weak symbols.
539 (long_options): Add --no-weak.
540 (usage): Mention --no-weak.
541 (main): Handle -W/--no-weak.
542 * doc/binutils.texi: Document new feature.
543 * NEWS: Mention the new feature.
544 * testsuite/binutils-all/nm.exp: Add test of new feature.
545 * testsuite/binutils-all/no-weak.s: New test source file.
546
547 2022-04-25 Nick Clifton <nickc@redhat.com>
548
549 PR 29072
550 * testsuite/lib/binutils-common.exp (prune_warnings_extra): Filter
551 out notes about the executable stacjk behaviour beign deprecated.
552
553 2022-04-12 Nick Clifton <nickc@redhat.com>
554
555 PR 28992
556 * objcopy.c (is_strip_section_1): Do not delete debuglink sections
557 when stripping debug information.
558
559 2022-04-06 Nick Clifton <nickc@redhat.com>
560
561 PR 28981
562 * dwarf.c (fetch_indexed_value): Rename to fecth_indexed_addr and
563 return the address, rather than a string.
564 (fetch_indexed_value): New function - returns a value indexed by a
565 DW_FORM_loclistx or DW_FORM_rnglistx form.
566 (read_and_display_attr_value): Add support for DW_FORM_loclistx
567 and DW_FORM_rnglistx.
568 (process_debug_info): Load the loclists and rnglists sections.
569 (display_loclists_list): Add support for DW_LLE_base_addressx,
570 DW_LLE_startx_endx, DW_LLE_startx_length and
571 DW_LLE_default_location.
572 (display_offset_entry_loclists): New function. Displays a
573 .debug_loclists section that contains offset entry tables.
574 (display_debug_loc): Call the new function.
575 (display_debug_rnglists_list): Add support for
576 DW_RLE_base_addressx, DW_RLE_startx_endx and DW_RLE_startx_length.
577 (display_debug_ranges): Display the contents of the section's
578 header.
579 * dwarf.h (struct debug_info): Add loclists_base field.
580 * testsuite/binutils-all/dw5.W: Update expected output.
581 * testsuite/binutils-all/x86-64/pr26808.dump: Likewise.
582
583 2022-04-01 John Baldwin <jhb@FreeBSD.org>
584
585 * readelf.c (get_freebsd_elfcore_note_type): Handle
586 NT_FREEBSD_X86_SEGBASES.
587
588 2022-03-31 Nick Clifton <nickc@redhat.com>
589
590 * arlex.l: Accept the plus character as part of a filename.
591
592 2022-03-16 Fangrui Song <maskray@google.com>
593
594 PR binutils/28926
595 * objcopy.c (filter_symbols): Apply weaken to STB_GNU_UNIQUE symbols
596 * NEWS: Mention feature.
597 * testsuite/binutils-all/objcopy.exp (objcopy_test_symbol_manipulation): New test.
598 * testsuite/binutils-all/weaken-gnu-unique.s: New.
599
600 2022-03-16 Martin Storsjö <martin@martin.st>
601
602 PR 28885
603 * dlltool.c (main): use imp_name rather than dll_name when
604 generating a temporary file name.
605
606 2022-03-16 Simon Marchi <simon.marchi@efficios.com>
607
608 * readelf.c (dump_relocations): Handle EM_AMDGPU.
609
610 2022-03-16 Simon Marchi <simon.marchi@efficios.com>
611
612 * Makefile.am (readelf_CFLAGS): New.
613 (readelf_LDADD): Add MSGPACK_LIBS.
614 * Makefile.in: Re-generate.
615 * config.in: Re-generate.
616 * configure: Re-generate.
617 * configure.ac: Add --with-msgpack flag and check for msgpack
618 using pkg-config.
619 * readelf.c: Include msgpack.h if HAVE_MSGPACK.
620 (print_note_contents_hex): New.
621 (print_indents): New.
622 (dump_msgpack_obj): New.
623 (dump_msgpack): New.
624 (print_amdgpu_note): New.
625 (process_note): Handle NT_AMDGPU_METADATA note contents.
626 Use print_note_contents_hex.
627
628 2022-03-16 Simon Marchi <simon.marchi@efficios.com>
629
630 * readelf.c (get_amdgpu_elf_note_type): New.
631 (process_note): Handle "AMDGPU" notes.
632
633 2022-03-16 Simon Marchi <simon.marchi@efficios.com>
634
635 * readelf.c: Include elf/amdgcn.h.
636 (decode_AMDGPU_machine_flags): New.
637 (get_machine_flags): Handle flags for EM_AMDGPU machine type.
638
639 2022-03-16 Simon Marchi <simon.marchi@efficios.com>
640
641 * readelf.c (get_osabi_name): Handle EM_AMDGPU OS ABIs.
642
643 2022-03-16 Nick Clifton <nickc@redhat.com>
644
645 * po/sr.po: Updated Serbian translation.
646
647 2022-03-15 Tom Tromey <tromey@adacore.com>
648
649 * dwarf-mode.el: Now 1.7.
650 (dwarf--sentinel): Switch to the process buffer.
651
652 2022-03-11 Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
653
654 * MAINTAINERS: Add gprofng maintainer.
655 * README-how-to-make-a-release: Add gprofng.
656
657 2022-03-10 Nick Clifton <nickc@redhat.com>
658
659 * dwarf.c (use_debuginfod): New variable. Set to 1.
660 (load_separate_debug_info): Only call
661 debuginfod_fetch_separate_debug_info is use_debuginfod is true.
662 (dwarf_select_sections_by_names): Add do-not-use-debuginfod and
663 use-debuginfod options.
664 (dwarf_select_sections_by_letters): Add D and E options.
665 * dwarf.h (use_debuginfod): New extern.
666 * objdump.c (usage): Mention the new options.
667 * readelf.c (usage): Likewise.
668 * doc/binutils.texi: Document the new options.
669 * doc/debug-options.texi: Describe the new options.
670 * NEWS: Mention the new feature.
671 * testsuite/binutils-all/debuginfod.exp: Add tests of the new
672 options.
673
674 2021-03-06 Maciej W. Rozycki <macro@orcam.me.uk>
675
676 * testsuite/binutils-all/mips/mips1-branch-alias.d: New test.
677 * testsuite/binutils-all/mips/mips1-branch-noalias.d: New test.
678 * testsuite/binutils-all/mips/mips2-branch-alias.d: New test.
679 * testsuite/binutils-all/mips/mips2-branch-noalias.d: New test.
680 * testsuite/binutils-all/mips/mips32r6-branch-alias.d: New test.
681 * testsuite/binutils-all/mips/mips32r6-branch-noalias.d: New
682 test.
683 * testsuite/binutils-all/mips/micromips-branch-alias.d: New
684 test.
685 * testsuite/binutils-all/mips/micromips-branch-noalias.d: New
686 test.
687 * testsuite/binutils-all/mips/mips-branch-alias.s: New test
688 source.
689 * testsuite/binutils-all/mips/micromips-branch-alias.s: New test
690 source.
691 * testsuite/binutils-all/mips/mips.exp: Run the new tests.
692
693 2022-03-04 Simon Marchi <simon.marchi@polymtl.ca>
694
695 * readelf.c (process_dynamic_section): Fix indentation.
696
697 2022-02-09 Nick Clifton <nickc@redhat.com>
698
699 * README-how-to-make-a-release: Update after the 2.38 release.
700
701 2022-01-27 Nick Clifton <nickc@redhat.com>
702
703 * po/sv.po: Updated Swedish translation.
704
705 2022-01-24 Nick Clifton <nickc@redhat.com>
706
707 * po/bg.po: Updated Bulgarian translation.
708 * po/fr.po: Updated French translation.
709 * po/ro.po: Updated Romanian translation.
710 * po/uk.po: Updated Ukranian translation.
711
712 2022-01-22 Martin Storsjö <martin@martin.st>
713
714 * dlltool.c (main): Allow inferring tmp_prefix from the dll name
715 from a def file.
716
717 2022-01-22 Nick Clifton <nickc@redhat.com>
718
719 * configure: Regenerate.
720 * po/binutils.pot: Regenerate.
721
722 2022-01-22 Nick Clifton <nickc@redhat.com>
723
724 * 2.38 release branch created.
725
726 2022-01-17 Nick Clifton <nickc@redhat.com>
727
728 * Makefile.in: Regenerate.
729
730 2022-01-11 Fangrui Song <maskray@google.com>
731
732 PR binutils/28759
733 * ar.c (long_options): Add --thin.
734 (usage) Add --thin. Deprecate -T without diagnostics.
735 * doc/binutils.texi: Add doc.
736 * NEWS: Mention --thin.
737 * binutils/testsuite/binutils-all/ar.exp: Add tests.
738
739 2022-01-11 Martin Storsjö <martin@martin.st>
740
741 * dlltool.c (main): If a prefix has not been provided, attempt to
742 use a deterministic one based upon the dll name.
743
744 2022-01-07 Pavel Mayorov <pmayorov@cloudlinux.com>
745
746 PR 28718
747 * dwarf.c: Revert previous delta.
748 (debug_get_real_type): Reject indirect types that point to
749 indirect types.
750 (debug_get_type_name, debug_get_type_size, debug_write_type):
751 Likewise.
752
753 2022-01-06 Nick Clifton <nickc@redhat.com>
754
755 * debug.c (debug_write_type): Allow for malicious recursion via
756 indirect debug types.
757
758 2022-01-04 Nick Clifton <nickc@redhat.com>
759
760 PR 28716
761 * dwarf.c (load_build_id_debug_file): Remove spurious printf.
762
763 2021-12-16 Nick Clifton <nickc@redhat.com>
764
765 PR 28697
766 * dwarf.c (load_build_id_debug_file): New function.
767 (try_build_id_prefix): New function.
768 (check_for_and_load_links): Call load_build_id_debug_file.
769 (debug_displays): Add entry for .note.gnu.build-id.
770 * dwarf.h (enum dwarf_section_display_enum): Add
771 note_gnu_build_id.
772 * testsuite/binutils-all/debuginfod.exp (test_fetch_debuglink):
773 Fix regexp for loads via debuglink section.
774
775 2021-12-03 Chenghua Xu <xuchenghua@loongson.cn>
776
777 * MAINTAINERS: Add myself and Zhensong Liu
778 as the LoongArch maintainer.
779
780 2021-12-02 Nick Clifton <nickc@redhat.com>
781
782 PR 28645
783 * dwarf.c (process_cu_tu_index): Add test for overruning section
784 whilst processing slots.
785
786 2021-11-30 Roland McGrath <mcgrathr@google.com>
787
788 * doc/local.mk: Give each man page target its missing dependency on
789 doc/$(am__dirstamp).
790
791 2021-11-30 Nick Clifton <nickc@redhat.com>
792
793 * dwarf.c (find_debug_info_for_offset): Use dwarf_vma type for
794 offsets, sizes and ranges.
795 (display_loc_list): Likewise. Also use print_dwarf_vma to print
796 the offset.
797 (display_loclists_list): Likewise.
798 (display_loc_list_dwo): Likewise.
799 (display_debug_str): Likewise.
800 (display_debug_aranges): Likewise.
801 (display_debug_ranges_list): Likewise.
802 (display_debug_rnglists_list): Likewise.
803 (display_debug_ranges): Likewise.
804
805 2021-11-29 Nick Clifton <nickc@redhat.com>
806
807 PR 28632
808 * strings.c (usage): Update desciption of -n option.
809 * doc/binutils.texi: Likewise.
810
811 2021-11-24 Nick Clifton <nickc@redhat.com>
812
813 PR 28564
814 * sysdump.c (getCHARS): Check for an out of bounds read.
815
816 2021-11-16 Fangrui Song <maskray@google.com>
817
818 * readelf.c (enum relocation_type): New.
819 (slurp_relr_relocs): New.
820 (dump_relocations): Change is_rela to rel_type.
821 Dump RELR.
822 (dynamic_relocations): Add DT_RELR.
823 (process_relocs): Check SHT_RELR and DT_RELR.
824 (process_dynamic_section): Store into dynamic_info for
825 DT_RELR/DT_RELRENT/DT_RELRSZ.
826
827 2021-11-09 Nick Clifton <nickc@redhat.com>
828
829 * nm.c: Add --unicode option to control how unicode characters are
830 handled.
831 * objdump.c: Likewise.
832 * readelf.c: Likewise.
833 * strings.c: Likewise.
834 * binutils.texi: Document the new feature.
835 * NEWS: Document the new feature.
836 * testsuite/binutils-all/unicode.exp: New file.
837 * testsuite/binutils-all/nm.hex.unicode
838 * testsuite/binutils-all/strings.escape.unicode
839 * testsuite/binutils-all/objdump.highlight.unicode
840 * testsuite/binutils-all/readelf.invalid.unicode
841
842 2021-11-03 Tom Tromey <tromey@adacore.com>
843
844 * dwarf.c (display_debug_loc): Use section name in warnings.
845
846 2021-10-25 Nick Alcock <nick.alcock@oracle.com>
847
848 * objdump.c (usage): --ctf now has an optional argument.
849 (main): Adjust accordingly.
850 (dump_ctf): Default it.
851 * doc/ctf.options.texi: Adjust.
852
853 2021-10-25 Nick Alcock <nick.alcock@oracle.com>
854
855 * objdump.c (usage): --ctf-parent now takes a name, not a section.
856 (dump_ctf): Don't open a separate section; use the parent_name in
857 ctf_dict_open instead. Use ctf_archive_next, not ctf_archive_iter,
858 so we can pass down a member count.
859 (dump_ctf_archive_member): Add the member count; don't return
860 anything. Import parents into children no matter what the
861 parent's name, while still avoiding displaying the header for the
862 common parent name of ".ctf".
863 * readelf.c (usage): Adjust similarly.
864 (dump_section_as_ctf): Likewise.
865 (dump_ctf_archive_member): Likewise. Never stop iterating over
866 archive members, even if ctf_dump of one member fails.
867 * doc/ctf.options.texi: Adjust.
868
869 2021-10-19 Nick Clifton <nickc@redhat.com>
870
871 * nm.c (filter_symbols): Test for a NULL name before checking to
872 see if the symbol is __gnu_lto_slim.
873 * objcopy.c (filter_symbols): Likewise.
874
875 2021-09-30 Nick Clifton <nickc@redhat.com>
876
877 * objcopy.c (filter_symbols): Fail if attempting to dredefine
878 symbols in an LTO object file.
879
880 2021-09-27 Nick Alcock <nick.alcock@oracle.com>
881
882 * configure: Regenerate.
883
884 2021-09-20 Andrew Burgess <andrew.burgess@embecosm.com>
885
886 * testsuite/binutils-all/riscv/riscv.exp: New file.
887 * testsuite/binutils-all/riscv/unknown.d: New file.
888 * testsuite/binutils-all/riscv/unknown.s: New file.
889
890 2021-09-07 Luis Machado <luis.machado@linaro.org>
891
892 Revert: [AArch64] MTE corefile support
893
894 2021-05-21 Luis Machado <luis.machado@linaro.org>
895
896 * readelf.c (get_note_type): Handle NT_MEMTAG note types.
897
898 2021-08-11 Nick Clifton <nickc@redhat.com>
899
900 * po/pt.po: Updated Portuguese translation.
901
902 2021-08-10 Nick Clifton <nickc@redhat.com>
903
904 * po/sr.po: Updated Serbian translation.
905
906 2021-07-16 Nick Clifton <nickc@redhat.com>
907
908 * po/sv.po: Updated Swedish translation.
909
910 2021-07-14 Clément Chigot <clement.chigot@atos.net>
911
912 * dwarf.h (struct dwarf_section): Add XCOFF name.
913 * dwarf.c (struct dwarf_section_display): Update.
914 * objdump.c (load_debug_section): Add XCOFF name handler.
915 (dump_dwarf_section): Likewise.
916
917 2021-07-12 Nick Clifton <nickc@redhat.com>
918
919 * po/fr.po: Updated French translation.
920
921 2021-07-10 Alan Modra <amodra@gmail.com>
922
923 PR 28069
924 * dwarf.c (display_discr_list): Remove assertions. Delete "end"
925 parameter, use initial "data" pointer as the end. Formatting.
926 Don't count down bytes as they are read.
927 (read_and_display_attr_value): Adjust display_discr_list call.
928 (read_and_print_leb128): Don't pass __FILE__ and __LINE__ to
929 report_leb_status.
930 * dwarf.h (report_leb_status): Don't report file and line
931 numbers. Delete file and lnum parameters,
932 (READ_ULEB, READ_SLEB): Adjust.
933
934 2021-07-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
935
936 * configure.ac: Check for strnlen declaration.
937 * configure, config.in: Regenerate.
938
939 2021-07-05 Alan Modra <amodra@gmail.com>
940
941 PR 28047
942 * dwarf.c (get_type_abbrev_from_form): Add cu_end parameter.
943 Check DW_FORM_ref1 etc. arg against cu_end rather than end of
944 section. Adjust all callers.
945
946 2021-07-03 Nick Clifton <nickc@redhat.com>
947
948 * configure: Regenerate.
949 * po/opcodes.pot: Regenerate.
950 * README-how-to-make-a-release: Update.
951
952 2021-07-03 Nick Clifton <nickc@redhat.com>
953
954 * 2.37 release branch created.
955
956 2021-07-02 Alan Modra <amodra@gmail.com>
957
958 PR 28048
959 * dwarf.c (get_type_signedness): Don't run off end of buffer
960 printing DW_FORM_string attribute.
961
962 2021-07-01 Nick Clifton <nickc@redhat.com>
963
964 PR 28029
965 * testsuite/binutils-all/debuginfod.exp: Replace -wK with -wk.
966
967 2021-07-01 Andrei Homescu <ah@immunant.com>
968
969 * readelf.c (process_archive): Reset file position to the
970 beginning when calling process_object for thin archive members.
971 * testsuite/binutils-all/readelf.exp: Add test.
972 * testsuite/binutils-all/readelf.h.thin: New file.
973
974 2021-06-30 Tom Tromey <tom@tromey.com>
975
976 * dwarf.c (read_and_display_attr_value): Handle
977 DW_FORM_implicit_const.
978
979 2021-06-30 Richard Henderson <richard.henderson@linaro.org>
980
981 * dwarf.c (display_debug_frames): Both DW_CFA_def_cfa_sf
982 and DW_CFA_def_cfa_offset_sf have a signed offset.
983
984 2021-06-19 Alan Modra <amodra@gmail.com>
985
986 * dwarf.c (display_debug_lines_decoded): Use memcpy rather than
987 strncpy when trimming file name length to MAX_FILENAME_LENGTH.
988 Don't make an unnecessary copy when length is good.
989
990 2021-06-18 H.J. Lu <hongjiu.lu@intel.com>
991
992 * readelf.c (print_gnu_property_note): Handle
993 GNU_PROPERTY_UINT32_AND_LO, GNU_PROPERTY_UINT32_AND_HI,
994 GNU_PROPERTY_UINT32_OR_LO and GNU_PROPERTY_UINT32_OR_HI.
995
996 2021-06-15 Nick Clifton <nickc@redhat.com>
997
998 * readelf.c (get_note_type): Add support for NT_GO_BUILDID.
999
1000 2021-06-15 Alan Modra <amodra@gmail.com>
1001
1002 * readelf.c (locate_dynamic_section, is_pie): New functions.
1003 (get_file_type): Replace e_type parameter with filedata. Call
1004 is_pie for ET_DYN. Update all callers.
1005 (process_program_headers): Use local variables dynamic_addr and
1006 dynamic_size, updating filedata on exit from function. Set
1007 dynamic_size of 1 to indicate no dynamic section or segment.
1008 Update tests of dynamic_size throughout.
1009 * testsuite/binutils-all/x86-64/pr27708.dump: Update expected output.
1010
1011 2021-06-14 Eric Botcazou <ebotcazou@adacore.com>
1012
1013 * dwarf.c (struct abbrev_attr): Change type of implicit_const.
1014 (add_abbrev_attr): Likewise.
1015 (process_abbrev_set): Likewise.
1016 (display_debug_abbrev): Adjust to above change.
1017
1018 2021-06-12 Alan Modra <amodra@gmail.com>
1019
1020 * readelf.c (process_file_header): Don't clear section_headers.
1021
1022 2021-06-12 Alan Modra <amodra@gmail.com>
1023
1024 * readelf.c (get_section_headers): Don't test e_shoff here, leave
1025 that to get_32bit_section_headers or get_64bit_section_headers.
1026 (process_object): Throw away section header read to print file
1027 header extension.
1028
1029 2021-06-11 Alan Modra <amodra@gmail.com>
1030
1031 * readelf.c (struct filedata): Move archive_file_offset and
1032 archive_file_size earlier.
1033 (free_filedata): Clear using memset.
1034
1035 2021-06-11 Alan Modra <amodra@gmail.com>
1036
1037 * readelf.c (GET_ELF_SYMBOLS): Delete. Replace with..
1038 (get_elf_symbols): ..this new function throughout.
1039 (get_32bit_section_headers): Don't free section_headers.
1040 (get_64bit_section_headers): Likewise.
1041 (get_section_headers): New function, use throughout in place of
1042 32bit and 64bit variants.
1043 (get_dynamic_section): Similarly.
1044 (process_section_headers): Don't free filedata memory here.
1045 (get_file_header): Don't get section headers here..
1046 (process_object): ..Read them here instead. Don't exit without
1047 freeing filedata memory.
1048
1049 2021-06-09 Nick Clifton <nickc@redhat.com>
1050
1051 * MAINTAINERS: Remove Daniel Jacobwitz from the maintainers list.
1052
1053 2021-06-07 Jan Beulich <jbeulich@suse.com>
1054
1055 * dwarf.c (display_debug_aranges): Add u suffix to constant.
1056
1057 2021-05-29 Alan Modra <amodra@gmail.com>
1058
1059 * objdump (usage): Add missing \n.
1060
1061 2021-05-29 Alan Modra <amodra@gmail.com>
1062
1063 * readelf.c (parse_args): Call dwarf_select_sections_all on
1064 --debug-dump without optarg.
1065 (usage): Associate -w and --debug-dump options closely.
1066 Split up help message. Remove extraneous blank lines around
1067 ctf help.
1068 * objdump.c (usage): Similarly.
1069
1070 2021-05-29 Maciej W. Rozycki <macro@orcam.me.uk>
1071
1072 * testsuite/binutils-all/mips/mips-xpa-virt-1.d: Correct CFC0
1073 operand disassembly.
1074 * testsuite/binutils-all/mips/mips-xpa-virt-3.d: Likewise.
1075
1076 2021-05-29 Maciej W. Rozycki <macro@orcam.me.uk>
1077
1078 * testsuite/binutils-all/mips/mips-xpa-virt-1.d: Use `mips:3000'
1079 machine for disassembly.
1080 * testsuite/binutils-all/mips/mips-xpa-virt-2.d: Likewise.
1081 * testsuite/binutils-all/mips/mips-xpa-virt-3.d: Likewise.
1082 * testsuite/binutils-all/mips/mips-xpa-virt-4.d: Likewise.
1083
1084 2021-05-28 H.J. Lu <hongjiu.lu@intel.com>
1085
1086 PR ld/27905
1087 * readelf.c (decode_x86_feature_2): Revert commit 50c95a739c9.
1088
1089 2021-05-27 Alan Modra <amodra@gmail.com>
1090
1091 * readelf (usage): Order -w letters to match --debug-dump= and
1092 move common '=' for --debug-dump out of brackets.
1093
1094 2021-05-26 H.J. Lu <hongjiu.lu@intel.com>
1095
1096 PR ld/27905
1097 * readelf.c (decode_x86_feature_2): Support
1098 GNU_PROPERTY_X86_FEATURE_2_CODE16.
1099
1100 2021-05-23 Tiezhu Yang <yangtiezhu@loongson.cn>
1101
1102 * readelf.c (get_machine_name): Change Loongson Loongarch to
1103 LoongArch.
1104
1105 2021-05-21 Luis Machado <luis.machado@linaro.org>
1106
1107 * readelf.c (get_note_type): Add missing NT_ARM_* entries.
1108
1109 2021-05-21 Luis Machado <luis.machado@linaro.org>
1110
1111 * readelf.c (get_note_type): Handle NT_MEMTAG note types.
1112
1113 2021-05-19 Eli Schwartz <eschwartz@archlinux.org>
1114
1115 * dwarf.c (ENABLE_CHECKING): Define to 0 if not previously set.
1116
1117 2021-05-19 Alan Modra <amodra@gmail.com>
1118
1119 PR 27884
1120 * dwarf.c (get_type_abbrev_from_form): Replace cu_offset_return
1121 param with map_return, and return map for DW_FORM_ref_addr.
1122 (get_type_signedness): Adjust calls to get_type_abbrev_from_form.
1123 Pass returned cu map start and end to recursive call.
1124 (read_and_display_attr_value): Similarly.
1125
1126 2021-05-19 Alan Modra <amodra@gmail.com>
1127
1128 PR 27879
1129 * sysdump.c (getBARRAY): Sanity check size against max.
1130 (getINT): Avoid UB shift left.
1131
1132 2021-05-15 Alan Modra <amodra@gmail.com>
1133
1134 * dwarf.c (process_cu_tu_index): Avoid pointer UB. Use _mul_overflow.
1135 Delete dead code.
1136
1137 2021-05-15 Alan Modra <amodra@gmail.com>
1138
1139 * dwarf.c (display_gdb_index): Avoid pointer UB and overflow in
1140 length calculations.
1141
1142 2021-05-15 Alan Modra <amodra@gmail.com>
1143
1144 * dwarf.c (display_debug_names): Complain when header length is
1145 too small. Avoid pointer UB. Sanity check augmentation string,
1146 CU table, TU table and foreign TU table sizes.
1147
1148 2021-05-15 Alan Modra <amodra@gmail.com>
1149
1150 * dwarf.c (display_debug_frames): Delete initial_length_size.
1151 Avoid pointer UB. Constrain data reads to length given in header.
1152 Sanity check cie header length. Only skip up to next FDE on
1153 finding augmentation data too long.
1154
1155 2021-05-15 Alan Modra <amodra@gmail.com>
1156
1157 * dwarf.c (read_cie): Add more sanity checks to ensure data
1158 pointer is not bumped past end.
1159
1160 2021-05-15 Alan Modra <amodra@gmail.com>
1161
1162 * dwarf.c (display_debug_ranges): Delete initial_length_size.
1163 Correct fallback size calculated on finding a reloc. Constrain
1164 data reads to length given in header. Avoid pointer UB.
1165
1166 2021-05-15 Alan Modra <amodra@gmail.com>
1167
1168 * dwarf.c (display_debug_rnglists_list): Avoid pointer UB.
1169
1170 2021-05-15 Alan Modra <amodra@gmail.com>
1171
1172 * dwarf.c (display_debug_str_offsets): Constrain reads to length
1173 given in header.
1174
1175 2021-05-15 Alan Modra <amodra@gmail.com>
1176
1177 * dwarf.c (display_debug_aranges): Delete initial_length_size.
1178 Use end_ranges to constrain data reads to header length. Avoid
1179 pointer UB.
1180
1181 2021-05-15 Alan Modra <amodra@gmail.com>
1182
1183 * dwarf.c (display_loc_list): Avoid pointer UB. Correct check
1184 before reading uleb length. Warn on excess length.
1185
1186 2021-05-15 Alan Modra <amodra@gmail.com>
1187
1188 * dwarf.c (display_debug_macro): Print strings that might not
1189 be zero terminated with %*s. Don't bump curr if unterminated.
1190
1191 2021-05-15 Alan Modra <amodra@gmail.com>
1192
1193 * dwarf.c (get_line_filename_and_dirname): Delete initial_length_size.
1194 Simplify length sanity check, and check for too small lengths.
1195 Constrain data reads to header length. Avoid pointer UB.
1196
1197 2021-05-15 Alan Modra <amodra@gmail.com>
1198
1199 * dwarf.c (display_debug_macinfo): Print strings that might not
1200 be zero terminated with %*s. Don't bump curr if unterminated.
1201
1202 2021-05-15 Alan Modra <amodra@gmail.com>
1203
1204 * dwarf.c (display_debug_pubnames_worker): Delete initial_length_size.
1205 Simplify length check. Constrain reads to length given by header.
1206
1207 2021-05-15 Alan Modra <amodra@gmail.com>
1208
1209 * dwarf.c (display_debug_lines_decoded): Don't use strnlen when
1210 we have already checked for NUL termination.
1211
1212 2021-05-15 Alan Modra <amodra@gmail.com>
1213
1214 * dwarf.c (read_debug_line_header): Delete initial_length_size.
1215 Avoid pointer UB. Keep within length specified by header.
1216 Delete dead code.
1217
1218 2021-05-15 Alan Modra <amodra@gmail.com>
1219
1220 * dwarf.c (process_debug_info): Always do the first CU length
1221 scan for sanity checks. Remove initial_length_size var and
1222 instead calculate end_cu. Use end_cu to limit data reads.
1223 Delete now dead code checking length.
1224
1225 2021-05-15 Alan Modra <amodra@gmail.com>
1226
1227 * dwarf.c (SAFE_BYTE_GET_INTERNAL): Assert only when ENABLE_CHECKING.
1228
1229 2021-05-15 Alan Modra <amodra@gmail.com>
1230
1231 * bucomm.h (_mul_overflow): Define.
1232 * dwarf.c (get_encoded_value): Avoid pointer UB.
1233
1234 2021-05-13 Alan Modra <amodra@gmail.com>
1235
1236 PR 27861
1237 * dwarf.c (display_debug_str_offsets): Sanity check dwarf5
1238 header length.
1239
1240 2021-05-13 Alan Modra <amodra@gmail.com>
1241
1242 PR 27860
1243 * dwarf.c (display_debug_frames): Sanity check cie_off before
1244 attempting to read cie.
1245
1246 2021-05-12 Alan Modra <amodra@gmail.com>
1247
1248 * dwarf.c (process_extended_line_op): Don't bump data pointer past
1249 end when strnlen doesn't find string terminator.
1250 (decode_location_expression): Remove dead code.
1251 (skip_attr_bytes): Remove const from end param. Ensure data
1252 pointer doesn't pass end.
1253 (get_type_signedness): Remove const from end param.
1254 (read_and_display_attr_value): Ensure data pointer doesn't pass end.
1255 (display_debug_lines_raw, display_debug_lines_decoded): Likewise.
1256 (display_debug_pubnames_worker): Likewise.
1257 (display_debug_pubnames_worker): Use SAFE_BYTE_GET_AND INC rather
1258 than blindly incrementing data pointer.
1259 (display_debug_addr, display_debug_str_offsets): Likewise. Don't
1260 compare pointers, compare lengths.
1261
1262 2021-05-12 Alan Modra <amodra@gmail.com>
1263
1264 * dwarf.c (SAFE_BYTE_GET_INTERNAL): Define.
1265 (SAFE_BYTE_GET, SAFE_BYTE_GET_AND_INC): Define using the above.
1266 (SAFE_SIGNED_BYTE_GET, SAFE_SIGNED_BYTE_GET_AND_INC): Likewise.
1267 (display_discr_list): Use SAFE_BYTE_GET_AND_INC rather than
1268 SAFE_BYTE_GET followed by increment.
1269 (process_debug_info): Likewise, and test bytes remaining before
1270 incrementing section_begin rather than using pointer comparison.
1271 (display_debug_names): Pass lvalue as SAFE_BYTE_GET PTR.
1272 (process_cu_tu_index): Likewise for SAFE_BYTE_GET_AND_INC.
1273
1274 2021-05-12 Alan Modra <amodra@gmail.com>
1275
1276 * dwarf.c (dwarf_vmatoa64, SAFE_BYTE_GET64, add64): Delete.
1277 (skip_attr_bytes): Replace use of SAFE_BYTE_GET64 with
1278 SAFE_BYTE_GET_AND_INC.
1279 (read_and_display_attr_value): Likewise. Print using dwarf_vmatoa.
1280 (process_debug_info, process_cu_tu_index): Likewise.
1281 * elfcomm.c (byte_put, byte_put_little_endian, byte_put_big_endian),
1282 (byte_get, byte_get_little_endian, byte_get_big_endian),
1283 (byte_get_signed): Make size param unsigned. Remove code dealing
1284 with 4-byte elf_vma.
1285 (byte_get_64): Delete.
1286 * elfcomm.h (byte_put, byte_put_little_endian, byte_put_big_endian),
1287 (byte_get, byte_get_little_endian, byte_get_big_endian),
1288 (byte_get_signed): Update prototypes.
1289 (byte_get_64): Delete.
1290
1291 2021-05-12 Alan Modra <amodra@gmail.com>
1292
1293 PR 27836
1294 * dwarf.c (display_debug_frames): Don't compare pointers derived
1295 from user input. Test offset against bounds instead.
1296
1297 2021-05-12 Alan Modra <amodra@gmail.com>
1298
1299 PR 27853
1300 * dwarf.c (display_formatted_table): Test for data >= end rather
1301 than data == end.
1302 (process_extended_line_op): Likewise.
1303 (display_debug_lines_raw): Likewise.
1304 (display_debug_lines_decoded): Likewise.
1305
1306 2021-05-12 Alan Modra <amodra@gmail.com>
1307
1308 PR 27849
1309 * dwarf.c (fetch_indexed_string): Correct length sanity checks.
1310 Sanity check section size for version and padding too. Correct
1311 index sanity check. Handle multiple tables in .debug_str_offsets.
1312
1313 2021-05-11 Hans-Peter Nilsson <hp@axis.com>
1314
1315 * dwarf.c (process_abbrev_set): Properly parenthesize before
1316 casting to unsigned long.
1317
1318 2021-05-11 Alan Modra <amodra@gmail.com>
1319
1320 PR 27845
1321 * dwarf.c (process_abbrev_set): Replace start and end parameters
1322 with section, abbrev_base, abbrev_size, abbrev_offset. Update
1323 all callers. Sanity check parameters correctly and emit warnings
1324 here rather than..
1325 (process_debug_info): ..here.
1326
1327 2021-05-10 Thomas Wolff <towo@towo.net>
1328
1329 PR 4356
1330 PR 26865
1331 PR 27594
1332 * windres.c (quot): Revert previous delta. Do not use double
1333 quotes when spaces are detected in options.
1334 * doc/binutils.texi (windres): Remove suggestion that the
1335 --preprocessor option can take arguments.
1336
1337 2021-05-10 Alan Modra <amodra@gmail.com>
1338
1339 * dwarf.c (SAFE_BYTE_GET): Check bounds by subtracting amount from
1340 END rather than adding amount to PTR.
1341 (SAFE_SIGNED_BYTE_GET, SAFE_BYTE_GET64): Likewise.
1342
1343 2021-05-09 Alan Modra <amodra@gmail.com>
1344
1345 * objcopy.c (eq_string): Delete.
1346 (create_symbol_htab): Use htab_eq_string.
1347
1348 2021-05-08 Mike Frysinger <vapier@gentoo.org>
1349
1350 * README-how-to-make-a-release: Update html & pdf entries.
1351
1352 2021-05-08 Mike Frysinger <vapier@gentoo.org>
1353
1354 * doc/Makefile.am (html-local, binutils/index.html): New targets.
1355 * doc/Makefile.in: Regenerate.
1356
1357 2021-05-08 Mike Frysinger <vapier@gentoo.org>
1358
1359 * doc/Makefile.am (AM_MAKEINFOFLAGS): Add --no-split.
1360 * doc/Makefile.in: Regenerate.
1361
1362 2021-05-07 Nick Clifton <nickc@redhat.com>
1363
1364 * readelf.c (no_processor_specific_unwind): New function.
1365 (process_unwind): Use no_processor_specific_unwind for X86
1366 targets.
1367
1368 2021-05-07 Michael Forney <mforney@mforney.org>
1369
1370 * dwarf.c: Don't omit second operand of '?' operator.
1371
1372 2021-04-30 Nick Clifton <nickc@redhat.com>
1373
1374 PR 27796
1375 * dwarf.c (load_debug_sup_file): Allocate memory for filename in
1376 .debug_sup section.
1377
1378 2021-04-29 Nick Clifton <nickc@redhat.com>
1379
1380 PR 27594
1381 * doc/binutils.texi (windres): Correct the description of the
1382 default value of the --preprocessor argument.
1383
1384 2021-04-27 Nick Clifton <nickc@redhat.com>
1385
1386 PR 27779
1387 * dwarf.c (parse_gnu_debuglink): Reject empty names.
1388 (parse_gnu_debugaltlink): Likewise.
1389
1390 2021-04-22 Clément Chigot <clement.chigot@atos.net>
1391
1392 * od-xcoff.c (dump_xcoff32_symbols): Adapt to new
1393 aux structures.
1394
1395 2021-04-21 Nick Lott <nick.lott@gmail.com>
1396
1397 PR 27672
1398 * readelf.c (sym_base): New variable.
1399 (enum print_mode): Add more modes.
1400 (print_vma): Add suport for new modes.
1401 (options): Add sym-base.
1402 (usage): Add sym-base.
1403 (parse_args): Add support for --sym-base.
1404 (print_dynamic_symbol_size): New function.
1405 (print_dynamic_symbol): Use new function.
1406 * doc/binutils.texi: Document the new feature.
1407 * NEWS: Mention the new feature.
1408
1409 2021-04-21 Nick Clifton <nickc@redhat.com>
1410
1411 * testsuite/binutils-all/mips/global-local-symtab-sort-n64t.d:
1412 Adjust expected output to allow for named section symbols.
1413 * testsuite/binutils-all/mips/global-local-symtab-sort-o32t.d:
1414 Likewise.
1415 * testsuite/binutils-all/readelf.s-64: Likewise.
1416 * testsuite/binutils-all/readelf.ss-64-unused: Likewise.
1417 * testsuite/binutils-all/readelf.ss-tmips: Likewise.
1418 * testsuite/binutils-all/readelf.ss-unused: Likewise.
1419
1420 2021-04-21 Luo Longjun <luolongjun@huawei.com>
1421
1422 * readelf.c (print_dynamic_symbol): Print the section name for
1423 section symbols without a name of their own.
1424
1425 2021-04-20 Andreas Krebbel <krebbel@linux.ibm.com>
1426
1427 * MAINTAINERS: Remove Martin Schwidefsky as s390 maintainer and
1428 add him to Past Maintainers.
1429 Update my email address.
1430
1431 2021-04-19 Nick Clifton <nickc@redhat.com>
1432
1433 PR 21702
1434 * arsup.c (ar_addmod): Enable plugin support, if available.
1435
1436 2021-04-19 Nick Clifton <nickc@redhat.com>
1437
1438 * rename.c: (get_stat_atime_ns): Add prototype.
1439 (get_stat_mtime_ns): Add prototype.
1440
1441 2021-04-16 Alan Modra <amodra@gmail.com>
1442
1443 PR 27725
1444 * rename.c (get_stat_atime, get_stat_mtime): Make static.
1445 (get_stat_atime_ns, get_stat_mtime_ns): Likewise.
1446
1447 2021-04-15 Pekka Seppänen <pexu@sourceware.mail.kapsi.fi>
1448
1449 PR 27725
1450 * rename.c (get_stat_atime_ns): Add ATTRIBUTE_UNUSED.
1451 (get_stat_mtime_ns): Likewise.
1452
1453 2021-04-15 Alan Modra <amodra@gmail.com>
1454
1455 PR 27725
1456 * configure.ac: Check for sys/time.h and utimensat. Use standard
1457 checks for mkstemp and mkdtemp. Whitespace. Check for nanosecond
1458 members of struct stat.
1459 * rename.c: Prefer sys/time.h for utimes over utime.h for utime.
1460 (STAT_TIMESPEC, STAT_TIMESPEC_NS): Define
1461 (get_stat_atime_ns, get_stat_mtime_ns): New inline functions.
1462 (get_stat_atime, get_stat_mtime): Likewise.
1463 (set_times): Choose first available of utimensat, utimes, utime.
1464 Use above inline functions to set timespec and timeval values.
1465 * configure: Regenerate.
1466 * config.in: Regenerate.
1467 * testsuite/binutils-all/objcopy.exp (objcopy_test): Add test of
1468 file timestamp when --preserve-dates is used.
1469
1470 2021-04-15 Alan Modra <amodra@gmail.com>
1471
1472 PR 27456
1473 * rename.c (smart_rename): When TO and FROM are equal, just set
1474 file timestamp.
1475 * objcopy.c (strip_main, copy_main): Always call smart_rename.
1476
1477 2021-04-14 H.J. Lu <hongjiu.lu@intel.com>
1478
1479 PR binutils/27708
1480 * testsuite/binutils-all/x86-64/pr27708.dump: New file.
1481 * testsuite/binutils-all/x86-64/pr27708.exe.bz2: Likewise.
1482 * testsuite/binutils-all/x86-64/x86-64.exp: Run binutils/27708
1483 test.
1484
1485 2021-04-14 Mark Harmstone <mark@harmstone.com>
1486
1487 PR 27686
1488 * resbin.c (bin_to_res_version): Ignore any trailing bytes at the
1489 end of the structure.
1490
1491 2021-04-14 Frederic Cambus <fred@statdns.com>
1492
1493 * readelf.c (get_netbsd_elfcore_note_type): Remove unneeded #ifdef
1494 checks for NT_NETBSDCORE_AUXV and NT_NETBSDCORE_LWPSTATUS.
1495
1496 2021-04-14 Alan Modra <amodra@gmail.com>
1497
1498 PR 27716
1499 * objdump.c (show_line): Don't limit paths to PATH_MAX.
1500 * readelf.c (struct filedata): Change program_interpreter from
1501 a char array to a char pointer.
1502 (process_program_headers): Sanity check PT_INTERP p_filesz.
1503 Malloc program_interpreter using p_filesz and read directly from
1504 file.
1505 (process_dynamic_section): Check program_interpreter is non-NULL.
1506 (free_filedata): New function, split out from..
1507 (process_object): ..here.
1508 (close_debug_file): Call free_filedata.
1509 * sysdep.h: Don't include sys/param.h.
1510 (PATH_MAX): Don't define.
1511 * configure.ac: Don't check for sys/param.h.
1512 * configure: Regenerate.
1513
1514 2021-04-13 Frederic Cambus <fred@statdns.com>
1515
1516 * readelf.c (process_netbsd_elf_note): Remove now unneeded #ifdef
1517 check for NT_NETBSD_PAX.
1518
1519 2021-04-12 Alan Modra <amodra@gmail.com>
1520
1521 * configure.ac (--enable-checking): Add support.
1522 * config.in: Regenerate.
1523 * configure: Regenerate.
1524
1525 2021-04-09 Alan Modra <amodra@gmail.com>
1526
1527 * objdump.c (struct objdump_disasm_info): Delete dynrelbuf and
1528 dynrelcount.
1529 (find_symbol_for_address): Adjust for dynrelbuf and dynrelcount move.
1530 (disassemble_section, disassemble_data): Likewise.
1531
1532 2021-04-06 Alan Modra <amodra@gmail.com>
1533
1534 * objdump.c (objdump_symbol_at_address): Return asymbol*.
1535
1536 2021-04-06 Alan Modra <amodra@gmail.com>
1537
1538 * NEWS: Mention C99 requirement.
1539 * README: Likewise. Modernise examples and "Reporting bugs".
1540
1541 2021-04-05 Alan Modra <amodra@gmail.com>
1542
1543 * configure.ac: Assume long long is available. Don't test for
1544 strings.h, stdlib.h, limits.h, locale.h, or wchar.h. Check
1545 inttypes.h, stdint.h, sys/stat.h and sys/types.h. Don't check for
1546 strcoll, setlocale, setmode or location of time_t. Don't check
1547 for fprintf, getenv, snprintf, strnlen, strstr or vsnprintf decls.
1548 (AC_ISC_POSIX, AXC_HEADER_STRING, AC_FUNC_ALLOCA): Don't invoke.
1549 * sysdep.h: Don't include alloca-conf.h, include config.h instead.
1550 Test HAVE_SYS_TYPES_H and reorder includes. Include limits.h,
1551 locale.h, string.h and stdlib.h unconditionally. Remove various
1552 fallback declarations. Assume long long is available.
1553 * addr2line.c: Don't test HAVE_SETLOCALE.
1554 * ar.c: Likewise.
1555 * coffdump.c: Likewise.
1556 * dlltool.c: Likewise.
1557 * dllwrap.c: Likewise.
1558 * elfedit.c: Likewise.
1559 * nm.c: Likewise.
1560 * objcopy.c: Likewise.
1561 * objdump.c: Likewise.
1562 * readelf.c: Likewise.
1563 * size.c: Likewise.
1564 * srconv.c: Likewise.
1565 * strings.c: Likewise.
1566 * sysdump.c: Likewise.
1567 * windmc.c: Likewise.
1568 * windres.c: Likewise.
1569 * bucomm.c: Don't test HAVE_TIME_T_IN_TIME_H or HAVE_TIME_T_IN_TYPES_H.
1570 * dwarf.c: Include limits.h unconditionally. Assume long long
1571 is available.
1572 * nm.c: Don't test HAVE_STRCOLL.
1573 * readelf.c: Don't test HAVE_WCHAR_H.
1574 * strings.c: Assume long long is available.
1575 * syslex.l: Include string.h unconditionally.
1576 * aclocal.m4: Regenerate.
1577 * config.in: Regenerate.
1578 * configure: Regenerate.
1579 * Makefile.in: Regenerate.
1580 * doc/Makefile.in: Regenerate.
1581
1582 2021-04-01 Martin Liska <mliska@suse.cz>
1583
1584 * elfcomm.h (strneq): Remove strneq and use startswith.
1585 * readelf.c (ia64_process_unwind): Likewise.
1586 (process_note): Likewise.
1587
1588 2021-04-01 Martin Liska <mliska@suse.cz>
1589
1590 * dllwrap.c: Use startswith function.
1591 * objcopy.c (is_dwo_section): Likewise.
1592 (handle_remove_section_option): Likewise.
1593 (copy_main): Likewise.
1594 * objdump.c (is_significant_symbol_name): Likewise.
1595
1596 2021-04-01 Martin Liska <mliska@suse.cz>
1597
1598 * dwarf.c (display_debug_lines_raw): Replace const_strneq with
1599 startswith.
1600 (display_debug_lines_decoded): Likewise.
1601 (display_debug_links): Likewise.
1602 * elfcomm.c (setup_archive): Likewise.
1603 * elfcomm.h (const_strneq): Likewise.
1604 * readelf.c (process_section_headers): Likewise.
1605 (slurp_ia64_unwind_table): Likewise.
1606 (slurp_hppa_unwind_table): Likewise.
1607 (decode_arm_unwind): Likewise.
1608 (display_debug_section): Likewise.
1609 (process_note): Likewise.
1610
1611 2021-03-31 Alan Modra <amodra@gmail.com>
1612
1613 * sysdep.h (POISON_BFD_BOOLEAN): Define.
1614 * addr2line.c, * ar.c, * arsup.c, * bfdtest2.c, * binemul.c,
1615 * binemul.h, * bucomm.c, * bucomm.h, * budbg.h, * coffgrok.c,
1616 * debug.c, * debug.h, * dlltool.c, * dwarf.c, * dwarf.h,
1617 * elfedit.c, * emul_aix.c, * mclex.c, * nm.c, * objcopy.c,
1618 * objdump.c, * od-macho.c, * prdbg.c, * rdcoff.c, * rddbg.c,
1619 * readelf.c, * rename.c, * stabs.c, * strings.c, * windint.h,
1620 * windmc.c, * windmc.h, * windres.c, * winduni.c,
1621 * wrstabs.c: Replace bfd_boolean with bool, FALSE with false,
1622 and TRUE with true throughout.
1623
1624 2021-03-31 Alan Modra <amodra@gmail.com>
1625
1626 * coffdump.c: Include stdint.h in place of bfd_stdint.h.
1627 * dwarf.c: Likewise.
1628
1629 2021-03-31 Alan Modra <amodra@gmail.com>
1630
1631 * prdbg.c (pr_function_type): Replace LITSTTCPY with strcpy.
1632
1633 2021-03-29 Alan Modra <amodra@gmail.com>
1634
1635 * dlltool.c (main): Don't use "boolean_condition ? TRUE : FALSE".
1636 * dwarf.c (read_and_display_attr_value): Likewise.
1637 (display_debug_str_offsets): Likewise.
1638 * objdump.c (dump_bfd): Likewise.
1639 * readelf.c (dump_section_as_strings): Likewise.
1640 (dump_section_as_bytes): Likewise.
1641
1642 2021-03-29 Alan Modra <amodra@gmail.com>
1643
1644 * objdump.c (process_links): Use type int.
1645 * readelf.c (request_dump): Don't increment do_dump, set it.
1646 * windint.h (target_is_bigendian): Use type bfd_boolean.
1647 * windmc.c (target_is_bigendian): Likewise.
1648 * windres.c (target_is_bigendian): Likewise.
1649
1650 2021-03-22 Martin Liska <mliska@suse.cz>
1651
1652 * dlltool.c (scan_drectve_symbols): Replace usage of CONST_STRNEQ
1653 with startswith.
1654 * emul_aix.c (ar_emul_aix_parse_arg): Likewise.
1655 * objcopy.c (is_mergeable_note_section): Likewise.
1656 * objdump.c (dump_dwarf_section): Likewise.
1657 * prdbg.c (pr_method_type): Likewise.
1658 (pr_class_baseclass): Likewise.
1659 (tg_class_baseclass): Likewise.
1660 * readelf.c (process_lto_symbol_tables): Likewise.
1661 * stabs.c (ULLHIGH): Likewise.
1662 (parse_stab_argtypes): Likewise.
1663 (stab_demangle_function_name): Likewise.
1664
1665 2021-03-19 H.J. Lu <hongjiu.lu@intel.com>
1666
1667 * readelf.c (get_machine_name): Add EM_INTELGT.
1668
1669 2021-03-18 Nick Clifton <nickc@redhat.com>
1670
1671 PR 27478
1672 * readelf.c (dump_section_as_strings): Mention separate filename.
1673 (dump_section_as_bytes): Likewise.
1674 (dump_section_as_ctf): Likewise.
1675 (initialise_dumkps_byname): Only issue a warning for missing
1676 sections if processing the main file.
1677 (process_section_contents): Only issue a warning for unsumped
1678 section numbers in the main file.
1679 (initialise_dump_sects): New function. Contains code extracted
1680 from ...
1681 (process_object): ... here. Also call initialise_dump_sects for
1682 separate files.
1683
1684 2021-03-16 Nick Clifton <nickc@redhat.com>
1685
1686 PR 27534
1687 * readelf.c (display_debug_section): Also retain .debug_addr
1688 sections.
1689
1690 2021-03-16 Nick Clifton <nickc@redhat.com>
1691
1692 PR 27533
1693 * readelf.c (process_section_contents): Only dump debug
1694 information for separate files unless process_links is enabled.
1695 (process_object): Always call process_section_contents for
1696 separate info files.
1697
1698 2021-03-15 Nick Clifton <nickc@redhat.com>
1699
1700 PR 27487
1701 * nm.c (FORMAT_JUST_SYMBOLS): Define.
1702 (struct optput_fns): Add entry for FORMAT_JUST_SYMBOLS.
1703 (long_options): Add just-symbols.
1704 (set_output_format): Add support for just-symbols.
1705 (get_print_format): Likewise.
1706 (do_not_print_object_filename): New function.
1707 (do_not_print_archive_filename): New function.
1708 (do_not_print_archive_member): New function.
1709 (do_not_print_symbol_filename): New function.
1710 (just_print_symbol_name): New function.
1711 (main): Handle --just-symbols.
1712 * NEWS: Mention the new feature.
1713 * doc/binutils.texi: Document the new feature.
1714
1715 2021-03-12 Clément Chigot <clement.chigot@atos.net>
1716
1717 * od-xcoff.c: Replace RTB by TRL entry.
1718
1719 2021-03-05 Craig Blackmore <craig.blackmore@embecosm.com>
1720 Andrew Burgess <andrew.burgess@embecosm.com>
1721
1722 * readelf.c (get_note_type): Handle NT_RISCV_CSR.
1723
1724 2021-03-05 Craig Blackmore <craig.blackmore@embecosm.com>
1725 Andrew Burgess <andrew.burgess@embecosm.com>
1726
1727 * readelf.c (get_note_type): Handle NT_GDB_TDESC.
1728
1729 2021-03-05 Nick Clifton <nickc@redhat.com>
1730
1731 PR 27387
1732 * dwarf.c (display_debug_macro): Handle the displaying of
1733 DW_MACRO_define_strp and DW_MACRO_undef_strp in v4
1734 .debug_macro.dwo sections.
1735
1736 2021-03-04 Nick Clifton <nickc@redhat.com>
1737
1738 PR 27478
1739 * objdump.c (process_links): New variable.
1740 (usage): Add --process-links.
1741 (long_options): Likewise.
1742 (dump_bfd): Stop processing once the bfd has been loaded unless
1743 this is the main file or process_links has been enabled.
1744 (main): Handle the process-links option.
1745 * readelf.c (process_links): New variable.
1746 (struct filedata): Add is_separate field.
1747 (options): Add --process-links.
1748 (usage): Likewise.
1749 (parse_args): Likewise.
1750 (process_file_header): Include the filename when dumping
1751 information for separate debuginfo files.
1752 (process_program_headers): Likewise.
1753 (process_section_headers): Likewise.
1754 (process_section_groups): Likewise.
1755 (process_relocs): Likewise.
1756 (process_dynamic_section): Likewise.
1757 (process_version_sections): Likewise.
1758 (display_lto_symtab): Likewise.
1759 (process_symbol_table): Likewise.
1760 (process_syminfo): Likewise.
1761 (initialise_dumps_by_name): Likewise.
1762 (process_section_contents): Likewise.
1763 (process_notes_at): Likewise.
1764 (process_notes): Likewise.
1765 (open_file): Add is_separate parameter. Use to initialise the
1766 is_separate field in the filedata structure.
1767 (open_deug): Update call to open_file.
1768 (process_object): Add processing of the contents of separate
1769 debuginfo files, gated by the process_links variable.
1770 (process_archive): Update call to open_file.
1771 (process_file): Initialise the is_separate field in the filedata
1772 structure.
1773 * dwarf.c (load_separate_debug_info_file): Only report the
1774 loading of a separate file if debug links are being dumped.
1775 * objcopy.c (keep_section_symbols): New variable.
1776 (enum command_line_switch): Add OPTION_KEEP_SYMBOLS.
1777 (strip_options): Add keep-section-symbols.
1778 (copy_options): Likewise.
1779 (copy_usage): Likewise.
1780 (strip_usage): Likewise.
1781 (copy_object): Keep section symbols if requested by command line
1782 option.
1783 (strip_main): Handle --keep-section-symbols.
1784 (copy_main): Likewise.
1785 * doc/binutils.texi: Document the new options.
1786 * NEWS: Mention the new features.
1787 * testsuite/binutils-all/compress.exp (test_gnu_debuglink):
1788 Update options passed to objdump. Use diff rather than cmp to
1789 compare the dumped data.
1790 * testsuite/binutils-all/objdump.WK2: Update regexp.
1791 * testsuite/binutils-all/objdump.WK3: Update regexp.
1792 * testsuite/binutils-all/objdump.exp: Use --process-links
1793 instead of --dwarf=follow-links.
1794 * testsuite/binutils-all/readelf.exp (readelf_test): Include
1795 readelf's output in the log when the test fails.
1796 Add the -P option to the -wKis test.
1797 * testsuite/binutils-all/readelf.wKis: Update expected output.
1798
1799 2021-03-03 Alan Modra <amodra@gmail.com>
1800
1801 PR 27493
1802 * objcopy.c (filter_symbols): Apply --weaken to undefined symbols.
1803 * NEWS: Mention feature.
1804
1805 2021-03-01 H.J. Lu <hongjiu.lu@intel.com>
1806
1807 PR binutils/27486
1808 * dwarf.c (load_separate_debug_info): Issue warning only if
1809 do_debug_links is set.
1810 * testsuite/binutils-all/compress.exp: Run objdump and readelf
1811 with missing debug file.
1812
1813 2021-03-01 Alan Modra <amodra@gmail.com>
1814
1815 PR 27128
1816 * doc/binutils.texi: Add nm --with-symbol-versions and
1817 --without-symbol-versions documentation.
1818 * nm.c (with_symbol_versions): New variable.
1819 (enum long_option_values): Delete OPTION_WITH_SYMBOL_VERSIONS.
1820 (long_options): Make --with-symbol-versions entry twiddle the flag.
1821 Add --without-symbol-versions.
1822 (print_symname): Strip version when !with_symbol_versions. Add
1823 dynamic version info under control of with_symbol_versions.
1824 (main): Remove OPTION_WITH_SYMBOL_VERSIONS case.
1825
1826 2021-02-26 Fangrui Song <maskray@google.com>
1827
1828 PR 27408
1829 * readelf.c (quiet): New option flag.
1830 (enum long_option_values): New enum to hold long option value.
1831 (long_options): Add --quiet.
1832 (usage): Mention --quiet.
1833 (display_rel_file): If quiet is enabled, suppress "no symbols".
1834 (main): Handle the new option.
1835 * NEWS: Mention --quiet.
1836 * docs/binutils.texi: Document --quiet.
1837
1838 2021-02-26 Tom de Vries <tdevries@suse.de>
1839
1840 * dwarf.c (display_debug_addr): Handle dwarf-5 .debug_addr bits.
1841
1842 2021-02-26 Tom de Vries <tdevries@suse.de>
1843
1844 PR 27390
1845 * dwarf.c: (skip_attr_bytes): Add support for DW_FORM_str* and
1846 DW_FORM_addrx*.
1847 (read_and_display_attr_value): Likewise.
1848
1849 2021-02-25 Nick Clifton <nickc@redhat.com>
1850
1851 * dwarf.c (get_type_abbrev_from_form): Accept but ignore sup
1852 forms.
1853 (read_and_display_attr_value): Handle sup forms.
1854 (display_debug_sup): New function. Displays the contents of a
1855 .debug_sup section.
1856 (load_debug_sup_file): New function. Loads the contents of a file
1857 referenced by a .debug_sup section.
1858 (check_for_and_load_links): Call load_debug_sup_file.
1859 (debug_displays): Add entry for .debug_sup.
1860 * dwarf.h (enum dwarf_section_display_enum): Add debug_sup.
1861 * readelf.c (process_section_headers): Add support for debug_sup.
1862 * doc/debug.options.texi: Note that the =links option will display
1863 the contents of .debug_sup sections.
1864 * NEWS: Mention the new support.
1865
1866 2021-02-25 Alan Modra <amodra@gmail.com>
1867
1868 PR 27456
1869 * rename.c (simple_copy): Mark target_stat ATTRIBUTE_UNUSED.
1870
1871 2021-02-24 Nick Clifton <nickc@redhat.com>
1872
1873 PR 27285
1874 * od-elf32_avr.c (elf32_avr_get_memory_usage): Check for overflows
1875 when adding together the section sizes.
1876
1877 2021-02-24 Nick Clifton <nickc@redhat.com>
1878
1879 * objcopy.c (merge_gnu_build_notes): Remove support for v1/v2 GNU
1880 build notes.
1881 * readelf.c (print_gnu_build_attribute_description): Likewise.
1882
1883 2021-02-24 Alan Modra <amodra@gmail.com>
1884 Siddhesh Poyarekar <siddhesh@gotplt.org>
1885
1886 PR 27456
1887 * bucomm.h (smart_rename): Update prototype.
1888 * rename.c (smart_rename): Add fromfd and preserve_dates params.
1889 Pass fromfd and target_stat to simple_copy. Call set_times
1890 when preserve_dates.
1891 (simple_copy): Accept fromfd rather than from filename. Add
1892 target_stat param. Rewind fromfd rather than opening. Open
1893 "to" file without O_CREAT. Try to preserve S_ISUID and S_ISGID.
1894 * ar.c (write_archive): Rename ofd to tmpfd. Dup tmpfd before
1895 closing output temp file, and pass tmpfd to smart_rename.
1896 * arsup.c (temp_fd): Rename from real_fd.
1897 (ar_save): Dup temp_fd and pass to smart_rename.
1898 * objcopy.c (strip_main, copy_main): Likewise, and pass
1899 preserve_dates.
1900
1901 2021-02-24 Alan Modra <amodra@gmail.com>
1902
1903 PR 27456
1904 * rename.c: Tidy throughout.
1905 (smart_rename): Always copy. Remove windows specific code.
1906
1907 2021-02-20 Alan Modra <amodra@gmail.com>
1908
1909 * testsuite/lib/binutils-common.exp: Whitespace fixes throughout.
1910 (run_dump_test): Fail if expecting errors from a file like we do
1911 for error strings, if no error is seen.
1912
1913 2021-02-19 Alan Modra <amodra@gmail.com>
1914
1915 * testsuite/binutils-all/readelf.exp (pr26548): Run for 32-bit too.
1916
1917 2021-02-19 Siddhesh Poyarekar <siddhesh@gotplt.org>
1918
1919 * ar.c (write_archive): Remove TARGET_STAT. Adjust call to
1920 SMART_RENAME.
1921 * arsup.c (ar_save): Likewise.
1922 * objcopy (strip_main): Don't copy TMPFD. Don't set times on
1923 temporary file and adjust call to SMART_RENAME.
1924 (copy_main): Likewise.
1925 * rename.c [!S_ISLNK]: Remove definitions.
1926 (try_preserve_permissions): Remove function.
1927 (smart_rename): Remove FD, PRESERVE_DATES arguments. Use
1928 rename system call only if TO does not exist.
1929 * bucomm.h (smart_rename): Adjust declaration.
1930
1931 2021-02-18 Nick Clifton <nickc@redhat.com>
1932
1933 * objcopy.c (merge_gnu_build_notes): Handle notes with a start
1934 address that is higher than the end address.
1935
1936 2021-02-17 Alan Modra <amodra@gmail.com>
1937
1938 * dwarf.c: Include limits.h.
1939 (CHAR_BIT): Provide backup define.
1940 (read_leb128): Use CHAR_BIT to size "result" in bits. Correct
1941 signed overflow checking.
1942 * testsuite/binutils-all/pr26548.s,
1943 * testsuite/binutils-all/pr26548.d,
1944 * testsuite/binutils-all/pr26548e.d: New tests.
1945 * testsuite/binutils-all/readelf.exp: Run them.
1946 (readelf_test): Drop unused "xfails" parameter. Update all uses.
1947
1948 2021-02-16 Jan Beulich <jbeulich@suse.com>
1949
1950 * dwarf.c (process_debug_info): Initialize "dwo_id".
1951
1952 2021-02-15 Alan Modra <amodra@gmail.com>
1953
1954 * objdump.c (load_specific_debug_section): Don't call
1955 bfd_cache_section_contents. Rearrange so that
1956 bfd_get_full_section_contents is not called on path where
1957 bfd_simple_get_relocated_section_contents is called.
1958 Don't set section->user_data.
1959 (free_debug_section): Always free section->start. Don't twiddle
1960 section flags.
1961 * readelf.c (load_specific_debug_section): Don't set user_data.
1962 * dwarf.h (struct dwarf_section): Remove use_data field.
1963 * dwarf.c (NO_ABBREVS, ABBREV): Adjust to suit.
1964
1965 2021-02-15 Alan Modra <amodra@gmail.com>
1966
1967 * testsuite/binutils-all/compress.exp: Remove nds32 xfails.
1968 * testsuite/binutils-all/objdump.exp: Likewise.
1969
1970 2021-02-14 Alan Modra <amodra@gmail.com>
1971
1972 * objdump.c (slurp_symtab): Don't add an extra entry for NULL
1973 to the symbol array.
1974 (slurp_dynamic_symtab): Likewise.
1975 (dump_bfd): Formatting. Copy terminating NULL from extra_syms.
1976
1977 2021-02-14 Alan Modra <amodra@gmail.com>
1978
1979 * Makefile.in: Regenerate.
1980 * doc/Makefile.in: Regenerate.
1981
1982 2021-02-13 Mike Frysinger <vapier@gentoo.org>
1983
1984 * aclocal.m4: Regenerate.
1985
1986 2021-02-12 Nick Clifton <nickc@redhat.com>
1987
1988 * configure.ac (follow-debug-links): Add option to enable or
1989 disable the following of debug links by default. Set the
1990 default for the option to be 'follow'.
1991 * dwarf.c (do_follow_links): Initialise with DEFAULT_FOR_FOLLOW_LINKS.
1992 (dwarf_select_sections_by_names): Add no-follow-links option.
1993 (dwarf_select_sections_by_letter): Add 'N' option.
1994 * objdump.c (usage): Add conditional text describing the
1995 follow links option.
1996 (slurp_symtab): Ensure that there is a NULL entry at the end
1997 of the symbol table.
1998 (slurp_dynamic_symtab): Likewise.
1999 (dump_bfd): When extending the symbol table, ensure that there
2000 is still a NULL entry at the end.
2001 * readelf.c (usage): Add conditional text describing the
2002 follow links option.
2003 * doc/binutils.texi: Update documentation for objcopy and
2004 readelf.
2005 * doc/debug.options.texi: Update documentation of the
2006 follow-links option.
2007 * config.in: Regenerate.
2008 * configure: Regenerate.
2009 * testsuite/binutils-all/compress.exp: Add the -WN option to
2010 objdump command lines that are not expecting to follow links.
2011 * testsuite/binutils-all/readelf.exp: Add the
2012 --debug-dump=no-follow-links option to tests that are not
2013 expecting to follow debug links.
2014 * NEWS: Mention the new behaviour.
2015
2016 2021-02-12 Alan Modra <amodra@gmail.com>
2017
2018 * testsuite/binutils-all/objcopy.exp: Report "unsupported" when
2019 gas or ld fails to build a testcase rather than "unresolved".
2020 Report "fail" when readelf returns an error status rather than
2021 "unresolved".
2022 * testsuite/binutils-all/ar.exp: Likewise.
2023 * testsuite/binutils-all/compress.exp: Likewise.
2024 * testsuite/binutils-all/readelf.exp: Likewise.
2025
2026 2021-02-12 Alan Modra <amodra@gmail.com>
2027
2028 * testsuite/binutils-all/pr25662.s: Replace "a" with "aaa" and
2029 "c" with "ccc" labels.
2030
2031 2021-02-12 Tom de Vries <tdevries@suse.de>
2032
2033 * dwarf.h (debug_info): Fix typo in comment.
2034
2035 2021-02-12 Tom de Vries <tdevries@suse.de>
2036
2037 * dwarf.c (display_debug_str_offsets): Handle multiple sets of
2038 entries.
2039
2040 2021-02-12 Tom de Vries <tdevries@suse.de>
2041
2042 * dwarf.c (process_debug_info): Print DWO ID.
2043
2044 2021-02-11 Alan Modra <amodra@gmail.com>
2045
2046 PR 27290
2047 PR 27293
2048 PR 27295
2049 * od-elf32_avr.c (elf32_avr_get_note_section_contents): Formatting.
2050 Use bfd_malloc_and_get_section.
2051 (elf32_avr_get_note_desc): Formatting. Return descsz. Sanity
2052 check namesz. Return NULL if descsz is too small. Ensure
2053 string table is terminated.
2054 (elf32_avr_get_device_info): Formatting. Add note_size param.
2055 Sanity check note.
2056 (elf32_avr_dump_mem_usage): Adjust to suit.
2057
2058 2021-02-10 Tom de Vries <tdevries@suse.de>
2059
2060 PR binutils/27391
2061 * dwarf.c (load_dwo_file): Handle case that name is absolute path.
2062
2063 2021-02-10 Tom de Vries <tdevries@suse.de>
2064
2065 PR binutils/27371
2066 * dwarf.c (display_debug_ranges): Filter range lists according to
2067 section.
2068
2069 2021-02-09 Tom de Vries <tdevries@suse.de>
2070
2071 PR binutils/27370
2072 * dwarf.c (get_type_abbrev_from_form): Handle DW_FORM_ref_sig8.
2073
2074 2021-02-09 Tom de Vries <tdevries@suse.de>
2075
2076 PR binutils/27386
2077 * dwarf.c (process_debug_info): Handling DW_UT_skeleton and
2078 DW_UT_split_compile.
2079
2080 2021-02-09 Alan Modra <amodra@gmail.com>
2081
2082 * testsuite/lib/binutils-common.exp (supports_gnu_osabi): Remove
2083 symbianelf.
2084
2085 2021-02-07 Alan Modra <amodra@gmail.com>
2086
2087 * unwind-ia64.c (unw_print_xyreg): Don't leave output buffer
2088 uninitialised on invalid input.
2089
2090 2021-02-06 Alan Modra <amodra@gmail.com>
2091
2092 PR 27349
2093 * rename.c (smart_rename): Test for existence and type of output
2094 file with lstat.
2095
2096 2021-02-05 Nick Clifton <nickc@redhat.com>
2097
2098 * MAINTAINERS: Remove Richard Henderson as the ALPHA maintainer.
2099
2100 2021-02-05 Eli Zaretskii <eliz@gnu.org>
2101
2102 PR 27252
2103 * elfedit.c (check_file):
2104 * bucomm.c (get_file_size): Fix typos in comments.
2105
2106 2021-02-05 Alan Modra <amodra@gmail.com>
2107
2108 PR 27345
2109 * arsup.c (ar_save): Use stat rather than lstat.
2110
2111 2021-02-03 Alan Modra <amodra@gmail.com>
2112
2113 PR 27270
2114 PR 27284
2115 PR 26945
2116 * ar.c: Don't include libbfd.h.
2117 (write_archive): Replace xmalloc+strcpy with xstrdup. Use
2118 bfd_stat rather than fstat on iostream. Move stat and fd tests
2119 outside of _WIN32 ifdef. Delete skip_stat variable.
2120 * arsup.c (temp_name, real_ofd): New static variables.
2121 (ar_open): Use make_tempname and bfd_fdopenw.
2122 (ar_save): Adjust to suit ar_open changes. Move stat output
2123 of _WIN32 ifdef.
2124 * objcopy.c: Don't include libbfd.h.
2125 (copy_file): Use bfd_stat.
2126
2127 2021-02-02 H.J. Lu <hongjiu.lu@intel.com>
2128
2129 PR binutils/27281
2130 * readelf.c (process_section_headers): Add 'R' and 'D' to
2131 "Key to Flags:".
2132 * testsuite/binutils-all/retain1a.d: Updated.
2133
2134 2021-01-30 Nick Clifton <nickc@redhat.com>
2135
2136 * README-how-to-make-a-release: Small updates after the 2.35.2
2137 release.
2138
2139 2021-01-28 Eli Zaretskii <eliz@gnu.org>
2140
2141 PR 4356
2142 * windres.c (quot): Use double quotes to protect strings on
2143 Windows platforms.
2144
2145 2021-01-28 Eli Zaretskii <eliz@gnu.org>
2146
2147 PR 27252
2148 * bucomm.c (get_file_size): Add code to handle /dev/null on
2149 Windows systems.
2150 * elfedit.c (check_file): Likewise.
2151
2152 2021-01-27 Nick Clifton <nickc@redhat.com>
2153
2154 * objcopy.c (copy_main): Remove conditional control of the calls
2155 to free, simplifying the code and making it easier to detect
2156 typos.
2157
2158 2021-01-26 Frederic Cambus <fred@statdns.com>
2159
2160 * objcopy.c (copy_main): Fix a double free happening when both
2161 --localize-symbols and --globalize-symbols options are invoked
2162 together.
2163
2164 2021-01-24 Nick Clifton <nickc@redhat.com>
2165
2166 * README-how-to-make-a-release: Minor updates after the 2.36 release.
2167
2168 2021-01-16 Alan Modra <amodra@gmail.com>
2169
2170 * readelf.c (uncompress_section_contents): Tidy inflateEnd result test.
2171
2172 2021-01-15 Alan Modra <amodra@gmail.com>
2173
2174 PR 26539
2175 * readelf.c (uncompress_section_contents): Always call inflateEnd.
2176
2177 2021-01-14 Alexandre Oliva <oliva@gnu.org>
2178
2179 * MAINTAINERS: Update my email address.
2180
2181 2021-01-14 Nick Clifton <nickc@redhat.com>
2182
2183 * po/sv.po: Updated Swedish translation.
2184
2185 2021-01-13 Alan Modra <amodra@gmail.com>
2186
2187 * Makefile.in: Regenerate.
2188 * doc/Makefile.in: Regenerate.
2189
2190 2021-01-13 Zebediah Figura <z.figura12@gmail.com>
2191
2192 PR 27037
2193 * dlltool.c (i386_trampoline): Adjust %rsp immediately on entry
2194 and before exit.
2195 (i386_x64_trampoline): Add SEH annotations.
2196 (struct mac): Add how_seh field.
2197 (make_delay_head): If how_set field is true add SEh instructions.
2198
2199 2021-01-12 H.J. Lu <hongjiu.lu@intel.com>
2200
2201 PR binutils/26792
2202 * configure.ac: Use GNU_MAKE_JOBSERVER.
2203 * aclocal.m4: Regenerated.
2204 * configure: Likewise.
2205
2206 2021-01-12 Nick Clifton <nickc@redhat.com>
2207
2208 * po/fr.po: Updated French translation.
2209
2210 2021-01-11 H.J. Lu <hongjiu.lu@intel.com>
2211
2212 PR ld/27173
2213 * configure: Regenerated.
2214
2215 2021-01-11 Nick Clifton <nickc@redhat.com>
2216
2217 * po/pt.po: Updated Portuguese translation.
2218 * po/sr.po: Updated Serbian translation.
2219 * po/uk.po: Updated Ukranian translation.
2220
2221 2021-01-09 H.J. Lu <hongjiu.lu@intel.com>
2222
2223 * configure: Regenerated.
2224
2225 2021-01-09 Nick Clifton <nickc@redhat.com>
2226
2227 * configure: Regenerate.
2228 * po/binutils.pot: Regenerate.
2229
2230 2021-01-09 Nick Clifton <nickc@redhat.com>
2231
2232 * 2.36 release branch crated.
2233 * README-how-to-make-a-release: Add note about updating Makefiles
2234 and libtool files.
2235 * BRANCHES: Add binutils-2.36-branch.
2236
2237 2021-01-09 Alan Modra <amodra@gmail.com>
2238
2239 * configure: Regenerate.
2240
2241 2021-01-07 Samuel Thibault <samuel.thibault@gnu.org>
2242
2243 * configure: Regenerate.
2244
2245 2021-01-07 H.J. Lu <hongjiu.lu@intel.com>
2246
2247 PR 27109
2248 * objcopy.c (copy_object): Handle section symbols for
2249 non-relocatable inputs.
2250 * testsuite/binutils-all/readelf.exp (readelf_test): Check
2251 is_elf_unused_section_symbols.
2252 * testsuite/binutils-all/readelf.s-64: Updated.
2253 * testsuite/binutils-all/readelf.ss: Likewise.
2254 * testsuite/binutils-all/readelf.ss-64: Likewise.
2255 * testsuite/binutils-all/readelf.s-64-unused: New file.
2256 * testsuite/binutils-all/readelf.ss-64-unused: Likewise.
2257 * testsuite/binutils-all/readelf.ss-unused: Likewise.
2258 * testsuite/lib/binutils-common.exp
2259 (is_elf_unused_section_symbols): New proc.
2260
2261 2021-01-06 Reuben Thomas <rrt@sc3d.org>
2262
2263 * binutils/readelf.c: Correct grammar in comment.
2264
2265 2021-01-01 Nicolas Boulenguez <nicolas@debian.org>
2266
2267 * coffgrok.c (do_type): Correct spelling of auxiliary in errors.
2268 * doc/binutils.texi: Correct grammar.
2269 * readelf.c (process_version_sections): Correct spelling of auxiliary
2270 in warning.
2271 * testsuite/binutils-all/vax/objdump.exp: Comment grammar fix.
2272
2273 2021-01-01 Alan Modra <amodra@gmail.com>
2274
2275 Update year range in copyright notice of all files.
2276
2277 For older changes see ChangeLog-2020
2278 \f
2279 Copyright (C) 2021-2023 Free Software Foundation, Inc.
2280
2281 Copying and distribution of this file, with or without modification,
2282 are permitted in any medium without royalty provided the copyright
2283 notice and this notice are preserved.
2284
2285 Local Variables:
2286 mode: change-log
2287 left-margin: 8
2288 fill-column: 74
2289 version-control: never
2290 End: