Documentation fix
[deliverable/binutils-gdb.git] / bfd / ChangeLog
CommitLineData
92f402a7
L
12017-12-01 H.J. Lu <hongjiu.lu@intel.com>
2
3 * elfxx-x86.c (_bfd_x86_elf_readonly_dynrelocs): Print symbol
4 for map file output.
5
63c1f59d
AM
62017-12-01 Alan Modra <amodra@gmail.com>
7
8 * elf32-hppa.c (maybe_set_textrel): Print symbol for map file output.
9 * elf32-ppc.c (maybe_set_textrel): Likewise.
10 * elf64-ppc.c (maybe_set_textrel): Likewise.
11 * elf32-arm.c (readonly_dynrelocs): New function.
12 (maybe_set_textrel): New function, replacing..
13 (elf32_arm_readonly_dynrelocs): ..this.
14 * elf32-lm32.c (readonly_dynrelocs): New function.
15 (maybe_set_textrel): New function, replacing old version of..
16 (readonly_dynrelocs): ..this.
17 * elf32-m32r.c (readonly_dynrelocs): New function.
18 (maybe_set_textrel): New function, replacing old version of..
19 (readonly_dynrelocs): ..this.
20 * elf32-metag.c (readonly_dynrelocs): New function.
21 (maybe_set_textrel): New function, replacing old version of..
22 (readonly_dynrelocs): ..this.
23 * elf32-nds32.c: Delete unnecessary forward declarations.
24 (readonly_dynrelocs): New function.
25 (maybe_set_textrel): New function, replacing old version of..
26 (readonly_dynrelocs): ..this.
27 * elf32-or1k.c (readonly_dynrelocs): New function.
28 (maybe_set_textrel): New function, replacing old version of..
29 (readonly_dynrelocs): ..this.
30 * elf32-s390.c (readonly_dynrelocs): New function.
31 (maybe_set_textrel): New function, replacing old version of..
32 (readonly_dynrelocs): ..this.
33 * elf32-sh.c (readonly_dynrelocs): New function.
34 (maybe_set_textrel): New function, replacing old version of..
35 (readonly_dynrelocs): ..this.
36 * elf32-tic6x.c (readonly_dynrelocs): New function.
37 (maybe_set_textrel): New function, replacing..
38 (elf32_tic6x_readonly_dynrelocs): ..this.
39 * elf32-tilepro.c (readonly_dynrelocs): New function.
40 (maybe_set_textrel): New function, replacing old version of..
41 (readonly_dynrelocs): ..this.
42 * elf64-s390.c (readonly_dynrelocs): New function.
43 (maybe_set_textrel): New function, replacing old version of..
44 (readonly_dynrelocs): ..this.
45 * elfnn-aarch64.c (readonly_dynrelocs): New function.
46 (maybe_set_textrel): New function, replacing..
47 (aarch64_readonly_readonly_dynrelocs): ..this.
48 * elfnn-riscv.c (readonly_dynrelocs): New function.
49 (maybe_set_textrel): New function, replacing old version of..
50 (readonly_dynrelocs): ..this.
51 * elfxx-sparc.c (readonly_dynrelocs): New function.
52 (maybe_set_textrel): New function, replacing old version of..
53 (readonly_dynrelocs): ..this.
54 * elfxx-tilegx.c (readonly_dynrelocs): New function.
55 (maybe_set_textrel): New function, replacing old version of..
56 (readonly_dynrelocs): ..this.
57
4a7e5234
AM
582017-12-01 Alan Modra <amodra@gmail.com>
59
60 PR 22533
61 * elf32-hppa.c (elf32_hppa_copy_indirect_symbol): Don't do anything
62 special with non_got_ref for weak aliases.
63 (elf32_hppa_check_relocs): Tweak setting of non_got_ref.
64 (elf32_hppa_adjust_dynamic_symbol): When initialising weak aliases,
65 don't uselessly copy non_got_ref. Clear dyn_relocs instead if
66 strong symbol is allocated in dynbss. Tidy comments.
67 (elf32_hppa_relocate_section): Comment fix.
68 * elf32-ppc.c (ppc_elf_copy_indirect_symbol): Don't do anything
69 special with non_got_ref for weak aliases.
70 (ppc_elf_adjust_dynamic_symbol): When initialising weak aliases,
71 don't uselessly copy non_got_ref. Clear dyn_relocs instead if
72 strong symbol is allocated in dynbss. Tidy comments.
73 * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Don't do anything
74 special with non_got_ref for weak aliases.
75 (ppc64_elf_adjust_dynamic_symbol): When initialising weak aliases,
76 don't uselessly copy non_got_ref. Clear dyn_relocs instead if
77 strong symbol is allocated in dynbss. Tidy comments.
78
4581a1c7
NC
792017-11-29 Nick Clifton <nickc@redhat.com>
80
81 PR 22509
82 * coffcode.h (coff_slurp_reloc_table): Check for a NULL symbol
83 pointer when processing relocs.
84
ca39c2f4
SS
852017-11-29 Stefan Stroe <stroestefan@gmail.com>
86
87 * po/Make-in (datadir): Define as @datadir@.
88 (localedir): Define as @localedir@.
89 (gnulocaledir, gettextsrcdir): Use @datarootdir@.
90
b0029dce
NC
912017-11-28 Nick Clifton <nickc@redhat.com>
92
93 PR 22507
94 * coffgen.c (_bfd_coff_read_string_table): Check for an excessive
95 size of the external string table.
96
b23dc97f
NC
972017-11-28 Nick Clifton <nickc@redhat.com>
98
99 PR 22506
100 * reloc.c (reloc_offset_in_range): Rename to
101 bfd_reloc_offset_in_range and export.
102 (bfd_perform_relocation): Rename function invocation.
103 (bfd_install_relocation): Likewise.
104 (bfd_final_link_relocate): Likewise.
105 * bfd-in2.h: Regenerate.
106 * coff-arm.c (coff_arm_reloc): Use bfd_reloc_offset_in_range.
107 * coff-i386.c (coff_i386_reloc): Likewise.
108 * coff-i860.c (coff_i860_reloc): Likewise.
109 * coff-m68k.c (mk68kcoff_common_addend_special_fn): Likewise.
110 * coff-m88k.c (m88k_special_reloc): Likewise.
111 * coff-mips.c (mips_reflo_reloc): Likewise.
112 * coff-x86_64.c (coff_amd64_reloc): Likewise.
113
6c6bc899
L
1142017-11-28 H.J. Lu <hongjiu.lu@intel.com>
115
116 * elf-m10300.c (mn10300_elf_check_relocs): Don't set
117 non_ir_ref_regular.
118 * elf32-arm.c (elf32_arm_check_relocs): Likewise.
119 * elf32-bfin.c (bfin_check_relocs): Likewise.
120 * elf32-cr16.c (cr16_elf_check_relocs): Likewise.
121 * elf32-cris.c (cris_elf_check_relocs): Likewise.
122 * elf32-d10v.c (elf32_d10v_check_relocs): Likewise.
123 * elf32-dlx.c (elf32_dlx_check_relocs): Likewise.
124 * elf32-fr30.c (fr30_elf_check_relocs): Likewise.
125 * elf32-frv.c (elf32_frv_check_relocs): Likewise.
126 * elf32-hppa.c (elf32_hppa_check_relocs): Likewise.
127 * elf32-i370.c (i370_elf_check_relocs): Likewise.
128 * elf32-i386.c (elf_i386_check_relocs): Likewise.
129 * elf32-iq2000.c (iq2000_elf_check_relocs): Likewise.
130 * elf32-lm32.c (lm32_elf_check_relocs): Likewise.
131 * elf32-m32c.c (m32c_elf_check_relocs): Likewise.
132 * elf32-m32r.c (m32r_elf_check_relocs): Likewise.
133 * elf32-m68hc1x.c (elf32_m68hc11_check_relocs): Likewise.
134 * elf32-m68k.c (elf_m68k_check_relocs): Likewise.
135 * elf32-mcore.c (mcore_elf_check_relocs): Likewise.
136 * elf32-metag.c (elf_metag_check_relocs): Likewise.
137 * elf32-microblaze.c (microblaze_elf_check_relocs): Likewise.
138 * elf32-moxie.c (moxie_elf_check_relocs): Likewise.
139 * elf32-msp430.c (elf32_msp430_check_relocs): Likewise.
140 * elf32-mt.c (mt_elf_check_relocs): Likewise.
141 * elf32-nios2.c (nios2_elf32_check_relocs): Likewise.
142 * elf32-or1k.c (or1k_elf_check_relocs): Likewise.
143 * elf32-ppc.c (ppc_elf_check_relocs): Likewise.
144 * elf32-rl78.c (rl78_elf_check_relocs): Likewise.
145 * elf32-s390.c (elf_s390_check_relocs): Likewise.
146 * elf32-score.c (s3_bfd_score_elf_check_relocs): Likewise.
147 * elf32-score7.c (s7_bfd_score_elf_check_relocs): Likewise.
148 * elf32-sh.c (sh_elf_check_relocs): Likewise.
149 * elf32-tic6x.c (elf32_tic6x_check_relocs): Likewise.
150 * elf32-tilepro.c (tilepro_elf_check_relocs): Likewise.
151 * elf32-v850.c (v850_elf_check_relocs): Likewise.
152 * elf32-vax.c (elf_vax_check_relocs): Likewise.
153 * elf32-xstormy16.c (xstormy16_elf_check_relocs): Likewise.
154 * elf32-xtensa.c (elf_xtensa_check_relocs): Likewise.
155 * elf64-aarch64.c (elf64_aarch64_check_relocs): Likewise.
156 * elf64-alpha.c (elf64_alpha_check_relocs): Likewise.
157 * elf64-hppa.c (elf64_hppa_check_relocs): Likewise.
158 * elf64-ia64-vms.c (elf64_ia64_check_relocs): Likewise.
159 * elf64-mmix.c (mmix_elf_check_relocs): Likewise.
160 * elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
161 * elf64-s390.c (elf_s390_check_relocs): Likewise.
162 * elf64-sh64.c (sh_elf64_check_relocs): Likewise.
163 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
164 * elfnn-aarch64.c (elfNN_aarch64_check_relocs): Likewise.
165 * elfnn-ia64.c (elfNN_ia64_check_relocs): Likewise.
166 * elfnn-riscv.c (riscv_elf_check_relocs): Likewise.
167 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
168 * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Likewise.
169 * elfxx-tilegx.c (tilegx_elf_check_relocs): Likewise.
170
165f707a
AM
1712017-11-28 Alan Modra <amodra@gmail.com>
172
173 PR 22471
174 * elflink.c (_bfd_elf_merge_symbol): Allow weak symbols to override
175 early passes over linker script symbols.
176 * linker.c (_bfd_generic_link_add_one_symbol): Allow symbols to
177 override early passes over linker script symbols. Clear ldscript_def
178 on symbol definitions.
179
cd5b2bab
AM
1802017-11-28 Alan Modra <amodra@gmail.com>
181
182 * elf64-mmix.c (bfd_elf64_bfd_copy_link_hash_symbol_type): Define.
183
a83ef4d1
L
1842017-11-28 H.J. Lu <hongjiu.lu@intel.com>
185
186 PR ld/22502
187 * elflink.c (_bfd_elf_merge_symbol): Also skip definition from
188 an IR object.
189 (elf_link_add_object_symbols): If linker plugin is enabled, set
190 non_ir_ref_regular on symbols referenced in regular objects so
191 that linker plugin will get the correct symbol resolution.
192
6dda7875
SN
1932017-11-27 Szabolcs Nagy <szabolcs.nagy@arm.com>
194
195 PR ld/22263
196 * elfnn-aarch64.c (elfNN_aarch64_relocate_section): Use
197 bfd_link_executable instead of bfd_link_pic for TLS.
198 (elfNN_aarch64_allocate_dynrelocs): Likewise.
199 (aarch64_can_relax_tls): Likewise.
200
a377ae2a
SN
2012017-11-27 Szabolcs Nagy <szabolcs.nagy@arm.com>
202
203 PR ld/22269
204 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Use
205 UNDEFWEAK_NO_DYNAMIC_RELOC to avoid dynamic GOT relocs.
206 (elfNN_aarch64_allocate_dynrelocs): Likewise.
207
276da9b3
L
2082017-11-24 H.J. Lu <hongjiu.lu@intel.com>
209
210 PR binutils/22444
211 * elf.c (elf_read_notes): Add an argument for note aligment.
212 (elf_parse_notes): Likewise.
213 (_bfd_elf_make_section_from_shdr): Pass section aligment to
214 elf_parse_notes.
215 (bfd_section_from_phdr): Pass segment aligment to elf_read_notes.
216 (elf_parse_notes): Add an argument for note aligment. Use
217 ELF_NOTE_DESC_OFFSET to get the offset of the note descriptor.
218 Use ELF_NOTE_NEXT_OFFSET to get the offset of the next note
219 entry.
220 (elf_read_notes): Add an argument for note aligment and pass it
221 to elf_parse_notes.
222
287c7eaf
AM
2232017-11-23 Alan Modra <amodra@gmail.com>
224
225 * elf32-hppa.c (pc_dynrelocs): Define.
226 (elf32_hppa_copy_indirect_symbol): Don't copy dyn_relocs to weakdefs.
227 (alias_readonly_dynrelocs): New function.
228 (elf32_hppa_adjust_dynamic_symbol): Don't clear non_got_ref to
229 indicate dyn_relocs should be discarded, discard them here.
230 Use alias_readonly_dynrelocs.
231 (allocate_dynrelocs): Don't test or clear non_got_ref.
232 (elf32_hppa_relocate_section): Simplify test for dynamic relocs.
233 * elf32-ppc.c (ppc_elf_copy_indirect_symbol): Don't copy dyn_relocs
234 to weakdefs.
235 (alias_readonly_dynrelocs, pc_dynrelocs): New functions.
236 (ppc_elf_adjust_dynamic_symbol): Don't clear non_got_ref to
237 indicate dyn_relocs should be discarded, discard them here.
238 Use alias_readonly_dynrelocs.
239 (allocate_dynrelocs): Don't test or clear non_got_ref.
240 (ppc_elf_relocate_section): Simplify test for dynamic relocs.
241
ab2477e1
AM
2422017-11-23 Alan Modra <amodra@gmail.com>
243
244 * elf64-ppc.c (struct ppc_link_hash_entry): Delete weakref field.
245 (ppc64_elf_copy_indirect_symbol): Don't set weakref.
246 (alias_readonly_dynrelocs): Use u.alias rather than weakref.
247 (ppc64_elf_adjust_dynamic_symbol): Don't use
248 alias_readonly_dynrelocs for function symbols.
249
60d67dc8
AM
2502017-11-23 Alan Modra <amodra@gmail.com>
251
252 * elf-bfd.h (struct elf_link_hash_entry): Add is_weakalias.
253 Rename u.weakdef to u.alias and update comment.
254 (weakdef): New static inline function.
255 * elflink.c (bfd_elf_record_link_assignment) Test is_weakalias
256 rather than u.weakdef != NULL, and use weakdef function.
257 (_bfd_elf_adjust_dynamic_symbol): Likewise.
258 (_bfd_elf_fix_symbol_flags): Likewise. Clear is_weakalias on
259 all aliases if def has been overridden in a regular object, not
260 u.weakdef.
261 (elf_link_add_object_symbols): Delete new_weakdef flag. Test
262 is_weakalias and use weakdef. Set is_weakalias and circular
263 u.alias. Update comments.
264 (_bfd_elf_gc_mark_rsec): Test is_weakalias rather than
265 u.weakdef != NULL and use weakdef function.
266 * elf-m10300.c (_bfd_mn10300_elf_adjust_dynamic_symbol): Test
267 is_weakalias rather than u.weakdef != NULL and use weakdef
268 function. Assert that def is strong defined.
269 * elf32-arc.c (elf_arc_adjust_dynamic_symbol): Likewise.
270 * elf32-arm.c (elf32_arm_adjust_dynamic_symbol): Likewise.
271 * elf32-bfin.c (elf32_bfinfdpic_adjust_dynamic_symbol): Likewise.
272 (bfin_adjust_dynamic_symbol): Likewise.
273 * elf32-cr16.c (_bfd_cr16_elf_adjust_dynamic_symbol): Likewise.
274 * elf32-cris.c (elf_cris_adjust_dynamic_symbol): Likewise.
275 * elf32-frv.c (elf32_frvfdpic_adjust_dynamic_symbol): Likewise.
276 * elf32-hppa.c (elf32_hppa_adjust_dynamic_symbol): Likewise.
277 * elf32-i370.c (i370_elf_adjust_dynamic_symbol): Likewise.
278 * elf32-lm32.c (lm32_elf_adjust_dynamic_symbol): Likewise.
279 * elf32-m32r.c (m32r_elf_adjust_dynamic_symbol): Likewise.
280 * elf32-m68k.c (elf_m68k_adjust_dynamic_symbol): Likewise.
281 * elf32-metag.c (elf_metag_adjust_dynamic_symbol): Likewise.
282 * elf32-microblaze.c (microblaze_elf_adjust_dynamic_symbol): Likewise.
283 * elf32-nds32.c (nds32_elf_adjust_dynamic_symbol): Likewise.
284 * elf32-nios2.c (nios2_elf32_adjust_dynamic_symbol): Likewise.
285 * elf32-or1k.c (or1k_elf_adjust_dynamic_symbol): Likewise.
286 * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Likewise.
287 * elf32-s390.c (elf_s390_adjust_dynamic_symbol): Likewise.
288 * elf32-score.c (s3_bfd_score_elf_adjust_dynamic_symbol): Likewise.
289 * elf32-score7.c (s7_bfd_score_elf_adjust_dynamic_symbol): Likewise.
290 * elf32-sh.c (sh_elf_adjust_dynamic_symbol): Likewise.
291 * elf32-tic6x.c (elf32_tic6x_adjust_dynamic_symbol): Likewise.
292 * elf32-tilepro.c (tilepro_elf_gc_mark_hook): Likewise.
293 (tilepro_elf_adjust_dynamic_symbol): Likewise.
294 * elf32-vax.c (elf_vax_adjust_dynamic_symbol): Likewise.
295 * elf32-xtensa.c (elf_xtensa_adjust_dynamic_symbol): Likewise.
296 * elf64-alpha.c (elf64_alpha_adjust_dynamic_symbol): Likewise.
297 * elf64-hppa.c (elf64_hppa_adjust_dynamic_symbol): Likewise.
298 * elf64-ia64-vms.c (elf64_ia64_adjust_dynamic_symbol): Likewise.
299 * elf64-ppc.c (ppc64_elf_gc_mark_hook): Likewise.
300 (ppc64_elf_adjust_dynamic_symbol): Likewise.
301 * elf64-s390.c (elf_s390_adjust_dynamic_symbol): Likewise.
302 * elf64-sh64.c (sh64_elf64_adjust_dynamic_symbol): Likewise.
303 * elfnn-aarch64.c (elfNN_aarch64_adjust_dynamic_symbol): Likewise.
304 * elfnn-ia64.c (elfNN_ia64_adjust_dynamic_symbol): Likewise.
305 * elfnn-riscv.c (riscv_elf_adjust_dynamic_symbol): Likewise.
306 * elfxx-mips.c (_bfd_mips_elf_adjust_dynamic_symbol): Likewise.
307 * elfxx-sparc.c (_bfd_sparc_elf_gc_mark_hook): Likewise.
308 (_bfd_sparc_elf_adjust_dynamic_symbol): Likewise.
309 * elfxx-tilegx.c (tilegx_elf_gc_mark_hook): Likewise.
310 (tilegx_elf_adjust_dynamic_symbol): Likewise.
311 * elfxx-x86.c (_bfd_x86_elf_adjust_dynamic_symbol): Likewise.
312
0ee5a0e4
AM
3132017-11-21 Alan Modra <amodra@gmail.com>
314
315 * elf-bfd.h (elf_symbol_from): Check for NULL symbol bfd.
316 * elfcode.h (elf_slurp_reloc_table_from_section): Add FIXME comment.
317
b77db948
NC
3182017-11-20 Nick Clifton <nickc@redhat.com>
319
320 PR 22450
321 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Skip
322 objects without a GNU_PROPERTY note section when looking for a bfd
323 onto which notes can be accumulated.
324
28e07a05
AM
3252017-11-20 Alan Modra <amodra@gmail.com>
326
327 PR 22451
328 PR 22460
329 * elf.c (_bfd_elf_init_reloc_shdr): Delete "sec_hdr" parameter
330 and leave rel_hdr->sh_flags zero. Update calls.
331 (bfd_elf_set_group_contents): Check input rel/rela SHF_GROUP
332 flag when !gas before adding rel/rela section to group. Set
333 output rel/rela SHF_GROUP flags.
334
671275c3
JW
3352017-11-18 Jim Wilson <jimw@sifive.com>
336
337 * elfnn-riscv.c (_bfd_riscv_relax_align): Add space between alignment
338 and to in error message.
339
2c244f9b
L
3402017-11-17 H.J. Lu <hongjiu.lu@intel.com>
341
342 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Pass
343 "%F%P:", instead of "%F:", to linker callback in case of error.
344
80a04378
NC
3452017-11-16 Nick Clifton <nickc@redhat.com>
346
347 PR 22421
348 * elf.c (elfcore_grok_netbsd_procinfo): Check that the note is big enough.
349 (elfcore_grok_openbsd_procinfo): Likewise.
350 (elfcore_grok_nto_status): Likewise.
351
38b28f70
NC
3522017-11-16 Nick Clifton <nickc@redhat.com>
353
354 * merge.c (sec_merge_emit): Always create padding buffer. Add
355 asserts to make sure that the buffer is long enough.
356
a5065160
AM
3572017-11-15 Alan Modra <amodra@gmail.com>
358
359 * bfd.c (union _bfd_doprnt_args): Add "Bad".
360 (_bfd_doprnt): Handle more flags.
361 (_bfd_doprnt_scan): Likewise. Tidy setting of args array.
362 (error_handler_internal): Init args type to Bad.
363
06bcf541
AM
3642017-11-14 Alan Modra <amodra@gmail.com>
365
366 PR 22431
367 * elf64-ppc.c (ppc64_elf_size_dynamic_sections): Warn on discarding
368 non-empty dynamic section.
369 (ppc_build_one_stub): Take elf_gp from output bfd, not output
370 section owner.
371 (ppc_size_one_stub, ppc64_elf_next_toc_section): Likewise.
372
2d0d44d5
AM
3732017-11-14 Alan Modra <amodra@gmail.com>
374
375 * elf64-ppc.c (ppc64_elf_size_stubs): Correct test for user
376 .eh_frame info.
377
5be87c8f
JB
3782017-11-13 Jan Beulich <jbeulich@suse.com>
379
380 * coff-tic80.c (COFF_ENCODE_ALIGNMENT, COFF_DECODE_ALIGNMENT):
381 Define.
382 * coffcode.h (coff_set_alignment_hook): Drop tic80 special case.
383 (coff_write_object_contents): Likewise. Issue diagnostic for too
384 large alignment.
385
f882209d
L
3862017-11-12 H.J. Lu <hongjiu.lu@intel.com>
387
388 PR ld/22423
389 * elf.c (_bfd_elf_map_sections_to_segments): Remove PF_X from
390 PT_PHDR segment.
391
e3e53eed
AM
3922017-11-12 Alan Modra <amodra@gmail.com>
393
394 * elflink.c (elf_link_add_object_symbols): Ignore anything but
395 defined and defweak symbols when setting up weakdefs.
396
529fe20e
AM
3972017-11-12 Alan Modra <amodra@gmail.com>
398
399 * elf32-hppa.c (elf32_hppa_adjust_dynamic_symbol): Set non_got_ref
400 to keep dyn_relocs, clear to discard. Comment.
401 (allocate_dynrelocs): Always clear non_got_ref when clearing
402 dyn_relocs in non-pic case. Invert non_got_ref test. Also test
403 dynamic_adjusted and ELF_COMMON_DEF_P. Move code deleting
404 dyn_relocs on undefined syms to handle for non-pic too.
405 (elf32_hppa_relocate_section): Simplify test for non-pic dyn relocs.
406 * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Set non_got_ref
407 to keep dyn_relocs, clear to discard. Comment.
408 (allocate_dynrelocs): Always clear non_got_ref when clearing
409 dyn_relocs in non-pic case. Invert non_got_ref test. Also test
410 dynamic_adjusted and ELF_COMMON_DEF_P. Move code deleting
411 dyn_relocs on undefined syms to handle for non-pic too.
412 (ppc_elf_relocate_section): Simplify test for non-pic dyn relocs.
413 * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Discard
414 dyn_relocs here. Don't bother setting non_got_ref. Comment.
415 (allocate_dynrelocs): Delete special handling of non-pic ELFv2
416 ifuncs. Move code deleting dyn_relocs on undefined symbols to
417 handle for non-pic too. Don't test non_got_ref. Do test
418 dynamic_adjusted and ELF_COMMON_DEF_P.
419
c9ec0e89
DT
4202017-11-08 Djordje Todorovic <djordje.todorovic@rt-rk.com>
421
422 * elf32-mips.c (elf32_mips_grok_psinfo): Extract core->pid.
423 * elf64-mips.c (elf64_mips_grok_psinfo): Likewise.
424 * elfn32-mips.c (elf32_mips_grok_psinfo): Likewise.
425
9031cb4a
DT
4262017-11-08 Djordje Todorovic <djordje.todorovic@rt-rk.com>
427
428 * elf32-mips.c (elf32_mips_write_core_note): New function.
429 (elf_backend_write_core_note): New macro.
430 * elf64-mips.c (elf64_mips_write_core_note): New function.
431 (elf_backend_write_core_note): New macro.
432 * elfn32-mips.c (elf32_mips_write_core_note): New function.
433 (elf_backend_write_core_note): New macro.
434
db84fff3
AM
4352017-11-07 Alan Modra <amodra@gmail.com>
436
437 * elf64-ppc.c (ppc64_elf_build_stubs): Correct pluralization in
438 statistics message.
439
6003e27e
AM
4402017-11-07 Alan Modra <amodra@gmail.com>
441
442 * sysdep.h: Formatting, comment fixes.
443 (gettext, ngettext): Redefine when ENABLE_NLS.
444 (ngettext, dngettext, dcngettext): Define when !ENABLE_NLS.
445 (_): Define using gettext.
446 (textdomain, bindtextdomain): Use safer "do nothing".
447 * hosts/alphavms.h (textdomain, bindtextdomain): Likewise.
448 (ngettext, dngettext, dcngettext): Define when !ENABLE_NLS.
449
26a93010
AM
4502017-11-05 Alan Modra <amodra@gmail.com>
451
452 PR 22397
453 * bfd.c (_bfd_doprnt_scan): Check args index before storing, not
454 after.
455
7167fe4c
AM
4562017-11-05 Alan Modra <amodra@gmail.com>
457
458 PR 22397
459 * bfd.c (union _bfd_doprnt_args): New.
460 (PRINT_TYPE): Add FIELD arg. Take value from args.
461 (_bfd_doprnt): Replace ap parameter with args. Adjust all
462 PRINT_TYPE invocations and reading of format args to suit.
463 Move "%%" handling out of switch handling args. Support
464 positional parameters.
465 (_bfd_doprnt_scan): New function.
466 (error_handler_internal): Call _bfd_doprnt_scan and read args.
467
f15d0b54
AM
4682017-11-04 Alan Modra <amodra@gmail.com>
469
470 * elf32-ppc.c (got_entries_needed, got_relocs_needed): New functions.
471 (allocate_dynrelocs, ppc_elf_size_dynamic_sections): Use them here.
472 (ppc_elf_relocate_section): Don't output a dynamic relocation
473 for IE GOT entries in an executable.
474 * elf64-ppc.c (allocate_got): Trim unnecessary TPREL relocs.
475 (ppc64_elf_size_dynamic_sections): Likewise.
476 (ppc64_elf_relocate_section): Likewise.
477
98bbb1b8
AM
4782017-11-04 Alan Modra <amodra@gmail.com>
479
480 * elf32-ppc.c (readonly_dynrelocs): Delete info param. Update all
481 callers. Don't bother with SEC_ALLOC test. Return section pointer.
482 Move minfo call to..
483 (maybe_set_textrel): ..here.
484 * elf64-ppc.c (readonly_dynrelocs): Return section pointer.
485 (maybe_set_textrel): Call minfo to print textrel warning to map file.
486
2e684e75
AM
4872017-11-04 Alan Modra <amodra@gmail.com>
488
489 * elf32-hppa.c (enum _tls_type): Move.
490 (struct elf32_hppa_link_hash_entry): Make tls_type a bitfield.
491 (elf32_hppa_check_relocs): Set DF_STATIC_TLS only for shared libraries.
492 Tidy tls_type handling. Set symbol tls_type for GOT_TLS_LDM too.
493 (got_entries_needed, got_relocs_needed): New functions.
494 (allocate_dynrelocs): Use them.
495 (elf32_hppa_size_dynamic_sections): Likewise.
496 (elf32_hppa_relocate_section): Delete bogus FIXME. Formatting.
497 Correct code emitting relocs on GD/IE got entries. Report an
498 error when a symbol has both normal and TLS GOT relocs.
499
127e8e9f
AM
5002017-11-04 Alan Modra <amodra@gmail.com>
501
502 PR 22394
503 * elf32-hppa.c (elf32_hppa_check_relocs): Don't create dyn_relocs
504 for plabels when non-pic.
505 (maybe_set_textrel): New function.
506 (readonly_dynrelocs): Move and rewrite.
507 (elf32_hppa_adjust_dynamic_symbol): Use it. Don't create copy
508 relocs when def_regular or -z nocopyreloc. Handle non_got_ref
509 for functions. Expand non_got_ref comments.
510 (elf32_hppa_size_dynamic_sections): Use maybe_set_textrel.
511
79b0c981
L
5122017-11-03 H.J. Lu <hongjiu.lu@intel.com>
513
514 * elf32-i386.c (elf_i386_check_relocs): Set plt.refcount to 1.
515 Don't use func_pointer_refcount. Don't set plt.refcount nor
516 non_got_ref for function pointer reference.
517 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
518 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Don't use
519 func_pointer_refcount.
520 (_bfd_x86_elf_copy_indirect_symbol): Don't copy
521 func_pointer_refcount.
522 (_bfd_x86_elf_hide_symbol): Don't use func_pointer_refcount.
523 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): Likewise.
524 (elf_x86_link_hash_entry): Remove func_pointer_refcount.
525
6cee8979
NC
5262017-11-03 Mingi Cho <mgcho.minic@gmail.com>
527 Nick Clifton <nickc@redhat.com>
528
529 PR 22385
530 * coffgen.c (_bfd_coff_get_external_symbols): Check for an
531 overlarge raw syment count.
532 (coff_get_normalized_symtab): Likewise.
533
81b42bca
JB
5342017-11-01 James Bowman <james.bowman@ftdichip.com>
535
536 * archures.c: Add bfd_mach_ft32b.
537 * cpu-ft32.c: Add arch_info_struct.
538 * elf32-ft32.c: Add R_FT32_RELAX, SC0, SC1,
539 DIFF32.
540 (ft32_elf_relocate_section): Add clauses for R_FT32_SC0, SC1,
541 DIFF32.
542 (ft32_reloc_shortable, elf32_ft32_is_diff_reloc)
543 (elf32_ft32_adjust_diff_reloc_value)
544 (elf32_ft32_adjust_reloc_if_spans_insn)
545 (elf32_ft32_relax_delete_bytes, elf32_ft32_relax_is_branch_target)
546 (ft32_elf_relax_section): New function.
547 * reloc.c: Add BFD_RELOC_FT32_RELAX, SC0, SC1, DIFF32.
548 * bfd-in2.h: Regenerate.
549 * libbfd.h: Regenerate.
550
a67d66eb
NC
5512017-11-01 Nick Clifton <nickc@redhat.com>
552
553 PR 22376
554 * coffcode.h (coff_slurp_line_table): Check for an excessively
555 large line number count.
556
e0115a84
NC
5572017-11-01 Nick Clifton <nickc@redhat.com>
558
559 PR 22373
560 * peicode.h (pe_bfd_read_buildid): Revise check for invalid size
561 and offset in light of further possible bogus values.
562
3988aed5
AM
5632017-11-01 Alan Modra <amodra@gmail.com>
564
565 PR 22374
566 * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Don't create a plt
567 entry when just a dynamic reloc can serve. Ensure no dynamic
568 relocations when UNDEFWEAK_NO_DYNAMIC_RELOC by setting non_got_ref.
569 Expand and move the non_got_ref comment.
570 * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Likewise.
571
ee357486
NC
5722017-11-01 Nick Clifton <nickc@redhat.com>
573
574 PR 22369
575 * coffgen.c (_bfd_coff_free_symbols): Fail if called on a non-COFF
576 file.
577 * cofflink.c (coff_link_check_archive_element): Skip non-COFF
578 members of an archive.
579
0bb6961f
NC
5802017-10-31 Nick Clifton <nickc@redhat.com>
581
582 PR 22373
583 * peicode.h (pe_bfd_read_buildid): Check for invalid size and data
584 offset values.
585
81742b83
AM
5862017-10-30 Alan Modra <amodra@gmail.com>
587
7f9cb5d2
AM
588 * elf32-frv.c (ELF_TARGET_ID): Don't define for generic
589 elf target.
590
81742b83
AM
591 * elflink.c (elf_gc_sweep): Test elf_object_id in addition to
592 relocs_compatible.
593 (bfd_elf_gc_sections): Likewise.
594
d336fa6d
AM
5952017-10-30 Alan Modra <amodra@gmail.com>
596
597 PR 22269
598 * elf32-hppa.c (elf32_hppa_check_relocs): Move SEC_ALLOC test to
599 ensure non_got_ref is not set due to debug references.
600 (elf32_hppa_adjust_dynamic_symbol): Tidy plabel handling. Use
601 SYMBOL_CALLS_LOCAL and UNDEFWEAK_NO_DYNAMIC_RELOC when determining
602 need for a plt entry.
603 (allocate_dynrelocs): Similarly for got entries. Tidy code discarding
604 dynamic relocs when pic. Remove bogus code attempting to handle
605 commons.
606 (elf32_hppa_relocate_section): Similarly. Delete resolved_to_zero
607 and simplify.
608 (elf32_hppa_finish_dynamic_symbol): Use UNDEFWEAK_NO_DYNAMIC_RELOC
609 and SYMBOL_REFERENCES_LOCAL in GOT handling.
610
c0e331c7
AM
6112017-10-28 Alan Modra <amodra@gmail.com>
612
613 PR 22300
614 * elflink.c (_bfd_elf_merge_symbol): Remove relocs_compatible check.
615 * elf32-hppa.c (elf_backend_relocs_compatible): Define.
616 * elf32-ppc.c (elf_backend_relocs_compatible): Define.
617 * elf64-ppc.c (elf_backend_relocs_compatible): Define.
618
e601d38b
AM
6192017-10-25 Alan Modra <amodra@gmail.com>
620
621 * archive.c (_bfd_compute_and_write_armap): Match "__gnu_lto_slim"
622 optionally prefixed with "_".
623 * linker.c (_bfd_generic_link_add_one_symbol): Likewise.
624
3342be5d
AW
6252017-10-24 Andrew Waterman <andrew@sifive.com>
626
627 * elfnn-riscv.c (_bfd_riscv_relax_lui): Don't relax to c.lui
628 when rd is x0.
629
93f4de39
RL
6302017-10-24 Renlin Li <renlin.li@arm.com>
631
632 PR ld/21703
633 * elflink.c (_bfd_elf_merge_symbol): Handle multiple definition case.
634
66cae560
NC
6352017-10-23 Nick Clifton <nickc@redhat.com>
636
637 PR 22319
638 * elflink.c (elf_link_output_extsym): Keep global undefined
639 symbols if they have been marked as needed.
640
defc8e2b
MR
6412017-10-23 Maciej W. Rozycki <macro@imgtec.com>
642
643 * elfn32-mips.c (mips_elf_n32_mkobject): New prototype and
644 function.
645 (bfd_elf32_mkobject): Use `mips_elf_n32_mkobject' rather than
646 `_bfd_mips_elf_mkobject'.
647
56fbd041
HPN
6482017-10-22 Hans-Peter Nilsson <hp@axis.com>
649
650 PR gas/22304
651 * config.bfd (cris-*-* | crisv32-*-*): Require a 64-bit BFD.
652
9d06997a
PD
6532017-10-19 Palmer Dabbelt <palmer@dabbelt.com>
654
655 * elfnn-riscv.c (riscv_pcgp_hi_reloc): New structure.
656 (riscv_pcgp_lo_reloc): Likewise.
657 (riscv_pcgp_relocs): Likewise.
658 (riscv_init_pcgp_relocs): New function.
659 (riscv_free_pcgp_relocs): Likewise.
660 (riscv_record_pcgp_hi_reloc): Likewise.
661 (riscv_record_pcgp_lo_reloc): Likewise.
662 (riscv_delete_pcgp_hi_reloc): Likewise.
663 (riscv_use_pcgp_hi_reloc): Likewise.
664 (riscv_record_pcgp_lo_reloc): Likewise.
665 (riscv_find_pcgp_lo_reloc): Likewise.
666 (riscv_delete_pcgp_lo_reloc): Likewise.
667 (_bfd_riscv_relax_pc): Likewise.
668 (_bfd_riscv_relax_section): Handle R_RISCV_PCREL_* relocations
669 via the new functions above.
670
ff6f4d9b
PD
6712017-10-19 Palmer Dabbelt <palmer@dabbelt.com>
672
673 * elfnn-riscv.c (R_RISCV_DELETE): New define.
674 (_bfd_riscv_relax_delete): New function.
675 (perform_relocation): Handle R_RISCV_DELETE.
676 (_bfd_riscv_relax_section): Likewise.
677
28095894
L
6782017-10-19 H.J. Lu <hongjiu.lu@intel.com>
679
680 PR ld/22263
681 * elfxx-tilegx.c (tilegx_elf_tls_transition): Replace
682 bfd_link_pic with !bfd_link_executable, !bfd_link_pic with
683 bfd_link_executable for TLS check.
684 (tilegx_elf_check_relocs): Likewise.
685 (allocate_dynrelocs): Likewise.
686 (tilegx_elf_relocate_section): Likewise.
687
1ba1f393
L
6882017-10-19 H.J. Lu <hongjiu.lu@intel.com>
689
690 PR ld/22263
691 * elf32-tilepro.c (tilepro_elf_tls_transition): Replace
692 bfd_link_pic with !bfd_link_executable, !bfd_link_pic with
693 bfd_link_executable for TLS check.
694 (tilepro_elf_check_relocs): Likewise.
695 (allocate_dynrelocs): Likewise.
696 (tilepro_elf_relocate_section): Likewise.
697
6982017-10-19 H.J. Lu <hongjiu.lu@intel.com>
0fb7012e
L
699
700 PR ld/22263
701 * elfxx-sparc.c (sparc_elf_tls_transition): Replace
702 bfd_link_pic with !bfd_link_executable, !bfd_link_pic with
703 bfd_link_executable for TLS check.
704 (_bfd_sparc_elf_check_relocs): Likewise.
705 (allocate_dynrelocs): Likewise.
706 (_bfd_sparc_elf_relocate_section): Likewise.
707
8e354058
L
7082017-10-18 H.J. Lu <hongjiu.lu@intel.com>
709
710 * elf32-tilepro.c (tilepro_elf_gc_mark_hook): Call
711 _bfd_generic_link_add_one_symbol to mark __tls_get_addr.
712 * elfxx-tilegx.c (tilegx_elf_gc_mark_hook): Likewise.
713
b7213666
L
7142017-10-17 H.J. Lu <hongjiu.lu@intel.com>
715
716 * elf32-microblaze.c (microblaze_elf_check_relocs): Check for
717 indirect and warning symbols.
718
cf54ebff
AM
7192017-10-17 Alan Modra <amodra@gmail.com>
720
721 PR 22307
722 * elf-properties.c (_bfd_elf_parse_gnu_properties): Compare datasz
723 against size left rather than comparing pointers. Reorganise loop.
724
0301ce14
AM
7252017-10-17 Alan Modra <amodra@gmail.com>
726
727 PR 22306
728 * aoutx.h (aout_get_external_symbols): Handle stringsize of zero,
729 and error for any other size that doesn't cover the header word.
730
5c3261b0
L
7312017-10-16 H.J. Lu <hongjiu.lu@intel.com>
732
733 * elf-bfd.h (elf_backend_data): Remove gc_sweep_hook.
734 * elf32-arm.c (elf32_arm_gc_sweep_hook): Removed.
735 (elf_backend_gc_sweep_hook): Likewise.
736 * elf32-bfin.c (bfin_gc_sweep_hook): Likewise.
737 (bfinfdpic_gc_sweep_hook): Likewise.
738 (elf_backend_gc_sweep_hook): Likewise.
739 * elf32-cr16.c (elf32_cr16_gc_sweep_hook): Likewise.
740 (elf_backend_gc_sweep_hook): Likewise.
741 * elf32-cris.c (cris_elf_gc_sweep_hook): Likewise.
742 (elf_backend_gc_sweep_hook): Likewise.
743 * elf32-hppa.c (elf32_hppa_gc_sweep_hook): Likewise.
744 (elf_backend_gc_sweep_hook): Likewise.
745 * elf32-lm32.c (lm32_elf_gc_sweep_hook): Likewise.
746 (elf_backend_gc_sweep_hook): Likewise.
747 * elf32-m32r.c (m32r_elf_gc_sweep_hook): Likewise.
748 (elf_backend_gc_sweep_hook): Likewise.
749 * elf32-m68k.c (elf_m68k_got_entry): Remove elf_m68k_gc_sweep_hook
750 from comments.
751 (elf_m68k_remove_got_entry_type): Removed.
752 (elf_m68k_find_got_entry_ptr): Likewise.
753 (elf_m68k_remove_got_entry): Likewise.
754 (elf_m68k_gc_sweep_hook): Likewise.
755 (elf_backend_gc_sweep_hook): Likewise.
756 * elf32-mcore.c (mcore_elf_gc_sweep_hook): Likewise.
757 (elf_backend_gc_sweep_hook): Likewise.
758 * elf32-metag.c (elf_metag_gc_sweep_hook): Likewise.
759 (elf_backend_gc_sweep_hook): Likewise.
760 * elf32-microblaze.c (elf_backend_gc_sweep_hook): Likewise.
761 (elf_backend_gc_sweep_hook): Likewise.
762 * elf32-mips.c (elf_backend_gc_sweep_hook): Likewise.
763 (elf_backend_gc_sweep_hook): Likewise.
764 * elf32-nds32.c (nds32_elf_gc_sweep_hook): Likewise.
765 (elf_backend_gc_sweep_hook): Likewise.
766 * elf32-nios2.c (nios2_elf32_gc_sweep_hook): Likewise.
767 (elf_backend_gc_sweep_hook): Likewise.
768 * elf32-or1k.c (or1k_elf_gc_sweep_hook): Likewise.
769 (elf_backend_gc_sweep_hook): Likewise.
770 * elf32-ppc.c (ppc_elf_gc_sweep_hook): Likewise.
771 (elf_backend_gc_sweep_hook): Likewise.
772 * elf32-s390.c (elf_s390_gc_sweep_hook): Likewise.
773 (elf_backend_gc_sweep_hook): Likewise.
774 * elf32-sparc.c (elf_backend_gc_sweep_hook): Likewise.
775 * elf32-tic6x.c (elf32_tic6x_gc_sweep_hook): Likewise.
776 (elf_backend_gc_sweep_hook): Likewise.
777 * elf32-tilegx.c (elf_backend_gc_sweep_hook): Likewise.
778 * elf32-tilepro.c (tilepro_elf_gc_sweep_hook): Likewise.
779 (elf_backend_gc_sweep_hook): Likewise.
780 * elf32-vax.c (elf_vax_gc_sweep_hook): Likewise.
781 (elf_backend_gc_sweep_hook): Likewise.
782 * elf32-xtensa.c (elf_xtensa_gc_sweep_hook): Likewise.
783 (elf_backend_gc_sweep_hook): Likewise.
784 * elf64-alpha.c (elf64_alpha_gc_sweep_hook): Likewise.
785 (elf_backend_gc_sweep_hook): Likewise.
786 * elf64-mips.c (elf_backend_gc_sweep_hook): Likewise.
787 * elf64-mmix.c (mmix_elf_gc_sweep_hook): Likewise.
788 (elf_backend_gc_sweep_hook): Likewise.
789 * elf64-ppc.c (elf_backend_gc_sweep_hook): Likewise.
790 (ppc64_elf_gc_sweep_hook): Likewise.
791 * elf64-s390.c (elf_s390_gc_sweep_hook): Likewise.
792 (elf_backend_gc_sweep_hook): Likewise.
793 * elf64-sparc.c (elf_backend_gc_sweep_hook): Likewise.
794 * elf64-tilegx.c (elf_backend_gc_sweep_hook): Likewise.
795 * elflink.c (elf_link_add_object_symbols): Don't call
796 _bfd_elf_link_check_relocs here.
797 (gc_sweep_hook_fn): Removed.
798 (elf_gc_sweep): Remove gc_sweep_hook.
799 * elfnn-aarch64.c (elfNN_aarch64_gc_sweep_hook): Removed.
800 (elf_backend_gc_sweep_hook): Likewise.
801 * elfnn-riscv.c (riscv_elf_gc_sweep_hook): Likewise.
802 (elf_backend_gc_sweep_hook): Likewise.
803 * elfxx-mips.c (_bfd_mips_elf_gc_sweep_hook): Likewise.
804 * elfxx-mips.h (_bfd_mips_elf_gc_sweep_hook): Likewise.
805 (elf_backend_gc_sweep_hook): Likewise.
806 * elfxx-sparc.c (_bfd_sparc_elf_gc_sweep_hook): Likewise.
807 * elfxx-sparc.h (_bfd_sparc_elf_gc_sweep_hook): Likewise.
808 * elfxx-target.h (elf_backend_gc_sweep_hook): Likewise.
809 (elfNN_bed): Remove elf_backend_gc_sweep_hook.
810 * elfxx-tilegx.c (tilegx_elf_gc_sweep_hook): Removed.
811 * elfxx-tilegx.h (tilegx_elf_gc_sweep_hook): Likewise.
812
851b6fa1
L
8132017-10-14 H.J. Lu <hongjiu.lu@intel.com>
814
815 * elf32-i386.c (elf_i386_backend_data): Removed.
816 (get_elf_i386_backend_data): Likewise.
817 (elf_i386_arch_bed): Replace elf_i386_backend_data with
818 elf_x86_backend_data.
819 (elf_i386_get_synthetic_symtab): Likewise.
820 (elf_i386_nacl_arch_bed): Likewise.
821 (elf_i386_vxworks_arch_bed): Likewise.
822 (elf_i386_relocate_section): Check target_os instead of
823 is_vxworks.
824 (elf_i386_finish_dynamic_symbol): Likewise.
825 (elf_i386_finish_dynamic_sections): Use htab->plt0_pad_byte.
826 Check target_os instead of is_vxworks.
827 (elf_i386_link_setup_gnu_properties): Remove normal_target and
828 is_vxworks. Initialize plt0_pad_byte.
829 * elf64-x86-64.c (elf_x86_64_backend_data); Removed.
830 (get_elf_x86_64_arch_data): Likewise.
831 (get_elf_x86_64_backend_data): Likewise.
832 (elf_x86_64_arch_bed): Replace elf_x86_64_backend_data with
833 elf_x86_backend_data.
834 (elf_x86_64_get_synthetic_symtab): Likewise.
835 (elf_x86_64_nacl_arch_bed): Likewise.
836 (elf_x86_64_link_setup_gnu_properties): Remove is_vxworks and
837 normal_target. Initialize plt0_pad_byte.
838 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Check target_os
839 instead of is_vxworks.
840 (_bfd_x86_elf_size_dynamic_sections): Likewise.
841 (_bfd_x86_elf_finish_dynamic_sections): Likewise.
842 (_bfd_x86_elf_adjust_dynamic_symbol): Likewise.
843 (_bfd_x86_elf_link_hash_table_create): Initialize target_os.
844 (_bfd_x86_elf_link_setup_gnu_properties): Remove is_vxworks.
845 Update normal_target. Set up plt0_pad_byte. Check target_os
846 instead of is_vxworks.
847 * elfxx-x86.h (elf_x86_target_os): New.
848 (elf_x86_backend_data): Likewise.
849 (get_elf_x86_backend_data): Likewise.
850 (elf_x86_link_hash_table): Remove is_vxworks. Add plt0_pad_byte
851 and target_os.
852 (elf_x86_init_table): Remove normal_target and is_vxworks. Add
853 plt0_pad_byte.
854
9577f60b
L
8552017-10-14 H.J. Lu <hongjiu.lu@intel.com>
856
857 * elf32-i386.c (elf_i386_finish_dynamic_sections): Call
858 _bfd_x86_elf_finish_dynamic_sections.
859 * elf64-x86-64.c (elf_x86_64_finish_dynamic_sections): Likewise.
860 * elfxx-x86.c (_bfd_x86_elf_finish_dynamic_sections): New
861 function.
862 * elfxx-x86.h (_bfd_x86_elf_finish_dynamic_sections): New
863 prototype.
864
5d84490b
L
8652017-10-14 H.J. Lu <hongjiu.lu@intel.com>
866
867 PR ld/21384
868 * elf32-cris.c (elf_cris_discard_excess_program_dynamics): Don't
869 hide symbol which was forced to be dynamic.
870
e01c16a8
L
8712017-10-14 H.J. Lu <hongjiu.lu@intel.com>
872
873 PR ld/22269
874 * elf32-cris.c (cris_elf_relocate_section): Don't generate
875 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
876 (cris_elf_check_relocs): Don't allocate dynamic relocation
877 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
878
6ee6e05a
L
8792017-10-14 H.J. Lu <hongjiu.lu@intel.com>
880
881 PR ld/22269
882 * elf32-sh.c (allocate_dynrelocs): Discard dynamic relocations
883 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
884 (sh_elf_relocate_section): Don't generate dynamic relocation if
885 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
886
b27bb18f
L
8872017-10-14 H.J. Lu <hongjiu.lu@intel.com>
888
889 PR ld/22269
890 * elf32-s390.c (allocate_dynrelocs): Discard dynamic
891 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
892 (elf_s390_relocate_section): Don't generate dynamic relocation
893 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
894 * elf64-s390.c (allocate_dynrelocs): Discard dynamic
895 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
896 (elf_s390_relocate_section): Don't generate dynamic relocation
897 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
898
31a53da5
L
8992017-10-14 H.J. Lu <hongjiu.lu@intel.com>
900
901 PR ld/22269
902 * elf32-nios2.c (nios2_elf32_relocate_section): Don't generate
903 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
904 (allocate_dynrelocs): Discard dynamic relocations if
905 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
906
112fef40
L
9072017-10-14 H.J. Lu <hongjiu.lu@intel.com>
908
909 PR ld/22269
910 * elf32-microblaze.c (microblaze_elf_relocate_section): Don't
911 generate dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is
912 true.
913 (allocate_dynrelocs): Discard dynamic relocations if
914 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
915
5056ba1d
L
9162017-10-14 H.J. Lu <hongjiu.lu@intel.com>
917
918 PR ld/22269
919 * elf32-m68k.c (elf_m68k_check_relocs): Don't allocate dynamic
920 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
921 (elf_m68k_adjust_dynamic_symbol): Don't make symbol dynamic if
922 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
923 (elf_m68k_relocate_section): Don't generate dynamic relocation
924 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
925
60c1b909
L
9262017-10-14 H.J. Lu <hongjiu.lu@intel.com>
927
928 PR ld/22269
929 * elf32-hppa.c (ensure_undef_dynamic): Don't make undefined
930 symbol dynamic if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
931 (allocate_dynrelocs): Discard dynamic relocations if
932 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
933 (elf32_hppa_relocate_section): Don't generate dynamic
934 relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
935
db41f6eb
L
9362017-10-14 H.J. Lu <hongjiu.lu@intel.com>
937
938 PR ld/22269
939 * elfnn-ia64.c (elfNN_ia64_check_relocs): Don't allocate
940 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
941 (allocate_fptr): Don't allocate function pointer if
942 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
943 (allocate_dynrel_entries): Don't allocate dynamic relocation
944 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
945 (set_got_entry): Don't set GOT entry if
946 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
947 (set_pltoff_entry): Don't set PLTOFF entry if
948 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
949 (elfNN_ia64_relocate_section): Don't install dynamic relocation
950 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
951
ad951203
L
9522017-10-14 H.J. Lu <hongjiu.lu@intel.com>
953
954 PR ld/22269
955 * elfxx-mips.c (mips_elf_calculate_relocation): Don't generate
956 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
957 (allocate_dynrelocs): Don't allocate dynamic relocations if
958 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
959
95b03e4a
L
9602017-10-14 H.J. Lu <hongjiu.lu@intel.com>
961
962 PR ld/22269
963 * elf32-arm.c (elf32_arm_final_link_relocate): Don't generate
964 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
965 (allocate_dynrelocs_for_symbol): Discard dynamic relocations
966 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
967
a3cd202a
L
9682017-10-14 H.J. Lu <hongjiu.lu@intel.com>
969
970 PR ld/22269
971 * elf32-tilepro.c (allocate_dynrelocs): Discard dynamic
972 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
973 (tilepro_elf_relocate_section): Don't generate dynamic
974 relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
975 * elfxx-tilegx.c (allocate_dynrelocs): Discard dynamic
976 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
977 (tilegx_elf_relocate_section): Don't generate dynamic
978 relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
979
ddb7fd0f
L
9802017-10-14 H.J. Lu <hongjiu.lu@intel.com>
981
982 PR ld/22269
983 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Don't
984 generate dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is
985 true.
986 (elfNN_aarch64_allocate_dynrelocs): Discard dynamic relocations
987 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
988
62cd30f1
L
9892017-10-14 H.J. Lu <hongjiu.lu@intel.com>
990
991 * elf32-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Moved to ...
992 * elf-bfd.h (UNDEFWEAK_NO_DYNAMIC_RELOC): Here.
993 * elf64-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Removed.
994
3b4b0a62
JB
9952017-10-12 James Bowman <james.bowman@ftdichip.com>
996
997 * bfd-in2.h: Regenerate.
998 * libbfd.h: Regenerate.
999 * elf32-ft32.c: Add HOWTO R_FT32_15.
1000 * reloc.c: Add BFD_RELOC_FT32_15.
1001
1d75a8e2
NC
10022017-10-12 Nick Clifton <nickc@redhat.com>
1003
1004 * reloc.c (enum bfd_reloc_status): Start values at 2.
1005 * bfd-in2.h: Regenerate.
1006 * elfnn-aarch64.c (aarch64_relocate): Invert sense of function, so
1007 that a TRUE return indicates success. Compare the result of
1008 calling _bfd_aarch64_elf_put_addend against bfd_reloc_ok.
1009 (build_one_stub): Change sense of tests against aarch64_relocate
1010 return value.
1011 (elfNN_aarch64_tls_relax): Return bfd_reloc_notsupported, rather
1012 than FALSE, when an error is detected.
1013 (elfNN_aarch64_final_link_relocate): Likewise.
1014
9f857535
L
10152017-10-12 H.J. Lu <hongjiu.lu@intel.com>
1016
1017 * elf32-i386.c (elf_backend_hide_symbol): New.
1018 * elf64-x86-64.c (elf_backend_hide_symbol): Likewise.
1019 * elfxx-x86.c (_bfd_x86_elf_hide_symbol): Likewise.
1020 * elfxx-x86.h (_bfd_x86_elf_hide_symbol): Likewise.
1021
559192d8
AM
10222017-10-12 Alan Modra <amodra@gmail.com>
1023
1024 * elflink.c (_bfd_elf_adjust_dynamic_symbol): Call
1025 elf_backend_hide_symbol, not _bfd_elf_link_hash_hide_symbol.
1026 (bfd_elf_define_start_stop): Likewise.
1027
f5233a16
AM
10282017-10-12 Alan Modra <amodra@gmail.com>
1029
1030 * elf32-nds32.c (nds32_elf_size_dynamic_sections): Set .interp
1031 when executable rather than non-PIC.
1032 * elf32-score.c (s3_bfd_score_elf_size_dynamic_sections): Likewise.
1033 * elf32-score7.c (s7_bfd_score_elf_size_dynamic_sections): Likewise.
1034
3c9a7b0d
MR
10352017-10-11 Maciej W. Rozycki <macro@imgtec.com>
1036
1037 * elf-bfd.h (elf_backend_data): Add `linux_prpsinfo64_ugid16'
1038 member.
1039 * elf-linux-core.h (elf_external_linux_prpsinfo64): Rename to...
1040 (elf_external_linux_prpsinfo64_ugid32): ... this.
1041 (swap_linux_prpsinfo32_out): Rename to...
1042 (swap_linux_prpsinfo32_ugid32_out): ... this.
1043 (elf_external_linux_prpsinfo64_ugid16): New structure.
1044 (swap_linux_prpsinfo64_ugid16_out): New function.
1045 * elfxx-target.h [!elf_backend_linux_prpsinfo64_ugid16]
1046 (elf_backend_linux_prpsinfo64_ugid16): Define.
1047 (elfNN_bed): Initialize `linux_prpsinfo64_ugid16' member.
1048 * elf.c (elfcore_write_linux_prpsinfo64): Handle both variants
1049 of the 64-bit Linux core PRPSINFO note.
1050 * elf64-sh64.c (elf_backend_linux_prpsinfo64_ugid16): Define.
1051
a2f63b2e
MR
10522017-10-11 Maciej W. Rozycki <macro@imgtec.com>
1053
1054 * elf-bfd.h (elf_backend_data): Add `linux_prpsinfo32_ugid16'
1055 member.
1056 (elfcore_write_ppc_linux_prpsinfo32): Remove prototype.
1057 * elf32-ppc.c (elfcore_write_ppc_linux_prpsinfo32): Remove.
1058 (elf_external_ppc_linux_prpsinfo32)
1059 (swap_ppc_linux_prpsinfo32_out): Move to...
1060 * elf-linux-core.h (elf_external_linux_prpsinfo32_ugid32)
1061 (swap_linux_prpsinfo32_ugid32_out): ... these.
1062 (elf_external_linux_prpsinfo32): Rename to...
1063 (elf_external_linux_prpsinfo32_ugid16): ... this.
1064 (swap_linux_prpsinfo32_out): Rename to...
1065 (swap_linux_prpsinfo32_ugid16_out): ... this.
1066 * elfxx-target.h [!elf_backend_linux_prpsinfo32_ugid16]
1067 (elf_backend_linux_prpsinfo32_ugid16): Define.
1068 (elfNN_bed): Initialize `linux_prpsinfo32_ugid16' member.
1069 * elf.c (elfcore_write_linux_prpsinfo32): Handle both variants
1070 of the 32-bit Linux core PRPSINFO note.
1071 * elf32-am33lin.c (elf_backend_linux_prpsinfo32_ugid16): Define.
1072 * elf32-arm.c (elf_backend_linux_prpsinfo32_ugid16): Define.
1073 * elf32-cris.c (elf_backend_linux_prpsinfo32_ugid16): Define.
1074 * elf32-frv.c (elf_backend_linux_prpsinfo32_ugid16): Define.
1075 * elf32-i386.c (elf_backend_linux_prpsinfo32_ugid16): Define.
1076 * elf32-m32r.c (elf_backend_linux_prpsinfo32_ugid16): Define.
1077 * elf32-m68k.c (elf_backend_linux_prpsinfo32_ugid16): Define.
1078 * elf32-s390.c (elf_backend_linux_prpsinfo32_ugid16): Define.
1079 * elf32-sh.c (elf_backend_linux_prpsinfo32_ugid16): Define.
1080 * elf32-sparc.c (elf_backend_linux_prpsinfo32_ugid16): Define.
1081
72bc1bb9
MR
10822017-10-11 Maciej W. Rozycki <macro@imgtec.com>
1083
1084 * elf-linux-core.h (elf_external_linux_prpsinfo64): Move the
1085 `gap' member ahead of `pr_flag'.
1086
8f314ad5
PA
10872017-10-11 Pedro Alves <palves@redhat.com>
1088
1089 * bfd.c (_doprnt): Rename to ...
1090 (_bfd_doprnt): ... this.
1091 (error_handler_internal): Adjust.
1092
0f09b4d8
L
10932017-10-10 H.J. Lu <hongjiu.lu@intel.com>
1094
1095 * elf32-i386.c (elf_i386_check_relocs): Set GOT refcount to 1
1096 instead of incrementing it.
1097 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1098
6c699715
RL
10992017-10-10 Renlin Li <renlin.li@arm.com>
1100
1101 PR ld/21402
1102 * elf32-arm.c (allocate_dynrelocs_for_symbol): Only make undefined weak
1103 symbols into dynamic.
1104
fc3c5343
L
11052017-10-09 H.J. Lu <hongjiu.lu@intel.com>
1106
1107 PR ld/22274
1108 * elfnn-riscv.c (riscv_elf_link_hash_table): Add max_alignment.
1109 (riscv_elf_link_hash_table_create): Initialize max_alignment to
1110 (bfd_vma) -1.
1111 (_bfd_riscv_relax_section): Cache the max alignment of output
1112 sections if possible.
1113
b9399fcf
AM
11142017-10-10 Alan Modra <amodra@gmail.com>
1115
1116 * elf64-ppc.c (ppc64_elf_before_check_relocs): Set sec_type for
1117 .opd whenever .opd is present and non-zero size. Move code
1118 setting abiversion to/from output file earlier. Only set
1119 u.opd.func_sec when --gc-sections. Read relocs and set up
1120 u.opd.func_sec values here..
1121 (ppc64_elf_check_relocs): ..rather than here. Simplify opd
1122 section tests.
1123 (ppc64_elf_edit_opd): Don't set sec_type for .opd here.
1124
478c006f
L
11252017-10-09 H.J. Lu <hongjiu.lu@intel.com>
1126
1127 * elf-m10300.c (mn10300_elf_check_relocs): Don't free cached
1128 isymbuf.
1129
9d45a7de
L
11302017-10-09 H.J. Lu <hongjiu.lu@intel.com>
1131
1132 * elf32-bfin.c (bfin_size_dynamic_sections): Don't create the
1133 .interp section with "ld --no-dynamic-linker".
1134
b55ec8b6
AM
11352017-10-09 Alan Modra <amodra@gmail.com>
1136
1137 PR 22212
1138 * dwarf2.c (_bfd_dwarf2_cleanup_debug_info): Free
1139 funcinfo_hash_table and varinfo_hash_table.
1140
a72f95f7
L
11412017-10-08 H.J. Lu <hongjiu.lu@intel.com>
1142
1143 * elf32-sh.c (readonly_dynrelocs): Dump dynamic relocation
1144 in read-only section with minfo.
1145 (sh_elf_size_dynamic_sections): Likewise.
1146
f9799aae
L
11472017-10-08 H.J. Lu <hongjiu.lu@intel.com>
1148
1149 * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections): Remove
1150 a strayed comment.
1151
4c7236d3
L
11522017-10-08 H.J. Lu <hongjiu.lu@intel.com>
1153
1154 * elfxx-tilegx.c (tilegx_elf_finish_dynamic_sections): Set
1155 this_hdr.sh_entsize only if section size > 0.
1156
70090aa5
L
11572017-10-08 H.J. Lu <hongjiu.lu@intel.com>
1158
1159 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Reformat.
1160
f0f07ad1
L
11612017-10-07 H.J. Lu <hongjiu.lu@intel.com>
1162
1163 * elfxx-sparc.c (readonly_dynrelocs): Dump dynamic relocation
1164 in read-only section with minfo.
1165 (_bfd_sparc_elf_size_dynamic_sections): Likewise.
1166
99180bcc
L
11672017-10-06 H.J. Lu <hongjiu.lu@intel.com>
1168
1169 * elfxx-x86.h (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Update
1170 comments.
1171
544c67cd
JB
11722017-10-06 John Baldwin <jhb@FreeBSD.org>
1173
1174 * elf-bfd.h (struct elf_backend_data): Add
1175 `elf_backend_grok_freebsd_prstatus'.
1176 * elf.c (elfcore_grok_freebsd_note): Call
1177 `elf_backend_grok_freebsd_prstatus' to handle NT_PRSTATUS if
1178 present.
1179 * elfn32-mips.c (elf_n32_mips_grok_freebsd_prstatus): New
1180 function.
1181 (elf_backend_grok_freebsd_prstatus): Define.
1182 * elfxx-target.h (elf_backend_grok_freebsd_prstatus): Define.
1183 (elfNN_bed): Initialize `elf_backend_grok_freebsd_prstatus'.
1184
98b273dc
L
11852017-10-06 H.J. Lu <hongjiu.lu@intel.com>
1186
1187 * elf32-i386.c (elf_i386_check_relocs): Replace has_got_reloc
1188 and has_non_got_reloc with zero_undefweak.
1189 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1190 * elfxx-x86.c (_bfd_x86_elf_link_hash_newfunc): Initialize
1191 zero_undefweak to 1.
1192 (_bfd_x86_elf_copy_indirect_symbol): Replace has_got_reloc and
1193 has_non_got_reloc with zero_undefweak.
1194 * elfxx-x86.h (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Replace
1195 has_got_reloc and has_non_got_reloc with zero_undefweak.
1196 (elf_x86_link_hash_entry): Likewise.
1197
e0d8f431
L
11982017-10-06 H.J. Lu <hongjiu.lu@intel.com>
1199
1200 * elfxx-x86.h (COPY_INPUT_RELOC_P): Add "do/while(0);".
1201 (VERIFY_COPY_RELOC): Likewise.
1202
ff38b4cc
L
12032017-10-06 H.J. Lu <hongjiu.lu@intel.com>
1204
1205 * elfxx-x86.h (VERIFY_COPY_RELOC): New.
1206 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Use it.
1207 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
1208
f3180fa9
L
12092017-10-06 H.J. Lu <hongjiu.lu@intel.com>
1210
1211 * elfxx-x86.h (VERIFY_PLT_ENTRY): New.
1212 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Use it.
1213 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
1214
e74399c4
L
12152017-10-06 H.J. Lu <hongjiu.lu@intel.com>
1216
1217 * elfxx-x86.h (COPY_INPUT_RELOC_P): New.
1218 * elf32-i386.c (elf_i386_relocate_section): Use it.
1219 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
1220
aebcc8ff
L
12212017-10-06 H.J. Lu <hongjiu.lu@intel.com>
1222
1223 * elf32-i386.c (X86_SIZE_TYPE_P): New.
1224 (elf_i386_relocate_section): Use GENERATE_DYNAMIC_RELOCATION_P.
1225 * elf64-x86-64.c (X86_SIZE_TYPE_P): New.
1226 (elf_x86_64_relocate_section): Use GENERATE_DYNAMIC_RELOCATION_P.
1227 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): New.
1228
cf1070f1
L
12292017-10-06 H.J. Lu <hongjiu.lu@intel.com>
1230
1231 * elfxx-x86.h (POINTER_LOCAL_IFUNC_P): New.
1232 (PLT_LOCAL_IFUNC_P): Likewise.
1233 * elf32-i386.c (elf_i386_relocate_section): Use them.
1234 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
1235
f70656b2
L
12362017-10-06 H.J. Lu <hongjiu.lu@intel.com>
1237
1238 * elfxx-x86.h (GENERATE_RELATIVE_RELOC_P): New.
1239 * elf32-i386.c (elf_i386_relocate_section): Use it.
1240 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
1241
1f92404c
L
12422017-10-06 H.J. Lu <hongjiu.lu@intel.com>
1243
1244 * elfxx-x86.h (RESOLVED_LOCALLY_P): New.
1245 * elf32-i386.c (elf_i386_relocate_section): Use it.
1246 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
1247
daf1c414
L
12482017-10-06 H.J. Lu <hongjiu.lu@intel.com>
1249
1250 * elf32-i386.c (X86_PCREL_TYPE_P): New.
1251 (elf_i386_check_relocs): Use NEED_DYNAMIC_RELOCATION_P.
1252 * elf64-x86-64.c (IS_X86_64_PCREL_TYPE): Renamed to ...
1253 (X86_PCREL_TYPE_P): This.
1254 (elf_x86_64_check_relocs): Use NEED_DYNAMIC_RELOCATION_P.
1255 Replace IS_X86_64_PCREL_TYPE with X86_PCREL_TYPE_P.
1256 (elf_x86_64_relocate_section): Replace IS_X86_64_PCREL_TYPE with
1257 X86_PCREL_TYPE_P.
1258 * elfxx-x86.h (NEED_DYNAMIC_RELOCATION_P): New.
1259
51537393
L
12602017-10-06 H.J. Lu <hongjiu.lu@intel.com>
1261
1262 * elfxx-x86.h (TLS_TRANSITION_IE_TO_LE_P): New.
1263 * elf32-i386.c (elf_i386_tls_transition): Use it.
1264 * elf64-x86-64.c (elf_x86_64_tls_transition): Likewise.
1265
0caf6c82
L
12662017-10-05 H.J. Lu <hongjiu.lu@intel.com>
1267
1268 * elf32-ppc.c (readonly_dynrelocs): Add a link_info argument.
1269 Dump dynamic relocation in read-only section with minfo if
1270 needed.
1271 (ppc_elf_adjust_dynamic_symbol): Pass NULL to readonly_dynrelocs.
1272 (maybe_set_textrel): Likewise.
1273 (ppc_elf_size_dynamic_sections): Dump dynamic relocation in
1274 read-only section with minfo.
1275
6d5be5d6
JB
12762017-10-05 John Baldwin <jhb@FreeBSD.org>
1277
1278 * elf.c (elfcore_grok_freebsd_note): Handle NT_ARM_VFP.
1279
007873f5
L
12802017-10-05 H.J. Lu <hongjiu.lu@intel.com>
1281
1282 * elf32-tilepro.c (readonly_dynrelocs): Dump dynamic relocation
1283 in read-only section with minfo.
1284 (tilepro_elf_size_dynamic_sections): Likewise.
1285 * elfxx-tilegx.c (readonly_dynrelocs): Likewise.
1286 (tilegx_elf_size_dynamic_sections): Likewise.
1287
2ca7de37
PA
12882017-10-05 Pedro Alves <palves@redhat.com>
1289
1290 PR 22245
1291 * bfd.c (bfd_set_error): Revert 2017-10-04 change. Remove
1292 ellipsis parameter. Split out bfd_error_on_input code to..
1293 (bfd_set_input_error): .. New function.
1294 * archive.c (_bfd_write_archive_contents): Use bfd_set_input_error.
1295 * vms-lib.c (_bfd_vms_lib_write_archive_contents): Likewise.
1296 * bfd-in2.h: Regenerate.
1297
8c6716e5
AM
12982017-10-05 Alan Modra <amodra@gmail.com>
1299
1300 * elflink.c (elf_link_input_bfd): Correct ctor/dtor in init_array/
1301 fini_array error value.
1302
db4677b8
AM
13032017-10-05 Alan Modra <amodra@gmail.com>
1304
1305 PR 21167
1306 * elf.c (_bfd_elf_setup_sections): Don't trim reloc sections from
1307 groups.
1308 (_bfd_elf_init_reloc_shdr): Pass sec_hdr, use it to copy SHF_GROUP
1309 flag from section.
1310 (elf_fake_sections): Adjust calls. Exit immediately on failure.
1311 (bfd_elf_set_group_contents): Add associated reloc section indices
1312 to group contents.
1313
a5259595
AM
13142017-10-04 Alan Modra <amodra@gmail.com>
1315
1316 * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Don't sort or
1317 classify symbols for ELFv2.
1318
9ba5f27c
PK
13192017-10-04 Pavel I. Kryukov <kryukov@frtk.ru>
1320
1321 PR 22245
1322 * bfd.c (bfd_set_error): Avoid UB on passing arg to va_start that
1323 undergoes default promotion.
1324 * bfd-in2.h: Regenerate.
1325
dcd2b8a0
AM
13262017-10-02 Alan Modra <amodra@gmail.com>
1327
1328 * elf32-ppc.c (ppc_elf_relocate_section): Fix comment typo.
1329 * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
1330
20230942
AM
13312017-10-01 Alan Modra <amodra@gmail.com>
1332
1333 PR 21957
1334 * dwarf2.c (new_line_sorts_after): Remove end_sequence comparison.
1335 (add_line_info): Always put end_sequence last.
1336
4b04bba2
AM
13372017-10-01 Alan Modra <amodra@gmail.com>
1338
1339 PR 22047
1340 * dwarf2.c (read_section): Allocate buffer with extra byte for
1341 bfd_simple_get_relocated_section_contents rather than copying
1342 afterwards.
1343
f6ac8c52
AM
13442017-09-29 Alan Modra <amodra@gmail.com>
1345
1346 * merge.c (merge_strings): Return FALSE on malloc failure.
1347 (_bfd_merge_sections): Return failures from record_section and
1348 merge_strings.
1349
1a3b5c34
AM
13502017-09-28 Alan Modra <amodra@gmail.com>
1351
1352 PR 22220
1353 * elflink.c (_bfd_elf_merge_symbol): Set non_ir_ref_dynamic in
1354 a case where plugin_notice isn't called.
1355
cd28e7aa
KLC
13562017-09-27 Kuan-Lin Chen <kuanlinchentw@gmail.com>
1357
1358 * elf32-nds32.c (nds32_elf_relax_section): Fix a tautological
1359 comparison.
1360
ac69a0d7
L
13612017-09-26 H.J. Lu <hongjiu.lu@intel.com>
1362
1363 PR ld/22199
1364 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Don't pass
1365 output_bfd to info->callbacks->minfo.
1366
262c0a87
NC
13672017-09-26 Nick Clifton <nickc@redhat.com>
1368
1369 PR 22172
1370 * elf64-x86-64.c (elf_x86_64_info_to_howto): Do not trigger an
1371 assertion failure if elf_x86_64_rtype_to_howto has already issued
1372 an error message.
1373
33e0a9a0
AM
13742017-09-26 Alan Modra <amodra@gmail.com>
1375
1376 PR 22210
1377 * dwarf2.c (read_formatted_entries): Use read_attribute_value to
1378 read data.
1379
30d0157a
NC
13802017-09-26 Nick Clifton <nickc@redhat.com>
1381
1382 PR 22210
1383 * dwarf2.c (read_formatted_entries): Fail early if we know that
1384 the loop parsing data entries will overflow the end of the
1385 section.
1386
1b86808a
AM
13872017-09-26 Alan Modra <amodra@gmail.com>
1388
1389 PR 22209
1390 * dwarf2.c (struct comp_unit): Delete sec_info_ptr field.
1391 (find_abstract_instance_name): Calculate DW_FORM_ref_addr relative
1392 to stash->info_ptr_memory, and check die_ref is within that memory.
1393 Set info_ptr_end correctly when another CU is refd. Check die_ref
1394 for DW_FORM_ref4 etc. is within CU.
1395
a54018b7
AM
13962017-09-26 Alan Modra <amodra@gmail.com>
1397
1398 PR 22205
1399 * dwarf2.c (concat_filename): Return "<unknown>" on NULL filename.
1400 (read_formatted_entries): Init "fe".
1401 (decode_line_info <DW_LNE_define_file>): Use line_info_add_file_name.
1402
e338894d
AM
14032017-09-26 Alan Modra <amodra@gmail.com>
1404
1405 PR 22204
1406 * dwarf2.c (decode_line_info): Ensure line_ptr stays within
1407 bounds in inner loop.
1408
1da5c9a4
AM
14092017-09-25 Alan Modra <amodra@gmail.com>
1410
1411 PR 22202
1412 * dwarf1.c (parse_die): Sanity check pointer against section limit
1413 before dereferencing.
1414 (parse_line_table): Likewise.
1415
11855d8a
AM
14162017-09-25 Alan Modra <amodra@gmail.com>
1417
1418 PR 22201
1419 * dwarf2.c (scan_unit_for_symbols): Ignore DW_AT_name unless it
1420 has string form.
1421 (parse_comp_unit): Likewise.
1422
c361faae
AM
14232017-09-25 Alan Modra <amodra@gmail.com>
1424
1425 PR 22200
1426 * dwarf2.c (read_formatted_entries): Error on format_count zero.
1427
52b36c51
AM
14282017-09-24 Alan Modra <amodra@gmail.com>
1429
1430 PR 22197
1431 * opncls.c (bfd_get_debug_link_info_1): Properly check that crc is
1432 within section bounds.
1433
a26a013f
AM
14342017-09-24 Alan Modra <amodra@gmail.com>
1435
1436 PR 22191
1437 * dwarf2.c (decode_line_info): Properly free line sequences on error.
1438
52a93b95
AM
14392017-09-24 Alan Modra <amodra@gmail.com>
1440
1441 PR 22187
1442 * dwarf2.c (find_abstract_instance_name): Add orig_info_ptr and
1443 pname param. Return status. Make name const. Don't abort,
1444 return an error. Formatting. Exit if current info_ptr matches
1445 orig_info_ptr. Update callers.
1446 (scan_unit_for_symbols): Start at nesting_level of zero. Make
1447 nested_funcs an array of structs for extensibility. Formatting.
1448
d8010d3e
AM
14492017-09-24 Alan Modra <amodra@gmail.com>
1450
1451 PR 22186
1452 * dwarf2.c (decode_line_info): Fail on lh.line_range of zero
1453 rather than dividing by zero.
1454
515f23e6
AM
14552017-09-24 Alan Modra <amodra@gmail.com>
1456
1457 PR 22169
1458 * dwarf2.c (decode_line_info): Correct .debug_line unit_length check.
1459
0d76029f
AM
14602017-09-24 Alan Modra <amodra@gmail.com>
1461
1462 PR 22167
1463 * dwarf2.c (scan_unit_for_symbols): Check u.blk->data is non-NULL.
1464
bd61e135
AM
14652017-09-24 Alan Modra <amodra@gmail.com>
1466
1467 PR 22166
1468 * elf.c (_bfd_elf_slurp_version_tables): Test sh_info on
1469 SHT_GNU_verneed section for sanity. Don't zalloc memory for
1470 verref.
1471
61e3bf5f
L
14722017-09-22 H.J. Lu <hongjiu.lu@intel.com>
1473
1474 PR binutils/22170
1475 * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Guard against
1476 corrupted PLT.
1477
b69e9267
L
14782017-09-22 H.J. Lu <hongjiu.lu@intel.com>
1479
59ca4c1b 1480 PR binutils/22163
b69e9267
L
1481 * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Also return
1482 -1 if bfd_canonicalize_dynamic_reloc returns 0.
1483
b877d21f
PA
14842017-09-22 Pedro Alves <palves@redhat.com>
1485 Alan Modra <amodra@gmail.com>
1486
1487 * version.h: Add comment.
1488
8fe09d74
AA
14892017-09-21 Andreas Arnez <arnez@linux.vnet.ibm.com>
1490
1491 * elf.c (elfcore_grok_note): For the cases NT_S390_GS_CB and
1492 NT_S390_GS_BC, correct the previously swapped invocations of
1493 elfcore_grok_s390_gs_bc and elfcore_grok_s390_gs_cb.
1494
25516cc5
AM
14952017-09-19 Alan Modra <amodra@gmail.com>
1496
1497 PR 21441
1498 * elf64-ppc.c (ppc64_elf_build_stubs): Don't check glink_eh_frame
1499 size.
1500
3d13f3e9
AM
15012017-09-19 Alan Modra <amodra@gmail.com>
1502
1503 PR 22150
1504 * elflink.c (bfd_elf_size_dynamic_sections): Garbage collect
1505 symbols before calculating verrefs. Don't renumber dynsyms
1506 after gc. Exclude .gnu.version when zero or one dynsym.
1507 Localize some vars and reindent.
1508
94670f6c
L
15092017-09-18 H.J. Lu <hongjiu.lu@intel.com>
1510
1511 PR ld/22148
1512 * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Check error
1513 return from bfd_canonicalize_dynamic_reloc.
1514
21d0a606
AM
15152017-09-15 Alan Modra <amodra@gmail.com>
1516
1517 PR 22116
1518 * archive.c (bfd_ar_hdr_from_filesystem): Detect when status.st_size
1519 overflows bfd_size_type.
1520
5e5e02ae
L
15212017-09-14 H.J. Lu <hongjiu.lu@intel.com>
1522
1523 PR ld/22135
1524 * elf32-i386.c (elf_i386_convert_load_reloc): Add an argument
1525 to indicate if conversion is performed.
1526 (elf_i386_check_relocs): Cache section contents and relocations
1527 if conversion is performed.
1528 * elf64-x86-64.c (elf_x86_64_check_relocs): Cache section
1529 contents and relocations if conversion is performed.
1530
4d465c68
NC
15312017-09-14 Nick Clifton <nickc@redhat.com>
1532
1533 PR binutils/22113
1534 * peXXigen.c (pe_print_idata): Extend check for HintName vector
1535 entries.
1536
f47432d4
L
15372017-09-13 H.J. Lu <hongjiu.lu@intel.com>
1538
1539 * elfxx-x86.h: Fix a typo in comments.
1540
4ec521f2
KLC
15412017-09-09 Kamil Rytarowski <n54@gmx.com>
1542
1543 * elf32-nds32.c: Rename __BIT() to N32_BIT().
1544
2420fff6
AM
15452017-09-09 Alan Modra <amodra@gmail.com>
1546
1547 * elf64-ppp.c (plt_stub_pad): Handle positive and negative
1548 plt_stub_align.
1549
c5bce5c6
L
15502017-09-09 H.J. Lu <hongjiu.lu@intel.com>
1551
1552 * elf32-i386.c (elf_i386_relocate_section): Update usage of
1553 UNDEFINED_WEAK_RESOLVED_TO_ZERO.
1554 (elf_i386_finish_dynamic_symbol): Likewise.
1555 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
1556 (elf_x86_64_finish_dynamic_symbol): Likewise.
1557 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Likewise.
1558 (_bfd_x86_elf_fixup_symbol): Likewise.
1559
8fbf0ba1
L
15602017-09-09 H.J. Lu <hongjiu.lu@intel.com>
1561
1562 * elfxx-x86.c (_bfd_x86_elf_link_symbol_references_local): Don't
1563 check has_non_got_reloc.
1564
0a27fed7
L
15652017-09-09 H.J. Lu <hongjiu.lu@intel.com>
1566
1567 PR ld/22115
1568 * elf32-i386.c (elf_i386_convert_load_reloc): Check linker_def.
1569 Don't use UNDEFINED_WEAK_RESOLVED_TO_ZERO.
1570 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Check
1571 linker_def. Don't use UNDEFINED_WEAK_RESOLVED_TO_ZERO.
1572 * elfxx-x86.c (_bfd_x86_elf_link_check_relocs): Set local_ref
1573 and linker_def on __ehdr_start if it is referenced and not
1574 defined.
1575 (_bfd_x86_elf_link_symbol_references_local): Also set local_ref
1576 and return TRUE when building executable, if a symbol has
1577 non-GOT/non-PLT relocations in text section or there is no
1578 dynamic linker.
1579 * elfxx-x86.h (elf_x86_link_hash_entry): Add linker_def.
1580
c7df954f
L
15812017-09-08 H.J. Lu <hongjiu.lu@intel.com>
1582
1583 * elfxx-x86.h: Update comments.
1584
1de031c8
L
15852017-09-08 H.J. Lu <hongjiu.lu@intel.com>
1586
1587 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Replace
1588 elf_x86_plt_layout_table with elf_x86_init_table.
1589 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties):
1590 Likewise.
1591 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties):
1592 Likewise.
1593 * elfxx-x86.h (elf_x86_plt_layout_table): Renamed to ...
1594 (elf_x86_init_table): This.
1595 (_bfd_x86_elf_link_setup_gnu_properties): Replace
1596 elf_x86_plt_layout_table with elf_x86_init_table.
1597
7a382c1c
L
15982017-09-07 H.J. Lu <hongjiu.lu@intel.com>
1599
1600 * configure.ac (bfd_backends): Don't add elf64-x86-64.lo nor
1601 elf64.lo together with elfxx-x86.lo for 64-bit BFD.
1602 * configure: Regenerated.
1603 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Set r_info
1604 and r_sym fields of plt_layout.
1605 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties):
1606 Likewise.
1607 * elfxx-x86.c (elf_x86_64_is_reloc_section): Remove BFD64 check.
1608 (_bfd_x86_elf_link_hash_table_create): Likewise. Don't set
1609 r_info nor r_sym fields.
1610 (_bfd_x86_elf_link_setup_gnu_properties): Set r_info and r_sym
1611 fields of htab.
1612 * elfxx-x86.h (elf_x86_plt_layout_table): Add r_info and r_sym.
1613
9eb7b0ac
PD
16142017-09-07 Palmer Dabbelt <palmer@dabbelt.com>
1615
1616 * (_bfd_riscv_relax_align): Call bfd_set_error and
1617 print an error message when unable to relax a .align directive.
1618
b1308d2c
PD
16192017-09-07 Palmer Dabbelt <palmer@dabbelt.com>
1620
1621 * elfnn-riscv.c (riscv_zero_pcrel_hi_reloc): New function.
1622 (riscv_record_pcrel_hi_reloc): Add absolute argument.
1623 (riscv_elf_relocate_section): Call riscv_zero_pcrel_hi_reloc for
1624 R_RISCV_PCREL_HI20 relocs, and pass the result to
1625 riscv_record_pcrel_hi_reloc.
1626
6999821f
L
16272017-09-07 H.J. Lu <hongjiu.lu@intel.com>
1628
1629 * elf32-i386.c (elf_i386_convert_load_reloc): Add an argument,
1630 r_type_p. Remove the converted argument. Replace
1631 SYMBOL_REFERENCES_LOCAL with SYMBOL_REFERENCES_LOCAL_P. Return
1632 the new relocation type via r_type_p.
1633 (elf_i386_relocate_section): Likewise.
1634 (elf_i386_finish_dynamic_symbol): Likewise.
1635 (need_convert_load): Removed.
1636 (check_relocs_failed): Updated.
1637 (elf_i386_check_relocs): Call elf_i386_convert_load_reloc,
1638 instead of setting need_convert_load.
1639 (_bfd_i386_elf_convert_load): Removed.
1640 * elf64-x86-64.c (need_convert_load): Removed.
1641 (check_relocs_failed): Updated.
1642 (elf_x86_64_convert_load_reloc): Add an argument, r_type_p.
1643 Replace SYMBOL_REFERENCES_LOCAL with SYMBOL_REFERENCES_LOCAL_P.
1644 Return the new relocation type via r_type_p.
1645 (elf_x86_64_check_relocs): Call elf_x86_64_convert_load_reloc,
1646 instead of setting need_convert_load.
1647 (elf_x86_64_check_relocs): Don't check PIC if relocation has
1648 been converted.
1649 (_bfd_x86_64_elf_convert_load): Removed.
1650 (elf_x86_64_relocate_section): Replace SYMBOL_REFERENCES_LOCAL
1651 with SYMBOL_REFERENCES_LOCAL_P.
1652 (elf_x86_64_finish_dynamic_symbol): Likewise.
1653 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Don't
1654 set convert_load.
1655 (_bfd_x86_elf_size_dynamic_sections): Don't call convert_load.
1656 (_bfd_x86_elf_link_symbol_references_local): New function.
1657 * elfxx-x86.h (SYMBOL_REFERENCES_LOCAL_P): New.
1658 (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Replace elf.forced_local with
1659 SYMBOL_REFERENCES_LOCAL_P.
1660 (elf_x86_link_hash_entry): Add local_ref.
1661 (elf_x86_link_hash_table): Remove convert_load.
1662 (_bfd_i386_elf_convert_load): Removed.
1663 (_bfd_x86_64_elf_convert_load): Likewise.
1664 (_bfd_x86_elf_link_symbol_references_local): New.
1665
78984959
L
16662017-09-06 H.J. Lu <hongjiu.lu@intel.com>
1667
1668 * elf64-x86-64.c (R_X86_64_converted_reloc_bit): New.
1669 (elf_x86_64_info_to_howto): Get the real relocation type by
1670 masking out R_X86_64_converted_reloc_bit.
1671 (elf_x86_64_check_tls_transition): Get the real relocation type
1672 by masking out R_X86_64_converted_reloc_bit.
1673 (elf_x86_64_convert_load_reloc): Set R_X86_64_converted_reloc_bit
1674 instead of setting converted_reloc.
1675 (elf_x86_64_relocate_section): Check R_X86_64_converted_reloc_bit
1676 instead of converted_reloc. Get the real relocation type by
1677 masking out R_X86_64_converted_reloc_bit.
1678 (elf_x86_64_link_setup_gnu_properties): Verify that the value of
1679 R_X86_64_converted_reloc_bit is valid.
1680 * elfxx-x86.h (converted_reloc): Removed.
1681
419414ea
L
16822017-09-06 H.J. Lu <hongjiu.lu@intel.com>
1683
1684 * elf32-i386.c (elf_i386_relocate_section): Don't change r_type
1685 when calling elf_i386_tls_transition. Don't use ELF32_R_TYPE
1686 to get the relocation type again.
1687 * elf64-x86-64.c (elf_x86_64_relocate_section): Don't change
1688 r_type when calling elf_x86_64_tls_transition. Don't use
1689 ELF32_R_TYPE to get the relocation type again.
1690
dc089072
L
16912017-09-05 H.J. Lu <hongjiu.lu@intel.com>
1692
1693 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Properly set
1694 converted_reloc.
1695
8b43e456
L
16962017-09-05 H.J. Lu <hongjiu.lu@intel.com>
1697
1698 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Remove the sec
1699 argument. Don't check relocation overflow. Avoid relocation
1700 overflow if --no-relax is used. Set converted_reloc on symbol
1701 if a GOTPCREL relocation is converted.
1702 (elf_x86_64_relocate_section): Issue a fatal error and suggest
1703 --no-relax if GOTPCREL relocation conversion leads to relocation
1704 overflow.
1705 * elfxx-x86.h (elf_x86_link_hash_entry): Add converted_reloc.
1706
83eef883
AFB
17072017-09-05 Alexander Fedotov <alexander.fedotov@nxp.com>
1708 Edmar Wienskoski <edmar.wienskoski@nxp.com
1709
1710 * elf32-ppc.c (ppc_elf_howto_raw): Add R_PPC_VLE_ADDR20.
1711 (ppc_elf_check_relocs): Handle it.
1712 (ppc_elf_vle_split20): New function.
1713 (ppc_elf_relocate_section): Handle R_PPC_VLE_ADDR20.
1714
0e30d991
L
17152017-09-03 H.J. Lu <hongjiu.lu@intel.com>
1716
1717 PR ld/22071
1718 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Set tlsdesc_plt
1719 for x86-64 if GOT_TLS_GDESC_P is true.
1720
1cf58434
AM
17212017-09-03 Alan Modra <amodra@gmail.com>
1722
1723 PR 22067
1724 * elfxx-x86.h (elf_x86_hash_table): Check is_elf_hash_table first.
1725
f04bdfa7
L
17262017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1727
1728 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
1729 tls_get_addr for x86-64 in one place.
1730
2ac3a7f5
L
17312017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1732
1733 * configure.ac (bfd_backends): Add elf64-x86-64.lo together
1734 with elfxx-x86.lo for 64-bit BFD.
1735 * configure: Regenerated.
1736
d47a8026
L
17372017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1738
1739 * elf32-i386.c (elf_i386_convert_load): Renamed to ...
1740 (_bfd_i386_elf_convert_load): This. Remove static.
1741 (elf_i386_size_dynamic_sections): Removed.
1742 (elf_backend_size_dynamic_sections): Likewise.
1743 * elf64-x86-64.c (elf_x86_64_convert_load): Renamed to ...
1744 (_bfd_x86_64_elf_convert_load): This. Remove static.
1745 (elf_x86_64_size_dynamic_sections): Removed.
1746 (elf_backend_size_dynamic_sections): Likewise.
1747 * elfxx-x86.c (_bfd_x86_elf_allocate_dynrelocs): Renamed to ...
1748 (elf_x86_allocate_dynrelocs): This. Make it static.
1749 (_bfd_x86_elf_allocate_local_dynrelocs): Renamed to ...
1750 (elf_x86_allocate_local_dynreloc): This. Make it static.
1751 (elf_i386_is_reloc_section): New function.
1752 (elf_x86_64_is_reloc_section): Likewise.
1753 (_bfd_x86_elf_link_hash_table_create): Initialize convert_load,
1754 is_reloc_section, dt_reloc, dt_reloc_sz and dt_reloc_ent.
1755 Rearrange got_entry_size initialization.
1756 (_bfd_x86_elf_size_dynamic_sections): New function.
1757 * elfxx-x86.h (elf_x86_link_hash_table): Add convert_load,
1758 is_reloc_section, dt_reloc, dt_reloc_sz and dt_reloc_ent.
1759 (_bfd_i386_elf_convert_load): New.
1760 (_bfd_x86_64_elf_convert_load): Likewise.
1761 (_bfd_x86_elf_size_dynamic_sections): Likewise.
1762 (elf_backend_size_dynamic_sections): Likewise.
1763 (_bfd_x86_elf_allocate_dynrelocs): Removed.
1764 (_bfd_x86_elf_allocate_local_dynrelocs): Likewise.
1765
2926eb2c
L
17662017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1767
1768 * elfxx-x86.h (elf_x86_link_hash_table): Rearrange fields and
1769 update comments.
1770
92c10f5f
L
17712017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1772
1773 * elf32-i386.c (elf_i386_size_dynamic_sections): Set
1774 sgotplt_jump_table_size with elf_x86_compute_jump_table_size.
1775
aa595247
L
17762017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1777
1778 * elf32-i386.c (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
1779 PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Moved to ...
1780 * elfxx-x86.h (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
1781 PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Here.
1782 * elf64-x86-64.c (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
1783 PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Removed.
1784
b9ce864c
L
17852017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1786
1787 * elf32-i386.c (elf_i386_allocate_dynrelocs): Removed.
1788 (elf_i386_allocate_local_dynrelocs): Likewise.
1789 (elf_i386_size_dynamic_sections): Replace
1790 elf_i386_allocate_dynrelocs/elf_i386_allocate_local_dynrelocs
1791 with _bfd_x86_elf_allocate_dynrelocs and
1792 _bfd_x86_elf_allocate_local_dynrelocs.
1793 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Removed.
1794 (elf_x86_64_allocate_local_dynrelocs): Likewise.
1795 (elf_x86_64_size_dynamic_sections): Replace
1796 elf_x86_64_allocate_dynrelocs/elf_x86_64_allocate_local_dynrelocs
1797 with _bfd_x86_elf_allocate_dynrelocs and
1798 _bfd_x86_elf_allocate_local_dynrelocs.
1799 * elfxx-x86.c (_bfd_x86_elf_allocate_dynrelocs): New function.
1800 (_bfd_x86_elf_allocate_local_dynrelocs): Likewise.
1801 * elfxx-x86.h (_bfd_x86_elf_allocate_dynrelocs): New prototype.
1802 (_bfd_x86_elf_allocate_local_dynrelocs): Likewise.
1803
fe53b4a4
L
18042017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1805
1806 * elf32-i386.c (is_i386_elf): Removed.
1807 (elf_i386_check_relocs): Replace is_i386_elf with is_x86_elf.
1808 (elf_i386_size_dynamic_sections): Likewise.
1809 (elf_i386_relocate_section): Likewise.
1810 * elf64-x86-64.c (is_x86_64_elf): Removed.
1811 (elf_x86_64_check_relocs): Replace is_x86_64_elf with
1812 is_x86_elf.
1813 (elf_x86_64_size_dynamic_sections): Likewise.
1814 (elf_x86_64_relocate_section): Likewise.
1815 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
1816 target_id.
1817 * elfxx-x86.h (elf_x86_link_hash_table): Add target_id.
1818 (is_x86_elf): New.
1819
9ff114ca
L
18202017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1821
1822 * elf32-i386.c (elf_i386_compute_jump_table_size): Removed.
1823 (elf_i386_allocate_dynrelocs): Replace
1824 elf_i386_compute_jump_table_size with
1825 elf_x86_compute_jump_table_size.
1826 (elf_i386_size_dynamic_sections): Likewise.
1827 * elf64-x86-64.c (elf_x86_64_compute_jump_table_size): Removed.
1828 (elf_x86_64_allocate_dynrelocs): Replace
1829 elf_x86_64_compute_jump_table_size with
1830 elf_x86_compute_jump_table_size.
1831 (elf_x86_64_size_dynamic_sections): Likewise.
1832 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
1833 got_entry_size.
1834 * elfxx-x86.h (elf_x86_link_hash_table): Add got_entry_size.
1835 (elf_x86_compute_jump_table_size): New.
1836
503294e7
L
18372017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1838
1839 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
1840 sizeof_reloc.
1841 (_bfd_x86_elf_adjust_dynamic_symbol): Use sizeof_reloc.
1842 * elfxx-x86.h (elf_x86_link_hash_table): Add sizeof_reloc.
1843
9a742a90
L
18442017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1845
1846 * elf32-i386.c (elf_i386_allocate_dynrelocs): Check VxWorks
1847 with htab->is_vxworks.
1848 (elf_i386_size_dynamic_sections): Likewise.
1849 (elf_i386_relocate_section): Likewise.
1850 (elf_i386_finish_dynamic_symbol): Likewise.
1851 (elf_i386_finish_dynamic_sections): Likewise.
1852
6b9553e2
L
18532017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1854
1855 * elf32-i386.c (GOT_TLS_IE, GOT_TLS_IE_POS, GOT_TLS_IE_NEG,
1856 GOT_TLS_IE_BOTH, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
1857 GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Moved to ...
1858 * elfxx-x86.h (GOT_TLS_IE, GOT_TLS_IE_POS, GOT_TLS_IE_NEG,
1859 GOT_TLS_IE_BOTH, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
1860 GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Here.
1861 * elf64-x86-64.c (GOT_TLS_IE, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
1862 GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Removed.
1863
ad71ce8d
L
18642017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1865
1866 PR ld/22064
1867 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Check
1868 ELF_COMMON_DEF_P for common symbols.
1869
96d01d93
AM
18702017-09-02 Alan Modra <amodra@gmail.com>
1871
1872 * elf-eh-frame.c (offset_adjust): Avoid false positive gcc warning.
1873 * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Likewise.
1874 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Likewise.
1875
4f501a24
L
18762017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1877
1878 * elf32-i386.c (elf_i386_gc_mark_hook): Removed.
1879 (elf_backend_gc_mark_hook): Likewise.
1880 * elf64-x86-64.c (elf_x86_64_gc_mark_hook): Likewise.
1881 (elf_backend_gc_mark_hook): Likewise.
1882 * elfxx-x86.c (_bfd_x86_elf_gc_mark_hook): New function.
1883 * elfxx-x86.h (_bfd_x86_elf_gc_mark_hook): New.
1884 (elf_backend_gc_mark_hook): Likewise.
1885
eeb2f20a
L
18862017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1887
1888 * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Removed.
1889 (elf_backend_adjust_dynamic_symbol): Likewise.
1890 * elf64-x86-64.c (elf_x86_64_adjust_dynamic_symbol): Likewise.
1891 (elf_backend_adjust_dynamic_symbol): Likewise.
1892 * elfxx-x86.c (_bfd_x86_elf_adjust_dynamic_symbol): New function.
1893 (_bfd_x86_elf_link_setup_gnu_properties): Copy is_vxworks.
1894 * elfxx-x86.h (elf_x86_link_hash_table): Add is_vxworks.
1895 (_bfd_x86_elf_adjust_dynamic_symbol): New.
1896 (elf_backend_adjust_dynamic_symbol): Likewise.
1897
c6295c22
L
18982017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1899
1900 * elfxx-x86.h (elf_x86_plt_layout_table): Fix a typo in
1901 comments.
1902
39946cc2
L
19032017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1904
1905 * elf32-i386.c (elf_i386_mkobject): Removed.
1906 (bfd_elf32_mkobject): Likewise.
1907 * elf64-x86-64.c (elf_x86_64_mkobject): Likewise.
1908 (bfd_elf64_mkobject): Likewise.
1909 (bfd_elf32_mkobject): Likewise.
1910 * elfxx-x86.c (_bfd_x86_elf_mkobject): New function.
18da07cd 1911 * elfxx-x86.h (_bfd_x86_elf_mkobject): New.
39946cc2
L
1912 (bfd_elf64_mkobject): Likewise.
1913 (bfd_elf32_mkobject): Likewise.
1914
a6798bab
L
19152017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1916
1917 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Updated.
1918 Call _bfd_x86_elf_link_setup_gnu_properties.
1919 * elf64-x86-64.c (elf_x86_lazy_plt_layout): Initialize
1920 pic_plt0_entry and pic_plt_entry fields with the non-PIC PLT
1921 entries.
1922 (elf_x86_64_non_lazy_plt): Likewise.
1923 (elf_x86_64_lazy_bnd_plt): Likewise.
1924 (elf_x86_64_non_lazy_bnd_plt): Likewise.
1925 (elf_x86_64_lazy_ibt_plt): Likewise.
1926 (elf_x32_lazy_ibt_plt): Likewise.
1927 (elf_x86_64_non_lazy_ibt_plt): Likewise.
1928 (elf_x32_non_lazy_ibt_plt): Likewise.
1929 (elf_x86_64_nacl_plt): Likewise.
1930 (elf_x86_64_link_setup_gnu_properties): Updated. Call
1931 _bfd_x86_elf_link_setup_gnu_properties.
1932 * elfxx-x86.c: Include elf-vxworks.h".
1933 (_bfd_x86_elf_link_setup_gnu_properties): New function.
1934 * elfxx-x86.h (elf_x86_lazy_plt_layout): Remove "for i386 only"
1935 comments for pic_plt0_entry and pic_plt_entry.
1936 (elf_x86_non_lazy_plt_layout): Likewise.
1937 (elf_x86_plt_layout_table): New.
1938 (_bfd_x86_elf_link_setup_gnu_properties): Likewise.
1939
e10c9c62
L
19402017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1941
1942 PR ld/22061
1943 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Create
1944 .eh_frame section for the second PLT.
1945 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Correct
1946 alignment of .eh_frame section for the second PLT.
1947
7e8b6008
NC
19482017-09-01 Nick Clifton <nickc@redhat.com>
1949
1950 PR 22059
1951 * dwarf2.c (decode_line_info): Fix test for an overlong line info
1952 structure.
1953
2a143b99
NC
19542017-09-01 Nick Clifton <nickc@redhat.com>
1955
1956 PR 22058
1957 * elf-attrs.c (_bfd_elf_parse_attributes): Ensure that the
1958 attribute buffer is NUL terminated.
1959
e4f27230
NC
19602017-08-31 Nick Clifton <nickc@redhat.com>
1961
1962 PR 22047
1963 * dwarf2.c (read_section): If necessary add a terminating NUL byte
1964 to dwarf string sections.
1965
686335cd
AM
19662017-08-31 Alan Modra <amodra@gmail.com>
1967
1968 * po/SRC-POTFILES.in: Regenerate.
1969
9866ffe2
AM
19702017-08-31 Alan Modra <amodra@gmail.com>
1971
1972 * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Don't exit early
1973 for a section containing just a terminator. Allow multiple
1974 terminators at end of section.
1975 * elflink.c (bfd_elf_discard_info): Iterate over .eh_frame
1976 sections when not adding alignment. Assert on terminator in
1977 the middle of FDEs.
1978
af471f82
AM
19792017-08-31 Alan Modra <amodra@gmail.com>
1980
1981 PR 21441
1982 PR 22048
1983 * elflink.c (bfd_elf_discard_info): Don't pad embedded zero
1984 terminators.
1985
3321e42b
L
19862017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1987
1988 * configure.ac (bfd_backends): Add elf64.lo together with
1989 elfxx-x86.lo for 64-bit BFD.
1990 * configure: Regenerated.
1991
ef32532f
JB
19922017-08-31 James Bowman <james.bowman@ftdichip.com>
1993
1994 * elf32-ft32.c (ft32_elf_howto_table): Use complain_overflow_dont
1995 for R_FT32_18.
1996
e234de6b
AM
19972017-08-31 Alan Modra <amodra@gmail.com>
1998
1999 PR binutils/22032
2000 * opncls.c (bfd_close_all_done): Don't call bfd_cache_close
2001 before _close_and_cleanup. Call iovec->bclose after.
2002 (bfd_close): Remove code common to, and call, bfd_close_all_done.
2003
f493882d
L
20042017-08-30 H.J. Lu <hongjiu.lu@intel.com>
2005
2006 * elf32-i386.c (elf_i386_plt_type): Removed.
2007 (elf_i386_plt): Likewise.
2008 (elf_i386_get_synthetic_symtab): Updated. Call
2009 _bfd_x86_elf_get_synthetic_symtab.
2010 * elf64-x86-64.c (elf_x86_64_plt_type): Removed.
2011 (elf_x86_64_plt): Likewise.
2012 (elf_x86_64_get_synthetic_symtab): Updated. Call
2013 _bfd_x86_elf_get_synthetic_symtab.
2014 * elfxx-x86.c (elf_i386_get_plt_got_vma): New function.
2015 (elf_x86_64_get_plt_got_vma): Likewise.
2016 (elf_i386_valid_plt_reloc_p): Likewise.
2017 (elf_x86_64_valid_plt_reloc_p): Likewise.
2018 (_bfd_x86_elf_get_synthetic_symtab): Likewise.
2019 * elfxx-x86.h (elf_x86_plt_type): New.
2020 (elf_x86_plt): Likewise.
2021 (_bfd_x86_elf_get_synthetic_symtab): Likewise.
2022
5b86dbf4
L
20232017-08-30 H.J. Lu <hongjiu.lu@intel.com>
2024
2025 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Check
2026 target_id instead of elf_machine_code.
2027
765e526c
L
20282017-08-30 H.J. Lu <hongjiu.lu@intel.com>
2029
2030 * elf32-i386.c (ELF_DYNAMIC_INTERPRETER): Removed.
2031 (elf_i386_lazy_plt_layout): Likewise.
2032 (elf_i386_non_lazy_plt_layout): Likewise.
2033 (elf_i386_plt_layout): Likewise.
2034 (elf_i386_link_hash_table): Likewise.
2035 (elf_i386_next_tls_desc_index): Likewise.
2036 (elf_i386_srelplt2): Likewise.
2037 (elf_i386_plt): Likewise.
2038 (elf_i386_lazy_plt): Likewise.
2039 (elf_i386_non_lazy_plt): Likewise.
2040 (elf_i386_link_hash_table_create): Likewise.
2041 (bfd_elf32_bfd_link_hash_table_create): Likewise.
2042 (elf_i386_lazy_plt): Updated.
2043 (elf_i386_non_lazy_plt): Likewise.
2044 (elf_i386_lazy_ibt_plt): Likewise.
2045 (elf_i386_non_lazy_ibt_plt): Likewise.
2046 (elf_i386_allocate_dynrelocs): Likewise.
2047 (elf_i386_size_dynamic_sections): Likewise.
2048 (elf_i386_relocate_section): Likewise.
2049 (elf_i386_finish_dynamic_symbol): Likewise.
2050 (elf_i386_finish_dynamic_sections): Likewise.
2051 (elf_i386_get_synthetic_symtab): Likewise.
2052 (elf_i386_link_setup_gnu_properties): Likewise.
2053 (elf_i386_nacl_plt): Likewise.
2054 * elf64-x86-64.c (ABI_64_P): Removed.
2055 (ELF64_DYNAMIC_INTERPRETER): Likewise.
2056 (ELF32_DYNAMIC_INTERPRETER): Likewise.
2057 (elf_x86_64_lazy_plt_layout): Likewise.
2058 (elf_x86_64_non_lazy_plt_layout): Likewise.
2059 (elf_x86_64_plt_layout): Likewise.
2060 (elf_x86_64_link_hash_table): Likewise.
2061 (elf_x86_64_plt): Likewise.
2062 (elf_x86_64_lazy_plt): Likewise.
2063 (elf_x86_64_non_lazy_plt): Likewise.
2064 (elf_x86_64_link_hash_table_create): Likewise.
2065 (bfd_elf64_bfd_link_hash_table_create): Likewise.
2066 (bfd_elf32_bfd_link_hash_table_create): Likewise.
2067 (elf_x86_64_lazy_plt): Updated.
2068 (elf_x86_64_non_lazy_plt): Likewise.
2069 (elf_x86_64_lazy_bnd_plt): Likewise.
2070 (elf_x86_64_non_lazy_bnd_plt): Likewise.
2071 (elf_x86_64_lazy_ibt_plt): Likewise.
2072 (elf_x32_lazy_ibt_plt): Likewise.
2073 (elf_x86_64_non_lazy_ibt_plt): Likewise.
2074 (elf_x32_non_lazy_ibt_plt): Likewise.
2075 (elf_x86_64_allocate_dynrelocs): Likewise.
2076 (elf_x86_64_size_dynamic_sections): Likewise.
2077 (elf_x86_64_relocate_section): Likewise.
2078 (elf_x86_64_finish_dynamic_symbol): Likewise.
2079 (elf_x86_64_finish_dynamic_sections): Likewise.
2080 (elf_x86_64_get_synthetic_symtab): Likewise.
2081 (elf_x86_64_link_setup_gnu_properties): Likewise.
2082 (elf_x86_64_nacl_plt): Likewise.
2083 * elfxx-x86.c: Include "objalloc.h", "elf/i386.h" and
2084 "elf/x86-64.h".
2085 (ELF32_DYNAMIC_INTERPRETER): New.
2086 (ELF64_DYNAMIC_INTERPRETER): Likewise.
2087 (ELFX32_DYNAMIC_INTERPRETER): Likewise.
2088 (_bfd_x86_elf_link_hash_table_create): Likewise.
2089 (_bfd_x86_elf_link_hash_table_free): Renamed to ...
2090 (elf_x86_link_hash_table_free): This. Make it static.
2091 * elfxx-x86.h: Don't include "objalloc.h".
2092 (ABI_64_P): New.
2093 (elf_x86_lazy_plt_layout): Likewise.
2094 (elf_x86_non_lazy_plt_layout): Likewise.
2095 (elf_x86_plt_layout): Likewise.
2096 (_bfd_x86_elf_link_hash_table_create): Likewise.
2097 (bfd_elf64_bfd_link_hash_table_create): Likewise.
2098 (bfd_elf32_bfd_link_hash_table_create): Likewise.
2099 (elf_x86_link_hash_table): Add plt, lazy_plt, non_lazy_plt,
2100 srelplt2 and next_tls_desc_index.
2101 (_bfd_x86_elf_link_hash_table_free): Removed.
2102
70e65ca8
MR
21032017-08-30 Maciej W. Rozycki <macro@imgtec.com>
2104
2105 * elfxx-mips.c (mips_elf_perform_relocation): Correct microMIPS
2106 branch offset interpretation.
2107
7c0ed396
L
21082017-08-30 H.J. Lu <hongjiu.lu@intel.com>
2109
2110 PR binutils/22032
2111 * opncls.c (bfd_close_all_done): Call _close_and_cleanup.
2112
0f2425c4
L
21132017-08-30 H.J. Lu <hongjiu.lu@intel.com>
2114
2115 * elf64-x86-64.c (elf_x86_64_next_tls_desc_index): Removed.
2116 (elf_x86_64_srelplt2): Likewise.
2117
9a23f96e
AM
21182017-08-30 Alan Modra <amodra@gmail.com>
2119
2120 * elf64-ppc.c (struct ppc_link_hash_table): Add do_tls_opt.
2121 (ppc64_elf_tls_optimize): Set it.
2122 (ppc64_elf_relocate_section): Nop addis on TPREL16_HA, and convert
2123 insn on TPREL16_LO and TPREL16_LO_DS relocs to use r13 when
2124 addis would add zero.
2125 * elf32-ppc.c (struct ppc_elf_link_hash_table): Add do_tls_opt.
2126 (ppc_elf_tls_optimize): Set it.
2127 (ppc_elf_relocate_section): Nop addis on TPREL16_HA, and convert
2128 insn on TPREL16_LO relocs to use r2 when addis would add zero.
2129
b9f04fe0
AM
21302017-08-30 Alan Modra <amodra@gmail.com>
2131
2132 * elf64-ppc.c (ppc64_elf_relocate_section): When optimizing
2133 __tls_get_addr call sequences to LE, don't move the addi down
2134 to the nop. Replace the bl with addi and leave the nop alone.
2135
5f0f0847
L
21362017-08-29 H.J. Lu <hongjiu.lu@intel.com>
2137
2138 * elf32-i386.c (elf_i386_pie_finish_undefweak_symbol):
2139 Re-indent.
2140 * elf64-x86-64.c (elf_x86_64_finish_local_dynamic_symbol):
2141 Likewise.
2142 (elf_x86_64_pie_finish_undefweak_symbol): Likewise.
2143
443701f5
L
21442017-08-29 H.J. Lu <hongjiu.lu@intel.com>
2145
2146 * Makefile.am (BFD32_BACKENDS): Add elfxx-x86.lo.
2147 (BFD64_BACKENDS): Likewise.
2148 (BFD32_BACKENDS_CFILES): Add elfxx-x86.c.
2149 (BFD64_BACKENDS_CFILES): Likewise.
2150 * Makefile.in: Regenerated.
2151 * configure.ac (bfd_backends): Add elfxx-x86.lo together with
2152 elf32-i386.lo and elf64-x86-64.lo.
2153 * configure: Regenerated.
2154 * elf32-i386.c: Include "elfxx-x86.h" instead of "sysdep.h",
2155 "bfd.h", "bfdlink.h", "libbfd.h", "elf-bfd.h", "bfd_stdint.h",
2156 "objalloc.h" and "hashtab.h".
2157 (ELIMINATE_COPY_RELOCS): Removed.
2158 (UNDEFINED_WEAK_RESOLVED_TO_ZERO):Likewise.
2159 (SYMBOL_NO_COPYRELOC): Likewise.
2160 (elf_i386_link_hash_entry): Likewise.
2161 (GOT_UNKNOWN): Likewise.
2162 (GOT_NORMAL): Likewise.
2163 (GOT_TLS_GD): Likewise.
2164 (elf_i386_hash_entry): Likewise.
2165 (elf_i386_obj_tdata): Likewise.
2166 (elf_i386_tdata): Likewise.
2167 (elf_i386_local_got_tls_type): Likewise.
2168 (elf_i386_local_tlsdesc_gotent): Likewise.
2169 (elf_i386_hash_table): Likewise.
2170 (elf_i386_link_hash_newfunc): Likewise.
2171 (elf_i386_local_htab_hash): Likewise.
2172 (elf_i386_local_htab_eq): Likewise.
2173 (elf_i386_get_local_sym_hash): Likewise.
2174 (elf_i386_link_hash_table_free): Likewise.
2175 (elf_i386_copy_indirect_symbol): Likewise.
2176 (elf_i386_fixup_symbol): Likewise.
2177 (elf_i386_readonly_dynrelocs): Likewise.
2178 (elf_i386_always_size_sections): Likewise.
2179 (elf_i386_set_tls_module_base): Likewise.
2180 (elf_i386_dtpoff_base): Likewise.
2181 (compare_relocs): Likewise.
2182 (elf_i386_hash_symbol): Likewise.
2183 (elf_i386_parse_gnu_properties): Likewise.
2184 (elf_i386_merge_gnu_properties): Likewise.
2185 (elf_i386_link_check_relocs): Likewise.
2186 (elf_i386_merge_symbol_attribute): Likewise.
2187 (bfd_elf32_bfd_link_check_relocs): Likewise.
2188 (elf_backend_copy_indirect_symbol): Likewise.
2189 (elf_backend_always_size_sections): Likewise.
2190 (elf_backend_omit_section_dynsym): Likewise.
2191 (elf_backend_hash_symbol): Likewise.
2192 (elf_backend_fixup_symbol): Likewise.
2193 (elf_backend_parse_gnu_properties): Likewise.
2194 (elf_backend_merge_gnu_properties): Likewise.
2195 (elf_backend_merge_symbol_attribute): Likewise.
2196 (elf_i386_mkobject): Updated.
2197 (elf_i386_link_hash_table_create): Likewise.
2198 (elf_i386_check_tls_transition): Likewise.
2199 (elf_i386_tls_transition): Likewise.
2200 (elf_i386_convert_load_reloc): Likewise.
2201 (elf_i386_check_relocs): Likewise.
2202 (elf_i386_adjust_dynamic_symbol): Likewise.
2203 (elf_i386_allocate_dynrelocs): Likewise.
2204 (elf_i386_convert_load): Likewise.
2205 (elf_i386_size_dynamic_sections): Likewise.
2206 (elf_i386_relocate_section): Likewise.
2207 (elf_i386_finish_dynamic_symbol ): Likewise.
2208 (elf_i386_finish_dynamic_sections): Likewise.
2209 (elf_i386_output_arch_local_syms): Likewise.
2210 (elf_i386_get_synthetic_symtab): Likewise.
2211 (elf_i386_link_setup_gnu_properties): Likewise.
2212 (elf_i386_link_hash_table): Use elf_x86_link_hash_table, instead
2213 of elf_link_hash_table, as base.
2214 (elf_i386_next_tls_desc_index): New.
2215 (elf_i386_srelplt2): Likewise.
2216 (elf_i386_plt): Likewise.
2217 (elf_i386_lazy_plt): Likewise.
2218 (elf_i386_non_lazy_plt): Likewise.
2219 * elf32-x86-64.c: Include "elfxx-x86.h" instead of "sysdep.h",
2220 "bfd.h", "bfdlink.h", "libbfd.h", "elf-bfd.h", "bfd_stdint.h",
2221 "objalloc.h" and "hashtab.h".
2222 (ELIMINATE_COPY_RELOCS): Removed.
2223 (UNDEFINED_WEAK_RESOLVED_TO_ZERO):Likewise.
2224 (SYMBOL_NO_COPYRELOC): Likewise.
2225 (elf_x86_64_link_hash_entry): Likewise.
2226 (GOT_UNKNOWN): Likewise.
2227 (GOT_NORMAL): Likewise.
2228 (GOT_TLS_GD): Likewise.
2229 (elf_x86_64_hash_entry): Likewise.
2230 (elf_x86_64_obj_tdata): Likewise.
2231 (elf_x86_64_tdata): Likewise.
2232 (elf_x86_64_local_got_tls_type): Likewise.
2233 (elf_x86_64_local_tlsdesc_gotent): Likewise.
2234 (elf_x86_64_hash_table): Likewise.
2235 (elf_x86_64_link_hash_newfunc): Likewise.
2236 (elf_x86_64_local_htab_hash): Likewise.
2237 (elf_x86_64_local_htab_eq): Likewise.
2238 (elf_x86_64_get_local_sym_hash): Likewise.
2239 (elf_x86_64_link_hash_table_free): Likewise.
2240 (elf_x86_64_copy_indirect_symbol): Likewise.
2241 (elf_x86_64_fixup_symbol): Likewise.
2242 (elf_x86_64_readonly_dynrelocs): Likewise.
2243 (elf_x86_64_always_size_sections): Likewise.
2244 (elf_x86_64_set_tls_module_base): Likewise.
2245 (elf_x86_64_dtpoff_base): Likewise.
2246 (compare_relocs): Likewise.
2247 (elf_x86_64_merge_symbol_attribute): Likewise.
2248 (elf_x86_64_hash_symbol): Likewise.
2249 (elf_x86_64_parse_gnu_properties): Likewise.
2250 (elf_x86_64_merge_gnu_properties): Likewise.
2251 (elf_x86_64_link_check_relocs): Likewise.
2252 (elf_backend_copy_indirect_symbol): Likewise.
2253 (elf_backend_always_size_sections): Likewise.
2254 (bfd_elf64_bfd_link_check_relocs): Likewise.
2255 (elf_backend_merge_symbol_attribute): Likewise.
2256 (elf_backend_hash_symbol): Likewise.
2257 (elf_backend_omit_section_dynsym): Likewise.
2258 (elf_backend_fixup_symbol): Likewise.
2259 (elf_backend_parse_gnu_properties): Likewise.
2260 (elf_backend_merge_gnu_properties): Likewise.
2261 (bfd_elf32_bfd_link_check_relocs): Likewise.
2262 (elf_x86_64_mkobject): Updated.
2263 (elf_x86_64_link_hash_table_create): Likewise.
2264 (elf_x86_64_check_tls_transition): Likewise.
2265 (elf_x86_64_tls_transition): Likewise.
2266 (elf_x86_64_convert_load_reloc): Likewise.
2267 (elf_x86_64_check_relocs): Likewise.
2268 (elf_x86_64_adjust_dynamic_symbol): Likewise.
2269 (elf_x86_64_allocate_dynrelocs): Likewise.
2270 (elf_x86_64_convert_load): Likewise.
2271 (elf_x86_64_size_dynamic_sections): Likewise.
2272 (elf_x86_64_relocate_section): Likewise.
2273 (elf_x86_64_finish_dynamic_symbol ): Likewise.
2274 (elf_x86_64_finish_dynamic_sections): Likewise.
2275 (elf_x86_64_output_arch_local_syms): Likewise.
2276 (elf_x86_64_get_synthetic_symtab): Likewise.
2277 (elf_x86_64_link_setup_gnu_properties): Likewise.
2278 (elf_x86_64_link_hash_table): Use elf_x86_link_hash_table,
2279 instead of elf_link_hash_table, as base.
2280 (elf_x86_64_next_tls_desc_index): New.
2281 (elf_x86_64_srelplt2): Likewise.
2282 (elf_x86_64_plt): Likewise.
2283 (elf_x86_64_lazy_plt): Likewise.
2284 (elf_x86_64_non_lazy_plt): Likewise.
2285 * elfxx-x86.c: New file.
2286 * elfxx-x86.h: Likewise.
2287
823cb067
L
22882017-08-29 H.J. Lu <hongjiu.lu@intel.com>
2289
2290 * elf32-i386.c (elf_i386_get_synthetic_symtab): Simplify bad
2291 return.
2292 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
2293
37c0b6ee
L
22942017-08-29 H.J. Lu <hongjiu.lu@intel.com>
2295
2296 * elf32-i386.c (elf_i386_get_synthetic_symtab): Check valid PLT
2297 sections before checking dynamic relocations and free invalid
2298 PLT section contents.
2299 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
2300
0fb0a767
L
23012017-08-28 H.J. Lu <hongjiu.lu@intel.com>
2302
2303 * elf-bfd.h (_bfd_elf_ifunc_get_synthetic_symtab): Removed.
2304 * elf-ifunc.c (_bfd_elf_ifunc_get_synthetic_symtab): Likewise.
2305
90efb642
L
23062017-08-28 H.J. Lu <hongjiu.lu@intel.com>
2307
2308 PR binutils/22018
2309 * elf32-i386.c (elf_i386_get_synthetic_symtab): Check for valid
2310 PLT section size.
2311 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
2312
596dc58f
L
23132017-08-27 H.J. Lu <hongjiu.lu@intel.com>
2314
2315 * elf32-i386.c (elf_i386_link_hash_newfunc): Initialize
2316 def_protected.
2317 * elf64-x86-64.c (elf_x86_64_link_hash_newfunc): Likewise.
2318
a5b4ee94
L
23192017-08-26 H.J. Lu <hongjiu.lu@intel.com>
2320
2321 PR ld/21997
2322 * elf-bfd.h (elf_obj_tdata): Use ENUM_BITFIELD on object_id,
2323 dyn_lib_class and has_gnu_symbols. Change bad_symtab to bitfield.
2324 Add a has_no_copy_on_protected bitfield.
2325 (elf_has_no_copy_on_protected): New.
2326 * elf-properties.c (_bfd_elf_parse_gnu_properties): Set
2327 elf_has_no_copy_on_protected for GNU_PROPERTY_NO_COPY_ON_PROTECTED.
2328 (elf_merge_gnu_property_list): Likewise.
2329 (_bfd_elf_link_setup_gnu_properties): Set extern_protected_data
2330 to FALSE for elf_has_no_copy_on_protected.
2331 * elf32-i386.c (SYMBOL_NO_COPYRELOC): New.
2332 (elf_i386_link_hash_entry): Add def_protected.
2333 (elf_i386_adjust_dynamic_symbol): Also check SYMBOL_NO_COPYRELOC
2334 when checking info->nocopyreloc.
2335 (elf_i386_link_setup_gnu_properties): Don't set
2336 extern_protected_data here.
2337 (elf_i386_merge_symbol_attribute): New function.
2338 (elf_backend_merge_symbol_attribute): New.
2339 * elf64-x86-64.c (SYMBOL_NO_COPYRELOC): New.
2340 (elf_x86_64_link_hash_entry): Add def_protected.
2341 (elf_x86_64_need_pic): Report protected symbol for def_protected.
2342 (elf_x86_64_adjust_dynamic_symbol): Also check SYMBOL_NO_COPYRELOC
2343 when checking info->nocopyreloc.
2344 (elf_x86_64_relocate_section): Also check for R_X86_64_PC32
2345 relocation run-time overflow and unresolvable R_X86_64_32S
2346 relocation against protected data symbol defined in shared object
2347 with GNU_PROPERTY_NO_COPY_ON_PROTECTED.
2348 (elf_x86_64_link_setup_gnu_properties): Don't set
2349 extern_protected_data here.
2350 (elf_x86_64_merge_symbol_attribute): New function.
2351 (elf_backend_merge_symbol_attribute): New.
2352
7c8bbca5
AM
23532017-08-26 Alan Modra <amodra@gmail.com>
2354
2355 * elf32-ppc.c (must_be_dyn_reloc): Use bfd_link_dll. Comment.
2356 (ppc_elf_check_relocs): Only set DF_STATIC_TLS in shared libs.
2357 (ppc_elf_relocate_section): Comment fix.
2358 * elf64-ppc.c (must_be_dyn_reloc): Use bfd_link_dll. Comment.
2359 (ppc64_elf_check_relocs): Only set DF_STATIC_TLS in shared libs.
2360 Support dynamic relocs for TPREL16 when non-pic too.
2361 (dec_dynrel_count): Adjust TPREL16 handling as per check_relocs.
2362 (ppc64_elf_relocate_section): Support dynamic relocs for TPREL16
2363 when non-pic too.
2364
5fdda9d6
L
23652017-08-25 H.J. Lu <hongjiu.lu@intel.com>
2366
2367 * elf32-i386.c (elf_i386_link_hash_entry): Remove redundant
2368 "symbol" in comments.
2369 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Likewise.
2370
7073b5b9
L
23712017-08-24 H.J. Lu <hongjiu.lu@intel.com>
2372
2373 PR ld/22001
2374 * elf64-x86-64.c (elf_x86_64_relocate_section): Check for
2375 R_X86_64_PC32 relocation run-time overflow and unresolvable
2376 R_X86_64_32S relocation with -z nocopyreloc.
2377
34bb2571
L
23782017-08-24 H.J. Lu <hongjiu.lu@intel.com>
2379
2380 * elf32-i386.c (elf_i386_check_relocs): Revert the last change.
2381 Undefined symbols may not have a type.
2382 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
2383
aab921ad
L
23842017-08-23 H.J. Lu <hongjiu.lu@intel.com>
2385
2386 * elf64-x86-64.c (elf_x86_64_need_pic): Add an argument for
2387 bfd_link_info. Report shared, PIE or PDE object based on
2388 bfd_link_info.
2389 (elf_x86_64_check_relocs): Update elf_x86_64_need_pic call.
2390 (elf_x86_64_relocate_section): Likewise.
2391
b1bb697e
L
23922017-08-23 H.J. Lu <hongjiu.lu@intel.com>
2393
2394 * elf32-i386.c (elf_i386_check_relocs): Increment PLT count only
2395 for function symbols.
2396 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
2397
73784fa5
L
23982017-08-23 H.J. Lu <hongjiu.lu@intel.com>
2399
2400 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Set
2401 extern_protected_data to FALSE if GNU_PROPERTY_NO_COPY_ON_PROTECTED
2402 is set on any input relocatable file.
2403 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Likewise.
2404
46434633
AM
24052017-08-23 Alan Modra <amodra@gmail.com>
2406
2407 PR 21988
2408 * elf64-ppc.c (ensure_undef_dynamic): Rename from
2409 ensure_undefweak_dynamic. Handle undefined too.
2410 * elf32-ppc.c (ensure_undef_dynamic): Likewise.
2411 * elf32-hppa.c (ensure_undef_dynamic): Likewise.
2412 (allocate_dynrelocs): Discard undefined non-default visibility
2413 relocs first. Make undefined syms dynamic. Tidy goto.
2414
487b6440
AM
24152017-08-21 Alan Modra <amodra@gmail.com>
2416 H.J. Lu <hongjiu.lu@intel.com>
2417
2418 PR ld/21964
2419 * elf-bfd.h (SYMBOLIC_BIND): Return TRUE for __start/__stop symbols.
2420 * elflink.c (bfd_elf_define_start_stop): Rewrite.
2421
284d826d
HPN
24222017-08-21 Hans-Peter Nilsson <hp@bitrange.com>
2423
2424 PR ld/20125
2425 * elf64-mmix.c (mmix_elf_relax_section): Correct handling of
2426 undefined weak symbols.
2427
de259397
NC
24282017-08-18 Nick Clifton <nickc@redhat.com>
2429
2430 PR binutils/21962
2431 * tekhex.c (getsym): Fix check for source pointer walking off the
2432 end of the input buffer.
2433
545bc2b3
SN
24342017-08-17 Szabolcs Nagy <szabolcs.nagy@arm.com>
2435
2436 PR ld/18808
2437 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Skip IFUNC
2438 relocations in debug sections, change abort to _bfd_error_handler.
2439
0c54f692
NC
24402017-08-14 Nick Clifton <nickc@redhat.com>
2441
2442 PR 21957
2443 * elf.c (setup_group): Check for an empty or very small group
2444 section.
2445 * po/bfd.pot: Regenerate.
2446
79a94a2a
AM
24472017-08-14 Alan Modra <amodra@gmail.com>
2448
2449 PR 21441
2450 * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Don't add
2451 alignment padding here.
2452 * elflink.c (bfd_elf_discard_info): Add .eh_frame padding here
2453 in a reverse pass over sections.
2454
98c5dfc9
L
24552017-08-11 H.J. Lu <hongjiu.lu@intel.com>
2456
2457 PR binutils/21943
2458 * elf32-i386.c (elf_i386_get_synthetic_symtab): Allocate space
2459 for @plt suffixes first.
2460 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
2461
24d3e51b
NC
24622017-08-08 Nick Clifton <nickc@redhat.com>
2463
2464 PR 21916
2465 * elf-attrs.c (_bfd_elf_parse_attributes): Complain about very
2466 small section lengths.
2467 * elf.c (_bfd_elf_setup_sections): Skip empty entries in the group
2468 table.
2469 (elfcore_grok_freebsd_prstatus): Add checks to make sure that
2470 there is enough data present in the note.
2471
206c9c79
AM
24722017-08-08 Alan Modra <amodra@gmail.com>
2473
2474 PR 21017
2475 * elf32-microblaze.c (microblaze_elf_check_relocs): Don't bump
2476 got.refcount for GOTOFF relocs, just create .got section.
2477
2980ccad
L
24782017-08-07 H.J. Lu <hongjiu.lu@intel.com>
2479
2480 * elflink.c (elf_link_add_object_symbols): Move common symbol
2481 check after bed->common_definition.
2482
b3293efa
AM
24832017-08-07 Alan Modra <amodra@gmail.com>
2484
2485 PR 21910
2486 * elflink.c (bfd_elf_final_link): Don't segfault when sections
2487 needed to define various dynamic tags have been discarded.
2488
b7a18930
NC
24892017-08-07 Nick Clifton <nickc@redhat.com>
2490
2491 PR 21884
2492 * elf32-i386.c (elf_i386_link_setup_gnu_properties): If the dynobj
2493 has not been set then use the bfd returned by
2494 _bfd_elf_link_setup_gnu_properties. If that is null then search
2495 through all the input bfds selecting the first normal, ELF format
2496 one.
2497 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Likewise.
2498
1d4af308
L
24992017-08-06 H.J. Lu <hongjiu.lu@intel.com>
2500
2501 * elf32-i386.c (elf_i386_link_hash_entry): Change tls_get_addr
2502 to 1 bit.
2503 (elf_i386_link_hash_newfunc): Initialize tls_get_addr to 0.
2504 (elf_i386_check_tls_transition): Check tls_get_addr directly.
2505 (elf_i386_convert_load_reloc): Update tls_get_addr check.
2506 (elf_i386_link_check_relocs): New function.
2507 (bfd_elf32_bfd_link_check_relocs): New.
2508 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Change tls_get_addr
2509 to 1 bit.
2510 (elf_x86_64_link_hash_newfunc): Initialize tls_get_addr to 0.
2511 (elf_x86_64_check_tls_transition): Check tls_get_addr directly.
2512 (elf_x86_64_convert_load_reloc): Update tls_get_addr check.
2513 (elf_x86_64_link_check_relocs): New function.
2514 (bfd_elf64_bfd_link_check_relocs): New.
2515 (bfd_elf32_bfd_link_check_relocs): Likewise.
2516
a4819f54
L
25172017-08-06 H.J. Lu <hongjiu.lu@intel.com>
2518
2519 PR ld/21903:
2520 * elflink.c (elf_link_add_object_symbols): Treat common symbol
2521 as undefined for --no-define-common.
2522
55ef6584
AM
25232017-08-05 Alan Modra <amodra@gmail.com>
2524
2525 * elf32-hppa.c (elf32_hppa_set_gp): Don't require an
2526 hppa_link_hash_table.
2527
d84ed528
MF
25282017-08-02 Max Filippov <jcmvbkbc@gmail.com>
2529
2530 * xtensa-isa.c (xtensa_isa_init): Don't update lookup table
2531 entries for sysregs with negative indices.
2532
1ef692ea
AK
25332017-08-01 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
2534
2535 * elf32-s390.c (elf_s390_finish_dynamic_sections): Skip if it
2536 isn't the S/390 specific elf data.
2537 * elf64-s390.c (elf_s390_finish_dynamic_sections): Likewise.
2538
57593436
KLC
25392017-07-31 Kuan-Lin Chen <rufus@andestech.com>
2540
2541 * elfxx-riscv.c (riscv_elf_add_sub_reloc): New function.
2542 * (howto_table) [R_RISCV_ADD8]: Use riscv_elf_add_sub_reloc.
2543 [R_RISCV_ADD16]: Likewise.
2544 [R_RISCV_ADD32]: Likewise.
2545 [R_RISCV_ADD64]: Likewise.
2546 [R_RISCV_SUB6]: Likewise.
2547 [R_RISCV_SUB8]: Likewise.
2548 [R_RISCV_SUB16]: Likewise.
2549 [R_RISCV_SUB32]: Likewise.
2550 [R_RISCV_SUB64]: Likewise.
2551
d44c746a
AM
25522017-07-31 Alan Modra <amodra@gmail.com>
2553
2554 * elf64-ppc.c (ppc64_elf_tls_setup): Warn on --plt-localentry
2555 without ld.so checks.
2556
8b5f1ed8
AM
25572017-07-29 Alan Modra <amodra@gmail.com>
2558
2559 PR 21847
2560 * elf64-ppc.c (struct ppc_link_hash_entry): Add non_zero_localentry.
2561 (ppc64_elf_merge_symbol): Set non_zero_localentry.
2562 (is_elfv2_localentry0): Test non_zero_localentry.
2563 (ppc64_elf_tls_setup): Default to --no-plt-localentry.
2564
894dde0b
AK
25652017-07-28 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
2566
2567 * elf32-s390.c (elf_s390_finish_dynamic_sections): Add NULL
2568 pointer check for htab->elf.irelplt.
2569 * elf64-s390.c (elf_s390_finish_dynamic_sections): Likewise.
2570
8bdf0be1
NC
25712017-07-27 Nick Clifton <nickc@redhat.com>
2572
2573 PR 21840
2574 * mach-o.c (bfd_mach_o_read_symtab_strtab): Fail if the symtab
2575 size is -1.
2576 * nlmcode.h (nlm_swap_auxiliary_headers_in): Replace assertion
2577 with error return.
2578 * section.c (bfd_make_section_with_flags): Fail if the name or bfd
2579 are NULL.
2580 * vms-alpha.c (bfd_make_section_with_flags): Correct computation
2581 of end pointer.
2582 (evax_bfd_print_emh): Check for invalid string lengths.
2583
c26bb067
NC
25842017-07-25 Nick Clifton <nickc@redhat.com>
2585
2586 * po/fr.po: Updated French translation.
2587
cfe7b9bd
BG
25882017-07-25 Benjamin Green <bengreen5mx@gmail.com>
2589
2590 PR 21824
2591 * elf32-msp430.c (msp430_elf_relax_section): Allow conversion of
2592 16-bit absolute branches into 10-bit pc-relative branches on the
2593 MSP430 as well as the MSP430X.
2594
d4aaa2a0
AM
25952017-07-25 Alan Modra <amodra@gmail.com>
2596
2597 * elf64-ppc.c (struct map_stub): Add tls_get_addr_opt_bctrl.
2598 (stub_eh_frame_size): New function.
2599 (ppc_size_one_stub): Set group tls_get_addr_opt_bctrl.
2600 (group_sections): Init group tls_get_addr_opt_bctrl.
2601 (ppc64_elf_size_stubs): Update sizing and initialization of
2602 .eh_frame. Iteration over stubs via group list.
2603 (ppc64_elf_build_stubs): Iterate over stubs via group list.
2604 (ppc64_elf_finish_dynamic_sections): Update finalization of
2605 .eh_frame.
2606
ca4cf9b9
NC
26072017-07-24 Nick Clifton <nickc@redhat.com>
2608
2609 PR 21813
2610 * mach-o.c (bfd_mach_o_canonicalize_relocs): Pass the base address
2611 of the relocs to the canonicalize_one_reloc routine.
2612 * mach-o.h (struct bfd_mach_o_backend_data): Update the prototype
2613 for the _bfd_mach_o_canonicalize_one_reloc field.
2614 * mach-o-arm.c (bfd_mach_o_arm_canonicalize_one_reloc): Add
2615 res_base parameter. Use to check for corrupt pair relocs.
2616 * mach-o-aarch64.c (bfd_mach_o_arm64_canonicalize_one_reloc):
2617 Likewise.
2618 * mach-o-i386.c (bfd_mach_o_i386_canonicalize_one_reloc):
2619 Likewise.
2620 * mach-o-x86-64.c (bfd_mach_o_x86_64_canonicalize_one_reloc):
2621 Likewise.
2622
2623 * vms-alpha.c (_bfd_vms_slurp_eihd): Make sure that there is
2624 enough data in the record before attempting to parse it.
2625 (_bfd_vms_slurp_eeom): Likewise.
2626
2627 (_bfd_vms_slurp_egsd): Check for an invalid section index.
2628 (image_set_ptr): Likewise.
2629 (alpha_vms_slurp_relocs): Likewise.
2630
8a2df5e2
NC
2631 (alpha_vms_object_p): Check for a truncated record.
2632
47aeb64c
NC
26332017-07-24 Nick Clifton <nickc@redhat.com>
2634
2635 PR 21803
2636 * reloc.c (_bfd_unrecognized_reloc): New function. Reports
2637 an unrecognized reloc and sets the bfd_error value.
2638 * libbfd.h: Regenerate.
2639 * elf32-arm.c (elf32_arm_final_link_relocate): Use the new
2640 function.
2641 * elf32-i386.c (elf_i386_relocate_section): Likewise.
2642 * elf32-tilepro.c (tilepro_elf_relocate_section): Likewise.
2643 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
2644 * elfnn-aarch64.c (elfNN_aarch64_relocate_section): Likewise.
2645 * elfxx-tilegx.c (tilegx_elf_relocate_section): Likewise.
2646
15a3a14f
AM
26472017-07-23 Alan Modra <amodra@gmail.com>
2648
2649 * elf64-ppc.c (ppc64_elf_size_stubs): Correct advance to
2650 restore of LR.
2651
f2e6a843
SN
26522017-07-19 Szabolcs Nagy <szabolcs.nagy@arm.com>
2653
2654 PR ld/18841
2655 * elfnn-aarch64.c (elfNN_aarch64_reloc_type_class): Return
2656 reloc_class_ifunc for ifunc symbols.
2657
909e4e71
NC
26582017-07-19 Nick Clifton <nickc@redhat.com>
2659
2660 PR 21787
2661 * archive.c (bfd_generic_archive_p): If the bfd does not have the
2662 correct magic bytes at the start, set the error to wrong format
2663 and clear the format selector before returning NULL.
2664
29866fa1
NC
26652017-07-19 Nick Clifton <nickc@redhat.com>
2666
2667 PR 21786
2668 * coff-rs6000.c (_bfd_strntol): New function.
2669 (_bfd_strntoll): New function.
2670 (GET_VALUE_IN_FIELD): New macro.
2671 (EQ_VALUE_IN_FIELD): new macro.
2672 (_bfd_xcoff_slurp_armap): Use new macros.
2673 (_bfd_xcoff_archive_p): Likewise.
2674 (_bfd_xcoff_read_ar_hdr): Likewise.
2675 (_bfd_xcoff_openr_next_archived_file): Likewise.
2676 (_bfd_xcoff_stat_arch_elt): Likewise.
6c4e7b6b
NC
2677 * coff64-rs6000.c (_bfd_strntol): New function.
2678 (_bfd_strntoll): New function.
2679 (GET_VALUE_IN_FIELD): New macro.
2680 (xcoff64_slurp_armap): Use new macros.
29866fa1 2681
684d5a10
JEM
26822017-07-19 Claudiu Zissulescu <claziss@synopsys.com>
2683 John Eric Martin <John.Martin@emmicro-us.com>
2684
2685 * bfd-in2.h: Regenerate.
2686 * libbfd.h: Regenerate.
2687 * elf32-arc.c (JLI): Define.
2688 * reloc.c: Add JLI relocations.
2689
de194d85
YC
26902017-07-18 Nick Clifton <nickc@redhat.com>
2691
2692 PR 21775
2693 * coff-sh.c: Fix spelling typos.
2694 * compress.c: Likewise.
2695 * cpu-pdp11.c: Likewise.
2696 * ecofflink.c: Likewise.
2697 * elf-m10300.c: Likewise.
2698 * elf.c: Likewise.
2699 * elf32-arm.c: Likewise.
2700 * elf32-m68k.c: Likewise.
2701 * elf32-nds32.c: Likewise.
2702 * elf32-ppc.c: Likewise.
2703 * elf32-sh.c: Likewise.
2704 * elf32-v850.c: Likewise.
2705 * elf64-ppc.c: Likewise.
2706 * elf64-x86-64.c: Likewise.
2707 * elflink.c: Likewise.
2708 * elfnn-aarch64.c: Likewise.
2709 * elfxx-mips.c: Likewise.
2710 * som.c: Likewise.
2711 * sunos.c: Likewise.
2712 * vms-alpha.c: Likewise.
2713 * xcofflink.c: Likewise.
2714
e4e21d9e
NC
27152017-07-18 Nick Clifton <nickc@redhat.com>
2716
2717 PR binutils/21781
2718 * coffcode.h (handle_COMDAT): Replace abort with an error message
2719 and return.
2720
8e85f840
L
27212017-07-17 H.J. Lu <hongjiu.lu@intel.com>
2722
2723 PR ld/21782
2724 * elf64-x86-64.c (elf_x86_64_relocate_section): Limit PIC check
2725 to shared library.
2726
dd57c19c
L
27272017-07-17 H.J. Lu <hongjiu.lu@intel.com>
2728
2729 * elf64-x86-64.c (elf_x86_64_relocate_section): Re-indent.
2730
676ee2b5
AM
27312017-07-16 Alan Modra <amodra@gmail.com>
2732
2733 * elf64-ppc.c (ppc64_elf_relocate_section): Don't optimize
2734 __tls_index GOT entries when using __tls_get_addr_opt stub.
2735 * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
2736
429d795d
AM
27372017-07-12 Alan Modra <amodra@gmail.com>
2738
2739 * po/es.po: Update from translationproject.org/latest/bfd/.
2740 * po/fi.po: Likewise.
2741 * po/fr.po: Likewise.
2742 * po/id.po: Likewise.
2743 * po/ja.po: Likewise.
2744 * po/ro.po: Likewise.
2745 * po/ru.po: Likewise.
2746 * po/sr.po: Likewise.
2747 * po/sv.po: Likewise.
2748 * po/tr.po: Likewise.
2749 * po/uk.po: Likewise.
2750 * po/vi.po: Likewise.
2751 * po/zh_CN.po: Likewise.
2752 * po/hr.po: New file from translationproject.org.
2753 * configure.ac (ALL_LINGUAS): Add hr. Sort.
2754 * configure: Regenerate.
2755
0bae9e9e
NC
27562017-07-12 Nick Clifton <nickc@redhat.com>
2757
2758 Fix compile time warnings using gcc 7.1.1.
2759 * elf32-xtensa.c (elf_xtensa_get_plt_section): Increase length of
2760 plt_name buffer.
2761 (elf_xtensa_get_gotplt_section): Increase length of got_name
2762 buffer.
2763 * mach-o-arm.c (bfd_mach_o_arm_canonicalize_one_reloc): Add a
2764 default return of FALSE.
2765 * mach-o-i386.c (bfd_mach_o_i386_canonicalize_one_reloc): Add a
2766 default return of FALSE.
2767
d42c267e
AM
27682017-07-12 Alan Modra <amodra@gmail.com>
2769
2770 * binary.c (binary_set_section_contents): Don't print filepos in
2771 error message.
2772 (coff_write_object_contents): Cast size_t for error message.
2773 (coff_slurp_line_table): Don't use bfd_vma symndx.
2774 (coff_slurp_reloc_table): Remove unneeded cast.
2775 * dwarf2.c (read_section): Cast bfd_int64_t to long long for
2776 error message.
2777 (find_abstract_instance_name): Likewise.
2778 * elf32-arm.c (arm_type_of_stub): Correct error arg order.
2779 (bfd_elf32_arm_stm32l4xx_erratum_scan): Don't cast error arg.
2780 (elf32_arm_check_relocs): Make r_symndx an int.
2781 * elf32-cris.c (cris_elf_check_relocs): Delete extraneous %s in
2782 format string.
2783 * elf32-metag.c (elf_metag_relocate_section): Delete extra error
2784 message arg.
2785 * elf32-nds32.c (nds32_elf_ex9_build_hash_table): Rewrite bogus
2786 error message.
2787 * elf32-i386.c (elf_i386_check_relocs): Make r_symndx an int.
2788 * elf32-s390.c (elf_s390_check_relocs): Likewise.
2789 * elf32-tic6x.c (elf32_tic6x_check_relocs): Likewise.
2790 * elf32-tilepro.c (tilepro_elf_check_relocs): Likewise.
2791 * elf32-xtensa.c (elf_xtensa_check_relocs): Likewise.
2792 * elf64-s390.c (elf_s390_check_relocs): Likewise.
2793 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
2794 * elfnn-aarch64.c (elfNN_aarch64_check_relocs): Likewise.
2795 * elfnn-riscv.c (riscv_elf_check_relocs): Likewise.
2796 * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Likewise.
2797 * elfxx-tilegx.c (tilegx_elf_check_relocs): Likewise.
2798 * elf64-mmix.c (_bfd_mmix_after_linker_allocation): Cast size_t args
2799 and use %lu for error message.
2800 * elflink.c (elf_link_adjust_relocs): Delete extra error message arg.
2801 * mmo.c (mmo_scan): Make stab_loc a file_ptr. Cast expression for
2802 error message.
2803
2804 * elf32-arm.c (elf32_arm_tls_relax): Correct format string and args
2805 in error message.
2806 (elf32_arm_final_link_relocate): Likewise.
2807 * coff-arm.c (bfd_arm_process_before_allocation): Likewise.
2808 * coffcode.h (styp_to_sec_flags): Likewise.
2809 * cofflink.c (_bfd_coff_write_global_sym): Likewise.
2810 * ecoff.c (_bfd_ecoff_slurp_symbol_table): Likewise.
2811 * elf32-arc.c (arc_elf_merge_private_bfd_data): Likewise.
2812 * elf32-bfin.c (bfinfdpic_check_relocs): Likewise.
2813 (elf32_bfin_merge_private_bfd_data): Likewise.
2814 * elf32-cris.c (cris_elf_relocate_section): Likewise.
2815 * elf32-frv.c (frv_elf_merge_private_bfd_data): Likewise.
2816 * elf32-i370.c (i370_elf_merge_private_bfd_data): Likewise.
2817 (i370_elf_relocate_section): Likewise.
2818 * elf32-iq2000.c (iq2000_elf_merge_private_bfd_data): Likewise.
2819 * elf32-m32c.c (m32c_elf_merge_private_bfd_data): Likewise.
2820 * elf32-m68hc1x.c (_bfd_m68hc11_elf_merge_private_bfd_data): Likewise.
2821 * elf32-mcore.c (mcore_elf_relocate_section): Likewise.
2822 * elf32-mep.c (mep_elf_merge_private_bfd_data): Likewise.
2823 * elf32-mt.c (mt_elf_merge_private_bfd_data): Likewise.
2824 * elf64-sparc.c (elf64_sparc_merge_private_bfd_data): Likewise.
2825 * elfxx-mips.c (mips_elf_merge_obj_e_flags): Likewise.
2826 (_bfd_mips_elf_merge_private_bfd_data): Likewise.
2827 * ieee.c (ieee_write_id, read_id): Likewise.
2828 * mach-o.c (bfd_mach_o_write_contents): Likewise.
2829 (bfd_mach_o_layout_commands, bfd_mach_o_read_section_32): Likewise.
2830 (bfd_mach_o_read_section_64, bfd_mach_o_read_symtab_symbol): Likewise.
2831 (bfd_mach_o_read_command, bfd_mach_o_header_p): Likewise.
2832 * peXXigen.c (_bfd_XXi_swap_aouthdr_in): Likewise.
2833 * stabs.c (_bfd_link_section_stabs): Likewise.
2834
2835 * coff-arm.c (coff_arm_relocate_section): Use L modifier in error
2836 format.
2837 * coff-mcore.c (coff_mcore_relocate_section): Likewise.
2838 * coff-ppc.c (coff_ppc_relocate_section): Likewise.
2839 * coff-rs6000.c (xcoff_reloc_type_toc): Likewise.
2840 * coff-sh.c (sh_relax_section): Likewise.
2841 (sh_relax_delete_bytes, sh_swap_insns): Likewise.
2842 * coff-tic80.c (coff_tic80_relocate_section): Likewise.
2843 * coffcode.h (coff_slurp_reloc_table): Likewise.
2844 * coffgen.c (_bfd_coff_get_external_symbols): Likewise.
2845 (_bfd_coff_read_string_table): Likewise.
2846 * cofflink.c (_bfd_coff_generic_relocate_section): Likewise.
2847 * compress.c (bfd_get_full_section_contents): Likewise.
2848 * dwarf2.c (read_formatted_entries, decode_line_info): Likewise.
2849 * elf-m10300.c (mn10300_elf_relocate_section): Likewise.
2850 * elf.c (bfd_elf_string_from_elf_section): Likewise.
2851 * elf32-arc.c (arc_special_overflow_checks): Likewise.
2852 * elf32-arm.c (elf32_arm_tls_relax): Likewise.
2853 (elf32_arm_final_link_relocate, elf32_arm_relocate_section): Likewise.
2854 (elf32_arm_write_section): Likewise.
2855 * elf32-bfin.c (bfin_relocate_section): Likewise.
2856 (bfinfdpic_relocate_section): Likewise.
2857 * elf32-hppa.c (hppa_build_one_stub): Likewise.
2858 (final_link_relocate, elf32_hppa_relocate_section): Likewise.
2859 * elf32-i386.c (elf_i386_tls_transition): Likewise.
2860 (elf_i386_relocate_section): Likewise.
2861 * elf32-ip2k.c (ip2k_final_link_relocate): Likewise.
2862 * elf32-lm32.c (lm32_elf_finish_dynamic_sections): Likewise.
2863 * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
2864 * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
2865 * elf32-metag.c (elf_metag_relocate_section): Likewise.
2866 * elf32-nds32.c (unrecognized_reloc_msg): Likewise.
2867 (nds32_elf_relax_longcall1, nds32_elf_relax_longcall2): Likewise.
2868 (nds32_elf_relax_longcall3, nds32_elf_relax_longjump1): Likewise.
2869 (nds32_elf_relax_longjump2, nds32_elf_relax_longjump3): Likewise.
2870 (nds32_elf_relax_longcall4, nds32_elf_relax_longcall5): Likewise.
2871 (nds32_elf_relax_longcall6, nds32_elf_relax_longjump4): Likewise.
2872 (nds32_elf_relax_longjump5, nds32_elf_relax_longjump6): Likewise.
2873 (nds32_elf_relax_longjump7, nds32_elf_relax_loadstore): Likewise.
2874 (nds32_elf_relax_ptr, nds32_elf_ex9_build_hash_table): Likewise.
2875 * elf32-nios2.c (nios2_elf32_relocate_section): Likewise.
2876 * elf32-rx.c (UNSAFE_FOR_PID): Likewise.
2877 * elf32-s390.c (invalid_tls_insn, elf_s390_relocate_section): Likewise.
2878 * elf32-score.c (s3_bfd_score_elf_check_relocs): Likewise.
2879 * elf32-score7.c (s7_bfd_score_elf_check_relocs): Likewise.
2880 * elf32-sh.c (sh_elf_relax_section): Likewise.
2881 (sh_elf_relax_delete_bytes, sh_elf_swap_insns): Likewise.
2882 (sh_elf_relocate_section): Likewise.
2883 * elf32-sh64.c (shmedia_prepare_reloc): Likewise.
2884 * elf32-spu.c (spu_elf_relocate_section): Likewise.
2885 * elf32-tic6x.c (elf32_tic6x_relocate_section): Likewise.
2886 * elf32-tilepro.c (tilepro_elf_relocate_section): Likewise.
2887 * elf32-v850.c (v850_elf_relax_section): Likewise.
2888 * elf32-vax.c (elf_vax_check_relocs): Likewise.
2889 (elf_vax_relocate_section): Likewise.
2890 * elf32-xtensa.c (elf_xtensa_relocate_section): Likewise.
2891 (extend_ebb_bounds_forward, extend_ebb_bounds_backward): Likewise.
2892 (compute_text_actions, compute_ebb_proposed_actions): Likewise.
2893 (do_fix_for_relocatable_link): Likewise.
2894 * elf64-alpha.c (elf64_alpha_relax_got_load): Likewise.
2895 (elf64_alpha_relax_with_lituse): Likewise.
2896 * elf64-hppa.c (elf64_hppa_finish_dynamic_symbol): Likewise.
2897 (elf_hppa_final_link_relocate): Likewise.
2898 * elf64-ia64-vms.c (elf64_ia64_relax_section): Likewise.
2899 (elf64_ia64_choose_gp, elf64_ia64_relocate_section): Likewise.
2900 (elf64_vms_link_add_object_symbols): Likewise.
2901 * elf64-mmix.c (mmix_elf_perform_relocation): Likewise.
2902 (mmix_final_link_relocate): Likewise.
2903 * elf64-s390.c (invalid_tls_insn): Likewise.
2904 (elf_s390_relocate_section): Likewise.
2905 * elf64-sh64.c (sh_elf64_relocate_section): Likewise.
2906 * elf64-x86-64.c (elf_x86_64_tls_transition): Likewise.
2907 (elf_x86_64_relocate_section): Likewise.
2908 * elfcode.h (elf_slurp_symbol_table): Likewise.
2909 * elfcore.h (elf_core_file_p): Likewise.
2910 * elflink.c (elf_link_read_relocs_from_section): Likewise.
2911 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Likewise.
2912 (elfNN_aarch64_relocate_section): Likewise.
2913 * elfnn-ia64.c (elfNN_ia64_relax_section): Likewise.
2914 (elfNN_ia64_choose_gp, elfNN_ia64_relocate_section): Likewise.
2915 * elfnn-riscv.c (riscv_elf_relocate_section): Likewise.
2916 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
2917 (_bfd_mips_elf_relocate_section): Likewise.
2918 (_bfd_mips_elf_finish_dynamic_symbol, mips_finish_exec_plt): Likewise.
2919 * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Likewise.
2920 * elfxx-tilegx.c (tilegx_elf_relocate_section): Likewise.
2921 * ieee.c (ieee_slurp_external_symbols): Likewise.
2922 * ihex.c (ihex_write_object_content): Likewise.
2923 * mach-o.c (bfd_mach_o_build_exec_seg_command): Likewise.
2924 * merge.c (_bfd_merged_section_offset): Likewise.
2925 * mmo.c (mmo_write_loc_chunk): Likewise.
2926 (mmo_write_object_contents): Likewise.
2927 * peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Likewise.
2928 * stabs.c (_bfd_link_section_stabs): Likewise.
2929 * xcofflink.c (xcoff_link_add_symbols, xcoff_find_tc0): Likewise.
2930
e3fbc3da
AM
29312017-07-11 Alan Modra <amodra@gmail.com>
2932
2933 * elf32-ppc.c (ppc_elf_relocate_section): Fix typo.
2934
2c4d9cbe
AM
29352017-07-11 Alan Modra <amodra@gmail.com>
2936
2937 * elf32-ppc.c (ppc_elf_relocate_section): Emit "unexpected
2938 instruction" error using _bfd_error_handler, not einfo.
2939
adce5b39
NC
29402017-07-10 Nick Clifton <nickc@redhat.com>
2941
2942 * coffcode.h (coff_slurp_symbol_table): Do not include an entry
2943 for C_AIX_WEAKEXT if it has the same value as C_WEAKEXT.
2944
e6f3b9c3
JB
29452017-07-07 John Baldwin <jhb@FreeBSD.org>
2946
2947 * elf.c (elfcore_grok_freebsd_note): Handle NT_FREEBSD_PTLWPINFO.
2948
532cc313
AM
29492017-07-07 Alan Modra <amodra@gmail.com>
2950
2951 * coffcode.h (coff_slurp_symbol_table): Handle C_AIX_WEAKEXT.
2952
1cf9552b
AM
29532017-07-07 Alan Modra <amodra@gmail.com>
2954
2955 * bfd.c (_doprnt): Replace "L" with "ll" when printing bfd_vma
2956 as long long. Move code replacing "ll" with "I64", and simplify.
2957
a0b7b105
L
29582017-07-06 H.J. Lu <hongjiu.lu@intel.com>
2959
2960 * bfd.c (_doprnt): Convert 'L' to 'l' when setting wide_width
2961 to 1.
2962
1d827a72
L
29632017-07-05 H.J. Lu <hongjiu.lu@intel.com>
2964
2965 * dwarf2.c (line_info_add_include_dir_stub): Replace time with
2966 xtime.
2967 (line_info_add_file_name): Likewise.
2968 (decode_line_info): Likewise.
2969
0d702cfe
TG
29702017-07-04 Tristan Gingold <gingold@adacore.com>
2971
2972 * version.m4: Bump version to 2.29.51
2973 * configure: Regenerate.
2974
564e46b7
JW
29752017-07-04 Jiong Wang <jiong.wang@arm.com>
2976
2977 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Remove the
2978 sanity check at the head of this function.
2979
0041f7df
JK
29802017-07-04 Jan Kratochvil <jan.kratochvil@redhat.com>
2981
2982 * dwarf2.c (struct dwarf2_debug): Add fields dwarf_line_str_buffer and
2983 dwarf_line_str_size.
2984 (struct attr_abbrev): Add field implicit_const.
2985 (dwarf_debug_sections): Add .debug_line_str.
2986 (enum dwarf_debug_section_enum): Add debug_line_str and debug_max.
2987 (dwarf_debug_section_assert): Add static assertion.
2988 (read_indirect_line_string): New.
2989 (read_abbrevs): Support DW_FORM_implicit_const.
2990 (is_str_attr): Support DW_FORM_line_strp.
2991 (read_attribute_value): Support DW_FORM_line_strp and
2992 DW_FORM_implicit_const.
2993 (read_attribute): Support DW_FORM_implicit_const.
2994 (line_info_add_include_dir, line_info_add_include_dir_stub):
2995 (line_info_add_file_name, read_formatted_entries): New.
2996 (decode_line_info, parse_comp_unit): Support DWARF 5.
2997 (_bfd_dwarf2_cleanup_debug_info): Free dwarf_line_str_buffer.
2998
d8cd8c1f
EB
29992017-07-03 Egeyar Bagcioglu <egeyar.bagcioglu@oracle.com>
3000
3001 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Remove the
3002 abort statement that was put for symbols that are not dynamic.
3003
15e6ed8c
TG
30042017-07-03 Tristan Gingold <gingold@adacore.com>
3005
3006 * po/bfd.pot: Regenerate
3007
76cfced5
AM
30082017-07-03 Alan Modra <amodra@gmail.com>
3009
3010 * bfd.c (_doprnt): Rewrite "ll" and "L" modifiers to "I64" for
3011 __MSVCRT__. Support "L" modifier for bfd_vma. Formatting.
3012 * elf.c (setup_group): Use "Lx" to print sh_size.
3013 (_bfd_elf_setup_sections): Remove unnecessary cast and print
3014 unknown section type in hex.
3015 (copy_special_section_fields): Style fix.
3016 (bfd_section_from_shdr): Correct format for sh_link. Use a
3017 common error message for all the variants of unrecognized
3018 section types.
3019 (assign_file_positions_for_load_sections): Use "Lx" for lma
3020 adjust error message.
3021 (assign_file_positions_for_non_load_sections): Formatting.
3022 (rewrite_elf_program_header): Formatting. Use "Lx" for
3023 bfd_vma values in error messages.
3024 * elfcode.h (elf_slurp_reloc_table_from_section): Cast
3025 ELF_R_SYM value to type expected by format.
3026 * elflink.c (elf_link_read_relocs_from_section): Use "Lx"
3027 in error messages.
3028 (elf_link_add_object_symbols): Use "Lu" for symbol sizes.
3029 (elf_link_input_bfd): Use "Lx" for r_info.
3030 (bfd_elf_gc_record_vtinherit): Use "Lx" for offset.
3031
ce9116fd
AM
30322017-07-03 Alan Modra <amodra@gmail.com>
3033
3034 * bfd.c (bfd_scan_vma): Don't use long long unless HAVE_LONG_LONG.
3035 * coff-rs6000.c (FMT20): Handle hosts with 64-bit long and
3036 Microsoft C library variant of long long format specifier.
3037 (PRINT20): Cast value to bfd_uint64_t not long long.
3038 * coffcode.h (coff_print_aux): Use BFD_VMA_FMT.
3039 * coff-x86_64.c (coff_amd64_reloc): Use bfd_uint64_t rather than
3040 long long. Don't cast to bfd_vma.
3041 * elf32-score.c (score3_bfd_getl48): Likewise.
3042 * vms-alpha.c (_bfd_vms_slurp_eisd): Likewise.
3043
cd9af601
AM
30442017-07-03 Alan Modra <amodra@gmail.com>
3045
3046 * elf.c (_bfd_elf_print_private_bfd_data): Use BFD_VMA_FMT to
3047 print d_tag.
3048 (bfd_elf_print_symbol): Don't cast symbol->flags.
3049 (_bfd_elf_symbol_from_bfd_symbol): Likewise.
3050 * elf32-ppc.c (ppc_elf_begin_write_processing): Correct
3051 _bfd_error_handler argument order.
3052 (ppc_elf_merge_private_bfd_data): Don't cast flags.
3053
33c734b2
AM
30542017-07-03 Alan Modra <amodra@gmail.com>
3055
3056 * configure.ac: Invoke AC_CHECK_TYPES for long long. Invoke
3057 AC_TYPE_LONG_DOUBLE.
3058 * configure: Regenerate.
3059 * config.in: Regenerate.
3060
3df5cd13
AW
30612017-06-29 Andrew Waterman <andrew@sifive.com>
3062
3063 * elfnn-riscv.c (riscv_elf_adjust_dynamic_symbol): Fix TLS copy
3064 relocs.
3065
ec1acaba
EB
30662017-06-29 Egeyar Bagcioglu <egeyar.bagcioglu@oracle.com>
3067
3068 * elfxx-sparc.c (allocate_dynrelocs): Don't make a symbol dynamic
3069 unless it is undefined weak.
3070 * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Set the flag
3071 relative_reloc to direct non-dynamic symbols to R_SPARC_RELATIVE
3072 relocation.
3073 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): If symbol
3074 is not dynamic in PIC, abort.
3075
ff07562f
JW
30762017-06-29 Jiong Wang <jiong.wang@arm.com>
3077
3078 PR ld/21402
3079 * elfnn-aarch64.c (elfNN_aarch64_allocate_dynrelocs): Only make
3080 undefined weak symbols into dynamic.
3081 (elfNN_aarch64_final_link_relocate): Generate runtime RELATIVE
3082 relocation for non-dynamic symbols.
3083 (elfNN_aarch64_finish_dynamic_symbol): Add sanity check.
3084
2aff25ba
JW
30852017-06-29 Jiong Wang <jiong.wang@arm.com>
3086
3087 * elfnn-aarch64.c (aarch64_relocation_aginst_gp_p): New function.
3088 (elfNN_aarch64_final_link_relocate): Delete duplicated code for
3089 BFD_RELOC_AARCH64_LD64_GOTOFF_LO15, BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC,
3090 BFD_RELOC_AARCH64_MOVW_GOTOFF_G1.
3091 * elfxx-aarch64.c (_bfd_aarch64_elf_resolve_relocation): Optimize the
3092 support for them.
3093
88ab90e8
AA
30942017-06-29 Andreas Arnez <arnez@linux.vnet.ibm.com>
3095
3096 * elf-bfd.h (elfcore_write_s390_gs_cb): Add prototype.
3097 (elfcore_write_s390_gs_bc): Likewise.
3098 * elf.c (elfcore_grok_s390_gs_cb): New function.
3099 (elfcore_grok_s390_gs_bc): New function.
3100 (elfcore_grok_note): Call them.
3101 (elfcore_write_s390_gs_cb): New function.
3102 (elfcore_write_s390_gs_bc): New function.
3103 (elfcore_write_register_note): Call them.
3104
328ce951
L
31052017-06-28 H.J. Lu <hongjiu.lu@intel.com>
3106
3107 * libbfd.c (_bfd_generic_get_section_contents): Don't call
3108 bfd_get_file_size. Check archive element size.
3109 (_bfd_generic_get_section_contents_in_window): Likewise.
3110
47fdcf63
L
31112017-06-28 H.J. Lu <hongjiu.lu@intel.com>
3112
3113 * bfd-in2.h: Regenerated.
3114 * bfdio.c (bfd_get_size): Change return type to ufile_ptr.
3115 (bfd_get_file_size): Likewise.
3116
38bf472a
MR
31172017-06-28 Maciej W. Rozycki <macro@imgtec.com>
3118 Matthew Fortune <matthew.fortune@imgtec.com>
3119
3120 * archures.c (bfd_mach_mips_interaptiv_mr2): New macro.
3121 * cpu-mips.c (I_interaptiv_mr2): New enum value.
3122 (arch_info_struct): Add "mips:interaptiv-mr2" entry.
3123 * elfxx-mips.c (_bfd_elf_mips_mach) <E_MIPS_MACH_IAMR2>: New
3124 case.
3125 (mips_set_isa_flags) <bfd_mach_mips_interaptiv_mr2>: Likewise.
3126 (bfd_mips_isa_ext) <bfd_mach_mips_interaptiv_mr2>: Likewise.
3127 (print_mips_isa_ext) <AFL_EXT_INTERAPTIV_MR2>: Likewise.
3128 (mips_mach_extensions): Add `bfd_mach_mipsisa32r3' and
3129 `bfd_mach_mips_interaptiv_mr2' entries.
3130 * bfd-in2.h: Regenerate.
3131
2d68166e
NC
31322017-06-27 Nick Clifton <nickc@redhat.com>
3133
3134 * tekhex.c (pass_over): Revert accidental conversion of a local
3135 array to a static array.
3136
68063779
SKS
31372017-06-27 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
3138
3139 PR ld/13402
3140 * elf32-avr.c (elf32_avr_adjust_diff_reloc_value): Adjust
3141 reloc addend if necessary. Adjust diff only if
3142 shrinked_insn_address < end_address.
3143
ea9aafc4
AM
31442017-06-27 Alan Modra <amodra@gmail.com>
3145
3146 PR binutils/21665
3147 * libbfd.c (_bfd_generic_get_section_contents): Warning fix.
3148 (_bfd_generic_get_section_contents_in_window): Likewise.
3149
a6cbf936
KLC
31502017-06-26 Kuan-Lin Chen <rufus@andestech.com>
3151
3152 * elfnn-riscv.c (perform_relocation): Support the new
3153 R_RISCV_32_PCREL relocation.
3154 (riscv_elf_relocate_section): Likewise.
3155 * elfxx-riscv.c (howto_table): Likewise.
3156 (riscv_reloc_map): Likewise.
3157 * bfd-in2.h (BFD_RELOC_RISCV_32_PCREL): New relocation.
3158 * libbfd.h: Regenerate.
3159
7211ae50
AM
31602017-06-27 Alan Modra <amodra@gmail.com>
3161
3162 PR binutils/21665
3163 * libbfd.c (_bfd_generic_get_section_contents): Delete abort.
3164 Use unsigned file pointer type, and remove cast.
3165 * libbfd.c (_bfd_generic_get_section_contents_in_window): Likewise.
3166 Add "count", not "sz".
3167
ab27f80c
PA
31682017-06-26 Pedro Alves <palves@redhat.com>
3169
3170 PR binutils/21665
3171 * libbfd.c (_bfd_generic_get_section_contents): Add "count", not
3172 "sz".
3173
1f473e3d
L
31742017-06-26 H.J. Lu <hongjiu.lu@intel.com>
3175
3176 PR binutils/21665
3177 * libbfd.c (_bfd_generic_get_section_contents_in_window): Add
3178 a missing line.
3179
b417536f
MR
31802017-06-26 Maciej W. Rozycki <macro@imgtec.com>
3181
3182 * cpu-mips.c (arch_info_struct): Mark the 4010 32-bit.
3183 * elfxx-mips.c (mips_set_isa_flags) <bfd_mach_mips4010>: Set
3184 E_MIPS_ARCH_2 rather than E_MIPS_ARCH_3 in `e_flags'.
3185 (mips_mach_extensions): Mark `bfd_mach_mips4010' as extending
3186 `bfd_mach_mips6000' rather than `bfd_mach_mips4000'.
3187
0630b49c
L
31882017-06-26 H.J. Lu <hongjiu.lu@intel.com>
3189
3190 PR binutils/21665
3191 * compress.c (bfd_get_full_section_contents): Don't check the
3192 file size here.
3193 * libbfd.c (_bfd_generic_get_section_contents): Check for and
ea9aafc4 3194 reject a section whose size + offset is greater than the size
0630b49c
L
3195 of the entire file.
3196 (_bfd_generic_get_section_contents_in_window): Likewise.
515a4464 3197
04e15b4a
NC
31982017-06-26 Nick Clifton <nickc@redhat.com>
3199
3200 PR binutils/21670
3201 * tekhex.c (getvalue): Check for the source pointer exceeding the
3202 end pointer before the first byte is read.
3203
cfd14a50
NC
32042017-06-26 Nick Clifton <nickc@redhat.com>
3205
3206 PR binutils/21665
ea9aafc4 3207 * opncls.c (get_build_id): Check that the section is big enough
cfd14a50
NC
3208 to contain the whole note.
3209 * compress.c (bfd_get_full_section_contents): Check for and reject
ea9aafc4 3210 a section whose size is greater than the size of the entire file.
cfd14a50
NC
3211 * elf32-v850.c (v850_elf_copy_notes): Allow for the ouput to not
3212 contain a notes section.
3213
93ec5e23
AK
32142017-06-26 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
3215
3216 * elf64-s390.c (elf_s390_additional_program_headers): Add NULL
3217 pointer checks.
3218 (elf_s390_modify_segment_map): Likewise.
3219 (bfd_elf_s390_set_options): Lisewise.
3220
57963c05
AM
32212017-06-26 Alan Modra <amodra@gmail.com>
3222
3223 * elflink.c (_bfd_elf_link_create_dynstrtab): Don't make dynobj
3224 a --just-syms bfd.
3225 (_bfd_elf_size_group_sections): Skip --just-syms bfds.
3226 (bfd_elf_size_dynamic_sections): Ignore .note.GNU-stack and
3227 .preinit_array on --just-syms bfds.
3228 (_bfd_elf_gc_mark_extra_sections): Skip --just-syms bfds.
3229 (elf_gc_sweep, bfd_elf_parse_eh_frame_entries): Likewise.
3230 (bfd_elf_gc_sections, bfd_elf_discard_info): Likewise.
3231
5cc4ca83
ST
32322017-06-25 Sergei Trofimovich <slyfox@gentoo.org>
3233
3234 * elf.c (find_link): Bounds check "hint".
3235
bff0500d
TP
32362017-06-24 Thomas Preud'homme <thomas.preudhomme@arm.com>
3237
3238 * elf32-arm.c (using_thumb_only): Update list of architectures in
3239 BFD_ASSERT for which the logic is valid.
3240 (using_thumb2_bl): Likewise.
3241 (using_thumb2): Likewise and return true for ARMv8-R.
3242 (arch_has_arm_nop): Likewise.
3243 (tag_cpu_arch_combine): New v8r table for ARMv8-R Tag_CPU_arch
3244 merging logic. Update commentis for value 15 of v8m_baseline,
3245 v8m_mainline and v4t_plus_v6_m arrays. Use v8r array to decide
3246 merging of value 15 of Tag_CPU_arch.
3247
4aa57d6a
JW
32482017-06-23 Jiong Wang <jiong.wang@arm.com>
3249
3250 * reloc.c (BFD_RELOC_AARCH64_ADR_GOTPAGE): Rename to
3251 BFD_RELOC_AARCH64_ADR_GOT_PAGE
3252 * bfd-in2.h: Regenerate.
3253
5d8763a3
L
32542017-06-22 H.J. Lu <hongjiu.lu@intel.com>
3255
3256 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Move
3257 the error_alignment label forward. Properly align program
3258 property note section.
3259
e652757b
EC
32602017-06-22 Eric Christopher <echristo@gmail.com>
3261
3262 * elf32-arm.c (elf32_arm_final_link_relocate): Use labs rather than
3263 abs to fix a truncation warning.
3264
84da4cf8
L
32652017-06-22 H.J. Lu <hongjiu.lu@intel.com>
3266
3267 * elf32-i386.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Resolve
3268 local undefined weak symbol to 0.
3269 * elf64-x86-64.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Likewise.
3270
48580982
L
32712017-06-22 H.J. Lu <hongjiu.lu@intel.com>
3272
3273 * elf32-i386.c (elf_i386_merge_gnu_properties): If info->shstk
3274 is set, turn on GNU_PROPERTY_X86_FEATURE_1_SHSTK.
3275 (elf_i386_link_setup_gnu_properties): If info->shstk is set,
3276 turn on GNU_PROPERTY_X86_FEATURE_1_IBT.
3277 * elf64-x86-64.c (elf_x86_64_merge_gnu_properties): If
3278 info->shstk is set, turn on GNU_PROPERTY_X86_FEATURE_1_SHSTK.
3279 (elf_x86_64_link_setup_gnu_properties): If info->shstk is set,
3280 turn on GNU_PROPERTY_X86_FEATURE_1_IBT.
3281
ee2fdd6f
L
32822017-06-22 H.J. Lu <hongjiu.lu@intel.com>
3283
3284 * elf32-i386.c (elf_i386_lazy_ibt_plt0_entry): New.
3285 (elf_i386_lazy_ibt_plt_entry): Likewise.
3286 (elf_i386_pic_lazy_ibt_plt0_entry): Likewise.
3287 (elf_i386_non_lazy_ibt_plt_entry): Likewise.
3288 (elf_i386_pic_non_lazy_ibt_plt_entry): Likewise.
3289 (elf_i386_eh_frame_lazy_ibt_plt): Likewise.
3290 (elf_i386_lazy_plt_layout): Likewise.
3291 (elf_i386_non_lazy_plt_layout): Likewise.
3292 (elf_i386_link_hash_entry): Add plt_second.
3293 (elf_i386_link_hash_table): Add plt_second and
3294 plt_second_eh_frame.
3295 (elf_i386_allocate_dynrelocs): Use the second PLT if needed.
3296 (elf_i386_size_dynamic_sections): Use .plt.got unwind info for
3297 the second PLT. Check the second PLT.
3298 (elf_i386_relocate_section): Use the second PLT to resolve
3299 PLT reference if needed.
3300 (elf_i386_finish_dynamic_symbol): Fill and use the second PLT if
3301 needed.
3302 (elf_i386_finish_dynamic_sections): Set sh_entsize on the
3303 second PLT. Generate unwind info for the second PLT.
3304 (elf_i386_plt_type): Add plt_second.
3305 (elf_i386_get_synthetic_symtab): Support the second PLT.
3306 (elf_i386_parse_gnu_properties): Support
3307 GNU_PROPERTY_X86_FEATURE_1_AND.
3308 (elf_i386_merge_gnu_properties): Support
3309 GNU_PROPERTY_X86_FEATURE_1_AND. If info->ibt is set, turn
3310 on GNU_PROPERTY_X86_FEATURE_1_IBT
3311 (elf_i386_link_setup_gnu_properties): If info->ibt is set,
3312 turn on GNU_PROPERTY_X86_FEATURE_1_IBT. Use IBT-enabled PLT
3313 for info->ibtplt, info->ibt or GNU_PROPERTY_X86_FEATURE_1_IBT
3314 is set on all relocatable inputs.
3315 * elf64-x86-64.c (elf_x86_64_lazy_ibt_plt_entry): New.
3316 (elf_x32_lazy_ibt_plt_entry): Likewise.
3317 (elf_x86_64_non_lazy_ibt_plt_entry): Likewise.
3318 (elf_x32_non_lazy_ibt_plt_entry): Likewise.
3319 (elf_x86_64_eh_frame_lazy_ibt_plt): Likewise.
3320 (elf_x32_eh_frame_lazy_ibt_plt): Likewise.
3321 (elf_x86_64_lazy_ibt_plt): Likewise.
3322 (elf_x32_lazy_ibt_plt): Likewise.
3323 (elf_x86_64_non_lazy_ibt_plt): Likewise.
3324 (elf_x32_non_lazy_ibt_plt): Likewise.
3325 (elf_x86_64_get_synthetic_symtab): Support the second PLT.
3326 (elf_x86_64_parse_gnu_properties): Support
3327 GNU_PROPERTY_X86_FEATURE_1_AND.
3328 (elf_x86_64_merge_gnu_properties): Support
3329 GNU_PROPERTY_X86_FEATURE_1_AND. If info->ibt is set, turn
3330 on GNU_PROPERTY_X86_FEATURE_1_IBT
3331 (elf_x86_64_link_setup_gnu_properties): If info->ibt is set,
3332 turn on GNU_PROPERTY_X86_FEATURE_1_IBT. Use IBT-enabled PLT
3333 for info->ibtplt, info->ibt or GNU_PROPERTY_X86_FEATURE_1_IBT
3334 is set on all relocatable inputs.
3335
d19237d9
NC
33362017-06-22 Nick Clifton <nickc@redhat.com>
3337
3338 PR binutils/21649
3339 * som.c (setup_sections): NUL terminate the space_strings buffer.
3340 Check that the space.name field does not index beyond the end of
3341 the space_strings buffer.
3342
6879f5a9
NC
33432017-06-21 Nick Clifton <nickc@redhat.com>
3344
3345 PR binutils/21646
3346 * coff-sh.c (sh_reloc): Check for an out of range reloc.
3347
7adc0a81
NC
33482017-06-21 Nick Clifton <nickc@redhat.com>
3349
3350 PR binutils/21639
3351 * vms-misc.c (_bfd_vms_save_sized_string): Use unsigned int as
3352 type of the size parameter.
3353 (_bfd_vms_save_counted_string): Add second parameter - the maximum
3354 length of the counted string.
3355 * vms.h (_bfd_vms_save_sized_string): Update prototype.
3356 (_bfd_vms_save_counted_string): Likewise.
3357 * vms-alpha.c (_bfd_vms_slurp_eisd): Update calls to
3358 _bfd_vms_save_counted_string.
3359 (_bfd_vms_slurp_ehdr): Likewise.
3360 (_bfd_vms_slurp_egsd): Likewise.
3361 (Parse_module): Likewise.
3362
6e1816be
AM
33632017-06-21 Alan Modra <amodra@gmail.com>
3364
3365 * elf64-ppc.c (ppc64_elf_size_stubs): Test for localentry:0 plt
3366 calls before tocsave calls.
3367 (ppc64_elf_relocate_section): Allow localentry:0 plt calls without
3368 following nop.
3369
20bd1b6b
NC
33702017-06-21 Nick Clifton <nickc@redhat.com>
3371
3372 PR binutils/21645
3373 * reloc.c (bfd_generic_get_relocated_section_contents): Fail if
3374 bfd_get_full_section_contents returns no contents.
3375
3de58d95
NC
33762017-06-21 Nick Clifton <nickc@redhat.com>
3377
3378 PR binutils/21638
3379 * vms-alpha.c (_bfd_vms_slurp_egsd): Check for an undersized
3380 record.
3381
cb06d03a
NC
33822017-06-21 Nick Clifton <nickc@redhat.com>
3383
3384 PR binutils/21637
3385 * vms-alpha.c (_bfd_vms_slurp_egsd): Check for an empty section
3386 list.
3387 (image_set_ptr): Likewise.
3388 (alpha_vms_fix_sec_rel): Likewise.
3389 (alpha_vms_slurp_relocs): Likewise.
3390
c458d007
NC
33912017-06-21 Nick Clifton <nickc@redhat.com>
3392
3393 PR binutils/21633
3394 * ieee.c (ieee_slurp_sections): Check for a NULL return from
3395 read_id.
3396 (ieee_archive_p): Likewise.
3397 (ieee_object_p): Likewise.
3398
ce497010
NC
33992017-06-21 Nick Clifton <nickc@redhat.com>
3400
3401 PR binutils/21640
3402 * elf.c (setup_group): Zero the group section pointer list after
3403 allocation so that loops can be caught. Check for NULL pointers
3404 when processing a group list.
3405
fd52715c
AK
34062017-06-20 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
3407
3408 * elf-s390.h: New file.
3409 * elf64-s390.c (struct elf_s390_link_hash_table): Add params
3410 field.
3411 (elf_s390_additional_program_headers): New function.
3412 (elf_s390_modify_segment_map): New function.
3413 (bfd_elf_s390_set_options): New function.
3414 (elf_backend_additional_program_headers)
3415 (elf_backend_modify_segment_map): Add macro definitions.
3416
abfa390d
L
34172017-06-19 H.J. Lu <hongjiu.lu@intel.com>
3418
3419 PR ld/21626
3420 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Check
3421 the DYNAMIC bit instead of bfd_count_sections.
3422
bc21b167
NC
34232017-06-19 Nick Clifton <nickc@redhat.com>
3424
3425 PR binutils/21618
3426 * vms-alpha.c (evax_bfd_print_emh): Check for insufficient record
3427 length.
3428 (evax_bfd_print_eeom): Likewise.
3429 (evax_bfd_print_egsd): Check for an overlarge record length.
3430 (evax_bfd_print_etir): Likewise.
3431
acb56a83
NC
34322017-06-19 Nick Clifton <nickc@redhat.com>
3433
3434 PR binutils/21612
3435 * libieee.h (struct common_header_type): Add end_p field.
3436 * ieee.c (this_byte_and_next): Do not advance input_p beyond
3437 end_p.
3438 (read_id): Check for a length that exceeds the remaining bytes in
3439 the input buffer.
3440 (ieee_seek): Initialise end_p.
3441 (ieee_archive_p): Likewise.
3442 (ieee_object_p): Likewise.
3443
72e84f96
NC
34442017-06-19 Nick Clifton <nickc@redhat.com>
3445
80053e46
NC
3446 PR binutils/21611
3447 * vms-alpha.c (_bfd_vms_slurp_eihs): Check for invalid offset
3448 before reading the EIHS structure entries.
3449
34502017-06-19 Nick Clifton <nickc@redhat.com>
3451
3452 PR binutils/21615
72e84f96
NC
3453 * vms-alpha.c (_bfd_vms_slurp_egsd): Use unsigned int for
3454 gsd_size. Check that there are enough bytes remaining to read the
3455 type and size of the next egsd. Check that the size of the egsd
3456 does not exceed the size of the record.
3457
875ffa3e
AM
34582017-06-19 Alan Modra <amodra@gmail.com>
3459
3460 * config.bfd: Correct targ_underscore for cris.
3461
bdd32e03
AM
34622017-06-18 Alan Modra <amodra@gmail.com>
3463
3464 * config.bfd: Correct targ_underscore for epiphany, ip2k,
3465 m32c, mn10200, pru, rl78, rx, crisv32 and v850.
3466
4b48e2f6
NC
34672017-06-16 Nick Clifton <nickc@redhat.com>
3468
3469 * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Do not fail if the
3470 bucketlist is empty because there are no symbols to add to the
3471 list.
3472
7dba9362
AM
34732017-06-16 Alan Modra <amodra@gmail.com>
3474
3475 PR ld/20022
3476 PR ld/21557
3477 PR ld/21562
3478 PR ld/21571
3479 * targets.c (struct bfd_target): Add _bfd_define_start_stop.
3480 (BFD_JUMP_TABLE_LINK): Likewise.
3481 * elf-bfd.h (bfd_elf_define_start_stop): Declare.
3482 * elflink.c (_bfd_elf_gc_mark_rsec): Update comment.
3483 (bfd_elf_define_start_stop): New function.
3484 * linker.c (bfd_generic_define_start_stop): New function.
3485 * coff64-rs6000.c (rs6000_xcoff64_vec, rs6000_xcoff64_aix_vec): Init
3486 new field.
3487 * aout-adobe.c (aout_32_bfd_define_start_stop): Define.
3488 * aout-target.h (MY_bfd_define_start_stop): Define.
3489 * aout-tic30.c (MY_bfd_define_start_stop): Define.
3490 * binary.c (binary_bfd_define_start_stop): Define.
3491 * bout.c (b_out_bfd_define_start_stop): Define.
3492 * coff-alpha.c (_bfd_ecoff_bfd_define_start_stop): Define.
3493 * coff-mips.c (_bfd_ecoff_bfd_define_start_stop): Define.
3494 * coff-rs6000.c (_bfd_xcoff_bfd_define_start_stop): Define.
3495 * coffcode.h (coff_bfd_define_start_stop): Define.
3496 * elfxx-target.h (bfd_elfNN_bfd_define_start_stop): Define.
3497 * i386msdos.c (msdos_bfd_define_start_stop): Define.
3498 * i386os9k.c (os9k_bfd_define_start_stop): Define.
3499 * ieee.c (ieee_bfd_define_start_stop): Define.
3500 * ihex.c (ihex_bfd_define_start_stop): Define.
3501 * libbfd-in.h (_bfd_nolink_bfd_define_start_stop): Define.
3502 * mach-o-target.c (bfd_mach_o_bfd_define_start_stop): Define.
3503 * mmo.c (mmo_bfd_define_start_stop): Define.
3504 * nlm-target.h (nlm_bfd_define_start_stop): Define.
3505 * oasys.c (oasys_bfd_define_start_stop): Define.
3506 * pef.c (bfd_pef_bfd_define_start_stop): Define.
3507 * plugin.c (bfd_plugin_bfd_define_start_stop): Define.
3508 * ppcboot.c (ppcboot_bfd_define_start_stop): Define.
3509 * som.c (som_bfd_define_start_stop): Define.
3510 * srec.c (srec_bfd_define_start_stop): Define.
3511 * tekhex.c (tekhex_bfd_define_start_stop): Define.
3512 * versados.c (versados_bfd_define_start_stop): Define.
3513 * vms-alpha.c (vms_bfd_define_start_stop): Define.
3514 (alpha_vms_bfd_define_start_stop): Define.
3515 * xsym.c (bfd_sym_bfd_define_start_stop): Define.
3516 * bfd-in2.h: Regenerate.
3517 * libbfd.h: Regenerate.
3518
d68f1976
JW
35192017-06-16 Jiong Wang <jiong.wang@arm.com>
3520
3521 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Use
3522 SYMBOL_REFERENCES_LOCAL.
3523
6353d82b
JW
35242017-06-15 Jiong Wang <jiong.wang@arm.com>
3525
3526 PR ld/21532
3527 * elfnn-aarch64.c (ELIMINATE_COPY_RELOCS): Set to 1.
3528 (elfNN_aarch64_final_link_relocate): Also propagate relocations to
3529 runtime for if there needs copy relocation elimination.
3530 (need_copy_relocation_p): New function. Return true for symbol with
3531 pc-relative references and if it's against read-only sections.
3532 (elfNN_aarch64_adjust_dynamic_symbol): Use need_copy_relocation_p.
3533 (elfNN_aarch64_check_relocs): Allocate dynrelocs for relocation types
3534 that are related with accessing external objects.
3535 (elfNN_aarch64_gc_sweep_hook): Sync the relocation types with the change
3536 in elfNN_aarch64_check_relocs.
3537
63634bb4
NC
35382017-06-15 Nick Clifton <nickc@redhat.com>
3539
3540 PR binutils/21582
3541 * ieee.c (ieee_object_p): Use a static buffer to avoid compiler
3542 bugs.
62b76e4b
NC
3543 PR binutils/21581
3544 (ieee_archive_p): Likewise.
63634bb4 3545
76800cba
NC
35462017-06-15 Nick Clifton <nickc@redhat.com>
3547
3548 PR binutils/21579
3549 * vms-alpha.c (_bfd_vms_slurp_etir): Extend check of cmd_length.
3550
f7e16c2a
MF
35512017-06-14 Max Filippov <jcmvbkbc@gmail.com>
3552
3553 * elf32-xtensa.c (elf_xtensa_be_plt_entry,
3554 elf_xtensa_le_plt_entry): Add dimension for the ABI to arrays,
3555 keep both windowed and call0 ABI PLT definitions.
3556 (elf_xtensa_create_plt_entry): Use selected ABI to choose upper
3557 elf_xtensa_*_plt_entry endex.
3558 (ELF_MAXPAGESIZE): Fix at minimal supported MMU page size.
3559
f461bbd8
NC
35602017-06-14 Nick Clifton <nickc@redhat.com>
3561
3562 PR binutils/21578
3563 * elf32-sh.c (sh_elf_set_mach_from_flags): Fix check for invalid
3564 flag value.
3565
c53d2e6d
NC
35662017-06-14 Nick Clifton <nickc@redhat.com>
3567
3568 PR binutils/21589
3569 * vms-alpha.c (_bfd_vms_get_value): Add an extra parameter - the
3570 maximum value for the ascic pointer. Check that name processing
3571 does not read beyond this value.
3572 (_bfd_vms_slurp_etir): Add checks for attempts to read beyond the
3573 end of etir record.
3574
04f963fd
NC
35752017-06-14 Nick Clifton <nickc@redhat.com>
3576
3577 PR binutils/21591
3578 * versados.c (versados_mkobject): Zero the allocated tdata structure.
3579 (process_otr): Check for an invalid offset in the otr structure.
3580
319c2dbe
SH
35812017-06-14 Sebastian Huber <sebastian.huber@embedded-brains.de>
3582
3583 * config.bfd (epiphany-*-elf): Accept epiphany-*-*.
3584
cbd0eecf
L
35852017-06-13 H.J. Lu <hongjiu.lu@intel.com>
3586
3587 PR ld/20022
3588 PR ld/21557
3589 PR ld/21562
3590 PR ld/21571
3591 * elf-bfd.h (elf_link_hash_entry): Add start_stop. Change the
3592 vtable field to a union.
3593 (_bfd_elf_is_start_stop): Removed.
3594 * elf32-i386.c (elf_i386_convert_load_reloc): Also check for
3595 __start_SECNAME and __stop_SECNAME symbols.
3596 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Likewise.
3597 * elflink.c (_bfd_elf_is_start_stop): Removed.
3598 (_bfd_elf_gc_mark_rsec): Check start_stop instead of calling
3599 _bfd_elf_is_start_stop.
3600 (elf_gc_propagate_vtable_entries_used): Skip __start_SECNAME and
3601 __stop_SECNAME symbols. Updated.
3602 (elf_gc_smash_unused_vtentry_relocs): Likewise.
3603 (bfd_elf_gc_record_vtinherit): Likewise.
3604 (bfd_elf_gc_record_vtentry): Likewise.
3605
10bbbc1d
NC
36062017-06-13 Nick Clifton <nickc@redhat.com>
3607
3608 PR ld/21524
3609 * elflink.c (elf_link_adjust_relocs): Generate an error when
3610 encountering a reloc against a symbol removed by garbage
3611 collection.
3612
5c3ce2bc
L
36132017-06-12 H.J. Lu <hongjiu.lu@intel.com>
3614
3615 * elf-bfd.h (elf_backend_data): Add struct bfd_link_info *
3616 to merge_gnu_properties.
3617 * elf-properties.c (elf_merge_gnu_properties): Add struct
3618 bfd_link_info * and pass it to merge_gnu_properties.
3619 (elf_merge_gnu_property_list): Add struct bfd_link_info *
3620 and pass it to elf_merge_gnu_properties.
3621 (_bfd_elf_link_setup_gnu_properties): Pass info to
3622 elf_merge_gnu_property_list.
3623 * elf32-i386.c (elf_i386_merge_gnu_properties): Add struct
3624 bfd_link_info *.
3625 * elf64-x86-64.c (elf_x86_64_merge_gnu_properties): Likewise.
3626
9b97dfbf
AM
36272017-06-11 Joe Zbiciak <joe.zbiciak@leftturnonly.info>
3628
3629 PR 21564
3630 * binary.c (binary_set_section_contents): Scale lma by octets
3631 per byte to set filepos.
3632
e3d1d408
CM
36332017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3634
3635 * elf32-arc.c (elf_arc_check_relocs): Fixed conditions to generate
3636 dynamic sections.
3637
64aa8e03
CM
36382017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3639
3640 * elf32-arc.c (elf_arc_size_dynamic_sections): Changed condition to
3641 require TEXTREL.
3642
a0abe743
CM
36432017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3644
3645 * arc-got.h (relocate_fix_got_relocs_for_got_info): Added TCB_SIZE to
3646 patched section contents for TLS IE reloc.
3647 * elf32-arc.c: Remove TCB_SIZE preprocessor macro.
3648
f4e6805f
CM
36492017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3650
3651 * elf32-arc.c (elf_arc_relocate_section): Added "call" to
3652 RELOC_FOR_GLOBAL_SYMBOL macro.
3653
cd640291
CM
36542018-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3655
3656 * elf32-arc.c (elf_arc_relocate_section): Small refactor and condition
3657 changes.
3658
7ef0acc1
VG
36592017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3660
3661 * config/tc-arc.c (md_undefined_symbol): Changed.
3662 * config/tc-arc.h (DYNAMIC_STRUCT_NAME): Removed.
3663
cc89d0b3
CM
36642017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3665
3666 * elf32-arc.c (elf_arc_relocate_section): Fixed reassign of indirect
3667 symbols.
3668
9d5c718b
CM
36692017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3670
3671 * elf32-arc.c (elf_arc_check_relocs): Added condition to disable
3672 warning and "Bad value" for local symbols ARC_32 or ARC_32_ME relocs.
3673
be9e3704
CM
36742017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3675
3676 * elf32-arc.c (ADD_RELA): Changed to only work when dynamic
3677 object is created.
3678
4ec192e6
RE
36792017-06-08 Richard Earnshaw <rearnsha@arm.com>
3680
3681 * elf32-arm.c (elf32_arm_merge_eabi_attributes): Remove assertion
3682 that the input bfd has Tag_FP_ARCH non-zero if Tag_ABI_HardFP_use
3683 is non-zero. Add clarifying comments.
3684
51fa2693
L
36852017-06-08 H.J. Lu <hongjiu.lu@intel.com>
3686
3687 * elf32-i386.c (elf_i386_check_relocs): Set local IFUNC symbol
3688 name. Use local IFUNC symbol name string to report unsupported
3689 non-PIC call to IFUNC function.
3690 (elf_i386_relocate_section): Dump local IFUNC name with minfo
3691 when generating R_386_IRELATIVE relocation.
3692 (elf_i386_finish_dynamic_symbol): Likewise.
3693 * elf_x86_64_check_relocs (elf_x86_64_check_relocs): Set local
3694 IFUNC symbol name.
3695 (elf_x86_64_relocate_section): Dump local IFUNC name with minfo
3696 when generating R_X86_64_IRELATIVE relocation.
3697 (elf_x86_64_finish_dynamic_symbol): Likewise.
3698
78e8a2ff
JM
36992017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
3700
3701 * elf.c (setup_group): Make sure BFD sections are created for all
3702 group sections in the input file when processing SHF_GROUP
3703 sections.
3704 (bfd_section_from_shdr): Avoid duplicating logic already
3705 implemented in `setup_group'.
3706
9949827b
DBR
37072017-06-06 Daniel Bonniot de Ruisselet <bonniot@gmail.com>
3708
3709 PR binutils/21546
3710 * peXXigen.c (pe_print_idata): Use the address of the first thunk
3711 if the hint address is zero.
3712
0ee3a6db
JC
37132017-06-06 James Clarke <jrtc27@jrtc27.com>
3714
3715 PR ld/19579
3716 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Check
3717 ELF_COMMON_DEF_P for common symbols.
3718
7bdf4127
AB
37192017-06-06 Andrew Burgess <andrew.burgess@embecosm.com>
3720
3721 * elf.c (_bfd_elf_make_section_from_shdr): Don't initially mark
3722 SEC_GROUP sections as SEC_EXCLUDE.
3723 (bfd_elf_set_group_contents): Replace use of abort with an assert.
3724 (assign_section_numbers): Use resolve_section_groups flag instead
3725 of relocatable link type.
3726 (_bfd_elf_init_private_section_data): Use resolve_section_groups
3727 flag instead of checking the final_link flag for part of the
3728 checks in here. Fix white space as a result.
3729 * elflink.c (elf_link_input_bfd): Use resolve_section_groups flag
3730 instead of relocatable link type.
3731 (bfd_elf_final_link): Likewise.
3732
458ad2b8
JM
37332017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
3734
3735 * elfxx-mips.c (_bfd_mips_elf_relocate_section): Remove unused
3736 variable `bed'.
3737 * elf32-score.c (score_elf_final_link_relocate): Likewise.
3738 (s3_bfd_score_elf_check_relocs): Likewise.
3739 * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
3740 (score_elf_final_link_relocate): Likewise.
3741 (s7_bfd_score_elf_check_relocs): Likewise.
3742
fbebaf4a
JM
37432017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
3744
3745 * elflink.c (init_reloc_cookie_rels): Remove unused variable
3746 `bed'.
3747
056bafd4
MR
37482017-06-06 Maciej W. Rozycki <macro@imgtec.com>
3749
3750 * elf-bfd.h (RELOC_AGAINST_DISCARDED_SECTION): Subtract `count'
3751 from `reloc_count' rather than decrementing it.
3752 * elf.c (bfd_section_from_shdr): Multiply the adjustment to
3753 `reloc_count' by `int_rels_per_ext_rel'.
3754 * elf32-score.c (score_elf_final_link_relocate): Do not multiply
3755 `reloc_count' by `int_rels_per_ext_rel' for last relocation
3756 entry determination.
3757 (s3_bfd_score_elf_check_relocs): Likewise.
3758 * elf32-score7.c (score_elf_final_link_relocate): Likewise.
3759 (s7_bfd_score_elf_relocate_section): Likewise.
3760 (s7_bfd_score_elf_check_relocs): Likewise.
3761 * elf64-mips.c (mips_elf64_get_reloc_upper_bound): Remove
3762 prototype and function.
3763 (mips_elf64_slurp_one_reloc_table): Do not update `reloc_count'.
3764 (mips_elf64_slurp_reloc_table): Assert that `reloc_count' is
3765 triple rather than once the sum of REL and RELA relocation entry
3766 counts.
3767 (bfd_elf64_get_reloc_upper_bound): Remove macro.
3768 * elflink.c (_bfd_elf_link_read_relocs): Do not multiply
3769 `reloc_count' by `int_rels_per_ext_rel' for internal relocation
3770 storage allocation size determination.
3771 (elf_link_input_bfd): Multiply `.ctors' and `.dtors' section's
3772 size by `int_rels_per_ext_rel'. Do not multiply `reloc_count'
3773 by `int_rels_per_ext_rel' for last relocation entry
3774 determination.
3775 (bfd_elf_final_link): Do not multiply `reloc_count' by
3776 `int_rels_per_ext_rel' for internal relocation storage
3777 allocation size determination.
3778 (init_reloc_cookie_rels): Do not multiply `reloc_count' by
3779 `int_rels_per_ext_rel' for last relocation entry determination.
3780 (elf_gc_smash_unused_vtentry_relocs): Likewise.
3781 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
3782 (_bfd_mips_elf_relocate_section): Likewise.
3783
af54f0eb
AM
37842017-06-05 Alan Modra <amodra@gmail.com>
3785
3786 PR 21529
3787 * linker.c (_bfd_generic_link_output_symbols): Handle BSF_GNU_UNIQUE.
3788
6cf3bf88 37892017-06-01 John Baldwin <jhb@FreeBSD.org>
b5430a3c
JB
3790
3791 * elf.c (elfcore_grok_freebsd_psinfo): Use ELF header class to
3792 determine structure sizes.
3793 (elfcore_grok_freebsd_prstatus): Likewise.
3794
f378ab09
AM
37952017-06-01 Alan Modra <amodra@gmail.com>
3796
3797 * elf64-ppc.c (struct ppc_link_hash_table): Add has_plt_localentry0.
3798 (ppc64_elf_merge_symbol_attribute): Merge localentry bits from
3799 dynamic objects.
3800 (is_elfv2_localentry0): New function.
3801 (ppc64_elf_tls_setup): Default params->plt_localentry0.
3802 (plt_stub_size): Adjust size for tls_get_addr_opt stub.
3803 (build_tls_get_addr_stub): Use a simpler stub when r2 is not saved.
3804 (ppc64_elf_size_stubs): Leave stub_type as ppc_stub_plt_call for
3805 optimized localentry:0 stubs.
3806 (ppc64_elf_build_stubs): Save r2 in ELFv2 __glink_PLTresolve.
3807 (ppc64_elf_relocate_section): Leave nop unchanged for optimized
3808 localentry:0 stubs.
3809 (ppc64_elf_finish_dynamic_sections): Set PPC64_OPT_LOCALENTRY in
3810 DT_PPC64_OPT.
3811 * elf64-ppc.h (struct ppc64_elf_params): Add plt_localentry0.
3812
8c65b54f
CS
38132017-05-30 Casey Smith <clegg89@gmail.com>
3814
3815 PR ld/21523
3816 * elf32-arm.c (elf32_arm_final_link_relocate): Install an absolute
3817 value when processing the R_ARM_THM_ALU_PREL_11_0 reloc.
3818
64984c22
AK
38192017-05-30 Anton Kolesov Anton.Kolesov@synopsys.com
3820
3821 * cpu-arc.c (arc_compatible): New function.
3822
37cd3877
AK
38232017-05-30 Anton Kolesov <anton.kolesov@synopsys.com>
3824
3825 * cpu-arc.c (arch_info_struct): Remove duplicate ARC600 entry.
3826
8e2f54bc
L
38272017-05-30 H.J. Lu <hongjiu.lu@intel.com>
3828
3829 PR binutils/21519
3830 * bfdio.c (bfd_get_file_size): New function.
3831 * bfd-in2.h: Regenerated.
3832
8e7f04f1 38332017-05-23 Dilian Palauzov <git-dpa@aegee.org>
3834
3835 * elf32-arc.c (arc_elf_merge_attributes): Add fall through
3836 comments.
3837
25f94347
L
38382017-05-22 H.J. Lu <hongjiu.lu@intel.com>
3839
3840 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Use
3841 dynobj instead of htab->elf.dynobj.
3842
e5713223
MR
38432017-05-19 Maciej W. Rozycki <macro@imgtec.com>
3844
3845 * elf64-mips.c (mips_elf64_canonicalize_reloc): Remove prototype
3846 and function.
3847 (mips_elf64_canonicalize_dynamic_reloc): Likewise.
3848 (mips_elf64_slurp_one_reloc_table): Set `reloc_count' to the
3849 actual number of internal relocations retrieved. Adjust
3850 function description.
3851 (bfd_elf64_canonicalize_reloc): Remove macro.
3852 (bfd_elf64_canonicalize_dynamic_reloc): Likewise.
3853
64517994
JM
38542017-05-19 Jose E. Marchesi <jose.marchesi@oracle.com>
3855
3856 * archures.c (bfd_mach_sparc_v9m8): Define.
3857 (bfd_mach_sparc_v8plusm8): Likewise.
3858 (bfd_mach_sparc_v9_p): Adjust to M8.
3859 (bfd_mach_sparc_64bit_p): Likewise.
3860 * aoutx.h (machine_type): Handle bfd_mach_sparc_v9m8 and
3861 bfd_mach_sparc_v8plusm8.
3862 * bfd-in2.h: Regenerated.
3863 * cpu-sparc.c (arch_info_struct): Entries for sparc:v9m8 and
3864 sparc:v8plusm8.
3865 * elfxx-sparc.c (_bfd_sparc_elf_object_p): Handle
3866 bfd_mach_sparc_v8plusm8 and bfd_mach_sparc_v9m8 using the new hw
3867 capabilities ONADDSUB, ONMUL, ONDIV, DICTUNP, FPCPSHL, RLE and
3868 SHA3.
3869 * elf32-sparc.c (elf32_sparc_final_write_processing): Handle
3870 bfd_mach_sparc_v8plusm8.
3871
eb026f09
AM
38722017-05-19 Alan Modra <amodra@gmail.com>
3873
3874 * elflink.c (_bfd_elf_gc_mark_extra_sections): Don't keep
3875 debug and special sections when no non-note alloc sections in an
3876 object are kept.
3877
535b785f
AM
38782017-05-18 Alan Modra <amodra@gmail.com>
3879
3880 * arc-got.h: Don't compare boolean values against TRUE or FALSE.
3881 * elf-m10300.c: Likewise.
3882 * elf.c: Likewise.
3883 * elf32-arc.c: Likewise.
3884 * elf32-bfin.c: Likewise.
3885 * elf32-m68k.c: Likewise.
3886 * elf32-nds32.c: Likewise.
3887 * elf32-tilepro.c: Likewise.
3888 * elflink.c: Likewise.
3889 * elfnn-aarch64.c: Likewise.
3890 * elfnn-riscv.c: Likewise.
3891 * elfxx-tilegx.c: Likewise.
3892 * mach-o.c: Likewise.
3893 * peXXigen.c: Likewise.
3894 * vms-alpha.c: Likewise.
3895 * vms-lib.c: Likewise.
3896
b7c871ed
L
38972017-05-17 H.J. Lu <hongjiu.lu@intel.com>
3898
3899 PR ld/20882
3900 * elflink.c (elf_gc_mark_debug_section): New function.
3901 (_bfd_elf_gc_mark_extra_sections): Mark any debug sections
3902 referenced by kept debug sections.
3903
bc4e12de
AM
39042017-05-16 Alan Modra <amodra@gmail.com>
3905
3906 * elf-m10300.c: Rename occurrences of non_ir_ref.
3907 * elf32-arm.c: Likewise.
3908 * elf32-bfin.c: Likewise.
3909 * elf32-cr16.c: Likewise.
3910 * elf32-cris.c: Likewise.
3911 * elf32-d10v.c: Likewise.
3912 * elf32-dlx.c: Likewise.
3913 * elf32-fr30.c: Likewise.
3914 * elf32-frv.c: Likewise.
3915 * elf32-hppa.c: Likewise.
3916 * elf32-i370.c: Likewise.
3917 * elf32-i386.c: Likewise.
3918 * elf32-iq2000.c: Likewise.
3919 * elf32-lm32.c: Likewise.
3920 * elf32-m32c.c: Likewise.
3921 * elf32-m32r.c: Likewise.
3922 * elf32-m68hc1x.c: Likewise.
3923 * elf32-m68k.c: Likewise.
3924 * elf32-mcore.c: Likewise.
3925 * elf32-metag.c: Likewise.
3926 * elf32-microblaze.c: Likewise.
3927 * elf32-moxie.c: Likewise.
3928 * elf32-msp430.c: Likewise.
3929 * elf32-mt.c: Likewise.
3930 * elf32-nios2.c: Likewise.
3931 * elf32-or1k.c: Likewise.
3932 * elf32-ppc.c: Likewise.
3933 * elf32-rl78.c: Likewise.
3934 * elf32-s390.c: Likewise.
3935 * elf32-score.c: Likewise.
3936 * elf32-score7.c: Likewise.
3937 * elf32-sh.c: Likewise.
3938 * elf32-tic6x.c: Likewise.
3939 * elf32-tilepro.c: Likewise.
3940 * elf32-v850.c: Likewise.
3941 * elf32-vax.c: Likewise.
3942 * elf32-xstormy16.c: Likewise.
3943 * elf32-xtensa.c: Likewise.
3944 * elf64-alpha.c: Likewise.
3945 * elf64-hppa.c: Likewise.
3946 * elf64-ia64-vms.c: Likewise.
3947 * elf64-mmix.c: Likewise.
3948 * elf64-ppc.c: Likewise.
3949 * elf64-s390.c: Likewise.
3950 * elf64-sh64.c: Likewise.
3951 * elf64-x86-64.c: Likewise.
3952 * elflink.c: Likewise.
3953 * elfnn-aarch64.c: Likewise.
3954 * elfnn-ia64.c: Likewise.
3955 * elfnn-riscv.c: Likewise.
3956 * elfxx-mips.c: Likewise.
3957 * elfxx-sparc.c: Likewise.
3958 * elfxx-tilegx.c: Likewise.
3959 * linker.c: Likewise.
3960
4070765b
AM
39612017-05-16 Alan Modra <amodra@gmail.com>
3962
3963 * elf64-ppc.c (add_symbol_adjust): Transfer non_ir_ref_dynamic.
3964 * elflink.c (elf_link_add_object_symbols): Update to use
3965 non_ir_ref_dynamic.
3966 (elf_link_input_bfd): Test non_ir_ref_dynamic in addition to
3967 non_ir_ref.
3968 * linker.c (_bfd_generic_link_add_one_symbol): Likewise.
3969
25499ac7
MR
39702017-05-15 Maciej W. Rozycki <macro@imgtec.com>
3971
3972 * elfxx-mips.c (print_mips_ases): Handle MIPS16e2 ASE.
3973
73caa85d
L
39742017-05-12 H.J. Lu <hongjiu.lu@intel.com>
3975
3976 * elf32-i386.c (elf_i386_parse_gnu_properties): Merge
3977 GNU_PROPERTY_X86_ISA_1_USED and GNU_PROPERTY_X86_ISA_1_NEEDED
3978 properties.
3979 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
3980
f2c29a16
L
39812017-05-11 H.J. Lu <hongjiu.lu@intel.com>
3982
3983 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Rename plt_bnd
3984 to plt_second.
3985 (elf_x86_64_link_hash_table): Rename plt_bnd/plt_bnd_eh_frame
3986 to plt_second/plt_second_eh_frame.
3987 (elf_x86_64_link_hash_newfunc): Updated.
3988 (elf_x86_64_allocate_dynrelocs): Likewise.
3989 (elf_x86_64_size_dynamic_sections): Likewise.
3990 (elf_x86_64_relocate_section): Likewise.
3991 (elf_x86_64_finish_dynamic_symbol): Likewise.
3992 (elf_x86_64_finish_dynamic_sections): Likewise.
3993 (elf_x86_64_plt_type): Rename plt_bnd to plt_second.
3994 (elf_x86_64_get_synthetic_symtab): Updated. Also scan the
3995 .plt.sec section.
3996 (elf_backend_setup_gnu_properties): Updated. Create the
3997 .plt.sec section instead of the .plt.sec section.
3998
dc2be3d2
L
39992017-05-11 H.J. Lu <hongjiu.lu@intel.com>
4000
4001 * elf32-i386.c (elf_i386_allocate_dynrelocs): Partially revert
4002 commit 25070364b0ce33eed46aa5d78ebebbec6accec7e.
4003 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewse.
4004
db84b98a
JM
40052017-05-10 Jose E. Marchesi <jose.marchesi@oracle.com>
4006
4007 * elf64-sparc.c (elf64_sparc_set_reloc): New function.
4008 (bfd_elf64_set_reloc): Define.
4009 (elf64_sparc_write_relocs): Use `canon_reloc_count'.
4010
23186865
JM
40112017-05-10 Jose E. Marchesi <jose.marchesi@oracle.com>
4012
4013 * targets.c (BFD_JUMP_TABLE_RELOCS): Add NAME##_set_reloc.
4014 (struct bfd_target): New field _bfd_set_reloc.
4015 * bfd.c (bfd_set_reloc): Call backend _set_bfd.
4016 * reloc.c (_bfd_generic_set_reloc): New function.
4017 * coffcode.h (coff_set_reloc): Define to _bfd_generic_set_reloc.
4018 * nlm-target.h (nlm_set_reloc): Likewise.
4019 * coff-rs6000.c (_bfd_xcoff_set_reloc): Likewise.
4020 * aout-tic30.c (MY_set_reloc): Likewise.
4021 * aout-target.h (MY_set_reloc): Likewise.
4022 * elfxx-target.h (bfd_elfNN_set_reloc): Likewise.
4023 * coff-alpha.c (_bfd_ecoff_set_reloc): Likewise.
4024 * mach-o-target.c (bfd_mach_o_set_reloc): Likewise.
4025 * vms-alpha.c (alpha_vms_set_reloc): Likewise.
4026 * aout-adobe.c (aout_32_set_reloc): Likewise.
4027 * bout.c (b_out_set_reloc): Likewise.
4028 * coff-mips.c (_bfd_ecoff_set_reloc): Likewise.
4029 * i386os9k.c (aout_32_set_reloc): Likewise.
4030 * ieee.c (ieee_set_reloc): Likewise.
4031 * oasys.c (oasys_set_reloc): Likewise.
4032 * som.c (som_set_reloc): Likewise.
4033 * versados.c (versados_set_reloc): Likewise.
4034 * coff64-rs6000.c (rs6000_xcoff64_vec): Add
4035 _bfd_generic_set_reloc.
4036 (rs6000_xcoff64_aix_vec): LIkewise.
4037 * libbfd.c (_bfd_norelocs_set_reloc): New function.
4038 * libbfd-in.h: Prototype for _bfd_norelocs_set_reloc.
4039 * i386msdos.c (msdos_set_reloc): Define to
4040 _bfd_norelocs_set_reloc.
4041 * elfcode.h (elf_set_reloc): Define.
4042 * bfd-in2.h: Regenerated.
4043
aab82f4c
L
40442017-05-10 H.J. Lu <hongjiu.lu@intel.com>
4045
4046 PR ld/21481
4047 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Use .plt.bnd
4048 for IFUNC function address.
4049
53a346d8
CZ
40502017-05-10 Claudiu Zissulescu <claziss@synopsys.com>
4051
4052 * elf32-arc.c (FEATURE_LIST_NAME): Define.
4053 (CONFLICT_LIST): Likewise.
4054 (opcode/arc-attrs.h): Include.
4055 (arc_elf_print_private_bfd_data): Print OSABI v4 flag.
4056 (arc_extract_features): New file.
4057 (arc_stralloc): Likewise.
4058 (arc_elf_merge_attributes): Likewise.
4059 (arc_elf_merge_private_bfd_data): Use object attributes.
4060 (bfd_arc_get_mach_from_attributes): New function.
4061 (arc_elf_object_p): Use object attributes.
4062 (arc_elf_final_write_processing): Likewise.
4063 (elf32_arc_obj_attrs_arg_type): New function.
4064 (elf32_arc_obj_attrs_handle_unknown): Likewise.
4065 (elf32_arc_section_from_shdr): Likewise.
4066 (elf_backend_obj_attrs_vendor): Define.
4067 (elf_backend_obj_attrs_section): Likewise.
4068 (elf_backend_obj_attrs_arg_type): Likewise.
4069 (elf_backend_obj_attrs_section_type): Likewise.
4070 (elf_backend_obj_attrs_handle_unknown): Likewise.
4071 (elf_backend_section_from_shdr): Likewise.
4072
e645cf40
AG
40732017-05-09 Andrew Goedhart <Andrewgoedhart@simplepowersolutions.co.za>
4074
4075 PR ld/21458
4076 * elf32-arm.c (elf32_arm_final_link_relocate): Set the bottom bit
4077 of the value when resolving a R_ARM_THM_ALU_PREL_11_0 relocation
4078 and the destination is a Thumb symbol.
4079
dd9e66ee
L
40802017-05-08 H.J. Lu <hongjiu.lu@intel.com>
4081
4082 * elf32-i386.c (elf_i386_get_synthetic_symtab): Add missing
4083 initializer to silence GCC 4.2.
4084 * lf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
4085
38b12349
L
40862017-05-08 H.J. Lu <hongjiu.lu@intel.com>
4087
4088 * elf64-x86-64.c (PLT_ENTRY_SIZE): Renamed to ...
4089 (LAZY_PLT_ENTRY_SIZE): This.
4090 (NON_LAZY_PLT_ENTRY_SIZE): New.
4091 (elf_x86_64_plt0_entry): Renamed to ...
4092 (elf_x86_64_lazy_plt0_entry): This.
4093 (elf_x86_64_plt_entry): Renamed to ...
4094 (elf_x86_64_lazy_plt_entry): This.
4095 (elf_x86_64_bnd_plt0_entry): Renamed to ...
4096 (elf_x86_64_lazy_bnd_plt0_entry): This.
4097 (elf_x86_64_legacy_plt_entry): Removed.
4098 (elf_x86_64_bnd_plt_entry): Renamed to ...
4099 (elf_x86_64_lazy_bnd_plt_entry): This.
4100 (elf_x86_64_legacy_plt2_entry): Renamed to ...
4101 (elf_x86_64_non_lazy_plt_entry): This.
4102 (elf_x86_64_bnd_plt2_entry): Renamed to ...
4103 (elf_x86_64_non_lazy_bnd_plt_entry): This.
4104 (elf_x86_64_eh_frame_plt): Renamed to ...
4105 (elf_x86_64_eh_frame_lazy_plt): This.
4106 (elf_x86_64_eh_frame_bnd_plt): Renamed to ...
4107 (elf_x86_64_eh_frame_lazy_bnd_plt): This.
4108 (elf_x86_64_eh_frame_plt_got): Renamed to ...
4109 (elf_x86_64_eh_frame_non_lazy_plt): This.
4110 (elf_x86_64_lazy_plt_layout): New.
4111 (elf_x86_64_non_lazy_plt_layout): Likewise.
4112 (elf_x86_64_plt_layout): Likewise.
4113 (elf_x86_64_backend_data): Remove PLT layout information. Add
4114 os for target system.
4115 (GET_PLT_ENTRY_SIZE): Removed.
4116 (elf_x86_64_lazy_plt): New.
4117 (elf_x86_64_non_lazy_plt): Likewise.
4118 (elf_x86_64_lazy_bnd_plt): Likewise.
4119 (elf_x86_64_non_lazy_bnd_plt): Likewise.
4120 (elf_x86-64_arch_bed): Updated.
4121 (elf_x86_64_link_hash_table): Add plt, lazy_plt and non_lazy_plt.
4122 (elf_x86_64_create_dynamic_sections): Removed.
4123 (elf_x86_64_check_relocs): Don't check elf.dynobj. Don't call
4124 _bfd_elf_create_ifunc_sections nor _bfd_elf_create_got_section.
4125 (elf_x86-64_adjust_dynamic_symbol): Updated.
4126 (elf_x86_64_allocate_dynrelocs): Updated. Pass 0 as PLT header
4127 size to _bfd_elf_allocate_ifunc_dyn_relocs and don't allocate
4128 size for PLT0 if there is no PLT0. Get plt_entry_size from
4129 non_lazy_plt for non-lazy PLT entries.
4130 (elf_x86_64_size_dynamic_sections): Updated. Get plt_entry_size
4131 from non_lazy_plt for non-lazy PLT entries.
4132 (elf_x86-64_relocate_section): Updated. Properly get PLT index
4133 if there is no PLT0.
4134 (elf_x86_64_finish_dynamic_symbol): Updated. Fill the first slot
4135 in the PLT entry with generic PLT layout. Fill the non-lazy PLT
4136 entries with non-lazy PLT layout. Don't fill the second and third
4137 slots in the PLT entry if there is no PLT0.
4138 (elf_x86_64_finish_dynamic_sections): Updated. Don't fill PLT0
4139 if there is no PLT0. Set sh_entsize on the .plt.got section.
4140 (compare_relocs): New.
4141 (elf_x86_64_plt_type): Likewise.
4142 (elf_x86_64_plt): Likewise.
4143 (elf_x86_64_nacl_plt): New. Forward declaration.
4144 (elf_x86_64_get_plt_sym_val): Removed.
4145 (elf_x86_64_get_synthetic_symtab): Rewrite to check PLT sections
4146 against all dynamic relocations.
4147 (elf_x86_64_link_setup_gnu_properties): New function.
4148 (elf_backend_create_dynamic_sections): Updated.
4149 (elf_backend_setup_gnu_properties): New.
4150 (elf_x86_64_nacl_plt): New.
4151 (elf_x86_64_nacl_arch_bed): Updated.
4152
f604c2a2
L
41532017-05-08 H.J. Lu <hongjiu.lu@intel.com>
4154
4155 * elf32-i386.c (PLT_ENTRY_SIZE): Renamed to ...
4156 (LAZY_PLT_ENTRY_SIZE): This.
4157 (NON_LAZY_PLT_ENTRY_SIZE): New.
4158 (elf_i386_plt0_entry): Renamed to ...
4159 (elf_i386_lazy_plt0_entry): This.
4160 (elf_i386_plt_entry): Renamed to ...
4161 (elf_i386_lazy_plt_entry): This.
4162 (elf_i386_pic_plt0_entry): Renamed to ...
4163 (elf_i386_pic_lazy_plt0_entry): This.
4164 (elf_i386_pic_plt_entry): Renamed to ...
4165 (elf_i386_pic_lazy_plt_entry): This.
4166 (elf_i386_got_plt_entry): Renamed to ...
4167 (elf_i386_non_lazy_plt_entry): This.
4168 (elf_i386_pic_got_plt_entry): Renamed to ...
4169 (elf_i386_pic_non_lazy_plt_entry): This.
4170 (elf_i386_eh_frame_plt): Renamed to ...
4171 (elf_i386_eh_frame_lazy_plt): This.
4172 (elf_i386_eh_frame_plt_got): Renamed to ...
4173 (elf_i386_eh_frame_non_lazy_plt): This.
4174 (elf_i386_plt_layout): Renamed to ...
4175 (elf_i386_lazy_plt_layout): This. Remove eh_frame_plt_got and
4176 eh_frame_plt_got_size.
4177 (elf_i386_non_lazy_plt_layout): New.
4178 (elf_i386_plt_layout): Likewise.
4179 (elf_i386_non_lazy_plt): Likewise.
4180 (GET_PLT_ENTRY_SIZE): Removed.
4181 (elf_i386_plt): Renamed to ...
4182 (elf_i386_lazy_plt): This.
4183 (elf_i386_backend_data): Remove plt. Rename is_vxworks to os.
4184 (elf_i386_arch_bed): Updated.
4185 (elf_i386_link_hash_table): Add plt, lazy_plt and non_lazy_plt.
4186 (elf_i386_create_dynamic_sections): Removed.
4187 (elf_i386_check_relocs): Don't check elf.dynobj. Don't call
4188 _bfd_elf_create_ifunc_sections nor _bfd_elf_create_got_section.
4189 (elf_i386_adjust_dynamic_symbol): Updated.
4190 (elf_i386_allocate_dynrelocs): Updated. Pass 0 as PLT header
4191 size to _bfd_elf_allocate_ifunc_dyn_relocs and don't allocate
4192 size for PLT0 if there is no PLT0.
4193 (elf_i386_size_dynamic_sections): Updated. Check whether GOT
4194 output section is discarded only if GOT isn't empty.
4195 (elf_i386_relocate_section): Updated. Properly get PLT index
4196 if there is no PLT0.
4197 (elf_i386_finish_dynamic_symbol): Updated. Don't fill the
4198 second and third slots in the PLT entry if there is no PLT0.
4199 (elf_i386_finish_dynamic_sections): Updated. Don't fill PLT0
4200 if there is no PLT0. Set sh_entsize on the .plt.got section.
4201 (elf_i386_nacl_plt): Forward declaration.
4202 (elf_i386_get_plt_sym_val): Removed.
4203 (elf_i386_get_synthetic_symtab): Rewrite to check PLT sections
4204 against all dynamic relocations.
4205 (elf_i386_link_setup_gnu_properties): New function.
4206 (elf_backend_create_dynamic_sections): Updated.
4207 (elf_backend_setup_gnu_properties): New.
4208 (elf_i386_nacl_plt): Updated.
4209 (elf_i386_nacl_arch_bed): Likewise.
4210 (elf_i386_vxworks_arch_bed): Likewise.
4211
046734ff
TP
42122017-05-08 Thomas Preud'homme <thomas.preudhomme@arm.com>
4213
4214 * elflink.c (elf_output_implib): Remove executable flag from import
4215 library bfd.
4216 * elf32-arm.c (elf32_arm_filter_implib_symbols): Assert that the import
4217 library is a relocatable object file.
4218
b660e9eb
SKS
42192017-05-01 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
4220
4221 PR ld/21404
4222 * elf32-avr.c (avr_should_move_sym): New function.
4223 (avr_should_reduce_sym_size): Likewise.
4224 (avr_should_increase_sym_size): Likewise.
4225 (elf32_avr_relax_delete_bytes): Adjust symbol values
4226 and sizes by calling new functions.
4227
763a5fa4
PD
42282017-05-01 Palmer Dabbelt <palmer@dabbelt.com>
4229
4230 * config.bfd (riscv32-*): Enable rv64.
4231
73ec947d
AM
42322017-05-02 Alan Modra <amodra@gmail.com>
4233
4234 PR 21384
4235 * elflink.c (bfd_elf_link_mark_dynamic_symbol): Test h->non_elf
4236 rather than h->root.type == bfd_link_hash_new.
4237 (bfd_elf_record_link_assignment): Similarly, call
4238 bfd_elf_link_mark_dynamic_symbol when h->non_elf.
4239
a941291c
AM
42402017-04-29 Alan Modra <amodra@gmail.com>
4241
4242 PR 21432
4243 * reloc.c (reloc_offset_in_range): New function.
4244 (bfd_perform_relocation, bfd_install_relocation): Use it.
4245 (_bfd_final_link_relocate): Likewise.
4246
750eaa47
L
42472017-04-28 H.J. Lu <hongjiu.lu@intel.com>
4248
4249 * elf32-i386.c (elf_i386_allocate_dynrelocs): Check plt_got
4250 before using .plt.got.
4251 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise.
4252
5b66fac4
L
42532017-04-27 H.J. Lu <hongjiu.lu@intel.com>
4254
4255 * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Use "="
4256 instead of "+=" to update 0.
4257
de9a3c42
L
42582017-04-27 H.J. Lu <hongjiu.lu@intel.com>
4259
4260 * elf32-i386.c (elf_i386_create_dynamic_sections): Create the
4261 .plt.got section here.
4262 (elf_i386_check_relocs): Don't create the .plt.got section.
4263 * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Create
4264 the .plt.got and .plt.bnd sections here.
4265 (elf_x86_64_check_relocs): Don't create the .plt.got nor
4266 .plt.bnd sections.
4267
da3d25af
L
42682017-04-27 H.J. Lu <hongjiu.lu@intel.com>
4269
4270 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Remove
4271 has_bnd_reloc.
4272 (elf_x86_64_link_hash_newfunc): Don't clear has_bnd_reloc.
4273 (elf_x86_64_copy_indirect_symbol): Don't copy has_bnd_reloc.
4274 (elf_x86_64_check_relocs): Don't set has_bnd_reloc.
4275 (elf_x86_64_finish_dynamic_symbol): Check bndplt instead of
4276 has_bnd_reloc.
4277
fba37edd
L
42782017-04-27 H.J. Lu <hongjiu.lu@intel.com>
4279
4280 * elf-bfd.h (elf_backend_data): Change setup_gnu_properties
4281 to return bfd *.
4282 (_bfd_elf_link_setup_gnu_properties): Return bfd *.
4283 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Return
4284 the first relocatable ELF input with GNU properties.
4285
1f78f649
L
42862017-04-27 H.J. Lu <hongjiu.lu@intel.com>
4287
4288 * elf32-i386.c (elf_i386_finish_dynamic_sections): Simplify
4289 VxWorks for non-PIC.
4290
76c20d54
AM
42912017-04-27 Alan Modra <amodra@gmail.com>
4292
4293 * elf-bfd.h (struct elf_backend_data): Make asection param of
4294 elf_backend_eh_frame_address_size const.
4295 (_bfd_elf_eh_frame_address_size): Likewise.
4296 * elf32-m32c.c (_bfd_m32c_elf_eh_frame_address_size): Likewise.
4297 * elf32-msp430.c (elf32_msp430_eh_frame_address_size): Likewise.
4298 * elfxx-mips.c (_bfd_mips_elf_eh_frame_address_size): Likewise.
4299 * elfxx-mips.h (_bfd_mips_elf_eh_frame_address_size): Likewise.
4300 * elf-eh-frame.c (_bfd_elf_eh_frame_address_size): Likewise.
4301 (next_cie_fde_offset): Constify params.
4302 (offset_adjust, adjust_eh_frame_local_symbols): Likewise.
4303
d7153c4a
AM
43042017-04-27 Alan Modra <amodra@gmail.com>
4305
4306 * elf-bfd.h (struct eh_cie_fde): Add aug_str_len and aug_data_len.
4307 (_bfd_elf_adjust_eh_frame_global_symbol): Declare.
4308 * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Set aug_str_len and
4309 aug_data_len.
4310 (offset_adjust): New function.
4311 (_bfd_elf_adjust_eh_frame_global_symbol): Likewise.
4312 (adjust_eh_frame_local_symbols): Likewise.
4313 (_bfd_elf_discard_section_eh_frame): Call adjust_eh_frame_local_symbols
4314 after changing anything. Return true if anything changed.
4315 * elflink.c (bfd_elf_discard_info): If .eh_frame changed, call
4316 _bfd_elf_adjust_eh_frame_global_symbol for globals.
4317
641338d8
AM
43182017-04-27 Alan Modra <amodra@gmail.com>
4319
4320 * elflink.c (_bfd_elf_link_hash_hide_symbol): Clear dynstr_index
4321 when force_local.
4322
21d68fcd
AM
43232017-04-27 Alan Modra <amodra@gmail.com>
4324
4325 * elf32-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
4326 (ppc_elf_select_plt_layout, ppc_elf_tls_setup): Use it.
4327 (ppc_elf_adjust_dynamic_symbol, allocate_dynrelocs): Likewise.
4328 (ppc_elf_relocate_section): Likewise. Delete silly optimisation
4329 for undef and undefweak dyn_relocs.
4330 * elf64-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
4331 (ppc64_elf_adjust_dynamic_symbol, ppc64_elf_tls_setup): Use it.
4332 (allocate_got, allocate_dynrelocs): Likewise.
4333 (ppc64_elf_relocate_section): Likewise.
4334
97d343d4
L
43352017-04-26 H.J. Lu <hongjiu.lu@intel.com>
4336
4337 * elf32-i386.c (elf_i386_size_dynamic_sections): Alwasys add
4338 DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rel.plt section.
4339 * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Alwasys
4340 add DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rela.plt section.
4341
04b31182
NC
43422017-04-26 Nick Clifton <nickc@redhat.com>
4343
4344 PR binutils/21434
4345 * reloc.c (bfd_perform_relocation): Check for a negative address
4346 in the reloc.
4347
23ec1e32
MR
43482017-04-26 Maciej W. Rozycki <macro@imgtec.com>
4349
4350 PR ld/21334
4351 * elf-bfd.h (elf_backend_data): Add `always_renumber_dynsyms'
4352 member.
4353 * elfxx-target.h [!elf_backend_always_renumber_dynsyms]
4354 (elf_backend_always_renumber_dynsyms): Define.
4355 (elfNN_bed): Initialize `always_renumber_dynsyms' member.
4356 * elfxx-mips.h (elf_backend_always_renumber_dynsyms): Define.
4357 * elflink.c (bfd_elf_size_dynamic_sections): Also call
4358 `_bfd_elf_link_renumber_dynsyms' if the backend has requested
4359 it.
4360 (bfd_elf_size_dynsym_hash_dynstr): Likewise.
4361
c46cec3a
MR
43622017-04-26 Maciej W. Rozycki <macro@imgtec.com>
4363
4364 * elflink.c (bfd_elf_size_dynamic_sections): Only call
4365 `_bfd_elf_link_renumber_dynsyms' after section GC if dynamic
4366 sections have been created.
4367
e63d1232
NC
43682017-04-26 Nick Clifton <nickc@redhat.com>
4369
4370 PR binutils/21431
4371 * compress.c (bfd_init_section_compress_status): Check the return
4372 value from bfd_malloc.
4373
9e9821dd
L
43742017-04-24 H.J. Lu <hongjiu.lu@intel.com>
4375
4376 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Add
4377 no_finish_dynamic_symbol.
4378 (elf_x86_64_link_hash_newfunc): Set no_finish_dynamic_symbol to
4379 0.
4380 (elf_x86_64_allocate_dynrelocs): If a symbol isn't undefined
4381 weak symbol, don't make it dynamic.
4382 (elf_x86_64_relocate_section): If a symbol isn't dynamic in PIC,
4383 set no_finish_dynamic_symbol and generate R_X86_64_RELATIVE
4384 relocation for GOT reference.
4385 (elf_x86_64_finish_dynamic_symbol): Abort if
4386 no_finish_dynamic_symbol isn't 0.
4387
0dc9a308
L
43882017-04-24 H.J. Lu <hongjiu.lu@intel.com>
4389
4390 PR ld/21402
4391 * elf32-i386.c (elf_i386_allocate_dynrelocs): If a symbol isn't
4392 undefined weak symbol, don't make it dynamic.
4393 (elf_i386_relocate_section): If a symbol isn't dynamic in PIC,
4394 set no_finish_dynamic_symbol and generate R_386_RELATIVE
4395 relocation for R_386_GOT32.
4396
1587442d
L
43972017-04-24 H.J. Lu <hongjiu.lu@intel.com>
4398
4399 PR ld/21425
4400 * elf32-i386.c (ELF_MAXPAGESIZE): Set to 0x1000 for VxWorks.
4401
7eacd66b
AM
44022017-04-23 Alan Modra <amodra@gmail.com>
4403
4404 PR 21414
4405 * section.c (GLOBAL_SYM_INIT): Make available in bfd.h.
4406 * elf.c (lcomm_sym): New.
4407 (_bfd_elf_large_com_section): Use lcomm_sym section symbol.
4408 * bfd-in2.h: Regenerate.
4409
bce964aa
AM
44102017-04-23 Alan Modra <amodra@gmail.com>
4411
4412 PR 21412
4413 * elf-bfd.h (struct elf_backend_data <get_reloc_section>): Change
4414 parameters and comment.
4415 (_bfd_elf_get_reloc_section): Delete.
4416 (_bfd_elf_plt_get_reloc_section): Declare.
4417 * elf.c (_bfd_elf_plt_get_reloc_section, elf_get_reloc_section):
4418 New functions. Don't blindly skip over assumed .rel/.rela prefix.
4419 Extracted from..
4420 (_bfd_elf_get_reloc_section): ..here. Delete.
4421 (assign_section_numbers): Call elf_get_reloc_section.
4422 * elf64-ppc.c (elf_backend_get_reloc_section): Define.
4423 * elfxx-target.h (elf_backend_get_reloc_section): Update.
4424
97e83a10
AM
44252017-04-23 Alan Modra <amodra@gmail.com>
4426
4427 PR 21409
4428 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Don't segfault when
4429 no symbols.
4430
e133d005
L
44312017-04-21 H.J. Lu <hongjiu.lu@intel.com>
4432
4433 PR ld/21402
4434 * elf32-i386.c (elf_i386_link_hash_entry): Add
4435 no_finish_dynamic_symbol.
4436 (elf_i386_link_hash_newfunc): Set no_finish_dynamic_symbol to 0.
4437 (elf_i386_allocate_dynrelocs): If a symbol isn't undefined weak
4438 symbol, don't make it dynamic in PIE.
4439 (elf_i386_relocate_section): If a symbol isn't dynamic in PIE,
4440 set no_finish_dynamic_symbol and generate R_386_RELATIVE
4441 relocation for R_386_GOT32
4442 (elf_i386_finish_dynamic_symbol): Abort if no_finish_dynamic_symbol
4443 isn't 0.
4444
3c5fce9b
L
44452017-04-21 H.J. Lu <hongjiu.lu@intel.com>
4446
4447 PR ld/19617
4448 PR ld/21086
4449 * elflink.c (elf_link_add_object_symbols): Require
4450 --no-dynamic-linker with -E/--dynamic-list when creating
4451 dynamic sections.
4452
0fad2956
MR
44532017-04-20 Maciej W. Rozycki <macro@imgtec.com>
4454
4455 * elflink.c (_bfd_elf_symbol_refs_local_p): Always return TRUE
4456 if forced local.
4457
64575f78
MR
44582017-04-20 Maciej W. Rozycki <macro@imgtec.com>
4459
4460 * elfxx-mips.c (_bfd_mips_elf_final_link): Reorder comment about
4461 dynamic symbol sorting.
4462
59fa66c5
L
44632017-04-20 H.J. Lu <hongjiu.lu@intel.com>
4464
4465 PR ld/21382
4466 * elflink.c (elf_link_add_object_symbols): Preserve
4467 dynamic_ref_after_ir_def when restoring the symbol table for
4468 unneeded dynamic object.
4469
e492d2f8
L
44702017-04-19 H.J. Lu <hongjiu.lu@intel.com>
4471
4472 PR ld/21401
4473 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Don't abort
4474 on on undefined IFUNC symbol in the second PLT.
4475
10169134
WAF
44762017-04-19 Wedson Almeida Filho <wedsonaf@gmail.com>
4477
4478 * peXXigen.c (pe_print_reloc): Correct chunk_end.
4479
954b63d4
AM
44802017-04-19 Alan Modra <amodra@gmail.com>
4481
4482 * elflink.c (_bfd_elf_adjust_dynamic_symbol): Hide undefweak
4483 or make dynamic for info->dynamic_undefined_weak 0 and 1.
4484 * elf32-ppc.c:Formatting.
4485 (ensure_undefweak_dynamic): Don't make dynamic when
4486 info->dynamic_undefined_weak is zero.
4487 (allocate_dynrelocs): Discard undefweak dyn_relocs for
4488 info->dynamic_undefined_weak. Discard undef dyn_relocs when
4489 not default visibility. Discard undef and undefweak
4490 dyn_relocs earlier.
4491 (ppc_elf_relocate_section): Adjust to suit.
4492 * elf64-ppc.c: Formatting.
4493 (ensure_undefweak_dynamic): Don't make dynamic when
4494 info->dynamic_undefined_weak is zero.
4495 (allocate_dynrelocs): Discard undefweak dyn_relocs for
4496 info->dynamic_undefined_weak. Discard them earlier.
4497
e6699019
L
44982017-04-17 H.J. Lu <hongjiu.lu@intel.com>
4499
4500 PR ld/21389
4501 * elflink.c (bfd_elf_size_dynamic_sections): Get soname index
4502 before generating the version definition section.
4503
c5d37467
AM
45042017-04-17 Alan Modra <amodra@gmail.com>
4505
4506 * elflink.c (_bfd_elf_merge_symbol): Undo dynamic linking
4507 state when a regular object file defines a symbol with
4508 incompatible type to that defined by an earlier shared lib.
4509
63a5468a
AM
45102017-04-13 Alan Modra <amodra@gmail.com>
4511
4512 * coffcode.h: Wrap some overly long _bfd_error_handler args.
4513 * elf.c: Likewise.
4514 * elf32-arm.c: Likewise.
4515 * elf32-i386.c: Likewise.
4516 * elf32-mep.c: Likewise.
4517 * elf64-ia64-vms.c: Likewise.
4518 * elf64-x86-64.c: Likewise.
4519 * elflink.c: Likewise.
4520 * elfnn-ia64.c: Likewise.
4521 * elfxx-mips.c: Likewise.
4522
dae82561
AM
45232017-04-13 Alan Modra <amodra@gmail.com>
4524
4525 * aoutx.h: Use %B and %A in error messages throughout file.
4526 * aout-cris.c: Likewise.
4527 * archive.c: Likewise.
4528 * binary.c: Likewise.
4529 * coff-rs6000.c: Likewise.
4530 * coff-tic4x.c: Likewise.
4531 * coffcode.h: Likewise.
4532 * coffgen.c: Likewise.
4533 * cofflink.c: Likewise.
4534 * coffswap.h: Likewise.
4535 * cpu-arm.c: Likewise.
4536 * elf-eh-frame.c: Likewise.
4537 * elf-m10300.c: Likewise.
4538 * elf.c: Likewise.
4539 * elf32-arc.c: Likewise.
4540 * elf32-arm.c: Likewise.
4541 * elf32-bfin.c: Likewise.
4542 * elf32-frv.c: Likewise.
4543 * elf32-iq2000.c: Likewise.
4544 * elf32-m32c.c: Likewise.
4545 * elf32-microblaze.c: Likewise.
4546 * elf32-nds32.c: Likewise.
4547 * elf32-rl78.c: Likewise.
4548 * elf32-rx.c: Likewise.
4549 * elf32-score.c: Likewise.
4550 * elf32-score7.c: Likewise.
4551 * elf32-sh64.c: Likewise.
4552 * elf32-v850.c: Likewise.
4553 * elf32-vax.c: Likewise.
4554 * elf32-visium.c: Likewise.
4555 * elf64-ia64-vms.c: Likewise.
4556 * elf64-mmix.c: Likewise.
4557 * elf64-sh64.c: Likewise.
4558 * elfcode.h: Likewise.
4559 * elfnn-aarch64.c: Likewise.
4560 * elfnn-ia64.c: Likewise.
4561 * elfxx-mips.c: Likewise.
4562 * hpux-core.c: Likewise.
4563 * ieee.c: Likewise.
4564 * ihex.c: Likewise.
4565 * linker.c: Likewise.
4566 * merge.c: Likewise.
4567 * mmo.c: Likewise.
4568 * oasys.c: Likewise.
4569 * pdp11.c: Likewise.
4570 * peXXigen.c: Likewise.
4571 * rs6000-core.c: Likewise.
4572 * vms-alpha.c: Likewise.
4573 * xcofflink.c: Likewise.
4574
c08bb8dd
AM
45752017-04-13 Alan Modra <amodra@gmail.com>
4576
4577 * bfd.c (PRINT_TYPE): Define.
4578 (_doprnt): New function.
4579 (error_handler_internal): Use _doprnt.
4580 * coff-arm.c: Put %A and %B arguments to _bfd_error_handler
4581 calls in their natural order, throughout file.
4582 * coff-mcore.c: Likewise.
4583 * coff-ppc.c: Likewise.
4584 * coff-tic80.c: Likewise.
4585 * cofflink.c: Likewise.
4586 * elf-s390-common.c: Likewise.
4587 * elf.c: Likewise.
4588 * elf32-arm.c: Likewise.
4589 * elf32-i386.c: Likewise.
4590 * elf32-m32r.c: Likewise.
4591 * elf32-msp430.c: Likewise.
4592 * elf32-spu.c: Likewise.
4593 * elf64-ia64-vms.c: Likewise.
4594 * elf64-sparc.c: Likewise.
4595 * elf64-x86-64.c: Likewise.
4596 * elflink.c: Likewise.
4597 * elfnn-aarch64.c: Likewise.
4598 * elfnn-ia64.c: Likewise.
4599 * elfxx-mips.c: Likewise.
4600
10463f39
AM
46012017-04-13 Alan Modra <amodra@gmail.com>
4602
4603 * elf32-arm.c (arm_type_of_stub): Supply missing args to "long
4604 branch veneers" error. Fix double space and format message.
4605 * elf32-avr.c (avr_add_stub): Do not pass NULL as %B arg.
4606 * elf64-ppc.c (tocsave_find): Supply missing %B arg.
4607
4af8774e
AM
46082017-04-13 Alan Modra <amodra@gmail.com>
4609
4610 * bfd-in2.h: Regenerate.
4611
e4097f5e
L
46122017-04-11 H.J. Lu <hongjiu.lu@intel.com>
4613
4614 * elf-properties.c (_bfd_elf_parse_gnu_properties): Remove the
4615 extra `\n' in warning/error messages.
4616 * elf32-i386.c (elf_i386_parse_gnu_properties): Likewise.
4617 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
4618
537616aa
L
46192017-04-11 H.J. Lu <hongjiu.lu@intel.com>
4620
4621 * elf-properties.c (_bfd_elf_parse_gnu_properties): Ignore
4622 processor-specific properties with generic ELF target vector.
4623
bb1dd176
QZ
46242017-04-10 Qing Zhao <qing.zhao@oracle.com>
4625
4626 * elf32-sparc.c (elf_backend_fixup_symbol): New.
4627 * elf64-sparc.c (elf_backend_fixup_symbol): New.
4628 * elfxx-sparc.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): New.
4629 (_bfd_sparc_elf_link_hash_entry): Add has_got_reloc and
4630 has_non_got_reloc.
4631 (link_hash_newfunc): Initialize has_got_reloc and
4632 has_non_got_reloc.
4633 (_bfd_sparc_elf_size_dynamic_sections): Set interp to .interp
4634 section.
4635 (_bfd_sparc_elf_copy_indirect_symbol): Copy has_got_reloc and
4636 has_non_got_reloc.
4637 (_bfd_sparc_elf_check_relocs): Set has_got_reloc and
4638 has_non_got_reloc.
4639 (_bfd_sparc_elf_fixup_symbol): New function.
4640 (allocate_dynrelocs): Don't allocate space for dynamic
4641 relocations and discard relocations against resolved undefined
4642 weak symbols in executable. Don't make resolved undefined weak
4643 symbols in executable dynamic. Keep dynamic non-GOT/non-PLT
4644 relocation against undefined weak symbols in PIE.
4645 (_bfd_sparc_elf_relocate_section): Don't generate dynamic
4646 relocations against resolved undefined weak symbols in PIE
4647 (_bfd_sparc_elf_finish_dynamic_symbol): Keep PLT/GOT entries
4648 without ynamic PLT/GOT relocations for resolved undefined weak
4649 symbols.
4650 Don't generate dynamic relocation against resolved undefined
4651 weak symbol in executable.
4652 (pie_finish_undefweak_symbol): New function.
4653 (_bfd_sparc_elf_finish_dynamic_sections): Call
4654 pie_finish_undefweak_symbol on all symbols in PIE.
4655 * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Add interp.
4656 (_bfd_sparc_elf_fixup_symbol): New function.
4657
d236cfd4
NC
46582017-04-10 Nick Clifton <nickc@redhat.com>
4659
4660 * config.bfd: Remove ns32k from obsolete list.
4661
6f9dbcd4
AM
46622017-04-10 Alan Modra <amodra@gmail.com>
4663
4664 PR 21287
4665 * elf.c (special_sections_f): Match .fini_array and .fini_array.*.
4666 (special_sections_i): Likewise for .init_array.
4667 (special_sections_p): Likewise for .preinit_array.
4668
8170f769
L
46692017-04-07 H.J. Lu <hongjiu.lu@intel.com>
4670
4671 PR ld/19579
4672 PR ld/21306
4673 * elf32-s390.c (elf_s390_finish_dynamic_symbol): Check
4674 ELF_COMMON_DEF_P for common symbols.
4675 * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
4676 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
4677 * elflink.c (_bfd_elf_merge_symbol): Revert commits
4678 202ac193bbbecc96a4978d1ac3d17148253f9b01 and
4679 07492f668d2173da7a2bda3707ff0985e0f460b6.
4680
49f4617b
PA
46812017-04-07 Pedro Alves <palves@redhat.com>
4682
4683 * opncls.c (bfd_get_debug_link_info): Rename to...
4684 (bfd_get_debug_link_info_1): ... this. Change type of second
4685 parameter to void pointer. Adjust.
4686 (bfd_get_debug_link_info): Reimplement on top of
4687 bfd_get_debug_link_info_1.
4688 (separate_debug_file_exists, separate_alt_debug_file_exists):
4689 Change type of second parameter to void pointer. Adjust.
4690 (get_func_type, check_func_type): Change type of second parameter
4691 to void pointer.
4692 (find_separate_debug_file): Add 'func_data' parameter. Pass it to
4693 the callback functions instead of passing the address of a local.
4694 (bfd_follow_gnu_debuglink): Pass address of unsigned long local to
4695 find_separate_debug_file.
4696 (get_alt_debug_link_info_shim): Change type of second parameter to
4697 void pointer. Adjust.
4698 (bfd_follow_gnu_debugaltlink): Adjust to pass NULL to
4699 find_separate_debug_file.
4700 (get_build_id_name, bfd_boolean check_build_id_file): Change type
4701 of second parameter to void pointer. Adjust.
4702 (bfd_follow_build_id_debuglink): Pass address of bfd_build_id
4703 pointer local to find_separate_debug_file.
4704
47052017-04-07 Tristan Gingold <gingold@gingold-Precision-7510>
1fd6d111
TG
4706
4707 * coffgen.c (_bfd_coff_gc_mark_hook): Handle PE weak
4708 external symbols with a definition.
4709 (_bfd_coff_gc_mark_extra_sections): Fix typo.
4710
86abf93a
AM
47112017-04-07 Alan Modra <amodra@gmail.com>
4712
4713 * po/SRC-POTFILES.in: Regenerate.
4714
8dea77f0
AM
47152017-04-05 Alan Modra <amodra@gmail.com>
4716
4717 * elf64-ppc.c (ppc64_elf_gc_sweep_hook): Support ELFv2 PLT
4718 reference counting.
4719
477bdd39
JT
47202017-04-02 Jon Turney <jon.turney@dronecode.org.uk>
4721
4722 (_bfd_XXi_swap_aouthdr_out): For clarity, use defines rather than
4723 numbers for DataDirectory entry indicies passed to
4724 add_data_entry().
4725
a91e1603
L
47262017-04-04 H.J. Lu <hongjiu.lu@intel.com>
4727
4728 * elf.c (get_program_header_size): Add a GNU_MBIND segment for
4729 each GNU_MBIND section and align GNU_MBIND section to page size.
4730 (_bfd_elf_map_sections_to_segments): Create a GNU_MBIND
4731 segment for each GNU_MBIND section.
4732 (_bfd_elf_init_private_section_data): Copy sh_info from input
4733 for GNU_MBIND section.
4734
b5292032
PD
47352017-04-03 Palmer Dabbelt <palmer@dabbelt.com>
4736
4737 * elfnn-riscv.c (GP_NAME): Delete.
4738 (riscv_global_pointer_value): Change GP_NAME to RISCV_GP_SYMBOL.
4739 (_bfd_riscv_relax_lui): Likewise.
4740
ad32986f
NC
47412017-04-04 Nick Clifton <nickc@redhat.com>
4742
4743 PR binutils/21342
4744 * elflink.c (_bfd_elf_define_linkage_sym): Prevent null pointer
4745 dereference.
4746 (bfd_elf_final_link): Only initialize the extended symbol index
4747 section if there are extended symbol tables to list.
4748
46bed679
L
47492017-04-03 H.J. Lu <hongjiu.lu@intel.com>
4750
4751 * Makefile.am (BFD32_BACKENDS): Add elf-properties.lo.
4752 (BFD32_BACKENDS_CFILES): Add elf-properties.c.
4753 * configure.ac (elf): Add elf-properties.lo.
4754 * Makefile.in: Regenerated.
4755 * configure: Likewise.
4756 * elf-bfd.h (elf_property_kind): New.
4757 (elf_property): Likewise.
4758 (elf_property_list): Likewise.
4759 (elf_properties): Likewise.
4760 (_bfd_elf_parse_gnu_properties): Likewise.
4761 (_bfd_elf_get_property): Likewise.
4762 (_bfd_elf_link_setup_gnu_properties): Likewise.
4763 (elf_backend_data): Add parse_gnu_properties, merge_gnu_properties
4764 and setup_gnu_properties.
4765 (elf_obj_tdata): Add properties.
4766 * elf-properties.c: New file.
4767 * elf32-i386.c (elf_i386_parse_gnu_properties): New.
4768 (elf_i386_merge_gnu_properties): Likewise.
4769 (elf_backend_parse_gnu_properties): Likewise.
4770 (elf_backend_merge_gnu_properties): Likewise.
4771 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
4772 (elf_x86_64_merge_gnu_properties): Likewise.
4773 (elf_backend_parse_gnu_properties): Likewise.
4774 (elf_backend_merge_gnu_properties): Likewise.
4775 * elfxx-target.h (elf_backend_merge_gnu_properties): Likewise.
4776 (elf_backend_parse_gnu_properties): Likewise.
4777 (elf_backend_setup_gnu_properties): Likewise.
4778 (elfNN_bed): Add elf_backend_parse_gnu_properties,
4779 elf_backend_merge_gnu_properties and
4780 elf_backend_setup_gnu_properties.
4781
f96bd6c2
PC
47822017-03-30 Pip Cet <pipcet@gmail.com>
4783
4784 * elf32-wasm32.c: Add relocation code, two relocs.
4785 * reloc.c: Add wasm32 relocations.
4786 * libbfd.h: Regenerate.
4787 * bfd-in2.h: Regenerate.
4788 * bfd/po/bfd.pot: Regenerate.
4789
e643cb45
NC
47902017-03-29 Nick Clifton <nickc@redhat.com>
4791
4792 PR binutils/18025
4793 * coff-bfd.h (struct coff_section_data): Add new fields:
4794 saved_bias and bias.
4795 * coffgen.c (coff_find_nearest_line_with_names): Cache the bias
4796 computed for PE binaries.
4797 * dwarf2.c (scan_unit_for_symbols): Only warn once about each
4798 missing abbrev.
4799
086554e8
HPN
48002017-03-28 Hans-Peter Nilsson <hp@axis.com>
4801
4802 PR ld/16044
4803 * elf32-cris.c (elf_cris_adjust_gotplt_to_got): Adjust BFD_ASSERT
4804 to handle a local symbol with a hash-symbol-entry; without PLT.
4805 Add BFD_ASSERT for an incidental case with GOT entry present.
4806 (cris_elf_check_relocs): Increment PLT refcount only if the symbol
4807 isn't forced-or-set local.
4808
a6be0538
PC
48092017-03-27 Pip Cet <pipcet@gmail.com>
4810
4811 * wasm-module.c: New file to support WebAssembly modules.
4812 * wasm-module.h: New file to support WebAssembly modules.
4813 * doc/webassembly.texi: Start documenting wasm-module.c.
4814 * config.bfd: Add wasm_vec.
4815 * targets.c: Likewise.
4816 * configure.ac: Likewise.
4817 * Makefile.am: Add entries for wasm-module.c.
4818 * Makefile.in: Regenerate.
4819 * configure: Regenerate.
4820 * po/SRC-POTFILES.in: Regenerate.
4821
79b1d3cb
PC
48222017-03-27 Pip Cet <pipcet@gmail.com>
4823
4824 * cpu-wasm32.c: New file to support wasm32 architecture.
4825 * elf32-wasm32.c: New file to support wasm32 architecture.
4826 * Makefile.am: Add wasm32 architecture.
4827 * archures.c: Likewise.
4828 * config.bfd: Likewise.
4829 * configure.ac: Likewise.
4830 * targets.c: Likewise.
4831 * Makefile.in: Regenerate.
4832 * bfd-in2.h: Regenerate.
4833 * configure: Regenerate.
4834 * po/SRC-POTFILES.in: Regenerate.
4835
aaed6f5b
AM
48362017-03-20 Alan Modra <amodra@gmail.com>
4837
4838 PR 21266
4839 * elf64-ppc.c (compare_symbols): Stabilize sort.
4840
82e66161
AM
48412017-03-18 Alan Modra <amodra@gmail.com>
4842
4843 * elf64-ppc.c (struct ppc_link_hash_table): Add
4844 local_ifunc_resolver and maybe_local_ifunc_resolver.
4845 (ppc_build_one_stub): Set flags on emitting dynamic
4846 relocation to ifunc.
4847 (ppc64_elf_relocate_section): Likewise.
4848 (ppc64_elf_finish_dynamic_symbol): Likewise.
4849 (ppc64_elf_finish_dynamic_sections): Error on DT_TEXTREL with
4850 local dynamic relocs to ifuncs.
4851 * elf32-ppc.c (struct ppc_elf_link_hash_table): Add
4852 local_ifunc_resolver and maybe_local_ifunc_resolver.
4853 (ppc_elf_relocate_section): Set flag on emitting dynamic
4854 relocation to ifuncs.
4855 (ppc_elf_finish_dynamic_symbol): Likewise.
4856 (ppc_elf_finish_dynamic_sections): Error on DT_TEXTREL with local
4857 dynamic relocs to ifuncs.
4858
f955cccf
NC
48592017-03-13 Nick Clifton <nickc@redhat.com>
4860
4861 PR binutils/21202
4862 * reloc.c (BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC): Rename to
4863 BFD_RELOC_AARCH64_TLSDESC_LD64_LO12.
4864 (BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC): Rename to
4865 BFD_RELOC_AARCH64_TLSDESC_ADD_LO12.
4866 * bfd-in2.h: Regenerate.
4867 * libbfd.h: Regenerate.
4868 * elfnn-aarch64.c (IS_AARCH64_TLS_RELAX_RELOC): Update reloc
4869 names.
4870 (IS_AARCH64_TLSDESC_RELOC): Likewise.
4871 (elfNN_aarch64_howto_table): Likewise.
4872 (aarch64_tls_transition_without_check): Likewise.
4873 (aarch64_reloc_got_type): Likewise.
4874 (elfNN_aarch64_final_link_relocate): Likewise.
4875 (elfNN_aarch64_tls_relax): Likewise.
4876 (elfNN_aarch64_relocate_section): Likewise.
4877 (elfNN_aarch64_gc_sweep_hook): Likewise.
4878 (elfNN_aarch64_check_relocs): Likewise.
4879 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
4880 (_bfd_aarch64_elf_resolve_relocation): Likewise.
4881
4aef7643
AM
48822017-03-11 Alan Modra <amodra@gmail.com>
4883
4884 * elf32-ppc.c: Remove ATTRIBUTE_UNUSED throughout when function
4885 parameter is in fact used. Whitespace fixes.
4886 * elf64-ppc.c: Likewise.
4887
f03265d9
ST
48882017-03-09 Sam Thursfield <sam.thursfield@codethink.co.uk>
4889
4890 * rs6000-core.c (CORE_NEW): Simplify macro when
4891 AIX_CORE_DUMPX_CORE and BFD64 are true to avoid compile warning.
4892
b1b07054
AM
48932017-03-07 Alan Modra <amodra@gmail.com>
4894
4895 PR 21224
4896 PR 20519
4897 * elf64-ppc.c (ppc64_elf_relocate_section): Add missing
4898 dyn_relocs check.
4899
2e0ce1c8
AM
49002017-03-05 Alan Modra <amodra@gmail.com>
4901
4902 * elf-bfd.h (struct eh_cie_fde): Add u.cie.per_encoding_aligned8.
4903 * elf-eh-frame.c (size_of_output_cie_fde): Don't align here.
4904 (next_cie_fde_offset): New function.
4905 (_bfd_elf_parse_eh_frame): Set u.cie.per_encoding_aligned8.
4906 (_bfd_elf_discard_section_eh_frame): Align zero terminator to
4907 four bytes. Align CIEs to four or eight bytes depending on
4908 per_encoding_aligned8. Align FDEs according to their encoding.
4909 Pad last FDE to output section alignment.
4910 (_bfd_elf_write_section_eh_frame): Adjust to suit. Remove
4911 assertion.
4912 * elf64-ppc.c (glink_eh_frame_cie): Delete padding.
4913 (ppc64_elf_size_stubs): Pad glink eh_frame as per elf-eh-frame.c.
4914 (ppc64_elf_finish_dynamic_sections): Adjust to suit.
4915
f98450c6
NC
49162017-03-02 Martin Bickel <binutils@ineranves.de>
4917
4918 PR ld/21212
4919 * elf.c (rewrite_elf_program_header): Do not issue a warning for
d20928fa 4920 empty segments which have a zero filesz, but a non-zero memsz.
f98450c6 4921
673cff9b
AM
49222017-03-02 Alan Modra <amodra@gmail.com>
4923
4924 * elf32-ppc.c (ppc_elf_vle_split16): Correct insn mask typo.
4925
3de43e7b
AM
49262017-02-28 Alan Modra <amodra@gmail.com>
4927
4928 * elf64-ppc.c (ppc64_elf_ha_reloc): Revert last change.
4929 (ppc64_elf_relocate_section): Likewise.
4930
4ef97a1b
AM
49312017-02-28 Alan Modra <amodra@gmail.com>
4932
4933 PR 20995
4934 * elf32-nios2.c (nios2_elf32_relocate_section): Use htab
4935 rather than elf32_nios2_hash_table or elf_hash_table.
4936 (create_got_section): Likewise.
4937 (nios2_elf32_finish_dynamic_symbol): Likewise.
4938 (nios2_elf32_adjust_dynamic_symbol): Likewise.
4939 (nios2_elf32_size_dynamic_sections): Likewise.
4940 (nios2_elf32_check_relocs): Delete dynobj, sgot, and srelgot
4941 vars. Use htab equivalents directly instead. Don't create
4942 all dynamic sections on needing just the GOT. Use a goto
4943 rather than a fall-through with reloc test. Ensure
4944 htab->dynobj is set when making dynamic sreloc section.
4945 (nios2_elf32_finish_dynamic_sections): Delete dynobj, use htab
4946 equivalent directly instead. Don't segfault on looking for
4947 .dynamic when dynamic sections have not been created. Don't
4948 segfault on .got.plt being discarded.
4949 (nios2_elf32_size_dynamic_sections): Delete plt and got vars.
4950 Don't set "relocs" on .rela.plt. Do handle .sbss. Delete
4951 fixme and another not so relevant comment.
4952 (nios2_elf_add_symbol_hook): Delete dynobj var. If not
4953 already set, set hash table dynobj on creating .sbss.
4954
7ba71655
AM
49552017-02-28 Alan Modra <amodra@gmail.com>
4956
4957 * reloc.c (BFD_RELOC_PPC_16DX_HA): New.
4958 * elf64-ppc.c (ppc64_elf_howto_raw <R_PPC64_16DX_HA>): New howto.
4959 (ppc64_elf_reloc_type_lookup): Translate new bfd reloc.
4960 (ppc64_elf_ha_reloc): Correct overflow test on REL16DX_HA.
4961 (ppc64_elf_relocate_section): Likewise.
4962 * elf32-ppc.c (ppc_elf_howto_raw <R_PPC_16DX_HA>): New howto.
4963 (ppc_elf_reloc_type_lookup): Translate new bfd reloc.
4964 (ppc_elf_check_relocs): Handle R_PPC_16DX_HA to pacify gcc.
4965 * libbfd.h: Regenerate.
4966 * bfd-in2.h: Regenerate.
4967
afbf7e8e
AM
49682017-02-28 Alan Modra <amodra@gmail.com>
4969
4970 * elflink.c (_bfd_elf_create_dynamic_sections): Don't make
4971 dynamic .data.rel.ro read-only.
4972 * elf32-arm.c (elf32_arm_finish_dynamic_symbol): Compare section
4973 rather than section flags when deciding where copy reloc goes.
4974 * elf32-cris.c (elf_cris_finish_dynamic_symbol): Likewise.
4975 * elf32-hppa.c (elf32_hppa_finish_dynamic_symbol): Likewise.
4976 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Likewise.
4977 * elf32-metag.c (elf_metag_finish_dynamic_symbol): Likewise.
4978 * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Likewise.
4979 * elf32-nios2.c (nios2_elf32_finish_dynamic_symbol): Likewise.
4980 * elf32-or1k.c (or1k_elf_finish_dynamic_symbol): Likewise.
4981 * elf32-ppc.c (ppc_elf_finish_dynamic_symbol): Likewise.
4982 * elf32-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
4983 * elf32-tic6x.c (elf32_tic6x_finish_dynamic_symbol): Likewise.
4984 * elf32-tilepro.c (tilepro_elf_finish_dynamic_symbol): Likewise.
4985 * elf64-ppc.c (ppc64_elf_finish_dynamic_symbol): Likewise.
4986 * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
4987 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
4988 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Likewise.
4989 * elfnn-riscv.c (riscv_elf_finish_dynamic_symbol): Likewise.
4990 * elfxx-mips.c (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise.
4991 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Likewise.
4992 * elfxx-tilegx.c (tilegx_elf_finish_dynamic_symbol): Likewise.
4993
0e392101
MR
49942017-02-28 Maciej W. Rozycki <macro@imgtec.com>
4995
4996 * elfxx-mips.c (mips_elf_perform_relocation): Also handle the
4997 `jalr $0, $25' instruction encoding.
4998
bd757ca7
NC
49992017-02-27 Nick Clifton <nickc@redhat.com>
5000
5001 PR ld/21180
5002 * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Avoid
5003 generating a seg-fault when encountering a symbol that has been
5004 deleted by garbage collection.
5005
034fed0b
AM
50062017-02-25 Alan Modra <amodra@gmail.com>
5007
5008 * elf32-arc.c (struct dynamic_sections): Delete.
5009 (enum dyn_section_types): Delete.
5010 (dyn_section_names): Delete.
5011 (arc_create_dynamic_sections): Delete.
5012 (elf_arc_finish_dynamic_sections): Don't call the above. Don't
5013 segfault on discarded .rela.plt section.
5014 (elf_arc_size_dynamic_sections): Formatting. Don't call
5015 arc_create_dynamic_sections. Don't allocate memory for sections
5016 handled by the generic linker. Correct code finding relocs in
5017 read-only sections. Set SEC_EXCLUDE on zero size .got,
5018 .got.plt, and .dynbss sections. Do set .interp for pies.
5019
d0f744f9
AW
50202017-02-24 Andrew Waterman <andrew@sifive.com>
5021
5022 * elfnn-riscv.c (GP_NAME): New macro.
5023 (riscv_global_pointer_value): Use it.
5024 (_bfd_riscv_relax_lui): If symbol and global pointer are in same
5025 output section, consider only that section's alignment.
5026
5d58c733
MR
50272017-02-23 Maciej W. Rozycki <macro@imgtec.com>
5028
5029 * elfxx-mips.h (_bfd_mips_relax_section): Remove prototype.
5030 * elfxx-mips.c (_bfd_mips_relax_section): Remove function.
5031 * elf64-mips.c (bfd_elf64_bfd_relax_section): Remove macro.
5032 * elfn32-mips.c (bfd_elf32_bfd_relax_section): Likewise.
5033
c1556ecd
MR
50342017-02-23 Maciej W. Rozycki <macro@imgtec.com>
5035
5036 * elfxx-mips.c (mips_elf_calculate_relocation) <R_MIPS_JALR>
5037 <R_MICROMIPS_JALR>: Discard relocation if `cross_mode_jump_p'
5038 or misaligned.
5039
5499c7c7
AM
50402017-02-23 Alan Modra <amodra@gmail.com>
5041
5042 PR 20744
5043 * elf32-ppc.c (ppc_elf_howto_raw): Correct dst_mask on all VLE
5044 16D relocations.
5045 (ppc_elf_vle_split16): Correct field mask and shift for 16D relocs.
5046 (ppc_elf_relocate_section): Correct calculation for VLE SDAREL
5047 relocs.
5048
902e9fc7
MR
50492017-02-22 Maciej W. Rozycki <macro@imgtec.com>
5050
5051 PR ld/20828
5052 * elflink.c (bfd_elf_size_dynamic_sections): Move symbol version
5053 processing ahead of the call to `elf_gc_sweep_symbol'.
5054
758d96d8
NC
50552017-02-22 Nick Clifton <nickc@redhat.com>
5056
5057 PR binutils/21193
5058 * opncls.c (bfd_create_gnu_debuglink_section): Give the newly
5059 created section 4-byte alignment.
5060
6528b6eb
AM
50612017-02-22 Alan Modra <amodra@gmail.com>
5062
5063 * elf64-ppc.c (ppc64_elf_finish_dynamic_sections): Don't segfault
5064 on .got or .plt output section being discarded by script.
5065 * elf32-ppc.c (ppc_elf_finish_dynamic_sections): Likewise. Move
5066 vxworks splt temp.
5067
24f1a751
AM
50682017-02-21 Alan Modra <amodra@gmail.com>
5069
5070 * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Only emit
5071 DT_RELA, DT_RELASZ, and DT_RELAENT when DT_RELASZ is non-zero.
5072
64487780
AM
50732017-02-20 Alan Modra <amodra@gmail.com>
5074
5075 PR 21181
5076 * elflink.c (bfd_elf_final_link): Make DT_REL/DT_RELA zero
5077 if DT_RELSZ/DT_RELASZ is zero.
5078
6438d1be
NC
50792017-02-17 Nick Clifton <nickc@redhat.com>
5080
5081 * compress.c (bfd_get_full_section_contents): Remember to reduce
5082 compressed size by the sizeof the compression header when
5083 decompressing the contents.
5084
4bc26c69
PA
50852017-02-17 Pedro Alves <palves@redhat.com>
5086
5087 * srec.c (Chunk): Rename to ...
5088 (_bfd_srec_len): ... this.
5089 (S3Forced): Rename to ...
5090 (_bfd_srec_forceS3): ... this.
5091 * objcopy.c: Adjust all references.
5092
7ec22e0f
PA
50932017-02-17 Pedro Alves <palves@redhat.com>
5094
5095 * archive.c (bsd_write_armap): Rename to ...
5096 (_bfd_bsd_write_armap): ... this.
5097 (coff_write_armap): Rename to ...
5098 (_bfd_coff_write_armap): ... this.
5099 * libbfd-in.h (bsd_write_armap): Rename to ...
5100 (_bfd_bsd_write_armap): ... this.
5101 (coff_write_armap): Rename to ...
5102 (_bfd_coff_write_armap): ... this.
5103 * aout-target.h, aout-tic30.c: Adjust all users.
5104 * libbfd.h: Regenerate.
5105
8c8402cc
PA
51062017-02-17 Pedro Alves <palves@redhat.com>
5107
5108 * bfd-in.h (bfd_read, bfd_write): Adjust to rename.
5109 (warn_deprecated): Rename to ...
5110 (_bfd_warn_deprecated): ... this.
5111 * libbfd.c (warn_deprecated): Rename to ...
5112 (_bfd_warn_deprecated): ... this.
5113 * bfd-in2.h: Regenerate.
5114
c7c3d11b
PA
51152017-02-17 Pedro Alves <palves@redhat.com>
5116
5117 * bfdio.c (real_ftell): Rename to ...
5118 (_bfd_real_ftell): ... this.
5119 (real_fseek): Rename to ...
5120 (_bfd_real_fseek): ... this.
5121 (real_fopen): Rename to ...
5122 (_bfd_real_fopen): ... this.
5123 * libbfd-in.h (real_ftell): Rename to ...
5124 (_bfd_real_ftell): ... this.
5125 (real_fseek): Rename to ...
5126 (_bfd_real_fseek): ... this.
5127 (real_fopen): Rename to ...
5128 (_bfd_real_fopen): ... this.
5129 * cache.c, dwarf2.c, opncls.c: Adjust all callers.
5130 * libbfd.h: Regenerate.
5131
4265548c
PA
51322017-02-17 Pedro Alves <palves@redhat.com>
5133
5134 * dwarf2.c, elf-attrs.c, elf32-nds32.c: Adjust all callers.
5135 * libbfd.c (read_unsigned_leb128): Rename to ...
5136 (_bfd_read_unsigned_leb128): ... this.
5137 (read_signed_leb128): Rename to ...
5138 (_bfd_read_signed_leb128): ... this.
5139 (safe_read_leb128): Rename to ...
5140 (_bfd_safe_read_leb128): ... this.
5141 * libbfd-in.h (read_unsigned_leb128): Rename to ...
5142 (_bfd_read_unsigned_leb128): ... this.
5143 (read_signed_leb128): Rename to ...
5144 (_bfd_read_signed_leb128): ... this.
5145 (safe_read_leb128): Rename to ...
5146 (_bfd_safe_read_leb128): ... this.
5147 * libbfd.h: Renegerate.
5148
3239a423
AB
51492017-02-16 Andrew Burgess <andrew.burgess@embecosm.com>
5150
5151 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Perform symbol lookup
5152 before trying to fine matching file and line information.
5153
90ed9b8b
AB
51542017-02-16 Andrew Burgess <andrew.burgess@embecosm.com>
5155
5156 * dwarf2.c (struct dwarf2_debug): Add orig_bfd member.
5157 (_bfd_dwarf2_slurp_debug_info): If stashed debug information does
5158 not match current bfd, then reload debug information. Record bfd
5159 we're loading debug info for in the stash. If we have debug
5160 informatin in the cache then perform section placement before
5161 returning.
5162
a8c75b76
AM
51632017-02-16 Alan Modra <amodra@gmail.com>
5164
5165 PR 21000
5166 * elf-bfd.h (struct elf_backend_data): Add no_page_alias.
5167 * elfxx-target.h (elf_backend_no_page_alias): Define.
5168 (elfNN_bed): Init new field.
5169 * elf.c (assign_file_positions_for_load_sections): If no_page_alias
5170 ensure PT_LOAD segment starts on a new page.
5171 * elf32-hppa.c (elf_backend_no_page_alias): Define.
5172
247d6c4c
AM
51732017-02-16 Alan Modra <amodra@gmail.com>
5174
5175 PR 21132
5176 * elf32-hppa.c (allocate_plt_static): Allocate space for relocs
5177 if pic.
5178
90571206
JW
51792017-02-16 Jiong Wang <jiong.wang@arm.com>
5180
5181 * bfd.c (BFD_FLAGS_SAVED): Add BFD_LINKER_CREATED.
5182 * bfd-in2.h: Regenerated.
5183
2a568401
L
51842017-02-15 H.J. Lu <hongjiu.lu@intel.com>
5185
5186 PR ld/21168
5187 * elf32-i386.c (elf_i386_relocate_section): Allow
5188 "lea foo@GOT, %reg" in PIC.
5189
a5def14f
L
51902017-02-15 H.J. Lu <hongjiu.lu@intel.com>
5191
5192 PR ld/20244
5193 * elf32-i386.c (elf_i386_relocate_section): Properly get IFUNC
5194 symbol name when reporting R_386_GOT32/R_386_GOT32X relocation
5195 error against local IFUNC symbol without a base register for
5196 PIC.
5197
174d0a74
MR
51982017-02-15 Maciej W. Rozycki <macro@imgtec.com>
5199
5200 * elf32-ppc.c (ppc_elf_check_relocs): Use `%H:' rather than
5201 `%P: %H:' with `info->callbacks->einfo'.
5202 (ppc_elf_relocate_section): Likewise.
5203 * elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
5204 (ppc64_elf_edit_toc): Likewise.
5205 (ppc64_elf_relocate_section): Likewise.
5206
e278ae05
AM
52072017-02-14 Alan Modra <amodra@gmail.com>
5208
5209 * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Support
5210 --gc-keep-exported, and test versioned field of sym rather than
5211 looking for @ in name.
5212
10ddfe62
PD
52132017-02-13 Palmer Dabbelt <palmer@dabbelt.com>
5214
5215 * elfnn-riscv.c (riscv_global_pointer_value): Change _gp to
5216 __global_pointer$.
5217
d11135f5
NC
52182017-02-13 Nick Clifton <nickc@redhat.com>
5219
5220 PR binutils/21151
5221 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Check for an invalid
5222 unit length field.
5223
cc162427
AW
52242017-02-07 Andrew Waterman <andrew@sifive.com>
5225
5226 * elfnn-riscv.c (riscv_elf_finish_dynamic_sections): Only write PLT
5227 entry size if PLT header is written.
5228
3d044c0c
SL
52292017-02-06 Sheldon Lobo <sheldon.lobo@oracle.com>
5230
5231 Fix sparc64 dynamic relocation processing to use the dynamic
5232 symbol count.
5233 * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Use 'dynamic'
5234 to determine if bfd_get_symcount() or bfd_get_dynamic_symcount()
5235 should be used.
5236
1b7e3d2f
NC
52372017-02-03 Nick Clifton <nickc@redhat.com>
5238
5239 PR 21096
5240 * coffcode.h (coff_write_object_contents): Enlarge size of
5241 s_name_buf in order to avoid compile time warning about possible
5242 integer truncation.
5243 * elf32-nds32.c (nds32_elf_ex9_import_table): Mask off lower
5244 32-bits of insn value before printing into buffer.
5245
e17b0c35
MR
52462017-02-02 Maciej W. Rozycki <macro@imgtec.com>
5247
5248 * elfxx-mips.c (mips_elf_hash_sort_data): Add
5249 `max_local_dynindx'.
5250 (mips_elf_sort_hash_table): Handle it.
5251 (mips_elf_sort_hash_table_f) <GGA_NONE>: For forced local
5252 symbols bump up `max_local_dynindx' rather than
5253 `max_non_got_dynindx'.
5254
55f8b9d2
MR
52552017-02-02 Maciej W. Rozycki <macro@imgtec.com>
5256
5257 * elfxx-mips.c (mips_elf_hash_sort_data): Convert the
5258 `min_got_dynindx', `max_unref_got_dynindx' and
5259 `max_non_got_dynindx' members to the `bfd_size_type' data type.
5260 (mips_elf_sort_hash_table): Adjust accordingly.
5261
0f8c4b60
MR
52622017-02-02 Maciej W. Rozycki <macro@imgtec.com>
5263
5264 * elfxx-mips.c (mips_elf_sort_hash_table): Use `htab' throughout
5265 to access the hash table.
5266
17a80fa8
MR
52672017-02-02 Maciej W. Rozycki <macro@imgtec.com>
5268
5269 * elfxx-mips.c (mips_elf_sort_hash_table): Move assertion on
5270 non-NULL `htab' to the beginning.
5271
8f56d4fd
MR
52722017-02-02 Maciej W. Rozycki <macro@imgtec.com>
5273
5274 * elflink.c (elf_gc_sweep): Wrap overlong line.
5275
8b10b0b3
MR
52762017-01-30 Maciej W. Rozycki <macro@imgtec.com>
5277
5278 * elfxx-mips.h (_bfd_mips_elf_insn32): Rename prototype to...
5279 (_bfd_mips_elf_linker_flags): ... this. Add another parameter.
5280 * elfxx-mips.c (mips_elf_link_hash_table): Add
5281 `ignore_branch_isa' member.
5282 (mips_elf_perform_relocation): Do not treat an ISA mode mismatch
5283 in branch relocation calculation as an error if
5284 `ignore_branch_isa' has been set.
5285 (_bfd_mips_elf_insn32): Rename to...
5286 (_bfd_mips_elf_linker_flags): ... this. Rename the `on'
5287 parameter to `insn32' and add an `ignore_branch_isa' parameter.
5288 Handle the new parameter.
5289
1fbd05e1
HPN
52902017-01-27 Hans-Peter Nilsson <hp@axis.com>
5291
22d9a0de
HPN
5292 * elf32-cris.c (elf_cris_finish_dynamic_symbol): Remove now unused
5293 local variable dynobj.
5294
1fbd05e1
HPN
5295 PR ld/20995
5296 * elf32-cris.c (elf_cris_size_dynamic_sections): Handle sdynrelro.
5297 (elf_cris_adjust_dynamic_symbol): Place variables copied into the
5298 executable from read-only sections into sdynrelro.
5299 (elf_cris_finish_dynamic_symbol): Select sreldynrelro for
5300 dynamic relocs in sdynrelro.
5301 (elf_backend_want_dynrelro): Define.
5302
4a7324e1
SH
53032017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
5304
5305 * config.bfd (*-*-rtemsaout*): Mark as removed.
5306
c75b4ebd
SH
53072017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
5308
5309 * config.bfd (powerpcle-*-rtems*): Do not mark as removed.
5310 (arm-*-rtems*): Move to (arm*-*-eabi*).
5311 (i[3-7]86-*-rtems*): Move to (i[3-7]86-*-elf*).
5312 (m68-*-rtems*): Move to (m68*-*-elf*).
5313
850d84f6
SH
53142017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
5315
5316 * config.bfd (*-*-rtemscoff*): Mark as removed.
5317
b531344c
MR
53182017-01-24 Maciej W. Rozycki <macro@imgtec.com>
5319
5320 PR ld/20828
5321 * elflink.c (bfd_elf_record_link_assignment): Revert last
5322 change and don't ever clear `forced_local'. Set `mark'
5323 unconditionally.
5324 (elf_gc_sweep_symbol_info, elf_gc_sweep_symbol): Reorder within
5325 file.
5326 (elf_gc_sweep): Move the call to `elf_gc_sweep_symbol'...
5327 (bfd_elf_size_dynamic_sections): ... here.
5328 * elf32-ppc.c (ppc_elf_tls_setup): Don't clear `forced_local'
5329 and set `mark' instead in `__tls_get_addr_opt' processing.
5330 * elf64-ppc.c (ppc64_elf_tls_setup): Likewise.
5331
f0158f44
AM
53322017-01-24 Alan Modra <amodra@gmail.com>
5333
5334 * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Merge two cases
5335 where dynamic relocs are preferable. Allow ifunc too.
5336 (ensure_undefweak_dynamic): New function.
5337 (allocate_dynrelocs): Use it here. Move plt handling last and
5338 don't make symbols dynamic, simplifying loop. Only make undef
5339 weak symbols with GOT entries dynamic. Correct condition
5340 for GOT relocs. Handle dynamic relocs on ifuncs. Correct
5341 comments. Remove goto.
5342 (ppc_elf_relocate_section): Correct test for using dynamic
5343 symbol on GOT relocs. Rearrange test for emitting GOT relocs
5344 to suit. Set up explicit tls_index entries and implicit GOT
5345 tls_index entries resolvable at link time for
5346 __tls_get_addr_opt. Simplify test to clear mem for prelink.
5347 * elf64-ppc.c (allocate_got): Correct condition for GOT relocs.
5348 (ensure_undefweak_dynamic): New function.
5349 (allocate_dynrelocs): Use it here. Only make undef weak symbols
5350 with GOT entries dynamic. Remove unnecessary test of
5351 WILL_CALL_FINISH_DYNAMIC_SYMBOL in PLT handling.
5352 (ppc64_elf_relocate_section): Correct test for using dynamic
5353 symbol on GOT relocs. Rearrange test for emitting GOT relocs
5354 to suit. Set up explicit tls_index entries and implicit GOT
5355 tls_index entries resolvable at link time for __tls_get_addr_opt.
5356 Simplify expression to clear mem for prelink.
5357
2d0ca824
YN
53582017-01-23 Yury Norov <ynorov@caviumnetworks.com>
5359
5360 * elfnn-aarch64.c: Fix relaxations for ILP32 mode.
5361
7f784814
JW
53622017-01-20 Jiong Wang <jiong.wang@arm.com>
5363
5364 * elfnn-aarch64.c (elf_aarch64_hash_symbol): New function.
5365 (elf_backend_hash_symbol): Define.
5366
81ff47b3
MR
53672017-01-18 Maciej W. Rozycki <macro@imgtec.com>
5368
5369 PR ld/20828
5370 * elflink.c (bfd_elf_record_link_assignment): Clear any
5371 `forced_local' marking for DSO symbols that are not being
5372 provided.
5373
640d6bfd
KLC
53742017-01-17 Kuan-Lin Chen <kuanlinchentw@gmail.com>
5375
5376 * elfnn-riscv.c (riscv_elf_object_p): New function.
5377
8361ed4d
L
53782017-01-12 H.J. Lu <hongjiu.lu@intel.com>
5379
5380 PR ld/21038
5381 * elf64-x86-64.c (elf_x86_64_link_hash_table): Add
5382 plt_bnd_eh_frame.
5383 (elf_x86_64_check_relocs): Create .eh_frame section for the
5384 .plt.bnd section.
5385 (elf_x86_64_size_dynamic_sections): Allocate and initialize
5386 .eh_frame section for the .plt.bnd section.
5387 (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
5388 for the .plt.bnd section.
5389
2425a30e
NC
53902017-01-12 Nick Clifton <nickc@redhat.com>
5391
5392 PR binutils/20876
5393 * opncls.c (find_separate_debug_file): Add include_dirs
5394 parameter. Only include the directory part of the bfd's filename
5395 in search paths if include_dirs is true. Add a couple of extra
5396 locations for looking for debug files.
5397 ( bfd_follow_gnu_debuglink): Update invocation of
5398 find_separate_debug_file.
5399 (bfd_follow_gnu_debugaltlink): Likewise.
5400 (get_build_id): New function: Finds the build-id of the given bfd.
5401 (get_build_id_name): New function: Computes the name of the
5402 separate debug info file for a bfd, based upon its build-id.
5403 (check_build_id_file): New function: Checks to see if a separate
5404 debug info file exists at the given location, and that its
5405 build-id matches that of the original bfd.
5406 (bfd_follow_build_id_debuglink): New function: Finds a separate
5407 debug info file for a given bfd by using the build-id method.
5408 * dwarf2.c (_bfd_dwarf2_slurp_debug_info): Try using the build-id
5409 method of locating a separate debug info file before using the
5410 debuglink method.
5411 * bfd-in2.h: Regenerate.
5412
9e659176
L
54132017-01-11 H.J. Lu <hongjiu.lu@intel.com>
5414
5415 PR ld/21038
5416 * elf64-x86-64.c (elf_x86_64_eh_frame_bnd_plt): New.
5417 (elf_x86_64_bnd_arch_bed): Use elf_x86_64_eh_frame_bnd_plt and
5418 elf_x86_64_eh_frame_plt_got.
5419 (elf_x86_64_size_dynamic_sections): Get unwind info from
5420 elf_x86_64_bnd_arch_bed for the BND PLT.
5421
f2e2d2f5
JS
54222017-01-11 Jeremy Soller <jackpot51@gmail.com>
5423
5424 * config.bfd: Add entries for i686-redox and x86_64-redox.
5425
52b232b3
L
54262017-01-10 H.J. Lu <hongjiu.lu@intel.com>
5427
5428 * elf32-i386.c (elf_i386_check_relocs): Align .eh_frame section
5429 to 4 bytes.
5430 * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Align
5431 .eh_frame section to 4 bytes for x32.
5432 (elf_x86_64_check_relocs): Likewise.
5433
fff53dae
L
54342017-01-10 H.J. Lu <hongjiu.lu@intel.com>
5435
5436 PR ld/20830
5437 * elf32-i386.c (elf_i386_eh_frame_plt_got): New.
5438 (PLT_GOT_FDE_LENGTH): Likewise.
5439 (elf_i386_plt_layout): Add eh_frame_plt_got and
5440 eh_frame_plt_got_size.
5441 (elf_i386_plt): Updated.
5442 (elf_i386_link_hash_table): Add plt_got_eh_frame.
5443 (elf_i386_check_relocs): Create .eh_frame section for .plt.got.
5444 (elf_i386_size_dynamic_sections): Allocate and initialize
5445 .eh_frame section for .plt.got.
5446 (elf_i386_finish_dynamic_sections): Adjust .eh_frame section for
5447 .plt.got.
5448 (elf_i386_nacl_plt): Add FIXME for eh_frame_plt_got and
5449 eh_frame_plt_got_size.
5450 * elf64-x86-64.c (elf_x86_64_eh_frame_plt_got): New.
5451 (PLT_GOT_FDE_LENGTH): Likewise.
5452 (elf_x86_64_backend_data): Add eh_frame_plt_got and
5453 eh_frame_plt_got_size.
5454 (elf_x86_64_arch_bed): Updated.
5455 (elf_x86_64_bnd_arch_bed): Add FIXME for eh_frame_plt_got and
5456 eh_frame_plt_got_size.
5457 (elf_x86_64_nacl_arch_bed): Likewise.
5458 (elf_x86_64_link_hash_table): Add plt_got_eh_frame.
5459 (elf_x86_64_check_relocs): Create .eh_frame section for .plt.got.
5460 (elf_x86_64_size_dynamic_sections): Allocate and initialize
5461 .eh_frame section for .plt.got.
5462 (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
5463 for .plt.got.
5464
f129e49f
L
54652017-01-10 H.J. Lu <hongjiu.lu@intel.com>
5466
5467 * elf32-i386.c (elf_i386_size_dynamic_sections): Set
5468 plt_eh_frame->size to eh_frame_plt_size and use eh_frame_plt.
5469
cd6581da
NC
54702017-01-09 Nick Clifton <nickc@redhat.com>
5471
5472 * dwarf2.c (lookup_address_in_function_table): Return early if
5473 there are no functions in the given comp unit, or if the high
5474 address of the last function in the comp unit is less than the
5475 desired address.
5476
98f02962
NC
54772017-01-09 Nick Clifton <nickc@redhat.com>
5478
5479 PR binutils/21013
5480 * coffgen.c (_bfd_coff_get_external_symbols): Generate an error
5481 message if there are too many symbols to load.
5482
ae4fda66
JC
54832017-01-04 James Clarke <jrtc27@jrtc27.com>
5484
5485 * elf64-alpha.c (elf64_alpha_relax_opt_call): Don't set tsec_free
5486 if relocs are cached.
5487
de1010f4
RF
54882017-01-03 Rich Felker <bugdal@aerifal.cx>
5489
5490 PR ld/21017
5491 * elf32-microblaze.c (microblaze_elf_check_relocs): Add an entry
5492 for R_MICROBLAZE_GOTOFF_64.
5493
09fe2662
NC
54942017-01-03 Nick Clifton <nickc@redhat.com>
5495
5496 * mach-o.c (bfd_mach_o_lookup_uuid_command): Fix compile time
5497 warning about using a possibly uninitialised variable.
5498
595e0a47
AM
54992017-01-02 Alan Modra <amodra@gmail.com>
5500
5501 * elf32-hppa.c (ensure_undef_weak_dynamic): New function.
5502 (allocate_plt_static, allocate_dynrelocs): Use it.
5503
7bd9df3b
AM
55042017-01-02 Alan Modra <amodra@gmail.com>
5505
5506 * elf-hppa.h (elf_hppa_fake_sections): Set SHF_INFO_LINK for
5507 .PARISC.unwind section.
5508
5b86074c
AM
55092017-01-02 Alan Modra <amodra@gmail.com>
5510
5511 PR ld/20989
5512 * elfxx-sparc.c (gdop_relative_offset_ok): New function.
5513 (_bfd_sparc_elf_relocate_section): Use it to validate GOT
5514 indirect to GOT pointer relative code edit.
5515
2571583a
AM
55162017-01-02 Alan Modra <amodra@gmail.com>
5517
5518 Update year range in copyright notice of all files.
5519
5c1ad6b5 5520For older changes see ChangeLog-2016
3499769a 5521\f
5c1ad6b5 5522Copyright (C) 2017 Free Software Foundation, Inc.
3499769a
AM
5523
5524Copying and distribution of this file, with or without modification,
5525are permitted in any medium without royalty provided the copyright
5526notice and this notice are preserved.
5527
5528Local Variables:
5529mode: change-log
5530left-margin: 8
5531fill-column: 74
5532version-control: never
5533End:
This page took 0.431534 seconds and 4 git commands to generate.