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