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