2006-06-19 Vladimir Prus <vladimir@codesourcery.com>
[external/binutils.git] / bfd / ChangeLog
1 2006-06-19  Vladimir Prus  <vladimir@codesourcery.com>
2
3         * elf32-arm.c (elf32_arm_swap_symbol_out): Don't set low
4         bit for undefined symbols.
5
6 2006-06-19  Alan Modra  <amodra@bigpond.net.au>
7
8         * elf-bfd.h (struct elf_backend_data): Add bfd_link_info pointer
9         parameter.
10         (_bfd_elf_sizeof_headers): Replace bfd_boolean param with
11         bfd_link_info pointer.
12         * targets.c (struct bfd_target <_bfd_sizeof_headers>): Likewise.
13         * bfd.c (bfd_sizeof_headers): Tweak param name.
14         * aout-adobe.c (aout_adobe_sizeof_headers): Adjust.
15         * aoutx.h (NAME (aout, sizeof_headers)): Adjust.
16         * binary.c (binary_sizeof_headers): Adjust.
17         * bout.c (b_out_sizeof_headers): Adjust.
18         * coff-rs6000.c (_bfd_xcoff_sizeof_headers): Adjust.
19         * coff64-rs6000.c (xcoff64_sizeof_headers): Adjust.
20         * coffgen.c (coff_sizeof_headers): Adjust.
21         * ecoff.c (_bfd_ecoff_sizeof_headers): Adjust.
22         (ecoff_compute_section_file_positions): Adjust.
23         (_bfd_ecoff_write_object_contents): Adjust.
24         * elf.c (get_program_header_size, _bfd_elf_sizeof_headers): Adjust.
25         * elf32-arm.c (elf32_arm_additional_program_headers): Adjust.
26         * elf32-i370.c (elf_backend_additional_program_headers): Adjust.
27         * elf32-ppc.c (ppc_elf_additional_program_headers): Adjust.
28         * elf64-hppa.c (elf64_hppa_additional_program_headers): Adjust.
29         * elf64-x86-64.c (elf64_x86_64_additional_program_headers): Adjust.
30         * elfxx-ia64.c (elfNN_ia64_additional_program_headers): Adjust.
31         * elfxx-mips.c (_bfd_mips_elf_additional_program_headers): Adjust.
32         * elfxx-mips.h (_bfd_mips_elf_additional_program_headers): Adjust.
33         * i386msdos.c: Convert to ISO C.
34         (msdos_sizeof_headers): Adjust.
35         * i386os9k.c: Convert to ISO C.
36         (os9k_sizeof_headers): Adjust.
37         * ieee.c (ieee_sizeof_headers): Adjust.
38         * ihex.c (ihex_sizeof_headers): Adjust.
39         * libaout.h (NAME (aout, sizeof_headers)): Adjust.
40         * libbfd-in.h (_bfd_nolink_sizeof_headers): Adjust.
41         * libcoff-in.h (coff_sizeof_headers): Adjust.
42         * libecoff.h (_bfd_ecoff_sizeof_headers): Adjust.
43         * mach-o.c (bfd_mach_o_sizeof_headers): Adjust.
44         * mmo.c (mmo_sizeof_headers): Adjust.
45         * oasys.c (oasys_sizeof_headers): Adjust.
46         * pdp11.c (NAME (aout, sizeof_headers)): Adjust.
47         * pef.c (bfd_pef_sizeof_headers): Adjust.
48         * ppcboot.c (ppcboot_sizeof_headers): Adjust.
49         * som.c (som_sizeof_headers): Adjust.
50         * srec.c (srec_sizeof_headers): Adjust.
51         * tekhex.c (tekhex_sizeof_headers): Adjust.
52         * versados.c (versados_sizeof_headers): Adjust.
53         * vms.c (vms_sizeof_headers): Adjust.
54         * xcoff-target.h (_bfd_xcoff_sizeof_headers): Adjust.
55         * xsym.c (bfd_sym_sizeof_headers): Adjust.
56         * xsym.h (bfd_sym_sizeof_headers): Adjust.
57         * bfd-in2.h: Regenerate.
58         * libbfd.h: Regenerate.
59         * libcoff.h: Regenerate.
60
61 2006-06-15  Mark Shinwell  <shinwell@codesourcery.com>
62
63         * bfd-in2.h: Regenerate.
64         * elf32-arm.c (R_ARM_ALU_PC_G0_NC, R_ARM_ALU_PC_G0,
65         R_ARM_ALU_PC_G1_NC, R_ARM_ALU_PC_G1, R_ARM_ALU_PC_G2,
66         R_ARM_LDR_PC_G1, R_ARM_LDR_PC_G2, R_ARM_LDRS_PC_G0,
67         R_ARM_LDRS_PC_G1, R_ARM_LDRS_PC_G2, R_ARM_LDC_PC_G0,
68         R_ARM_LDC_PC_G1, R_ARM_LDC_PC_G2, R_ARM_ALU_SB_G0_NC,
69         R_ARM_ALU_SB_G0, R_ARM_ALU_SB_G1_NC, R_ARM_ALU_SB_G1,
70         R_ARM_ALU_SB_G2, R_ARM_LDR_SB_G0, R_ARM_LDR_SB_G1,
71         R_ARM_LDR_SB_G2, R_ARM_LDRS_SB_G0, R_ARM_LDRS_SB_G1,
72         R_ARM_LDRS_SB_G2, R_ARM_LDC_SB_G0, R_ARM_LDC_SB_G1,
73         R_ARM_LDC_SB_G2): New relocation types.
74         (R_ARM_PC13): Rename to AAELF name R_ARM_LDR_PC_G0 and
75         adjust HOWTO entry to be consistent with R_ARM_LDR_PC_G1
76         and friends.
77         (elf32_arm_howto_table_3): Delete; contents merged into
78         elf32_arm_howto_table_2.
79         (elf32_arm_howto_from_type): Adjust correspondingly.
80         (elf32_arm_reloc_map): Extend with the above relocations.
81         (calculate_group_reloc_mask): New function.
82         (identify_add_or_sub): New function.
83         (elf32_arm_final_link_relocate): Support for the above
84         relocations.
85         * reloc.c: Add enumeration entries for BFD_RELOC_ARM_...
86         codes to correspond to the above relocations.
87
88 2006-06-14  Richard Sandiford  <richard@codesourcery.com>
89
90         * elf32-m68k.c (elf_m68k_plt_info): New structure.
91         (elf_m68k_plt0_entry): Add R_68K_PC32-style in-place addends.
92         (elf_m68k_plt_entry): Likewise.
93         (elf_m68k_plt_info): New table.
94         (CFV4E_PLT_ENTRY_SIZE): Rename to...
95         (ISAB_PLT_ENTRY_SIZE): ...this.
96         (CFV4E_FLAG): Delete.
97         (elf_cfv4e_plt0_entry): Rename to...
98         (elf_isab_plt0_entry): ...this.  Adjust comments.  Use (-6,%pc,%d0)
99         for the second instruction too.
100         (elf_cfv4e_plt_entry): Rename to...
101         (elf_isab_plt_entry): ...this.  Adjust comments and use (-6,%pc,%d0).
102         (elf_isab_plt_info): New table.
103         (CPU32_FLAG): Delete.
104         (PLT_CPU32_ENTRY_SIZE): Rename to...
105         (CPU32_PLT_ENTRY_SIZE): ...this.
106         (elf_cpu32_plt0_entry): Update bounds accordingly.  Add R_68K_PC32-
107         style in-place addends.
108         (elf_cpu32_plt_entry): Likewise.
109         (elf_cpu32_plt_info): New table.
110         (elf_m68k_link_hash_table): Add a plt_info field.
111         (elf_m68k_link_hash_table_create): Initialize it.
112         (elf_m68k_get_plt_info): New function.
113         (elf_m68k_always_size_sections): Likewise.
114         (elf_m68k_adjust_dynamic_symbol): Use the plt_info hash table field.
115         (elf_m68k_install_pc32): New function.
116         (elf_m68k_finish_dynamic_symbol): Factor code using plt_info and
117         elf_m68k_install_pc32.
118         (elf_m68k_finish_dynamic_sections): Likewise.
119         (elf_m68k_plt_sym_val): Use elf_m68k_get_plt_info.
120         (elf_backend_always_size_sections): Define.
121
122 2006-06-14  Alan Modra  <amodra@bigpond.net.au>
123
124         * elflink.c (elf_link_add_object_symbols): Save and restore
125         struct bfd_hash_table table, size and count fields for
126         as-needed libs.
127
128 2006-06-12  Thiemo Seufer  <ths@mips.com>
129
130         * elf32-mips.c: Expand comment about ABI-mandated pagesize values.
131         (ELF_MAXPAGESIZE, ELF_COMMONPAGESIZE): define in a more obvious way.
132         * elf64-mips.c, elfn32-mips.c (ELF_MAXPAGESIZE): Fix value for IRIX6.
133         Delete old comments.
134         (ELF_COMMONPAGESIZE): Define in a more obvious way.
135
136 2006-06-12  Nick Clifton  <nickc@redhat.com>
137
138         PR binutils/2735
139         * elflink.c (elf_link_add_object_symbols): Fix the warning message
140         about mismatched alignments to allow for the case where the common
141         alignment has been deduced from the section alignment.
142         * bfd.c (_bfd_default_error_handler): Update comment to explain
143         why bfd and asection varargs are out of order.  Explicitly catch
144         and abort on NULL bfd and asection arguments.
145
146 2006-06-11  Richard Sandiford  <richard@codesourcery.com>
147             Thiemo Seufer  <ths@mips.com>
148
149         * elfxx-mips.c (mips_elf_link_hash_table): Add function_stub_size.
150         (STUB_ORI): New macro.
151         (STUB_LI16U): Fix formatting.
152         (MIPS_FUNCTION_STUB_SIZE): Delete.
153         (MIPS_FUNCTION_STUB_MAX_SIZE): Likewise.
154         (MIPS_FUNCTION_STUB_NORMAL_SIZE): New macro.
155         (MIPS_FUNCTION_STUB_BIG_SIZE): Likewise.
156         (_bfd_mips_elf_adjust_dynamic_symbol): Use htab->function_stub_size
157         instead of MIPS_FUNCTION_STUB_SIZE.
158         (count_section_dynsyms): New function, split out from
159         _bfd_mips_elf_final_link.
160         (_bfd_mips_elf_always_size_sections): Get a worst-case estimate
161         of the number of dynamic symbols needed and use it to set up
162         function_stub_size.  Use function_stub_size rather than
163         MIPS_FUNCTION_STUB_SIZE to determine the size of the stub section.
164         Use 16-byte stubs for 0x10000 dynamic symbols.
165         (_bfd_mips_elf_size_dynamic_sections): Use htab->function_stub_size
166         instead of MIPS_FUNCTION_STUB_SIZE.  Fix formatting.
167         (_bfd_mips_elf_finish_dynamic_symbol): Likewise.  Change the
168         size of the stub buffer from MIPS_FUNCTION_STUB_MAX_SIZE to
169         MIPS_FUNCTION_STUB_BIG_SIZE.  Tweak the check for unhandled dynindxes.
170         Use MIPS_FUNCTION_STUB_BIG_SIZE rather than a hard-coded 20.
171         Use STUB_ORI rather than STUB_LI16U for big stubs.
172         (_bfd_mips_elf_link_hash_table_create): Initialize function_stub_size.
173         (_bfd_mips_elf_final_link): Use count_section_dynsyms.
174
175 2006-06-09  David Ung  <davidu@mips.com>
176
177         * bfd/elfxx-mips.c (mips_elf_calculate_relocation): Fix mode for stub
178         calling relocations.
179
180 2006-06-08  David Daney  <ddaney@avtrex.com>
181
182         * elfxx-mips.c (STUB_LI16): Removed.
183         (STUB_LUI): New macro.
184         (STUB_LI16U): Ditto.
185         (STUB_LI16S): Ditto.
186         (MIPS_FUNCTION_STUB_SIZE): Rewrote to take info parameter.
187         (_bfd_mips_elf_adjust_dynamic_symbol): Pass info parameter to
188         MIPS_FUNCTION_STUB_SIZE.
189         (_bfd_mips_elf_always_size_sections): Ditto.
190         (_bfd_mips_elf_size_dynamic_sections): Ditto.
191         (_bfd_mips_elf_finish_dynamic_sections): Ditto.
192         (_bfd_mips_elf_finish_dynamic_symbol): Rewrote stub generation
193         to allow larger symbol table indexes.
194
195 2006-06-07  Joseph S. Myers  <joseph@codesourcery.com>
196
197         * po/Make-in (pdf, ps): New dummy targets.
198
199 2006-06-06  Alan Modra  <amodra@bigpond.net.au>
200
201         * hash.c (bfd_hash_lookup): Correct stray line.
202
203         * elf.c (_bfd_elf_init_private_section_data): Comment typo.
204         (elfcore_grok_nto_status): Use long instead of pid_t.
205         (elfcore_grok_nto_regs, elfcore_grok_nto_note): Likewise.
206
207 2006-06-05  Daniel Jacobowitz  <dan@codesourcery.com>
208
209         * po/Make-in (top_builddir): Define.
210
211 2006-06-05  Alan Modra  <amodra@bigpond.net.au>
212
213         * Makefile.am: Run "make dep-am".
214         * Makefile.in: Regenerate.
215         * config.in: Regenerate.
216
217 2006-06-02  Alan Modra  <amodra@bigpond.net.au>
218             H.J. Lu  <hongjiu.lu@intel.com>
219
220         PR ld/2723
221         * elflink.c (bfd_elf_final_link): Don't output section symbols
222         for special ELF sections.
223
224 2006-06-01  Alan Modra  <amodra@bigpond.net.au>
225
226         * stabs.c (_bfd_link_section_stabs): Use bfd_make_section*_with_flags
227         instead of bfd_make_section*.
228         * aix386-core.c: Likewise.
229         * aix5ppc-core.c: Likewise.
230         * aout-adobe.c: Likewise.
231         * aoutf1.h: Likewise.
232         * binary.c: Likewise.
233         * cisco-core.c: Likewise.
234         * coff-arm.c: Likewise.
235         * coff-h8300.c: Likewise.
236         * elf.c: Likewise.
237         * elf32-bfin.c: Likewise.
238         * elf32-m32c.c: Likewise.
239         * hppabsd-core.c: Likewise.
240         * hpux-core.c: Likewise.
241         * i386linux.c: Likewise.
242         * ieee.c: Likewise.
243         * ihex.c: Likewise.
244         * irix-core.c: Likewise.
245         * lynx-core.c: Likewise.
246         * m68klinux.c: Likewise.
247         * mach-o.c: Likewise.
248         * netbsd-core.c: Likewise.
249         * nlmcode.h: Likewise.
250         * opncls.c: Likewise.
251         * osf-core.c: Likewise.
252         * peXXigen.c: Likewise.
253         * ppcboot.c: Likewise.
254         * ptrace-core.c: Likewise.
255         * rs6000-core.c: Likewise.
256         * sco5-core.c: Likewise.
257         * sparclinux.c: Likewise.
258         * srec.c: Likewise.
259         * sunos.c: Likewise.
260         * trad-core.c: Likewise.
261         * xcofflink.c: Likewise.
262         * xsym.c: Likewise.
263
264 2006-05-31  Daniel Jacobowitz  <dan@codesourcery.com>
265
266         * Makefile.am (INCLUDES): Use @INCINTL@.
267         * acinclude.m4: Include new gettext macros.
268         * configure.in: Use ZW_GNU_GETTEXT_SISTER_DIR and AM_PO_SUBDIRS.
269         Manually substitute POFILES and GMOFILES.
270         * Makefile.in, aclocal.m4, configure, doc/Makefile.in: Regenerated.
271
272 2006-05-30  H.J. Lu  <hongjiu.lu@intel.com>
273
274         * bfd.c (bfd_emul_get_maxpagesize): New.
275         (bfd_elf_set_pagesize): Likewise.
276         (bfd_emul_set_maxpagesize): Likewise.
277         (bfd_emul_get_commonpagesize): Likewise.
278         (bfd_emul_set_commonpagesize): Likewise.
279         * bfd-in2.h: Regenerated.
280
281         * elf-bfd.h (elf_backend_data): Add commonpagesize.
282         (xvec_get_elf_backend_data): New.
283         (get_elf_backend_data): Use xvec_get_elf_backend_data.
284
285         * elf32-arm.c (elf32_arm_vxworks_bed): Remove const.
286         * elfxx-target.h (elfNN_bed): Likewise.
287
288         * elf32-arm.c (ELF_COMMONPAGESIZE): Defined.
289         * elf32-mips.c (ELF_COMMONPAGESIZE): Likewise.
290         * elf32-ppc.c (ELF_COMMONPAGESIZE): Likewise.
291         * elf32-sh.c (ELF_COMMONPAGESIZE): Likewise.
292         * elf32-sh64.c (ELF_COMMONPAGESIZE): Likewise.
293         * elf32-sparc.c (ELF_COMMONPAGESIZE): Likewise.
294         * elf64-alpha.c (ELF_COMMONPAGESIZE): Likewise.
295         * elf64-ppc.c (ELF_COMMONPAGESIZE): Likewise.
296         * elf64-sparc.c (ELF_COMMONPAGESIZE): Likewise.
297         * elf64-x86-64.c (ELF_COMMONPAGESIZE): Likewise.
298         * elfn32-mips.c (ELF_COMMONPAGESIZE): Likewise.
299         * elfxx-ia64.c (ELF_COMMONPAGESIZE): Likewise.
300
301         * elfxx-target.h (ELF_COMMONPAGESIZE): Define if not defined.
302         (elfNN_bed): Initialize commonpagesize with ELF_COMMONPAGESIZE.
303
304         * targets.c (bfd_find_target): Support NULL abfd.
305
306 2006-05-30  Nick Clifton  <nickc@redhat.com>
307
308         * po/es.po: Updated Spanish translation.
309
310 2006-05-27  Alan Modra  <amodra@bigpond.net.au>
311             H.J. Lu  <hongjiu.lu@intel.com>
312
313         * elf.c (assign_file_positions_for_load_sections): Retrieve
314         maxpagesize from m->p_align if it is valid.  Set p_vaddr,
315         p_paddr and p_align earlier.  Revert 2006-05-19 change to p_align.
316         (copy_elf_program_header): Copy p_align.  Set p_align_valid.
317
318 2006-05-26  H.J. Lu  <hongjiu.lu@intel.com>
319
320         * elf64-x86-64.c (ELF_MINPAGESIZE): Changed to 0x1000.
321
322 2006-05-25  H.J. Lu  <hongjiu.lu@intel.com>
323
324         * elf64-x86-64.c (ELF_MINPAGESIZE): Set to 0x100000.
325
326 2006-05-25  H.J. Lu  <hongjiu.lu@intel.com>
327
328         * elf64-x86-64.c (ELF_MAXPAGESIZE): Updated to 0x200000.
329
330 2006-05-26  Alan Modra  <amodra@bigpond.net.au>
331
332         * elf.c (sym_is_global): Return a bfd_boolean.
333         (ignore_section_sym): New function.
334         (elf_map_symbols): Use ignore_section_sym to discard some syms.
335         (_bfd_elf_symbol_from_bfd_symbol): Ensure section belongs to
336         bfd before using elf_section_syms.
337
338 2006-05-25  H.J. Lu  <hongjiu.lu@intel.com>
339
340         * config.bfd: (sh-*-linux*): Treat as 64bit target.
341         (sh*l*-*-netbsdelf*): Likewise.
342         (sh-*-netbsdelf*): Likewise.
343         (shl*-*-elf*): Likewise.
344         (sh[1234]l*-*-elf*): Likewise.
345         (sh3el*-*-elf*): Likewise.
346         (shl*-*-kaos*): Likewise.
347         (sh-*-elf*): Likewise.
348         (sh[1234]*-elf*): Likewise.
349         (sh-*-rtems*): Likewise.
350         (sh-*-kaos*): Likewise.
351
352 2006-05-24  H.J. Lu  <hongjiu.lu@intel.com>
353
354         PR ld/1485
355         * config.bfd: Set want64 to true if 64bit bfd is used.
356         (sh-*-linux*): Use targ64_selvecs for 64bit targets.
357         (sh*l*-*-netbsdelf*): Likewise.
358         (sh-*-netbsdelf*): Likewise.
359         (shl*-*-elf*): Likewise.
360         (sh[1234]l*-*-elf*): Likewise.
361         (sh3el*-*-elf*): Likewise.
362         (shl*-*-kaos*): Likewise.
363         (sh-*-elf*): Likewise.
364         (sh[1234]*-elf*): Likewise.
365         (sh-*-rtems*): Likewise.
366         (sh-*-kaos*): Likewise.
367
368 2006-05-24  Paul Brook  <paul@codesourcery.com>
369
370         * elf-bfd.h (elf_backend_data): Add elf_backend_output_arch_local_syms
371         * elf32-arm.c (output_arch_syminfo): Define.
372         (elf32_arm_ouput_plt_map_sym, elf32_arm_output_plt_map,
373         elf32_arm_output_arch_local_syms): New functions.
374         (elf_backend_output_arch_local_syms): Define.
375         * elflink.c (bfd_elf_final_link): Call
376         elf_backend_output_arch_local_syms.
377         * elfxx-target.h (elf_backend_output_arch_local_syms): Provide default
378         definition.
379         (elfNN_bed): Add elf_backend_output_arch_local_syms.
380
381 2006-05-24  Paul Brook  <paul@codesourcery.com>
382
383         * elf32-arm.c (put_arm_insn, put_thumb_insn): New functions.
384         (elf32_thumb_to_arm_stub, elf32_arm_to_thumb_stub,
385         elf32_arm_finish_dynamic_symbol): Use them.
386
387 2006-05-24  Carlos O'Donell  <carlos@systemhalted.org>
388             Randolph Chung  <tausq@debian.org>
389             
390         * elf-hppa.h (reloc_hppa_howto_table): Check bitfield for
391         TPREL21L/TPREL14R relocations. Handle LTOFF_TP14R relocations.
392         Add handling for TLS relocations.
393         (elf_hpp_reloc_final_type): Handle TLS relocs.
394         * elf32-hppa.c: Add authors for cleanup and TLS support.
395         (hppa_elf_local_got_tls_type, hh_name, eh_name): Define.
396         (elf32_hppa_link_hash_entry): Add tls_type.
397         (elf32_hppa_link_hash_table): Add tld_ldm_got.
398         (hppa_link_has_newfunc): Set tls_type.
399         (elf32_hppa_link_hash_table_create): Set tls_ldm_got refcount.
400         (hppa_stub_name): Use hh_name macro.
401         (elf32_hppa_copy_indirect_symbol): Copy TLS information.
402         (elf32_hppa_check_relocs): Call elf32_hppa_optimized_tls_reloc.
403         Handle TLS relocs.
404         (elf32_hppa_gc_sweep_hook): Likewise. 
405         (allocate_dynrelocs): Handle TLS relocs.
406         (elf32_hppa_size_dynamic_sections): Count space required by TLS
407         relocs. Use hh_name macro.
408         (dtpoff_base): New function.
409         (tpoff): Likewise.
410         (elf32_hppa_optimized_tls_reloc): Likewise.
411         (final_link_relocate): Handle TLS relocs.
412         (elf32_hppa_relocate_section): Handle TLS relocs. Use eh_name
413         and hh_name macros.
414         (elf32_hppa_finish_dynamic_symbol): Setup TLS got entries. Use
415         hh_name and eh_name macros.
416         (elf32_hppa_reloc_type_clas): Handle TLS relocs.
417
418 2006-05-24  Bjoern Haase  <bjoern.m.haase@web.de> 
419
420         * archures.c: Add bfd_mach_avr6.
421         * cpu-avr.c: Likewise.
422         * reloc.c (BFD_RELOC_AVR_LO8_LDI_GS, BFD_RELOC_AVR_HI8_LDI_GS):
423         New relocations.
424         * libbfd.h: Regenerate. 
425         * bfd-in2.h:Regenerate.
426         * elf32-avr.h: New file.  Protoypes for functions accessed from ld.
427         * elf32-avr.c: Add elf32-avr.h to include list.
428         (elf32_avr_stub_hash_entry): New function.
429         (elf32_avr_link_hash_table): New struct.
430         (avr_link_hash_table): Likewise.
431         (avr_stub_hash_entry): Likewise.
432         (avr_stub_hash_lookup): New function.
433         (stub_hash_newfunc): New function.
434         (elf32_avr_link_hash_table_create): New function.
435         (elf32_avr_link_hash_table_free): New function.
436         (avr_get_stub_addr): New function.
437         (debug_relax, debug_stubs): Add new global variables controlling
438         debugging printout to stdout.
439         (avr_pc_wrap_around): Change the type to bfd_vma.
440         (avr_replace_call_ret_sequences): Add a new variable controling 
441         linkrelax optimizations.
442         (avr_stub_is_required_for_16_bit_reloc): New function.
443         (avr_final_link_relocate): 
444         Add linker hash table to parameter list. Use stub addr. if necessary.
445         (elf32_avr_relocate_section):
446         Add linker hashtable to parameter list of avr_final_link_relocate.
447         (bfd_elf_avr_final_write_processing): Add support for bfd_mach_avr6.
448         (elf32_avr_object_p): Add support for E_AVR_MACH_AVR6.
449         (elf32_avr_relax_delete_bytes):
450         Iterate over all sections of a bfd when adjusting relocs addends.
451         (elf32_avr_relax_section):
452         Evaluate avr_replace_call_ret_sequences and recalculate the size of 
453         stub section.
454         (avr_stub_name): New function.
455         (avr_get_stub_entry): New function.
456         (avr_add_stub): New function.
457         (avr_build_one_stub): New function.
458         (avr_size_one_stub): New function.
459         (elf32_avr_setup_params): New function.
460         (elf32_avr_setup_section_lists): New function.
461         (get_local_syms): New function.
462         (elf32_avr_size_stubs): New function.
463         (bfd_elf32_bfd_link_hash_table_create): New function.
464         (bfd_elf32_bfd_link_hash_table_free): New function.
465
466 2006-05-23  H.J. Lu  <hongjiu.lu@intel.com>
467
468         PR ld/2655
469         PR ld/2657
470         * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): Properly
471         update CIE/FDE length.  Don't pad to the section alignment.
472
473 2006-05-23  Jie Zhang  <jie.zhang@analog.com>
474
475         * elf32-bfin.c (bfinfdpic_relocate_section): Clear reloc for
476         deteted entries in .eh_frame section.
477
478 2006-05-23  Jie Zhang  <jie.zhang@analog.com>
479
480         * elf32-bfin.c (bfin_check_relocs): Use __GLOBAL_OFFSET_TABLE_
481         instead of _GLOBAL_OFFSET_TABLE_.
482         (bfin_relocate_section): Ditto.
483         (_bfin_create_got_section): Ditto.
484         (elf32_bfinfdpic_create_dynamic_sections): Use
485         __PROCEDURE_LINKAGE_TABLE_ instead of _PROCEDURE_LINKAGE_TABLE_.
486         (bfin_finish_dynamic_symbol): Use __DYNAMIC instead of _DYNAMIC.
487
488 2006-05-23  Alan Modra  <amodra@bigpond.net.au>
489
490         * elf64-ppc.c (compare_symbols): Prefer strong dynamic global
491         function syms over other syms.
492
493 2006-05-22  Daniel Jacobowitz  <dan@codesourcery.com>
494
495         * elflink.c (_bfd_elf_add_dynamic_entry): Remove DT_TEXTREL
496         check.
497         (bfd_elf_final_link): Add a late DT_TEXTREL check.
498         * elfxx-mips.c (MIPS_ELF_READONLY_SECTION): Define.
499         (mips_elf_create_dynamic_relocation): Set DF_TEXTREL.
500         (_bfd_mips_elf_check_relocs): Delete MIPS_READONLY_SECTION.
501         Use MIPS_ELF_READONLY_SECTION.
502         (_bfd_mips_elf_size_dynamic_sections): Clear DF_TEXTREL after
503         creating DT_TEXTREL.
504         (_bfd_mips_elf_finish_dynamic_sections): Clear textrel markers
505         if no text relocations were generated.
506
507 2006-05-19  H.J. Lu  <hongjiu.lu@intel.com>
508
509         * elfxx-ia64.c (ELF_MAXPAGESIZE): Fix a typo in comment.
510
511 2006-05-19  Alan Modra  <amodra@bigpond.net.au>
512
513         * elf.c (elf_fake_sections): Formatting.
514         (assign_file_positions_for_load_sections): Only add SEC_ALLOC
515         sections to p_memsz.  Remove hack for PT_NOTE sections.  Allow
516         section alignment to increase p_align for PT_LOAD.
517         (assign_file_positions_for_non_load_sections): Remove ARM BPABI
518         hack for PT_DYNAMIC.  Instead, set p_filesz for all segments
519         other than PT_LOAD, and PT_NOTE in core.
520
521 2006-05-17  Alan Modra  <amodra@bigpond.net.au>
522
523         * elf.c (assign_file_positions_for_segments): Split into..
524         (assign_file_positions_for_load_sections): ..this, and..
525         (assign_file_positions_for_non_load_sections): ..this new function,..
526         (assign_file_positions_except_relocs): ..writing program headers here.
527
528 2006-05-17  Alan Modra  <amodra@bigpond.net.au>
529
530         * elflink.c (elf_gc_sweep): Don't specially keep non-alloc,
531         non-load sections if they have relocs.
532
533 2006-05-15  Paul Brook  <paul@codesourcery.com>
534
535         * cpu-arm.c (bfd_is_arm_mapping_symbol_name): Rename ...
536         (bfd_is_arm_special_symbol_name): ... to this.  Add type argument.
537         Check symbol name is of specified type.
538         * elf32-arm.c (elf32_arm_is_target_special_symbol,
539         arm_elf_find_function, elf32_arm_output_symbol_hook): Use
540         bfd_is_arm_special_symbol_name.
541         * bfd-in.h (BFD_ARM_SPECIAL_SYM_TYPE_MAP,
542         BFD_ARM_SPECIAL_SYM_TYPE_TAG, BFD_ARM_SPECIAL_SYM_TYPE_OTHER,
543         BFD_ARM_SPECIAL_SYM_TYPE_ANY): Define.
544         (bfd_is_arm_mapping_symbol_name): Remove prototype.
545         (bfd_is_arm_special_symbol_name): Add prototype.
546         * bfd-in2.h: Regenerate.
547
548 2006-05-15  David Heine  <dlheine@tensilica.com>
549             Bob Wilson  <bob.wilson@acm.org>
550
551         * elf32-xtensa.c (check_loop_aligned): Fix reversed check for
552         undefined opcode.  Clean up assertions.
553         (narrow_instruction, widen_instruction): Remove "do_it" parameters.
554         Factor most of the code into separate functions....
555         (can_narrow_instruction, can_widen_instruction): New.
556         (prev_instr_is_a_loop): New.
557         (compute_ebb_proposed_actions): Combine error handling code for
558         decode errors.  Replace call to insn_decode_len with inline code.
559         Use can_narrow_instruction and can_widen_instruction.  Handle errors
560         from call to xtensa_opcode_is_loop.
561         (relax_section): Adjust calls to narrow_instruction and 
562         widen_instruction.
563
564 2006-05-15  Alan Modra  <amodra@bigpond.net.au>
565
566         PR 2658
567         * elf32-ppc.c (ppc_elf_relax_section): Don't segfault on non-pic
568         -shared link.
569
570 2006-05-11  Michael Matz  <matz@suse.de>
571
572         * elflink.c (match_group_member): Correctly iterate group
573         members.
574
575 2006-05-11  Paul Brook  <paul@codesourcery.com>
576
577         * elf32-arm.c (elf32_arm_reloc_map): Add MOVW and MOVT relocs.
578         (elf32_arm_final_link_relocate): Handle MOVW and MOVT relocs.
579         (elf32_arm_gc_sweep_hook, elf32_arm_check_relocs): Ditto.
580         * reloc.c: Ditto.
581         * bfd-in2.h: Regenerate.
582         * libbfd.h: Regenerate.
583         * libcoff.h: Regenerate.
584
585 2006-05-11  Mike Bland  <mbland@google.com>
586
587         * elf.c (_bfd_elf_init_private_section_data): Don't change
588         section type if already set.
589
590 2006-05-10  Nick Clifton  <nickc@redhat.com>
591
592         PR ld/2607
593         * elfcode.h (valid_section_index_p): New function: Checks for a
594         valid section index.  Allows indicies in the range SHN_LOPROC to
595         SHN_HIOS.
596         (elf_object_p): Use valid_section_index_p.
597
598 2006-05-11  Pedro Alves  <pedro_alves@portugalmail.pt>
599
600         * coff-arm.c (ARM_26D, ARM_32, ARM_RVA_32, ARM_SECTION,
601         ARM_SECREL): Mark WinCE versions of these relocs as partial
602         inplace.
603         (coff_arm_relocate_section): Adjust addend for WinCE.
604
605 2006-05-10  Alan Modra  <amodra@bigpond.net.au>
606
607         PR 2342
608         * elflink.c (_bfd_elf_default_action_discarded): Revert 2006-02-16.
609
610 2006-05-09  Nick Clifton  <nickc@redhat.com>
611
612         * coffcode.h (coff_write_relocs): Produce an error message if a an
613         out-of-range symbol index is detected in a reloc.
614
615 2006-05-09  Ben Elliston  <bje@au.ibm.com>
616
617         * elf64-ppc.c (ppc64_elf_finish_dynamic_symbol): Remove unused
618         local variable `dynobj'.
619         
620 2006-05-05  Bjoern Haase  <bjoern.m.haase@web.de>
621
622         * elf32-avr.c (elf32_avr_relax_delete_bytes): Iterate over all
623         of the bfd's sections for the reloc-addend adjustments.
624
625 2006-05-05  Martin Schwidefsky  <schwidefsky@de.ibm.com>
626
627         * elf32-s390.c (invalid_tls_insn): Call bfd_set_error.
628         (elf_s390_relocate_section): Add code to do the GD->LE and
629         LD->LE TLS linker optimizations if a brasl instruction is used
630         for the __tls_get_offset function call.
631         * elf64-s390.c (invalid_tls_insn): Call bfd_set_error.
632
633 2006-05-05  Alan Modra  <amodra@bigpond.net.au>
634
635         * elf64-ppc.c (ppc64_elf_tls_optimize): Only optimize
636         R_PPC64_TPREL64 and R_PPC64_DTPMOD64 relocs when they are in
637         the .toc and referenced by a TLS code sequence.
638         (ppc64_elf_edit_toc): Cater for the unlikely situation that
639         .toc is the first section in a file.
640
641 2006-05-04  Andreas Schwab  <schwab@suse.de>
642
643         * aoutf1.h (struct external_sparc_core): Declare c_regs as struct
644         regs instead of an array of int.
645         (struct external_solaris_bcp_core): Likewise.
646         (swapcore_sun3): Use offsetof instead of computing the offset
647         manually.
648         (swapcore_sparc): Likewise.  Simplify reference to c_regs.
649         (swapcore_solaris_bcp): Likewise.
650
651 2006-05-04  Daniel Jacobowitz  <dan@codesourcery.com>
652
653         * elfxx-mips.c (_bfd_mips_elf_hide_symbol): Adjust handling
654         for missing GOTs.
655
656 2006-05-04  Daniel Jacobowitz  <dan@codesourcery.com>
657
658         * cpu-arm.c (bfd_is_arm_mapping_symbol_name): Accept more
659         mapping symbols.
660
661 2006-05-04  Ben Elliston  <bje@au.ibm.com>
662
663         * coff-or32.c (bfd_section_from_shdr): Remove unused local
664         variable `ptr'.
665         * cofflink.c (process_embedded_commands): Remove unused local
666         variables `had_read' and `had_shared'.
667         * ecofflink.c (bfd_ecoff_debug_accumulate): Remove unused local
668         variable `fdr_adr'.
669         * ihex.c (ihex_read_section): Remove unused local variable `addr'.
670
671 2006-05-03  Alan Modra  <amodra@bigpond.net.au>
672
673         * libbfd-in.h (_bfd_generic_new_section_hook): Declare.
674         * section.c (bfd_abs_symbol, bfd_com_symbol): Delete.
675         (bfd_und_symbol, bfd_ind_symbol): Delete.
676         (BFD_FAKE_SECTION): Remove SYM_PTR param, set symbol_ptr_ptr to
677         &SEC.symbol.
678         (STD_SECTION): Adjust.
679         (_bfd_generic_new_section_hook): New function, extracted from..
680         (bfd_section_init): ..here.
681         (bfd_make_section_old_way): Call new_section_hook for abs, com,
682         und and ind sections.
683         * elf.c (_bfd_elf_large_com_section): Adjust.
684         * aoutx.h (new_section_hook): Call _bfd_generic_new_section_hook.
685         * pdp11.c (new_section_hook): Likewise.
686         * coffcode.h (coff_new_section_hook): Likewise.
687         * ecoff.c (_bfd_ecoff_new_section_hook): Likewise.
688         * elf.c (_bfd_elf_new_section_hook): Likewise.
689         * vms.c (vms_new_section_hook): Likwise.
690         * elf32-arm.c (elf32_arm_new_section_hook): Check used_by_bfd isn't
691         already set.
692         * elf32-sh64.c (sh64_elf_new_section_hook): Likewise.
693         * elf32-xtensa.c (elf_xtensa_new_section_hook): Likewise.
694         * elf64-mmix.c (mmix_elf_new_section_hook): Likewise.
695         * elf64-ppc.c (ppc64_elf_new_section_hook): Likewise.
696         * elfxx-mips.c (_bfd_mips_elf_new_section_hook): Likewise.
697         * elfxx-sparc.c (_bfd_sparc_elf_new_section_hook): Likewise.
698         * ieee.c (ieee_new_section_hook): Likewise.  Call
699         _bfd_generic_new_section_hook too.
700         * mmo.c (mmo_new_section_hook): Likewise.
701         * oasys.c (oasys_new_section_hook): Likewise.
702         * som.c (som_new_section_hook): Likewise.
703         * coff-w65.c (reloc_processing): Don't use bfd_abs_symbol.
704         * bfd-in2.h: Regenerate.
705         * libbfd.h: Regenerate.
706
707 2006-05-03  Alan Modra  <amodra@bigpond.net.au>
708
709         * hash.c (DEFAULT_SIZE): Revert last change.
710         (higher_prime_number): Correct test for no larger prime.  Don't
711         abort on error, instead return 0.  Depopulate primes[].
712         (bfd_hash_lookup): If we overflow size, refuse to grow table.
713
714 2006-05-02  Paul Brook  <paul@codesourcery.com>
715
716         * elf32-arm.c (elf32_arm_final_link_relocate): Set thumb funciton bit
717         for R_ARM_REL32.
718
719 2006-05-02  Ben Elliston  <bje@au.ibm.com>
720
721         * archive.c (bfd_generic_archive_p): Remove unused local variable
722         `fail'.
723         * dwarf2.c (decode_line_info): Remove unused local variable
724         `basic_block'.
725         * elfcode.h (elf_slurp_reloc_table_from_section): Remove unused
726         local variable `s'.
727         * tekhex.c (tekhex_write_object_contents): Remove unused local
728         variable `bytes_written'.
729         * aout-ns32k.c (MY_swap_std_reloc_out): Remove unused local
730         variable `r_addend'.
731         * elf32-dlx.c (dlx_rtype_to_howto): Remove breaks after returns.
732         * elfxx-mips.c (_bfd_elf_mips_mach): Remove breaks after returns.
733         (_bfd_ns32k_relocate_contents): Remove break after return.
734         * elf.c (bfd_section_from_shdr): Remove breaks after returns.
735
736 2006-05-02  Nick Clifton  <nickc@redhat.com>
737
738         * elf32-sh-symbian.c: Rename local define DEBUG to SYMBIAN_DEBUG
739         in order to avoid conflicts with the global DEBUG define.
740
741 2006-05-02  Alan Modra  <amodra@bigpond.net.au>
742
743         * dwarf2.c: Formatting.
744         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Simplify
745         output section check.
746         * elf32-i370.c: Warning fixes inside #ifdef DEBUG.
747         * elf32-m32c.c: Similarly.
748         * elf32-ppc.c: Similarly.
749         * elf32-v850.c: Similarly.
750         * nlm32-sparc.c: Similarly.
751         * elfcode.h: Similarly.
752         (elf_symbol_flags): Delete.
753         * elflink.c (elf_link_input_bfd): Comment typo.
754
755 2006-05-01  DJ Delorie  <dj@redhat.com>
756
757         * bfd-in.h (bfd_hash_table): Add count field.
758         * bfd-in2.h: Regenerate.
759         * hash.c (higher_prime_number): New.
760         (bfd_hash_table_inint_n): Init count field.
761         (bfd_hash_lookup): Grow table as needed.
762
763 2006-04-27  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
764
765         PR binutils/2584
766         * tekhex.c (getvalue): Change return type to bfd_boolean and
767         add the new parameter.  Return false if the unexpected character
768         is found.
769         (getsym): Likewise.
770         (first_phase): Change return type to bfd_boolean and return
771         false if the unexpected character is found.  Replace abort
772         with returning false.
773         (pass_over): Change return type to bfd_boolean and the type of
774         the second argument to bfd_boolean (*) (bfd *, int, char *).
775         Return false if FUNC returns false.
776         (tekhex_object_p): Return NULL if pass_over fails.
777
778 2006-04-27  Alan Modra  <amodra@bigpond.net.au>
779
780         * coff-rs6000.c (xcoff_write_archive_contents_old): Warning fix.
781
782 2006-04-26  H.J. Lu  <hongjiu.lu@intel.com>
783
784         PR binutils/2593
785         * elf.c (_bfd_elf_new_section_hook): Don't set section ELF type
786         and flags if its BFD flags have been set.
787         (_bfd_elf_init_private_section_data): Don't copy the output ELF
788         section type from input if it has been set to something
789         different.
790
791 2006-04-25  H.J. Lu  <hongjiu.lu@intel.com>
792
793         PR binutils/2467
794         * elf.c (_bfd_elf_close_and_cleanup): Check elf_tdata (abfd)
795         is NULL first.
796
797         * elf32-arm.c (elf32_arm_close_and_cleanup): Check if
798         abfd->sections is NULL.
799         (elf32_arm_bfd_free_cached_info): New.
800         (bfd_elf32_bfd_free_cached_info): Defined.
801
802         * elfxx-target.h (bfd_elfNN_bfd_free_cached_info): Default it
803         to _bfd_free_cached_info.
804
805         * libbfd-in.h (_bfd_free_cached_info): New.
806         * libbfd: Regenerated.
807
808         * opncls.c (_bfd_delete_bfd): Check if abfd->memory is NULL.
809         (_bfd_free_cached_info): New.
810
811 2006-04-21  Alan Modra  <amodra@bigpond.net.au>
812
813         * elf.c (assign_file_positions_except_relocs): Move code setting
814         file position of non-loaded sections..
815         (assign_file_positions_for_segments): ..to here.
816
817 2006-04-20  H.J. Lu  <hongjiu.lu@intel.com>
818
819         PR ld/2537
820         * elf.c (bfd_section_from_shdr): Allow sections reserved for
821         applications. Issue an error on sections we don't know how
822         to handle.
823
824 2006-04-19  Alan Modra  <amodra@bigpond.net.au>
825
826         * Makefile.am: Run "make dep-am".
827         * Makefile.in: Regenerate.
828
829 2006-04-19  Alan Modra  <amodra@bigpond.net.au>
830
831         * warning.m4 (--enable-werror): Format help message.
832         (--enable-build-warnings): Likewise.
833         * configure: Regenerate.
834
835 2006-04-18  Nick Clifton  <nickc@redhat.com>
836
837         PR 2257
838         * elfcode.h (elf_object_p): Allow files with corrupt e_shstrndx
839         fields to still be handled as ELF files.
840
841 2006-04-16  Daniel Jacobowitz  <dan@codesourcery.com>
842
843         * po/SRC-POTFILES.in: Regenerated.
844
845 2006-04-16  Daniel Jacobowitz  <dan@codesourcery.com>
846
847         * configure.in: Update version to 2.17.50.
848         * configure: Regenerated.
849
850 2006-04-14  David Heine  <dlheine@tensilica.com>
851
852         * elf32-xtensa.c (build_reloc_opcodes): New.
853         (compute_text_actions): Use it to decode opcodes outside inner loop.
854         (check_section_ebb_pcrels_fit): Add "reloc_opcodes" argument, and if
855         it is set, use it to get the opcodes for relocations.
856         (move_shared_literal): Adjust call to check_section_ebb_pcrels_fit.
857
858 2006-04-08  H.J. Lu  <hongjiu.lu@intel.com>
859
860         PR ld/2513
861         * elf32-i386.c (GOT_TLS_MASK): New macro for tls_type.
862         (GOT_TLS_IE_IE): Likewise.
863         (GOT_TLS_IE_GD): Likewise.
864         (GOT_TLS_IE_MASK): Likewise.
865         (elf_i386_check_relocs): For global symbols, set GOT_TLS_IE_GD
866         and GOT_TLS_IE_IE for R_386_TLS_GD and R_386_TLS_IE
867         respectively.
868         (allocate_dynrelocs): If both GOT_TLS_IE_IE and GOT_TLS_IE_GD
869         are set, treat tls_type as GOT_TLS_IE_BOTH.
870         (elf_i386_relocate_section): Likewise.
871
872 2006-04-07  Randolph Chung  <tausq@debian.org>
873
874         * elf64-hppa.c (elf64_hppa_grok_prstatus): New function.
875         (elf64_hppa_grok_psinfo): Likewise.
876         (elf_backend_grok_pstatus, elf_backend_grok_psinfo): Define.
877
878 2006-04-06  DJ Delorie  <dj@redhat.com>
879
880         * elf32-m32c.c (m32c_elf_relocate_section): Generate a symbol for
881         each plt entry we create.
882
883 2006-04-06  Carlos O'Donell  <carlos@codesourcery.com>
884
885         * po/Make-in: Add install-html target.
886         * Makefile.am: Rename docdir to bfddocdir. Add datarootdir, docdir
887         htmldir. Add install-html and install-html-recursive targets.
888         * Makefile.in: Regenerate.
889         * configure.in: AC_SUBST for datarootdir, docdir and htmldir.
890         * configure: Regenerate.
891
892 2006-04-06  H.J. Lu  <hongjiu.lu@intel.com>
893
894         * elfxx-ia64.c (elfNN_ia64_relax_section): Skip unneeded passes
895         with the skip_relax_pass_0 and skip_relax_pass_1 bits in the
896         section structure.
897
898 2006-04-05  Bernd Schmidt  <bernd.schmidt@analog.com>
899
900         * elf32-bfin.c (bfinfdpic_relocs_info_hash): Sprinkle casts to
901         eliminate warnings.
902
903 2006-04-05  H.J. Lu  <hongjiu.lu@intel.com>
904             James E Wilson  <wilson@specifixinc.com>
905
906         PR ld/2442
907         * elfxx-ia64.c (elfNN_ia64_dyn_sym_info): Remove next.
908         (elfNN_ia64_local_hash_entry): Add count, sorted_count and
909         size.
910         (elfNN_ia64_link_hash_entry): Likewise.
911         (elfNN_ia64_new_elf_hash_entry): Initialize count, sorted_count
912         and size.
913         (elfNN_ia64_hash_copy_indirect): Updated elfNN_ia64_dyn_sym_info
914         processing.
915         (elfNN_ia64_hash_hide_symbol): Likewise.
916         (elfNN_ia64_global_dyn_sym_thunk): Likewise.
917         (elfNN_ia64_local_dyn_sym_thunk): Likewise.
918         (elfNN_ia64_global_dyn_info_free): New function.
919         (elfNN_ia64_local_dyn_info_free): Likewise.
920         (elfNN_ia64_hash_table_free): Free local and global
921         elfNN_ia64_dyn_sym_info.
922         (addend_compare): New function.
923         (sort_dyn_sym_info): Likewise.
924         (get_dyn_sym_info): Updated to use binary search for addend.
925         (elfNN_ia64_check_relocs): Scan relocations to create dynamic
926         relocation arrays first.
927
928 2006-04-05  Bernd Schmidt  <bernd.schmidt@analog.com>
929
930         * elf32-bfin.c (_bfin_create_got_section): Don't generate a _gp
931         symbol.
932
933 2006-04-05  H.J. Lu  <hongjiu.lu@intel.com>
934
935         PR ld/2411
936         * elflink.c (check_dynsym): New.
937         (elf_link_output_extsym): Use it.
938         (bfd_elf_final_link): Likewise.
939
940 2006-04-05  H.J. Lu  <hongjiu.lu@intel.com>
941
942         PR ld/2404
943         * elflink.c (_bfd_elf_merge_symbol): Skip the default indirect
944         symbol from the dynamic definition with the default version if
945         its type and the type of existing regular definition mismatch.
946
947 2006-04-05  Richard Sandiford  <richard@codesourcery.com>
948             Daniel Jacobowitz  <dan@codesourcery.com>
949
950         * config.bfd (sparc-*-vxworks*): New stanza.
951         * configure.in (bfd_elf32_sparc_vxworks_vec): New stanza.
952         (bfd_elf32_sparc_vec, bfd_elf64_sparc_vec): Add elf-vxworks.lo.
953         * configure: Regenerate.
954         * elf32-sparc.c: Include elf-vxworks.h.
955         (elf32_sparc_vxworks_link_hash_table_create: New.
956         (elf32_sparc_vxworks_final_write_processing): New.
957         (TARGET_BIG_SYM): Override for VxWorks.
958         (TARGET_BIG_NAME, ELF_MINPAGESIZE): Likewise.
959         (bfd_elf32_bfd_link_hash_table_create): Likewise.
960         (elf_backend_want_got_plt, elf_backend_plt_readonly): Likewise.
961         (elf_backend_got_header_size, elf_backend_add_symbol_hook): Likewise.
962         (elf_backend_link_output_symbol_hook): Likewise.
963         (elf_backend_emit_relocs): Likewise.
964         (elf_backend_final_write_processing, elf32_bed): Likewise.
965         * elfxx-sparc.c: Include libiberty.h and elf-vxworks.h.
966         (sparc_vxworks_exec_plt0_entry, sparc_vxworks_exec_plt_entry): New.
967         (sparc_vxworks_shared_plt0_entry, sparc_vxworks_shared_plt_entry): New.
968         (_bfd_sparc_elf_link_hash_table_create): Don't initialize
969         build_plt_entry here.
970         (create_got_section): Initialize sgotplt for VxWorks.
971         (_bfd_sparc_elf_create_dynamic_sections): Initialize build_plt_entry,
972         plt_header_size and plt_entry_size, with new VxWorks-specific settings.
973         Call elf_vxworks_create_dynamic_sections for VxWorks.
974         (allocate_dynrelocs): Use plt_header_size and plt_entry_size.
975         Allocate room for .got.plt and .rela.plt.unloaded entries on VxWorks.
976         (_bfd_sparc_elf_size_dynamic_sections): Don't allocate a nop in .plt
977         for VxWorks.  Check for the .got.plt section.
978         (sparc_vxworks_build_plt_entry): New function.
979         (_bfd_sparc_elf_finish_dynamic_symbol): Add handling of VxWorks PLTs.
980         Don't make _GLOBAL_OFFSET_TABLE_ and _PROCEDURE_LINKAGE_TABLE_
981         absolute on VxWorks.
982         (sparc32_finish_dyn): Add special handling for DT_RELASZ
983         and DT_PLTGOT on VxWorks.
984         (sparc_vxworks_finish_exec_plt): New.
985         (sparc_vxworks_finish_shared_plt): New.
986         (_bfd_sparc_elf_finish_dynamic_sections): Call them.
987         Use plt_header_size and plt_entry_size.
988         * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Add is_vxworks,
989         srelplt2, sgotplt, plt_header_size and plt_entry_size fields.
990         * Makefile.am (elfxx-sparc.lo): Depend on elf-vxworks.h.
991         (elf32-sparc.lo): Likewise.
992         * Makefile.in: Regenerate.
993         * targets.c (bfd_elf32_sparc_vxworks_vec): Declare.
994         (_bfd_target_vector): Add a pointer to it.
995
996 2006-03-30  Ben Elliston  <bje@au.ibm.com>
997
998         PR ld/2267
999         * elflink.c (elf_fixup_link_order): Ensure `elfsec' is not a
1000         special section number that exceeds the number of ELF sections
1001         (eg. SHN_MIPS_SCOMMON).
1002
1003 2006-03-27  Richard Sandiford  <richard@codesourcery.com>
1004
1005         * elfxx-mips.c (mips_got_entry): Add more commentary.
1006         (mips_elf_local_got_index): Use the hash table entry to record
1007         the GOT index of forced-local symbols.
1008         (mips_elf_initialize_tls_index): Rearrange code.  Store the index
1009         in either the hash table entry or the mips_got_entry, not both.
1010         Add more commentary.
1011         (mips_elf_multi_got): Make sure the g->next is nonnull when calling
1012         mips_elf_initialize_tls_index.
1013
1014 2006-03-25  Bernd Schmidt  <bernd.schmidt@analog.com>
1015
1016         * elf32-bfin.c (bfd_const_reloc, bfd_oper_reloc, bfin_push_reloc,
1017         RELOC_STACK_SIZE, reloc_stack, reloc_stack_tos, is_reloc_stack_empty,
1018         reloc_stack_push, reloc_stack_pop, reloc_stack_operate,
1019         bfin_areloc_howto_table): Delete.  All
1020         uses deleted as well.
1021         (bfin_reloc_map): Delete all stack relocs.
1022         (bfin_info_to_howto, bfin_bfd_reloc_type_lookup,
1023         bfin_reloc_type_lookup): Don't support them.
1024         (bfin_relocate_section): Don't try to handle them.
1025
1026         * config.bfd (bfin-*-*): Add bfd_elf32_bfinfdpic_vec.
1027         * configure.in: Likewise.
1028         * configure: Regenerate.
1029         * elf32-bfin.c: Include "elf/dwarf2.h" and "hashtab.h".
1030         (BFIN_RELOC_MAX): Now 0x21.
1031         (bfin_howto_table, bfin_reloc_map): Add FD-PIC relocs.
1032         (bfd_elf32_bfinfdpic_vec): Declare.
1033         (IS_FDPIC): New macro.
1034         (struct bfinfdpic_elf_link_hash_table): New struct.
1035         (bfinfdpic_hash_table, bfinfdpic_got_section,
1036         bfinfdpic_gotrel_section, bfinfdpic_gotfixup_section,
1037         bfinfdpic_plt_setion, bfinfdpic_pltrel_section,
1038         bfinfdpic_relocs_info, bfinfdpic_got_initial_offset,
1039         bfinfdpic_plt_initial_offset): Accessor macros for it.
1040         (BFINFDPIC_SYM_LOCAL, BFINFDPIC_FUNCDESC_LOCAL): New macros.
1041         (struct bfinfdpic_relocs_info): New struct.
1042         (LZPLT_RESOLVER_EXTRA, LZPLT_NORMAL_SIZE, LZPLT_ENTRIES,
1043         BFINFDPIC_LZPLT_BLOCK_SIZE, BFINFDPIC_LZPLT_RESOLV_LOC,
1044         DEFAULT_STACK_SIZE): New macros.
1045         (bfinfdpic_elf_link_hash_table_create, bfinfdpic_relocs_info_hash,
1046         bfinfdpic_relocs_info_eq, bfinfdpics_relocs_info_find,
1047         bfinfdpic_relocs_info_for_global, bfinfdpic_relocs_info_for_local,
1048         bfinfdpic_pic_merge_early_relocs_info, _bfinfdpic_add_dyn_reloc,
1049         _bfinfdpic_add_rofixup, _bfinfdpic_osec_to_segment,
1050         _bfinfdpic_osec_readonly_p, bfinfdpic_relocate_section,
1051         bfinfdpic_check_relocs, bfinfdpic_gc_sweep_hook,
1052         _bfinfdpic_link_omit_section_dynsym, _bfin_create_got_section,
1053         elf32_bfinfdpic_create_dynamic_sections, _bfinfdpic_get_fd_entry,
1054         _bfinfdpic_compute_got_alloc_data, _bfinfdpic_get_got_entry,
1055         _bfinfdpic_assign_got_entries, _bfinfdpic_assign_plt_entries,
1056         _bfinfdpic_resolve_final_relocs_info,
1057         elf32_bfinfdpic_size_dynamic_sections,
1058         elf32_bfinfdpic_always_size_sections,
1059         elf32_bfinfdpic_modify_segment_map,
1060         _bfinfdpic_count_got_plt_entries,
1061         elf32_bfinfdpic_finish_dynamic_sections,
1062         elf32_bfinfdpic_adjust_dynamic_symbol,
1063         elf32_bfinfdpic_finish_dynamic_symbol,
1064         elf32_bfinfdpic_elf_use_relative_eh_frame,
1065         elf32_bfinfdpic_elf_encode_eh_address,
1066         elf32_bfin_object_p, bfin_elf_copy_private_bfd_data,
1067         elf32_bfinfdpic_copy_private_bfd_data,
1068         (struct _bfinfdpic_dynamic_got_info,
1069         struct _bfinfdpic_dynamic_got_plt_info): New structs.
1070         (elf32_bfin_print_private_bfd_data): Print PIC flags.
1071         (elf32_bfin_merge_private_bfd_data): Extend to support FD-PIC.
1072         (TARGET_LITTLE_SYM, TARGET_LITTLE_NAME, elf32_bed,
1073         elf_backend_got_header_size, bfd_elf32_bfd_link_hash_table_create,
1074         elf_backend_always_size_sectinos, elf_backend_modify_segment_map,
1075         bfd_elf32_bfd_copy_private_bfd_data,
1076         elf_backend_create_dynamic_sections, elf_backend_adjust_dynamic_symbol,
1077         elf_backend_size_dynamic_sections, elf_backend_finish_dynamic_symbol,
1078         elf_backend_finish_dynamic_sections, elf_backend_relocate_section,
1079         elf_backend_can_make_relative_eh_frame, elf_backend_check_relocs,
1080         elf_backend_can_make_ldsa_relative_eh_frame, elf_backend_may_use_rel_p,
1081         elf_backend_may_use_rela_p, elf_backend_default_use_rela_p,
1082         elf_backend_omit_section_dynsym): Redefine these macros and include
1083         "elf32-target.h" again to create the elf32-bfinfdpic target.
1084         * reloc.c (BFD_RELOC_BFIN_GOT17M4, BFD_RELOC_BFIN_GOTHI,
1085         BFD_RELOC_BFIN_GOTLO, BFD_RELOC_BFIN_FUNCDESC,
1086         BFD_RELOC_BFIN_FUNCDESC_GOT17M4, BFD_RELOC_BFIN_FUNCDESC_GOTHI,
1087         BFD_RELOC_BFIN_FUNCDESC_GOTLO, BFD_RELOC_BFIN_FUNCDESC_VALUE,
1088         BFD_RELOC_BFIN_FUNCDESC_GOTOFF17M4, BFD_RELOC_BFIN_FUNCDESC_GOTOFFHI,
1089         BFD_RELOC_BFIN_FUNCDESC_GOTOFFLO, BFD_RELOC_BFIN_GOTOFFHI,
1090         BFD_RELOC_BFIN_GOTOFFLO): New.
1091         * targets.c (bfd_elf32_bfinfdpic_vec): New bfd_target.
1092         (_bfd_target_vector): Add it.
1093         * bfd-in2.h: Regenerate.
1094         * libbfd.h: Regenerate.
1095
1096 2006-03-25  Richard Sandiford  <richard@codesourcery.com>
1097
1098         * cpu-m68k.c (bfd_m68k_compatible): Treat ISA A+ and ISA B code as
1099         incompatible.  Likewise MAC and EMAC code.
1100         * elf32-m68k.c (elf32_m68k_merge_private_bfd_data): Use
1101         bfd_get_compatible to set the new bfd architecture.  Rely on it
1102         to detect incompatibilities.
1103
1104 2006-03-23  Michael Matz  <matz@suse.de>
1105
1106         * reloc.c: Add BFD_RELOC_X86_64_GOT64, BFD_RELOC_X86_64_GOTPCREL64,
1107         BFD_RELOC_X86_64_GOTPC64, BFD_RELOC_X86_64_GOTPLT64,
1108         BFD_RELOC_X86_64_PLTOFF64.
1109         * bfd-in2.h: Regenerated.
1110         * libbfd.h: Regenerated.
1111         * elf64-x86-64.c (x86_64_elf_howto_table): Correct comment.
1112         Add howtos for above relocs.
1113         (x86_64_reloc_map): Add mappings for new relocs.
1114         (elf64_x86_64_check_relocs): R_X86_64_GOT64, R_X86_64_GOTPCREL64,
1115         R_X86_64_GOTPLT64 need a got entry.  R_X86_64_GOTPLT64 also a PLT
1116         entry.  R_X86_64_GOTPC64 needs a .got section.  R_X86_64_PLTOFF64
1117         needs a PLT entry.
1118         (elf64_x86_64_gc_sweep_hook): Reflect changes from
1119         elf64_x86_64_check_relocs for the new relocs.
1120         (elf64_x86_64_relocate_section): Handle new relocs.
1121
1122 2006-03-22  Bob Wilson  <bob.wilson@acm.org>
1123
1124         * elf32-xtensa.c (xtensa_read_table_entries): Remove assertion that
1125         rel->r_addend is zero.
1126
1127 2006-03-22  Richard Sandiford  <richard@codesourcery.com>
1128
1129         * elfxx-mips.c (_bfd_mips_vxworks_finish_dynamic_symbol): Fix type
1130         of "loc".
1131
1132 2006-03-22  Richard Sandiford  <richard@codesourcery.com>
1133             Daniel Jacobowitz  <dan@codesourcery.com>
1134             Phil Edwards  <phil@codesourcery.com>
1135             Zack Weinberg  <zack@codesourcery.com>
1136             Mark Mitchell  <mark@codesourcery.com>
1137             Nathan Sidwell  <nathan@codesourcery.com>
1138
1139         * bfd-in2.h: Regenerate.
1140         * config.bfd (mips*-*-vxworks*, mips*el-*-vxworks*): New stanzas.
1141         * configure.in (bfd_elf32_bigmips_vxworks_vec): New stanza.
1142         (bfd_elf32_littlemips_vxworks_vec): Likewise.
1143         (bfd_elf32_bigmips_vec): Add elf-vxworks.lo.
1144         (bfd_elf32_littlemips_vec): Likewise.
1145         (bfd_elf32_nbigmips_vec): Likewise.
1146         (bfd_elf32_nlittlemips_vec): Likewise.
1147         (bfd_elf32_ntradbigmips_vec): Likewise.
1148         (bfd_elf32_ntradlittlemips_vec): Likewise.
1149         (bfd_elf32_tradbigmips_vec): Likewise.
1150         (bfd_elf32_tradlittlemips_vec): Likewise.
1151         (bfd_elf64_bigmips_vec): Likewise.
1152         (bfd_elf64_littlemips_vec): Likewise.
1153         (bfd_elf64_tradbigmips_vec): Likewise.
1154         (bfd_elf64_tradlittlemips_vec): Likewise.
1155         * elf32-mips.c: Include elf-vxworks.h.
1156         (mips_info_to_howto_rel): Use elf_backend_mips_rtype_to_howto
1157         instead of calling mips_elf32_rtype_to_howto directly.
1158         (mips_vxworks_copy_howto_rela): New reloc howto.
1159         (mips_vxworks_jump_slot_howto_rela): Likewise.
1160         (mips_vxworks_bfd_reloc_type_lookup): New function.
1161         (mips_vxworks_rtype_to_howto): Likewise.
1162         (mips_vxworks_final_write_processing): Likewise.
1163         (TARGET_LITTLE_SYM, TARGET_LITTLE_NAME): Override for VxWorks.
1164         (TARGET_BIG_SYM, TARGET_BIG_NAME, elf_bed, ELF_MAXPAGESIZE): Likewise.
1165         (elf_backend_want_got_plt): Likewise.
1166         (elf_backend_want_plt_sym): Likewise.
1167         (elf_backend_got_symbol_offset): Likewise.
1168         (elf_backend_want_dynbss): Likewise.
1169         (elf_backend_may_use_rel_p): Likewise.
1170         (elf_backend_may_use_rela_p): Likewise.
1171         (elf_backend_default_use_rela_p): Likewise.
1172         (elf_backend_got_header_size: Likewise.
1173         (elf_backend_plt_readonly): Likewise.
1174         (bfd_elf32_bfd_reloc_type_lookup): Likewise.
1175         (elf_backend_mips_rtype_to_howto): Likewise.
1176         (elf_backend_adjust_dynamic_symbol): Likewise.
1177         (elf_backend_finish_dynamic_symbol): Likewise.
1178         (bfd_elf32_bfd_link_hash_table_create): Likewise.
1179         (elf_backend_add_symbol_hook): Likewise.
1180         (elf_backend_link_output_symbol_hook): Likewise.
1181         (elf_backend_emit_relocs): Likewise.
1182         (elf_backend_final_write_processing: Likewise.
1183         (elf_backend_additional_program_headers): Likewise.
1184         (elf_backend_modify_segment_map): Likewise.
1185         (elf_backend_symbol_processing): Likewise.
1186         * elfxx-mips.c: Include elf-vxworks.h.
1187         (mips_elf_link_hash_entry): Add is_relocation_target and
1188         is_branch_target fields.
1189         (mips_elf_link_hash_table): Add is_vxworks, srelbss, sdynbss, srelplt,
1190         srelplt2, sgotplt, splt, plt_header_size and plt_entry_size fields.
1191         (MIPS_ELF_RELA_SIZE, MIPS_ELF_REL_DYN_NAME): New macros.
1192         (MIPS_RESERVED_GOTNO): Take a mips_elf_link_hash_table argument.
1193         Return 3 for VxWorks.
1194         (ELF_MIPS_GP_OFFSET): Change the argument from a bfd to a
1195         mips_elf_link_hash_table.  Return 0 for VxWorks.
1196         (MIPS_ELF_GOT_MAX_SIZE): Change the argument from a bfd to a
1197         mips_elf_link_hash_table.  Update the call to ELF_MIPS_GP_OFFSET.
1198         (mips_vxworks_exec_plt0_entry): New variable.
1199         (mips_vxworks_exec_plt_entry): Likewise.
1200         (mips_vxworks_shared_plt0_entry): Likewise.
1201         (mips_vxworks_shared_plt_entry): Likewise.
1202         (mips_elf_link_hash_newfunc): Initialize the new hash_entry fields.
1203         (mips_elf_rel_dyn_section): Change the bfd argument to a
1204         mips_elf_link_hash_table.  Use MIPS_ELF_REL_DYN_NAME to get
1205         the name of the section.
1206         (mips_elf_initialize_tls_slots): Update the call to
1207         mips_elf_rel_dyn_section.
1208         (mips_elf_gotplt_index): New function.
1209         (mips_elf_local_got_index): Add an input_section argument.
1210         Update the call to mips_elf_create_local_got_entry.
1211         (mips_elf_got_page): Likewise.
1212         (mips_elf_got16_entry): Likewise.
1213         (mips_elf_create_local_got_entry): Add bfd_link_info and input_section
1214         arguments.  Create dynamic relocations for each entry on VxWorks.
1215         (mips_elf_merge_gots): Update the use of MIPS_ELF_GOT_MAX_SIZE.
1216         (mips_elf_multi_got): Update the uses of MIPS_ELF_GOT_MAX_SIZE
1217         and MIPS_RESERVED_GOTNO.
1218         (mips_elf_create_got_section): Update the uses of
1219         MIPS_ELF_GOT_MAX_SIZE.  Create .got.plt on VxWorks.
1220         (is_gott_symbol): New function.
1221         (mips_elf_calculate_relocation): Use a dynobj local variable.
1222         Update the calls to mips_elf_local_got_index, mips_elf_got16_entry and
1223         mips_elf_got_page_entry.  Set G to the .got.plt entry when calculating
1224         VxWorks R_MIPS_CALL* relocations.  Calculate and use G for all GOT
1225         relocations on VxWorks.  Add dynamic relocations for references
1226         to the VxWorks __GOTT_BASE__ and __GOTT_INDEX__ symbols.  Don't
1227         create dynamic relocations for R_MIPS_32, R_MIPS_REL32 or R_MIPS_64
1228         in VxWorks executables.
1229         (mips_elf_allocate_dynamic_relocations): Add a bfd_link_info argument.
1230         Use MIPS_ELF_RELA_SIZE to calculate the size of a VxWorks entry.
1231         Don't allocate a null entry on VxWorks.
1232         (mips_elf_create_dynamic_relocation): Update the call to
1233         mips_elf_rel_dyn_section.  Use absolute rather than relative
1234         relocations for VxWorks, and make them RELA rather than REL.
1235         (_bfd_mips_elf_create_dynamic_sections): Don't make .dynamic
1236         read-only on VxWorks.  Update the call to mips_elf_rel_dyn_section.
1237         Create the .plt, .rela.plt, .dynbss and .rela.bss sections on
1238         VxWorks.  Likewise create the _PROCEDURE_LINKAGE_TABLE symbol.
1239         Call elf_vxworks_create_dynamic_sections for VxWorks and
1240         initialize the plt_header_size and plt_entry_size fields.
1241         (_bfd_mips_elf_check_relocs): Don't allow GOT relocations to be
1242         used in VxWorks executables.  Don't allocate dynamic relocations
1243         for R_MIPS_32, R_MIPS_REL32 or R_MIPS_64 in VxWorks executables.
1244         Set is_relocation_target for each symbol referenced by a relocation.
1245         Allocate .rela.dyn entries for relocations against the special
1246         VxWorks __GOTT_BASE__ and __GOTT_INDEX__ symbols.  Create GOT
1247         entries for all VxWorks R_MIPS_GOT16 relocations.  Don't allocate
1248         a global GOT entry for symbols mentioned in VxWorks R_MIPS_CALL*,
1249         R_MIPS_32, R_MIPS_REL32 or R_MIPS_64 relocations.  Update the calls
1250         to mips_elf_rel_dyn_section and mips_elf_allocate_dynamic_relocations.
1251         Set is_branch_target for symbols mentioned in R_MIPS_PC16 or R_MIPS_26
1252         relocations.  Don't set no_fn_stub on VxWorks.
1253         (_bfd_mips_elf_adjust_dynamic_symbol): Update the call to
1254         mips_elf_allocate_dynamic_relocations.
1255         (_bfd_mips_vxworks_adjust_dynamic_symbol): New function.
1256         (_bfd_mips_elf_always_size_sections): Do not allocate GOT page
1257         entries for VxWorks, and do not create multiple GOTs.
1258         (_bfd_mips_elf_size_dynamic_sections): Use MIPS_ELF_REL_DYN_NAME.
1259         Handle .got specially for VxWorks.  Update the uses of
1260         MIPS_RESERVED_GOTNO and mips_elf_allocate_dynamic_relocations.
1261         Check for sgotplt and splt.  Allocate the .rel(a).dyn contents last,
1262         once its final size is known.  Set DF_TEXTREL for VxWorks.  Add
1263         DT_RELA, DT_RELASZ, DT_RELAENT, DT_PLTREL, DT_PLTRELSZ and DT_JMPREL
1264         tags on VxWorks.  Do not add the MIPS-specific tags for VxWorks.
1265         (_bfd_mips_vxworks_finish_dynamic_symbol): New function.
1266         (mips_vxworks_finish_exec_plt): Likewise.
1267         (mips_vxworks_finish_shared_plt): Likewise.
1268         (_bfd_mips_elf_finish_dynamic_sections): Remove an unncessary call
1269         to mips_elf_rel_dyn_section.  Use a VxWorks-specific value of
1270         DT_PLTGOT.  Handle DT_RELA, DT_RELASZ, DT_RELAENT, DT_PLTREL,
1271         DT_PLTRELSZ and DT_JMPREL.  Update the uses of MIPS_RESERVED_GOTNO
1272         and mips_elf_rel_dyn_section.  Use a different GOT header for
1273         VxWorks.  Don't sort .rela.dyn on VxWorks.  Finish the PLT on VxWorks.
1274         (_bfd_mips_elf_link_hash_table_create): Initialize the new
1275         mips_elf_link_hash_table fields.
1276         (_bfd_mips_vxworks_link_hash_table_create): New function.
1277         (_bfd_mips_elf_final_link): Set the GP value to _GLOBAL_OFFSET_TABLE_
1278         on VxWorks.  Update the call to ELF_MIPS_GP_OFFSET.
1279         * elfxx-mips.h (_bfd_mips_vxworks_adjust_dynamic_symbol): Declare.
1280         (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise.
1281         (_bfd_mips_vxworks_link_hash_table_create): Likewise.
1282         * libbfd.h: Regenerate.
1283         * Makefile.am (elfxx-mips.lo): Depend on elf-vxworks.h.
1284         (elf32-mips.lo): Likewise.
1285         * Makefile.in: Regenerate.
1286         * reloc.c (BFD_RELOC_MIPS_COPY, BFD_RELOC_MIPS_JUMP_SLOT): Declare.
1287         * targets.c (bfd_elf32_bigmips_vxworks_vec): Declare.
1288         (bfd_elf32_littlemips_vxworks_vec): Likewise.
1289         (_bfd_target_vector): Add entries for them.
1290
1291 2006-03-19  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
1292
1293         * elf64-hppa.c (elf64_hppa_special_sections): Change flags for .tbss
1294         section from SHF_PARISC_WEAKORDER to SHF_HP_TLS.
1295         (elf_backend_special_sections): Remove #undef.
1296
1297 2006-03-18  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
1298
1299         * elf64-hppa.c (allocate_global_data_opd): Don't create an OPD entry
1300         for undefined weak symbols.
1301
1302 2006-03-17  Daniel Jacobowitz  <dan@codesourcery.com>
1303
1304         PR ld/2462
1305         * elflink.c (bfd_elf_final_link): Remove
1306         bed->elf_backend_emit_relocs from emit_relocs.
1307
1308 2006-03-17  Alexandre Oliva  <aoliva@redhat.com>
1309
1310         * elf32-ppc.c (ppc_elf_relocate_section): Copy addend from
1311         first relocation to the second when relaxing TLS GD to LE;
1312         zero it out when relaxing to IE.
1313
1314 2006-03-17  Alan Modra  <amodra@bigpond.net.au>
1315
1316         PR 2434
1317         * elflink.c (elf_link_add_object_symbols): Save and restore
1318         warning sym's linked sym.
1319
1320 2006-03-16  Alan Modra  <amodra@bigpond.net.au>
1321
1322         PR 2434
1323         * elflink.c (struct elf_smash_syms_data, elf_smash_syms): Delete.
1324         (elf_link_add_object_symbols): Delete unnecessary locals.  Rename
1325         hash_table -> htab.  Formatting.  Save entire symbol table
1326         before loading as-needed syms, and restore afterwards if lib not
1327         needed.  Use bfd_hash_allocate rather than bfd_alloc for sym
1328         name.  Free some buffers earlier.
1329         * bfd-in.h (struct bfd_hash_table): Add entsize.
1330         (bfd_hash_table_init, bfd_hash_table_init_n): Adjust prototype.
1331         * elf-bfd.h (_bfd_elf_link_hash_table_init): Likewise
1332         * hash.c (bfd_hash_table_init_n): Add entsize param, save to
1333         hash table.
1334         (bfd_hash_table_init): Add param, adjust calls.
1335         * aoutx.h: Adjust all hash_table_init functions and calls.
1336         * bfd.c: Likewise.
1337         * coff-arm.c: Likewise.
1338         * coff-h8300.c: Likewise.
1339         * coff-ppc.c: Likewise.
1340         * cofflink.c: Likewise.
1341         * ecoff.c: Likewise.
1342         * ecofflink.c: Likewise.
1343         * elf-m10300.c: Likewise.
1344         * elf-strtab.c: Likewise.
1345         * elf.c: Likewise.
1346         * elf32-arm.c: Likewise.
1347         * elf32-bfin.c: Likewise.
1348         * elf32-cris.c: Likewise.
1349         * elf32-frv.c: Likewise.
1350         * elf32-hppa.c: Likewise.
1351         * elf32-i386.c: Likewise.
1352         * elf32-m32r.c: Likewise.
1353         * elf32-m68hc1x.c: Likewise.
1354         * elf32-m68k.c: Likewise.
1355         * elf32-ppc.c: Likewise.
1356         * elf32-s390.c: Likewise.
1357         * elf32-sh.c: Likewise.
1358         * elf32-vax.c: Likewise.
1359         * elf64-alpha.c: Likewise.
1360         * elf64-hppa.c: Likewise.
1361         * elf64-ppc.c: Likewise.
1362         * elf64-s390.c: Likewise.
1363         * elf64-sh64.c: Likewise.
1364         * elf64-x86-64.c: Likewise.
1365         * elfxx-ia64.c: Likewise.
1366         * elfxx-mips.c: Likewise.
1367         * elfxx-sparc.c: Likewise.
1368         * i386linux.c: Likewise.
1369         * libaout.h: Likewise.
1370         * libbfd-in.h: Likewise.
1371         * libcoff-in.h: Likewise.
1372         * linker.c: Likewise.
1373         * m68klinux.c: Likewise.
1374         * merge.c: Likewise.
1375         * opncls.c: Likewise.
1376         * pdp11.c: Likewise.
1377         * sparclinux.c: Likewise.
1378         * stabs.c: Likewise.
1379         * sunos.c: Likewise.
1380         * vms.c: Likewise.
1381         * xcofflink.c: Likewise.
1382         * section.c (struct section_hash_entry): Move to..
1383         * libbfd-in.h: ..here.
1384         * Makefile.am: Run "make dep-am"
1385         * Makefile.in: Regenerate.
1386         * bfd-in2.h: Regenerate.
1387         * libbfd.h: Regenerate.
1388         * libcoff.h: Regenerate.
1389
1390 2006-03-16  Alan Modra  <amodra@bigpond.net.au>
1391
1392         * elf32-ppc.c (ppc_elf_check_relocs): REL24 and REL14 relocs
1393         against __GLOBAL_OFFSET_TABLE__ need never be dynamic.  Tweak
1394         last change to REL32 relocs so that they are counted as
1395         possibly dynamic as per REL24 and REL14.
1396
1397 2006-03-16  Alan Modra  <amodra@bigpond.net.au>
1398
1399         * elf32-ppc.c (ppc_elf_check_relocs): Don't fall into REL24
1400         checks from REL32.
1401
1402 2006-03-15  Ben Elliston  <bje@au.ibm.com>
1403
1404         * elf32-arm.c (elf32_arm_merge_eabi_attributes): Iterate over all
1405         in_list elements, not just the first.
1406         
1407 2006-03-14  Richard Sandiford  <richard@codesourcery.com>
1408
1409         * elf32-mips.c (mips_elf_adjust_addend): New function, mostly split
1410         out from...
1411         (_bfd_mips_elf_relocate_section): ...here.  Use it to adjust r_addend
1412         for final links too.
1413
1414 2006-03-13  Richard Sandiford  <richard@codesourcery.com>
1415
1416         * elfxx-mips.c (mips_elf_create_got_section): Initialize hgot.
1417
1418 2006-03-11  H.J. Lu  <hongjiu.lu@intel.com>
1419
1420         PR ld/2443
1421         * dwarf2.c (concat_filename): Don't issue an error if file is 0.
1422
1423 2006-03-10  Paul Brook  <paul@codesourcery.com>
1424
1425         * elf32-arm.c (INTERWORK_FLAG): Handle EABIv5.
1426         (elf32_arm_print_private_bfd_data): Ditto.
1427
1428 2006-03-09  Paul Brook  <paul@codesourcery.com>
1429
1430         * cpu-arm.c (bfd_is_arm_mapping_symbol_name): Recognise additional
1431         mapping symbols.
1432
1433 2006-03-09  Khem Raj  <khem@mvista.com>
1434
1435         * elf32-arm.c(elf32_arm_finish_dynamic_sections): Use unsigned
1436         char type.
1437
1438 2006-03-08  H.J. Lu  <hongjiu.lu@intel.com>
1439
1440         * elfxx-ia64.c (elfNN_ia64_choose_gp): Properly choose gp.
1441
1442 2006-03-07  Richard Sandiford  <richard@codesourcery.com>
1443             Daniel Jacobowitz  <dan@codesourcery.com>
1444             Zack Weinberg  <zack@codesourcery.com>
1445             Nathan Sidwell  <nathan@codesourcery.com>
1446             Paul Brook  <paul@codesourcery.com>
1447             Ricardo Anguiano  <anguiano@codesourcery.com>
1448             Phil Edwards  <phil@codesourcery.com>
1449
1450         * configure.in (bfd_elf32_bigarm_vec): Include elf-vxworks.lo.
1451         (bfd_elf32_bigarm_symbian_vec): Likewise.
1452         (bfd_elf32_bigarm_vxworks_vec): Likewise.
1453         (bfd_elf32_littlearm_vec): Likewise.
1454         (bfd_elf32_littlearm_symbian_vec): Likewise.
1455         (bfd_elf32_littlearm_vxworks_vec): Likewise.
1456         * configure: Regenerate.
1457         * elf32-arm.c: Include libiberty.h and elf-vxworks.h.
1458         (RELOC_SECTION, RELOC_SIZE, SWAP_RELOC_IN, SWAP_RELOC_OUT): New macros.
1459         (elf32_arm_vxworks_bed): Add forward declaration.
1460         (elf32_arm_howto_table_1): Fix the masks for R_ASM_ABS12.
1461         (elf32_arm_vxworks_exec_plt0_entry): New table.
1462         (elf32_arm_vxworks_exec_plt_entry): Likewise.
1463         (elf32_arm_vxworks_shared_plt_entry): Likewise.
1464         (elf32_arm_link_hash_table): Add vxworks_p and srelplt2 fields.
1465         (reloc_section_p): New function.
1466         (create_got_section): Use RELOC_SECTION.
1467         (elf32_arm_create_dynamic_sections): Likewise.  Call
1468         elf_vxworks_create_dynamic_sections for VxWorks targets.
1469         Choose between the two possible values of plt_header_size
1470         and plt_entry_size.
1471         (elf32_arm_link_hash_table_create): Initialize vxworks_p and srelplt2.
1472         (elf32_arm_abs12_reloc): New function.
1473         (elf32_arm_final_link_relocate): Call it.  Allow the creation of
1474         dynamic R_ARM_ABS12 relocs on VxWorks.  Use reloc_section_p,
1475         RELOC_SIZE, SWAP_RELOC_OUT and RELOC_SECTION.  Initialize the
1476         r_addend fields of relocs.  On rela targets, skip any code that
1477         adjusts in-place addends.  When using _bfd_link_final_relocate
1478         to perform a final relocation, pass rel->r_addend as the addend
1479         argument.
1480         (elf32_arm_merge_private_bfd_data): If one of the bfds is a VxWorks
1481         object, ignore flags that are not standard on VxWorks.
1482         (elf32_arm_check_relocs): Allow the creation of dynamic R_ARM_ABS12
1483         relocs on VxWorks.  Use reloc_section_p.
1484         (elf32_arm_adjust_dynamic_symbol): Use RELOC_SECTION and RELOC_SIZE.
1485         (allocate_dynrelocs): Use RELOC_SIZE.  Account for the size of
1486         .rela.plt.unloaded relocs on VxWorks targets.
1487         (elf32_arm_size_dynamic_sections): Use RELOC_SIZE.  Check for
1488         .rela.plt.unloaded as well as .rel(a).plt.  Add DT_RELA* tags
1489         instead of DT_REL* tags on RELA targets.
1490         (elf32_arm_finish_dynamic_symbol): Use RELOC_SECTION, RELOC_SIZE
1491         and SWAP_RELOC_OUT.  Initialize r_addend fields.  Handle VxWorks
1492         PLT entries.  Do not make _GLOBAL_OFFSET_TABLE_ absolute on VxWorks.
1493         (elf32_arm_finish_dynamic_sections): Use RELOC_SECTION, RELOC_SIZE
1494         and SWAP_RELOC_OUT.  Initialize r_addend fields.  Handle DT_RELASZ
1495         like DT_RELSZ.  Handle the VxWorks form of initial PLT entry.
1496         Correct the .rela.plt.unreloaded symbol indexes.
1497         (elf32_arm_output_symbol_hook): Call the VxWorks version of this
1498         hook on VxWorks targets.
1499         (elf32_arm_vxworks_link_hash_table_create): Set vxworks_p to true.
1500         Minor formatting tweak.
1501         (elf32_arm_vxworks_final_write_processing): New function.
1502         (elf_backend_add_symbol_hook): Override for VxWorks and reset
1503         for Symbian.
1504         (elf_backend_final_write_processing): Likewise.
1505         (elf_backend_emit_relocs): Likewise.
1506         (elf_backend_want_plt_sym): Likewise.
1507         (ELF_MAXPAGESIZE): Likewise.
1508         (elf_backend_may_use_rel_p): Minor formatting tweak.
1509         (elf_backend_may_use_rela_p): Likewise.
1510         (elf_backend_default_use_rela_p): Likewise.
1511         (elf_backend_rela_normal): Likewise.
1512         * Makefile.in (elf32-arm.lo): Depend on elf-vxworks.h.
1513
1514 2006-03-06  Nathan Sidwell  <nathan@codesourcery.com>
1515
1516         * archures.c (bfd_mach_mcf_isa_a_nodiv, bfd_mach_mcf_isa_b_nousp):
1517         New.  Adjust other variants.
1518         (bfd_default_scan): Update.
1519         * bfd-in2.h: Rebuilt.
1520         * cpu-m68k.c: Adjust.
1521         (bfd_m68k_compatible): New. Use it for architectures.
1522         * elf32-m68k.c (elf32_m68k_object_p): Adjust.
1523         (elf32_m68k_merge_private_bfd_data): Adjust.  Correct isa-a/b
1524         mismatch.
1525         (elf32_m68k_print_private_bfd_data): Adjust.
1526         * ieee.c (ieee_write_processor): Adjust.
1527         
1528 2006-03-06  Alan Modra  <amodra@bigpond.net.au>
1529
1530         * dwarf2.c: Formatting.
1531         (add_line_info): Remove outer loop.
1532
1533 2006-03-05  H.J. Lu  <hongjiu.lu@intel.com>
1534             Alan Modra  <amodra@bigpond.net.au>
1535
1536         PR binutils/2338
1537         * dwarf2.c (loadable_section): New struct.
1538         (dwarf2_debug): Add loadable_section_count and
1539         loadable_sections.
1540         (new_line_sorts_after): New.
1541         (add_line_info): Use new_line_sorts_after to compare line
1542         addresses.
1543         (check_function_name): Removed.
1544         (unset_sections): New.
1545         (place_sections): New.
1546         (_bfd_dwarf2_find_nearest_line): Updated. Call place_sections
1547         and unset_sections on relocatable files.
1548         (_bfd_dwarf2_find_line): Likewise.
1549
1550 2006-03-03  Nick Clifton  <nickc@redhat.com>
1551
1552         * cpu-avr.c: Update to ISO-C90 formatting.
1553         * elf32-avr.c: Likewise.
1554
1555 2006-03-03  Bjoern Haase  <bjoern.m.haase@web.de>
1556
1557         * elf32-avr.c (avr_reloc_map): Insert BFD_RELOC_AVR_MS8_LDI
1558         and R_AVR_MS8_LDI 
1559         (bfd_elf_avr_final_write_processing): Set
1560         EF_AVR_LINKRELAX_PREPARED in e_flags field.
1561         (elf32_avr_relax_section): New function.
1562         (elf32_avr_relax_delete_bytes): New function.
1563         (elf32_avr_get_relocated_section_contents): New function.
1564         (avr_pc_wrap_around): New function.
1565         (avr_relative_distance_considering_wrap_around): New function.
1566         (avr_final_link_relocate): Handle negative int8t_t immediate for R_AVR_LDI.
1567         * reloc.c: Add BFD_RELOC_AVR_MS8_LDI and BFD_RELOC_AVR_LDI_NEG
1568         * libbfd.h: Regenerate.
1569         * bfd-in2.h: Regenerate.
1570
1571 2006-03-02  DJ Delorie  <dj@redhat.com>
1572
1573         * elf32-m32c.c (m32c_offset_for_reloc): Fix local symbol
1574         calculations.
1575
1576 2006-03-02  Richard Sandiford  <richard@codesourcery.com>
1577
1578         * elf32-ppc.c (is_ppc_elf_target): Return true if the target is
1579         bfd_elf32_powerpc_vxworks_vec.
1580
1581 2006-03-02  Nick Clifton  <nickc@redhat.com>
1582
1583         * elf32-m32c.c (m32c_elf_relax_section): Initialise 'gap'.
1584
1585 2006-03-02  Richard Sandiford  <richard@codesourcery.com>
1586
1587         * elf32-i386.c (elf_i386_create_dynamic_sections): Use
1588         elf_vxworks_create_dynamic_sections.
1589         (elf_i386_size_dynamic_sections): Remove VxWorks GOT and PLT
1590         symbol handling.
1591         * elf32-ppc.c (ppc_elf_create_dynamic_sections): Use
1592         elf_vxworks_create_dynamic_sections.
1593         (ppc_elf_size_dynamic_sections): Remove VxWorks GOT and PLT
1594         symbol handling.
1595         * elf-vxworks.c (elf_vxworks_create_dynamic_sections): New function.
1596         * elf-vxworks.h (elf_vxworks_create_dynamic_sections): Declare.
1597
1598 2006-03-02  Richard Sandiford  <richard@codesourcery.com>
1599
1600         * elf32-i386.c (elf_i386_vxworks_link_output_symbol_hook): Delete.
1601         (elf_backend_link_output_symbol_hook): Use
1602         elf_vxworks_link_output_symbol_hook instead.
1603         * elf32-ppc.c (elf_i386_vxworks_link_output_symbol_hook): Delete.
1604         (elf_backend_link_output_symbol_hook): Use
1605         elf_vxworks_link_output_symbol_hook instead.
1606         * elf-vxworks.c (elf_vxworks_link_output_symbol_hook): Provide the
1607         same interface as elf_backend_link_output_symbol_hook.
1608         * elf-vxworks.h (elf_vxworks_link_output_symbol_hook): Update
1609         prototype accordingly.
1610
1611 2006-03-02  Richard Sandiford  <richard@codesourcery.com>
1612
1613         * elf32-ppc.c (ppc_elf_plt_type): New enumeration.
1614         (ppc_elf_link_hash_table): Replace old_got and new_got with
1615         plt_type and can_use_new_plt.
1616         (ppc_elf_create_dynamic_sections): Add SEC_HAS_CONTENTS,
1617         SEC_LOAD and SEC_READONLY to the VxWorks .plt flags.
1618         (ppc_elf_check_relocs): Set can_use_new_plt instead of new_plt.
1619         Move from plt_type == PLT_UNSET to PLT_OLD instead of setting old_plt.
1620         (ppc_elf_select_plt_layout): Move from plt_type == PLT_UNSET to
1621         either plt_type == PLT_OLD or plt_type == PLT_NEW.  Assert that
1622         this function should not be called for VxWorks targets.
1623         (ppc_elf_tls_setup): Use plt_type instead of old_got.
1624         (allocate_got): Likewise.  Rearrange so that max_before_header
1625         is only used for PLT_OLD and PLT_NEW.
1626         (allocate_dynrelocs): Use plt_type instead of old_got and is_vxworks.
1627         (ppc_elf_size_dynamic_sections): Likewise.
1628         (ppc_elf_relax_section): Likewise.
1629         (ppc_elf_relocate_section): Likewise.
1630         (ppc_elf_finish_dynamic_symbol): Likewise.
1631         (ppc_elf_vxworks_link_hash_table_create): Initialize plt_type.
1632
1633 2006-02-28  Richard Sandiford  <richard@codesourcery.com>
1634
1635         * elf32-i386.c (elf_i386_link_hash_table): Add next_tls_desc_index.
1636         (elf_i386_link_hash_table_create): Initialize it.
1637         (elf_i386_compute_jump_table_size): Use it instead of
1638         srelplt->reloc_count.
1639         (allocate_dynrelocs): Likewise.
1640         (elf_i386_size_dynamic_sections): Likewise.
1641         (elf_i386_relocate_section): Likewise.
1642         
1643 2006-02-27  Jakub Jelinek  <jakub@redhat.com>
1644
1645         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Handle S flag.
1646         (_bfd_elf_write_section_eh_frame): Likewise.
1647
1648 2006-02-27  Carlos O'Donell  <carlos@codesourcery.com>
1649
1650         * po/Make-in: Add html target.
1651
1652 2006-02-27  Richard Sandiford  <richard@codesourcery.com>
1653
1654         * elf-m10300.c (_bfd_mn10300_elf_finish_dynamic_symbol): Use the
1655         cached hgot entry to check for _GLOBAL_OFFSET_TABLE_.
1656         * elf32-arm.c (elf32_arm_finish_dynamic_symbol): Likewise.
1657         * elf32-bfin.c (bfin_finish_dynamic_symbol): Likewise.
1658         * elf32-cris.c (elf_cris_finish_dynamic_symbol): Likewise.
1659         * elf32-hppa.c (elf32_hppa_finish_dynamic_symbol): Likewise.
1660         * elf32-i386.c (elf_i386_finish_dynamic_symbol): Likewise.
1661         * elf32-m32r.c (m32r_elf_finish_dynamic_symbol): Likewise.
1662         * elf32-m68k.c (elf_m68k_finish_dynamic_symbol): Likewise.
1663         * elf32-sh.c (sh_elf_finish_dynamic_symbol): Likewise.
1664         * elf32-vax.c (elf_vax_finish_dynamic_symbol): Likewise.
1665         * elf32-xtensa.c (elf_xtensa_finish_dynamic_symbol): Likewise.
1666         * elf64-sh64.c (sh64_elf64_finish_dynamic_symbol): Likewise.
1667         * elf64-x86-64.c (elf64_x86_64_finish_dynamic_symbol): Likewise.
1668         * elfxx-mips.c (_bfd_mips_elf_finish_dynamic_symbol): Likewise.
1669         * elf32-s390.c (elf_s390_finish_dynamic_symbol): Likewise.  Also use
1670         the cached hplt entry to check for _PROCEDURE_LINKAGE_TABLE_.
1671         * elf64-alpha.c (elf64_alpha_finish_dynamic_symbol): Likewise.
1672         * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
1673         * elfxx-ia64.c (elfNN_ia64_finish_dynamic_symbol): Likewise.
1674         * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Likewise.
1675
1676 2006-02-25  Richard Sandiford  <richard@codesourcery.com>
1677
1678         * elf-bfd.h (elf_link_hash_table): Add hplt field.
1679         * elflink.c (_bfd_elf_create_dynamic_sections): Initialize it.
1680         * elf-m10300.c (_bfd_mn10300_elf_create_got_section): Likewise.
1681         * elf32-frv.c (_frv_create_got_section): Likewise.
1682         * elf32-m32r.c (m32r_elf_create_dynamic_sections): Likewise.
1683         * elf32-sh.c (sh_elf_create_dynamic_sections): Likewise.
1684         * elf64-alpha.c (elf64_alpha_create_dynamic_sections): Likewise.
1685         * elf64-sh64.c (sh64_elf64_create_dynamic_sections): Likewise.
1686         * elf32-i386.c (elf_i386_link_hash_table): Remove hgot and hplt.
1687         (elf_i386_link_hash_table_create): Don't initialize them.
1688         (elf_i386_size_dynamic_sections): Use the generic ELF hplt and
1689         hgot fields.
1690         (elf_i386_finish_dynamic_symbol): Likewise.
1691         * elf32-ppc.c (ppc_elf_link_hash_table): Remove hplt.
1692         (ppc_elf_size_dynamic_sections): Use the generic ELF hplt fields.
1693         (ppc_elf_finish_dynamic_symbol): Likewise.
1694         
1695 2006-02-24  DJ Delorie  <dj@redhat.com>
1696
1697         * elf32-m32c.c (m32c_elf_howto_table): Add relaxation relocs.
1698         (m32c_elf_relocate_section): Don't relocate them.
1699         (compare_reloc): New.
1700         (relax_reloc): Remove.
1701         (m32c_offset_for_reloc): New.
1702         (m16c_addr_encodings): New.
1703         (m16c_jmpaddr_encodings): New.
1704         (m32c_addr_encodings): New.
1705         (m32c_elf_relax_section): Relax jumps and address displacements.
1706         (m32c_elf_relax_delete_bytes): Adjust for internal syms.  Fix up
1707         short jumps.
1708
1709         * reloc.c: Add m32c relax relocs.
1710         * libbfd.h: Regenerate.
1711         * bfd-in2.h: Regenerate.
1712         
1713 2006-02-24  H.J. Lu  <hongjiu.lu@intel.com>
1714
1715         PR ld/2218
1716         * elf-bfd.h (elf_backend_data): Add elf_backend_fixup_symbol.
1717         (_bfd_elf_link_hash_fixup_symbol): New.
1718
1719         * elflink.c (_bfd_elf_link_hash_fixup_symbol): New.
1720         (_bfd_elf_fix_symbol_flags): Call elf_backend_fixup_symbol if
1721         it isn't NULL.
1722
1723         * elfxx-ia64.c (elf_backend_fixup_symbol): Defined.
1724
1725         * elfxx-target.h (elf_backend_fixup_symbol): New.
1726         (elfNN_bed): Initialize elf_backend_fixup_symbol.
1727
1728 2006-02-23  H.J. Lu  <hongjiu.lu@intel.com>
1729
1730         * cpu-ia64-opc.c (ins_immu5b): New.
1731         (ext_immu5b): Likewise.
1732         (elf64_ia64_operands): Add IMMU5b.
1733
1734 2006-02-21  Alan Modra  <amodra@bigpond.net.au>
1735
1736         PR ld/2218
1737         * elf32-arm.c (allocate_dynrelocs): Ensure undef weak sym in pie
1738         is dynamic.
1739         * elf32-hppa.c (allocate_dynrelocs): Likewise.
1740         * elf32-i386.c (allocate_dynrelocs): Likewise.
1741         * elf32-s390.c (allocate_dynrelocs): Likewise.
1742         * elf32-sh.c (allocate_dynrelocs): Likewise.
1743         * elf64-s390.c (allocate_dynrelocs): Likewise.
1744         * elf64-x86-64.c (allocate_dynrelocs): Likewise.
1745         * elf32-m32r.c (allocate_dynrelocs): Likewise.  Discard relocs
1746         on undef weak with non-default visibility too.
1747         * elfxx-sparc.c (allocate_dynrelocs): Ditto.
1748
1749 2006-02-21  Alan Modra  <amodra@bigpond.net.au>
1750
1751         * bfd.c: (_bfd_default_error_handler): Don't call abort on
1752         error, instead call _exit.
1753         (_bfd_abort): Call _exit not xexit.
1754
1755 2006-02-17  Kevin Buettner  <kevinb@redhat.com>
1756
1757         * elf32-frv.c (elf32_frv_grok_prstatus, elf32_frv_grok_psinfo):
1758         New functions.
1759         * elf_backend_grok_prstatus, elf_backend_grok_psinfo): Define.
1760
1761 2006-02-17  Shrirang Khisti  <shrirangk@kpitcummins.com>
1762             Anil Paranjape   <anilp1@kpitcummins.com>
1763             Shilin Shakti    <shilins@kpitcummins.com>
1764
1765         * Makefile.am: Add xc16x related entry 
1766         * Makefile.in: Regenerate 
1767         * archures.c: Add bfd_xc16x_arch 
1768         * bfd-in2.h: Regenerate
1769         * config.bfd: Add xc16x-*-elf
1770         * configure.in: Add bfd_elf32_xc16x_vec
1771         * configure: Regenerate.
1772         * targets.c: Added xc16x related information
1773         * cpu-xc16x.c: New file
1774         * reloc.c: Add new relocations specific to xc16x:
1775         BFD_RELOC_XC16X_PAG, BFD_RELOC_XC16X_POF, BFD_RELOC_XC16X_SEG,
1776         BFD_RELOC_XC16X_SOF     
1777         * elf32-xc16x.c: New file.
1778
1779 2006-02-17  Alan Modra  <amodra@bigpond.net.au>
1780
1781         * elf32-ppc.c (allocate_dynrelocs): Tweak undef weak handling.
1782         * elf64-ppc.c (allocate_dynrelocs): Likewise.
1783
1784 2006-02-17  Alan Modra  <amodra@bigpond.net.au>
1785
1786         PR ld/2218
1787         * elf64-ppc.c (allocate_dynrelocs): Ensure undef weak sym is
1788         dynamic.
1789         (ppc64_elf_relocate_section): Check output reloc section size.
1790         * elf32-ppc.c (allocate_dynrelocs): Simplify undef weak test.
1791
1792 2006-02-16  H.J. Lu  <hongjiu.lu@intel.com>
1793
1794         PR ld/2322
1795         * elf.c (get_segment_type): New function.
1796         (_bfd_elf_print_private_bfd_data): Use it.
1797         (print_segment_map): New function.
1798         (assign_file_positions_for_segments): Call print_segment_map
1799         when there are not enough room for program headers.
1800
1801 2006-02-16  Nick Hudson  <nick.hudson@dsl.pipex.com>
1802
1803         * config.bfd (mips*el-*-netbsd*, mips*-*-netbsd*): Use
1804         traditional MIPS ELF targets.
1805
1806 2006-02-15  H.J. Lu  <hongjiu.lu@intel.com>
1807
1808         PR binutils/2338
1809         * dwarf2.c (check_function_name): New function.
1810         (_bfd_dwarf2_find_nearest_line): Use check_function_name to
1811         check if function is correct.
1812
1813 2006-02-16  Alan Modra  <amodra@bigpond.net.au>
1814
1815         * elflink.c (_bfd_elf_default_action_discarded): Return 0 for
1816         debug sections.
1817         (elf_link_input_bfd): Adjust comments.
1818
1819 2006-02-10  H.J. Lu  <hongjiu.lu@intel.com>
1820
1821         * elf.c (copy_private_bfd_data): Minor update.
1822
1823 2006-02-10  H.J. Lu  <hongjiu.lu@intel.com>
1824
1825         PR binutils/2258
1826         * elf.c (copy_private_bfd_data): Renamed to ...
1827         (rewrite_elf_program_header): This.
1828         (copy_elf_program_header): New function.
1829         (copy_private_bfd_data): Likewise.
1830
1831 2006-02-07  Nathan Sidwell  <nathan@codesourcery.com>
1832
1833         * archures.c (bfd_mach_mcf5200, bfd_mach_mcf5206e,
1834         bfd_mach_mcf5307, bfd_mach_mcf5407, bfd_mach_mcf528x,
1835         bfd_mach_mcfv4e, bfd_mach_mcf521x, bfd_mach_mcf5249,
1836         bfd_mach_mcf547x, bfd_mach_mcf548x): Remove.
1837         (bfd_mach_mcf_isa_a, bfd_mach_mcf_isa_a_div,
1838         bfd_mach_mcf_isa_a_div_mac, bfd_mach_mcf_isa_a_div_emac,
1839         bfd_mach_mcf_isa_aplus, bfd_mach_mcf_isa_aplus_mac,
1840         bfd_mach_mcf_isa_aplus_emac, bfd_mach_mcf_isa_aplus_usp,
1841         bfd_mach_mcf_isa_aplus_usp_mac, bfd_mach_mcf_isa_aplus_usp_emac,
1842         bfd_mach_mcf_isa_b, bfd_mach_mcf_isa_b_mac, bfd_mach_mcf_isa_b_emac,
1843         bfd_mach_mcf_isa_b_usp_float, bfd_mach_mcf_isa_b_usp_float_mac,
1844         bfd_mach_mcf_isa_b_usp_float_emac): New.
1845         (bfd_default_scan): Update coldfire mapping.
1846         * bfd-in.h (bfd_m68k_mach_to_features,
1847         bfd_m68k_features_to_mach): Declare.
1848         * bfd-in2.h: Rebuilt.
1849         * cpu-m68k.c (arch_info_struct): Add new coldfire machines,
1850         adjust legacy names.
1851         (m68k_arch_features): New.
1852         (bfd_m68k_mach_to_features,
1853         bfd_m68k_features_to_mach): Define.
1854         * elf32-m68k.c (elf32_m68k_object_p): New.
1855         (elf32_m68k_merge_private_bfd_data): Merge the CF EF flags.
1856         (elf32_m68k_print_private_bfd_data): Print the CF EF flags.
1857         (elf_backend_object_p): Define.
1858         * ieee.c (ieee_write_processor): Update coldfire machines.
1859         * libbfd.h: Rebuilt.
1860
1861 2006-02-06  Steve Ellcey  <sje@cup.hp.com>
1862
1863         * elfxx-ia64.c (elfNN_ia64_fake_sections): Set SHF_IA_64_HP_TLS
1864         if SHF_TLS is set.
1865
1866 2006-02-05  Arnold Metselaar  <arnold.metselaar@planet.nl>
1867
1868         * coff-z80.c (r_imm24): New howto. 
1869         (rtype2howto): New case R_IMM24.
1870         (coff_z80_reloc_type_lookup): New case BFD_RELOC_24.
1871         (extra_case): Use bfd_get_8 for R_IMM8, new case R_IMM24.
1872
1873 2006-02-04  Richard Sandiford  <richard@codesourcery.com>
1874
1875         * elfxx-mips.c (mips_elf_initialize_tls_index): If a TLS symbol
1876         has already been assigned a GOT index, copy that index to the
1877         current hash table entry.
1878
1879 2006-02-01  Eric Botcazou  <ebotcazou@libertysurf.fr>
1880
1881         * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Reinstate bypass
1882         for call-to-undefweak reloc overflow.
1883
1884 2006-01-31  Eric Botcazou  <ebotcazou@libertysurf.fr>
1885
1886         * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Reinstate bypass
1887         for 32-bit relocs overflow.
1888
1889 2006-01-27  Paul Brook  <paul@codesourcery.com>
1890
1891         * elf32-arm.c (elf32_arm_get_symbol_type): Allow STT_TLS thumb
1892         objects.
1893
1894 2006-01-18  Alexandre Oliva  <aoliva@redhat.com>
1895
1896         Introduce TLS descriptors for i386 and x86_64.
1897         * reloc.c (BFD_RELOC_386_TLS_GOTDESC, BFD_RELOC_386_TLS_DESC,
1898         BFD_RELOC_386_TLS_DESC_CALL, BFD_RELOC_X86_64_GOTPC32_TLSDESC,
1899         BFD_RELOC_X86_64_TLSDESC, BFD_RELOC_X86_64_TLSDESC_CALL): New.
1900         * libbfd.h, bfd-in2.h: Rebuilt.
1901         * elf32-i386.c (elf_howto_table): New relocations.
1902         (R_386_tls): Adjust.
1903         (elf_i386_reloc_type_lookup): Map new relocations.
1904         (GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P): New macros.
1905         (GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): New macros.
1906         (struct elf_i386_link_hash_entry): Add tlsdesc_got field.
1907         (struct elf_i386_obj_tdata): Add local_tlsdesc_gotent field.
1908         (elf_i386_local_tlsdesc_gotent): New macro.
1909         (struct elf_i386_link_hash_table): Add sgotplt_jump_table_size.
1910         (elf_i386_compute_jump_table_size): New macro.
1911         (link_hash_newfunc): Initialize tlsdesc_got.
1912         (elf_i386_link_hash_table_create): Set sgotplt_jump_table_size.
1913         (elf_i386_tls_transition): Handle R_386_TLS_GOTDESC and
1914         R_386_TLS_DESC_CALL.
1915         (elf_i386_check_relocs): Likewise.  Allocate space for
1916         local_tlsdesc_gotent.
1917         (elf_i386_gc_sweep_hook): Handle R_386_TLS_GOTDESC and
1918         R_386_TLS_DESC_CALL.
1919         (allocate_dynrelocs): Count function PLT relocations.  Reserve
1920         space for TLS descriptors and relocations.
1921         (elf_i386_size_dynamic_sections): Reserve space for TLS
1922         descriptors and relocations.  Set up sgotplt_jump_table_size.
1923         Don't zero reloc_count in srelplt.
1924         (elf_i386_always_size_sections): New.  Set up _TLS_MODULE_BASE_.
1925         (elf_i386_relocate_section): Handle R_386_TLS_GOTDESC and
1926         R_386_TLS_DESC_CALL.
1927         (elf_i386_finish_dynamic_symbol): Use GOT_TLS_GD_ANY_P.
1928         (elf_backend_always_size_sections): Define.
1929         * elf64-x86-64.c (x86_64_elf_howto): Add R_X86_64_GOTPC32_TLSDESC,
1930         R_X86_64_TLSDESC, R_X86_64_TLSDESC_CALL.
1931         (R_X86_64_standard): Adjust.
1932         (x86_64_reloc_map): Map new relocs.
1933         (elf64_x86_64_rtype_to_howto): New, split out of...
1934         (elf64_x86_64_info_to_howto): ... this function, and...
1935         (elf64_x86_64_reloc_type_lookup): ... use it to map elf_reloc_val.
1936         (GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P): New macros.
1937         (GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): New macros.
1938         (struct elf64_x86_64_link_hash_entry): Add tlsdesc_got field.
1939         (struct elf64_x86_64_obj_tdata): Add local_tlsdesc_gotent field.
1940         (elf64_x86_64_local_tlsdesc_gotent): New macro.
1941         (struct elf64_x86_64_link_hash_table): Add tlsdesc_plt,
1942         tlsdesc_got and sgotplt_jump_table_size fields.
1943         (elf64_x86_64_compute_jump_table_size): New macro.
1944         (link_hash_newfunc): Initialize tlsdesc_got.
1945         (elf64_x86_64_link_hash_table_create): Initialize new fields.
1946         (elf64_x86_64_tls_transition): Handle R_X86_64_GOTPC32_TLSDESC and
1947         R_X86_64_TLSDESC_CALL.
1948         (elf64_x86_64_check_relocs): Likewise.  Allocate space for
1949         local_tlsdesc_gotent.
1950         (elf64_x86_64_gc_sweep_hook): Handle R_X86_64_GOTPC32_TLSDESC and
1951         R_X86_64_TLSDESC_CALL.
1952         (allocate_dynrelocs): Count function PLT relocations.  Reserve
1953         space for TLS descriptors and relocations.
1954         (elf64_x86_64_size_dynamic_sections): Reserve space for TLS
1955         descriptors and relocations.  Set up sgotplt_jump_table_size,
1956         tlsdesc_plt and tlsdesc_got.  Make room for them.  Don't zero
1957         reloc_count in srelplt.  Add dynamic entries for DT_TLSDESC_PLT
1958         and DT_TLSDESC_GOT.
1959         (elf64_x86_64_always_size_sections): New.  Set up
1960         _TLS_MODULE_BASE_.
1961         (elf64_x86_64_relocate_section): Handle R_386_TLS_GOTDESC and
1962         R_386_TLS_DESC_CALL.
1963         (elf64_x86_64_finish_dynamic_symbol): Use GOT_TLS_GD_ANY_P.
1964         (elf64_x86_64_finish_dynamic_sections): Set DT_TLSDESC_PLT and
1965         DT_TLSDESC_GOT.  Set up TLS descriptor lazy resolver PLT entry.
1966         (elf_backend_always_size_sections): Define.
1967
1968 2006-01-17  H.J. Lu  <hongjiu.lu@intel.com>
1969
1970         PR binutils/2096
1971         * dwarf2.c (comp_unit_contains_address): Update comment.
1972         (_bfd_dwarf2_find_nearest_line): Use section's vma, instead of
1973         lma.  Return TRUE only if both comp_unit_contains_address and
1974         comp_unit_find_nearest_line return TRUE.
1975         (_bfd_dwarf2_find_line): Use section's vma, instead of lma.
1976
1977 2006-01-18  Alan Modra  <amodra@bigpond.net.au>
1978
1979         * elf-bfd.h (struct elf_backend_data): Add gc_mark_dynamic_ref.
1980         (bfd_elf_gc_mark_dynamic_ref_symbol): Declare.
1981         * elflink.c (bfd_elf_gc_mark_dynamic_ref_symbol): Rename from
1982         elf_gc_mark_dynamic_ref_symbol.  Make global.
1983         (bfd_elf_gc_sections): Call bed->gc_mark_dynamic_ref.
1984         * elfxx-target.h (elf_backend_gc_mark_dynamic_ref): Define.
1985         (elfNN_bed): Init new field.
1986         * elf64-ppc.c (elf_backend_gc_mark_dynamic_ref): Define.
1987         (ppc64_elf_gc_mark_dynamic_ref): New function.
1988
1989 2006-01-17  Alan Modra  <amodra@bigpond.net.au>
1990
1991         * elf64-ppc.c (ppc64_elf_gc_mark_hook): Don't hang forever in loop.
1992
1993 2006-01-17  Nick Clifton  <nickc@redhat.com>
1994
1995         PR binutils/2159
1996         * elf.c (elfcore_write_pstatus): Add ATTRIBUTE_UNUSED to unused
1997         parameters.
1998
1999 2006-01-11  Nick Clifton  <nickc@redhat.com>
2000
2001         * elf32-arm.c (elf32_arm_output_symbol_hook): Install new entry
2002         into the newly (re)allocated map array.
2003
2004 2006-01-09  Alexis Wilke  <alexis_wilke@yahoo.com>
2005
2006         * peXXigen.c (tbl): Add comma after "HIGH3ADJ".
2007
2008 2006-01-01  Jakub Jelinek  <jakub@redhat.com>
2009
2010         * elf64-ppc.c (ppc64_elf_action_discarded): Return 0
2011         for .toc1 section.
2012
2013 For older changes see ChangeLog-2005
2014 \f
2015 Local Variables:
2016 mode: change-log
2017 left-margin: 8
2018 fill-column: 74
2019 version-control: never
2020 End: