56d2a55b7fbf0711881c1563130880a6d8f4b46a
[external/binutils.git] / bfd / ChangeLog
1 2012-02-16  Alan Modra  <amodra@gmail.com>
2
3         PR binutils/13355
4         * elf32-rx.c (elf32_rx_relax_section): Correct width check.
5
6 2012-02-13  Richard Henderson  <rth@redhat.com>
7
8         PR ld/13621
9         * linker.c (fix_syms): Force symbols outside any section into
10         bfd_abs_section_ptr.
11
12 2012-02-13  Alan Modra  <amodra@gmail.com>
13
14         * elf32-m68hc1x.c (elf32_m68hc11_merge_symbol_attribute): New function.
15         * elf32-m68hc1x.h (elf32_m68hc11_merge_symbol_attribute): Declare.
16         * elf32-m68hc11.c (elf_backend_merge_symbol_attribute): Define.
17         * elf32-m68hc12.c (elf_backend_merge_symbol_attribute): Define.
18
19 2012-02-11  Jan Kratochvil  <jan.kratochvil@redhat.com>
20             Nick Clifton  <nickc@redhat.com>
21
22         * oasys.c (oasys_write_header): Fix compilation warning on zero-sized
23         memset.
24
25 2012-02-10  Iain Sandoe  <idsandoe@googlemail.com>
26
27         * mach-o.c (bfd_mach_o_build_seg_command): Count zerofill section
28         vma additions in their logical, rather than physical order.
29
30 2012-02-10  Iain Sandoe  <idsandoe@googlemail.com>
31
32         * mach-o.c (mach_o_section_name_xlat): Correct eh-frame section
33         parameters.
34         * mach-o-x86-64.c (text_section_names_xlat): New.
35         (mach_o_x86_64_segsec_names_xlat): New.
36         (bfd_mach_o_tgt_seg_table): Define to mach_o_x86_64_segsec_names_xlat.
37         * mach-o-i386.c (text_section_names_xlat): Correct section parameters.
38
39 2012-02-10  Tristan Gingold  <gingold@adacore.com>
40
41         * elfnn-ia64.c (elfNN_vms_object_p): Change comparison operator
42         to avoid infinite loop.  Add comments.
43
44 2012-02-09  H.J. Lu  <hongjiu.lu@intel.com>
45
46         PR ld/13675
47         * cpu-i386.c (bfd_arch_i386_fill): Updated to support multi byte
48         nop instructions.
49         (bfd_arch_i386_short_nop_fill): New.
50         (bfd_arch_i386_long_nop_fill): Likewise.
51         Use bfd_arch_i386_short_nop_fill in 32bit bfd_arch_info
52         initializers.  Use bfd_arch_i386_long_nop_fill on 64bit
53         bfd_arch_info initializers.
54
55         * cpu-k1om.c (bfd_arch_i386_fill): Renamed to ...
56         (bfd_arch_i386_short_nop_fill): This.
57         Update bfd_arch_info initializers.
58         * cpu-l1om.c: Likewise.
59
60 2012-02-08  Alan Modra  <amodra@gmail.com>
61
62         * elflink.c (_bfd_elf_gc_mark_rsec): Mark weakdef syms too.
63         (_bfd_elf_fix_symbol_flags): When a weakdef is def_regular, clear
64         the correct h->u.weakdef.
65
66 2012-02-07  Alan Modra  <amodra@gmail.com>
67
68         * elf.c (elf_find_function): Don't use internal_elf_sym.
69         (_bfd_elf_maybe_function_sym): Likewise.  Replace elf_symbol_type
70         parameter with asymbol.
71         * elf64-ppc.c (ppc64_elf_maybe_function_sym): Likewise.
72         * elf-bfd.h (_bfd_elf_maybe_function_sym): Update prototype.
73         (struct elf_backend_data <maybe_function_sym>): Likewise.
74
75 2012-02-02  Vidya Praveen (vidya.praveen@atmel.com)
76
77         PR bfd/13410
78         * bfd/elf32-avr.c (elf32_avr_relax_section): Correct the
79         condition that qualifies the candidates for relaxation.
80
81 2012-02-02  Tristan Gingold  <gingold@adacore.com>
82
83         * bfdio.c (real_fopen): Remove unused vms_modes variable.
84
85 2012-02-02  Tristan Gingold  <gingold@adacore.com>
86
87         * mach-o.c (bfd_mach_o_read_header): Silent uninitialized
88         variable warning.
89
90 2012-02-02  Tristan Gingold  <gingold@adacore.com>
91
92         * archive.c (bfd_slurp_armap): Fix thinko in cast.
93
94 2012-01-31  H.J. Lu  <hongjiu.lu@intel.com>
95
96         PR ld/13616
97         * archures.c (bfd_arch_info): Add fill.
98         (bfd_default_arch_struct): Add bfd_arch_default_fill.
99         (bfd_arch_default_fill): New.
100
101         * configure.in: Set bfd version to 2.22.52.
102         * configure: Regenerated.
103
104         * cpu-alpha.c: Add bfd_arch_default_fill to bfd_arch_info
105         initializer.
106         * cpu-arc.c: Likewise.
107         * cpu-arm.c: Likewise.
108         * cpu-avr.c: Likewise.
109         * cpu-bfin.c: Likewise.
110         * cpu-cr16.c: Likewise.
111         * cpu-cr16c.c: Likewise.
112         * cpu-cris.c: Likewise.
113         * cpu-crx.c: Likewise.
114         * cpu-d10v.c: Likewise.
115         * cpu-d30v.c: Likewise.
116         * cpu-dlx.c: Likewise.
117         * cpu-epiphany.c: Likewise.
118         * cpu-fr30.c: Likewise.
119         * cpu-frv.c: Likewise.
120         * cpu-h8300.c: Likewise.
121         * cpu-h8500.c: Likewise.
122         * cpu-hppa.c: Likewise.
123         * cpu-i370.c: Likewise.
124         * cpu-i860.c: Likewise.
125         * cpu-i960.c: Likewise.
126         * cpu-ia64.c: Likewise.
127         * cpu-ip2k.c: Likewise.
128         * cpu-iq2000.c: Likewise.
129         * cpu-lm32.c: Likewise.
130         * cpu-m10200.c: Likewise.
131         * cpu-m10300.c: Likewise.
132         * cpu-m32c.c: Likewise.
133         * cpu-m32r.c: Likewise.
134         * cpu-m68hc11.c: Likewise.
135         * cpu-m68hc12.c: Likewise.
136         * cpu-m68k.c: Likewise.
137         * cpu-m88k.c: Likewise.
138         * cpu-mcore.c: Likewise.
139         * cpu-mep.c: Likewise.
140         * cpu-microblaze.c: Likewise.
141         * cpu-mips.c: Likewise.
142         * cpu-mmix.c: Likewise.
143         * cpu-moxie.c: Likewise.
144         * cpu-msp430.c: Likewise.
145         * cpu-mt.c: Likewise.
146         * cpu-ns32k.c: Likewise.
147         * cpu-openrisc.c: Likewise.
148         * cpu-or32.c: Likewise.
149         * cpu-pdp11.c: Likewise.
150         * cpu-pj.c: Likewise.
151         * cpu-plugin.c: Likewise.
152         * cpu-powerpc.c: Likewise.
153         * cpu-rl78.c: Likewise.
154         * cpu-rs6000.c: Likewise.
155         * cpu-rx.c: Likewise.
156         * cpu-s390.c: Likewise.
157         * cpu-score.c: Likewise.
158         * cpu-sh.c: Likewise.
159         * cpu-sparc.c: Likewise.
160         * cpu-spu.c: Likewise.
161         * cpu-tic30.c: Likewise.
162         * cpu-tic4x.c: Likewise.
163         * cpu-tic54x.c: Likewise.
164         * cpu-tic6x.c: Likewise.
165         * cpu-tic80.c: Likewise.
166         * cpu-tilegx.c: Likewise.
167         * cpu-tilepro.c: Likewise.
168         * cpu-v850.c: Likewise.
169         * cpu-vax.c: Likewise.
170         * cpu-w65.c: Likewise.
171         * cpu-we32k.c: Likewise.
172         * cpu-xc16x.c: Likewise.
173         * cpu-xstormy16.c: Likewise.
174         * cpu-xtensa.c: Likewise.
175         * cpu-z80.c: Likewise.
176         * cpu-z8k.c: Likewise.
177
178         * cpu-i386.c: Include "libiberty.h".
179         (bfd_arch_i386_fill): New.
180         Add bfd_arch_i386_fill to  bfd_arch_info initializer.
181
182         * cpu-k1om.c: Add bfd_arch_i386_fill to  bfd_arch_info initializer.
183         * cpu-l1om.c: Likewise.
184
185         * linker.c (default_data_link_order): Call abfd->arch_info->fill
186         if fill size is 0.
187
188         * bfd-in2.h: Regenerated.
189
190 2012-01-27  Michael Eager  <eager@eagercon.com>
191
192         * bfd/elf32-microblaze.c (create_got_section):
193         Reuse existing .rela.got section.
194
195 2012-01-23  Alan Modra  <amodra@gmail.com>
196
197         * elf-bfd.h: Formatting.
198         (struct elf_backend_data): Add "maybe_function_sym".
199         (_bfd_elf_maybe_function_sym): Declare.
200         * elfxx-target.h (elf_backend_maybe_function_sym): Define.
201         (elfNN_bed): Init new field.
202         * elf.c (elf_find_function): Use maybe_function_sym.
203         (_bfd_elf_maybe_function_sym): New function.
204         * elf64-ppc.c (elf_backend_maybe_function_sym): Define.
205         (ppc64_elf_maybe_function_sym): New function.
206
207 2012-01-20  Francois Gouget  <fgouget@codeweavers.com>
208
209         PR binutils/13534
210         * archive.c (_bfd_ar_sizepad): New function. Correctly install and
211         pad the size field in an archive header.
212         (_bfd_generic_read_ar_hdr_mag): Use the correct type and scan
213         function for the archive size field.
214         (bfd_generic_openr_next_archived_file): Likewise.
215         (do_slurp_coff_armap): Likewise.
216         (_bfd_write_archive_contents): Likewise.
217         (_bfd_bsd44_write_ar_hdr): Use the new function.
218         (bfd_ar_hdr_from_filesystem): Likewise.
219         (_bfd_write_archive_contents): Likewise.
220         (bsd_write_armap): Likewise.
221         (coff_write_armap): Likewise.
222         * archive64.c (bfd_elf64_archive_write_armap): Likewise.
223         * bfdio.c (bfd_bread): Use correct type for archive element
224         sizes.
225         * ar.c (open_inarch): Likewise.
226         (extract_file): Likewise.
227         * libbfd-in.h (struct areltdata): Use correct types for
228         parsed_size and extra_size fields.
229         Prototype _bfd_ar_sizepad function.
230         * libbfd.h: Regenerate.
231
232 2012-01-20  Ulrich Weigand  <ulrich.weigand@linaro.org>
233
234         * elf.c (elfcore_write_prpsinfo): Provide unconditionally.
235         Return NULL if core file generation is unsupported.
236         (elfcore_write_prstatus): Likewise.
237         * elf32-arm.c (elf32_arm_nabi_write_core_note): New function.
238         (elf_backend_write_core_note): Define.
239
240 2012-01-19  Tristan Gingold  <gingold@adacore.com>
241
242         * pef.c: Add a comment.
243         * xsym.c: Likewise.
244
245 2012-01-17  Alan Modra  <amodra@gmail.com>
246
247         * elf32-ppc.c (ppc_elf_write_core_note <NT_PRPSINFO>): Don't leave
248         trailing garbage in the note.
249         * elf64-ppc.c (ppc64_elf_write_core_note <NT_PRPSINFO>): Likewise.
250
251 2012-01-16  Daniel Green  <venix1@gmail.com>
252
253         PR ld/13491
254         * coff-i386.c (coff_i386_rtype_to_howto <R_SECREL32>): Test
255         h->root.type not h->type.
256         * coff-x86_64.c (coff_amd64_rtype_to_howto <R_AMD64_SECREL>): Likewise.
257
258 2012-01-13  Iain Sandoe  <idsandoe@googlemail.com>
259
260         * mach-o.c (bfd_mach_o_build_dysymtab_command): Handle absolute
261         indirect symbols.
262
263 2012-01-13  Iain Sandoe  <idsandoe@googlemail.com>
264
265         * mach-o.c (bfd_mach_o_write_relocs): Move computation of relocs file
266         position from here... to (bfd_mach_o_build_seg_command): Here.
267
268 2012-01-12  Iain Sandoe  <idsandoe@googlemail.com>
269
270         * mach-o.c (bfd_mach_o_count_indirect_symbols): New.
271         (bfd_mach_o_build_dysymtab_command): Populate indirect symbol table.
272         * mach-o.h (bfd_mach_o_asymbol): Move declaration to start of the
273         file. (bfd_mach_o_section): Add indirect_syms field.
274
275 2012-01-11  Iain Sandoe  <idsandoe@googlemail.com>
276
277         * mach-o.c (bfd_mach_o_build_seg_command): Separate computation of
278         vmsize from filesize.  Don't compute offsets or file sizes for
279         zerofill sections.
280
281 2012-01-11  Iain Sandoe  <idsandoe@googlemail.com>
282
283         * mach-o.c (bfd_mach_o_build_commands): Make the building of each
284         command type independent.
285
286 2012-01-11  Alan Modra  <amodra@gmail.com>
287
288         * elf64-ppc.c: Define more insns used in plt call stubs.
289         (ppc64_elf_brtaken_reloc): Assume isa version 2 or above.
290         (ppc64_elf_relocate_section): Likewise.
291         (enum ppc_stub_type): Add ppc_stub_plt_call_r2save.
292         (struct ppc_link_hash_table): Increase size of stub_count array.
293         Add plt_stub_align and plt_thread_safe.
294         (ALWAYS_USE_FAKE_DEP, ALWAYS_EMIT_R2SAVE): Define.
295         (plt_stub_size, plt_stub_pad): New functions.
296         (build_plt_stub): Emit barriers for power7 thread safety.  Don't
297         emit needless save of r2.
298         (build_tls_get_addr_stub): Adjust params.
299         (ppc_build_one_stub): Handle ppc_stub_plt_call_r2save and aligning
300         plt stubs.  Adjust build_*plt_stub calls.
301         (ppc_size_one_stub): Similarly.
302         (ppc64_elf_size_stubs): Accept plt_thread_safe and plt_stub_align
303         params.  Choose default for plt_thread_safe based on existence of
304         calls to thread creation functions.  Modify plt_call to
305         plt_call_r2save when no tocsave reloc found.  Align tail of stub
306         sections.
307         (ppc64_elf_build_stubs): Align tail of stub sections.  Adjust
308         output of stub statistics.
309         (ppc64_elf_relocate_section): Handle ppc_stub_plt_call_r2save.
310         * elf64-ppc.h (ppc64_elf_size_stubs): Update prototype.
311
312 2012-01-10  H.J. Lu  <hongjiu.lu@intel.com>
313
314         PR ld/13581
315         * elf64-x86-64.c (elf_x86_64_relocate_section): Remove ABI_64_P
316         check on R_X86_64_PCXX.
317
318 2012-01-10  Tristan Gingold  <gingold@adacore.com>
319
320         * mach-o.c (bfd_mach_o_build_commands): Avoid uninitialized false
321         warning.
322
323 2012-01-10  Tristan Gingold  <gingold@adacore.com>
324
325         * bfdio.c (bfd_tell): Handle nested archives.
326         (bfd_seek): Ditto.
327         * cache.c (bfd_cache_lookup_worker): Ditto.
328         * archive.c (_bfd_get_elt_at_filepos): Remove code dealing with
329         nested archives.
330         (bfd_generic_openr_next_archived_file): Likewise.
331
332 2012-01-09  Iain Sandoe  <idsandoe@googlemail.com>
333
334         * mach-o.c (bfd_mach_o_bfd_copy_private_symbol_data): Implement.
335         (bfd_mach_o_write_symtab): Remove handling for indirect syms.
336         (bfd_mach_o_primary_symbol_sort_key): Likewise.
337         (bfd_mach_o_cf_symbols): Likewise.
338         (bfd_mach_o_sort_symbol_table): Remove.
339         (bfd_mach_o_mangle_symbols): Adjust arguments, remove handling
340         for indirect and dysymtab counts.  Do the symbol sorting here.
341         (bfd_mach_o_build_dysymtab_command): Count the symbol types here.
342         Make the indirect symbols a TODO.
343         (bfd_mach_o_build_commands): Adjust call to bfd_mach_o_mangle_symbols.
344         (bfd_mach_o_make_empty_symbol): Specifically flag unset symbols with
345         a non-zero value.
346         (bfd_mach_o_read_symtab_symbol): Record the symbol index.
347         (bfd_mach_o_read_symtab_symbol): Adjust recording of global status.
348         * mach-o.h (mach_o_data_struct): Remove indirect and dysymtab entries.
349         (IS_MACHO_INDIRECT): Remove.
350         (SYM_MACHO_FIELDS_UNSET, SYM_MACHO_FIELDS_NOT_VALIDATED): New.
351
352 2012-01-06  Nick Clifton  <nickc@redhat.com>
353
354         PR binutils/13121
355         * reloc.c (bfd_generic_lookup_section_flags): Rename 'finfo' to
356         'flaginfo' to avoid conflicts with AIX system headers.
357
358 2012-01-06  Tristan Gingold  <gingold@adacore.com>
359
360         * bfdio.c (bfd_bread): Use arelt_size macro.
361
362 2012-01-06  Tristan Gingold  <gingold@adacore.com>
363
364         * config.bfd (i[3-7]86-*-darwin*): Define targ64_selvecs.
365
366 2012-01-05  Nick Clifton  <nickc@redhat.com>
367
368         PR ld/12161
369         * elf32-avr.c (elf32_avr_relax_delete_bytes): Read in relocs if
370         necessary.
371
372 2012-01-05  Jan Kratochvil  <jan.kratochvil@redhat.com>
373
374         Fix zero registers core files when built by gcc-4.7.
375         * elf64-x86-64.c (elf_x86_64_write_core_note): Remove variables p and
376         size.  Call elfcore_write_note for the local variables.  Remove the
377         final elfcore_write_note call.  Add NOTREACHED comments.
378
379 2012-01-04  Tristan Gingold  <gingold@adacore.com>
380
381         * mach-o.c (bfd_mach_o_fat_stat_arch_elt): New function.
382         (bfd_mach_o_generic_stat_arch_elt): Adjust.
383
384 2012-01-04  Tristan Gingold  <gingold@adacore.com>
385
386         * mach-o.c (bfd_mach_o_fat_member_init): New function.
387         (bfd_mach_o_openr_next_archived_file): Reindent.
388         Adjust to call bfd_mach_o_fat_member_init.
389         (bfd_mach_o_fat_extract): Adjust to call bfd_mach_o_fat_member_init.
390
391 2012-01-04  Tristan Gingold  <gingold@adacore.com>
392
393         * mach-o-x86-64.c (bfd_mach_o_x86_64_swap_reloc_out): Handle
394         BFD_RELOC_32, BFD_RELOC_MACH_O_X86_64_PCREL32_1,
395         BFD_RELOC_MACH_O_X86_64_PCREL32_2,
396         BFD_RELOC_MACH_O_X86_64_PCREL32_4,
397         BFD_RELOC_MACH_O_X86_64_BRANCH32,
398         BFD_RELOC_MACH_O_X86_64_SUBTRACTOR32,
399         BFD_RELOC_MACH_O_X86_64_GOT.
400
401 2012-01-04  Tristan Gingold  <gingold@adacore.com>
402
403         * mach-o.h (bfd_mach_o_fvmlib_command): New structure.
404         (bfd_mach_o_load_command): Add fvmlib field.
405
406         * mach-o.c (bfd_mach_o_read_fvmlib): New function.
407         (bfd_mach_o_read_command): Handle fvmlib.
408
409 2012-01-04  Tristan Gingold  <gingold@adacore.com>
410
411         * mach-o.c (bfd_mach_o_convert_architecture): Reindent.
412         Decode msubtype for ARM.
413
414 2012-01-04  Tristan Gingold  <gingold@adacore.com>
415
416         * mach-o.c (bfd_mach_o_get_synthetic_symtab): Add comments.
417
418 2012-01-04  Tristan Gingold  <gingold@adacore.com>
419
420         * mach-o.h: Reindent header.
421         (bfd_mach_o_encryption_info_command): New structure.
422         (bfd_mach_o_load_command): Add encryption_info field.
423
424         * mach-o.c (bfd_mach_o_read_encryption_info): New function.
425         (bfd_mach_o_read_command): Handle BFD_MACH_O_LC_ENCRYPTION_INFO.
426         (bfd_mach_o_read_command): Adjust error message.
427
428 2012-01-04  Shinichiro Hamaji  <shinichiro.hamaji@gmail.com>
429
430         * dwarf2.c (_bfd_dwarf2_slurp_debug_info): Factor out the part
431         which reads DWARF2 and stores in stash from find_line.
432         (find_line) Call _bfd_dwarf2_slurp_debug_info.
433         * libbfd-in.h (_bfd_dwarf2_slurp_debug_info): Add declaration.
434         * libbfd.h (_bfd_dwarf2_slurp_debug_info): Regenerate.
435         * mach-o.c (dsym_subdir): The name of subdir where debug
436         information may be stored.
437         (bfd_mach_o_lookup_uuid_command): New. Lookup a load command whose
438         type is UUID.
439         (bfd_mach_o_dsym_for_uuid_p): New. Check if the specified BFD is
440         corresponding to the executable.
441         (bfd_mach_o_find_dsym): New. Find a debug information BFD in the
442         specified binary file.
443         (bfd_mach_o_follow_dsym): New. Find a debug information BFD for
444         the original BFD.
445         (bfd_mach_o_find_nearest_line): Check dSYM files for Mach-O
446         executables, dylibs, and bundles.
447         (bfd_mach_o_close_and_cleanup): Clean up BFDs for the dSYM file.
448         * mach-o.h (dsym_bfd): The BFD of the dSYM file.
449
450 2012-01-03  Iain Sandoe  <idsandoe@googlemail.com>
451
452         * mach-o.c (bfd_mach_o_mangle_symbols): Put in the section index
453         for stabd symbols.
454         (bfd_mach_o_primary_symbol_sort_key): Adjust for stabs.
455         (bfd_mach_o_cf_symbols): Likewise.
456
457 2012-01-03  Iain Sandoe  <idsandoe@googlemail.com>
458
459         * mach-o.c (bfd_mach_o_mangle_symbols): Correct typo.
460
461 2012-01-03  Iain Sandoe  <idsandoe@googlemail.com>
462
463         * mach-o.c (bfd_mach_o_write_symtab): Fill in the string table index
464         as the value of an indirect symbol.  Keep the string table index in
465         non-indirect syms for reference.
466         (bfd_mach_o_write_dysymtab): New.
467         (bfd_mach_o_primary_symbol_sort_key): New.
468         (bfd_mach_o_cf_symbols): New.
469         (bfd_mach_o_sort_symbol_table): New.
470         (bfd_mach_o_mangle_symbols): Return early if no symbols.  Sort symbols.
471         If we are emitting a dysymtab, process indirect symbols and count the
472         number of each other kind.
473         (bfd_mach_o_mangle_sections): New.
474         (bfd_mach_o_write_contents): Split out some pre-requisite code into
475         the command builder. Write dysymtab if the command is present.
476         (bfd_mach_o_count_sections_for_seg): New.
477         (bfd_mach_o_build_seg_command): New.
478         (bfd_mach_o_build_dysymtab_command): New.
479         (bfd_mach_o_build_commands): Reorganize to support the fact that some
480         commands are optional and should not be emitted if there are no
481         sections or symbols.
482         (bfd_mach_o_set_section_contents): Amend comment.
483         * mach-o.h: Amend and add to comments.
484         (mach_o_data_struct): Add fields for dysymtab symbols counts and a
485         pointer to the indirects, when present.
486         (bfd_mach_o_should_emit_dysymtab): New macro.
487         (IS_MACHO_INDIRECT): Likewise.
488
489 For older changes see ChangeLog-2011
490 \f
491 Local Variables:
492 mode: change-log
493 left-margin: 8
494 fill-column: 74
495 version-control: never
496 End: