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