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