x86: Define PLT_CIE_LENGTH and PLT_FDE_* in elfxx-x86.h
[deliverable/binutils-gdb.git] / bfd / ChangeLog
CommitLineData
aa595247
L
12017-09-02 H.J. Lu <hongjiu.lu@intel.com>
2
3 * elf32-i386.c (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
4 PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Moved to ...
5 * elfxx-x86.h (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
6 PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Here.
7 * elf64-x86-64.c (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
8 PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Removed.
9
b9ce864c
L
102017-09-02 H.J. Lu <hongjiu.lu@intel.com>
11
12 * elf32-i386.c (elf_i386_allocate_dynrelocs): Removed.
13 (elf_i386_allocate_local_dynrelocs): Likewise.
14 (elf_i386_size_dynamic_sections): Replace
15 elf_i386_allocate_dynrelocs/elf_i386_allocate_local_dynrelocs
16 with _bfd_x86_elf_allocate_dynrelocs and
17 _bfd_x86_elf_allocate_local_dynrelocs.
18 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Removed.
19 (elf_x86_64_allocate_local_dynrelocs): Likewise.
20 (elf_x86_64_size_dynamic_sections): Replace
21 elf_x86_64_allocate_dynrelocs/elf_x86_64_allocate_local_dynrelocs
22 with _bfd_x86_elf_allocate_dynrelocs and
23 _bfd_x86_elf_allocate_local_dynrelocs.
24 * elfxx-x86.c (_bfd_x86_elf_allocate_dynrelocs): New function.
25 (_bfd_x86_elf_allocate_local_dynrelocs): Likewise.
26 * elfxx-x86.h (_bfd_x86_elf_allocate_dynrelocs): New prototype.
27 (_bfd_x86_elf_allocate_local_dynrelocs): Likewise.
28
fe53b4a4
L
292017-09-02 H.J. Lu <hongjiu.lu@intel.com>
30
31 * elf32-i386.c (is_i386_elf): Removed.
32 (elf_i386_check_relocs): Replace is_i386_elf with is_x86_elf.
33 (elf_i386_size_dynamic_sections): Likewise.
34 (elf_i386_relocate_section): Likewise.
35 * elf64-x86-64.c (is_x86_64_elf): Removed.
36 (elf_x86_64_check_relocs): Replace is_x86_64_elf with
37 is_x86_elf.
38 (elf_x86_64_size_dynamic_sections): Likewise.
39 (elf_x86_64_relocate_section): Likewise.
40 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
41 target_id.
42 * elfxx-x86.h (elf_x86_link_hash_table): Add target_id.
43 (is_x86_elf): New.
44
9ff114ca
L
452017-09-02 H.J. Lu <hongjiu.lu@intel.com>
46
47 * elf32-i386.c (elf_i386_compute_jump_table_size): Removed.
48 (elf_i386_allocate_dynrelocs): Replace
49 elf_i386_compute_jump_table_size with
50 elf_x86_compute_jump_table_size.
51 (elf_i386_size_dynamic_sections): Likewise.
52 * elf64-x86-64.c (elf_x86_64_compute_jump_table_size): Removed.
53 (elf_x86_64_allocate_dynrelocs): Replace
54 elf_x86_64_compute_jump_table_size with
55 elf_x86_compute_jump_table_size.
56 (elf_x86_64_size_dynamic_sections): Likewise.
57 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
58 got_entry_size.
59 * elfxx-x86.h (elf_x86_link_hash_table): Add got_entry_size.
60 (elf_x86_compute_jump_table_size): New.
61
503294e7
L
622017-09-02 H.J. Lu <hongjiu.lu@intel.com>
63
64 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
65 sizeof_reloc.
66 (_bfd_x86_elf_adjust_dynamic_symbol): Use sizeof_reloc.
67 * elfxx-x86.h (elf_x86_link_hash_table): Add sizeof_reloc.
68
9a742a90
L
692017-09-02 H.J. Lu <hongjiu.lu@intel.com>
70
71 * elf32-i386.c (elf_i386_allocate_dynrelocs): Check VxWorks
72 with htab->is_vxworks.
73 (elf_i386_size_dynamic_sections): Likewise.
74 (elf_i386_relocate_section): Likewise.
75 (elf_i386_finish_dynamic_symbol): Likewise.
76 (elf_i386_finish_dynamic_sections): Likewise.
77
6b9553e2
L
782017-09-02 H.J. Lu <hongjiu.lu@intel.com>
79
80 * elf32-i386.c (GOT_TLS_IE, GOT_TLS_IE_POS, GOT_TLS_IE_NEG,
81 GOT_TLS_IE_BOTH, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
82 GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Moved to ...
83 * elfxx-x86.h (GOT_TLS_IE, GOT_TLS_IE_POS, GOT_TLS_IE_NEG,
84 GOT_TLS_IE_BOTH, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
85 GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Here.
86 * elf64-x86-64.c (GOT_TLS_IE, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
87 GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Removed.
88
ad71ce8d
L
892017-09-01 H.J. Lu <hongjiu.lu@intel.com>
90
91 PR ld/22064
92 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Check
93 ELF_COMMON_DEF_P for common symbols.
94
96d01d93
AM
952017-09-02 Alan Modra <amodra@gmail.com>
96
97 * elf-eh-frame.c (offset_adjust): Avoid false positive gcc warning.
98 * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Likewise.
99 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Likewise.
100
4f501a24
L
1012017-09-01 H.J. Lu <hongjiu.lu@intel.com>
102
103 * elf32-i386.c (elf_i386_gc_mark_hook): Removed.
104 (elf_backend_gc_mark_hook): Likewise.
105 * elf64-x86-64.c (elf_x86_64_gc_mark_hook): Likewise.
106 (elf_backend_gc_mark_hook): Likewise.
107 * elfxx-x86.c (_bfd_x86_elf_gc_mark_hook): New function.
108 * elfxx-x86.h (_bfd_x86_elf_gc_mark_hook): New.
109 (elf_backend_gc_mark_hook): Likewise.
110
eeb2f20a
L
1112017-09-01 H.J. Lu <hongjiu.lu@intel.com>
112
113 * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Removed.
114 (elf_backend_adjust_dynamic_symbol): Likewise.
115 * elf64-x86-64.c (elf_x86_64_adjust_dynamic_symbol): Likewise.
116 (elf_backend_adjust_dynamic_symbol): Likewise.
117 * elfxx-x86.c (_bfd_x86_elf_adjust_dynamic_symbol): New function.
118 (_bfd_x86_elf_link_setup_gnu_properties): Copy is_vxworks.
119 * elfxx-x86.h (elf_x86_link_hash_table): Add is_vxworks.
120 (_bfd_x86_elf_adjust_dynamic_symbol): New.
121 (elf_backend_adjust_dynamic_symbol): Likewise.
122
c6295c22
L
1232017-09-01 H.J. Lu <hongjiu.lu@intel.com>
124
125 * elfxx-x86.h (elf_x86_plt_layout_table): Fix a typo in
126 comments.
127
39946cc2
L
1282017-09-01 H.J. Lu <hongjiu.lu@intel.com>
129
130 * elf32-i386.c (elf_i386_mkobject): Removed.
131 (bfd_elf32_mkobject): Likewise.
132 * elf64-x86-64.c (elf_x86_64_mkobject): Likewise.
133 (bfd_elf64_mkobject): Likewise.
134 (bfd_elf32_mkobject): Likewise.
135 * elfxx-x86.c (_bfd_x86_elf_mkobject): New function.
18da07cd 136 * elfxx-x86.h (_bfd_x86_elf_mkobject): New.
39946cc2
L
137 (bfd_elf64_mkobject): Likewise.
138 (bfd_elf32_mkobject): Likewise.
139
a6798bab
L
1402017-09-01 H.J. Lu <hongjiu.lu@intel.com>
141
142 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Updated.
143 Call _bfd_x86_elf_link_setup_gnu_properties.
144 * elf64-x86-64.c (elf_x86_lazy_plt_layout): Initialize
145 pic_plt0_entry and pic_plt_entry fields with the non-PIC PLT
146 entries.
147 (elf_x86_64_non_lazy_plt): Likewise.
148 (elf_x86_64_lazy_bnd_plt): Likewise.
149 (elf_x86_64_non_lazy_bnd_plt): Likewise.
150 (elf_x86_64_lazy_ibt_plt): Likewise.
151 (elf_x32_lazy_ibt_plt): Likewise.
152 (elf_x86_64_non_lazy_ibt_plt): Likewise.
153 (elf_x32_non_lazy_ibt_plt): Likewise.
154 (elf_x86_64_nacl_plt): Likewise.
155 (elf_x86_64_link_setup_gnu_properties): Updated. Call
156 _bfd_x86_elf_link_setup_gnu_properties.
157 * elfxx-x86.c: Include elf-vxworks.h".
158 (_bfd_x86_elf_link_setup_gnu_properties): New function.
159 * elfxx-x86.h (elf_x86_lazy_plt_layout): Remove "for i386 only"
160 comments for pic_plt0_entry and pic_plt_entry.
161 (elf_x86_non_lazy_plt_layout): Likewise.
162 (elf_x86_plt_layout_table): New.
163 (_bfd_x86_elf_link_setup_gnu_properties): Likewise.
164
e10c9c62
L
1652017-09-01 H.J. Lu <hongjiu.lu@intel.com>
166
167 PR ld/22061
168 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Create
169 .eh_frame section for the second PLT.
170 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Correct
171 alignment of .eh_frame section for the second PLT.
172
7e8b6008
NC
1732017-09-01 Nick Clifton <nickc@redhat.com>
174
175 PR 22059
176 * dwarf2.c (decode_line_info): Fix test for an overlong line info
177 structure.
178
2a143b99
NC
1792017-09-01 Nick Clifton <nickc@redhat.com>
180
181 PR 22058
182 * elf-attrs.c (_bfd_elf_parse_attributes): Ensure that the
183 attribute buffer is NUL terminated.
184
e4f27230
NC
1852017-08-31 Nick Clifton <nickc@redhat.com>
186
187 PR 22047
188 * dwarf2.c (read_section): If necessary add a terminating NUL byte
189 to dwarf string sections.
190
686335cd
AM
1912017-08-31 Alan Modra <amodra@gmail.com>
192
193 * po/SRC-POTFILES.in: Regenerate.
194
9866ffe2
AM
1952017-08-31 Alan Modra <amodra@gmail.com>
196
197 * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Don't exit early
198 for a section containing just a terminator. Allow multiple
199 terminators at end of section.
200 * elflink.c (bfd_elf_discard_info): Iterate over .eh_frame
201 sections when not adding alignment. Assert on terminator in
202 the middle of FDEs.
203
af471f82
AM
2042017-08-31 Alan Modra <amodra@gmail.com>
205
206 PR 21441
207 PR 22048
208 * elflink.c (bfd_elf_discard_info): Don't pad embedded zero
209 terminators.
210
3321e42b
L
2112017-08-30 H.J. Lu <hongjiu.lu@intel.com>
212
213 * configure.ac (bfd_backends): Add elf64.lo together with
214 elfxx-x86.lo for 64-bit BFD.
215 * configure: Regenerated.
216
ef32532f
JB
2172017-08-31 James Bowman <james.bowman@ftdichip.com>
218
219 * elf32-ft32.c (ft32_elf_howto_table): Use complain_overflow_dont
220 for R_FT32_18.
221
e234de6b
AM
2222017-08-31 Alan Modra <amodra@gmail.com>
223
224 PR binutils/22032
225 * opncls.c (bfd_close_all_done): Don't call bfd_cache_close
226 before _close_and_cleanup. Call iovec->bclose after.
227 (bfd_close): Remove code common to, and call, bfd_close_all_done.
228
f493882d
L
2292017-08-30 H.J. Lu <hongjiu.lu@intel.com>
230
231 * elf32-i386.c (elf_i386_plt_type): Removed.
232 (elf_i386_plt): Likewise.
233 (elf_i386_get_synthetic_symtab): Updated. Call
234 _bfd_x86_elf_get_synthetic_symtab.
235 * elf64-x86-64.c (elf_x86_64_plt_type): Removed.
236 (elf_x86_64_plt): Likewise.
237 (elf_x86_64_get_synthetic_symtab): Updated. Call
238 _bfd_x86_elf_get_synthetic_symtab.
239 * elfxx-x86.c (elf_i386_get_plt_got_vma): New function.
240 (elf_x86_64_get_plt_got_vma): Likewise.
241 (elf_i386_valid_plt_reloc_p): Likewise.
242 (elf_x86_64_valid_plt_reloc_p): Likewise.
243 (_bfd_x86_elf_get_synthetic_symtab): Likewise.
244 * elfxx-x86.h (elf_x86_plt_type): New.
245 (elf_x86_plt): Likewise.
246 (_bfd_x86_elf_get_synthetic_symtab): Likewise.
247
5b86dbf4
L
2482017-08-30 H.J. Lu <hongjiu.lu@intel.com>
249
250 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Check
251 target_id instead of elf_machine_code.
252
765e526c
L
2532017-08-30 H.J. Lu <hongjiu.lu@intel.com>
254
255 * elf32-i386.c (ELF_DYNAMIC_INTERPRETER): Removed.
256 (elf_i386_lazy_plt_layout): Likewise.
257 (elf_i386_non_lazy_plt_layout): Likewise.
258 (elf_i386_plt_layout): Likewise.
259 (elf_i386_link_hash_table): Likewise.
260 (elf_i386_next_tls_desc_index): Likewise.
261 (elf_i386_srelplt2): Likewise.
262 (elf_i386_plt): Likewise.
263 (elf_i386_lazy_plt): Likewise.
264 (elf_i386_non_lazy_plt): Likewise.
265 (elf_i386_link_hash_table_create): Likewise.
266 (bfd_elf32_bfd_link_hash_table_create): Likewise.
267 (elf_i386_lazy_plt): Updated.
268 (elf_i386_non_lazy_plt): Likewise.
269 (elf_i386_lazy_ibt_plt): Likewise.
270 (elf_i386_non_lazy_ibt_plt): Likewise.
271 (elf_i386_allocate_dynrelocs): Likewise.
272 (elf_i386_size_dynamic_sections): Likewise.
273 (elf_i386_relocate_section): Likewise.
274 (elf_i386_finish_dynamic_symbol): Likewise.
275 (elf_i386_finish_dynamic_sections): Likewise.
276 (elf_i386_get_synthetic_symtab): Likewise.
277 (elf_i386_link_setup_gnu_properties): Likewise.
278 (elf_i386_nacl_plt): Likewise.
279 * elf64-x86-64.c (ABI_64_P): Removed.
280 (ELF64_DYNAMIC_INTERPRETER): Likewise.
281 (ELF32_DYNAMIC_INTERPRETER): Likewise.
282 (elf_x86_64_lazy_plt_layout): Likewise.
283 (elf_x86_64_non_lazy_plt_layout): Likewise.
284 (elf_x86_64_plt_layout): Likewise.
285 (elf_x86_64_link_hash_table): Likewise.
286 (elf_x86_64_plt): Likewise.
287 (elf_x86_64_lazy_plt): Likewise.
288 (elf_x86_64_non_lazy_plt): Likewise.
289 (elf_x86_64_link_hash_table_create): Likewise.
290 (bfd_elf64_bfd_link_hash_table_create): Likewise.
291 (bfd_elf32_bfd_link_hash_table_create): Likewise.
292 (elf_x86_64_lazy_plt): Updated.
293 (elf_x86_64_non_lazy_plt): Likewise.
294 (elf_x86_64_lazy_bnd_plt): Likewise.
295 (elf_x86_64_non_lazy_bnd_plt): Likewise.
296 (elf_x86_64_lazy_ibt_plt): Likewise.
297 (elf_x32_lazy_ibt_plt): Likewise.
298 (elf_x86_64_non_lazy_ibt_plt): Likewise.
299 (elf_x32_non_lazy_ibt_plt): Likewise.
300 (elf_x86_64_allocate_dynrelocs): Likewise.
301 (elf_x86_64_size_dynamic_sections): Likewise.
302 (elf_x86_64_relocate_section): Likewise.
303 (elf_x86_64_finish_dynamic_symbol): Likewise.
304 (elf_x86_64_finish_dynamic_sections): Likewise.
305 (elf_x86_64_get_synthetic_symtab): Likewise.
306 (elf_x86_64_link_setup_gnu_properties): Likewise.
307 (elf_x86_64_nacl_plt): Likewise.
308 * elfxx-x86.c: Include "objalloc.h", "elf/i386.h" and
309 "elf/x86-64.h".
310 (ELF32_DYNAMIC_INTERPRETER): New.
311 (ELF64_DYNAMIC_INTERPRETER): Likewise.
312 (ELFX32_DYNAMIC_INTERPRETER): Likewise.
313 (_bfd_x86_elf_link_hash_table_create): Likewise.
314 (_bfd_x86_elf_link_hash_table_free): Renamed to ...
315 (elf_x86_link_hash_table_free): This. Make it static.
316 * elfxx-x86.h: Don't include "objalloc.h".
317 (ABI_64_P): New.
318 (elf_x86_lazy_plt_layout): Likewise.
319 (elf_x86_non_lazy_plt_layout): Likewise.
320 (elf_x86_plt_layout): Likewise.
321 (_bfd_x86_elf_link_hash_table_create): Likewise.
322 (bfd_elf64_bfd_link_hash_table_create): Likewise.
323 (bfd_elf32_bfd_link_hash_table_create): Likewise.
324 (elf_x86_link_hash_table): Add plt, lazy_plt, non_lazy_plt,
325 srelplt2 and next_tls_desc_index.
326 (_bfd_x86_elf_link_hash_table_free): Removed.
327
70e65ca8
MR
3282017-08-30 Maciej W. Rozycki <macro@imgtec.com>
329
330 * elfxx-mips.c (mips_elf_perform_relocation): Correct microMIPS
331 branch offset interpretation.
332
7c0ed396
L
3332017-08-30 H.J. Lu <hongjiu.lu@intel.com>
334
335 PR binutils/22032
336 * opncls.c (bfd_close_all_done): Call _close_and_cleanup.
337
0f2425c4
L
3382017-08-30 H.J. Lu <hongjiu.lu@intel.com>
339
340 * elf64-x86-64.c (elf_x86_64_next_tls_desc_index): Removed.
341 (elf_x86_64_srelplt2): Likewise.
342
9a23f96e
AM
3432017-08-30 Alan Modra <amodra@gmail.com>
344
345 * elf64-ppc.c (struct ppc_link_hash_table): Add do_tls_opt.
346 (ppc64_elf_tls_optimize): Set it.
347 (ppc64_elf_relocate_section): Nop addis on TPREL16_HA, and convert
348 insn on TPREL16_LO and TPREL16_LO_DS relocs to use r13 when
349 addis would add zero.
350 * elf32-ppc.c (struct ppc_elf_link_hash_table): Add do_tls_opt.
351 (ppc_elf_tls_optimize): Set it.
352 (ppc_elf_relocate_section): Nop addis on TPREL16_HA, and convert
353 insn on TPREL16_LO relocs to use r2 when addis would add zero.
354
b9f04fe0
AM
3552017-08-30 Alan Modra <amodra@gmail.com>
356
357 * elf64-ppc.c (ppc64_elf_relocate_section): When optimizing
358 __tls_get_addr call sequences to LE, don't move the addi down
359 to the nop. Replace the bl with addi and leave the nop alone.
360
5f0f0847
L
3612017-08-29 H.J. Lu <hongjiu.lu@intel.com>
362
363 * elf32-i386.c (elf_i386_pie_finish_undefweak_symbol):
364 Re-indent.
365 * elf64-x86-64.c (elf_x86_64_finish_local_dynamic_symbol):
366 Likewise.
367 (elf_x86_64_pie_finish_undefweak_symbol): Likewise.
368
443701f5
L
3692017-08-29 H.J. Lu <hongjiu.lu@intel.com>
370
371 * Makefile.am (BFD32_BACKENDS): Add elfxx-x86.lo.
372 (BFD64_BACKENDS): Likewise.
373 (BFD32_BACKENDS_CFILES): Add elfxx-x86.c.
374 (BFD64_BACKENDS_CFILES): Likewise.
375 * Makefile.in: Regenerated.
376 * configure.ac (bfd_backends): Add elfxx-x86.lo together with
377 elf32-i386.lo and elf64-x86-64.lo.
378 * configure: Regenerated.
379 * elf32-i386.c: Include "elfxx-x86.h" instead of "sysdep.h",
380 "bfd.h", "bfdlink.h", "libbfd.h", "elf-bfd.h", "bfd_stdint.h",
381 "objalloc.h" and "hashtab.h".
382 (ELIMINATE_COPY_RELOCS): Removed.
383 (UNDEFINED_WEAK_RESOLVED_TO_ZERO):Likewise.
384 (SYMBOL_NO_COPYRELOC): Likewise.
385 (elf_i386_link_hash_entry): Likewise.
386 (GOT_UNKNOWN): Likewise.
387 (GOT_NORMAL): Likewise.
388 (GOT_TLS_GD): Likewise.
389 (elf_i386_hash_entry): Likewise.
390 (elf_i386_obj_tdata): Likewise.
391 (elf_i386_tdata): Likewise.
392 (elf_i386_local_got_tls_type): Likewise.
393 (elf_i386_local_tlsdesc_gotent): Likewise.
394 (elf_i386_hash_table): Likewise.
395 (elf_i386_link_hash_newfunc): Likewise.
396 (elf_i386_local_htab_hash): Likewise.
397 (elf_i386_local_htab_eq): Likewise.
398 (elf_i386_get_local_sym_hash): Likewise.
399 (elf_i386_link_hash_table_free): Likewise.
400 (elf_i386_copy_indirect_symbol): Likewise.
401 (elf_i386_fixup_symbol): Likewise.
402 (elf_i386_readonly_dynrelocs): Likewise.
403 (elf_i386_always_size_sections): Likewise.
404 (elf_i386_set_tls_module_base): Likewise.
405 (elf_i386_dtpoff_base): Likewise.
406 (compare_relocs): Likewise.
407 (elf_i386_hash_symbol): Likewise.
408 (elf_i386_parse_gnu_properties): Likewise.
409 (elf_i386_merge_gnu_properties): Likewise.
410 (elf_i386_link_check_relocs): Likewise.
411 (elf_i386_merge_symbol_attribute): Likewise.
412 (bfd_elf32_bfd_link_check_relocs): Likewise.
413 (elf_backend_copy_indirect_symbol): Likewise.
414 (elf_backend_always_size_sections): Likewise.
415 (elf_backend_omit_section_dynsym): Likewise.
416 (elf_backend_hash_symbol): Likewise.
417 (elf_backend_fixup_symbol): Likewise.
418 (elf_backend_parse_gnu_properties): Likewise.
419 (elf_backend_merge_gnu_properties): Likewise.
420 (elf_backend_merge_symbol_attribute): Likewise.
421 (elf_i386_mkobject): Updated.
422 (elf_i386_link_hash_table_create): Likewise.
423 (elf_i386_check_tls_transition): Likewise.
424 (elf_i386_tls_transition): Likewise.
425 (elf_i386_convert_load_reloc): Likewise.
426 (elf_i386_check_relocs): Likewise.
427 (elf_i386_adjust_dynamic_symbol): Likewise.
428 (elf_i386_allocate_dynrelocs): Likewise.
429 (elf_i386_convert_load): Likewise.
430 (elf_i386_size_dynamic_sections): Likewise.
431 (elf_i386_relocate_section): Likewise.
432 (elf_i386_finish_dynamic_symbol ): Likewise.
433 (elf_i386_finish_dynamic_sections): Likewise.
434 (elf_i386_output_arch_local_syms): Likewise.
435 (elf_i386_get_synthetic_symtab): Likewise.
436 (elf_i386_link_setup_gnu_properties): Likewise.
437 (elf_i386_link_hash_table): Use elf_x86_link_hash_table, instead
438 of elf_link_hash_table, as base.
439 (elf_i386_next_tls_desc_index): New.
440 (elf_i386_srelplt2): Likewise.
441 (elf_i386_plt): Likewise.
442 (elf_i386_lazy_plt): Likewise.
443 (elf_i386_non_lazy_plt): Likewise.
444 * elf32-x86-64.c: Include "elfxx-x86.h" instead of "sysdep.h",
445 "bfd.h", "bfdlink.h", "libbfd.h", "elf-bfd.h", "bfd_stdint.h",
446 "objalloc.h" and "hashtab.h".
447 (ELIMINATE_COPY_RELOCS): Removed.
448 (UNDEFINED_WEAK_RESOLVED_TO_ZERO):Likewise.
449 (SYMBOL_NO_COPYRELOC): Likewise.
450 (elf_x86_64_link_hash_entry): Likewise.
451 (GOT_UNKNOWN): Likewise.
452 (GOT_NORMAL): Likewise.
453 (GOT_TLS_GD): Likewise.
454 (elf_x86_64_hash_entry): Likewise.
455 (elf_x86_64_obj_tdata): Likewise.
456 (elf_x86_64_tdata): Likewise.
457 (elf_x86_64_local_got_tls_type): Likewise.
458 (elf_x86_64_local_tlsdesc_gotent): Likewise.
459 (elf_x86_64_hash_table): Likewise.
460 (elf_x86_64_link_hash_newfunc): Likewise.
461 (elf_x86_64_local_htab_hash): Likewise.
462 (elf_x86_64_local_htab_eq): Likewise.
463 (elf_x86_64_get_local_sym_hash): Likewise.
464 (elf_x86_64_link_hash_table_free): Likewise.
465 (elf_x86_64_copy_indirect_symbol): Likewise.
466 (elf_x86_64_fixup_symbol): Likewise.
467 (elf_x86_64_readonly_dynrelocs): Likewise.
468 (elf_x86_64_always_size_sections): Likewise.
469 (elf_x86_64_set_tls_module_base): Likewise.
470 (elf_x86_64_dtpoff_base): Likewise.
471 (compare_relocs): Likewise.
472 (elf_x86_64_merge_symbol_attribute): Likewise.
473 (elf_x86_64_hash_symbol): Likewise.
474 (elf_x86_64_parse_gnu_properties): Likewise.
475 (elf_x86_64_merge_gnu_properties): Likewise.
476 (elf_x86_64_link_check_relocs): Likewise.
477 (elf_backend_copy_indirect_symbol): Likewise.
478 (elf_backend_always_size_sections): Likewise.
479 (bfd_elf64_bfd_link_check_relocs): Likewise.
480 (elf_backend_merge_symbol_attribute): Likewise.
481 (elf_backend_hash_symbol): Likewise.
482 (elf_backend_omit_section_dynsym): Likewise.
483 (elf_backend_fixup_symbol): Likewise.
484 (elf_backend_parse_gnu_properties): Likewise.
485 (elf_backend_merge_gnu_properties): Likewise.
486 (bfd_elf32_bfd_link_check_relocs): Likewise.
487 (elf_x86_64_mkobject): Updated.
488 (elf_x86_64_link_hash_table_create): Likewise.
489 (elf_x86_64_check_tls_transition): Likewise.
490 (elf_x86_64_tls_transition): Likewise.
491 (elf_x86_64_convert_load_reloc): Likewise.
492 (elf_x86_64_check_relocs): Likewise.
493 (elf_x86_64_adjust_dynamic_symbol): Likewise.
494 (elf_x86_64_allocate_dynrelocs): Likewise.
495 (elf_x86_64_convert_load): Likewise.
496 (elf_x86_64_size_dynamic_sections): Likewise.
497 (elf_x86_64_relocate_section): Likewise.
498 (elf_x86_64_finish_dynamic_symbol ): Likewise.
499 (elf_x86_64_finish_dynamic_sections): Likewise.
500 (elf_x86_64_output_arch_local_syms): Likewise.
501 (elf_x86_64_get_synthetic_symtab): Likewise.
502 (elf_x86_64_link_setup_gnu_properties): Likewise.
503 (elf_x86_64_link_hash_table): Use elf_x86_link_hash_table,
504 instead of elf_link_hash_table, as base.
505 (elf_x86_64_next_tls_desc_index): New.
506 (elf_x86_64_srelplt2): Likewise.
507 (elf_x86_64_plt): Likewise.
508 (elf_x86_64_lazy_plt): Likewise.
509 (elf_x86_64_non_lazy_plt): Likewise.
510 * elfxx-x86.c: New file.
511 * elfxx-x86.h: Likewise.
512
823cb067
L
5132017-08-29 H.J. Lu <hongjiu.lu@intel.com>
514
515 * elf32-i386.c (elf_i386_get_synthetic_symtab): Simplify bad
516 return.
517 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
518
37c0b6ee
L
5192017-08-29 H.J. Lu <hongjiu.lu@intel.com>
520
521 * elf32-i386.c (elf_i386_get_synthetic_symtab): Check valid PLT
522 sections before checking dynamic relocations and free invalid
523 PLT section contents.
524 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
525
0fb0a767
L
5262017-08-28 H.J. Lu <hongjiu.lu@intel.com>
527
528 * elf-bfd.h (_bfd_elf_ifunc_get_synthetic_symtab): Removed.
529 * elf-ifunc.c (_bfd_elf_ifunc_get_synthetic_symtab): Likewise.
530
90efb642
L
5312017-08-28 H.J. Lu <hongjiu.lu@intel.com>
532
533 PR binutils/22018
534 * elf32-i386.c (elf_i386_get_synthetic_symtab): Check for valid
535 PLT section size.
536 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
537
596dc58f
L
5382017-08-27 H.J. Lu <hongjiu.lu@intel.com>
539
540 * elf32-i386.c (elf_i386_link_hash_newfunc): Initialize
541 def_protected.
542 * elf64-x86-64.c (elf_x86_64_link_hash_newfunc): Likewise.
543
a5b4ee94
L
5442017-08-26 H.J. Lu <hongjiu.lu@intel.com>
545
546 PR ld/21997
547 * elf-bfd.h (elf_obj_tdata): Use ENUM_BITFIELD on object_id,
548 dyn_lib_class and has_gnu_symbols. Change bad_symtab to bitfield.
549 Add a has_no_copy_on_protected bitfield.
550 (elf_has_no_copy_on_protected): New.
551 * elf-properties.c (_bfd_elf_parse_gnu_properties): Set
552 elf_has_no_copy_on_protected for GNU_PROPERTY_NO_COPY_ON_PROTECTED.
553 (elf_merge_gnu_property_list): Likewise.
554 (_bfd_elf_link_setup_gnu_properties): Set extern_protected_data
555 to FALSE for elf_has_no_copy_on_protected.
556 * elf32-i386.c (SYMBOL_NO_COPYRELOC): New.
557 (elf_i386_link_hash_entry): Add def_protected.
558 (elf_i386_adjust_dynamic_symbol): Also check SYMBOL_NO_COPYRELOC
559 when checking info->nocopyreloc.
560 (elf_i386_link_setup_gnu_properties): Don't set
561 extern_protected_data here.
562 (elf_i386_merge_symbol_attribute): New function.
563 (elf_backend_merge_symbol_attribute): New.
564 * elf64-x86-64.c (SYMBOL_NO_COPYRELOC): New.
565 (elf_x86_64_link_hash_entry): Add def_protected.
566 (elf_x86_64_need_pic): Report protected symbol for def_protected.
567 (elf_x86_64_adjust_dynamic_symbol): Also check SYMBOL_NO_COPYRELOC
568 when checking info->nocopyreloc.
569 (elf_x86_64_relocate_section): Also check for R_X86_64_PC32
570 relocation run-time overflow and unresolvable R_X86_64_32S
571 relocation against protected data symbol defined in shared object
572 with GNU_PROPERTY_NO_COPY_ON_PROTECTED.
573 (elf_x86_64_link_setup_gnu_properties): Don't set
574 extern_protected_data here.
575 (elf_x86_64_merge_symbol_attribute): New function.
576 (elf_backend_merge_symbol_attribute): New.
577
7c8bbca5
AM
5782017-08-26 Alan Modra <amodra@gmail.com>
579
580 * elf32-ppc.c (must_be_dyn_reloc): Use bfd_link_dll. Comment.
581 (ppc_elf_check_relocs): Only set DF_STATIC_TLS in shared libs.
582 (ppc_elf_relocate_section): Comment fix.
583 * elf64-ppc.c (must_be_dyn_reloc): Use bfd_link_dll. Comment.
584 (ppc64_elf_check_relocs): Only set DF_STATIC_TLS in shared libs.
585 Support dynamic relocs for TPREL16 when non-pic too.
586 (dec_dynrel_count): Adjust TPREL16 handling as per check_relocs.
587 (ppc64_elf_relocate_section): Support dynamic relocs for TPREL16
588 when non-pic too.
589
5fdda9d6
L
5902017-08-25 H.J. Lu <hongjiu.lu@intel.com>
591
592 * elf32-i386.c (elf_i386_link_hash_entry): Remove redundant
593 "symbol" in comments.
594 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Likewise.
595
7073b5b9
L
5962017-08-24 H.J. Lu <hongjiu.lu@intel.com>
597
598 PR ld/22001
599 * elf64-x86-64.c (elf_x86_64_relocate_section): Check for
600 R_X86_64_PC32 relocation run-time overflow and unresolvable
601 R_X86_64_32S relocation with -z nocopyreloc.
602
34bb2571
L
6032017-08-24 H.J. Lu <hongjiu.lu@intel.com>
604
605 * elf32-i386.c (elf_i386_check_relocs): Revert the last change.
606 Undefined symbols may not have a type.
607 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
608
aab921ad
L
6092017-08-23 H.J. Lu <hongjiu.lu@intel.com>
610
611 * elf64-x86-64.c (elf_x86_64_need_pic): Add an argument for
612 bfd_link_info. Report shared, PIE or PDE object based on
613 bfd_link_info.
614 (elf_x86_64_check_relocs): Update elf_x86_64_need_pic call.
615 (elf_x86_64_relocate_section): Likewise.
616
b1bb697e
L
6172017-08-23 H.J. Lu <hongjiu.lu@intel.com>
618
619 * elf32-i386.c (elf_i386_check_relocs): Increment PLT count only
620 for function symbols.
621 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
622
73784fa5
L
6232017-08-23 H.J. Lu <hongjiu.lu@intel.com>
624
625 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Set
626 extern_protected_data to FALSE if GNU_PROPERTY_NO_COPY_ON_PROTECTED
627 is set on any input relocatable file.
628 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Likewise.
629
46434633
AM
6302017-08-23 Alan Modra <amodra@gmail.com>
631
632 PR 21988
633 * elf64-ppc.c (ensure_undef_dynamic): Rename from
634 ensure_undefweak_dynamic. Handle undefined too.
635 * elf32-ppc.c (ensure_undef_dynamic): Likewise.
636 * elf32-hppa.c (ensure_undef_dynamic): Likewise.
637 (allocate_dynrelocs): Discard undefined non-default visibility
638 relocs first. Make undefined syms dynamic. Tidy goto.
639
487b6440
AM
6402017-08-21 Alan Modra <amodra@gmail.com>
641 H.J. Lu <hongjiu.lu@intel.com>
642
643 PR ld/21964
644 * elf-bfd.h (SYMBOLIC_BIND): Return TRUE for __start/__stop symbols.
645 * elflink.c (bfd_elf_define_start_stop): Rewrite.
646
284d826d
HPN
6472017-08-21 Hans-Peter Nilsson <hp@bitrange.com>
648
649 PR ld/20125
650 * elf64-mmix.c (mmix_elf_relax_section): Correct handling of
651 undefined weak symbols.
652
de259397
NC
6532017-08-18 Nick Clifton <nickc@redhat.com>
654
655 PR binutils/21962
656 * tekhex.c (getsym): Fix check for source pointer walking off the
657 end of the input buffer.
658
545bc2b3
SN
6592017-08-17 Szabolcs Nagy <szabolcs.nagy@arm.com>
660
661 PR ld/18808
662 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Skip IFUNC
663 relocations in debug sections, change abort to _bfd_error_handler.
664
0c54f692
NC
6652017-08-14 Nick Clifton <nickc@redhat.com>
666
667 PR 21957
668 * elf.c (setup_group): Check for an empty or very small group
669 section.
670 * po/bfd.pot: Regenerate.
671
79a94a2a
AM
6722017-08-14 Alan Modra <amodra@gmail.com>
673
674 PR 21441
675 * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Don't add
676 alignment padding here.
677 * elflink.c (bfd_elf_discard_info): Add .eh_frame padding here
678 in a reverse pass over sections.
679
98c5dfc9
L
6802017-08-11 H.J. Lu <hongjiu.lu@intel.com>
681
682 PR binutils/21943
683 * elf32-i386.c (elf_i386_get_synthetic_symtab): Allocate space
684 for @plt suffixes first.
685 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
686
24d3e51b
NC
6872017-08-08 Nick Clifton <nickc@redhat.com>
688
689 PR 21916
690 * elf-attrs.c (_bfd_elf_parse_attributes): Complain about very
691 small section lengths.
692 * elf.c (_bfd_elf_setup_sections): Skip empty entries in the group
693 table.
694 (elfcore_grok_freebsd_prstatus): Add checks to make sure that
695 there is enough data present in the note.
696
206c9c79
AM
6972017-08-08 Alan Modra <amodra@gmail.com>
698
699 PR 21017
700 * elf32-microblaze.c (microblaze_elf_check_relocs): Don't bump
701 got.refcount for GOTOFF relocs, just create .got section.
702
2980ccad
L
7032017-08-07 H.J. Lu <hongjiu.lu@intel.com>
704
705 * elflink.c (elf_link_add_object_symbols): Move common symbol
706 check after bed->common_definition.
707
b3293efa
AM
7082017-08-07 Alan Modra <amodra@gmail.com>
709
710 PR 21910
711 * elflink.c (bfd_elf_final_link): Don't segfault when sections
712 needed to define various dynamic tags have been discarded.
713
b7a18930
NC
7142017-08-07 Nick Clifton <nickc@redhat.com>
715
716 PR 21884
717 * elf32-i386.c (elf_i386_link_setup_gnu_properties): If the dynobj
718 has not been set then use the bfd returned by
719 _bfd_elf_link_setup_gnu_properties. If that is null then search
720 through all the input bfds selecting the first normal, ELF format
721 one.
722 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Likewise.
723
1d4af308
L
7242017-08-06 H.J. Lu <hongjiu.lu@intel.com>
725
726 * elf32-i386.c (elf_i386_link_hash_entry): Change tls_get_addr
727 to 1 bit.
728 (elf_i386_link_hash_newfunc): Initialize tls_get_addr to 0.
729 (elf_i386_check_tls_transition): Check tls_get_addr directly.
730 (elf_i386_convert_load_reloc): Update tls_get_addr check.
731 (elf_i386_link_check_relocs): New function.
732 (bfd_elf32_bfd_link_check_relocs): New.
733 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Change tls_get_addr
734 to 1 bit.
735 (elf_x86_64_link_hash_newfunc): Initialize tls_get_addr to 0.
736 (elf_x86_64_check_tls_transition): Check tls_get_addr directly.
737 (elf_x86_64_convert_load_reloc): Update tls_get_addr check.
738 (elf_x86_64_link_check_relocs): New function.
739 (bfd_elf64_bfd_link_check_relocs): New.
740 (bfd_elf32_bfd_link_check_relocs): Likewise.
741
a4819f54
L
7422017-08-06 H.J. Lu <hongjiu.lu@intel.com>
743
744 PR ld/21903:
745 * elflink.c (elf_link_add_object_symbols): Treat common symbol
746 as undefined for --no-define-common.
747
55ef6584
AM
7482017-08-05 Alan Modra <amodra@gmail.com>
749
750 * elf32-hppa.c (elf32_hppa_set_gp): Don't require an
751 hppa_link_hash_table.
752
d84ed528
MF
7532017-08-02 Max Filippov <jcmvbkbc@gmail.com>
754
755 * xtensa-isa.c (xtensa_isa_init): Don't update lookup table
756 entries for sysregs with negative indices.
757
1ef692ea
AK
7582017-08-01 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
759
760 * elf32-s390.c (elf_s390_finish_dynamic_sections): Skip if it
761 isn't the S/390 specific elf data.
762 * elf64-s390.c (elf_s390_finish_dynamic_sections): Likewise.
763
57593436
KLC
7642017-07-31 Kuan-Lin Chen <rufus@andestech.com>
765
766 * elfxx-riscv.c (riscv_elf_add_sub_reloc): New function.
767 * (howto_table) [R_RISCV_ADD8]: Use riscv_elf_add_sub_reloc.
768 [R_RISCV_ADD16]: Likewise.
769 [R_RISCV_ADD32]: Likewise.
770 [R_RISCV_ADD64]: Likewise.
771 [R_RISCV_SUB6]: Likewise.
772 [R_RISCV_SUB8]: Likewise.
773 [R_RISCV_SUB16]: Likewise.
774 [R_RISCV_SUB32]: Likewise.
775 [R_RISCV_SUB64]: Likewise.
776
d44c746a
AM
7772017-07-31 Alan Modra <amodra@gmail.com>
778
779 * elf64-ppc.c (ppc64_elf_tls_setup): Warn on --plt-localentry
780 without ld.so checks.
781
8b5f1ed8
AM
7822017-07-29 Alan Modra <amodra@gmail.com>
783
784 PR 21847
785 * elf64-ppc.c (struct ppc_link_hash_entry): Add non_zero_localentry.
786 (ppc64_elf_merge_symbol): Set non_zero_localentry.
787 (is_elfv2_localentry0): Test non_zero_localentry.
788 (ppc64_elf_tls_setup): Default to --no-plt-localentry.
789
894dde0b
AK
7902017-07-28 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
791
792 * elf32-s390.c (elf_s390_finish_dynamic_sections): Add NULL
793 pointer check for htab->elf.irelplt.
794 * elf64-s390.c (elf_s390_finish_dynamic_sections): Likewise.
795
8bdf0be1
NC
7962017-07-27 Nick Clifton <nickc@redhat.com>
797
798 PR 21840
799 * mach-o.c (bfd_mach_o_read_symtab_strtab): Fail if the symtab
800 size is -1.
801 * nlmcode.h (nlm_swap_auxiliary_headers_in): Replace assertion
802 with error return.
803 * section.c (bfd_make_section_with_flags): Fail if the name or bfd
804 are NULL.
805 * vms-alpha.c (bfd_make_section_with_flags): Correct computation
806 of end pointer.
807 (evax_bfd_print_emh): Check for invalid string lengths.
808
c26bb067
NC
8092017-07-25 Nick Clifton <nickc@redhat.com>
810
811 * po/fr.po: Updated French translation.
812
cfe7b9bd
BG
8132017-07-25 Benjamin Green <bengreen5mx@gmail.com>
814
815 PR 21824
816 * elf32-msp430.c (msp430_elf_relax_section): Allow conversion of
817 16-bit absolute branches into 10-bit pc-relative branches on the
818 MSP430 as well as the MSP430X.
819
d4aaa2a0
AM
8202017-07-25 Alan Modra <amodra@gmail.com>
821
822 * elf64-ppc.c (struct map_stub): Add tls_get_addr_opt_bctrl.
823 (stub_eh_frame_size): New function.
824 (ppc_size_one_stub): Set group tls_get_addr_opt_bctrl.
825 (group_sections): Init group tls_get_addr_opt_bctrl.
826 (ppc64_elf_size_stubs): Update sizing and initialization of
827 .eh_frame. Iteration over stubs via group list.
828 (ppc64_elf_build_stubs): Iterate over stubs via group list.
829 (ppc64_elf_finish_dynamic_sections): Update finalization of
830 .eh_frame.
831
ca4cf9b9
NC
8322017-07-24 Nick Clifton <nickc@redhat.com>
833
834 PR 21813
835 * mach-o.c (bfd_mach_o_canonicalize_relocs): Pass the base address
836 of the relocs to the canonicalize_one_reloc routine.
837 * mach-o.h (struct bfd_mach_o_backend_data): Update the prototype
838 for the _bfd_mach_o_canonicalize_one_reloc field.
839 * mach-o-arm.c (bfd_mach_o_arm_canonicalize_one_reloc): Add
840 res_base parameter. Use to check for corrupt pair relocs.
841 * mach-o-aarch64.c (bfd_mach_o_arm64_canonicalize_one_reloc):
842 Likewise.
843 * mach-o-i386.c (bfd_mach_o_i386_canonicalize_one_reloc):
844 Likewise.
845 * mach-o-x86-64.c (bfd_mach_o_x86_64_canonicalize_one_reloc):
846 Likewise.
847
848 * vms-alpha.c (_bfd_vms_slurp_eihd): Make sure that there is
849 enough data in the record before attempting to parse it.
850 (_bfd_vms_slurp_eeom): Likewise.
851
852 (_bfd_vms_slurp_egsd): Check for an invalid section index.
853 (image_set_ptr): Likewise.
854 (alpha_vms_slurp_relocs): Likewise.
855
8a2df5e2
NC
856 (alpha_vms_object_p): Check for a truncated record.
857
47aeb64c
NC
8582017-07-24 Nick Clifton <nickc@redhat.com>
859
860 PR 21803
861 * reloc.c (_bfd_unrecognized_reloc): New function. Reports
862 an unrecognized reloc and sets the bfd_error value.
863 * libbfd.h: Regenerate.
864 * elf32-arm.c (elf32_arm_final_link_relocate): Use the new
865 function.
866 * elf32-i386.c (elf_i386_relocate_section): Likewise.
867 * elf32-tilepro.c (tilepro_elf_relocate_section): Likewise.
868 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
869 * elfnn-aarch64.c (elfNN_aarch64_relocate_section): Likewise.
870 * elfxx-tilegx.c (tilegx_elf_relocate_section): Likewise.
871
15a3a14f
AM
8722017-07-23 Alan Modra <amodra@gmail.com>
873
874 * elf64-ppc.c (ppc64_elf_size_stubs): Correct advance to
875 restore of LR.
876
f2e6a843
SN
8772017-07-19 Szabolcs Nagy <szabolcs.nagy@arm.com>
878
879 PR ld/18841
880 * elfnn-aarch64.c (elfNN_aarch64_reloc_type_class): Return
881 reloc_class_ifunc for ifunc symbols.
882
909e4e71
NC
8832017-07-19 Nick Clifton <nickc@redhat.com>
884
885 PR 21787
886 * archive.c (bfd_generic_archive_p): If the bfd does not have the
887 correct magic bytes at the start, set the error to wrong format
888 and clear the format selector before returning NULL.
889
29866fa1
NC
8902017-07-19 Nick Clifton <nickc@redhat.com>
891
892 PR 21786
893 * coff-rs6000.c (_bfd_strntol): New function.
894 (_bfd_strntoll): New function.
895 (GET_VALUE_IN_FIELD): New macro.
896 (EQ_VALUE_IN_FIELD): new macro.
897 (_bfd_xcoff_slurp_armap): Use new macros.
898 (_bfd_xcoff_archive_p): Likewise.
899 (_bfd_xcoff_read_ar_hdr): Likewise.
900 (_bfd_xcoff_openr_next_archived_file): Likewise.
901 (_bfd_xcoff_stat_arch_elt): Likewise.
6c4e7b6b
NC
902 * coff64-rs6000.c (_bfd_strntol): New function.
903 (_bfd_strntoll): New function.
904 (GET_VALUE_IN_FIELD): New macro.
905 (xcoff64_slurp_armap): Use new macros.
29866fa1 906
684d5a10
JEM
9072017-07-19 Claudiu Zissulescu <claziss@synopsys.com>
908 John Eric Martin <John.Martin@emmicro-us.com>
909
910 * bfd-in2.h: Regenerate.
911 * libbfd.h: Regenerate.
912 * elf32-arc.c (JLI): Define.
913 * reloc.c: Add JLI relocations.
914
de194d85
YC
9152017-07-18 Nick Clifton <nickc@redhat.com>
916
917 PR 21775
918 * coff-sh.c: Fix spelling typos.
919 * compress.c: Likewise.
920 * cpu-pdp11.c: Likewise.
921 * ecofflink.c: Likewise.
922 * elf-m10300.c: Likewise.
923 * elf.c: Likewise.
924 * elf32-arm.c: Likewise.
925 * elf32-m68k.c: Likewise.
926 * elf32-nds32.c: Likewise.
927 * elf32-ppc.c: Likewise.
928 * elf32-sh.c: Likewise.
929 * elf32-v850.c: Likewise.
930 * elf64-ppc.c: Likewise.
931 * elf64-x86-64.c: Likewise.
932 * elflink.c: Likewise.
933 * elfnn-aarch64.c: Likewise.
934 * elfxx-mips.c: Likewise.
935 * som.c: Likewise.
936 * sunos.c: Likewise.
937 * vms-alpha.c: Likewise.
938 * xcofflink.c: Likewise.
939
e4e21d9e
NC
9402017-07-18 Nick Clifton <nickc@redhat.com>
941
942 PR binutils/21781
943 * coffcode.h (handle_COMDAT): Replace abort with an error message
944 and return.
945
8e85f840
L
9462017-07-17 H.J. Lu <hongjiu.lu@intel.com>
947
948 PR ld/21782
949 * elf64-x86-64.c (elf_x86_64_relocate_section): Limit PIC check
950 to shared library.
951
dd57c19c
L
9522017-07-17 H.J. Lu <hongjiu.lu@intel.com>
953
954 * elf64-x86-64.c (elf_x86_64_relocate_section): Re-indent.
955
676ee2b5
AM
9562017-07-16 Alan Modra <amodra@gmail.com>
957
958 * elf64-ppc.c (ppc64_elf_relocate_section): Don't optimize
959 __tls_index GOT entries when using __tls_get_addr_opt stub.
960 * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
961
429d795d
AM
9622017-07-12 Alan Modra <amodra@gmail.com>
963
964 * po/es.po: Update from translationproject.org/latest/bfd/.
965 * po/fi.po: Likewise.
966 * po/fr.po: Likewise.
967 * po/id.po: Likewise.
968 * po/ja.po: Likewise.
969 * po/ro.po: Likewise.
970 * po/ru.po: Likewise.
971 * po/sr.po: Likewise.
972 * po/sv.po: Likewise.
973 * po/tr.po: Likewise.
974 * po/uk.po: Likewise.
975 * po/vi.po: Likewise.
976 * po/zh_CN.po: Likewise.
977 * po/hr.po: New file from translationproject.org.
978 * configure.ac (ALL_LINGUAS): Add hr. Sort.
979 * configure: Regenerate.
980
0bae9e9e
NC
9812017-07-12 Nick Clifton <nickc@redhat.com>
982
983 Fix compile time warnings using gcc 7.1.1.
984 * elf32-xtensa.c (elf_xtensa_get_plt_section): Increase length of
985 plt_name buffer.
986 (elf_xtensa_get_gotplt_section): Increase length of got_name
987 buffer.
988 * mach-o-arm.c (bfd_mach_o_arm_canonicalize_one_reloc): Add a
989 default return of FALSE.
990 * mach-o-i386.c (bfd_mach_o_i386_canonicalize_one_reloc): Add a
991 default return of FALSE.
992
d42c267e
AM
9932017-07-12 Alan Modra <amodra@gmail.com>
994
995 * binary.c (binary_set_section_contents): Don't print filepos in
996 error message.
997 (coff_write_object_contents): Cast size_t for error message.
998 (coff_slurp_line_table): Don't use bfd_vma symndx.
999 (coff_slurp_reloc_table): Remove unneeded cast.
1000 * dwarf2.c (read_section): Cast bfd_int64_t to long long for
1001 error message.
1002 (find_abstract_instance_name): Likewise.
1003 * elf32-arm.c (arm_type_of_stub): Correct error arg order.
1004 (bfd_elf32_arm_stm32l4xx_erratum_scan): Don't cast error arg.
1005 (elf32_arm_check_relocs): Make r_symndx an int.
1006 * elf32-cris.c (cris_elf_check_relocs): Delete extraneous %s in
1007 format string.
1008 * elf32-metag.c (elf_metag_relocate_section): Delete extra error
1009 message arg.
1010 * elf32-nds32.c (nds32_elf_ex9_build_hash_table): Rewrite bogus
1011 error message.
1012 * elf32-i386.c (elf_i386_check_relocs): Make r_symndx an int.
1013 * elf32-s390.c (elf_s390_check_relocs): Likewise.
1014 * elf32-tic6x.c (elf32_tic6x_check_relocs): Likewise.
1015 * elf32-tilepro.c (tilepro_elf_check_relocs): Likewise.
1016 * elf32-xtensa.c (elf_xtensa_check_relocs): Likewise.
1017 * elf64-s390.c (elf_s390_check_relocs): Likewise.
1018 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1019 * elfnn-aarch64.c (elfNN_aarch64_check_relocs): Likewise.
1020 * elfnn-riscv.c (riscv_elf_check_relocs): Likewise.
1021 * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Likewise.
1022 * elfxx-tilegx.c (tilegx_elf_check_relocs): Likewise.
1023 * elf64-mmix.c (_bfd_mmix_after_linker_allocation): Cast size_t args
1024 and use %lu for error message.
1025 * elflink.c (elf_link_adjust_relocs): Delete extra error message arg.
1026 * mmo.c (mmo_scan): Make stab_loc a file_ptr. Cast expression for
1027 error message.
1028
1029 * elf32-arm.c (elf32_arm_tls_relax): Correct format string and args
1030 in error message.
1031 (elf32_arm_final_link_relocate): Likewise.
1032 * coff-arm.c (bfd_arm_process_before_allocation): Likewise.
1033 * coffcode.h (styp_to_sec_flags): Likewise.
1034 * cofflink.c (_bfd_coff_write_global_sym): Likewise.
1035 * ecoff.c (_bfd_ecoff_slurp_symbol_table): Likewise.
1036 * elf32-arc.c (arc_elf_merge_private_bfd_data): Likewise.
1037 * elf32-bfin.c (bfinfdpic_check_relocs): Likewise.
1038 (elf32_bfin_merge_private_bfd_data): Likewise.
1039 * elf32-cris.c (cris_elf_relocate_section): Likewise.
1040 * elf32-frv.c (frv_elf_merge_private_bfd_data): Likewise.
1041 * elf32-i370.c (i370_elf_merge_private_bfd_data): Likewise.
1042 (i370_elf_relocate_section): Likewise.
1043 * elf32-iq2000.c (iq2000_elf_merge_private_bfd_data): Likewise.
1044 * elf32-m32c.c (m32c_elf_merge_private_bfd_data): Likewise.
1045 * elf32-m68hc1x.c (_bfd_m68hc11_elf_merge_private_bfd_data): Likewise.
1046 * elf32-mcore.c (mcore_elf_relocate_section): Likewise.
1047 * elf32-mep.c (mep_elf_merge_private_bfd_data): Likewise.
1048 * elf32-mt.c (mt_elf_merge_private_bfd_data): Likewise.
1049 * elf64-sparc.c (elf64_sparc_merge_private_bfd_data): Likewise.
1050 * elfxx-mips.c (mips_elf_merge_obj_e_flags): Likewise.
1051 (_bfd_mips_elf_merge_private_bfd_data): Likewise.
1052 * ieee.c (ieee_write_id, read_id): Likewise.
1053 * mach-o.c (bfd_mach_o_write_contents): Likewise.
1054 (bfd_mach_o_layout_commands, bfd_mach_o_read_section_32): Likewise.
1055 (bfd_mach_o_read_section_64, bfd_mach_o_read_symtab_symbol): Likewise.
1056 (bfd_mach_o_read_command, bfd_mach_o_header_p): Likewise.
1057 * peXXigen.c (_bfd_XXi_swap_aouthdr_in): Likewise.
1058 * stabs.c (_bfd_link_section_stabs): Likewise.
1059
1060 * coff-arm.c (coff_arm_relocate_section): Use L modifier in error
1061 format.
1062 * coff-mcore.c (coff_mcore_relocate_section): Likewise.
1063 * coff-ppc.c (coff_ppc_relocate_section): Likewise.
1064 * coff-rs6000.c (xcoff_reloc_type_toc): Likewise.
1065 * coff-sh.c (sh_relax_section): Likewise.
1066 (sh_relax_delete_bytes, sh_swap_insns): Likewise.
1067 * coff-tic80.c (coff_tic80_relocate_section): Likewise.
1068 * coffcode.h (coff_slurp_reloc_table): Likewise.
1069 * coffgen.c (_bfd_coff_get_external_symbols): Likewise.
1070 (_bfd_coff_read_string_table): Likewise.
1071 * cofflink.c (_bfd_coff_generic_relocate_section): Likewise.
1072 * compress.c (bfd_get_full_section_contents): Likewise.
1073 * dwarf2.c (read_formatted_entries, decode_line_info): Likewise.
1074 * elf-m10300.c (mn10300_elf_relocate_section): Likewise.
1075 * elf.c (bfd_elf_string_from_elf_section): Likewise.
1076 * elf32-arc.c (arc_special_overflow_checks): Likewise.
1077 * elf32-arm.c (elf32_arm_tls_relax): Likewise.
1078 (elf32_arm_final_link_relocate, elf32_arm_relocate_section): Likewise.
1079 (elf32_arm_write_section): Likewise.
1080 * elf32-bfin.c (bfin_relocate_section): Likewise.
1081 (bfinfdpic_relocate_section): Likewise.
1082 * elf32-hppa.c (hppa_build_one_stub): Likewise.
1083 (final_link_relocate, elf32_hppa_relocate_section): Likewise.
1084 * elf32-i386.c (elf_i386_tls_transition): Likewise.
1085 (elf_i386_relocate_section): Likewise.
1086 * elf32-ip2k.c (ip2k_final_link_relocate): Likewise.
1087 * elf32-lm32.c (lm32_elf_finish_dynamic_sections): Likewise.
1088 * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
1089 * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
1090 * elf32-metag.c (elf_metag_relocate_section): Likewise.
1091 * elf32-nds32.c (unrecognized_reloc_msg): Likewise.
1092 (nds32_elf_relax_longcall1, nds32_elf_relax_longcall2): Likewise.
1093 (nds32_elf_relax_longcall3, nds32_elf_relax_longjump1): Likewise.
1094 (nds32_elf_relax_longjump2, nds32_elf_relax_longjump3): Likewise.
1095 (nds32_elf_relax_longcall4, nds32_elf_relax_longcall5): Likewise.
1096 (nds32_elf_relax_longcall6, nds32_elf_relax_longjump4): Likewise.
1097 (nds32_elf_relax_longjump5, nds32_elf_relax_longjump6): Likewise.
1098 (nds32_elf_relax_longjump7, nds32_elf_relax_loadstore): Likewise.
1099 (nds32_elf_relax_ptr, nds32_elf_ex9_build_hash_table): Likewise.
1100 * elf32-nios2.c (nios2_elf32_relocate_section): Likewise.
1101 * elf32-rx.c (UNSAFE_FOR_PID): Likewise.
1102 * elf32-s390.c (invalid_tls_insn, elf_s390_relocate_section): Likewise.
1103 * elf32-score.c (s3_bfd_score_elf_check_relocs): Likewise.
1104 * elf32-score7.c (s7_bfd_score_elf_check_relocs): Likewise.
1105 * elf32-sh.c (sh_elf_relax_section): Likewise.
1106 (sh_elf_relax_delete_bytes, sh_elf_swap_insns): Likewise.
1107 (sh_elf_relocate_section): Likewise.
1108 * elf32-sh64.c (shmedia_prepare_reloc): Likewise.
1109 * elf32-spu.c (spu_elf_relocate_section): Likewise.
1110 * elf32-tic6x.c (elf32_tic6x_relocate_section): Likewise.
1111 * elf32-tilepro.c (tilepro_elf_relocate_section): Likewise.
1112 * elf32-v850.c (v850_elf_relax_section): Likewise.
1113 * elf32-vax.c (elf_vax_check_relocs): Likewise.
1114 (elf_vax_relocate_section): Likewise.
1115 * elf32-xtensa.c (elf_xtensa_relocate_section): Likewise.
1116 (extend_ebb_bounds_forward, extend_ebb_bounds_backward): Likewise.
1117 (compute_text_actions, compute_ebb_proposed_actions): Likewise.
1118 (do_fix_for_relocatable_link): Likewise.
1119 * elf64-alpha.c (elf64_alpha_relax_got_load): Likewise.
1120 (elf64_alpha_relax_with_lituse): Likewise.
1121 * elf64-hppa.c (elf64_hppa_finish_dynamic_symbol): Likewise.
1122 (elf_hppa_final_link_relocate): Likewise.
1123 * elf64-ia64-vms.c (elf64_ia64_relax_section): Likewise.
1124 (elf64_ia64_choose_gp, elf64_ia64_relocate_section): Likewise.
1125 (elf64_vms_link_add_object_symbols): Likewise.
1126 * elf64-mmix.c (mmix_elf_perform_relocation): Likewise.
1127 (mmix_final_link_relocate): Likewise.
1128 * elf64-s390.c (invalid_tls_insn): Likewise.
1129 (elf_s390_relocate_section): Likewise.
1130 * elf64-sh64.c (sh_elf64_relocate_section): Likewise.
1131 * elf64-x86-64.c (elf_x86_64_tls_transition): Likewise.
1132 (elf_x86_64_relocate_section): Likewise.
1133 * elfcode.h (elf_slurp_symbol_table): Likewise.
1134 * elfcore.h (elf_core_file_p): Likewise.
1135 * elflink.c (elf_link_read_relocs_from_section): Likewise.
1136 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Likewise.
1137 (elfNN_aarch64_relocate_section): Likewise.
1138 * elfnn-ia64.c (elfNN_ia64_relax_section): Likewise.
1139 (elfNN_ia64_choose_gp, elfNN_ia64_relocate_section): Likewise.
1140 * elfnn-riscv.c (riscv_elf_relocate_section): Likewise.
1141 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
1142 (_bfd_mips_elf_relocate_section): Likewise.
1143 (_bfd_mips_elf_finish_dynamic_symbol, mips_finish_exec_plt): Likewise.
1144 * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Likewise.
1145 * elfxx-tilegx.c (tilegx_elf_relocate_section): Likewise.
1146 * ieee.c (ieee_slurp_external_symbols): Likewise.
1147 * ihex.c (ihex_write_object_content): Likewise.
1148 * mach-o.c (bfd_mach_o_build_exec_seg_command): Likewise.
1149 * merge.c (_bfd_merged_section_offset): Likewise.
1150 * mmo.c (mmo_write_loc_chunk): Likewise.
1151 (mmo_write_object_contents): Likewise.
1152 * peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Likewise.
1153 * stabs.c (_bfd_link_section_stabs): Likewise.
1154 * xcofflink.c (xcoff_link_add_symbols, xcoff_find_tc0): Likewise.
1155
e3fbc3da
AM
11562017-07-11 Alan Modra <amodra@gmail.com>
1157
1158 * elf32-ppc.c (ppc_elf_relocate_section): Fix typo.
1159
2c4d9cbe
AM
11602017-07-11 Alan Modra <amodra@gmail.com>
1161
1162 * elf32-ppc.c (ppc_elf_relocate_section): Emit "unexpected
1163 instruction" error using _bfd_error_handler, not einfo.
1164
adce5b39
NC
11652017-07-10 Nick Clifton <nickc@redhat.com>
1166
1167 * coffcode.h (coff_slurp_symbol_table): Do not include an entry
1168 for C_AIX_WEAKEXT if it has the same value as C_WEAKEXT.
1169
e6f3b9c3
JB
11702017-07-07 John Baldwin <jhb@FreeBSD.org>
1171
1172 * elf.c (elfcore_grok_freebsd_note): Handle NT_FREEBSD_PTLWPINFO.
1173
532cc313
AM
11742017-07-07 Alan Modra <amodra@gmail.com>
1175
1176 * coffcode.h (coff_slurp_symbol_table): Handle C_AIX_WEAKEXT.
1177
1cf9552b
AM
11782017-07-07 Alan Modra <amodra@gmail.com>
1179
1180 * bfd.c (_doprnt): Replace "L" with "ll" when printing bfd_vma
1181 as long long. Move code replacing "ll" with "I64", and simplify.
1182
a0b7b105
L
11832017-07-06 H.J. Lu <hongjiu.lu@intel.com>
1184
1185 * bfd.c (_doprnt): Convert 'L' to 'l' when setting wide_width
1186 to 1.
1187
1d827a72
L
11882017-07-05 H.J. Lu <hongjiu.lu@intel.com>
1189
1190 * dwarf2.c (line_info_add_include_dir_stub): Replace time with
1191 xtime.
1192 (line_info_add_file_name): Likewise.
1193 (decode_line_info): Likewise.
1194
0d702cfe
TG
11952017-07-04 Tristan Gingold <gingold@adacore.com>
1196
1197 * version.m4: Bump version to 2.29.51
1198 * configure: Regenerate.
1199
564e46b7
JW
12002017-07-04 Jiong Wang <jiong.wang@arm.com>
1201
1202 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Remove the
1203 sanity check at the head of this function.
1204
0041f7df
JK
12052017-07-04 Jan Kratochvil <jan.kratochvil@redhat.com>
1206
1207 * dwarf2.c (struct dwarf2_debug): Add fields dwarf_line_str_buffer and
1208 dwarf_line_str_size.
1209 (struct attr_abbrev): Add field implicit_const.
1210 (dwarf_debug_sections): Add .debug_line_str.
1211 (enum dwarf_debug_section_enum): Add debug_line_str and debug_max.
1212 (dwarf_debug_section_assert): Add static assertion.
1213 (read_indirect_line_string): New.
1214 (read_abbrevs): Support DW_FORM_implicit_const.
1215 (is_str_attr): Support DW_FORM_line_strp.
1216 (read_attribute_value): Support DW_FORM_line_strp and
1217 DW_FORM_implicit_const.
1218 (read_attribute): Support DW_FORM_implicit_const.
1219 (line_info_add_include_dir, line_info_add_include_dir_stub):
1220 (line_info_add_file_name, read_formatted_entries): New.
1221 (decode_line_info, parse_comp_unit): Support DWARF 5.
1222 (_bfd_dwarf2_cleanup_debug_info): Free dwarf_line_str_buffer.
1223
d8cd8c1f
EB
12242017-07-03 Egeyar Bagcioglu <egeyar.bagcioglu@oracle.com>
1225
1226 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Remove the
1227 abort statement that was put for symbols that are not dynamic.
1228
15e6ed8c
TG
12292017-07-03 Tristan Gingold <gingold@adacore.com>
1230
1231 * po/bfd.pot: Regenerate
1232
76cfced5
AM
12332017-07-03 Alan Modra <amodra@gmail.com>
1234
1235 * bfd.c (_doprnt): Rewrite "ll" and "L" modifiers to "I64" for
1236 __MSVCRT__. Support "L" modifier for bfd_vma. Formatting.
1237 * elf.c (setup_group): Use "Lx" to print sh_size.
1238 (_bfd_elf_setup_sections): Remove unnecessary cast and print
1239 unknown section type in hex.
1240 (copy_special_section_fields): Style fix.
1241 (bfd_section_from_shdr): Correct format for sh_link. Use a
1242 common error message for all the variants of unrecognized
1243 section types.
1244 (assign_file_positions_for_load_sections): Use "Lx" for lma
1245 adjust error message.
1246 (assign_file_positions_for_non_load_sections): Formatting.
1247 (rewrite_elf_program_header): Formatting. Use "Lx" for
1248 bfd_vma values in error messages.
1249 * elfcode.h (elf_slurp_reloc_table_from_section): Cast
1250 ELF_R_SYM value to type expected by format.
1251 * elflink.c (elf_link_read_relocs_from_section): Use "Lx"
1252 in error messages.
1253 (elf_link_add_object_symbols): Use "Lu" for symbol sizes.
1254 (elf_link_input_bfd): Use "Lx" for r_info.
1255 (bfd_elf_gc_record_vtinherit): Use "Lx" for offset.
1256
ce9116fd
AM
12572017-07-03 Alan Modra <amodra@gmail.com>
1258
1259 * bfd.c (bfd_scan_vma): Don't use long long unless HAVE_LONG_LONG.
1260 * coff-rs6000.c (FMT20): Handle hosts with 64-bit long and
1261 Microsoft C library variant of long long format specifier.
1262 (PRINT20): Cast value to bfd_uint64_t not long long.
1263 * coffcode.h (coff_print_aux): Use BFD_VMA_FMT.
1264 * coff-x86_64.c (coff_amd64_reloc): Use bfd_uint64_t rather than
1265 long long. Don't cast to bfd_vma.
1266 * elf32-score.c (score3_bfd_getl48): Likewise.
1267 * vms-alpha.c (_bfd_vms_slurp_eisd): Likewise.
1268
cd9af601
AM
12692017-07-03 Alan Modra <amodra@gmail.com>
1270
1271 * elf.c (_bfd_elf_print_private_bfd_data): Use BFD_VMA_FMT to
1272 print d_tag.
1273 (bfd_elf_print_symbol): Don't cast symbol->flags.
1274 (_bfd_elf_symbol_from_bfd_symbol): Likewise.
1275 * elf32-ppc.c (ppc_elf_begin_write_processing): Correct
1276 _bfd_error_handler argument order.
1277 (ppc_elf_merge_private_bfd_data): Don't cast flags.
1278
33c734b2
AM
12792017-07-03 Alan Modra <amodra@gmail.com>
1280
1281 * configure.ac: Invoke AC_CHECK_TYPES for long long. Invoke
1282 AC_TYPE_LONG_DOUBLE.
1283 * configure: Regenerate.
1284 * config.in: Regenerate.
1285
3df5cd13
AW
12862017-06-29 Andrew Waterman <andrew@sifive.com>
1287
1288 * elfnn-riscv.c (riscv_elf_adjust_dynamic_symbol): Fix TLS copy
1289 relocs.
1290
ec1acaba
EB
12912017-06-29 Egeyar Bagcioglu <egeyar.bagcioglu@oracle.com>
1292
1293 * elfxx-sparc.c (allocate_dynrelocs): Don't make a symbol dynamic
1294 unless it is undefined weak.
1295 * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Set the flag
1296 relative_reloc to direct non-dynamic symbols to R_SPARC_RELATIVE
1297 relocation.
1298 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): If symbol
1299 is not dynamic in PIC, abort.
1300
ff07562f
JW
13012017-06-29 Jiong Wang <jiong.wang@arm.com>
1302
1303 PR ld/21402
1304 * elfnn-aarch64.c (elfNN_aarch64_allocate_dynrelocs): Only make
1305 undefined weak symbols into dynamic.
1306 (elfNN_aarch64_final_link_relocate): Generate runtime RELATIVE
1307 relocation for non-dynamic symbols.
1308 (elfNN_aarch64_finish_dynamic_symbol): Add sanity check.
1309
2aff25ba
JW
13102017-06-29 Jiong Wang <jiong.wang@arm.com>
1311
1312 * elfnn-aarch64.c (aarch64_relocation_aginst_gp_p): New function.
1313 (elfNN_aarch64_final_link_relocate): Delete duplicated code for
1314 BFD_RELOC_AARCH64_LD64_GOTOFF_LO15, BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC,
1315 BFD_RELOC_AARCH64_MOVW_GOTOFF_G1.
1316 * elfxx-aarch64.c (_bfd_aarch64_elf_resolve_relocation): Optimize the
1317 support for them.
1318
88ab90e8
AA
13192017-06-29 Andreas Arnez <arnez@linux.vnet.ibm.com>
1320
1321 * elf-bfd.h (elfcore_write_s390_gs_cb): Add prototype.
1322 (elfcore_write_s390_gs_bc): Likewise.
1323 * elf.c (elfcore_grok_s390_gs_cb): New function.
1324 (elfcore_grok_s390_gs_bc): New function.
1325 (elfcore_grok_note): Call them.
1326 (elfcore_write_s390_gs_cb): New function.
1327 (elfcore_write_s390_gs_bc): New function.
1328 (elfcore_write_register_note): Call them.
1329
328ce951
L
13302017-06-28 H.J. Lu <hongjiu.lu@intel.com>
1331
1332 * libbfd.c (_bfd_generic_get_section_contents): Don't call
1333 bfd_get_file_size. Check archive element size.
1334 (_bfd_generic_get_section_contents_in_window): Likewise.
1335
47fdcf63
L
13362017-06-28 H.J. Lu <hongjiu.lu@intel.com>
1337
1338 * bfd-in2.h: Regenerated.
1339 * bfdio.c (bfd_get_size): Change return type to ufile_ptr.
1340 (bfd_get_file_size): Likewise.
1341
38bf472a
MR
13422017-06-28 Maciej W. Rozycki <macro@imgtec.com>
1343 Matthew Fortune <matthew.fortune@imgtec.com>
1344
1345 * archures.c (bfd_mach_mips_interaptiv_mr2): New macro.
1346 * cpu-mips.c (I_interaptiv_mr2): New enum value.
1347 (arch_info_struct): Add "mips:interaptiv-mr2" entry.
1348 * elfxx-mips.c (_bfd_elf_mips_mach) <E_MIPS_MACH_IAMR2>: New
1349 case.
1350 (mips_set_isa_flags) <bfd_mach_mips_interaptiv_mr2>: Likewise.
1351 (bfd_mips_isa_ext) <bfd_mach_mips_interaptiv_mr2>: Likewise.
1352 (print_mips_isa_ext) <AFL_EXT_INTERAPTIV_MR2>: Likewise.
1353 (mips_mach_extensions): Add `bfd_mach_mipsisa32r3' and
1354 `bfd_mach_mips_interaptiv_mr2' entries.
1355 * bfd-in2.h: Regenerate.
1356
2d68166e
NC
13572017-06-27 Nick Clifton <nickc@redhat.com>
1358
1359 * tekhex.c (pass_over): Revert accidental conversion of a local
1360 array to a static array.
1361
68063779
SKS
13622017-06-27 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
1363
1364 PR ld/13402
1365 * elf32-avr.c (elf32_avr_adjust_diff_reloc_value): Adjust
1366 reloc addend if necessary. Adjust diff only if
1367 shrinked_insn_address < end_address.
1368
ea9aafc4
AM
13692017-06-27 Alan Modra <amodra@gmail.com>
1370
1371 PR binutils/21665
1372 * libbfd.c (_bfd_generic_get_section_contents): Warning fix.
1373 (_bfd_generic_get_section_contents_in_window): Likewise.
1374
a6cbf936
KLC
13752017-06-26 Kuan-Lin Chen <rufus@andestech.com>
1376
1377 * elfnn-riscv.c (perform_relocation): Support the new
1378 R_RISCV_32_PCREL relocation.
1379 (riscv_elf_relocate_section): Likewise.
1380 * elfxx-riscv.c (howto_table): Likewise.
1381 (riscv_reloc_map): Likewise.
1382 * bfd-in2.h (BFD_RELOC_RISCV_32_PCREL): New relocation.
1383 * libbfd.h: Regenerate.
1384
7211ae50
AM
13852017-06-27 Alan Modra <amodra@gmail.com>
1386
1387 PR binutils/21665
1388 * libbfd.c (_bfd_generic_get_section_contents): Delete abort.
1389 Use unsigned file pointer type, and remove cast.
1390 * libbfd.c (_bfd_generic_get_section_contents_in_window): Likewise.
1391 Add "count", not "sz".
1392
ab27f80c
PA
13932017-06-26 Pedro Alves <palves@redhat.com>
1394
1395 PR binutils/21665
1396 * libbfd.c (_bfd_generic_get_section_contents): Add "count", not
1397 "sz".
1398
1f473e3d
L
13992017-06-26 H.J. Lu <hongjiu.lu@intel.com>
1400
1401 PR binutils/21665
1402 * libbfd.c (_bfd_generic_get_section_contents_in_window): Add
1403 a missing line.
1404
b417536f
MR
14052017-06-26 Maciej W. Rozycki <macro@imgtec.com>
1406
1407 * cpu-mips.c (arch_info_struct): Mark the 4010 32-bit.
1408 * elfxx-mips.c (mips_set_isa_flags) <bfd_mach_mips4010>: Set
1409 E_MIPS_ARCH_2 rather than E_MIPS_ARCH_3 in `e_flags'.
1410 (mips_mach_extensions): Mark `bfd_mach_mips4010' as extending
1411 `bfd_mach_mips6000' rather than `bfd_mach_mips4000'.
1412
0630b49c
L
14132017-06-26 H.J. Lu <hongjiu.lu@intel.com>
1414
1415 PR binutils/21665
1416 * compress.c (bfd_get_full_section_contents): Don't check the
1417 file size here.
1418 * libbfd.c (_bfd_generic_get_section_contents): Check for and
ea9aafc4 1419 reject a section whose size + offset is greater than the size
0630b49c
L
1420 of the entire file.
1421 (_bfd_generic_get_section_contents_in_window): Likewise.
515a4464 1422
04e15b4a
NC
14232017-06-26 Nick Clifton <nickc@redhat.com>
1424
1425 PR binutils/21670
1426 * tekhex.c (getvalue): Check for the source pointer exceeding the
1427 end pointer before the first byte is read.
1428
cfd14a50
NC
14292017-06-26 Nick Clifton <nickc@redhat.com>
1430
1431 PR binutils/21665
ea9aafc4 1432 * opncls.c (get_build_id): Check that the section is big enough
cfd14a50
NC
1433 to contain the whole note.
1434 * compress.c (bfd_get_full_section_contents): Check for and reject
ea9aafc4 1435 a section whose size is greater than the size of the entire file.
cfd14a50
NC
1436 * elf32-v850.c (v850_elf_copy_notes): Allow for the ouput to not
1437 contain a notes section.
1438
93ec5e23
AK
14392017-06-26 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
1440
1441 * elf64-s390.c (elf_s390_additional_program_headers): Add NULL
1442 pointer checks.
1443 (elf_s390_modify_segment_map): Likewise.
1444 (bfd_elf_s390_set_options): Lisewise.
1445
57963c05
AM
14462017-06-26 Alan Modra <amodra@gmail.com>
1447
1448 * elflink.c (_bfd_elf_link_create_dynstrtab): Don't make dynobj
1449 a --just-syms bfd.
1450 (_bfd_elf_size_group_sections): Skip --just-syms bfds.
1451 (bfd_elf_size_dynamic_sections): Ignore .note.GNU-stack and
1452 .preinit_array on --just-syms bfds.
1453 (_bfd_elf_gc_mark_extra_sections): Skip --just-syms bfds.
1454 (elf_gc_sweep, bfd_elf_parse_eh_frame_entries): Likewise.
1455 (bfd_elf_gc_sections, bfd_elf_discard_info): Likewise.
1456
5cc4ca83
ST
14572017-06-25 Sergei Trofimovich <slyfox@gentoo.org>
1458
1459 * elf.c (find_link): Bounds check "hint".
1460
bff0500d
TP
14612017-06-24 Thomas Preud'homme <thomas.preudhomme@arm.com>
1462
1463 * elf32-arm.c (using_thumb_only): Update list of architectures in
1464 BFD_ASSERT for which the logic is valid.
1465 (using_thumb2_bl): Likewise.
1466 (using_thumb2): Likewise and return true for ARMv8-R.
1467 (arch_has_arm_nop): Likewise.
1468 (tag_cpu_arch_combine): New v8r table for ARMv8-R Tag_CPU_arch
1469 merging logic. Update commentis for value 15 of v8m_baseline,
1470 v8m_mainline and v4t_plus_v6_m arrays. Use v8r array to decide
1471 merging of value 15 of Tag_CPU_arch.
1472
4aa57d6a
JW
14732017-06-23 Jiong Wang <jiong.wang@arm.com>
1474
1475 * reloc.c (BFD_RELOC_AARCH64_ADR_GOTPAGE): Rename to
1476 BFD_RELOC_AARCH64_ADR_GOT_PAGE
1477 * bfd-in2.h: Regenerate.
1478
5d8763a3
L
14792017-06-22 H.J. Lu <hongjiu.lu@intel.com>
1480
1481 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Move
1482 the error_alignment label forward. Properly align program
1483 property note section.
1484
e652757b
EC
14852017-06-22 Eric Christopher <echristo@gmail.com>
1486
1487 * elf32-arm.c (elf32_arm_final_link_relocate): Use labs rather than
1488 abs to fix a truncation warning.
1489
84da4cf8
L
14902017-06-22 H.J. Lu <hongjiu.lu@intel.com>
1491
1492 * elf32-i386.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Resolve
1493 local undefined weak symbol to 0.
1494 * elf64-x86-64.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Likewise.
1495
48580982
L
14962017-06-22 H.J. Lu <hongjiu.lu@intel.com>
1497
1498 * elf32-i386.c (elf_i386_merge_gnu_properties): If info->shstk
1499 is set, turn on GNU_PROPERTY_X86_FEATURE_1_SHSTK.
1500 (elf_i386_link_setup_gnu_properties): If info->shstk is set,
1501 turn on GNU_PROPERTY_X86_FEATURE_1_IBT.
1502 * elf64-x86-64.c (elf_x86_64_merge_gnu_properties): If
1503 info->shstk is set, turn on GNU_PROPERTY_X86_FEATURE_1_SHSTK.
1504 (elf_x86_64_link_setup_gnu_properties): If info->shstk is set,
1505 turn on GNU_PROPERTY_X86_FEATURE_1_IBT.
1506
ee2fdd6f
L
15072017-06-22 H.J. Lu <hongjiu.lu@intel.com>
1508
1509 * elf32-i386.c (elf_i386_lazy_ibt_plt0_entry): New.
1510 (elf_i386_lazy_ibt_plt_entry): Likewise.
1511 (elf_i386_pic_lazy_ibt_plt0_entry): Likewise.
1512 (elf_i386_non_lazy_ibt_plt_entry): Likewise.
1513 (elf_i386_pic_non_lazy_ibt_plt_entry): Likewise.
1514 (elf_i386_eh_frame_lazy_ibt_plt): Likewise.
1515 (elf_i386_lazy_plt_layout): Likewise.
1516 (elf_i386_non_lazy_plt_layout): Likewise.
1517 (elf_i386_link_hash_entry): Add plt_second.
1518 (elf_i386_link_hash_table): Add plt_second and
1519 plt_second_eh_frame.
1520 (elf_i386_allocate_dynrelocs): Use the second PLT if needed.
1521 (elf_i386_size_dynamic_sections): Use .plt.got unwind info for
1522 the second PLT. Check the second PLT.
1523 (elf_i386_relocate_section): Use the second PLT to resolve
1524 PLT reference if needed.
1525 (elf_i386_finish_dynamic_symbol): Fill and use the second PLT if
1526 needed.
1527 (elf_i386_finish_dynamic_sections): Set sh_entsize on the
1528 second PLT. Generate unwind info for the second PLT.
1529 (elf_i386_plt_type): Add plt_second.
1530 (elf_i386_get_synthetic_symtab): Support the second PLT.
1531 (elf_i386_parse_gnu_properties): Support
1532 GNU_PROPERTY_X86_FEATURE_1_AND.
1533 (elf_i386_merge_gnu_properties): Support
1534 GNU_PROPERTY_X86_FEATURE_1_AND. If info->ibt is set, turn
1535 on GNU_PROPERTY_X86_FEATURE_1_IBT
1536 (elf_i386_link_setup_gnu_properties): If info->ibt is set,
1537 turn on GNU_PROPERTY_X86_FEATURE_1_IBT. Use IBT-enabled PLT
1538 for info->ibtplt, info->ibt or GNU_PROPERTY_X86_FEATURE_1_IBT
1539 is set on all relocatable inputs.
1540 * elf64-x86-64.c (elf_x86_64_lazy_ibt_plt_entry): New.
1541 (elf_x32_lazy_ibt_plt_entry): Likewise.
1542 (elf_x86_64_non_lazy_ibt_plt_entry): Likewise.
1543 (elf_x32_non_lazy_ibt_plt_entry): Likewise.
1544 (elf_x86_64_eh_frame_lazy_ibt_plt): Likewise.
1545 (elf_x32_eh_frame_lazy_ibt_plt): Likewise.
1546 (elf_x86_64_lazy_ibt_plt): Likewise.
1547 (elf_x32_lazy_ibt_plt): Likewise.
1548 (elf_x86_64_non_lazy_ibt_plt): Likewise.
1549 (elf_x32_non_lazy_ibt_plt): Likewise.
1550 (elf_x86_64_get_synthetic_symtab): Support the second PLT.
1551 (elf_x86_64_parse_gnu_properties): Support
1552 GNU_PROPERTY_X86_FEATURE_1_AND.
1553 (elf_x86_64_merge_gnu_properties): Support
1554 GNU_PROPERTY_X86_FEATURE_1_AND. If info->ibt is set, turn
1555 on GNU_PROPERTY_X86_FEATURE_1_IBT
1556 (elf_x86_64_link_setup_gnu_properties): If info->ibt is set,
1557 turn on GNU_PROPERTY_X86_FEATURE_1_IBT. Use IBT-enabled PLT
1558 for info->ibtplt, info->ibt or GNU_PROPERTY_X86_FEATURE_1_IBT
1559 is set on all relocatable inputs.
1560
d19237d9
NC
15612017-06-22 Nick Clifton <nickc@redhat.com>
1562
1563 PR binutils/21649
1564 * som.c (setup_sections): NUL terminate the space_strings buffer.
1565 Check that the space.name field does not index beyond the end of
1566 the space_strings buffer.
1567
6879f5a9
NC
15682017-06-21 Nick Clifton <nickc@redhat.com>
1569
1570 PR binutils/21646
1571 * coff-sh.c (sh_reloc): Check for an out of range reloc.
1572
7adc0a81
NC
15732017-06-21 Nick Clifton <nickc@redhat.com>
1574
1575 PR binutils/21639
1576 * vms-misc.c (_bfd_vms_save_sized_string): Use unsigned int as
1577 type of the size parameter.
1578 (_bfd_vms_save_counted_string): Add second parameter - the maximum
1579 length of the counted string.
1580 * vms.h (_bfd_vms_save_sized_string): Update prototype.
1581 (_bfd_vms_save_counted_string): Likewise.
1582 * vms-alpha.c (_bfd_vms_slurp_eisd): Update calls to
1583 _bfd_vms_save_counted_string.
1584 (_bfd_vms_slurp_ehdr): Likewise.
1585 (_bfd_vms_slurp_egsd): Likewise.
1586 (Parse_module): Likewise.
1587
6e1816be
AM
15882017-06-21 Alan Modra <amodra@gmail.com>
1589
1590 * elf64-ppc.c (ppc64_elf_size_stubs): Test for localentry:0 plt
1591 calls before tocsave calls.
1592 (ppc64_elf_relocate_section): Allow localentry:0 plt calls without
1593 following nop.
1594
20bd1b6b
NC
15952017-06-21 Nick Clifton <nickc@redhat.com>
1596
1597 PR binutils/21645
1598 * reloc.c (bfd_generic_get_relocated_section_contents): Fail if
1599 bfd_get_full_section_contents returns no contents.
1600
3de58d95
NC
16012017-06-21 Nick Clifton <nickc@redhat.com>
1602
1603 PR binutils/21638
1604 * vms-alpha.c (_bfd_vms_slurp_egsd): Check for an undersized
1605 record.
1606
cb06d03a
NC
16072017-06-21 Nick Clifton <nickc@redhat.com>
1608
1609 PR binutils/21637
1610 * vms-alpha.c (_bfd_vms_slurp_egsd): Check for an empty section
1611 list.
1612 (image_set_ptr): Likewise.
1613 (alpha_vms_fix_sec_rel): Likewise.
1614 (alpha_vms_slurp_relocs): Likewise.
1615
c458d007
NC
16162017-06-21 Nick Clifton <nickc@redhat.com>
1617
1618 PR binutils/21633
1619 * ieee.c (ieee_slurp_sections): Check for a NULL return from
1620 read_id.
1621 (ieee_archive_p): Likewise.
1622 (ieee_object_p): Likewise.
1623
ce497010
NC
16242017-06-21 Nick Clifton <nickc@redhat.com>
1625
1626 PR binutils/21640
1627 * elf.c (setup_group): Zero the group section pointer list after
1628 allocation so that loops can be caught. Check for NULL pointers
1629 when processing a group list.
1630
fd52715c
AK
16312017-06-20 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
1632
1633 * elf-s390.h: New file.
1634 * elf64-s390.c (struct elf_s390_link_hash_table): Add params
1635 field.
1636 (elf_s390_additional_program_headers): New function.
1637 (elf_s390_modify_segment_map): New function.
1638 (bfd_elf_s390_set_options): New function.
1639 (elf_backend_additional_program_headers)
1640 (elf_backend_modify_segment_map): Add macro definitions.
1641
abfa390d
L
16422017-06-19 H.J. Lu <hongjiu.lu@intel.com>
1643
1644 PR ld/21626
1645 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Check
1646 the DYNAMIC bit instead of bfd_count_sections.
1647
bc21b167
NC
16482017-06-19 Nick Clifton <nickc@redhat.com>
1649
1650 PR binutils/21618
1651 * vms-alpha.c (evax_bfd_print_emh): Check for insufficient record
1652 length.
1653 (evax_bfd_print_eeom): Likewise.
1654 (evax_bfd_print_egsd): Check for an overlarge record length.
1655 (evax_bfd_print_etir): Likewise.
1656
acb56a83
NC
16572017-06-19 Nick Clifton <nickc@redhat.com>
1658
1659 PR binutils/21612
1660 * libieee.h (struct common_header_type): Add end_p field.
1661 * ieee.c (this_byte_and_next): Do not advance input_p beyond
1662 end_p.
1663 (read_id): Check for a length that exceeds the remaining bytes in
1664 the input buffer.
1665 (ieee_seek): Initialise end_p.
1666 (ieee_archive_p): Likewise.
1667 (ieee_object_p): Likewise.
1668
72e84f96
NC
16692017-06-19 Nick Clifton <nickc@redhat.com>
1670
80053e46
NC
1671 PR binutils/21611
1672 * vms-alpha.c (_bfd_vms_slurp_eihs): Check for invalid offset
1673 before reading the EIHS structure entries.
1674
16752017-06-19 Nick Clifton <nickc@redhat.com>
1676
1677 PR binutils/21615
72e84f96
NC
1678 * vms-alpha.c (_bfd_vms_slurp_egsd): Use unsigned int for
1679 gsd_size. Check that there are enough bytes remaining to read the
1680 type and size of the next egsd. Check that the size of the egsd
1681 does not exceed the size of the record.
1682
875ffa3e
AM
16832017-06-19 Alan Modra <amodra@gmail.com>
1684
1685 * config.bfd: Correct targ_underscore for cris.
1686
bdd32e03
AM
16872017-06-18 Alan Modra <amodra@gmail.com>
1688
1689 * config.bfd: Correct targ_underscore for epiphany, ip2k,
1690 m32c, mn10200, pru, rl78, rx, crisv32 and v850.
1691
4b48e2f6
NC
16922017-06-16 Nick Clifton <nickc@redhat.com>
1693
1694 * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Do not fail if the
1695 bucketlist is empty because there are no symbols to add to the
1696 list.
1697
7dba9362
AM
16982017-06-16 Alan Modra <amodra@gmail.com>
1699
1700 PR ld/20022
1701 PR ld/21557
1702 PR ld/21562
1703 PR ld/21571
1704 * targets.c (struct bfd_target): Add _bfd_define_start_stop.
1705 (BFD_JUMP_TABLE_LINK): Likewise.
1706 * elf-bfd.h (bfd_elf_define_start_stop): Declare.
1707 * elflink.c (_bfd_elf_gc_mark_rsec): Update comment.
1708 (bfd_elf_define_start_stop): New function.
1709 * linker.c (bfd_generic_define_start_stop): New function.
1710 * coff64-rs6000.c (rs6000_xcoff64_vec, rs6000_xcoff64_aix_vec): Init
1711 new field.
1712 * aout-adobe.c (aout_32_bfd_define_start_stop): Define.
1713 * aout-target.h (MY_bfd_define_start_stop): Define.
1714 * aout-tic30.c (MY_bfd_define_start_stop): Define.
1715 * binary.c (binary_bfd_define_start_stop): Define.
1716 * bout.c (b_out_bfd_define_start_stop): Define.
1717 * coff-alpha.c (_bfd_ecoff_bfd_define_start_stop): Define.
1718 * coff-mips.c (_bfd_ecoff_bfd_define_start_stop): Define.
1719 * coff-rs6000.c (_bfd_xcoff_bfd_define_start_stop): Define.
1720 * coffcode.h (coff_bfd_define_start_stop): Define.
1721 * elfxx-target.h (bfd_elfNN_bfd_define_start_stop): Define.
1722 * i386msdos.c (msdos_bfd_define_start_stop): Define.
1723 * i386os9k.c (os9k_bfd_define_start_stop): Define.
1724 * ieee.c (ieee_bfd_define_start_stop): Define.
1725 * ihex.c (ihex_bfd_define_start_stop): Define.
1726 * libbfd-in.h (_bfd_nolink_bfd_define_start_stop): Define.
1727 * mach-o-target.c (bfd_mach_o_bfd_define_start_stop): Define.
1728 * mmo.c (mmo_bfd_define_start_stop): Define.
1729 * nlm-target.h (nlm_bfd_define_start_stop): Define.
1730 * oasys.c (oasys_bfd_define_start_stop): Define.
1731 * pef.c (bfd_pef_bfd_define_start_stop): Define.
1732 * plugin.c (bfd_plugin_bfd_define_start_stop): Define.
1733 * ppcboot.c (ppcboot_bfd_define_start_stop): Define.
1734 * som.c (som_bfd_define_start_stop): Define.
1735 * srec.c (srec_bfd_define_start_stop): Define.
1736 * tekhex.c (tekhex_bfd_define_start_stop): Define.
1737 * versados.c (versados_bfd_define_start_stop): Define.
1738 * vms-alpha.c (vms_bfd_define_start_stop): Define.
1739 (alpha_vms_bfd_define_start_stop): Define.
1740 * xsym.c (bfd_sym_bfd_define_start_stop): Define.
1741 * bfd-in2.h: Regenerate.
1742 * libbfd.h: Regenerate.
1743
d68f1976
JW
17442017-06-16 Jiong Wang <jiong.wang@arm.com>
1745
1746 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Use
1747 SYMBOL_REFERENCES_LOCAL.
1748
6353d82b
JW
17492017-06-15 Jiong Wang <jiong.wang@arm.com>
1750
1751 PR ld/21532
1752 * elfnn-aarch64.c (ELIMINATE_COPY_RELOCS): Set to 1.
1753 (elfNN_aarch64_final_link_relocate): Also propagate relocations to
1754 runtime for if there needs copy relocation elimination.
1755 (need_copy_relocation_p): New function. Return true for symbol with
1756 pc-relative references and if it's against read-only sections.
1757 (elfNN_aarch64_adjust_dynamic_symbol): Use need_copy_relocation_p.
1758 (elfNN_aarch64_check_relocs): Allocate dynrelocs for relocation types
1759 that are related with accessing external objects.
1760 (elfNN_aarch64_gc_sweep_hook): Sync the relocation types with the change
1761 in elfNN_aarch64_check_relocs.
1762
63634bb4
NC
17632017-06-15 Nick Clifton <nickc@redhat.com>
1764
1765 PR binutils/21582
1766 * ieee.c (ieee_object_p): Use a static buffer to avoid compiler
1767 bugs.
62b76e4b
NC
1768 PR binutils/21581
1769 (ieee_archive_p): Likewise.
63634bb4 1770
76800cba
NC
17712017-06-15 Nick Clifton <nickc@redhat.com>
1772
1773 PR binutils/21579
1774 * vms-alpha.c (_bfd_vms_slurp_etir): Extend check of cmd_length.
1775
f7e16c2a
MF
17762017-06-14 Max Filippov <jcmvbkbc@gmail.com>
1777
1778 * elf32-xtensa.c (elf_xtensa_be_plt_entry,
1779 elf_xtensa_le_plt_entry): Add dimension for the ABI to arrays,
1780 keep both windowed and call0 ABI PLT definitions.
1781 (elf_xtensa_create_plt_entry): Use selected ABI to choose upper
1782 elf_xtensa_*_plt_entry endex.
1783 (ELF_MAXPAGESIZE): Fix at minimal supported MMU page size.
1784
f461bbd8
NC
17852017-06-14 Nick Clifton <nickc@redhat.com>
1786
1787 PR binutils/21578
1788 * elf32-sh.c (sh_elf_set_mach_from_flags): Fix check for invalid
1789 flag value.
1790
c53d2e6d
NC
17912017-06-14 Nick Clifton <nickc@redhat.com>
1792
1793 PR binutils/21589
1794 * vms-alpha.c (_bfd_vms_get_value): Add an extra parameter - the
1795 maximum value for the ascic pointer. Check that name processing
1796 does not read beyond this value.
1797 (_bfd_vms_slurp_etir): Add checks for attempts to read beyond the
1798 end of etir record.
1799
04f963fd
NC
18002017-06-14 Nick Clifton <nickc@redhat.com>
1801
1802 PR binutils/21591
1803 * versados.c (versados_mkobject): Zero the allocated tdata structure.
1804 (process_otr): Check for an invalid offset in the otr structure.
1805
319c2dbe
SH
18062017-06-14 Sebastian Huber <sebastian.huber@embedded-brains.de>
1807
1808 * config.bfd (epiphany-*-elf): Accept epiphany-*-*.
1809
cbd0eecf
L
18102017-06-13 H.J. Lu <hongjiu.lu@intel.com>
1811
1812 PR ld/20022
1813 PR ld/21557
1814 PR ld/21562
1815 PR ld/21571
1816 * elf-bfd.h (elf_link_hash_entry): Add start_stop. Change the
1817 vtable field to a union.
1818 (_bfd_elf_is_start_stop): Removed.
1819 * elf32-i386.c (elf_i386_convert_load_reloc): Also check for
1820 __start_SECNAME and __stop_SECNAME symbols.
1821 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Likewise.
1822 * elflink.c (_bfd_elf_is_start_stop): Removed.
1823 (_bfd_elf_gc_mark_rsec): Check start_stop instead of calling
1824 _bfd_elf_is_start_stop.
1825 (elf_gc_propagate_vtable_entries_used): Skip __start_SECNAME and
1826 __stop_SECNAME symbols. Updated.
1827 (elf_gc_smash_unused_vtentry_relocs): Likewise.
1828 (bfd_elf_gc_record_vtinherit): Likewise.
1829 (bfd_elf_gc_record_vtentry): Likewise.
1830
10bbbc1d
NC
18312017-06-13 Nick Clifton <nickc@redhat.com>
1832
1833 PR ld/21524
1834 * elflink.c (elf_link_adjust_relocs): Generate an error when
1835 encountering a reloc against a symbol removed by garbage
1836 collection.
1837
5c3ce2bc
L
18382017-06-12 H.J. Lu <hongjiu.lu@intel.com>
1839
1840 * elf-bfd.h (elf_backend_data): Add struct bfd_link_info *
1841 to merge_gnu_properties.
1842 * elf-properties.c (elf_merge_gnu_properties): Add struct
1843 bfd_link_info * and pass it to merge_gnu_properties.
1844 (elf_merge_gnu_property_list): Add struct bfd_link_info *
1845 and pass it to elf_merge_gnu_properties.
1846 (_bfd_elf_link_setup_gnu_properties): Pass info to
1847 elf_merge_gnu_property_list.
1848 * elf32-i386.c (elf_i386_merge_gnu_properties): Add struct
1849 bfd_link_info *.
1850 * elf64-x86-64.c (elf_x86_64_merge_gnu_properties): Likewise.
1851
9b97dfbf
AM
18522017-06-11 Joe Zbiciak <joe.zbiciak@leftturnonly.info>
1853
1854 PR 21564
1855 * binary.c (binary_set_section_contents): Scale lma by octets
1856 per byte to set filepos.
1857
e3d1d408
CM
18582017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
1859
1860 * elf32-arc.c (elf_arc_check_relocs): Fixed conditions to generate
1861 dynamic sections.
1862
64aa8e03
CM
18632017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
1864
1865 * elf32-arc.c (elf_arc_size_dynamic_sections): Changed condition to
1866 require TEXTREL.
1867
a0abe743
CM
18682017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
1869
1870 * arc-got.h (relocate_fix_got_relocs_for_got_info): Added TCB_SIZE to
1871 patched section contents for TLS IE reloc.
1872 * elf32-arc.c: Remove TCB_SIZE preprocessor macro.
1873
f4e6805f
CM
18742017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
1875
1876 * elf32-arc.c (elf_arc_relocate_section): Added "call" to
1877 RELOC_FOR_GLOBAL_SYMBOL macro.
1878
cd640291
CM
18792018-06-08 Cupertino Miranda <cmiranda@synopsys.com>
1880
1881 * elf32-arc.c (elf_arc_relocate_section): Small refactor and condition
1882 changes.
1883
7ef0acc1
VG
18842017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
1885
1886 * config/tc-arc.c (md_undefined_symbol): Changed.
1887 * config/tc-arc.h (DYNAMIC_STRUCT_NAME): Removed.
1888
cc89d0b3
CM
18892017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
1890
1891 * elf32-arc.c (elf_arc_relocate_section): Fixed reassign of indirect
1892 symbols.
1893
9d5c718b
CM
18942017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
1895
1896 * elf32-arc.c (elf_arc_check_relocs): Added condition to disable
1897 warning and "Bad value" for local symbols ARC_32 or ARC_32_ME relocs.
1898
be9e3704
CM
18992017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
1900
1901 * elf32-arc.c (ADD_RELA): Changed to only work when dynamic
1902 object is created.
1903
4ec192e6
RE
19042017-06-08 Richard Earnshaw <rearnsha@arm.com>
1905
1906 * elf32-arm.c (elf32_arm_merge_eabi_attributes): Remove assertion
1907 that the input bfd has Tag_FP_ARCH non-zero if Tag_ABI_HardFP_use
1908 is non-zero. Add clarifying comments.
1909
51fa2693
L
19102017-06-08 H.J. Lu <hongjiu.lu@intel.com>
1911
1912 * elf32-i386.c (elf_i386_check_relocs): Set local IFUNC symbol
1913 name. Use local IFUNC symbol name string to report unsupported
1914 non-PIC call to IFUNC function.
1915 (elf_i386_relocate_section): Dump local IFUNC name with minfo
1916 when generating R_386_IRELATIVE relocation.
1917 (elf_i386_finish_dynamic_symbol): Likewise.
1918 * elf_x86_64_check_relocs (elf_x86_64_check_relocs): Set local
1919 IFUNC symbol name.
1920 (elf_x86_64_relocate_section): Dump local IFUNC name with minfo
1921 when generating R_X86_64_IRELATIVE relocation.
1922 (elf_x86_64_finish_dynamic_symbol): Likewise.
1923
78e8a2ff
JM
19242017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
1925
1926 * elf.c (setup_group): Make sure BFD sections are created for all
1927 group sections in the input file when processing SHF_GROUP
1928 sections.
1929 (bfd_section_from_shdr): Avoid duplicating logic already
1930 implemented in `setup_group'.
1931
9949827b
DBR
19322017-06-06 Daniel Bonniot de Ruisselet <bonniot@gmail.com>
1933
1934 PR binutils/21546
1935 * peXXigen.c (pe_print_idata): Use the address of the first thunk
1936 if the hint address is zero.
1937
0ee3a6db
JC
19382017-06-06 James Clarke <jrtc27@jrtc27.com>
1939
1940 PR ld/19579
1941 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Check
1942 ELF_COMMON_DEF_P for common symbols.
1943
7bdf4127
AB
19442017-06-06 Andrew Burgess <andrew.burgess@embecosm.com>
1945
1946 * elf.c (_bfd_elf_make_section_from_shdr): Don't initially mark
1947 SEC_GROUP sections as SEC_EXCLUDE.
1948 (bfd_elf_set_group_contents): Replace use of abort with an assert.
1949 (assign_section_numbers): Use resolve_section_groups flag instead
1950 of relocatable link type.
1951 (_bfd_elf_init_private_section_data): Use resolve_section_groups
1952 flag instead of checking the final_link flag for part of the
1953 checks in here. Fix white space as a result.
1954 * elflink.c (elf_link_input_bfd): Use resolve_section_groups flag
1955 instead of relocatable link type.
1956 (bfd_elf_final_link): Likewise.
1957
458ad2b8
JM
19582017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
1959
1960 * elfxx-mips.c (_bfd_mips_elf_relocate_section): Remove unused
1961 variable `bed'.
1962 * elf32-score.c (score_elf_final_link_relocate): Likewise.
1963 (s3_bfd_score_elf_check_relocs): Likewise.
1964 * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
1965 (score_elf_final_link_relocate): Likewise.
1966 (s7_bfd_score_elf_check_relocs): Likewise.
1967
fbebaf4a
JM
19682017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
1969
1970 * elflink.c (init_reloc_cookie_rels): Remove unused variable
1971 `bed'.
1972
056bafd4
MR
19732017-06-06 Maciej W. Rozycki <macro@imgtec.com>
1974
1975 * elf-bfd.h (RELOC_AGAINST_DISCARDED_SECTION): Subtract `count'
1976 from `reloc_count' rather than decrementing it.
1977 * elf.c (bfd_section_from_shdr): Multiply the adjustment to
1978 `reloc_count' by `int_rels_per_ext_rel'.
1979 * elf32-score.c (score_elf_final_link_relocate): Do not multiply
1980 `reloc_count' by `int_rels_per_ext_rel' for last relocation
1981 entry determination.
1982 (s3_bfd_score_elf_check_relocs): Likewise.
1983 * elf32-score7.c (score_elf_final_link_relocate): Likewise.
1984 (s7_bfd_score_elf_relocate_section): Likewise.
1985 (s7_bfd_score_elf_check_relocs): Likewise.
1986 * elf64-mips.c (mips_elf64_get_reloc_upper_bound): Remove
1987 prototype and function.
1988 (mips_elf64_slurp_one_reloc_table): Do not update `reloc_count'.
1989 (mips_elf64_slurp_reloc_table): Assert that `reloc_count' is
1990 triple rather than once the sum of REL and RELA relocation entry
1991 counts.
1992 (bfd_elf64_get_reloc_upper_bound): Remove macro.
1993 * elflink.c (_bfd_elf_link_read_relocs): Do not multiply
1994 `reloc_count' by `int_rels_per_ext_rel' for internal relocation
1995 storage allocation size determination.
1996 (elf_link_input_bfd): Multiply `.ctors' and `.dtors' section's
1997 size by `int_rels_per_ext_rel'. Do not multiply `reloc_count'
1998 by `int_rels_per_ext_rel' for last relocation entry
1999 determination.
2000 (bfd_elf_final_link): Do not multiply `reloc_count' by
2001 `int_rels_per_ext_rel' for internal relocation storage
2002 allocation size determination.
2003 (init_reloc_cookie_rels): Do not multiply `reloc_count' by
2004 `int_rels_per_ext_rel' for last relocation entry determination.
2005 (elf_gc_smash_unused_vtentry_relocs): Likewise.
2006 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
2007 (_bfd_mips_elf_relocate_section): Likewise.
2008
af54f0eb
AM
20092017-06-05 Alan Modra <amodra@gmail.com>
2010
2011 PR 21529
2012 * linker.c (_bfd_generic_link_output_symbols): Handle BSF_GNU_UNIQUE.
2013
6cf3bf88 20142017-06-01 John Baldwin <jhb@FreeBSD.org>
b5430a3c
JB
2015
2016 * elf.c (elfcore_grok_freebsd_psinfo): Use ELF header class to
2017 determine structure sizes.
2018 (elfcore_grok_freebsd_prstatus): Likewise.
2019
f378ab09
AM
20202017-06-01 Alan Modra <amodra@gmail.com>
2021
2022 * elf64-ppc.c (struct ppc_link_hash_table): Add has_plt_localentry0.
2023 (ppc64_elf_merge_symbol_attribute): Merge localentry bits from
2024 dynamic objects.
2025 (is_elfv2_localentry0): New function.
2026 (ppc64_elf_tls_setup): Default params->plt_localentry0.
2027 (plt_stub_size): Adjust size for tls_get_addr_opt stub.
2028 (build_tls_get_addr_stub): Use a simpler stub when r2 is not saved.
2029 (ppc64_elf_size_stubs): Leave stub_type as ppc_stub_plt_call for
2030 optimized localentry:0 stubs.
2031 (ppc64_elf_build_stubs): Save r2 in ELFv2 __glink_PLTresolve.
2032 (ppc64_elf_relocate_section): Leave nop unchanged for optimized
2033 localentry:0 stubs.
2034 (ppc64_elf_finish_dynamic_sections): Set PPC64_OPT_LOCALENTRY in
2035 DT_PPC64_OPT.
2036 * elf64-ppc.h (struct ppc64_elf_params): Add plt_localentry0.
2037
8c65b54f
CS
20382017-05-30 Casey Smith <clegg89@gmail.com>
2039
2040 PR ld/21523
2041 * elf32-arm.c (elf32_arm_final_link_relocate): Install an absolute
2042 value when processing the R_ARM_THM_ALU_PREL_11_0 reloc.
2043
64984c22
AK
20442017-05-30 Anton Kolesov Anton.Kolesov@synopsys.com
2045
2046 * cpu-arc.c (arc_compatible): New function.
2047
37cd3877
AK
20482017-05-30 Anton Kolesov <anton.kolesov@synopsys.com>
2049
2050 * cpu-arc.c (arch_info_struct): Remove duplicate ARC600 entry.
2051
8e2f54bc
L
20522017-05-30 H.J. Lu <hongjiu.lu@intel.com>
2053
2054 PR binutils/21519
2055 * bfdio.c (bfd_get_file_size): New function.
2056 * bfd-in2.h: Regenerated.
2057
8e7f04f1 20582017-05-23 Dilian Palauzov <git-dpa@aegee.org>
2059
2060 * elf32-arc.c (arc_elf_merge_attributes): Add fall through
2061 comments.
2062
25f94347
L
20632017-05-22 H.J. Lu <hongjiu.lu@intel.com>
2064
2065 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Use
2066 dynobj instead of htab->elf.dynobj.
2067
e5713223
MR
20682017-05-19 Maciej W. Rozycki <macro@imgtec.com>
2069
2070 * elf64-mips.c (mips_elf64_canonicalize_reloc): Remove prototype
2071 and function.
2072 (mips_elf64_canonicalize_dynamic_reloc): Likewise.
2073 (mips_elf64_slurp_one_reloc_table): Set `reloc_count' to the
2074 actual number of internal relocations retrieved. Adjust
2075 function description.
2076 (bfd_elf64_canonicalize_reloc): Remove macro.
2077 (bfd_elf64_canonicalize_dynamic_reloc): Likewise.
2078
64517994
JM
20792017-05-19 Jose E. Marchesi <jose.marchesi@oracle.com>
2080
2081 * archures.c (bfd_mach_sparc_v9m8): Define.
2082 (bfd_mach_sparc_v8plusm8): Likewise.
2083 (bfd_mach_sparc_v9_p): Adjust to M8.
2084 (bfd_mach_sparc_64bit_p): Likewise.
2085 * aoutx.h (machine_type): Handle bfd_mach_sparc_v9m8 and
2086 bfd_mach_sparc_v8plusm8.
2087 * bfd-in2.h: Regenerated.
2088 * cpu-sparc.c (arch_info_struct): Entries for sparc:v9m8 and
2089 sparc:v8plusm8.
2090 * elfxx-sparc.c (_bfd_sparc_elf_object_p): Handle
2091 bfd_mach_sparc_v8plusm8 and bfd_mach_sparc_v9m8 using the new hw
2092 capabilities ONADDSUB, ONMUL, ONDIV, DICTUNP, FPCPSHL, RLE and
2093 SHA3.
2094 * elf32-sparc.c (elf32_sparc_final_write_processing): Handle
2095 bfd_mach_sparc_v8plusm8.
2096
eb026f09
AM
20972017-05-19 Alan Modra <amodra@gmail.com>
2098
2099 * elflink.c (_bfd_elf_gc_mark_extra_sections): Don't keep
2100 debug and special sections when no non-note alloc sections in an
2101 object are kept.
2102
535b785f
AM
21032017-05-18 Alan Modra <amodra@gmail.com>
2104
2105 * arc-got.h: Don't compare boolean values against TRUE or FALSE.
2106 * elf-m10300.c: Likewise.
2107 * elf.c: Likewise.
2108 * elf32-arc.c: Likewise.
2109 * elf32-bfin.c: Likewise.
2110 * elf32-m68k.c: Likewise.
2111 * elf32-nds32.c: Likewise.
2112 * elf32-tilepro.c: Likewise.
2113 * elflink.c: Likewise.
2114 * elfnn-aarch64.c: Likewise.
2115 * elfnn-riscv.c: Likewise.
2116 * elfxx-tilegx.c: Likewise.
2117 * mach-o.c: Likewise.
2118 * peXXigen.c: Likewise.
2119 * vms-alpha.c: Likewise.
2120 * vms-lib.c: Likewise.
2121
b7c871ed
L
21222017-05-17 H.J. Lu <hongjiu.lu@intel.com>
2123
2124 PR ld/20882
2125 * elflink.c (elf_gc_mark_debug_section): New function.
2126 (_bfd_elf_gc_mark_extra_sections): Mark any debug sections
2127 referenced by kept debug sections.
2128
bc4e12de
AM
21292017-05-16 Alan Modra <amodra@gmail.com>
2130
2131 * elf-m10300.c: Rename occurrences of non_ir_ref.
2132 * elf32-arm.c: Likewise.
2133 * elf32-bfin.c: Likewise.
2134 * elf32-cr16.c: Likewise.
2135 * elf32-cris.c: Likewise.
2136 * elf32-d10v.c: Likewise.
2137 * elf32-dlx.c: Likewise.
2138 * elf32-fr30.c: Likewise.
2139 * elf32-frv.c: Likewise.
2140 * elf32-hppa.c: Likewise.
2141 * elf32-i370.c: Likewise.
2142 * elf32-i386.c: Likewise.
2143 * elf32-iq2000.c: Likewise.
2144 * elf32-lm32.c: Likewise.
2145 * elf32-m32c.c: Likewise.
2146 * elf32-m32r.c: Likewise.
2147 * elf32-m68hc1x.c: Likewise.
2148 * elf32-m68k.c: Likewise.
2149 * elf32-mcore.c: Likewise.
2150 * elf32-metag.c: Likewise.
2151 * elf32-microblaze.c: Likewise.
2152 * elf32-moxie.c: Likewise.
2153 * elf32-msp430.c: Likewise.
2154 * elf32-mt.c: Likewise.
2155 * elf32-nios2.c: Likewise.
2156 * elf32-or1k.c: Likewise.
2157 * elf32-ppc.c: Likewise.
2158 * elf32-rl78.c: Likewise.
2159 * elf32-s390.c: Likewise.
2160 * elf32-score.c: Likewise.
2161 * elf32-score7.c: Likewise.
2162 * elf32-sh.c: Likewise.
2163 * elf32-tic6x.c: Likewise.
2164 * elf32-tilepro.c: Likewise.
2165 * elf32-v850.c: Likewise.
2166 * elf32-vax.c: Likewise.
2167 * elf32-xstormy16.c: Likewise.
2168 * elf32-xtensa.c: Likewise.
2169 * elf64-alpha.c: Likewise.
2170 * elf64-hppa.c: Likewise.
2171 * elf64-ia64-vms.c: Likewise.
2172 * elf64-mmix.c: Likewise.
2173 * elf64-ppc.c: Likewise.
2174 * elf64-s390.c: Likewise.
2175 * elf64-sh64.c: Likewise.
2176 * elf64-x86-64.c: Likewise.
2177 * elflink.c: Likewise.
2178 * elfnn-aarch64.c: Likewise.
2179 * elfnn-ia64.c: Likewise.
2180 * elfnn-riscv.c: Likewise.
2181 * elfxx-mips.c: Likewise.
2182 * elfxx-sparc.c: Likewise.
2183 * elfxx-tilegx.c: Likewise.
2184 * linker.c: Likewise.
2185
4070765b
AM
21862017-05-16 Alan Modra <amodra@gmail.com>
2187
2188 * elf64-ppc.c (add_symbol_adjust): Transfer non_ir_ref_dynamic.
2189 * elflink.c (elf_link_add_object_symbols): Update to use
2190 non_ir_ref_dynamic.
2191 (elf_link_input_bfd): Test non_ir_ref_dynamic in addition to
2192 non_ir_ref.
2193 * linker.c (_bfd_generic_link_add_one_symbol): Likewise.
2194
25499ac7
MR
21952017-05-15 Maciej W. Rozycki <macro@imgtec.com>
2196
2197 * elfxx-mips.c (print_mips_ases): Handle MIPS16e2 ASE.
2198
73caa85d
L
21992017-05-12 H.J. Lu <hongjiu.lu@intel.com>
2200
2201 * elf32-i386.c (elf_i386_parse_gnu_properties): Merge
2202 GNU_PROPERTY_X86_ISA_1_USED and GNU_PROPERTY_X86_ISA_1_NEEDED
2203 properties.
2204 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
2205
f2c29a16
L
22062017-05-11 H.J. Lu <hongjiu.lu@intel.com>
2207
2208 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Rename plt_bnd
2209 to plt_second.
2210 (elf_x86_64_link_hash_table): Rename plt_bnd/plt_bnd_eh_frame
2211 to plt_second/plt_second_eh_frame.
2212 (elf_x86_64_link_hash_newfunc): Updated.
2213 (elf_x86_64_allocate_dynrelocs): Likewise.
2214 (elf_x86_64_size_dynamic_sections): Likewise.
2215 (elf_x86_64_relocate_section): Likewise.
2216 (elf_x86_64_finish_dynamic_symbol): Likewise.
2217 (elf_x86_64_finish_dynamic_sections): Likewise.
2218 (elf_x86_64_plt_type): Rename plt_bnd to plt_second.
2219 (elf_x86_64_get_synthetic_symtab): Updated. Also scan the
2220 .plt.sec section.
2221 (elf_backend_setup_gnu_properties): Updated. Create the
2222 .plt.sec section instead of the .plt.sec section.
2223
dc2be3d2
L
22242017-05-11 H.J. Lu <hongjiu.lu@intel.com>
2225
2226 * elf32-i386.c (elf_i386_allocate_dynrelocs): Partially revert
2227 commit 25070364b0ce33eed46aa5d78ebebbec6accec7e.
2228 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewse.
2229
db84b98a
JM
22302017-05-10 Jose E. Marchesi <jose.marchesi@oracle.com>
2231
2232 * elf64-sparc.c (elf64_sparc_set_reloc): New function.
2233 (bfd_elf64_set_reloc): Define.
2234 (elf64_sparc_write_relocs): Use `canon_reloc_count'.
2235
23186865
JM
22362017-05-10 Jose E. Marchesi <jose.marchesi@oracle.com>
2237
2238 * targets.c (BFD_JUMP_TABLE_RELOCS): Add NAME##_set_reloc.
2239 (struct bfd_target): New field _bfd_set_reloc.
2240 * bfd.c (bfd_set_reloc): Call backend _set_bfd.
2241 * reloc.c (_bfd_generic_set_reloc): New function.
2242 * coffcode.h (coff_set_reloc): Define to _bfd_generic_set_reloc.
2243 * nlm-target.h (nlm_set_reloc): Likewise.
2244 * coff-rs6000.c (_bfd_xcoff_set_reloc): Likewise.
2245 * aout-tic30.c (MY_set_reloc): Likewise.
2246 * aout-target.h (MY_set_reloc): Likewise.
2247 * elfxx-target.h (bfd_elfNN_set_reloc): Likewise.
2248 * coff-alpha.c (_bfd_ecoff_set_reloc): Likewise.
2249 * mach-o-target.c (bfd_mach_o_set_reloc): Likewise.
2250 * vms-alpha.c (alpha_vms_set_reloc): Likewise.
2251 * aout-adobe.c (aout_32_set_reloc): Likewise.
2252 * bout.c (b_out_set_reloc): Likewise.
2253 * coff-mips.c (_bfd_ecoff_set_reloc): Likewise.
2254 * i386os9k.c (aout_32_set_reloc): Likewise.
2255 * ieee.c (ieee_set_reloc): Likewise.
2256 * oasys.c (oasys_set_reloc): Likewise.
2257 * som.c (som_set_reloc): Likewise.
2258 * versados.c (versados_set_reloc): Likewise.
2259 * coff64-rs6000.c (rs6000_xcoff64_vec): Add
2260 _bfd_generic_set_reloc.
2261 (rs6000_xcoff64_aix_vec): LIkewise.
2262 * libbfd.c (_bfd_norelocs_set_reloc): New function.
2263 * libbfd-in.h: Prototype for _bfd_norelocs_set_reloc.
2264 * i386msdos.c (msdos_set_reloc): Define to
2265 _bfd_norelocs_set_reloc.
2266 * elfcode.h (elf_set_reloc): Define.
2267 * bfd-in2.h: Regenerated.
2268
aab82f4c
L
22692017-05-10 H.J. Lu <hongjiu.lu@intel.com>
2270
2271 PR ld/21481
2272 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Use .plt.bnd
2273 for IFUNC function address.
2274
53a346d8
CZ
22752017-05-10 Claudiu Zissulescu <claziss@synopsys.com>
2276
2277 * elf32-arc.c (FEATURE_LIST_NAME): Define.
2278 (CONFLICT_LIST): Likewise.
2279 (opcode/arc-attrs.h): Include.
2280 (arc_elf_print_private_bfd_data): Print OSABI v4 flag.
2281 (arc_extract_features): New file.
2282 (arc_stralloc): Likewise.
2283 (arc_elf_merge_attributes): Likewise.
2284 (arc_elf_merge_private_bfd_data): Use object attributes.
2285 (bfd_arc_get_mach_from_attributes): New function.
2286 (arc_elf_object_p): Use object attributes.
2287 (arc_elf_final_write_processing): Likewise.
2288 (elf32_arc_obj_attrs_arg_type): New function.
2289 (elf32_arc_obj_attrs_handle_unknown): Likewise.
2290 (elf32_arc_section_from_shdr): Likewise.
2291 (elf_backend_obj_attrs_vendor): Define.
2292 (elf_backend_obj_attrs_section): Likewise.
2293 (elf_backend_obj_attrs_arg_type): Likewise.
2294 (elf_backend_obj_attrs_section_type): Likewise.
2295 (elf_backend_obj_attrs_handle_unknown): Likewise.
2296 (elf_backend_section_from_shdr): Likewise.
2297
e645cf40
AG
22982017-05-09 Andrew Goedhart <Andrewgoedhart@simplepowersolutions.co.za>
2299
2300 PR ld/21458
2301 * elf32-arm.c (elf32_arm_final_link_relocate): Set the bottom bit
2302 of the value when resolving a R_ARM_THM_ALU_PREL_11_0 relocation
2303 and the destination is a Thumb symbol.
2304
dd9e66ee
L
23052017-05-08 H.J. Lu <hongjiu.lu@intel.com>
2306
2307 * elf32-i386.c (elf_i386_get_synthetic_symtab): Add missing
2308 initializer to silence GCC 4.2.
2309 * lf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
2310
38b12349
L
23112017-05-08 H.J. Lu <hongjiu.lu@intel.com>
2312
2313 * elf64-x86-64.c (PLT_ENTRY_SIZE): Renamed to ...
2314 (LAZY_PLT_ENTRY_SIZE): This.
2315 (NON_LAZY_PLT_ENTRY_SIZE): New.
2316 (elf_x86_64_plt0_entry): Renamed to ...
2317 (elf_x86_64_lazy_plt0_entry): This.
2318 (elf_x86_64_plt_entry): Renamed to ...
2319 (elf_x86_64_lazy_plt_entry): This.
2320 (elf_x86_64_bnd_plt0_entry): Renamed to ...
2321 (elf_x86_64_lazy_bnd_plt0_entry): This.
2322 (elf_x86_64_legacy_plt_entry): Removed.
2323 (elf_x86_64_bnd_plt_entry): Renamed to ...
2324 (elf_x86_64_lazy_bnd_plt_entry): This.
2325 (elf_x86_64_legacy_plt2_entry): Renamed to ...
2326 (elf_x86_64_non_lazy_plt_entry): This.
2327 (elf_x86_64_bnd_plt2_entry): Renamed to ...
2328 (elf_x86_64_non_lazy_bnd_plt_entry): This.
2329 (elf_x86_64_eh_frame_plt): Renamed to ...
2330 (elf_x86_64_eh_frame_lazy_plt): This.
2331 (elf_x86_64_eh_frame_bnd_plt): Renamed to ...
2332 (elf_x86_64_eh_frame_lazy_bnd_plt): This.
2333 (elf_x86_64_eh_frame_plt_got): Renamed to ...
2334 (elf_x86_64_eh_frame_non_lazy_plt): This.
2335 (elf_x86_64_lazy_plt_layout): New.
2336 (elf_x86_64_non_lazy_plt_layout): Likewise.
2337 (elf_x86_64_plt_layout): Likewise.
2338 (elf_x86_64_backend_data): Remove PLT layout information. Add
2339 os for target system.
2340 (GET_PLT_ENTRY_SIZE): Removed.
2341 (elf_x86_64_lazy_plt): New.
2342 (elf_x86_64_non_lazy_plt): Likewise.
2343 (elf_x86_64_lazy_bnd_plt): Likewise.
2344 (elf_x86_64_non_lazy_bnd_plt): Likewise.
2345 (elf_x86-64_arch_bed): Updated.
2346 (elf_x86_64_link_hash_table): Add plt, lazy_plt and non_lazy_plt.
2347 (elf_x86_64_create_dynamic_sections): Removed.
2348 (elf_x86_64_check_relocs): Don't check elf.dynobj. Don't call
2349 _bfd_elf_create_ifunc_sections nor _bfd_elf_create_got_section.
2350 (elf_x86-64_adjust_dynamic_symbol): Updated.
2351 (elf_x86_64_allocate_dynrelocs): Updated. Pass 0 as PLT header
2352 size to _bfd_elf_allocate_ifunc_dyn_relocs and don't allocate
2353 size for PLT0 if there is no PLT0. Get plt_entry_size from
2354 non_lazy_plt for non-lazy PLT entries.
2355 (elf_x86_64_size_dynamic_sections): Updated. Get plt_entry_size
2356 from non_lazy_plt for non-lazy PLT entries.
2357 (elf_x86-64_relocate_section): Updated. Properly get PLT index
2358 if there is no PLT0.
2359 (elf_x86_64_finish_dynamic_symbol): Updated. Fill the first slot
2360 in the PLT entry with generic PLT layout. Fill the non-lazy PLT
2361 entries with non-lazy PLT layout. Don't fill the second and third
2362 slots in the PLT entry if there is no PLT0.
2363 (elf_x86_64_finish_dynamic_sections): Updated. Don't fill PLT0
2364 if there is no PLT0. Set sh_entsize on the .plt.got section.
2365 (compare_relocs): New.
2366 (elf_x86_64_plt_type): Likewise.
2367 (elf_x86_64_plt): Likewise.
2368 (elf_x86_64_nacl_plt): New. Forward declaration.
2369 (elf_x86_64_get_plt_sym_val): Removed.
2370 (elf_x86_64_get_synthetic_symtab): Rewrite to check PLT sections
2371 against all dynamic relocations.
2372 (elf_x86_64_link_setup_gnu_properties): New function.
2373 (elf_backend_create_dynamic_sections): Updated.
2374 (elf_backend_setup_gnu_properties): New.
2375 (elf_x86_64_nacl_plt): New.
2376 (elf_x86_64_nacl_arch_bed): Updated.
2377
f604c2a2
L
23782017-05-08 H.J. Lu <hongjiu.lu@intel.com>
2379
2380 * elf32-i386.c (PLT_ENTRY_SIZE): Renamed to ...
2381 (LAZY_PLT_ENTRY_SIZE): This.
2382 (NON_LAZY_PLT_ENTRY_SIZE): New.
2383 (elf_i386_plt0_entry): Renamed to ...
2384 (elf_i386_lazy_plt0_entry): This.
2385 (elf_i386_plt_entry): Renamed to ...
2386 (elf_i386_lazy_plt_entry): This.
2387 (elf_i386_pic_plt0_entry): Renamed to ...
2388 (elf_i386_pic_lazy_plt0_entry): This.
2389 (elf_i386_pic_plt_entry): Renamed to ...
2390 (elf_i386_pic_lazy_plt_entry): This.
2391 (elf_i386_got_plt_entry): Renamed to ...
2392 (elf_i386_non_lazy_plt_entry): This.
2393 (elf_i386_pic_got_plt_entry): Renamed to ...
2394 (elf_i386_pic_non_lazy_plt_entry): This.
2395 (elf_i386_eh_frame_plt): Renamed to ...
2396 (elf_i386_eh_frame_lazy_plt): This.
2397 (elf_i386_eh_frame_plt_got): Renamed to ...
2398 (elf_i386_eh_frame_non_lazy_plt): This.
2399 (elf_i386_plt_layout): Renamed to ...
2400 (elf_i386_lazy_plt_layout): This. Remove eh_frame_plt_got and
2401 eh_frame_plt_got_size.
2402 (elf_i386_non_lazy_plt_layout): New.
2403 (elf_i386_plt_layout): Likewise.
2404 (elf_i386_non_lazy_plt): Likewise.
2405 (GET_PLT_ENTRY_SIZE): Removed.
2406 (elf_i386_plt): Renamed to ...
2407 (elf_i386_lazy_plt): This.
2408 (elf_i386_backend_data): Remove plt. Rename is_vxworks to os.
2409 (elf_i386_arch_bed): Updated.
2410 (elf_i386_link_hash_table): Add plt, lazy_plt and non_lazy_plt.
2411 (elf_i386_create_dynamic_sections): Removed.
2412 (elf_i386_check_relocs): Don't check elf.dynobj. Don't call
2413 _bfd_elf_create_ifunc_sections nor _bfd_elf_create_got_section.
2414 (elf_i386_adjust_dynamic_symbol): Updated.
2415 (elf_i386_allocate_dynrelocs): Updated. Pass 0 as PLT header
2416 size to _bfd_elf_allocate_ifunc_dyn_relocs and don't allocate
2417 size for PLT0 if there is no PLT0.
2418 (elf_i386_size_dynamic_sections): Updated. Check whether GOT
2419 output section is discarded only if GOT isn't empty.
2420 (elf_i386_relocate_section): Updated. Properly get PLT index
2421 if there is no PLT0.
2422 (elf_i386_finish_dynamic_symbol): Updated. Don't fill the
2423 second and third slots in the PLT entry if there is no PLT0.
2424 (elf_i386_finish_dynamic_sections): Updated. Don't fill PLT0
2425 if there is no PLT0. Set sh_entsize on the .plt.got section.
2426 (elf_i386_nacl_plt): Forward declaration.
2427 (elf_i386_get_plt_sym_val): Removed.
2428 (elf_i386_get_synthetic_symtab): Rewrite to check PLT sections
2429 against all dynamic relocations.
2430 (elf_i386_link_setup_gnu_properties): New function.
2431 (elf_backend_create_dynamic_sections): Updated.
2432 (elf_backend_setup_gnu_properties): New.
2433 (elf_i386_nacl_plt): Updated.
2434 (elf_i386_nacl_arch_bed): Likewise.
2435 (elf_i386_vxworks_arch_bed): Likewise.
2436
046734ff
TP
24372017-05-08 Thomas Preud'homme <thomas.preudhomme@arm.com>
2438
2439 * elflink.c (elf_output_implib): Remove executable flag from import
2440 library bfd.
2441 * elf32-arm.c (elf32_arm_filter_implib_symbols): Assert that the import
2442 library is a relocatable object file.
2443
b660e9eb
SKS
24442017-05-01 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
2445
2446 PR ld/21404
2447 * elf32-avr.c (avr_should_move_sym): New function.
2448 (avr_should_reduce_sym_size): Likewise.
2449 (avr_should_increase_sym_size): Likewise.
2450 (elf32_avr_relax_delete_bytes): Adjust symbol values
2451 and sizes by calling new functions.
2452
763a5fa4
PD
24532017-05-01 Palmer Dabbelt <palmer@dabbelt.com>
2454
2455 * config.bfd (riscv32-*): Enable rv64.
2456
73ec947d
AM
24572017-05-02 Alan Modra <amodra@gmail.com>
2458
2459 PR 21384
2460 * elflink.c (bfd_elf_link_mark_dynamic_symbol): Test h->non_elf
2461 rather than h->root.type == bfd_link_hash_new.
2462 (bfd_elf_record_link_assignment): Similarly, call
2463 bfd_elf_link_mark_dynamic_symbol when h->non_elf.
2464
a941291c
AM
24652017-04-29 Alan Modra <amodra@gmail.com>
2466
2467 PR 21432
2468 * reloc.c (reloc_offset_in_range): New function.
2469 (bfd_perform_relocation, bfd_install_relocation): Use it.
2470 (_bfd_final_link_relocate): Likewise.
2471
750eaa47
L
24722017-04-28 H.J. Lu <hongjiu.lu@intel.com>
2473
2474 * elf32-i386.c (elf_i386_allocate_dynrelocs): Check plt_got
2475 before using .plt.got.
2476 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise.
2477
5b66fac4
L
24782017-04-27 H.J. Lu <hongjiu.lu@intel.com>
2479
2480 * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Use "="
2481 instead of "+=" to update 0.
2482
de9a3c42
L
24832017-04-27 H.J. Lu <hongjiu.lu@intel.com>
2484
2485 * elf32-i386.c (elf_i386_create_dynamic_sections): Create the
2486 .plt.got section here.
2487 (elf_i386_check_relocs): Don't create the .plt.got section.
2488 * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Create
2489 the .plt.got and .plt.bnd sections here.
2490 (elf_x86_64_check_relocs): Don't create the .plt.got nor
2491 .plt.bnd sections.
2492
da3d25af
L
24932017-04-27 H.J. Lu <hongjiu.lu@intel.com>
2494
2495 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Remove
2496 has_bnd_reloc.
2497 (elf_x86_64_link_hash_newfunc): Don't clear has_bnd_reloc.
2498 (elf_x86_64_copy_indirect_symbol): Don't copy has_bnd_reloc.
2499 (elf_x86_64_check_relocs): Don't set has_bnd_reloc.
2500 (elf_x86_64_finish_dynamic_symbol): Check bndplt instead of
2501 has_bnd_reloc.
2502
fba37edd
L
25032017-04-27 H.J. Lu <hongjiu.lu@intel.com>
2504
2505 * elf-bfd.h (elf_backend_data): Change setup_gnu_properties
2506 to return bfd *.
2507 (_bfd_elf_link_setup_gnu_properties): Return bfd *.
2508 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Return
2509 the first relocatable ELF input with GNU properties.
2510
1f78f649
L
25112017-04-27 H.J. Lu <hongjiu.lu@intel.com>
2512
2513 * elf32-i386.c (elf_i386_finish_dynamic_sections): Simplify
2514 VxWorks for non-PIC.
2515
76c20d54
AM
25162017-04-27 Alan Modra <amodra@gmail.com>
2517
2518 * elf-bfd.h (struct elf_backend_data): Make asection param of
2519 elf_backend_eh_frame_address_size const.
2520 (_bfd_elf_eh_frame_address_size): Likewise.
2521 * elf32-m32c.c (_bfd_m32c_elf_eh_frame_address_size): Likewise.
2522 * elf32-msp430.c (elf32_msp430_eh_frame_address_size): Likewise.
2523 * elfxx-mips.c (_bfd_mips_elf_eh_frame_address_size): Likewise.
2524 * elfxx-mips.h (_bfd_mips_elf_eh_frame_address_size): Likewise.
2525 * elf-eh-frame.c (_bfd_elf_eh_frame_address_size): Likewise.
2526 (next_cie_fde_offset): Constify params.
2527 (offset_adjust, adjust_eh_frame_local_symbols): Likewise.
2528
d7153c4a
AM
25292017-04-27 Alan Modra <amodra@gmail.com>
2530
2531 * elf-bfd.h (struct eh_cie_fde): Add aug_str_len and aug_data_len.
2532 (_bfd_elf_adjust_eh_frame_global_symbol): Declare.
2533 * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Set aug_str_len and
2534 aug_data_len.
2535 (offset_adjust): New function.
2536 (_bfd_elf_adjust_eh_frame_global_symbol): Likewise.
2537 (adjust_eh_frame_local_symbols): Likewise.
2538 (_bfd_elf_discard_section_eh_frame): Call adjust_eh_frame_local_symbols
2539 after changing anything. Return true if anything changed.
2540 * elflink.c (bfd_elf_discard_info): If .eh_frame changed, call
2541 _bfd_elf_adjust_eh_frame_global_symbol for globals.
2542
641338d8
AM
25432017-04-27 Alan Modra <amodra@gmail.com>
2544
2545 * elflink.c (_bfd_elf_link_hash_hide_symbol): Clear dynstr_index
2546 when force_local.
2547
21d68fcd
AM
25482017-04-27 Alan Modra <amodra@gmail.com>
2549
2550 * elf32-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
2551 (ppc_elf_select_plt_layout, ppc_elf_tls_setup): Use it.
2552 (ppc_elf_adjust_dynamic_symbol, allocate_dynrelocs): Likewise.
2553 (ppc_elf_relocate_section): Likewise. Delete silly optimisation
2554 for undef and undefweak dyn_relocs.
2555 * elf64-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
2556 (ppc64_elf_adjust_dynamic_symbol, ppc64_elf_tls_setup): Use it.
2557 (allocate_got, allocate_dynrelocs): Likewise.
2558 (ppc64_elf_relocate_section): Likewise.
2559
97d343d4
L
25602017-04-26 H.J. Lu <hongjiu.lu@intel.com>
2561
2562 * elf32-i386.c (elf_i386_size_dynamic_sections): Alwasys add
2563 DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rel.plt section.
2564 * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Alwasys
2565 add DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rela.plt section.
2566
04b31182
NC
25672017-04-26 Nick Clifton <nickc@redhat.com>
2568
2569 PR binutils/21434
2570 * reloc.c (bfd_perform_relocation): Check for a negative address
2571 in the reloc.
2572
23ec1e32
MR
25732017-04-26 Maciej W. Rozycki <macro@imgtec.com>
2574
2575 PR ld/21334
2576 * elf-bfd.h (elf_backend_data): Add `always_renumber_dynsyms'
2577 member.
2578 * elfxx-target.h [!elf_backend_always_renumber_dynsyms]
2579 (elf_backend_always_renumber_dynsyms): Define.
2580 (elfNN_bed): Initialize `always_renumber_dynsyms' member.
2581 * elfxx-mips.h (elf_backend_always_renumber_dynsyms): Define.
2582 * elflink.c (bfd_elf_size_dynamic_sections): Also call
2583 `_bfd_elf_link_renumber_dynsyms' if the backend has requested
2584 it.
2585 (bfd_elf_size_dynsym_hash_dynstr): Likewise.
2586
c46cec3a
MR
25872017-04-26 Maciej W. Rozycki <macro@imgtec.com>
2588
2589 * elflink.c (bfd_elf_size_dynamic_sections): Only call
2590 `_bfd_elf_link_renumber_dynsyms' after section GC if dynamic
2591 sections have been created.
2592
e63d1232
NC
25932017-04-26 Nick Clifton <nickc@redhat.com>
2594
2595 PR binutils/21431
2596 * compress.c (bfd_init_section_compress_status): Check the return
2597 value from bfd_malloc.
2598
9e9821dd
L
25992017-04-24 H.J. Lu <hongjiu.lu@intel.com>
2600
2601 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Add
2602 no_finish_dynamic_symbol.
2603 (elf_x86_64_link_hash_newfunc): Set no_finish_dynamic_symbol to
2604 0.
2605 (elf_x86_64_allocate_dynrelocs): If a symbol isn't undefined
2606 weak symbol, don't make it dynamic.
2607 (elf_x86_64_relocate_section): If a symbol isn't dynamic in PIC,
2608 set no_finish_dynamic_symbol and generate R_X86_64_RELATIVE
2609 relocation for GOT reference.
2610 (elf_x86_64_finish_dynamic_symbol): Abort if
2611 no_finish_dynamic_symbol isn't 0.
2612
0dc9a308
L
26132017-04-24 H.J. Lu <hongjiu.lu@intel.com>
2614
2615 PR ld/21402
2616 * elf32-i386.c (elf_i386_allocate_dynrelocs): If a symbol isn't
2617 undefined weak symbol, don't make it dynamic.
2618 (elf_i386_relocate_section): If a symbol isn't dynamic in PIC,
2619 set no_finish_dynamic_symbol and generate R_386_RELATIVE
2620 relocation for R_386_GOT32.
2621
1587442d
L
26222017-04-24 H.J. Lu <hongjiu.lu@intel.com>
2623
2624 PR ld/21425
2625 * elf32-i386.c (ELF_MAXPAGESIZE): Set to 0x1000 for VxWorks.
2626
7eacd66b
AM
26272017-04-23 Alan Modra <amodra@gmail.com>
2628
2629 PR 21414
2630 * section.c (GLOBAL_SYM_INIT): Make available in bfd.h.
2631 * elf.c (lcomm_sym): New.
2632 (_bfd_elf_large_com_section): Use lcomm_sym section symbol.
2633 * bfd-in2.h: Regenerate.
2634
bce964aa
AM
26352017-04-23 Alan Modra <amodra@gmail.com>
2636
2637 PR 21412
2638 * elf-bfd.h (struct elf_backend_data <get_reloc_section>): Change
2639 parameters and comment.
2640 (_bfd_elf_get_reloc_section): Delete.
2641 (_bfd_elf_plt_get_reloc_section): Declare.
2642 * elf.c (_bfd_elf_plt_get_reloc_section, elf_get_reloc_section):
2643 New functions. Don't blindly skip over assumed .rel/.rela prefix.
2644 Extracted from..
2645 (_bfd_elf_get_reloc_section): ..here. Delete.
2646 (assign_section_numbers): Call elf_get_reloc_section.
2647 * elf64-ppc.c (elf_backend_get_reloc_section): Define.
2648 * elfxx-target.h (elf_backend_get_reloc_section): Update.
2649
97e83a10
AM
26502017-04-23 Alan Modra <amodra@gmail.com>
2651
2652 PR 21409
2653 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Don't segfault when
2654 no symbols.
2655
e133d005
L
26562017-04-21 H.J. Lu <hongjiu.lu@intel.com>
2657
2658 PR ld/21402
2659 * elf32-i386.c (elf_i386_link_hash_entry): Add
2660 no_finish_dynamic_symbol.
2661 (elf_i386_link_hash_newfunc): Set no_finish_dynamic_symbol to 0.
2662 (elf_i386_allocate_dynrelocs): If a symbol isn't undefined weak
2663 symbol, don't make it dynamic in PIE.
2664 (elf_i386_relocate_section): If a symbol isn't dynamic in PIE,
2665 set no_finish_dynamic_symbol and generate R_386_RELATIVE
2666 relocation for R_386_GOT32
2667 (elf_i386_finish_dynamic_symbol): Abort if no_finish_dynamic_symbol
2668 isn't 0.
2669
3c5fce9b
L
26702017-04-21 H.J. Lu <hongjiu.lu@intel.com>
2671
2672 PR ld/19617
2673 PR ld/21086
2674 * elflink.c (elf_link_add_object_symbols): Require
2675 --no-dynamic-linker with -E/--dynamic-list when creating
2676 dynamic sections.
2677
0fad2956
MR
26782017-04-20 Maciej W. Rozycki <macro@imgtec.com>
2679
2680 * elflink.c (_bfd_elf_symbol_refs_local_p): Always return TRUE
2681 if forced local.
2682
64575f78
MR
26832017-04-20 Maciej W. Rozycki <macro@imgtec.com>
2684
2685 * elfxx-mips.c (_bfd_mips_elf_final_link): Reorder comment about
2686 dynamic symbol sorting.
2687
59fa66c5
L
26882017-04-20 H.J. Lu <hongjiu.lu@intel.com>
2689
2690 PR ld/21382
2691 * elflink.c (elf_link_add_object_symbols): Preserve
2692 dynamic_ref_after_ir_def when restoring the symbol table for
2693 unneeded dynamic object.
2694
e492d2f8
L
26952017-04-19 H.J. Lu <hongjiu.lu@intel.com>
2696
2697 PR ld/21401
2698 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Don't abort
2699 on on undefined IFUNC symbol in the second PLT.
2700
10169134
WAF
27012017-04-19 Wedson Almeida Filho <wedsonaf@gmail.com>
2702
2703 * peXXigen.c (pe_print_reloc): Correct chunk_end.
2704
954b63d4
AM
27052017-04-19 Alan Modra <amodra@gmail.com>
2706
2707 * elflink.c (_bfd_elf_adjust_dynamic_symbol): Hide undefweak
2708 or make dynamic for info->dynamic_undefined_weak 0 and 1.
2709 * elf32-ppc.c:Formatting.
2710 (ensure_undefweak_dynamic): Don't make dynamic when
2711 info->dynamic_undefined_weak is zero.
2712 (allocate_dynrelocs): Discard undefweak dyn_relocs for
2713 info->dynamic_undefined_weak. Discard undef dyn_relocs when
2714 not default visibility. Discard undef and undefweak
2715 dyn_relocs earlier.
2716 (ppc_elf_relocate_section): Adjust to suit.
2717 * elf64-ppc.c: Formatting.
2718 (ensure_undefweak_dynamic): Don't make dynamic when
2719 info->dynamic_undefined_weak is zero.
2720 (allocate_dynrelocs): Discard undefweak dyn_relocs for
2721 info->dynamic_undefined_weak. Discard them earlier.
2722
e6699019
L
27232017-04-17 H.J. Lu <hongjiu.lu@intel.com>
2724
2725 PR ld/21389
2726 * elflink.c (bfd_elf_size_dynamic_sections): Get soname index
2727 before generating the version definition section.
2728
c5d37467
AM
27292017-04-17 Alan Modra <amodra@gmail.com>
2730
2731 * elflink.c (_bfd_elf_merge_symbol): Undo dynamic linking
2732 state when a regular object file defines a symbol with
2733 incompatible type to that defined by an earlier shared lib.
2734
63a5468a
AM
27352017-04-13 Alan Modra <amodra@gmail.com>
2736
2737 * coffcode.h: Wrap some overly long _bfd_error_handler args.
2738 * elf.c: Likewise.
2739 * elf32-arm.c: Likewise.
2740 * elf32-i386.c: Likewise.
2741 * elf32-mep.c: Likewise.
2742 * elf64-ia64-vms.c: Likewise.
2743 * elf64-x86-64.c: Likewise.
2744 * elflink.c: Likewise.
2745 * elfnn-ia64.c: Likewise.
2746 * elfxx-mips.c: Likewise.
2747
dae82561
AM
27482017-04-13 Alan Modra <amodra@gmail.com>
2749
2750 * aoutx.h: Use %B and %A in error messages throughout file.
2751 * aout-cris.c: Likewise.
2752 * archive.c: Likewise.
2753 * binary.c: Likewise.
2754 * coff-rs6000.c: Likewise.
2755 * coff-tic4x.c: Likewise.
2756 * coffcode.h: Likewise.
2757 * coffgen.c: Likewise.
2758 * cofflink.c: Likewise.
2759 * coffswap.h: Likewise.
2760 * cpu-arm.c: Likewise.
2761 * elf-eh-frame.c: Likewise.
2762 * elf-m10300.c: Likewise.
2763 * elf.c: Likewise.
2764 * elf32-arc.c: Likewise.
2765 * elf32-arm.c: Likewise.
2766 * elf32-bfin.c: Likewise.
2767 * elf32-frv.c: Likewise.
2768 * elf32-iq2000.c: Likewise.
2769 * elf32-m32c.c: Likewise.
2770 * elf32-microblaze.c: Likewise.
2771 * elf32-nds32.c: Likewise.
2772 * elf32-rl78.c: Likewise.
2773 * elf32-rx.c: Likewise.
2774 * elf32-score.c: Likewise.
2775 * elf32-score7.c: Likewise.
2776 * elf32-sh64.c: Likewise.
2777 * elf32-v850.c: Likewise.
2778 * elf32-vax.c: Likewise.
2779 * elf32-visium.c: Likewise.
2780 * elf64-ia64-vms.c: Likewise.
2781 * elf64-mmix.c: Likewise.
2782 * elf64-sh64.c: Likewise.
2783 * elfcode.h: Likewise.
2784 * elfnn-aarch64.c: Likewise.
2785 * elfnn-ia64.c: Likewise.
2786 * elfxx-mips.c: Likewise.
2787 * hpux-core.c: Likewise.
2788 * ieee.c: Likewise.
2789 * ihex.c: Likewise.
2790 * linker.c: Likewise.
2791 * merge.c: Likewise.
2792 * mmo.c: Likewise.
2793 * oasys.c: Likewise.
2794 * pdp11.c: Likewise.
2795 * peXXigen.c: Likewise.
2796 * rs6000-core.c: Likewise.
2797 * vms-alpha.c: Likewise.
2798 * xcofflink.c: Likewise.
2799
c08bb8dd
AM
28002017-04-13 Alan Modra <amodra@gmail.com>
2801
2802 * bfd.c (PRINT_TYPE): Define.
2803 (_doprnt): New function.
2804 (error_handler_internal): Use _doprnt.
2805 * coff-arm.c: Put %A and %B arguments to _bfd_error_handler
2806 calls in their natural order, throughout file.
2807 * coff-mcore.c: Likewise.
2808 * coff-ppc.c: Likewise.
2809 * coff-tic80.c: Likewise.
2810 * cofflink.c: Likewise.
2811 * elf-s390-common.c: Likewise.
2812 * elf.c: Likewise.
2813 * elf32-arm.c: Likewise.
2814 * elf32-i386.c: Likewise.
2815 * elf32-m32r.c: Likewise.
2816 * elf32-msp430.c: Likewise.
2817 * elf32-spu.c: Likewise.
2818 * elf64-ia64-vms.c: Likewise.
2819 * elf64-sparc.c: Likewise.
2820 * elf64-x86-64.c: Likewise.
2821 * elflink.c: Likewise.
2822 * elfnn-aarch64.c: Likewise.
2823 * elfnn-ia64.c: Likewise.
2824 * elfxx-mips.c: Likewise.
2825
10463f39
AM
28262017-04-13 Alan Modra <amodra@gmail.com>
2827
2828 * elf32-arm.c (arm_type_of_stub): Supply missing args to "long
2829 branch veneers" error. Fix double space and format message.
2830 * elf32-avr.c (avr_add_stub): Do not pass NULL as %B arg.
2831 * elf64-ppc.c (tocsave_find): Supply missing %B arg.
2832
4af8774e
AM
28332017-04-13 Alan Modra <amodra@gmail.com>
2834
2835 * bfd-in2.h: Regenerate.
2836
e4097f5e
L
28372017-04-11 H.J. Lu <hongjiu.lu@intel.com>
2838
2839 * elf-properties.c (_bfd_elf_parse_gnu_properties): Remove the
2840 extra `\n' in warning/error messages.
2841 * elf32-i386.c (elf_i386_parse_gnu_properties): Likewise.
2842 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
2843
537616aa
L
28442017-04-11 H.J. Lu <hongjiu.lu@intel.com>
2845
2846 * elf-properties.c (_bfd_elf_parse_gnu_properties): Ignore
2847 processor-specific properties with generic ELF target vector.
2848
bb1dd176
QZ
28492017-04-10 Qing Zhao <qing.zhao@oracle.com>
2850
2851 * elf32-sparc.c (elf_backend_fixup_symbol): New.
2852 * elf64-sparc.c (elf_backend_fixup_symbol): New.
2853 * elfxx-sparc.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): New.
2854 (_bfd_sparc_elf_link_hash_entry): Add has_got_reloc and
2855 has_non_got_reloc.
2856 (link_hash_newfunc): Initialize has_got_reloc and
2857 has_non_got_reloc.
2858 (_bfd_sparc_elf_size_dynamic_sections): Set interp to .interp
2859 section.
2860 (_bfd_sparc_elf_copy_indirect_symbol): Copy has_got_reloc and
2861 has_non_got_reloc.
2862 (_bfd_sparc_elf_check_relocs): Set has_got_reloc and
2863 has_non_got_reloc.
2864 (_bfd_sparc_elf_fixup_symbol): New function.
2865 (allocate_dynrelocs): Don't allocate space for dynamic
2866 relocations and discard relocations against resolved undefined
2867 weak symbols in executable. Don't make resolved undefined weak
2868 symbols in executable dynamic. Keep dynamic non-GOT/non-PLT
2869 relocation against undefined weak symbols in PIE.
2870 (_bfd_sparc_elf_relocate_section): Don't generate dynamic
2871 relocations against resolved undefined weak symbols in PIE
2872 (_bfd_sparc_elf_finish_dynamic_symbol): Keep PLT/GOT entries
2873 without ynamic PLT/GOT relocations for resolved undefined weak
2874 symbols.
2875 Don't generate dynamic relocation against resolved undefined
2876 weak symbol in executable.
2877 (pie_finish_undefweak_symbol): New function.
2878 (_bfd_sparc_elf_finish_dynamic_sections): Call
2879 pie_finish_undefweak_symbol on all symbols in PIE.
2880 * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Add interp.
2881 (_bfd_sparc_elf_fixup_symbol): New function.
2882
d236cfd4
NC
28832017-04-10 Nick Clifton <nickc@redhat.com>
2884
2885 * config.bfd: Remove ns32k from obsolete list.
2886
6f9dbcd4
AM
28872017-04-10 Alan Modra <amodra@gmail.com>
2888
2889 PR 21287
2890 * elf.c (special_sections_f): Match .fini_array and .fini_array.*.
2891 (special_sections_i): Likewise for .init_array.
2892 (special_sections_p): Likewise for .preinit_array.
2893
8170f769
L
28942017-04-07 H.J. Lu <hongjiu.lu@intel.com>
2895
2896 PR ld/19579
2897 PR ld/21306
2898 * elf32-s390.c (elf_s390_finish_dynamic_symbol): Check
2899 ELF_COMMON_DEF_P for common symbols.
2900 * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
2901 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
2902 * elflink.c (_bfd_elf_merge_symbol): Revert commits
2903 202ac193bbbecc96a4978d1ac3d17148253f9b01 and
2904 07492f668d2173da7a2bda3707ff0985e0f460b6.
2905
49f4617b
PA
29062017-04-07 Pedro Alves <palves@redhat.com>
2907
2908 * opncls.c (bfd_get_debug_link_info): Rename to...
2909 (bfd_get_debug_link_info_1): ... this. Change type of second
2910 parameter to void pointer. Adjust.
2911 (bfd_get_debug_link_info): Reimplement on top of
2912 bfd_get_debug_link_info_1.
2913 (separate_debug_file_exists, separate_alt_debug_file_exists):
2914 Change type of second parameter to void pointer. Adjust.
2915 (get_func_type, check_func_type): Change type of second parameter
2916 to void pointer.
2917 (find_separate_debug_file): Add 'func_data' parameter. Pass it to
2918 the callback functions instead of passing the address of a local.
2919 (bfd_follow_gnu_debuglink): Pass address of unsigned long local to
2920 find_separate_debug_file.
2921 (get_alt_debug_link_info_shim): Change type of second parameter to
2922 void pointer. Adjust.
2923 (bfd_follow_gnu_debugaltlink): Adjust to pass NULL to
2924 find_separate_debug_file.
2925 (get_build_id_name, bfd_boolean check_build_id_file): Change type
2926 of second parameter to void pointer. Adjust.
2927 (bfd_follow_build_id_debuglink): Pass address of bfd_build_id
2928 pointer local to find_separate_debug_file.
2929
29302017-04-07 Tristan Gingold <gingold@gingold-Precision-7510>
1fd6d111
TG
2931
2932 * coffgen.c (_bfd_coff_gc_mark_hook): Handle PE weak
2933 external symbols with a definition.
2934 (_bfd_coff_gc_mark_extra_sections): Fix typo.
2935
86abf93a
AM
29362017-04-07 Alan Modra <amodra@gmail.com>
2937
2938 * po/SRC-POTFILES.in: Regenerate.
2939
8dea77f0
AM
29402017-04-05 Alan Modra <amodra@gmail.com>
2941
2942 * elf64-ppc.c (ppc64_elf_gc_sweep_hook): Support ELFv2 PLT
2943 reference counting.
2944
477bdd39
JT
29452017-04-02 Jon Turney <jon.turney@dronecode.org.uk>
2946
2947 (_bfd_XXi_swap_aouthdr_out): For clarity, use defines rather than
2948 numbers for DataDirectory entry indicies passed to
2949 add_data_entry().
2950
a91e1603
L
29512017-04-04 H.J. Lu <hongjiu.lu@intel.com>
2952
2953 * elf.c (get_program_header_size): Add a GNU_MBIND segment for
2954 each GNU_MBIND section and align GNU_MBIND section to page size.
2955 (_bfd_elf_map_sections_to_segments): Create a GNU_MBIND
2956 segment for each GNU_MBIND section.
2957 (_bfd_elf_init_private_section_data): Copy sh_info from input
2958 for GNU_MBIND section.
2959
b5292032
PD
29602017-04-03 Palmer Dabbelt <palmer@dabbelt.com>
2961
2962 * elfnn-riscv.c (GP_NAME): Delete.
2963 (riscv_global_pointer_value): Change GP_NAME to RISCV_GP_SYMBOL.
2964 (_bfd_riscv_relax_lui): Likewise.
2965
ad32986f
NC
29662017-04-04 Nick Clifton <nickc@redhat.com>
2967
2968 PR binutils/21342
2969 * elflink.c (_bfd_elf_define_linkage_sym): Prevent null pointer
2970 dereference.
2971 (bfd_elf_final_link): Only initialize the extended symbol index
2972 section if there are extended symbol tables to list.
2973
46bed679
L
29742017-04-03 H.J. Lu <hongjiu.lu@intel.com>
2975
2976 * Makefile.am (BFD32_BACKENDS): Add elf-properties.lo.
2977 (BFD32_BACKENDS_CFILES): Add elf-properties.c.
2978 * configure.ac (elf): Add elf-properties.lo.
2979 * Makefile.in: Regenerated.
2980 * configure: Likewise.
2981 * elf-bfd.h (elf_property_kind): New.
2982 (elf_property): Likewise.
2983 (elf_property_list): Likewise.
2984 (elf_properties): Likewise.
2985 (_bfd_elf_parse_gnu_properties): Likewise.
2986 (_bfd_elf_get_property): Likewise.
2987 (_bfd_elf_link_setup_gnu_properties): Likewise.
2988 (elf_backend_data): Add parse_gnu_properties, merge_gnu_properties
2989 and setup_gnu_properties.
2990 (elf_obj_tdata): Add properties.
2991 * elf-properties.c: New file.
2992 * elf32-i386.c (elf_i386_parse_gnu_properties): New.
2993 (elf_i386_merge_gnu_properties): Likewise.
2994 (elf_backend_parse_gnu_properties): Likewise.
2995 (elf_backend_merge_gnu_properties): Likewise.
2996 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
2997 (elf_x86_64_merge_gnu_properties): Likewise.
2998 (elf_backend_parse_gnu_properties): Likewise.
2999 (elf_backend_merge_gnu_properties): Likewise.
3000 * elfxx-target.h (elf_backend_merge_gnu_properties): Likewise.
3001 (elf_backend_parse_gnu_properties): Likewise.
3002 (elf_backend_setup_gnu_properties): Likewise.
3003 (elfNN_bed): Add elf_backend_parse_gnu_properties,
3004 elf_backend_merge_gnu_properties and
3005 elf_backend_setup_gnu_properties.
3006
f96bd6c2
PC
30072017-03-30 Pip Cet <pipcet@gmail.com>
3008
3009 * elf32-wasm32.c: Add relocation code, two relocs.
3010 * reloc.c: Add wasm32 relocations.
3011 * libbfd.h: Regenerate.
3012 * bfd-in2.h: Regenerate.
3013 * bfd/po/bfd.pot: Regenerate.
3014
e643cb45
NC
30152017-03-29 Nick Clifton <nickc@redhat.com>
3016
3017 PR binutils/18025
3018 * coff-bfd.h (struct coff_section_data): Add new fields:
3019 saved_bias and bias.
3020 * coffgen.c (coff_find_nearest_line_with_names): Cache the bias
3021 computed for PE binaries.
3022 * dwarf2.c (scan_unit_for_symbols): Only warn once about each
3023 missing abbrev.
3024
086554e8
HPN
30252017-03-28 Hans-Peter Nilsson <hp@axis.com>
3026
3027 PR ld/16044
3028 * elf32-cris.c (elf_cris_adjust_gotplt_to_got): Adjust BFD_ASSERT
3029 to handle a local symbol with a hash-symbol-entry; without PLT.
3030 Add BFD_ASSERT for an incidental case with GOT entry present.
3031 (cris_elf_check_relocs): Increment PLT refcount only if the symbol
3032 isn't forced-or-set local.
3033
a6be0538
PC
30342017-03-27 Pip Cet <pipcet@gmail.com>
3035
3036 * wasm-module.c: New file to support WebAssembly modules.
3037 * wasm-module.h: New file to support WebAssembly modules.
3038 * doc/webassembly.texi: Start documenting wasm-module.c.
3039 * config.bfd: Add wasm_vec.
3040 * targets.c: Likewise.
3041 * configure.ac: Likewise.
3042 * Makefile.am: Add entries for wasm-module.c.
3043 * Makefile.in: Regenerate.
3044 * configure: Regenerate.
3045 * po/SRC-POTFILES.in: Regenerate.
3046
79b1d3cb
PC
30472017-03-27 Pip Cet <pipcet@gmail.com>
3048
3049 * cpu-wasm32.c: New file to support wasm32 architecture.
3050 * elf32-wasm32.c: New file to support wasm32 architecture.
3051 * Makefile.am: Add wasm32 architecture.
3052 * archures.c: Likewise.
3053 * config.bfd: Likewise.
3054 * configure.ac: Likewise.
3055 * targets.c: Likewise.
3056 * Makefile.in: Regenerate.
3057 * bfd-in2.h: Regenerate.
3058 * configure: Regenerate.
3059 * po/SRC-POTFILES.in: Regenerate.
3060
aaed6f5b
AM
30612017-03-20 Alan Modra <amodra@gmail.com>
3062
3063 PR 21266
3064 * elf64-ppc.c (compare_symbols): Stabilize sort.
3065
82e66161
AM
30662017-03-18 Alan Modra <amodra@gmail.com>
3067
3068 * elf64-ppc.c (struct ppc_link_hash_table): Add
3069 local_ifunc_resolver and maybe_local_ifunc_resolver.
3070 (ppc_build_one_stub): Set flags on emitting dynamic
3071 relocation to ifunc.
3072 (ppc64_elf_relocate_section): Likewise.
3073 (ppc64_elf_finish_dynamic_symbol): Likewise.
3074 (ppc64_elf_finish_dynamic_sections): Error on DT_TEXTREL with
3075 local dynamic relocs to ifuncs.
3076 * elf32-ppc.c (struct ppc_elf_link_hash_table): Add
3077 local_ifunc_resolver and maybe_local_ifunc_resolver.
3078 (ppc_elf_relocate_section): Set flag on emitting dynamic
3079 relocation to ifuncs.
3080 (ppc_elf_finish_dynamic_symbol): Likewise.
3081 (ppc_elf_finish_dynamic_sections): Error on DT_TEXTREL with local
3082 dynamic relocs to ifuncs.
3083
f955cccf
NC
30842017-03-13 Nick Clifton <nickc@redhat.com>
3085
3086 PR binutils/21202
3087 * reloc.c (BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC): Rename to
3088 BFD_RELOC_AARCH64_TLSDESC_LD64_LO12.
3089 (BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC): Rename to
3090 BFD_RELOC_AARCH64_TLSDESC_ADD_LO12.
3091 * bfd-in2.h: Regenerate.
3092 * libbfd.h: Regenerate.
3093 * elfnn-aarch64.c (IS_AARCH64_TLS_RELAX_RELOC): Update reloc
3094 names.
3095 (IS_AARCH64_TLSDESC_RELOC): Likewise.
3096 (elfNN_aarch64_howto_table): Likewise.
3097 (aarch64_tls_transition_without_check): Likewise.
3098 (aarch64_reloc_got_type): Likewise.
3099 (elfNN_aarch64_final_link_relocate): Likewise.
3100 (elfNN_aarch64_tls_relax): Likewise.
3101 (elfNN_aarch64_relocate_section): Likewise.
3102 (elfNN_aarch64_gc_sweep_hook): Likewise.
3103 (elfNN_aarch64_check_relocs): Likewise.
3104 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
3105 (_bfd_aarch64_elf_resolve_relocation): Likewise.
3106
4aef7643
AM
31072017-03-11 Alan Modra <amodra@gmail.com>
3108
3109 * elf32-ppc.c: Remove ATTRIBUTE_UNUSED throughout when function
3110 parameter is in fact used. Whitespace fixes.
3111 * elf64-ppc.c: Likewise.
3112
f03265d9
ST
31132017-03-09 Sam Thursfield <sam.thursfield@codethink.co.uk>
3114
3115 * rs6000-core.c (CORE_NEW): Simplify macro when
3116 AIX_CORE_DUMPX_CORE and BFD64 are true to avoid compile warning.
3117
b1b07054
AM
31182017-03-07 Alan Modra <amodra@gmail.com>
3119
3120 PR 21224
3121 PR 20519
3122 * elf64-ppc.c (ppc64_elf_relocate_section): Add missing
3123 dyn_relocs check.
3124
2e0ce1c8
AM
31252017-03-05 Alan Modra <amodra@gmail.com>
3126
3127 * elf-bfd.h (struct eh_cie_fde): Add u.cie.per_encoding_aligned8.
3128 * elf-eh-frame.c (size_of_output_cie_fde): Don't align here.
3129 (next_cie_fde_offset): New function.
3130 (_bfd_elf_parse_eh_frame): Set u.cie.per_encoding_aligned8.
3131 (_bfd_elf_discard_section_eh_frame): Align zero terminator to
3132 four bytes. Align CIEs to four or eight bytes depending on
3133 per_encoding_aligned8. Align FDEs according to their encoding.
3134 Pad last FDE to output section alignment.
3135 (_bfd_elf_write_section_eh_frame): Adjust to suit. Remove
3136 assertion.
3137 * elf64-ppc.c (glink_eh_frame_cie): Delete padding.
3138 (ppc64_elf_size_stubs): Pad glink eh_frame as per elf-eh-frame.c.
3139 (ppc64_elf_finish_dynamic_sections): Adjust to suit.
3140
f98450c6
NC
31412017-03-02 Martin Bickel <binutils@ineranves.de>
3142
3143 PR ld/21212
3144 * elf.c (rewrite_elf_program_header): Do not issue a warning for
d20928fa 3145 empty segments which have a zero filesz, but a non-zero memsz.
f98450c6 3146
673cff9b
AM
31472017-03-02 Alan Modra <amodra@gmail.com>
3148
3149 * elf32-ppc.c (ppc_elf_vle_split16): Correct insn mask typo.
3150
3de43e7b
AM
31512017-02-28 Alan Modra <amodra@gmail.com>
3152
3153 * elf64-ppc.c (ppc64_elf_ha_reloc): Revert last change.
3154 (ppc64_elf_relocate_section): Likewise.
3155
4ef97a1b
AM
31562017-02-28 Alan Modra <amodra@gmail.com>
3157
3158 PR 20995
3159 * elf32-nios2.c (nios2_elf32_relocate_section): Use htab
3160 rather than elf32_nios2_hash_table or elf_hash_table.
3161 (create_got_section): Likewise.
3162 (nios2_elf32_finish_dynamic_symbol): Likewise.
3163 (nios2_elf32_adjust_dynamic_symbol): Likewise.
3164 (nios2_elf32_size_dynamic_sections): Likewise.
3165 (nios2_elf32_check_relocs): Delete dynobj, sgot, and srelgot
3166 vars. Use htab equivalents directly instead. Don't create
3167 all dynamic sections on needing just the GOT. Use a goto
3168 rather than a fall-through with reloc test. Ensure
3169 htab->dynobj is set when making dynamic sreloc section.
3170 (nios2_elf32_finish_dynamic_sections): Delete dynobj, use htab
3171 equivalent directly instead. Don't segfault on looking for
3172 .dynamic when dynamic sections have not been created. Don't
3173 segfault on .got.plt being discarded.
3174 (nios2_elf32_size_dynamic_sections): Delete plt and got vars.
3175 Don't set "relocs" on .rela.plt. Do handle .sbss. Delete
3176 fixme and another not so relevant comment.
3177 (nios2_elf_add_symbol_hook): Delete dynobj var. If not
3178 already set, set hash table dynobj on creating .sbss.
3179
7ba71655
AM
31802017-02-28 Alan Modra <amodra@gmail.com>
3181
3182 * reloc.c (BFD_RELOC_PPC_16DX_HA): New.
3183 * elf64-ppc.c (ppc64_elf_howto_raw <R_PPC64_16DX_HA>): New howto.
3184 (ppc64_elf_reloc_type_lookup): Translate new bfd reloc.
3185 (ppc64_elf_ha_reloc): Correct overflow test on REL16DX_HA.
3186 (ppc64_elf_relocate_section): Likewise.
3187 * elf32-ppc.c (ppc_elf_howto_raw <R_PPC_16DX_HA>): New howto.
3188 (ppc_elf_reloc_type_lookup): Translate new bfd reloc.
3189 (ppc_elf_check_relocs): Handle R_PPC_16DX_HA to pacify gcc.
3190 * libbfd.h: Regenerate.
3191 * bfd-in2.h: Regenerate.
3192
afbf7e8e
AM
31932017-02-28 Alan Modra <amodra@gmail.com>
3194
3195 * elflink.c (_bfd_elf_create_dynamic_sections): Don't make
3196 dynamic .data.rel.ro read-only.
3197 * elf32-arm.c (elf32_arm_finish_dynamic_symbol): Compare section
3198 rather than section flags when deciding where copy reloc goes.
3199 * elf32-cris.c (elf_cris_finish_dynamic_symbol): Likewise.
3200 * elf32-hppa.c (elf32_hppa_finish_dynamic_symbol): Likewise.
3201 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Likewise.
3202 * elf32-metag.c (elf_metag_finish_dynamic_symbol): Likewise.
3203 * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Likewise.
3204 * elf32-nios2.c (nios2_elf32_finish_dynamic_symbol): Likewise.
3205 * elf32-or1k.c (or1k_elf_finish_dynamic_symbol): Likewise.
3206 * elf32-ppc.c (ppc_elf_finish_dynamic_symbol): Likewise.
3207 * elf32-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
3208 * elf32-tic6x.c (elf32_tic6x_finish_dynamic_symbol): Likewise.
3209 * elf32-tilepro.c (tilepro_elf_finish_dynamic_symbol): Likewise.
3210 * elf64-ppc.c (ppc64_elf_finish_dynamic_symbol): Likewise.
3211 * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
3212 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
3213 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Likewise.
3214 * elfnn-riscv.c (riscv_elf_finish_dynamic_symbol): Likewise.
3215 * elfxx-mips.c (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise.
3216 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Likewise.
3217 * elfxx-tilegx.c (tilegx_elf_finish_dynamic_symbol): Likewise.
3218
0e392101
MR
32192017-02-28 Maciej W. Rozycki <macro@imgtec.com>
3220
3221 * elfxx-mips.c (mips_elf_perform_relocation): Also handle the
3222 `jalr $0, $25' instruction encoding.
3223
bd757ca7
NC
32242017-02-27 Nick Clifton <nickc@redhat.com>
3225
3226 PR ld/21180
3227 * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Avoid
3228 generating a seg-fault when encountering a symbol that has been
3229 deleted by garbage collection.
3230
034fed0b
AM
32312017-02-25 Alan Modra <amodra@gmail.com>
3232
3233 * elf32-arc.c (struct dynamic_sections): Delete.
3234 (enum dyn_section_types): Delete.
3235 (dyn_section_names): Delete.
3236 (arc_create_dynamic_sections): Delete.
3237 (elf_arc_finish_dynamic_sections): Don't call the above. Don't
3238 segfault on discarded .rela.plt section.
3239 (elf_arc_size_dynamic_sections): Formatting. Don't call
3240 arc_create_dynamic_sections. Don't allocate memory for sections
3241 handled by the generic linker. Correct code finding relocs in
3242 read-only sections. Set SEC_EXCLUDE on zero size .got,
3243 .got.plt, and .dynbss sections. Do set .interp for pies.
3244
d0f744f9
AW
32452017-02-24 Andrew Waterman <andrew@sifive.com>
3246
3247 * elfnn-riscv.c (GP_NAME): New macro.
3248 (riscv_global_pointer_value): Use it.
3249 (_bfd_riscv_relax_lui): If symbol and global pointer are in same
3250 output section, consider only that section's alignment.
3251
5d58c733
MR
32522017-02-23 Maciej W. Rozycki <macro@imgtec.com>
3253
3254 * elfxx-mips.h (_bfd_mips_relax_section): Remove prototype.
3255 * elfxx-mips.c (_bfd_mips_relax_section): Remove function.
3256 * elf64-mips.c (bfd_elf64_bfd_relax_section): Remove macro.
3257 * elfn32-mips.c (bfd_elf32_bfd_relax_section): Likewise.
3258
c1556ecd
MR
32592017-02-23 Maciej W. Rozycki <macro@imgtec.com>
3260
3261 * elfxx-mips.c (mips_elf_calculate_relocation) <R_MIPS_JALR>
3262 <R_MICROMIPS_JALR>: Discard relocation if `cross_mode_jump_p'
3263 or misaligned.
3264
5499c7c7
AM
32652017-02-23 Alan Modra <amodra@gmail.com>
3266
3267 PR 20744
3268 * elf32-ppc.c (ppc_elf_howto_raw): Correct dst_mask on all VLE
3269 16D relocations.
3270 (ppc_elf_vle_split16): Correct field mask and shift for 16D relocs.
3271 (ppc_elf_relocate_section): Correct calculation for VLE SDAREL
3272 relocs.
3273
902e9fc7
MR
32742017-02-22 Maciej W. Rozycki <macro@imgtec.com>
3275
3276 PR ld/20828
3277 * elflink.c (bfd_elf_size_dynamic_sections): Move symbol version
3278 processing ahead of the call to `elf_gc_sweep_symbol'.
3279
758d96d8
NC
32802017-02-22 Nick Clifton <nickc@redhat.com>
3281
3282 PR binutils/21193
3283 * opncls.c (bfd_create_gnu_debuglink_section): Give the newly
3284 created section 4-byte alignment.
3285
6528b6eb
AM
32862017-02-22 Alan Modra <amodra@gmail.com>
3287
3288 * elf64-ppc.c (ppc64_elf_finish_dynamic_sections): Don't segfault
3289 on .got or .plt output section being discarded by script.
3290 * elf32-ppc.c (ppc_elf_finish_dynamic_sections): Likewise. Move
3291 vxworks splt temp.
3292
24f1a751
AM
32932017-02-21 Alan Modra <amodra@gmail.com>
3294
3295 * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Only emit
3296 DT_RELA, DT_RELASZ, and DT_RELAENT when DT_RELASZ is non-zero.
3297
64487780
AM
32982017-02-20 Alan Modra <amodra@gmail.com>
3299
3300 PR 21181
3301 * elflink.c (bfd_elf_final_link): Make DT_REL/DT_RELA zero
3302 if DT_RELSZ/DT_RELASZ is zero.
3303
6438d1be
NC
33042017-02-17 Nick Clifton <nickc@redhat.com>
3305
3306 * compress.c (bfd_get_full_section_contents): Remember to reduce
3307 compressed size by the sizeof the compression header when
3308 decompressing the contents.
3309
4bc26c69
PA
33102017-02-17 Pedro Alves <palves@redhat.com>
3311
3312 * srec.c (Chunk): Rename to ...
3313 (_bfd_srec_len): ... this.
3314 (S3Forced): Rename to ...
3315 (_bfd_srec_forceS3): ... this.
3316 * objcopy.c: Adjust all references.
3317
7ec22e0f
PA
33182017-02-17 Pedro Alves <palves@redhat.com>
3319
3320 * archive.c (bsd_write_armap): Rename to ...
3321 (_bfd_bsd_write_armap): ... this.
3322 (coff_write_armap): Rename to ...
3323 (_bfd_coff_write_armap): ... this.
3324 * libbfd-in.h (bsd_write_armap): Rename to ...
3325 (_bfd_bsd_write_armap): ... this.
3326 (coff_write_armap): Rename to ...
3327 (_bfd_coff_write_armap): ... this.
3328 * aout-target.h, aout-tic30.c: Adjust all users.
3329 * libbfd.h: Regenerate.
3330
8c8402cc
PA
33312017-02-17 Pedro Alves <palves@redhat.com>
3332
3333 * bfd-in.h (bfd_read, bfd_write): Adjust to rename.
3334 (warn_deprecated): Rename to ...
3335 (_bfd_warn_deprecated): ... this.
3336 * libbfd.c (warn_deprecated): Rename to ...
3337 (_bfd_warn_deprecated): ... this.
3338 * bfd-in2.h: Regenerate.
3339
c7c3d11b
PA
33402017-02-17 Pedro Alves <palves@redhat.com>
3341
3342 * bfdio.c (real_ftell): Rename to ...
3343 (_bfd_real_ftell): ... this.
3344 (real_fseek): Rename to ...
3345 (_bfd_real_fseek): ... this.
3346 (real_fopen): Rename to ...
3347 (_bfd_real_fopen): ... this.
3348 * libbfd-in.h (real_ftell): Rename to ...
3349 (_bfd_real_ftell): ... this.
3350 (real_fseek): Rename to ...
3351 (_bfd_real_fseek): ... this.
3352 (real_fopen): Rename to ...
3353 (_bfd_real_fopen): ... this.
3354 * cache.c, dwarf2.c, opncls.c: Adjust all callers.
3355 * libbfd.h: Regenerate.
3356
4265548c
PA
33572017-02-17 Pedro Alves <palves@redhat.com>
3358
3359 * dwarf2.c, elf-attrs.c, elf32-nds32.c: Adjust all callers.
3360 * libbfd.c (read_unsigned_leb128): Rename to ...
3361 (_bfd_read_unsigned_leb128): ... this.
3362 (read_signed_leb128): Rename to ...
3363 (_bfd_read_signed_leb128): ... this.
3364 (safe_read_leb128): Rename to ...
3365 (_bfd_safe_read_leb128): ... this.
3366 * libbfd-in.h (read_unsigned_leb128): Rename to ...
3367 (_bfd_read_unsigned_leb128): ... this.
3368 (read_signed_leb128): Rename to ...
3369 (_bfd_read_signed_leb128): ... this.
3370 (safe_read_leb128): Rename to ...
3371 (_bfd_safe_read_leb128): ... this.
3372 * libbfd.h: Renegerate.
3373
3239a423
AB
33742017-02-16 Andrew Burgess <andrew.burgess@embecosm.com>
3375
3376 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Perform symbol lookup
3377 before trying to fine matching file and line information.
3378
90ed9b8b
AB
33792017-02-16 Andrew Burgess <andrew.burgess@embecosm.com>
3380
3381 * dwarf2.c (struct dwarf2_debug): Add orig_bfd member.
3382 (_bfd_dwarf2_slurp_debug_info): If stashed debug information does
3383 not match current bfd, then reload debug information. Record bfd
3384 we're loading debug info for in the stash. If we have debug
3385 informatin in the cache then perform section placement before
3386 returning.
3387
a8c75b76
AM
33882017-02-16 Alan Modra <amodra@gmail.com>
3389
3390 PR 21000
3391 * elf-bfd.h (struct elf_backend_data): Add no_page_alias.
3392 * elfxx-target.h (elf_backend_no_page_alias): Define.
3393 (elfNN_bed): Init new field.
3394 * elf.c (assign_file_positions_for_load_sections): If no_page_alias
3395 ensure PT_LOAD segment starts on a new page.
3396 * elf32-hppa.c (elf_backend_no_page_alias): Define.
3397
247d6c4c
AM
33982017-02-16 Alan Modra <amodra@gmail.com>
3399
3400 PR 21132
3401 * elf32-hppa.c (allocate_plt_static): Allocate space for relocs
3402 if pic.
3403
90571206
JW
34042017-02-16 Jiong Wang <jiong.wang@arm.com>
3405
3406 * bfd.c (BFD_FLAGS_SAVED): Add BFD_LINKER_CREATED.
3407 * bfd-in2.h: Regenerated.
3408
2a568401
L
34092017-02-15 H.J. Lu <hongjiu.lu@intel.com>
3410
3411 PR ld/21168
3412 * elf32-i386.c (elf_i386_relocate_section): Allow
3413 "lea foo@GOT, %reg" in PIC.
3414
a5def14f
L
34152017-02-15 H.J. Lu <hongjiu.lu@intel.com>
3416
3417 PR ld/20244
3418 * elf32-i386.c (elf_i386_relocate_section): Properly get IFUNC
3419 symbol name when reporting R_386_GOT32/R_386_GOT32X relocation
3420 error against local IFUNC symbol without a base register for
3421 PIC.
3422
174d0a74
MR
34232017-02-15 Maciej W. Rozycki <macro@imgtec.com>
3424
3425 * elf32-ppc.c (ppc_elf_check_relocs): Use `%H:' rather than
3426 `%P: %H:' with `info->callbacks->einfo'.
3427 (ppc_elf_relocate_section): Likewise.
3428 * elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
3429 (ppc64_elf_edit_toc): Likewise.
3430 (ppc64_elf_relocate_section): Likewise.
3431
e278ae05
AM
34322017-02-14 Alan Modra <amodra@gmail.com>
3433
3434 * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Support
3435 --gc-keep-exported, and test versioned field of sym rather than
3436 looking for @ in name.
3437
10ddfe62
PD
34382017-02-13 Palmer Dabbelt <palmer@dabbelt.com>
3439
3440 * elfnn-riscv.c (riscv_global_pointer_value): Change _gp to
3441 __global_pointer$.
3442
d11135f5
NC
34432017-02-13 Nick Clifton <nickc@redhat.com>
3444
3445 PR binutils/21151
3446 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Check for an invalid
3447 unit length field.
3448
cc162427
AW
34492017-02-07 Andrew Waterman <andrew@sifive.com>
3450
3451 * elfnn-riscv.c (riscv_elf_finish_dynamic_sections): Only write PLT
3452 entry size if PLT header is written.
3453
3d044c0c
SL
34542017-02-06 Sheldon Lobo <sheldon.lobo@oracle.com>
3455
3456 Fix sparc64 dynamic relocation processing to use the dynamic
3457 symbol count.
3458 * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Use 'dynamic'
3459 to determine if bfd_get_symcount() or bfd_get_dynamic_symcount()
3460 should be used.
3461
1b7e3d2f
NC
34622017-02-03 Nick Clifton <nickc@redhat.com>
3463
3464 PR 21096
3465 * coffcode.h (coff_write_object_contents): Enlarge size of
3466 s_name_buf in order to avoid compile time warning about possible
3467 integer truncation.
3468 * elf32-nds32.c (nds32_elf_ex9_import_table): Mask off lower
3469 32-bits of insn value before printing into buffer.
3470
e17b0c35
MR
34712017-02-02 Maciej W. Rozycki <macro@imgtec.com>
3472
3473 * elfxx-mips.c (mips_elf_hash_sort_data): Add
3474 `max_local_dynindx'.
3475 (mips_elf_sort_hash_table): Handle it.
3476 (mips_elf_sort_hash_table_f) <GGA_NONE>: For forced local
3477 symbols bump up `max_local_dynindx' rather than
3478 `max_non_got_dynindx'.
3479
55f8b9d2
MR
34802017-02-02 Maciej W. Rozycki <macro@imgtec.com>
3481
3482 * elfxx-mips.c (mips_elf_hash_sort_data): Convert the
3483 `min_got_dynindx', `max_unref_got_dynindx' and
3484 `max_non_got_dynindx' members to the `bfd_size_type' data type.
3485 (mips_elf_sort_hash_table): Adjust accordingly.
3486
0f8c4b60
MR
34872017-02-02 Maciej W. Rozycki <macro@imgtec.com>
3488
3489 * elfxx-mips.c (mips_elf_sort_hash_table): Use `htab' throughout
3490 to access the hash table.
3491
17a80fa8
MR
34922017-02-02 Maciej W. Rozycki <macro@imgtec.com>
3493
3494 * elfxx-mips.c (mips_elf_sort_hash_table): Move assertion on
3495 non-NULL `htab' to the beginning.
3496
8f56d4fd
MR
34972017-02-02 Maciej W. Rozycki <macro@imgtec.com>
3498
3499 * elflink.c (elf_gc_sweep): Wrap overlong line.
3500
8b10b0b3
MR
35012017-01-30 Maciej W. Rozycki <macro@imgtec.com>
3502
3503 * elfxx-mips.h (_bfd_mips_elf_insn32): Rename prototype to...
3504 (_bfd_mips_elf_linker_flags): ... this. Add another parameter.
3505 * elfxx-mips.c (mips_elf_link_hash_table): Add
3506 `ignore_branch_isa' member.
3507 (mips_elf_perform_relocation): Do not treat an ISA mode mismatch
3508 in branch relocation calculation as an error if
3509 `ignore_branch_isa' has been set.
3510 (_bfd_mips_elf_insn32): Rename to...
3511 (_bfd_mips_elf_linker_flags): ... this. Rename the `on'
3512 parameter to `insn32' and add an `ignore_branch_isa' parameter.
3513 Handle the new parameter.
3514
1fbd05e1
HPN
35152017-01-27 Hans-Peter Nilsson <hp@axis.com>
3516
22d9a0de
HPN
3517 * elf32-cris.c (elf_cris_finish_dynamic_symbol): Remove now unused
3518 local variable dynobj.
3519
1fbd05e1
HPN
3520 PR ld/20995
3521 * elf32-cris.c (elf_cris_size_dynamic_sections): Handle sdynrelro.
3522 (elf_cris_adjust_dynamic_symbol): Place variables copied into the
3523 executable from read-only sections into sdynrelro.
3524 (elf_cris_finish_dynamic_symbol): Select sreldynrelro for
3525 dynamic relocs in sdynrelro.
3526 (elf_backend_want_dynrelro): Define.
3527
4a7324e1
SH
35282017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
3529
3530 * config.bfd (*-*-rtemsaout*): Mark as removed.
3531
c75b4ebd
SH
35322017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
3533
3534 * config.bfd (powerpcle-*-rtems*): Do not mark as removed.
3535 (arm-*-rtems*): Move to (arm*-*-eabi*).
3536 (i[3-7]86-*-rtems*): Move to (i[3-7]86-*-elf*).
3537 (m68-*-rtems*): Move to (m68*-*-elf*).
3538
850d84f6
SH
35392017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
3540
3541 * config.bfd (*-*-rtemscoff*): Mark as removed.
3542
b531344c
MR
35432017-01-24 Maciej W. Rozycki <macro@imgtec.com>
3544
3545 PR ld/20828
3546 * elflink.c (bfd_elf_record_link_assignment): Revert last
3547 change and don't ever clear `forced_local'. Set `mark'
3548 unconditionally.
3549 (elf_gc_sweep_symbol_info, elf_gc_sweep_symbol): Reorder within
3550 file.
3551 (elf_gc_sweep): Move the call to `elf_gc_sweep_symbol'...
3552 (bfd_elf_size_dynamic_sections): ... here.
3553 * elf32-ppc.c (ppc_elf_tls_setup): Don't clear `forced_local'
3554 and set `mark' instead in `__tls_get_addr_opt' processing.
3555 * elf64-ppc.c (ppc64_elf_tls_setup): Likewise.
3556
f0158f44
AM
35572017-01-24 Alan Modra <amodra@gmail.com>
3558
3559 * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Merge two cases
3560 where dynamic relocs are preferable. Allow ifunc too.
3561 (ensure_undefweak_dynamic): New function.
3562 (allocate_dynrelocs): Use it here. Move plt handling last and
3563 don't make symbols dynamic, simplifying loop. Only make undef
3564 weak symbols with GOT entries dynamic. Correct condition
3565 for GOT relocs. Handle dynamic relocs on ifuncs. Correct
3566 comments. Remove goto.
3567 (ppc_elf_relocate_section): Correct test for using dynamic
3568 symbol on GOT relocs. Rearrange test for emitting GOT relocs
3569 to suit. Set up explicit tls_index entries and implicit GOT
3570 tls_index entries resolvable at link time for
3571 __tls_get_addr_opt. Simplify test to clear mem for prelink.
3572 * elf64-ppc.c (allocate_got): Correct condition for GOT relocs.
3573 (ensure_undefweak_dynamic): New function.
3574 (allocate_dynrelocs): Use it here. Only make undef weak symbols
3575 with GOT entries dynamic. Remove unnecessary test of
3576 WILL_CALL_FINISH_DYNAMIC_SYMBOL in PLT handling.
3577 (ppc64_elf_relocate_section): Correct test for using dynamic
3578 symbol on GOT relocs. Rearrange test for emitting GOT relocs
3579 to suit. Set up explicit tls_index entries and implicit GOT
3580 tls_index entries resolvable at link time for __tls_get_addr_opt.
3581 Simplify expression to clear mem for prelink.
3582
2d0ca824
YN
35832017-01-23 Yury Norov <ynorov@caviumnetworks.com>
3584
3585 * elfnn-aarch64.c: Fix relaxations for ILP32 mode.
3586
7f784814
JW
35872017-01-20 Jiong Wang <jiong.wang@arm.com>
3588
3589 * elfnn-aarch64.c (elf_aarch64_hash_symbol): New function.
3590 (elf_backend_hash_symbol): Define.
3591
81ff47b3
MR
35922017-01-18 Maciej W. Rozycki <macro@imgtec.com>
3593
3594 PR ld/20828
3595 * elflink.c (bfd_elf_record_link_assignment): Clear any
3596 `forced_local' marking for DSO symbols that are not being
3597 provided.
3598
640d6bfd
KLC
35992017-01-17 Kuan-Lin Chen <kuanlinchentw@gmail.com>
3600
3601 * elfnn-riscv.c (riscv_elf_object_p): New function.
3602
8361ed4d
L
36032017-01-12 H.J. Lu <hongjiu.lu@intel.com>
3604
3605 PR ld/21038
3606 * elf64-x86-64.c (elf_x86_64_link_hash_table): Add
3607 plt_bnd_eh_frame.
3608 (elf_x86_64_check_relocs): Create .eh_frame section for the
3609 .plt.bnd section.
3610 (elf_x86_64_size_dynamic_sections): Allocate and initialize
3611 .eh_frame section for the .plt.bnd section.
3612 (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
3613 for the .plt.bnd section.
3614
2425a30e
NC
36152017-01-12 Nick Clifton <nickc@redhat.com>
3616
3617 PR binutils/20876
3618 * opncls.c (find_separate_debug_file): Add include_dirs
3619 parameter. Only include the directory part of the bfd's filename
3620 in search paths if include_dirs is true. Add a couple of extra
3621 locations for looking for debug files.
3622 ( bfd_follow_gnu_debuglink): Update invocation of
3623 find_separate_debug_file.
3624 (bfd_follow_gnu_debugaltlink): Likewise.
3625 (get_build_id): New function: Finds the build-id of the given bfd.
3626 (get_build_id_name): New function: Computes the name of the
3627 separate debug info file for a bfd, based upon its build-id.
3628 (check_build_id_file): New function: Checks to see if a separate
3629 debug info file exists at the given location, and that its
3630 build-id matches that of the original bfd.
3631 (bfd_follow_build_id_debuglink): New function: Finds a separate
3632 debug info file for a given bfd by using the build-id method.
3633 * dwarf2.c (_bfd_dwarf2_slurp_debug_info): Try using the build-id
3634 method of locating a separate debug info file before using the
3635 debuglink method.
3636 * bfd-in2.h: Regenerate.
3637
9e659176
L
36382017-01-11 H.J. Lu <hongjiu.lu@intel.com>
3639
3640 PR ld/21038
3641 * elf64-x86-64.c (elf_x86_64_eh_frame_bnd_plt): New.
3642 (elf_x86_64_bnd_arch_bed): Use elf_x86_64_eh_frame_bnd_plt and
3643 elf_x86_64_eh_frame_plt_got.
3644 (elf_x86_64_size_dynamic_sections): Get unwind info from
3645 elf_x86_64_bnd_arch_bed for the BND PLT.
3646
f2e2d2f5
JS
36472017-01-11 Jeremy Soller <jackpot51@gmail.com>
3648
3649 * config.bfd: Add entries for i686-redox and x86_64-redox.
3650
52b232b3
L
36512017-01-10 H.J. Lu <hongjiu.lu@intel.com>
3652
3653 * elf32-i386.c (elf_i386_check_relocs): Align .eh_frame section
3654 to 4 bytes.
3655 * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Align
3656 .eh_frame section to 4 bytes for x32.
3657 (elf_x86_64_check_relocs): Likewise.
3658
fff53dae
L
36592017-01-10 H.J. Lu <hongjiu.lu@intel.com>
3660
3661 PR ld/20830
3662 * elf32-i386.c (elf_i386_eh_frame_plt_got): New.
3663 (PLT_GOT_FDE_LENGTH): Likewise.
3664 (elf_i386_plt_layout): Add eh_frame_plt_got and
3665 eh_frame_plt_got_size.
3666 (elf_i386_plt): Updated.
3667 (elf_i386_link_hash_table): Add plt_got_eh_frame.
3668 (elf_i386_check_relocs): Create .eh_frame section for .plt.got.
3669 (elf_i386_size_dynamic_sections): Allocate and initialize
3670 .eh_frame section for .plt.got.
3671 (elf_i386_finish_dynamic_sections): Adjust .eh_frame section for
3672 .plt.got.
3673 (elf_i386_nacl_plt): Add FIXME for eh_frame_plt_got and
3674 eh_frame_plt_got_size.
3675 * elf64-x86-64.c (elf_x86_64_eh_frame_plt_got): New.
3676 (PLT_GOT_FDE_LENGTH): Likewise.
3677 (elf_x86_64_backend_data): Add eh_frame_plt_got and
3678 eh_frame_plt_got_size.
3679 (elf_x86_64_arch_bed): Updated.
3680 (elf_x86_64_bnd_arch_bed): Add FIXME for eh_frame_plt_got and
3681 eh_frame_plt_got_size.
3682 (elf_x86_64_nacl_arch_bed): Likewise.
3683 (elf_x86_64_link_hash_table): Add plt_got_eh_frame.
3684 (elf_x86_64_check_relocs): Create .eh_frame section for .plt.got.
3685 (elf_x86_64_size_dynamic_sections): Allocate and initialize
3686 .eh_frame section for .plt.got.
3687 (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
3688 for .plt.got.
3689
f129e49f
L
36902017-01-10 H.J. Lu <hongjiu.lu@intel.com>
3691
3692 * elf32-i386.c (elf_i386_size_dynamic_sections): Set
3693 plt_eh_frame->size to eh_frame_plt_size and use eh_frame_plt.
3694
cd6581da
NC
36952017-01-09 Nick Clifton <nickc@redhat.com>
3696
3697 * dwarf2.c (lookup_address_in_function_table): Return early if
3698 there are no functions in the given comp unit, or if the high
3699 address of the last function in the comp unit is less than the
3700 desired address.
3701
98f02962
NC
37022017-01-09 Nick Clifton <nickc@redhat.com>
3703
3704 PR binutils/21013
3705 * coffgen.c (_bfd_coff_get_external_symbols): Generate an error
3706 message if there are too many symbols to load.
3707
ae4fda66
JC
37082017-01-04 James Clarke <jrtc27@jrtc27.com>
3709
3710 * elf64-alpha.c (elf64_alpha_relax_opt_call): Don't set tsec_free
3711 if relocs are cached.
3712
de1010f4
RF
37132017-01-03 Rich Felker <bugdal@aerifal.cx>
3714
3715 PR ld/21017
3716 * elf32-microblaze.c (microblaze_elf_check_relocs): Add an entry
3717 for R_MICROBLAZE_GOTOFF_64.
3718
09fe2662
NC
37192017-01-03 Nick Clifton <nickc@redhat.com>
3720
3721 * mach-o.c (bfd_mach_o_lookup_uuid_command): Fix compile time
3722 warning about using a possibly uninitialised variable.
3723
595e0a47
AM
37242017-01-02 Alan Modra <amodra@gmail.com>
3725
3726 * elf32-hppa.c (ensure_undef_weak_dynamic): New function.
3727 (allocate_plt_static, allocate_dynrelocs): Use it.
3728
7bd9df3b
AM
37292017-01-02 Alan Modra <amodra@gmail.com>
3730
3731 * elf-hppa.h (elf_hppa_fake_sections): Set SHF_INFO_LINK for
3732 .PARISC.unwind section.
3733
5b86074c
AM
37342017-01-02 Alan Modra <amodra@gmail.com>
3735
3736 PR ld/20989
3737 * elfxx-sparc.c (gdop_relative_offset_ok): New function.
3738 (_bfd_sparc_elf_relocate_section): Use it to validate GOT
3739 indirect to GOT pointer relative code edit.
3740
2571583a
AM
37412017-01-02 Alan Modra <amodra@gmail.com>
3742
3743 Update year range in copyright notice of all files.
3744
5c1ad6b5 3745For older changes see ChangeLog-2016
3499769a 3746\f
5c1ad6b5 3747Copyright (C) 2017 Free Software Foundation, Inc.
3499769a
AM
3748
3749Copying and distribution of this file, with or without modification,
3750are permitted in any medium without royalty provided the copyright
3751notice and this notice are preserved.
3752
3753Local Variables:
3754mode: change-log
3755left-margin: 8
3756fill-column: 74
3757version-control: never
3758End:
This page took 0.270869 seconds and 4 git commands to generate.