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