PR 2342
[platform/upstream/binutils.git] / bfd / ChangeLog
1 2006-05-10  Alan Modra  <amodra@bigpond.net.au>
2
3         PR 2342
4         * elflink.c (_bfd_elf_default_action_discarded): Revert 2006-02-16.
5
6 2006-05-09  Nick Clifton  <nickc@redhat.com>
7
8         * coffcode.h (coff_write_relocs): Produce an error message if a an
9         out-of-range symbol index is detected in a reloc.
10
11 2006-05-09  Ben Elliston  <bje@au.ibm.com>
12
13         * elf64-ppc.c (ppc64_elf_finish_dynamic_symbol): Remove unused
14         local variable `dynobj'.
15         
16 2006-05-05  Bjoern Haase  <bjoern.m.haase@web.de>
17
18         * elf32-avr.c (elf32_avr_relax_delete_bytes): Iterate over all
19         of the bfd's sections for the reloc-addend adjustments.
20
21 2006-05-05  Martin Schwidefsky  <schwidefsky@de.ibm.com>
22
23         * elf32-s390.c (invalid_tls_insn): Call bfd_set_error.
24         (elf_s390_relocate_section): Add code to do the GD->LE and
25         LD->LE TLS linker optimizations if a brasl instruction is used
26         for the __tls_get_offset function call.
27         * elf64-s390.c (invalid_tls_insn): Call bfd_set_error.
28
29 2006-05-05  Alan Modra  <amodra@bigpond.net.au>
30
31         * elf64-ppc.c (ppc64_elf_tls_optimize): Only optimize
32         R_PPC64_TPREL64 and R_PPC64_DTPMOD64 relocs when they are in
33         the .toc and referenced by a TLS code sequence.
34         (ppc64_elf_edit_toc): Cater for the unlikely situation that
35         .toc is the first section in a file.
36
37 2006-05-04  Andreas Schwab  <schwab@suse.de>
38
39         * aoutf1.h (struct external_sparc_core): Declare c_regs as struct
40         regs instead of an array of int.
41         (struct external_solaris_bcp_core): Likewise.
42         (swapcore_sun3): Use offsetof instead of computing the offset
43         manually.
44         (swapcore_sparc): Likewise.  Simplify reference to c_regs.
45         (swapcore_solaris_bcp): Likewise.
46
47 2006-05-04  Daniel Jacobowitz  <dan@codesourcery.com>
48
49         * elfxx-mips.c (_bfd_mips_elf_hide_symbol): Adjust handling
50         for missing GOTs.
51
52 2006-05-04  Daniel Jacobowitz  <dan@codesourcery.com>
53
54         * bfd/cpu-arm.c (bfd_is_arm_mapping_symbol_name): Accept more
55         mapping symbols.
56
57 2006-05-04  Ben Elliston  <bje@au.ibm.com>
58
59         * coff-or32.c (bfd_section_from_shdr): Remove unused local
60         variable `ptr'.
61         * cofflink.c (process_embedded_commands): Remove unused local
62         variables `had_read' and `had_shared'.
63         * ecofflink.c (bfd_ecoff_debug_accumulate): Remove unused local
64         variable `fdr_adr'.
65         * ihex.c (ihex_read_section): Remove unused local variable `addr'.
66
67 2006-05-03  Alan Modra  <amodra@bigpond.net.au>
68
69         * libbfd-in.h (_bfd_generic_new_section_hook): Declare.
70         * section.c (bfd_abs_symbol, bfd_com_symbol): Delete.
71         (bfd_und_symbol, bfd_ind_symbol): Delete.
72         (BFD_FAKE_SECTION): Remove SYM_PTR param, set symbol_ptr_ptr to
73         &SEC.symbol.
74         (STD_SECTION): Adjust.
75         (_bfd_generic_new_section_hook): New function, extracted from..
76         (bfd_section_init): ..here.
77         (bfd_make_section_old_way): Call new_section_hook for abs, com,
78         und and ind sections.
79         * elf.c (_bfd_elf_large_com_section): Adjust.
80         * aoutx.h (new_section_hook): Call _bfd_generic_new_section_hook.
81         * pdp11.c (new_section_hook): Likewise.
82         * coffcode.h (coff_new_section_hook): Likewise.
83         * ecoff.c (_bfd_ecoff_new_section_hook): Likewise.
84         * elf.c (_bfd_elf_new_section_hook): Likewise.
85         * vms.c (vms_new_section_hook): Likwise.
86         * elf32-arm.c (elf32_arm_new_section_hook): Check used_by_bfd isn't
87         already set.
88         * elf32-sh64.c (sh64_elf_new_section_hook): Likewise.
89         * elf32-xtensa.c (elf_xtensa_new_section_hook): Likewise.
90         * elf64-mmix.c (mmix_elf_new_section_hook): Likewise.
91         * elf64-ppc.c (ppc64_elf_new_section_hook): Likewise.
92         * elfxx-mips.c (_bfd_mips_elf_new_section_hook): Likewise.
93         * elfxx-sparc.c (_bfd_sparc_elf_new_section_hook): Likewise.
94         * ieee.c (ieee_new_section_hook): Likewise.  Call
95         _bfd_generic_new_section_hook too.
96         * mmo.c (mmo_new_section_hook): Likewise.
97         * oasys.c (oasys_new_section_hook): Likewise.
98         * som.c (som_new_section_hook): Likewise.
99         * coff-w65.c (reloc_processing): Don't use bfd_abs_symbol.
100         * bfd-in2.h: Regenerate.
101         * libbfd.h: Regenerate.
102
103 2006-05-03  Alan Modra  <amodra@bigpond.net.au>
104
105         * hash.c (DEFAULT_SIZE): Revert last change.
106         (higher_prime_number): Correct test for no larger prime.  Don't
107         abort on error, instead return 0.  Depopulate primes[].
108         (bfd_hash_lookup): If we overflow size, refuse to grow table.
109
110 2006-05-02  Paul Brook  <paul@codesourcery.com>
111
112         * elf32-arm.c (elf32_arm_final_link_relocate): Set thumb funciton bit
113         for R_ARM_REL32.
114
115 2006-05-02  Ben Elliston  <bje@au.ibm.com>
116
117         * archive.c (bfd_generic_archive_p): Remove unused local variable
118         `fail'.
119         * dwarf2.c (decode_line_info): Remove unused local variable
120         `basic_block'.
121         * elfcode.h (elf_slurp_reloc_table_from_section): Remove unused
122         local variable `s'.
123         * tekhex.c (tekhex_write_object_contents): Remove unused local
124         variable `bytes_written'.
125         * aout-ns32k.c (MY_swap_std_reloc_out): Remove unused local
126         variable `r_addend'.
127         * elf32-dlx.c (dlx_rtype_to_howto): Remove breaks after returns.
128         * elfxx-mips.c (_bfd_elf_mips_mach): Remove breaks after returns.
129         (_bfd_ns32k_relocate_contents): Remove break after return.
130         * elf.c (bfd_section_from_shdr): Remove breaks after returns.
131
132 2006-05-02  Nick Clifton  <nickc@redhat.com>
133
134         * elf32-sh-symbian.c: Rename local define DEBUG to SYMBIAN_DEBUG
135         in order to avoid conflicts with the global DEBUG define.
136
137 2006-05-02  Alan Modra  <amodra@bigpond.net.au>
138
139         * dwarf2.c: Formatting.
140         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Simplify
141         output section check.
142         * elf32-i370.c: Warning fixes inside #ifdef DEBUG.
143         * elf32-m32c.c: Similarly.
144         * elf32-ppc.c: Similarly.
145         * elf32-v850.c: Similarly.
146         * nlm32-sparc.c: Similarly.
147         * elfcode.h: Similarly.
148         (elf_symbol_flags): Delete.
149         * elflink.c (elf_link_input_bfd): Comment typo.
150
151 2006-05-01  DJ Delorie  <dj@redhat.com>
152
153         * bfd-in.h (bfd_hash_table): Add count field.
154         * bfd-in2.h: Regenerate.
155         * hash.c (higher_prime_number): New.
156         (bfd_hash_table_inint_n): Init count field.
157         (bfd_hash_lookup): Grow table as needed.
158
159 2006-04-27  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
160
161         PR binutils/2584
162         * tekhex.c (getvalue): Change return type to bfd_boolean and
163         add the new parameter.  Return false if the unexpected character
164         is found.
165         (getsym): Likewise.
166         (first_phase): Change return type to bfd_boolean and return
167         false if the unexpected character is found.  Replace abort
168         with returning false.
169         (pass_over): Change return type to bfd_boolean and the type of
170         the second argument to bfd_boolean (*) (bfd *, int, char *).
171         Return false if FUNC returns false.
172         (tekhex_object_p): Return NULL if pass_over fails.
173
174 2006-04-27  Alan Modra  <amodra@bigpond.net.au>
175
176         * coff-rs6000.c (xcoff_write_archive_contents_old): Warning fix.
177
178 2006-04-26  H.J. Lu  <hongjiu.lu@intel.com>
179
180         PR binutils/2593
181         * elf.c (_bfd_elf_new_section_hook): Don't set section ELF type
182         and flags if its BFD flags have been set.
183         (_bfd_elf_init_private_section_data): Don't copy the output ELF
184         section type from input if it has been set to something
185         different.
186
187 2006-04-25  H.J. Lu  <hongjiu.lu@intel.com>
188
189         PR binutils/2467
190         * elf.c (_bfd_elf_close_and_cleanup): Check elf_tdata (abfd)
191         is NULL first.
192
193         * elf32-arm.c (elf32_arm_close_and_cleanup): Check if
194         abfd->sections is NULL.
195         (elf32_arm_bfd_free_cached_info): New.
196         (bfd_elf32_bfd_free_cached_info): Defined.
197
198         * elfxx-target.h (bfd_elfNN_bfd_free_cached_info): Default it
199         to _bfd_free_cached_info.
200
201         * libbfd-in.h (_bfd_free_cached_info): New.
202         * libbfd: Regenerated.
203
204         * opncls.c (_bfd_delete_bfd): Check if abfd->memory is NULL.
205         (_bfd_free_cached_info): New.
206
207 2006-04-21  Alan Modra  <amodra@bigpond.net.au>
208
209         * elf.c (assign_file_positions_except_relocs): Move code setting
210         file position of non-loaded sections..
211         (assign_file_positions_for_segments): ..to here.
212
213 2006-04-20  H.J. Lu  <hongjiu.lu@intel.com>
214
215         PR ld/2537
216         * elf.c (bfd_section_from_shdr): Allow sections reserved for
217         applications. Issue an error on sections we don't know how
218         to handle.
219
220 2006-04-19  Alan Modra  <amodra@bigpond.net.au>
221
222         * Makefile.am: Run "make dep-am".
223         * Makefile.in: Regenerate.
224
225 2006-04-19  Alan Modra  <amodra@bigpond.net.au>
226
227         * warning.m4 (--enable-werror): Format help message.
228         (--enable-build-warnings): Likewise.
229         * configure: Regenerate.
230
231 2006-04-18  Nick Clifton  <nickc@redhat.com>
232
233         PR 2257
234         * elfcode.h (elf_object_p): Allow files with corrupt e_shstrndx
235         fields to still be handled as ELF files.
236
237 2006-04-16  Daniel Jacobowitz  <dan@codesourcery.com>
238
239         * po/SRC-POTFILES.in: Regenerated.
240
241 2006-04-16  Daniel Jacobowitz  <dan@codesourcery.com>
242
243         * configure.in: Update version to 2.17.50.
244         * configure: Regenerated.
245
246 2006-04-14  David Heine  <dlheine@tensilica.com>
247
248         * elf32-xtensa.c (build_reloc_opcodes): New.
249         (compute_text_actions): Use it to decode opcodes outside inner loop.
250         (check_section_ebb_pcrels_fit): Add "reloc_opcodes" argument, and if
251         it is set, use it to get the opcodes for relocations.
252         (move_shared_literal): Adjust call to check_section_ebb_pcrels_fit.
253
254 2006-04-08  H.J. Lu  <hongjiu.lu@intel.com>
255
256         PR ld/2513
257         * elf32-i386.c (GOT_TLS_MASK): New macro for tls_type.
258         (GOT_TLS_IE_IE): Likewise.
259         (GOT_TLS_IE_GD): Likewise.
260         (GOT_TLS_IE_MASK): Likewise.
261         (elf_i386_check_relocs): For global symbols, set GOT_TLS_IE_GD
262         and GOT_TLS_IE_IE for R_386_TLS_GD and R_386_TLS_IE
263         respectively.
264         (allocate_dynrelocs): If both GOT_TLS_IE_IE and GOT_TLS_IE_GD
265         are set, treat tls_type as GOT_TLS_IE_BOTH.
266         (elf_i386_relocate_section): Likewise.
267
268 2006-04-07  Randolph Chung  <tausq@debian.org>
269
270         * elf64-hppa.c (elf64_hppa_grok_prstatus): New function.
271         (elf64_hppa_grok_psinfo): Likewise.
272         (elf_backend_grok_pstatus, elf_backend_grok_psinfo): Define.
273
274 2006-04-06  DJ Delorie  <dj@redhat.com>
275
276         * elf32-m32c.c (m32c_elf_relocate_section): Generate a symbol for
277         each plt entry we create.
278
279 2006-04-06  Carlos O'Donell  <carlos@codesourcery.com>
280
281         * po/Make-in: Add install-html target.
282         * Makefile.am: Rename docdir to bfddocdir. Add datarootdir, docdir
283         htmldir. Add install-html and install-html-recursive targets.
284         * Makefile.in: Regenerate.
285         * configure.in: AC_SUBST for datarootdir, docdir and htmldir.
286         * configure: Regenerate.
287
288 2006-04-06  H.J. Lu  <hongjiu.lu@intel.com>
289
290         * elfxx-ia64.c (elfNN_ia64_relax_section): Skip unneeded passes
291         with the skip_relax_pass_0 and skip_relax_pass_1 bits in the
292         section structure.
293
294 2006-04-05  Bernd Schmidt  <bernd.schmidt@analog.com>
295
296         * elf32-bfin.c (bfinfdpic_relocs_info_hash): Sprinkle casts to
297         eliminate warnings.
298
299 2006-04-05  H.J. Lu  <hongjiu.lu@intel.com>
300             James E Wilson  <wilson@specifixinc.com>
301
302         PR ld/2442
303         * elfxx-ia64.c (elfNN_ia64_dyn_sym_info): Remove next.
304         (elfNN_ia64_local_hash_entry): Add count, sorted_count and
305         size.
306         (elfNN_ia64_link_hash_entry): Likewise.
307         (elfNN_ia64_new_elf_hash_entry): Initialize count, sorted_count
308         and size.
309         (elfNN_ia64_hash_copy_indirect): Updated elfNN_ia64_dyn_sym_info
310         processing.
311         (elfNN_ia64_hash_hide_symbol): Likewise.
312         (elfNN_ia64_global_dyn_sym_thunk): Likewise.
313         (elfNN_ia64_local_dyn_sym_thunk): Likewise.
314         (elfNN_ia64_global_dyn_info_free): New function.
315         (elfNN_ia64_local_dyn_info_free): Likewise.
316         (elfNN_ia64_hash_table_free): Free local and global
317         elfNN_ia64_dyn_sym_info.
318         (addend_compare): New function.
319         (sort_dyn_sym_info): Likewise.
320         (get_dyn_sym_info): Updated to use binary search for addend.
321         (elfNN_ia64_check_relocs): Scan relocations to create dynamic
322         relocation arrays first.
323
324 2006-04-05  Bernd Schmidt  <bernd.schmidt@analog.com>
325
326         * elf32-bfin.c (_bfin_create_got_section): Don't generate a _gp
327         symbol.
328
329 2006-04-05  H.J. Lu  <hongjiu.lu@intel.com>
330
331         PR ld/2411
332         * elflink.c (check_dynsym): New.
333         (elf_link_output_extsym): Use it.
334         (bfd_elf_final_link): Likewise.
335
336 2006-04-05  H.J. Lu  <hongjiu.lu@intel.com>
337
338         PR ld/2404
339         * elflink.c (_bfd_elf_merge_symbol): Skip the default indirect
340         symbol from the dynamic definition with the default version if
341         its type and the type of existing regular definition mismatch.
342
343 2006-04-05  Richard Sandiford  <richard@codesourcery.com>
344             Daniel Jacobowitz  <dan@codesourcery.com>
345
346         * config.bfd (sparc-*-vxworks*): New stanza.
347         * configure.in (bfd_elf32_sparc_vxworks_vec): New stanza.
348         (bfd_elf32_sparc_vec, bfd_elf64_sparc_vec): Add elf-vxworks.lo.
349         * configure: Regenerate.
350         * elf32-sparc.c: Include elf-vxworks.h.
351         (elf32_sparc_vxworks_link_hash_table_create: New.
352         (elf32_sparc_vxworks_final_write_processing): New.
353         (TARGET_BIG_SYM): Override for VxWorks.
354         (TARGET_BIG_NAME, ELF_MINPAGESIZE): Likewise.
355         (bfd_elf32_bfd_link_hash_table_create): Likewise.
356         (elf_backend_want_got_plt, elf_backend_plt_readonly): Likewise.
357         (elf_backend_got_header_size, elf_backend_add_symbol_hook): Likewise.
358         (elf_backend_link_output_symbol_hook): Likewise.
359         (elf_backend_emit_relocs): Likewise.
360         (elf_backend_final_write_processing, elf32_bed): Likewise.
361         * elfxx-sparc.c: Include libiberty.h and elf-vxworks.h.
362         (sparc_vxworks_exec_plt0_entry, sparc_vxworks_exec_plt_entry): New.
363         (sparc_vxworks_shared_plt0_entry, sparc_vxworks_shared_plt_entry): New.
364         (_bfd_sparc_elf_link_hash_table_create): Don't initialize
365         build_plt_entry here.
366         (create_got_section): Initialize sgotplt for VxWorks.
367         (_bfd_sparc_elf_create_dynamic_sections): Initialize build_plt_entry,
368         plt_header_size and plt_entry_size, with new VxWorks-specific settings.
369         Call elf_vxworks_create_dynamic_sections for VxWorks.
370         (allocate_dynrelocs): Use plt_header_size and plt_entry_size.
371         Allocate room for .got.plt and .rela.plt.unloaded entries on VxWorks.
372         (_bfd_sparc_elf_size_dynamic_sections): Don't allocate a nop in .plt
373         for VxWorks.  Check for the .got.plt section.
374         (sparc_vxworks_build_plt_entry): New function.
375         (_bfd_sparc_elf_finish_dynamic_symbol): Add handling of VxWorks PLTs.
376         Don't make _GLOBAL_OFFSET_TABLE_ and _PROCEDURE_LINKAGE_TABLE_
377         absolute on VxWorks.
378         (sparc32_finish_dyn): Add special handling for DT_RELASZ
379         and DT_PLTGOT on VxWorks.
380         (sparc_vxworks_finish_exec_plt): New.
381         (sparc_vxworks_finish_shared_plt): New.
382         (_bfd_sparc_elf_finish_dynamic_sections): Call them.
383         Use plt_header_size and plt_entry_size.
384         * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Add is_vxworks,
385         srelplt2, sgotplt, plt_header_size and plt_entry_size fields.
386         * Makefile.am (elfxx-sparc.lo): Depend on elf-vxworks.h.
387         (elf32-sparc.lo): Likewise.
388         * Makefile.in: Regenerate.
389         * targets.c (bfd_elf32_sparc_vxworks_vec): Declare.
390         (_bfd_target_vector): Add a pointer to it.
391
392 2006-03-30  Ben Elliston  <bje@au.ibm.com>
393
394         PR ld/2267
395         * elflink.c (elf_fixup_link_order): Ensure `elfsec' is not a
396         special section number that exceeds the number of ELF sections
397         (eg. SHN_MIPS_SCOMMON).
398
399 2006-03-27  Richard Sandiford  <richard@codesourcery.com>
400
401         * elfxx-mips.c (mips_got_entry): Add more commentary.
402         (mips_elf_local_got_index): Use the hash table entry to record
403         the GOT index of forced-local symbols.
404         (mips_elf_initialize_tls_index): Rearrange code.  Store the index
405         in either the hash table entry or the mips_got_entry, not both.
406         Add more commentary.
407         (mips_elf_multi_got): Make sure the g->next is nonnull when calling
408         mips_elf_initialize_tls_index.
409
410 2006-03-25  Bernd Schmidt  <bernd.schmidt@analog.com>
411
412         * elf32-bfin.c (bfd_const_reloc, bfd_oper_reloc, bfin_push_reloc,
413         RELOC_STACK_SIZE, reloc_stack, reloc_stack_tos, is_reloc_stack_empty,
414         reloc_stack_push, reloc_stack_pop, reloc_stack_operate,
415         bfin_areloc_howto_table): Delete.  All
416         uses deleted as well.
417         (bfin_reloc_map): Delete all stack relocs.
418         (bfin_info_to_howto, bfin_bfd_reloc_type_lookup,
419         bfin_reloc_type_lookup): Don't support them.
420         (bfin_relocate_section): Don't try to handle them.
421
422         * config.bfd (bfin-*-*): Add bfd_elf32_bfinfdpic_vec.
423         * configure.in: Likewise.
424         * configure: Regenerate.
425         * elf32-bfin.c: Include "elf/dwarf2.h" and "hashtab.h".
426         (BFIN_RELOC_MAX): Now 0x21.
427         (bfin_howto_table, bfin_reloc_map): Add FD-PIC relocs.
428         (bfd_elf32_bfinfdpic_vec): Declare.
429         (IS_FDPIC): New macro.
430         (struct bfinfdpic_elf_link_hash_table): New struct.
431         (bfinfdpic_hash_table, bfinfdpic_got_section,
432         bfinfdpic_gotrel_section, bfinfdpic_gotfixup_section,
433         bfinfdpic_plt_setion, bfinfdpic_pltrel_section,
434         bfinfdpic_relocs_info, bfinfdpic_got_initial_offset,
435         bfinfdpic_plt_initial_offset): Accessor macros for it.
436         (BFINFDPIC_SYM_LOCAL, BFINFDPIC_FUNCDESC_LOCAL): New macros.
437         (struct bfinfdpic_relocs_info): New struct.
438         (LZPLT_RESOLVER_EXTRA, LZPLT_NORMAL_SIZE, LZPLT_ENTRIES,
439         BFINFDPIC_LZPLT_BLOCK_SIZE, BFINFDPIC_LZPLT_RESOLV_LOC,
440         DEFAULT_STACK_SIZE): New macros.
441         (bfinfdpic_elf_link_hash_table_create, bfinfdpic_relocs_info_hash,
442         bfinfdpic_relocs_info_eq, bfinfdpics_relocs_info_find,
443         bfinfdpic_relocs_info_for_global, bfinfdpic_relocs_info_for_local,
444         bfinfdpic_pic_merge_early_relocs_info, _bfinfdpic_add_dyn_reloc,
445         _bfinfdpic_add_rofixup, _bfinfdpic_osec_to_segment,
446         _bfinfdpic_osec_readonly_p, bfinfdpic_relocate_section,
447         bfinfdpic_check_relocs, bfinfdpic_gc_sweep_hook,
448         _bfinfdpic_link_omit_section_dynsym, _bfin_create_got_section,
449         elf32_bfinfdpic_create_dynamic_sections, _bfinfdpic_get_fd_entry,
450         _bfinfdpic_compute_got_alloc_data, _bfinfdpic_get_got_entry,
451         _bfinfdpic_assign_got_entries, _bfinfdpic_assign_plt_entries,
452         _bfinfdpic_resolve_final_relocs_info,
453         elf32_bfinfdpic_size_dynamic_sections,
454         elf32_bfinfdpic_always_size_sections,
455         elf32_bfinfdpic_modify_segment_map,
456         _bfinfdpic_count_got_plt_entries,
457         elf32_bfinfdpic_finish_dynamic_sections,
458         elf32_bfinfdpic_adjust_dynamic_symbol,
459         elf32_bfinfdpic_finish_dynamic_symbol,
460         elf32_bfinfdpic_elf_use_relative_eh_frame,
461         elf32_bfinfdpic_elf_encode_eh_address,
462         elf32_bfin_object_p, bfin_elf_copy_private_bfd_data,
463         elf32_bfinfdpic_copy_private_bfd_data,
464         (struct _bfinfdpic_dynamic_got_info,
465         struct _bfinfdpic_dynamic_got_plt_info): New structs.
466         (elf32_bfin_print_private_bfd_data): Print PIC flags.
467         (elf32_bfin_merge_private_bfd_data): Extend to support FD-PIC.
468         (TARGET_LITTLE_SYM, TARGET_LITTLE_NAME, elf32_bed,
469         elf_backend_got_header_size, bfd_elf32_bfd_link_hash_table_create,
470         elf_backend_always_size_sectinos, elf_backend_modify_segment_map,
471         bfd_elf32_bfd_copy_private_bfd_data,
472         elf_backend_create_dynamic_sections, elf_backend_adjust_dynamic_symbol,
473         elf_backend_size_dynamic_sections, elf_backend_finish_dynamic_symbol,
474         elf_backend_finish_dynamic_sections, elf_backend_relocate_section,
475         elf_backend_can_make_relative_eh_frame, elf_backend_check_relocs,
476         elf_backend_can_make_ldsa_relative_eh_frame, elf_backend_may_use_rel_p,
477         elf_backend_may_use_rela_p, elf_backend_default_use_rela_p,
478         elf_backend_omit_section_dynsym): Redefine these macros and include
479         "elf32-target.h" again to create the elf32-bfinfdpic target.
480         * reloc.c (BFD_RELOC_BFIN_GOT17M4, BFD_RELOC_BFIN_GOTHI,
481         BFD_RELOC_BFIN_GOTLO, BFD_RELOC_BFIN_FUNCDESC,
482         BFD_RELOC_BFIN_FUNCDESC_GOT17M4, BFD_RELOC_BFIN_FUNCDESC_GOTHI,
483         BFD_RELOC_BFIN_FUNCDESC_GOTLO, BFD_RELOC_BFIN_FUNCDESC_VALUE,
484         BFD_RELOC_BFIN_FUNCDESC_GOTOFF17M4, BFD_RELOC_BFIN_FUNCDESC_GOTOFFHI,
485         BFD_RELOC_BFIN_FUNCDESC_GOTOFFLO, BFD_RELOC_BFIN_GOTOFFHI,
486         BFD_RELOC_BFIN_GOTOFFLO): New.
487         * targets.c (bfd_elf32_bfinfdpic_vec): New bfd_target.
488         (_bfd_target_vector): Add it.
489         * bfd-in2.h: Regenerate.
490         * libbfd.h: Regenerate.
491
492 2006-03-25  Richard Sandiford  <richard@codesourcery.com>
493
494         * cpu-m68k.c (bfd_m68k_compatible): Treat ISA A+ and ISA B code as
495         incompatible.  Likewise MAC and EMAC code.
496         * elf32-m68k.c (elf32_m68k_merge_private_bfd_data): Use
497         bfd_get_compatible to set the new bfd architecture.  Rely on it
498         to detect incompatibilities.
499
500 2006-03-23  Michael Matz  <matz@suse.de>
501
502         * reloc.c: Add BFD_RELOC_X86_64_GOT64, BFD_RELOC_X86_64_GOTPCREL64,
503         BFD_RELOC_X86_64_GOTPC64, BFD_RELOC_X86_64_GOTPLT64,
504         BFD_RELOC_X86_64_PLTOFF64.
505         * bfd-in2.h: Regenerated.
506         * libbfd.h: Regenerated.
507         * elf64-x86-64.c (x86_64_elf_howto_table): Correct comment.
508         Add howtos for above relocs.
509         (x86_64_reloc_map): Add mappings for new relocs.
510         (elf64_x86_64_check_relocs): R_X86_64_GOT64, R_X86_64_GOTPCREL64,
511         R_X86_64_GOTPLT64 need a got entry.  R_X86_64_GOTPLT64 also a PLT
512         entry.  R_X86_64_GOTPC64 needs a .got section.  R_X86_64_PLTOFF64
513         needs a PLT entry.
514         (elf64_x86_64_gc_sweep_hook): Reflect changes from
515         elf64_x86_64_check_relocs for the new relocs.
516         (elf64_x86_64_relocate_section): Handle new relocs.
517
518 2006-03-22  Bob Wilson  <bob.wilson@acm.org>
519
520         * elf32-xtensa.c (xtensa_read_table_entries): Remove assertion that
521         rel->r_addend is zero.
522
523 2006-03-22  Richard Sandiford  <richard@codesourcery.com>
524
525         * elfxx-mips.c (_bfd_mips_vxworks_finish_dynamic_symbol): Fix type
526         of "loc".
527
528 2006-03-22  Richard Sandiford  <richard@codesourcery.com>
529             Daniel Jacobowitz  <dan@codesourcery.com>
530             Phil Edwards  <phil@codesourcery.com>
531             Zack Weinberg  <zack@codesourcery.com>
532             Mark Mitchell  <mark@codesourcery.com>
533             Nathan Sidwell  <nathan@codesourcery.com>
534
535         * bfd-in2.h: Regenerate.
536         * config.bfd (mips*-*-vxworks*, mips*el-*-vxworks*): New stanzas.
537         * configure.in (bfd_elf32_bigmips_vxworks_vec): New stanza.
538         (bfd_elf32_littlemips_vxworks_vec): Likewise.
539         (bfd_elf32_bigmips_vec): Add elf-vxworks.lo.
540         (bfd_elf32_littlemips_vec): Likewise.
541         (bfd_elf32_nbigmips_vec): Likewise.
542         (bfd_elf32_nlittlemips_vec): Likewise.
543         (bfd_elf32_ntradbigmips_vec): Likewise.
544         (bfd_elf32_ntradlittlemips_vec): Likewise.
545         (bfd_elf32_tradbigmips_vec): Likewise.
546         (bfd_elf32_tradlittlemips_vec): Likewise.
547         (bfd_elf64_bigmips_vec): Likewise.
548         (bfd_elf64_littlemips_vec): Likewise.
549         (bfd_elf64_tradbigmips_vec): Likewise.
550         (bfd_elf64_tradlittlemips_vec): Likewise.
551         * elf32-mips.c: Include elf-vxworks.h.
552         (mips_info_to_howto_rel): Use elf_backend_mips_rtype_to_howto
553         instead of calling mips_elf32_rtype_to_howto directly.
554         (mips_vxworks_copy_howto_rela): New reloc howto.
555         (mips_vxworks_jump_slot_howto_rela): Likewise.
556         (mips_vxworks_bfd_reloc_type_lookup): New function.
557         (mips_vxworks_rtype_to_howto): Likewise.
558         (mips_vxworks_final_write_processing): Likewise.
559         (TARGET_LITTLE_SYM, TARGET_LITTLE_NAME): Override for VxWorks.
560         (TARGET_BIG_SYM, TARGET_BIG_NAME, elf_bed, ELF_MAXPAGESIZE): Likewise.
561         (elf_backend_want_got_plt): Likewise.
562         (elf_backend_want_plt_sym): Likewise.
563         (elf_backend_got_symbol_offset): Likewise.
564         (elf_backend_want_dynbss): Likewise.
565         (elf_backend_may_use_rel_p): Likewise.
566         (elf_backend_may_use_rela_p): Likewise.
567         (elf_backend_default_use_rela_p): Likewise.
568         (elf_backend_got_header_size: Likewise.
569         (elf_backend_plt_readonly): Likewise.
570         (bfd_elf32_bfd_reloc_type_lookup): Likewise.
571         (elf_backend_mips_rtype_to_howto): Likewise.
572         (elf_backend_adjust_dynamic_symbol): Likewise.
573         (elf_backend_finish_dynamic_symbol): Likewise.
574         (bfd_elf32_bfd_link_hash_table_create): Likewise.
575         (elf_backend_add_symbol_hook): Likewise.
576         (elf_backend_link_output_symbol_hook): Likewise.
577         (elf_backend_emit_relocs): Likewise.
578         (elf_backend_final_write_processing: Likewise.
579         (elf_backend_additional_program_headers): Likewise.
580         (elf_backend_modify_segment_map): Likewise.
581         (elf_backend_symbol_processing): Likewise.
582         * elfxx-mips.c: Include elf-vxworks.h.
583         (mips_elf_link_hash_entry): Add is_relocation_target and
584         is_branch_target fields.
585         (mips_elf_link_hash_table): Add is_vxworks, srelbss, sdynbss, srelplt,
586         srelplt2, sgotplt, splt, plt_header_size and plt_entry_size fields.
587         (MIPS_ELF_RELA_SIZE, MIPS_ELF_REL_DYN_NAME): New macros.
588         (MIPS_RESERVED_GOTNO): Take a mips_elf_link_hash_table argument.
589         Return 3 for VxWorks.
590         (ELF_MIPS_GP_OFFSET): Change the argument from a bfd to a
591         mips_elf_link_hash_table.  Return 0 for VxWorks.
592         (MIPS_ELF_GOT_MAX_SIZE): Change the argument from a bfd to a
593         mips_elf_link_hash_table.  Update the call to ELF_MIPS_GP_OFFSET.
594         (mips_vxworks_exec_plt0_entry): New variable.
595         (mips_vxworks_exec_plt_entry): Likewise.
596         (mips_vxworks_shared_plt0_entry): Likewise.
597         (mips_vxworks_shared_plt_entry): Likewise.
598         (mips_elf_link_hash_newfunc): Initialize the new hash_entry fields.
599         (mips_elf_rel_dyn_section): Change the bfd argument to a
600         mips_elf_link_hash_table.  Use MIPS_ELF_REL_DYN_NAME to get
601         the name of the section.
602         (mips_elf_initialize_tls_slots): Update the call to
603         mips_elf_rel_dyn_section.
604         (mips_elf_gotplt_index): New function.
605         (mips_elf_local_got_index): Add an input_section argument.
606         Update the call to mips_elf_create_local_got_entry.
607         (mips_elf_got_page): Likewise.
608         (mips_elf_got16_entry): Likewise.
609         (mips_elf_create_local_got_entry): Add bfd_link_info and input_section
610         arguments.  Create dynamic relocations for each entry on VxWorks.
611         (mips_elf_merge_gots): Update the use of MIPS_ELF_GOT_MAX_SIZE.
612         (mips_elf_multi_got): Update the uses of MIPS_ELF_GOT_MAX_SIZE
613         and MIPS_RESERVED_GOTNO.
614         (mips_elf_create_got_section): Update the uses of
615         MIPS_ELF_GOT_MAX_SIZE.  Create .got.plt on VxWorks.
616         (is_gott_symbol): New function.
617         (mips_elf_calculate_relocation): Use a dynobj local variable.
618         Update the calls to mips_elf_local_got_index, mips_elf_got16_entry and
619         mips_elf_got_page_entry.  Set G to the .got.plt entry when calculating
620         VxWorks R_MIPS_CALL* relocations.  Calculate and use G for all GOT
621         relocations on VxWorks.  Add dynamic relocations for references
622         to the VxWorks __GOTT_BASE__ and __GOTT_INDEX__ symbols.  Don't
623         create dynamic relocations for R_MIPS_32, R_MIPS_REL32 or R_MIPS_64
624         in VxWorks executables.
625         (mips_elf_allocate_dynamic_relocations): Add a bfd_link_info argument.
626         Use MIPS_ELF_RELA_SIZE to calculate the size of a VxWorks entry.
627         Don't allocate a null entry on VxWorks.
628         (mips_elf_create_dynamic_relocation): Update the call to
629         mips_elf_rel_dyn_section.  Use absolute rather than relative
630         relocations for VxWorks, and make them RELA rather than REL.
631         (_bfd_mips_elf_create_dynamic_sections): Don't make .dynamic
632         read-only on VxWorks.  Update the call to mips_elf_rel_dyn_section.
633         Create the .plt, .rela.plt, .dynbss and .rela.bss sections on
634         VxWorks.  Likewise create the _PROCEDURE_LINKAGE_TABLE symbol.
635         Call elf_vxworks_create_dynamic_sections for VxWorks and
636         initialize the plt_header_size and plt_entry_size fields.
637         (_bfd_mips_elf_check_relocs): Don't allow GOT relocations to be
638         used in VxWorks executables.  Don't allocate dynamic relocations
639         for R_MIPS_32, R_MIPS_REL32 or R_MIPS_64 in VxWorks executables.
640         Set is_relocation_target for each symbol referenced by a relocation.
641         Allocate .rela.dyn entries for relocations against the special
642         VxWorks __GOTT_BASE__ and __GOTT_INDEX__ symbols.  Create GOT
643         entries for all VxWorks R_MIPS_GOT16 relocations.  Don't allocate
644         a global GOT entry for symbols mentioned in VxWorks R_MIPS_CALL*,
645         R_MIPS_32, R_MIPS_REL32 or R_MIPS_64 relocations.  Update the calls
646         to mips_elf_rel_dyn_section and mips_elf_allocate_dynamic_relocations.
647         Set is_branch_target for symbols mentioned in R_MIPS_PC16 or R_MIPS_26
648         relocations.  Don't set no_fn_stub on VxWorks.
649         (_bfd_mips_elf_adjust_dynamic_symbol): Update the call to
650         mips_elf_allocate_dynamic_relocations.
651         (_bfd_mips_vxworks_adjust_dynamic_symbol): New function.
652         (_bfd_mips_elf_always_size_sections): Do not allocate GOT page
653         entries for VxWorks, and do not create multiple GOTs.
654         (_bfd_mips_elf_size_dynamic_sections): Use MIPS_ELF_REL_DYN_NAME.
655         Handle .got specially for VxWorks.  Update the uses of
656         MIPS_RESERVED_GOTNO and mips_elf_allocate_dynamic_relocations.
657         Check for sgotplt and splt.  Allocate the .rel(a).dyn contents last,
658         once its final size is known.  Set DF_TEXTREL for VxWorks.  Add
659         DT_RELA, DT_RELASZ, DT_RELAENT, DT_PLTREL, DT_PLTRELSZ and DT_JMPREL
660         tags on VxWorks.  Do not add the MIPS-specific tags for VxWorks.
661         (_bfd_mips_vxworks_finish_dynamic_symbol): New function.
662         (mips_vxworks_finish_exec_plt): Likewise.
663         (mips_vxworks_finish_shared_plt): Likewise.
664         (_bfd_mips_elf_finish_dynamic_sections): Remove an unncessary call
665         to mips_elf_rel_dyn_section.  Use a VxWorks-specific value of
666         DT_PLTGOT.  Handle DT_RELA, DT_RELASZ, DT_RELAENT, DT_PLTREL,
667         DT_PLTRELSZ and DT_JMPREL.  Update the uses of MIPS_RESERVED_GOTNO
668         and mips_elf_rel_dyn_section.  Use a different GOT header for
669         VxWorks.  Don't sort .rela.dyn on VxWorks.  Finish the PLT on VxWorks.
670         (_bfd_mips_elf_link_hash_table_create): Initialize the new
671         mips_elf_link_hash_table fields.
672         (_bfd_mips_vxworks_link_hash_table_create): New function.
673         (_bfd_mips_elf_final_link): Set the GP value to _GLOBAL_OFFSET_TABLE_
674         on VxWorks.  Update the call to ELF_MIPS_GP_OFFSET.
675         * elfxx-mips.h (_bfd_mips_vxworks_adjust_dynamic_symbol): Declare.
676         (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise.
677         (_bfd_mips_vxworks_link_hash_table_create): Likewise.
678         * libbfd.h: Regenerate.
679         * Makefile.am (elfxx-mips.lo): Depend on elf-vxworks.h.
680         (elf32-mips.lo): Likewise.
681         * Makefile.in: Regenerate.
682         * reloc.c (BFD_RELOC_MIPS_COPY, BFD_RELOC_MIPS_JUMP_SLOT): Declare.
683         * targets.c (bfd_elf32_bigmips_vxworks_vec): Declare.
684         (bfd_elf32_littlemips_vxworks_vec): Likewise.
685         (_bfd_target_vector): Add entries for them.
686
687 2006-03-19  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
688
689         * elf64-hppa.c (elf64_hppa_special_sections): Change flags for .tbss
690         section from SHF_PARISC_WEAKORDER to SHF_HP_TLS.
691         (elf_backend_special_sections): Remove #undef.
692
693 2006-03-18  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
694
695         * elf64-hppa.c (allocate_global_data_opd): Don't create an OPD entry
696         for undefined weak symbols.
697
698 2006-03-17  Daniel Jacobowitz  <dan@codesourcery.com>
699
700         PR ld/2462
701         * elflink.c (bfd_elf_final_link): Remove
702         bed->elf_backend_emit_relocs from emit_relocs.
703
704 2006-03-17  Alexandre Oliva  <aoliva@redhat.com>
705
706         * elf32-ppc.c (ppc_elf_relocate_section): Copy addend from
707         first relocation to the second when relaxing TLS GD to LE;
708         zero it out when relaxing to IE.
709
710 2006-03-17  Alan Modra  <amodra@bigpond.net.au>
711
712         PR 2434
713         * elflink.c (elf_link_add_object_symbols): Save and restore
714         warning sym's linked sym.
715
716 2006-03-16  Alan Modra  <amodra@bigpond.net.au>
717
718         PR 2434
719         * elflink.c (struct elf_smash_syms_data, elf_smash_syms): Delete.
720         (elf_link_add_object_symbols): Delete unnecessary locals.  Rename
721         hash_table -> htab.  Formatting.  Save entire symbol table
722         before loading as-needed syms, and restore afterwards if lib not
723         needed.  Use bfd_hash_allocate rather than bfd_alloc for sym
724         name.  Free some buffers earlier.
725         * bfd-in.h (struct bfd_hash_table): Add entsize.
726         (bfd_hash_table_init, bfd_hash_table_init_n): Adjust prototype.
727         * elf-bfd.h (_bfd_elf_link_hash_table_init): Likewise
728         * hash.c (bfd_hash_table_init_n): Add entsize param, save to
729         hash table.
730         (bfd_hash_table_init): Add param, adjust calls.
731         * aoutx.h: Adjust all hash_table_init functions and calls.
732         * bfd.c: Likewise.
733         * coff-arm.c: Likewise.
734         * coff-h8300.c: Likewise.
735         * coff-ppc.c: Likewise.
736         * cofflink.c: Likewise.
737         * ecoff.c: Likewise.
738         * ecofflink.c: Likewise.
739         * elf-m10300.c: Likewise.
740         * elf-strtab.c: Likewise.
741         * elf.c: Likewise.
742         * elf32-arm.c: Likewise.
743         * elf32-bfin.c: Likewise.
744         * elf32-cris.c: Likewise.
745         * elf32-frv.c: Likewise.
746         * elf32-hppa.c: Likewise.
747         * elf32-i386.c: Likewise.
748         * elf32-m32r.c: Likewise.
749         * elf32-m68hc1x.c: Likewise.
750         * elf32-m68k.c: Likewise.
751         * elf32-ppc.c: Likewise.
752         * elf32-s390.c: Likewise.
753         * elf32-sh.c: Likewise.
754         * elf32-vax.c: Likewise.
755         * elf64-alpha.c: Likewise.
756         * elf64-hppa.c: Likewise.
757         * elf64-ppc.c: Likewise.
758         * elf64-s390.c: Likewise.
759         * elf64-sh64.c: Likewise.
760         * elf64-x86-64.c: Likewise.
761         * elfxx-ia64.c: Likewise.
762         * elfxx-mips.c: Likewise.
763         * elfxx-sparc.c: Likewise.
764         * i386linux.c: Likewise.
765         * libaout.h: Likewise.
766         * libbfd-in.h: Likewise.
767         * libcoff-in.h: Likewise.
768         * linker.c: Likewise.
769         * m68klinux.c: Likewise.
770         * merge.c: Likewise.
771         * opncls.c: Likewise.
772         * pdp11.c: Likewise.
773         * sparclinux.c: Likewise.
774         * stabs.c: Likewise.
775         * sunos.c: Likewise.
776         * vms.c: Likewise.
777         * xcofflink.c: Likewise.
778         * section.c (struct section_hash_entry): Move to..
779         * libbfd-in.h: ..here.
780         * Makefile.am: Run "make dep-am"
781         * Makefile.in: Regenerate.
782         * bfd-in2.h: Regenerate.
783         * libbfd.h: Regenerate.
784         * libcoff.h: Regenerate.
785
786 2006-03-16  Alan Modra  <amodra@bigpond.net.au>
787
788         * elf32-ppc.c (ppc_elf_check_relocs): REL24 and REL14 relocs
789         against __GLOBAL_OFFSET_TABLE__ need never be dynamic.  Tweak
790         last change to REL32 relocs so that they are counted as
791         possibly dynamic as per REL24 and REL14.
792
793 2006-03-16  Alan Modra  <amodra@bigpond.net.au>
794
795         * elf32-ppc.c (ppc_elf_check_relocs): Don't fall into REL24
796         checks from REL32.
797
798 2006-03-15  Ben Elliston  <bje@au.ibm.com>
799
800         * elf32-arm.c (elf32_arm_merge_eabi_attributes): Iterate over all
801         in_list elements, not just the first.
802         
803 2006-03-14  Richard Sandiford  <richard@codesourcery.com>
804
805         * elf32-mips.c (mips_elf_adjust_addend): New function, mostly split
806         out from...
807         (_bfd_mips_elf_relocate_section): ...here.  Use it to adjust r_addend
808         for final links too.
809
810 2006-03-13  Richard Sandiford  <richard@codesourcery.com>
811
812         * elfxx-mips.c (mips_elf_create_got_section): Initialize hgot.
813
814 2006-03-11  H.J. Lu  <hongjiu.lu@intel.com>
815
816         PR ld/2443
817         * dwarf2.c (concat_filename): Don't issue an error if file is 0.
818
819 2006-03-10  Paul Brook  <paul@codesourcery.com>
820
821         * elf32-arm.c (INTERWORK_FLAG): Handle EABIv5.
822         (elf32_arm_print_private_bfd_data): Ditto.
823
824 2006-03-09  Paul Brook  <paul@codesourcery.com>
825
826         * cpu-arm.c (bfd_is_arm_mapping_symbol_name): Recognise additional
827         mapping symbols.
828
829 2006-03-09  Khem Raj  <khem@mvista.com>
830
831         * elf32-arm.c(elf32_arm_finish_dynamic_sections): Use unsigned
832         char type.
833
834 2006-03-08  H.J. Lu  <hongjiu.lu@intel.com>
835
836         * elfxx-ia64.c (elfNN_ia64_choose_gp): Properly choose gp.
837
838 2006-03-07  Richard Sandiford  <richard@codesourcery.com>
839             Daniel Jacobowitz  <dan@codesourcery.com>
840             Zack Weinberg  <zack@codesourcery.com>
841             Nathan Sidwell  <nathan@codesourcery.com>
842             Paul Brook  <paul@codesourcery.com>
843             Ricardo Anguiano  <anguiano@codesourcery.com>
844             Phil Edwards  <phil@codesourcery.com>
845
846         * configure.in (bfd_elf32_bigarm_vec): Include elf-vxworks.lo.
847         (bfd_elf32_bigarm_symbian_vec): Likewise.
848         (bfd_elf32_bigarm_vxworks_vec): Likewise.
849         (bfd_elf32_littlearm_vec): Likewise.
850         (bfd_elf32_littlearm_symbian_vec): Likewise.
851         (bfd_elf32_littlearm_vxworks_vec): Likewise.
852         * configure: Regenerate.
853         * elf32-arm.c: Include libiberty.h and elf-vxworks.h.
854         (RELOC_SECTION, RELOC_SIZE, SWAP_RELOC_IN, SWAP_RELOC_OUT): New macros.
855         (elf32_arm_vxworks_bed): Add forward declaration.
856         (elf32_arm_howto_table_1): Fix the masks for R_ASM_ABS12.
857         (elf32_arm_vxworks_exec_plt0_entry): New table.
858         (elf32_arm_vxworks_exec_plt_entry): Likewise.
859         (elf32_arm_vxworks_shared_plt_entry): Likewise.
860         (elf32_arm_link_hash_table): Add vxworks_p and srelplt2 fields.
861         (reloc_section_p): New function.
862         (create_got_section): Use RELOC_SECTION.
863         (elf32_arm_create_dynamic_sections): Likewise.  Call
864         elf_vxworks_create_dynamic_sections for VxWorks targets.
865         Choose between the two possible values of plt_header_size
866         and plt_entry_size.
867         (elf32_arm_link_hash_table_create): Initialize vxworks_p and srelplt2.
868         (elf32_arm_abs12_reloc): New function.
869         (elf32_arm_final_link_relocate): Call it.  Allow the creation of
870         dynamic R_ARM_ABS12 relocs on VxWorks.  Use reloc_section_p,
871         RELOC_SIZE, SWAP_RELOC_OUT and RELOC_SECTION.  Initialize the
872         r_addend fields of relocs.  On rela targets, skip any code that
873         adjusts in-place addends.  When using _bfd_link_final_relocate
874         to perform a final relocation, pass rel->r_addend as the addend
875         argument.
876         (elf32_arm_merge_private_bfd_data): If one of the bfds is a VxWorks
877         object, ignore flags that are not standard on VxWorks.
878         (elf32_arm_check_relocs): Allow the creation of dynamic R_ARM_ABS12
879         relocs on VxWorks.  Use reloc_section_p.
880         (elf32_arm_adjust_dynamic_symbol): Use RELOC_SECTION and RELOC_SIZE.
881         (allocate_dynrelocs): Use RELOC_SIZE.  Account for the size of
882         .rela.plt.unloaded relocs on VxWorks targets.
883         (elf32_arm_size_dynamic_sections): Use RELOC_SIZE.  Check for
884         .rela.plt.unloaded as well as .rel(a).plt.  Add DT_RELA* tags
885         instead of DT_REL* tags on RELA targets.
886         (elf32_arm_finish_dynamic_symbol): Use RELOC_SECTION, RELOC_SIZE
887         and SWAP_RELOC_OUT.  Initialize r_addend fields.  Handle VxWorks
888         PLT entries.  Do not make _GLOBAL_OFFSET_TABLE_ absolute on VxWorks.
889         (elf32_arm_finish_dynamic_sections): Use RELOC_SECTION, RELOC_SIZE
890         and SWAP_RELOC_OUT.  Initialize r_addend fields.  Handle DT_RELASZ
891         like DT_RELSZ.  Handle the VxWorks form of initial PLT entry.
892         Correct the .rela.plt.unreloaded symbol indexes.
893         (elf32_arm_output_symbol_hook): Call the VxWorks version of this
894         hook on VxWorks targets.
895         (elf32_arm_vxworks_link_hash_table_create): Set vxworks_p to true.
896         Minor formatting tweak.
897         (elf32_arm_vxworks_final_write_processing): New function.
898         (elf_backend_add_symbol_hook): Override for VxWorks and reset
899         for Symbian.
900         (elf_backend_final_write_processing): Likewise.
901         (elf_backend_emit_relocs): Likewise.
902         (elf_backend_want_plt_sym): Likewise.
903         (ELF_MAXPAGESIZE): Likewise.
904         (elf_backend_may_use_rel_p): Minor formatting tweak.
905         (elf_backend_may_use_rela_p): Likewise.
906         (elf_backend_default_use_rela_p): Likewise.
907         (elf_backend_rela_normal): Likewise.
908         * Makefile.in (elf32-arm.lo): Depend on elf-vxworks.h.
909
910 2006-03-06  Nathan Sidwell  <nathan@codesourcery.com>
911
912         * archures.c (bfd_mach_mcf_isa_a_nodiv, bfd_mach_mcf_isa_b_nousp):
913         New.  Adjust other variants.
914         (bfd_default_scan): Update.
915         * bfd-in2.h: Rebuilt.
916         * cpu-m68k.c: Adjust.
917         (bfd_m68k_compatible): New. Use it for architectures.
918         * elf32-m68k.c (elf32_m68k_object_p): Adjust.
919         (elf32_m68k_merge_private_bfd_data): Adjust.  Correct isa-a/b
920         mismatch.
921         (elf32_m68k_print_private_bfd_data): Adjust.
922         * ieee.c (ieee_write_processor): Adjust.
923         
924 2006-03-06  Alan Modra  <amodra@bigpond.net.au>
925
926         * dwarf2.c: Formatting.
927         (add_line_info): Remove outer loop.
928
929 2006-03-05  H.J. Lu  <hongjiu.lu@intel.com>
930             Alan Modra  <amodra@bigpond.net.au>
931
932         PR binutils/2338
933         * dwarf2.c (loadable_section): New struct.
934         (dwarf2_debug): Add loadable_section_count and
935         loadable_sections.
936         (new_line_sorts_after): New.
937         (add_line_info): Use new_line_sorts_after to compare line
938         addresses.
939         (check_function_name): Removed.
940         (unset_sections): New.
941         (place_sections): New.
942         (_bfd_dwarf2_find_nearest_line): Updated. Call place_sections
943         and unset_sections on relocatable files.
944         (_bfd_dwarf2_find_line): Likewise.
945
946 2006-03-03  Nick Clifton  <nickc@redhat.com>
947
948         * cpu-avr.c: Update to ISO-C90 formatting.
949         * elf32-avr.c: Likewise.
950
951 2006-03-03  Bjoern Haase  <bjoern.m.haase@web.de>
952
953         * elf32-avr.c (avr_reloc_map): Insert BFD_RELOC_AVR_MS8_LDI
954         and R_AVR_MS8_LDI 
955         (bfd_elf_avr_final_write_processing): Set
956         EF_AVR_LINKRELAX_PREPARED in e_flags field.
957         (elf32_avr_relax_section): New function.
958         (elf32_avr_relax_delete_bytes): New function.
959         (elf32_avr_get_relocated_section_contents): New function.
960         (avr_pc_wrap_around): New function.
961         (avr_relative_distance_considering_wrap_around): New function.
962         (avr_final_link_relocate): Handle negative int8t_t immediate for R_AVR_LDI.
963         * reloc.c: Add BFD_RELOC_AVR_MS8_LDI and BFD_RELOC_AVR_LDI_NEG
964         * libbfd.h: Regenerate.
965         * bfd-in2.h: Regenerate.
966
967 2006-03-02  DJ Delorie  <dj@redhat.com>
968
969         * elf32-m32c.c (m32c_offset_for_reloc): Fix local symbol
970         calculations.
971
972 2006-03-02  Richard Sandiford  <richard@codesourcery.com>
973
974         * elf32-ppc.c (is_ppc_elf_target): Return true if the target is
975         bfd_elf32_powerpc_vxworks_vec.
976
977 2006-03-02  Nick Clifton  <nickc@redhat.com>
978
979         * elf32-m32c.c (m32c_elf_relax_section): Initialise 'gap'.
980
981 2006-03-02  Richard Sandiford  <richard@codesourcery.com>
982
983         * elf32-i386.c (elf_i386_create_dynamic_sections): Use
984         elf_vxworks_create_dynamic_sections.
985         (elf_i386_size_dynamic_sections): Remove VxWorks GOT and PLT
986         symbol handling.
987         * elf32-ppc.c (ppc_elf_create_dynamic_sections): Use
988         elf_vxworks_create_dynamic_sections.
989         (ppc_elf_size_dynamic_sections): Remove VxWorks GOT and PLT
990         symbol handling.
991         * elf-vxworks.c (elf_vxworks_create_dynamic_sections): New function.
992         * elf-vxworks.h (elf_vxworks_create_dynamic_sections): Declare.
993
994 2006-03-02  Richard Sandiford  <richard@codesourcery.com>
995
996         * elf32-i386.c (elf_i386_vxworks_link_output_symbol_hook): Delete.
997         (elf_backend_link_output_symbol_hook): Use
998         elf_vxworks_link_output_symbol_hook instead.
999         * elf32-ppc.c (elf_i386_vxworks_link_output_symbol_hook): Delete.
1000         (elf_backend_link_output_symbol_hook): Use
1001         elf_vxworks_link_output_symbol_hook instead.
1002         * elf-vxworks.c (elf_vxworks_link_output_symbol_hook): Provide the
1003         same interface as elf_backend_link_output_symbol_hook.
1004         * elf-vxworks.h (elf_vxworks_link_output_symbol_hook): Update
1005         prototype accordingly.
1006
1007 2006-03-02  Richard Sandiford  <richard@codesourcery.com>
1008
1009         * elf32-ppc.c (ppc_elf_plt_type): New enumeration.
1010         (ppc_elf_link_hash_table): Replace old_got and new_got with
1011         plt_type and can_use_new_plt.
1012         (ppc_elf_create_dynamic_sections): Add SEC_HAS_CONTENTS,
1013         SEC_LOAD and SEC_READONLY to the VxWorks .plt flags.
1014         (ppc_elf_check_relocs): Set can_use_new_plt instead of new_plt.
1015         Move from plt_type == PLT_UNSET to PLT_OLD instead of setting old_plt.
1016         (ppc_elf_select_plt_layout): Move from plt_type == PLT_UNSET to
1017         either plt_type == PLT_OLD or plt_type == PLT_NEW.  Assert that
1018         this function should not be called for VxWorks targets.
1019         (ppc_elf_tls_setup): Use plt_type instead of old_got.
1020         (allocate_got): Likewise.  Rearrange so that max_before_header
1021         is only used for PLT_OLD and PLT_NEW.
1022         (allocate_dynrelocs): Use plt_type instead of old_got and is_vxworks.
1023         (ppc_elf_size_dynamic_sections): Likewise.
1024         (ppc_elf_relax_section): Likewise.
1025         (ppc_elf_relocate_section): Likewise.
1026         (ppc_elf_finish_dynamic_symbol): Likewise.
1027         (ppc_elf_vxworks_link_hash_table_create): Initialize plt_type.
1028
1029 2006-02-28  Richard Sandiford  <richard@codesourcery.com>
1030
1031         * elf32-i386.c (elf_i386_link_hash_table): Add next_tls_desc_index.
1032         (elf_i386_link_hash_table_create): Initialize it.
1033         (elf_i386_compute_jump_table_size): Use it instead of
1034         srelplt->reloc_count.
1035         (allocate_dynrelocs): Likewise.
1036         (elf_i386_size_dynamic_sections): Likewise.
1037         (elf_i386_relocate_section): Likewise.
1038         
1039 2006-02-27  Jakub Jelinek  <jakub@redhat.com>
1040
1041         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Handle S flag.
1042         (_bfd_elf_write_section_eh_frame): Likewise.
1043
1044 2006-02-27  Carlos O'Donell  <carlos@codesourcery.com>
1045
1046         * po/Make-in: Add html target.
1047
1048 2006-02-27  Richard Sandiford  <richard@codesourcery.com>
1049
1050         * elf-m10300.c (_bfd_mn10300_elf_finish_dynamic_symbol): Use the
1051         cached hgot entry to check for _GLOBAL_OFFSET_TABLE_.
1052         * elf32-arm.c (elf32_arm_finish_dynamic_symbol): Likewise.
1053         * elf32-bfin.c (bfin_finish_dynamic_symbol): Likewise.
1054         * elf32-cris.c (elf_cris_finish_dynamic_symbol): Likewise.
1055         * elf32-hppa.c (elf32_hppa_finish_dynamic_symbol): Likewise.
1056         * elf32-i386.c (elf_i386_finish_dynamic_symbol): Likewise.
1057         * elf32-m32r.c (m32r_elf_finish_dynamic_symbol): Likewise.
1058         * elf32-m68k.c (elf_m68k_finish_dynamic_symbol): Likewise.
1059         * elf32-sh.c (sh_elf_finish_dynamic_symbol): Likewise.
1060         * elf32-vax.c (elf_vax_finish_dynamic_symbol): Likewise.
1061         * elf32-xtensa.c (elf_xtensa_finish_dynamic_symbol): Likewise.
1062         * elf64-sh64.c (sh64_elf64_finish_dynamic_symbol): Likewise.
1063         * elf64-x86-64.c (elf64_x86_64_finish_dynamic_symbol): Likewise.
1064         * elfxx-mips.c (_bfd_mips_elf_finish_dynamic_symbol): Likewise.
1065         * elf32-s390.c (elf_s390_finish_dynamic_symbol): Likewise.  Also use
1066         the cached hplt entry to check for _PROCEDURE_LINKAGE_TABLE_.
1067         * elf64-alpha.c (elf64_alpha_finish_dynamic_symbol): Likewise.
1068         * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
1069         * elfxx-ia64.c (elfNN_ia64_finish_dynamic_symbol): Likewise.
1070         * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Likewise.
1071
1072 2006-02-25  Richard Sandiford  <richard@codesourcery.com>
1073
1074         * elf-bfd.h (elf_link_hash_table): Add hplt field.
1075         * elflink.c (_bfd_elf_create_dynamic_sections): Initialize it.
1076         * elf-m10300.c (_bfd_mn10300_elf_create_got_section): Likewise.
1077         * elf32-frv.c (_frv_create_got_section): Likewise.
1078         * elf32-m32r.c (m32r_elf_create_dynamic_sections): Likewise.
1079         * elf32-sh.c (sh_elf_create_dynamic_sections): Likewise.
1080         * elf64-alpha.c (elf64_alpha_create_dynamic_sections): Likewise.
1081         * elf64-sh64.c (sh64_elf64_create_dynamic_sections): Likewise.
1082         * elf32-i386.c (elf_i386_link_hash_table): Remove hgot and hplt.
1083         (elf_i386_link_hash_table_create): Don't initialize them.
1084         (elf_i386_size_dynamic_sections): Use the generic ELF hplt and
1085         hgot fields.
1086         (elf_i386_finish_dynamic_symbol): Likewise.
1087         * elf32-ppc.c (ppc_elf_link_hash_table): Remove hplt.
1088         (ppc_elf_size_dynamic_sections): Use the generic ELF hplt fields.
1089         (ppc_elf_finish_dynamic_symbol): Likewise.
1090         
1091 2006-02-24  DJ Delorie  <dj@redhat.com>
1092
1093         * elf32-m32c.c (m32c_elf_howto_table): Add relaxation relocs.
1094         (m32c_elf_relocate_section): Don't relocate them.
1095         (compare_reloc): New.
1096         (relax_reloc): Remove.
1097         (m32c_offset_for_reloc): New.
1098         (m16c_addr_encodings): New.
1099         (m16c_jmpaddr_encodings): New.
1100         (m32c_addr_encodings): New.
1101         (m32c_elf_relax_section): Relax jumps and address displacements.
1102         (m32c_elf_relax_delete_bytes): Adjust for internal syms.  Fix up
1103         short jumps.
1104
1105         * reloc.c: Add m32c relax relocs.
1106         * libbfd.h: Regenerate.
1107         * bfd-in2.h: Regenerate.
1108         
1109 2006-02-24  H.J. Lu  <hongjiu.lu@intel.com>
1110
1111         PR ld/2218
1112         * elf-bfd.h (elf_backend_data): Add elf_backend_fixup_symbol.
1113         (_bfd_elf_link_hash_fixup_symbol): New.
1114
1115         * elflink.c (_bfd_elf_link_hash_fixup_symbol): New.
1116         (_bfd_elf_fix_symbol_flags): Call elf_backend_fixup_symbol if
1117         it isn't NULL.
1118
1119         * elfxx-ia64.c (elf_backend_fixup_symbol): Defined.
1120
1121         * elfxx-target.h (elf_backend_fixup_symbol): New.
1122         (elfNN_bed): Initialize elf_backend_fixup_symbol.
1123
1124 2006-02-23  H.J. Lu  <hongjiu.lu@intel.com>
1125
1126         * cpu-ia64-opc.c (ins_immu5b): New.
1127         (ext_immu5b): Likewise.
1128         (elf64_ia64_operands): Add IMMU5b.
1129
1130 2006-02-21  Alan Modra  <amodra@bigpond.net.au>
1131
1132         PR ld/2218
1133         * elf32-arm.c (allocate_dynrelocs): Ensure undef weak sym in pie
1134         is dynamic.
1135         * elf32-hppa.c (allocate_dynrelocs): Likewise.
1136         * elf32-i386.c (allocate_dynrelocs): Likewise.
1137         * elf32-s390.c (allocate_dynrelocs): Likewise.
1138         * elf32-sh.c (allocate_dynrelocs): Likewise.
1139         * elf64-s390.c (allocate_dynrelocs): Likewise.
1140         * elf64-x86-64.c (allocate_dynrelocs): Likewise.
1141         * elf32-m32r.c (allocate_dynrelocs): Likewise.  Discard relocs
1142         on undef weak with non-default visibility too.
1143         * elfxx-sparc.c (allocate_dynrelocs): Ditto.
1144
1145 2006-02-21  Alan Modra  <amodra@bigpond.net.au>
1146
1147         * bfd.c: (_bfd_default_error_handler): Don't call abort on
1148         error, instead call _exit.
1149         (_bfd_abort): Call _exit not xexit.
1150
1151 2006-02-17  Kevin Buettner  <kevinb@redhat.com>
1152
1153         * elf32-frv.c (elf32_frv_grok_prstatus, elf32_frv_grok_psinfo):
1154         New functions.
1155         * elf_backend_grok_prstatus, elf_backend_grok_psinfo): Define.
1156
1157 2006-02-17  Shrirang Khisti  <shrirangk@kpitcummins.com>
1158             Anil Paranjape   <anilp1@kpitcummins.com>
1159             Shilin Shakti    <shilins@kpitcummins.com>
1160
1161         * Makefile.am: Add xc16x related entry 
1162         * Makefile.in: Regenerate 
1163         * archures.c: Add bfd_xc16x_arch 
1164         * bfd-in2.h: Regenerate
1165         * config.bfd: Add xc16x-*-elf
1166         * configure.in: Add bfd_elf32_xc16x_vec
1167         * configure: Regenerate.
1168         * targets.c: Added xc16x related information
1169         * cpu-xc16x.c: New file
1170         * reloc.c: Add new relocations specific to xc16x:
1171         BFD_RELOC_XC16X_PAG, BFD_RELOC_XC16X_POF, BFD_RELOC_XC16X_SEG,
1172         BFD_RELOC_XC16X_SOF     
1173         * elf32-xc16x.c: New file.
1174
1175 2006-02-17  Alan Modra  <amodra@bigpond.net.au>
1176
1177         * elf32-ppc.c (allocate_dynrelocs): Tweak undef weak handling.
1178         * elf64-ppc.c (allocate_dynrelocs): Likewise.
1179
1180 2006-02-17  Alan Modra  <amodra@bigpond.net.au>
1181
1182         PR ld/2218
1183         * elf64-ppc.c (allocate_dynrelocs): Ensure undef weak sym is
1184         dynamic.
1185         (ppc64_elf_relocate_section): Check output reloc section size.
1186         * elf32-ppc.c (allocate_dynrelocs): Simplify undef weak test.
1187
1188 2006-02-16  H.J. Lu  <hongjiu.lu@intel.com>
1189
1190         PR ld/2322
1191         * elf.c (get_segment_type): New function.
1192         (_bfd_elf_print_private_bfd_data): Use it.
1193         (print_segment_map): New function.
1194         (assign_file_positions_for_segments): Call print_segment_map
1195         when there are not enough room for program headers.
1196
1197 2006-02-16  Nick Hudson  <nick.hudson@dsl.pipex.com>
1198
1199         * config.bfd (mips*el-*-netbsd*, mips*-*-netbsd*): Use
1200         traditional MIPS ELF targets.
1201
1202 2006-02-15  H.J. Lu  <hongjiu.lu@intel.com>
1203
1204         PR binutils/2338
1205         * dwarf2.c (check_function_name): New function.
1206         (_bfd_dwarf2_find_nearest_line): Use check_function_name to
1207         check if function is correct.
1208
1209 2006-02-16  Alan Modra  <amodra@bigpond.net.au>
1210
1211         * elflink.c (_bfd_elf_default_action_discarded): Return 0 for
1212         debug sections.
1213         (elf_link_input_bfd): Adjust comments.
1214
1215 2006-02-10  H.J. Lu  <hongjiu.lu@intel.com>
1216
1217         * elf.c (copy_private_bfd_data): Minor update.
1218
1219 2006-02-10  H.J. Lu  <hongjiu.lu@intel.com>
1220
1221         PR binutils/2258
1222         * elf.c (copy_private_bfd_data): Renamed to ...
1223         (rewrite_elf_program_header): This.
1224         (copy_elf_program_header): New function.
1225         (copy_private_bfd_data): Likewise.
1226
1227 2006-02-07  Nathan Sidwell  <nathan@codesourcery.com>
1228
1229         * archures.c (bfd_mach_mcf5200, bfd_mach_mcf5206e,
1230         bfd_mach_mcf5307, bfd_mach_mcf5407, bfd_mach_mcf528x,
1231         bfd_mach_mcfv4e, bfd_mach_mcf521x, bfd_mach_mcf5249,
1232         bfd_mach_mcf547x, bfd_mach_mcf548x): Remove.
1233         (bfd_mach_mcf_isa_a, bfd_mach_mcf_isa_a_div,
1234         bfd_mach_mcf_isa_a_div_mac, bfd_mach_mcf_isa_a_div_emac,
1235         bfd_mach_mcf_isa_aplus, bfd_mach_mcf_isa_aplus_mac,
1236         bfd_mach_mcf_isa_aplus_emac, bfd_mach_mcf_isa_aplus_usp,
1237         bfd_mach_mcf_isa_aplus_usp_mac, bfd_mach_mcf_isa_aplus_usp_emac,
1238         bfd_mach_mcf_isa_b, bfd_mach_mcf_isa_b_mac, bfd_mach_mcf_isa_b_emac,
1239         bfd_mach_mcf_isa_b_usp_float, bfd_mach_mcf_isa_b_usp_float_mac,
1240         bfd_mach_mcf_isa_b_usp_float_emac): New.
1241         (bfd_default_scan): Update coldfire mapping.
1242         * bfd-in.h (bfd_m68k_mach_to_features,
1243         bfd_m68k_features_to_mach): Declare.
1244         * bfd-in2.h: Rebuilt.
1245         * cpu-m68k.c (arch_info_struct): Add new coldfire machines,
1246         adjust legacy names.
1247         (m68k_arch_features): New.
1248         (bfd_m68k_mach_to_features,
1249         bfd_m68k_features_to_mach): Define.
1250         * elf32-m68k.c (elf32_m68k_object_p): New.
1251         (elf32_m68k_merge_private_bfd_data): Merge the CF EF flags.
1252         (elf32_m68k_print_private_bfd_data): Print the CF EF flags.
1253         (elf_backend_object_p): Define.
1254         * ieee.c (ieee_write_processor): Update coldfire machines.
1255         * libbfd.h: Rebuilt.
1256
1257 2006-02-06  Steve Ellcey  <sje@cup.hp.com>
1258
1259         * elfxx-ia64.c (elfNN_ia64_fake_sections): Set SHF_IA_64_HP_TLS
1260         if SHF_TLS is set.
1261
1262 2006-02-05  Arnold Metselaar  <arnold.metselaar@planet.nl>
1263
1264         * coff-z80.c (r_imm24): New howto. 
1265         (rtype2howto): New case R_IMM24.
1266         (coff_z80_reloc_type_lookup): New case BFD_RELOC_24.
1267         (extra_case): Use bfd_get_8 for R_IMM8, new case R_IMM24.
1268
1269 2006-02-04  Richard Sandiford  <richard@codesourcery.com>
1270
1271         * elfxx-mips.c (mips_elf_initialize_tls_index): If a TLS symbol
1272         has already been assigned a GOT index, copy that index to the
1273         current hash table entry.
1274
1275 2006-02-01  Eric Botcazou  <ebotcazou@libertysurf.fr>
1276
1277         * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Reinstate bypass
1278         for call-to-undefweak reloc overflow.
1279
1280 2006-01-31  Eric Botcazou  <ebotcazou@libertysurf.fr>
1281
1282         * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Reinstate bypass
1283         for 32-bit relocs overflow.
1284
1285 2006-01-27  Paul Brook  <paul@codesourcery.com>
1286
1287         * elf32-arm.c (elf32_arm_get_symbol_type): Allow STT_TLS thumb
1288         objects.
1289
1290 2006-01-18  Alexandre Oliva  <aoliva@redhat.com>
1291
1292         Introduce TLS descriptors for i386 and x86_64.
1293         * reloc.c (BFD_RELOC_386_TLS_GOTDESC, BFD_RELOC_386_TLS_DESC,
1294         BFD_RELOC_386_TLS_DESC_CALL, BFD_RELOC_X86_64_GOTPC32_TLSDESC,
1295         BFD_RELOC_X86_64_TLSDESC, BFD_RELOC_X86_64_TLSDESC_CALL): New.
1296         * libbfd.h, bfd-in2.h: Rebuilt.
1297         * elf32-i386.c (elf_howto_table): New relocations.
1298         (R_386_tls): Adjust.
1299         (elf_i386_reloc_type_lookup): Map new relocations.
1300         (GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P): New macros.
1301         (GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): New macros.
1302         (struct elf_i386_link_hash_entry): Add tlsdesc_got field.
1303         (struct elf_i386_obj_tdata): Add local_tlsdesc_gotent field.
1304         (elf_i386_local_tlsdesc_gotent): New macro.
1305         (struct elf_i386_link_hash_table): Add sgotplt_jump_table_size.
1306         (elf_i386_compute_jump_table_size): New macro.
1307         (link_hash_newfunc): Initialize tlsdesc_got.
1308         (elf_i386_link_hash_table_create): Set sgotplt_jump_table_size.
1309         (elf_i386_tls_transition): Handle R_386_TLS_GOTDESC and
1310         R_386_TLS_DESC_CALL.
1311         (elf_i386_check_relocs): Likewise.  Allocate space for
1312         local_tlsdesc_gotent.
1313         (elf_i386_gc_sweep_hook): Handle R_386_TLS_GOTDESC and
1314         R_386_TLS_DESC_CALL.
1315         (allocate_dynrelocs): Count function PLT relocations.  Reserve
1316         space for TLS descriptors and relocations.
1317         (elf_i386_size_dynamic_sections): Reserve space for TLS
1318         descriptors and relocations.  Set up sgotplt_jump_table_size.
1319         Don't zero reloc_count in srelplt.
1320         (elf_i386_always_size_sections): New.  Set up _TLS_MODULE_BASE_.
1321         (elf_i386_relocate_section): Handle R_386_TLS_GOTDESC and
1322         R_386_TLS_DESC_CALL.
1323         (elf_i386_finish_dynamic_symbol): Use GOT_TLS_GD_ANY_P.
1324         (elf_backend_always_size_sections): Define.
1325         * elf64-x86-64.c (x86_64_elf_howto): Add R_X86_64_GOTPC32_TLSDESC,
1326         R_X86_64_TLSDESC, R_X86_64_TLSDESC_CALL.
1327         (R_X86_64_standard): Adjust.
1328         (x86_64_reloc_map): Map new relocs.
1329         (elf64_x86_64_rtype_to_howto): New, split out of...
1330         (elf64_x86_64_info_to_howto): ... this function, and...
1331         (elf64_x86_64_reloc_type_lookup): ... use it to map elf_reloc_val.
1332         (GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P): New macros.
1333         (GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): New macros.
1334         (struct elf64_x86_64_link_hash_entry): Add tlsdesc_got field.
1335         (struct elf64_x86_64_obj_tdata): Add local_tlsdesc_gotent field.
1336         (elf64_x86_64_local_tlsdesc_gotent): New macro.
1337         (struct elf64_x86_64_link_hash_table): Add tlsdesc_plt,
1338         tlsdesc_got and sgotplt_jump_table_size fields.
1339         (elf64_x86_64_compute_jump_table_size): New macro.
1340         (link_hash_newfunc): Initialize tlsdesc_got.
1341         (elf64_x86_64_link_hash_table_create): Initialize new fields.
1342         (elf64_x86_64_tls_transition): Handle R_X86_64_GOTPC32_TLSDESC and
1343         R_X86_64_TLSDESC_CALL.
1344         (elf64_x86_64_check_relocs): Likewise.  Allocate space for
1345         local_tlsdesc_gotent.
1346         (elf64_x86_64_gc_sweep_hook): Handle R_X86_64_GOTPC32_TLSDESC and
1347         R_X86_64_TLSDESC_CALL.
1348         (allocate_dynrelocs): Count function PLT relocations.  Reserve
1349         space for TLS descriptors and relocations.
1350         (elf64_x86_64_size_dynamic_sections): Reserve space for TLS
1351         descriptors and relocations.  Set up sgotplt_jump_table_size,
1352         tlsdesc_plt and tlsdesc_got.  Make room for them.  Don't zero
1353         reloc_count in srelplt.  Add dynamic entries for DT_TLSDESC_PLT
1354         and DT_TLSDESC_GOT.
1355         (elf64_x86_64_always_size_sections): New.  Set up
1356         _TLS_MODULE_BASE_.
1357         (elf64_x86_64_relocate_section): Handle R_386_TLS_GOTDESC and
1358         R_386_TLS_DESC_CALL.
1359         (elf64_x86_64_finish_dynamic_symbol): Use GOT_TLS_GD_ANY_P.
1360         (elf64_x86_64_finish_dynamic_sections): Set DT_TLSDESC_PLT and
1361         DT_TLSDESC_GOT.  Set up TLS descriptor lazy resolver PLT entry.
1362         (elf_backend_always_size_sections): Define.
1363
1364 2006-01-17  H.J. Lu  <hongjiu.lu@intel.com>
1365
1366         PR binutils/2096
1367         * dwarf2.c (comp_unit_contains_address): Update comment.
1368         (_bfd_dwarf2_find_nearest_line): Use section's vma, instead of
1369         lma.  Return TRUE only if both comp_unit_contains_address and
1370         comp_unit_find_nearest_line return TRUE.
1371         (_bfd_dwarf2_find_line): Use section's vma, instead of lma.
1372
1373 2006-01-18  Alan Modra  <amodra@bigpond.net.au>
1374
1375         * elf-bfd.h (struct elf_backend_data): Add gc_mark_dynamic_ref.
1376         (bfd_elf_gc_mark_dynamic_ref_symbol): Declare.
1377         * elflink.c (bfd_elf_gc_mark_dynamic_ref_symbol): Rename from
1378         elf_gc_mark_dynamic_ref_symbol.  Make global.
1379         (bfd_elf_gc_sections): Call bed->gc_mark_dynamic_ref.
1380         * elfxx-target.h (elf_backend_gc_mark_dynamic_ref): Define.
1381         (elfNN_bed): Init new field.
1382         * elf64-ppc.c (elf_backend_gc_mark_dynamic_ref): Define.
1383         (ppc64_elf_gc_mark_dynamic_ref): New function.
1384
1385 2006-01-17  Alan Modra  <amodra@bigpond.net.au>
1386
1387         * elf64-ppc.c (ppc64_elf_gc_mark_hook): Don't hang forever in loop.
1388
1389 2006-01-17  Nick Clifton  <nickc@redhat.com>
1390
1391         PR binutils/2159
1392         * elf.c (elfcore_write_pstatus): Add ATTRIBUTE_UNUSED to unused
1393         parameters.
1394
1395 2006-01-11  Nick Clifton  <nickc@redhat.com>
1396
1397         * elf32-arm.c (elf32_arm_output_symbol_hook): Install new entry
1398         into the newly (re)allocated map array.
1399
1400 2006-01-09  Alexis Wilke  <alexis_wilke@yahoo.com>
1401
1402         * peXXigen.c (tbl): Add comma after "HIGH3ADJ".
1403
1404 2006-01-01  Jakub Jelinek  <jakub@redhat.com>
1405
1406         * elf64-ppc.c (ppc64_elf_action_discarded): Return 0
1407         for .toc1 section.
1408
1409 For older changes see ChangeLog-2005
1410 \f
1411 Local Variables:
1412 mode: change-log
1413 left-margin: 8
1414 fill-column: 74
1415 version-control: never
1416 End: