Fix address violation errors parsing corrupt binary files.
[deliverable/binutils-gdb.git] / bfd / ChangeLog
CommitLineData
ca4cf9b9
NC
12017-07-24 Nick Clifton <nickc@redhat.com>
2
3 PR 21813
4 * mach-o.c (bfd_mach_o_canonicalize_relocs): Pass the base address
5 of the relocs to the canonicalize_one_reloc routine.
6 * mach-o.h (struct bfd_mach_o_backend_data): Update the prototype
7 for the _bfd_mach_o_canonicalize_one_reloc field.
8 * mach-o-arm.c (bfd_mach_o_arm_canonicalize_one_reloc): Add
9 res_base parameter. Use to check for corrupt pair relocs.
10 * mach-o-aarch64.c (bfd_mach_o_arm64_canonicalize_one_reloc):
11 Likewise.
12 * mach-o-i386.c (bfd_mach_o_i386_canonicalize_one_reloc):
13 Likewise.
14 * mach-o-x86-64.c (bfd_mach_o_x86_64_canonicalize_one_reloc):
15 Likewise.
16
17 * vms-alpha.c (_bfd_vms_slurp_eihd): Make sure that there is
18 enough data in the record before attempting to parse it.
19 (_bfd_vms_slurp_eeom): Likewise.
20
21 (_bfd_vms_slurp_egsd): Check for an invalid section index.
22 (image_set_ptr): Likewise.
23 (alpha_vms_slurp_relocs): Likewise.
24
47aeb64c
NC
252017-07-24 Nick Clifton <nickc@redhat.com>
26
27 PR 21803
28 * reloc.c (_bfd_unrecognized_reloc): New function. Reports
29 an unrecognized reloc and sets the bfd_error value.
30 * libbfd.h: Regenerate.
31 * elf32-arm.c (elf32_arm_final_link_relocate): Use the new
32 function.
33 * elf32-i386.c (elf_i386_relocate_section): Likewise.
34 * elf32-tilepro.c (tilepro_elf_relocate_section): Likewise.
35 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
36 * elfnn-aarch64.c (elfNN_aarch64_relocate_section): Likewise.
37 * elfxx-tilegx.c (tilegx_elf_relocate_section): Likewise.
38
15a3a14f
AM
392017-07-23 Alan Modra <amodra@gmail.com>
40
41 * elf64-ppc.c (ppc64_elf_size_stubs): Correct advance to
42 restore of LR.
43
f2e6a843
SN
442017-07-19 Szabolcs Nagy <szabolcs.nagy@arm.com>
45
46 PR ld/18841
47 * elfnn-aarch64.c (elfNN_aarch64_reloc_type_class): Return
48 reloc_class_ifunc for ifunc symbols.
49
909e4e71
NC
502017-07-19 Nick Clifton <nickc@redhat.com>
51
52 PR 21787
53 * archive.c (bfd_generic_archive_p): If the bfd does not have the
54 correct magic bytes at the start, set the error to wrong format
55 and clear the format selector before returning NULL.
56
29866fa1
NC
572017-07-19 Nick Clifton <nickc@redhat.com>
58
59 PR 21786
60 * coff-rs6000.c (_bfd_strntol): New function.
61 (_bfd_strntoll): New function.
62 (GET_VALUE_IN_FIELD): New macro.
63 (EQ_VALUE_IN_FIELD): new macro.
64 (_bfd_xcoff_slurp_armap): Use new macros.
65 (_bfd_xcoff_archive_p): Likewise.
66 (_bfd_xcoff_read_ar_hdr): Likewise.
67 (_bfd_xcoff_openr_next_archived_file): Likewise.
68 (_bfd_xcoff_stat_arch_elt): Likewise.
6c4e7b6b
NC
69 * coff64-rs6000.c (_bfd_strntol): New function.
70 (_bfd_strntoll): New function.
71 (GET_VALUE_IN_FIELD): New macro.
72 (xcoff64_slurp_armap): Use new macros.
29866fa1 73
684d5a10
JEM
742017-07-19 Claudiu Zissulescu <claziss@synopsys.com>
75 John Eric Martin <John.Martin@emmicro-us.com>
76
77 * bfd-in2.h: Regenerate.
78 * libbfd.h: Regenerate.
79 * elf32-arc.c (JLI): Define.
80 * reloc.c: Add JLI relocations.
81
de194d85
YC
822017-07-18 Nick Clifton <nickc@redhat.com>
83
84 PR 21775
85 * coff-sh.c: Fix spelling typos.
86 * compress.c: Likewise.
87 * cpu-pdp11.c: Likewise.
88 * ecofflink.c: Likewise.
89 * elf-m10300.c: Likewise.
90 * elf.c: Likewise.
91 * elf32-arm.c: Likewise.
92 * elf32-m68k.c: Likewise.
93 * elf32-nds32.c: Likewise.
94 * elf32-ppc.c: Likewise.
95 * elf32-sh.c: Likewise.
96 * elf32-v850.c: Likewise.
97 * elf64-ppc.c: Likewise.
98 * elf64-x86-64.c: Likewise.
99 * elflink.c: Likewise.
100 * elfnn-aarch64.c: Likewise.
101 * elfxx-mips.c: Likewise.
102 * som.c: Likewise.
103 * sunos.c: Likewise.
104 * vms-alpha.c: Likewise.
105 * xcofflink.c: Likewise.
106
e4e21d9e
NC
1072017-07-18 Nick Clifton <nickc@redhat.com>
108
109 PR binutils/21781
110 * coffcode.h (handle_COMDAT): Replace abort with an error message
111 and return.
112
8e85f840
L
1132017-07-17 H.J. Lu <hongjiu.lu@intel.com>
114
115 PR ld/21782
116 * elf64-x86-64.c (elf_x86_64_relocate_section): Limit PIC check
117 to shared library.
118
dd57c19c
L
1192017-07-17 H.J. Lu <hongjiu.lu@intel.com>
120
121 * elf64-x86-64.c (elf_x86_64_relocate_section): Re-indent.
122
676ee2b5
AM
1232017-07-16 Alan Modra <amodra@gmail.com>
124
125 * elf64-ppc.c (ppc64_elf_relocate_section): Don't optimize
126 __tls_index GOT entries when using __tls_get_addr_opt stub.
127 * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
128
429d795d
AM
1292017-07-12 Alan Modra <amodra@gmail.com>
130
131 * po/es.po: Update from translationproject.org/latest/bfd/.
132 * po/fi.po: Likewise.
133 * po/fr.po: Likewise.
134 * po/id.po: Likewise.
135 * po/ja.po: Likewise.
136 * po/ro.po: Likewise.
137 * po/ru.po: Likewise.
138 * po/sr.po: Likewise.
139 * po/sv.po: Likewise.
140 * po/tr.po: Likewise.
141 * po/uk.po: Likewise.
142 * po/vi.po: Likewise.
143 * po/zh_CN.po: Likewise.
144 * po/hr.po: New file from translationproject.org.
145 * configure.ac (ALL_LINGUAS): Add hr. Sort.
146 * configure: Regenerate.
147
0bae9e9e
NC
1482017-07-12 Nick Clifton <nickc@redhat.com>
149
150 Fix compile time warnings using gcc 7.1.1.
151 * elf32-xtensa.c (elf_xtensa_get_plt_section): Increase length of
152 plt_name buffer.
153 (elf_xtensa_get_gotplt_section): Increase length of got_name
154 buffer.
155 * mach-o-arm.c (bfd_mach_o_arm_canonicalize_one_reloc): Add a
156 default return of FALSE.
157 * mach-o-i386.c (bfd_mach_o_i386_canonicalize_one_reloc): Add a
158 default return of FALSE.
159
d42c267e
AM
1602017-07-12 Alan Modra <amodra@gmail.com>
161
162 * binary.c (binary_set_section_contents): Don't print filepos in
163 error message.
164 (coff_write_object_contents): Cast size_t for error message.
165 (coff_slurp_line_table): Don't use bfd_vma symndx.
166 (coff_slurp_reloc_table): Remove unneeded cast.
167 * dwarf2.c (read_section): Cast bfd_int64_t to long long for
168 error message.
169 (find_abstract_instance_name): Likewise.
170 * elf32-arm.c (arm_type_of_stub): Correct error arg order.
171 (bfd_elf32_arm_stm32l4xx_erratum_scan): Don't cast error arg.
172 (elf32_arm_check_relocs): Make r_symndx an int.
173 * elf32-cris.c (cris_elf_check_relocs): Delete extraneous %s in
174 format string.
175 * elf32-metag.c (elf_metag_relocate_section): Delete extra error
176 message arg.
177 * elf32-nds32.c (nds32_elf_ex9_build_hash_table): Rewrite bogus
178 error message.
179 * elf32-i386.c (elf_i386_check_relocs): Make r_symndx an int.
180 * elf32-s390.c (elf_s390_check_relocs): Likewise.
181 * elf32-tic6x.c (elf32_tic6x_check_relocs): Likewise.
182 * elf32-tilepro.c (tilepro_elf_check_relocs): Likewise.
183 * elf32-xtensa.c (elf_xtensa_check_relocs): Likewise.
184 * elf64-s390.c (elf_s390_check_relocs): Likewise.
185 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
186 * elfnn-aarch64.c (elfNN_aarch64_check_relocs): Likewise.
187 * elfnn-riscv.c (riscv_elf_check_relocs): Likewise.
188 * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Likewise.
189 * elfxx-tilegx.c (tilegx_elf_check_relocs): Likewise.
190 * elf64-mmix.c (_bfd_mmix_after_linker_allocation): Cast size_t args
191 and use %lu for error message.
192 * elflink.c (elf_link_adjust_relocs): Delete extra error message arg.
193 * mmo.c (mmo_scan): Make stab_loc a file_ptr. Cast expression for
194 error message.
195
196 * elf32-arm.c (elf32_arm_tls_relax): Correct format string and args
197 in error message.
198 (elf32_arm_final_link_relocate): Likewise.
199 * coff-arm.c (bfd_arm_process_before_allocation): Likewise.
200 * coffcode.h (styp_to_sec_flags): Likewise.
201 * cofflink.c (_bfd_coff_write_global_sym): Likewise.
202 * ecoff.c (_bfd_ecoff_slurp_symbol_table): Likewise.
203 * elf32-arc.c (arc_elf_merge_private_bfd_data): Likewise.
204 * elf32-bfin.c (bfinfdpic_check_relocs): Likewise.
205 (elf32_bfin_merge_private_bfd_data): Likewise.
206 * elf32-cris.c (cris_elf_relocate_section): Likewise.
207 * elf32-frv.c (frv_elf_merge_private_bfd_data): Likewise.
208 * elf32-i370.c (i370_elf_merge_private_bfd_data): Likewise.
209 (i370_elf_relocate_section): Likewise.
210 * elf32-iq2000.c (iq2000_elf_merge_private_bfd_data): Likewise.
211 * elf32-m32c.c (m32c_elf_merge_private_bfd_data): Likewise.
212 * elf32-m68hc1x.c (_bfd_m68hc11_elf_merge_private_bfd_data): Likewise.
213 * elf32-mcore.c (mcore_elf_relocate_section): Likewise.
214 * elf32-mep.c (mep_elf_merge_private_bfd_data): Likewise.
215 * elf32-mt.c (mt_elf_merge_private_bfd_data): Likewise.
216 * elf64-sparc.c (elf64_sparc_merge_private_bfd_data): Likewise.
217 * elfxx-mips.c (mips_elf_merge_obj_e_flags): Likewise.
218 (_bfd_mips_elf_merge_private_bfd_data): Likewise.
219 * ieee.c (ieee_write_id, read_id): Likewise.
220 * mach-o.c (bfd_mach_o_write_contents): Likewise.
221 (bfd_mach_o_layout_commands, bfd_mach_o_read_section_32): Likewise.
222 (bfd_mach_o_read_section_64, bfd_mach_o_read_symtab_symbol): Likewise.
223 (bfd_mach_o_read_command, bfd_mach_o_header_p): Likewise.
224 * peXXigen.c (_bfd_XXi_swap_aouthdr_in): Likewise.
225 * stabs.c (_bfd_link_section_stabs): Likewise.
226
227 * coff-arm.c (coff_arm_relocate_section): Use L modifier in error
228 format.
229 * coff-mcore.c (coff_mcore_relocate_section): Likewise.
230 * coff-ppc.c (coff_ppc_relocate_section): Likewise.
231 * coff-rs6000.c (xcoff_reloc_type_toc): Likewise.
232 * coff-sh.c (sh_relax_section): Likewise.
233 (sh_relax_delete_bytes, sh_swap_insns): Likewise.
234 * coff-tic80.c (coff_tic80_relocate_section): Likewise.
235 * coffcode.h (coff_slurp_reloc_table): Likewise.
236 * coffgen.c (_bfd_coff_get_external_symbols): Likewise.
237 (_bfd_coff_read_string_table): Likewise.
238 * cofflink.c (_bfd_coff_generic_relocate_section): Likewise.
239 * compress.c (bfd_get_full_section_contents): Likewise.
240 * dwarf2.c (read_formatted_entries, decode_line_info): Likewise.
241 * elf-m10300.c (mn10300_elf_relocate_section): Likewise.
242 * elf.c (bfd_elf_string_from_elf_section): Likewise.
243 * elf32-arc.c (arc_special_overflow_checks): Likewise.
244 * elf32-arm.c (elf32_arm_tls_relax): Likewise.
245 (elf32_arm_final_link_relocate, elf32_arm_relocate_section): Likewise.
246 (elf32_arm_write_section): Likewise.
247 * elf32-bfin.c (bfin_relocate_section): Likewise.
248 (bfinfdpic_relocate_section): Likewise.
249 * elf32-hppa.c (hppa_build_one_stub): Likewise.
250 (final_link_relocate, elf32_hppa_relocate_section): Likewise.
251 * elf32-i386.c (elf_i386_tls_transition): Likewise.
252 (elf_i386_relocate_section): Likewise.
253 * elf32-ip2k.c (ip2k_final_link_relocate): Likewise.
254 * elf32-lm32.c (lm32_elf_finish_dynamic_sections): Likewise.
255 * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
256 * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
257 * elf32-metag.c (elf_metag_relocate_section): Likewise.
258 * elf32-nds32.c (unrecognized_reloc_msg): Likewise.
259 (nds32_elf_relax_longcall1, nds32_elf_relax_longcall2): Likewise.
260 (nds32_elf_relax_longcall3, nds32_elf_relax_longjump1): Likewise.
261 (nds32_elf_relax_longjump2, nds32_elf_relax_longjump3): Likewise.
262 (nds32_elf_relax_longcall4, nds32_elf_relax_longcall5): Likewise.
263 (nds32_elf_relax_longcall6, nds32_elf_relax_longjump4): Likewise.
264 (nds32_elf_relax_longjump5, nds32_elf_relax_longjump6): Likewise.
265 (nds32_elf_relax_longjump7, nds32_elf_relax_loadstore): Likewise.
266 (nds32_elf_relax_ptr, nds32_elf_ex9_build_hash_table): Likewise.
267 * elf32-nios2.c (nios2_elf32_relocate_section): Likewise.
268 * elf32-rx.c (UNSAFE_FOR_PID): Likewise.
269 * elf32-s390.c (invalid_tls_insn, elf_s390_relocate_section): Likewise.
270 * elf32-score.c (s3_bfd_score_elf_check_relocs): Likewise.
271 * elf32-score7.c (s7_bfd_score_elf_check_relocs): Likewise.
272 * elf32-sh.c (sh_elf_relax_section): Likewise.
273 (sh_elf_relax_delete_bytes, sh_elf_swap_insns): Likewise.
274 (sh_elf_relocate_section): Likewise.
275 * elf32-sh64.c (shmedia_prepare_reloc): Likewise.
276 * elf32-spu.c (spu_elf_relocate_section): Likewise.
277 * elf32-tic6x.c (elf32_tic6x_relocate_section): Likewise.
278 * elf32-tilepro.c (tilepro_elf_relocate_section): Likewise.
279 * elf32-v850.c (v850_elf_relax_section): Likewise.
280 * elf32-vax.c (elf_vax_check_relocs): Likewise.
281 (elf_vax_relocate_section): Likewise.
282 * elf32-xtensa.c (elf_xtensa_relocate_section): Likewise.
283 (extend_ebb_bounds_forward, extend_ebb_bounds_backward): Likewise.
284 (compute_text_actions, compute_ebb_proposed_actions): Likewise.
285 (do_fix_for_relocatable_link): Likewise.
286 * elf64-alpha.c (elf64_alpha_relax_got_load): Likewise.
287 (elf64_alpha_relax_with_lituse): Likewise.
288 * elf64-hppa.c (elf64_hppa_finish_dynamic_symbol): Likewise.
289 (elf_hppa_final_link_relocate): Likewise.
290 * elf64-ia64-vms.c (elf64_ia64_relax_section): Likewise.
291 (elf64_ia64_choose_gp, elf64_ia64_relocate_section): Likewise.
292 (elf64_vms_link_add_object_symbols): Likewise.
293 * elf64-mmix.c (mmix_elf_perform_relocation): Likewise.
294 (mmix_final_link_relocate): Likewise.
295 * elf64-s390.c (invalid_tls_insn): Likewise.
296 (elf_s390_relocate_section): Likewise.
297 * elf64-sh64.c (sh_elf64_relocate_section): Likewise.
298 * elf64-x86-64.c (elf_x86_64_tls_transition): Likewise.
299 (elf_x86_64_relocate_section): Likewise.
300 * elfcode.h (elf_slurp_symbol_table): Likewise.
301 * elfcore.h (elf_core_file_p): Likewise.
302 * elflink.c (elf_link_read_relocs_from_section): Likewise.
303 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Likewise.
304 (elfNN_aarch64_relocate_section): Likewise.
305 * elfnn-ia64.c (elfNN_ia64_relax_section): Likewise.
306 (elfNN_ia64_choose_gp, elfNN_ia64_relocate_section): Likewise.
307 * elfnn-riscv.c (riscv_elf_relocate_section): Likewise.
308 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
309 (_bfd_mips_elf_relocate_section): Likewise.
310 (_bfd_mips_elf_finish_dynamic_symbol, mips_finish_exec_plt): Likewise.
311 * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Likewise.
312 * elfxx-tilegx.c (tilegx_elf_relocate_section): Likewise.
313 * ieee.c (ieee_slurp_external_symbols): Likewise.
314 * ihex.c (ihex_write_object_content): Likewise.
315 * mach-o.c (bfd_mach_o_build_exec_seg_command): Likewise.
316 * merge.c (_bfd_merged_section_offset): Likewise.
317 * mmo.c (mmo_write_loc_chunk): Likewise.
318 (mmo_write_object_contents): Likewise.
319 * peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Likewise.
320 * stabs.c (_bfd_link_section_stabs): Likewise.
321 * xcofflink.c (xcoff_link_add_symbols, xcoff_find_tc0): Likewise.
322
e3fbc3da
AM
3232017-07-11 Alan Modra <amodra@gmail.com>
324
325 * elf32-ppc.c (ppc_elf_relocate_section): Fix typo.
326
2c4d9cbe
AM
3272017-07-11 Alan Modra <amodra@gmail.com>
328
329 * elf32-ppc.c (ppc_elf_relocate_section): Emit "unexpected
330 instruction" error using _bfd_error_handler, not einfo.
331
adce5b39
NC
3322017-07-10 Nick Clifton <nickc@redhat.com>
333
334 * coffcode.h (coff_slurp_symbol_table): Do not include an entry
335 for C_AIX_WEAKEXT if it has the same value as C_WEAKEXT.
336
e6f3b9c3
JB
3372017-07-07 John Baldwin <jhb@FreeBSD.org>
338
339 * elf.c (elfcore_grok_freebsd_note): Handle NT_FREEBSD_PTLWPINFO.
340
532cc313
AM
3412017-07-07 Alan Modra <amodra@gmail.com>
342
343 * coffcode.h (coff_slurp_symbol_table): Handle C_AIX_WEAKEXT.
344
1cf9552b
AM
3452017-07-07 Alan Modra <amodra@gmail.com>
346
347 * bfd.c (_doprnt): Replace "L" with "ll" when printing bfd_vma
348 as long long. Move code replacing "ll" with "I64", and simplify.
349
a0b7b105
L
3502017-07-06 H.J. Lu <hongjiu.lu@intel.com>
351
352 * bfd.c (_doprnt): Convert 'L' to 'l' when setting wide_width
353 to 1.
354
1d827a72
L
3552017-07-05 H.J. Lu <hongjiu.lu@intel.com>
356
357 * dwarf2.c (line_info_add_include_dir_stub): Replace time with
358 xtime.
359 (line_info_add_file_name): Likewise.
360 (decode_line_info): Likewise.
361
0d702cfe
TG
3622017-07-04 Tristan Gingold <gingold@adacore.com>
363
364 * version.m4: Bump version to 2.29.51
365 * configure: Regenerate.
366
564e46b7
JW
3672017-07-04 Jiong Wang <jiong.wang@arm.com>
368
369 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Remove the
370 sanity check at the head of this function.
371
0041f7df
JK
3722017-07-04 Jan Kratochvil <jan.kratochvil@redhat.com>
373
374 * dwarf2.c (struct dwarf2_debug): Add fields dwarf_line_str_buffer and
375 dwarf_line_str_size.
376 (struct attr_abbrev): Add field implicit_const.
377 (dwarf_debug_sections): Add .debug_line_str.
378 (enum dwarf_debug_section_enum): Add debug_line_str and debug_max.
379 (dwarf_debug_section_assert): Add static assertion.
380 (read_indirect_line_string): New.
381 (read_abbrevs): Support DW_FORM_implicit_const.
382 (is_str_attr): Support DW_FORM_line_strp.
383 (read_attribute_value): Support DW_FORM_line_strp and
384 DW_FORM_implicit_const.
385 (read_attribute): Support DW_FORM_implicit_const.
386 (line_info_add_include_dir, line_info_add_include_dir_stub):
387 (line_info_add_file_name, read_formatted_entries): New.
388 (decode_line_info, parse_comp_unit): Support DWARF 5.
389 (_bfd_dwarf2_cleanup_debug_info): Free dwarf_line_str_buffer.
390
d8cd8c1f
EB
3912017-07-03 Egeyar Bagcioglu <egeyar.bagcioglu@oracle.com>
392
393 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Remove the
394 abort statement that was put for symbols that are not dynamic.
395
15e6ed8c
TG
3962017-07-03 Tristan Gingold <gingold@adacore.com>
397
398 * po/bfd.pot: Regenerate
399
76cfced5
AM
4002017-07-03 Alan Modra <amodra@gmail.com>
401
402 * bfd.c (_doprnt): Rewrite "ll" and "L" modifiers to "I64" for
403 __MSVCRT__. Support "L" modifier for bfd_vma. Formatting.
404 * elf.c (setup_group): Use "Lx" to print sh_size.
405 (_bfd_elf_setup_sections): Remove unnecessary cast and print
406 unknown section type in hex.
407 (copy_special_section_fields): Style fix.
408 (bfd_section_from_shdr): Correct format for sh_link. Use a
409 common error message for all the variants of unrecognized
410 section types.
411 (assign_file_positions_for_load_sections): Use "Lx" for lma
412 adjust error message.
413 (assign_file_positions_for_non_load_sections): Formatting.
414 (rewrite_elf_program_header): Formatting. Use "Lx" for
415 bfd_vma values in error messages.
416 * elfcode.h (elf_slurp_reloc_table_from_section): Cast
417 ELF_R_SYM value to type expected by format.
418 * elflink.c (elf_link_read_relocs_from_section): Use "Lx"
419 in error messages.
420 (elf_link_add_object_symbols): Use "Lu" for symbol sizes.
421 (elf_link_input_bfd): Use "Lx" for r_info.
422 (bfd_elf_gc_record_vtinherit): Use "Lx" for offset.
423
ce9116fd
AM
4242017-07-03 Alan Modra <amodra@gmail.com>
425
426 * bfd.c (bfd_scan_vma): Don't use long long unless HAVE_LONG_LONG.
427 * coff-rs6000.c (FMT20): Handle hosts with 64-bit long and
428 Microsoft C library variant of long long format specifier.
429 (PRINT20): Cast value to bfd_uint64_t not long long.
430 * coffcode.h (coff_print_aux): Use BFD_VMA_FMT.
431 * coff-x86_64.c (coff_amd64_reloc): Use bfd_uint64_t rather than
432 long long. Don't cast to bfd_vma.
433 * elf32-score.c (score3_bfd_getl48): Likewise.
434 * vms-alpha.c (_bfd_vms_slurp_eisd): Likewise.
435
cd9af601
AM
4362017-07-03 Alan Modra <amodra@gmail.com>
437
438 * elf.c (_bfd_elf_print_private_bfd_data): Use BFD_VMA_FMT to
439 print d_tag.
440 (bfd_elf_print_symbol): Don't cast symbol->flags.
441 (_bfd_elf_symbol_from_bfd_symbol): Likewise.
442 * elf32-ppc.c (ppc_elf_begin_write_processing): Correct
443 _bfd_error_handler argument order.
444 (ppc_elf_merge_private_bfd_data): Don't cast flags.
445
33c734b2
AM
4462017-07-03 Alan Modra <amodra@gmail.com>
447
448 * configure.ac: Invoke AC_CHECK_TYPES for long long. Invoke
449 AC_TYPE_LONG_DOUBLE.
450 * configure: Regenerate.
451 * config.in: Regenerate.
452
3df5cd13
AW
4532017-06-29 Andrew Waterman <andrew@sifive.com>
454
455 * elfnn-riscv.c (riscv_elf_adjust_dynamic_symbol): Fix TLS copy
456 relocs.
457
ec1acaba
EB
4582017-06-29 Egeyar Bagcioglu <egeyar.bagcioglu@oracle.com>
459
460 * elfxx-sparc.c (allocate_dynrelocs): Don't make a symbol dynamic
461 unless it is undefined weak.
462 * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Set the flag
463 relative_reloc to direct non-dynamic symbols to R_SPARC_RELATIVE
464 relocation.
465 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): If symbol
466 is not dynamic in PIC, abort.
467
ff07562f
JW
4682017-06-29 Jiong Wang <jiong.wang@arm.com>
469
470 PR ld/21402
471 * elfnn-aarch64.c (elfNN_aarch64_allocate_dynrelocs): Only make
472 undefined weak symbols into dynamic.
473 (elfNN_aarch64_final_link_relocate): Generate runtime RELATIVE
474 relocation for non-dynamic symbols.
475 (elfNN_aarch64_finish_dynamic_symbol): Add sanity check.
476
2aff25ba
JW
4772017-06-29 Jiong Wang <jiong.wang@arm.com>
478
479 * elfnn-aarch64.c (aarch64_relocation_aginst_gp_p): New function.
480 (elfNN_aarch64_final_link_relocate): Delete duplicated code for
481 BFD_RELOC_AARCH64_LD64_GOTOFF_LO15, BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC,
482 BFD_RELOC_AARCH64_MOVW_GOTOFF_G1.
483 * elfxx-aarch64.c (_bfd_aarch64_elf_resolve_relocation): Optimize the
484 support for them.
485
88ab90e8
AA
4862017-06-29 Andreas Arnez <arnez@linux.vnet.ibm.com>
487
488 * elf-bfd.h (elfcore_write_s390_gs_cb): Add prototype.
489 (elfcore_write_s390_gs_bc): Likewise.
490 * elf.c (elfcore_grok_s390_gs_cb): New function.
491 (elfcore_grok_s390_gs_bc): New function.
492 (elfcore_grok_note): Call them.
493 (elfcore_write_s390_gs_cb): New function.
494 (elfcore_write_s390_gs_bc): New function.
495 (elfcore_write_register_note): Call them.
496
328ce951
L
4972017-06-28 H.J. Lu <hongjiu.lu@intel.com>
498
499 * libbfd.c (_bfd_generic_get_section_contents): Don't call
500 bfd_get_file_size. Check archive element size.
501 (_bfd_generic_get_section_contents_in_window): Likewise.
502
47fdcf63
L
5032017-06-28 H.J. Lu <hongjiu.lu@intel.com>
504
505 * bfd-in2.h: Regenerated.
506 * bfdio.c (bfd_get_size): Change return type to ufile_ptr.
507 (bfd_get_file_size): Likewise.
508
38bf472a
MR
5092017-06-28 Maciej W. Rozycki <macro@imgtec.com>
510 Matthew Fortune <matthew.fortune@imgtec.com>
511
512 * archures.c (bfd_mach_mips_interaptiv_mr2): New macro.
513 * cpu-mips.c (I_interaptiv_mr2): New enum value.
514 (arch_info_struct): Add "mips:interaptiv-mr2" entry.
515 * elfxx-mips.c (_bfd_elf_mips_mach) <E_MIPS_MACH_IAMR2>: New
516 case.
517 (mips_set_isa_flags) <bfd_mach_mips_interaptiv_mr2>: Likewise.
518 (bfd_mips_isa_ext) <bfd_mach_mips_interaptiv_mr2>: Likewise.
519 (print_mips_isa_ext) <AFL_EXT_INTERAPTIV_MR2>: Likewise.
520 (mips_mach_extensions): Add `bfd_mach_mipsisa32r3' and
521 `bfd_mach_mips_interaptiv_mr2' entries.
522 * bfd-in2.h: Regenerate.
523
2d68166e
NC
5242017-06-27 Nick Clifton <nickc@redhat.com>
525
526 * tekhex.c (pass_over): Revert accidental conversion of a local
527 array to a static array.
528
68063779
SKS
5292017-06-27 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
530
531 PR ld/13402
532 * elf32-avr.c (elf32_avr_adjust_diff_reloc_value): Adjust
533 reloc addend if necessary. Adjust diff only if
534 shrinked_insn_address < end_address.
535
ea9aafc4
AM
5362017-06-27 Alan Modra <amodra@gmail.com>
537
538 PR binutils/21665
539 * libbfd.c (_bfd_generic_get_section_contents): Warning fix.
540 (_bfd_generic_get_section_contents_in_window): Likewise.
541
a6cbf936
KLC
5422017-06-26 Kuan-Lin Chen <rufus@andestech.com>
543
544 * elfnn-riscv.c (perform_relocation): Support the new
545 R_RISCV_32_PCREL relocation.
546 (riscv_elf_relocate_section): Likewise.
547 * elfxx-riscv.c (howto_table): Likewise.
548 (riscv_reloc_map): Likewise.
549 * bfd-in2.h (BFD_RELOC_RISCV_32_PCREL): New relocation.
550 * libbfd.h: Regenerate.
551
7211ae50
AM
5522017-06-27 Alan Modra <amodra@gmail.com>
553
554 PR binutils/21665
555 * libbfd.c (_bfd_generic_get_section_contents): Delete abort.
556 Use unsigned file pointer type, and remove cast.
557 * libbfd.c (_bfd_generic_get_section_contents_in_window): Likewise.
558 Add "count", not "sz".
559
ab27f80c
PA
5602017-06-26 Pedro Alves <palves@redhat.com>
561
562 PR binutils/21665
563 * libbfd.c (_bfd_generic_get_section_contents): Add "count", not
564 "sz".
565
1f473e3d
L
5662017-06-26 H.J. Lu <hongjiu.lu@intel.com>
567
568 PR binutils/21665
569 * libbfd.c (_bfd_generic_get_section_contents_in_window): Add
570 a missing line.
571
b417536f
MR
5722017-06-26 Maciej W. Rozycki <macro@imgtec.com>
573
574 * cpu-mips.c (arch_info_struct): Mark the 4010 32-bit.
575 * elfxx-mips.c (mips_set_isa_flags) <bfd_mach_mips4010>: Set
576 E_MIPS_ARCH_2 rather than E_MIPS_ARCH_3 in `e_flags'.
577 (mips_mach_extensions): Mark `bfd_mach_mips4010' as extending
578 `bfd_mach_mips6000' rather than `bfd_mach_mips4000'.
579
0630b49c
L
5802017-06-26 H.J. Lu <hongjiu.lu@intel.com>
581
582 PR binutils/21665
583 * compress.c (bfd_get_full_section_contents): Don't check the
584 file size here.
585 * libbfd.c (_bfd_generic_get_section_contents): Check for and
ea9aafc4 586 reject a section whose size + offset is greater than the size
0630b49c
L
587 of the entire file.
588 (_bfd_generic_get_section_contents_in_window): Likewise.
515a4464 589
04e15b4a
NC
5902017-06-26 Nick Clifton <nickc@redhat.com>
591
592 PR binutils/21670
593 * tekhex.c (getvalue): Check for the source pointer exceeding the
594 end pointer before the first byte is read.
595
cfd14a50
NC
5962017-06-26 Nick Clifton <nickc@redhat.com>
597
598 PR binutils/21665
ea9aafc4 599 * opncls.c (get_build_id): Check that the section is big enough
cfd14a50
NC
600 to contain the whole note.
601 * compress.c (bfd_get_full_section_contents): Check for and reject
ea9aafc4 602 a section whose size is greater than the size of the entire file.
cfd14a50
NC
603 * elf32-v850.c (v850_elf_copy_notes): Allow for the ouput to not
604 contain a notes section.
605
93ec5e23
AK
6062017-06-26 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
607
608 * elf64-s390.c (elf_s390_additional_program_headers): Add NULL
609 pointer checks.
610 (elf_s390_modify_segment_map): Likewise.
611 (bfd_elf_s390_set_options): Lisewise.
612
57963c05
AM
6132017-06-26 Alan Modra <amodra@gmail.com>
614
615 * elflink.c (_bfd_elf_link_create_dynstrtab): Don't make dynobj
616 a --just-syms bfd.
617 (_bfd_elf_size_group_sections): Skip --just-syms bfds.
618 (bfd_elf_size_dynamic_sections): Ignore .note.GNU-stack and
619 .preinit_array on --just-syms bfds.
620 (_bfd_elf_gc_mark_extra_sections): Skip --just-syms bfds.
621 (elf_gc_sweep, bfd_elf_parse_eh_frame_entries): Likewise.
622 (bfd_elf_gc_sections, bfd_elf_discard_info): Likewise.
623
5cc4ca83
ST
6242017-06-25 Sergei Trofimovich <slyfox@gentoo.org>
625
626 * elf.c (find_link): Bounds check "hint".
627
bff0500d
TP
6282017-06-24 Thomas Preud'homme <thomas.preudhomme@arm.com>
629
630 * elf32-arm.c (using_thumb_only): Update list of architectures in
631 BFD_ASSERT for which the logic is valid.
632 (using_thumb2_bl): Likewise.
633 (using_thumb2): Likewise and return true for ARMv8-R.
634 (arch_has_arm_nop): Likewise.
635 (tag_cpu_arch_combine): New v8r table for ARMv8-R Tag_CPU_arch
636 merging logic. Update commentis for value 15 of v8m_baseline,
637 v8m_mainline and v4t_plus_v6_m arrays. Use v8r array to decide
638 merging of value 15 of Tag_CPU_arch.
639
4aa57d6a
JW
6402017-06-23 Jiong Wang <jiong.wang@arm.com>
641
642 * reloc.c (BFD_RELOC_AARCH64_ADR_GOTPAGE): Rename to
643 BFD_RELOC_AARCH64_ADR_GOT_PAGE
644 * bfd-in2.h: Regenerate.
645
5d8763a3
L
6462017-06-22 H.J. Lu <hongjiu.lu@intel.com>
647
648 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Move
649 the error_alignment label forward. Properly align program
650 property note section.
651
e652757b
EC
6522017-06-22 Eric Christopher <echristo@gmail.com>
653
654 * elf32-arm.c (elf32_arm_final_link_relocate): Use labs rather than
655 abs to fix a truncation warning.
656
84da4cf8
L
6572017-06-22 H.J. Lu <hongjiu.lu@intel.com>
658
659 * elf32-i386.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Resolve
660 local undefined weak symbol to 0.
661 * elf64-x86-64.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Likewise.
662
48580982
L
6632017-06-22 H.J. Lu <hongjiu.lu@intel.com>
664
665 * elf32-i386.c (elf_i386_merge_gnu_properties): If info->shstk
666 is set, turn on GNU_PROPERTY_X86_FEATURE_1_SHSTK.
667 (elf_i386_link_setup_gnu_properties): If info->shstk is set,
668 turn on GNU_PROPERTY_X86_FEATURE_1_IBT.
669 * elf64-x86-64.c (elf_x86_64_merge_gnu_properties): If
670 info->shstk is set, turn on GNU_PROPERTY_X86_FEATURE_1_SHSTK.
671 (elf_x86_64_link_setup_gnu_properties): If info->shstk is set,
672 turn on GNU_PROPERTY_X86_FEATURE_1_IBT.
673
ee2fdd6f
L
6742017-06-22 H.J. Lu <hongjiu.lu@intel.com>
675
676 * elf32-i386.c (elf_i386_lazy_ibt_plt0_entry): New.
677 (elf_i386_lazy_ibt_plt_entry): Likewise.
678 (elf_i386_pic_lazy_ibt_plt0_entry): Likewise.
679 (elf_i386_non_lazy_ibt_plt_entry): Likewise.
680 (elf_i386_pic_non_lazy_ibt_plt_entry): Likewise.
681 (elf_i386_eh_frame_lazy_ibt_plt): Likewise.
682 (elf_i386_lazy_plt_layout): Likewise.
683 (elf_i386_non_lazy_plt_layout): Likewise.
684 (elf_i386_link_hash_entry): Add plt_second.
685 (elf_i386_link_hash_table): Add plt_second and
686 plt_second_eh_frame.
687 (elf_i386_allocate_dynrelocs): Use the second PLT if needed.
688 (elf_i386_size_dynamic_sections): Use .plt.got unwind info for
689 the second PLT. Check the second PLT.
690 (elf_i386_relocate_section): Use the second PLT to resolve
691 PLT reference if needed.
692 (elf_i386_finish_dynamic_symbol): Fill and use the second PLT if
693 needed.
694 (elf_i386_finish_dynamic_sections): Set sh_entsize on the
695 second PLT. Generate unwind info for the second PLT.
696 (elf_i386_plt_type): Add plt_second.
697 (elf_i386_get_synthetic_symtab): Support the second PLT.
698 (elf_i386_parse_gnu_properties): Support
699 GNU_PROPERTY_X86_FEATURE_1_AND.
700 (elf_i386_merge_gnu_properties): Support
701 GNU_PROPERTY_X86_FEATURE_1_AND. If info->ibt is set, turn
702 on GNU_PROPERTY_X86_FEATURE_1_IBT
703 (elf_i386_link_setup_gnu_properties): If info->ibt is set,
704 turn on GNU_PROPERTY_X86_FEATURE_1_IBT. Use IBT-enabled PLT
705 for info->ibtplt, info->ibt or GNU_PROPERTY_X86_FEATURE_1_IBT
706 is set on all relocatable inputs.
707 * elf64-x86-64.c (elf_x86_64_lazy_ibt_plt_entry): New.
708 (elf_x32_lazy_ibt_plt_entry): Likewise.
709 (elf_x86_64_non_lazy_ibt_plt_entry): Likewise.
710 (elf_x32_non_lazy_ibt_plt_entry): Likewise.
711 (elf_x86_64_eh_frame_lazy_ibt_plt): Likewise.
712 (elf_x32_eh_frame_lazy_ibt_plt): Likewise.
713 (elf_x86_64_lazy_ibt_plt): Likewise.
714 (elf_x32_lazy_ibt_plt): Likewise.
715 (elf_x86_64_non_lazy_ibt_plt): Likewise.
716 (elf_x32_non_lazy_ibt_plt): Likewise.
717 (elf_x86_64_get_synthetic_symtab): Support the second PLT.
718 (elf_x86_64_parse_gnu_properties): Support
719 GNU_PROPERTY_X86_FEATURE_1_AND.
720 (elf_x86_64_merge_gnu_properties): Support
721 GNU_PROPERTY_X86_FEATURE_1_AND. If info->ibt is set, turn
722 on GNU_PROPERTY_X86_FEATURE_1_IBT
723 (elf_x86_64_link_setup_gnu_properties): If info->ibt is set,
724 turn on GNU_PROPERTY_X86_FEATURE_1_IBT. Use IBT-enabled PLT
725 for info->ibtplt, info->ibt or GNU_PROPERTY_X86_FEATURE_1_IBT
726 is set on all relocatable inputs.
727
d19237d9
NC
7282017-06-22 Nick Clifton <nickc@redhat.com>
729
730 PR binutils/21649
731 * som.c (setup_sections): NUL terminate the space_strings buffer.
732 Check that the space.name field does not index beyond the end of
733 the space_strings buffer.
734
6879f5a9
NC
7352017-06-21 Nick Clifton <nickc@redhat.com>
736
737 PR binutils/21646
738 * coff-sh.c (sh_reloc): Check for an out of range reloc.
739
7adc0a81
NC
7402017-06-21 Nick Clifton <nickc@redhat.com>
741
742 PR binutils/21639
743 * vms-misc.c (_bfd_vms_save_sized_string): Use unsigned int as
744 type of the size parameter.
745 (_bfd_vms_save_counted_string): Add second parameter - the maximum
746 length of the counted string.
747 * vms.h (_bfd_vms_save_sized_string): Update prototype.
748 (_bfd_vms_save_counted_string): Likewise.
749 * vms-alpha.c (_bfd_vms_slurp_eisd): Update calls to
750 _bfd_vms_save_counted_string.
751 (_bfd_vms_slurp_ehdr): Likewise.
752 (_bfd_vms_slurp_egsd): Likewise.
753 (Parse_module): Likewise.
754
6e1816be
AM
7552017-06-21 Alan Modra <amodra@gmail.com>
756
757 * elf64-ppc.c (ppc64_elf_size_stubs): Test for localentry:0 plt
758 calls before tocsave calls.
759 (ppc64_elf_relocate_section): Allow localentry:0 plt calls without
760 following nop.
761
20bd1b6b
NC
7622017-06-21 Nick Clifton <nickc@redhat.com>
763
764 PR binutils/21645
765 * reloc.c (bfd_generic_get_relocated_section_contents): Fail if
766 bfd_get_full_section_contents returns no contents.
767
3de58d95
NC
7682017-06-21 Nick Clifton <nickc@redhat.com>
769
770 PR binutils/21638
771 * vms-alpha.c (_bfd_vms_slurp_egsd): Check for an undersized
772 record.
773
cb06d03a
NC
7742017-06-21 Nick Clifton <nickc@redhat.com>
775
776 PR binutils/21637
777 * vms-alpha.c (_bfd_vms_slurp_egsd): Check for an empty section
778 list.
779 (image_set_ptr): Likewise.
780 (alpha_vms_fix_sec_rel): Likewise.
781 (alpha_vms_slurp_relocs): Likewise.
782
c458d007
NC
7832017-06-21 Nick Clifton <nickc@redhat.com>
784
785 PR binutils/21633
786 * ieee.c (ieee_slurp_sections): Check for a NULL return from
787 read_id.
788 (ieee_archive_p): Likewise.
789 (ieee_object_p): Likewise.
790
ce497010
NC
7912017-06-21 Nick Clifton <nickc@redhat.com>
792
793 PR binutils/21640
794 * elf.c (setup_group): Zero the group section pointer list after
795 allocation so that loops can be caught. Check for NULL pointers
796 when processing a group list.
797
fd52715c
AK
7982017-06-20 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
799
800 * elf-s390.h: New file.
801 * elf64-s390.c (struct elf_s390_link_hash_table): Add params
802 field.
803 (elf_s390_additional_program_headers): New function.
804 (elf_s390_modify_segment_map): New function.
805 (bfd_elf_s390_set_options): New function.
806 (elf_backend_additional_program_headers)
807 (elf_backend_modify_segment_map): Add macro definitions.
808
abfa390d
L
8092017-06-19 H.J. Lu <hongjiu.lu@intel.com>
810
811 PR ld/21626
812 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Check
813 the DYNAMIC bit instead of bfd_count_sections.
814
bc21b167
NC
8152017-06-19 Nick Clifton <nickc@redhat.com>
816
817 PR binutils/21618
818 * vms-alpha.c (evax_bfd_print_emh): Check for insufficient record
819 length.
820 (evax_bfd_print_eeom): Likewise.
821 (evax_bfd_print_egsd): Check for an overlarge record length.
822 (evax_bfd_print_etir): Likewise.
823
acb56a83
NC
8242017-06-19 Nick Clifton <nickc@redhat.com>
825
826 PR binutils/21612
827 * libieee.h (struct common_header_type): Add end_p field.
828 * ieee.c (this_byte_and_next): Do not advance input_p beyond
829 end_p.
830 (read_id): Check for a length that exceeds the remaining bytes in
831 the input buffer.
832 (ieee_seek): Initialise end_p.
833 (ieee_archive_p): Likewise.
834 (ieee_object_p): Likewise.
835
72e84f96
NC
8362017-06-19 Nick Clifton <nickc@redhat.com>
837
80053e46
NC
838 PR binutils/21611
839 * vms-alpha.c (_bfd_vms_slurp_eihs): Check for invalid offset
840 before reading the EIHS structure entries.
841
8422017-06-19 Nick Clifton <nickc@redhat.com>
843
844 PR binutils/21615
72e84f96
NC
845 * vms-alpha.c (_bfd_vms_slurp_egsd): Use unsigned int for
846 gsd_size. Check that there are enough bytes remaining to read the
847 type and size of the next egsd. Check that the size of the egsd
848 does not exceed the size of the record.
849
875ffa3e
AM
8502017-06-19 Alan Modra <amodra@gmail.com>
851
852 * config.bfd: Correct targ_underscore for cris.
853
bdd32e03
AM
8542017-06-18 Alan Modra <amodra@gmail.com>
855
856 * config.bfd: Correct targ_underscore for epiphany, ip2k,
857 m32c, mn10200, pru, rl78, rx, crisv32 and v850.
858
4b48e2f6
NC
8592017-06-16 Nick Clifton <nickc@redhat.com>
860
861 * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Do not fail if the
862 bucketlist is empty because there are no symbols to add to the
863 list.
864
7dba9362
AM
8652017-06-16 Alan Modra <amodra@gmail.com>
866
867 PR ld/20022
868 PR ld/21557
869 PR ld/21562
870 PR ld/21571
871 * targets.c (struct bfd_target): Add _bfd_define_start_stop.
872 (BFD_JUMP_TABLE_LINK): Likewise.
873 * elf-bfd.h (bfd_elf_define_start_stop): Declare.
874 * elflink.c (_bfd_elf_gc_mark_rsec): Update comment.
875 (bfd_elf_define_start_stop): New function.
876 * linker.c (bfd_generic_define_start_stop): New function.
877 * coff64-rs6000.c (rs6000_xcoff64_vec, rs6000_xcoff64_aix_vec): Init
878 new field.
879 * aout-adobe.c (aout_32_bfd_define_start_stop): Define.
880 * aout-target.h (MY_bfd_define_start_stop): Define.
881 * aout-tic30.c (MY_bfd_define_start_stop): Define.
882 * binary.c (binary_bfd_define_start_stop): Define.
883 * bout.c (b_out_bfd_define_start_stop): Define.
884 * coff-alpha.c (_bfd_ecoff_bfd_define_start_stop): Define.
885 * coff-mips.c (_bfd_ecoff_bfd_define_start_stop): Define.
886 * coff-rs6000.c (_bfd_xcoff_bfd_define_start_stop): Define.
887 * coffcode.h (coff_bfd_define_start_stop): Define.
888 * elfxx-target.h (bfd_elfNN_bfd_define_start_stop): Define.
889 * i386msdos.c (msdos_bfd_define_start_stop): Define.
890 * i386os9k.c (os9k_bfd_define_start_stop): Define.
891 * ieee.c (ieee_bfd_define_start_stop): Define.
892 * ihex.c (ihex_bfd_define_start_stop): Define.
893 * libbfd-in.h (_bfd_nolink_bfd_define_start_stop): Define.
894 * mach-o-target.c (bfd_mach_o_bfd_define_start_stop): Define.
895 * mmo.c (mmo_bfd_define_start_stop): Define.
896 * nlm-target.h (nlm_bfd_define_start_stop): Define.
897 * oasys.c (oasys_bfd_define_start_stop): Define.
898 * pef.c (bfd_pef_bfd_define_start_stop): Define.
899 * plugin.c (bfd_plugin_bfd_define_start_stop): Define.
900 * ppcboot.c (ppcboot_bfd_define_start_stop): Define.
901 * som.c (som_bfd_define_start_stop): Define.
902 * srec.c (srec_bfd_define_start_stop): Define.
903 * tekhex.c (tekhex_bfd_define_start_stop): Define.
904 * versados.c (versados_bfd_define_start_stop): Define.
905 * vms-alpha.c (vms_bfd_define_start_stop): Define.
906 (alpha_vms_bfd_define_start_stop): Define.
907 * xsym.c (bfd_sym_bfd_define_start_stop): Define.
908 * bfd-in2.h: Regenerate.
909 * libbfd.h: Regenerate.
910
d68f1976
JW
9112017-06-16 Jiong Wang <jiong.wang@arm.com>
912
913 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Use
914 SYMBOL_REFERENCES_LOCAL.
915
6353d82b
JW
9162017-06-15 Jiong Wang <jiong.wang@arm.com>
917
918 PR ld/21532
919 * elfnn-aarch64.c (ELIMINATE_COPY_RELOCS): Set to 1.
920 (elfNN_aarch64_final_link_relocate): Also propagate relocations to
921 runtime for if there needs copy relocation elimination.
922 (need_copy_relocation_p): New function. Return true for symbol with
923 pc-relative references and if it's against read-only sections.
924 (elfNN_aarch64_adjust_dynamic_symbol): Use need_copy_relocation_p.
925 (elfNN_aarch64_check_relocs): Allocate dynrelocs for relocation types
926 that are related with accessing external objects.
927 (elfNN_aarch64_gc_sweep_hook): Sync the relocation types with the change
928 in elfNN_aarch64_check_relocs.
929
63634bb4
NC
9302017-06-15 Nick Clifton <nickc@redhat.com>
931
932 PR binutils/21582
933 * ieee.c (ieee_object_p): Use a static buffer to avoid compiler
934 bugs.
62b76e4b
NC
935 PR binutils/21581
936 (ieee_archive_p): Likewise.
63634bb4 937
76800cba
NC
9382017-06-15 Nick Clifton <nickc@redhat.com>
939
940 PR binutils/21579
941 * vms-alpha.c (_bfd_vms_slurp_etir): Extend check of cmd_length.
942
f7e16c2a
MF
9432017-06-14 Max Filippov <jcmvbkbc@gmail.com>
944
945 * elf32-xtensa.c (elf_xtensa_be_plt_entry,
946 elf_xtensa_le_plt_entry): Add dimension for the ABI to arrays,
947 keep both windowed and call0 ABI PLT definitions.
948 (elf_xtensa_create_plt_entry): Use selected ABI to choose upper
949 elf_xtensa_*_plt_entry endex.
950 (ELF_MAXPAGESIZE): Fix at minimal supported MMU page size.
951
f461bbd8
NC
9522017-06-14 Nick Clifton <nickc@redhat.com>
953
954 PR binutils/21578
955 * elf32-sh.c (sh_elf_set_mach_from_flags): Fix check for invalid
956 flag value.
957
c53d2e6d
NC
9582017-06-14 Nick Clifton <nickc@redhat.com>
959
960 PR binutils/21589
961 * vms-alpha.c (_bfd_vms_get_value): Add an extra parameter - the
962 maximum value for the ascic pointer. Check that name processing
963 does not read beyond this value.
964 (_bfd_vms_slurp_etir): Add checks for attempts to read beyond the
965 end of etir record.
966
04f963fd
NC
9672017-06-14 Nick Clifton <nickc@redhat.com>
968
969 PR binutils/21591
970 * versados.c (versados_mkobject): Zero the allocated tdata structure.
971 (process_otr): Check for an invalid offset in the otr structure.
972
319c2dbe
SH
9732017-06-14 Sebastian Huber <sebastian.huber@embedded-brains.de>
974
975 * config.bfd (epiphany-*-elf): Accept epiphany-*-*.
976
cbd0eecf
L
9772017-06-13 H.J. Lu <hongjiu.lu@intel.com>
978
979 PR ld/20022
980 PR ld/21557
981 PR ld/21562
982 PR ld/21571
983 * elf-bfd.h (elf_link_hash_entry): Add start_stop. Change the
984 vtable field to a union.
985 (_bfd_elf_is_start_stop): Removed.
986 * elf32-i386.c (elf_i386_convert_load_reloc): Also check for
987 __start_SECNAME and __stop_SECNAME symbols.
988 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Likewise.
989 * elflink.c (_bfd_elf_is_start_stop): Removed.
990 (_bfd_elf_gc_mark_rsec): Check start_stop instead of calling
991 _bfd_elf_is_start_stop.
992 (elf_gc_propagate_vtable_entries_used): Skip __start_SECNAME and
993 __stop_SECNAME symbols. Updated.
994 (elf_gc_smash_unused_vtentry_relocs): Likewise.
995 (bfd_elf_gc_record_vtinherit): Likewise.
996 (bfd_elf_gc_record_vtentry): Likewise.
997
10bbbc1d
NC
9982017-06-13 Nick Clifton <nickc@redhat.com>
999
1000 PR ld/21524
1001 * elflink.c (elf_link_adjust_relocs): Generate an error when
1002 encountering a reloc against a symbol removed by garbage
1003 collection.
1004
5c3ce2bc
L
10052017-06-12 H.J. Lu <hongjiu.lu@intel.com>
1006
1007 * elf-bfd.h (elf_backend_data): Add struct bfd_link_info *
1008 to merge_gnu_properties.
1009 * elf-properties.c (elf_merge_gnu_properties): Add struct
1010 bfd_link_info * and pass it to merge_gnu_properties.
1011 (elf_merge_gnu_property_list): Add struct bfd_link_info *
1012 and pass it to elf_merge_gnu_properties.
1013 (_bfd_elf_link_setup_gnu_properties): Pass info to
1014 elf_merge_gnu_property_list.
1015 * elf32-i386.c (elf_i386_merge_gnu_properties): Add struct
1016 bfd_link_info *.
1017 * elf64-x86-64.c (elf_x86_64_merge_gnu_properties): Likewise.
1018
9b97dfbf
AM
10192017-06-11 Joe Zbiciak <joe.zbiciak@leftturnonly.info>
1020
1021 PR 21564
1022 * binary.c (binary_set_section_contents): Scale lma by octets
1023 per byte to set filepos.
1024
e3d1d408
CM
10252017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
1026
1027 * elf32-arc.c (elf_arc_check_relocs): Fixed conditions to generate
1028 dynamic sections.
1029
64aa8e03
CM
10302017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
1031
1032 * elf32-arc.c (elf_arc_size_dynamic_sections): Changed condition to
1033 require TEXTREL.
1034
a0abe743
CM
10352017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
1036
1037 * arc-got.h (relocate_fix_got_relocs_for_got_info): Added TCB_SIZE to
1038 patched section contents for TLS IE reloc.
1039 * elf32-arc.c: Remove TCB_SIZE preprocessor macro.
1040
f4e6805f
CM
10412017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
1042
1043 * elf32-arc.c (elf_arc_relocate_section): Added "call" to
1044 RELOC_FOR_GLOBAL_SYMBOL macro.
1045
cd640291
CM
10462018-06-08 Cupertino Miranda <cmiranda@synopsys.com>
1047
1048 * elf32-arc.c (elf_arc_relocate_section): Small refactor and condition
1049 changes.
1050
7ef0acc1
VG
10512017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
1052
1053 * config/tc-arc.c (md_undefined_symbol): Changed.
1054 * config/tc-arc.h (DYNAMIC_STRUCT_NAME): Removed.
1055
cc89d0b3
CM
10562017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
1057
1058 * elf32-arc.c (elf_arc_relocate_section): Fixed reassign of indirect
1059 symbols.
1060
9d5c718b
CM
10612017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
1062
1063 * elf32-arc.c (elf_arc_check_relocs): Added condition to disable
1064 warning and "Bad value" for local symbols ARC_32 or ARC_32_ME relocs.
1065
be9e3704
CM
10662017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
1067
1068 * elf32-arc.c (ADD_RELA): Changed to only work when dynamic
1069 object is created.
1070
4ec192e6
RE
10712017-06-08 Richard Earnshaw <rearnsha@arm.com>
1072
1073 * elf32-arm.c (elf32_arm_merge_eabi_attributes): Remove assertion
1074 that the input bfd has Tag_FP_ARCH non-zero if Tag_ABI_HardFP_use
1075 is non-zero. Add clarifying comments.
1076
51fa2693
L
10772017-06-08 H.J. Lu <hongjiu.lu@intel.com>
1078
1079 * elf32-i386.c (elf_i386_check_relocs): Set local IFUNC symbol
1080 name. Use local IFUNC symbol name string to report unsupported
1081 non-PIC call to IFUNC function.
1082 (elf_i386_relocate_section): Dump local IFUNC name with minfo
1083 when generating R_386_IRELATIVE relocation.
1084 (elf_i386_finish_dynamic_symbol): Likewise.
1085 * elf_x86_64_check_relocs (elf_x86_64_check_relocs): Set local
1086 IFUNC symbol name.
1087 (elf_x86_64_relocate_section): Dump local IFUNC name with minfo
1088 when generating R_X86_64_IRELATIVE relocation.
1089 (elf_x86_64_finish_dynamic_symbol): Likewise.
1090
78e8a2ff
JM
10912017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
1092
1093 * elf.c (setup_group): Make sure BFD sections are created for all
1094 group sections in the input file when processing SHF_GROUP
1095 sections.
1096 (bfd_section_from_shdr): Avoid duplicating logic already
1097 implemented in `setup_group'.
1098
9949827b
DBR
10992017-06-06 Daniel Bonniot de Ruisselet <bonniot@gmail.com>
1100
1101 PR binutils/21546
1102 * peXXigen.c (pe_print_idata): Use the address of the first thunk
1103 if the hint address is zero.
1104
0ee3a6db
JC
11052017-06-06 James Clarke <jrtc27@jrtc27.com>
1106
1107 PR ld/19579
1108 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Check
1109 ELF_COMMON_DEF_P for common symbols.
1110
7bdf4127
AB
11112017-06-06 Andrew Burgess <andrew.burgess@embecosm.com>
1112
1113 * elf.c (_bfd_elf_make_section_from_shdr): Don't initially mark
1114 SEC_GROUP sections as SEC_EXCLUDE.
1115 (bfd_elf_set_group_contents): Replace use of abort with an assert.
1116 (assign_section_numbers): Use resolve_section_groups flag instead
1117 of relocatable link type.
1118 (_bfd_elf_init_private_section_data): Use resolve_section_groups
1119 flag instead of checking the final_link flag for part of the
1120 checks in here. Fix white space as a result.
1121 * elflink.c (elf_link_input_bfd): Use resolve_section_groups flag
1122 instead of relocatable link type.
1123 (bfd_elf_final_link): Likewise.
1124
458ad2b8
JM
11252017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
1126
1127 * elfxx-mips.c (_bfd_mips_elf_relocate_section): Remove unused
1128 variable `bed'.
1129 * elf32-score.c (score_elf_final_link_relocate): Likewise.
1130 (s3_bfd_score_elf_check_relocs): Likewise.
1131 * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
1132 (score_elf_final_link_relocate): Likewise.
1133 (s7_bfd_score_elf_check_relocs): Likewise.
1134
fbebaf4a
JM
11352017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
1136
1137 * elflink.c (init_reloc_cookie_rels): Remove unused variable
1138 `bed'.
1139
056bafd4
MR
11402017-06-06 Maciej W. Rozycki <macro@imgtec.com>
1141
1142 * elf-bfd.h (RELOC_AGAINST_DISCARDED_SECTION): Subtract `count'
1143 from `reloc_count' rather than decrementing it.
1144 * elf.c (bfd_section_from_shdr): Multiply the adjustment to
1145 `reloc_count' by `int_rels_per_ext_rel'.
1146 * elf32-score.c (score_elf_final_link_relocate): Do not multiply
1147 `reloc_count' by `int_rels_per_ext_rel' for last relocation
1148 entry determination.
1149 (s3_bfd_score_elf_check_relocs): Likewise.
1150 * elf32-score7.c (score_elf_final_link_relocate): Likewise.
1151 (s7_bfd_score_elf_relocate_section): Likewise.
1152 (s7_bfd_score_elf_check_relocs): Likewise.
1153 * elf64-mips.c (mips_elf64_get_reloc_upper_bound): Remove
1154 prototype and function.
1155 (mips_elf64_slurp_one_reloc_table): Do not update `reloc_count'.
1156 (mips_elf64_slurp_reloc_table): Assert that `reloc_count' is
1157 triple rather than once the sum of REL and RELA relocation entry
1158 counts.
1159 (bfd_elf64_get_reloc_upper_bound): Remove macro.
1160 * elflink.c (_bfd_elf_link_read_relocs): Do not multiply
1161 `reloc_count' by `int_rels_per_ext_rel' for internal relocation
1162 storage allocation size determination.
1163 (elf_link_input_bfd): Multiply `.ctors' and `.dtors' section's
1164 size by `int_rels_per_ext_rel'. Do not multiply `reloc_count'
1165 by `int_rels_per_ext_rel' for last relocation entry
1166 determination.
1167 (bfd_elf_final_link): Do not multiply `reloc_count' by
1168 `int_rels_per_ext_rel' for internal relocation storage
1169 allocation size determination.
1170 (init_reloc_cookie_rels): Do not multiply `reloc_count' by
1171 `int_rels_per_ext_rel' for last relocation entry determination.
1172 (elf_gc_smash_unused_vtentry_relocs): Likewise.
1173 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
1174 (_bfd_mips_elf_relocate_section): Likewise.
1175
af54f0eb
AM
11762017-06-05 Alan Modra <amodra@gmail.com>
1177
1178 PR 21529
1179 * linker.c (_bfd_generic_link_output_symbols): Handle BSF_GNU_UNIQUE.
1180
6cf3bf88 11812017-06-01 John Baldwin <jhb@FreeBSD.org>
b5430a3c
JB
1182
1183 * elf.c (elfcore_grok_freebsd_psinfo): Use ELF header class to
1184 determine structure sizes.
1185 (elfcore_grok_freebsd_prstatus): Likewise.
1186
f378ab09
AM
11872017-06-01 Alan Modra <amodra@gmail.com>
1188
1189 * elf64-ppc.c (struct ppc_link_hash_table): Add has_plt_localentry0.
1190 (ppc64_elf_merge_symbol_attribute): Merge localentry bits from
1191 dynamic objects.
1192 (is_elfv2_localentry0): New function.
1193 (ppc64_elf_tls_setup): Default params->plt_localentry0.
1194 (plt_stub_size): Adjust size for tls_get_addr_opt stub.
1195 (build_tls_get_addr_stub): Use a simpler stub when r2 is not saved.
1196 (ppc64_elf_size_stubs): Leave stub_type as ppc_stub_plt_call for
1197 optimized localentry:0 stubs.
1198 (ppc64_elf_build_stubs): Save r2 in ELFv2 __glink_PLTresolve.
1199 (ppc64_elf_relocate_section): Leave nop unchanged for optimized
1200 localentry:0 stubs.
1201 (ppc64_elf_finish_dynamic_sections): Set PPC64_OPT_LOCALENTRY in
1202 DT_PPC64_OPT.
1203 * elf64-ppc.h (struct ppc64_elf_params): Add plt_localentry0.
1204
8c65b54f
CS
12052017-05-30 Casey Smith <clegg89@gmail.com>
1206
1207 PR ld/21523
1208 * elf32-arm.c (elf32_arm_final_link_relocate): Install an absolute
1209 value when processing the R_ARM_THM_ALU_PREL_11_0 reloc.
1210
64984c22
AK
12112017-05-30 Anton Kolesov Anton.Kolesov@synopsys.com
1212
1213 * cpu-arc.c (arc_compatible): New function.
1214
37cd3877
AK
12152017-05-30 Anton Kolesov <anton.kolesov@synopsys.com>
1216
1217 * cpu-arc.c (arch_info_struct): Remove duplicate ARC600 entry.
1218
8e2f54bc
L
12192017-05-30 H.J. Lu <hongjiu.lu@intel.com>
1220
1221 PR binutils/21519
1222 * bfdio.c (bfd_get_file_size): New function.
1223 * bfd-in2.h: Regenerated.
1224
8e7f04f1 12252017-05-23 Dilian Palauzov <git-dpa@aegee.org>
1226
1227 * elf32-arc.c (arc_elf_merge_attributes): Add fall through
1228 comments.
1229
25f94347
L
12302017-05-22 H.J. Lu <hongjiu.lu@intel.com>
1231
1232 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Use
1233 dynobj instead of htab->elf.dynobj.
1234
e5713223
MR
12352017-05-19 Maciej W. Rozycki <macro@imgtec.com>
1236
1237 * elf64-mips.c (mips_elf64_canonicalize_reloc): Remove prototype
1238 and function.
1239 (mips_elf64_canonicalize_dynamic_reloc): Likewise.
1240 (mips_elf64_slurp_one_reloc_table): Set `reloc_count' to the
1241 actual number of internal relocations retrieved. Adjust
1242 function description.
1243 (bfd_elf64_canonicalize_reloc): Remove macro.
1244 (bfd_elf64_canonicalize_dynamic_reloc): Likewise.
1245
64517994
JM
12462017-05-19 Jose E. Marchesi <jose.marchesi@oracle.com>
1247
1248 * archures.c (bfd_mach_sparc_v9m8): Define.
1249 (bfd_mach_sparc_v8plusm8): Likewise.
1250 (bfd_mach_sparc_v9_p): Adjust to M8.
1251 (bfd_mach_sparc_64bit_p): Likewise.
1252 * aoutx.h (machine_type): Handle bfd_mach_sparc_v9m8 and
1253 bfd_mach_sparc_v8plusm8.
1254 * bfd-in2.h: Regenerated.
1255 * cpu-sparc.c (arch_info_struct): Entries for sparc:v9m8 and
1256 sparc:v8plusm8.
1257 * elfxx-sparc.c (_bfd_sparc_elf_object_p): Handle
1258 bfd_mach_sparc_v8plusm8 and bfd_mach_sparc_v9m8 using the new hw
1259 capabilities ONADDSUB, ONMUL, ONDIV, DICTUNP, FPCPSHL, RLE and
1260 SHA3.
1261 * elf32-sparc.c (elf32_sparc_final_write_processing): Handle
1262 bfd_mach_sparc_v8plusm8.
1263
eb026f09
AM
12642017-05-19 Alan Modra <amodra@gmail.com>
1265
1266 * elflink.c (_bfd_elf_gc_mark_extra_sections): Don't keep
1267 debug and special sections when no non-note alloc sections in an
1268 object are kept.
1269
535b785f
AM
12702017-05-18 Alan Modra <amodra@gmail.com>
1271
1272 * arc-got.h: Don't compare boolean values against TRUE or FALSE.
1273 * elf-m10300.c: Likewise.
1274 * elf.c: Likewise.
1275 * elf32-arc.c: Likewise.
1276 * elf32-bfin.c: Likewise.
1277 * elf32-m68k.c: Likewise.
1278 * elf32-nds32.c: Likewise.
1279 * elf32-tilepro.c: Likewise.
1280 * elflink.c: Likewise.
1281 * elfnn-aarch64.c: Likewise.
1282 * elfnn-riscv.c: Likewise.
1283 * elfxx-tilegx.c: Likewise.
1284 * mach-o.c: Likewise.
1285 * peXXigen.c: Likewise.
1286 * vms-alpha.c: Likewise.
1287 * vms-lib.c: Likewise.
1288
b7c871ed
L
12892017-05-17 H.J. Lu <hongjiu.lu@intel.com>
1290
1291 PR ld/20882
1292 * elflink.c (elf_gc_mark_debug_section): New function.
1293 (_bfd_elf_gc_mark_extra_sections): Mark any debug sections
1294 referenced by kept debug sections.
1295
bc4e12de
AM
12962017-05-16 Alan Modra <amodra@gmail.com>
1297
1298 * elf-m10300.c: Rename occurrences of non_ir_ref.
1299 * elf32-arm.c: Likewise.
1300 * elf32-bfin.c: Likewise.
1301 * elf32-cr16.c: Likewise.
1302 * elf32-cris.c: Likewise.
1303 * elf32-d10v.c: Likewise.
1304 * elf32-dlx.c: Likewise.
1305 * elf32-fr30.c: Likewise.
1306 * elf32-frv.c: Likewise.
1307 * elf32-hppa.c: Likewise.
1308 * elf32-i370.c: Likewise.
1309 * elf32-i386.c: Likewise.
1310 * elf32-iq2000.c: Likewise.
1311 * elf32-lm32.c: Likewise.
1312 * elf32-m32c.c: Likewise.
1313 * elf32-m32r.c: Likewise.
1314 * elf32-m68hc1x.c: Likewise.
1315 * elf32-m68k.c: Likewise.
1316 * elf32-mcore.c: Likewise.
1317 * elf32-metag.c: Likewise.
1318 * elf32-microblaze.c: Likewise.
1319 * elf32-moxie.c: Likewise.
1320 * elf32-msp430.c: Likewise.
1321 * elf32-mt.c: Likewise.
1322 * elf32-nios2.c: Likewise.
1323 * elf32-or1k.c: Likewise.
1324 * elf32-ppc.c: Likewise.
1325 * elf32-rl78.c: Likewise.
1326 * elf32-s390.c: Likewise.
1327 * elf32-score.c: Likewise.
1328 * elf32-score7.c: Likewise.
1329 * elf32-sh.c: Likewise.
1330 * elf32-tic6x.c: Likewise.
1331 * elf32-tilepro.c: Likewise.
1332 * elf32-v850.c: Likewise.
1333 * elf32-vax.c: Likewise.
1334 * elf32-xstormy16.c: Likewise.
1335 * elf32-xtensa.c: Likewise.
1336 * elf64-alpha.c: Likewise.
1337 * elf64-hppa.c: Likewise.
1338 * elf64-ia64-vms.c: Likewise.
1339 * elf64-mmix.c: Likewise.
1340 * elf64-ppc.c: Likewise.
1341 * elf64-s390.c: Likewise.
1342 * elf64-sh64.c: Likewise.
1343 * elf64-x86-64.c: Likewise.
1344 * elflink.c: Likewise.
1345 * elfnn-aarch64.c: Likewise.
1346 * elfnn-ia64.c: Likewise.
1347 * elfnn-riscv.c: Likewise.
1348 * elfxx-mips.c: Likewise.
1349 * elfxx-sparc.c: Likewise.
1350 * elfxx-tilegx.c: Likewise.
1351 * linker.c: Likewise.
1352
4070765b
AM
13532017-05-16 Alan Modra <amodra@gmail.com>
1354
1355 * elf64-ppc.c (add_symbol_adjust): Transfer non_ir_ref_dynamic.
1356 * elflink.c (elf_link_add_object_symbols): Update to use
1357 non_ir_ref_dynamic.
1358 (elf_link_input_bfd): Test non_ir_ref_dynamic in addition to
1359 non_ir_ref.
1360 * linker.c (_bfd_generic_link_add_one_symbol): Likewise.
1361
25499ac7
MR
13622017-05-15 Maciej W. Rozycki <macro@imgtec.com>
1363
1364 * elfxx-mips.c (print_mips_ases): Handle MIPS16e2 ASE.
1365
73caa85d
L
13662017-05-12 H.J. Lu <hongjiu.lu@intel.com>
1367
1368 * elf32-i386.c (elf_i386_parse_gnu_properties): Merge
1369 GNU_PROPERTY_X86_ISA_1_USED and GNU_PROPERTY_X86_ISA_1_NEEDED
1370 properties.
1371 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
1372
f2c29a16
L
13732017-05-11 H.J. Lu <hongjiu.lu@intel.com>
1374
1375 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Rename plt_bnd
1376 to plt_second.
1377 (elf_x86_64_link_hash_table): Rename plt_bnd/plt_bnd_eh_frame
1378 to plt_second/plt_second_eh_frame.
1379 (elf_x86_64_link_hash_newfunc): Updated.
1380 (elf_x86_64_allocate_dynrelocs): Likewise.
1381 (elf_x86_64_size_dynamic_sections): Likewise.
1382 (elf_x86_64_relocate_section): Likewise.
1383 (elf_x86_64_finish_dynamic_symbol): Likewise.
1384 (elf_x86_64_finish_dynamic_sections): Likewise.
1385 (elf_x86_64_plt_type): Rename plt_bnd to plt_second.
1386 (elf_x86_64_get_synthetic_symtab): Updated. Also scan the
1387 .plt.sec section.
1388 (elf_backend_setup_gnu_properties): Updated. Create the
1389 .plt.sec section instead of the .plt.sec section.
1390
dc2be3d2
L
13912017-05-11 H.J. Lu <hongjiu.lu@intel.com>
1392
1393 * elf32-i386.c (elf_i386_allocate_dynrelocs): Partially revert
1394 commit 25070364b0ce33eed46aa5d78ebebbec6accec7e.
1395 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewse.
1396
db84b98a
JM
13972017-05-10 Jose E. Marchesi <jose.marchesi@oracle.com>
1398
1399 * elf64-sparc.c (elf64_sparc_set_reloc): New function.
1400 (bfd_elf64_set_reloc): Define.
1401 (elf64_sparc_write_relocs): Use `canon_reloc_count'.
1402
23186865
JM
14032017-05-10 Jose E. Marchesi <jose.marchesi@oracle.com>
1404
1405 * targets.c (BFD_JUMP_TABLE_RELOCS): Add NAME##_set_reloc.
1406 (struct bfd_target): New field _bfd_set_reloc.
1407 * bfd.c (bfd_set_reloc): Call backend _set_bfd.
1408 * reloc.c (_bfd_generic_set_reloc): New function.
1409 * coffcode.h (coff_set_reloc): Define to _bfd_generic_set_reloc.
1410 * nlm-target.h (nlm_set_reloc): Likewise.
1411 * coff-rs6000.c (_bfd_xcoff_set_reloc): Likewise.
1412 * aout-tic30.c (MY_set_reloc): Likewise.
1413 * aout-target.h (MY_set_reloc): Likewise.
1414 * elfxx-target.h (bfd_elfNN_set_reloc): Likewise.
1415 * coff-alpha.c (_bfd_ecoff_set_reloc): Likewise.
1416 * mach-o-target.c (bfd_mach_o_set_reloc): Likewise.
1417 * vms-alpha.c (alpha_vms_set_reloc): Likewise.
1418 * aout-adobe.c (aout_32_set_reloc): Likewise.
1419 * bout.c (b_out_set_reloc): Likewise.
1420 * coff-mips.c (_bfd_ecoff_set_reloc): Likewise.
1421 * i386os9k.c (aout_32_set_reloc): Likewise.
1422 * ieee.c (ieee_set_reloc): Likewise.
1423 * oasys.c (oasys_set_reloc): Likewise.
1424 * som.c (som_set_reloc): Likewise.
1425 * versados.c (versados_set_reloc): Likewise.
1426 * coff64-rs6000.c (rs6000_xcoff64_vec): Add
1427 _bfd_generic_set_reloc.
1428 (rs6000_xcoff64_aix_vec): LIkewise.
1429 * libbfd.c (_bfd_norelocs_set_reloc): New function.
1430 * libbfd-in.h: Prototype for _bfd_norelocs_set_reloc.
1431 * i386msdos.c (msdos_set_reloc): Define to
1432 _bfd_norelocs_set_reloc.
1433 * elfcode.h (elf_set_reloc): Define.
1434 * bfd-in2.h: Regenerated.
1435
aab82f4c
L
14362017-05-10 H.J. Lu <hongjiu.lu@intel.com>
1437
1438 PR ld/21481
1439 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Use .plt.bnd
1440 for IFUNC function address.
1441
53a346d8
CZ
14422017-05-10 Claudiu Zissulescu <claziss@synopsys.com>
1443
1444 * elf32-arc.c (FEATURE_LIST_NAME): Define.
1445 (CONFLICT_LIST): Likewise.
1446 (opcode/arc-attrs.h): Include.
1447 (arc_elf_print_private_bfd_data): Print OSABI v4 flag.
1448 (arc_extract_features): New file.
1449 (arc_stralloc): Likewise.
1450 (arc_elf_merge_attributes): Likewise.
1451 (arc_elf_merge_private_bfd_data): Use object attributes.
1452 (bfd_arc_get_mach_from_attributes): New function.
1453 (arc_elf_object_p): Use object attributes.
1454 (arc_elf_final_write_processing): Likewise.
1455 (elf32_arc_obj_attrs_arg_type): New function.
1456 (elf32_arc_obj_attrs_handle_unknown): Likewise.
1457 (elf32_arc_section_from_shdr): Likewise.
1458 (elf_backend_obj_attrs_vendor): Define.
1459 (elf_backend_obj_attrs_section): Likewise.
1460 (elf_backend_obj_attrs_arg_type): Likewise.
1461 (elf_backend_obj_attrs_section_type): Likewise.
1462 (elf_backend_obj_attrs_handle_unknown): Likewise.
1463 (elf_backend_section_from_shdr): Likewise.
1464
e645cf40
AG
14652017-05-09 Andrew Goedhart <Andrewgoedhart@simplepowersolutions.co.za>
1466
1467 PR ld/21458
1468 * elf32-arm.c (elf32_arm_final_link_relocate): Set the bottom bit
1469 of the value when resolving a R_ARM_THM_ALU_PREL_11_0 relocation
1470 and the destination is a Thumb symbol.
1471
dd9e66ee
L
14722017-05-08 H.J. Lu <hongjiu.lu@intel.com>
1473
1474 * elf32-i386.c (elf_i386_get_synthetic_symtab): Add missing
1475 initializer to silence GCC 4.2.
1476 * lf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
1477
38b12349
L
14782017-05-08 H.J. Lu <hongjiu.lu@intel.com>
1479
1480 * elf64-x86-64.c (PLT_ENTRY_SIZE): Renamed to ...
1481 (LAZY_PLT_ENTRY_SIZE): This.
1482 (NON_LAZY_PLT_ENTRY_SIZE): New.
1483 (elf_x86_64_plt0_entry): Renamed to ...
1484 (elf_x86_64_lazy_plt0_entry): This.
1485 (elf_x86_64_plt_entry): Renamed to ...
1486 (elf_x86_64_lazy_plt_entry): This.
1487 (elf_x86_64_bnd_plt0_entry): Renamed to ...
1488 (elf_x86_64_lazy_bnd_plt0_entry): This.
1489 (elf_x86_64_legacy_plt_entry): Removed.
1490 (elf_x86_64_bnd_plt_entry): Renamed to ...
1491 (elf_x86_64_lazy_bnd_plt_entry): This.
1492 (elf_x86_64_legacy_plt2_entry): Renamed to ...
1493 (elf_x86_64_non_lazy_plt_entry): This.
1494 (elf_x86_64_bnd_plt2_entry): Renamed to ...
1495 (elf_x86_64_non_lazy_bnd_plt_entry): This.
1496 (elf_x86_64_eh_frame_plt): Renamed to ...
1497 (elf_x86_64_eh_frame_lazy_plt): This.
1498 (elf_x86_64_eh_frame_bnd_plt): Renamed to ...
1499 (elf_x86_64_eh_frame_lazy_bnd_plt): This.
1500 (elf_x86_64_eh_frame_plt_got): Renamed to ...
1501 (elf_x86_64_eh_frame_non_lazy_plt): This.
1502 (elf_x86_64_lazy_plt_layout): New.
1503 (elf_x86_64_non_lazy_plt_layout): Likewise.
1504 (elf_x86_64_plt_layout): Likewise.
1505 (elf_x86_64_backend_data): Remove PLT layout information. Add
1506 os for target system.
1507 (GET_PLT_ENTRY_SIZE): Removed.
1508 (elf_x86_64_lazy_plt): New.
1509 (elf_x86_64_non_lazy_plt): Likewise.
1510 (elf_x86_64_lazy_bnd_plt): Likewise.
1511 (elf_x86_64_non_lazy_bnd_plt): Likewise.
1512 (elf_x86-64_arch_bed): Updated.
1513 (elf_x86_64_link_hash_table): Add plt, lazy_plt and non_lazy_plt.
1514 (elf_x86_64_create_dynamic_sections): Removed.
1515 (elf_x86_64_check_relocs): Don't check elf.dynobj. Don't call
1516 _bfd_elf_create_ifunc_sections nor _bfd_elf_create_got_section.
1517 (elf_x86-64_adjust_dynamic_symbol): Updated.
1518 (elf_x86_64_allocate_dynrelocs): Updated. Pass 0 as PLT header
1519 size to _bfd_elf_allocate_ifunc_dyn_relocs and don't allocate
1520 size for PLT0 if there is no PLT0. Get plt_entry_size from
1521 non_lazy_plt for non-lazy PLT entries.
1522 (elf_x86_64_size_dynamic_sections): Updated. Get plt_entry_size
1523 from non_lazy_plt for non-lazy PLT entries.
1524 (elf_x86-64_relocate_section): Updated. Properly get PLT index
1525 if there is no PLT0.
1526 (elf_x86_64_finish_dynamic_symbol): Updated. Fill the first slot
1527 in the PLT entry with generic PLT layout. Fill the non-lazy PLT
1528 entries with non-lazy PLT layout. Don't fill the second and third
1529 slots in the PLT entry if there is no PLT0.
1530 (elf_x86_64_finish_dynamic_sections): Updated. Don't fill PLT0
1531 if there is no PLT0. Set sh_entsize on the .plt.got section.
1532 (compare_relocs): New.
1533 (elf_x86_64_plt_type): Likewise.
1534 (elf_x86_64_plt): Likewise.
1535 (elf_x86_64_nacl_plt): New. Forward declaration.
1536 (elf_x86_64_get_plt_sym_val): Removed.
1537 (elf_x86_64_get_synthetic_symtab): Rewrite to check PLT sections
1538 against all dynamic relocations.
1539 (elf_x86_64_link_setup_gnu_properties): New function.
1540 (elf_backend_create_dynamic_sections): Updated.
1541 (elf_backend_setup_gnu_properties): New.
1542 (elf_x86_64_nacl_plt): New.
1543 (elf_x86_64_nacl_arch_bed): Updated.
1544
f604c2a2
L
15452017-05-08 H.J. Lu <hongjiu.lu@intel.com>
1546
1547 * elf32-i386.c (PLT_ENTRY_SIZE): Renamed to ...
1548 (LAZY_PLT_ENTRY_SIZE): This.
1549 (NON_LAZY_PLT_ENTRY_SIZE): New.
1550 (elf_i386_plt0_entry): Renamed to ...
1551 (elf_i386_lazy_plt0_entry): This.
1552 (elf_i386_plt_entry): Renamed to ...
1553 (elf_i386_lazy_plt_entry): This.
1554 (elf_i386_pic_plt0_entry): Renamed to ...
1555 (elf_i386_pic_lazy_plt0_entry): This.
1556 (elf_i386_pic_plt_entry): Renamed to ...
1557 (elf_i386_pic_lazy_plt_entry): This.
1558 (elf_i386_got_plt_entry): Renamed to ...
1559 (elf_i386_non_lazy_plt_entry): This.
1560 (elf_i386_pic_got_plt_entry): Renamed to ...
1561 (elf_i386_pic_non_lazy_plt_entry): This.
1562 (elf_i386_eh_frame_plt): Renamed to ...
1563 (elf_i386_eh_frame_lazy_plt): This.
1564 (elf_i386_eh_frame_plt_got): Renamed to ...
1565 (elf_i386_eh_frame_non_lazy_plt): This.
1566 (elf_i386_plt_layout): Renamed to ...
1567 (elf_i386_lazy_plt_layout): This. Remove eh_frame_plt_got and
1568 eh_frame_plt_got_size.
1569 (elf_i386_non_lazy_plt_layout): New.
1570 (elf_i386_plt_layout): Likewise.
1571 (elf_i386_non_lazy_plt): Likewise.
1572 (GET_PLT_ENTRY_SIZE): Removed.
1573 (elf_i386_plt): Renamed to ...
1574 (elf_i386_lazy_plt): This.
1575 (elf_i386_backend_data): Remove plt. Rename is_vxworks to os.
1576 (elf_i386_arch_bed): Updated.
1577 (elf_i386_link_hash_table): Add plt, lazy_plt and non_lazy_plt.
1578 (elf_i386_create_dynamic_sections): Removed.
1579 (elf_i386_check_relocs): Don't check elf.dynobj. Don't call
1580 _bfd_elf_create_ifunc_sections nor _bfd_elf_create_got_section.
1581 (elf_i386_adjust_dynamic_symbol): Updated.
1582 (elf_i386_allocate_dynrelocs): Updated. Pass 0 as PLT header
1583 size to _bfd_elf_allocate_ifunc_dyn_relocs and don't allocate
1584 size for PLT0 if there is no PLT0.
1585 (elf_i386_size_dynamic_sections): Updated. Check whether GOT
1586 output section is discarded only if GOT isn't empty.
1587 (elf_i386_relocate_section): Updated. Properly get PLT index
1588 if there is no PLT0.
1589 (elf_i386_finish_dynamic_symbol): Updated. Don't fill the
1590 second and third slots in the PLT entry if there is no PLT0.
1591 (elf_i386_finish_dynamic_sections): Updated. Don't fill PLT0
1592 if there is no PLT0. Set sh_entsize on the .plt.got section.
1593 (elf_i386_nacl_plt): Forward declaration.
1594 (elf_i386_get_plt_sym_val): Removed.
1595 (elf_i386_get_synthetic_symtab): Rewrite to check PLT sections
1596 against all dynamic relocations.
1597 (elf_i386_link_setup_gnu_properties): New function.
1598 (elf_backend_create_dynamic_sections): Updated.
1599 (elf_backend_setup_gnu_properties): New.
1600 (elf_i386_nacl_plt): Updated.
1601 (elf_i386_nacl_arch_bed): Likewise.
1602 (elf_i386_vxworks_arch_bed): Likewise.
1603
046734ff
TP
16042017-05-08 Thomas Preud'homme <thomas.preudhomme@arm.com>
1605
1606 * elflink.c (elf_output_implib): Remove executable flag from import
1607 library bfd.
1608 * elf32-arm.c (elf32_arm_filter_implib_symbols): Assert that the import
1609 library is a relocatable object file.
1610
b660e9eb
SKS
16112017-05-01 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
1612
1613 PR ld/21404
1614 * elf32-avr.c (avr_should_move_sym): New function.
1615 (avr_should_reduce_sym_size): Likewise.
1616 (avr_should_increase_sym_size): Likewise.
1617 (elf32_avr_relax_delete_bytes): Adjust symbol values
1618 and sizes by calling new functions.
1619
763a5fa4
PD
16202017-05-01 Palmer Dabbelt <palmer@dabbelt.com>
1621
1622 * config.bfd (riscv32-*): Enable rv64.
1623
73ec947d
AM
16242017-05-02 Alan Modra <amodra@gmail.com>
1625
1626 PR 21384
1627 * elflink.c (bfd_elf_link_mark_dynamic_symbol): Test h->non_elf
1628 rather than h->root.type == bfd_link_hash_new.
1629 (bfd_elf_record_link_assignment): Similarly, call
1630 bfd_elf_link_mark_dynamic_symbol when h->non_elf.
1631
a941291c
AM
16322017-04-29 Alan Modra <amodra@gmail.com>
1633
1634 PR 21432
1635 * reloc.c (reloc_offset_in_range): New function.
1636 (bfd_perform_relocation, bfd_install_relocation): Use it.
1637 (_bfd_final_link_relocate): Likewise.
1638
750eaa47
L
16392017-04-28 H.J. Lu <hongjiu.lu@intel.com>
1640
1641 * elf32-i386.c (elf_i386_allocate_dynrelocs): Check plt_got
1642 before using .plt.got.
1643 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise.
1644
5b66fac4
L
16452017-04-27 H.J. Lu <hongjiu.lu@intel.com>
1646
1647 * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Use "="
1648 instead of "+=" to update 0.
1649
de9a3c42
L
16502017-04-27 H.J. Lu <hongjiu.lu@intel.com>
1651
1652 * elf32-i386.c (elf_i386_create_dynamic_sections): Create the
1653 .plt.got section here.
1654 (elf_i386_check_relocs): Don't create the .plt.got section.
1655 * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Create
1656 the .plt.got and .plt.bnd sections here.
1657 (elf_x86_64_check_relocs): Don't create the .plt.got nor
1658 .plt.bnd sections.
1659
da3d25af
L
16602017-04-27 H.J. Lu <hongjiu.lu@intel.com>
1661
1662 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Remove
1663 has_bnd_reloc.
1664 (elf_x86_64_link_hash_newfunc): Don't clear has_bnd_reloc.
1665 (elf_x86_64_copy_indirect_symbol): Don't copy has_bnd_reloc.
1666 (elf_x86_64_check_relocs): Don't set has_bnd_reloc.
1667 (elf_x86_64_finish_dynamic_symbol): Check bndplt instead of
1668 has_bnd_reloc.
1669
fba37edd
L
16702017-04-27 H.J. Lu <hongjiu.lu@intel.com>
1671
1672 * elf-bfd.h (elf_backend_data): Change setup_gnu_properties
1673 to return bfd *.
1674 (_bfd_elf_link_setup_gnu_properties): Return bfd *.
1675 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Return
1676 the first relocatable ELF input with GNU properties.
1677
1f78f649
L
16782017-04-27 H.J. Lu <hongjiu.lu@intel.com>
1679
1680 * elf32-i386.c (elf_i386_finish_dynamic_sections): Simplify
1681 VxWorks for non-PIC.
1682
76c20d54
AM
16832017-04-27 Alan Modra <amodra@gmail.com>
1684
1685 * elf-bfd.h (struct elf_backend_data): Make asection param of
1686 elf_backend_eh_frame_address_size const.
1687 (_bfd_elf_eh_frame_address_size): Likewise.
1688 * elf32-m32c.c (_bfd_m32c_elf_eh_frame_address_size): Likewise.
1689 * elf32-msp430.c (elf32_msp430_eh_frame_address_size): Likewise.
1690 * elfxx-mips.c (_bfd_mips_elf_eh_frame_address_size): Likewise.
1691 * elfxx-mips.h (_bfd_mips_elf_eh_frame_address_size): Likewise.
1692 * elf-eh-frame.c (_bfd_elf_eh_frame_address_size): Likewise.
1693 (next_cie_fde_offset): Constify params.
1694 (offset_adjust, adjust_eh_frame_local_symbols): Likewise.
1695
d7153c4a
AM
16962017-04-27 Alan Modra <amodra@gmail.com>
1697
1698 * elf-bfd.h (struct eh_cie_fde): Add aug_str_len and aug_data_len.
1699 (_bfd_elf_adjust_eh_frame_global_symbol): Declare.
1700 * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Set aug_str_len and
1701 aug_data_len.
1702 (offset_adjust): New function.
1703 (_bfd_elf_adjust_eh_frame_global_symbol): Likewise.
1704 (adjust_eh_frame_local_symbols): Likewise.
1705 (_bfd_elf_discard_section_eh_frame): Call adjust_eh_frame_local_symbols
1706 after changing anything. Return true if anything changed.
1707 * elflink.c (bfd_elf_discard_info): If .eh_frame changed, call
1708 _bfd_elf_adjust_eh_frame_global_symbol for globals.
1709
641338d8
AM
17102017-04-27 Alan Modra <amodra@gmail.com>
1711
1712 * elflink.c (_bfd_elf_link_hash_hide_symbol): Clear dynstr_index
1713 when force_local.
1714
21d68fcd
AM
17152017-04-27 Alan Modra <amodra@gmail.com>
1716
1717 * elf32-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
1718 (ppc_elf_select_plt_layout, ppc_elf_tls_setup): Use it.
1719 (ppc_elf_adjust_dynamic_symbol, allocate_dynrelocs): Likewise.
1720 (ppc_elf_relocate_section): Likewise. Delete silly optimisation
1721 for undef and undefweak dyn_relocs.
1722 * elf64-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
1723 (ppc64_elf_adjust_dynamic_symbol, ppc64_elf_tls_setup): Use it.
1724 (allocate_got, allocate_dynrelocs): Likewise.
1725 (ppc64_elf_relocate_section): Likewise.
1726
97d343d4
L
17272017-04-26 H.J. Lu <hongjiu.lu@intel.com>
1728
1729 * elf32-i386.c (elf_i386_size_dynamic_sections): Alwasys add
1730 DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rel.plt section.
1731 * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Alwasys
1732 add DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rela.plt section.
1733
04b31182
NC
17342017-04-26 Nick Clifton <nickc@redhat.com>
1735
1736 PR binutils/21434
1737 * reloc.c (bfd_perform_relocation): Check for a negative address
1738 in the reloc.
1739
23ec1e32
MR
17402017-04-26 Maciej W. Rozycki <macro@imgtec.com>
1741
1742 PR ld/21334
1743 * elf-bfd.h (elf_backend_data): Add `always_renumber_dynsyms'
1744 member.
1745 * elfxx-target.h [!elf_backend_always_renumber_dynsyms]
1746 (elf_backend_always_renumber_dynsyms): Define.
1747 (elfNN_bed): Initialize `always_renumber_dynsyms' member.
1748 * elfxx-mips.h (elf_backend_always_renumber_dynsyms): Define.
1749 * elflink.c (bfd_elf_size_dynamic_sections): Also call
1750 `_bfd_elf_link_renumber_dynsyms' if the backend has requested
1751 it.
1752 (bfd_elf_size_dynsym_hash_dynstr): Likewise.
1753
c46cec3a
MR
17542017-04-26 Maciej W. Rozycki <macro@imgtec.com>
1755
1756 * elflink.c (bfd_elf_size_dynamic_sections): Only call
1757 `_bfd_elf_link_renumber_dynsyms' after section GC if dynamic
1758 sections have been created.
1759
e63d1232
NC
17602017-04-26 Nick Clifton <nickc@redhat.com>
1761
1762 PR binutils/21431
1763 * compress.c (bfd_init_section_compress_status): Check the return
1764 value from bfd_malloc.
1765
9e9821dd
L
17662017-04-24 H.J. Lu <hongjiu.lu@intel.com>
1767
1768 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Add
1769 no_finish_dynamic_symbol.
1770 (elf_x86_64_link_hash_newfunc): Set no_finish_dynamic_symbol to
1771 0.
1772 (elf_x86_64_allocate_dynrelocs): If a symbol isn't undefined
1773 weak symbol, don't make it dynamic.
1774 (elf_x86_64_relocate_section): If a symbol isn't dynamic in PIC,
1775 set no_finish_dynamic_symbol and generate R_X86_64_RELATIVE
1776 relocation for GOT reference.
1777 (elf_x86_64_finish_dynamic_symbol): Abort if
1778 no_finish_dynamic_symbol isn't 0.
1779
0dc9a308
L
17802017-04-24 H.J. Lu <hongjiu.lu@intel.com>
1781
1782 PR ld/21402
1783 * elf32-i386.c (elf_i386_allocate_dynrelocs): If a symbol isn't
1784 undefined weak symbol, don't make it dynamic.
1785 (elf_i386_relocate_section): If a symbol isn't dynamic in PIC,
1786 set no_finish_dynamic_symbol and generate R_386_RELATIVE
1787 relocation for R_386_GOT32.
1788
1587442d
L
17892017-04-24 H.J. Lu <hongjiu.lu@intel.com>
1790
1791 PR ld/21425
1792 * elf32-i386.c (ELF_MAXPAGESIZE): Set to 0x1000 for VxWorks.
1793
7eacd66b
AM
17942017-04-23 Alan Modra <amodra@gmail.com>
1795
1796 PR 21414
1797 * section.c (GLOBAL_SYM_INIT): Make available in bfd.h.
1798 * elf.c (lcomm_sym): New.
1799 (_bfd_elf_large_com_section): Use lcomm_sym section symbol.
1800 * bfd-in2.h: Regenerate.
1801
bce964aa
AM
18022017-04-23 Alan Modra <amodra@gmail.com>
1803
1804 PR 21412
1805 * elf-bfd.h (struct elf_backend_data <get_reloc_section>): Change
1806 parameters and comment.
1807 (_bfd_elf_get_reloc_section): Delete.
1808 (_bfd_elf_plt_get_reloc_section): Declare.
1809 * elf.c (_bfd_elf_plt_get_reloc_section, elf_get_reloc_section):
1810 New functions. Don't blindly skip over assumed .rel/.rela prefix.
1811 Extracted from..
1812 (_bfd_elf_get_reloc_section): ..here. Delete.
1813 (assign_section_numbers): Call elf_get_reloc_section.
1814 * elf64-ppc.c (elf_backend_get_reloc_section): Define.
1815 * elfxx-target.h (elf_backend_get_reloc_section): Update.
1816
97e83a10
AM
18172017-04-23 Alan Modra <amodra@gmail.com>
1818
1819 PR 21409
1820 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Don't segfault when
1821 no symbols.
1822
e133d005
L
18232017-04-21 H.J. Lu <hongjiu.lu@intel.com>
1824
1825 PR ld/21402
1826 * elf32-i386.c (elf_i386_link_hash_entry): Add
1827 no_finish_dynamic_symbol.
1828 (elf_i386_link_hash_newfunc): Set no_finish_dynamic_symbol to 0.
1829 (elf_i386_allocate_dynrelocs): If a symbol isn't undefined weak
1830 symbol, don't make it dynamic in PIE.
1831 (elf_i386_relocate_section): If a symbol isn't dynamic in PIE,
1832 set no_finish_dynamic_symbol and generate R_386_RELATIVE
1833 relocation for R_386_GOT32
1834 (elf_i386_finish_dynamic_symbol): Abort if no_finish_dynamic_symbol
1835 isn't 0.
1836
3c5fce9b
L
18372017-04-21 H.J. Lu <hongjiu.lu@intel.com>
1838
1839 PR ld/19617
1840 PR ld/21086
1841 * elflink.c (elf_link_add_object_symbols): Require
1842 --no-dynamic-linker with -E/--dynamic-list when creating
1843 dynamic sections.
1844
0fad2956
MR
18452017-04-20 Maciej W. Rozycki <macro@imgtec.com>
1846
1847 * elflink.c (_bfd_elf_symbol_refs_local_p): Always return TRUE
1848 if forced local.
1849
64575f78
MR
18502017-04-20 Maciej W. Rozycki <macro@imgtec.com>
1851
1852 * elfxx-mips.c (_bfd_mips_elf_final_link): Reorder comment about
1853 dynamic symbol sorting.
1854
59fa66c5
L
18552017-04-20 H.J. Lu <hongjiu.lu@intel.com>
1856
1857 PR ld/21382
1858 * elflink.c (elf_link_add_object_symbols): Preserve
1859 dynamic_ref_after_ir_def when restoring the symbol table for
1860 unneeded dynamic object.
1861
e492d2f8
L
18622017-04-19 H.J. Lu <hongjiu.lu@intel.com>
1863
1864 PR ld/21401
1865 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Don't abort
1866 on on undefined IFUNC symbol in the second PLT.
1867
10169134
WAF
18682017-04-19 Wedson Almeida Filho <wedsonaf@gmail.com>
1869
1870 * peXXigen.c (pe_print_reloc): Correct chunk_end.
1871
954b63d4
AM
18722017-04-19 Alan Modra <amodra@gmail.com>
1873
1874 * elflink.c (_bfd_elf_adjust_dynamic_symbol): Hide undefweak
1875 or make dynamic for info->dynamic_undefined_weak 0 and 1.
1876 * elf32-ppc.c:Formatting.
1877 (ensure_undefweak_dynamic): Don't make dynamic when
1878 info->dynamic_undefined_weak is zero.
1879 (allocate_dynrelocs): Discard undefweak dyn_relocs for
1880 info->dynamic_undefined_weak. Discard undef dyn_relocs when
1881 not default visibility. Discard undef and undefweak
1882 dyn_relocs earlier.
1883 (ppc_elf_relocate_section): Adjust to suit.
1884 * elf64-ppc.c: Formatting.
1885 (ensure_undefweak_dynamic): Don't make dynamic when
1886 info->dynamic_undefined_weak is zero.
1887 (allocate_dynrelocs): Discard undefweak dyn_relocs for
1888 info->dynamic_undefined_weak. Discard them earlier.
1889
e6699019
L
18902017-04-17 H.J. Lu <hongjiu.lu@intel.com>
1891
1892 PR ld/21389
1893 * elflink.c (bfd_elf_size_dynamic_sections): Get soname index
1894 before generating the version definition section.
1895
c5d37467
AM
18962017-04-17 Alan Modra <amodra@gmail.com>
1897
1898 * elflink.c (_bfd_elf_merge_symbol): Undo dynamic linking
1899 state when a regular object file defines a symbol with
1900 incompatible type to that defined by an earlier shared lib.
1901
63a5468a
AM
19022017-04-13 Alan Modra <amodra@gmail.com>
1903
1904 * coffcode.h: Wrap some overly long _bfd_error_handler args.
1905 * elf.c: Likewise.
1906 * elf32-arm.c: Likewise.
1907 * elf32-i386.c: Likewise.
1908 * elf32-mep.c: Likewise.
1909 * elf64-ia64-vms.c: Likewise.
1910 * elf64-x86-64.c: Likewise.
1911 * elflink.c: Likewise.
1912 * elfnn-ia64.c: Likewise.
1913 * elfxx-mips.c: Likewise.
1914
dae82561
AM
19152017-04-13 Alan Modra <amodra@gmail.com>
1916
1917 * aoutx.h: Use %B and %A in error messages throughout file.
1918 * aout-cris.c: Likewise.
1919 * archive.c: Likewise.
1920 * binary.c: Likewise.
1921 * coff-rs6000.c: Likewise.
1922 * coff-tic4x.c: Likewise.
1923 * coffcode.h: Likewise.
1924 * coffgen.c: Likewise.
1925 * cofflink.c: Likewise.
1926 * coffswap.h: Likewise.
1927 * cpu-arm.c: Likewise.
1928 * elf-eh-frame.c: Likewise.
1929 * elf-m10300.c: Likewise.
1930 * elf.c: Likewise.
1931 * elf32-arc.c: Likewise.
1932 * elf32-arm.c: Likewise.
1933 * elf32-bfin.c: Likewise.
1934 * elf32-frv.c: Likewise.
1935 * elf32-iq2000.c: Likewise.
1936 * elf32-m32c.c: Likewise.
1937 * elf32-microblaze.c: Likewise.
1938 * elf32-nds32.c: Likewise.
1939 * elf32-rl78.c: Likewise.
1940 * elf32-rx.c: Likewise.
1941 * elf32-score.c: Likewise.
1942 * elf32-score7.c: Likewise.
1943 * elf32-sh64.c: Likewise.
1944 * elf32-v850.c: Likewise.
1945 * elf32-vax.c: Likewise.
1946 * elf32-visium.c: Likewise.
1947 * elf64-ia64-vms.c: Likewise.
1948 * elf64-mmix.c: Likewise.
1949 * elf64-sh64.c: Likewise.
1950 * elfcode.h: Likewise.
1951 * elfnn-aarch64.c: Likewise.
1952 * elfnn-ia64.c: Likewise.
1953 * elfxx-mips.c: Likewise.
1954 * hpux-core.c: Likewise.
1955 * ieee.c: Likewise.
1956 * ihex.c: Likewise.
1957 * linker.c: Likewise.
1958 * merge.c: Likewise.
1959 * mmo.c: Likewise.
1960 * oasys.c: Likewise.
1961 * pdp11.c: Likewise.
1962 * peXXigen.c: Likewise.
1963 * rs6000-core.c: Likewise.
1964 * vms-alpha.c: Likewise.
1965 * xcofflink.c: Likewise.
1966
c08bb8dd
AM
19672017-04-13 Alan Modra <amodra@gmail.com>
1968
1969 * bfd.c (PRINT_TYPE): Define.
1970 (_doprnt): New function.
1971 (error_handler_internal): Use _doprnt.
1972 * coff-arm.c: Put %A and %B arguments to _bfd_error_handler
1973 calls in their natural order, throughout file.
1974 * coff-mcore.c: Likewise.
1975 * coff-ppc.c: Likewise.
1976 * coff-tic80.c: Likewise.
1977 * cofflink.c: Likewise.
1978 * elf-s390-common.c: Likewise.
1979 * elf.c: Likewise.
1980 * elf32-arm.c: Likewise.
1981 * elf32-i386.c: Likewise.
1982 * elf32-m32r.c: Likewise.
1983 * elf32-msp430.c: Likewise.
1984 * elf32-spu.c: Likewise.
1985 * elf64-ia64-vms.c: Likewise.
1986 * elf64-sparc.c: Likewise.
1987 * elf64-x86-64.c: Likewise.
1988 * elflink.c: Likewise.
1989 * elfnn-aarch64.c: Likewise.
1990 * elfnn-ia64.c: Likewise.
1991 * elfxx-mips.c: Likewise.
1992
10463f39
AM
19932017-04-13 Alan Modra <amodra@gmail.com>
1994
1995 * elf32-arm.c (arm_type_of_stub): Supply missing args to "long
1996 branch veneers" error. Fix double space and format message.
1997 * elf32-avr.c (avr_add_stub): Do not pass NULL as %B arg.
1998 * elf64-ppc.c (tocsave_find): Supply missing %B arg.
1999
4af8774e
AM
20002017-04-13 Alan Modra <amodra@gmail.com>
2001
2002 * bfd-in2.h: Regenerate.
2003
e4097f5e
L
20042017-04-11 H.J. Lu <hongjiu.lu@intel.com>
2005
2006 * elf-properties.c (_bfd_elf_parse_gnu_properties): Remove the
2007 extra `\n' in warning/error messages.
2008 * elf32-i386.c (elf_i386_parse_gnu_properties): Likewise.
2009 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
2010
537616aa
L
20112017-04-11 H.J. Lu <hongjiu.lu@intel.com>
2012
2013 * elf-properties.c (_bfd_elf_parse_gnu_properties): Ignore
2014 processor-specific properties with generic ELF target vector.
2015
bb1dd176
QZ
20162017-04-10 Qing Zhao <qing.zhao@oracle.com>
2017
2018 * elf32-sparc.c (elf_backend_fixup_symbol): New.
2019 * elf64-sparc.c (elf_backend_fixup_symbol): New.
2020 * elfxx-sparc.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): New.
2021 (_bfd_sparc_elf_link_hash_entry): Add has_got_reloc and
2022 has_non_got_reloc.
2023 (link_hash_newfunc): Initialize has_got_reloc and
2024 has_non_got_reloc.
2025 (_bfd_sparc_elf_size_dynamic_sections): Set interp to .interp
2026 section.
2027 (_bfd_sparc_elf_copy_indirect_symbol): Copy has_got_reloc and
2028 has_non_got_reloc.
2029 (_bfd_sparc_elf_check_relocs): Set has_got_reloc and
2030 has_non_got_reloc.
2031 (_bfd_sparc_elf_fixup_symbol): New function.
2032 (allocate_dynrelocs): Don't allocate space for dynamic
2033 relocations and discard relocations against resolved undefined
2034 weak symbols in executable. Don't make resolved undefined weak
2035 symbols in executable dynamic. Keep dynamic non-GOT/non-PLT
2036 relocation against undefined weak symbols in PIE.
2037 (_bfd_sparc_elf_relocate_section): Don't generate dynamic
2038 relocations against resolved undefined weak symbols in PIE
2039 (_bfd_sparc_elf_finish_dynamic_symbol): Keep PLT/GOT entries
2040 without ynamic PLT/GOT relocations for resolved undefined weak
2041 symbols.
2042 Don't generate dynamic relocation against resolved undefined
2043 weak symbol in executable.
2044 (pie_finish_undefweak_symbol): New function.
2045 (_bfd_sparc_elf_finish_dynamic_sections): Call
2046 pie_finish_undefweak_symbol on all symbols in PIE.
2047 * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Add interp.
2048 (_bfd_sparc_elf_fixup_symbol): New function.
2049
d236cfd4
NC
20502017-04-10 Nick Clifton <nickc@redhat.com>
2051
2052 * config.bfd: Remove ns32k from obsolete list.
2053
6f9dbcd4
AM
20542017-04-10 Alan Modra <amodra@gmail.com>
2055
2056 PR 21287
2057 * elf.c (special_sections_f): Match .fini_array and .fini_array.*.
2058 (special_sections_i): Likewise for .init_array.
2059 (special_sections_p): Likewise for .preinit_array.
2060
8170f769
L
20612017-04-07 H.J. Lu <hongjiu.lu@intel.com>
2062
2063 PR ld/19579
2064 PR ld/21306
2065 * elf32-s390.c (elf_s390_finish_dynamic_symbol): Check
2066 ELF_COMMON_DEF_P for common symbols.
2067 * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
2068 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
2069 * elflink.c (_bfd_elf_merge_symbol): Revert commits
2070 202ac193bbbecc96a4978d1ac3d17148253f9b01 and
2071 07492f668d2173da7a2bda3707ff0985e0f460b6.
2072
49f4617b
PA
20732017-04-07 Pedro Alves <palves@redhat.com>
2074
2075 * opncls.c (bfd_get_debug_link_info): Rename to...
2076 (bfd_get_debug_link_info_1): ... this. Change type of second
2077 parameter to void pointer. Adjust.
2078 (bfd_get_debug_link_info): Reimplement on top of
2079 bfd_get_debug_link_info_1.
2080 (separate_debug_file_exists, separate_alt_debug_file_exists):
2081 Change type of second parameter to void pointer. Adjust.
2082 (get_func_type, check_func_type): Change type of second parameter
2083 to void pointer.
2084 (find_separate_debug_file): Add 'func_data' parameter. Pass it to
2085 the callback functions instead of passing the address of a local.
2086 (bfd_follow_gnu_debuglink): Pass address of unsigned long local to
2087 find_separate_debug_file.
2088 (get_alt_debug_link_info_shim): Change type of second parameter to
2089 void pointer. Adjust.
2090 (bfd_follow_gnu_debugaltlink): Adjust to pass NULL to
2091 find_separate_debug_file.
2092 (get_build_id_name, bfd_boolean check_build_id_file): Change type
2093 of second parameter to void pointer. Adjust.
2094 (bfd_follow_build_id_debuglink): Pass address of bfd_build_id
2095 pointer local to find_separate_debug_file.
2096
20972017-04-07 Tristan Gingold <gingold@gingold-Precision-7510>
1fd6d111
TG
2098
2099 * coffgen.c (_bfd_coff_gc_mark_hook): Handle PE weak
2100 external symbols with a definition.
2101 (_bfd_coff_gc_mark_extra_sections): Fix typo.
2102
86abf93a
AM
21032017-04-07 Alan Modra <amodra@gmail.com>
2104
2105 * po/SRC-POTFILES.in: Regenerate.
2106
8dea77f0
AM
21072017-04-05 Alan Modra <amodra@gmail.com>
2108
2109 * elf64-ppc.c (ppc64_elf_gc_sweep_hook): Support ELFv2 PLT
2110 reference counting.
2111
477bdd39
JT
21122017-04-02 Jon Turney <jon.turney@dronecode.org.uk>
2113
2114 (_bfd_XXi_swap_aouthdr_out): For clarity, use defines rather than
2115 numbers for DataDirectory entry indicies passed to
2116 add_data_entry().
2117
a91e1603
L
21182017-04-04 H.J. Lu <hongjiu.lu@intel.com>
2119
2120 * elf.c (get_program_header_size): Add a GNU_MBIND segment for
2121 each GNU_MBIND section and align GNU_MBIND section to page size.
2122 (_bfd_elf_map_sections_to_segments): Create a GNU_MBIND
2123 segment for each GNU_MBIND section.
2124 (_bfd_elf_init_private_section_data): Copy sh_info from input
2125 for GNU_MBIND section.
2126
b5292032
PD
21272017-04-03 Palmer Dabbelt <palmer@dabbelt.com>
2128
2129 * elfnn-riscv.c (GP_NAME): Delete.
2130 (riscv_global_pointer_value): Change GP_NAME to RISCV_GP_SYMBOL.
2131 (_bfd_riscv_relax_lui): Likewise.
2132
ad32986f
NC
21332017-04-04 Nick Clifton <nickc@redhat.com>
2134
2135 PR binutils/21342
2136 * elflink.c (_bfd_elf_define_linkage_sym): Prevent null pointer
2137 dereference.
2138 (bfd_elf_final_link): Only initialize the extended symbol index
2139 section if there are extended symbol tables to list.
2140
46bed679
L
21412017-04-03 H.J. Lu <hongjiu.lu@intel.com>
2142
2143 * Makefile.am (BFD32_BACKENDS): Add elf-properties.lo.
2144 (BFD32_BACKENDS_CFILES): Add elf-properties.c.
2145 * configure.ac (elf): Add elf-properties.lo.
2146 * Makefile.in: Regenerated.
2147 * configure: Likewise.
2148 * elf-bfd.h (elf_property_kind): New.
2149 (elf_property): Likewise.
2150 (elf_property_list): Likewise.
2151 (elf_properties): Likewise.
2152 (_bfd_elf_parse_gnu_properties): Likewise.
2153 (_bfd_elf_get_property): Likewise.
2154 (_bfd_elf_link_setup_gnu_properties): Likewise.
2155 (elf_backend_data): Add parse_gnu_properties, merge_gnu_properties
2156 and setup_gnu_properties.
2157 (elf_obj_tdata): Add properties.
2158 * elf-properties.c: New file.
2159 * elf32-i386.c (elf_i386_parse_gnu_properties): New.
2160 (elf_i386_merge_gnu_properties): Likewise.
2161 (elf_backend_parse_gnu_properties): Likewise.
2162 (elf_backend_merge_gnu_properties): Likewise.
2163 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
2164 (elf_x86_64_merge_gnu_properties): Likewise.
2165 (elf_backend_parse_gnu_properties): Likewise.
2166 (elf_backend_merge_gnu_properties): Likewise.
2167 * elfxx-target.h (elf_backend_merge_gnu_properties): Likewise.
2168 (elf_backend_parse_gnu_properties): Likewise.
2169 (elf_backend_setup_gnu_properties): Likewise.
2170 (elfNN_bed): Add elf_backend_parse_gnu_properties,
2171 elf_backend_merge_gnu_properties and
2172 elf_backend_setup_gnu_properties.
2173
f96bd6c2
PC
21742017-03-30 Pip Cet <pipcet@gmail.com>
2175
2176 * elf32-wasm32.c: Add relocation code, two relocs.
2177 * reloc.c: Add wasm32 relocations.
2178 * libbfd.h: Regenerate.
2179 * bfd-in2.h: Regenerate.
2180 * bfd/po/bfd.pot: Regenerate.
2181
e643cb45
NC
21822017-03-29 Nick Clifton <nickc@redhat.com>
2183
2184 PR binutils/18025
2185 * coff-bfd.h (struct coff_section_data): Add new fields:
2186 saved_bias and bias.
2187 * coffgen.c (coff_find_nearest_line_with_names): Cache the bias
2188 computed for PE binaries.
2189 * dwarf2.c (scan_unit_for_symbols): Only warn once about each
2190 missing abbrev.
2191
086554e8
HPN
21922017-03-28 Hans-Peter Nilsson <hp@axis.com>
2193
2194 PR ld/16044
2195 * elf32-cris.c (elf_cris_adjust_gotplt_to_got): Adjust BFD_ASSERT
2196 to handle a local symbol with a hash-symbol-entry; without PLT.
2197 Add BFD_ASSERT for an incidental case with GOT entry present.
2198 (cris_elf_check_relocs): Increment PLT refcount only if the symbol
2199 isn't forced-or-set local.
2200
a6be0538
PC
22012017-03-27 Pip Cet <pipcet@gmail.com>
2202
2203 * wasm-module.c: New file to support WebAssembly modules.
2204 * wasm-module.h: New file to support WebAssembly modules.
2205 * doc/webassembly.texi: Start documenting wasm-module.c.
2206 * config.bfd: Add wasm_vec.
2207 * targets.c: Likewise.
2208 * configure.ac: Likewise.
2209 * Makefile.am: Add entries for wasm-module.c.
2210 * Makefile.in: Regenerate.
2211 * configure: Regenerate.
2212 * po/SRC-POTFILES.in: Regenerate.
2213
79b1d3cb
PC
22142017-03-27 Pip Cet <pipcet@gmail.com>
2215
2216 * cpu-wasm32.c: New file to support wasm32 architecture.
2217 * elf32-wasm32.c: New file to support wasm32 architecture.
2218 * Makefile.am: Add wasm32 architecture.
2219 * archures.c: Likewise.
2220 * config.bfd: Likewise.
2221 * configure.ac: Likewise.
2222 * targets.c: Likewise.
2223 * Makefile.in: Regenerate.
2224 * bfd-in2.h: Regenerate.
2225 * configure: Regenerate.
2226 * po/SRC-POTFILES.in: Regenerate.
2227
aaed6f5b
AM
22282017-03-20 Alan Modra <amodra@gmail.com>
2229
2230 PR 21266
2231 * elf64-ppc.c (compare_symbols): Stabilize sort.
2232
82e66161
AM
22332017-03-18 Alan Modra <amodra@gmail.com>
2234
2235 * elf64-ppc.c (struct ppc_link_hash_table): Add
2236 local_ifunc_resolver and maybe_local_ifunc_resolver.
2237 (ppc_build_one_stub): Set flags on emitting dynamic
2238 relocation to ifunc.
2239 (ppc64_elf_relocate_section): Likewise.
2240 (ppc64_elf_finish_dynamic_symbol): Likewise.
2241 (ppc64_elf_finish_dynamic_sections): Error on DT_TEXTREL with
2242 local dynamic relocs to ifuncs.
2243 * elf32-ppc.c (struct ppc_elf_link_hash_table): Add
2244 local_ifunc_resolver and maybe_local_ifunc_resolver.
2245 (ppc_elf_relocate_section): Set flag on emitting dynamic
2246 relocation to ifuncs.
2247 (ppc_elf_finish_dynamic_symbol): Likewise.
2248 (ppc_elf_finish_dynamic_sections): Error on DT_TEXTREL with local
2249 dynamic relocs to ifuncs.
2250
f955cccf
NC
22512017-03-13 Nick Clifton <nickc@redhat.com>
2252
2253 PR binutils/21202
2254 * reloc.c (BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC): Rename to
2255 BFD_RELOC_AARCH64_TLSDESC_LD64_LO12.
2256 (BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC): Rename to
2257 BFD_RELOC_AARCH64_TLSDESC_ADD_LO12.
2258 * bfd-in2.h: Regenerate.
2259 * libbfd.h: Regenerate.
2260 * elfnn-aarch64.c (IS_AARCH64_TLS_RELAX_RELOC): Update reloc
2261 names.
2262 (IS_AARCH64_TLSDESC_RELOC): Likewise.
2263 (elfNN_aarch64_howto_table): Likewise.
2264 (aarch64_tls_transition_without_check): Likewise.
2265 (aarch64_reloc_got_type): Likewise.
2266 (elfNN_aarch64_final_link_relocate): Likewise.
2267 (elfNN_aarch64_tls_relax): Likewise.
2268 (elfNN_aarch64_relocate_section): Likewise.
2269 (elfNN_aarch64_gc_sweep_hook): Likewise.
2270 (elfNN_aarch64_check_relocs): Likewise.
2271 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
2272 (_bfd_aarch64_elf_resolve_relocation): Likewise.
2273
4aef7643
AM
22742017-03-11 Alan Modra <amodra@gmail.com>
2275
2276 * elf32-ppc.c: Remove ATTRIBUTE_UNUSED throughout when function
2277 parameter is in fact used. Whitespace fixes.
2278 * elf64-ppc.c: Likewise.
2279
f03265d9
ST
22802017-03-09 Sam Thursfield <sam.thursfield@codethink.co.uk>
2281
2282 * rs6000-core.c (CORE_NEW): Simplify macro when
2283 AIX_CORE_DUMPX_CORE and BFD64 are true to avoid compile warning.
2284
b1b07054
AM
22852017-03-07 Alan Modra <amodra@gmail.com>
2286
2287 PR 21224
2288 PR 20519
2289 * elf64-ppc.c (ppc64_elf_relocate_section): Add missing
2290 dyn_relocs check.
2291
2e0ce1c8
AM
22922017-03-05 Alan Modra <amodra@gmail.com>
2293
2294 * elf-bfd.h (struct eh_cie_fde): Add u.cie.per_encoding_aligned8.
2295 * elf-eh-frame.c (size_of_output_cie_fde): Don't align here.
2296 (next_cie_fde_offset): New function.
2297 (_bfd_elf_parse_eh_frame): Set u.cie.per_encoding_aligned8.
2298 (_bfd_elf_discard_section_eh_frame): Align zero terminator to
2299 four bytes. Align CIEs to four or eight bytes depending on
2300 per_encoding_aligned8. Align FDEs according to their encoding.
2301 Pad last FDE to output section alignment.
2302 (_bfd_elf_write_section_eh_frame): Adjust to suit. Remove
2303 assertion.
2304 * elf64-ppc.c (glink_eh_frame_cie): Delete padding.
2305 (ppc64_elf_size_stubs): Pad glink eh_frame as per elf-eh-frame.c.
2306 (ppc64_elf_finish_dynamic_sections): Adjust to suit.
2307
f98450c6
NC
23082017-03-02 Martin Bickel <binutils@ineranves.de>
2309
2310 PR ld/21212
2311 * elf.c (rewrite_elf_program_header): Do not issue a warning for
d20928fa 2312 empty segments which have a zero filesz, but a non-zero memsz.
f98450c6 2313
673cff9b
AM
23142017-03-02 Alan Modra <amodra@gmail.com>
2315
2316 * elf32-ppc.c (ppc_elf_vle_split16): Correct insn mask typo.
2317
3de43e7b
AM
23182017-02-28 Alan Modra <amodra@gmail.com>
2319
2320 * elf64-ppc.c (ppc64_elf_ha_reloc): Revert last change.
2321 (ppc64_elf_relocate_section): Likewise.
2322
4ef97a1b
AM
23232017-02-28 Alan Modra <amodra@gmail.com>
2324
2325 PR 20995
2326 * elf32-nios2.c (nios2_elf32_relocate_section): Use htab
2327 rather than elf32_nios2_hash_table or elf_hash_table.
2328 (create_got_section): Likewise.
2329 (nios2_elf32_finish_dynamic_symbol): Likewise.
2330 (nios2_elf32_adjust_dynamic_symbol): Likewise.
2331 (nios2_elf32_size_dynamic_sections): Likewise.
2332 (nios2_elf32_check_relocs): Delete dynobj, sgot, and srelgot
2333 vars. Use htab equivalents directly instead. Don't create
2334 all dynamic sections on needing just the GOT. Use a goto
2335 rather than a fall-through with reloc test. Ensure
2336 htab->dynobj is set when making dynamic sreloc section.
2337 (nios2_elf32_finish_dynamic_sections): Delete dynobj, use htab
2338 equivalent directly instead. Don't segfault on looking for
2339 .dynamic when dynamic sections have not been created. Don't
2340 segfault on .got.plt being discarded.
2341 (nios2_elf32_size_dynamic_sections): Delete plt and got vars.
2342 Don't set "relocs" on .rela.plt. Do handle .sbss. Delete
2343 fixme and another not so relevant comment.
2344 (nios2_elf_add_symbol_hook): Delete dynobj var. If not
2345 already set, set hash table dynobj on creating .sbss.
2346
7ba71655
AM
23472017-02-28 Alan Modra <amodra@gmail.com>
2348
2349 * reloc.c (BFD_RELOC_PPC_16DX_HA): New.
2350 * elf64-ppc.c (ppc64_elf_howto_raw <R_PPC64_16DX_HA>): New howto.
2351 (ppc64_elf_reloc_type_lookup): Translate new bfd reloc.
2352 (ppc64_elf_ha_reloc): Correct overflow test on REL16DX_HA.
2353 (ppc64_elf_relocate_section): Likewise.
2354 * elf32-ppc.c (ppc_elf_howto_raw <R_PPC_16DX_HA>): New howto.
2355 (ppc_elf_reloc_type_lookup): Translate new bfd reloc.
2356 (ppc_elf_check_relocs): Handle R_PPC_16DX_HA to pacify gcc.
2357 * libbfd.h: Regenerate.
2358 * bfd-in2.h: Regenerate.
2359
afbf7e8e
AM
23602017-02-28 Alan Modra <amodra@gmail.com>
2361
2362 * elflink.c (_bfd_elf_create_dynamic_sections): Don't make
2363 dynamic .data.rel.ro read-only.
2364 * elf32-arm.c (elf32_arm_finish_dynamic_symbol): Compare section
2365 rather than section flags when deciding where copy reloc goes.
2366 * elf32-cris.c (elf_cris_finish_dynamic_symbol): Likewise.
2367 * elf32-hppa.c (elf32_hppa_finish_dynamic_symbol): Likewise.
2368 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Likewise.
2369 * elf32-metag.c (elf_metag_finish_dynamic_symbol): Likewise.
2370 * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Likewise.
2371 * elf32-nios2.c (nios2_elf32_finish_dynamic_symbol): Likewise.
2372 * elf32-or1k.c (or1k_elf_finish_dynamic_symbol): Likewise.
2373 * elf32-ppc.c (ppc_elf_finish_dynamic_symbol): Likewise.
2374 * elf32-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
2375 * elf32-tic6x.c (elf32_tic6x_finish_dynamic_symbol): Likewise.
2376 * elf32-tilepro.c (tilepro_elf_finish_dynamic_symbol): Likewise.
2377 * elf64-ppc.c (ppc64_elf_finish_dynamic_symbol): Likewise.
2378 * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
2379 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
2380 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Likewise.
2381 * elfnn-riscv.c (riscv_elf_finish_dynamic_symbol): Likewise.
2382 * elfxx-mips.c (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise.
2383 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Likewise.
2384 * elfxx-tilegx.c (tilegx_elf_finish_dynamic_symbol): Likewise.
2385
0e392101
MR
23862017-02-28 Maciej W. Rozycki <macro@imgtec.com>
2387
2388 * elfxx-mips.c (mips_elf_perform_relocation): Also handle the
2389 `jalr $0, $25' instruction encoding.
2390
bd757ca7
NC
23912017-02-27 Nick Clifton <nickc@redhat.com>
2392
2393 PR ld/21180
2394 * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Avoid
2395 generating a seg-fault when encountering a symbol that has been
2396 deleted by garbage collection.
2397
034fed0b
AM
23982017-02-25 Alan Modra <amodra@gmail.com>
2399
2400 * elf32-arc.c (struct dynamic_sections): Delete.
2401 (enum dyn_section_types): Delete.
2402 (dyn_section_names): Delete.
2403 (arc_create_dynamic_sections): Delete.
2404 (elf_arc_finish_dynamic_sections): Don't call the above. Don't
2405 segfault on discarded .rela.plt section.
2406 (elf_arc_size_dynamic_sections): Formatting. Don't call
2407 arc_create_dynamic_sections. Don't allocate memory for sections
2408 handled by the generic linker. Correct code finding relocs in
2409 read-only sections. Set SEC_EXCLUDE on zero size .got,
2410 .got.plt, and .dynbss sections. Do set .interp for pies.
2411
d0f744f9
AW
24122017-02-24 Andrew Waterman <andrew@sifive.com>
2413
2414 * elfnn-riscv.c (GP_NAME): New macro.
2415 (riscv_global_pointer_value): Use it.
2416 (_bfd_riscv_relax_lui): If symbol and global pointer are in same
2417 output section, consider only that section's alignment.
2418
5d58c733
MR
24192017-02-23 Maciej W. Rozycki <macro@imgtec.com>
2420
2421 * elfxx-mips.h (_bfd_mips_relax_section): Remove prototype.
2422 * elfxx-mips.c (_bfd_mips_relax_section): Remove function.
2423 * elf64-mips.c (bfd_elf64_bfd_relax_section): Remove macro.
2424 * elfn32-mips.c (bfd_elf32_bfd_relax_section): Likewise.
2425
c1556ecd
MR
24262017-02-23 Maciej W. Rozycki <macro@imgtec.com>
2427
2428 * elfxx-mips.c (mips_elf_calculate_relocation) <R_MIPS_JALR>
2429 <R_MICROMIPS_JALR>: Discard relocation if `cross_mode_jump_p'
2430 or misaligned.
2431
5499c7c7
AM
24322017-02-23 Alan Modra <amodra@gmail.com>
2433
2434 PR 20744
2435 * elf32-ppc.c (ppc_elf_howto_raw): Correct dst_mask on all VLE
2436 16D relocations.
2437 (ppc_elf_vle_split16): Correct field mask and shift for 16D relocs.
2438 (ppc_elf_relocate_section): Correct calculation for VLE SDAREL
2439 relocs.
2440
902e9fc7
MR
24412017-02-22 Maciej W. Rozycki <macro@imgtec.com>
2442
2443 PR ld/20828
2444 * elflink.c (bfd_elf_size_dynamic_sections): Move symbol version
2445 processing ahead of the call to `elf_gc_sweep_symbol'.
2446
758d96d8
NC
24472017-02-22 Nick Clifton <nickc@redhat.com>
2448
2449 PR binutils/21193
2450 * opncls.c (bfd_create_gnu_debuglink_section): Give the newly
2451 created section 4-byte alignment.
2452
6528b6eb
AM
24532017-02-22 Alan Modra <amodra@gmail.com>
2454
2455 * elf64-ppc.c (ppc64_elf_finish_dynamic_sections): Don't segfault
2456 on .got or .plt output section being discarded by script.
2457 * elf32-ppc.c (ppc_elf_finish_dynamic_sections): Likewise. Move
2458 vxworks splt temp.
2459
24f1a751
AM
24602017-02-21 Alan Modra <amodra@gmail.com>
2461
2462 * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Only emit
2463 DT_RELA, DT_RELASZ, and DT_RELAENT when DT_RELASZ is non-zero.
2464
64487780
AM
24652017-02-20 Alan Modra <amodra@gmail.com>
2466
2467 PR 21181
2468 * elflink.c (bfd_elf_final_link): Make DT_REL/DT_RELA zero
2469 if DT_RELSZ/DT_RELASZ is zero.
2470
6438d1be
NC
24712017-02-17 Nick Clifton <nickc@redhat.com>
2472
2473 * compress.c (bfd_get_full_section_contents): Remember to reduce
2474 compressed size by the sizeof the compression header when
2475 decompressing the contents.
2476
4bc26c69
PA
24772017-02-17 Pedro Alves <palves@redhat.com>
2478
2479 * srec.c (Chunk): Rename to ...
2480 (_bfd_srec_len): ... this.
2481 (S3Forced): Rename to ...
2482 (_bfd_srec_forceS3): ... this.
2483 * objcopy.c: Adjust all references.
2484
7ec22e0f
PA
24852017-02-17 Pedro Alves <palves@redhat.com>
2486
2487 * archive.c (bsd_write_armap): Rename to ...
2488 (_bfd_bsd_write_armap): ... this.
2489 (coff_write_armap): Rename to ...
2490 (_bfd_coff_write_armap): ... this.
2491 * libbfd-in.h (bsd_write_armap): Rename to ...
2492 (_bfd_bsd_write_armap): ... this.
2493 (coff_write_armap): Rename to ...
2494 (_bfd_coff_write_armap): ... this.
2495 * aout-target.h, aout-tic30.c: Adjust all users.
2496 * libbfd.h: Regenerate.
2497
8c8402cc
PA
24982017-02-17 Pedro Alves <palves@redhat.com>
2499
2500 * bfd-in.h (bfd_read, bfd_write): Adjust to rename.
2501 (warn_deprecated): Rename to ...
2502 (_bfd_warn_deprecated): ... this.
2503 * libbfd.c (warn_deprecated): Rename to ...
2504 (_bfd_warn_deprecated): ... this.
2505 * bfd-in2.h: Regenerate.
2506
c7c3d11b
PA
25072017-02-17 Pedro Alves <palves@redhat.com>
2508
2509 * bfdio.c (real_ftell): Rename to ...
2510 (_bfd_real_ftell): ... this.
2511 (real_fseek): Rename to ...
2512 (_bfd_real_fseek): ... this.
2513 (real_fopen): Rename to ...
2514 (_bfd_real_fopen): ... this.
2515 * libbfd-in.h (real_ftell): Rename to ...
2516 (_bfd_real_ftell): ... this.
2517 (real_fseek): Rename to ...
2518 (_bfd_real_fseek): ... this.
2519 (real_fopen): Rename to ...
2520 (_bfd_real_fopen): ... this.
2521 * cache.c, dwarf2.c, opncls.c: Adjust all callers.
2522 * libbfd.h: Regenerate.
2523
4265548c
PA
25242017-02-17 Pedro Alves <palves@redhat.com>
2525
2526 * dwarf2.c, elf-attrs.c, elf32-nds32.c: Adjust all callers.
2527 * libbfd.c (read_unsigned_leb128): Rename to ...
2528 (_bfd_read_unsigned_leb128): ... this.
2529 (read_signed_leb128): Rename to ...
2530 (_bfd_read_signed_leb128): ... this.
2531 (safe_read_leb128): Rename to ...
2532 (_bfd_safe_read_leb128): ... this.
2533 * libbfd-in.h (read_unsigned_leb128): Rename to ...
2534 (_bfd_read_unsigned_leb128): ... this.
2535 (read_signed_leb128): Rename to ...
2536 (_bfd_read_signed_leb128): ... this.
2537 (safe_read_leb128): Rename to ...
2538 (_bfd_safe_read_leb128): ... this.
2539 * libbfd.h: Renegerate.
2540
3239a423
AB
25412017-02-16 Andrew Burgess <andrew.burgess@embecosm.com>
2542
2543 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Perform symbol lookup
2544 before trying to fine matching file and line information.
2545
90ed9b8b
AB
25462017-02-16 Andrew Burgess <andrew.burgess@embecosm.com>
2547
2548 * dwarf2.c (struct dwarf2_debug): Add orig_bfd member.
2549 (_bfd_dwarf2_slurp_debug_info): If stashed debug information does
2550 not match current bfd, then reload debug information. Record bfd
2551 we're loading debug info for in the stash. If we have debug
2552 informatin in the cache then perform section placement before
2553 returning.
2554
a8c75b76
AM
25552017-02-16 Alan Modra <amodra@gmail.com>
2556
2557 PR 21000
2558 * elf-bfd.h (struct elf_backend_data): Add no_page_alias.
2559 * elfxx-target.h (elf_backend_no_page_alias): Define.
2560 (elfNN_bed): Init new field.
2561 * elf.c (assign_file_positions_for_load_sections): If no_page_alias
2562 ensure PT_LOAD segment starts on a new page.
2563 * elf32-hppa.c (elf_backend_no_page_alias): Define.
2564
247d6c4c
AM
25652017-02-16 Alan Modra <amodra@gmail.com>
2566
2567 PR 21132
2568 * elf32-hppa.c (allocate_plt_static): Allocate space for relocs
2569 if pic.
2570
90571206
JW
25712017-02-16 Jiong Wang <jiong.wang@arm.com>
2572
2573 * bfd.c (BFD_FLAGS_SAVED): Add BFD_LINKER_CREATED.
2574 * bfd-in2.h: Regenerated.
2575
2a568401
L
25762017-02-15 H.J. Lu <hongjiu.lu@intel.com>
2577
2578 PR ld/21168
2579 * elf32-i386.c (elf_i386_relocate_section): Allow
2580 "lea foo@GOT, %reg" in PIC.
2581
a5def14f
L
25822017-02-15 H.J. Lu <hongjiu.lu@intel.com>
2583
2584 PR ld/20244
2585 * elf32-i386.c (elf_i386_relocate_section): Properly get IFUNC
2586 symbol name when reporting R_386_GOT32/R_386_GOT32X relocation
2587 error against local IFUNC symbol without a base register for
2588 PIC.
2589
174d0a74
MR
25902017-02-15 Maciej W. Rozycki <macro@imgtec.com>
2591
2592 * elf32-ppc.c (ppc_elf_check_relocs): Use `%H:' rather than
2593 `%P: %H:' with `info->callbacks->einfo'.
2594 (ppc_elf_relocate_section): Likewise.
2595 * elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
2596 (ppc64_elf_edit_toc): Likewise.
2597 (ppc64_elf_relocate_section): Likewise.
2598
e278ae05
AM
25992017-02-14 Alan Modra <amodra@gmail.com>
2600
2601 * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Support
2602 --gc-keep-exported, and test versioned field of sym rather than
2603 looking for @ in name.
2604
10ddfe62
PD
26052017-02-13 Palmer Dabbelt <palmer@dabbelt.com>
2606
2607 * elfnn-riscv.c (riscv_global_pointer_value): Change _gp to
2608 __global_pointer$.
2609
d11135f5
NC
26102017-02-13 Nick Clifton <nickc@redhat.com>
2611
2612 PR binutils/21151
2613 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Check for an invalid
2614 unit length field.
2615
cc162427
AW
26162017-02-07 Andrew Waterman <andrew@sifive.com>
2617
2618 * elfnn-riscv.c (riscv_elf_finish_dynamic_sections): Only write PLT
2619 entry size if PLT header is written.
2620
3d044c0c
SL
26212017-02-06 Sheldon Lobo <sheldon.lobo@oracle.com>
2622
2623 Fix sparc64 dynamic relocation processing to use the dynamic
2624 symbol count.
2625 * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Use 'dynamic'
2626 to determine if bfd_get_symcount() or bfd_get_dynamic_symcount()
2627 should be used.
2628
1b7e3d2f
NC
26292017-02-03 Nick Clifton <nickc@redhat.com>
2630
2631 PR 21096
2632 * coffcode.h (coff_write_object_contents): Enlarge size of
2633 s_name_buf in order to avoid compile time warning about possible
2634 integer truncation.
2635 * elf32-nds32.c (nds32_elf_ex9_import_table): Mask off lower
2636 32-bits of insn value before printing into buffer.
2637
e17b0c35
MR
26382017-02-02 Maciej W. Rozycki <macro@imgtec.com>
2639
2640 * elfxx-mips.c (mips_elf_hash_sort_data): Add
2641 `max_local_dynindx'.
2642 (mips_elf_sort_hash_table): Handle it.
2643 (mips_elf_sort_hash_table_f) <GGA_NONE>: For forced local
2644 symbols bump up `max_local_dynindx' rather than
2645 `max_non_got_dynindx'.
2646
55f8b9d2
MR
26472017-02-02 Maciej W. Rozycki <macro@imgtec.com>
2648
2649 * elfxx-mips.c (mips_elf_hash_sort_data): Convert the
2650 `min_got_dynindx', `max_unref_got_dynindx' and
2651 `max_non_got_dynindx' members to the `bfd_size_type' data type.
2652 (mips_elf_sort_hash_table): Adjust accordingly.
2653
0f8c4b60
MR
26542017-02-02 Maciej W. Rozycki <macro@imgtec.com>
2655
2656 * elfxx-mips.c (mips_elf_sort_hash_table): Use `htab' throughout
2657 to access the hash table.
2658
17a80fa8
MR
26592017-02-02 Maciej W. Rozycki <macro@imgtec.com>
2660
2661 * elfxx-mips.c (mips_elf_sort_hash_table): Move assertion on
2662 non-NULL `htab' to the beginning.
2663
8f56d4fd
MR
26642017-02-02 Maciej W. Rozycki <macro@imgtec.com>
2665
2666 * elflink.c (elf_gc_sweep): Wrap overlong line.
2667
8b10b0b3
MR
26682017-01-30 Maciej W. Rozycki <macro@imgtec.com>
2669
2670 * elfxx-mips.h (_bfd_mips_elf_insn32): Rename prototype to...
2671 (_bfd_mips_elf_linker_flags): ... this. Add another parameter.
2672 * elfxx-mips.c (mips_elf_link_hash_table): Add
2673 `ignore_branch_isa' member.
2674 (mips_elf_perform_relocation): Do not treat an ISA mode mismatch
2675 in branch relocation calculation as an error if
2676 `ignore_branch_isa' has been set.
2677 (_bfd_mips_elf_insn32): Rename to...
2678 (_bfd_mips_elf_linker_flags): ... this. Rename the `on'
2679 parameter to `insn32' and add an `ignore_branch_isa' parameter.
2680 Handle the new parameter.
2681
1fbd05e1
HPN
26822017-01-27 Hans-Peter Nilsson <hp@axis.com>
2683
22d9a0de
HPN
2684 * elf32-cris.c (elf_cris_finish_dynamic_symbol): Remove now unused
2685 local variable dynobj.
2686
1fbd05e1
HPN
2687 PR ld/20995
2688 * elf32-cris.c (elf_cris_size_dynamic_sections): Handle sdynrelro.
2689 (elf_cris_adjust_dynamic_symbol): Place variables copied into the
2690 executable from read-only sections into sdynrelro.
2691 (elf_cris_finish_dynamic_symbol): Select sreldynrelro for
2692 dynamic relocs in sdynrelro.
2693 (elf_backend_want_dynrelro): Define.
2694
4a7324e1
SH
26952017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
2696
2697 * config.bfd (*-*-rtemsaout*): Mark as removed.
2698
c75b4ebd
SH
26992017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
2700
2701 * config.bfd (powerpcle-*-rtems*): Do not mark as removed.
2702 (arm-*-rtems*): Move to (arm*-*-eabi*).
2703 (i[3-7]86-*-rtems*): Move to (i[3-7]86-*-elf*).
2704 (m68-*-rtems*): Move to (m68*-*-elf*).
2705
850d84f6
SH
27062017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
2707
2708 * config.bfd (*-*-rtemscoff*): Mark as removed.
2709
b531344c
MR
27102017-01-24 Maciej W. Rozycki <macro@imgtec.com>
2711
2712 PR ld/20828
2713 * elflink.c (bfd_elf_record_link_assignment): Revert last
2714 change and don't ever clear `forced_local'. Set `mark'
2715 unconditionally.
2716 (elf_gc_sweep_symbol_info, elf_gc_sweep_symbol): Reorder within
2717 file.
2718 (elf_gc_sweep): Move the call to `elf_gc_sweep_symbol'...
2719 (bfd_elf_size_dynamic_sections): ... here.
2720 * elf32-ppc.c (ppc_elf_tls_setup): Don't clear `forced_local'
2721 and set `mark' instead in `__tls_get_addr_opt' processing.
2722 * elf64-ppc.c (ppc64_elf_tls_setup): Likewise.
2723
f0158f44
AM
27242017-01-24 Alan Modra <amodra@gmail.com>
2725
2726 * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Merge two cases
2727 where dynamic relocs are preferable. Allow ifunc too.
2728 (ensure_undefweak_dynamic): New function.
2729 (allocate_dynrelocs): Use it here. Move plt handling last and
2730 don't make symbols dynamic, simplifying loop. Only make undef
2731 weak symbols with GOT entries dynamic. Correct condition
2732 for GOT relocs. Handle dynamic relocs on ifuncs. Correct
2733 comments. Remove goto.
2734 (ppc_elf_relocate_section): Correct test for using dynamic
2735 symbol on GOT relocs. Rearrange test for emitting GOT relocs
2736 to suit. Set up explicit tls_index entries and implicit GOT
2737 tls_index entries resolvable at link time for
2738 __tls_get_addr_opt. Simplify test to clear mem for prelink.
2739 * elf64-ppc.c (allocate_got): Correct condition for GOT relocs.
2740 (ensure_undefweak_dynamic): New function.
2741 (allocate_dynrelocs): Use it here. Only make undef weak symbols
2742 with GOT entries dynamic. Remove unnecessary test of
2743 WILL_CALL_FINISH_DYNAMIC_SYMBOL in PLT handling.
2744 (ppc64_elf_relocate_section): Correct test for using dynamic
2745 symbol on GOT relocs. Rearrange test for emitting GOT relocs
2746 to suit. Set up explicit tls_index entries and implicit GOT
2747 tls_index entries resolvable at link time for __tls_get_addr_opt.
2748 Simplify expression to clear mem for prelink.
2749
2d0ca824
YN
27502017-01-23 Yury Norov <ynorov@caviumnetworks.com>
2751
2752 * elfnn-aarch64.c: Fix relaxations for ILP32 mode.
2753
7f784814
JW
27542017-01-20 Jiong Wang <jiong.wang@arm.com>
2755
2756 * elfnn-aarch64.c (elf_aarch64_hash_symbol): New function.
2757 (elf_backend_hash_symbol): Define.
2758
81ff47b3
MR
27592017-01-18 Maciej W. Rozycki <macro@imgtec.com>
2760
2761 PR ld/20828
2762 * elflink.c (bfd_elf_record_link_assignment): Clear any
2763 `forced_local' marking for DSO symbols that are not being
2764 provided.
2765
640d6bfd
KLC
27662017-01-17 Kuan-Lin Chen <kuanlinchentw@gmail.com>
2767
2768 * elfnn-riscv.c (riscv_elf_object_p): New function.
2769
8361ed4d
L
27702017-01-12 H.J. Lu <hongjiu.lu@intel.com>
2771
2772 PR ld/21038
2773 * elf64-x86-64.c (elf_x86_64_link_hash_table): Add
2774 plt_bnd_eh_frame.
2775 (elf_x86_64_check_relocs): Create .eh_frame section for the
2776 .plt.bnd section.
2777 (elf_x86_64_size_dynamic_sections): Allocate and initialize
2778 .eh_frame section for the .plt.bnd section.
2779 (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
2780 for the .plt.bnd section.
2781
2425a30e
NC
27822017-01-12 Nick Clifton <nickc@redhat.com>
2783
2784 PR binutils/20876
2785 * opncls.c (find_separate_debug_file): Add include_dirs
2786 parameter. Only include the directory part of the bfd's filename
2787 in search paths if include_dirs is true. Add a couple of extra
2788 locations for looking for debug files.
2789 ( bfd_follow_gnu_debuglink): Update invocation of
2790 find_separate_debug_file.
2791 (bfd_follow_gnu_debugaltlink): Likewise.
2792 (get_build_id): New function: Finds the build-id of the given bfd.
2793 (get_build_id_name): New function: Computes the name of the
2794 separate debug info file for a bfd, based upon its build-id.
2795 (check_build_id_file): New function: Checks to see if a separate
2796 debug info file exists at the given location, and that its
2797 build-id matches that of the original bfd.
2798 (bfd_follow_build_id_debuglink): New function: Finds a separate
2799 debug info file for a given bfd by using the build-id method.
2800 * dwarf2.c (_bfd_dwarf2_slurp_debug_info): Try using the build-id
2801 method of locating a separate debug info file before using the
2802 debuglink method.
2803 * bfd-in2.h: Regenerate.
2804
9e659176
L
28052017-01-11 H.J. Lu <hongjiu.lu@intel.com>
2806
2807 PR ld/21038
2808 * elf64-x86-64.c (elf_x86_64_eh_frame_bnd_plt): New.
2809 (elf_x86_64_bnd_arch_bed): Use elf_x86_64_eh_frame_bnd_plt and
2810 elf_x86_64_eh_frame_plt_got.
2811 (elf_x86_64_size_dynamic_sections): Get unwind info from
2812 elf_x86_64_bnd_arch_bed for the BND PLT.
2813
f2e2d2f5
JS
28142017-01-11 Jeremy Soller <jackpot51@gmail.com>
2815
2816 * config.bfd: Add entries for i686-redox and x86_64-redox.
2817
52b232b3
L
28182017-01-10 H.J. Lu <hongjiu.lu@intel.com>
2819
2820 * elf32-i386.c (elf_i386_check_relocs): Align .eh_frame section
2821 to 4 bytes.
2822 * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Align
2823 .eh_frame section to 4 bytes for x32.
2824 (elf_x86_64_check_relocs): Likewise.
2825
fff53dae
L
28262017-01-10 H.J. Lu <hongjiu.lu@intel.com>
2827
2828 PR ld/20830
2829 * elf32-i386.c (elf_i386_eh_frame_plt_got): New.
2830 (PLT_GOT_FDE_LENGTH): Likewise.
2831 (elf_i386_plt_layout): Add eh_frame_plt_got and
2832 eh_frame_plt_got_size.
2833 (elf_i386_plt): Updated.
2834 (elf_i386_link_hash_table): Add plt_got_eh_frame.
2835 (elf_i386_check_relocs): Create .eh_frame section for .plt.got.
2836 (elf_i386_size_dynamic_sections): Allocate and initialize
2837 .eh_frame section for .plt.got.
2838 (elf_i386_finish_dynamic_sections): Adjust .eh_frame section for
2839 .plt.got.
2840 (elf_i386_nacl_plt): Add FIXME for eh_frame_plt_got and
2841 eh_frame_plt_got_size.
2842 * elf64-x86-64.c (elf_x86_64_eh_frame_plt_got): New.
2843 (PLT_GOT_FDE_LENGTH): Likewise.
2844 (elf_x86_64_backend_data): Add eh_frame_plt_got and
2845 eh_frame_plt_got_size.
2846 (elf_x86_64_arch_bed): Updated.
2847 (elf_x86_64_bnd_arch_bed): Add FIXME for eh_frame_plt_got and
2848 eh_frame_plt_got_size.
2849 (elf_x86_64_nacl_arch_bed): Likewise.
2850 (elf_x86_64_link_hash_table): Add plt_got_eh_frame.
2851 (elf_x86_64_check_relocs): Create .eh_frame section for .plt.got.
2852 (elf_x86_64_size_dynamic_sections): Allocate and initialize
2853 .eh_frame section for .plt.got.
2854 (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
2855 for .plt.got.
2856
f129e49f
L
28572017-01-10 H.J. Lu <hongjiu.lu@intel.com>
2858
2859 * elf32-i386.c (elf_i386_size_dynamic_sections): Set
2860 plt_eh_frame->size to eh_frame_plt_size and use eh_frame_plt.
2861
cd6581da
NC
28622017-01-09 Nick Clifton <nickc@redhat.com>
2863
2864 * dwarf2.c (lookup_address_in_function_table): Return early if
2865 there are no functions in the given comp unit, or if the high
2866 address of the last function in the comp unit is less than the
2867 desired address.
2868
98f02962
NC
28692017-01-09 Nick Clifton <nickc@redhat.com>
2870
2871 PR binutils/21013
2872 * coffgen.c (_bfd_coff_get_external_symbols): Generate an error
2873 message if there are too many symbols to load.
2874
ae4fda66
JC
28752017-01-04 James Clarke <jrtc27@jrtc27.com>
2876
2877 * elf64-alpha.c (elf64_alpha_relax_opt_call): Don't set tsec_free
2878 if relocs are cached.
2879
de1010f4
RF
28802017-01-03 Rich Felker <bugdal@aerifal.cx>
2881
2882 PR ld/21017
2883 * elf32-microblaze.c (microblaze_elf_check_relocs): Add an entry
2884 for R_MICROBLAZE_GOTOFF_64.
2885
09fe2662
NC
28862017-01-03 Nick Clifton <nickc@redhat.com>
2887
2888 * mach-o.c (bfd_mach_o_lookup_uuid_command): Fix compile time
2889 warning about using a possibly uninitialised variable.
2890
595e0a47
AM
28912017-01-02 Alan Modra <amodra@gmail.com>
2892
2893 * elf32-hppa.c (ensure_undef_weak_dynamic): New function.
2894 (allocate_plt_static, allocate_dynrelocs): Use it.
2895
7bd9df3b
AM
28962017-01-02 Alan Modra <amodra@gmail.com>
2897
2898 * elf-hppa.h (elf_hppa_fake_sections): Set SHF_INFO_LINK for
2899 .PARISC.unwind section.
2900
5b86074c
AM
29012017-01-02 Alan Modra <amodra@gmail.com>
2902
2903 PR ld/20989
2904 * elfxx-sparc.c (gdop_relative_offset_ok): New function.
2905 (_bfd_sparc_elf_relocate_section): Use it to validate GOT
2906 indirect to GOT pointer relative code edit.
2907
2571583a
AM
29082017-01-02 Alan Modra <amodra@gmail.com>
2909
2910 Update year range in copyright notice of all files.
2911
5c1ad6b5 2912For older changes see ChangeLog-2016
3499769a 2913\f
5c1ad6b5 2914Copyright (C) 2017 Free Software Foundation, Inc.
3499769a
AM
2915
2916Copying and distribution of this file, with or without modification,
2917are permitted in any medium without royalty provided the copyright
2918notice and this notice are preserved.
2919
2920Local Variables:
2921mode: change-log
2922left-margin: 8
2923fill-column: 74
2924version-control: never
2925End:
This page took 0.251154 seconds and 4 git commands to generate.