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