More fixes for bfd_get_section_contents change
[binutils-gdb.git] / bfd / ChangeLog
1 2017-06-27 Alan Modra <amodra@gmail.com>
2
3 PR binutils/21665
4 * libbfd.c (_bfd_generic_get_section_contents): Delete abort.
5 Use unsigned file pointer type, and remove cast.
6 * libbfd.c (_bfd_generic_get_section_contents_in_window): Likewise.
7 Add "count", not "sz".
8
9 2017-06-26 Pedro Alves <palves@redhat.com>
10
11 PR binutils/21665
12 * libbfd.c (_bfd_generic_get_section_contents): Add "count", not
13 "sz".
14
15 2017-06-26 H.J. Lu <hongjiu.lu@intel.com>
16
17 PR binutils/21665
18 * libbfd.c (_bfd_generic_get_section_contents_in_window): Add
19 a missing line.
20
21 2017-06-26 Maciej W. Rozycki <macro@imgtec.com>
22
23 * cpu-mips.c (arch_info_struct): Mark the 4010 32-bit.
24 * elfxx-mips.c (mips_set_isa_flags) <bfd_mach_mips4010>: Set
25 E_MIPS_ARCH_2 rather than E_MIPS_ARCH_3 in `e_flags'.
26 (mips_mach_extensions): Mark `bfd_mach_mips4010' as extending
27 `bfd_mach_mips6000' rather than `bfd_mach_mips4000'.
28
29 2017-06-26 H.J. Lu <hongjiu.lu@intel.com>
30
31 PR binutils/21665
32 * compress.c (bfd_get_full_section_contents): Don't check the
33 file size here.
34 * libbfd.c (_bfd_generic_get_section_contents): Check for and
35 reject a section whoes size + offset is greater than the size
36 of the entire file.
37 (_bfd_generic_get_section_contents_in_window): Likewise.
38
39 2017-06-26 Nick Clifton <nickc@redhat.com>
40
41 PR binutils/21670
42 * tekhex.c (getvalue): Check for the source pointer exceeding the
43 end pointer before the first byte is read.
44
45 2017-06-26 Nick Clifton <nickc@redhat.com>
46
47 PR binutils/21665
48 * opncls.c (get_build_id): Check that the section is beig enough
49 to contain the whole note.
50 * compress.c (bfd_get_full_section_contents): Check for and reject
51 a section whoes size is greater than the size of the entire file.
52 * elf32-v850.c (v850_elf_copy_notes): Allow for the ouput to not
53 contain a notes section.
54
55 2017-06-26 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
56
57 * elf64-s390.c (elf_s390_additional_program_headers): Add NULL
58 pointer checks.
59 (elf_s390_modify_segment_map): Likewise.
60 (bfd_elf_s390_set_options): Lisewise.
61
62 2017-06-26 Alan Modra <amodra@gmail.com>
63
64 * elflink.c (_bfd_elf_link_create_dynstrtab): Don't make dynobj
65 a --just-syms bfd.
66 (_bfd_elf_size_group_sections): Skip --just-syms bfds.
67 (bfd_elf_size_dynamic_sections): Ignore .note.GNU-stack and
68 .preinit_array on --just-syms bfds.
69 (_bfd_elf_gc_mark_extra_sections): Skip --just-syms bfds.
70 (elf_gc_sweep, bfd_elf_parse_eh_frame_entries): Likewise.
71 (bfd_elf_gc_sections, bfd_elf_discard_info): Likewise.
72
73 2017-06-25 Sergei Trofimovich <slyfox@gentoo.org>
74
75 * elf.c (find_link): Bounds check "hint".
76
77 2017-06-24 Thomas Preud'homme <thomas.preudhomme@arm.com>
78
79 * elf32-arm.c (using_thumb_only): Update list of architectures in
80 BFD_ASSERT for which the logic is valid.
81 (using_thumb2_bl): Likewise.
82 (using_thumb2): Likewise and return true for ARMv8-R.
83 (arch_has_arm_nop): Likewise.
84 (tag_cpu_arch_combine): New v8r table for ARMv8-R Tag_CPU_arch
85 merging logic. Update commentis for value 15 of v8m_baseline,
86 v8m_mainline and v4t_plus_v6_m arrays. Use v8r array to decide
87 merging of value 15 of Tag_CPU_arch.
88
89 2017-06-23 Jiong Wang <jiong.wang@arm.com>
90
91 * reloc.c (BFD_RELOC_AARCH64_ADR_GOTPAGE): Rename to
92 BFD_RELOC_AARCH64_ADR_GOT_PAGE
93 * bfd-in2.h: Regenerate.
94
95 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
96
97 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Move
98 the error_alignment label forward. Properly align program
99 property note section.
100
101 2017-06-22 Eric Christopher <echristo@gmail.com>
102
103 * elf32-arm.c (elf32_arm_final_link_relocate): Use labs rather than
104 abs to fix a truncation warning.
105
106 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
107
108 * elf32-i386.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Resolve
109 local undefined weak symbol to 0.
110 * elf64-x86-64.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Likewise.
111
112 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
113
114 * elf32-i386.c (elf_i386_merge_gnu_properties): If info->shstk
115 is set, turn on GNU_PROPERTY_X86_FEATURE_1_SHSTK.
116 (elf_i386_link_setup_gnu_properties): If info->shstk is set,
117 turn on GNU_PROPERTY_X86_FEATURE_1_IBT.
118 * elf64-x86-64.c (elf_x86_64_merge_gnu_properties): If
119 info->shstk is set, turn on GNU_PROPERTY_X86_FEATURE_1_SHSTK.
120 (elf_x86_64_link_setup_gnu_properties): If info->shstk is set,
121 turn on GNU_PROPERTY_X86_FEATURE_1_IBT.
122
123 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
124
125 * elf32-i386.c (elf_i386_lazy_ibt_plt0_entry): New.
126 (elf_i386_lazy_ibt_plt_entry): Likewise.
127 (elf_i386_pic_lazy_ibt_plt0_entry): Likewise.
128 (elf_i386_non_lazy_ibt_plt_entry): Likewise.
129 (elf_i386_pic_non_lazy_ibt_plt_entry): Likewise.
130 (elf_i386_eh_frame_lazy_ibt_plt): Likewise.
131 (elf_i386_lazy_plt_layout): Likewise.
132 (elf_i386_non_lazy_plt_layout): Likewise.
133 (elf_i386_link_hash_entry): Add plt_second.
134 (elf_i386_link_hash_table): Add plt_second and
135 plt_second_eh_frame.
136 (elf_i386_allocate_dynrelocs): Use the second PLT if needed.
137 (elf_i386_size_dynamic_sections): Use .plt.got unwind info for
138 the second PLT. Check the second PLT.
139 (elf_i386_relocate_section): Use the second PLT to resolve
140 PLT reference if needed.
141 (elf_i386_finish_dynamic_symbol): Fill and use the second PLT if
142 needed.
143 (elf_i386_finish_dynamic_sections): Set sh_entsize on the
144 second PLT. Generate unwind info for the second PLT.
145 (elf_i386_plt_type): Add plt_second.
146 (elf_i386_get_synthetic_symtab): Support the second PLT.
147 (elf_i386_parse_gnu_properties): Support
148 GNU_PROPERTY_X86_FEATURE_1_AND.
149 (elf_i386_merge_gnu_properties): Support
150 GNU_PROPERTY_X86_FEATURE_1_AND. If info->ibt is set, turn
151 on GNU_PROPERTY_X86_FEATURE_1_IBT
152 (elf_i386_link_setup_gnu_properties): If info->ibt is set,
153 turn on GNU_PROPERTY_X86_FEATURE_1_IBT. Use IBT-enabled PLT
154 for info->ibtplt, info->ibt or GNU_PROPERTY_X86_FEATURE_1_IBT
155 is set on all relocatable inputs.
156 * elf64-x86-64.c (elf_x86_64_lazy_ibt_plt_entry): New.
157 (elf_x32_lazy_ibt_plt_entry): Likewise.
158 (elf_x86_64_non_lazy_ibt_plt_entry): Likewise.
159 (elf_x32_non_lazy_ibt_plt_entry): Likewise.
160 (elf_x86_64_eh_frame_lazy_ibt_plt): Likewise.
161 (elf_x32_eh_frame_lazy_ibt_plt): Likewise.
162 (elf_x86_64_lazy_ibt_plt): Likewise.
163 (elf_x32_lazy_ibt_plt): Likewise.
164 (elf_x86_64_non_lazy_ibt_plt): Likewise.
165 (elf_x32_non_lazy_ibt_plt): Likewise.
166 (elf_x86_64_get_synthetic_symtab): Support the second PLT.
167 (elf_x86_64_parse_gnu_properties): Support
168 GNU_PROPERTY_X86_FEATURE_1_AND.
169 (elf_x86_64_merge_gnu_properties): Support
170 GNU_PROPERTY_X86_FEATURE_1_AND. If info->ibt is set, turn
171 on GNU_PROPERTY_X86_FEATURE_1_IBT
172 (elf_x86_64_link_setup_gnu_properties): If info->ibt is set,
173 turn on GNU_PROPERTY_X86_FEATURE_1_IBT. Use IBT-enabled PLT
174 for info->ibtplt, info->ibt or GNU_PROPERTY_X86_FEATURE_1_IBT
175 is set on all relocatable inputs.
176
177 2017-06-22 Nick Clifton <nickc@redhat.com>
178
179 PR binutils/21649
180 * som.c (setup_sections): NUL terminate the space_strings buffer.
181 Check that the space.name field does not index beyond the end of
182 the space_strings buffer.
183
184 2017-06-21 Nick Clifton <nickc@redhat.com>
185
186 PR binutils/21646
187 * coff-sh.c (sh_reloc): Check for an out of range reloc.
188
189 2017-06-21 Nick Clifton <nickc@redhat.com>
190
191 PR binutils/21639
192 * vms-misc.c (_bfd_vms_save_sized_string): Use unsigned int as
193 type of the size parameter.
194 (_bfd_vms_save_counted_string): Add second parameter - the maximum
195 length of the counted string.
196 * vms.h (_bfd_vms_save_sized_string): Update prototype.
197 (_bfd_vms_save_counted_string): Likewise.
198 * vms-alpha.c (_bfd_vms_slurp_eisd): Update calls to
199 _bfd_vms_save_counted_string.
200 (_bfd_vms_slurp_ehdr): Likewise.
201 (_bfd_vms_slurp_egsd): Likewise.
202 (Parse_module): Likewise.
203
204 2017-06-21 Alan Modra <amodra@gmail.com>
205
206 * elf64-ppc.c (ppc64_elf_size_stubs): Test for localentry:0 plt
207 calls before tocsave calls.
208 (ppc64_elf_relocate_section): Allow localentry:0 plt calls without
209 following nop.
210
211 2017-06-21 Nick Clifton <nickc@redhat.com>
212
213 PR binutils/21645
214 * reloc.c (bfd_generic_get_relocated_section_contents): Fail if
215 bfd_get_full_section_contents returns no contents.
216
217 2017-06-21 Nick Clifton <nickc@redhat.com>
218
219 PR binutils/21638
220 * vms-alpha.c (_bfd_vms_slurp_egsd): Check for an undersized
221 record.
222
223 2017-06-21 Nick Clifton <nickc@redhat.com>
224
225 PR binutils/21637
226 * vms-alpha.c (_bfd_vms_slurp_egsd): Check for an empty section
227 list.
228 (image_set_ptr): Likewise.
229 (alpha_vms_fix_sec_rel): Likewise.
230 (alpha_vms_slurp_relocs): Likewise.
231
232 2017-06-21 Nick Clifton <nickc@redhat.com>
233
234 PR binutils/21633
235 * ieee.c (ieee_slurp_sections): Check for a NULL return from
236 read_id.
237 (ieee_archive_p): Likewise.
238 (ieee_object_p): Likewise.
239
240 2017-06-21 Nick Clifton <nickc@redhat.com>
241
242 PR binutils/21640
243 * elf.c (setup_group): Zero the group section pointer list after
244 allocation so that loops can be caught. Check for NULL pointers
245 when processing a group list.
246
247 2017-06-20 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
248
249 * elf-s390.h: New file.
250 * elf64-s390.c (struct elf_s390_link_hash_table): Add params
251 field.
252 (elf_s390_additional_program_headers): New function.
253 (elf_s390_modify_segment_map): New function.
254 (bfd_elf_s390_set_options): New function.
255 (elf_backend_additional_program_headers)
256 (elf_backend_modify_segment_map): Add macro definitions.
257
258 2017-06-19 H.J. Lu <hongjiu.lu@intel.com>
259
260 PR ld/21626
261 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Check
262 the DYNAMIC bit instead of bfd_count_sections.
263
264 2017-06-19 Nick Clifton <nickc@redhat.com>
265
266 PR binutils/21618
267 * vms-alpha.c (evax_bfd_print_emh): Check for insufficient record
268 length.
269 (evax_bfd_print_eeom): Likewise.
270 (evax_bfd_print_egsd): Check for an overlarge record length.
271 (evax_bfd_print_etir): Likewise.
272
273 2017-06-19 Nick Clifton <nickc@redhat.com>
274
275 PR binutils/21612
276 * libieee.h (struct common_header_type): Add end_p field.
277 * ieee.c (this_byte_and_next): Do not advance input_p beyond
278 end_p.
279 (read_id): Check for a length that exceeds the remaining bytes in
280 the input buffer.
281 (ieee_seek): Initialise end_p.
282 (ieee_archive_p): Likewise.
283 (ieee_object_p): Likewise.
284
285 2017-06-19 Nick Clifton <nickc@redhat.com>
286
287 PR binutils/21611
288 * vms-alpha.c (_bfd_vms_slurp_eihs): Check for invalid offset
289 before reading the EIHS structure entries.
290
291 2017-06-19 Nick Clifton <nickc@redhat.com>
292
293 PR binutils/21615
294 * vms-alpha.c (_bfd_vms_slurp_egsd): Use unsigned int for
295 gsd_size. Check that there are enough bytes remaining to read the
296 type and size of the next egsd. Check that the size of the egsd
297 does not exceed the size of the record.
298
299 2017-06-19 Alan Modra <amodra@gmail.com>
300
301 * config.bfd: Correct targ_underscore for cris.
302
303 2017-06-18 Alan Modra <amodra@gmail.com>
304
305 * config.bfd: Correct targ_underscore for epiphany, ip2k,
306 m32c, mn10200, pru, rl78, rx, crisv32 and v850.
307
308 2017-06-16 Nick Clifton <nickc@redhat.com>
309
310 * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Do not fail if the
311 bucketlist is empty because there are no symbols to add to the
312 list.
313
314 2017-06-16 Alan Modra <amodra@gmail.com>
315
316 PR ld/20022
317 PR ld/21557
318 PR ld/21562
319 PR ld/21571
320 * targets.c (struct bfd_target): Add _bfd_define_start_stop.
321 (BFD_JUMP_TABLE_LINK): Likewise.
322 * elf-bfd.h (bfd_elf_define_start_stop): Declare.
323 * elflink.c (_bfd_elf_gc_mark_rsec): Update comment.
324 (bfd_elf_define_start_stop): New function.
325 * linker.c (bfd_generic_define_start_stop): New function.
326 * coff64-rs6000.c (rs6000_xcoff64_vec, rs6000_xcoff64_aix_vec): Init
327 new field.
328 * aout-adobe.c (aout_32_bfd_define_start_stop): Define.
329 * aout-target.h (MY_bfd_define_start_stop): Define.
330 * aout-tic30.c (MY_bfd_define_start_stop): Define.
331 * binary.c (binary_bfd_define_start_stop): Define.
332 * bout.c (b_out_bfd_define_start_stop): Define.
333 * coff-alpha.c (_bfd_ecoff_bfd_define_start_stop): Define.
334 * coff-mips.c (_bfd_ecoff_bfd_define_start_stop): Define.
335 * coff-rs6000.c (_bfd_xcoff_bfd_define_start_stop): Define.
336 * coffcode.h (coff_bfd_define_start_stop): Define.
337 * elfxx-target.h (bfd_elfNN_bfd_define_start_stop): Define.
338 * i386msdos.c (msdos_bfd_define_start_stop): Define.
339 * i386os9k.c (os9k_bfd_define_start_stop): Define.
340 * ieee.c (ieee_bfd_define_start_stop): Define.
341 * ihex.c (ihex_bfd_define_start_stop): Define.
342 * libbfd-in.h (_bfd_nolink_bfd_define_start_stop): Define.
343 * mach-o-target.c (bfd_mach_o_bfd_define_start_stop): Define.
344 * mmo.c (mmo_bfd_define_start_stop): Define.
345 * nlm-target.h (nlm_bfd_define_start_stop): Define.
346 * oasys.c (oasys_bfd_define_start_stop): Define.
347 * pef.c (bfd_pef_bfd_define_start_stop): Define.
348 * plugin.c (bfd_plugin_bfd_define_start_stop): Define.
349 * ppcboot.c (ppcboot_bfd_define_start_stop): Define.
350 * som.c (som_bfd_define_start_stop): Define.
351 * srec.c (srec_bfd_define_start_stop): Define.
352 * tekhex.c (tekhex_bfd_define_start_stop): Define.
353 * versados.c (versados_bfd_define_start_stop): Define.
354 * vms-alpha.c (vms_bfd_define_start_stop): Define.
355 (alpha_vms_bfd_define_start_stop): Define.
356 * xsym.c (bfd_sym_bfd_define_start_stop): Define.
357 * bfd-in2.h: Regenerate.
358 * libbfd.h: Regenerate.
359
360 2017-06-16 Jiong Wang <jiong.wang@arm.com>
361
362 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Use
363 SYMBOL_REFERENCES_LOCAL.
364
365 2017-06-15 Jiong Wang <jiong.wang@arm.com>
366
367 PR ld/21532
368 * elfnn-aarch64.c (ELIMINATE_COPY_RELOCS): Set to 1.
369 (elfNN_aarch64_final_link_relocate): Also propagate relocations to
370 runtime for if there needs copy relocation elimination.
371 (need_copy_relocation_p): New function. Return true for symbol with
372 pc-relative references and if it's against read-only sections.
373 (elfNN_aarch64_adjust_dynamic_symbol): Use need_copy_relocation_p.
374 (elfNN_aarch64_check_relocs): Allocate dynrelocs for relocation types
375 that are related with accessing external objects.
376 (elfNN_aarch64_gc_sweep_hook): Sync the relocation types with the change
377 in elfNN_aarch64_check_relocs.
378
379 2017-06-15 Nick Clifton <nickc@redhat.com>
380
381 PR binutils/21582
382 * ieee.c (ieee_object_p): Use a static buffer to avoid compiler
383 bugs.
384 PR binutils/21581
385 (ieee_archive_p): Likewise.
386
387 2017-06-15 Nick Clifton <nickc@redhat.com>
388
389 PR binutils/21579
390 * vms-alpha.c (_bfd_vms_slurp_etir): Extend check of cmd_length.
391
392 2017-06-14 Max Filippov <jcmvbkbc@gmail.com>
393
394 * elf32-xtensa.c (elf_xtensa_be_plt_entry,
395 elf_xtensa_le_plt_entry): Add dimension for the ABI to arrays,
396 keep both windowed and call0 ABI PLT definitions.
397 (elf_xtensa_create_plt_entry): Use selected ABI to choose upper
398 elf_xtensa_*_plt_entry endex.
399 (ELF_MAXPAGESIZE): Fix at minimal supported MMU page size.
400
401 2017-06-14 Nick Clifton <nickc@redhat.com>
402
403 PR binutils/21578
404 * elf32-sh.c (sh_elf_set_mach_from_flags): Fix check for invalid
405 flag value.
406
407 2017-06-14 Nick Clifton <nickc@redhat.com>
408
409 PR binutils/21589
410 * vms-alpha.c (_bfd_vms_get_value): Add an extra parameter - the
411 maximum value for the ascic pointer. Check that name processing
412 does not read beyond this value.
413 (_bfd_vms_slurp_etir): Add checks for attempts to read beyond the
414 end of etir record.
415
416 2017-06-14 Nick Clifton <nickc@redhat.com>
417
418 PR binutils/21591
419 * versados.c (versados_mkobject): Zero the allocated tdata structure.
420 (process_otr): Check for an invalid offset in the otr structure.
421
422 2017-06-14 Sebastian Huber <sebastian.huber@embedded-brains.de>
423
424 * config.bfd (epiphany-*-elf): Accept epiphany-*-*.
425
426 2017-06-13 H.J. Lu <hongjiu.lu@intel.com>
427
428 PR ld/20022
429 PR ld/21557
430 PR ld/21562
431 PR ld/21571
432 * elf-bfd.h (elf_link_hash_entry): Add start_stop. Change the
433 vtable field to a union.
434 (_bfd_elf_is_start_stop): Removed.
435 * elf32-i386.c (elf_i386_convert_load_reloc): Also check for
436 __start_SECNAME and __stop_SECNAME symbols.
437 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Likewise.
438 * elflink.c (_bfd_elf_is_start_stop): Removed.
439 (_bfd_elf_gc_mark_rsec): Check start_stop instead of calling
440 _bfd_elf_is_start_stop.
441 (elf_gc_propagate_vtable_entries_used): Skip __start_SECNAME and
442 __stop_SECNAME symbols. Updated.
443 (elf_gc_smash_unused_vtentry_relocs): Likewise.
444 (bfd_elf_gc_record_vtinherit): Likewise.
445 (bfd_elf_gc_record_vtentry): Likewise.
446
447 2017-06-13 Nick Clifton <nickc@redhat.com>
448
449 PR ld/21524
450 * elflink.c (elf_link_adjust_relocs): Generate an error when
451 encountering a reloc against a symbol removed by garbage
452 collection.
453
454 2017-06-12 H.J. Lu <hongjiu.lu@intel.com>
455
456 * elf-bfd.h (elf_backend_data): Add struct bfd_link_info *
457 to merge_gnu_properties.
458 * elf-properties.c (elf_merge_gnu_properties): Add struct
459 bfd_link_info * and pass it to merge_gnu_properties.
460 (elf_merge_gnu_property_list): Add struct bfd_link_info *
461 and pass it to elf_merge_gnu_properties.
462 (_bfd_elf_link_setup_gnu_properties): Pass info to
463 elf_merge_gnu_property_list.
464 * elf32-i386.c (elf_i386_merge_gnu_properties): Add struct
465 bfd_link_info *.
466 * elf64-x86-64.c (elf_x86_64_merge_gnu_properties): Likewise.
467
468 2017-06-11 Joe Zbiciak <joe.zbiciak@leftturnonly.info>
469
470 PR 21564
471 * binary.c (binary_set_section_contents): Scale lma by octets
472 per byte to set filepos.
473
474 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
475
476 * elf32-arc.c (elf_arc_check_relocs): Fixed conditions to generate
477 dynamic sections.
478
479 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
480
481 * elf32-arc.c (elf_arc_size_dynamic_sections): Changed condition to
482 require TEXTREL.
483
484 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
485
486 * arc-got.h (relocate_fix_got_relocs_for_got_info): Added TCB_SIZE to
487 patched section contents for TLS IE reloc.
488 * elf32-arc.c: Remove TCB_SIZE preprocessor macro.
489
490 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
491
492 * elf32-arc.c (elf_arc_relocate_section): Added "call" to
493 RELOC_FOR_GLOBAL_SYMBOL macro.
494
495 2018-06-08 Cupertino Miranda <cmiranda@synopsys.com>
496
497 * elf32-arc.c (elf_arc_relocate_section): Small refactor and condition
498 changes.
499
500 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
501
502 * config/tc-arc.c (md_undefined_symbol): Changed.
503 * config/tc-arc.h (DYNAMIC_STRUCT_NAME): Removed.
504
505 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
506
507 * elf32-arc.c (elf_arc_relocate_section): Fixed reassign of indirect
508 symbols.
509
510 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
511
512 * elf32-arc.c (elf_arc_check_relocs): Added condition to disable
513 warning and "Bad value" for local symbols ARC_32 or ARC_32_ME relocs.
514
515 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
516
517 * elf32-arc.c (ADD_RELA): Changed to only work when dynamic
518 object is created.
519
520 2017-06-08 Richard Earnshaw <rearnsha@arm.com>
521
522 * elf32-arm.c (elf32_arm_merge_eabi_attributes): Remove assertion
523 that the input bfd has Tag_FP_ARCH non-zero if Tag_ABI_HardFP_use
524 is non-zero. Add clarifying comments.
525
526 2017-06-08 H.J. Lu <hongjiu.lu@intel.com>
527
528 * elf32-i386.c (elf_i386_check_relocs): Set local IFUNC symbol
529 name. Use local IFUNC symbol name string to report unsupported
530 non-PIC call to IFUNC function.
531 (elf_i386_relocate_section): Dump local IFUNC name with minfo
532 when generating R_386_IRELATIVE relocation.
533 (elf_i386_finish_dynamic_symbol): Likewise.
534 * elf_x86_64_check_relocs (elf_x86_64_check_relocs): Set local
535 IFUNC symbol name.
536 (elf_x86_64_relocate_section): Dump local IFUNC name with minfo
537 when generating R_X86_64_IRELATIVE relocation.
538 (elf_x86_64_finish_dynamic_symbol): Likewise.
539
540 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
541
542 * elf.c (setup_group): Make sure BFD sections are created for all
543 group sections in the input file when processing SHF_GROUP
544 sections.
545 (bfd_section_from_shdr): Avoid duplicating logic already
546 implemented in `setup_group'.
547
548 2017-06-06 Daniel Bonniot de Ruisselet <bonniot@gmail.com>
549
550 PR binutils/21546
551 * peXXigen.c (pe_print_idata): Use the address of the first thunk
552 if the hint address is zero.
553
554 2017-06-06 James Clarke <jrtc27@jrtc27.com>
555
556 PR ld/19579
557 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Check
558 ELF_COMMON_DEF_P for common symbols.
559
560 2017-06-06 Andrew Burgess <andrew.burgess@embecosm.com>
561
562 * elf.c (_bfd_elf_make_section_from_shdr): Don't initially mark
563 SEC_GROUP sections as SEC_EXCLUDE.
564 (bfd_elf_set_group_contents): Replace use of abort with an assert.
565 (assign_section_numbers): Use resolve_section_groups flag instead
566 of relocatable link type.
567 (_bfd_elf_init_private_section_data): Use resolve_section_groups
568 flag instead of checking the final_link flag for part of the
569 checks in here. Fix white space as a result.
570 * elflink.c (elf_link_input_bfd): Use resolve_section_groups flag
571 instead of relocatable link type.
572 (bfd_elf_final_link): Likewise.
573
574 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
575
576 * elfxx-mips.c (_bfd_mips_elf_relocate_section): Remove unused
577 variable `bed'.
578 * elf32-score.c (score_elf_final_link_relocate): Likewise.
579 (s3_bfd_score_elf_check_relocs): Likewise.
580 * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
581 (score_elf_final_link_relocate): Likewise.
582 (s7_bfd_score_elf_check_relocs): Likewise.
583
584 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
585
586 * elflink.c (init_reloc_cookie_rels): Remove unused variable
587 `bed'.
588
589 2017-06-06 Maciej W. Rozycki <macro@imgtec.com>
590
591 * elf-bfd.h (RELOC_AGAINST_DISCARDED_SECTION): Subtract `count'
592 from `reloc_count' rather than decrementing it.
593 * elf.c (bfd_section_from_shdr): Multiply the adjustment to
594 `reloc_count' by `int_rels_per_ext_rel'.
595 * elf32-score.c (score_elf_final_link_relocate): Do not multiply
596 `reloc_count' by `int_rels_per_ext_rel' for last relocation
597 entry determination.
598 (s3_bfd_score_elf_check_relocs): Likewise.
599 * elf32-score7.c (score_elf_final_link_relocate): Likewise.
600 (s7_bfd_score_elf_relocate_section): Likewise.
601 (s7_bfd_score_elf_check_relocs): Likewise.
602 * elf64-mips.c (mips_elf64_get_reloc_upper_bound): Remove
603 prototype and function.
604 (mips_elf64_slurp_one_reloc_table): Do not update `reloc_count'.
605 (mips_elf64_slurp_reloc_table): Assert that `reloc_count' is
606 triple rather than once the sum of REL and RELA relocation entry
607 counts.
608 (bfd_elf64_get_reloc_upper_bound): Remove macro.
609 * elflink.c (_bfd_elf_link_read_relocs): Do not multiply
610 `reloc_count' by `int_rels_per_ext_rel' for internal relocation
611 storage allocation size determination.
612 (elf_link_input_bfd): Multiply `.ctors' and `.dtors' section's
613 size by `int_rels_per_ext_rel'. Do not multiply `reloc_count'
614 by `int_rels_per_ext_rel' for last relocation entry
615 determination.
616 (bfd_elf_final_link): Do not multiply `reloc_count' by
617 `int_rels_per_ext_rel' for internal relocation storage
618 allocation size determination.
619 (init_reloc_cookie_rels): Do not multiply `reloc_count' by
620 `int_rels_per_ext_rel' for last relocation entry determination.
621 (elf_gc_smash_unused_vtentry_relocs): Likewise.
622 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
623 (_bfd_mips_elf_relocate_section): Likewise.
624
625 2017-06-05 Alan Modra <amodra@gmail.com>
626
627 PR 21529
628 * linker.c (_bfd_generic_link_output_symbols): Handle BSF_GNU_UNIQUE.
629
630 2017-06-01 John Baldwin <jhb@FreeBSD.org>
631
632 * elf.c (elfcore_grok_freebsd_psinfo): Use ELF header class to
633 determine structure sizes.
634 (elfcore_grok_freebsd_prstatus): Likewise.
635
636 2017-06-01 Alan Modra <amodra@gmail.com>
637
638 * elf64-ppc.c (struct ppc_link_hash_table): Add has_plt_localentry0.
639 (ppc64_elf_merge_symbol_attribute): Merge localentry bits from
640 dynamic objects.
641 (is_elfv2_localentry0): New function.
642 (ppc64_elf_tls_setup): Default params->plt_localentry0.
643 (plt_stub_size): Adjust size for tls_get_addr_opt stub.
644 (build_tls_get_addr_stub): Use a simpler stub when r2 is not saved.
645 (ppc64_elf_size_stubs): Leave stub_type as ppc_stub_plt_call for
646 optimized localentry:0 stubs.
647 (ppc64_elf_build_stubs): Save r2 in ELFv2 __glink_PLTresolve.
648 (ppc64_elf_relocate_section): Leave nop unchanged for optimized
649 localentry:0 stubs.
650 (ppc64_elf_finish_dynamic_sections): Set PPC64_OPT_LOCALENTRY in
651 DT_PPC64_OPT.
652 * elf64-ppc.h (struct ppc64_elf_params): Add plt_localentry0.
653
654 2017-05-30 Casey Smith <clegg89@gmail.com>
655
656 PR ld/21523
657 * elf32-arm.c (elf32_arm_final_link_relocate): Install an absolute
658 value when processing the R_ARM_THM_ALU_PREL_11_0 reloc.
659
660 2017-05-30 Anton Kolesov Anton.Kolesov@synopsys.com
661
662 * cpu-arc.c (arc_compatible): New function.
663
664 2017-05-30 Anton Kolesov <anton.kolesov@synopsys.com>
665
666 * cpu-arc.c (arch_info_struct): Remove duplicate ARC600 entry.
667
668 2017-05-30 H.J. Lu <hongjiu.lu@intel.com>
669
670 PR binutils/21519
671 * bfdio.c (bfd_get_file_size): New function.
672 * bfd-in2.h: Regenerated.
673
674 2017-05-23 Dilian Palauzov <git-dpa@aegee.org>
675
676 * elf32-arc.c (arc_elf_merge_attributes): Add fall through
677 comments.
678
679 2017-05-22 H.J. Lu <hongjiu.lu@intel.com>
680
681 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Use
682 dynobj instead of htab->elf.dynobj.
683
684 2017-05-19 Maciej W. Rozycki <macro@imgtec.com>
685
686 * elf64-mips.c (mips_elf64_canonicalize_reloc): Remove prototype
687 and function.
688 (mips_elf64_canonicalize_dynamic_reloc): Likewise.
689 (mips_elf64_slurp_one_reloc_table): Set `reloc_count' to the
690 actual number of internal relocations retrieved. Adjust
691 function description.
692 (bfd_elf64_canonicalize_reloc): Remove macro.
693 (bfd_elf64_canonicalize_dynamic_reloc): Likewise.
694
695 2017-05-19 Jose E. Marchesi <jose.marchesi@oracle.com>
696
697 * archures.c (bfd_mach_sparc_v9m8): Define.
698 (bfd_mach_sparc_v8plusm8): Likewise.
699 (bfd_mach_sparc_v9_p): Adjust to M8.
700 (bfd_mach_sparc_64bit_p): Likewise.
701 * aoutx.h (machine_type): Handle bfd_mach_sparc_v9m8 and
702 bfd_mach_sparc_v8plusm8.
703 * bfd-in2.h: Regenerated.
704 * cpu-sparc.c (arch_info_struct): Entries for sparc:v9m8 and
705 sparc:v8plusm8.
706 * elfxx-sparc.c (_bfd_sparc_elf_object_p): Handle
707 bfd_mach_sparc_v8plusm8 and bfd_mach_sparc_v9m8 using the new hw
708 capabilities ONADDSUB, ONMUL, ONDIV, DICTUNP, FPCPSHL, RLE and
709 SHA3.
710 * elf32-sparc.c (elf32_sparc_final_write_processing): Handle
711 bfd_mach_sparc_v8plusm8.
712
713 2017-05-19 Alan Modra <amodra@gmail.com>
714
715 * elflink.c (_bfd_elf_gc_mark_extra_sections): Don't keep
716 debug and special sections when no non-note alloc sections in an
717 object are kept.
718
719 2017-05-18 Alan Modra <amodra@gmail.com>
720
721 * arc-got.h: Don't compare boolean values against TRUE or FALSE.
722 * elf-m10300.c: Likewise.
723 * elf.c: Likewise.
724 * elf32-arc.c: Likewise.
725 * elf32-bfin.c: Likewise.
726 * elf32-m68k.c: Likewise.
727 * elf32-nds32.c: Likewise.
728 * elf32-tilepro.c: Likewise.
729 * elflink.c: Likewise.
730 * elfnn-aarch64.c: Likewise.
731 * elfnn-riscv.c: Likewise.
732 * elfxx-tilegx.c: Likewise.
733 * mach-o.c: Likewise.
734 * peXXigen.c: Likewise.
735 * vms-alpha.c: Likewise.
736 * vms-lib.c: Likewise.
737
738 2017-05-17 H.J. Lu <hongjiu.lu@intel.com>
739
740 PR ld/20882
741 * elflink.c (elf_gc_mark_debug_section): New function.
742 (_bfd_elf_gc_mark_extra_sections): Mark any debug sections
743 referenced by kept debug sections.
744
745 2017-05-16 Alan Modra <amodra@gmail.com>
746
747 * elf-m10300.c: Rename occurrences of non_ir_ref.
748 * elf32-arm.c: Likewise.
749 * elf32-bfin.c: Likewise.
750 * elf32-cr16.c: Likewise.
751 * elf32-cris.c: Likewise.
752 * elf32-d10v.c: Likewise.
753 * elf32-dlx.c: Likewise.
754 * elf32-fr30.c: Likewise.
755 * elf32-frv.c: Likewise.
756 * elf32-hppa.c: Likewise.
757 * elf32-i370.c: Likewise.
758 * elf32-i386.c: Likewise.
759 * elf32-iq2000.c: Likewise.
760 * elf32-lm32.c: Likewise.
761 * elf32-m32c.c: Likewise.
762 * elf32-m32r.c: Likewise.
763 * elf32-m68hc1x.c: Likewise.
764 * elf32-m68k.c: Likewise.
765 * elf32-mcore.c: Likewise.
766 * elf32-metag.c: Likewise.
767 * elf32-microblaze.c: Likewise.
768 * elf32-moxie.c: Likewise.
769 * elf32-msp430.c: Likewise.
770 * elf32-mt.c: Likewise.
771 * elf32-nios2.c: Likewise.
772 * elf32-or1k.c: Likewise.
773 * elf32-ppc.c: Likewise.
774 * elf32-rl78.c: Likewise.
775 * elf32-s390.c: Likewise.
776 * elf32-score.c: Likewise.
777 * elf32-score7.c: Likewise.
778 * elf32-sh.c: Likewise.
779 * elf32-tic6x.c: Likewise.
780 * elf32-tilepro.c: Likewise.
781 * elf32-v850.c: Likewise.
782 * elf32-vax.c: Likewise.
783 * elf32-xstormy16.c: Likewise.
784 * elf32-xtensa.c: Likewise.
785 * elf64-alpha.c: Likewise.
786 * elf64-hppa.c: Likewise.
787 * elf64-ia64-vms.c: Likewise.
788 * elf64-mmix.c: Likewise.
789 * elf64-ppc.c: Likewise.
790 * elf64-s390.c: Likewise.
791 * elf64-sh64.c: Likewise.
792 * elf64-x86-64.c: Likewise.
793 * elflink.c: Likewise.
794 * elfnn-aarch64.c: Likewise.
795 * elfnn-ia64.c: Likewise.
796 * elfnn-riscv.c: Likewise.
797 * elfxx-mips.c: Likewise.
798 * elfxx-sparc.c: Likewise.
799 * elfxx-tilegx.c: Likewise.
800 * linker.c: Likewise.
801
802 2017-05-16 Alan Modra <amodra@gmail.com>
803
804 * elf64-ppc.c (add_symbol_adjust): Transfer non_ir_ref_dynamic.
805 * elflink.c (elf_link_add_object_symbols): Update to use
806 non_ir_ref_dynamic.
807 (elf_link_input_bfd): Test non_ir_ref_dynamic in addition to
808 non_ir_ref.
809 * linker.c (_bfd_generic_link_add_one_symbol): Likewise.
810
811 2017-05-15 Maciej W. Rozycki <macro@imgtec.com>
812
813 * elfxx-mips.c (print_mips_ases): Handle MIPS16e2 ASE.
814
815 2017-05-12 H.J. Lu <hongjiu.lu@intel.com>
816
817 * elf32-i386.c (elf_i386_parse_gnu_properties): Merge
818 GNU_PROPERTY_X86_ISA_1_USED and GNU_PROPERTY_X86_ISA_1_NEEDED
819 properties.
820 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
821
822 2017-05-11 H.J. Lu <hongjiu.lu@intel.com>
823
824 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Rename plt_bnd
825 to plt_second.
826 (elf_x86_64_link_hash_table): Rename plt_bnd/plt_bnd_eh_frame
827 to plt_second/plt_second_eh_frame.
828 (elf_x86_64_link_hash_newfunc): Updated.
829 (elf_x86_64_allocate_dynrelocs): Likewise.
830 (elf_x86_64_size_dynamic_sections): Likewise.
831 (elf_x86_64_relocate_section): Likewise.
832 (elf_x86_64_finish_dynamic_symbol): Likewise.
833 (elf_x86_64_finish_dynamic_sections): Likewise.
834 (elf_x86_64_plt_type): Rename plt_bnd to plt_second.
835 (elf_x86_64_get_synthetic_symtab): Updated. Also scan the
836 .plt.sec section.
837 (elf_backend_setup_gnu_properties): Updated. Create the
838 .plt.sec section instead of the .plt.sec section.
839
840 2017-05-11 H.J. Lu <hongjiu.lu@intel.com>
841
842 * elf32-i386.c (elf_i386_allocate_dynrelocs): Partially revert
843 commit 25070364b0ce33eed46aa5d78ebebbec6accec7e.
844 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewse.
845
846 2017-05-10 Jose E. Marchesi <jose.marchesi@oracle.com>
847
848 * elf64-sparc.c (elf64_sparc_set_reloc): New function.
849 (bfd_elf64_set_reloc): Define.
850 (elf64_sparc_write_relocs): Use `canon_reloc_count'.
851
852 2017-05-10 Jose E. Marchesi <jose.marchesi@oracle.com>
853
854 * targets.c (BFD_JUMP_TABLE_RELOCS): Add NAME##_set_reloc.
855 (struct bfd_target): New field _bfd_set_reloc.
856 * bfd.c (bfd_set_reloc): Call backend _set_bfd.
857 * reloc.c (_bfd_generic_set_reloc): New function.
858 * coffcode.h (coff_set_reloc): Define to _bfd_generic_set_reloc.
859 * nlm-target.h (nlm_set_reloc): Likewise.
860 * coff-rs6000.c (_bfd_xcoff_set_reloc): Likewise.
861 * aout-tic30.c (MY_set_reloc): Likewise.
862 * aout-target.h (MY_set_reloc): Likewise.
863 * elfxx-target.h (bfd_elfNN_set_reloc): Likewise.
864 * coff-alpha.c (_bfd_ecoff_set_reloc): Likewise.
865 * mach-o-target.c (bfd_mach_o_set_reloc): Likewise.
866 * vms-alpha.c (alpha_vms_set_reloc): Likewise.
867 * aout-adobe.c (aout_32_set_reloc): Likewise.
868 * bout.c (b_out_set_reloc): Likewise.
869 * coff-mips.c (_bfd_ecoff_set_reloc): Likewise.
870 * i386os9k.c (aout_32_set_reloc): Likewise.
871 * ieee.c (ieee_set_reloc): Likewise.
872 * oasys.c (oasys_set_reloc): Likewise.
873 * som.c (som_set_reloc): Likewise.
874 * versados.c (versados_set_reloc): Likewise.
875 * coff64-rs6000.c (rs6000_xcoff64_vec): Add
876 _bfd_generic_set_reloc.
877 (rs6000_xcoff64_aix_vec): LIkewise.
878 * libbfd.c (_bfd_norelocs_set_reloc): New function.
879 * libbfd-in.h: Prototype for _bfd_norelocs_set_reloc.
880 * i386msdos.c (msdos_set_reloc): Define to
881 _bfd_norelocs_set_reloc.
882 * elfcode.h (elf_set_reloc): Define.
883 * bfd-in2.h: Regenerated.
884
885 2017-05-10 H.J. Lu <hongjiu.lu@intel.com>
886
887 PR ld/21481
888 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Use .plt.bnd
889 for IFUNC function address.
890
891 2017-05-10 Claudiu Zissulescu <claziss@synopsys.com>
892
893 * elf32-arc.c (FEATURE_LIST_NAME): Define.
894 (CONFLICT_LIST): Likewise.
895 (opcode/arc-attrs.h): Include.
896 (arc_elf_print_private_bfd_data): Print OSABI v4 flag.
897 (arc_extract_features): New file.
898 (arc_stralloc): Likewise.
899 (arc_elf_merge_attributes): Likewise.
900 (arc_elf_merge_private_bfd_data): Use object attributes.
901 (bfd_arc_get_mach_from_attributes): New function.
902 (arc_elf_object_p): Use object attributes.
903 (arc_elf_final_write_processing): Likewise.
904 (elf32_arc_obj_attrs_arg_type): New function.
905 (elf32_arc_obj_attrs_handle_unknown): Likewise.
906 (elf32_arc_section_from_shdr): Likewise.
907 (elf_backend_obj_attrs_vendor): Define.
908 (elf_backend_obj_attrs_section): Likewise.
909 (elf_backend_obj_attrs_arg_type): Likewise.
910 (elf_backend_obj_attrs_section_type): Likewise.
911 (elf_backend_obj_attrs_handle_unknown): Likewise.
912 (elf_backend_section_from_shdr): Likewise.
913
914 2017-05-09 Andrew Goedhart <Andrewgoedhart@simplepowersolutions.co.za>
915
916 PR ld/21458
917 * elf32-arm.c (elf32_arm_final_link_relocate): Set the bottom bit
918 of the value when resolving a R_ARM_THM_ALU_PREL_11_0 relocation
919 and the destination is a Thumb symbol.
920
921 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
922
923 * elf32-i386.c (elf_i386_get_synthetic_symtab): Add missing
924 initializer to silence GCC 4.2.
925 * lf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
926
927 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
928
929 * elf64-x86-64.c (PLT_ENTRY_SIZE): Renamed to ...
930 (LAZY_PLT_ENTRY_SIZE): This.
931 (NON_LAZY_PLT_ENTRY_SIZE): New.
932 (elf_x86_64_plt0_entry): Renamed to ...
933 (elf_x86_64_lazy_plt0_entry): This.
934 (elf_x86_64_plt_entry): Renamed to ...
935 (elf_x86_64_lazy_plt_entry): This.
936 (elf_x86_64_bnd_plt0_entry): Renamed to ...
937 (elf_x86_64_lazy_bnd_plt0_entry): This.
938 (elf_x86_64_legacy_plt_entry): Removed.
939 (elf_x86_64_bnd_plt_entry): Renamed to ...
940 (elf_x86_64_lazy_bnd_plt_entry): This.
941 (elf_x86_64_legacy_plt2_entry): Renamed to ...
942 (elf_x86_64_non_lazy_plt_entry): This.
943 (elf_x86_64_bnd_plt2_entry): Renamed to ...
944 (elf_x86_64_non_lazy_bnd_plt_entry): This.
945 (elf_x86_64_eh_frame_plt): Renamed to ...
946 (elf_x86_64_eh_frame_lazy_plt): This.
947 (elf_x86_64_eh_frame_bnd_plt): Renamed to ...
948 (elf_x86_64_eh_frame_lazy_bnd_plt): This.
949 (elf_x86_64_eh_frame_plt_got): Renamed to ...
950 (elf_x86_64_eh_frame_non_lazy_plt): This.
951 (elf_x86_64_lazy_plt_layout): New.
952 (elf_x86_64_non_lazy_plt_layout): Likewise.
953 (elf_x86_64_plt_layout): Likewise.
954 (elf_x86_64_backend_data): Remove PLT layout information. Add
955 os for target system.
956 (GET_PLT_ENTRY_SIZE): Removed.
957 (elf_x86_64_lazy_plt): New.
958 (elf_x86_64_non_lazy_plt): Likewise.
959 (elf_x86_64_lazy_bnd_plt): Likewise.
960 (elf_x86_64_non_lazy_bnd_plt): Likewise.
961 (elf_x86-64_arch_bed): Updated.
962 (elf_x86_64_link_hash_table): Add plt, lazy_plt and non_lazy_plt.
963 (elf_x86_64_create_dynamic_sections): Removed.
964 (elf_x86_64_check_relocs): Don't check elf.dynobj. Don't call
965 _bfd_elf_create_ifunc_sections nor _bfd_elf_create_got_section.
966 (elf_x86-64_adjust_dynamic_symbol): Updated.
967 (elf_x86_64_allocate_dynrelocs): Updated. Pass 0 as PLT header
968 size to _bfd_elf_allocate_ifunc_dyn_relocs and don't allocate
969 size for PLT0 if there is no PLT0. Get plt_entry_size from
970 non_lazy_plt for non-lazy PLT entries.
971 (elf_x86_64_size_dynamic_sections): Updated. Get plt_entry_size
972 from non_lazy_plt for non-lazy PLT entries.
973 (elf_x86-64_relocate_section): Updated. Properly get PLT index
974 if there is no PLT0.
975 (elf_x86_64_finish_dynamic_symbol): Updated. Fill the first slot
976 in the PLT entry with generic PLT layout. Fill the non-lazy PLT
977 entries with non-lazy PLT layout. Don't fill the second and third
978 slots in the PLT entry if there is no PLT0.
979 (elf_x86_64_finish_dynamic_sections): Updated. Don't fill PLT0
980 if there is no PLT0. Set sh_entsize on the .plt.got section.
981 (compare_relocs): New.
982 (elf_x86_64_plt_type): Likewise.
983 (elf_x86_64_plt): Likewise.
984 (elf_x86_64_nacl_plt): New. Forward declaration.
985 (elf_x86_64_get_plt_sym_val): Removed.
986 (elf_x86_64_get_synthetic_symtab): Rewrite to check PLT sections
987 against all dynamic relocations.
988 (elf_x86_64_link_setup_gnu_properties): New function.
989 (elf_backend_create_dynamic_sections): Updated.
990 (elf_backend_setup_gnu_properties): New.
991 (elf_x86_64_nacl_plt): New.
992 (elf_x86_64_nacl_arch_bed): Updated.
993
994 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
995
996 * elf32-i386.c (PLT_ENTRY_SIZE): Renamed to ...
997 (LAZY_PLT_ENTRY_SIZE): This.
998 (NON_LAZY_PLT_ENTRY_SIZE): New.
999 (elf_i386_plt0_entry): Renamed to ...
1000 (elf_i386_lazy_plt0_entry): This.
1001 (elf_i386_plt_entry): Renamed to ...
1002 (elf_i386_lazy_plt_entry): This.
1003 (elf_i386_pic_plt0_entry): Renamed to ...
1004 (elf_i386_pic_lazy_plt0_entry): This.
1005 (elf_i386_pic_plt_entry): Renamed to ...
1006 (elf_i386_pic_lazy_plt_entry): This.
1007 (elf_i386_got_plt_entry): Renamed to ...
1008 (elf_i386_non_lazy_plt_entry): This.
1009 (elf_i386_pic_got_plt_entry): Renamed to ...
1010 (elf_i386_pic_non_lazy_plt_entry): This.
1011 (elf_i386_eh_frame_plt): Renamed to ...
1012 (elf_i386_eh_frame_lazy_plt): This.
1013 (elf_i386_eh_frame_plt_got): Renamed to ...
1014 (elf_i386_eh_frame_non_lazy_plt): This.
1015 (elf_i386_plt_layout): Renamed to ...
1016 (elf_i386_lazy_plt_layout): This. Remove eh_frame_plt_got and
1017 eh_frame_plt_got_size.
1018 (elf_i386_non_lazy_plt_layout): New.
1019 (elf_i386_plt_layout): Likewise.
1020 (elf_i386_non_lazy_plt): Likewise.
1021 (GET_PLT_ENTRY_SIZE): Removed.
1022 (elf_i386_plt): Renamed to ...
1023 (elf_i386_lazy_plt): This.
1024 (elf_i386_backend_data): Remove plt. Rename is_vxworks to os.
1025 (elf_i386_arch_bed): Updated.
1026 (elf_i386_link_hash_table): Add plt, lazy_plt and non_lazy_plt.
1027 (elf_i386_create_dynamic_sections): Removed.
1028 (elf_i386_check_relocs): Don't check elf.dynobj. Don't call
1029 _bfd_elf_create_ifunc_sections nor _bfd_elf_create_got_section.
1030 (elf_i386_adjust_dynamic_symbol): Updated.
1031 (elf_i386_allocate_dynrelocs): Updated. Pass 0 as PLT header
1032 size to _bfd_elf_allocate_ifunc_dyn_relocs and don't allocate
1033 size for PLT0 if there is no PLT0.
1034 (elf_i386_size_dynamic_sections): Updated. Check whether GOT
1035 output section is discarded only if GOT isn't empty.
1036 (elf_i386_relocate_section): Updated. Properly get PLT index
1037 if there is no PLT0.
1038 (elf_i386_finish_dynamic_symbol): Updated. Don't fill the
1039 second and third slots in the PLT entry if there is no PLT0.
1040 (elf_i386_finish_dynamic_sections): Updated. Don't fill PLT0
1041 if there is no PLT0. Set sh_entsize on the .plt.got section.
1042 (elf_i386_nacl_plt): Forward declaration.
1043 (elf_i386_get_plt_sym_val): Removed.
1044 (elf_i386_get_synthetic_symtab): Rewrite to check PLT sections
1045 against all dynamic relocations.
1046 (elf_i386_link_setup_gnu_properties): New function.
1047 (elf_backend_create_dynamic_sections): Updated.
1048 (elf_backend_setup_gnu_properties): New.
1049 (elf_i386_nacl_plt): Updated.
1050 (elf_i386_nacl_arch_bed): Likewise.
1051 (elf_i386_vxworks_arch_bed): Likewise.
1052
1053 2017-05-08 Thomas Preud'homme <thomas.preudhomme@arm.com>
1054
1055 * elflink.c (elf_output_implib): Remove executable flag from import
1056 library bfd.
1057 * elf32-arm.c (elf32_arm_filter_implib_symbols): Assert that the import
1058 library is a relocatable object file.
1059
1060 2017-05-01 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
1061
1062 PR ld/21404
1063 * elf32-avr.c (avr_should_move_sym): New function.
1064 (avr_should_reduce_sym_size): Likewise.
1065 (avr_should_increase_sym_size): Likewise.
1066 (elf32_avr_relax_delete_bytes): Adjust symbol values
1067 and sizes by calling new functions.
1068
1069 2017-05-01 Palmer Dabbelt <palmer@dabbelt.com>
1070
1071 * config.bfd (riscv32-*): Enable rv64.
1072
1073 2017-05-02 Alan Modra <amodra@gmail.com>
1074
1075 PR 21384
1076 * elflink.c (bfd_elf_link_mark_dynamic_symbol): Test h->non_elf
1077 rather than h->root.type == bfd_link_hash_new.
1078 (bfd_elf_record_link_assignment): Similarly, call
1079 bfd_elf_link_mark_dynamic_symbol when h->non_elf.
1080
1081 2017-04-29 Alan Modra <amodra@gmail.com>
1082
1083 PR 21432
1084 * reloc.c (reloc_offset_in_range): New function.
1085 (bfd_perform_relocation, bfd_install_relocation): Use it.
1086 (_bfd_final_link_relocate): Likewise.
1087
1088 2017-04-28 H.J. Lu <hongjiu.lu@intel.com>
1089
1090 * elf32-i386.c (elf_i386_allocate_dynrelocs): Check plt_got
1091 before using .plt.got.
1092 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise.
1093
1094 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
1095
1096 * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Use "="
1097 instead of "+=" to update 0.
1098
1099 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
1100
1101 * elf32-i386.c (elf_i386_create_dynamic_sections): Create the
1102 .plt.got section here.
1103 (elf_i386_check_relocs): Don't create the .plt.got section.
1104 * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Create
1105 the .plt.got and .plt.bnd sections here.
1106 (elf_x86_64_check_relocs): Don't create the .plt.got nor
1107 .plt.bnd sections.
1108
1109 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
1110
1111 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Remove
1112 has_bnd_reloc.
1113 (elf_x86_64_link_hash_newfunc): Don't clear has_bnd_reloc.
1114 (elf_x86_64_copy_indirect_symbol): Don't copy has_bnd_reloc.
1115 (elf_x86_64_check_relocs): Don't set has_bnd_reloc.
1116 (elf_x86_64_finish_dynamic_symbol): Check bndplt instead of
1117 has_bnd_reloc.
1118
1119 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
1120
1121 * elf-bfd.h (elf_backend_data): Change setup_gnu_properties
1122 to return bfd *.
1123 (_bfd_elf_link_setup_gnu_properties): Return bfd *.
1124 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Return
1125 the first relocatable ELF input with GNU properties.
1126
1127 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
1128
1129 * elf32-i386.c (elf_i386_finish_dynamic_sections): Simplify
1130 VxWorks for non-PIC.
1131
1132 2017-04-27 Alan Modra <amodra@gmail.com>
1133
1134 * elf-bfd.h (struct elf_backend_data): Make asection param of
1135 elf_backend_eh_frame_address_size const.
1136 (_bfd_elf_eh_frame_address_size): Likewise.
1137 * elf32-m32c.c (_bfd_m32c_elf_eh_frame_address_size): Likewise.
1138 * elf32-msp430.c (elf32_msp430_eh_frame_address_size): Likewise.
1139 * elfxx-mips.c (_bfd_mips_elf_eh_frame_address_size): Likewise.
1140 * elfxx-mips.h (_bfd_mips_elf_eh_frame_address_size): Likewise.
1141 * elf-eh-frame.c (_bfd_elf_eh_frame_address_size): Likewise.
1142 (next_cie_fde_offset): Constify params.
1143 (offset_adjust, adjust_eh_frame_local_symbols): Likewise.
1144
1145 2017-04-27 Alan Modra <amodra@gmail.com>
1146
1147 * elf-bfd.h (struct eh_cie_fde): Add aug_str_len and aug_data_len.
1148 (_bfd_elf_adjust_eh_frame_global_symbol): Declare.
1149 * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Set aug_str_len and
1150 aug_data_len.
1151 (offset_adjust): New function.
1152 (_bfd_elf_adjust_eh_frame_global_symbol): Likewise.
1153 (adjust_eh_frame_local_symbols): Likewise.
1154 (_bfd_elf_discard_section_eh_frame): Call adjust_eh_frame_local_symbols
1155 after changing anything. Return true if anything changed.
1156 * elflink.c (bfd_elf_discard_info): If .eh_frame changed, call
1157 _bfd_elf_adjust_eh_frame_global_symbol for globals.
1158
1159 2017-04-27 Alan Modra <amodra@gmail.com>
1160
1161 * elflink.c (_bfd_elf_link_hash_hide_symbol): Clear dynstr_index
1162 when force_local.
1163
1164 2017-04-27 Alan Modra <amodra@gmail.com>
1165
1166 * elf32-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
1167 (ppc_elf_select_plt_layout, ppc_elf_tls_setup): Use it.
1168 (ppc_elf_adjust_dynamic_symbol, allocate_dynrelocs): Likewise.
1169 (ppc_elf_relocate_section): Likewise. Delete silly optimisation
1170 for undef and undefweak dyn_relocs.
1171 * elf64-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
1172 (ppc64_elf_adjust_dynamic_symbol, ppc64_elf_tls_setup): Use it.
1173 (allocate_got, allocate_dynrelocs): Likewise.
1174 (ppc64_elf_relocate_section): Likewise.
1175
1176 2017-04-26 H.J. Lu <hongjiu.lu@intel.com>
1177
1178 * elf32-i386.c (elf_i386_size_dynamic_sections): Alwasys add
1179 DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rel.plt section.
1180 * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Alwasys
1181 add DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rela.plt section.
1182
1183 2017-04-26 Nick Clifton <nickc@redhat.com>
1184
1185 PR binutils/21434
1186 * reloc.c (bfd_perform_relocation): Check for a negative address
1187 in the reloc.
1188
1189 2017-04-26 Maciej W. Rozycki <macro@imgtec.com>
1190
1191 PR ld/21334
1192 * elf-bfd.h (elf_backend_data): Add `always_renumber_dynsyms'
1193 member.
1194 * elfxx-target.h [!elf_backend_always_renumber_dynsyms]
1195 (elf_backend_always_renumber_dynsyms): Define.
1196 (elfNN_bed): Initialize `always_renumber_dynsyms' member.
1197 * elfxx-mips.h (elf_backend_always_renumber_dynsyms): Define.
1198 * elflink.c (bfd_elf_size_dynamic_sections): Also call
1199 `_bfd_elf_link_renumber_dynsyms' if the backend has requested
1200 it.
1201 (bfd_elf_size_dynsym_hash_dynstr): Likewise.
1202
1203 2017-04-26 Maciej W. Rozycki <macro@imgtec.com>
1204
1205 * elflink.c (bfd_elf_size_dynamic_sections): Only call
1206 `_bfd_elf_link_renumber_dynsyms' after section GC if dynamic
1207 sections have been created.
1208
1209 2017-04-26 Nick Clifton <nickc@redhat.com>
1210
1211 PR binutils/21431
1212 * compress.c (bfd_init_section_compress_status): Check the return
1213 value from bfd_malloc.
1214
1215 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
1216
1217 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Add
1218 no_finish_dynamic_symbol.
1219 (elf_x86_64_link_hash_newfunc): Set no_finish_dynamic_symbol to
1220 0.
1221 (elf_x86_64_allocate_dynrelocs): If a symbol isn't undefined
1222 weak symbol, don't make it dynamic.
1223 (elf_x86_64_relocate_section): If a symbol isn't dynamic in PIC,
1224 set no_finish_dynamic_symbol and generate R_X86_64_RELATIVE
1225 relocation for GOT reference.
1226 (elf_x86_64_finish_dynamic_symbol): Abort if
1227 no_finish_dynamic_symbol isn't 0.
1228
1229 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
1230
1231 PR ld/21402
1232 * elf32-i386.c (elf_i386_allocate_dynrelocs): If a symbol isn't
1233 undefined weak symbol, don't make it dynamic.
1234 (elf_i386_relocate_section): If a symbol isn't dynamic in PIC,
1235 set no_finish_dynamic_symbol and generate R_386_RELATIVE
1236 relocation for R_386_GOT32.
1237
1238 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
1239
1240 PR ld/21425
1241 * elf32-i386.c (ELF_MAXPAGESIZE): Set to 0x1000 for VxWorks.
1242
1243 2017-04-23 Alan Modra <amodra@gmail.com>
1244
1245 PR 21414
1246 * section.c (GLOBAL_SYM_INIT): Make available in bfd.h.
1247 * elf.c (lcomm_sym): New.
1248 (_bfd_elf_large_com_section): Use lcomm_sym section symbol.
1249 * bfd-in2.h: Regenerate.
1250
1251 2017-04-23 Alan Modra <amodra@gmail.com>
1252
1253 PR 21412
1254 * elf-bfd.h (struct elf_backend_data <get_reloc_section>): Change
1255 parameters and comment.
1256 (_bfd_elf_get_reloc_section): Delete.
1257 (_bfd_elf_plt_get_reloc_section): Declare.
1258 * elf.c (_bfd_elf_plt_get_reloc_section, elf_get_reloc_section):
1259 New functions. Don't blindly skip over assumed .rel/.rela prefix.
1260 Extracted from..
1261 (_bfd_elf_get_reloc_section): ..here. Delete.
1262 (assign_section_numbers): Call elf_get_reloc_section.
1263 * elf64-ppc.c (elf_backend_get_reloc_section): Define.
1264 * elfxx-target.h (elf_backend_get_reloc_section): Update.
1265
1266 2017-04-23 Alan Modra <amodra@gmail.com>
1267
1268 PR 21409
1269 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Don't segfault when
1270 no symbols.
1271
1272 2017-04-21 H.J. Lu <hongjiu.lu@intel.com>
1273
1274 PR ld/21402
1275 * elf32-i386.c (elf_i386_link_hash_entry): Add
1276 no_finish_dynamic_symbol.
1277 (elf_i386_link_hash_newfunc): Set no_finish_dynamic_symbol to 0.
1278 (elf_i386_allocate_dynrelocs): If a symbol isn't undefined weak
1279 symbol, don't make it dynamic in PIE.
1280 (elf_i386_relocate_section): If a symbol isn't dynamic in PIE,
1281 set no_finish_dynamic_symbol and generate R_386_RELATIVE
1282 relocation for R_386_GOT32
1283 (elf_i386_finish_dynamic_symbol): Abort if no_finish_dynamic_symbol
1284 isn't 0.
1285
1286 2017-04-21 H.J. Lu <hongjiu.lu@intel.com>
1287
1288 PR ld/19617
1289 PR ld/21086
1290 * elflink.c (elf_link_add_object_symbols): Require
1291 --no-dynamic-linker with -E/--dynamic-list when creating
1292 dynamic sections.
1293
1294 2017-04-20 Maciej W. Rozycki <macro@imgtec.com>
1295
1296 * elflink.c (_bfd_elf_symbol_refs_local_p): Always return TRUE
1297 if forced local.
1298
1299 2017-04-20 Maciej W. Rozycki <macro@imgtec.com>
1300
1301 * elfxx-mips.c (_bfd_mips_elf_final_link): Reorder comment about
1302 dynamic symbol sorting.
1303
1304 2017-04-20 H.J. Lu <hongjiu.lu@intel.com>
1305
1306 PR ld/21382
1307 * elflink.c (elf_link_add_object_symbols): Preserve
1308 dynamic_ref_after_ir_def when restoring the symbol table for
1309 unneeded dynamic object.
1310
1311 2017-04-19 H.J. Lu <hongjiu.lu@intel.com>
1312
1313 PR ld/21401
1314 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Don't abort
1315 on on undefined IFUNC symbol in the second PLT.
1316
1317 2017-04-19 Wedson Almeida Filho <wedsonaf@gmail.com>
1318
1319 * peXXigen.c (pe_print_reloc): Correct chunk_end.
1320
1321 2017-04-19 Alan Modra <amodra@gmail.com>
1322
1323 * elflink.c (_bfd_elf_adjust_dynamic_symbol): Hide undefweak
1324 or make dynamic for info->dynamic_undefined_weak 0 and 1.
1325 * elf32-ppc.c:Formatting.
1326 (ensure_undefweak_dynamic): Don't make dynamic when
1327 info->dynamic_undefined_weak is zero.
1328 (allocate_dynrelocs): Discard undefweak dyn_relocs for
1329 info->dynamic_undefined_weak. Discard undef dyn_relocs when
1330 not default visibility. Discard undef and undefweak
1331 dyn_relocs earlier.
1332 (ppc_elf_relocate_section): Adjust to suit.
1333 * elf64-ppc.c: Formatting.
1334 (ensure_undefweak_dynamic): Don't make dynamic when
1335 info->dynamic_undefined_weak is zero.
1336 (allocate_dynrelocs): Discard undefweak dyn_relocs for
1337 info->dynamic_undefined_weak. Discard them earlier.
1338
1339 2017-04-17 H.J. Lu <hongjiu.lu@intel.com>
1340
1341 PR ld/21389
1342 * elflink.c (bfd_elf_size_dynamic_sections): Get soname index
1343 before generating the version definition section.
1344
1345 2017-04-17 Alan Modra <amodra@gmail.com>
1346
1347 * elflink.c (_bfd_elf_merge_symbol): Undo dynamic linking
1348 state when a regular object file defines a symbol with
1349 incompatible type to that defined by an earlier shared lib.
1350
1351 2017-04-13 Alan Modra <amodra@gmail.com>
1352
1353 * coffcode.h: Wrap some overly long _bfd_error_handler args.
1354 * elf.c: Likewise.
1355 * elf32-arm.c: Likewise.
1356 * elf32-i386.c: Likewise.
1357 * elf32-mep.c: Likewise.
1358 * elf64-ia64-vms.c: Likewise.
1359 * elf64-x86-64.c: Likewise.
1360 * elflink.c: Likewise.
1361 * elfnn-ia64.c: Likewise.
1362 * elfxx-mips.c: Likewise.
1363
1364 2017-04-13 Alan Modra <amodra@gmail.com>
1365
1366 * aoutx.h: Use %B and %A in error messages throughout file.
1367 * aout-cris.c: Likewise.
1368 * archive.c: Likewise.
1369 * binary.c: Likewise.
1370 * coff-rs6000.c: Likewise.
1371 * coff-tic4x.c: Likewise.
1372 * coffcode.h: Likewise.
1373 * coffgen.c: Likewise.
1374 * cofflink.c: Likewise.
1375 * coffswap.h: Likewise.
1376 * cpu-arm.c: Likewise.
1377 * elf-eh-frame.c: Likewise.
1378 * elf-m10300.c: Likewise.
1379 * elf.c: Likewise.
1380 * elf32-arc.c: Likewise.
1381 * elf32-arm.c: Likewise.
1382 * elf32-bfin.c: Likewise.
1383 * elf32-frv.c: Likewise.
1384 * elf32-iq2000.c: Likewise.
1385 * elf32-m32c.c: Likewise.
1386 * elf32-microblaze.c: Likewise.
1387 * elf32-nds32.c: Likewise.
1388 * elf32-rl78.c: Likewise.
1389 * elf32-rx.c: Likewise.
1390 * elf32-score.c: Likewise.
1391 * elf32-score7.c: Likewise.
1392 * elf32-sh64.c: Likewise.
1393 * elf32-v850.c: Likewise.
1394 * elf32-vax.c: Likewise.
1395 * elf32-visium.c: Likewise.
1396 * elf64-ia64-vms.c: Likewise.
1397 * elf64-mmix.c: Likewise.
1398 * elf64-sh64.c: Likewise.
1399 * elfcode.h: Likewise.
1400 * elfnn-aarch64.c: Likewise.
1401 * elfnn-ia64.c: Likewise.
1402 * elfxx-mips.c: Likewise.
1403 * hpux-core.c: Likewise.
1404 * ieee.c: Likewise.
1405 * ihex.c: Likewise.
1406 * linker.c: Likewise.
1407 * merge.c: Likewise.
1408 * mmo.c: Likewise.
1409 * oasys.c: Likewise.
1410 * pdp11.c: Likewise.
1411 * peXXigen.c: Likewise.
1412 * rs6000-core.c: Likewise.
1413 * vms-alpha.c: Likewise.
1414 * xcofflink.c: Likewise.
1415
1416 2017-04-13 Alan Modra <amodra@gmail.com>
1417
1418 * bfd.c (PRINT_TYPE): Define.
1419 (_doprnt): New function.
1420 (error_handler_internal): Use _doprnt.
1421 * coff-arm.c: Put %A and %B arguments to _bfd_error_handler
1422 calls in their natural order, throughout file.
1423 * coff-mcore.c: Likewise.
1424 * coff-ppc.c: Likewise.
1425 * coff-tic80.c: Likewise.
1426 * cofflink.c: Likewise.
1427 * elf-s390-common.c: Likewise.
1428 * elf.c: Likewise.
1429 * elf32-arm.c: Likewise.
1430 * elf32-i386.c: Likewise.
1431 * elf32-m32r.c: Likewise.
1432 * elf32-msp430.c: Likewise.
1433 * elf32-spu.c: Likewise.
1434 * elf64-ia64-vms.c: Likewise.
1435 * elf64-sparc.c: Likewise.
1436 * elf64-x86-64.c: Likewise.
1437 * elflink.c: Likewise.
1438 * elfnn-aarch64.c: Likewise.
1439 * elfnn-ia64.c: Likewise.
1440 * elfxx-mips.c: Likewise.
1441
1442 2017-04-13 Alan Modra <amodra@gmail.com>
1443
1444 * elf32-arm.c (arm_type_of_stub): Supply missing args to "long
1445 branch veneers" error. Fix double space and format message.
1446 * elf32-avr.c (avr_add_stub): Do not pass NULL as %B arg.
1447 * elf64-ppc.c (tocsave_find): Supply missing %B arg.
1448
1449 2017-04-13 Alan Modra <amodra@gmail.com>
1450
1451 * bfd-in2.h: Regenerate.
1452
1453 2017-04-11 H.J. Lu <hongjiu.lu@intel.com>
1454
1455 * elf-properties.c (_bfd_elf_parse_gnu_properties): Remove the
1456 extra `\n' in warning/error messages.
1457 * elf32-i386.c (elf_i386_parse_gnu_properties): Likewise.
1458 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
1459
1460 2017-04-11 H.J. Lu <hongjiu.lu@intel.com>
1461
1462 * elf-properties.c (_bfd_elf_parse_gnu_properties): Ignore
1463 processor-specific properties with generic ELF target vector.
1464
1465 2017-04-10 Qing Zhao <qing.zhao@oracle.com>
1466
1467 * elf32-sparc.c (elf_backend_fixup_symbol): New.
1468 * elf64-sparc.c (elf_backend_fixup_symbol): New.
1469 * elfxx-sparc.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): New.
1470 (_bfd_sparc_elf_link_hash_entry): Add has_got_reloc and
1471 has_non_got_reloc.
1472 (link_hash_newfunc): Initialize has_got_reloc and
1473 has_non_got_reloc.
1474 (_bfd_sparc_elf_size_dynamic_sections): Set interp to .interp
1475 section.
1476 (_bfd_sparc_elf_copy_indirect_symbol): Copy has_got_reloc and
1477 has_non_got_reloc.
1478 (_bfd_sparc_elf_check_relocs): Set has_got_reloc and
1479 has_non_got_reloc.
1480 (_bfd_sparc_elf_fixup_symbol): New function.
1481 (allocate_dynrelocs): Don't allocate space for dynamic
1482 relocations and discard relocations against resolved undefined
1483 weak symbols in executable. Don't make resolved undefined weak
1484 symbols in executable dynamic. Keep dynamic non-GOT/non-PLT
1485 relocation against undefined weak symbols in PIE.
1486 (_bfd_sparc_elf_relocate_section): Don't generate dynamic
1487 relocations against resolved undefined weak symbols in PIE
1488 (_bfd_sparc_elf_finish_dynamic_symbol): Keep PLT/GOT entries
1489 without ynamic PLT/GOT relocations for resolved undefined weak
1490 symbols.
1491 Don't generate dynamic relocation against resolved undefined
1492 weak symbol in executable.
1493 (pie_finish_undefweak_symbol): New function.
1494 (_bfd_sparc_elf_finish_dynamic_sections): Call
1495 pie_finish_undefweak_symbol on all symbols in PIE.
1496 * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Add interp.
1497 (_bfd_sparc_elf_fixup_symbol): New function.
1498
1499 2017-04-10 Nick Clifton <nickc@redhat.com>
1500
1501 * config.bfd: Remove ns32k from obsolete list.
1502
1503 2017-04-10 Alan Modra <amodra@gmail.com>
1504
1505 PR 21287
1506 * elf.c (special_sections_f): Match .fini_array and .fini_array.*.
1507 (special_sections_i): Likewise for .init_array.
1508 (special_sections_p): Likewise for .preinit_array.
1509
1510 2017-04-07 H.J. Lu <hongjiu.lu@intel.com>
1511
1512 PR ld/19579
1513 PR ld/21306
1514 * elf32-s390.c (elf_s390_finish_dynamic_symbol): Check
1515 ELF_COMMON_DEF_P for common symbols.
1516 * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
1517 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
1518 * elflink.c (_bfd_elf_merge_symbol): Revert commits
1519 202ac193bbbecc96a4978d1ac3d17148253f9b01 and
1520 07492f668d2173da7a2bda3707ff0985e0f460b6.
1521
1522 2017-04-07 Pedro Alves <palves@redhat.com>
1523
1524 * opncls.c (bfd_get_debug_link_info): Rename to...
1525 (bfd_get_debug_link_info_1): ... this. Change type of second
1526 parameter to void pointer. Adjust.
1527 (bfd_get_debug_link_info): Reimplement on top of
1528 bfd_get_debug_link_info_1.
1529 (separate_debug_file_exists, separate_alt_debug_file_exists):
1530 Change type of second parameter to void pointer. Adjust.
1531 (get_func_type, check_func_type): Change type of second parameter
1532 to void pointer.
1533 (find_separate_debug_file): Add 'func_data' parameter. Pass it to
1534 the callback functions instead of passing the address of a local.
1535 (bfd_follow_gnu_debuglink): Pass address of unsigned long local to
1536 find_separate_debug_file.
1537 (get_alt_debug_link_info_shim): Change type of second parameter to
1538 void pointer. Adjust.
1539 (bfd_follow_gnu_debugaltlink): Adjust to pass NULL to
1540 find_separate_debug_file.
1541 (get_build_id_name, bfd_boolean check_build_id_file): Change type
1542 of second parameter to void pointer. Adjust.
1543 (bfd_follow_build_id_debuglink): Pass address of bfd_build_id
1544 pointer local to find_separate_debug_file.
1545
1546 2017-04-07 Tristan Gingold <gingold@gingold-Precision-7510>
1547
1548 * coffgen.c (_bfd_coff_gc_mark_hook): Handle PE weak
1549 external symbols with a definition.
1550 (_bfd_coff_gc_mark_extra_sections): Fix typo.
1551
1552 2017-04-07 Alan Modra <amodra@gmail.com>
1553
1554 * po/SRC-POTFILES.in: Regenerate.
1555
1556 2017-04-05 Alan Modra <amodra@gmail.com>
1557
1558 * elf64-ppc.c (ppc64_elf_gc_sweep_hook): Support ELFv2 PLT
1559 reference counting.
1560
1561 2017-04-02 Jon Turney <jon.turney@dronecode.org.uk>
1562
1563 (_bfd_XXi_swap_aouthdr_out): For clarity, use defines rather than
1564 numbers for DataDirectory entry indicies passed to
1565 add_data_entry().
1566
1567 2017-04-04 H.J. Lu <hongjiu.lu@intel.com>
1568
1569 * elf.c (get_program_header_size): Add a GNU_MBIND segment for
1570 each GNU_MBIND section and align GNU_MBIND section to page size.
1571 (_bfd_elf_map_sections_to_segments): Create a GNU_MBIND
1572 segment for each GNU_MBIND section.
1573 (_bfd_elf_init_private_section_data): Copy sh_info from input
1574 for GNU_MBIND section.
1575
1576 2017-04-03 Palmer Dabbelt <palmer@dabbelt.com>
1577
1578 * elfnn-riscv.c (GP_NAME): Delete.
1579 (riscv_global_pointer_value): Change GP_NAME to RISCV_GP_SYMBOL.
1580 (_bfd_riscv_relax_lui): Likewise.
1581
1582 2017-04-04 Nick Clifton <nickc@redhat.com>
1583
1584 PR binutils/21342
1585 * elflink.c (_bfd_elf_define_linkage_sym): Prevent null pointer
1586 dereference.
1587 (bfd_elf_final_link): Only initialize the extended symbol index
1588 section if there are extended symbol tables to list.
1589
1590 2017-04-03 H.J. Lu <hongjiu.lu@intel.com>
1591
1592 * Makefile.am (BFD32_BACKENDS): Add elf-properties.lo.
1593 (BFD32_BACKENDS_CFILES): Add elf-properties.c.
1594 * configure.ac (elf): Add elf-properties.lo.
1595 * Makefile.in: Regenerated.
1596 * configure: Likewise.
1597 * elf-bfd.h (elf_property_kind): New.
1598 (elf_property): Likewise.
1599 (elf_property_list): Likewise.
1600 (elf_properties): Likewise.
1601 (_bfd_elf_parse_gnu_properties): Likewise.
1602 (_bfd_elf_get_property): Likewise.
1603 (_bfd_elf_link_setup_gnu_properties): Likewise.
1604 (elf_backend_data): Add parse_gnu_properties, merge_gnu_properties
1605 and setup_gnu_properties.
1606 (elf_obj_tdata): Add properties.
1607 * elf-properties.c: New file.
1608 * elf32-i386.c (elf_i386_parse_gnu_properties): New.
1609 (elf_i386_merge_gnu_properties): Likewise.
1610 (elf_backend_parse_gnu_properties): Likewise.
1611 (elf_backend_merge_gnu_properties): Likewise.
1612 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
1613 (elf_x86_64_merge_gnu_properties): Likewise.
1614 (elf_backend_parse_gnu_properties): Likewise.
1615 (elf_backend_merge_gnu_properties): Likewise.
1616 * elfxx-target.h (elf_backend_merge_gnu_properties): Likewise.
1617 (elf_backend_parse_gnu_properties): Likewise.
1618 (elf_backend_setup_gnu_properties): Likewise.
1619 (elfNN_bed): Add elf_backend_parse_gnu_properties,
1620 elf_backend_merge_gnu_properties and
1621 elf_backend_setup_gnu_properties.
1622
1623 2017-03-30 Pip Cet <pipcet@gmail.com>
1624
1625 * elf32-wasm32.c: Add relocation code, two relocs.
1626 * reloc.c: Add wasm32 relocations.
1627 * libbfd.h: Regenerate.
1628 * bfd-in2.h: Regenerate.
1629 * bfd/po/bfd.pot: Regenerate.
1630
1631 2017-03-29 Nick Clifton <nickc@redhat.com>
1632
1633 PR binutils/18025
1634 * coff-bfd.h (struct coff_section_data): Add new fields:
1635 saved_bias and bias.
1636 * coffgen.c (coff_find_nearest_line_with_names): Cache the bias
1637 computed for PE binaries.
1638 * dwarf2.c (scan_unit_for_symbols): Only warn once about each
1639 missing abbrev.
1640
1641 2017-03-28 Hans-Peter Nilsson <hp@axis.com>
1642
1643 PR ld/16044
1644 * elf32-cris.c (elf_cris_adjust_gotplt_to_got): Adjust BFD_ASSERT
1645 to handle a local symbol with a hash-symbol-entry; without PLT.
1646 Add BFD_ASSERT for an incidental case with GOT entry present.
1647 (cris_elf_check_relocs): Increment PLT refcount only if the symbol
1648 isn't forced-or-set local.
1649
1650 2017-03-27 Pip Cet <pipcet@gmail.com>
1651
1652 * wasm-module.c: New file to support WebAssembly modules.
1653 * wasm-module.h: New file to support WebAssembly modules.
1654 * doc/webassembly.texi: Start documenting wasm-module.c.
1655 * config.bfd: Add wasm_vec.
1656 * targets.c: Likewise.
1657 * configure.ac: Likewise.
1658 * Makefile.am: Add entries for wasm-module.c.
1659 * Makefile.in: Regenerate.
1660 * configure: Regenerate.
1661 * po/SRC-POTFILES.in: Regenerate.
1662
1663 2017-03-27 Pip Cet <pipcet@gmail.com>
1664
1665 * cpu-wasm32.c: New file to support wasm32 architecture.
1666 * elf32-wasm32.c: New file to support wasm32 architecture.
1667 * Makefile.am: Add wasm32 architecture.
1668 * archures.c: Likewise.
1669 * config.bfd: Likewise.
1670 * configure.ac: Likewise.
1671 * targets.c: Likewise.
1672 * Makefile.in: Regenerate.
1673 * bfd-in2.h: Regenerate.
1674 * configure: Regenerate.
1675 * po/SRC-POTFILES.in: Regenerate.
1676
1677 2017-03-20 Alan Modra <amodra@gmail.com>
1678
1679 PR 21266
1680 * elf64-ppc.c (compare_symbols): Stabilize sort.
1681
1682 2017-03-18 Alan Modra <amodra@gmail.com>
1683
1684 * elf64-ppc.c (struct ppc_link_hash_table): Add
1685 local_ifunc_resolver and maybe_local_ifunc_resolver.
1686 (ppc_build_one_stub): Set flags on emitting dynamic
1687 relocation to ifunc.
1688 (ppc64_elf_relocate_section): Likewise.
1689 (ppc64_elf_finish_dynamic_symbol): Likewise.
1690 (ppc64_elf_finish_dynamic_sections): Error on DT_TEXTREL with
1691 local dynamic relocs to ifuncs.
1692 * elf32-ppc.c (struct ppc_elf_link_hash_table): Add
1693 local_ifunc_resolver and maybe_local_ifunc_resolver.
1694 (ppc_elf_relocate_section): Set flag on emitting dynamic
1695 relocation to ifuncs.
1696 (ppc_elf_finish_dynamic_symbol): Likewise.
1697 (ppc_elf_finish_dynamic_sections): Error on DT_TEXTREL with local
1698 dynamic relocs to ifuncs.
1699
1700 2017-03-13 Nick Clifton <nickc@redhat.com>
1701
1702 PR binutils/21202
1703 * reloc.c (BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC): Rename to
1704 BFD_RELOC_AARCH64_TLSDESC_LD64_LO12.
1705 (BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC): Rename to
1706 BFD_RELOC_AARCH64_TLSDESC_ADD_LO12.
1707 * bfd-in2.h: Regenerate.
1708 * libbfd.h: Regenerate.
1709 * elfnn-aarch64.c (IS_AARCH64_TLS_RELAX_RELOC): Update reloc
1710 names.
1711 (IS_AARCH64_TLSDESC_RELOC): Likewise.
1712 (elfNN_aarch64_howto_table): Likewise.
1713 (aarch64_tls_transition_without_check): Likewise.
1714 (aarch64_reloc_got_type): Likewise.
1715 (elfNN_aarch64_final_link_relocate): Likewise.
1716 (elfNN_aarch64_tls_relax): Likewise.
1717 (elfNN_aarch64_relocate_section): Likewise.
1718 (elfNN_aarch64_gc_sweep_hook): Likewise.
1719 (elfNN_aarch64_check_relocs): Likewise.
1720 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
1721 (_bfd_aarch64_elf_resolve_relocation): Likewise.
1722
1723 2017-03-11 Alan Modra <amodra@gmail.com>
1724
1725 * elf32-ppc.c: Remove ATTRIBUTE_UNUSED throughout when function
1726 parameter is in fact used. Whitespace fixes.
1727 * elf64-ppc.c: Likewise.
1728
1729 2017-03-09 Sam Thursfield <sam.thursfield@codethink.co.uk>
1730
1731 * rs6000-core.c (CORE_NEW): Simplify macro when
1732 AIX_CORE_DUMPX_CORE and BFD64 are true to avoid compile warning.
1733
1734 2017-03-07 Alan Modra <amodra@gmail.com>
1735
1736 PR 21224
1737 PR 20519
1738 * elf64-ppc.c (ppc64_elf_relocate_section): Add missing
1739 dyn_relocs check.
1740
1741 2017-03-05 Alan Modra <amodra@gmail.com>
1742
1743 * elf-bfd.h (struct eh_cie_fde): Add u.cie.per_encoding_aligned8.
1744 * elf-eh-frame.c (size_of_output_cie_fde): Don't align here.
1745 (next_cie_fde_offset): New function.
1746 (_bfd_elf_parse_eh_frame): Set u.cie.per_encoding_aligned8.
1747 (_bfd_elf_discard_section_eh_frame): Align zero terminator to
1748 four bytes. Align CIEs to four or eight bytes depending on
1749 per_encoding_aligned8. Align FDEs according to their encoding.
1750 Pad last FDE to output section alignment.
1751 (_bfd_elf_write_section_eh_frame): Adjust to suit. Remove
1752 assertion.
1753 * elf64-ppc.c (glink_eh_frame_cie): Delete padding.
1754 (ppc64_elf_size_stubs): Pad glink eh_frame as per elf-eh-frame.c.
1755 (ppc64_elf_finish_dynamic_sections): Adjust to suit.
1756
1757 2017-03-02 Martin Bickel <binutils@ineranves.de>
1758
1759 PR ld/21212
1760 * elf.c (rewrite_elf_program_header): Do not issue a warning for
1761 empty segments which have a zero filesz, but a non-zero memsz.
1762
1763 2017-03-02 Alan Modra <amodra@gmail.com>
1764
1765 * elf32-ppc.c (ppc_elf_vle_split16): Correct insn mask typo.
1766
1767 2017-02-28 Alan Modra <amodra@gmail.com>
1768
1769 * elf64-ppc.c (ppc64_elf_ha_reloc): Revert last change.
1770 (ppc64_elf_relocate_section): Likewise.
1771
1772 2017-02-28 Alan Modra <amodra@gmail.com>
1773
1774 PR 20995
1775 * elf32-nios2.c (nios2_elf32_relocate_section): Use htab
1776 rather than elf32_nios2_hash_table or elf_hash_table.
1777 (create_got_section): Likewise.
1778 (nios2_elf32_finish_dynamic_symbol): Likewise.
1779 (nios2_elf32_adjust_dynamic_symbol): Likewise.
1780 (nios2_elf32_size_dynamic_sections): Likewise.
1781 (nios2_elf32_check_relocs): Delete dynobj, sgot, and srelgot
1782 vars. Use htab equivalents directly instead. Don't create
1783 all dynamic sections on needing just the GOT. Use a goto
1784 rather than a fall-through with reloc test. Ensure
1785 htab->dynobj is set when making dynamic sreloc section.
1786 (nios2_elf32_finish_dynamic_sections): Delete dynobj, use htab
1787 equivalent directly instead. Don't segfault on looking for
1788 .dynamic when dynamic sections have not been created. Don't
1789 segfault on .got.plt being discarded.
1790 (nios2_elf32_size_dynamic_sections): Delete plt and got vars.
1791 Don't set "relocs" on .rela.plt. Do handle .sbss. Delete
1792 fixme and another not so relevant comment.
1793 (nios2_elf_add_symbol_hook): Delete dynobj var. If not
1794 already set, set hash table dynobj on creating .sbss.
1795
1796 2017-02-28 Alan Modra <amodra@gmail.com>
1797
1798 * reloc.c (BFD_RELOC_PPC_16DX_HA): New.
1799 * elf64-ppc.c (ppc64_elf_howto_raw <R_PPC64_16DX_HA>): New howto.
1800 (ppc64_elf_reloc_type_lookup): Translate new bfd reloc.
1801 (ppc64_elf_ha_reloc): Correct overflow test on REL16DX_HA.
1802 (ppc64_elf_relocate_section): Likewise.
1803 * elf32-ppc.c (ppc_elf_howto_raw <R_PPC_16DX_HA>): New howto.
1804 (ppc_elf_reloc_type_lookup): Translate new bfd reloc.
1805 (ppc_elf_check_relocs): Handle R_PPC_16DX_HA to pacify gcc.
1806 * libbfd.h: Regenerate.
1807 * bfd-in2.h: Regenerate.
1808
1809 2017-02-28 Alan Modra <amodra@gmail.com>
1810
1811 * elflink.c (_bfd_elf_create_dynamic_sections): Don't make
1812 dynamic .data.rel.ro read-only.
1813 * elf32-arm.c (elf32_arm_finish_dynamic_symbol): Compare section
1814 rather than section flags when deciding where copy reloc goes.
1815 * elf32-cris.c (elf_cris_finish_dynamic_symbol): Likewise.
1816 * elf32-hppa.c (elf32_hppa_finish_dynamic_symbol): Likewise.
1817 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Likewise.
1818 * elf32-metag.c (elf_metag_finish_dynamic_symbol): Likewise.
1819 * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Likewise.
1820 * elf32-nios2.c (nios2_elf32_finish_dynamic_symbol): Likewise.
1821 * elf32-or1k.c (or1k_elf_finish_dynamic_symbol): Likewise.
1822 * elf32-ppc.c (ppc_elf_finish_dynamic_symbol): Likewise.
1823 * elf32-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
1824 * elf32-tic6x.c (elf32_tic6x_finish_dynamic_symbol): Likewise.
1825 * elf32-tilepro.c (tilepro_elf_finish_dynamic_symbol): Likewise.
1826 * elf64-ppc.c (ppc64_elf_finish_dynamic_symbol): Likewise.
1827 * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
1828 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
1829 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Likewise.
1830 * elfnn-riscv.c (riscv_elf_finish_dynamic_symbol): Likewise.
1831 * elfxx-mips.c (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise.
1832 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Likewise.
1833 * elfxx-tilegx.c (tilegx_elf_finish_dynamic_symbol): Likewise.
1834
1835 2017-02-28 Maciej W. Rozycki <macro@imgtec.com>
1836
1837 * elfxx-mips.c (mips_elf_perform_relocation): Also handle the
1838 `jalr $0, $25' instruction encoding.
1839
1840 2017-02-27 Nick Clifton <nickc@redhat.com>
1841
1842 PR ld/21180
1843 * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Avoid
1844 generating a seg-fault when encountering a symbol that has been
1845 deleted by garbage collection.
1846
1847 2017-02-25 Alan Modra <amodra@gmail.com>
1848
1849 * elf32-arc.c (struct dynamic_sections): Delete.
1850 (enum dyn_section_types): Delete.
1851 (dyn_section_names): Delete.
1852 (arc_create_dynamic_sections): Delete.
1853 (elf_arc_finish_dynamic_sections): Don't call the above. Don't
1854 segfault on discarded .rela.plt section.
1855 (elf_arc_size_dynamic_sections): Formatting. Don't call
1856 arc_create_dynamic_sections. Don't allocate memory for sections
1857 handled by the generic linker. Correct code finding relocs in
1858 read-only sections. Set SEC_EXCLUDE on zero size .got,
1859 .got.plt, and .dynbss sections. Do set .interp for pies.
1860
1861 2017-02-24 Andrew Waterman <andrew@sifive.com>
1862
1863 * elfnn-riscv.c (GP_NAME): New macro.
1864 (riscv_global_pointer_value): Use it.
1865 (_bfd_riscv_relax_lui): If symbol and global pointer are in same
1866 output section, consider only that section's alignment.
1867
1868 2017-02-23 Maciej W. Rozycki <macro@imgtec.com>
1869
1870 * elfxx-mips.h (_bfd_mips_relax_section): Remove prototype.
1871 * elfxx-mips.c (_bfd_mips_relax_section): Remove function.
1872 * elf64-mips.c (bfd_elf64_bfd_relax_section): Remove macro.
1873 * elfn32-mips.c (bfd_elf32_bfd_relax_section): Likewise.
1874
1875 2017-02-23 Maciej W. Rozycki <macro@imgtec.com>
1876
1877 * elfxx-mips.c (mips_elf_calculate_relocation) <R_MIPS_JALR>
1878 <R_MICROMIPS_JALR>: Discard relocation if `cross_mode_jump_p'
1879 or misaligned.
1880
1881 2017-02-23 Alan Modra <amodra@gmail.com>
1882
1883 PR 20744
1884 * elf32-ppc.c (ppc_elf_howto_raw): Correct dst_mask on all VLE
1885 16D relocations.
1886 (ppc_elf_vle_split16): Correct field mask and shift for 16D relocs.
1887 (ppc_elf_relocate_section): Correct calculation for VLE SDAREL
1888 relocs.
1889
1890 2017-02-22 Maciej W. Rozycki <macro@imgtec.com>
1891
1892 PR ld/20828
1893 * elflink.c (bfd_elf_size_dynamic_sections): Move symbol version
1894 processing ahead of the call to `elf_gc_sweep_symbol'.
1895
1896 2017-02-22 Nick Clifton <nickc@redhat.com>
1897
1898 PR binutils/21193
1899 * opncls.c (bfd_create_gnu_debuglink_section): Give the newly
1900 created section 4-byte alignment.
1901
1902 2017-02-22 Alan Modra <amodra@gmail.com>
1903
1904 * elf64-ppc.c (ppc64_elf_finish_dynamic_sections): Don't segfault
1905 on .got or .plt output section being discarded by script.
1906 * elf32-ppc.c (ppc_elf_finish_dynamic_sections): Likewise. Move
1907 vxworks splt temp.
1908
1909 2017-02-21 Alan Modra <amodra@gmail.com>
1910
1911 * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Only emit
1912 DT_RELA, DT_RELASZ, and DT_RELAENT when DT_RELASZ is non-zero.
1913
1914 2017-02-20 Alan Modra <amodra@gmail.com>
1915
1916 PR 21181
1917 * elflink.c (bfd_elf_final_link): Make DT_REL/DT_RELA zero
1918 if DT_RELSZ/DT_RELASZ is zero.
1919
1920 2017-02-17 Nick Clifton <nickc@redhat.com>
1921
1922 * compress.c (bfd_get_full_section_contents): Remember to reduce
1923 compressed size by the sizeof the compression header when
1924 decompressing the contents.
1925
1926 2017-02-17 Pedro Alves <palves@redhat.com>
1927
1928 * srec.c (Chunk): Rename to ...
1929 (_bfd_srec_len): ... this.
1930 (S3Forced): Rename to ...
1931 (_bfd_srec_forceS3): ... this.
1932 * objcopy.c: Adjust all references.
1933
1934 2017-02-17 Pedro Alves <palves@redhat.com>
1935
1936 * archive.c (bsd_write_armap): Rename to ...
1937 (_bfd_bsd_write_armap): ... this.
1938 (coff_write_armap): Rename to ...
1939 (_bfd_coff_write_armap): ... this.
1940 * libbfd-in.h (bsd_write_armap): Rename to ...
1941 (_bfd_bsd_write_armap): ... this.
1942 (coff_write_armap): Rename to ...
1943 (_bfd_coff_write_armap): ... this.
1944 * aout-target.h, aout-tic30.c: Adjust all users.
1945 * libbfd.h: Regenerate.
1946
1947 2017-02-17 Pedro Alves <palves@redhat.com>
1948
1949 * bfd-in.h (bfd_read, bfd_write): Adjust to rename.
1950 (warn_deprecated): Rename to ...
1951 (_bfd_warn_deprecated): ... this.
1952 * libbfd.c (warn_deprecated): Rename to ...
1953 (_bfd_warn_deprecated): ... this.
1954 * bfd-in2.h: Regenerate.
1955
1956 2017-02-17 Pedro Alves <palves@redhat.com>
1957
1958 * bfdio.c (real_ftell): Rename to ...
1959 (_bfd_real_ftell): ... this.
1960 (real_fseek): Rename to ...
1961 (_bfd_real_fseek): ... this.
1962 (real_fopen): Rename to ...
1963 (_bfd_real_fopen): ... this.
1964 * libbfd-in.h (real_ftell): Rename to ...
1965 (_bfd_real_ftell): ... this.
1966 (real_fseek): Rename to ...
1967 (_bfd_real_fseek): ... this.
1968 (real_fopen): Rename to ...
1969 (_bfd_real_fopen): ... this.
1970 * cache.c, dwarf2.c, opncls.c: Adjust all callers.
1971 * libbfd.h: Regenerate.
1972
1973 2017-02-17 Pedro Alves <palves@redhat.com>
1974
1975 * dwarf2.c, elf-attrs.c, elf32-nds32.c: Adjust all callers.
1976 * libbfd.c (read_unsigned_leb128): Rename to ...
1977 (_bfd_read_unsigned_leb128): ... this.
1978 (read_signed_leb128): Rename to ...
1979 (_bfd_read_signed_leb128): ... this.
1980 (safe_read_leb128): Rename to ...
1981 (_bfd_safe_read_leb128): ... this.
1982 * libbfd-in.h (read_unsigned_leb128): Rename to ...
1983 (_bfd_read_unsigned_leb128): ... this.
1984 (read_signed_leb128): Rename to ...
1985 (_bfd_read_signed_leb128): ... this.
1986 (safe_read_leb128): Rename to ...
1987 (_bfd_safe_read_leb128): ... this.
1988 * libbfd.h: Renegerate.
1989
1990 2017-02-16 Andrew Burgess <andrew.burgess@embecosm.com>
1991
1992 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Perform symbol lookup
1993 before trying to fine matching file and line information.
1994
1995 2017-02-16 Andrew Burgess <andrew.burgess@embecosm.com>
1996
1997 * dwarf2.c (struct dwarf2_debug): Add orig_bfd member.
1998 (_bfd_dwarf2_slurp_debug_info): If stashed debug information does
1999 not match current bfd, then reload debug information. Record bfd
2000 we're loading debug info for in the stash. If we have debug
2001 informatin in the cache then perform section placement before
2002 returning.
2003
2004 2017-02-16 Alan Modra <amodra@gmail.com>
2005
2006 PR 21000
2007 * elf-bfd.h (struct elf_backend_data): Add no_page_alias.
2008 * elfxx-target.h (elf_backend_no_page_alias): Define.
2009 (elfNN_bed): Init new field.
2010 * elf.c (assign_file_positions_for_load_sections): If no_page_alias
2011 ensure PT_LOAD segment starts on a new page.
2012 * elf32-hppa.c (elf_backend_no_page_alias): Define.
2013
2014 2017-02-16 Alan Modra <amodra@gmail.com>
2015
2016 PR 21132
2017 * elf32-hppa.c (allocate_plt_static): Allocate space for relocs
2018 if pic.
2019
2020 2017-02-16 Jiong Wang <jiong.wang@arm.com>
2021
2022 * bfd.c (BFD_FLAGS_SAVED): Add BFD_LINKER_CREATED.
2023 * bfd-in2.h: Regenerated.
2024
2025 2017-02-15 H.J. Lu <hongjiu.lu@intel.com>
2026
2027 PR ld/21168
2028 * elf32-i386.c (elf_i386_relocate_section): Allow
2029 "lea foo@GOT, %reg" in PIC.
2030
2031 2017-02-15 H.J. Lu <hongjiu.lu@intel.com>
2032
2033 PR ld/20244
2034 * elf32-i386.c (elf_i386_relocate_section): Properly get IFUNC
2035 symbol name when reporting R_386_GOT32/R_386_GOT32X relocation
2036 error against local IFUNC symbol without a base register for
2037 PIC.
2038
2039 2017-02-15 Maciej W. Rozycki <macro@imgtec.com>
2040
2041 * elf32-ppc.c (ppc_elf_check_relocs): Use `%H:' rather than
2042 `%P: %H:' with `info->callbacks->einfo'.
2043 (ppc_elf_relocate_section): Likewise.
2044 * elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
2045 (ppc64_elf_edit_toc): Likewise.
2046 (ppc64_elf_relocate_section): Likewise.
2047
2048 2017-02-14 Alan Modra <amodra@gmail.com>
2049
2050 * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Support
2051 --gc-keep-exported, and test versioned field of sym rather than
2052 looking for @ in name.
2053
2054 2017-02-13 Palmer Dabbelt <palmer@dabbelt.com>
2055
2056 * elfnn-riscv.c (riscv_global_pointer_value): Change _gp to
2057 __global_pointer$.
2058
2059 2017-02-13 Nick Clifton <nickc@redhat.com>
2060
2061 PR binutils/21151
2062 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Check for an invalid
2063 unit length field.
2064
2065 2017-02-07 Andrew Waterman <andrew@sifive.com>
2066
2067 * elfnn-riscv.c (riscv_elf_finish_dynamic_sections): Only write PLT
2068 entry size if PLT header is written.
2069
2070 2017-02-06 Sheldon Lobo <sheldon.lobo@oracle.com>
2071
2072 Fix sparc64 dynamic relocation processing to use the dynamic
2073 symbol count.
2074 * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Use 'dynamic'
2075 to determine if bfd_get_symcount() or bfd_get_dynamic_symcount()
2076 should be used.
2077
2078 2017-02-03 Nick Clifton <nickc@redhat.com>
2079
2080 PR 21096
2081 * coffcode.h (coff_write_object_contents): Enlarge size of
2082 s_name_buf in order to avoid compile time warning about possible
2083 integer truncation.
2084 * elf32-nds32.c (nds32_elf_ex9_import_table): Mask off lower
2085 32-bits of insn value before printing into buffer.
2086
2087 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
2088
2089 * elfxx-mips.c (mips_elf_hash_sort_data): Add
2090 `max_local_dynindx'.
2091 (mips_elf_sort_hash_table): Handle it.
2092 (mips_elf_sort_hash_table_f) <GGA_NONE>: For forced local
2093 symbols bump up `max_local_dynindx' rather than
2094 `max_non_got_dynindx'.
2095
2096 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
2097
2098 * elfxx-mips.c (mips_elf_hash_sort_data): Convert the
2099 `min_got_dynindx', `max_unref_got_dynindx' and
2100 `max_non_got_dynindx' members to the `bfd_size_type' data type.
2101 (mips_elf_sort_hash_table): Adjust accordingly.
2102
2103 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
2104
2105 * elfxx-mips.c (mips_elf_sort_hash_table): Use `htab' throughout
2106 to access the hash table.
2107
2108 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
2109
2110 * elfxx-mips.c (mips_elf_sort_hash_table): Move assertion on
2111 non-NULL `htab' to the beginning.
2112
2113 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
2114
2115 * elflink.c (elf_gc_sweep): Wrap overlong line.
2116
2117 2017-01-30 Maciej W. Rozycki <macro@imgtec.com>
2118
2119 * elfxx-mips.h (_bfd_mips_elf_insn32): Rename prototype to...
2120 (_bfd_mips_elf_linker_flags): ... this. Add another parameter.
2121 * elfxx-mips.c (mips_elf_link_hash_table): Add
2122 `ignore_branch_isa' member.
2123 (mips_elf_perform_relocation): Do not treat an ISA mode mismatch
2124 in branch relocation calculation as an error if
2125 `ignore_branch_isa' has been set.
2126 (_bfd_mips_elf_insn32): Rename to...
2127 (_bfd_mips_elf_linker_flags): ... this. Rename the `on'
2128 parameter to `insn32' and add an `ignore_branch_isa' parameter.
2129 Handle the new parameter.
2130
2131 2017-01-27 Hans-Peter Nilsson <hp@axis.com>
2132
2133 * elf32-cris.c (elf_cris_finish_dynamic_symbol): Remove now unused
2134 local variable dynobj.
2135
2136 PR ld/20995
2137 * elf32-cris.c (elf_cris_size_dynamic_sections): Handle sdynrelro.
2138 (elf_cris_adjust_dynamic_symbol): Place variables copied into the
2139 executable from read-only sections into sdynrelro.
2140 (elf_cris_finish_dynamic_symbol): Select sreldynrelro for
2141 dynamic relocs in sdynrelro.
2142 (elf_backend_want_dynrelro): Define.
2143
2144 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
2145
2146 * config.bfd (*-*-rtemsaout*): Mark as removed.
2147
2148 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
2149
2150 * config.bfd (powerpcle-*-rtems*): Do not mark as removed.
2151 (arm-*-rtems*): Move to (arm*-*-eabi*).
2152 (i[3-7]86-*-rtems*): Move to (i[3-7]86-*-elf*).
2153 (m68-*-rtems*): Move to (m68*-*-elf*).
2154
2155 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
2156
2157 * config.bfd (*-*-rtemscoff*): Mark as removed.
2158
2159 2017-01-24 Maciej W. Rozycki <macro@imgtec.com>
2160
2161 PR ld/20828
2162 * elflink.c (bfd_elf_record_link_assignment): Revert last
2163 change and don't ever clear `forced_local'. Set `mark'
2164 unconditionally.
2165 (elf_gc_sweep_symbol_info, elf_gc_sweep_symbol): Reorder within
2166 file.
2167 (elf_gc_sweep): Move the call to `elf_gc_sweep_symbol'...
2168 (bfd_elf_size_dynamic_sections): ... here.
2169 * elf32-ppc.c (ppc_elf_tls_setup): Don't clear `forced_local'
2170 and set `mark' instead in `__tls_get_addr_opt' processing.
2171 * elf64-ppc.c (ppc64_elf_tls_setup): Likewise.
2172
2173 2017-01-24 Alan Modra <amodra@gmail.com>
2174
2175 * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Merge two cases
2176 where dynamic relocs are preferable. Allow ifunc too.
2177 (ensure_undefweak_dynamic): New function.
2178 (allocate_dynrelocs): Use it here. Move plt handling last and
2179 don't make symbols dynamic, simplifying loop. Only make undef
2180 weak symbols with GOT entries dynamic. Correct condition
2181 for GOT relocs. Handle dynamic relocs on ifuncs. Correct
2182 comments. Remove goto.
2183 (ppc_elf_relocate_section): Correct test for using dynamic
2184 symbol on GOT relocs. Rearrange test for emitting GOT relocs
2185 to suit. Set up explicit tls_index entries and implicit GOT
2186 tls_index entries resolvable at link time for
2187 __tls_get_addr_opt. Simplify test to clear mem for prelink.
2188 * elf64-ppc.c (allocate_got): Correct condition for GOT relocs.
2189 (ensure_undefweak_dynamic): New function.
2190 (allocate_dynrelocs): Use it here. Only make undef weak symbols
2191 with GOT entries dynamic. Remove unnecessary test of
2192 WILL_CALL_FINISH_DYNAMIC_SYMBOL in PLT handling.
2193 (ppc64_elf_relocate_section): Correct test for using dynamic
2194 symbol on GOT relocs. Rearrange test for emitting GOT relocs
2195 to suit. Set up explicit tls_index entries and implicit GOT
2196 tls_index entries resolvable at link time for __tls_get_addr_opt.
2197 Simplify expression to clear mem for prelink.
2198
2199 2017-01-23 Yury Norov <ynorov@caviumnetworks.com>
2200
2201 * elfnn-aarch64.c: Fix relaxations for ILP32 mode.
2202
2203 2017-01-20 Jiong Wang <jiong.wang@arm.com>
2204
2205 * elfnn-aarch64.c (elf_aarch64_hash_symbol): New function.
2206 (elf_backend_hash_symbol): Define.
2207
2208 2017-01-18 Maciej W. Rozycki <macro@imgtec.com>
2209
2210 PR ld/20828
2211 * elflink.c (bfd_elf_record_link_assignment): Clear any
2212 `forced_local' marking for DSO symbols that are not being
2213 provided.
2214
2215 2017-01-17 Kuan-Lin Chen <kuanlinchentw@gmail.com>
2216
2217 * elfnn-riscv.c (riscv_elf_object_p): New function.
2218
2219 2017-01-12 H.J. Lu <hongjiu.lu@intel.com>
2220
2221 PR ld/21038
2222 * elf64-x86-64.c (elf_x86_64_link_hash_table): Add
2223 plt_bnd_eh_frame.
2224 (elf_x86_64_check_relocs): Create .eh_frame section for the
2225 .plt.bnd section.
2226 (elf_x86_64_size_dynamic_sections): Allocate and initialize
2227 .eh_frame section for the .plt.bnd section.
2228 (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
2229 for the .plt.bnd section.
2230
2231 2017-01-12 Nick Clifton <nickc@redhat.com>
2232
2233 PR binutils/20876
2234 * opncls.c (find_separate_debug_file): Add include_dirs
2235 parameter. Only include the directory part of the bfd's filename
2236 in search paths if include_dirs is true. Add a couple of extra
2237 locations for looking for debug files.
2238 ( bfd_follow_gnu_debuglink): Update invocation of
2239 find_separate_debug_file.
2240 (bfd_follow_gnu_debugaltlink): Likewise.
2241 (get_build_id): New function: Finds the build-id of the given bfd.
2242 (get_build_id_name): New function: Computes the name of the
2243 separate debug info file for a bfd, based upon its build-id.
2244 (check_build_id_file): New function: Checks to see if a separate
2245 debug info file exists at the given location, and that its
2246 build-id matches that of the original bfd.
2247 (bfd_follow_build_id_debuglink): New function: Finds a separate
2248 debug info file for a given bfd by using the build-id method.
2249 * dwarf2.c (_bfd_dwarf2_slurp_debug_info): Try using the build-id
2250 method of locating a separate debug info file before using the
2251 debuglink method.
2252 * bfd-in2.h: Regenerate.
2253
2254 2017-01-11 H.J. Lu <hongjiu.lu@intel.com>
2255
2256 PR ld/21038
2257 * elf64-x86-64.c (elf_x86_64_eh_frame_bnd_plt): New.
2258 (elf_x86_64_bnd_arch_bed): Use elf_x86_64_eh_frame_bnd_plt and
2259 elf_x86_64_eh_frame_plt_got.
2260 (elf_x86_64_size_dynamic_sections): Get unwind info from
2261 elf_x86_64_bnd_arch_bed for the BND PLT.
2262
2263 2017-01-11 Jeremy Soller <jackpot51@gmail.com>
2264
2265 * config.bfd: Add entries for i686-redox and x86_64-redox.
2266
2267 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
2268
2269 * elf32-i386.c (elf_i386_check_relocs): Align .eh_frame section
2270 to 4 bytes.
2271 * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Align
2272 .eh_frame section to 4 bytes for x32.
2273 (elf_x86_64_check_relocs): Likewise.
2274
2275 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
2276
2277 PR ld/20830
2278 * elf32-i386.c (elf_i386_eh_frame_plt_got): New.
2279 (PLT_GOT_FDE_LENGTH): Likewise.
2280 (elf_i386_plt_layout): Add eh_frame_plt_got and
2281 eh_frame_plt_got_size.
2282 (elf_i386_plt): Updated.
2283 (elf_i386_link_hash_table): Add plt_got_eh_frame.
2284 (elf_i386_check_relocs): Create .eh_frame section for .plt.got.
2285 (elf_i386_size_dynamic_sections): Allocate and initialize
2286 .eh_frame section for .plt.got.
2287 (elf_i386_finish_dynamic_sections): Adjust .eh_frame section for
2288 .plt.got.
2289 (elf_i386_nacl_plt): Add FIXME for eh_frame_plt_got and
2290 eh_frame_plt_got_size.
2291 * elf64-x86-64.c (elf_x86_64_eh_frame_plt_got): New.
2292 (PLT_GOT_FDE_LENGTH): Likewise.
2293 (elf_x86_64_backend_data): Add eh_frame_plt_got and
2294 eh_frame_plt_got_size.
2295 (elf_x86_64_arch_bed): Updated.
2296 (elf_x86_64_bnd_arch_bed): Add FIXME for eh_frame_plt_got and
2297 eh_frame_plt_got_size.
2298 (elf_x86_64_nacl_arch_bed): Likewise.
2299 (elf_x86_64_link_hash_table): Add plt_got_eh_frame.
2300 (elf_x86_64_check_relocs): Create .eh_frame section for .plt.got.
2301 (elf_x86_64_size_dynamic_sections): Allocate and initialize
2302 .eh_frame section for .plt.got.
2303 (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
2304 for .plt.got.
2305
2306 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
2307
2308 * elf32-i386.c (elf_i386_size_dynamic_sections): Set
2309 plt_eh_frame->size to eh_frame_plt_size and use eh_frame_plt.
2310
2311 2017-01-09 Nick Clifton <nickc@redhat.com>
2312
2313 * dwarf2.c (lookup_address_in_function_table): Return early if
2314 there are no functions in the given comp unit, or if the high
2315 address of the last function in the comp unit is less than the
2316 desired address.
2317
2318 2017-01-09 Nick Clifton <nickc@redhat.com>
2319
2320 PR binutils/21013
2321 * coffgen.c (_bfd_coff_get_external_symbols): Generate an error
2322 message if there are too many symbols to load.
2323
2324 2017-01-04 James Clarke <jrtc27@jrtc27.com>
2325
2326 * elf64-alpha.c (elf64_alpha_relax_opt_call): Don't set tsec_free
2327 if relocs are cached.
2328
2329 2017-01-03 Rich Felker <bugdal@aerifal.cx>
2330
2331 PR ld/21017
2332 * elf32-microblaze.c (microblaze_elf_check_relocs): Add an entry
2333 for R_MICROBLAZE_GOTOFF_64.
2334
2335 2017-01-03 Nick Clifton <nickc@redhat.com>
2336
2337 * mach-o.c (bfd_mach_o_lookup_uuid_command): Fix compile time
2338 warning about using a possibly uninitialised variable.
2339
2340 2017-01-02 Alan Modra <amodra@gmail.com>
2341
2342 * elf32-hppa.c (ensure_undef_weak_dynamic): New function.
2343 (allocate_plt_static, allocate_dynrelocs): Use it.
2344
2345 2017-01-02 Alan Modra <amodra@gmail.com>
2346
2347 * elf-hppa.h (elf_hppa_fake_sections): Set SHF_INFO_LINK for
2348 .PARISC.unwind section.
2349
2350 2017-01-02 Alan Modra <amodra@gmail.com>
2351
2352 PR ld/20989
2353 * elfxx-sparc.c (gdop_relative_offset_ok): New function.
2354 (_bfd_sparc_elf_relocate_section): Use it to validate GOT
2355 indirect to GOT pointer relative code edit.
2356
2357 2017-01-02 Alan Modra <amodra@gmail.com>
2358
2359 Update year range in copyright notice of all files.
2360
2361 For older changes see ChangeLog-2016
2362 \f
2363 Copyright (C) 2017 Free Software Foundation, Inc.
2364
2365 Copying and distribution of this file, with or without modification,
2366 are permitted in any medium without royalty provided the copyright
2367 notice and this notice are preserved.
2368
2369 Local Variables:
2370 mode: change-log
2371 left-margin: 8
2372 fill-column: 74
2373 version-control: never
2374 End: