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