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