Convert PLT reloc only if pointer equality isn't needed
[deliverable/binutils-gdb.git] / bfd / ChangeLog
1 2015-05-27 H.J. Lu <hongjiu.lu@intel.com>
2
3 PR binutils/18458
4 * elf32-i386.c (elf_i386_check_relocs): Create .plt.got section
5 for now binding only if pointer equality isn't needed.
6 (elf_i386_allocate_dynrelocs): Use .plt.got section for now
7 binding only if pointer equality isn't needed.
8 * elf64-x86-64.c (elf_x86_64_check_relocs): Create .plt.got
9 section for now binding only if pointer equality isn't needed.
10 (elf_x86_64_allocate_dynrelocs): Use .plt.got section for now
11 binding only if pointer equality isn't needed.
12
13 2015-05-26 H.J. Lu <hongjiu.lu@intel.com>
14
15 PR binutils/18437
16 * elf32-i386.c (elf_i386_get_plt_sym_val): Skip extra relocations
17 in .rel.plt/.rela.plt.
18 * elf64-x86-64.c (elf_x86_64_get_plt_sym_val): Likewise.
19
20 2015-05-19 Jiong Wang <jiong.wang@arm.com>
21
22 * elfnn-aarch64.c (aarch64_tls_transition_without_check): Sort
23 relocation case labels alphabetically.
24 (elfNN_aarch64_final_link_relocate): Ditto.
25 (elfNN_aarch64_tls_relax): Ditto.
26 (elfNN_aarch64_relocate_section): Ditto.
27 (elfNN_aarch64_gc_sweep_hook): Ditto.
28 (elfNN_aarch64_check_relocs): Ditto.
29 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Ditto.
30 (_bfd_aarch64_elf_resolve_relocation): Ditto.
31
32 2015-05-18 Jiong Wang <jiong.wang@arm.com>
33
34 * elfnn-aarch64.c (elfNN_aarch64_adjust_dynamic_symbol): Rewrite
35 comments.
36
37 2015-05-16 H.J. Lu <hongjiu.lu@intel.com>
38
39 * elf32-i386.c (elf_i386_check_relocs): Create .plt.got section
40 for now binding.
41 (elf_i386_allocate_dynrelocs): Use .plt.got section for now
42 binding.
43 * elf64-x86-64.c (elf_x86_64_check_relocs): Create .plt.got
44 section for now binding.
45 (elf_x86_64_allocate_dynrelocs): Use .plt.got section for now
46 binding.
47
48 2015-05-14 H.J. Lu <hongjiu.lu@intel.com>
49
50 * bfd.c (bfd_update_compression_header): Also write the zlib
51 header if the SHF_COMPRESSED bit cleared..
52 (bfd_check_compression_header): Return the uncompressed size.
53 * compress.c (decompress_contents): Don't skip the zlib header.
54 (bfd_compress_section_contents): Properly handle ELFCOMPRESS_ZLIB,
55 which doesn't have the zlib header.
56 (bfd_init_section_decompress_status): Likewise.
57 (bfd_get_full_section_contents): Updated.
58 (bfd_is_section_compressed): Likewise.
59 (bfd_is_section_compressed_with_header): Return the uncompressed
60 size.
61 * elf.c (_bfd_elf_make_section_from_shdr): Updated.
62 * bfd-in2.h: Regenerated.
63
64 2015-05-14 Jiong Wang <jiong.wang@arm.com>
65
66 * elfnn-aarch64.c (elfNN_aarch64_relocate_section): Remove overflow
67 check restrictions.
68
69 2015-05-14 Max Filippov <jcmvbkbc@gmail.com>
70
71 * elf32-xtensa.c (elf_xtensa_gc_sweep_hook): Treat PLT reference
72 as GOT reference when plt.refcount is not positive.
73
74 2015-05-12 H.J. Lu <hongjiu.lu@intel.com>
75
76 * elf32-i386.c (elf_i386_allocate_dynrelocs): Allocate space
77 for the first .plt entry only if needed.
78 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise.
79
80 2015-05-11 H.J. Lu <hongjiu.lu@intel.com>
81
82 * Makefile.am (ALL_MACHINES): Add cpu-iamcu.lo.
83 (ALL_MACHINES_CFILES): Likewise.
84 * archures.c (bfd_mach_iamcu): New.
85 (bfd_mach_i386_iamcu): Likewise.
86 (bfd_mach_i386_iamcu_intel_syntax): Likewise.
87 (bfd_iamcu_arch): Likewise.
88 (bfd_archures_list): Add &bfd_iamcu_arch.
89 * config.bfd (targ_selvecs): Add iamcu_elf32_vec to
90 i386_elf32_vec.
91 (targ_archs): Add bfd_iamcu_arch if needed.
92 * configure.ac: Support iamcu_elf32_vec.
93 * cpu-iamcu.c: New file.
94 * elf32-i386.c (elf32_iamcu_elf_object_p): New function.
95 Add support for iamcu_elf32_vec and elf32_iamcu_bed.
96 * targets.c (iamcu_elf32_vec): New.
97 (_bfd_target_vector): Add iamcu_elf32_vec.
98 * Makefile.in: Regenerated.
99 * bfd-in2.h: Likewise.
100 * configure: Likewise.
101
102 2015-05-11 H.J. Lu <hongjiu.lu@intel.com>
103
104 * elfcode.h (elf_object_p): Replace EM_486 with EM_IAMCU.
105
106 2015-05-10 H.J. Lu <hongjiu.lu@intel.com>
107
108 * elf32-i386.c (elf_i386_convert_mov_to_lea): Replace input_bfd
109 and output_bfd with abfd.
110 * elf64-x86-64.c (elf_x86_64_convert_mov_to_lea): Likewise.
111
112 2015-05-06 Toni Spets <toni.spets@iki.fi>
113
114 PR ld/18372
115 * peXXigen.c (rsrc_process_section): Skip discarded resource
116 sections.
117
118 2015-05-01 H.J. Lu <hongjiu.lu@intel.com>
119
120 * config.bfd: Support i[3-7]86-*-elf*.
121
122 2015-04-30 H.J. Lu <hongjiu.lu@intel.com>
123
124 * elf32-i386.c (elf_backend_post_process_headers): Undef for
125 Solaris 2.
126
127 2015-04-30 Nick Clifton <nickc@redhat.com>
128
129 PR 18317
130 * elf32-mep.c (MEPREL): Use bfd_elf_generic_reloc instead of
131 mep_reloc.
132 (mep_reloc): Delete unused function.
133
134 2015-04-29 Nick Clifton <nickc@redhat.com>
135
136 PR 17099
137 * coff-i386.c (coff_i386_rtype_to_howto): Allow absolute PCRLONG
138 relocs.
139
140 2015-04-27 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
141
142 * elf-s390-common.c (elf_s390_merge_obj_attributes): New function.
143 * elf32-s390.c (elf32_s390_merge_private_bfd_data): Call
144 elf_s390_merge_obj_attributes.
145 * elf64-s390.c (elf64_s390_merge_private_bfd_data): New function.
146
147 2015-04-24 Jiong Wang <jiong.wang@arm.com>
148
149 PR ld/18270
150 * elfnn-aarch64.c (elfNN_aarch64_size_dynamic): Count local symbol for
151 GOT_NORMAL for both sgot/srelgot section.
152 (elfNN_aarch64_final_link_relocate): Relocate against GOT entry address
153 and generate necessary runtime relocation for GOT entry.
154
155 2015-04-24 H.J. Lu <hongjiu.lu@intel.com>
156
157 PR binutils/18209
158 * archive.c (_bfd_get_elt_at_filepos): Copy is_linker_input.
159
160 2015-04-24 Jiong Wang <jiong.wang@arm.com>
161
162 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Reject
163 PC-relative relocation for external symbol.
164
165 2015-04-24 Nick Clifton <nickc@redhat.com>
166
167 PR 18313
168 * compress.c (decompress_contents): Zero initialse the z_stream
169 structure.
170
171 2015-04-24 Nick Clifton <nickc@redhat.com>
172
173 * elf.c (_bfd_elf_is_local_label_name): Extend test for assembler
174 local labels to include local labels with a numeric suffix and
175 fake symbols.
176
177 2015-04-24 H.J. Lu <hongjiu.lu@intel.com>
178
179 PR binutils/18316
180 * section.c (SEC_MEP_VLIW): New.
181 * bfd-in2.h: Regenerated.
182
183 2015-04-23 H.J. Lu <hongjiu.lu@intel.com>
184
185 PR ld/18277
186 * compress.c (bfd_compress_section_contents): Remove the
187 write_compress argument.
188 (bfd_init_section_compress_status): Updated.
189 (bfd_compress_section): Likewise.
190 * elf.c (_bfd_elf_set_reloc_sh_name): New.
191 (_bfd_elf_init_reloc_shdr): Add delay_st_name_p. Set sh_name
192 to (unsigned int) -1 if delay_st_name_p is TRUE. Use
193 _bfd_elf_set_reloc_sh_name.
194 (elf_fake_sections): Don't rename DWARF debug section for
195 linker output if it will be compressed. Instead, set
196 delay_st_name_p to TRUE and pass it to _bfd_elf_init_reloc_shdr.
197 (assign_section_numbers): Call _bfd_elf_strtab_addref only if
198 sh_name != (unsigned int) -1. Don't finalize nor assign
199 shstrtab section here. Delay setting output section names to
200 _bfd_elf_write_object_contents.
201 (_bfd_elf_compute_section_file_positions): Update comments on
202 sh_offset for shstrtab section.
203 (assign_file_positions_for_non_load_sections): Set sh_offset to
204 -1 for shstrtab section.
205 (assign_file_positions_except_relocs): Likewise.
206 (_bfd_elf_assign_file_positions_for_non_load): Set up sh_name
207 when compressing DWARF debug sections. Place shstrtab section
208 after DWARF debug sections have been compressed.
209 (_bfd_elf_write_object_contents): Setting sh_name for output
210 sections.
211
212 2015-04-23 H.J. Lu <hongjiu.lu@intel.com>
213
214 PR binutils/18209
215 * bfd.c (bfd): Add is_linker_input.
216 * elf.c (convert_debug_to_zdebug): New.
217 (convert_zdebug_to_debug): Likewise.
218 (_bfd_elf_make_section_from_shdr): Don't convert .debug_* to
219 .zdebug_* here. Use convert_zdebug_to_debug. Set SEC_ELF_RENAME.
220 (_bfd_elf_init_reloc_shdr): Pass a pointer to section name
221 instead of a pointer to section.
222 (elf_fake_sections): Rename the section name if SEC_ELF_RENAME
223 is set.
224 * section.c (SEC_ELF_RENAME): New.
225 * bfd-in2.h: Regenerated.
226
227 2015-04-23 Alan Modra <amodra@gmail.com>
228
229 * elf64-ppc.c (TOC_BASE_ALIGN): Define.
230 (ppc64_elf_next_toc_section): Align multi-got toc base.
231 (ppc64_elf_set_toc): Likewise initial toc base and .TOC. symbol.
232
233 2015-04-22 H.J. Lu <hongjiu.lu@intel.com>
234
235 PR ld/18289
236 * elf32-i386.c (elf_i386_link_hash_entry): Add gotoff_ref.
237 (elf_i386_link_hash_newfunc): Initialize gotoff_ref to 0.
238 (elf_i386_create_dynamic_sections): Always allow copy relocs for
239 building executables.
240 (elf_i386_copy_indirect_symbol): Also copy gotoff_ref.
241 (elf_i386_check_relocs): Set gotoff_ref for R_386_GOTOFF.
242 (elf_i386_adjust_dynamic_symbol): Also allocate copy relocs for
243 PIE and R_386_GOTOFF.
244 (elf_i386_relocate_section): Allow R_386_GOTOFF in executable.
245
246 2015-04-20 H.J. Lu <hongjiu.lu@intel.com>
247
248 * elf.c (assign_section_numbers): Always set up sh_name.
249
250 2015-04-20 H.J. Lu <hongjiu.lu@intel.com>
251
252 * elf.c (assign_file_positions_for_non_load_sections): Iterate
253 sections by pointer.
254 (_bfd_elf_assign_file_positions_for_non_load): Likewise.
255
256 2015-04-14 H.J. Lu <hongjiu.lu@intel.com>
257
258 * bfd-in.h (compressed_debug_section_type): New.
259 * compress.c (bfd_compress_section_contents): Add an argument
260 for linker write compression and always generate .zdebug_*
261 section when linking.
262 (bfd_init_section_compress_status): Pass FALSE to
263 bfd_compress_section_contents.
264 (bfd_compress_section): New function.
265 * elf.c (elf_fake_sections): For linking, set SEC_ELF_COMPRESS
266 on DWARF debug sections if COMPRESS_DEBUG is set and rename
267 section if COMPRESS_DEBUG_GABI_ZLIB isn't set.
268 (assign_file_positions_for_non_load_sections): Set sh_offset
269 to -1 if SEC_ELF_COMPRESS is set.
270 (assign_file_positions_except_relocs): Likwise.
271 (_bfd_elf_assign_file_positions_for_relocs): Renamed to ...
272 (_bfd_elf_assign_file_positions_for_non_load): This. Change
273 return time to bfd_boolean. Compress the section if
274 SEC_ELF_COMPRESS is set.
275 (_bfd_elf_write_object_contents): Updated.
276 (_bfd_elf_set_section_contents): Write section contents to
277 the buffer if SEC_ELF_COMPRESS is set.
278 * merge.c: Include "elf-bfd.h".
279 (sec_merge_emit): Add arguments for contents and offset. Write
280 to contents with offset if contents isn't NULL.
281 (_bfd_write_merged_section): Write section contents to the
282 buffer if SEC_ELF_COMPRESS is set. Pass contents and
283 output_offset to sec_merge_emit.
284 * elflink.c (bfd_elf_final_link): Allocate the buffer for
285 output section contents if SEC_ELF_COMPRESS is set.
286 * section.c (SEC_ELF_COMPRESS): New.
287 * bfd-in2.h: Regenerated.
288
289 2015-04-15 Alan Modra <amodra@gmail.com>
290
291 * elf32-rl78.c (rl78_elf_relocate_section): Typo fix.
292
293 2015-04-14 Nick Clifton <nickc@redhat.com>
294
295 * elf32-rl78.c (RL78_OP_REL): New macro.
296 (rl78_elf_howto_table): Use it for complex relocs.
297 (get_symbol_value): Handle the cases when the info or status
298 arguments are NULL.
299 (get_romstart): Cache the status returned by get_symbol_value.
300 (get_ramstart): Likewise.
301 (RL78_STACK_PUSH): Generate an error message if the stack
302 overflows.
303 (RL78_STACK_POP): Likewise for underflows.
304 (rl78_compute_complex_reloc): New function. Contains the basic
305 processing code for all RL78 complex relocs.
306 (rl78_special_reloc): New function. Provides special reloc
307 handling for complex relocs.
308 (rl78_elf_relocate_section): Use rl78_compute_complex_reloc.
309 (rl78_offset_for_reloc): Likewise.
310
311 2015-04-14 H.J. Lu <hongjiu.lu@intel.com>
312
313 PR ld/pr17709
314 * elflink.c (_bfd_elf_adjust_dynamic_copy): Check
315 info->extern_protected_data when warning copy relocs against
316 protected symbols.
317 (_bfd_elf_symbol_refs_local_p): Check info->extern_protected_data
318 when checking protected non-function symbols.
319
320 2015-04-13 John Baldwin <jhb@FreeBSD.org>
321
322 * elf.c (elfcore_grok_note): Recognize NT_X86_XSTATE on
323 FreeBSD.
324 (elfcore_write_xstatereg): Use correct note name on FreeBSD.
325
326 2015-04-13 H.J. Lu <hongjiu.lu@intel.com>
327
328 PR ld/18250
329 * elflink.c (elf_link_is_defined_archive_symbol): Return FALSE
330 if the object has been claimed by plugin.
331
332 2015-04-11 H.J. Lu <hongjiu.lu@intel.com>
333
334 * elf32-i386.c (elf_i386_relocate_section): Replace SYMBOLIC_BIND
335 with SYMBOL_REFERENCES_LOCAL when checking R_386_GOTOFF against
336 protected data symbol when building shared library.
337 * elf64-x86-64.c (elf_x86_64_relocate_section): Check
338 R_X86_64_GOTOFF64 against undefined symbol and replace
339 SYMBOLIC_BIND with SYMBOL_REFERENCES_LOCAL when checking
340 R_X86_64_GOTOFF64 against protected data symbol when building
341 shared library.
342
343 2015-04-10 H.J. Lu <hongjiu.lu@intel.com>
344
345 PR ld/pr17709
346 * elf32-i386.c (elf_i386_relocate_section): Also check R_386_GOTOFF
347 against protected data symbol when building shared library.
348 * elf64-x86-64.c (elf_x86_64_relocate_section): Also check
349 R_X86_64_GOTOFF64 against protected data symbol when building
350 shared library.
351
352 2015-04-10 H.J. Lu <hongjiu.lu@intel.com>
353
354 PR ld/pr15228
355 PR ld/pr17709
356 * elf-bfd.h (elf_backend_data): Add extern_protected_data.
357 * elf32-i386.c (elf_backend_extern_protected_data): New.
358 Defined to 1.
359 * elf64-x86-64.c (elf_backend_extern_protected_data): Likewise.
360 * elflink.c (_bfd_elf_adjust_dynamic_copy): Don't error on
361 copy relocs against protected symbols if extern_protected_data
362 is true.
363 (_bfd_elf_symbol_refs_local_p): Don't return true on protected
364 non-function symbols if extern_protected_data is true.
365 * elfxx-target.h (elf_backend_extern_protected_data): New.
366 Default to 0.
367 (elfNN_bed): Initialize extern_protected_data with
368 elf_backend_extern_protected_data.
369
370 2015-04-10 H.J. Lu <hongjiu.lu@intel.com>
371
372 * compress.c (bfd_compress_section_contents): Replace bfd_malloc
373 and free with bfd_alloc and bfd_release on compressed buffer.
374 Release buffer if compressed section isn't smaller.
375
376 2015-04-10 Alan Modra <amodra@gmail.com>
377
378 PR ld/18222
379 * elflink.c (_bfd_elf_adjust_dynamic_copy): Don't report an error
380 on adding a protected visibility variable to .dynbss.
381
382 2015-04-10 Alan Modra <amodra@gmail.com>
383
384 Revert 2015-03-05 H.J. Lu <hongjiu.lu@intel.com>
385 PR ld/pr15228
386 PR ld/pr17709
387 * elf-bfd.h (elf_backend_data): Delete extern_protected_data.
388 * elf32-i386.c (elf_backend_extern_protected_data): Delete.
389 * elf64-x86-64.c (elf_backend_extern_protected_data): Likewise.
390 * elflink.c (_bfd_elf_adjust_dynamic_copy): Remove
391 extern_protected_data test.
392 (_bfd_elf_symbol_refs_local_p): Likewise.
393 * elfxx-target.h (elf_backend_extern_protected_data): Delete.
394 (elfNN_bed): Delete elf_backend_extern_protected_data init.
395
396 2015-04-09 H.J. Lu <hongjiu.lu@intel.com>
397
398 * compress.c (bfd_compress_section_contents): Update comments.
399 (bfd_init_section_decompress_status): Likewise.
400 (bfd_init_section_compress_status): Likewise.
401
402 2015-04-09 H.J. Lu <hongjiu.lu@intel.com>
403
404 * elfxx-target.h (TARGET_BIG_SYM): Add BFD_COMPRESS_GABI to
405 object_flags.
406 (TARGET_LITTLE_SYM): Likewise.
407
408 2015-04-09 Max Filippov <jcmvbkbc@gmail.com>
409
410 * elf32-xtensa.c (splay-tree.h): include header.
411 (text_action_struct): drop next pointer.
412 (text_action_list_struct): drop head pointer, add count and
413 tree fields.
414 (find_fill_action): instead of linear search in text_action_list
415 search in the tree.
416 (text_action_compare, action_first, action_next): new functions.
417 (text_action_add, text_action_add_literal): instead of linear
418 search and insertion insert new node into the tree.
419 (removed_by_actions): pass additional parameter: action_list,
420 use it to traverse the tree.
421 (offset_with_removed_text): pass additional action_list parameter
422 to removed_by_actions.
423 (map_action_fn_context): new typedef.
424 (map_action_fn_context_struct): new structure.
425 (map_action_fn): new function.
426 (map_removal_by_action): use splay_tree_foreach to build map.
427 (find_insn_action): replace linear search in text_action_list
428 with series of splay_tree_lookups.
429 (print_action, print_action_list_fn): new functions.
430 (print_action_list): use splay_tree_foreach.
431 (init_xtensa_relax_info): drop action_list.head initialization.
432 Initialize the tree.
433 (compute_text_actions): use non-zero action_list_count instead of
434 non-NULL action list.
435 (xlate_map_context): new typedef.
436 (xlate_map_context_struct): new structure.
437 (xlate_map_fn): new function.
438 (build_xlate_map): use splay_tree_foreach to build map.
439 (action_remove_bytes_fn): new function.
440 (relax_section): use zero action_list_count instead of NULL
441 action list. Use splay_tree_foreach to count final section size.
442 Drop unused variable 'removed'.
443
444 2015-04-09 Max Filippov <jcmvbkbc@gmail.com>
445
446 * elf32-xtensa.c (removed_literal_map_entry): new typedef.
447 (removed_literal_map_entry_struct): new structure.
448 (removed_literal_list_struct): add new fields: n_map and map.
449 (map_removed_literal, removed_literal_compare): new functions.
450 (find_removed_literal): build index array for literals ordered
451 by VMA, use binary search to find removed literal.
452
453 2015-04-09 Max Filippov <jcmvbkbc@gmail.com>
454
455 * elf32-xtensa.c (removal_by_action_entry_struct,
456 removal_by_action_map_struct): new structures.
457 (removal_by_action_entry, removal_by_action_map): new typedefs.
458 (text_action_list_struct): add new field: map.
459 (map_removal_by_action, removed_by_actions_map,
460 offset_with_removed_text_map): new functions.
461 (relax_section): replace offset_with_removed_text with
462 offset_with_removed_text_map.
463 (translate_reloc, relax_property_section, relax_section_symbols):
464 replace removed_by_actions with removed_by_actions_map.
465
466 2015-04-09 Max Filippov <jcmvbkbc@gmail.com>
467
468 * elf32-xtensa.c (reloc_range_list, reloc_range_list_entry,
469 reloc_range): new typedef.
470 (reloc_range_list_struct, reloc_range_list_entry_struct,
471 reloc_range_struct): new structures.
472 (reloc_range_compare, build_reloc_ranges,
473 reloc_range_list_append, reloc_range_list_remove,
474 reloc_range_list_update_range, free_reloc_range_list): new
475 functions.
476 (compute_text_actions): precompute relocation opcodes before the
477 loop. Add relevant_relocs variable, initialize it before the
478 loop, pass it to the check_section_ebb_pcrels_fit.
479 (check_section_ebb_pcrels_fit): add new parameter:
480 relevant_relocs. Update address range in the relevant_relocs if
481 it's non-NULL and iterate only over relevant relocations.
482
483 2015-04-09 Nick Clifton <nickc@redhat.com>
484
485 * elf32-rx.c (describe_flags): Report the settings of the string
486 insn using bits.
487 (rx_elf_merge_private_bfd_data): Handle merging of the string insn
488 using bits.
489
490 2015-04-08 H.J. Lu <hongjiu.lu@intel.com>
491
492 * compress.c (bfd_compress_section_contents): Work around a GCC
493 uninitialized warning bug fixed in GCC 4.7.
494
495 2015-04-08 H.J. Lu <hongjiu.lu@intel.com>
496
497 * archive.c (_bfd_get_elt_at_filepos): Also copy BFD_COMPRESS_GABI
498 bit.
499 * bfd.c (bfd::flags): Increase size to 18 bits.
500 (BFD_COMPRESS_GABI): New.
501 (BFD_FLAGS_SAVED): Add BFD_COMPRESS_GABI.
502 (BFD_FLAGS_FOR_BFD_USE_MASK): Likewise.
503 (bfd_update_compression_header): New fuction.
504 (bfd_check_compression_header): Likewise.
505 (bfd_get_compression_header_size): Likewise.
506 (bfd_is_section_compressed_with_header): Likewise.
507 * compress.c (MAX_COMPRESSION_HEADER_SIZE): New.
508 (bfd_compress_section_contents): Return the uncompressed size if
509 the full section contents is compressed successfully. Support
510 converting from/to .zdebug* sections.
511 (bfd_get_full_section_contents): Call
512 bfd_get_compression_header_size to get compression header size.
513 (bfd_is_section_compressed): Renamed to ...
514 (bfd_is_section_compressed_with_header): This. Add a pointer
515 argument to return compression header size.
516 (bfd_is_section_compressed): Use it.
517 (bfd_init_section_decompress_status): Call
518 bfd_get_compression_header_size to get compression header size.
519 Return FALSE if uncompressed section size is 0.
520 * elf.c (_bfd_elf_make_section_from_shdr): Support converting
521 from/to .zdebug* sections.
522 * bfd-in2.h: Regenerated.
523
524 2015-04-07 Alan Modra <amodra@gmail.com>
525
526 * elf.c (_bfd_elf_get_reloc_section): Allow for .got.plt being
527 mapped to output .got section.
528
529 2015-04-07 Alan Modra <amodra@gmail.com>
530
531 * elf32-ppc.c (struct ppc_elf_link_hash_entry): Add has_addr16_ha
532 and has_addr16_lo. Make has_sda_refs a bitfield.
533 (ppc_elf_check_relocs): Set new flags.
534 (ppc_elf_link_hash_table_create): Update default_params.
535 (ppc_elf_adjust_dynamic_symbol): Clear protected_def in cases
536 where we won't be making .dynbss entries or editing code. Set
537 params->pic_fixup when we'll edit code for protected var access.
538 (allocate_dynrelocs): Allocate got entry for edited code and
539 discard dyn_relocs.
540 (struct ppc_elf_relax_info): Add picfixup_size.
541 (ppc_elf_relax_section): Rename struct one_fixup to struct
542 one_branch_fixup. Rename fixups to branch_fixups. Size space for
543 pic fixups.
544 (ppc_elf_relocate_section): Edit non-PIC accessing protected
545 visibility variables to PIC. Don't emit dyn_relocs for code
546 we've edited.
547 * elf32-ppc.h (struct ppc_elf_params): Add pic_fixup.
548
549 2015-04-07 Nick Clifton <nickc@redhat.com>
550
551 * elf.c (_bfd_elf_is_local_label_name): Treat assembler generated
552 local labels as local.
553
554 2015-04-06 H.J. Lu <hongjiu.lu@intel.com>
555
556 * compress.c (get_uncompressed_size): Removed.
557 (bfd_compress_section_contents): Use bfd_putb64 to write
558 uncompressed section size.
559 (bfd_init_section_decompress_status): Replace
560 get_uncompressed_size with bfd_getb64.
561
562 2015-04-04 H.J. Lu <hongjiu.lu@intel.com>
563
564 * elf.c (_bfd_elf_init_private_section_data): Also preserve the
565 SHF_COMPRESSED bit if not decompress.
566
567 2015-04-04 H.J. Lu <hongjiu.lu@intel.com>
568
569 * compress.c (get_uncompressed_size): New. Extracted from ...
570 (bfd_init_section_decompress_status): This. Use it.
571
572 2015-04-02 Andrew Turner <andrew@freebsd.org>
573
574 * config.bfd: Add aarch64-*-freebsd* target triple.
575
576 2015-04-02 H.J. Lu <hongjiu.lu@intel.com>
577
578 * configure: Regenerated.
579
580 2015-04-01 Tejas Belagod <tejas.belagod@arm.com>
581 Marcus Shawcroft <marcus.shawcroft@arm.com>
582 Jiong Wang <jiong.wang@arm.com>
583
584 * bfd-in.h (bfd_elf64_aarch64_set_options)
585 (bfd_elf32_aarch64_set_options): Add parameter.
586 * bfd-in2.h: Regenerated.
587 * elfnn-aarch64.c (aarch64_erratum_843419_stub)
588 (_bfd_aarch64_adrp_p, _bfd_aarch64_erratum_843419_sequence_p)
589 (_bfd_aarch64_erratum_843419_stub_name)
590 (_bfd_aarch64_erratum_843419_fixup)
591 (_bfd_aarch64_erratum_843419_scan)
592 (_bfd_aarch64_erratum_843419_branch_to_stub)
593 (_bfd_aarch64_erratum_843419_p): Define.
594 (enum elf_aarch64_stub_type): Define
595 aarch64_stub_erratum_843419_veneer.
596 (struct elf_aarch64_stub_hash_entry): Define adrp_offset.
597 (struct elf_aarch64_link_hash_table): Define fix_erratum_843419
598 and fix_erratum_843419_adr.
599 (stub_hash_newfunc): Initialize adrp_offset;
600 (_bfd_aarch64_add_stub_entry_after): Define.
601 (aarch64_map_one_stub, aarch64_build_one_stub)
602 (aarch64_size_one_stub): Handle
603 aarch64_stub_erratum_843419_veneer.
604 (_bfd_aarch64_resize_stubs): Round stub section size.
605 (elfNN_aarch64_size_stubs): Add scan for 843419.
606 (bfd_elfNN_aarch64_set_options): Add parameter. Initialize
607 fix_erratum_843419 and fix_erratum_843419_adr.
608 (struct erratum_835769_branch_to_stub_data): Add info.
609 (elfNN_aarch64_write_section): Initialise info. Handle 843419.
610 (elfNN_aarch64_size_dynamic_sections): Handle 843419.
611 * elfxx-aarch64.c (_bfd_aarch64_decode_adrp_imm)
612 (_bfd_aarch64_sign_extend): Define.
613 (reencode_adr_imm): Remove static. Rename to:
614 (_bfd_aarch64_reencode_adr_imm): Define.
615 (_bfd_aarch64_elf_put_addend): Call _bfd_aarch64_reencode_adr_imm.
616 * elfxx-aarch64.h (AARCH64_ADR_OP, AARCH64_ADRP_OP)
617 (AARCH64_ADRP_OP_MASK, _bfd_aarch64_sign_extend)
618 (_bfd_aarch64_decode_adrp_imm, _bfd_aarch64_reencode_adr_imm):
619 Define.
620
621 2015-04-01 H.J. Lu <hongjiu.lu@intel.com>
622
623 * configure: Regenerated.
624
625 2015-03-31 Ed Schouten <ed@nuxi.nl>
626
627 * config.bfd (targ_defvec): Set to x86_64_elf64_cloudabi_vec
628 for x86_64-*-cloudabi*.
629 * configure.ac: Handle x86_64_elf64_cloudabi_vec.
630 * configure: Regenerated.
631 * elf64-x86-64.c (TARGET_LITTLE_SYM): Support x86_64-*-cloudabi*.
632 (TARGET_LITTLE_NAME): Likewise.
633 (ELF_OSABI): Likewise.
634 (elf64_bed): Likewise.
635 * targets.c (x86_64_elf64_cloudabi_vec): New.
636 (_bfd_target_vector): Add x86_64_elf64_cloudabi_vec.
637
638 2015-03-31 H.J. Lu <hongjiu.lu@intel.com>
639
640 * configure.ac: Revert the AM_ZLIB change.
641 * Makefile.in: Regenerated.
642 * aclocal.m4: Likewise.
643 * configure: Likewise.
644 * doc/Makefile.in: Likewise.
645
646 2015-03-30 H.J. Lu <hongjiu.lu@intel.com>
647
648 PR ld/18169
649 * elf-bfd.h (elf_backend_data): Add get_reloc_section.
650 (_bfd_elf_get_reloc_section): New.
651 * elf.c (_bfd_elf_get_reloc_section): Likewise.
652 (assign_section_numbers): Call get_reloc_section to look up the
653 section the relocs apply.
654 * elfxx-target.h (elf_backend_get_reloc_section): Likewise.
655 (elfNN_bed): Initialize get_reloc_section with
656 elf_backend_get_reloc_section.
657
658 2015-03-29 H.J. Lu <hongjiu.lu@intel.com>
659
660 * Makefile.am (ZLIB): New.
661 (ZLIBINC): Likewise.
662 (AM_CFLAGS): Add $(ZLIBINC).
663 (libbfd_la_LIBADD): Add $(ZLIB).
664 * compress.c: Don't check HAVE_ZLIB_H to include <zlib.h>.
665 (decompress_contents): Don't check HAVE_ZLIB_H.
666 (bfd_compress_section_contents): Likewise.
667 (bfd_get_full_section_contents): Likewise.
668 (bfd_init_section_decompress_status): Likewise.
669 (bfd_init_section_compress_status): Likewise.
670 * configure.ac (AM_ZLIB): Removed.
671 (zlibdir): New. AC_SUBST.
672 (zlibinc): Likewise.
673 Add --with-system-zlib.
674 * Makefile.in: Regenerated.
675 * acinclude.m4: Likewise.
676 * config.in: Likewise.
677 * configure: Likewise.
678 * doc/Makefile.in: Likewise.
679
680 2015-03-27 Alan Modra <amodra@gmail.com>
681
682 PR ld/15228
683 PR ld/18167
684 * elflink.c (elf_merge_st_other): Add "sec" parameter. Don't set
685 protected_def when symbol section is read-only. Adjust all calls.
686 * elf-bfd.h (struct elf_link_hash_entry): Update protected_def comment.
687
688 2015-03-26 Tejas Belagod <tejas.belagod@arm.com>
689
690 * elfnn-aarch64.c (aarch64_build_one_stub): Replace the call to generic
691 _bfd_final_link_relocate with aarch64_relocate.
692
693 2015-03-26 H.J. Lu <hongjiu.lu@intel.com>
694
695 PR ld/18160
696 * elflink.c (elf_gc_sweep): Skip if relocation is incompatible.
697 (bfd_elf_gc_sections): Likewise.
698
699 2015-03-25 Marcus Shawcroft <marcus.shawcroft@arm.com>
700
701 * elfnn-aarch64.c (_bfd_aarch64_resize_stubs): Adjust stub section
702 size for initial branch.
703 (elfNN_aarch64_build_stubs): Write initial branch.
704 _bfd_aarch64_decode_(elfNN_aarch64_output_arch_local_syms): Write
705 mapping symbol on initial branch.
706
707 2015-03-25 Marcus Shawcroft <marcus.shawcroft@arm.com>
708
709 * elfnn-aarch64.c (_bfd_aarch64_erratum_835769_scan):
710 Update erratum count.
711
712 2015-03-25 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
713
714 * elflink.c (_bfd_elf_gc_mark_extra_sections): Don't break on
715 first matching debug section.
716
717 2015-03-24 H.J. Lu <hongjiu.lu@intel.com>
718
719 PR gas/18087
720 * compress.c (bfd_compress_section_contents): Don't write the
721 zlib header and set contents as well as compress_status if
722 compression didn't make the section smaller.
723 (bfd_init_section_compress_status): Don't check compression
724 size here.
725
726 2015-03-24 Nick Clifton <nickc@redhat.com>
727
728 PR binutils/17512
729 * coffgen.c (coff_get_normalized_symtab): Fix test for out of
730 range auxillary sections.
731
732 2015-03-24 Marcus Shawcroft <marcus.shawcroft@arm.com>
733
734 * elfnn-aarch64.c (_bfd_aarch64_create_or_find_stub_sec): Factor
735 code into:
736 (_bfd_aarch64_get_stub_for_link_section): Define.
737
738 2015-03-24 Marcus Shawcroft <marcus.shawcroft@arm.com>
739
740 * elfnn-aarch64.c (_bfd_aarch64_create_or_find_stub_sec): Adjust
741 update of section_group[].stub_sec.
742
743 2015-03-24 Marcus Shawcroft <marcus.shawcroft@arm.com>
744
745 * elfnn-aarch64.c (struct aarch64_erratum_835769_fix) Remove.
746 (erratum_835769_scan) Drop fix_table_size_p and fixes_p arguments.
747 Delete fixes, fix_table_size and associated code. Call
748 _bfd_aarch64_add_stub_entry_in_group. Rename to...
749 (bfd_aarch64_erratum_835769_scan): Define.
750 (elfNN_aarch64_size_stubs): Delete erratum_835769_fixes,
751 erratum_835769_fix_table_size, i and associated code. Relocate
752 call to _bfd_aarch64_erratum_835769_scan. Delete adhoc stub size
753 correction. Delete construction of stub entry from
754 erratum_835769_fixes array.
755
756 2015-03-24 Marcus Shawcroft <marcus.shawcroft@arm.com>
757
758 * elfnn-aarch64.c (elfNN_aarch64_size_stubs): Use
759 _bfd_aarch64_add_stub_entry_in_group.
760
761 2015-03-24 Alan Modra <amodra@gmail.com>
762
763 * elf64-ppc.c (ppc64_elf_relocate_section): Report overflow to
764 stubs, even those for undefined weak symbols. Otherwise, don't
765 report relocation overflow on branches to undefined strong
766 symbols. Fix memory leak.
767 * elf32-ppc.c (ppc_elf_relocate_section): Don't report relocation
768 overflow on branches to undefined strong symbols.
769
770 2015-03-23 Keith Seitz <keiths@redhat.com>
771
772 * elfnn-aarch64.c (_bfd_aarch64_create_or_find_stub_sec): Add
773 missing ';'.
774
775 2015-03-23 Marcus Shawcroft <marcus.shawcroft@arm.com>
776
777 * elfnn-aarch64.c (erratum_835769_scan): Factor stub name
778 construction into...
779 (_bfd_aarch64_erratum_835769_stub_name): Define.
780
781 2015-03-23 Marcus Shawcroft <marcus.shawcroft@arm.com>
782
783 * elfnn-aarch64.c (elfNN_aarch64_size_stubs): Factor out
784 stub resize code into...
785 (bfd_aarch64_resize_stubs): Define.
786
787 2015-03-23 Marcus Shawcroft <marcus.shawcroft@arm.com>
788
789 * elfnn-aarch64.c (_bfd_aarch64_create_or_find_stub_sec): Factor stub
790 creation code into...
791 (bfd_aarch64_create_stub_section): Define.
792
793 2015-03-23 Marcus Shawcroft <marcus.shawcroft@arm.com>
794
795 * elfnn-aarch64.c (_bfd_aarch64_create_or_find_stub_sec): Rename
796 from elf_aarch64_create_or_find_stub_sec.
797 (_bfd_aarch64_add_stub_entry_in_group): Rename from
798 elfNN_aarch64_add_stub. Call
799 _bfd_aarch64_create_or_find_stub_sec.
800 (elfNN_aarch64_size_stubs, elfNN_aarch64_size_stubs): Call
801 _bfd_aarch64_add_stub_entry_in_group.
802
803 2015-03-23 Marcus Shawcroft <marcus.shawcroft@arm.com>
804
805 * elfnn-aarch64.c (erratum_835769_scan) Add comment. Reverse
806 sense of boolean return.
807 (elfNN_aarch64_size_stubs): Adjust for above.
808
809 2015-03-23 Marcus Shawcroft <marcus.shawcroft@arm.com>
810
811 * elfnn-aarch64.c (elf_aarch64_create_or_find_stub_sec):
812 Remove unused parameter.
813 (elfNN_aarch64_size_stubs): Adjust for above.
814
815 2015-03-23 Marcus Shawcroft <marcus.shawcroft@arm.com>
816
817 * elfnn-aarch64.c (elfNN_aarch64_size_stubs): Remove bfd_indx.
818
819 2015-03-23 Marcus Shawcroft <marcus.shawcroft@arm.com>
820
821 * elfnn-aarch64.c (aarch64_erratum_835769_fixes)
822 (num_aarch64_erratum_835769_fixes): Remove.
823 (elfNN_aarch64_size_stubs): Remove assignments to above.
824
825 2015-03-23 Marcus Shawcroft <marcus.shawcroft@arm.com>
826
827 * elfnn-aarch64.c (aarch64_mem_op_p): Update comment. Rename rtn
828 to rt2.
829 (aarch64_erratum_seqeunce): Rename rtn to rt2.
830
831 2015-03-23 Marcus Shawcroft <marcus.shawcroft@arm.com>
832
833 * elfnn-aarch64.c (elfNN_aarch64_write_section): Adjust layout.
834
835 2015-03-19 Nick Clifton <nickc@redhat.com>
836
837 * elf32-rl78.c (rl78_cpu_name): New function. Prints the name of
838 the RL78 core based upon the flags.
839 (rl78_elf_merge_private_bfd_data): Handle merging of G13 and G14
840 flags.
841 (rl78_elf_print_private_bfd_data): Use rl78_cpu_name.
842 (elf32_rl78_machine): Always return bfd_mach_rl78.
843
844 2015-03-19 Nick Clifton <nickc@redhat.com>
845
846 PR 18078
847 * compress.c (bfd_compress_section_contents): Do not define this
848 function if it is not used.
849
850 2015-03-18 H.J. Lu <hongjiu.lu@intel.com>
851
852 * compress.c (bfd_compress_section_contents): Make it static.
853 * bfd/bfd-in2.h: Regenerated.
854
855 2015-03-18 Eric Youngdale <eyoungdale@ptc.com>
856
857 PR ld/16598
858 * peicode.h (pe_ILF_build_a_bfd): Add support for creating relocs
859 suitable for the AMD64.
860
861 2015-03-18 Jon Turney <jon.turney@dronecode.org.uk>
862 Nick Clifton <nickc@redhat.com>
863
864 PR binutils/18087
865 * coffgen.c (make_a_section_from_file): Only prepend a z to a
866 debug section's name if the section was actually compressed.
867 * elf.c (_bfd_elf_make_section_from_shdr): Likewise.
868 * compress.c (bfd_init_section_compress_status): Do not compress
869 the section if doing so would make it bigger. In such cases leave
870 the section alone and return COMPRESS_SECTION_NONE.
871
872 2015-03-17 Alan Modra <amodra@gmail.com>
873
874 * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Return count of 0
875 on nothing to do, before malloc of returned symbol array.
876
877 2015-03-16 Nick Clifton <nickc@redhat.com>
878
879 * elf32-rx.c (elf32_rx_relax_delete_bytes): If the relocs are not
880 stored in the elf_section_data structure then load them as
881 necessary.
882
883 2015-03-14 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
884
885 * elf-s390-common.c (elf_s390_elf_sort_relocs_p): Don't sort
886 relocs against code sections.
887 * elf32-s390.c: Define elf_backend_sort_relocs_p.
888 * elf64-s390.c: Likewise.
889
890 2015-03-11 Alan Modra <amodra@gmail.com>
891
892 * elf32-ppc.c (ppc_elf_get_synthetic_symtab): Examine stubs in
893 reverse order. Account for larger size of __tls_get_addr_opt stub.
894
895 2015-03-10 Yuri Gribov <y.gribov@samsung.arm>
896
897 PR ld/16572
898 * elf32-arm.c (elf32_arm_final_link_relocate): Remove support for
899 ELF_ARM_HASENTRY.
900 (elf32_arm_print_private_bfd_data): Likewise.
901
902 2015-03-06 Nick Clifton <nickc@redhat.com>
903
904 PR binutils/17765
905 * elflink.c (put_value): Like previous delta, but for the 32-bit
906 case.
907
908 2015-03-05 Nick Clifton <nickc@redhat.com>
909
910 PR binutils/17765
911 * elflink.c (put_value): Avoid using an undefined shift
912 operation.
913
914 2015-03-05 H.J. Lu <hongjiu.lu@intel.com>
915
916 PR ld/pr15228
917 PR ld/pr17709
918 * elf-bfd.h (elf_backend_data): Add extern_protected_data.
919 * elf32-i386.c (elf_backend_extern_protected_data): New.
920 Defined to 1.
921 * elf64-x86-64.c (elf_backend_extern_protected_data): Likewise.
922 * elflink.c (_bfd_elf_adjust_dynamic_copy): Don't error on
923 copy relocs against protected symbols if extern_protected_data
924 is true.
925 (_bfd_elf_symbol_refs_local_p): Don't return true on protected
926 non-function symbols if extern_protected_data is true.
927 * elfxx-target.h (elf_backend_extern_protected_data): New.
928 Default to 0.
929 (elfNN_bed): Initialize extern_protected_data with
930 elf_backend_extern_protected_data.
931
932 2015-03-05 Nick Clifton <nickc@redhat.com>
933
934 PR binutils/18025
935 * coffgen.c (coff_find_nearest_line_with_names): If the dwarf2
936 lookup fails, check for an address bias in the dwarf info, and if
937 one exists, retry the lookup with the biased value.
938 * dwarf2.c (_bfd_dwarf2_find_symbol_bias): New function.
939 Determines if a bias exists bewteen the addresses of functions
940 based on DWARF information vs symbol table information.
941 * libbfd-in.h (_bfd_dwarf2_find_symbol_bias): Prototype.
942 * libbfd.h: Regenerate.
943
944 2015-03-04 Marcus Shawcroft <marcus.shawcroft@arm.com>
945
946 * elfxx-aarch64.c (decode_add_imm, decode_movw_imm)
947 (decode_tst_branch_ofs_14, decode_ld_lit_ofs_19)
948 (decode_cond_branch_ofs_19, decode_branch_ofs_26): Remove.
949
950 2015-03-04 Marcus Shawcroft <marcus.shawcroft@arm.com>
951
952 * elfnn-aarch64.c (aarch64_build_one_stub): Call abort.
953 (aarch64_size_one_stub): Likewise.
954 (aarch64_map_one_stub): Likewise.
955
956 2015-03-04 Andreas Arnez <arnez@linux.vnet.ibm.com>
957
958 * cpu-s390.c (N): New macro.
959 (bfd_s390_31_arch): New. Define only if default target word size
960 is 64 bits. Otherwise define...
961 (bfd_390_64_arch): ...this. Make static.
962 (bfd_s390_arch): Define according to the default target word size.
963 Let the 'next' field point to the alternate arch.
964
965 2015-03-04 Richard Sandiford <richard.sandiford@arm.com>
966
967 PR gas/17843
968 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Expect
969 R_AARCH64_TLSLE_MOVW_TPREL_G0_NC and R_AARCH64_TLSLE_MOVW_TPREL_G1_NC
970 to be used with MOVK rather than MOVZ.
971
972 2015-03-03 DJ Delorie <dj@redhat.com>
973
974 * elf32-rl78.c (rl78_elf_relax_section): Only relax ADDR16's if
975 there's a symbol.
976
977 2015-02-28 Alan Modra <amodra@gmail.com>
978
979 * elf32-ppc.c (ppc_elf_tls_setup): Set no_tls_get_addr_opt if
980 not PLT_NEW.
981
982 2015-02-27 H.J. Lu <hongjiu.lu@intel.com>
983
984 * elf32-i386.c (need_convert_mov_to_lea): New.
985 (elf_i386_check_relocs): Set need_convert_mov_to_lea if needed.
986 (elf_i386_convert_mov_to_lea): Return TRUE if
987 need_convert_mov_to_lea is unset.
988 * elf64-x86-64.c (need_convert_mov_to_lea): New.
989 (elf_x86_64_check_relocs): Set need_convert_mov_to_lea if needed.
990 (elf_x86_64_convert_mov_to_lea): Return TRUE if
991 need_convert_mov_to_lea is unset.
992
993 2015-02-27 Nick Clifton <nickc@redhat.com>
994
995 PR binutils/17910
996 * coffgen.c (_bfd_coff_internal_syment_name): Only check for
997 string length overflow when the string table length is actually
998 set.
999
1000 2015-02-27 Marcus Shawcroft <marcus.shawcroft@arm.com>
1001
1002 * bfd/bfd-in2.h: Regenerate.
1003 * bfd/libbfd.h: Regenerate.
1004
1005 2015-02-26 Marcus Shawcroft <marcus.shawcroft@arm.com>
1006
1007 * elfnn-aarch64.c (elfNN_aarch64_howto_table): Fix
1008 TLSDESC_LD_PREL19 field width and masks.
1009 (aarch64_tls_transition_without_check)
1010 (aarch64_reloc_got_type, elfNN_aarch64_final_link_relocate)
1011 (elfNN_aarch64_tls_relax, elfNN_aarch64_relocate_section)
1012 (elfNN_aarch64_gc_sweep_hook, elfNN_aarch64_check_relocs): Handle
1013 BFD_RELOC_AARCH64_TLSDESC_LD_PREL19.
1014 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend)
1015 (_bfd_aarch64_elf_resolve_relocation): Likewise.
1016
1017 2015-02-26 Marcus Shawcroft <marcus.shawcroft@arm.com>
1018
1019 * elfnn-aarch64.c (IS_AARCH64_TLSDESC_RELOC): Reorder R_TYPE
1020 tests.
1021 (aarch64_tls_transition_without_check)
1022 (aarch64_reloc_got_type, elfNN_aarch64_final_link_relocate)
1023 (elfNN_aarch64_tls_relax, elfNN_aarch64_relocate_section)
1024 (elfNN_aarch64_gc_sweep_hook, elfNN_aarch64_check_relocs): Handle
1025 BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21.
1026 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend)
1027 (_bfd_aarch64_elf_resolve_relocation): Likewise.
1028 * reloc.c (BFD_RELOC_AARCH64_TLSGD_ADR_PREL21): Define.
1029
1030 2015-02-26 Marcus Shawcroft <marcus.shawcroft@arm.com>
1031
1032 * elfnn-aarch64.c (IS_AARCH64_TLS_RELOC)
1033 (elfNN_aarch64_howto_table, aarch64_tls_transition_without_check)
1034 (aarch64_reloc_got_type, elfNN_aarch64_final_link_relocate)
1035 (elfNN_aarch64_tls_relax, elfNN_aarch64_relocate_section)
1036 (elfNN_aarch64_gc_sweep_hook, elfNN_aarch64_check_relocs): Handle
1037 BFD_RELOC_AARCH64_TLSGD_ADR_PREL21.
1038 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend)
1039 (_bfd_aarch64_elf_resolve_relocation): Likewise.
1040 * reloc.c (BFD_RELOC_AARCH64_TLSGD_ADR_PREL21): Define.
1041
1042 2015-02-26 Marcus Shawcroft <marcus.shawcroft@arm.com>
1043
1044 * elfnn-aarch64.c: (TLSIE_LD_GOTTREL_PREL19): Fix HOWTO bit field width.
1045 (aarch64_tls_transition_without_check, aarch64_reloc_got_type)
1046 (elfNN_aarch64_final_link_relocate, elfNN_aarch64_tls_relax)
1047 (elfNN_aarch64_relocate_section, elfNN_aarch64_gc_sweep_hook)
1048 (elfNN_aarch64_check_relocs): Handle
1049 BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19.
1050
1051 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend)
1052 (_bfd_aarch64_elf_resolve_relocation): Likewise.
1053
1054 2015-02-26 Marcus Shawcroft <marcus.shawcroft@arm.com>
1055
1056 * elfnn-aarch64.c: (TLSDESC_CALL): Fix HOWTO bit field width.
1057
1058 2015-02-26 Marcus Shawcroft <marcus.shawcroft@arm.com>
1059
1060 * elfnn-aarch64.c (TLSLE_MOVW_TPREL_G2)
1061 (TLSLE_MOVW_TPREL_G1, TLSLE_MOVW_TPREL_G1_NC)
1062 (TLSLE_MOVW_TPREL_G0, TLSLE_MOVW_TPREL_G0_NC): Fix bit field
1063 width.
1064
1065 2015-02-26 Marcus Shawcroft <marcus.shawcroft@arm.com>
1066
1067 * elfnn-aarch64.c: (TLSIE_MOVW_GOTTPREL_G0_NC): Fix HOWTO bit
1068 field width.
1069
1070 2015-02-26 Nick Clifton <nickc@redhat.com>
1071
1072 PR binutils/17512
1073 * coffcode.h (coff_compute_section_file_positions): Report
1074 negative page sizes.
1075 * elf.c (elf_fake_sections): Handle excessive alignmment powers.
1076 (assign_file_positions_for_non_load_sections): Replace assertion
1077 with an error message.
1078 (rewrite_elf_program_header): Handle excessive segment
1079 alignments.
1080 * mach-o.c (bfd_mach_o_read_section_32): Likewise.
1081 (bfd_mach_o_read_section_64): Likewise.
1082 * peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Use %B to
1083 print a bfd name, not %A.
1084
1085 2015-02-26 Alan Modra <amodra@gmail.com>
1086
1087 * elf64-ppc.c (plt_stub_size, build_plt_stub): Don't build
1088 thread-safe stubs for iplt.
1089 (build_tls_get_addr_stub): Restore r2 immediately after call.
1090
1091 2015-02-26 Terry Guo <terry.guo@arm.com>
1092
1093 * elf32-arm.c (elf32_arm_merge_eabi_attributes): Update how we
1094 merge Tag_ABI_HardFP_use.
1095
1096 2015-02-26 Alan Modra <amodra@gmail.com>
1097
1098 * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Heed -z nocopyreloc.
1099 Use text relocs rather than giving an error on trying to use
1100 .dynbss for protected shared lib vars.
1101 * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Likewise.
1102
1103 2015-02-25 Andrew Burgess <andrew.burgess@embecosm.com>
1104
1105 * elf32-avr.c (struct elf_avr_section_data): New structure.
1106 (struct avr_relax_info): New structure.
1107 (elf_avr_new_section_hook): New function.
1108 (struct elf_avr_section_data): Add relax_info.
1109 (get_avr_relax_info): New function.
1110 (init_avr_relax_info): New function.
1111 (elf32_avr_relax_delete_bytes): Find next property record before
1112 deleting bytes. When deleting don't move bytes beyond the next
1113 property record.
1114 (avr_elf32_assign_records_to_section): New function.
1115 (avr_property_record_compare): New function.
1116 (avr_load_all_property_sections): New function.
1117 (elf32_avr_relax_section): Load property data. After relaxing the
1118 section, move any .align directives that have enough deleted bytes
1119 before them.
1120 (bfd_elf32_new_section_hook): Define.
1121
1122 2015-02-25 Andrew Burgess <andrew.burgess@embecosm.com>
1123
1124 * elf32-avr.h (struct avr_property_header): New strucure.
1125 (avr_elf32_load_property_records): Declare.
1126 (avr_elf32_property_record_name): Declare.
1127 * elf32-avr.c: Add bfd_stdint.h include.
1128 (retrieve_local_syms): New function.
1129 (get_elf_r_symndx_section): New function.
1130 (get_elf_r_symndx_offset): New function.
1131 (internal_reloc_compare): New function.
1132 (struct avr_find_section_data): New structure.
1133 (avr_is_section_for_address): New function.
1134 (avr_find_section_for_address): New function.
1135 (avr_elf32_load_records_from_section): New function.
1136 (avr_elf32_load_property_records): New function.
1137 (avr_elf32_property_record_name): New function.
1138
1139 2015-02-25 Andrew Burgess <andrew.burgess@embecosm.com>
1140
1141 * elf32-avr.h (AVR_PROPERTY_RECORD_SECTION_NAME): Define.
1142 (AVR_PROPERTY_RECORDS_VERSION): Define.
1143 (AVR_PROPERTY_SECTION_HEADER_SIZE): Define.
1144 (struct avr_property_record): New structure.
1145
1146 2015-02-24 Nick Clifton <nickc@redhat.com>
1147
1148 * elf32-v850.c (v850_set_note): New function. Creates a Renesas
1149 style note entry.
1150 (v850_elf_make_note_section): New function. Creates a note
1151 section.
1152 (v850_elf_create_sections): New function. Create a note section
1153 if one is not already present.
1154 (v850_elf_set_note): New function. Adds a note to a bfd.
1155 (v850_elf_copy_private_bfd_data): New function. Copies V850
1156 notes.
1157 (v850_elf_merge_notes): New function. Merges V850 notes.
1158 (print_v850_note): New function. Displays a V850 note.
1159 (v850_elf_print_notes): New function. Displays all notes attached
1160 to a bfd.
1161 (v850_elf_merge_private_bfd_data): Call v850_elf_merge_notes.
1162 (v850_elf_print_private_bfd_data): Call v850_elf_print_notes.
1163 (v850_elf_fake_sections): Set the type of the V850 note section.
1164 * bfd-in.h (v850_elf_create_sections): Add prototype.
1165 (v850_elf_set_note): Add prototype.
1166 * bfd-in2.h: Regenerate.
1167
1168 2015-02-24 Nick Clifton <nickc@redhat.com>
1169
1170 * configure.ac (AC_CHECK_HEADERS): Add wctype.h.
1171 * configure: Regenerate.
1172 * config.in: Regenerate.
1173 * peXXigen.c: Include wctype.h if HAVE_WCTYPE_H is defined.
1174 (u16_mbtowc): Use wint_t types if HAVE_WCTYPE_H is defined.
1175 (rsrc_cmp): Use towlower instead of wcsncasecmp if HAVE_WCTYPE_H
1176 is defined.
1177
1178 2015-02-24 Nick Clifton <nickc@redhat.com>
1179
1180 * pdp11.c (set_section_contents): Pad the .text and .data sections
1181 to their aligned sizes.
1182
1183 2015-02-23 Yoshinori Sato <ysato@users.sourceforge.jp>
1184
1185 * config.bfd: Add h8300-*-linux.
1186 * configure.ac: Add h8300_elf32_linux_vec.
1187 * configure: Regenerate.
1188 * elf32-h8300.c: Likewise.
1189 * targets.c(_bfd_target_vector): Likewise.
1190
1191 2015-02-23 Nick Clifton <nickc@redhat.com>
1192
1193 PR 17914
1194 * cpu-w65.c: Correct typos in license notice.
1195
1196 PR 17940
1197 * elf32-msp430.c (msp430_elf_relax_delete_bytes): Adjust debug
1198 symbols at end of sections. Adjust function sizes.
1199
1200 2015-02-20 Andreas Arnez <arnez@linux.vnet.ibm.com>
1201
1202 * elf-bfd.h (elfcore_write_s390_vxrs_low): Add prototype.
1203 (elfcore_write_s390_vxrs_high): Likewise.
1204 * elf.c (elfcore_grok_s390_vxrs_low): New function.
1205 (elfcore_grok_s390_vxrs_high): New function.
1206 (elfcore_grok_note): Call them.
1207 (elfcore_write_s390_vxrs_low): New function.
1208 (elfcore_write_s390_vxrs_high): New function.
1209 (elfcore_write_register_note): Call them.
1210
1211 2015-02-19 Branko Drevensek <branko.drevensek@gmail.com>
1212
1213 PR 17995
1214 * verilog.c (verilog_write_record): Correct buffer size.
1215
1216 2015-02-19 Alan Modra <amodra@gmail.com>
1217
1218 * elflink.c (_bfd_elf_define_linkage_sym): Set 'bed' earlier.
1219
1220 2015-02-19 Alan Modra <amodra@gmail.com>
1221
1222 PR ld/4317
1223 * elflink.c (elf_link_input_bfd): Drop undefined local syms.
1224 (elf_link_output_extsym): Drop local and global undefined syms.
1225 Tidy. Expand comment.
1226
1227 2015-02-17 Alan Modra <amodra@gmail.com>
1228
1229 PR ld/17975
1230 * elflink.c (struct elf_outext_info): Remove need_second_pass
1231 and second_pass.
1232 (elf_link_output_extsym): Delete code handling second forced
1233 local pass. Move code emitting NULL STT_FILE symbol later, so
1234 that it can be omitted if forced local is stripped. Don't
1235 emit the NULL STT_FILE if no file symbols have been output.
1236 (bfd_elf_final_link): Remove second forced local pass.
1237 * elf32-ppc.c (add_stub_sym): Set linker_def on linker syms.
1238 (ppc_elf_size_dynamic_sections): Likewise.
1239 * elf64-ppc.c (ppc_build_one_stub): Likewise.
1240 (build_global_entry_stubs): Likewise.
1241 (ppc64_elf_build_stubs): Likewise.
1242
1243 2015-02-16 H.J. Lu <hongjiu.lu@intel.com>
1244
1245 PR ld/17975
1246 * elflink.c (elf_link_output_extsym): Only check filesym_count
1247 when outputting a NULL FILE symbol. Set second_pass_sym to
1248 h->forced_local && !h->root.linker_def.
1249
1250 2015-02-15 H.J. Lu <hongjiu.lu@intel.com>
1251
1252 * elf32-i386.c (elf_i386_always_size_sections): Set root.linker_def
1253 on _TLS_MODULE_BASE_.
1254 * elf64-x86-64.c (elf_x86_64_always_size_sections): Likewise.
1255
1256 2015-02-15 Alan Modra <amodra@gmail.com>
1257
1258 * dwarf2.c (read_rangelist): Correct buffer overflow check
1259 Whitespace throughout file.
1260
1261 2015-02-14 Alan Modra <amodra@gmail.com>
1262
1263 PR ld/17973
1264 * bfd.c (struct bfd): Add lto_output.
1265 * linker.c (_bfd_handle_already_linked): Explicitly test for
1266 objects added by the lto plugin.
1267 * opncls.c (_bfd_new_bfd_contained_in): Copy lto_output and
1268 no_export flags from archive.
1269 * archive.c (open_nested_file): New function, setting lto_output
1270 and no_export, extracted from..
1271 (find_nested_archive): ..here. Flip params. Rename from
1272 _bfd_find_nested_archive.
1273 (_bfd_get_elt_at_filepos): Correct var typo. Use open_nested_file.
1274 (_bfd_look_for_bfd_in_cache): Copy no_export.
1275 * elflink.c (elf_link_add_object_symbols): Remove now unnecessary
1276 my_archive->no_export test.
1277 (elf_link_input_bfd): Drop existing lto_output STT_FILE syms.
1278 Don't use the file name when adding lto_output STT_FILE sym.
1279 * bfd-in2.h: Regenerate.
1280
1281 2015-02-13 Alan Modra <amodra@gmail.com>
1282
1283 PR binutils/17512
1284 * elf64-ppc.c (opd_entry_value): Tighten offset check. Remove
1285 now redundant assert.
1286
1287 2015-02-12 Nick Clifton <nickc@redhat.com>
1288
1289 PR binutils/17512
1290 * dwarf.c (read_1_byte, read_1_signed_byte, read_2_bytes)
1291 (read_4_bytes, read_8_bytes, read_n_bytes, read_string)
1292 (read_indirect_string, read_alt_indirect_string)
1293 (read_alt_indirect_ref, read_address, read_abbrevs)
1294 (read_attribute_value, read_attribute, decode_line_info)
1295 (find_abstract_instance_name, read_rangelist)
1296 (scan_unit_for_symbols, parse_comp_unit)
1297 (_bfd_dwarf2_find_nearest_line): Harden DWARF reading code. Pass
1298 end pointers to reading functions and check for offsets taking
1299 pointers out of range. Replace calls to read_*_leb128 with calls
1300 to safe_read_leb128.
1301
1302 (* elf64-ppc.c (opd_entry_value): Add a check for an overlarge
1303 offset.
1304 * syms.c (_bfd_stab_section_find_nearest_line): Add checks for
1305 computed file_name address being before the start of the string
1306 table.
1307
1308 2015-02-11 H.J. Lu <hongjiu.lu@intel.com>
1309
1310 PR ld/17878
1311 * bfd.c (bfd_plugin_format): New.
1312 (bfd): Add plugin_format and plugin_dummy_bfd.
1313 * plugin.c (try_load_plugin): Take a pointer to bfd_boolean
1314 argument to return TRUE if any plugin is found. Set plugin_format.
1315 (has_plugin): New.
1316 (bfd_plugin_target_p): New.
1317 (bfd_plugin_specified_p): Likewise.
1318 (bfd_plugin_target_p): Likewise.
1319 (register_ld_plugin_object_p): Likewise.
1320 (bfd_plugin_set_plugin): Set has_plugin.
1321 (load_plugin): Cache try_load_plugin result.
1322 (bfd_plugin_object_p): Try ld_plugin_object_p first. Check
1323 plugin_format.
1324 * plugin.h (bfd_plugin_target_p): New.
1325 (bfd_plugin_specified_p): Likewise.
1326 (register_ld_plugin_object_p): Likewise.
1327 * bfd-in2.h: Regenerated.
1328
1329 2015-02-11 Pedro Alves <palves@redhat.com>
1330
1331 * libbfd-in.h [__cplusplus]: Open extern "C" scope.
1332 * libcoff-in.h [__cplusplus]: Open extern "C" scope.
1333 * libbfd.h: Regenerate.
1334 * libcoff.h: Regenerate.
1335
1336 * elf-bfd.h [__cplusplus]: Wrap in extern "C".
1337 * mach-o.h [__cplusplus]: Wrap in extern "C".
1338 * som.h [__cplusplus]: Wrap in extern "C".
1339
1340 2015-02-10 Nick Clifton <nickc@redhat.com>
1341
1342 PR binutils/17512
1343 * coffcode.h (styp_to_sec_flags): Use an unsigned long type to
1344 hold the flag bits.
1345 * peXXigen.c (pe_print_reloc): Use unsigned types to hold the
1346 size and number of relocs.
1347 (pe_print_debugdata): Use a 32-bit aligned buffer to store the
1348 codeview record.
1349 * versados.c (process_otr): Check the esdid value before using it
1350 to access the EDATA.
1351
1352 2015-02-09 Ed Maste <emaste@freebsd.org>
1353
1354 * elf32-i386.c (elf_i386_get_plt_sym_val): Avoid incrementing
1355 uninitialized and unused variable.
1356 * elf64-x86-64.c (elf_x86_64_get_plt_sym_val): Likewise.
1357
1358 2015-02-09 Alan Modra <amodra@gmail.com>
1359
1360 * elf32-ppc.c (ppc_elf_relocate_section): Don't segfault on NULL
1361 tls_sec.
1362 * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
1363 * elflink.c (elf_link_output_extsym): Don't assert on NULL tls_sec.
1364
1365 2015-02-09 Alan Modra <amodra@gmail.com>
1366
1367 * elflink.c: Whitespace, formatting fixes.
1368 (elf_link_input_bfd): Clarify comment.
1369 (elf_link_output_extsym): Exclude symbols in linker created
1370 sections when testing for plugin symbols.
1371
1372 2015-02-07 H.J. Lu <hongjiu.lu@intel.com>
1373
1374 PR ld/17935
1375 * elf32-i386.c (elf_i386_readonly_dynrelocs): Also issue a
1376 warning for relocation in readonly section for -z text.
1377 (elf_i386_size_dynamic_sections): Likewise.
1378 * elf64-x86-64.c (elf_x86_64_readonly_dynrelocs): Likewise.
1379 (elf_x86_64_size_dynamic_sections): Likewise.
1380
1381 2015-02-06 H.J. Lu <hongjiu.lu@intel.com>
1382
1383 PR ld/12365
1384 PR ld/14272
1385 * elflink.c (_bfd_elf_fix_symbol_flags): Revert the last change.
1386 (elf_link_input_bfd): Mark the plugin symbol undefined if it is
1387 referenced from a non-IR file.
1388
1389 2015-02-06 Nick Clifton <nickc@redhat.com>
1390
1391 PR binutils/17512
1392 * peXXigen.c (rsrc_print_resource_entries): Add range check for
1393 addresses that wrap around the address space.
1394 (rsrc_parse_entry): Likewise.
1395
1396 2015-02-03 H.J. Lu <hongjiu.lu@intel.com>
1397
1398 PR ld/12365
1399 PR ld/14272
1400 * elflink.c (_bfd_elf_fix_symbol_flags): Mark the plugin symbol
1401 undefined if it is referenced from a non-IR file.
1402
1403 2015-02-03 Nick Clifton <nickc@redhat.com>
1404
1405 PR binutils/17512
1406 * ecoff.c: Use bfd_alloc2 to allocate space for structure arrays.
1407 (_bfd_ecoff_slurp_symbol_table): Check for a negative symbol
1408 index or an out of range fdr index.
1409 * elf-m10300.c (mn10300_info_to_howto): Fix typo in error message.
1410 * elf32-arc.c (arc_info_to_howto_rel): Likewise.
1411 * elf32-avr.c (avr_info_to_howto_rela): Likewise.
1412 * elf32-cr16.c (elf_cr16_info_to_howto): Likewise.
1413 * elf32-cr16c.c (elf_cr16c_info_to_howto_rel): Likewise.
1414 * elf32-cris.c (cris_info_to_howto_rela): Likewise.
1415 * elf32-crx.c (elf_crx_info_to_howto): Likewise.
1416 * elf32-d10v.c (d10v_info_to_howto_rel): Likewise.
1417 * elf32-d30v.c (d30v_info_to_howto_rel): Likewise.
1418 * elf32-epiphany.c (epiphany_info_to_howto_rela): Likewise.
1419 * elf32-fr30.c (fr30_info_to_howto_rela): Likewise.
1420 * elf32-frv.c (frv_info_to_howto_rela): Likewise.
1421 * elf32-i370.c (i370_elf_info_to_howto): Likewise.
1422 * elf32-i960.c (elf32_i960_info_to_howto_rel): Likewise.
1423 * elf32-ip2k.c (ip2k_info_to_howto_rela): Likewise.
1424 * elf32-iq2000.c (iq2000_info_to_howto_rela): Likewise.
1425 * elf32-lm32.c (lm32_info_to_howto_rela): Likewise.
1426 * elf32-m32c.c (m32c_info_to_howto_rela): Likewise.
1427 * elf32-m32r.c (m32r_info_to_howto_rel): Likewise.
1428 * elf32-m68hc11.c (m68hc11_info_to_howto_rel): Likewise.
1429 * elf32-m68hc12.c (m68hc11_info_to_howto_rel): Likewise.
1430 * elf32-mcore.c (mcore_elf_info_to_howto): Likewise.
1431 * elf32-mep.c (mep_info_to_howto_rela): Likewise.
1432 * elf32-metag.c (metag_info_to_howto_rela): Likewise.
1433 * elf32-microblaze.c (microblaze_elf_info_to_howto): Likewise.
1434 * elf32-moxie.c (moxie_info_to_howto_rela): Likewise.
1435 * elf32-msp430.c (msp430_info_to_howto_rela): Likewise.
1436 * elf32-mt.c (mt_info_to_howto_rela): Likewise.
1437 * elf32-nds32.c (nds32_info_to_howto_rel): Likewise.
1438 * elf32-or1k.c (or1k_info_to_howto_rela): Likewise.
1439 * elf32-pj.c (pj_elf_info_to_howto): Likewise.
1440 * elf32-ppc.c (ppc_elf_info_to_howto): Likewise.
1441 * elf32-rl78.c (rl78_info_to_howto_rela): Likewise.
1442 * elf32-rx.c (rx_info_to_howto_rela): Likewise.
1443 * elf32-sh.c (sh_elf_info_to_howto): Likewise.
1444 * elf32-spu.c (spu_elf_info_to_howto): Likewise.
1445 * elf32-v850.c (v850_elf_perform_relocation): Likewise.
1446 * elf32-vax.c (rtype_to_howto): Likewise.
1447 * elf32-visium.c (visium_info_to_howto_rela): Likewise.
1448 * elf32-xgate.c (xgate_info_to_howto_rel): Likewise.
1449 * elf32-xtensa.c (elf_xtensa_info_to_howto_rela): Likewise.
1450 * elf64-alpha.c (elf64_alpha_info_to_howto): Likewise.
1451 * elf64-mmix.c (mmix_info_to_howto_rela): Likewise.
1452 * mach-o.c: Use bfd_alloc2 to allocate space for structure arrays.
1453 (bfd_mach_o_canonicalize_one_reloc): Fix check on out
1454 of range symbol indicies.
1455 (bfd_mach_o_canonicalize_relocs): Check for out of range alloc.
1456 (bfd_mach_o_canonicalize_dynamic_reloc): Likewise.
1457 (bfd_mach_o_build_dysymtab): Likewise.
1458 (bfd_mach_o_write_symtab_content): Set the string table size to
1459 zero upon error.
1460 (bfd_mach_o_read_symtab_symbols): Reset the nsyms value if the
1461 read fails.
1462 * peXXigen.c (pe_print_edata): Check for numeric overflow in edt
1463 fields.
1464 * tekhex.c (first_phase): Check for src pointer reaching end of
1465 buffer.
1466
1467 2015-02-03 Will Newton <will.newton@linaro.org>
1468
1469 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol):
1470 Set st_value to zero for undefined symbols if the reference
1471 is weak or pointer_equality_needed is FALSE.
1472
1473 * elf32-arm.c (elf32_arm_finish_dynamic_symbol): Improve
1474 comment discussing why we clear st_value for some symbols.
1475
1476 2015-02-02 Kuan-Lin Chen <kuanlinchentw@gmail.com>
1477
1478 * elf32-nds32.c (nds32_get_section_contents): Add one more argument.
1479 (nds32_elf_relocate_section): Do not relocate R_NDS32_LONGJUMP7.
1480
1481 2015-01-29 Alan Modra <amodra@gmail.com>
1482
1483 * elf64-ppc.c (ppc64_elf_relocate_section): Correct GOT_TLSLD
1484 optimization. Tidy mask for GOT_TLSGD optimization.
1485 * elf32-ppc.c (ppc_elf_relocate_section): Likewise. Correct
1486 location of nop zapping high insn too.
1487
1488 2015-01-28 Alan Modra <amodra@gmail.com>
1489
1490 * elf64-ppc.h (struct ppc64_elf_params): Add "object_in_toc".
1491 * elf64-ppc.c (ppc64_elf_add_symbol_hook): Assume that global symbols
1492 in .toc indicate xlc compiled code that might require a rw .toc.
1493
1494 2015-01-28 James Bowman <james.bowman@ftdichip.com>
1495
1496 * Makefile.am: Add FT32 files.
1497 * archures.c (enum bfd_architecture): Add bfd_arch_ft32.
1498 (bfd_mach_ft32): Define.
1499 (bfd_ft32_arch): Declare.
1500 (bfd_archures_list): Add bfd_ft32_arch.
1501 * config.bfd: Handle FT32.
1502 * configure.ac: Likewise.
1503 * cpu-ft32.c: New file.
1504 * elf32-ft32.c: New file.
1505 * reloc.c (BFD_RELOC_FT32_10, BFD_RELOC_FT32_20, BFD_RELOC_FT32_17,
1506 BFD_RELOC_FT32_18): Define.
1507 * targets.c (_bfd_target_vector): Add ft32_elf32_vec.
1508 * bfd-in2.h: Regenerate.
1509 * libbfd.h: Regenerate.
1510 * Makefile.in: Regenerate.
1511 * configure: Regenerate.
1512 * po/SRC-POTFILES.in: Regenerate.
1513
1514 2015-01-27 Nick Clifton <nickc@redhat.com>
1515
1516 PR binutils/17512
1517 * pdp11.c (aout_get_external_symbols): Return false if there are
1518 no symbols.
1519
1520 * dwarf2.c (concat_filename): Check for an empty directory table.
1521 (scan_unit_for_symbols): Check for reading off the end of the
1522 unit.
1523 (parse_comp_unit): Check for a DW_AT_comp_dir attribute with a
1524 non-string form.
1525 * elf64-ppc.c (opd_entry_value): Fail if there are no relocs
1526 available.
1527
1528 2015-01-26 Kuan-Lin Chen <kuanlinchentw@gmail.com>
1529
1530 * elf32-nds32.c (nds32_elf_pick_relax): Fix again setting.
1531
1532 2015-01-22 DJ Delorie <dj@redhat.com>
1533
1534 * elf32-m32c.c (m32c_apply_reloc_24): New.
1535 (m32c_elf_howto_table): Use it for R_M32C_24.
1536 (m32c_elf_relocate_section): Handle R_M32C_24 specially.
1537
1538 2015-01-22 Nick Clifton <nickc@redhat.com>
1539
1540 PR binutils/17512
1541 * coffcode.h (handle_COMDAT): When searching for the section
1542 symbol, make sure that there is space left in the symbol table.
1543 * vms-alpha.c (_bfd_vms_slurp_ehdr): Add range checks.
1544
1545 2015-01-21 Nick Clifton <nickc@redhat.com>
1546
1547 PR binutils/17512
1548 * coffcode.h (coff_set_arch_mach_hook): Check return value from
1549 bfd_malloc.
1550 (coff_slurp_line_table): Return FALSE if the line number
1551 information was corrupt.
1552 (coff_slurp_symbol_table): Return FALSE if the symbol information
1553 was corrupt.
1554 * mach-o.c (bfd_mach_o_bfd_copy_private_header_data): Always
1555 initialise the fields of the dyld_info structure.
1556 (bfd_mach_o_build_exec_seg_command): Replace assertion with an
1557 error message and a return value.
1558 (bfd_mach_o_layout_commands): Change the function to boolean.
1559 Return FALSE if the function fails.
1560 (bfd_mach_o_build_commands): Fail if bfd_mach_o_layout_commands
1561 fails.
1562 (bfd_mach_o_read_command): Fail if an unrecognised command is
1563 encountered.
1564 * peXXigen.c (_bfd_XXi_swap_aouthdr_in): Set bfd_error if the
1565 read fails.
1566 (slurp_symtab): Check the return from bfd_malloc.
1567 (_bfd_XX_bfd_copy_private_bfd_data_common): Fail if the copy
1568 encountered an error.
1569 (_bfd_XXi_final_link_postscript): Fail if a section could not be
1570 copied.
1571 * peicode.h (pe_bfd_object_p): Fail if the header could not be
1572 swapped in.
1573 * tekhex.c (first_phase): Fail if the section is too big.
1574 * versados.c (struct esdid): Add content_size field.
1575 (process_otr): Use and check the new field.
1576 (versados_get_section_contents): Check that the section exists and
1577 that the requested data is available.
1578
1579 2015-01-20 Chung-Lin Tang <cltang@codesourcery.com>
1580
1581 * elf32-nios2.c (elf_backend_default_execstack): Define as 0.
1582
1583 2015-01-20 Alan Modra <amodra@gmail.com>
1584
1585 PR ld/17615
1586 * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Don't drop
1587 ELF_COMMON_DEF syms.
1588
1589 2015-01-19 Alan Modra <amodra@gmail.com>
1590
1591 PR ld/17615
1592 * elf-bfd.h (ELF_COMMON_DEF_P): Note that this might be true for
1593 linker script assignments too.
1594 * elflink.c (elf_gc_sweep_symbol): Don't drop ELF_COMMON_DEF syms.
1595 (bfd_elf_gc_mark_dynamic_ref_symbol): Similarly.
1596
1597 2015-01-19 Alan Modra <amodra@gmail.com>
1598
1599 * elf32-bfin.c (bfin_bfd_reloc_type_lookup): Correct loop iteration
1600 to allow return of first howto.
1601 * elf32-fr30.c (fr30_reloc_type_lookup): Likewise.
1602 * elf32-m32c.c (m32c_reloc_type_lookup): Likewise.
1603 * elf32-moxie.c (moxie_reloc_type_lookup): Likewise.
1604 * elf32-or1k.c (or1k_reloc_type_lookup): Likewise.
1605 * elf32-rl78.c (rl78_reloc_type_lookup): Likewise.
1606 * elf32-rx.c (rx_reloc_type_lookup): Likewise.
1607 * elf32-tilepro.c (tilepro_reloc_type_lookup): Likewise.
1608 * elf32-xstormy16.c (xstormy16_reloc_type_lookup): Likewise.
1609 * elfxx-tilegx.c (tilegx_reloc_type_lookup): Likewise.
1610 * elf32-nios2.c (nios2_reloc_map): Add mapping for R_NIOS2_NONE.
1611 * elf32-spu.c (spu_elf_bfd_to_reloc_type): Allow return of R_SPU_NONE.
1612 (spu_elf_reloc_type_lookup): Adjust to suit.
1613
1614 2015-01-19 Alan Modra <amodra@gmail.com>
1615
1616 * bfd-in.h (bfd_get_section_limit_octets): New define, extracted from..
1617 (bfd_get_section_limit): ..here.
1618 * reloc.c (bfd_perform_relocation): Correct bfd_reloc_outofrange check.
1619 (bfd_install_relocation, _bfd_final_link_relocate): Add same check here.
1620 * elf32-sh.c (sh_elf_reloc): Correct bfd_reloc_outofrange check.
1621 * elf32-ppc.c (ppc_elf_addr16_ha_reloc): Remove duplicated
1622 bfd_reloc_outofrange check.
1623 * bfd-in2.h: Regenerate.
1624
1625 * cpu-ns32k.c (_bfd_do_ns32k_reloc_contents): Return bfd_reloc_ok
1626 on zero size relocs.
1627 * ecoff.c (ecoff_reloc_link_order): Likewise.
1628 * elf32-nds32.c (nds32_relocate_contents): Likewise.
1629 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
1630
1631 * reloc.c (_bfd_relocate_contents): Don't bomb on zero size relocs.
1632 (_bfd_clear_contents): Likewise.
1633 * elfxx-mips.c (mips_elf_obtain_contents): Likewise.
1634 (mips_elf_perform_relocation): Likewise.
1635
1636 * aoutx.h (aout_link_reloc_link_order): Allow for NULL return
1637 from malloc on zero size alloc.
1638 * cofflink.c (_bfd_coff_reloc_link_order): Likewise.
1639 * elflink.c (elf_reloc_link_order): Likewise.
1640 * linker.c (_bfd_generic_reloc_link_order): Likewise.
1641 * pdp11.c (aout_link_reloc_link_order): Likewise.
1642 * xcofflink.c (xcoff_reloc_link_order): Likewise.
1643
1644 * aoutx.h (howto_table_ext): Ensure NONE relocs have size 3,
1645 bitsize 0, and complain_overflow_dont.
1646 * coff-sparc.c (coff_sparc_howto_table): Likewise.
1647 * elf-hppa.h (elf_hppa_howto_table): Likewise.
1648 * elf-m10200.c (elf_mn10200_howto_table): Likewise.
1649 * elf-m10300.c (elf_mn10300_howto_table): Likewise.
1650 * elf32-arc.c (elf_arc_howto_table): Likewise.
1651 * elf32-arm.c (elf32_arm_howto_table_1): Likewise.
1652 * elf32-avr.c (elf_avr_howto_table): Likewise.
1653 * elf32-bfin.c (bfin_howto_table): Likewise.
1654 * elf32-cr16.c (cr16_elf_howto_table): Likewise.
1655 * elf32-cris.c (cris_elf_howto_table): Likewise.
1656 * elf32-crx.c (crx_elf_howto_table): Likewise.
1657 * elf32-d10v.c (elf_d10v_howto_table): Likewise.
1658 * elf32-d30v.c (elf_d30v_howto_table): Likewise.
1659 * elf32-dlx.c (dlx_elf_howto_table): Likewise.
1660 * elf32-epiphany.c (epiphany_elf_howto_table): Likewise.
1661 * elf32-fr30.c (fr30_elf_howto_table): Likewise.
1662 * elf32-frv.c (elf32_frv_howto_table): Likewise.
1663 * elf32-h8300.c (h8_elf_howto_table): Likewise.
1664 * elf32-i370.c (i370_elf_howto_raw): Likewise.
1665 * elf32-i386.c (elf_howto_table): Likewise.
1666 * elf32-i860.c (elf32_i860_howto_table): Likewise.
1667 * elf32-i960.c (elf32_i960_relocate): Likewise.
1668 * elf32-ip2k.c (ip2k_elf_howto_table): Likewise.
1669 * elf32-iq2000.c (iq2000_elf_howto_table): Likewise.
1670 * elf32-lm32.c (lm32_elf_howto_table): Likewise.
1671 * elf32-m32c.c (m32c_elf_howto_table): Likewise.
1672 * elf32-m32r.c (m32r_elf_howto_table): Likewise.
1673 * elf32-m68hc11.c (elf_m68hc11_howto_table): Likewise.
1674 * elf32-m68hc12.c (elf_m68hc11_howto_table): Likewise.
1675 * elf32-m68k.c (howto_table): Likewise.
1676 * elf32-mcore.c (mcore_elf_howto_raw): Likewise.
1677 * elf32-mep.c (mep_elf_howto_table): Likewise.
1678 * elf32-metag.c (elf_metag_howto_table): Likewise.
1679 * elf32-microblaze.c (microblaze_elf_howto_raw): Likewise.
1680 * elf32-mips.c (elf_mips_howto_table_rel): Likewise.
1681 * elf32-moxie.c (moxie_elf_howto_table): Likewise.
1682 * elf32-msp430.c (elf_msp430_howto_table): Likewise.
1683 * elf32-mt.c (mt_elf_howto_table): Likewise.
1684 * elf32-nds32.c (nds32_elf_howto_table): Likewise.
1685 * elf32-nios2.c (elf_nios2_howto_table_rel): Likewise.
1686 * elf32-or1k.c (or1k_elf_howto_table): Likewise.
1687 * elf32-pj.c (pj_elf_howto_table): Likewise.
1688 * elf32-ppc.c (ppc_elf_howto_raw): Likewise.
1689 * elf32-rl78.c (rl78_elf_howto_table): Likewise.
1690 * elf32-rx.c (rx_elf_howto_table): Likewise.
1691 * elf32-s390.c (elf_howto_table): Likewise.
1692 * elf32-score.c (elf32_score_howto_table): Likewise.
1693 * elf32-score7.c (elf32_score_howto_table): Likewise.
1694 * elf32-sh-relocs.h (R_SH_NONE): Likewise.
1695 * elf32-spu.c (elf_howto_table): Likewise.
1696 * elf32-tic6x.c (elf32_tic6x_howto_table): Likewise.
1697 * elf32-tilepro.c (tilepro_elf_howto_table): Likewise.
1698 * elf32-v850.c (v850_elf_howto_table): Likewise.
1699 * elf32-vax.c (howto_table): Likewise.
1700 * elf32-visium.c (visium_elf_howto_table): Likewise.
1701 * elf32-xc16x.c (xc16x_elf_howto_table): Likewise.
1702 * elf32-xgate.c (elf_xgate_howto_table): Likewise.
1703 * elf32-xstormy16.c (xstormy16_elf_howto_table): Likewise.
1704 * elf32-xtensa.c (elf_howto_table): Likewise.
1705 * elf64-alpha.c (elf64_alpha_howto_table): Likewise.
1706 * elf64-mips.c (mips_elf64_howto_table_rel): Likewise.
1707 * elf64-mmix.c (elf_mmix_howto_table): Likewise.
1708 * elf64-ppc.c (ppc64_elf_howto_raw): Likewise.
1709 * elf64-s390.c (elf_howto_table): Likewise.
1710 * elf64-sh64.c (sh_elf64_howto_table): Likewise.
1711 * elf64-x86-64.c (x86_64_elf_howto_table): Likewise.
1712 * elfn32-mips.c (elf_mips_howto_table_rel): Likewise.
1713 * elfnn-aarch64.c (elfNN_aarch64_howto_table): Likewise.
1714 (elfNN_aarch64_howto_none): Likewise.
1715 * elfxx-ia64.c (ia64_howto_table): Likewise.
1716 * elfxx-sparc.c (_bfd_sparc_elf_howto_table): Likewise.
1717 * elfxx-tilegx.c (tilegx_elf_howto_table): Likewise.
1718 * nlm32-sparc.c (nlm32_sparc_howto_table): Likewise.
1719
1720 2015-01-15 H.J. Lu <hongjiu.lu@intel.com>
1721
1722 PR ld/17847
1723 * elf64-x86-64.c (elf_x86_64_relocate_section): Don't complain
1724 about -fPIC if the symbol is undefined when building executable.
1725
1726 2015-01-15 Nick Clifton <nickc@redhat.com>
1727
1728 PR binutils/17512
1729 * elf-m10300.c (mn10300_info_to_howto): Replace assertion with an
1730 error message. Never return an invalid howto pointer.
1731 * elf32-cr16.c (cr16_info_to_howto): Likewise.
1732 * elf32-crx.c (elf_crx_info_to_howto): Likewise.
1733 * elf32-i370.c (i370_elf_info_to_howto): Likewise.
1734 * elf32-mcore.c (mcore_elf_info_to_howto): Likewise.
1735 * elf32-microblaze.c (microblaze_elf_info_to_howto): Likewise.
1736 * elf32-mips.c (mips_elf32_rtype_to_howto): Likewise.
1737 * elf32-pj.c (pj_elf_info_to_howto): Likewise.
1738 * elf32-ppc.c (ppc_elf_info_to_howto): Likewise.
1739 * elf32-spu.c (spu_elf_info_to_howto): Likewise.
1740 * elf32-v850.c (v850_elf_info_to_howto_rela): Likewise.
1741 * elf32-vax.c (rtype_to_howto): Likewise.
1742 * elf64-alpha.c (elf64_alpha_info_to_howto): Likewise.
1743 * elf64-mips.c (mips_elf64_rtype_to_howto): Likewise.
1744 * elfn32-mips.c (sh_elf_info_to_howto): Likewise.
1745 * elf32-sh.c (sh_elf_info_to_howto): Likewise.
1746 (sh_elf_reloc): Check that the reloc is in range.
1747 * reloc.c (bfd_perform_relocation): Check that the section is big
1748 enough for the entire reloc.
1749 (bfd_generic_get_relocated_section_contents): Report unexpected
1750 return values from perform_reloc.
1751
1752 2015-01-15 Nick Clifton <nickc@redhat.com>
1753
1754 * elf32-msp430.c (msp430_elf_relax_section): Skip unhandled
1755 relocs. Include PC-relative adjustment for R_MSP430X_ABS16
1756 relaxation.
1757
1758 2015-01-15 Alan Modra <amodra@gmail.com>
1759
1760 * elflink.c (_bfd_elf_link_omit_section_dynsym): Return true for
1761 any output section matching a linker created dynobj section.
1762
1763 2015-01-15 Alan Modra <amodra@gmail.com>
1764
1765 PR 17842
1766 * elflink.c (elf_link_output_sym): Assert elf_onesymtab set.
1767 (bfd_elf_final_link): Always create a symbol table when emit_relocs.
1768 Don't assign symtab file position unless symbols will be output.
1769 Merge blocks with condition in common. Don't call
1770 elf_backend_output_arch_local_syms or elf_backend_output_arch_syms
1771 unless other symbols are output. Move assignment of symtab_shndx
1772 file position. Localize variable.
1773
1774 2015-01-14 Jiong Wang <jiong.wang@arm.com>
1775
1776 * elf32-arm.c (elf32_arm_final_link_relocate): Reject R_ARM_32/_NOI when
1777 trying to defer them to runtime.
1778
1779 2015-01-13 Thomas Preud'homme <thomas.preudhomme@arm.com>
1780
1781 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Use SYMBOLIC_BIND
1782 to check if a symbol should be bound symbolically.
1783
1784 2015-01-13 Jiong Wang <jiong.wang@arm.com>
1785
1786 * elfnn-aarch64.c: (elfNN_aarch64_howto_table): Enable overflow check
1787 for TLSLE_MOVW_TPREL_G2.
1788
1789 2015-01-13 Jiong Wang <jiong.wang@arm.com>
1790
1791 PR ld/17415
1792 * elfnn-aarch64.c (elfNN_aarch64_howto_table): Mark
1793 R_AARCH64_TLSLE_ADD_TPREL_HI12 as complain_overflow_unsigned.
1794 * elfxx-aarch64.c (_bfd_aarch64_elf_resolve_relocation): Correct the
1795 bit mask.
1796
1797 2015-01-12 Terry Guo <terry.guo@arm.com>
1798
1799 * elflink.c (_bfd_elf_gc_mark_debug_special_section_group): New
1800 function.
1801 (_bfd_elf_gc_mark_extra_sections): Use it.
1802
1803 2015-01-11 H.J. Lu <hongjiu.lu@intel.com>
1804
1805 PR ld/17827
1806 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): For PIE,
1807 only discard space for pc-relative relocs symbols which turn
1808 out to need copy relocs.
1809
1810 2015-01-09 Nick Clifton <nickc@redhat.com>
1811
1812 * tekhex.c (getvalue): Fix thinko in test for correct extraction
1813 of value.
1814 (getsym): Return false if there was not enough data to extract the
1815 symbol.
1816
1817 2015-01-09 Anthony Green <green@moxielogic.com>
1818
1819 * elf32-moxie.c (ELF_MACHINE_ALT1): Define.
1820
1821 2015-01-08 Nick Clifton <nickc@redhat.com>
1822
1823 * elf32-msp430.c (msp430_elf_relax_section): Add relaxation of
1824 16-bit absolute BR instructions to 10-bit pc-relative JMP
1825 instructions.
1826
1827 2015-01-08 Nick Clifton <nickc@redhat.com>
1828
1829 PR binutils/17512
1830 * coffcode.h (coff_slurp_symbol_table): Return false if we failed
1831 to load the line table.
1832 * elf.c (_bfd_elf_map_sections_to_segments): Enforce a minimum
1833 maxpagesize of 1.
1834 * peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Fail if
1835 the Data Directory Size is too large.
1836
1837 2015-01-06 H.J. Lu <hongjiu.lu@intel.com>
1838
1839 PR binutils/17512
1840 * elf32-i386.c (elf_i386_get_plt_sym_val): Skip unknown relocation.
1841 * elf64-x86-64.c (elf_x86_64_get_plt_sym_val): Likewise.
1842
1843 2015-01-06 Nick Clifton <nickc@redhat.com>
1844
1845 PR binutils/17512
1846 * mach-o.c (bfd_mach_o_read_symtab_strtab): Zero terminate the
1847 string table.
1848
1849 * reloc.c (bfd_get_reloc_size): Handle a reloc size of -1.
1850 (bfd_perform_relocation): Include the size of the reloc in the
1851 test for an out of range relocation.
1852 (bfd_generic_get_relocated_section_contents): Remove reloc range
1853 test.
1854
1855 * coff-i860.c (CALC_ADDEND): Always set an addend value.
1856 * tekhex.c (getvalue): Add an end pointer parameter. Use it to
1857 avoid reading off the end of the buffer.
1858 (getsym): Likewise.
1859 (first_phase): Likewise.
1860 (pass_over): Pass an end pointer to the invoked function.
1861
1862 2015-01-05 H.J. Lu <hongjiu.lu@intel.com>
1863
1864 PR binutils/17512
1865 * elf32-i386.c (elf_i386_get_plt_sym_val): Return NULL on corrupt
1866 input.
1867 * elf64-x86-64.c (elf_x86_64_get_plt_sym_val): Likewise.
1868
1869 2015-01-05 Nick Clifton <nickc@redhat.com>
1870
1871 PR binutils/17512
1872 * archive.c (do_slurp_bsd_armap): Make sure that the parsed sized
1873 is at least big enough for the header to be read.
1874 * elf32-i386.c (elf_i386_get_plt_sym_val): Skip unknown relocs.
1875 * mach-o.c (bfd_mach_o_get_synthetic_symtab): Add range checks.
1876 (bfd_mach_o_read_command): Prevetn duplicate error messages about
1877 unrecognized commands.
1878 * syms.c (_bfd_stab_section_find_nearest_line): Add range checks
1879 when indexing into the string table.
1880
1881 2015-01-01 Alan Modra <amodra@gmail.com>
1882
1883 Update year range in copyright notice of all files.
1884
1885 For older changes see ChangeLog-2014
1886 \f
1887 Copyright (C) 2015 Free Software Foundation, Inc.
1888
1889 Copying and distribution of this file, with or without modification,
1890 are permitted in any medium without royalty provided the copyright
1891 notice and this notice are preserved.
1892
1893 Local Variables:
1894 mode: change-log
1895 left-margin: 8
1896 fill-column: 74
1897 version-control: never
1898 End:
This page took 0.069489 seconds and 5 git commands to generate.