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