s390: Check UNDEFWEAK_NO_DYNAMIC_RELOC
[deliverable/binutils-gdb.git] / bfd / ChangeLog
CommitLineData
b27bb18f
L
12017-10-14 H.J. Lu <hongjiu.lu@intel.com>
2
3 PR ld/22269
4 * elf32-s390.c (allocate_dynrelocs): Discard dynamic
5 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
6 (elf_s390_relocate_section): Don't generate dynamic relocation
7 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
8 * elf64-s390.c (allocate_dynrelocs): Discard dynamic
9 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
10 (elf_s390_relocate_section): Don't generate dynamic relocation
11 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
12
31a53da5
L
132017-10-14 H.J. Lu <hongjiu.lu@intel.com>
14
15 PR ld/22269
16 * elf32-nios2.c (nios2_elf32_relocate_section): Don't generate
17 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
18 (allocate_dynrelocs): Discard dynamic relocations if
19 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
20
112fef40
L
212017-10-14 H.J. Lu <hongjiu.lu@intel.com>
22
23 PR ld/22269
24 * elf32-microblaze.c (microblaze_elf_relocate_section): Don't
25 generate dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is
26 true.
27 (allocate_dynrelocs): Discard dynamic relocations if
28 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
29
5056ba1d
L
302017-10-14 H.J. Lu <hongjiu.lu@intel.com>
31
32 PR ld/22269
33 * elf32-m68k.c (elf_m68k_check_relocs): Don't allocate dynamic
34 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
35 (elf_m68k_adjust_dynamic_symbol): Don't make symbol dynamic if
36 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
37 (elf_m68k_relocate_section): Don't generate dynamic relocation
38 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
39
60c1b909
L
402017-10-14 H.J. Lu <hongjiu.lu@intel.com>
41
42 PR ld/22269
43 * elf32-hppa.c (ensure_undef_dynamic): Don't make undefined
44 symbol dynamic if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
45 (allocate_dynrelocs): Discard dynamic relocations if
46 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
47 (elf32_hppa_relocate_section): Don't generate dynamic
48 relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
49
db41f6eb
L
502017-10-14 H.J. Lu <hongjiu.lu@intel.com>
51
52 PR ld/22269
53 * elfnn-ia64.c (elfNN_ia64_check_relocs): Don't allocate
54 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
55 (allocate_fptr): Don't allocate function pointer if
56 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
57 (allocate_dynrel_entries): Don't allocate dynamic relocation
58 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
59 (set_got_entry): Don't set GOT entry if
60 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
61 (set_pltoff_entry): Don't set PLTOFF entry if
62 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
63 (elfNN_ia64_relocate_section): Don't install dynamic relocation
64 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
65
ad951203
L
662017-10-14 H.J. Lu <hongjiu.lu@intel.com>
67
68 PR ld/22269
69 * elfxx-mips.c (mips_elf_calculate_relocation): Don't generate
70 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
71 (allocate_dynrelocs): Don't allocate dynamic relocations if
72 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
73
95b03e4a
L
742017-10-14 H.J. Lu <hongjiu.lu@intel.com>
75
76 PR ld/22269
77 * elf32-arm.c (elf32_arm_final_link_relocate): Don't generate
78 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
79 (allocate_dynrelocs_for_symbol): Discard dynamic relocations
80 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
81
a3cd202a
L
822017-10-14 H.J. Lu <hongjiu.lu@intel.com>
83
84 PR ld/22269
85 * elf32-tilepro.c (allocate_dynrelocs): Discard dynamic
86 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
87 (tilepro_elf_relocate_section): Don't generate dynamic
88 relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
89 * elfxx-tilegx.c (allocate_dynrelocs): Discard dynamic
90 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
91 (tilegx_elf_relocate_section): Don't generate dynamic
92 relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
93
ddb7fd0f
L
942017-10-14 H.J. Lu <hongjiu.lu@intel.com>
95
96 PR ld/22269
97 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Don't
98 generate dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is
99 true.
100 (elfNN_aarch64_allocate_dynrelocs): Discard dynamic relocations
101 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
102
62cd30f1
L
1032017-10-14 H.J. Lu <hongjiu.lu@intel.com>
104
105 * elf32-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Moved to ...
106 * elf-bfd.h (UNDEFWEAK_NO_DYNAMIC_RELOC): Here.
107 * elf64-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Removed.
108
3b4b0a62
JB
1092017-10-12 James Bowman <james.bowman@ftdichip.com>
110
111 * bfd-in2.h: Regenerate.
112 * libbfd.h: Regenerate.
113 * elf32-ft32.c: Add HOWTO R_FT32_15.
114 * reloc.c: Add BFD_RELOC_FT32_15.
115
1d75a8e2
NC
1162017-10-12 Nick Clifton <nickc@redhat.com>
117
118 * reloc.c (enum bfd_reloc_status): Start values at 2.
119 * bfd-in2.h: Regenerate.
120 * elfnn-aarch64.c (aarch64_relocate): Invert sense of function, so
121 that a TRUE return indicates success. Compare the result of
122 calling _bfd_aarch64_elf_put_addend against bfd_reloc_ok.
123 (build_one_stub): Change sense of tests against aarch64_relocate
124 return value.
125 (elfNN_aarch64_tls_relax): Return bfd_reloc_notsupported, rather
126 than FALSE, when an error is detected.
127 (elfNN_aarch64_final_link_relocate): Likewise.
128
9f857535
L
1292017-10-12 H.J. Lu <hongjiu.lu@intel.com>
130
131 * elf32-i386.c (elf_backend_hide_symbol): New.
132 * elf64-x86-64.c (elf_backend_hide_symbol): Likewise.
133 * elfxx-x86.c (_bfd_x86_elf_hide_symbol): Likewise.
134 * elfxx-x86.h (_bfd_x86_elf_hide_symbol): Likewise.
135
559192d8
AM
1362017-10-12 Alan Modra <amodra@gmail.com>
137
138 * elflink.c (_bfd_elf_adjust_dynamic_symbol): Call
139 elf_backend_hide_symbol, not _bfd_elf_link_hash_hide_symbol.
140 (bfd_elf_define_start_stop): Likewise.
141
f5233a16
AM
1422017-10-12 Alan Modra <amodra@gmail.com>
143
144 * elf32-nds32.c (nds32_elf_size_dynamic_sections): Set .interp
145 when executable rather than non-PIC.
146 * elf32-score.c (s3_bfd_score_elf_size_dynamic_sections): Likewise.
147 * elf32-score7.c (s7_bfd_score_elf_size_dynamic_sections): Likewise.
148
3c9a7b0d
MR
1492017-10-11 Maciej W. Rozycki <macro@imgtec.com>
150
151 * elf-bfd.h (elf_backend_data): Add `linux_prpsinfo64_ugid16'
152 member.
153 * elf-linux-core.h (elf_external_linux_prpsinfo64): Rename to...
154 (elf_external_linux_prpsinfo64_ugid32): ... this.
155 (swap_linux_prpsinfo32_out): Rename to...
156 (swap_linux_prpsinfo32_ugid32_out): ... this.
157 (elf_external_linux_prpsinfo64_ugid16): New structure.
158 (swap_linux_prpsinfo64_ugid16_out): New function.
159 * elfxx-target.h [!elf_backend_linux_prpsinfo64_ugid16]
160 (elf_backend_linux_prpsinfo64_ugid16): Define.
161 (elfNN_bed): Initialize `linux_prpsinfo64_ugid16' member.
162 * elf.c (elfcore_write_linux_prpsinfo64): Handle both variants
163 of the 64-bit Linux core PRPSINFO note.
164 * elf64-sh64.c (elf_backend_linux_prpsinfo64_ugid16): Define.
165
a2f63b2e
MR
1662017-10-11 Maciej W. Rozycki <macro@imgtec.com>
167
168 * elf-bfd.h (elf_backend_data): Add `linux_prpsinfo32_ugid16'
169 member.
170 (elfcore_write_ppc_linux_prpsinfo32): Remove prototype.
171 * elf32-ppc.c (elfcore_write_ppc_linux_prpsinfo32): Remove.
172 (elf_external_ppc_linux_prpsinfo32)
173 (swap_ppc_linux_prpsinfo32_out): Move to...
174 * elf-linux-core.h (elf_external_linux_prpsinfo32_ugid32)
175 (swap_linux_prpsinfo32_ugid32_out): ... these.
176 (elf_external_linux_prpsinfo32): Rename to...
177 (elf_external_linux_prpsinfo32_ugid16): ... this.
178 (swap_linux_prpsinfo32_out): Rename to...
179 (swap_linux_prpsinfo32_ugid16_out): ... this.
180 * elfxx-target.h [!elf_backend_linux_prpsinfo32_ugid16]
181 (elf_backend_linux_prpsinfo32_ugid16): Define.
182 (elfNN_bed): Initialize `linux_prpsinfo32_ugid16' member.
183 * elf.c (elfcore_write_linux_prpsinfo32): Handle both variants
184 of the 32-bit Linux core PRPSINFO note.
185 * elf32-am33lin.c (elf_backend_linux_prpsinfo32_ugid16): Define.
186 * elf32-arm.c (elf_backend_linux_prpsinfo32_ugid16): Define.
187 * elf32-cris.c (elf_backend_linux_prpsinfo32_ugid16): Define.
188 * elf32-frv.c (elf_backend_linux_prpsinfo32_ugid16): Define.
189 * elf32-i386.c (elf_backend_linux_prpsinfo32_ugid16): Define.
190 * elf32-m32r.c (elf_backend_linux_prpsinfo32_ugid16): Define.
191 * elf32-m68k.c (elf_backend_linux_prpsinfo32_ugid16): Define.
192 * elf32-s390.c (elf_backend_linux_prpsinfo32_ugid16): Define.
193 * elf32-sh.c (elf_backend_linux_prpsinfo32_ugid16): Define.
194 * elf32-sparc.c (elf_backend_linux_prpsinfo32_ugid16): Define.
195
72bc1bb9
MR
1962017-10-11 Maciej W. Rozycki <macro@imgtec.com>
197
198 * elf-linux-core.h (elf_external_linux_prpsinfo64): Move the
199 `gap' member ahead of `pr_flag'.
200
8f314ad5
PA
2012017-10-11 Pedro Alves <palves@redhat.com>
202
203 * bfd.c (_doprnt): Rename to ...
204 (_bfd_doprnt): ... this.
205 (error_handler_internal): Adjust.
206
0f09b4d8
L
2072017-10-10 H.J. Lu <hongjiu.lu@intel.com>
208
209 * elf32-i386.c (elf_i386_check_relocs): Set GOT refcount to 1
210 instead of incrementing it.
211 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
212
6c699715
RL
2132017-10-10 Renlin Li <renlin.li@arm.com>
214
215 PR ld/21402
216 * elf32-arm.c (allocate_dynrelocs_for_symbol): Only make undefined weak
217 symbols into dynamic.
218
fc3c5343
L
2192017-10-09 H.J. Lu <hongjiu.lu@intel.com>
220
221 PR ld/22274
222 * elfnn-riscv.c (riscv_elf_link_hash_table): Add max_alignment.
223 (riscv_elf_link_hash_table_create): Initialize max_alignment to
224 (bfd_vma) -1.
225 (_bfd_riscv_relax_section): Cache the max alignment of output
226 sections if possible.
227
b9399fcf
AM
2282017-10-10 Alan Modra <amodra@gmail.com>
229
230 * elf64-ppc.c (ppc64_elf_before_check_relocs): Set sec_type for
231 .opd whenever .opd is present and non-zero size. Move code
232 setting abiversion to/from output file earlier. Only set
233 u.opd.func_sec when --gc-sections. Read relocs and set up
234 u.opd.func_sec values here..
235 (ppc64_elf_check_relocs): ..rather than here. Simplify opd
236 section tests.
237 (ppc64_elf_edit_opd): Don't set sec_type for .opd here.
238
478c006f
L
2392017-10-09 H.J. Lu <hongjiu.lu@intel.com>
240
241 * elf-m10300.c (mn10300_elf_check_relocs): Don't free cached
242 isymbuf.
243
9d45a7de
L
2442017-10-09 H.J. Lu <hongjiu.lu@intel.com>
245
246 * elf32-bfin.c (bfin_size_dynamic_sections): Don't create the
247 .interp section with "ld --no-dynamic-linker".
248
b55ec8b6
AM
2492017-10-09 Alan Modra <amodra@gmail.com>
250
251 PR 22212
252 * dwarf2.c (_bfd_dwarf2_cleanup_debug_info): Free
253 funcinfo_hash_table and varinfo_hash_table.
254
a72f95f7
L
2552017-10-08 H.J. Lu <hongjiu.lu@intel.com>
256
257 * elf32-sh.c (readonly_dynrelocs): Dump dynamic relocation
258 in read-only section with minfo.
259 (sh_elf_size_dynamic_sections): Likewise.
260
f9799aae
L
2612017-10-08 H.J. Lu <hongjiu.lu@intel.com>
262
263 * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections): Remove
264 a strayed comment.
265
4c7236d3
L
2662017-10-08 H.J. Lu <hongjiu.lu@intel.com>
267
268 * elfxx-tilegx.c (tilegx_elf_finish_dynamic_sections): Set
269 this_hdr.sh_entsize only if section size > 0.
270
70090aa5
L
2712017-10-08 H.J. Lu <hongjiu.lu@intel.com>
272
273 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Reformat.
274
f0f07ad1
L
2752017-10-07 H.J. Lu <hongjiu.lu@intel.com>
276
277 * elfxx-sparc.c (readonly_dynrelocs): Dump dynamic relocation
278 in read-only section with minfo.
279 (_bfd_sparc_elf_size_dynamic_sections): Likewise.
280
99180bcc
L
2812017-10-06 H.J. Lu <hongjiu.lu@intel.com>
282
283 * elfxx-x86.h (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Update
284 comments.
285
544c67cd
JB
2862017-10-06 John Baldwin <jhb@FreeBSD.org>
287
288 * elf-bfd.h (struct elf_backend_data): Add
289 `elf_backend_grok_freebsd_prstatus'.
290 * elf.c (elfcore_grok_freebsd_note): Call
291 `elf_backend_grok_freebsd_prstatus' to handle NT_PRSTATUS if
292 present.
293 * elfn32-mips.c (elf_n32_mips_grok_freebsd_prstatus): New
294 function.
295 (elf_backend_grok_freebsd_prstatus): Define.
296 * elfxx-target.h (elf_backend_grok_freebsd_prstatus): Define.
297 (elfNN_bed): Initialize `elf_backend_grok_freebsd_prstatus'.
298
98b273dc
L
2992017-10-06 H.J. Lu <hongjiu.lu@intel.com>
300
301 * elf32-i386.c (elf_i386_check_relocs): Replace has_got_reloc
302 and has_non_got_reloc with zero_undefweak.
303 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
304 * elfxx-x86.c (_bfd_x86_elf_link_hash_newfunc): Initialize
305 zero_undefweak to 1.
306 (_bfd_x86_elf_copy_indirect_symbol): Replace has_got_reloc and
307 has_non_got_reloc with zero_undefweak.
308 * elfxx-x86.h (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Replace
309 has_got_reloc and has_non_got_reloc with zero_undefweak.
310 (elf_x86_link_hash_entry): Likewise.
311
e0d8f431
L
3122017-10-06 H.J. Lu <hongjiu.lu@intel.com>
313
314 * elfxx-x86.h (COPY_INPUT_RELOC_P): Add "do/while(0);".
315 (VERIFY_COPY_RELOC): Likewise.
316
ff38b4cc
L
3172017-10-06 H.J. Lu <hongjiu.lu@intel.com>
318
319 * elfxx-x86.h (VERIFY_COPY_RELOC): New.
320 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Use it.
321 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
322
f3180fa9
L
3232017-10-06 H.J. Lu <hongjiu.lu@intel.com>
324
325 * elfxx-x86.h (VERIFY_PLT_ENTRY): New.
326 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Use it.
327 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
328
e74399c4
L
3292017-10-06 H.J. Lu <hongjiu.lu@intel.com>
330
331 * elfxx-x86.h (COPY_INPUT_RELOC_P): New.
332 * elf32-i386.c (elf_i386_relocate_section): Use it.
333 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
334
aebcc8ff
L
3352017-10-06 H.J. Lu <hongjiu.lu@intel.com>
336
337 * elf32-i386.c (X86_SIZE_TYPE_P): New.
338 (elf_i386_relocate_section): Use GENERATE_DYNAMIC_RELOCATION_P.
339 * elf64-x86-64.c (X86_SIZE_TYPE_P): New.
340 (elf_x86_64_relocate_section): Use GENERATE_DYNAMIC_RELOCATION_P.
341 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): New.
342
cf1070f1
L
3432017-10-06 H.J. Lu <hongjiu.lu@intel.com>
344
345 * elfxx-x86.h (POINTER_LOCAL_IFUNC_P): New.
346 (PLT_LOCAL_IFUNC_P): Likewise.
347 * elf32-i386.c (elf_i386_relocate_section): Use them.
348 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
349
f70656b2
L
3502017-10-06 H.J. Lu <hongjiu.lu@intel.com>
351
352 * elfxx-x86.h (GENERATE_RELATIVE_RELOC_P): New.
353 * elf32-i386.c (elf_i386_relocate_section): Use it.
354 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
355
1f92404c
L
3562017-10-06 H.J. Lu <hongjiu.lu@intel.com>
357
358 * elfxx-x86.h (RESOLVED_LOCALLY_P): New.
359 * elf32-i386.c (elf_i386_relocate_section): Use it.
360 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
361
daf1c414
L
3622017-10-06 H.J. Lu <hongjiu.lu@intel.com>
363
364 * elf32-i386.c (X86_PCREL_TYPE_P): New.
365 (elf_i386_check_relocs): Use NEED_DYNAMIC_RELOCATION_P.
366 * elf64-x86-64.c (IS_X86_64_PCREL_TYPE): Renamed to ...
367 (X86_PCREL_TYPE_P): This.
368 (elf_x86_64_check_relocs): Use NEED_DYNAMIC_RELOCATION_P.
369 Replace IS_X86_64_PCREL_TYPE with X86_PCREL_TYPE_P.
370 (elf_x86_64_relocate_section): Replace IS_X86_64_PCREL_TYPE with
371 X86_PCREL_TYPE_P.
372 * elfxx-x86.h (NEED_DYNAMIC_RELOCATION_P): New.
373
51537393
L
3742017-10-06 H.J. Lu <hongjiu.lu@intel.com>
375
376 * elfxx-x86.h (TLS_TRANSITION_IE_TO_LE_P): New.
377 * elf32-i386.c (elf_i386_tls_transition): Use it.
378 * elf64-x86-64.c (elf_x86_64_tls_transition): Likewise.
379
0caf6c82
L
3802017-10-05 H.J. Lu <hongjiu.lu@intel.com>
381
382 * elf32-ppc.c (readonly_dynrelocs): Add a link_info argument.
383 Dump dynamic relocation in read-only section with minfo if
384 needed.
385 (ppc_elf_adjust_dynamic_symbol): Pass NULL to readonly_dynrelocs.
386 (maybe_set_textrel): Likewise.
387 (ppc_elf_size_dynamic_sections): Dump dynamic relocation in
388 read-only section with minfo.
389
6d5be5d6
JB
3902017-10-05 John Baldwin <jhb@FreeBSD.org>
391
392 * elf.c (elfcore_grok_freebsd_note): Handle NT_ARM_VFP.
393
007873f5
L
3942017-10-05 H.J. Lu <hongjiu.lu@intel.com>
395
396 * elf32-tilepro.c (readonly_dynrelocs): Dump dynamic relocation
397 in read-only section with minfo.
398 (tilepro_elf_size_dynamic_sections): Likewise.
399 * elfxx-tilegx.c (readonly_dynrelocs): Likewise.
400 (tilegx_elf_size_dynamic_sections): Likewise.
401
2ca7de37
PA
4022017-10-05 Pedro Alves <palves@redhat.com>
403
404 PR 22245
405 * bfd.c (bfd_set_error): Revert 2017-10-04 change. Remove
406 ellipsis parameter. Split out bfd_error_on_input code to..
407 (bfd_set_input_error): .. New function.
408 * archive.c (_bfd_write_archive_contents): Use bfd_set_input_error.
409 * vms-lib.c (_bfd_vms_lib_write_archive_contents): Likewise.
410 * bfd-in2.h: Regenerate.
411
8c6716e5
AM
4122017-10-05 Alan Modra <amodra@gmail.com>
413
414 * elflink.c (elf_link_input_bfd): Correct ctor/dtor in init_array/
415 fini_array error value.
416
db4677b8
AM
4172017-10-05 Alan Modra <amodra@gmail.com>
418
419 PR 21167
420 * elf.c (_bfd_elf_setup_sections): Don't trim reloc sections from
421 groups.
422 (_bfd_elf_init_reloc_shdr): Pass sec_hdr, use it to copy SHF_GROUP
423 flag from section.
424 (elf_fake_sections): Adjust calls. Exit immediately on failure.
425 (bfd_elf_set_group_contents): Add associated reloc section indices
426 to group contents.
427
a5259595
AM
4282017-10-04 Alan Modra <amodra@gmail.com>
429
430 * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Don't sort or
431 classify symbols for ELFv2.
432
9ba5f27c
PK
4332017-10-04 Pavel I. Kryukov <kryukov@frtk.ru>
434
435 PR 22245
436 * bfd.c (bfd_set_error): Avoid UB on passing arg to va_start that
437 undergoes default promotion.
438 * bfd-in2.h: Regenerate.
439
dcd2b8a0
AM
4402017-10-02 Alan Modra <amodra@gmail.com>
441
442 * elf32-ppc.c (ppc_elf_relocate_section): Fix comment typo.
443 * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
444
20230942
AM
4452017-10-01 Alan Modra <amodra@gmail.com>
446
447 PR 21957
448 * dwarf2.c (new_line_sorts_after): Remove end_sequence comparison.
449 (add_line_info): Always put end_sequence last.
450
4b04bba2
AM
4512017-10-01 Alan Modra <amodra@gmail.com>
452
453 PR 22047
454 * dwarf2.c (read_section): Allocate buffer with extra byte for
455 bfd_simple_get_relocated_section_contents rather than copying
456 afterwards.
457
f6ac8c52
AM
4582017-09-29 Alan Modra <amodra@gmail.com>
459
460 * merge.c (merge_strings): Return FALSE on malloc failure.
461 (_bfd_merge_sections): Return failures from record_section and
462 merge_strings.
463
1a3b5c34
AM
4642017-09-28 Alan Modra <amodra@gmail.com>
465
466 PR 22220
467 * elflink.c (_bfd_elf_merge_symbol): Set non_ir_ref_dynamic in
468 a case where plugin_notice isn't called.
469
cd28e7aa
KLC
4702017-09-27 Kuan-Lin Chen <kuanlinchentw@gmail.com>
471
472 * elf32-nds32.c (nds32_elf_relax_section): Fix a tautological
473 comparison.
474
ac69a0d7
L
4752017-09-26 H.J. Lu <hongjiu.lu@intel.com>
476
477 PR ld/22199
478 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Don't pass
479 output_bfd to info->callbacks->minfo.
480
262c0a87
NC
4812017-09-26 Nick Clifton <nickc@redhat.com>
482
483 PR 22172
484 * elf64-x86-64.c (elf_x86_64_info_to_howto): Do not trigger an
485 assertion failure if elf_x86_64_rtype_to_howto has already issued
486 an error message.
487
33e0a9a0
AM
4882017-09-26 Alan Modra <amodra@gmail.com>
489
490 PR 22210
491 * dwarf2.c (read_formatted_entries): Use read_attribute_value to
492 read data.
493
30d0157a
NC
4942017-09-26 Nick Clifton <nickc@redhat.com>
495
496 PR 22210
497 * dwarf2.c (read_formatted_entries): Fail early if we know that
498 the loop parsing data entries will overflow the end of the
499 section.
500
1b86808a
AM
5012017-09-26 Alan Modra <amodra@gmail.com>
502
503 PR 22209
504 * dwarf2.c (struct comp_unit): Delete sec_info_ptr field.
505 (find_abstract_instance_name): Calculate DW_FORM_ref_addr relative
506 to stash->info_ptr_memory, and check die_ref is within that memory.
507 Set info_ptr_end correctly when another CU is refd. Check die_ref
508 for DW_FORM_ref4 etc. is within CU.
509
a54018b7
AM
5102017-09-26 Alan Modra <amodra@gmail.com>
511
512 PR 22205
513 * dwarf2.c (concat_filename): Return "<unknown>" on NULL filename.
514 (read_formatted_entries): Init "fe".
515 (decode_line_info <DW_LNE_define_file>): Use line_info_add_file_name.
516
e338894d
AM
5172017-09-26 Alan Modra <amodra@gmail.com>
518
519 PR 22204
520 * dwarf2.c (decode_line_info): Ensure line_ptr stays within
521 bounds in inner loop.
522
1da5c9a4
AM
5232017-09-25 Alan Modra <amodra@gmail.com>
524
525 PR 22202
526 * dwarf1.c (parse_die): Sanity check pointer against section limit
527 before dereferencing.
528 (parse_line_table): Likewise.
529
11855d8a
AM
5302017-09-25 Alan Modra <amodra@gmail.com>
531
532 PR 22201
533 * dwarf2.c (scan_unit_for_symbols): Ignore DW_AT_name unless it
534 has string form.
535 (parse_comp_unit): Likewise.
536
c361faae
AM
5372017-09-25 Alan Modra <amodra@gmail.com>
538
539 PR 22200
540 * dwarf2.c (read_formatted_entries): Error on format_count zero.
541
52b36c51
AM
5422017-09-24 Alan Modra <amodra@gmail.com>
543
544 PR 22197
545 * opncls.c (bfd_get_debug_link_info_1): Properly check that crc is
546 within section bounds.
547
a26a013f
AM
5482017-09-24 Alan Modra <amodra@gmail.com>
549
550 PR 22191
551 * dwarf2.c (decode_line_info): Properly free line sequences on error.
552
52a93b95
AM
5532017-09-24 Alan Modra <amodra@gmail.com>
554
555 PR 22187
556 * dwarf2.c (find_abstract_instance_name): Add orig_info_ptr and
557 pname param. Return status. Make name const. Don't abort,
558 return an error. Formatting. Exit if current info_ptr matches
559 orig_info_ptr. Update callers.
560 (scan_unit_for_symbols): Start at nesting_level of zero. Make
561 nested_funcs an array of structs for extensibility. Formatting.
562
d8010d3e
AM
5632017-09-24 Alan Modra <amodra@gmail.com>
564
565 PR 22186
566 * dwarf2.c (decode_line_info): Fail on lh.line_range of zero
567 rather than dividing by zero.
568
515f23e6
AM
5692017-09-24 Alan Modra <amodra@gmail.com>
570
571 PR 22169
572 * dwarf2.c (decode_line_info): Correct .debug_line unit_length check.
573
0d76029f
AM
5742017-09-24 Alan Modra <amodra@gmail.com>
575
576 PR 22167
577 * dwarf2.c (scan_unit_for_symbols): Check u.blk->data is non-NULL.
578
bd61e135
AM
5792017-09-24 Alan Modra <amodra@gmail.com>
580
581 PR 22166
582 * elf.c (_bfd_elf_slurp_version_tables): Test sh_info on
583 SHT_GNU_verneed section for sanity. Don't zalloc memory for
584 verref.
585
61e3bf5f
L
5862017-09-22 H.J. Lu <hongjiu.lu@intel.com>
587
588 PR binutils/22170
589 * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Guard against
590 corrupted PLT.
591
b69e9267
L
5922017-09-22 H.J. Lu <hongjiu.lu@intel.com>
593
59ca4c1b 594 PR binutils/22163
b69e9267
L
595 * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Also return
596 -1 if bfd_canonicalize_dynamic_reloc returns 0.
597
b877d21f
PA
5982017-09-22 Pedro Alves <palves@redhat.com>
599 Alan Modra <amodra@gmail.com>
600
601 * version.h: Add comment.
602
8fe09d74
AA
6032017-09-21 Andreas Arnez <arnez@linux.vnet.ibm.com>
604
605 * elf.c (elfcore_grok_note): For the cases NT_S390_GS_CB and
606 NT_S390_GS_BC, correct the previously swapped invocations of
607 elfcore_grok_s390_gs_bc and elfcore_grok_s390_gs_cb.
608
25516cc5
AM
6092017-09-19 Alan Modra <amodra@gmail.com>
610
611 PR 21441
612 * elf64-ppc.c (ppc64_elf_build_stubs): Don't check glink_eh_frame
613 size.
614
3d13f3e9
AM
6152017-09-19 Alan Modra <amodra@gmail.com>
616
617 PR 22150
618 * elflink.c (bfd_elf_size_dynamic_sections): Garbage collect
619 symbols before calculating verrefs. Don't renumber dynsyms
620 after gc. Exclude .gnu.version when zero or one dynsym.
621 Localize some vars and reindent.
622
94670f6c
L
6232017-09-18 H.J. Lu <hongjiu.lu@intel.com>
624
625 PR ld/22148
626 * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Check error
627 return from bfd_canonicalize_dynamic_reloc.
628
21d0a606
AM
6292017-09-15 Alan Modra <amodra@gmail.com>
630
631 PR 22116
632 * archive.c (bfd_ar_hdr_from_filesystem): Detect when status.st_size
633 overflows bfd_size_type.
634
5e5e02ae
L
6352017-09-14 H.J. Lu <hongjiu.lu@intel.com>
636
637 PR ld/22135
638 * elf32-i386.c (elf_i386_convert_load_reloc): Add an argument
639 to indicate if conversion is performed.
640 (elf_i386_check_relocs): Cache section contents and relocations
641 if conversion is performed.
642 * elf64-x86-64.c (elf_x86_64_check_relocs): Cache section
643 contents and relocations if conversion is performed.
644
4d465c68
NC
6452017-09-14 Nick Clifton <nickc@redhat.com>
646
647 PR binutils/22113
648 * peXXigen.c (pe_print_idata): Extend check for HintName vector
649 entries.
650
f47432d4
L
6512017-09-13 H.J. Lu <hongjiu.lu@intel.com>
652
653 * elfxx-x86.h: Fix a typo in comments.
654
4ec521f2
KLC
6552017-09-09 Kamil Rytarowski <n54@gmx.com>
656
657 * elf32-nds32.c: Rename __BIT() to N32_BIT().
658
2420fff6
AM
6592017-09-09 Alan Modra <amodra@gmail.com>
660
661 * elf64-ppp.c (plt_stub_pad): Handle positive and negative
662 plt_stub_align.
663
c5bce5c6
L
6642017-09-09 H.J. Lu <hongjiu.lu@intel.com>
665
666 * elf32-i386.c (elf_i386_relocate_section): Update usage of
667 UNDEFINED_WEAK_RESOLVED_TO_ZERO.
668 (elf_i386_finish_dynamic_symbol): Likewise.
669 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
670 (elf_x86_64_finish_dynamic_symbol): Likewise.
671 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Likewise.
672 (_bfd_x86_elf_fixup_symbol): Likewise.
673
8fbf0ba1
L
6742017-09-09 H.J. Lu <hongjiu.lu@intel.com>
675
676 * elfxx-x86.c (_bfd_x86_elf_link_symbol_references_local): Don't
677 check has_non_got_reloc.
678
0a27fed7
L
6792017-09-09 H.J. Lu <hongjiu.lu@intel.com>
680
681 PR ld/22115
682 * elf32-i386.c (elf_i386_convert_load_reloc): Check linker_def.
683 Don't use UNDEFINED_WEAK_RESOLVED_TO_ZERO.
684 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Check
685 linker_def. Don't use UNDEFINED_WEAK_RESOLVED_TO_ZERO.
686 * elfxx-x86.c (_bfd_x86_elf_link_check_relocs): Set local_ref
687 and linker_def on __ehdr_start if it is referenced and not
688 defined.
689 (_bfd_x86_elf_link_symbol_references_local): Also set local_ref
690 and return TRUE when building executable, if a symbol has
691 non-GOT/non-PLT relocations in text section or there is no
692 dynamic linker.
693 * elfxx-x86.h (elf_x86_link_hash_entry): Add linker_def.
694
c7df954f
L
6952017-09-08 H.J. Lu <hongjiu.lu@intel.com>
696
697 * elfxx-x86.h: Update comments.
698
1de031c8
L
6992017-09-08 H.J. Lu <hongjiu.lu@intel.com>
700
701 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Replace
702 elf_x86_plt_layout_table with elf_x86_init_table.
703 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties):
704 Likewise.
705 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties):
706 Likewise.
707 * elfxx-x86.h (elf_x86_plt_layout_table): Renamed to ...
708 (elf_x86_init_table): This.
709 (_bfd_x86_elf_link_setup_gnu_properties): Replace
710 elf_x86_plt_layout_table with elf_x86_init_table.
711
7a382c1c
L
7122017-09-07 H.J. Lu <hongjiu.lu@intel.com>
713
714 * configure.ac (bfd_backends): Don't add elf64-x86-64.lo nor
715 elf64.lo together with elfxx-x86.lo for 64-bit BFD.
716 * configure: Regenerated.
717 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Set r_info
718 and r_sym fields of plt_layout.
719 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties):
720 Likewise.
721 * elfxx-x86.c (elf_x86_64_is_reloc_section): Remove BFD64 check.
722 (_bfd_x86_elf_link_hash_table_create): Likewise. Don't set
723 r_info nor r_sym fields.
724 (_bfd_x86_elf_link_setup_gnu_properties): Set r_info and r_sym
725 fields of htab.
726 * elfxx-x86.h (elf_x86_plt_layout_table): Add r_info and r_sym.
727
9eb7b0ac
PD
7282017-09-07 Palmer Dabbelt <palmer@dabbelt.com>
729
730 * (_bfd_riscv_relax_align): Call bfd_set_error and
731 print an error message when unable to relax a .align directive.
732
b1308d2c
PD
7332017-09-07 Palmer Dabbelt <palmer@dabbelt.com>
734
735 * elfnn-riscv.c (riscv_zero_pcrel_hi_reloc): New function.
736 (riscv_record_pcrel_hi_reloc): Add absolute argument.
737 (riscv_elf_relocate_section): Call riscv_zero_pcrel_hi_reloc for
738 R_RISCV_PCREL_HI20 relocs, and pass the result to
739 riscv_record_pcrel_hi_reloc.
740
6999821f
L
7412017-09-07 H.J. Lu <hongjiu.lu@intel.com>
742
743 * elf32-i386.c (elf_i386_convert_load_reloc): Add an argument,
744 r_type_p. Remove the converted argument. Replace
745 SYMBOL_REFERENCES_LOCAL with SYMBOL_REFERENCES_LOCAL_P. Return
746 the new relocation type via r_type_p.
747 (elf_i386_relocate_section): Likewise.
748 (elf_i386_finish_dynamic_symbol): Likewise.
749 (need_convert_load): Removed.
750 (check_relocs_failed): Updated.
751 (elf_i386_check_relocs): Call elf_i386_convert_load_reloc,
752 instead of setting need_convert_load.
753 (_bfd_i386_elf_convert_load): Removed.
754 * elf64-x86-64.c (need_convert_load): Removed.
755 (check_relocs_failed): Updated.
756 (elf_x86_64_convert_load_reloc): Add an argument, r_type_p.
757 Replace SYMBOL_REFERENCES_LOCAL with SYMBOL_REFERENCES_LOCAL_P.
758 Return the new relocation type via r_type_p.
759 (elf_x86_64_check_relocs): Call elf_x86_64_convert_load_reloc,
760 instead of setting need_convert_load.
761 (elf_x86_64_check_relocs): Don't check PIC if relocation has
762 been converted.
763 (_bfd_x86_64_elf_convert_load): Removed.
764 (elf_x86_64_relocate_section): Replace SYMBOL_REFERENCES_LOCAL
765 with SYMBOL_REFERENCES_LOCAL_P.
766 (elf_x86_64_finish_dynamic_symbol): Likewise.
767 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Don't
768 set convert_load.
769 (_bfd_x86_elf_size_dynamic_sections): Don't call convert_load.
770 (_bfd_x86_elf_link_symbol_references_local): New function.
771 * elfxx-x86.h (SYMBOL_REFERENCES_LOCAL_P): New.
772 (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Replace elf.forced_local with
773 SYMBOL_REFERENCES_LOCAL_P.
774 (elf_x86_link_hash_entry): Add local_ref.
775 (elf_x86_link_hash_table): Remove convert_load.
776 (_bfd_i386_elf_convert_load): Removed.
777 (_bfd_x86_64_elf_convert_load): Likewise.
778 (_bfd_x86_elf_link_symbol_references_local): New.
779
78984959
L
7802017-09-06 H.J. Lu <hongjiu.lu@intel.com>
781
782 * elf64-x86-64.c (R_X86_64_converted_reloc_bit): New.
783 (elf_x86_64_info_to_howto): Get the real relocation type by
784 masking out R_X86_64_converted_reloc_bit.
785 (elf_x86_64_check_tls_transition): Get the real relocation type
786 by masking out R_X86_64_converted_reloc_bit.
787 (elf_x86_64_convert_load_reloc): Set R_X86_64_converted_reloc_bit
788 instead of setting converted_reloc.
789 (elf_x86_64_relocate_section): Check R_X86_64_converted_reloc_bit
790 instead of converted_reloc. Get the real relocation type by
791 masking out R_X86_64_converted_reloc_bit.
792 (elf_x86_64_link_setup_gnu_properties): Verify that the value of
793 R_X86_64_converted_reloc_bit is valid.
794 * elfxx-x86.h (converted_reloc): Removed.
795
419414ea
L
7962017-09-06 H.J. Lu <hongjiu.lu@intel.com>
797
798 * elf32-i386.c (elf_i386_relocate_section): Don't change r_type
799 when calling elf_i386_tls_transition. Don't use ELF32_R_TYPE
800 to get the relocation type again.
801 * elf64-x86-64.c (elf_x86_64_relocate_section): Don't change
802 r_type when calling elf_x86_64_tls_transition. Don't use
803 ELF32_R_TYPE to get the relocation type again.
804
dc089072
L
8052017-09-05 H.J. Lu <hongjiu.lu@intel.com>
806
807 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Properly set
808 converted_reloc.
809
8b43e456
L
8102017-09-05 H.J. Lu <hongjiu.lu@intel.com>
811
812 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Remove the sec
813 argument. Don't check relocation overflow. Avoid relocation
814 overflow if --no-relax is used. Set converted_reloc on symbol
815 if a GOTPCREL relocation is converted.
816 (elf_x86_64_relocate_section): Issue a fatal error and suggest
817 --no-relax if GOTPCREL relocation conversion leads to relocation
818 overflow.
819 * elfxx-x86.h (elf_x86_link_hash_entry): Add converted_reloc.
820
83eef883
AFB
8212017-09-05 Alexander Fedotov <alexander.fedotov@nxp.com>
822 Edmar Wienskoski <edmar.wienskoski@nxp.com
823
824 * elf32-ppc.c (ppc_elf_howto_raw): Add R_PPC_VLE_ADDR20.
825 (ppc_elf_check_relocs): Handle it.
826 (ppc_elf_vle_split20): New function.
827 (ppc_elf_relocate_section): Handle R_PPC_VLE_ADDR20.
828
0e30d991
L
8292017-09-03 H.J. Lu <hongjiu.lu@intel.com>
830
831 PR ld/22071
832 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Set tlsdesc_plt
833 for x86-64 if GOT_TLS_GDESC_P is true.
834
1cf58434
AM
8352017-09-03 Alan Modra <amodra@gmail.com>
836
837 PR 22067
838 * elfxx-x86.h (elf_x86_hash_table): Check is_elf_hash_table first.
839
f04bdfa7
L
8402017-09-02 H.J. Lu <hongjiu.lu@intel.com>
841
842 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
843 tls_get_addr for x86-64 in one place.
844
2ac3a7f5
L
8452017-09-02 H.J. Lu <hongjiu.lu@intel.com>
846
847 * configure.ac (bfd_backends): Add elf64-x86-64.lo together
848 with elfxx-x86.lo for 64-bit BFD.
849 * configure: Regenerated.
850
d47a8026
L
8512017-09-02 H.J. Lu <hongjiu.lu@intel.com>
852
853 * elf32-i386.c (elf_i386_convert_load): Renamed to ...
854 (_bfd_i386_elf_convert_load): This. Remove static.
855 (elf_i386_size_dynamic_sections): Removed.
856 (elf_backend_size_dynamic_sections): Likewise.
857 * elf64-x86-64.c (elf_x86_64_convert_load): Renamed to ...
858 (_bfd_x86_64_elf_convert_load): This. Remove static.
859 (elf_x86_64_size_dynamic_sections): Removed.
860 (elf_backend_size_dynamic_sections): Likewise.
861 * elfxx-x86.c (_bfd_x86_elf_allocate_dynrelocs): Renamed to ...
862 (elf_x86_allocate_dynrelocs): This. Make it static.
863 (_bfd_x86_elf_allocate_local_dynrelocs): Renamed to ...
864 (elf_x86_allocate_local_dynreloc): This. Make it static.
865 (elf_i386_is_reloc_section): New function.
866 (elf_x86_64_is_reloc_section): Likewise.
867 (_bfd_x86_elf_link_hash_table_create): Initialize convert_load,
868 is_reloc_section, dt_reloc, dt_reloc_sz and dt_reloc_ent.
869 Rearrange got_entry_size initialization.
870 (_bfd_x86_elf_size_dynamic_sections): New function.
871 * elfxx-x86.h (elf_x86_link_hash_table): Add convert_load,
872 is_reloc_section, dt_reloc, dt_reloc_sz and dt_reloc_ent.
873 (_bfd_i386_elf_convert_load): New.
874 (_bfd_x86_64_elf_convert_load): Likewise.
875 (_bfd_x86_elf_size_dynamic_sections): Likewise.
876 (elf_backend_size_dynamic_sections): Likewise.
877 (_bfd_x86_elf_allocate_dynrelocs): Removed.
878 (_bfd_x86_elf_allocate_local_dynrelocs): Likewise.
879
2926eb2c
L
8802017-09-02 H.J. Lu <hongjiu.lu@intel.com>
881
882 * elfxx-x86.h (elf_x86_link_hash_table): Rearrange fields and
883 update comments.
884
92c10f5f
L
8852017-09-02 H.J. Lu <hongjiu.lu@intel.com>
886
887 * elf32-i386.c (elf_i386_size_dynamic_sections): Set
888 sgotplt_jump_table_size with elf_x86_compute_jump_table_size.
889
aa595247
L
8902017-09-02 H.J. Lu <hongjiu.lu@intel.com>
891
892 * elf32-i386.c (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
893 PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Moved to ...
894 * elfxx-x86.h (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
895 PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Here.
896 * elf64-x86-64.c (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
897 PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Removed.
898
b9ce864c
L
8992017-09-02 H.J. Lu <hongjiu.lu@intel.com>
900
901 * elf32-i386.c (elf_i386_allocate_dynrelocs): Removed.
902 (elf_i386_allocate_local_dynrelocs): Likewise.
903 (elf_i386_size_dynamic_sections): Replace
904 elf_i386_allocate_dynrelocs/elf_i386_allocate_local_dynrelocs
905 with _bfd_x86_elf_allocate_dynrelocs and
906 _bfd_x86_elf_allocate_local_dynrelocs.
907 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Removed.
908 (elf_x86_64_allocate_local_dynrelocs): Likewise.
909 (elf_x86_64_size_dynamic_sections): Replace
910 elf_x86_64_allocate_dynrelocs/elf_x86_64_allocate_local_dynrelocs
911 with _bfd_x86_elf_allocate_dynrelocs and
912 _bfd_x86_elf_allocate_local_dynrelocs.
913 * elfxx-x86.c (_bfd_x86_elf_allocate_dynrelocs): New function.
914 (_bfd_x86_elf_allocate_local_dynrelocs): Likewise.
915 * elfxx-x86.h (_bfd_x86_elf_allocate_dynrelocs): New prototype.
916 (_bfd_x86_elf_allocate_local_dynrelocs): Likewise.
917
fe53b4a4
L
9182017-09-02 H.J. Lu <hongjiu.lu@intel.com>
919
920 * elf32-i386.c (is_i386_elf): Removed.
921 (elf_i386_check_relocs): Replace is_i386_elf with is_x86_elf.
922 (elf_i386_size_dynamic_sections): Likewise.
923 (elf_i386_relocate_section): Likewise.
924 * elf64-x86-64.c (is_x86_64_elf): Removed.
925 (elf_x86_64_check_relocs): Replace is_x86_64_elf with
926 is_x86_elf.
927 (elf_x86_64_size_dynamic_sections): Likewise.
928 (elf_x86_64_relocate_section): Likewise.
929 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
930 target_id.
931 * elfxx-x86.h (elf_x86_link_hash_table): Add target_id.
932 (is_x86_elf): New.
933
9ff114ca
L
9342017-09-02 H.J. Lu <hongjiu.lu@intel.com>
935
936 * elf32-i386.c (elf_i386_compute_jump_table_size): Removed.
937 (elf_i386_allocate_dynrelocs): Replace
938 elf_i386_compute_jump_table_size with
939 elf_x86_compute_jump_table_size.
940 (elf_i386_size_dynamic_sections): Likewise.
941 * elf64-x86-64.c (elf_x86_64_compute_jump_table_size): Removed.
942 (elf_x86_64_allocate_dynrelocs): Replace
943 elf_x86_64_compute_jump_table_size with
944 elf_x86_compute_jump_table_size.
945 (elf_x86_64_size_dynamic_sections): Likewise.
946 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
947 got_entry_size.
948 * elfxx-x86.h (elf_x86_link_hash_table): Add got_entry_size.
949 (elf_x86_compute_jump_table_size): New.
950
503294e7
L
9512017-09-02 H.J. Lu <hongjiu.lu@intel.com>
952
953 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
954 sizeof_reloc.
955 (_bfd_x86_elf_adjust_dynamic_symbol): Use sizeof_reloc.
956 * elfxx-x86.h (elf_x86_link_hash_table): Add sizeof_reloc.
957
9a742a90
L
9582017-09-02 H.J. Lu <hongjiu.lu@intel.com>
959
960 * elf32-i386.c (elf_i386_allocate_dynrelocs): Check VxWorks
961 with htab->is_vxworks.
962 (elf_i386_size_dynamic_sections): Likewise.
963 (elf_i386_relocate_section): Likewise.
964 (elf_i386_finish_dynamic_symbol): Likewise.
965 (elf_i386_finish_dynamic_sections): Likewise.
966
6b9553e2
L
9672017-09-02 H.J. Lu <hongjiu.lu@intel.com>
968
969 * elf32-i386.c (GOT_TLS_IE, GOT_TLS_IE_POS, GOT_TLS_IE_NEG,
970 GOT_TLS_IE_BOTH, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
971 GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Moved to ...
972 * elfxx-x86.h (GOT_TLS_IE, GOT_TLS_IE_POS, GOT_TLS_IE_NEG,
973 GOT_TLS_IE_BOTH, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
974 GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Here.
975 * elf64-x86-64.c (GOT_TLS_IE, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
976 GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Removed.
977
ad71ce8d
L
9782017-09-01 H.J. Lu <hongjiu.lu@intel.com>
979
980 PR ld/22064
981 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Check
982 ELF_COMMON_DEF_P for common symbols.
983
96d01d93
AM
9842017-09-02 Alan Modra <amodra@gmail.com>
985
986 * elf-eh-frame.c (offset_adjust): Avoid false positive gcc warning.
987 * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Likewise.
988 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Likewise.
989
4f501a24
L
9902017-09-01 H.J. Lu <hongjiu.lu@intel.com>
991
992 * elf32-i386.c (elf_i386_gc_mark_hook): Removed.
993 (elf_backend_gc_mark_hook): Likewise.
994 * elf64-x86-64.c (elf_x86_64_gc_mark_hook): Likewise.
995 (elf_backend_gc_mark_hook): Likewise.
996 * elfxx-x86.c (_bfd_x86_elf_gc_mark_hook): New function.
997 * elfxx-x86.h (_bfd_x86_elf_gc_mark_hook): New.
998 (elf_backend_gc_mark_hook): Likewise.
999
eeb2f20a
L
10002017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1001
1002 * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Removed.
1003 (elf_backend_adjust_dynamic_symbol): Likewise.
1004 * elf64-x86-64.c (elf_x86_64_adjust_dynamic_symbol): Likewise.
1005 (elf_backend_adjust_dynamic_symbol): Likewise.
1006 * elfxx-x86.c (_bfd_x86_elf_adjust_dynamic_symbol): New function.
1007 (_bfd_x86_elf_link_setup_gnu_properties): Copy is_vxworks.
1008 * elfxx-x86.h (elf_x86_link_hash_table): Add is_vxworks.
1009 (_bfd_x86_elf_adjust_dynamic_symbol): New.
1010 (elf_backend_adjust_dynamic_symbol): Likewise.
1011
c6295c22
L
10122017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1013
1014 * elfxx-x86.h (elf_x86_plt_layout_table): Fix a typo in
1015 comments.
1016
39946cc2
L
10172017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1018
1019 * elf32-i386.c (elf_i386_mkobject): Removed.
1020 (bfd_elf32_mkobject): Likewise.
1021 * elf64-x86-64.c (elf_x86_64_mkobject): Likewise.
1022 (bfd_elf64_mkobject): Likewise.
1023 (bfd_elf32_mkobject): Likewise.
1024 * elfxx-x86.c (_bfd_x86_elf_mkobject): New function.
18da07cd 1025 * elfxx-x86.h (_bfd_x86_elf_mkobject): New.
39946cc2
L
1026 (bfd_elf64_mkobject): Likewise.
1027 (bfd_elf32_mkobject): Likewise.
1028
a6798bab
L
10292017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1030
1031 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Updated.
1032 Call _bfd_x86_elf_link_setup_gnu_properties.
1033 * elf64-x86-64.c (elf_x86_lazy_plt_layout): Initialize
1034 pic_plt0_entry and pic_plt_entry fields with the non-PIC PLT
1035 entries.
1036 (elf_x86_64_non_lazy_plt): Likewise.
1037 (elf_x86_64_lazy_bnd_plt): Likewise.
1038 (elf_x86_64_non_lazy_bnd_plt): Likewise.
1039 (elf_x86_64_lazy_ibt_plt): Likewise.
1040 (elf_x32_lazy_ibt_plt): Likewise.
1041 (elf_x86_64_non_lazy_ibt_plt): Likewise.
1042 (elf_x32_non_lazy_ibt_plt): Likewise.
1043 (elf_x86_64_nacl_plt): Likewise.
1044 (elf_x86_64_link_setup_gnu_properties): Updated. Call
1045 _bfd_x86_elf_link_setup_gnu_properties.
1046 * elfxx-x86.c: Include elf-vxworks.h".
1047 (_bfd_x86_elf_link_setup_gnu_properties): New function.
1048 * elfxx-x86.h (elf_x86_lazy_plt_layout): Remove "for i386 only"
1049 comments for pic_plt0_entry and pic_plt_entry.
1050 (elf_x86_non_lazy_plt_layout): Likewise.
1051 (elf_x86_plt_layout_table): New.
1052 (_bfd_x86_elf_link_setup_gnu_properties): Likewise.
1053
e10c9c62
L
10542017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1055
1056 PR ld/22061
1057 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Create
1058 .eh_frame section for the second PLT.
1059 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Correct
1060 alignment of .eh_frame section for the second PLT.
1061
7e8b6008
NC
10622017-09-01 Nick Clifton <nickc@redhat.com>
1063
1064 PR 22059
1065 * dwarf2.c (decode_line_info): Fix test for an overlong line info
1066 structure.
1067
2a143b99
NC
10682017-09-01 Nick Clifton <nickc@redhat.com>
1069
1070 PR 22058
1071 * elf-attrs.c (_bfd_elf_parse_attributes): Ensure that the
1072 attribute buffer is NUL terminated.
1073
e4f27230
NC
10742017-08-31 Nick Clifton <nickc@redhat.com>
1075
1076 PR 22047
1077 * dwarf2.c (read_section): If necessary add a terminating NUL byte
1078 to dwarf string sections.
1079
686335cd
AM
10802017-08-31 Alan Modra <amodra@gmail.com>
1081
1082 * po/SRC-POTFILES.in: Regenerate.
1083
9866ffe2
AM
10842017-08-31 Alan Modra <amodra@gmail.com>
1085
1086 * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Don't exit early
1087 for a section containing just a terminator. Allow multiple
1088 terminators at end of section.
1089 * elflink.c (bfd_elf_discard_info): Iterate over .eh_frame
1090 sections when not adding alignment. Assert on terminator in
1091 the middle of FDEs.
1092
af471f82
AM
10932017-08-31 Alan Modra <amodra@gmail.com>
1094
1095 PR 21441
1096 PR 22048
1097 * elflink.c (bfd_elf_discard_info): Don't pad embedded zero
1098 terminators.
1099
3321e42b
L
11002017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1101
1102 * configure.ac (bfd_backends): Add elf64.lo together with
1103 elfxx-x86.lo for 64-bit BFD.
1104 * configure: Regenerated.
1105
ef32532f
JB
11062017-08-31 James Bowman <james.bowman@ftdichip.com>
1107
1108 * elf32-ft32.c (ft32_elf_howto_table): Use complain_overflow_dont
1109 for R_FT32_18.
1110
e234de6b
AM
11112017-08-31 Alan Modra <amodra@gmail.com>
1112
1113 PR binutils/22032
1114 * opncls.c (bfd_close_all_done): Don't call bfd_cache_close
1115 before _close_and_cleanup. Call iovec->bclose after.
1116 (bfd_close): Remove code common to, and call, bfd_close_all_done.
1117
f493882d
L
11182017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1119
1120 * elf32-i386.c (elf_i386_plt_type): Removed.
1121 (elf_i386_plt): Likewise.
1122 (elf_i386_get_synthetic_symtab): Updated. Call
1123 _bfd_x86_elf_get_synthetic_symtab.
1124 * elf64-x86-64.c (elf_x86_64_plt_type): Removed.
1125 (elf_x86_64_plt): Likewise.
1126 (elf_x86_64_get_synthetic_symtab): Updated. Call
1127 _bfd_x86_elf_get_synthetic_symtab.
1128 * elfxx-x86.c (elf_i386_get_plt_got_vma): New function.
1129 (elf_x86_64_get_plt_got_vma): Likewise.
1130 (elf_i386_valid_plt_reloc_p): Likewise.
1131 (elf_x86_64_valid_plt_reloc_p): Likewise.
1132 (_bfd_x86_elf_get_synthetic_symtab): Likewise.
1133 * elfxx-x86.h (elf_x86_plt_type): New.
1134 (elf_x86_plt): Likewise.
1135 (_bfd_x86_elf_get_synthetic_symtab): Likewise.
1136
5b86dbf4
L
11372017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1138
1139 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Check
1140 target_id instead of elf_machine_code.
1141
765e526c
L
11422017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1143
1144 * elf32-i386.c (ELF_DYNAMIC_INTERPRETER): Removed.
1145 (elf_i386_lazy_plt_layout): Likewise.
1146 (elf_i386_non_lazy_plt_layout): Likewise.
1147 (elf_i386_plt_layout): Likewise.
1148 (elf_i386_link_hash_table): Likewise.
1149 (elf_i386_next_tls_desc_index): Likewise.
1150 (elf_i386_srelplt2): Likewise.
1151 (elf_i386_plt): Likewise.
1152 (elf_i386_lazy_plt): Likewise.
1153 (elf_i386_non_lazy_plt): Likewise.
1154 (elf_i386_link_hash_table_create): Likewise.
1155 (bfd_elf32_bfd_link_hash_table_create): Likewise.
1156 (elf_i386_lazy_plt): Updated.
1157 (elf_i386_non_lazy_plt): Likewise.
1158 (elf_i386_lazy_ibt_plt): Likewise.
1159 (elf_i386_non_lazy_ibt_plt): Likewise.
1160 (elf_i386_allocate_dynrelocs): Likewise.
1161 (elf_i386_size_dynamic_sections): Likewise.
1162 (elf_i386_relocate_section): Likewise.
1163 (elf_i386_finish_dynamic_symbol): Likewise.
1164 (elf_i386_finish_dynamic_sections): Likewise.
1165 (elf_i386_get_synthetic_symtab): Likewise.
1166 (elf_i386_link_setup_gnu_properties): Likewise.
1167 (elf_i386_nacl_plt): Likewise.
1168 * elf64-x86-64.c (ABI_64_P): Removed.
1169 (ELF64_DYNAMIC_INTERPRETER): Likewise.
1170 (ELF32_DYNAMIC_INTERPRETER): Likewise.
1171 (elf_x86_64_lazy_plt_layout): Likewise.
1172 (elf_x86_64_non_lazy_plt_layout): Likewise.
1173 (elf_x86_64_plt_layout): Likewise.
1174 (elf_x86_64_link_hash_table): Likewise.
1175 (elf_x86_64_plt): Likewise.
1176 (elf_x86_64_lazy_plt): Likewise.
1177 (elf_x86_64_non_lazy_plt): Likewise.
1178 (elf_x86_64_link_hash_table_create): Likewise.
1179 (bfd_elf64_bfd_link_hash_table_create): Likewise.
1180 (bfd_elf32_bfd_link_hash_table_create): Likewise.
1181 (elf_x86_64_lazy_plt): Updated.
1182 (elf_x86_64_non_lazy_plt): Likewise.
1183 (elf_x86_64_lazy_bnd_plt): Likewise.
1184 (elf_x86_64_non_lazy_bnd_plt): Likewise.
1185 (elf_x86_64_lazy_ibt_plt): Likewise.
1186 (elf_x32_lazy_ibt_plt): Likewise.
1187 (elf_x86_64_non_lazy_ibt_plt): Likewise.
1188 (elf_x32_non_lazy_ibt_plt): Likewise.
1189 (elf_x86_64_allocate_dynrelocs): Likewise.
1190 (elf_x86_64_size_dynamic_sections): Likewise.
1191 (elf_x86_64_relocate_section): Likewise.
1192 (elf_x86_64_finish_dynamic_symbol): Likewise.
1193 (elf_x86_64_finish_dynamic_sections): Likewise.
1194 (elf_x86_64_get_synthetic_symtab): Likewise.
1195 (elf_x86_64_link_setup_gnu_properties): Likewise.
1196 (elf_x86_64_nacl_plt): Likewise.
1197 * elfxx-x86.c: Include "objalloc.h", "elf/i386.h" and
1198 "elf/x86-64.h".
1199 (ELF32_DYNAMIC_INTERPRETER): New.
1200 (ELF64_DYNAMIC_INTERPRETER): Likewise.
1201 (ELFX32_DYNAMIC_INTERPRETER): Likewise.
1202 (_bfd_x86_elf_link_hash_table_create): Likewise.
1203 (_bfd_x86_elf_link_hash_table_free): Renamed to ...
1204 (elf_x86_link_hash_table_free): This. Make it static.
1205 * elfxx-x86.h: Don't include "objalloc.h".
1206 (ABI_64_P): New.
1207 (elf_x86_lazy_plt_layout): Likewise.
1208 (elf_x86_non_lazy_plt_layout): Likewise.
1209 (elf_x86_plt_layout): Likewise.
1210 (_bfd_x86_elf_link_hash_table_create): Likewise.
1211 (bfd_elf64_bfd_link_hash_table_create): Likewise.
1212 (bfd_elf32_bfd_link_hash_table_create): Likewise.
1213 (elf_x86_link_hash_table): Add plt, lazy_plt, non_lazy_plt,
1214 srelplt2 and next_tls_desc_index.
1215 (_bfd_x86_elf_link_hash_table_free): Removed.
1216
70e65ca8
MR
12172017-08-30 Maciej W. Rozycki <macro@imgtec.com>
1218
1219 * elfxx-mips.c (mips_elf_perform_relocation): Correct microMIPS
1220 branch offset interpretation.
1221
7c0ed396
L
12222017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1223
1224 PR binutils/22032
1225 * opncls.c (bfd_close_all_done): Call _close_and_cleanup.
1226
0f2425c4
L
12272017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1228
1229 * elf64-x86-64.c (elf_x86_64_next_tls_desc_index): Removed.
1230 (elf_x86_64_srelplt2): Likewise.
1231
9a23f96e
AM
12322017-08-30 Alan Modra <amodra@gmail.com>
1233
1234 * elf64-ppc.c (struct ppc_link_hash_table): Add do_tls_opt.
1235 (ppc64_elf_tls_optimize): Set it.
1236 (ppc64_elf_relocate_section): Nop addis on TPREL16_HA, and convert
1237 insn on TPREL16_LO and TPREL16_LO_DS relocs to use r13 when
1238 addis would add zero.
1239 * elf32-ppc.c (struct ppc_elf_link_hash_table): Add do_tls_opt.
1240 (ppc_elf_tls_optimize): Set it.
1241 (ppc_elf_relocate_section): Nop addis on TPREL16_HA, and convert
1242 insn on TPREL16_LO relocs to use r2 when addis would add zero.
1243
b9f04fe0
AM
12442017-08-30 Alan Modra <amodra@gmail.com>
1245
1246 * elf64-ppc.c (ppc64_elf_relocate_section): When optimizing
1247 __tls_get_addr call sequences to LE, don't move the addi down
1248 to the nop. Replace the bl with addi and leave the nop alone.
1249
5f0f0847
L
12502017-08-29 H.J. Lu <hongjiu.lu@intel.com>
1251
1252 * elf32-i386.c (elf_i386_pie_finish_undefweak_symbol):
1253 Re-indent.
1254 * elf64-x86-64.c (elf_x86_64_finish_local_dynamic_symbol):
1255 Likewise.
1256 (elf_x86_64_pie_finish_undefweak_symbol): Likewise.
1257
443701f5
L
12582017-08-29 H.J. Lu <hongjiu.lu@intel.com>
1259
1260 * Makefile.am (BFD32_BACKENDS): Add elfxx-x86.lo.
1261 (BFD64_BACKENDS): Likewise.
1262 (BFD32_BACKENDS_CFILES): Add elfxx-x86.c.
1263 (BFD64_BACKENDS_CFILES): Likewise.
1264 * Makefile.in: Regenerated.
1265 * configure.ac (bfd_backends): Add elfxx-x86.lo together with
1266 elf32-i386.lo and elf64-x86-64.lo.
1267 * configure: Regenerated.
1268 * elf32-i386.c: Include "elfxx-x86.h" instead of "sysdep.h",
1269 "bfd.h", "bfdlink.h", "libbfd.h", "elf-bfd.h", "bfd_stdint.h",
1270 "objalloc.h" and "hashtab.h".
1271 (ELIMINATE_COPY_RELOCS): Removed.
1272 (UNDEFINED_WEAK_RESOLVED_TO_ZERO):Likewise.
1273 (SYMBOL_NO_COPYRELOC): Likewise.
1274 (elf_i386_link_hash_entry): Likewise.
1275 (GOT_UNKNOWN): Likewise.
1276 (GOT_NORMAL): Likewise.
1277 (GOT_TLS_GD): Likewise.
1278 (elf_i386_hash_entry): Likewise.
1279 (elf_i386_obj_tdata): Likewise.
1280 (elf_i386_tdata): Likewise.
1281 (elf_i386_local_got_tls_type): Likewise.
1282 (elf_i386_local_tlsdesc_gotent): Likewise.
1283 (elf_i386_hash_table): Likewise.
1284 (elf_i386_link_hash_newfunc): Likewise.
1285 (elf_i386_local_htab_hash): Likewise.
1286 (elf_i386_local_htab_eq): Likewise.
1287 (elf_i386_get_local_sym_hash): Likewise.
1288 (elf_i386_link_hash_table_free): Likewise.
1289 (elf_i386_copy_indirect_symbol): Likewise.
1290 (elf_i386_fixup_symbol): Likewise.
1291 (elf_i386_readonly_dynrelocs): Likewise.
1292 (elf_i386_always_size_sections): Likewise.
1293 (elf_i386_set_tls_module_base): Likewise.
1294 (elf_i386_dtpoff_base): Likewise.
1295 (compare_relocs): Likewise.
1296 (elf_i386_hash_symbol): Likewise.
1297 (elf_i386_parse_gnu_properties): Likewise.
1298 (elf_i386_merge_gnu_properties): Likewise.
1299 (elf_i386_link_check_relocs): Likewise.
1300 (elf_i386_merge_symbol_attribute): Likewise.
1301 (bfd_elf32_bfd_link_check_relocs): Likewise.
1302 (elf_backend_copy_indirect_symbol): Likewise.
1303 (elf_backend_always_size_sections): Likewise.
1304 (elf_backend_omit_section_dynsym): Likewise.
1305 (elf_backend_hash_symbol): Likewise.
1306 (elf_backend_fixup_symbol): Likewise.
1307 (elf_backend_parse_gnu_properties): Likewise.
1308 (elf_backend_merge_gnu_properties): Likewise.
1309 (elf_backend_merge_symbol_attribute): Likewise.
1310 (elf_i386_mkobject): Updated.
1311 (elf_i386_link_hash_table_create): Likewise.
1312 (elf_i386_check_tls_transition): Likewise.
1313 (elf_i386_tls_transition): Likewise.
1314 (elf_i386_convert_load_reloc): Likewise.
1315 (elf_i386_check_relocs): Likewise.
1316 (elf_i386_adjust_dynamic_symbol): Likewise.
1317 (elf_i386_allocate_dynrelocs): Likewise.
1318 (elf_i386_convert_load): Likewise.
1319 (elf_i386_size_dynamic_sections): Likewise.
1320 (elf_i386_relocate_section): Likewise.
1321 (elf_i386_finish_dynamic_symbol ): Likewise.
1322 (elf_i386_finish_dynamic_sections): Likewise.
1323 (elf_i386_output_arch_local_syms): Likewise.
1324 (elf_i386_get_synthetic_symtab): Likewise.
1325 (elf_i386_link_setup_gnu_properties): Likewise.
1326 (elf_i386_link_hash_table): Use elf_x86_link_hash_table, instead
1327 of elf_link_hash_table, as base.
1328 (elf_i386_next_tls_desc_index): New.
1329 (elf_i386_srelplt2): Likewise.
1330 (elf_i386_plt): Likewise.
1331 (elf_i386_lazy_plt): Likewise.
1332 (elf_i386_non_lazy_plt): Likewise.
1333 * elf32-x86-64.c: Include "elfxx-x86.h" instead of "sysdep.h",
1334 "bfd.h", "bfdlink.h", "libbfd.h", "elf-bfd.h", "bfd_stdint.h",
1335 "objalloc.h" and "hashtab.h".
1336 (ELIMINATE_COPY_RELOCS): Removed.
1337 (UNDEFINED_WEAK_RESOLVED_TO_ZERO):Likewise.
1338 (SYMBOL_NO_COPYRELOC): Likewise.
1339 (elf_x86_64_link_hash_entry): Likewise.
1340 (GOT_UNKNOWN): Likewise.
1341 (GOT_NORMAL): Likewise.
1342 (GOT_TLS_GD): Likewise.
1343 (elf_x86_64_hash_entry): Likewise.
1344 (elf_x86_64_obj_tdata): Likewise.
1345 (elf_x86_64_tdata): Likewise.
1346 (elf_x86_64_local_got_tls_type): Likewise.
1347 (elf_x86_64_local_tlsdesc_gotent): Likewise.
1348 (elf_x86_64_hash_table): Likewise.
1349 (elf_x86_64_link_hash_newfunc): Likewise.
1350 (elf_x86_64_local_htab_hash): Likewise.
1351 (elf_x86_64_local_htab_eq): Likewise.
1352 (elf_x86_64_get_local_sym_hash): Likewise.
1353 (elf_x86_64_link_hash_table_free): Likewise.
1354 (elf_x86_64_copy_indirect_symbol): Likewise.
1355 (elf_x86_64_fixup_symbol): Likewise.
1356 (elf_x86_64_readonly_dynrelocs): Likewise.
1357 (elf_x86_64_always_size_sections): Likewise.
1358 (elf_x86_64_set_tls_module_base): Likewise.
1359 (elf_x86_64_dtpoff_base): Likewise.
1360 (compare_relocs): Likewise.
1361 (elf_x86_64_merge_symbol_attribute): Likewise.
1362 (elf_x86_64_hash_symbol): Likewise.
1363 (elf_x86_64_parse_gnu_properties): Likewise.
1364 (elf_x86_64_merge_gnu_properties): Likewise.
1365 (elf_x86_64_link_check_relocs): Likewise.
1366 (elf_backend_copy_indirect_symbol): Likewise.
1367 (elf_backend_always_size_sections): Likewise.
1368 (bfd_elf64_bfd_link_check_relocs): Likewise.
1369 (elf_backend_merge_symbol_attribute): Likewise.
1370 (elf_backend_hash_symbol): Likewise.
1371 (elf_backend_omit_section_dynsym): Likewise.
1372 (elf_backend_fixup_symbol): Likewise.
1373 (elf_backend_parse_gnu_properties): Likewise.
1374 (elf_backend_merge_gnu_properties): Likewise.
1375 (bfd_elf32_bfd_link_check_relocs): Likewise.
1376 (elf_x86_64_mkobject): Updated.
1377 (elf_x86_64_link_hash_table_create): Likewise.
1378 (elf_x86_64_check_tls_transition): Likewise.
1379 (elf_x86_64_tls_transition): Likewise.
1380 (elf_x86_64_convert_load_reloc): Likewise.
1381 (elf_x86_64_check_relocs): Likewise.
1382 (elf_x86_64_adjust_dynamic_symbol): Likewise.
1383 (elf_x86_64_allocate_dynrelocs): Likewise.
1384 (elf_x86_64_convert_load): Likewise.
1385 (elf_x86_64_size_dynamic_sections): Likewise.
1386 (elf_x86_64_relocate_section): Likewise.
1387 (elf_x86_64_finish_dynamic_symbol ): Likewise.
1388 (elf_x86_64_finish_dynamic_sections): Likewise.
1389 (elf_x86_64_output_arch_local_syms): Likewise.
1390 (elf_x86_64_get_synthetic_symtab): Likewise.
1391 (elf_x86_64_link_setup_gnu_properties): Likewise.
1392 (elf_x86_64_link_hash_table): Use elf_x86_link_hash_table,
1393 instead of elf_link_hash_table, as base.
1394 (elf_x86_64_next_tls_desc_index): New.
1395 (elf_x86_64_srelplt2): Likewise.
1396 (elf_x86_64_plt): Likewise.
1397 (elf_x86_64_lazy_plt): Likewise.
1398 (elf_x86_64_non_lazy_plt): Likewise.
1399 * elfxx-x86.c: New file.
1400 * elfxx-x86.h: Likewise.
1401
823cb067
L
14022017-08-29 H.J. Lu <hongjiu.lu@intel.com>
1403
1404 * elf32-i386.c (elf_i386_get_synthetic_symtab): Simplify bad
1405 return.
1406 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
1407
37c0b6ee
L
14082017-08-29 H.J. Lu <hongjiu.lu@intel.com>
1409
1410 * elf32-i386.c (elf_i386_get_synthetic_symtab): Check valid PLT
1411 sections before checking dynamic relocations and free invalid
1412 PLT section contents.
1413 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
1414
0fb0a767
L
14152017-08-28 H.J. Lu <hongjiu.lu@intel.com>
1416
1417 * elf-bfd.h (_bfd_elf_ifunc_get_synthetic_symtab): Removed.
1418 * elf-ifunc.c (_bfd_elf_ifunc_get_synthetic_symtab): Likewise.
1419
90efb642
L
14202017-08-28 H.J. Lu <hongjiu.lu@intel.com>
1421
1422 PR binutils/22018
1423 * elf32-i386.c (elf_i386_get_synthetic_symtab): Check for valid
1424 PLT section size.
1425 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
1426
596dc58f
L
14272017-08-27 H.J. Lu <hongjiu.lu@intel.com>
1428
1429 * elf32-i386.c (elf_i386_link_hash_newfunc): Initialize
1430 def_protected.
1431 * elf64-x86-64.c (elf_x86_64_link_hash_newfunc): Likewise.
1432
a5b4ee94
L
14332017-08-26 H.J. Lu <hongjiu.lu@intel.com>
1434
1435 PR ld/21997
1436 * elf-bfd.h (elf_obj_tdata): Use ENUM_BITFIELD on object_id,
1437 dyn_lib_class and has_gnu_symbols. Change bad_symtab to bitfield.
1438 Add a has_no_copy_on_protected bitfield.
1439 (elf_has_no_copy_on_protected): New.
1440 * elf-properties.c (_bfd_elf_parse_gnu_properties): Set
1441 elf_has_no_copy_on_protected for GNU_PROPERTY_NO_COPY_ON_PROTECTED.
1442 (elf_merge_gnu_property_list): Likewise.
1443 (_bfd_elf_link_setup_gnu_properties): Set extern_protected_data
1444 to FALSE for elf_has_no_copy_on_protected.
1445 * elf32-i386.c (SYMBOL_NO_COPYRELOC): New.
1446 (elf_i386_link_hash_entry): Add def_protected.
1447 (elf_i386_adjust_dynamic_symbol): Also check SYMBOL_NO_COPYRELOC
1448 when checking info->nocopyreloc.
1449 (elf_i386_link_setup_gnu_properties): Don't set
1450 extern_protected_data here.
1451 (elf_i386_merge_symbol_attribute): New function.
1452 (elf_backend_merge_symbol_attribute): New.
1453 * elf64-x86-64.c (SYMBOL_NO_COPYRELOC): New.
1454 (elf_x86_64_link_hash_entry): Add def_protected.
1455 (elf_x86_64_need_pic): Report protected symbol for def_protected.
1456 (elf_x86_64_adjust_dynamic_symbol): Also check SYMBOL_NO_COPYRELOC
1457 when checking info->nocopyreloc.
1458 (elf_x86_64_relocate_section): Also check for R_X86_64_PC32
1459 relocation run-time overflow and unresolvable R_X86_64_32S
1460 relocation against protected data symbol defined in shared object
1461 with GNU_PROPERTY_NO_COPY_ON_PROTECTED.
1462 (elf_x86_64_link_setup_gnu_properties): Don't set
1463 extern_protected_data here.
1464 (elf_x86_64_merge_symbol_attribute): New function.
1465 (elf_backend_merge_symbol_attribute): New.
1466
7c8bbca5
AM
14672017-08-26 Alan Modra <amodra@gmail.com>
1468
1469 * elf32-ppc.c (must_be_dyn_reloc): Use bfd_link_dll. Comment.
1470 (ppc_elf_check_relocs): Only set DF_STATIC_TLS in shared libs.
1471 (ppc_elf_relocate_section): Comment fix.
1472 * elf64-ppc.c (must_be_dyn_reloc): Use bfd_link_dll. Comment.
1473 (ppc64_elf_check_relocs): Only set DF_STATIC_TLS in shared libs.
1474 Support dynamic relocs for TPREL16 when non-pic too.
1475 (dec_dynrel_count): Adjust TPREL16 handling as per check_relocs.
1476 (ppc64_elf_relocate_section): Support dynamic relocs for TPREL16
1477 when non-pic too.
1478
5fdda9d6
L
14792017-08-25 H.J. Lu <hongjiu.lu@intel.com>
1480
1481 * elf32-i386.c (elf_i386_link_hash_entry): Remove redundant
1482 "symbol" in comments.
1483 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Likewise.
1484
7073b5b9
L
14852017-08-24 H.J. Lu <hongjiu.lu@intel.com>
1486
1487 PR ld/22001
1488 * elf64-x86-64.c (elf_x86_64_relocate_section): Check for
1489 R_X86_64_PC32 relocation run-time overflow and unresolvable
1490 R_X86_64_32S relocation with -z nocopyreloc.
1491
34bb2571
L
14922017-08-24 H.J. Lu <hongjiu.lu@intel.com>
1493
1494 * elf32-i386.c (elf_i386_check_relocs): Revert the last change.
1495 Undefined symbols may not have a type.
1496 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1497
aab921ad
L
14982017-08-23 H.J. Lu <hongjiu.lu@intel.com>
1499
1500 * elf64-x86-64.c (elf_x86_64_need_pic): Add an argument for
1501 bfd_link_info. Report shared, PIE or PDE object based on
1502 bfd_link_info.
1503 (elf_x86_64_check_relocs): Update elf_x86_64_need_pic call.
1504 (elf_x86_64_relocate_section): Likewise.
1505
b1bb697e
L
15062017-08-23 H.J. Lu <hongjiu.lu@intel.com>
1507
1508 * elf32-i386.c (elf_i386_check_relocs): Increment PLT count only
1509 for function symbols.
1510 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1511
73784fa5
L
15122017-08-23 H.J. Lu <hongjiu.lu@intel.com>
1513
1514 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Set
1515 extern_protected_data to FALSE if GNU_PROPERTY_NO_COPY_ON_PROTECTED
1516 is set on any input relocatable file.
1517 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Likewise.
1518
46434633
AM
15192017-08-23 Alan Modra <amodra@gmail.com>
1520
1521 PR 21988
1522 * elf64-ppc.c (ensure_undef_dynamic): Rename from
1523 ensure_undefweak_dynamic. Handle undefined too.
1524 * elf32-ppc.c (ensure_undef_dynamic): Likewise.
1525 * elf32-hppa.c (ensure_undef_dynamic): Likewise.
1526 (allocate_dynrelocs): Discard undefined non-default visibility
1527 relocs first. Make undefined syms dynamic. Tidy goto.
1528
487b6440
AM
15292017-08-21 Alan Modra <amodra@gmail.com>
1530 H.J. Lu <hongjiu.lu@intel.com>
1531
1532 PR ld/21964
1533 * elf-bfd.h (SYMBOLIC_BIND): Return TRUE for __start/__stop symbols.
1534 * elflink.c (bfd_elf_define_start_stop): Rewrite.
1535
284d826d
HPN
15362017-08-21 Hans-Peter Nilsson <hp@bitrange.com>
1537
1538 PR ld/20125
1539 * elf64-mmix.c (mmix_elf_relax_section): Correct handling of
1540 undefined weak symbols.
1541
de259397
NC
15422017-08-18 Nick Clifton <nickc@redhat.com>
1543
1544 PR binutils/21962
1545 * tekhex.c (getsym): Fix check for source pointer walking off the
1546 end of the input buffer.
1547
545bc2b3
SN
15482017-08-17 Szabolcs Nagy <szabolcs.nagy@arm.com>
1549
1550 PR ld/18808
1551 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Skip IFUNC
1552 relocations in debug sections, change abort to _bfd_error_handler.
1553
0c54f692
NC
15542017-08-14 Nick Clifton <nickc@redhat.com>
1555
1556 PR 21957
1557 * elf.c (setup_group): Check for an empty or very small group
1558 section.
1559 * po/bfd.pot: Regenerate.
1560
79a94a2a
AM
15612017-08-14 Alan Modra <amodra@gmail.com>
1562
1563 PR 21441
1564 * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Don't add
1565 alignment padding here.
1566 * elflink.c (bfd_elf_discard_info): Add .eh_frame padding here
1567 in a reverse pass over sections.
1568
98c5dfc9
L
15692017-08-11 H.J. Lu <hongjiu.lu@intel.com>
1570
1571 PR binutils/21943
1572 * elf32-i386.c (elf_i386_get_synthetic_symtab): Allocate space
1573 for @plt suffixes first.
1574 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
1575
24d3e51b
NC
15762017-08-08 Nick Clifton <nickc@redhat.com>
1577
1578 PR 21916
1579 * elf-attrs.c (_bfd_elf_parse_attributes): Complain about very
1580 small section lengths.
1581 * elf.c (_bfd_elf_setup_sections): Skip empty entries in the group
1582 table.
1583 (elfcore_grok_freebsd_prstatus): Add checks to make sure that
1584 there is enough data present in the note.
1585
206c9c79
AM
15862017-08-08 Alan Modra <amodra@gmail.com>
1587
1588 PR 21017
1589 * elf32-microblaze.c (microblaze_elf_check_relocs): Don't bump
1590 got.refcount for GOTOFF relocs, just create .got section.
1591
2980ccad
L
15922017-08-07 H.J. Lu <hongjiu.lu@intel.com>
1593
1594 * elflink.c (elf_link_add_object_symbols): Move common symbol
1595 check after bed->common_definition.
1596
b3293efa
AM
15972017-08-07 Alan Modra <amodra@gmail.com>
1598
1599 PR 21910
1600 * elflink.c (bfd_elf_final_link): Don't segfault when sections
1601 needed to define various dynamic tags have been discarded.
1602
b7a18930
NC
16032017-08-07 Nick Clifton <nickc@redhat.com>
1604
1605 PR 21884
1606 * elf32-i386.c (elf_i386_link_setup_gnu_properties): If the dynobj
1607 has not been set then use the bfd returned by
1608 _bfd_elf_link_setup_gnu_properties. If that is null then search
1609 through all the input bfds selecting the first normal, ELF format
1610 one.
1611 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Likewise.
1612
1d4af308
L
16132017-08-06 H.J. Lu <hongjiu.lu@intel.com>
1614
1615 * elf32-i386.c (elf_i386_link_hash_entry): Change tls_get_addr
1616 to 1 bit.
1617 (elf_i386_link_hash_newfunc): Initialize tls_get_addr to 0.
1618 (elf_i386_check_tls_transition): Check tls_get_addr directly.
1619 (elf_i386_convert_load_reloc): Update tls_get_addr check.
1620 (elf_i386_link_check_relocs): New function.
1621 (bfd_elf32_bfd_link_check_relocs): New.
1622 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Change tls_get_addr
1623 to 1 bit.
1624 (elf_x86_64_link_hash_newfunc): Initialize tls_get_addr to 0.
1625 (elf_x86_64_check_tls_transition): Check tls_get_addr directly.
1626 (elf_x86_64_convert_load_reloc): Update tls_get_addr check.
1627 (elf_x86_64_link_check_relocs): New function.
1628 (bfd_elf64_bfd_link_check_relocs): New.
1629 (bfd_elf32_bfd_link_check_relocs): Likewise.
1630
a4819f54
L
16312017-08-06 H.J. Lu <hongjiu.lu@intel.com>
1632
1633 PR ld/21903:
1634 * elflink.c (elf_link_add_object_symbols): Treat common symbol
1635 as undefined for --no-define-common.
1636
55ef6584
AM
16372017-08-05 Alan Modra <amodra@gmail.com>
1638
1639 * elf32-hppa.c (elf32_hppa_set_gp): Don't require an
1640 hppa_link_hash_table.
1641
d84ed528
MF
16422017-08-02 Max Filippov <jcmvbkbc@gmail.com>
1643
1644 * xtensa-isa.c (xtensa_isa_init): Don't update lookup table
1645 entries for sysregs with negative indices.
1646
1ef692ea
AK
16472017-08-01 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
1648
1649 * elf32-s390.c (elf_s390_finish_dynamic_sections): Skip if it
1650 isn't the S/390 specific elf data.
1651 * elf64-s390.c (elf_s390_finish_dynamic_sections): Likewise.
1652
57593436
KLC
16532017-07-31 Kuan-Lin Chen <rufus@andestech.com>
1654
1655 * elfxx-riscv.c (riscv_elf_add_sub_reloc): New function.
1656 * (howto_table) [R_RISCV_ADD8]: Use riscv_elf_add_sub_reloc.
1657 [R_RISCV_ADD16]: Likewise.
1658 [R_RISCV_ADD32]: Likewise.
1659 [R_RISCV_ADD64]: Likewise.
1660 [R_RISCV_SUB6]: Likewise.
1661 [R_RISCV_SUB8]: Likewise.
1662 [R_RISCV_SUB16]: Likewise.
1663 [R_RISCV_SUB32]: Likewise.
1664 [R_RISCV_SUB64]: Likewise.
1665
d44c746a
AM
16662017-07-31 Alan Modra <amodra@gmail.com>
1667
1668 * elf64-ppc.c (ppc64_elf_tls_setup): Warn on --plt-localentry
1669 without ld.so checks.
1670
8b5f1ed8
AM
16712017-07-29 Alan Modra <amodra@gmail.com>
1672
1673 PR 21847
1674 * elf64-ppc.c (struct ppc_link_hash_entry): Add non_zero_localentry.
1675 (ppc64_elf_merge_symbol): Set non_zero_localentry.
1676 (is_elfv2_localentry0): Test non_zero_localentry.
1677 (ppc64_elf_tls_setup): Default to --no-plt-localentry.
1678
894dde0b
AK
16792017-07-28 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
1680
1681 * elf32-s390.c (elf_s390_finish_dynamic_sections): Add NULL
1682 pointer check for htab->elf.irelplt.
1683 * elf64-s390.c (elf_s390_finish_dynamic_sections): Likewise.
1684
8bdf0be1
NC
16852017-07-27 Nick Clifton <nickc@redhat.com>
1686
1687 PR 21840
1688 * mach-o.c (bfd_mach_o_read_symtab_strtab): Fail if the symtab
1689 size is -1.
1690 * nlmcode.h (nlm_swap_auxiliary_headers_in): Replace assertion
1691 with error return.
1692 * section.c (bfd_make_section_with_flags): Fail if the name or bfd
1693 are NULL.
1694 * vms-alpha.c (bfd_make_section_with_flags): Correct computation
1695 of end pointer.
1696 (evax_bfd_print_emh): Check for invalid string lengths.
1697
c26bb067
NC
16982017-07-25 Nick Clifton <nickc@redhat.com>
1699
1700 * po/fr.po: Updated French translation.
1701
cfe7b9bd
BG
17022017-07-25 Benjamin Green <bengreen5mx@gmail.com>
1703
1704 PR 21824
1705 * elf32-msp430.c (msp430_elf_relax_section): Allow conversion of
1706 16-bit absolute branches into 10-bit pc-relative branches on the
1707 MSP430 as well as the MSP430X.
1708
d4aaa2a0
AM
17092017-07-25 Alan Modra <amodra@gmail.com>
1710
1711 * elf64-ppc.c (struct map_stub): Add tls_get_addr_opt_bctrl.
1712 (stub_eh_frame_size): New function.
1713 (ppc_size_one_stub): Set group tls_get_addr_opt_bctrl.
1714 (group_sections): Init group tls_get_addr_opt_bctrl.
1715 (ppc64_elf_size_stubs): Update sizing and initialization of
1716 .eh_frame. Iteration over stubs via group list.
1717 (ppc64_elf_build_stubs): Iterate over stubs via group list.
1718 (ppc64_elf_finish_dynamic_sections): Update finalization of
1719 .eh_frame.
1720
ca4cf9b9
NC
17212017-07-24 Nick Clifton <nickc@redhat.com>
1722
1723 PR 21813
1724 * mach-o.c (bfd_mach_o_canonicalize_relocs): Pass the base address
1725 of the relocs to the canonicalize_one_reloc routine.
1726 * mach-o.h (struct bfd_mach_o_backend_data): Update the prototype
1727 for the _bfd_mach_o_canonicalize_one_reloc field.
1728 * mach-o-arm.c (bfd_mach_o_arm_canonicalize_one_reloc): Add
1729 res_base parameter. Use to check for corrupt pair relocs.
1730 * mach-o-aarch64.c (bfd_mach_o_arm64_canonicalize_one_reloc):
1731 Likewise.
1732 * mach-o-i386.c (bfd_mach_o_i386_canonicalize_one_reloc):
1733 Likewise.
1734 * mach-o-x86-64.c (bfd_mach_o_x86_64_canonicalize_one_reloc):
1735 Likewise.
1736
1737 * vms-alpha.c (_bfd_vms_slurp_eihd): Make sure that there is
1738 enough data in the record before attempting to parse it.
1739 (_bfd_vms_slurp_eeom): Likewise.
1740
1741 (_bfd_vms_slurp_egsd): Check for an invalid section index.
1742 (image_set_ptr): Likewise.
1743 (alpha_vms_slurp_relocs): Likewise.
1744
8a2df5e2
NC
1745 (alpha_vms_object_p): Check for a truncated record.
1746
47aeb64c
NC
17472017-07-24 Nick Clifton <nickc@redhat.com>
1748
1749 PR 21803
1750 * reloc.c (_bfd_unrecognized_reloc): New function. Reports
1751 an unrecognized reloc and sets the bfd_error value.
1752 * libbfd.h: Regenerate.
1753 * elf32-arm.c (elf32_arm_final_link_relocate): Use the new
1754 function.
1755 * elf32-i386.c (elf_i386_relocate_section): Likewise.
1756 * elf32-tilepro.c (tilepro_elf_relocate_section): Likewise.
1757 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
1758 * elfnn-aarch64.c (elfNN_aarch64_relocate_section): Likewise.
1759 * elfxx-tilegx.c (tilegx_elf_relocate_section): Likewise.
1760
15a3a14f
AM
17612017-07-23 Alan Modra <amodra@gmail.com>
1762
1763 * elf64-ppc.c (ppc64_elf_size_stubs): Correct advance to
1764 restore of LR.
1765
f2e6a843
SN
17662017-07-19 Szabolcs Nagy <szabolcs.nagy@arm.com>
1767
1768 PR ld/18841
1769 * elfnn-aarch64.c (elfNN_aarch64_reloc_type_class): Return
1770 reloc_class_ifunc for ifunc symbols.
1771
909e4e71
NC
17722017-07-19 Nick Clifton <nickc@redhat.com>
1773
1774 PR 21787
1775 * archive.c (bfd_generic_archive_p): If the bfd does not have the
1776 correct magic bytes at the start, set the error to wrong format
1777 and clear the format selector before returning NULL.
1778
29866fa1
NC
17792017-07-19 Nick Clifton <nickc@redhat.com>
1780
1781 PR 21786
1782 * coff-rs6000.c (_bfd_strntol): New function.
1783 (_bfd_strntoll): New function.
1784 (GET_VALUE_IN_FIELD): New macro.
1785 (EQ_VALUE_IN_FIELD): new macro.
1786 (_bfd_xcoff_slurp_armap): Use new macros.
1787 (_bfd_xcoff_archive_p): Likewise.
1788 (_bfd_xcoff_read_ar_hdr): Likewise.
1789 (_bfd_xcoff_openr_next_archived_file): Likewise.
1790 (_bfd_xcoff_stat_arch_elt): Likewise.
6c4e7b6b
NC
1791 * coff64-rs6000.c (_bfd_strntol): New function.
1792 (_bfd_strntoll): New function.
1793 (GET_VALUE_IN_FIELD): New macro.
1794 (xcoff64_slurp_armap): Use new macros.
29866fa1 1795
684d5a10
JEM
17962017-07-19 Claudiu Zissulescu <claziss@synopsys.com>
1797 John Eric Martin <John.Martin@emmicro-us.com>
1798
1799 * bfd-in2.h: Regenerate.
1800 * libbfd.h: Regenerate.
1801 * elf32-arc.c (JLI): Define.
1802 * reloc.c: Add JLI relocations.
1803
de194d85
YC
18042017-07-18 Nick Clifton <nickc@redhat.com>
1805
1806 PR 21775
1807 * coff-sh.c: Fix spelling typos.
1808 * compress.c: Likewise.
1809 * cpu-pdp11.c: Likewise.
1810 * ecofflink.c: Likewise.
1811 * elf-m10300.c: Likewise.
1812 * elf.c: Likewise.
1813 * elf32-arm.c: Likewise.
1814 * elf32-m68k.c: Likewise.
1815 * elf32-nds32.c: Likewise.
1816 * elf32-ppc.c: Likewise.
1817 * elf32-sh.c: Likewise.
1818 * elf32-v850.c: Likewise.
1819 * elf64-ppc.c: Likewise.
1820 * elf64-x86-64.c: Likewise.
1821 * elflink.c: Likewise.
1822 * elfnn-aarch64.c: Likewise.
1823 * elfxx-mips.c: Likewise.
1824 * som.c: Likewise.
1825 * sunos.c: Likewise.
1826 * vms-alpha.c: Likewise.
1827 * xcofflink.c: Likewise.
1828
e4e21d9e
NC
18292017-07-18 Nick Clifton <nickc@redhat.com>
1830
1831 PR binutils/21781
1832 * coffcode.h (handle_COMDAT): Replace abort with an error message
1833 and return.
1834
8e85f840
L
18352017-07-17 H.J. Lu <hongjiu.lu@intel.com>
1836
1837 PR ld/21782
1838 * elf64-x86-64.c (elf_x86_64_relocate_section): Limit PIC check
1839 to shared library.
1840
dd57c19c
L
18412017-07-17 H.J. Lu <hongjiu.lu@intel.com>
1842
1843 * elf64-x86-64.c (elf_x86_64_relocate_section): Re-indent.
1844
676ee2b5
AM
18452017-07-16 Alan Modra <amodra@gmail.com>
1846
1847 * elf64-ppc.c (ppc64_elf_relocate_section): Don't optimize
1848 __tls_index GOT entries when using __tls_get_addr_opt stub.
1849 * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
1850
429d795d
AM
18512017-07-12 Alan Modra <amodra@gmail.com>
1852
1853 * po/es.po: Update from translationproject.org/latest/bfd/.
1854 * po/fi.po: Likewise.
1855 * po/fr.po: Likewise.
1856 * po/id.po: Likewise.
1857 * po/ja.po: Likewise.
1858 * po/ro.po: Likewise.
1859 * po/ru.po: Likewise.
1860 * po/sr.po: Likewise.
1861 * po/sv.po: Likewise.
1862 * po/tr.po: Likewise.
1863 * po/uk.po: Likewise.
1864 * po/vi.po: Likewise.
1865 * po/zh_CN.po: Likewise.
1866 * po/hr.po: New file from translationproject.org.
1867 * configure.ac (ALL_LINGUAS): Add hr. Sort.
1868 * configure: Regenerate.
1869
0bae9e9e
NC
18702017-07-12 Nick Clifton <nickc@redhat.com>
1871
1872 Fix compile time warnings using gcc 7.1.1.
1873 * elf32-xtensa.c (elf_xtensa_get_plt_section): Increase length of
1874 plt_name buffer.
1875 (elf_xtensa_get_gotplt_section): Increase length of got_name
1876 buffer.
1877 * mach-o-arm.c (bfd_mach_o_arm_canonicalize_one_reloc): Add a
1878 default return of FALSE.
1879 * mach-o-i386.c (bfd_mach_o_i386_canonicalize_one_reloc): Add a
1880 default return of FALSE.
1881
d42c267e
AM
18822017-07-12 Alan Modra <amodra@gmail.com>
1883
1884 * binary.c (binary_set_section_contents): Don't print filepos in
1885 error message.
1886 (coff_write_object_contents): Cast size_t for error message.
1887 (coff_slurp_line_table): Don't use bfd_vma symndx.
1888 (coff_slurp_reloc_table): Remove unneeded cast.
1889 * dwarf2.c (read_section): Cast bfd_int64_t to long long for
1890 error message.
1891 (find_abstract_instance_name): Likewise.
1892 * elf32-arm.c (arm_type_of_stub): Correct error arg order.
1893 (bfd_elf32_arm_stm32l4xx_erratum_scan): Don't cast error arg.
1894 (elf32_arm_check_relocs): Make r_symndx an int.
1895 * elf32-cris.c (cris_elf_check_relocs): Delete extraneous %s in
1896 format string.
1897 * elf32-metag.c (elf_metag_relocate_section): Delete extra error
1898 message arg.
1899 * elf32-nds32.c (nds32_elf_ex9_build_hash_table): Rewrite bogus
1900 error message.
1901 * elf32-i386.c (elf_i386_check_relocs): Make r_symndx an int.
1902 * elf32-s390.c (elf_s390_check_relocs): Likewise.
1903 * elf32-tic6x.c (elf32_tic6x_check_relocs): Likewise.
1904 * elf32-tilepro.c (tilepro_elf_check_relocs): Likewise.
1905 * elf32-xtensa.c (elf_xtensa_check_relocs): Likewise.
1906 * elf64-s390.c (elf_s390_check_relocs): Likewise.
1907 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1908 * elfnn-aarch64.c (elfNN_aarch64_check_relocs): Likewise.
1909 * elfnn-riscv.c (riscv_elf_check_relocs): Likewise.
1910 * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Likewise.
1911 * elfxx-tilegx.c (tilegx_elf_check_relocs): Likewise.
1912 * elf64-mmix.c (_bfd_mmix_after_linker_allocation): Cast size_t args
1913 and use %lu for error message.
1914 * elflink.c (elf_link_adjust_relocs): Delete extra error message arg.
1915 * mmo.c (mmo_scan): Make stab_loc a file_ptr. Cast expression for
1916 error message.
1917
1918 * elf32-arm.c (elf32_arm_tls_relax): Correct format string and args
1919 in error message.
1920 (elf32_arm_final_link_relocate): Likewise.
1921 * coff-arm.c (bfd_arm_process_before_allocation): Likewise.
1922 * coffcode.h (styp_to_sec_flags): Likewise.
1923 * cofflink.c (_bfd_coff_write_global_sym): Likewise.
1924 * ecoff.c (_bfd_ecoff_slurp_symbol_table): Likewise.
1925 * elf32-arc.c (arc_elf_merge_private_bfd_data): Likewise.
1926 * elf32-bfin.c (bfinfdpic_check_relocs): Likewise.
1927 (elf32_bfin_merge_private_bfd_data): Likewise.
1928 * elf32-cris.c (cris_elf_relocate_section): Likewise.
1929 * elf32-frv.c (frv_elf_merge_private_bfd_data): Likewise.
1930 * elf32-i370.c (i370_elf_merge_private_bfd_data): Likewise.
1931 (i370_elf_relocate_section): Likewise.
1932 * elf32-iq2000.c (iq2000_elf_merge_private_bfd_data): Likewise.
1933 * elf32-m32c.c (m32c_elf_merge_private_bfd_data): Likewise.
1934 * elf32-m68hc1x.c (_bfd_m68hc11_elf_merge_private_bfd_data): Likewise.
1935 * elf32-mcore.c (mcore_elf_relocate_section): Likewise.
1936 * elf32-mep.c (mep_elf_merge_private_bfd_data): Likewise.
1937 * elf32-mt.c (mt_elf_merge_private_bfd_data): Likewise.
1938 * elf64-sparc.c (elf64_sparc_merge_private_bfd_data): Likewise.
1939 * elfxx-mips.c (mips_elf_merge_obj_e_flags): Likewise.
1940 (_bfd_mips_elf_merge_private_bfd_data): Likewise.
1941 * ieee.c (ieee_write_id, read_id): Likewise.
1942 * mach-o.c (bfd_mach_o_write_contents): Likewise.
1943 (bfd_mach_o_layout_commands, bfd_mach_o_read_section_32): Likewise.
1944 (bfd_mach_o_read_section_64, bfd_mach_o_read_symtab_symbol): Likewise.
1945 (bfd_mach_o_read_command, bfd_mach_o_header_p): Likewise.
1946 * peXXigen.c (_bfd_XXi_swap_aouthdr_in): Likewise.
1947 * stabs.c (_bfd_link_section_stabs): Likewise.
1948
1949 * coff-arm.c (coff_arm_relocate_section): Use L modifier in error
1950 format.
1951 * coff-mcore.c (coff_mcore_relocate_section): Likewise.
1952 * coff-ppc.c (coff_ppc_relocate_section): Likewise.
1953 * coff-rs6000.c (xcoff_reloc_type_toc): Likewise.
1954 * coff-sh.c (sh_relax_section): Likewise.
1955 (sh_relax_delete_bytes, sh_swap_insns): Likewise.
1956 * coff-tic80.c (coff_tic80_relocate_section): Likewise.
1957 * coffcode.h (coff_slurp_reloc_table): Likewise.
1958 * coffgen.c (_bfd_coff_get_external_symbols): Likewise.
1959 (_bfd_coff_read_string_table): Likewise.
1960 * cofflink.c (_bfd_coff_generic_relocate_section): Likewise.
1961 * compress.c (bfd_get_full_section_contents): Likewise.
1962 * dwarf2.c (read_formatted_entries, decode_line_info): Likewise.
1963 * elf-m10300.c (mn10300_elf_relocate_section): Likewise.
1964 * elf.c (bfd_elf_string_from_elf_section): Likewise.
1965 * elf32-arc.c (arc_special_overflow_checks): Likewise.
1966 * elf32-arm.c (elf32_arm_tls_relax): Likewise.
1967 (elf32_arm_final_link_relocate, elf32_arm_relocate_section): Likewise.
1968 (elf32_arm_write_section): Likewise.
1969 * elf32-bfin.c (bfin_relocate_section): Likewise.
1970 (bfinfdpic_relocate_section): Likewise.
1971 * elf32-hppa.c (hppa_build_one_stub): Likewise.
1972 (final_link_relocate, elf32_hppa_relocate_section): Likewise.
1973 * elf32-i386.c (elf_i386_tls_transition): Likewise.
1974 (elf_i386_relocate_section): Likewise.
1975 * elf32-ip2k.c (ip2k_final_link_relocate): Likewise.
1976 * elf32-lm32.c (lm32_elf_finish_dynamic_sections): Likewise.
1977 * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
1978 * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
1979 * elf32-metag.c (elf_metag_relocate_section): Likewise.
1980 * elf32-nds32.c (unrecognized_reloc_msg): Likewise.
1981 (nds32_elf_relax_longcall1, nds32_elf_relax_longcall2): Likewise.
1982 (nds32_elf_relax_longcall3, nds32_elf_relax_longjump1): Likewise.
1983 (nds32_elf_relax_longjump2, nds32_elf_relax_longjump3): Likewise.
1984 (nds32_elf_relax_longcall4, nds32_elf_relax_longcall5): Likewise.
1985 (nds32_elf_relax_longcall6, nds32_elf_relax_longjump4): Likewise.
1986 (nds32_elf_relax_longjump5, nds32_elf_relax_longjump6): Likewise.
1987 (nds32_elf_relax_longjump7, nds32_elf_relax_loadstore): Likewise.
1988 (nds32_elf_relax_ptr, nds32_elf_ex9_build_hash_table): Likewise.
1989 * elf32-nios2.c (nios2_elf32_relocate_section): Likewise.
1990 * elf32-rx.c (UNSAFE_FOR_PID): Likewise.
1991 * elf32-s390.c (invalid_tls_insn, elf_s390_relocate_section): Likewise.
1992 * elf32-score.c (s3_bfd_score_elf_check_relocs): Likewise.
1993 * elf32-score7.c (s7_bfd_score_elf_check_relocs): Likewise.
1994 * elf32-sh.c (sh_elf_relax_section): Likewise.
1995 (sh_elf_relax_delete_bytes, sh_elf_swap_insns): Likewise.
1996 (sh_elf_relocate_section): Likewise.
1997 * elf32-sh64.c (shmedia_prepare_reloc): Likewise.
1998 * elf32-spu.c (spu_elf_relocate_section): Likewise.
1999 * elf32-tic6x.c (elf32_tic6x_relocate_section): Likewise.
2000 * elf32-tilepro.c (tilepro_elf_relocate_section): Likewise.
2001 * elf32-v850.c (v850_elf_relax_section): Likewise.
2002 * elf32-vax.c (elf_vax_check_relocs): Likewise.
2003 (elf_vax_relocate_section): Likewise.
2004 * elf32-xtensa.c (elf_xtensa_relocate_section): Likewise.
2005 (extend_ebb_bounds_forward, extend_ebb_bounds_backward): Likewise.
2006 (compute_text_actions, compute_ebb_proposed_actions): Likewise.
2007 (do_fix_for_relocatable_link): Likewise.
2008 * elf64-alpha.c (elf64_alpha_relax_got_load): Likewise.
2009 (elf64_alpha_relax_with_lituse): Likewise.
2010 * elf64-hppa.c (elf64_hppa_finish_dynamic_symbol): Likewise.
2011 (elf_hppa_final_link_relocate): Likewise.
2012 * elf64-ia64-vms.c (elf64_ia64_relax_section): Likewise.
2013 (elf64_ia64_choose_gp, elf64_ia64_relocate_section): Likewise.
2014 (elf64_vms_link_add_object_symbols): Likewise.
2015 * elf64-mmix.c (mmix_elf_perform_relocation): Likewise.
2016 (mmix_final_link_relocate): Likewise.
2017 * elf64-s390.c (invalid_tls_insn): Likewise.
2018 (elf_s390_relocate_section): Likewise.
2019 * elf64-sh64.c (sh_elf64_relocate_section): Likewise.
2020 * elf64-x86-64.c (elf_x86_64_tls_transition): Likewise.
2021 (elf_x86_64_relocate_section): Likewise.
2022 * elfcode.h (elf_slurp_symbol_table): Likewise.
2023 * elfcore.h (elf_core_file_p): Likewise.
2024 * elflink.c (elf_link_read_relocs_from_section): Likewise.
2025 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Likewise.
2026 (elfNN_aarch64_relocate_section): Likewise.
2027 * elfnn-ia64.c (elfNN_ia64_relax_section): Likewise.
2028 (elfNN_ia64_choose_gp, elfNN_ia64_relocate_section): Likewise.
2029 * elfnn-riscv.c (riscv_elf_relocate_section): Likewise.
2030 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
2031 (_bfd_mips_elf_relocate_section): Likewise.
2032 (_bfd_mips_elf_finish_dynamic_symbol, mips_finish_exec_plt): Likewise.
2033 * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Likewise.
2034 * elfxx-tilegx.c (tilegx_elf_relocate_section): Likewise.
2035 * ieee.c (ieee_slurp_external_symbols): Likewise.
2036 * ihex.c (ihex_write_object_content): Likewise.
2037 * mach-o.c (bfd_mach_o_build_exec_seg_command): Likewise.
2038 * merge.c (_bfd_merged_section_offset): Likewise.
2039 * mmo.c (mmo_write_loc_chunk): Likewise.
2040 (mmo_write_object_contents): Likewise.
2041 * peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Likewise.
2042 * stabs.c (_bfd_link_section_stabs): Likewise.
2043 * xcofflink.c (xcoff_link_add_symbols, xcoff_find_tc0): Likewise.
2044
e3fbc3da
AM
20452017-07-11 Alan Modra <amodra@gmail.com>
2046
2047 * elf32-ppc.c (ppc_elf_relocate_section): Fix typo.
2048
2c4d9cbe
AM
20492017-07-11 Alan Modra <amodra@gmail.com>
2050
2051 * elf32-ppc.c (ppc_elf_relocate_section): Emit "unexpected
2052 instruction" error using _bfd_error_handler, not einfo.
2053
adce5b39
NC
20542017-07-10 Nick Clifton <nickc@redhat.com>
2055
2056 * coffcode.h (coff_slurp_symbol_table): Do not include an entry
2057 for C_AIX_WEAKEXT if it has the same value as C_WEAKEXT.
2058
e6f3b9c3
JB
20592017-07-07 John Baldwin <jhb@FreeBSD.org>
2060
2061 * elf.c (elfcore_grok_freebsd_note): Handle NT_FREEBSD_PTLWPINFO.
2062
532cc313
AM
20632017-07-07 Alan Modra <amodra@gmail.com>
2064
2065 * coffcode.h (coff_slurp_symbol_table): Handle C_AIX_WEAKEXT.
2066
1cf9552b
AM
20672017-07-07 Alan Modra <amodra@gmail.com>
2068
2069 * bfd.c (_doprnt): Replace "L" with "ll" when printing bfd_vma
2070 as long long. Move code replacing "ll" with "I64", and simplify.
2071
a0b7b105
L
20722017-07-06 H.J. Lu <hongjiu.lu@intel.com>
2073
2074 * bfd.c (_doprnt): Convert 'L' to 'l' when setting wide_width
2075 to 1.
2076
1d827a72
L
20772017-07-05 H.J. Lu <hongjiu.lu@intel.com>
2078
2079 * dwarf2.c (line_info_add_include_dir_stub): Replace time with
2080 xtime.
2081 (line_info_add_file_name): Likewise.
2082 (decode_line_info): Likewise.
2083
0d702cfe
TG
20842017-07-04 Tristan Gingold <gingold@adacore.com>
2085
2086 * version.m4: Bump version to 2.29.51
2087 * configure: Regenerate.
2088
564e46b7
JW
20892017-07-04 Jiong Wang <jiong.wang@arm.com>
2090
2091 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Remove the
2092 sanity check at the head of this function.
2093
0041f7df
JK
20942017-07-04 Jan Kratochvil <jan.kratochvil@redhat.com>
2095
2096 * dwarf2.c (struct dwarf2_debug): Add fields dwarf_line_str_buffer and
2097 dwarf_line_str_size.
2098 (struct attr_abbrev): Add field implicit_const.
2099 (dwarf_debug_sections): Add .debug_line_str.
2100 (enum dwarf_debug_section_enum): Add debug_line_str and debug_max.
2101 (dwarf_debug_section_assert): Add static assertion.
2102 (read_indirect_line_string): New.
2103 (read_abbrevs): Support DW_FORM_implicit_const.
2104 (is_str_attr): Support DW_FORM_line_strp.
2105 (read_attribute_value): Support DW_FORM_line_strp and
2106 DW_FORM_implicit_const.
2107 (read_attribute): Support DW_FORM_implicit_const.
2108 (line_info_add_include_dir, line_info_add_include_dir_stub):
2109 (line_info_add_file_name, read_formatted_entries): New.
2110 (decode_line_info, parse_comp_unit): Support DWARF 5.
2111 (_bfd_dwarf2_cleanup_debug_info): Free dwarf_line_str_buffer.
2112
d8cd8c1f
EB
21132017-07-03 Egeyar Bagcioglu <egeyar.bagcioglu@oracle.com>
2114
2115 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Remove the
2116 abort statement that was put for symbols that are not dynamic.
2117
15e6ed8c
TG
21182017-07-03 Tristan Gingold <gingold@adacore.com>
2119
2120 * po/bfd.pot: Regenerate
2121
76cfced5
AM
21222017-07-03 Alan Modra <amodra@gmail.com>
2123
2124 * bfd.c (_doprnt): Rewrite "ll" and "L" modifiers to "I64" for
2125 __MSVCRT__. Support "L" modifier for bfd_vma. Formatting.
2126 * elf.c (setup_group): Use "Lx" to print sh_size.
2127 (_bfd_elf_setup_sections): Remove unnecessary cast and print
2128 unknown section type in hex.
2129 (copy_special_section_fields): Style fix.
2130 (bfd_section_from_shdr): Correct format for sh_link. Use a
2131 common error message for all the variants of unrecognized
2132 section types.
2133 (assign_file_positions_for_load_sections): Use "Lx" for lma
2134 adjust error message.
2135 (assign_file_positions_for_non_load_sections): Formatting.
2136 (rewrite_elf_program_header): Formatting. Use "Lx" for
2137 bfd_vma values in error messages.
2138 * elfcode.h (elf_slurp_reloc_table_from_section): Cast
2139 ELF_R_SYM value to type expected by format.
2140 * elflink.c (elf_link_read_relocs_from_section): Use "Lx"
2141 in error messages.
2142 (elf_link_add_object_symbols): Use "Lu" for symbol sizes.
2143 (elf_link_input_bfd): Use "Lx" for r_info.
2144 (bfd_elf_gc_record_vtinherit): Use "Lx" for offset.
2145
ce9116fd
AM
21462017-07-03 Alan Modra <amodra@gmail.com>
2147
2148 * bfd.c (bfd_scan_vma): Don't use long long unless HAVE_LONG_LONG.
2149 * coff-rs6000.c (FMT20): Handle hosts with 64-bit long and
2150 Microsoft C library variant of long long format specifier.
2151 (PRINT20): Cast value to bfd_uint64_t not long long.
2152 * coffcode.h (coff_print_aux): Use BFD_VMA_FMT.
2153 * coff-x86_64.c (coff_amd64_reloc): Use bfd_uint64_t rather than
2154 long long. Don't cast to bfd_vma.
2155 * elf32-score.c (score3_bfd_getl48): Likewise.
2156 * vms-alpha.c (_bfd_vms_slurp_eisd): Likewise.
2157
cd9af601
AM
21582017-07-03 Alan Modra <amodra@gmail.com>
2159
2160 * elf.c (_bfd_elf_print_private_bfd_data): Use BFD_VMA_FMT to
2161 print d_tag.
2162 (bfd_elf_print_symbol): Don't cast symbol->flags.
2163 (_bfd_elf_symbol_from_bfd_symbol): Likewise.
2164 * elf32-ppc.c (ppc_elf_begin_write_processing): Correct
2165 _bfd_error_handler argument order.
2166 (ppc_elf_merge_private_bfd_data): Don't cast flags.
2167
33c734b2
AM
21682017-07-03 Alan Modra <amodra@gmail.com>
2169
2170 * configure.ac: Invoke AC_CHECK_TYPES for long long. Invoke
2171 AC_TYPE_LONG_DOUBLE.
2172 * configure: Regenerate.
2173 * config.in: Regenerate.
2174
3df5cd13
AW
21752017-06-29 Andrew Waterman <andrew@sifive.com>
2176
2177 * elfnn-riscv.c (riscv_elf_adjust_dynamic_symbol): Fix TLS copy
2178 relocs.
2179
ec1acaba
EB
21802017-06-29 Egeyar Bagcioglu <egeyar.bagcioglu@oracle.com>
2181
2182 * elfxx-sparc.c (allocate_dynrelocs): Don't make a symbol dynamic
2183 unless it is undefined weak.
2184 * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Set the flag
2185 relative_reloc to direct non-dynamic symbols to R_SPARC_RELATIVE
2186 relocation.
2187 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): If symbol
2188 is not dynamic in PIC, abort.
2189
ff07562f
JW
21902017-06-29 Jiong Wang <jiong.wang@arm.com>
2191
2192 PR ld/21402
2193 * elfnn-aarch64.c (elfNN_aarch64_allocate_dynrelocs): Only make
2194 undefined weak symbols into dynamic.
2195 (elfNN_aarch64_final_link_relocate): Generate runtime RELATIVE
2196 relocation for non-dynamic symbols.
2197 (elfNN_aarch64_finish_dynamic_symbol): Add sanity check.
2198
2aff25ba
JW
21992017-06-29 Jiong Wang <jiong.wang@arm.com>
2200
2201 * elfnn-aarch64.c (aarch64_relocation_aginst_gp_p): New function.
2202 (elfNN_aarch64_final_link_relocate): Delete duplicated code for
2203 BFD_RELOC_AARCH64_LD64_GOTOFF_LO15, BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC,
2204 BFD_RELOC_AARCH64_MOVW_GOTOFF_G1.
2205 * elfxx-aarch64.c (_bfd_aarch64_elf_resolve_relocation): Optimize the
2206 support for them.
2207
88ab90e8
AA
22082017-06-29 Andreas Arnez <arnez@linux.vnet.ibm.com>
2209
2210 * elf-bfd.h (elfcore_write_s390_gs_cb): Add prototype.
2211 (elfcore_write_s390_gs_bc): Likewise.
2212 * elf.c (elfcore_grok_s390_gs_cb): New function.
2213 (elfcore_grok_s390_gs_bc): New function.
2214 (elfcore_grok_note): Call them.
2215 (elfcore_write_s390_gs_cb): New function.
2216 (elfcore_write_s390_gs_bc): New function.
2217 (elfcore_write_register_note): Call them.
2218
328ce951
L
22192017-06-28 H.J. Lu <hongjiu.lu@intel.com>
2220
2221 * libbfd.c (_bfd_generic_get_section_contents): Don't call
2222 bfd_get_file_size. Check archive element size.
2223 (_bfd_generic_get_section_contents_in_window): Likewise.
2224
47fdcf63
L
22252017-06-28 H.J. Lu <hongjiu.lu@intel.com>
2226
2227 * bfd-in2.h: Regenerated.
2228 * bfdio.c (bfd_get_size): Change return type to ufile_ptr.
2229 (bfd_get_file_size): Likewise.
2230
38bf472a
MR
22312017-06-28 Maciej W. Rozycki <macro@imgtec.com>
2232 Matthew Fortune <matthew.fortune@imgtec.com>
2233
2234 * archures.c (bfd_mach_mips_interaptiv_mr2): New macro.
2235 * cpu-mips.c (I_interaptiv_mr2): New enum value.
2236 (arch_info_struct): Add "mips:interaptiv-mr2" entry.
2237 * elfxx-mips.c (_bfd_elf_mips_mach) <E_MIPS_MACH_IAMR2>: New
2238 case.
2239 (mips_set_isa_flags) <bfd_mach_mips_interaptiv_mr2>: Likewise.
2240 (bfd_mips_isa_ext) <bfd_mach_mips_interaptiv_mr2>: Likewise.
2241 (print_mips_isa_ext) <AFL_EXT_INTERAPTIV_MR2>: Likewise.
2242 (mips_mach_extensions): Add `bfd_mach_mipsisa32r3' and
2243 `bfd_mach_mips_interaptiv_mr2' entries.
2244 * bfd-in2.h: Regenerate.
2245
2d68166e
NC
22462017-06-27 Nick Clifton <nickc@redhat.com>
2247
2248 * tekhex.c (pass_over): Revert accidental conversion of a local
2249 array to a static array.
2250
68063779
SKS
22512017-06-27 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
2252
2253 PR ld/13402
2254 * elf32-avr.c (elf32_avr_adjust_diff_reloc_value): Adjust
2255 reloc addend if necessary. Adjust diff only if
2256 shrinked_insn_address < end_address.
2257
ea9aafc4
AM
22582017-06-27 Alan Modra <amodra@gmail.com>
2259
2260 PR binutils/21665
2261 * libbfd.c (_bfd_generic_get_section_contents): Warning fix.
2262 (_bfd_generic_get_section_contents_in_window): Likewise.
2263
a6cbf936
KLC
22642017-06-26 Kuan-Lin Chen <rufus@andestech.com>
2265
2266 * elfnn-riscv.c (perform_relocation): Support the new
2267 R_RISCV_32_PCREL relocation.
2268 (riscv_elf_relocate_section): Likewise.
2269 * elfxx-riscv.c (howto_table): Likewise.
2270 (riscv_reloc_map): Likewise.
2271 * bfd-in2.h (BFD_RELOC_RISCV_32_PCREL): New relocation.
2272 * libbfd.h: Regenerate.
2273
7211ae50
AM
22742017-06-27 Alan Modra <amodra@gmail.com>
2275
2276 PR binutils/21665
2277 * libbfd.c (_bfd_generic_get_section_contents): Delete abort.
2278 Use unsigned file pointer type, and remove cast.
2279 * libbfd.c (_bfd_generic_get_section_contents_in_window): Likewise.
2280 Add "count", not "sz".
2281
ab27f80c
PA
22822017-06-26 Pedro Alves <palves@redhat.com>
2283
2284 PR binutils/21665
2285 * libbfd.c (_bfd_generic_get_section_contents): Add "count", not
2286 "sz".
2287
1f473e3d
L
22882017-06-26 H.J. Lu <hongjiu.lu@intel.com>
2289
2290 PR binutils/21665
2291 * libbfd.c (_bfd_generic_get_section_contents_in_window): Add
2292 a missing line.
2293
b417536f
MR
22942017-06-26 Maciej W. Rozycki <macro@imgtec.com>
2295
2296 * cpu-mips.c (arch_info_struct): Mark the 4010 32-bit.
2297 * elfxx-mips.c (mips_set_isa_flags) <bfd_mach_mips4010>: Set
2298 E_MIPS_ARCH_2 rather than E_MIPS_ARCH_3 in `e_flags'.
2299 (mips_mach_extensions): Mark `bfd_mach_mips4010' as extending
2300 `bfd_mach_mips6000' rather than `bfd_mach_mips4000'.
2301
0630b49c
L
23022017-06-26 H.J. Lu <hongjiu.lu@intel.com>
2303
2304 PR binutils/21665
2305 * compress.c (bfd_get_full_section_contents): Don't check the
2306 file size here.
2307 * libbfd.c (_bfd_generic_get_section_contents): Check for and
ea9aafc4 2308 reject a section whose size + offset is greater than the size
0630b49c
L
2309 of the entire file.
2310 (_bfd_generic_get_section_contents_in_window): Likewise.
515a4464 2311
04e15b4a
NC
23122017-06-26 Nick Clifton <nickc@redhat.com>
2313
2314 PR binutils/21670
2315 * tekhex.c (getvalue): Check for the source pointer exceeding the
2316 end pointer before the first byte is read.
2317
cfd14a50
NC
23182017-06-26 Nick Clifton <nickc@redhat.com>
2319
2320 PR binutils/21665
ea9aafc4 2321 * opncls.c (get_build_id): Check that the section is big enough
cfd14a50
NC
2322 to contain the whole note.
2323 * compress.c (bfd_get_full_section_contents): Check for and reject
ea9aafc4 2324 a section whose size is greater than the size of the entire file.
cfd14a50
NC
2325 * elf32-v850.c (v850_elf_copy_notes): Allow for the ouput to not
2326 contain a notes section.
2327
93ec5e23
AK
23282017-06-26 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
2329
2330 * elf64-s390.c (elf_s390_additional_program_headers): Add NULL
2331 pointer checks.
2332 (elf_s390_modify_segment_map): Likewise.
2333 (bfd_elf_s390_set_options): Lisewise.
2334
57963c05
AM
23352017-06-26 Alan Modra <amodra@gmail.com>
2336
2337 * elflink.c (_bfd_elf_link_create_dynstrtab): Don't make dynobj
2338 a --just-syms bfd.
2339 (_bfd_elf_size_group_sections): Skip --just-syms bfds.
2340 (bfd_elf_size_dynamic_sections): Ignore .note.GNU-stack and
2341 .preinit_array on --just-syms bfds.
2342 (_bfd_elf_gc_mark_extra_sections): Skip --just-syms bfds.
2343 (elf_gc_sweep, bfd_elf_parse_eh_frame_entries): Likewise.
2344 (bfd_elf_gc_sections, bfd_elf_discard_info): Likewise.
2345
5cc4ca83
ST
23462017-06-25 Sergei Trofimovich <slyfox@gentoo.org>
2347
2348 * elf.c (find_link): Bounds check "hint".
2349
bff0500d
TP
23502017-06-24 Thomas Preud'homme <thomas.preudhomme@arm.com>
2351
2352 * elf32-arm.c (using_thumb_only): Update list of architectures in
2353 BFD_ASSERT for which the logic is valid.
2354 (using_thumb2_bl): Likewise.
2355 (using_thumb2): Likewise and return true for ARMv8-R.
2356 (arch_has_arm_nop): Likewise.
2357 (tag_cpu_arch_combine): New v8r table for ARMv8-R Tag_CPU_arch
2358 merging logic. Update commentis for value 15 of v8m_baseline,
2359 v8m_mainline and v4t_plus_v6_m arrays. Use v8r array to decide
2360 merging of value 15 of Tag_CPU_arch.
2361
4aa57d6a
JW
23622017-06-23 Jiong Wang <jiong.wang@arm.com>
2363
2364 * reloc.c (BFD_RELOC_AARCH64_ADR_GOTPAGE): Rename to
2365 BFD_RELOC_AARCH64_ADR_GOT_PAGE
2366 * bfd-in2.h: Regenerate.
2367
5d8763a3
L
23682017-06-22 H.J. Lu <hongjiu.lu@intel.com>
2369
2370 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Move
2371 the error_alignment label forward. Properly align program
2372 property note section.
2373
e652757b
EC
23742017-06-22 Eric Christopher <echristo@gmail.com>
2375
2376 * elf32-arm.c (elf32_arm_final_link_relocate): Use labs rather than
2377 abs to fix a truncation warning.
2378
84da4cf8
L
23792017-06-22 H.J. Lu <hongjiu.lu@intel.com>
2380
2381 * elf32-i386.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Resolve
2382 local undefined weak symbol to 0.
2383 * elf64-x86-64.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Likewise.
2384
48580982
L
23852017-06-22 H.J. Lu <hongjiu.lu@intel.com>
2386
2387 * elf32-i386.c (elf_i386_merge_gnu_properties): If info->shstk
2388 is set, turn on GNU_PROPERTY_X86_FEATURE_1_SHSTK.
2389 (elf_i386_link_setup_gnu_properties): If info->shstk is set,
2390 turn on GNU_PROPERTY_X86_FEATURE_1_IBT.
2391 * elf64-x86-64.c (elf_x86_64_merge_gnu_properties): If
2392 info->shstk is set, turn on GNU_PROPERTY_X86_FEATURE_1_SHSTK.
2393 (elf_x86_64_link_setup_gnu_properties): If info->shstk is set,
2394 turn on GNU_PROPERTY_X86_FEATURE_1_IBT.
2395
ee2fdd6f
L
23962017-06-22 H.J. Lu <hongjiu.lu@intel.com>
2397
2398 * elf32-i386.c (elf_i386_lazy_ibt_plt0_entry): New.
2399 (elf_i386_lazy_ibt_plt_entry): Likewise.
2400 (elf_i386_pic_lazy_ibt_plt0_entry): Likewise.
2401 (elf_i386_non_lazy_ibt_plt_entry): Likewise.
2402 (elf_i386_pic_non_lazy_ibt_plt_entry): Likewise.
2403 (elf_i386_eh_frame_lazy_ibt_plt): Likewise.
2404 (elf_i386_lazy_plt_layout): Likewise.
2405 (elf_i386_non_lazy_plt_layout): Likewise.
2406 (elf_i386_link_hash_entry): Add plt_second.
2407 (elf_i386_link_hash_table): Add plt_second and
2408 plt_second_eh_frame.
2409 (elf_i386_allocate_dynrelocs): Use the second PLT if needed.
2410 (elf_i386_size_dynamic_sections): Use .plt.got unwind info for
2411 the second PLT. Check the second PLT.
2412 (elf_i386_relocate_section): Use the second PLT to resolve
2413 PLT reference if needed.
2414 (elf_i386_finish_dynamic_symbol): Fill and use the second PLT if
2415 needed.
2416 (elf_i386_finish_dynamic_sections): Set sh_entsize on the
2417 second PLT. Generate unwind info for the second PLT.
2418 (elf_i386_plt_type): Add plt_second.
2419 (elf_i386_get_synthetic_symtab): Support the second PLT.
2420 (elf_i386_parse_gnu_properties): Support
2421 GNU_PROPERTY_X86_FEATURE_1_AND.
2422 (elf_i386_merge_gnu_properties): Support
2423 GNU_PROPERTY_X86_FEATURE_1_AND. If info->ibt is set, turn
2424 on GNU_PROPERTY_X86_FEATURE_1_IBT
2425 (elf_i386_link_setup_gnu_properties): If info->ibt is set,
2426 turn on GNU_PROPERTY_X86_FEATURE_1_IBT. Use IBT-enabled PLT
2427 for info->ibtplt, info->ibt or GNU_PROPERTY_X86_FEATURE_1_IBT
2428 is set on all relocatable inputs.
2429 * elf64-x86-64.c (elf_x86_64_lazy_ibt_plt_entry): New.
2430 (elf_x32_lazy_ibt_plt_entry): Likewise.
2431 (elf_x86_64_non_lazy_ibt_plt_entry): Likewise.
2432 (elf_x32_non_lazy_ibt_plt_entry): Likewise.
2433 (elf_x86_64_eh_frame_lazy_ibt_plt): Likewise.
2434 (elf_x32_eh_frame_lazy_ibt_plt): Likewise.
2435 (elf_x86_64_lazy_ibt_plt): Likewise.
2436 (elf_x32_lazy_ibt_plt): Likewise.
2437 (elf_x86_64_non_lazy_ibt_plt): Likewise.
2438 (elf_x32_non_lazy_ibt_plt): Likewise.
2439 (elf_x86_64_get_synthetic_symtab): Support the second PLT.
2440 (elf_x86_64_parse_gnu_properties): Support
2441 GNU_PROPERTY_X86_FEATURE_1_AND.
2442 (elf_x86_64_merge_gnu_properties): Support
2443 GNU_PROPERTY_X86_FEATURE_1_AND. If info->ibt is set, turn
2444 on GNU_PROPERTY_X86_FEATURE_1_IBT
2445 (elf_x86_64_link_setup_gnu_properties): If info->ibt is set,
2446 turn on GNU_PROPERTY_X86_FEATURE_1_IBT. Use IBT-enabled PLT
2447 for info->ibtplt, info->ibt or GNU_PROPERTY_X86_FEATURE_1_IBT
2448 is set on all relocatable inputs.
2449
d19237d9
NC
24502017-06-22 Nick Clifton <nickc@redhat.com>
2451
2452 PR binutils/21649
2453 * som.c (setup_sections): NUL terminate the space_strings buffer.
2454 Check that the space.name field does not index beyond the end of
2455 the space_strings buffer.
2456
6879f5a9
NC
24572017-06-21 Nick Clifton <nickc@redhat.com>
2458
2459 PR binutils/21646
2460 * coff-sh.c (sh_reloc): Check for an out of range reloc.
2461
7adc0a81
NC
24622017-06-21 Nick Clifton <nickc@redhat.com>
2463
2464 PR binutils/21639
2465 * vms-misc.c (_bfd_vms_save_sized_string): Use unsigned int as
2466 type of the size parameter.
2467 (_bfd_vms_save_counted_string): Add second parameter - the maximum
2468 length of the counted string.
2469 * vms.h (_bfd_vms_save_sized_string): Update prototype.
2470 (_bfd_vms_save_counted_string): Likewise.
2471 * vms-alpha.c (_bfd_vms_slurp_eisd): Update calls to
2472 _bfd_vms_save_counted_string.
2473 (_bfd_vms_slurp_ehdr): Likewise.
2474 (_bfd_vms_slurp_egsd): Likewise.
2475 (Parse_module): Likewise.
2476
6e1816be
AM
24772017-06-21 Alan Modra <amodra@gmail.com>
2478
2479 * elf64-ppc.c (ppc64_elf_size_stubs): Test for localentry:0 plt
2480 calls before tocsave calls.
2481 (ppc64_elf_relocate_section): Allow localentry:0 plt calls without
2482 following nop.
2483
20bd1b6b
NC
24842017-06-21 Nick Clifton <nickc@redhat.com>
2485
2486 PR binutils/21645
2487 * reloc.c (bfd_generic_get_relocated_section_contents): Fail if
2488 bfd_get_full_section_contents returns no contents.
2489
3de58d95
NC
24902017-06-21 Nick Clifton <nickc@redhat.com>
2491
2492 PR binutils/21638
2493 * vms-alpha.c (_bfd_vms_slurp_egsd): Check for an undersized
2494 record.
2495
cb06d03a
NC
24962017-06-21 Nick Clifton <nickc@redhat.com>
2497
2498 PR binutils/21637
2499 * vms-alpha.c (_bfd_vms_slurp_egsd): Check for an empty section
2500 list.
2501 (image_set_ptr): Likewise.
2502 (alpha_vms_fix_sec_rel): Likewise.
2503 (alpha_vms_slurp_relocs): Likewise.
2504
c458d007
NC
25052017-06-21 Nick Clifton <nickc@redhat.com>
2506
2507 PR binutils/21633
2508 * ieee.c (ieee_slurp_sections): Check for a NULL return from
2509 read_id.
2510 (ieee_archive_p): Likewise.
2511 (ieee_object_p): Likewise.
2512
ce497010
NC
25132017-06-21 Nick Clifton <nickc@redhat.com>
2514
2515 PR binutils/21640
2516 * elf.c (setup_group): Zero the group section pointer list after
2517 allocation so that loops can be caught. Check for NULL pointers
2518 when processing a group list.
2519
fd52715c
AK
25202017-06-20 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
2521
2522 * elf-s390.h: New file.
2523 * elf64-s390.c (struct elf_s390_link_hash_table): Add params
2524 field.
2525 (elf_s390_additional_program_headers): New function.
2526 (elf_s390_modify_segment_map): New function.
2527 (bfd_elf_s390_set_options): New function.
2528 (elf_backend_additional_program_headers)
2529 (elf_backend_modify_segment_map): Add macro definitions.
2530
abfa390d
L
25312017-06-19 H.J. Lu <hongjiu.lu@intel.com>
2532
2533 PR ld/21626
2534 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Check
2535 the DYNAMIC bit instead of bfd_count_sections.
2536
bc21b167
NC
25372017-06-19 Nick Clifton <nickc@redhat.com>
2538
2539 PR binutils/21618
2540 * vms-alpha.c (evax_bfd_print_emh): Check for insufficient record
2541 length.
2542 (evax_bfd_print_eeom): Likewise.
2543 (evax_bfd_print_egsd): Check for an overlarge record length.
2544 (evax_bfd_print_etir): Likewise.
2545
acb56a83
NC
25462017-06-19 Nick Clifton <nickc@redhat.com>
2547
2548 PR binutils/21612
2549 * libieee.h (struct common_header_type): Add end_p field.
2550 * ieee.c (this_byte_and_next): Do not advance input_p beyond
2551 end_p.
2552 (read_id): Check for a length that exceeds the remaining bytes in
2553 the input buffer.
2554 (ieee_seek): Initialise end_p.
2555 (ieee_archive_p): Likewise.
2556 (ieee_object_p): Likewise.
2557
72e84f96
NC
25582017-06-19 Nick Clifton <nickc@redhat.com>
2559
80053e46
NC
2560 PR binutils/21611
2561 * vms-alpha.c (_bfd_vms_slurp_eihs): Check for invalid offset
2562 before reading the EIHS structure entries.
2563
25642017-06-19 Nick Clifton <nickc@redhat.com>
2565
2566 PR binutils/21615
72e84f96
NC
2567 * vms-alpha.c (_bfd_vms_slurp_egsd): Use unsigned int for
2568 gsd_size. Check that there are enough bytes remaining to read the
2569 type and size of the next egsd. Check that the size of the egsd
2570 does not exceed the size of the record.
2571
875ffa3e
AM
25722017-06-19 Alan Modra <amodra@gmail.com>
2573
2574 * config.bfd: Correct targ_underscore for cris.
2575
bdd32e03
AM
25762017-06-18 Alan Modra <amodra@gmail.com>
2577
2578 * config.bfd: Correct targ_underscore for epiphany, ip2k,
2579 m32c, mn10200, pru, rl78, rx, crisv32 and v850.
2580
4b48e2f6
NC
25812017-06-16 Nick Clifton <nickc@redhat.com>
2582
2583 * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Do not fail if the
2584 bucketlist is empty because there are no symbols to add to the
2585 list.
2586
7dba9362
AM
25872017-06-16 Alan Modra <amodra@gmail.com>
2588
2589 PR ld/20022
2590 PR ld/21557
2591 PR ld/21562
2592 PR ld/21571
2593 * targets.c (struct bfd_target): Add _bfd_define_start_stop.
2594 (BFD_JUMP_TABLE_LINK): Likewise.
2595 * elf-bfd.h (bfd_elf_define_start_stop): Declare.
2596 * elflink.c (_bfd_elf_gc_mark_rsec): Update comment.
2597 (bfd_elf_define_start_stop): New function.
2598 * linker.c (bfd_generic_define_start_stop): New function.
2599 * coff64-rs6000.c (rs6000_xcoff64_vec, rs6000_xcoff64_aix_vec): Init
2600 new field.
2601 * aout-adobe.c (aout_32_bfd_define_start_stop): Define.
2602 * aout-target.h (MY_bfd_define_start_stop): Define.
2603 * aout-tic30.c (MY_bfd_define_start_stop): Define.
2604 * binary.c (binary_bfd_define_start_stop): Define.
2605 * bout.c (b_out_bfd_define_start_stop): Define.
2606 * coff-alpha.c (_bfd_ecoff_bfd_define_start_stop): Define.
2607 * coff-mips.c (_bfd_ecoff_bfd_define_start_stop): Define.
2608 * coff-rs6000.c (_bfd_xcoff_bfd_define_start_stop): Define.
2609 * coffcode.h (coff_bfd_define_start_stop): Define.
2610 * elfxx-target.h (bfd_elfNN_bfd_define_start_stop): Define.
2611 * i386msdos.c (msdos_bfd_define_start_stop): Define.
2612 * i386os9k.c (os9k_bfd_define_start_stop): Define.
2613 * ieee.c (ieee_bfd_define_start_stop): Define.
2614 * ihex.c (ihex_bfd_define_start_stop): Define.
2615 * libbfd-in.h (_bfd_nolink_bfd_define_start_stop): Define.
2616 * mach-o-target.c (bfd_mach_o_bfd_define_start_stop): Define.
2617 * mmo.c (mmo_bfd_define_start_stop): Define.
2618 * nlm-target.h (nlm_bfd_define_start_stop): Define.
2619 * oasys.c (oasys_bfd_define_start_stop): Define.
2620 * pef.c (bfd_pef_bfd_define_start_stop): Define.
2621 * plugin.c (bfd_plugin_bfd_define_start_stop): Define.
2622 * ppcboot.c (ppcboot_bfd_define_start_stop): Define.
2623 * som.c (som_bfd_define_start_stop): Define.
2624 * srec.c (srec_bfd_define_start_stop): Define.
2625 * tekhex.c (tekhex_bfd_define_start_stop): Define.
2626 * versados.c (versados_bfd_define_start_stop): Define.
2627 * vms-alpha.c (vms_bfd_define_start_stop): Define.
2628 (alpha_vms_bfd_define_start_stop): Define.
2629 * xsym.c (bfd_sym_bfd_define_start_stop): Define.
2630 * bfd-in2.h: Regenerate.
2631 * libbfd.h: Regenerate.
2632
d68f1976
JW
26332017-06-16 Jiong Wang <jiong.wang@arm.com>
2634
2635 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Use
2636 SYMBOL_REFERENCES_LOCAL.
2637
6353d82b
JW
26382017-06-15 Jiong Wang <jiong.wang@arm.com>
2639
2640 PR ld/21532
2641 * elfnn-aarch64.c (ELIMINATE_COPY_RELOCS): Set to 1.
2642 (elfNN_aarch64_final_link_relocate): Also propagate relocations to
2643 runtime for if there needs copy relocation elimination.
2644 (need_copy_relocation_p): New function. Return true for symbol with
2645 pc-relative references and if it's against read-only sections.
2646 (elfNN_aarch64_adjust_dynamic_symbol): Use need_copy_relocation_p.
2647 (elfNN_aarch64_check_relocs): Allocate dynrelocs for relocation types
2648 that are related with accessing external objects.
2649 (elfNN_aarch64_gc_sweep_hook): Sync the relocation types with the change
2650 in elfNN_aarch64_check_relocs.
2651
63634bb4
NC
26522017-06-15 Nick Clifton <nickc@redhat.com>
2653
2654 PR binutils/21582
2655 * ieee.c (ieee_object_p): Use a static buffer to avoid compiler
2656 bugs.
62b76e4b
NC
2657 PR binutils/21581
2658 (ieee_archive_p): Likewise.
63634bb4 2659
76800cba
NC
26602017-06-15 Nick Clifton <nickc@redhat.com>
2661
2662 PR binutils/21579
2663 * vms-alpha.c (_bfd_vms_slurp_etir): Extend check of cmd_length.
2664
f7e16c2a
MF
26652017-06-14 Max Filippov <jcmvbkbc@gmail.com>
2666
2667 * elf32-xtensa.c (elf_xtensa_be_plt_entry,
2668 elf_xtensa_le_plt_entry): Add dimension for the ABI to arrays,
2669 keep both windowed and call0 ABI PLT definitions.
2670 (elf_xtensa_create_plt_entry): Use selected ABI to choose upper
2671 elf_xtensa_*_plt_entry endex.
2672 (ELF_MAXPAGESIZE): Fix at minimal supported MMU page size.
2673
f461bbd8
NC
26742017-06-14 Nick Clifton <nickc@redhat.com>
2675
2676 PR binutils/21578
2677 * elf32-sh.c (sh_elf_set_mach_from_flags): Fix check for invalid
2678 flag value.
2679
c53d2e6d
NC
26802017-06-14 Nick Clifton <nickc@redhat.com>
2681
2682 PR binutils/21589
2683 * vms-alpha.c (_bfd_vms_get_value): Add an extra parameter - the
2684 maximum value for the ascic pointer. Check that name processing
2685 does not read beyond this value.
2686 (_bfd_vms_slurp_etir): Add checks for attempts to read beyond the
2687 end of etir record.
2688
04f963fd
NC
26892017-06-14 Nick Clifton <nickc@redhat.com>
2690
2691 PR binutils/21591
2692 * versados.c (versados_mkobject): Zero the allocated tdata structure.
2693 (process_otr): Check for an invalid offset in the otr structure.
2694
319c2dbe
SH
26952017-06-14 Sebastian Huber <sebastian.huber@embedded-brains.de>
2696
2697 * config.bfd (epiphany-*-elf): Accept epiphany-*-*.
2698
cbd0eecf
L
26992017-06-13 H.J. Lu <hongjiu.lu@intel.com>
2700
2701 PR ld/20022
2702 PR ld/21557
2703 PR ld/21562
2704 PR ld/21571
2705 * elf-bfd.h (elf_link_hash_entry): Add start_stop. Change the
2706 vtable field to a union.
2707 (_bfd_elf_is_start_stop): Removed.
2708 * elf32-i386.c (elf_i386_convert_load_reloc): Also check for
2709 __start_SECNAME and __stop_SECNAME symbols.
2710 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Likewise.
2711 * elflink.c (_bfd_elf_is_start_stop): Removed.
2712 (_bfd_elf_gc_mark_rsec): Check start_stop instead of calling
2713 _bfd_elf_is_start_stop.
2714 (elf_gc_propagate_vtable_entries_used): Skip __start_SECNAME and
2715 __stop_SECNAME symbols. Updated.
2716 (elf_gc_smash_unused_vtentry_relocs): Likewise.
2717 (bfd_elf_gc_record_vtinherit): Likewise.
2718 (bfd_elf_gc_record_vtentry): Likewise.
2719
10bbbc1d
NC
27202017-06-13 Nick Clifton <nickc@redhat.com>
2721
2722 PR ld/21524
2723 * elflink.c (elf_link_adjust_relocs): Generate an error when
2724 encountering a reloc against a symbol removed by garbage
2725 collection.
2726
5c3ce2bc
L
27272017-06-12 H.J. Lu <hongjiu.lu@intel.com>
2728
2729 * elf-bfd.h (elf_backend_data): Add struct bfd_link_info *
2730 to merge_gnu_properties.
2731 * elf-properties.c (elf_merge_gnu_properties): Add struct
2732 bfd_link_info * and pass it to merge_gnu_properties.
2733 (elf_merge_gnu_property_list): Add struct bfd_link_info *
2734 and pass it to elf_merge_gnu_properties.
2735 (_bfd_elf_link_setup_gnu_properties): Pass info to
2736 elf_merge_gnu_property_list.
2737 * elf32-i386.c (elf_i386_merge_gnu_properties): Add struct
2738 bfd_link_info *.
2739 * elf64-x86-64.c (elf_x86_64_merge_gnu_properties): Likewise.
2740
9b97dfbf
AM
27412017-06-11 Joe Zbiciak <joe.zbiciak@leftturnonly.info>
2742
2743 PR 21564
2744 * binary.c (binary_set_section_contents): Scale lma by octets
2745 per byte to set filepos.
2746
e3d1d408
CM
27472017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2748
2749 * elf32-arc.c (elf_arc_check_relocs): Fixed conditions to generate
2750 dynamic sections.
2751
64aa8e03
CM
27522017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2753
2754 * elf32-arc.c (elf_arc_size_dynamic_sections): Changed condition to
2755 require TEXTREL.
2756
a0abe743
CM
27572017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2758
2759 * arc-got.h (relocate_fix_got_relocs_for_got_info): Added TCB_SIZE to
2760 patched section contents for TLS IE reloc.
2761 * elf32-arc.c: Remove TCB_SIZE preprocessor macro.
2762
f4e6805f
CM
27632017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2764
2765 * elf32-arc.c (elf_arc_relocate_section): Added "call" to
2766 RELOC_FOR_GLOBAL_SYMBOL macro.
2767
cd640291
CM
27682018-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2769
2770 * elf32-arc.c (elf_arc_relocate_section): Small refactor and condition
2771 changes.
2772
7ef0acc1
VG
27732017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2774
2775 * config/tc-arc.c (md_undefined_symbol): Changed.
2776 * config/tc-arc.h (DYNAMIC_STRUCT_NAME): Removed.
2777
cc89d0b3
CM
27782017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2779
2780 * elf32-arc.c (elf_arc_relocate_section): Fixed reassign of indirect
2781 symbols.
2782
9d5c718b
CM
27832017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2784
2785 * elf32-arc.c (elf_arc_check_relocs): Added condition to disable
2786 warning and "Bad value" for local symbols ARC_32 or ARC_32_ME relocs.
2787
be9e3704
CM
27882017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2789
2790 * elf32-arc.c (ADD_RELA): Changed to only work when dynamic
2791 object is created.
2792
4ec192e6
RE
27932017-06-08 Richard Earnshaw <rearnsha@arm.com>
2794
2795 * elf32-arm.c (elf32_arm_merge_eabi_attributes): Remove assertion
2796 that the input bfd has Tag_FP_ARCH non-zero if Tag_ABI_HardFP_use
2797 is non-zero. Add clarifying comments.
2798
51fa2693
L
27992017-06-08 H.J. Lu <hongjiu.lu@intel.com>
2800
2801 * elf32-i386.c (elf_i386_check_relocs): Set local IFUNC symbol
2802 name. Use local IFUNC symbol name string to report unsupported
2803 non-PIC call to IFUNC function.
2804 (elf_i386_relocate_section): Dump local IFUNC name with minfo
2805 when generating R_386_IRELATIVE relocation.
2806 (elf_i386_finish_dynamic_symbol): Likewise.
2807 * elf_x86_64_check_relocs (elf_x86_64_check_relocs): Set local
2808 IFUNC symbol name.
2809 (elf_x86_64_relocate_section): Dump local IFUNC name with minfo
2810 when generating R_X86_64_IRELATIVE relocation.
2811 (elf_x86_64_finish_dynamic_symbol): Likewise.
2812
78e8a2ff
JM
28132017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
2814
2815 * elf.c (setup_group): Make sure BFD sections are created for all
2816 group sections in the input file when processing SHF_GROUP
2817 sections.
2818 (bfd_section_from_shdr): Avoid duplicating logic already
2819 implemented in `setup_group'.
2820
9949827b
DBR
28212017-06-06 Daniel Bonniot de Ruisselet <bonniot@gmail.com>
2822
2823 PR binutils/21546
2824 * peXXigen.c (pe_print_idata): Use the address of the first thunk
2825 if the hint address is zero.
2826
0ee3a6db
JC
28272017-06-06 James Clarke <jrtc27@jrtc27.com>
2828
2829 PR ld/19579
2830 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Check
2831 ELF_COMMON_DEF_P for common symbols.
2832
7bdf4127
AB
28332017-06-06 Andrew Burgess <andrew.burgess@embecosm.com>
2834
2835 * elf.c (_bfd_elf_make_section_from_shdr): Don't initially mark
2836 SEC_GROUP sections as SEC_EXCLUDE.
2837 (bfd_elf_set_group_contents): Replace use of abort with an assert.
2838 (assign_section_numbers): Use resolve_section_groups flag instead
2839 of relocatable link type.
2840 (_bfd_elf_init_private_section_data): Use resolve_section_groups
2841 flag instead of checking the final_link flag for part of the
2842 checks in here. Fix white space as a result.
2843 * elflink.c (elf_link_input_bfd): Use resolve_section_groups flag
2844 instead of relocatable link type.
2845 (bfd_elf_final_link): Likewise.
2846
458ad2b8
JM
28472017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
2848
2849 * elfxx-mips.c (_bfd_mips_elf_relocate_section): Remove unused
2850 variable `bed'.
2851 * elf32-score.c (score_elf_final_link_relocate): Likewise.
2852 (s3_bfd_score_elf_check_relocs): Likewise.
2853 * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
2854 (score_elf_final_link_relocate): Likewise.
2855 (s7_bfd_score_elf_check_relocs): Likewise.
2856
fbebaf4a
JM
28572017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
2858
2859 * elflink.c (init_reloc_cookie_rels): Remove unused variable
2860 `bed'.
2861
056bafd4
MR
28622017-06-06 Maciej W. Rozycki <macro@imgtec.com>
2863
2864 * elf-bfd.h (RELOC_AGAINST_DISCARDED_SECTION): Subtract `count'
2865 from `reloc_count' rather than decrementing it.
2866 * elf.c (bfd_section_from_shdr): Multiply the adjustment to
2867 `reloc_count' by `int_rels_per_ext_rel'.
2868 * elf32-score.c (score_elf_final_link_relocate): Do not multiply
2869 `reloc_count' by `int_rels_per_ext_rel' for last relocation
2870 entry determination.
2871 (s3_bfd_score_elf_check_relocs): Likewise.
2872 * elf32-score7.c (score_elf_final_link_relocate): Likewise.
2873 (s7_bfd_score_elf_relocate_section): Likewise.
2874 (s7_bfd_score_elf_check_relocs): Likewise.
2875 * elf64-mips.c (mips_elf64_get_reloc_upper_bound): Remove
2876 prototype and function.
2877 (mips_elf64_slurp_one_reloc_table): Do not update `reloc_count'.
2878 (mips_elf64_slurp_reloc_table): Assert that `reloc_count' is
2879 triple rather than once the sum of REL and RELA relocation entry
2880 counts.
2881 (bfd_elf64_get_reloc_upper_bound): Remove macro.
2882 * elflink.c (_bfd_elf_link_read_relocs): Do not multiply
2883 `reloc_count' by `int_rels_per_ext_rel' for internal relocation
2884 storage allocation size determination.
2885 (elf_link_input_bfd): Multiply `.ctors' and `.dtors' section's
2886 size by `int_rels_per_ext_rel'. Do not multiply `reloc_count'
2887 by `int_rels_per_ext_rel' for last relocation entry
2888 determination.
2889 (bfd_elf_final_link): Do not multiply `reloc_count' by
2890 `int_rels_per_ext_rel' for internal relocation storage
2891 allocation size determination.
2892 (init_reloc_cookie_rels): Do not multiply `reloc_count' by
2893 `int_rels_per_ext_rel' for last relocation entry determination.
2894 (elf_gc_smash_unused_vtentry_relocs): Likewise.
2895 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
2896 (_bfd_mips_elf_relocate_section): Likewise.
2897
af54f0eb
AM
28982017-06-05 Alan Modra <amodra@gmail.com>
2899
2900 PR 21529
2901 * linker.c (_bfd_generic_link_output_symbols): Handle BSF_GNU_UNIQUE.
2902
6cf3bf88 29032017-06-01 John Baldwin <jhb@FreeBSD.org>
b5430a3c
JB
2904
2905 * elf.c (elfcore_grok_freebsd_psinfo): Use ELF header class to
2906 determine structure sizes.
2907 (elfcore_grok_freebsd_prstatus): Likewise.
2908
f378ab09
AM
29092017-06-01 Alan Modra <amodra@gmail.com>
2910
2911 * elf64-ppc.c (struct ppc_link_hash_table): Add has_plt_localentry0.
2912 (ppc64_elf_merge_symbol_attribute): Merge localentry bits from
2913 dynamic objects.
2914 (is_elfv2_localentry0): New function.
2915 (ppc64_elf_tls_setup): Default params->plt_localentry0.
2916 (plt_stub_size): Adjust size for tls_get_addr_opt stub.
2917 (build_tls_get_addr_stub): Use a simpler stub when r2 is not saved.
2918 (ppc64_elf_size_stubs): Leave stub_type as ppc_stub_plt_call for
2919 optimized localentry:0 stubs.
2920 (ppc64_elf_build_stubs): Save r2 in ELFv2 __glink_PLTresolve.
2921 (ppc64_elf_relocate_section): Leave nop unchanged for optimized
2922 localentry:0 stubs.
2923 (ppc64_elf_finish_dynamic_sections): Set PPC64_OPT_LOCALENTRY in
2924 DT_PPC64_OPT.
2925 * elf64-ppc.h (struct ppc64_elf_params): Add plt_localentry0.
2926
8c65b54f
CS
29272017-05-30 Casey Smith <clegg89@gmail.com>
2928
2929 PR ld/21523
2930 * elf32-arm.c (elf32_arm_final_link_relocate): Install an absolute
2931 value when processing the R_ARM_THM_ALU_PREL_11_0 reloc.
2932
64984c22
AK
29332017-05-30 Anton Kolesov Anton.Kolesov@synopsys.com
2934
2935 * cpu-arc.c (arc_compatible): New function.
2936
37cd3877
AK
29372017-05-30 Anton Kolesov <anton.kolesov@synopsys.com>
2938
2939 * cpu-arc.c (arch_info_struct): Remove duplicate ARC600 entry.
2940
8e2f54bc
L
29412017-05-30 H.J. Lu <hongjiu.lu@intel.com>
2942
2943 PR binutils/21519
2944 * bfdio.c (bfd_get_file_size): New function.
2945 * bfd-in2.h: Regenerated.
2946
8e7f04f1 29472017-05-23 Dilian Palauzov <git-dpa@aegee.org>
2948
2949 * elf32-arc.c (arc_elf_merge_attributes): Add fall through
2950 comments.
2951
25f94347
L
29522017-05-22 H.J. Lu <hongjiu.lu@intel.com>
2953
2954 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Use
2955 dynobj instead of htab->elf.dynobj.
2956
e5713223
MR
29572017-05-19 Maciej W. Rozycki <macro@imgtec.com>
2958
2959 * elf64-mips.c (mips_elf64_canonicalize_reloc): Remove prototype
2960 and function.
2961 (mips_elf64_canonicalize_dynamic_reloc): Likewise.
2962 (mips_elf64_slurp_one_reloc_table): Set `reloc_count' to the
2963 actual number of internal relocations retrieved. Adjust
2964 function description.
2965 (bfd_elf64_canonicalize_reloc): Remove macro.
2966 (bfd_elf64_canonicalize_dynamic_reloc): Likewise.
2967
64517994
JM
29682017-05-19 Jose E. Marchesi <jose.marchesi@oracle.com>
2969
2970 * archures.c (bfd_mach_sparc_v9m8): Define.
2971 (bfd_mach_sparc_v8plusm8): Likewise.
2972 (bfd_mach_sparc_v9_p): Adjust to M8.
2973 (bfd_mach_sparc_64bit_p): Likewise.
2974 * aoutx.h (machine_type): Handle bfd_mach_sparc_v9m8 and
2975 bfd_mach_sparc_v8plusm8.
2976 * bfd-in2.h: Regenerated.
2977 * cpu-sparc.c (arch_info_struct): Entries for sparc:v9m8 and
2978 sparc:v8plusm8.
2979 * elfxx-sparc.c (_bfd_sparc_elf_object_p): Handle
2980 bfd_mach_sparc_v8plusm8 and bfd_mach_sparc_v9m8 using the new hw
2981 capabilities ONADDSUB, ONMUL, ONDIV, DICTUNP, FPCPSHL, RLE and
2982 SHA3.
2983 * elf32-sparc.c (elf32_sparc_final_write_processing): Handle
2984 bfd_mach_sparc_v8plusm8.
2985
eb026f09
AM
29862017-05-19 Alan Modra <amodra@gmail.com>
2987
2988 * elflink.c (_bfd_elf_gc_mark_extra_sections): Don't keep
2989 debug and special sections when no non-note alloc sections in an
2990 object are kept.
2991
535b785f
AM
29922017-05-18 Alan Modra <amodra@gmail.com>
2993
2994 * arc-got.h: Don't compare boolean values against TRUE or FALSE.
2995 * elf-m10300.c: Likewise.
2996 * elf.c: Likewise.
2997 * elf32-arc.c: Likewise.
2998 * elf32-bfin.c: Likewise.
2999 * elf32-m68k.c: Likewise.
3000 * elf32-nds32.c: Likewise.
3001 * elf32-tilepro.c: Likewise.
3002 * elflink.c: Likewise.
3003 * elfnn-aarch64.c: Likewise.
3004 * elfnn-riscv.c: Likewise.
3005 * elfxx-tilegx.c: Likewise.
3006 * mach-o.c: Likewise.
3007 * peXXigen.c: Likewise.
3008 * vms-alpha.c: Likewise.
3009 * vms-lib.c: Likewise.
3010
b7c871ed
L
30112017-05-17 H.J. Lu <hongjiu.lu@intel.com>
3012
3013 PR ld/20882
3014 * elflink.c (elf_gc_mark_debug_section): New function.
3015 (_bfd_elf_gc_mark_extra_sections): Mark any debug sections
3016 referenced by kept debug sections.
3017
bc4e12de
AM
30182017-05-16 Alan Modra <amodra@gmail.com>
3019
3020 * elf-m10300.c: Rename occurrences of non_ir_ref.
3021 * elf32-arm.c: Likewise.
3022 * elf32-bfin.c: Likewise.
3023 * elf32-cr16.c: Likewise.
3024 * elf32-cris.c: Likewise.
3025 * elf32-d10v.c: Likewise.
3026 * elf32-dlx.c: Likewise.
3027 * elf32-fr30.c: Likewise.
3028 * elf32-frv.c: Likewise.
3029 * elf32-hppa.c: Likewise.
3030 * elf32-i370.c: Likewise.
3031 * elf32-i386.c: Likewise.
3032 * elf32-iq2000.c: Likewise.
3033 * elf32-lm32.c: Likewise.
3034 * elf32-m32c.c: Likewise.
3035 * elf32-m32r.c: Likewise.
3036 * elf32-m68hc1x.c: Likewise.
3037 * elf32-m68k.c: Likewise.
3038 * elf32-mcore.c: Likewise.
3039 * elf32-metag.c: Likewise.
3040 * elf32-microblaze.c: Likewise.
3041 * elf32-moxie.c: Likewise.
3042 * elf32-msp430.c: Likewise.
3043 * elf32-mt.c: Likewise.
3044 * elf32-nios2.c: Likewise.
3045 * elf32-or1k.c: Likewise.
3046 * elf32-ppc.c: Likewise.
3047 * elf32-rl78.c: Likewise.
3048 * elf32-s390.c: Likewise.
3049 * elf32-score.c: Likewise.
3050 * elf32-score7.c: Likewise.
3051 * elf32-sh.c: Likewise.
3052 * elf32-tic6x.c: Likewise.
3053 * elf32-tilepro.c: Likewise.
3054 * elf32-v850.c: Likewise.
3055 * elf32-vax.c: Likewise.
3056 * elf32-xstormy16.c: Likewise.
3057 * elf32-xtensa.c: Likewise.
3058 * elf64-alpha.c: Likewise.
3059 * elf64-hppa.c: Likewise.
3060 * elf64-ia64-vms.c: Likewise.
3061 * elf64-mmix.c: Likewise.
3062 * elf64-ppc.c: Likewise.
3063 * elf64-s390.c: Likewise.
3064 * elf64-sh64.c: Likewise.
3065 * elf64-x86-64.c: Likewise.
3066 * elflink.c: Likewise.
3067 * elfnn-aarch64.c: Likewise.
3068 * elfnn-ia64.c: Likewise.
3069 * elfnn-riscv.c: Likewise.
3070 * elfxx-mips.c: Likewise.
3071 * elfxx-sparc.c: Likewise.
3072 * elfxx-tilegx.c: Likewise.
3073 * linker.c: Likewise.
3074
4070765b
AM
30752017-05-16 Alan Modra <amodra@gmail.com>
3076
3077 * elf64-ppc.c (add_symbol_adjust): Transfer non_ir_ref_dynamic.
3078 * elflink.c (elf_link_add_object_symbols): Update to use
3079 non_ir_ref_dynamic.
3080 (elf_link_input_bfd): Test non_ir_ref_dynamic in addition to
3081 non_ir_ref.
3082 * linker.c (_bfd_generic_link_add_one_symbol): Likewise.
3083
25499ac7
MR
30842017-05-15 Maciej W. Rozycki <macro@imgtec.com>
3085
3086 * elfxx-mips.c (print_mips_ases): Handle MIPS16e2 ASE.
3087
73caa85d
L
30882017-05-12 H.J. Lu <hongjiu.lu@intel.com>
3089
3090 * elf32-i386.c (elf_i386_parse_gnu_properties): Merge
3091 GNU_PROPERTY_X86_ISA_1_USED and GNU_PROPERTY_X86_ISA_1_NEEDED
3092 properties.
3093 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
3094
f2c29a16
L
30952017-05-11 H.J. Lu <hongjiu.lu@intel.com>
3096
3097 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Rename plt_bnd
3098 to plt_second.
3099 (elf_x86_64_link_hash_table): Rename plt_bnd/plt_bnd_eh_frame
3100 to plt_second/plt_second_eh_frame.
3101 (elf_x86_64_link_hash_newfunc): Updated.
3102 (elf_x86_64_allocate_dynrelocs): Likewise.
3103 (elf_x86_64_size_dynamic_sections): Likewise.
3104 (elf_x86_64_relocate_section): Likewise.
3105 (elf_x86_64_finish_dynamic_symbol): Likewise.
3106 (elf_x86_64_finish_dynamic_sections): Likewise.
3107 (elf_x86_64_plt_type): Rename plt_bnd to plt_second.
3108 (elf_x86_64_get_synthetic_symtab): Updated. Also scan the
3109 .plt.sec section.
3110 (elf_backend_setup_gnu_properties): Updated. Create the
3111 .plt.sec section instead of the .plt.sec section.
3112
dc2be3d2
L
31132017-05-11 H.J. Lu <hongjiu.lu@intel.com>
3114
3115 * elf32-i386.c (elf_i386_allocate_dynrelocs): Partially revert
3116 commit 25070364b0ce33eed46aa5d78ebebbec6accec7e.
3117 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewse.
3118
db84b98a
JM
31192017-05-10 Jose E. Marchesi <jose.marchesi@oracle.com>
3120
3121 * elf64-sparc.c (elf64_sparc_set_reloc): New function.
3122 (bfd_elf64_set_reloc): Define.
3123 (elf64_sparc_write_relocs): Use `canon_reloc_count'.
3124
23186865
JM
31252017-05-10 Jose E. Marchesi <jose.marchesi@oracle.com>
3126
3127 * targets.c (BFD_JUMP_TABLE_RELOCS): Add NAME##_set_reloc.
3128 (struct bfd_target): New field _bfd_set_reloc.
3129 * bfd.c (bfd_set_reloc): Call backend _set_bfd.
3130 * reloc.c (_bfd_generic_set_reloc): New function.
3131 * coffcode.h (coff_set_reloc): Define to _bfd_generic_set_reloc.
3132 * nlm-target.h (nlm_set_reloc): Likewise.
3133 * coff-rs6000.c (_bfd_xcoff_set_reloc): Likewise.
3134 * aout-tic30.c (MY_set_reloc): Likewise.
3135 * aout-target.h (MY_set_reloc): Likewise.
3136 * elfxx-target.h (bfd_elfNN_set_reloc): Likewise.
3137 * coff-alpha.c (_bfd_ecoff_set_reloc): Likewise.
3138 * mach-o-target.c (bfd_mach_o_set_reloc): Likewise.
3139 * vms-alpha.c (alpha_vms_set_reloc): Likewise.
3140 * aout-adobe.c (aout_32_set_reloc): Likewise.
3141 * bout.c (b_out_set_reloc): Likewise.
3142 * coff-mips.c (_bfd_ecoff_set_reloc): Likewise.
3143 * i386os9k.c (aout_32_set_reloc): Likewise.
3144 * ieee.c (ieee_set_reloc): Likewise.
3145 * oasys.c (oasys_set_reloc): Likewise.
3146 * som.c (som_set_reloc): Likewise.
3147 * versados.c (versados_set_reloc): Likewise.
3148 * coff64-rs6000.c (rs6000_xcoff64_vec): Add
3149 _bfd_generic_set_reloc.
3150 (rs6000_xcoff64_aix_vec): LIkewise.
3151 * libbfd.c (_bfd_norelocs_set_reloc): New function.
3152 * libbfd-in.h: Prototype for _bfd_norelocs_set_reloc.
3153 * i386msdos.c (msdos_set_reloc): Define to
3154 _bfd_norelocs_set_reloc.
3155 * elfcode.h (elf_set_reloc): Define.
3156 * bfd-in2.h: Regenerated.
3157
aab82f4c
L
31582017-05-10 H.J. Lu <hongjiu.lu@intel.com>
3159
3160 PR ld/21481
3161 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Use .plt.bnd
3162 for IFUNC function address.
3163
53a346d8
CZ
31642017-05-10 Claudiu Zissulescu <claziss@synopsys.com>
3165
3166 * elf32-arc.c (FEATURE_LIST_NAME): Define.
3167 (CONFLICT_LIST): Likewise.
3168 (opcode/arc-attrs.h): Include.
3169 (arc_elf_print_private_bfd_data): Print OSABI v4 flag.
3170 (arc_extract_features): New file.
3171 (arc_stralloc): Likewise.
3172 (arc_elf_merge_attributes): Likewise.
3173 (arc_elf_merge_private_bfd_data): Use object attributes.
3174 (bfd_arc_get_mach_from_attributes): New function.
3175 (arc_elf_object_p): Use object attributes.
3176 (arc_elf_final_write_processing): Likewise.
3177 (elf32_arc_obj_attrs_arg_type): New function.
3178 (elf32_arc_obj_attrs_handle_unknown): Likewise.
3179 (elf32_arc_section_from_shdr): Likewise.
3180 (elf_backend_obj_attrs_vendor): Define.
3181 (elf_backend_obj_attrs_section): Likewise.
3182 (elf_backend_obj_attrs_arg_type): Likewise.
3183 (elf_backend_obj_attrs_section_type): Likewise.
3184 (elf_backend_obj_attrs_handle_unknown): Likewise.
3185 (elf_backend_section_from_shdr): Likewise.
3186
e645cf40
AG
31872017-05-09 Andrew Goedhart <Andrewgoedhart@simplepowersolutions.co.za>
3188
3189 PR ld/21458
3190 * elf32-arm.c (elf32_arm_final_link_relocate): Set the bottom bit
3191 of the value when resolving a R_ARM_THM_ALU_PREL_11_0 relocation
3192 and the destination is a Thumb symbol.
3193
dd9e66ee
L
31942017-05-08 H.J. Lu <hongjiu.lu@intel.com>
3195
3196 * elf32-i386.c (elf_i386_get_synthetic_symtab): Add missing
3197 initializer to silence GCC 4.2.
3198 * lf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
3199
38b12349
L
32002017-05-08 H.J. Lu <hongjiu.lu@intel.com>
3201
3202 * elf64-x86-64.c (PLT_ENTRY_SIZE): Renamed to ...
3203 (LAZY_PLT_ENTRY_SIZE): This.
3204 (NON_LAZY_PLT_ENTRY_SIZE): New.
3205 (elf_x86_64_plt0_entry): Renamed to ...
3206 (elf_x86_64_lazy_plt0_entry): This.
3207 (elf_x86_64_plt_entry): Renamed to ...
3208 (elf_x86_64_lazy_plt_entry): This.
3209 (elf_x86_64_bnd_plt0_entry): Renamed to ...
3210 (elf_x86_64_lazy_bnd_plt0_entry): This.
3211 (elf_x86_64_legacy_plt_entry): Removed.
3212 (elf_x86_64_bnd_plt_entry): Renamed to ...
3213 (elf_x86_64_lazy_bnd_plt_entry): This.
3214 (elf_x86_64_legacy_plt2_entry): Renamed to ...
3215 (elf_x86_64_non_lazy_plt_entry): This.
3216 (elf_x86_64_bnd_plt2_entry): Renamed to ...
3217 (elf_x86_64_non_lazy_bnd_plt_entry): This.
3218 (elf_x86_64_eh_frame_plt): Renamed to ...
3219 (elf_x86_64_eh_frame_lazy_plt): This.
3220 (elf_x86_64_eh_frame_bnd_plt): Renamed to ...
3221 (elf_x86_64_eh_frame_lazy_bnd_plt): This.
3222 (elf_x86_64_eh_frame_plt_got): Renamed to ...
3223 (elf_x86_64_eh_frame_non_lazy_plt): This.
3224 (elf_x86_64_lazy_plt_layout): New.
3225 (elf_x86_64_non_lazy_plt_layout): Likewise.
3226 (elf_x86_64_plt_layout): Likewise.
3227 (elf_x86_64_backend_data): Remove PLT layout information. Add
3228 os for target system.
3229 (GET_PLT_ENTRY_SIZE): Removed.
3230 (elf_x86_64_lazy_plt): New.
3231 (elf_x86_64_non_lazy_plt): Likewise.
3232 (elf_x86_64_lazy_bnd_plt): Likewise.
3233 (elf_x86_64_non_lazy_bnd_plt): Likewise.
3234 (elf_x86-64_arch_bed): Updated.
3235 (elf_x86_64_link_hash_table): Add plt, lazy_plt and non_lazy_plt.
3236 (elf_x86_64_create_dynamic_sections): Removed.
3237 (elf_x86_64_check_relocs): Don't check elf.dynobj. Don't call
3238 _bfd_elf_create_ifunc_sections nor _bfd_elf_create_got_section.
3239 (elf_x86-64_adjust_dynamic_symbol): Updated.
3240 (elf_x86_64_allocate_dynrelocs): Updated. Pass 0 as PLT header
3241 size to _bfd_elf_allocate_ifunc_dyn_relocs and don't allocate
3242 size for PLT0 if there is no PLT0. Get plt_entry_size from
3243 non_lazy_plt for non-lazy PLT entries.
3244 (elf_x86_64_size_dynamic_sections): Updated. Get plt_entry_size
3245 from non_lazy_plt for non-lazy PLT entries.
3246 (elf_x86-64_relocate_section): Updated. Properly get PLT index
3247 if there is no PLT0.
3248 (elf_x86_64_finish_dynamic_symbol): Updated. Fill the first slot
3249 in the PLT entry with generic PLT layout. Fill the non-lazy PLT
3250 entries with non-lazy PLT layout. Don't fill the second and third
3251 slots in the PLT entry if there is no PLT0.
3252 (elf_x86_64_finish_dynamic_sections): Updated. Don't fill PLT0
3253 if there is no PLT0. Set sh_entsize on the .plt.got section.
3254 (compare_relocs): New.
3255 (elf_x86_64_plt_type): Likewise.
3256 (elf_x86_64_plt): Likewise.
3257 (elf_x86_64_nacl_plt): New. Forward declaration.
3258 (elf_x86_64_get_plt_sym_val): Removed.
3259 (elf_x86_64_get_synthetic_symtab): Rewrite to check PLT sections
3260 against all dynamic relocations.
3261 (elf_x86_64_link_setup_gnu_properties): New function.
3262 (elf_backend_create_dynamic_sections): Updated.
3263 (elf_backend_setup_gnu_properties): New.
3264 (elf_x86_64_nacl_plt): New.
3265 (elf_x86_64_nacl_arch_bed): Updated.
3266
f604c2a2
L
32672017-05-08 H.J. Lu <hongjiu.lu@intel.com>
3268
3269 * elf32-i386.c (PLT_ENTRY_SIZE): Renamed to ...
3270 (LAZY_PLT_ENTRY_SIZE): This.
3271 (NON_LAZY_PLT_ENTRY_SIZE): New.
3272 (elf_i386_plt0_entry): Renamed to ...
3273 (elf_i386_lazy_plt0_entry): This.
3274 (elf_i386_plt_entry): Renamed to ...
3275 (elf_i386_lazy_plt_entry): This.
3276 (elf_i386_pic_plt0_entry): Renamed to ...
3277 (elf_i386_pic_lazy_plt0_entry): This.
3278 (elf_i386_pic_plt_entry): Renamed to ...
3279 (elf_i386_pic_lazy_plt_entry): This.
3280 (elf_i386_got_plt_entry): Renamed to ...
3281 (elf_i386_non_lazy_plt_entry): This.
3282 (elf_i386_pic_got_plt_entry): Renamed to ...
3283 (elf_i386_pic_non_lazy_plt_entry): This.
3284 (elf_i386_eh_frame_plt): Renamed to ...
3285 (elf_i386_eh_frame_lazy_plt): This.
3286 (elf_i386_eh_frame_plt_got): Renamed to ...
3287 (elf_i386_eh_frame_non_lazy_plt): This.
3288 (elf_i386_plt_layout): Renamed to ...
3289 (elf_i386_lazy_plt_layout): This. Remove eh_frame_plt_got and
3290 eh_frame_plt_got_size.
3291 (elf_i386_non_lazy_plt_layout): New.
3292 (elf_i386_plt_layout): Likewise.
3293 (elf_i386_non_lazy_plt): Likewise.
3294 (GET_PLT_ENTRY_SIZE): Removed.
3295 (elf_i386_plt): Renamed to ...
3296 (elf_i386_lazy_plt): This.
3297 (elf_i386_backend_data): Remove plt. Rename is_vxworks to os.
3298 (elf_i386_arch_bed): Updated.
3299 (elf_i386_link_hash_table): Add plt, lazy_plt and non_lazy_plt.
3300 (elf_i386_create_dynamic_sections): Removed.
3301 (elf_i386_check_relocs): Don't check elf.dynobj. Don't call
3302 _bfd_elf_create_ifunc_sections nor _bfd_elf_create_got_section.
3303 (elf_i386_adjust_dynamic_symbol): Updated.
3304 (elf_i386_allocate_dynrelocs): Updated. Pass 0 as PLT header
3305 size to _bfd_elf_allocate_ifunc_dyn_relocs and don't allocate
3306 size for PLT0 if there is no PLT0.
3307 (elf_i386_size_dynamic_sections): Updated. Check whether GOT
3308 output section is discarded only if GOT isn't empty.
3309 (elf_i386_relocate_section): Updated. Properly get PLT index
3310 if there is no PLT0.
3311 (elf_i386_finish_dynamic_symbol): Updated. Don't fill the
3312 second and third slots in the PLT entry if there is no PLT0.
3313 (elf_i386_finish_dynamic_sections): Updated. Don't fill PLT0
3314 if there is no PLT0. Set sh_entsize on the .plt.got section.
3315 (elf_i386_nacl_plt): Forward declaration.
3316 (elf_i386_get_plt_sym_val): Removed.
3317 (elf_i386_get_synthetic_symtab): Rewrite to check PLT sections
3318 against all dynamic relocations.
3319 (elf_i386_link_setup_gnu_properties): New function.
3320 (elf_backend_create_dynamic_sections): Updated.
3321 (elf_backend_setup_gnu_properties): New.
3322 (elf_i386_nacl_plt): Updated.
3323 (elf_i386_nacl_arch_bed): Likewise.
3324 (elf_i386_vxworks_arch_bed): Likewise.
3325
046734ff
TP
33262017-05-08 Thomas Preud'homme <thomas.preudhomme@arm.com>
3327
3328 * elflink.c (elf_output_implib): Remove executable flag from import
3329 library bfd.
3330 * elf32-arm.c (elf32_arm_filter_implib_symbols): Assert that the import
3331 library is a relocatable object file.
3332
b660e9eb
SKS
33332017-05-01 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
3334
3335 PR ld/21404
3336 * elf32-avr.c (avr_should_move_sym): New function.
3337 (avr_should_reduce_sym_size): Likewise.
3338 (avr_should_increase_sym_size): Likewise.
3339 (elf32_avr_relax_delete_bytes): Adjust symbol values
3340 and sizes by calling new functions.
3341
763a5fa4
PD
33422017-05-01 Palmer Dabbelt <palmer@dabbelt.com>
3343
3344 * config.bfd (riscv32-*): Enable rv64.
3345
73ec947d
AM
33462017-05-02 Alan Modra <amodra@gmail.com>
3347
3348 PR 21384
3349 * elflink.c (bfd_elf_link_mark_dynamic_symbol): Test h->non_elf
3350 rather than h->root.type == bfd_link_hash_new.
3351 (bfd_elf_record_link_assignment): Similarly, call
3352 bfd_elf_link_mark_dynamic_symbol when h->non_elf.
3353
a941291c
AM
33542017-04-29 Alan Modra <amodra@gmail.com>
3355
3356 PR 21432
3357 * reloc.c (reloc_offset_in_range): New function.
3358 (bfd_perform_relocation, bfd_install_relocation): Use it.
3359 (_bfd_final_link_relocate): Likewise.
3360
750eaa47
L
33612017-04-28 H.J. Lu <hongjiu.lu@intel.com>
3362
3363 * elf32-i386.c (elf_i386_allocate_dynrelocs): Check plt_got
3364 before using .plt.got.
3365 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise.
3366
5b66fac4
L
33672017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3368
3369 * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Use "="
3370 instead of "+=" to update 0.
3371
de9a3c42
L
33722017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3373
3374 * elf32-i386.c (elf_i386_create_dynamic_sections): Create the
3375 .plt.got section here.
3376 (elf_i386_check_relocs): Don't create the .plt.got section.
3377 * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Create
3378 the .plt.got and .plt.bnd sections here.
3379 (elf_x86_64_check_relocs): Don't create the .plt.got nor
3380 .plt.bnd sections.
3381
da3d25af
L
33822017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3383
3384 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Remove
3385 has_bnd_reloc.
3386 (elf_x86_64_link_hash_newfunc): Don't clear has_bnd_reloc.
3387 (elf_x86_64_copy_indirect_symbol): Don't copy has_bnd_reloc.
3388 (elf_x86_64_check_relocs): Don't set has_bnd_reloc.
3389 (elf_x86_64_finish_dynamic_symbol): Check bndplt instead of
3390 has_bnd_reloc.
3391
fba37edd
L
33922017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3393
3394 * elf-bfd.h (elf_backend_data): Change setup_gnu_properties
3395 to return bfd *.
3396 (_bfd_elf_link_setup_gnu_properties): Return bfd *.
3397 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Return
3398 the first relocatable ELF input with GNU properties.
3399
1f78f649
L
34002017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3401
3402 * elf32-i386.c (elf_i386_finish_dynamic_sections): Simplify
3403 VxWorks for non-PIC.
3404
76c20d54
AM
34052017-04-27 Alan Modra <amodra@gmail.com>
3406
3407 * elf-bfd.h (struct elf_backend_data): Make asection param of
3408 elf_backend_eh_frame_address_size const.
3409 (_bfd_elf_eh_frame_address_size): Likewise.
3410 * elf32-m32c.c (_bfd_m32c_elf_eh_frame_address_size): Likewise.
3411 * elf32-msp430.c (elf32_msp430_eh_frame_address_size): Likewise.
3412 * elfxx-mips.c (_bfd_mips_elf_eh_frame_address_size): Likewise.
3413 * elfxx-mips.h (_bfd_mips_elf_eh_frame_address_size): Likewise.
3414 * elf-eh-frame.c (_bfd_elf_eh_frame_address_size): Likewise.
3415 (next_cie_fde_offset): Constify params.
3416 (offset_adjust, adjust_eh_frame_local_symbols): Likewise.
3417
d7153c4a
AM
34182017-04-27 Alan Modra <amodra@gmail.com>
3419
3420 * elf-bfd.h (struct eh_cie_fde): Add aug_str_len and aug_data_len.
3421 (_bfd_elf_adjust_eh_frame_global_symbol): Declare.
3422 * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Set aug_str_len and
3423 aug_data_len.
3424 (offset_adjust): New function.
3425 (_bfd_elf_adjust_eh_frame_global_symbol): Likewise.
3426 (adjust_eh_frame_local_symbols): Likewise.
3427 (_bfd_elf_discard_section_eh_frame): Call adjust_eh_frame_local_symbols
3428 after changing anything. Return true if anything changed.
3429 * elflink.c (bfd_elf_discard_info): If .eh_frame changed, call
3430 _bfd_elf_adjust_eh_frame_global_symbol for globals.
3431
641338d8
AM
34322017-04-27 Alan Modra <amodra@gmail.com>
3433
3434 * elflink.c (_bfd_elf_link_hash_hide_symbol): Clear dynstr_index
3435 when force_local.
3436
21d68fcd
AM
34372017-04-27 Alan Modra <amodra@gmail.com>
3438
3439 * elf32-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
3440 (ppc_elf_select_plt_layout, ppc_elf_tls_setup): Use it.
3441 (ppc_elf_adjust_dynamic_symbol, allocate_dynrelocs): Likewise.
3442 (ppc_elf_relocate_section): Likewise. Delete silly optimisation
3443 for undef and undefweak dyn_relocs.
3444 * elf64-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
3445 (ppc64_elf_adjust_dynamic_symbol, ppc64_elf_tls_setup): Use it.
3446 (allocate_got, allocate_dynrelocs): Likewise.
3447 (ppc64_elf_relocate_section): Likewise.
3448
97d343d4
L
34492017-04-26 H.J. Lu <hongjiu.lu@intel.com>
3450
3451 * elf32-i386.c (elf_i386_size_dynamic_sections): Alwasys add
3452 DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rel.plt section.
3453 * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Alwasys
3454 add DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rela.plt section.
3455
04b31182
NC
34562017-04-26 Nick Clifton <nickc@redhat.com>
3457
3458 PR binutils/21434
3459 * reloc.c (bfd_perform_relocation): Check for a negative address
3460 in the reloc.
3461
23ec1e32
MR
34622017-04-26 Maciej W. Rozycki <macro@imgtec.com>
3463
3464 PR ld/21334
3465 * elf-bfd.h (elf_backend_data): Add `always_renumber_dynsyms'
3466 member.
3467 * elfxx-target.h [!elf_backend_always_renumber_dynsyms]
3468 (elf_backend_always_renumber_dynsyms): Define.
3469 (elfNN_bed): Initialize `always_renumber_dynsyms' member.
3470 * elfxx-mips.h (elf_backend_always_renumber_dynsyms): Define.
3471 * elflink.c (bfd_elf_size_dynamic_sections): Also call
3472 `_bfd_elf_link_renumber_dynsyms' if the backend has requested
3473 it.
3474 (bfd_elf_size_dynsym_hash_dynstr): Likewise.
3475
c46cec3a
MR
34762017-04-26 Maciej W. Rozycki <macro@imgtec.com>
3477
3478 * elflink.c (bfd_elf_size_dynamic_sections): Only call
3479 `_bfd_elf_link_renumber_dynsyms' after section GC if dynamic
3480 sections have been created.
3481
e63d1232
NC
34822017-04-26 Nick Clifton <nickc@redhat.com>
3483
3484 PR binutils/21431
3485 * compress.c (bfd_init_section_compress_status): Check the return
3486 value from bfd_malloc.
3487
9e9821dd
L
34882017-04-24 H.J. Lu <hongjiu.lu@intel.com>
3489
3490 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Add
3491 no_finish_dynamic_symbol.
3492 (elf_x86_64_link_hash_newfunc): Set no_finish_dynamic_symbol to
3493 0.
3494 (elf_x86_64_allocate_dynrelocs): If a symbol isn't undefined
3495 weak symbol, don't make it dynamic.
3496 (elf_x86_64_relocate_section): If a symbol isn't dynamic in PIC,
3497 set no_finish_dynamic_symbol and generate R_X86_64_RELATIVE
3498 relocation for GOT reference.
3499 (elf_x86_64_finish_dynamic_symbol): Abort if
3500 no_finish_dynamic_symbol isn't 0.
3501
0dc9a308
L
35022017-04-24 H.J. Lu <hongjiu.lu@intel.com>
3503
3504 PR ld/21402
3505 * elf32-i386.c (elf_i386_allocate_dynrelocs): If a symbol isn't
3506 undefined weak symbol, don't make it dynamic.
3507 (elf_i386_relocate_section): If a symbol isn't dynamic in PIC,
3508 set no_finish_dynamic_symbol and generate R_386_RELATIVE
3509 relocation for R_386_GOT32.
3510
1587442d
L
35112017-04-24 H.J. Lu <hongjiu.lu@intel.com>
3512
3513 PR ld/21425
3514 * elf32-i386.c (ELF_MAXPAGESIZE): Set to 0x1000 for VxWorks.
3515
7eacd66b
AM
35162017-04-23 Alan Modra <amodra@gmail.com>
3517
3518 PR 21414
3519 * section.c (GLOBAL_SYM_INIT): Make available in bfd.h.
3520 * elf.c (lcomm_sym): New.
3521 (_bfd_elf_large_com_section): Use lcomm_sym section symbol.
3522 * bfd-in2.h: Regenerate.
3523
bce964aa
AM
35242017-04-23 Alan Modra <amodra@gmail.com>
3525
3526 PR 21412
3527 * elf-bfd.h (struct elf_backend_data <get_reloc_section>): Change
3528 parameters and comment.
3529 (_bfd_elf_get_reloc_section): Delete.
3530 (_bfd_elf_plt_get_reloc_section): Declare.
3531 * elf.c (_bfd_elf_plt_get_reloc_section, elf_get_reloc_section):
3532 New functions. Don't blindly skip over assumed .rel/.rela prefix.
3533 Extracted from..
3534 (_bfd_elf_get_reloc_section): ..here. Delete.
3535 (assign_section_numbers): Call elf_get_reloc_section.
3536 * elf64-ppc.c (elf_backend_get_reloc_section): Define.
3537 * elfxx-target.h (elf_backend_get_reloc_section): Update.
3538
97e83a10
AM
35392017-04-23 Alan Modra <amodra@gmail.com>
3540
3541 PR 21409
3542 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Don't segfault when
3543 no symbols.
3544
e133d005
L
35452017-04-21 H.J. Lu <hongjiu.lu@intel.com>
3546
3547 PR ld/21402
3548 * elf32-i386.c (elf_i386_link_hash_entry): Add
3549 no_finish_dynamic_symbol.
3550 (elf_i386_link_hash_newfunc): Set no_finish_dynamic_symbol to 0.
3551 (elf_i386_allocate_dynrelocs): If a symbol isn't undefined weak
3552 symbol, don't make it dynamic in PIE.
3553 (elf_i386_relocate_section): If a symbol isn't dynamic in PIE,
3554 set no_finish_dynamic_symbol and generate R_386_RELATIVE
3555 relocation for R_386_GOT32
3556 (elf_i386_finish_dynamic_symbol): Abort if no_finish_dynamic_symbol
3557 isn't 0.
3558
3c5fce9b
L
35592017-04-21 H.J. Lu <hongjiu.lu@intel.com>
3560
3561 PR ld/19617
3562 PR ld/21086
3563 * elflink.c (elf_link_add_object_symbols): Require
3564 --no-dynamic-linker with -E/--dynamic-list when creating
3565 dynamic sections.
3566
0fad2956
MR
35672017-04-20 Maciej W. Rozycki <macro@imgtec.com>
3568
3569 * elflink.c (_bfd_elf_symbol_refs_local_p): Always return TRUE
3570 if forced local.
3571
64575f78
MR
35722017-04-20 Maciej W. Rozycki <macro@imgtec.com>
3573
3574 * elfxx-mips.c (_bfd_mips_elf_final_link): Reorder comment about
3575 dynamic symbol sorting.
3576
59fa66c5
L
35772017-04-20 H.J. Lu <hongjiu.lu@intel.com>
3578
3579 PR ld/21382
3580 * elflink.c (elf_link_add_object_symbols): Preserve
3581 dynamic_ref_after_ir_def when restoring the symbol table for
3582 unneeded dynamic object.
3583
e492d2f8
L
35842017-04-19 H.J. Lu <hongjiu.lu@intel.com>
3585
3586 PR ld/21401
3587 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Don't abort
3588 on on undefined IFUNC symbol in the second PLT.
3589
10169134
WAF
35902017-04-19 Wedson Almeida Filho <wedsonaf@gmail.com>
3591
3592 * peXXigen.c (pe_print_reloc): Correct chunk_end.
3593
954b63d4
AM
35942017-04-19 Alan Modra <amodra@gmail.com>
3595
3596 * elflink.c (_bfd_elf_adjust_dynamic_symbol): Hide undefweak
3597 or make dynamic for info->dynamic_undefined_weak 0 and 1.
3598 * elf32-ppc.c:Formatting.
3599 (ensure_undefweak_dynamic): Don't make dynamic when
3600 info->dynamic_undefined_weak is zero.
3601 (allocate_dynrelocs): Discard undefweak dyn_relocs for
3602 info->dynamic_undefined_weak. Discard undef dyn_relocs when
3603 not default visibility. Discard undef and undefweak
3604 dyn_relocs earlier.
3605 (ppc_elf_relocate_section): Adjust to suit.
3606 * elf64-ppc.c: Formatting.
3607 (ensure_undefweak_dynamic): Don't make dynamic when
3608 info->dynamic_undefined_weak is zero.
3609 (allocate_dynrelocs): Discard undefweak dyn_relocs for
3610 info->dynamic_undefined_weak. Discard them earlier.
3611
e6699019
L
36122017-04-17 H.J. Lu <hongjiu.lu@intel.com>
3613
3614 PR ld/21389
3615 * elflink.c (bfd_elf_size_dynamic_sections): Get soname index
3616 before generating the version definition section.
3617
c5d37467
AM
36182017-04-17 Alan Modra <amodra@gmail.com>
3619
3620 * elflink.c (_bfd_elf_merge_symbol): Undo dynamic linking
3621 state when a regular object file defines a symbol with
3622 incompatible type to that defined by an earlier shared lib.
3623
63a5468a
AM
36242017-04-13 Alan Modra <amodra@gmail.com>
3625
3626 * coffcode.h: Wrap some overly long _bfd_error_handler args.
3627 * elf.c: Likewise.
3628 * elf32-arm.c: Likewise.
3629 * elf32-i386.c: Likewise.
3630 * elf32-mep.c: Likewise.
3631 * elf64-ia64-vms.c: Likewise.
3632 * elf64-x86-64.c: Likewise.
3633 * elflink.c: Likewise.
3634 * elfnn-ia64.c: Likewise.
3635 * elfxx-mips.c: Likewise.
3636
dae82561
AM
36372017-04-13 Alan Modra <amodra@gmail.com>
3638
3639 * aoutx.h: Use %B and %A in error messages throughout file.
3640 * aout-cris.c: Likewise.
3641 * archive.c: Likewise.
3642 * binary.c: Likewise.
3643 * coff-rs6000.c: Likewise.
3644 * coff-tic4x.c: Likewise.
3645 * coffcode.h: Likewise.
3646 * coffgen.c: Likewise.
3647 * cofflink.c: Likewise.
3648 * coffswap.h: Likewise.
3649 * cpu-arm.c: Likewise.
3650 * elf-eh-frame.c: Likewise.
3651 * elf-m10300.c: Likewise.
3652 * elf.c: Likewise.
3653 * elf32-arc.c: Likewise.
3654 * elf32-arm.c: Likewise.
3655 * elf32-bfin.c: Likewise.
3656 * elf32-frv.c: Likewise.
3657 * elf32-iq2000.c: Likewise.
3658 * elf32-m32c.c: Likewise.
3659 * elf32-microblaze.c: Likewise.
3660 * elf32-nds32.c: Likewise.
3661 * elf32-rl78.c: Likewise.
3662 * elf32-rx.c: Likewise.
3663 * elf32-score.c: Likewise.
3664 * elf32-score7.c: Likewise.
3665 * elf32-sh64.c: Likewise.
3666 * elf32-v850.c: Likewise.
3667 * elf32-vax.c: Likewise.
3668 * elf32-visium.c: Likewise.
3669 * elf64-ia64-vms.c: Likewise.
3670 * elf64-mmix.c: Likewise.
3671 * elf64-sh64.c: Likewise.
3672 * elfcode.h: Likewise.
3673 * elfnn-aarch64.c: Likewise.
3674 * elfnn-ia64.c: Likewise.
3675 * elfxx-mips.c: Likewise.
3676 * hpux-core.c: Likewise.
3677 * ieee.c: Likewise.
3678 * ihex.c: Likewise.
3679 * linker.c: Likewise.
3680 * merge.c: Likewise.
3681 * mmo.c: Likewise.
3682 * oasys.c: Likewise.
3683 * pdp11.c: Likewise.
3684 * peXXigen.c: Likewise.
3685 * rs6000-core.c: Likewise.
3686 * vms-alpha.c: Likewise.
3687 * xcofflink.c: Likewise.
3688
c08bb8dd
AM
36892017-04-13 Alan Modra <amodra@gmail.com>
3690
3691 * bfd.c (PRINT_TYPE): Define.
3692 (_doprnt): New function.
3693 (error_handler_internal): Use _doprnt.
3694 * coff-arm.c: Put %A and %B arguments to _bfd_error_handler
3695 calls in their natural order, throughout file.
3696 * coff-mcore.c: Likewise.
3697 * coff-ppc.c: Likewise.
3698 * coff-tic80.c: Likewise.
3699 * cofflink.c: Likewise.
3700 * elf-s390-common.c: Likewise.
3701 * elf.c: Likewise.
3702 * elf32-arm.c: Likewise.
3703 * elf32-i386.c: Likewise.
3704 * elf32-m32r.c: Likewise.
3705 * elf32-msp430.c: Likewise.
3706 * elf32-spu.c: Likewise.
3707 * elf64-ia64-vms.c: Likewise.
3708 * elf64-sparc.c: Likewise.
3709 * elf64-x86-64.c: Likewise.
3710 * elflink.c: Likewise.
3711 * elfnn-aarch64.c: Likewise.
3712 * elfnn-ia64.c: Likewise.
3713 * elfxx-mips.c: Likewise.
3714
10463f39
AM
37152017-04-13 Alan Modra <amodra@gmail.com>
3716
3717 * elf32-arm.c (arm_type_of_stub): Supply missing args to "long
3718 branch veneers" error. Fix double space and format message.
3719 * elf32-avr.c (avr_add_stub): Do not pass NULL as %B arg.
3720 * elf64-ppc.c (tocsave_find): Supply missing %B arg.
3721
4af8774e
AM
37222017-04-13 Alan Modra <amodra@gmail.com>
3723
3724 * bfd-in2.h: Regenerate.
3725
e4097f5e
L
37262017-04-11 H.J. Lu <hongjiu.lu@intel.com>
3727
3728 * elf-properties.c (_bfd_elf_parse_gnu_properties): Remove the
3729 extra `\n' in warning/error messages.
3730 * elf32-i386.c (elf_i386_parse_gnu_properties): Likewise.
3731 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
3732
537616aa
L
37332017-04-11 H.J. Lu <hongjiu.lu@intel.com>
3734
3735 * elf-properties.c (_bfd_elf_parse_gnu_properties): Ignore
3736 processor-specific properties with generic ELF target vector.
3737
bb1dd176
QZ
37382017-04-10 Qing Zhao <qing.zhao@oracle.com>
3739
3740 * elf32-sparc.c (elf_backend_fixup_symbol): New.
3741 * elf64-sparc.c (elf_backend_fixup_symbol): New.
3742 * elfxx-sparc.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): New.
3743 (_bfd_sparc_elf_link_hash_entry): Add has_got_reloc and
3744 has_non_got_reloc.
3745 (link_hash_newfunc): Initialize has_got_reloc and
3746 has_non_got_reloc.
3747 (_bfd_sparc_elf_size_dynamic_sections): Set interp to .interp
3748 section.
3749 (_bfd_sparc_elf_copy_indirect_symbol): Copy has_got_reloc and
3750 has_non_got_reloc.
3751 (_bfd_sparc_elf_check_relocs): Set has_got_reloc and
3752 has_non_got_reloc.
3753 (_bfd_sparc_elf_fixup_symbol): New function.
3754 (allocate_dynrelocs): Don't allocate space for dynamic
3755 relocations and discard relocations against resolved undefined
3756 weak symbols in executable. Don't make resolved undefined weak
3757 symbols in executable dynamic. Keep dynamic non-GOT/non-PLT
3758 relocation against undefined weak symbols in PIE.
3759 (_bfd_sparc_elf_relocate_section): Don't generate dynamic
3760 relocations against resolved undefined weak symbols in PIE
3761 (_bfd_sparc_elf_finish_dynamic_symbol): Keep PLT/GOT entries
3762 without ynamic PLT/GOT relocations for resolved undefined weak
3763 symbols.
3764 Don't generate dynamic relocation against resolved undefined
3765 weak symbol in executable.
3766 (pie_finish_undefweak_symbol): New function.
3767 (_bfd_sparc_elf_finish_dynamic_sections): Call
3768 pie_finish_undefweak_symbol on all symbols in PIE.
3769 * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Add interp.
3770 (_bfd_sparc_elf_fixup_symbol): New function.
3771
d236cfd4
NC
37722017-04-10 Nick Clifton <nickc@redhat.com>
3773
3774 * config.bfd: Remove ns32k from obsolete list.
3775
6f9dbcd4
AM
37762017-04-10 Alan Modra <amodra@gmail.com>
3777
3778 PR 21287
3779 * elf.c (special_sections_f): Match .fini_array and .fini_array.*.
3780 (special_sections_i): Likewise for .init_array.
3781 (special_sections_p): Likewise for .preinit_array.
3782
8170f769
L
37832017-04-07 H.J. Lu <hongjiu.lu@intel.com>
3784
3785 PR ld/19579
3786 PR ld/21306
3787 * elf32-s390.c (elf_s390_finish_dynamic_symbol): Check
3788 ELF_COMMON_DEF_P for common symbols.
3789 * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
3790 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
3791 * elflink.c (_bfd_elf_merge_symbol): Revert commits
3792 202ac193bbbecc96a4978d1ac3d17148253f9b01 and
3793 07492f668d2173da7a2bda3707ff0985e0f460b6.
3794
49f4617b
PA
37952017-04-07 Pedro Alves <palves@redhat.com>
3796
3797 * opncls.c (bfd_get_debug_link_info): Rename to...
3798 (bfd_get_debug_link_info_1): ... this. Change type of second
3799 parameter to void pointer. Adjust.
3800 (bfd_get_debug_link_info): Reimplement on top of
3801 bfd_get_debug_link_info_1.
3802 (separate_debug_file_exists, separate_alt_debug_file_exists):
3803 Change type of second parameter to void pointer. Adjust.
3804 (get_func_type, check_func_type): Change type of second parameter
3805 to void pointer.
3806 (find_separate_debug_file): Add 'func_data' parameter. Pass it to
3807 the callback functions instead of passing the address of a local.
3808 (bfd_follow_gnu_debuglink): Pass address of unsigned long local to
3809 find_separate_debug_file.
3810 (get_alt_debug_link_info_shim): Change type of second parameter to
3811 void pointer. Adjust.
3812 (bfd_follow_gnu_debugaltlink): Adjust to pass NULL to
3813 find_separate_debug_file.
3814 (get_build_id_name, bfd_boolean check_build_id_file): Change type
3815 of second parameter to void pointer. Adjust.
3816 (bfd_follow_build_id_debuglink): Pass address of bfd_build_id
3817 pointer local to find_separate_debug_file.
3818
38192017-04-07 Tristan Gingold <gingold@gingold-Precision-7510>
1fd6d111
TG
3820
3821 * coffgen.c (_bfd_coff_gc_mark_hook): Handle PE weak
3822 external symbols with a definition.
3823 (_bfd_coff_gc_mark_extra_sections): Fix typo.
3824
86abf93a
AM
38252017-04-07 Alan Modra <amodra@gmail.com>
3826
3827 * po/SRC-POTFILES.in: Regenerate.
3828
8dea77f0
AM
38292017-04-05 Alan Modra <amodra@gmail.com>
3830
3831 * elf64-ppc.c (ppc64_elf_gc_sweep_hook): Support ELFv2 PLT
3832 reference counting.
3833
477bdd39
JT
38342017-04-02 Jon Turney <jon.turney@dronecode.org.uk>
3835
3836 (_bfd_XXi_swap_aouthdr_out): For clarity, use defines rather than
3837 numbers for DataDirectory entry indicies passed to
3838 add_data_entry().
3839
a91e1603
L
38402017-04-04 H.J. Lu <hongjiu.lu@intel.com>
3841
3842 * elf.c (get_program_header_size): Add a GNU_MBIND segment for
3843 each GNU_MBIND section and align GNU_MBIND section to page size.
3844 (_bfd_elf_map_sections_to_segments): Create a GNU_MBIND
3845 segment for each GNU_MBIND section.
3846 (_bfd_elf_init_private_section_data): Copy sh_info from input
3847 for GNU_MBIND section.
3848
b5292032
PD
38492017-04-03 Palmer Dabbelt <palmer@dabbelt.com>
3850
3851 * elfnn-riscv.c (GP_NAME): Delete.
3852 (riscv_global_pointer_value): Change GP_NAME to RISCV_GP_SYMBOL.
3853 (_bfd_riscv_relax_lui): Likewise.
3854
ad32986f
NC
38552017-04-04 Nick Clifton <nickc@redhat.com>
3856
3857 PR binutils/21342
3858 * elflink.c (_bfd_elf_define_linkage_sym): Prevent null pointer
3859 dereference.
3860 (bfd_elf_final_link): Only initialize the extended symbol index
3861 section if there are extended symbol tables to list.
3862
46bed679
L
38632017-04-03 H.J. Lu <hongjiu.lu@intel.com>
3864
3865 * Makefile.am (BFD32_BACKENDS): Add elf-properties.lo.
3866 (BFD32_BACKENDS_CFILES): Add elf-properties.c.
3867 * configure.ac (elf): Add elf-properties.lo.
3868 * Makefile.in: Regenerated.
3869 * configure: Likewise.
3870 * elf-bfd.h (elf_property_kind): New.
3871 (elf_property): Likewise.
3872 (elf_property_list): Likewise.
3873 (elf_properties): Likewise.
3874 (_bfd_elf_parse_gnu_properties): Likewise.
3875 (_bfd_elf_get_property): Likewise.
3876 (_bfd_elf_link_setup_gnu_properties): Likewise.
3877 (elf_backend_data): Add parse_gnu_properties, merge_gnu_properties
3878 and setup_gnu_properties.
3879 (elf_obj_tdata): Add properties.
3880 * elf-properties.c: New file.
3881 * elf32-i386.c (elf_i386_parse_gnu_properties): New.
3882 (elf_i386_merge_gnu_properties): Likewise.
3883 (elf_backend_parse_gnu_properties): Likewise.
3884 (elf_backend_merge_gnu_properties): Likewise.
3885 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
3886 (elf_x86_64_merge_gnu_properties): Likewise.
3887 (elf_backend_parse_gnu_properties): Likewise.
3888 (elf_backend_merge_gnu_properties): Likewise.
3889 * elfxx-target.h (elf_backend_merge_gnu_properties): Likewise.
3890 (elf_backend_parse_gnu_properties): Likewise.
3891 (elf_backend_setup_gnu_properties): Likewise.
3892 (elfNN_bed): Add elf_backend_parse_gnu_properties,
3893 elf_backend_merge_gnu_properties and
3894 elf_backend_setup_gnu_properties.
3895
f96bd6c2
PC
38962017-03-30 Pip Cet <pipcet@gmail.com>
3897
3898 * elf32-wasm32.c: Add relocation code, two relocs.
3899 * reloc.c: Add wasm32 relocations.
3900 * libbfd.h: Regenerate.
3901 * bfd-in2.h: Regenerate.
3902 * bfd/po/bfd.pot: Regenerate.
3903
e643cb45
NC
39042017-03-29 Nick Clifton <nickc@redhat.com>
3905
3906 PR binutils/18025
3907 * coff-bfd.h (struct coff_section_data): Add new fields:
3908 saved_bias and bias.
3909 * coffgen.c (coff_find_nearest_line_with_names): Cache the bias
3910 computed for PE binaries.
3911 * dwarf2.c (scan_unit_for_symbols): Only warn once about each
3912 missing abbrev.
3913
086554e8
HPN
39142017-03-28 Hans-Peter Nilsson <hp@axis.com>
3915
3916 PR ld/16044
3917 * elf32-cris.c (elf_cris_adjust_gotplt_to_got): Adjust BFD_ASSERT
3918 to handle a local symbol with a hash-symbol-entry; without PLT.
3919 Add BFD_ASSERT for an incidental case with GOT entry present.
3920 (cris_elf_check_relocs): Increment PLT refcount only if the symbol
3921 isn't forced-or-set local.
3922
a6be0538
PC
39232017-03-27 Pip Cet <pipcet@gmail.com>
3924
3925 * wasm-module.c: New file to support WebAssembly modules.
3926 * wasm-module.h: New file to support WebAssembly modules.
3927 * doc/webassembly.texi: Start documenting wasm-module.c.
3928 * config.bfd: Add wasm_vec.
3929 * targets.c: Likewise.
3930 * configure.ac: Likewise.
3931 * Makefile.am: Add entries for wasm-module.c.
3932 * Makefile.in: Regenerate.
3933 * configure: Regenerate.
3934 * po/SRC-POTFILES.in: Regenerate.
3935
79b1d3cb
PC
39362017-03-27 Pip Cet <pipcet@gmail.com>
3937
3938 * cpu-wasm32.c: New file to support wasm32 architecture.
3939 * elf32-wasm32.c: New file to support wasm32 architecture.
3940 * Makefile.am: Add wasm32 architecture.
3941 * archures.c: Likewise.
3942 * config.bfd: Likewise.
3943 * configure.ac: Likewise.
3944 * targets.c: Likewise.
3945 * Makefile.in: Regenerate.
3946 * bfd-in2.h: Regenerate.
3947 * configure: Regenerate.
3948 * po/SRC-POTFILES.in: Regenerate.
3949
aaed6f5b
AM
39502017-03-20 Alan Modra <amodra@gmail.com>
3951
3952 PR 21266
3953 * elf64-ppc.c (compare_symbols): Stabilize sort.
3954
82e66161
AM
39552017-03-18 Alan Modra <amodra@gmail.com>
3956
3957 * elf64-ppc.c (struct ppc_link_hash_table): Add
3958 local_ifunc_resolver and maybe_local_ifunc_resolver.
3959 (ppc_build_one_stub): Set flags on emitting dynamic
3960 relocation to ifunc.
3961 (ppc64_elf_relocate_section): Likewise.
3962 (ppc64_elf_finish_dynamic_symbol): Likewise.
3963 (ppc64_elf_finish_dynamic_sections): Error on DT_TEXTREL with
3964 local dynamic relocs to ifuncs.
3965 * elf32-ppc.c (struct ppc_elf_link_hash_table): Add
3966 local_ifunc_resolver and maybe_local_ifunc_resolver.
3967 (ppc_elf_relocate_section): Set flag on emitting dynamic
3968 relocation to ifuncs.
3969 (ppc_elf_finish_dynamic_symbol): Likewise.
3970 (ppc_elf_finish_dynamic_sections): Error on DT_TEXTREL with local
3971 dynamic relocs to ifuncs.
3972
f955cccf
NC
39732017-03-13 Nick Clifton <nickc@redhat.com>
3974
3975 PR binutils/21202
3976 * reloc.c (BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC): Rename to
3977 BFD_RELOC_AARCH64_TLSDESC_LD64_LO12.
3978 (BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC): Rename to
3979 BFD_RELOC_AARCH64_TLSDESC_ADD_LO12.
3980 * bfd-in2.h: Regenerate.
3981 * libbfd.h: Regenerate.
3982 * elfnn-aarch64.c (IS_AARCH64_TLS_RELAX_RELOC): Update reloc
3983 names.
3984 (IS_AARCH64_TLSDESC_RELOC): Likewise.
3985 (elfNN_aarch64_howto_table): Likewise.
3986 (aarch64_tls_transition_without_check): Likewise.
3987 (aarch64_reloc_got_type): Likewise.
3988 (elfNN_aarch64_final_link_relocate): Likewise.
3989 (elfNN_aarch64_tls_relax): Likewise.
3990 (elfNN_aarch64_relocate_section): Likewise.
3991 (elfNN_aarch64_gc_sweep_hook): Likewise.
3992 (elfNN_aarch64_check_relocs): Likewise.
3993 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
3994 (_bfd_aarch64_elf_resolve_relocation): Likewise.
3995
4aef7643
AM
39962017-03-11 Alan Modra <amodra@gmail.com>
3997
3998 * elf32-ppc.c: Remove ATTRIBUTE_UNUSED throughout when function
3999 parameter is in fact used. Whitespace fixes.
4000 * elf64-ppc.c: Likewise.
4001
f03265d9
ST
40022017-03-09 Sam Thursfield <sam.thursfield@codethink.co.uk>
4003
4004 * rs6000-core.c (CORE_NEW): Simplify macro when
4005 AIX_CORE_DUMPX_CORE and BFD64 are true to avoid compile warning.
4006
b1b07054
AM
40072017-03-07 Alan Modra <amodra@gmail.com>
4008
4009 PR 21224
4010 PR 20519
4011 * elf64-ppc.c (ppc64_elf_relocate_section): Add missing
4012 dyn_relocs check.
4013
2e0ce1c8
AM
40142017-03-05 Alan Modra <amodra@gmail.com>
4015
4016 * elf-bfd.h (struct eh_cie_fde): Add u.cie.per_encoding_aligned8.
4017 * elf-eh-frame.c (size_of_output_cie_fde): Don't align here.
4018 (next_cie_fde_offset): New function.
4019 (_bfd_elf_parse_eh_frame): Set u.cie.per_encoding_aligned8.
4020 (_bfd_elf_discard_section_eh_frame): Align zero terminator to
4021 four bytes. Align CIEs to four or eight bytes depending on
4022 per_encoding_aligned8. Align FDEs according to their encoding.
4023 Pad last FDE to output section alignment.
4024 (_bfd_elf_write_section_eh_frame): Adjust to suit. Remove
4025 assertion.
4026 * elf64-ppc.c (glink_eh_frame_cie): Delete padding.
4027 (ppc64_elf_size_stubs): Pad glink eh_frame as per elf-eh-frame.c.
4028 (ppc64_elf_finish_dynamic_sections): Adjust to suit.
4029
f98450c6
NC
40302017-03-02 Martin Bickel <binutils@ineranves.de>
4031
4032 PR ld/21212
4033 * elf.c (rewrite_elf_program_header): Do not issue a warning for
d20928fa 4034 empty segments which have a zero filesz, but a non-zero memsz.
f98450c6 4035
673cff9b
AM
40362017-03-02 Alan Modra <amodra@gmail.com>
4037
4038 * elf32-ppc.c (ppc_elf_vle_split16): Correct insn mask typo.
4039
3de43e7b
AM
40402017-02-28 Alan Modra <amodra@gmail.com>
4041
4042 * elf64-ppc.c (ppc64_elf_ha_reloc): Revert last change.
4043 (ppc64_elf_relocate_section): Likewise.
4044
4ef97a1b
AM
40452017-02-28 Alan Modra <amodra@gmail.com>
4046
4047 PR 20995
4048 * elf32-nios2.c (nios2_elf32_relocate_section): Use htab
4049 rather than elf32_nios2_hash_table or elf_hash_table.
4050 (create_got_section): Likewise.
4051 (nios2_elf32_finish_dynamic_symbol): Likewise.
4052 (nios2_elf32_adjust_dynamic_symbol): Likewise.
4053 (nios2_elf32_size_dynamic_sections): Likewise.
4054 (nios2_elf32_check_relocs): Delete dynobj, sgot, and srelgot
4055 vars. Use htab equivalents directly instead. Don't create
4056 all dynamic sections on needing just the GOT. Use a goto
4057 rather than a fall-through with reloc test. Ensure
4058 htab->dynobj is set when making dynamic sreloc section.
4059 (nios2_elf32_finish_dynamic_sections): Delete dynobj, use htab
4060 equivalent directly instead. Don't segfault on looking for
4061 .dynamic when dynamic sections have not been created. Don't
4062 segfault on .got.plt being discarded.
4063 (nios2_elf32_size_dynamic_sections): Delete plt and got vars.
4064 Don't set "relocs" on .rela.plt. Do handle .sbss. Delete
4065 fixme and another not so relevant comment.
4066 (nios2_elf_add_symbol_hook): Delete dynobj var. If not
4067 already set, set hash table dynobj on creating .sbss.
4068
7ba71655
AM
40692017-02-28 Alan Modra <amodra@gmail.com>
4070
4071 * reloc.c (BFD_RELOC_PPC_16DX_HA): New.
4072 * elf64-ppc.c (ppc64_elf_howto_raw <R_PPC64_16DX_HA>): New howto.
4073 (ppc64_elf_reloc_type_lookup): Translate new bfd reloc.
4074 (ppc64_elf_ha_reloc): Correct overflow test on REL16DX_HA.
4075 (ppc64_elf_relocate_section): Likewise.
4076 * elf32-ppc.c (ppc_elf_howto_raw <R_PPC_16DX_HA>): New howto.
4077 (ppc_elf_reloc_type_lookup): Translate new bfd reloc.
4078 (ppc_elf_check_relocs): Handle R_PPC_16DX_HA to pacify gcc.
4079 * libbfd.h: Regenerate.
4080 * bfd-in2.h: Regenerate.
4081
afbf7e8e
AM
40822017-02-28 Alan Modra <amodra@gmail.com>
4083
4084 * elflink.c (_bfd_elf_create_dynamic_sections): Don't make
4085 dynamic .data.rel.ro read-only.
4086 * elf32-arm.c (elf32_arm_finish_dynamic_symbol): Compare section
4087 rather than section flags when deciding where copy reloc goes.
4088 * elf32-cris.c (elf_cris_finish_dynamic_symbol): Likewise.
4089 * elf32-hppa.c (elf32_hppa_finish_dynamic_symbol): Likewise.
4090 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Likewise.
4091 * elf32-metag.c (elf_metag_finish_dynamic_symbol): Likewise.
4092 * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Likewise.
4093 * elf32-nios2.c (nios2_elf32_finish_dynamic_symbol): Likewise.
4094 * elf32-or1k.c (or1k_elf_finish_dynamic_symbol): Likewise.
4095 * elf32-ppc.c (ppc_elf_finish_dynamic_symbol): Likewise.
4096 * elf32-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
4097 * elf32-tic6x.c (elf32_tic6x_finish_dynamic_symbol): Likewise.
4098 * elf32-tilepro.c (tilepro_elf_finish_dynamic_symbol): Likewise.
4099 * elf64-ppc.c (ppc64_elf_finish_dynamic_symbol): Likewise.
4100 * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
4101 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
4102 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Likewise.
4103 * elfnn-riscv.c (riscv_elf_finish_dynamic_symbol): Likewise.
4104 * elfxx-mips.c (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise.
4105 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Likewise.
4106 * elfxx-tilegx.c (tilegx_elf_finish_dynamic_symbol): Likewise.
4107
0e392101
MR
41082017-02-28 Maciej W. Rozycki <macro@imgtec.com>
4109
4110 * elfxx-mips.c (mips_elf_perform_relocation): Also handle the
4111 `jalr $0, $25' instruction encoding.
4112
bd757ca7
NC
41132017-02-27 Nick Clifton <nickc@redhat.com>
4114
4115 PR ld/21180
4116 * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Avoid
4117 generating a seg-fault when encountering a symbol that has been
4118 deleted by garbage collection.
4119
034fed0b
AM
41202017-02-25 Alan Modra <amodra@gmail.com>
4121
4122 * elf32-arc.c (struct dynamic_sections): Delete.
4123 (enum dyn_section_types): Delete.
4124 (dyn_section_names): Delete.
4125 (arc_create_dynamic_sections): Delete.
4126 (elf_arc_finish_dynamic_sections): Don't call the above. Don't
4127 segfault on discarded .rela.plt section.
4128 (elf_arc_size_dynamic_sections): Formatting. Don't call
4129 arc_create_dynamic_sections. Don't allocate memory for sections
4130 handled by the generic linker. Correct code finding relocs in
4131 read-only sections. Set SEC_EXCLUDE on zero size .got,
4132 .got.plt, and .dynbss sections. Do set .interp for pies.
4133
d0f744f9
AW
41342017-02-24 Andrew Waterman <andrew@sifive.com>
4135
4136 * elfnn-riscv.c (GP_NAME): New macro.
4137 (riscv_global_pointer_value): Use it.
4138 (_bfd_riscv_relax_lui): If symbol and global pointer are in same
4139 output section, consider only that section's alignment.
4140
5d58c733
MR
41412017-02-23 Maciej W. Rozycki <macro@imgtec.com>
4142
4143 * elfxx-mips.h (_bfd_mips_relax_section): Remove prototype.
4144 * elfxx-mips.c (_bfd_mips_relax_section): Remove function.
4145 * elf64-mips.c (bfd_elf64_bfd_relax_section): Remove macro.
4146 * elfn32-mips.c (bfd_elf32_bfd_relax_section): Likewise.
4147
c1556ecd
MR
41482017-02-23 Maciej W. Rozycki <macro@imgtec.com>
4149
4150 * elfxx-mips.c (mips_elf_calculate_relocation) <R_MIPS_JALR>
4151 <R_MICROMIPS_JALR>: Discard relocation if `cross_mode_jump_p'
4152 or misaligned.
4153
5499c7c7
AM
41542017-02-23 Alan Modra <amodra@gmail.com>
4155
4156 PR 20744
4157 * elf32-ppc.c (ppc_elf_howto_raw): Correct dst_mask on all VLE
4158 16D relocations.
4159 (ppc_elf_vle_split16): Correct field mask and shift for 16D relocs.
4160 (ppc_elf_relocate_section): Correct calculation for VLE SDAREL
4161 relocs.
4162
902e9fc7
MR
41632017-02-22 Maciej W. Rozycki <macro@imgtec.com>
4164
4165 PR ld/20828
4166 * elflink.c (bfd_elf_size_dynamic_sections): Move symbol version
4167 processing ahead of the call to `elf_gc_sweep_symbol'.
4168
758d96d8
NC
41692017-02-22 Nick Clifton <nickc@redhat.com>
4170
4171 PR binutils/21193
4172 * opncls.c (bfd_create_gnu_debuglink_section): Give the newly
4173 created section 4-byte alignment.
4174
6528b6eb
AM
41752017-02-22 Alan Modra <amodra@gmail.com>
4176
4177 * elf64-ppc.c (ppc64_elf_finish_dynamic_sections): Don't segfault
4178 on .got or .plt output section being discarded by script.
4179 * elf32-ppc.c (ppc_elf_finish_dynamic_sections): Likewise. Move
4180 vxworks splt temp.
4181
24f1a751
AM
41822017-02-21 Alan Modra <amodra@gmail.com>
4183
4184 * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Only emit
4185 DT_RELA, DT_RELASZ, and DT_RELAENT when DT_RELASZ is non-zero.
4186
64487780
AM
41872017-02-20 Alan Modra <amodra@gmail.com>
4188
4189 PR 21181
4190 * elflink.c (bfd_elf_final_link): Make DT_REL/DT_RELA zero
4191 if DT_RELSZ/DT_RELASZ is zero.
4192
6438d1be
NC
41932017-02-17 Nick Clifton <nickc@redhat.com>
4194
4195 * compress.c (bfd_get_full_section_contents): Remember to reduce
4196 compressed size by the sizeof the compression header when
4197 decompressing the contents.
4198
4bc26c69
PA
41992017-02-17 Pedro Alves <palves@redhat.com>
4200
4201 * srec.c (Chunk): Rename to ...
4202 (_bfd_srec_len): ... this.
4203 (S3Forced): Rename to ...
4204 (_bfd_srec_forceS3): ... this.
4205 * objcopy.c: Adjust all references.
4206
7ec22e0f
PA
42072017-02-17 Pedro Alves <palves@redhat.com>
4208
4209 * archive.c (bsd_write_armap): Rename to ...
4210 (_bfd_bsd_write_armap): ... this.
4211 (coff_write_armap): Rename to ...
4212 (_bfd_coff_write_armap): ... this.
4213 * libbfd-in.h (bsd_write_armap): Rename to ...
4214 (_bfd_bsd_write_armap): ... this.
4215 (coff_write_armap): Rename to ...
4216 (_bfd_coff_write_armap): ... this.
4217 * aout-target.h, aout-tic30.c: Adjust all users.
4218 * libbfd.h: Regenerate.
4219
8c8402cc
PA
42202017-02-17 Pedro Alves <palves@redhat.com>
4221
4222 * bfd-in.h (bfd_read, bfd_write): Adjust to rename.
4223 (warn_deprecated): Rename to ...
4224 (_bfd_warn_deprecated): ... this.
4225 * libbfd.c (warn_deprecated): Rename to ...
4226 (_bfd_warn_deprecated): ... this.
4227 * bfd-in2.h: Regenerate.
4228
c7c3d11b
PA
42292017-02-17 Pedro Alves <palves@redhat.com>
4230
4231 * bfdio.c (real_ftell): Rename to ...
4232 (_bfd_real_ftell): ... this.
4233 (real_fseek): Rename to ...
4234 (_bfd_real_fseek): ... this.
4235 (real_fopen): Rename to ...
4236 (_bfd_real_fopen): ... this.
4237 * libbfd-in.h (real_ftell): Rename to ...
4238 (_bfd_real_ftell): ... this.
4239 (real_fseek): Rename to ...
4240 (_bfd_real_fseek): ... this.
4241 (real_fopen): Rename to ...
4242 (_bfd_real_fopen): ... this.
4243 * cache.c, dwarf2.c, opncls.c: Adjust all callers.
4244 * libbfd.h: Regenerate.
4245
4265548c
PA
42462017-02-17 Pedro Alves <palves@redhat.com>
4247
4248 * dwarf2.c, elf-attrs.c, elf32-nds32.c: Adjust all callers.
4249 * libbfd.c (read_unsigned_leb128): Rename to ...
4250 (_bfd_read_unsigned_leb128): ... this.
4251 (read_signed_leb128): Rename to ...
4252 (_bfd_read_signed_leb128): ... this.
4253 (safe_read_leb128): Rename to ...
4254 (_bfd_safe_read_leb128): ... this.
4255 * libbfd-in.h (read_unsigned_leb128): Rename to ...
4256 (_bfd_read_unsigned_leb128): ... this.
4257 (read_signed_leb128): Rename to ...
4258 (_bfd_read_signed_leb128): ... this.
4259 (safe_read_leb128): Rename to ...
4260 (_bfd_safe_read_leb128): ... this.
4261 * libbfd.h: Renegerate.
4262
3239a423
AB
42632017-02-16 Andrew Burgess <andrew.burgess@embecosm.com>
4264
4265 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Perform symbol lookup
4266 before trying to fine matching file and line information.
4267
90ed9b8b
AB
42682017-02-16 Andrew Burgess <andrew.burgess@embecosm.com>
4269
4270 * dwarf2.c (struct dwarf2_debug): Add orig_bfd member.
4271 (_bfd_dwarf2_slurp_debug_info): If stashed debug information does
4272 not match current bfd, then reload debug information. Record bfd
4273 we're loading debug info for in the stash. If we have debug
4274 informatin in the cache then perform section placement before
4275 returning.
4276
a8c75b76
AM
42772017-02-16 Alan Modra <amodra@gmail.com>
4278
4279 PR 21000
4280 * elf-bfd.h (struct elf_backend_data): Add no_page_alias.
4281 * elfxx-target.h (elf_backend_no_page_alias): Define.
4282 (elfNN_bed): Init new field.
4283 * elf.c (assign_file_positions_for_load_sections): If no_page_alias
4284 ensure PT_LOAD segment starts on a new page.
4285 * elf32-hppa.c (elf_backend_no_page_alias): Define.
4286
247d6c4c
AM
42872017-02-16 Alan Modra <amodra@gmail.com>
4288
4289 PR 21132
4290 * elf32-hppa.c (allocate_plt_static): Allocate space for relocs
4291 if pic.
4292
90571206
JW
42932017-02-16 Jiong Wang <jiong.wang@arm.com>
4294
4295 * bfd.c (BFD_FLAGS_SAVED): Add BFD_LINKER_CREATED.
4296 * bfd-in2.h: Regenerated.
4297
2a568401
L
42982017-02-15 H.J. Lu <hongjiu.lu@intel.com>
4299
4300 PR ld/21168
4301 * elf32-i386.c (elf_i386_relocate_section): Allow
4302 "lea foo@GOT, %reg" in PIC.
4303
a5def14f
L
43042017-02-15 H.J. Lu <hongjiu.lu@intel.com>
4305
4306 PR ld/20244
4307 * elf32-i386.c (elf_i386_relocate_section): Properly get IFUNC
4308 symbol name when reporting R_386_GOT32/R_386_GOT32X relocation
4309 error against local IFUNC symbol without a base register for
4310 PIC.
4311
174d0a74
MR
43122017-02-15 Maciej W. Rozycki <macro@imgtec.com>
4313
4314 * elf32-ppc.c (ppc_elf_check_relocs): Use `%H:' rather than
4315 `%P: %H:' with `info->callbacks->einfo'.
4316 (ppc_elf_relocate_section): Likewise.
4317 * elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
4318 (ppc64_elf_edit_toc): Likewise.
4319 (ppc64_elf_relocate_section): Likewise.
4320
e278ae05
AM
43212017-02-14 Alan Modra <amodra@gmail.com>
4322
4323 * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Support
4324 --gc-keep-exported, and test versioned field of sym rather than
4325 looking for @ in name.
4326
10ddfe62
PD
43272017-02-13 Palmer Dabbelt <palmer@dabbelt.com>
4328
4329 * elfnn-riscv.c (riscv_global_pointer_value): Change _gp to
4330 __global_pointer$.
4331
d11135f5
NC
43322017-02-13 Nick Clifton <nickc@redhat.com>
4333
4334 PR binutils/21151
4335 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Check for an invalid
4336 unit length field.
4337
cc162427
AW
43382017-02-07 Andrew Waterman <andrew@sifive.com>
4339
4340 * elfnn-riscv.c (riscv_elf_finish_dynamic_sections): Only write PLT
4341 entry size if PLT header is written.
4342
3d044c0c
SL
43432017-02-06 Sheldon Lobo <sheldon.lobo@oracle.com>
4344
4345 Fix sparc64 dynamic relocation processing to use the dynamic
4346 symbol count.
4347 * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Use 'dynamic'
4348 to determine if bfd_get_symcount() or bfd_get_dynamic_symcount()
4349 should be used.
4350
1b7e3d2f
NC
43512017-02-03 Nick Clifton <nickc@redhat.com>
4352
4353 PR 21096
4354 * coffcode.h (coff_write_object_contents): Enlarge size of
4355 s_name_buf in order to avoid compile time warning about possible
4356 integer truncation.
4357 * elf32-nds32.c (nds32_elf_ex9_import_table): Mask off lower
4358 32-bits of insn value before printing into buffer.
4359
e17b0c35
MR
43602017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4361
4362 * elfxx-mips.c (mips_elf_hash_sort_data): Add
4363 `max_local_dynindx'.
4364 (mips_elf_sort_hash_table): Handle it.
4365 (mips_elf_sort_hash_table_f) <GGA_NONE>: For forced local
4366 symbols bump up `max_local_dynindx' rather than
4367 `max_non_got_dynindx'.
4368
55f8b9d2
MR
43692017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4370
4371 * elfxx-mips.c (mips_elf_hash_sort_data): Convert the
4372 `min_got_dynindx', `max_unref_got_dynindx' and
4373 `max_non_got_dynindx' members to the `bfd_size_type' data type.
4374 (mips_elf_sort_hash_table): Adjust accordingly.
4375
0f8c4b60
MR
43762017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4377
4378 * elfxx-mips.c (mips_elf_sort_hash_table): Use `htab' throughout
4379 to access the hash table.
4380
17a80fa8
MR
43812017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4382
4383 * elfxx-mips.c (mips_elf_sort_hash_table): Move assertion on
4384 non-NULL `htab' to the beginning.
4385
8f56d4fd
MR
43862017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4387
4388 * elflink.c (elf_gc_sweep): Wrap overlong line.
4389
8b10b0b3
MR
43902017-01-30 Maciej W. Rozycki <macro@imgtec.com>
4391
4392 * elfxx-mips.h (_bfd_mips_elf_insn32): Rename prototype to...
4393 (_bfd_mips_elf_linker_flags): ... this. Add another parameter.
4394 * elfxx-mips.c (mips_elf_link_hash_table): Add
4395 `ignore_branch_isa' member.
4396 (mips_elf_perform_relocation): Do not treat an ISA mode mismatch
4397 in branch relocation calculation as an error if
4398 `ignore_branch_isa' has been set.
4399 (_bfd_mips_elf_insn32): Rename to...
4400 (_bfd_mips_elf_linker_flags): ... this. Rename the `on'
4401 parameter to `insn32' and add an `ignore_branch_isa' parameter.
4402 Handle the new parameter.
4403
1fbd05e1
HPN
44042017-01-27 Hans-Peter Nilsson <hp@axis.com>
4405
22d9a0de
HPN
4406 * elf32-cris.c (elf_cris_finish_dynamic_symbol): Remove now unused
4407 local variable dynobj.
4408
1fbd05e1
HPN
4409 PR ld/20995
4410 * elf32-cris.c (elf_cris_size_dynamic_sections): Handle sdynrelro.
4411 (elf_cris_adjust_dynamic_symbol): Place variables copied into the
4412 executable from read-only sections into sdynrelro.
4413 (elf_cris_finish_dynamic_symbol): Select sreldynrelro for
4414 dynamic relocs in sdynrelro.
4415 (elf_backend_want_dynrelro): Define.
4416
4a7324e1
SH
44172017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
4418
4419 * config.bfd (*-*-rtemsaout*): Mark as removed.
4420
c75b4ebd
SH
44212017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
4422
4423 * config.bfd (powerpcle-*-rtems*): Do not mark as removed.
4424 (arm-*-rtems*): Move to (arm*-*-eabi*).
4425 (i[3-7]86-*-rtems*): Move to (i[3-7]86-*-elf*).
4426 (m68-*-rtems*): Move to (m68*-*-elf*).
4427
850d84f6
SH
44282017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
4429
4430 * config.bfd (*-*-rtemscoff*): Mark as removed.
4431
b531344c
MR
44322017-01-24 Maciej W. Rozycki <macro@imgtec.com>
4433
4434 PR ld/20828
4435 * elflink.c (bfd_elf_record_link_assignment): Revert last
4436 change and don't ever clear `forced_local'. Set `mark'
4437 unconditionally.
4438 (elf_gc_sweep_symbol_info, elf_gc_sweep_symbol): Reorder within
4439 file.
4440 (elf_gc_sweep): Move the call to `elf_gc_sweep_symbol'...
4441 (bfd_elf_size_dynamic_sections): ... here.
4442 * elf32-ppc.c (ppc_elf_tls_setup): Don't clear `forced_local'
4443 and set `mark' instead in `__tls_get_addr_opt' processing.
4444 * elf64-ppc.c (ppc64_elf_tls_setup): Likewise.
4445
f0158f44
AM
44462017-01-24 Alan Modra <amodra@gmail.com>
4447
4448 * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Merge two cases
4449 where dynamic relocs are preferable. Allow ifunc too.
4450 (ensure_undefweak_dynamic): New function.
4451 (allocate_dynrelocs): Use it here. Move plt handling last and
4452 don't make symbols dynamic, simplifying loop. Only make undef
4453 weak symbols with GOT entries dynamic. Correct condition
4454 for GOT relocs. Handle dynamic relocs on ifuncs. Correct
4455 comments. Remove goto.
4456 (ppc_elf_relocate_section): Correct test for using dynamic
4457 symbol on GOT relocs. Rearrange test for emitting GOT relocs
4458 to suit. Set up explicit tls_index entries and implicit GOT
4459 tls_index entries resolvable at link time for
4460 __tls_get_addr_opt. Simplify test to clear mem for prelink.
4461 * elf64-ppc.c (allocate_got): Correct condition for GOT relocs.
4462 (ensure_undefweak_dynamic): New function.
4463 (allocate_dynrelocs): Use it here. Only make undef weak symbols
4464 with GOT entries dynamic. Remove unnecessary test of
4465 WILL_CALL_FINISH_DYNAMIC_SYMBOL in PLT handling.
4466 (ppc64_elf_relocate_section): Correct test for using dynamic
4467 symbol on GOT relocs. Rearrange test for emitting GOT relocs
4468 to suit. Set up explicit tls_index entries and implicit GOT
4469 tls_index entries resolvable at link time for __tls_get_addr_opt.
4470 Simplify expression to clear mem for prelink.
4471
2d0ca824
YN
44722017-01-23 Yury Norov <ynorov@caviumnetworks.com>
4473
4474 * elfnn-aarch64.c: Fix relaxations for ILP32 mode.
4475
7f784814
JW
44762017-01-20 Jiong Wang <jiong.wang@arm.com>
4477
4478 * elfnn-aarch64.c (elf_aarch64_hash_symbol): New function.
4479 (elf_backend_hash_symbol): Define.
4480
81ff47b3
MR
44812017-01-18 Maciej W. Rozycki <macro@imgtec.com>
4482
4483 PR ld/20828
4484 * elflink.c (bfd_elf_record_link_assignment): Clear any
4485 `forced_local' marking for DSO symbols that are not being
4486 provided.
4487
640d6bfd
KLC
44882017-01-17 Kuan-Lin Chen <kuanlinchentw@gmail.com>
4489
4490 * elfnn-riscv.c (riscv_elf_object_p): New function.
4491
8361ed4d
L
44922017-01-12 H.J. Lu <hongjiu.lu@intel.com>
4493
4494 PR ld/21038
4495 * elf64-x86-64.c (elf_x86_64_link_hash_table): Add
4496 plt_bnd_eh_frame.
4497 (elf_x86_64_check_relocs): Create .eh_frame section for the
4498 .plt.bnd section.
4499 (elf_x86_64_size_dynamic_sections): Allocate and initialize
4500 .eh_frame section for the .plt.bnd section.
4501 (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
4502 for the .plt.bnd section.
4503
2425a30e
NC
45042017-01-12 Nick Clifton <nickc@redhat.com>
4505
4506 PR binutils/20876
4507 * opncls.c (find_separate_debug_file): Add include_dirs
4508 parameter. Only include the directory part of the bfd's filename
4509 in search paths if include_dirs is true. Add a couple of extra
4510 locations for looking for debug files.
4511 ( bfd_follow_gnu_debuglink): Update invocation of
4512 find_separate_debug_file.
4513 (bfd_follow_gnu_debugaltlink): Likewise.
4514 (get_build_id): New function: Finds the build-id of the given bfd.
4515 (get_build_id_name): New function: Computes the name of the
4516 separate debug info file for a bfd, based upon its build-id.
4517 (check_build_id_file): New function: Checks to see if a separate
4518 debug info file exists at the given location, and that its
4519 build-id matches that of the original bfd.
4520 (bfd_follow_build_id_debuglink): New function: Finds a separate
4521 debug info file for a given bfd by using the build-id method.
4522 * dwarf2.c (_bfd_dwarf2_slurp_debug_info): Try using the build-id
4523 method of locating a separate debug info file before using the
4524 debuglink method.
4525 * bfd-in2.h: Regenerate.
4526
9e659176
L
45272017-01-11 H.J. Lu <hongjiu.lu@intel.com>
4528
4529 PR ld/21038
4530 * elf64-x86-64.c (elf_x86_64_eh_frame_bnd_plt): New.
4531 (elf_x86_64_bnd_arch_bed): Use elf_x86_64_eh_frame_bnd_plt and
4532 elf_x86_64_eh_frame_plt_got.
4533 (elf_x86_64_size_dynamic_sections): Get unwind info from
4534 elf_x86_64_bnd_arch_bed for the BND PLT.
4535
f2e2d2f5
JS
45362017-01-11 Jeremy Soller <jackpot51@gmail.com>
4537
4538 * config.bfd: Add entries for i686-redox and x86_64-redox.
4539
52b232b3
L
45402017-01-10 H.J. Lu <hongjiu.lu@intel.com>
4541
4542 * elf32-i386.c (elf_i386_check_relocs): Align .eh_frame section
4543 to 4 bytes.
4544 * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Align
4545 .eh_frame section to 4 bytes for x32.
4546 (elf_x86_64_check_relocs): Likewise.
4547
fff53dae
L
45482017-01-10 H.J. Lu <hongjiu.lu@intel.com>
4549
4550 PR ld/20830
4551 * elf32-i386.c (elf_i386_eh_frame_plt_got): New.
4552 (PLT_GOT_FDE_LENGTH): Likewise.
4553 (elf_i386_plt_layout): Add eh_frame_plt_got and
4554 eh_frame_plt_got_size.
4555 (elf_i386_plt): Updated.
4556 (elf_i386_link_hash_table): Add plt_got_eh_frame.
4557 (elf_i386_check_relocs): Create .eh_frame section for .plt.got.
4558 (elf_i386_size_dynamic_sections): Allocate and initialize
4559 .eh_frame section for .plt.got.
4560 (elf_i386_finish_dynamic_sections): Adjust .eh_frame section for
4561 .plt.got.
4562 (elf_i386_nacl_plt): Add FIXME for eh_frame_plt_got and
4563 eh_frame_plt_got_size.
4564 * elf64-x86-64.c (elf_x86_64_eh_frame_plt_got): New.
4565 (PLT_GOT_FDE_LENGTH): Likewise.
4566 (elf_x86_64_backend_data): Add eh_frame_plt_got and
4567 eh_frame_plt_got_size.
4568 (elf_x86_64_arch_bed): Updated.
4569 (elf_x86_64_bnd_arch_bed): Add FIXME for eh_frame_plt_got and
4570 eh_frame_plt_got_size.
4571 (elf_x86_64_nacl_arch_bed): Likewise.
4572 (elf_x86_64_link_hash_table): Add plt_got_eh_frame.
4573 (elf_x86_64_check_relocs): Create .eh_frame section for .plt.got.
4574 (elf_x86_64_size_dynamic_sections): Allocate and initialize
4575 .eh_frame section for .plt.got.
4576 (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
4577 for .plt.got.
4578
f129e49f
L
45792017-01-10 H.J. Lu <hongjiu.lu@intel.com>
4580
4581 * elf32-i386.c (elf_i386_size_dynamic_sections): Set
4582 plt_eh_frame->size to eh_frame_plt_size and use eh_frame_plt.
4583
cd6581da
NC
45842017-01-09 Nick Clifton <nickc@redhat.com>
4585
4586 * dwarf2.c (lookup_address_in_function_table): Return early if
4587 there are no functions in the given comp unit, or if the high
4588 address of the last function in the comp unit is less than the
4589 desired address.
4590
98f02962
NC
45912017-01-09 Nick Clifton <nickc@redhat.com>
4592
4593 PR binutils/21013
4594 * coffgen.c (_bfd_coff_get_external_symbols): Generate an error
4595 message if there are too many symbols to load.
4596
ae4fda66
JC
45972017-01-04 James Clarke <jrtc27@jrtc27.com>
4598
4599 * elf64-alpha.c (elf64_alpha_relax_opt_call): Don't set tsec_free
4600 if relocs are cached.
4601
de1010f4
RF
46022017-01-03 Rich Felker <bugdal@aerifal.cx>
4603
4604 PR ld/21017
4605 * elf32-microblaze.c (microblaze_elf_check_relocs): Add an entry
4606 for R_MICROBLAZE_GOTOFF_64.
4607
09fe2662
NC
46082017-01-03 Nick Clifton <nickc@redhat.com>
4609
4610 * mach-o.c (bfd_mach_o_lookup_uuid_command): Fix compile time
4611 warning about using a possibly uninitialised variable.
4612
595e0a47
AM
46132017-01-02 Alan Modra <amodra@gmail.com>
4614
4615 * elf32-hppa.c (ensure_undef_weak_dynamic): New function.
4616 (allocate_plt_static, allocate_dynrelocs): Use it.
4617
7bd9df3b
AM
46182017-01-02 Alan Modra <amodra@gmail.com>
4619
4620 * elf-hppa.h (elf_hppa_fake_sections): Set SHF_INFO_LINK for
4621 .PARISC.unwind section.
4622
5b86074c
AM
46232017-01-02 Alan Modra <amodra@gmail.com>
4624
4625 PR ld/20989
4626 * elfxx-sparc.c (gdop_relative_offset_ok): New function.
4627 (_bfd_sparc_elf_relocate_section): Use it to validate GOT
4628 indirect to GOT pointer relative code edit.
4629
2571583a
AM
46302017-01-02 Alan Modra <amodra@gmail.com>
4631
4632 Update year range in copyright notice of all files.
4633
5c1ad6b5 4634For older changes see ChangeLog-2016
3499769a 4635\f
5c1ad6b5 4636Copyright (C) 2017 Free Software Foundation, Inc.
3499769a
AM
4637
4638Copying and distribution of this file, with or without modification,
4639are permitted in any medium without royalty provided the copyright
4640notice and this notice are preserved.
4641
4642Local Variables:
4643mode: change-log
4644left-margin: 8
4645fill-column: 74
4646version-control: never
4647End:
This page took 0.377371 seconds and 4 git commands to generate.