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