MIPS/BFD: Correct microMIPS cross-mode BAL to JALX relaxation
[deliverable/binutils-gdb.git] / bfd / ChangeLog
CommitLineData
70e65ca8
MR
12017-08-30 Maciej W. Rozycki <macro@imgtec.com>
2
3 * elfxx-mips.c (mips_elf_perform_relocation): Correct microMIPS
4 branch offset interpretation.
5
7c0ed396
L
62017-08-30 H.J. Lu <hongjiu.lu@intel.com>
7
8 PR binutils/22032
9 * opncls.c (bfd_close_all_done): Call _close_and_cleanup.
10
0f2425c4
L
112017-08-30 H.J. Lu <hongjiu.lu@intel.com>
12
13 * elf64-x86-64.c (elf_x86_64_next_tls_desc_index): Removed.
14 (elf_x86_64_srelplt2): Likewise.
15
9a23f96e
AM
162017-08-30 Alan Modra <amodra@gmail.com>
17
18 * elf64-ppc.c (struct ppc_link_hash_table): Add do_tls_opt.
19 (ppc64_elf_tls_optimize): Set it.
20 (ppc64_elf_relocate_section): Nop addis on TPREL16_HA, and convert
21 insn on TPREL16_LO and TPREL16_LO_DS relocs to use r13 when
22 addis would add zero.
23 * elf32-ppc.c (struct ppc_elf_link_hash_table): Add do_tls_opt.
24 (ppc_elf_tls_optimize): Set it.
25 (ppc_elf_relocate_section): Nop addis on TPREL16_HA, and convert
26 insn on TPREL16_LO relocs to use r2 when addis would add zero.
27
b9f04fe0
AM
282017-08-30 Alan Modra <amodra@gmail.com>
29
30 * elf64-ppc.c (ppc64_elf_relocate_section): When optimizing
31 __tls_get_addr call sequences to LE, don't move the addi down
32 to the nop. Replace the bl with addi and leave the nop alone.
33
5f0f0847
L
342017-08-29 H.J. Lu <hongjiu.lu@intel.com>
35
36 * elf32-i386.c (elf_i386_pie_finish_undefweak_symbol):
37 Re-indent.
38 * elf64-x86-64.c (elf_x86_64_finish_local_dynamic_symbol):
39 Likewise.
40 (elf_x86_64_pie_finish_undefweak_symbol): Likewise.
41
443701f5
L
422017-08-29 H.J. Lu <hongjiu.lu@intel.com>
43
44 * Makefile.am (BFD32_BACKENDS): Add elfxx-x86.lo.
45 (BFD64_BACKENDS): Likewise.
46 (BFD32_BACKENDS_CFILES): Add elfxx-x86.c.
47 (BFD64_BACKENDS_CFILES): Likewise.
48 * Makefile.in: Regenerated.
49 * configure.ac (bfd_backends): Add elfxx-x86.lo together with
50 elf32-i386.lo and elf64-x86-64.lo.
51 * configure: Regenerated.
52 * elf32-i386.c: Include "elfxx-x86.h" instead of "sysdep.h",
53 "bfd.h", "bfdlink.h", "libbfd.h", "elf-bfd.h", "bfd_stdint.h",
54 "objalloc.h" and "hashtab.h".
55 (ELIMINATE_COPY_RELOCS): Removed.
56 (UNDEFINED_WEAK_RESOLVED_TO_ZERO):Likewise.
57 (SYMBOL_NO_COPYRELOC): Likewise.
58 (elf_i386_link_hash_entry): Likewise.
59 (GOT_UNKNOWN): Likewise.
60 (GOT_NORMAL): Likewise.
61 (GOT_TLS_GD): Likewise.
62 (elf_i386_hash_entry): Likewise.
63 (elf_i386_obj_tdata): Likewise.
64 (elf_i386_tdata): Likewise.
65 (elf_i386_local_got_tls_type): Likewise.
66 (elf_i386_local_tlsdesc_gotent): Likewise.
67 (elf_i386_hash_table): Likewise.
68 (elf_i386_link_hash_newfunc): Likewise.
69 (elf_i386_local_htab_hash): Likewise.
70 (elf_i386_local_htab_eq): Likewise.
71 (elf_i386_get_local_sym_hash): Likewise.
72 (elf_i386_link_hash_table_free): Likewise.
73 (elf_i386_copy_indirect_symbol): Likewise.
74 (elf_i386_fixup_symbol): Likewise.
75 (elf_i386_readonly_dynrelocs): Likewise.
76 (elf_i386_always_size_sections): Likewise.
77 (elf_i386_set_tls_module_base): Likewise.
78 (elf_i386_dtpoff_base): Likewise.
79 (compare_relocs): Likewise.
80 (elf_i386_hash_symbol): Likewise.
81 (elf_i386_parse_gnu_properties): Likewise.
82 (elf_i386_merge_gnu_properties): Likewise.
83 (elf_i386_link_check_relocs): Likewise.
84 (elf_i386_merge_symbol_attribute): Likewise.
85 (bfd_elf32_bfd_link_check_relocs): Likewise.
86 (elf_backend_copy_indirect_symbol): Likewise.
87 (elf_backend_always_size_sections): Likewise.
88 (elf_backend_omit_section_dynsym): Likewise.
89 (elf_backend_hash_symbol): Likewise.
90 (elf_backend_fixup_symbol): Likewise.
91 (elf_backend_parse_gnu_properties): Likewise.
92 (elf_backend_merge_gnu_properties): Likewise.
93 (elf_backend_merge_symbol_attribute): Likewise.
94 (elf_i386_mkobject): Updated.
95 (elf_i386_link_hash_table_create): Likewise.
96 (elf_i386_check_tls_transition): Likewise.
97 (elf_i386_tls_transition): Likewise.
98 (elf_i386_convert_load_reloc): Likewise.
99 (elf_i386_check_relocs): Likewise.
100 (elf_i386_adjust_dynamic_symbol): Likewise.
101 (elf_i386_allocate_dynrelocs): Likewise.
102 (elf_i386_convert_load): Likewise.
103 (elf_i386_size_dynamic_sections): Likewise.
104 (elf_i386_relocate_section): Likewise.
105 (elf_i386_finish_dynamic_symbol ): Likewise.
106 (elf_i386_finish_dynamic_sections): Likewise.
107 (elf_i386_output_arch_local_syms): Likewise.
108 (elf_i386_get_synthetic_symtab): Likewise.
109 (elf_i386_link_setup_gnu_properties): Likewise.
110 (elf_i386_link_hash_table): Use elf_x86_link_hash_table, instead
111 of elf_link_hash_table, as base.
112 (elf_i386_next_tls_desc_index): New.
113 (elf_i386_srelplt2): Likewise.
114 (elf_i386_plt): Likewise.
115 (elf_i386_lazy_plt): Likewise.
116 (elf_i386_non_lazy_plt): Likewise.
117 * elf32-x86-64.c: Include "elfxx-x86.h" instead of "sysdep.h",
118 "bfd.h", "bfdlink.h", "libbfd.h", "elf-bfd.h", "bfd_stdint.h",
119 "objalloc.h" and "hashtab.h".
120 (ELIMINATE_COPY_RELOCS): Removed.
121 (UNDEFINED_WEAK_RESOLVED_TO_ZERO):Likewise.
122 (SYMBOL_NO_COPYRELOC): Likewise.
123 (elf_x86_64_link_hash_entry): Likewise.
124 (GOT_UNKNOWN): Likewise.
125 (GOT_NORMAL): Likewise.
126 (GOT_TLS_GD): Likewise.
127 (elf_x86_64_hash_entry): Likewise.
128 (elf_x86_64_obj_tdata): Likewise.
129 (elf_x86_64_tdata): Likewise.
130 (elf_x86_64_local_got_tls_type): Likewise.
131 (elf_x86_64_local_tlsdesc_gotent): Likewise.
132 (elf_x86_64_hash_table): Likewise.
133 (elf_x86_64_link_hash_newfunc): Likewise.
134 (elf_x86_64_local_htab_hash): Likewise.
135 (elf_x86_64_local_htab_eq): Likewise.
136 (elf_x86_64_get_local_sym_hash): Likewise.
137 (elf_x86_64_link_hash_table_free): Likewise.
138 (elf_x86_64_copy_indirect_symbol): Likewise.
139 (elf_x86_64_fixup_symbol): Likewise.
140 (elf_x86_64_readonly_dynrelocs): Likewise.
141 (elf_x86_64_always_size_sections): Likewise.
142 (elf_x86_64_set_tls_module_base): Likewise.
143 (elf_x86_64_dtpoff_base): Likewise.
144 (compare_relocs): Likewise.
145 (elf_x86_64_merge_symbol_attribute): Likewise.
146 (elf_x86_64_hash_symbol): Likewise.
147 (elf_x86_64_parse_gnu_properties): Likewise.
148 (elf_x86_64_merge_gnu_properties): Likewise.
149 (elf_x86_64_link_check_relocs): Likewise.
150 (elf_backend_copy_indirect_symbol): Likewise.
151 (elf_backend_always_size_sections): Likewise.
152 (bfd_elf64_bfd_link_check_relocs): Likewise.
153 (elf_backend_merge_symbol_attribute): Likewise.
154 (elf_backend_hash_symbol): Likewise.
155 (elf_backend_omit_section_dynsym): Likewise.
156 (elf_backend_fixup_symbol): Likewise.
157 (elf_backend_parse_gnu_properties): Likewise.
158 (elf_backend_merge_gnu_properties): Likewise.
159 (bfd_elf32_bfd_link_check_relocs): Likewise.
160 (elf_x86_64_mkobject): Updated.
161 (elf_x86_64_link_hash_table_create): Likewise.
162 (elf_x86_64_check_tls_transition): Likewise.
163 (elf_x86_64_tls_transition): Likewise.
164 (elf_x86_64_convert_load_reloc): Likewise.
165 (elf_x86_64_check_relocs): Likewise.
166 (elf_x86_64_adjust_dynamic_symbol): Likewise.
167 (elf_x86_64_allocate_dynrelocs): Likewise.
168 (elf_x86_64_convert_load): Likewise.
169 (elf_x86_64_size_dynamic_sections): Likewise.
170 (elf_x86_64_relocate_section): Likewise.
171 (elf_x86_64_finish_dynamic_symbol ): Likewise.
172 (elf_x86_64_finish_dynamic_sections): Likewise.
173 (elf_x86_64_output_arch_local_syms): Likewise.
174 (elf_x86_64_get_synthetic_symtab): Likewise.
175 (elf_x86_64_link_setup_gnu_properties): Likewise.
176 (elf_x86_64_link_hash_table): Use elf_x86_link_hash_table,
177 instead of elf_link_hash_table, as base.
178 (elf_x86_64_next_tls_desc_index): New.
179 (elf_x86_64_srelplt2): Likewise.
180 (elf_x86_64_plt): Likewise.
181 (elf_x86_64_lazy_plt): Likewise.
182 (elf_x86_64_non_lazy_plt): Likewise.
183 * elfxx-x86.c: New file.
184 * elfxx-x86.h: Likewise.
185
823cb067
L
1862017-08-29 H.J. Lu <hongjiu.lu@intel.com>
187
188 * elf32-i386.c (elf_i386_get_synthetic_symtab): Simplify bad
189 return.
190 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
191
37c0b6ee
L
1922017-08-29 H.J. Lu <hongjiu.lu@intel.com>
193
194 * elf32-i386.c (elf_i386_get_synthetic_symtab): Check valid PLT
195 sections before checking dynamic relocations and free invalid
196 PLT section contents.
197 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
198
0fb0a767
L
1992017-08-28 H.J. Lu <hongjiu.lu@intel.com>
200
201 * elf-bfd.h (_bfd_elf_ifunc_get_synthetic_symtab): Removed.
202 * elf-ifunc.c (_bfd_elf_ifunc_get_synthetic_symtab): Likewise.
203
90efb642
L
2042017-08-28 H.J. Lu <hongjiu.lu@intel.com>
205
206 PR binutils/22018
207 * elf32-i386.c (elf_i386_get_synthetic_symtab): Check for valid
208 PLT section size.
209 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
210
596dc58f
L
2112017-08-27 H.J. Lu <hongjiu.lu@intel.com>
212
213 * elf32-i386.c (elf_i386_link_hash_newfunc): Initialize
214 def_protected.
215 * elf64-x86-64.c (elf_x86_64_link_hash_newfunc): Likewise.
216
a5b4ee94
L
2172017-08-26 H.J. Lu <hongjiu.lu@intel.com>
218
219 PR ld/21997
220 * elf-bfd.h (elf_obj_tdata): Use ENUM_BITFIELD on object_id,
221 dyn_lib_class and has_gnu_symbols. Change bad_symtab to bitfield.
222 Add a has_no_copy_on_protected bitfield.
223 (elf_has_no_copy_on_protected): New.
224 * elf-properties.c (_bfd_elf_parse_gnu_properties): Set
225 elf_has_no_copy_on_protected for GNU_PROPERTY_NO_COPY_ON_PROTECTED.
226 (elf_merge_gnu_property_list): Likewise.
227 (_bfd_elf_link_setup_gnu_properties): Set extern_protected_data
228 to FALSE for elf_has_no_copy_on_protected.
229 * elf32-i386.c (SYMBOL_NO_COPYRELOC): New.
230 (elf_i386_link_hash_entry): Add def_protected.
231 (elf_i386_adjust_dynamic_symbol): Also check SYMBOL_NO_COPYRELOC
232 when checking info->nocopyreloc.
233 (elf_i386_link_setup_gnu_properties): Don't set
234 extern_protected_data here.
235 (elf_i386_merge_symbol_attribute): New function.
236 (elf_backend_merge_symbol_attribute): New.
237 * elf64-x86-64.c (SYMBOL_NO_COPYRELOC): New.
238 (elf_x86_64_link_hash_entry): Add def_protected.
239 (elf_x86_64_need_pic): Report protected symbol for def_protected.
240 (elf_x86_64_adjust_dynamic_symbol): Also check SYMBOL_NO_COPYRELOC
241 when checking info->nocopyreloc.
242 (elf_x86_64_relocate_section): Also check for R_X86_64_PC32
243 relocation run-time overflow and unresolvable R_X86_64_32S
244 relocation against protected data symbol defined in shared object
245 with GNU_PROPERTY_NO_COPY_ON_PROTECTED.
246 (elf_x86_64_link_setup_gnu_properties): Don't set
247 extern_protected_data here.
248 (elf_x86_64_merge_symbol_attribute): New function.
249 (elf_backend_merge_symbol_attribute): New.
250
7c8bbca5
AM
2512017-08-26 Alan Modra <amodra@gmail.com>
252
253 * elf32-ppc.c (must_be_dyn_reloc): Use bfd_link_dll. Comment.
254 (ppc_elf_check_relocs): Only set DF_STATIC_TLS in shared libs.
255 (ppc_elf_relocate_section): Comment fix.
256 * elf64-ppc.c (must_be_dyn_reloc): Use bfd_link_dll. Comment.
257 (ppc64_elf_check_relocs): Only set DF_STATIC_TLS in shared libs.
258 Support dynamic relocs for TPREL16 when non-pic too.
259 (dec_dynrel_count): Adjust TPREL16 handling as per check_relocs.
260 (ppc64_elf_relocate_section): Support dynamic relocs for TPREL16
261 when non-pic too.
262
5fdda9d6
L
2632017-08-25 H.J. Lu <hongjiu.lu@intel.com>
264
265 * elf32-i386.c (elf_i386_link_hash_entry): Remove redundant
266 "symbol" in comments.
267 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Likewise.
268
7073b5b9
L
2692017-08-24 H.J. Lu <hongjiu.lu@intel.com>
270
271 PR ld/22001
272 * elf64-x86-64.c (elf_x86_64_relocate_section): Check for
273 R_X86_64_PC32 relocation run-time overflow and unresolvable
274 R_X86_64_32S relocation with -z nocopyreloc.
275
34bb2571
L
2762017-08-24 H.J. Lu <hongjiu.lu@intel.com>
277
278 * elf32-i386.c (elf_i386_check_relocs): Revert the last change.
279 Undefined symbols may not have a type.
280 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
281
aab921ad
L
2822017-08-23 H.J. Lu <hongjiu.lu@intel.com>
283
284 * elf64-x86-64.c (elf_x86_64_need_pic): Add an argument for
285 bfd_link_info. Report shared, PIE or PDE object based on
286 bfd_link_info.
287 (elf_x86_64_check_relocs): Update elf_x86_64_need_pic call.
288 (elf_x86_64_relocate_section): Likewise.
289
b1bb697e
L
2902017-08-23 H.J. Lu <hongjiu.lu@intel.com>
291
292 * elf32-i386.c (elf_i386_check_relocs): Increment PLT count only
293 for function symbols.
294 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
295
73784fa5
L
2962017-08-23 H.J. Lu <hongjiu.lu@intel.com>
297
298 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Set
299 extern_protected_data to FALSE if GNU_PROPERTY_NO_COPY_ON_PROTECTED
300 is set on any input relocatable file.
301 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Likewise.
302
46434633
AM
3032017-08-23 Alan Modra <amodra@gmail.com>
304
305 PR 21988
306 * elf64-ppc.c (ensure_undef_dynamic): Rename from
307 ensure_undefweak_dynamic. Handle undefined too.
308 * elf32-ppc.c (ensure_undef_dynamic): Likewise.
309 * elf32-hppa.c (ensure_undef_dynamic): Likewise.
310 (allocate_dynrelocs): Discard undefined non-default visibility
311 relocs first. Make undefined syms dynamic. Tidy goto.
312
487b6440
AM
3132017-08-21 Alan Modra <amodra@gmail.com>
314 H.J. Lu <hongjiu.lu@intel.com>
315
316 PR ld/21964
317 * elf-bfd.h (SYMBOLIC_BIND): Return TRUE for __start/__stop symbols.
318 * elflink.c (bfd_elf_define_start_stop): Rewrite.
319
284d826d
HPN
3202017-08-21 Hans-Peter Nilsson <hp@bitrange.com>
321
322 PR ld/20125
323 * elf64-mmix.c (mmix_elf_relax_section): Correct handling of
324 undefined weak symbols.
325
de259397
NC
3262017-08-18 Nick Clifton <nickc@redhat.com>
327
328 PR binutils/21962
329 * tekhex.c (getsym): Fix check for source pointer walking off the
330 end of the input buffer.
331
545bc2b3
SN
3322017-08-17 Szabolcs Nagy <szabolcs.nagy@arm.com>
333
334 PR ld/18808
335 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Skip IFUNC
336 relocations in debug sections, change abort to _bfd_error_handler.
337
0c54f692
NC
3382017-08-14 Nick Clifton <nickc@redhat.com>
339
340 PR 21957
341 * elf.c (setup_group): Check for an empty or very small group
342 section.
343 * po/bfd.pot: Regenerate.
344
79a94a2a
AM
3452017-08-14 Alan Modra <amodra@gmail.com>
346
347 PR 21441
348 * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Don't add
349 alignment padding here.
350 * elflink.c (bfd_elf_discard_info): Add .eh_frame padding here
351 in a reverse pass over sections.
352
98c5dfc9
L
3532017-08-11 H.J. Lu <hongjiu.lu@intel.com>
354
355 PR binutils/21943
356 * elf32-i386.c (elf_i386_get_synthetic_symtab): Allocate space
357 for @plt suffixes first.
358 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
359
24d3e51b
NC
3602017-08-08 Nick Clifton <nickc@redhat.com>
361
362 PR 21916
363 * elf-attrs.c (_bfd_elf_parse_attributes): Complain about very
364 small section lengths.
365 * elf.c (_bfd_elf_setup_sections): Skip empty entries in the group
366 table.
367 (elfcore_grok_freebsd_prstatus): Add checks to make sure that
368 there is enough data present in the note.
369
206c9c79
AM
3702017-08-08 Alan Modra <amodra@gmail.com>
371
372 PR 21017
373 * elf32-microblaze.c (microblaze_elf_check_relocs): Don't bump
374 got.refcount for GOTOFF relocs, just create .got section.
375
2980ccad
L
3762017-08-07 H.J. Lu <hongjiu.lu@intel.com>
377
378 * elflink.c (elf_link_add_object_symbols): Move common symbol
379 check after bed->common_definition.
380
b3293efa
AM
3812017-08-07 Alan Modra <amodra@gmail.com>
382
383 PR 21910
384 * elflink.c (bfd_elf_final_link): Don't segfault when sections
385 needed to define various dynamic tags have been discarded.
386
b7a18930
NC
3872017-08-07 Nick Clifton <nickc@redhat.com>
388
389 PR 21884
390 * elf32-i386.c (elf_i386_link_setup_gnu_properties): If the dynobj
391 has not been set then use the bfd returned by
392 _bfd_elf_link_setup_gnu_properties. If that is null then search
393 through all the input bfds selecting the first normal, ELF format
394 one.
395 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Likewise.
396
1d4af308
L
3972017-08-06 H.J. Lu <hongjiu.lu@intel.com>
398
399 * elf32-i386.c (elf_i386_link_hash_entry): Change tls_get_addr
400 to 1 bit.
401 (elf_i386_link_hash_newfunc): Initialize tls_get_addr to 0.
402 (elf_i386_check_tls_transition): Check tls_get_addr directly.
403 (elf_i386_convert_load_reloc): Update tls_get_addr check.
404 (elf_i386_link_check_relocs): New function.
405 (bfd_elf32_bfd_link_check_relocs): New.
406 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Change tls_get_addr
407 to 1 bit.
408 (elf_x86_64_link_hash_newfunc): Initialize tls_get_addr to 0.
409 (elf_x86_64_check_tls_transition): Check tls_get_addr directly.
410 (elf_x86_64_convert_load_reloc): Update tls_get_addr check.
411 (elf_x86_64_link_check_relocs): New function.
412 (bfd_elf64_bfd_link_check_relocs): New.
413 (bfd_elf32_bfd_link_check_relocs): Likewise.
414
a4819f54
L
4152017-08-06 H.J. Lu <hongjiu.lu@intel.com>
416
417 PR ld/21903:
418 * elflink.c (elf_link_add_object_symbols): Treat common symbol
419 as undefined for --no-define-common.
420
55ef6584
AM
4212017-08-05 Alan Modra <amodra@gmail.com>
422
423 * elf32-hppa.c (elf32_hppa_set_gp): Don't require an
424 hppa_link_hash_table.
425
d84ed528
MF
4262017-08-02 Max Filippov <jcmvbkbc@gmail.com>
427
428 * xtensa-isa.c (xtensa_isa_init): Don't update lookup table
429 entries for sysregs with negative indices.
430
1ef692ea
AK
4312017-08-01 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
432
433 * elf32-s390.c (elf_s390_finish_dynamic_sections): Skip if it
434 isn't the S/390 specific elf data.
435 * elf64-s390.c (elf_s390_finish_dynamic_sections): Likewise.
436
57593436
KLC
4372017-07-31 Kuan-Lin Chen <rufus@andestech.com>
438
439 * elfxx-riscv.c (riscv_elf_add_sub_reloc): New function.
440 * (howto_table) [R_RISCV_ADD8]: Use riscv_elf_add_sub_reloc.
441 [R_RISCV_ADD16]: Likewise.
442 [R_RISCV_ADD32]: Likewise.
443 [R_RISCV_ADD64]: Likewise.
444 [R_RISCV_SUB6]: Likewise.
445 [R_RISCV_SUB8]: Likewise.
446 [R_RISCV_SUB16]: Likewise.
447 [R_RISCV_SUB32]: Likewise.
448 [R_RISCV_SUB64]: Likewise.
449
d44c746a
AM
4502017-07-31 Alan Modra <amodra@gmail.com>
451
452 * elf64-ppc.c (ppc64_elf_tls_setup): Warn on --plt-localentry
453 without ld.so checks.
454
8b5f1ed8
AM
4552017-07-29 Alan Modra <amodra@gmail.com>
456
457 PR 21847
458 * elf64-ppc.c (struct ppc_link_hash_entry): Add non_zero_localentry.
459 (ppc64_elf_merge_symbol): Set non_zero_localentry.
460 (is_elfv2_localentry0): Test non_zero_localentry.
461 (ppc64_elf_tls_setup): Default to --no-plt-localentry.
462
894dde0b
AK
4632017-07-28 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
464
465 * elf32-s390.c (elf_s390_finish_dynamic_sections): Add NULL
466 pointer check for htab->elf.irelplt.
467 * elf64-s390.c (elf_s390_finish_dynamic_sections): Likewise.
468
8bdf0be1
NC
4692017-07-27 Nick Clifton <nickc@redhat.com>
470
471 PR 21840
472 * mach-o.c (bfd_mach_o_read_symtab_strtab): Fail if the symtab
473 size is -1.
474 * nlmcode.h (nlm_swap_auxiliary_headers_in): Replace assertion
475 with error return.
476 * section.c (bfd_make_section_with_flags): Fail if the name or bfd
477 are NULL.
478 * vms-alpha.c (bfd_make_section_with_flags): Correct computation
479 of end pointer.
480 (evax_bfd_print_emh): Check for invalid string lengths.
481
c26bb067
NC
4822017-07-25 Nick Clifton <nickc@redhat.com>
483
484 * po/fr.po: Updated French translation.
485
cfe7b9bd
BG
4862017-07-25 Benjamin Green <bengreen5mx@gmail.com>
487
488 PR 21824
489 * elf32-msp430.c (msp430_elf_relax_section): Allow conversion of
490 16-bit absolute branches into 10-bit pc-relative branches on the
491 MSP430 as well as the MSP430X.
492
d4aaa2a0
AM
4932017-07-25 Alan Modra <amodra@gmail.com>
494
495 * elf64-ppc.c (struct map_stub): Add tls_get_addr_opt_bctrl.
496 (stub_eh_frame_size): New function.
497 (ppc_size_one_stub): Set group tls_get_addr_opt_bctrl.
498 (group_sections): Init group tls_get_addr_opt_bctrl.
499 (ppc64_elf_size_stubs): Update sizing and initialization of
500 .eh_frame. Iteration over stubs via group list.
501 (ppc64_elf_build_stubs): Iterate over stubs via group list.
502 (ppc64_elf_finish_dynamic_sections): Update finalization of
503 .eh_frame.
504
ca4cf9b9
NC
5052017-07-24 Nick Clifton <nickc@redhat.com>
506
507 PR 21813
508 * mach-o.c (bfd_mach_o_canonicalize_relocs): Pass the base address
509 of the relocs to the canonicalize_one_reloc routine.
510 * mach-o.h (struct bfd_mach_o_backend_data): Update the prototype
511 for the _bfd_mach_o_canonicalize_one_reloc field.
512 * mach-o-arm.c (bfd_mach_o_arm_canonicalize_one_reloc): Add
513 res_base parameter. Use to check for corrupt pair relocs.
514 * mach-o-aarch64.c (bfd_mach_o_arm64_canonicalize_one_reloc):
515 Likewise.
516 * mach-o-i386.c (bfd_mach_o_i386_canonicalize_one_reloc):
517 Likewise.
518 * mach-o-x86-64.c (bfd_mach_o_x86_64_canonicalize_one_reloc):
519 Likewise.
520
521 * vms-alpha.c (_bfd_vms_slurp_eihd): Make sure that there is
522 enough data in the record before attempting to parse it.
523 (_bfd_vms_slurp_eeom): Likewise.
524
525 (_bfd_vms_slurp_egsd): Check for an invalid section index.
526 (image_set_ptr): Likewise.
527 (alpha_vms_slurp_relocs): Likewise.
528
8a2df5e2
NC
529 (alpha_vms_object_p): Check for a truncated record.
530
47aeb64c
NC
5312017-07-24 Nick Clifton <nickc@redhat.com>
532
533 PR 21803
534 * reloc.c (_bfd_unrecognized_reloc): New function. Reports
535 an unrecognized reloc and sets the bfd_error value.
536 * libbfd.h: Regenerate.
537 * elf32-arm.c (elf32_arm_final_link_relocate): Use the new
538 function.
539 * elf32-i386.c (elf_i386_relocate_section): Likewise.
540 * elf32-tilepro.c (tilepro_elf_relocate_section): Likewise.
541 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
542 * elfnn-aarch64.c (elfNN_aarch64_relocate_section): Likewise.
543 * elfxx-tilegx.c (tilegx_elf_relocate_section): Likewise.
544
15a3a14f
AM
5452017-07-23 Alan Modra <amodra@gmail.com>
546
547 * elf64-ppc.c (ppc64_elf_size_stubs): Correct advance to
548 restore of LR.
549
f2e6a843
SN
5502017-07-19 Szabolcs Nagy <szabolcs.nagy@arm.com>
551
552 PR ld/18841
553 * elfnn-aarch64.c (elfNN_aarch64_reloc_type_class): Return
554 reloc_class_ifunc for ifunc symbols.
555
909e4e71
NC
5562017-07-19 Nick Clifton <nickc@redhat.com>
557
558 PR 21787
559 * archive.c (bfd_generic_archive_p): If the bfd does not have the
560 correct magic bytes at the start, set the error to wrong format
561 and clear the format selector before returning NULL.
562
29866fa1
NC
5632017-07-19 Nick Clifton <nickc@redhat.com>
564
565 PR 21786
566 * coff-rs6000.c (_bfd_strntol): New function.
567 (_bfd_strntoll): New function.
568 (GET_VALUE_IN_FIELD): New macro.
569 (EQ_VALUE_IN_FIELD): new macro.
570 (_bfd_xcoff_slurp_armap): Use new macros.
571 (_bfd_xcoff_archive_p): Likewise.
572 (_bfd_xcoff_read_ar_hdr): Likewise.
573 (_bfd_xcoff_openr_next_archived_file): Likewise.
574 (_bfd_xcoff_stat_arch_elt): Likewise.
6c4e7b6b
NC
575 * coff64-rs6000.c (_bfd_strntol): New function.
576 (_bfd_strntoll): New function.
577 (GET_VALUE_IN_FIELD): New macro.
578 (xcoff64_slurp_armap): Use new macros.
29866fa1 579
684d5a10
JEM
5802017-07-19 Claudiu Zissulescu <claziss@synopsys.com>
581 John Eric Martin <John.Martin@emmicro-us.com>
582
583 * bfd-in2.h: Regenerate.
584 * libbfd.h: Regenerate.
585 * elf32-arc.c (JLI): Define.
586 * reloc.c: Add JLI relocations.
587
de194d85
YC
5882017-07-18 Nick Clifton <nickc@redhat.com>
589
590 PR 21775
591 * coff-sh.c: Fix spelling typos.
592 * compress.c: Likewise.
593 * cpu-pdp11.c: Likewise.
594 * ecofflink.c: Likewise.
595 * elf-m10300.c: Likewise.
596 * elf.c: Likewise.
597 * elf32-arm.c: Likewise.
598 * elf32-m68k.c: Likewise.
599 * elf32-nds32.c: Likewise.
600 * elf32-ppc.c: Likewise.
601 * elf32-sh.c: Likewise.
602 * elf32-v850.c: Likewise.
603 * elf64-ppc.c: Likewise.
604 * elf64-x86-64.c: Likewise.
605 * elflink.c: Likewise.
606 * elfnn-aarch64.c: Likewise.
607 * elfxx-mips.c: Likewise.
608 * som.c: Likewise.
609 * sunos.c: Likewise.
610 * vms-alpha.c: Likewise.
611 * xcofflink.c: Likewise.
612
e4e21d9e
NC
6132017-07-18 Nick Clifton <nickc@redhat.com>
614
615 PR binutils/21781
616 * coffcode.h (handle_COMDAT): Replace abort with an error message
617 and return.
618
8e85f840
L
6192017-07-17 H.J. Lu <hongjiu.lu@intel.com>
620
621 PR ld/21782
622 * elf64-x86-64.c (elf_x86_64_relocate_section): Limit PIC check
623 to shared library.
624
dd57c19c
L
6252017-07-17 H.J. Lu <hongjiu.lu@intel.com>
626
627 * elf64-x86-64.c (elf_x86_64_relocate_section): Re-indent.
628
676ee2b5
AM
6292017-07-16 Alan Modra <amodra@gmail.com>
630
631 * elf64-ppc.c (ppc64_elf_relocate_section): Don't optimize
632 __tls_index GOT entries when using __tls_get_addr_opt stub.
633 * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
634
429d795d
AM
6352017-07-12 Alan Modra <amodra@gmail.com>
636
637 * po/es.po: Update from translationproject.org/latest/bfd/.
638 * po/fi.po: Likewise.
639 * po/fr.po: Likewise.
640 * po/id.po: Likewise.
641 * po/ja.po: Likewise.
642 * po/ro.po: Likewise.
643 * po/ru.po: Likewise.
644 * po/sr.po: Likewise.
645 * po/sv.po: Likewise.
646 * po/tr.po: Likewise.
647 * po/uk.po: Likewise.
648 * po/vi.po: Likewise.
649 * po/zh_CN.po: Likewise.
650 * po/hr.po: New file from translationproject.org.
651 * configure.ac (ALL_LINGUAS): Add hr. Sort.
652 * configure: Regenerate.
653
0bae9e9e
NC
6542017-07-12 Nick Clifton <nickc@redhat.com>
655
656 Fix compile time warnings using gcc 7.1.1.
657 * elf32-xtensa.c (elf_xtensa_get_plt_section): Increase length of
658 plt_name buffer.
659 (elf_xtensa_get_gotplt_section): Increase length of got_name
660 buffer.
661 * mach-o-arm.c (bfd_mach_o_arm_canonicalize_one_reloc): Add a
662 default return of FALSE.
663 * mach-o-i386.c (bfd_mach_o_i386_canonicalize_one_reloc): Add a
664 default return of FALSE.
665
d42c267e
AM
6662017-07-12 Alan Modra <amodra@gmail.com>
667
668 * binary.c (binary_set_section_contents): Don't print filepos in
669 error message.
670 (coff_write_object_contents): Cast size_t for error message.
671 (coff_slurp_line_table): Don't use bfd_vma symndx.
672 (coff_slurp_reloc_table): Remove unneeded cast.
673 * dwarf2.c (read_section): Cast bfd_int64_t to long long for
674 error message.
675 (find_abstract_instance_name): Likewise.
676 * elf32-arm.c (arm_type_of_stub): Correct error arg order.
677 (bfd_elf32_arm_stm32l4xx_erratum_scan): Don't cast error arg.
678 (elf32_arm_check_relocs): Make r_symndx an int.
679 * elf32-cris.c (cris_elf_check_relocs): Delete extraneous %s in
680 format string.
681 * elf32-metag.c (elf_metag_relocate_section): Delete extra error
682 message arg.
683 * elf32-nds32.c (nds32_elf_ex9_build_hash_table): Rewrite bogus
684 error message.
685 * elf32-i386.c (elf_i386_check_relocs): Make r_symndx an int.
686 * elf32-s390.c (elf_s390_check_relocs): Likewise.
687 * elf32-tic6x.c (elf32_tic6x_check_relocs): Likewise.
688 * elf32-tilepro.c (tilepro_elf_check_relocs): Likewise.
689 * elf32-xtensa.c (elf_xtensa_check_relocs): Likewise.
690 * elf64-s390.c (elf_s390_check_relocs): Likewise.
691 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
692 * elfnn-aarch64.c (elfNN_aarch64_check_relocs): Likewise.
693 * elfnn-riscv.c (riscv_elf_check_relocs): Likewise.
694 * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Likewise.
695 * elfxx-tilegx.c (tilegx_elf_check_relocs): Likewise.
696 * elf64-mmix.c (_bfd_mmix_after_linker_allocation): Cast size_t args
697 and use %lu for error message.
698 * elflink.c (elf_link_adjust_relocs): Delete extra error message arg.
699 * mmo.c (mmo_scan): Make stab_loc a file_ptr. Cast expression for
700 error message.
701
702 * elf32-arm.c (elf32_arm_tls_relax): Correct format string and args
703 in error message.
704 (elf32_arm_final_link_relocate): Likewise.
705 * coff-arm.c (bfd_arm_process_before_allocation): Likewise.
706 * coffcode.h (styp_to_sec_flags): Likewise.
707 * cofflink.c (_bfd_coff_write_global_sym): Likewise.
708 * ecoff.c (_bfd_ecoff_slurp_symbol_table): Likewise.
709 * elf32-arc.c (arc_elf_merge_private_bfd_data): Likewise.
710 * elf32-bfin.c (bfinfdpic_check_relocs): Likewise.
711 (elf32_bfin_merge_private_bfd_data): Likewise.
712 * elf32-cris.c (cris_elf_relocate_section): Likewise.
713 * elf32-frv.c (frv_elf_merge_private_bfd_data): Likewise.
714 * elf32-i370.c (i370_elf_merge_private_bfd_data): Likewise.
715 (i370_elf_relocate_section): Likewise.
716 * elf32-iq2000.c (iq2000_elf_merge_private_bfd_data): Likewise.
717 * elf32-m32c.c (m32c_elf_merge_private_bfd_data): Likewise.
718 * elf32-m68hc1x.c (_bfd_m68hc11_elf_merge_private_bfd_data): Likewise.
719 * elf32-mcore.c (mcore_elf_relocate_section): Likewise.
720 * elf32-mep.c (mep_elf_merge_private_bfd_data): Likewise.
721 * elf32-mt.c (mt_elf_merge_private_bfd_data): Likewise.
722 * elf64-sparc.c (elf64_sparc_merge_private_bfd_data): Likewise.
723 * elfxx-mips.c (mips_elf_merge_obj_e_flags): Likewise.
724 (_bfd_mips_elf_merge_private_bfd_data): Likewise.
725 * ieee.c (ieee_write_id, read_id): Likewise.
726 * mach-o.c (bfd_mach_o_write_contents): Likewise.
727 (bfd_mach_o_layout_commands, bfd_mach_o_read_section_32): Likewise.
728 (bfd_mach_o_read_section_64, bfd_mach_o_read_symtab_symbol): Likewise.
729 (bfd_mach_o_read_command, bfd_mach_o_header_p): Likewise.
730 * peXXigen.c (_bfd_XXi_swap_aouthdr_in): Likewise.
731 * stabs.c (_bfd_link_section_stabs): Likewise.
732
733 * coff-arm.c (coff_arm_relocate_section): Use L modifier in error
734 format.
735 * coff-mcore.c (coff_mcore_relocate_section): Likewise.
736 * coff-ppc.c (coff_ppc_relocate_section): Likewise.
737 * coff-rs6000.c (xcoff_reloc_type_toc): Likewise.
738 * coff-sh.c (sh_relax_section): Likewise.
739 (sh_relax_delete_bytes, sh_swap_insns): Likewise.
740 * coff-tic80.c (coff_tic80_relocate_section): Likewise.
741 * coffcode.h (coff_slurp_reloc_table): Likewise.
742 * coffgen.c (_bfd_coff_get_external_symbols): Likewise.
743 (_bfd_coff_read_string_table): Likewise.
744 * cofflink.c (_bfd_coff_generic_relocate_section): Likewise.
745 * compress.c (bfd_get_full_section_contents): Likewise.
746 * dwarf2.c (read_formatted_entries, decode_line_info): Likewise.
747 * elf-m10300.c (mn10300_elf_relocate_section): Likewise.
748 * elf.c (bfd_elf_string_from_elf_section): Likewise.
749 * elf32-arc.c (arc_special_overflow_checks): Likewise.
750 * elf32-arm.c (elf32_arm_tls_relax): Likewise.
751 (elf32_arm_final_link_relocate, elf32_arm_relocate_section): Likewise.
752 (elf32_arm_write_section): Likewise.
753 * elf32-bfin.c (bfin_relocate_section): Likewise.
754 (bfinfdpic_relocate_section): Likewise.
755 * elf32-hppa.c (hppa_build_one_stub): Likewise.
756 (final_link_relocate, elf32_hppa_relocate_section): Likewise.
757 * elf32-i386.c (elf_i386_tls_transition): Likewise.
758 (elf_i386_relocate_section): Likewise.
759 * elf32-ip2k.c (ip2k_final_link_relocate): Likewise.
760 * elf32-lm32.c (lm32_elf_finish_dynamic_sections): Likewise.
761 * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
762 * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
763 * elf32-metag.c (elf_metag_relocate_section): Likewise.
764 * elf32-nds32.c (unrecognized_reloc_msg): Likewise.
765 (nds32_elf_relax_longcall1, nds32_elf_relax_longcall2): Likewise.
766 (nds32_elf_relax_longcall3, nds32_elf_relax_longjump1): Likewise.
767 (nds32_elf_relax_longjump2, nds32_elf_relax_longjump3): Likewise.
768 (nds32_elf_relax_longcall4, nds32_elf_relax_longcall5): Likewise.
769 (nds32_elf_relax_longcall6, nds32_elf_relax_longjump4): Likewise.
770 (nds32_elf_relax_longjump5, nds32_elf_relax_longjump6): Likewise.
771 (nds32_elf_relax_longjump7, nds32_elf_relax_loadstore): Likewise.
772 (nds32_elf_relax_ptr, nds32_elf_ex9_build_hash_table): Likewise.
773 * elf32-nios2.c (nios2_elf32_relocate_section): Likewise.
774 * elf32-rx.c (UNSAFE_FOR_PID): Likewise.
775 * elf32-s390.c (invalid_tls_insn, elf_s390_relocate_section): Likewise.
776 * elf32-score.c (s3_bfd_score_elf_check_relocs): Likewise.
777 * elf32-score7.c (s7_bfd_score_elf_check_relocs): Likewise.
778 * elf32-sh.c (sh_elf_relax_section): Likewise.
779 (sh_elf_relax_delete_bytes, sh_elf_swap_insns): Likewise.
780 (sh_elf_relocate_section): Likewise.
781 * elf32-sh64.c (shmedia_prepare_reloc): Likewise.
782 * elf32-spu.c (spu_elf_relocate_section): Likewise.
783 * elf32-tic6x.c (elf32_tic6x_relocate_section): Likewise.
784 * elf32-tilepro.c (tilepro_elf_relocate_section): Likewise.
785 * elf32-v850.c (v850_elf_relax_section): Likewise.
786 * elf32-vax.c (elf_vax_check_relocs): Likewise.
787 (elf_vax_relocate_section): Likewise.
788 * elf32-xtensa.c (elf_xtensa_relocate_section): Likewise.
789 (extend_ebb_bounds_forward, extend_ebb_bounds_backward): Likewise.
790 (compute_text_actions, compute_ebb_proposed_actions): Likewise.
791 (do_fix_for_relocatable_link): Likewise.
792 * elf64-alpha.c (elf64_alpha_relax_got_load): Likewise.
793 (elf64_alpha_relax_with_lituse): Likewise.
794 * elf64-hppa.c (elf64_hppa_finish_dynamic_symbol): Likewise.
795 (elf_hppa_final_link_relocate): Likewise.
796 * elf64-ia64-vms.c (elf64_ia64_relax_section): Likewise.
797 (elf64_ia64_choose_gp, elf64_ia64_relocate_section): Likewise.
798 (elf64_vms_link_add_object_symbols): Likewise.
799 * elf64-mmix.c (mmix_elf_perform_relocation): Likewise.
800 (mmix_final_link_relocate): Likewise.
801 * elf64-s390.c (invalid_tls_insn): Likewise.
802 (elf_s390_relocate_section): Likewise.
803 * elf64-sh64.c (sh_elf64_relocate_section): Likewise.
804 * elf64-x86-64.c (elf_x86_64_tls_transition): Likewise.
805 (elf_x86_64_relocate_section): Likewise.
806 * elfcode.h (elf_slurp_symbol_table): Likewise.
807 * elfcore.h (elf_core_file_p): Likewise.
808 * elflink.c (elf_link_read_relocs_from_section): Likewise.
809 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Likewise.
810 (elfNN_aarch64_relocate_section): Likewise.
811 * elfnn-ia64.c (elfNN_ia64_relax_section): Likewise.
812 (elfNN_ia64_choose_gp, elfNN_ia64_relocate_section): Likewise.
813 * elfnn-riscv.c (riscv_elf_relocate_section): Likewise.
814 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
815 (_bfd_mips_elf_relocate_section): Likewise.
816 (_bfd_mips_elf_finish_dynamic_symbol, mips_finish_exec_plt): Likewise.
817 * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Likewise.
818 * elfxx-tilegx.c (tilegx_elf_relocate_section): Likewise.
819 * ieee.c (ieee_slurp_external_symbols): Likewise.
820 * ihex.c (ihex_write_object_content): Likewise.
821 * mach-o.c (bfd_mach_o_build_exec_seg_command): Likewise.
822 * merge.c (_bfd_merged_section_offset): Likewise.
823 * mmo.c (mmo_write_loc_chunk): Likewise.
824 (mmo_write_object_contents): Likewise.
825 * peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Likewise.
826 * stabs.c (_bfd_link_section_stabs): Likewise.
827 * xcofflink.c (xcoff_link_add_symbols, xcoff_find_tc0): Likewise.
828
e3fbc3da
AM
8292017-07-11 Alan Modra <amodra@gmail.com>
830
831 * elf32-ppc.c (ppc_elf_relocate_section): Fix typo.
832
2c4d9cbe
AM
8332017-07-11 Alan Modra <amodra@gmail.com>
834
835 * elf32-ppc.c (ppc_elf_relocate_section): Emit "unexpected
836 instruction" error using _bfd_error_handler, not einfo.
837
adce5b39
NC
8382017-07-10 Nick Clifton <nickc@redhat.com>
839
840 * coffcode.h (coff_slurp_symbol_table): Do not include an entry
841 for C_AIX_WEAKEXT if it has the same value as C_WEAKEXT.
842
e6f3b9c3
JB
8432017-07-07 John Baldwin <jhb@FreeBSD.org>
844
845 * elf.c (elfcore_grok_freebsd_note): Handle NT_FREEBSD_PTLWPINFO.
846
532cc313
AM
8472017-07-07 Alan Modra <amodra@gmail.com>
848
849 * coffcode.h (coff_slurp_symbol_table): Handle C_AIX_WEAKEXT.
850
1cf9552b
AM
8512017-07-07 Alan Modra <amodra@gmail.com>
852
853 * bfd.c (_doprnt): Replace "L" with "ll" when printing bfd_vma
854 as long long. Move code replacing "ll" with "I64", and simplify.
855
a0b7b105
L
8562017-07-06 H.J. Lu <hongjiu.lu@intel.com>
857
858 * bfd.c (_doprnt): Convert 'L' to 'l' when setting wide_width
859 to 1.
860
1d827a72
L
8612017-07-05 H.J. Lu <hongjiu.lu@intel.com>
862
863 * dwarf2.c (line_info_add_include_dir_stub): Replace time with
864 xtime.
865 (line_info_add_file_name): Likewise.
866 (decode_line_info): Likewise.
867
0d702cfe
TG
8682017-07-04 Tristan Gingold <gingold@adacore.com>
869
870 * version.m4: Bump version to 2.29.51
871 * configure: Regenerate.
872
564e46b7
JW
8732017-07-04 Jiong Wang <jiong.wang@arm.com>
874
875 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Remove the
876 sanity check at the head of this function.
877
0041f7df
JK
8782017-07-04 Jan Kratochvil <jan.kratochvil@redhat.com>
879
880 * dwarf2.c (struct dwarf2_debug): Add fields dwarf_line_str_buffer and
881 dwarf_line_str_size.
882 (struct attr_abbrev): Add field implicit_const.
883 (dwarf_debug_sections): Add .debug_line_str.
884 (enum dwarf_debug_section_enum): Add debug_line_str and debug_max.
885 (dwarf_debug_section_assert): Add static assertion.
886 (read_indirect_line_string): New.
887 (read_abbrevs): Support DW_FORM_implicit_const.
888 (is_str_attr): Support DW_FORM_line_strp.
889 (read_attribute_value): Support DW_FORM_line_strp and
890 DW_FORM_implicit_const.
891 (read_attribute): Support DW_FORM_implicit_const.
892 (line_info_add_include_dir, line_info_add_include_dir_stub):
893 (line_info_add_file_name, read_formatted_entries): New.
894 (decode_line_info, parse_comp_unit): Support DWARF 5.
895 (_bfd_dwarf2_cleanup_debug_info): Free dwarf_line_str_buffer.
896
d8cd8c1f
EB
8972017-07-03 Egeyar Bagcioglu <egeyar.bagcioglu@oracle.com>
898
899 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Remove the
900 abort statement that was put for symbols that are not dynamic.
901
15e6ed8c
TG
9022017-07-03 Tristan Gingold <gingold@adacore.com>
903
904 * po/bfd.pot: Regenerate
905
76cfced5
AM
9062017-07-03 Alan Modra <amodra@gmail.com>
907
908 * bfd.c (_doprnt): Rewrite "ll" and "L" modifiers to "I64" for
909 __MSVCRT__. Support "L" modifier for bfd_vma. Formatting.
910 * elf.c (setup_group): Use "Lx" to print sh_size.
911 (_bfd_elf_setup_sections): Remove unnecessary cast and print
912 unknown section type in hex.
913 (copy_special_section_fields): Style fix.
914 (bfd_section_from_shdr): Correct format for sh_link. Use a
915 common error message for all the variants of unrecognized
916 section types.
917 (assign_file_positions_for_load_sections): Use "Lx" for lma
918 adjust error message.
919 (assign_file_positions_for_non_load_sections): Formatting.
920 (rewrite_elf_program_header): Formatting. Use "Lx" for
921 bfd_vma values in error messages.
922 * elfcode.h (elf_slurp_reloc_table_from_section): Cast
923 ELF_R_SYM value to type expected by format.
924 * elflink.c (elf_link_read_relocs_from_section): Use "Lx"
925 in error messages.
926 (elf_link_add_object_symbols): Use "Lu" for symbol sizes.
927 (elf_link_input_bfd): Use "Lx" for r_info.
928 (bfd_elf_gc_record_vtinherit): Use "Lx" for offset.
929
ce9116fd
AM
9302017-07-03 Alan Modra <amodra@gmail.com>
931
932 * bfd.c (bfd_scan_vma): Don't use long long unless HAVE_LONG_LONG.
933 * coff-rs6000.c (FMT20): Handle hosts with 64-bit long and
934 Microsoft C library variant of long long format specifier.
935 (PRINT20): Cast value to bfd_uint64_t not long long.
936 * coffcode.h (coff_print_aux): Use BFD_VMA_FMT.
937 * coff-x86_64.c (coff_amd64_reloc): Use bfd_uint64_t rather than
938 long long. Don't cast to bfd_vma.
939 * elf32-score.c (score3_bfd_getl48): Likewise.
940 * vms-alpha.c (_bfd_vms_slurp_eisd): Likewise.
941
cd9af601
AM
9422017-07-03 Alan Modra <amodra@gmail.com>
943
944 * elf.c (_bfd_elf_print_private_bfd_data): Use BFD_VMA_FMT to
945 print d_tag.
946 (bfd_elf_print_symbol): Don't cast symbol->flags.
947 (_bfd_elf_symbol_from_bfd_symbol): Likewise.
948 * elf32-ppc.c (ppc_elf_begin_write_processing): Correct
949 _bfd_error_handler argument order.
950 (ppc_elf_merge_private_bfd_data): Don't cast flags.
951
33c734b2
AM
9522017-07-03 Alan Modra <amodra@gmail.com>
953
954 * configure.ac: Invoke AC_CHECK_TYPES for long long. Invoke
955 AC_TYPE_LONG_DOUBLE.
956 * configure: Regenerate.
957 * config.in: Regenerate.
958
3df5cd13
AW
9592017-06-29 Andrew Waterman <andrew@sifive.com>
960
961 * elfnn-riscv.c (riscv_elf_adjust_dynamic_symbol): Fix TLS copy
962 relocs.
963
ec1acaba
EB
9642017-06-29 Egeyar Bagcioglu <egeyar.bagcioglu@oracle.com>
965
966 * elfxx-sparc.c (allocate_dynrelocs): Don't make a symbol dynamic
967 unless it is undefined weak.
968 * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Set the flag
969 relative_reloc to direct non-dynamic symbols to R_SPARC_RELATIVE
970 relocation.
971 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): If symbol
972 is not dynamic in PIC, abort.
973
ff07562f
JW
9742017-06-29 Jiong Wang <jiong.wang@arm.com>
975
976 PR ld/21402
977 * elfnn-aarch64.c (elfNN_aarch64_allocate_dynrelocs): Only make
978 undefined weak symbols into dynamic.
979 (elfNN_aarch64_final_link_relocate): Generate runtime RELATIVE
980 relocation for non-dynamic symbols.
981 (elfNN_aarch64_finish_dynamic_symbol): Add sanity check.
982
2aff25ba
JW
9832017-06-29 Jiong Wang <jiong.wang@arm.com>
984
985 * elfnn-aarch64.c (aarch64_relocation_aginst_gp_p): New function.
986 (elfNN_aarch64_final_link_relocate): Delete duplicated code for
987 BFD_RELOC_AARCH64_LD64_GOTOFF_LO15, BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC,
988 BFD_RELOC_AARCH64_MOVW_GOTOFF_G1.
989 * elfxx-aarch64.c (_bfd_aarch64_elf_resolve_relocation): Optimize the
990 support for them.
991
88ab90e8
AA
9922017-06-29 Andreas Arnez <arnez@linux.vnet.ibm.com>
993
994 * elf-bfd.h (elfcore_write_s390_gs_cb): Add prototype.
995 (elfcore_write_s390_gs_bc): Likewise.
996 * elf.c (elfcore_grok_s390_gs_cb): New function.
997 (elfcore_grok_s390_gs_bc): New function.
998 (elfcore_grok_note): Call them.
999 (elfcore_write_s390_gs_cb): New function.
1000 (elfcore_write_s390_gs_bc): New function.
1001 (elfcore_write_register_note): Call them.
1002
328ce951
L
10032017-06-28 H.J. Lu <hongjiu.lu@intel.com>
1004
1005 * libbfd.c (_bfd_generic_get_section_contents): Don't call
1006 bfd_get_file_size. Check archive element size.
1007 (_bfd_generic_get_section_contents_in_window): Likewise.
1008
47fdcf63
L
10092017-06-28 H.J. Lu <hongjiu.lu@intel.com>
1010
1011 * bfd-in2.h: Regenerated.
1012 * bfdio.c (bfd_get_size): Change return type to ufile_ptr.
1013 (bfd_get_file_size): Likewise.
1014
38bf472a
MR
10152017-06-28 Maciej W. Rozycki <macro@imgtec.com>
1016 Matthew Fortune <matthew.fortune@imgtec.com>
1017
1018 * archures.c (bfd_mach_mips_interaptiv_mr2): New macro.
1019 * cpu-mips.c (I_interaptiv_mr2): New enum value.
1020 (arch_info_struct): Add "mips:interaptiv-mr2" entry.
1021 * elfxx-mips.c (_bfd_elf_mips_mach) <E_MIPS_MACH_IAMR2>: New
1022 case.
1023 (mips_set_isa_flags) <bfd_mach_mips_interaptiv_mr2>: Likewise.
1024 (bfd_mips_isa_ext) <bfd_mach_mips_interaptiv_mr2>: Likewise.
1025 (print_mips_isa_ext) <AFL_EXT_INTERAPTIV_MR2>: Likewise.
1026 (mips_mach_extensions): Add `bfd_mach_mipsisa32r3' and
1027 `bfd_mach_mips_interaptiv_mr2' entries.
1028 * bfd-in2.h: Regenerate.
1029
2d68166e
NC
10302017-06-27 Nick Clifton <nickc@redhat.com>
1031
1032 * tekhex.c (pass_over): Revert accidental conversion of a local
1033 array to a static array.
1034
68063779
SKS
10352017-06-27 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
1036
1037 PR ld/13402
1038 * elf32-avr.c (elf32_avr_adjust_diff_reloc_value): Adjust
1039 reloc addend if necessary. Adjust diff only if
1040 shrinked_insn_address < end_address.
1041
ea9aafc4
AM
10422017-06-27 Alan Modra <amodra@gmail.com>
1043
1044 PR binutils/21665
1045 * libbfd.c (_bfd_generic_get_section_contents): Warning fix.
1046 (_bfd_generic_get_section_contents_in_window): Likewise.
1047
a6cbf936
KLC
10482017-06-26 Kuan-Lin Chen <rufus@andestech.com>
1049
1050 * elfnn-riscv.c (perform_relocation): Support the new
1051 R_RISCV_32_PCREL relocation.
1052 (riscv_elf_relocate_section): Likewise.
1053 * elfxx-riscv.c (howto_table): Likewise.
1054 (riscv_reloc_map): Likewise.
1055 * bfd-in2.h (BFD_RELOC_RISCV_32_PCREL): New relocation.
1056 * libbfd.h: Regenerate.
1057
7211ae50
AM
10582017-06-27 Alan Modra <amodra@gmail.com>
1059
1060 PR binutils/21665
1061 * libbfd.c (_bfd_generic_get_section_contents): Delete abort.
1062 Use unsigned file pointer type, and remove cast.
1063 * libbfd.c (_bfd_generic_get_section_contents_in_window): Likewise.
1064 Add "count", not "sz".
1065
ab27f80c
PA
10662017-06-26 Pedro Alves <palves@redhat.com>
1067
1068 PR binutils/21665
1069 * libbfd.c (_bfd_generic_get_section_contents): Add "count", not
1070 "sz".
1071
1f473e3d
L
10722017-06-26 H.J. Lu <hongjiu.lu@intel.com>
1073
1074 PR binutils/21665
1075 * libbfd.c (_bfd_generic_get_section_contents_in_window): Add
1076 a missing line.
1077
b417536f
MR
10782017-06-26 Maciej W. Rozycki <macro@imgtec.com>
1079
1080 * cpu-mips.c (arch_info_struct): Mark the 4010 32-bit.
1081 * elfxx-mips.c (mips_set_isa_flags) <bfd_mach_mips4010>: Set
1082 E_MIPS_ARCH_2 rather than E_MIPS_ARCH_3 in `e_flags'.
1083 (mips_mach_extensions): Mark `bfd_mach_mips4010' as extending
1084 `bfd_mach_mips6000' rather than `bfd_mach_mips4000'.
1085
0630b49c
L
10862017-06-26 H.J. Lu <hongjiu.lu@intel.com>
1087
1088 PR binutils/21665
1089 * compress.c (bfd_get_full_section_contents): Don't check the
1090 file size here.
1091 * libbfd.c (_bfd_generic_get_section_contents): Check for and
ea9aafc4 1092 reject a section whose size + offset is greater than the size
0630b49c
L
1093 of the entire file.
1094 (_bfd_generic_get_section_contents_in_window): Likewise.
515a4464 1095
04e15b4a
NC
10962017-06-26 Nick Clifton <nickc@redhat.com>
1097
1098 PR binutils/21670
1099 * tekhex.c (getvalue): Check for the source pointer exceeding the
1100 end pointer before the first byte is read.
1101
cfd14a50
NC
11022017-06-26 Nick Clifton <nickc@redhat.com>
1103
1104 PR binutils/21665
ea9aafc4 1105 * opncls.c (get_build_id): Check that the section is big enough
cfd14a50
NC
1106 to contain the whole note.
1107 * compress.c (bfd_get_full_section_contents): Check for and reject
ea9aafc4 1108 a section whose size is greater than the size of the entire file.
cfd14a50
NC
1109 * elf32-v850.c (v850_elf_copy_notes): Allow for the ouput to not
1110 contain a notes section.
1111
93ec5e23
AK
11122017-06-26 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
1113
1114 * elf64-s390.c (elf_s390_additional_program_headers): Add NULL
1115 pointer checks.
1116 (elf_s390_modify_segment_map): Likewise.
1117 (bfd_elf_s390_set_options): Lisewise.
1118
57963c05
AM
11192017-06-26 Alan Modra <amodra@gmail.com>
1120
1121 * elflink.c (_bfd_elf_link_create_dynstrtab): Don't make dynobj
1122 a --just-syms bfd.
1123 (_bfd_elf_size_group_sections): Skip --just-syms bfds.
1124 (bfd_elf_size_dynamic_sections): Ignore .note.GNU-stack and
1125 .preinit_array on --just-syms bfds.
1126 (_bfd_elf_gc_mark_extra_sections): Skip --just-syms bfds.
1127 (elf_gc_sweep, bfd_elf_parse_eh_frame_entries): Likewise.
1128 (bfd_elf_gc_sections, bfd_elf_discard_info): Likewise.
1129
5cc4ca83
ST
11302017-06-25 Sergei Trofimovich <slyfox@gentoo.org>
1131
1132 * elf.c (find_link): Bounds check "hint".
1133
bff0500d
TP
11342017-06-24 Thomas Preud'homme <thomas.preudhomme@arm.com>
1135
1136 * elf32-arm.c (using_thumb_only): Update list of architectures in
1137 BFD_ASSERT for which the logic is valid.
1138 (using_thumb2_bl): Likewise.
1139 (using_thumb2): Likewise and return true for ARMv8-R.
1140 (arch_has_arm_nop): Likewise.
1141 (tag_cpu_arch_combine): New v8r table for ARMv8-R Tag_CPU_arch
1142 merging logic. Update commentis for value 15 of v8m_baseline,
1143 v8m_mainline and v4t_plus_v6_m arrays. Use v8r array to decide
1144 merging of value 15 of Tag_CPU_arch.
1145
4aa57d6a
JW
11462017-06-23 Jiong Wang <jiong.wang@arm.com>
1147
1148 * reloc.c (BFD_RELOC_AARCH64_ADR_GOTPAGE): Rename to
1149 BFD_RELOC_AARCH64_ADR_GOT_PAGE
1150 * bfd-in2.h: Regenerate.
1151
5d8763a3
L
11522017-06-22 H.J. Lu <hongjiu.lu@intel.com>
1153
1154 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Move
1155 the error_alignment label forward. Properly align program
1156 property note section.
1157
e652757b
EC
11582017-06-22 Eric Christopher <echristo@gmail.com>
1159
1160 * elf32-arm.c (elf32_arm_final_link_relocate): Use labs rather than
1161 abs to fix a truncation warning.
1162
84da4cf8
L
11632017-06-22 H.J. Lu <hongjiu.lu@intel.com>
1164
1165 * elf32-i386.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Resolve
1166 local undefined weak symbol to 0.
1167 * elf64-x86-64.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Likewise.
1168
48580982
L
11692017-06-22 H.J. Lu <hongjiu.lu@intel.com>
1170
1171 * elf32-i386.c (elf_i386_merge_gnu_properties): If info->shstk
1172 is set, turn on GNU_PROPERTY_X86_FEATURE_1_SHSTK.
1173 (elf_i386_link_setup_gnu_properties): If info->shstk is set,
1174 turn on GNU_PROPERTY_X86_FEATURE_1_IBT.
1175 * elf64-x86-64.c (elf_x86_64_merge_gnu_properties): If
1176 info->shstk is set, turn on GNU_PROPERTY_X86_FEATURE_1_SHSTK.
1177 (elf_x86_64_link_setup_gnu_properties): If info->shstk is set,
1178 turn on GNU_PROPERTY_X86_FEATURE_1_IBT.
1179
ee2fdd6f
L
11802017-06-22 H.J. Lu <hongjiu.lu@intel.com>
1181
1182 * elf32-i386.c (elf_i386_lazy_ibt_plt0_entry): New.
1183 (elf_i386_lazy_ibt_plt_entry): Likewise.
1184 (elf_i386_pic_lazy_ibt_plt0_entry): Likewise.
1185 (elf_i386_non_lazy_ibt_plt_entry): Likewise.
1186 (elf_i386_pic_non_lazy_ibt_plt_entry): Likewise.
1187 (elf_i386_eh_frame_lazy_ibt_plt): Likewise.
1188 (elf_i386_lazy_plt_layout): Likewise.
1189 (elf_i386_non_lazy_plt_layout): Likewise.
1190 (elf_i386_link_hash_entry): Add plt_second.
1191 (elf_i386_link_hash_table): Add plt_second and
1192 plt_second_eh_frame.
1193 (elf_i386_allocate_dynrelocs): Use the second PLT if needed.
1194 (elf_i386_size_dynamic_sections): Use .plt.got unwind info for
1195 the second PLT. Check the second PLT.
1196 (elf_i386_relocate_section): Use the second PLT to resolve
1197 PLT reference if needed.
1198 (elf_i386_finish_dynamic_symbol): Fill and use the second PLT if
1199 needed.
1200 (elf_i386_finish_dynamic_sections): Set sh_entsize on the
1201 second PLT. Generate unwind info for the second PLT.
1202 (elf_i386_plt_type): Add plt_second.
1203 (elf_i386_get_synthetic_symtab): Support the second PLT.
1204 (elf_i386_parse_gnu_properties): Support
1205 GNU_PROPERTY_X86_FEATURE_1_AND.
1206 (elf_i386_merge_gnu_properties): Support
1207 GNU_PROPERTY_X86_FEATURE_1_AND. If info->ibt is set, turn
1208 on GNU_PROPERTY_X86_FEATURE_1_IBT
1209 (elf_i386_link_setup_gnu_properties): If info->ibt is set,
1210 turn on GNU_PROPERTY_X86_FEATURE_1_IBT. Use IBT-enabled PLT
1211 for info->ibtplt, info->ibt or GNU_PROPERTY_X86_FEATURE_1_IBT
1212 is set on all relocatable inputs.
1213 * elf64-x86-64.c (elf_x86_64_lazy_ibt_plt_entry): New.
1214 (elf_x32_lazy_ibt_plt_entry): Likewise.
1215 (elf_x86_64_non_lazy_ibt_plt_entry): Likewise.
1216 (elf_x32_non_lazy_ibt_plt_entry): Likewise.
1217 (elf_x86_64_eh_frame_lazy_ibt_plt): Likewise.
1218 (elf_x32_eh_frame_lazy_ibt_plt): Likewise.
1219 (elf_x86_64_lazy_ibt_plt): Likewise.
1220 (elf_x32_lazy_ibt_plt): Likewise.
1221 (elf_x86_64_non_lazy_ibt_plt): Likewise.
1222 (elf_x32_non_lazy_ibt_plt): Likewise.
1223 (elf_x86_64_get_synthetic_symtab): Support the second PLT.
1224 (elf_x86_64_parse_gnu_properties): Support
1225 GNU_PROPERTY_X86_FEATURE_1_AND.
1226 (elf_x86_64_merge_gnu_properties): Support
1227 GNU_PROPERTY_X86_FEATURE_1_AND. If info->ibt is set, turn
1228 on GNU_PROPERTY_X86_FEATURE_1_IBT
1229 (elf_x86_64_link_setup_gnu_properties): If info->ibt is set,
1230 turn on GNU_PROPERTY_X86_FEATURE_1_IBT. Use IBT-enabled PLT
1231 for info->ibtplt, info->ibt or GNU_PROPERTY_X86_FEATURE_1_IBT
1232 is set on all relocatable inputs.
1233
d19237d9
NC
12342017-06-22 Nick Clifton <nickc@redhat.com>
1235
1236 PR binutils/21649
1237 * som.c (setup_sections): NUL terminate the space_strings buffer.
1238 Check that the space.name field does not index beyond the end of
1239 the space_strings buffer.
1240
6879f5a9
NC
12412017-06-21 Nick Clifton <nickc@redhat.com>
1242
1243 PR binutils/21646
1244 * coff-sh.c (sh_reloc): Check for an out of range reloc.
1245
7adc0a81
NC
12462017-06-21 Nick Clifton <nickc@redhat.com>
1247
1248 PR binutils/21639
1249 * vms-misc.c (_bfd_vms_save_sized_string): Use unsigned int as
1250 type of the size parameter.
1251 (_bfd_vms_save_counted_string): Add second parameter - the maximum
1252 length of the counted string.
1253 * vms.h (_bfd_vms_save_sized_string): Update prototype.
1254 (_bfd_vms_save_counted_string): Likewise.
1255 * vms-alpha.c (_bfd_vms_slurp_eisd): Update calls to
1256 _bfd_vms_save_counted_string.
1257 (_bfd_vms_slurp_ehdr): Likewise.
1258 (_bfd_vms_slurp_egsd): Likewise.
1259 (Parse_module): Likewise.
1260
6e1816be
AM
12612017-06-21 Alan Modra <amodra@gmail.com>
1262
1263 * elf64-ppc.c (ppc64_elf_size_stubs): Test for localentry:0 plt
1264 calls before tocsave calls.
1265 (ppc64_elf_relocate_section): Allow localentry:0 plt calls without
1266 following nop.
1267
20bd1b6b
NC
12682017-06-21 Nick Clifton <nickc@redhat.com>
1269
1270 PR binutils/21645
1271 * reloc.c (bfd_generic_get_relocated_section_contents): Fail if
1272 bfd_get_full_section_contents returns no contents.
1273
3de58d95
NC
12742017-06-21 Nick Clifton <nickc@redhat.com>
1275
1276 PR binutils/21638
1277 * vms-alpha.c (_bfd_vms_slurp_egsd): Check for an undersized
1278 record.
1279
cb06d03a
NC
12802017-06-21 Nick Clifton <nickc@redhat.com>
1281
1282 PR binutils/21637
1283 * vms-alpha.c (_bfd_vms_slurp_egsd): Check for an empty section
1284 list.
1285 (image_set_ptr): Likewise.
1286 (alpha_vms_fix_sec_rel): Likewise.
1287 (alpha_vms_slurp_relocs): Likewise.
1288
c458d007
NC
12892017-06-21 Nick Clifton <nickc@redhat.com>
1290
1291 PR binutils/21633
1292 * ieee.c (ieee_slurp_sections): Check for a NULL return from
1293 read_id.
1294 (ieee_archive_p): Likewise.
1295 (ieee_object_p): Likewise.
1296
ce497010
NC
12972017-06-21 Nick Clifton <nickc@redhat.com>
1298
1299 PR binutils/21640
1300 * elf.c (setup_group): Zero the group section pointer list after
1301 allocation so that loops can be caught. Check for NULL pointers
1302 when processing a group list.
1303
fd52715c
AK
13042017-06-20 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
1305
1306 * elf-s390.h: New file.
1307 * elf64-s390.c (struct elf_s390_link_hash_table): Add params
1308 field.
1309 (elf_s390_additional_program_headers): New function.
1310 (elf_s390_modify_segment_map): New function.
1311 (bfd_elf_s390_set_options): New function.
1312 (elf_backend_additional_program_headers)
1313 (elf_backend_modify_segment_map): Add macro definitions.
1314
abfa390d
L
13152017-06-19 H.J. Lu <hongjiu.lu@intel.com>
1316
1317 PR ld/21626
1318 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Check
1319 the DYNAMIC bit instead of bfd_count_sections.
1320
bc21b167
NC
13212017-06-19 Nick Clifton <nickc@redhat.com>
1322
1323 PR binutils/21618
1324 * vms-alpha.c (evax_bfd_print_emh): Check for insufficient record
1325 length.
1326 (evax_bfd_print_eeom): Likewise.
1327 (evax_bfd_print_egsd): Check for an overlarge record length.
1328 (evax_bfd_print_etir): Likewise.
1329
acb56a83
NC
13302017-06-19 Nick Clifton <nickc@redhat.com>
1331
1332 PR binutils/21612
1333 * libieee.h (struct common_header_type): Add end_p field.
1334 * ieee.c (this_byte_and_next): Do not advance input_p beyond
1335 end_p.
1336 (read_id): Check for a length that exceeds the remaining bytes in
1337 the input buffer.
1338 (ieee_seek): Initialise end_p.
1339 (ieee_archive_p): Likewise.
1340 (ieee_object_p): Likewise.
1341
72e84f96
NC
13422017-06-19 Nick Clifton <nickc@redhat.com>
1343
80053e46
NC
1344 PR binutils/21611
1345 * vms-alpha.c (_bfd_vms_slurp_eihs): Check for invalid offset
1346 before reading the EIHS structure entries.
1347
13482017-06-19 Nick Clifton <nickc@redhat.com>
1349
1350 PR binutils/21615
72e84f96
NC
1351 * vms-alpha.c (_bfd_vms_slurp_egsd): Use unsigned int for
1352 gsd_size. Check that there are enough bytes remaining to read the
1353 type and size of the next egsd. Check that the size of the egsd
1354 does not exceed the size of the record.
1355
875ffa3e
AM
13562017-06-19 Alan Modra <amodra@gmail.com>
1357
1358 * config.bfd: Correct targ_underscore for cris.
1359
bdd32e03
AM
13602017-06-18 Alan Modra <amodra@gmail.com>
1361
1362 * config.bfd: Correct targ_underscore for epiphany, ip2k,
1363 m32c, mn10200, pru, rl78, rx, crisv32 and v850.
1364
4b48e2f6
NC
13652017-06-16 Nick Clifton <nickc@redhat.com>
1366
1367 * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Do not fail if the
1368 bucketlist is empty because there are no symbols to add to the
1369 list.
1370
7dba9362
AM
13712017-06-16 Alan Modra <amodra@gmail.com>
1372
1373 PR ld/20022
1374 PR ld/21557
1375 PR ld/21562
1376 PR ld/21571
1377 * targets.c (struct bfd_target): Add _bfd_define_start_stop.
1378 (BFD_JUMP_TABLE_LINK): Likewise.
1379 * elf-bfd.h (bfd_elf_define_start_stop): Declare.
1380 * elflink.c (_bfd_elf_gc_mark_rsec): Update comment.
1381 (bfd_elf_define_start_stop): New function.
1382 * linker.c (bfd_generic_define_start_stop): New function.
1383 * coff64-rs6000.c (rs6000_xcoff64_vec, rs6000_xcoff64_aix_vec): Init
1384 new field.
1385 * aout-adobe.c (aout_32_bfd_define_start_stop): Define.
1386 * aout-target.h (MY_bfd_define_start_stop): Define.
1387 * aout-tic30.c (MY_bfd_define_start_stop): Define.
1388 * binary.c (binary_bfd_define_start_stop): Define.
1389 * bout.c (b_out_bfd_define_start_stop): Define.
1390 * coff-alpha.c (_bfd_ecoff_bfd_define_start_stop): Define.
1391 * coff-mips.c (_bfd_ecoff_bfd_define_start_stop): Define.
1392 * coff-rs6000.c (_bfd_xcoff_bfd_define_start_stop): Define.
1393 * coffcode.h (coff_bfd_define_start_stop): Define.
1394 * elfxx-target.h (bfd_elfNN_bfd_define_start_stop): Define.
1395 * i386msdos.c (msdos_bfd_define_start_stop): Define.
1396 * i386os9k.c (os9k_bfd_define_start_stop): Define.
1397 * ieee.c (ieee_bfd_define_start_stop): Define.
1398 * ihex.c (ihex_bfd_define_start_stop): Define.
1399 * libbfd-in.h (_bfd_nolink_bfd_define_start_stop): Define.
1400 * mach-o-target.c (bfd_mach_o_bfd_define_start_stop): Define.
1401 * mmo.c (mmo_bfd_define_start_stop): Define.
1402 * nlm-target.h (nlm_bfd_define_start_stop): Define.
1403 * oasys.c (oasys_bfd_define_start_stop): Define.
1404 * pef.c (bfd_pef_bfd_define_start_stop): Define.
1405 * plugin.c (bfd_plugin_bfd_define_start_stop): Define.
1406 * ppcboot.c (ppcboot_bfd_define_start_stop): Define.
1407 * som.c (som_bfd_define_start_stop): Define.
1408 * srec.c (srec_bfd_define_start_stop): Define.
1409 * tekhex.c (tekhex_bfd_define_start_stop): Define.
1410 * versados.c (versados_bfd_define_start_stop): Define.
1411 * vms-alpha.c (vms_bfd_define_start_stop): Define.
1412 (alpha_vms_bfd_define_start_stop): Define.
1413 * xsym.c (bfd_sym_bfd_define_start_stop): Define.
1414 * bfd-in2.h: Regenerate.
1415 * libbfd.h: Regenerate.
1416
d68f1976
JW
14172017-06-16 Jiong Wang <jiong.wang@arm.com>
1418
1419 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Use
1420 SYMBOL_REFERENCES_LOCAL.
1421
6353d82b
JW
14222017-06-15 Jiong Wang <jiong.wang@arm.com>
1423
1424 PR ld/21532
1425 * elfnn-aarch64.c (ELIMINATE_COPY_RELOCS): Set to 1.
1426 (elfNN_aarch64_final_link_relocate): Also propagate relocations to
1427 runtime for if there needs copy relocation elimination.
1428 (need_copy_relocation_p): New function. Return true for symbol with
1429 pc-relative references and if it's against read-only sections.
1430 (elfNN_aarch64_adjust_dynamic_symbol): Use need_copy_relocation_p.
1431 (elfNN_aarch64_check_relocs): Allocate dynrelocs for relocation types
1432 that are related with accessing external objects.
1433 (elfNN_aarch64_gc_sweep_hook): Sync the relocation types with the change
1434 in elfNN_aarch64_check_relocs.
1435
63634bb4
NC
14362017-06-15 Nick Clifton <nickc@redhat.com>
1437
1438 PR binutils/21582
1439 * ieee.c (ieee_object_p): Use a static buffer to avoid compiler
1440 bugs.
62b76e4b
NC
1441 PR binutils/21581
1442 (ieee_archive_p): Likewise.
63634bb4 1443
76800cba
NC
14442017-06-15 Nick Clifton <nickc@redhat.com>
1445
1446 PR binutils/21579
1447 * vms-alpha.c (_bfd_vms_slurp_etir): Extend check of cmd_length.
1448
f7e16c2a
MF
14492017-06-14 Max Filippov <jcmvbkbc@gmail.com>
1450
1451 * elf32-xtensa.c (elf_xtensa_be_plt_entry,
1452 elf_xtensa_le_plt_entry): Add dimension for the ABI to arrays,
1453 keep both windowed and call0 ABI PLT definitions.
1454 (elf_xtensa_create_plt_entry): Use selected ABI to choose upper
1455 elf_xtensa_*_plt_entry endex.
1456 (ELF_MAXPAGESIZE): Fix at minimal supported MMU page size.
1457
f461bbd8
NC
14582017-06-14 Nick Clifton <nickc@redhat.com>
1459
1460 PR binutils/21578
1461 * elf32-sh.c (sh_elf_set_mach_from_flags): Fix check for invalid
1462 flag value.
1463
c53d2e6d
NC
14642017-06-14 Nick Clifton <nickc@redhat.com>
1465
1466 PR binutils/21589
1467 * vms-alpha.c (_bfd_vms_get_value): Add an extra parameter - the
1468 maximum value for the ascic pointer. Check that name processing
1469 does not read beyond this value.
1470 (_bfd_vms_slurp_etir): Add checks for attempts to read beyond the
1471 end of etir record.
1472
04f963fd
NC
14732017-06-14 Nick Clifton <nickc@redhat.com>
1474
1475 PR binutils/21591
1476 * versados.c (versados_mkobject): Zero the allocated tdata structure.
1477 (process_otr): Check for an invalid offset in the otr structure.
1478
319c2dbe
SH
14792017-06-14 Sebastian Huber <sebastian.huber@embedded-brains.de>
1480
1481 * config.bfd (epiphany-*-elf): Accept epiphany-*-*.
1482
cbd0eecf
L
14832017-06-13 H.J. Lu <hongjiu.lu@intel.com>
1484
1485 PR ld/20022
1486 PR ld/21557
1487 PR ld/21562
1488 PR ld/21571
1489 * elf-bfd.h (elf_link_hash_entry): Add start_stop. Change the
1490 vtable field to a union.
1491 (_bfd_elf_is_start_stop): Removed.
1492 * elf32-i386.c (elf_i386_convert_load_reloc): Also check for
1493 __start_SECNAME and __stop_SECNAME symbols.
1494 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Likewise.
1495 * elflink.c (_bfd_elf_is_start_stop): Removed.
1496 (_bfd_elf_gc_mark_rsec): Check start_stop instead of calling
1497 _bfd_elf_is_start_stop.
1498 (elf_gc_propagate_vtable_entries_used): Skip __start_SECNAME and
1499 __stop_SECNAME symbols. Updated.
1500 (elf_gc_smash_unused_vtentry_relocs): Likewise.
1501 (bfd_elf_gc_record_vtinherit): Likewise.
1502 (bfd_elf_gc_record_vtentry): Likewise.
1503
10bbbc1d
NC
15042017-06-13 Nick Clifton <nickc@redhat.com>
1505
1506 PR ld/21524
1507 * elflink.c (elf_link_adjust_relocs): Generate an error when
1508 encountering a reloc against a symbol removed by garbage
1509 collection.
1510
5c3ce2bc
L
15112017-06-12 H.J. Lu <hongjiu.lu@intel.com>
1512
1513 * elf-bfd.h (elf_backend_data): Add struct bfd_link_info *
1514 to merge_gnu_properties.
1515 * elf-properties.c (elf_merge_gnu_properties): Add struct
1516 bfd_link_info * and pass it to merge_gnu_properties.
1517 (elf_merge_gnu_property_list): Add struct bfd_link_info *
1518 and pass it to elf_merge_gnu_properties.
1519 (_bfd_elf_link_setup_gnu_properties): Pass info to
1520 elf_merge_gnu_property_list.
1521 * elf32-i386.c (elf_i386_merge_gnu_properties): Add struct
1522 bfd_link_info *.
1523 * elf64-x86-64.c (elf_x86_64_merge_gnu_properties): Likewise.
1524
9b97dfbf
AM
15252017-06-11 Joe Zbiciak <joe.zbiciak@leftturnonly.info>
1526
1527 PR 21564
1528 * binary.c (binary_set_section_contents): Scale lma by octets
1529 per byte to set filepos.
1530
e3d1d408
CM
15312017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
1532
1533 * elf32-arc.c (elf_arc_check_relocs): Fixed conditions to generate
1534 dynamic sections.
1535
64aa8e03
CM
15362017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
1537
1538 * elf32-arc.c (elf_arc_size_dynamic_sections): Changed condition to
1539 require TEXTREL.
1540
a0abe743
CM
15412017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
1542
1543 * arc-got.h (relocate_fix_got_relocs_for_got_info): Added TCB_SIZE to
1544 patched section contents for TLS IE reloc.
1545 * elf32-arc.c: Remove TCB_SIZE preprocessor macro.
1546
f4e6805f
CM
15472017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
1548
1549 * elf32-arc.c (elf_arc_relocate_section): Added "call" to
1550 RELOC_FOR_GLOBAL_SYMBOL macro.
1551
cd640291
CM
15522018-06-08 Cupertino Miranda <cmiranda@synopsys.com>
1553
1554 * elf32-arc.c (elf_arc_relocate_section): Small refactor and condition
1555 changes.
1556
7ef0acc1
VG
15572017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
1558
1559 * config/tc-arc.c (md_undefined_symbol): Changed.
1560 * config/tc-arc.h (DYNAMIC_STRUCT_NAME): Removed.
1561
cc89d0b3
CM
15622017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
1563
1564 * elf32-arc.c (elf_arc_relocate_section): Fixed reassign of indirect
1565 symbols.
1566
9d5c718b
CM
15672017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
1568
1569 * elf32-arc.c (elf_arc_check_relocs): Added condition to disable
1570 warning and "Bad value" for local symbols ARC_32 or ARC_32_ME relocs.
1571
be9e3704
CM
15722017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
1573
1574 * elf32-arc.c (ADD_RELA): Changed to only work when dynamic
1575 object is created.
1576
4ec192e6
RE
15772017-06-08 Richard Earnshaw <rearnsha@arm.com>
1578
1579 * elf32-arm.c (elf32_arm_merge_eabi_attributes): Remove assertion
1580 that the input bfd has Tag_FP_ARCH non-zero if Tag_ABI_HardFP_use
1581 is non-zero. Add clarifying comments.
1582
51fa2693
L
15832017-06-08 H.J. Lu <hongjiu.lu@intel.com>
1584
1585 * elf32-i386.c (elf_i386_check_relocs): Set local IFUNC symbol
1586 name. Use local IFUNC symbol name string to report unsupported
1587 non-PIC call to IFUNC function.
1588 (elf_i386_relocate_section): Dump local IFUNC name with minfo
1589 when generating R_386_IRELATIVE relocation.
1590 (elf_i386_finish_dynamic_symbol): Likewise.
1591 * elf_x86_64_check_relocs (elf_x86_64_check_relocs): Set local
1592 IFUNC symbol name.
1593 (elf_x86_64_relocate_section): Dump local IFUNC name with minfo
1594 when generating R_X86_64_IRELATIVE relocation.
1595 (elf_x86_64_finish_dynamic_symbol): Likewise.
1596
78e8a2ff
JM
15972017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
1598
1599 * elf.c (setup_group): Make sure BFD sections are created for all
1600 group sections in the input file when processing SHF_GROUP
1601 sections.
1602 (bfd_section_from_shdr): Avoid duplicating logic already
1603 implemented in `setup_group'.
1604
9949827b
DBR
16052017-06-06 Daniel Bonniot de Ruisselet <bonniot@gmail.com>
1606
1607 PR binutils/21546
1608 * peXXigen.c (pe_print_idata): Use the address of the first thunk
1609 if the hint address is zero.
1610
0ee3a6db
JC
16112017-06-06 James Clarke <jrtc27@jrtc27.com>
1612
1613 PR ld/19579
1614 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Check
1615 ELF_COMMON_DEF_P for common symbols.
1616
7bdf4127
AB
16172017-06-06 Andrew Burgess <andrew.burgess@embecosm.com>
1618
1619 * elf.c (_bfd_elf_make_section_from_shdr): Don't initially mark
1620 SEC_GROUP sections as SEC_EXCLUDE.
1621 (bfd_elf_set_group_contents): Replace use of abort with an assert.
1622 (assign_section_numbers): Use resolve_section_groups flag instead
1623 of relocatable link type.
1624 (_bfd_elf_init_private_section_data): Use resolve_section_groups
1625 flag instead of checking the final_link flag for part of the
1626 checks in here. Fix white space as a result.
1627 * elflink.c (elf_link_input_bfd): Use resolve_section_groups flag
1628 instead of relocatable link type.
1629 (bfd_elf_final_link): Likewise.
1630
458ad2b8
JM
16312017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
1632
1633 * elfxx-mips.c (_bfd_mips_elf_relocate_section): Remove unused
1634 variable `bed'.
1635 * elf32-score.c (score_elf_final_link_relocate): Likewise.
1636 (s3_bfd_score_elf_check_relocs): Likewise.
1637 * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
1638 (score_elf_final_link_relocate): Likewise.
1639 (s7_bfd_score_elf_check_relocs): Likewise.
1640
fbebaf4a
JM
16412017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
1642
1643 * elflink.c (init_reloc_cookie_rels): Remove unused variable
1644 `bed'.
1645
056bafd4
MR
16462017-06-06 Maciej W. Rozycki <macro@imgtec.com>
1647
1648 * elf-bfd.h (RELOC_AGAINST_DISCARDED_SECTION): Subtract `count'
1649 from `reloc_count' rather than decrementing it.
1650 * elf.c (bfd_section_from_shdr): Multiply the adjustment to
1651 `reloc_count' by `int_rels_per_ext_rel'.
1652 * elf32-score.c (score_elf_final_link_relocate): Do not multiply
1653 `reloc_count' by `int_rels_per_ext_rel' for last relocation
1654 entry determination.
1655 (s3_bfd_score_elf_check_relocs): Likewise.
1656 * elf32-score7.c (score_elf_final_link_relocate): Likewise.
1657 (s7_bfd_score_elf_relocate_section): Likewise.
1658 (s7_bfd_score_elf_check_relocs): Likewise.
1659 * elf64-mips.c (mips_elf64_get_reloc_upper_bound): Remove
1660 prototype and function.
1661 (mips_elf64_slurp_one_reloc_table): Do not update `reloc_count'.
1662 (mips_elf64_slurp_reloc_table): Assert that `reloc_count' is
1663 triple rather than once the sum of REL and RELA relocation entry
1664 counts.
1665 (bfd_elf64_get_reloc_upper_bound): Remove macro.
1666 * elflink.c (_bfd_elf_link_read_relocs): Do not multiply
1667 `reloc_count' by `int_rels_per_ext_rel' for internal relocation
1668 storage allocation size determination.
1669 (elf_link_input_bfd): Multiply `.ctors' and `.dtors' section's
1670 size by `int_rels_per_ext_rel'. Do not multiply `reloc_count'
1671 by `int_rels_per_ext_rel' for last relocation entry
1672 determination.
1673 (bfd_elf_final_link): Do not multiply `reloc_count' by
1674 `int_rels_per_ext_rel' for internal relocation storage
1675 allocation size determination.
1676 (init_reloc_cookie_rels): Do not multiply `reloc_count' by
1677 `int_rels_per_ext_rel' for last relocation entry determination.
1678 (elf_gc_smash_unused_vtentry_relocs): Likewise.
1679 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
1680 (_bfd_mips_elf_relocate_section): Likewise.
1681
af54f0eb
AM
16822017-06-05 Alan Modra <amodra@gmail.com>
1683
1684 PR 21529
1685 * linker.c (_bfd_generic_link_output_symbols): Handle BSF_GNU_UNIQUE.
1686
6cf3bf88 16872017-06-01 John Baldwin <jhb@FreeBSD.org>
b5430a3c
JB
1688
1689 * elf.c (elfcore_grok_freebsd_psinfo): Use ELF header class to
1690 determine structure sizes.
1691 (elfcore_grok_freebsd_prstatus): Likewise.
1692
f378ab09
AM
16932017-06-01 Alan Modra <amodra@gmail.com>
1694
1695 * elf64-ppc.c (struct ppc_link_hash_table): Add has_plt_localentry0.
1696 (ppc64_elf_merge_symbol_attribute): Merge localentry bits from
1697 dynamic objects.
1698 (is_elfv2_localentry0): New function.
1699 (ppc64_elf_tls_setup): Default params->plt_localentry0.
1700 (plt_stub_size): Adjust size for tls_get_addr_opt stub.
1701 (build_tls_get_addr_stub): Use a simpler stub when r2 is not saved.
1702 (ppc64_elf_size_stubs): Leave stub_type as ppc_stub_plt_call for
1703 optimized localentry:0 stubs.
1704 (ppc64_elf_build_stubs): Save r2 in ELFv2 __glink_PLTresolve.
1705 (ppc64_elf_relocate_section): Leave nop unchanged for optimized
1706 localentry:0 stubs.
1707 (ppc64_elf_finish_dynamic_sections): Set PPC64_OPT_LOCALENTRY in
1708 DT_PPC64_OPT.
1709 * elf64-ppc.h (struct ppc64_elf_params): Add plt_localentry0.
1710
8c65b54f
CS
17112017-05-30 Casey Smith <clegg89@gmail.com>
1712
1713 PR ld/21523
1714 * elf32-arm.c (elf32_arm_final_link_relocate): Install an absolute
1715 value when processing the R_ARM_THM_ALU_PREL_11_0 reloc.
1716
64984c22
AK
17172017-05-30 Anton Kolesov Anton.Kolesov@synopsys.com
1718
1719 * cpu-arc.c (arc_compatible): New function.
1720
37cd3877
AK
17212017-05-30 Anton Kolesov <anton.kolesov@synopsys.com>
1722
1723 * cpu-arc.c (arch_info_struct): Remove duplicate ARC600 entry.
1724
8e2f54bc
L
17252017-05-30 H.J. Lu <hongjiu.lu@intel.com>
1726
1727 PR binutils/21519
1728 * bfdio.c (bfd_get_file_size): New function.
1729 * bfd-in2.h: Regenerated.
1730
8e7f04f1 17312017-05-23 Dilian Palauzov <git-dpa@aegee.org>
1732
1733 * elf32-arc.c (arc_elf_merge_attributes): Add fall through
1734 comments.
1735
25f94347
L
17362017-05-22 H.J. Lu <hongjiu.lu@intel.com>
1737
1738 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Use
1739 dynobj instead of htab->elf.dynobj.
1740
e5713223
MR
17412017-05-19 Maciej W. Rozycki <macro@imgtec.com>
1742
1743 * elf64-mips.c (mips_elf64_canonicalize_reloc): Remove prototype
1744 and function.
1745 (mips_elf64_canonicalize_dynamic_reloc): Likewise.
1746 (mips_elf64_slurp_one_reloc_table): Set `reloc_count' to the
1747 actual number of internal relocations retrieved. Adjust
1748 function description.
1749 (bfd_elf64_canonicalize_reloc): Remove macro.
1750 (bfd_elf64_canonicalize_dynamic_reloc): Likewise.
1751
64517994
JM
17522017-05-19 Jose E. Marchesi <jose.marchesi@oracle.com>
1753
1754 * archures.c (bfd_mach_sparc_v9m8): Define.
1755 (bfd_mach_sparc_v8plusm8): Likewise.
1756 (bfd_mach_sparc_v9_p): Adjust to M8.
1757 (bfd_mach_sparc_64bit_p): Likewise.
1758 * aoutx.h (machine_type): Handle bfd_mach_sparc_v9m8 and
1759 bfd_mach_sparc_v8plusm8.
1760 * bfd-in2.h: Regenerated.
1761 * cpu-sparc.c (arch_info_struct): Entries for sparc:v9m8 and
1762 sparc:v8plusm8.
1763 * elfxx-sparc.c (_bfd_sparc_elf_object_p): Handle
1764 bfd_mach_sparc_v8plusm8 and bfd_mach_sparc_v9m8 using the new hw
1765 capabilities ONADDSUB, ONMUL, ONDIV, DICTUNP, FPCPSHL, RLE and
1766 SHA3.
1767 * elf32-sparc.c (elf32_sparc_final_write_processing): Handle
1768 bfd_mach_sparc_v8plusm8.
1769
eb026f09
AM
17702017-05-19 Alan Modra <amodra@gmail.com>
1771
1772 * elflink.c (_bfd_elf_gc_mark_extra_sections): Don't keep
1773 debug and special sections when no non-note alloc sections in an
1774 object are kept.
1775
535b785f
AM
17762017-05-18 Alan Modra <amodra@gmail.com>
1777
1778 * arc-got.h: Don't compare boolean values against TRUE or FALSE.
1779 * elf-m10300.c: Likewise.
1780 * elf.c: Likewise.
1781 * elf32-arc.c: Likewise.
1782 * elf32-bfin.c: Likewise.
1783 * elf32-m68k.c: Likewise.
1784 * elf32-nds32.c: Likewise.
1785 * elf32-tilepro.c: Likewise.
1786 * elflink.c: Likewise.
1787 * elfnn-aarch64.c: Likewise.
1788 * elfnn-riscv.c: Likewise.
1789 * elfxx-tilegx.c: Likewise.
1790 * mach-o.c: Likewise.
1791 * peXXigen.c: Likewise.
1792 * vms-alpha.c: Likewise.
1793 * vms-lib.c: Likewise.
1794
b7c871ed
L
17952017-05-17 H.J. Lu <hongjiu.lu@intel.com>
1796
1797 PR ld/20882
1798 * elflink.c (elf_gc_mark_debug_section): New function.
1799 (_bfd_elf_gc_mark_extra_sections): Mark any debug sections
1800 referenced by kept debug sections.
1801
bc4e12de
AM
18022017-05-16 Alan Modra <amodra@gmail.com>
1803
1804 * elf-m10300.c: Rename occurrences of non_ir_ref.
1805 * elf32-arm.c: Likewise.
1806 * elf32-bfin.c: Likewise.
1807 * elf32-cr16.c: Likewise.
1808 * elf32-cris.c: Likewise.
1809 * elf32-d10v.c: Likewise.
1810 * elf32-dlx.c: Likewise.
1811 * elf32-fr30.c: Likewise.
1812 * elf32-frv.c: Likewise.
1813 * elf32-hppa.c: Likewise.
1814 * elf32-i370.c: Likewise.
1815 * elf32-i386.c: Likewise.
1816 * elf32-iq2000.c: Likewise.
1817 * elf32-lm32.c: Likewise.
1818 * elf32-m32c.c: Likewise.
1819 * elf32-m32r.c: Likewise.
1820 * elf32-m68hc1x.c: Likewise.
1821 * elf32-m68k.c: Likewise.
1822 * elf32-mcore.c: Likewise.
1823 * elf32-metag.c: Likewise.
1824 * elf32-microblaze.c: Likewise.
1825 * elf32-moxie.c: Likewise.
1826 * elf32-msp430.c: Likewise.
1827 * elf32-mt.c: Likewise.
1828 * elf32-nios2.c: Likewise.
1829 * elf32-or1k.c: Likewise.
1830 * elf32-ppc.c: Likewise.
1831 * elf32-rl78.c: Likewise.
1832 * elf32-s390.c: Likewise.
1833 * elf32-score.c: Likewise.
1834 * elf32-score7.c: Likewise.
1835 * elf32-sh.c: Likewise.
1836 * elf32-tic6x.c: Likewise.
1837 * elf32-tilepro.c: Likewise.
1838 * elf32-v850.c: Likewise.
1839 * elf32-vax.c: Likewise.
1840 * elf32-xstormy16.c: Likewise.
1841 * elf32-xtensa.c: Likewise.
1842 * elf64-alpha.c: Likewise.
1843 * elf64-hppa.c: Likewise.
1844 * elf64-ia64-vms.c: Likewise.
1845 * elf64-mmix.c: Likewise.
1846 * elf64-ppc.c: Likewise.
1847 * elf64-s390.c: Likewise.
1848 * elf64-sh64.c: Likewise.
1849 * elf64-x86-64.c: Likewise.
1850 * elflink.c: Likewise.
1851 * elfnn-aarch64.c: Likewise.
1852 * elfnn-ia64.c: Likewise.
1853 * elfnn-riscv.c: Likewise.
1854 * elfxx-mips.c: Likewise.
1855 * elfxx-sparc.c: Likewise.
1856 * elfxx-tilegx.c: Likewise.
1857 * linker.c: Likewise.
1858
4070765b
AM
18592017-05-16 Alan Modra <amodra@gmail.com>
1860
1861 * elf64-ppc.c (add_symbol_adjust): Transfer non_ir_ref_dynamic.
1862 * elflink.c (elf_link_add_object_symbols): Update to use
1863 non_ir_ref_dynamic.
1864 (elf_link_input_bfd): Test non_ir_ref_dynamic in addition to
1865 non_ir_ref.
1866 * linker.c (_bfd_generic_link_add_one_symbol): Likewise.
1867
25499ac7
MR
18682017-05-15 Maciej W. Rozycki <macro@imgtec.com>
1869
1870 * elfxx-mips.c (print_mips_ases): Handle MIPS16e2 ASE.
1871
73caa85d
L
18722017-05-12 H.J. Lu <hongjiu.lu@intel.com>
1873
1874 * elf32-i386.c (elf_i386_parse_gnu_properties): Merge
1875 GNU_PROPERTY_X86_ISA_1_USED and GNU_PROPERTY_X86_ISA_1_NEEDED
1876 properties.
1877 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
1878
f2c29a16
L
18792017-05-11 H.J. Lu <hongjiu.lu@intel.com>
1880
1881 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Rename plt_bnd
1882 to plt_second.
1883 (elf_x86_64_link_hash_table): Rename plt_bnd/plt_bnd_eh_frame
1884 to plt_second/plt_second_eh_frame.
1885 (elf_x86_64_link_hash_newfunc): Updated.
1886 (elf_x86_64_allocate_dynrelocs): Likewise.
1887 (elf_x86_64_size_dynamic_sections): Likewise.
1888 (elf_x86_64_relocate_section): Likewise.
1889 (elf_x86_64_finish_dynamic_symbol): Likewise.
1890 (elf_x86_64_finish_dynamic_sections): Likewise.
1891 (elf_x86_64_plt_type): Rename plt_bnd to plt_second.
1892 (elf_x86_64_get_synthetic_symtab): Updated. Also scan the
1893 .plt.sec section.
1894 (elf_backend_setup_gnu_properties): Updated. Create the
1895 .plt.sec section instead of the .plt.sec section.
1896
dc2be3d2
L
18972017-05-11 H.J. Lu <hongjiu.lu@intel.com>
1898
1899 * elf32-i386.c (elf_i386_allocate_dynrelocs): Partially revert
1900 commit 25070364b0ce33eed46aa5d78ebebbec6accec7e.
1901 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewse.
1902
db84b98a
JM
19032017-05-10 Jose E. Marchesi <jose.marchesi@oracle.com>
1904
1905 * elf64-sparc.c (elf64_sparc_set_reloc): New function.
1906 (bfd_elf64_set_reloc): Define.
1907 (elf64_sparc_write_relocs): Use `canon_reloc_count'.
1908
23186865
JM
19092017-05-10 Jose E. Marchesi <jose.marchesi@oracle.com>
1910
1911 * targets.c (BFD_JUMP_TABLE_RELOCS): Add NAME##_set_reloc.
1912 (struct bfd_target): New field _bfd_set_reloc.
1913 * bfd.c (bfd_set_reloc): Call backend _set_bfd.
1914 * reloc.c (_bfd_generic_set_reloc): New function.
1915 * coffcode.h (coff_set_reloc): Define to _bfd_generic_set_reloc.
1916 * nlm-target.h (nlm_set_reloc): Likewise.
1917 * coff-rs6000.c (_bfd_xcoff_set_reloc): Likewise.
1918 * aout-tic30.c (MY_set_reloc): Likewise.
1919 * aout-target.h (MY_set_reloc): Likewise.
1920 * elfxx-target.h (bfd_elfNN_set_reloc): Likewise.
1921 * coff-alpha.c (_bfd_ecoff_set_reloc): Likewise.
1922 * mach-o-target.c (bfd_mach_o_set_reloc): Likewise.
1923 * vms-alpha.c (alpha_vms_set_reloc): Likewise.
1924 * aout-adobe.c (aout_32_set_reloc): Likewise.
1925 * bout.c (b_out_set_reloc): Likewise.
1926 * coff-mips.c (_bfd_ecoff_set_reloc): Likewise.
1927 * i386os9k.c (aout_32_set_reloc): Likewise.
1928 * ieee.c (ieee_set_reloc): Likewise.
1929 * oasys.c (oasys_set_reloc): Likewise.
1930 * som.c (som_set_reloc): Likewise.
1931 * versados.c (versados_set_reloc): Likewise.
1932 * coff64-rs6000.c (rs6000_xcoff64_vec): Add
1933 _bfd_generic_set_reloc.
1934 (rs6000_xcoff64_aix_vec): LIkewise.
1935 * libbfd.c (_bfd_norelocs_set_reloc): New function.
1936 * libbfd-in.h: Prototype for _bfd_norelocs_set_reloc.
1937 * i386msdos.c (msdos_set_reloc): Define to
1938 _bfd_norelocs_set_reloc.
1939 * elfcode.h (elf_set_reloc): Define.
1940 * bfd-in2.h: Regenerated.
1941
aab82f4c
L
19422017-05-10 H.J. Lu <hongjiu.lu@intel.com>
1943
1944 PR ld/21481
1945 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Use .plt.bnd
1946 for IFUNC function address.
1947
53a346d8
CZ
19482017-05-10 Claudiu Zissulescu <claziss@synopsys.com>
1949
1950 * elf32-arc.c (FEATURE_LIST_NAME): Define.
1951 (CONFLICT_LIST): Likewise.
1952 (opcode/arc-attrs.h): Include.
1953 (arc_elf_print_private_bfd_data): Print OSABI v4 flag.
1954 (arc_extract_features): New file.
1955 (arc_stralloc): Likewise.
1956 (arc_elf_merge_attributes): Likewise.
1957 (arc_elf_merge_private_bfd_data): Use object attributes.
1958 (bfd_arc_get_mach_from_attributes): New function.
1959 (arc_elf_object_p): Use object attributes.
1960 (arc_elf_final_write_processing): Likewise.
1961 (elf32_arc_obj_attrs_arg_type): New function.
1962 (elf32_arc_obj_attrs_handle_unknown): Likewise.
1963 (elf32_arc_section_from_shdr): Likewise.
1964 (elf_backend_obj_attrs_vendor): Define.
1965 (elf_backend_obj_attrs_section): Likewise.
1966 (elf_backend_obj_attrs_arg_type): Likewise.
1967 (elf_backend_obj_attrs_section_type): Likewise.
1968 (elf_backend_obj_attrs_handle_unknown): Likewise.
1969 (elf_backend_section_from_shdr): Likewise.
1970
e645cf40
AG
19712017-05-09 Andrew Goedhart <Andrewgoedhart@simplepowersolutions.co.za>
1972
1973 PR ld/21458
1974 * elf32-arm.c (elf32_arm_final_link_relocate): Set the bottom bit
1975 of the value when resolving a R_ARM_THM_ALU_PREL_11_0 relocation
1976 and the destination is a Thumb symbol.
1977
dd9e66ee
L
19782017-05-08 H.J. Lu <hongjiu.lu@intel.com>
1979
1980 * elf32-i386.c (elf_i386_get_synthetic_symtab): Add missing
1981 initializer to silence GCC 4.2.
1982 * lf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
1983
38b12349
L
19842017-05-08 H.J. Lu <hongjiu.lu@intel.com>
1985
1986 * elf64-x86-64.c (PLT_ENTRY_SIZE): Renamed to ...
1987 (LAZY_PLT_ENTRY_SIZE): This.
1988 (NON_LAZY_PLT_ENTRY_SIZE): New.
1989 (elf_x86_64_plt0_entry): Renamed to ...
1990 (elf_x86_64_lazy_plt0_entry): This.
1991 (elf_x86_64_plt_entry): Renamed to ...
1992 (elf_x86_64_lazy_plt_entry): This.
1993 (elf_x86_64_bnd_plt0_entry): Renamed to ...
1994 (elf_x86_64_lazy_bnd_plt0_entry): This.
1995 (elf_x86_64_legacy_plt_entry): Removed.
1996 (elf_x86_64_bnd_plt_entry): Renamed to ...
1997 (elf_x86_64_lazy_bnd_plt_entry): This.
1998 (elf_x86_64_legacy_plt2_entry): Renamed to ...
1999 (elf_x86_64_non_lazy_plt_entry): This.
2000 (elf_x86_64_bnd_plt2_entry): Renamed to ...
2001 (elf_x86_64_non_lazy_bnd_plt_entry): This.
2002 (elf_x86_64_eh_frame_plt): Renamed to ...
2003 (elf_x86_64_eh_frame_lazy_plt): This.
2004 (elf_x86_64_eh_frame_bnd_plt): Renamed to ...
2005 (elf_x86_64_eh_frame_lazy_bnd_plt): This.
2006 (elf_x86_64_eh_frame_plt_got): Renamed to ...
2007 (elf_x86_64_eh_frame_non_lazy_plt): This.
2008 (elf_x86_64_lazy_plt_layout): New.
2009 (elf_x86_64_non_lazy_plt_layout): Likewise.
2010 (elf_x86_64_plt_layout): Likewise.
2011 (elf_x86_64_backend_data): Remove PLT layout information. Add
2012 os for target system.
2013 (GET_PLT_ENTRY_SIZE): Removed.
2014 (elf_x86_64_lazy_plt): New.
2015 (elf_x86_64_non_lazy_plt): Likewise.
2016 (elf_x86_64_lazy_bnd_plt): Likewise.
2017 (elf_x86_64_non_lazy_bnd_plt): Likewise.
2018 (elf_x86-64_arch_bed): Updated.
2019 (elf_x86_64_link_hash_table): Add plt, lazy_plt and non_lazy_plt.
2020 (elf_x86_64_create_dynamic_sections): Removed.
2021 (elf_x86_64_check_relocs): Don't check elf.dynobj. Don't call
2022 _bfd_elf_create_ifunc_sections nor _bfd_elf_create_got_section.
2023 (elf_x86-64_adjust_dynamic_symbol): Updated.
2024 (elf_x86_64_allocate_dynrelocs): Updated. Pass 0 as PLT header
2025 size to _bfd_elf_allocate_ifunc_dyn_relocs and don't allocate
2026 size for PLT0 if there is no PLT0. Get plt_entry_size from
2027 non_lazy_plt for non-lazy PLT entries.
2028 (elf_x86_64_size_dynamic_sections): Updated. Get plt_entry_size
2029 from non_lazy_plt for non-lazy PLT entries.
2030 (elf_x86-64_relocate_section): Updated. Properly get PLT index
2031 if there is no PLT0.
2032 (elf_x86_64_finish_dynamic_symbol): Updated. Fill the first slot
2033 in the PLT entry with generic PLT layout. Fill the non-lazy PLT
2034 entries with non-lazy PLT layout. Don't fill the second and third
2035 slots in the PLT entry if there is no PLT0.
2036 (elf_x86_64_finish_dynamic_sections): Updated. Don't fill PLT0
2037 if there is no PLT0. Set sh_entsize on the .plt.got section.
2038 (compare_relocs): New.
2039 (elf_x86_64_plt_type): Likewise.
2040 (elf_x86_64_plt): Likewise.
2041 (elf_x86_64_nacl_plt): New. Forward declaration.
2042 (elf_x86_64_get_plt_sym_val): Removed.
2043 (elf_x86_64_get_synthetic_symtab): Rewrite to check PLT sections
2044 against all dynamic relocations.
2045 (elf_x86_64_link_setup_gnu_properties): New function.
2046 (elf_backend_create_dynamic_sections): Updated.
2047 (elf_backend_setup_gnu_properties): New.
2048 (elf_x86_64_nacl_plt): New.
2049 (elf_x86_64_nacl_arch_bed): Updated.
2050
f604c2a2
L
20512017-05-08 H.J. Lu <hongjiu.lu@intel.com>
2052
2053 * elf32-i386.c (PLT_ENTRY_SIZE): Renamed to ...
2054 (LAZY_PLT_ENTRY_SIZE): This.
2055 (NON_LAZY_PLT_ENTRY_SIZE): New.
2056 (elf_i386_plt0_entry): Renamed to ...
2057 (elf_i386_lazy_plt0_entry): This.
2058 (elf_i386_plt_entry): Renamed to ...
2059 (elf_i386_lazy_plt_entry): This.
2060 (elf_i386_pic_plt0_entry): Renamed to ...
2061 (elf_i386_pic_lazy_plt0_entry): This.
2062 (elf_i386_pic_plt_entry): Renamed to ...
2063 (elf_i386_pic_lazy_plt_entry): This.
2064 (elf_i386_got_plt_entry): Renamed to ...
2065 (elf_i386_non_lazy_plt_entry): This.
2066 (elf_i386_pic_got_plt_entry): Renamed to ...
2067 (elf_i386_pic_non_lazy_plt_entry): This.
2068 (elf_i386_eh_frame_plt): Renamed to ...
2069 (elf_i386_eh_frame_lazy_plt): This.
2070 (elf_i386_eh_frame_plt_got): Renamed to ...
2071 (elf_i386_eh_frame_non_lazy_plt): This.
2072 (elf_i386_plt_layout): Renamed to ...
2073 (elf_i386_lazy_plt_layout): This. Remove eh_frame_plt_got and
2074 eh_frame_plt_got_size.
2075 (elf_i386_non_lazy_plt_layout): New.
2076 (elf_i386_plt_layout): Likewise.
2077 (elf_i386_non_lazy_plt): Likewise.
2078 (GET_PLT_ENTRY_SIZE): Removed.
2079 (elf_i386_plt): Renamed to ...
2080 (elf_i386_lazy_plt): This.
2081 (elf_i386_backend_data): Remove plt. Rename is_vxworks to os.
2082 (elf_i386_arch_bed): Updated.
2083 (elf_i386_link_hash_table): Add plt, lazy_plt and non_lazy_plt.
2084 (elf_i386_create_dynamic_sections): Removed.
2085 (elf_i386_check_relocs): Don't check elf.dynobj. Don't call
2086 _bfd_elf_create_ifunc_sections nor _bfd_elf_create_got_section.
2087 (elf_i386_adjust_dynamic_symbol): Updated.
2088 (elf_i386_allocate_dynrelocs): Updated. Pass 0 as PLT header
2089 size to _bfd_elf_allocate_ifunc_dyn_relocs and don't allocate
2090 size for PLT0 if there is no PLT0.
2091 (elf_i386_size_dynamic_sections): Updated. Check whether GOT
2092 output section is discarded only if GOT isn't empty.
2093 (elf_i386_relocate_section): Updated. Properly get PLT index
2094 if there is no PLT0.
2095 (elf_i386_finish_dynamic_symbol): Updated. Don't fill the
2096 second and third slots in the PLT entry if there is no PLT0.
2097 (elf_i386_finish_dynamic_sections): Updated. Don't fill PLT0
2098 if there is no PLT0. Set sh_entsize on the .plt.got section.
2099 (elf_i386_nacl_plt): Forward declaration.
2100 (elf_i386_get_plt_sym_val): Removed.
2101 (elf_i386_get_synthetic_symtab): Rewrite to check PLT sections
2102 against all dynamic relocations.
2103 (elf_i386_link_setup_gnu_properties): New function.
2104 (elf_backend_create_dynamic_sections): Updated.
2105 (elf_backend_setup_gnu_properties): New.
2106 (elf_i386_nacl_plt): Updated.
2107 (elf_i386_nacl_arch_bed): Likewise.
2108 (elf_i386_vxworks_arch_bed): Likewise.
2109
046734ff
TP
21102017-05-08 Thomas Preud'homme <thomas.preudhomme@arm.com>
2111
2112 * elflink.c (elf_output_implib): Remove executable flag from import
2113 library bfd.
2114 * elf32-arm.c (elf32_arm_filter_implib_symbols): Assert that the import
2115 library is a relocatable object file.
2116
b660e9eb
SKS
21172017-05-01 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
2118
2119 PR ld/21404
2120 * elf32-avr.c (avr_should_move_sym): New function.
2121 (avr_should_reduce_sym_size): Likewise.
2122 (avr_should_increase_sym_size): Likewise.
2123 (elf32_avr_relax_delete_bytes): Adjust symbol values
2124 and sizes by calling new functions.
2125
763a5fa4
PD
21262017-05-01 Palmer Dabbelt <palmer@dabbelt.com>
2127
2128 * config.bfd (riscv32-*): Enable rv64.
2129
73ec947d
AM
21302017-05-02 Alan Modra <amodra@gmail.com>
2131
2132 PR 21384
2133 * elflink.c (bfd_elf_link_mark_dynamic_symbol): Test h->non_elf
2134 rather than h->root.type == bfd_link_hash_new.
2135 (bfd_elf_record_link_assignment): Similarly, call
2136 bfd_elf_link_mark_dynamic_symbol when h->non_elf.
2137
a941291c
AM
21382017-04-29 Alan Modra <amodra@gmail.com>
2139
2140 PR 21432
2141 * reloc.c (reloc_offset_in_range): New function.
2142 (bfd_perform_relocation, bfd_install_relocation): Use it.
2143 (_bfd_final_link_relocate): Likewise.
2144
750eaa47
L
21452017-04-28 H.J. Lu <hongjiu.lu@intel.com>
2146
2147 * elf32-i386.c (elf_i386_allocate_dynrelocs): Check plt_got
2148 before using .plt.got.
2149 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise.
2150
5b66fac4
L
21512017-04-27 H.J. Lu <hongjiu.lu@intel.com>
2152
2153 * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Use "="
2154 instead of "+=" to update 0.
2155
de9a3c42
L
21562017-04-27 H.J. Lu <hongjiu.lu@intel.com>
2157
2158 * elf32-i386.c (elf_i386_create_dynamic_sections): Create the
2159 .plt.got section here.
2160 (elf_i386_check_relocs): Don't create the .plt.got section.
2161 * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Create
2162 the .plt.got and .plt.bnd sections here.
2163 (elf_x86_64_check_relocs): Don't create the .plt.got nor
2164 .plt.bnd sections.
2165
da3d25af
L
21662017-04-27 H.J. Lu <hongjiu.lu@intel.com>
2167
2168 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Remove
2169 has_bnd_reloc.
2170 (elf_x86_64_link_hash_newfunc): Don't clear has_bnd_reloc.
2171 (elf_x86_64_copy_indirect_symbol): Don't copy has_bnd_reloc.
2172 (elf_x86_64_check_relocs): Don't set has_bnd_reloc.
2173 (elf_x86_64_finish_dynamic_symbol): Check bndplt instead of
2174 has_bnd_reloc.
2175
fba37edd
L
21762017-04-27 H.J. Lu <hongjiu.lu@intel.com>
2177
2178 * elf-bfd.h (elf_backend_data): Change setup_gnu_properties
2179 to return bfd *.
2180 (_bfd_elf_link_setup_gnu_properties): Return bfd *.
2181 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Return
2182 the first relocatable ELF input with GNU properties.
2183
1f78f649
L
21842017-04-27 H.J. Lu <hongjiu.lu@intel.com>
2185
2186 * elf32-i386.c (elf_i386_finish_dynamic_sections): Simplify
2187 VxWorks for non-PIC.
2188
76c20d54
AM
21892017-04-27 Alan Modra <amodra@gmail.com>
2190
2191 * elf-bfd.h (struct elf_backend_data): Make asection param of
2192 elf_backend_eh_frame_address_size const.
2193 (_bfd_elf_eh_frame_address_size): Likewise.
2194 * elf32-m32c.c (_bfd_m32c_elf_eh_frame_address_size): Likewise.
2195 * elf32-msp430.c (elf32_msp430_eh_frame_address_size): Likewise.
2196 * elfxx-mips.c (_bfd_mips_elf_eh_frame_address_size): Likewise.
2197 * elfxx-mips.h (_bfd_mips_elf_eh_frame_address_size): Likewise.
2198 * elf-eh-frame.c (_bfd_elf_eh_frame_address_size): Likewise.
2199 (next_cie_fde_offset): Constify params.
2200 (offset_adjust, adjust_eh_frame_local_symbols): Likewise.
2201
d7153c4a
AM
22022017-04-27 Alan Modra <amodra@gmail.com>
2203
2204 * elf-bfd.h (struct eh_cie_fde): Add aug_str_len and aug_data_len.
2205 (_bfd_elf_adjust_eh_frame_global_symbol): Declare.
2206 * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Set aug_str_len and
2207 aug_data_len.
2208 (offset_adjust): New function.
2209 (_bfd_elf_adjust_eh_frame_global_symbol): Likewise.
2210 (adjust_eh_frame_local_symbols): Likewise.
2211 (_bfd_elf_discard_section_eh_frame): Call adjust_eh_frame_local_symbols
2212 after changing anything. Return true if anything changed.
2213 * elflink.c (bfd_elf_discard_info): If .eh_frame changed, call
2214 _bfd_elf_adjust_eh_frame_global_symbol for globals.
2215
641338d8
AM
22162017-04-27 Alan Modra <amodra@gmail.com>
2217
2218 * elflink.c (_bfd_elf_link_hash_hide_symbol): Clear dynstr_index
2219 when force_local.
2220
21d68fcd
AM
22212017-04-27 Alan Modra <amodra@gmail.com>
2222
2223 * elf32-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
2224 (ppc_elf_select_plt_layout, ppc_elf_tls_setup): Use it.
2225 (ppc_elf_adjust_dynamic_symbol, allocate_dynrelocs): Likewise.
2226 (ppc_elf_relocate_section): Likewise. Delete silly optimisation
2227 for undef and undefweak dyn_relocs.
2228 * elf64-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
2229 (ppc64_elf_adjust_dynamic_symbol, ppc64_elf_tls_setup): Use it.
2230 (allocate_got, allocate_dynrelocs): Likewise.
2231 (ppc64_elf_relocate_section): Likewise.
2232
97d343d4
L
22332017-04-26 H.J. Lu <hongjiu.lu@intel.com>
2234
2235 * elf32-i386.c (elf_i386_size_dynamic_sections): Alwasys add
2236 DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rel.plt section.
2237 * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Alwasys
2238 add DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rela.plt section.
2239
04b31182
NC
22402017-04-26 Nick Clifton <nickc@redhat.com>
2241
2242 PR binutils/21434
2243 * reloc.c (bfd_perform_relocation): Check for a negative address
2244 in the reloc.
2245
23ec1e32
MR
22462017-04-26 Maciej W. Rozycki <macro@imgtec.com>
2247
2248 PR ld/21334
2249 * elf-bfd.h (elf_backend_data): Add `always_renumber_dynsyms'
2250 member.
2251 * elfxx-target.h [!elf_backend_always_renumber_dynsyms]
2252 (elf_backend_always_renumber_dynsyms): Define.
2253 (elfNN_bed): Initialize `always_renumber_dynsyms' member.
2254 * elfxx-mips.h (elf_backend_always_renumber_dynsyms): Define.
2255 * elflink.c (bfd_elf_size_dynamic_sections): Also call
2256 `_bfd_elf_link_renumber_dynsyms' if the backend has requested
2257 it.
2258 (bfd_elf_size_dynsym_hash_dynstr): Likewise.
2259
c46cec3a
MR
22602017-04-26 Maciej W. Rozycki <macro@imgtec.com>
2261
2262 * elflink.c (bfd_elf_size_dynamic_sections): Only call
2263 `_bfd_elf_link_renumber_dynsyms' after section GC if dynamic
2264 sections have been created.
2265
e63d1232
NC
22662017-04-26 Nick Clifton <nickc@redhat.com>
2267
2268 PR binutils/21431
2269 * compress.c (bfd_init_section_compress_status): Check the return
2270 value from bfd_malloc.
2271
9e9821dd
L
22722017-04-24 H.J. Lu <hongjiu.lu@intel.com>
2273
2274 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Add
2275 no_finish_dynamic_symbol.
2276 (elf_x86_64_link_hash_newfunc): Set no_finish_dynamic_symbol to
2277 0.
2278 (elf_x86_64_allocate_dynrelocs): If a symbol isn't undefined
2279 weak symbol, don't make it dynamic.
2280 (elf_x86_64_relocate_section): If a symbol isn't dynamic in PIC,
2281 set no_finish_dynamic_symbol and generate R_X86_64_RELATIVE
2282 relocation for GOT reference.
2283 (elf_x86_64_finish_dynamic_symbol): Abort if
2284 no_finish_dynamic_symbol isn't 0.
2285
0dc9a308
L
22862017-04-24 H.J. Lu <hongjiu.lu@intel.com>
2287
2288 PR ld/21402
2289 * elf32-i386.c (elf_i386_allocate_dynrelocs): If a symbol isn't
2290 undefined weak symbol, don't make it dynamic.
2291 (elf_i386_relocate_section): If a symbol isn't dynamic in PIC,
2292 set no_finish_dynamic_symbol and generate R_386_RELATIVE
2293 relocation for R_386_GOT32.
2294
1587442d
L
22952017-04-24 H.J. Lu <hongjiu.lu@intel.com>
2296
2297 PR ld/21425
2298 * elf32-i386.c (ELF_MAXPAGESIZE): Set to 0x1000 for VxWorks.
2299
7eacd66b
AM
23002017-04-23 Alan Modra <amodra@gmail.com>
2301
2302 PR 21414
2303 * section.c (GLOBAL_SYM_INIT): Make available in bfd.h.
2304 * elf.c (lcomm_sym): New.
2305 (_bfd_elf_large_com_section): Use lcomm_sym section symbol.
2306 * bfd-in2.h: Regenerate.
2307
bce964aa
AM
23082017-04-23 Alan Modra <amodra@gmail.com>
2309
2310 PR 21412
2311 * elf-bfd.h (struct elf_backend_data <get_reloc_section>): Change
2312 parameters and comment.
2313 (_bfd_elf_get_reloc_section): Delete.
2314 (_bfd_elf_plt_get_reloc_section): Declare.
2315 * elf.c (_bfd_elf_plt_get_reloc_section, elf_get_reloc_section):
2316 New functions. Don't blindly skip over assumed .rel/.rela prefix.
2317 Extracted from..
2318 (_bfd_elf_get_reloc_section): ..here. Delete.
2319 (assign_section_numbers): Call elf_get_reloc_section.
2320 * elf64-ppc.c (elf_backend_get_reloc_section): Define.
2321 * elfxx-target.h (elf_backend_get_reloc_section): Update.
2322
97e83a10
AM
23232017-04-23 Alan Modra <amodra@gmail.com>
2324
2325 PR 21409
2326 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Don't segfault when
2327 no symbols.
2328
e133d005
L
23292017-04-21 H.J. Lu <hongjiu.lu@intel.com>
2330
2331 PR ld/21402
2332 * elf32-i386.c (elf_i386_link_hash_entry): Add
2333 no_finish_dynamic_symbol.
2334 (elf_i386_link_hash_newfunc): Set no_finish_dynamic_symbol to 0.
2335 (elf_i386_allocate_dynrelocs): If a symbol isn't undefined weak
2336 symbol, don't make it dynamic in PIE.
2337 (elf_i386_relocate_section): If a symbol isn't dynamic in PIE,
2338 set no_finish_dynamic_symbol and generate R_386_RELATIVE
2339 relocation for R_386_GOT32
2340 (elf_i386_finish_dynamic_symbol): Abort if no_finish_dynamic_symbol
2341 isn't 0.
2342
3c5fce9b
L
23432017-04-21 H.J. Lu <hongjiu.lu@intel.com>
2344
2345 PR ld/19617
2346 PR ld/21086
2347 * elflink.c (elf_link_add_object_symbols): Require
2348 --no-dynamic-linker with -E/--dynamic-list when creating
2349 dynamic sections.
2350
0fad2956
MR
23512017-04-20 Maciej W. Rozycki <macro@imgtec.com>
2352
2353 * elflink.c (_bfd_elf_symbol_refs_local_p): Always return TRUE
2354 if forced local.
2355
64575f78
MR
23562017-04-20 Maciej W. Rozycki <macro@imgtec.com>
2357
2358 * elfxx-mips.c (_bfd_mips_elf_final_link): Reorder comment about
2359 dynamic symbol sorting.
2360
59fa66c5
L
23612017-04-20 H.J. Lu <hongjiu.lu@intel.com>
2362
2363 PR ld/21382
2364 * elflink.c (elf_link_add_object_symbols): Preserve
2365 dynamic_ref_after_ir_def when restoring the symbol table for
2366 unneeded dynamic object.
2367
e492d2f8
L
23682017-04-19 H.J. Lu <hongjiu.lu@intel.com>
2369
2370 PR ld/21401
2371 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Don't abort
2372 on on undefined IFUNC symbol in the second PLT.
2373
10169134
WAF
23742017-04-19 Wedson Almeida Filho <wedsonaf@gmail.com>
2375
2376 * peXXigen.c (pe_print_reloc): Correct chunk_end.
2377
954b63d4
AM
23782017-04-19 Alan Modra <amodra@gmail.com>
2379
2380 * elflink.c (_bfd_elf_adjust_dynamic_symbol): Hide undefweak
2381 or make dynamic for info->dynamic_undefined_weak 0 and 1.
2382 * elf32-ppc.c:Formatting.
2383 (ensure_undefweak_dynamic): Don't make dynamic when
2384 info->dynamic_undefined_weak is zero.
2385 (allocate_dynrelocs): Discard undefweak dyn_relocs for
2386 info->dynamic_undefined_weak. Discard undef dyn_relocs when
2387 not default visibility. Discard undef and undefweak
2388 dyn_relocs earlier.
2389 (ppc_elf_relocate_section): Adjust to suit.
2390 * elf64-ppc.c: Formatting.
2391 (ensure_undefweak_dynamic): Don't make dynamic when
2392 info->dynamic_undefined_weak is zero.
2393 (allocate_dynrelocs): Discard undefweak dyn_relocs for
2394 info->dynamic_undefined_weak. Discard them earlier.
2395
e6699019
L
23962017-04-17 H.J. Lu <hongjiu.lu@intel.com>
2397
2398 PR ld/21389
2399 * elflink.c (bfd_elf_size_dynamic_sections): Get soname index
2400 before generating the version definition section.
2401
c5d37467
AM
24022017-04-17 Alan Modra <amodra@gmail.com>
2403
2404 * elflink.c (_bfd_elf_merge_symbol): Undo dynamic linking
2405 state when a regular object file defines a symbol with
2406 incompatible type to that defined by an earlier shared lib.
2407
63a5468a
AM
24082017-04-13 Alan Modra <amodra@gmail.com>
2409
2410 * coffcode.h: Wrap some overly long _bfd_error_handler args.
2411 * elf.c: Likewise.
2412 * elf32-arm.c: Likewise.
2413 * elf32-i386.c: Likewise.
2414 * elf32-mep.c: Likewise.
2415 * elf64-ia64-vms.c: Likewise.
2416 * elf64-x86-64.c: Likewise.
2417 * elflink.c: Likewise.
2418 * elfnn-ia64.c: Likewise.
2419 * elfxx-mips.c: Likewise.
2420
dae82561
AM
24212017-04-13 Alan Modra <amodra@gmail.com>
2422
2423 * aoutx.h: Use %B and %A in error messages throughout file.
2424 * aout-cris.c: Likewise.
2425 * archive.c: Likewise.
2426 * binary.c: Likewise.
2427 * coff-rs6000.c: Likewise.
2428 * coff-tic4x.c: Likewise.
2429 * coffcode.h: Likewise.
2430 * coffgen.c: Likewise.
2431 * cofflink.c: Likewise.
2432 * coffswap.h: Likewise.
2433 * cpu-arm.c: Likewise.
2434 * elf-eh-frame.c: Likewise.
2435 * elf-m10300.c: Likewise.
2436 * elf.c: Likewise.
2437 * elf32-arc.c: Likewise.
2438 * elf32-arm.c: Likewise.
2439 * elf32-bfin.c: Likewise.
2440 * elf32-frv.c: Likewise.
2441 * elf32-iq2000.c: Likewise.
2442 * elf32-m32c.c: Likewise.
2443 * elf32-microblaze.c: Likewise.
2444 * elf32-nds32.c: Likewise.
2445 * elf32-rl78.c: Likewise.
2446 * elf32-rx.c: Likewise.
2447 * elf32-score.c: Likewise.
2448 * elf32-score7.c: Likewise.
2449 * elf32-sh64.c: Likewise.
2450 * elf32-v850.c: Likewise.
2451 * elf32-vax.c: Likewise.
2452 * elf32-visium.c: Likewise.
2453 * elf64-ia64-vms.c: Likewise.
2454 * elf64-mmix.c: Likewise.
2455 * elf64-sh64.c: Likewise.
2456 * elfcode.h: Likewise.
2457 * elfnn-aarch64.c: Likewise.
2458 * elfnn-ia64.c: Likewise.
2459 * elfxx-mips.c: Likewise.
2460 * hpux-core.c: Likewise.
2461 * ieee.c: Likewise.
2462 * ihex.c: Likewise.
2463 * linker.c: Likewise.
2464 * merge.c: Likewise.
2465 * mmo.c: Likewise.
2466 * oasys.c: Likewise.
2467 * pdp11.c: Likewise.
2468 * peXXigen.c: Likewise.
2469 * rs6000-core.c: Likewise.
2470 * vms-alpha.c: Likewise.
2471 * xcofflink.c: Likewise.
2472
c08bb8dd
AM
24732017-04-13 Alan Modra <amodra@gmail.com>
2474
2475 * bfd.c (PRINT_TYPE): Define.
2476 (_doprnt): New function.
2477 (error_handler_internal): Use _doprnt.
2478 * coff-arm.c: Put %A and %B arguments to _bfd_error_handler
2479 calls in their natural order, throughout file.
2480 * coff-mcore.c: Likewise.
2481 * coff-ppc.c: Likewise.
2482 * coff-tic80.c: Likewise.
2483 * cofflink.c: Likewise.
2484 * elf-s390-common.c: Likewise.
2485 * elf.c: Likewise.
2486 * elf32-arm.c: Likewise.
2487 * elf32-i386.c: Likewise.
2488 * elf32-m32r.c: Likewise.
2489 * elf32-msp430.c: Likewise.
2490 * elf32-spu.c: Likewise.
2491 * elf64-ia64-vms.c: Likewise.
2492 * elf64-sparc.c: Likewise.
2493 * elf64-x86-64.c: Likewise.
2494 * elflink.c: Likewise.
2495 * elfnn-aarch64.c: Likewise.
2496 * elfnn-ia64.c: Likewise.
2497 * elfxx-mips.c: Likewise.
2498
10463f39
AM
24992017-04-13 Alan Modra <amodra@gmail.com>
2500
2501 * elf32-arm.c (arm_type_of_stub): Supply missing args to "long
2502 branch veneers" error. Fix double space and format message.
2503 * elf32-avr.c (avr_add_stub): Do not pass NULL as %B arg.
2504 * elf64-ppc.c (tocsave_find): Supply missing %B arg.
2505
4af8774e
AM
25062017-04-13 Alan Modra <amodra@gmail.com>
2507
2508 * bfd-in2.h: Regenerate.
2509
e4097f5e
L
25102017-04-11 H.J. Lu <hongjiu.lu@intel.com>
2511
2512 * elf-properties.c (_bfd_elf_parse_gnu_properties): Remove the
2513 extra `\n' in warning/error messages.
2514 * elf32-i386.c (elf_i386_parse_gnu_properties): Likewise.
2515 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
2516
537616aa
L
25172017-04-11 H.J. Lu <hongjiu.lu@intel.com>
2518
2519 * elf-properties.c (_bfd_elf_parse_gnu_properties): Ignore
2520 processor-specific properties with generic ELF target vector.
2521
bb1dd176
QZ
25222017-04-10 Qing Zhao <qing.zhao@oracle.com>
2523
2524 * elf32-sparc.c (elf_backend_fixup_symbol): New.
2525 * elf64-sparc.c (elf_backend_fixup_symbol): New.
2526 * elfxx-sparc.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): New.
2527 (_bfd_sparc_elf_link_hash_entry): Add has_got_reloc and
2528 has_non_got_reloc.
2529 (link_hash_newfunc): Initialize has_got_reloc and
2530 has_non_got_reloc.
2531 (_bfd_sparc_elf_size_dynamic_sections): Set interp to .interp
2532 section.
2533 (_bfd_sparc_elf_copy_indirect_symbol): Copy has_got_reloc and
2534 has_non_got_reloc.
2535 (_bfd_sparc_elf_check_relocs): Set has_got_reloc and
2536 has_non_got_reloc.
2537 (_bfd_sparc_elf_fixup_symbol): New function.
2538 (allocate_dynrelocs): Don't allocate space for dynamic
2539 relocations and discard relocations against resolved undefined
2540 weak symbols in executable. Don't make resolved undefined weak
2541 symbols in executable dynamic. Keep dynamic non-GOT/non-PLT
2542 relocation against undefined weak symbols in PIE.
2543 (_bfd_sparc_elf_relocate_section): Don't generate dynamic
2544 relocations against resolved undefined weak symbols in PIE
2545 (_bfd_sparc_elf_finish_dynamic_symbol): Keep PLT/GOT entries
2546 without ynamic PLT/GOT relocations for resolved undefined weak
2547 symbols.
2548 Don't generate dynamic relocation against resolved undefined
2549 weak symbol in executable.
2550 (pie_finish_undefweak_symbol): New function.
2551 (_bfd_sparc_elf_finish_dynamic_sections): Call
2552 pie_finish_undefweak_symbol on all symbols in PIE.
2553 * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Add interp.
2554 (_bfd_sparc_elf_fixup_symbol): New function.
2555
d236cfd4
NC
25562017-04-10 Nick Clifton <nickc@redhat.com>
2557
2558 * config.bfd: Remove ns32k from obsolete list.
2559
6f9dbcd4
AM
25602017-04-10 Alan Modra <amodra@gmail.com>
2561
2562 PR 21287
2563 * elf.c (special_sections_f): Match .fini_array and .fini_array.*.
2564 (special_sections_i): Likewise for .init_array.
2565 (special_sections_p): Likewise for .preinit_array.
2566
8170f769
L
25672017-04-07 H.J. Lu <hongjiu.lu@intel.com>
2568
2569 PR ld/19579
2570 PR ld/21306
2571 * elf32-s390.c (elf_s390_finish_dynamic_symbol): Check
2572 ELF_COMMON_DEF_P for common symbols.
2573 * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
2574 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
2575 * elflink.c (_bfd_elf_merge_symbol): Revert commits
2576 202ac193bbbecc96a4978d1ac3d17148253f9b01 and
2577 07492f668d2173da7a2bda3707ff0985e0f460b6.
2578
49f4617b
PA
25792017-04-07 Pedro Alves <palves@redhat.com>
2580
2581 * opncls.c (bfd_get_debug_link_info): Rename to...
2582 (bfd_get_debug_link_info_1): ... this. Change type of second
2583 parameter to void pointer. Adjust.
2584 (bfd_get_debug_link_info): Reimplement on top of
2585 bfd_get_debug_link_info_1.
2586 (separate_debug_file_exists, separate_alt_debug_file_exists):
2587 Change type of second parameter to void pointer. Adjust.
2588 (get_func_type, check_func_type): Change type of second parameter
2589 to void pointer.
2590 (find_separate_debug_file): Add 'func_data' parameter. Pass it to
2591 the callback functions instead of passing the address of a local.
2592 (bfd_follow_gnu_debuglink): Pass address of unsigned long local to
2593 find_separate_debug_file.
2594 (get_alt_debug_link_info_shim): Change type of second parameter to
2595 void pointer. Adjust.
2596 (bfd_follow_gnu_debugaltlink): Adjust to pass NULL to
2597 find_separate_debug_file.
2598 (get_build_id_name, bfd_boolean check_build_id_file): Change type
2599 of second parameter to void pointer. Adjust.
2600 (bfd_follow_build_id_debuglink): Pass address of bfd_build_id
2601 pointer local to find_separate_debug_file.
2602
26032017-04-07 Tristan Gingold <gingold@gingold-Precision-7510>
1fd6d111
TG
2604
2605 * coffgen.c (_bfd_coff_gc_mark_hook): Handle PE weak
2606 external symbols with a definition.
2607 (_bfd_coff_gc_mark_extra_sections): Fix typo.
2608
86abf93a
AM
26092017-04-07 Alan Modra <amodra@gmail.com>
2610
2611 * po/SRC-POTFILES.in: Regenerate.
2612
8dea77f0
AM
26132017-04-05 Alan Modra <amodra@gmail.com>
2614
2615 * elf64-ppc.c (ppc64_elf_gc_sweep_hook): Support ELFv2 PLT
2616 reference counting.
2617
477bdd39
JT
26182017-04-02 Jon Turney <jon.turney@dronecode.org.uk>
2619
2620 (_bfd_XXi_swap_aouthdr_out): For clarity, use defines rather than
2621 numbers for DataDirectory entry indicies passed to
2622 add_data_entry().
2623
a91e1603
L
26242017-04-04 H.J. Lu <hongjiu.lu@intel.com>
2625
2626 * elf.c (get_program_header_size): Add a GNU_MBIND segment for
2627 each GNU_MBIND section and align GNU_MBIND section to page size.
2628 (_bfd_elf_map_sections_to_segments): Create a GNU_MBIND
2629 segment for each GNU_MBIND section.
2630 (_bfd_elf_init_private_section_data): Copy sh_info from input
2631 for GNU_MBIND section.
2632
b5292032
PD
26332017-04-03 Palmer Dabbelt <palmer@dabbelt.com>
2634
2635 * elfnn-riscv.c (GP_NAME): Delete.
2636 (riscv_global_pointer_value): Change GP_NAME to RISCV_GP_SYMBOL.
2637 (_bfd_riscv_relax_lui): Likewise.
2638
ad32986f
NC
26392017-04-04 Nick Clifton <nickc@redhat.com>
2640
2641 PR binutils/21342
2642 * elflink.c (_bfd_elf_define_linkage_sym): Prevent null pointer
2643 dereference.
2644 (bfd_elf_final_link): Only initialize the extended symbol index
2645 section if there are extended symbol tables to list.
2646
46bed679
L
26472017-04-03 H.J. Lu <hongjiu.lu@intel.com>
2648
2649 * Makefile.am (BFD32_BACKENDS): Add elf-properties.lo.
2650 (BFD32_BACKENDS_CFILES): Add elf-properties.c.
2651 * configure.ac (elf): Add elf-properties.lo.
2652 * Makefile.in: Regenerated.
2653 * configure: Likewise.
2654 * elf-bfd.h (elf_property_kind): New.
2655 (elf_property): Likewise.
2656 (elf_property_list): Likewise.
2657 (elf_properties): Likewise.
2658 (_bfd_elf_parse_gnu_properties): Likewise.
2659 (_bfd_elf_get_property): Likewise.
2660 (_bfd_elf_link_setup_gnu_properties): Likewise.
2661 (elf_backend_data): Add parse_gnu_properties, merge_gnu_properties
2662 and setup_gnu_properties.
2663 (elf_obj_tdata): Add properties.
2664 * elf-properties.c: New file.
2665 * elf32-i386.c (elf_i386_parse_gnu_properties): New.
2666 (elf_i386_merge_gnu_properties): Likewise.
2667 (elf_backend_parse_gnu_properties): Likewise.
2668 (elf_backend_merge_gnu_properties): Likewise.
2669 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
2670 (elf_x86_64_merge_gnu_properties): Likewise.
2671 (elf_backend_parse_gnu_properties): Likewise.
2672 (elf_backend_merge_gnu_properties): Likewise.
2673 * elfxx-target.h (elf_backend_merge_gnu_properties): Likewise.
2674 (elf_backend_parse_gnu_properties): Likewise.
2675 (elf_backend_setup_gnu_properties): Likewise.
2676 (elfNN_bed): Add elf_backend_parse_gnu_properties,
2677 elf_backend_merge_gnu_properties and
2678 elf_backend_setup_gnu_properties.
2679
f96bd6c2
PC
26802017-03-30 Pip Cet <pipcet@gmail.com>
2681
2682 * elf32-wasm32.c: Add relocation code, two relocs.
2683 * reloc.c: Add wasm32 relocations.
2684 * libbfd.h: Regenerate.
2685 * bfd-in2.h: Regenerate.
2686 * bfd/po/bfd.pot: Regenerate.
2687
e643cb45
NC
26882017-03-29 Nick Clifton <nickc@redhat.com>
2689
2690 PR binutils/18025
2691 * coff-bfd.h (struct coff_section_data): Add new fields:
2692 saved_bias and bias.
2693 * coffgen.c (coff_find_nearest_line_with_names): Cache the bias
2694 computed for PE binaries.
2695 * dwarf2.c (scan_unit_for_symbols): Only warn once about each
2696 missing abbrev.
2697
086554e8
HPN
26982017-03-28 Hans-Peter Nilsson <hp@axis.com>
2699
2700 PR ld/16044
2701 * elf32-cris.c (elf_cris_adjust_gotplt_to_got): Adjust BFD_ASSERT
2702 to handle a local symbol with a hash-symbol-entry; without PLT.
2703 Add BFD_ASSERT for an incidental case with GOT entry present.
2704 (cris_elf_check_relocs): Increment PLT refcount only if the symbol
2705 isn't forced-or-set local.
2706
a6be0538
PC
27072017-03-27 Pip Cet <pipcet@gmail.com>
2708
2709 * wasm-module.c: New file to support WebAssembly modules.
2710 * wasm-module.h: New file to support WebAssembly modules.
2711 * doc/webassembly.texi: Start documenting wasm-module.c.
2712 * config.bfd: Add wasm_vec.
2713 * targets.c: Likewise.
2714 * configure.ac: Likewise.
2715 * Makefile.am: Add entries for wasm-module.c.
2716 * Makefile.in: Regenerate.
2717 * configure: Regenerate.
2718 * po/SRC-POTFILES.in: Regenerate.
2719
79b1d3cb
PC
27202017-03-27 Pip Cet <pipcet@gmail.com>
2721
2722 * cpu-wasm32.c: New file to support wasm32 architecture.
2723 * elf32-wasm32.c: New file to support wasm32 architecture.
2724 * Makefile.am: Add wasm32 architecture.
2725 * archures.c: Likewise.
2726 * config.bfd: Likewise.
2727 * configure.ac: Likewise.
2728 * targets.c: Likewise.
2729 * Makefile.in: Regenerate.
2730 * bfd-in2.h: Regenerate.
2731 * configure: Regenerate.
2732 * po/SRC-POTFILES.in: Regenerate.
2733
aaed6f5b
AM
27342017-03-20 Alan Modra <amodra@gmail.com>
2735
2736 PR 21266
2737 * elf64-ppc.c (compare_symbols): Stabilize sort.
2738
82e66161
AM
27392017-03-18 Alan Modra <amodra@gmail.com>
2740
2741 * elf64-ppc.c (struct ppc_link_hash_table): Add
2742 local_ifunc_resolver and maybe_local_ifunc_resolver.
2743 (ppc_build_one_stub): Set flags on emitting dynamic
2744 relocation to ifunc.
2745 (ppc64_elf_relocate_section): Likewise.
2746 (ppc64_elf_finish_dynamic_symbol): Likewise.
2747 (ppc64_elf_finish_dynamic_sections): Error on DT_TEXTREL with
2748 local dynamic relocs to ifuncs.
2749 * elf32-ppc.c (struct ppc_elf_link_hash_table): Add
2750 local_ifunc_resolver and maybe_local_ifunc_resolver.
2751 (ppc_elf_relocate_section): Set flag on emitting dynamic
2752 relocation to ifuncs.
2753 (ppc_elf_finish_dynamic_symbol): Likewise.
2754 (ppc_elf_finish_dynamic_sections): Error on DT_TEXTREL with local
2755 dynamic relocs to ifuncs.
2756
f955cccf
NC
27572017-03-13 Nick Clifton <nickc@redhat.com>
2758
2759 PR binutils/21202
2760 * reloc.c (BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC): Rename to
2761 BFD_RELOC_AARCH64_TLSDESC_LD64_LO12.
2762 (BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC): Rename to
2763 BFD_RELOC_AARCH64_TLSDESC_ADD_LO12.
2764 * bfd-in2.h: Regenerate.
2765 * libbfd.h: Regenerate.
2766 * elfnn-aarch64.c (IS_AARCH64_TLS_RELAX_RELOC): Update reloc
2767 names.
2768 (IS_AARCH64_TLSDESC_RELOC): Likewise.
2769 (elfNN_aarch64_howto_table): Likewise.
2770 (aarch64_tls_transition_without_check): Likewise.
2771 (aarch64_reloc_got_type): Likewise.
2772 (elfNN_aarch64_final_link_relocate): Likewise.
2773 (elfNN_aarch64_tls_relax): Likewise.
2774 (elfNN_aarch64_relocate_section): Likewise.
2775 (elfNN_aarch64_gc_sweep_hook): Likewise.
2776 (elfNN_aarch64_check_relocs): Likewise.
2777 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
2778 (_bfd_aarch64_elf_resolve_relocation): Likewise.
2779
4aef7643
AM
27802017-03-11 Alan Modra <amodra@gmail.com>
2781
2782 * elf32-ppc.c: Remove ATTRIBUTE_UNUSED throughout when function
2783 parameter is in fact used. Whitespace fixes.
2784 * elf64-ppc.c: Likewise.
2785
f03265d9
ST
27862017-03-09 Sam Thursfield <sam.thursfield@codethink.co.uk>
2787
2788 * rs6000-core.c (CORE_NEW): Simplify macro when
2789 AIX_CORE_DUMPX_CORE and BFD64 are true to avoid compile warning.
2790
b1b07054
AM
27912017-03-07 Alan Modra <amodra@gmail.com>
2792
2793 PR 21224
2794 PR 20519
2795 * elf64-ppc.c (ppc64_elf_relocate_section): Add missing
2796 dyn_relocs check.
2797
2e0ce1c8
AM
27982017-03-05 Alan Modra <amodra@gmail.com>
2799
2800 * elf-bfd.h (struct eh_cie_fde): Add u.cie.per_encoding_aligned8.
2801 * elf-eh-frame.c (size_of_output_cie_fde): Don't align here.
2802 (next_cie_fde_offset): New function.
2803 (_bfd_elf_parse_eh_frame): Set u.cie.per_encoding_aligned8.
2804 (_bfd_elf_discard_section_eh_frame): Align zero terminator to
2805 four bytes. Align CIEs to four or eight bytes depending on
2806 per_encoding_aligned8. Align FDEs according to their encoding.
2807 Pad last FDE to output section alignment.
2808 (_bfd_elf_write_section_eh_frame): Adjust to suit. Remove
2809 assertion.
2810 * elf64-ppc.c (glink_eh_frame_cie): Delete padding.
2811 (ppc64_elf_size_stubs): Pad glink eh_frame as per elf-eh-frame.c.
2812 (ppc64_elf_finish_dynamic_sections): Adjust to suit.
2813
f98450c6
NC
28142017-03-02 Martin Bickel <binutils@ineranves.de>
2815
2816 PR ld/21212
2817 * elf.c (rewrite_elf_program_header): Do not issue a warning for
d20928fa 2818 empty segments which have a zero filesz, but a non-zero memsz.
f98450c6 2819
673cff9b
AM
28202017-03-02 Alan Modra <amodra@gmail.com>
2821
2822 * elf32-ppc.c (ppc_elf_vle_split16): Correct insn mask typo.
2823
3de43e7b
AM
28242017-02-28 Alan Modra <amodra@gmail.com>
2825
2826 * elf64-ppc.c (ppc64_elf_ha_reloc): Revert last change.
2827 (ppc64_elf_relocate_section): Likewise.
2828
4ef97a1b
AM
28292017-02-28 Alan Modra <amodra@gmail.com>
2830
2831 PR 20995
2832 * elf32-nios2.c (nios2_elf32_relocate_section): Use htab
2833 rather than elf32_nios2_hash_table or elf_hash_table.
2834 (create_got_section): Likewise.
2835 (nios2_elf32_finish_dynamic_symbol): Likewise.
2836 (nios2_elf32_adjust_dynamic_symbol): Likewise.
2837 (nios2_elf32_size_dynamic_sections): Likewise.
2838 (nios2_elf32_check_relocs): Delete dynobj, sgot, and srelgot
2839 vars. Use htab equivalents directly instead. Don't create
2840 all dynamic sections on needing just the GOT. Use a goto
2841 rather than a fall-through with reloc test. Ensure
2842 htab->dynobj is set when making dynamic sreloc section.
2843 (nios2_elf32_finish_dynamic_sections): Delete dynobj, use htab
2844 equivalent directly instead. Don't segfault on looking for
2845 .dynamic when dynamic sections have not been created. Don't
2846 segfault on .got.plt being discarded.
2847 (nios2_elf32_size_dynamic_sections): Delete plt and got vars.
2848 Don't set "relocs" on .rela.plt. Do handle .sbss. Delete
2849 fixme and another not so relevant comment.
2850 (nios2_elf_add_symbol_hook): Delete dynobj var. If not
2851 already set, set hash table dynobj on creating .sbss.
2852
7ba71655
AM
28532017-02-28 Alan Modra <amodra@gmail.com>
2854
2855 * reloc.c (BFD_RELOC_PPC_16DX_HA): New.
2856 * elf64-ppc.c (ppc64_elf_howto_raw <R_PPC64_16DX_HA>): New howto.
2857 (ppc64_elf_reloc_type_lookup): Translate new bfd reloc.
2858 (ppc64_elf_ha_reloc): Correct overflow test on REL16DX_HA.
2859 (ppc64_elf_relocate_section): Likewise.
2860 * elf32-ppc.c (ppc_elf_howto_raw <R_PPC_16DX_HA>): New howto.
2861 (ppc_elf_reloc_type_lookup): Translate new bfd reloc.
2862 (ppc_elf_check_relocs): Handle R_PPC_16DX_HA to pacify gcc.
2863 * libbfd.h: Regenerate.
2864 * bfd-in2.h: Regenerate.
2865
afbf7e8e
AM
28662017-02-28 Alan Modra <amodra@gmail.com>
2867
2868 * elflink.c (_bfd_elf_create_dynamic_sections): Don't make
2869 dynamic .data.rel.ro read-only.
2870 * elf32-arm.c (elf32_arm_finish_dynamic_symbol): Compare section
2871 rather than section flags when deciding where copy reloc goes.
2872 * elf32-cris.c (elf_cris_finish_dynamic_symbol): Likewise.
2873 * elf32-hppa.c (elf32_hppa_finish_dynamic_symbol): Likewise.
2874 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Likewise.
2875 * elf32-metag.c (elf_metag_finish_dynamic_symbol): Likewise.
2876 * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Likewise.
2877 * elf32-nios2.c (nios2_elf32_finish_dynamic_symbol): Likewise.
2878 * elf32-or1k.c (or1k_elf_finish_dynamic_symbol): Likewise.
2879 * elf32-ppc.c (ppc_elf_finish_dynamic_symbol): Likewise.
2880 * elf32-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
2881 * elf32-tic6x.c (elf32_tic6x_finish_dynamic_symbol): Likewise.
2882 * elf32-tilepro.c (tilepro_elf_finish_dynamic_symbol): Likewise.
2883 * elf64-ppc.c (ppc64_elf_finish_dynamic_symbol): Likewise.
2884 * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
2885 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
2886 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Likewise.
2887 * elfnn-riscv.c (riscv_elf_finish_dynamic_symbol): Likewise.
2888 * elfxx-mips.c (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise.
2889 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Likewise.
2890 * elfxx-tilegx.c (tilegx_elf_finish_dynamic_symbol): Likewise.
2891
0e392101
MR
28922017-02-28 Maciej W. Rozycki <macro@imgtec.com>
2893
2894 * elfxx-mips.c (mips_elf_perform_relocation): Also handle the
2895 `jalr $0, $25' instruction encoding.
2896
bd757ca7
NC
28972017-02-27 Nick Clifton <nickc@redhat.com>
2898
2899 PR ld/21180
2900 * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Avoid
2901 generating a seg-fault when encountering a symbol that has been
2902 deleted by garbage collection.
2903
034fed0b
AM
29042017-02-25 Alan Modra <amodra@gmail.com>
2905
2906 * elf32-arc.c (struct dynamic_sections): Delete.
2907 (enum dyn_section_types): Delete.
2908 (dyn_section_names): Delete.
2909 (arc_create_dynamic_sections): Delete.
2910 (elf_arc_finish_dynamic_sections): Don't call the above. Don't
2911 segfault on discarded .rela.plt section.
2912 (elf_arc_size_dynamic_sections): Formatting. Don't call
2913 arc_create_dynamic_sections. Don't allocate memory for sections
2914 handled by the generic linker. Correct code finding relocs in
2915 read-only sections. Set SEC_EXCLUDE on zero size .got,
2916 .got.plt, and .dynbss sections. Do set .interp for pies.
2917
d0f744f9
AW
29182017-02-24 Andrew Waterman <andrew@sifive.com>
2919
2920 * elfnn-riscv.c (GP_NAME): New macro.
2921 (riscv_global_pointer_value): Use it.
2922 (_bfd_riscv_relax_lui): If symbol and global pointer are in same
2923 output section, consider only that section's alignment.
2924
5d58c733
MR
29252017-02-23 Maciej W. Rozycki <macro@imgtec.com>
2926
2927 * elfxx-mips.h (_bfd_mips_relax_section): Remove prototype.
2928 * elfxx-mips.c (_bfd_mips_relax_section): Remove function.
2929 * elf64-mips.c (bfd_elf64_bfd_relax_section): Remove macro.
2930 * elfn32-mips.c (bfd_elf32_bfd_relax_section): Likewise.
2931
c1556ecd
MR
29322017-02-23 Maciej W. Rozycki <macro@imgtec.com>
2933
2934 * elfxx-mips.c (mips_elf_calculate_relocation) <R_MIPS_JALR>
2935 <R_MICROMIPS_JALR>: Discard relocation if `cross_mode_jump_p'
2936 or misaligned.
2937
5499c7c7
AM
29382017-02-23 Alan Modra <amodra@gmail.com>
2939
2940 PR 20744
2941 * elf32-ppc.c (ppc_elf_howto_raw): Correct dst_mask on all VLE
2942 16D relocations.
2943 (ppc_elf_vle_split16): Correct field mask and shift for 16D relocs.
2944 (ppc_elf_relocate_section): Correct calculation for VLE SDAREL
2945 relocs.
2946
902e9fc7
MR
29472017-02-22 Maciej W. Rozycki <macro@imgtec.com>
2948
2949 PR ld/20828
2950 * elflink.c (bfd_elf_size_dynamic_sections): Move symbol version
2951 processing ahead of the call to `elf_gc_sweep_symbol'.
2952
758d96d8
NC
29532017-02-22 Nick Clifton <nickc@redhat.com>
2954
2955 PR binutils/21193
2956 * opncls.c (bfd_create_gnu_debuglink_section): Give the newly
2957 created section 4-byte alignment.
2958
6528b6eb
AM
29592017-02-22 Alan Modra <amodra@gmail.com>
2960
2961 * elf64-ppc.c (ppc64_elf_finish_dynamic_sections): Don't segfault
2962 on .got or .plt output section being discarded by script.
2963 * elf32-ppc.c (ppc_elf_finish_dynamic_sections): Likewise. Move
2964 vxworks splt temp.
2965
24f1a751
AM
29662017-02-21 Alan Modra <amodra@gmail.com>
2967
2968 * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Only emit
2969 DT_RELA, DT_RELASZ, and DT_RELAENT when DT_RELASZ is non-zero.
2970
64487780
AM
29712017-02-20 Alan Modra <amodra@gmail.com>
2972
2973 PR 21181
2974 * elflink.c (bfd_elf_final_link): Make DT_REL/DT_RELA zero
2975 if DT_RELSZ/DT_RELASZ is zero.
2976
6438d1be
NC
29772017-02-17 Nick Clifton <nickc@redhat.com>
2978
2979 * compress.c (bfd_get_full_section_contents): Remember to reduce
2980 compressed size by the sizeof the compression header when
2981 decompressing the contents.
2982
4bc26c69
PA
29832017-02-17 Pedro Alves <palves@redhat.com>
2984
2985 * srec.c (Chunk): Rename to ...
2986 (_bfd_srec_len): ... this.
2987 (S3Forced): Rename to ...
2988 (_bfd_srec_forceS3): ... this.
2989 * objcopy.c: Adjust all references.
2990
7ec22e0f
PA
29912017-02-17 Pedro Alves <palves@redhat.com>
2992
2993 * archive.c (bsd_write_armap): Rename to ...
2994 (_bfd_bsd_write_armap): ... this.
2995 (coff_write_armap): Rename to ...
2996 (_bfd_coff_write_armap): ... this.
2997 * libbfd-in.h (bsd_write_armap): Rename to ...
2998 (_bfd_bsd_write_armap): ... this.
2999 (coff_write_armap): Rename to ...
3000 (_bfd_coff_write_armap): ... this.
3001 * aout-target.h, aout-tic30.c: Adjust all users.
3002 * libbfd.h: Regenerate.
3003
8c8402cc
PA
30042017-02-17 Pedro Alves <palves@redhat.com>
3005
3006 * bfd-in.h (bfd_read, bfd_write): Adjust to rename.
3007 (warn_deprecated): Rename to ...
3008 (_bfd_warn_deprecated): ... this.
3009 * libbfd.c (warn_deprecated): Rename to ...
3010 (_bfd_warn_deprecated): ... this.
3011 * bfd-in2.h: Regenerate.
3012
c7c3d11b
PA
30132017-02-17 Pedro Alves <palves@redhat.com>
3014
3015 * bfdio.c (real_ftell): Rename to ...
3016 (_bfd_real_ftell): ... this.
3017 (real_fseek): Rename to ...
3018 (_bfd_real_fseek): ... this.
3019 (real_fopen): Rename to ...
3020 (_bfd_real_fopen): ... this.
3021 * libbfd-in.h (real_ftell): Rename to ...
3022 (_bfd_real_ftell): ... this.
3023 (real_fseek): Rename to ...
3024 (_bfd_real_fseek): ... this.
3025 (real_fopen): Rename to ...
3026 (_bfd_real_fopen): ... this.
3027 * cache.c, dwarf2.c, opncls.c: Adjust all callers.
3028 * libbfd.h: Regenerate.
3029
4265548c
PA
30302017-02-17 Pedro Alves <palves@redhat.com>
3031
3032 * dwarf2.c, elf-attrs.c, elf32-nds32.c: Adjust all callers.
3033 * libbfd.c (read_unsigned_leb128): Rename to ...
3034 (_bfd_read_unsigned_leb128): ... this.
3035 (read_signed_leb128): Rename to ...
3036 (_bfd_read_signed_leb128): ... this.
3037 (safe_read_leb128): Rename to ...
3038 (_bfd_safe_read_leb128): ... this.
3039 * libbfd-in.h (read_unsigned_leb128): Rename to ...
3040 (_bfd_read_unsigned_leb128): ... this.
3041 (read_signed_leb128): Rename to ...
3042 (_bfd_read_signed_leb128): ... this.
3043 (safe_read_leb128): Rename to ...
3044 (_bfd_safe_read_leb128): ... this.
3045 * libbfd.h: Renegerate.
3046
3239a423
AB
30472017-02-16 Andrew Burgess <andrew.burgess@embecosm.com>
3048
3049 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Perform symbol lookup
3050 before trying to fine matching file and line information.
3051
90ed9b8b
AB
30522017-02-16 Andrew Burgess <andrew.burgess@embecosm.com>
3053
3054 * dwarf2.c (struct dwarf2_debug): Add orig_bfd member.
3055 (_bfd_dwarf2_slurp_debug_info): If stashed debug information does
3056 not match current bfd, then reload debug information. Record bfd
3057 we're loading debug info for in the stash. If we have debug
3058 informatin in the cache then perform section placement before
3059 returning.
3060
a8c75b76
AM
30612017-02-16 Alan Modra <amodra@gmail.com>
3062
3063 PR 21000
3064 * elf-bfd.h (struct elf_backend_data): Add no_page_alias.
3065 * elfxx-target.h (elf_backend_no_page_alias): Define.
3066 (elfNN_bed): Init new field.
3067 * elf.c (assign_file_positions_for_load_sections): If no_page_alias
3068 ensure PT_LOAD segment starts on a new page.
3069 * elf32-hppa.c (elf_backend_no_page_alias): Define.
3070
247d6c4c
AM
30712017-02-16 Alan Modra <amodra@gmail.com>
3072
3073 PR 21132
3074 * elf32-hppa.c (allocate_plt_static): Allocate space for relocs
3075 if pic.
3076
90571206
JW
30772017-02-16 Jiong Wang <jiong.wang@arm.com>
3078
3079 * bfd.c (BFD_FLAGS_SAVED): Add BFD_LINKER_CREATED.
3080 * bfd-in2.h: Regenerated.
3081
2a568401
L
30822017-02-15 H.J. Lu <hongjiu.lu@intel.com>
3083
3084 PR ld/21168
3085 * elf32-i386.c (elf_i386_relocate_section): Allow
3086 "lea foo@GOT, %reg" in PIC.
3087
a5def14f
L
30882017-02-15 H.J. Lu <hongjiu.lu@intel.com>
3089
3090 PR ld/20244
3091 * elf32-i386.c (elf_i386_relocate_section): Properly get IFUNC
3092 symbol name when reporting R_386_GOT32/R_386_GOT32X relocation
3093 error against local IFUNC symbol without a base register for
3094 PIC.
3095
174d0a74
MR
30962017-02-15 Maciej W. Rozycki <macro@imgtec.com>
3097
3098 * elf32-ppc.c (ppc_elf_check_relocs): Use `%H:' rather than
3099 `%P: %H:' with `info->callbacks->einfo'.
3100 (ppc_elf_relocate_section): Likewise.
3101 * elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
3102 (ppc64_elf_edit_toc): Likewise.
3103 (ppc64_elf_relocate_section): Likewise.
3104
e278ae05
AM
31052017-02-14 Alan Modra <amodra@gmail.com>
3106
3107 * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Support
3108 --gc-keep-exported, and test versioned field of sym rather than
3109 looking for @ in name.
3110
10ddfe62
PD
31112017-02-13 Palmer Dabbelt <palmer@dabbelt.com>
3112
3113 * elfnn-riscv.c (riscv_global_pointer_value): Change _gp to
3114 __global_pointer$.
3115
d11135f5
NC
31162017-02-13 Nick Clifton <nickc@redhat.com>
3117
3118 PR binutils/21151
3119 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Check for an invalid
3120 unit length field.
3121
cc162427
AW
31222017-02-07 Andrew Waterman <andrew@sifive.com>
3123
3124 * elfnn-riscv.c (riscv_elf_finish_dynamic_sections): Only write PLT
3125 entry size if PLT header is written.
3126
3d044c0c
SL
31272017-02-06 Sheldon Lobo <sheldon.lobo@oracle.com>
3128
3129 Fix sparc64 dynamic relocation processing to use the dynamic
3130 symbol count.
3131 * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Use 'dynamic'
3132 to determine if bfd_get_symcount() or bfd_get_dynamic_symcount()
3133 should be used.
3134
1b7e3d2f
NC
31352017-02-03 Nick Clifton <nickc@redhat.com>
3136
3137 PR 21096
3138 * coffcode.h (coff_write_object_contents): Enlarge size of
3139 s_name_buf in order to avoid compile time warning about possible
3140 integer truncation.
3141 * elf32-nds32.c (nds32_elf_ex9_import_table): Mask off lower
3142 32-bits of insn value before printing into buffer.
3143
e17b0c35
MR
31442017-02-02 Maciej W. Rozycki <macro@imgtec.com>
3145
3146 * elfxx-mips.c (mips_elf_hash_sort_data): Add
3147 `max_local_dynindx'.
3148 (mips_elf_sort_hash_table): Handle it.
3149 (mips_elf_sort_hash_table_f) <GGA_NONE>: For forced local
3150 symbols bump up `max_local_dynindx' rather than
3151 `max_non_got_dynindx'.
3152
55f8b9d2
MR
31532017-02-02 Maciej W. Rozycki <macro@imgtec.com>
3154
3155 * elfxx-mips.c (mips_elf_hash_sort_data): Convert the
3156 `min_got_dynindx', `max_unref_got_dynindx' and
3157 `max_non_got_dynindx' members to the `bfd_size_type' data type.
3158 (mips_elf_sort_hash_table): Adjust accordingly.
3159
0f8c4b60
MR
31602017-02-02 Maciej W. Rozycki <macro@imgtec.com>
3161
3162 * elfxx-mips.c (mips_elf_sort_hash_table): Use `htab' throughout
3163 to access the hash table.
3164
17a80fa8
MR
31652017-02-02 Maciej W. Rozycki <macro@imgtec.com>
3166
3167 * elfxx-mips.c (mips_elf_sort_hash_table): Move assertion on
3168 non-NULL `htab' to the beginning.
3169
8f56d4fd
MR
31702017-02-02 Maciej W. Rozycki <macro@imgtec.com>
3171
3172 * elflink.c (elf_gc_sweep): Wrap overlong line.
3173
8b10b0b3
MR
31742017-01-30 Maciej W. Rozycki <macro@imgtec.com>
3175
3176 * elfxx-mips.h (_bfd_mips_elf_insn32): Rename prototype to...
3177 (_bfd_mips_elf_linker_flags): ... this. Add another parameter.
3178 * elfxx-mips.c (mips_elf_link_hash_table): Add
3179 `ignore_branch_isa' member.
3180 (mips_elf_perform_relocation): Do not treat an ISA mode mismatch
3181 in branch relocation calculation as an error if
3182 `ignore_branch_isa' has been set.
3183 (_bfd_mips_elf_insn32): Rename to...
3184 (_bfd_mips_elf_linker_flags): ... this. Rename the `on'
3185 parameter to `insn32' and add an `ignore_branch_isa' parameter.
3186 Handle the new parameter.
3187
1fbd05e1
HPN
31882017-01-27 Hans-Peter Nilsson <hp@axis.com>
3189
22d9a0de
HPN
3190 * elf32-cris.c (elf_cris_finish_dynamic_symbol): Remove now unused
3191 local variable dynobj.
3192
1fbd05e1
HPN
3193 PR ld/20995
3194 * elf32-cris.c (elf_cris_size_dynamic_sections): Handle sdynrelro.
3195 (elf_cris_adjust_dynamic_symbol): Place variables copied into the
3196 executable from read-only sections into sdynrelro.
3197 (elf_cris_finish_dynamic_symbol): Select sreldynrelro for
3198 dynamic relocs in sdynrelro.
3199 (elf_backend_want_dynrelro): Define.
3200
4a7324e1
SH
32012017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
3202
3203 * config.bfd (*-*-rtemsaout*): Mark as removed.
3204
c75b4ebd
SH
32052017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
3206
3207 * config.bfd (powerpcle-*-rtems*): Do not mark as removed.
3208 (arm-*-rtems*): Move to (arm*-*-eabi*).
3209 (i[3-7]86-*-rtems*): Move to (i[3-7]86-*-elf*).
3210 (m68-*-rtems*): Move to (m68*-*-elf*).
3211
850d84f6
SH
32122017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
3213
3214 * config.bfd (*-*-rtemscoff*): Mark as removed.
3215
b531344c
MR
32162017-01-24 Maciej W. Rozycki <macro@imgtec.com>
3217
3218 PR ld/20828
3219 * elflink.c (bfd_elf_record_link_assignment): Revert last
3220 change and don't ever clear `forced_local'. Set `mark'
3221 unconditionally.
3222 (elf_gc_sweep_symbol_info, elf_gc_sweep_symbol): Reorder within
3223 file.
3224 (elf_gc_sweep): Move the call to `elf_gc_sweep_symbol'...
3225 (bfd_elf_size_dynamic_sections): ... here.
3226 * elf32-ppc.c (ppc_elf_tls_setup): Don't clear `forced_local'
3227 and set `mark' instead in `__tls_get_addr_opt' processing.
3228 * elf64-ppc.c (ppc64_elf_tls_setup): Likewise.
3229
f0158f44
AM
32302017-01-24 Alan Modra <amodra@gmail.com>
3231
3232 * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Merge two cases
3233 where dynamic relocs are preferable. Allow ifunc too.
3234 (ensure_undefweak_dynamic): New function.
3235 (allocate_dynrelocs): Use it here. Move plt handling last and
3236 don't make symbols dynamic, simplifying loop. Only make undef
3237 weak symbols with GOT entries dynamic. Correct condition
3238 for GOT relocs. Handle dynamic relocs on ifuncs. Correct
3239 comments. Remove goto.
3240 (ppc_elf_relocate_section): Correct test for using dynamic
3241 symbol on GOT relocs. Rearrange test for emitting GOT relocs
3242 to suit. Set up explicit tls_index entries and implicit GOT
3243 tls_index entries resolvable at link time for
3244 __tls_get_addr_opt. Simplify test to clear mem for prelink.
3245 * elf64-ppc.c (allocate_got): Correct condition for GOT relocs.
3246 (ensure_undefweak_dynamic): New function.
3247 (allocate_dynrelocs): Use it here. Only make undef weak symbols
3248 with GOT entries dynamic. Remove unnecessary test of
3249 WILL_CALL_FINISH_DYNAMIC_SYMBOL in PLT handling.
3250 (ppc64_elf_relocate_section): Correct test for using dynamic
3251 symbol on GOT relocs. Rearrange test for emitting GOT relocs
3252 to suit. Set up explicit tls_index entries and implicit GOT
3253 tls_index entries resolvable at link time for __tls_get_addr_opt.
3254 Simplify expression to clear mem for prelink.
3255
2d0ca824
YN
32562017-01-23 Yury Norov <ynorov@caviumnetworks.com>
3257
3258 * elfnn-aarch64.c: Fix relaxations for ILP32 mode.
3259
7f784814
JW
32602017-01-20 Jiong Wang <jiong.wang@arm.com>
3261
3262 * elfnn-aarch64.c (elf_aarch64_hash_symbol): New function.
3263 (elf_backend_hash_symbol): Define.
3264
81ff47b3
MR
32652017-01-18 Maciej W. Rozycki <macro@imgtec.com>
3266
3267 PR ld/20828
3268 * elflink.c (bfd_elf_record_link_assignment): Clear any
3269 `forced_local' marking for DSO symbols that are not being
3270 provided.
3271
640d6bfd
KLC
32722017-01-17 Kuan-Lin Chen <kuanlinchentw@gmail.com>
3273
3274 * elfnn-riscv.c (riscv_elf_object_p): New function.
3275
8361ed4d
L
32762017-01-12 H.J. Lu <hongjiu.lu@intel.com>
3277
3278 PR ld/21038
3279 * elf64-x86-64.c (elf_x86_64_link_hash_table): Add
3280 plt_bnd_eh_frame.
3281 (elf_x86_64_check_relocs): Create .eh_frame section for the
3282 .plt.bnd section.
3283 (elf_x86_64_size_dynamic_sections): Allocate and initialize
3284 .eh_frame section for the .plt.bnd section.
3285 (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
3286 for the .plt.bnd section.
3287
2425a30e
NC
32882017-01-12 Nick Clifton <nickc@redhat.com>
3289
3290 PR binutils/20876
3291 * opncls.c (find_separate_debug_file): Add include_dirs
3292 parameter. Only include the directory part of the bfd's filename
3293 in search paths if include_dirs is true. Add a couple of extra
3294 locations for looking for debug files.
3295 ( bfd_follow_gnu_debuglink): Update invocation of
3296 find_separate_debug_file.
3297 (bfd_follow_gnu_debugaltlink): Likewise.
3298 (get_build_id): New function: Finds the build-id of the given bfd.
3299 (get_build_id_name): New function: Computes the name of the
3300 separate debug info file for a bfd, based upon its build-id.
3301 (check_build_id_file): New function: Checks to see if a separate
3302 debug info file exists at the given location, and that its
3303 build-id matches that of the original bfd.
3304 (bfd_follow_build_id_debuglink): New function: Finds a separate
3305 debug info file for a given bfd by using the build-id method.
3306 * dwarf2.c (_bfd_dwarf2_slurp_debug_info): Try using the build-id
3307 method of locating a separate debug info file before using the
3308 debuglink method.
3309 * bfd-in2.h: Regenerate.
3310
9e659176
L
33112017-01-11 H.J. Lu <hongjiu.lu@intel.com>
3312
3313 PR ld/21038
3314 * elf64-x86-64.c (elf_x86_64_eh_frame_bnd_plt): New.
3315 (elf_x86_64_bnd_arch_bed): Use elf_x86_64_eh_frame_bnd_plt and
3316 elf_x86_64_eh_frame_plt_got.
3317 (elf_x86_64_size_dynamic_sections): Get unwind info from
3318 elf_x86_64_bnd_arch_bed for the BND PLT.
3319
f2e2d2f5
JS
33202017-01-11 Jeremy Soller <jackpot51@gmail.com>
3321
3322 * config.bfd: Add entries for i686-redox and x86_64-redox.
3323
52b232b3
L
33242017-01-10 H.J. Lu <hongjiu.lu@intel.com>
3325
3326 * elf32-i386.c (elf_i386_check_relocs): Align .eh_frame section
3327 to 4 bytes.
3328 * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Align
3329 .eh_frame section to 4 bytes for x32.
3330 (elf_x86_64_check_relocs): Likewise.
3331
fff53dae
L
33322017-01-10 H.J. Lu <hongjiu.lu@intel.com>
3333
3334 PR ld/20830
3335 * elf32-i386.c (elf_i386_eh_frame_plt_got): New.
3336 (PLT_GOT_FDE_LENGTH): Likewise.
3337 (elf_i386_plt_layout): Add eh_frame_plt_got and
3338 eh_frame_plt_got_size.
3339 (elf_i386_plt): Updated.
3340 (elf_i386_link_hash_table): Add plt_got_eh_frame.
3341 (elf_i386_check_relocs): Create .eh_frame section for .plt.got.
3342 (elf_i386_size_dynamic_sections): Allocate and initialize
3343 .eh_frame section for .plt.got.
3344 (elf_i386_finish_dynamic_sections): Adjust .eh_frame section for
3345 .plt.got.
3346 (elf_i386_nacl_plt): Add FIXME for eh_frame_plt_got and
3347 eh_frame_plt_got_size.
3348 * elf64-x86-64.c (elf_x86_64_eh_frame_plt_got): New.
3349 (PLT_GOT_FDE_LENGTH): Likewise.
3350 (elf_x86_64_backend_data): Add eh_frame_plt_got and
3351 eh_frame_plt_got_size.
3352 (elf_x86_64_arch_bed): Updated.
3353 (elf_x86_64_bnd_arch_bed): Add FIXME for eh_frame_plt_got and
3354 eh_frame_plt_got_size.
3355 (elf_x86_64_nacl_arch_bed): Likewise.
3356 (elf_x86_64_link_hash_table): Add plt_got_eh_frame.
3357 (elf_x86_64_check_relocs): Create .eh_frame section for .plt.got.
3358 (elf_x86_64_size_dynamic_sections): Allocate and initialize
3359 .eh_frame section for .plt.got.
3360 (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
3361 for .plt.got.
3362
f129e49f
L
33632017-01-10 H.J. Lu <hongjiu.lu@intel.com>
3364
3365 * elf32-i386.c (elf_i386_size_dynamic_sections): Set
3366 plt_eh_frame->size to eh_frame_plt_size and use eh_frame_plt.
3367
cd6581da
NC
33682017-01-09 Nick Clifton <nickc@redhat.com>
3369
3370 * dwarf2.c (lookup_address_in_function_table): Return early if
3371 there are no functions in the given comp unit, or if the high
3372 address of the last function in the comp unit is less than the
3373 desired address.
3374
98f02962
NC
33752017-01-09 Nick Clifton <nickc@redhat.com>
3376
3377 PR binutils/21013
3378 * coffgen.c (_bfd_coff_get_external_symbols): Generate an error
3379 message if there are too many symbols to load.
3380
ae4fda66
JC
33812017-01-04 James Clarke <jrtc27@jrtc27.com>
3382
3383 * elf64-alpha.c (elf64_alpha_relax_opt_call): Don't set tsec_free
3384 if relocs are cached.
3385
de1010f4
RF
33862017-01-03 Rich Felker <bugdal@aerifal.cx>
3387
3388 PR ld/21017
3389 * elf32-microblaze.c (microblaze_elf_check_relocs): Add an entry
3390 for R_MICROBLAZE_GOTOFF_64.
3391
09fe2662
NC
33922017-01-03 Nick Clifton <nickc@redhat.com>
3393
3394 * mach-o.c (bfd_mach_o_lookup_uuid_command): Fix compile time
3395 warning about using a possibly uninitialised variable.
3396
595e0a47
AM
33972017-01-02 Alan Modra <amodra@gmail.com>
3398
3399 * elf32-hppa.c (ensure_undef_weak_dynamic): New function.
3400 (allocate_plt_static, allocate_dynrelocs): Use it.
3401
7bd9df3b
AM
34022017-01-02 Alan Modra <amodra@gmail.com>
3403
3404 * elf-hppa.h (elf_hppa_fake_sections): Set SHF_INFO_LINK for
3405 .PARISC.unwind section.
3406
5b86074c
AM
34072017-01-02 Alan Modra <amodra@gmail.com>
3408
3409 PR ld/20989
3410 * elfxx-sparc.c (gdop_relative_offset_ok): New function.
3411 (_bfd_sparc_elf_relocate_section): Use it to validate GOT
3412 indirect to GOT pointer relative code edit.
3413
2571583a
AM
34142017-01-02 Alan Modra <amodra@gmail.com>
3415
3416 Update year range in copyright notice of all files.
3417
5c1ad6b5 3418For older changes see ChangeLog-2016
3499769a 3419\f
5c1ad6b5 3420Copyright (C) 2017 Free Software Foundation, Inc.
3499769a
AM
3421
3422Copying and distribution of this file, with or without modification,
3423are permitted in any medium without royalty provided the copyright
3424notice and this notice are preserved.
3425
3426Local Variables:
3427mode: change-log
3428left-margin: 8
3429fill-column: 74
3430version-control: never
3431End:
This page took 0.263397 seconds and 4 git commands to generate.