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