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