ld/
[external/binutils.git] / bfd / ChangeLog
1 2010-09-23  Alan Modra  <amodra@gmail.com>
2
3         * elf.c (_bfd_elf_init_private_section_data): Allow for SEC_RELOC
4         difference between input and output section.
5
6 2010-09-22  Kai Tietz  <kai.tietz@onevision.com>
7
8         * coffcode.h (sec_to_styp_flags): Adjust debug
9         sections to be conform to pe-coff specification
10         and avoid marking them as excluded.
11         (styp_to_sec_flags): Doing reverse mapping.
12
13         * peXXigen.c (_bfd_XXi_final_link_postscript): Add handling for
14         setting IAT directory entry.
15
16 2010-09-20  Richard Henderson  <rth@redhat.com>
17
18         * elf64-alpha.c (elf64_alpha_howto_table): Use bfd_elf_generic_reloc.
19
20 2010-09-19  Richard Sandiford  <rdsandiford@googlemail.com>
21
22         * elfxx-mips.c (mips_elf_link_hash_entry): Add got_only_for_calls.
23         (mips_elf_link_hash_newfunc): Initialize it.
24         (mips_elf_record_global_got_symbol): Add a for_call parameter.
25         (mips_elf_count_got_symbols): Check SYMBOL_CALLS_LOCAL rather
26         than SYMBOL_REFERENCES_LOCAL if the GOT entry is only used for calls.
27         Try to remove .got entries in favour of .got.plt entries on VxWorks.
28         (_bfd_mips_elf_check_relocs): Do not try to avoid allocating
29         a global GOT entry for VxWorks calls.  Update uses of
30         mips_elf_record_global_got_symbol.
31         (allocate_dynrelocs): Set got_only_for_calls to false if the GOT
32         entry is used for dynamic relocations.
33
34 2010-09-19  Richard Sandiford  <rdsandiford@googlemail.com>
35
36         * elfxx-mips.c (mips_got_entry): Adjust commentary.
37         (mips_elf_create_local_got_entry): If given a symbol, check that it
38         has been assigned to the local part of the GOT.
39         (mips_elf_count_got_symbols): Take the bfd_link_info as argument
40         instead of the master GOT.  Put all locally-binding symbols in
41         the local area.
42         (mips_elf_make_got_per_bfd): Use global_got_area to decide whether
43         a symbol lives in the local or global area.
44         (mips_elf_local_relocation_p): Remove check_forced argument and
45         retain only the !check_forced behavior.
46         (mips_elf_calculate_relocation): Adjust call accordingly.
47         Use global_got_area to decide whether an output relocation
48         should be local or global.  Explicitly decay R_MIPS_GOT_PAGE
49         into R_MIPS_GOT_DISP where appropriate.  Fix selection of
50         local vs. global semantics for R_MIPS*_26.  Remove redundant
51         reevaluation of what is stored in was_local_p.
52         (mips_elf_create_dynamic_relocation): Use global_got_area to decide
53         whether the relocation should be against a global or local symbol.
54         (mips_elf_lay_out_got): Update the GOT traversal after the above
55         change to mips_elf_count_got_symbols.
56         (mips_elf_adjust_addend): Adjust call to mips_elf_local_relocation_p.
57         (_bfd_mips_elf_relocate_section): Likewise.
58         (_bfd_mips_elf_finish_dynamic_symbol): Use global_got_area to decide
59         whether the symbol has a global got entry.
60         (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise.
61
62 2010-09-19  Richard Sandiford  <rdsandiford@googlemail.com>
63
64         * elfxx-mips.c (allocate_dynrelocs): Don't add relocation symbols
65         to the global GOT on VxWorks.
66
67 2010-09-19  Richard Sandiford  <rdsandiford@googlemail.com>
68
69         * elfxx-mips.c (_bfd_mips_elf_check_relocs): On VxWorks,
70         exclude __GOTT_BASE__ and __GOTT_INDEX__ from the warning
71         about HI/LO relocations in shared objects.
72
73 2010-09-16  Alan Modra  <amodra@gmail.com>
74
75         * elf32-spu.c (spu_elf_size_sections): Omit fixups for non-alloc
76         sections.
77         (spu_elf_create_sections): Mark .fixup with SEC_LINKER_CREATED and
78         set dynobj.
79         (spu_elf_finish_dynamic_sections): New function.
80         (elf_backend_finish_dynamic_sections): Define.
81
82 2010-09-16  Alan Modra  <amodra@gmail.com>
83
84         * elf.c (bfd_elf_get_default_section_type): Don't test SEC_NEVER_LOAD.
85         * elflink.c (elf_link_input_bfd): Likewise.
86
87 2010-09-15  Kai Tietz  <kai.tietz@onevision.com>
88
89         * pei-x86_64.c (pex64_get_unwind_info): Reorgnized.
90         (pex64_get_scope_entry): Removed.
91         (find_next_xdata_or_end): New helper.
92         (pex64_dump_xdata): Reworked.
93         (pex64_bfd_print_pdata): Add checking for
94         valid pdata sorting and values. Reworked
95         output.
96
97 2010-09-15  H.J. Lu  <hongjiu.lu@intel.com>
98
99         PR binutils/12004
100         * plugin.c (bfd_plugin_object_p): Handle NULL iostream.
101
102 2010-09-14  Kai Tietz  <kai.tietz@onevision.com>
103
104         * pe-x86_64.c (COFF_SECTION_ALIGNMENT_ENTRIES): Make
105         .rdata, .data, and .text partial matched section names.
106         * pei-x86_64.c: Likewise.
107
108         * peXXigen.c (sort_x64_pdata): New helper.
109         (_bfd_XXi_final_link_postscript): Do pdata sorting.
110
111 2010-09-09  H.J. Lu  <hongjiu.lu@intel.com>
112
113         PR ld/11998
114         * elf.c (assign_file_positions_for_load_sections): Don't warn
115         zero LMA adjustment.
116
117 2010-09-09  Bernd Schmidt  <bernds@codesourcery.com>
118
119         bfd/
120         * elflink.c (bfd_elf_final_link): Correct calculation of
121         max_external_reloc_size.
122
123 2010-09-07  Alan Modra  <amodra@gmail.com>
124             Marcus Brinkmann  <marcus.brinkmann@ruhr-uni-bochum.de>
125
126         * peXXigen.c: Whitespace.
127         (pe_print_idata): Correct section limit calculations.  Tidy array
128         indexing.
129         (_bfd_XX_print_ce_compressed_pdata): Don't leak memory.
130
131 2010-09-02  Richard Henderson  <rth@redhat.com>
132
133         * config.bfd (x86_64-*-mingw*): Select 32-bit pei vectors too.
134
135 2010-09-01  Pedro Alves  <pedro@codesourcery.com>
136
137         * netbsd-core.c (netbsd_core_core_file_pid): Renamed to ...
138         (netbsd_core_file_pid): ... this.
139
140 2010-09-01  Tristan Gingold  <gingold@adacore.com>
141
142         * coffcode.h (coff_slurp_line_table): Add a cast.
143         (coff_slurp_reloc_table): Ditto.
144
145 2010-08-30  Gunther Nikl  <gnikl@users.sourceforge.net>
146
147         * cisco-core.c (cisco_core_file_pid): Define.
148
149 2010-08-30  Alan Modra  <amodra@gmail.com>
150
151         PR binutils/11953
152         * elf.c (copy_elf_program_header): Calculate map->header_size
153         from lowest_section, not first_section.  Validate program
154         header p_paddr against section lma.  Find lowest_section in
155         second loop over headers.
156
157 2010-08-28  Alan Modra  <amodra@gmail.com>
158
159         * elflink.c (_bfd_elf_dynamic_symbol_p): Rename param.  Make
160         common syms local.
161         (_bfd_elf_symbol_refs_local_p): Expand comment.
162         (elf_link_output_extsym): Fix style nit.
163
164 2010-08-26  Nathan Sidwell  <nathan@codesourcery.com>
165
166         * elf32-arm.c (elf32_arm_final_link): Process stub sections
167         exactly once.
168
169 2010-08-25  H.J. Lu  <hongjiu.lu@intel.com>
170
171         PR ld/11939
172         * elflink.c (elf_link_add_object_symbols): Don't set
173         unique_global for non-ELF hash link table.
174
175 2010-08-25  H.J. Lu  <hongjiu.lu@intel.com>
176
177         PR ld/11944
178         * elf-bfd.h (elf_backend_data): Add target_id.
179         (bfd_elf_make_generic_object): Renamed to ...
180         (bfd_elf_make_object): This.
181
182         * elf.c (bfd_elf_make_generic_object): Removed.
183         (bfd_elf_make_object): New.
184         (bfd_elf_mkcorefile): Really treat it as an object file.
185
186         * elf-m10300.c (ELF_TARGET_ID): New.
187         * elf32-arm.c (ELF_TARGET_ID): Likewise.
188         * elf32-bfin.c (ELF_TARGET_ID): Likewise.
189         * elf32-cris.c (ELF_TARGET_ID): Likewise.
190         * elf32-frv.c (ELF_TARGET_ID): Likewise.
191         * elf32-i386.c (ELF_TARGET_ID): Likewise.
192         * elf32-lm32.c (ELF_TARGET_ID): Likewise.
193         * elf32-m32r.c (ELF_TARGET_ID): Likewise.
194         * elf32-m68hc11.c (ELF_TARGET_ID): Likewise.
195         * elf32-m68hc12.c (ELF_TARGET_ID): Likewise.
196         * elf32-m68k.c (ELF_TARGET_ID): Likewise.
197         * elf32-microblaze.c (ELF_TARGET_ID): Likewise.
198         * elf32-ppc.c (ELF_TARGET_ID): Likewise.
199         * elf32-s390.c (ELF_TARGET_ID): Likewise.
200         * elf32-sh.c (ELF_TARGET_ID): Likewise.
201         * elf32-sparc.c (ELF_TARGET_ID): Likewise.
202         * elf32-spu.c (ELF_TARGET_ID): Likewise.
203         * elf32-tic6x.c (ELF_TARGET_ID): Likewise.
204         * elf32-xtensa.c (ELF_TARGET_ID): Likewise.
205         * elf64-alpha.c (ELF_TARGET_ID): Likewise.
206         * elf64-hppa.c (ELF_TARGET_ID): Likewise.
207         * elf64-ppc.c (ELF_TARGET_ID): Likewise.
208         * elf64-s390.c (ELF_TARGET_ID): Likewise.
209         * elf64-x86-64.c (ELF_TARGET_ID): Likewise.
210         * elfxx-ia64.c (ELF_TARGET_ID): Likewise.
211
212         * elf32-hppa.c (elf32_hppa_mkobject): Removed.
213         (bfd_elf32_mkobject): Likewise.
214         (ELF_TARGET_ID): New.
215
216         * elf32-mips.c (ELF_TARGET_ID): New.
217         (bfd_elf32_mkobject): Removed.
218
219         * elf64-mips.c (ELF_TARGET_ID): New.
220         (bfd_elf64_mkobject): Removed.
221
222         * elfn32-mips.c (ELF_TARGET_ID): New.
223         (bfd_elf32_mkobject): Removed.
224
225         * elfxx-mips.c (_bfd_mips_elf_mkobject): Removed.
226         * elfxx-mips.h (_bfd_mips_elf_mkobject): Likewise.
227
228         * elfxx-target.h (bfd_elfNN_mkobject): Default to
229         bfd_elf_make_object.
230         (ELF_TARGET_ID): New.  Default to GENERIC_ELF_DATA.
231         (elfNN_bed): Initialize target_id.
232
233 2010-08-25  Julian Brown  <julian@codesourcery.com>
234
235         * elf32-arm.c (arm_stub_required_alignment): New.
236         (arm_build_one_stub): Use above to partition stubs.
237         (make_branch_to_a8_stub): Use arm_stub_a8_veneer_lwm not
238         arm_stub_a8_veneer_b_cond.
239
240 2010-08-25  Alan Modra  <amodra@gmail.com>
241
242         * aout-arm.c (MY(bfd_reloc_type_lookup)): Use bfd_arch_bits_per_address.
243         * aout-ns32k.c (MY(bfd_reloc_type_lookup)): Likewise.
244         * aoutx.h (NAME(aout,reloc_type_lookup)): Likewise.
245         * coff-arm.c (coff_arm_reloc_type_lookup): Likewise.
246         * elf-hppa.h (elf_hppa_reloc_final_type): Likewise.
247         * reloc.c (bfd_default_reloc_type_lookup): Likewise.
248         * riscix.c (riscix_reloc_type_lookup): Likewise.
249
250 2010-08-25  Alan Modra  <amodra@gmail.com>
251
252         * elf.c (_bfd_elf_map_sections_to_segments): Don't load program
253         headers if any loaded section wraps the address space.  Simplify
254         ~(m-1) to -m.  Use lma rather than vma when determining whether
255         note sections are adjacent.
256
257 2010-08-22  H.J. Lu  <hongjiu.lu@intel.com>
258
259         PR ld/11933
260         * elflink.c (elf_link_add_object_symbols): Don't check relocation
261         if input ELF object ID doesn't match output.
262
263 2010-08-21  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
264
265         * configure: Regenerate.
266
267 2010-08-20  H.J. Lu  <hongjiu.lu@intel.com>
268
269         * merge.c (sec_merge_emit): Revert the last checkin.
270
271 2010-08-20  Maciej W. Rozycki  <macro@codesourcery.com>
272
273         * elf32-sh.c (sh_elf_relocate_section): Handle non-ELF output
274         BFD.
275
276 2010-08-20  Maciej W. Rozycki  <macro@codesourcery.com>
277
278         * elf32-m68k.c (bfd_elf_m68k_set_target_options): Don't set GOT
279         options unless an m68k hash table has been found.
280
281 2010-08-20  Nick Clifton  <nickc@redhat.com>
282
283         * merge.c (sec_merge_emit): Do not zero pad sections that do not
284         have an alignment.
285
286 2010-08-18  Pedro Alves  <pedro@codesourcery.com>
287
288         PR corefile/8210
289
290         * bfd-in2.h: Regenerate.
291         * corefile.c (bfd_core_file_pid): New.
292
293         * targets.c (BFD_JUMP_TABLE_CORE): Add NAME##_core_file_pid.
294         (struct bfd_target) <_core_file_pid>: New.
295
296         * libbfd-in.h (_bfd_nocore_core_file_pid): Declare.
297         * libbfd.c (_bfd_nocore_core_file_pid): New.
298
299         * elf-bfd.h (bfd_elf32_core_file_pid, bfd_elf64_core_file_pid):
300         Declare.
301         * elfcode.h (elf_core_file_pid): New define.
302         * elfcore.h (elf_core_file_pid): New function.
303
304         * elf.c (elfcore_make_pid): Rewrite.
305         (elfcore_grok_prstatus): Only set core_pid if not set yet.
306         (elfcore_grok_prstatus) [!HAVE_PRSTATUS_T_PR_WHO]: Fallback to
307         getting the lwpid from prstat.pr_pid.
308
309         * elf64-x86-64.c (elf64_x86_64_grok_prstatus): Write the LWPID to
310         elf_tdata's core_lwpid instead of to core_pid.
311         (elf64_x86_64_grok_psinfo): Extract the the main process's PID,
312         and store it in elf_tdata's core_pid field.
313         * elf32-i386.c (elf_i386_grok_prstatus): Write the LWPID to
314         elf_tdata's core_lwpid instead of to core_pid.
315         (elf_i386_grok_psinfo): Extract the the main process's PID, and
316         store it in elf_tdata's core_pid field.
317
318         * elf32-am33lin.c (elf32_am33lin_grok_prstatus): Write the LWPID
319         to elf_tdata's core_lwpid instead of to core_pid.
320         * elf32-arm.c (elf32_arm_nabi_grok_prstatus): Write the LWPID to
321         elf_tdata's core_lwpid instead of to core_pid.
322         * elf32-cris.c (cris_elf_grok_prstatus): Write the LWPID to
323         elf_tdata's core_lwpid instead of to core_pid.
324         * elf32-frv.c (elf32_frv_grok_prstatus): Write the LWPID to
325         elf_tdata's core_lwpid instead of to core_pid.
326         * elf32-hppa.c (elf32_hppa_grok_prstatus): Write the LWPID to
327         elf_tdata's core_lwpid instead of to core_pid.
328         * elf32-mips.c (elf32_mips_grok_prstatus): Write the LWPID to
329         elf_tdata's core_lwpid instead of to core_pid.
330         * elf32-ppc.c (ppc_elf_grok_prstatus): Write the LWPID to
331         elf_tdata's core_lwpid instead of to core_pid.
332         * elf32-s390.c (elf_s390_grok_prstatus): Write the LWPID to
333         elf_tdata's core_lwpid instead of to core_pid.
334         * elf32-score.c (s3_bfd_score_elf_grok_prstatus): Write the LWPID
335         to elf_tdata's core_lwpid instead of to core_pid.
336         * elf32-score7.c (s7_bfd_score_elf_grok_prstatus): Write the LWPID
337         to elf_tdata's core_lwpid instead of to core_pid.
338         * elf32-sh.c (elf32_shlin_grok_prstatus): Write the LWPID to
339         elf_tdata's core_lwpid instead of to core_pid.
340         * elf32-xtensa.c (elf_xtensa_grok_prstatus): Write the LWPID to
341         elf_tdata's core_lwpid instead of to core_pid.
342         * elf64-hppa.c (elf64_hppa_grok_prstatus): Write the LWPID to
343         elf_tdata's core_lwpid instead of to core_pid.
344         * elf64-mips.c (elf64_mips_grok_prstatus): Write the LWPID to
345         elf_tdata's core_lwpid instead of to core_pid.
346         * elf64-ppc.c (ppc64_elf_grok_prstatus): Write the LWPID to
347         elf_tdata's core_lwpid instead of to core_pid.
348         * elfn32-mips.c (elf32_mips_grok_prstatus): Write the LWPID to
349         elf_tdata's core_lwpid instead of to core_pid.
350
351         * plugin.c (bfd_plugin_core_file_pid): New function.
352         * aout-target.h (MY_core_file_pid): Define.
353         * aout-tic30.c (MY_core_file_pid, MY_core_file_p): New defines.
354         * coff-rs6000.c (coff_core_file_pid): New define.
355         (rs6000coff_vec, pmac_xcoff_vec): Use BFD_JUMP_TABLE_CORE.
356         * coff64-rs6000.c (coff_core_file_pid): New define.
357         (rs6000coff64_vec): Use BFD_JUMP_TABLE_CORE.
358         (xcoff64_core_file_pid): New define.
359         (aix5coff64_vec): Use BFD_JUMP_TABLE_CORE.
360         * mach-o-target.c (bfd_mach_o_core_file_pid): New define.
361         * aix386-core.c (aix386_core_file_pid): New define.
362         * hppabsd-core.c (hppabsd_core_core_file_pid): New define.
363         * hpux-core.c (hpux_core_core_file_pid): New define.
364         * irix-core.c (irix_core_core_file_pid): New define.
365         * lynx-core.c (lynx_core_file_pid): New define.
366         * osf-core.c (osf_core_core_file_pid): New define.
367         * ptrace-core.c (ptrace_unix_core_file_pid): New define.
368         * sco5-core.c (sco5_core_file_pid): New define.
369         * xcoff-target.h (coff_core_file_pid): New define.
370         * netbsd-core.c (netbsd_core_core_file_pid): New define.
371
372 2010-08-13  H.J. Lu  <hongjiu.lu@intel.com>
373
374         PR ld/11913
375         * elf32-i386.c (elf_i386_finish_dynamic_sections): Check if
376          .got.plt section is discarded.
377          * elf64-x86-64.c (elf64_x86_64_finish_dynamic_sections): Likewise.
378
379 2010-08-13  Nathan Sidwell  <nathan@codesourcery.com>
380
381         * elf32-m69k.c (elf32_m68k_print_private_bfd_data): Detect EMAC_B
382         variant.
383
384 2010-08-12  H.J. Lu  <hongjiu.lu@intel.com>
385
386         PR binutils/11909
387         * Makefile.am (coff-tic4x.lo): New.  Disable -Werror.
388         (coff-tic54x.lo): Likewise.
389         * Makefile.in: Regenerated.
390
391 2010-08-12  Todd Veldhuizen  <todd.veldhuizen@logicblox.com>
392
393         PR ld/11843
394         * elflink.c (compute_bucket_count): Avoid futile long searches for
395         the best bucket size.
396
397 2010-08-09  Richard Henderson  <rth@redhat.com>
398
399         PR ld/11891
400         * elf64-alpha.c (elf64_alpha_relax_tls_get_addr): Disallow relaxing
401         to tlshi/lo until pos0 and pos1 are adjacent.  Use the destination
402         register from the tldgd insn.
403
404 2010-08-09  Catherine Moore  <clm@codesourcery.com>
405
406         * elfxx-mips.c (mips_elf_perform_relocation): Improve
407         interlinking error message.
408
409 2010-08-06  Alan Modra  <amodra@gmail.com>
410
411         * elf64-ppc.c (ha_reloc_match): Allow matches to other than r2.
412         (ppc64_elf_relocate_section): Nop out high part insn of large toc
413         code sequence when the high part of offset is zero.
414
415 2010-08-04  Tristan Gingold  <gingold@adacore.com>
416
417         * vms-alpha.c (alpha_vms_build_fixups): Write the EICP.
418         (alpha_vms_bfd_final_link): Explicitly forbid relocatable links.
419         Clear the SEC_RELOC flag.
420
421 2010-08-04  Tristan Gingold  <gingold@adacore.com>
422
423         * vms-alpha.c (alpha_vms_create_eisd_for_section): Make writable
424         sections with relocs.
425         (alpha_vms_add_fixup_lp): Set SEC_RELOC flag.
426         (alpha_vms_add_fixup_ca): Ditto.
427         (alpha_vms_add_fixup_qr): Ditto.
428         Add comments.
429
430 2010-08-04  Tristan Gingold  <gingold@adacore.com>
431
432         * vms-alpha.c (alpha_vms_create_eisd_for_section): Do not make
433         CODE sections writable.
434
435 2010-08-04  Tristan Gingold  <gingold@adacore.com>
436
437         * vms-alpha.c (alpha_vms_add_lw_fixup): Renamed to ...
438         (alpha_vms_add_fixup_lr): ... this for consistency.
439         (alpha_vms_add_qw_fixup): Removed.
440         Fix some comments.
441         (vms_get_symbol_info): Adjust type for unknown sections.
442
443 2010-08-04  Tristan Gingold  <gingold@adacore.com>
444
445         * vms-alpha.c (_bfd_vms_slurp_egsd): Use the canonical absolute
446         section for any absolute section.  Remove some debugging code.
447
448 2010-08-03  DJ Delorie  <dj@redhat.com>
449
450         * elf32-m32c.c (ELF_MAXPAGESIZE): Change page size to 256 bytes.
451
452 2010-08-03  Tristan Gingold  <gingold@adacore.com>
453
454         * vms-misc.c (vms_convert_to_var): Make it static.
455         (_bfd_vms_convert_to_var_unix_filename): Make it public.
456
457 2010-08-03  Tristan Gingold  <gingold@adacore.com>
458
459         * makefile.vms (OBJS): Update list.
460
461 2010-08-03  Tristan Gingold  <gingold@adacore.com>
462
463         * vms-alpha.c (_bfd_vms_slurp_egsd): Do not set SEC_HAS_CONTENTS
464         nor SEC_RELOC for empty sections.
465
466 2010-08-03  Tristan Gingold  <gingold@adacore.com>
467
468         * vms-alpha.c (evax_section_flags): Fix flags for absolute
469         section.  Remove useless parenthesis.
470
471 2010-08-03  Tristan Gingold  <gingold@adacore.com>
472
473         * vms-lib.c (vms_lib_bread_raw): Change type of BUF argument.
474         (vms_lib_bread, vms_lib_bopen): Adjust.
475
476 2010-08-02  Alan Modra  <amodra@gmail.com>
477
478         PR 11866
479         * elf.c (assign_file_positions_for_load_sections): Use p_vaddr to
480         calculate off_adjust rather than first section vma.
481
482 2010-07-30  H.J. Lu  <hongjiu.lu@intel.com>
483
484         * elflink.c (compute_bucket_count): Add ATTRIBUTE_UNUSED to info.
485
486 2010-07-30  Anthony Green  <green@moxielogic.com>
487
488         * config.bfd (targ_cpu): Add moxie-*-rtems support.
489
490 2010-07-29  Alan Modra  <amodra@gmail.com>
491
492         * elf64-ppc.c (ppc64_elf_edit_toc): Always adjust local syms in
493         .toc section, even when none are used in relocs.
494
495 2010-07-27  Maciej W. Rozycki  <macro@codesourcery.com>
496
497         * elfxx-mips.h: Include "elf/mips.h".
498         (gprel16_reloc_p): New static inline function.
499         * elfxx-mips.c (_bfd_mips_elf_check_relocs)
500         [R_MIPS16_GOT16, R_MIPS_GOT16, R_MIPS_GOT_HI16, R_MIPS_GOT_LO16]:
501         Use got16_reloc_p.
502         (_bfd_mips_elf_relocate_section)[bfd_reloc_overflow]: Use
503         gprel16_reloc_p.
504         * elf32-mips.c (mips_info_to_howto_rel): Likewise.
505         * elfn32-mips.c (mips_info_to_howto_rel): Likewise.
506
507 2010-07-27  Maciej W. Rozycki  <macro@codesourcery.com>
508
509         * elf64-mips.c (mips_elf64_howto_table_rela)
510         [R_MIPS_TLS_DTPMOD64]: Clear partial_inplace.
511         [R_MIPS_TLS_DTPREL64, R_MIPS_TLS_GD, R_MIPS_TLS_LDM]: Likewise.
512         [R_MIPS_TLS_DTPREL_HI16, R_MIPS_TLS_DTPREL_LO16]: Likewise.
513         [R_MIPS_TLS_GOTTPREL, R_MIPS_TLS_TPREL64]: Likewise.
514         [R_MIPS_TLS_TPREL_HI16, R_MIPS_TLS_TPREL_LO16]: Likewise.
515         * elfn32-mips.c (elf_mips_howto_table_rela)
516         [R_MIPS_TLS_DTPMOD32]: Likewise.
517         [R_MIPS_TLS_DTPREL32, R_MIPS_TLS_GD, R_MIPS_TLS_LDM]: Likewise.
518         [R_MIPS_TLS_DTPREL_HI16, R_MIPS_TLS_DTPREL_LO16]: Likewise.
519         [R_MIPS_TLS_GOTTPREL, R_MIPS_TLS_TPREL32]: Likewise.
520         [R_MIPS_TLS_TPREL_HI16, R_MIPS_TLS_TPREL_LO16]: Likewise.
521
522 2010-07-23  Naveen.H.S  <naveen.S@kpitcummins.com>
523             Ina Pandit  <ina.pandit@kpitcummins.com>
524
525         * archures.c (DESCRIPTION): Define bfd_mach_v850e2 and
526         bfd_mach_v850e2v3.
527         * reloc.c (bfd_architecture): Define bfd_mach_v850e2 and
528         bfd_mach_v850e2v3.
529         (BFD_RELOC_V850_16_PCREL, BFD_RELOC_V850_17_PCREL,
530         BFD_RELOC_V850_22_PCREL, BFD_RELOC_V850_23,
531         BFD_RELOC_V850_32_PCREL, BFD_RELOC_V850_32_ABS,
532         BFD_RELOC_V850_16_SPLIT_OFFSET, BFD_RELOC_V850_16_S1,
533         BFD_RELOC_V850_LO16_SPLIT_OFFSET, BFD_RELOC_V850_SDA_15_16_OFFSET,
534         BFD_RELOC_V850_ZDA_16_16_OFFSET, BFD_RELOC_V850_CALLT_15_16_OFFSET,
535         BFD_RELOC_V850_32_GOTPCREL, BFD_RELOC_V850_16_GOT,
536         BFD_RELOC_V850_32_GOT, BFD_RELOC_V850_22_PLT_PCREL,
537         BFD_RELOC_V850_32_PLT_PCREL, BFD_RELOC_V850_COPY,
538         BFD_RELOC_V850_GLOB_DAT, BFD_RELOC_V850_JMP_SLOT,
539         BFD_RELOC_V850_RELATIVE, BFD_RELOC_V850_16_GOTOFF,
540         BFD_RELOC_V850_32_GOTOFF, BFD_RELOC_V850_CODE,
541         BFD_RELOC_V850_DATA): New relocations for V850 target.
542         * config.bfd: Match all v850 targets.
543         * cpu-v850.c (arch_info_struct): Define V850e2 and V850e2v3.
544         * elf32-v850.c (v850_elf_check_relocs): Check the newly added
545         relocations.
546         (v850_elf_perform_relocation ): Update the newly added
547         relocations.
548         (v850_elf_howto_t): Update the specifications of added
549         relocations.
550         (v850_elf_reloc_map): Update the relocation mappings.
551         (v850_elf_final_link_relocate): Maps added relocation into the
552         appropriate howto structure.
553         (v850_elf_object_p): Add support for V850E2 and V850E2V3.
554         (v850_elf_final_write_processing): Likewise.
555         (v850_elf_merge_private_bfd_data): Likewise.
556         (v850_elf_print_private_bfd_data): Likewise.
557         * libbfd.h: Regenerate.
558         * bfd-in2.h: Regenerate.
559
560 2010-07-23  Alan Modra  <amodra@gmail.com>
561
562         * archive.c (_bfd_archive_bsd44_construct_extended_name_table):
563         Correct format specifier.
564
565 2010-07-22  Alan Modra  <amodra@gmail.com>
566
567         * ecoff.c: Don't include aout/ranlib.h.
568         (_bfd_ecoff_slurp_armap): Use correct struct for ardata->symdefs.
569         (_bfd_ecoff_write_armap): Output ar_date and ar_size using
570         _bfd_ar_spacepad.
571
572 2010-07-22  Alan Modra  <amodra@gmail.com>
573
574         * aoutx.h (some_aout_object_p): Don't set EXEC_P for files with
575         relocs.
576
577 2010-07-20  Alan Modra  <amodra@gmail.com>
578
579         * elf.c (assign_file_positions_for_load_sections): Check that
580         zero size sections are allocated in segments too.
581         (assign_file_positions_for_non_load_sections): Warn if zero
582         size alloc sections are found here.
583         (copy_elf_program_header): Don't drop zero size sections from
584         segment map.
585         (copy_private_bfd_data): Check for changes in zero size sections.
586
587 2010-07-17  Alan Modra  <amodra@gmail.com>
588
589         * elf.c (_bfd_elf_map_sections_to_segments): Force new segment
590         for sections with overlapping LMAs.
591         (assign_file_positions_for_load_sections): Catch overlap for
592         sections that wrap around the address space.  Replace a
593         warning that duplicates ld's --check-sections error with a
594         warning that lma has been adjusted for overlapping sections.
595
596 2010-07-14  Cary Coutant  <ccoutant@google.com>
597
598         PR ld/11817
599         * dwarf2.c (read_section): Revert patch for compressed debug sections.
600         (find_line): Likewise.
601         (read_and_uncompress_section): Remove.
602
603 2010-07-13  H.J. Lu  <hongjiu.lu@intel.com>
604
605         PR ld/11812
606         * elf32-i386.c (elf_i386_size_dynamic_sections): Don't
607          allocate .got.plt section if there are no GOT nor PLT
608          entries.
609          * elf64-x86-64.c (elf64_x86_64_size_dynamic_sections): Likewise.
610
611 2010-07-13  H.J. Lu  <hongjiu.lu@intel.com>
612
613         PR ld/11791
614         * elf-ifunc.c (_bfd_elf_allocate_ifunc_dyn_relocs): Support
615         garbage collection against STT_GNU_IFUNC symbols.
616
617         * elf32-i386.c (elf_i386_get_local_sym_hash): Don't set
618         elf.plt.offset/elf.got.offset to -1.
619         (elf_i386_tls_transition): Skip TLS transition for functions.
620         (elf_i386_gc_sweep_hook): Support STT_GNU_IFUNC symbols.
621
622         * elf64-x86-64.c (elf64_x86_64_get_local_sym_hash): Don't set
623         elf.plt.offset/elf.got.offset to -1.
624         (elf64_x86_64_tls_transition): Skip TLS transition for functions.
625         (elf64_x86_64_gc_sweep_hook): Support STT_GNU_IFUNC symbols.
626
627 2010-07-12  H.J. Lu  <hongjiu.lu@intel.com>
628
629         * elf32-i386.c (elf_i386_check_relocs): Re-indent.
630         (elf_i386_relocate_section): Likewise.
631
632 2010-07-06  H.J. Lu  <hongjiu.lu@intel.com>
633
634         * dwarf2.c (add_line_info): Initialize prev_line.
635
636 2010-07-06  Alan Modra  <amodra@gmail.com>
637
638         * elf32-ppc.c (ppc_elf_relax_section): Insert branch around
639         trampolines only for .init and .fini sections.
640
641 2010-07-05  Alan Modra  <amodra@gmail.com>
642
643         * elf32-ppc.c: Formatting.
644         (ppc_elf_finish_dynamic_sections): Don't make plt_entry var static.
645
646 2010-07-03  Cary Coutant  <ccoutant@google.com>
647
648         * compress.c (bfd_uncompress_section_contents): Add ATTRIBUTE_UNUSED.
649         * dwarf2.c (read_and_uncompress_section): New function.
650         (read_section): Call it.
651         (find_line): Likewise.
652
653 2010-07-01  Alan Modra  <amodra@gmail.com>
654
655         * elf64-ppc.c (ppc64_elf_edit_toc): Use SYMBOL_CALLS_LOCAL rather
656         than SYMBOL_REFERENCES_LOCAL.
657         (ppc64_elf_relocate_section): Likewise.
658
659 2010-07-01  Alan Modra  <amodra@gmail.com>
660
661         * elf64-ppc.c (ppc64_elf_edit_toc): Keep toc entries for ifuncs.
662
663 2010-06-29  Alan Modra  <amodra@gmail.com>
664
665         * cpu-maxq.c: Delete file.
666         * coff-maxq.c: Delete file.
667         * Makefile.am: Remove references to maxq.
668         * archures.c: Likewise.
669         * coffcode.h: Likewise.
670         * configure.in: Likewise.
671         * targets.c: Likewise.
672         * config.bfd: Move maxq from obsolete to removed.
673         * Makefile.in: Regenerate.
674         * bfd-in2.h: Regenerate.
675         * configure: Regenerate.
676         * libbfd.h: Regenerate.
677         * po/SRC-POTFILES.in: Regenerate.
678
679 2010-06-28  Alan Modra  <amodra@gmail.com>
680
681         * compress.c (bfd_uncompress_section_contents): Use ATTRIBUTE_UNUSED
682         to silence gcc warning.
683
684 2010-06-27  Alan Modra  <amodra@gmail.com>
685
686         * elf64-ppc.c (get_tls_mask): Don't segfault on NULL elf_section_data.
687         (group_sections): Likewise.
688
689 2010-06-27  Alan Modra  <amodra@gmail.com>
690
691         * bout.c (aligncode): Delete set but unused variables.
692         * coff-mcore.c (coff_mcore_relocate_section): Likewise.
693         * coff-ppc.c (ppc_record_toc_entry): Likewise.
694         (coff_ppc_relocate_section): Likewise.
695         * coff-rs6000.c (xcoff_complain_overflow_bitfield_func): Likewise.
696         * elf-m10200.c (mn10200_elf_relax_delete_bytes): Likewise.
697         * elf-m10300.c (mn10300_elf_final_link_relocate): Likewise.
698         (mn10300_elf_relax_section): Likewise.
699         * elf32-arm.c (arm_build_one_stub, arm_size_one_stub): Likewise.
700         (record_vfp11_erratum_veneer): Likewise.
701         (bfd_elf32_arm_vfp11_erratum_scan): Likewise.
702         (elf32_arm_final_link_relocate): Likewise.
703         (elf32_arm_check_relocs, arm_map_one_stub): Likewise.
704         * elf32-avr.c (elf32_avr_relax_delete_bytes): Likewise.
705         (elf32_avr_relax_section): Likewise.
706         (avr_mark_stub_not_to_be_necessary): Likewise.
707         * elf32-bfin.c (_bfin_create_got_section): Likewise.
708         * elf32-cr16.c (cr16_elf_final_link_relocate): Likewise.
709         (elf32_cr16_relax_delete_bytes): Likewise.
710         * elf32-cr16c.c (cr16c_elf_final_link_relocate): Likewise.
711         * elf32-cris.c (elf_cris_finish_dynamic_symbol): Likewise.
712         * elf32-crx.c (elf32_crx_relax_delete_bytes): Likewise.
713         * elf32-h8300.c (elf32_h8_relax_section): Likewise.
714         (elf32_h8_relax_delete_bytes): Likewise.
715         * elf32-hppa.c (elf32_hppa_check_relocs): Likewise.
716         * elf32-i370.c (i370_elf_check_relocs): Likewise.
717         (elf_relocate_section): Likewise.
718         * elf32-ip2k.c (adjust_all_relocations): Likewise.
719         (ip2k_elf_relax_section): Likewise.
720         * elf32-lm32.c (lm32_elf_relocate_section): Likewise.
721         (lm32_elf_check_relocs): Likewise.
722         (lm32_elf_finish_dynamic_sections): Likewise.
723         (lm32_elf_finish_dynamic_symbol): Likewise.
724         * elf32-m32c.c (m32c_offset_for_reloc): Likewise.
725         (m32c_elf_relax_delete_bytes): Likewise.
726         * elf32-m32r.c (m32r_elf_finish_dynamic_symbol): Likewise.
727         (m32r_elf_finish_dynamic_sections): Likewise.
728         (m32r_elf_check_relocs, m32r_elf_fake_sections): Likewise.
729         * elf32-m68hc11.c (m68hc11_elf_relax_section): Likewise.
730         * elf32-m68hc1x.c (elf32_m68hc11_relocate_section): Likewise.
731         * elf32-m68k.c (elf_m68k_gc_sweep_hook): Likewise.
732         * elf32-microblaze.c (microblaze_elf_relocate_section): Likewise.
733         (microblaze_elf_check_relocs): Likewise.
734         (microblaze_elf_finish_dynamic_symbol): Likewise.
735         * elf32-msp430.c (msp430_elf_relax_delete_bytes): Likewise.
736         * elf32-ppc.c (ppc_elf_tls_optimize): Likewise.
737         * elf32-rx.c (rx_elf_relocate_section): Likewise.
738         (elf32_rx_relax_delete_bytes, rx_offset_for_reloc): Likewise.
739         (elf32_rx_relax_section): Likewise.
740         * elf32-score.c (score_elf_got_offset_from_index): Likewise.
741         (score_elf_final_link_relocate): Likewise.
742         (s3_bfd_score_elf_relocate_section): Likewise.
743         * elf32-score7.c (score_elf_got_offset_from_index): Likewise.
744         (s7_bfd_score_elf_relocate_section): Likewise.
745         * elf32-sh.c (sh_elf_check_relocs): Likewise.
746         * elf32-spu.c (spu_elf_relocate_section): Likewise.
747         * elf32-v850.c (v850_elf_check_relocs): Likewise.
748         (find_remembered_hi16s_reloc): Likewise.
749         * elf32-vax.c (elf32_vax_merge_private_bfd_data): Likewise.
750         (elf_vax_relocate_section): Likewise.
751         * elf32-xc16x.c (elf32_xc16x_relocate_section): Likewise.
752         * elf32-xtensa.c (xlate_offset_with_removed_text): Likewise.
753         (move_literal): Likewise.
754         * elf64-hppa.c (elf64_hppa_section_from_shdr): Likewise.
755         (elf64_hppa_check_relocs): Likewise.
756         (elf64_hppa_finish_dynamic_symbol): Likewise.
757         (elf64_hppa_relocate_section): Likewise.
758         * elf64-mmix.c (mmix_elf_reloc, mmix_elf_relax_section): Likewise.
759         * elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
760         (ppc64_elf_edit_opd, ppc64_elf_edit_toc): Likewise.
761         * elfxx-ia64.c (elfNN_ia64_section_from_shdr): Likewise.
762         (elfNN_vms_section_from_shdr): Likewise.
763         * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Likewise.
764         (_bfd_sparc_elf_relocate_section): Likewise.
765         * hp300hpux.c (slurp_symbol_table): Likewise.
766         * i386lynx.c (swap_std_reloc_out, swap_std_reloc_in): Likewise.
767         * mach-o.c (bfd_mach_o_write_thread): Likewise.
768         * mmo.c (mmo_scan, mmo_write_symbols_and_terminator): Likewise.
769         * nlm32-sparc.c (nlm_sparc_read_reloc): Likewise.
770         * pdp11.c (pdp11_aout_link_input_section): Likewise.
771         (aout_link_input_section, aout_link_input_bfd): Likewise.
772         * pe-mips.c (mips_swap_reloc_out): Likewise.
773         (coff_pe_mips_relocate_section): Likewise.
774         * som.c (som_bfd_ar_write_symbol_stuff): Likewise.
775         * vms-alpha.c (_bfd_vms_slurp_egsd): Likewise.
776         * xsym.c (bfd_sym_fetch_type_information_table_ent): Likewise.
777
778         * coff-i860.c (i860_reloc_processing): Avoid set but unused warning.
779         * coffcode.h (coff_compute_section_file_positions): Likewise.
780         (coff_slurp_reloc_table): Likewise.
781         * cpu-arm.c (arm_check_note): Likewise.
782         * elf-bfd.h (RELOC_FOR_GLOBAL_SYMBOL): Likewise.
783         * elf32-avr.c (elf32_avr_relocate_section): Likewise.
784         * elf32-bfin.c (elf32_bfin_merge_private_bfd_data): Likewise.
785         * elf32-ip2k.c (ip2k_elf_relocate_section): Likewise.
786         * elf32-moxie.c (moxie_elf_relocate_section): Likewise.
787         * elf32-msp430.c (elf32_msp430_relocate_section): Likewise.
788         * elf32-sh64.c (_bfd_sh_align_load_span): Likewise.
789         * ieee.c (parse_expression): Likewise.
790         (ieee_slurp_external_symbols, drop_int): Likewise.
791         * peXXigen.c (pe_print_pdata): Likewise.
792         * versados.c (process_esd): Likewise.
793
794 2010-06-25  Tristan Gingold  <gingold@adacore.com>
795
796         * vms-alpha.c (_bfd_vms_write_egsd): Check absolute section with
797         its flags.  Create an absolute section if needed.
798
799 2010-06-25  Tristan Gingold  <gingold@adacore.com>
800
801         * vms-alpha.c (_bfd_vms_write_egsd): Set target_index field of
802         sections.  Mark .vmsdebug section as SEC_DEBUGGING.  Do not create
803         dummy psect anymore.  Adjust.
804         (_bfd_vms_write_eeom): Adjust (use target_index instead of index)
805         (_bfd_vms_write_etir): Ditto.
806         (start_etir_or_etbt_record): Test for SEC_DEBUGGING instead of
807         section name.  Adjust.
808
809 2010-06-25  Tristan Gingold  <gingold@adacore.com>
810
811         * vms-alpha.c (alpha_vms_write_exec): Set linktime field.
812
813 2010-06-25  Alan Modra  <amodra@gmail.com>
814
815         * elf64-ppc.c (toc_skip_enum): Define.
816         (ppc64_elf_edit_toc): Use two low bits of skip array as markers.
817         Optimize largetoc sequences.
818         (adjust_toc_syms): Update for skip array change.
819         (ppc64_elf_relocate_section): Handle R_PPC64_LO_DS_OPT.
820
821 2010-06-25  Alan Modra  <amodra@gmail.com>
822
823         * elf64-ppc.c (is_static_defined): New function.
824         (get_tls_mask, ppc_type_of_stub): Use it here.
825         (ppc64_elf_edit_opd): Ensure we only attempt to edit ppc64 input.
826         (ppc64_elf_tls_setup): Typo fix.
827         (adjust_toc_syms): Correctly handle symbols defined past the end
828         of the toc.  Move syms on removed entries to next entry rather
829         than to start of toc.
830         (ppc64_elf_edit_toc): Likewise.  Ensure we only attempt to
831         edit ppc64 input.  Allocate one extra word in skip array.
832         Honour info->keep_memory when reading relocs if we can.
833         Adjust toc relocs after adjusting symbols.
834
835 2010-06-23  Nathan Sidwell  <nathan@codesourcery.com>
836
837         * archive64.c (bfd_elf64_archive_write_armap): Fix buffer overrun
838         when scaning map.
839
840 2010-06-17  Tristan Gingold  <gingold@adacore.com>
841
842         * Makefile.am (BFD32_BACKENDS_CFILES): Move vms-alpha.c to ...
843         (BFD64_BACKENDS_CFILES): ... here.
844         (BFD32_BACKENDS): Move vms-alpha.lo to ...
845         (BFD64_BACKENDS): ... here.
846         * Makefile.in: Regenerate.
847
848 2010-06-15  Joseph Myers  <joseph@codesourcery.com>
849
850         * elf-bfd.h (LEAST_KNOWN_OBJ_ATTRIBUTE): Decrease to 2.
851         * elf32-tic6x.c (elf32_tic6x_obj_attrs_arg_type,
852         elf32_tic6x_merge_arch_attributes, elf32_tic6x_merge_attributes,
853         elf32_tic6x_merge_private_bfd_data): New.
854         (bfd_elf32_bfd_merge_private_bfd_data,
855         elf_backend_obj_attrs_arg_type, elf_backend_obj_attrs_section,
856         elf_backend_obj_attrs_section_type, elf_backend_obj_attrs_vendor):
857         Define.
858         * elf32-tic6x.h (elf32_tic6x_merge_arch_attributes): Declare.
859
860 2010-06-15  Joseph Myers  <joseph@codesourcery.com>
861
862         * elf-bfd.h (LEAST_KNOWN_OBJ_ATTRIBUTE): Define.
863         (struct elf_backend_data): Update comment on obj_attrs_order.
864         * elf-attrs.c (vendor_obj_attr_size, vendor_set_obj_attr_contents,
865         _bfd_elf_copy_obj_attributes): Use LEAST_KNOWN_OBJ_ATTRIBUTE
866         instead of hardcoded 4.
867         * elf32-arm.c (elf32_arm_obj_attrs_order): Use
868         LEAST_KNOWN_OBJ_ATTRIBUTE and LEAST_KNOWN_OBJ_ATTRIBUTE + 1
869         instead of hardcoded 4 and 5.
870         (elf32_arm_merge_eabi_attributes): Use LEAST_KNOWN_OBJ_ATTRIBUTE
871         instead of hardcoded 4.
872
873 2010-06-14  Kevin Buettner  <kevinb@redhat.com>
874
875         * elf32-h8300.c (elf_symbol_leading_char): Define.
876
877 2010-06-11  Jan Kratochvil  <jan.kratochvil@redhat.com>
878
879         * vms-alpha.c (_bfd_vms_write_egsd): Make sname const.
880
881 2010-06-11  Tristan Gingold  <gingold@adacore.com>
882
883         * vms-alpha.c (_bfd_vms_slurp_egsd): Always set vma of absolute
884         sections to 0.
885
886 2010-06-11  Tristan Gingold  <gingold@adacore.com>
887
888         * vms-alpha.c (evax_bfd_print_etir): Handle ETIR__C_STO_GBL_LW.
889
890 2010-06-11  Tristan Gingold  <gingold@adacore.com>
891
892         * vms-misc.c (_bfd_vms_output_counted): Make VALUE argument const.
893         Adjust cast.
894         (_bfd_vms_output_dump): Make DATA argument const, adjust cast.
895         * vms.h (_bfd_vms_output_counted, _bfd_vms_output_dump): Adjust.
896         * vms-alpha.c (evax_section_flags): Make it const.
897         (vms_secflag_by_name): Remove unused ABFD argument.
898         Make SECTION_FLAGS and NAME arguments const. Clarify comment.
899         (vms_esecflag_by_name): Make SECTION_FLAGS and NAME arguments const.
900         (_bfd_vms_slurp_egsd): Adjust call to vms_secflag_by_name.
901         (_bfd_vms_write_egsd): Remove useless cast.
902
903 2010-06-10  Tristan Gingold  <gingold@adacore.com>
904
905         * config.bfd: Remove #if/#endif so that som can be compiled on any
906         host.
907         * targets.c (_bfd_target_vector): Remove #if/#endif so that som
908         can be used on any host.
909
910 2010-06-10  Tristan Gingold  <gingold@adacore.com>
911
912         * som.c: Can now be compiled on any host.
913         Include bfd headers instead of system one.
914         (som_compute_checksum): Parameter is now a pointer to a
915         som_external_header structure.  Adjust.
916         (struct section_to_type): Field section is now const.
917         (R_DLT_REL, R_AUX_UNWIND, R_SEC_STMT): Removed conditional
918         definition.
919         (R_LONG_PCREL_MODE, R_N0SEL, R_N1SEL, R_LINETAB): Ditto.
920         (R_LINETAB_ESC, R_LTP_OVERRIDE, R_COMMENT): Ditto.
921         (som_swap_clock_in, som_swap_clock_out): New functions.
922         (som_swap_header_in, som_swap_header_out): Likewise.
923         (som_swap_space_dictionary_in): Likewise.
924         (som_swap_space_dictionary_out): Likewise.
925         (som_swap_subspace_dictionary_in): Likewise.
926         (som_swap_subspace_dictionary_record_out): Likewise.
927         (som_swap_aux_id_in, som_swap_aux_id_out): Likewise.
928         (som_swap_string_auxhdr_out): Likewise.
929         (som_swap_compilation_unit_out): Likewise.
930         (som_swap_exec_auxhdr_in): Likewise.
931         (som_swap_exec_auxhdr_out): Likewise.
932         (som_swap_lst_header_in): Likewise.
933         (som_object_setup): Adjust parameter type using bfd types.
934         (setup_sections): Likewise.  Ditto for object file types.
935         Use intermediate variables for external representation and use the
936         swap functions to convert.
937         (som_object_p): Ditto.  Remove #ifdef/#endif on always defined
938         macros.
939         (som_prep_headers): Likewise.
940         (som_write_symbol_strings): Likewise.
941         (som_begin_writing): Likewise.
942         (som_finish_writing): Likewise.
943         (som_build_and_write_symbol_table): Likewise.
944         (bfd_section_from_som_symbol): Likewise.
945         (som_slurp_symbol_table): Likewise.
946         (som_bfd_print_private_bfd_data): Likewise.
947         (bfd_som_attach_aux_hdr): Likewise.  Clear the padding.
948         (bfd_som_attach_compilation_unit): Likewise.
949         (som_bfd_count_ar_symbols): Likewise.
950         (som_bfd_fill_in_ar_symbols): Likewise.
951         (som_slurp_armap): Likewise.
952         (som_bfd_ar_write_symbol_stuff): Likewise.
953         (som_write_armap): Likewise.  Use _bfd_ar_spacepad instead of
954         sprintf to write header fields.
955         * som.h: Include bfd headers instead of system one.
956         (FILE_HDR_SIZE, AUX_HDR_SIZE): Removed.
957         (struct somdata): Use bfd structures instead of system ones.
958         (struct som_section_data_struct): Likewise.
959         (struct som_subspace_dictionary_record): Removed (now in
960         include/som/internal.h)
961
962 2010-06-10  Tristan Gingold  <gingold@adacore.com>
963
964         * targets.c (bfd_target_list): Remove hp/ux compiler work-around
965         as bfd requires an ANSI-C compiler.
966
967 2010-06-09 Tristan Gingold  <gingold@adacore.com>
968
969         * bfdio.c (bfd_bread): Fix the code to prevent reading past the
970         end of archive members.
971
972 2010-06-08  Tristan Gingold  <gingold@adacore.com>
973
974         * som.c (som_bfd_free_cached_info): Do not free relocations as
975         they were allocated with bfd_zalloc.
976
977 2010-06-08  Tristan Gingold  <gingold@adacore.com>
978
979         * vms-lib.c (_bfd_vms_lib_write_archive_contents): Increment
980         for the first block.
981
982 2010-06-08  Tristan Gingold  <gingold@adacore.com>
983
984         * vms-lib.c (_bfd_vms_lib_ia64_mkarchive): New function.
985         * libbfd-in.h (_bfd_vms_lib_ia64_mkarchive): Declare.
986         * libbfd.h: Regenerate.
987         * elfxx-ia64.c (bfd_elfNN_write_archive_contents): Redefine for VMS.
988         (bfd_elfNN_mkarchive): Ditto.
989
990 2010-06-02  Tristan Gingold  <gingold@adacore.com>
991
992         * vms-alpha.c (alpha_vms_bfd_final_link): Fix 64bit constant.
993
994 2010-06-01  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
995
996         * configure: Regenerate.
997
998 2010-06-01  Tristan Gingold  <gingold@adacore.com>
999
1000         * vms-alpha.c (struct vms_private_data_struct): Add
1001         transfer_address field.  Remove unused dst_info field.
1002         (alpha_vms_write_exec): Use transfer_address.
1003         (_bfd_vms_write_egsd): Add a comment about LIB$INITIALIZE.
1004         (alpha_vms_bfd_final_link): Set transfer_address.
1005
1006 2010-05-31  Tristan Gingold  <gingold@adacore.com>
1007
1008         * vms-lib.c (credat_lo, credat_hi): New fields.
1009         (vms_read_block): Adjust comments.
1010         (vms_write_block): New function.
1011         (_bfd_vms_lib_archive_p): Decode majorid once.  Replace some
1012         hard-coded values with constants.  Set credat_lo and credat_hi.
1013         (_bfd_vms_lib_mkarchive): Add argument kind.
1014         Set ver, mhd_size and type according to kind.
1015         (_bfd_vms_lib_alpha_mkarchive): New function.
1016         (struct lib_index): Renamed from struct vms_index
1017         (lib_index_cmp): Renamed from vms_index_cmp.  Adjusted.
1018         (get_idxlen): Type of idx argument adjusted.  Add is_elfidx
1019         argument and handle it.
1020         (vms_write_index): Adjust argument idx.  Handle elf indexes.
1021         (_bfd_vms_lib_build_map): Adjust type of arguments modules and res.
1022         (_bfd_vms_lib_write_archive_contents): Add is_elfidx variable and
1023         use it.  Handle elf indexes.  Set credat.
1024         * libbfd-in.h (_bfd_vms_lib_mkarchive): Renamed to ...
1025         (_bfd_vms_lib_alpha_mkarchive): ... this.
1026         * libbfd.h: Regenerated.
1027         * vms-alpha.c (vms_alpha_vec): Adjust after previous renaming.
1028
1029 2010-05-28  Sterling Augustine  <sterling@tensilica.com>
1030
1031         * elf32-xtensa.c (elf_xtensa_relocate_section): Add a large amount
1032         of code to change the bits in the instructions to match the changes
1033         in the relocations.  Declare dest_addr and sym_sec to help.
1034
1035 2010-05-28  Jan Kratochvil  <jan.kratochvil@redhat.com>
1036
1037         Workaround GCC PR middle-end/4210.
1038         * vms-misc.c (vms_time_t_to_vms_time): Use ternary operator for val[2]
1039         and val[3].
1040
1041 2010-05-27  Tristan Gingold  <gingold@adacore.com>
1042
1043         * vms-misc.c: Define __NEW_STARLET.  Remove trailing spaces.
1044         (VMS_TIME_FACTOR, VMS_TIME_OFFSET): New macros.
1045         (vms_time_to_time_t): Use them instead of local const.
1046         (vms_time_t_to_vms_time): New function.
1047         (vms_get_time): Likewise.
1048         (vms_raw_get_time): Likewise.
1049         * vms.h (vms_time_t_to_vms_time): New declaration.
1050         (vms_get_time): Likewise.
1051         (vms_raw_get_time): Likewise.
1052
1053 2010-05-26  Tristan Gingold  <gingold@adacore.com>
1054
1055         * vms-alpha.c: Update comments.
1056         (alpha_vms_write_exec): Set lnkflags.  Write the GST.
1057         (alpha_vms_link_output_symbol): New function.
1058         (alpha_vms_bfd_final_link): Generate the VMS symbol table.
1059         Set dst_section private field.
1060         (alpha_vms_bfd_final_link): Remove code that set dst_section.
1061
1062 2010-05-26  Tristan Gingold  <gingold@adacore.com>
1063
1064         * bfdio.c: Declare and define _bfd_memory_iovec.
1065         (bfd_bread): Move code for BFD_IN_MEMORY...
1066         (bfd_bwrite): ... Ditto ...
1067         (bfd_tell): ... Ditto ...
1068         (bfd_flush): ... Ditto ...
1069         (bfd_stat): ... Ditto ...
1070         (bfd_seek): ... Ditto ...
1071         (bfd_get_size): ... Ditto ...
1072         (bfd_mmap): ... Ditto ...
1073         (memory_bread): ... to these new functions.
1074         (memory_bwrite): Ditto.
1075         (memory_btell): Ditto.
1076         (memory_bseek): Ditto.
1077         (memory_bflush): Ditto.
1078         (memory_bstat): Ditto.
1079         (memory_bmmap): Ditto.
1080         (memory_bclose): New function.
1081         * peicode.h (pe_ILF_build_a_bfd): Use BFD_IN_MEMORY.
1082         * xcofflink.c (bfd_xcoff_link_generate_rtinit): Ditto.
1083         * opncls.c (bfd_close): Do not handle BFD_IN_MEMORY case.
1084         (bfd_make_writable): Use _bfd_memory_iovec.
1085         * elfcode.h (bfd_from_remote_memory): Use _bfd_memory_iovec.
1086         * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Use
1087         _bfd_memory_iovec.
1088         (alpha_ecoff_openr_next_archived_file): Use proxy_origin
1089         instead of origin.
1090         * libbfd.h: Regenerate.
1091
1092 2010-05-25  Daniel Jacobowitz  <dan@codesourcery.com>
1093             Joseph Myers  <joseph@codesourcery.com>
1094             Andrew Stubbs  <ams@codesourcery.com>
1095
1096         * config.bfd (sh-*-uclinux* | sh[12]-*-uclinux*): Add
1097         bfd_elf32_shl_vec, and FDPIC vectors to targ_selvecs.
1098         * configure.in: Handle FDPIC vectors.
1099         * elf32-sh-relocs.h: Add FDPIC and movi20 relocations.
1100         * elf32-sh.c (DEFAULT_STACK_SIZE): Define.
1101         (SYMBOL_FUNCDESC_LOCAL): Define.  Use it instead of
1102         SYMBOL_REFERENCES_LOCAL for function descriptors.
1103         (fdpic_object_p): New.
1104         (sh_reloc_map): Add FDPIC and movi20 relocations.
1105         (sh_elf_info_to_howto, sh_elf_relocate_section): Handle new invalid
1106         range.
1107         (struct elf_sh_plt_info): Add got20 and short_plt.  Update all
1108         definitions.
1109         (FDPIC_PLT_ENTRY_SIZE, FDPIC_PLT_LAZY_OFFSET): Define.
1110         (fdpic_sh_plt_entry_be, fdpic_sh_plt_entry_le, fdpic_sh_plts): New.
1111         (FDPIC_SH2A_PLT_ENTRY_SIZE, FDPIC_SH2A_PLT_LAZY_OFFSET): Define.
1112         (fdpic_sh2a_plt_entry_be, fdpic_sh2a_plt_entry_le)
1113         (fdpic_sh2a_short_plt_be, fdpic_sh2a_short_plt_le, fdpic_sh2a_plts):
1114         New.
1115         (get_plt_info): Handle FDPIC.
1116         (MAX_SHORT_PLT): Define.
1117         (get_plt_index, get_plt_offset): Handle short_plt.
1118         (union gotref): New.
1119         (struct elf_sh_link_hash_entry): Add funcdesc, rename tls_type to
1120         got_type and adjust all uses.  Add GOT_FUNCDESC.
1121         (struct sh_elf_obj_tdata): Add local_funcdesc.  Rename
1122         local_got_tls_type to local_got_type.
1123         (sh_elf_local_got_type): Renamed from sh_elf_local_got_tls_type.  All
1124         users changed.
1125         (sh_elf_local_funcdesc): Define.
1126         (struct elf_sh_link_hash_table): Add sfuncdesc, srelfuncdesc, fdpic_p,
1127         and srofixup.
1128         (sh_elf_link_hash_newfunc): Initialize new fields.
1129         (sh_elf_link_hash_table_create): Set fdpic_p.
1130         (sh_elf_omit_section_dynsym): New.
1131         (create_got_section): Create .got.funcdesc, .rela.got.funcdesc
1132         and .rofixup.
1133         (allocate_dynrelocs): Allocate local function descriptors and space
1134         for R_SH_FUNCDESC-related relocations, and for rofixups.
1135         Handle GOT_FUNCDESC.  Create fixups.  Handle GOT entries which
1136         require function descriptors.
1137         (sh_elf_always_size_sections): Handle PT_GNU_STACK and __stacksize.
1138         (sh_elf_modify_program_headers): New.
1139         (sh_elf_size_dynamic_sections): Allocate function descriptors for
1140         local symbols.  Allocate .got.funcdesc contents.  Allocate rofixups.
1141         Handle local GOT entries of type GOT_FUNCDESC.  Create fixups for
1142         local GOT entries.  Ensure that FDPIC libraries always have a PLTGOT
1143         entry in the .dynamic section.
1144         (sh_elf_add_dyn_reloc, sh_elf_got_offset, sh_elf_initialize_funcdesc)
1145         (sh_elf_add_rofixup, sh_elf_osec_to_segment)
1146         (sh_elf_osec_readonly_p, install_movi20_field): New functions.
1147         (sh_elf_relocate_section): Handle new relocations, R_SH_FUNCDESC,
1148         R_SH_GOTFUNCDESC and R_SH_GOTOFFFUNCDESC.  Use sh_elf_got_offset
1149         and .got.plt throughout to find _GLOBAL_OFFSET_TABLE_.  Add rofixup
1150         read-only section warnings.  Handle undefined weak symbols.  Generate
1151         fixups for R_SH_DIR32 and GOT entries.  Check for cross-segment
1152         relocations and clear EF_SH_PIC.  Handle 20-bit relocations.
1153         Always generate R_SH_DIR32 for FDPIC instead of R_SH_RELATIVE.
1154         (sh_elf_gc_sweep_hook): Handle R_SH_FUNCDESC, R_SH_GOTOFF20,
1155         R_SH_GOTFUNCDESC, R_SH_GOTFUNCDESC20, and R_SH_GOTOFFFUNCDESC.
1156         Handle 20-bit relocations.
1157         (sh_elf_copy_indirect_symbol): Copy function descriptor reference
1158         counts.
1159         (sh_elf_check_relocs): Handle new relocations.  Make symbols
1160         dynamic for FDPIC relocs.  Account for rofixups.  Error for FDPIC
1161         symbol mismatches.  Allocate a GOT for R_SH_DIR32. Allocate fixups
1162         for R_SH_DIR32.
1163         (sh_elf_copy_private_data): Copy PT_GNU_STACK size.
1164         (sh_elf_merge_private_data): Copy initial flags.  Do not clobber
1165         non-mach flags.  Set EF_SH_PIC for FDPIC.  Reject FDPIC mismatches.
1166         (sh_elf_finish_dynamic_symbol): Do not handle got_funcdesc entries
1167         here.  Rename sgot to sgotplt and srel to srelplt.  Handle short_plt,
1168         FDPIC descriptors, and got20.  Create R_SH_FUNCDESC_VALUE for FDPIC.
1169         Use install_movi20_field.  Rename srel to srelgot.  Always generate
1170         R_SH_DIR32 for FDPIC instead of R_SH_RELATIVE.
1171         (sh_elf_finish_dynamic_sections): Fill in the GOT pointer in rofixup.
1172         Do not fill in reserved GOT entries for FDPIC.  Correct DT_PLTGOT.
1173         Rename sgot to sgotplt.  Assert that the right number of rofixups
1174         and dynamic relocations were allocated.
1175         (sh_elf_use_relative_eh_frame, sh_elf_encode_eh_address): New.
1176         (elf_backend_omit_section_dynsym): Use sh_elf_omit_section_dynsym.
1177         (elf_backend_can_make_relative_eh_frame)
1178         (elf_backend_can_make_lsda_relative_eh_frame)
1179         (elf_backend_encode_eh_address): Define.
1180         (TARGET_BIG_SYM, TARGET_BIG_NAME, TARGET_LITTLE_SYM)
1181         (TARGET_LITTLE_NAME, elf_backend_modify_program_headers, elf32_bed):
1182         Redefine for FDPIC vector.
1183         * reloc.c: Add SH FDPIC and movi20 relocations.
1184         * targets.c (_bfd_target_vector): Add FDPIC vectors.
1185         * configure, bfd-in2.h, libbfd.h: Regenerated.
1186
1187 2010-05-25  Jay Krell  <jay.krell@cornell.edu>
1188
1189         PR ld/11624
1190         * archive.c (_bfd_calloc_wrapper): New function.
1191         (_bfd_add_bfd_to_archive_cache): Use it.
1192
1193         * configure.in: Add alpha*-*-*vms* to list of natives.
1194         * configure: Regenerate.
1195
1196         * vms-misc.c: Define globalref if necessary.
1197         (vms_convert_to_var_unix_filename): Rename to
1198         _bfd_vms_convert_to_var_unix_filename and export.
1199         * vms.h: Add prototype for _bfd_vms_convert_to_var_unix_filename.
1200         * vms-alpha.c (vms_close_and_cleanup): Update invocation of
1201         vms_convert_to_var_unix_filename.
1202
1203 2010-05-24  Tristan Gingold  <gingold@adacore.com>
1204
1205         * vms-alpha.c (add_symbol_entry): New function extrated from ...
1206         (add_symbol): ... adjusted.
1207
1208 2010-05-24  Tristan Gingold  <gingold@adacore.com>
1209
1210         * vms-alpha.c (_bfd_vms_slurp_egsd): Fix indentation.
1211         (alpha_vms_write_exec): Add a comment.
1212         (_bfd_vms_write_egsd): Ditto.
1213         (alpha_vms_convert_symbol): Remove a blank line.
1214
1215 2010-05-21  Tristan Gingold  <gingold@adacore.com>
1216
1217         * vms-alpha.c (_bfd_vms_slurp_eihs): Do not create a bfd section
1218         for the GST.
1219
1220 2010-05-21  Tristan Gingold  <gingold@adacore.com>
1221
1222         * vms-alpha.c (_bfd_vms_slurp_eisd): Set SEC_HAS_CONTENTS and
1223         SEC_LOAD if isect has data.
1224         (vms_get_symbol_info): Refine the condition for 'T' type.
1225
1226 2010-05-18  Tristan Gingold  <gingold@adacore.com>
1227
1228         * vms-alpha.c (_bfd_vms_write_emh): New function.
1229         (_bfd_vms_write_lmn): New function.
1230         (_bfd_vms_write_eeom): Moved.
1231         (hash_string): Likewise.
1232         (_bfd_vms_length_hash_symbol): Likewise.
1233         (_bfd_vms_write_ehdr): Code moved to _bfd_vms_write_emh
1234         and _bfd_vms_write_lmn, and call these functions.
1235
1236 2010-05-18  Tristan Gingold  <gingold@adacore.com>
1237
1238         * vms-alpha.c (evax_bfd_print_dst): Handle INCR_LINUM_L.
1239         Add details in the messages.
1240         (evax_bfd_print_image): Change message.
1241
1242 2010-05-18  H.J. Lu  <hongjiu.lu@intel.com>
1243
1244         PR gas/11600
1245         * elf.c (_bfd_elf_make_section_from_shdr): Handle SHF_EXCLUDE
1246         (elf_fake_sections): Likewise.
1247
1248         * elf32-i370.c (i370_elf_section_from_shdr): Don't handle
1249         SHF_EXCLUDE here.
1250         * elf32-ppc.c (ppc_elf_fake_sections): Likewise.
1251
1252 2010-05-17  Tristan Gingold  <gingold@adacore.com>
1253
1254         * vms-alpha.c: Include esgps.h and eidc.h.
1255         (_bfd_vms_slurp_egsd): Ignore SPSC and IDC sub-records.
1256         (evax_bfd_print_egsd_flags): New function, extracted from ...
1257         (evax_bfd_print_egsd): ..., calls evax_bfd_print_egsd_flags.  Handles
1258         EGSD__C_SPSC and EGSD__C_IDC.
1259
1260 2010-05-14  Tristan Gingold  <gingold@adacore.com>
1261
1262         * vms-alpha.c (alpha_vms_object_p): Accept header size of 0.
1263         (_bfd_vms_get_object_record): Handle align byte only in the
1264         foreign case.
1265
1266 2010-05-14  Tristan Gingold  <gingold@adacore.com>
1267
1268         * vms-lib.c (_bfd_vms_lib_ia64_archive_p): New function.
1269         * libbfd-in.h (_bfd_vms_lib_ia64_archive_p): Add prototype.
1270         * libbfd.h: Regenerate.
1271         * configure.in (havevecs): Define HAVE_all_vecs when
1272         --enable-targets=all is set.  Use AC_SUBST on it.
1273         (tdefaults): Do not add havevecs.
1274         (bfd_elf64_ia64_vms_vec): Add vms-lib.lo and vms-misc.lo
1275         * configure: Regenerate.
1276         * Makefile.am (HAVEVECS): New variable.
1277         (INCLUDES): Add HAVEVECS.
1278         * Makefile.in: Regenerate.
1279         * elfxx-ia64.c (INCLUDE_IA64_VMS): New macro, defined if vms
1280         target is selected.  Add #ifdef/#endif around vms specific code.
1281         (bfd_elfNN_archive_p, bfd_elfNN_archive_slurp_armap,
1282         bfd_elfNN_archive_slurp_extended_name_table,
1283         bfd_elfNN_archive_construct_extended_name_table,
1284         bfd_elfNN_archive_truncate_arname,
1285         bfd_elfNN_archive_write_armap,
1286         bfd_elfNN_archive_read_ar_hdr,
1287         bfd_elfNN_archive_write_ar_hdr,
1288         bfd_elfNN_archive_openr_next_archived_file,
1289         bfd_elfNN_archive_get_elt_at_index,
1290         bfd_elfNN_archive_generic_stat_arch_elt,
1291         bfd_elfNN_archive_update_armap_timestamp): Define to use vms archives.
1292
1293 2010-05-11  Jie Zhang  <jie@codesourcery.com>
1294
1295         * elf32-arm.c (elf32_arm_merge_eabi_attributes): Merge
1296         Tag_ABI_HardFP_use correctly.
1297
1298 2010-05-11  Alan Modra  <amodra@gmail.com>
1299
1300         * coffcode.h (coff_write_object_contents): Enclose all occurrences
1301         of hasdebug and is_reloc_section in #ifdef COFF_IMAGE_WITH_PE.
1302
1303 2010-05-07  Daniel Jacobowitz  <dan@codesourcery.com>
1304
1305         * elf32-arm.c (struct a8_erratum_reloc): Add hash member.  Move
1306         sym_name to improve packing.
1307         (cortex_a8_erratum_scan): Check for PLT entries.
1308         (elf32_arm_size_stubs): Save the target symbol for a8 relocs.
1309
1310 2010-05-07  Tristan Gingold  <gingold@adacore.com>
1311
1312         * Makefile.in: Regenerate with automake 1.11.1.
1313         * aclocal.m4: Ditto.
1314
1315 2010-05-05  Nick Clifton  <nickc@redhat.com>
1316
1317         * po/es.po: Updated Spanish translation.
1318
1319 2010-05-03  Tristan Gingold  <gingold@adacore.com>
1320
1321         * vms-lib.c (vms_lib_bopen): Fix the size threshold to read
1322         selective_search flag.
1323         Add comments.
1324         * vms-alpha.c (alpha_vms_bfd_final_link): Create the DMT section
1325         before output_has_begun is set.
1326
1327 2010-05-03  Tristan Gingold  <gingold@adacore.com>
1328
1329         * vms-alpha.c: Add comments.
1330         (struct vms_private_data_struct): Remove image_autoextend field.
1331         (dst_check_allocation): Removed.
1332         (image_write): Remove call to dst_check_allocation.
1333         (vms_slurp_debug): Do not set image_autoextend.  Adjust section
1334         size.
1335         (_bfd_vms_slurp_object_records): Remove useless new_type variable.
1336         (alpha_vms_write_exec): Use dst_section to get the dst section.
1337         Write the dmt section.
1338         (evax_bfd_print_image): Also print the dst size in hexa.  Fix typo.
1339         (alpha_vms_read_sections_content): Do not set image_autoextend.
1340         (alpha_vms_bfd_final_link): Generate the dst.
1341
1342 2010-05-03  Tristan Gingold  <gingold@adacore.com>
1343
1344         * vms-lib.c (_bfd_vms_lib_archive_p): Adjust for a possible empty
1345         next array.
1346         (vms_lib_dcx): Adjust for the above change.
1347
1348 2010-04-30  H.J. Lu  <hongjiu.lu@intel.com>
1349
1350         PR ld/11542
1351         * elf-bfd.h (RELOC_AGAINST_DISCARDED_SECTION): New.
1352
1353         * elf32-i386.c (elf_i386_relocate_section): Use it.
1354         * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
1355
1356 2010-04-30  Tristan Gingold  <gingold@adacore.com>
1357
1358         * vms-lib.c (vms_read_block): New function.
1359         (vms_traverse_index): Use vms_read_block.  Handle long key names.
1360
1361 2010-04-30  Tristan Gingold  <gingold@adacore.com>
1362
1363         * vms-lib.c (struct lib_tdata): Field artdata added, fields nbr_syms
1364         and syms removed.
1365         (struct carsym_mem): New structure.
1366         (vms_add_index): New function.
1367         (vms_add_indexes_from_list): New function.
1368         (vms_traverse_index): Parameter carsym changed to carsym_mem.
1369         Code adjusted to handle elfidx.
1370         (vms_lib_read_index): Adjusted for vms_traverse_index changes.
1371         Parameter NBREL is now a pointer.
1372         (_bfd_vms_lib_archive_p): Adjust for above change.  Handle ia64
1373         archives.
1374         (_bfd_vms_lib_mkarchive): Adjusted for changes in struct lib_tdata.
1375         (_bfd_vms_lib_find_symbol): Ditto.
1376         (vms_lib_bopen): Fix two typos: return FALSE in case of error,
1377         check MHD id.
1378         (_bfd_vms_lib_get_module): New function.
1379         (_bfd_vms_lib_get_elt_at_index): Rewritten using the above
1380         function.
1381         (_bfd_vms_lib_openr_next_archived_file): Use _bfd_vms_lib_get_module.
1382         (_bfd_vms_lib_generic_stat_arch_elt): Handle ia64 archives.
1383         (vms_write_index): Adjust for structure renamed.
1384         * vms-alpha.c (alpha_vms_link_add_archive_symbols): Adjust for
1385         changes of _bfd_vms_lib_find_symbol.
1386
1387 2010-04-28  Kai Tietz  <kai.tietz@onevision.com>
1388
1389         * config.bfd: Correct accidential reverted patch
1390         about vax*-*-*vms*.
1391
1392 2010-04-27  Kai Tietz  <kai.tietz@onevision.com>
1393
1394         * pe-x86_64.c (TARGET_UNDERSCORE): Set value dependent
1395         to USE_MINGW64_LEADING_UNDERSCORES.
1396         * pei-x86_64.c (TARGET_UNDERSCORE): Likewise.
1397         * config.bfd: Change underscoring default for x64 mingw
1398         to false.
1399         * coffcode.h (coff_write_relocs): Add check that dereferenced
1400         sym_ptr_ptr isn't NULL.
1401         * config.in (USE_MINGW64_LEADING_UNDERSCORES): New.
1402         * configure: Regenerated.
1403         * configure.in: Add option '--enable-leading-mingw64-underscores'
1404         and define config.in variable USE_MINGW64_LEADING_UNDERSCORES.
1405
1406 2010-04-27  Nick Clifton  <nickc@redhat.com>
1407
1408         PR binutils/11512
1409         * coffgen.c (coff_find_nearest_line): Incldue the section address
1410         of function name symbols in address comparisons.
1411
1412 2010-04-27  Nick Clifton  <nickc@redhat.com>
1413
1414         * po/fr.po: Updated French translation.
1415
1416 2010-04-23  Alan Modra  <amodra@gmail.com>
1417
1418         * elf.c: Replace use of ELF_IS_SECTION_IN_SEGMENT and
1419         ELF_IS_SECTION_IN_SEGMENT_FILE with ELF_SECTION_IN_SEGMENT
1420         throughout file.
1421         (assign_file_positions_for_load_sections): Modify section in
1422         segment warning to ignore overlay vmas.
1423         * elf32-spu.c (spu_elf_object_p): Replace use of
1424         ELF_IS_SECTION_IN_SEGMENT_MEMORY with ELF_SECTION_IN_SEGMENT.
1425
1426 2010-04-22  Nick Clifton  <nickc@redhat.com>
1427
1428         * po/bfd.pot: Updated by the Translation project.
1429         * po/vi.po: Updated Vietnamese translation.
1430
1431 2010-04-22  Alan Modra  <amodra@gmail.com>
1432
1433         * elf.c (assign_file_positions_for_load_sections): Revert 2008-05-29
1434         change.  Tidy.  Don't error on sections not allocated in segment.
1435
1436 2010-04-15  Andrew Haley  <aph@redhat.com>
1437
1438         * bfd-in.h (elf32_arm_fix_exidx_coverage): Add new flag:
1439         merge_exidx_entries.
1440         * bfd-in2.h: Likewise.
1441         * elf32-arm.c (elf32_arm_fix_exidx_coverage): Likewise.  Use it to
1442         control merging of exidx entries.
1443
1444 2010-04-20  Joseph Myers  <joseph@codesourcery.com>
1445
1446         * elf32-tic6x.h: New.
1447         * elf-bfd.h (enum elf_target_id): Define TIC6X_ELF_DATA.
1448         * elf32-tic6x.c (struct elf32_tic6x_obj_tdata, elf32_tic6x_tdata,
1449         elf32_tic6x_howto_table_rel, elf32_tic6x_info_to_howto_rel,
1450         elf32_tic6x_set_use_rela_p, elf32_tic6x_mkobject,
1451         elf32_tic6x_new_section_hook, elf32_tic6x_rel_relocation_p,
1452         bfd_elf32_mkobject, bfd_elf32_new_section_hook): New.
1453         (elf32_tic6x_reloc_type_lookup, elf32_tic6x_reloc_name_lookup,
1454         elf32_tic6x_relocate_section): Handle REL relocations.
1455         (elf_info_to_howto_rel): Define to elf32_tic6x_info_to_howto_rel.
1456
1457 2010-04-20  Jakub Jelinek  <jakub@redhat.com>
1458
1459         * dwarf2.c (find_abstract_instance_name, scan_unit_for_symbols): Treat
1460         DW_AT_linkage_name the same as DW_AT_MIPS_linkage_name.
1461
1462 2010-04-19  Nick Clifton  <nickc@redhat.com>
1463
1464         * archive64.c (bfd_elf64_archive_slurp_armap): Remove unused
1465         arhdrpos variable.
1466         * elf64-x86-64.c (elf64_x86_64_relocate_section): Add unused
1467         attribute to warned variable.  Remove unused val, type and type2
1468         variables.
1469
1470 2010-04-16  Andreas Schwab  <schwab@redhat.com>
1471
1472         * vms-alpha.c (alpha_vms_link_add_object_symbols): Avoid breaking
1473         strict-aliasing rules.
1474
1475 2010-04-16  Tristan Gingold  <gingold@adacore.com>
1476
1477         * vms-alpha.c (_bfd_vms_slurp_eihd): Fix typo.
1478         (_bfd_vms_get_object_record): Always assume there is a pad byte
1479         for alignment.
1480
1481         * vms-lib.c: Add a few comments.
1482
1483 2010-04-15  Matthew Gretton-Dann  <matthew.gretton-dann@arm.com>
1484
1485         * elf32-arm.c (elf32_arm_merge_eabi_attributes): Support additions to
1486         attributes in v2.08 of the ABI.
1487
1488 2010-04-15  Alan Modra  <amodra@gmail.com>
1489
1490         * config.bfd (vax*-*-*vms*): Delete.
1491
1492 2010-04-14  Tristan Gingold  <gingold@adacore.com>
1493
1494         * Makefile.am (BFD32_BACKENDS): Remove vms-gsd.lo, vms-hdr.lo,
1495         vms-tir.lo, vms.lo and add vms-alpha.lo
1496         (BFD32_BACKENDS_CFILES): Remove vms-gsd.c, vms-hdr.c,
1497         vms-tir.c, vms.c and add vms-alpha.c
1498         * Makefile.in: Regenerate.
1499         * configure.in (TDEFINES): Adjust file list for vms_alpha_vec.
1500         Remove vms_vax_vec.
1501         * configure: Regenerate.
1502         * targets.c (vms_vax_vec): Remove the declaration.
1503         (_bfd_target_vector): Remove vms_vax_vec.
1504         * vms-alpha.c: New file.
1505         * vms-gsd.c: Removed, rewritten in vms-alpha.c
1506         * vms-hdr.c: Ditto.
1507         * vms-tir.c: Ditto.
1508         * vms.c: Ditto.
1509         * vms-misc.c: Fix indentation and comments.  Replace most of
1510         #if VMS_DEBUG/vms_debug with vms_debug2.
1511         (_bfd_vms_hash_newfunc): Moved to vms-alpha.c
1512         (hash_string): Ditto.
1513         (_bfd_vms_length_hash_symbol): Ditto.
1514         (maybe_adjust_record_pointer_for_object): Ditto.
1515         (_bfd_vms_get_object_record): Ditto.
1516         (vms_get_remaining_object_record): Ditto.
1517         (_bfd_vms_push): Ditto.
1518         (_bfd_vms_pop): Ditto.
1519         (_bfd_vms_get_header_values): Removed.
1520         (_bfd_vms_get_first_record): Removed.
1521         (vms_get_remaining_image_record): Removed.
1522         (new_symbol): Removed.
1523         (_bfd_vms_enter_symbol): Removed.
1524         (_bfd_vms_save_sized_string): Use memcpy instead of strncpy.
1525         (_bfd_vms_output_begin): Remove rechead parameter.  Replace bfd
1526         parameter with struct vms_rec_wr.
1527         (_bfd_vms_output_push): Removed and replaced by ...
1528         (_bfd_vms_output_begin_subrec): ... new function.
1529         (_bfd_vms_output_alignment): Replace bfd parameter with
1530         struct vms_rec_wr, and adjust.
1531         (_bfd_vms_output_check): Ditto
1532         (_bfd_vms_output_byte): Ditto.
1533         (_bfd_vms_output_short): Ditto.
1534         (_bfd_vms_output_long): Ditto.
1535         (_bfd_vms_output_quad): Ditto.
1536         (_bfd_vms_output_counted): Ditto.
1537         (_bfd_vms_output_dump): Ditto.
1538         (_bfd_vms_output_fill): Ditto.
1539         (_bfd_vms_output_pop): Removed and replaced by ...
1540         (_bfd_vms_output_end_subrec): ... new function.
1541         (_bfd_vms_output_flush): Removed.
1542         (_bfd_vms_output_align): New function.
1543         (_bfd_vms_output_end): Add recwr parameter.  Adjust for this new
1544         parameter.
1545         (vms_convert_to_var): New function imported from vms.c
1546         (vms_convert_to_var_1): Ditto.
1547         (vms_convert_to_var_unix_filename): Ditto.
1548         (vms_get_module_name): Ditto.
1549         (get_vms_time_string): Ditto.
1550         (vms_time_to_time_t): Ditto.
1551         (vms_rawtime_to_time_t): Ditto.
1552         * vms.h: All macros for the VMS file format are now in include/vms.
1553         Prototypes for vms.c, vms-gsd.c, vms-misc.c, vms-hdr.c, vms-tir.c
1554         have been removed.
1555         (struct vms_symbol_struct, struct stack_struct): Moved to vms-alpha.c
1556         (struct fileinfo, struct srecinfo, struct lineinfo): Ditto.
1557         (struct funcinfo, struct vms_private_data_struct): Ditto.
1558         (struct vms_section_data_struct): Ditto.
1559         (struct vms_rec_rd, stryct vms_rec_wr): New declarations.
1560         (vms_get_module_name, get_vms_time_string): New declarations.
1561         (vms_time_to_time_t, vms_rawtime_to_time_t): Ditto.
1562         (_bfd_vms_output_begin_subrec, _bfd_vms_output_end_subrec): Ditto.
1563         (_bfd_vms_save_sized_string, _bfd_vms_save_counted_string): Adjusted.
1564         (_bfd_vms_output_begin, _bfd_vms_output_alignment): Ditto.
1565         (_bfd_vms_output_end,_bfd_vms_output_check): Ditto.
1566         (_bfd_vms_output_byte, _bfd_vms_output_short): Ditto.
1567         (_bfd_vms_output_long, _bfd_vms_output_quad): Ditto.
1568         (_bfd_vms_output_counted, _bfd_vms_output_dump): Ditto.
1569         (_bfd_vms_output_fill): Ditto.
1570         (bfd_vms_set_section_flags): Ditto.
1571
1572 2010-04-14  Matthew Gretton-Dann  <matthew.gretton-dann@arm.com>
1573
1574         * elflink.c (_bfd_elf_merge_symbol): Tighten up the test for early
1575         exit due to merging the same weak symbol to test that the symbols are
1576         actually weak.
1577
1578 2010-04-13  Alan Modra  <amodra@gmail.com>
1579
1580         * elf64-ppc.c (ppc64_elf_relocate_section): Correct NOP location
1581         when optimizing high got_tlsgd/ld insns.
1582
1583 2010-04-10  H.J. Lu  <hongjiu.lu@intel.com>
1584
1585         * hosts/x86-64linux.h (HAVE_PRPSINFO32_T): Undefine before
1586         define.
1587         (HAVE_PRSTATUS32_T): Likewise.
1588
1589 2010-04-10  H.J. Lu  <hongjiu.lu@intel.com>
1590
1591         PR corefiles/11467
1592         * configure.in (CORE_HEADER): New. Set to hosts/x86-64linux.h
1593         for x86_64-*-linux*.
1594         * config.in: Regenerated.
1595         * configure: Likewise.
1596
1597         * elf.c: Include CORE_HEADER if it is defined.
1598
1599 2010-04-10  H.J. Lu  <hongjiu.lu@intel.com>
1600             Jan Kratochvil  <jan.kratochvil@redhat.com>
1601
1602         * hosts/x86-64linux.h: New.
1603
1604 2010-04-09  Nick Clifton  <nickc@redhat.com>
1605
1606         * aoutx.h (aout_link_input_bfd): Remove unused variable sym_count.
1607         * elf-eh-frame.c (_bfd_elf_eh_frame_section_offset): Remove unused
1608         variables htab and hdr_info and mark info parameter as unused.
1609         * elf.c (prep_headers): Remove unused variable i_phdrp.
1610         (_bfd_elf_write_object_contents): Remove unused variable i_ehdrp.
1611         * elf32-i386.c (elf_i386_relocate_section): Mark variabled warned
1612         as unused.
1613         * peXXigen.c (pe_print_reloc): Remove unused variable datasize.
1614         * verilog.c (verilog_write_section): Remove unused variable
1615         address.
1616
1617 2010-04-07  Alan Modra  <amodra@gmail.com>
1618
1619         * warning.m4 (GCC_WARN_CFLAGS): Only add -Wshadow for gcc-4 and above.
1620         * configure: Regenerate.
1621
1622 2010-04-06  H.J. Lu  <hongjiu.lu@intel.com>
1623
1624         PR ld/11434
1625         * elf-bfd.h (SYMBOLIC_BIND): Don't bind unique symbol locally.
1626
1627 2010-04-06  Tristan Gingold  <gingold@adacore.com>
1628
1629         * vms-lib.c (_bfd_vms_lib_write_archive_contents): Fix idd flags.
1630
1631 2010-04-05  Jakub Jelinek  <jakub@redhat.com>
1632
1633         * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Handle CIE version 4
1634         provided that it has the expected address size and zero segment
1635         length.
1636
1637         * dwarf2.c (struct line_head): Add maximum_ops_per_insn field.
1638         (struct line_info): Add op_index field, change end_sequence type to
1639         unsigned char.
1640         (new_line_sorts_after): For the same address compare op_index.
1641         (add_line_info): Add op_index argument, store it into the structure.
1642         (decode_line_info): Complain about unknown versions of .debug_line.
1643         Initialize maximum_ops_per_insn.  Add op_index state register and
1644         track it.
1645
1646 2010-04-01  Nathan Sidwell  <nathan@codesourcery.com>
1647
1648         * elf32-ppc.c (apuinfo_set): New static var.
1649         (ppc_elf_begin_write_processing): Set it here, always create an
1650         APUinfo section if there were any in the inputs.
1651         (ppc_elf_write_section): Check apuinfo_set.
1652         (ppc_elf_final_write_processing): Likewise.
1653
1654 2010-04-01  Tristan Gingold  <gingold@adacore.com>
1655
1656         * vms.h: Include time.h. Add prototypes for vms_get_module_name,
1657         vms_time_to_time_t and vms_rawtime_to_time_t.
1658         * vms.c (vms_alpha_vec): Add archives support.
1659         * vms-misc.c: Include safe-ctype.h
1660         (vms_get_module_name): New function.
1661         (vms_time_to_time_t, vms_rawtime_to_time_t): Ditto.
1662         * vms-hdr.c (_bfd_vms_write_hdr): Put module name creation to the
1663         vms_get_module_name function.  Use this function.
1664         * targets.c: Declare vms_lib_txt_vec.  Add it to _bfd_target_vector.
1665         * libbfd-in.h: Add prototype for _bfd_append_relative_path.
1666         Add prototypes for vms-lib.c
1667         * libbfd.h: Regenerate.
1668         * configure.in (TDEFINES): Add an entry for vms_lib_txt_vec.  Add
1669         vms-lib.lo to vms_alpha_vec.
1670         * config.bfd (targ_cpu): Add targ_selvecs for alpha*-*-*vms*.
1671         * configure: Regenerate.
1672         * bfd.c: Add selective_search field.
1673         * bfd-in2.h: Regenerate.
1674         * archive.c (append_relative_path): Rename to
1675         _bfd_append_relative_path and make it public.
1676         (_bfd_get_elt_at_filepos): Adjust for above renaming.
1677         * Makefile.am (BFD32_BACKENDS): Add vms-lib.lo
1678         (BFD32_BACKENDS_CFILES): Add vms-lib.c
1679         * Makefile.in: Regenerate.
1680
1681 2010-04-01  Jakub Jelinek  <jakub@redhat.com>
1682
1683         * dwarf2.c (read_attribute_value): Handle CU version 4
1684         for DW_FORM_ref_addr, handle DW_FORM_sec_offset, DW_FORM_exprloc
1685         and DW_FORM_flag_present.  For unknown form value return NULL.
1686         (scan_unit_for_symbols): For DW_AT_location handle DW_FORM_exprloc
1687         like DW_FORM_block.
1688         (parse_comp_unit): Allow CU version 4.
1689
1690 2010-04-01  Hans-Peter Nilsson  <hp@axis.com>
1691
1692         * elf32-cris.c (cris_elf_relocate_section): Correct first argument
1693         to _bfd_elf_get_dynamic_reloc_section.
1694         (elf_cris_discard_excess_dso_dynamics): Ditto.
1695
1696 2010-03-31  Kai Tietz  <kai.tietz@onevision.com>
1697
1698         * coff-i386.c (in_reloc_p): Check also for R_SECREL32.
1699         * coff-x86_64.c (in_reloc_p): Check also for R_AMD64_SECREL.
1700
1701 2010-03-31  Alan Modra  <amodra@gmail.com>
1702
1703         * elf64-ppc.c (ppc64_elf_relocate_section): Nop out optimized
1704         TPREL16_HI and TPREL16_HA insns.
1705
1706 2010-03-31  Hans-Peter Nilsson  <hp@axis.com>
1707
1708         PR ld/11458
1709         * elf32-cris.c (elf_cris_copy_indirect_symbol): Remove invalid
1710         assert of empty pcrel_relocs_copied on the direct symbol.  Instead
1711         of moving the list from the indirect symbol to the direct symbol,
1712         merge into any existing list.
1713         (cris_elf_check_relocs): Store the original section in the
1714         pcrel_relocs_copied list, not the relocation section.
1715         (elf_cris_discard_excess_dso_dynamics): Adjust accordingly to find
1716         the relocation section, for reducing its size.  Change the
1717         BFD_ASSERT into a check for the section being read-only, and only
1718         emit warnings and TEXTREL marker when there's an entry for a
1719         read-only section.
1720
1721 2010-03-29  Daniel Jacobowitz  <dan@codesourcery.com>
1722
1723         * elf32-arm.c (using_thumb_only): Handle v6-M.
1724
1725 2010-03-26  Alan Modra  <amodra@gmail.com>
1726
1727         * elf32-ppc.c (ppc_elf_howto_raw <R_PPC_EMB_RELSDA>): Not pc-relative.
1728         * bfd-in.h (elf_discarded_section): Clarify comment.
1729         * reloc.c (struct reloc_howto_struct <pc_relative>): Likewise.
1730         * bfd-in2.h: Regenerate.
1731
1732 2010-03-26  Matt Rice  <ratmice@gmail.com>
1733
1734         * archive.c (_bfd_compute_and_write_armap): Allow symbols flagged
1735         as unique in the armap.
1736
1737 2010-03-26  Alan Modra  <amodra@gmail.com>
1738
1739         PR ld/11375
1740         * elf64-ppc.c (ppc64_elf_relocate_section): Always look up a
1741         possible stub on branches.
1742
1743 2010-03-25  Joseph Myers  <joseph@codesourcery.com>
1744
1745         * Makefile.am (ALL_MACHINES): Add cpu-tic6x.lo.
1746         (ALL_MACHINES_CFILES): Add cpu-tic6x.c.
1747         (BFD32_BACKENDS): Add elf32-tic6x.lo.
1748         (BFD32_BACKENDS_CFILES): Add elf32-tic6x.c.
1749         * Makefile.in: Regenerate.
1750         * archures.c (bfd_arch_tic6x, bfd_tic6x_arch): New.
1751         (bfd_archures_list): Update.
1752         * config.bfd (tic6x-*-elf): New.
1753         * configure.in (bfd_elf32_tic6x_be_vec, bfd_elf32_tic6x_le_vec):
1754         New.
1755         * configure: Regenerate.
1756         * cpu-tic6x.c, elf32-tic6x.c: New.
1757         * reloc.c (BFD_RELOC_C6000_PCR_S21, BFD_RELOC_C6000_PCR_S12,
1758         BFD_RELOC_C6000_PCR_S10, BFD_RELOC_C6000_PCR_S7,
1759         BFD_RELOC_C6000_ABS_S16, BFD_RELOC_C6000_ABS_L16,
1760         BFD_RELOC_C6000_ABS_H16, BFD_RELOC_C6000_SBR_U15_B,
1761         BFD_RELOC_C6000_SBR_U15_H, BFD_RELOC_C6000_SBR_U15_W,
1762         BFD_RELOC_C6000_SBR_S16, BFD_RELOC_C6000_SBR_L16_B,
1763         BFD_RELOC_C6000_SBR_L16_H, BFD_RELOC_C6000_SBR_L16_W,
1764         BFD_RELOC_C6000_SBR_H16_B, BFD_RELOC_C6000_SBR_H16_H,
1765         BFD_RELOC_C6000_SBR_H16_W, BFD_RELOC_C6000_SBR_GOT_U15_W,
1766         BFD_RELOC_C6000_SBR_GOT_L16_W, BFD_RELOC_C6000_SBR_GOT_H16_W,
1767         BFD_RELOC_C6000_DSBT_INDEX, BFD_RELOC_C6000_PREL31,
1768         BFD_RELOC_C6000_COPY, BFD_RELOC_C6000_ALIGN,
1769         BFD_RELOC_C6000_FPHEAD, BFD_RELOC_C6000_NOCMP): New.
1770         * targets.c (bfd_elf32_tic6x_be_vec, bfd_elf32_tic6x_le_vec): New.
1771         (_bfd_target_vector): Update.
1772         * bfd-in2.h, libbfd.h: Regenerate.
1773
1774 2010-03-24  H.J. Lu  <hongjiu.lu@intel.com>
1775
1776         * aout-target.h: Update copyright year.
1777         * aout-tic30.c: Likewise.
1778         * coff-alpha.c: Likewise.
1779         * coff-rs6000.c: Likewise.
1780         * coff64-rs6000.c: Likewise.
1781         * elf64-mips.c: Likewise.
1782         * ieee.c: Likewise.
1783         * libecoff.h: Likewise.
1784         * mach-o-target.c: Likewise.
1785         * mach-o.c: Likewise.
1786         * oasys.c: Likewise.
1787         * targets.c: Likewise.
1788
1789 2010-03-24  H.J. Lu  <hongjiu.lu@intel.com>
1790
1791         * libbfd-in.h: Update copyright year.
1792
1793 2010-03-21  H.J. Lu  <hongjiu.lu@intel.com>
1794
1795         PR ld/11413
1796         * elflink.c (_bfd_elf_add_default_symbol): Check !executable
1797         instead of shared.
1798
1799 2010-03-19  Jie Zhang  <jie@codesourcery.com>
1800
1801         * elf32-arm.c (struct section_list): Remove.
1802         (section_list): Remove typedef.
1803         (record_section_with_arm_elf_section_data): Remove.
1804         (find_arm_elf_section_entry): Remove.
1805         (get_arm_elf_section_data): Use is_arm_elf.
1806         (unrecord_section_with_arm_elf_section_data): Remove.
1807         (elf32_arm_new_section_hook): Don't call
1808         record_section_with_arm_elf_section_data.
1809         (elf32_arm_write_section): Set mapcount to -1 when
1810         the map has been used. Don't call
1811         unrecord_section_with_arm_elf_section_data.
1812         (unrecord_section_via_map_over_sections): Remove.
1813         (elf32_arm_close_and_cleanup): Remove.
1814         (elf32_arm_bfd_free_cached_info): Remove.
1815         (bfd_elf32_close_and_cleanup): Don't define.
1816         (bfd_elf32_bfd_free_cached_info): Don't define.
1817
1818 2010-03-18  H.J. Lu  <hongjiu.lu@intel.com>
1819
1820         PR binutils/11396
1821         * libcoff-in.h (pe_tdata): Add dont_strip_reloc.
1822         * libcoff.h: Regenerated.
1823
1824         * peXXigen.c (_bfd_XXi_only_swap_filehdr_out): Clear F_RELFLG
1825         if dont_strip_reloc is set.
1826         (_bfd_XX_bfd_copy_private_bfd_data_common): Set
1827         dont_strip_reloc on output if there is no .reloc and
1828         IMAGE_FILE_RELOCS_STRIPPED isn't set in input.
1829
1830 2010-03-18  Wei Guozhi  <carrot@google.com>
1831
1832         PR gas/11323
1833         * elf32-arm.c (elf32_arm_reloc_map): Map BFD_RELOC_ARM_GOT_PREL to
1834         R_ARM_GOT_PREL.
1835         * reloc.c (BFD_RELOC_ARM_GOT_PREL): New ARM relocation.
1836         * bfd-in2.h: Regenerate.
1837         * libbfd.h: Regenerate.
1838
1839 2010-03-17  H.J. Lu  <hongjiu.lu@intel.com>
1840
1841         * reloc.c (BFD_RELOC_SPU_PIC18): Removed.
1842         (BFD_RELOC_SPU_STUB): Likewise.
1843
1844 2010-03-17  Jie Zhang  <jie@codesourcery.com>
1845
1846         * elf.c (assign_file_positions_for_load_sections): Avoid
1847         overflow.
1848
1849 2010-03-17  Alan Modra  <amodra@gmail.com>
1850
1851         PR binutils/11382
1852         * plugin.c (bfd_plugin_object_p): Pass iostream to fileno using
1853         proper type.
1854
1855 2010-03-17  Alan Modra  <amodra@gmail.com>
1856
1857         * elf32-arm.c (cortex_a8_erratum_scan): Warning fix.
1858
1859 2010-03-16  Alan Modra  <amodra@gmail.com>
1860
1861         * elf64-ppc.c (struct ppc_link_hash_table): Add do_toc_opt.
1862         (ppc64_elf_edit_toc): Set it here.
1863         (ha_reloc_match): New function.
1864         (ppc64_elf_relocate_section): Optimize bigtoc insn sequences.
1865
1866 2010-03-15  Alan Modra  <amodra@gmail.com>
1867
1868         * elf64-ppc.c (ppc64_elf_has_small_toc_reloc): New function.
1869         * elf64-ppc.h (ppc64_elf_has_small_toc_reloc): Declare.
1870
1871 2010-03-14  Alan Modra  <amodra@gmail.com>
1872
1873         PR ld/11378
1874         * elf64-ppc.h (ppc64_elf_check_init_fini): Declare.
1875         * elf64-ppc.c (call_check_done): Define.
1876         (ppc64_elf_add_symbol_hook): Substitute bfd_get_section_name macro.
1877         (ppc64_elf_check_relocs, ppc64_elf_size_dynamic_sections): Likewise.
1878         (ppc64_elf_finish_multitoc_partition): Remove unnecessary check.
1879         (toc_adjusting_stub_needed): Use call_check_done rather than toc_off.
1880         Simplify return logic.  Iterate over all .init and .fini fragments
1881         by recursion.  Set makes_toc_func_call here..
1882         (ppc64_elf_next_input_section): ..rather than here.
1883         (check_pasted_section, ppc64_elf_check_init_fini): New functions.
1884
1885 2010-03-13  Alan Modra  <amodra@gmail.com>
1886
1887         PR ld/11375
1888         * elf64-ppc.c (ppc_type_of_stub): Always set *hash to the
1889         function descriptor symbol if there is one, not just for plt stubs.
1890         (ppc64_elf_relocate_section): Use fdh on all ppc_get_stub_entry calls.
1891
1892 2010-03-05  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
1893
1894         * elflink.c (bfd_elf_size_dynamic_sections): Don't emit base
1895         version twice.
1896         Skip it when constructing def.vd_next.
1897
1898         * elf32-i386.c (TARGET_LITTLE_SYM): Redefine to
1899         bfd_elf32_i386_sol2_vec.
1900         (TARGET_LITTLE_NAME): Redefine to elf32-i386-sol2.
1901         (elf32_bed): Redefine to elf32_i386_sol2_bed.
1902         (elf_backend_want_plt_sym): Redefine to 1.
1903
1904         * elf64-x86-64.c (TARGET_LITTLE_SYM): Redefine to
1905         bfd_elf64_x86_64_sol2_vec.
1906         (TARGET_LITTLE_NAME): Redefine to elf64-x86-64-sol2.
1907         (elf64_bed): Redefine to elf64_x86_64_sol2_bed.
1908         (elf_backend_want_plt_sym): Redefine to 1.
1909
1910         * config.bfd (i[3-7]86-*-solaris2*): Set targ_defvec to
1911         bfd_elf32_i386_sol2_vec.
1912         Replace bfd_elf64_x86_64_vec by bfd_elf64_x86_64_sol2_vec in
1913         targ64_selvecs.
1914         (x86_64-*-solaris2*): Set targ_defvec to bfd_elf32_i386_sol2_vec.
1915         Replace bfd_elf64_x86_64_vec by bfd_elf64_x86_64_sol2_vec in
1916         targ_selvecs.
1917
1918         * configure.in: Handle bfd_elf32_i386_sol2_vec,
1919         bfd_elf64_x86_64_sol2_vec.
1920         * configure: Regenerate.
1921
1922         * targets.c (bfd_elf32_i386_sol2_vec): Declare.
1923         (bfd_elf64_x86_64_sol2_vec): Declare.
1924         (_bfd_target_vector): Add bfd_elf32_i386_sol2_vec,
1925         bfd_elf64_x86_64_sol2_vec.
1926
1927 2010-03-04  Daniel Jacobowitz  <dan@codesourcery.com>
1928
1929         * elf32-arm.c (elf32_arm_output_arch_local_syms): Skip non-program
1930         sections.
1931
1932 2010-03-04  Alan Modra  <amodra@gmail.com>
1933
1934         PR 11302
1935         * dwarf2.c (read_abbrevs): Return NULL on alloc failures.
1936         (read_attribute_value, decode_line_info): Likewise.
1937         (add_line_info, read_rangelist): Return FALSE on alloc failures.
1938         (arange_add, sort_line_sequences): Likewise.
1939         (find_abstract_instance_name): Handle failures from called funcs.
1940         (scan_unit_for_symbols, parse_comp_unit, decode_line_info): Likewise.
1941         (find_line): Realloc to a temp, and handle alloc fail.
1942
1943 2010-03-03  Daniel Jacobowitz  <dan@codesourcery.com>
1944
1945         * elf32-arm.c (elf32_arm_output_arch_local_syms): Do not add
1946         a mapping symbol to an empty section.
1947
1948 2010-03-02  Matthew Gretton-Dann  <matthew.gretton-dann@arm.com>
1949
1950         * elf32-arm.c (elf32_arm_merge_eabi_attributes): Add a check of the
1951         return value from the call to _bfd_elf_merge_object_attributes.
1952
1953 2010-03-02  Christophe Lyon  <christophe.lyon@st.com>
1954         Alan Modra  <amodra@gmail.com>
1955
1956         * elf32-arm.c (a8_erratum_fix): Add st_type field to record the
1957         destination mode of the a8 stub.
1958         (elf32_arm_link_hash_table): Add top_id field.
1959         (elf32_arm_link_hash_table_create): Initialize top_id.
1960         (arm_type_of_stub): Update prototype, st_type can now be updated
1961         by this function. Actual destination address in case of PLT is
1962         computed here, to help factorizing code.
1963         (elf32_arm_stub_name): Update prototype, use stub_type additional
1964         parameter to build stub name.
1965         (elf32_arm_get_stub_entry): Update prototype, use stub_type
1966         additional parameter to build stub entry.
1967         (arm_build_one_stub): Use bfd_put_16/bfd_put_32 instead of
1968         put_thumb_insn/put_arm_insn as BE8 encoding is now handled later.
1969         Call elf32_arm_final_link_relocate to process all in-stub
1970         relocations.
1971         (elf32_arm_setup_section_lists): Update top_id.
1972         (cortex_a8_erratum_scan): Record stub destination mode.
1973         (elf32_arm_size_stubs): Update call to arm_type_of_stub according
1974         to new prototype.
1975         (elf32_arm_final_link_relocate): Enable processing of in-stub
1976         REL32 relocations. Rely on arm_type_of_stub to detect if a stub is
1977         needed, enabling code factorization.
1978         (elf32_arm_final_link): Process stub sections.
1979         (elf32_arm_output_map_sym): Add entry to code/data map.
1980
1981 2010-03-01  David S. Miller  <davem@davemloft.net>
1982
1983         * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): When STT_GNU_IFUNC and
1984         h->def_regular, set h->ref_regular.
1985         (allocate_dynrelocs): Only force output of STT_GNU_IFUNC plt entries
1986         and dynamic relocations if h->ref_regular.
1987
1988         * elfxx-sparc.c (struct elf_reloc_map): Delete.
1989         (sparc_reloc_map): Delete.
1990         (_bfd_sparc_elf_reloc_type_lookup): Explicitly handle each
1991         relocation type in switch statements.
1992
1993 2010-02-25  Alan Modra  <amodra@gmail.com>
1994
1995         PR ld/11304
1996         * elf.c (_bfd_elf_init_private_section_data): Rename need_group
1997         to final_link and invert.  For final link allow some flags to
1998         differ.  Don't specially allow flags to be all zero.
1999
2000 2010-02-24  Alan Modra  <amodra@gmail.com>
2001
2002         PR binutils/10858
2003         * elfxx-mips.c (mips_elf_create_dynamic_relocation): Ise
2004         SYMBOL_REFERENCES_LOCAL to exclude entries from the dynamic symbol
2005         table.
2006
2007 2010-02-23  Andrew Zabolotny  <anpaza@mail.ru>
2008
2009         PR binutils/11297
2010         * elf32-avr.c (elf_avr_howto_table): Add R_AVR_8.
2011         (avr_reloc_map): Map BFD_RELOC_8 to R_AVR_8.
2012
2013 2010-02-22  Alan Modra  <amodra@gmail.com>
2014
2015         * reloc.c (bfd_check_overflow): When forming addrmask, shift
2016         fieldmask left by rightshift.
2017         (_bfd_relocate_contents): Likewise.  Use rightshift addrmask in all
2018         overflow checks.
2019
2020 2010-02-20  H.J. Lu  <hongjiu.lu@intel.com>
2021
2022         * elf64-x86-64.c (elf64_x86_64_add_symbol_hook): Don't check
2023         STT_GNU_IFUNC on large common symbol.
2024
2025 2010-02-18  H.J. Lu  <hongjiu.lu@intel.com>
2026
2027         * elf32-i386.c (elf_i386_add_symbol_hook): Don't set
2028         has_ifunc_symbols if the symbol comes from a shared library.
2029         * elf32-ppc.c (ppc_elf_add_symbol_hook): Likewise.
2030         * elf32-sparc.c (elf32_sparc_add_symbol_hook): Likewise.
2031         * elf64-ppc.c (ppc64_elf_add_symbol_hook): Likewise.
2032         * elf64-sparc.c (elf64_sparc_add_symbol_hook): Likewise.
2033         * elf64-x86-64.c (elf64_x86_64_add_symbol_hook): Likewise.
2034
2035 2010-02-19  Alan Modra  <amodra@gmail.com>
2036
2037         * elf.c (_bfd_elf_fixup_group_sections): New function, split out from..
2038         (_bfd_elf_copy_private_header_data): ..here.
2039         * elflink.c (_bfd_elf_size_group_sections): New function.
2040         (bfd_elf_size_dynamic_sections): Call it.
2041         * elf-bfd.h (_bfd_elf_size_group_sections): Declare.
2042         (_bfd_elf_fixup_group_sections): Declare.
2043
2044 2010-02-18  Matthew Gretton-Dann  <matthew.gretton-dann@arm.com>
2045
2046         * elf32-arm.c (elf32_arm_merge_eabi_attributes): Add support for
2047         merging Tag_DIV_use, Tag_MPextension_use, and
2048         Tag_MPextension_use_legacy tags.
2049
2050 2010-02-18  Alan Modra  <amodra@gmail.com>
2051
2052         * elf.c (bfd_elf_set_group_contents): Revert accidental 2009-01-15
2053         commit.  Don't write zeros for removed group members.
2054         (_bfd_elf_copy_private_header_data): Adjust size of group section
2055         when group members are removed by objcopy.
2056
2057 2010-02-15  Dave Korn  <dave.korn.cygwin@gmail.com>
2058
2059         PR binutils/11280
2060         * configure.host (*-*-solaris2.11):  Add host define to select
2061         valid default code page for windres/windmc on solaris.
2062
2063 2010-02-15  Nick Clifton  <nickc@redhat.com>
2064
2065         * po/vi.po: Updated Vietnamese translation.
2066
2067 2010-02-12  Daniel Gutson  <dgutson@codesourcery.com>
2068
2069         * elf32-arm.c (elf32_arm_output_arch_local_syms): add
2070         missing mapping symbol to data only sections.
2071
2072 2010-02-11  David S. Miller  <davem@davemloft.net>
2073
2074         * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): For R_SPARC_GOTDATA_OP_HIX22
2075         and R_SPARC_GOTDATA_OP_LOX10, only bump the GOT refcount for global
2076         symbols.
2077         (_bfd_sparc_elf_gc_sweep_hook): Likewise only decrement the GOT count for
2078         these relocs on global symbols.
2079         (gdopoff): New.
2080         (_bfd_sparc_elf_relocate_section): Perform GOTDATA optimizations on
2081         local symbol references which are not STT_GNU_IFUNC.  Handle
2082         relocation of them like R_SPARC_HIX22 and R_SPARC_LOX10 respectively,
2083         and deal with negative vs. non-negative values properly.
2084
2085 2010-02-09  Tristan Gingold  <gingold@adacore.com>
2086
2087         * mach-o.c (bfd_mach_o_canonicalize_one_reloc): Adjust addend for
2088         non-external relocation.
2089
2090 2010-02-09  Alan Modra  <amodra@gmail.com>
2091
2092         * elf64-ppc.c (merge_got_entries): Move earlier in file.
2093         (allocate_dynrelocs): Merge got entries here if not doing multi-toc.
2094         (ppc64_elf_size_dynamic_sections): Similarly merge tlsld_got.
2095         (ppc64_elf_layout_multitoc): Don't resize if we have already
2096         merged got entries.
2097
2098 2010-02-09  Michael Holzheu  <holzheu@de.ibm.com>
2099
2100         * elf-bfd.h (elfcore_write_s390_timer, elfcore_write_s390_todcmp,
2101         elfcore_write_s390_todpreg, elfcore_write_s390_ctrs,
2102         elfcore_write_s390_prefix): New.
2103         * elf.c (elfcore_write_s390_timer, elfcore_write_s390_todcmp,
2104         elfcore_write_s390_todpreg, elfcore_write_s390_ctrs,
2105         elfcore_write_s390_prefix): New.
2106         (elfcore_grok_note): Handle NT_S390_TIMER, NT_S390_TODCMP,
2107         NT_S390_TODPREG, NT_S390_CTRS and NT_S390_PREFIX.
2108         (elfcore_write_register_note): Handle .reg-s390-timer,
2109         .reg-s390-todcmp, .reg-s390-todpreg, .reg-s390-ctrs,
2110         .reg-s390-prefix section.
2111
2112 2010-02-09  Alan Modra  <amodra@gmail.com>
2113
2114         * elf64-ppc.c (struct got_entry): Make tls_type and is_indirect
2115         unsigned char.  Update variables and code using them throughout file.
2116         (struct ppc_link_hash_entry): Likewise for tls_mask.
2117
2118         * elf64-ppc.c (ppc64_elf_layout_multitoc): Don't merge local got ents.
2119
2120         * elf64-ppc.c (has_small_toc_reloc): Don't define.
2121         (makes_toc_func_call, call_check_in_progress): Shuffle flags.
2122         (struct ppc64_elf_obj_tdata): Add has_small_toc_reloc.  Update
2123         code setting the flag.
2124         (ppc64_elf_next_toc_section): Group big-toc sections in
2125         0x80008000 chunks.
2126
2127 2010-02-08  David S. Miller  <davem@davemloft.net>
2128
2129         * elfxx-sparc.h (struct _bfd_sparc_elf_link_hash_table): Remove sgot,
2130         srelgot, splt, srelplt, and sgotplt members in favor of generic copies.
2131
2132         * elfxx-sparc.c (create_got_section): Delete.
2133         (_bfd_sparc_elf_create_dynamic_sections): Don't call, the dynamic
2134         section creator does that work for us.  Use ->elf.foo instead of
2135         ->foo where applicable.
2136         (_bfd_sparc_elf_check_relocs): Use ->elf.foo instead of ->foo
2137         where applicable.
2138         (allocate_dynrelocs): Likewise.
2139         (_bfd_sparc_elf_size_dynamic_sections): Likewise.
2140         (_bfd_sparc_elf_relocate_section): Likewise.
2141         (sparc_vxworks_build_plt_entry): Likewise.
2142         (_bfd_sparc_elf_finish_dynamic_symbol): Likewise.
2143         (sparc_finish_dyn): Likewise.
2144         (sparc_vxworks_finish_exec_plt): Likewise.
2145         (sparc_vxworks_finish_shared_plt): Likewise.
2146         (_bfd_sparc_elf_finish_dynamic_sections): Likewise.
2147
2148         * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Use the SYMBOL_*
2149         macros for visibilty and locality checks.
2150         (_bfd_sparc_elf_adjust_dynamic_symbol): Likewise.
2151         (allocate_dynrelocs): Likewise.
2152         (_bfd_sparc_elf_relocate_section): Likewise.
2153         (_bfd_sparc_elf_finish_dynamic_symbol):Likewise.
2154
2155         * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Remove set
2156         but never used local var 'dynobj'.
2157
2158         * elfxx-sparc.c (_bfd_sparc_elf_adjust_dynamic_symbol): Handle
2159         nocopyreloc.
2160
2161         * reloc.c (BFD_RELOC_SPARC_JMP_IREL): New.
2162         (BFD_RELOC_SPARC_IRELATIVE): Likewise.
2163         * bfd-in2.h: Regenerate.
2164         * libbfd.h: Regenerate.
2165
2166         * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Add loc_hash_table
2167         and loc_hash_memory.
2168         (_bfd_sparc_elf_link_hash_table_free): Declare.
2169         * elf32-sparc.c (elf32_sparc_add_symbol_hook): New.
2170         (elf_backend_add_symbol_hook, elf_backend_post_process_headers,
2171         bfd_elf32_bfd_link_hash_table_free): Define.
2172         * elf64-sparc.c (elf64_sparc_add_symbol_hook): Set
2173         has_ifunc_symbols if STT_GNU_IFUNC.
2174         (bfd_elf64_bfd_link_hash_table_free): Define.
2175         (elf_backend_post_process_headers): Define always.
2176         * elfxx-sparc.c (sparc_jmp_irel_howto, sparc_irelative_howto): New.
2177         (sparc_reloc_map): Add entries for new IFUNC relocs.
2178         (_bfd_sparc_elf_reloc_type_lookup): Handle new IFUNC relocs.
2179         (_bfd_sparc_elf_info_to_howto_ptr): Likewise.
2180         (elf_sparc_local_htab_hash, elf_sparc_local_htab_eq,
2181         elf_sparc_get_local_sym_hash): New.
2182         (_bfd_sparc_elf_create_dynamic_sections): Move PLT ops initialization
2183         from here...
2184         (_bfd_sparc_elf_link_hash_table_create): ... to here.  Allocate
2185         local hash table.
2186         (_bfd_sparc_elf_link_hash_table_free): New.
2187         (create_ifunc_sections): New.
2188         (_bfd_sparc_elf_check_relocs): Unconditionally assign htab->elf.dynobj
2189         and call create_ifunc_sections().  For local STT_GNU_IFUNC symbols
2190         cons up a fake local hash table entry for it.  Unconditionally add
2191         a PLT refcount for STT_GNU_IFUNC symbols when h->def_regular.  Count
2192         dyn relocs for ifunc.
2193         (_bfd_sparc_elf_adjust_dynamic_symbol): Handle ifunc.
2194         (allocate_dynrelocs):  Unconditionally emit a PLT entry when
2195         STT_GNU_IFUNC and h->def_regular.  Count GOT dyn relocs for ifunc.
2196         (allocate_local_dynrelocs): New function.
2197         (_bfd_sparc_elf_size_dynamic_sections): Invoke it over the local hash
2198         table.  Emit dynamic relocs to irelplt when not shared.  Treat iplt
2199         like splt.
2200         (_bfd_sparc_elf_relocate_section): Handle ifunc relocations by hand.
2201         (_bfd_sparc_elf_finish_dynamic_symbol): Adjust for non-dynamic ifunc
2202         plt in iplt/irelplt.
2203
2204 2010-02-08  Richard Sandiford  <r.sandiford@uk.ibm.com>
2205
2206         * xcofflink.c (_bfd_xcoff_bfd_final_link): When calculating
2207         max_contents_size, only consider sections whose contents must
2208         be swapped in.
2209
2210 2010-02-09  Alan Modra  <amodra@gmail.com>
2211
2212         * elf64-ppc.c (allocate_dynrelocs): Remove unused got structs here..
2213         (ppc64_elf_size_dynamic_sections): ..and here..
2214         (merge_got_entries): ..rather than here.
2215
2216 2010-02-09  Alan Modra  <amodra@gmail.com>
2217
2218         * elf64-ppc.c (struct ppc_link_hash_table): Add do_multi_toc.
2219         (has_small_toc_reloc): Define.
2220         (ppc64_elf_check_relocs): Set the above flags.
2221         (ppc64_elf_edit_opd): Delete obfd param.
2222         (ppc64_elf_tls_optimize): Likewise.
2223         (ppc64_elf_edit_toc): Likewise.
2224         (ppc64_elf_tls_setup): Likewise.  Add no_multi_toc param.
2225         * elf64-ppc.h: Update prototypes.
2226
2227 2010-02-08  Alan Modra  <amodra@gmail.com>
2228
2229         * section.c (struct bfd_section): Delete has_tls_reloc,
2230         has_tls_get_addr_call, has_gp_reloc, need_finalize_relax, reloc_done.
2231         Add sec_flg0 thru sec_flg5.
2232         (BFD_FAKE_SECTION): Update for changed flags.
2233         * ecoff.c (bfd_debug_section): Likewise.
2234         * elf32-ppc.c (has_tls_reloc, has_tls_get_addr_call): Define.
2235         * elf64-ppc.c (has_tls_reloc, has_tls_get_addr_call): Define.
2236         (has_toc_reloc, makes_toc_func_call, call_check_in_progress): Update.
2237         * elf32-xtensa.c (reloc_done): Define.
2238         * elfxx-ia64.c (skip_relax_pass_0, skip_relax_pass_1): Update.
2239         * bfd-in2.h: Regenerate.
2240
2241 2010-02-08  Tristan Gingold  <gingold@adacore.com>
2242
2243         * mach-o.c (bfd_mach_o_canonicalize_one_reloc): Set reloc.r_extern
2244         for non-scattered relocations.
2245
2246 2010-02-08  Nathan Sidwell  <nathan@codesourcery.com>
2247
2248         * elf32-ppc.c (ppc_elf_begin_write_processing): Allow empty
2249         apuinfo sections, only scan input sections once and reuse the
2250         buffer.
2251
2252 2010-02-08  Philipp Tomsich  <philipp.tomsich@theobroma-systems.com>
2253
2254         * archures.c (bfd_mach_ppc_titan): Define.
2255         * bfd-in2.h: Regenerate.
2256         * cpu-powerpc.c (bfd_powerpc_archs): Add titan entry.
2257
2258 2010-02-08  Alan Modra  <amodra@gmail.com>
2259
2260         * elf32-ppc.c (ppc_elf_check_relocs): Remove dead ifunc code.
2261
2262 2010-02-05  Sterling Augustine  <sterling@tensilica.com>
2263
2264         * elf.c (assign_file_positions_for_load_sections) Update lma of
2265         section if necessary.  Fixes Bugzilla 11219.
2266
2267 2010-02-05  H.J. Lu  <hongjiu.lu@intel.com>
2268
2269         * elf32-i386.c: Remove trailing white spaces.
2270         * elf64-x86-64.c: Likewise.
2271
2272 2010-02-03  Nick Clifton  <nickc@redhat.com>
2273
2274         * elf-bfd.h (emum elf_object_id): Rename to elf_target_id.  Add
2275         entries for other architectures.
2276         (struct elf_link_hash_table): Add hash_table_id field.
2277         (elf_hash_table_id): New accessor macro.
2278         * elflink.c (_bfd_elf_link_hash_table_init): Add target_id
2279         parameter.
2280         * elf-m10300.c (elf32_mn10300_hash_table): Check table id before
2281         returning cast pointer.
2282         (elf32_mn10300_link_hash_table_create): Identify new table as
2283         containing MN10300 extensions.
2284         (mn10300_elf_relax_section): Check pointer returned by
2285         elf32_mn10300_hash_table.
2286         * elf32-arm.c: Likewise, except using ARM extensions.
2287         * elf32-avr.c: Likewise, except using AVR extensions.
2288         * elf32-bfin.c: Likewise, except using BFIN extensions.
2289         * elf32-cris.c: Likewise, except using CRIS extensions.
2290         * elf32-frv.c: Likewise, except using FRV extensions.
2291         * elf32-hppa.c: Likewise, except using HPPA32 extensions.
2292         * elf32-i386.c: Likewise, except using I386 extensions.
2293         * elf32-lm32.c: Likewise, except using LM32 extensions.
2294         * elf32-m32r.c: Likewise, except using M32RM extensions.
2295         * elf32-m68hc11.c: Likewise, except using M68HC11 extensions.
2296         * elf32-m68hc1x.c: Likewise, except using M68HC11 extensions.
2297         * elf32-m68hc1x.h: Likewise, except using M68HC11 extensions.
2298         * elf32-m68k.c: Likewise, except using M68K extensions.
2299         * elf32-microblaze.c: Likewise, except using MICROBLAZE extensions.
2300         * elf32-ppc.c: Likewise, except using PPC32 extensions.
2301         * elf32-s390.c: Likewise, except using S390 extensions.
2302         * elf32-sh.c: Likewise, except using SH extensions.
2303         * elf32-spu.c: Likewise, except using SPU extensions.
2304         * elf32-xtensa.c: Likewise, except using XTENSA extensions.
2305         * elf64-alpha.c: Likewise, except using ALPHA extensions.
2306         * elf64-hppa.c: Likewise, except using HPPA64 extensions.
2307         * elf64-ppc.c: Likewise, except using PPC64 extensions.
2308         * elf64-s390.c: Likewise, except using S390 extensions.
2309         * elf64-x86-64.c: Likewise, except using X86_64 extensions.
2310         * elfxx-ia64.c: Likewise, except using IA64 extensions.
2311         * elfxx-mips.c: Likewise, except using MIPS extensions.
2312         * elfxx-sparc.c: Likewise, except using SPARC extensions.
2313         * elfxx-sparc.h: Likewise, except using SPARC extensions.
2314         * elf32-cr16.c (struct elf32_cr16_link_hash_table): Delete
2315         redundant structure.
2316         (elf32_cr16_hash_table): Delete unused macro.
2317         (elf32_cr16_link_hash_traverse): Delete unused macro.
2318         * elf32-score.c: Likewise.
2319         * elf32-score7.c: Likewise.
2320         * elf32-vax.c: Likewise.
2321         * elf64-sh64.c: Likewise.
2322
2323 2010-02-03  Alan Modra  <amodra@gmail.com>
2324
2325         * elf64-ppc.c (struct plt_entry): Move earlier in file.
2326         (struct got_entry): Likewise.  Add is_indirect and got.ent fields.
2327         (struct ppc64_elf_obj_tdata): Change tlsld_got to be a struct got_entry.
2328         Update all uses.
2329         (struct ppc_link_hash_table): Add got_reli_size and second_toc_pass.
2330         Remove no_multi_toc.
2331         (update_local_sym_info, ppc64_elf_check_relocs): Clear is_indirect
2332         when allocating a new struct got_entry.
2333         (allocate_got): New function, extracted from..
2334         (allocate_dynrelocs): ..here.  Abort on got entry in non-ppc64 bfd.
2335         (ppc64_elf_size_dynamic_sections): Track got relocs allocated in
2336         .reliplt by got_reli_size.  Set owner on ppc64_tlsld_got entries.
2337         (ppc64_elf_setup_section_lists): Remove output_bfd param and
2338         no_multi_toc, add add_stub_section and layout_sections_again.  Stash
2339         new params in htab.  Extract some code to..
2340         (ppc64_elf_start_multitoc_partition): ..here.  New function.
2341         (ppc64_elf_next_toc_section): Check for linker script errors.  Handle
2342         second pass toc scan.
2343         (merge_got_entries, merge_global_got, reallocate_got): New functions.
2344         (ppc64_elf_reinit_toc): Rename to..
2345         (ppc64_elf_finish_multitoc_partition): ..this.
2346         (ppc64_elf_layout_multitoc): New function.
2347         (ppc64_elf_size_stubs): Delete output_bfd, add_stub_section and
2348         layout_sections_again params.
2349         (ppc64_elf_relocate_section): Handle indirect got entries.
2350         * elf64-ppc.h: Update prototypes.  Declare new functions.
2351
2352 2010-02-02  H.J. Lu  <hongjiu.lu@intel.com>
2353
2354         * elf-bfd.h (elfcore_write_xstatereg): New.
2355
2356         * elf.c (elfcore_grok_xstatereg): New.
2357         (elfcore_write_xstatereg): Likewise.
2358         (elfcore_grok_note): Handle NT_X86_XSTATE.
2359         (elfcore_write_register_note): Handle .reg-xstate section.
2360
2361 2010-02-01  Tristan Gingold  <gingold@adacore.com>
2362
2363         * som.c (som_write_ar_hdr): Define this macro.
2364
2365 2010-01-30  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
2366
2367         * elf32-hppa.c (final_link_relocate): Convert R_PARISC_TLS_GD21L,
2368         R_PARISC_TLS_LDM21L and R_PARISC_TLS_IE21L relocations that use the
2369         linkage table pointer to use the global table pointer if not doing
2370         a shared link.
2371
2372 2010-01-29  Joel Brobecker  <brobecker@adacore.com>
2373
2374         * elf.c (elfcore_grok_lwpstatus): Do not overwrite the core signal
2375         if it has already been set.
2376
2377 2010-01-27  Tristan Gingold  <gingold@adacore.com>
2378
2379         * vms.h: Remove trailing spaces.
2380         (struct hdr_struct): Remove unused hdr_c_cpr field.
2381         (enum file_format_enum): Add comments.
2382         * vms.c (vms_bfd_print_private_bfd_data): New function that
2383         replaces the macro.
2384         Remove trailing spaces.
2385         * vms-misc.c: Improve comments.
2386         (_bfd_vms_get_object_record): Also handle files without pads.
2387         * vms-hdr.c (_bfd_vms_write_dbg): Fix format string.
2388         * vms-gsd.c (struct flagdescstruct): Make name field const.
2389         (gsyflagdesc): Fix typo.
2390
2391 2010-01-27  Alan Modra  <amodra@gmail.com>
2392
2393         PR ld/11217
2394         * elf64-ppc.c (struct ppc_link_hash_table): Add toc_bfd, toc_first_sec.
2395         (ppc64_elf_setup_section_lists): Init them.
2396         (ppc64_elf_next_toc_section): Don't partition multi-toc between .got
2397         and .toc on the same input file.
2398         (ppc64_elf_relocate_section): Correct GOT entry offset.
2399
2400 2010-01-26  Tristan Gingold  <gingold@adacore.com>
2401
2402         * targets.c (BFD_JUMP_TABLE_ARCHIVE): Add initializer for write_ar_hdr.
2403         (bfd_target): Add _bfd_write_ar_hdr_fn field.
2404         * archive.c (is_bsd44_extended_name): New macro.
2405         (_bfd_generic_read_ar_hdr_mag): Use it.  Add extra_size.
2406         (bfd_slurp_armap): Also check for "__.SYMDEF" as a BSD4.4 extended
2407         name.
2408         (_bfd_archive_bsd44_construct_extended_name_table): New function.
2409         (_bfd_generic_write_ar_hdr): Ditto.
2410         (_bfd_bsd44_write_ar_hdr): Ditto.
2411         (_bfd_write_archive_contents): Call _bfd_write_ar_hdr.
2412         (bsd_write_armap): Adjust firstreal computation.
2413         * libbfd-in.h (struct areltdata): Add extra_size field.
2414         (_bfd_generic_write_ar_hdr): Add prototype.
2415         (_bfd_bsd44_write_ar_hdr): Ditto.
2416         (_bfd_write_ar_hdr): Define.
2417         (_bfd_noarchive_write_ar_hdr): Ditto.
2418         (_bfd_archive_bsd_write_ar_hdr): Ditto.
2419         (_bfd_archive_coff_write_ar_hdr): Ditto.
2420         (_bfd_archive_bsd44_slurp_armap): Ditto.
2421         (_bfd_archive_bsd44_slurp_extended_name_table): Ditto.
2422         (_bfd_archive_bsd44_construct_extended_name_table): New prototype.
2423         (_bfd_archive_bsd44_truncate_arname): Ditto.
2424         (_bfd_archive_bsd44_write_armap): Ditto.
2425         (_bfd_archive_bsd44_read_ar_hdr): Ditto.
2426         (_bfd_archive_bsd44_write_ar_hdr): Ditto.
2427         (_bfd_archive_bsd44_openr_next_archived_file): Ditto.
2428         (_bfd_archive_bsd44_get_elt_at_index): Ditto.
2429         (_bfd_archive_bsd44_generic_stat_arch_elt): Ditto.
2430         (_bfd_archive_bsd44_update_armap_timestamp): Ditto.
2431         * libbfd.h: Regenerate.
2432         * oasys.c (oasys_write_ar_hdr): Define.
2433         * libecoff.h (_bfd_ecoff_write_ar_hdr): Define.
2434         * ieee.c (ieee_write_ar_hdr): Define.
2435         * elf64-mips.c (bfd_elf64_archive_write_ar_hdr): Define.
2436         * coff-rs6000.c (rs6000coff_vec): Adjust for write_ar_hdr field.
2437         (bfd_pmac_xcoff_backend_data): Ditto.
2438         * coff64-rs6000.c (rs6000coff64_vec): Ditto.
2439         (bfd_xcoff_aix5_backend_data): Ditto.
2440         * coff-alpha.c (alpha_ecoff_write_ar_hdr): Define.
2441         * aout-target.h (MY_write_ar_hdr): Define it if not defined.
2442         * aout-tic30.c (MY_write_ar_hdr): Ditto.
2443         * mach-o-target.c (TARGET_NAME): Use _bfd_archive_bsd44 archive.
2444         (bfd_mach_o_mkarchive, bfd_mach_o_read_ar_hdr)
2445         (bfd_mach_o_slurp_armap, bfd_mach_o_slurp_extended_name_table)
2446         (bfd_mach_o_construct_extended_name_table)
2447         (bfd_mach_o_truncate_arname, bfd_mach_o_write_armap)
2448         (bfd_mach_o_get_elt_at_index, bfd_mach_o_generic_stat_arch_elt)
2449         (bfd_mach_o_update_armap_timestamp): Moved to mach-o.c
2450         * mach-o.c (bfd_mach_o_mkarchive, bfd_mach_o_read_ar_hdr)
2451         (bfd_mach_o_slurp_armap, bfd_mach_o_slurp_extended_name_table)
2452         (bfd_mach_o_construct_extended_name_table)
2453         (bfd_mach_o_truncate_arname, bfd_mach_o_write_armap)
2454         (bfd_mach_o_get_elt_at_index, bfd_mach_o_generic_stat_arch_elt)
2455         (bfd_mach_o_update_armap_timestamp): Moved from mach-o-target.c
2456         * bfd-in2.h: Regenerate.
2457
2458 2010-01-26  Alan Modra  <amodra@gmail.com>
2459             H.J. Lu  <hongjiu.lu@intel.com>
2460
2461         PR ld/11218
2462         * elflink.c (elf_link_output_extsym): Do not ignore undefined
2463         symbols with ref_regular set when gc_sections is active.
2464
2465 2010-01-25  Alan Modra  <amodra@gmail.com>
2466
2467         PR ld/11217
2468         * elf64-ppc.c (ppc64_elf_tls_optimize): Optimize tls sequences
2469         with relocations against undefined weak symbols.
2470         (ppc64_elf_relocate_section): Don't optimize calls to undefined
2471         weak functions if the symbol is dynamic.
2472         (ppc64_elf_relocate_section): Edit tprel tls sequences.
2473         * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
2474         (_bfd_elf_ppc_at_tprel_transform): New function.
2475         * bfd-in.h (_bfd_elf_ppc_at_tprel_transform): Declare.
2476         * bfd-in2.h: Regenerate.
2477
2478 2010-01-23  Richard Sandiford  <r.sandiford@uk.ibm.com>
2479
2480         * coff-rs6000.c (xcoff_howto_table): Change size to 0 and bitsize to 1.
2481         (_bfd_xcoff_reloc_type_lookup): Handle BFD_RELOC_NONE.
2482         * coff64-rs6000.c (xcoff64_howto_table): Change size to 0 and
2483         bitsize to 1.
2484         (xcoff64_reloc_type_lookup): Handle BFD_RELOC_NONE.
2485
2486 2010-01-21  Nick Clifton  <nickc@redhat.com>
2487
2488         * elflink.c (elf_link_add_object_symbols): Look up name of
2489         undefined symbol both before and after versioning has been
2490         applied.  Do not bother with symbols that are weakly undefined.
2491
2492 2010-01-21  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>
2493
2494         * elf32-s390.c (elf32_s390_merge_private_bfd_data): New function.
2495         (bfd_elf32_bfd_merge_private_bfd_data): New macro definition.
2496
2497 2010-01-19  Cary Coutant  <ccoutant@google.com>
2498
2499         * dwarf2.c (read_attribute_value): Add DW_FORM_ref_sig8.
2500
2501 2010-01-19  Daisuke Hatayama  <d.hatayama@jp.fujitsu.com>
2502             Alan Modra <amodra@gmail.com>
2503
2504         * elfcode.h (elf_swap_ehdr_out): Handle e_phnum > 0xffff.
2505         (elf_object_p): Read e_phnum extension.
2506         (elf_write_shdrs_and_ehdr): Write e_phnum extension.
2507         * elfcore.h (elf_core_file_p): Read e_phnum extension.  Sanity check
2508         that we can read last program header.
2509
2510 2010-01-19  Matthew Gretton-Dann  <matthew.gretton-dann@arm.com>
2511
2512         * elf32-arm.c (elf32_arm_howto_table_1): Correct bitsize of
2513         R_ARM_THM_CALL entry.
2514         (elf32_arm_final_link_relocate): Correct calculation of
2515         reloc_signed_max when doing a R_ARM_THM_CALL, R_ARM_THM_XPC22,
2516         or R_ARM_THM_JUMP24 relocation.
2517
2518 2010-01-18  Alan Modra  <amodra@gmail.com>
2519
2520         PR 11168
2521         * coffcode.h (coff_compute_section_file_positions): Move Rs6000COFF_C
2522         block past vars in COFF_IMAGE_WITH_PE block.  Report error on more
2523         than 32k sections.
2524
2525 2010-01-15  Jan Kratochvil  <jan.kratochvil@redhat.com>
2526
2527         Fix compilation warning on gcc-3.4.
2528         * vms-tir.c (start_etir_record, sto_imm): Rename the prototype
2529         parameter index to sec_index according to the function definition.
2530
2531 2010-01-13  Chao-ying Fu  <fu@mips.com>
2532
2533         * elfxx-mips.c (JR_TO_B_P): New define to transform JR to B.
2534         It is true for all CPUs.
2535         (jal_reloc_p): New function.
2536         (mips_elf_calculate_relocation): Rename require_jalxp to
2537         cross_mode_jump_p.
2538         Update comment for CROSS_MODE_JUMP_P.
2539         Set up cross_mode_jump_p based on the mode change.
2540         (mips_elf_perform_relocation): Rename require_jalx to cross_mode_jump_p.
2541         Update comment for CROSS_MODE_JUMP_P.
2542         Test cross_mode_jump_p and jal_reloc_p to turn jal to jalx.
2543         Use !cross_mode_jump_p to guard conversion.
2544         Convert "jr t9" to "b", if possible.
2545         (_bfd_mips_elf_relocate_section): Rename require_jalx to
2546         cross_mode_jump_p.
2547         Pass &cross_mode_jump_p to call mips_elf_calculate_relocation.
2548         Pass cross_mode_jump_p to call mips_elf_perform_relocation.
2549
2550 2010-01-13  Nick Clifton  <nickc@redhat.com>
2551
2552         * cpu-m32c.c (m32c_scan): New function.  Ensures that a scan for
2553         "m32c" returns the m32c arch_info_struct and not the m16c
2554         arch_info_struct.
2555         (arch_info_struct): Use the new scan function.
2556         (bfd_m32c_arch): Likewise.
2557
2558 2010-01-13  Tristan Gingold  <gingold@adacore.com>
2559
2560         * config.bfd: Remove duplicated target vector for i386-*-darwin.
2561         Appends new arch instead of overriding.
2562         Use mach_o_x86_64_vec for x86_64-*-darwin.
2563         * configure.in: Add mach_o_x86_64_vec.
2564         * configure: Regenerate.
2565         * targets.c: Declare mach_o_x86_64_vec, add it to _bfd_target_vector.
2566         * Makefile.am (BFD64_BACKENDS): Add mach-o-x86-64.lo
2567         (BFD64_BACKENDS_CFILES): Add mach-o-x86-64.c
2568         * Makefile.in: Regenerate.
2569         * mach-o-x86-64.c: New file.
2570
2571 2010-01-13  Tristan Gingold  <gingold@adacore.com>
2572
2573         * reloc.c: Add MACH_O_X86_64 relocations.
2574         * bfd-in2.h: Regenerate.
2575         * libbfd.h: Regenerate.
2576
2577 2010-01-13  Tristan Gingold  <gingold@adacore.com>
2578
2579         * archive.c (normalize): Use lbasename.
2580         (bfd_bsd_truncate_arname): Ditto.
2581         (bfd_gnu_truncate_arname): Ditto.
2582
2583 2010-01-12  Tristan Gingold  <gingold@adacore.com>
2584
2585         * makefile.vms (CFLAGS): Turns warnings into informational messages.
2586
2587 2010-01-11  Tristan Gingold  <gingold@adacore.com>
2588
2589         * mach-o.h: Add x86-64 relocation types.
2590
2591 2010-01-11  Tristan Gingold  <gingold@adacore.com>
2592
2593         * mach-o.h (bfd_mach_o_backend_data): Add arch field.
2594         (bfd_mach_o_set_arch_mach): New prototype.
2595         * mach-o.c (bfd_mach_o_mkobject): Define with bfd_mach_o_gen_mkobject.
2596         (bfd_mach_o_set_arch_mach): New function.
2597         (bfd_mach_o_gen_mkobject): New function.
2598         Set TARGET_ARCHITECTURE for the generic back-ends.
2599         * mach-o-target.c (bfd_mach_o_set_arch_mach): Remove define.
2600         Check that TARGET_ARCHITECTURE is defined.
2601         Add TARGET_ARCHITECTURE in TARGET_NAME_BACKEND structure.
2602         * mach-o-i386.c (TARGET_ARCHITECTURE): Define.
2603
2604 2010-01-11  Tristan Gingold  <gingold@adacore.com>
2605
2606         * archive.c (bfd_slurp_armap): Also check for Mach-O sorted armap.
2607
2608 2010-01-11  Nick Clifton  <nickc@redhat.com>
2609
2610         * elf32-v850.c (v850_elf_perform_relocation): Fix overflow
2611         handling of R_V850_HI16_S relocation.
2612
2613 2010-01-11  Alan Modra  <amodra@gmail.com>
2614
2615         PR 11103
2616         * dwarf1.c (parse_die): Correct FORM_STRING data pointer increment.
2617
2618 2010-01-11  Alan Modra  <amodra@gmail.com>
2619
2620         PR 6832
2621         * dwarf2.c (struct comp_unit): Add sec_info_ptr.
2622         (find_abstract_instance_name): Use it.
2623         (parse_comp_unit): Set it.
2624
2625 2010-01-09  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
2626
2627         * Makefile.in: Regenerate.
2628         * configure: Regenerate.
2629
2630 2010-01-08  Tristan Gingold  <gingold@adacore.com>
2631
2632         * archive.c: Remove bfd_special_undocumented_glue.
2633
2634 2010-01-08  Alan Modra  <amodra@gmail.com>
2635
2636         PR ld/11133
2637         * elf32-cr16.c (elf32_cr16_gc_mark_hook): Call _bfd_elf_gc_mark_hook.
2638         * elf32-microblaze.c (microblaze_elf_gc_mark_hook): Likewise.
2639         * elf64-ppc.c (ppc64_elf_gc_mark_hook): Likewise.
2640
2641 2010-01-07  H.J. Lu  <hongjiu.lu@intel.com>
2642
2643         PR ld/11138
2644         * elflink.c (elf_link_check_versioned_symbol): Don't abort if
2645         a symbol referenced by DSO is is defined in a non-shared object
2646         and forced local.
2647
2648 2010-01-07  H.J. Lu  <hongjiu.lu@intel.com>
2649
2650         PR ld/11133
2651         * elflink.c (_bfd_elf_gc_mark_hook): Check section XXX for
2652         undefined __start_XXX/__stop_XXX in all input files and set
2653         SEC_KEEP.
2654
2655 2010-01-07  H.J. Lu  <hongjiu.lu@intel.com>
2656
2657         PR ld/11143
2658         * elflink.c (elf_gc_sweep): Keep SHT_NOTE section.
2659
2660 2010-01-04  Daniel Gutson  <dgutson@codesourcery.com>
2661
2662         * bfd.m4 (BFD_HAVE_SYS_PROCFS_TYPE): Define _STRUCTURE_PROC
2663         before including procfs.h.
2664         (BFD_HAVE_SYS_PROCFS_TYPE_MEMBER): Likewise.
2665         * configure.in: Added autoconf probe for the pr_fpreg member.
2666         * configure: Regenerated.
2667         * config.in: Regenerated.
2668         * elf.c: Define _STRUCTURE_PROC before including procfs.h.
2669
2670 2010-01-04  Joel Brobecker  <brobecker@adacore.com>
2671
2672         Fix -Wshadow warnings in dwarf2.c (seen on alpha-tru64).
2673         * dwarf2.c (concat_filename): Rename dirname with dir_name
2674         to void shadowing the dirname function.
2675         Rename subdirname with subdir_name to stay consistent with
2676         the new dir_name variable name.
2677
2678 2010-01-04  Edmar Wienskoski  <edmar@freescale.com>
2679
2680         * archures.c: Add bfd_mach_ppc_e500mc64.
2681         * bfd-in2.h: Regenerate.
2682         * cpu-powerpc.c (bfd_powerpc_archs): Add entry for
2683         bfd_mach_ppc_e500mc64.
2684
2685 2010-01-01  Joel Brobecker  <brobecker@adacore.com>
2686
2687         Fix -Wshadow warnings (seen on ppc-aix)
2688         * xcofflink.c: Replace finfo by flinfo throughout.
2689
2690 For older changes see ChangeLog-2009
2691 \f
2692 Local Variables:
2693 mode: change-log
2694 left-margin: 8
2695 fill-column: 74
2696 version-control: never
2697 End: