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