* elf.c (bfd_section_from_shdr): Remove extraneous breaks.
[external/binutils.git] / bfd / ChangeLog
1 2006-10-26  Ben Elliston  <bje@au.ibm.com>
2
3         * elf.c (bfd_section_from_shdr): Remove extraneous breaks.
4         * targets.c (find_target): Remove extraneous break.
5
6 2006-10-26  Ben Elliston  <bje@au.ibm.com>
7
8         * coff-maxq.c (coff_maxq20_reloc): Remove unused variable `howto'.
9         (struct maxq_reloc_map): Unused; remove.
10         (maxq_reloc_map): Likewise.
11         (maxq_reloc_type_lookup): Remove loop over maxq_reloc_map.
12
13 2006-10-26  Ben Elliston  <bje@au.ibm.com>      
14
15         * elf.c (bfd_elf_set_dyn_lib_class): Change second argument type
16         from int to enum dynamic_lib_link_class lib_class.
17         * bfd-in.h (bfd_elf_set_dyn_lib_class): Likewise.
18         * bfd-in2.h: Regenerate.
19
20 2006-10-25  Alan Modra  <amodra@bigpond.net.au>
21             Trevor Smigiel  <Trevor_Smigiel@playstation.sony.com>
22             Yukishige Shibata  <shibata@rd.scei.sony.co.jp>
23             Nobuhisa Fujinami  <fnami@rd.scei.sony.co.jp>
24             Takeaki Fukuoka  <fukuoka@rd.scei.sony.co.jp>
25
26         * cpu-spu.c: New file.
27         * elf32-spu.c: New file.
28         * elf32-spu.h: New file.
29         * archures.c: Add SPU support.
30         * config.bfd: Likewise.
31         * configure.in: Likewise.
32         * reloc.c: Likewise.
33         * targets.c: Likewise.
34         * Makefile.am: Likewise.  Run "make dep-am".
35         * libbfd.h: Regenerate.
36         * bfd-in2.h: Regenerate.
37         * Makefile.in: Regenerate.
38         * configure: Regenerate.
39         * po/SRC-POTFILES.in: Regenerate.
40
41 2006-10-23  Alan Modra  <amodra@bigpond.net.au>
42
43         * elf64-ppc.c (ppc64_elf_edit_opd): Clarify comment.
44
45 2006-10-23  Alan Modra  <amodra@bigpond.net.au>
46
47         * elf32-score.c: Formatting.
48         (elf_backend_omit_section_dynsym): Define.
49         (score_elf_create_dynamic_relocation): Remove code copied from mips.
50         Don't use section syms in dynamic relocs.  Remove unused param.
51         (score_elf_final_link_relocate): Remove unused param.
52
53 2006-10-23  Alan Modra  <amodra@bigpond.net.au>
54
55         * linker.c (fix_syms): Choose best of previous and next
56         section based on section flags and vma.
57
58 2006-10-21  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
59
60         * elf32-sh64.c (sh64_elf_merge_symbol_attribute): Do merging
61         only when the non visibility part of st_other is non-zero.
62         * elf64-sh64.c (sh64_elf64_merge_symbol_attribute): Likewise.
63
64 2006-10-20  Richard Sandiford  <richard@codesourcery.com>
65
66         * elfxx-mips.c (_bfd_mips_elf_modify_segment_map): Don't extend
67         PT_DYNAMIC on GNU/Linux targets.
68
69 2006-10-20  Richard Sandiford  <richard@codesourcery.com>
70
71         * elfxx-mips.c (_bfd_mips_elf_finish_dynamic_sections): Make the
72         size of .rel.dyn reflect the value of DT_RELSZ.
73
74 2006-10-20  Richard Sandiford  <richard@codesourcery.com>
75
76         * elfxx-mips.c (_bfd_mips_elf_additional_program_headers): Allocate
77         a PT_NULL header for dynamic objects.
78         (_bfd_mips_elf_modify_segment_map): Add it.
79
80 2006-10-19  Mei Ligang  <ligang@sunnorth.com.cn>
81
82         * elf32-score.c (score_elf_rel_dyn_section): Replace
83         bfd_make_section with bfd_make_section_with_flags.
84         (_bfd_score_elf_create_dynamic_sections): Ditto.
85         (score_elf_create_got_section): Ditto.
86         (score_elf_final_link_relocate): Delete referrence to
87         EF_SCORE_HASENTRY.
88
89 2006-10-19  Richard Sandiford  <richard@codesourcery.com>
90
91         * elfxx-mips.c (sort_dynamic_relocs): Sort relocations against the
92         same symbol by increasing r_offset.
93         (sort_dynamic_relocs_64): Likewise.  Fix comparisons between very
94         large and very small symbol indexes.
95
96 2006-10-19  Richard Sandiford  <richard@codesourcery.com>
97
98         * elfxx-mips.c (_bfd_mips_elf_size_dynamic_sections): Add DT_DEBUG
99         and DT_MIPS_RLD_MAP tags for position-independent executables.
100         Do not add DT_DEBUG to shared libraries for any MIPS target.
101
102 2006-10-18  H.J. Lu  <hongjiu.lu@intel.com>
103
104         PR ld/3290
105         * elflink.c (elf_link_add_object_symbols): Hide definitions in
106         debug sections.
107
108 2006-10-19  Alan Modra  <amodra@bigpond.net.au>
109
110         * elf32-arm.c (bfd_elf32_arm_allocate_interworking_sect): Check,
111         don't set, glue section size.
112         (record_arm_to_thumb_glue): Set glue section size here.
113         (record_thumb_to_arm_glue): Likewise.
114         (bfd_elf32_arm_add_glue_sections_to_bfd): Formatting.
115         (bfd_elf32_arm_process_before_allocation): Ignore exluded sections.
116
117 2006-10-18  Roy Marples  <uberlord@gentoo.org>
118
119         * elf64-sparc.c: Add FreeBSD support.
120         (elf64_sparc_fbsd_post_process_headers): New function.
121         * targets.c (_bfd_target_vector): Add bfd_elf64_sparc_freebsd_vec.
122         * config.bfd (sparc64-*-freebsd*): Set targ_defvec to bfd_elf64_sparc_freebsd_vec.
123         * configure.in: Add entry for bfd_elf64_sparc_freebsd_vec.
124         * configure: Regenerate.
125
126 2006-10-17  Mark Shinwell  <shinwell@codesourcery.com>
127
128         * elf32-arm.c (elf32_arm_final_link_relocate): Add support for
129         R_ARM_MOVW_BREL_NC, R_ARM_MOVW_BREL, R_ARM_MOVT_BREL,
130         R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVW_BREL and
131         R_ARM_THM_MOVT_BREL relocations.
132
133 2006-10-17  Mark Shinwell  <shinwell@codesourcery.com>
134
135         * elf32-arm.c (elf32_arm_howto_table_1): Change offset for
136         R_THM_CALL to 25 and remove FIXME comment.
137         (using_thumb2): New function.
138         (elf32_arm_final_link_relocate): Cope with Thumb-2 BL encoding.
139
140 2006-10-17  Mark Shinwell  <shinwell@codesourcery.com>
141
142         * elf32-arm.c (elf32_arm_final_link_relocate): Add cases
143         for R_ARM_ABS32_NOI and R_ARM_REL32_NOI.
144         (elf32_arm_gc_sweep_hook): Likewise.
145         (elf32_arm_check_relocs): Likewise.
146         (allocate_dynrelocs): Likewise.
147
148 2006-10-17  Alan Modra  <amodra@bigpond.net.au>
149
150         * elf-bfd.h (struct elf_link_hash_table): Reorder.  Add
151         text_index_section and data_index_section.
152         (struct elf_backend_data): Add elf_backend_init_index_section.
153         (_bfd_elf_init_1_index_section): Declare.
154         (_bfd_elf_init_2_index_sections): Declare.
155         * elfxx-target.h (elf_backend_init_index_section): Define.
156         (elfNN_bed): Init new field.
157         * elflink.c (_bfd_elf_link_omit_section_dynsym): Keep first tls
158         section and text_index_section plus data_index_section.
159         (_bfd_elf_link_renumber_dynsyms): Clear dynindx on omitted sections.
160         (_bfd_elf_init_1_index_section): New function.
161         (_bfd_elf_init_2_index_sections): New function.
162         (bfd_elf_size_dynsym_hash_dynstr): Call elf_backend_init_index_section.
163         (elf_link_input_bfd): When emitting relocs, use text_index_section
164         and data_index_section for removed sections.
165         * elf-m10300.c (elf_backend_omit_section_dynsym): Define.
166         * elf32-i386.c: Likewise.
167         * elf32-m32r.c: Likewise.
168         * elf32-sh.c: Likewise.
169         * elf32-xstormy16.c: Likewise.
170         * elf32-xtensa.c: Likewise.
171         * elf64-alpha.c: Likewise.
172         * elf64-hppa.c: Likewise.
173         * elf64-mmix.c: Likewise.
174         * elf64-sh64.c: Likewise.
175         * elfxx-ia64.c: Likewise.
176         * elf32-arm.c (elf32_arm_final_link_relocate): Use text_index_section
177         and data_index_section sym for relocs against sections with no dynamic
178         section sym.
179         (elf_backend_init_index_section): Define.
180         * elf32-cris.c: Similarly.
181         * elf32-hppa.c: Similarly.
182         * elf32-i370.c: Similarly.
183         * elf32-m68k.c: Similarly.
184         * elf32-mips.c: Similarly.
185         * elf32-ppc.c: Similarly.
186         * elf32-s390.c: Similarly.
187         * elf32-sparc.c: Similarly.
188         * elf32-vax.c: Similarly.
189         * elf64-mips.c: Similarly.
190         * elf64-ppc.c: Similarly.
191         * elf64-s390.c: Similarly.
192         * elf64-sparc.c: Similarly.
193         * elf64-x86-64.c: Similarly.
194         * elfn32-mips.c: Similarly.
195         * elfxx-mips.c: Similarly.
196         * elfxx-sparc.c: Similarly.
197         * linker.c (fix_syms): Base symbols in removed sections on
198         previous section in preference to using absolute section.
199
200 2006-10-16  Andreas Schwab  <schwab@suse.de>
201
202         * elfxx-ia64.c (addend_compare): Properly compute return value.
203
204 2006-10-15  H.J. Lu  <hongjiu.lu@intel.com>
205
206         PR ld/3314
207         * elf.c (assign_file_positions_for_non_load_sections): Don't
208         page align empty SHF_ALLOC sections.
209
210 2006-10-13  Jakub Jelinek  <jakub@redhat.com>
211
212         * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_sections): Set
213         .plt sh_entsize to 0 if plt header size isn't multiple of
214         plt entry size or for 32-bit which adds a nop insn at the
215         end of the .plt section.
216
217 2006-10-12  Bob Wilson  <bob.wilson@acm.org>
218
219         * elf32-xtensa.c (elf_xtensa_action_discarded): New.
220         (elf_backend_action_discarded): Define.
221
222 2006-10-11  Bob Wilson  <bob.wilson@acm.org>
223
224         * elf32-xtensa.c (elf_xtensa_relocate_section): Return after
225         unresolvable relocation error.
226         (elf_xtensa_finish_dynamic_symbol): Set value of undefined, weak
227         symbols to zero.
228
229 2006-10-10  Bob Wilson  <bob.wilson@acm.org>
230
231         * elf32-xtensa.c (elf_xtensa_size_dynamic_sections): Add DT_DEBUG
232         for PIE executables.
233
234 2006-10-03  Jakub Jelinek  <jakub@redhat.com>
235
236         * elf-bfd.h (struct eh_cie_fde): Add set_loc pointer.
237         * elf-eh-frame.c (skip_cfa_op): Fix handling of DW_CFA_advance_loc.
238         Handle DW_CFA_{remember,restore}_state, DW_CFA_GNU_window_save,
239         DW_CFA_val_{offset{,_sf},expression}.
240         (skip_non_nops): Record number of DW_CFA_set_loc ops.
241         (_bfd_elf_discard_section_eh_frame): Require skip_non_nops recognizes
242         all ops.  If there are any DW_CFA_set_loc ops and they are pcrel
243         or going to be pcrel, compute set_loc array.
244         (_bfd_elf_eh_frame_section_offset): If make_relative, kill relocations
245         against DW_CFA_set_loc operands.
246         (_bfd_elf_write_section_eh_frame): Handle DW_CFA_set_loc adjusting.
247
248 2006-10-02  Daniel Jacobowitz  <dan@codesourcery.com>
249
250         * elflink.c (_bfd_elf_merge_symbol): Discard references to TLS
251         symbols from the --just-syms file.
252
253 2006-10-01  Alan Modra  <amodra@bigpond.net.au>
254
255         * elf64-ppc.c (ppc64_elf_build_stubs): Test glink size for
256         existence of PLT.
257
258 2006-09-29  H.J. Lu  <hongjiu.lu@intel.com>
259
260         PR ld/3283
261         * elf64-x86-64.c (elf64_x86_64_relocate_section): Don't ignore
262         relocation overflow on branches to undefweaks.
263
264 2006-09-29  Alan Modra  <amodra@bigpond.net.au>
265
266         * po/BLD-POTFILES.in: Regenerate.
267         * po/SRC-POTFILES.in: Regenerate.
268
269 2006-09-29  Danny Smith  <dannysmith@users.sourceforge.net>
270
271         PR 3276
272         * pei-i386.c (COFF_SECTION_ALIGNMENT_ENTRIES): Enable 16 byte
273         alignment for .data$, .rdata$ and .text$ sections so that sse
274         and sse2 code will work for linkonce sections too.
275         * pe-i386.c (COFF_SECTION_ALIGNMENT_ENTRIES): Likewise.
276
277 2006-09-28  Alan Modra  <amodra@bigpond.net.au>
278
279         * elflink.c (_bfd_elf_gc_mark_hook): New function.
280         * elf-bfd.h (_bfd_elf_gc_mark_hook): Declare.
281         * elfxx-target.h (elf_backend_gc_mark_hook): Default to above.
282         * elf-m10300.c (mn10300_elf_gc_mark_hook): Use _bfd_elf_gc_mark_hook.
283         * elf32-arm.c (elf32_arm_gc_mark_hook): Likewise.
284         * elf32-cris.c (cris_elf_gc_mark_hook): Likewise.
285         * elf32-hppa.c (elf32_hppa_gc_mark_hook): Likewise.
286         * elf32-i386.c (elf_i386_gc_mark_hook): Likewise.
287         * elf32-m32r.c (m32r_elf_gc_mark_hook): Likewise.
288         * elf32-m68k.c (elf_m68k_gc_mark_hook): Likewise.
289         * elf32-mcore.c (mcore_elf_gc_mark_hook): Likewise.
290         * elf32-ppc.c (ppc_elf_gc_mark_hook): Likewise.
291         * elf32-s390.c (elf_s390_gc_mark_hook): Likewise.
292         * elf32-score.c (_bfd_score_elf_gc_mark_hook): Likewise.
293         * elf32-sh.c (sh_elf_gc_mark_hook): Likewise.
294         * elf32-vax.c (elf_vax_gc_mark_hook): Likewise.
295         * elf32-xtensa.c (elf_xtensa_gc_mark_hook): Likewise.
296         * elf64-mmix.c (mmix_elf_gc_mark_hook): Likewise.
297         * elf64-s390.c (elf_s390_gc_mark_hook): Likewise.
298         * elf64-x86-64.c (elf64_x86_64_gc_mark_hook): Likewise.
299         * elfxx-mips.c (_bfd_mips_elf_gc_mark_hook): Likewise.
300         * elfxx-sparc.c (_bfd_sparc_elf_gc_mark_hook): Likewise.
301         * elf32-bfin.c (bfin_gc_mark_hook): Likewise.
302         (bfinfdpic_gc_sweep_hook): Delete.
303         (elf_backend_gc_sweep_hook): Don't define for elf32-bfinfdpic.
304         * elf32-d10v.c (elf32_d10v_gc_mark_hook): Use _bfd_elf_gc_mark_hook.
305         (elf32_d10v_gc_sweep_hook): Delete.
306         (elf_backend_gc_sweep_hook): Don't define.
307         * elf32-fr30.c (fr30_elf_gc_mark_hook): Use _bfd_elf_gc_mark_hook.
308         (fr30_elf_gc_sweep_hook): Delete.
309         (elf_backend_gc_sweep_hook): Don't define.
310         * elf32-frv.c (elf32_frv_gc_mark_hook): Use _bfd_elf_gc_mark_hook.
311         (elf32_frv_gc_sweep_hook): Delete.
312         (elf_backend_gc_sweep_hook): Don't define.
313         * elf32-iq2000.c (iq2000_elf_gc_mark_hook): Use _bfd_elf_gc_mark_hook.
314         (iq2000_elf_gc_sweep_hook): Delete.
315         (elf_backend_gc_sweep_hook): Don't define.
316         * elf32-openrisc.c (openrisc_elf_gc_mark_hook): Use
317         _bfd_elf_gc_mark_hook.
318         (openrisc_elf_gc_sweep_hook): Delete.
319         (elf_backend_gc_sweep_hook): Don't define.
320         * elf32-v850.c (v850_elf_gc_mark_hook): Use _bfd_elf_gc_mark_hook.
321         (v850_elf_gc_sweep_hook): Delete.
322         (elf_backend_gc_sweep_hook): Don't define.
323         * elf32-xstormy16.c (xstormy16_elf_gc_mark_hook): Use
324         _bfd_elf_gc_mark_hook.
325         (xstormy16_elf_gc_sweep_hook): Delete.
326         (elf_backend_gc_sweep_hook): Don't define.
327         * elf64-sh64.c (sh_elf64_gc_mark_hook): Use _bfd_elf_gc_mark_hook.
328         (sh_elf64_gc_sweep_hook): Delete.
329         (elf_backend_gc_sweep_hook): Don't define.
330         * elf32-avr.c (elf32_avr_gc_mark_hook): Delete.
331         (elf32_avr_gc_sweep_hook): Delete.
332         (elf_backend_gc_mark_hook, elf_backend_gc_mark_hook): Don't define.
333         * elf32-cr16c.c (elf32_cr16c_gc_mark_hook): Delete.
334         (elf32_cr16c_gc_sweep_hook): Delete.
335         (elf_backend_gc_mark_hook, elf_backend_gc_mark_hook): Don't define.
336         * elf32-crx.c (elf32_crx_gc_mark_hook): Delete.
337         (elf32_crx_gc_sweep_hook): Delete.
338         (elf_backend_gc_mark_hook, elf_backend_gc_mark_hook): Don't define.
339         * elf32-h8300.c (elf32_h8_gc_mark_hook): Delete.
340         (elf32_h8_gc_sweep_hook): Delete.
341         (elf_backend_gc_mark_hook, elf_backend_gc_mark_hook): Don't define.
342         * elf32-ip2k.c (ip2k_elf_gc_mark_hook): Delete.
343         (ip2k_elf_gc_sweep_hook): Delete.
344         (elf_backend_gc_mark_hook, elf_backend_gc_mark_hook): Don't define.
345         * elf32-m32c.c (m32c_elf_gc_mark_hook, m32c_elf_gc_sweep_hook): Delete.
346         (elf_backend_gc_mark_hook, elf_backend_gc_mark_hook): Don't define.
347         * elf32-m68hc11.c (elf_backend_gc_mark_hook): Don't define.
348         (elf_backend_gc_sweep_hook): Don't define.
349         * elf32-m68hc12.c (elf_backend_gc_mark_hook): Don't define.
350         (elf_backend_gc_sweep_hook): Don't define.
351         * elf32-m68hc1x.c (elf32_m68hc11_gc_mark_hook): Delete.
352         (elf32_m68hc11_gc_sweep_hook): Delete.
353         * elf32-m68hc1x.h (elf32_m68hc11_gc_mark_hook): Delete.
354         (elf32_m68hc11_gc_sweep_hook): Delete.
355         * elf32-msp430.c (elf32_msp430_gc_mark_hook): Delete.
356         (elf32_msp430_gc_sweep_hook): Delete.
357         (elf_backend_gc_mark_hook, elf_backend_gc_mark_hook): Don't define.
358         * elf32-mt.c (mt_elf_gc_mark_hook, mt_elf_gc_sweep_hook): Delete.
359         (elf_backend_gc_mark_hook, elf_backend_gc_mark_hook): Don't define.
360
361 2006-09-25 Pedro Alves <pedro_alves@portugalmail.pt>
362
363         * bfd-in.h (CONST_STRNCPY) : Delete.
364         (LITSTRCPY) : New.
365         (LITMEMCPY) : New.
366         * bfd-in2.h : Regenerate.
367         * elflink.c  (bfd_elf_gc_sections) : Use LITMEMCPY. Don't manually
368         calculate string lengths.
369         * nlmcode.h (nlm_swap_auxiliary_headers_in) : Use LITMEMCPY.
370
371 2006-09-26  H.J. Lu  <hongjiu.lu@intel.com>
372
373         PR ld/3223
374         PR ld/3267
375         * elf.c (assign_file_positions_for_non_load_sections): Don't
376         warn zero size allocated sections.
377
378 2006-09-27  Alan Modra  <amodra@bigpond.net.au>
379
380         * elf32-score.c (_bfd_score_elf_relocate_section): Move assignment
381         to "name" so that compiler realizes it is never uninitialized.
382         Use bfd_elf_sym_name.
383
384 2006-09-26  H.J. Lu  <hongjiu.lu@intel.com>
385
386         PR binutils/3262
387         * elf.c (rewrite_elf_program_header): Use bfd_zalloc instead of
388         bfd_alloc to allocate segment map.
389         (copy_elf_program_header): Likewise.
390
391 2006-09-26  Mark Shinwell  <shinwell@codesourcery.com>
392             Joseph Myers  <joseph@codesourcery.com>
393             Ian Lance Taylor  <ian@wasabisystems.com>
394             Ben Elliston  <bje@wasabisystems.com>
395
396         * archures.c: Add definition for bfd_mach_arm_iWMMXt2.
397         * cpu-arm.c (processors): Add bfd_mach_arm_iWMMXt2.
398         (arch_info_struct, bfd_arm_update_notes): Likewise.
399         (architectures): Likewise.
400         (bfd_arm_merge_machines): Check for iWMMXt2.
401         * bfd-in2.h: Rebuild.
402
403 2006-09-24  H.J. Lu  <hongjiu.lu@intel.com>
404
405         * configure: Regenerated.
406
407 2006-09-22  Alan Modra  <amodra@bigpond.net.au>
408
409         * elfcode.h (elf_swap_symbol_in): Return bfd_boolean.  Don't abort
410         on error.
411         * elf-bfd.h (elf_size_info <swap_symbol_in>): Adjust decl.
412         (bfd_elf32_swap_symbol_in, bfd_elf64_swap_symbol_in): Likewise.
413         * elf.c (bfd_elf_get_elf_syms): Test return of swap_symbol_in,
414         and report error.
415         * elf32-arm.c (elf32_arm_swap_symbol_in): Return bfd_boolean.
416
417 2006-09-20  Martin Schwidefsky  <schwidefsky@de.ibm.com>
418
419         * elf32-s390.c (elf_s390_relocate_section): Remove check for code
420         section in LD to LE linker relaxation for R_390_TLS_LDO32.
421         * elf64-s390.c (elf_s390_relocate_section): Likewise for
422         R_390_TLS_LDO64.
423
424 2006-09-20  Kai Tietz  <Kai.Tietz@onevision.com>
425
426         * configure.in: Added new target-vectors x86_64coff_vec,
427         x86_64pe_vec, and x86_64pei_vec.
428         * configure: Regenerate.
429         * config.bfd: Adjusted x86_64 target architecture detection.
430         * bfd.c: Add for new target "coff-x86-64"
431         (bfd_get_sign_extend): Add target vector idents for pe-x86-64. and pei-x86-64.
432         * coff-x86_64.c: Add new file for x86_64 (AMD64) coff support.
433         * libpei.h: Adjustments for COFF_WITH_pex64.
434         * coffcode.h: Add for new target machine, architecture, signature, and internal
435         signature handler.
436         * Makefile.am: Add new files to target-all and define make-rule for pex64igen.c
437         * Makefile.in: Regenerate.
438         * pe-x86_64.c: Add for new target "pe-x86-64".
439         * pei-x86_64.c: Add for new target "pei-x86-64".
440         * peicode.h: Adjusts for new targets.
441         (coff_swap_filehdr_out): Set for this target to
442         _bfd_pex64_only_swap_filehdr_out.
443         (SIZEOF_IDATA4): Define it as 8 byte size for this target.
444         (SIZEOF_IDATA5): Define it as 8 byte size for this target.
445         (jump_table jtab): Add for AMD64MAGIC.
446         (pe_ILF_build_a_bfd): Adjusts for new size of SIZEOF_IDATA4 and SIZE_IDATA5.
447         (pe_ILF_object_p): Add coff image-file signature to internal
448         signature translation.
449         * peXXigen.c: Adjust proper include of target coff-header and
450         introduced target specific code
451         (COFF_WITH_pex64): New macro for this target.
452         (pe_print_idata): New dumping method for import section of PE+ files.
453         * targets.c: Add new target vectors declarations for x86_64 coff targets.
454         * coffcode.h: Support code to support the x86_64 PE magic number.
455         * coff-x86_64.c: New file.
456
457 2006-09-17  Hans-Peter Nilsson  <hp@axis.com>
458
459         * elf.c (special_sections_s): Revert last STRING_COMMA_LEN change
460         for .stabstr entry, explain why.
461
462 2006-09-17  Anton Blanchard  <anton@samba.org>
463             Alan Modra  <amodra@bigpond.net.au>
464
465         * dwarf2.c (concat_filename): Apply DW_AT_comp_dir if dir table
466         entry isn't absolute.
467
468 2006-09-17  Mei Ligang  <ligang@sunnorth.com.cn>
469
470         * cpu-score.c: New file.
471         * elf32-score.c: New file.
472         * config.bfd: Add Score target.
473         * Makefile.am: Add Score files.
474         * Makefile.in: Regenerate.
475         * archures.c: Add Score architecture.
476         * reloc.c: Add Score relocs.
477         * targets.c: Add Score target vectors.
478         * bfd-in2.h: Regenerate.
479         * libbfd.h: Regenerate.
480         * configure.in: Add Score target.
481         * configure: Regenerate.
482
483 2006-09-16  Nick Clifton  <nickc@redhat.com>
484             Pedro Alves  <pedro_alves@portugalmail.pt>
485
486         * bfd-in.h (STRING_AND_COMMA): New macro.  Takes one constant
487         string as its argument and emits the string followed by a comma
488         and then the length of the string.
489         (CONST_STRNEQ): New macro.  Checks to see if a variable string
490         has a constant string as its initial characters.
491         (CONST_STRNCPY): New macro.  Copies a constant string to the start
492         of a variable string.
493         * bfd-in2.h: Regenerate.
494         * archive.c: Make use of the new macros.
495         * archive64.c: Likewise.
496         * bfd.c: Likewise.
497         * coff-ppc.c: Likewise.
498         * coff-stgo32.c: Likewise.
499         * coffcode.h: Likewise.
500         * cofflink.c: Likewise.
501         * cpu-i960.c: Likewise.
502         * dwarf2.c: Likewise.
503         * ecoff.c: Likewise.
504         * elf-m10300.c: Likewise.
505         * elf.c: Likewise.
506         * elf32-arm.c: Likewise.
507         * elf32-bfin.c: Likewise.
508         * elf32-cris.c: Likewise.
509         * elf32-hppa.c: Likewise.
510         * elf32-i370.c: Likewise.
511         * elf32-i386.c: Likewise.
512         * elf32-iq2000.c: Likewise.
513         * elf32-m32r.c: Likewise.
514         * elf32-m68hc11.c: Likewise.
515         * elf32-m68hc12.c: Likewise.
516         * elf32-m68k.c: Likewise.
517         * elf32-mcore.c: Likewise.
518         * elf32-ppc.c: Likewise.
519         * elf32-s390.c: Likewise.
520         * elf32-sh-symbian.c: Likewise.
521         * elf32-sh.c: Likewise.
522         * elf32-sh64.c: Likewise.
523         * elf32-v850.c: Likewise.
524         * elf32-vax.c: Likewise.
525         * elf32-xtensa.c: Likewise.
526         * elf64-alpha.c: Likewise.
527         * elf64-hppa.c: Likewise.
528         * elf64-mmix.c: Likewise.
529         * elf64-ppc.c: Likewise.
530         * elf64-s390.c: Likewise.
531         * elf64-sh64.c: Likewise.
532         * elf64-x86-64.c: Likewise.
533         * elflink.c: Likewise.
534         * elfxx-ia64.c: Likewise.
535         * elfxx-mips.c: Likewise.
536         * elfxx-sparc.c: Likewise.
537         * hpux-core.c: Likewise.
538         * i386linux.c: Likewise.
539         * ieee.c: Likewise.
540         * libpei.h: Likewise.
541         * linker.c: Likewise.
542         * m68klinux.c: Likewise.
543         * mmo.c: Likewise.
544         * nlmcode.h: Likewise.
545         * osf-core.c: Likewise.
546         * pef.c: Likewise.
547         * som.c: Likewise.
548         * sparclinux.c: Likewise.
549         * vms-hdr.c: Likewise.
550
551 2006-09-14  Alan Modra  <amodra@bigpond.net.au>
552
553         PR 3181
554         * elf.c (_bfd_elf_copy_private_header_data): Fix group members
555         that have had their SHT_GROUP section removed.
556
557 2006-09-12  H.J. Lu  <hongjiu.lu@intel.com>
558
559         PR ld/3197
560         * elflink.c (elf_link_output_extsym): Compute bucket only if
561         needed.
562
563 2006-09-10  H.J. Lu  <hongjiu.lu@intel.com>
564
565         PR binutils/3186
566         * elf.c (_bfd_elf_make_section_from_shdr): Correct length of
567         "gnu.linkonce.wi.".
568
569 2006-09-08  Vladimir Prus  <vladimir@codesourcery.com>
570
571         * elf32-arm.c (elf32_arm_swap_symbol_out): Remove
572         unconditional setting of low bit for Thumb symbol
573         mistakenly left behind after check for external
574         symbols was added.  Fix comment typo.
575
576 2006-09-07  H.J. Lu  <hongjiu.lu@intel.com>
577
578         * elf-bfd.h (elf_link_hash_entry): Add a dynamic field.
579         (bfd_elf_link_mark_dynamic_symbol): New.
580         (SYMBOLIC_BIND): New.
581
582         * elf32-i386.c (elf_i386_check_relocs): Replace info->symbolic
583         with SYMBOLIC_BIND (info, h).
584         (elf_i386_relocate_section): Likewise.
585         * elf64-x86-64.c (elf64_x86_64_check_relocs): Likewise.
586         (elf64_x86_64_relocate_section): Likewise.
587         * elfxx-ia64.c (elfNN_ia64_check_relocs): Likewise.
588
589         * elflink.c (bfd_elf_link_mark_dynamic_symbol): New.
590         (bfd_elf_record_link_assignment): Call
591         bfd_elf_link_mark_dynamic_symbol on new entry.
592         (_bfd_elf_merge_symbol): Likewise.
593         (_bfd_elf_export_symbol): Return if the symbol isn't exported.
594         (_bfd_elf_fix_symbol_flags): Replace info->symbolic with
595         SYMBOLIC_BIND (info, h).
596         (_bfd_elf_dynamic_symbol_p): Likewise.
597         (_bfd_elf_symbol_refs_local_p): Likewise.
598         (bfd_elf_size_dynamic_sections): Updated.
599
600 2006-09-05  Bibo Mao  <bibo.mao@intel.com>
601
602         PR binutils/3171
603         * coffcode.h (coff_write_object_contents): Set the optional
604         header magic number to PE32PMAGIC instead of ZMAGIC for ia64.
605
606 2006-09-04  Mark Shinwell  <shinwell@codesourcery.com>
607
608         * elf32-arm.c (elf32_arm_howto_table_1): Adjust entries for
609         R_ARM_THM_ALU_PREL_11_0 and R_ARM_THM_PC12 relocations.
610         (elf32_arm_final_link_relocate): Handle R_ARM_THM_ALU_PREL_11_0
611         and R_ARM_THM_PC12 relocations.
612
613 2006-08-24  Bob Wilson  <bob.wilson@acm.org>
614
615         * elf32-xtensa.c (xtensa_get_property_section_name): Delete.
616         (xtensa_get_property_section): New.
617         (xtensa_read_table_entries): Use xtensa_get_property_section.
618         (relax_property_section, xtensa_get_property_predef_flags): Handle
619         group name suffixes in property section names.
620         (match_section_group): New.
621
622 2006-08-23  Frediano Ziglio  <Frediano.Ziglio@vodafone.com>
623
624         * archive.c (hpux_uid_gid_encode): Fix thinko decrementing "cnt"
625         variable.
626
627 2006-08-22  Daniel Jacobowitz  <dan@codesourcery.com>
628
629         * elf32-arm.c (elf32_arm_copy_indirect_symbol): Only copy
630         plt_thumb_refcount from indirect symbols.
631
632 2006-08-22  Alan Modra  <amodra@bigpond.net.au>
633
634         * elf32-ppc.c (ppc_elf_relocate_section): Correct GOT and PLT HA
635         reloc handling.
636         * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
637
638 2006-08-21  Mark Shinwell  <shinwell@codesourcery.com>
639
640         * elf32-arm.c (elf32_arm_link_hash_table): Correct typo in
641         comment for target1_is_rel.
642
643 2006-08-21  Pedro Alves  <pedro_alves@portugalmail.pt>
644
645         * Makefile.am: Add rules to build pe-arm-wince.lo
646         and pei-arm-wince.lo objects.
647         * Makefile.in: Regenerate.
648         * pe-arm-wince.c: New file.
649         * pei-arm-wince.c: New file.
650         * pei-arm.c: Remove ARM_WINCE block.
651         * pe-arm.c: Remove ARM_WINCE block. Rename
652         bfd_arm_pe_allocate_interworking_sections,
653         bfd_arm_pe_get_bfd_for_interworking, and
654         bfd_arm_pe_process_before_allocation to
655         bfd_armpe_allocate_interworking_sections,
656         bfd_armpe_get_bfd_for_interworking, and
657         bfd_armpe_process_before_allocation. Move them before
658         including bfd.h.
659         * bfd.c: ARM wince bfd format names were renamed. Adjust.
660         * coff-arm.c [ARM_WINCE]: Adjust so Windows CE doesn't end up
661         with unexpected/conflicting relocs.
662         * targets.c: The arm-wince-pe target got its own new vector.
663         Adjust.
664         * config.bfd: Likewise.
665         * configure.in: Likewise.
666         * configure: Regenerate.
667
668 2006-08-18  Paul Brook  <paul@codesourcery.com>
669
670         * elf32-arm.c (elf32_arm_link_hash_entry): Add export_glue.
671         (elf32_arm_link_hash_newfunc): Initialize export_glue.
672         (record_arm_to_thumb_glue): Return stub symbol.
673         (elf32_arm_create_thumb_stub): New function.
674         (elf32_arm_to_thumb_stub): Use it.
675         (elf32_arm_to_thumb_export_stub): New function.
676         (elf32_arm_begin_write_processing): New function.
677         (allocate_dynrelocs): Allocate Arm stubs.
678         (elf_backend_begin_write_processing): Define.
679         (elf32_arm_symbian_begin_write_processing): Remove ATTRIBUTE_UNUSED.
680         Call elf32_arm_begin_write_processing.
681
682 2006-08-17  Alan Modra  <amodra@bigpond.net.au>
683
684         * elf64-ppc.c (create_linkage_sections): Align .glink to 8 bytes.
685         (ppc64_elf_build_stubs): Use new lazy linking stub.
686
687 2006-08-17  Alan Modra  <amodra@bigpond.net.au>
688
689         * elf64-ppc.c (ppc64_elf_size_stubs): Ignore non-code sections.
690
691 2006-08-16  H.J. Lu  <hongjiu.lu@intel.com>
692
693         PR ld/3015
694         * elf.c (get_program_header_size): Add a PT_GNU_RELRO segment
695         only if there is a PT_DYNAMIC segment.
696         (_bfd_elf_map_sections_to_segments): Likewise.
697         (assign_file_positions_for_load_sections): Set PT_GNU_RELRO
698         segment alignment to 1.
699
700 2006-08-15  Thiemo Seufer  <ths@mips.com>
701             Nigel Stephens  <nigel@mips.com>
702
703         * elf32-mips.c, elf64-mips.c, elfn32-mips.c
704         (elf_backend_merge_symbol_attribute): Define.
705         * elflink.c (elf_link_add_object_symbols): Merge only the ELF
706         visibility flags.
707         * elfxx-mips.c (_bfd_mips_elf_merge_symbol_attribute): New function.
708
709 2006-08-15  Thiemo Seufer  <ths@mips.com>
710             Nigel Stephens  <nigel@mips.com>
711             David Ung  <davidu@mips.com>
712
713         * config.bfd: Add configurations for mips*el-sde-elf* and
714         mips*-sde-elf*.
715
716 2006-08-14  DJ Delorie  <dj@redhat.com>
717
718         * elf-m10300.c (elf32_mn10300_link_hash_entry): Add value.
719         (elf32_mn10300_count_hash_table_entries): New.
720         (elf32_mn10300_list_hash_table_entries): New.
721         (sort_by_value): New.
722         (mn10300_elf_relax_section): Don't skip data sections; restrict
723         code-specific tests to code-specific areas so that potential
724         indirect calls can be detected.  Check for multiple local symbols
725         at the same address and merge their flags.
726         (elf32_mn10300_link_hash_newfunc): Initialize value.
727
728 2006-08-14  Thiemo Seufer  <ths@mips.com>
729
730         * elfxx-mips.c (_bfd_mips_elf_symbol_processing,
731         _bfd_mips_elf_add_symbol_hook): Don't try to place small common TLS
732         symbols in .scommon.
733
734 2006-08-11  Thiemo Seufer  <ths@mips.com>
735
736         * elfxx-mips.c (_bfd_mips_elf_finish_dynamic_sections): Set
737         sh_entsize only when sgot was already initialized.
738
739 2006-08-08  DJ Delorie  <dj@redhat.com>
740
741         * elf32-sh.c (sh_elf_relax_section): Allow for branches across
742         non-moving .align directives.  Preserve any DIR32 offset when
743         converting bsr's to jsr's.
744
745 2006-08-08  Alan Modra  <amodra@bigpond.net.au>
746
747         * elf64-ppc.c (ppc64_elf_build_stubs): Clear relbrlt reloc_count
748         after stubs have been built.
749
750 2006-08-07  Nick Clifton  <nickc@redhat.com>
751
752         * elf32-sh.c (vxworks_object_p): Only check for vxworks target
753         vectors if they are going to be created.
754
755 2006-08-07  Nick Clifton  <nickc@redhat.com>
756
757         * configure.in (bfd_elf32_shnbsd_vec): Fix typo.
758         * configure: Regenerate.
759
760 2006-08-07  Nick Clifton  <nickc@redhat.com>
761
762         * coff-arm.c (coff_arm_rtype_to_howto): Only check for ARM_SECREL
763         relocation types if the target is ARM_WINCE.
764
765 2006-08-05  Pedro Alves  <pedro_alves@portugalmail.pt>
766
767         * bfd.c (bfd_get_sign_extend_vma): Add cases for pe-arm-little
768         and pei-arm-little.
769         * coff-arm.c (coff_arm_rtype_to_howto) [COFF_WITH_PE]: Handle
770         ARM_SECREL.
771         (coff_arm_reloc_type_lookup): Map BFD_RELOC_32_SECREL to
772         ARM_SECREL.
773         * pe-arm.c [COFF_SECTION_ALIGNMENT_ENTRIES]: Define.
774         * pei-arm.c [TARGET_UNDERSCORE]: Define for ARM_WINCE like in
775         pe-arm.c.
776         [COFF_SECTION_ALIGNMENT_ENTRIES]: Define.
777
778 2006-08-04  Marcelo Tosatti  <marcelo@kvack.org>
779
780         * elflink.c (elf_gc_sweep): If info.print_gc_sections is true,
781         list removed sections to stderr.
782
783 2006-08-04  Richard Sandiford  <richard@codesourcery.com>
784             Kazu Hirata  <kazu@codesourcery.com>
785             Phil Edwards  <phil@codesourcery.com>
786             Nathan Sidwell  <nathan@codesourcery.com>
787
788         * config.bfd (sh-*-vxworks): Use bfd_elf32_shvxworks_vec and
789         bfd_elf32_shlvxworks_vec.
790         * configure.in (bfd_elf32_sh64_vec): Add elf-vxworks.lo.
791         (bfd_elf32_sh64l_vec, bfd_elf32_sh64lin_vec): Likewise.
792         (bfd_elf32_sh64blin_vec, bfd_elf32_sh64lnbsd_vec): Likewise.
793         (bfd_elf32_sh64nbsd_vec, bfd_elf32_sh_vec): Likewise.
794         (bfd_elf32_shblin_vec, bfd_elf32_shl_vec): Likewise.
795         (bfd_elf32_shl_symbian_vec, bfd_elf32_shlin_vec): Likewise.
796         (bfd_elf32_shlnbsd_vec, bfd_elf32_shnbsd_vec): Likewise.
797         (bfd_elf32_shlvxworks_vec, bfd_elf32_shvxworks_vec): New stanzas.
798         * configure: Regenerate.
799         * Makefile.am: Regenerate dependencies.
800         * Makefile.in: Regenerate.
801         * elf-vxworks.c (elf_vxworks_gott_symbol_p): New function.
802         (elf_vxworks_add_symbol_hook): Use it.
803         (elf_vxworks_link_output_symbol_hook): Likewise.  Use the hash
804         table entry to check for weak undefined symbols and to obtain
805         the original bfd.
806         (elf_vxworks_emit_relocs): Use target_index instead of this_idx.
807         * elf32-sh-relocs.h: New file, split from elf32-sh.c.
808         (R_SH_DIR32): Use SH_PARTIAL32 for the partial_inplace field,
809         SH_SRC_MASK32 for the src_mask field, and SH_ELF_RELOC for the
810         special_function field.
811         (R_SH_REL32): Use SH_PARTIAL32 and SH_SRC_MASK32 here too.
812         (R_SH_REL32, R_SH_TLS_GD_32, R_SH_TLS_LD_32): Likewise.
813         (R_SH_TLS_LDO_32, R_SH_TLS_IE_32, R_SH_TLS_LE_32): Likewise.
814         (R_SH_TLS_DTPMOD32, R_SH_TLS_DTPOFF32, R_SH_TLS_TPOFF32): Likewise.
815         (R_SH_GOT32, R_SH_PLT32, R_SH_COPY, R_SH_GLOB_DAT): Likewise.
816         (R_SH_JMP_SLOT, R_SH_RELATIVE, R_SH_GOTOFF, R_SH_GOTPC): Likewise.
817         (SH_PARTIAL32, SH_SRC_MASK32, SH_ELF_RELOC): Undefine at end of file.
818         * elf32-sh.c: Include elf32-vxworks.h.
819         (MINUS_ONE): Define.
820         (sh_elf_howto_table): Include elf32-sh-relocs.h with SH_PARTIAL32
821         set to TRUE, SH_SRC_MASK32 set to 0xffffffff, and SH_ELF_RELOC set
822         to sh_elf_reloc.
823         (sh_vxworks_howto_table): New variable.  Include elf32-sh-relocs.h
824         with SH_PARTIAL32 set to FALSE, SH_SRC_MASK32 set to 0, and
825         SH_ELF_RELOC set to bfd_elf_generic_reloc.
826         (vxworks_object_p, get_howto_table): New functions.
827         (sh_elf_reloc_type_lookup): Fix typo.  Use get_howto_table.
828         (sh_elf_info_to_howto): Use get_howto_table.
829         (sh_elf_relax_section): Honor the partial_inplace field of the
830         R_SH_DIR32 howto.
831         (sh_elf_relax_delete_bytes): Likewise.
832         (elf_sh_plt_info): New structure.
833         (PLT_ENTRY_SIZE): Replace both definitions with...
834         (ELF_PLT_ENTRY_SIZE): ...this new macro, with separate definitions for
835         INCLUDE_SHMEDIA and !INCLUDE_SHMEDIA.
836         (elf_sh_plt0_entry_be): Update sizes of both definitions accordingly.
837         (elf_sh_plt0_entry_le): Likewise.
838         (elf_sh_plt_entry_be, elf_sh_plt_entry_le): Likewise.
839         (elf_sh_pic_plt_entry_be, elf_sh_pic_plt_entry_le): Likewise.
840         (elf_sh_plts): New structure, with separate definitions for
841         INCLUDE_SHMEDIA and !INCLUDE_SHMEDIA.
842         (elf_sh_plt0_entry): Delete both definitions.
843         (elf_sh_plt_entry, elf_sh_pic_plt_entry): Likewise.
844         (elf_sh_sizeof_plt, elf_sh_plt_plt0_offset): Likewise.
845         (elf_sh_plt_temp_offset, elf_sh_plt_symbol_offset): Likewise.
846         (elf_sh_plt_reloc_offset): Likewise.
847         (movi_shori_putval): Delete in favor of...
848         (install_plt_field): ...this new function, with separate definitions
849         for INCLUDE_SHMEDIA and !INCLUDE_SHMEDIA.
850         (get_plt_info): New function, with separate definitions
851         for INCLUDE_SHMEDIA and !INCLUDE_SHMEDIA.
852         (elf_sh_plt0_linker_offset, elf_sh_plt0_gotid_offset): Delete.
853         (VXWORKS_PLT_HEADER_SIZE, VXWORKS_PLT_ENTRY_SIZE): New macros.
854         (vxworks_sh_plt0_entry_be, vxworks_sh_plt0_entry_le): New constants.
855         (vxworks_sh_plt_entry_be, vxworks_sh_plt_entry_le): Likewise.
856         (vxworks_sh_pic_plt_entry_be, vxworks_sh_pic_plt_entry_le): Likewise.
857         (get_plt_index, get_plt_offset): New functions.
858         (elf_sh_link_hash_table): Add srelplt2, plt_info and vxworks_p fields.
859         (sh_elf_link_hash_table_create): Initialize them.
860         (sh_elf_create_dynamic_sections): Call
861         elf_vxworks_create_dynamic_sections for VxWorks.
862         (allocate_dynrelocs): Use htab->plt_info to get the size of PLT
863         entries.  Allocate relocation entries in .rela.plt.unloaded if
864         generating a VxWorks executable.
865         (sh_elf_always_size_sections): New function.
866         (sh_elf_size_dynamic_sections): Extend .rela.plt handling to
867         .rela.plt.unloaded.
868         (sh_elf_relocate_section): Use get_howto_table.  Honor
869         partial_inplace when calculating the addend for dynamic
870         relocations.  Use get_plt_index.
871         (sh_elf_finish_dynamic_symbol): Use get_plt_index, install_plt_field
872         and htab->plt_info.  Fill in the bra .plt offset for VxWorks
873         executables.  Populate .rela.plt.unloaded.  Do not make
874         _GLOBAL_OFFSET_TABLE_ absolute on VxWorks.
875         (sh_elf_finish_dynamic_sections): Use install_plt_field and
876         htab->plt_info.  Handle cases where there is no special PLT header.
877         Populate the first relocation in .rela.plt.unloaded and fix up
878         the remaining entries.
879         (sh_elf_plt_sym_val): Use get_plt_info.
880         (elf_backend_always_size_sections): Define.
881         (TARGET_BIG_SYM, TARGET_BIG_NAME): Override for VxWorks.
882         (TARGET_LITTLE_SYM, TARGET_BIG_SYM): Likewise.
883         (elf32_bed, elf_backend_want_plt_sym): Likewise.
884         (elf_symbol_leading_char, elf_backend_want_got_underscore): Likewise.
885         (elf_backend_grok_prstatus, elf_backend_grok_psinfo): Likewise.
886         (elf_backend_add_symbol_hook): Likewise.
887         (elf_backend_link_output_symbol_hook): Likewise.
888         (elf_backend_emit_relocs): Likewise.
889         (elf_backend_final_write_processing): Likewise.
890         (ELF_MAXPAGESIZE, ELF_COMMONPAGESIZE): Likewise.
891         * targets.c (bfd_elf32_shlvxworks_vec): Declare.
892         (bfd_elf32_shvxworks_vec): Likewise.
893         (_bfd_target_vector): Include bfd_elf32_shlvxworks_vec and
894         bfd_elf32_shvxworks_vec.
895
896 2006-08-02  Mark Kettenis  <kettenis@gnu.org>
897
898         * configure.in (arm-*-openbsd*): Set COREFILE to netbsd-core.lo.
899         * configure: Regenerate.
900
901 2006-08-02  Petr Salinger  <Petr.Salinger@seznam.cz>
902
903         PR binutils/2983
904         * elf64-x86-64.c: Add FreeBSD support.
905         (elf64_x86_64_fbsd_post_process_headers): New function.
906         * targets.c (_bfd_target_vector): Add bfd_elf64_x86_64_freebsd_vec.
907         * config.bfd (x64_64-*-freebsd*): Add bfd_elf64_x86_64_freebsd_vec
908         to the targ_selvecs.
909         * configure.in: Add entry for bfd_elf64_x86_64_freebsd_vec.
910         * configure: Regenerate.
911
912 2006-07-26  Andreas Schwab  <schwab@suse.de>
913
914         * elfxx-ia64.c (elfNN_ia64_choose_gp): Use rawsize if set.
915
916 2006-07-26  Alan Modra  <amodra@bigpond.net.au>
917
918         * elf.c (elf_modify_segment_map): Delete empty PT_LOAD segments.
919         * elf32-xtensa.c (elf_xtensa_modify_segment_map): Delete.
920         (define elf_backend_modify_segment_map): Don't define.
921
922 2006-07-25  Thiemo Seufer  <ths@networkno.de>
923
924         * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Allow
925         linking of objects for compatible machine types.
926
927 2006-07-25  Thiemo Seufer  <ths@networkno.de>
928
929         * elfxx-mips.c (mips_elf_next_relocation): Tighten check to test
930         also for same symbol.
931
932 2006-07-25  Thiemo Seufer  <ths@mips.com>
933
934         * elfxx-mips.c (mips_elf_calculate_relocation): Remove magic constant.
935
936 2006-07-24  Michael Wetherell  <mike.wetherell@ntlworld.com>
937
938         * elf.c (bfd_section_from_shdr): Reject unrecognised OS-specific
939         sections only if the SHF_OS_NONCONFORMING flag is present.
940
941 2006-07-24  Nick Clifton  <nickc@redhat.com>
942
943         PR ld/2729
944         * peXXigen.c (_bfd_XXi_final_link_postscript): Check for the
945         existance of output sections before putting their entries into the
946         DataDictionary.
947
948 2006-07-20  Thiemo Seufer  <ths@mips.com>
949
950         * elf32-mips.c (mips16_jump_reloc): Remove function.
951         (elf_mips16_howto_table_rel): Use _bfd_mips_elf_generic_reloc
952         instead of mips16_jump_reloc.
953         * elf64_mips.c, wlfn32-mips.c (mips16_jump_reloc): Remove function.
954         (elf_mips16_howto_table_rel, elf_mips16_howto_table_rela): Use
955         _bfd_mips_elf_generic_reloc instead of mips16_jump_reloc.
956
957 2006-07-19  Alan Modra  <amodra@bigpond.net.au>
958
959         * bfd-in.h (enum notice_asneeded_action): Define.
960         * bfd-in2.h: Regenerate.
961         * elflink.c (elf_link_add_object_symbols): Call linker "notice"
962         function with NULL name for as-needed handling.
963
964 2006-07-18  Paul Brook  <paul@codesourcery.com>
965
966         * bfd-in2.h: Regenerate.
967         * libbfd.h: Regenerate.
968         * reloc.c: Add BFD_RELOC_ARM_T32_ADD_IMM.
969
970 2006-07-18  Nick Clifton  <nickc@redhat.com>
971
972         * elfxx-mips.c (_bfd_mips_elf_common_definition): New function.
973         Consider SHN_MIPS_ACOMMON and SHN_MIPS_SCOMMON as being common
974         sections.
975         * elfxx-mips.h  (_bfd_mips_elf_common_definition): Prototype.
976
977 2006-07-14  Jakub Jelinek  <jakub@redhat.com>
978
979         * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Fix cinfo.shift2 value.
980
981 2006-07-14  Mark Kettenis  <kettenis@gnu.org>
982
983         * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Move declarations
984         to the start of a block.
985
986 2006-07-13  Nick Clifton  <nickc@redhat.com>
987
988         * coff-sh.c (_bfd_sh_align_load_span): Catch sh_insn_info()
989         returning a NULL value.
990
991 2006-07-12  H.J. Lu  <hongjiu.lu@intel.com>
992
993         PR ld/2884
994         * elflink.c (_bfd_elf_merge_symbol): Copy the symbol info from
995         the old versioned dynamic definition to the new one with
996         non-default visibility.  Hide the symbol if it is hidden or
997         internal.
998
999 2006-07-12  Matthew R. Dempsky  <mrd@alkemio.org>
1000
1001         * cpu-m68k.c (bfd_m68k_compatible): Handle CPU32.
1002
1003 2006-07-10  Jakub Jelinek  <jakub@redhat.com>
1004
1005         * elf.c (_bfd_elf_print_private_bfd_data): Handle DT_GNU_HASH.
1006         (bfd_section_from_shdr, elf_fake_sections, assign_section_numbers):
1007         Handle SHT_GNU_HASH.
1008         (special_sections_g): Include .gnu.hash section.
1009         (bfd_elf_gnu_hash): New function.
1010         * elf-bfd.h (bfd_elf_gnu_hash, _bfd_elf_hash_symbol): New prototypes.
1011         (struct elf_backend_data): Add elf_hash_symbol method.
1012         * elflink.c (_bfd_elf_link_create_dynamic_sections): Create .hash
1013         only if info->emit_hash, create .gnu.hash section if
1014         info->emit_gnu_hash.
1015         (struct collect_gnu_hash_codes): New type.
1016         (elf_collect_gnu_hash_codes, elf_renumber_gnu_hash_syms,
1017         _bfd_elf_hash_symbol): New functions.
1018         (compute_bucket_count): Don't compute HASHCODES array, instead add
1019         that and NSYMS as arguments.  Use bed->s->sizeof_hash_entry
1020         instead of bed->s->arch_size / 8.  Fix .hash size estimation.
1021         When not optimizing, use the number of hashed symbols rather than
1022         dynsymcount.
1023         (bfd_elf_size_dynamic_sections): Only add DT_HASH if info->emit_hash,
1024         and ADD DT_GNU_HASH if info->emit_gnu_hash.
1025         (bfd_elf_size_dynsym_hash_dynstr): Size .hash only if info->emit_hash,
1026         adjust compute_bucket_count caller.  Create and populate .gnu.hash
1027         section if info->emit_gnu_hash.
1028         (elf_link_output_extsym): Only populate .hash section if
1029         finfo->hash_sec != NULL.
1030         (bfd_elf_final_link): Adjust assertion.  Handle DT_GNU_HASH.
1031         * elfxx-target.h (elf_backend_hash_symbol): Define if not yet defined.
1032         (elfNN_bed): Add elf_backend_hash_symbol.
1033         * elf64-x86-64.c (elf64_x86_64_hash_symbol): New function.
1034         (elf_backend_hash_symbol): Define.
1035         * elf32-i386.c (elf_i386_hash_symbol): New function.
1036         (elf_backend_hash_symbol): Define.
1037
1038 2006-07-05  Nick Clifton  <nickc@redhat.com>
1039
1040         PR ld/2659
1041         * cofflink.c (_bfd_coff_link_input_bfd): Fix selection of aux
1042         entry when multiple definitions of a symbol are encountered.
1043
1044 2006-06-30  H.J. Lu  <hongjiu.lu@intel.com>
1045
1046         * elf32-i386.c (elf_i386_relocate_section): Use xchg %ax,%ax
1047         instead of 2 nops.
1048         * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
1049         (elf64_x86_64_plt0_entry): Use nopl 0(%rax) instead of 4 nops.
1050
1051 2006-06-29  Jakub Jelinek  <jakub@redhat.com>
1052
1053         PR ld/2513
1054         * elf32-i386.c (GOT_TLS_MASK, GOT_TLS_IE_IE, GOT_TLS_IE_GD,
1055         GOT_TLS_IE_MASK, elf_i386_check_relocs, allocate_dynrelocs): Revert
1056         2006-04-08 changes.
1057         (elf_i386_relocate_section): Likewise.  For GD->IE transition
1058         change subl into addl whenever tls_type is GOT_TLS_IE_POS.
1059
1060 2006-06-23  Alan Modra  <amodra@bigpond.net.au>
1061
1062         PR ld/2754
1063         * elf.c (bfd_elf_mkobject): Don't alloc if already done.  Set
1064         program_header_size to -1.
1065         (_bfd_elf_map_sections_to_segments): Adjust program_header_size check.
1066         (assign_file_positions_for_load_sections ): Likewise.
1067         (_bfd_elf_sizeof_headers): Use saved program_header_size if
1068         available.
1069         * elf32-arm.c (elf32_arm_mkobject): Call bfd_elf_mkobject, don't
1070         alloc if already done.
1071         * elf32-i386.c (elf_i386_mkobject): Likewise.
1072         * elf32-ppc.c (ppc_elf_mkobject): Likewise.
1073         * elf32-s390.c (elf_s390_mkobject): Likewise.
1074         * elf32-sh.c (sh_elf_mkobject): Likewise.
1075         * elf64-alpha.c (elf64_alpha_mkobject): Likewise.
1076         * elf64-ppc.c (ppc64_elf_mkobject): Likewise.
1077         * elf64-s390.c (elf_s390_mkobject): Likewise.
1078         * elf64-x86-64.c (elf64_x86_64_mkobject): Likewise.
1079         * elfxx-sparc.c (_bfd_sparc_elf_mkobject): Likewise.
1080
1081 2006-06-20  Jakub Jelinek  <jakub@redhat.com>
1082
1083         * elflink.c (elf_link_add_object_symbols): Don't create .tcommon
1084         section for relocatable link.
1085
1086 2006-06-21  Alan Modra  <amodra@bigpond.net.au>
1087
1088         * elf-bfd.h (struct elf_backend_data): Add
1089         elf_backend_modify_program_headers.
1090         * elfxx-target.h (elf_backend_modify_program_headers): Define.
1091         (elfNN_bed): Init new field.
1092         * elf.c (elf_modify_segment_map): Remove comment.
1093         (assign_file_positions_for_load_sections): Only call
1094         elf_modify_segment_map for objcopy/strip.
1095         (assign_file_positions_except_relocs): Call
1096         elf_backend_modify_program_headers.
1097         * elf32-frv.c (elf32_frvfdpic_always_size_sections): Don't make
1098         .stack section.
1099         (elf32_frvfdpic_modify_segment_map): Delete.
1100         (elf32_frvfdpic_modify_program_headers): New.
1101         (elf_backend_modify_segment_map): Don't define.
1102         (elf_backend_modify_program_headers): Define.
1103         * elf32-bfin.c (elf32_bfinfdpic_always_size_sections): Don't make
1104         .stack section.
1105         (elf32_bfinfdpic_modify_segment_map): Delete.
1106         (elf32_bfinfdpic_modify_program_headers): New.
1107         (elf_backend_modify_segment_map): Don't define.
1108         (elf_backend_modify_program_headers): Define.
1109         * elfxx-ia64.c (elfNN_ia64_modify_program_headers): New function.
1110         Split out from..
1111         (elfNN_ia64_modify_segment_map): ..here.
1112         (elf_backend_modify_program_headers): Define.
1113
1114 2006-06-20  Jakub Jelinek  <jakub@redhat.com>
1115
1116         * bfd.c (bfd_record_phdr): Clear p_align and p_align_valid fields.
1117         * elf.c (_bfd_elf_link_hash_table_init): Clear hplt field.
1118
1119 2006-06-20  Alan Modra  <amodra@bigpond.net.au>
1120
1121         * elf-bfd.h: Formatting.
1122         (_bfd_elf_map_sections_to_segments): Declare.
1123         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame_hdr): Don't
1124         clear program_header_size.
1125         * elf.c (get_program_header_size): Move.  Don't use or set saved
1126         program_header_size here.
1127         (elf_modify_segment_map): New function.  Split out from..
1128         (assign_file_positions_for_load_sections): ..here.  Assert
1129         header size is correct.  Remove dead code.
1130         (_bfd_elf_map_sections_to_segments): Rename from
1131         map_sections_to_segments.  Make global.  Use get_program_header_size
1132         when we need estimate of header size.  Call elf_modify_segment_map.
1133         Set program_header_size.
1134         (print_segment_map): Delete.
1135         (_bfd_elf_sizeof_headers): If segment_map available, get the
1136         actual size.
1137         * elf32-arm.c (elf32_arm_symbian_modify_segment_map): Make safe
1138         for calling more than once.
1139         * elf32-bfin.c (elf32_bfinfdpic_modify_segment_map): Likewise.
1140         * elf32-frv.c (elf32_frvfdpic_modify_segment_map): Likewise.
1141         * elfxx-mips.c (_bfd_mips_elf_modify_segment_map): Likewise.
1142         * elf32-i370.c (elf_backend_add_symbol_hook): Delete.
1143         (elf_backend_additional_program_headers): Delete.
1144         (elf_backend_modify_segment_map): Delete.
1145         * elf64-hppa.c (elf64_hppa_modify_segment_map): Convert to ISO C.
1146         * elfxx-ia64.c (elfNN_ia64_modify_segment_map): Likewise.
1147         * doc/bfdint.texi: Delete SIZEOF_HEADERS difficulties.
1148
1149 2006-06-19  Vladimir Prus  <vladimir@codesourcery.com>
1150
1151         * elf32-arm.c (elf32_arm_swap_symbol_out): Don't set low
1152         bit for undefined symbols.
1153
1154 2006-06-19  Alan Modra  <amodra@bigpond.net.au>
1155
1156         * elf-bfd.h (struct elf_backend_data): Add bfd_link_info pointer
1157         parameter.
1158         (_bfd_elf_sizeof_headers): Replace bfd_boolean param with
1159         bfd_link_info pointer.
1160         * targets.c (struct bfd_target <_bfd_sizeof_headers>): Likewise.
1161         * bfd.c (bfd_sizeof_headers): Tweak param name.
1162         * aout-adobe.c (aout_adobe_sizeof_headers): Adjust.
1163         * aoutx.h (NAME (aout, sizeof_headers)): Adjust.
1164         * binary.c (binary_sizeof_headers): Adjust.
1165         * bout.c (b_out_sizeof_headers): Adjust.
1166         * coff-rs6000.c (_bfd_xcoff_sizeof_headers): Adjust.
1167         * coff64-rs6000.c (xcoff64_sizeof_headers): Adjust.
1168         * coffgen.c (coff_sizeof_headers): Adjust.
1169         * ecoff.c (_bfd_ecoff_sizeof_headers): Adjust.
1170         (ecoff_compute_section_file_positions): Adjust.
1171         (_bfd_ecoff_write_object_contents): Adjust.
1172         * elf.c (get_program_header_size, _bfd_elf_sizeof_headers): Adjust.
1173         * elf32-arm.c (elf32_arm_additional_program_headers): Adjust.
1174         * elf32-i370.c (elf_backend_additional_program_headers): Adjust.
1175         * elf32-ppc.c (ppc_elf_additional_program_headers): Adjust.
1176         * elf64-hppa.c (elf64_hppa_additional_program_headers): Adjust.
1177         * elf64-x86-64.c (elf64_x86_64_additional_program_headers): Adjust.
1178         * elfxx-ia64.c (elfNN_ia64_additional_program_headers): Adjust.
1179         * elfxx-mips.c (_bfd_mips_elf_additional_program_headers): Adjust.
1180         * elfxx-mips.h (_bfd_mips_elf_additional_program_headers): Adjust.
1181         * i386msdos.c: Convert to ISO C.
1182         (msdos_sizeof_headers): Adjust.
1183         * i386os9k.c: Convert to ISO C.
1184         (os9k_sizeof_headers): Adjust.
1185         * ieee.c (ieee_sizeof_headers): Adjust.
1186         * ihex.c (ihex_sizeof_headers): Adjust.
1187         * libaout.h (NAME (aout, sizeof_headers)): Adjust.
1188         * libbfd-in.h (_bfd_nolink_sizeof_headers): Adjust.
1189         * libcoff-in.h (coff_sizeof_headers): Adjust.
1190         * libecoff.h (_bfd_ecoff_sizeof_headers): Adjust.
1191         * mach-o.c (bfd_mach_o_sizeof_headers): Adjust.
1192         * mmo.c (mmo_sizeof_headers): Adjust.
1193         * oasys.c (oasys_sizeof_headers): Adjust.
1194         * pdp11.c (NAME (aout, sizeof_headers)): Adjust.
1195         * pef.c (bfd_pef_sizeof_headers): Adjust.
1196         * ppcboot.c (ppcboot_sizeof_headers): Adjust.
1197         * som.c (som_sizeof_headers): Adjust.
1198         * srec.c (srec_sizeof_headers): Adjust.
1199         * tekhex.c (tekhex_sizeof_headers): Adjust.
1200         * versados.c (versados_sizeof_headers): Adjust.
1201         * vms.c (vms_sizeof_headers): Adjust.
1202         * xcoff-target.h (_bfd_xcoff_sizeof_headers): Adjust.
1203         * xsym.c (bfd_sym_sizeof_headers): Adjust.
1204         * xsym.h (bfd_sym_sizeof_headers): Adjust.
1205         * bfd-in2.h: Regenerate.
1206         * libbfd.h: Regenerate.
1207         * libcoff.h: Regenerate.
1208
1209 2006-06-15  Mark Shinwell  <shinwell@codesourcery.com>
1210
1211         * bfd-in2.h: Regenerate.
1212         * elf32-arm.c (R_ARM_ALU_PC_G0_NC, R_ARM_ALU_PC_G0,
1213         R_ARM_ALU_PC_G1_NC, R_ARM_ALU_PC_G1, R_ARM_ALU_PC_G2,
1214         R_ARM_LDR_PC_G1, R_ARM_LDR_PC_G2, R_ARM_LDRS_PC_G0,
1215         R_ARM_LDRS_PC_G1, R_ARM_LDRS_PC_G2, R_ARM_LDC_PC_G0,
1216         R_ARM_LDC_PC_G1, R_ARM_LDC_PC_G2, R_ARM_ALU_SB_G0_NC,
1217         R_ARM_ALU_SB_G0, R_ARM_ALU_SB_G1_NC, R_ARM_ALU_SB_G1,
1218         R_ARM_ALU_SB_G2, R_ARM_LDR_SB_G0, R_ARM_LDR_SB_G1,
1219         R_ARM_LDR_SB_G2, R_ARM_LDRS_SB_G0, R_ARM_LDRS_SB_G1,
1220         R_ARM_LDRS_SB_G2, R_ARM_LDC_SB_G0, R_ARM_LDC_SB_G1,
1221         R_ARM_LDC_SB_G2): New relocation types.
1222         (R_ARM_PC13): Rename to AAELF name R_ARM_LDR_PC_G0 and
1223         adjust HOWTO entry to be consistent with R_ARM_LDR_PC_G1
1224         and friends.
1225         (elf32_arm_howto_table_3): Delete; contents merged into
1226         elf32_arm_howto_table_2.
1227         (elf32_arm_howto_from_type): Adjust correspondingly.
1228         (elf32_arm_reloc_map): Extend with the above relocations.
1229         (calculate_group_reloc_mask): New function.
1230         (identify_add_or_sub): New function.
1231         (elf32_arm_final_link_relocate): Support for the above
1232         relocations.
1233         * reloc.c: Add enumeration entries for BFD_RELOC_ARM_...
1234         codes to correspond to the above relocations.
1235
1236 2006-06-14  Richard Sandiford  <richard@codesourcery.com>
1237
1238         * elf32-m68k.c (elf_m68k_plt_info): New structure.
1239         (elf_m68k_plt0_entry): Add R_68K_PC32-style in-place addends.
1240         (elf_m68k_plt_entry): Likewise.
1241         (elf_m68k_plt_info): New table.
1242         (CFV4E_PLT_ENTRY_SIZE): Rename to...
1243         (ISAB_PLT_ENTRY_SIZE): ...this.
1244         (CFV4E_FLAG): Delete.
1245         (elf_cfv4e_plt0_entry): Rename to...
1246         (elf_isab_plt0_entry): ...this.  Adjust comments.  Use (-6,%pc,%d0)
1247         for the second instruction too.
1248         (elf_cfv4e_plt_entry): Rename to...
1249         (elf_isab_plt_entry): ...this.  Adjust comments and use (-6,%pc,%d0).
1250         (elf_isab_plt_info): New table.
1251         (CPU32_FLAG): Delete.
1252         (PLT_CPU32_ENTRY_SIZE): Rename to...
1253         (CPU32_PLT_ENTRY_SIZE): ...this.
1254         (elf_cpu32_plt0_entry): Update bounds accordingly.  Add R_68K_PC32-
1255         style in-place addends.
1256         (elf_cpu32_plt_entry): Likewise.
1257         (elf_cpu32_plt_info): New table.
1258         (elf_m68k_link_hash_table): Add a plt_info field.
1259         (elf_m68k_link_hash_table_create): Initialize it.
1260         (elf_m68k_get_plt_info): New function.
1261         (elf_m68k_always_size_sections): Likewise.
1262         (elf_m68k_adjust_dynamic_symbol): Use the plt_info hash table field.
1263         (elf_m68k_install_pc32): New function.
1264         (elf_m68k_finish_dynamic_symbol): Factor code using plt_info and
1265         elf_m68k_install_pc32.
1266         (elf_m68k_finish_dynamic_sections): Likewise.
1267         (elf_m68k_plt_sym_val): Use elf_m68k_get_plt_info.
1268         (elf_backend_always_size_sections): Define.
1269
1270 2006-06-14  Alan Modra  <amodra@bigpond.net.au>
1271
1272         * elflink.c (elf_link_add_object_symbols): Save and restore
1273         struct bfd_hash_table table, size and count fields for
1274         as-needed libs.
1275
1276 2006-06-12  Thiemo Seufer  <ths@mips.com>
1277
1278         * elf32-mips.c: Expand comment about ABI-mandated pagesize values.
1279         (ELF_MAXPAGESIZE, ELF_COMMONPAGESIZE): define in a more obvious way.
1280         * elf64-mips.c, elfn32-mips.c (ELF_MAXPAGESIZE): Fix value for IRIX6.
1281         Delete old comments.
1282         (ELF_COMMONPAGESIZE): Define in a more obvious way.
1283
1284 2006-06-12  Nick Clifton  <nickc@redhat.com>
1285
1286         PR binutils/2735
1287         * elflink.c (elf_link_add_object_symbols): Fix the warning message
1288         about mismatched alignments to allow for the case where the common
1289         alignment has been deduced from the section alignment.
1290         * bfd.c (_bfd_default_error_handler): Update comment to explain
1291         why bfd and asection varargs are out of order.  Explicitly catch
1292         and abort on NULL bfd and asection arguments.
1293
1294 2006-06-11  Richard Sandiford  <richard@codesourcery.com>
1295             Thiemo Seufer  <ths@mips.com>
1296
1297         * elfxx-mips.c (mips_elf_link_hash_table): Add function_stub_size.
1298         (STUB_ORI): New macro.
1299         (STUB_LI16U): Fix formatting.
1300         (MIPS_FUNCTION_STUB_SIZE): Delete.
1301         (MIPS_FUNCTION_STUB_MAX_SIZE): Likewise.
1302         (MIPS_FUNCTION_STUB_NORMAL_SIZE): New macro.
1303         (MIPS_FUNCTION_STUB_BIG_SIZE): Likewise.
1304         (_bfd_mips_elf_adjust_dynamic_symbol): Use htab->function_stub_size
1305         instead of MIPS_FUNCTION_STUB_SIZE.
1306         (count_section_dynsyms): New function, split out from
1307         _bfd_mips_elf_final_link.
1308         (_bfd_mips_elf_always_size_sections): Get a worst-case estimate
1309         of the number of dynamic symbols needed and use it to set up
1310         function_stub_size.  Use function_stub_size rather than
1311         MIPS_FUNCTION_STUB_SIZE to determine the size of the stub section.
1312         Use 16-byte stubs for 0x10000 dynamic symbols.
1313         (_bfd_mips_elf_size_dynamic_sections): Use htab->function_stub_size
1314         instead of MIPS_FUNCTION_STUB_SIZE.  Fix formatting.
1315         (_bfd_mips_elf_finish_dynamic_symbol): Likewise.  Change the
1316         size of the stub buffer from MIPS_FUNCTION_STUB_MAX_SIZE to
1317         MIPS_FUNCTION_STUB_BIG_SIZE.  Tweak the check for unhandled dynindxes.
1318         Use MIPS_FUNCTION_STUB_BIG_SIZE rather than a hard-coded 20.
1319         Use STUB_ORI rather than STUB_LI16U for big stubs.
1320         (_bfd_mips_elf_link_hash_table_create): Initialize function_stub_size.
1321         (_bfd_mips_elf_final_link): Use count_section_dynsyms.
1322
1323 2006-06-09  David Ung  <davidu@mips.com>
1324
1325         * bfd/elfxx-mips.c (mips_elf_calculate_relocation): Fix mode for stub
1326         calling relocations.
1327
1328 2006-06-08  David Daney  <ddaney@avtrex.com>
1329
1330         * elfxx-mips.c (STUB_LI16): Removed.
1331         (STUB_LUI): New macro.
1332         (STUB_LI16U): Ditto.
1333         (STUB_LI16S): Ditto.
1334         (MIPS_FUNCTION_STUB_SIZE): Rewrote to take info parameter.
1335         (_bfd_mips_elf_adjust_dynamic_symbol): Pass info parameter to
1336         MIPS_FUNCTION_STUB_SIZE.
1337         (_bfd_mips_elf_always_size_sections): Ditto.
1338         (_bfd_mips_elf_size_dynamic_sections): Ditto.
1339         (_bfd_mips_elf_finish_dynamic_sections): Ditto.
1340         (_bfd_mips_elf_finish_dynamic_symbol): Rewrote stub generation
1341         to allow larger symbol table indexes.
1342
1343 2006-06-07  Joseph S. Myers  <joseph@codesourcery.com>
1344
1345         * po/Make-in (pdf, ps): New dummy targets.
1346
1347 2006-06-06  Alan Modra  <amodra@bigpond.net.au>
1348
1349         * hash.c (bfd_hash_lookup): Correct stray line.
1350
1351         * elf.c (_bfd_elf_init_private_section_data): Comment typo.
1352         (elfcore_grok_nto_status): Use long instead of pid_t.
1353         (elfcore_grok_nto_regs, elfcore_grok_nto_note): Likewise.
1354
1355 2006-06-05  Daniel Jacobowitz  <dan@codesourcery.com>
1356
1357         * po/Make-in (top_builddir): Define.
1358
1359 2006-06-05  Alan Modra  <amodra@bigpond.net.au>
1360
1361         * Makefile.am: Run "make dep-am".
1362         * Makefile.in: Regenerate.
1363         * config.in: Regenerate.
1364
1365 2006-06-02  Alan Modra  <amodra@bigpond.net.au>
1366             H.J. Lu  <hongjiu.lu@intel.com>
1367
1368         PR ld/2723
1369         * elflink.c (bfd_elf_final_link): Don't output section symbols
1370         for special ELF sections.
1371
1372 2006-06-01  Alan Modra  <amodra@bigpond.net.au>
1373
1374         * stabs.c (_bfd_link_section_stabs): Use bfd_make_section*_with_flags
1375         instead of bfd_make_section*.
1376         * aix386-core.c: Likewise.
1377         * aix5ppc-core.c: Likewise.
1378         * aout-adobe.c: Likewise.
1379         * aoutf1.h: Likewise.
1380         * binary.c: Likewise.
1381         * cisco-core.c: Likewise.
1382         * coff-arm.c: Likewise.
1383         * coff-h8300.c: Likewise.
1384         * elf.c: Likewise.
1385         * elf32-bfin.c: Likewise.
1386         * elf32-m32c.c: Likewise.
1387         * hppabsd-core.c: Likewise.
1388         * hpux-core.c: Likewise.
1389         * i386linux.c: Likewise.
1390         * ieee.c: Likewise.
1391         * ihex.c: Likewise.
1392         * irix-core.c: Likewise.
1393         * lynx-core.c: Likewise.
1394         * m68klinux.c: Likewise.
1395         * mach-o.c: Likewise.
1396         * netbsd-core.c: Likewise.
1397         * nlmcode.h: Likewise.
1398         * opncls.c: Likewise.
1399         * osf-core.c: Likewise.
1400         * peXXigen.c: Likewise.
1401         * ppcboot.c: Likewise.
1402         * ptrace-core.c: Likewise.
1403         * rs6000-core.c: Likewise.
1404         * sco5-core.c: Likewise.
1405         * sparclinux.c: Likewise.
1406         * srec.c: Likewise.
1407         * sunos.c: Likewise.
1408         * trad-core.c: Likewise.
1409         * xcofflink.c: Likewise.
1410         * xsym.c: Likewise.
1411
1412 2006-05-31  Daniel Jacobowitz  <dan@codesourcery.com>
1413
1414         * Makefile.am (INCLUDES): Use @INCINTL@.
1415         * acinclude.m4: Include new gettext macros.
1416         * configure.in: Use ZW_GNU_GETTEXT_SISTER_DIR and AM_PO_SUBDIRS.
1417         Manually substitute POFILES and GMOFILES.
1418         * Makefile.in, aclocal.m4, configure, doc/Makefile.in: Regenerated.
1419
1420 2006-05-30  H.J. Lu  <hongjiu.lu@intel.com>
1421
1422         * bfd.c (bfd_emul_get_maxpagesize): New.
1423         (bfd_elf_set_pagesize): Likewise.
1424         (bfd_emul_set_maxpagesize): Likewise.
1425         (bfd_emul_get_commonpagesize): Likewise.
1426         (bfd_emul_set_commonpagesize): Likewise.
1427         * bfd-in2.h: Regenerated.
1428
1429         * elf-bfd.h (elf_backend_data): Add commonpagesize.
1430         (xvec_get_elf_backend_data): New.
1431         (get_elf_backend_data): Use xvec_get_elf_backend_data.
1432
1433         * elf32-arm.c (elf32_arm_vxworks_bed): Remove const.
1434         * elfxx-target.h (elfNN_bed): Likewise.
1435
1436         * elf32-arm.c (ELF_COMMONPAGESIZE): Defined.
1437         * elf32-mips.c (ELF_COMMONPAGESIZE): Likewise.
1438         * elf32-ppc.c (ELF_COMMONPAGESIZE): Likewise.
1439         * elf32-sh.c (ELF_COMMONPAGESIZE): Likewise.
1440         * elf32-sh64.c (ELF_COMMONPAGESIZE): Likewise.
1441         * elf32-sparc.c (ELF_COMMONPAGESIZE): Likewise.
1442         * elf64-alpha.c (ELF_COMMONPAGESIZE): Likewise.
1443         * elf64-ppc.c (ELF_COMMONPAGESIZE): Likewise.
1444         * elf64-sparc.c (ELF_COMMONPAGESIZE): Likewise.
1445         * elf64-x86-64.c (ELF_COMMONPAGESIZE): Likewise.
1446         * elfn32-mips.c (ELF_COMMONPAGESIZE): Likewise.
1447         * elfxx-ia64.c (ELF_COMMONPAGESIZE): Likewise.
1448
1449         * elfxx-target.h (ELF_COMMONPAGESIZE): Define if not defined.
1450         (elfNN_bed): Initialize commonpagesize with ELF_COMMONPAGESIZE.
1451
1452         * targets.c (bfd_find_target): Support NULL abfd.
1453
1454 2006-05-30  Nick Clifton  <nickc@redhat.com>
1455
1456         * po/es.po: Updated Spanish translation.
1457
1458 2006-05-27  Alan Modra  <amodra@bigpond.net.au>
1459             H.J. Lu  <hongjiu.lu@intel.com>
1460
1461         * elf.c (assign_file_positions_for_load_sections): Retrieve
1462         maxpagesize from m->p_align if it is valid.  Set p_vaddr,
1463         p_paddr and p_align earlier.  Revert 2006-05-19 change to p_align.
1464         (copy_elf_program_header): Copy p_align.  Set p_align_valid.
1465
1466 2006-05-26  H.J. Lu  <hongjiu.lu@intel.com>
1467
1468         * elf64-x86-64.c (ELF_MINPAGESIZE): Changed to 0x1000.
1469
1470 2006-05-25  H.J. Lu  <hongjiu.lu@intel.com>
1471
1472         * elf64-x86-64.c (ELF_MINPAGESIZE): Set to 0x100000.
1473
1474 2006-05-25  H.J. Lu  <hongjiu.lu@intel.com>
1475
1476         * elf64-x86-64.c (ELF_MAXPAGESIZE): Updated to 0x200000.
1477
1478 2006-05-26  Alan Modra  <amodra@bigpond.net.au>
1479
1480         * elf.c (sym_is_global): Return a bfd_boolean.
1481         (ignore_section_sym): New function.
1482         (elf_map_symbols): Use ignore_section_sym to discard some syms.
1483         (_bfd_elf_symbol_from_bfd_symbol): Ensure section belongs to
1484         bfd before using elf_section_syms.
1485
1486 2006-05-25  H.J. Lu  <hongjiu.lu@intel.com>
1487
1488         * config.bfd: (sh-*-linux*): Treat as 64bit target.
1489         (sh*l*-*-netbsdelf*): Likewise.
1490         (sh-*-netbsdelf*): Likewise.
1491         (shl*-*-elf*): Likewise.
1492         (sh[1234]l*-*-elf*): Likewise.
1493         (sh3el*-*-elf*): Likewise.
1494         (shl*-*-kaos*): Likewise.
1495         (sh-*-elf*): Likewise.
1496         (sh[1234]*-elf*): Likewise.
1497         (sh-*-rtems*): Likewise.
1498         (sh-*-kaos*): Likewise.
1499
1500 2006-05-24  H.J. Lu  <hongjiu.lu@intel.com>
1501
1502         PR ld/1485
1503         * config.bfd: Set want64 to true if 64bit bfd is used.
1504         (sh-*-linux*): Use targ64_selvecs for 64bit targets.
1505         (sh*l*-*-netbsdelf*): Likewise.
1506         (sh-*-netbsdelf*): Likewise.
1507         (shl*-*-elf*): Likewise.
1508         (sh[1234]l*-*-elf*): Likewise.
1509         (sh3el*-*-elf*): Likewise.
1510         (shl*-*-kaos*): Likewise.
1511         (sh-*-elf*): Likewise.
1512         (sh[1234]*-elf*): Likewise.
1513         (sh-*-rtems*): Likewise.
1514         (sh-*-kaos*): Likewise.
1515
1516 2006-05-24  Paul Brook  <paul@codesourcery.com>
1517
1518         * elf-bfd.h (elf_backend_data): Add elf_backend_output_arch_local_syms
1519         * elf32-arm.c (output_arch_syminfo): Define.
1520         (elf32_arm_ouput_plt_map_sym, elf32_arm_output_plt_map,
1521         elf32_arm_output_arch_local_syms): New functions.
1522         (elf_backend_output_arch_local_syms): Define.
1523         * elflink.c (bfd_elf_final_link): Call
1524         elf_backend_output_arch_local_syms.
1525         * elfxx-target.h (elf_backend_output_arch_local_syms): Provide default
1526         definition.
1527         (elfNN_bed): Add elf_backend_output_arch_local_syms.
1528
1529 2006-05-24  Paul Brook  <paul@codesourcery.com>
1530
1531         * elf32-arm.c (put_arm_insn, put_thumb_insn): New functions.
1532         (elf32_thumb_to_arm_stub, elf32_arm_to_thumb_stub,
1533         elf32_arm_finish_dynamic_symbol): Use them.
1534
1535 2006-05-24  Carlos O'Donell  <carlos@systemhalted.org>
1536             Randolph Chung  <tausq@debian.org>
1537
1538         * elf-hppa.h (reloc_hppa_howto_table): Check bitfield for
1539         TPREL21L/TPREL14R relocations. Handle LTOFF_TP14R relocations.
1540         Add handling for TLS relocations.
1541         (elf_hpp_reloc_final_type): Handle TLS relocs.
1542         * elf32-hppa.c: Add authors for cleanup and TLS support.
1543         (hppa_elf_local_got_tls_type, hh_name, eh_name): Define.
1544         (elf32_hppa_link_hash_entry): Add tls_type.
1545         (elf32_hppa_link_hash_table): Add tld_ldm_got.
1546         (hppa_link_has_newfunc): Set tls_type.
1547         (elf32_hppa_link_hash_table_create): Set tls_ldm_got refcount.
1548         (hppa_stub_name): Use hh_name macro.
1549         (elf32_hppa_copy_indirect_symbol): Copy TLS information.
1550         (elf32_hppa_check_relocs): Call elf32_hppa_optimized_tls_reloc.
1551         Handle TLS relocs.
1552         (elf32_hppa_gc_sweep_hook): Likewise.
1553         (allocate_dynrelocs): Handle TLS relocs.
1554         (elf32_hppa_size_dynamic_sections): Count space required by TLS
1555         relocs. Use hh_name macro.
1556         (dtpoff_base): New function.
1557         (tpoff): Likewise.
1558         (elf32_hppa_optimized_tls_reloc): Likewise.
1559         (final_link_relocate): Handle TLS relocs.
1560         (elf32_hppa_relocate_section): Handle TLS relocs. Use eh_name
1561         and hh_name macros.
1562         (elf32_hppa_finish_dynamic_symbol): Setup TLS got entries. Use
1563         hh_name and eh_name macros.
1564         (elf32_hppa_reloc_type_clas): Handle TLS relocs.
1565
1566 2006-05-24  Bjoern Haase  <bjoern.m.haase@web.de>
1567
1568         * archures.c: Add bfd_mach_avr6.
1569         * cpu-avr.c: Likewise.
1570         * reloc.c (BFD_RELOC_AVR_LO8_LDI_GS, BFD_RELOC_AVR_HI8_LDI_GS):
1571         New relocations.
1572         * libbfd.h: Regenerate.
1573         * bfd-in2.h:Regenerate.
1574         * elf32-avr.h: New file.  Protoypes for functions accessed from ld.
1575         * elf32-avr.c: Add elf32-avr.h to include list.
1576         (elf32_avr_stub_hash_entry): New function.
1577         (elf32_avr_link_hash_table): New struct.
1578         (avr_link_hash_table): Likewise.
1579         (avr_stub_hash_entry): Likewise.
1580         (avr_stub_hash_lookup): New function.
1581         (stub_hash_newfunc): New function.
1582         (elf32_avr_link_hash_table_create): New function.
1583         (elf32_avr_link_hash_table_free): New function.
1584         (avr_get_stub_addr): New function.
1585         (debug_relax, debug_stubs): Add new global variables controlling
1586         debugging printout to stdout.
1587         (avr_pc_wrap_around): Change the type to bfd_vma.
1588         (avr_replace_call_ret_sequences): Add a new variable controling
1589         linkrelax optimizations.
1590         (avr_stub_is_required_for_16_bit_reloc): New function.
1591         (avr_final_link_relocate):
1592         Add linker hash table to parameter list. Use stub addr. if necessary.
1593         (elf32_avr_relocate_section):
1594         Add linker hashtable to parameter list of avr_final_link_relocate.
1595         (bfd_elf_avr_final_write_processing): Add support for bfd_mach_avr6.
1596         (elf32_avr_object_p): Add support for E_AVR_MACH_AVR6.
1597         (elf32_avr_relax_delete_bytes):
1598         Iterate over all sections of a bfd when adjusting relocs addends.
1599         (elf32_avr_relax_section):
1600         Evaluate avr_replace_call_ret_sequences and recalculate the size of
1601         stub section.
1602         (avr_stub_name): New function.
1603         (avr_get_stub_entry): New function.
1604         (avr_add_stub): New function.
1605         (avr_build_one_stub): New function.
1606         (avr_size_one_stub): New function.
1607         (elf32_avr_setup_params): New function.
1608         (elf32_avr_setup_section_lists): New function.
1609         (get_local_syms): New function.
1610         (elf32_avr_size_stubs): New function.
1611         (bfd_elf32_bfd_link_hash_table_create): New function.
1612         (bfd_elf32_bfd_link_hash_table_free): New function.
1613
1614 2006-05-23  H.J. Lu  <hongjiu.lu@intel.com>
1615
1616         PR ld/2655
1617         PR ld/2657
1618         * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): Properly
1619         update CIE/FDE length.  Don't pad to the section alignment.
1620
1621 2006-05-23  Jie Zhang  <jie.zhang@analog.com>
1622
1623         * elf32-bfin.c (bfinfdpic_relocate_section): Clear reloc for
1624         deteted entries in .eh_frame section.
1625
1626 2006-05-23  Jie Zhang  <jie.zhang@analog.com>
1627
1628         * elf32-bfin.c (bfin_check_relocs): Use __GLOBAL_OFFSET_TABLE_
1629         instead of _GLOBAL_OFFSET_TABLE_.
1630         (bfin_relocate_section): Ditto.
1631         (_bfin_create_got_section): Ditto.
1632         (elf32_bfinfdpic_create_dynamic_sections): Use
1633         __PROCEDURE_LINKAGE_TABLE_ instead of _PROCEDURE_LINKAGE_TABLE_.
1634         (bfin_finish_dynamic_symbol): Use __DYNAMIC instead of _DYNAMIC.
1635
1636 2006-05-23  Alan Modra  <amodra@bigpond.net.au>
1637
1638         * elf64-ppc.c (compare_symbols): Prefer strong dynamic global
1639         function syms over other syms.
1640
1641 2006-05-22  Daniel Jacobowitz  <dan@codesourcery.com>
1642
1643         * elflink.c (_bfd_elf_add_dynamic_entry): Remove DT_TEXTREL
1644         check.
1645         (bfd_elf_final_link): Add a late DT_TEXTREL check.
1646         * elfxx-mips.c (MIPS_ELF_READONLY_SECTION): Define.
1647         (mips_elf_create_dynamic_relocation): Set DF_TEXTREL.
1648         (_bfd_mips_elf_check_relocs): Delete MIPS_READONLY_SECTION.
1649         Use MIPS_ELF_READONLY_SECTION.
1650         (_bfd_mips_elf_size_dynamic_sections): Clear DF_TEXTREL after
1651         creating DT_TEXTREL.
1652         (_bfd_mips_elf_finish_dynamic_sections): Clear textrel markers
1653         if no text relocations were generated.
1654
1655 2006-05-19  H.J. Lu  <hongjiu.lu@intel.com>
1656
1657         * elfxx-ia64.c (ELF_MAXPAGESIZE): Fix a typo in comment.
1658
1659 2006-05-19  Alan Modra  <amodra@bigpond.net.au>
1660
1661         * elf.c (elf_fake_sections): Formatting.
1662         (assign_file_positions_for_load_sections): Only add SEC_ALLOC
1663         sections to p_memsz.  Remove hack for PT_NOTE sections.  Allow
1664         section alignment to increase p_align for PT_LOAD.
1665         (assign_file_positions_for_non_load_sections): Remove ARM BPABI
1666         hack for PT_DYNAMIC.  Instead, set p_filesz for all segments
1667         other than PT_LOAD, and PT_NOTE in core.
1668
1669 2006-05-17  Alan Modra  <amodra@bigpond.net.au>
1670
1671         * elf.c (assign_file_positions_for_segments): Split into..
1672         (assign_file_positions_for_load_sections): ..this, and..
1673         (assign_file_positions_for_non_load_sections): ..this new function,..
1674         (assign_file_positions_except_relocs): ..writing program headers here.
1675
1676 2006-05-17  Alan Modra  <amodra@bigpond.net.au>
1677
1678         * elflink.c (elf_gc_sweep): Don't specially keep non-alloc,
1679         non-load sections if they have relocs.
1680
1681 2006-05-15  Paul Brook  <paul@codesourcery.com>
1682
1683         * cpu-arm.c (bfd_is_arm_mapping_symbol_name): Rename ...
1684         (bfd_is_arm_special_symbol_name): ... to this.  Add type argument.
1685         Check symbol name is of specified type.
1686         * elf32-arm.c (elf32_arm_is_target_special_symbol,
1687         arm_elf_find_function, elf32_arm_output_symbol_hook): Use
1688         bfd_is_arm_special_symbol_name.
1689         * bfd-in.h (BFD_ARM_SPECIAL_SYM_TYPE_MAP,
1690         BFD_ARM_SPECIAL_SYM_TYPE_TAG, BFD_ARM_SPECIAL_SYM_TYPE_OTHER,
1691         BFD_ARM_SPECIAL_SYM_TYPE_ANY): Define.
1692         (bfd_is_arm_mapping_symbol_name): Remove prototype.
1693         (bfd_is_arm_special_symbol_name): Add prototype.
1694         * bfd-in2.h: Regenerate.
1695
1696 2006-05-15  David Heine  <dlheine@tensilica.com>
1697             Bob Wilson  <bob.wilson@acm.org>
1698
1699         * elf32-xtensa.c (check_loop_aligned): Fix reversed check for
1700         undefined opcode.  Clean up assertions.
1701         (narrow_instruction, widen_instruction): Remove "do_it" parameters.
1702         Factor most of the code into separate functions....
1703         (can_narrow_instruction, can_widen_instruction): New.
1704         (prev_instr_is_a_loop): New.
1705         (compute_ebb_proposed_actions): Combine error handling code for
1706         decode errors.  Replace call to insn_decode_len with inline code.
1707         Use can_narrow_instruction and can_widen_instruction.  Handle errors
1708         from call to xtensa_opcode_is_loop.
1709         (relax_section): Adjust calls to narrow_instruction and
1710         widen_instruction.
1711
1712 2006-05-15  Alan Modra  <amodra@bigpond.net.au>
1713
1714         PR 2658
1715         * elf32-ppc.c (ppc_elf_relax_section): Don't segfault on non-pic
1716         -shared link.
1717
1718 2006-05-11  Michael Matz  <matz@suse.de>
1719
1720         * elflink.c (match_group_member): Correctly iterate group
1721         members.
1722
1723 2006-05-11  Paul Brook  <paul@codesourcery.com>
1724
1725         * elf32-arm.c (elf32_arm_reloc_map): Add MOVW and MOVT relocs.
1726         (elf32_arm_final_link_relocate): Handle MOVW and MOVT relocs.
1727         (elf32_arm_gc_sweep_hook, elf32_arm_check_relocs): Ditto.
1728         * reloc.c: Ditto.
1729         * bfd-in2.h: Regenerate.
1730         * libbfd.h: Regenerate.
1731         * libcoff.h: Regenerate.
1732
1733 2006-05-11  Mike Bland  <mbland@google.com>
1734
1735         * elf.c (_bfd_elf_init_private_section_data): Don't change
1736         section type if already set.
1737
1738 2006-05-10  Nick Clifton  <nickc@redhat.com>
1739
1740         PR ld/2607
1741         * elfcode.h (valid_section_index_p): New function: Checks for a
1742         valid section index.  Allows indicies in the range SHN_LOPROC to
1743         SHN_HIOS.
1744         (elf_object_p): Use valid_section_index_p.
1745
1746 2006-05-11  Pedro Alves  <pedro_alves@portugalmail.pt>
1747
1748         * coff-arm.c (ARM_26D, ARM_32, ARM_RVA_32, ARM_SECTION,
1749         ARM_SECREL): Mark WinCE versions of these relocs as partial
1750         inplace.
1751         (coff_arm_relocate_section): Adjust addend for WinCE.
1752
1753 2006-05-10  Alan Modra  <amodra@bigpond.net.au>
1754
1755         PR 2342
1756         * elflink.c (_bfd_elf_default_action_discarded): Revert 2006-02-16.
1757
1758 2006-05-09  Nick Clifton  <nickc@redhat.com>
1759
1760         * coffcode.h (coff_write_relocs): Produce an error message if a an
1761         out-of-range symbol index is detected in a reloc.
1762
1763 2006-05-09  Ben Elliston  <bje@au.ibm.com>
1764
1765         * elf64-ppc.c (ppc64_elf_finish_dynamic_symbol): Remove unused
1766         local variable `dynobj'.
1767
1768 2006-05-05  Bjoern Haase  <bjoern.m.haase@web.de>
1769
1770         * elf32-avr.c (elf32_avr_relax_delete_bytes): Iterate over all
1771         of the bfd's sections for the reloc-addend adjustments.
1772
1773 2006-05-05  Martin Schwidefsky  <schwidefsky@de.ibm.com>
1774
1775         * elf32-s390.c (invalid_tls_insn): Call bfd_set_error.
1776         (elf_s390_relocate_section): Add code to do the GD->LE and
1777         LD->LE TLS linker optimizations if a brasl instruction is used
1778         for the __tls_get_offset function call.
1779         * elf64-s390.c (invalid_tls_insn): Call bfd_set_error.
1780
1781 2006-05-05  Alan Modra  <amodra@bigpond.net.au>
1782
1783         * elf64-ppc.c (ppc64_elf_tls_optimize): Only optimize
1784         R_PPC64_TPREL64 and R_PPC64_DTPMOD64 relocs when they are in
1785         the .toc and referenced by a TLS code sequence.
1786         (ppc64_elf_edit_toc): Cater for the unlikely situation that
1787         .toc is the first section in a file.
1788
1789 2006-05-04  Andreas Schwab  <schwab@suse.de>
1790
1791         * aoutf1.h (struct external_sparc_core): Declare c_regs as struct
1792         regs instead of an array of int.
1793         (struct external_solaris_bcp_core): Likewise.
1794         (swapcore_sun3): Use offsetof instead of computing the offset
1795         manually.
1796         (swapcore_sparc): Likewise.  Simplify reference to c_regs.
1797         (swapcore_solaris_bcp): Likewise.
1798
1799 2006-05-04  Daniel Jacobowitz  <dan@codesourcery.com>
1800
1801         * elfxx-mips.c (_bfd_mips_elf_hide_symbol): Adjust handling
1802         for missing GOTs.
1803
1804 2006-05-04  Daniel Jacobowitz  <dan@codesourcery.com>
1805
1806         * cpu-arm.c (bfd_is_arm_mapping_symbol_name): Accept more
1807         mapping symbols.
1808
1809 2006-05-04  Ben Elliston  <bje@au.ibm.com>
1810
1811         * coff-or32.c (bfd_section_from_shdr): Remove unused local
1812         variable `ptr'.
1813         * cofflink.c (process_embedded_commands): Remove unused local
1814         variables `had_read' and `had_shared'.
1815         * ecofflink.c (bfd_ecoff_debug_accumulate): Remove unused local
1816         variable `fdr_adr'.
1817         * ihex.c (ihex_read_section): Remove unused local variable `addr'.
1818
1819 2006-05-03  Alan Modra  <amodra@bigpond.net.au>
1820
1821         * libbfd-in.h (_bfd_generic_new_section_hook): Declare.
1822         * section.c (bfd_abs_symbol, bfd_com_symbol): Delete.
1823         (bfd_und_symbol, bfd_ind_symbol): Delete.
1824         (BFD_FAKE_SECTION): Remove SYM_PTR param, set symbol_ptr_ptr to
1825         &SEC.symbol.
1826         (STD_SECTION): Adjust.
1827         (_bfd_generic_new_section_hook): New function, extracted from..
1828         (bfd_section_init): ..here.
1829         (bfd_make_section_old_way): Call new_section_hook for abs, com,
1830         und and ind sections.
1831         * elf.c (_bfd_elf_large_com_section): Adjust.
1832         * aoutx.h (new_section_hook): Call _bfd_generic_new_section_hook.
1833         * pdp11.c (new_section_hook): Likewise.
1834         * coffcode.h (coff_new_section_hook): Likewise.
1835         * ecoff.c (_bfd_ecoff_new_section_hook): Likewise.
1836         * elf.c (_bfd_elf_new_section_hook): Likewise.
1837         * vms.c (vms_new_section_hook): Likwise.
1838         * elf32-arm.c (elf32_arm_new_section_hook): Check used_by_bfd isn't
1839         already set.
1840         * elf32-sh64.c (sh64_elf_new_section_hook): Likewise.
1841         * elf32-xtensa.c (elf_xtensa_new_section_hook): Likewise.
1842         * elf64-mmix.c (mmix_elf_new_section_hook): Likewise.
1843         * elf64-ppc.c (ppc64_elf_new_section_hook): Likewise.
1844         * elfxx-mips.c (_bfd_mips_elf_new_section_hook): Likewise.
1845         * elfxx-sparc.c (_bfd_sparc_elf_new_section_hook): Likewise.
1846         * ieee.c (ieee_new_section_hook): Likewise.  Call
1847         _bfd_generic_new_section_hook too.
1848         * mmo.c (mmo_new_section_hook): Likewise.
1849         * oasys.c (oasys_new_section_hook): Likewise.
1850         * som.c (som_new_section_hook): Likewise.
1851         * coff-w65.c (reloc_processing): Don't use bfd_abs_symbol.
1852         * bfd-in2.h: Regenerate.
1853         * libbfd.h: Regenerate.
1854
1855 2006-05-03  Alan Modra  <amodra@bigpond.net.au>
1856
1857         * hash.c (DEFAULT_SIZE): Revert last change.
1858         (higher_prime_number): Correct test for no larger prime.  Don't
1859         abort on error, instead return 0.  Depopulate primes[].
1860         (bfd_hash_lookup): If we overflow size, refuse to grow table.
1861
1862 2006-05-02  Paul Brook  <paul@codesourcery.com>
1863
1864         * elf32-arm.c (elf32_arm_final_link_relocate): Set thumb funciton bit
1865         for R_ARM_REL32.
1866
1867 2006-05-02  Ben Elliston  <bje@au.ibm.com>
1868
1869         * archive.c (bfd_generic_archive_p): Remove unused local variable
1870         `fail'.
1871         * dwarf2.c (decode_line_info): Remove unused local variable
1872         `basic_block'.
1873         * elfcode.h (elf_slurp_reloc_table_from_section): Remove unused
1874         local variable `s'.
1875         * tekhex.c (tekhex_write_object_contents): Remove unused local
1876         variable `bytes_written'.
1877         * aout-ns32k.c (MY_swap_std_reloc_out): Remove unused local
1878         variable `r_addend'.
1879         * elf32-dlx.c (dlx_rtype_to_howto): Remove breaks after returns.
1880         * elfxx-mips.c (_bfd_elf_mips_mach): Remove breaks after returns.
1881         (_bfd_ns32k_relocate_contents): Remove break after return.
1882         * elf.c (bfd_section_from_shdr): Remove breaks after returns.
1883
1884 2006-05-02  Nick Clifton  <nickc@redhat.com>
1885
1886         * elf32-sh-symbian.c: Rename local define DEBUG to SYMBIAN_DEBUG
1887         in order to avoid conflicts with the global DEBUG define.
1888
1889 2006-05-02  Alan Modra  <amodra@bigpond.net.au>
1890
1891         * dwarf2.c: Formatting.
1892         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Simplify
1893         output section check.
1894         * elf32-i370.c: Warning fixes inside #ifdef DEBUG.
1895         * elf32-m32c.c: Similarly.
1896         * elf32-ppc.c: Similarly.
1897         * elf32-v850.c: Similarly.
1898         * nlm32-sparc.c: Similarly.
1899         * elfcode.h: Similarly.
1900         (elf_symbol_flags): Delete.
1901         * elflink.c (elf_link_input_bfd): Comment typo.
1902
1903 2006-05-01  DJ Delorie  <dj@redhat.com>
1904
1905         * bfd-in.h (bfd_hash_table): Add count field.
1906         * bfd-in2.h: Regenerate.
1907         * hash.c (higher_prime_number): New.
1908         (bfd_hash_table_inint_n): Init count field.
1909         (bfd_hash_lookup): Grow table as needed.
1910
1911 2006-04-27  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1912
1913         PR binutils/2584
1914         * tekhex.c (getvalue): Change return type to bfd_boolean and
1915         add the new parameter.  Return false if the unexpected character
1916         is found.
1917         (getsym): Likewise.
1918         (first_phase): Change return type to bfd_boolean and return
1919         false if the unexpected character is found.  Replace abort
1920         with returning false.
1921         (pass_over): Change return type to bfd_boolean and the type of
1922         the second argument to bfd_boolean (*) (bfd *, int, char *).
1923         Return false if FUNC returns false.
1924         (tekhex_object_p): Return NULL if pass_over fails.
1925
1926 2006-04-27  Alan Modra  <amodra@bigpond.net.au>
1927
1928         * coff-rs6000.c (xcoff_write_archive_contents_old): Warning fix.
1929
1930 2006-04-26  H.J. Lu  <hongjiu.lu@intel.com>
1931
1932         PR binutils/2593
1933         * elf.c (_bfd_elf_new_section_hook): Don't set section ELF type
1934         and flags if its BFD flags have been set.
1935         (_bfd_elf_init_private_section_data): Don't copy the output ELF
1936         section type from input if it has been set to something
1937         different.
1938
1939 2006-04-25  H.J. Lu  <hongjiu.lu@intel.com>
1940
1941         PR binutils/2467
1942         * elf.c (_bfd_elf_close_and_cleanup): Check elf_tdata (abfd)
1943         is NULL first.
1944
1945         * elf32-arm.c (elf32_arm_close_and_cleanup): Check if
1946         abfd->sections is NULL.
1947         (elf32_arm_bfd_free_cached_info): New.
1948         (bfd_elf32_bfd_free_cached_info): Defined.
1949
1950         * elfxx-target.h (bfd_elfNN_bfd_free_cached_info): Default it
1951         to _bfd_free_cached_info.
1952
1953         * libbfd-in.h (_bfd_free_cached_info): New.
1954         * libbfd: Regenerated.
1955
1956         * opncls.c (_bfd_delete_bfd): Check if abfd->memory is NULL.
1957         (_bfd_free_cached_info): New.
1958
1959 2006-04-21  Alan Modra  <amodra@bigpond.net.au>
1960
1961         * elf.c (assign_file_positions_except_relocs): Move code setting
1962         file position of non-loaded sections..
1963         (assign_file_positions_for_segments): ..to here.
1964
1965 2006-04-20  H.J. Lu  <hongjiu.lu@intel.com>
1966
1967         PR ld/2537
1968         * elf.c (bfd_section_from_shdr): Allow sections reserved for
1969         applications. Issue an error on sections we don't know how
1970         to handle.
1971
1972 2006-04-19  Alan Modra  <amodra@bigpond.net.au>
1973
1974         * Makefile.am: Run "make dep-am".
1975         * Makefile.in: Regenerate.
1976
1977 2006-04-19  Alan Modra  <amodra@bigpond.net.au>
1978
1979         * warning.m4 (--enable-werror): Format help message.
1980         (--enable-build-warnings): Likewise.
1981         * configure: Regenerate.
1982
1983 2006-04-18  Nick Clifton  <nickc@redhat.com>
1984
1985         PR 2257
1986         * elfcode.h (elf_object_p): Allow files with corrupt e_shstrndx
1987         fields to still be handled as ELF files.
1988
1989 2006-04-16  Daniel Jacobowitz  <dan@codesourcery.com>
1990
1991         * po/SRC-POTFILES.in: Regenerated.
1992
1993 2006-04-16  Daniel Jacobowitz  <dan@codesourcery.com>
1994
1995         * configure.in: Update version to 2.17.50.
1996         * configure: Regenerated.
1997
1998 2006-04-14  David Heine  <dlheine@tensilica.com>
1999
2000         * elf32-xtensa.c (build_reloc_opcodes): New.
2001         (compute_text_actions): Use it to decode opcodes outside inner loop.
2002         (check_section_ebb_pcrels_fit): Add "reloc_opcodes" argument, and if
2003         it is set, use it to get the opcodes for relocations.
2004         (move_shared_literal): Adjust call to check_section_ebb_pcrels_fit.
2005
2006 2006-04-08  H.J. Lu  <hongjiu.lu@intel.com>
2007
2008         PR ld/2513
2009         * elf32-i386.c (GOT_TLS_MASK): New macro for tls_type.
2010         (GOT_TLS_IE_IE): Likewise.
2011         (GOT_TLS_IE_GD): Likewise.
2012         (GOT_TLS_IE_MASK): Likewise.
2013         (elf_i386_check_relocs): For global symbols, set GOT_TLS_IE_GD
2014         and GOT_TLS_IE_IE for R_386_TLS_GD and R_386_TLS_IE
2015         respectively.
2016         (allocate_dynrelocs): If both GOT_TLS_IE_IE and GOT_TLS_IE_GD
2017         are set, treat tls_type as GOT_TLS_IE_BOTH.
2018         (elf_i386_relocate_section): Likewise.
2019
2020 2006-04-07  Randolph Chung  <tausq@debian.org>
2021
2022         * elf64-hppa.c (elf64_hppa_grok_prstatus): New function.
2023         (elf64_hppa_grok_psinfo): Likewise.
2024         (elf_backend_grok_pstatus, elf_backend_grok_psinfo): Define.
2025
2026 2006-04-06  DJ Delorie  <dj@redhat.com>
2027
2028         * elf32-m32c.c (m32c_elf_relocate_section): Generate a symbol for
2029         each plt entry we create.
2030
2031 2006-04-06  Carlos O'Donell  <carlos@codesourcery.com>
2032
2033         * po/Make-in: Add install-html target.
2034         * Makefile.am: Rename docdir to bfddocdir. Add datarootdir, docdir
2035         htmldir. Add install-html and install-html-recursive targets.
2036         * Makefile.in: Regenerate.
2037         * configure.in: AC_SUBST for datarootdir, docdir and htmldir.
2038         * configure: Regenerate.
2039
2040 2006-04-06  H.J. Lu  <hongjiu.lu@intel.com>
2041
2042         * elfxx-ia64.c (elfNN_ia64_relax_section): Skip unneeded passes
2043         with the skip_relax_pass_0 and skip_relax_pass_1 bits in the
2044         section structure.
2045
2046 2006-04-05  Bernd Schmidt  <bernd.schmidt@analog.com>
2047
2048         * elf32-bfin.c (bfinfdpic_relocs_info_hash): Sprinkle casts to
2049         eliminate warnings.
2050
2051 2006-04-05  H.J. Lu  <hongjiu.lu@intel.com>
2052             James E Wilson  <wilson@specifixinc.com>
2053
2054         PR ld/2442
2055         * elfxx-ia64.c (elfNN_ia64_dyn_sym_info): Remove next.
2056         (elfNN_ia64_local_hash_entry): Add count, sorted_count and
2057         size.
2058         (elfNN_ia64_link_hash_entry): Likewise.
2059         (elfNN_ia64_new_elf_hash_entry): Initialize count, sorted_count
2060         and size.
2061         (elfNN_ia64_hash_copy_indirect): Updated elfNN_ia64_dyn_sym_info
2062         processing.
2063         (elfNN_ia64_hash_hide_symbol): Likewise.
2064         (elfNN_ia64_global_dyn_sym_thunk): Likewise.
2065         (elfNN_ia64_local_dyn_sym_thunk): Likewise.
2066         (elfNN_ia64_global_dyn_info_free): New function.
2067         (elfNN_ia64_local_dyn_info_free): Likewise.
2068         (elfNN_ia64_hash_table_free): Free local and global
2069         elfNN_ia64_dyn_sym_info.
2070         (addend_compare): New function.
2071         (sort_dyn_sym_info): Likewise.
2072         (get_dyn_sym_info): Updated to use binary search for addend.
2073         (elfNN_ia64_check_relocs): Scan relocations to create dynamic
2074         relocation arrays first.
2075
2076 2006-04-05  Bernd Schmidt  <bernd.schmidt@analog.com>
2077
2078         * elf32-bfin.c (_bfin_create_got_section): Don't generate a _gp
2079         symbol.
2080
2081 2006-04-05  H.J. Lu  <hongjiu.lu@intel.com>
2082
2083         PR ld/2411
2084         * elflink.c (check_dynsym): New.
2085         (elf_link_output_extsym): Use it.
2086         (bfd_elf_final_link): Likewise.
2087
2088 2006-04-05  H.J. Lu  <hongjiu.lu@intel.com>
2089
2090         PR ld/2404
2091         * elflink.c (_bfd_elf_merge_symbol): Skip the default indirect
2092         symbol from the dynamic definition with the default version if
2093         its type and the type of existing regular definition mismatch.
2094
2095 2006-04-05  Richard Sandiford  <richard@codesourcery.com>
2096             Daniel Jacobowitz  <dan@codesourcery.com>
2097
2098         * config.bfd (sparc-*-vxworks*): New stanza.
2099         * configure.in (bfd_elf32_sparc_vxworks_vec): New stanza.
2100         (bfd_elf32_sparc_vec, bfd_elf64_sparc_vec): Add elf-vxworks.lo.
2101         * configure: Regenerate.
2102         * elf32-sparc.c: Include elf-vxworks.h.
2103         (elf32_sparc_vxworks_link_hash_table_create: New.
2104         (elf32_sparc_vxworks_final_write_processing): New.
2105         (TARGET_BIG_SYM): Override for VxWorks.
2106         (TARGET_BIG_NAME, ELF_MINPAGESIZE): Likewise.
2107         (bfd_elf32_bfd_link_hash_table_create): Likewise.
2108         (elf_backend_want_got_plt, elf_backend_plt_readonly): Likewise.
2109         (elf_backend_got_header_size, elf_backend_add_symbol_hook): Likewise.
2110         (elf_backend_link_output_symbol_hook): Likewise.
2111         (elf_backend_emit_relocs): Likewise.
2112         (elf_backend_final_write_processing, elf32_bed): Likewise.
2113         * elfxx-sparc.c: Include libiberty.h and elf-vxworks.h.
2114         (sparc_vxworks_exec_plt0_entry, sparc_vxworks_exec_plt_entry): New.
2115         (sparc_vxworks_shared_plt0_entry, sparc_vxworks_shared_plt_entry): New.
2116         (_bfd_sparc_elf_link_hash_table_create): Don't initialize
2117         build_plt_entry here.
2118         (create_got_section): Initialize sgotplt for VxWorks.
2119         (_bfd_sparc_elf_create_dynamic_sections): Initialize build_plt_entry,
2120         plt_header_size and plt_entry_size, with new VxWorks-specific settings.
2121         Call elf_vxworks_create_dynamic_sections for VxWorks.
2122         (allocate_dynrelocs): Use plt_header_size and plt_entry_size.
2123         Allocate room for .got.plt and .rela.plt.unloaded entries on VxWorks.
2124         (_bfd_sparc_elf_size_dynamic_sections): Don't allocate a nop in .plt
2125         for VxWorks.  Check for the .got.plt section.
2126         (sparc_vxworks_build_plt_entry): New function.
2127         (_bfd_sparc_elf_finish_dynamic_symbol): Add handling of VxWorks PLTs.
2128         Don't make _GLOBAL_OFFSET_TABLE_ and _PROCEDURE_LINKAGE_TABLE_
2129         absolute on VxWorks.
2130         (sparc32_finish_dyn): Add special handling for DT_RELASZ
2131         and DT_PLTGOT on VxWorks.
2132         (sparc_vxworks_finish_exec_plt): New.
2133         (sparc_vxworks_finish_shared_plt): New.
2134         (_bfd_sparc_elf_finish_dynamic_sections): Call them.
2135         Use plt_header_size and plt_entry_size.
2136         * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Add is_vxworks,
2137         srelplt2, sgotplt, plt_header_size and plt_entry_size fields.
2138         * Makefile.am (elfxx-sparc.lo): Depend on elf-vxworks.h.
2139         (elf32-sparc.lo): Likewise.
2140         * Makefile.in: Regenerate.
2141         * targets.c (bfd_elf32_sparc_vxworks_vec): Declare.
2142         (_bfd_target_vector): Add a pointer to it.
2143
2144 2006-03-30  Ben Elliston  <bje@au.ibm.com>
2145
2146         PR ld/2267
2147         * elflink.c (elf_fixup_link_order): Ensure `elfsec' is not a
2148         special section number that exceeds the number of ELF sections
2149         (eg. SHN_MIPS_SCOMMON).
2150
2151 2006-03-27  Richard Sandiford  <richard@codesourcery.com>
2152
2153         * elfxx-mips.c (mips_got_entry): Add more commentary.
2154         (mips_elf_local_got_index): Use the hash table entry to record
2155         the GOT index of forced-local symbols.
2156         (mips_elf_initialize_tls_index): Rearrange code.  Store the index
2157         in either the hash table entry or the mips_got_entry, not both.
2158         Add more commentary.
2159         (mips_elf_multi_got): Make sure the g->next is nonnull when calling
2160         mips_elf_initialize_tls_index.
2161
2162 2006-03-25  Bernd Schmidt  <bernd.schmidt@analog.com>
2163
2164         * elf32-bfin.c (bfd_const_reloc, bfd_oper_reloc, bfin_push_reloc,
2165         RELOC_STACK_SIZE, reloc_stack, reloc_stack_tos, is_reloc_stack_empty,
2166         reloc_stack_push, reloc_stack_pop, reloc_stack_operate,
2167         bfin_areloc_howto_table): Delete.  All
2168         uses deleted as well.
2169         (bfin_reloc_map): Delete all stack relocs.
2170         (bfin_info_to_howto, bfin_bfd_reloc_type_lookup,
2171         bfin_reloc_type_lookup): Don't support them.
2172         (bfin_relocate_section): Don't try to handle them.
2173
2174         * config.bfd (bfin-*-*): Add bfd_elf32_bfinfdpic_vec.
2175         * configure.in: Likewise.
2176         * configure: Regenerate.
2177         * elf32-bfin.c: Include "elf/dwarf2.h" and "hashtab.h".
2178         (BFIN_RELOC_MAX): Now 0x21.
2179         (bfin_howto_table, bfin_reloc_map): Add FD-PIC relocs.
2180         (bfd_elf32_bfinfdpic_vec): Declare.
2181         (IS_FDPIC): New macro.
2182         (struct bfinfdpic_elf_link_hash_table): New struct.
2183         (bfinfdpic_hash_table, bfinfdpic_got_section,
2184         bfinfdpic_gotrel_section, bfinfdpic_gotfixup_section,
2185         bfinfdpic_plt_setion, bfinfdpic_pltrel_section,
2186         bfinfdpic_relocs_info, bfinfdpic_got_initial_offset,
2187         bfinfdpic_plt_initial_offset): Accessor macros for it.
2188         (BFINFDPIC_SYM_LOCAL, BFINFDPIC_FUNCDESC_LOCAL): New macros.
2189         (struct bfinfdpic_relocs_info): New struct.
2190         (LZPLT_RESOLVER_EXTRA, LZPLT_NORMAL_SIZE, LZPLT_ENTRIES,
2191         BFINFDPIC_LZPLT_BLOCK_SIZE, BFINFDPIC_LZPLT_RESOLV_LOC,
2192         DEFAULT_STACK_SIZE): New macros.
2193         (bfinfdpic_elf_link_hash_table_create, bfinfdpic_relocs_info_hash,
2194         bfinfdpic_relocs_info_eq, bfinfdpics_relocs_info_find,
2195         bfinfdpic_relocs_info_for_global, bfinfdpic_relocs_info_for_local,
2196         bfinfdpic_pic_merge_early_relocs_info, _bfinfdpic_add_dyn_reloc,
2197         _bfinfdpic_add_rofixup, _bfinfdpic_osec_to_segment,
2198         _bfinfdpic_osec_readonly_p, bfinfdpic_relocate_section,
2199         bfinfdpic_check_relocs, bfinfdpic_gc_sweep_hook,
2200         _bfinfdpic_link_omit_section_dynsym, _bfin_create_got_section,
2201         elf32_bfinfdpic_create_dynamic_sections, _bfinfdpic_get_fd_entry,
2202         _bfinfdpic_compute_got_alloc_data, _bfinfdpic_get_got_entry,
2203         _bfinfdpic_assign_got_entries, _bfinfdpic_assign_plt_entries,
2204         _bfinfdpic_resolve_final_relocs_info,
2205         elf32_bfinfdpic_size_dynamic_sections,
2206         elf32_bfinfdpic_always_size_sections,
2207         elf32_bfinfdpic_modify_segment_map,
2208         _bfinfdpic_count_got_plt_entries,
2209         elf32_bfinfdpic_finish_dynamic_sections,
2210         elf32_bfinfdpic_adjust_dynamic_symbol,
2211         elf32_bfinfdpic_finish_dynamic_symbol,
2212         elf32_bfinfdpic_elf_use_relative_eh_frame,
2213         elf32_bfinfdpic_elf_encode_eh_address,
2214         elf32_bfin_object_p, bfin_elf_copy_private_bfd_data,
2215         elf32_bfinfdpic_copy_private_bfd_data,
2216         (struct _bfinfdpic_dynamic_got_info,
2217         struct _bfinfdpic_dynamic_got_plt_info): New structs.
2218         (elf32_bfin_print_private_bfd_data): Print PIC flags.
2219         (elf32_bfin_merge_private_bfd_data): Extend to support FD-PIC.
2220         (TARGET_LITTLE_SYM, TARGET_LITTLE_NAME, elf32_bed,
2221         elf_backend_got_header_size, bfd_elf32_bfd_link_hash_table_create,
2222         elf_backend_always_size_sectinos, elf_backend_modify_segment_map,
2223         bfd_elf32_bfd_copy_private_bfd_data,
2224         elf_backend_create_dynamic_sections, elf_backend_adjust_dynamic_symbol,
2225         elf_backend_size_dynamic_sections, elf_backend_finish_dynamic_symbol,
2226         elf_backend_finish_dynamic_sections, elf_backend_relocate_section,
2227         elf_backend_can_make_relative_eh_frame, elf_backend_check_relocs,
2228         elf_backend_can_make_ldsa_relative_eh_frame, elf_backend_may_use_rel_p,
2229         elf_backend_may_use_rela_p, elf_backend_default_use_rela_p,
2230         elf_backend_omit_section_dynsym): Redefine these macros and include
2231         "elf32-target.h" again to create the elf32-bfinfdpic target.
2232         * reloc.c (BFD_RELOC_BFIN_GOT17M4, BFD_RELOC_BFIN_GOTHI,
2233         BFD_RELOC_BFIN_GOTLO, BFD_RELOC_BFIN_FUNCDESC,
2234         BFD_RELOC_BFIN_FUNCDESC_GOT17M4, BFD_RELOC_BFIN_FUNCDESC_GOTHI,
2235         BFD_RELOC_BFIN_FUNCDESC_GOTLO, BFD_RELOC_BFIN_FUNCDESC_VALUE,
2236         BFD_RELOC_BFIN_FUNCDESC_GOTOFF17M4, BFD_RELOC_BFIN_FUNCDESC_GOTOFFHI,
2237         BFD_RELOC_BFIN_FUNCDESC_GOTOFFLO, BFD_RELOC_BFIN_GOTOFFHI,
2238         BFD_RELOC_BFIN_GOTOFFLO): New.
2239         * targets.c (bfd_elf32_bfinfdpic_vec): New bfd_target.
2240         (_bfd_target_vector): Add it.
2241         * bfd-in2.h: Regenerate.
2242         * libbfd.h: Regenerate.
2243
2244 2006-03-25  Richard Sandiford  <richard@codesourcery.com>
2245
2246         * cpu-m68k.c (bfd_m68k_compatible): Treat ISA A+ and ISA B code as
2247         incompatible.  Likewise MAC and EMAC code.
2248         * elf32-m68k.c (elf32_m68k_merge_private_bfd_data): Use
2249         bfd_get_compatible to set the new bfd architecture.  Rely on it
2250         to detect incompatibilities.
2251
2252 2006-03-23  Michael Matz  <matz@suse.de>
2253
2254         * reloc.c: Add BFD_RELOC_X86_64_GOT64, BFD_RELOC_X86_64_GOTPCREL64,
2255         BFD_RELOC_X86_64_GOTPC64, BFD_RELOC_X86_64_GOTPLT64,
2256         BFD_RELOC_X86_64_PLTOFF64.
2257         * bfd-in2.h: Regenerated.
2258         * libbfd.h: Regenerated.
2259         * elf64-x86-64.c (x86_64_elf_howto_table): Correct comment.
2260         Add howtos for above relocs.
2261         (x86_64_reloc_map): Add mappings for new relocs.
2262         (elf64_x86_64_check_relocs): R_X86_64_GOT64, R_X86_64_GOTPCREL64,
2263         R_X86_64_GOTPLT64 need a got entry.  R_X86_64_GOTPLT64 also a PLT
2264         entry.  R_X86_64_GOTPC64 needs a .got section.  R_X86_64_PLTOFF64
2265         needs a PLT entry.
2266         (elf64_x86_64_gc_sweep_hook): Reflect changes from
2267         elf64_x86_64_check_relocs for the new relocs.
2268         (elf64_x86_64_relocate_section): Handle new relocs.
2269
2270 2006-03-22  Bob Wilson  <bob.wilson@acm.org>
2271
2272         * elf32-xtensa.c (xtensa_read_table_entries): Remove assertion that
2273         rel->r_addend is zero.
2274
2275 2006-03-22  Richard Sandiford  <richard@codesourcery.com>
2276
2277         * elfxx-mips.c (_bfd_mips_vxworks_finish_dynamic_symbol): Fix type
2278         of "loc".
2279
2280 2006-03-22  Richard Sandiford  <richard@codesourcery.com>
2281             Daniel Jacobowitz  <dan@codesourcery.com>
2282             Phil Edwards  <phil@codesourcery.com>
2283             Zack Weinberg  <zack@codesourcery.com>
2284             Mark Mitchell  <mark@codesourcery.com>
2285             Nathan Sidwell  <nathan@codesourcery.com>
2286
2287         * bfd-in2.h: Regenerate.
2288         * config.bfd (mips*-*-vxworks*, mips*el-*-vxworks*): New stanzas.
2289         * configure.in (bfd_elf32_bigmips_vxworks_vec): New stanza.
2290         (bfd_elf32_littlemips_vxworks_vec): Likewise.
2291         (bfd_elf32_bigmips_vec): Add elf-vxworks.lo.
2292         (bfd_elf32_littlemips_vec): Likewise.
2293         (bfd_elf32_nbigmips_vec): Likewise.
2294         (bfd_elf32_nlittlemips_vec): Likewise.
2295         (bfd_elf32_ntradbigmips_vec): Likewise.
2296         (bfd_elf32_ntradlittlemips_vec): Likewise.
2297         (bfd_elf32_tradbigmips_vec): Likewise.
2298         (bfd_elf32_tradlittlemips_vec): Likewise.
2299         (bfd_elf64_bigmips_vec): Likewise.
2300         (bfd_elf64_littlemips_vec): Likewise.
2301         (bfd_elf64_tradbigmips_vec): Likewise.
2302         (bfd_elf64_tradlittlemips_vec): Likewise.
2303         * elf32-mips.c: Include elf-vxworks.h.
2304         (mips_info_to_howto_rel): Use elf_backend_mips_rtype_to_howto
2305         instead of calling mips_elf32_rtype_to_howto directly.
2306         (mips_vxworks_copy_howto_rela): New reloc howto.
2307         (mips_vxworks_jump_slot_howto_rela): Likewise.
2308         (mips_vxworks_bfd_reloc_type_lookup): New function.
2309         (mips_vxworks_rtype_to_howto): Likewise.
2310         (mips_vxworks_final_write_processing): Likewise.
2311         (TARGET_LITTLE_SYM, TARGET_LITTLE_NAME): Override for VxWorks.
2312         (TARGET_BIG_SYM, TARGET_BIG_NAME, elf_bed, ELF_MAXPAGESIZE): Likewise.
2313         (elf_backend_want_got_plt): Likewise.
2314         (elf_backend_want_plt_sym): Likewise.
2315         (elf_backend_got_symbol_offset): Likewise.
2316         (elf_backend_want_dynbss): Likewise.
2317         (elf_backend_may_use_rel_p): Likewise.
2318         (elf_backend_may_use_rela_p): Likewise.
2319         (elf_backend_default_use_rela_p): Likewise.
2320         (elf_backend_got_header_size: Likewise.
2321         (elf_backend_plt_readonly): Likewise.
2322         (bfd_elf32_bfd_reloc_type_lookup): Likewise.
2323         (elf_backend_mips_rtype_to_howto): Likewise.
2324         (elf_backend_adjust_dynamic_symbol): Likewise.
2325         (elf_backend_finish_dynamic_symbol): Likewise.
2326         (bfd_elf32_bfd_link_hash_table_create): Likewise.
2327         (elf_backend_add_symbol_hook): Likewise.
2328         (elf_backend_link_output_symbol_hook): Likewise.
2329         (elf_backend_emit_relocs): Likewise.
2330         (elf_backend_final_write_processing: Likewise.
2331         (elf_backend_additional_program_headers): Likewise.
2332         (elf_backend_modify_segment_map): Likewise.
2333         (elf_backend_symbol_processing): Likewise.
2334         * elfxx-mips.c: Include elf-vxworks.h.
2335         (mips_elf_link_hash_entry): Add is_relocation_target and
2336         is_branch_target fields.
2337         (mips_elf_link_hash_table): Add is_vxworks, srelbss, sdynbss, srelplt,
2338         srelplt2, sgotplt, splt, plt_header_size and plt_entry_size fields.
2339         (MIPS_ELF_RELA_SIZE, MIPS_ELF_REL_DYN_NAME): New macros.
2340         (MIPS_RESERVED_GOTNO): Take a mips_elf_link_hash_table argument.
2341         Return 3 for VxWorks.
2342         (ELF_MIPS_GP_OFFSET): Change the argument from a bfd to a
2343         mips_elf_link_hash_table.  Return 0 for VxWorks.
2344         (MIPS_ELF_GOT_MAX_SIZE): Change the argument from a bfd to a
2345         mips_elf_link_hash_table.  Update the call to ELF_MIPS_GP_OFFSET.
2346         (mips_vxworks_exec_plt0_entry): New variable.
2347         (mips_vxworks_exec_plt_entry): Likewise.
2348         (mips_vxworks_shared_plt0_entry): Likewise.
2349         (mips_vxworks_shared_plt_entry): Likewise.
2350         (mips_elf_link_hash_newfunc): Initialize the new hash_entry fields.
2351         (mips_elf_rel_dyn_section): Change the bfd argument to a
2352         mips_elf_link_hash_table.  Use MIPS_ELF_REL_DYN_NAME to get
2353         the name of the section.
2354         (mips_elf_initialize_tls_slots): Update the call to
2355         mips_elf_rel_dyn_section.
2356         (mips_elf_gotplt_index): New function.
2357         (mips_elf_local_got_index): Add an input_section argument.
2358         Update the call to mips_elf_create_local_got_entry.
2359         (mips_elf_got_page): Likewise.
2360         (mips_elf_got16_entry): Likewise.
2361         (mips_elf_create_local_got_entry): Add bfd_link_info and input_section
2362         arguments.  Create dynamic relocations for each entry on VxWorks.
2363         (mips_elf_merge_gots): Update the use of MIPS_ELF_GOT_MAX_SIZE.
2364         (mips_elf_multi_got): Update the uses of MIPS_ELF_GOT_MAX_SIZE
2365         and MIPS_RESERVED_GOTNO.
2366         (mips_elf_create_got_section): Update the uses of
2367         MIPS_ELF_GOT_MAX_SIZE.  Create .got.plt on VxWorks.
2368         (is_gott_symbol): New function.
2369         (mips_elf_calculate_relocation): Use a dynobj local variable.
2370         Update the calls to mips_elf_local_got_index, mips_elf_got16_entry and
2371         mips_elf_got_page_entry.  Set G to the .got.plt entry when calculating
2372         VxWorks R_MIPS_CALL* relocations.  Calculate and use G for all GOT
2373         relocations on VxWorks.  Add dynamic relocations for references
2374         to the VxWorks __GOTT_BASE__ and __GOTT_INDEX__ symbols.  Don't
2375         create dynamic relocations for R_MIPS_32, R_MIPS_REL32 or R_MIPS_64
2376         in VxWorks executables.
2377         (mips_elf_allocate_dynamic_relocations): Add a bfd_link_info argument.
2378         Use MIPS_ELF_RELA_SIZE to calculate the size of a VxWorks entry.
2379         Don't allocate a null entry on VxWorks.
2380         (mips_elf_create_dynamic_relocation): Update the call to
2381         mips_elf_rel_dyn_section.  Use absolute rather than relative
2382         relocations for VxWorks, and make them RELA rather than REL.
2383         (_bfd_mips_elf_create_dynamic_sections): Don't make .dynamic
2384         read-only on VxWorks.  Update the call to mips_elf_rel_dyn_section.
2385         Create the .plt, .rela.plt, .dynbss and .rela.bss sections on
2386         VxWorks.  Likewise create the _PROCEDURE_LINKAGE_TABLE symbol.
2387         Call elf_vxworks_create_dynamic_sections for VxWorks and
2388         initialize the plt_header_size and plt_entry_size fields.
2389         (_bfd_mips_elf_check_relocs): Don't allow GOT relocations to be
2390         used in VxWorks executables.  Don't allocate dynamic relocations
2391         for R_MIPS_32, R_MIPS_REL32 or R_MIPS_64 in VxWorks executables.
2392         Set is_relocation_target for each symbol referenced by a relocation.
2393         Allocate .rela.dyn entries for relocations against the special
2394         VxWorks __GOTT_BASE__ and __GOTT_INDEX__ symbols.  Create GOT
2395         entries for all VxWorks R_MIPS_GOT16 relocations.  Don't allocate
2396         a global GOT entry for symbols mentioned in VxWorks R_MIPS_CALL*,
2397         R_MIPS_32, R_MIPS_REL32 or R_MIPS_64 relocations.  Update the calls
2398         to mips_elf_rel_dyn_section and mips_elf_allocate_dynamic_relocations.
2399         Set is_branch_target for symbols mentioned in R_MIPS_PC16 or R_MIPS_26
2400         relocations.  Don't set no_fn_stub on VxWorks.
2401         (_bfd_mips_elf_adjust_dynamic_symbol): Update the call to
2402         mips_elf_allocate_dynamic_relocations.
2403         (_bfd_mips_vxworks_adjust_dynamic_symbol): New function.
2404         (_bfd_mips_elf_always_size_sections): Do not allocate GOT page
2405         entries for VxWorks, and do not create multiple GOTs.
2406         (_bfd_mips_elf_size_dynamic_sections): Use MIPS_ELF_REL_DYN_NAME.
2407         Handle .got specially for VxWorks.  Update the uses of
2408         MIPS_RESERVED_GOTNO and mips_elf_allocate_dynamic_relocations.
2409         Check for sgotplt and splt.  Allocate the .rel(a).dyn contents last,
2410         once its final size is known.  Set DF_TEXTREL for VxWorks.  Add
2411         DT_RELA, DT_RELASZ, DT_RELAENT, DT_PLTREL, DT_PLTRELSZ and DT_JMPREL
2412         tags on VxWorks.  Do not add the MIPS-specific tags for VxWorks.
2413         (_bfd_mips_vxworks_finish_dynamic_symbol): New function.
2414         (mips_vxworks_finish_exec_plt): Likewise.
2415         (mips_vxworks_finish_shared_plt): Likewise.
2416         (_bfd_mips_elf_finish_dynamic_sections): Remove an unncessary call
2417         to mips_elf_rel_dyn_section.  Use a VxWorks-specific value of
2418         DT_PLTGOT.  Handle DT_RELA, DT_RELASZ, DT_RELAENT, DT_PLTREL,
2419         DT_PLTRELSZ and DT_JMPREL.  Update the uses of MIPS_RESERVED_GOTNO
2420         and mips_elf_rel_dyn_section.  Use a different GOT header for
2421         VxWorks.  Don't sort .rela.dyn on VxWorks.  Finish the PLT on VxWorks.
2422         (_bfd_mips_elf_link_hash_table_create): Initialize the new
2423         mips_elf_link_hash_table fields.
2424         (_bfd_mips_vxworks_link_hash_table_create): New function.
2425         (_bfd_mips_elf_final_link): Set the GP value to _GLOBAL_OFFSET_TABLE_
2426         on VxWorks.  Update the call to ELF_MIPS_GP_OFFSET.
2427         * elfxx-mips.h (_bfd_mips_vxworks_adjust_dynamic_symbol): Declare.
2428         (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise.
2429         (_bfd_mips_vxworks_link_hash_table_create): Likewise.
2430         * libbfd.h: Regenerate.
2431         * Makefile.am (elfxx-mips.lo): Depend on elf-vxworks.h.
2432         (elf32-mips.lo): Likewise.
2433         * Makefile.in: Regenerate.
2434         * reloc.c (BFD_RELOC_MIPS_COPY, BFD_RELOC_MIPS_JUMP_SLOT): Declare.
2435         * targets.c (bfd_elf32_bigmips_vxworks_vec): Declare.
2436         (bfd_elf32_littlemips_vxworks_vec): Likewise.
2437         (_bfd_target_vector): Add entries for them.
2438
2439 2006-03-19  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
2440
2441         * elf64-hppa.c (elf64_hppa_special_sections): Change flags for .tbss
2442         section from SHF_PARISC_WEAKORDER to SHF_HP_TLS.
2443         (elf_backend_special_sections): Remove #undef.
2444
2445 2006-03-18  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
2446
2447         * elf64-hppa.c (allocate_global_data_opd): Don't create an OPD entry
2448         for undefined weak symbols.
2449
2450 2006-03-17  Daniel Jacobowitz  <dan@codesourcery.com>
2451
2452         PR ld/2462
2453         * elflink.c (bfd_elf_final_link): Remove
2454         bed->elf_backend_emit_relocs from emit_relocs.
2455
2456 2006-03-17  Alexandre Oliva  <aoliva@redhat.com>
2457
2458         * elf32-ppc.c (ppc_elf_relocate_section): Copy addend from
2459         first relocation to the second when relaxing TLS GD to LE;
2460         zero it out when relaxing to IE.
2461
2462 2006-03-17  Alan Modra  <amodra@bigpond.net.au>
2463
2464         PR 2434
2465         * elflink.c (elf_link_add_object_symbols): Save and restore
2466         warning sym's linked sym.
2467
2468 2006-03-16  Alan Modra  <amodra@bigpond.net.au>
2469
2470         PR 2434
2471         * elflink.c (struct elf_smash_syms_data, elf_smash_syms): Delete.
2472         (elf_link_add_object_symbols): Delete unnecessary locals.  Rename
2473         hash_table -> htab.  Formatting.  Save entire symbol table
2474         before loading as-needed syms, and restore afterwards if lib not
2475         needed.  Use bfd_hash_allocate rather than bfd_alloc for sym
2476         name.  Free some buffers earlier.
2477         * bfd-in.h (struct bfd_hash_table): Add entsize.
2478         (bfd_hash_table_init, bfd_hash_table_init_n): Adjust prototype.
2479         * elf-bfd.h (_bfd_elf_link_hash_table_init): Likewise
2480         * hash.c (bfd_hash_table_init_n): Add entsize param, save to
2481         hash table.
2482         (bfd_hash_table_init): Add param, adjust calls.
2483         * aoutx.h: Adjust all hash_table_init functions and calls.
2484         * bfd.c: Likewise.
2485         * coff-arm.c: Likewise.
2486         * coff-h8300.c: Likewise.
2487         * coff-ppc.c: Likewise.
2488         * cofflink.c: Likewise.
2489         * ecoff.c: Likewise.
2490         * ecofflink.c: Likewise.
2491         * elf-m10300.c: Likewise.
2492         * elf-strtab.c: Likewise.
2493         * elf.c: Likewise.
2494         * elf32-arm.c: Likewise.
2495         * elf32-bfin.c: Likewise.
2496         * elf32-cris.c: Likewise.
2497         * elf32-frv.c: Likewise.
2498         * elf32-hppa.c: Likewise.
2499         * elf32-i386.c: Likewise.
2500         * elf32-m32r.c: Likewise.
2501         * elf32-m68hc1x.c: Likewise.
2502         * elf32-m68k.c: Likewise.
2503         * elf32-ppc.c: Likewise.
2504         * elf32-s390.c: Likewise.
2505         * elf32-sh.c: Likewise.
2506         * elf32-vax.c: Likewise.
2507         * elf64-alpha.c: Likewise.
2508         * elf64-hppa.c: Likewise.
2509         * elf64-ppc.c: Likewise.
2510         * elf64-s390.c: Likewise.
2511         * elf64-sh64.c: Likewise.
2512         * elf64-x86-64.c: Likewise.
2513         * elfxx-ia64.c: Likewise.
2514         * elfxx-mips.c: Likewise.
2515         * elfxx-sparc.c: Likewise.
2516         * i386linux.c: Likewise.
2517         * libaout.h: Likewise.
2518         * libbfd-in.h: Likewise.
2519         * libcoff-in.h: Likewise.
2520         * linker.c: Likewise.
2521         * m68klinux.c: Likewise.
2522         * merge.c: Likewise.
2523         * opncls.c: Likewise.
2524         * pdp11.c: Likewise.
2525         * sparclinux.c: Likewise.
2526         * stabs.c: Likewise.
2527         * sunos.c: Likewise.
2528         * vms.c: Likewise.
2529         * xcofflink.c: Likewise.
2530         * section.c (struct section_hash_entry): Move to..
2531         * libbfd-in.h: ..here.
2532         * Makefile.am: Run "make dep-am"
2533         * Makefile.in: Regenerate.
2534         * bfd-in2.h: Regenerate.
2535         * libbfd.h: Regenerate.
2536         * libcoff.h: Regenerate.
2537
2538 2006-03-16  Alan Modra  <amodra@bigpond.net.au>
2539
2540         * elf32-ppc.c (ppc_elf_check_relocs): REL24 and REL14 relocs
2541         against __GLOBAL_OFFSET_TABLE__ need never be dynamic.  Tweak
2542         last change to REL32 relocs so that they are counted as
2543         possibly dynamic as per REL24 and REL14.
2544
2545 2006-03-16  Alan Modra  <amodra@bigpond.net.au>
2546
2547         * elf32-ppc.c (ppc_elf_check_relocs): Don't fall into REL24
2548         checks from REL32.
2549
2550 2006-03-15  Ben Elliston  <bje@au.ibm.com>
2551
2552         * elf32-arm.c (elf32_arm_merge_eabi_attributes): Iterate over all
2553         in_list elements, not just the first.
2554
2555 2006-03-14  Richard Sandiford  <richard@codesourcery.com>
2556
2557         * elf32-mips.c (mips_elf_adjust_addend): New function, mostly split
2558         out from...
2559         (_bfd_mips_elf_relocate_section): ...here.  Use it to adjust r_addend
2560         for final links too.
2561
2562 2006-03-13  Richard Sandiford  <richard@codesourcery.com>
2563
2564         * elfxx-mips.c (mips_elf_create_got_section): Initialize hgot.
2565
2566 2006-03-11  H.J. Lu  <hongjiu.lu@intel.com>
2567
2568         PR ld/2443
2569         * dwarf2.c (concat_filename): Don't issue an error if file is 0.
2570
2571 2006-03-10  Paul Brook  <paul@codesourcery.com>
2572
2573         * elf32-arm.c (INTERWORK_FLAG): Handle EABIv5.
2574         (elf32_arm_print_private_bfd_data): Ditto.
2575
2576 2006-03-09  Paul Brook  <paul@codesourcery.com>
2577
2578         * cpu-arm.c (bfd_is_arm_mapping_symbol_name): Recognise additional
2579         mapping symbols.
2580
2581 2006-03-09  Khem Raj  <khem@mvista.com>
2582
2583         * elf32-arm.c(elf32_arm_finish_dynamic_sections): Use unsigned
2584         char type.
2585
2586 2006-03-08  H.J. Lu  <hongjiu.lu@intel.com>
2587
2588         * elfxx-ia64.c (elfNN_ia64_choose_gp): Properly choose gp.
2589
2590 2006-03-07  Richard Sandiford  <richard@codesourcery.com>
2591             Daniel Jacobowitz  <dan@codesourcery.com>
2592             Zack Weinberg  <zack@codesourcery.com>
2593             Nathan Sidwell  <nathan@codesourcery.com>
2594             Paul Brook  <paul@codesourcery.com>
2595             Ricardo Anguiano  <anguiano@codesourcery.com>
2596             Phil Edwards  <phil@codesourcery.com>
2597
2598         * configure.in (bfd_elf32_bigarm_vec): Include elf-vxworks.lo.
2599         (bfd_elf32_bigarm_symbian_vec): Likewise.
2600         (bfd_elf32_bigarm_vxworks_vec): Likewise.
2601         (bfd_elf32_littlearm_vec): Likewise.
2602         (bfd_elf32_littlearm_symbian_vec): Likewise.
2603         (bfd_elf32_littlearm_vxworks_vec): Likewise.
2604         * configure: Regenerate.
2605         * elf32-arm.c: Include libiberty.h and elf-vxworks.h.
2606         (RELOC_SECTION, RELOC_SIZE, SWAP_RELOC_IN, SWAP_RELOC_OUT): New macros.
2607         (elf32_arm_vxworks_bed): Add forward declaration.
2608         (elf32_arm_howto_table_1): Fix the masks for R_ASM_ABS12.
2609         (elf32_arm_vxworks_exec_plt0_entry): New table.
2610         (elf32_arm_vxworks_exec_plt_entry): Likewise.
2611         (elf32_arm_vxworks_shared_plt_entry): Likewise.
2612         (elf32_arm_link_hash_table): Add vxworks_p and srelplt2 fields.
2613         (reloc_section_p): New function.
2614         (create_got_section): Use RELOC_SECTION.
2615         (elf32_arm_create_dynamic_sections): Likewise.  Call
2616         elf_vxworks_create_dynamic_sections for VxWorks targets.
2617         Choose between the two possible values of plt_header_size
2618         and plt_entry_size.
2619         (elf32_arm_link_hash_table_create): Initialize vxworks_p and srelplt2.
2620         (elf32_arm_abs12_reloc): New function.
2621         (elf32_arm_final_link_relocate): Call it.  Allow the creation of
2622         dynamic R_ARM_ABS12 relocs on VxWorks.  Use reloc_section_p,
2623         RELOC_SIZE, SWAP_RELOC_OUT and RELOC_SECTION.  Initialize the
2624         r_addend fields of relocs.  On rela targets, skip any code that
2625         adjusts in-place addends.  When using _bfd_link_final_relocate
2626         to perform a final relocation, pass rel->r_addend as the addend
2627         argument.
2628         (elf32_arm_merge_private_bfd_data): If one of the bfds is a VxWorks
2629         object, ignore flags that are not standard on VxWorks.
2630         (elf32_arm_check_relocs): Allow the creation of dynamic R_ARM_ABS12
2631         relocs on VxWorks.  Use reloc_section_p.
2632         (elf32_arm_adjust_dynamic_symbol): Use RELOC_SECTION and RELOC_SIZE.
2633         (allocate_dynrelocs): Use RELOC_SIZE.  Account for the size of
2634         .rela.plt.unloaded relocs on VxWorks targets.
2635         (elf32_arm_size_dynamic_sections): Use RELOC_SIZE.  Check for
2636         .rela.plt.unloaded as well as .rel(a).plt.  Add DT_RELA* tags
2637         instead of DT_REL* tags on RELA targets.
2638         (elf32_arm_finish_dynamic_symbol): Use RELOC_SECTION, RELOC_SIZE
2639         and SWAP_RELOC_OUT.  Initialize r_addend fields.  Handle VxWorks
2640         PLT entries.  Do not make _GLOBAL_OFFSET_TABLE_ absolute on VxWorks.
2641         (elf32_arm_finish_dynamic_sections): Use RELOC_SECTION, RELOC_SIZE
2642         and SWAP_RELOC_OUT.  Initialize r_addend fields.  Handle DT_RELASZ
2643         like DT_RELSZ.  Handle the VxWorks form of initial PLT entry.
2644         Correct the .rela.plt.unreloaded symbol indexes.
2645         (elf32_arm_output_symbol_hook): Call the VxWorks version of this
2646         hook on VxWorks targets.
2647         (elf32_arm_vxworks_link_hash_table_create): Set vxworks_p to true.
2648         Minor formatting tweak.
2649         (elf32_arm_vxworks_final_write_processing): New function.
2650         (elf_backend_add_symbol_hook): Override for VxWorks and reset
2651         for Symbian.
2652         (elf_backend_final_write_processing): Likewise.
2653         (elf_backend_emit_relocs): Likewise.
2654         (elf_backend_want_plt_sym): Likewise.
2655         (ELF_MAXPAGESIZE): Likewise.
2656         (elf_backend_may_use_rel_p): Minor formatting tweak.
2657         (elf_backend_may_use_rela_p): Likewise.
2658         (elf_backend_default_use_rela_p): Likewise.
2659         (elf_backend_rela_normal): Likewise.
2660         * Makefile.in (elf32-arm.lo): Depend on elf-vxworks.h.
2661
2662 2006-03-06  Nathan Sidwell  <nathan@codesourcery.com>
2663
2664         * archures.c (bfd_mach_mcf_isa_a_nodiv, bfd_mach_mcf_isa_b_nousp):
2665         New.  Adjust other variants.
2666         (bfd_default_scan): Update.
2667         * bfd-in2.h: Rebuilt.
2668         * cpu-m68k.c: Adjust.
2669         (bfd_m68k_compatible): New. Use it for architectures.
2670         * elf32-m68k.c (elf32_m68k_object_p): Adjust.
2671         (elf32_m68k_merge_private_bfd_data): Adjust.  Correct isa-a/b
2672         mismatch.
2673         (elf32_m68k_print_private_bfd_data): Adjust.
2674         * ieee.c (ieee_write_processor): Adjust.
2675
2676 2006-03-06  Alan Modra  <amodra@bigpond.net.au>
2677
2678         * dwarf2.c: Formatting.
2679         (add_line_info): Remove outer loop.
2680
2681 2006-03-05  H.J. Lu  <hongjiu.lu@intel.com>
2682             Alan Modra  <amodra@bigpond.net.au>
2683
2684         PR binutils/2338
2685         * dwarf2.c (loadable_section): New struct.
2686         (dwarf2_debug): Add loadable_section_count and
2687         loadable_sections.
2688         (new_line_sorts_after): New.
2689         (add_line_info): Use new_line_sorts_after to compare line
2690         addresses.
2691         (check_function_name): Removed.
2692         (unset_sections): New.
2693         (place_sections): New.
2694         (_bfd_dwarf2_find_nearest_line): Updated. Call place_sections
2695         and unset_sections on relocatable files.
2696         (_bfd_dwarf2_find_line): Likewise.
2697
2698 2006-03-03  Nick Clifton  <nickc@redhat.com>
2699
2700         * cpu-avr.c: Update to ISO-C90 formatting.
2701         * elf32-avr.c: Likewise.
2702
2703 2006-03-03  Bjoern Haase  <bjoern.m.haase@web.de>
2704
2705         * elf32-avr.c (avr_reloc_map): Insert BFD_RELOC_AVR_MS8_LDI
2706         and R_AVR_MS8_LDI
2707         (bfd_elf_avr_final_write_processing): Set
2708         EF_AVR_LINKRELAX_PREPARED in e_flags field.
2709         (elf32_avr_relax_section): New function.
2710         (elf32_avr_relax_delete_bytes): New function.
2711         (elf32_avr_get_relocated_section_contents): New function.
2712         (avr_pc_wrap_around): New function.
2713         (avr_relative_distance_considering_wrap_around): New function.
2714         (avr_final_link_relocate): Handle negative int8t_t immediate for R_AVR_LDI.
2715         * reloc.c: Add BFD_RELOC_AVR_MS8_LDI and BFD_RELOC_AVR_LDI_NEG
2716         * libbfd.h: Regenerate.
2717         * bfd-in2.h: Regenerate.
2718
2719 2006-03-02  DJ Delorie  <dj@redhat.com>
2720
2721         * elf32-m32c.c (m32c_offset_for_reloc): Fix local symbol
2722         calculations.
2723
2724 2006-03-02  Richard Sandiford  <richard@codesourcery.com>
2725
2726         * elf32-ppc.c (is_ppc_elf_target): Return true if the target is
2727         bfd_elf32_powerpc_vxworks_vec.
2728
2729 2006-03-02  Nick Clifton  <nickc@redhat.com>
2730
2731         * elf32-m32c.c (m32c_elf_relax_section): Initialise 'gap'.
2732
2733 2006-03-02  Richard Sandiford  <richard@codesourcery.com>
2734
2735         * elf32-i386.c (elf_i386_create_dynamic_sections): Use
2736         elf_vxworks_create_dynamic_sections.
2737         (elf_i386_size_dynamic_sections): Remove VxWorks GOT and PLT
2738         symbol handling.
2739         * elf32-ppc.c (ppc_elf_create_dynamic_sections): Use
2740         elf_vxworks_create_dynamic_sections.
2741         (ppc_elf_size_dynamic_sections): Remove VxWorks GOT and PLT
2742         symbol handling.
2743         * elf-vxworks.c (elf_vxworks_create_dynamic_sections): New function.
2744         * elf-vxworks.h (elf_vxworks_create_dynamic_sections): Declare.
2745
2746 2006-03-02  Richard Sandiford  <richard@codesourcery.com>
2747
2748         * elf32-i386.c (elf_i386_vxworks_link_output_symbol_hook): Delete.
2749         (elf_backend_link_output_symbol_hook): Use
2750         elf_vxworks_link_output_symbol_hook instead.
2751         * elf32-ppc.c (elf_i386_vxworks_link_output_symbol_hook): Delete.
2752         (elf_backend_link_output_symbol_hook): Use
2753         elf_vxworks_link_output_symbol_hook instead.
2754         * elf-vxworks.c (elf_vxworks_link_output_symbol_hook): Provide the
2755         same interface as elf_backend_link_output_symbol_hook.
2756         * elf-vxworks.h (elf_vxworks_link_output_symbol_hook): Update
2757         prototype accordingly.
2758
2759 2006-03-02  Richard Sandiford  <richard@codesourcery.com>
2760
2761         * elf32-ppc.c (ppc_elf_plt_type): New enumeration.
2762         (ppc_elf_link_hash_table): Replace old_got and new_got with
2763         plt_type and can_use_new_plt.
2764         (ppc_elf_create_dynamic_sections): Add SEC_HAS_CONTENTS,
2765         SEC_LOAD and SEC_READONLY to the VxWorks .plt flags.
2766         (ppc_elf_check_relocs): Set can_use_new_plt instead of new_plt.
2767         Move from plt_type == PLT_UNSET to PLT_OLD instead of setting old_plt.
2768         (ppc_elf_select_plt_layout): Move from plt_type == PLT_UNSET to
2769         either plt_type == PLT_OLD or plt_type == PLT_NEW.  Assert that
2770         this function should not be called for VxWorks targets.
2771         (ppc_elf_tls_setup): Use plt_type instead of old_got.
2772         (allocate_got): Likewise.  Rearrange so that max_before_header
2773         is only used for PLT_OLD and PLT_NEW.
2774         (allocate_dynrelocs): Use plt_type instead of old_got and is_vxworks.
2775         (ppc_elf_size_dynamic_sections): Likewise.
2776         (ppc_elf_relax_section): Likewise.
2777         (ppc_elf_relocate_section): Likewise.
2778         (ppc_elf_finish_dynamic_symbol): Likewise.
2779         (ppc_elf_vxworks_link_hash_table_create): Initialize plt_type.
2780
2781 2006-02-28  Richard Sandiford  <richard@codesourcery.com>
2782
2783         * elf32-i386.c (elf_i386_link_hash_table): Add next_tls_desc_index.
2784         (elf_i386_link_hash_table_create): Initialize it.
2785         (elf_i386_compute_jump_table_size): Use it instead of
2786         srelplt->reloc_count.
2787         (allocate_dynrelocs): Likewise.
2788         (elf_i386_size_dynamic_sections): Likewise.
2789         (elf_i386_relocate_section): Likewise.
2790
2791 2006-02-27  Jakub Jelinek  <jakub@redhat.com>
2792
2793         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Handle S flag.
2794         (_bfd_elf_write_section_eh_frame): Likewise.
2795
2796 2006-02-27  Carlos O'Donell  <carlos@codesourcery.com>
2797
2798         * po/Make-in: Add html target.
2799
2800 2006-02-27  Richard Sandiford  <richard@codesourcery.com>
2801
2802         * elf-m10300.c (_bfd_mn10300_elf_finish_dynamic_symbol): Use the
2803         cached hgot entry to check for _GLOBAL_OFFSET_TABLE_.
2804         * elf32-arm.c (elf32_arm_finish_dynamic_symbol): Likewise.
2805         * elf32-bfin.c (bfin_finish_dynamic_symbol): Likewise.
2806         * elf32-cris.c (elf_cris_finish_dynamic_symbol): Likewise.
2807         * elf32-hppa.c (elf32_hppa_finish_dynamic_symbol): Likewise.
2808         * elf32-i386.c (elf_i386_finish_dynamic_symbol): Likewise.
2809         * elf32-m32r.c (m32r_elf_finish_dynamic_symbol): Likewise.
2810         * elf32-m68k.c (elf_m68k_finish_dynamic_symbol): Likewise.
2811         * elf32-sh.c (sh_elf_finish_dynamic_symbol): Likewise.
2812         * elf32-vax.c (elf_vax_finish_dynamic_symbol): Likewise.
2813         * elf32-xtensa.c (elf_xtensa_finish_dynamic_symbol): Likewise.
2814         * elf64-sh64.c (sh64_elf64_finish_dynamic_symbol): Likewise.
2815         * elf64-x86-64.c (elf64_x86_64_finish_dynamic_symbol): Likewise.
2816         * elfxx-mips.c (_bfd_mips_elf_finish_dynamic_symbol): Likewise.
2817         * elf32-s390.c (elf_s390_finish_dynamic_symbol): Likewise.  Also use
2818         the cached hplt entry to check for _PROCEDURE_LINKAGE_TABLE_.
2819         * elf64-alpha.c (elf64_alpha_finish_dynamic_symbol): Likewise.
2820         * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
2821         * elfxx-ia64.c (elfNN_ia64_finish_dynamic_symbol): Likewise.
2822         * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Likewise.
2823
2824 2006-02-25  Richard Sandiford  <richard@codesourcery.com>
2825
2826         * elf-bfd.h (elf_link_hash_table): Add hplt field.
2827         * elflink.c (_bfd_elf_create_dynamic_sections): Initialize it.
2828         * elf-m10300.c (_bfd_mn10300_elf_create_got_section): Likewise.
2829         * elf32-frv.c (_frv_create_got_section): Likewise.
2830         * elf32-m32r.c (m32r_elf_create_dynamic_sections): Likewise.
2831         * elf32-sh.c (sh_elf_create_dynamic_sections): Likewise.
2832         * elf64-alpha.c (elf64_alpha_create_dynamic_sections): Likewise.
2833         * elf64-sh64.c (sh64_elf64_create_dynamic_sections): Likewise.
2834         * elf32-i386.c (elf_i386_link_hash_table): Remove hgot and hplt.
2835         (elf_i386_link_hash_table_create): Don't initialize them.
2836         (elf_i386_size_dynamic_sections): Use the generic ELF hplt and
2837         hgot fields.
2838         (elf_i386_finish_dynamic_symbol): Likewise.
2839         * elf32-ppc.c (ppc_elf_link_hash_table): Remove hplt.
2840         (ppc_elf_size_dynamic_sections): Use the generic ELF hplt fields.
2841         (ppc_elf_finish_dynamic_symbol): Likewise.
2842
2843 2006-02-24  DJ Delorie  <dj@redhat.com>
2844
2845         * elf32-m32c.c (m32c_elf_howto_table): Add relaxation relocs.
2846         (m32c_elf_relocate_section): Don't relocate them.
2847         (compare_reloc): New.
2848         (relax_reloc): Remove.
2849         (m32c_offset_for_reloc): New.
2850         (m16c_addr_encodings): New.
2851         (m16c_jmpaddr_encodings): New.
2852         (m32c_addr_encodings): New.
2853         (m32c_elf_relax_section): Relax jumps and address displacements.
2854         (m32c_elf_relax_delete_bytes): Adjust for internal syms.  Fix up
2855         short jumps.
2856
2857         * reloc.c: Add m32c relax relocs.
2858         * libbfd.h: Regenerate.
2859         * bfd-in2.h: Regenerate.
2860
2861 2006-02-24  H.J. Lu  <hongjiu.lu@intel.com>
2862
2863         PR ld/2218
2864         * elf-bfd.h (elf_backend_data): Add elf_backend_fixup_symbol.
2865         (_bfd_elf_link_hash_fixup_symbol): New.
2866
2867         * elflink.c (_bfd_elf_link_hash_fixup_symbol): New.
2868         (_bfd_elf_fix_symbol_flags): Call elf_backend_fixup_symbol if
2869         it isn't NULL.
2870
2871         * elfxx-ia64.c (elf_backend_fixup_symbol): Defined.
2872
2873         * elfxx-target.h (elf_backend_fixup_symbol): New.
2874         (elfNN_bed): Initialize elf_backend_fixup_symbol.
2875
2876 2006-02-23  H.J. Lu  <hongjiu.lu@intel.com>
2877
2878         * cpu-ia64-opc.c (ins_immu5b): New.
2879         (ext_immu5b): Likewise.
2880         (elf64_ia64_operands): Add IMMU5b.
2881
2882 2006-02-21  Alan Modra  <amodra@bigpond.net.au>
2883
2884         PR ld/2218
2885         * elf32-arm.c (allocate_dynrelocs): Ensure undef weak sym in pie
2886         is dynamic.
2887         * elf32-hppa.c (allocate_dynrelocs): Likewise.
2888         * elf32-i386.c (allocate_dynrelocs): Likewise.
2889         * elf32-s390.c (allocate_dynrelocs): Likewise.
2890         * elf32-sh.c (allocate_dynrelocs): Likewise.
2891         * elf64-s390.c (allocate_dynrelocs): Likewise.
2892         * elf64-x86-64.c (allocate_dynrelocs): Likewise.
2893         * elf32-m32r.c (allocate_dynrelocs): Likewise.  Discard relocs
2894         on undef weak with non-default visibility too.
2895         * elfxx-sparc.c (allocate_dynrelocs): Ditto.
2896
2897 2006-02-21  Alan Modra  <amodra@bigpond.net.au>
2898
2899         * bfd.c: (_bfd_default_error_handler): Don't call abort on
2900         error, instead call _exit.
2901         (_bfd_abort): Call _exit not xexit.
2902
2903 2006-02-17  Kevin Buettner  <kevinb@redhat.com>
2904
2905         * elf32-frv.c (elf32_frv_grok_prstatus, elf32_frv_grok_psinfo):
2906         New functions.
2907         * elf_backend_grok_prstatus, elf_backend_grok_psinfo): Define.
2908
2909 2006-02-17  Shrirang Khisti  <shrirangk@kpitcummins.com>
2910             Anil Paranjape  <anilp1@kpitcummins.com>
2911             Shilin Shakti  <shilins@kpitcummins.com>
2912
2913         * Makefile.am: Add xc16x related entry
2914         * Makefile.in: Regenerate
2915         * archures.c: Add bfd_xc16x_arch
2916         * bfd-in2.h: Regenerate
2917         * config.bfd: Add xc16x-*-elf
2918         * configure.in: Add bfd_elf32_xc16x_vec
2919         * configure: Regenerate.
2920         * targets.c: Added xc16x related information
2921         * cpu-xc16x.c: New file
2922         * reloc.c: Add new relocations specific to xc16x:
2923         BFD_RELOC_XC16X_PAG, BFD_RELOC_XC16X_POF, BFD_RELOC_XC16X_SEG,
2924         BFD_RELOC_XC16X_SOF
2925         * elf32-xc16x.c: New file.
2926
2927 2006-02-17  Alan Modra  <amodra@bigpond.net.au>
2928
2929         * elf32-ppc.c (allocate_dynrelocs): Tweak undef weak handling.
2930         * elf64-ppc.c (allocate_dynrelocs): Likewise.
2931
2932 2006-02-17  Alan Modra  <amodra@bigpond.net.au>
2933
2934         PR ld/2218
2935         * elf64-ppc.c (allocate_dynrelocs): Ensure undef weak sym is
2936         dynamic.
2937         (ppc64_elf_relocate_section): Check output reloc section size.
2938         * elf32-ppc.c (allocate_dynrelocs): Simplify undef weak test.
2939
2940 2006-02-16  H.J. Lu  <hongjiu.lu@intel.com>
2941
2942         PR ld/2322
2943         * elf.c (get_segment_type): New function.
2944         (_bfd_elf_print_private_bfd_data): Use it.
2945         (print_segment_map): New function.
2946         (assign_file_positions_for_segments): Call print_segment_map
2947         when there are not enough room for program headers.
2948
2949 2006-02-16  Nick Hudson  <nick.hudson@dsl.pipex.com>
2950
2951         * config.bfd (mips*el-*-netbsd*, mips*-*-netbsd*): Use
2952         traditional MIPS ELF targets.
2953
2954 2006-02-15  H.J. Lu  <hongjiu.lu@intel.com>
2955
2956         PR binutils/2338
2957         * dwarf2.c (check_function_name): New function.
2958         (_bfd_dwarf2_find_nearest_line): Use check_function_name to
2959         check if function is correct.
2960
2961 2006-02-16  Alan Modra  <amodra@bigpond.net.au>
2962
2963         * elflink.c (_bfd_elf_default_action_discarded): Return 0 for
2964         debug sections.
2965         (elf_link_input_bfd): Adjust comments.
2966
2967 2006-02-10  H.J. Lu  <hongjiu.lu@intel.com>
2968
2969         * elf.c (copy_private_bfd_data): Minor update.
2970
2971 2006-02-10  H.J. Lu  <hongjiu.lu@intel.com>
2972
2973         PR binutils/2258
2974         * elf.c (copy_private_bfd_data): Renamed to ...
2975         (rewrite_elf_program_header): This.
2976         (copy_elf_program_header): New function.
2977         (copy_private_bfd_data): Likewise.
2978
2979 2006-02-07  Nathan Sidwell  <nathan@codesourcery.com>
2980
2981         * archures.c (bfd_mach_mcf5200, bfd_mach_mcf5206e,
2982         bfd_mach_mcf5307, bfd_mach_mcf5407, bfd_mach_mcf528x,
2983         bfd_mach_mcfv4e, bfd_mach_mcf521x, bfd_mach_mcf5249,
2984         bfd_mach_mcf547x, bfd_mach_mcf548x): Remove.
2985         (bfd_mach_mcf_isa_a, bfd_mach_mcf_isa_a_div,
2986         bfd_mach_mcf_isa_a_div_mac, bfd_mach_mcf_isa_a_div_emac,
2987         bfd_mach_mcf_isa_aplus, bfd_mach_mcf_isa_aplus_mac,
2988         bfd_mach_mcf_isa_aplus_emac, bfd_mach_mcf_isa_aplus_usp,
2989         bfd_mach_mcf_isa_aplus_usp_mac, bfd_mach_mcf_isa_aplus_usp_emac,
2990         bfd_mach_mcf_isa_b, bfd_mach_mcf_isa_b_mac, bfd_mach_mcf_isa_b_emac,
2991         bfd_mach_mcf_isa_b_usp_float, bfd_mach_mcf_isa_b_usp_float_mac,
2992         bfd_mach_mcf_isa_b_usp_float_emac): New.
2993         (bfd_default_scan): Update coldfire mapping.
2994         * bfd-in.h (bfd_m68k_mach_to_features,
2995         bfd_m68k_features_to_mach): Declare.
2996         * bfd-in2.h: Rebuilt.
2997         * cpu-m68k.c (arch_info_struct): Add new coldfire machines,
2998         adjust legacy names.
2999         (m68k_arch_features): New.
3000         (bfd_m68k_mach_to_features,
3001         bfd_m68k_features_to_mach): Define.
3002         * elf32-m68k.c (elf32_m68k_object_p): New.
3003         (elf32_m68k_merge_private_bfd_data): Merge the CF EF flags.
3004         (elf32_m68k_print_private_bfd_data): Print the CF EF flags.
3005         (elf_backend_object_p): Define.
3006         * ieee.c (ieee_write_processor): Update coldfire machines.
3007         * libbfd.h: Rebuilt.
3008
3009 2006-02-06  Steve Ellcey  <sje@cup.hp.com>
3010
3011         * elfxx-ia64.c (elfNN_ia64_fake_sections): Set SHF_IA_64_HP_TLS
3012         if SHF_TLS is set.
3013
3014 2006-02-05  Arnold Metselaar  <arnold.metselaar@planet.nl>
3015
3016         * coff-z80.c (r_imm24): New howto.
3017         (rtype2howto): New case R_IMM24.
3018         (coff_z80_reloc_type_lookup): New case BFD_RELOC_24.
3019         (extra_case): Use bfd_get_8 for R_IMM8, new case R_IMM24.
3020
3021 2006-02-04  Richard Sandiford  <richard@codesourcery.com>
3022
3023         * elfxx-mips.c (mips_elf_initialize_tls_index): If a TLS symbol
3024         has already been assigned a GOT index, copy that index to the
3025         current hash table entry.
3026
3027 2006-02-01  Eric Botcazou  <ebotcazou@libertysurf.fr>
3028
3029         * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Reinstate bypass
3030         for call-to-undefweak reloc overflow.
3031
3032 2006-01-31  Eric Botcazou  <ebotcazou@libertysurf.fr>
3033
3034         * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Reinstate bypass
3035         for 32-bit relocs overflow.
3036
3037 2006-01-27  Paul Brook  <paul@codesourcery.com>
3038
3039         * elf32-arm.c (elf32_arm_get_symbol_type): Allow STT_TLS thumb
3040         objects.
3041
3042 2006-01-18  Alexandre Oliva  <aoliva@redhat.com>
3043
3044         Introduce TLS descriptors for i386 and x86_64.
3045         * reloc.c (BFD_RELOC_386_TLS_GOTDESC, BFD_RELOC_386_TLS_DESC,
3046         BFD_RELOC_386_TLS_DESC_CALL, BFD_RELOC_X86_64_GOTPC32_TLSDESC,
3047         BFD_RELOC_X86_64_TLSDESC, BFD_RELOC_X86_64_TLSDESC_CALL): New.
3048         * libbfd.h, bfd-in2.h: Rebuilt.
3049         * elf32-i386.c (elf_howto_table): New relocations.
3050         (R_386_tls): Adjust.
3051         (elf_i386_reloc_type_lookup): Map new relocations.
3052         (GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P): New macros.
3053         (GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): New macros.
3054         (struct elf_i386_link_hash_entry): Add tlsdesc_got field.
3055         (struct elf_i386_obj_tdata): Add local_tlsdesc_gotent field.
3056         (elf_i386_local_tlsdesc_gotent): New macro.
3057         (struct elf_i386_link_hash_table): Add sgotplt_jump_table_size.
3058         (elf_i386_compute_jump_table_size): New macro.
3059         (link_hash_newfunc): Initialize tlsdesc_got.
3060         (elf_i386_link_hash_table_create): Set sgotplt_jump_table_size.
3061         (elf_i386_tls_transition): Handle R_386_TLS_GOTDESC and
3062         R_386_TLS_DESC_CALL.
3063         (elf_i386_check_relocs): Likewise.  Allocate space for
3064         local_tlsdesc_gotent.
3065         (elf_i386_gc_sweep_hook): Handle R_386_TLS_GOTDESC and
3066         R_386_TLS_DESC_CALL.
3067         (allocate_dynrelocs): Count function PLT relocations.  Reserve
3068         space for TLS descriptors and relocations.
3069         (elf_i386_size_dynamic_sections): Reserve space for TLS
3070         descriptors and relocations.  Set up sgotplt_jump_table_size.
3071         Don't zero reloc_count in srelplt.
3072         (elf_i386_always_size_sections): New.  Set up _TLS_MODULE_BASE_.
3073         (elf_i386_relocate_section): Handle R_386_TLS_GOTDESC and
3074         R_386_TLS_DESC_CALL.
3075         (elf_i386_finish_dynamic_symbol): Use GOT_TLS_GD_ANY_P.
3076         (elf_backend_always_size_sections): Define.
3077         * elf64-x86-64.c (x86_64_elf_howto): Add R_X86_64_GOTPC32_TLSDESC,
3078         R_X86_64_TLSDESC, R_X86_64_TLSDESC_CALL.
3079         (R_X86_64_standard): Adjust.
3080         (x86_64_reloc_map): Map new relocs.
3081         (elf64_x86_64_rtype_to_howto): New, split out of...
3082         (elf64_x86_64_info_to_howto): ... this function, and...
3083         (elf64_x86_64_reloc_type_lookup): ... use it to map elf_reloc_val.
3084         (GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P): New macros.
3085         (GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): New macros.
3086         (struct elf64_x86_64_link_hash_entry): Add tlsdesc_got field.
3087         (struct elf64_x86_64_obj_tdata): Add local_tlsdesc_gotent field.
3088         (elf64_x86_64_local_tlsdesc_gotent): New macro.
3089         (struct elf64_x86_64_link_hash_table): Add tlsdesc_plt,
3090         tlsdesc_got and sgotplt_jump_table_size fields.
3091         (elf64_x86_64_compute_jump_table_size): New macro.
3092         (link_hash_newfunc): Initialize tlsdesc_got.
3093         (elf64_x86_64_link_hash_table_create): Initialize new fields.
3094         (elf64_x86_64_tls_transition): Handle R_X86_64_GOTPC32_TLSDESC and
3095         R_X86_64_TLSDESC_CALL.
3096         (elf64_x86_64_check_relocs): Likewise.  Allocate space for
3097         local_tlsdesc_gotent.
3098         (elf64_x86_64_gc_sweep_hook): Handle R_X86_64_GOTPC32_TLSDESC and
3099         R_X86_64_TLSDESC_CALL.
3100         (allocate_dynrelocs): Count function PLT relocations.  Reserve
3101         space for TLS descriptors and relocations.
3102         (elf64_x86_64_size_dynamic_sections): Reserve space for TLS
3103         descriptors and relocations.  Set up sgotplt_jump_table_size,
3104         tlsdesc_plt and tlsdesc_got.  Make room for them.  Don't zero
3105         reloc_count in srelplt.  Add dynamic entries for DT_TLSDESC_PLT
3106         and DT_TLSDESC_GOT.
3107         (elf64_x86_64_always_size_sections): New.  Set up
3108         _TLS_MODULE_BASE_.
3109         (elf64_x86_64_relocate_section): Handle R_386_TLS_GOTDESC and
3110         R_386_TLS_DESC_CALL.
3111         (elf64_x86_64_finish_dynamic_symbol): Use GOT_TLS_GD_ANY_P.
3112         (elf64_x86_64_finish_dynamic_sections): Set DT_TLSDESC_PLT and
3113         DT_TLSDESC_GOT.  Set up TLS descriptor lazy resolver PLT entry.
3114         (elf_backend_always_size_sections): Define.
3115
3116 2006-01-17  H.J. Lu  <hongjiu.lu@intel.com>
3117
3118         PR binutils/2096
3119         * dwarf2.c (comp_unit_contains_address): Update comment.
3120         (_bfd_dwarf2_find_nearest_line): Use section's vma, instead of
3121         lma.  Return TRUE only if both comp_unit_contains_address and
3122         comp_unit_find_nearest_line return TRUE.
3123         (_bfd_dwarf2_find_line): Use section's vma, instead of lma.
3124
3125 2006-01-18  Alan Modra  <amodra@bigpond.net.au>
3126
3127         * elf-bfd.h (struct elf_backend_data): Add gc_mark_dynamic_ref.
3128         (bfd_elf_gc_mark_dynamic_ref_symbol): Declare.
3129         * elflink.c (bfd_elf_gc_mark_dynamic_ref_symbol): Rename from
3130         elf_gc_mark_dynamic_ref_symbol.  Make global.
3131         (bfd_elf_gc_sections): Call bed->gc_mark_dynamic_ref.
3132         * elfxx-target.h (elf_backend_gc_mark_dynamic_ref): Define.
3133         (elfNN_bed): Init new field.
3134         * elf64-ppc.c (elf_backend_gc_mark_dynamic_ref): Define.
3135         (ppc64_elf_gc_mark_dynamic_ref): New function.
3136
3137 2006-01-17  Alan Modra  <amodra@bigpond.net.au>
3138
3139         * elf64-ppc.c (ppc64_elf_gc_mark_hook): Don't hang forever in loop.
3140
3141 2006-01-17  Nick Clifton  <nickc@redhat.com>
3142
3143         PR binutils/2159
3144         * elf.c (elfcore_write_pstatus): Add ATTRIBUTE_UNUSED to unused
3145         parameters.
3146
3147 2006-01-11  Nick Clifton  <nickc@redhat.com>
3148
3149         * elf32-arm.c (elf32_arm_output_symbol_hook): Install new entry
3150         into the newly (re)allocated map array.
3151
3152 2006-01-09  Alexis Wilke  <alexis_wilke@yahoo.com>
3153
3154         * peXXigen.c (tbl): Add comma after "HIGH3ADJ".
3155
3156 2006-01-01  Jakub Jelinek  <jakub@redhat.com>
3157
3158         * elf64-ppc.c (ppc64_elf_action_discarded): Return 0
3159         for .toc1 section.
3160
3161 For older changes see ChangeLog-2005
3162 \f
3163 Local Variables:
3164 mode: change-log
3165 left-margin: 8
3166 fill-column: 74
3167 version-control: never
3168 End: