PR24015, glibc-2.28 on little-endian mips32 broken
[deliverable/binutils-gdb.git] / bfd / ChangeLog
1 2018-12-28 Alan Modra <amodra@gmail.com>
2
3 PR 24015
4 * elf.c (bfd_elf_get_default_section_type): Make common sections
5 SHT_NOBITS.
6 * linker.c (bfd_generic_define_common_symbol): Clear
7 SEC_HAS_CONTENTS.
8
9 2018-12-28 Alan Modra <amodra@gmail.com>
10
11 PR 23966
12 * libbfd.c (SSIZE_MAX): Define.
13 (bfd_malloc, bfd_realloc): Don't cast size to long to check for
14 "negative" values, compare against SSIZE_MAX instead.
15
16 2018-12-23 H.J. Lu <hongjiu.lu@intel.com>
17
18 * elf32-i386.c (elf_i386_rtype_to_howto): Remove the unused bfd
19 pointer argument.
20 (elf_i386_info_to_howto_rel): Updated.
21 (elf_i386_tls_transition): Likewise.
22 (elf_i386_relocate_section): Likewise.
23
24 2018-12-20 H.J. Lu <hongjiu.lu@intel.com>
25
26 * elf32-i386.c (elf_i386_relocate_section): Call
27 elf_i386_rtype_to_howto to get reloc_howto_type pointer.
28 * elf64-x86-64.c (elf_x86_64_relocate_section): Call
29 elf_x86_64_rtype_to_howto to get reloc_howto_type pointer.
30
31 2018-12-18 Alan Modra <amodra@gmail.com>
32
33 * Makefile.am (bfdinclude_HEADERS): Add bfd_stdint.h.
34 (BFD_H_DEPS): Add include/diagnostics.h.
35 (LOCAL_H_DEPS): Add bfd_stdint.h.
36 * bfd-in.h: Include bfd_stdint.h.
37 * arc-plt.h: Don't include stdint.h.
38 * coff-rs6000.c: Likewise.
39 * coff64-rs6000.c: Likewise.
40 * elfxx-riscv.c: Likewise.
41 * cache.c: Don't include bfd_stdint.h.
42 * elf32-arm.c: Likewise.
43 * elf32-avr.c: Likewise.
44 * elf32-nds32.c: Likewise.
45 * elf32-rl78.c: Likewise.
46 * elf32-rx.c: Likewise.
47 * elf32-wasm32.c: Likewise.
48 * elf64-nfp.c: Likewise.
49 * elflink.c: Likewise.
50 * elfnn-aarch64.c: Likewise.
51 * elfnn-ia64.c: Likewise.
52 * elfxx-ia64.c: Likewise.
53 * elfxx-x86.h: Likewise.
54 * wasm-module.c: Likewise, and don't include sysdep.h twice.
55 * elf-nacl.h: Don't include bfd.h.
56 * mach-o.h: Likewise.
57 * elfxx-aarch64.c: Include bfd.h and elf-bfd.h.
58 * elfxx-aarch64.h: Don't include bfd.h, elf-bfd.h or stdint.h.
59 * mach-o-aarch64.c: Include mach-o.h later.
60 * mach-o-arm.c: Likewise.
61 * mach-o-i386.c: Likewise.
62 * mach-o-x86-64.c: Likewise.
63 * mach-o.c: Likewise.
64 * sysdep.h: Don't include ansidecl.h or sys/stat.h.
65 * Makefile.in: Regenerate.
66 * bfd-in2.h: Regenerate.
67
68 2018-12-18 Alan Modra <amodra@gmail.com>
69
70 PR 23980
71 * elf32-i386.c (elf_i386_relocate_section): Exit with wrong format
72 error rather than asserting input file is as expected.
73 * elf32-s390.c (elf_s390_relocate_section): Likewise.
74 * elf32-sh.c (sh_elf_relocate_section): Likewise.
75 * elf32-xtensa.c (elf_xtensa_relocate_section): Likewise.
76 * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
77 * elf64-s390.c (elf_s390_relocate_section): Likewise.
78 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
79 * elf32-ppc.c (ppc_elf_relocate_section): Exit with wrong format
80 error if input file is not ppc32 ELF.
81
82 2018-12-18 Alan Modra <amodra@gmail.com>
83
84 PR 23980
85 * elf64-ppc.c (ppc64_elf_hide_symbol): Check hash table type
86 before referencing ppc64-only fields of hash entries.
87
88 2018-12-17 Alan Modra <amodra@gmail.com>
89
90 PR 23994
91 * aoutx.h: Include limits.h.
92 (get_reloc_upper_bound): Detect long overflow and return a file
93 too big error if it occurs.
94 * elf.c: Include limits.h.
95 (_bfd_elf_get_symtab_upper_bound): Detect long overflow and return
96 a file too big error if it occurs.
97 (_bfd_elf_get_dynamic_symtab_upper_bound): Likewise.
98 (_bfd_elf_get_dynamic_reloc_upper_bound): Likewise.
99
100 2018-12-14 H.J. Lu <hongjiu.lu@intel.com>
101
102 PR ld/23900
103 * elf.c (get_program_header_size): Add a PT_GNU_PROPERTY
104 segment for NOTE_GNU_PROPERTY_SECTION_NAME.
105 (_bfd_elf_map_sections_to_segments): Create a PT_GNU_PROPERTY
106 segment for NOTE_GNU_PROPERTY_SECTION_NAME.
107 * elfxx-x86.c (_bfd_elf_link_setup_gnu_properties): Don't set
108 GNU_PROPERTY_X86_UINT32_VALID.
109
110 2018-12-11 Max Filippov <jcmvbkbc@gmail.com>
111
112 * elf32-xtensa.c (elf_xtensa_do_reloc): Limit const16 opcode
113 immediate field to 16 least significant bits.
114
115 2018-12-11 H.J. Lu <hongjiu.lu@intel.com>
116
117 * elf32-xc16x.c (elf32_xc16x_rtype_to_howto): New function.
118 (elf32_xc16x_relocate_section): Call elf32_xc16x_rtype_to_howto
119 instead of xc16x_reloc_type_lookup to get reloc_howto_type.
120
121 2018-12-07 H.J. Lu <hongjiu.lu@intel.com>
122
123 PR ld/23958
124 * elflink.c (_bfd_elf_add_default_symbol): Override the previous
125 definition from IR object.
126
127 2018-12-08 Stafford Horne <shorne@gmail.com>
128
129 * elf32-or1k.c (or1k_grok_prstatus): New function.
130 (or1k_grok_psinfo): Likewise.
131
132 2018-12-07 H.J. Lu <hongjiu.lu@intel.com>
133
134 * elf-properties.c (elf_find_and_remove_property): Add a
135 bfd_boolean argument to indicate if the property should be
136 removed.
137 (elf_merge_gnu_property_list): Updated. Report
138 property change in linker map file.
139 (elf_get_gnu_property_section_size): Skip property_remove
140 properties.
141 (elf_write_gnu_properties): Likewise.
142 (_bfd_elf_link_setup_gnu_properties): Report property merge
143 in linker map file. Pass abfd to elf_merge_gnu_property_list.
144
145 2018-12-07 Alan Modra <amodra@gmail.com>
146
147 PR 23952
148 * syms.c (_bfd_generic_read_minisymbols): Free syms before
149 returning with zero symcount.
150
151 2018-12-06 Alan Modra <amodra@gmail.com>
152
153 * elf32-ppc.c (ppc_elf_howto_raw <R_PPC_VLE_ADDR20>): Correct
154 mask and shift value.
155 (ppc_elf_vle_split16): Use E_OPCODE_MASK. Handle e_li
156 specially.
157
158 2018-12-05 Sam Tebbs <sam.tebbs@arm.com>
159
160 * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Add check for 'B'.
161
162 2018-12-04 H.J. Lu <hongjiu.lu@intel.com>
163
164 PR ld/23372
165 * elfxx-x86.c (_bfd_x86_elf_merge_gnu_properties): Don't remove
166 empty properties for GNU_PROPERTY_X86_COMPAT_ISA_1_USED and
167 GNU_PROPERTY_X86_UINT32_OR_AND.
168 (_bfd_x86_elf_link_fixup_gnu_properties): Likewise.
169
170 2018-12-03 Kito Cheng <kito@andestech.com>
171
172 * elfxx-riscv.h (RISCV_DONT_CARE_VERSION): New macro.
173 (struct riscv_subset_t): New structure.
174 (riscv_subset_t): New typedef.
175 (riscv_subset_list_t): New structure.
176 (riscv_release_subset_list): New prototype.
177 (riscv_add_subset): Likewise.
178 (riscv_lookup_subset): Likewise.
179 (riscv_lookup_subset_version): Likewise.
180 (riscv_release_subset_list): Likewise.
181 * elfxx-riscv.c: Include safe-ctype.h.
182 (riscv_parsing_subset_version): New function.
183 (riscv_supported_std_ext): Likewise.
184 (riscv_parse_std_ext): Likewise.
185 (riscv_parse_sv_or_non_std_ext): Likewise.
186 (riscv_parse_subset): Likewise.
187 (riscv_add_subset): Likewise.
188 (riscv_lookup_subset): Likewise.
189 (riscv_lookup_subset_version): Likewise.
190 (riscv_release_subset_list): Likewise.
191
192 2018-12-01 H.J. Lu <hongjiu.lu@intel.com>
193
194 PR ld/23930
195 * elfxx-x86.c (_bfd_x86_elf_size_dynamic_sections): Update
196 the iplt section alignment if it is non-empty.
197 (_bfd_x86_elf_link_setup_gnu_properties): Set plt.iplt_alignment
198 and delay setting the iplt section alignment.
199 * elfxx-x86.h (elf_x86_plt_layout): Add iplt_alignment.
200
201 2018-11-30 Nick Clifton <nickc@redhat.com>
202
203 PR 23942
204 * elfcode.h (elf_object_p): Check for corrupt input files with
205 more program headers than can actually fit in the file.
206
207 2018-11-30 Nick Clifton <nickc@redhat.com>
208
209 PR 23932
210 * elf.c (IS_CONTAINED_BY_LMA): Add a check for a negative section
211 size.
212 (rewrite_elf_program_header): If no sections are mapped into a
213 segment return an error.
214
215 2018-11-30 Alan Modra <amodra@gmail.com>
216
217 PR 23937
218 * elf64-ppc.c (write_plt_relocs_for_local_syms): Don't add local
219 entry offset for ifuncs.
220
221 2018-11-29 H.J. Lu <hongjiu.lu@intel.com>
222
223 PR ld/23929
224 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Don't
225 merge .note.gnu.property section in IR inputs.
226
227 2018-11-27 Thomas Preud'homme <thomas.preudhomme@linaro.org>
228
229 * cpu-arm.c (processors): Add processors known to GAS but missing here
230 and reindent.
231 (bfd_arm_update_notes): Add comment explaining why the list of
232 architectures in the switch should not be updated.
233 (architectures): Likewise.
234
235 2018-11-27 Maciej W. Rozycki <macro@linux-mips.org>
236
237 * elfxx-mips.c (_bfd_mips_elf_check_relocs) <R_MIPS16_HI16>
238 <R_MIPS_HI16, R_MIPS_HIGHER, R_MIPS_HIGHEST, R_MICROMIPS_HI16>
239 <R_MICROMIPS_HIGHER, R_MICROMIPS_HIGHEST>: Also accept an
240 absolute symbol in PIC code.
241
242 2018-11-27 Maciej W. Rozycki <macro@linux-mips.org>
243
244 * elfxx-mips.c (_bfd_mips_elf_check_relocs) <R_MIPS16_26>
245 <R_MIPS_26, R_MICROMIPS_26_S1>: Use `info->callbacks->einfo'
246 rather than `_bfd_error_handler' to report refused relocations
247 in PIC code and continue processing. Fix error message: `can
248 not' -> `cannot'.
249
250 2018-11-27 H.J. Lu <hongjiu.lu@intel.com>
251
252 PR binutils/23919
253 * compress.c (bfd_is_section_compressed_with_header): Initialize
254 *uncompressed_align_pow_p to 0.
255
256 2018-11-27 Tamar Christina <tamar.christina@arm.com>
257
258 PR ld/23904
259 * elfnn-aarch64.c (_bfd_aarch64_adrp_p): Use existing constants.
260 (_bfd_aarch64_erratum_843419_branch_to_stub): Use _bfd_aarch64_adrp_p.
261 (struct erratum_835769_branch_to_stub_clear_data): New.
262 (_bfd_aarch64_erratum_843419_clear_stub): New.
263 (clear_erratum_843419_entry): New.
264 (elfNN_aarch64_tls_relax): Use it.
265 (elfNN_aarch64_relocate_section): Pass input_section.
266 (aarch64_map_one_stub): Handle branch type none as valid.
267
268 2018-11-27 Mark Wielaard <mark@klomp.org>
269
270 PR binutils/23919
271 * bfd.c (bfd_update_compression_header): Explicitly set alignment.
272 (bfd_check_compression_header): Add uncompressed_alignment_power
273 argument. Check ch_addralign is a power of 2.
274 * bfd-in2.h: Regenerated.
275 * compress.c (bfd_compress_section_contents): Get and set
276 orig_uncompressed_alignment_pow if section is decompressed.
277 (bfd_is_section_compressed_with_header): Add and get
278 uncompressed_align_pow_p argument.
279 (bfd_is_section_compressed): Add uncompressed_align_power argument
280 to bfd_is_section_compressed_with_header call.
281 (bfd_init_section_decompress_status): Get and set
282 uncompressed_alignment_power.
283 * elf.c (_bfd_elf_make_section_from_shdr): Add
284 uncompressed_align_power argument to
285 bfd_is_section_compressed_with_header call.
286
287 2018-11-21 Jozef Lawrynowicz <jozef.l@mittosystems.com>
288
289 * elf32-msp430.c (elf32_msp430_merge_mspabi_attributes): Do not
290 error when .MSP430.attributes section is missing from objects
291 created by LTO.
292
293 2018-11-13 Jim Wilson <jimw@sifive.com>
294
295 * elfnn-riscv.c (riscv_float_abi_string): New.
296 (_bfd_riscv_elf_merge_private_bfd_data): Use it for error message.
297
298 2018-11-09 Bernhard M. Wiedemann <bwiedemann@suse.de>
299
300 * peXXigen.c (_bfd_XXi_only_swap_filehdr_out): Correct comment
301 concerning timestamp insertion.
302
303 2018-11-09 Cupertino Miranda <cmiranda@synopsys.com>
304
305 * arc-got.h (arc_got_entry_type_for_reloc): Changed to
306 correct static TLS relocs.
307 * elf32-arc.c (elf_arc_check_relocs): Introduced warning to
308 TLS relocs which require -fPIC.
309 (arc_create_forced_local_got_entries_for_tls): Created.
310 Traverses list of GOT entries to be resolved statically
311 when needed.
312 (elf_arc_finish_dynamic_sections): Changed. Calls
313 arc_create_forced_local_got_entries_for_tls for each known
314 possibly GOT symbol.
315
316 2018-11-09 rhn <sowaac.rhn@porcupinefactory.org>
317
318 PR 23699
319 * ihex.c (ihex_write_object_contents): Check for sign extended
320 addresses that cannot be supported in the ihex format.
321
322 2018-11-09 Claudiu Zissulescu <claziss@synopsys.com>
323
324 * arc-got.h (arc_get_local_got_ents): Revamp it; use
325 elf_local_got_ents to store the local got list.
326 (get_got_entry_list_for_symbo): Restructure it.
327 * elf32-arc.c (elf_arc_relocate_section): Correct the call to
328 get_got_entry_list_for_symbol.
329
330 2018-11-07 Nick Clifton <nickc@redhat.com>
331
332 * po/fr.po: Updated French translation.
333 * po/pt.po: Updated Portuguese translation.
334
335 2018-11-06 Roman Bolshakov <r.bolshakov@yadro.com>
336 Saagar Jha <saagar@saagarjha.com>
337
338 * mach-o.h: Add new enums for BFD_MACH_O_PLATFORM_MACOS,
339 BFD_MACH_O_PLATFORM_IOS, BFD_MACH_O_PLATFORM_TVOS,
340 BFD_MACH_O_PLATFORM_WATCHOS, BFD_MACH_O_PLATFORM_BRIDGEOS,
341 BFD_MACH_O_TOOL_CLANG, BFD_MACH_O_TOOL_SWIFT, BFD_MACH_O_TOOL_LD.
342 (struct bfd_mach_o_note_command): New.
343 (struct bfd_mach_o_build_version_tool): New.
344 (struct bfd_mach_o_build_version_command): New.
345 (bfd_mach_o_read_version_min): Don't split version into
346 a few fields. Rename reserved to sdk.
347 * mach-o.c (bfd_mach_o_read_version_min): Don't split version into a
348 few fields. Rename reserved to sdk.
349 (bfd_mach_o_read_command): Handle LC_VERSION_MIN_TVOS, LC_NOTE,
350 LC_BUILD_VERSION.
351 (bfd_mach_o_read_note): New.
352 (bfd_mach_o_read_build_version): New.
353
354 2018-11-07 Yoshinori Sato <ysato@users.sourceforge.jp>
355
356 * config.bfd: Add rx-*-linux.
357 * congigure.ac: Likewise.
358 * elf32-rx.c (rx_linux_object_p): New function.
359 (TARGET_LITTLE_SYM, TARGET_LITTLE_NAME)
360 (elf_backend_object_p, elf32_bed): Define rx-*-linux.
361 * targets.c: Add rx_elf32_linux_le_vec.
362 * configure: Regenerate.
363
364 2018-11-06 Romain Margheriti <lilrom13@gmail.com>
365
366 PR 23742
367 * mach-o.c (bfd_mach_o_read_command): Accept and ignore
368 BFD_MACH_O_LC_LINKER_OPTIONS and BFD_MACH_O_LC_BUILD_VERSION
369 commands.
370
371 2018-11-02 Alan Modra <amodra@gmail.com>
372
373 PR 23850
374 * elf.c (bfd_section_from_shdr): Treat SHF_ALLOC SHT_REL* sections
375 in an executable or shared library as normal sections.
376
377 2018-10-31 Renlin Li <renlin.li@arm.com>
378
379 * elfnn-aarch64.c (elfNN_aarch64_check_relocs): Don't create got
380 section for Local Exec TLS model.
381
382 2018-10-24 H.J. Lu <hongjiu.lu@intel.com>
383
384 PR ld/23818
385 * elflink.c (_bfd_elf_link_assign_sym_version): Hide symbols
386 defined in discarded input sections.
387
388 2018-10-24 Alan Modra <amodra@gmail.com>
389
390 * elf32-arm.c (elf32_arm_size_stubs): Ignore as-needed libs that
391 were not needed.
392
393 2018-10-23 Alan Modra <amodra@gmail.com>
394
395 PR 23806
396 * merge.c (_bfd_add_merge_section): Don't attempt to merge
397 sections with ridiculously large alignments.
398
399 2018-10-23 Alan Modra <amodra@gmail.com>
400
401 PR 23805
402 * elflink.c (elf_link_input_bfd): Don't segfault on finding
403 STT_TLS symbols without any TLS sections. Instead, change the
404 symbol type to STT_NOTYPE.
405
406 2018-10-23 Alan Modra <amodra@gmail.com>
407
408 PR 23804
409 * merge.c (_bfd_add_merge_section): Don't attempt to merge
410 sections where size is not a multiple of entsize.
411
412 2018-10-20 Alan Modra <amodra@gmail.com>
413
414 PR 23788
415 * elf.c (section_match): Don't require a size match for SHT_SYMTAB
416 or SHT_STRTAB.
417
418 2018-10-17 Alan Modra <amodra@gmail.com>
419
420 PR 23653
421 * elflink.c (_bfd_elf_link_create_dynstrtab): Match elf_object_id
422 too when choosing dynobj.
423
424 2018-10-16 Alan Modra <amodra@gmail.com>
425
426 * peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Simplify
427 PE_DEBUG_DATA size checks.
428
429 2018-10-16 Alan Modra <amodra@gmail.com>
430
431 PR 23781
432 * peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Free data
433 before returning.
434
435 2018-10-16 Alan Modra <amodra@gmail.com>
436
437 PR 23534
438 * init.c (bfd_init): Return an unsigned int.
439 bfd-in2.h: Regenerate.
440
441 2018-10-15 Alan Modra <amodra@gmail.com>
442
443 PR 23534
444 * init.c (BFD_INIT_MAGIC): Define.
445 (bfd_init): Return BFD_INIT_MAGIC.
446 bfd-in2.h: Regenerate.
447
448 2018-10-13 Alan Modra <amodra@gmail.com>
449
450 PR 23770
451 PR 23425
452 * reloc.c (_bfd_clear_contents): Replace "location" param with
453 "buf" and "off". Bounds check "off". Return status.
454 * cofflink.c (_bfd_coff_generic_relocate_section): Update
455 _bfd_clear_contents call.
456 * elf-bfd.h (RELOC_AGAINST_DISCARDED_SECTION): Likewise.
457 * elf32-arc.c (elf_arc_relocate_section): Likewise.
458 * elf32-i386.c (elf_i386_relocate_section): Likewise.
459 * elf32-metag.c (metag_final_link_relocate): Likewise.
460 * elf32-nds32.c (nds32_elf_get_relocated_section_contents): Likewise.
461 * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
462 * elf32-visium.c (visium_elf_relocate_section): Likewise.
463 * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
464 * elf64-x86-64.c *(elf_x86_64_relocate_section): Likewise.
465 * libbfd-in.h (_bfd_clear_contents): Update prototype.
466 * libbfd.h: Regenerate.
467
468 2018-10-09 Egeyar Bagcioglu <egeyar.bagcioglu@oracle.com>
469
470 * elflink.c (elf_link_output_extsym): Do not place symbols into a
471 discarded .dynsym.
472
473 2018-10-08 H.J. Lu <hongjiu.lu@intel.com>
474
475 PR ld/23428
476 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Don't
477 add GNU_PROPERTY_X86_FEATURE_2_NEEDED to force program header
478 in non-code PT_LOAD segment.
479
480 2018-10-08 Alan Modra <amodra@gmail.com>
481
482 * elf-nacl.c (nacl_modify_segment_map): Cope with header PT_LOAD
483 lacking sections.
484 * elf.c (_bfd_elf_map_sections_to_segments): Assume file and
485 program headers are required when info->load_phdrs. Reorganize
486 code handling program headers. Generate a mapping without
487 sections just for file and program headers when -z separate-code
488 would indicate they should be on a different page to the first
489 section.
490
491 2018-10-08 Alan Modra <amodra@gmail.com>
492
493 * elf.c (assign_file_positions_for_load_sections): Set p_vaddr
494 from m->p_vaddr_offset for segments without sections. Invert
495 sign of p_vaddr_offset.
496 (rewrite_elf_program_header, copy_elf_program_header): Save
497 old segment p_vaddr to p_vaddr_offset. Invert sign of
498 p_vaddr_offset.
499
500 2018-10-08 Alan Modra <amodra@gmail.com>
501
502 * elf.c (get_program_header_size): Don't count PT_INTERP if
503 .interp is empty.
504 (_bfd_elf_map_sections_to_segments): Don't create PT_INTERP if
505 .interp is empty.
506
507 2018-10-08 Alan Modra <amodra@gmail.com>
508
509 * elf32-spu.c (spu_elf_modify_segment_map): Don't insert
510 overlays before segment containing headers.
511
512 2018-10-08 Alan Modra <amodra@gmail.com>
513
514 * elf.c (make_mapping): Cope with zero size array at end of
515 struct elf_segment_map.
516 (_bfd_elf_map_sections_to_segments): Likewise.
517 (rewrite_elf_program_header, copy_elf_program_header): Likewise.
518 (_bfd_elf_map_sections_to_segments): Rename phdr_index to hdr_index.
519
520 2018-10-05 Alan Modra <amodra@gmail.com>
521
522 * elf32-spu.c (spu_elf_create_sections): Make .note.spu_name
523 SHT_NOTE.
524
525 2018-10-05 Richard Henderson <rth@twiddle.net>
526
527 * bfd-in2.h: Regenerated.
528 * elf32-or1k.c: (or1k_elf_howto_table): Fix formatting for
529 R_OR1K_PLT26, Add R_OR1K_PCREL_PG21, R_OR1K_GOT_PG21,
530 R_OR1K_TLS_GD_PG21, R_OR1K_TLS_LDM_PG21, R_OR1K_TLS_IE_PG21,
531 R_OR1K_LO13, R_OR1K_GOT_LO13, R_OR1K_TLS_GD_LO13, R_OR1K_TLS_LDM_LO13,
532 R_OR1K_TLS_IE_LO13, R_OR1K_SLO13, R_OR1K_PLTA26.
533 (or1k_reloc_map): Add BFD_RELOC_OR1K_PCREL_PG21,
534 BFD_RELOC_OR1K_GOT_PG21, BFD_RELOC_OR1K_TLS_GD_PG21,
535 BFD_RELOC_OR1K_TLS_LDM_PG21, BFD_RELOC_OR1K_TLS_IE_PG21,
536 BFD_RELOC_OR1K_LO13, BFD_RELOC_OR1K_GOT_LO13,
537 BFD_RELOC_OR1K_TLS_GD_LO13, BFD_RELOC_OR1K_TLS_GD_LO13,
538 BFD_RELOC_OR1K_TLS_LDM_LO13, BFD_RELOC_OR1K_TLS_IE_LO13,
539 BFD_RELOC_OR1K_SLO13, BFD_RELOC_OR1K_PLTA26.
540 (elf_or1k_link_hash_table): Add field saw_plta.
541 (or1k_final_link_relocate): Add value calculations for new relocations.
542 (or1k_elf_relocate_section): Add section relocations for new
543 relocations.
544 (or1k_write_plt_entry): New function.
545 (or1k_elf_finish_dynamic_sections): Add support for PLTA relocations
546 using new l.adrp instruction. Cleanup PLT relocation code generation.
547 * libbfd.h: Regenerated.
548 * reloc.c: Add BFD_RELOC_OR1K_PCREL_PG21, BFD_RELOC_OR1K_LO13,
549 BFD_RELOC_OR1K_SLO13, BFD_RELOC_OR1K_GOT_PG21, BFD_RELOC_OR1K_GOT_LO13,
550 BFD_RELOC_OR1K_PLTA26, BFD_RELOC_OR1K_TLS_GD_PG21,
551 BFD_RELOC_OR1K_TLS_GD_LO13, BFD_RELOC_OR1K_TLS_LDM_PG21,
552 BFD_RELOC_OR1K_TLS_LDM_LO13, BFD_RELOC_OR1K_TLS_IE_PG21,
553 BFD_RELOC_OR1K_TLS_IE_LO13.
554
555 2018-10-05 Richard Henderson <rth@twiddle.net>
556
557 * elf32-or1k.c (or1k_elf_relocate_section): Add error for unknown
558 relocations. Add error for non zero addend with plt and got
559 relocations. Add error for got and plt references against dynamic, non
560 local, symbols. Add error when linking non shared liraries with
561 flag_pic.
562
563 2018-10-05 Richard Henderson <rth@twiddle.net>
564 Stafford Horne <shorne@gmail.com>
565
566 * bfd-in2.h: Regenerated.
567 * elf32-or1k.c (N_ONES): New macro.
568 (or1k_elf_howto_table): Fix R_OR1K_PLT26 to complain on overflow.
569 Add definitions for R_OR1K_TLS_TPOFF, R_OR1K_TLS_DTPOFF,
570 R_OR1K_TLS_DTPMOD, R_OR1K_AHI16, R_OR1K_GOTOFF_AHI16,
571 R_OR1K_TLS_IE_AHI16, R_OR1K_TLS_LE_AHI16, R_OR1K_SLO16,
572 R_OR1K_GOTOFF_SLO16, R_OR1K_TLS_LE_SLO16.
573 (or1k_reloc_map): Add entries for BFD_RELOC_HI16_S,
574 BFD_RELOC_LO16_GOTOFF, BFD_RELOC_HI16_GOTOFF, BFD_RELOC_HI16_S_GOTOFF,
575 BFD_RELOC_OR1K_TLS_IE_AHI16, BFD_RELOC_OR1K_TLS_LE_AHI16,
576 BFD_RELOC_OR1K_SLO16, BFD_RELOC_OR1K_GOTOFF_SLO16,
577 BFD_RELOC_OR1K_TLS_LE_SLO16.
578 (or1k_reloc_type_lookup): Change search loop to start ad index 0 and
579 also check results before returning.
580 (or1k_reloc_name_lookup): Simplify loop to use R_OR1K_max as index
581 limit.
582 (or1k_final_link_relocate): New function.
583 (or1k_elf_relocate_section): Add support for new AHI and SLO
584 relocations. Use or1k_final_link_relocate instead of generic
585 _bfd_final_link_relocate.
586 (or1k_elf_check_relocs): Add support for new AHI and SLO relocations.
587 * reloc.c: Add new enums for BFD_RELOC_OR1K_SLO16,
588 BFD_RELOC_OR1K_GOTOFF_SLO16, BFD_RELOC_OR1K_TLS_IE_AHI16,
589 BFD_RELOC_OR1K_TLS_IE_AHI16, BFD_RELOC_OR1K_TLS_LE_AHI16,
590 BFD_RELOC_OR1K_TLS_LE_SLO16. Remove unused BFD_RELOC_OR1K_GOTOFF_HI16
591 and BFD_RELOC_OR1K_GOTOFF_LO16.
592 * libbfd.h: Regenerated.
593
594 2018-10-04 Jim Wilson <jimw@sifive.com>
595
596 * elfnn-riscv.c (riscv_elf_size_dynamic_sections): In dynobj->sections
597 loop, handle htab->sdyntdata section.
598
599 2018-10-04 Jose E. Marchesi <jose.marchesi@oracle.com>
600
601 * elf64-sparc.c (elf64_sparc_output_arch_syms): Do notcorrect the
602 impact of STT_REGISTER symbols in the dynsym sh_info here...
603 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_sections): ...but
604 do it here.
605
606 2018-10-03 H.J. Lu <hongjiu.lu@intel.com>
607
608 PR ld/23658
609 * elf.c (get_program_header_size): Put all adjacent SHT_NOTE
610 sections with the same section alignment into a single PT_NOTE
611 segment. Check SHT_NOTE section type instead of section name.
612 (_bfd_elf_map_sections_to_segments): Likewise.
613
614 2018-10-03 Millan Wolff <mail@milianw.de>
615
616 PR 23715
617 * dwarf2.c (find_abstract_instance): Allow recursive invocations
618 of find_abstract_instance to override the name variable.
619
620 2018-10-03 Nick Clifton <nickc@redhat.com>
621
622 * po/pt.po: Updated Portuguese translation.
623
624 2018-10-01 Cupertino Miranda <cmiranda@synopsys.com>
625
626 * arc-got.h (relocate_fix_got_relocs_for_got_info): Changed. Take TLS
627 section alignment in consideration for this relocation. Fixed TCB_SIZE
628 offset size to include section alignment.
629 (get_got_entry_list_for_symbol): Changed.
630 * elf32-arc.c (FINAL_SECTSTART): Added this formula macro.
631 (ARC_TLS_DTPOFF) Updated reloc to use new created macro instead.
632 (arc_special_overflow_checks): Fixed TCB_SIZE offsize to include
633 section alignment.
634 (elf_arc_check_relocs): Changed.
635 (elf_arc_finish_dynamic_symbol) Return FALSE in case arc_htab is NULL.
636 (struct elf_arc_link_hash_entry): Moved and changed.
637 (elf_arc_link_hash_newfunc): Changed.
638 (arc_elf_link_hash_table_create): Removed old initializations.
639 (elf_arc_relocate_section, elf_arc_finish_dynamic_symbol): Changed.
640
641 2018-09-28 H.J. Lu <hongjiu.lu@intel.com>
642
643 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Use
644 elfclass instead of bed->s->elfclass.
645
646 2018-09-27 Jim Wilson <jimw@sifive.com>
647
648 * elfnn-riscv.c (riscv_init_pcgp_relocs): Add explanatory comment.
649 (riscv_free_pcgp_relocs, riscv_record_pcgp_reloc): Likewise.
650 (riscv_find_pcgp_hi_reloc, riscv_reocrd_pcgp_lo_reloc): Likewise.
651 (riscv_find_pcgp_lo_reloc): Likewise.
652 (riscv_delete_pcgp_hi_reloc, riscv_use_pcgp_hi_reloc): Delete.
653 (riscv_delete_pcgp_lo_reloc): Likewise.
654 (_bfd_riscv_relax_pc): Don't call riscv_use_pcgp_hi_reloc. Replace
655 calls to riscv_delete_pcgp_lo_reloc and riscv_delete_pcgp_hi_reloc
656 with TRUE. Mark abfd arg as ATTRIBUTE_UNUSED.
657
658 2018-09-25 Jim Wilson <jimw@sifive.com>
659
660 * elfnn-riscv.c (riscv_make_plt_header): New arg output_bfd. Change
661 return type to bfd_boolean. If EF_RISCV_RVE call _bfd_error_handler
662 and return FALSE. Return TRUE at end.
663 (riscv_make_plt_entry): Likewise.
664 (riscv_elf_finish_dynamic_symbol): Update call to riscv_make_plt_entry.
665 (riscv_elf_finish_dynamic_sections): Update call to
666 riscv_make_plt_header.
667
668 2018-09-24 Jim Wilson <jimw@sifive.com>
669
670 * elfnn-riscv.c (_bfd_riscv_relax_pc) <R_RISCV_PCREL_LO12_I>: New local
671 hi_sec_off which is symbol address with addend subtracted. Use in
672 riscv_find_pcgp_hi_reloc and riscv_record_pcgp_lo_reloc calls.
673
674 * elfnn-riscv.c (riscv_resolve_pcrel_lo_relocs): Add check for reloc
675 overflow with addend. Use reloc_dangerous instead of reloc_overflow.
676 Add strings for the two errors handled here.
677 (riscv_elf_relocate_section) In case R_RISCV_PCREL_LO12_I, rewrite
678 comment. Only give error with addend when used with section symbol.
679 In case bfd_reloc_dangerous, update error string.
680
681 2018-09-24 Jozef Lawrynowicz <jozef.l@mittosystems.com>
682
683 PR gdb/20948
684 * elf.c (_bfd_elf_write_object_contents): Return from function
685 early if abfd->direction == both_direction.
686
687 2018-09-21 Simon Marchi <simon.marchi@ericsson.com>
688
689 * configure.ac: Check for fls.
690 * elf32-nds32.c (fls): Only define if !HAVE_FLS.
691 * config.in: Re-generate.
692 * configure: Re-generate.
693
694 2018-09-20 Maciej W. Rozycki <macro@linux-mips.org>
695
696 * config.bfd <rs6000-*-aix5.[01], rs6000-*-aix[5-9]*>: Remove
697 duplicate `case' selectors.
698
699 2018-09-20 Nelson Chu <nelson.chu1990@gmail.com>
700
701 * elf32-nds32.c (nds32_elf_relax_loadstore):
702 Remove the unused target features.
703 (bfd_elf32_nds32_set_target_option): Remove the unused parameters.
704 (nds32_elf_relax_piclo12, nds32_elf_relax_letlslo12,
705 nds32_elf_relax_letlsadd, nds32_elf_relax_letlsls,
706 nds32_elf_relax_pltgot_suff, nds32_elf_relax_got_suff
707 nds32_elf_relax_gotoff_suff, calculate_plt_memory_address,
708 calculate_plt_offset, calculate_got_memory_address,
709 nds32_elf_check_dup_relocs): Removed.
710 All callers changed.
711 * elf32-nds32.h: Remove the unused macros and defines.
712 (elf_nds32_link_hash_table): Remove the unused variable.
713 (bfd_elf32_nds32_set_target_option): Update prototype.
714 (nds32_elf_ex9_init): Removed.
715 * elf32-nds32.c (nds32_convert_32_to_16): Updated.
716 * elf32-nds32.c (HOWTO2, HOWTO3): Define new HOWTO macros
717 to initialize array nds32_elf_howto_table in any order
718 without lots of EMPTY_HOWTO.
719 (nds32_reloc_map): Updated.
720 * reloc.c: Add BFD_RELOC_NDS32_LSI.
721 * bfd-in2.h: Regenerated.
722 * bfd/libbfd.h: Regenerated.
723 * elf32-nds32.c (nds32_elf_relax_howto_table): Add R_NDS32_LSI.
724 (nds32_reloc_map): Likewise.
725 (nds32_elf_relax_flsi): New function.
726 (nds32_elf_relax_section): Support floating load/store relaxation.
727 * elf32-nds32.c (NDS32_GUARD_SEC_P, elf32_nds32_local_gp_offset):
728 New macro.
729 (struct elf_nds32_link_hash_entry): New `offset_to_gp' field.
730 (struct elf_nds32_obj_tdata): New `offset_to_gp' and `hdr_size' fields.
731 (elf32_nds32_allocate_local_sym_info, nds32_elf_relax_guard,
732 nds32_elf_is_target_special_symbol, nds32_elf_maybe_function_sym):
733 New functions.
734 (nds32_info_to_howto_rel): Add BFD_ASSERT.
735 (bfd_elf32_bfd_reloc_type_table_lookup, nds32_elf_link_hash_newfunc,
736 nds32_elf_link_hash_table_create, nds32_elf_relocate_section,
737 nds32_elf_relax_loadstore, nds32_elf_relax_lo12, nds32_relax_adjust_label,
738 bfd_elf32_nds32_set_target_option, nds32_fag_mark_relax): Updated.
739 (nds32_elf_final_sda_base): Improve it to find the better gp value.
740 (insert_nds32_elf_blank): Must consider `len' when inserting blanks.
741 * elf32-nds32.h (bfd_elf32_nds32_set_target_option): Update prototype.
742 (struct elf_nds32_link_hash_table): Add new variable `hyper_relax'.
743 * elf32-nds32.c (elf32_nds32_allocate_dynrelocs): New function.
744 (create_got_section): Likewise.
745 (allocate_dynrelocs, nds32_elf_size_dynamic_sections,
746 nds32_elf_relocate_section, nds32_elf_finish_dynamic_symbol): Updated.
747 (nds32_elf_check_relocs): Fix the issue that the shared library may
748 has TEXTREL entry in the dynamic section.
749 (nds32_elf_create_dynamic_sections): Enable to call readonly_dynrelocs
750 since the TEXTREL issue is fixed in the nds32_elf_check_relocs.
751 (nds32_elf_finish_dynamic_sections): Update and add DT_RELASZ
752 dynamic entry.
753 (calculate_offset): Remove the unused parameter `pic_ext_target' and
754 related codes.
755 All callers changed.
756 (elf_backend_dtrel_excludes_plt): Disable it temporarily since it
757 will cause some errors for our test cases.
758 * elf32-nds32.c (nds32_elf_merge_private_bfd_data): Allow to link the
759 generic object.
760 * reloc.c: Add TLS relocations.
761 * libbfd.h: Regenerated.
762 * bfd-in2.h: Regenerated.
763 * elf32-nds32.h (struct section_id_list_t): New.
764 (elf32_nds32_lookup_section_id, elf32_nds32_check_relax_group,
765 elf32_nds32_unify_relax_group, nds32_elf_unify_tls_model):
766 New prototypes.
767 (elf32_nds32_compute_jump_table_size, elf32_nds32_local_tlsdesc_gotent):
768 New macro.
769 (nds32_insertion_sort, bfd_elf32_nds32_set_target_option,
770 elf_nds32_link_hash_table): Updated.
771 * elf32-nds32.c (enum elf_nds32_tls_type): New.
772 (struct elf32_nds32_relax_group_t, struct relax_group_list_t): New.
773 (elf32_nds32_add_dynreloc, patch_tls_desc_to_ie, get_tls_type,
774 fls, ones32, list_insert, list_insert_sibling, dump_chain,
775 elf32_nds32_check_relax_group, elf32_nds32_lookup_section_id,
776 elf32_nds32_unify_relax_group, nds32_elf_unify_tls_model): New functions.
777 (elf_nds32_obj_tdata): Add new fields.
778 (elf32_nds32_relax_group_ptr, nds32_elf_local_tlsdesc_gotent): New macros.
779 (nds32_elf_howto_table): Add TLS relocations.
780 (nds32_reloc_map): Likewise.
781 (nds32_elf_copy_indirect_symbol, nds32_elf_size_dynamic_sections,
782 nds32_elf_finish_dynamic_symbol, elf32_nds32_allocate_local_sym_info,
783 nds32_elf_relocate_section, bfd_elf32_nds32_set_target_option,
784 nds32_elf_check_relocs, allocate_dynrelocs): Updated.
785 (nds32_elf_relax_section): Call nds32_elf_unify_tls_model.
786 (dtpoff_base): Rename it to `gottpof' and then update it.
787
788 2018-09-20 Alan Modra <amodra@gmail.com>
789
790 PR 23685
791 * peXXigen.c (pe_print_edata): Correct export address table
792 overflow checks. Check dataoff against section size too.
793
794 2018-09-20 Alan Modra <amodra@gmail.com>
795
796 PR 23686
797 * dwarf2.c (read_section): Error when attempting to malloc
798 "(bfd_size_type) -1".
799 * syms.c (_bfd_stab_section_find_nearest_line): Bounds check
800 function_name. Bounds check reloc address. Formatting. Ensure
801 .stabstr zero terminated.
802
803 2018-09-18 Nick Clifton <nickc@redhat.com>
804
805 PR 23657
806 * elfcode.h (elf_swap_shdr_in): Generate a warning message if an
807 ELF section has contents and size larger than the file size.
808
809 2018-09-14 Maciej W. Rozycki <macro@mips.com>
810
811 PR ld/21375
812 * elfxx-mips.h (_bfd_mips_elf_hide_symbol): New prototype.
813 (_bfd_mips_elf_linker_flags): Update prototype.
814 * elf32-mips.c (elf_backend_hide_symbol): New macro.
815 * elf64-mips.c (elf_backend_hide_symbol): Likewise.
816 * elfn32-mips.c (elf_backend_hide_symbol): Likewise.
817 * elfxx-mips.c (mips_elf_link_hash_table): Add
818 `use_absolute_zero' and `gnu_target' members.
819 (mips_elf_record_global_got_symbol): Call
820 `_bfd_mips_elf_hide_symbol' rather than
821 `_bfd_elf_link_hash_hide_symbol'.
822 (mips_use_local_got_p): Return FALSE if the symbol is absolute.
823 (mips_elf_obtain_contents): Reorder function.
824 (mips_elf_nullify_got_load): New function.
825 (mips_elf_calculate_relocation): Add `contents' parameter.
826 Nullify GOT loads or if it is not possible, then redirect GOT
827 relocations to the `__gnu_absolute_zero' symbol, for references
828 that are supposed to resolve to zero.
829 (mips_elf_define_absolute_zero): New function.
830 (_bfd_mips_elf_check_relocs): Prepare for arrangements made in
831 `mips_elf_calculate_relocation' for references made via the GOT
832 that are supposed to resolve to zero.
833 (_bfd_mips_elf_hide_symbol): New function.
834 (_bfd_mips_elf_linker_flags): Add the `gnu_target' parameter,
835 set the `gnu_target' member of the MIPS hash table.
836 (MIPS_LIBC_ABI_ABSOLUTE): New enumeration constant.
837 (_bfd_mips_post_process_headers): Use it.
838
839 2018-09-14 Maciej W. Rozycki <macro@mips.com>
840
841 * elfxx-mips.c (mips_elf_store_contents): New function...
842 (mips_elf_perform_relocation): ... factored out from here.
843
844 2018-09-14 Lifang Xia <lifang_xia@c-sky.com>
845
846 * elf32-csky.c (csky_elf_howto_table): Fill special_function of
847 R_CKCORE_PCREL32.
848 (csky_elf_relocate_section): Add R_CKCORE_PCREL32 process.
849
850 2018-09-14 Alan Modra <amodra@gmail.com>
851
852 PR 23425
853 * reloc.c (bfd_generic_get_relocated_section_contents): Zero reloc
854 fields in debug sections when reloc is against an undefined symbol
855 and called from bfd_simple_get_relocated_section_contents or
856 similar.
857 * dwarf2.c (find_abstract_instance): Return true for zero offset
858 DW_FORM_ref_addr without returning values.
859
860 2018-09-06 Alan Modra <amodra@gmail.com>
861
862 PR 23570
863 * elf32-avr.c (elf_avr_special_sections): New.
864 (elf_backend_special_sections): Define.
865
866 2018-09-04 Jose E. Marchesi <jose.marchesi@oracle.com>
867
868 * elfxx-sparc.c (_bfd_sparc_elf_info_to_howto): Do not issue an
869 error when an invalid relocation is passed; this is already done
870 by `_bfd_sparc_elf_info_to_howto_ptr'.
871
872 2018-09-04 Jose E. Marchesi <jose.marchesi@oracle.com>
873
874 * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Issue an
875 error when an invalid symbol index is retrieved in ELF64_R_SYM of
876 a relocation seen in an input file.
877
878 2018-09-03 Jozef Lawrynowicz <jozef.l@mittosystems.com>
879 Alan Modra <amodra@gmail.com>
880
881 PR 23595
882 elf.c (copy_elf_program_header): When first segment contains
883 only the headers and SHT_NOBITS sections, use segment p_filesz
884 to calculate header and padding size. Use filepos of the first
885 section otherwise.
886
887 2018-08-31 H.J. Lu <hongjiu.lu@intel.com>
888
889 PR ld/23600
890 * archures.c (bfd_arch_get_compatible): Allow an IR object with
891 unknown architecture.
892
893 2018-08-31 Alan Modra <amodra@gmail.com>
894
895 * elf64-ppc.c (num_relocs_for_offset): New function.
896 (emit_relocs_for_offset): New function.
897 (use_global_in_relocs): New function, split out from..
898 (ppc_build_one_stub): ..here. Output relocations for notoc stubs.
899 (ppc_size_one_stub): Calculate reloc count for notoc stubs.
900 (ppc64_elf_size_stubs): Don't count undefined syms in stub_globals.
901
902 2018-08-31 Alan Modra <amodra@gmail.com>
903
904 * reloc.c (BFD_RELOC_PPC64_REL16_HIGH, BFD_RELOC_PPC64_REL16_HIGHA),
905 (BFD_RELOC_PPC64_REL16_HIGHER, BFD_RELOC_PPC64_REL16_HIGHERA),
906 (BFD_RELOC_PPC64_REL16_HIGHEST, BFD_RELOC_PPC64_REL16_HIGHESTA):
907 Define.
908 * elf64-ppc.c (ppc64_elf_howto_raw): Add new REL16 howtos.
909 (ppc64_elf_reloc_type_lookup): Translate new REL16 relocs.
910 (ppc64_elf_check_relocs, ppc64_elf_relocate_section): Handle them.
911 * bfd-in2.h: Regenerate.
912 * libbfd.h: Regenerate.
913
914 2018-08-31 Alan Modra <amodra@gmail.com>
915
916 * elf64-ppc.c: Correct _notoc stub comments.
917 (ppc_build_one_stub): Simplify output of branch for notoc
918 long branch stub. Don't include label offset of 8 bytes in
919 "off" calculation for notoc plt stub. Don't emit insns to get pc.
920 (build_offset): Emit insns to get pc here instead.
921 (size_offset): Add 4 extra insns.
922 (plt_stub_size): Adjust for "off" and size_offset changes.
923 (ppc_size_one_stub): Rearrange code into a switch, duplicating
924 some to better match ppc_build_one_stub.
925
926 2018-08-29 Chenghua Xu <paul.hua.gm@gmail.com>
927
928 * archures.c (bfd_architecture): New machine
929 bfd_mach_mips_gs264e.
930 * bfd-in2.h (bfd_architecture): Likewise.
931 * cpu-mips.c (enum I_xxx): Likewise.
932 (arch_info_struct): Likewise.
933 * elfxx-mips.c (_bfd_elf_mips_mach): Handle
934 E_MIPS_MACH_GS264E.
935 (mips_set_isa_flags): Likewise.
936 (mips_mach_extensions): Map bfd_mach_mips_gs264e to
937 bfd_mach_mips_gs464e extension.
938
939 2018-08-29 Chenghua Xu <paul.hua.gm@gmail.com>
940
941 * archures.c (bfd_architecture): New machine
942 bfd_mach_mips_gs464e.
943 * bfd-in2.h (bfd_architecture): Likewise.
944 * cpu-mips.c (enum I_xxx): Likewise.
945 (arch_info_struct): Likewise.
946 * elfxx-mips.c (_bfd_elf_mips_mach): Handle
947 E_MIPS_MACH_GS464E.
948 (mips_set_isa_flags): Likewise.
949 (mips_mach_extensions): Map bfd_mach_mips_gs464e to
950 bfd_mach_mips_gs464 extension.
951
952 2018-08-29 Chenghua Xu <paul.hua.gm@gmail.com>
953
954 * archures.c (bfd_architecture): Rename
955 bfd_mach_mips_loongson_3a to bfd_mach_mips_gs464.
956 * bfd-in2.h (bfd_architecture): Likewise.
957 * cpu-mips.c (enum I_xxx): Likewise.
958 (arch_info_struct): Likewise.
959 * elfxx-mips.c (_bfd_elf_mips_mach): Likewise.
960 (mips_set_isa_flags): Likewise.
961 (mips_mach_extensions): Likewise.
962 (bfd_mips_isa_ext_mach): Likewise.
963 (bfd_mips_isa_ext): Likewise.
964 (print_mips_isa_ext): Delete AFL_EXT_LOONGSON_3A.
965
966 2018-08-29 Chenghua Xu <paul.hua.gm@gmail.com>
967
968 * elfxx-mips.c (print_mips_ases): Add Loongson EXT2 extension.
969
970 2018-08-29 Chenghua Xu <paul.hua.gm@gmail.com>
971
972 * elfxx-mips.c (infer_mips_abiflags): Use ases instead of
973 isa_ext for infer ABI flags.
974 (print_mips_ases): Add Loongson EXT extension.
975
976 2018-08-29 Chenghua Xu <paul.hua.gm@gmail.com>
977
978 * elfxx-mips.c (print_mips_ases): Add CAM extension.
979
980 2018-08-27 H.J. Lu <hongjiu.lu@intel.com>
981
982 * elfxx-x86.c (_bfd_x86_elf_parse_gnu_properties): Don't mask
983 out the GNU_PROPERTY_X86_UINT32_VALID bit.
984
985 2018-08-25 H.J. Lu <hongjiu.lu@intel.com>
986
987 PR ld/23499
988 * elf.c (_bfd_elf_get_symbol_version_string): Return
989 _("<corrupt>") for corrupt symbol version info.
990
991 2018-08-24 H.J. Lu <hongjiu.lu@intel.com>
992
993 * elfxx-x86.c (_bfd_x86_elf_parse_gnu_properties): Handle
994 X86_COMPAT_ISA_1_USED, X86_COMPAT_ISA_1_NEEDED,
995 X86_UINT32_AND_LO, X86_UINT32_AND_HI, X86_UINT32_OR_LO,
996 X86_UINT32_OR_HI, X86_UINT32_OR_AND_LO and X86_UINT32_OR_AND_HI
997 instead of X86_ISA_1_USED, X86_ISA_1_NEEDED and X86_FEATURE_1_AND.
998 (_bfd_x86_elf_merge_gnu_properties): Likewise.
999 (_bfd_x86_elf_link_setup_gnu_properties): Add X86_FEATURE_2_NEEDED
1000 instead of X86_ISA_1_NEEDED.
1001 (_bfd_x86_elf_link_fixup_gnu_properties): Handle
1002 X86_COMPAT_ISA_1_USED, X86_COMPAT_ISA_1_NEEDED, X86_UINT32_AND_LO,
1003 X86_UINT32_AND_HI, X86_UINT32_OR_LO, X86_UINT32_OR_HI,
1004 X86_UINT32_OR_AND_LO and X86_UINT32_OR_AND_HI instead of
1005 X86_ISA_1_USED, X86_ISA_1_NEEDED and X86_FEATURE_1_AND.
1006
1007 2018-08-24 H.J. Lu <hongjiu.lu@intel.com>
1008
1009 * elfxx-x86.c (_bfd_x86_elf_parse_gnu_properties): Mask out the
1010 GNU_PROPERTY_X86_UINT32_VALID bit.
1011 (_bfd_x86_elf_link_fixup_gnu_properties): Set the
1012 GNU_PROPERTY_X86_UINT32_VALID bit for non-relocatable output.
1013
1014 2018-08-23 Zenith423 <zenith432@users.sourceforge.net>
1015
1016 PR 23460
1017 * plugin.c (struct plugin_list_entry): New structure.
1018 (plugin_list): New variable.
1019 (try_load_plugin): Place opened plugins on a list. Ensure that
1020 the refcount in the dynamic loader is kept at 1.
1021
1022 2018-08-23 Alan Modra <amodra@gmail.com>
1023
1024 * elf64-ppc.c (ppc64_elf_relocate_section): Revise "call lacks
1025 nop" error message.
1026
1027 2018-08-23 Nick Clifton <nickc@redhat.com>
1028
1029 * elf64-hppa.c (elf_hppa_final_link_relocate): Replace unworkable
1030 code with an assertion.
1031
1032 2018-08-23 Nick Clifton <nickc@redhat.com>
1033
1034 PR 23061
1035 * coffgen.c (coff_pointerize_aux): Add table_end parameter. Use
1036 it to prevent walking off the end of the table.
1037 (coff_get_normalized_symtab): Pass internal_end pointer to
1038 coff_pointerize_aux.
1039
1040 2018-08-23 Alan Modra <amodra@gmail.com>
1041
1042 * elf64-ppc.c (ppc64_elf_relocate_section): Don't miss clearing
1043 unresolved_reloc on ppc_stub_plt_call_notoc.
1044
1045 2018-08-22 H.J. Lu <hongjiu.lu@intel.com>
1046
1047 PR ld/23536
1048 * development.sh (experimental): New.
1049
1050 2018-08-22 Helge Deller <deller@gmx.de>
1051 Nick Clifton <nickc@redhat.com>
1052
1053 * elf-hppa.h (elf_hppa_fake_sections): Use SHT_PARISC_UNWIND as
1054 the section type of the .PARISC.unwind section on 64-bit binaries
1055 and SHT_PROGBITS for 32-bit binaries. Add a comment about it.
1056 Add comment about the sh_entsize value.
1057
1058 2018-08-22 Rafeal Auler <rafaelauler@gmail.com>
1059
1060 PR 23560
1061 * elfnn-aarch64.c (elfNN_aarch64_size_stubs): Always update the
1062 stub's target, since it may have been changed after the layout.
1063
1064 2018-08-21 John Darington <john@darrington.wattle.id.au>
1065
1066 * elf32-s12z.c (opru18_reloc): New function.
1067 (elf_s12z_howto_table): Adjust Howto according to new knowledge.
1068
1069 2018-08-21 mephi42 <mephi42@gmail.com>
1070
1071 PR binutils/23315
1072 * mach-o.c (bfd_mach_o_mangle_symbols): Update n_type even if
1073 data is already considered filled.
1074
1075 2018-08-21 Alan Modra <amodra@gmail.com>
1076
1077 * elf64-ppc.c (HOW): Define.
1078 (ONES): Delete.
1079 (ppc64_elf_howto_raw): Use HOW to initialize entries.
1080 * elf32-ppc.c (HOW): Define.
1081 (ppc_elf_howto_raw): Use HOW to initialize entries, updating
1082 R_PPC_VLE_REL15 and R_PPC_VLE_REL24 to use bitpos=0.
1083
1084 2018-08-21 Alan Modra <amodra@gmail.com>
1085
1086 * reloc.c (reloc_howto_type): Typedef.
1087 (bfd_symbol): Delete forward declaration.
1088 (struct reloc_howto_struct): Add "negate" field. Make "size",
1089 "bitsize", "rightshift", "bitpos", "complain_on_overflow",
1090 "pc_relative", "partial_inplace", and "pcrel_offset" bitfields.
1091 Rearrange for better packing. Revise comments.
1092 (HOWTO): Map to rearranged reloc_howto_struct.
1093 (bfd_get_reloc_size): Delete now unused cases.
1094 (read_reloc, write_reloc): Likewise.
1095 (apply_reloc, _bfd_relocate_contents): Test howto->negate
1096 rather than howto->size < 0 for negated relocation values.
1097 * coff-rs6000.c (xcoff_complain_overflow_bitfield_func): Avoid
1098 signed/unsigned warning.
1099 (xcoff_ppc_relocate_section): Delete "condition is always false"
1100 code.
1101 * coff64-rs6000.c (xcoff64_ppc_relocate_section): Likewise.
1102 * cpu-ns32k.c (do_ns32k_reloc): Adjust to suit reloc_howto_struct
1103 changes.
1104 * vms-alpha.c (_bfd_vms_write_etir, alpha_vms_slurp_relocs): Use
1105 size 16 for ALPHA_R_LINKAGE.
1106 (alpha_howto_table <ALPHA_R_LINKAGE>): Set encoded size and
1107 bitsize to zero.
1108 * bfd-in.h (reloc_howto_type): Delete.
1109 * bfd-in2.h: Regenerate.
1110
1111 2018-08-21 Alan Modra <amodra@gmail.com>
1112
1113 * reloc.c (HOWTO): Revise comment.
1114 (NEWHOWTO, HOWTO_PREPARE): Delete.
1115 * coff-arm.c (coff_arm_reloc_type_lookup): Replace const struc
1116 reloc_howto_struct with reloc_howto_type.
1117 * ns32knetbsd.c (MY_bfd_reloc_type_lookup): Likewise.
1118 * vms-alpha.c (alpha_vms_bfd_reloc_type_lookup): Likewise.
1119 * elf-hppa.h (HOW): Define.
1120 (elf_hppa_howto_table): Use it to simplify this table, correcting
1121 name of R_PARISC_LTOFF16WF, R_PARISC_LTOFF_FPTR64, and
1122 R_PARISC_LTOFF_FPTR16DF.
1123 * elf32-mep.c (MEPREL): Use HOWTO.
1124 * bfd-in2.h: Regenerate.
1125
1126 2018-08-20 Alan Modra <amodra@gmail.com>
1127
1128 * mmo.c (valid_mmo_symbol_character_set): Initialize and make
1129 array const.
1130 (mmo_init): Don't init valid_mmo_symbol_character_set.
1131
1132 2018-08-20 Alan Modra <amodra@gmail.com>
1133
1134 * rs6000-core.c (CORE_COMMONSZ): Balance parentheses in expression.
1135
1136 2018-08-17 H.J. Lu <hongjiu.lu@intel.com>
1137
1138 PR ld/23515
1139 * elf-bfd.h (elf_backend_data): Add fixup_gnu_properties.
1140 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Call
1141 backend fixup_gnu_properties if it isn't NULL. Discard
1142 .note.gnu.property section if all properties have been removed.
1143 * elfxx-target.h (elf_backend_fixup_gnu_properties): New.
1144 (elfNN_bed): Initialize fixup_gnu_properties.
1145 * elfxx-x86.c (_bfd_x86_elf_link_fixup_gnu_properties): New
1146 function.
1147 * elfxx-x86.h (_bfd_x86_elf_link_fixup_gnu_properties): New
1148 prototype.
1149 (elf_backend_fixup_gnu_properties): New.
1150
1151 2018-08-16 Alan Modra <amodra@gmail.com>
1152
1153 * elf64-ppc.c: Correct ppc_stub_long_branch_notoc example.
1154 Formatting.
1155
1156 2018-08-12 H.J. Lu <hongjiu.lu@intel.com>
1157
1158 PR binutils/23494
1159 * Makefile.am (BFD32_LIBS): Add elf-properties.lo.
1160 (BFD32_LIBS_CFILES): Add elf-properties.c.
1161 (BFD32_BACKENDS): Remove elf-properties.lo.
1162 (BFD32_BACKENDS_CFILES): Remove elf-properties.c.
1163 * configure.ac (elf): Remove elf-properties.lo.
1164 * Makefile.in: Regenerated.
1165 * configure: Likewise.
1166
1167 2018-08-11 H.J. Lu <hongjiu.lu@intel.com>
1168
1169 PR ld/23428
1170 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Don't
1171 add X86_ISA_1_NEEDED property only if existing properties won't
1172 be removed.
1173
1174 2018-08-11 Alan Modra <amodra@gmail.com>
1175
1176 * reloc.c (bfd_get_reloc_size): Sort switch.
1177 (read_reloc, write_reloc, apply_reloc): New functions.
1178 (bfd_perform_relocation, bfd_install_relocation): Use apply_reloc.
1179 (_bfd_relocate_contents): Use read_reloc and write_reloc.
1180 (_bfd_clear_contents): Likewise.
1181
1182 2018-08-11 John Darrington <john@darrington.wattle.id.au>
1183
1184 * reloc.c (_bfd_relocate_contents): Handle 3 byte relocs.
1185 (_bfd_clear_contents): Likewise.
1186 (bfd_perform_relocation): Likewise.
1187 (bfd_install_relocation): Likewise.
1188
1189 2018-08-10 H.J. Lu <hongjiu.lu@intel.com>
1190
1191 PR ld/23499
1192 * elflink.c (bfd_elf_record_link_assignment): Always clear
1193 h->verinfo.verdef when overriding a dynamic definition.
1194
1195 2018-08-10 H.J. Lu <hongjiu.lu@intel.com>
1196
1197 PR binutils/23494
1198 * elf-properties.c (elf_get_gnu_property_section_size): Always
1199 use align_size as pr_datasz for GNU_PROPERTY_STACK_SIZE.
1200 (elf_write_gnu_properties): Likewise.
1201
1202 2018-08-08 H.J. Lu <hongjiu.lu@intel.com>
1203
1204 PR binutils/23494
1205 * bfd.c (bfd_convert_section_size): Check BFD_DECOMPRESS after
1206 calling _bfd_elf_convert_gnu_property_size to convert
1207 .note.gnu.property section size.
1208 (bfd_convert_section_contents): Check BFD_DECOMPRESS after
1209 calling _bfd_elf_convert_gnu_properties to convert
1210 .note.gnu.property section.
1211 * elf-bfd.h (_bfd_elf_convert_gnu_property_size): New prototype.
1212 (_bfd_elf_convert_gnu_properties): Likewise.
1213 * elf-properties.c (elf_get_gnu_property_section_size): New
1214 function.
1215 (elf_write_gnu_properties): Likewise.
1216 (_bfd_elf_convert_gnu_property_size): Likewise.
1217 (_bfd_elf_convert_gnu_properties): Likewise.
1218 (_bfd_elf_link_setup_gnu_properties): Use
1219 elf_get_gnu_property_section_size and elf_write_gnu_properties.
1220
1221 2018-08-08 H.J. Lu <hongjiu.lu@intel.com>
1222
1223 PR ld/23486
1224 * elfxx-x86.c (_bfd_x86_elf_merge_gnu_properties): Remove
1225 GNU_PROPERTY_X86_ISA_1_USED if an input file doesn't have it.
1226 (_bfd_x86_elf_link_setup_gnu_properties): Adding the
1227 GNU_PROPERTY_X86_ISA_1_NEEDED, instead of
1228 GNU_PROPERTY_X86_ISA_1_USED, property.
1229
1230 2018-08-07 Alan Modra <amodra@gmail.com>
1231
1232 * elf64-ppc.c (struct map_stub): Delete tls_get_addr_opt_bctrl.
1233 Add lr_restore, eh_size and eh_base.
1234 (eh_advance, eh_advance_size): New functions.
1235 (build_tls_get_addr_stub): Emit EH info for stub.
1236 (ppc_build_one_stub): Likewise for _notoc stubs.
1237 (ppc_size_one_stub): Size EH info for stub.
1238 (group_sections): Init new map_stub fields.
1239 (stub_eh_frame_size): Delete.
1240 (ppc64_elf_size_stubs): Size EH info for stubs. Set up dummy EH
1241 program for stubs.
1242 (ppc64_elf_build_stubs): Reinit new map_stub fields. Set FDE
1243 offset to stub section here..
1244 (ppc64_elf_finish_dynamic_sections): ..rather than here.
1245
1246 2018-08-07 Alan Modra <amodra@gmail.com>
1247
1248 * elf64-ppc.c (ppc64_elf_relocate_section): Don't skip first
1249 instruction of __tls_get_addr_opt stub.
1250 (plt_stub_size): Omit ALWAYS_EMIT_R2SAVE condition when
1251 dealing with __tls_get_addr_opt stub.
1252 (build_tls_get_addr_stub, ppc_size_one_stub): Likewise.
1253
1254 2018-08-06 Claudiu Zissulescu <claziss@synopsys.com>
1255
1256 * elf32-arc.c (arc_elf_merge_private_bfd_data): Complain about
1257 efalgs only when in/out exists.
1258 (elf32_arc_section_from_shdr): Don't complain about 0x0c
1259 section type. It is mwdt compiler specific.
1260
1261 2018-08-06 Claudiu Zissulescu <claziss@synopsys.com>
1262
1263 * elf32-arc.c (arc_elf_merge_attributes): Fix merge attributes.
1264
1265 2018-08-06 Claudiu Zissulescu <claziss@synopsys.com>
1266
1267 * elf32-arc.c (arc_elf_merge_attributes): Handle
1268 Tag_ARC_ATR_version.
1269
1270 2018-08-05 Alan Modra <amodra@gmail.com>
1271
1272 * elf64-ppc.c (ADDI_R12_R11, ADDI_R12_R12, LIS_R12),
1273 (ADDIS_R12_R11, ORIS_R12_R12_0, ORI_R12_R12_0),
1274 (SLDI_R12_R12_32, LDX_R12_R11_R12, ADD_R12_R11_R12): Define.
1275 (ppc64_elf_howto_raw): Add R_PPC64_REL24_NOTOC entry.
1276 (ppc64_elf_reloc_type_lookup): Support R_PPC64_REL24_NOTOC.
1277 (ppc_stub_type): Add ppc_stub_long_branch_notoc,
1278 ppc_stub_long_branch_both, ppc_stub_plt_branch_notoc,
1279 ppc_stub_plt_branch_both, ppc_stub_plt_call_notoc, and
1280 ppc_stub_plt_call_both.
1281 (is_branch_reloc): Add R_PPC64_REL24_NOTOC.
1282 (build_offset, size_offset): New functions.
1283 (plt_stub_size): Support plt_call_notoc and plt_call_both.
1284 (ppc_build_one_stub, ppc_size_one_stub): Support new stubs.
1285 (toc_adjusting_stub_needed): Handle R_PPC64_REL24_NOTOC.
1286 (ppc64_elf_size_stubs): Likewise, and new stubs.
1287 (ppc64_elf_build_stubs, ppc64_elf_relocate_section): Likewise.
1288 * reloc.c: Add BFD_RELOC_PPC64_REL24_NOTOC.
1289 * bfd-in2.h: Regenerate.
1290 * libbfd.h: Regenerate.
1291
1292 2018-08-05 Alan Modra <amodra@gmail.com>
1293
1294 * elf64-ppc.c (ppc_build_one_stub): Lose "_r2off" in stub symbols.
1295
1296 2018-08-02 Jim Wilson <jimw@sifive.com>
1297
1298 * elfnn-riscv.c (riscv_elf_create_dynamic_sections): For .tdata.dyn,
1299 add SEC_LINKER_CREATED flag.
1300
1301 2018-08-01 Nick Clifton <nickc@redhat.com>
1302
1303 * coff-rs6000.c (_bfd_xcoff_put_ldsymbol_name): Suppress warnings
1304 about potentially truncated strncpy operations.
1305 (_bfd_xcoff_put_symbol_name): Likewise.
1306
1307 * elf32-avr.c (avr_stub_name): Check for a NULL return from
1308 bfd_malloc.
1309
1310 2018-08-01 Zenith <zenith432@users.sourceforge.net>
1311
1312 PR 23460
1313 * plugin.c (bfd_plugin_open_input): Close file descriptor if the
1314 call to fstat fails.
1315 (try_claim): Always close the file descriptor at the end of the
1316 function.
1317 (try_load_plugin): If a plugin has already been registered, then
1318 skip the dlopen and onload steps and go straight to claiming the
1319 file. If these is an error, close the plugin.
1320
1321 2018-08-01 Alan Modra <amodra@gmail.com>
1322
1323 * elf64-ppc.c (plt_stub_pad): Delay plt_stub_size call until needed.
1324 (ppc_build_one_stub): Don't set stub_offset, instead assert that
1325 it is sane. Don't adjust stub_offset for alignment. Adjust size
1326 calculation. Use "targ" temp when calculating offsets.
1327 (ppc_size_one_stub): Set stub_offset here. Use "targ" temp when
1328 calculating offsets. Adjust for alignment before setting
1329 tls_get_addr_opt_bctrl.
1330
1331 2018-08-01 Alan Modra <amodra@gmail.com>
1332
1333 * po/SRC-POTFILES.in: Regenerate.
1334
1335 2018-07-30 Nick Clifton <nickc@redhat.com>
1336
1337 PR 22706
1338 * elf32-sh.c (sh_elf_relocate_section): When processing
1339 translation relocs, fail if the relocation offset is too small.
1340 Replace BFD_ASSERTs with more helpful error messages.
1341
1342 2018-07-30 Andrew Jenner <andrew@codesourcery.com>
1343
1344 * Makefile.am (ALL_MACHINES, ALL_MACHINES_CFILES): Add C-SKY.
1345 (BFD32_BACKENDS, BFD_BACKENDS_CFILES): Likewise.
1346 * Makefile.in: Regenerated.
1347 * archures.c (enum bfd_architecture): Add bfd_arch_csky and
1348 related bfd_mach defines.
1349 (bfd_csky_arch): Declare.
1350 (bfd_archures_list): Add C-SKY.
1351 * bfd-in.h (elf32_csky_build_stubs): Declare.
1352 (elf32_csky_size_stubs): Declare.
1353 (elf32_csky_next_input_section: Declare.
1354 (elf32_csky_setup_section_lists): Declare.
1355 * bfd-in2.h: Regenerated.
1356 * config.bfd: Add C-SKY.
1357 * configure.ac: Likewise.
1358 * configure: Regenerated.
1359 * cpu-csky.c: New file.
1360 * elf-bfd.h (enum elf_target_id): Add C-SKY.
1361 * elf32-csky.c: New file.
1362 * libbfd.h: Regenerated.
1363 * reloc.c: Add C-SKY relocations.
1364 * targets.c (csky_elf32_be_vec, csky_elf32_le_vec): Declare.
1365 (_bfd_target_vector): Add C-SKY target vector entries.
1366
1367 2018-07-27 John Darrington <john@darrington.wattle.id.au>
1368
1369 * elf32-s12z.c (ELF_TARGET_ID): Don't define.
1370
1371 2018-07-27 John Darrington <john@darrington.wattle.id.au>
1372
1373 * libbfd.c (bfd_getb24, bfd_getl24): New functions.
1374 (bfd_get_24, bfd_put_24): New macros.
1375 * bfd-in2.h: Regenerate.
1376
1377 2018-07-27 John Darrington <john@darrington.wattle.id.au>
1378
1379 * elf32-s12z.c (s12z_elf_set_mach_from_flags): Remove comment.
1380
1381 2018-07-26 Alan Modra <amodra@gmail.com>
1382
1383 * elf64-ppc.c (ppc64_elf_size_stubs): Use a ppc_stub_long_branch_r2off
1384 for calls to symbols with STO_PPC64_LOCAL_MASK bits set to 1.
1385
1386 2018-07-25 Alan Modra <amodra@gmail.com>
1387
1388 * elf32-ppc.c (ppc_elf_relax_section): Ignore common or undef locals.
1389 Avoid trashing toff with added when used as a symbol index.
1390 Ignore R_PPC_PLTREL24 addends in unused example code. Avoid
1391 creating unnecessary fixups when relocatable.
1392
1393 2018-07-25 Alan Modra <amodra@gmail.com>
1394
1395 * elf32-arm.c (elf32_arm_nabi_write_core_note): Disable
1396 -Wstringop-truncation warning for gcc-8.0 too.
1397 * elf32-ppc.c (ppc_elf_write_core_note): Likewise.
1398 * elf64-ppc.c (ppc64_elf_write_core_note): Likewise.
1399 * elfxx-aarch64.c (_bfd_aarch64_elf_write_core_note): Likewise.
1400 * elf32-s390.c (elf_s390_write_core_note): Comment fix.
1401 * elf64-s390.c (elf_s390_write_core_note): Likewise.
1402
1403 2018-07-24 Alan Modra <amodra@gmail.com>
1404
1405 PR 23430
1406 * dwarf2.c (dwarf_debug_section_enum): Fix comment typo.
1407 * elf.c (bfd_section_from_shdr, elf_sort_sections): Likewise.
1408
1409 2018-07-23 Max Filippov <jcmvbkbc@gmail.com>
1410
1411 * elf32-xtensa.c (elf_xtensa_finish_dynamic_sections): Move
1412 relocation sections consistency check to always check both
1413 .rela.dyn and .rela.plt when they exist. Rearrange variable
1414 definition and assignment places.
1415
1416 2018-07-23 Max Filippov <jcmvbkbc@gmail.com>
1417
1418 * elf32-xtensa.c (shrink_dynamic_reloc_sections): Shrink dynamic
1419 relocations section for dynamic undefined weak symbols when
1420 linking a shared object.
1421
1422 2018-07-23 Tom Tromey <tom@tromey.com>
1423
1424 * elf.c (bfd_get_elf_phdrs): Don't call memcpy with size 0.
1425
1426 2018-07-21 Eric Botcazou <ebotcazou@adacore.com>
1427
1428 * elf32-arm.c (elf32_arm_final_link_relocate) <R_ARM_GOT32>: Small
1429 cleanup for the case of a global symbol that binds locally. Also
1430 install a value in the GOT slot in the case of a local symbol in
1431 a non-PIC link.
1432
1433 2018-07-20 H.J. Lu <hongjiu.lu@intel.com>
1434
1435 PR ld/23428
1436 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): If the
1437 separate code program header is needed, make sure that the first
1438 read-only PT_LOAD segment has no code by adding a
1439 GNU_PROPERTY_X86_ISA_1_USED note.
1440
1441 2018-07-20 Chenghua Xu <paul.hua.gm@gmail.com>
1442 Maciej W. Rozycki <macro@mips.com>
1443
1444 * elfxx-mips.c (print_mips_ases): Add MMI extension.
1445
1446 2018-07-20 Maciej W. Rozycki <macro@mips.com>
1447
1448 * elfxx-mips.c (_bfd_mips_elf_size_dynamic_sections): Do not
1449 create DT_REL, DT_RELSZ or DT_RELENT dynamic entries if the
1450 dynamic relocation section will be discarded from output.
1451 (_bfd_mips_elf_finish_dynamic_sections) <DT_RELSZ>: Assert that
1452 the dynamic relocation section will be retained in output.
1453
1454 2018-07-18 Maciej W. Rozycki <macro@mips.com>
1455
1456 * xcofflink.c (xcoff_write_global_symbol): Fix symbol type
1457 checks for defined weak symbols.
1458
1459 2018-07-17 Maciej W. Rozycki <macro@mips.com>
1460
1461 * elf32-nds32.c (nds32_elf_relax_loadstore): Use
1462 `bfd_is_abs_symbol' rather than `bfd_is_abs_section' in checking
1463 whether the symbol is absolute.
1464 (nds32_elf_relax_lo12): Likewise.
1465 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Likewise.
1466 (elfNN_aarch64_check_relocs): Likewise.
1467 * xcofflink.c (xcoff_need_ldrel_p): Likewise.
1468 (bfd_xcoff_import_symbol): Likewise.
1469 (xcoff_write_global_symbol): Likewise.
1470
1471 2018-07-17 Maciej W. Rozycki <macro@mips.com>
1472
1473 * linker.c (bfd_is_abs_symbol): New macro.
1474 * bfd-in2.h: Regenerate.
1475
1476 2018-07-16 Edjunior Barbosa Machado <emachado@linux.vnet.ibm.com>
1477
1478 * elf-bfd.h (elfcore_write_ppc_tar): Add prototype.
1479 (elfcore_write_ppc_ppr): Likewise.
1480 (elfcore_write_ppc_dscr): Likewise.
1481 (elfcore_write_ppc_ebb): Likewise.
1482 (elfcore_write_ppc_pmu): Likewise.
1483 (elfcore_write_ppc_tm_cgpr): Likewise.
1484 (elfcore_write_ppc_tm_cfpr): Likewise.
1485 (elfcore_write_ppc_tm_cvmx): Likewise.
1486 (elfcore_write_ppc_tm_cvsx): Likewise.
1487 (elfcore_write_ppc_tm_spr): Likewise.
1488 (elfcore_write_ppc_tm_ctar): Likewise.
1489 (elfcore_write_ppc_tm_cppr): Likewise.
1490 (elfcore_write_ppc_tm_cdscr): Likewise.
1491 * elf.c (elfcore_write_ppc_tar): New function.
1492 (elfcore_write_ppc_ppr): Likewise.
1493 (elfcore_write_ppc_dscr): Likewise.
1494 (elfcore_write_ppc_ebb): Likewise.
1495 (elfcore_write_ppc_pmu): Likewise.
1496 (elfcore_write_ppc_tm_cgpr): Likewise.
1497 (elfcore_write_ppc_tm_cfpr): Likewise.
1498 (elfcore_write_ppc_tm_cvmx): Likewise.
1499 (elfcore_write_ppc_tm_cvsx): Likewise.
1500 (elfcore_write_ppc_tm_spr): Likewise.
1501 (elfcore_write_ppc_tm_ctar): Likewise.
1502 (elfcore_write_ppc_tm_cppr): Likewise.
1503 (elfcore_write_ppc_tm_cdscr): Likewise.
1504 (elfcore_write_register_note): Call them.
1505 (elfcore_grok_ppc_tar): New function.
1506 (elfcore_grok_ppc_ppr): Likewise.
1507 (elfcore_grok_ppc_dscr): Likewise.
1508 (elfcore_grok_ppc_ebb): Likewise.
1509 (elfcore_grok_ppc_pmu): Likewise.
1510 (elfcore_grok_ppc_tm_cgpr): Likewise.
1511 (elfcore_grok_ppc_tm_cfpr): Likewise.
1512 (elfcore_grok_ppc_tm_cvmx): Likewise.
1513 (elfcore_grok_ppc_tm_cvsx): Likewise.
1514 (elfcore_grok_ppc_tm_spr): Likewise.
1515 (elfcore_grok_ppc_tm_ctar): Likewise.
1516 (elfcore_grok_ppc_tm_cppr): Likewise.
1517 (elfcore_grok_ppc_tm_cdscr): Likewise.
1518 (elfcore_grok_note): Call them.
1519
1520 2018-07-11 Maciej W. Rozycki <macro@mips.com>
1521
1522 * elfxx-mips.c (mips_tls_got_relocs): Use `bfd_link_dll' rather
1523 than `!bfd_link_pic' in determining the dynamic symbol index.
1524 Avoid the index of -1.
1525 (mips_elf_initialize_tls_slots): Likewise. Flatten code by
1526 moving `dyn' to the beginning of the function block.
1527
1528 2018-07-11 Maciej W. Rozycki <macro@mips.com>
1529 Rich Felker <bugdal@aerifal.cx>
1530
1531 PR ld/22570
1532 * elfxx-mips.c (mips_tls_got_relocs): Use `bfd_link_dll' rather
1533 than `bfd_link_pic' to determine whether dynamic relocations are
1534 to be produced.
1535 (mips_elf_initialize_tls_slots): Likewise.
1536
1537 2018-07-10 Maciej W. Rozycki <macro@mips.com>
1538
1539 * elflink.c (bfd_elf_final_link): Rename `remove' local variable
1540 to `remove_section'.
1541
1542 2018-07-10 Alan Modra <amodra@gmail.com>
1543
1544 * elf32-xgate.h: Delete.
1545 * elf32-xgate.c: Delete unnecessary forward declarations, add two
1546 that are now needed.
1547 (xgate_elf_bfd_link_hash_table_create)
1548 (xgate_elf_bfd_link_hash_table_free)
1549 (xgate_elf_set_mach_from_flags, struct xgate_scan_param)
1550 (stub_hash_newfunc, elf32_xgate_add_symbol_hook)
1551 (elf32_xgate_setup_section_lists, elf32_xgate_size_stubs)
1552 (elf32_xgate_build_stubs, elf32_xgate_check_relocs)
1553 (elf32_xgate_relocate_section, _bfd_xgate_elf_set_private_flags)
1554 (elf32_xgate_post_process_headers): Delete.
1555 (elf32_xgate_backend_symbol_processing): New function.
1556 (xgate_elf_ignore_reloc, xgate_elf_special_reloc)
1557 (_bfd_xgate_elf_print_private_bfd_data): Make static.
1558 (ELF_TARGET_ID, elf_info_to_howto, elf_backend_check_relocs)
1559 (elf_backend_relocate_section, elf_backend_object_p)
1560 (elf_backend_final_write_processing, elf_backend_can_gc_sections)
1561 (elf_backend_post_process_headers, elf_backend_add_symbol_hook)
1562 (bfd_elf32_bfd_link_hash_table_create)
1563 (bfd_elf32_bfd_set_private_flags)
1564 (xgate_stub_hash_lookup): Don't define.
1565 (elf_backend_symbol_processing): Define.
1566 * elf-bfd.h (elf_target_id): Delete XGATE_ELF_DATA.
1567
1568 2018-07-09 Maciej W. Rozycki <macro@mips.com>
1569
1570 * elfxx-mips.c (_bfd_mips_elf_adjust_dynamic_symbol): Don't set
1571 `->needs_lazy_stub' if the stubs output section is the absolute
1572 section.
1573
1574 2018-07-09 H.J. Lu <hongjiu.lu@intel.com>
1575
1576 PR ld/23388
1577 * configure.ac: Use changequote for "i[3-7]86-*-linux-*".
1578 * configure: Regenerated.
1579
1580 2018-07-09 Alan Modra <amodra@gmail.com>
1581
1582 * elf32-m68hc1x.c (elf32_m68hc11_post_process_headers): Call
1583 _bfd_elf_post_process_headers.
1584
1585 2018-07-06 Max Filippov <jcmvbkbc@gmail.com>
1586
1587 * elf32-xtensa.c (elf_xtensa_allocate_dynrelocs): Don't allocate
1588 space for dynamic relocation for undefined weak symbol.
1589 (elf_xtensa_relocate_section): Don't emit R_XTENSA_RELATIVE
1590 relocation for undefined weak symbols.
1591 (shrink_dynamic_reloc_sections): Don't shrink dynamic relocation
1592 section for relocations against undefined weak symbols.
1593
1594 2018-07-06 Alan Hayward <alan.hayward@arm.com>
1595
1596 * elf.c (elfcore_grok_aarch_sve): New function.
1597 (elfcore_grok_note): Check for Aarch64 SVE.
1598 (elfcore_write_aarch_sve): New function.
1599 (elfcore_write_register_note): Check for Aarch64 SVE.
1600 * elf-bfd.h(elfcore_grok_aarch_sve): New declaration.
1601
1602 2018-07-06 Alan Modra <amodra@gmail.com>
1603
1604 * elf32-arm.c (elf32_arm_nabi_write_core_note): Don't use
1605 DIAGNOTIC_PUSH and DIAGNOSTIC_POP unconditionally.
1606 * elf32-ppc.c (ppc_elf_write_core_note): Likewise.
1607 * elf32-s390.c (elf_s390_write_core_note): Likewise.
1608 * elf64-ppc.c (ppc64_elf_write_core_note): Likewise.
1609 * elf64-s390.c (elf_s390_write_core_note): Likewise.
1610 * elfxx-aarch64.c (_bfd_aarch64_elf_write_core_note): Likewise.
1611
1612 2018-07-05 Jim Wilson <jimw@sifive.com>
1613
1614 * config.bfd (riscv32*-*-*): Renamed from riscv32-*-*.
1615 (riscv64*-*-*): Likewise.
1616 (riscv-*-*): Add as an alias for riscv32*-*-*.
1617
1618 2018-07-05 H.J. Lu <hongjiu.lu@intel.com>
1619
1620 PR ld/23372
1621 * elfxx-x86.c (_bfd_x86_elf_merge_gnu_properties): Remove x86
1622 ISA properties with empty bits.
1623
1624 2018-07-05 Nick Clifton <nickc@redhat.com>
1625
1626 * po/ru.po: Updated Russian translation.
1627
1628 2018-07-05 Alan Modra <amodra@gmail.com>
1629
1630 * elf-bfd.h (_bfd_elf_ppc_merge_fp_attributes): Update prototype.
1631 * elf32-ppc.c (_bfd_elf_ppc_merge_fp_attributes): Return error
1632 on mismatch. Remove "warning: " from messages. Track last bfd
1633 used to set tags.
1634 (ppc_elf_merge_obj_attributes): Likewise. Handle status from
1635 _bfd_elf_ppc_merge_fp_attributes.
1636 * elf64-ppc.c (ppc64_elf_merge_private_bfd_data): Handle status
1637 from _bfd_elf_ppc_merge_fp_attributes.
1638
1639 2018-07-04 H.J. Lu <hongjiu.lu@intel.com>
1640
1641 * Makefile.am (bfdinclude_HEADERS): Add $(INCDIR)/diagnostics.h.
1642 * Makefile.in: Regenerated.
1643
1644 2018-07-03 Alan Modra <amodra@gmail.com>
1645
1646 * elflink.c (bfd_elf_final_link): Remove zero size .gnu.attributes
1647 sections.
1648
1649 2018-07-03 Alan Modra <amodra@gmail.com>
1650
1651 * elf-bfd.h (ATTR_TYPE_FLAG_ERROR, ATTR_TYPE_HAS_ERROR): Define.
1652 * elf-attrs.c (is_default_attr): Handle ATTR_TYPE_HAS_ERROR.
1653 * elf32-ppc.c (_bfd_elf_ppc_merge_fp_attributes): Use
1654 ATTR_TYPE_FLAG_INT_VAL. Set ATTR_TYPE_HAS_ERROR on finding
1655 incompatible attribute.
1656 (ppc_elf_merge_obj_attributes): Likewise. Return
1657 _bfd_elf_merge_object_attributes result.
1658 * elf64-ppc.c (ppc64_elf_merge_private_bfd_data): Return
1659 _bfd_elf_merge_object_attributes result.
1660
1661 2018-07-03 Alan Modra <amodra@gmail.com>
1662
1663 PR 17550
1664 * elflink.c (_bfd_elf_fix_symbol_flags): Hide dynamic symbols
1665 in discarded sections.
1666
1667 2018-07-02 Maciej W. Rozycki <macro@mips.com>
1668
1669 * elfxx-mips.c (_bfd_mips_elf_create_dynamic_sections): Set
1670 `mark' for symbols created from `mips_elf_dynsym_rtproc_names'
1671 list.
1672
1673 2018-07-02 Maciej W. Rozycki <macro@mips.com>
1674
1675 * elf64-mips.c (micromips_elf64_howto_table_rel): Add
1676 R_MICROMIPS_HI0_LO16, R_MICROMIPS_TLS_GD, R_MICROMIPS_TLS_LDM,
1677 R_MICROMIPS_TLS_DTPREL_HI16, R_MICROMIPS_TLS_DTPREL_LO16,
1678 R_MICROMIPS_TLS_GOTTPREL, R_MICROMIPS_TLS_TPREL_HI16,
1679 R_MICROMIPS_TLS_TPREL_LO16, R_MICROMIPS_GPREL7_S2 and
1680 R_MICROMIPS_PC23_S2 relocation entries.
1681 (micromips_elf64_howto_table_rela): Likewise.
1682 (micromips_reloc_map): Likewise.
1683 * elfn32-mips.c (elf_micromips_howto_table_rel): Likewise.
1684 (elf_micromips_howto_table_rela): Likewise.
1685 (micromips_reloc_map): Likewise.
1686
1687 2018-07-02 H.J. Lu <hongjiu.lu@intel.com>
1688
1689 PR ld/23324
1690 * elf64-x86-64.c (elf_x86_64_relocate_section): Clear the
1691 R_X86_64_converted_reloc_bit bit.
1692
1693 2018-07-02 Jeff Muizelaar <jrmuizel@gmail.com>
1694 Tom Tromey <tom@tromey.com>
1695
1696 PR 13157
1697 PR 21787
1698 * mach-o.c (bfd_mach_o_fat_close_and_cleanup): New function.
1699 (bfd_mach_o_close_and_cleanup): Redefine.
1700 * archive.c (_bfd_unlink_from_archive_parent): New function,
1701 extracted from..
1702 (_bfd_archive_close_and_cleanup): ..here.
1703 (bfd_generic_archive_p): Do not clear archive's format.
1704 * libbfd-in.h (_bfd_unlink_from_archive_parent): Declare.
1705 * libbfd.h: Regenerate.
1706
1707 2018-07-02 Thomas Preud'homme <thomas.preudhomme@arm.com>
1708
1709 * archures.c (bfd_mach_arm_5TEJ, bfd_mach_arm_6, bfd_mach_arm_6KZ,
1710 bfd_mach_arm_6T2, bfd_mach_arm_6K, bfd_mach_arm_7, bfd_mach_arm_6M,
1711 bfd_mach_arm_6SM, bfd_mach_arm_7EM, bfd_mach_arm_8, bfd_mach_arm_8R,
1712 bfd_mach_arm_8M_BASE, bfd_mach_arm_8M_MAIN): Define.
1713 * bfd-in2.h: Regenerate.
1714 * cpu-arm.c (arch_info_struct): Add entries for above new
1715 bfd_mach_arm values.
1716 * elf32-arm.c (bfd_arm_get_mach_from_attributes): Add Tag_CPU_arch to
1717 bfd_mach_arm mapping logic for pre Armv4 and Armv5TEJ and later
1718 architectures. Force assert failure for any new Tag_CPU_arch value.
1719
1720 2018-07-02 Thomas Preud'homme <thomas.preudhomme@arm.com>
1721
1722 * doc/bfdint.texi: Use command-line consistently when used in a
1723 compount word.
1724 * doc/bfdsumm.texi: Likewise.
1725
1726 2018-06-29 Maciej W. Rozycki <macro@mips.com>
1727
1728 * elfxx-mips.c (allocate_dynrelocs): Remove extraneous symbol
1729 visibility check made for undefined weak symbols.
1730
1731 2018-06-26 Nick Clifton <nickc@redhat.com>
1732
1733 * po/uk.po: Updated Ukranian translation.
1734
1735 2018-06-25 Nick Clifton <nickc@redhat.com>
1736
1737 * elfnn-aarch64.c (_bfd_aarch64_erratum_835769_stub_name): Check
1738 for malloc returning NULL.
1739 (_bfd_aarch64_erratum_843419_fixup): Check for
1740 _bfd_aarch64_erratum_835769_stub_name returning NULL.
1741
1742 2018-06-24 Nick Clifton <nickc@redhat.com>
1743
1744 * po/bfd.pot: Regenerate.
1745
1746 2018-06-24 Nick Clifton <nickc@redhat.com>
1747
1748 * version.m4: Update version string to 2.31.51.
1749 * configure: Regenerate.
1750
1751 2018-06-24 Nick Clifton <nickc@redhat.com>
1752
1753 2.31 branch created.
1754
1755 2018-06-21 Maciej W. Rozycki <macro@mips.com>
1756
1757 * elfxx-mips.c (_bfd_mips_elf_compact_eh_encoding)
1758 (_bfd_mips_elf_cant_unwind_opcode): Correct formatting.
1759
1760 2018-06-21 Maciej W. Rozycki <macro@mips.com>
1761
1762 * elfxx-mips.c (_bfd_mips_post_process_headers): Keep
1763 EI_ABIVERSION setting together.
1764
1765 2018-06-21 Maciej W. Rozycki <macro@mips.com>
1766
1767 * elfxx-mips.c (MIPS_LIBC_ABI_DEFAULT, MIPS_LIBC_ABI_MIPS_PLT)
1768 (MIPS_LIBC_ABI_UNIQUE, MIPS_LIBC_ABI_MIPS_O32_FP64)
1769 (MIPS_LIBC_ABI_MAX): New enumeration constants.
1770 (_bfd_mips_post_process_headers): Use them in place of magic
1771 numbers.
1772
1773 2018-06-21 Jim Wilson <jimw@sifive.com>
1774
1775 * elfnn-riscv.c (riscv_elf_finish_dynamic_symbol): Update comment.
1776 Use SYMBOL_REFERENCES_LOCAL. Add asserts for h->got.offset.
1777
1778 2018-06-21 Alan Modra <amodra@gmail.com>
1779
1780 * doc/Makefile.am (AUTOMAKE_OPTIONS): Add "foreign".
1781 * doc/Makefile.in: Regenerate.
1782
1783 2018-06-20 Renlin Li <renlin.li@arm.com>
1784
1785 * elfxx-aarch64.c (_bfd_aarch64_elf_resolve_relocation): Use PG_OFFSET
1786 to resolve BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC,
1787 BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC,
1788 BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC,
1789 BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC,
1790 BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12_NC,
1791 BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12_NC,
1792 BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12_NC,
1793 BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12_NC.
1794
1795 2018-06-20 Nick Clifton <nickc@redhat.com>
1796
1797 PR 23316
1798 * opncls.c (get_build_id): Check for a negative or excessive data
1799 size in the build-id note.
1800
1801 2018-06-20 Nick Clifton <nickc@redhat.com>
1802
1803 PR 23299
1804 * mach-o.c (cputype): New function.
1805 (cpusubtype): New function.
1806 (bfd_mach_o_bfd_print_private_data): New function. Dispalys the
1807 values in the MACH-O file header.
1808 (bfd_mach_o_bfd_copy_private_header_data): Copy the cputype and
1809 cpusubtype fields from the input bfd's mach-o header to the output
1810 bfd.
1811 * mach-o-target.c (bfd_mach_o_bfd_print_private_bfd_data):
1812 Redefine to bfd_mach_o_bfd_print_private_data.
1813 * mach-o.h (bfd_mach_o_bfd_print_private_bfd_data): Prototype.
1814
1815 2018-06-19 Maciej W. Rozycki <macro@mips.com>
1816
1817 PR ld/22966
1818 * elfxx-mips.c (_bfd_mips_elf_finish_dynamic_symbol): Verify the
1819 `.got.plt' entry referred is in range.
1820 (mips_finish_exec_plt): Correct the range check for `.got.plt'
1821 start. Replace the assertion used for that with a proper error
1822 message.
1823
1824 2018-06-19 Maciej W. Rozycki <macro@mips.com>
1825
1826 * elfxx-mips.c (_bfd_mips_elf_finish_dynamic_symbol): Fix
1827 formatting.
1828
1829 2018-06-19 Simon Marchi <simon.marchi@ericsson.com>
1830
1831 * Makefile.am (AUTOMAKE_OPTIONS): Remove 1.11.
1832 (INCLUDES): Rename to ...
1833 (AM_CPPFLAGS): ... this.
1834 * configure.ac: Remove AC_PREREQ.
1835 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove 1.9, cygnus, add
1836 info-in-builddir no-texinfo.tex.
1837 (info_TEXINFOS): Rename bfd.texinfo to bfd.texi.
1838 * doc/bfd.texinfo: Rename to ...
1839 * doc/bfd.texi: ... this.
1840 * Makefile.in: Re-generate.
1841 * aclocal.m4: Re-generate.
1842 * config.in: Re-generate.
1843 * configure: Re-generate.
1844 * doc/Makefile.in: Re-generate.
1845
1846 2018-06-18 Mephi <mephi42@gmail.com>
1847
1848 PR 23297
1849 * mach-o-x86-64.c (x86_64_howto_table): Add entry for
1850 BFD_RELOC_MACH_O_X86_64_RELOC_TLV.
1851 (bfd_mach_o_x86_64_canonicalize_one_reloc): Handle the new reloc.
1852 (bfd_mach_o_x86_64_swap_reloc_out): Likewise.
1853 * reloc.c (BFD_RELOC_MACH_O_X86_64_TV): New entry.
1854 * bfd-in2.h: Regenerate.
1855 * libbfd.h: Regenerate.
1856
1857 2018-06-14 Faraz Shahbazker <Faraz.Shahbazker@mips.com>
1858
1859 * elfxx-mips.c (print_mips_ases): Add GINV extension.
1860
1861 2018-06-14 H.J. Lu <hongjiu.lu@intel.com>
1862
1863 PR binutils/23267
1864 * elf.c (_bfd_elf_get_symbol_version_string): Check if the first
1865 symbol version is base version.
1866
1867 2018-06-14 Alan Modra <amodra@gmail.com>
1868
1869 * elf-bfd.h (struct elf_link_hash_table): Add "dynamic_relocs".
1870 * elflink.c (_bfd_elf_init_2_index_sections): Comment fix.
1871 (_bfd_elf_add_dynamic_entry): Set "dynamic_relocs".
1872 (_bfd_elf_link_renumber_dynsyms): Exclude all section symbols when
1873 "dynamic_relocs" is not set.
1874 * elfxx-mips.c (count_section_dynsyms): Likewise.
1875
1876 2018-06-14 Alan Modra <amodra@gmail.com>
1877
1878 PR 23282
1879 * bfdio.c (bfd_seek): Optimize away seeks to current position.
1880
1881 2018-06-13 Scott Egerton <scott.egerton@imgtec.com>
1882 Faraz Shahbazker <Faraz.Shahbazker@mips.com>
1883
1884 * elfxx-mips.c (print_mips_ases): Add CRC.
1885
1886 2018-06-08 H.J. Lu <hongjiu.lu@intel.com>
1887
1888 PR ld/23161
1889 * elfxx-x86.c (elf_x86_hide_linker_defined): New function.
1890 (_bfd_x86_elf_link_check_relocs): Use it to hide hidden
1891 __bss_start, _end and _edata in shared libraries.
1892
1893 2018-06-07 Alan Modra <amodra@gmail.com>
1894
1895 * elf32-tic6x.c (elf32_tic6x_check_relocs): Reference
1896 __c6xabi_DSBT_BASE explicitly for R_C6000_SBR_* relocs.
1897
1898 2018-06-05 Alan Modra <amodra@gmail.com>
1899
1900 * bfd.c (struct bfd): Update comment on "where" usage.
1901 * bfdio.c (bfd_bwrite, bfd_stat): Use and update "iovec",
1902 "iostream", and "where" from containing archive file. Return
1903 error on NULL iovec.
1904 (bfd_bread): Similarly, and return error attempted out of
1905 bounds archive element access.
1906 (bfd_tell, bfd_flush): Use and update "iovec", "iostream", and
1907 "where" from containing archive file.
1908 (bfd_seek): Likewise. Return error on NULL iovec. Don't
1909 attempt to optimize away seeks. Don't paper over errors by
1910 calling bfd_tell.
1911 (bfd_get_mtime): Call bfd_stat rather than iovec->bstat.
1912 (bfd_get_size): Likewise.
1913 (bfd_mmap): Operate on and use iovec of containing archive
1914 file. Return error on NULL iovec.
1915 * cache.c (bfd_cache_lookup_worker): Abort if working on
1916 archive element bfd.
1917 (cache_bread_1): Delete bfd parameter, add FILE* parameter.
1918 Don't ignore zero byte reads.
1919 (cache_bread): Look up FILE* in cache here. Error on NULL
1920 lookup.
1921 (cache_bwrite): Rename "where" to "from".
1922 (cache_bmmap): Don't handle archive elements.
1923 * coffcode.h (coff_slurp_line_table): Exit early on zero
1924 lineno count.
1925 * bfd-in2.h: Regenerate.
1926
1927 2018-06-05 Alan Modra <amodra@gmail.com>
1928
1929 PR 23254
1930 * plugin.c (bfd_plugin_open_input): Allow for possibility of
1931 nested archives. Open file again for plugin.
1932 (try_claim): Don't save and restore file position. Close file
1933 if not claimed.
1934 * sysdep.h (O_BINARY): Define.
1935
1936 2018-06-04 Max Filippov <jcmvbkbc@gmail.com>
1937
1938 * elf32-xtensa.c (xtensa_read_table_entries): Make global.
1939 (compute_fill_extra_space): Drop declaration. Rename function to
1940 xtensa_compute_fill_extra_space.
1941 (compute_ebb_actions, remove_dead_literal): Update references to
1942 compute_fill_extra_space.
1943
1944 2018-06-04 Volodymyr Arbatov <arbatov@cadence.com>
1945
1946 * elf32-xtensa.c (elf32xtensa_separate_props): New global
1947 variable.
1948 (xtensa_add_names): New function.
1949 (xtensa_property_section_name): Add new parameter
1950 separate_sections, use it to choose property section name.
1951 (xtensa_get_separate_property_section): New function.
1952 (xtensa_get_property_section): Invoke
1953 xtensa_get_separate_property_section to get individual property
1954 section if it exists, common property section otherwise.
1955 (xtensa_make_property_section): Pass elf32xtensa_separate_props
1956 to xtensa_property_section_name.
1957
1958 2018-06-04 H.J. Lu <hongjiu.lu@intel.com>
1959
1960 PR binutils/23146
1961 * bfd-in.h: Include "diagnostics.h".
1962 * bfd-in2.h: Regenerated.
1963 * elf32-arm.c (elf32_arm_nabi_write_core_note): Use
1964 DIAGNOSTIC_PUSH, DIAGNOSTIC_IGNORE_STRINGOP_TRUNCATION and
1965 DIAGNOSTIC_POP to silence GCC 8.1 warnings with
1966 -Wstringop-truncation.
1967 * elf32-ppc.c (ppc_elf_write_core_note): Likewse.
1968 * elf32-s390.c (elf_s390_write_core_note): Likewse.
1969 * elf64-ppc.c (ppc64_elf_write_core_note): Likewse.
1970 * elf64-s390.c (elf_s390_write_core_note): Likewse.
1971 * elfxx-aarch64.c (_bfd_aarch64_elf_write_core_note): Likewse.
1972
1973 2018-06-03 Jim Wilson <jimw@sifive.com>
1974
1975 PR ld/23244
1976 * elfnn-riscv.c (riscv_elf_relocate_section) <R_RISCV_CALL>: Check
1977 for and handle an undefined weak with no PLT.
1978
1979 PR ld/22756
1980 * elfnn-riscv.c (riscv_relax_delete_bytes): Add versioned_hidden check
1981 to code that ignores duplicate symbols.
1982
1983 2018-06-01 H.J. Lu <hongjiu.lu@intel.com>
1984
1985 * version.m4: Bump version to 2.30.52
1986 * configure: Regenerated.
1987
1988 2018-06-01 Alan Modra <amodra@gmail.com>
1989
1990 * bfd.c (_bfd_error_handler): Arrange for this function to be
1991 declared in bfd-in2.h.
1992 * libbfd-in.h (_bfd_error_handler): Don't declare.
1993 * libbfd.h: Regenerate.
1994 * bfd-in2.h: Regenerate.
1995
1996 2018-05-30 Amaan Cheval <amaan.cheval@gmail.com>
1997
1998 * config.bfd (x86_64-*-*): Add pei-x86-64 target to x86_64-*-rtems*
1999 This is needed to generate UEFI application image files from ELFs.
2000
2001 2018-05-28 H.J. Lu <hongjiu.lu@intel.com>
2002
2003 * elf32-i386.c (elf_i386_lazy_plt): Add plt_tlsdesc_entry,
2004 plt_tlsdesc_entry_size, plt_tlsdesc_got1_offset,
2005 plt_tlsdesc_got2_offset, plt_tlsdesc_got1_insn_end and
2006 plt_tlsdesc_got2_insn_end for TLSDESC entry.
2007 (elf_i386_lazy_ibt_plt): Likewise.
2008 (elf_i386_nacl_plt): Likewise.
2009 * elf64-x86-64.c (tlsdesc_plt_entry): Moved and renamed to ...
2010 (elf_x86_64_tlsdesc_plt_entry): This.
2011 (elf_x86_64_lazy_plt): Add plt_tlsdesc_entry,
2012 plt_tlsdesc_entry_size, plt_tlsdesc_got1_offset,
2013 plt_tlsdesc_got2_offset, plt_tlsdesc_got1_insn_end and
2014 plt_tlsdesc_got2_insn_end for TLSDESC entry.
2015 (elf_x86_64_lazy_bnd_plt): Likewise.
2016 (elf_x86_64_lazy_ibt_plt): Likewise.
2017 (elf_x32_lazy_ibt_plt): Likewise.
2018 (elf_x86_64_nacl_plt): Likewise.
2019 (elf_x86_64_finish_dynamic_sections): Use plt_tlsdesc_entry,
2020 plt_tlsdesc_entry_size, plt_tlsdesc_got1_offset,
2021 plt_tlsdesc_got2_offset, plt_tlsdesc_got1_insn_end and
2022 plt_tlsdesc_got2_insn_end to update TLSDESC entry.
2023 * elfxx-x86.h (elf_x86_lazy_plt_layout): Update comments.
2024 Add plt_tlsdesc_entry, plt_tlsdesc_entry_size,
2025 plt_tlsdesc_got1_offset, plt_tlsdesc_got2_offset,
2026 plt_tlsdesc_got1_insn_end and plt_tlsdesc_got2_insn_end.
2027 (elf_x86_non_lazy_plt_layout): Update comments.
2028 (elf_x86_plt_layout): Likewise.
2029
2030 2018-05-28 H.J. Lu <hongjiu.lu@intel.com>
2031
2032 PR ld/23238
2033 * elf-s390-common.c (elf_s390_add_symbol_hook): Removed.
2034 * elf32-arc.c (elf_arc_add_symbol_hook): Likewise.
2035 (elf_backend_add_symbol_hook): Likewise.
2036 * elf32-m68k.c (elf_m68k_add_symbol_hook): Likewise.
2037 (elf_backend_add_symbol_hook): Likewise.
2038 * elf32-s390.c (elf_backend_add_symbol_hook): Likewise.
2039 * elf32-sparc.c (elf32_sparc_add_symbol_hook): Likewise.
2040 (elf_backend_add_symbol_hook): Likewise.
2041 * elf64-s390.c (elf_backend_add_symbol_hook): Likewise.
2042 * elfxx-aarch64.c (_bfd_aarch64_elf_add_symbol_hook): Likewise.
2043 * elfxx-aarch64.h (_bfd_aarch64_elf_add_symbol_hook): Likewise.
2044 (elf_backend_add_symbol_hook): Likewise.
2045 * elf32-arm.c (elf32_arm_add_symbol_hook): Remove STT_GNU_IFUNC
2046 handling.
2047 * elf32-ppc.c (ppc_elf_add_symbol_hook): Likewise.
2048 * elf64-ppc.c (ppc64_elf_add_symbol_hook): Likewise.
2049 * elf64-sparc.c (elf64_sparc_add_symbol_hook): Likewise.
2050 * elflink.c (elf_link_add_object_symbols): Set
2051 elf_gnu_symbol_ifunc for STT_GNU_IFUNC symbols.
2052
2053 2018-05-26 H.J. Lu <hongjiu.lu@intel.com>
2054
2055 PR ld/23194
2056 * elf-bfd.h (_bfd_elf_link_hide_sym_by_version): New.
2057 * elflink.c (_bfd_elf_link_hide_versioned_symbol): New function.
2058 Extracted from _bfd_elf_link_assign_sym_version.
2059 (_bfd_elf_link_hide_sym_by_version): New function.
2060 (_bfd_elf_link_assign_sym_version): Use
2061 _bfd_elf_link_hide_versioned_symbol.
2062 * elfxx-x86.c (_bfd_x86_elf_link_symbol_references_local): Call
2063 _bfd_elf_link_hide_sym_by_version instead of
2064 bfd_hide_sym_by_version. Don't check unversioned symbol.
2065
2066 2018-05-25 Alan Modra <amodra@gmail.com>
2067
2068 * Makefile.in: Regenerate.
2069 * po/SRC-POTFILES.in: Regenerate.
2070
2071 2018-05-25 Alan Modra <amodra@gmail.com>
2072
2073 * configure.ac (bfd_cv_hidden): Run test with -Werror in CFLAGS.
2074 * configure: Regenerate.
2075
2076 2018-05-23 H.J. Lu <hongjiu.lu@intel.com>
2077
2078 * elf64-ppc.c (ppc64_elf_write_core_note): Add ATTRIBUTE_NONSTRING
2079 to data.
2080
2081 2018-05-22 Alan Modra <amodra@gmail.com>
2082
2083 PR 23207
2084 * elf32-hppa.c (hppa_get_stub_entry): Return NULL when link_sec
2085 is NULL.
2086 (elf32_hppa_size_stubs): Only create stubs for load, alloc, code
2087 sections.
2088 (final_link_relocate): Revert last change.
2089
2090 2018-05-22 Alan Modra <amodra@gmail.com>
2091
2092 PR 23207
2093 * elf32-hppa.c (final_link_relocate): Don't look for plt call
2094 stubs in non-alloc sections.
2095
2096 2018-05-21 H.J. Lu <hongjiu.lu@intel.com>
2097
2098 PR ld/23201
2099 * aout-target.h (MY_bfd_link_hide_symbol): New.
2100 * aout-tic30.c (MY_bfd_link_hide_symbol): Likewise.
2101 * binary.c (binary_bfd_link_hide_symbol): Likewise.
2102 * coff-alpha.c (_bfd_ecoff_bfd_link_hide_symbol): Likewise.
2103 * coff-mips.c (_bfd_ecoff_bfd_link_hide_symbol): Likewise.
2104 * coff-rs6000.c (_bfd_xcoff_bfd_link_hide_symbol): Likewise.
2105 * coffcode.h (coff_bfd_link_hide_symbol): Likewise.
2106 * elf-bfd.h (_bfd_elf_link_hide_symbol): Likewise.
2107 * elfxx-target.h (bfd_elfNN_bfd_link_hide_symbol): Likewise.
2108 * i386msdos.c (msdos_bfd_link_hide_symbol): Likewise.
2109 * ihex.c (ihex_bfd_link_hide_symbol): Likewise.
2110 * libbfd-in.h (_bfd_nolink_bfd_link_hide_symbol): Likewise.
2111 * linker.c (_bfd_generic_link_hide_symbol): Likewise.
2112 (bfd_link_hide_symbol): Likewise.
2113 * mach-o-target.c (bfd_mach_o_bfd_link_hide_symbol): Likewise.
2114 * mmo.c (mmo_bfd_link_hide_symbol): Likewise.
2115 * pef.c (bfd_pef_bfd_link_hide_symbol): Likewise.
2116 * plugin.c (bfd_plugin_bfd_link_hide_symbol): Likewise.
2117 * ppcboot.c (ppcboot_bfd_link_hide_symbol): Likewise.
2118 * som.c (som_bfd_link_hide_symbol): Likewise.
2119 * srec.c (srec_bfd_link_hide_symbol): Likewise.
2120 * tekhex.c (tekhex_bfd_link_hide_symbol): Likewise.
2121 * vms-alpha.c (vms_bfd_link_hide_symbol): Likewise.
2122 (alpha_vms_bfd_link_hide_symbol): Likewise.
2123 * xsym.c (bfd_sym_bfd_link_hide_symbol): Likewise.
2124 * coff64-rs6000.c (rs6000_xcoff64_vec): Add
2125 _bfd_generic_link_hide_symbol.
2126 (rs6000_xcoff64_aix_vec): Likewise.
2127 * elflink.c (bfd_elf_record_link_assignment): Don't make forced
2128 local symbol dynamic.
2129 (_bfd_elf_link_hide_symbol): New function.
2130 * elfxx-x86.c (_bfd_x86_elf_link_symbol_references_local): Don't
2131 check root.ldscript_def.
2132 * targets.c (bfd_target): Add _bfd_link_hide_symbol.
2133 (BFD_JUMP_TABLE_LINK): Add NAME##_bfd_link_hide_symbol.
2134 * bfd-in2.h: Regenerated.
2135 * libbfd.h: Likewise.
2136
2137 2018-05-21 H.J. Lu <hongjiu.lu@intel.com>
2138
2139 PR binutils/23199
2140 * elf.c (setup_group): Mark section in a section group with
2141 SHF_GROUP.
2142
2143 2018-05-18 H.J. Lu <hongjiu.lu@intel.com>
2144
2145 PR ld/23194
2146 * elfxx-x86.c (_bfd_x86_elf_link_symbol_references_local): Don't
2147 set eh->local_ref to 1 if a symbol is versioned and there is a
2148 version script.
2149
2150 2018-05-18 Kito Cheng <kito.cheng@gmail.com>
2151
2152 * elfnn-riscv.c (_bfd_riscv_elf_merge_private_bfd_data): Handle
2153 EF_RISCV_RVE.
2154
2155 2018-05-18 Jim Wilson <jimw@sifive.com>
2156
2157 * elfnn-riscv.c (allocate_dynrelocs): Discard dynamic relocations if
2158 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
2159 (riscv_elf_relocate_section): Don't generate dynamic relocation if
2160 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
2161 (riscv_elf_finish_dynamic_symbol): Likewise.
2162
2163 2018-05-18 John Darrington <john@darrington.wattle.id.au>
2164
2165 * Makefile.am: Add s12z files.
2166 * Makefile.in: Regenerate.
2167 * archures.c: Add bfd_s12z_arch.
2168 * bfd-in.h: Add exports of bfd_putb24 and bfd_putl24.
2169 * bfd-in2.h: Regenerate.
2170 * config.bfd: Add s12z target.
2171 * configure.ac: Add s12z target.
2172 * configure: Regenerate.
2173 * cpu-s12z.c: New file.
2174 * elf32-s12z.c: New file.
2175 * libbfd.c (bfd_putb24): New function.
2176 (bfd_putl24): New function.
2177 * libbfd.h: Regenerate.
2178 * reloc.c: Add s12z relocations.
2179 (bfd_get_reloc_size): Handle size 5 relocs.
2180 * targets.c: Add s12z_elf32_vec.
2181
2182 2018-05-18 H.J. Lu <hongjiu.lu@intel.com>
2183
2184 PR ld/23189
2185 * elf32-i386.c (elf_i386_relocate_section): Handle R_386_GOT32X
2186 like R_386_GOT32.
2187 * elfxx-x86.c (_bfd_x86_elf_link_symbol_references_local): Don't
2188 set eh->local_ref to 1 for linker defined symbols.
2189
2190 2018-05-18 Alan Modra <amodra@gmail.com>
2191
2192 PR 23199
2193 * elf.c (setup_group): Formatting. Check that SHT_GROUP entries
2194 don't point at other SHT_GROUP sections. Set shdr corresponding
2195 to invalid entry, to NULL rather than section 0. Identify
2196 SHT_GROUP section index when reporting an error. Cope with NULL
2197 shdr pointer.
2198
2199 2018-05-18 Alan Modra <amodra@gmail.com>
2200
2201 * libbfd-in.h (ATTRIBUTE_HIDDEN): Define and use throughout.
2202 * configure.ac (HAVE_HIDDEN): Check compiler support for hidden
2203 visibility.
2204 * libbfd.h: Regenerate.
2205 * configure: Regenerate.
2206 * config.in: Regenerate.
2207
2208 2018-05-18 Alan Modra <amodra@gmail.com>
2209
2210 * libbfd-in.h: Add include guard.
2211 * libcoff-in.h: Likewise.
2212 * doc/Makefile.am (libbfd.h, libcoff.h): Append another #endif.
2213 * doc/Makefile.in: Regenerate.
2214 * libbfd.h: Regenerate.
2215 * libcoff.h: Regenerate.
2216
2217 2018-05-16 Maciej W. Rozycki <macro@mips.com>
2218
2219 * elf32-nds32.c (nds32_convert_32_to_16): Preset `insn_type'.
2220
2221 2018-05-16 Alan Modra <amodra@gmail.com>
2222
2223 PR 22458
2224 * format.c (struct bfd_preserve): Add section_id.
2225 (bfd_preserve_save, bfd_preserve_restore): Save and restore
2226 _bfd_section_id.
2227 (bfd_reinit): Set _bfd_section_id.
2228 (bfd_check_format_matches): Put all matches of any priority into
2229 matching_vector. Save initial section id and start each attempted
2230 match at that section id.
2231 * libbfd-in.h (_bfd_section_id): Declare.
2232 * section.c (_bfd_section_id): Rename from section_id and make
2233 global. Adjust uses.
2234 (bfd_get_next_section_id): Delete.
2235 * elf64-ppc.c (ppc64_elf_setup_section_lists): Replace use of
2236 bfd_get_section_id with _bfd_section_id.
2237 * libbfd.h: Regenerate.
2238 * bfd-in2.h: Regenerate.
2239
2240 2018-05-15 Christophe Guillon <christophe.guillon@st.com>
2241
2242 * coffcode.h (coff_bigobj_swap_aux_in): Make sure that all fields
2243 of the aux structure are initialised.
2244
2245 2018-05-15 Francois H. Theron <francois.theron@netronome.com>
2246
2247 * targets.c: Wrap nfp_elf64_vec in BFD64 ifdef.
2248
2249 2018-05-15 Nick Clifton <nickc@redhat.com>
2250
2251 * po/pt.po: New Portuguese translation.
2252 * configure.ac (ALL_LINGUAS): Add pt.
2253 * configure: Regenerate.
2254
2255 2018-05-14 H.J. Lu <hongjiu.lu@intel.com>
2256
2257 PR ld/23169
2258 * elf-ifunc.c (_bfd_elf_allocate_ifunc_dyn_relocs): Don't issue
2259 an error on IFUNC pointer defined in PDE.
2260 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Call
2261 _bfd_x86_elf_link_fixup_ifunc_symbol.
2262 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
2263 * elfxx-x86.c (_bfd_x86_elf_link_fixup_ifunc_symbol): New
2264 function.
2265 * elfxx-x86.h (_bfd_x86_elf_link_fixup_ifunc_symbol): New.
2266
2267 2018-05-14 H.J. Lu <hongjiu.lu@intel.com>
2268
2269 PR ld/23162
2270 * elfxx-x86.c (elf_x86_linker_defined): New function.
2271 (_bfd_x86_elf_link_check_relocs): Use it to mark __bss_start,
2272 _end and _edata locally defined within executables.
2273
2274 2018-05-12 Alan Modra <amodra@gmail.com>
2275
2276 PR 20659
2277 * elf.c (rewrite_elf_program_header): Use segment_mark only for
2278 PT_LOAD headers. Delete first_matching_lma and first_suggested_lma.
2279 Instead make matching_lma and suggested_lma pointers to the
2280 sections. Align section vma and lma calculated from segment.
2281 Don't clear includes_phdrs or includes_filehdr based on p_paddr
2282 test. Try to handle alignment padding before first section by
2283 adjusting new segment lma down. Adjust PT_PHDR map p_paddr.
2284
2285 2018-05-09 Dimitar Dimitrov <dimitar@dinux.eu>
2286
2287 * elf32-pru.c (pru_elf32_do_ldi32_relocate): Make LDI32 relocation
2288 conformant to TI ABI.
2289 (pru_elf32_relax_section): Likewise.
2290 (pru_elf_relax_delete_bytes): Fix offsets for new LDI32 code.
2291 * elf32-pru.c (pru_elf32_do_ldi32_relocate): Ignore addend.
2292 (pru_elf32_pmem_relocate): Trap - should not get here.
2293 (pru_elf32_relocate_section): Add support for REL relocations.
2294 (elf_info_to_howto_rel): Enable REL.
2295 (elf_backend_may_use_rel_p): Likewise.
2296 (elf_backend_may_use_rela_p): Likewise.
2297 (elf_backend_default_use_rela_p): Likewise.
2298
2299 2018-05-09 Alan Modra <amodra@gmail.com>
2300
2301 PR 23148
2302 * peXXigen.c (pe_print_edata): Correct minimum size.
2303
2304 2018-05-09 Alan Modra <amodra@gmail.com>
2305
2306 PR 23147
2307 * peXXigen.c (pe_print_idata): Bound check hint_addr.
2308
2309 2018-05-08 Nick Clifton <nickc@redhat.com>
2310
2311 PR 22809
2312 * elf.c (bfd_elf_get_str_section): Check for an excessively large
2313 string section.
2314 * elf-attrs.c (_bfd_elf_parse_attributes): Issue an error if the
2315 attribute section is larger than the size of the file.
2316
2317 2018-05-07 Alan Modra <amodra@gmail.com>
2318
2319 * cofflink.c (_bfd_coff_link_input_bfd): Use memcmp rather than
2320 strncmp when checking for ".bf" special symbol.
2321 * peXXigen.c (_bfd_XXi_swap_scnhdr_out): Make pe_required_section_flags
2322 section name a char array, remove sentinal known_sections entry,
2323 and adjust loop over known_sections to suit. Use memcmp rather
2324 than strncmp.
2325
2326 2018-05-04 Alan Modra <amodra@gmail.com>
2327
2328 * elf-linux-core.h (struct elf_external_linux_prpsinfo32_ugid32),
2329 (struct elf_external_linux_prpsinfo32_ugid16),
2330 (struct elf_external_linux_prpsinfo64_ugid32),
2331 (struct elf_external_linux_prpsinfo64_ugid16): Add ATTRIBUTE_NONSTRING
2332 to pr_fname and pr_psargs fields. Remove GCC diagnostic pragmas.
2333 Move comment to..
2334 * elf.c (elfcore_write_prpsinfo): ..here. Indent nested preprocessor
2335 directives.
2336 * elf32-arm.c (elf32_arm_nabi_write_core_note): Add ATTRIBUTE_NONSTRING
2337 to data.
2338 * elf32-ppc.c (ppc_elf_write_core_note): Likewise.
2339 * elf32-s390.c (elf_s390_write_core_note): Likewise.
2340 * elf64-s390.c (elf_s390_write_core_note): Likewise.
2341 * elfxx-aarch64.c (_bfd_aarch64_elf_write_core_note): Likewise.
2342 * elf64-x86-64.c (elf_x86_64_write_core_note): Add GCC diagnostic
2343 pragmas.
2344 * peXXigen.c (_bfd_XXi_swap_scnhdr_out): Use strnlen to avoid
2345 false positive gcc-8 warning.
2346 * cofflink.c (_bfd_coff_link_input_bfd): Likewise.
2347
2348 2018-05-04 Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
2349
2350 * elf32-ppc.c (_bfd_elf_ppc_merge_fp_attributes): Fix the order
2351 of arguments when warning about different long double types.
2352
2353 2018-05-03 Simon Atanasyan <simon@atanasyan.com>
2354
2355 * elf32-mips.c: (elf32_mips_fixup_symbol): New function.
2356 (elf_backend_fixup_symbol): New macro.
2357 * elfxx-mips.c: (mips_elf_output_extsym): Discard _gp_disp
2358 handling.
2359 (_bfd_mips_elf_finish_dynamic_symbol): Likewise.
2360
2361 2018-04-30 Francois H. Theron <francois.theron@netronome.com>
2362
2363 * Makefile.am: Added NFP files to build.
2364 * archures.c: Added bfd_arch_nfp
2365 * config.bfd: Added NFP support.
2366 * configure.ac: Added NFP support.
2367 * cpu-nfp.c: New, for NFP support.
2368 * elf-bfd.h: Added elf_section_info()
2369 * elf64-nfp.c: New, for NFP support.
2370 * po/SRC-POTFILES.in: Added NFP source files.
2371 * targets.c: Added nfp_elf64_vec
2372 * bfd-in2.h: Regenerate.
2373 * Makefile.in: Regenerate.
2374 * configure: Regenerate.
2375
2376 2018-04-27 Alan Modra <amodra@gmail.com>
2377
2378 * bfd-in2.h: Regenerate.
2379 * libbfd.h: Regenerate.
2380
2381 2018-04-27 Alan Modra <amodra@gmail.com>
2382
2383 PR 23123
2384 PR 22374
2385 * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Don't drop plt
2386 relocs for ifuncs.
2387 * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Comment fixes.
2388
2389 2018-04-26 Pedro Alves <palves@redhat.com>
2390
2391 * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Don't consider
2392 ifunc and non-ifunc symbols duplicates.
2393
2394 2018-04-25 Christophe Lyon <christophe.lyon@st.com>
2395 Mickaël Guêné <mickael.guene@st.com>
2396
2397 * elf32-arm.c (elf32_arm_fdpic_thumb_plt_entry): New.
2398 (elf32_arm_plt_needs_thumb_stub_p): Handle thumb-only case.
2399 (elf32_arm_populate_plt_entry): Likewise.
2400 (elf32_arm_output_plt_map_1): Likewise.
2401 (elf32_arm_output_arch_local_syms): Likewise.
2402
2403 2018-04-25 Christophe Lyon <christophe.lyon@st.com>
2404 Mickaël Guêné <mickael.guene@st.com>
2405
2406 * elf32-arm.c (elf32_arm_finish_dynamic_symbol): Handle
2407 _GLOBAL_OFFSET_TABLE_ in FDPIC mode.
2408
2409 2018-04-25 Christophe Lyon <christophe.lyon@st.com>
2410 Mickaël Guêné <mickael.guene@st.com>
2411
2412 * elf32-arm.c (bfd_elf32_arm_set_target_params): Handle FDPIC case
2413 for R_ARM_TARGET2.
2414
2415 2018-04-25 Christophe Lyon <christophe.lyon@st.com>
2416 Mickaël Guêné <mickael.guene@st.com>
2417
2418 * elf32-arm.c (DEFAULT_STACK_SIZE): New.
2419 (elf32_arm_always_size_sections): Create stack segment.
2420
2421 2018-04-25 Christophe Lyon <christophe.lyon@st.com>
2422 Mickaël Guêné <mickael.guene@st.com>
2423
2424 * bfd-in2.h (BFD_RELOC_ARM_TLS_GD32_FDPIC)
2425 (BFD_RELOC_ARM_TLS_LDM32_FDPIC, BFD_RELOC_ARM_TLS_IE32_FDPIC): New
2426 relocations.
2427 * elf32-arm.c (elf32_arm_howto_table_2): Add R_ARM_TLS_GD32_FDPIC,
2428 R_ARM_TLS_LDM32_FDPIC, R_ARM_TLS_IE32_FDPIC relocations.
2429 (elf32_arm_reloc_map): Add R_ARM_TLS_GD32_FDPIC,
2430 R_ARM_TLS_LDM32_FDPIC, R_ARM_TLS_IE32_FDPIC.
2431 (struct elf32_arm_link_hash_table): Update comment.
2432 (elf32_arm_final_link_relocate): Handle TLS FDPIC relocations.
2433 (IS_ARM_TLS_RELOC): Likewise.
2434 (elf32_arm_check_relocs): Likewise.
2435 (allocate_dynrelocs_for_symbol): Likewise.
2436 (elf32_arm_size_dynamic_sections): Update comment.
2437 * reloc.c: Add BFD_RELOC_ARM_TLS_GD32_FDPIC,
2438 BFD_RELOC_ARM_TLS_LDM32_FDPIC, BFD_RELOC_ARM_TLS_IE32_FDPIC.
2439
2440 2018-04-25 Christophe Lyon <christophe.lyon@st.com>
2441 Mickaël Guêné <mickael.guene@st.com>
2442
2443 * elf32-arm.c (elf32_arm_fdpic_plt_entry): New.
2444 (elf32_arm_create_dynamic_sections): Handle FDPIC.
2445 (elf32_arm_allocate_plt_entry): Likewise.
2446 (elf32_arm_populate_plt_entry): Likewise.
2447 (elf32_arm_output_plt_map_1): Likewise.
2448
2449 2018-04-25 Christophe Lyon <christophe.lyon@st.com>
2450 Mickaël Guêné <mickael.guene@st.com>
2451
2452 * elf32-arm.c (struct fdpic_local): New.
2453 (elf_arm_obj_tdata): Add local_fdpic_cnts field.
2454 (elf32_arm_local_fdpic_cnts): New.
2455 (struct fdpic_global): New.
2456 (elf32_arm_link_hash_entry): Add fdpic_cnts field.
2457 (elf32_arm_link_hash_table): Add srofixup field.
2458 (arm_elf_add_rofixup): New.
2459 (arm_elf_fill_funcdesc): New.
2460 (elf32_arm_link_hash_newfunc): Handle fdpic_cnts.
2461 (elf32_arm_allocate_local_sym_info): Likewise.
2462 (create_got_section): Create .rofixup section.
2463 (elf32_arm_copy_indirect_symbol): Handle fdpic_cnts.
2464 (bfd_elf32_arm_set_target_params): Handle FDPIC.
2465 (elf32_arm_final_link_relocate): Likewise.
2466 (elf32_arm_check_relocs): Likewise.
2467 (allocate_dynrelocs_for_symbol): Likewise.
2468 (elf32_arm_size_dynamic_sections): Likewise.
2469 (elf32_arm_finish_dynamic_sections): Likewise.
2470 (elf32_arm_output_arch_local_syms): Likewise.
2471 (elf32_arm_fdpic_omit_section_dynsym): New.
2472
2473 2018-04-25 Christophe Lyon <christophe.lyon@st.com>
2474 Mickaël Guêné <mickael.guene@st.com>
2475
2476 * bfd-in2.c (BFD_RELOC_ARM_GOTFUNCDESC)
2477 (BFD_RELOC_ARM_GOTOFFFUNCDESC, BFD_RELOC_ARM_FUNCDESC)
2478 (BFD_RELOC_ARM_FUNCDESC_VALUE): New.
2479 * elf32-arm.c (elf32_arm_howto_table_2): Add R_ARM_GOTFUNCDESC,
2480 R_ARM_GOTOFFFUNCDESC, R_ARM_FUNCDESC, R_ARM_FUNCDESC_VALUE.
2481 (elf32_arm_howto_from_type): Take new members of
2482 elf32_arm_howto_table_2 into account.
2483 (elf32_arm_reloc_map): Add BFD_RELOC_ARM_GOTFUNCDESC,
2484 BFD_RELOC_ARM_GOTOFFFUNCDESC, BFD_RELOC_ARM_FUNCDESC,
2485 BFD_RELOC_ARM_FUNCDESC_VALUE.
2486 * reloc.c: Add BFD_RELOC_ARM_GOTFUNCDESC,
2487 BFD_RELOC_ARM_GOTOFFFUNCDESC, BFD_RELOC_ARM_FUNCDESC,
2488 BFD_RELOC_ARM_FUNCDESC_VALUE.
2489
2490 2018-04-25 Christophe Lyon <christophe.lyon@st.com>
2491 Mickaël Guêné <mickael.guene@st.com>
2492
2493 * elf32-arm.c (elf32_arm_print_private_bfd_data): Support
2494 EF_ARM_PIC and ELFOSABI_ARM_FDPIC.
2495 (elf32_arm_post_process_headers): Support ELFOSABI_ARM_FDPIC.
2496 (ELF_OSABI): Define to ELFOSABI_ARM_FDPIC.
2497
2498 2018-04-25 Christophe Lyon <christophe.lyon@st.com>
2499 Mickaël Guêné <mickael.guene@st.com>
2500
2501 * config.bfd (arm*-*-linux-*): Add arm_elf32_fdpic_be_vec and
2502 arm_elf32_fdpic_le_vec to targ_selvecs. Accept
2503 arm*-*-uclinuxfdpiceabi.
2504 * configure.ac: Add support for arm_elf32_fdpic_be_vec and
2505 arm_elf32_fdpic_le_vec.
2506 * configure: Regenerate.
2507 * elf32-arm.c (struct elf32_arm_link_hash_table): Add fdpic_p.
2508 (elf32_arm_link_hash_table_create): Initialize fdpic_p.
2509 (TARGET_LITTLE_SYM, TARGET_LITTLE_NAME, TARGET_BIG_SYM)
2510 (TARGET_BIG_NAME, elf_match_priority): Define for FDPIC targets.
2511 (elf32_arm_fdpic_link_hash_table_create): New.
2512 * targets.c (_bfd_target_vector): Add arm_elf32_fdpic_be_vec and
2513 arm_elf32_fdpic_le_vec.
2514
2515 2018-04-25 Alan Modra <amodra@gmail.com>
2516
2517 * elf-linux-core.h: Disable gcc-8 string truncation warning.
2518 * elf.c (elfcore_write_prpsinfo): Likewise.
2519
2520 2018-04-25 Alan Modra <amodra@gmail.com>
2521
2522 * Makefile.am: Remove arm-aout and arm-coff support.
2523 * config.bfd: Likewise.
2524 * configure.ac: Likewise.
2525 * targets.c: Likewise.
2526 * aout-arm.c: Delete.
2527 * armnetbsd.c: Delete.
2528 * riscix.c: Delete.
2529 * Makefile.in: Regenerate.
2530 * configure: Regenerate.
2531 * po/SRC-POTFILES.in: Regenerate.
2532
2533 2018-04-24 Nick Clifton <nickc@redhat.com>
2534
2535 PR 23113
2536 * elf.c (ignore_section_sym): Check for the output_section pointer
2537 being NULL before dereferencing it.
2538
2539 PR 23110
2540 * peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Check for
2541 a negative PE_DEBUG_DATA size before iterating over the debug data.
2542
2543 2018-04-23 Alan Modra <amodra@gmail.com>
2544
2545 * elf-linux-core.h: Revert last change.
2546 * elf.c: Likewise.
2547
2548 2018-04-23 Nick Clifton <nickc@redhat.com>
2549
2550 PR 23056
2551 * aoutx.h (aout_get_external_symbols): Allocate an extra byte at
2552 the end of the string table, and zero it.
2553
2554 2018-04-23 Alan Modra <amodra@gmail.com>
2555
2556 * elf-linux-core.h (swap_linux_prpsinfo32_ugid32_out): Disable
2557 gcc-8 string truncation warning.
2558 (swap_linux_prpsinfo32_ugid16_out): Likewise.
2559 (swap_linux_prpsinfo64_ugid32_out): Likewise.
2560 (swap_linux_prpsinfo64_ugid16_out): Likewise.
2561 * elf.c (elfcore_write_prpsinfo): Likewise.
2562
2563 2018-04-23 Nick Clifton <nickc@redhat.com>
2564
2565 PR 23056
2566 * aoutx.h (aout_get_external_symbols): Allocate an extra byte at
2567 the end of the string table, and zero it.
2568
2569 2018-04-20 Alan Modra <amodra@gmail.com>
2570
2571 PR 22978
2572 * elf32-hppa.c (got_relocs_needed): Add extra param to special
2573 case both dtprel and tprel relocs.
2574 (allocate_dynrelocs): Adjust conditions for got relocs.
2575 (elf32_hppa_relocate_section): Likewise for local sym got relocs.
2576 Emit dynamic relocs on TLS GOT entries for shared libraries,
2577 not when pic. Omit dynamic reloc on dtprel entry when local,
2578 and on tprel entry when local and executable.
2579
2580 2018-04-19 Alan Modra <amodra@gmail.com>
2581
2582 PR 22537
2583 * elf32-hppa.c (elf32_hppa_size_stubs): Init "destination" to -1.
2584 (hppa_type_of_stub): Don't return a long branch stub for
2585 symbols other than those defined statically.
2586
2587 2018-04-19 Alan Modra <amodra@gmail.com>
2588
2589 * Makefile.am: Revert 2018-04-18 coff-mips changes.
2590 * config.bfd: Add back mips_ecoff_le_vec and mips_ecoff_be_vec
2591 to selvecs for mips targets change 2018-04-18.
2592 * configure.ac: Reinstate mips_ecoff_le_vec, mips_ecoff_be_vec
2593 and mips_ecoff_bele_vec.
2594 * targets.c: Likewise.
2595 * coff-mips.c: Resurrect.
2596 * Makefile.in: Regenerate.
2597 * configure: Regenerate.
2598 * po/SRC-POTFILES.in: Regenerate.
2599
2600 2018-04-18 Alan Modra <amodra@gmail.com>
2601
2602 * Makefile.am: Remove mips aout and coff support.
2603 * config.bfd: Likewise.
2604 * configure.ac: Likewise.
2605 * targets.c: Likewise.
2606 * coff-mips.c: Delete
2607 * mipsbsd.c: Delete
2608 * pe-mips.c: Delete
2609 * pei-mips.c: Delete
2610 * Makefile.in: Regenerate.
2611 * configure: Regenerate.
2612 * po/SRC-POTFILES.in: Regenerate.
2613
2614 2018-04-17 H.J. Lu <hongjiu.lu@intel.com>
2615
2616 * elf32-i386.c (elf32_bed): Define before including
2617 "elf32-target.h".
2618 * elf64-x86-64.c (elf64_bed): Define before including
2619 "elf64-target.h".
2620 (elf32_bed): Define before including "elf32-target.h".
2621
2622 2018-04-17 H.J. Lu <hongjiu.lu@intel.com>
2623
2624 PR ld/23055
2625 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Use a
2626 normal input file with compatible relocation.
2627
2628 2018-04-18 Alan Modra <amodra@gmail.com>
2629
2630 * Makefile.am: Remove support for assorted i386 aout and coff targets.
2631 * config.bfd: Likewise.
2632 * configure.ac: Likewise.
2633 * doc/bfdint.texi: Likewise.
2634 * targets.c: Likewise.
2635 * freebsd.h: Delete.
2636 * i386dynix.c: Delete.
2637 * i386freebsd.c: Delete.
2638 * i386linux.c: Delete.
2639 * i386mach3.c: Delete.
2640 * i386netbsd.c: Delete.
2641 * i386os9k.c: Delete.
2642 * Makefile.in: Regenerate.
2643 * configure: Regenerate.
2644 * po/SRC-POTFILES.in: Regenerate.
2645
2646 2018-04-17 Andrew Sadek <andrew.sadek.se@gmail.com>
2647
2648 Microblaze Target: PIC data text relative
2649
2650 * bfd/reloc.c (2 new BFD relocations):
2651 BFD_RELOC_MICROBLAZE_64_TEXTPCREL &
2652 BFD_RELOC_MICROBLAZE_64_TEXTPCREL
2653 * bfd/bfd-in2.h: Regenerate
2654 * bfd/libbfd.h: Regenerate
2655 * bfd/elf32-microblaze.c (Handle new relocs): define 'HOWTO' of 3
2656 new relocs and handle them in both relocate and relax functions.
2657 (microblaze_elf_reloc_type_lookup): add mapping between for new
2658 bfd relocs.
2659 (microblaze_elf_relocate_section): Handle new relocs in case of
2660 elf relocation.
2661 (microblaze_elf_relax_section): Handle new relocs for elf relaxation.
2662
2663 2018-04-17 Nick Clifton <nickc@redhat.com>
2664
2665 PR 23055
2666 * aoutx.h (find_nearest_line): Check that the symbol name exists
2667 and is long enough, before attempting to see if it is for a .o
2668 file.
2669 * hash.c (bfd_hash_hash): Add an assertion that the string is not
2670 NULL.
2671 * linker.c (bfd_link_hash_lookup): Fail if the table or string are
2672 NULL.
2673 (_bfd_generic_link_add_archive_symbols): Fail if an archive entry
2674 has no name.
2675
2676 PR 23065
2677 * dwarf2.c (concat_filename): Check for a NULL table pointer.
2678
2679 2018-04-16 Nick Clifton <nickc@redhat.com>
2680
2681 PR 23061
2682 * coffgen.c (coff_pointerize_aux): Check for an out of range
2683 fixup.
2684
2685 2018-04-16 Alan Modra <amodra@gmail.com>
2686
2687 * Makefile.am: Remove arm-epoc-pe support.
2688 * coff-arm.c: Likewise.
2689 * config.bfd: Likewise.
2690 * configure.ac: Likewise.
2691 * targets.c: Likewise.
2692 * epoc-pe-arm.c: Delete.
2693 * epoc-pei-arm.c: Delete.
2694 * Makefile.in: Regenerate.
2695 * configure: Regenerate.
2696 * po/SRC-POTFILES.in: Regenerate.
2697
2698 2018-04-16 Alan Modra <amodra@gmail.com>
2699
2700 * Makefile.am: Remove sparc-aout and sparc-coff support.
2701 * config.bfd: Likewise.
2702 * configure.ac: Likewise.
2703 * targets.c: Likewise.
2704 * aout-sparcle.c: Delete.
2705 * aoutf1.h: Delete.
2706 * cf-sparclynx.c: Delete.
2707 * coff-sparc.c: Delete.
2708 * demo64.c: Delete.
2709 * sparclinux.c: Delete.
2710 * sparclynx.c: Delete.
2711 * sparcnetbsd.c: Delete.
2712 * sunos.c: Delete.
2713 * Makefile.in: Regenerate.
2714 * configure: Regenerate.
2715 * po/SRC-POTFILES.in: Regenerate.
2716
2717 2018-04-16 Alan Modra <amodra@gmail.com>
2718
2719 * Makefile.am: Remove m68k-aout and m68k-coff support.
2720 * aoutf1.h: Likewise.
2721 * aoutx.h: Likewise.
2722 * archive.c: Likewise.
2723 * bfd-in.h: Likewise.
2724 * bfd.c: Likewise.
2725 * coffcode.h: Likewise.
2726 * coffswap.h: Likewise.
2727 * config.bfd: Likewise.
2728 * configure.ac: Likewise.
2729 * configure.host: Likewise.
2730 * doc/bfd.texinfo: Likewise.
2731 * doc/bfdint.texi: Likewise.
2732 * freebsd.h: Likewise.
2733 * gen-aout.c: Likewise.
2734 * hpux-core.c: Likewise.
2735 * libaout.h: Likewise.
2736 * libbfd-in.h: Likewise.
2737 * pdp11.c: Likewise.
2738 * peicode.h: Likewise.
2739 * riscix.c: Likewise.
2740 * targets.c: Likewise.
2741 * aout0.c: Delete.
2742 * coff-apollo.c: Delete.
2743 * coff-aux.c: Delete.
2744 * coff-m68k.c: Delete.
2745 * coff-svm68k.c: Delete.
2746 * coff-u68k.c: Delete.
2747 * hosts/delta68.h: Delete.
2748 * hosts/hp300bsd.h: Delete.
2749 * hosts/m68kaux.h: Delete.
2750 * hosts/news.h: Delete.
2751 * hp300bsd.c: Delete.
2752 * hp300hpux.c: Delete.
2753 * liboasys.h: Delete.
2754 * m68k4knetbsd.c: Delete.
2755 * m68klinux.c: Delete.
2756 * m68knetbsd.c: Delete.
2757 * oasys.c: Delete.
2758 * versados.c: Delete.
2759 * Makefile.in: Regenerate.
2760 * bfd-in2.h: Regenerate.
2761 * configure: Regenerate.
2762 * libbfd.h: Regenerate.
2763 * po/SRC-POTFILES.in: Regenerate.
2764
2765 2018-04-16 Alan Modra <amodra@gmail.com>
2766
2767 * Makefile.am: Remove sh5 and sh64 support.
2768 * archures.c: Likewise.
2769 * config.bfd: Likewise.
2770 * configure.ac: Likewise.
2771 * cpu-sh.c: Likewise.
2772 * elf32-sh-relocs.h: Likewise.
2773 * elf32-sh.c: Likewise.
2774 * targets.c: Likewise.
2775 * elf32-sh64-com.c: Delete.
2776 * elf32-sh64.c: Delete.
2777 * elf32-sh64.h: Delete.
2778 * elf64-sh64.c: Delete.
2779 * Makefile.in: Regenerate.
2780 * bfd-in2.h: Regenerate.
2781 * configure: Regenerate.
2782 * po/SRC-POTFILES.in: Regenerate.
2783
2784 2018-04-16 Alan Modra <amodra@gmail.com>
2785
2786 * Makefile.am: Remove sh-symbianelf support.
2787 * config.bfd: Likewise.
2788 * configure.ac: Likewise.
2789 * targets.c: Likewise.
2790 * elf32-sh-symbian.c: Delete.
2791 * Makefile.in: Regenerate.
2792 * configure: Regenerate.
2793 * po/SRC-POTFILES.in: Regenerate.
2794
2795 2018-04-16 Alan Modra <amodra@gmail.com>
2796
2797 * Makefile.am: Remove vax-bsd and vax-ultrix support.
2798 * config.bfd: Likewise.
2799 * configure.ac: Likewise.
2800 * targets.c: Likewise.
2801 * vaxbsd.c: Delete.
2802 * Makefile.in: Regenerate.
2803 * configure: Regenerate.
2804 * po/SRC-POTFILES.in: Regenerate.
2805
2806 2018-04-16 Alan Modra <amodra@gmail.com>
2807
2808 * Makefile.am: Remove w65 support.
2809 * archures.c: Likewise.
2810 * coffcode.h: Likewise.
2811 * config.bfd: Likewise.
2812 * configure.ac: Likewise.
2813 * targets.c: Likewise.
2814 * coff-w65.c: Delete.
2815 * cpu-w65.c: Delete.
2816 * Makefile.in: Regenerate.
2817 * bfd-in2.h: Regenerate.
2818 * configure: Regenerate.
2819 * po/SRC-POTFILES.in: Regenerate.
2820
2821 2018-04-16 Alan Modra <amodra@gmail.com>
2822
2823 * Makefile.am: Remove we32k support.
2824 * archures.c: Likewise.
2825 * coffcode.h: Likewise.
2826 * config.bfd: Likewise.
2827 * configure.ac: Likewise.
2828 * targets.c: Likewise.
2829 * coff-we32k.c: Delete.
2830 * cpu-we32k.c: Delete.
2831 * Makefile.in: Regenerate.
2832 * bfd-in2.h: Regenerate.
2833 * configure: Regenerate.
2834 * po/SRC-POTFILES.in: Regenerate.
2835
2836 2018-04-16 Alan Modra <amodra@gmail.com>
2837
2838 * Makefile.am: Remove m88k support.
2839 * aoutx.h: Likewise.
2840 * archures.c: Likewise.
2841 * coffcode.h: Likewise.
2842 * coffswap.h: Likewise.
2843 * config.bfd: Likewise.
2844 * configure.ac: Likewise.
2845 * cpu-ns32k.c: Likewise.
2846 * elf32-nds32.c: Likewise.
2847 * mach-o.c: Likewise.
2848 * netbsd-core.c: Likewise.
2849 * reloc.c: Likewise.
2850 * targets.c: Likewise.
2851 * coff-m88k.c: Delete.
2852 * cpu-m88k.c: Delete.
2853 * elf32-m88k.c: Delete.
2854 * hosts/m88kmach3.h: Delete.
2855 * m88kmach3.c: Delete.
2856 * m88kopenbsd.c: Delete.
2857 * Makefile.in: Regenerate.
2858 * bfd-in2.h: Regenerate.
2859 * configure: Regenerate.
2860 * po/SRC-POTFILES.in: Regenerate.
2861
2862 2018-04-16 Alan Modra <amodra@gmail.com>
2863
2864 * Makefile.am: Remove i370 support.
2865 * archures.c: Likewise.
2866 * config.bfd: Likewise.
2867 * configure.ac: Likewise.
2868 * targets.c: Likewise.
2869 * cpu-i370.c: Delete.
2870 * elf32-i370.c: Delete.
2871 * Makefile.in: Regenerate.
2872 * bfd-in2.h: Regenerate.
2873 * configure: Regenerate.
2874 * po/SRC-POTFILES.in: Regenerate.
2875
2876 2018-04-16 Alan Modra <amodra@gmail.com>
2877
2878 * Makefile.am: Remove h8500 support.
2879 * archures.c: Likewise.
2880 * coffcode.h: Likewise.
2881 * config.bfd: Likewise.
2882 * configure.ac: Likewise.
2883 * targets.c: Likewise.
2884 * coff-h8500.c: Delete.
2885 * cpu-h8500.c: Delete.
2886 * Makefile.in: Regenerate.
2887 * bfd-in2.h: Regenerate.
2888 * configure: Regenerate.
2889 * po/SRC-POTFILES.in: Regenerate.
2890
2891 2018-04-16 Alan Modra <amodra@gmail.com>
2892
2893 * Makefile.am: Remove h8300-coff support.
2894 * coffcode.h: Likewise.
2895 * config.bfd: Likewise.
2896 * configure.ac: Likewise.
2897 * reloc16.c: Likewise.
2898 * targets.c: Likewise.
2899 * coff-h8300.c: Delete.
2900 * Makefile.in: Regenerate.
2901 * configure: Regenerate.
2902 * po/SRC-POTFILES.in: Regenerate.
2903
2904 2018-04-16 Alan Modra <amodra@gmail.com>
2905
2906 * Makefile.am: Remove IEEE 695 support.
2907 * archures.c: Likewise.
2908 * bfd.c: Likewise.
2909 * config.bfd: Likewise.
2910 * configure.ac: Likewise.
2911 * doc/bfd.texinfo: Likewise.
2912 * doc/bfdint.texi: Likewise.
2913 * doc/bfdsumm.texi: Likewise.
2914 * section.c: Likewise.
2915 * targets.c: Likewise.
2916 * ieee.c: Delete.
2917 * libieee.h: Delete.
2918 * Makefile.in: Regenerate.
2919 * bfd-in2.h: Regenerate.
2920 * configure: Regenerate.
2921 * po/SRC-POTFILES.in: Regenerate.
2922
2923 2018-04-16 Alan Modra <amodra@gmail.com>
2924
2925 * config.bfd: Remove tandem support.
2926
2927 2018-04-16 Alan Modra <amodra@gmail.com>
2928
2929 * Makefile.am: Remove newsos3 support.
2930 * aoutx.h: Likewise.
2931 * config.bfd: Likewise.
2932 * configure.ac: Likewise.
2933 * targets.c: Likewise.
2934 * newsos3.c: Delete.
2935 * Makefile.in: Regenerate.
2936 * configure: Regenerate.
2937 * po/SRC-POTFILES.in: Regenerate.
2938
2939 2018-04-16 Alan Modra <amodra@gmail.com>
2940
2941 * Makefile.am: Remove netware support.
2942 * bfd-in.h: Likewise.
2943 * bfd.c: Likewise.
2944 * config.bfd: Likewise.
2945 * configure.ac: Likewise.
2946 * doc/bfdint.texi: Likewise.
2947 * ecoff.c: Likewise.
2948 * targets.c: Likewise.
2949 * libnlm.h: Delete.
2950 * nlm-target.h: Delete.
2951 * nlm.c: Delete.
2952 * nlm32-alpha.c: Delete.
2953 * nlm32-i386.c: Delete.
2954 * nlm32-ppc.c: Delete.
2955 * nlm32-sparc.c: Delete.
2956 * nlm32.c: Delete.
2957 * nlm64.c: Delete.
2958 * nlmcode.h: Delete.
2959 * nlmswap.h: Delete.
2960 * Makefile.in: Regenerate.
2961 * bfd-in2.h: Regenerate.
2962 * configure: Regenerate.
2963 * po/SRC-POTFILES.in: Regenerate.
2964
2965 2018-04-16 Alan Modra <amodra@gmail.com>
2966
2967 * archures.c: Remove tahoe support.
2968 * config.bfd: Likewise.
2969 * configure.ac: Likewise.
2970 * hosts/tahoe.h: Delete.
2971 * bfd-in2.h: Regenerate.
2972 * configure: Regenerate.
2973
2974 2018-04-14 Alan Modra <amodra@gmail.com>
2975
2976 * elf-bfd.h (struct elf_backend_data): Add relropagesize.
2977 * elfxx-target.h (ELF_RELROPAGESIZE): Provide default and
2978 sanity test.
2979 (elfNN_bed): Init relropagesize.
2980 * bfd.c (bfd_emul_get_commonpagesize): Add boolean param to
2981 select relropagesize.
2982 * elf32-ppc.c (ELF_COMMONPAGESIZE): Define as 0x1000.
2983 (ELF_RELROPAGESIZE): Define as ELF_MAXPAGESIZE.
2984 (ELF_MINPAGESIZE): Don't define.
2985 * elf64-ppc.c (ELF_COMMONPAGESIZE): Define as 0x1000.
2986 (ELF_RELROPAGESIZE): Define as ELF_MAXPAGESIZE.
2987 * bfd-in2.h: Regenerate.
2988
2989 2018-04-14 Alan Modra <amodra@gmail.com>
2990
2991 * elf32-ppc.c (ELF_MAXPAGESIZE, ELF_COMMONPAGESIZE): Don't depend
2992 on __QNXTARGET__ define.
2993
2994 2018-04-14 Alan Modra <amodra@gmail.com>
2995
2996 * config.bfd: Add powerpc-*-lynxos* and powerpc-*-windiss*
2997 to obsolete list.
2998
2999 2018-04-11 Alan Modra <amodra@gmail.com>
3000
3001 * aout-adobe.c: Delete.
3002 * bout.c: Delete.
3003 * coff-i860.c: Delete.
3004 * coff-i960.c: Delete.
3005 * cpu-i860.c: Delete.
3006 * cpu-i960.c: Delete.
3007 * elf32-i860.c: Delete.
3008 * elf32-i960.c: Delete.
3009 * hosts/i860mach3.h: Delete.
3010 * Makefile.am: Remove i860, i960, bout, and adobe support.
3011 * archures.c: Remove i860 and i960 support.
3012 * coffcode.h: Likewise.
3013 * reloc.c: Likewise.
3014 * aoutx.h: Comment updates.
3015 * archive.c: Remove BOUT and i960 support.
3016 * bfd.c: Remove BOUT support.
3017 * coffswap.h: Remove i960 support.
3018 * config.bfd: Remove i860, i960 and adobe targets.
3019 * configure.ac: Remove adode, bout, i860, i960, icoff targets.
3020 * targets.c: Likewise.
3021 * ieee.c: Remove i960 support.
3022 * mach-o.c: Remove i860 support.
3023 * Makefile.in: Regenerate.
3024 * bfd-in2.h: Regenerate.
3025 * configure: Regenerate.
3026 * libbfd.h: Regenerate.
3027 * po/SRC-POTFILES.in: Regenerate.
3028
3029 2018-04-09 Maciej W. Rozycki <macro@mips.com>
3030
3031 * elf64-mips.c (mips_elf64_write_rel): Handle a NULL BFD pointer
3032 in the BFD symbol referred by the relocation.
3033 (mips_elf64_write_rela): Likewise.
3034
3035 2018-04-09 Maciej W. Rozycki <macro@mips.com>
3036
3037 * elf64-mips.c (mips_elf64_slurp_one_reloc_table): Issue an
3038 error for out-of-range `r_sym' values.
3039
3040 2018-04-09 Alan Modra <amodra@gmail.com>
3041
3042 * elf64-ppc.c (struct _ppc64_elf_section_data): Add has_pltcall field.
3043 (struct ppc_link_hash_table): Add can_convert_all_inline_plt.
3044 (ppc64_elf_check_relocs): Set has_pltcall.
3045 (ppc64_elf_adjust_dynamic_symbol): Discard some PLT entries.
3046 (ppc64_elf_inline_plt): New function.
3047 (ppc64_elf_size_dynamic_sections): Discard some PLT entries for locals.
3048 * elf64-ppc.h (ppc64_elf_inline_plt): Declare.
3049 * elf32-ppc.c (has_pltcall): Define.
3050 (struct ppc_elf_link_hash_table): Add can_convert_all_inline_plt.
3051 (ppc_elf_check_relocs): Set has_pltcall.
3052 (ppc_elf_inline_plt): New function.
3053 (ppc_elf_adjust_dynamic_symbol): Discard some PLT entries.
3054 (ppc_elf_size_dynamic_sections): Likewise.
3055 * elf32-ppc.h (ppc_elf_inline_plt): Declare.
3056
3057 2018-04-09 Alan Modra <amodra@gmail.com>
3058
3059 * elf32-ppc.c (ppc_elf_howto_raw): Add PLTSEQ and PLTCALL howtos.
3060 (is_plt_seq_reloc): New function.
3061 (ppc_elf_check_relocs): Handle PLTSEQ and PLTCALL relocs.
3062 (ppc_elf_tls_optimize): Handle inline plt call sequence.
3063 (ppc_elf_relax_section): Handle PLTCALL reloc.
3064 (ppc_elf_relocate_section): Nop out inline plt call sequence when
3065 resolving locally.
3066 * elf64-ppc.c (ppc64_elf_howto_raw): Add R_PPC64_PLTSEQ and
3067 R_PPC64_PLTCALL entries. Comment R_PPC64_TOCSAVE.
3068 (has_tls_get_addr_call): Correct comment.
3069 (is_branch_reloc): Add PLTCALL.
3070 (is_plt_seq_reloc): New function.
3071 (ppc64_elf_check_relocs): Handle PLT16_LO_DS reloc. Set
3072 has_tls_reloc for R_PPC64_TLSGD and R_PPC64_TLSLD. Create plt
3073 entry for R_PPC64_PLTCALL.
3074 (ppc64_elf_tls_optimize): Handle inline plt call sequence.
3075 (ppc_type_of_stub): Handle PLTCALL reloc.
3076 (toc_adjusting_stub_needed): Likewise.
3077 (ppc64_elf_relocate_section): Set "can_plt_call" for PLTCALL
3078 reloc insn. Nop out inline plt call sequence when resolving
3079 locally. Handle __tls_get_addr inline plt call optimization.
3080
3081 2018-04-09 Alan Modra <amodra@gmail.com>
3082
3083 * elf64-ppc.c (LOCAL_PLT_ENTRY_SIZE): Define.
3084 (struct ppc_stub_hash_entry): Add symtype field.
3085 (PLT_KEEP): Define.
3086 (struct ppc_link_hash_table): Add pltlocal and relpltlocal.
3087 (create_linkage_sections): Create pltlocal and relpltlocal.
3088 (ppc64_elf_check_relocs): Allow PLT relocs on local symbols.
3089 Set PLT_KEEP.
3090 (ppc64_elf_adjust_dynamic_symbol): Keep PLT entries for inline calls.
3091 (allocate_dynrelocs): Allocate pltlocal and relpltlocal.
3092 (ppc64_elf_size_dynamic_sections): Size pltlocal and relpltlocal.
3093 Keep PLT entries for inline calls against locals.
3094 (ppc_build_one_stub): Use pltlocal as appropriate.
3095 (ppc_size_one_stub): Likewise.
3096 (ppc64_elf_size_stubs): Set symtype.
3097 (build_global_entry_stubs_and_plt): Init pltlocal and write
3098 relpltlocal for globals.
3099 (write_plt_relocs_for_local_syms): Likewise for local syms.
3100 (ppc64_elf_relocate_section): Support PLT for local syms.
3101 * elf32-ppc.c (PLT_KEEP): Define.
3102 (struct ppc_elf_link_hash_table): Add pltlocal and relpltlocal.
3103 (ppc_elf_create_glink): Create pltlocal and relpltlocal.
3104 (ppc_elf_check_relocs): Allow PLT relocs on local symbols.
3105 Set PLT_KEEP. Adjust update_local_sym_info call.
3106 (ppc_elf_adjust_dynamic_symbol): Keep PLT entries for inline calls.
3107 (allocate_dynrelocs): Allocate pltlocal and relpltlocal.
3108 (ppc_elf_size_dynamic_sections): Size pltlocal and relpltlocal.
3109 (ppc_elf_relocate_section): Support PLT16 relocs for local syms.
3110 (write_global_sym_plt): Init pltlocal and write relpltlocal.
3111 (ppc_finish_symbols): Likewise for locals.
3112
3113 2018-04-09 Alan Modra <amodra@gmail.com>
3114
3115 * elf64-ppc.c (ppc_build_one_stub): Move output of PLT relocs
3116 for local symbols to..
3117 (write_plt_relocs_for_local_syms): ..here. New function.
3118 (ppc64_elf_finish_dynamic_symbol): Move output of PLT relocs for
3119 global symbols to..
3120 (build_global_entry_stubs_and_plt): ..here. Rename from
3121 build_global_entry_stubs.
3122 (ppc64_elf_build_stubs): Always call build_global_entry_stubs_and_plt.
3123 Call write_plt_relocs_for_local_syms.
3124 * elf32-ppc.c (get_sym_h): New function.
3125 (ppc_elf_relax_section): Use get_sym_h.
3126 (ppc_elf_relocate_section): Move output of PLT relocs and glink
3127 stubs for local symbols to..
3128 (ppc_finish_symbols): ..here. New function.
3129 (ppc_elf_finish_dynamic_symbol): Move output of PLT relocs for
3130 global syms to..
3131 (write_global_sym_plt): ..here. New function.
3132 * elf32-ppc.h (ppc_elf_modify_segment_map): Delete attribute.
3133 (ppc_finish_symbols): Declare.
3134
3135 2018-04-09 Alan Modra <amodra@gmail.com>
3136
3137 * elf32-ppc.c (ppc_elf_check_relocs): Handle PLT16 relocs.
3138 (ppc_elf_relocate_section): Likewise.
3139 * elf64-ppc.c (ppc64_elf_check_relocs): Handle PLT16_LO_DS.
3140 (ppc64_elf_relocate_section): Likewise. Correct PLT16
3141 resolution to plt entry relative to toc pointer.
3142
3143 2018-04-09 Alan Modra <amodra@gmail.com>
3144
3145 * elf64-ppc.c (TLS_TLS, TLS_GD, TLS_LD, TLS_TPREL, TLS_DTPREL,
3146 TLS_TPRELGD, TLS_EXPLICIT): Renumber. Test TLS_TLS throughout
3147 file when other TLS flags are tested in a mask.
3148 (TLS_MARK, NON_GOT): Define.
3149 (PLT_IFUNC): Redefine, and test TLS_TLS throughout file as well.
3150 (update_local_sym_info): Don't create got entry when NON_GOT.
3151 (ppc64_elf_check_relocs): Pass NON_GOT with PLT_IFUNC.
3152 Set TLS_MARK.
3153 (get_tls_mask): Do toc lookup if tls_mask is just TLS_MARK.
3154 (ppc64_elf_relocate_section): Likewise.
3155 (ppc64_elf_tls_optimize): Don't attempt to optimize indirect
3156 __tls_get_addr calls lacking a marker reloc.
3157 * elf32-ppc.c (TLS_TLS, TLS_GD, TLS_LD, TLS_TPREL, TLS_DTPREL,
3158 TLS_TPRELGD): Renumber. Update comment.
3159 (TLS_MARK, NON_GOT): Define.
3160 (PLT_IFUNC): Redefine, and test TLS_TLS throughout file as well.
3161 (update_local_sym_info): Don't create got entry when NON_GOT.
3162 (ppc_elf_check_relocs): Pass NON_GOT with PLT_IFUNC.
3163 Set TLS_MARK.
3164 (ppc_elf_tls_optimize): Don't attempt to optimize indirect
3165 __tls_get_addr calls lacking a marker reloc.
3166
3167 2018-04-06 H.J. Lu <hongjiu.lu@intel.com>
3168
3169 * elf64-x86-64.c (elf_x86_64_info_to_howto): Don't mask out
3170 R_X86_64_converted_reloc_bit.
3171
3172 2018-04-05 H.J. Lu <hongjiu.lu@intel.com>
3173
3174 PR gas/22318
3175 * configure: Regenerated.
3176
3177 2018-04-05 Alan Modra <amodra@gmail.com>
3178
3179 * elf-hppa.h (elf_hppa_info_to_howto): Init howto to NULL.
3180 (elf_hppa_info_to_howto_rel): Likewise.
3181
3182 2018-04-04 Maciej W. Rozycki <macro@mips.com>
3183
3184 * elf-hppa.h (elf_hppa_info_to_howto): Also return
3185 unsuccessfully for unimplemented relocations.
3186 (elf_hppa_info_to_howto_rel): Likewise.
3187
3188 2018-04-04 Maciej W. Rozycki <macro@mips.com>
3189
3190 * elf32-i860.c (lookup_howto): Add `abfd' parameter. Set the
3191 `bfd_error_bad_value' error and call `_bfd_error_handler' on a
3192 howto lookup failure.
3193 (elf32_i860_reloc_type_lookup): Adjust `lookup_howto' call
3194 accordingly.
3195 (elf32_i860_info_to_howto_rela): Likewise.
3196 (elf32_i860_relocate_splitn): Likewise.
3197 (elf32_i860_relocate_pc16): Likewise.
3198 (elf32_i860_relocate_pc26): Likewise.
3199 (elf32_i860_relocate_section): Likewise.
3200
3201 2018-04-04 Maciej W. Rozycki <macro@mips.com>
3202
3203 * elf32-visium.c (visium_info_to_howto_rela): Correct the range
3204 check for `visium_elf_howto_table' table access.
3205
3206 2018-04-04 Maciej W. Rozycki <macro@mips.com>
3207
3208 * elf32-iq2000.c (iq2000_info_to_howto_rela): Correct the range
3209 check for `iq2000_elf_howto_table' table access.
3210
3211 2018-04-04 Maciej W. Rozycki <macro@mips.com>
3212
3213 * elf32-frv.c (frv_info_to_howto_rela): Correct the range check
3214 for `elf32_frv_howto_table' table access.
3215
3216 2018-04-04 Maciej W. Rozycki <macro@mips.com>
3217
3218 * elf32-mips.c (mips_elf32_rtype_to_howto): Also return
3219 unsuccessfully for placeholder howtos.
3220 * elf64-mips.c (mips_elf64_rtype_to_howto): Likewise.
3221 * elfn32-mips.c (mips_elf_n32_rtype_to_howto): Likewise.
3222
3223 2018-03-29 Maciej W. Rozycki <macro@mips.com>
3224
3225 * elf32-mips.c (mips_info_to_howto_rel): Remove the calls to
3226 `_bfd_error_handler' and to set the `bfd_error_bad_value' error.
3227
3228 2018-03-28 Maciej W. Rozycki <macro@mips.com>
3229
3230 * elf-hppa.h (elf_hppa_info_to_howto_rel): Remove
3231 ATTRIBUTE_UNUSED from `abfd'.
3232
3233 2018-03-28 Maciej W. Rozycki <macro@mips.com>
3234
3235 * elf-hppa.h (elf_hppa_info_to_howto_rel): Correct
3236 `_bfd_error_handler' call formatting.
3237
3238 2018-03-28 Maciej W. Rozycki <macro@mips.com>
3239
3240 * elf32-mips.c (mips_info_to_howto_rel): Call
3241 `mips_elf32_rtype_to_howto' directly rather than via
3242 `->elf_backend_mips_rtype_to_howto'.
3243
3244 2018-03-28 Renlin Li <renlin.li@arm.com>
3245
3246 PR ld/22970
3247 * elfnn-aarch64.c (IS_AARCH64_TLS_RELOC): Add cases for
3248 BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12,
3249 BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12_NC,
3250 BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12,
3251 BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12_NC,
3252 BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12,
3253 BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12_NC,
3254 BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12,
3255 BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12_NC.
3256 (elfNN_aarch64_final_link_relocate): Support new relocations.
3257 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Support new
3258 relocations.
3259 (_bfd_aarch64_elf_resolve_relocation): Support new relocations.
3260
3261 2018-03-28 Renlin Li <renlin.li@arm.com>
3262
3263 PR ld/22970
3264 * reloc.c: Add BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12
3265 BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12_NC,
3266 BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12,
3267 BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12_NC,
3268 BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12,
3269 BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12_NC,
3270 BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12,
3271 BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12_NC,
3272 BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12,
3273 BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12_NC.
3274 * elfnn-aarch64.c (elfNN_aarch64_howto_table): Add table entry for
3275 TLSLE_LDST16_TPREL_LO12,
3276 TLSLE_LDST16_TPREL_LO12_NC,
3277 TLSLE_LDST32_TPREL_LO12,
3278 TLSLE_LDST32_TPREL_LO12_NC,
3279 TLSLE_LDST64_TPREL_LO12,
3280 TLSLE_LDST64_TPREL_LO12_NC,
3281 TLSLE_LDST8_TPREL_LO12,
3282 TLSLE_LDST8_TPREL_LO12_NC.
3283 * bfd-in2.h: Regenerated.
3284 * libbfd.h: Regenerated.
3285
3286 2018-03-28 Eric Botcazou <ebotcazou@adacore.com>
3287
3288 PR ld/22972
3289 * elfxx-sparc.c (struct _bfd_sparc_elf_link_hash_entry): Add new flag
3290 has_old_style_got_reloc.
3291 (_bfd_sparc_elf_check_relocs) <GOT relocations>: Set it for old-style
3292 relocations. Fix a couple of long lines.
3293 (_bfd_sparc_elf_relocate_section) <R_SPARC_GOTDATA_OP>: Do not generate
3294 a R_SPARC_NONE for the GOT slot if the symbol is also subject to old-style
3295 GOT relocations.
3296
3297 2018-03-25 H.J. Lu <hongjiu.lu@intel.com>
3298
3299 PR ld/23000
3300 * elf64-x86-64.c (elf_x86_64_finish_dynamic_sections): Add
3301 ENDBR64 to the TLSDESC PLT entry.
3302
3303 2018-03-21 Alan Modra <amodra@gmail.com>
3304
3305 * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Trim uninteresting
3306 symbols. Use size_t counts. Delete redundant opd test.
3307
3308 2018-03-21 Alan Modra <amodra@gmail.com>
3309
3310 * elf32-ppc.c (ppc_elf_tls_optimize): Delete locsyms.
3311
3312 2018-03-21 Alan Modra <amodra@gmail.com>
3313
3314 * elf32-ppc.c (struct ppc_elf_link_hash_entry): Make tls_mask
3315 field unsigned.
3316 (update_local_sym_info): Likewise for local_got_tls_masks.
3317 (ppc_elf_tls_optimize): Likewise for lgot_masks.
3318
3319 2018-03-21 Alan Modra <amodra@gmail.com>
3320
3321 * elf64-ppc.c (ppc_size_one_stub): Fix comment typo.
3322 (ppc64_elf_layout_multitoc): Allocate relocs for tprel as we
3323 do in size_dynamic_sections.
3324
3325 2018-03-21 Alan Modra <amodra@gmail.com>
3326
3327 * elf64-ppc.c (ppc64_elf_relocate_section): Don't access rel[1]
3328 without first checking array bounds.
3329 * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
3330
3331 2018-03-20 H.J. Lu <hongjiu.lu@intel.com>
3332
3333 PR ld/22983
3334 * elflink.c (bfd_elf_link_mark_dynamic_symbol): Set
3335 non_ir_ref_dynamic if a symbol is made dynamic by --dynamic-list.
3336
3337 2018-03-19 Nick Clifton <nickc@redhat.com>
3338
3339 * po/es.po: Updated Spanish translation.
3340
3341 2018-03-15 Max Filippov <jcmvbkbc@gmail.com>
3342
3343 * elf32-xtensa.c (xlate_map_entry): Change types of address
3344 fields from 'unsigned' to 'bfd_vma'.
3345 (xlate_offset_with_removed_text): Use struct xlate_map_entry as
3346 the key argument to bsearch. Allow offsets past the end of a
3347 section, use the last map entry for translation of such offsets.
3348
3349 2018-03-15 Kuan-Lin Chen <kuanlinchentw@gmail.com>
3350
3351 * elf32-nds32.c (nds32_elf_ex9_build_hash_table): Removed.
3352 Not support the target feature.
3353 (nds32_elf_ex9_itb_base): Likewise.
3354 (nds32_elf_ex9_import_table): Likewise.
3355 (nds32_elf_ex9_finish): Likewise.
3356 (nds32_elf_ex9_reloc_jmp): Likewise.
3357 (nds32_elf_get_insn_with_reg): Likewise.
3358 (nds32_get_local_syms): Likewise.
3359 (nds32_elf_ex9_replace_instruction): Likewise.
3360 (nds32_elf_ifc_calc): Likewise.
3361 (nds32_elf_ifc_finish): Likewise.
3362 (nds32_elf_ifc_replace): Likewise.
3363 (nds32_elf_ifc_reloc): Likewise.
3364
3365 2018-03-14 Alan Modra <amodra@gmail.com>
3366
3367 * elf64-ppc.c (sfpr_define): Adjust for stub_sec size having
3368 sfpr size added before defining alias symbols.
3369 (ppc64_elf_build_stubs): Add stub section padding before
3370 copying sfpr contents and defining save/restore alias symbols.
3371
3372 2018-03-14 H.J. Lu <hongjiu.lu@intel.com>
3373
3374 PR ld/20882
3375 * elflink.c (elf_gc_mark_debug_section): Also check the local
3376 debug definition section.
3377
3378 2018-03-13 Nick Clifton <nickc@redhat.com>
3379
3380 PR 22113
3381 * pei-x86_64.c (pex64_get_unwind_info): Change to a boolean
3382 function. Add an end address parameter. Check access of the data
3383 pointer to make sure that they do not extend beyond the end
3384 address. Return FALSE if any check fails. Add the end address
3385 pointer to the ui structure.
3386 (pex64_xdata_print_uwd_codes): Check accesses of the raw unwind
3387 codes to make sure that they do not extend beyond the end address
3388 pointer. Print an error message and return immediately if any
3389 check fails.
3390
3391 2018-03-09 Nick Clifton <nickc@redhat.com>
3392
3393 * elf64-s390.c (elf_s390_relocate_section): Move check for
3394 relocations against non-allocated sections to before the code that
3395 handles ifunc relocations.
3396 * elf32-s390.c (elf_s390_relocate_section): Likewise.
3397 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Treat
3398 relocs against IFUNC symbols in non-allocated sections as relocs
3399 against FUNC symbols.
3400 * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Likewise.
3401
3402 2018-03-08 H.J. Lu <hongjiu.lu@intel.com>
3403
3404 PR ld/22929
3405 * elf32-i386.c (elf_i386_relocate_section): Treat relocation
3406 against IFUNC symbol in SHT_NOTE section without SHF_ALLOC as
3407 relocation against FUNC symbol.
3408 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
3409
3410 2018-03-07 Renlin Li <renlin.li@arm.com>
3411
3412 PR ld/20402
3413 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Check absolute
3414 symbol, and don't emit relocation in specific case.
3415
3416 2018-03-07 Alan Modra <amodra@gmail.com>
3417
3418 * elf64-mips.c (mips_elf64_rtype_to_howto): Return NULL on error.
3419 (mips_elf64_slurp_one_reloc_table): Pass on error.
3420
3421 2018-03-03 James Cowgill <james.cowgill@mips.com>
3422 Maciej W. Rozycki <macro@mips.com>
3423
3424 PR ld/21900
3425 * elfxx-mips.c (mips_elf_calculate_relocation): Only return
3426 after calling `undefined_symbol' hook if this is an error
3427 condition. Assume the value of 0 for the symbol requested
3428 otherwise.
3429
3430 2018-03-02 Jim Wilson <jimw@sifive.com>
3431
3432 PR 22903
3433 * elfnn-aarch64.c (_bfd_aarch64_resize_stubs): Add 8 bytes for branch
3434 and nop instead of 4.
3435 (elfNN_arch64_build_stubs): Add nop after branch. Increase size by
3436 8 instead of 4.
3437
3438 2018-03-01 Jim Wilson <jimw@sifive.com>
3439
3440 PR 22756
3441 * elfnn-riscv.c (riscv_relax_delete_bytes): When adjust st_size, use
3442 else if instead of if.
3443
3444 2018-03-01 Alan Modra <amodra@gmail.com>
3445
3446 * elf32-ft32.c (ft32_info_to_howto_rela): Correct range test.
3447
3448 2018-02-28 Alan Modra <amodra@gmail.com>
3449
3450 PR 22887
3451 * aoutx.h (swap_std_reloc_in): Correct r_index bound check.
3452
3453 2018-02-28 Nick Clifton <nickc@redhat.com>
3454
3455 PR 22895
3456 PR 22893
3457 * dwarf2.c (read_n_bytes): Replace size parameter with dwarf_block
3458 pointer. Drop unused abfd parameter. Check the size of the block
3459 before initialising the data field. Return the end pointer if the
3460 size is invalid.
3461 (read_attribute_value): Adjust invocations of read_n_bytes.
3462
3463 PR 22894
3464 * dwarf1.c (parse_die): Check the length of form blocks before
3465 advancing the data pointer.
3466
3467 2018-02-28 Alan Modra <amodra@gmail.com>
3468
3469 PR 22887
3470 * aoutx.h (translate_symbol_table): Print an error message and set
3471 bfd_error on finding an invalid name string offset.
3472
3473 2018-02-27 H.J. Lu <hongjiu.lu@intel.com>
3474
3475 * config.in: Regenerated.
3476 * configure: Likewise.
3477 * configure.ac: Add --enable-separate-code.
3478 (DEFAULT_LD_Z_SEPARATE_CODE): New AC_DEFINE_UNQUOTED. Default
3479 to 1 for Linux/x86 targets,
3480 * elf64-x86-64.c (ELF_MAXPAGESIZE): Set to 0x1000 if
3481 DEFAULT_LD_Z_SEPARATE_CODE is 1.
3482
3483 2018-02-27 Nick Clifton <nickc@redhat.com>
3484
3485 * aout-cris.c (swap_ext_reloc_out): Standadize error/warning
3486 message.
3487 * elf-hppa.h (elf_hppa_info_to_howto_rel): Likewise.
3488 * elf32-i386.c (elf_i386_reloc_type_lookup): Likewise.
3489 * elf32-xtensa.c (elf_xtensa_reloc_type_lookup): Likewise.
3490 * elf64-ppc.c (ppc64_elf_reloc_type_lookup): Likewise.
3491 * elf64-s390.c (elf_s390_reloc_type_lookup): Likewise.
3492 * elf64-sh64.c (sh_elf64_info_to_howto): Likewise.
3493 * elfxx-ia64.c (ia64_elf_reloc_type_lookup): Likewise.
3494 * elfxx-sparc.c (_bfd_sparc_elf_reloc_type_lookup): Likewise.
3495 * elfxx-tilegx.c (tilegx_reloc_type_lookup): Likewise.
3496
3497 PR 22875
3498 * elf-bfd.h (struct elf_backend_data): Change the return type of
3499 the elf_info_to_howto and elf_info_to_howto_rel function pointers
3500 to bfd_boolean.
3501 * elfcode.h (elf_slurp_reloc_table_from_section): Check the return
3502 value from the info_to_howto function and fail if that function
3503 failed.
3504 * elf32-h8300.c (elf32_h8_relocate_section): Check return value
3505 from the info_to_howto function.
3506 (elf32_h8_relax_section): Likewise.
3507 * elf32-lm32.c (lm32_elf_relocate_section): Likewise.
3508 * elf32-m68hc1x.c (elf32_m68hc11_relocate_section): Likewise.
3509 * elf32-score.c (s3_bfd_score_elf_relocate_section): Likewise.
3510 * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
3511 * elf32-tic6x.c (elf32_tic6x_relocate_section): Likewise.
3512 * elf64-ia64-vms.c (elf64_ia64_relocate_section): Likewise.
3513 * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Likewise.
3514 * elf64-x86-64.c (elf_x86_64_tls_transition): Likewise.
3515 * elfnn-ia64.c (elfNN_ia64_relocate_section): Likewise.
3516 * elfnn-riscv.c (riscv_elf_check_relocs): Likewise.
3517 (riscv_elf_relocate_section): Likewise.
3518 * elf-hppa.h (elf_hppa_info_to_howto): Change return type to
3519 bfd_boolean. Issue an error message, set an error value and
3520 return FALSE if the reloc is not recognized.
3521 (elf_hppa_info_to_howto_rel): Likewise.
3522 * elf-m10200.c (mn10200_info_to_howto): Likewise.
3523 * elf-m10300.c (mn10300_info_to_howto): Likewise.
3524 * elf.c (_bfd_elf_no_info_to_howto): Likewise.
3525 * elf32-arc.c (arc_info_to_howto_rel): Likewise.
3526 * elf32-arm.c (elf32_arm_info_to_howto): Likewise.
3527 * elf32-avr.c (avr_info_to_howto_rela): Likewise.
3528 * elf32-bfin.c (bfin_info_to_howto): Likewise.
3529 * elf32-cr16.c (elf_cr16_info_to_howto): Likewise.
3530 * elf32-cr16c.c (elf_cr16c_info_to_howto): Likewise.
3531 * elf32-cris.c (elf_cr16c_info_to_howto_rel)
3532 (cris_info_to_howto_rela): Likewise.
3533 * elf32-crx.c (elf_crx_info_to_howto): Likewise.
3534 * elf32-d10v.c (d10v_info_to_howto_rel): Likewise.
3535 * elf32-d30v.c (d30v_info_to_howto_rel, d30v_info_to_howto_rela):
3536 Likewise.
3537 * elf32-dlx.c (dlx_rtype_to_howto, elf32_dlx_info_to_howto)
3538 (elf32_dlx_info_to_howto_rel): Likewise.
3539 * elf32-epiphany.c (epiphany_info_to_howto_rela): Likewise.
3540 * elf32-fr30.c (fr30_info_to_howto_rela): Likewise.
3541 * elf32-frv.c (frv_info_to_howto_rela)
3542 (frvfdpic_info_to_howto_rel): Likewise.
3543 * elf32-ft32.c (ft32_info_to_howto_rela): Likewise.
3544 * elf32-gen.c (elf_generic_info_to_howto)
3545 (elf_generic_info_to_howto_rel): Likewise.
3546 * elf32-h8300.c (elf32_h8_info_to_howto)
3547 (elf32_h8_info_to_howto_rel): Likewise.
3548 * elf32-i370.c (i370_elf_info_to_howto): Likewise.
3549 * elf32-i386.c (elf_i386_reloc_type_lookup)
3550 (elf_i386_rtype_to_howto, elf_i386_info_to_howto_rel): Likewise.
3551 * elf32-i860.c (lookup_howto, elf32_i860_info_to_howto_rela):
3552 Likewise.
3553 * elf32-i960.c (elf32_i960_info_to_howto_rel): Likewise.
3554 * elf32-ip2k.c (ip2k_info_to_howto_rela): Likewise.
3555 * elf32-iq2000.c (iq2000_info_to_howto_rela): Likewise.
3556 * elf32-lm32.c (lm32_info_to_howto_rela): Likewise.
3557 * elf32-m32c.c (m32c_info_to_howto_rela): Likewise.
3558 * elf32-m32r.c (m32r_info_to_howto_rel, m32r_info_to_howto):
3559 Likewise.
3560 * elf32-m68hc11.c (m68hc11_info_to_howto_rel): Likewise.
3561 * elf32-m68hc12.c (m68hc11_info_to_howto_rel): Likewise.
3562 * elf32-m68k.c (rtype_to_howto): Likewise.
3563 * elf32-mcore.c (mcore_elf_info_to_howto): Likewise.
3564 * elf32-mep.c (mep_info_to_howto_rela): Likewise.
3565 * elf32-metag.c (metag_info_to_howto_rela): Likewise.
3566 * elf32-microblaze.c (microblaze_elf_info_to_howto): Likewise.
3567 * elf32-mips.c (mips_info_to_howto_rel, mips_info_to_howto_rela):
3568 Likewise.
3569 * elf32-moxie.c (moxie_info_to_howto_rela): Likewise.
3570 * elf32-msp430.c (msp430_info_to_howto_rela): Likewise.
3571 * elf32-mt.c (mt_info_to_howto_rela): Likewise.
3572 * elf32-nds32.c (nds32_info_to_howto_rel, nds32_info_to_howto):
3573 Likewise.
3574 * elf32-nios2.c (nios2_elf32_info_to_howto): Likewise.
3575 * elf32-or1k.c (or1k_info_to_howto_rela): Likewise.
3576 * elf32-pj.c (pj_elf_info_to_howto): Likewise.
3577 * elf32-ppc.c (ppc_elf_info_to_howto): Likewise.
3578 * elf32-pru.c (pru_elf32_info_to_howto): Likewise.
3579 * elf32-rl78.c (rl78_info_to_howto_rela): Likewise.
3580 * elf32-rx.c (rx_info_to_howto_rela): Likewise.
3581 * elf32-s390.c (elf_s390_info_to_howto): Likewise.
3582 * elf32-score.c (s3_bfd_score_info_to_howto)
3583 (_bfd_score_info_to_howto): Likewise.
3584 * elf32-score7.c (s7_bfd_score_info_to_howto): Likewise.
3585 * elf32-sh.c (sh_elf_info_to_howto): Likewise.
3586 * elf32-spu.c (spu_elf_info_to_howto): Likewise.
3587 * elf32-tic6x.c (elf32_tic6x_info_to_howto)
3588 (elf32_tic6x_info_to_howto_rel): Likewise.
3589 * elf32-tilepro.c (tilepro_info_to_howto_rela): Likewise.
3590 * elf32-v850.c (v850_elf_info_to_howto_rel)
3591 (v850_elf_info_to_howto_rela, v800_elf_info_to_howto): Likewise.
3592 * elf32-vax.c (rtype_to_howto): Likewise.
3593 * elf32-visium.c (visium_info_to_howto_rela): Likewise.
3594 * elf32-wasm32.c (elf32_wasm32_rtype_to_howto)
3595 (elf32_wasm32_info_to_howto_rela): Likewise.
3596 * elf32-xc16x.c (elf32_xc16x_info_to_howto): Likewise.
3597 * elf32-xgate.c (xgate_info_to_howto_rel): Likewise.
3598 * elf32-xstormy16.c (xstormy16_info_to_howto_rela): Likewise.
3599 * elf32-xtensa.c (elf_xtensa_info_to_howto_rela): Likewise.
3600 * elf64-alpha.c (elf64_alpha_info_to_howto): Likewise.
3601 * elf64-gen.c (elf_generic_info_to_howto)
3602 (elf_generic_info_to_howto_rel): Likewise.
3603 * elf64-ia64-vms.c (elf64_ia64_info_to_howto): Likewise.
3604 * elf64-mips.c (mips_elf64_info_to_howto_rela): Likewise.
3605 * elf64-mmix.c (mmix_info_to_howto_rela): Likewise.
3606 * elf64-ppc.c (ppc64_elf_info_to_howto): Likewise.
3607 * elf64-s390.c (elf_s390_reloc_type_lookup): Likewise.
3608 * elf64-sh64.c (elf_s390_info_to_howto, sh_elf64_info_to_howto):
3609 Likewise.
3610 * elf64-x86-64.c (elf_x86_64_info_to_howto): Likewise.
3611 * elfn32-mips.c (mips_info_to_howto_rel, mips_info_to_howto_rela):
3612 Likewise.
3613 * elfnn-aarch64.c (elfNN_aarch64_info_to_howto): Likewise.
3614 * elfnn-ia64.c (elfNN_ia64_info_to_howto): Likewise.
3615 * elfnn-riscv.c (riscv_info_to_howto_rela): Likewise.
3616 * elfxx-ia64.c (ia64_elf_reloc_type_lookup): Likewise.
3617 * elfxx-sparc.c (_bfd_sparc_elf_info_to_howto): Likewise.
3618 * elfxx-tilegx.c (tilegx_info_to_howto_rela): Likewise.
3619 * elf32-score.h (s7_bfd_score_info_to_howto): Update prototype.
3620 * elfxx-sparc.h (_bfd_sparc_elf_info_to_howto): Update prototype.
3621 * elfxx-tilegx.h (tilegx_info_to_howto_rela): Update prototype.
3622 * elfxx-target.h (elf_info_to_howto, elf_info_to_howto_rel):
3623 Default to NULL.
3624
3625 2018-02-26 Jim Wilson <jimw@sifive.com>
3626 Stephan Schreiber <info@fs-driver.org>
3627
3628 PR 15904
3629 * elfnn-ia64.c (elfNN_ia64_relax_section): After ia64_elf_relax_brl
3630 call, set changed_contents and changed_relocs. Likewise after
3631 successful ia64_elf_relax_br call.
3632
3633 2018-02-26 Alan Modra <amodra@gmail.com>
3634
3635 * elf.c (assign_file_positions_except_relocs): Don't segfault
3636 when actual number of phdrs is less than allocated. Delete
3637 outdated comment. Formatting.
3638
3639 2018-02-26 Alan Modra <amodra@gmail.com>
3640
3641 * elf-m10300.c, * elf-s390-common.c, * elf32-arc.c, * elf32-cris.c,
3642 * elf32-dlx.c, * elf32-frv.c, * elf32-i370.c, * elf32-lm32.c,
3643 * elf32-m32r.c, * elf32-m68hc1x.c, * elf32-m68k.c,
3644 * elf32-microblaze.c, * elf32-msp430.c, * elf32-nds32.c,
3645 * elf32-nios2.c, * elf32-or1k.c, * elf32-rl78.c, * elf32-rx.c,
3646 * elf32-score.c, * elf32-score7.c, * elf32-sh-symbian.c,
3647 * elf32-sh.c, * elf32-spu.c, * elf32-v850.c, * elf32-xtensa.c,
3648 * elf64-alpha.c, * elf64-ia64-vms.c, * elf64-mmix.c,
3649 * elf64-sh64.c, * elf64-sparc.c, * elfnn-ia64.c, * elfxx-tilegx.c,
3650 * mmo.c, * osf-core.c, * srec.c, * vms-alpha.c: Standardize
3651 error/warning messages.
3652
3653 2018-02-26 Alan Modra <amodra@gmail.com>
3654
3655 * archive.c, * bfd.c, * linker.c, * reloc.c, * stabs.c,
3656 * syms.c: Standardize error/warning messages.
3657
3658 2018-02-26 Alan Modra <amodra@gmail.com>
3659
3660 * aout-adobe.c, * aout-cris.c, * i386linux.c, * m68klinux.c,
3661 * sparclinux.c, * coff-alpha.c, * coff-arm.c, * coff-mcore.c,
3662 * coffcode.h, * coffgen.c, * cofflink.c, * ecoff.c, * pe-mips.c,
3663 * peXXigen.c, * peicode.h: Standardize error/warning messages.
3664
3665 2018-02-26 Alan Modra <amodra@gmail.com>
3666
3667 * elf32-arm.c, * elfnn-aarch64.c: Standardize error/warning messages.
3668
3669 2018-02-26 Alan Modra <amodra@gmail.com>
3670
3671 * elfxx-mips.c: Standardize error/warning messages.
3672
3673 2018-02-26 Alan Modra <amodra@gmail.com>
3674
3675 * dwarf2.c, * elf-attrs.c, * elf-eh-frame.c, * elf.c, * elf32-gen.c,
3676 * elflink.c: Standardize error/warning messages. Replace use of
3677 linker callback einfo with _bfd_error_handler when possible.
3678
3679 2018-02-26 Alan Modra <amodra@gmail.com>
3680
3681 * aoutx.h, * coff-alpha.c, * coff-i860.c, * coff-m68k.c,
3682 * coff-mcore.c, * coff-ppc.c, * coff-rs6000.c, * coff-sh.c,
3683 * coff-tic4x.c, * coff-tic54x.c, * coff-tic80.c, * coff-w65.c,
3684 * elf-bfd.h, * elf-m10300.c, * elf.c, * elf32-avr.c, * elf32-bfin.c,
3685 * elf32-cr16.c, * elf32-cr16c.c, * elf32-cris.c, * elf32-crx.c,
3686 * elf32-d10v.c, * elf32-d30v.c, * elf32-dlx.c, * elf32-epiphany.c,
3687 * elf32-fr30.c, * elf32-frv.c, * elf32-i370.c, * elf32-i386.c,
3688 * elf32-i960.c, * elf32-ip2k.c, * elf32-iq2000.c, * elf32-lm32.c,
3689 * elf32-m32c.c, * elf32-m32r.c, * elf32-m68hc11.c, * elf32-m68hc12.c,
3690 * elf32-m68k.c, * elf32-mcore.c, * elf32-mep.c, * elf32-metag.c,
3691 * elf32-microblaze.c, * elf32-mips.c, * elf32-moxie.c,
3692 * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c, * elf32-or1k.c,
3693 * elf32-pj.c, * elf32-ppc.c, * elf32-rl78.c, * elf32-rx.c,
3694 * elf32-s390.c, * elf32-sh.c, * elf32-spu.c, * elf32-tic6x.c,
3695 * elf32-v850.c, * elf32-vax.c, * elf32-visium.c, * elf32-wasm32.c,
3696 * elf32-xgate.c, * elf32-xtensa.c, * elf64-alpha.c,
3697 * elf64-ia64-vms.c, * elf64-mips.c, * elf64-mmix.c,
3698 * elf64-ppc.c, * elf64-s390.c, * elf64-sparc.c, * elf64-x86-64.c,
3699 * elfn32-mips.c, * elfnn-aarch64.c, * elfnn-ia64.c,
3700 * elfnn-riscv.c, * elfxx-mips.c, * elfxx-riscv.c, * elfxx-riscv.h,
3701 * elfxx-sparc.c, * elfxx-sparc.h, * reloc.c: Standardize
3702 unrecognized/unsupported reloc message.
3703
3704 2018-02-26 Alan Modra <amodra@gmail.com>
3705
3706 * elf32-ppc.c: Standardize error/warning messages. Use
3707 _bfd_error_handler rather than einfo when einfo features not used.
3708 * elf64-ppc.c: Likewise.
3709
3710 2018-02-23 Alan Modra <amodra@gmail.com>
3711
3712 PR 22881
3713 * elf.c (assign_file_positions_for_non_load_sections): Remove RELRO
3714 segment if no matching LOAD segment.
3715
3716 2018-02-23 Kuan-Lin Chen <kuanlinchentw@gmail.com>
3717
3718 * elf32-nds32.h: Define mask for ict_model.
3719
3720 2018-02-20 Jason Duerstock <jason.duerstock@gmail.com>
3721
3722 * elfnn-ia64.c (elf_backend_can_gc_sections): Enable.
3723
3724 2018-02-19 Maciej W. Rozycki <macro@mips.com>
3725
3726 Revert
3727 2018-01-12 Vlad Ivanov <vlad@ivanov.email>
3728
3729 * elfxx-mips.c (_bfd_mips_elf_final_link): Notify user when
3730 .reginfo section has wrong size.
3731
3732 2018-02-19 Maciej W. Rozycki <macro@mips.com>
3733
3734 * elfxx-mips.c (_bfd_mips_elf_always_size_sections): Set
3735 SEC_FIXED_SIZE and SEC_HAS_CONTENTS flags for `.reginfo' and
3736 `.MIPS.abiflags' sections.
3737 (_bfd_mips_elf_final_link): Avoid reading beyond `.reginfo'
3738 section's end.
3739
3740 2018-02-19 Maciej W. Rozycki <macro@mips.com>
3741
3742 * section.c (SEC_FIXED_SIZE): New macro.
3743 * bfd-in2.h: Regenerate.
3744
3745 2018-02-19 Maciej W. Rozycki <macro@mips.com>
3746
3747 * section.c (SEC_HAS_GOT_REF): Remove macro.
3748 * bfd-in2.h: Regenerate.
3749
3750 2018-02-19 Alan Modra <amodra@gmail.com>
3751
3752 * elf-attrs.c (_bfd_elf_parse_attributes): Correct _bfd_error_handler
3753 arguments.
3754 * elfxx-mips.c (_bfd_mips_elf_final_link): Likewise.
3755 * elfnn-riscv.c (_bfd_riscv_relax_align): Likewise.
3756 (_bfd_riscv_relax_pc): Likewise and fix typos.
3757 * libbfd-in.h (_bfd_error_handler): Add attribute printf.
3758 * libbfd.h: Regenerate.
3759
3760 2018-02-19 Alan Modra <amodra@gmail.com>
3761
3762 * dwarf2.c (read_section): Don't use 'll' format modifier.
3763 (find_abstract_instance): Likewise.
3764 * elfcore.h (elf_core_file_p): Likewise.
3765
3766 2018-02-19 Alan Modra <amodra@gmail.com>
3767
3768 * bfd-in.h: Include inttypes.h or if not available define
3769 PRId64, PRIu64 and PRIx64.
3770 * bfd.c (_bfd_doprnt, _bfd_doprnt_scan): Remove support for L
3771 modifier to print bfd_vma.
3772 * coff-arm.c, * coff-mcore.c, * coff-ppc.c, * coff-rs6000.c,
3773 * coff-sh.c, * coff-tic80.c, * coffcode.h, * coffgen.c, * cofflink.c,
3774 * compress.c, * dwarf2.c, * elf-m10300.c, * elf.c, * elf32-arc.c,
3775 * elf32-arm.c, * elf32-bfin.c, * elf32-cris.c, * elf32-hppa.c,
3776 * elf32-i386.c, * elf32-ip2k.c, * elf32-lm32.c, * elf32-m32r.c,
3777 * elf32-m68k.c, * elf32-metag.c, * elf32-nds32.c, * elf32-nios2.c,
3778 * elf32-ppc.c, * elf32-rx.c, * elf32-s390.c, * elf32-score.c,
3779 * elf32-score7.c, * elf32-sh.c, * elf32-sh64.c, * elf32-spu.c,
3780 * elf32-tic6x.c, * elf32-tilepro.c, * elf32-v850.c, * elf32-vax.c,
3781 * elf32-xtensa.c, * elf64-alpha.c, * elf64-hppa.c, * elf64-ia64-vms.c,
3782 * elf64-mmix.c, * elf64-s390.c, * elf64-sh64.c, * elf64-x86-64.c,
3783 * elfcode.h, * elfcore.h, * elflink.c, * elfnn-aarch64.c,
3784 * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-mips.c, * elfxx-sparc.c,
3785 * elfxx-tilegx.c, * ieee.c, * ihex.c, * mach-o.c, * merge.c, * mmo.c,
3786 * peXXigen.c, * xcofflink.c: Replace use of Lx modifier with PRIx64,
3787 and cast input to uint64_t, and similarly for Ld and Lu.
3788 * bfd-in2.h: Regenerate.
3789
3790 2018-02-19 Alan Modra <amodra@gmail.com>
3791
3792 * elf32-arm.c, * elf32-hppa.c, * elf32-lm32.c, * elf32-m32r.c,
3793 * elf32-metag.c, * elf32-nds32.c, * elf32-or1k.c, * elf32-ppc.c,
3794 * elf32-s390.c, * elf32-sh.c, * elf32-tic6x.c, * elf32-tilepro.c,
3795 * elf64-ppc.c, * elf64-s390.c, * elflink.c, * elfnn-aarch64.c,
3796 * elfnn-riscv.c, * elfxx-sparc.c, * elfxx-tilegx.c, * elfxx-x86.c,
3797 * reloc.c: Replace use of %R and %T in format strings passed to
3798 einfo and friends by %pR and %pT.
3799
3800 2018-02-19 Alan Modra <amodra@gmail.com>
3801
3802 * bfd.c (_bfd_doprnt, _bfd_doprnt_scan): Handle %pA and %pB in place
3803 of %A and %B.
3804 * aout-adobe.c: Update all messages using %A and %B.
3805 * aout-cris.c: Likewise.
3806 * aoutx.h: Likewise.
3807 * archive.c: Likewise.
3808 * binary.c: Likewise.
3809 * cache.c: Likewise.
3810 * coff-alpha.c: Likewise.
3811 * coff-arm.c: Likewise.
3812 * coff-i860.c: Likewise.
3813 * coff-mcore.c: Likewise.
3814 * coff-ppc.c: Likewise.
3815 * coff-rs6000.c: Likewise.
3816 * coff-sh.c: Likewise.
3817 * coff-tic4x.c: Likewise.
3818 * coff-tic54x.c: Likewise.
3819 * coff-tic80.c: Likewise.
3820 * coff64-rs6000.c: Likewise.
3821 * coffcode.h: Likewise.
3822 * coffgen.c: Likewise.
3823 * cofflink.c: Likewise.
3824 * coffswap.h: Likewise.
3825 * compress.c: Likewise.
3826 * cpu-arm.c: Likewise.
3827 * ecoff.c: Likewise.
3828 * elf-attrs.c: Likewise.
3829 * elf-eh-frame.c: Likewise.
3830 * elf-ifunc.c: Likewise.
3831 * elf-m10300.c: Likewise.
3832 * elf-properties.c: Likewise.
3833 * elf-s390-common.c: Likewise.
3834 * elf.c: Likewise.
3835 * elf32-arc.c: Likewise.
3836 * elf32-arm.c: Likewise.
3837 * elf32-avr.c: Likewise.
3838 * elf32-bfin.c: Likewise.
3839 * elf32-cr16.c: Likewise.
3840 * elf32-cr16c.c: Likewise.
3841 * elf32-cris.c: Likewise.
3842 * elf32-crx.c: Likewise.
3843 * elf32-d10v.c: Likewise.
3844 * elf32-d30v.c: Likewise.
3845 * elf32-epiphany.c: Likewise.
3846 * elf32-fr30.c: Likewise.
3847 * elf32-frv.c: Likewise.
3848 * elf32-gen.c: Likewise.
3849 * elf32-hppa.c: Likewise.
3850 * elf32-i370.c: Likewise.
3851 * elf32-i386.c: Likewise.
3852 * elf32-i960.c: Likewise.
3853 * elf32-ip2k.c: Likewise.
3854 * elf32-iq2000.c: Likewise.
3855 * elf32-lm32.c: Likewise.
3856 * elf32-m32c.c: Likewise.
3857 * elf32-m32r.c: Likewise.
3858 * elf32-m68hc11.c: Likewise.
3859 * elf32-m68hc12.c: Likewise.
3860 * elf32-m68hc1x.c: Likewise.
3861 * elf32-m68k.c: Likewise.
3862 * elf32-mcore.c: Likewise.
3863 * elf32-mep.c: Likewise.
3864 * elf32-metag.c: Likewise.
3865 * elf32-microblaze.c: Likewise.
3866 * elf32-moxie.c: Likewise.
3867 * elf32-msp430.c: Likewise.
3868 * elf32-mt.c: Likewise.
3869 * elf32-nds32.c: Likewise.
3870 * elf32-nios2.c: Likewise.
3871 * elf32-or1k.c: Likewise.
3872 * elf32-pj.c: Likewise.
3873 * elf32-ppc.c: Likewise.
3874 * elf32-rl78.c: Likewise.
3875 * elf32-rx.c: Likewise.
3876 * elf32-s390.c: Likewise.
3877 * elf32-score.c: Likewise.
3878 * elf32-score7.c: Likewise.
3879 * elf32-sh-symbian.c: Likewise.
3880 * elf32-sh.c: Likewise.
3881 * elf32-sh64.c: Likewise.
3882 * elf32-sparc.c: Likewise.
3883 * elf32-spu.c: Likewise.
3884 * elf32-tic6x.c: Likewise.
3885 * elf32-tilepro.c: Likewise.
3886 * elf32-v850.c: Likewise.
3887 * elf32-vax.c: Likewise.
3888 * elf32-visium.c: Likewise.
3889 * elf32-wasm32.c: Likewise.
3890 * elf32-xgate.c: Likewise.
3891 * elf32-xtensa.c: Likewise.
3892 * elf64-alpha.c: Likewise.
3893 * elf64-gen.c: Likewise.
3894 * elf64-hppa.c: Likewise.
3895 * elf64-ia64-vms.c: Likewise.
3896 * elf64-mmix.c: Likewise.
3897 * elf64-ppc.c: Likewise.
3898 * elf64-s390.c: Likewise.
3899 * elf64-sh64.c: Likewise.
3900 * elf64-sparc.c: Likewise.
3901 * elf64-x86-64.c: Likewise.
3902 * elfcode.h: Likewise.
3903 * elfcore.h: Likewise.
3904 * elflink.c: Likewise.
3905 * elfnn-aarch64.c: Likewise.
3906 * elfnn-ia64.c: Likewise.
3907 * elfnn-riscv.c: Likewise.
3908 * elfxx-mips.c: Likewise.
3909 * elfxx-sparc.c: Likewise.
3910 * elfxx-tilegx.c: Likewise.
3911 * elfxx-x86.c: Likewise.
3912 * hpux-core.c: Likewise.
3913 * ieee.c: Likewise.
3914 * ihex.c: Likewise.
3915 * libbfd.c: Likewise.
3916 * linker.c: Likewise.
3917 * mach-o.c: Likewise.
3918 * merge.c: Likewise.
3919 * mmo.c: Likewise.
3920 * oasys.c: Likewise.
3921 * pdp11.c: Likewise.
3922 * pe-mips.c: Likewise.
3923 * peXXigen.c: Likewise.
3924 * peicode.h: Likewise.
3925 * reloc.c: Likewise.
3926 * rs6000-core.c: Likewise.
3927 * srec.c: Likewise.
3928 * stabs.c: Likewise.
3929 * vms-alpha.c: Likewise.
3930 * xcofflink.c: Likewise.
3931
3932 2018-02-19 Alan Modra <amodra@gmail.com>
3933
3934 PR 22845
3935 * elf.c (IS_TBSS): Define.
3936 (_bfd_elf_map_sections_to_segments): Use IS_TBSS.
3937 (assign_file_positions_for_non_load_sections): Revert last change.
3938 Properly calculate load segment limits to compare against relro limits.
3939
3940 2018-02-17 Alan Modra <amodra@gmail.com>
3941
3942 PR 22845
3943 * elf.c (assign_file_positions_for_non_load_sections): Ignore
3944 degenerate zero size PT_LOAD segments when finding one overlapping
3945 the PT_GNU_RELRO segment.
3946
3947 2018-02-16 Alan Modra <amodra@gmail.com>
3948
3949 * libbfd.c (_bfd_bool_bfd_false_error): Rename from bfd_false.
3950 (_bfd_bool_bfd_true): Rename from bfd_true.
3951 (_bfd_ptr_bfd_null_error): Rename from bfd_nullvoidptr.
3952 (_bfd_int_bfd_0): Rename from bfd_0.
3953 (_bfd_uint_bfd_0): Rename from bfd_0u.
3954 (_bfd_long_bfd_0): Rename from bfd_0l.
3955 (_bfd_long_bfd_n1_error): Rename from _bfd_n1.
3956 (_bfd_void_bfd): Rename from bfd_void.
3957 (_bfd_bool_bfd_false, _bfd_bool_bfd_asymbol_false),
3958 (_bfd_bool_bfd_link_false_error),
3959 (_bfd_bool_bfd_link_true, _bfd_bool_bfd_bfd_true),
3960 (_bfd_bool_bfd_uint_true, _bfd_bool_bfd_ptr_true),
3961 (_bfd_bool_bfd_asection_bfd_asection_true),
3962 (_bfd_bool_bfd_asymbol_bfd_asymbol_true),
3963 (_bfd_void_bfd_link, _bfd_void_bfd_asection): New functions.
3964 * archive.c (_bfd_noarchive_get_elt_at_index),
3965 (_bfd_noarchive_openr_next_archived_file),
3966 (_bfd_noarchive_construct_extended_name_table),
3967 (_bfd_noarchive_write_ar_hdr, _bfd_noarchive_truncate_arname),
3968 (_bfd_noarchive_write_armap): New functions.
3969 * archures.c (_bfd_nowrite_set_arch_mach): New function.
3970 * coff-alpha.c (alpha_ecoff_swap_coff_aux_in),
3971 (alpha_ecoff_swap_coff_sym_in, alpha_ecoff_swap_coff_lineno_in),
3972 (alpha_ecoff_swap_coff_aux_out, alpha_ecoff_swap_coff_sym_out),
3973 (alpha_ecoff_swap_coff_lineno_out),
3974 (alpha_ecoff_swap_coff_reloc_out): New functions.
3975 * coff-mips.c (mips_ecoff_swap_coff_aux_in),
3976 (mips_ecoff_swap_coff_sym_in, mips_ecoff_swap_coff_lineno_in),
3977 (mips_ecoff_swap_coff_aux_out, mips_ecoff_swap_coff_sym_out),
3978 (mips_ecoff_swap_coff_lineno_out),
3979 (mips_ecoff_swap_coff_reloc_out): New functions.
3980 * coffcode.h (coff_set_alignment_hook): Replace define with
3981 new function.
3982 (symname_in_debug_hook): Likewise.
3983 * ecoff.c (_bfd_ecoff_set_alignment_hook): New function.
3984 * elfxx-target.h (elf_backend_allow_non_load_phdr): Default to 0.
3985 * elf.c (assign_file_positions_except_relocs): Test
3986 elf_backend_allow_non_load_phdr for NULL.
3987 * elflink.c (_bfd_elf_omit_section_dynsym_default): Rename from
3988 _bfd_elf_link_omit_section_dynsym. Update uses.
3989 (_bfd_elf_omit_section_dynsym_all): New function.
3990 * elf-bfd.h (_bfd_elf_link_omit_section_dynsym): Delete.
3991 (_bfd_elf_omit_section_dynsym_default): Declare.
3992 (_bfd_elf_omit_section_dynsym_all): Declare.
3993 * linker.c (_bfd_nolink_sizeof_headers, _bfd_nolink_bfd_relax_section),
3994 (_bfd_nolink_bfd_get_relocated_section_contents),
3995 (_bfd_nolink_bfd_lookup_section_flags),
3996 (_bfd_nolink_bfd_is_group_section, _bfd_nolink_bfd_discard_group),
3997 (_bfd_nolink_bfd_link_hash_table_create),
3998 (_bfd_nolink_bfd_link_just_syms),
3999 (_bfd_nolink_bfd_copy_link_hash_symbol_type),
4000 (_bfd_nolink_bfd_link_split_section),
4001 (_bfd_nolink_section_already_linked),
4002 (_bfd_nolink_bfd_define_common_symbol),
4003 (_bfd_nolink_bfd_define_start_stop): New functions.
4004 * reloc.c (_bfd_norelocs_bfd_reloc_type_lookup),
4005 (_bfd_norelocs_bfd_reloc_name_lookup),
4006 (_bfd_nodynamic_canonicalize_dynamic_reloc): New functions.
4007 * section.c (_bfd_nowrite_set_section_contents): New function.
4008 * syms.c (_bfd_nosymbols_canonicalize_symtab),
4009 (_bfd_nosymbols_print_symbol, _bfd_nosymbols_get_symbol_info),
4010 (_bfd_nosymbols_get_symbol_version_string),
4011 (_bfd_nosymbols_bfd_is_local_label_name),
4012 (_bfd_nosymbols_get_lineno, _bfd_nosymbols_find_nearest_line),
4013 (_bfd_nosymbols_find_line, _bfd_nosymbols_find_inliner_info),
4014 (_bfd_nosymbols_bfd_make_debug_symbol),
4015 ( _bfd_nosymbols_read_minisymbols),
4016 ( _bfd_nosymbols_minisymbol_to_symbol),
4017 (_bfd_nodynamic_get_synthetic_symtab): New functions.
4018 * libbfd-in.h: Declare new functions. Update existing defines,
4019 removing casts.
4020 * aix386-core.c: Update to use new hooks. Formatting.
4021 * aout-adobe.c: Likewise.
4022 * aout-arm.c: Likewise.
4023 * aout-target.h: Likewise.
4024 * aout-tic30.c: Likewise.
4025 * aoutf1.h: Likewise.
4026 * binary.c: Likewise.
4027 * bout.c: Likewise.
4028 * cisco-core.c: Likewise.
4029 * coff-alpha.c: Likewise.
4030 * coff-i386.c: Likewise.
4031 * coff-i860.c: Likewise.
4032 * coff-i960.c: Likewise.
4033 * coff-ia64.c: Likewise.
4034 * coff-mips.c: Likewise.
4035 * coff-ppc.c: Likewise.
4036 * coff-rs6000.c: Likewise.
4037 * coff-sh.c: Likewise.
4038 * coff-tic30.c: Likewise.
4039 * coff-tic54x.c: Likewise.
4040 * coff-x86_64.c: Likewise.
4041 * coff64-rs6000.c: Likewise.
4042 * coffcode.h: Likewise.
4043 * elf-m10300.c: Likewise.
4044 * elf32-cr16.c: Likewise.
4045 * elf32-lm32.c: Likewise.
4046 * elf32-m32r.c: Likewise.
4047 * elf32-metag.c: Likewise.
4048 * elf32-score.c: Likewise.
4049 * elf32-score7.c: Likewise.
4050 * elf32-tilepro.c: Likewise.
4051 * elf32-xstormy16.c: Likewise.
4052 * elf32-xtensa.c: Likewise.
4053 * elf64-alpha.c: Likewise.
4054 * elf64-hppa.c: Likewise.
4055 * elf64-ia64-vms.c: Likewise.
4056 * elf64-mmix.c: Likewise.
4057 * elf64-sh64.c: Likewise.
4058 * elfnn-ia64.c: Likewise.
4059 * elfxx-sparc.c: Likewise.
4060 * elfxx-target.h: Likewise.
4061 * elfxx-tilegx.c: Likewise.
4062 * elfxx-x86.h: Likewise.
4063 * hp300hpux.c: Likewise.
4064 * hppabsd-core.c: Likewise.
4065 * hpux-core.c: Likewise.
4066 * i386msdos.c: Likewise.
4067 * i386os9k.c: Likewise.
4068 * ieee.c: Likewise.
4069 * ihex.c: Likewise.
4070 * irix-core.c: Likewise.
4071 * libaout.h: Likewise.
4072 * libecoff.h: Likewise.
4073 * mach-o-target.c: Likewise.
4074 * mach-o.c: Likewise.
4075 * mipsbsd.c: Likewise.
4076 * mmo.c: Likewise.
4077 * netbsd-core.c: Likewise.
4078 * nlm-target.h: Likewise.
4079 * oasys.c: Likewise.
4080 * osf-core.c: Likewise.
4081 * pdp11.c: Likewise.
4082 * pe-mips.c: Likewise.
4083 * pe-x86_64.c: Likewise.
4084 * pef.c: Likewise.
4085 * plugin.c: Likewise.
4086 * ppcboot.c: Likewise.
4087 * ptrace-core.c: Likewise.
4088 * sco5-core.c: Likewise.
4089 * som.c: Likewise.
4090 * sparclynx.c: Likewise.
4091 * srec.c: Likewise.
4092 * tekhex.c: Likewise.
4093 * trad-core.c: Likewise.
4094 * verilog.c: Likewise.
4095 * versados.c: Likewise.
4096 * vms-alpha.c: Likewise.
4097 * vms-lib.c: Likewise.
4098 * wasm-module.c: Likewise.
4099 * xsym.c: Likewise.
4100 * libbfd.h: Regenerate.
4101
4102 2018-02-15 Jim Wilson <jimw@sifive.com>
4103
4104 * elfnn-riscv.c (_bfd_riscv_relax_section): Ifdef out check to ignore
4105 symbols whose section address is zero.
4106
4107 * elfnn-riscv.c (riscv_elf_relocate_section): Use bfd_reloc_dangerous
4108 when pcrel_lo reloc has an addend. Use reloc_dangerous callback for
4109 bfd_reloc_dangerous. Use einfo instead of warning callback for errors.
4110 Add %X%P to error messages.
4111
4112 2018-02-15 Eric Botcazou <ebotcazou@adacore.com>
4113
4114 PR ld/22832
4115 * elfxx-sparc.c (_bfd_sparc_elf_check_relocs) <R_SPARC_TLS_GD_CALL>:
4116 Pass FALSE instead of TRUE as 'create' argument to bfd_link_hash_lookup
4117 and assert that the result of the call is not NULL.
4118
4119 2018-02-14 Nick Clifton <nickc@redhat.com>
4120
4121 PR 22823
4122 Revert previous delta. Add extra casts to avoid compile time
4123 warnings instead.
4124 * libbfd-in.h (_bfd_generic_bfd_copy_private_bfd_data): Add extra
4125 cast to avoid warning from gcc v8 compiler.
4126 (_bfd_generic_bfd_merge_private_bfd_data): Likewise.
4127 (_bfd_generic_bfd_set_private_flags): Likewise.
4128 (_bfd_generic_bfd_copy_private_section_data): Likewise.
4129 (_bfd_generic_bfd_copy_private_symbol_data): Likewise.
4130 (_bfd_generic_bfd_copy_private_header_data): Likewise.
4131 (_bfd_generic_bfd_print_private_bfd_data): Likewise.
4132 (_bfd_noarchive_construct_extended_name_table): Likewise.
4133 (_bfd_noarchive_truncate_arname): Likewise.
4134 (_bfd_noarchive_write_ar_hdr): Likewise.
4135 (_bfd_noarchive_get_elt_at_index): Likewise.
4136 (_bfd_nosymbols_canonicalize_symtab): Likewise.
4137 (_bfd_nosymbols_print_symbol): Likewise.
4138 (_bfd_nosymbols_get_symbol_info): Likewise.
4139 (_bfd_nosymbols_get_symbol_version_string): Likewise.
4140 (_bfd_nosymbols_bfd_is_local_label_name): Likewise.
4141 (_bfd_nosymbols_bfd_is_target_special_symbol): Likewise.
4142 (_bfd_nosymbols_get_lineno): Likewise.
4143 (_bfd_nosymbols_find_nearest_line): Likewise.
4144 (_bfd_nosymbols_find_line): Likewise.
4145 (_bfd_nosymbols_find_inliner_info): Likewise.
4146 (_bfd_nosymbols_bfd_make_debug_symbol): Likewise.
4147 (_bfd_nosymbols_read_minisymbols): Likewise.
4148 (_bfd_nosymbols_minisymbol_to_symbol): Likewise.
4149 (_bfd_norelocs_bfd_reloc_type_lookup): Likewise.
4150 (_bfd_norelocs_bfd_reloc_name_lookup): Likewise.
4151 (_bfd_nowrite_set_arch_mach): Likewise.
4152 (_bfd_nowrite_set_section_contents): Likewise.
4153 (_bfd_nolink_sizeof_headers): Likewise.
4154 (_bfd_nolink_bfd_get_relocated_section_contents): Likewise.
4155 (_bfd_nolink_bfd_relax_section): Likewise.
4156 (_bfd_nolink_bfd_gc_sections): Likewise.
4157 (_bfd_nolink_bfd_lookup_section_flags): Likewise.
4158 (_bfd_nolink_bfd_merge_sections): Likewise.
4159 (_bfd_nolink_bfd_is_group_section): Likewise.
4160 (_bfd_nolink_bfd_discard_group): Likewise.
4161 (_bfd_nolink_bfd_link_hash_table_create): Likewise.
4162 (_bfd_nolink_bfd_link_add_symbols): Likewise.
4163 (_bfd_nolink_bfd_link_just_syms): Likewise.
4164 (_bfd_nolink_bfd_copy_link_hash_symbol_type): Likewise.
4165 (_bfd_nolink_bfd_final_link): Likewise.
4166 (_bfd_nolink_bfd_link_split_section): Likewise.
4167 (_bfd_nolink_section_already_linked): Likewise.
4168 (_bfd_nolink_bfd_define_common_symbol): Likewise.
4169 (_bfd_nolink_bfd_define_start_stop): Likewise.
4170 (_bfd_nodynamic_canonicalize_dynamic_symtab): Likewise.
4171 (_bfd_nodynamic_get_synthetic_symtab): Likewise.
4172 (_bfd_nodynamic_get_dynamic_reloc_upper_bound _bfd_): Likewise.
4173 (_bfd_nodynamic_canonicalize_dynamic_reloc): Likewise.
4174 * libbfd.c (bfd_false_any): Delete.
4175 (bfd_true_any, bfd_nullvoidptr_any, bfd_0_any): Delete.
4176 (bfd_0u_any, bfd_0l_any, _bfd_n1_any, bfd_void_any): Delete.
4177 * libbfd.h (extern): Regenerate
4178 * aout-target.h (MY_bfd_is_target_special_symbol): Add extra
4179 cast to avoid warning from gcc v8 compiler.
4180 * aout-tic30.c (tic30_aout_set_arch_mach): Likewise.
4181 * binary.c (binary_get_symbol_info): Likewise.
4182 * coff-alpha.c (alpha_ecoff_backend_data): Likewise.
4183 * coff-mips.c (mips_ecoff_backend_data): Likewise.
4184 * coffcode.h (coff_set_alignment_hook): Likewise.
4185 (symname_in_debug_hook): Likewise.
4186 (bfd_coff_backend_data bigobj_swap_table): Likewise.
4187 * elf-m10300.c (elf_backend_omit_section_dynsym): Likewise.
4188 * elf32-cr16.c (elf_backend_omit_section_dynsym): Likewise.
4189 * elf32-lm32.c (elf_backend_omit_section_dynsym): Likewise.
4190 * elf32-m32r.c (elf_backend_omit_section_dynsym): Likewise.
4191 * elf32-metag.c (elf_backend_omit_section_dynsym): Likewise.
4192 * elf32-score.c (elf_backend_omit_section_dynsym): Likewise.
4193 * elf32-score7.c (elf_backend_omit_section_dynsym): Likewise.
4194 * elf32-xstormy16.c (elf_backend_omit_section_dynsym): Likewise.
4195 * elf32-xtensa.c (elf_backend_omit_section_dynsym): Likewise.
4196 * elf64-alpha.c (elf_backend_omit_section_dynsym): Likewise.
4197 * elf64-hppa.c (elf_backend_omit_section_dynsym): Likewise.
4198 * elf64-ia64-vms.c (elf_backend_omit_section_dynsym): Likewise.
4199 * elf64-mmix.c (elf_backend_omit_section_dynsym): Likewise.
4200 * elf64-sh64.c (elf_backend_omit_section_dynsym): Likewise.
4201 * elfnn-ia64.c (elf_backend_omit_section_dynsym): Likewise.
4202 * elfxx-target.h (bfd_elfNN_bfd_debug_info_accumulate): Likewise.
4203 (bfd_elfNN_bfd_make_debug_symbol): Likewise.
4204 (bfd_elfNN_bfd_merge_private_bfd_data): Likewise.
4205 (bfd_elfNN_bfd_set_private_flags): Likewise.
4206 (bfd_elfNN_bfd_is_target_special_symbol): Likewise.
4207 (elf_backend_init_index_section): Likewise.
4208 (elf_backend_allow_non_load_phdr): Likewise.
4209 * elfxx-x86.h (elf_backend_omit_section_dynsym): Likewise.
4210 * i386msdos.c (msdos_bfd_is_target_special_symbol): Likewise.
4211 * ieee.c (ieee_construct_extended_name_table): Likewise.
4212 (ieee_write_armap): Likewise.
4213 (ieee_write_ar_hdr): Likewise.
4214 (ieee_bfd_is_target_special_symbol): Likewise.
4215 * ihex.c (ihex_canonicalize_symtab): Likewise.
4216 (ihex_bfd_is_target_special_symbol): Likewise.
4217 * libaout.h (aout_32_bfd_is_target_special_symbol): Likewise.
4218 * libecoff.h (_bfd_ecoff_bfd_is_target_special_symbol): Likewise.
4219 (_bfd_ecoff_set_alignment_hook): Likewise.
4220 * mach-o-target.c (bfd_mach_o_bfd_is_target_special_symbol): Likewise.
4221 * mmo.c (mmo_bfd_is_target_special_symbol): Likewise.
4222 * nlm-target.h (nlm_bfd_is_target_special_symbol): Likewise.
4223 * oasys.c (oasys_construct_extended_name_table): Likewise.
4224 (oasys_write_armap): Likewise.
4225 (oasys_write_ar_hdr): Likewise.
4226 (oasys_bfd_is_target_special_symbol): Likewise.
4227 * pef.c (bfd_pef_bfd_is_target_special_symbol): Likewise.
4228 * plugin.c (bfd_plugin_bfd_is_target_special_symbol): Likewise.
4229 * ppcboot.c (ppcboot_bfd_is_target_special_symbol): Likewise.
4230 * som.c (som_bfd_is_target_special_symbol): Likewise.
4231 * srec.c (srec_bfd_is_target_special_symbol): Likewise.
4232 * tekhex.c (tekhex_bfd_is_target_special_symbol): Likewise.
4233 * verilog.c (verilog_bfd_is_target_special_symbol): Likewise.
4234 * versados.c (versados_bfd_is_target_special_symbol): Likewise.
4235 (versados_bfd_reloc_name_lookup): Likewise.
4236 * vms-alpha.c (vms_bfd_is_target_special_symbol): Likewise.
4237 (vms_bfd_define_start_stop): Likewise.
4238 (alpha_vms_bfd_is_target_special_symbol): Likewise.
4239 * wasm-module.c (wasm_bfd_is_target_special_symbol): Likewise.
4240 * xsym.c (bfd_sym_bfd_is_target_special_symbol): Likewise.
4241
4242 2018-02-14 H.J. Lu <hongjiu.lu@intel.com>
4243
4244 PR ld/22842
4245 * elf32-i386.c (elf_i386_check_relocs): Pass FALSE for non
4246 PC-relative PLT to NEED_DYNAMIC_RELOCATION_P.
4247 * elf64-x86-64.c (elf_x86_64_check_relocs): Create PLT for
4248 R_X86_64_PC32 reloc against dynamic function in data section.
4249 Pass TRUE for PC-relative PLT to NEED_DYNAMIC_RELOCATION_P.
4250 (elf_x86_64_relocate_section): Use PLT for R_X86_64_PC32 reloc
4251 against dynamic function in data section.
4252 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Use PLT in PIE as
4253 function address only if pcrel_plt is true.
4254 (_bfd_x86_elf_link_hash_table_create): Set pcrel_plt.
4255 * elfxx-x86.h (NEED_DYNAMIC_RELOCATION_P): Add PCREL_PLT for
4256 PC-relative PLT. If PLT is PC-relative, don't generate dynamic
4257 PC-relative relocation against a function definition in data
4258 secton in PIE. Remove the obsolete comments.
4259 (elf_x86_link_hash_table): Add pcrel_plt.
4260
4261 2018-02-13 H.J. Lu <hongjiu.lu@intel.com>
4262
4263 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Check bfd_link_dll,
4264 instead of bfd_link_pic, for building shared library.
4265
4266 2018-02-13 H.J. Lu <hongjiu.lu@intel.com>
4267
4268 PR gas/22791
4269 * elf64-x86-64.c (is_32bit_relative_branch): Removed.
4270 (elf_x86_64_relocate_section): Check PIC relocations in PIE.
4271 Remove is_32bit_relative_branch usage. Disallow PC32 reloc
4272 against protected function in shared object.
4273
4274 2018-02-13 Sergei Trofimovich <slyfox@inbox.ru>
4275
4276 PR 22828
4277 * po/ru.po: Fix typo in Russian translation.
4278
4279 2018-02-13 Maciej W. Rozycki <macro@mips.com>
4280
4281 * wasm-module.c (wasm_scan_name_function_section): Rename
4282 `index' local variable to `idx'.
4283
4284 2018-02-13 Nick Clifton <nickc@redhat.com>
4285
4286 PR 22823
4287 Fix compile time warnings generated by gcc version 8.
4288 * libbfd-in.h: Remove extraneous text from prototypes.
4289 Add prototypes for bfd_false_any, bfd_true_any,
4290 bfd_nullvoidptr_any, bfd_0_any, bfd_0u_any, bfd_0l_any,
4291 bfd_n1_any, bfd_void_any.
4292 (_bfd_generic_bfd_copy_private_bfd_data): Use vararg based dummy
4293 function.
4294 (_bfd_generic_bfd_merge_private_bfd_data): Likewise.
4295 (_bfd_generic_bfd_set_private_flags): Likewise.
4296 (_bfd_generic_bfd_copy_private_section_data): Likewise.
4297 (_bfd_generic_bfd_copy_private_symbol_data): Likewise.
4298 (_bfd_generic_bfd_copy_private_header_data): Likewise.
4299 (_bfd_generic_bfd_print_private_bfd_data): Likewise.
4300 (_bfd_noarchive_construct_extended_name_table): Likewise.
4301 (_bfd_noarchive_truncate_arname): Likewise.
4302 (_bfd_noarchive_write_ar_hdr): Likewise.
4303 (_bfd_noarchive_get_elt_at_index): Likewise.
4304 (_bfd_nosymbols_canonicalize_symtab): Likewise.
4305 (_bfd_nosymbols_print_symbol): Likewise.
4306 (_bfd_nosymbols_get_symbol_info): Likewise.
4307 (_bfd_nosymbols_get_symbol_version_string): Likewise.
4308 (_bfd_nosymbols_bfd_is_local_label_name): Likewise.
4309 (_bfd_nosymbols_bfd_is_target_special_symbol): Likewise.
4310 (_bfd_nosymbols_get_lineno): Likewise.
4311 (_bfd_nosymbols_find_nearest_line): Likewise.
4312 (_bfd_nosymbols_find_line): Likewise.
4313 (_bfd_nosymbols_find_inliner_info): Likewise.
4314 (_bfd_nosymbols_bfd_make_debug_symbol): Likewise.
4315 (_bfd_nosymbols_read_minisymbols): Likewise.
4316 (_bfd_nosymbols_minisymbol_to_symbol): Likewise.
4317 (_bfd_norelocs_bfd_reloc_type_lookup): Likewise.
4318 (_bfd_norelocs_bfd_reloc_name_lookup): Likewise.
4319 (_bfd_nowrite_set_arch_mach): Likewise.
4320 (_bfd_nowrite_set_section_contents): Likewise.
4321 (_bfd_nolink_sizeof_headers): Likewise.
4322 (_bfd_nolink_bfd_get_relocated_section_contents): Likewise.
4323 (_bfd_nolink_bfd_relax_section): Likewise.
4324 (_bfd_nolink_bfd_gc_sections): Likewise.
4325 (_bfd_nolink_bfd_lookup_section_flags): Likewise.
4326 (_bfd_nolink_bfd_merge_sections): Likewise.
4327 (_bfd_nolink_bfd_is_group_section): Likewise.
4328 (_bfd_nolink_bfd_discard_group): Likewise.
4329 (_bfd_nolink_bfd_link_hash_table_create): Likewise.
4330 (_bfd_nolink_bfd_link_add_symbols): Likewise.
4331 (_bfd_nolink_bfd_link_just_syms): Likewise.
4332 (_bfd_nolink_bfd_copy_link_hash_symbol_type): Likewise.
4333 (_bfd_nolink_bfd_final_link): Likewise.
4334 (_bfd_nolink_bfd_link_split_section): Likewise.
4335 (_bfd_nolink_section_already_linked): Likewise.
4336 (_bfd_nolink_bfd_define_common_symbol): Likewise.
4337 (_bfd_nolink_bfd_define_start_stop): Likewise.
4338 (_bfd_nodynamic_canonicalize_dynamic_symtab): Likewise.
4339 (_bfd_nodynamic_get_synthetic_symtab): Likewise.
4340 (_bfd_nodynamic_get_dynamic_reloc_upper_bound _bfd_): Likewise.
4341 (_bfd_nodynamic_canonicalize_dynamic_reloc): Likewise.
4342 * libbfd.c (bfd_false_any): New function. Like bfd_false but
4343 accepts one or more arguments.
4344 (bfd_true_any): Likewise.
4345 (bfd_nullvoidptr_any): Likewise.
4346 (bfd_0_any): Likewise.
4347 (bfd_0u_any): Likewise.
4348 (bfd_0l_any): Likewise.
4349 (_bfd_n1_any): Likewise.
4350 (bfd_void_any): Likewise.
4351 * libbfd.h (extern): Regenerate
4352 * aout-target.h (MY_bfd_is_target_special_symbol): Use vararg
4353 based dummy function.
4354 * aout-tic30.c (tic30_aout_set_arch_mach): Likewise.
4355 * binary.c (binary_get_symbol_info): Likewise.
4356 * coff-alpha.c (alpha_ecoff_backend_data): Likewise.
4357 * coff-mips.c (mips_ecoff_backend_data): Likewise.
4358 * coffcode.h (coff_set_alignment_hook): Likewise.
4359 (symname_in_debug_hook): Likewise.
4360 (bfd_coff_backend_data bigobj_swap_table): Likewise.
4361 * elf-m10300.c (elf_backend_omit_section_dynsym): Likewise.
4362 * elf32-cr16.c (elf_backend_omit_section_dynsym): Likewise.
4363 * elf32-lm32.c (elf_backend_omit_section_dynsym): Likewise.
4364 * elf32-m32r.c (elf_backend_omit_section_dynsym): Likewise.
4365 * elf32-metag.c (elf_backend_omit_section_dynsym): Likewise.
4366 * elf32-score.c (elf_backend_omit_section_dynsym): Likewise.
4367 * elf32-score7.c (elf_backend_omit_section_dynsym): Likewise.
4368 * elf32-xstormy16.c (elf_backend_omit_section_dynsym): Likewise.
4369 * elf32-xtensa.c (elf_backend_omit_section_dynsym): Likewise.
4370 * elf64-alpha.c (elf_backend_omit_section_dynsym): Likewise.
4371 * elf64-hppa.c (elf_backend_omit_section_dynsym): Likewise.
4372 * elf64-ia64-vms.c (elf_backend_omit_section_dynsym): Likewise.
4373 * elf64-mmix.c (elf_backend_omit_section_dynsym): Likewise.
4374 * elf64-sh64.c (elf_backend_omit_section_dynsym): Likewise.
4375 * elfnn-ia64.c (elf_backend_omit_section_dynsym): Likewise.
4376 * elfxx-target.h (bfd_elfNN_bfd_debug_info_accumulate): Likewise.
4377 (bfd_elfNN_bfd_make_debug_symbol): Likewise.
4378 (bfd_elfNN_bfd_merge_private_bfd_data): Likewise.
4379 (bfd_elfNN_bfd_set_private_flags): Likewise.
4380 (bfd_elfNN_bfd_is_target_special_symbol): Likewise.
4381 (elf_backend_init_index_section): Likewise.
4382 (elf_backend_allow_non_load_phdr): Likewise.
4383 * elfxx-x86.h (elf_backend_omit_section_dynsym): Likewise.
4384 * i386msdos.c (msdos_bfd_is_target_special_symbol): Likewise.
4385 * ieee.c (ieee_construct_extended_name_table): Likewise.
4386 (ieee_write_armap): Likewise.
4387 (ieee_write_ar_hdr): Likewise.
4388 (ieee_bfd_is_target_special_symbol): Likewise.
4389 * ihex.c (ihex_canonicalize_symtab): Likewise.
4390 (ihex_bfd_is_target_special_symbol): Likewise.
4391 * libaout.h (aout_32_bfd_is_target_special_symbol): Likewise.
4392 * libecoff.h (_bfd_ecoff_bfd_is_target_special_symbol): Likewise.
4393 (_bfd_ecoff_set_alignment_hook): Likewise.
4394 * mach-o-target.c (bfd_mach_o_bfd_is_target_special_symbol): Likewise.
4395 * mmo.c (mmo_bfd_is_target_special_symbol): Likewise.
4396 * nlm-target.h (nlm_bfd_is_target_special_symbol): Likewise.
4397 * oasys.c (oasys_construct_extended_name_table): Likewise.
4398 (oasys_write_armap): Likewise.
4399 (oasys_write_ar_hdr): Likewise.
4400 (oasys_bfd_is_target_special_symbol): Likewise.
4401 * pef.c (bfd_pef_bfd_is_target_special_symbol): Likewise.
4402 * plugin.c (bfd_plugin_bfd_is_target_special_symbol): Likewise.
4403 * ppcboot.c (ppcboot_bfd_is_target_special_symbol): Likewise.
4404 * som.c (som_bfd_is_target_special_symbol): Likewise.
4405 * srec.c (srec_bfd_is_target_special_symbol): Likewise.
4406 * tekhex.c (tekhex_bfd_is_target_special_symbol): Likewise.
4407 * verilog.c (verilog_bfd_is_target_special_symbol): Likewise.
4408 * versados.c (versados_bfd_is_target_special_symbol): Likewise.
4409 (versados_bfd_reloc_name_lookup): Likewise.
4410 * vms-alpha.c (vms_bfd_is_target_special_symbol): Likewise.
4411 (vms_bfd_define_start_stop): Likewise.
4412 (alpha_vms_bfd_is_target_special_symbol): Likewise.
4413 * wasm-module.c (wasm_bfd_is_target_special_symbol): Likewise.
4414 * xsym.c (bfd_sym_bfd_is_target_special_symbol): Likewise.
4415 * elf32-arc.c (get_replace_function): Assign replacement function
4416 to func pointer.
4417 * elf32-i370.c (i370_noop): Update prototype.
4418
4419 2018-02-13 Alan Modra <amodra@gmail.com>
4420
4421 PR 22836
4422 * elf.c (_bfd_elf_fixup_group_sections): Account for removed
4423 relocation sections. If size reduces to just the flag word,
4424 remove that too and mark with SEC_EXCLUDE.
4425 * elflink.c (bfd_elf_final_link): Strip empty group sections.
4426
4427 2018-02-13 Alan Modra <amodra@gmail.com>
4428
4429 PR 22829
4430 * elf.c (assign_file_positions_for_non_load_sections): Rewrite
4431 PT_GNU_RELRO setup.
4432
4433 2018-02-12 Zebediah Figura <z.figura12@gmail.com>
4434
4435 * i386msdos.c (msdos_mkobject); New function.
4436 (msdos_object_p): New function.
4437 (i386_msdos_vec): Use msdos_object_p as the check_format
4438 function.
4439 * peicode.h: Rename external_PEI_DOS_hdr, DOSMAGIC, and
4440 NT_SIGNATURE to external_DOS_hdr, IMAGE_DOS_SIGNATURE, and
4441 IMAGE_NT_SIGNATURE.
4442 * peXXigen.c: Likewise.
4443 * coff-ia64.c: Likewise.
4444
4445 2018-02-12 Nick Clifton <nickc@redhat.com>
4446
4447 * elf32-nds32.c (nds32_elf_relax_longjump3): Remove redundant
4448 assignment.
4449 * elf32-arc.c (elf_arc_relocate_section): Likewise.
4450
4451 2018-02-09 Eric Botcazou <ebotcazou@adacore.com>
4452
4453 * elfxx-sparc.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Reorder conditions.
4454 (sparc_elf_append_rela): Assert that there is enough room in section.
4455 (_bfd_sparc_elf_copy_indirect_symbol): Fix formatting.
4456 (_bfd_sparc_elf_adjust_dynamic_symbol): Minor tweak.
4457 (allocate_dynrelocs): Remove outdated comments and reorder conditions.
4458 For a symbol subject to a GOT relocation, reserve a slot in the
4459 relocation section if the symbol isn't dynamic and we are in PIC mode.
4460 (_bfd_sparc_elf_relocate_section) <R_SPARC_GOTDATA_OP>: If relocation
4461 is relaxed and a slot was reserved, generate a R_SPARC_NONE relocation.
4462 <R_SPARC_GOTDATA_OP_HIX22>: Adjust comments.
4463 <R_SPARC_PC10>: Reorder conditions. Remove always-false assertion.
4464 (_bfd_sparc_elf_finish_dynamic_symbol): Rename local_undefweak into
4465 resolved_to_zero. Do not generate a dynamic GOT relocation for an
4466 undefined weak symbol with non-default visibility. Remove superfluous
4467 'else' and fix formatting.
4468
4469 2018-02-09 H.J. Lu <hongjiu.lu@intel.com>
4470
4471 * elf32-i386.c (elf_i386_get_synthetic_symtab): Also handle
4472 is_solaris.
4473 (i386_elf32_sol2_vec): Don't declare.
4474 (elf_i386_link_setup_gnu_properties): Also handle is_solaris.
4475 Don't set need_global_offset_table.
4476 (elf_i386_solaris_arch_bed): New.
4477 (elf_backend_arch_data): Set to elf_i386_solaris_arch_bed for
4478 Solaris.
4479 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Check
4480 target_os != is_nacl instead of target_os == is_normal.
4481 (x86_64_elf64_sol2_vec): Don't declare.
4482 (elf_x86_64_link_setup_gnu_properties): Check target_os !=
4483 is_nacl instead of target_os == is_normal. Don't set
4484 need_global_offset_table.
4485 (elf_x86_64_solaris_arch_bed): New.
4486 (elf_backend_arch_data): Set to elf_x86_64_solaris_arch_bed for
4487 Solaris.
4488 * elfxx-x86.c (_bfd_x86_elf_size_dynamic_sections): Keep
4489 _GLOBAL_OFFSET_TABLE_ for Solaris.
4490 (_bfd_x86_elf_link_setup_gnu_properties): Don't copy
4491 need_global_offset_table.
4492 * elfxx-x86.h (elf_x86_target_os): Add is_solaris.
4493 (elf_x86_link_hash_table): Remove need_global_offset_table.
4494 (elf_x86_init_table): Likewise.
4495
4496 2018-02-08 H.J. Lu <hongjiu.lu@intel.com>
4497
4498 * elf32-i386.c (elf32_i386_copy_solaris_special_section_fields):
4499 Remove prototype.
4500 (i386_elf32_sol2_vec): Declared.
4501 (elf_i386_link_setup_gnu_properties): Set
4502 need_global_offset_table with info->output_bfd->xvec.
4503 * elf64-x86-64.c (elf64_x86_64_copy_solaris_special_section_fields):
4504 Remove prototype.
4505 (x86_64_elf64_sol2_vec): Declared.
4506 (elf_x86_64_link_setup_gnu_properties): Set
4507 need_global_offset_table with info->output_bfd->xvec.
4508
4509 2018-02-08 H.J. Lu <hongjiu.lu@intel.com>
4510
4511 * elf32-i386.c (elf32_i386_copy_solaris_special_section_fields):
4512 New prototype.
4513 (elf_i386_link_setup_gnu_properties): Set need_global_offset_table
4514 for Solaris.
4515 * elf64-x86-64.c (elf64_x86_64_copy_solaris_special_section_fields):
4516 New prototype.
4517 (elf_x86_64_link_setup_gnu_properties): Set
4518 need_global_offset_table for Solaris.
4519 * elfxx-x86.c (_bfd_x86_elf_size_dynamic_sections): Keep the
4520 unused _GLOBAL_OFFSET_TABLE_ for Solaris.
4521 (_bfd_x86_elf_link_setup_gnu_properties): Copy
4522 need_global_offset_table.
4523 * elfxx-x86.h (elf_x86_link_hash_table): Add
4524 need_global_offset_table.
4525 (elf_x86_init_table): Likewise.
4526
4527 2018-02-08 Jim Wilson <jimw@sifive.com>
4528
4529 * elfnn-riscv.c (riscv_elf_relocate_section): Add comment for previous
4530 change.
4531
4532 2018-02-08 Nick Clifton <nickc@redhat.com>
4533
4534 PR 22788
4535 * elf.c (elf_parse_notes): Reject notes with excessuively large
4536 alignments.
4537
4538 2018-02-07 Alan Modra <amodra@gmail.com>
4539
4540 Revert 2018-01-17 Alan Modra <amodra@gmail.com>
4541 * elf32-ppc.c: Remove speculation barrier support.
4542 * elf32-ppc.h: Likewise.
4543 * elf64-ppc.c: Likewise.
4544 * elf64-ppc.h: Likewise.
4545
4546 2018-02-06 Jim Wilson <jimw@sifive.com>
4547
4548 * elfnn-riscv.c (riscv_elf_relocate_section): Return TRUE if used
4549 callback to report an error.
4550
4551 2018-02-06 Eric Botcazou <ebotcazou@adacore.com>
4552
4553 PR ld/22263
4554 * elfxx-sparc.c (sparc_elf_tls_transition): Turn call to bfd_link_pic
4555 into call to !bfd_link_executable and tidy up.
4556 (_bfd_sparc_elf_check_relocs): Fix formatting and tidy up.
4557 <R_SPARC_TLS_LE_HIX22>: Turn call to bfd_link_pic into call to
4558 !bfd_link_executable.
4559 <R_SPARC_TLS_IE_HI22>: Likewise.
4560 <GOT relocations>: Remove useless code, tidy and merge related blocks.
4561 <R_SPARC_TLS_GD_CALL>: Turn call to bfd_link_pic into call to
4562 !bfd_link_executable.
4563 <R_SPARC_WPLT30>: Tidy up.
4564 (_bfd_sparc_elf_gc_mark_hook): Turn call to bfd_link_pic into call to
4565 !bfd_link_executable.
4566 (allocate_dynrelocs): Likewise.
4567 (_bfd_sparc_elf_relocate_section): Fix formatting and tidy up.
4568 <R_SPARC_TLS_GD_HI22>: Merge into...
4569 <R_SPARC_TLS_GD_LO10>: ...this. Adjust 4th argument in call to
4570 sparc_elf_tls_transition and remove redundant code.
4571 <R_SPARC_TLS_LDM_HI22>: Turn call to bfd_link_pic into call to
4572 !bfd_link_executable.
4573 <R_SPARC_TLS_LDO_HIX22>: Likewise.
4574 <R_SPARC_TLS_LE_HIX22>: Likewise. Tidy up.
4575 <R_SPARC_TLS_LDM_CALL>: Likewise.
4576 <R_SPARC_TLS_GD_CALL>: Likewise. Tidy up.
4577 <R_SPARC_TLS_GD_ADD>: Likewise.
4578 <R_SPARC_TLS_LDM_ADD>: Likewise.
4579 <R_SPARC_TLS_LDO_ADD>: Likewise.
4580 <R_SPARC_TLS_IE_LD>: Likewise.
4581
4582 2018-02-06 Miloš Stojanović <milos.stojanovic@rt-rk.com>
4583
4584 PR 22789
4585 * elfxx-mips.c (_bfd_mips_elf_find_nearest_line): If the dwarf
4586 functions failed to find the function name, try the generic elf
4587 find function instead.
4588
4589 2018-02-06 Sergio Durigan Junior <sergiodj@redhat.com>
4590
4591 * coff-rs6000.c (xcoff_write_archive_contents_old): Use
4592 'memcpy' instead of 'strncpy' when writing the magic number.
4593
4594 2018-02-06 Nick Clifton <nickc@redhat.com>
4595
4596 PR 22794
4597 * opncls.c (bfd_get_debug_link_info_1): Check the size of the
4598 section before attempting to read it in.
4599 (bfd_get_alt_debug_link_info): Likewise.
4600
4601 2018-02-06 Paul Carroll <pcarroll@codesourcery.com>
4602
4603 * bfd/dwarf2.c (find_abstract_name): Modified to return file and
4604 line information in addition to name, if they can be found.
4605
4606 2018-02-05 Renlin Li <renlin.li@arm.com>
4607
4608 PR ld/22764
4609 * elfnn-aarch64.c (elfNN_aarch64_check_relocs): Relax the
4610 R_AARCH64_ABS32 and R_AARCH64_ABS16 for absolute symbol. Apply the
4611 check for writeable section as well.
4612
4613 2018-02-05 H.J. Lu <hongjiu.lu@intel.com>
4614
4615 PR ld/22782
4616 * elf32-i386.c (elf_i386_check_relocs): Set got_referenced if
4617 _GLOBAL_OFFSET_TABLE_ is referenced or GOT is needed to resolve
4618 undefined weak symbol to 0.
4619 * elf64-x86-64.c (elf_x86_64_check_relocs): Set got_referenced
4620 if _GLOBAL_OFFSET_TABLE_ is referenced.
4621 * elfxx-x86.c (_bfd_x86_elf_size_dynamic_sections): Check
4622 got_referenced instead of ref_regular_nonweak. Remove the
4623 unused _GLOBAL_OFFSET_TABLE_ from symbol table.
4624 * elfxx-x86.h (elf_x86_link_hash_table): Add got_referenced.
4625
4626 2018-02-05 Maciej W. Rozycki <macro@mips.com>
4627
4628 * elfnn-riscv.c (_bfd_riscv_relax_pc): Use `memset' to
4629 initialize `hi_reloc'.
4630
4631 2018-02-05 Maciej W. Rozycki <macro@mips.com>
4632
4633 * elfxx-mips.c (_bfd_mips_elf_section_processing): For
4634 SHT_MIPS_REGINFO sections don't assert the correct size and
4635 report an error instead.
4636
4637 2018-02-05 Maciej W. Rozycki <macro@mips.com>
4638
4639 * elf.c (_bfd_elf_write_object_contents): Propagate a failure
4640 status from `->elf_backend_section_processing'.
4641
4642 2018-02-02 Jim Wilson <jimw@sifive.com>
4643
4644 PR ld/22756
4645 * elfnn-riscv.c (riscv_relax_delete_bytes): New parameter link_info.
4646 If link_info->wrap_hash, check for a duplicate symbol and ignore.
4647 (_bfd_riscv_relax_call, bfd_riscv_relax_lui, _bfd_riscv_relax_tls_le):
4648 Pass new argument to riscv_relax_delete_bytes.
4649 (_bfd_riscv_relax_align, _bfd_riscv_relax_delete): Likewise. Remove
4650 ATTRIBUTE_UNUSED from link_info parameter.
4651
4652 2018-02-02 Alan Modra <amodra@gmail.com>
4653
4654 * elf64-ppc.c (ppc64_elf_relocate_section): Don't relocate nops
4655 emitted for toc sequence optimization. Set and use "howto" later.
4656
4657 2018-02-01 Simon Marchi <simon.marchi@ericsson.com>
4658
4659 * elf64-ppc.c (ppc64_elf_archive_symbol_lookup): Avoid pointer
4660 arithmetic on NULL pointer.
4661 * elflink.c (_bfd_elf_archive_symbol_lookup,
4662 elf_link_add_archive_symbols): Likewise.
4663
4664 2018-01-31 Michael Matz <matz@suse.de>
4665
4666 * elflink.c (bfd_elf_define_start_stop): Fix check of
4667 def_dynamic.
4668
4669 2018-01-31 H.J. Lu <hongjiu.lu@intel.com>
4670
4671 PR ld/21964
4672 * elflink.c (bfd_elf_define_start_stop): Check if __start and
4673 __stop symbols are referenced by shared objects.
4674
4675 2018-01-30 Alan Modra <amodra@gmail.com>
4676
4677 PR 22758
4678 * elf.c (_bfd_elf_map_sections_to_segments): Don't start a new
4679 segment when demand paged with lma on the same page. Test this
4680 before load/non-load, executable/non-executable,
4681 writable/non-writable tests and simplify. Delete bogus relro
4682 condition in writable/non-writable test. Delete outdated
4683 comment. Formatting.
4684
4685 2018-01-30 Alan Modra <amodra@gmail.com>
4686
4687 * elflink.c (bfd_elf_define_start_stop): Make __start and __stop
4688 symbols dynamic.
4689
4690 2018-01-29 Alan Modra <amodra@gmail.com>
4691
4692 PR 22741
4693 * coffgen.c (coff_pointerize_aux): Ensure auxent tagndx is in
4694 range before converting to a symbol table pointer.
4695
4696 2018-01-27 Nick Clifton <nickc@redhat.com>
4697
4698 * po/ru.po: Updated Russian translation.
4699
4700 2018-01-26 Alan Modra <amodra@gmail.com>
4701
4702 * elflink.c (bfd_elf_define_start_stop): Override symbols when
4703 they are defined dynamically.
4704
4705 2018-01-26 Alan Modra <amodra@gmail.com>
4706
4707 * elf64-ppc.c (ppc64_elf_size_stubs): Iterate sizing when
4708 .branch_lt changes size.
4709
4710 2018-01-25 Alan Modra <amodra@gmail.com>
4711
4712 PR 22746
4713 * elfcode.h (elf_object_p): Avoid integer overflow.
4714
4715 2018-01-25 Eric Botcazou <ebotcazou@adacore.com>
4716
4717 PR ld/22727
4718 * elfxx-sparc.c (_bfd_sparc_elf_check_relocs) <R_SPARC_TLS_GD_CALL>:
4719 Do a mere lookup of the __tls_get_addr symbol instead of adding it.
4720
4721 Revert
4722 2017-10-19 H.J. Lu <hongjiu.lu@intel.com>
4723
4724 PR ld/22263
4725 * elfxx-sparc.c (sparc_elf_tls_transition): Replace
4726 bfd_link_pic with !bfd_link_executable, !bfd_link_pic with
4727 bfd_link_executable for TLS check.
4728 (_bfd_sparc_elf_check_relocs): Likewise.
4729 (allocate_dynrelocs): Likewise.
4730 (_bfd_sparc_elf_relocate_section): Likewise.
4731
4732 2018-01-24 Renlin Li <renlin.li@arm.com>
4733
4734 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Add support for
4735 BFD_RELOC_AARCH64_MOVW_PREL_G0, BFD_RELOC_AARCH64_MOVW_PREL_G0_NC,
4736 BFD_RELOC_AARCH64_MOVW_PREL_G1, BFD_RELOC_AARCH64_MOVW_PREL_G1_NC,
4737 BFD_RELOC_AARCH64_MOVW_PREL_G2, BFD_RELOC_AARCH64_MOVW_PREL_G2_NC,
4738 BFD_RELOC_AARCH64_MOVW_PREL_G3.
4739 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
4740 (_bfd_aarch64_elf_resolve_relocation): Likewise.
4741
4742 2018-01-24 Renlin Li <renlin.li@arm.com>
4743
4744 * reloc.c: Add BFD_RELOC_AARCH64_MOVW_PREL_G0,
4745 BFD_RELOC_AARCH64_MOVW_PREL_G0_NC, BFD_RELOC_AARCH64_MOVW_PREL_G1,
4746 BFD_RELOC_AARCH64_MOVW_PREL_G1_NC, BFD_RELOC_AARCH64_MOVW_PREL_G2,
4747 BFD_RELOC_AARCH64_MOVW_PREL_G2_NC, BFD_RELOC_AARCH64_MOVW_PREL_G3.
4748 * elfnn-aarch64.c (elfNN_aarch64_howto_table): Add entries for
4749 BFD_RELOC_AARCH64_MOVW_PREL_G0, BFD_RELOC_AARCH64_MOVW_PREL_G0_NC,
4750 BFD_RELOC_AARCH64_MOVW_PREL_G1, BFD_RELOC_AARCH64_MOVW_PREL_G1_NC,
4751 BFD_RELOC_AARCH64_MOVW_PREL_G2, BFD_RELOC_AARCH64_MOVW_PREL_G2_NC,
4752 BFD_RELOC_AARCH64_MOVW_PREL_G3.
4753 * bfd-in2.h: Regenerate.
4754 * libbfd.h: Regenerate.
4755
4756 2018-01-23 Maciej W. Rozycki <macro@mips.com>
4757
4758 * elfxx-mips.c (_bfd_mips_elf_final_link): Update a stale
4759 `mips_elf32_section_processing' comment reference.
4760
4761 2018-01-20 H.J. Lu <hongjiu.lu@intel.com>
4762
4763 PR ld/22721
4764 * elfxx-x86.c (_bfd_x86_elf_link_check_relocs): Check the
4765 versioned __tls_get_addr symbol.
4766
4767 2018-01-19 Nick Clifton <nickc@redhat.com>
4768
4769 * po/fr.po: Updated French translation.
4770
4771 2018-01-18 Alan Modra <amodra@gmail.com>
4772
4773 * elf32-ppc.c (ppc_elf_create_glink): Correct alignment of .glink.
4774 * elf64-ppc.c (ppc64_elf_size_stubs): Handle negative plt_stub_align.
4775 (ppc64_elf_build_stubs): Likewise.
4776
4777 2018-01-17 Nick Clifton <nickc@redhat.com>
4778
4779 * po/ru.po: Updated Russian translation.
4780 * po/uk/po: Updated Ukranian translation.
4781
4782 2018-01-17 Alan Modra <amodra@gmail.com>
4783
4784 * elf64-ppc.c (ppc64_elf_build_stubs): Silence gcc warning.
4785
4786 2018-01-17 Alan Modra <amodra@gmail.com>
4787
4788 * elf32-ppc.c (GLINK_ENTRY_SIZE): Handle speculation barrier.
4789 (CRSETEQ, BEQCTRM): Define.
4790 (is_nonpic_glink_stub): Don't check bctr.
4791 (ppc_elf_link_hash_table_create): Init new ppc_elf_params field.
4792 (ppc_elf_relax_section): Size speculation barrier.
4793 (output_bctr): New function.
4794 (write_glink_stub): Use output_bctr.
4795 (ppc_elf_relocate_section): Use output_bctr for long branch stub.
4796 (ppc_elf_finish_dynamic_symbol): Likewise.
4797 (ppc_elf_finish_dynamic_sections): Use output_bctr.
4798 * elf32-ppc.h (struct ppc_elf_params): Add speculate_indirect_jumps.
4799 * elf64-ppc.c (CRSETEQ, BEQCTRM, BEQCTRLM): Define.
4800 (GLINK_PLTRESOLVE_SIZE): Size speculation barrier.
4801 (size_global_entry_stubs): Handle speculation barrier sizing.
4802 (plt_stub_size): Likewise.
4803 (output_bctr): New function.
4804 (build_plt_stub, build_tls_get_addr_stub): Output speculation
4805 barrier.
4806 (ppc_build_one_stub): Likewise for ppc_stub_plt_branch.
4807 (ppc_size_one_stub): Size speculation barrier in ppc_stub_plt_branch.
4808 (build_global_entry_stubs): Output speculation barrier.
4809 (ppc64_elf_build_stubs): Likewise in __glink_PLTresolve stub.
4810 * elf64-ppc.h (struct ppc64_elf_params): Add speculate_indirect_jumps.
4811
4812 2018-01-17 Alan Modra <amodra@gmail.com>
4813
4814 * elf32-ppc.c (GLINK_ENTRY_SIZE): Add parameters, handle
4815 __tls_get_addr_opt, and alignment sizing.
4816 (TLS_GET_ADDR_GLINK_SIZE): Delete.
4817 (is_nonpic_glink_stub): Don't use GLINK_ENTRY_SIZE.
4818 (ppc_elf_get_synthetic_symtab): Recognize stubs spaced at 4, 6,
4819 or 8 insns.
4820 (ppc_elf_link_hash_table_create): Init new ppc_elf_params field.
4821 (allocate_dynrelocs): Use new GLINK_ENTRY_SIZE.
4822 (ppc_elf_size_dynamic_sections): Likewise. Size branch table
4823 by PLT reloc count.
4824 (write_glink_stub): Handle __tls_get_addr_opt stub.
4825 Pad out to size given by GLINK_ENTRY_SIZE.
4826 (ppc_elf_relocate_section): Adjust write_glink_stub call.
4827 (ppc_elf_finish_dynamic_symbol): Likewise.
4828 (ppc_elf_finish_dynamic_sections): Write PLTresolve without using
4829 insn array since so many need rewriting.
4830 * elf32-ppc.h (struct ppc_elf_params): Add plt_stub_align.
4831 * elf64-ppc.c (GLINK_PLTRESOLVE_SIZE): Rename from
4832 GLINK_CALL_STUB_SIZE. Add htab param and evaluate to size without
4833 nops. Adjust all uses.
4834 (ppc64_elf_get_synthetic_symtab): Don't use GLINK_CALL_STUB_SIZE
4835 in glink_vma calculation.
4836 (struct ppc_link_hash_table): Add global_entry section pointer.
4837 (create_linkage_sections): Create separate section for global
4838 entry stubs.
4839 (PPC_LO, PPC_HI, PPC_HA): Move earlier.
4840 (size_global_entry_stubs): Handle sizing for aligned stubs.
4841 (ppc64_elf_size_dynamic_sections): Handle global_entry alloc,
4842 and don't stash end of glink branch table in rawsize.
4843 (ppc_build_one_stub): Rewrite stub size calculations.
4844 (build_global_entry_stubs): Use new section.
4845 (ppc64_elf_build_stubs): Don't pad __glink_PLTresolve with nops.
4846 Build lazy link stubs out to end of section. Build global entry
4847 stubs in new section.
4848
4849 2018-01-15 Nick Clifton <nickc@redhat.com>
4850
4851 * po/uk.po: Updated Ukranian translation.
4852
4853 2018-01-13 Nick Clifton <nickc@redhat.com>
4854
4855 * po/bfd.pot: Regenerated.
4856
4857 2018-01-13 Nick Clifton <nickc@redhat.com>
4858
4859 * version.m4: Bump version to 2.30.51
4860 * configure: Regenerate.
4861
4862 2018-01-13 Nick Clifton <nickc@redhat.com>
4863
4864 2.30 branch created.
4865
4866 2018-01-12 Jens Widell <jl@opera.com>
4867
4868 * elf.c (setup_group): Optimize search for group by remembering
4869 last found group and restarting search at that index.
4870 * elf-bfd.h (struct elf_obj_tdata): Add group_search_offset field.
4871
4872 2018-01-12 Gunther Nikl <gnikl@users.sourceforge.net>
4873
4874 * aoutx.h (aout_link_check_ar_symbols): Remove default and handle
4875 bfd_link_common_skip_none in switch.
4876
4877 2018-01-12 Alan Modra <amodra@gmail.com>
4878
4879 PR ld/22649
4880 * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Ignore dynamic
4881 references on forced local symbols.
4882
4883 2018-01-12 Vlad Ivanov <vlad@ivanov.email>
4884
4885 * elfxx-mips.c (_bfd_mips_elf_final_link): Notify user when
4886 .reginfo section has wrong size.
4887
4888 2018-01-11 H.J. Lu <hongjiu.lu@intel.com>
4889
4890 PR ld/22393
4891 * elf.c (_bfd_elf_map_sections_to_segments): When generating
4892 separate code and read-only data LOAD segments, create a new
4893 LOAD segment if the previous section contains text and the
4894 current section doesn't or vice versa. Don't put a writable
4895 section in a read-only segment if there is a RELRO segment.
4896
4897 2018-01-11 H.J. Lu <hongjiu.lu@intel.com>
4898
4899 PR ld/22649
4900 * elflink.c (bfd_elf_gc_mark_dynamic_ref_symbol): Ignore dynamic
4901 references on forced local symbols.
4902
4903 2018-01-11 H.J. Lu <hongjiu.lu@intel.com>
4904
4905 PR ld/22677
4906 * elflink.c (bfd_elf_gc_sections): Keep all PREINIT_ARRAY,
4907 INIT_ARRAY as well as FINI_ARRAY sections for ld -r --gc-section.
4908
4909 2018-01-09 Kuan-Lin Chen <kuanlinchentw@gmail.com>
4910
4911 PR 22662
4912 * elf32-nds32.c (nds32_elf_relax_loadstore): Fix a typographical error.
4913
4914 2018-01-03 John Baldwin <jhb@FreeBSD.org>
4915
4916 * elf.c (elfcore_grok_freebsd_note): Handle
4917 NT_FREEBSD_PROCSTAT_PROC, NT_FREEBSD_PROCSTAT_FILES, and
4918 NT_FREEBSD_PROCSTAT_VMMAP.
4919
4920 2018-01-03 Alan Modra <amodra@gmail.com>
4921
4922 Update year range in copyright notice of all files.
4923
4924 For older changes see ChangeLog-2017
4925 \f
4926 Copyright (C) 2018 Free Software Foundation, Inc.
4927
4928 Copying and distribution of this file, with or without modification,
4929 are permitted in any medium without royalty provided the copyright
4930 notice and this notice are preserved.
4931
4932 Local Variables:
4933 mode: change-log
4934 left-margin: 8
4935 fill-column: 74
4936 version-control: never
4937 End:
This page took 0.238699 seconds and 4 git commands to generate.