PowerPC TPREL16_HA/LO reloc optimization
[binutils-gdb.git] / bfd / ChangeLog
1 2017-08-30 Alan Modra <amodra@gmail.com>
2
3 * elf64-ppc.c (struct ppc_link_hash_table): Add do_tls_opt.
4 (ppc64_elf_tls_optimize): Set it.
5 (ppc64_elf_relocate_section): Nop addis on TPREL16_HA, and convert
6 insn on TPREL16_LO and TPREL16_LO_DS relocs to use r13 when
7 addis would add zero.
8 * elf32-ppc.c (struct ppc_elf_link_hash_table): Add do_tls_opt.
9 (ppc_elf_tls_optimize): Set it.
10 (ppc_elf_relocate_section): Nop addis on TPREL16_HA, and convert
11 insn on TPREL16_LO relocs to use r2 when addis would add zero.
12
13 2017-08-30 Alan Modra <amodra@gmail.com>
14
15 * elf64-ppc.c (ppc64_elf_relocate_section): When optimizing
16 __tls_get_addr call sequences to LE, don't move the addi down
17 to the nop. Replace the bl with addi and leave the nop alone.
18
19 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
20
21 * elf32-i386.c (elf_i386_pie_finish_undefweak_symbol):
22 Re-indent.
23 * elf64-x86-64.c (elf_x86_64_finish_local_dynamic_symbol):
24 Likewise.
25 (elf_x86_64_pie_finish_undefweak_symbol): Likewise.
26
27 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
28
29 * elf32-i386.c (elf_i386_get_synthetic_symtab): Simplify bad
30 return.
31 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
32
33 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
34
35 * elf32-i386.c (elf_i386_get_synthetic_symtab): Check valid PLT
36 sections before checking dynamic relocations and free invalid
37 PLT section contents.
38 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
39
40 2017-08-28 H.J. Lu <hongjiu.lu@intel.com>
41
42 * elf-bfd.h (_bfd_elf_ifunc_get_synthetic_symtab): Removed.
43 * elf-ifunc.c (_bfd_elf_ifunc_get_synthetic_symtab): Likewise.
44
45 2017-08-28 H.J. Lu <hongjiu.lu@intel.com>
46
47 PR binutils/22018
48 * elf32-i386.c (elf_i386_get_synthetic_symtab): Check for valid
49 PLT section size.
50 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
51
52 2017-08-27 H.J. Lu <hongjiu.lu@intel.com>
53
54 * elf32-i386.c (elf_i386_link_hash_newfunc): Initialize
55 def_protected.
56 * elf64-x86-64.c (elf_x86_64_link_hash_newfunc): Likewise.
57
58 2017-08-26 H.J. Lu <hongjiu.lu@intel.com>
59
60 PR ld/21997
61 * elf-bfd.h (elf_obj_tdata): Use ENUM_BITFIELD on object_id,
62 dyn_lib_class and has_gnu_symbols. Change bad_symtab to bitfield.
63 Add a has_no_copy_on_protected bitfield.
64 (elf_has_no_copy_on_protected): New.
65 * elf-properties.c (_bfd_elf_parse_gnu_properties): Set
66 elf_has_no_copy_on_protected for GNU_PROPERTY_NO_COPY_ON_PROTECTED.
67 (elf_merge_gnu_property_list): Likewise.
68 (_bfd_elf_link_setup_gnu_properties): Set extern_protected_data
69 to FALSE for elf_has_no_copy_on_protected.
70 * elf32-i386.c (SYMBOL_NO_COPYRELOC): New.
71 (elf_i386_link_hash_entry): Add def_protected.
72 (elf_i386_adjust_dynamic_symbol): Also check SYMBOL_NO_COPYRELOC
73 when checking info->nocopyreloc.
74 (elf_i386_link_setup_gnu_properties): Don't set
75 extern_protected_data here.
76 (elf_i386_merge_symbol_attribute): New function.
77 (elf_backend_merge_symbol_attribute): New.
78 * elf64-x86-64.c (SYMBOL_NO_COPYRELOC): New.
79 (elf_x86_64_link_hash_entry): Add def_protected.
80 (elf_x86_64_need_pic): Report protected symbol for def_protected.
81 (elf_x86_64_adjust_dynamic_symbol): Also check SYMBOL_NO_COPYRELOC
82 when checking info->nocopyreloc.
83 (elf_x86_64_relocate_section): Also check for R_X86_64_PC32
84 relocation run-time overflow and unresolvable R_X86_64_32S
85 relocation against protected data symbol defined in shared object
86 with GNU_PROPERTY_NO_COPY_ON_PROTECTED.
87 (elf_x86_64_link_setup_gnu_properties): Don't set
88 extern_protected_data here.
89 (elf_x86_64_merge_symbol_attribute): New function.
90 (elf_backend_merge_symbol_attribute): New.
91
92 2017-08-26 Alan Modra <amodra@gmail.com>
93
94 * elf32-ppc.c (must_be_dyn_reloc): Use bfd_link_dll. Comment.
95 (ppc_elf_check_relocs): Only set DF_STATIC_TLS in shared libs.
96 (ppc_elf_relocate_section): Comment fix.
97 * elf64-ppc.c (must_be_dyn_reloc): Use bfd_link_dll. Comment.
98 (ppc64_elf_check_relocs): Only set DF_STATIC_TLS in shared libs.
99 Support dynamic relocs for TPREL16 when non-pic too.
100 (dec_dynrel_count): Adjust TPREL16 handling as per check_relocs.
101 (ppc64_elf_relocate_section): Support dynamic relocs for TPREL16
102 when non-pic too.
103
104 2017-08-25 H.J. Lu <hongjiu.lu@intel.com>
105
106 * elf32-i386.c (elf_i386_link_hash_entry): Remove redundant
107 "symbol" in comments.
108 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Likewise.
109
110 2017-08-24 H.J. Lu <hongjiu.lu@intel.com>
111
112 PR ld/22001
113 * elf64-x86-64.c (elf_x86_64_relocate_section): Check for
114 R_X86_64_PC32 relocation run-time overflow and unresolvable
115 R_X86_64_32S relocation with -z nocopyreloc.
116
117 2017-08-24 H.J. Lu <hongjiu.lu@intel.com>
118
119 * elf32-i386.c (elf_i386_check_relocs): Revert the last change.
120 Undefined symbols may not have a type.
121 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
122
123 2017-08-23 H.J. Lu <hongjiu.lu@intel.com>
124
125 * elf64-x86-64.c (elf_x86_64_need_pic): Add an argument for
126 bfd_link_info. Report shared, PIE or PDE object based on
127 bfd_link_info.
128 (elf_x86_64_check_relocs): Update elf_x86_64_need_pic call.
129 (elf_x86_64_relocate_section): Likewise.
130
131 2017-08-23 H.J. Lu <hongjiu.lu@intel.com>
132
133 * elf32-i386.c (elf_i386_check_relocs): Increment PLT count only
134 for function symbols.
135 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
136
137 2017-08-23 H.J. Lu <hongjiu.lu@intel.com>
138
139 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Set
140 extern_protected_data to FALSE if GNU_PROPERTY_NO_COPY_ON_PROTECTED
141 is set on any input relocatable file.
142 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Likewise.
143
144 2017-08-23 Alan Modra <amodra@gmail.com>
145
146 PR 21988
147 * elf64-ppc.c (ensure_undef_dynamic): Rename from
148 ensure_undefweak_dynamic. Handle undefined too.
149 * elf32-ppc.c (ensure_undef_dynamic): Likewise.
150 * elf32-hppa.c (ensure_undef_dynamic): Likewise.
151 (allocate_dynrelocs): Discard undefined non-default visibility
152 relocs first. Make undefined syms dynamic. Tidy goto.
153
154 2017-08-21 Alan Modra <amodra@gmail.com>
155 H.J. Lu <hongjiu.lu@intel.com>
156
157 PR ld/21964
158 * elf-bfd.h (SYMBOLIC_BIND): Return TRUE for __start/__stop symbols.
159 * elflink.c (bfd_elf_define_start_stop): Rewrite.
160
161 2017-08-21 Hans-Peter Nilsson <hp@bitrange.com>
162
163 PR ld/20125
164 * elf64-mmix.c (mmix_elf_relax_section): Correct handling of
165 undefined weak symbols.
166
167 2017-08-18 Nick Clifton <nickc@redhat.com>
168
169 PR binutils/21962
170 * tekhex.c (getsym): Fix check for source pointer walking off the
171 end of the input buffer.
172
173 2017-08-17 Szabolcs Nagy <szabolcs.nagy@arm.com>
174
175 PR ld/18808
176 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Skip IFUNC
177 relocations in debug sections, change abort to _bfd_error_handler.
178
179 2017-08-14 Nick Clifton <nickc@redhat.com>
180
181 PR 21957
182 * elf.c (setup_group): Check for an empty or very small group
183 section.
184 * po/bfd.pot: Regenerate.
185
186 2017-08-14 Alan Modra <amodra@gmail.com>
187
188 PR 21441
189 * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Don't add
190 alignment padding here.
191 * elflink.c (bfd_elf_discard_info): Add .eh_frame padding here
192 in a reverse pass over sections.
193
194 2017-08-11 H.J. Lu <hongjiu.lu@intel.com>
195
196 PR binutils/21943
197 * elf32-i386.c (elf_i386_get_synthetic_symtab): Allocate space
198 for @plt suffixes first.
199 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
200
201 2017-08-08 Nick Clifton <nickc@redhat.com>
202
203 PR 21916
204 * elf-attrs.c (_bfd_elf_parse_attributes): Complain about very
205 small section lengths.
206 * elf.c (_bfd_elf_setup_sections): Skip empty entries in the group
207 table.
208 (elfcore_grok_freebsd_prstatus): Add checks to make sure that
209 there is enough data present in the note.
210
211 2017-08-08 Alan Modra <amodra@gmail.com>
212
213 PR 21017
214 * elf32-microblaze.c (microblaze_elf_check_relocs): Don't bump
215 got.refcount for GOTOFF relocs, just create .got section.
216
217 2017-08-07 H.J. Lu <hongjiu.lu@intel.com>
218
219 * elflink.c (elf_link_add_object_symbols): Move common symbol
220 check after bed->common_definition.
221
222 2017-08-07 Alan Modra <amodra@gmail.com>
223
224 PR 21910
225 * elflink.c (bfd_elf_final_link): Don't segfault when sections
226 needed to define various dynamic tags have been discarded.
227
228 2017-08-07 Nick Clifton <nickc@redhat.com>
229
230 PR 21884
231 * elf32-i386.c (elf_i386_link_setup_gnu_properties): If the dynobj
232 has not been set then use the bfd returned by
233 _bfd_elf_link_setup_gnu_properties. If that is null then search
234 through all the input bfds selecting the first normal, ELF format
235 one.
236 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Likewise.
237
238 2017-08-06 H.J. Lu <hongjiu.lu@intel.com>
239
240 * elf32-i386.c (elf_i386_link_hash_entry): Change tls_get_addr
241 to 1 bit.
242 (elf_i386_link_hash_newfunc): Initialize tls_get_addr to 0.
243 (elf_i386_check_tls_transition): Check tls_get_addr directly.
244 (elf_i386_convert_load_reloc): Update tls_get_addr check.
245 (elf_i386_link_check_relocs): New function.
246 (bfd_elf32_bfd_link_check_relocs): New.
247 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Change tls_get_addr
248 to 1 bit.
249 (elf_x86_64_link_hash_newfunc): Initialize tls_get_addr to 0.
250 (elf_x86_64_check_tls_transition): Check tls_get_addr directly.
251 (elf_x86_64_convert_load_reloc): Update tls_get_addr check.
252 (elf_x86_64_link_check_relocs): New function.
253 (bfd_elf64_bfd_link_check_relocs): New.
254 (bfd_elf32_bfd_link_check_relocs): Likewise.
255
256 2017-08-06 H.J. Lu <hongjiu.lu@intel.com>
257
258 PR ld/21903:
259 * elflink.c (elf_link_add_object_symbols): Treat common symbol
260 as undefined for --no-define-common.
261
262 2017-08-05 Alan Modra <amodra@gmail.com>
263
264 * elf32-hppa.c (elf32_hppa_set_gp): Don't require an
265 hppa_link_hash_table.
266
267 2017-08-02 Max Filippov <jcmvbkbc@gmail.com>
268
269 * xtensa-isa.c (xtensa_isa_init): Don't update lookup table
270 entries for sysregs with negative indices.
271
272 2017-08-01 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
273
274 * elf32-s390.c (elf_s390_finish_dynamic_sections): Skip if it
275 isn't the S/390 specific elf data.
276 * elf64-s390.c (elf_s390_finish_dynamic_sections): Likewise.
277
278 2017-07-31 Kuan-Lin Chen <rufus@andestech.com>
279
280 * elfxx-riscv.c (riscv_elf_add_sub_reloc): New function.
281 * (howto_table) [R_RISCV_ADD8]: Use riscv_elf_add_sub_reloc.
282 [R_RISCV_ADD16]: Likewise.
283 [R_RISCV_ADD32]: Likewise.
284 [R_RISCV_ADD64]: Likewise.
285 [R_RISCV_SUB6]: Likewise.
286 [R_RISCV_SUB8]: Likewise.
287 [R_RISCV_SUB16]: Likewise.
288 [R_RISCV_SUB32]: Likewise.
289 [R_RISCV_SUB64]: Likewise.
290
291 2017-07-31 Alan Modra <amodra@gmail.com>
292
293 * elf64-ppc.c (ppc64_elf_tls_setup): Warn on --plt-localentry
294 without ld.so checks.
295
296 2017-07-29 Alan Modra <amodra@gmail.com>
297
298 PR 21847
299 * elf64-ppc.c (struct ppc_link_hash_entry): Add non_zero_localentry.
300 (ppc64_elf_merge_symbol): Set non_zero_localentry.
301 (is_elfv2_localentry0): Test non_zero_localentry.
302 (ppc64_elf_tls_setup): Default to --no-plt-localentry.
303
304 2017-07-28 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
305
306 * elf32-s390.c (elf_s390_finish_dynamic_sections): Add NULL
307 pointer check for htab->elf.irelplt.
308 * elf64-s390.c (elf_s390_finish_dynamic_sections): Likewise.
309
310 2017-07-27 Nick Clifton <nickc@redhat.com>
311
312 PR 21840
313 * mach-o.c (bfd_mach_o_read_symtab_strtab): Fail if the symtab
314 size is -1.
315 * nlmcode.h (nlm_swap_auxiliary_headers_in): Replace assertion
316 with error return.
317 * section.c (bfd_make_section_with_flags): Fail if the name or bfd
318 are NULL.
319 * vms-alpha.c (bfd_make_section_with_flags): Correct computation
320 of end pointer.
321 (evax_bfd_print_emh): Check for invalid string lengths.
322
323 2017-07-25 Nick Clifton <nickc@redhat.com>
324
325 * po/fr.po: Updated French translation.
326
327 2017-07-25 Benjamin Green <bengreen5mx@gmail.com>
328
329 PR 21824
330 * elf32-msp430.c (msp430_elf_relax_section): Allow conversion of
331 16-bit absolute branches into 10-bit pc-relative branches on the
332 MSP430 as well as the MSP430X.
333
334 2017-07-25 Alan Modra <amodra@gmail.com>
335
336 * elf64-ppc.c (struct map_stub): Add tls_get_addr_opt_bctrl.
337 (stub_eh_frame_size): New function.
338 (ppc_size_one_stub): Set group tls_get_addr_opt_bctrl.
339 (group_sections): Init group tls_get_addr_opt_bctrl.
340 (ppc64_elf_size_stubs): Update sizing and initialization of
341 .eh_frame. Iteration over stubs via group list.
342 (ppc64_elf_build_stubs): Iterate over stubs via group list.
343 (ppc64_elf_finish_dynamic_sections): Update finalization of
344 .eh_frame.
345
346 2017-07-24 Nick Clifton <nickc@redhat.com>
347
348 PR 21813
349 * mach-o.c (bfd_mach_o_canonicalize_relocs): Pass the base address
350 of the relocs to the canonicalize_one_reloc routine.
351 * mach-o.h (struct bfd_mach_o_backend_data): Update the prototype
352 for the _bfd_mach_o_canonicalize_one_reloc field.
353 * mach-o-arm.c (bfd_mach_o_arm_canonicalize_one_reloc): Add
354 res_base parameter. Use to check for corrupt pair relocs.
355 * mach-o-aarch64.c (bfd_mach_o_arm64_canonicalize_one_reloc):
356 Likewise.
357 * mach-o-i386.c (bfd_mach_o_i386_canonicalize_one_reloc):
358 Likewise.
359 * mach-o-x86-64.c (bfd_mach_o_x86_64_canonicalize_one_reloc):
360 Likewise.
361
362 * vms-alpha.c (_bfd_vms_slurp_eihd): Make sure that there is
363 enough data in the record before attempting to parse it.
364 (_bfd_vms_slurp_eeom): Likewise.
365
366 (_bfd_vms_slurp_egsd): Check for an invalid section index.
367 (image_set_ptr): Likewise.
368 (alpha_vms_slurp_relocs): Likewise.
369
370 (alpha_vms_object_p): Check for a truncated record.
371
372 2017-07-24 Nick Clifton <nickc@redhat.com>
373
374 PR 21803
375 * reloc.c (_bfd_unrecognized_reloc): New function. Reports
376 an unrecognized reloc and sets the bfd_error value.
377 * libbfd.h: Regenerate.
378 * elf32-arm.c (elf32_arm_final_link_relocate): Use the new
379 function.
380 * elf32-i386.c (elf_i386_relocate_section): Likewise.
381 * elf32-tilepro.c (tilepro_elf_relocate_section): Likewise.
382 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
383 * elfnn-aarch64.c (elfNN_aarch64_relocate_section): Likewise.
384 * elfxx-tilegx.c (tilegx_elf_relocate_section): Likewise.
385
386 2017-07-23 Alan Modra <amodra@gmail.com>
387
388 * elf64-ppc.c (ppc64_elf_size_stubs): Correct advance to
389 restore of LR.
390
391 2017-07-19 Szabolcs Nagy <szabolcs.nagy@arm.com>
392
393 PR ld/18841
394 * elfnn-aarch64.c (elfNN_aarch64_reloc_type_class): Return
395 reloc_class_ifunc for ifunc symbols.
396
397 2017-07-19 Nick Clifton <nickc@redhat.com>
398
399 PR 21787
400 * archive.c (bfd_generic_archive_p): If the bfd does not have the
401 correct magic bytes at the start, set the error to wrong format
402 and clear the format selector before returning NULL.
403
404 2017-07-19 Nick Clifton <nickc@redhat.com>
405
406 PR 21786
407 * coff-rs6000.c (_bfd_strntol): New function.
408 (_bfd_strntoll): New function.
409 (GET_VALUE_IN_FIELD): New macro.
410 (EQ_VALUE_IN_FIELD): new macro.
411 (_bfd_xcoff_slurp_armap): Use new macros.
412 (_bfd_xcoff_archive_p): Likewise.
413 (_bfd_xcoff_read_ar_hdr): Likewise.
414 (_bfd_xcoff_openr_next_archived_file): Likewise.
415 (_bfd_xcoff_stat_arch_elt): Likewise.
416 * coff64-rs6000.c (_bfd_strntol): New function.
417 (_bfd_strntoll): New function.
418 (GET_VALUE_IN_FIELD): New macro.
419 (xcoff64_slurp_armap): Use new macros.
420
421 2017-07-19 Claudiu Zissulescu <claziss@synopsys.com>
422 John Eric Martin <John.Martin@emmicro-us.com>
423
424 * bfd-in2.h: Regenerate.
425 * libbfd.h: Regenerate.
426 * elf32-arc.c (JLI): Define.
427 * reloc.c: Add JLI relocations.
428
429 2017-07-18 Nick Clifton <nickc@redhat.com>
430
431 PR 21775
432 * coff-sh.c: Fix spelling typos.
433 * compress.c: Likewise.
434 * cpu-pdp11.c: Likewise.
435 * ecofflink.c: Likewise.
436 * elf-m10300.c: Likewise.
437 * elf.c: Likewise.
438 * elf32-arm.c: Likewise.
439 * elf32-m68k.c: Likewise.
440 * elf32-nds32.c: Likewise.
441 * elf32-ppc.c: Likewise.
442 * elf32-sh.c: Likewise.
443 * elf32-v850.c: Likewise.
444 * elf64-ppc.c: Likewise.
445 * elf64-x86-64.c: Likewise.
446 * elflink.c: Likewise.
447 * elfnn-aarch64.c: Likewise.
448 * elfxx-mips.c: Likewise.
449 * som.c: Likewise.
450 * sunos.c: Likewise.
451 * vms-alpha.c: Likewise.
452 * xcofflink.c: Likewise.
453
454 2017-07-18 Nick Clifton <nickc@redhat.com>
455
456 PR binutils/21781
457 * coffcode.h (handle_COMDAT): Replace abort with an error message
458 and return.
459
460 2017-07-17 H.J. Lu <hongjiu.lu@intel.com>
461
462 PR ld/21782
463 * elf64-x86-64.c (elf_x86_64_relocate_section): Limit PIC check
464 to shared library.
465
466 2017-07-17 H.J. Lu <hongjiu.lu@intel.com>
467
468 * elf64-x86-64.c (elf_x86_64_relocate_section): Re-indent.
469
470 2017-07-16 Alan Modra <amodra@gmail.com>
471
472 * elf64-ppc.c (ppc64_elf_relocate_section): Don't optimize
473 __tls_index GOT entries when using __tls_get_addr_opt stub.
474 * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
475
476 2017-07-12 Alan Modra <amodra@gmail.com>
477
478 * po/es.po: Update from translationproject.org/latest/bfd/.
479 * po/fi.po: Likewise.
480 * po/fr.po: Likewise.
481 * po/id.po: Likewise.
482 * po/ja.po: Likewise.
483 * po/ro.po: Likewise.
484 * po/ru.po: Likewise.
485 * po/sr.po: Likewise.
486 * po/sv.po: Likewise.
487 * po/tr.po: Likewise.
488 * po/uk.po: Likewise.
489 * po/vi.po: Likewise.
490 * po/zh_CN.po: Likewise.
491 * po/hr.po: New file from translationproject.org.
492 * configure.ac (ALL_LINGUAS): Add hr. Sort.
493 * configure: Regenerate.
494
495 2017-07-12 Nick Clifton <nickc@redhat.com>
496
497 Fix compile time warnings using gcc 7.1.1.
498 * elf32-xtensa.c (elf_xtensa_get_plt_section): Increase length of
499 plt_name buffer.
500 (elf_xtensa_get_gotplt_section): Increase length of got_name
501 buffer.
502 * mach-o-arm.c (bfd_mach_o_arm_canonicalize_one_reloc): Add a
503 default return of FALSE.
504 * mach-o-i386.c (bfd_mach_o_i386_canonicalize_one_reloc): Add a
505 default return of FALSE.
506
507 2017-07-12 Alan Modra <amodra@gmail.com>
508
509 * binary.c (binary_set_section_contents): Don't print filepos in
510 error message.
511 (coff_write_object_contents): Cast size_t for error message.
512 (coff_slurp_line_table): Don't use bfd_vma symndx.
513 (coff_slurp_reloc_table): Remove unneeded cast.
514 * dwarf2.c (read_section): Cast bfd_int64_t to long long for
515 error message.
516 (find_abstract_instance_name): Likewise.
517 * elf32-arm.c (arm_type_of_stub): Correct error arg order.
518 (bfd_elf32_arm_stm32l4xx_erratum_scan): Don't cast error arg.
519 (elf32_arm_check_relocs): Make r_symndx an int.
520 * elf32-cris.c (cris_elf_check_relocs): Delete extraneous %s in
521 format string.
522 * elf32-metag.c (elf_metag_relocate_section): Delete extra error
523 message arg.
524 * elf32-nds32.c (nds32_elf_ex9_build_hash_table): Rewrite bogus
525 error message.
526 * elf32-i386.c (elf_i386_check_relocs): Make r_symndx an int.
527 * elf32-s390.c (elf_s390_check_relocs): Likewise.
528 * elf32-tic6x.c (elf32_tic6x_check_relocs): Likewise.
529 * elf32-tilepro.c (tilepro_elf_check_relocs): Likewise.
530 * elf32-xtensa.c (elf_xtensa_check_relocs): Likewise.
531 * elf64-s390.c (elf_s390_check_relocs): Likewise.
532 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
533 * elfnn-aarch64.c (elfNN_aarch64_check_relocs): Likewise.
534 * elfnn-riscv.c (riscv_elf_check_relocs): Likewise.
535 * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Likewise.
536 * elfxx-tilegx.c (tilegx_elf_check_relocs): Likewise.
537 * elf64-mmix.c (_bfd_mmix_after_linker_allocation): Cast size_t args
538 and use %lu for error message.
539 * elflink.c (elf_link_adjust_relocs): Delete extra error message arg.
540 * mmo.c (mmo_scan): Make stab_loc a file_ptr. Cast expression for
541 error message.
542
543 * elf32-arm.c (elf32_arm_tls_relax): Correct format string and args
544 in error message.
545 (elf32_arm_final_link_relocate): Likewise.
546 * coff-arm.c (bfd_arm_process_before_allocation): Likewise.
547 * coffcode.h (styp_to_sec_flags): Likewise.
548 * cofflink.c (_bfd_coff_write_global_sym): Likewise.
549 * ecoff.c (_bfd_ecoff_slurp_symbol_table): Likewise.
550 * elf32-arc.c (arc_elf_merge_private_bfd_data): Likewise.
551 * elf32-bfin.c (bfinfdpic_check_relocs): Likewise.
552 (elf32_bfin_merge_private_bfd_data): Likewise.
553 * elf32-cris.c (cris_elf_relocate_section): Likewise.
554 * elf32-frv.c (frv_elf_merge_private_bfd_data): Likewise.
555 * elf32-i370.c (i370_elf_merge_private_bfd_data): Likewise.
556 (i370_elf_relocate_section): Likewise.
557 * elf32-iq2000.c (iq2000_elf_merge_private_bfd_data): Likewise.
558 * elf32-m32c.c (m32c_elf_merge_private_bfd_data): Likewise.
559 * elf32-m68hc1x.c (_bfd_m68hc11_elf_merge_private_bfd_data): Likewise.
560 * elf32-mcore.c (mcore_elf_relocate_section): Likewise.
561 * elf32-mep.c (mep_elf_merge_private_bfd_data): Likewise.
562 * elf32-mt.c (mt_elf_merge_private_bfd_data): Likewise.
563 * elf64-sparc.c (elf64_sparc_merge_private_bfd_data): Likewise.
564 * elfxx-mips.c (mips_elf_merge_obj_e_flags): Likewise.
565 (_bfd_mips_elf_merge_private_bfd_data): Likewise.
566 * ieee.c (ieee_write_id, read_id): Likewise.
567 * mach-o.c (bfd_mach_o_write_contents): Likewise.
568 (bfd_mach_o_layout_commands, bfd_mach_o_read_section_32): Likewise.
569 (bfd_mach_o_read_section_64, bfd_mach_o_read_symtab_symbol): Likewise.
570 (bfd_mach_o_read_command, bfd_mach_o_header_p): Likewise.
571 * peXXigen.c (_bfd_XXi_swap_aouthdr_in): Likewise.
572 * stabs.c (_bfd_link_section_stabs): Likewise.
573
574 * coff-arm.c (coff_arm_relocate_section): Use L modifier in error
575 format.
576 * coff-mcore.c (coff_mcore_relocate_section): Likewise.
577 * coff-ppc.c (coff_ppc_relocate_section): Likewise.
578 * coff-rs6000.c (xcoff_reloc_type_toc): Likewise.
579 * coff-sh.c (sh_relax_section): Likewise.
580 (sh_relax_delete_bytes, sh_swap_insns): Likewise.
581 * coff-tic80.c (coff_tic80_relocate_section): Likewise.
582 * coffcode.h (coff_slurp_reloc_table): Likewise.
583 * coffgen.c (_bfd_coff_get_external_symbols): Likewise.
584 (_bfd_coff_read_string_table): Likewise.
585 * cofflink.c (_bfd_coff_generic_relocate_section): Likewise.
586 * compress.c (bfd_get_full_section_contents): Likewise.
587 * dwarf2.c (read_formatted_entries, decode_line_info): Likewise.
588 * elf-m10300.c (mn10300_elf_relocate_section): Likewise.
589 * elf.c (bfd_elf_string_from_elf_section): Likewise.
590 * elf32-arc.c (arc_special_overflow_checks): Likewise.
591 * elf32-arm.c (elf32_arm_tls_relax): Likewise.
592 (elf32_arm_final_link_relocate, elf32_arm_relocate_section): Likewise.
593 (elf32_arm_write_section): Likewise.
594 * elf32-bfin.c (bfin_relocate_section): Likewise.
595 (bfinfdpic_relocate_section): Likewise.
596 * elf32-hppa.c (hppa_build_one_stub): Likewise.
597 (final_link_relocate, elf32_hppa_relocate_section): Likewise.
598 * elf32-i386.c (elf_i386_tls_transition): Likewise.
599 (elf_i386_relocate_section): Likewise.
600 * elf32-ip2k.c (ip2k_final_link_relocate): Likewise.
601 * elf32-lm32.c (lm32_elf_finish_dynamic_sections): Likewise.
602 * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
603 * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
604 * elf32-metag.c (elf_metag_relocate_section): Likewise.
605 * elf32-nds32.c (unrecognized_reloc_msg): Likewise.
606 (nds32_elf_relax_longcall1, nds32_elf_relax_longcall2): Likewise.
607 (nds32_elf_relax_longcall3, nds32_elf_relax_longjump1): Likewise.
608 (nds32_elf_relax_longjump2, nds32_elf_relax_longjump3): Likewise.
609 (nds32_elf_relax_longcall4, nds32_elf_relax_longcall5): Likewise.
610 (nds32_elf_relax_longcall6, nds32_elf_relax_longjump4): Likewise.
611 (nds32_elf_relax_longjump5, nds32_elf_relax_longjump6): Likewise.
612 (nds32_elf_relax_longjump7, nds32_elf_relax_loadstore): Likewise.
613 (nds32_elf_relax_ptr, nds32_elf_ex9_build_hash_table): Likewise.
614 * elf32-nios2.c (nios2_elf32_relocate_section): Likewise.
615 * elf32-rx.c (UNSAFE_FOR_PID): Likewise.
616 * elf32-s390.c (invalid_tls_insn, elf_s390_relocate_section): Likewise.
617 * elf32-score.c (s3_bfd_score_elf_check_relocs): Likewise.
618 * elf32-score7.c (s7_bfd_score_elf_check_relocs): Likewise.
619 * elf32-sh.c (sh_elf_relax_section): Likewise.
620 (sh_elf_relax_delete_bytes, sh_elf_swap_insns): Likewise.
621 (sh_elf_relocate_section): Likewise.
622 * elf32-sh64.c (shmedia_prepare_reloc): Likewise.
623 * elf32-spu.c (spu_elf_relocate_section): Likewise.
624 * elf32-tic6x.c (elf32_tic6x_relocate_section): Likewise.
625 * elf32-tilepro.c (tilepro_elf_relocate_section): Likewise.
626 * elf32-v850.c (v850_elf_relax_section): Likewise.
627 * elf32-vax.c (elf_vax_check_relocs): Likewise.
628 (elf_vax_relocate_section): Likewise.
629 * elf32-xtensa.c (elf_xtensa_relocate_section): Likewise.
630 (extend_ebb_bounds_forward, extend_ebb_bounds_backward): Likewise.
631 (compute_text_actions, compute_ebb_proposed_actions): Likewise.
632 (do_fix_for_relocatable_link): Likewise.
633 * elf64-alpha.c (elf64_alpha_relax_got_load): Likewise.
634 (elf64_alpha_relax_with_lituse): Likewise.
635 * elf64-hppa.c (elf64_hppa_finish_dynamic_symbol): Likewise.
636 (elf_hppa_final_link_relocate): Likewise.
637 * elf64-ia64-vms.c (elf64_ia64_relax_section): Likewise.
638 (elf64_ia64_choose_gp, elf64_ia64_relocate_section): Likewise.
639 (elf64_vms_link_add_object_symbols): Likewise.
640 * elf64-mmix.c (mmix_elf_perform_relocation): Likewise.
641 (mmix_final_link_relocate): Likewise.
642 * elf64-s390.c (invalid_tls_insn): Likewise.
643 (elf_s390_relocate_section): Likewise.
644 * elf64-sh64.c (sh_elf64_relocate_section): Likewise.
645 * elf64-x86-64.c (elf_x86_64_tls_transition): Likewise.
646 (elf_x86_64_relocate_section): Likewise.
647 * elfcode.h (elf_slurp_symbol_table): Likewise.
648 * elfcore.h (elf_core_file_p): Likewise.
649 * elflink.c (elf_link_read_relocs_from_section): Likewise.
650 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Likewise.
651 (elfNN_aarch64_relocate_section): Likewise.
652 * elfnn-ia64.c (elfNN_ia64_relax_section): Likewise.
653 (elfNN_ia64_choose_gp, elfNN_ia64_relocate_section): Likewise.
654 * elfnn-riscv.c (riscv_elf_relocate_section): Likewise.
655 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
656 (_bfd_mips_elf_relocate_section): Likewise.
657 (_bfd_mips_elf_finish_dynamic_symbol, mips_finish_exec_plt): Likewise.
658 * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Likewise.
659 * elfxx-tilegx.c (tilegx_elf_relocate_section): Likewise.
660 * ieee.c (ieee_slurp_external_symbols): Likewise.
661 * ihex.c (ihex_write_object_content): Likewise.
662 * mach-o.c (bfd_mach_o_build_exec_seg_command): Likewise.
663 * merge.c (_bfd_merged_section_offset): Likewise.
664 * mmo.c (mmo_write_loc_chunk): Likewise.
665 (mmo_write_object_contents): Likewise.
666 * peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Likewise.
667 * stabs.c (_bfd_link_section_stabs): Likewise.
668 * xcofflink.c (xcoff_link_add_symbols, xcoff_find_tc0): Likewise.
669
670 2017-07-11 Alan Modra <amodra@gmail.com>
671
672 * elf32-ppc.c (ppc_elf_relocate_section): Fix typo.
673
674 2017-07-11 Alan Modra <amodra@gmail.com>
675
676 * elf32-ppc.c (ppc_elf_relocate_section): Emit "unexpected
677 instruction" error using _bfd_error_handler, not einfo.
678
679 2017-07-10 Nick Clifton <nickc@redhat.com>
680
681 * coffcode.h (coff_slurp_symbol_table): Do not include an entry
682 for C_AIX_WEAKEXT if it has the same value as C_WEAKEXT.
683
684 2017-07-07 John Baldwin <jhb@FreeBSD.org>
685
686 * elf.c (elfcore_grok_freebsd_note): Handle NT_FREEBSD_PTLWPINFO.
687
688 2017-07-07 Alan Modra <amodra@gmail.com>
689
690 * coffcode.h (coff_slurp_symbol_table): Handle C_AIX_WEAKEXT.
691
692 2017-07-07 Alan Modra <amodra@gmail.com>
693
694 * bfd.c (_doprnt): Replace "L" with "ll" when printing bfd_vma
695 as long long. Move code replacing "ll" with "I64", and simplify.
696
697 2017-07-06 H.J. Lu <hongjiu.lu@intel.com>
698
699 * bfd.c (_doprnt): Convert 'L' to 'l' when setting wide_width
700 to 1.
701
702 2017-07-05 H.J. Lu <hongjiu.lu@intel.com>
703
704 * dwarf2.c (line_info_add_include_dir_stub): Replace time with
705 xtime.
706 (line_info_add_file_name): Likewise.
707 (decode_line_info): Likewise.
708
709 2017-07-04 Tristan Gingold <gingold@adacore.com>
710
711 * version.m4: Bump version to 2.29.51
712 * configure: Regenerate.
713
714 2017-07-04 Jiong Wang <jiong.wang@arm.com>
715
716 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Remove the
717 sanity check at the head of this function.
718
719 2017-07-04 Jan Kratochvil <jan.kratochvil@redhat.com>
720
721 * dwarf2.c (struct dwarf2_debug): Add fields dwarf_line_str_buffer and
722 dwarf_line_str_size.
723 (struct attr_abbrev): Add field implicit_const.
724 (dwarf_debug_sections): Add .debug_line_str.
725 (enum dwarf_debug_section_enum): Add debug_line_str and debug_max.
726 (dwarf_debug_section_assert): Add static assertion.
727 (read_indirect_line_string): New.
728 (read_abbrevs): Support DW_FORM_implicit_const.
729 (is_str_attr): Support DW_FORM_line_strp.
730 (read_attribute_value): Support DW_FORM_line_strp and
731 DW_FORM_implicit_const.
732 (read_attribute): Support DW_FORM_implicit_const.
733 (line_info_add_include_dir, line_info_add_include_dir_stub):
734 (line_info_add_file_name, read_formatted_entries): New.
735 (decode_line_info, parse_comp_unit): Support DWARF 5.
736 (_bfd_dwarf2_cleanup_debug_info): Free dwarf_line_str_buffer.
737
738 2017-07-03 Egeyar Bagcioglu <egeyar.bagcioglu@oracle.com>
739
740 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Remove the
741 abort statement that was put for symbols that are not dynamic.
742
743 2017-07-03 Tristan Gingold <gingold@adacore.com>
744
745 * po/bfd.pot: Regenerate
746
747 2017-07-03 Alan Modra <amodra@gmail.com>
748
749 * bfd.c (_doprnt): Rewrite "ll" and "L" modifiers to "I64" for
750 __MSVCRT__. Support "L" modifier for bfd_vma. Formatting.
751 * elf.c (setup_group): Use "Lx" to print sh_size.
752 (_bfd_elf_setup_sections): Remove unnecessary cast and print
753 unknown section type in hex.
754 (copy_special_section_fields): Style fix.
755 (bfd_section_from_shdr): Correct format for sh_link. Use a
756 common error message for all the variants of unrecognized
757 section types.
758 (assign_file_positions_for_load_sections): Use "Lx" for lma
759 adjust error message.
760 (assign_file_positions_for_non_load_sections): Formatting.
761 (rewrite_elf_program_header): Formatting. Use "Lx" for
762 bfd_vma values in error messages.
763 * elfcode.h (elf_slurp_reloc_table_from_section): Cast
764 ELF_R_SYM value to type expected by format.
765 * elflink.c (elf_link_read_relocs_from_section): Use "Lx"
766 in error messages.
767 (elf_link_add_object_symbols): Use "Lu" for symbol sizes.
768 (elf_link_input_bfd): Use "Lx" for r_info.
769 (bfd_elf_gc_record_vtinherit): Use "Lx" for offset.
770
771 2017-07-03 Alan Modra <amodra@gmail.com>
772
773 * bfd.c (bfd_scan_vma): Don't use long long unless HAVE_LONG_LONG.
774 * coff-rs6000.c (FMT20): Handle hosts with 64-bit long and
775 Microsoft C library variant of long long format specifier.
776 (PRINT20): Cast value to bfd_uint64_t not long long.
777 * coffcode.h (coff_print_aux): Use BFD_VMA_FMT.
778 * coff-x86_64.c (coff_amd64_reloc): Use bfd_uint64_t rather than
779 long long. Don't cast to bfd_vma.
780 * elf32-score.c (score3_bfd_getl48): Likewise.
781 * vms-alpha.c (_bfd_vms_slurp_eisd): Likewise.
782
783 2017-07-03 Alan Modra <amodra@gmail.com>
784
785 * elf.c (_bfd_elf_print_private_bfd_data): Use BFD_VMA_FMT to
786 print d_tag.
787 (bfd_elf_print_symbol): Don't cast symbol->flags.
788 (_bfd_elf_symbol_from_bfd_symbol): Likewise.
789 * elf32-ppc.c (ppc_elf_begin_write_processing): Correct
790 _bfd_error_handler argument order.
791 (ppc_elf_merge_private_bfd_data): Don't cast flags.
792
793 2017-07-03 Alan Modra <amodra@gmail.com>
794
795 * configure.ac: Invoke AC_CHECK_TYPES for long long. Invoke
796 AC_TYPE_LONG_DOUBLE.
797 * configure: Regenerate.
798 * config.in: Regenerate.
799
800 2017-06-29 Andrew Waterman <andrew@sifive.com>
801
802 * elfnn-riscv.c (riscv_elf_adjust_dynamic_symbol): Fix TLS copy
803 relocs.
804
805 2017-06-29 Egeyar Bagcioglu <egeyar.bagcioglu@oracle.com>
806
807 * elfxx-sparc.c (allocate_dynrelocs): Don't make a symbol dynamic
808 unless it is undefined weak.
809 * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Set the flag
810 relative_reloc to direct non-dynamic symbols to R_SPARC_RELATIVE
811 relocation.
812 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): If symbol
813 is not dynamic in PIC, abort.
814
815 2017-06-29 Jiong Wang <jiong.wang@arm.com>
816
817 PR ld/21402
818 * elfnn-aarch64.c (elfNN_aarch64_allocate_dynrelocs): Only make
819 undefined weak symbols into dynamic.
820 (elfNN_aarch64_final_link_relocate): Generate runtime RELATIVE
821 relocation for non-dynamic symbols.
822 (elfNN_aarch64_finish_dynamic_symbol): Add sanity check.
823
824 2017-06-29 Jiong Wang <jiong.wang@arm.com>
825
826 * elfnn-aarch64.c (aarch64_relocation_aginst_gp_p): New function.
827 (elfNN_aarch64_final_link_relocate): Delete duplicated code for
828 BFD_RELOC_AARCH64_LD64_GOTOFF_LO15, BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC,
829 BFD_RELOC_AARCH64_MOVW_GOTOFF_G1.
830 * elfxx-aarch64.c (_bfd_aarch64_elf_resolve_relocation): Optimize the
831 support for them.
832
833 2017-06-29 Andreas Arnez <arnez@linux.vnet.ibm.com>
834
835 * elf-bfd.h (elfcore_write_s390_gs_cb): Add prototype.
836 (elfcore_write_s390_gs_bc): Likewise.
837 * elf.c (elfcore_grok_s390_gs_cb): New function.
838 (elfcore_grok_s390_gs_bc): New function.
839 (elfcore_grok_note): Call them.
840 (elfcore_write_s390_gs_cb): New function.
841 (elfcore_write_s390_gs_bc): New function.
842 (elfcore_write_register_note): Call them.
843
844 2017-06-28 H.J. Lu <hongjiu.lu@intel.com>
845
846 * libbfd.c (_bfd_generic_get_section_contents): Don't call
847 bfd_get_file_size. Check archive element size.
848 (_bfd_generic_get_section_contents_in_window): Likewise.
849
850 2017-06-28 H.J. Lu <hongjiu.lu@intel.com>
851
852 * bfd-in2.h: Regenerated.
853 * bfdio.c (bfd_get_size): Change return type to ufile_ptr.
854 (bfd_get_file_size): Likewise.
855
856 2017-06-28 Maciej W. Rozycki <macro@imgtec.com>
857 Matthew Fortune <matthew.fortune@imgtec.com>
858
859 * archures.c (bfd_mach_mips_interaptiv_mr2): New macro.
860 * cpu-mips.c (I_interaptiv_mr2): New enum value.
861 (arch_info_struct): Add "mips:interaptiv-mr2" entry.
862 * elfxx-mips.c (_bfd_elf_mips_mach) <E_MIPS_MACH_IAMR2>: New
863 case.
864 (mips_set_isa_flags) <bfd_mach_mips_interaptiv_mr2>: Likewise.
865 (bfd_mips_isa_ext) <bfd_mach_mips_interaptiv_mr2>: Likewise.
866 (print_mips_isa_ext) <AFL_EXT_INTERAPTIV_MR2>: Likewise.
867 (mips_mach_extensions): Add `bfd_mach_mipsisa32r3' and
868 `bfd_mach_mips_interaptiv_mr2' entries.
869 * bfd-in2.h: Regenerate.
870
871 2017-06-27 Nick Clifton <nickc@redhat.com>
872
873 * tekhex.c (pass_over): Revert accidental conversion of a local
874 array to a static array.
875
876 2017-06-27 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
877
878 PR ld/13402
879 * elf32-avr.c (elf32_avr_adjust_diff_reloc_value): Adjust
880 reloc addend if necessary. Adjust diff only if
881 shrinked_insn_address < end_address.
882
883 2017-06-27 Alan Modra <amodra@gmail.com>
884
885 PR binutils/21665
886 * libbfd.c (_bfd_generic_get_section_contents): Warning fix.
887 (_bfd_generic_get_section_contents_in_window): Likewise.
888
889 2017-06-26 Kuan-Lin Chen <rufus@andestech.com>
890
891 * elfnn-riscv.c (perform_relocation): Support the new
892 R_RISCV_32_PCREL relocation.
893 (riscv_elf_relocate_section): Likewise.
894 * elfxx-riscv.c (howto_table): Likewise.
895 (riscv_reloc_map): Likewise.
896 * bfd-in2.h (BFD_RELOC_RISCV_32_PCREL): New relocation.
897 * libbfd.h: Regenerate.
898
899 2017-06-27 Alan Modra <amodra@gmail.com>
900
901 PR binutils/21665
902 * libbfd.c (_bfd_generic_get_section_contents): Delete abort.
903 Use unsigned file pointer type, and remove cast.
904 * libbfd.c (_bfd_generic_get_section_contents_in_window): Likewise.
905 Add "count", not "sz".
906
907 2017-06-26 Pedro Alves <palves@redhat.com>
908
909 PR binutils/21665
910 * libbfd.c (_bfd_generic_get_section_contents): Add "count", not
911 "sz".
912
913 2017-06-26 H.J. Lu <hongjiu.lu@intel.com>
914
915 PR binutils/21665
916 * libbfd.c (_bfd_generic_get_section_contents_in_window): Add
917 a missing line.
918
919 2017-06-26 Maciej W. Rozycki <macro@imgtec.com>
920
921 * cpu-mips.c (arch_info_struct): Mark the 4010 32-bit.
922 * elfxx-mips.c (mips_set_isa_flags) <bfd_mach_mips4010>: Set
923 E_MIPS_ARCH_2 rather than E_MIPS_ARCH_3 in `e_flags'.
924 (mips_mach_extensions): Mark `bfd_mach_mips4010' as extending
925 `bfd_mach_mips6000' rather than `bfd_mach_mips4000'.
926
927 2017-06-26 H.J. Lu <hongjiu.lu@intel.com>
928
929 PR binutils/21665
930 * compress.c (bfd_get_full_section_contents): Don't check the
931 file size here.
932 * libbfd.c (_bfd_generic_get_section_contents): Check for and
933 reject a section whose size + offset is greater than the size
934 of the entire file.
935 (_bfd_generic_get_section_contents_in_window): Likewise.
936
937 2017-06-26 Nick Clifton <nickc@redhat.com>
938
939 PR binutils/21670
940 * tekhex.c (getvalue): Check for the source pointer exceeding the
941 end pointer before the first byte is read.
942
943 2017-06-26 Nick Clifton <nickc@redhat.com>
944
945 PR binutils/21665
946 * opncls.c (get_build_id): Check that the section is big enough
947 to contain the whole note.
948 * compress.c (bfd_get_full_section_contents): Check for and reject
949 a section whose size is greater than the size of the entire file.
950 * elf32-v850.c (v850_elf_copy_notes): Allow for the ouput to not
951 contain a notes section.
952
953 2017-06-26 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
954
955 * elf64-s390.c (elf_s390_additional_program_headers): Add NULL
956 pointer checks.
957 (elf_s390_modify_segment_map): Likewise.
958 (bfd_elf_s390_set_options): Lisewise.
959
960 2017-06-26 Alan Modra <amodra@gmail.com>
961
962 * elflink.c (_bfd_elf_link_create_dynstrtab): Don't make dynobj
963 a --just-syms bfd.
964 (_bfd_elf_size_group_sections): Skip --just-syms bfds.
965 (bfd_elf_size_dynamic_sections): Ignore .note.GNU-stack and
966 .preinit_array on --just-syms bfds.
967 (_bfd_elf_gc_mark_extra_sections): Skip --just-syms bfds.
968 (elf_gc_sweep, bfd_elf_parse_eh_frame_entries): Likewise.
969 (bfd_elf_gc_sections, bfd_elf_discard_info): Likewise.
970
971 2017-06-25 Sergei Trofimovich <slyfox@gentoo.org>
972
973 * elf.c (find_link): Bounds check "hint".
974
975 2017-06-24 Thomas Preud'homme <thomas.preudhomme@arm.com>
976
977 * elf32-arm.c (using_thumb_only): Update list of architectures in
978 BFD_ASSERT for which the logic is valid.
979 (using_thumb2_bl): Likewise.
980 (using_thumb2): Likewise and return true for ARMv8-R.
981 (arch_has_arm_nop): Likewise.
982 (tag_cpu_arch_combine): New v8r table for ARMv8-R Tag_CPU_arch
983 merging logic. Update commentis for value 15 of v8m_baseline,
984 v8m_mainline and v4t_plus_v6_m arrays. Use v8r array to decide
985 merging of value 15 of Tag_CPU_arch.
986
987 2017-06-23 Jiong Wang <jiong.wang@arm.com>
988
989 * reloc.c (BFD_RELOC_AARCH64_ADR_GOTPAGE): Rename to
990 BFD_RELOC_AARCH64_ADR_GOT_PAGE
991 * bfd-in2.h: Regenerate.
992
993 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
994
995 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Move
996 the error_alignment label forward. Properly align program
997 property note section.
998
999 2017-06-22 Eric Christopher <echristo@gmail.com>
1000
1001 * elf32-arm.c (elf32_arm_final_link_relocate): Use labs rather than
1002 abs to fix a truncation warning.
1003
1004 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
1005
1006 * elf32-i386.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Resolve
1007 local undefined weak symbol to 0.
1008 * elf64-x86-64.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Likewise.
1009
1010 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
1011
1012 * elf32-i386.c (elf_i386_merge_gnu_properties): If info->shstk
1013 is set, turn on GNU_PROPERTY_X86_FEATURE_1_SHSTK.
1014 (elf_i386_link_setup_gnu_properties): If info->shstk is set,
1015 turn on GNU_PROPERTY_X86_FEATURE_1_IBT.
1016 * elf64-x86-64.c (elf_x86_64_merge_gnu_properties): If
1017 info->shstk is set, turn on GNU_PROPERTY_X86_FEATURE_1_SHSTK.
1018 (elf_x86_64_link_setup_gnu_properties): If info->shstk is set,
1019 turn on GNU_PROPERTY_X86_FEATURE_1_IBT.
1020
1021 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
1022
1023 * elf32-i386.c (elf_i386_lazy_ibt_plt0_entry): New.
1024 (elf_i386_lazy_ibt_plt_entry): Likewise.
1025 (elf_i386_pic_lazy_ibt_plt0_entry): Likewise.
1026 (elf_i386_non_lazy_ibt_plt_entry): Likewise.
1027 (elf_i386_pic_non_lazy_ibt_plt_entry): Likewise.
1028 (elf_i386_eh_frame_lazy_ibt_plt): Likewise.
1029 (elf_i386_lazy_plt_layout): Likewise.
1030 (elf_i386_non_lazy_plt_layout): Likewise.
1031 (elf_i386_link_hash_entry): Add plt_second.
1032 (elf_i386_link_hash_table): Add plt_second and
1033 plt_second_eh_frame.
1034 (elf_i386_allocate_dynrelocs): Use the second PLT if needed.
1035 (elf_i386_size_dynamic_sections): Use .plt.got unwind info for
1036 the second PLT. Check the second PLT.
1037 (elf_i386_relocate_section): Use the second PLT to resolve
1038 PLT reference if needed.
1039 (elf_i386_finish_dynamic_symbol): Fill and use the second PLT if
1040 needed.
1041 (elf_i386_finish_dynamic_sections): Set sh_entsize on the
1042 second PLT. Generate unwind info for the second PLT.
1043 (elf_i386_plt_type): Add plt_second.
1044 (elf_i386_get_synthetic_symtab): Support the second PLT.
1045 (elf_i386_parse_gnu_properties): Support
1046 GNU_PROPERTY_X86_FEATURE_1_AND.
1047 (elf_i386_merge_gnu_properties): Support
1048 GNU_PROPERTY_X86_FEATURE_1_AND. If info->ibt is set, turn
1049 on GNU_PROPERTY_X86_FEATURE_1_IBT
1050 (elf_i386_link_setup_gnu_properties): If info->ibt is set,
1051 turn on GNU_PROPERTY_X86_FEATURE_1_IBT. Use IBT-enabled PLT
1052 for info->ibtplt, info->ibt or GNU_PROPERTY_X86_FEATURE_1_IBT
1053 is set on all relocatable inputs.
1054 * elf64-x86-64.c (elf_x86_64_lazy_ibt_plt_entry): New.
1055 (elf_x32_lazy_ibt_plt_entry): Likewise.
1056 (elf_x86_64_non_lazy_ibt_plt_entry): Likewise.
1057 (elf_x32_non_lazy_ibt_plt_entry): Likewise.
1058 (elf_x86_64_eh_frame_lazy_ibt_plt): Likewise.
1059 (elf_x32_eh_frame_lazy_ibt_plt): Likewise.
1060 (elf_x86_64_lazy_ibt_plt): Likewise.
1061 (elf_x32_lazy_ibt_plt): Likewise.
1062 (elf_x86_64_non_lazy_ibt_plt): Likewise.
1063 (elf_x32_non_lazy_ibt_plt): Likewise.
1064 (elf_x86_64_get_synthetic_symtab): Support the second PLT.
1065 (elf_x86_64_parse_gnu_properties): Support
1066 GNU_PROPERTY_X86_FEATURE_1_AND.
1067 (elf_x86_64_merge_gnu_properties): Support
1068 GNU_PROPERTY_X86_FEATURE_1_AND. If info->ibt is set, turn
1069 on GNU_PROPERTY_X86_FEATURE_1_IBT
1070 (elf_x86_64_link_setup_gnu_properties): If info->ibt is set,
1071 turn on GNU_PROPERTY_X86_FEATURE_1_IBT. Use IBT-enabled PLT
1072 for info->ibtplt, info->ibt or GNU_PROPERTY_X86_FEATURE_1_IBT
1073 is set on all relocatable inputs.
1074
1075 2017-06-22 Nick Clifton <nickc@redhat.com>
1076
1077 PR binutils/21649
1078 * som.c (setup_sections): NUL terminate the space_strings buffer.
1079 Check that the space.name field does not index beyond the end of
1080 the space_strings buffer.
1081
1082 2017-06-21 Nick Clifton <nickc@redhat.com>
1083
1084 PR binutils/21646
1085 * coff-sh.c (sh_reloc): Check for an out of range reloc.
1086
1087 2017-06-21 Nick Clifton <nickc@redhat.com>
1088
1089 PR binutils/21639
1090 * vms-misc.c (_bfd_vms_save_sized_string): Use unsigned int as
1091 type of the size parameter.
1092 (_bfd_vms_save_counted_string): Add second parameter - the maximum
1093 length of the counted string.
1094 * vms.h (_bfd_vms_save_sized_string): Update prototype.
1095 (_bfd_vms_save_counted_string): Likewise.
1096 * vms-alpha.c (_bfd_vms_slurp_eisd): Update calls to
1097 _bfd_vms_save_counted_string.
1098 (_bfd_vms_slurp_ehdr): Likewise.
1099 (_bfd_vms_slurp_egsd): Likewise.
1100 (Parse_module): Likewise.
1101
1102 2017-06-21 Alan Modra <amodra@gmail.com>
1103
1104 * elf64-ppc.c (ppc64_elf_size_stubs): Test for localentry:0 plt
1105 calls before tocsave calls.
1106 (ppc64_elf_relocate_section): Allow localentry:0 plt calls without
1107 following nop.
1108
1109 2017-06-21 Nick Clifton <nickc@redhat.com>
1110
1111 PR binutils/21645
1112 * reloc.c (bfd_generic_get_relocated_section_contents): Fail if
1113 bfd_get_full_section_contents returns no contents.
1114
1115 2017-06-21 Nick Clifton <nickc@redhat.com>
1116
1117 PR binutils/21638
1118 * vms-alpha.c (_bfd_vms_slurp_egsd): Check for an undersized
1119 record.
1120
1121 2017-06-21 Nick Clifton <nickc@redhat.com>
1122
1123 PR binutils/21637
1124 * vms-alpha.c (_bfd_vms_slurp_egsd): Check for an empty section
1125 list.
1126 (image_set_ptr): Likewise.
1127 (alpha_vms_fix_sec_rel): Likewise.
1128 (alpha_vms_slurp_relocs): Likewise.
1129
1130 2017-06-21 Nick Clifton <nickc@redhat.com>
1131
1132 PR binutils/21633
1133 * ieee.c (ieee_slurp_sections): Check for a NULL return from
1134 read_id.
1135 (ieee_archive_p): Likewise.
1136 (ieee_object_p): Likewise.
1137
1138 2017-06-21 Nick Clifton <nickc@redhat.com>
1139
1140 PR binutils/21640
1141 * elf.c (setup_group): Zero the group section pointer list after
1142 allocation so that loops can be caught. Check for NULL pointers
1143 when processing a group list.
1144
1145 2017-06-20 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
1146
1147 * elf-s390.h: New file.
1148 * elf64-s390.c (struct elf_s390_link_hash_table): Add params
1149 field.
1150 (elf_s390_additional_program_headers): New function.
1151 (elf_s390_modify_segment_map): New function.
1152 (bfd_elf_s390_set_options): New function.
1153 (elf_backend_additional_program_headers)
1154 (elf_backend_modify_segment_map): Add macro definitions.
1155
1156 2017-06-19 H.J. Lu <hongjiu.lu@intel.com>
1157
1158 PR ld/21626
1159 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Check
1160 the DYNAMIC bit instead of bfd_count_sections.
1161
1162 2017-06-19 Nick Clifton <nickc@redhat.com>
1163
1164 PR binutils/21618
1165 * vms-alpha.c (evax_bfd_print_emh): Check for insufficient record
1166 length.
1167 (evax_bfd_print_eeom): Likewise.
1168 (evax_bfd_print_egsd): Check for an overlarge record length.
1169 (evax_bfd_print_etir): Likewise.
1170
1171 2017-06-19 Nick Clifton <nickc@redhat.com>
1172
1173 PR binutils/21612
1174 * libieee.h (struct common_header_type): Add end_p field.
1175 * ieee.c (this_byte_and_next): Do not advance input_p beyond
1176 end_p.
1177 (read_id): Check for a length that exceeds the remaining bytes in
1178 the input buffer.
1179 (ieee_seek): Initialise end_p.
1180 (ieee_archive_p): Likewise.
1181 (ieee_object_p): Likewise.
1182
1183 2017-06-19 Nick Clifton <nickc@redhat.com>
1184
1185 PR binutils/21611
1186 * vms-alpha.c (_bfd_vms_slurp_eihs): Check for invalid offset
1187 before reading the EIHS structure entries.
1188
1189 2017-06-19 Nick Clifton <nickc@redhat.com>
1190
1191 PR binutils/21615
1192 * vms-alpha.c (_bfd_vms_slurp_egsd): Use unsigned int for
1193 gsd_size. Check that there are enough bytes remaining to read the
1194 type and size of the next egsd. Check that the size of the egsd
1195 does not exceed the size of the record.
1196
1197 2017-06-19 Alan Modra <amodra@gmail.com>
1198
1199 * config.bfd: Correct targ_underscore for cris.
1200
1201 2017-06-18 Alan Modra <amodra@gmail.com>
1202
1203 * config.bfd: Correct targ_underscore for epiphany, ip2k,
1204 m32c, mn10200, pru, rl78, rx, crisv32 and v850.
1205
1206 2017-06-16 Nick Clifton <nickc@redhat.com>
1207
1208 * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Do not fail if the
1209 bucketlist is empty because there are no symbols to add to the
1210 list.
1211
1212 2017-06-16 Alan Modra <amodra@gmail.com>
1213
1214 PR ld/20022
1215 PR ld/21557
1216 PR ld/21562
1217 PR ld/21571
1218 * targets.c (struct bfd_target): Add _bfd_define_start_stop.
1219 (BFD_JUMP_TABLE_LINK): Likewise.
1220 * elf-bfd.h (bfd_elf_define_start_stop): Declare.
1221 * elflink.c (_bfd_elf_gc_mark_rsec): Update comment.
1222 (bfd_elf_define_start_stop): New function.
1223 * linker.c (bfd_generic_define_start_stop): New function.
1224 * coff64-rs6000.c (rs6000_xcoff64_vec, rs6000_xcoff64_aix_vec): Init
1225 new field.
1226 * aout-adobe.c (aout_32_bfd_define_start_stop): Define.
1227 * aout-target.h (MY_bfd_define_start_stop): Define.
1228 * aout-tic30.c (MY_bfd_define_start_stop): Define.
1229 * binary.c (binary_bfd_define_start_stop): Define.
1230 * bout.c (b_out_bfd_define_start_stop): Define.
1231 * coff-alpha.c (_bfd_ecoff_bfd_define_start_stop): Define.
1232 * coff-mips.c (_bfd_ecoff_bfd_define_start_stop): Define.
1233 * coff-rs6000.c (_bfd_xcoff_bfd_define_start_stop): Define.
1234 * coffcode.h (coff_bfd_define_start_stop): Define.
1235 * elfxx-target.h (bfd_elfNN_bfd_define_start_stop): Define.
1236 * i386msdos.c (msdos_bfd_define_start_stop): Define.
1237 * i386os9k.c (os9k_bfd_define_start_stop): Define.
1238 * ieee.c (ieee_bfd_define_start_stop): Define.
1239 * ihex.c (ihex_bfd_define_start_stop): Define.
1240 * libbfd-in.h (_bfd_nolink_bfd_define_start_stop): Define.
1241 * mach-o-target.c (bfd_mach_o_bfd_define_start_stop): Define.
1242 * mmo.c (mmo_bfd_define_start_stop): Define.
1243 * nlm-target.h (nlm_bfd_define_start_stop): Define.
1244 * oasys.c (oasys_bfd_define_start_stop): Define.
1245 * pef.c (bfd_pef_bfd_define_start_stop): Define.
1246 * plugin.c (bfd_plugin_bfd_define_start_stop): Define.
1247 * ppcboot.c (ppcboot_bfd_define_start_stop): Define.
1248 * som.c (som_bfd_define_start_stop): Define.
1249 * srec.c (srec_bfd_define_start_stop): Define.
1250 * tekhex.c (tekhex_bfd_define_start_stop): Define.
1251 * versados.c (versados_bfd_define_start_stop): Define.
1252 * vms-alpha.c (vms_bfd_define_start_stop): Define.
1253 (alpha_vms_bfd_define_start_stop): Define.
1254 * xsym.c (bfd_sym_bfd_define_start_stop): Define.
1255 * bfd-in2.h: Regenerate.
1256 * libbfd.h: Regenerate.
1257
1258 2017-06-16 Jiong Wang <jiong.wang@arm.com>
1259
1260 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Use
1261 SYMBOL_REFERENCES_LOCAL.
1262
1263 2017-06-15 Jiong Wang <jiong.wang@arm.com>
1264
1265 PR ld/21532
1266 * elfnn-aarch64.c (ELIMINATE_COPY_RELOCS): Set to 1.
1267 (elfNN_aarch64_final_link_relocate): Also propagate relocations to
1268 runtime for if there needs copy relocation elimination.
1269 (need_copy_relocation_p): New function. Return true for symbol with
1270 pc-relative references and if it's against read-only sections.
1271 (elfNN_aarch64_adjust_dynamic_symbol): Use need_copy_relocation_p.
1272 (elfNN_aarch64_check_relocs): Allocate dynrelocs for relocation types
1273 that are related with accessing external objects.
1274 (elfNN_aarch64_gc_sweep_hook): Sync the relocation types with the change
1275 in elfNN_aarch64_check_relocs.
1276
1277 2017-06-15 Nick Clifton <nickc@redhat.com>
1278
1279 PR binutils/21582
1280 * ieee.c (ieee_object_p): Use a static buffer to avoid compiler
1281 bugs.
1282 PR binutils/21581
1283 (ieee_archive_p): Likewise.
1284
1285 2017-06-15 Nick Clifton <nickc@redhat.com>
1286
1287 PR binutils/21579
1288 * vms-alpha.c (_bfd_vms_slurp_etir): Extend check of cmd_length.
1289
1290 2017-06-14 Max Filippov <jcmvbkbc@gmail.com>
1291
1292 * elf32-xtensa.c (elf_xtensa_be_plt_entry,
1293 elf_xtensa_le_plt_entry): Add dimension for the ABI to arrays,
1294 keep both windowed and call0 ABI PLT definitions.
1295 (elf_xtensa_create_plt_entry): Use selected ABI to choose upper
1296 elf_xtensa_*_plt_entry endex.
1297 (ELF_MAXPAGESIZE): Fix at minimal supported MMU page size.
1298
1299 2017-06-14 Nick Clifton <nickc@redhat.com>
1300
1301 PR binutils/21578
1302 * elf32-sh.c (sh_elf_set_mach_from_flags): Fix check for invalid
1303 flag value.
1304
1305 2017-06-14 Nick Clifton <nickc@redhat.com>
1306
1307 PR binutils/21589
1308 * vms-alpha.c (_bfd_vms_get_value): Add an extra parameter - the
1309 maximum value for the ascic pointer. Check that name processing
1310 does not read beyond this value.
1311 (_bfd_vms_slurp_etir): Add checks for attempts to read beyond the
1312 end of etir record.
1313
1314 2017-06-14 Nick Clifton <nickc@redhat.com>
1315
1316 PR binutils/21591
1317 * versados.c (versados_mkobject): Zero the allocated tdata structure.
1318 (process_otr): Check for an invalid offset in the otr structure.
1319
1320 2017-06-14 Sebastian Huber <sebastian.huber@embedded-brains.de>
1321
1322 * config.bfd (epiphany-*-elf): Accept epiphany-*-*.
1323
1324 2017-06-13 H.J. Lu <hongjiu.lu@intel.com>
1325
1326 PR ld/20022
1327 PR ld/21557
1328 PR ld/21562
1329 PR ld/21571
1330 * elf-bfd.h (elf_link_hash_entry): Add start_stop. Change the
1331 vtable field to a union.
1332 (_bfd_elf_is_start_stop): Removed.
1333 * elf32-i386.c (elf_i386_convert_load_reloc): Also check for
1334 __start_SECNAME and __stop_SECNAME symbols.
1335 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Likewise.
1336 * elflink.c (_bfd_elf_is_start_stop): Removed.
1337 (_bfd_elf_gc_mark_rsec): Check start_stop instead of calling
1338 _bfd_elf_is_start_stop.
1339 (elf_gc_propagate_vtable_entries_used): Skip __start_SECNAME and
1340 __stop_SECNAME symbols. Updated.
1341 (elf_gc_smash_unused_vtentry_relocs): Likewise.
1342 (bfd_elf_gc_record_vtinherit): Likewise.
1343 (bfd_elf_gc_record_vtentry): Likewise.
1344
1345 2017-06-13 Nick Clifton <nickc@redhat.com>
1346
1347 PR ld/21524
1348 * elflink.c (elf_link_adjust_relocs): Generate an error when
1349 encountering a reloc against a symbol removed by garbage
1350 collection.
1351
1352 2017-06-12 H.J. Lu <hongjiu.lu@intel.com>
1353
1354 * elf-bfd.h (elf_backend_data): Add struct bfd_link_info *
1355 to merge_gnu_properties.
1356 * elf-properties.c (elf_merge_gnu_properties): Add struct
1357 bfd_link_info * and pass it to merge_gnu_properties.
1358 (elf_merge_gnu_property_list): Add struct bfd_link_info *
1359 and pass it to elf_merge_gnu_properties.
1360 (_bfd_elf_link_setup_gnu_properties): Pass info to
1361 elf_merge_gnu_property_list.
1362 * elf32-i386.c (elf_i386_merge_gnu_properties): Add struct
1363 bfd_link_info *.
1364 * elf64-x86-64.c (elf_x86_64_merge_gnu_properties): Likewise.
1365
1366 2017-06-11 Joe Zbiciak <joe.zbiciak@leftturnonly.info>
1367
1368 PR 21564
1369 * binary.c (binary_set_section_contents): Scale lma by octets
1370 per byte to set filepos.
1371
1372 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
1373
1374 * elf32-arc.c (elf_arc_check_relocs): Fixed conditions to generate
1375 dynamic sections.
1376
1377 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
1378
1379 * elf32-arc.c (elf_arc_size_dynamic_sections): Changed condition to
1380 require TEXTREL.
1381
1382 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
1383
1384 * arc-got.h (relocate_fix_got_relocs_for_got_info): Added TCB_SIZE to
1385 patched section contents for TLS IE reloc.
1386 * elf32-arc.c: Remove TCB_SIZE preprocessor macro.
1387
1388 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
1389
1390 * elf32-arc.c (elf_arc_relocate_section): Added "call" to
1391 RELOC_FOR_GLOBAL_SYMBOL macro.
1392
1393 2018-06-08 Cupertino Miranda <cmiranda@synopsys.com>
1394
1395 * elf32-arc.c (elf_arc_relocate_section): Small refactor and condition
1396 changes.
1397
1398 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
1399
1400 * config/tc-arc.c (md_undefined_symbol): Changed.
1401 * config/tc-arc.h (DYNAMIC_STRUCT_NAME): Removed.
1402
1403 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
1404
1405 * elf32-arc.c (elf_arc_relocate_section): Fixed reassign of indirect
1406 symbols.
1407
1408 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
1409
1410 * elf32-arc.c (elf_arc_check_relocs): Added condition to disable
1411 warning and "Bad value" for local symbols ARC_32 or ARC_32_ME relocs.
1412
1413 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
1414
1415 * elf32-arc.c (ADD_RELA): Changed to only work when dynamic
1416 object is created.
1417
1418 2017-06-08 Richard Earnshaw <rearnsha@arm.com>
1419
1420 * elf32-arm.c (elf32_arm_merge_eabi_attributes): Remove assertion
1421 that the input bfd has Tag_FP_ARCH non-zero if Tag_ABI_HardFP_use
1422 is non-zero. Add clarifying comments.
1423
1424 2017-06-08 H.J. Lu <hongjiu.lu@intel.com>
1425
1426 * elf32-i386.c (elf_i386_check_relocs): Set local IFUNC symbol
1427 name. Use local IFUNC symbol name string to report unsupported
1428 non-PIC call to IFUNC function.
1429 (elf_i386_relocate_section): Dump local IFUNC name with minfo
1430 when generating R_386_IRELATIVE relocation.
1431 (elf_i386_finish_dynamic_symbol): Likewise.
1432 * elf_x86_64_check_relocs (elf_x86_64_check_relocs): Set local
1433 IFUNC symbol name.
1434 (elf_x86_64_relocate_section): Dump local IFUNC name with minfo
1435 when generating R_X86_64_IRELATIVE relocation.
1436 (elf_x86_64_finish_dynamic_symbol): Likewise.
1437
1438 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
1439
1440 * elf.c (setup_group): Make sure BFD sections are created for all
1441 group sections in the input file when processing SHF_GROUP
1442 sections.
1443 (bfd_section_from_shdr): Avoid duplicating logic already
1444 implemented in `setup_group'.
1445
1446 2017-06-06 Daniel Bonniot de Ruisselet <bonniot@gmail.com>
1447
1448 PR binutils/21546
1449 * peXXigen.c (pe_print_idata): Use the address of the first thunk
1450 if the hint address is zero.
1451
1452 2017-06-06 James Clarke <jrtc27@jrtc27.com>
1453
1454 PR ld/19579
1455 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Check
1456 ELF_COMMON_DEF_P for common symbols.
1457
1458 2017-06-06 Andrew Burgess <andrew.burgess@embecosm.com>
1459
1460 * elf.c (_bfd_elf_make_section_from_shdr): Don't initially mark
1461 SEC_GROUP sections as SEC_EXCLUDE.
1462 (bfd_elf_set_group_contents): Replace use of abort with an assert.
1463 (assign_section_numbers): Use resolve_section_groups flag instead
1464 of relocatable link type.
1465 (_bfd_elf_init_private_section_data): Use resolve_section_groups
1466 flag instead of checking the final_link flag for part of the
1467 checks in here. Fix white space as a result.
1468 * elflink.c (elf_link_input_bfd): Use resolve_section_groups flag
1469 instead of relocatable link type.
1470 (bfd_elf_final_link): Likewise.
1471
1472 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
1473
1474 * elfxx-mips.c (_bfd_mips_elf_relocate_section): Remove unused
1475 variable `bed'.
1476 * elf32-score.c (score_elf_final_link_relocate): Likewise.
1477 (s3_bfd_score_elf_check_relocs): Likewise.
1478 * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
1479 (score_elf_final_link_relocate): Likewise.
1480 (s7_bfd_score_elf_check_relocs): Likewise.
1481
1482 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
1483
1484 * elflink.c (init_reloc_cookie_rels): Remove unused variable
1485 `bed'.
1486
1487 2017-06-06 Maciej W. Rozycki <macro@imgtec.com>
1488
1489 * elf-bfd.h (RELOC_AGAINST_DISCARDED_SECTION): Subtract `count'
1490 from `reloc_count' rather than decrementing it.
1491 * elf.c (bfd_section_from_shdr): Multiply the adjustment to
1492 `reloc_count' by `int_rels_per_ext_rel'.
1493 * elf32-score.c (score_elf_final_link_relocate): Do not multiply
1494 `reloc_count' by `int_rels_per_ext_rel' for last relocation
1495 entry determination.
1496 (s3_bfd_score_elf_check_relocs): Likewise.
1497 * elf32-score7.c (score_elf_final_link_relocate): Likewise.
1498 (s7_bfd_score_elf_relocate_section): Likewise.
1499 (s7_bfd_score_elf_check_relocs): Likewise.
1500 * elf64-mips.c (mips_elf64_get_reloc_upper_bound): Remove
1501 prototype and function.
1502 (mips_elf64_slurp_one_reloc_table): Do not update `reloc_count'.
1503 (mips_elf64_slurp_reloc_table): Assert that `reloc_count' is
1504 triple rather than once the sum of REL and RELA relocation entry
1505 counts.
1506 (bfd_elf64_get_reloc_upper_bound): Remove macro.
1507 * elflink.c (_bfd_elf_link_read_relocs): Do not multiply
1508 `reloc_count' by `int_rels_per_ext_rel' for internal relocation
1509 storage allocation size determination.
1510 (elf_link_input_bfd): Multiply `.ctors' and `.dtors' section's
1511 size by `int_rels_per_ext_rel'. Do not multiply `reloc_count'
1512 by `int_rels_per_ext_rel' for last relocation entry
1513 determination.
1514 (bfd_elf_final_link): Do not multiply `reloc_count' by
1515 `int_rels_per_ext_rel' for internal relocation storage
1516 allocation size determination.
1517 (init_reloc_cookie_rels): Do not multiply `reloc_count' by
1518 `int_rels_per_ext_rel' for last relocation entry determination.
1519 (elf_gc_smash_unused_vtentry_relocs): Likewise.
1520 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
1521 (_bfd_mips_elf_relocate_section): Likewise.
1522
1523 2017-06-05 Alan Modra <amodra@gmail.com>
1524
1525 PR 21529
1526 * linker.c (_bfd_generic_link_output_symbols): Handle BSF_GNU_UNIQUE.
1527
1528 2017-06-01 John Baldwin <jhb@FreeBSD.org>
1529
1530 * elf.c (elfcore_grok_freebsd_psinfo): Use ELF header class to
1531 determine structure sizes.
1532 (elfcore_grok_freebsd_prstatus): Likewise.
1533
1534 2017-06-01 Alan Modra <amodra@gmail.com>
1535
1536 * elf64-ppc.c (struct ppc_link_hash_table): Add has_plt_localentry0.
1537 (ppc64_elf_merge_symbol_attribute): Merge localentry bits from
1538 dynamic objects.
1539 (is_elfv2_localentry0): New function.
1540 (ppc64_elf_tls_setup): Default params->plt_localentry0.
1541 (plt_stub_size): Adjust size for tls_get_addr_opt stub.
1542 (build_tls_get_addr_stub): Use a simpler stub when r2 is not saved.
1543 (ppc64_elf_size_stubs): Leave stub_type as ppc_stub_plt_call for
1544 optimized localentry:0 stubs.
1545 (ppc64_elf_build_stubs): Save r2 in ELFv2 __glink_PLTresolve.
1546 (ppc64_elf_relocate_section): Leave nop unchanged for optimized
1547 localentry:0 stubs.
1548 (ppc64_elf_finish_dynamic_sections): Set PPC64_OPT_LOCALENTRY in
1549 DT_PPC64_OPT.
1550 * elf64-ppc.h (struct ppc64_elf_params): Add plt_localentry0.
1551
1552 2017-05-30 Casey Smith <clegg89@gmail.com>
1553
1554 PR ld/21523
1555 * elf32-arm.c (elf32_arm_final_link_relocate): Install an absolute
1556 value when processing the R_ARM_THM_ALU_PREL_11_0 reloc.
1557
1558 2017-05-30 Anton Kolesov Anton.Kolesov@synopsys.com
1559
1560 * cpu-arc.c (arc_compatible): New function.
1561
1562 2017-05-30 Anton Kolesov <anton.kolesov@synopsys.com>
1563
1564 * cpu-arc.c (arch_info_struct): Remove duplicate ARC600 entry.
1565
1566 2017-05-30 H.J. Lu <hongjiu.lu@intel.com>
1567
1568 PR binutils/21519
1569 * bfdio.c (bfd_get_file_size): New function.
1570 * bfd-in2.h: Regenerated.
1571
1572 2017-05-23 Dilian Palauzov <git-dpa@aegee.org>
1573
1574 * elf32-arc.c (arc_elf_merge_attributes): Add fall through
1575 comments.
1576
1577 2017-05-22 H.J. Lu <hongjiu.lu@intel.com>
1578
1579 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Use
1580 dynobj instead of htab->elf.dynobj.
1581
1582 2017-05-19 Maciej W. Rozycki <macro@imgtec.com>
1583
1584 * elf64-mips.c (mips_elf64_canonicalize_reloc): Remove prototype
1585 and function.
1586 (mips_elf64_canonicalize_dynamic_reloc): Likewise.
1587 (mips_elf64_slurp_one_reloc_table): Set `reloc_count' to the
1588 actual number of internal relocations retrieved. Adjust
1589 function description.
1590 (bfd_elf64_canonicalize_reloc): Remove macro.
1591 (bfd_elf64_canonicalize_dynamic_reloc): Likewise.
1592
1593 2017-05-19 Jose E. Marchesi <jose.marchesi@oracle.com>
1594
1595 * archures.c (bfd_mach_sparc_v9m8): Define.
1596 (bfd_mach_sparc_v8plusm8): Likewise.
1597 (bfd_mach_sparc_v9_p): Adjust to M8.
1598 (bfd_mach_sparc_64bit_p): Likewise.
1599 * aoutx.h (machine_type): Handle bfd_mach_sparc_v9m8 and
1600 bfd_mach_sparc_v8plusm8.
1601 * bfd-in2.h: Regenerated.
1602 * cpu-sparc.c (arch_info_struct): Entries for sparc:v9m8 and
1603 sparc:v8plusm8.
1604 * elfxx-sparc.c (_bfd_sparc_elf_object_p): Handle
1605 bfd_mach_sparc_v8plusm8 and bfd_mach_sparc_v9m8 using the new hw
1606 capabilities ONADDSUB, ONMUL, ONDIV, DICTUNP, FPCPSHL, RLE and
1607 SHA3.
1608 * elf32-sparc.c (elf32_sparc_final_write_processing): Handle
1609 bfd_mach_sparc_v8plusm8.
1610
1611 2017-05-19 Alan Modra <amodra@gmail.com>
1612
1613 * elflink.c (_bfd_elf_gc_mark_extra_sections): Don't keep
1614 debug and special sections when no non-note alloc sections in an
1615 object are kept.
1616
1617 2017-05-18 Alan Modra <amodra@gmail.com>
1618
1619 * arc-got.h: Don't compare boolean values against TRUE or FALSE.
1620 * elf-m10300.c: Likewise.
1621 * elf.c: Likewise.
1622 * elf32-arc.c: Likewise.
1623 * elf32-bfin.c: Likewise.
1624 * elf32-m68k.c: Likewise.
1625 * elf32-nds32.c: Likewise.
1626 * elf32-tilepro.c: Likewise.
1627 * elflink.c: Likewise.
1628 * elfnn-aarch64.c: Likewise.
1629 * elfnn-riscv.c: Likewise.
1630 * elfxx-tilegx.c: Likewise.
1631 * mach-o.c: Likewise.
1632 * peXXigen.c: Likewise.
1633 * vms-alpha.c: Likewise.
1634 * vms-lib.c: Likewise.
1635
1636 2017-05-17 H.J. Lu <hongjiu.lu@intel.com>
1637
1638 PR ld/20882
1639 * elflink.c (elf_gc_mark_debug_section): New function.
1640 (_bfd_elf_gc_mark_extra_sections): Mark any debug sections
1641 referenced by kept debug sections.
1642
1643 2017-05-16 Alan Modra <amodra@gmail.com>
1644
1645 * elf-m10300.c: Rename occurrences of non_ir_ref.
1646 * elf32-arm.c: Likewise.
1647 * elf32-bfin.c: Likewise.
1648 * elf32-cr16.c: Likewise.
1649 * elf32-cris.c: Likewise.
1650 * elf32-d10v.c: Likewise.
1651 * elf32-dlx.c: Likewise.
1652 * elf32-fr30.c: Likewise.
1653 * elf32-frv.c: Likewise.
1654 * elf32-hppa.c: Likewise.
1655 * elf32-i370.c: Likewise.
1656 * elf32-i386.c: Likewise.
1657 * elf32-iq2000.c: Likewise.
1658 * elf32-lm32.c: Likewise.
1659 * elf32-m32c.c: Likewise.
1660 * elf32-m32r.c: Likewise.
1661 * elf32-m68hc1x.c: Likewise.
1662 * elf32-m68k.c: Likewise.
1663 * elf32-mcore.c: Likewise.
1664 * elf32-metag.c: Likewise.
1665 * elf32-microblaze.c: Likewise.
1666 * elf32-moxie.c: Likewise.
1667 * elf32-msp430.c: Likewise.
1668 * elf32-mt.c: Likewise.
1669 * elf32-nios2.c: Likewise.
1670 * elf32-or1k.c: Likewise.
1671 * elf32-ppc.c: Likewise.
1672 * elf32-rl78.c: Likewise.
1673 * elf32-s390.c: Likewise.
1674 * elf32-score.c: Likewise.
1675 * elf32-score7.c: Likewise.
1676 * elf32-sh.c: Likewise.
1677 * elf32-tic6x.c: Likewise.
1678 * elf32-tilepro.c: Likewise.
1679 * elf32-v850.c: Likewise.
1680 * elf32-vax.c: Likewise.
1681 * elf32-xstormy16.c: Likewise.
1682 * elf32-xtensa.c: Likewise.
1683 * elf64-alpha.c: Likewise.
1684 * elf64-hppa.c: Likewise.
1685 * elf64-ia64-vms.c: Likewise.
1686 * elf64-mmix.c: Likewise.
1687 * elf64-ppc.c: Likewise.
1688 * elf64-s390.c: Likewise.
1689 * elf64-sh64.c: Likewise.
1690 * elf64-x86-64.c: Likewise.
1691 * elflink.c: Likewise.
1692 * elfnn-aarch64.c: Likewise.
1693 * elfnn-ia64.c: Likewise.
1694 * elfnn-riscv.c: Likewise.
1695 * elfxx-mips.c: Likewise.
1696 * elfxx-sparc.c: Likewise.
1697 * elfxx-tilegx.c: Likewise.
1698 * linker.c: Likewise.
1699
1700 2017-05-16 Alan Modra <amodra@gmail.com>
1701
1702 * elf64-ppc.c (add_symbol_adjust): Transfer non_ir_ref_dynamic.
1703 * elflink.c (elf_link_add_object_symbols): Update to use
1704 non_ir_ref_dynamic.
1705 (elf_link_input_bfd): Test non_ir_ref_dynamic in addition to
1706 non_ir_ref.
1707 * linker.c (_bfd_generic_link_add_one_symbol): Likewise.
1708
1709 2017-05-15 Maciej W. Rozycki <macro@imgtec.com>
1710
1711 * elfxx-mips.c (print_mips_ases): Handle MIPS16e2 ASE.
1712
1713 2017-05-12 H.J. Lu <hongjiu.lu@intel.com>
1714
1715 * elf32-i386.c (elf_i386_parse_gnu_properties): Merge
1716 GNU_PROPERTY_X86_ISA_1_USED and GNU_PROPERTY_X86_ISA_1_NEEDED
1717 properties.
1718 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
1719
1720 2017-05-11 H.J. Lu <hongjiu.lu@intel.com>
1721
1722 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Rename plt_bnd
1723 to plt_second.
1724 (elf_x86_64_link_hash_table): Rename plt_bnd/plt_bnd_eh_frame
1725 to plt_second/plt_second_eh_frame.
1726 (elf_x86_64_link_hash_newfunc): Updated.
1727 (elf_x86_64_allocate_dynrelocs): Likewise.
1728 (elf_x86_64_size_dynamic_sections): Likewise.
1729 (elf_x86_64_relocate_section): Likewise.
1730 (elf_x86_64_finish_dynamic_symbol): Likewise.
1731 (elf_x86_64_finish_dynamic_sections): Likewise.
1732 (elf_x86_64_plt_type): Rename plt_bnd to plt_second.
1733 (elf_x86_64_get_synthetic_symtab): Updated. Also scan the
1734 .plt.sec section.
1735 (elf_backend_setup_gnu_properties): Updated. Create the
1736 .plt.sec section instead of the .plt.sec section.
1737
1738 2017-05-11 H.J. Lu <hongjiu.lu@intel.com>
1739
1740 * elf32-i386.c (elf_i386_allocate_dynrelocs): Partially revert
1741 commit 25070364b0ce33eed46aa5d78ebebbec6accec7e.
1742 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewse.
1743
1744 2017-05-10 Jose E. Marchesi <jose.marchesi@oracle.com>
1745
1746 * elf64-sparc.c (elf64_sparc_set_reloc): New function.
1747 (bfd_elf64_set_reloc): Define.
1748 (elf64_sparc_write_relocs): Use `canon_reloc_count'.
1749
1750 2017-05-10 Jose E. Marchesi <jose.marchesi@oracle.com>
1751
1752 * targets.c (BFD_JUMP_TABLE_RELOCS): Add NAME##_set_reloc.
1753 (struct bfd_target): New field _bfd_set_reloc.
1754 * bfd.c (bfd_set_reloc): Call backend _set_bfd.
1755 * reloc.c (_bfd_generic_set_reloc): New function.
1756 * coffcode.h (coff_set_reloc): Define to _bfd_generic_set_reloc.
1757 * nlm-target.h (nlm_set_reloc): Likewise.
1758 * coff-rs6000.c (_bfd_xcoff_set_reloc): Likewise.
1759 * aout-tic30.c (MY_set_reloc): Likewise.
1760 * aout-target.h (MY_set_reloc): Likewise.
1761 * elfxx-target.h (bfd_elfNN_set_reloc): Likewise.
1762 * coff-alpha.c (_bfd_ecoff_set_reloc): Likewise.
1763 * mach-o-target.c (bfd_mach_o_set_reloc): Likewise.
1764 * vms-alpha.c (alpha_vms_set_reloc): Likewise.
1765 * aout-adobe.c (aout_32_set_reloc): Likewise.
1766 * bout.c (b_out_set_reloc): Likewise.
1767 * coff-mips.c (_bfd_ecoff_set_reloc): Likewise.
1768 * i386os9k.c (aout_32_set_reloc): Likewise.
1769 * ieee.c (ieee_set_reloc): Likewise.
1770 * oasys.c (oasys_set_reloc): Likewise.
1771 * som.c (som_set_reloc): Likewise.
1772 * versados.c (versados_set_reloc): Likewise.
1773 * coff64-rs6000.c (rs6000_xcoff64_vec): Add
1774 _bfd_generic_set_reloc.
1775 (rs6000_xcoff64_aix_vec): LIkewise.
1776 * libbfd.c (_bfd_norelocs_set_reloc): New function.
1777 * libbfd-in.h: Prototype for _bfd_norelocs_set_reloc.
1778 * i386msdos.c (msdos_set_reloc): Define to
1779 _bfd_norelocs_set_reloc.
1780 * elfcode.h (elf_set_reloc): Define.
1781 * bfd-in2.h: Regenerated.
1782
1783 2017-05-10 H.J. Lu <hongjiu.lu@intel.com>
1784
1785 PR ld/21481
1786 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Use .plt.bnd
1787 for IFUNC function address.
1788
1789 2017-05-10 Claudiu Zissulescu <claziss@synopsys.com>
1790
1791 * elf32-arc.c (FEATURE_LIST_NAME): Define.
1792 (CONFLICT_LIST): Likewise.
1793 (opcode/arc-attrs.h): Include.
1794 (arc_elf_print_private_bfd_data): Print OSABI v4 flag.
1795 (arc_extract_features): New file.
1796 (arc_stralloc): Likewise.
1797 (arc_elf_merge_attributes): Likewise.
1798 (arc_elf_merge_private_bfd_data): Use object attributes.
1799 (bfd_arc_get_mach_from_attributes): New function.
1800 (arc_elf_object_p): Use object attributes.
1801 (arc_elf_final_write_processing): Likewise.
1802 (elf32_arc_obj_attrs_arg_type): New function.
1803 (elf32_arc_obj_attrs_handle_unknown): Likewise.
1804 (elf32_arc_section_from_shdr): Likewise.
1805 (elf_backend_obj_attrs_vendor): Define.
1806 (elf_backend_obj_attrs_section): Likewise.
1807 (elf_backend_obj_attrs_arg_type): Likewise.
1808 (elf_backend_obj_attrs_section_type): Likewise.
1809 (elf_backend_obj_attrs_handle_unknown): Likewise.
1810 (elf_backend_section_from_shdr): Likewise.
1811
1812 2017-05-09 Andrew Goedhart <Andrewgoedhart@simplepowersolutions.co.za>
1813
1814 PR ld/21458
1815 * elf32-arm.c (elf32_arm_final_link_relocate): Set the bottom bit
1816 of the value when resolving a R_ARM_THM_ALU_PREL_11_0 relocation
1817 and the destination is a Thumb symbol.
1818
1819 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
1820
1821 * elf32-i386.c (elf_i386_get_synthetic_symtab): Add missing
1822 initializer to silence GCC 4.2.
1823 * lf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
1824
1825 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
1826
1827 * elf64-x86-64.c (PLT_ENTRY_SIZE): Renamed to ...
1828 (LAZY_PLT_ENTRY_SIZE): This.
1829 (NON_LAZY_PLT_ENTRY_SIZE): New.
1830 (elf_x86_64_plt0_entry): Renamed to ...
1831 (elf_x86_64_lazy_plt0_entry): This.
1832 (elf_x86_64_plt_entry): Renamed to ...
1833 (elf_x86_64_lazy_plt_entry): This.
1834 (elf_x86_64_bnd_plt0_entry): Renamed to ...
1835 (elf_x86_64_lazy_bnd_plt0_entry): This.
1836 (elf_x86_64_legacy_plt_entry): Removed.
1837 (elf_x86_64_bnd_plt_entry): Renamed to ...
1838 (elf_x86_64_lazy_bnd_plt_entry): This.
1839 (elf_x86_64_legacy_plt2_entry): Renamed to ...
1840 (elf_x86_64_non_lazy_plt_entry): This.
1841 (elf_x86_64_bnd_plt2_entry): Renamed to ...
1842 (elf_x86_64_non_lazy_bnd_plt_entry): This.
1843 (elf_x86_64_eh_frame_plt): Renamed to ...
1844 (elf_x86_64_eh_frame_lazy_plt): This.
1845 (elf_x86_64_eh_frame_bnd_plt): Renamed to ...
1846 (elf_x86_64_eh_frame_lazy_bnd_plt): This.
1847 (elf_x86_64_eh_frame_plt_got): Renamed to ...
1848 (elf_x86_64_eh_frame_non_lazy_plt): This.
1849 (elf_x86_64_lazy_plt_layout): New.
1850 (elf_x86_64_non_lazy_plt_layout): Likewise.
1851 (elf_x86_64_plt_layout): Likewise.
1852 (elf_x86_64_backend_data): Remove PLT layout information. Add
1853 os for target system.
1854 (GET_PLT_ENTRY_SIZE): Removed.
1855 (elf_x86_64_lazy_plt): New.
1856 (elf_x86_64_non_lazy_plt): Likewise.
1857 (elf_x86_64_lazy_bnd_plt): Likewise.
1858 (elf_x86_64_non_lazy_bnd_plt): Likewise.
1859 (elf_x86-64_arch_bed): Updated.
1860 (elf_x86_64_link_hash_table): Add plt, lazy_plt and non_lazy_plt.
1861 (elf_x86_64_create_dynamic_sections): Removed.
1862 (elf_x86_64_check_relocs): Don't check elf.dynobj. Don't call
1863 _bfd_elf_create_ifunc_sections nor _bfd_elf_create_got_section.
1864 (elf_x86-64_adjust_dynamic_symbol): Updated.
1865 (elf_x86_64_allocate_dynrelocs): Updated. Pass 0 as PLT header
1866 size to _bfd_elf_allocate_ifunc_dyn_relocs and don't allocate
1867 size for PLT0 if there is no PLT0. Get plt_entry_size from
1868 non_lazy_plt for non-lazy PLT entries.
1869 (elf_x86_64_size_dynamic_sections): Updated. Get plt_entry_size
1870 from non_lazy_plt for non-lazy PLT entries.
1871 (elf_x86-64_relocate_section): Updated. Properly get PLT index
1872 if there is no PLT0.
1873 (elf_x86_64_finish_dynamic_symbol): Updated. Fill the first slot
1874 in the PLT entry with generic PLT layout. Fill the non-lazy PLT
1875 entries with non-lazy PLT layout. Don't fill the second and third
1876 slots in the PLT entry if there is no PLT0.
1877 (elf_x86_64_finish_dynamic_sections): Updated. Don't fill PLT0
1878 if there is no PLT0. Set sh_entsize on the .plt.got section.
1879 (compare_relocs): New.
1880 (elf_x86_64_plt_type): Likewise.
1881 (elf_x86_64_plt): Likewise.
1882 (elf_x86_64_nacl_plt): New. Forward declaration.
1883 (elf_x86_64_get_plt_sym_val): Removed.
1884 (elf_x86_64_get_synthetic_symtab): Rewrite to check PLT sections
1885 against all dynamic relocations.
1886 (elf_x86_64_link_setup_gnu_properties): New function.
1887 (elf_backend_create_dynamic_sections): Updated.
1888 (elf_backend_setup_gnu_properties): New.
1889 (elf_x86_64_nacl_plt): New.
1890 (elf_x86_64_nacl_arch_bed): Updated.
1891
1892 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
1893
1894 * elf32-i386.c (PLT_ENTRY_SIZE): Renamed to ...
1895 (LAZY_PLT_ENTRY_SIZE): This.
1896 (NON_LAZY_PLT_ENTRY_SIZE): New.
1897 (elf_i386_plt0_entry): Renamed to ...
1898 (elf_i386_lazy_plt0_entry): This.
1899 (elf_i386_plt_entry): Renamed to ...
1900 (elf_i386_lazy_plt_entry): This.
1901 (elf_i386_pic_plt0_entry): Renamed to ...
1902 (elf_i386_pic_lazy_plt0_entry): This.
1903 (elf_i386_pic_plt_entry): Renamed to ...
1904 (elf_i386_pic_lazy_plt_entry): This.
1905 (elf_i386_got_plt_entry): Renamed to ...
1906 (elf_i386_non_lazy_plt_entry): This.
1907 (elf_i386_pic_got_plt_entry): Renamed to ...
1908 (elf_i386_pic_non_lazy_plt_entry): This.
1909 (elf_i386_eh_frame_plt): Renamed to ...
1910 (elf_i386_eh_frame_lazy_plt): This.
1911 (elf_i386_eh_frame_plt_got): Renamed to ...
1912 (elf_i386_eh_frame_non_lazy_plt): This.
1913 (elf_i386_plt_layout): Renamed to ...
1914 (elf_i386_lazy_plt_layout): This. Remove eh_frame_plt_got and
1915 eh_frame_plt_got_size.
1916 (elf_i386_non_lazy_plt_layout): New.
1917 (elf_i386_plt_layout): Likewise.
1918 (elf_i386_non_lazy_plt): Likewise.
1919 (GET_PLT_ENTRY_SIZE): Removed.
1920 (elf_i386_plt): Renamed to ...
1921 (elf_i386_lazy_plt): This.
1922 (elf_i386_backend_data): Remove plt. Rename is_vxworks to os.
1923 (elf_i386_arch_bed): Updated.
1924 (elf_i386_link_hash_table): Add plt, lazy_plt and non_lazy_plt.
1925 (elf_i386_create_dynamic_sections): Removed.
1926 (elf_i386_check_relocs): Don't check elf.dynobj. Don't call
1927 _bfd_elf_create_ifunc_sections nor _bfd_elf_create_got_section.
1928 (elf_i386_adjust_dynamic_symbol): Updated.
1929 (elf_i386_allocate_dynrelocs): Updated. Pass 0 as PLT header
1930 size to _bfd_elf_allocate_ifunc_dyn_relocs and don't allocate
1931 size for PLT0 if there is no PLT0.
1932 (elf_i386_size_dynamic_sections): Updated. Check whether GOT
1933 output section is discarded only if GOT isn't empty.
1934 (elf_i386_relocate_section): Updated. Properly get PLT index
1935 if there is no PLT0.
1936 (elf_i386_finish_dynamic_symbol): Updated. Don't fill the
1937 second and third slots in the PLT entry if there is no PLT0.
1938 (elf_i386_finish_dynamic_sections): Updated. Don't fill PLT0
1939 if there is no PLT0. Set sh_entsize on the .plt.got section.
1940 (elf_i386_nacl_plt): Forward declaration.
1941 (elf_i386_get_plt_sym_val): Removed.
1942 (elf_i386_get_synthetic_symtab): Rewrite to check PLT sections
1943 against all dynamic relocations.
1944 (elf_i386_link_setup_gnu_properties): New function.
1945 (elf_backend_create_dynamic_sections): Updated.
1946 (elf_backend_setup_gnu_properties): New.
1947 (elf_i386_nacl_plt): Updated.
1948 (elf_i386_nacl_arch_bed): Likewise.
1949 (elf_i386_vxworks_arch_bed): Likewise.
1950
1951 2017-05-08 Thomas Preud'homme <thomas.preudhomme@arm.com>
1952
1953 * elflink.c (elf_output_implib): Remove executable flag from import
1954 library bfd.
1955 * elf32-arm.c (elf32_arm_filter_implib_symbols): Assert that the import
1956 library is a relocatable object file.
1957
1958 2017-05-01 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
1959
1960 PR ld/21404
1961 * elf32-avr.c (avr_should_move_sym): New function.
1962 (avr_should_reduce_sym_size): Likewise.
1963 (avr_should_increase_sym_size): Likewise.
1964 (elf32_avr_relax_delete_bytes): Adjust symbol values
1965 and sizes by calling new functions.
1966
1967 2017-05-01 Palmer Dabbelt <palmer@dabbelt.com>
1968
1969 * config.bfd (riscv32-*): Enable rv64.
1970
1971 2017-05-02 Alan Modra <amodra@gmail.com>
1972
1973 PR 21384
1974 * elflink.c (bfd_elf_link_mark_dynamic_symbol): Test h->non_elf
1975 rather than h->root.type == bfd_link_hash_new.
1976 (bfd_elf_record_link_assignment): Similarly, call
1977 bfd_elf_link_mark_dynamic_symbol when h->non_elf.
1978
1979 2017-04-29 Alan Modra <amodra@gmail.com>
1980
1981 PR 21432
1982 * reloc.c (reloc_offset_in_range): New function.
1983 (bfd_perform_relocation, bfd_install_relocation): Use it.
1984 (_bfd_final_link_relocate): Likewise.
1985
1986 2017-04-28 H.J. Lu <hongjiu.lu@intel.com>
1987
1988 * elf32-i386.c (elf_i386_allocate_dynrelocs): Check plt_got
1989 before using .plt.got.
1990 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise.
1991
1992 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
1993
1994 * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Use "="
1995 instead of "+=" to update 0.
1996
1997 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
1998
1999 * elf32-i386.c (elf_i386_create_dynamic_sections): Create the
2000 .plt.got section here.
2001 (elf_i386_check_relocs): Don't create the .plt.got section.
2002 * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Create
2003 the .plt.got and .plt.bnd sections here.
2004 (elf_x86_64_check_relocs): Don't create the .plt.got nor
2005 .plt.bnd sections.
2006
2007 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
2008
2009 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Remove
2010 has_bnd_reloc.
2011 (elf_x86_64_link_hash_newfunc): Don't clear has_bnd_reloc.
2012 (elf_x86_64_copy_indirect_symbol): Don't copy has_bnd_reloc.
2013 (elf_x86_64_check_relocs): Don't set has_bnd_reloc.
2014 (elf_x86_64_finish_dynamic_symbol): Check bndplt instead of
2015 has_bnd_reloc.
2016
2017 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
2018
2019 * elf-bfd.h (elf_backend_data): Change setup_gnu_properties
2020 to return bfd *.
2021 (_bfd_elf_link_setup_gnu_properties): Return bfd *.
2022 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Return
2023 the first relocatable ELF input with GNU properties.
2024
2025 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
2026
2027 * elf32-i386.c (elf_i386_finish_dynamic_sections): Simplify
2028 VxWorks for non-PIC.
2029
2030 2017-04-27 Alan Modra <amodra@gmail.com>
2031
2032 * elf-bfd.h (struct elf_backend_data): Make asection param of
2033 elf_backend_eh_frame_address_size const.
2034 (_bfd_elf_eh_frame_address_size): Likewise.
2035 * elf32-m32c.c (_bfd_m32c_elf_eh_frame_address_size): Likewise.
2036 * elf32-msp430.c (elf32_msp430_eh_frame_address_size): Likewise.
2037 * elfxx-mips.c (_bfd_mips_elf_eh_frame_address_size): Likewise.
2038 * elfxx-mips.h (_bfd_mips_elf_eh_frame_address_size): Likewise.
2039 * elf-eh-frame.c (_bfd_elf_eh_frame_address_size): Likewise.
2040 (next_cie_fde_offset): Constify params.
2041 (offset_adjust, adjust_eh_frame_local_symbols): Likewise.
2042
2043 2017-04-27 Alan Modra <amodra@gmail.com>
2044
2045 * elf-bfd.h (struct eh_cie_fde): Add aug_str_len and aug_data_len.
2046 (_bfd_elf_adjust_eh_frame_global_symbol): Declare.
2047 * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Set aug_str_len and
2048 aug_data_len.
2049 (offset_adjust): New function.
2050 (_bfd_elf_adjust_eh_frame_global_symbol): Likewise.
2051 (adjust_eh_frame_local_symbols): Likewise.
2052 (_bfd_elf_discard_section_eh_frame): Call adjust_eh_frame_local_symbols
2053 after changing anything. Return true if anything changed.
2054 * elflink.c (bfd_elf_discard_info): If .eh_frame changed, call
2055 _bfd_elf_adjust_eh_frame_global_symbol for globals.
2056
2057 2017-04-27 Alan Modra <amodra@gmail.com>
2058
2059 * elflink.c (_bfd_elf_link_hash_hide_symbol): Clear dynstr_index
2060 when force_local.
2061
2062 2017-04-27 Alan Modra <amodra@gmail.com>
2063
2064 * elf32-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
2065 (ppc_elf_select_plt_layout, ppc_elf_tls_setup): Use it.
2066 (ppc_elf_adjust_dynamic_symbol, allocate_dynrelocs): Likewise.
2067 (ppc_elf_relocate_section): Likewise. Delete silly optimisation
2068 for undef and undefweak dyn_relocs.
2069 * elf64-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
2070 (ppc64_elf_adjust_dynamic_symbol, ppc64_elf_tls_setup): Use it.
2071 (allocate_got, allocate_dynrelocs): Likewise.
2072 (ppc64_elf_relocate_section): Likewise.
2073
2074 2017-04-26 H.J. Lu <hongjiu.lu@intel.com>
2075
2076 * elf32-i386.c (elf_i386_size_dynamic_sections): Alwasys add
2077 DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rel.plt section.
2078 * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Alwasys
2079 add DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rela.plt section.
2080
2081 2017-04-26 Nick Clifton <nickc@redhat.com>
2082
2083 PR binutils/21434
2084 * reloc.c (bfd_perform_relocation): Check for a negative address
2085 in the reloc.
2086
2087 2017-04-26 Maciej W. Rozycki <macro@imgtec.com>
2088
2089 PR ld/21334
2090 * elf-bfd.h (elf_backend_data): Add `always_renumber_dynsyms'
2091 member.
2092 * elfxx-target.h [!elf_backend_always_renumber_dynsyms]
2093 (elf_backend_always_renumber_dynsyms): Define.
2094 (elfNN_bed): Initialize `always_renumber_dynsyms' member.
2095 * elfxx-mips.h (elf_backend_always_renumber_dynsyms): Define.
2096 * elflink.c (bfd_elf_size_dynamic_sections): Also call
2097 `_bfd_elf_link_renumber_dynsyms' if the backend has requested
2098 it.
2099 (bfd_elf_size_dynsym_hash_dynstr): Likewise.
2100
2101 2017-04-26 Maciej W. Rozycki <macro@imgtec.com>
2102
2103 * elflink.c (bfd_elf_size_dynamic_sections): Only call
2104 `_bfd_elf_link_renumber_dynsyms' after section GC if dynamic
2105 sections have been created.
2106
2107 2017-04-26 Nick Clifton <nickc@redhat.com>
2108
2109 PR binutils/21431
2110 * compress.c (bfd_init_section_compress_status): Check the return
2111 value from bfd_malloc.
2112
2113 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
2114
2115 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Add
2116 no_finish_dynamic_symbol.
2117 (elf_x86_64_link_hash_newfunc): Set no_finish_dynamic_symbol to
2118 0.
2119 (elf_x86_64_allocate_dynrelocs): If a symbol isn't undefined
2120 weak symbol, don't make it dynamic.
2121 (elf_x86_64_relocate_section): If a symbol isn't dynamic in PIC,
2122 set no_finish_dynamic_symbol and generate R_X86_64_RELATIVE
2123 relocation for GOT reference.
2124 (elf_x86_64_finish_dynamic_symbol): Abort if
2125 no_finish_dynamic_symbol isn't 0.
2126
2127 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
2128
2129 PR ld/21402
2130 * elf32-i386.c (elf_i386_allocate_dynrelocs): If a symbol isn't
2131 undefined weak symbol, don't make it dynamic.
2132 (elf_i386_relocate_section): If a symbol isn't dynamic in PIC,
2133 set no_finish_dynamic_symbol and generate R_386_RELATIVE
2134 relocation for R_386_GOT32.
2135
2136 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
2137
2138 PR ld/21425
2139 * elf32-i386.c (ELF_MAXPAGESIZE): Set to 0x1000 for VxWorks.
2140
2141 2017-04-23 Alan Modra <amodra@gmail.com>
2142
2143 PR 21414
2144 * section.c (GLOBAL_SYM_INIT): Make available in bfd.h.
2145 * elf.c (lcomm_sym): New.
2146 (_bfd_elf_large_com_section): Use lcomm_sym section symbol.
2147 * bfd-in2.h: Regenerate.
2148
2149 2017-04-23 Alan Modra <amodra@gmail.com>
2150
2151 PR 21412
2152 * elf-bfd.h (struct elf_backend_data <get_reloc_section>): Change
2153 parameters and comment.
2154 (_bfd_elf_get_reloc_section): Delete.
2155 (_bfd_elf_plt_get_reloc_section): Declare.
2156 * elf.c (_bfd_elf_plt_get_reloc_section, elf_get_reloc_section):
2157 New functions. Don't blindly skip over assumed .rel/.rela prefix.
2158 Extracted from..
2159 (_bfd_elf_get_reloc_section): ..here. Delete.
2160 (assign_section_numbers): Call elf_get_reloc_section.
2161 * elf64-ppc.c (elf_backend_get_reloc_section): Define.
2162 * elfxx-target.h (elf_backend_get_reloc_section): Update.
2163
2164 2017-04-23 Alan Modra <amodra@gmail.com>
2165
2166 PR 21409
2167 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Don't segfault when
2168 no symbols.
2169
2170 2017-04-21 H.J. Lu <hongjiu.lu@intel.com>
2171
2172 PR ld/21402
2173 * elf32-i386.c (elf_i386_link_hash_entry): Add
2174 no_finish_dynamic_symbol.
2175 (elf_i386_link_hash_newfunc): Set no_finish_dynamic_symbol to 0.
2176 (elf_i386_allocate_dynrelocs): If a symbol isn't undefined weak
2177 symbol, don't make it dynamic in PIE.
2178 (elf_i386_relocate_section): If a symbol isn't dynamic in PIE,
2179 set no_finish_dynamic_symbol and generate R_386_RELATIVE
2180 relocation for R_386_GOT32
2181 (elf_i386_finish_dynamic_symbol): Abort if no_finish_dynamic_symbol
2182 isn't 0.
2183
2184 2017-04-21 H.J. Lu <hongjiu.lu@intel.com>
2185
2186 PR ld/19617
2187 PR ld/21086
2188 * elflink.c (elf_link_add_object_symbols): Require
2189 --no-dynamic-linker with -E/--dynamic-list when creating
2190 dynamic sections.
2191
2192 2017-04-20 Maciej W. Rozycki <macro@imgtec.com>
2193
2194 * elflink.c (_bfd_elf_symbol_refs_local_p): Always return TRUE
2195 if forced local.
2196
2197 2017-04-20 Maciej W. Rozycki <macro@imgtec.com>
2198
2199 * elfxx-mips.c (_bfd_mips_elf_final_link): Reorder comment about
2200 dynamic symbol sorting.
2201
2202 2017-04-20 H.J. Lu <hongjiu.lu@intel.com>
2203
2204 PR ld/21382
2205 * elflink.c (elf_link_add_object_symbols): Preserve
2206 dynamic_ref_after_ir_def when restoring the symbol table for
2207 unneeded dynamic object.
2208
2209 2017-04-19 H.J. Lu <hongjiu.lu@intel.com>
2210
2211 PR ld/21401
2212 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Don't abort
2213 on on undefined IFUNC symbol in the second PLT.
2214
2215 2017-04-19 Wedson Almeida Filho <wedsonaf@gmail.com>
2216
2217 * peXXigen.c (pe_print_reloc): Correct chunk_end.
2218
2219 2017-04-19 Alan Modra <amodra@gmail.com>
2220
2221 * elflink.c (_bfd_elf_adjust_dynamic_symbol): Hide undefweak
2222 or make dynamic for info->dynamic_undefined_weak 0 and 1.
2223 * elf32-ppc.c:Formatting.
2224 (ensure_undefweak_dynamic): Don't make dynamic when
2225 info->dynamic_undefined_weak is zero.
2226 (allocate_dynrelocs): Discard undefweak dyn_relocs for
2227 info->dynamic_undefined_weak. Discard undef dyn_relocs when
2228 not default visibility. Discard undef and undefweak
2229 dyn_relocs earlier.
2230 (ppc_elf_relocate_section): Adjust to suit.
2231 * elf64-ppc.c: Formatting.
2232 (ensure_undefweak_dynamic): Don't make dynamic when
2233 info->dynamic_undefined_weak is zero.
2234 (allocate_dynrelocs): Discard undefweak dyn_relocs for
2235 info->dynamic_undefined_weak. Discard them earlier.
2236
2237 2017-04-17 H.J. Lu <hongjiu.lu@intel.com>
2238
2239 PR ld/21389
2240 * elflink.c (bfd_elf_size_dynamic_sections): Get soname index
2241 before generating the version definition section.
2242
2243 2017-04-17 Alan Modra <amodra@gmail.com>
2244
2245 * elflink.c (_bfd_elf_merge_symbol): Undo dynamic linking
2246 state when a regular object file defines a symbol with
2247 incompatible type to that defined by an earlier shared lib.
2248
2249 2017-04-13 Alan Modra <amodra@gmail.com>
2250
2251 * coffcode.h: Wrap some overly long _bfd_error_handler args.
2252 * elf.c: Likewise.
2253 * elf32-arm.c: Likewise.
2254 * elf32-i386.c: Likewise.
2255 * elf32-mep.c: Likewise.
2256 * elf64-ia64-vms.c: Likewise.
2257 * elf64-x86-64.c: Likewise.
2258 * elflink.c: Likewise.
2259 * elfnn-ia64.c: Likewise.
2260 * elfxx-mips.c: Likewise.
2261
2262 2017-04-13 Alan Modra <amodra@gmail.com>
2263
2264 * aoutx.h: Use %B and %A in error messages throughout file.
2265 * aout-cris.c: Likewise.
2266 * archive.c: Likewise.
2267 * binary.c: Likewise.
2268 * coff-rs6000.c: Likewise.
2269 * coff-tic4x.c: Likewise.
2270 * coffcode.h: Likewise.
2271 * coffgen.c: Likewise.
2272 * cofflink.c: Likewise.
2273 * coffswap.h: Likewise.
2274 * cpu-arm.c: Likewise.
2275 * elf-eh-frame.c: Likewise.
2276 * elf-m10300.c: Likewise.
2277 * elf.c: Likewise.
2278 * elf32-arc.c: Likewise.
2279 * elf32-arm.c: Likewise.
2280 * elf32-bfin.c: Likewise.
2281 * elf32-frv.c: Likewise.
2282 * elf32-iq2000.c: Likewise.
2283 * elf32-m32c.c: Likewise.
2284 * elf32-microblaze.c: Likewise.
2285 * elf32-nds32.c: Likewise.
2286 * elf32-rl78.c: Likewise.
2287 * elf32-rx.c: Likewise.
2288 * elf32-score.c: Likewise.
2289 * elf32-score7.c: Likewise.
2290 * elf32-sh64.c: Likewise.
2291 * elf32-v850.c: Likewise.
2292 * elf32-vax.c: Likewise.
2293 * elf32-visium.c: Likewise.
2294 * elf64-ia64-vms.c: Likewise.
2295 * elf64-mmix.c: Likewise.
2296 * elf64-sh64.c: Likewise.
2297 * elfcode.h: Likewise.
2298 * elfnn-aarch64.c: Likewise.
2299 * elfnn-ia64.c: Likewise.
2300 * elfxx-mips.c: Likewise.
2301 * hpux-core.c: Likewise.
2302 * ieee.c: Likewise.
2303 * ihex.c: Likewise.
2304 * linker.c: Likewise.
2305 * merge.c: Likewise.
2306 * mmo.c: Likewise.
2307 * oasys.c: Likewise.
2308 * pdp11.c: Likewise.
2309 * peXXigen.c: Likewise.
2310 * rs6000-core.c: Likewise.
2311 * vms-alpha.c: Likewise.
2312 * xcofflink.c: Likewise.
2313
2314 2017-04-13 Alan Modra <amodra@gmail.com>
2315
2316 * bfd.c (PRINT_TYPE): Define.
2317 (_doprnt): New function.
2318 (error_handler_internal): Use _doprnt.
2319 * coff-arm.c: Put %A and %B arguments to _bfd_error_handler
2320 calls in their natural order, throughout file.
2321 * coff-mcore.c: Likewise.
2322 * coff-ppc.c: Likewise.
2323 * coff-tic80.c: Likewise.
2324 * cofflink.c: Likewise.
2325 * elf-s390-common.c: Likewise.
2326 * elf.c: Likewise.
2327 * elf32-arm.c: Likewise.
2328 * elf32-i386.c: Likewise.
2329 * elf32-m32r.c: Likewise.
2330 * elf32-msp430.c: Likewise.
2331 * elf32-spu.c: Likewise.
2332 * elf64-ia64-vms.c: Likewise.
2333 * elf64-sparc.c: Likewise.
2334 * elf64-x86-64.c: Likewise.
2335 * elflink.c: Likewise.
2336 * elfnn-aarch64.c: Likewise.
2337 * elfnn-ia64.c: Likewise.
2338 * elfxx-mips.c: Likewise.
2339
2340 2017-04-13 Alan Modra <amodra@gmail.com>
2341
2342 * elf32-arm.c (arm_type_of_stub): Supply missing args to "long
2343 branch veneers" error. Fix double space and format message.
2344 * elf32-avr.c (avr_add_stub): Do not pass NULL as %B arg.
2345 * elf64-ppc.c (tocsave_find): Supply missing %B arg.
2346
2347 2017-04-13 Alan Modra <amodra@gmail.com>
2348
2349 * bfd-in2.h: Regenerate.
2350
2351 2017-04-11 H.J. Lu <hongjiu.lu@intel.com>
2352
2353 * elf-properties.c (_bfd_elf_parse_gnu_properties): Remove the
2354 extra `\n' in warning/error messages.
2355 * elf32-i386.c (elf_i386_parse_gnu_properties): Likewise.
2356 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
2357
2358 2017-04-11 H.J. Lu <hongjiu.lu@intel.com>
2359
2360 * elf-properties.c (_bfd_elf_parse_gnu_properties): Ignore
2361 processor-specific properties with generic ELF target vector.
2362
2363 2017-04-10 Qing Zhao <qing.zhao@oracle.com>
2364
2365 * elf32-sparc.c (elf_backend_fixup_symbol): New.
2366 * elf64-sparc.c (elf_backend_fixup_symbol): New.
2367 * elfxx-sparc.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): New.
2368 (_bfd_sparc_elf_link_hash_entry): Add has_got_reloc and
2369 has_non_got_reloc.
2370 (link_hash_newfunc): Initialize has_got_reloc and
2371 has_non_got_reloc.
2372 (_bfd_sparc_elf_size_dynamic_sections): Set interp to .interp
2373 section.
2374 (_bfd_sparc_elf_copy_indirect_symbol): Copy has_got_reloc and
2375 has_non_got_reloc.
2376 (_bfd_sparc_elf_check_relocs): Set has_got_reloc and
2377 has_non_got_reloc.
2378 (_bfd_sparc_elf_fixup_symbol): New function.
2379 (allocate_dynrelocs): Don't allocate space for dynamic
2380 relocations and discard relocations against resolved undefined
2381 weak symbols in executable. Don't make resolved undefined weak
2382 symbols in executable dynamic. Keep dynamic non-GOT/non-PLT
2383 relocation against undefined weak symbols in PIE.
2384 (_bfd_sparc_elf_relocate_section): Don't generate dynamic
2385 relocations against resolved undefined weak symbols in PIE
2386 (_bfd_sparc_elf_finish_dynamic_symbol): Keep PLT/GOT entries
2387 without ynamic PLT/GOT relocations for resolved undefined weak
2388 symbols.
2389 Don't generate dynamic relocation against resolved undefined
2390 weak symbol in executable.
2391 (pie_finish_undefweak_symbol): New function.
2392 (_bfd_sparc_elf_finish_dynamic_sections): Call
2393 pie_finish_undefweak_symbol on all symbols in PIE.
2394 * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Add interp.
2395 (_bfd_sparc_elf_fixup_symbol): New function.
2396
2397 2017-04-10 Nick Clifton <nickc@redhat.com>
2398
2399 * config.bfd: Remove ns32k from obsolete list.
2400
2401 2017-04-10 Alan Modra <amodra@gmail.com>
2402
2403 PR 21287
2404 * elf.c (special_sections_f): Match .fini_array and .fini_array.*.
2405 (special_sections_i): Likewise for .init_array.
2406 (special_sections_p): Likewise for .preinit_array.
2407
2408 2017-04-07 H.J. Lu <hongjiu.lu@intel.com>
2409
2410 PR ld/19579
2411 PR ld/21306
2412 * elf32-s390.c (elf_s390_finish_dynamic_symbol): Check
2413 ELF_COMMON_DEF_P for common symbols.
2414 * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
2415 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
2416 * elflink.c (_bfd_elf_merge_symbol): Revert commits
2417 202ac193bbbecc96a4978d1ac3d17148253f9b01 and
2418 07492f668d2173da7a2bda3707ff0985e0f460b6.
2419
2420 2017-04-07 Pedro Alves <palves@redhat.com>
2421
2422 * opncls.c (bfd_get_debug_link_info): Rename to...
2423 (bfd_get_debug_link_info_1): ... this. Change type of second
2424 parameter to void pointer. Adjust.
2425 (bfd_get_debug_link_info): Reimplement on top of
2426 bfd_get_debug_link_info_1.
2427 (separate_debug_file_exists, separate_alt_debug_file_exists):
2428 Change type of second parameter to void pointer. Adjust.
2429 (get_func_type, check_func_type): Change type of second parameter
2430 to void pointer.
2431 (find_separate_debug_file): Add 'func_data' parameter. Pass it to
2432 the callback functions instead of passing the address of a local.
2433 (bfd_follow_gnu_debuglink): Pass address of unsigned long local to
2434 find_separate_debug_file.
2435 (get_alt_debug_link_info_shim): Change type of second parameter to
2436 void pointer. Adjust.
2437 (bfd_follow_gnu_debugaltlink): Adjust to pass NULL to
2438 find_separate_debug_file.
2439 (get_build_id_name, bfd_boolean check_build_id_file): Change type
2440 of second parameter to void pointer. Adjust.
2441 (bfd_follow_build_id_debuglink): Pass address of bfd_build_id
2442 pointer local to find_separate_debug_file.
2443
2444 2017-04-07 Tristan Gingold <gingold@gingold-Precision-7510>
2445
2446 * coffgen.c (_bfd_coff_gc_mark_hook): Handle PE weak
2447 external symbols with a definition.
2448 (_bfd_coff_gc_mark_extra_sections): Fix typo.
2449
2450 2017-04-07 Alan Modra <amodra@gmail.com>
2451
2452 * po/SRC-POTFILES.in: Regenerate.
2453
2454 2017-04-05 Alan Modra <amodra@gmail.com>
2455
2456 * elf64-ppc.c (ppc64_elf_gc_sweep_hook): Support ELFv2 PLT
2457 reference counting.
2458
2459 2017-04-02 Jon Turney <jon.turney@dronecode.org.uk>
2460
2461 (_bfd_XXi_swap_aouthdr_out): For clarity, use defines rather than
2462 numbers for DataDirectory entry indicies passed to
2463 add_data_entry().
2464
2465 2017-04-04 H.J. Lu <hongjiu.lu@intel.com>
2466
2467 * elf.c (get_program_header_size): Add a GNU_MBIND segment for
2468 each GNU_MBIND section and align GNU_MBIND section to page size.
2469 (_bfd_elf_map_sections_to_segments): Create a GNU_MBIND
2470 segment for each GNU_MBIND section.
2471 (_bfd_elf_init_private_section_data): Copy sh_info from input
2472 for GNU_MBIND section.
2473
2474 2017-04-03 Palmer Dabbelt <palmer@dabbelt.com>
2475
2476 * elfnn-riscv.c (GP_NAME): Delete.
2477 (riscv_global_pointer_value): Change GP_NAME to RISCV_GP_SYMBOL.
2478 (_bfd_riscv_relax_lui): Likewise.
2479
2480 2017-04-04 Nick Clifton <nickc@redhat.com>
2481
2482 PR binutils/21342
2483 * elflink.c (_bfd_elf_define_linkage_sym): Prevent null pointer
2484 dereference.
2485 (bfd_elf_final_link): Only initialize the extended symbol index
2486 section if there are extended symbol tables to list.
2487
2488 2017-04-03 H.J. Lu <hongjiu.lu@intel.com>
2489
2490 * Makefile.am (BFD32_BACKENDS): Add elf-properties.lo.
2491 (BFD32_BACKENDS_CFILES): Add elf-properties.c.
2492 * configure.ac (elf): Add elf-properties.lo.
2493 * Makefile.in: Regenerated.
2494 * configure: Likewise.
2495 * elf-bfd.h (elf_property_kind): New.
2496 (elf_property): Likewise.
2497 (elf_property_list): Likewise.
2498 (elf_properties): Likewise.
2499 (_bfd_elf_parse_gnu_properties): Likewise.
2500 (_bfd_elf_get_property): Likewise.
2501 (_bfd_elf_link_setup_gnu_properties): Likewise.
2502 (elf_backend_data): Add parse_gnu_properties, merge_gnu_properties
2503 and setup_gnu_properties.
2504 (elf_obj_tdata): Add properties.
2505 * elf-properties.c: New file.
2506 * elf32-i386.c (elf_i386_parse_gnu_properties): New.
2507 (elf_i386_merge_gnu_properties): Likewise.
2508 (elf_backend_parse_gnu_properties): Likewise.
2509 (elf_backend_merge_gnu_properties): Likewise.
2510 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
2511 (elf_x86_64_merge_gnu_properties): Likewise.
2512 (elf_backend_parse_gnu_properties): Likewise.
2513 (elf_backend_merge_gnu_properties): Likewise.
2514 * elfxx-target.h (elf_backend_merge_gnu_properties): Likewise.
2515 (elf_backend_parse_gnu_properties): Likewise.
2516 (elf_backend_setup_gnu_properties): Likewise.
2517 (elfNN_bed): Add elf_backend_parse_gnu_properties,
2518 elf_backend_merge_gnu_properties and
2519 elf_backend_setup_gnu_properties.
2520
2521 2017-03-30 Pip Cet <pipcet@gmail.com>
2522
2523 * elf32-wasm32.c: Add relocation code, two relocs.
2524 * reloc.c: Add wasm32 relocations.
2525 * libbfd.h: Regenerate.
2526 * bfd-in2.h: Regenerate.
2527 * bfd/po/bfd.pot: Regenerate.
2528
2529 2017-03-29 Nick Clifton <nickc@redhat.com>
2530
2531 PR binutils/18025
2532 * coff-bfd.h (struct coff_section_data): Add new fields:
2533 saved_bias and bias.
2534 * coffgen.c (coff_find_nearest_line_with_names): Cache the bias
2535 computed for PE binaries.
2536 * dwarf2.c (scan_unit_for_symbols): Only warn once about each
2537 missing abbrev.
2538
2539 2017-03-28 Hans-Peter Nilsson <hp@axis.com>
2540
2541 PR ld/16044
2542 * elf32-cris.c (elf_cris_adjust_gotplt_to_got): Adjust BFD_ASSERT
2543 to handle a local symbol with a hash-symbol-entry; without PLT.
2544 Add BFD_ASSERT for an incidental case with GOT entry present.
2545 (cris_elf_check_relocs): Increment PLT refcount only if the symbol
2546 isn't forced-or-set local.
2547
2548 2017-03-27 Pip Cet <pipcet@gmail.com>
2549
2550 * wasm-module.c: New file to support WebAssembly modules.
2551 * wasm-module.h: New file to support WebAssembly modules.
2552 * doc/webassembly.texi: Start documenting wasm-module.c.
2553 * config.bfd: Add wasm_vec.
2554 * targets.c: Likewise.
2555 * configure.ac: Likewise.
2556 * Makefile.am: Add entries for wasm-module.c.
2557 * Makefile.in: Regenerate.
2558 * configure: Regenerate.
2559 * po/SRC-POTFILES.in: Regenerate.
2560
2561 2017-03-27 Pip Cet <pipcet@gmail.com>
2562
2563 * cpu-wasm32.c: New file to support wasm32 architecture.
2564 * elf32-wasm32.c: New file to support wasm32 architecture.
2565 * Makefile.am: Add wasm32 architecture.
2566 * archures.c: Likewise.
2567 * config.bfd: Likewise.
2568 * configure.ac: Likewise.
2569 * targets.c: Likewise.
2570 * Makefile.in: Regenerate.
2571 * bfd-in2.h: Regenerate.
2572 * configure: Regenerate.
2573 * po/SRC-POTFILES.in: Regenerate.
2574
2575 2017-03-20 Alan Modra <amodra@gmail.com>
2576
2577 PR 21266
2578 * elf64-ppc.c (compare_symbols): Stabilize sort.
2579
2580 2017-03-18 Alan Modra <amodra@gmail.com>
2581
2582 * elf64-ppc.c (struct ppc_link_hash_table): Add
2583 local_ifunc_resolver and maybe_local_ifunc_resolver.
2584 (ppc_build_one_stub): Set flags on emitting dynamic
2585 relocation to ifunc.
2586 (ppc64_elf_relocate_section): Likewise.
2587 (ppc64_elf_finish_dynamic_symbol): Likewise.
2588 (ppc64_elf_finish_dynamic_sections): Error on DT_TEXTREL with
2589 local dynamic relocs to ifuncs.
2590 * elf32-ppc.c (struct ppc_elf_link_hash_table): Add
2591 local_ifunc_resolver and maybe_local_ifunc_resolver.
2592 (ppc_elf_relocate_section): Set flag on emitting dynamic
2593 relocation to ifuncs.
2594 (ppc_elf_finish_dynamic_symbol): Likewise.
2595 (ppc_elf_finish_dynamic_sections): Error on DT_TEXTREL with local
2596 dynamic relocs to ifuncs.
2597
2598 2017-03-13 Nick Clifton <nickc@redhat.com>
2599
2600 PR binutils/21202
2601 * reloc.c (BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC): Rename to
2602 BFD_RELOC_AARCH64_TLSDESC_LD64_LO12.
2603 (BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC): Rename to
2604 BFD_RELOC_AARCH64_TLSDESC_ADD_LO12.
2605 * bfd-in2.h: Regenerate.
2606 * libbfd.h: Regenerate.
2607 * elfnn-aarch64.c (IS_AARCH64_TLS_RELAX_RELOC): Update reloc
2608 names.
2609 (IS_AARCH64_TLSDESC_RELOC): Likewise.
2610 (elfNN_aarch64_howto_table): Likewise.
2611 (aarch64_tls_transition_without_check): Likewise.
2612 (aarch64_reloc_got_type): Likewise.
2613 (elfNN_aarch64_final_link_relocate): Likewise.
2614 (elfNN_aarch64_tls_relax): Likewise.
2615 (elfNN_aarch64_relocate_section): Likewise.
2616 (elfNN_aarch64_gc_sweep_hook): Likewise.
2617 (elfNN_aarch64_check_relocs): Likewise.
2618 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
2619 (_bfd_aarch64_elf_resolve_relocation): Likewise.
2620
2621 2017-03-11 Alan Modra <amodra@gmail.com>
2622
2623 * elf32-ppc.c: Remove ATTRIBUTE_UNUSED throughout when function
2624 parameter is in fact used. Whitespace fixes.
2625 * elf64-ppc.c: Likewise.
2626
2627 2017-03-09 Sam Thursfield <sam.thursfield@codethink.co.uk>
2628
2629 * rs6000-core.c (CORE_NEW): Simplify macro when
2630 AIX_CORE_DUMPX_CORE and BFD64 are true to avoid compile warning.
2631
2632 2017-03-07 Alan Modra <amodra@gmail.com>
2633
2634 PR 21224
2635 PR 20519
2636 * elf64-ppc.c (ppc64_elf_relocate_section): Add missing
2637 dyn_relocs check.
2638
2639 2017-03-05 Alan Modra <amodra@gmail.com>
2640
2641 * elf-bfd.h (struct eh_cie_fde): Add u.cie.per_encoding_aligned8.
2642 * elf-eh-frame.c (size_of_output_cie_fde): Don't align here.
2643 (next_cie_fde_offset): New function.
2644 (_bfd_elf_parse_eh_frame): Set u.cie.per_encoding_aligned8.
2645 (_bfd_elf_discard_section_eh_frame): Align zero terminator to
2646 four bytes. Align CIEs to four or eight bytes depending on
2647 per_encoding_aligned8. Align FDEs according to their encoding.
2648 Pad last FDE to output section alignment.
2649 (_bfd_elf_write_section_eh_frame): Adjust to suit. Remove
2650 assertion.
2651 * elf64-ppc.c (glink_eh_frame_cie): Delete padding.
2652 (ppc64_elf_size_stubs): Pad glink eh_frame as per elf-eh-frame.c.
2653 (ppc64_elf_finish_dynamic_sections): Adjust to suit.
2654
2655 2017-03-02 Martin Bickel <binutils@ineranves.de>
2656
2657 PR ld/21212
2658 * elf.c (rewrite_elf_program_header): Do not issue a warning for
2659 empty segments which have a zero filesz, but a non-zero memsz.
2660
2661 2017-03-02 Alan Modra <amodra@gmail.com>
2662
2663 * elf32-ppc.c (ppc_elf_vle_split16): Correct insn mask typo.
2664
2665 2017-02-28 Alan Modra <amodra@gmail.com>
2666
2667 * elf64-ppc.c (ppc64_elf_ha_reloc): Revert last change.
2668 (ppc64_elf_relocate_section): Likewise.
2669
2670 2017-02-28 Alan Modra <amodra@gmail.com>
2671
2672 PR 20995
2673 * elf32-nios2.c (nios2_elf32_relocate_section): Use htab
2674 rather than elf32_nios2_hash_table or elf_hash_table.
2675 (create_got_section): Likewise.
2676 (nios2_elf32_finish_dynamic_symbol): Likewise.
2677 (nios2_elf32_adjust_dynamic_symbol): Likewise.
2678 (nios2_elf32_size_dynamic_sections): Likewise.
2679 (nios2_elf32_check_relocs): Delete dynobj, sgot, and srelgot
2680 vars. Use htab equivalents directly instead. Don't create
2681 all dynamic sections on needing just the GOT. Use a goto
2682 rather than a fall-through with reloc test. Ensure
2683 htab->dynobj is set when making dynamic sreloc section.
2684 (nios2_elf32_finish_dynamic_sections): Delete dynobj, use htab
2685 equivalent directly instead. Don't segfault on looking for
2686 .dynamic when dynamic sections have not been created. Don't
2687 segfault on .got.plt being discarded.
2688 (nios2_elf32_size_dynamic_sections): Delete plt and got vars.
2689 Don't set "relocs" on .rela.plt. Do handle .sbss. Delete
2690 fixme and another not so relevant comment.
2691 (nios2_elf_add_symbol_hook): Delete dynobj var. If not
2692 already set, set hash table dynobj on creating .sbss.
2693
2694 2017-02-28 Alan Modra <amodra@gmail.com>
2695
2696 * reloc.c (BFD_RELOC_PPC_16DX_HA): New.
2697 * elf64-ppc.c (ppc64_elf_howto_raw <R_PPC64_16DX_HA>): New howto.
2698 (ppc64_elf_reloc_type_lookup): Translate new bfd reloc.
2699 (ppc64_elf_ha_reloc): Correct overflow test on REL16DX_HA.
2700 (ppc64_elf_relocate_section): Likewise.
2701 * elf32-ppc.c (ppc_elf_howto_raw <R_PPC_16DX_HA>): New howto.
2702 (ppc_elf_reloc_type_lookup): Translate new bfd reloc.
2703 (ppc_elf_check_relocs): Handle R_PPC_16DX_HA to pacify gcc.
2704 * libbfd.h: Regenerate.
2705 * bfd-in2.h: Regenerate.
2706
2707 2017-02-28 Alan Modra <amodra@gmail.com>
2708
2709 * elflink.c (_bfd_elf_create_dynamic_sections): Don't make
2710 dynamic .data.rel.ro read-only.
2711 * elf32-arm.c (elf32_arm_finish_dynamic_symbol): Compare section
2712 rather than section flags when deciding where copy reloc goes.
2713 * elf32-cris.c (elf_cris_finish_dynamic_symbol): Likewise.
2714 * elf32-hppa.c (elf32_hppa_finish_dynamic_symbol): Likewise.
2715 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Likewise.
2716 * elf32-metag.c (elf_metag_finish_dynamic_symbol): Likewise.
2717 * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Likewise.
2718 * elf32-nios2.c (nios2_elf32_finish_dynamic_symbol): Likewise.
2719 * elf32-or1k.c (or1k_elf_finish_dynamic_symbol): Likewise.
2720 * elf32-ppc.c (ppc_elf_finish_dynamic_symbol): Likewise.
2721 * elf32-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
2722 * elf32-tic6x.c (elf32_tic6x_finish_dynamic_symbol): Likewise.
2723 * elf32-tilepro.c (tilepro_elf_finish_dynamic_symbol): Likewise.
2724 * elf64-ppc.c (ppc64_elf_finish_dynamic_symbol): Likewise.
2725 * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
2726 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
2727 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Likewise.
2728 * elfnn-riscv.c (riscv_elf_finish_dynamic_symbol): Likewise.
2729 * elfxx-mips.c (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise.
2730 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Likewise.
2731 * elfxx-tilegx.c (tilegx_elf_finish_dynamic_symbol): Likewise.
2732
2733 2017-02-28 Maciej W. Rozycki <macro@imgtec.com>
2734
2735 * elfxx-mips.c (mips_elf_perform_relocation): Also handle the
2736 `jalr $0, $25' instruction encoding.
2737
2738 2017-02-27 Nick Clifton <nickc@redhat.com>
2739
2740 PR ld/21180
2741 * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Avoid
2742 generating a seg-fault when encountering a symbol that has been
2743 deleted by garbage collection.
2744
2745 2017-02-25 Alan Modra <amodra@gmail.com>
2746
2747 * elf32-arc.c (struct dynamic_sections): Delete.
2748 (enum dyn_section_types): Delete.
2749 (dyn_section_names): Delete.
2750 (arc_create_dynamic_sections): Delete.
2751 (elf_arc_finish_dynamic_sections): Don't call the above. Don't
2752 segfault on discarded .rela.plt section.
2753 (elf_arc_size_dynamic_sections): Formatting. Don't call
2754 arc_create_dynamic_sections. Don't allocate memory for sections
2755 handled by the generic linker. Correct code finding relocs in
2756 read-only sections. Set SEC_EXCLUDE on zero size .got,
2757 .got.plt, and .dynbss sections. Do set .interp for pies.
2758
2759 2017-02-24 Andrew Waterman <andrew@sifive.com>
2760
2761 * elfnn-riscv.c (GP_NAME): New macro.
2762 (riscv_global_pointer_value): Use it.
2763 (_bfd_riscv_relax_lui): If symbol and global pointer are in same
2764 output section, consider only that section's alignment.
2765
2766 2017-02-23 Maciej W. Rozycki <macro@imgtec.com>
2767
2768 * elfxx-mips.h (_bfd_mips_relax_section): Remove prototype.
2769 * elfxx-mips.c (_bfd_mips_relax_section): Remove function.
2770 * elf64-mips.c (bfd_elf64_bfd_relax_section): Remove macro.
2771 * elfn32-mips.c (bfd_elf32_bfd_relax_section): Likewise.
2772
2773 2017-02-23 Maciej W. Rozycki <macro@imgtec.com>
2774
2775 * elfxx-mips.c (mips_elf_calculate_relocation) <R_MIPS_JALR>
2776 <R_MICROMIPS_JALR>: Discard relocation if `cross_mode_jump_p'
2777 or misaligned.
2778
2779 2017-02-23 Alan Modra <amodra@gmail.com>
2780
2781 PR 20744
2782 * elf32-ppc.c (ppc_elf_howto_raw): Correct dst_mask on all VLE
2783 16D relocations.
2784 (ppc_elf_vle_split16): Correct field mask and shift for 16D relocs.
2785 (ppc_elf_relocate_section): Correct calculation for VLE SDAREL
2786 relocs.
2787
2788 2017-02-22 Maciej W. Rozycki <macro@imgtec.com>
2789
2790 PR ld/20828
2791 * elflink.c (bfd_elf_size_dynamic_sections): Move symbol version
2792 processing ahead of the call to `elf_gc_sweep_symbol'.
2793
2794 2017-02-22 Nick Clifton <nickc@redhat.com>
2795
2796 PR binutils/21193
2797 * opncls.c (bfd_create_gnu_debuglink_section): Give the newly
2798 created section 4-byte alignment.
2799
2800 2017-02-22 Alan Modra <amodra@gmail.com>
2801
2802 * elf64-ppc.c (ppc64_elf_finish_dynamic_sections): Don't segfault
2803 on .got or .plt output section being discarded by script.
2804 * elf32-ppc.c (ppc_elf_finish_dynamic_sections): Likewise. Move
2805 vxworks splt temp.
2806
2807 2017-02-21 Alan Modra <amodra@gmail.com>
2808
2809 * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Only emit
2810 DT_RELA, DT_RELASZ, and DT_RELAENT when DT_RELASZ is non-zero.
2811
2812 2017-02-20 Alan Modra <amodra@gmail.com>
2813
2814 PR 21181
2815 * elflink.c (bfd_elf_final_link): Make DT_REL/DT_RELA zero
2816 if DT_RELSZ/DT_RELASZ is zero.
2817
2818 2017-02-17 Nick Clifton <nickc@redhat.com>
2819
2820 * compress.c (bfd_get_full_section_contents): Remember to reduce
2821 compressed size by the sizeof the compression header when
2822 decompressing the contents.
2823
2824 2017-02-17 Pedro Alves <palves@redhat.com>
2825
2826 * srec.c (Chunk): Rename to ...
2827 (_bfd_srec_len): ... this.
2828 (S3Forced): Rename to ...
2829 (_bfd_srec_forceS3): ... this.
2830 * objcopy.c: Adjust all references.
2831
2832 2017-02-17 Pedro Alves <palves@redhat.com>
2833
2834 * archive.c (bsd_write_armap): Rename to ...
2835 (_bfd_bsd_write_armap): ... this.
2836 (coff_write_armap): Rename to ...
2837 (_bfd_coff_write_armap): ... this.
2838 * libbfd-in.h (bsd_write_armap): Rename to ...
2839 (_bfd_bsd_write_armap): ... this.
2840 (coff_write_armap): Rename to ...
2841 (_bfd_coff_write_armap): ... this.
2842 * aout-target.h, aout-tic30.c: Adjust all users.
2843 * libbfd.h: Regenerate.
2844
2845 2017-02-17 Pedro Alves <palves@redhat.com>
2846
2847 * bfd-in.h (bfd_read, bfd_write): Adjust to rename.
2848 (warn_deprecated): Rename to ...
2849 (_bfd_warn_deprecated): ... this.
2850 * libbfd.c (warn_deprecated): Rename to ...
2851 (_bfd_warn_deprecated): ... this.
2852 * bfd-in2.h: Regenerate.
2853
2854 2017-02-17 Pedro Alves <palves@redhat.com>
2855
2856 * bfdio.c (real_ftell): Rename to ...
2857 (_bfd_real_ftell): ... this.
2858 (real_fseek): Rename to ...
2859 (_bfd_real_fseek): ... this.
2860 (real_fopen): Rename to ...
2861 (_bfd_real_fopen): ... this.
2862 * libbfd-in.h (real_ftell): Rename to ...
2863 (_bfd_real_ftell): ... this.
2864 (real_fseek): Rename to ...
2865 (_bfd_real_fseek): ... this.
2866 (real_fopen): Rename to ...
2867 (_bfd_real_fopen): ... this.
2868 * cache.c, dwarf2.c, opncls.c: Adjust all callers.
2869 * libbfd.h: Regenerate.
2870
2871 2017-02-17 Pedro Alves <palves@redhat.com>
2872
2873 * dwarf2.c, elf-attrs.c, elf32-nds32.c: Adjust all callers.
2874 * libbfd.c (read_unsigned_leb128): Rename to ...
2875 (_bfd_read_unsigned_leb128): ... this.
2876 (read_signed_leb128): Rename to ...
2877 (_bfd_read_signed_leb128): ... this.
2878 (safe_read_leb128): Rename to ...
2879 (_bfd_safe_read_leb128): ... this.
2880 * libbfd-in.h (read_unsigned_leb128): Rename to ...
2881 (_bfd_read_unsigned_leb128): ... this.
2882 (read_signed_leb128): Rename to ...
2883 (_bfd_read_signed_leb128): ... this.
2884 (safe_read_leb128): Rename to ...
2885 (_bfd_safe_read_leb128): ... this.
2886 * libbfd.h: Renegerate.
2887
2888 2017-02-16 Andrew Burgess <andrew.burgess@embecosm.com>
2889
2890 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Perform symbol lookup
2891 before trying to fine matching file and line information.
2892
2893 2017-02-16 Andrew Burgess <andrew.burgess@embecosm.com>
2894
2895 * dwarf2.c (struct dwarf2_debug): Add orig_bfd member.
2896 (_bfd_dwarf2_slurp_debug_info): If stashed debug information does
2897 not match current bfd, then reload debug information. Record bfd
2898 we're loading debug info for in the stash. If we have debug
2899 informatin in the cache then perform section placement before
2900 returning.
2901
2902 2017-02-16 Alan Modra <amodra@gmail.com>
2903
2904 PR 21000
2905 * elf-bfd.h (struct elf_backend_data): Add no_page_alias.
2906 * elfxx-target.h (elf_backend_no_page_alias): Define.
2907 (elfNN_bed): Init new field.
2908 * elf.c (assign_file_positions_for_load_sections): If no_page_alias
2909 ensure PT_LOAD segment starts on a new page.
2910 * elf32-hppa.c (elf_backend_no_page_alias): Define.
2911
2912 2017-02-16 Alan Modra <amodra@gmail.com>
2913
2914 PR 21132
2915 * elf32-hppa.c (allocate_plt_static): Allocate space for relocs
2916 if pic.
2917
2918 2017-02-16 Jiong Wang <jiong.wang@arm.com>
2919
2920 * bfd.c (BFD_FLAGS_SAVED): Add BFD_LINKER_CREATED.
2921 * bfd-in2.h: Regenerated.
2922
2923 2017-02-15 H.J. Lu <hongjiu.lu@intel.com>
2924
2925 PR ld/21168
2926 * elf32-i386.c (elf_i386_relocate_section): Allow
2927 "lea foo@GOT, %reg" in PIC.
2928
2929 2017-02-15 H.J. Lu <hongjiu.lu@intel.com>
2930
2931 PR ld/20244
2932 * elf32-i386.c (elf_i386_relocate_section): Properly get IFUNC
2933 symbol name when reporting R_386_GOT32/R_386_GOT32X relocation
2934 error against local IFUNC symbol without a base register for
2935 PIC.
2936
2937 2017-02-15 Maciej W. Rozycki <macro@imgtec.com>
2938
2939 * elf32-ppc.c (ppc_elf_check_relocs): Use `%H:' rather than
2940 `%P: %H:' with `info->callbacks->einfo'.
2941 (ppc_elf_relocate_section): Likewise.
2942 * elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
2943 (ppc64_elf_edit_toc): Likewise.
2944 (ppc64_elf_relocate_section): Likewise.
2945
2946 2017-02-14 Alan Modra <amodra@gmail.com>
2947
2948 * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Support
2949 --gc-keep-exported, and test versioned field of sym rather than
2950 looking for @ in name.
2951
2952 2017-02-13 Palmer Dabbelt <palmer@dabbelt.com>
2953
2954 * elfnn-riscv.c (riscv_global_pointer_value): Change _gp to
2955 __global_pointer$.
2956
2957 2017-02-13 Nick Clifton <nickc@redhat.com>
2958
2959 PR binutils/21151
2960 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Check for an invalid
2961 unit length field.
2962
2963 2017-02-07 Andrew Waterman <andrew@sifive.com>
2964
2965 * elfnn-riscv.c (riscv_elf_finish_dynamic_sections): Only write PLT
2966 entry size if PLT header is written.
2967
2968 2017-02-06 Sheldon Lobo <sheldon.lobo@oracle.com>
2969
2970 Fix sparc64 dynamic relocation processing to use the dynamic
2971 symbol count.
2972 * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Use 'dynamic'
2973 to determine if bfd_get_symcount() or bfd_get_dynamic_symcount()
2974 should be used.
2975
2976 2017-02-03 Nick Clifton <nickc@redhat.com>
2977
2978 PR 21096
2979 * coffcode.h (coff_write_object_contents): Enlarge size of
2980 s_name_buf in order to avoid compile time warning about possible
2981 integer truncation.
2982 * elf32-nds32.c (nds32_elf_ex9_import_table): Mask off lower
2983 32-bits of insn value before printing into buffer.
2984
2985 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
2986
2987 * elfxx-mips.c (mips_elf_hash_sort_data): Add
2988 `max_local_dynindx'.
2989 (mips_elf_sort_hash_table): Handle it.
2990 (mips_elf_sort_hash_table_f) <GGA_NONE>: For forced local
2991 symbols bump up `max_local_dynindx' rather than
2992 `max_non_got_dynindx'.
2993
2994 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
2995
2996 * elfxx-mips.c (mips_elf_hash_sort_data): Convert the
2997 `min_got_dynindx', `max_unref_got_dynindx' and
2998 `max_non_got_dynindx' members to the `bfd_size_type' data type.
2999 (mips_elf_sort_hash_table): Adjust accordingly.
3000
3001 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
3002
3003 * elfxx-mips.c (mips_elf_sort_hash_table): Use `htab' throughout
3004 to access the hash table.
3005
3006 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
3007
3008 * elfxx-mips.c (mips_elf_sort_hash_table): Move assertion on
3009 non-NULL `htab' to the beginning.
3010
3011 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
3012
3013 * elflink.c (elf_gc_sweep): Wrap overlong line.
3014
3015 2017-01-30 Maciej W. Rozycki <macro@imgtec.com>
3016
3017 * elfxx-mips.h (_bfd_mips_elf_insn32): Rename prototype to...
3018 (_bfd_mips_elf_linker_flags): ... this. Add another parameter.
3019 * elfxx-mips.c (mips_elf_link_hash_table): Add
3020 `ignore_branch_isa' member.
3021 (mips_elf_perform_relocation): Do not treat an ISA mode mismatch
3022 in branch relocation calculation as an error if
3023 `ignore_branch_isa' has been set.
3024 (_bfd_mips_elf_insn32): Rename to...
3025 (_bfd_mips_elf_linker_flags): ... this. Rename the `on'
3026 parameter to `insn32' and add an `ignore_branch_isa' parameter.
3027 Handle the new parameter.
3028
3029 2017-01-27 Hans-Peter Nilsson <hp@axis.com>
3030
3031 * elf32-cris.c (elf_cris_finish_dynamic_symbol): Remove now unused
3032 local variable dynobj.
3033
3034 PR ld/20995
3035 * elf32-cris.c (elf_cris_size_dynamic_sections): Handle sdynrelro.
3036 (elf_cris_adjust_dynamic_symbol): Place variables copied into the
3037 executable from read-only sections into sdynrelro.
3038 (elf_cris_finish_dynamic_symbol): Select sreldynrelro for
3039 dynamic relocs in sdynrelro.
3040 (elf_backend_want_dynrelro): Define.
3041
3042 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
3043
3044 * config.bfd (*-*-rtemsaout*): Mark as removed.
3045
3046 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
3047
3048 * config.bfd (powerpcle-*-rtems*): Do not mark as removed.
3049 (arm-*-rtems*): Move to (arm*-*-eabi*).
3050 (i[3-7]86-*-rtems*): Move to (i[3-7]86-*-elf*).
3051 (m68-*-rtems*): Move to (m68*-*-elf*).
3052
3053 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
3054
3055 * config.bfd (*-*-rtemscoff*): Mark as removed.
3056
3057 2017-01-24 Maciej W. Rozycki <macro@imgtec.com>
3058
3059 PR ld/20828
3060 * elflink.c (bfd_elf_record_link_assignment): Revert last
3061 change and don't ever clear `forced_local'. Set `mark'
3062 unconditionally.
3063 (elf_gc_sweep_symbol_info, elf_gc_sweep_symbol): Reorder within
3064 file.
3065 (elf_gc_sweep): Move the call to `elf_gc_sweep_symbol'...
3066 (bfd_elf_size_dynamic_sections): ... here.
3067 * elf32-ppc.c (ppc_elf_tls_setup): Don't clear `forced_local'
3068 and set `mark' instead in `__tls_get_addr_opt' processing.
3069 * elf64-ppc.c (ppc64_elf_tls_setup): Likewise.
3070
3071 2017-01-24 Alan Modra <amodra@gmail.com>
3072
3073 * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Merge two cases
3074 where dynamic relocs are preferable. Allow ifunc too.
3075 (ensure_undefweak_dynamic): New function.
3076 (allocate_dynrelocs): Use it here. Move plt handling last and
3077 don't make symbols dynamic, simplifying loop. Only make undef
3078 weak symbols with GOT entries dynamic. Correct condition
3079 for GOT relocs. Handle dynamic relocs on ifuncs. Correct
3080 comments. Remove goto.
3081 (ppc_elf_relocate_section): Correct test for using dynamic
3082 symbol on GOT relocs. Rearrange test for emitting GOT relocs
3083 to suit. Set up explicit tls_index entries and implicit GOT
3084 tls_index entries resolvable at link time for
3085 __tls_get_addr_opt. Simplify test to clear mem for prelink.
3086 * elf64-ppc.c (allocate_got): Correct condition for GOT relocs.
3087 (ensure_undefweak_dynamic): New function.
3088 (allocate_dynrelocs): Use it here. Only make undef weak symbols
3089 with GOT entries dynamic. Remove unnecessary test of
3090 WILL_CALL_FINISH_DYNAMIC_SYMBOL in PLT handling.
3091 (ppc64_elf_relocate_section): Correct test for using dynamic
3092 symbol on GOT relocs. Rearrange test for emitting GOT relocs
3093 to suit. Set up explicit tls_index entries and implicit GOT
3094 tls_index entries resolvable at link time for __tls_get_addr_opt.
3095 Simplify expression to clear mem for prelink.
3096
3097 2017-01-23 Yury Norov <ynorov@caviumnetworks.com>
3098
3099 * elfnn-aarch64.c: Fix relaxations for ILP32 mode.
3100
3101 2017-01-20 Jiong Wang <jiong.wang@arm.com>
3102
3103 * elfnn-aarch64.c (elf_aarch64_hash_symbol): New function.
3104 (elf_backend_hash_symbol): Define.
3105
3106 2017-01-18 Maciej W. Rozycki <macro@imgtec.com>
3107
3108 PR ld/20828
3109 * elflink.c (bfd_elf_record_link_assignment): Clear any
3110 `forced_local' marking for DSO symbols that are not being
3111 provided.
3112
3113 2017-01-17 Kuan-Lin Chen <kuanlinchentw@gmail.com>
3114
3115 * elfnn-riscv.c (riscv_elf_object_p): New function.
3116
3117 2017-01-12 H.J. Lu <hongjiu.lu@intel.com>
3118
3119 PR ld/21038
3120 * elf64-x86-64.c (elf_x86_64_link_hash_table): Add
3121 plt_bnd_eh_frame.
3122 (elf_x86_64_check_relocs): Create .eh_frame section for the
3123 .plt.bnd section.
3124 (elf_x86_64_size_dynamic_sections): Allocate and initialize
3125 .eh_frame section for the .plt.bnd section.
3126 (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
3127 for the .plt.bnd section.
3128
3129 2017-01-12 Nick Clifton <nickc@redhat.com>
3130
3131 PR binutils/20876
3132 * opncls.c (find_separate_debug_file): Add include_dirs
3133 parameter. Only include the directory part of the bfd's filename
3134 in search paths if include_dirs is true. Add a couple of extra
3135 locations for looking for debug files.
3136 ( bfd_follow_gnu_debuglink): Update invocation of
3137 find_separate_debug_file.
3138 (bfd_follow_gnu_debugaltlink): Likewise.
3139 (get_build_id): New function: Finds the build-id of the given bfd.
3140 (get_build_id_name): New function: Computes the name of the
3141 separate debug info file for a bfd, based upon its build-id.
3142 (check_build_id_file): New function: Checks to see if a separate
3143 debug info file exists at the given location, and that its
3144 build-id matches that of the original bfd.
3145 (bfd_follow_build_id_debuglink): New function: Finds a separate
3146 debug info file for a given bfd by using the build-id method.
3147 * dwarf2.c (_bfd_dwarf2_slurp_debug_info): Try using the build-id
3148 method of locating a separate debug info file before using the
3149 debuglink method.
3150 * bfd-in2.h: Regenerate.
3151
3152 2017-01-11 H.J. Lu <hongjiu.lu@intel.com>
3153
3154 PR ld/21038
3155 * elf64-x86-64.c (elf_x86_64_eh_frame_bnd_plt): New.
3156 (elf_x86_64_bnd_arch_bed): Use elf_x86_64_eh_frame_bnd_plt and
3157 elf_x86_64_eh_frame_plt_got.
3158 (elf_x86_64_size_dynamic_sections): Get unwind info from
3159 elf_x86_64_bnd_arch_bed for the BND PLT.
3160
3161 2017-01-11 Jeremy Soller <jackpot51@gmail.com>
3162
3163 * config.bfd: Add entries for i686-redox and x86_64-redox.
3164
3165 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
3166
3167 * elf32-i386.c (elf_i386_check_relocs): Align .eh_frame section
3168 to 4 bytes.
3169 * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Align
3170 .eh_frame section to 4 bytes for x32.
3171 (elf_x86_64_check_relocs): Likewise.
3172
3173 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
3174
3175 PR ld/20830
3176 * elf32-i386.c (elf_i386_eh_frame_plt_got): New.
3177 (PLT_GOT_FDE_LENGTH): Likewise.
3178 (elf_i386_plt_layout): Add eh_frame_plt_got and
3179 eh_frame_plt_got_size.
3180 (elf_i386_plt): Updated.
3181 (elf_i386_link_hash_table): Add plt_got_eh_frame.
3182 (elf_i386_check_relocs): Create .eh_frame section for .plt.got.
3183 (elf_i386_size_dynamic_sections): Allocate and initialize
3184 .eh_frame section for .plt.got.
3185 (elf_i386_finish_dynamic_sections): Adjust .eh_frame section for
3186 .plt.got.
3187 (elf_i386_nacl_plt): Add FIXME for eh_frame_plt_got and
3188 eh_frame_plt_got_size.
3189 * elf64-x86-64.c (elf_x86_64_eh_frame_plt_got): New.
3190 (PLT_GOT_FDE_LENGTH): Likewise.
3191 (elf_x86_64_backend_data): Add eh_frame_plt_got and
3192 eh_frame_plt_got_size.
3193 (elf_x86_64_arch_bed): Updated.
3194 (elf_x86_64_bnd_arch_bed): Add FIXME for eh_frame_plt_got and
3195 eh_frame_plt_got_size.
3196 (elf_x86_64_nacl_arch_bed): Likewise.
3197 (elf_x86_64_link_hash_table): Add plt_got_eh_frame.
3198 (elf_x86_64_check_relocs): Create .eh_frame section for .plt.got.
3199 (elf_x86_64_size_dynamic_sections): Allocate and initialize
3200 .eh_frame section for .plt.got.
3201 (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
3202 for .plt.got.
3203
3204 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
3205
3206 * elf32-i386.c (elf_i386_size_dynamic_sections): Set
3207 plt_eh_frame->size to eh_frame_plt_size and use eh_frame_plt.
3208
3209 2017-01-09 Nick Clifton <nickc@redhat.com>
3210
3211 * dwarf2.c (lookup_address_in_function_table): Return early if
3212 there are no functions in the given comp unit, or if the high
3213 address of the last function in the comp unit is less than the
3214 desired address.
3215
3216 2017-01-09 Nick Clifton <nickc@redhat.com>
3217
3218 PR binutils/21013
3219 * coffgen.c (_bfd_coff_get_external_symbols): Generate an error
3220 message if there are too many symbols to load.
3221
3222 2017-01-04 James Clarke <jrtc27@jrtc27.com>
3223
3224 * elf64-alpha.c (elf64_alpha_relax_opt_call): Don't set tsec_free
3225 if relocs are cached.
3226
3227 2017-01-03 Rich Felker <bugdal@aerifal.cx>
3228
3229 PR ld/21017
3230 * elf32-microblaze.c (microblaze_elf_check_relocs): Add an entry
3231 for R_MICROBLAZE_GOTOFF_64.
3232
3233 2017-01-03 Nick Clifton <nickc@redhat.com>
3234
3235 * mach-o.c (bfd_mach_o_lookup_uuid_command): Fix compile time
3236 warning about using a possibly uninitialised variable.
3237
3238 2017-01-02 Alan Modra <amodra@gmail.com>
3239
3240 * elf32-hppa.c (ensure_undef_weak_dynamic): New function.
3241 (allocate_plt_static, allocate_dynrelocs): Use it.
3242
3243 2017-01-02 Alan Modra <amodra@gmail.com>
3244
3245 * elf-hppa.h (elf_hppa_fake_sections): Set SHF_INFO_LINK for
3246 .PARISC.unwind section.
3247
3248 2017-01-02 Alan Modra <amodra@gmail.com>
3249
3250 PR ld/20989
3251 * elfxx-sparc.c (gdop_relative_offset_ok): New function.
3252 (_bfd_sparc_elf_relocate_section): Use it to validate GOT
3253 indirect to GOT pointer relative code edit.
3254
3255 2017-01-02 Alan Modra <amodra@gmail.com>
3256
3257 Update year range in copyright notice of all files.
3258
3259 For older changes see ChangeLog-2016
3260 \f
3261 Copyright (C) 2017 Free Software Foundation, Inc.
3262
3263 Copying and distribution of this file, with or without modification,
3264 are permitted in any medium without royalty provided the copyright
3265 notice and this notice are preserved.
3266
3267 Local Variables:
3268 mode: change-log
3269 left-margin: 8
3270 fill-column: 74
3271 version-control: never
3272 End: