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