* elf64-x86-64.c (struct elf_x86_64_backend_data): New type.
[external/binutils.git] / bfd / ChangeLog
1 2012-03-15  Roland McGrath  <mcgrathr@google.com>
2
3         * elf64-x86-64.c (struct elf_x86_64_backend_data): New type.
4         (get_elf_x86_64_backend_data, GET_PLT_ENTRY_SIZE): New macros.
5         (elf_x86_64_arch_bed): New variable.
6         (elf_backend_arch_data): New macro.
7         (elf_x86_64_adjust_dynamic_symbol): Use GET_PLT_ENTRY_SIZE.
8         (elf_x86_64_allocate_dynrelocs): Likewise.
9         (elf_x86_64_relocate_section): Likewise.
10         (elf_x86_64_plt_sym_val): Likewise.
11         (elf_x86_64_finish_dynamic_symbol): Use elf_x86_64_backend_data
12         parameters for PLT details.
13         (elf_x86_64_finish_dynamic_sections): Likewise.
14
15 2012-03-14  Roland McGrath  <mcgrathr@google.com>
16
17         * elf32-i386.c (elf_i386_nacl_pic_plt0_entry): Initialize up
18         to the full size, padding out with nop instructions.
19
20 2012-03-12  Alan Modra  <amodra@gmail.com>
21
22         * elf-m10300.c (_bfd_mn10300_elf_adjust_dynamic_symbol): Don't warn
23         on zero size dynbss symbol.
24         * elf32-arm.c (elf32_arm_adjust_dynamic_symbol): Likewise.
25         * elf32-cr16.c (_bfd_cr16_elf_adjust_dynamic_symbol): Likewise.
26         * elf32-cris.c (elf_cris_adjust_dynamic_symbol): Likewise.
27         * elf32-hppa.c (elf32_hppa_adjust_dynamic_symbol): Likewise.
28         * elf32-i370.c (i370_elf_adjust_dynamic_symbol): Likewise.
29         * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Likewise.
30         * elf32-lm32.c (lm32_elf_adjust_dynamic_symbol): Likewise.
31         * elf32-m32r.c (m32r_elf_adjust_dynamic_symbol): Likewise.
32         * elf32-m68k.c (elf_m68k_adjust_dynamic_symbol): Likewise.
33         * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Likewise.
34         * elf32-s390.c (elf_s390_adjust_dynamic_symbol): Likewise.
35         * elf32-sh.c (sh_elf_adjust_dynamic_symbol): Likewise.
36         * elf32-tic6x.c (elf32_tic6x_adjust_dynamic_symbol): Likewise.
37         * elf32-tilepro.c (tilepro_elf_adjust_dynamic_symbol): Likewise.
38         * elf32-vax.c (elf_vax_adjust_dynamic_symbol): Likewise.
39         * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Likewise.
40         * elf64-s390.c (elf_s390_adjust_dynamic_symbol): Likewise.
41         * elf64-sh64.c (sh64_elf64_adjust_dynamic_symbol): Likewise.
42         * elf64-x86-64.c (elf_x86_64_adjust_dynamic_symbol): Likewise.
43         * elfxx-sparc.c (_bfd_sparc_elf_adjust_dynamic_symbol): Likewise.
44         * elfxx-tilegx.c (tilegx_elf_adjust_dynamic_symbol): Likewise.
45
46 2012-03-10  Edmar Wienskoski  <edmar@freescale.com>
47
48         * archures.c: Add bfd_mach_ppc_e5500 and bfd_mach_ppc_e6500.
49         * bfd-in2.h: Regenerate.
50         * cpu-powerpc.c (bfd_powerpc_archs): Add entries for
51         bfd_mach_ppc_e5500 and bfd_mach_ppc_e6500.
52
53 2012-03-09  H.J. Lu  <hongjiu.lu@intel.com>
54
55         PR ld/13817
56         * bfd/elf32-i386.c (elf_i386_relocate_section): Restore
57         R_386_IRELATIVE.
58
59         * * elf64-x86-64.c (elf_x86_64_relocate_section): Restore
60         R_X86_64_IRELATIVE.
61
62 2012-03-08  Tristan Gingold  <gingold@adacore.com>
63
64         * vms-lib.c (_bfd_vms_lib_write_archive_contents): Set maximum
65         keylen according to archive kind.  Set nextvbn and nextrfa lhd
66         fields.  Add comments.
67
68 2012-03-07  Nick Clifton  <nickc@redhat.com>
69
70         * elf-m10300.c (elf32_mn10300_link_hash_entry): Add tls_type
71         field.
72         (elf32_mn10300_link_hash_table): Add tls_ldm_got entry;
73         (elf_mn10300_tdata): Define.
74         (elf_mn10300_local_got_tls_type): Define.
75         (elf_mn10300_howto_table): Add entries for R_MN10300_TLS_GD,
76         R_MN10300_TLS_LD, R_MN10300_TLS_LDO, R_MN10300_TLS_GOTIE,
77         R_MN10300_TLS_IE, R_MN10300_TLS_LE, R_MN10300_TLS_DPTMOD,
78         R_MN10300_TLS_DTPOFF, R_MN10300_TLS_TPOFF relocs.
79         (mn10300_reloc_map): Likewise.
80         (elf_mn10300_tls_transition): New function.
81         (dtpoff, tpoff, mn10300_do_tls_transition): New functions.
82         (mn10300_elf_check_relocs): Add TLS support.
83         (mn10300_elf_final_link_relocate): Likewise.
84         (mn10300_elf_relocate_section): Likewise.
85         (mn10300_elf_relax_section): Likewise.
86         (elf32_mn10300_link_hash_newfunc): Initialise new field.
87         (_bfd_mn10300_copy_indirect_symbol): New function.
88         (elf32_mn10300_link_hash_table_create): Initialise new fields.
89         (_bfd_mn10300_elf_size_dynamic_sections): Add TLS support.
90         (_bfd_mn10300_elf_finish_dynamic_symbol): Likewise.
91         (_bfd_mn10300_elf_reloc_type_class): Allocate an
92         elf_mn10300_obj_tdata structure.
93         (elf_backend_copy_indirect_symbol): Define.
94         * reloc.c (BFD_MN10300_TLS_GD, BFD_MN10300_TLS_LD,
95         BFD_MN10300_TLS_LDO, BFD_MN10300_TLS_GOTIE, BFD_MN10300_TLS_IE,
96         BFD_MN10300_TLS_LE, BFD_MN10300_TLS_DPTMOD,
97         BFD_MN10300_TLS_DTPOFF, BFD_MN10300_TLS_TPOFF): New relocations.
98         (BFD_RELOC_MN10300_32_PCREL, BFD_RELOC_MN10300_16_PCREL): Move to
99         alongside other MN10300 relocations.
100         * bfd-in2.h: Regenerate.
101         * libbfd.h: Regenerate.
102
103 2012-03-06  Jakub Jelinek  <jakub@redhat.com>
104
105         * elf64-x86-64.c (elf_x86_64_relocate_section): For R_X86_64_RELATIVE
106         set relocate to TRUE.
107
108 2012-03-05  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
109
110         PR ld/12152
111         * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Also ignore
112         overflows for R_SPARC_UA32 in .stab sections.
113
114 2012-03-01  Alan Modra  <amodra@gmail.com>
115
116         * elfxx-tilegx.c (tilegx_elf_relocate_section): Silence bogus warning.
117
118 2012-02-27  Alan Modra  <amodra@gmail.com>
119
120         * elf32-sh.c (sh_elf_osec_to_segment): Check for elf flavour bfd
121         before calling elf specific function.
122         (sh_elf_osec_readonly_p): Test for error return from above.
123
124 2012-02-27  Alan Modra  <amodra@gmail.com>
125
126         * elf32-spu.c (build_stub): Fix malloc under-allocation.
127
128 2012-02-25  Walter Lee  <walt@tilera.com>
129         * reloc.c: Add BFD_RELOC_TILEPRO_TLS_GD_CALL,
130         BFD_RELOC_TILEPRO_IMM8_X0_TLS_GD_ADD,
131         BFD_RELOC_TILEPRO_IMM8_X1_TLS_GD_ADD,
132         BFD_RELOC_TILEPRO_IMM8_Y0_TLS_GD_ADD,
133         BFD_RELOC_TILEPRO_IMM8_Y1_TLS_GD_ADD,
134         BFD_RELOC_TILEPRO_TLS_IE_LOAD, BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE,
135         BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE,
136         BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_LO,
137         BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_LO,
138         BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_HI,
139         BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_HI,
140         BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_HA,
141         BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_HA,
142         BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_LE,
143         BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_LE,
144         BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_LE,
145         BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_LE,
146         BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_LE,
147         BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_LE,
148         BFD_RELOC_TILEGX_TLS_GD_CALL, BFD_RELOC_TILEGX_IMM8_X0_TLS_GD_ADD,
149         BFD_RELOC_TILEGX_IMM8_X1_TLS_GD_ADD,
150         BFD_RELOC_TILEGX_IMM8_Y0_TLS_GD_ADD,
151         BFD_RELOC_TILEGX_IMM8_Y1_TLS_GD_ADD, BFD_RELOC_TILEGX_TLS_IE_LOAD,
152         BFD_RELOC_TILEGX_IMM8_X0_TLS_ADD,
153         BFD_RELOC_TILEGX_IMM8_X1_TLS_ADD,
154         BFD_RELOC_TILEGX_IMM8_Y0_TLS_ADD, BFD_RELOC_TILEGX_IMM8_Y1_TLS_ADD.
155         Delete BFD_RELOC_TILEGX_IMM16_X0_HW1_GOT,
156         BFD_RELOC_TILEGX_IMM16_X1_HW1_GOT,
157         BFD_RELOC_TILEGX_IMM16_X0_HW2_GOT,
158         BFD_RELOC_TILEGX_IMM16_X1_HW2_GOT,
159         BFD_RELOC_TILEGX_IMM16_X0_HW3_GOT,
160         BFD_RELOC_TILEGX_IMM16_X1_HW3_GOT,
161         BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_GOT,
162         BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_GOT,
163         BFD_RELOC_TILEGX_IMM16_X0_HW1_TLS_GD,
164         BFD_RELOC_TILEGX_IMM16_X1_HW1_TLS_GD,
165         BFD_RELOC_TILEGX_IMM16_X0_HW2_TLS_GD,
166         BFD_RELOC_TILEGX_IMM16_X1_HW2_TLS_GD,
167         BFD_RELOC_TILEGX_IMM16_X0_HW3_TLS_GD,
168         BFD_RELOC_TILEGX_IMM16_X1_HW3_TLS_GD,
169         BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_TLS_GD,
170         BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_TLS_GD,
171         BFD_RELOC_TILEGX_IMM16_X0_HW1_TLS_IE,
172         BFD_RELOC_TILEGX_IMM16_X1_HW1_TLS_IE,
173         BFD_RELOC_TILEGX_IMM16_X0_HW2_TLS_IE,
174         BFD_RELOC_TILEGX_IMM16_X1_HW2_TLS_IE,
175         BFD_RELOC_TILEGX_IMM16_X0_HW3_TLS_IE,
176         BFD_RELOC_TILEGX_IMM16_X1_HW3_TLS_IE,
177         BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_TLS_IE,
178         BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_TLS_IE.
179         * elf32-tilepro.c (tilepro_elf_howto_table): Update tilepro
180         relocations.
181         (tilepro_reloc_map): Ditto.
182         (tilepro_info_to_howto_rela): Ditto.
183         (reloc_to_create_func): Ditto.
184         (tilepro_tls_translate_to_le): New.
185         (tilepro_tls_translate_to_ie): New.
186         (tilepro_elf_tls_transition): New.
187         (tilepro_elf_check_relocs): Handle new tls relocations.
188         (tilepro_elf_gc_sweep_hook): Ditto.
189         (allocate_dynrelocs): Ditto.
190         (tilepro_elf_relocate_section): Ditto.
191         (tilepro_replace_insn): New.
192         (insn_mask_X1): New.
193         (insn_mask_X0_no_dest_no_srca): New
194         (insn_mask_X1_no_dest_no_srca): New
195         (insn_mask_Y0_no_dest_no_srca): New
196         (insn_mask_Y1_no_dest_no_srca): New
197         (srca_mask_X0): New
198         (srca_mask_X1): New
199         (insn_tls_le_move_X1): New
200         (insn_tls_le_move_zero_X0X1): New
201         (insn_tls_ie_lw_X1): New
202         (insn_tls_ie_add_X0X1): New
203         (insn_tls_ie_add_Y0Y1): New
204         (insn_tls_gd_add_X0X1): New
205         (insn_tls_gd_add_Y0Y1): New
206         * elfxx-tilegx.c (tilegx_elf_howto_table): Update tilegx
207         relocations.
208         (tilegx_reloc_map): Ditto.
209         (tilegx_info_to_howto_rela): Ditto.
210         (reloc_to_create_func): Ditto.
211         (tilegx_elf_link_hash_table): New field disable_le_transition.
212         (tilegx_tls_translate_to_le): New.
213         (tilegx_tls_translate_to_ie): New.
214         (tilegx_elf_tls_transition): New.
215         (tilegx_elf_check_relocs): Handle new tls relocations.
216         (tilegx_elf_gc_sweep_hook): Ditto.
217         (allocate_dynrelocs): Ditto.
218         (tilegx_elf_relocate_section): Ditto.
219         (tilegx_copy_bits): New.
220         (tilegx_replace_insn): New.
221         (insn_mask_X1): New.
222         (insn_mask_X0_no_dest_no_srca): New.
223         (insn_mask_X1_no_dest_no_srca): New.
224         (insn_mask_Y0_no_dest_no_srca): New.
225         (insn_mask_Y1_no_dest_no_srca): New.
226         (insn_mask_X0_no_operand): New.
227         (insn_mask_X1_no_operand): New.
228         (insn_mask_Y0_no_operand): New.
229         (insn_mask_Y1_no_operand): New.
230         (insn_tls_ie_ld_X1): New.
231         (insn_tls_ie_ld4s_X1): New.
232         (insn_tls_ie_add_X0X1): New.
233         (insn_tls_ie_add_Y0Y1): New.
234         (insn_tls_ie_addx_X0X1): New.
235         (insn_tls_ie_addx_Y0Y1): New.
236         (insn_tls_gd_add_X0X1): New.
237         (insn_tls_gd_add_Y0Y1): New.
238         (insn_move_X0X1): New.
239         (insn_move_Y0Y1): New.
240         (insn_add_X0X1): New.
241         (insn_add_Y0Y1): New.
242         (insn_addx_X0X1): New.
243         (insn_addx_Y0Y1): New.
244         * libbfd.h: Regenerate.
245         * bfd-in2.h: Regenerate.
246
247 2012-02-25  Walter Lee  <walt@tilera.com>
248
249         * config.bfd (tilegx-*-*): rename little endian vector; add big
250         endian vector.
251         (tilegxbe-*-*): New case.
252         * configure.in (bfd_elf32_tilegx_vec): Rename...
253         (bfd_elf32_tilegx_le_vec): ... to this.
254         (bfd_elf32_tilegx_be_vec): New vector.
255         (bfd_elf64_tilegx_vec): Rename...
256         (bfd_elf64_tilegx_le_vec): ... to this.
257         (bfd_elf64_tilegx_be_vec): New vector.
258         * configure: Regenerate.
259         * elf32-tilegx.c (TARGET_LITTLE_SYM): Rename.
260         (TARGET_LITTLE_NAME): Ditto.
261         (TARGET_BIG_SYM): Define.
262         (TARGET_BIG_NAME): Define.
263         * elf64-tilegx.c (TARGET_LITTLE_SYM): Rename.
264         (TARGET_LITTLE_NAME): Ditto.
265         (TARGET_BIG_SYM): Define.
266         (TARGET_BIG_NAME): Define.
267         * targets.c (bfd_elf32_tilegx_vec): Rename...
268         (bfd_elf32_tilegx_le_vec): ... to this.
269         (bfd_elf32_tilegx_be_vec): Declare.
270         (bfd_elf64_tilegx_vec): Rename...
271         (bfd_elf64_tilegx_le_vec): ... to this.
272         (bfd_elf64_tilegx_be_vec): Declare.
273         (_bfd_target_vector): Add / rename above vectors.
274         * arctures.c (bfd_architecture): Define bfd_mach_tilegx32.
275         * bfd-in2.h: Regenerate.
276         * cpu-tilegx.c (bfd_tilegx32_arch): define.
277         (bfd_tilegx_arch): link to bfd_tilegx32_arch.
278
279 2012-02-24  Nick Clifton  <nickc@redhat.com>
280
281         PR ld/13730
282         * reloc.c (bfd_generic_get_relocated_section_contents): Issue an
283         error message instead of aborting, when an outofrange reloc is
284         encountered.
285
286 2012-02-23  Iain Sandoe  <idsandoe@googlemail.com>
287
288         * mach-o.c (bfd_mach_o_swap_in_non_scattered_reloc): New.
289         (bfd_mach_o_canonicalize_one_reloc):  Swap non-scattered reloc
290         bit-fields when target and host differ in endian-ness.  When
291         PAIRs are non-scattered find the 'symbol' from the preceding
292         reloc.  Add FIXME re. reloc symbols on section boundaries.
293         (bfd_mach_o_swap_out_non_scattered_reloc): New.
294         (bfd_mach_o_write_relocs): Use bfd_mach_o_encode_non_scattered_reloc.
295
296 2012-02-17  Iain Sandoe  <idsandoe@googlemail.com>
297
298         * mach-o-i386.c (i386_howto_table): Add support for 16 bit
299         sect-diffs.
300         (bfd_mach_o_i386_swap_reloc_in): Handle 16bit sect-diffs.
301         (bfd_mach_o_i386_swap_reloc_out): Likewise.
302
303 2012-02-17  Tristan Gingold  <gingold@adacore.com>
304
305         * reloc.c (BFD_RELOC_MACH_O_LOCAL_SECTDIFF):
306         * libbfd.h: Regenerated.
307         * bfd-in2.h: Likewise.
308         * mach-o-i386.c (i386_howto_table): Include local sectdiff.
309         (bfd_mach_o_i386_swap_reloc_in): Update for local sectdiff.
310         (bfd_mach_o_i386_swap_reloc_out): Likewise.
311
312 2012-02-17  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>
313
314         * elf32-s390.c (elf_s390_relocate_section): Support basr in the
315         GD->LE and LD->LE optimizations.
316
317 2012-02-16  Alan Modra  <amodra@gmail.com>
318
319         PR binutils/13355
320         * elf32-rx.c (elf32_rx_relax_section): Correct width check.
321
322 2012-02-13  Richard Henderson  <rth@redhat.com>
323
324         PR ld/13621
325         * linker.c (fix_syms): Force symbols outside any section into
326         bfd_abs_section_ptr.
327
328 2012-02-13  Alan Modra  <amodra@gmail.com>
329
330         * elf32-m68hc1x.c (elf32_m68hc11_merge_symbol_attribute): New function.
331         * elf32-m68hc1x.h (elf32_m68hc11_merge_symbol_attribute): Declare.
332         * elf32-m68hc11.c (elf_backend_merge_symbol_attribute): Define.
333         * elf32-m68hc12.c (elf_backend_merge_symbol_attribute): Define.
334
335 2012-02-11  Jan Kratochvil  <jan.kratochvil@redhat.com>
336             Nick Clifton  <nickc@redhat.com>
337
338         * oasys.c (oasys_write_header): Fix compilation warning on zero-sized
339         memset.
340
341 2012-02-10  Iain Sandoe  <idsandoe@googlemail.com>
342
343         * mach-o.c (bfd_mach_o_build_seg_command): Count zerofill section
344         vma additions in their logical, rather than physical order.
345
346 2012-02-10  Iain Sandoe  <idsandoe@googlemail.com>
347
348         * mach-o.c (mach_o_section_name_xlat): Correct eh-frame section
349         parameters.
350         * mach-o-x86-64.c (text_section_names_xlat): New.
351         (mach_o_x86_64_segsec_names_xlat): New.
352         (bfd_mach_o_tgt_seg_table): Define to mach_o_x86_64_segsec_names_xlat.
353         * mach-o-i386.c (text_section_names_xlat): Correct section parameters.
354
355 2012-02-10  Tristan Gingold  <gingold@adacore.com>
356
357         * elfnn-ia64.c (elfNN_vms_object_p): Change comparison operator
358         to avoid infinite loop.  Add comments.
359
360 2012-02-09  H.J. Lu  <hongjiu.lu@intel.com>
361
362         PR ld/13675
363         * cpu-i386.c (bfd_arch_i386_fill): Updated to support multi byte
364         nop instructions.
365         (bfd_arch_i386_short_nop_fill): New.
366         (bfd_arch_i386_long_nop_fill): Likewise.
367         Use bfd_arch_i386_short_nop_fill in 32bit bfd_arch_info
368         initializers.  Use bfd_arch_i386_long_nop_fill on 64bit
369         bfd_arch_info initializers.
370
371         * cpu-k1om.c (bfd_arch_i386_fill): Renamed to ...
372         (bfd_arch_i386_short_nop_fill): This.
373         Update bfd_arch_info initializers.
374         * cpu-l1om.c: Likewise.
375
376 2012-02-08  Alan Modra  <amodra@gmail.com>
377
378         * elflink.c (_bfd_elf_gc_mark_rsec): Mark weakdef syms too.
379         (_bfd_elf_fix_symbol_flags): When a weakdef is def_regular, clear
380         the correct h->u.weakdef.
381
382 2012-02-07  Alan Modra  <amodra@gmail.com>
383
384         * elf.c (elf_find_function): Don't use internal_elf_sym.
385         (_bfd_elf_maybe_function_sym): Likewise.  Replace elf_symbol_type
386         parameter with asymbol.
387         * elf64-ppc.c (ppc64_elf_maybe_function_sym): Likewise.
388         * elf-bfd.h (_bfd_elf_maybe_function_sym): Update prototype.
389         (struct elf_backend_data <maybe_function_sym>): Likewise.
390
391 2012-02-02  Vidya Praveen (vidya.praveen@atmel.com)
392
393         PR bfd/13410
394         * bfd/elf32-avr.c (elf32_avr_relax_section): Correct the
395         condition that qualifies the candidates for relaxation.
396
397 2012-02-02  Tristan Gingold  <gingold@adacore.com>
398
399         * bfdio.c (real_fopen): Remove unused vms_modes variable.
400
401 2012-02-02  Tristan Gingold  <gingold@adacore.com>
402
403         * mach-o.c (bfd_mach_o_read_header): Silent uninitialized
404         variable warning.
405
406 2012-02-02  Tristan Gingold  <gingold@adacore.com>
407
408         * archive.c (bfd_slurp_armap): Fix thinko in cast.
409
410 2012-01-31  H.J. Lu  <hongjiu.lu@intel.com>
411
412         PR ld/13616
413         * archures.c (bfd_arch_info): Add fill.
414         (bfd_default_arch_struct): Add bfd_arch_default_fill.
415         (bfd_arch_default_fill): New.
416
417         * configure.in: Set bfd version to 2.22.52.
418         * configure: Regenerated.
419
420         * cpu-alpha.c: Add bfd_arch_default_fill to bfd_arch_info
421         initializer.
422         * cpu-arc.c: Likewise.
423         * cpu-arm.c: Likewise.
424         * cpu-avr.c: Likewise.
425         * cpu-bfin.c: Likewise.
426         * cpu-cr16.c: Likewise.
427         * cpu-cr16c.c: Likewise.
428         * cpu-cris.c: Likewise.
429         * cpu-crx.c: Likewise.
430         * cpu-d10v.c: Likewise.
431         * cpu-d30v.c: Likewise.
432         * cpu-dlx.c: Likewise.
433         * cpu-epiphany.c: Likewise.
434         * cpu-fr30.c: Likewise.
435         * cpu-frv.c: Likewise.
436         * cpu-h8300.c: Likewise.
437         * cpu-h8500.c: Likewise.
438         * cpu-hppa.c: Likewise.
439         * cpu-i370.c: Likewise.
440         * cpu-i860.c: Likewise.
441         * cpu-i960.c: Likewise.
442         * cpu-ia64.c: Likewise.
443         * cpu-ip2k.c: Likewise.
444         * cpu-iq2000.c: Likewise.
445         * cpu-lm32.c: Likewise.
446         * cpu-m10200.c: Likewise.
447         * cpu-m10300.c: Likewise.
448         * cpu-m32c.c: Likewise.
449         * cpu-m32r.c: Likewise.
450         * cpu-m68hc11.c: Likewise.
451         * cpu-m68hc12.c: Likewise.
452         * cpu-m68k.c: Likewise.
453         * cpu-m88k.c: Likewise.
454         * cpu-mcore.c: Likewise.
455         * cpu-mep.c: Likewise.
456         * cpu-microblaze.c: Likewise.
457         * cpu-mips.c: Likewise.
458         * cpu-mmix.c: Likewise.
459         * cpu-moxie.c: Likewise.
460         * cpu-msp430.c: Likewise.
461         * cpu-mt.c: Likewise.
462         * cpu-ns32k.c: Likewise.
463         * cpu-openrisc.c: Likewise.
464         * cpu-or32.c: Likewise.
465         * cpu-pdp11.c: Likewise.
466         * cpu-pj.c: Likewise.
467         * cpu-plugin.c: Likewise.
468         * cpu-powerpc.c: Likewise.
469         * cpu-rl78.c: Likewise.
470         * cpu-rs6000.c: Likewise.
471         * cpu-rx.c: Likewise.
472         * cpu-s390.c: Likewise.
473         * cpu-score.c: Likewise.
474         * cpu-sh.c: Likewise.
475         * cpu-sparc.c: Likewise.
476         * cpu-spu.c: Likewise.
477         * cpu-tic30.c: Likewise.
478         * cpu-tic4x.c: Likewise.
479         * cpu-tic54x.c: Likewise.
480         * cpu-tic6x.c: Likewise.
481         * cpu-tic80.c: Likewise.
482         * cpu-tilegx.c: Likewise.
483         * cpu-tilepro.c: Likewise.
484         * cpu-v850.c: Likewise.
485         * cpu-vax.c: Likewise.
486         * cpu-w65.c: Likewise.
487         * cpu-we32k.c: Likewise.
488         * cpu-xc16x.c: Likewise.
489         * cpu-xstormy16.c: Likewise.
490         * cpu-xtensa.c: Likewise.
491         * cpu-z80.c: Likewise.
492         * cpu-z8k.c: Likewise.
493
494         * cpu-i386.c: Include "libiberty.h".
495         (bfd_arch_i386_fill): New.
496         Add bfd_arch_i386_fill to  bfd_arch_info initializer.
497
498         * cpu-k1om.c: Add bfd_arch_i386_fill to  bfd_arch_info initializer.
499         * cpu-l1om.c: Likewise.
500
501         * linker.c (default_data_link_order): Call abfd->arch_info->fill
502         if fill size is 0.
503
504         * bfd-in2.h: Regenerated.
505
506 2012-01-27  Michael Eager  <eager@eagercon.com>
507
508         * bfd/elf32-microblaze.c (create_got_section):
509         Reuse existing .rela.got section.
510
511 2012-01-23  Alan Modra  <amodra@gmail.com>
512
513         * elf-bfd.h: Formatting.
514         (struct elf_backend_data): Add "maybe_function_sym".
515         (_bfd_elf_maybe_function_sym): Declare.
516         * elfxx-target.h (elf_backend_maybe_function_sym): Define.
517         (elfNN_bed): Init new field.
518         * elf.c (elf_find_function): Use maybe_function_sym.
519         (_bfd_elf_maybe_function_sym): New function.
520         * elf64-ppc.c (elf_backend_maybe_function_sym): Define.
521         (ppc64_elf_maybe_function_sym): New function.
522
523 2012-01-20  Francois Gouget  <fgouget@codeweavers.com>
524
525         PR binutils/13534
526         * archive.c (_bfd_ar_sizepad): New function. Correctly install and
527         pad the size field in an archive header.
528         (_bfd_generic_read_ar_hdr_mag): Use the correct type and scan
529         function for the archive size field.
530         (bfd_generic_openr_next_archived_file): Likewise.
531         (do_slurp_coff_armap): Likewise.
532         (_bfd_write_archive_contents): Likewise.
533         (_bfd_bsd44_write_ar_hdr): Use the new function.
534         (bfd_ar_hdr_from_filesystem): Likewise.
535         (_bfd_write_archive_contents): Likewise.
536         (bsd_write_armap): Likewise.
537         (coff_write_armap): Likewise.
538         * archive64.c (bfd_elf64_archive_write_armap): Likewise.
539         * bfdio.c (bfd_bread): Use correct type for archive element
540         sizes.
541         * ar.c (open_inarch): Likewise.
542         (extract_file): Likewise.
543         * libbfd-in.h (struct areltdata): Use correct types for
544         parsed_size and extra_size fields.
545         Prototype _bfd_ar_sizepad function.
546         * libbfd.h: Regenerate.
547
548 2012-01-20  Ulrich Weigand  <ulrich.weigand@linaro.org>
549
550         * elf.c (elfcore_write_prpsinfo): Provide unconditionally.
551         Return NULL if core file generation is unsupported.
552         (elfcore_write_prstatus): Likewise.
553         * elf32-arm.c (elf32_arm_nabi_write_core_note): New function.
554         (elf_backend_write_core_note): Define.
555
556 2012-01-19  Tristan Gingold  <gingold@adacore.com>
557
558         * pef.c: Add a comment.
559         * xsym.c: Likewise.
560
561 2012-01-17  Alan Modra  <amodra@gmail.com>
562
563         * elf32-ppc.c (ppc_elf_write_core_note <NT_PRPSINFO>): Don't leave
564         trailing garbage in the note.
565         * elf64-ppc.c (ppc64_elf_write_core_note <NT_PRPSINFO>): Likewise.
566
567 2012-01-16  Daniel Green  <venix1@gmail.com>
568
569         PR ld/13491
570         * coff-i386.c (coff_i386_rtype_to_howto <R_SECREL32>): Test
571         h->root.type not h->type.
572         * coff-x86_64.c (coff_amd64_rtype_to_howto <R_AMD64_SECREL>): Likewise.
573
574 2012-01-13  Iain Sandoe  <idsandoe@googlemail.com>
575
576         * mach-o.c (bfd_mach_o_build_dysymtab_command): Handle absolute
577         indirect symbols.
578
579 2012-01-13  Iain Sandoe  <idsandoe@googlemail.com>
580
581         * mach-o.c (bfd_mach_o_write_relocs): Move computation of relocs file
582         position from here... to (bfd_mach_o_build_seg_command): Here.
583
584 2012-01-12  Iain Sandoe  <idsandoe@googlemail.com>
585
586         * mach-o.c (bfd_mach_o_count_indirect_symbols): New.
587         (bfd_mach_o_build_dysymtab_command): Populate indirect symbol table.
588         * mach-o.h (bfd_mach_o_asymbol): Move declaration to start of the
589         file. (bfd_mach_o_section): Add indirect_syms field.
590
591 2012-01-11  Iain Sandoe  <idsandoe@googlemail.com>
592
593         * mach-o.c (bfd_mach_o_build_seg_command): Separate computation of
594         vmsize from filesize.  Don't compute offsets or file sizes for
595         zerofill sections.
596
597 2012-01-11  Iain Sandoe  <idsandoe@googlemail.com>
598
599         * mach-o.c (bfd_mach_o_build_commands): Make the building of each
600         command type independent.
601
602 2012-01-11  Alan Modra  <amodra@gmail.com>
603
604         * elf64-ppc.c: Define more insns used in plt call stubs.
605         (ppc64_elf_brtaken_reloc): Assume isa version 2 or above.
606         (ppc64_elf_relocate_section): Likewise.
607         (enum ppc_stub_type): Add ppc_stub_plt_call_r2save.
608         (struct ppc_link_hash_table): Increase size of stub_count array.
609         Add plt_stub_align and plt_thread_safe.
610         (ALWAYS_USE_FAKE_DEP, ALWAYS_EMIT_R2SAVE): Define.
611         (plt_stub_size, plt_stub_pad): New functions.
612         (build_plt_stub): Emit barriers for power7 thread safety.  Don't
613         emit needless save of r2.
614         (build_tls_get_addr_stub): Adjust params.
615         (ppc_build_one_stub): Handle ppc_stub_plt_call_r2save and aligning
616         plt stubs.  Adjust build_*plt_stub calls.
617         (ppc_size_one_stub): Similarly.
618         (ppc64_elf_size_stubs): Accept plt_thread_safe and plt_stub_align
619         params.  Choose default for plt_thread_safe based on existence of
620         calls to thread creation functions.  Modify plt_call to
621         plt_call_r2save when no tocsave reloc found.  Align tail of stub
622         sections.
623         (ppc64_elf_build_stubs): Align tail of stub sections.  Adjust
624         output of stub statistics.
625         (ppc64_elf_relocate_section): Handle ppc_stub_plt_call_r2save.
626         * elf64-ppc.h (ppc64_elf_size_stubs): Update prototype.
627
628 2012-01-10  H.J. Lu  <hongjiu.lu@intel.com>
629
630         PR ld/13581
631         * elf64-x86-64.c (elf_x86_64_relocate_section): Remove ABI_64_P
632         check on R_X86_64_PCXX.
633
634 2012-01-10  Tristan Gingold  <gingold@adacore.com>
635
636         * mach-o.c (bfd_mach_o_build_commands): Avoid uninitialized false
637         warning.
638
639 2012-01-10  Tristan Gingold  <gingold@adacore.com>
640
641         * bfdio.c (bfd_tell): Handle nested archives.
642         (bfd_seek): Ditto.
643         * cache.c (bfd_cache_lookup_worker): Ditto.
644         * archive.c (_bfd_get_elt_at_filepos): Remove code dealing with
645         nested archives.
646         (bfd_generic_openr_next_archived_file): Likewise.
647
648 2012-01-09  Iain Sandoe  <idsandoe@googlemail.com>
649
650         * mach-o.c (bfd_mach_o_bfd_copy_private_symbol_data): Implement.
651         (bfd_mach_o_write_symtab): Remove handling for indirect syms.
652         (bfd_mach_o_primary_symbol_sort_key): Likewise.
653         (bfd_mach_o_cf_symbols): Likewise.
654         (bfd_mach_o_sort_symbol_table): Remove.
655         (bfd_mach_o_mangle_symbols): Adjust arguments, remove handling
656         for indirect and dysymtab counts.  Do the symbol sorting here.
657         (bfd_mach_o_build_dysymtab_command): Count the symbol types here.
658         Make the indirect symbols a TODO.
659         (bfd_mach_o_build_commands): Adjust call to bfd_mach_o_mangle_symbols.
660         (bfd_mach_o_make_empty_symbol): Specifically flag unset symbols with
661         a non-zero value.
662         (bfd_mach_o_read_symtab_symbol): Record the symbol index.
663         (bfd_mach_o_read_symtab_symbol): Adjust recording of global status.
664         * mach-o.h (mach_o_data_struct): Remove indirect and dysymtab entries.
665         (IS_MACHO_INDIRECT): Remove.
666         (SYM_MACHO_FIELDS_UNSET, SYM_MACHO_FIELDS_NOT_VALIDATED): New.
667
668 2012-01-06  Nick Clifton  <nickc@redhat.com>
669
670         PR binutils/13121
671         * reloc.c (bfd_generic_lookup_section_flags): Rename 'finfo' to
672         'flaginfo' to avoid conflicts with AIX system headers.
673
674 2012-01-06  Tristan Gingold  <gingold@adacore.com>
675
676         * bfdio.c (bfd_bread): Use arelt_size macro.
677
678 2012-01-06  Tristan Gingold  <gingold@adacore.com>
679
680         * config.bfd (i[3-7]86-*-darwin*): Define targ64_selvecs.
681
682 2012-01-05  Nick Clifton  <nickc@redhat.com>
683
684         PR ld/12161
685         * elf32-avr.c (elf32_avr_relax_delete_bytes): Read in relocs if
686         necessary.
687
688 2012-01-05  Jan Kratochvil  <jan.kratochvil@redhat.com>
689
690         Fix zero registers core files when built by gcc-4.7.
691         * elf64-x86-64.c (elf_x86_64_write_core_note): Remove variables p and
692         size.  Call elfcore_write_note for the local variables.  Remove the
693         final elfcore_write_note call.  Add NOTREACHED comments.
694
695 2012-01-04  Tristan Gingold  <gingold@adacore.com>
696
697         * mach-o.c (bfd_mach_o_fat_stat_arch_elt): New function.
698         (bfd_mach_o_generic_stat_arch_elt): Adjust.
699
700 2012-01-04  Tristan Gingold  <gingold@adacore.com>
701
702         * mach-o.c (bfd_mach_o_fat_member_init): New function.
703         (bfd_mach_o_openr_next_archived_file): Reindent.
704         Adjust to call bfd_mach_o_fat_member_init.
705         (bfd_mach_o_fat_extract): Adjust to call bfd_mach_o_fat_member_init.
706
707 2012-01-04  Tristan Gingold  <gingold@adacore.com>
708
709         * mach-o-x86-64.c (bfd_mach_o_x86_64_swap_reloc_out): Handle
710         BFD_RELOC_32, BFD_RELOC_MACH_O_X86_64_PCREL32_1,
711         BFD_RELOC_MACH_O_X86_64_PCREL32_2,
712         BFD_RELOC_MACH_O_X86_64_PCREL32_4,
713         BFD_RELOC_MACH_O_X86_64_BRANCH32,
714         BFD_RELOC_MACH_O_X86_64_SUBTRACTOR32,
715         BFD_RELOC_MACH_O_X86_64_GOT.
716
717 2012-01-04  Tristan Gingold  <gingold@adacore.com>
718
719         * mach-o.h (bfd_mach_o_fvmlib_command): New structure.
720         (bfd_mach_o_load_command): Add fvmlib field.
721
722         * mach-o.c (bfd_mach_o_read_fvmlib): New function.
723         (bfd_mach_o_read_command): Handle fvmlib.
724
725 2012-01-04  Tristan Gingold  <gingold@adacore.com>
726
727         * mach-o.c (bfd_mach_o_convert_architecture): Reindent.
728         Decode msubtype for ARM.
729
730 2012-01-04  Tristan Gingold  <gingold@adacore.com>
731
732         * mach-o.c (bfd_mach_o_get_synthetic_symtab): Add comments.
733
734 2012-01-04  Tristan Gingold  <gingold@adacore.com>
735
736         * mach-o.h: Reindent header.
737         (bfd_mach_o_encryption_info_command): New structure.
738         (bfd_mach_o_load_command): Add encryption_info field.
739
740         * mach-o.c (bfd_mach_o_read_encryption_info): New function.
741         (bfd_mach_o_read_command): Handle BFD_MACH_O_LC_ENCRYPTION_INFO.
742         (bfd_mach_o_read_command): Adjust error message.
743
744 2012-01-04  Shinichiro Hamaji  <shinichiro.hamaji@gmail.com>
745
746         * dwarf2.c (_bfd_dwarf2_slurp_debug_info): Factor out the part
747         which reads DWARF2 and stores in stash from find_line.
748         (find_line) Call _bfd_dwarf2_slurp_debug_info.
749         * libbfd-in.h (_bfd_dwarf2_slurp_debug_info): Add declaration.
750         * libbfd.h (_bfd_dwarf2_slurp_debug_info): Regenerate.
751         * mach-o.c (dsym_subdir): The name of subdir where debug
752         information may be stored.
753         (bfd_mach_o_lookup_uuid_command): New. Lookup a load command whose
754         type is UUID.
755         (bfd_mach_o_dsym_for_uuid_p): New. Check if the specified BFD is
756         corresponding to the executable.
757         (bfd_mach_o_find_dsym): New. Find a debug information BFD in the
758         specified binary file.
759         (bfd_mach_o_follow_dsym): New. Find a debug information BFD for
760         the original BFD.
761         (bfd_mach_o_find_nearest_line): Check dSYM files for Mach-O
762         executables, dylibs, and bundles.
763         (bfd_mach_o_close_and_cleanup): Clean up BFDs for the dSYM file.
764         * mach-o.h (dsym_bfd): The BFD of the dSYM file.
765
766 2012-01-03  Iain Sandoe  <idsandoe@googlemail.com>
767
768         * mach-o.c (bfd_mach_o_mangle_symbols): Put in the section index
769         for stabd symbols.
770         (bfd_mach_o_primary_symbol_sort_key): Adjust for stabs.
771         (bfd_mach_o_cf_symbols): Likewise.
772
773 2012-01-03  Iain Sandoe  <idsandoe@googlemail.com>
774
775         * mach-o.c (bfd_mach_o_mangle_symbols): Correct typo.
776
777 2012-01-03  Iain Sandoe  <idsandoe@googlemail.com>
778
779         * mach-o.c (bfd_mach_o_write_symtab): Fill in the string table index
780         as the value of an indirect symbol.  Keep the string table index in
781         non-indirect syms for reference.
782         (bfd_mach_o_write_dysymtab): New.
783         (bfd_mach_o_primary_symbol_sort_key): New.
784         (bfd_mach_o_cf_symbols): New.
785         (bfd_mach_o_sort_symbol_table): New.
786         (bfd_mach_o_mangle_symbols): Return early if no symbols.  Sort symbols.
787         If we are emitting a dysymtab, process indirect symbols and count the
788         number of each other kind.
789         (bfd_mach_o_mangle_sections): New.
790         (bfd_mach_o_write_contents): Split out some pre-requisite code into
791         the command builder. Write dysymtab if the command is present.
792         (bfd_mach_o_count_sections_for_seg): New.
793         (bfd_mach_o_build_seg_command): New.
794         (bfd_mach_o_build_dysymtab_command): New.
795         (bfd_mach_o_build_commands): Reorganize to support the fact that some
796         commands are optional and should not be emitted if there are no
797         sections or symbols.
798         (bfd_mach_o_set_section_contents): Amend comment.
799         * mach-o.h: Amend and add to comments.
800         (mach_o_data_struct): Add fields for dysymtab symbols counts and a
801         pointer to the indirects, when present.
802         (bfd_mach_o_should_emit_dysymtab): New macro.
803         (IS_MACHO_INDIRECT): Likewise.
804
805 For older changes see ChangeLog-2011
806 \f
807 Local Variables:
808 mode: change-log
809 left-margin: 8
810 fill-column: 74
811 version-control: never
812 End: