Correct elf64-ppc.c linkage stub comment and formatting fixes
[deliverable/binutils-gdb.git] / bfd / ChangeLog
1 2018-08-16 Alan Modra <amodra@gmail.com>
2
3 * elf64-ppc.c: Correct ppc_stub_long_branch_notoc example.
4 Formatting.
5
6 2018-08-12 H.J. Lu <hongjiu.lu@intel.com>
7
8 PR binutils/23494
9 * Makefile.am (BFD32_LIBS): Add elf-properties.lo.
10 (BFD32_LIBS_CFILES): Add elf-properties.c.
11 (BFD32_BACKENDS): Remove elf-properties.lo.
12 (BFD32_BACKENDS_CFILES): Remove elf-properties.c.
13 * configure.ac (elf): Remove elf-properties.lo.
14 * Makefile.in: Regenerated.
15 * configure: Likewise.
16
17 2018-08-11 H.J. Lu <hongjiu.lu@intel.com>
18
19 PR ld/23428
20 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Don't
21 add X86_ISA_1_NEEDED property only if existing properties won't
22 be removed.
23
24 2018-08-11 Alan Modra <amodra@gmail.com>
25
26 * reloc.c (bfd_get_reloc_size): Sort switch.
27 (read_reloc, write_reloc, apply_reloc): New functions.
28 (bfd_perform_relocation, bfd_install_relocation): Use apply_reloc.
29 (_bfd_relocate_contents): Use read_reloc and write_reloc.
30 (_bfd_clear_contents): Likewise.
31
32 2018-08-11 John Darrington <john@darrington.wattle.id.au>
33
34 * reloc.c (_bfd_relocate_contents): Handle 3 byte relocs.
35 (_bfd_clear_contents): Likewise.
36 (bfd_perform_relocation): Likewise.
37 (bfd_install_relocation): Likewise.
38
39 2018-08-10 H.J. Lu <hongjiu.lu@intel.com>
40
41 PR ld/23499
42 * elflink.c (bfd_elf_record_link_assignment): Always clear
43 h->verinfo.verdef when overriding a dynamic definition.
44
45 2018-08-10 H.J. Lu <hongjiu.lu@intel.com>
46
47 PR binutils/23494
48 * elf-properties.c (elf_get_gnu_property_section_size): Always
49 use align_size as pr_datasz for GNU_PROPERTY_STACK_SIZE.
50 (elf_write_gnu_properties): Likewise.
51
52 2018-08-08 H.J. Lu <hongjiu.lu@intel.com>
53
54 PR binutils/23494
55 * bfd.c (bfd_convert_section_size): Check BFD_DECOMPRESS after
56 calling _bfd_elf_convert_gnu_property_size to convert
57 .note.gnu.property section size.
58 (bfd_convert_section_contents): Check BFD_DECOMPRESS after
59 calling _bfd_elf_convert_gnu_properties to convert
60 .note.gnu.property section.
61 * elf-bfd.h (_bfd_elf_convert_gnu_property_size): New prototype.
62 (_bfd_elf_convert_gnu_properties): Likewise.
63 * elf-properties.c (elf_get_gnu_property_section_size): New
64 function.
65 (elf_write_gnu_properties): Likewise.
66 (_bfd_elf_convert_gnu_property_size): Likewise.
67 (_bfd_elf_convert_gnu_properties): Likewise.
68 (_bfd_elf_link_setup_gnu_properties): Use
69 elf_get_gnu_property_section_size and elf_write_gnu_properties.
70
71 2018-08-08 H.J. Lu <hongjiu.lu@intel.com>
72
73 PR ld/23486
74 * elfxx-x86.c (_bfd_x86_elf_merge_gnu_properties): Remove
75 GNU_PROPERTY_X86_ISA_1_USED if an input file doesn't have it.
76 (_bfd_x86_elf_link_setup_gnu_properties): Adding the
77 GNU_PROPERTY_X86_ISA_1_NEEDED, instead of
78 GNU_PROPERTY_X86_ISA_1_USED, property.
79
80 2018-08-07 Alan Modra <amodra@gmail.com>
81
82 * elf64-ppc.c (struct map_stub): Delete tls_get_addr_opt_bctrl.
83 Add lr_restore, eh_size and eh_base.
84 (eh_advance, eh_advance_size): New functions.
85 (build_tls_get_addr_stub): Emit EH info for stub.
86 (ppc_build_one_stub): Likewise for _notoc stubs.
87 (ppc_size_one_stub): Size EH info for stub.
88 (group_sections): Init new map_stub fields.
89 (stub_eh_frame_size): Delete.
90 (ppc64_elf_size_stubs): Size EH info for stubs. Set up dummy EH
91 program for stubs.
92 (ppc64_elf_build_stubs): Reinit new map_stub fields. Set FDE
93 offset to stub section here..
94 (ppc64_elf_finish_dynamic_sections): ..rather than here.
95
96 2018-08-07 Alan Modra <amodra@gmail.com>
97
98 * elf64-ppc.c (ppc64_elf_relocate_section): Don't skip first
99 instruction of __tls_get_addr_opt stub.
100 (plt_stub_size): Omit ALWAYS_EMIT_R2SAVE condition when
101 dealing with __tls_get_addr_opt stub.
102 (build_tls_get_addr_stub, ppc_size_one_stub): Likewise.
103
104 2018-08-06 Claudiu Zissulescu <claziss@synopsys.com>
105
106 * elf32-arc.c (arc_elf_merge_private_bfd_data): Complain about
107 efalgs only when in/out exists.
108 (elf32_arc_section_from_shdr): Don't complain about 0x0c
109 section type. It is mwdt compiler specific.
110
111 2018-08-06 Claudiu Zissulescu <claziss@synopsys.com>
112
113 * elf32-arc.c (arc_elf_merge_attributes): Fix merge attributes.
114
115 2018-08-06 Claudiu Zissulescu <claziss@synopsys.com>
116
117 * elf32-arc.c (arc_elf_merge_attributes): Handle
118 Tag_ARC_ATR_version.
119
120 2018-08-05 Alan Modra <amodra@gmail.com>
121
122 * elf64-ppc.c (ADDI_R12_R11, ADDI_R12_R12, LIS_R12),
123 (ADDIS_R12_R11, ORIS_R12_R12_0, ORI_R12_R12_0),
124 (SLDI_R12_R12_32, LDX_R12_R11_R12, ADD_R12_R11_R12): Define.
125 (ppc64_elf_howto_raw): Add R_PPC64_REL24_NOTOC entry.
126 (ppc64_elf_reloc_type_lookup): Support R_PPC64_REL24_NOTOC.
127 (ppc_stub_type): Add ppc_stub_long_branch_notoc,
128 ppc_stub_long_branch_both, ppc_stub_plt_branch_notoc,
129 ppc_stub_plt_branch_both, ppc_stub_plt_call_notoc, and
130 ppc_stub_plt_call_both.
131 (is_branch_reloc): Add R_PPC64_REL24_NOTOC.
132 (build_offset, size_offset): New functions.
133 (plt_stub_size): Support plt_call_notoc and plt_call_both.
134 (ppc_build_one_stub, ppc_size_one_stub): Support new stubs.
135 (toc_adjusting_stub_needed): Handle R_PPC64_REL24_NOTOC.
136 (ppc64_elf_size_stubs): Likewise, and new stubs.
137 (ppc64_elf_build_stubs, ppc64_elf_relocate_section): Likewise.
138 * reloc.c: Add BFD_RELOC_PPC64_REL24_NOTOC.
139 * bfd-in2.h: Regenerate.
140 * libbfd.h: Regenerate.
141
142 2018-08-05 Alan Modra <amodra@gmail.com>
143
144 * elf64-ppc.c (ppc_build_one_stub): Lose "_r2off" in stub symbols.
145
146 2018-08-02 Jim Wilson <jimw@sifive.com>
147
148 * elfnn-riscv.c (riscv_elf_create_dynamic_sections): For .tdata.dyn,
149 add SEC_LINKER_CREATED flag.
150
151 2018-08-01 Nick Clifton <nickc@redhat.com>
152
153 * coff-rs6000.c (_bfd_xcoff_put_ldsymbol_name): Suppress warnings
154 about potentially truncated strncpy operations.
155 (_bfd_xcoff_put_symbol_name): Likewise.
156
157 * elf32-avr.c (avr_stub_name): Check for a NULL return from
158 bfd_malloc.
159
160 2018-08-01 Zenith <zenith432@users.sourceforge.net>
161
162 PR 23460
163 * plugin.c (bfd_plugin_open_input): Close file descriptor if the
164 call to fstat fails.
165 (try_claim): Always close the file descriptor at the end of the
166 function.
167 (try_load_plugin): If a plugin has already been registered, then
168 skip the dlopen and onload steps and go straight to claiming the
169 file. If these is an error, close the plugin.
170
171 2018-08-01 Alan Modra <amodra@gmail.com>
172
173 * elf64-ppc.c (plt_stub_pad): Delay plt_stub_size call until needed.
174 (ppc_build_one_stub): Don't set stub_offset, instead assert that
175 it is sane. Don't adjust stub_offset for alignment. Adjust size
176 calculation. Use "targ" temp when calculating offsets.
177 (ppc_size_one_stub): Set stub_offset here. Use "targ" temp when
178 calculating offsets. Adjust for alignment before setting
179 tls_get_addr_opt_bctrl.
180
181 2018-08-01 Alan Modra <amodra@gmail.com>
182
183 * po/SRC-POTFILES.in: Regenerate.
184
185 2018-07-30 Nick Clifton <nickc@redhat.com>
186
187 PR 22706
188 * elf32-sh.c (sh_elf_relocate_section): When processing
189 translation relocs, fail if the relocation offset is too small.
190 Replace BFD_ASSERTs with more helpful error messages.
191
192 2018-07-30 Andrew Jenner <andrew@codesourcery.com>
193
194 * Makefile.am (ALL_MACHINES, ALL_MACHINES_CFILES): Add C-SKY.
195 (BFD32_BACKENDS, BFD_BACKENDS_CFILES): Likewise.
196 * Makefile.in: Regenerated.
197 * archures.c (enum bfd_architecture): Add bfd_arch_csky and
198 related bfd_mach defines.
199 (bfd_csky_arch): Declare.
200 (bfd_archures_list): Add C-SKY.
201 * bfd-in.h (elf32_csky_build_stubs): Declare.
202 (elf32_csky_size_stubs): Declare.
203 (elf32_csky_next_input_section: Declare.
204 (elf32_csky_setup_section_lists): Declare.
205 * bfd-in2.h: Regenerated.
206 * config.bfd: Add C-SKY.
207 * configure.ac: Likewise.
208 * configure: Regenerated.
209 * cpu-csky.c: New file.
210 * elf-bfd.h (enum elf_target_id): Add C-SKY.
211 * elf32-csky.c: New file.
212 * libbfd.h: Regenerated.
213 * reloc.c: Add C-SKY relocations.
214 * targets.c (csky_elf32_be_vec, csky_elf32_le_vec): Declare.
215 (_bfd_target_vector): Add C-SKY target vector entries.
216
217 2018-07-27 John Darrington <john@darrington.wattle.id.au>
218
219 * elf32-s12z.c (ELF_TARGET_ID): Don't define.
220
221 2018-07-27 John Darrington <john@darrington.wattle.id.au>
222
223 * libbfd.c (bfd_getb24, bfd_getl24): New functions.
224 (bfd_get_24, bfd_put_24): New macros.
225 * bfd-in2.h: Regenerate.
226
227 2018-07-27 John Darrington <john@darrington.wattle.id.au>
228
229 * elf32-s12z.c (s12z_elf_set_mach_from_flags): Remove comment.
230
231 2018-07-26 Alan Modra <amodra@gmail.com>
232
233 * elf64-ppc.c (ppc64_elf_size_stubs): Use a ppc_stub_long_branch_r2off
234 for calls to symbols with STO_PPC64_LOCAL_MASK bits set to 1.
235
236 2018-07-25 Alan Modra <amodra@gmail.com>
237
238 * elf32-ppc.c (ppc_elf_relax_section): Ignore common or undef locals.
239 Avoid trashing toff with added when used as a symbol index.
240 Ignore R_PPC_PLTREL24 addends in unused example code. Avoid
241 creating unnecessary fixups when relocatable.
242
243 2018-07-25 Alan Modra <amodra@gmail.com>
244
245 * elf32-arm.c (elf32_arm_nabi_write_core_note): Disable
246 -Wstringop-truncation warning for gcc-8.0 too.
247 * elf32-ppc.c (ppc_elf_write_core_note): Likewise.
248 * elf64-ppc.c (ppc64_elf_write_core_note): Likewise.
249 * elfxx-aarch64.c (_bfd_aarch64_elf_write_core_note): Likewise.
250 * elf32-s390.c (elf_s390_write_core_note): Comment fix.
251 * elf64-s390.c (elf_s390_write_core_note): Likewise.
252
253 2018-07-24 Alan Modra <amodra@gmail.com>
254
255 PR 23430
256 * dwarf2.c (dwarf_debug_section_enum): Fix comment typo.
257 * elf.c (bfd_section_from_shdr, elf_sort_sections): Likewise.
258
259 2018-07-23 Max Filippov <jcmvbkbc@gmail.com>
260
261 * elf32-xtensa.c (elf_xtensa_finish_dynamic_sections): Move
262 relocation sections consistency check to always check both
263 .rela.dyn and .rela.plt when they exist. Rearrange variable
264 definition and assignment places.
265
266 2018-07-23 Max Filippov <jcmvbkbc@gmail.com>
267
268 * elf32-xtensa.c (shrink_dynamic_reloc_sections): Shrink dynamic
269 relocations section for dynamic undefined weak symbols when
270 linking a shared object.
271
272 2018-07-23 Tom Tromey <tom@tromey.com>
273
274 * elf.c (bfd_get_elf_phdrs): Don't call memcpy with size 0.
275
276 2018-07-21 Eric Botcazou <ebotcazou@adacore.com>
277
278 * elf32-arm.c (elf32_arm_final_link_relocate) <R_ARM_GOT32>: Small
279 cleanup for the case of a global symbol that binds locally. Also
280 install a value in the GOT slot in the case of a local symbol in
281 a non-PIC link.
282
283 2018-07-20 H.J. Lu <hongjiu.lu@intel.com>
284
285 PR ld/23428
286 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): If the
287 separate code program header is needed, make sure that the first
288 read-only PT_LOAD segment has no code by adding a
289 GNU_PROPERTY_X86_ISA_1_USED note.
290
291 2018-07-20 Chenghua Xu <paul.hua.gm@gmail.com>
292 Maciej W. Rozycki <macro@mips.com>
293
294 * elfxx-mips.c (print_mips_ases): Add MMI extension.
295
296 2018-07-20 Maciej W. Rozycki <macro@mips.com>
297
298 * elfxx-mips.c (_bfd_mips_elf_size_dynamic_sections): Do not
299 create DT_REL, DT_RELSZ or DT_RELENT dynamic entries if the
300 dynamic relocation section will be discarded from output.
301 (_bfd_mips_elf_finish_dynamic_sections) <DT_RELSZ>: Assert that
302 the dynamic relocation section will be retained in output.
303
304 2018-07-18 Maciej W. Rozycki <macro@mips.com>
305
306 * xcofflink.c (xcoff_write_global_symbol): Fix symbol type
307 checks for defined weak symbols.
308
309 2018-07-17 Maciej W. Rozycki <macro@mips.com>
310
311 * elf32-nds32.c (nds32_elf_relax_loadstore): Use
312 `bfd_is_abs_symbol' rather than `bfd_is_abs_section' in checking
313 whether the symbol is absolute.
314 (nds32_elf_relax_lo12): Likewise.
315 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Likewise.
316 (elfNN_aarch64_check_relocs): Likewise.
317 * xcofflink.c (xcoff_need_ldrel_p): Likewise.
318 (bfd_xcoff_import_symbol): Likewise.
319 (xcoff_write_global_symbol): Likewise.
320
321 2018-07-17 Maciej W. Rozycki <macro@mips.com>
322
323 * linker.c (bfd_is_abs_symbol): New macro.
324 * bfd-in2.h: Regenerate.
325
326 2018-07-16 Edjunior Barbosa Machado <emachado@linux.vnet.ibm.com>
327
328 * elf-bfd.h (elfcore_write_ppc_tar): Add prototype.
329 (elfcore_write_ppc_ppr): Likewise.
330 (elfcore_write_ppc_dscr): Likewise.
331 (elfcore_write_ppc_ebb): Likewise.
332 (elfcore_write_ppc_pmu): Likewise.
333 (elfcore_write_ppc_tm_cgpr): Likewise.
334 (elfcore_write_ppc_tm_cfpr): Likewise.
335 (elfcore_write_ppc_tm_cvmx): Likewise.
336 (elfcore_write_ppc_tm_cvsx): Likewise.
337 (elfcore_write_ppc_tm_spr): Likewise.
338 (elfcore_write_ppc_tm_ctar): Likewise.
339 (elfcore_write_ppc_tm_cppr): Likewise.
340 (elfcore_write_ppc_tm_cdscr): Likewise.
341 * elf.c (elfcore_write_ppc_tar): New function.
342 (elfcore_write_ppc_ppr): Likewise.
343 (elfcore_write_ppc_dscr): Likewise.
344 (elfcore_write_ppc_ebb): Likewise.
345 (elfcore_write_ppc_pmu): Likewise.
346 (elfcore_write_ppc_tm_cgpr): Likewise.
347 (elfcore_write_ppc_tm_cfpr): Likewise.
348 (elfcore_write_ppc_tm_cvmx): Likewise.
349 (elfcore_write_ppc_tm_cvsx): Likewise.
350 (elfcore_write_ppc_tm_spr): Likewise.
351 (elfcore_write_ppc_tm_ctar): Likewise.
352 (elfcore_write_ppc_tm_cppr): Likewise.
353 (elfcore_write_ppc_tm_cdscr): Likewise.
354 (elfcore_write_register_note): Call them.
355 (elfcore_grok_ppc_tar): New function.
356 (elfcore_grok_ppc_ppr): Likewise.
357 (elfcore_grok_ppc_dscr): Likewise.
358 (elfcore_grok_ppc_ebb): Likewise.
359 (elfcore_grok_ppc_pmu): Likewise.
360 (elfcore_grok_ppc_tm_cgpr): Likewise.
361 (elfcore_grok_ppc_tm_cfpr): Likewise.
362 (elfcore_grok_ppc_tm_cvmx): Likewise.
363 (elfcore_grok_ppc_tm_cvsx): Likewise.
364 (elfcore_grok_ppc_tm_spr): Likewise.
365 (elfcore_grok_ppc_tm_ctar): Likewise.
366 (elfcore_grok_ppc_tm_cppr): Likewise.
367 (elfcore_grok_ppc_tm_cdscr): Likewise.
368 (elfcore_grok_note): Call them.
369
370 2018-07-11 Maciej W. Rozycki <macro@mips.com>
371
372 * elfxx-mips.c (mips_tls_got_relocs): Use `bfd_link_dll' rather
373 than `!bfd_link_pic' in determining the dynamic symbol index.
374 Avoid the index of -1.
375 (mips_elf_initialize_tls_slots): Likewise. Flatten code by
376 moving `dyn' to the beginning of the function block.
377
378 2018-07-11 Maciej W. Rozycki <macro@mips.com>
379 Rich Felker <bugdal@aerifal.cx>
380
381 PR ld/22570
382 * elfxx-mips.c (mips_tls_got_relocs): Use `bfd_link_dll' rather
383 than `bfd_link_pic' to determine whether dynamic relocations are
384 to be produced.
385 (mips_elf_initialize_tls_slots): Likewise.
386
387 2018-07-10 Maciej W. Rozycki <macro@mips.com>
388
389 * elflink.c (bfd_elf_final_link): Rename `remove' local variable
390 to `remove_section'.
391
392 2018-07-10 Alan Modra <amodra@gmail.com>
393
394 * elf32-xgate.h: Delete.
395 * elf32-xgate.c: Delete unnecessary forward declarations, add two
396 that are now needed.
397 (xgate_elf_bfd_link_hash_table_create)
398 (xgate_elf_bfd_link_hash_table_free)
399 (xgate_elf_set_mach_from_flags, struct xgate_scan_param)
400 (stub_hash_newfunc, elf32_xgate_add_symbol_hook)
401 (elf32_xgate_setup_section_lists, elf32_xgate_size_stubs)
402 (elf32_xgate_build_stubs, elf32_xgate_check_relocs)
403 (elf32_xgate_relocate_section, _bfd_xgate_elf_set_private_flags)
404 (elf32_xgate_post_process_headers): Delete.
405 (elf32_xgate_backend_symbol_processing): New function.
406 (xgate_elf_ignore_reloc, xgate_elf_special_reloc)
407 (_bfd_xgate_elf_print_private_bfd_data): Make static.
408 (ELF_TARGET_ID, elf_info_to_howto, elf_backend_check_relocs)
409 (elf_backend_relocate_section, elf_backend_object_p)
410 (elf_backend_final_write_processing, elf_backend_can_gc_sections)
411 (elf_backend_post_process_headers, elf_backend_add_symbol_hook)
412 (bfd_elf32_bfd_link_hash_table_create)
413 (bfd_elf32_bfd_set_private_flags)
414 (xgate_stub_hash_lookup): Don't define.
415 (elf_backend_symbol_processing): Define.
416 * elf-bfd.h (elf_target_id): Delete XGATE_ELF_DATA.
417
418 2018-07-09 Maciej W. Rozycki <macro@mips.com>
419
420 * elfxx-mips.c (_bfd_mips_elf_adjust_dynamic_symbol): Don't set
421 `->needs_lazy_stub' if the stubs output section is the absolute
422 section.
423
424 2018-07-09 H.J. Lu <hongjiu.lu@intel.com>
425
426 PR ld/23388
427 * configure.ac: Use changequote for "i[3-7]86-*-linux-*".
428 * configure: Regenerated.
429
430 2018-07-09 Alan Modra <amodra@gmail.com>
431
432 * elf32-m68hc1x.c (elf32_m68hc11_post_process_headers): Call
433 _bfd_elf_post_process_headers.
434
435 2018-07-06 Max Filippov <jcmvbkbc@gmail.com>
436
437 * elf32-xtensa.c (elf_xtensa_allocate_dynrelocs): Don't allocate
438 space for dynamic relocation for undefined weak symbol.
439 (elf_xtensa_relocate_section): Don't emit R_XTENSA_RELATIVE
440 relocation for undefined weak symbols.
441 (shrink_dynamic_reloc_sections): Don't shrink dynamic relocation
442 section for relocations against undefined weak symbols.
443
444 2018-07-06 Alan Hayward <alan.hayward@arm.com>
445
446 * elf.c (elfcore_grok_aarch_sve): New function.
447 (elfcore_grok_note): Check for Aarch64 SVE.
448 (elfcore_write_aarch_sve): New function.
449 (elfcore_write_register_note): Check for Aarch64 SVE.
450 * elf-bfd.h(elfcore_grok_aarch_sve): New declaration.
451
452 2018-07-06 Alan Modra <amodra@gmail.com>
453
454 * elf32-arm.c (elf32_arm_nabi_write_core_note): Don't use
455 DIAGNOTIC_PUSH and DIAGNOSTIC_POP unconditionally.
456 * elf32-ppc.c (ppc_elf_write_core_note): Likewise.
457 * elf32-s390.c (elf_s390_write_core_note): Likewise.
458 * elf64-ppc.c (ppc64_elf_write_core_note): Likewise.
459 * elf64-s390.c (elf_s390_write_core_note): Likewise.
460 * elfxx-aarch64.c (_bfd_aarch64_elf_write_core_note): Likewise.
461
462 2018-07-05 Jim Wilson <jimw@sifive.com>
463
464 * config.bfd (riscv32*-*-*): Renamed from riscv32-*-*.
465 (riscv64*-*-*): Likewise.
466 (riscv-*-*): Add as an alias for riscv32*-*-*.
467
468 2018-07-05 H.J. Lu <hongjiu.lu@intel.com>
469
470 PR ld/23372
471 * elfxx-x86.c (_bfd_x86_elf_merge_gnu_properties): Remove x86
472 ISA properties with empty bits.
473
474 2018-07-05 Nick Clifton <nickc@redhat.com>
475
476 * po/ru.po: Updated Russian translation.
477
478 2018-07-05 Alan Modra <amodra@gmail.com>
479
480 * elf-bfd.h (_bfd_elf_ppc_merge_fp_attributes): Update prototype.
481 * elf32-ppc.c (_bfd_elf_ppc_merge_fp_attributes): Return error
482 on mismatch. Remove "warning: " from messages. Track last bfd
483 used to set tags.
484 (ppc_elf_merge_obj_attributes): Likewise. Handle status from
485 _bfd_elf_ppc_merge_fp_attributes.
486 * elf64-ppc.c (ppc64_elf_merge_private_bfd_data): Handle status
487 from _bfd_elf_ppc_merge_fp_attributes.
488
489 2018-07-04 H.J. Lu <hongjiu.lu@intel.com>
490
491 * Makefile.am (bfdinclude_HEADERS): Add $(INCDIR)/diagnostics.h.
492 * Makefile.in: Regenerated.
493
494 2018-07-03 Alan Modra <amodra@gmail.com>
495
496 * elflink.c (bfd_elf_final_link): Remove zero size .gnu.attributes
497 sections.
498
499 2018-07-03 Alan Modra <amodra@gmail.com>
500
501 * elf-bfd.h (ATTR_TYPE_FLAG_ERROR, ATTR_TYPE_HAS_ERROR): Define.
502 * elf-attrs.c (is_default_attr): Handle ATTR_TYPE_HAS_ERROR.
503 * elf32-ppc.c (_bfd_elf_ppc_merge_fp_attributes): Use
504 ATTR_TYPE_FLAG_INT_VAL. Set ATTR_TYPE_HAS_ERROR on finding
505 incompatible attribute.
506 (ppc_elf_merge_obj_attributes): Likewise. Return
507 _bfd_elf_merge_object_attributes result.
508 * elf64-ppc.c (ppc64_elf_merge_private_bfd_data): Return
509 _bfd_elf_merge_object_attributes result.
510
511 2018-07-03 Alan Modra <amodra@gmail.com>
512
513 PR 17550
514 * elflink.c (_bfd_elf_fix_symbol_flags): Hide dynamic symbols
515 in discarded sections.
516
517 2018-07-02 Maciej W. Rozycki <macro@mips.com>
518
519 * elfxx-mips.c (_bfd_mips_elf_create_dynamic_sections): Set
520 `mark' for symbols created from `mips_elf_dynsym_rtproc_names'
521 list.
522
523 2018-07-02 Maciej W. Rozycki <macro@mips.com>
524
525 * elf64-mips.c (micromips_elf64_howto_table_rel): Add
526 R_MICROMIPS_HI0_LO16, R_MICROMIPS_TLS_GD, R_MICROMIPS_TLS_LDM,
527 R_MICROMIPS_TLS_DTPREL_HI16, R_MICROMIPS_TLS_DTPREL_LO16,
528 R_MICROMIPS_TLS_GOTTPREL, R_MICROMIPS_TLS_TPREL_HI16,
529 R_MICROMIPS_TLS_TPREL_LO16, R_MICROMIPS_GPREL7_S2 and
530 R_MICROMIPS_PC23_S2 relocation entries.
531 (micromips_elf64_howto_table_rela): Likewise.
532 (micromips_reloc_map): Likewise.
533 * elfn32-mips.c (elf_micromips_howto_table_rel): Likewise.
534 (elf_micromips_howto_table_rela): Likewise.
535 (micromips_reloc_map): Likewise.
536
537 2018-07-02 H.J. Lu <hongjiu.lu@intel.com>
538
539 PR ld/23324
540 * elf64-x86-64.c (elf_x86_64_relocate_section): Clear the
541 R_X86_64_converted_reloc_bit bit.
542
543 2018-07-02 Jeff Muizelaar <jrmuizel@gmail.com>
544 Tom Tromey <tom@tromey.com>
545
546 PR 13157
547 PR 21787
548 * mach-o.c (bfd_mach_o_fat_close_and_cleanup): New function.
549 (bfd_mach_o_close_and_cleanup): Redefine.
550 * archive.c (_bfd_unlink_from_archive_parent): New function,
551 extracted from..
552 (_bfd_archive_close_and_cleanup): ..here.
553 (bfd_generic_archive_p): Do not clear archive's format.
554 * libbfd-in.h (_bfd_unlink_from_archive_parent): Declare.
555 * libbfd.h: Regenerate.
556
557 2018-07-02 Thomas Preud'homme <thomas.preudhomme@arm.com>
558
559 * archures.c (bfd_mach_arm_5TEJ, bfd_mach_arm_6, bfd_mach_arm_6KZ,
560 bfd_mach_arm_6T2, bfd_mach_arm_6K, bfd_mach_arm_7, bfd_mach_arm_6M,
561 bfd_mach_arm_6SM, bfd_mach_arm_7EM, bfd_mach_arm_8, bfd_mach_arm_8R,
562 bfd_mach_arm_8M_BASE, bfd_mach_arm_8M_MAIN): Define.
563 * bfd-in2.h: Regenerate.
564 * cpu-arm.c (arch_info_struct): Add entries for above new
565 bfd_mach_arm values.
566 * elf32-arm.c (bfd_arm_get_mach_from_attributes): Add Tag_CPU_arch to
567 bfd_mach_arm mapping logic for pre Armv4 and Armv5TEJ and later
568 architectures. Force assert failure for any new Tag_CPU_arch value.
569
570 2018-07-02 Thomas Preud'homme <thomas.preudhomme@arm.com>
571
572 * doc/bfdint.texi: Use command-line consistently when used in a
573 compount word.
574 * doc/bfdsumm.texi: Likewise.
575
576 2018-06-29 Maciej W. Rozycki <macro@mips.com>
577
578 * elfxx-mips.c (allocate_dynrelocs): Remove extraneous symbol
579 visibility check made for undefined weak symbols.
580
581 2018-06-26 Nick Clifton <nickc@redhat.com>
582
583 * po/uk.po: Updated Ukranian translation.
584
585 2018-06-25 Nick Clifton <nickc@redhat.com>
586
587 * elfnn-aarch64.c (_bfd_aarch64_erratum_835769_stub_name): Check
588 for malloc returning NULL.
589 (_bfd_aarch64_erratum_843419_fixup): Check for
590 _bfd_aarch64_erratum_835769_stub_name returning NULL.
591
592 2018-06-24 Nick Clifton <nickc@redhat.com>
593
594 * po/bfd.pot: Regenerate.
595
596 2018-06-24 Nick Clifton <nickc@redhat.com>
597
598 * version.m4: Update version string to 2.31.51.
599 * configure: Regenerate.
600
601 2018-06-24 Nick Clifton <nickc@redhat.com>
602
603 2.31 branch created.
604
605 2018-06-21 Maciej W. Rozycki <macro@mips.com>
606
607 * elfxx-mips.c (_bfd_mips_elf_compact_eh_encoding)
608 (_bfd_mips_elf_cant_unwind_opcode): Correct formatting.
609
610 2018-06-21 Maciej W. Rozycki <macro@mips.com>
611
612 * elfxx-mips.c (_bfd_mips_post_process_headers): Keep
613 EI_ABIVERSION setting together.
614
615 2018-06-21 Maciej W. Rozycki <macro@mips.com>
616
617 * elfxx-mips.c (MIPS_LIBC_ABI_DEFAULT, MIPS_LIBC_ABI_MIPS_PLT)
618 (MIPS_LIBC_ABI_UNIQUE, MIPS_LIBC_ABI_MIPS_O32_FP64)
619 (MIPS_LIBC_ABI_MAX): New enumeration constants.
620 (_bfd_mips_post_process_headers): Use them in place of magic
621 numbers.
622
623 2018-06-21 Jim Wilson <jimw@sifive.com>
624
625 * elfnn-riscv.c (riscv_elf_finish_dynamic_symbol): Update comment.
626 Use SYMBOL_REFERENCES_LOCAL. Add asserts for h->got.offset.
627
628 2018-06-21 Alan Modra <amodra@gmail.com>
629
630 * doc/Makefile.am (AUTOMAKE_OPTIONS): Add "foreign".
631 * doc/Makefile.in: Regenerate.
632
633 2018-06-20 Renlin Li <renlin.li@arm.com>
634
635 * elfxx-aarch64.c (_bfd_aarch64_elf_resolve_relocation): Use PG_OFFSET
636 to resolve BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC,
637 BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC,
638 BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC,
639 BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC,
640 BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12_NC,
641 BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12_NC,
642 BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12_NC,
643 BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12_NC.
644
645 2018-06-20 Nick Clifton <nickc@redhat.com>
646
647 PR 23316
648 * opncls.c (get_build_id): Check for a negative or excessive data
649 size in the build-id note.
650
651 2018-06-20 Nick Clifton <nickc@redhat.com>
652
653 PR 23299
654 * mach-o.c (cputype): New function.
655 (cpusubtype): New function.
656 (bfd_mach_o_bfd_print_private_data): New function. Dispalys the
657 values in the MACH-O file header.
658 (bfd_mach_o_bfd_copy_private_header_data): Copy the cputype and
659 cpusubtype fields from the input bfd's mach-o header to the output
660 bfd.
661 * mach-o-target.c (bfd_mach_o_bfd_print_private_bfd_data):
662 Redefine to bfd_mach_o_bfd_print_private_data.
663 * mach-o.h (bfd_mach_o_bfd_print_private_bfd_data): Prototype.
664
665 2018-06-19 Maciej W. Rozycki <macro@mips.com>
666
667 PR ld/22966
668 * elfxx-mips.c (_bfd_mips_elf_finish_dynamic_symbol): Verify the
669 `.got.plt' entry referred is in range.
670 (mips_finish_exec_plt): Correct the range check for `.got.plt'
671 start. Replace the assertion used for that with a proper error
672 message.
673
674 2018-06-19 Maciej W. Rozycki <macro@mips.com>
675
676 * elfxx-mips.c (_bfd_mips_elf_finish_dynamic_symbol): Fix
677 formatting.
678
679 2018-06-19 Simon Marchi <simon.marchi@ericsson.com>
680
681 * Makefile.am (AUTOMAKE_OPTIONS): Remove 1.11.
682 (INCLUDES): Rename to ...
683 (AM_CPPFLAGS): ... this.
684 * configure.ac: Remove AC_PREREQ.
685 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove 1.9, cygnus, add
686 info-in-builddir no-texinfo.tex.
687 (info_TEXINFOS): Rename bfd.texinfo to bfd.texi.
688 * doc/bfd.texinfo: Rename to ...
689 * doc/bfd.texi: ... this.
690 * Makefile.in: Re-generate.
691 * aclocal.m4: Re-generate.
692 * config.in: Re-generate.
693 * configure: Re-generate.
694 * doc/Makefile.in: Re-generate.
695
696 2018-06-18 Mephi <mephi42@gmail.com>
697
698 PR 23297
699 * mach-o-x86-64.c (x86_64_howto_table): Add entry for
700 BFD_RELOC_MACH_O_X86_64_RELOC_TLV.
701 (bfd_mach_o_x86_64_canonicalize_one_reloc): Handle the new reloc.
702 (bfd_mach_o_x86_64_swap_reloc_out): Likewise.
703 * reloc.c (BFD_RELOC_MACH_O_X86_64_TV): New entry.
704 * bfd-in2.h: Regenerate.
705 * libbfd.h: Regenerate.
706
707 2018-06-14 Faraz Shahbazker <Faraz.Shahbazker@mips.com>
708
709 * elfxx-mips.c (print_mips_ases): Add GINV extension.
710
711 2018-06-14 H.J. Lu <hongjiu.lu@intel.com>
712
713 PR binutils/23267
714 * elf.c (_bfd_elf_get_symbol_version_string): Check if the first
715 symbol version is base version.
716
717 2018-06-14 Alan Modra <amodra@gmail.com>
718
719 * elf-bfd.h (struct elf_link_hash_table): Add "dynamic_relocs".
720 * elflink.c (_bfd_elf_init_2_index_sections): Comment fix.
721 (_bfd_elf_add_dynamic_entry): Set "dynamic_relocs".
722 (_bfd_elf_link_renumber_dynsyms): Exclude all section symbols when
723 "dynamic_relocs" is not set.
724 * elfxx-mips.c (count_section_dynsyms): Likewise.
725
726 2018-06-14 Alan Modra <amodra@gmail.com>
727
728 PR 23282
729 * bfdio.c (bfd_seek): Optimize away seeks to current position.
730
731 2018-06-13 Scott Egerton <scott.egerton@imgtec.com>
732 Faraz Shahbazker <Faraz.Shahbazker@mips.com>
733
734 * elfxx-mips.c (print_mips_ases): Add CRC.
735
736 2018-06-08 H.J. Lu <hongjiu.lu@intel.com>
737
738 PR ld/23161
739 * elfxx-x86.c (elf_x86_hide_linker_defined): New function.
740 (_bfd_x86_elf_link_check_relocs): Use it to hide hidden
741 __bss_start, _end and _edata in shared libraries.
742
743 2018-06-07 Alan Modra <amodra@gmail.com>
744
745 * elf32-tic6x.c (elf32_tic6x_check_relocs): Reference
746 __c6xabi_DSBT_BASE explicitly for R_C6000_SBR_* relocs.
747
748 2018-06-05 Alan Modra <amodra@gmail.com>
749
750 * bfd.c (struct bfd): Update comment on "where" usage.
751 * bfdio.c (bfd_bwrite, bfd_stat): Use and update "iovec",
752 "iostream", and "where" from containing archive file. Return
753 error on NULL iovec.
754 (bfd_bread): Similarly, and return error attempted out of
755 bounds archive element access.
756 (bfd_tell, bfd_flush): Use and update "iovec", "iostream", and
757 "where" from containing archive file.
758 (bfd_seek): Likewise. Return error on NULL iovec. Don't
759 attempt to optimize away seeks. Don't paper over errors by
760 calling bfd_tell.
761 (bfd_get_mtime): Call bfd_stat rather than iovec->bstat.
762 (bfd_get_size): Likewise.
763 (bfd_mmap): Operate on and use iovec of containing archive
764 file. Return error on NULL iovec.
765 * cache.c (bfd_cache_lookup_worker): Abort if working on
766 archive element bfd.
767 (cache_bread_1): Delete bfd parameter, add FILE* parameter.
768 Don't ignore zero byte reads.
769 (cache_bread): Look up FILE* in cache here. Error on NULL
770 lookup.
771 (cache_bwrite): Rename "where" to "from".
772 (cache_bmmap): Don't handle archive elements.
773 * coffcode.h (coff_slurp_line_table): Exit early on zero
774 lineno count.
775 * bfd-in2.h: Regenerate.
776
777 2018-06-05 Alan Modra <amodra@gmail.com>
778
779 PR 23254
780 * plugin.c (bfd_plugin_open_input): Allow for possibility of
781 nested archives. Open file again for plugin.
782 (try_claim): Don't save and restore file position. Close file
783 if not claimed.
784 * sysdep.h (O_BINARY): Define.
785
786 2018-06-04 Max Filippov <jcmvbkbc@gmail.com>
787
788 * elf32-xtensa.c (xtensa_read_table_entries): Make global.
789 (compute_fill_extra_space): Drop declaration. Rename function to
790 xtensa_compute_fill_extra_space.
791 (compute_ebb_actions, remove_dead_literal): Update references to
792 compute_fill_extra_space.
793
794 2018-06-04 Volodymyr Arbatov <arbatov@cadence.com>
795
796 * elf32-xtensa.c (elf32xtensa_separate_props): New global
797 variable.
798 (xtensa_add_names): New function.
799 (xtensa_property_section_name): Add new parameter
800 separate_sections, use it to choose property section name.
801 (xtensa_get_separate_property_section): New function.
802 (xtensa_get_property_section): Invoke
803 xtensa_get_separate_property_section to get individual property
804 section if it exists, common property section otherwise.
805 (xtensa_make_property_section): Pass elf32xtensa_separate_props
806 to xtensa_property_section_name.
807
808 2018-06-04 H.J. Lu <hongjiu.lu@intel.com>
809
810 PR binutils/23146
811 * bfd-in.h: Include "diagnostics.h".
812 * bfd-in2.h: Regenerated.
813 * elf32-arm.c (elf32_arm_nabi_write_core_note): Use
814 DIAGNOSTIC_PUSH, DIAGNOSTIC_IGNORE_STRINGOP_TRUNCATION and
815 DIAGNOSTIC_POP to silence GCC 8.1 warnings with
816 -Wstringop-truncation.
817 * elf32-ppc.c (ppc_elf_write_core_note): Likewse.
818 * elf32-s390.c (elf_s390_write_core_note): Likewse.
819 * elf64-ppc.c (ppc64_elf_write_core_note): Likewse.
820 * elf64-s390.c (elf_s390_write_core_note): Likewse.
821 * elfxx-aarch64.c (_bfd_aarch64_elf_write_core_note): Likewse.
822
823 2018-06-03 Jim Wilson <jimw@sifive.com>
824
825 PR ld/23244
826 * elfnn-riscv.c (riscv_elf_relocate_section) <R_RISCV_CALL>: Check
827 for and handle an undefined weak with no PLT.
828
829 PR ld/22756
830 * elfnn-riscv.c (riscv_relax_delete_bytes): Add versioned_hidden check
831 to code that ignores duplicate symbols.
832
833 2018-06-01 H.J. Lu <hongjiu.lu@intel.com>
834
835 * version.m4: Bump version to 2.30.52
836 * configure: Regenerated.
837
838 2018-06-01 Alan Modra <amodra@gmail.com>
839
840 * bfd.c (_bfd_error_handler): Arrange for this function to be
841 declared in bfd-in2.h.
842 * libbfd-in.h (_bfd_error_handler): Don't declare.
843 * libbfd.h: Regenerate.
844 * bfd-in2.h: Regenerate.
845
846 2018-05-30 Amaan Cheval <amaan.cheval@gmail.com>
847
848 * config.bfd (x86_64-*-*): Add pei-x86-64 target to x86_64-*-rtems*
849 This is needed to generate UEFI application image files from ELFs.
850
851 2018-05-28 H.J. Lu <hongjiu.lu@intel.com>
852
853 * elf32-i386.c (elf_i386_lazy_plt): Add plt_tlsdesc_entry,
854 plt_tlsdesc_entry_size, plt_tlsdesc_got1_offset,
855 plt_tlsdesc_got2_offset, plt_tlsdesc_got1_insn_end and
856 plt_tlsdesc_got2_insn_end for TLSDESC entry.
857 (elf_i386_lazy_ibt_plt): Likewise.
858 (elf_i386_nacl_plt): Likewise.
859 * elf64-x86-64.c (tlsdesc_plt_entry): Moved and renamed to ...
860 (elf_x86_64_tlsdesc_plt_entry): This.
861 (elf_x86_64_lazy_plt): Add plt_tlsdesc_entry,
862 plt_tlsdesc_entry_size, plt_tlsdesc_got1_offset,
863 plt_tlsdesc_got2_offset, plt_tlsdesc_got1_insn_end and
864 plt_tlsdesc_got2_insn_end for TLSDESC entry.
865 (elf_x86_64_lazy_bnd_plt): Likewise.
866 (elf_x86_64_lazy_ibt_plt): Likewise.
867 (elf_x32_lazy_ibt_plt): Likewise.
868 (elf_x86_64_nacl_plt): Likewise.
869 (elf_x86_64_finish_dynamic_sections): Use plt_tlsdesc_entry,
870 plt_tlsdesc_entry_size, plt_tlsdesc_got1_offset,
871 plt_tlsdesc_got2_offset, plt_tlsdesc_got1_insn_end and
872 plt_tlsdesc_got2_insn_end to update TLSDESC entry.
873 * elfxx-x86.h (elf_x86_lazy_plt_layout): Update comments.
874 Add plt_tlsdesc_entry, plt_tlsdesc_entry_size,
875 plt_tlsdesc_got1_offset, plt_tlsdesc_got2_offset,
876 plt_tlsdesc_got1_insn_end and plt_tlsdesc_got2_insn_end.
877 (elf_x86_non_lazy_plt_layout): Update comments.
878 (elf_x86_plt_layout): Likewise.
879
880 2018-05-28 H.J. Lu <hongjiu.lu@intel.com>
881
882 PR ld/23238
883 * elf-s390-common.c (elf_s390_add_symbol_hook): Removed.
884 * elf32-arc.c (elf_arc_add_symbol_hook): Likewise.
885 (elf_backend_add_symbol_hook): Likewise.
886 * elf32-m68k.c (elf_m68k_add_symbol_hook): Likewise.
887 (elf_backend_add_symbol_hook): Likewise.
888 * elf32-s390.c (elf_backend_add_symbol_hook): Likewise.
889 * elf32-sparc.c (elf32_sparc_add_symbol_hook): Likewise.
890 (elf_backend_add_symbol_hook): Likewise.
891 * elf64-s390.c (elf_backend_add_symbol_hook): Likewise.
892 * elfxx-aarch64.c (_bfd_aarch64_elf_add_symbol_hook): Likewise.
893 * elfxx-aarch64.h (_bfd_aarch64_elf_add_symbol_hook): Likewise.
894 (elf_backend_add_symbol_hook): Likewise.
895 * elf32-arm.c (elf32_arm_add_symbol_hook): Remove STT_GNU_IFUNC
896 handling.
897 * elf32-ppc.c (ppc_elf_add_symbol_hook): Likewise.
898 * elf64-ppc.c (ppc64_elf_add_symbol_hook): Likewise.
899 * elf64-sparc.c (elf64_sparc_add_symbol_hook): Likewise.
900 * elflink.c (elf_link_add_object_symbols): Set
901 elf_gnu_symbol_ifunc for STT_GNU_IFUNC symbols.
902
903 2018-05-26 H.J. Lu <hongjiu.lu@intel.com>
904
905 PR ld/23194
906 * elf-bfd.h (_bfd_elf_link_hide_sym_by_version): New.
907 * elflink.c (_bfd_elf_link_hide_versioned_symbol): New function.
908 Extracted from _bfd_elf_link_assign_sym_version.
909 (_bfd_elf_link_hide_sym_by_version): New function.
910 (_bfd_elf_link_assign_sym_version): Use
911 _bfd_elf_link_hide_versioned_symbol.
912 * elfxx-x86.c (_bfd_x86_elf_link_symbol_references_local): Call
913 _bfd_elf_link_hide_sym_by_version instead of
914 bfd_hide_sym_by_version. Don't check unversioned symbol.
915
916 2018-05-25 Alan Modra <amodra@gmail.com>
917
918 * Makefile.in: Regenerate.
919 * po/SRC-POTFILES.in: Regenerate.
920
921 2018-05-25 Alan Modra <amodra@gmail.com>
922
923 * configure.ac (bfd_cv_hidden): Run test with -Werror in CFLAGS.
924 * configure: Regenerate.
925
926 2018-05-23 H.J. Lu <hongjiu.lu@intel.com>
927
928 * elf64-ppc.c (ppc64_elf_write_core_note): Add ATTRIBUTE_NONSTRING
929 to data.
930
931 2018-05-22 Alan Modra <amodra@gmail.com>
932
933 PR 23207
934 * elf32-hppa.c (hppa_get_stub_entry): Return NULL when link_sec
935 is NULL.
936 (elf32_hppa_size_stubs): Only create stubs for load, alloc, code
937 sections.
938 (final_link_relocate): Revert last change.
939
940 2018-05-22 Alan Modra <amodra@gmail.com>
941
942 PR 23207
943 * elf32-hppa.c (final_link_relocate): Don't look for plt call
944 stubs in non-alloc sections.
945
946 2018-05-21 H.J. Lu <hongjiu.lu@intel.com>
947
948 PR ld/23201
949 * aout-target.h (MY_bfd_link_hide_symbol): New.
950 * aout-tic30.c (MY_bfd_link_hide_symbol): Likewise.
951 * binary.c (binary_bfd_link_hide_symbol): Likewise.
952 * coff-alpha.c (_bfd_ecoff_bfd_link_hide_symbol): Likewise.
953 * coff-mips.c (_bfd_ecoff_bfd_link_hide_symbol): Likewise.
954 * coff-rs6000.c (_bfd_xcoff_bfd_link_hide_symbol): Likewise.
955 * coffcode.h (coff_bfd_link_hide_symbol): Likewise.
956 * elf-bfd.h (_bfd_elf_link_hide_symbol): Likewise.
957 * elfxx-target.h (bfd_elfNN_bfd_link_hide_symbol): Likewise.
958 * i386msdos.c (msdos_bfd_link_hide_symbol): Likewise.
959 * ihex.c (ihex_bfd_link_hide_symbol): Likewise.
960 * libbfd-in.h (_bfd_nolink_bfd_link_hide_symbol): Likewise.
961 * linker.c (_bfd_generic_link_hide_symbol): Likewise.
962 (bfd_link_hide_symbol): Likewise.
963 * mach-o-target.c (bfd_mach_o_bfd_link_hide_symbol): Likewise.
964 * mmo.c (mmo_bfd_link_hide_symbol): Likewise.
965 * pef.c (bfd_pef_bfd_link_hide_symbol): Likewise.
966 * plugin.c (bfd_plugin_bfd_link_hide_symbol): Likewise.
967 * ppcboot.c (ppcboot_bfd_link_hide_symbol): Likewise.
968 * som.c (som_bfd_link_hide_symbol): Likewise.
969 * srec.c (srec_bfd_link_hide_symbol): Likewise.
970 * tekhex.c (tekhex_bfd_link_hide_symbol): Likewise.
971 * vms-alpha.c (vms_bfd_link_hide_symbol): Likewise.
972 (alpha_vms_bfd_link_hide_symbol): Likewise.
973 * xsym.c (bfd_sym_bfd_link_hide_symbol): Likewise.
974 * coff64-rs6000.c (rs6000_xcoff64_vec): Add
975 _bfd_generic_link_hide_symbol.
976 (rs6000_xcoff64_aix_vec): Likewise.
977 * elflink.c (bfd_elf_record_link_assignment): Don't make forced
978 local symbol dynamic.
979 (_bfd_elf_link_hide_symbol): New function.
980 * elfxx-x86.c (_bfd_x86_elf_link_symbol_references_local): Don't
981 check root.ldscript_def.
982 * targets.c (bfd_target): Add _bfd_link_hide_symbol.
983 (BFD_JUMP_TABLE_LINK): Add NAME##_bfd_link_hide_symbol.
984 * bfd-in2.h: Regenerated.
985 * libbfd.h: Likewise.
986
987 2018-05-21 H.J. Lu <hongjiu.lu@intel.com>
988
989 PR binutils/23199
990 * elf.c (setup_group): Mark section in a section group with
991 SHF_GROUP.
992
993 2018-05-18 H.J. Lu <hongjiu.lu@intel.com>
994
995 PR ld/23194
996 * elfxx-x86.c (_bfd_x86_elf_link_symbol_references_local): Don't
997 set eh->local_ref to 1 if a symbol is versioned and there is a
998 version script.
999
1000 2018-05-18 Kito Cheng <kito.cheng@gmail.com>
1001
1002 * elfnn-riscv.c (_bfd_riscv_elf_merge_private_bfd_data): Handle
1003 EF_RISCV_RVE.
1004
1005 2018-05-18 Jim Wilson <jimw@sifive.com>
1006
1007 * elfnn-riscv.c (allocate_dynrelocs): Discard dynamic relocations if
1008 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
1009 (riscv_elf_relocate_section): Don't generate dynamic relocation if
1010 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
1011 (riscv_elf_finish_dynamic_symbol): Likewise.
1012
1013 2018-05-18 John Darrington <john@darrington.wattle.id.au>
1014
1015 * Makefile.am: Add s12z files.
1016 * Makefile.in: Regenerate.
1017 * archures.c: Add bfd_s12z_arch.
1018 * bfd-in.h: Add exports of bfd_putb24 and bfd_putl24.
1019 * bfd-in2.h: Regenerate.
1020 * config.bfd: Add s12z target.
1021 * configure.ac: Add s12z target.
1022 * configure: Regenerate.
1023 * cpu-s12z.c: New file.
1024 * elf32-s12z.c: New file.
1025 * libbfd.c (bfd_putb24): New function.
1026 (bfd_putl24): New function.
1027 * libbfd.h: Regenerate.
1028 * reloc.c: Add s12z relocations.
1029 (bfd_get_reloc_size): Handle size 5 relocs.
1030 * targets.c: Add s12z_elf32_vec.
1031
1032 2018-05-18 H.J. Lu <hongjiu.lu@intel.com>
1033
1034 PR ld/23189
1035 * elf32-i386.c (elf_i386_relocate_section): Handle R_386_GOT32X
1036 like R_386_GOT32.
1037 * elfxx-x86.c (_bfd_x86_elf_link_symbol_references_local): Don't
1038 set eh->local_ref to 1 for linker defined symbols.
1039
1040 2018-05-18 Alan Modra <amodra@gmail.com>
1041
1042 PR 23199
1043 * elf.c (setup_group): Formatting. Check that SHT_GROUP entries
1044 don't point at other SHT_GROUP sections. Set shdr corresponding
1045 to invalid entry, to NULL rather than section 0. Identify
1046 SHT_GROUP section index when reporting an error. Cope with NULL
1047 shdr pointer.
1048
1049 2018-05-18 Alan Modra <amodra@gmail.com>
1050
1051 * libbfd-in.h (ATTRIBUTE_HIDDEN): Define and use throughout.
1052 * configure.ac (HAVE_HIDDEN): Check compiler support for hidden
1053 visibility.
1054 * libbfd.h: Regenerate.
1055 * configure: Regenerate.
1056 * config.in: Regenerate.
1057
1058 2018-05-18 Alan Modra <amodra@gmail.com>
1059
1060 * libbfd-in.h: Add include guard.
1061 * libcoff-in.h: Likewise.
1062 * doc/Makefile.am (libbfd.h, libcoff.h): Append another #endif.
1063 * doc/Makefile.in: Regenerate.
1064 * libbfd.h: Regenerate.
1065 * libcoff.h: Regenerate.
1066
1067 2018-05-16 Maciej W. Rozycki <macro@mips.com>
1068
1069 * elf32-nds32.c (nds32_convert_32_to_16): Preset `insn_type'.
1070
1071 2018-05-16 Alan Modra <amodra@gmail.com>
1072
1073 PR 22458
1074 * format.c (struct bfd_preserve): Add section_id.
1075 (bfd_preserve_save, bfd_preserve_restore): Save and restore
1076 _bfd_section_id.
1077 (bfd_reinit): Set _bfd_section_id.
1078 (bfd_check_format_matches): Put all matches of any priority into
1079 matching_vector. Save initial section id and start each attempted
1080 match at that section id.
1081 * libbfd-in.h (_bfd_section_id): Declare.
1082 * section.c (_bfd_section_id): Rename from section_id and make
1083 global. Adjust uses.
1084 (bfd_get_next_section_id): Delete.
1085 * elf64-ppc.c (ppc64_elf_setup_section_lists): Replace use of
1086 bfd_get_section_id with _bfd_section_id.
1087 * libbfd.h: Regenerate.
1088 * bfd-in2.h: Regenerate.
1089
1090 2018-05-15 Christophe Guillon <christophe.guillon@st.com>
1091
1092 * coffcode.h (coff_bigobj_swap_aux_in): Make sure that all fields
1093 of the aux structure are initialised.
1094
1095 2018-05-15 Francois H. Theron <francois.theron@netronome.com>
1096
1097 * targets.c: Wrap nfp_elf64_vec in BFD64 ifdef.
1098
1099 2018-05-15 Nick Clifton <nickc@redhat.com>
1100
1101 * po/pt.po: New Portuguese translation.
1102 * configure.ac (ALL_LINGUAS): Add pt.
1103 * configure: Regenerate.
1104
1105 2018-05-14 H.J. Lu <hongjiu.lu@intel.com>
1106
1107 PR ld/23169
1108 * elf-ifunc.c (_bfd_elf_allocate_ifunc_dyn_relocs): Don't issue
1109 an error on IFUNC pointer defined in PDE.
1110 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Call
1111 _bfd_x86_elf_link_fixup_ifunc_symbol.
1112 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
1113 * elfxx-x86.c (_bfd_x86_elf_link_fixup_ifunc_symbol): New
1114 function.
1115 * elfxx-x86.h (_bfd_x86_elf_link_fixup_ifunc_symbol): New.
1116
1117 2018-05-14 H.J. Lu <hongjiu.lu@intel.com>
1118
1119 PR ld/23162
1120 * elfxx-x86.c (elf_x86_linker_defined): New function.
1121 (_bfd_x86_elf_link_check_relocs): Use it to mark __bss_start,
1122 _end and _edata locally defined within executables.
1123
1124 2018-05-12 Alan Modra <amodra@gmail.com>
1125
1126 PR 20659
1127 * elf.c (rewrite_elf_program_header): Use segment_mark only for
1128 PT_LOAD headers. Delete first_matching_lma and first_suggested_lma.
1129 Instead make matching_lma and suggested_lma pointers to the
1130 sections. Align section vma and lma calculated from segment.
1131 Don't clear includes_phdrs or includes_filehdr based on p_paddr
1132 test. Try to handle alignment padding before first section by
1133 adjusting new segment lma down. Adjust PT_PHDR map p_paddr.
1134
1135 2018-05-09 Dimitar Dimitrov <dimitar@dinux.eu>
1136
1137 * elf32-pru.c (pru_elf32_do_ldi32_relocate): Make LDI32 relocation
1138 conformant to TI ABI.
1139 (pru_elf32_relax_section): Likewise.
1140 (pru_elf_relax_delete_bytes): Fix offsets for new LDI32 code.
1141 * elf32-pru.c (pru_elf32_do_ldi32_relocate): Ignore addend.
1142 (pru_elf32_pmem_relocate): Trap - should not get here.
1143 (pru_elf32_relocate_section): Add support for REL relocations.
1144 (elf_info_to_howto_rel): Enable REL.
1145 (elf_backend_may_use_rel_p): Likewise.
1146 (elf_backend_may_use_rela_p): Likewise.
1147 (elf_backend_default_use_rela_p): Likewise.
1148
1149 2018-05-09 Alan Modra <amodra@gmail.com>
1150
1151 PR 23148
1152 * peXXigen.c (pe_print_edata): Correct minimum size.
1153
1154 2018-05-09 Alan Modra <amodra@gmail.com>
1155
1156 PR 23147
1157 * peXXigen.c (pe_print_idata): Bound check hint_addr.
1158
1159 2018-05-08 Nick Clifton <nickc@redhat.com>
1160
1161 PR 22809
1162 * elf.c (bfd_elf_get_str_section): Check for an excessively large
1163 string section.
1164 * elf-attrs.c (_bfd_elf_parse_attributes): Issue an error if the
1165 attribute section is larger than the size of the file.
1166
1167 2018-05-07 Alan Modra <amodra@gmail.com>
1168
1169 * cofflink.c (_bfd_coff_link_input_bfd): Use memcmp rather than
1170 strncmp when checking for ".bf" special symbol.
1171 * peXXigen.c (_bfd_XXi_swap_scnhdr_out): Make pe_required_section_flags
1172 section name a char array, remove sentinal known_sections entry,
1173 and adjust loop over known_sections to suit. Use memcmp rather
1174 than strncmp.
1175
1176 2018-05-04 Alan Modra <amodra@gmail.com>
1177
1178 * elf-linux-core.h (struct elf_external_linux_prpsinfo32_ugid32),
1179 (struct elf_external_linux_prpsinfo32_ugid16),
1180 (struct elf_external_linux_prpsinfo64_ugid32),
1181 (struct elf_external_linux_prpsinfo64_ugid16): Add ATTRIBUTE_NONSTRING
1182 to pr_fname and pr_psargs fields. Remove GCC diagnostic pragmas.
1183 Move comment to..
1184 * elf.c (elfcore_write_prpsinfo): ..here. Indent nested preprocessor
1185 directives.
1186 * elf32-arm.c (elf32_arm_nabi_write_core_note): Add ATTRIBUTE_NONSTRING
1187 to data.
1188 * elf32-ppc.c (ppc_elf_write_core_note): Likewise.
1189 * elf32-s390.c (elf_s390_write_core_note): Likewise.
1190 * elf64-s390.c (elf_s390_write_core_note): Likewise.
1191 * elfxx-aarch64.c (_bfd_aarch64_elf_write_core_note): Likewise.
1192 * elf64-x86-64.c (elf_x86_64_write_core_note): Add GCC diagnostic
1193 pragmas.
1194 * peXXigen.c (_bfd_XXi_swap_scnhdr_out): Use strnlen to avoid
1195 false positive gcc-8 warning.
1196 * cofflink.c (_bfd_coff_link_input_bfd): Likewise.
1197
1198 2018-05-04 Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
1199
1200 * elf32-ppc.c (_bfd_elf_ppc_merge_fp_attributes): Fix the order
1201 of arguments when warning about different long double types.
1202
1203 2018-05-03 Simon Atanasyan <simon@atanasyan.com>
1204
1205 * elf32-mips.c: (elf32_mips_fixup_symbol): New function.
1206 (elf_backend_fixup_symbol): New macro.
1207 * elfxx-mips.c: (mips_elf_output_extsym): Discard _gp_disp
1208 handling.
1209 (_bfd_mips_elf_finish_dynamic_symbol): Likewise.
1210
1211 2018-04-30 Francois H. Theron <francois.theron@netronome.com>
1212
1213 * Makefile.am: Added NFP files to build.
1214 * archures.c: Added bfd_arch_nfp
1215 * config.bfd: Added NFP support.
1216 * configure.ac: Added NFP support.
1217 * cpu-nfp.c: New, for NFP support.
1218 * elf-bfd.h: Added elf_section_info()
1219 * elf64-nfp.c: New, for NFP support.
1220 * po/SRC-POTFILES.in: Added NFP source files.
1221 * targets.c: Added nfp_elf64_vec
1222 * bfd-in2.h: Regenerate.
1223 * Makefile.in: Regenerate.
1224 * configure: Regenerate.
1225
1226 2018-04-27 Alan Modra <amodra@gmail.com>
1227
1228 * bfd-in2.h: Regenerate.
1229 * libbfd.h: Regenerate.
1230
1231 2018-04-27 Alan Modra <amodra@gmail.com>
1232
1233 PR 23123
1234 PR 22374
1235 * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Don't drop plt
1236 relocs for ifuncs.
1237 * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Comment fixes.
1238
1239 2018-04-26 Pedro Alves <palves@redhat.com>
1240
1241 * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Don't consider
1242 ifunc and non-ifunc symbols duplicates.
1243
1244 2018-04-25 Christophe Lyon <christophe.lyon@st.com>
1245 Mickaël Guêné <mickael.guene@st.com>
1246
1247 * elf32-arm.c (elf32_arm_fdpic_thumb_plt_entry): New.
1248 (elf32_arm_plt_needs_thumb_stub_p): Handle thumb-only case.
1249 (elf32_arm_populate_plt_entry): Likewise.
1250 (elf32_arm_output_plt_map_1): Likewise.
1251 (elf32_arm_output_arch_local_syms): Likewise.
1252
1253 2018-04-25 Christophe Lyon <christophe.lyon@st.com>
1254 Mickaël Guêné <mickael.guene@st.com>
1255
1256 * elf32-arm.c (elf32_arm_finish_dynamic_symbol): Handle
1257 _GLOBAL_OFFSET_TABLE_ in FDPIC mode.
1258
1259 2018-04-25 Christophe Lyon <christophe.lyon@st.com>
1260 Mickaël Guêné <mickael.guene@st.com>
1261
1262 * elf32-arm.c (bfd_elf32_arm_set_target_params): Handle FDPIC case
1263 for R_ARM_TARGET2.
1264
1265 2018-04-25 Christophe Lyon <christophe.lyon@st.com>
1266 Mickaël Guêné <mickael.guene@st.com>
1267
1268 * elf32-arm.c (DEFAULT_STACK_SIZE): New.
1269 (elf32_arm_always_size_sections): Create stack segment.
1270
1271 2018-04-25 Christophe Lyon <christophe.lyon@st.com>
1272 Mickaël Guêné <mickael.guene@st.com>
1273
1274 * bfd-in2.h (BFD_RELOC_ARM_TLS_GD32_FDPIC)
1275 (BFD_RELOC_ARM_TLS_LDM32_FDPIC, BFD_RELOC_ARM_TLS_IE32_FDPIC): New
1276 relocations.
1277 * elf32-arm.c (elf32_arm_howto_table_2): Add R_ARM_TLS_GD32_FDPIC,
1278 R_ARM_TLS_LDM32_FDPIC, R_ARM_TLS_IE32_FDPIC relocations.
1279 (elf32_arm_reloc_map): Add R_ARM_TLS_GD32_FDPIC,
1280 R_ARM_TLS_LDM32_FDPIC, R_ARM_TLS_IE32_FDPIC.
1281 (struct elf32_arm_link_hash_table): Update comment.
1282 (elf32_arm_final_link_relocate): Handle TLS FDPIC relocations.
1283 (IS_ARM_TLS_RELOC): Likewise.
1284 (elf32_arm_check_relocs): Likewise.
1285 (allocate_dynrelocs_for_symbol): Likewise.
1286 (elf32_arm_size_dynamic_sections): Update comment.
1287 * reloc.c: Add BFD_RELOC_ARM_TLS_GD32_FDPIC,
1288 BFD_RELOC_ARM_TLS_LDM32_FDPIC, BFD_RELOC_ARM_TLS_IE32_FDPIC.
1289
1290 2018-04-25 Christophe Lyon <christophe.lyon@st.com>
1291 Mickaël Guêné <mickael.guene@st.com>
1292
1293 * elf32-arm.c (elf32_arm_fdpic_plt_entry): New.
1294 (elf32_arm_create_dynamic_sections): Handle FDPIC.
1295 (elf32_arm_allocate_plt_entry): Likewise.
1296 (elf32_arm_populate_plt_entry): Likewise.
1297 (elf32_arm_output_plt_map_1): Likewise.
1298
1299 2018-04-25 Christophe Lyon <christophe.lyon@st.com>
1300 Mickaël Guêné <mickael.guene@st.com>
1301
1302 * elf32-arm.c (struct fdpic_local): New.
1303 (elf_arm_obj_tdata): Add local_fdpic_cnts field.
1304 (elf32_arm_local_fdpic_cnts): New.
1305 (struct fdpic_global): New.
1306 (elf32_arm_link_hash_entry): Add fdpic_cnts field.
1307 (elf32_arm_link_hash_table): Add srofixup field.
1308 (arm_elf_add_rofixup): New.
1309 (arm_elf_fill_funcdesc): New.
1310 (elf32_arm_link_hash_newfunc): Handle fdpic_cnts.
1311 (elf32_arm_allocate_local_sym_info): Likewise.
1312 (create_got_section): Create .rofixup section.
1313 (elf32_arm_copy_indirect_symbol): Handle fdpic_cnts.
1314 (bfd_elf32_arm_set_target_params): Handle FDPIC.
1315 (elf32_arm_final_link_relocate): Likewise.
1316 (elf32_arm_check_relocs): Likewise.
1317 (allocate_dynrelocs_for_symbol): Likewise.
1318 (elf32_arm_size_dynamic_sections): Likewise.
1319 (elf32_arm_finish_dynamic_sections): Likewise.
1320 (elf32_arm_output_arch_local_syms): Likewise.
1321 (elf32_arm_fdpic_omit_section_dynsym): New.
1322
1323 2018-04-25 Christophe Lyon <christophe.lyon@st.com>
1324 Mickaël Guêné <mickael.guene@st.com>
1325
1326 * bfd-in2.c (BFD_RELOC_ARM_GOTFUNCDESC)
1327 (BFD_RELOC_ARM_GOTOFFFUNCDESC, BFD_RELOC_ARM_FUNCDESC)
1328 (BFD_RELOC_ARM_FUNCDESC_VALUE): New.
1329 * elf32-arm.c (elf32_arm_howto_table_2): Add R_ARM_GOTFUNCDESC,
1330 R_ARM_GOTOFFFUNCDESC, R_ARM_FUNCDESC, R_ARM_FUNCDESC_VALUE.
1331 (elf32_arm_howto_from_type): Take new members of
1332 elf32_arm_howto_table_2 into account.
1333 (elf32_arm_reloc_map): Add BFD_RELOC_ARM_GOTFUNCDESC,
1334 BFD_RELOC_ARM_GOTOFFFUNCDESC, BFD_RELOC_ARM_FUNCDESC,
1335 BFD_RELOC_ARM_FUNCDESC_VALUE.
1336 * reloc.c: Add BFD_RELOC_ARM_GOTFUNCDESC,
1337 BFD_RELOC_ARM_GOTOFFFUNCDESC, BFD_RELOC_ARM_FUNCDESC,
1338 BFD_RELOC_ARM_FUNCDESC_VALUE.
1339
1340 2018-04-25 Christophe Lyon <christophe.lyon@st.com>
1341 Mickaël Guêné <mickael.guene@st.com>
1342
1343 * elf32-arm.c (elf32_arm_print_private_bfd_data): Support
1344 EF_ARM_PIC and ELFOSABI_ARM_FDPIC.
1345 (elf32_arm_post_process_headers): Support ELFOSABI_ARM_FDPIC.
1346 (ELF_OSABI): Define to ELFOSABI_ARM_FDPIC.
1347
1348 2018-04-25 Christophe Lyon <christophe.lyon@st.com>
1349 Mickaël Guêné <mickael.guene@st.com>
1350
1351 * config.bfd (arm*-*-linux-*): Add arm_elf32_fdpic_be_vec and
1352 arm_elf32_fdpic_le_vec to targ_selvecs. Accept
1353 arm*-*-uclinuxfdpiceabi.
1354 * configure.ac: Add support for arm_elf32_fdpic_be_vec and
1355 arm_elf32_fdpic_le_vec.
1356 * configure: Regenerate.
1357 * elf32-arm.c (struct elf32_arm_link_hash_table): Add fdpic_p.
1358 (elf32_arm_link_hash_table_create): Initialize fdpic_p.
1359 (TARGET_LITTLE_SYM, TARGET_LITTLE_NAME, TARGET_BIG_SYM)
1360 (TARGET_BIG_NAME, elf_match_priority): Define for FDPIC targets.
1361 (elf32_arm_fdpic_link_hash_table_create): New.
1362 * targets.c (_bfd_target_vector): Add arm_elf32_fdpic_be_vec and
1363 arm_elf32_fdpic_le_vec.
1364
1365 2018-04-25 Alan Modra <amodra@gmail.com>
1366
1367 * elf-linux-core.h: Disable gcc-8 string truncation warning.
1368 * elf.c (elfcore_write_prpsinfo): Likewise.
1369
1370 2018-04-25 Alan Modra <amodra@gmail.com>
1371
1372 * Makefile.am: Remove arm-aout and arm-coff support.
1373 * config.bfd: Likewise.
1374 * configure.ac: Likewise.
1375 * targets.c: Likewise.
1376 * aout-arm.c: Delete.
1377 * armnetbsd.c: Delete.
1378 * riscix.c: Delete.
1379 * Makefile.in: Regenerate.
1380 * configure: Regenerate.
1381 * po/SRC-POTFILES.in: Regenerate.
1382
1383 2018-04-24 Nick Clifton <nickc@redhat.com>
1384
1385 PR 23113
1386 * elf.c (ignore_section_sym): Check for the output_section pointer
1387 being NULL before dereferencing it.
1388
1389 PR 23110
1390 * peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Check for
1391 a negative PE_DEBUG_DATA size before iterating over the debug data.
1392
1393 2018-04-23 Alan Modra <amodra@gmail.com>
1394
1395 * elf-linux-core.h: Revert last change.
1396 * elf.c: Likewise.
1397
1398 2018-04-23 Nick Clifton <nickc@redhat.com>
1399
1400 PR 23056
1401 * aoutx.h (aout_get_external_symbols): Allocate an extra byte at
1402 the end of the string table, and zero it.
1403
1404 2018-04-23 Alan Modra <amodra@gmail.com>
1405
1406 * elf-linux-core.h (swap_linux_prpsinfo32_ugid32_out): Disable
1407 gcc-8 string truncation warning.
1408 (swap_linux_prpsinfo32_ugid16_out): Likewise.
1409 (swap_linux_prpsinfo64_ugid32_out): Likewise.
1410 (swap_linux_prpsinfo64_ugid16_out): Likewise.
1411 * elf.c (elfcore_write_prpsinfo): Likewise.
1412
1413 2018-04-23 Nick Clifton <nickc@redhat.com>
1414
1415 PR 23056
1416 * aoutx.h (aout_get_external_symbols): Allocate an extra byte at
1417 the end of the string table, and zero it.
1418
1419 2018-04-20 Alan Modra <amodra@gmail.com>
1420
1421 PR 22978
1422 * elf32-hppa.c (got_relocs_needed): Add extra param to special
1423 case both dtprel and tprel relocs.
1424 (allocate_dynrelocs): Adjust conditions for got relocs.
1425 (elf32_hppa_relocate_section): Likewise for local sym got relocs.
1426 Emit dynamic relocs on TLS GOT entries for shared libraries,
1427 not when pic. Omit dynamic reloc on dtprel entry when local,
1428 and on tprel entry when local and executable.
1429
1430 2018-04-19 Alan Modra <amodra@gmail.com>
1431
1432 PR 22537
1433 * elf32-hppa.c (elf32_hppa_size_stubs): Init "destination" to -1.
1434 (hppa_type_of_stub): Don't return a long branch stub for
1435 symbols other than those defined statically.
1436
1437 2018-04-19 Alan Modra <amodra@gmail.com>
1438
1439 * Makefile.am: Revert 2018-04-18 coff-mips changes.
1440 * config.bfd: Add back mips_ecoff_le_vec and mips_ecoff_be_vec
1441 to selvecs for mips targets change 2018-04-18.
1442 * configure.ac: Reinstate mips_ecoff_le_vec, mips_ecoff_be_vec
1443 and mips_ecoff_bele_vec.
1444 * targets.c: Likewise.
1445 * coff-mips.c: Resurrect.
1446 * Makefile.in: Regenerate.
1447 * configure: Regenerate.
1448 * po/SRC-POTFILES.in: Regenerate.
1449
1450 2018-04-18 Alan Modra <amodra@gmail.com>
1451
1452 * Makefile.am: Remove mips aout and coff support.
1453 * config.bfd: Likewise.
1454 * configure.ac: Likewise.
1455 * targets.c: Likewise.
1456 * coff-mips.c: Delete
1457 * mipsbsd.c: Delete
1458 * pe-mips.c: Delete
1459 * pei-mips.c: Delete
1460 * Makefile.in: Regenerate.
1461 * configure: Regenerate.
1462 * po/SRC-POTFILES.in: Regenerate.
1463
1464 2018-04-17 H.J. Lu <hongjiu.lu@intel.com>
1465
1466 * elf32-i386.c (elf32_bed): Define before including
1467 "elf32-target.h".
1468 * elf64-x86-64.c (elf64_bed): Define before including
1469 "elf64-target.h".
1470 (elf32_bed): Define before including "elf32-target.h".
1471
1472 2018-04-17 H.J. Lu <hongjiu.lu@intel.com>
1473
1474 PR ld/23055
1475 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Use a
1476 normal input file with compatible relocation.
1477
1478 2018-04-18 Alan Modra <amodra@gmail.com>
1479
1480 * Makefile.am: Remove support for assorted i386 aout and coff targets.
1481 * config.bfd: Likewise.
1482 * configure.ac: Likewise.
1483 * doc/bfdint.texi: Likewise.
1484 * targets.c: Likewise.
1485 * freebsd.h: Delete.
1486 * i386dynix.c: Delete.
1487 * i386freebsd.c: Delete.
1488 * i386linux.c: Delete.
1489 * i386mach3.c: Delete.
1490 * i386netbsd.c: Delete.
1491 * i386os9k.c: Delete.
1492 * Makefile.in: Regenerate.
1493 * configure: Regenerate.
1494 * po/SRC-POTFILES.in: Regenerate.
1495
1496 2018-04-17 Andrew Sadek <andrew.sadek.se@gmail.com>
1497
1498 Microblaze Target: PIC data text relative
1499
1500 * bfd/reloc.c (2 new BFD relocations):
1501 BFD_RELOC_MICROBLAZE_64_TEXTPCREL &
1502 BFD_RELOC_MICROBLAZE_64_TEXTPCREL
1503 * bfd/bfd-in2.h: Regenerate
1504 * bfd/libbfd.h: Regenerate
1505 * bfd/elf32-microblaze.c (Handle new relocs): define 'HOWTO' of 3
1506 new relocs and handle them in both relocate and relax functions.
1507 (microblaze_elf_reloc_type_lookup): add mapping between for new
1508 bfd relocs.
1509 (microblaze_elf_relocate_section): Handle new relocs in case of
1510 elf relocation.
1511 (microblaze_elf_relax_section): Handle new relocs for elf relaxation.
1512
1513 2018-04-17 Nick Clifton <nickc@redhat.com>
1514
1515 PR 23055
1516 * aoutx.h (find_nearest_line): Check that the symbol name exists
1517 and is long enough, before attempting to see if it is for a .o
1518 file.
1519 * hash.c (bfd_hash_hash): Add an assertion that the string is not
1520 NULL.
1521 * linker.c (bfd_link_hash_lookup): Fail if the table or string are
1522 NULL.
1523 (_bfd_generic_link_add_archive_symbols): Fail if an archive entry
1524 has no name.
1525
1526 PR 23065
1527 * dwarf2.c (concat_filename): Check for a NULL table pointer.
1528
1529 2018-04-16 Nick Clifton <nickc@redhat.com>
1530
1531 PR 23061
1532 * coffgen.c (coff_pointerize_aux): Check for an out of range
1533 fixup.
1534
1535 2018-04-16 Alan Modra <amodra@gmail.com>
1536
1537 * Makefile.am: Remove arm-epoc-pe support.
1538 * coff-arm.c: Likewise.
1539 * config.bfd: Likewise.
1540 * configure.ac: Likewise.
1541 * targets.c: Likewise.
1542 * epoc-pe-arm.c: Delete.
1543 * epoc-pei-arm.c: Delete.
1544 * Makefile.in: Regenerate.
1545 * configure: Regenerate.
1546 * po/SRC-POTFILES.in: Regenerate.
1547
1548 2018-04-16 Alan Modra <amodra@gmail.com>
1549
1550 * Makefile.am: Remove sparc-aout and sparc-coff support.
1551 * config.bfd: Likewise.
1552 * configure.ac: Likewise.
1553 * targets.c: Likewise.
1554 * aout-sparcle.c: Delete.
1555 * aoutf1.h: Delete.
1556 * cf-sparclynx.c: Delete.
1557 * coff-sparc.c: Delete.
1558 * demo64.c: Delete.
1559 * sparclinux.c: Delete.
1560 * sparclynx.c: Delete.
1561 * sparcnetbsd.c: Delete.
1562 * sunos.c: Delete.
1563 * Makefile.in: Regenerate.
1564 * configure: Regenerate.
1565 * po/SRC-POTFILES.in: Regenerate.
1566
1567 2018-04-16 Alan Modra <amodra@gmail.com>
1568
1569 * Makefile.am: Remove m68k-aout and m68k-coff support.
1570 * aoutf1.h: Likewise.
1571 * aoutx.h: Likewise.
1572 * archive.c: Likewise.
1573 * bfd-in.h: Likewise.
1574 * bfd.c: Likewise.
1575 * coffcode.h: Likewise.
1576 * coffswap.h: Likewise.
1577 * config.bfd: Likewise.
1578 * configure.ac: Likewise.
1579 * configure.host: Likewise.
1580 * doc/bfd.texinfo: Likewise.
1581 * doc/bfdint.texi: Likewise.
1582 * freebsd.h: Likewise.
1583 * gen-aout.c: Likewise.
1584 * hpux-core.c: Likewise.
1585 * libaout.h: Likewise.
1586 * libbfd-in.h: Likewise.
1587 * pdp11.c: Likewise.
1588 * peicode.h: Likewise.
1589 * riscix.c: Likewise.
1590 * targets.c: Likewise.
1591 * aout0.c: Delete.
1592 * coff-apollo.c: Delete.
1593 * coff-aux.c: Delete.
1594 * coff-m68k.c: Delete.
1595 * coff-svm68k.c: Delete.
1596 * coff-u68k.c: Delete.
1597 * hosts/delta68.h: Delete.
1598 * hosts/hp300bsd.h: Delete.
1599 * hosts/m68kaux.h: Delete.
1600 * hosts/news.h: Delete.
1601 * hp300bsd.c: Delete.
1602 * hp300hpux.c: Delete.
1603 * liboasys.h: Delete.
1604 * m68k4knetbsd.c: Delete.
1605 * m68klinux.c: Delete.
1606 * m68knetbsd.c: Delete.
1607 * oasys.c: Delete.
1608 * versados.c: Delete.
1609 * Makefile.in: Regenerate.
1610 * bfd-in2.h: Regenerate.
1611 * configure: Regenerate.
1612 * libbfd.h: Regenerate.
1613 * po/SRC-POTFILES.in: Regenerate.
1614
1615 2018-04-16 Alan Modra <amodra@gmail.com>
1616
1617 * Makefile.am: Remove sh5 and sh64 support.
1618 * archures.c: Likewise.
1619 * config.bfd: Likewise.
1620 * configure.ac: Likewise.
1621 * cpu-sh.c: Likewise.
1622 * elf32-sh-relocs.h: Likewise.
1623 * elf32-sh.c: Likewise.
1624 * targets.c: Likewise.
1625 * elf32-sh64-com.c: Delete.
1626 * elf32-sh64.c: Delete.
1627 * elf32-sh64.h: Delete.
1628 * elf64-sh64.c: Delete.
1629 * Makefile.in: Regenerate.
1630 * bfd-in2.h: Regenerate.
1631 * configure: Regenerate.
1632 * po/SRC-POTFILES.in: Regenerate.
1633
1634 2018-04-16 Alan Modra <amodra@gmail.com>
1635
1636 * Makefile.am: Remove sh-symbianelf support.
1637 * config.bfd: Likewise.
1638 * configure.ac: Likewise.
1639 * targets.c: Likewise.
1640 * elf32-sh-symbian.c: Delete.
1641 * Makefile.in: Regenerate.
1642 * configure: Regenerate.
1643 * po/SRC-POTFILES.in: Regenerate.
1644
1645 2018-04-16 Alan Modra <amodra@gmail.com>
1646
1647 * Makefile.am: Remove vax-bsd and vax-ultrix support.
1648 * config.bfd: Likewise.
1649 * configure.ac: Likewise.
1650 * targets.c: Likewise.
1651 * vaxbsd.c: Delete.
1652 * Makefile.in: Regenerate.
1653 * configure: Regenerate.
1654 * po/SRC-POTFILES.in: Regenerate.
1655
1656 2018-04-16 Alan Modra <amodra@gmail.com>
1657
1658 * Makefile.am: Remove w65 support.
1659 * archures.c: Likewise.
1660 * coffcode.h: Likewise.
1661 * config.bfd: Likewise.
1662 * configure.ac: Likewise.
1663 * targets.c: Likewise.
1664 * coff-w65.c: Delete.
1665 * cpu-w65.c: Delete.
1666 * Makefile.in: Regenerate.
1667 * bfd-in2.h: Regenerate.
1668 * configure: Regenerate.
1669 * po/SRC-POTFILES.in: Regenerate.
1670
1671 2018-04-16 Alan Modra <amodra@gmail.com>
1672
1673 * Makefile.am: Remove we32k support.
1674 * archures.c: Likewise.
1675 * coffcode.h: Likewise.
1676 * config.bfd: Likewise.
1677 * configure.ac: Likewise.
1678 * targets.c: Likewise.
1679 * coff-we32k.c: Delete.
1680 * cpu-we32k.c: Delete.
1681 * Makefile.in: Regenerate.
1682 * bfd-in2.h: Regenerate.
1683 * configure: Regenerate.
1684 * po/SRC-POTFILES.in: Regenerate.
1685
1686 2018-04-16 Alan Modra <amodra@gmail.com>
1687
1688 * Makefile.am: Remove m88k support.
1689 * aoutx.h: Likewise.
1690 * archures.c: Likewise.
1691 * coffcode.h: Likewise.
1692 * coffswap.h: Likewise.
1693 * config.bfd: Likewise.
1694 * configure.ac: Likewise.
1695 * cpu-ns32k.c: Likewise.
1696 * elf32-nds32.c: Likewise.
1697 * mach-o.c: Likewise.
1698 * netbsd-core.c: Likewise.
1699 * reloc.c: Likewise.
1700 * targets.c: Likewise.
1701 * coff-m88k.c: Delete.
1702 * cpu-m88k.c: Delete.
1703 * elf32-m88k.c: Delete.
1704 * hosts/m88kmach3.h: Delete.
1705 * m88kmach3.c: Delete.
1706 * m88kopenbsd.c: Delete.
1707 * Makefile.in: Regenerate.
1708 * bfd-in2.h: Regenerate.
1709 * configure: Regenerate.
1710 * po/SRC-POTFILES.in: Regenerate.
1711
1712 2018-04-16 Alan Modra <amodra@gmail.com>
1713
1714 * Makefile.am: Remove i370 support.
1715 * archures.c: Likewise.
1716 * config.bfd: Likewise.
1717 * configure.ac: Likewise.
1718 * targets.c: Likewise.
1719 * cpu-i370.c: Delete.
1720 * elf32-i370.c: Delete.
1721 * Makefile.in: Regenerate.
1722 * bfd-in2.h: Regenerate.
1723 * configure: Regenerate.
1724 * po/SRC-POTFILES.in: Regenerate.
1725
1726 2018-04-16 Alan Modra <amodra@gmail.com>
1727
1728 * Makefile.am: Remove h8500 support.
1729 * archures.c: Likewise.
1730 * coffcode.h: Likewise.
1731 * config.bfd: Likewise.
1732 * configure.ac: Likewise.
1733 * targets.c: Likewise.
1734 * coff-h8500.c: Delete.
1735 * cpu-h8500.c: Delete.
1736 * Makefile.in: Regenerate.
1737 * bfd-in2.h: Regenerate.
1738 * configure: Regenerate.
1739 * po/SRC-POTFILES.in: Regenerate.
1740
1741 2018-04-16 Alan Modra <amodra@gmail.com>
1742
1743 * Makefile.am: Remove h8300-coff support.
1744 * coffcode.h: Likewise.
1745 * config.bfd: Likewise.
1746 * configure.ac: Likewise.
1747 * reloc16.c: Likewise.
1748 * targets.c: Likewise.
1749 * coff-h8300.c: Delete.
1750 * Makefile.in: Regenerate.
1751 * configure: Regenerate.
1752 * po/SRC-POTFILES.in: Regenerate.
1753
1754 2018-04-16 Alan Modra <amodra@gmail.com>
1755
1756 * Makefile.am: Remove IEEE 695 support.
1757 * archures.c: Likewise.
1758 * bfd.c: Likewise.
1759 * config.bfd: Likewise.
1760 * configure.ac: Likewise.
1761 * doc/bfd.texinfo: Likewise.
1762 * doc/bfdint.texi: Likewise.
1763 * doc/bfdsumm.texi: Likewise.
1764 * section.c: Likewise.
1765 * targets.c: Likewise.
1766 * ieee.c: Delete.
1767 * libieee.h: Delete.
1768 * Makefile.in: Regenerate.
1769 * bfd-in2.h: Regenerate.
1770 * configure: Regenerate.
1771 * po/SRC-POTFILES.in: Regenerate.
1772
1773 2018-04-16 Alan Modra <amodra@gmail.com>
1774
1775 * config.bfd: Remove tandem support.
1776
1777 2018-04-16 Alan Modra <amodra@gmail.com>
1778
1779 * Makefile.am: Remove newsos3 support.
1780 * aoutx.h: Likewise.
1781 * config.bfd: Likewise.
1782 * configure.ac: Likewise.
1783 * targets.c: Likewise.
1784 * newsos3.c: Delete.
1785 * Makefile.in: Regenerate.
1786 * configure: Regenerate.
1787 * po/SRC-POTFILES.in: Regenerate.
1788
1789 2018-04-16 Alan Modra <amodra@gmail.com>
1790
1791 * Makefile.am: Remove netware support.
1792 * bfd-in.h: Likewise.
1793 * bfd.c: Likewise.
1794 * config.bfd: Likewise.
1795 * configure.ac: Likewise.
1796 * doc/bfdint.texi: Likewise.
1797 * ecoff.c: Likewise.
1798 * targets.c: Likewise.
1799 * libnlm.h: Delete.
1800 * nlm-target.h: Delete.
1801 * nlm.c: Delete.
1802 * nlm32-alpha.c: Delete.
1803 * nlm32-i386.c: Delete.
1804 * nlm32-ppc.c: Delete.
1805 * nlm32-sparc.c: Delete.
1806 * nlm32.c: Delete.
1807 * nlm64.c: Delete.
1808 * nlmcode.h: Delete.
1809 * nlmswap.h: Delete.
1810 * Makefile.in: Regenerate.
1811 * bfd-in2.h: Regenerate.
1812 * configure: Regenerate.
1813 * po/SRC-POTFILES.in: Regenerate.
1814
1815 2018-04-16 Alan Modra <amodra@gmail.com>
1816
1817 * archures.c: Remove tahoe support.
1818 * config.bfd: Likewise.
1819 * configure.ac: Likewise.
1820 * hosts/tahoe.h: Delete.
1821 * bfd-in2.h: Regenerate.
1822 * configure: Regenerate.
1823
1824 2018-04-14 Alan Modra <amodra@gmail.com>
1825
1826 * elf-bfd.h (struct elf_backend_data): Add relropagesize.
1827 * elfxx-target.h (ELF_RELROPAGESIZE): Provide default and
1828 sanity test.
1829 (elfNN_bed): Init relropagesize.
1830 * bfd.c (bfd_emul_get_commonpagesize): Add boolean param to
1831 select relropagesize.
1832 * elf32-ppc.c (ELF_COMMONPAGESIZE): Define as 0x1000.
1833 (ELF_RELROPAGESIZE): Define as ELF_MAXPAGESIZE.
1834 (ELF_MINPAGESIZE): Don't define.
1835 * elf64-ppc.c (ELF_COMMONPAGESIZE): Define as 0x1000.
1836 (ELF_RELROPAGESIZE): Define as ELF_MAXPAGESIZE.
1837 * bfd-in2.h: Regenerate.
1838
1839 2018-04-14 Alan Modra <amodra@gmail.com>
1840
1841 * elf32-ppc.c (ELF_MAXPAGESIZE, ELF_COMMONPAGESIZE): Don't depend
1842 on __QNXTARGET__ define.
1843
1844 2018-04-14 Alan Modra <amodra@gmail.com>
1845
1846 * config.bfd: Add powerpc-*-lynxos* and powerpc-*-windiss*
1847 to obsolete list.
1848
1849 2018-04-11 Alan Modra <amodra@gmail.com>
1850
1851 * aout-adobe.c: Delete.
1852 * bout.c: Delete.
1853 * coff-i860.c: Delete.
1854 * coff-i960.c: Delete.
1855 * cpu-i860.c: Delete.
1856 * cpu-i960.c: Delete.
1857 * elf32-i860.c: Delete.
1858 * elf32-i960.c: Delete.
1859 * hosts/i860mach3.h: Delete.
1860 * Makefile.am: Remove i860, i960, bout, and adobe support.
1861 * archures.c: Remove i860 and i960 support.
1862 * coffcode.h: Likewise.
1863 * reloc.c: Likewise.
1864 * aoutx.h: Comment updates.
1865 * archive.c: Remove BOUT and i960 support.
1866 * bfd.c: Remove BOUT support.
1867 * coffswap.h: Remove i960 support.
1868 * config.bfd: Remove i860, i960 and adobe targets.
1869 * configure.ac: Remove adode, bout, i860, i960, icoff targets.
1870 * targets.c: Likewise.
1871 * ieee.c: Remove i960 support.
1872 * mach-o.c: Remove i860 support.
1873 * Makefile.in: Regenerate.
1874 * bfd-in2.h: Regenerate.
1875 * configure: Regenerate.
1876 * libbfd.h: Regenerate.
1877 * po/SRC-POTFILES.in: Regenerate.
1878
1879 2018-04-09 Maciej W. Rozycki <macro@mips.com>
1880
1881 * elf64-mips.c (mips_elf64_write_rel): Handle a NULL BFD pointer
1882 in the BFD symbol referred by the relocation.
1883 (mips_elf64_write_rela): Likewise.
1884
1885 2018-04-09 Maciej W. Rozycki <macro@mips.com>
1886
1887 * elf64-mips.c (mips_elf64_slurp_one_reloc_table): Issue an
1888 error for out-of-range `r_sym' values.
1889
1890 2018-04-09 Alan Modra <amodra@gmail.com>
1891
1892 * elf64-ppc.c (struct _ppc64_elf_section_data): Add has_pltcall field.
1893 (struct ppc_link_hash_table): Add can_convert_all_inline_plt.
1894 (ppc64_elf_check_relocs): Set has_pltcall.
1895 (ppc64_elf_adjust_dynamic_symbol): Discard some PLT entries.
1896 (ppc64_elf_inline_plt): New function.
1897 (ppc64_elf_size_dynamic_sections): Discard some PLT entries for locals.
1898 * elf64-ppc.h (ppc64_elf_inline_plt): Declare.
1899 * elf32-ppc.c (has_pltcall): Define.
1900 (struct ppc_elf_link_hash_table): Add can_convert_all_inline_plt.
1901 (ppc_elf_check_relocs): Set has_pltcall.
1902 (ppc_elf_inline_plt): New function.
1903 (ppc_elf_adjust_dynamic_symbol): Discard some PLT entries.
1904 (ppc_elf_size_dynamic_sections): Likewise.
1905 * elf32-ppc.h (ppc_elf_inline_plt): Declare.
1906
1907 2018-04-09 Alan Modra <amodra@gmail.com>
1908
1909 * elf32-ppc.c (ppc_elf_howto_raw): Add PLTSEQ and PLTCALL howtos.
1910 (is_plt_seq_reloc): New function.
1911 (ppc_elf_check_relocs): Handle PLTSEQ and PLTCALL relocs.
1912 (ppc_elf_tls_optimize): Handle inline plt call sequence.
1913 (ppc_elf_relax_section): Handle PLTCALL reloc.
1914 (ppc_elf_relocate_section): Nop out inline plt call sequence when
1915 resolving locally.
1916 * elf64-ppc.c (ppc64_elf_howto_raw): Add R_PPC64_PLTSEQ and
1917 R_PPC64_PLTCALL entries. Comment R_PPC64_TOCSAVE.
1918 (has_tls_get_addr_call): Correct comment.
1919 (is_branch_reloc): Add PLTCALL.
1920 (is_plt_seq_reloc): New function.
1921 (ppc64_elf_check_relocs): Handle PLT16_LO_DS reloc. Set
1922 has_tls_reloc for R_PPC64_TLSGD and R_PPC64_TLSLD. Create plt
1923 entry for R_PPC64_PLTCALL.
1924 (ppc64_elf_tls_optimize): Handle inline plt call sequence.
1925 (ppc_type_of_stub): Handle PLTCALL reloc.
1926 (toc_adjusting_stub_needed): Likewise.
1927 (ppc64_elf_relocate_section): Set "can_plt_call" for PLTCALL
1928 reloc insn. Nop out inline plt call sequence when resolving
1929 locally. Handle __tls_get_addr inline plt call optimization.
1930
1931 2018-04-09 Alan Modra <amodra@gmail.com>
1932
1933 * elf64-ppc.c (LOCAL_PLT_ENTRY_SIZE): Define.
1934 (struct ppc_stub_hash_entry): Add symtype field.
1935 (PLT_KEEP): Define.
1936 (struct ppc_link_hash_table): Add pltlocal and relpltlocal.
1937 (create_linkage_sections): Create pltlocal and relpltlocal.
1938 (ppc64_elf_check_relocs): Allow PLT relocs on local symbols.
1939 Set PLT_KEEP.
1940 (ppc64_elf_adjust_dynamic_symbol): Keep PLT entries for inline calls.
1941 (allocate_dynrelocs): Allocate pltlocal and relpltlocal.
1942 (ppc64_elf_size_dynamic_sections): Size pltlocal and relpltlocal.
1943 Keep PLT entries for inline calls against locals.
1944 (ppc_build_one_stub): Use pltlocal as appropriate.
1945 (ppc_size_one_stub): Likewise.
1946 (ppc64_elf_size_stubs): Set symtype.
1947 (build_global_entry_stubs_and_plt): Init pltlocal and write
1948 relpltlocal for globals.
1949 (write_plt_relocs_for_local_syms): Likewise for local syms.
1950 (ppc64_elf_relocate_section): Support PLT for local syms.
1951 * elf32-ppc.c (PLT_KEEP): Define.
1952 (struct ppc_elf_link_hash_table): Add pltlocal and relpltlocal.
1953 (ppc_elf_create_glink): Create pltlocal and relpltlocal.
1954 (ppc_elf_check_relocs): Allow PLT relocs on local symbols.
1955 Set PLT_KEEP. Adjust update_local_sym_info call.
1956 (ppc_elf_adjust_dynamic_symbol): Keep PLT entries for inline calls.
1957 (allocate_dynrelocs): Allocate pltlocal and relpltlocal.
1958 (ppc_elf_size_dynamic_sections): Size pltlocal and relpltlocal.
1959 (ppc_elf_relocate_section): Support PLT16 relocs for local syms.
1960 (write_global_sym_plt): Init pltlocal and write relpltlocal.
1961 (ppc_finish_symbols): Likewise for locals.
1962
1963 2018-04-09 Alan Modra <amodra@gmail.com>
1964
1965 * elf64-ppc.c (ppc_build_one_stub): Move output of PLT relocs
1966 for local symbols to..
1967 (write_plt_relocs_for_local_syms): ..here. New function.
1968 (ppc64_elf_finish_dynamic_symbol): Move output of PLT relocs for
1969 global symbols to..
1970 (build_global_entry_stubs_and_plt): ..here. Rename from
1971 build_global_entry_stubs.
1972 (ppc64_elf_build_stubs): Always call build_global_entry_stubs_and_plt.
1973 Call write_plt_relocs_for_local_syms.
1974 * elf32-ppc.c (get_sym_h): New function.
1975 (ppc_elf_relax_section): Use get_sym_h.
1976 (ppc_elf_relocate_section): Move output of PLT relocs and glink
1977 stubs for local symbols to..
1978 (ppc_finish_symbols): ..here. New function.
1979 (ppc_elf_finish_dynamic_symbol): Move output of PLT relocs for
1980 global syms to..
1981 (write_global_sym_plt): ..here. New function.
1982 * elf32-ppc.h (ppc_elf_modify_segment_map): Delete attribute.
1983 (ppc_finish_symbols): Declare.
1984
1985 2018-04-09 Alan Modra <amodra@gmail.com>
1986
1987 * elf32-ppc.c (ppc_elf_check_relocs): Handle PLT16 relocs.
1988 (ppc_elf_relocate_section): Likewise.
1989 * elf64-ppc.c (ppc64_elf_check_relocs): Handle PLT16_LO_DS.
1990 (ppc64_elf_relocate_section): Likewise. Correct PLT16
1991 resolution to plt entry relative to toc pointer.
1992
1993 2018-04-09 Alan Modra <amodra@gmail.com>
1994
1995 * elf64-ppc.c (TLS_TLS, TLS_GD, TLS_LD, TLS_TPREL, TLS_DTPREL,
1996 TLS_TPRELGD, TLS_EXPLICIT): Renumber. Test TLS_TLS throughout
1997 file when other TLS flags are tested in a mask.
1998 (TLS_MARK, NON_GOT): Define.
1999 (PLT_IFUNC): Redefine, and test TLS_TLS throughout file as well.
2000 (update_local_sym_info): Don't create got entry when NON_GOT.
2001 (ppc64_elf_check_relocs): Pass NON_GOT with PLT_IFUNC.
2002 Set TLS_MARK.
2003 (get_tls_mask): Do toc lookup if tls_mask is just TLS_MARK.
2004 (ppc64_elf_relocate_section): Likewise.
2005 (ppc64_elf_tls_optimize): Don't attempt to optimize indirect
2006 __tls_get_addr calls lacking a marker reloc.
2007 * elf32-ppc.c (TLS_TLS, TLS_GD, TLS_LD, TLS_TPREL, TLS_DTPREL,
2008 TLS_TPRELGD): Renumber. Update comment.
2009 (TLS_MARK, NON_GOT): Define.
2010 (PLT_IFUNC): Redefine, and test TLS_TLS throughout file as well.
2011 (update_local_sym_info): Don't create got entry when NON_GOT.
2012 (ppc_elf_check_relocs): Pass NON_GOT with PLT_IFUNC.
2013 Set TLS_MARK.
2014 (ppc_elf_tls_optimize): Don't attempt to optimize indirect
2015 __tls_get_addr calls lacking a marker reloc.
2016
2017 2018-04-06 H.J. Lu <hongjiu.lu@intel.com>
2018
2019 * elf64-x86-64.c (elf_x86_64_info_to_howto): Don't mask out
2020 R_X86_64_converted_reloc_bit.
2021
2022 2018-04-05 H.J. Lu <hongjiu.lu@intel.com>
2023
2024 PR gas/22318
2025 * configure: Regenerated.
2026
2027 2018-04-05 Alan Modra <amodra@gmail.com>
2028
2029 * elf-hppa.h (elf_hppa_info_to_howto): Init howto to NULL.
2030 (elf_hppa_info_to_howto_rel): Likewise.
2031
2032 2018-04-04 Maciej W. Rozycki <macro@mips.com>
2033
2034 * elf-hppa.h (elf_hppa_info_to_howto): Also return
2035 unsuccessfully for unimplemented relocations.
2036 (elf_hppa_info_to_howto_rel): Likewise.
2037
2038 2018-04-04 Maciej W. Rozycki <macro@mips.com>
2039
2040 * elf32-i860.c (lookup_howto): Add `abfd' parameter. Set the
2041 `bfd_error_bad_value' error and call `_bfd_error_handler' on a
2042 howto lookup failure.
2043 (elf32_i860_reloc_type_lookup): Adjust `lookup_howto' call
2044 accordingly.
2045 (elf32_i860_info_to_howto_rela): Likewise.
2046 (elf32_i860_relocate_splitn): Likewise.
2047 (elf32_i860_relocate_pc16): Likewise.
2048 (elf32_i860_relocate_pc26): Likewise.
2049 (elf32_i860_relocate_section): Likewise.
2050
2051 2018-04-04 Maciej W. Rozycki <macro@mips.com>
2052
2053 * elf32-visium.c (visium_info_to_howto_rela): Correct the range
2054 check for `visium_elf_howto_table' table access.
2055
2056 2018-04-04 Maciej W. Rozycki <macro@mips.com>
2057
2058 * elf32-iq2000.c (iq2000_info_to_howto_rela): Correct the range
2059 check for `iq2000_elf_howto_table' table access.
2060
2061 2018-04-04 Maciej W. Rozycki <macro@mips.com>
2062
2063 * elf32-frv.c (frv_info_to_howto_rela): Correct the range check
2064 for `elf32_frv_howto_table' table access.
2065
2066 2018-04-04 Maciej W. Rozycki <macro@mips.com>
2067
2068 * elf32-mips.c (mips_elf32_rtype_to_howto): Also return
2069 unsuccessfully for placeholder howtos.
2070 * elf64-mips.c (mips_elf64_rtype_to_howto): Likewise.
2071 * elfn32-mips.c (mips_elf_n32_rtype_to_howto): Likewise.
2072
2073 2018-03-29 Maciej W. Rozycki <macro@mips.com>
2074
2075 * elf32-mips.c (mips_info_to_howto_rel): Remove the calls to
2076 `_bfd_error_handler' and to set the `bfd_error_bad_value' error.
2077
2078 2018-03-28 Maciej W. Rozycki <macro@mips.com>
2079
2080 * elf-hppa.h (elf_hppa_info_to_howto_rel): Remove
2081 ATTRIBUTE_UNUSED from `abfd'.
2082
2083 2018-03-28 Maciej W. Rozycki <macro@mips.com>
2084
2085 * elf-hppa.h (elf_hppa_info_to_howto_rel): Correct
2086 `_bfd_error_handler' call formatting.
2087
2088 2018-03-28 Maciej W. Rozycki <macro@mips.com>
2089
2090 * elf32-mips.c (mips_info_to_howto_rel): Call
2091 `mips_elf32_rtype_to_howto' directly rather than via
2092 `->elf_backend_mips_rtype_to_howto'.
2093
2094 2018-03-28 Renlin Li <renlin.li@arm.com>
2095
2096 PR ld/22970
2097 * elfnn-aarch64.c (IS_AARCH64_TLS_RELOC): Add cases for
2098 BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12,
2099 BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12_NC,
2100 BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12,
2101 BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12_NC,
2102 BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12,
2103 BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12_NC,
2104 BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12,
2105 BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12_NC.
2106 (elfNN_aarch64_final_link_relocate): Support new relocations.
2107 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Support new
2108 relocations.
2109 (_bfd_aarch64_elf_resolve_relocation): Support new relocations.
2110
2111 2018-03-28 Renlin Li <renlin.li@arm.com>
2112
2113 PR ld/22970
2114 * reloc.c: Add BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12
2115 BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12_NC,
2116 BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12,
2117 BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12_NC,
2118 BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12,
2119 BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12_NC,
2120 BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12,
2121 BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12_NC,
2122 BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12,
2123 BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12_NC.
2124 * elfnn-aarch64.c (elfNN_aarch64_howto_table): Add table entry for
2125 TLSLE_LDST16_TPREL_LO12,
2126 TLSLE_LDST16_TPREL_LO12_NC,
2127 TLSLE_LDST32_TPREL_LO12,
2128 TLSLE_LDST32_TPREL_LO12_NC,
2129 TLSLE_LDST64_TPREL_LO12,
2130 TLSLE_LDST64_TPREL_LO12_NC,
2131 TLSLE_LDST8_TPREL_LO12,
2132 TLSLE_LDST8_TPREL_LO12_NC.
2133 * bfd-in2.h: Regenerated.
2134 * libbfd.h: Regenerated.
2135
2136 2018-03-28 Eric Botcazou <ebotcazou@adacore.com>
2137
2138 PR ld/22972
2139 * elfxx-sparc.c (struct _bfd_sparc_elf_link_hash_entry): Add new flag
2140 has_old_style_got_reloc.
2141 (_bfd_sparc_elf_check_relocs) <GOT relocations>: Set it for old-style
2142 relocations. Fix a couple of long lines.
2143 (_bfd_sparc_elf_relocate_section) <R_SPARC_GOTDATA_OP>: Do not generate
2144 a R_SPARC_NONE for the GOT slot if the symbol is also subject to old-style
2145 GOT relocations.
2146
2147 2018-03-25 H.J. Lu <hongjiu.lu@intel.com>
2148
2149 PR ld/23000
2150 * elf64-x86-64.c (elf_x86_64_finish_dynamic_sections): Add
2151 ENDBR64 to the TLSDESC PLT entry.
2152
2153 2018-03-21 Alan Modra <amodra@gmail.com>
2154
2155 * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Trim uninteresting
2156 symbols. Use size_t counts. Delete redundant opd test.
2157
2158 2018-03-21 Alan Modra <amodra@gmail.com>
2159
2160 * elf32-ppc.c (ppc_elf_tls_optimize): Delete locsyms.
2161
2162 2018-03-21 Alan Modra <amodra@gmail.com>
2163
2164 * elf32-ppc.c (struct ppc_elf_link_hash_entry): Make tls_mask
2165 field unsigned.
2166 (update_local_sym_info): Likewise for local_got_tls_masks.
2167 (ppc_elf_tls_optimize): Likewise for lgot_masks.
2168
2169 2018-03-21 Alan Modra <amodra@gmail.com>
2170
2171 * elf64-ppc.c (ppc_size_one_stub): Fix comment typo.
2172 (ppc64_elf_layout_multitoc): Allocate relocs for tprel as we
2173 do in size_dynamic_sections.
2174
2175 2018-03-21 Alan Modra <amodra@gmail.com>
2176
2177 * elf64-ppc.c (ppc64_elf_relocate_section): Don't access rel[1]
2178 without first checking array bounds.
2179 * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
2180
2181 2018-03-20 H.J. Lu <hongjiu.lu@intel.com>
2182
2183 PR ld/22983
2184 * elflink.c (bfd_elf_link_mark_dynamic_symbol): Set
2185 non_ir_ref_dynamic if a symbol is made dynamic by --dynamic-list.
2186
2187 2018-03-19 Nick Clifton <nickc@redhat.com>
2188
2189 * po/es.po: Updated Spanish translation.
2190
2191 2018-03-15 Max Filippov <jcmvbkbc@gmail.com>
2192
2193 * elf32-xtensa.c (xlate_map_entry): Change types of address
2194 fields from 'unsigned' to 'bfd_vma'.
2195 (xlate_offset_with_removed_text): Use struct xlate_map_entry as
2196 the key argument to bsearch. Allow offsets past the end of a
2197 section, use the last map entry for translation of such offsets.
2198
2199 2018-03-15 Kuan-Lin Chen <kuanlinchentw@gmail.com>
2200
2201 * elf32-nds32.c (nds32_elf_ex9_build_hash_table): Removed.
2202 Not support the target feature.
2203 (nds32_elf_ex9_itb_base): Likewise.
2204 (nds32_elf_ex9_import_table): Likewise.
2205 (nds32_elf_ex9_finish): Likewise.
2206 (nds32_elf_ex9_reloc_jmp): Likewise.
2207 (nds32_elf_get_insn_with_reg): Likewise.
2208 (nds32_get_local_syms): Likewise.
2209 (nds32_elf_ex9_replace_instruction): Likewise.
2210 (nds32_elf_ifc_calc): Likewise.
2211 (nds32_elf_ifc_finish): Likewise.
2212 (nds32_elf_ifc_replace): Likewise.
2213 (nds32_elf_ifc_reloc): Likewise.
2214
2215 2018-03-14 Alan Modra <amodra@gmail.com>
2216
2217 * elf64-ppc.c (sfpr_define): Adjust for stub_sec size having
2218 sfpr size added before defining alias symbols.
2219 (ppc64_elf_build_stubs): Add stub section padding before
2220 copying sfpr contents and defining save/restore alias symbols.
2221
2222 2018-03-14 H.J. Lu <hongjiu.lu@intel.com>
2223
2224 PR ld/20882
2225 * elflink.c (elf_gc_mark_debug_section): Also check the local
2226 debug definition section.
2227
2228 2018-03-13 Nick Clifton <nickc@redhat.com>
2229
2230 PR 22113
2231 * pei-x86_64.c (pex64_get_unwind_info): Change to a boolean
2232 function. Add an end address parameter. Check access of the data
2233 pointer to make sure that they do not extend beyond the end
2234 address. Return FALSE if any check fails. Add the end address
2235 pointer to the ui structure.
2236 (pex64_xdata_print_uwd_codes): Check accesses of the raw unwind
2237 codes to make sure that they do not extend beyond the end address
2238 pointer. Print an error message and return immediately if any
2239 check fails.
2240
2241 2018-03-09 Nick Clifton <nickc@redhat.com>
2242
2243 * elf64-s390.c (elf_s390_relocate_section): Move check for
2244 relocations against non-allocated sections to before the code that
2245 handles ifunc relocations.
2246 * elf32-s390.c (elf_s390_relocate_section): Likewise.
2247 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Treat
2248 relocs against IFUNC symbols in non-allocated sections as relocs
2249 against FUNC symbols.
2250 * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Likewise.
2251
2252 2018-03-08 H.J. Lu <hongjiu.lu@intel.com>
2253
2254 PR ld/22929
2255 * elf32-i386.c (elf_i386_relocate_section): Treat relocation
2256 against IFUNC symbol in SHT_NOTE section without SHF_ALLOC as
2257 relocation against FUNC symbol.
2258 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
2259
2260 2018-03-07 Renlin Li <renlin.li@arm.com>
2261
2262 PR ld/20402
2263 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Check absolute
2264 symbol, and don't emit relocation in specific case.
2265
2266 2018-03-07 Alan Modra <amodra@gmail.com>
2267
2268 * elf64-mips.c (mips_elf64_rtype_to_howto): Return NULL on error.
2269 (mips_elf64_slurp_one_reloc_table): Pass on error.
2270
2271 2018-03-03 James Cowgill <james.cowgill@mips.com>
2272 Maciej W. Rozycki <macro@mips.com>
2273
2274 PR ld/21900
2275 * elfxx-mips.c (mips_elf_calculate_relocation): Only return
2276 after calling `undefined_symbol' hook if this is an error
2277 condition. Assume the value of 0 for the symbol requested
2278 otherwise.
2279
2280 2018-03-02 Jim Wilson <jimw@sifive.com>
2281
2282 PR 22903
2283 * elfnn-aarch64.c (_bfd_aarch64_resize_stubs): Add 8 bytes for branch
2284 and nop instead of 4.
2285 (elfNN_arch64_build_stubs): Add nop after branch. Increase size by
2286 8 instead of 4.
2287
2288 2018-03-01 Jim Wilson <jimw@sifive.com>
2289
2290 PR 22756
2291 * elfnn-riscv.c (riscv_relax_delete_bytes): When adjust st_size, use
2292 else if instead of if.
2293
2294 2018-03-01 Alan Modra <amodra@gmail.com>
2295
2296 * elf32-ft32.c (ft32_info_to_howto_rela): Correct range test.
2297
2298 2018-02-28 Alan Modra <amodra@gmail.com>
2299
2300 PR 22887
2301 * aoutx.h (swap_std_reloc_in): Correct r_index bound check.
2302
2303 2018-02-28 Nick Clifton <nickc@redhat.com>
2304
2305 PR 22895
2306 PR 22893
2307 * dwarf2.c (read_n_bytes): Replace size parameter with dwarf_block
2308 pointer. Drop unused abfd parameter. Check the size of the block
2309 before initialising the data field. Return the end pointer if the
2310 size is invalid.
2311 (read_attribute_value): Adjust invocations of read_n_bytes.
2312
2313 PR 22894
2314 * dwarf1.c (parse_die): Check the length of form blocks before
2315 advancing the data pointer.
2316
2317 2018-02-28 Alan Modra <amodra@gmail.com>
2318
2319 PR 22887
2320 * aoutx.h (translate_symbol_table): Print an error message and set
2321 bfd_error on finding an invalid name string offset.
2322
2323 2018-02-27 H.J. Lu <hongjiu.lu@intel.com>
2324
2325 * config.in: Regenerated.
2326 * configure: Likewise.
2327 * configure.ac: Add --enable-separate-code.
2328 (DEFAULT_LD_Z_SEPARATE_CODE): New AC_DEFINE_UNQUOTED. Default
2329 to 1 for Linux/x86 targets,
2330 * elf64-x86-64.c (ELF_MAXPAGESIZE): Set to 0x1000 if
2331 DEFAULT_LD_Z_SEPARATE_CODE is 1.
2332
2333 2018-02-27 Nick Clifton <nickc@redhat.com>
2334
2335 * aout-cris.c (swap_ext_reloc_out): Standadize error/warning
2336 message.
2337 * elf-hppa.h (elf_hppa_info_to_howto_rel): Likewise.
2338 * elf32-i386.c (elf_i386_reloc_type_lookup): Likewise.
2339 * elf32-xtensa.c (elf_xtensa_reloc_type_lookup): Likewise.
2340 * elf64-ppc.c (ppc64_elf_reloc_type_lookup): Likewise.
2341 * elf64-s390.c (elf_s390_reloc_type_lookup): Likewise.
2342 * elf64-sh64.c (sh_elf64_info_to_howto): Likewise.
2343 * elfxx-ia64.c (ia64_elf_reloc_type_lookup): Likewise.
2344 * elfxx-sparc.c (_bfd_sparc_elf_reloc_type_lookup): Likewise.
2345 * elfxx-tilegx.c (tilegx_reloc_type_lookup): Likewise.
2346
2347 PR 22875
2348 * elf-bfd.h (struct elf_backend_data): Change the return type of
2349 the elf_info_to_howto and elf_info_to_howto_rel function pointers
2350 to bfd_boolean.
2351 * elfcode.h (elf_slurp_reloc_table_from_section): Check the return
2352 value from the info_to_howto function and fail if that function
2353 failed.
2354 * elf32-h8300.c (elf32_h8_relocate_section): Check return value
2355 from the info_to_howto function.
2356 (elf32_h8_relax_section): Likewise.
2357 * elf32-lm32.c (lm32_elf_relocate_section): Likewise.
2358 * elf32-m68hc1x.c (elf32_m68hc11_relocate_section): Likewise.
2359 * elf32-score.c (s3_bfd_score_elf_relocate_section): Likewise.
2360 * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
2361 * elf32-tic6x.c (elf32_tic6x_relocate_section): Likewise.
2362 * elf64-ia64-vms.c (elf64_ia64_relocate_section): Likewise.
2363 * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Likewise.
2364 * elf64-x86-64.c (elf_x86_64_tls_transition): Likewise.
2365 * elfnn-ia64.c (elfNN_ia64_relocate_section): Likewise.
2366 * elfnn-riscv.c (riscv_elf_check_relocs): Likewise.
2367 (riscv_elf_relocate_section): Likewise.
2368 * elf-hppa.h (elf_hppa_info_to_howto): Change return type to
2369 bfd_boolean. Issue an error message, set an error value and
2370 return FALSE if the reloc is not recognized.
2371 (elf_hppa_info_to_howto_rel): Likewise.
2372 * elf-m10200.c (mn10200_info_to_howto): Likewise.
2373 * elf-m10300.c (mn10300_info_to_howto): Likewise.
2374 * elf.c (_bfd_elf_no_info_to_howto): Likewise.
2375 * elf32-arc.c (arc_info_to_howto_rel): Likewise.
2376 * elf32-arm.c (elf32_arm_info_to_howto): Likewise.
2377 * elf32-avr.c (avr_info_to_howto_rela): Likewise.
2378 * elf32-bfin.c (bfin_info_to_howto): Likewise.
2379 * elf32-cr16.c (elf_cr16_info_to_howto): Likewise.
2380 * elf32-cr16c.c (elf_cr16c_info_to_howto): Likewise.
2381 * elf32-cris.c (elf_cr16c_info_to_howto_rel)
2382 (cris_info_to_howto_rela): Likewise.
2383 * elf32-crx.c (elf_crx_info_to_howto): Likewise.
2384 * elf32-d10v.c (d10v_info_to_howto_rel): Likewise.
2385 * elf32-d30v.c (d30v_info_to_howto_rel, d30v_info_to_howto_rela):
2386 Likewise.
2387 * elf32-dlx.c (dlx_rtype_to_howto, elf32_dlx_info_to_howto)
2388 (elf32_dlx_info_to_howto_rel): Likewise.
2389 * elf32-epiphany.c (epiphany_info_to_howto_rela): Likewise.
2390 * elf32-fr30.c (fr30_info_to_howto_rela): Likewise.
2391 * elf32-frv.c (frv_info_to_howto_rela)
2392 (frvfdpic_info_to_howto_rel): Likewise.
2393 * elf32-ft32.c (ft32_info_to_howto_rela): Likewise.
2394 * elf32-gen.c (elf_generic_info_to_howto)
2395 (elf_generic_info_to_howto_rel): Likewise.
2396 * elf32-h8300.c (elf32_h8_info_to_howto)
2397 (elf32_h8_info_to_howto_rel): Likewise.
2398 * elf32-i370.c (i370_elf_info_to_howto): Likewise.
2399 * elf32-i386.c (elf_i386_reloc_type_lookup)
2400 (elf_i386_rtype_to_howto, elf_i386_info_to_howto_rel): Likewise.
2401 * elf32-i860.c (lookup_howto, elf32_i860_info_to_howto_rela):
2402 Likewise.
2403 * elf32-i960.c (elf32_i960_info_to_howto_rel): Likewise.
2404 * elf32-ip2k.c (ip2k_info_to_howto_rela): Likewise.
2405 * elf32-iq2000.c (iq2000_info_to_howto_rela): Likewise.
2406 * elf32-lm32.c (lm32_info_to_howto_rela): Likewise.
2407 * elf32-m32c.c (m32c_info_to_howto_rela): Likewise.
2408 * elf32-m32r.c (m32r_info_to_howto_rel, m32r_info_to_howto):
2409 Likewise.
2410 * elf32-m68hc11.c (m68hc11_info_to_howto_rel): Likewise.
2411 * elf32-m68hc12.c (m68hc11_info_to_howto_rel): Likewise.
2412 * elf32-m68k.c (rtype_to_howto): Likewise.
2413 * elf32-mcore.c (mcore_elf_info_to_howto): Likewise.
2414 * elf32-mep.c (mep_info_to_howto_rela): Likewise.
2415 * elf32-metag.c (metag_info_to_howto_rela): Likewise.
2416 * elf32-microblaze.c (microblaze_elf_info_to_howto): Likewise.
2417 * elf32-mips.c (mips_info_to_howto_rel, mips_info_to_howto_rela):
2418 Likewise.
2419 * elf32-moxie.c (moxie_info_to_howto_rela): Likewise.
2420 * elf32-msp430.c (msp430_info_to_howto_rela): Likewise.
2421 * elf32-mt.c (mt_info_to_howto_rela): Likewise.
2422 * elf32-nds32.c (nds32_info_to_howto_rel, nds32_info_to_howto):
2423 Likewise.
2424 * elf32-nios2.c (nios2_elf32_info_to_howto): Likewise.
2425 * elf32-or1k.c (or1k_info_to_howto_rela): Likewise.
2426 * elf32-pj.c (pj_elf_info_to_howto): Likewise.
2427 * elf32-ppc.c (ppc_elf_info_to_howto): Likewise.
2428 * elf32-pru.c (pru_elf32_info_to_howto): Likewise.
2429 * elf32-rl78.c (rl78_info_to_howto_rela): Likewise.
2430 * elf32-rx.c (rx_info_to_howto_rela): Likewise.
2431 * elf32-s390.c (elf_s390_info_to_howto): Likewise.
2432 * elf32-score.c (s3_bfd_score_info_to_howto)
2433 (_bfd_score_info_to_howto): Likewise.
2434 * elf32-score7.c (s7_bfd_score_info_to_howto): Likewise.
2435 * elf32-sh.c (sh_elf_info_to_howto): Likewise.
2436 * elf32-spu.c (spu_elf_info_to_howto): Likewise.
2437 * elf32-tic6x.c (elf32_tic6x_info_to_howto)
2438 (elf32_tic6x_info_to_howto_rel): Likewise.
2439 * elf32-tilepro.c (tilepro_info_to_howto_rela): Likewise.
2440 * elf32-v850.c (v850_elf_info_to_howto_rel)
2441 (v850_elf_info_to_howto_rela, v800_elf_info_to_howto): Likewise.
2442 * elf32-vax.c (rtype_to_howto): Likewise.
2443 * elf32-visium.c (visium_info_to_howto_rela): Likewise.
2444 * elf32-wasm32.c (elf32_wasm32_rtype_to_howto)
2445 (elf32_wasm32_info_to_howto_rela): Likewise.
2446 * elf32-xc16x.c (elf32_xc16x_info_to_howto): Likewise.
2447 * elf32-xgate.c (xgate_info_to_howto_rel): Likewise.
2448 * elf32-xstormy16.c (xstormy16_info_to_howto_rela): Likewise.
2449 * elf32-xtensa.c (elf_xtensa_info_to_howto_rela): Likewise.
2450 * elf64-alpha.c (elf64_alpha_info_to_howto): Likewise.
2451 * elf64-gen.c (elf_generic_info_to_howto)
2452 (elf_generic_info_to_howto_rel): Likewise.
2453 * elf64-ia64-vms.c (elf64_ia64_info_to_howto): Likewise.
2454 * elf64-mips.c (mips_elf64_info_to_howto_rela): Likewise.
2455 * elf64-mmix.c (mmix_info_to_howto_rela): Likewise.
2456 * elf64-ppc.c (ppc64_elf_info_to_howto): Likewise.
2457 * elf64-s390.c (elf_s390_reloc_type_lookup): Likewise.
2458 * elf64-sh64.c (elf_s390_info_to_howto, sh_elf64_info_to_howto):
2459 Likewise.
2460 * elf64-x86-64.c (elf_x86_64_info_to_howto): Likewise.
2461 * elfn32-mips.c (mips_info_to_howto_rel, mips_info_to_howto_rela):
2462 Likewise.
2463 * elfnn-aarch64.c (elfNN_aarch64_info_to_howto): Likewise.
2464 * elfnn-ia64.c (elfNN_ia64_info_to_howto): Likewise.
2465 * elfnn-riscv.c (riscv_info_to_howto_rela): Likewise.
2466 * elfxx-ia64.c (ia64_elf_reloc_type_lookup): Likewise.
2467 * elfxx-sparc.c (_bfd_sparc_elf_info_to_howto): Likewise.
2468 * elfxx-tilegx.c (tilegx_info_to_howto_rela): Likewise.
2469 * elf32-score.h (s7_bfd_score_info_to_howto): Update prototype.
2470 * elfxx-sparc.h (_bfd_sparc_elf_info_to_howto): Update prototype.
2471 * elfxx-tilegx.h (tilegx_info_to_howto_rela): Update prototype.
2472 * elfxx-target.h (elf_info_to_howto, elf_info_to_howto_rel):
2473 Default to NULL.
2474
2475 2018-02-26 Jim Wilson <jimw@sifive.com>
2476 Stephan Schreiber <info@fs-driver.org>
2477
2478 PR 15904
2479 * elfnn-ia64.c (elfNN_ia64_relax_section): After ia64_elf_relax_brl
2480 call, set changed_contents and changed_relocs. Likewise after
2481 successful ia64_elf_relax_br call.
2482
2483 2018-02-26 Alan Modra <amodra@gmail.com>
2484
2485 * elf.c (assign_file_positions_except_relocs): Don't segfault
2486 when actual number of phdrs is less than allocated. Delete
2487 outdated comment. Formatting.
2488
2489 2018-02-26 Alan Modra <amodra@gmail.com>
2490
2491 * elf-m10300.c, * elf-s390-common.c, * elf32-arc.c, * elf32-cris.c,
2492 * elf32-dlx.c, * elf32-frv.c, * elf32-i370.c, * elf32-lm32.c,
2493 * elf32-m32r.c, * elf32-m68hc1x.c, * elf32-m68k.c,
2494 * elf32-microblaze.c, * elf32-msp430.c, * elf32-nds32.c,
2495 * elf32-nios2.c, * elf32-or1k.c, * elf32-rl78.c, * elf32-rx.c,
2496 * elf32-score.c, * elf32-score7.c, * elf32-sh-symbian.c,
2497 * elf32-sh.c, * elf32-spu.c, * elf32-v850.c, * elf32-xtensa.c,
2498 * elf64-alpha.c, * elf64-ia64-vms.c, * elf64-mmix.c,
2499 * elf64-sh64.c, * elf64-sparc.c, * elfnn-ia64.c, * elfxx-tilegx.c,
2500 * mmo.c, * osf-core.c, * srec.c, * vms-alpha.c: Standardize
2501 error/warning messages.
2502
2503 2018-02-26 Alan Modra <amodra@gmail.com>
2504
2505 * archive.c, * bfd.c, * linker.c, * reloc.c, * stabs.c,
2506 * syms.c: Standardize error/warning messages.
2507
2508 2018-02-26 Alan Modra <amodra@gmail.com>
2509
2510 * aout-adobe.c, * aout-cris.c, * i386linux.c, * m68klinux.c,
2511 * sparclinux.c, * coff-alpha.c, * coff-arm.c, * coff-mcore.c,
2512 * coffcode.h, * coffgen.c, * cofflink.c, * ecoff.c, * pe-mips.c,
2513 * peXXigen.c, * peicode.h: Standardize error/warning messages.
2514
2515 2018-02-26 Alan Modra <amodra@gmail.com>
2516
2517 * elf32-arm.c, * elfnn-aarch64.c: Standardize error/warning messages.
2518
2519 2018-02-26 Alan Modra <amodra@gmail.com>
2520
2521 * elfxx-mips.c: Standardize error/warning messages.
2522
2523 2018-02-26 Alan Modra <amodra@gmail.com>
2524
2525 * dwarf2.c, * elf-attrs.c, * elf-eh-frame.c, * elf.c, * elf32-gen.c,
2526 * elflink.c: Standardize error/warning messages. Replace use of
2527 linker callback einfo with _bfd_error_handler when possible.
2528
2529 2018-02-26 Alan Modra <amodra@gmail.com>
2530
2531 * aoutx.h, * coff-alpha.c, * coff-i860.c, * coff-m68k.c,
2532 * coff-mcore.c, * coff-ppc.c, * coff-rs6000.c, * coff-sh.c,
2533 * coff-tic4x.c, * coff-tic54x.c, * coff-tic80.c, * coff-w65.c,
2534 * elf-bfd.h, * elf-m10300.c, * elf.c, * elf32-avr.c, * elf32-bfin.c,
2535 * elf32-cr16.c, * elf32-cr16c.c, * elf32-cris.c, * elf32-crx.c,
2536 * elf32-d10v.c, * elf32-d30v.c, * elf32-dlx.c, * elf32-epiphany.c,
2537 * elf32-fr30.c, * elf32-frv.c, * elf32-i370.c, * elf32-i386.c,
2538 * elf32-i960.c, * elf32-ip2k.c, * elf32-iq2000.c, * elf32-lm32.c,
2539 * elf32-m32c.c, * elf32-m32r.c, * elf32-m68hc11.c, * elf32-m68hc12.c,
2540 * elf32-m68k.c, * elf32-mcore.c, * elf32-mep.c, * elf32-metag.c,
2541 * elf32-microblaze.c, * elf32-mips.c, * elf32-moxie.c,
2542 * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c, * elf32-or1k.c,
2543 * elf32-pj.c, * elf32-ppc.c, * elf32-rl78.c, * elf32-rx.c,
2544 * elf32-s390.c, * elf32-sh.c, * elf32-spu.c, * elf32-tic6x.c,
2545 * elf32-v850.c, * elf32-vax.c, * elf32-visium.c, * elf32-wasm32.c,
2546 * elf32-xgate.c, * elf32-xtensa.c, * elf64-alpha.c,
2547 * elf64-ia64-vms.c, * elf64-mips.c, * elf64-mmix.c,
2548 * elf64-ppc.c, * elf64-s390.c, * elf64-sparc.c, * elf64-x86-64.c,
2549 * elfn32-mips.c, * elfnn-aarch64.c, * elfnn-ia64.c,
2550 * elfnn-riscv.c, * elfxx-mips.c, * elfxx-riscv.c, * elfxx-riscv.h,
2551 * elfxx-sparc.c, * elfxx-sparc.h, * reloc.c: Standardize
2552 unrecognized/unsupported reloc message.
2553
2554 2018-02-26 Alan Modra <amodra@gmail.com>
2555
2556 * elf32-ppc.c: Standardize error/warning messages. Use
2557 _bfd_error_handler rather than einfo when einfo features not used.
2558 * elf64-ppc.c: Likewise.
2559
2560 2018-02-23 Alan Modra <amodra@gmail.com>
2561
2562 PR 22881
2563 * elf.c (assign_file_positions_for_non_load_sections): Remove RELRO
2564 segment if no matching LOAD segment.
2565
2566 2018-02-23 Kuan-Lin Chen <kuanlinchentw@gmail.com>
2567
2568 * elf32-nds32.h: Define mask for ict_model.
2569
2570 2018-02-20 Jason Duerstock <jason.duerstock@gmail.com>
2571
2572 * elfnn-ia64.c (elf_backend_can_gc_sections): Enable.
2573
2574 2018-02-19 Maciej W. Rozycki <macro@mips.com>
2575
2576 Revert
2577 2018-01-12 Vlad Ivanov <vlad@ivanov.email>
2578
2579 * elfxx-mips.c (_bfd_mips_elf_final_link): Notify user when
2580 .reginfo section has wrong size.
2581
2582 2018-02-19 Maciej W. Rozycki <macro@mips.com>
2583
2584 * elfxx-mips.c (_bfd_mips_elf_always_size_sections): Set
2585 SEC_FIXED_SIZE and SEC_HAS_CONTENTS flags for `.reginfo' and
2586 `.MIPS.abiflags' sections.
2587 (_bfd_mips_elf_final_link): Avoid reading beyond `.reginfo'
2588 section's end.
2589
2590 2018-02-19 Maciej W. Rozycki <macro@mips.com>
2591
2592 * section.c (SEC_FIXED_SIZE): New macro.
2593 * bfd-in2.h: Regenerate.
2594
2595 2018-02-19 Maciej W. Rozycki <macro@mips.com>
2596
2597 * section.c (SEC_HAS_GOT_REF): Remove macro.
2598 * bfd-in2.h: Regenerate.
2599
2600 2018-02-19 Alan Modra <amodra@gmail.com>
2601
2602 * elf-attrs.c (_bfd_elf_parse_attributes): Correct _bfd_error_handler
2603 arguments.
2604 * elfxx-mips.c (_bfd_mips_elf_final_link): Likewise.
2605 * elfnn-riscv.c (_bfd_riscv_relax_align): Likewise.
2606 (_bfd_riscv_relax_pc): Likewise and fix typos.
2607 * libbfd-in.h (_bfd_error_handler): Add attribute printf.
2608 * libbfd.h: Regenerate.
2609
2610 2018-02-19 Alan Modra <amodra@gmail.com>
2611
2612 * dwarf2.c (read_section): Don't use 'll' format modifier.
2613 (find_abstract_instance): Likewise.
2614 * elfcore.h (elf_core_file_p): Likewise.
2615
2616 2018-02-19 Alan Modra <amodra@gmail.com>
2617
2618 * bfd-in.h: Include inttypes.h or if not available define
2619 PRId64, PRIu64 and PRIx64.
2620 * bfd.c (_bfd_doprnt, _bfd_doprnt_scan): Remove support for L
2621 modifier to print bfd_vma.
2622 * coff-arm.c, * coff-mcore.c, * coff-ppc.c, * coff-rs6000.c,
2623 * coff-sh.c, * coff-tic80.c, * coffcode.h, * coffgen.c, * cofflink.c,
2624 * compress.c, * dwarf2.c, * elf-m10300.c, * elf.c, * elf32-arc.c,
2625 * elf32-arm.c, * elf32-bfin.c, * elf32-cris.c, * elf32-hppa.c,
2626 * elf32-i386.c, * elf32-ip2k.c, * elf32-lm32.c, * elf32-m32r.c,
2627 * elf32-m68k.c, * elf32-metag.c, * elf32-nds32.c, * elf32-nios2.c,
2628 * elf32-ppc.c, * elf32-rx.c, * elf32-s390.c, * elf32-score.c,
2629 * elf32-score7.c, * elf32-sh.c, * elf32-sh64.c, * elf32-spu.c,
2630 * elf32-tic6x.c, * elf32-tilepro.c, * elf32-v850.c, * elf32-vax.c,
2631 * elf32-xtensa.c, * elf64-alpha.c, * elf64-hppa.c, * elf64-ia64-vms.c,
2632 * elf64-mmix.c, * elf64-s390.c, * elf64-sh64.c, * elf64-x86-64.c,
2633 * elfcode.h, * elfcore.h, * elflink.c, * elfnn-aarch64.c,
2634 * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-mips.c, * elfxx-sparc.c,
2635 * elfxx-tilegx.c, * ieee.c, * ihex.c, * mach-o.c, * merge.c, * mmo.c,
2636 * peXXigen.c, * xcofflink.c: Replace use of Lx modifier with PRIx64,
2637 and cast input to uint64_t, and similarly for Ld and Lu.
2638 * bfd-in2.h: Regenerate.
2639
2640 2018-02-19 Alan Modra <amodra@gmail.com>
2641
2642 * elf32-arm.c, * elf32-hppa.c, * elf32-lm32.c, * elf32-m32r.c,
2643 * elf32-metag.c, * elf32-nds32.c, * elf32-or1k.c, * elf32-ppc.c,
2644 * elf32-s390.c, * elf32-sh.c, * elf32-tic6x.c, * elf32-tilepro.c,
2645 * elf64-ppc.c, * elf64-s390.c, * elflink.c, * elfnn-aarch64.c,
2646 * elfnn-riscv.c, * elfxx-sparc.c, * elfxx-tilegx.c, * elfxx-x86.c,
2647 * reloc.c: Replace use of %R and %T in format strings passed to
2648 einfo and friends by %pR and %pT.
2649
2650 2018-02-19 Alan Modra <amodra@gmail.com>
2651
2652 * bfd.c (_bfd_doprnt, _bfd_doprnt_scan): Handle %pA and %pB in place
2653 of %A and %B.
2654 * aout-adobe.c: Update all messages using %A and %B.
2655 * aout-cris.c: Likewise.
2656 * aoutx.h: Likewise.
2657 * archive.c: Likewise.
2658 * binary.c: Likewise.
2659 * cache.c: Likewise.
2660 * coff-alpha.c: Likewise.
2661 * coff-arm.c: Likewise.
2662 * coff-i860.c: Likewise.
2663 * coff-mcore.c: Likewise.
2664 * coff-ppc.c: Likewise.
2665 * coff-rs6000.c: Likewise.
2666 * coff-sh.c: Likewise.
2667 * coff-tic4x.c: Likewise.
2668 * coff-tic54x.c: Likewise.
2669 * coff-tic80.c: Likewise.
2670 * coff64-rs6000.c: Likewise.
2671 * coffcode.h: Likewise.
2672 * coffgen.c: Likewise.
2673 * cofflink.c: Likewise.
2674 * coffswap.h: Likewise.
2675 * compress.c: Likewise.
2676 * cpu-arm.c: Likewise.
2677 * ecoff.c: Likewise.
2678 * elf-attrs.c: Likewise.
2679 * elf-eh-frame.c: Likewise.
2680 * elf-ifunc.c: Likewise.
2681 * elf-m10300.c: Likewise.
2682 * elf-properties.c: Likewise.
2683 * elf-s390-common.c: Likewise.
2684 * elf.c: Likewise.
2685 * elf32-arc.c: Likewise.
2686 * elf32-arm.c: Likewise.
2687 * elf32-avr.c: Likewise.
2688 * elf32-bfin.c: Likewise.
2689 * elf32-cr16.c: Likewise.
2690 * elf32-cr16c.c: Likewise.
2691 * elf32-cris.c: Likewise.
2692 * elf32-crx.c: Likewise.
2693 * elf32-d10v.c: Likewise.
2694 * elf32-d30v.c: Likewise.
2695 * elf32-epiphany.c: Likewise.
2696 * elf32-fr30.c: Likewise.
2697 * elf32-frv.c: Likewise.
2698 * elf32-gen.c: Likewise.
2699 * elf32-hppa.c: Likewise.
2700 * elf32-i370.c: Likewise.
2701 * elf32-i386.c: Likewise.
2702 * elf32-i960.c: Likewise.
2703 * elf32-ip2k.c: Likewise.
2704 * elf32-iq2000.c: Likewise.
2705 * elf32-lm32.c: Likewise.
2706 * elf32-m32c.c: Likewise.
2707 * elf32-m32r.c: Likewise.
2708 * elf32-m68hc11.c: Likewise.
2709 * elf32-m68hc12.c: Likewise.
2710 * elf32-m68hc1x.c: Likewise.
2711 * elf32-m68k.c: Likewise.
2712 * elf32-mcore.c: Likewise.
2713 * elf32-mep.c: Likewise.
2714 * elf32-metag.c: Likewise.
2715 * elf32-microblaze.c: Likewise.
2716 * elf32-moxie.c: Likewise.
2717 * elf32-msp430.c: Likewise.
2718 * elf32-mt.c: Likewise.
2719 * elf32-nds32.c: Likewise.
2720 * elf32-nios2.c: Likewise.
2721 * elf32-or1k.c: Likewise.
2722 * elf32-pj.c: Likewise.
2723 * elf32-ppc.c: Likewise.
2724 * elf32-rl78.c: Likewise.
2725 * elf32-rx.c: Likewise.
2726 * elf32-s390.c: Likewise.
2727 * elf32-score.c: Likewise.
2728 * elf32-score7.c: Likewise.
2729 * elf32-sh-symbian.c: Likewise.
2730 * elf32-sh.c: Likewise.
2731 * elf32-sh64.c: Likewise.
2732 * elf32-sparc.c: Likewise.
2733 * elf32-spu.c: Likewise.
2734 * elf32-tic6x.c: Likewise.
2735 * elf32-tilepro.c: Likewise.
2736 * elf32-v850.c: Likewise.
2737 * elf32-vax.c: Likewise.
2738 * elf32-visium.c: Likewise.
2739 * elf32-wasm32.c: Likewise.
2740 * elf32-xgate.c: Likewise.
2741 * elf32-xtensa.c: Likewise.
2742 * elf64-alpha.c: Likewise.
2743 * elf64-gen.c: Likewise.
2744 * elf64-hppa.c: Likewise.
2745 * elf64-ia64-vms.c: Likewise.
2746 * elf64-mmix.c: Likewise.
2747 * elf64-ppc.c: Likewise.
2748 * elf64-s390.c: Likewise.
2749 * elf64-sh64.c: Likewise.
2750 * elf64-sparc.c: Likewise.
2751 * elf64-x86-64.c: Likewise.
2752 * elfcode.h: Likewise.
2753 * elfcore.h: Likewise.
2754 * elflink.c: Likewise.
2755 * elfnn-aarch64.c: Likewise.
2756 * elfnn-ia64.c: Likewise.
2757 * elfnn-riscv.c: Likewise.
2758 * elfxx-mips.c: Likewise.
2759 * elfxx-sparc.c: Likewise.
2760 * elfxx-tilegx.c: Likewise.
2761 * elfxx-x86.c: Likewise.
2762 * hpux-core.c: Likewise.
2763 * ieee.c: Likewise.
2764 * ihex.c: Likewise.
2765 * libbfd.c: Likewise.
2766 * linker.c: Likewise.
2767 * mach-o.c: Likewise.
2768 * merge.c: Likewise.
2769 * mmo.c: Likewise.
2770 * oasys.c: Likewise.
2771 * pdp11.c: Likewise.
2772 * pe-mips.c: Likewise.
2773 * peXXigen.c: Likewise.
2774 * peicode.h: Likewise.
2775 * reloc.c: Likewise.
2776 * rs6000-core.c: Likewise.
2777 * srec.c: Likewise.
2778 * stabs.c: Likewise.
2779 * vms-alpha.c: Likewise.
2780 * xcofflink.c: Likewise.
2781
2782 2018-02-19 Alan Modra <amodra@gmail.com>
2783
2784 PR 22845
2785 * elf.c (IS_TBSS): Define.
2786 (_bfd_elf_map_sections_to_segments): Use IS_TBSS.
2787 (assign_file_positions_for_non_load_sections): Revert last change.
2788 Properly calculate load segment limits to compare against relro limits.
2789
2790 2018-02-17 Alan Modra <amodra@gmail.com>
2791
2792 PR 22845
2793 * elf.c (assign_file_positions_for_non_load_sections): Ignore
2794 degenerate zero size PT_LOAD segments when finding one overlapping
2795 the PT_GNU_RELRO segment.
2796
2797 2018-02-16 Alan Modra <amodra@gmail.com>
2798
2799 * libbfd.c (_bfd_bool_bfd_false_error): Rename from bfd_false.
2800 (_bfd_bool_bfd_true): Rename from bfd_true.
2801 (_bfd_ptr_bfd_null_error): Rename from bfd_nullvoidptr.
2802 (_bfd_int_bfd_0): Rename from bfd_0.
2803 (_bfd_uint_bfd_0): Rename from bfd_0u.
2804 (_bfd_long_bfd_0): Rename from bfd_0l.
2805 (_bfd_long_bfd_n1_error): Rename from _bfd_n1.
2806 (_bfd_void_bfd): Rename from bfd_void.
2807 (_bfd_bool_bfd_false, _bfd_bool_bfd_asymbol_false),
2808 (_bfd_bool_bfd_link_false_error),
2809 (_bfd_bool_bfd_link_true, _bfd_bool_bfd_bfd_true),
2810 (_bfd_bool_bfd_uint_true, _bfd_bool_bfd_ptr_true),
2811 (_bfd_bool_bfd_asection_bfd_asection_true),
2812 (_bfd_bool_bfd_asymbol_bfd_asymbol_true),
2813 (_bfd_void_bfd_link, _bfd_void_bfd_asection): New functions.
2814 * archive.c (_bfd_noarchive_get_elt_at_index),
2815 (_bfd_noarchive_openr_next_archived_file),
2816 (_bfd_noarchive_construct_extended_name_table),
2817 (_bfd_noarchive_write_ar_hdr, _bfd_noarchive_truncate_arname),
2818 (_bfd_noarchive_write_armap): New functions.
2819 * archures.c (_bfd_nowrite_set_arch_mach): New function.
2820 * coff-alpha.c (alpha_ecoff_swap_coff_aux_in),
2821 (alpha_ecoff_swap_coff_sym_in, alpha_ecoff_swap_coff_lineno_in),
2822 (alpha_ecoff_swap_coff_aux_out, alpha_ecoff_swap_coff_sym_out),
2823 (alpha_ecoff_swap_coff_lineno_out),
2824 (alpha_ecoff_swap_coff_reloc_out): New functions.
2825 * coff-mips.c (mips_ecoff_swap_coff_aux_in),
2826 (mips_ecoff_swap_coff_sym_in, mips_ecoff_swap_coff_lineno_in),
2827 (mips_ecoff_swap_coff_aux_out, mips_ecoff_swap_coff_sym_out),
2828 (mips_ecoff_swap_coff_lineno_out),
2829 (mips_ecoff_swap_coff_reloc_out): New functions.
2830 * coffcode.h (coff_set_alignment_hook): Replace define with
2831 new function.
2832 (symname_in_debug_hook): Likewise.
2833 * ecoff.c (_bfd_ecoff_set_alignment_hook): New function.
2834 * elfxx-target.h (elf_backend_allow_non_load_phdr): Default to 0.
2835 * elf.c (assign_file_positions_except_relocs): Test
2836 elf_backend_allow_non_load_phdr for NULL.
2837 * elflink.c (_bfd_elf_omit_section_dynsym_default): Rename from
2838 _bfd_elf_link_omit_section_dynsym. Update uses.
2839 (_bfd_elf_omit_section_dynsym_all): New function.
2840 * elf-bfd.h (_bfd_elf_link_omit_section_dynsym): Delete.
2841 (_bfd_elf_omit_section_dynsym_default): Declare.
2842 (_bfd_elf_omit_section_dynsym_all): Declare.
2843 * linker.c (_bfd_nolink_sizeof_headers, _bfd_nolink_bfd_relax_section),
2844 (_bfd_nolink_bfd_get_relocated_section_contents),
2845 (_bfd_nolink_bfd_lookup_section_flags),
2846 (_bfd_nolink_bfd_is_group_section, _bfd_nolink_bfd_discard_group),
2847 (_bfd_nolink_bfd_link_hash_table_create),
2848 (_bfd_nolink_bfd_link_just_syms),
2849 (_bfd_nolink_bfd_copy_link_hash_symbol_type),
2850 (_bfd_nolink_bfd_link_split_section),
2851 (_bfd_nolink_section_already_linked),
2852 (_bfd_nolink_bfd_define_common_symbol),
2853 (_bfd_nolink_bfd_define_start_stop): New functions.
2854 * reloc.c (_bfd_norelocs_bfd_reloc_type_lookup),
2855 (_bfd_norelocs_bfd_reloc_name_lookup),
2856 (_bfd_nodynamic_canonicalize_dynamic_reloc): New functions.
2857 * section.c (_bfd_nowrite_set_section_contents): New function.
2858 * syms.c (_bfd_nosymbols_canonicalize_symtab),
2859 (_bfd_nosymbols_print_symbol, _bfd_nosymbols_get_symbol_info),
2860 (_bfd_nosymbols_get_symbol_version_string),
2861 (_bfd_nosymbols_bfd_is_local_label_name),
2862 (_bfd_nosymbols_get_lineno, _bfd_nosymbols_find_nearest_line),
2863 (_bfd_nosymbols_find_line, _bfd_nosymbols_find_inliner_info),
2864 (_bfd_nosymbols_bfd_make_debug_symbol),
2865 ( _bfd_nosymbols_read_minisymbols),
2866 ( _bfd_nosymbols_minisymbol_to_symbol),
2867 (_bfd_nodynamic_get_synthetic_symtab): New functions.
2868 * libbfd-in.h: Declare new functions. Update existing defines,
2869 removing casts.
2870 * aix386-core.c: Update to use new hooks. Formatting.
2871 * aout-adobe.c: Likewise.
2872 * aout-arm.c: Likewise.
2873 * aout-target.h: Likewise.
2874 * aout-tic30.c: Likewise.
2875 * aoutf1.h: Likewise.
2876 * binary.c: Likewise.
2877 * bout.c: Likewise.
2878 * cisco-core.c: Likewise.
2879 * coff-alpha.c: Likewise.
2880 * coff-i386.c: Likewise.
2881 * coff-i860.c: Likewise.
2882 * coff-i960.c: Likewise.
2883 * coff-ia64.c: Likewise.
2884 * coff-mips.c: Likewise.
2885 * coff-ppc.c: Likewise.
2886 * coff-rs6000.c: Likewise.
2887 * coff-sh.c: Likewise.
2888 * coff-tic30.c: Likewise.
2889 * coff-tic54x.c: Likewise.
2890 * coff-x86_64.c: Likewise.
2891 * coff64-rs6000.c: Likewise.
2892 * coffcode.h: Likewise.
2893 * elf-m10300.c: Likewise.
2894 * elf32-cr16.c: Likewise.
2895 * elf32-lm32.c: Likewise.
2896 * elf32-m32r.c: Likewise.
2897 * elf32-metag.c: Likewise.
2898 * elf32-score.c: Likewise.
2899 * elf32-score7.c: Likewise.
2900 * elf32-tilepro.c: Likewise.
2901 * elf32-xstormy16.c: Likewise.
2902 * elf32-xtensa.c: Likewise.
2903 * elf64-alpha.c: Likewise.
2904 * elf64-hppa.c: Likewise.
2905 * elf64-ia64-vms.c: Likewise.
2906 * elf64-mmix.c: Likewise.
2907 * elf64-sh64.c: Likewise.
2908 * elfnn-ia64.c: Likewise.
2909 * elfxx-sparc.c: Likewise.
2910 * elfxx-target.h: Likewise.
2911 * elfxx-tilegx.c: Likewise.
2912 * elfxx-x86.h: Likewise.
2913 * hp300hpux.c: Likewise.
2914 * hppabsd-core.c: Likewise.
2915 * hpux-core.c: Likewise.
2916 * i386msdos.c: Likewise.
2917 * i386os9k.c: Likewise.
2918 * ieee.c: Likewise.
2919 * ihex.c: Likewise.
2920 * irix-core.c: Likewise.
2921 * libaout.h: Likewise.
2922 * libecoff.h: Likewise.
2923 * mach-o-target.c: Likewise.
2924 * mach-o.c: Likewise.
2925 * mipsbsd.c: Likewise.
2926 * mmo.c: Likewise.
2927 * netbsd-core.c: Likewise.
2928 * nlm-target.h: Likewise.
2929 * oasys.c: Likewise.
2930 * osf-core.c: Likewise.
2931 * pdp11.c: Likewise.
2932 * pe-mips.c: Likewise.
2933 * pe-x86_64.c: Likewise.
2934 * pef.c: Likewise.
2935 * plugin.c: Likewise.
2936 * ppcboot.c: Likewise.
2937 * ptrace-core.c: Likewise.
2938 * sco5-core.c: Likewise.
2939 * som.c: Likewise.
2940 * sparclynx.c: Likewise.
2941 * srec.c: Likewise.
2942 * tekhex.c: Likewise.
2943 * trad-core.c: Likewise.
2944 * verilog.c: Likewise.
2945 * versados.c: Likewise.
2946 * vms-alpha.c: Likewise.
2947 * vms-lib.c: Likewise.
2948 * wasm-module.c: Likewise.
2949 * xsym.c: Likewise.
2950 * libbfd.h: Regenerate.
2951
2952 2018-02-15 Jim Wilson <jimw@sifive.com>
2953
2954 * elfnn-riscv.c (_bfd_riscv_relax_section): Ifdef out check to ignore
2955 symbols whose section address is zero.
2956
2957 * elfnn-riscv.c (riscv_elf_relocate_section): Use bfd_reloc_dangerous
2958 when pcrel_lo reloc has an addend. Use reloc_dangerous callback for
2959 bfd_reloc_dangerous. Use einfo instead of warning callback for errors.
2960 Add %X%P to error messages.
2961
2962 2018-02-15 Eric Botcazou <ebotcazou@adacore.com>
2963
2964 PR ld/22832
2965 * elfxx-sparc.c (_bfd_sparc_elf_check_relocs) <R_SPARC_TLS_GD_CALL>:
2966 Pass FALSE instead of TRUE as 'create' argument to bfd_link_hash_lookup
2967 and assert that the result of the call is not NULL.
2968
2969 2018-02-14 Nick Clifton <nickc@redhat.com>
2970
2971 PR 22823
2972 Revert previous delta. Add extra casts to avoid compile time
2973 warnings instead.
2974 * libbfd-in.h (_bfd_generic_bfd_copy_private_bfd_data): Add extra
2975 cast to avoid warning from gcc v8 compiler.
2976 (_bfd_generic_bfd_merge_private_bfd_data): Likewise.
2977 (_bfd_generic_bfd_set_private_flags): Likewise.
2978 (_bfd_generic_bfd_copy_private_section_data): Likewise.
2979 (_bfd_generic_bfd_copy_private_symbol_data): Likewise.
2980 (_bfd_generic_bfd_copy_private_header_data): Likewise.
2981 (_bfd_generic_bfd_print_private_bfd_data): Likewise.
2982 (_bfd_noarchive_construct_extended_name_table): Likewise.
2983 (_bfd_noarchive_truncate_arname): Likewise.
2984 (_bfd_noarchive_write_ar_hdr): Likewise.
2985 (_bfd_noarchive_get_elt_at_index): Likewise.
2986 (_bfd_nosymbols_canonicalize_symtab): Likewise.
2987 (_bfd_nosymbols_print_symbol): Likewise.
2988 (_bfd_nosymbols_get_symbol_info): Likewise.
2989 (_bfd_nosymbols_get_symbol_version_string): Likewise.
2990 (_bfd_nosymbols_bfd_is_local_label_name): Likewise.
2991 (_bfd_nosymbols_bfd_is_target_special_symbol): Likewise.
2992 (_bfd_nosymbols_get_lineno): Likewise.
2993 (_bfd_nosymbols_find_nearest_line): Likewise.
2994 (_bfd_nosymbols_find_line): Likewise.
2995 (_bfd_nosymbols_find_inliner_info): Likewise.
2996 (_bfd_nosymbols_bfd_make_debug_symbol): Likewise.
2997 (_bfd_nosymbols_read_minisymbols): Likewise.
2998 (_bfd_nosymbols_minisymbol_to_symbol): Likewise.
2999 (_bfd_norelocs_bfd_reloc_type_lookup): Likewise.
3000 (_bfd_norelocs_bfd_reloc_name_lookup): Likewise.
3001 (_bfd_nowrite_set_arch_mach): Likewise.
3002 (_bfd_nowrite_set_section_contents): Likewise.
3003 (_bfd_nolink_sizeof_headers): Likewise.
3004 (_bfd_nolink_bfd_get_relocated_section_contents): Likewise.
3005 (_bfd_nolink_bfd_relax_section): Likewise.
3006 (_bfd_nolink_bfd_gc_sections): Likewise.
3007 (_bfd_nolink_bfd_lookup_section_flags): Likewise.
3008 (_bfd_nolink_bfd_merge_sections): Likewise.
3009 (_bfd_nolink_bfd_is_group_section): Likewise.
3010 (_bfd_nolink_bfd_discard_group): Likewise.
3011 (_bfd_nolink_bfd_link_hash_table_create): Likewise.
3012 (_bfd_nolink_bfd_link_add_symbols): Likewise.
3013 (_bfd_nolink_bfd_link_just_syms): Likewise.
3014 (_bfd_nolink_bfd_copy_link_hash_symbol_type): Likewise.
3015 (_bfd_nolink_bfd_final_link): Likewise.
3016 (_bfd_nolink_bfd_link_split_section): Likewise.
3017 (_bfd_nolink_section_already_linked): Likewise.
3018 (_bfd_nolink_bfd_define_common_symbol): Likewise.
3019 (_bfd_nolink_bfd_define_start_stop): Likewise.
3020 (_bfd_nodynamic_canonicalize_dynamic_symtab): Likewise.
3021 (_bfd_nodynamic_get_synthetic_symtab): Likewise.
3022 (_bfd_nodynamic_get_dynamic_reloc_upper_bound _bfd_): Likewise.
3023 (_bfd_nodynamic_canonicalize_dynamic_reloc): Likewise.
3024 * libbfd.c (bfd_false_any): Delete.
3025 (bfd_true_any, bfd_nullvoidptr_any, bfd_0_any): Delete.
3026 (bfd_0u_any, bfd_0l_any, _bfd_n1_any, bfd_void_any): Delete.
3027 * libbfd.h (extern): Regenerate
3028 * aout-target.h (MY_bfd_is_target_special_symbol): Add extra
3029 cast to avoid warning from gcc v8 compiler.
3030 * aout-tic30.c (tic30_aout_set_arch_mach): Likewise.
3031 * binary.c (binary_get_symbol_info): Likewise.
3032 * coff-alpha.c (alpha_ecoff_backend_data): Likewise.
3033 * coff-mips.c (mips_ecoff_backend_data): Likewise.
3034 * coffcode.h (coff_set_alignment_hook): Likewise.
3035 (symname_in_debug_hook): Likewise.
3036 (bfd_coff_backend_data bigobj_swap_table): Likewise.
3037 * elf-m10300.c (elf_backend_omit_section_dynsym): Likewise.
3038 * elf32-cr16.c (elf_backend_omit_section_dynsym): Likewise.
3039 * elf32-lm32.c (elf_backend_omit_section_dynsym): Likewise.
3040 * elf32-m32r.c (elf_backend_omit_section_dynsym): Likewise.
3041 * elf32-metag.c (elf_backend_omit_section_dynsym): Likewise.
3042 * elf32-score.c (elf_backend_omit_section_dynsym): Likewise.
3043 * elf32-score7.c (elf_backend_omit_section_dynsym): Likewise.
3044 * elf32-xstormy16.c (elf_backend_omit_section_dynsym): Likewise.
3045 * elf32-xtensa.c (elf_backend_omit_section_dynsym): Likewise.
3046 * elf64-alpha.c (elf_backend_omit_section_dynsym): Likewise.
3047 * elf64-hppa.c (elf_backend_omit_section_dynsym): Likewise.
3048 * elf64-ia64-vms.c (elf_backend_omit_section_dynsym): Likewise.
3049 * elf64-mmix.c (elf_backend_omit_section_dynsym): Likewise.
3050 * elf64-sh64.c (elf_backend_omit_section_dynsym): Likewise.
3051 * elfnn-ia64.c (elf_backend_omit_section_dynsym): Likewise.
3052 * elfxx-target.h (bfd_elfNN_bfd_debug_info_accumulate): Likewise.
3053 (bfd_elfNN_bfd_make_debug_symbol): Likewise.
3054 (bfd_elfNN_bfd_merge_private_bfd_data): Likewise.
3055 (bfd_elfNN_bfd_set_private_flags): Likewise.
3056 (bfd_elfNN_bfd_is_target_special_symbol): Likewise.
3057 (elf_backend_init_index_section): Likewise.
3058 (elf_backend_allow_non_load_phdr): Likewise.
3059 * elfxx-x86.h (elf_backend_omit_section_dynsym): Likewise.
3060 * i386msdos.c (msdos_bfd_is_target_special_symbol): Likewise.
3061 * ieee.c (ieee_construct_extended_name_table): Likewise.
3062 (ieee_write_armap): Likewise.
3063 (ieee_write_ar_hdr): Likewise.
3064 (ieee_bfd_is_target_special_symbol): Likewise.
3065 * ihex.c (ihex_canonicalize_symtab): Likewise.
3066 (ihex_bfd_is_target_special_symbol): Likewise.
3067 * libaout.h (aout_32_bfd_is_target_special_symbol): Likewise.
3068 * libecoff.h (_bfd_ecoff_bfd_is_target_special_symbol): Likewise.
3069 (_bfd_ecoff_set_alignment_hook): Likewise.
3070 * mach-o-target.c (bfd_mach_o_bfd_is_target_special_symbol): Likewise.
3071 * mmo.c (mmo_bfd_is_target_special_symbol): Likewise.
3072 * nlm-target.h (nlm_bfd_is_target_special_symbol): Likewise.
3073 * oasys.c (oasys_construct_extended_name_table): Likewise.
3074 (oasys_write_armap): Likewise.
3075 (oasys_write_ar_hdr): Likewise.
3076 (oasys_bfd_is_target_special_symbol): Likewise.
3077 * pef.c (bfd_pef_bfd_is_target_special_symbol): Likewise.
3078 * plugin.c (bfd_plugin_bfd_is_target_special_symbol): Likewise.
3079 * ppcboot.c (ppcboot_bfd_is_target_special_symbol): Likewise.
3080 * som.c (som_bfd_is_target_special_symbol): Likewise.
3081 * srec.c (srec_bfd_is_target_special_symbol): Likewise.
3082 * tekhex.c (tekhex_bfd_is_target_special_symbol): Likewise.
3083 * verilog.c (verilog_bfd_is_target_special_symbol): Likewise.
3084 * versados.c (versados_bfd_is_target_special_symbol): Likewise.
3085 (versados_bfd_reloc_name_lookup): Likewise.
3086 * vms-alpha.c (vms_bfd_is_target_special_symbol): Likewise.
3087 (vms_bfd_define_start_stop): Likewise.
3088 (alpha_vms_bfd_is_target_special_symbol): Likewise.
3089 * wasm-module.c (wasm_bfd_is_target_special_symbol): Likewise.
3090 * xsym.c (bfd_sym_bfd_is_target_special_symbol): Likewise.
3091
3092 2018-02-14 H.J. Lu <hongjiu.lu@intel.com>
3093
3094 PR ld/22842
3095 * elf32-i386.c (elf_i386_check_relocs): Pass FALSE for non
3096 PC-relative PLT to NEED_DYNAMIC_RELOCATION_P.
3097 * elf64-x86-64.c (elf_x86_64_check_relocs): Create PLT for
3098 R_X86_64_PC32 reloc against dynamic function in data section.
3099 Pass TRUE for PC-relative PLT to NEED_DYNAMIC_RELOCATION_P.
3100 (elf_x86_64_relocate_section): Use PLT for R_X86_64_PC32 reloc
3101 against dynamic function in data section.
3102 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Use PLT in PIE as
3103 function address only if pcrel_plt is true.
3104 (_bfd_x86_elf_link_hash_table_create): Set pcrel_plt.
3105 * elfxx-x86.h (NEED_DYNAMIC_RELOCATION_P): Add PCREL_PLT for
3106 PC-relative PLT. If PLT is PC-relative, don't generate dynamic
3107 PC-relative relocation against a function definition in data
3108 secton in PIE. Remove the obsolete comments.
3109 (elf_x86_link_hash_table): Add pcrel_plt.
3110
3111 2018-02-13 H.J. Lu <hongjiu.lu@intel.com>
3112
3113 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Check bfd_link_dll,
3114 instead of bfd_link_pic, for building shared library.
3115
3116 2018-02-13 H.J. Lu <hongjiu.lu@intel.com>
3117
3118 PR gas/22791
3119 * elf64-x86-64.c (is_32bit_relative_branch): Removed.
3120 (elf_x86_64_relocate_section): Check PIC relocations in PIE.
3121 Remove is_32bit_relative_branch usage. Disallow PC32 reloc
3122 against protected function in shared object.
3123
3124 2018-02-13 Sergei Trofimovich <slyfox@inbox.ru>
3125
3126 PR 22828
3127 * po/ru.po: Fix typo in Russian translation.
3128
3129 2018-02-13 Maciej W. Rozycki <macro@mips.com>
3130
3131 * wasm-module.c (wasm_scan_name_function_section): Rename
3132 `index' local variable to `idx'.
3133
3134 2018-02-13 Nick Clifton <nickc@redhat.com>
3135
3136 PR 22823
3137 Fix compile time warnings generated by gcc version 8.
3138 * libbfd-in.h: Remove extraneous text from prototypes.
3139 Add prototypes for bfd_false_any, bfd_true_any,
3140 bfd_nullvoidptr_any, bfd_0_any, bfd_0u_any, bfd_0l_any,
3141 bfd_n1_any, bfd_void_any.
3142 (_bfd_generic_bfd_copy_private_bfd_data): Use vararg based dummy
3143 function.
3144 (_bfd_generic_bfd_merge_private_bfd_data): Likewise.
3145 (_bfd_generic_bfd_set_private_flags): Likewise.
3146 (_bfd_generic_bfd_copy_private_section_data): Likewise.
3147 (_bfd_generic_bfd_copy_private_symbol_data): Likewise.
3148 (_bfd_generic_bfd_copy_private_header_data): Likewise.
3149 (_bfd_generic_bfd_print_private_bfd_data): Likewise.
3150 (_bfd_noarchive_construct_extended_name_table): Likewise.
3151 (_bfd_noarchive_truncate_arname): Likewise.
3152 (_bfd_noarchive_write_ar_hdr): Likewise.
3153 (_bfd_noarchive_get_elt_at_index): Likewise.
3154 (_bfd_nosymbols_canonicalize_symtab): Likewise.
3155 (_bfd_nosymbols_print_symbol): Likewise.
3156 (_bfd_nosymbols_get_symbol_info): Likewise.
3157 (_bfd_nosymbols_get_symbol_version_string): Likewise.
3158 (_bfd_nosymbols_bfd_is_local_label_name): Likewise.
3159 (_bfd_nosymbols_bfd_is_target_special_symbol): Likewise.
3160 (_bfd_nosymbols_get_lineno): Likewise.
3161 (_bfd_nosymbols_find_nearest_line): Likewise.
3162 (_bfd_nosymbols_find_line): Likewise.
3163 (_bfd_nosymbols_find_inliner_info): Likewise.
3164 (_bfd_nosymbols_bfd_make_debug_symbol): Likewise.
3165 (_bfd_nosymbols_read_minisymbols): Likewise.
3166 (_bfd_nosymbols_minisymbol_to_symbol): Likewise.
3167 (_bfd_norelocs_bfd_reloc_type_lookup): Likewise.
3168 (_bfd_norelocs_bfd_reloc_name_lookup): Likewise.
3169 (_bfd_nowrite_set_arch_mach): Likewise.
3170 (_bfd_nowrite_set_section_contents): Likewise.
3171 (_bfd_nolink_sizeof_headers): Likewise.
3172 (_bfd_nolink_bfd_get_relocated_section_contents): Likewise.
3173 (_bfd_nolink_bfd_relax_section): Likewise.
3174 (_bfd_nolink_bfd_gc_sections): Likewise.
3175 (_bfd_nolink_bfd_lookup_section_flags): Likewise.
3176 (_bfd_nolink_bfd_merge_sections): Likewise.
3177 (_bfd_nolink_bfd_is_group_section): Likewise.
3178 (_bfd_nolink_bfd_discard_group): Likewise.
3179 (_bfd_nolink_bfd_link_hash_table_create): Likewise.
3180 (_bfd_nolink_bfd_link_add_symbols): Likewise.
3181 (_bfd_nolink_bfd_link_just_syms): Likewise.
3182 (_bfd_nolink_bfd_copy_link_hash_symbol_type): Likewise.
3183 (_bfd_nolink_bfd_final_link): Likewise.
3184 (_bfd_nolink_bfd_link_split_section): Likewise.
3185 (_bfd_nolink_section_already_linked): Likewise.
3186 (_bfd_nolink_bfd_define_common_symbol): Likewise.
3187 (_bfd_nolink_bfd_define_start_stop): Likewise.
3188 (_bfd_nodynamic_canonicalize_dynamic_symtab): Likewise.
3189 (_bfd_nodynamic_get_synthetic_symtab): Likewise.
3190 (_bfd_nodynamic_get_dynamic_reloc_upper_bound _bfd_): Likewise.
3191 (_bfd_nodynamic_canonicalize_dynamic_reloc): Likewise.
3192 * libbfd.c (bfd_false_any): New function. Like bfd_false but
3193 accepts one or more arguments.
3194 (bfd_true_any): Likewise.
3195 (bfd_nullvoidptr_any): Likewise.
3196 (bfd_0_any): Likewise.
3197 (bfd_0u_any): Likewise.
3198 (bfd_0l_any): Likewise.
3199 (_bfd_n1_any): Likewise.
3200 (bfd_void_any): Likewise.
3201 * libbfd.h (extern): Regenerate
3202 * aout-target.h (MY_bfd_is_target_special_symbol): Use vararg
3203 based dummy function.
3204 * aout-tic30.c (tic30_aout_set_arch_mach): Likewise.
3205 * binary.c (binary_get_symbol_info): Likewise.
3206 * coff-alpha.c (alpha_ecoff_backend_data): Likewise.
3207 * coff-mips.c (mips_ecoff_backend_data): Likewise.
3208 * coffcode.h (coff_set_alignment_hook): Likewise.
3209 (symname_in_debug_hook): Likewise.
3210 (bfd_coff_backend_data bigobj_swap_table): Likewise.
3211 * elf-m10300.c (elf_backend_omit_section_dynsym): Likewise.
3212 * elf32-cr16.c (elf_backend_omit_section_dynsym): Likewise.
3213 * elf32-lm32.c (elf_backend_omit_section_dynsym): Likewise.
3214 * elf32-m32r.c (elf_backend_omit_section_dynsym): Likewise.
3215 * elf32-metag.c (elf_backend_omit_section_dynsym): Likewise.
3216 * elf32-score.c (elf_backend_omit_section_dynsym): Likewise.
3217 * elf32-score7.c (elf_backend_omit_section_dynsym): Likewise.
3218 * elf32-xstormy16.c (elf_backend_omit_section_dynsym): Likewise.
3219 * elf32-xtensa.c (elf_backend_omit_section_dynsym): Likewise.
3220 * elf64-alpha.c (elf_backend_omit_section_dynsym): Likewise.
3221 * elf64-hppa.c (elf_backend_omit_section_dynsym): Likewise.
3222 * elf64-ia64-vms.c (elf_backend_omit_section_dynsym): Likewise.
3223 * elf64-mmix.c (elf_backend_omit_section_dynsym): Likewise.
3224 * elf64-sh64.c (elf_backend_omit_section_dynsym): Likewise.
3225 * elfnn-ia64.c (elf_backend_omit_section_dynsym): Likewise.
3226 * elfxx-target.h (bfd_elfNN_bfd_debug_info_accumulate): Likewise.
3227 (bfd_elfNN_bfd_make_debug_symbol): Likewise.
3228 (bfd_elfNN_bfd_merge_private_bfd_data): Likewise.
3229 (bfd_elfNN_bfd_set_private_flags): Likewise.
3230 (bfd_elfNN_bfd_is_target_special_symbol): Likewise.
3231 (elf_backend_init_index_section): Likewise.
3232 (elf_backend_allow_non_load_phdr): Likewise.
3233 * elfxx-x86.h (elf_backend_omit_section_dynsym): Likewise.
3234 * i386msdos.c (msdos_bfd_is_target_special_symbol): Likewise.
3235 * ieee.c (ieee_construct_extended_name_table): Likewise.
3236 (ieee_write_armap): Likewise.
3237 (ieee_write_ar_hdr): Likewise.
3238 (ieee_bfd_is_target_special_symbol): Likewise.
3239 * ihex.c (ihex_canonicalize_symtab): Likewise.
3240 (ihex_bfd_is_target_special_symbol): Likewise.
3241 * libaout.h (aout_32_bfd_is_target_special_symbol): Likewise.
3242 * libecoff.h (_bfd_ecoff_bfd_is_target_special_symbol): Likewise.
3243 (_bfd_ecoff_set_alignment_hook): Likewise.
3244 * mach-o-target.c (bfd_mach_o_bfd_is_target_special_symbol): Likewise.
3245 * mmo.c (mmo_bfd_is_target_special_symbol): Likewise.
3246 * nlm-target.h (nlm_bfd_is_target_special_symbol): Likewise.
3247 * oasys.c (oasys_construct_extended_name_table): Likewise.
3248 (oasys_write_armap): Likewise.
3249 (oasys_write_ar_hdr): Likewise.
3250 (oasys_bfd_is_target_special_symbol): Likewise.
3251 * pef.c (bfd_pef_bfd_is_target_special_symbol): Likewise.
3252 * plugin.c (bfd_plugin_bfd_is_target_special_symbol): Likewise.
3253 * ppcboot.c (ppcboot_bfd_is_target_special_symbol): Likewise.
3254 * som.c (som_bfd_is_target_special_symbol): Likewise.
3255 * srec.c (srec_bfd_is_target_special_symbol): Likewise.
3256 * tekhex.c (tekhex_bfd_is_target_special_symbol): Likewise.
3257 * verilog.c (verilog_bfd_is_target_special_symbol): Likewise.
3258 * versados.c (versados_bfd_is_target_special_symbol): Likewise.
3259 (versados_bfd_reloc_name_lookup): Likewise.
3260 * vms-alpha.c (vms_bfd_is_target_special_symbol): Likewise.
3261 (vms_bfd_define_start_stop): Likewise.
3262 (alpha_vms_bfd_is_target_special_symbol): Likewise.
3263 * wasm-module.c (wasm_bfd_is_target_special_symbol): Likewise.
3264 * xsym.c (bfd_sym_bfd_is_target_special_symbol): Likewise.
3265 * elf32-arc.c (get_replace_function): Assign replacement function
3266 to func pointer.
3267 * elf32-i370.c (i370_noop): Update prototype.
3268
3269 2018-02-13 Alan Modra <amodra@gmail.com>
3270
3271 PR 22836
3272 * elf.c (_bfd_elf_fixup_group_sections): Account for removed
3273 relocation sections. If size reduces to just the flag word,
3274 remove that too and mark with SEC_EXCLUDE.
3275 * elflink.c (bfd_elf_final_link): Strip empty group sections.
3276
3277 2018-02-13 Alan Modra <amodra@gmail.com>
3278
3279 PR 22829
3280 * elf.c (assign_file_positions_for_non_load_sections): Rewrite
3281 PT_GNU_RELRO setup.
3282
3283 2018-02-12 Zebediah Figura <z.figura12@gmail.com>
3284
3285 * i386msdos.c (msdos_mkobject); New function.
3286 (msdos_object_p): New function.
3287 (i386_msdos_vec): Use msdos_object_p as the check_format
3288 function.
3289 * peicode.h: Rename external_PEI_DOS_hdr, DOSMAGIC, and
3290 NT_SIGNATURE to external_DOS_hdr, IMAGE_DOS_SIGNATURE, and
3291 IMAGE_NT_SIGNATURE.
3292 * peXXigen.c: Likewise.
3293 * coff-ia64.c: Likewise.
3294
3295 2018-02-12 Nick Clifton <nickc@redhat.com>
3296
3297 * elf32-nds32.c (nds32_elf_relax_longjump3): Remove redundant
3298 assignment.
3299 * elf32-arc.c (elf_arc_relocate_section): Likewise.
3300
3301 2018-02-09 Eric Botcazou <ebotcazou@adacore.com>
3302
3303 * elfxx-sparc.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Reorder conditions.
3304 (sparc_elf_append_rela): Assert that there is enough room in section.
3305 (_bfd_sparc_elf_copy_indirect_symbol): Fix formatting.
3306 (_bfd_sparc_elf_adjust_dynamic_symbol): Minor tweak.
3307 (allocate_dynrelocs): Remove outdated comments and reorder conditions.
3308 For a symbol subject to a GOT relocation, reserve a slot in the
3309 relocation section if the symbol isn't dynamic and we are in PIC mode.
3310 (_bfd_sparc_elf_relocate_section) <R_SPARC_GOTDATA_OP>: If relocation
3311 is relaxed and a slot was reserved, generate a R_SPARC_NONE relocation.
3312 <R_SPARC_GOTDATA_OP_HIX22>: Adjust comments.
3313 <R_SPARC_PC10>: Reorder conditions. Remove always-false assertion.
3314 (_bfd_sparc_elf_finish_dynamic_symbol): Rename local_undefweak into
3315 resolved_to_zero. Do not generate a dynamic GOT relocation for an
3316 undefined weak symbol with non-default visibility. Remove superfluous
3317 'else' and fix formatting.
3318
3319 2018-02-09 H.J. Lu <hongjiu.lu@intel.com>
3320
3321 * elf32-i386.c (elf_i386_get_synthetic_symtab): Also handle
3322 is_solaris.
3323 (i386_elf32_sol2_vec): Don't declare.
3324 (elf_i386_link_setup_gnu_properties): Also handle is_solaris.
3325 Don't set need_global_offset_table.
3326 (elf_i386_solaris_arch_bed): New.
3327 (elf_backend_arch_data): Set to elf_i386_solaris_arch_bed for
3328 Solaris.
3329 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Check
3330 target_os != is_nacl instead of target_os == is_normal.
3331 (x86_64_elf64_sol2_vec): Don't declare.
3332 (elf_x86_64_link_setup_gnu_properties): Check target_os !=
3333 is_nacl instead of target_os == is_normal. Don't set
3334 need_global_offset_table.
3335 (elf_x86_64_solaris_arch_bed): New.
3336 (elf_backend_arch_data): Set to elf_x86_64_solaris_arch_bed for
3337 Solaris.
3338 * elfxx-x86.c (_bfd_x86_elf_size_dynamic_sections): Keep
3339 _GLOBAL_OFFSET_TABLE_ for Solaris.
3340 (_bfd_x86_elf_link_setup_gnu_properties): Don't copy
3341 need_global_offset_table.
3342 * elfxx-x86.h (elf_x86_target_os): Add is_solaris.
3343 (elf_x86_link_hash_table): Remove need_global_offset_table.
3344 (elf_x86_init_table): Likewise.
3345
3346 2018-02-08 H.J. Lu <hongjiu.lu@intel.com>
3347
3348 * elf32-i386.c (elf32_i386_copy_solaris_special_section_fields):
3349 Remove prototype.
3350 (i386_elf32_sol2_vec): Declared.
3351 (elf_i386_link_setup_gnu_properties): Set
3352 need_global_offset_table with info->output_bfd->xvec.
3353 * elf64-x86-64.c (elf64_x86_64_copy_solaris_special_section_fields):
3354 Remove prototype.
3355 (x86_64_elf64_sol2_vec): Declared.
3356 (elf_x86_64_link_setup_gnu_properties): Set
3357 need_global_offset_table with info->output_bfd->xvec.
3358
3359 2018-02-08 H.J. Lu <hongjiu.lu@intel.com>
3360
3361 * elf32-i386.c (elf32_i386_copy_solaris_special_section_fields):
3362 New prototype.
3363 (elf_i386_link_setup_gnu_properties): Set need_global_offset_table
3364 for Solaris.
3365 * elf64-x86-64.c (elf64_x86_64_copy_solaris_special_section_fields):
3366 New prototype.
3367 (elf_x86_64_link_setup_gnu_properties): Set
3368 need_global_offset_table for Solaris.
3369 * elfxx-x86.c (_bfd_x86_elf_size_dynamic_sections): Keep the
3370 unused _GLOBAL_OFFSET_TABLE_ for Solaris.
3371 (_bfd_x86_elf_link_setup_gnu_properties): Copy
3372 need_global_offset_table.
3373 * elfxx-x86.h (elf_x86_link_hash_table): Add
3374 need_global_offset_table.
3375 (elf_x86_init_table): Likewise.
3376
3377 2018-02-08 Jim Wilson <jimw@sifive.com>
3378
3379 * elfnn-riscv.c (riscv_elf_relocate_section): Add comment for previous
3380 change.
3381
3382 2018-02-08 Nick Clifton <nickc@redhat.com>
3383
3384 PR 22788
3385 * elf.c (elf_parse_notes): Reject notes with excessuively large
3386 alignments.
3387
3388 2018-02-07 Alan Modra <amodra@gmail.com>
3389
3390 Revert 2018-01-17 Alan Modra <amodra@gmail.com>
3391 * elf32-ppc.c: Remove speculation barrier support.
3392 * elf32-ppc.h: Likewise.
3393 * elf64-ppc.c: Likewise.
3394 * elf64-ppc.h: Likewise.
3395
3396 2018-02-06 Jim Wilson <jimw@sifive.com>
3397
3398 * elfnn-riscv.c (riscv_elf_relocate_section): Return TRUE if used
3399 callback to report an error.
3400
3401 2018-02-06 Eric Botcazou <ebotcazou@adacore.com>
3402
3403 PR ld/22263
3404 * elfxx-sparc.c (sparc_elf_tls_transition): Turn call to bfd_link_pic
3405 into call to !bfd_link_executable and tidy up.
3406 (_bfd_sparc_elf_check_relocs): Fix formatting and tidy up.
3407 <R_SPARC_TLS_LE_HIX22>: Turn call to bfd_link_pic into call to
3408 !bfd_link_executable.
3409 <R_SPARC_TLS_IE_HI22>: Likewise.
3410 <GOT relocations>: Remove useless code, tidy and merge related blocks.
3411 <R_SPARC_TLS_GD_CALL>: Turn call to bfd_link_pic into call to
3412 !bfd_link_executable.
3413 <R_SPARC_WPLT30>: Tidy up.
3414 (_bfd_sparc_elf_gc_mark_hook): Turn call to bfd_link_pic into call to
3415 !bfd_link_executable.
3416 (allocate_dynrelocs): Likewise.
3417 (_bfd_sparc_elf_relocate_section): Fix formatting and tidy up.
3418 <R_SPARC_TLS_GD_HI22>: Merge into...
3419 <R_SPARC_TLS_GD_LO10>: ...this. Adjust 4th argument in call to
3420 sparc_elf_tls_transition and remove redundant code.
3421 <R_SPARC_TLS_LDM_HI22>: Turn call to bfd_link_pic into call to
3422 !bfd_link_executable.
3423 <R_SPARC_TLS_LDO_HIX22>: Likewise.
3424 <R_SPARC_TLS_LE_HIX22>: Likewise. Tidy up.
3425 <R_SPARC_TLS_LDM_CALL>: Likewise.
3426 <R_SPARC_TLS_GD_CALL>: Likewise. Tidy up.
3427 <R_SPARC_TLS_GD_ADD>: Likewise.
3428 <R_SPARC_TLS_LDM_ADD>: Likewise.
3429 <R_SPARC_TLS_LDO_ADD>: Likewise.
3430 <R_SPARC_TLS_IE_LD>: Likewise.
3431
3432 2018-02-06 Miloš Stojanović <milos.stojanovic@rt-rk.com>
3433
3434 PR 22789
3435 * elfxx-mips.c (_bfd_mips_elf_find_nearest_line): If the dwarf
3436 functions failed to find the function name, try the generic elf
3437 find function instead.
3438
3439 2018-02-06 Sergio Durigan Junior <sergiodj@redhat.com>
3440
3441 * coff-rs6000.c (xcoff_write_archive_contents_old): Use
3442 'memcpy' instead of 'strncpy' when writing the magic number.
3443
3444 2018-02-06 Nick Clifton <nickc@redhat.com>
3445
3446 PR 22794
3447 * opncls.c (bfd_get_debug_link_info_1): Check the size of the
3448 section before attempting to read it in.
3449 (bfd_get_alt_debug_link_info): Likewise.
3450
3451 2018-02-06 Paul Carroll <pcarroll@codesourcery.com>
3452
3453 * bfd/dwarf2.c (find_abstract_name): Modified to return file and
3454 line information in addition to name, if they can be found.
3455
3456 2018-02-05 Renlin Li <renlin.li@arm.com>
3457
3458 PR ld/22764
3459 * elfnn-aarch64.c (elfNN_aarch64_check_relocs): Relax the
3460 R_AARCH64_ABS32 and R_AARCH64_ABS16 for absolute symbol. Apply the
3461 check for writeable section as well.
3462
3463 2018-02-05 H.J. Lu <hongjiu.lu@intel.com>
3464
3465 PR ld/22782
3466 * elf32-i386.c (elf_i386_check_relocs): Set got_referenced if
3467 _GLOBAL_OFFSET_TABLE_ is referenced or GOT is needed to resolve
3468 undefined weak symbol to 0.
3469 * elf64-x86-64.c (elf_x86_64_check_relocs): Set got_referenced
3470 if _GLOBAL_OFFSET_TABLE_ is referenced.
3471 * elfxx-x86.c (_bfd_x86_elf_size_dynamic_sections): Check
3472 got_referenced instead of ref_regular_nonweak. Remove the
3473 unused _GLOBAL_OFFSET_TABLE_ from symbol table.
3474 * elfxx-x86.h (elf_x86_link_hash_table): Add got_referenced.
3475
3476 2018-02-05 Maciej W. Rozycki <macro@mips.com>
3477
3478 * elfnn-riscv.c (_bfd_riscv_relax_pc): Use `memset' to
3479 initialize `hi_reloc'.
3480
3481 2018-02-05 Maciej W. Rozycki <macro@mips.com>
3482
3483 * elfxx-mips.c (_bfd_mips_elf_section_processing): For
3484 SHT_MIPS_REGINFO sections don't assert the correct size and
3485 report an error instead.
3486
3487 2018-02-05 Maciej W. Rozycki <macro@mips.com>
3488
3489 * elf.c (_bfd_elf_write_object_contents): Propagate a failure
3490 status from `->elf_backend_section_processing'.
3491
3492 2018-02-02 Jim Wilson <jimw@sifive.com>
3493
3494 PR ld/22756
3495 * elfnn-riscv.c (riscv_relax_delete_bytes): New parameter link_info.
3496 If link_info->wrap_hash, check for a duplicate symbol and ignore.
3497 (_bfd_riscv_relax_call, bfd_riscv_relax_lui, _bfd_riscv_relax_tls_le):
3498 Pass new argument to riscv_relax_delete_bytes.
3499 (_bfd_riscv_relax_align, _bfd_riscv_relax_delete): Likewise. Remove
3500 ATTRIBUTE_UNUSED from link_info parameter.
3501
3502 2018-02-02 Alan Modra <amodra@gmail.com>
3503
3504 * elf64-ppc.c (ppc64_elf_relocate_section): Don't relocate nops
3505 emitted for toc sequence optimization. Set and use "howto" later.
3506
3507 2018-02-01 Simon Marchi <simon.marchi@ericsson.com>
3508
3509 * elf64-ppc.c (ppc64_elf_archive_symbol_lookup): Avoid pointer
3510 arithmetic on NULL pointer.
3511 * elflink.c (_bfd_elf_archive_symbol_lookup,
3512 elf_link_add_archive_symbols): Likewise.
3513
3514 2018-01-31 Michael Matz <matz@suse.de>
3515
3516 * elflink.c (bfd_elf_define_start_stop): Fix check of
3517 def_dynamic.
3518
3519 2018-01-31 H.J. Lu <hongjiu.lu@intel.com>
3520
3521 PR ld/21964
3522 * elflink.c (bfd_elf_define_start_stop): Check if __start and
3523 __stop symbols are referenced by shared objects.
3524
3525 2018-01-30 Alan Modra <amodra@gmail.com>
3526
3527 PR 22758
3528 * elf.c (_bfd_elf_map_sections_to_segments): Don't start a new
3529 segment when demand paged with lma on the same page. Test this
3530 before load/non-load, executable/non-executable,
3531 writable/non-writable tests and simplify. Delete bogus relro
3532 condition in writable/non-writable test. Delete outdated
3533 comment. Formatting.
3534
3535 2018-01-30 Alan Modra <amodra@gmail.com>
3536
3537 * elflink.c (bfd_elf_define_start_stop): Make __start and __stop
3538 symbols dynamic.
3539
3540 2018-01-29 Alan Modra <amodra@gmail.com>
3541
3542 PR 22741
3543 * coffgen.c (coff_pointerize_aux): Ensure auxent tagndx is in
3544 range before converting to a symbol table pointer.
3545
3546 2018-01-27 Nick Clifton <nickc@redhat.com>
3547
3548 * po/ru.po: Updated Russian translation.
3549
3550 2018-01-26 Alan Modra <amodra@gmail.com>
3551
3552 * elflink.c (bfd_elf_define_start_stop): Override symbols when
3553 they are defined dynamically.
3554
3555 2018-01-26 Alan Modra <amodra@gmail.com>
3556
3557 * elf64-ppc.c (ppc64_elf_size_stubs): Iterate sizing when
3558 .branch_lt changes size.
3559
3560 2018-01-25 Alan Modra <amodra@gmail.com>
3561
3562 PR 22746
3563 * elfcode.h (elf_object_p): Avoid integer overflow.
3564
3565 2018-01-25 Eric Botcazou <ebotcazou@adacore.com>
3566
3567 PR ld/22727
3568 * elfxx-sparc.c (_bfd_sparc_elf_check_relocs) <R_SPARC_TLS_GD_CALL>:
3569 Do a mere lookup of the __tls_get_addr symbol instead of adding it.
3570
3571 Revert
3572 2017-10-19 H.J. Lu <hongjiu.lu@intel.com>
3573
3574 PR ld/22263
3575 * elfxx-sparc.c (sparc_elf_tls_transition): Replace
3576 bfd_link_pic with !bfd_link_executable, !bfd_link_pic with
3577 bfd_link_executable for TLS check.
3578 (_bfd_sparc_elf_check_relocs): Likewise.
3579 (allocate_dynrelocs): Likewise.
3580 (_bfd_sparc_elf_relocate_section): Likewise.
3581
3582 2018-01-24 Renlin Li <renlin.li@arm.com>
3583
3584 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Add support for
3585 BFD_RELOC_AARCH64_MOVW_PREL_G0, BFD_RELOC_AARCH64_MOVW_PREL_G0_NC,
3586 BFD_RELOC_AARCH64_MOVW_PREL_G1, BFD_RELOC_AARCH64_MOVW_PREL_G1_NC,
3587 BFD_RELOC_AARCH64_MOVW_PREL_G2, BFD_RELOC_AARCH64_MOVW_PREL_G2_NC,
3588 BFD_RELOC_AARCH64_MOVW_PREL_G3.
3589 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
3590 (_bfd_aarch64_elf_resolve_relocation): Likewise.
3591
3592 2018-01-24 Renlin Li <renlin.li@arm.com>
3593
3594 * reloc.c: Add BFD_RELOC_AARCH64_MOVW_PREL_G0,
3595 BFD_RELOC_AARCH64_MOVW_PREL_G0_NC, BFD_RELOC_AARCH64_MOVW_PREL_G1,
3596 BFD_RELOC_AARCH64_MOVW_PREL_G1_NC, BFD_RELOC_AARCH64_MOVW_PREL_G2,
3597 BFD_RELOC_AARCH64_MOVW_PREL_G2_NC, BFD_RELOC_AARCH64_MOVW_PREL_G3.
3598 * elfnn-aarch64.c (elfNN_aarch64_howto_table): Add entries for
3599 BFD_RELOC_AARCH64_MOVW_PREL_G0, BFD_RELOC_AARCH64_MOVW_PREL_G0_NC,
3600 BFD_RELOC_AARCH64_MOVW_PREL_G1, BFD_RELOC_AARCH64_MOVW_PREL_G1_NC,
3601 BFD_RELOC_AARCH64_MOVW_PREL_G2, BFD_RELOC_AARCH64_MOVW_PREL_G2_NC,
3602 BFD_RELOC_AARCH64_MOVW_PREL_G3.
3603 * bfd-in2.h: Regenerate.
3604 * libbfd.h: Regenerate.
3605
3606 2018-01-23 Maciej W. Rozycki <macro@mips.com>
3607
3608 * elfxx-mips.c (_bfd_mips_elf_final_link): Update a stale
3609 `mips_elf32_section_processing' comment reference.
3610
3611 2018-01-20 H.J. Lu <hongjiu.lu@intel.com>
3612
3613 PR ld/22721
3614 * elfxx-x86.c (_bfd_x86_elf_link_check_relocs): Check the
3615 versioned __tls_get_addr symbol.
3616
3617 2018-01-19 Nick Clifton <nickc@redhat.com>
3618
3619 * po/fr.po: Updated French translation.
3620
3621 2018-01-18 Alan Modra <amodra@gmail.com>
3622
3623 * elf32-ppc.c (ppc_elf_create_glink): Correct alignment of .glink.
3624 * elf64-ppc.c (ppc64_elf_size_stubs): Handle negative plt_stub_align.
3625 (ppc64_elf_build_stubs): Likewise.
3626
3627 2018-01-17 Nick Clifton <nickc@redhat.com>
3628
3629 * po/ru.po: Updated Russian translation.
3630 * po/uk/po: Updated Ukranian translation.
3631
3632 2018-01-17 Alan Modra <amodra@gmail.com>
3633
3634 * elf64-ppc.c (ppc64_elf_build_stubs): Silence gcc warning.
3635
3636 2018-01-17 Alan Modra <amodra@gmail.com>
3637
3638 * elf32-ppc.c (GLINK_ENTRY_SIZE): Handle speculation barrier.
3639 (CRSETEQ, BEQCTRM): Define.
3640 (is_nonpic_glink_stub): Don't check bctr.
3641 (ppc_elf_link_hash_table_create): Init new ppc_elf_params field.
3642 (ppc_elf_relax_section): Size speculation barrier.
3643 (output_bctr): New function.
3644 (write_glink_stub): Use output_bctr.
3645 (ppc_elf_relocate_section): Use output_bctr for long branch stub.
3646 (ppc_elf_finish_dynamic_symbol): Likewise.
3647 (ppc_elf_finish_dynamic_sections): Use output_bctr.
3648 * elf32-ppc.h (struct ppc_elf_params): Add speculate_indirect_jumps.
3649 * elf64-ppc.c (CRSETEQ, BEQCTRM, BEQCTRLM): Define.
3650 (GLINK_PLTRESOLVE_SIZE): Size speculation barrier.
3651 (size_global_entry_stubs): Handle speculation barrier sizing.
3652 (plt_stub_size): Likewise.
3653 (output_bctr): New function.
3654 (build_plt_stub, build_tls_get_addr_stub): Output speculation
3655 barrier.
3656 (ppc_build_one_stub): Likewise for ppc_stub_plt_branch.
3657 (ppc_size_one_stub): Size speculation barrier in ppc_stub_plt_branch.
3658 (build_global_entry_stubs): Output speculation barrier.
3659 (ppc64_elf_build_stubs): Likewise in __glink_PLTresolve stub.
3660 * elf64-ppc.h (struct ppc64_elf_params): Add speculate_indirect_jumps.
3661
3662 2018-01-17 Alan Modra <amodra@gmail.com>
3663
3664 * elf32-ppc.c (GLINK_ENTRY_SIZE): Add parameters, handle
3665 __tls_get_addr_opt, and alignment sizing.
3666 (TLS_GET_ADDR_GLINK_SIZE): Delete.
3667 (is_nonpic_glink_stub): Don't use GLINK_ENTRY_SIZE.
3668 (ppc_elf_get_synthetic_symtab): Recognize stubs spaced at 4, 6,
3669 or 8 insns.
3670 (ppc_elf_link_hash_table_create): Init new ppc_elf_params field.
3671 (allocate_dynrelocs): Use new GLINK_ENTRY_SIZE.
3672 (ppc_elf_size_dynamic_sections): Likewise. Size branch table
3673 by PLT reloc count.
3674 (write_glink_stub): Handle __tls_get_addr_opt stub.
3675 Pad out to size given by GLINK_ENTRY_SIZE.
3676 (ppc_elf_relocate_section): Adjust write_glink_stub call.
3677 (ppc_elf_finish_dynamic_symbol): Likewise.
3678 (ppc_elf_finish_dynamic_sections): Write PLTresolve without using
3679 insn array since so many need rewriting.
3680 * elf32-ppc.h (struct ppc_elf_params): Add plt_stub_align.
3681 * elf64-ppc.c (GLINK_PLTRESOLVE_SIZE): Rename from
3682 GLINK_CALL_STUB_SIZE. Add htab param and evaluate to size without
3683 nops. Adjust all uses.
3684 (ppc64_elf_get_synthetic_symtab): Don't use GLINK_CALL_STUB_SIZE
3685 in glink_vma calculation.
3686 (struct ppc_link_hash_table): Add global_entry section pointer.
3687 (create_linkage_sections): Create separate section for global
3688 entry stubs.
3689 (PPC_LO, PPC_HI, PPC_HA): Move earlier.
3690 (size_global_entry_stubs): Handle sizing for aligned stubs.
3691 (ppc64_elf_size_dynamic_sections): Handle global_entry alloc,
3692 and don't stash end of glink branch table in rawsize.
3693 (ppc_build_one_stub): Rewrite stub size calculations.
3694 (build_global_entry_stubs): Use new section.
3695 (ppc64_elf_build_stubs): Don't pad __glink_PLTresolve with nops.
3696 Build lazy link stubs out to end of section. Build global entry
3697 stubs in new section.
3698
3699 2018-01-15 Nick Clifton <nickc@redhat.com>
3700
3701 * po/uk.po: Updated Ukranian translation.
3702
3703 2018-01-13 Nick Clifton <nickc@redhat.com>
3704
3705 * po/bfd.pot: Regenerated.
3706
3707 2018-01-13 Nick Clifton <nickc@redhat.com>
3708
3709 * version.m4: Bump version to 2.30.51
3710 * configure: Regenerate.
3711
3712 2018-01-13 Nick Clifton <nickc@redhat.com>
3713
3714 2.30 branch created.
3715
3716 2018-01-12 Jens Widell <jl@opera.com>
3717
3718 * elf.c (setup_group): Optimize search for group by remembering
3719 last found group and restarting search at that index.
3720 * elf-bfd.h (struct elf_obj_tdata): Add group_search_offset field.
3721
3722 2018-01-12 Gunther Nikl <gnikl@users.sourceforge.net>
3723
3724 * aoutx.h (aout_link_check_ar_symbols): Remove default and handle
3725 bfd_link_common_skip_none in switch.
3726
3727 2018-01-12 Alan Modra <amodra@gmail.com>
3728
3729 PR ld/22649
3730 * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Ignore dynamic
3731 references on forced local symbols.
3732
3733 2018-01-12 Vlad Ivanov <vlad@ivanov.email>
3734
3735 * elfxx-mips.c (_bfd_mips_elf_final_link): Notify user when
3736 .reginfo section has wrong size.
3737
3738 2018-01-11 H.J. Lu <hongjiu.lu@intel.com>
3739
3740 PR ld/22393
3741 * elf.c (_bfd_elf_map_sections_to_segments): When generating
3742 separate code and read-only data LOAD segments, create a new
3743 LOAD segment if the previous section contains text and the
3744 current section doesn't or vice versa. Don't put a writable
3745 section in a read-only segment if there is a RELRO segment.
3746
3747 2018-01-11 H.J. Lu <hongjiu.lu@intel.com>
3748
3749 PR ld/22649
3750 * elflink.c (bfd_elf_gc_mark_dynamic_ref_symbol): Ignore dynamic
3751 references on forced local symbols.
3752
3753 2018-01-11 H.J. Lu <hongjiu.lu@intel.com>
3754
3755 PR ld/22677
3756 * elflink.c (bfd_elf_gc_sections): Keep all PREINIT_ARRAY,
3757 INIT_ARRAY as well as FINI_ARRAY sections for ld -r --gc-section.
3758
3759 2018-01-09 Kuan-Lin Chen <kuanlinchentw@gmail.com>
3760
3761 PR 22662
3762 * elf32-nds32.c (nds32_elf_relax_loadstore): Fix a typographical error.
3763
3764 2018-01-03 John Baldwin <jhb@FreeBSD.org>
3765
3766 * elf.c (elfcore_grok_freebsd_note): Handle
3767 NT_FREEBSD_PROCSTAT_PROC, NT_FREEBSD_PROCSTAT_FILES, and
3768 NT_FREEBSD_PROCSTAT_VMMAP.
3769
3770 2018-01-03 Alan Modra <amodra@gmail.com>
3771
3772 Update year range in copyright notice of all files.
3773
3774 For older changes see ChangeLog-2017
3775 \f
3776 Copyright (C) 2018 Free Software Foundation, Inc.
3777
3778 Copying and distribution of this file, with or without modification,
3779 are permitted in any medium without royalty provided the copyright
3780 notice and this notice are preserved.
3781
3782 Local Variables:
3783 mode: change-log
3784 left-margin: 8
3785 fill-column: 74
3786 version-control: never
3787 End:
This page took 0.120535 seconds and 4 git commands to generate.