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