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