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