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