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