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