1 2017-12-06 Alan Modra <amodra@gmail.com>
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.
48 2017-12-06 Alan Modra <amodra@gmail.com>
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.
54 2017-12-04 Alan Modra <amodra@gmail.com>
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.
65 2017-12-01 H.J. Lu <hongjiu.lu@intel.com>
67 * elfxx-x86.c (_bfd_x86_elf_readonly_dynrelocs): Print symbol
70 2017-12-01 Alan Modra <amodra@gmail.com>
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.
122 2017-12-01 Alan Modra <amodra@gmail.com>
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.
143 2017-11-29 Nick Clifton <nickc@redhat.com>
146 * coffcode.h (coff_slurp_reloc_table): Check for a NULL symbol
147 pointer when processing relocs.
149 2017-11-29 Stefan Stroe <stroestefan@gmail.com>
151 * po/Make-in (datadir): Define as @datadir@.
152 (localedir): Define as @localedir@.
153 (gnulocaledir, gettextsrcdir): Use @datarootdir@.
155 2017-11-28 Nick Clifton <nickc@redhat.com>
158 * coffgen.c (_bfd_coff_read_string_table): Check for an excessive
159 size of the external string table.
161 2017-11-28 Nick Clifton <nickc@redhat.com>
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.
178 2017-11-28 H.J. Lu <hongjiu.lu@intel.com>
180 * elf-m10300.c (mn10300_elf_check_relocs): Don't set
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.
235 2017-11-28 Alan Modra <amodra@gmail.com>
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.
244 2017-11-28 Alan Modra <amodra@gmail.com>
246 * elf64-mmix.c (bfd_elf64_bfd_copy_link_hash_symbol_type): Define.
248 2017-11-28 H.J. Lu <hongjiu.lu@intel.com>
251 * elflink.c (_bfd_elf_merge_symbol): Also skip definition from
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.
257 2017-11-27 Szabolcs Nagy <szabolcs.nagy@arm.com>
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.
265 2017-11-27 Szabolcs Nagy <szabolcs.nagy@arm.com>
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.
272 2017-11-24 H.J. Lu <hongjiu.lu@intel.com>
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
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
284 (elf_read_notes): Add an argument for note aligment and pass it
287 2017-11-23 Alan Modra <amodra@gmail.com>
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
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.
306 2017-11-23 Alan Modra <amodra@gmail.com>
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.
314 2017-11-23 Alan Modra <amodra@gmail.com>
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
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.
377 2017-11-21 Alan Modra <amodra@gmail.com>
379 * elf-bfd.h (elf_symbol_from): Check for NULL symbol bfd.
380 * elfcode.h (elf_slurp_reloc_table_from_section): Add FIXME comment.
382 2017-11-20 Nick Clifton <nickc@redhat.com>
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.
389 2017-11-20 Alan Modra <amodra@gmail.com>
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.
399 2017-11-18 Jim Wilson <jimw@sifive.com>
401 * elfnn-riscv.c (_bfd_riscv_relax_align): Add space between alignment
402 and to in error message.
404 2017-11-17 H.J. Lu <hongjiu.lu@intel.com>
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.
409 2017-11-16 Nick Clifton <nickc@redhat.com>
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.
416 2017-11-16 Nick Clifton <nickc@redhat.com>
418 * merge.c (sec_merge_emit): Always create padding buffer. Add
419 asserts to make sure that the buffer is long enough.
421 2017-11-15 Alan Modra <amodra@gmail.com>
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.
428 2017-11-14 Alan Modra <amodra@gmail.com>
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
435 (ppc_size_one_stub, ppc64_elf_next_toc_section): Likewise.
437 2017-11-14 Alan Modra <amodra@gmail.com>
439 * elf64-ppc.c (ppc64_elf_size_stubs): Correct test for user
442 2017-11-13 Jan Beulich <jbeulich@suse.com>
444 * coff-tic80.c (COFF_ENCODE_ALIGNMENT, COFF_DECODE_ALIGNMENT):
446 * coffcode.h (coff_set_alignment_hook): Drop tic80 special case.
447 (coff_write_object_contents): Likewise. Issue diagnostic for too
450 2017-11-12 H.J. Lu <hongjiu.lu@intel.com>
453 * elf.c (_bfd_elf_map_sections_to_segments): Remove PF_X from
456 2017-11-12 Alan Modra <amodra@gmail.com>
458 * elflink.c (elf_link_add_object_symbols): Ignore anything but
459 defined and defweak symbols when setting up weakdefs.
461 2017-11-12 Alan Modra <amodra@gmail.com>
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.
484 2017-11-08 Djordje Todorovic <djordje.todorovic@rt-rk.com>
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.
490 2017-11-08 Djordje Todorovic <djordje.todorovic@rt-rk.com>
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.
499 2017-11-07 Alan Modra <amodra@gmail.com>
501 * elf64-ppc.c (ppc64_elf_build_stubs): Correct pluralization in
504 2017-11-07 Alan Modra <amodra@gmail.com>
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.
514 2017-11-05 Alan Modra <amodra@gmail.com>
517 * bfd.c (_bfd_doprnt_scan): Check args index before storing, not
520 2017-11-05 Alan Modra <amodra@gmail.com>
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.
532 2017-11-04 Alan Modra <amodra@gmail.com>
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.
542 2017-11-04 Alan Modra <amodra@gmail.com>
544 * elf32-ppc.c (readonly_dynrelocs): Delete info param. Update all
545 callers. Don't bother with SEC_ALLOC test. Return section pointer.
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.
551 2017-11-04 Alan Modra <amodra@gmail.com>
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.
564 2017-11-04 Alan Modra <amodra@gmail.com>
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.
576 2017-11-03 H.J. Lu <hongjiu.lu@intel.com>
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.
590 2017-11-03 Mingi Cho <mgcho.minic@gmail.com>
591 Nick Clifton <nickc@redhat.com>
594 * coffgen.c (_bfd_coff_get_external_symbols): Check for an
595 overlarge raw syment count.
596 (coff_get_normalized_symtab): Likewise.
598 2017-11-01 James Bowman <james.bowman@ftdichip.com>
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,
604 (ft32_elf_relocate_section): Add clauses for R_FT32_SC0, SC1,
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.
615 2017-11-01 Nick Clifton <nickc@redhat.com>
618 * coffcode.h (coff_slurp_line_table): Check for an excessively
619 large line number count.
621 2017-11-01 Nick Clifton <nickc@redhat.com>
624 * peicode.h (pe_bfd_read_buildid): Revise check for invalid size
625 and offset in light of further possible bogus values.
627 2017-11-01 Alan Modra <amodra@gmail.com>
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.
636 2017-11-01 Nick Clifton <nickc@redhat.com>
639 * coffgen.c (_bfd_coff_free_symbols): Fail if called on a non-COFF
641 * cofflink.c (coff_link_check_archive_element): Skip non-COFF
642 members of an archive.
644 2017-10-31 Nick Clifton <nickc@redhat.com>
647 * peicode.h (pe_bfd_read_buildid): Check for invalid size and data
650 2017-10-30 Alan Modra <amodra@gmail.com>
652 * elf32-frv.c (ELF_TARGET_ID): Don't define for generic
655 * elflink.c (elf_gc_sweep): Test elf_object_id in addition to
657 (bfd_elf_gc_sections): Likewise.
659 2017-10-30 Alan Modra <amodra@gmail.com>
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
670 (elf32_hppa_relocate_section): Similarly. Delete resolved_to_zero
672 (elf32_hppa_finish_dynamic_symbol): Use UNDEFWEAK_NO_DYNAMIC_RELOC
673 and SYMBOL_REFERENCES_LOCAL in GOT handling.
675 2017-10-28 Alan Modra <amodra@gmail.com>
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.
683 2017-10-25 Alan Modra <amodra@gmail.com>
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.
689 2017-10-24 Andrew Waterman <andrew@sifive.com>
691 * elfnn-riscv.c (_bfd_riscv_relax_lui): Don't relax to c.lui
694 2017-10-24 Renlin Li <renlin.li@arm.com>
697 * elflink.c (_bfd_elf_merge_symbol): Handle multiple definition case.
699 2017-10-23 Nick Clifton <nickc@redhat.com>
702 * elflink.c (elf_link_output_extsym): Keep global undefined
703 symbols if they have been marked as needed.
705 2017-10-23 Maciej W. Rozycki <macro@imgtec.com>
707 * elfn32-mips.c (mips_elf_n32_mkobject): New prototype and
709 (bfd_elf32_mkobject): Use `mips_elf_n32_mkobject' rather than
710 `_bfd_mips_elf_mkobject'.
712 2017-10-22 Hans-Peter Nilsson <hp@axis.com>
715 * config.bfd (cris-*-* | crisv32-*-*): Require a 64-bit BFD.
717 2017-10-19 Palmer Dabbelt <palmer@dabbelt.com>
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.
735 2017-10-19 Palmer Dabbelt <palmer@dabbelt.com>
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.
742 2017-10-19 H.J. Lu <hongjiu.lu@intel.com>
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.
752 2017-10-19 H.J. Lu <hongjiu.lu@intel.com>
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.
762 2017-10-19 H.J. Lu <hongjiu.lu@intel.com>
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.
772 2017-10-18 H.J. Lu <hongjiu.lu@intel.com>
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.
778 2017-10-17 H.J. Lu <hongjiu.lu@intel.com>
780 * elf32-microblaze.c (microblaze_elf_check_relocs): Check for
781 indirect and warning symbols.
783 2017-10-17 Alan Modra <amodra@gmail.com>
786 * elf-properties.c (_bfd_elf_parse_gnu_properties): Compare datasz
787 against size left rather than comparing pointers. Reorganise loop.
789 2017-10-17 Alan Modra <amodra@gmail.com>
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.
795 2017-10-16 H.J. Lu <hongjiu.lu@intel.com>
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
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.
877 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
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
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
916 (elf_x86_init_table): Remove normal_target and is_vxworks. Add
919 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
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
926 * elfxx-x86.h (_bfd_x86_elf_finish_dynamic_sections): New
929 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
932 * elf32-cris.c (elf_cris_discard_excess_program_dynamics): Don't
933 hide symbol which was forced to be dynamic.
935 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
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.
943 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
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.
951 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
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.
963 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
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.
971 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
974 * elf32-microblaze.c (microblaze_elf_relocate_section): Don't
975 generate dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is
977 (allocate_dynrelocs): Discard dynamic relocations if
978 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
980 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
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.
990 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
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.
1000 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
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.
1016 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
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.
1024 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
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.
1032 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
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.
1044 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
1047 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Don't
1048 generate dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is
1050 (elfNN_aarch64_allocate_dynrelocs): Discard dynamic relocations
1051 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
1053 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
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.
1059 2017-10-12 James Bowman <james.bowman@ftdichip.com>
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.
1066 2017-10-12 Nick Clifton <nickc@redhat.com>
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
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.
1079 2017-10-12 H.J. Lu <hongjiu.lu@intel.com>
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.
1086 2017-10-12 Alan Modra <amodra@gmail.com>
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.
1092 2017-10-12 Alan Modra <amodra@gmail.com>
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.
1099 2017-10-11 Maciej W. Rozycki <macro@imgtec.com>
1101 * elf-bfd.h (elf_backend_data): Add `linux_prpsinfo64_ugid16'
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.
1116 2017-10-11 Maciej W. Rozycki <macro@imgtec.com>
1118 * elf-bfd.h (elf_backend_data): Add `linux_prpsinfo32_ugid16'
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.
1146 2017-10-11 Maciej W. Rozycki <macro@imgtec.com>
1148 * elf-linux-core.h (elf_external_linux_prpsinfo64): Move the
1149 `gap' member ahead of `pr_flag'.
1151 2017-10-11 Pedro Alves <palves@redhat.com>
1153 * bfd.c (_doprnt): Rename to ...
1154 (_bfd_doprnt): ... this.
1155 (error_handler_internal): Adjust.
1157 2017-10-10 H.J. Lu <hongjiu.lu@intel.com>
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.
1163 2017-10-10 Renlin Li <renlin.li@arm.com>
1166 * elf32-arm.c (allocate_dynrelocs_for_symbol): Only make undefined weak
1167 symbols into dynamic.
1169 2017-10-09 H.J. Lu <hongjiu.lu@intel.com>
1172 * elfnn-riscv.c (riscv_elf_link_hash_table): Add max_alignment.
1173 (riscv_elf_link_hash_table_create): Initialize max_alignment to
1175 (_bfd_riscv_relax_section): Cache the max alignment of output
1176 sections if possible.
1178 2017-10-10 Alan Modra <amodra@gmail.com>
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
1187 (ppc64_elf_edit_opd): Don't set sec_type for .opd here.
1189 2017-10-09 H.J. Lu <hongjiu.lu@intel.com>
1191 * elf-m10300.c (mn10300_elf_check_relocs): Don't free cached
1194 2017-10-09 H.J. Lu <hongjiu.lu@intel.com>
1196 * elf32-bfin.c (bfin_size_dynamic_sections): Don't create the
1197 .interp section with "ld --no-dynamic-linker".
1199 2017-10-09 Alan Modra <amodra@gmail.com>
1202 * dwarf2.c (_bfd_dwarf2_cleanup_debug_info): Free
1203 funcinfo_hash_table and varinfo_hash_table.
1205 2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
1207 * elf32-sh.c (readonly_dynrelocs): Dump dynamic relocation
1208 in read-only section with minfo.
1209 (sh_elf_size_dynamic_sections): Likewise.
1211 2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
1213 * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections): Remove
1216 2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
1218 * elfxx-tilegx.c (tilegx_elf_finish_dynamic_sections): Set
1219 this_hdr.sh_entsize only if section size > 0.
1221 2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
1223 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Reformat.
1225 2017-10-07 H.J. Lu <hongjiu.lu@intel.com>
1227 * elfxx-sparc.c (readonly_dynrelocs): Dump dynamic relocation
1228 in read-only section with minfo.
1229 (_bfd_sparc_elf_size_dynamic_sections): Likewise.
1231 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
1233 * elfxx-x86.h (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Update
1236 2017-10-06 John Baldwin <jhb@FreeBSD.org>
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
1243 * elfn32-mips.c (elf_n32_mips_grok_freebsd_prstatus): New
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'.
1249 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
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.
1262 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
1264 * elfxx-x86.h (COPY_INPUT_RELOC_P): Add "do/while(0);".
1265 (VERIFY_COPY_RELOC): Likewise.
1267 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
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.
1273 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
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.
1279 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
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.
1285 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
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.
1293 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
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.
1300 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
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.
1306 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
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.
1312 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
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
1322 * elfxx-x86.h (NEED_DYNAMIC_RELOCATION_P): New.
1324 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
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.
1330 2017-10-05 H.J. Lu <hongjiu.lu@intel.com>
1332 * elf32-ppc.c (readonly_dynrelocs): Add a link_info argument.
1333 Dump dynamic relocation in read-only section with minfo if
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.
1340 2017-10-05 John Baldwin <jhb@FreeBSD.org>
1342 * elf.c (elfcore_grok_freebsd_note): Handle NT_ARM_VFP.
1344 2017-10-05 H.J. Lu <hongjiu.lu@intel.com>
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.
1352 2017-10-05 Pedro Alves <palves@redhat.com>
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.
1362 2017-10-05 Alan Modra <amodra@gmail.com>
1364 * elflink.c (elf_link_input_bfd): Correct ctor/dtor in init_array/
1365 fini_array error value.
1367 2017-10-05 Alan Modra <amodra@gmail.com>
1370 * elf.c (_bfd_elf_setup_sections): Don't trim reloc sections from
1372 (_bfd_elf_init_reloc_shdr): Pass sec_hdr, use it to copy SHF_GROUP
1374 (elf_fake_sections): Adjust calls. Exit immediately on failure.
1375 (bfd_elf_set_group_contents): Add associated reloc section indices
1378 2017-10-04 Alan Modra <amodra@gmail.com>
1380 * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Don't sort or
1381 classify symbols for ELFv2.
1383 2017-10-04 Pavel I. Kryukov <kryukov@frtk.ru>
1386 * bfd.c (bfd_set_error): Avoid UB on passing arg to va_start that
1387 undergoes default promotion.
1388 * bfd-in2.h: Regenerate.
1390 2017-10-02 Alan Modra <amodra@gmail.com>
1392 * elf32-ppc.c (ppc_elf_relocate_section): Fix comment typo.
1393 * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
1395 2017-10-01 Alan Modra <amodra@gmail.com>
1398 * dwarf2.c (new_line_sorts_after): Remove end_sequence comparison.
1399 (add_line_info): Always put end_sequence last.
1401 2017-10-01 Alan Modra <amodra@gmail.com>
1404 * dwarf2.c (read_section): Allocate buffer with extra byte for
1405 bfd_simple_get_relocated_section_contents rather than copying
1408 2017-09-29 Alan Modra <amodra@gmail.com>
1410 * merge.c (merge_strings): Return FALSE on malloc failure.
1411 (_bfd_merge_sections): Return failures from record_section and
1414 2017-09-28 Alan Modra <amodra@gmail.com>
1417 * elflink.c (_bfd_elf_merge_symbol): Set non_ir_ref_dynamic in
1418 a case where plugin_notice isn't called.
1420 2017-09-27 Kuan-Lin Chen <kuanlinchentw@gmail.com>
1422 * elf32-nds32.c (nds32_elf_relax_section): Fix a tautological
1425 2017-09-26 H.J. Lu <hongjiu.lu@intel.com>
1428 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Don't pass
1429 output_bfd to info->callbacks->minfo.
1431 2017-09-26 Nick Clifton <nickc@redhat.com>
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
1438 2017-09-26 Alan Modra <amodra@gmail.com>
1441 * dwarf2.c (read_formatted_entries): Use read_attribute_value to
1444 2017-09-26 Nick Clifton <nickc@redhat.com>
1447 * dwarf2.c (read_formatted_entries): Fail early if we know that
1448 the loop parsing data entries will overflow the end of the
1451 2017-09-26 Alan Modra <amodra@gmail.com>
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.
1460 2017-09-26 Alan Modra <amodra@gmail.com>
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.
1467 2017-09-26 Alan Modra <amodra@gmail.com>
1470 * dwarf2.c (decode_line_info): Ensure line_ptr stays within
1471 bounds in inner loop.
1473 2017-09-25 Alan Modra <amodra@gmail.com>
1476 * dwarf1.c (parse_die): Sanity check pointer against section limit
1477 before dereferencing.
1478 (parse_line_table): Likewise.
1480 2017-09-25 Alan Modra <amodra@gmail.com>
1483 * dwarf2.c (scan_unit_for_symbols): Ignore DW_AT_name unless it
1485 (parse_comp_unit): Likewise.
1487 2017-09-25 Alan Modra <amodra@gmail.com>
1490 * dwarf2.c (read_formatted_entries): Error on format_count zero.
1492 2017-09-24 Alan Modra <amodra@gmail.com>
1495 * opncls.c (bfd_get_debug_link_info_1): Properly check that crc is
1496 within section bounds.
1498 2017-09-24 Alan Modra <amodra@gmail.com>
1501 * dwarf2.c (decode_line_info): Properly free line sequences on error.
1503 2017-09-24 Alan Modra <amodra@gmail.com>
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.
1513 2017-09-24 Alan Modra <amodra@gmail.com>
1516 * dwarf2.c (decode_line_info): Fail on lh.line_range of zero
1517 rather than dividing by zero.
1519 2017-09-24 Alan Modra <amodra@gmail.com>
1522 * dwarf2.c (decode_line_info): Correct .debug_line unit_length check.
1524 2017-09-24 Alan Modra <amodra@gmail.com>
1527 * dwarf2.c (scan_unit_for_symbols): Check u.blk->data is non-NULL.
1529 2017-09-24 Alan Modra <amodra@gmail.com>
1532 * elf.c (_bfd_elf_slurp_version_tables): Test sh_info on
1533 SHT_GNU_verneed section for sanity. Don't zalloc memory for
1536 2017-09-22 H.J. Lu <hongjiu.lu@intel.com>
1539 * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Guard against
1542 2017-09-22 H.J. Lu <hongjiu.lu@intel.com>
1545 * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Also return
1546 -1 if bfd_canonicalize_dynamic_reloc returns 0.
1548 2017-09-22 Pedro Alves <palves@redhat.com>
1549 Alan Modra <amodra@gmail.com>
1551 * version.h: Add comment.
1553 2017-09-21 Andreas Arnez <arnez@linux.vnet.ibm.com>
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.
1559 2017-09-19 Alan Modra <amodra@gmail.com>
1562 * elf64-ppc.c (ppc64_elf_build_stubs): Don't check glink_eh_frame
1565 2017-09-19 Alan Modra <amodra@gmail.com>
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.
1573 2017-09-18 H.J. Lu <hongjiu.lu@intel.com>
1576 * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Check error
1577 return from bfd_canonicalize_dynamic_reloc.
1579 2017-09-15 Alan Modra <amodra@gmail.com>
1582 * archive.c (bfd_ar_hdr_from_filesystem): Detect when status.st_size
1583 overflows bfd_size_type.
1585 2017-09-14 H.J. Lu <hongjiu.lu@intel.com>
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.
1595 2017-09-14 Nick Clifton <nickc@redhat.com>
1598 * peXXigen.c (pe_print_idata): Extend check for HintName vector
1601 2017-09-13 H.J. Lu <hongjiu.lu@intel.com>
1603 * elfxx-x86.h: Fix a typo in comments.
1605 2017-09-09 Kamil Rytarowski <n54@gmx.com>
1607 * elf32-nds32.c: Rename __BIT() to N32_BIT().
1609 2017-09-09 Alan Modra <amodra@gmail.com>
1611 * elf64-ppp.c (plt_stub_pad): Handle positive and negative
1614 2017-09-09 H.J. Lu <hongjiu.lu@intel.com>
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.
1624 2017-09-09 H.J. Lu <hongjiu.lu@intel.com>
1626 * elfxx-x86.c (_bfd_x86_elf_link_symbol_references_local): Don't
1627 check has_non_got_reloc.
1629 2017-09-09 H.J. Lu <hongjiu.lu@intel.com>
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
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
1643 * elfxx-x86.h (elf_x86_link_hash_entry): Add linker_def.
1645 2017-09-08 H.J. Lu <hongjiu.lu@intel.com>
1647 * elfxx-x86.h: Update comments.
1649 2017-09-08 H.J. Lu <hongjiu.lu@intel.com>
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):
1655 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties):
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.
1662 2017-09-07 H.J. Lu <hongjiu.lu@intel.com>
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):
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
1676 * elfxx-x86.h (elf_x86_plt_layout_table): Add r_info and r_sym.
1678 2017-09-07 Palmer Dabbelt <palmer@dabbelt.com>
1680 * (_bfd_riscv_relax_align): Call bfd_set_error and
1681 print an error message when unable to relax a .align directive.
1683 2017-09-07 Palmer Dabbelt <palmer@dabbelt.com>
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.
1691 2017-09-07 H.J. Lu <hongjiu.lu@intel.com>
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
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
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.
1730 2017-09-06 H.J. Lu <hongjiu.lu@intel.com>
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.
1746 2017-09-06 H.J. Lu <hongjiu.lu@intel.com>
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.
1755 2017-09-05 H.J. Lu <hongjiu.lu@intel.com>
1757 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Properly set
1760 2017-09-05 H.J. Lu <hongjiu.lu@intel.com>
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
1769 * elfxx-x86.h (elf_x86_link_hash_entry): Add converted_reloc.
1771 2017-09-05 Alexander Fedotov <alexander.fedotov@nxp.com>
1772 Edmar Wienskoski <edmar.wienskoski@nxp.com
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.
1779 2017-09-03 H.J. Lu <hongjiu.lu@intel.com>
1782 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Set tlsdesc_plt
1783 for x86-64 if GOT_TLS_GDESC_P is true.
1785 2017-09-03 Alan Modra <amodra@gmail.com>
1788 * elfxx-x86.h (elf_x86_hash_table): Check is_elf_hash_table first.
1790 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1792 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
1793 tls_get_addr for x86-64 in one place.
1795 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1797 * configure.ac (bfd_backends): Add elf64-x86-64.lo together
1798 with elfxx-x86.lo for 64-bit BFD.
1799 * configure: Regenerated.
1801 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
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.
1830 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1832 * elfxx-x86.h (elf_x86_link_hash_table): Rearrange fields and
1835 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1837 * elf32-i386.c (elf_i386_size_dynamic_sections): Set
1838 sgotplt_jump_table_size with elf_x86_compute_jump_table_size.
1840 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
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.
1849 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
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.
1868 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
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
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
1881 * elfxx-x86.h (elf_x86_link_hash_table): Add target_id.
1884 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
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
1898 * elfxx-x86.h (elf_x86_link_hash_table): Add got_entry_size.
1899 (elf_x86_compute_jump_table_size): New.
1901 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1903 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
1905 (_bfd_x86_elf_adjust_dynamic_symbol): Use sizeof_reloc.
1906 * elfxx-x86.h (elf_x86_link_hash_table): Add sizeof_reloc.
1908 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
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.
1917 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
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.
1928 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1931 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Check
1932 ELF_COMMON_DEF_P for common symbols.
1934 2017-09-02 Alan Modra <amodra@gmail.com>
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.
1940 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
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.
1950 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
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.
1962 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1964 * elfxx-x86.h (elf_x86_plt_layout_table): Fix a typo in
1967 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
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.
1975 * elfxx-x86.h (_bfd_x86_elf_mkobject): New.
1976 (bfd_elf64_mkobject): Likewise.
1977 (bfd_elf32_mkobject): Likewise.
1979 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
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
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.
2004 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
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.
2012 2017-09-01 Nick Clifton <nickc@redhat.com>
2015 * dwarf2.c (decode_line_info): Fix test for an overlong line info
2018 2017-09-01 Nick Clifton <nickc@redhat.com>
2021 * elf-attrs.c (_bfd_elf_parse_attributes): Ensure that the
2022 attribute buffer is NUL terminated.
2024 2017-08-31 Nick Clifton <nickc@redhat.com>
2027 * dwarf2.c (read_section): If necessary add a terminating NUL byte
2028 to dwarf string sections.
2030 2017-08-31 Alan Modra <amodra@gmail.com>
2032 * po/SRC-POTFILES.in: Regenerate.
2034 2017-08-31 Alan Modra <amodra@gmail.com>
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
2043 2017-08-31 Alan Modra <amodra@gmail.com>
2047 * elflink.c (bfd_elf_discard_info): Don't pad embedded zero
2050 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
2052 * configure.ac (bfd_backends): Add elf64.lo together with
2053 elfxx-x86.lo for 64-bit BFD.
2054 * configure: Regenerated.
2056 2017-08-31 James Bowman <james.bowman@ftdichip.com>
2058 * elf32-ft32.c (ft32_elf_howto_table): Use complain_overflow_dont
2061 2017-08-31 Alan Modra <amodra@gmail.com>
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.
2068 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
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.
2087 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
2089 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Check
2090 target_id instead of elf_machine_code.
2092 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
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
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".
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.
2167 2017-08-30 Maciej W. Rozycki <macro@imgtec.com>
2169 * elfxx-mips.c (mips_elf_perform_relocation): Correct microMIPS
2170 branch offset interpretation.
2172 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
2175 * opncls.c (bfd_close_all_done): Call _close_and_cleanup.
2177 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
2179 * elf64-x86-64.c (elf_x86_64_next_tls_desc_index): Removed.
2180 (elf_x86_64_srelplt2): Likewise.
2182 2017-08-30 Alan Modra <amodra@gmail.com>
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.
2194 2017-08-30 Alan Modra <amodra@gmail.com>
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.
2200 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
2202 * elf32-i386.c (elf_i386_pie_finish_undefweak_symbol):
2204 * elf64-x86-64.c (elf_x86_64_finish_local_dynamic_symbol):
2206 (elf_x86_64_pie_finish_undefweak_symbol): Likewise.
2208 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
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.
2352 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
2354 * elf32-i386.c (elf_i386_get_synthetic_symtab): Simplify bad
2356 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
2358 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
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.
2365 2017-08-28 H.J. Lu <hongjiu.lu@intel.com>
2367 * elf-bfd.h (_bfd_elf_ifunc_get_synthetic_symtab): Removed.
2368 * elf-ifunc.c (_bfd_elf_ifunc_get_synthetic_symtab): Likewise.
2370 2017-08-28 H.J. Lu <hongjiu.lu@intel.com>
2373 * elf32-i386.c (elf_i386_get_synthetic_symtab): Check for valid
2375 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
2377 2017-08-27 H.J. Lu <hongjiu.lu@intel.com>
2379 * elf32-i386.c (elf_i386_link_hash_newfunc): Initialize
2381 * elf64-x86-64.c (elf_x86_64_link_hash_newfunc): Likewise.
2383 2017-08-26 H.J. Lu <hongjiu.lu@intel.com>
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.
2417 2017-08-26 Alan Modra <amodra@gmail.com>
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
2429 2017-08-25 H.J. Lu <hongjiu.lu@intel.com>
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.
2435 2017-08-24 H.J. Lu <hongjiu.lu@intel.com>
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.
2442 2017-08-24 H.J. Lu <hongjiu.lu@intel.com>
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.
2448 2017-08-23 H.J. Lu <hongjiu.lu@intel.com>
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
2453 (elf_x86_64_check_relocs): Update elf_x86_64_need_pic call.
2454 (elf_x86_64_relocate_section): Likewise.
2456 2017-08-23 H.J. Lu <hongjiu.lu@intel.com>
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.
2462 2017-08-23 H.J. Lu <hongjiu.lu@intel.com>
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.
2469 2017-08-23 Alan Modra <amodra@gmail.com>
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.
2479 2017-08-21 Alan Modra <amodra@gmail.com>
2480 H.J. Lu <hongjiu.lu@intel.com>
2483 * elf-bfd.h (SYMBOLIC_BIND): Return TRUE for __start/__stop symbols.
2484 * elflink.c (bfd_elf_define_start_stop): Rewrite.
2486 2017-08-21 Hans-Peter Nilsson <hp@bitrange.com>
2489 * elf64-mmix.c (mmix_elf_relax_section): Correct handling of
2490 undefined weak symbols.
2492 2017-08-18 Nick Clifton <nickc@redhat.com>
2495 * tekhex.c (getsym): Fix check for source pointer walking off the
2496 end of the input buffer.
2498 2017-08-17 Szabolcs Nagy <szabolcs.nagy@arm.com>
2501 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Skip IFUNC
2502 relocations in debug sections, change abort to _bfd_error_handler.
2504 2017-08-14 Nick Clifton <nickc@redhat.com>
2507 * elf.c (setup_group): Check for an empty or very small group
2509 * po/bfd.pot: Regenerate.
2511 2017-08-14 Alan Modra <amodra@gmail.com>
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.
2519 2017-08-11 H.J. Lu <hongjiu.lu@intel.com>
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.
2526 2017-08-08 Nick Clifton <nickc@redhat.com>
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
2533 (elfcore_grok_freebsd_prstatus): Add checks to make sure that
2534 there is enough data present in the note.
2536 2017-08-08 Alan Modra <amodra@gmail.com>
2539 * elf32-microblaze.c (microblaze_elf_check_relocs): Don't bump
2540 got.refcount for GOTOFF relocs, just create .got section.
2542 2017-08-07 H.J. Lu <hongjiu.lu@intel.com>
2544 * elflink.c (elf_link_add_object_symbols): Move common symbol
2545 check after bed->common_definition.
2547 2017-08-07 Alan Modra <amodra@gmail.com>
2550 * elflink.c (bfd_elf_final_link): Don't segfault when sections
2551 needed to define various dynamic tags have been discarded.
2553 2017-08-07 Nick Clifton <nickc@redhat.com>
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
2561 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Likewise.
2563 2017-08-06 H.J. Lu <hongjiu.lu@intel.com>
2565 * elf32-i386.c (elf_i386_link_hash_entry): Change tls_get_addr
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
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.
2581 2017-08-06 H.J. Lu <hongjiu.lu@intel.com>
2584 * elflink.c (elf_link_add_object_symbols): Treat common symbol
2585 as undefined for --no-define-common.
2587 2017-08-05 Alan Modra <amodra@gmail.com>
2589 * elf32-hppa.c (elf32_hppa_set_gp): Don't require an
2590 hppa_link_hash_table.
2592 2017-08-02 Max Filippov <jcmvbkbc@gmail.com>
2594 * xtensa-isa.c (xtensa_isa_init): Don't update lookup table
2595 entries for sysregs with negative indices.
2597 2017-08-01 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
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.
2603 2017-07-31 Kuan-Lin Chen <rufus@andestech.com>
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.
2616 2017-07-31 Alan Modra <amodra@gmail.com>
2618 * elf64-ppc.c (ppc64_elf_tls_setup): Warn on --plt-localentry
2619 without ld.so checks.
2621 2017-07-29 Alan Modra <amodra@gmail.com>
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.
2629 2017-07-28 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
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.
2635 2017-07-27 Nick Clifton <nickc@redhat.com>
2638 * mach-o.c (bfd_mach_o_read_symtab_strtab): Fail if the symtab
2640 * nlmcode.h (nlm_swap_auxiliary_headers_in): Replace assertion
2642 * section.c (bfd_make_section_with_flags): Fail if the name or bfd
2644 * vms-alpha.c (bfd_make_section_with_flags): Correct computation
2646 (evax_bfd_print_emh): Check for invalid string lengths.
2648 2017-07-25 Nick Clifton <nickc@redhat.com>
2650 * po/fr.po: Updated French translation.
2652 2017-07-25 Benjamin Green <bengreen5mx@gmail.com>
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.
2659 2017-07-25 Alan Modra <amodra@gmail.com>
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
2671 2017-07-24 Nick Clifton <nickc@redhat.com>
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):
2682 * mach-o-i386.c (bfd_mach_o_i386_canonicalize_one_reloc):
2684 * mach-o-x86-64.c (bfd_mach_o_x86_64_canonicalize_one_reloc):
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.
2691 (_bfd_vms_slurp_egsd): Check for an invalid section index.
2692 (image_set_ptr): Likewise.
2693 (alpha_vms_slurp_relocs): Likewise.
2695 (alpha_vms_object_p): Check for a truncated record.
2697 2017-07-24 Nick Clifton <nickc@redhat.com>
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
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.
2711 2017-07-23 Alan Modra <amodra@gmail.com>
2713 * elf64-ppc.c (ppc64_elf_size_stubs): Correct advance to
2716 2017-07-19 Szabolcs Nagy <szabolcs.nagy@arm.com>
2719 * elfnn-aarch64.c (elfNN_aarch64_reloc_type_class): Return
2720 reloc_class_ifunc for ifunc symbols.
2722 2017-07-19 Nick Clifton <nickc@redhat.com>
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.
2729 2017-07-19 Nick Clifton <nickc@redhat.com>
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.
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.
2746 2017-07-19 Claudiu Zissulescu <claziss@synopsys.com>
2747 John Eric Martin <John.Martin@emmicro-us.com>
2749 * bfd-in2.h: Regenerate.
2750 * libbfd.h: Regenerate.
2751 * elf32-arc.c (JLI): Define.
2752 * reloc.c: Add JLI relocations.
2754 2017-07-18 Nick Clifton <nickc@redhat.com>
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.
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.
2775 * sunos.c: Likewise.
2776 * vms-alpha.c: Likewise.
2777 * xcofflink.c: Likewise.
2779 2017-07-18 Nick Clifton <nickc@redhat.com>
2782 * coffcode.h (handle_COMDAT): Replace abort with an error message
2785 2017-07-17 H.J. Lu <hongjiu.lu@intel.com>
2788 * elf64-x86-64.c (elf_x86_64_relocate_section): Limit PIC check
2791 2017-07-17 H.J. Lu <hongjiu.lu@intel.com>
2793 * elf64-x86-64.c (elf_x86_64_relocate_section): Re-indent.
2795 2017-07-16 Alan Modra <amodra@gmail.com>
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.
2801 2017-07-12 Alan Modra <amodra@gmail.com>
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.
2820 2017-07-12 Nick Clifton <nickc@redhat.com>
2822 Fix compile time warnings using gcc 7.1.1.
2823 * elf32-xtensa.c (elf_xtensa_get_plt_section): Increase length of
2825 (elf_xtensa_get_gotplt_section): Increase length of got_name
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.
2832 2017-07-12 Alan Modra <amodra@gmail.com>
2834 * binary.c (binary_set_section_contents): Don't print filepos in
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
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
2847 * elf32-metag.c (elf_metag_relocate_section): Delete extra error
2849 * elf32-nds32.c (nds32_elf_ex9_build_hash_table): Rewrite bogus
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
2868 * elf32-arm.c (elf32_arm_tls_relax): Correct format string and args
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.
2899 * coff-arm.c (coff_arm_relocate_section): Use L modifier in error
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.
2995 2017-07-11 Alan Modra <amodra@gmail.com>
2997 * elf32-ppc.c (ppc_elf_relocate_section): Fix typo.
2999 2017-07-11 Alan Modra <amodra@gmail.com>
3001 * elf32-ppc.c (ppc_elf_relocate_section): Emit "unexpected
3002 instruction" error using _bfd_error_handler, not einfo.
3004 2017-07-10 Nick Clifton <nickc@redhat.com>
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.
3009 2017-07-07 John Baldwin <jhb@FreeBSD.org>
3011 * elf.c (elfcore_grok_freebsd_note): Handle NT_FREEBSD_PTLWPINFO.
3013 2017-07-07 Alan Modra <amodra@gmail.com>
3015 * coffcode.h (coff_slurp_symbol_table): Handle C_AIX_WEAKEXT.
3017 2017-07-07 Alan Modra <amodra@gmail.com>
3019 * bfd.c (_doprnt): Replace "L" with "ll" when printing bfd_vma
3020 as long long. Move code replacing "ll" with "I64", and simplify.
3022 2017-07-06 H.J. Lu <hongjiu.lu@intel.com>
3024 * bfd.c (_doprnt): Convert 'L' to 'l' when setting wide_width
3027 2017-07-05 H.J. Lu <hongjiu.lu@intel.com>
3029 * dwarf2.c (line_info_add_include_dir_stub): Replace time with
3031 (line_info_add_file_name): Likewise.
3032 (decode_line_info): Likewise.
3034 2017-07-04 Tristan Gingold <gingold@adacore.com>
3036 * version.m4: Bump version to 2.29.51
3037 * configure: Regenerate.
3039 2017-07-04 Jiong Wang <jiong.wang@arm.com>
3041 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Remove the
3042 sanity check at the head of this function.
3044 2017-07-04 Jan Kratochvil <jan.kratochvil@redhat.com>
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.
3063 2017-07-03 Egeyar Bagcioglu <egeyar.bagcioglu@oracle.com>
3065 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Remove the
3066 abort statement that was put for symbols that are not dynamic.
3068 2017-07-03 Tristan Gingold <gingold@adacore.com>
3070 * po/bfd.pot: Regenerate
3072 2017-07-03 Alan Modra <amodra@gmail.com>
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
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"
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.
3096 2017-07-03 Alan Modra <amodra@gmail.com>
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.
3108 2017-07-03 Alan Modra <amodra@gmail.com>
3110 * elf.c (_bfd_elf_print_private_bfd_data): Use BFD_VMA_FMT to
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.
3118 2017-07-03 Alan Modra <amodra@gmail.com>
3120 * configure.ac: Invoke AC_CHECK_TYPES for long long. Invoke
3121 AC_TYPE_LONG_DOUBLE.
3122 * configure: Regenerate.
3123 * config.in: Regenerate.
3125 2017-06-29 Andrew Waterman <andrew@sifive.com>
3127 * elfnn-riscv.c (riscv_elf_adjust_dynamic_symbol): Fix TLS copy
3130 2017-06-29 Egeyar Bagcioglu <egeyar.bagcioglu@oracle.com>
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
3137 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): If symbol
3138 is not dynamic in PIC, abort.
3140 2017-06-29 Jiong Wang <jiong.wang@arm.com>
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.
3149 2017-06-29 Jiong Wang <jiong.wang@arm.com>
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
3158 2017-06-29 Andreas Arnez <arnez@linux.vnet.ibm.com>
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.
3169 2017-06-28 H.J. Lu <hongjiu.lu@intel.com>
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.
3175 2017-06-28 H.J. Lu <hongjiu.lu@intel.com>
3177 * bfd-in2.h: Regenerated.
3178 * bfdio.c (bfd_get_size): Change return type to ufile_ptr.
3179 (bfd_get_file_size): Likewise.
3181 2017-06-28 Maciej W. Rozycki <macro@imgtec.com>
3182 Matthew Fortune <matthew.fortune@imgtec.com>
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
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.
3196 2017-06-27 Nick Clifton <nickc@redhat.com>
3198 * tekhex.c (pass_over): Revert accidental conversion of a local
3199 array to a static array.
3201 2017-06-27 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
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.
3208 2017-06-27 Alan Modra <amodra@gmail.com>
3211 * libbfd.c (_bfd_generic_get_section_contents): Warning fix.
3212 (_bfd_generic_get_section_contents_in_window): Likewise.
3214 2017-06-26 Kuan-Lin Chen <rufus@andestech.com>
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.
3224 2017-06-27 Alan Modra <amodra@gmail.com>
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".
3232 2017-06-26 Pedro Alves <palves@redhat.com>
3235 * libbfd.c (_bfd_generic_get_section_contents): Add "count", not
3238 2017-06-26 H.J. Lu <hongjiu.lu@intel.com>
3241 * libbfd.c (_bfd_generic_get_section_contents_in_window): Add
3244 2017-06-26 Maciej W. Rozycki <macro@imgtec.com>
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'.
3252 2017-06-26 H.J. Lu <hongjiu.lu@intel.com>
3255 * compress.c (bfd_get_full_section_contents): Don't check the
3257 * libbfd.c (_bfd_generic_get_section_contents): Check for and
3258 reject a section whose size + offset is greater than the size
3260 (_bfd_generic_get_section_contents_in_window): Likewise.
3262 2017-06-26 Nick Clifton <nickc@redhat.com>
3265 * tekhex.c (getvalue): Check for the source pointer exceeding the
3266 end pointer before the first byte is read.
3268 2017-06-26 Nick Clifton <nickc@redhat.com>
3271 * opncls.c (get_build_id): Check that the section is big enough
3272 to contain the whole note.
3273 * compress.c (bfd_get_full_section_contents): Check for and reject
3274 a section whose size is greater than the size of the entire file.
3275 * elf32-v850.c (v850_elf_copy_notes): Allow for the ouput to not
3276 contain a notes section.
3278 2017-06-26 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
3280 * elf64-s390.c (elf_s390_additional_program_headers): Add NULL
3282 (elf_s390_modify_segment_map): Likewise.
3283 (bfd_elf_s390_set_options): Lisewise.
3285 2017-06-26 Alan Modra <amodra@gmail.com>
3287 * elflink.c (_bfd_elf_link_create_dynstrtab): Don't make dynobj
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.
3296 2017-06-25 Sergei Trofimovich <slyfox@gentoo.org>
3298 * elf.c (find_link): Bounds check "hint".
3300 2017-06-24 Thomas Preud'homme <thomas.preudhomme@arm.com>
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.
3312 2017-06-23 Jiong Wang <jiong.wang@arm.com>
3314 * reloc.c (BFD_RELOC_AARCH64_ADR_GOTPAGE): Rename to
3315 BFD_RELOC_AARCH64_ADR_GOT_PAGE
3316 * bfd-in2.h: Regenerate.
3318 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
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.
3324 2017-06-22 Eric Christopher <echristo@gmail.com>
3326 * elf32-arm.c (elf32_arm_final_link_relocate): Use labs rather than
3327 abs to fix a truncation warning.
3329 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
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.
3335 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
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.
3346 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
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
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.
3400 2017-06-22 Nick Clifton <nickc@redhat.com>
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.
3407 2017-06-21 Nick Clifton <nickc@redhat.com>
3410 * coff-sh.c (sh_reloc): Check for an out of range reloc.
3412 2017-06-21 Nick Clifton <nickc@redhat.com>
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.
3427 2017-06-21 Alan Modra <amodra@gmail.com>
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
3434 2017-06-21 Nick Clifton <nickc@redhat.com>
3437 * reloc.c (bfd_generic_get_relocated_section_contents): Fail if
3438 bfd_get_full_section_contents returns no contents.
3440 2017-06-21 Nick Clifton <nickc@redhat.com>
3443 * vms-alpha.c (_bfd_vms_slurp_egsd): Check for an undersized
3446 2017-06-21 Nick Clifton <nickc@redhat.com>
3449 * vms-alpha.c (_bfd_vms_slurp_egsd): Check for an empty section
3451 (image_set_ptr): Likewise.
3452 (alpha_vms_fix_sec_rel): Likewise.
3453 (alpha_vms_slurp_relocs): Likewise.
3455 2017-06-21 Nick Clifton <nickc@redhat.com>
3458 * ieee.c (ieee_slurp_sections): Check for a NULL return from
3460 (ieee_archive_p): Likewise.
3461 (ieee_object_p): Likewise.
3463 2017-06-21 Nick Clifton <nickc@redhat.com>
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.
3470 2017-06-20 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
3472 * elf-s390.h: New file.
3473 * elf64-s390.c (struct elf_s390_link_hash_table): Add params
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.
3481 2017-06-19 H.J. Lu <hongjiu.lu@intel.com>
3484 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Check
3485 the DYNAMIC bit instead of bfd_count_sections.
3487 2017-06-19 Nick Clifton <nickc@redhat.com>
3490 * vms-alpha.c (evax_bfd_print_emh): Check for insufficient record
3492 (evax_bfd_print_eeom): Likewise.
3493 (evax_bfd_print_egsd): Check for an overlarge record length.
3494 (evax_bfd_print_etir): Likewise.
3496 2017-06-19 Nick Clifton <nickc@redhat.com>
3499 * libieee.h (struct common_header_type): Add end_p field.
3500 * ieee.c (this_byte_and_next): Do not advance input_p beyond
3502 (read_id): Check for a length that exceeds the remaining bytes in
3504 (ieee_seek): Initialise end_p.
3505 (ieee_archive_p): Likewise.
3506 (ieee_object_p): Likewise.
3508 2017-06-19 Nick Clifton <nickc@redhat.com>
3511 * vms-alpha.c (_bfd_vms_slurp_eihs): Check for invalid offset
3512 before reading the EIHS structure entries.
3514 2017-06-19 Nick Clifton <nickc@redhat.com>
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.
3522 2017-06-19 Alan Modra <amodra@gmail.com>
3524 * config.bfd: Correct targ_underscore for cris.
3526 2017-06-18 Alan Modra <amodra@gmail.com>
3528 * config.bfd: Correct targ_underscore for epiphany, ip2k,
3529 m32c, mn10200, pru, rl78, rx, crisv32 and v850.
3531 2017-06-16 Nick Clifton <nickc@redhat.com>
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
3537 2017-06-16 Alan Modra <amodra@gmail.com>
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
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.
3583 2017-06-16 Jiong Wang <jiong.wang@arm.com>
3585 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Use
3586 SYMBOL_REFERENCES_LOCAL.
3588 2017-06-15 Jiong Wang <jiong.wang@arm.com>
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.
3602 2017-06-15 Nick Clifton <nickc@redhat.com>
3605 * ieee.c (ieee_object_p): Use a static buffer to avoid compiler
3608 (ieee_archive_p): Likewise.
3610 2017-06-15 Nick Clifton <nickc@redhat.com>
3613 * vms-alpha.c (_bfd_vms_slurp_etir): Extend check of cmd_length.
3615 2017-06-14 Max Filippov <jcmvbkbc@gmail.com>
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.
3624 2017-06-14 Nick Clifton <nickc@redhat.com>
3627 * elf32-sh.c (sh_elf_set_mach_from_flags): Fix check for invalid
3630 2017-06-14 Nick Clifton <nickc@redhat.com>
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
3639 2017-06-14 Nick Clifton <nickc@redhat.com>
3642 * versados.c (versados_mkobject): Zero the allocated tdata structure.
3643 (process_otr): Check for an invalid offset in the otr structure.
3645 2017-06-14 Sebastian Huber <sebastian.huber@embedded-brains.de>
3647 * config.bfd (epiphany-*-elf): Accept epiphany-*-*.
3649 2017-06-13 H.J. Lu <hongjiu.lu@intel.com>
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.
3670 2017-06-13 Nick Clifton <nickc@redhat.com>
3673 * elflink.c (elf_link_adjust_relocs): Generate an error when
3674 encountering a reloc against a symbol removed by garbage
3677 2017-06-12 H.J. Lu <hongjiu.lu@intel.com>
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
3689 * elf64-x86-64.c (elf_x86_64_merge_gnu_properties): Likewise.
3691 2017-06-11 Joe Zbiciak <joe.zbiciak@leftturnonly.info>
3694 * binary.c (binary_set_section_contents): Scale lma by octets
3695 per byte to set filepos.
3697 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3699 * elf32-arc.c (elf_arc_check_relocs): Fixed conditions to generate
3702 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3704 * elf32-arc.c (elf_arc_size_dynamic_sections): Changed condition to
3707 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
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.
3713 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3715 * elf32-arc.c (elf_arc_relocate_section): Added "call" to
3716 RELOC_FOR_GLOBAL_SYMBOL macro.
3718 2018-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3720 * elf32-arc.c (elf_arc_relocate_section): Small refactor and condition
3723 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3725 * config/tc-arc.c (md_undefined_symbol): Changed.
3726 * config/tc-arc.h (DYNAMIC_STRUCT_NAME): Removed.
3728 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3730 * elf32-arc.c (elf_arc_relocate_section): Fixed reassign of indirect
3733 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
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.
3738 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3740 * elf32-arc.c (ADD_RELA): Changed to only work when dynamic
3743 2017-06-08 Richard Earnshaw <rearnsha@arm.com>
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.
3749 2017-06-08 H.J. Lu <hongjiu.lu@intel.com>
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
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.
3763 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
3765 * elf.c (setup_group): Make sure BFD sections are created for all
3766 group sections in the input file when processing SHF_GROUP
3768 (bfd_section_from_shdr): Avoid duplicating logic already
3769 implemented in `setup_group'.
3771 2017-06-06 Daniel Bonniot de Ruisselet <bonniot@gmail.com>
3774 * peXXigen.c (pe_print_idata): Use the address of the first thunk
3775 if the hint address is zero.
3777 2017-06-06 James Clarke <jrtc27@jrtc27.com>
3780 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Check
3781 ELF_COMMON_DEF_P for common symbols.
3783 2017-06-06 Andrew Burgess <andrew.burgess@embecosm.com>
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.
3797 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
3799 * elfxx-mips.c (_bfd_mips_elf_relocate_section): Remove unused
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.
3807 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
3809 * elflink.c (init_reloc_cookie_rels): Remove unused variable
3812 2017-06-06 Maciej W. Rozycki <macro@imgtec.com>
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
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
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.
3848 2017-06-05 Alan Modra <amodra@gmail.com>
3851 * linker.c (_bfd_generic_link_output_symbols): Handle BSF_GNU_UNIQUE.
3853 2017-06-01 John Baldwin <jhb@FreeBSD.org>
3855 * elf.c (elfcore_grok_freebsd_psinfo): Use ELF header class to
3856 determine structure sizes.
3857 (elfcore_grok_freebsd_prstatus): Likewise.
3859 2017-06-01 Alan Modra <amodra@gmail.com>
3861 * elf64-ppc.c (struct ppc_link_hash_table): Add has_plt_localentry0.
3862 (ppc64_elf_merge_symbol_attribute): Merge localentry bits from
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
3873 (ppc64_elf_finish_dynamic_sections): Set PPC64_OPT_LOCALENTRY in
3875 * elf64-ppc.h (struct ppc64_elf_params): Add plt_localentry0.
3877 2017-05-30 Casey Smith <clegg89@gmail.com>
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.
3883 2017-05-30 Anton Kolesov Anton.Kolesov@synopsys.com
3885 * cpu-arc.c (arc_compatible): New function.
3887 2017-05-30 Anton Kolesov <anton.kolesov@synopsys.com>
3889 * cpu-arc.c (arch_info_struct): Remove duplicate ARC600 entry.
3891 2017-05-30 H.J. Lu <hongjiu.lu@intel.com>
3894 * bfdio.c (bfd_get_file_size): New function.
3895 * bfd-in2.h: Regenerated.
3897 2017-05-23 Dilian Palauzov <git-dpa@aegee.org>
3899 * elf32-arc.c (arc_elf_merge_attributes): Add fall through
3902 2017-05-22 H.J. Lu <hongjiu.lu@intel.com>
3904 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Use
3905 dynobj instead of htab->elf.dynobj.
3907 2017-05-19 Maciej W. Rozycki <macro@imgtec.com>
3909 * elf64-mips.c (mips_elf64_canonicalize_reloc): Remove prototype
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.
3918 2017-05-19 Jose E. Marchesi <jose.marchesi@oracle.com>
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
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
3933 * elf32-sparc.c (elf32_sparc_final_write_processing): Handle
3934 bfd_mach_sparc_v8plusm8.
3936 2017-05-19 Alan Modra <amodra@gmail.com>
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
3942 2017-05-18 Alan Modra <amodra@gmail.com>
3944 * arc-got.h: Don't compare boolean values against TRUE or FALSE.
3945 * elf-m10300.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.
3961 2017-05-17 H.J. Lu <hongjiu.lu@intel.com>
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.
3968 2017-05-16 Alan Modra <amodra@gmail.com>
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.
4025 2017-05-16 Alan Modra <amodra@gmail.com>
4027 * elf64-ppc.c (add_symbol_adjust): Transfer non_ir_ref_dynamic.
4028 * elflink.c (elf_link_add_object_symbols): Update to use
4030 (elf_link_input_bfd): Test non_ir_ref_dynamic in addition to
4032 * linker.c (_bfd_generic_link_add_one_symbol): Likewise.
4034 2017-05-15 Maciej W. Rozycki <macro@imgtec.com>
4036 * elfxx-mips.c (print_mips_ases): Handle MIPS16e2 ASE.
4038 2017-05-12 H.J. Lu <hongjiu.lu@intel.com>
4040 * elf32-i386.c (elf_i386_parse_gnu_properties): Merge
4041 GNU_PROPERTY_X86_ISA_1_USED and GNU_PROPERTY_X86_ISA_1_NEEDED
4043 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
4045 2017-05-11 H.J. Lu <hongjiu.lu@intel.com>
4047 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Rename plt_bnd
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
4060 (elf_backend_setup_gnu_properties): Updated. Create the
4061 .plt.sec section instead of the .plt.sec section.
4063 2017-05-11 H.J. Lu <hongjiu.lu@intel.com>
4065 * elf32-i386.c (elf_i386_allocate_dynrelocs): Partially revert
4066 commit 25070364b0ce33eed46aa5d78ebebbec6accec7e.
4067 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewse.
4069 2017-05-10 Jose E. Marchesi <jose.marchesi@oracle.com>
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'.
4075 2017-05-10 Jose E. Marchesi <jose.marchesi@oracle.com>
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.
4108 2017-05-10 H.J. Lu <hongjiu.lu@intel.com>
4111 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Use .plt.bnd
4112 for IFUNC function address.
4114 2017-05-10 Claudiu Zissulescu <claziss@synopsys.com>
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.
4137 2017-05-09 Andrew Goedhart <Andrewgoedhart@simplepowersolutions.co.za>
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.
4144 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
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.
4150 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
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.
4217 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
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.
4276 2017-05-08 Thomas Preud'homme <thomas.preudhomme@arm.com>
4278 * elflink.c (elf_output_implib): Remove executable flag from import
4280 * elf32-arm.c (elf32_arm_filter_implib_symbols): Assert that the import
4281 library is a relocatable object file.
4283 2017-05-01 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
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.
4292 2017-05-01 Palmer Dabbelt <palmer@dabbelt.com>
4294 * config.bfd (riscv32-*): Enable rv64.
4296 2017-05-02 Alan Modra <amodra@gmail.com>
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.
4304 2017-04-29 Alan Modra <amodra@gmail.com>
4307 * reloc.c (reloc_offset_in_range): New function.
4308 (bfd_perform_relocation, bfd_install_relocation): Use it.
4309 (_bfd_final_link_relocate): Likewise.
4311 2017-04-28 H.J. Lu <hongjiu.lu@intel.com>
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.
4317 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
4319 * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Use "="
4320 instead of "+=" to update 0.
4322 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
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
4332 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
4334 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Remove
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
4342 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
4344 * elf-bfd.h (elf_backend_data): Change setup_gnu_properties
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.
4350 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
4352 * elf32-i386.c (elf_i386_finish_dynamic_sections): Simplify
4353 VxWorks for non-PIC.
4355 2017-04-27 Alan Modra <amodra@gmail.com>
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.
4368 2017-04-27 Alan Modra <amodra@gmail.com>
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
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.
4382 2017-04-27 Alan Modra <amodra@gmail.com>
4384 * elflink.c (_bfd_elf_link_hash_hide_symbol): Clear dynstr_index
4387 2017-04-27 Alan Modra <amodra@gmail.com>
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.
4399 2017-04-26 H.J. Lu <hongjiu.lu@intel.com>
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.
4406 2017-04-26 Nick Clifton <nickc@redhat.com>
4409 * reloc.c (bfd_perform_relocation): Check for a negative address
4412 2017-04-26 Maciej W. Rozycki <macro@imgtec.com>
4415 * elf-bfd.h (elf_backend_data): Add `always_renumber_dynsyms'
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
4424 (bfd_elf_size_dynsym_hash_dynstr): Likewise.
4426 2017-04-26 Maciej W. Rozycki <macro@imgtec.com>
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.
4432 2017-04-26 Nick Clifton <nickc@redhat.com>
4435 * compress.c (bfd_init_section_compress_status): Check the return
4436 value from bfd_malloc.
4438 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
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
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.
4452 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
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.
4461 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
4464 * elf32-i386.c (ELF_MAXPAGESIZE): Set to 0x1000 for VxWorks.
4466 2017-04-23 Alan Modra <amodra@gmail.com>
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.
4474 2017-04-23 Alan Modra <amodra@gmail.com>
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.
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.
4489 2017-04-23 Alan Modra <amodra@gmail.com>
4492 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Don't segfault when
4495 2017-04-21 H.J. Lu <hongjiu.lu@intel.com>
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
4509 2017-04-21 H.J. Lu <hongjiu.lu@intel.com>
4513 * elflink.c (elf_link_add_object_symbols): Require
4514 --no-dynamic-linker with -E/--dynamic-list when creating
4517 2017-04-20 Maciej W. Rozycki <macro@imgtec.com>
4519 * elflink.c (_bfd_elf_symbol_refs_local_p): Always return TRUE
4522 2017-04-20 Maciej W. Rozycki <macro@imgtec.com>
4524 * elfxx-mips.c (_bfd_mips_elf_final_link): Reorder comment about
4525 dynamic symbol sorting.
4527 2017-04-20 H.J. Lu <hongjiu.lu@intel.com>
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.
4534 2017-04-19 H.J. Lu <hongjiu.lu@intel.com>
4537 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Don't abort
4538 on on undefined IFUNC symbol in the second PLT.
4540 2017-04-19 Wedson Almeida Filho <wedsonaf@gmail.com>
4542 * peXXigen.c (pe_print_reloc): Correct chunk_end.
4544 2017-04-19 Alan Modra <amodra@gmail.com>
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
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.
4562 2017-04-17 H.J. Lu <hongjiu.lu@intel.com>
4565 * elflink.c (bfd_elf_size_dynamic_sections): Get soname index
4566 before generating the version definition section.
4568 2017-04-17 Alan Modra <amodra@gmail.com>
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.
4574 2017-04-13 Alan Modra <amodra@gmail.com>
4576 * coffcode.h: Wrap some overly long _bfd_error_handler args.
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.
4587 2017-04-13 Alan Modra <amodra@gmail.com>
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.
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.
4629 * linker.c: Likewise.
4630 * merge.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.
4639 2017-04-13 Alan Modra <amodra@gmail.com>
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.
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.
4665 2017-04-13 Alan Modra <amodra@gmail.com>
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.
4672 2017-04-13 Alan Modra <amodra@gmail.com>
4674 * bfd-in2.h: Regenerate.
4676 2017-04-11 H.J. Lu <hongjiu.lu@intel.com>
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.
4683 2017-04-11 H.J. Lu <hongjiu.lu@intel.com>
4685 * elf-properties.c (_bfd_elf_parse_gnu_properties): Ignore
4686 processor-specific properties with generic ELF target vector.
4688 2017-04-10 Qing Zhao <qing.zhao@oracle.com>
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
4695 (link_hash_newfunc): Initialize has_got_reloc and
4697 (_bfd_sparc_elf_size_dynamic_sections): Set interp to .interp
4699 (_bfd_sparc_elf_copy_indirect_symbol): Copy has_got_reloc and
4701 (_bfd_sparc_elf_check_relocs): Set has_got_reloc and
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
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.
4722 2017-04-10 Nick Clifton <nickc@redhat.com>
4724 * config.bfd: Remove ns32k from obsolete list.
4726 2017-04-10 Alan Modra <amodra@gmail.com>
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.
4733 2017-04-07 H.J. Lu <hongjiu.lu@intel.com>
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.
4745 2017-04-07 Pedro Alves <palves@redhat.com>
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
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.
4769 2017-04-07 Tristan Gingold <gingold@gingold-Precision-7510>
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.
4775 2017-04-07 Alan Modra <amodra@gmail.com>
4777 * po/SRC-POTFILES.in: Regenerate.
4779 2017-04-05 Alan Modra <amodra@gmail.com>
4781 * elf64-ppc.c (ppc64_elf_gc_sweep_hook): Support ELFv2 PLT
4784 2017-04-02 Jon Turney <jon.turney@dronecode.org.uk>
4786 (_bfd_XXi_swap_aouthdr_out): For clarity, use defines rather than
4787 numbers for DataDirectory entry indicies passed to
4790 2017-04-04 H.J. Lu <hongjiu.lu@intel.com>
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.
4799 2017-04-03 Palmer Dabbelt <palmer@dabbelt.com>
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.
4805 2017-04-04 Nick Clifton <nickc@redhat.com>
4808 * elflink.c (_bfd_elf_define_linkage_sym): Prevent null pointer
4810 (bfd_elf_final_link): Only initialize the extended symbol index
4811 section if there are extended symbol tables to list.
4813 2017-04-03 H.J. Lu <hongjiu.lu@intel.com>
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.
4846 2017-03-30 Pip Cet <pipcet@gmail.com>
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.
4854 2017-03-29 Nick Clifton <nickc@redhat.com>
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
4864 2017-03-28 Hans-Peter Nilsson <hp@axis.com>
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.
4873 2017-03-27 Pip Cet <pipcet@gmail.com>
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.
4886 2017-03-27 Pip Cet <pipcet@gmail.com>
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.
4900 2017-03-20 Alan Modra <amodra@gmail.com>
4903 * elf64-ppc.c (compare_symbols): Stabilize sort.
4905 2017-03-18 Alan Modra <amodra@gmail.com>
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.
4923 2017-03-13 Nick Clifton <nickc@redhat.com>
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
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.
4946 2017-03-11 Alan Modra <amodra@gmail.com>
4948 * elf32-ppc.c: Remove ATTRIBUTE_UNUSED throughout when function
4949 parameter is in fact used. Whitespace fixes.
4950 * elf64-ppc.c: Likewise.
4952 2017-03-09 Sam Thursfield <sam.thursfield@codethink.co.uk>
4954 * rs6000-core.c (CORE_NEW): Simplify macro when
4955 AIX_CORE_DUMPX_CORE and BFD64 are true to avoid compile warning.
4957 2017-03-07 Alan Modra <amodra@gmail.com>
4961 * elf64-ppc.c (ppc64_elf_relocate_section): Add missing
4964 2017-03-05 Alan Modra <amodra@gmail.com>
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
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.
4980 2017-03-02 Martin Bickel <binutils@ineranves.de>
4983 * elf.c (rewrite_elf_program_header): Do not issue a warning for
4984 empty segments which have a zero filesz, but a non-zero memsz.
4986 2017-03-02 Alan Modra <amodra@gmail.com>
4988 * elf32-ppc.c (ppc_elf_vle_split16): Correct insn mask typo.
4990 2017-02-28 Alan Modra <amodra@gmail.com>
4992 * elf64-ppc.c (ppc64_elf_ha_reloc): Revert last change.
4993 (ppc64_elf_relocate_section): Likewise.
4995 2017-02-28 Alan Modra <amodra@gmail.com>
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.
5019 2017-02-28 Alan Modra <amodra@gmail.com>
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.
5032 2017-02-28 Alan Modra <amodra@gmail.com>
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.
5058 2017-02-28 Maciej W. Rozycki <macro@imgtec.com>
5060 * elfxx-mips.c (mips_elf_perform_relocation): Also handle the
5061 `jalr $0, $25' instruction encoding.
5063 2017-02-27 Nick Clifton <nickc@redhat.com>
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.
5070 2017-02-25 Alan Modra <amodra@gmail.com>
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.
5084 2017-02-24 Andrew Waterman <andrew@sifive.com>
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.
5091 2017-02-23 Maciej W. Rozycki <macro@imgtec.com>
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.
5098 2017-02-23 Maciej W. Rozycki <macro@imgtec.com>
5100 * elfxx-mips.c (mips_elf_calculate_relocation) <R_MIPS_JALR>
5101 <R_MICROMIPS_JALR>: Discard relocation if `cross_mode_jump_p'
5104 2017-02-23 Alan Modra <amodra@gmail.com>
5107 * elf32-ppc.c (ppc_elf_howto_raw): Correct dst_mask on all VLE
5109 (ppc_elf_vle_split16): Correct field mask and shift for 16D relocs.
5110 (ppc_elf_relocate_section): Correct calculation for VLE SDAREL
5113 2017-02-22 Maciej W. Rozycki <macro@imgtec.com>
5116 * elflink.c (bfd_elf_size_dynamic_sections): Move symbol version
5117 processing ahead of the call to `elf_gc_sweep_symbol'.
5119 2017-02-22 Nick Clifton <nickc@redhat.com>
5122 * opncls.c (bfd_create_gnu_debuglink_section): Give the newly
5123 created section 4-byte alignment.
5125 2017-02-22 Alan Modra <amodra@gmail.com>
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
5132 2017-02-21 Alan Modra <amodra@gmail.com>
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.
5137 2017-02-20 Alan Modra <amodra@gmail.com>
5140 * elflink.c (bfd_elf_final_link): Make DT_REL/DT_RELA zero
5141 if DT_RELSZ/DT_RELASZ is zero.
5143 2017-02-17 Nick Clifton <nickc@redhat.com>
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.
5149 2017-02-17 Pedro Alves <palves@redhat.com>
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.
5157 2017-02-17 Pedro Alves <palves@redhat.com>
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.
5170 2017-02-17 Pedro Alves <palves@redhat.com>
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.
5179 2017-02-17 Pedro Alves <palves@redhat.com>
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.
5196 2017-02-17 Pedro Alves <palves@redhat.com>
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.
5213 2017-02-16 Andrew Burgess <andrew.burgess@embecosm.com>
5215 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Perform symbol lookup
5216 before trying to fine matching file and line information.
5218 2017-02-16 Andrew Burgess <andrew.burgess@embecosm.com>
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
5227 2017-02-16 Alan Modra <amodra@gmail.com>
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.
5237 2017-02-16 Alan Modra <amodra@gmail.com>
5240 * elf32-hppa.c (allocate_plt_static): Allocate space for relocs
5243 2017-02-16 Jiong Wang <jiong.wang@arm.com>
5245 * bfd.c (BFD_FLAGS_SAVED): Add BFD_LINKER_CREATED.
5246 * bfd-in2.h: Regenerated.
5248 2017-02-15 H.J. Lu <hongjiu.lu@intel.com>
5251 * elf32-i386.c (elf_i386_relocate_section): Allow
5252 "lea foo@GOT, %reg" in PIC.
5254 2017-02-15 H.J. Lu <hongjiu.lu@intel.com>
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
5262 2017-02-15 Maciej W. Rozycki <macro@imgtec.com>
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.
5271 2017-02-14 Alan Modra <amodra@gmail.com>
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.
5277 2017-02-13 Palmer Dabbelt <palmer@dabbelt.com>
5279 * elfnn-riscv.c (riscv_global_pointer_value): Change _gp to
5282 2017-02-13 Nick Clifton <nickc@redhat.com>
5285 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Check for an invalid
5288 2017-02-07 Andrew Waterman <andrew@sifive.com>
5290 * elfnn-riscv.c (riscv_elf_finish_dynamic_sections): Only write PLT
5291 entry size if PLT header is written.
5293 2017-02-06 Sheldon Lobo <sheldon.lobo@oracle.com>
5295 Fix sparc64 dynamic relocation processing to use the dynamic
5297 * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Use 'dynamic'
5298 to determine if bfd_get_symcount() or bfd_get_dynamic_symcount()
5301 2017-02-03 Nick Clifton <nickc@redhat.com>
5304 * coffcode.h (coff_write_object_contents): Enlarge size of
5305 s_name_buf in order to avoid compile time warning about possible
5307 * elf32-nds32.c (nds32_elf_ex9_import_table): Mask off lower
5308 32-bits of insn value before printing into buffer.
5310 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
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'.
5319 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
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.
5326 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
5328 * elfxx-mips.c (mips_elf_sort_hash_table): Use `htab' throughout
5329 to access the hash table.
5331 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
5333 * elfxx-mips.c (mips_elf_sort_hash_table): Move assertion on
5334 non-NULL `htab' to the beginning.
5336 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
5338 * elflink.c (elf_gc_sweep): Wrap overlong line.
5340 2017-01-30 Maciej W. Rozycki <macro@imgtec.com>
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.
5354 2017-01-27 Hans-Peter Nilsson <hp@axis.com>
5356 * elf32-cris.c (elf_cris_finish_dynamic_symbol): Remove now unused
5357 local variable dynobj.
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.
5367 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
5369 * config.bfd (*-*-rtemsaout*): Mark as removed.
5371 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
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*).
5378 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
5380 * config.bfd (*-*-rtemscoff*): Mark as removed.
5382 2017-01-24 Maciej W. Rozycki <macro@imgtec.com>
5385 * elflink.c (bfd_elf_record_link_assignment): Revert last
5386 change and don't ever clear `forced_local'. Set `mark'
5388 (elf_gc_sweep_symbol_info, elf_gc_sweep_symbol): Reorder within
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.
5396 2017-01-24 Alan Modra <amodra@gmail.com>
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.
5422 2017-01-23 Yury Norov <ynorov@caviumnetworks.com>
5424 * elfnn-aarch64.c: Fix relaxations for ILP32 mode.
5426 2017-01-20 Jiong Wang <jiong.wang@arm.com>
5428 * elfnn-aarch64.c (elf_aarch64_hash_symbol): New function.
5429 (elf_backend_hash_symbol): Define.
5431 2017-01-18 Maciej W. Rozycki <macro@imgtec.com>
5434 * elflink.c (bfd_elf_record_link_assignment): Clear any
5435 `forced_local' marking for DSO symbols that are not being
5438 2017-01-17 Kuan-Lin Chen <kuanlinchentw@gmail.com>
5440 * elfnn-riscv.c (riscv_elf_object_p): New function.
5442 2017-01-12 H.J. Lu <hongjiu.lu@intel.com>
5445 * elf64-x86-64.c (elf_x86_64_link_hash_table): Add
5447 (elf_x86_64_check_relocs): Create .eh_frame section for the
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.
5454 2017-01-12 Nick Clifton <nickc@redhat.com>
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
5475 * bfd-in2.h: Regenerate.
5477 2017-01-11 H.J. Lu <hongjiu.lu@intel.com>
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.
5486 2017-01-11 Jeremy Soller <jackpot51@gmail.com>
5488 * config.bfd: Add entries for i686-redox and x86_64-redox.
5490 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
5492 * elf32-i386.c (elf_i386_check_relocs): Align .eh_frame section
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.
5498 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
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
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
5529 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
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.
5534 2017-01-09 Nick Clifton <nickc@redhat.com>
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
5541 2017-01-09 Nick Clifton <nickc@redhat.com>
5544 * coffgen.c (_bfd_coff_get_external_symbols): Generate an error
5545 message if there are too many symbols to load.
5547 2017-01-04 James Clarke <jrtc27@jrtc27.com>
5549 * elf64-alpha.c (elf64_alpha_relax_opt_call): Don't set tsec_free
5550 if relocs are cached.
5552 2017-01-03 Rich Felker <bugdal@aerifal.cx>
5555 * elf32-microblaze.c (microblaze_elf_check_relocs): Add an entry
5556 for R_MICROBLAZE_GOTOFF_64.
5558 2017-01-03 Nick Clifton <nickc@redhat.com>
5560 * mach-o.c (bfd_mach_o_lookup_uuid_command): Fix compile time
5561 warning about using a possibly uninitialised variable.
5563 2017-01-02 Alan Modra <amodra@gmail.com>
5565 * elf32-hppa.c (ensure_undef_weak_dynamic): New function.
5566 (allocate_plt_static, allocate_dynrelocs): Use it.
5568 2017-01-02 Alan Modra <amodra@gmail.com>
5570 * elf-hppa.h (elf_hppa_fake_sections): Set SHF_INFO_LINK for
5571 .PARISC.unwind section.
5573 2017-01-02 Alan Modra <amodra@gmail.com>
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.
5580 2017-01-02 Alan Modra <amodra@gmail.com>
5582 Update year range in copyright notice of all files.
5584 For older changes see ChangeLog-2016
5586 Copyright (C) 2017 Free Software Foundation, Inc.
5588 Copying and distribution of this file, with or without modification,
5589 are permitted in any medium without royalty provided the copyright
5590 notice and this notice are preserved.
5596 version-control: never