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