Fix build problem on 32-bit hosts with the recent patch for PR 16821.
[platform/upstream/binutils.git] / bfd / ChangeLog
1 2014-04-22  Yuanhui Zhang  <asmwarrior@gmail.com>
2
3         PR ld/16821
4         * peXXigen.c (abs_finder): Fix for 32-bit host builds.
5
6 2014-04-22  Will Newton  <will.newton@linaro.org>
7
8         * elfnn-aarch64.c (elfNN_aarch64_section_flags): Remove
9         function.  (elf_backend_section_flags): Remove define.
10
11 2014-04-21  Richard Henderson  <rth@redhat.com>
12
13         * elf64-alpha.c (elf64_alpha_size_got_sections): New may_merge
14         parameter; honor it and disable got merging when false.
15         (elf64_alpha_relax_got_load): Do not relax to GPREL relocs during
16         the first pass of relaxation.
17         (elf64_alpha_relax_with_lituse): Likewise.  Move relaxed relocs to
18         the end of the LITERAL+LITUSE chain.
19         (elf64_alpha_relax_section): Only process LITERAL relocs during the
20         second pass of relaxation.
21
22         * configure.ac (use_secureplt): Enable by default.
23         * configure: Rebuild.
24
25 2014-04-18  Tristan Gingold  <gingold@adacore.com>
26
27         * mach-o.h (bfd_mach_o_dyld_info_command): Add rebase_content,
28         bind_content, weak_bind_content, lazy_bind_content,
29         export_content.
30         (bfd_mach_o_load_command): Add comments, add next field.
31         (mach_o_data_struct): Replace commands field by first_command
32         and last_command.
33         * mach-o.c (bfd_mach_o_append_command): New function.
34         (bfd_mach_o_bfd_copy_private_symbol_data): Add blank lines.
35         (bfd_mach_o_bfd_copy_private_section_data): Check flavour,
36         copy fields.
37         (bfd_mach_o_bfd_copy_private_header_data): Copy load commands.
38         (bfd_mach_o_pad4, bfd_mach_o_pad_command): New functions.
39         (bfd_mach_o_write_thread): Use macro instead of literal.
40         (bfd_mach_o_write_dylinker, bfd_mach_o_write_dylib)
41         (bfd_mach_o_write_main, bfd_mach_o_write_dyld_info): New
42         functions.
43         (bfd_mach_o_write_symtab_content): New function (extracted
44         from bfd_mach_o_write_symtab).
45         (bfd_mach_o_write_symtab): Split.
46         (bfd_mach_o_count_indirect_symbols): Move
47         (bfd_mach_o_build_dysymtab): Remove layout code.
48         (bfd_mach_o_write_contents): Rewritten to build commands in order.
49         (bfd_mach_o_count_sections_for_seg): Remove.
50         (bfd_mach_o_build_obj_seg_command): New function (extracted from
51         bfd_mach_o_build_seg_command).
52         (bfd_mach_o_build_exec_seg_command): New function.
53         (bfd_mach_o_build_dysymtab_command): Remove.
54         (bfd_mach_o_layout_commands): New function.
55         (bfd_mach_o_init_segment): New function.
56         (bfd_mach_o_build_commands): Major rework to handle non-object
57         files.
58         (bfd_mach_o_alloc_and_read, bfd_mach_o_read_dyld_content): New
59         function.
60         (bfd_mach_o_read_dyld_info): Clear content fields.
61         (bfd_mach_o_read_segment): Adjust call.
62         (bfd_mach_o_flatten_sections): Adjust as now load commands are
63         chained.
64         (bfd_mach_o_scan_start_address, bfd_mach_o_scan)
65         (bfd_mach_o_mkobject_init, bfd_mach_o_get_base_address)
66         (bfd_mach_o_lookup_command, bfd_mach_o_core_fetch_environment):
67         Likewise.
68
69 2014-04-18  Tristan Gingold  <gingold@adacore.com>
70
71         * mach-o-target.c (bfd_mach_o_bfd_copy_private_header_data):
72         Define instead of bfd_mach_o_bfd_copy_private_bfd_data.
73         * mach-o.c (bfd_mach_o_bfd_copy_private_bfd_data): Rename.
74         * mach-o.h (bfd_mach_o_bfd_copy_private_bfd_data): Likewise.
75
76 2014-04-18  Tristan Gingold  <gingold@adacore.com>
77
78         * mach-o.h (bfd_mach_o_dylinker_command)
79         (bfd_mach_o_dylib_command, bfd_mach_o_fvmlib_command): Remove
80         name_len field.
81         * mach-o.c (bfd_mach_o_read_dylinker, bfd_mach_o_read_dylib)
82         (bfd_mach_o_read_fvmlib): Adjust after name_len removal.
83
84 2014-04-18  Tristan Gingold  <gingold@adacore.com>
85
86         * mach-o.h (bfd_mach_o_backend_data): Add page_size field.
87         * mach-o-target.c: Check TARGET_PAGESIZE is defined.
88         (TARGET_NAME_BACKEND): Add TARGET_PAGESIZE.
89         * mach-o.c (TARGET_PAGESIZE): Define and undefined for
90         each targets declared.
91         * mach-o-x86-64.c (TARGET_PAGESIZE): Define.
92         * mach-o-i386.c (TARGET_PAGESIZE): Define.
93
94 2014-04-18  Tristan Gingold  <gingold@adacore.com>
95
96         * mach-o.c (bfd_mach_o_write_thread)
97         (bfd_mach_o_write_section_32, bfd_mach_o_write_section_64)
98         (bfd_mach_o_write_segment_32, bfd_mach_o_write_segment_64)
99         (bfd_mach_o_read_dylinker, bfd_mach_o_read_dylib)
100         (bfd_mach_o_read_prebound_dylib, bfd_mach_o_read_prebind_cksum)
101         (bfd_mach_o_read_twolevel_hints, bfd_mach_o_read_fvmlib)
102         (bfd_mach_o_read_thread, bfd_mach_o_read_dysymtab)
103         (bfd_mach_o_read_symtab, bfd_mach_o_read_uuid)
104         (bfd_mach_o_read_linkedit, bfd_mach_o_read_str)
105         (bfd_mach_o_read_dyld_info, bfd_mach_o_read_segment)
106         (bfd_mach_o_read_segment_32, bfd_mach_o_read_segment_64)
107         (bfd_mach_o_read_command): Now return a boolean status.
108         Adjust return statements.
109         (bfd_mach_o_write_contents, bfd_mach_o_scan): Adjust tests.
110         (bfd_mach_o_core_file_failing_command): Remove useless initialization.
111
112 2014-04-17  Kwok Cheung Yeung  <kcy@codesourcery.com>
113
114         * elfxx-mips.c (struct mips_got_info): Delete assigned_gotno
115         field.  Add assigned_low_gotno and assigned_high_gotno fields.
116         (mips_elf_create_local_got_entry): Update out-of-space condition.
117         Set index of new GOT entry to assigned_low_gotno if required by
118         the current relocation, else set it to assigned_high_gotno.
119         (mips_elf_set_global_gotidx): Replace uses of assigned_gotno
120         with assigned_low_gotno.
121         (mips_elf_multi_got): Initialize assigned_low_gotno and
122         assigned_high_gotno in secondary GOTs.  Use assigned_low_gotno
123         in place of assigned_gotno when handling global GOT entries.
124         (mips_elf_lay_out_got): Initialize assigned_low_gotno and
125         assigned_high_gotno.
126         (_bfd_mips_elf_finish_dynamic_sections): Account for a possible
127         gap in the middle of local GOT space.
128
129 2014-04-17  Alan Modra  <amodra@gmail.com>
130
131         PR 16846
132         * elflink.c (_bfd_elf_merge_symbol): Ignore TLS mismatch when
133         current bfd is a plugin.  Don't always set type_change_ok
134         when old bfd is a plugin.
135
136 2014-04-16  Tristan Gingold  <gingold@adacore.com>
137
138         * mach-o-x86-64.c (bfd_mach_o_x86_64_mkobject): Adjust cpusubtype
139         flag.
140
141 2014-04-16  Alan Modra  <amodra@gmail.com>
142
143         * elf32-ppc.c (ppc_elf_relocate_section): Fill 476 fixup area
144         with "ba 0" rather than zeros.
145
146 2014-04-15  Marcus Shawcroft  <marcus.shawcroft@arm.com>
147
148         * (elfNN_aarch64_tls_relax): Fix instruction mask.
149
150 2014-04-14  Alan Modra  <amodra@gmail.com>
151
152         * elf32-ppc.c (BA): Define
153         (ppc_elf_link_hash_table_create): Correct default_params.
154         (write_glink_stub): Pad small plt call stub with "ba 0" rather
155         than "nop" for ppc476_workaround.
156         (ppc_elf_finish_dynamic_sections): Likewise for branch table
157         and __glink_PLTresolve.  Ensure plt call stub at end of page
158         doesn't allow fall-thru prefetch.
159
160 2014-04-11  Nick Clifton  <nickc@redhat.com>
161
162         PR ld/16821
163         * peXXigen.c (abs_finder): New function.
164         (_bfd_XXi_swap_sym_out): For absolute symbols with values larger
165         than 1^32 try to convert them into section relative values
166         instead.
167
168 2014-04-11  Nick Clifton  <nickc@redhat.com>
169
170         * bfd-in2.h: Regenerate.
171         * libbfd.h: Regenerate.
172
173 2014-04-10  Cesar Philippidis  <cesar@codesourcery.com>
174
175         * elf32-nios2.c (nios2_elf32_build_stubs): Ignore dynobjs
176         when building function stubs.
177
178 2014-04-10  Senthil Kumar Selvaraj  <senthil_kumar.selvaraj@atmel.com>
179
180         * elf32-avr.c: Add DIFF relocations for AVR.
181         (avr_final_link_relocate): Handle the DIFF relocs.
182         (bfd_elf_avr_diff_reloc): New.
183         (elf32_avr_is_diff_reloc): New.
184         (elf32_avr_adjust_diff_reloc_value): Reduce difference value.
185         (elf32_avr_relax_delete_bytes): Recompute difference after deleting
186         bytes.
187
188         * reloc.c: Add BFD_RELOC_AVR_DIFF8/16/32 relocations
189
190 2014-04-09  Alan Modra  <amodra@gmail.com>
191
192         * libcoff.h: Regenerate.
193
194 2014-04-09  Alan Modra  <amodra@gmail.com>
195
196         * elf32-ppc.c (ppc_elf_relocate_section): Remove bctr from list
197         of safe ppc476 insns at end of page.  Also remove non-branch insns.
198         Expand comments.
199
200 2014-04-08  Jon TURNEY  <jon.turney@dronecode.org.uk>
201
202         * peXXigen.c (pe_print_debugdata): New function: Displays the
203         contents of the debug directory and decodes codeview entries.
204         (_bfd_XXi_swap_debugdir_in, _bfd_XXi_swap_debugdir_out)
205         (_bfd_XXi_slurp_codeview_record, _bfd_XXi_write_codeview_record):
206         Add functions for reading and writing debugdir and codeview
207         records.
208         * libpei.h (_bfd_XXi_swap_debugdir_in, _bfd_XXi_swap_debugdir_out)
209         (_bfd_XXi_write_codeview_record): Add prototypes and macros.
210         * libcoff-in.h (pe_tdata): Add build-id data.
211         * libcoff.h: Regenerate.
212         * coffcode.h (coff_write_object_contents): Run build_id
213         after_write_object_contents hook.
214
215 2014-04-05  Alan Modra  <amodra@gmail.com>
216
217         * elflink.c (_bfd_elf_add_default_symbol): Pass poldbfd when
218         merging non-default sym.
219
220 2014-04-04  Tristan Gingold  <gingold@adacore.com>
221
222         * mach-o.c (bfd_mach_o_header_p): Reject 64 bit target when not
223         configured for.
224
225 2014-04-04  Tristan Gingold  <gingold@adacore.com>
226
227         * mach-o.c (bfd_mach_o_convert_section_name_to_mach_o): Fix
228         thinko on names length.
229
230 2014-04-04  Tristan Gingold  <gingold@adacore.com>
231
232         * mach-o-i386.c (bfd_mach_o_i386_swap_reloc_out): Use target index
233         of output_section.
234         * mach-o-x86-64.c (bfd_mach_o_x86_64_swap_reloc_out): Ditto.
235
236 2014-04-04  Tristan Gingold  <gingold@adacore.com>
237
238         * bfd.c (bfd_get_arch_size): Default is taken from arch.
239
240 2014-04-03  Jon Turney  <jon.turney@dronecode.org.uk>
241
242         * peXXigen.c (pe_print_edata): Verify edt.name lies inside
243         section before dereferencing.
244         (pe_print_idata, pe_print_edata, pe_print_reloc)
245         (rsrc_print_section): Don't bother interpreting the contents
246         of sections which have no contents.
247
248 2014-04-03  Maria Guseva  <m.guseva@samsung.com>
249
250         PR ld/16803
251         * elf.c (_bfd_elf_set_section_contents): Use correct type to hold
252         file position.
253
254 2014-04-03  Tristan Gingold  <gingold@adacore.com>
255
256         * mach-o.c (bfd_mach_o_mangle_symbols): Use index from
257         output_section.
258         (bfd_mach_o_build_seg_command): Add comment.  Realign segment.
259         Fix style.
260         (bfd_mach_o_build_commands, bfd_mach_o_read_thread): Fix style.
261
262 2014-04-03  Alan Modra  <amodra@gmail.com>
263
264         * elf-bfd.h (struct elf_backend_data
265         <elf_backend_bfd_from_remote_memory>): Replace "size_t size"
266         with "bfd_size_type size".
267         (_bfd_elf32_bfd_from_remote_memory): Likewise.
268         (_bfd_elf64_bfd_from_remote_memory): Likewise.
269         * elf.c (bfd_elf_bfd_from_remote_memory): Likewise.
270         * elfcode.h (bfd_from_remote_memory): Likewise.
271         * bfd-in.h (bfd_elf_bfd_from_remote_memory): Likewise.
272         * bfd-in2.h: Regenerate.
273
274 2014-04-02  Tristan Gingold  <gingold@adacore.com>
275
276         * mach-o.h (bfd_mach_o_twolevel_hints_command)
277         (bfd_mach_o_prebind_cksum_command): New types.
278         (bfd_mach_o_prebound_dylib_command): Rewrite.
279         (bfd_mach_o_load_command): Add prebind_cksum and twolevel_hints
280         fields.
281         * mach-o.c (bfd_mach_o_read_prebound_dylib): Read and decode the
282         command.
283         (bfd_mach_o_read_prebind_cksum): New function.
284         (bfd_mach_o_read_twolevel_hints): Ditto.
285         (bfd_mach_o_read_command): Handle prebind cksum and twolevel hints
286         commands.
287
288 2014-04-02  Alan Modra  <amodra@gmail.com>
289
290         * elfcode.h (bfd_from_remote_memory): Add "size" parameter.
291         Consolidate code handling possible section headers past end of
292         segment.  Don't use p_align for page size guess, instead use
293         minpagesize.  Take note of ld.so clearing section headers when
294         p_memsz > p_filesz.  Handle file header specifying no section
295         headers.  Handle zero p_align throughout.  Default loadbase to
296         zero.  Add comments.  Rename contents_size to high_offset, and
297         make it a bfd_vma.  Delete unnecessary bfd_set_error calls.
298         * bfd-in.h (bfd_elf_bfd_from_remote_memory): Update prototpe.
299         * elf-bfd.h (struct elf_backend_data <elf_backend_from_remote_memory>):
300         Likewise.
301         (_bfd_elf32_bfd_from_remote_memory): Likewise.
302         (_bfd_elf64_bfd_from_remote_memory): Likewise.
303         * elf.c (bfd_elf_bfd_from_remote_memory): Adjust.
304         * bfd-in2.h: Regnerate.
305
306 2014-04-01  Tristan Gingold  <gingold@adacore.com>
307
308         * mach-o.c (bfd_mach_o_canonicalize_one_reloc): Avoid to crash
309         when num == 0.
310
311 2014-03-27  Yury Gribov  <y.gribov@samsung.com>
312             Pavel Fedin  <p.fedin@samsung.com>
313
314         * elf32-arm.c: Add support for limited pretty-printing of PLT
315         entries on eabi and nacl targets.
316         (elf32_arm_get_synthetic_symtab): Add new callback.
317         (elf32_arm_nacl_plt_sym_val): Likewise.
318         (elf32_arm_plt0_size): Add helper function.
319         (elf32_arm_plt_size): Likewise.
320
321 2014-03-27  Tristan Gingold  <gingold@adacore.com>
322
323         * mach-o.c (bfd_mach_o_read_dylinker): Remove assert.
324         (bfd_mach_o_read_command): Handle BFD_MACH_O_LC_DYLD_ENVIRONMENT.
325
326 2014-03-27  Tristan Gingold  <gingold@adacore.com>
327
328         * mach-o.h (bfd_mach_o_get_base_address): New prototype.
329         * mach-o.c (bfd_mach_o_write_symtab)
330         (bfd_mach_o_write_contents)
331         (bfd_mach_o_set_section_flags_from_bfd)
332         (bfd_mach_o_build_seg_command): Fix indentation.
333         (bfd_mach_o_get_base_address): New function.
334
335 2014-03-26  Nick Clifton  <nickc@redhat.com>
336
337         * cofflink.c (_bfd_coff_generic_relocate_section): Skip
338         relocations in discarded sections.
339
340 2014-03-26  Tristan Gingold  <gingold@adacore.com>
341
342         * mach-o.c (bfd_mach_o_convert_architecture): Add
343         BFD_MACH_O_CPU_TYPE_ARM64.
344
345 2014-03-26  Alan Modra  <amodra@gmail.com>
346
347         * elf64-ppc.c (ppc64_elf_check_relocs): Account for possibly
348         needed plt entries when taking the address of functions for
349         abiversion == 0 (ie. unknown) as well as abiversion == 2.
350         Move opd setup and abiversion checks to..
351         (ppc64_elf_before_check_relocs): ..here.  Renamed from
352         ppc64_elf_process_dot_syms.  Set output abiversion from input and
353         input abiversion from output, if either is not set.
354         (ppc64_elf_merge_private_bfd_data): Don't merge flags here.
355         (elf_backend_check_directives): Update.
356
357 2014-03-25  Will Newton  <will.newton@linaro.org>
358
359          * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_sections):
360          Set value of DT_PLTRELSZ and DT_RELASZ based on the size
361          of input sections rather than output sections.
362
363 2014-03-20  Will Newton  <will.newton@linaro.org>
364
365         PR ld/16715
366         * elf32-arm.c (elf32_arm_check_relocs): Set
367         pointer_equality_needed for absolute references within
368         executable links.
369         (elf32_arm_finish_dynamic_symbol): Set st_value to zero
370         unless pointer_equality_needed is set.
371
372 2014-03-19  Nick Clifton  <nickc@redhat.com>
373
374         * peXXigen.c (rsrc_process_section): Add code to scan input
375         sections and record their lengths.  Use these lengths to find the
376         start of each merged .rsrc section.
377
378 2014-03-17  Tristan Gingold  <gingold@adacore.com>
379
380         * mach-o.c (bfd_mach_o_read_dylib): Handle lazy load dylib.
381         (bfd_mach_o_read_command): Ditto.
382
383 2014-03-14  Meador Inge  <meadori@codesourcery.com>
384
385          * configure.in: Add strnlen to AC_CHECK_DECLS.
386          * config.in: Regenerate.
387          * configure: Regenerate.
388          * sysdep.h (strnlen): Add prototype.
389
390 2014-03-14  Alan Modra  <amodra@gmail.com>
391
392         * elf32-ppc.c (ppc_elf_relocate_section): Correct overflow
393         handling for VLE_SDA21 relocs.
394
395 2014-03-13  Tristan Gingold  <gingold@adacore.com>
396
397         * peicode.h (pe_ILF_object_p): Adjust, as the version number
398         has been read.
399         (pe_bfd_object_p): Also read version number to detect ILF.
400         * pe-x86_64.c (COFF_WITH_PE_BIGOBJ): Define.
401         (x86_64pe_bigobj_vec): Define
402         * coffcode.h (bfd_coff_backend_data): Add _bfd_coff_max_nscns field.
403         (bfd_coff_max_nscns): New macro.
404         (coff_compute_section_file_positions): Use unsigned int for
405         target_index.  Compare with bfd_coff_max_nscns.
406         (bfd_coff_std_swap_table, ticoff0_swap_table, ticoff1_swap_table):
407         Set a value for _bfd_coff_max_nscns.
408         (header_bigobj_classid): New constant.
409         (coff_bigobj_swap_filehdr_in, coff_bigobj_swap_filehdr_out)
410         (coff_bigobj_swap_sym_in, coff_bigobj_swap_sym_out)
411         (coff_bigobj_swap_aux_in, coff_bigobj_swap_aux_out): New
412         functions.
413         (bigobj_swap_table): New table.
414         * libcoff.h: Regenerate.
415         * coff-sh.c (bfd_coff_small_swap_table): Likewise.
416         * coff-alpha.c (alpha_ecoff_backend_data): Add value for
417         _bfd_coff_max_nscns.
418         * coff-mips.c (mips_ecoff_backend_data): Likewise.
419         * coff-rs6000.c (bfd_xcoff_backend_data)
420         (bfd_pmac_xcoff_backend_data): Likewise.
421         * coff64-rs6000.c (bfd_xcoff_backend_data)
422         (bfd_xcoff_aix5_backend_data): Likewise.
423         * targets.c (x86_64pe_bigobj_vec): Declare.
424         * configure.in (x86_64pe_bigobj_vec): New vector.
425         * configure: Regenerate.
426         * config.bfd: Add bigobj object format for Windows targets.
427
428 2014-03-12  Nick Clifton  <nickc@redhat.com>
429
430         PR ld/16671
431         * elf32-arm.c (elf32_arm_add_symbol_hook): Check for ARM format
432         before testing for vxworks.
433
434 2014-03-12  Alan Modra  <amodra@gmail.com>
435
436         * Makefile.in: Regenerate.
437
438 2014-03-12  Alan Modra  <amodra@gmail.com>
439
440         PR 16690
441         * elf.c (copy_elf_program_header): Ignore first section lma if
442         non-alloc.
443
444 2014-03-11  Alan Modra  <amodra@gmail.com>
445
446         PR 16686
447         * coff-rs6000.c: Include stdint.h.
448         * coff64-rs6000.c: Likewise.
449
450 2014-03-10  Tristan Gingold  <gingold@adacore.com>
451
452         * ticoff.h: Removed.
453
454 2014-03-08  Alan Modra  <amodra@gmail.com>
455
456         * elf32-ppc.c (ppc_elf_howto_raw): Correct overflow check for
457         many relocations.  Correct bitsize and rightshift too for a number
458         of VLE relocs.  Describe R_PPC_VLE_SDA21 and R_PPC_VLE_SDA21_LO.
459         Correct dst_mask on R_PPC_VLE_SDA21_LO.
460         (ppc_elf_vle_split16): Tidy, delete unnecessary prototype.
461         (ppc_elf_relocate_section): Modify overflow test for 16-bit
462         fields in instructions to signed/unsigned according to whether
463         the field takes a signed or unsigned value.  Tidy vle split16 code.
464         Correct R_PPC_VLE_SDA21 and R_PPC_VLE_SDA21_LO handling.
465
466 2014-03-08  Alan Modra  <amodra@gmail.com>
467
468         * elf64-ppc.c (ppc64_elf_howto_raw): Use complain_overflow_signed
469         for R_PPC64_ADDR14, R_PPC64_ADDR14_BRTAKEN, R_PPC64_ADDR14_BRNTAKEN,
470         R_PPC64_SECTOFF, R_PPC64_ADDR16_DS, R_PPC64_SECTOFF_DS,
471         R_PPC64_REL16 entries.  Use complain_overflow_dont for R_PPC64_TOC.
472         (ppc64_elf_relocate_section): Modify overflow test for 16-bit
473         fields in instructions to signed/unsigned according to whether
474         the field takes a signed or unsigned value.
475
476 2014-03-07  Pedro Alves  <palves@redhat.com>
477
478         PR gdb/16696
479         * rs6000-core.c (rs6000coff_core_p): Cast pointers to bfd_vma
480         through ptr_to_uint instead of through long.
481
482 2014-03-06  Nick Clifton  <nickc@redhat.com>
483
484         PR 16664
485         * elf-attrs.c (_bfd_elf_parse_attributes): Add checks for corrupt
486         attribute section names.
487
488 2014-03-05  Alan Modra  <amodra@gmail.com>
489
490         Update copyright years.
491
492 2014-03-05  Alan Modra  <amodra@gmail.com>
493
494         * elf64-ppc.c (ppc64_elf_howto_raw): Add R_PPC64_ADDR64_LOCAL entry.
495         (ppc64_elf_reloc_type_lookup): Support R_PPC64_ADDR64_LOCAL.
496         (ppc64_elf_check_relocs): Likewise.
497         (ppc64_elf_relocate_section): Likewise.
498         * Add BFD_RELOC_PPC64_ADDR64_LOCAL.
499         * bfd-in2.h: Regenerate.
500         * libbfd.h: Regenerate.
501
502 2014-03-04  Heiher  <r@hev.cc>
503
504         * elfxx-mips.c (mips_set_isa_flags): Use E_MIPS_ARCH_64R2 for
505         Loongson-3A.
506         (mips_mach_extensions): Make bfd_mach_mips_loongson_3a an
507         extension of bfd_mach_mipsisa64r2.
508
509 2014-03-04  Nick Clifton  <nickc@redhat.com>
510
511         PR ld/16017
512         * elf32-arm.c (elf32_thumb2_plt0_entry): New array.
513         (elf32_thumb2_plt_entry): New array.
514         (elf32_arm_create_dynamic_sections): Set PLT entry sizes when
515         using thumb2 based PLT.
516         (elf32_arm_populate_plt_entry): Handle generating Thumb2 based PLT
517         entries.
518         (elf32_arm_final_link_relocate): Do not bias jumps to Thumb based
519         PLT entries.
520         (elf32_arm_finish_dynamic_sections): Handle creation of Thumb2
521         based PLT 0-entry.
522         (elf32_arm_output_plt_map_1): Handle creation of local symbols for
523         Thumb2 based PLT 0-entry.
524         (elf32_arm_output_arch_local_syms): Handle creation of local
525         symbols for Thumb2 based PLT entries.
526
527 2014-02-28  Alan Modra  <amodra@gmail.com>
528
529         PR ld/16643
530         * elflink.c (elf_gc_sweep): Call gc_sweep_hook for exactly
531         the same conditions we called check_relocs.
532
533 2014-02-27  Yuri Gribov  <y.gribov@samsung.com>
534
535         * bfd-in.h: Add export of bfd_elf32_arm_use_long_plt.
536         * bfd-in2.h: Regenerate.
537         * elf32-arm.c (elf32_arm_plt_entry_long): New array.
538         (elf32_arm_link_hash_table_create): Set plt_entry_size to 16 if
539         using long PLT entries.
540         (bfd_elf32_arm_use_long_plt): New function.
541         (elf32_arm_populate_plt_entry): Add support for long PLT entries.
542
543 2014-02-27  Alan Modra  <amodra@gmail.com>
544
545         * elf32-ppc.c (ppc_elf_link_hash_table_create): Provide default
546         params for targets that don't use ppc32elf.em.
547
548 2014-02-20  Chung-Lin Tang  <cltang@codesourcery.com>
549
550         * elf32-nios2.c (nios2_elf32_relocate_section): Fix calculation
551         of GOTOFF relocations.
552
553 2014-02-19  Igor Zamyatin  <igor.zamyatin@intel.com>
554             H.J. Lu  <hongjiu.lu@intel.com>
555
556         * elf64-x86-64.c (elf_x86_64_bnd_plt0_entry): New.
557         (elf_x86_64_legacy_plt_entry): Likewise.
558         (elf_x86_64_bnd_plt_entry): Likewise.
559         (elf_x86_64_legacy_plt2_entry): Likewise.
560         (elf_x86_64_bnd_plt2_entry): Likewise.
561         (elf_x86_64_bnd_arch_bed): Likewise.
562         (elf_x86_64_link_hash_entry): Add has_bnd_reloc and plt_bnd.
563         (elf_x86_64_link_hash_table): Add plt_bnd.
564         (elf_x86_64_link_hash_newfunc): Initialize has_bnd_reloc and
565         plt_bnd.
566         (elf_x86_64_copy_indirect_symbol): Also copy has_bnd_reloc.
567         (elf_x86_64_check_relocs): Create the second PLT for Intel MPX
568         in 64-bit mode.
569         (elf_x86_64_allocate_dynrelocs): Handle the second PLT for IFUNC
570         symbols.  Resolve call to the second PLT if it is created.
571         (elf_x86_64_size_dynamic_sections): Keep the second PLT section.
572         (elf_x86_64_relocate_section): Resolve PLT references to the
573         second PLT if it is created.
574         (elf_x86_64_finish_dynamic_symbol): Use BND PLT0 and fill the
575         second PLT entry for BND relocation.
576         (elf_x86_64_finish_dynamic_sections): Use MPX backend data if
577         the second PLT is created.
578         (elf_x86_64_get_synthetic_symtab): New.
579         (bfd_elf64_get_synthetic_symtab): Likewise.  Undefine for NaCl.
580
581 2014-02-19  Alan Modra  <amodra@gmail.com>
582
583         * elf64-ppc.h (struct ppc64_elf_params): Add save_restore_funcs.
584         * elf64-ppc.c (ppc64_elf_func_desc_adjust): Use it to control
585         provision of out-of-line register save/restore routines.
586
587 2014-02-18  Jack Carter  <jack.carter@imgtec.com>
588
589         * elfxx-mips.c(_bfd_mips_elf_modify_segment_map): Deleted hard coding of
590         PT_DYNAMIC segment flags.
591
592 2014-02-17  Jan Kratochvil  <jan.kratochvil@redhat.com>
593
594         PR binutils/16595
595         * simple.c (struct saved_offsets): New.
596         (simple_save_output_info): Use it for ptr.
597         (simple_restore_output_info): Use it for ptr.  Check section_count.
598         (bfd_simple_get_relocated_section_contents): Use it for saved_offsets.
599
600 2014-02-17  Alan Modra  <amodra@gmail.com>
601
602         * elf64-ppc.h (struct ppc64_elf_params): Define.
603         (ppc64_elf_init_stub_bfd, ppc64_elf_edit_opd, ppc64_elf_tls_setup,
604         ppc64_elf_setup_section_lists, ppc64_elf_size_stubs,
605         ppc64_elf_build_stubs): Update prototype.
606         * elf64-ppp.c (struct ppc_link_hash_table): Add params, delete other
607         fields now in params.  Adjust code throughout file.
608         (ppc64_elf_init_stub_bfd): Delete "abfd" parameter, add "params".
609         Save params pointer in htab.
610         (ppc64_elf_edit_opd, ppc64_elf_tls_setup,
611         ppc64_elf_setup_section_lists, ppc64_elf_size_stubs,
612         ppc64_elf_build_stubs): Remove parameters now in "params".
613
614 2014-02-17  Alan Modra  <amodra@gmail.com>
615
616         * elf32-ppc.c (ppc_elf_relocate_section): Move relocs on insns
617         patched for ppc476 workaround.  Reapply branch taken/not taken
618         relocs.
619
620 2014-02-12  Alan Modra  <amodra@gmail.com>
621
622         * elf32-ppc.c (ppc_elf_relax_section): Don't build long-branch
623         stubs for calls to __tls_get_addr that we know will later be
624         optimised away.
625
626 2014-02-12  Alan Modra  <amodra@gmail.com>
627
628         * elf32-ppc.c (ppc_elf_relax_section): Enable ppc476 workaround
629         for ld -r, when code sections are sufficiently aligned.
630         * elf32-ppc.h (struct ppc_elf_params): Delete pagesize.  Add
631         pagesize_p2.
632
633 2014-02-12  Alan Modra  <amodra@gmail.com>
634
635         PR gold/15530
636         * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Support
637         --export-dynamic and --dynamic-list marking of symbols.
638         * elflink.c (bfd_elf_gc_mark_dynamic_ref_symbol): Reorder
639         cheap tests first.
640
641 2014-02-10  H.J. Lu  <hongjiu.lu@intel.com>
642
643         PR gold/16530
644         * elflink.c (bfd_elf_gc_mark_dynamic_ref_symbol): Mark symbol in
645         executables if it matches dynamic_list.
646
647 2014-02-10  Alan Modra  <amodra@gmail.com>
648
649         * po/SRC-POTFILES.in: Regenerate.
650         * po/bfd.pot: Regenerate.
651
652 2014-02-09  Alan Modra  <amodra@gmail.com>
653
654         * elf-bfd.h (struct elf_backend_data): Add caches_rawsize.
655         * elfxx-target.h (elf_backend_caches_rawsize): Define.
656         (elfNN_bed): Init new field.
657         * elflink.c (elf_link_input_bfd): Handle caches_rawsize.
658         * elf32-ppc.c (shared_stub_entry): Zero addi offset.
659         (ppc_elf_relax_section): Don't reallocate section here, write
660         stubs, or write out relocs for ld -r here..
661         (ppc_elf_relocate_section): ..instead write stubs here, and use
662         existing code to write out relocs for ld -r.  Fix offset
663         adjustment on reloc for little-endian.
664         (elf_backend_caches_rawsize): Define.
665
666 2014-02-07  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
667
668         PR build/16550
669         * cache.c (bfd_cache_max_open): Cast RLIM_INFINITY to rlim_t.
670
671 2014-02-04  Jan Kratochvil  <jan.kratochvil@redhat.com>
672
673         * coff-rs6000.c (xcoff_write_archive_contents_big): Free OFFSETS in
674         return paths.  Three times.
675         * elf64-ppc.c (ppc64_elf_link_hash_table_create): Free HTAB in all
676         return paths.
677         (ppc64_elf_tls_optimize): Free TOC_REF in return path.
678         (ppc64_elf_edit_toc): Free USED in return path.
679
680 2014-02-03  Sandra Loosemore  <sandra@codesourcery.com>
681
682         * reloc.c (BFD_RELOC_NIOS2_GOT_LO, BFD_RELOC_NIOS2_GOT_HA): New.
683         (BFD_RELOC_NIOS2_CALL_LO, BFD_RELOC_NIOS2_CALL_HA): New.
684         * libbfd.h: Regenerated.
685         * bfd-in2.h: Regenerated.
686         * elf32-nios2.c (elf_nios2_howto_table_rel): Add new relocations.
687         (nios2_reloc_map): Likewise.
688         (GOT_USED, CALL_USED): Renamed from GOT16_USED and CALL16_USED.
689         Fixed all references.
690         (nios2_elf32_relocate_section): Add new relocations.
691         (nios2_elf32_check_relocs): Likewise.
692         (nios2_elf32_gc_sweep_hook): Likewise.
693
694 2014-02-03  Alan Modra  <amodra@gmail.com>
695
696         * elf32-ppc.c (struct ppc_elf_link_hash_table): Add params.
697         Delete emit_stub_syms, no_tls_get_addr_opt.  Update all uses.
698         (ppc_elf_link_params): New function.
699         (ppc_elf_create_glink): Align .glink to 64 bytes for ppc476
700         workaround.
701         (ppc_elf_select_plt_layout): Remove plt_style and emit_stub_syms
702         parameters.  Use htab->params instead.
703         (ppc_elf_tls_setup): Remove no_tls_get_addr_opt parameter.
704         (ppc_elf_size_dynamic_sections): Align __glink_PLTresolve to
705         64 bytes for ppc476 workaround.
706         (struct ppc_elf_relax_info): New.
707         (ppc_elf_relax_section): Exclude linker created sections and
708         those too small to hold one instruction.  Don't add another
709         branch  around trampolines on later relax passes.  Don't
710         generate trampolines for undefined symbols when !relocatable,
711         nor for plugin symbols.  Allocate space for ppc476 workaround
712         patch area.  Free fixups on error return path.
713         (ppc_elf_relocate_section): Handle ppc476 workaround patching.
714         * elf32-ppc.h (struct ppc_elf_params): New.
715         (ppc_elf_select_plt_layout, ppc_elf_tls_setup): Update prototype.
716         (ppc_elf_link_params): Declare.
717         * section.c (SEC_INFO_TYPE_TARGET): Define.
718         * bfd-in2.h: Regenerate.
719
720 2014-02-02  Sandra Loosemore  <sandra@codesourcery.com>
721
722         * elf32-nios2.c (struct elf32_nios2_link_hash_table): Add
723         h_gp_got field.
724         (nios2_elf32_relocate_section): Use got_base to adjust
725         GOT-pointer-relative relocations relative to _gp_got.
726         (create_got_section): Create _gp_got symbol.
727         (nios2_elf32_finish_dynamic_symbol): Make _gp_got absolute.
728         (nios2_elf32_size_dynamic_sections): Set _gp_got offset.
729
730 2014-01-30  Sandra Loosemore  <sandra@codesourcery.com>
731
732         * bfd-in2.h: Update from reloc.c.
733         * elf32-nios2.c: Include elf32-nios2.h.
734         (elf_nios2_howto_table_rel): Add entry for R_NIOS2_CALL26_NOAT.
735         (nios2_reloc_map): Likewise.
736         (enum elf32_nios2_stub_type): Declare.
737         (struct elf32_nios2_stub_hash_entry): Declare.
738         (nios2_stub_hash_entry, nios2_stub_hash_lookup): New macros.
739         (struct elf32_nios2_link_hash_entry): Add hsh_cache field.
740         (struct elf32_nios2_link_hash_table): Add new fields bstab,
741         stub_bfd, add_stub_section, layout_sections_again, stub_group,
742         bfd_count, top_index, input_list, all_local_syms.
743         (nios2_call26_stub_entry): New.
744         (nios2_elf32_install_imm16): Move up in file.
745         (nios2_elf32_install_data): Move up in file.
746         (hiadj): Move up in file.
747         (stub_hash_newfunc): New.
748         (link_hash_newfunc): Initialize hsh_cache field.
749         (STUB_SUFFIX): New.
750         (nios2_stub_name): New.
751         (nios2_get_stub_entry): New.
752         (nios2_add_stub): New.
753         (nios2_elf32_setup_section_lists): New.
754         (nios2_elf32_next_input_section): New.
755         (CALL26_SEGMENT): New.
756         (MAX_STUB_SECTION_SIZE): New.
757         (group_sections): New.
758         (nios2_type_of_stub): New.
759         (nios2_build_one_stub): New.
760         (nios2_size_one_stub): New.
761         (get_local_syms): New.
762         (nios2_elf32_size_stubs): New.
763         (nios2_elf32_build_stubs): New.
764         (nios2_elf32_do_call26_relocate): Correct CALL26 overflow test.
765         (nios2_elf32_relocate_section): Handle R_NIOS2_CALL26_NOAT.  Add
766         trampolines for R_NIOS2_CALL26 stubs.
767         (nios2_elf32_check_relocs): Handle R_NIOS2_CALL26_NOAT.
768         (nios2_elf32_gc_sweep_hook): Likewise.
769         (nios2_elf32_link_hash_table_create): Initialize the stub hash table.
770         (nios2_elf32_link_hash_table_free): New.
771         (bfd_elf32_bfd_link_hash_table_free): Define.
772         * elf32-nios2.h: New file.
773         * libbfd.h: Update from reloc.c.
774         * reloc.c (BFD_RELOC_NIOS2_CALL26_NOAT): New.
775
776 2014-01-29  Nick Clifton  <nickc@redhat.com>
777
778         PR binutils/16318
779         * elf32-metag.c (elf_metag_post_process_headers): Call
780         _bfd_elf_post_process_headers.
781         * elf32-sh64.c (sh64_elf_copy_private_data): Call
782         _bfd_elf_copy_private_data.
783         * elf64-sh64.c (sh_elf64_copy_private_data_internal): Likewise.
784
785 2014-01-29  Nick Clifton  <nickc@redhat.com>
786
787         * bfd-in.h (bfd_set_section_vma): Delete.
788         (bfd_set_section_alignment): Delete.
789         (bfd_set_section_userdata): Delete.
790         (bfd_set_cacheable): Delete.
791         * bfd.c (bfd_set_cacheable): New static inline function.
792         * section.c (bfd_set_section_userdata): Likewise.
793         (bfd_set_section_vma): Likewise.
794         (bfd_set_section_alignment): Likewise.
795         * bfd-in2.h: Regenerate.
796
797 2014-01-28  Nick Clifton  <nickc@redhat.com>
798
799         * dwarf2.c (find_abstract_instance_name): For DW_FORM_ref_addr
800         attributes select the CU containing the abbreviation, which may not
801         be the current CU.
802
803 2014-01-24  Alan Modra  <amodra@gmail.com>
804
805         * elf64-ppc.c (ppc_build_one_stub): Correct reloc count passed
806         to get_relocs for ELFv2.
807
808 2014-01-23  H.J. Lu  <hongjiu.lu@intel.com>
809
810         PR ld/16498
811         * elf.c (_bfd_elf_map_sections_to_segments): Issue a linker error
812         if TLS sections are not adjacent.
813
814 2014-01-22  Alan Modra  <amodra@gmail.com>
815
816         * elflink.c (elf_link_add_object_symbols): Call minfo for --as-needed.
817
818 2014-01-22  Alan Modra  <amodra@gmail.com>
819
820         * elf64-ppc.c (STK_LINKER): Comment typo fix.
821
822 2014-01-21  H.J. Lu  <hongjiu.lu@intel.com>
823
824         PR ld/16467
825         * elflink.c (_bfd_elf_merge_symbol): When types of the existing
826         regular default symbol definition and the versioned dynamic
827         symbol definition mismatch, skip the default symbol definition
828         if one of them is IFUNC.
829
830 2014-01-21  H.J. Lu  <hongjiu.lu@intel.com>
831
832         PR ld/2404
833         * elflink.c (_bfd_elf_merge_symbol): Don't check info->shared,
834         info->export_dynamic nor h->ref_dynamic for type mismatch when
835         adding the default version.
836
837 2014-01-16  Alan Modra  <amodra@gmail.com>
838
839         * elfxx-mips.c (mips_elf_record_got_page_entry): Pass in a
840         mips_elf_traverse_got_arg* rather than mips_got_info*.
841         Adjust caller.  Alloc on output_bfd rather than symbol section
842         owner.
843
844 2014-01-15  H.J. Lu  <hongjiu.lu@intel.com>
845
846         * elf32-i386.c (elf_i386_allocate_dynrelocs): Revert the last
847         change.
848         * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise.
849
850 2014-01-14  H.J. Lu  <hongjiu.lu@intel.com>
851
852         PR ld/16428
853         * elf32-i386.c (elf_i386_allocate_dynrelocs): Don't discard relocs
854         against __ehdr_start.
855         * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise.
856
857 2014-01-14  H.J. Lu  <hongjiu.lu@intel.com>
858
859         * elf32-i386.c (elf_i386_allocate_dynrelocs): Revert the last
860         change.
861         * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise.
862
863 2014-01-14  H.J. Lu  <hongjiu.lu@intel.com>
864
865         PR ld/16428
866         * elf32-i386.c (elf_i386_allocate_dynrelocs): Don't update reloc
867         count if there are any non pc-relative relocs.
868         * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise.
869
870 2014-01-14  Michael Hudson-Doyle  <michael.hudson@linaro.org>
871             Kugan Vivekanandarajah  <kugan.vivekanandarajah@linaro.org>
872
873         * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Use correct
874         offset while calculating relocation address.
875         (elfNN_aarch64_create_small_pltn_entry): Likewise.
876         (elfNN_aarch64_init_small_plt0_entry): Likewise.
877
878 2014-01-13  Ma Jiang  <ma.jiang@zte.com.cn>
879
880         PR ld/16202
881         * elf32-arm.c (elf32_arm_final_link_relocate): Refetch addends for
882         R_ARM_ABS8 and R_ARM_ABS16.
883
884 2014-01-13  Alan Modra  <amodra@gmail.com>
885
886         * elf32-ppc.c (ppc_elf_check_relocs): For @local call to ifunc,
887         error when shared and force a plt call otherwise.
888         (ppc_elf_size_dynamic_sections): Don't emit DT_PPC_GOT unless
889         plt_type == PLT_NEW.
890         (ppc_elf_relocate_section): Add missing test to resolve ifuncs to
891         the appropriate call stub.
892
893 2014-01-10  Alan Modra  <amodra@gmail.com>
894
895         PR ld/14207
896         PR ld/16322
897         PR binutils/16323
898         * elf.c (assign_file_positions_for_load_sections): Revert last change.
899         (assign_file_positions_for_non_load_sections): When setting up
900         PT_GNU_RELRO header, don't require a corresponding PT_LOAD
901         header that completely covers the relro region.
902
903 2014-01-09  Tristan Gingold  <gingold@adacore.com>
904
905         * coff-rs6000.c (rs6000coff_vec, pmac_xcoff_vec): use jump
906         table macros and add macros to initializa the structure.
907
908 2014-01-08  H.J. Lu  <hongjiu.lu@intel.com>
909
910         PR ld/14207
911         PR ld/16322
912         PR binutils/16323
913         * elf.c (_bfd_elf_map_sections_to_segments): Don't check section
914         size for PT_GNU_RELRO segment.
915         (assign_file_positions_for_load_sections): If PT_LOAD segment
916         doesn't fit PT_GNU_RELRO segment, adjust its p_filesz and p_memsz.
917
918 2014-01-07  Tom Tromey  <tromey@redhat.com>
919
920         * elf32-xtensa.c (vsprint_msg): Don't use old VA_* compatibility
921         wrappers.
922
923 2014-01-03  Nick Clifton  <nickc@redhat.com>
924
925         PR binutils/16199
926         * elf.c (vma_page_aligned_bias): Handle a maxpagesize value of
927         zero.
928
929 2014-01-02  Yuanhui Zhang  <asmwarrior@gmail.com>
930
931         PR binutils/14289
932         * pef.c (bfd_pef_xlib_read_header): Increase buffer size to 80.
933
934 2014-01-02  Nick Clifton  <nickc@redhat.com>
935
936         PR binutils/11983
937         * archive.c (_bfd_get_elt_at_filepos): Store a copy of the
938         filename in the bfd's filename field.
939         * elfcode.h (bfd_from_remote_memory): Likewise.
940         * ieee.c (ieee_object_p): Likewise.
941         * mach-o.c (bfd_mach_o_fat_member_init): Likewise.
942         * oasys.c (oasys_openr_next_archived_file): Likewise.
943         * vms-lib.c (_bfd_vms_lib_get_module): Likewise.
944         * opncls.c (bfd_fopen): Likewise.
945         (bfd_openstreamr): Likewise.
946         (bfd_openr_iovec): Likewise.
947         (bfd_openw): Likewise.
948         (bfd_create): Likewise.
949         (_bfd_delete_bfd): Free filename.
950
951 For older changes see ChangeLog-2013
952 \f
953 Copyright (C) 2014 Free Software Foundation, Inc.
954
955 Copying and distribution of this file, with or without modification,
956 are permitted in any medium without royalty provided the copyright
957 notice and this notice are preserved.
958
959 Local Variables:
960 mode: change-log
961 left-margin: 8
962 fill-column: 74
963 version-control: never
964 End: