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