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