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