MSP430: Enable relaxation of jump instructions to hard-coded pcrel offsets
[binutils-gdb.git] / bfd / ChangeLog
1 2020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
2
3 * elf32-msp430.c (msp430_elf_relax_section): Before relaxing a branch,
4 check if previous instruction matches a conditional jump inserted
5 earlier. Invert conditional jump and delete branch in this case.
6
7 2020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
8
9 * elf32-msp430.c (msp430_elf_relax_add_two_words): Rename to
10 msp430_elf_relax_add_words. Support insertion of either one or two
11 words.
12 (msp430_elf_relax_section): Catch opcode of 0x3c00 when relocation
13 needs to be grown. Handle insertion of branch instruction to replace
14 jump.
15
16 2020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
17
18 * elf32-msp430.c (msp430_final_link_relocate): Add printf statements for
19 debugging relocations.
20 (msp430_elf_relax_delete_bytes): Likewise.
21 (msp430_elf_relax_add_two_words): Likewise.
22 (msp430_elf_relax_section): Likewise.
23
24 2020-02-10 Alan Modra <amodra@gmail.com>
25
26 * archures.c: Wrap overlong z80 comments.
27 * bfd-in2.h: Regenerate.
28
29 2020-02-07 Sergey Belyashov <sergey.belyashov@gmail.com>
30
31 PR 25469
32 * archures.c: Add GBZ80 and Z80N machine values.
33 * reloc.c: Add BFD_RELOC_Z80_16_BE.
34 * coff-z80.c: Add support for new reloc.
35 * coffcode.h: Add support for new machine values.
36 * cpu-z80.c: Add support for new machine names.
37 * elf32-z80.c: Add support for new reloc.
38 * bfd-in2.h: Regenerate.
39 * libbfd.h: Regenerate.
40
41 2020-02-07 Nick Clifton <nickc@redhat.com>
42
43 PR 23932
44 * elf.c (rewrite_elf_program_header): Do not complain if no
45 sections are mapped to a segment.
46
47 2020-02-06 H.J. Lu <hongjiu.lu@intel.com>
48
49 PR ld/25490
50 * elflink.c (_bfd_elf_gc_mark_extra_sections): Issue an error
51 for garbage collection on __patchable_function_entries section
52 without linked-to section.
53
54 2020-02-06 H.J. Lu <hongjiu.lu@intel.com>
55
56 PR gas/25381
57 * bfd-in2.h: Regenerated.
58 * elflink.c (_bfd_elf_gc_mark_extra_sections): Call mark_hook
59 on section if gc_mark of any of its linked-to sections is set
60 and don't set gc_mark again.
61 * section.c (asection): Add linked_to_symbol_name to map_head
62 union.
63
64 2020-02-06 Maciej W. Rozycki <macro@wdc.com>
65
66 * elf32-v850.c (v850_elf_relax_section): Fix the index used for
67 reporting an unrecognized instruction with R_V850_LONGJUMP.
68
69 2020-02-05 Alan Modra <amodra@gmail.com>
70
71 * elf64-ppc.c (ppc_stub_plt_branch): Match comment with reality.
72
73 2020-02-04 Alan Modra <amodra@gmail.com>
74
75 * elf32-ppc.c (ppc_elf_relocate_section): After applying
76 R_PPC_VLE_ADDR20, goto copy_reloc.
77
78 2020-02-02 H.J. Lu <hongjiu.lu@intel.com>
79
80 * bfd-in2.h: Regenerated.
81 * section.c (SEC_ASSEMBLER_SECTION_ID): Fix a typo in comments.
82
83 2020-02-02 H.J. Lu <hongjiu.lu@intel.com>
84
85 PR gas/25380
86 * bfd-in2.h: Regenerated.
87 * ecoff.c (bfd_debug_section): Add section_id.
88 * section.c (bfd_section): Add section_id.
89 (SEC_ASSEMBLER_SECTION_ID): New.
90 (BFD_FAKE_SECTION): Add section_id.
91
92 2020-02-01 Nick Clifton <nickc@redhat.com>
93
94 * config.bfd: Move the c30-aout and tic30-aout targets onto the
95 obsolete list.
96
97 2020-01-31 Sandra Loosemore <sandra@codesourcery.com>
98
99 * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): DW_EH_PE_datarel
100 encodings are relative to the GOT on nios2, too.
101
102 2020-01-31 Alan Modra <amodra@gmail.com>
103
104 * Makefile.am (elf32-target.h, elf64-target.h): Don't use a temp
105 file. Use $< and $@ in rules.
106 (elf32-aarch64.c, elf64-aarch64.c): Likewise.
107 (elf32-ia64.c, elf64-ia64.c): Likewise.
108 (elf32-riscv.c, elf64-riscv.c): Likewise.
109 (peigen.c, pepigen.c, pex64igen.c): Likewise.
110 (elf32-aarch64.c, elf64-aarch64.c): Don't emit $srcdir on #line.
111 (elf32-riscv.c, elf64-riscv.c): Likewise, and use $(SED).
112 (elf32-ia64.c, elf64-ia64.c): Do emit #line.
113 (peigen.c, pepigen.c, pex64igen.c): Likewise.
114 * Makefile.in: Regenerate.
115
116 2020-01-31 Alan Modra <amodra@gmail.com>
117
118 PR 4110
119 * elf.c (setup_group): Don't clear entire section contents,
120 just the padding after group flags. Release alloc'd memory
121 after a seek or read failure.
122
123 2020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
124
125 * peXXigen.c (pe_is_repro): New function.
126 (_bfd_XX_print_private_bfd_data_common): Note timestamp is
127 actually a build hash if PE_IMAGE_DEBUG_TYPE_REPRO is present.
128
129 2020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
130
131 * peXXigen.c (debug_type_names): Add names for new debug data type
132 values.
133
134 2020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
135
136 * peXXigen.c (pe_print_debugdata): Fix the iteration variable for
137 inner loop. Fix a memory leak.
138
139 2020-01-30 Alan Modra <amodra@gmail.com>
140
141 * coffgen.c (coff_real_object_p): Don't clear obj_coff_keep_syms
142 or obj_coff_keep_strings here.
143 (coff_get_normalized_symtab): Free external syms directly.
144 * xcofflink.c (xcoff_link_input_bfd): Restore obj_coff_keep_syms
145 on error exit path.
146
147 2020-01-27 Jim Wilson <jimw@sifive.com>
148
149 * cpu-riscv.c (riscv_scan): New.
150 (N): Change bfd_default_scan to riscv_scan.
151
152 2020-01-27 Andreas Schwab <schwab@suse.de>
153
154 * Makefile.am (ALL_MACHINES): Remove cpu-plugin.lo.
155 (ALL_MACHINES_CFILES): Remove cpu-plugin.c.
156 * Makefile.in: Regenerate.
157 * cpu-plugin.c: Remove.
158 * archures.c (enum bfd_architecture): Remove bfd_arch_plugin.
159 (bfd_plugin_arch): Remove declaration.
160 * bfd-in2.h: Regenerate.
161 * po/SRC-POTFILES.in: Regenerate.
162
163 2020-01-27 H.J. Lu <hongjiu.lu@intel.com>
164 Alan Modra <amodra@gmail.com>
165
166 PR ld/25458
167 * elflink.c (_bfd_elf_gc_mark_rsec): Mark all weak aliases.
168
169 2020-01-24 Jim Wilson <jimw@sifive.com>
170
171 * elfxx-riscv.c (riscv_get_prefix_class): Format s case like others.
172 (riscv_parse_prefixed_ext): Fix s extension comment and reword to
173 avoid over long line.
174
175 2020-01-24 Nick Clifton <nickc@redhat.com>
176
177 PR 25447
178 * coffgen.c (_bfd_coff_close_and_cleanup): Do not clear the keep
179 syms and keep strings flags as these may have been set in order to
180 prevent a bogus call to free.
181
182 2020-01-23 Nick Clifton <nickc@redhat.com>
183
184 * po/fr.po: Updated French translation.
185
186 2020-01-23 Alan Modra <amodra@gmail.com>
187
188 PR 25444
189 * elf.c (assign_file_positions_for_load_sections): Avoid divide
190 by zero when p_align is zero.
191
192 2020-01-22 Maxim Blinov <maxim.blinov@embecosm.com>
193
194 * bfd/elfnn-riscv.c (riscv_skip_prefix): New.
195 (riscv_prefix_cmp): Likewise.
196 (riscv_non_std_ext_p): Deleted.
197 (riscv_std_sv_ext_p): Likewise.
198 (riscv_non_std_sv_ext_p): Likewise.
199 (riscv_merge_non_std_and_sv_ext): Rename to...
200 (riscv_merge_multi_letter_ext): and modified to use riscv_prefix_cmp.
201 (riscv_merge_arch_attr_info): Replace 3 calls to
202 riscv_merge_non_std_and_sv_ext with single call to
203 riscv_merge_multi_letter_ext.
204 * bfd/elfxx-riscv.c (riscv_parse_std_ext): Break if we
205 encounter a 'z' prefix.
206 (riscv_get_prefix_class): New function, return prefix class based
207 on first few characters of input string.
208 (riscv_parse_config): New structure to factor out minor differences
209 in extension class parsing behaviour.
210 (riscv_parse_sv_or_non_std_ext): Rename to...
211 (riscv_parse_prefixed_ext): and parameterise with
212 riscv_parse_config.
213 (riscv_std_z_ext_strtab, riscv_std_s_ext_strtab): New.
214 (riscv_multi_letter_ext_valid_p): New.
215 (riscv_ext_x_valid_p, riscv_ext_z_valid_p, riscv_ext_s_valid_p): New.
216 (riscv_parse_subset): Delegate all non-single-letter parsing work
217 to riscv_parse_prefixed_ext.
218 * bfd/elfxx-riscv.h (riscv_isa_ext_class): New type.
219 (riscv_get_prefix_class): Declare.
220
221 2020-01-22 Alan Modra <amodra@gmail.com>
222
223 * elf64-ppc.c (struct ppc_link_hash_table): Add tga_group.
224 (ppc64_elf_archive_symbol_lookup): Extract __tls_get_addr_opt for
225 __tls_get_addr_desc.
226 (ppc64_elf_size_stubs): Add section for linker generated
227 __tls_get_addr_desc wrapper function. Loop at least once if
228 generating this function.
229 (emit_tga_desc, emit_tga_desc_eh_frame): New functions.
230 (ppc64_elf_build_stubs): Generate __tls_get_addr_desc.
231
232 2020-01-22 Alan Modra <amodra@gmail.com>
233
234 * elf64-ppc.h (struct ppc64_elf_params): Add no_tls_get_addr_regsave.
235 * elf64-ppc.c (struct ppc_link_hash_table): Add tga_desc and
236 tga_desc_fd.
237 (is_tls_get_addr): Match tga_desc and tga_desc_df too.
238 (STDU_R1_0R1, ADDI_R1_R1): Define.
239 (tls_get_addr_prologue, tls_get_addr_epilogue): New functions.
240 (ppc64_elf_tls_setup): Set up tga_desc and tga_desc_fd. Indirect
241 tga_desc_fd to opt_fd, and tga_desc to opt. Set
242 no_tls_get_addr_regsave.
243 (branch_reloc_hash_match): Add hash3 and hash4.
244 (ppc64_elf_tls_optimize): Handle tga_desc_fd and tga_desc too.
245 (ppc64_elf_size_dynamic_sections): Likewise.
246 (ppc64_elf_relocate_section): Likewise.
247 (plt_stub_size, build_plt_stub): Likewise. Size regsave
248 __tls_get_addr stub.
249 (build_tls_get_addr_stub): Build regsave __tls_get_addr stub and
250 eh_frame.
251 (ppc_size_one_stub): Handle tga_desc_fd and tga_desc too. Size
252 eh_frame for regsave __tls_get_addr.
253
254 2020-01-22 Alan Modra <amodra@gmail.com>
255
256 * elf64-ppc.c (ppc64_elf_size_stubs): Correct condition under
257 which __tls_get_addr calls will be eliminated.
258
259 2020-01-20 Nick Clifton <nickc@redhat.com>
260
261 * po/pt.po: Updates Portuguese translation.
262 * po/ru.po: Updated Russian translation.
263 * po/uk.po: Updated Ukranian translation.
264
265 2020-01-20 H.J. Lu <hongjiu.lu@intel.com>
266
267 PR ld/25416
268 * elf64-x86-64.c (elf_x86_64_check_tls_transition): Support
269 "rex leal x@tlsdesc(%rip), %reg" and "call *x@tlsdesc(%eax)" in
270 X32 mode.
271 (elf_x86_64_relocate_section): In x32 mode, for GDesc -> LE
272 transition, relax "rex leal x@tlsdesc(%rip), %reg" to
273 "rex movl $x@tpoff, %reg", for GDesc -> IE transition, relax
274 "rex leal x@tlsdesc(%rip), %reg" to
275 "rex movl x@gottpoff(%rip), %eax". For both transitions, relax
276 "call *(%eax)" to "nopl (%rax)".
277
278 2020-01-20 Alan Modra <amodra@gmail.com>
279
280 * elf64-ppc.c (LD_R11_0R3, CMPDI_R11_0, STD_R11_0R1, LD_R11_0R1),
281 (MTLR_R11): Don't define.
282 (LD_R0_0R3, CMPDI_R0_0): Define.
283 (build_tls_get_addr_stub): Don't use r11 in stub.
284
285 2020-01-20 Alan Modra <amodra@gmail.com>
286
287 * elf64-ppc.c (ppc_elf_hash_entry): New function, use throughout file.
288 (defined_sym_val, is_tls_get_addr): Likewise.
289
290 2020-01-18 Nick Clifton <nickc@redhat.com>
291
292 * version.m4 (BFD_VERSION): Set to 2.34.50.
293 * configure: Regenerate.
294 * po/bfd.pot: Regenerate.
295
296 2020-01-18 Nick Clifton <nickc@redhat.com>
297
298 Binutils 2.34 branch created.
299
300 2020-01-17 Christian Biesinger <cbiesinger@google.com>
301
302 * coff-arm.c: Fix spelling error (seperate).
303 * elfxx-riscv.c (riscv_parse_sv_or_non_std_ext): Fix spelling
304 error (seperate).
305 * sysdep.h (strnlen): Fix spelling error (seperate).
306
307 2020-01-15 Lars Brinkhoff <lars@nocrew.org>
308
309 PR 20694
310 * pdp11.c (TARGET_PAGE_SIZE): Set to 8192.
311
312 2020-01-15 Alan Modra <amodra@gmail.com>
313
314 PR 25384
315 * elf64-ppc.c (ELIMINATE_COPY_RELOCS): Update comment.
316 (ppc64_elf_adjust_dynamic_symbol): Don't allow .dynbss copies
317 of function symbols unless dot symbols are present. Do warn
318 whenever one is created, regardles of whether a PLT entry is
319 also emitted for the function symbol.
320
321 2020-01-14 Alan Modra <amodra@gmail.com>
322
323 * som.c (som_bfd_count_ar_symbols): Error when file position
324 of symbols on chains is not strictly increasing.
325
326 2020-01-14 Alan Modra <amodra@gmail.com>
327
328 * vms.h (VMS_DEBUG): Define as 0.
329 * vms-alpha.c (image_write): Move debug output after bounds check.
330 Tidy bounds check.
331 (_bfd_vms_slurp_eihd): Warning fix.
332 (_bfd_vms_slurp_etir): Init variables to avoid bogus warnings.
333
334 2020-01-13 Alan Modra <amodra@gmail.com>
335
336 * vms-alpha.c (_bfd_vms_slurp_egsd): Ensure minimum size even
337 for "ignored" records.
338
339 2020-01-13 Alan Modra <amodra@gmail.com>
340
341 * wasm-module.c (wasm_scan_name_function_section): Formatting.
342 Delete asect name check. Move asect NULL check to wasm_object_p.
343 Correct bounds check of sizes against end. Replace uses of
344 bfd_zalloc with bfd_alloc, zeroing only necessary bytes. Use
345 just one bfd_release.
346 (wasm_scan): Don't use malloc/strdup for section names,
347 bfd_alloc instead. Simplify code prefixing section name.
348 Formatting. Don't attempt to free memory here..
349 (wasm_object_p): ..do so here.
350
351 2020-01-10 Szabolcs Nagy <szabolcs.nagy@arm.com>
352
353 PR ld/22269
354 * elf32-arm.c (elf32_arm_final_link_relocate): Use
355 UNDEFWEAK_NO_DYNAMIC_RELOC.
356 (allocate_dynrelocs_for_symbol): Likewise.
357
358 2020-01-10 Tamar Christina <tamar.christina@arm.com>
359
360 PR 25210
361 * elfnn-aarch64.c (_bfd_aarch64_create_stub_section): Remove elfclass.
362
363 2020-01-10 Alan Modra <amodra@gmail.com>
364
365 * coff-alpha.c (alpha_ecoff_object_p): Calculate size in bfd_size_type.
366
367 2020-01-09 Nick Clifton <nickc@redhat.com>
368
369 PR 25221
370 * bfd.c (bfd_convert_section_contents): Check for a compress
371 header size that is larger than the actual section size.
372
373 2020-01-08 Alan Modra <amodra@gmail.com>
374
375 PR 25351
376 * elflink.c (bfd_elf_final_link): Call _bfd_fix_excluded_sec_syms
377 after removing sections.
378
379 2020-01-06 Jim Wilson <jimw@sifive.com>
380
381 PR 25205
382 * elfnn-riscv.c (riscv_elf_relocate_section) <R_RISCV_CALL>: Add
383 check for !bfd_link_pic (info).
384 <R_RISCV_CALL_PLT>: Move next to R_RISCV_CALL.
385 <R_RISCV_JAL>: Add comment.
386 (_bfd_riscv_relax_section): For plt.offset check, add check for
387 bfd_link_pic (info). Add comment.
388
389 2020-01-06 Alan Modra <amodra@gmail.com>
390
391 * format.c (bfd_check_format_matches): Ignore bfd_error on target
392 match failures. Don't init to bfd_error_wrong_format before
393 calling _bfd_check_format.
394
395 2020-01-06 Alan Modra <amodra@gmail.com>
396
397 * vms-alpha.c (_bfd_vms_push, _bfd_vms_pop): Return pass/fail
398 status rather than exiting on stack overflow or underflow.
399 (_bfd_vms_slurp_etir): Adjust to suit.
400
401 2020-01-06 Alan Modra <amodra@gmail.com>
402
403 * som.c (som_bfd_fill_in_ar_symbols): Bounds check som_dict index.
404
405 2020-01-06 Alan Modra <amodra@gmail.com>
406
407 * mach-o.c (bfd_mach_o_read_dylinker): Don't read past end of
408 command. Check name offset is within command.
409 (bfd_mach_o_read_dylib, bfd_mach_o_read_prebound_dylib),
410 (bfd_mach_o_read_prebind_cksum, bfd_mach_o_read_twolevel_hints),
411 (bfd_mach_o_read_fvmlib, bfd_mach_o_read_dysymtab),
412 (bfd_mach_o_read_symtab, bfd_mach_o_read_uuid),
413 (bfd_mach_o_read_linkedit, bfd_mach_o_read_str),
414 (bfd_mach_o_read_dyld_info, bfd_mach_o_read_version_min),
415 (bfd_mach_o_read_encryption_info, bfd_mach_o_read_source_version),
416 (bfd_mach_o_read_encryption_info_64, bfd_mach_o_read_main),
417 (bfd_mach_o_read_note, bfd_mach_o_read_build_version),
418 (bfd_mach_o_read_segment): Similarly.
419 (bfd_mach_o_read_thread): Properly bound check thread struct.
420 Don't repeat checks on second loop.
421 (bfd_mach_o_read_command): Fail on invalid command length.
422
423 2020-01-04 Alan Modra <amodra@gmail.com>
424
425 * format.c (bfd_check_format_matches): Add preserve_match.
426 Save initial bfd state in "preserve", matched bfd state in
427 "preserve_match". Save just the first match. Release
428 bfd_alloc memory. Restore and finish preserved state as
429 appropriate on all function exit paths.
430
431 2020-01-04 Alan Modra <amodra@gmail.com>
432
433 * mmo.c (mmo_mkobject): Allocate tdata with bfd_zalloc.
434
435 2020-01-04 Alan Modra <amodra@gmail.com>
436
437 * coffgen.c (coff_real_object_p): Free malloc'd memory on target
438 match too.
439
440 2020-01-03 Nick Clifton <nickc@redhat.com>
441
442 PR 25307
443 (bfd_pef_parse_function_stubs): Correct the test that ensures that
444 there is enough data remaining in the code buffer before
445 attempting to read a function stub.
446
447 2020-01-03 Nick Clifton <nickc@redhat.com>
448
449 PR 25308
450 * elf-properties.c (_bfd_elf_convert_gnu_properties): Check the
451 return value from bfd_malloc.
452 * elf32-arm.c (bfd_elf32_arm_vfp11_fix_veneer_locations): Likewise.
453 (bfd_elf32_arm_stm32l4xx_fix_veneer_locations): Likewise.
454 (elf32_arm_filter_cmse_symbols): Likewise.
455 (elf32_arm_write_section): Likewise.
456 * mach-o.c (bfd_mach_o_core_fetch_environment): Likewise.
457 (bfd_mach_o_follow_dsym): Likewise.
458 * pef.c (bfd_pef_print_loader_section): Likewise.
459 (bfd_pef_scan_start_address): Likewise.
460 (bfd_pef_parse_function_stubs): Likewise.
461 (bfd_pef_parse_symbols): Likewise.
462
463 2020-01-03 Sergei Trofimovich <siarheit@google.com>
464
465 * elfnn-ia64.c (elfNN_ia64_merge_private_bfd_data): don't fail
466 on binary inputs ld/PR25316.
467 (is_ia64_elf): new helper to filter on ia64 objects.
468
469 2020-01-03 Jan Beulich <jbeulich@suse.com>
470
471 * mach-o.c (cpusubtype, bfd_mach_o_header_p): Insert underscore
472 in parameter names.
473 (bfd_mach_o_scan): Insert underscore in two variable names.
474
475 2020-01-02 Sergey Belyashov <sergey.belyashov@gmail.com>
476
477 * Makefile.am: Add z80-elf target support.
478 * configure.ac: Likewise.
479 * targets.c: Likewise.
480 * Makefile.in: Regenerate.
481 * configure: Regenerate.
482 * config.bfd: Add z80-elf target support and new arches: ez80 and
483 z180.
484 * elf32-z80.c: New file.
485 * archures.c: Add new z80 architectures: eZ80 and Z180.
486 * coffcode.h: Likewise.
487 * cpu-z80.c: Likewise.
488 * coff-z80.c: Add new relocations for Z80 target and local label
489 check.
490 * reloc.c: Add new relocs.
491 * bfd-in2.h: Regenerate.
492 * libbfd.h: Regenerate.
493
494 2020-01-02 Tamar Christina <tamar.christina@arm.com>
495
496 PR 25210
497 PR 24753
498 * elfnn-aarch64.c (_bfd_aarch64_create_stub_section): Set ELF class.
499
500 2020-01-01 Alan Modra <amodra@gmail.com>
501
502 Update year range in copyright notice of all files.
503
504 For older changes see ChangeLog-2019
505 \f
506 Copyright (C) 2020 Free Software Foundation, Inc.
507
508 Copying and distribution of this file, with or without modification,
509 are permitted in any medium without royalty provided the copyright
510 notice and this notice are preserved.
511
512 Local Variables:
513 mode: change-log
514 left-margin: 8
515 fill-column: 74
516 version-control: never
517 End: