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