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