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