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