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