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