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