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