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