9ff4b5c37de18acd92b8d192f91496944c5f947e
[platform/upstream/binutils.git] / bfd / ChangeLog
1 2008-08-25  Christophe Lyon  <christophe.lyon@st.com>
2
3         * elf32-arm.c (arm_thumb_arm_v4t_short_branch_stub): Define.
4         (elf32_arm_stub_type): Add arm_thumb_arm_v4t_stub_short_branch.
5         (arm_type_of_stub): Handle armv4t short branches. Update
6         prototype.
7         (arm_stub_is_thumb): Handle arm_thumb_arm_v4t_stub_short_branch.
8         (arm_build_one_stub): Likewise.
9         (arm_size_one_stub): Likewise.
10         (elf32_arm_size_stubs): Use new arm_type_of_stub prototype.
11         (arm_map_one_stub): Handle arm_thumb_arm_v4t_stub_short_branch.
12
13 2008-08-24  Andreas Schwab  <schwab@suse.de>
14
15         * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): Do proper
16         extension when calculating difference of offsets.
17
18 2008-08-24  Alan Modra  <amodra@bigpond.net.au>
19
20         * configure.in: Update a number of obsolete autoconf macros.
21         * aclocal.m4: Regenerate.
22
23 2008-08-23  Andreas Schwab  <schwab@suse.de>
24
25         * opncls.c (find_separate_debug_file): Use the canonical
26         absolute name of the bfd object for finding the debug file in
27         the global debugfile directory.
28
29 2008-08-22  Jakub Jelinek  <jakub@redhat.com>
30
31         Fix PR ld/3290 regression for cross-files DW_FORM_ref_addr relocations.
32         * elflink.c (elf_link_add_object_symbols): Make debug symbols local
33         now only for non-RELOCATABLE targets.
34
35 2008-08-20  Bob Wilson  <bob.wilson@acm.org>
36
37         * elf-bfd.h (elf_object_id): Add XTENSA_ELF_TDATA.
38         * elf32-xtensa.c (elf_howto_table): Add TLS relocations.
39         (elf_xtensa_reloc_type_lookup): Likewise.
40         (TCB_SIZE): Define.
41         (elf_xtensa_link_hash_entry): New.
42         (GOT_UNKNOWN, GOT_NORMAL, GOT_TLS_GD, GOT_TLS_IE, GOT_TLS_ANY): Define.
43         (elf_xtensa_hash_entry): Define.
44         (elf_xtensa_obj_tdata): New.
45         (elf_xtensa_tdata): Define.
46         (elf_xtensa_local_got_tls_type): Define.
47         (elf_xtensa_local_tlsfunc_refcounts): Define.
48         (is_xtensa_elf): Define.
49         (elf_xtensa_mkobject): New.
50         (elf_xtensa_link_hash_table): Add tlsbase field.
51         (elf_xtensa_link_hash_newfunc): New.
52         (elf_xtensa_link_hash_table_create): Use elf_xtensa_link_hash_newfunc.
53         Create an entry for "_TLS_MODULE_BASE_" and save it in tlsbase field.
54         (elf_xtensa_copy_indirect_symbol): New.
55         (elf_xtensa_check_relocs): Rewrite to handle TLS relocations.
56         (elf_xtensa_gc_sweep_hook): Likewise.
57         (elf_xtensa_allocate_dynrelocs): Optimize away GOT entries for
58         TLSDESC_FN relocations when an IE reference is seen.
59         (elf_xtensa_allocate_local_got_size): Likewise.
60         (elf_xtensa_always_size_sections): New.
61         (dtpoff_base, tpoff): New.
62         (elf_xtensa_do_reloc): Handle TLS relocations.
63         (replace_tls_insn): New.
64         (IS_XTENSA_TLS_RELOC): Define.
65         (elf_xtensa_relocate_section): Handle TLS relocations.
66         (get_indirect_call_dest_reg): New.
67         (bfd_elf32_mkobject): Define.
68         (elf_backend_always_size_sections): New.
69         (elf_backend_copy_indirect_symbol): New.
70         * reloc.c (BFD_RELOC_XTENSA_TLSDESC_FN, BFD_RELOC_XTENSA_TLSDESC_ARG)
71         (BFD_RELOC_XTENSA_TLS_DTPOFF, BFD_RELOC_XTENSA_TLS_TPOFF)
72         (BFD_RELOC_XTENSA_TLS_FUNC, BFD_RELOC_XTENSA_TLS_ARG)
73         (BFD_RELOC_XTENSA_TLS_CALL): New.
74         * bfd-in2.h: Regenerate.
75         * libbfd.h: Regenerate.
76
77 2008-08-18  Richard Sandiford  <rdsandiford@googlemail.com>
78
79         * elfxx-mips.c (_bfd_mips_elf_copy_indirect_symbol): Copy MIPS16
80         stub information.
81
82 2008-08-17  Nick Clifton  <nickc@redhat.com>
83
84         * elf32-arm.c: Tidy up the code.
85         (bfd_elf32_arm_allocate_interworking_sections): Move common code
86         into...
87         (arm_allocate_glue_section_space): ... New function.
88         (bfd_elf32_arm_add_glue_sections_to_bfd): Move common code
89         into...
90         (arm_make_glue_section): ... New function.
91
92         * elfxx-mips.c (_bfd_mips_elf_check_relocs): Handle the situation
93         where the sym_hashes are not available.
94
95 2008-08-17  Alan Modra  <amodra@bigpond.net.au>
96
97         * bfd.c (struct _bfd): Correct outsymbols comment.
98         * bfd-in2.h: Regenerate.
99         * linker.c (bfd_generic_link_read_symbols): Renamed from..
100         (generic_link_read_symbols): ..this, and made global.
101
102 2008-08-15  Alan Modra  <amodra@bigpond.net.au>
103
104         PR 6526
105         * configure.in: Invoke AC_USE_SYSTEM_EXTENSIONS.
106         * Makefile.in: Regenerate.
107         * aclocal.m4: Regenerate.
108         * config.in: Regenerate.
109         * configure: Regenerate.
110
111 2008-08-14  Jaka Močnik  <jaka@xlab.si>
112
113         * coffgen.c (coff_find_nearest_line): Correct cached line index.
114
115 2008-08-12  Alan Modra  <amodra@bigpond.net.au>
116
117         * elf32-ppc.c (allocate_dynrelocs): Ignore dyn_relocs when
118         !dynamic_sections_created.  Don't make symbols with got
119         references dynamic if !dynamic_sections_created.
120         * elf64-ppc.c (allocate_dynrelocs): Likewise.  Alloc dynamic
121         relocs on undefined symbols.
122         (ppc64_elf_relocate_section): Allow dynamic relocs on
123         undefined symbols.
124
125 2008-08-11  Alan Modra  <amodra@bigpond.net.au>
126
127         * elf64-ppc.c (toc_adjusting_stub_needed): Any call via the plt
128         needs r2 valid, not just those to external syms.
129
130 2008-08-09  Pedro Alves  <pedro@codesourcery.com>
131
132         * archive.c (_bfd_archive_bsd_update_armap_timestamp): Cast stat
133         st_mtime to long before comparison.
134
135 2008-08-08  Anatoly Sokolov  <aesok@post.ru>
136
137         * archures.c (bfd_mach_avr25, bfd_mach_avr31, bfd_mach_avr35,
138         bfd_mach_avr51): New.
139         * bfd-in2.h: Regenerate.
140         * cpu-avr.c (arch_info_struct): Add avr25, avr31, avr35, and avr51
141         architectures. Change comments to match architecture comments in GCC.
142         (compatible): Add test for new AVR architectures.
143         * elf32-avr.c (bfd_elf_avr_final_write_processing): Recognize
144         bfd_mach_avr25, bfd_mach_avr31, bfd_mach_avr35 and bfd_mach_avr51.
145         (elf32_avr_object_p): Recognize E_AVR_MACH_AVR25, E_AVR_MACH_AVR31,
146         E_AVR_MACH_AVR35 and E_AVR_MACH_AVR51.
147
148
149 2008-08-08  Richard Sandiford  <rdsandiford@googlemail.com>
150             Daniel Jacobowitz  <dan@codesourcery.com>
151             Catherine Moore  <clm@codesourcery.com>
152             Mark Shinwell  <shinwell@codesourcery.com>
153             Maxim Kuvyrkov  <maxim@codesourcery.com>
154
155         * elf32-mips.c (mips_vxworks_copy_howto_rela): Replace with...
156         (elf_mips_copy_howto): ...this howto.  Clear the size fields.
157         (mips_vxworks_jump_slot_howto_rela): Replace with...
158         (elf_mips_jump_slot_howto): ...this howto.
159         (bfd_elf32_bfd_reloc_type_lookup): Handle BFD_RELOC_MIPS_COPY
160         and BFD_RELOC_MIPS_JUMP_SLOT.
161         (bfd_elf32_bfd_reloc_name_lookup): Handle "R_MIPS_COPY" and
162         "R_MIPS_JUMP_SLOT".
163         (mips_elf32_rtype_to_howto): Handle R_MIPS_COPY and R_MIPS_JUMP_SLOT.
164         (elf_backend_plt_readonly): Define.
165         (elf_backend_plt_sym_val): Define for non-VxWorks targets.
166         (mips_vxworks_bfd_reloc_type_lookup): Delete.
167         (mips_vxworks_bfd_reloc_name_lookup): Likewise.
168         (mips_vxworks_rtype_to_howto): Likewise.
169         (elf_backend_want_dynbss): Don't define for VxWorks.
170         (elf_backend_plt_readonly): Likewise.
171         (bfd_elf32_bfd_reloc_type_lookup): Likewise.
172         (bfd_elf32_bfd_reloc_name_lookup): Likewise.
173         (elf_backend_mips_rtype_to_howto): Likewise.
174         (elf_backend_adjust_dynamic_symbol): Likewise.
175         (elf_backend_got_symbol_offset): Don't define.
176         * elfn32-mips.c (elf_mips_copy_howto, elf_mips_jump_slot_howto): New.
177         (bfd_elf32_bfd_reloc_type_lookup): Handle BFD_RELOC_MIPS_COPY
178         and BFD_RELOC_MIPS_JUMP_SLOT.
179         (bfd_elf32_bfd_reloc_name_lookup): Handle "R_MIPS_COPY" and
180         "R_MIPS_JUMP_SLOT".
181         (mips_elf32_n32_rtype_to_howto): Handle R_MIPS_COPY and
182         R_MIPS_JUMP_SLOT.
183         (elf_backend_rela_plts_and_copies_p, elf_backend_plt_readonly)
184         (elf_backend_plt_sym_val): Define.
185         * elf64-mips.c (elf_mips_copy_howto, elf_mips_jump_slot_howto): New.
186         (bfd_elf64_bfd_reloc_type_lookup): Handle BFD_RELOC_MIPS_COPY
187         and BFD_RELOC_MIPS_JUMP_SLOT.
188         (bfd_elf64_bfd_reloc_name_lookup): Handle "R_MIPS_COPY" and
189         "R_MIPS_JUMP_SLOT".
190         (mips_elf64_rtype_to_howto): Handle R_MIPS_COPY and R_MIPS_JUMP_SLOT.
191         (elf_backend_rela_plts_and_copies_p, elf_backend_plt_readonly)
192         (elf_backend_plt_sym_val): Define.
193         * elfxx-mips.h (_bfd_mips_vxworks_adjust_dynamic_symbol): Delete.
194         (_bfd_mips_elf_use_plts_and_copy_relocs, _bfd_mips_elf_init_stubs)
195         (_bfd_mips_elf_plt_sym_val, _bfd_mips_post_process_headers): Declare.
196         * elfxx-mips.c (mips_elf_la25_stub): New structure.
197         (LA25_LUI, LA25_J, LA25_ADDIU): New macros.
198         (mips_elf_link_hash_entry): Add "la25_stubs", "has_static_relocs"
199         and "has_nonpic_branches" fields.  Remove "is_relocation_target" and
200         "is_branch_target".
201         (mips_elf_link_hash_table): Add blank lines.  Add
202         "use_plts_and_copy_relocs", "reserved_gotno", "strampoline",
203         "la25_stubs" and "add_stub_section" fields.
204         (mips_htab_traverse_info): New structure.
205         (PIC_OBJECT_P, MIPS_ELF_LOAD_WORD): New macros.
206         (MIPS_RESERVED_GOTNO): Delete.
207         (mips_o32_exec_plt0_entry, mips_n32_exec_plt0_entry)
208         (mips_n64_exec_plt0_entry, mips_exec_plt_entry): New tables.
209         (mips_elf_link_hash_newfunc): Update after the changes to
210         mips_elf_link_hash_entry.
211         (mips_elf_check_mips16_stubs): Replace the DATA parameter with
212         an INFO parameter.  Don't look through warnings symbols here;
213         do it in mips_elf_check_symbols instead.
214         (mips_elf_create_stub_symbol): New function.
215         (mips_elf_la25_stub_hash, mips_elf_la25_stub_eq): New functions.
216         (_bfd_mips_elf_init_stubs, mips_elf_local_pic_function_p): Likewise.
217         (mips_elf_add_la25_intro, mips_elf_add_la25_trampoline): Likewise.
218         (mips_elf_add_la25_stub, mips_elf_check_symbols): New functions.
219         (mips_elf_gotplt_index): Check for VxWorks.
220         (mips_elf_output_dynamic_relocation): Take the relocation index
221         as an extra parameter.  Do not increment reloc_count here.
222         (mips_elf_initialize_tls_slots): Update the calls to
223         mips_elf_output_dynamic_relocation accordingly.
224         (mips_elf_multi_got): Use htab->reserved_gotno instead of
225         MIPS_RESERVED_GOTNO.
226         (mips_elf_create_got_section): Don't allocate reserved GOT
227         entries here.  Unconditionally create .got.plt, but don't
228         set its alignment here.
229         (mips_elf_relocation_needs_la25_stub): New function.
230         (mips_elf_calculate_relocation): Redirect branches and jumps to
231         a non-PIC stub if one exists.  Check !h->has_static_relocs instead
232         of !htab->is_vxworks when deciding whether to create dynamic
233         relocations for R_MIPS_32, R_MIPS_REL32 and R_MIPS_64.
234         (_bfd_mips_elf_create_dynamic_sections): Unconditionally call
235         _bfd_elf_create_dynamic_sections.  Unconditionally set up
236         htab->splt and htab->sdynbss.  Set htab->srelplt to ".rel.plt"
237         if !htab->is_vxworks.  Add non-VxWorks values of
238         htab->plt_header_size and htab->plt_entry_size.
239         (_bfd_mips_elf_check_relocs): Set pointer_equality_needed for
240         non-branch static relocations.  Set has_nonpic_branches when an la25
241         stub might be required.  Set can_make_dynamic_p to TRUE if R_MIPS_32,
242         R_MIPS_REL32 and R_MIPS_64 relocations can be made dynamic,
243         rather than duplicating the condition.  Do not make them dynamic
244         for read-only sections in non-PIC executable objects.
245         Do not protect this code with dynobj == NULL || htab->sgot == NULL;
246         handle each group of cases separately.  Add a default case that
247         sets has_static_relocs for non-GOT relocations that cannot be
248         made dynamic.  Don't set is_relocation_target and is_branch_target.
249         Reject non-PIC static relocations in shared objects.
250         (_bfd_mips_vxworks_adjust_dynamic_symbol): Fold into...
251         (_bfd_mips_elf_adjust_dynamic_symbol): ...here, using
252         htab->use_plts_and_copy_relocs instead of htab->is_vxworks
253         to select PLT and copy-reloc handling.  Set the alignment of
254         .plt and .got.plt when allocating the first entry.  Generalize
255         code to handle REL as well as RELA sections and 64-bit as well as
256         32-bit GOT entries.  Complain if we find a static-only reloc
257         against an externally-defined symbol and if we cannot create
258         dynamic relocations for it.  Allocate copy relocs using
259         mips_elf_allocate_dynamic_relocations on non-VxWorks targets.
260         Set possibly_dynamic_relocs to 0 when using PLTs or copy relocs.
261         Skip reserved .got.plt entries.
262         (_bfd_mips_elf_always_size_sections): Use mips_elf_check_symbols
263         instead of mips_elf_check_mips16_stubs to process each symbol.
264         Do the traversal for relocatable objects too.
265         (mips_elf_lay_out_got): Use htab->reserved_gotno instead of
266         MIPS_RESERVED_GOTNO.
267         (_bfd_mips_elf_size_dynamic_sections): Exclude sdynbss if it
268         is empty.  Extend the DT_PLTREL, DT_JMPREL and DT_PLTRELSZ handling
269         to non-VxWorks targets.  Only add DT_REL{,A}, DT_REL{,A}SZ and
270         DT_REL{,A}ENT if .rel.dyn is nonempty.  Create a symbol for the
271         PLT.  Allocate a nop at the end of the PLT.  Allocate DT_MIPS_PLTGOT.
272         (mips_elf_create_la25_stub_info): New function.
273         (_bfd_mips_elf_finish_dynamic_symbol): Write out PLT entries
274         and copy relocs where necessary.  Check pointer_equality_needed.
275         (mips_finish_exec_plt): New function.
276         (_bfd_mips_elf_finish_dynamic_sections): Always set DT_PLTGOT
277         to the beginning of htab->sgot.  Use htab->reserved_gotno instead
278         of MIPS_RESERVED_GOTNO.  Assert htab->use_plts_and_copy_relocs
279         instead of htab->is_vxworks for DT_PLTREL, DT_PLTRELSZ and DT_JMPREL.
280         Set DT_PLTREL to DT_REL instead of DT_RELA on non-VxWorks targets.
281         Use mips_finish_exec_plt to create non-VxWorks PLT headers.  Set
282         DT_MIPS_PLTGOT.
283         (_bfd_mips_elf_copy_indirect_symbol): Copy has_static_relocs
284         from the indirect symbol to the direct symbol.  Also copy
285         has_nonpic_branches for indirect symbols.
286         (_bfd_mips_elf_get_target_dtag): Handle DT_MIPS_PLTGOT and
287         DT_MIPS_RWPLT.
288         (_bfd_mips_elf_link_hash_table_create): Initialize the new
289         mips_elf_link_hash_table fields.
290         (_bfd_mips_vxworks_link_hash_table_create): Set
291         use_plts_and_copy_relocs to TRUE.  Use TRUE rather than 1
292         when setting is_vxworks.
293         (_bfd_mips_elf_use_plts_and_copy_relocs): New function.
294         (_bfd_mips_elf_final_link): Call mips_elf_create_la25_stub for
295         each la25_stub.
296         (_bfd_mips_elf_merge_private_bfd_data): Treat dynamic objects
297         as PIC.  Generalize message about linking PIC and non-PIC.
298         (_bfd_mips_elf_plt_sym_val, _bfd_mips_post_process_headers): New
299         functions.
300         * reloc.c: Update comment near BFD_RELOC_MIPS_JUMP_SLOT.
301         * bfd-in2.h: Regenerated.
302
303 2008-08-08  Alan Modra  <amodra@bigpond.net.au>
304
305         * elf.c (bfd_elf_get_elf_syms): Don't leak memory on error.
306         * elflink.c (_bfd_elf_link_read_relocs): bfd_release on error.
307         (elf_link_add_object_symbols): Don't leak memory on error.
308         (bfd_elf_size_dynsym_hash_dynstr): Likewise.
309         (elf_fixup_link_order): Free sections.
310
311 2008-08-07  Richard Sandiford  <rdsandiford@googlemail.com>
312
313         * elf-bfd.h (elf_backend_data): Add a "rela_plts_and_copies_p" field.
314         * elfxx-target.h (elf_backend_rela_plts_and_copies_p): New macro.
315         (elfNN_bed): Use it.
316         * elf.c (_bfd_elf_get_synthetic_symtab): Use rela_plts_and_copies_p
317         instead of default_use_rela_p to choose between ".rel.plt" and
318         ".rela.plt".
319         * elflink.c (_bfd_elf_create_dynamic_sections): Use
320         rela_plts_and_copies_p instead of default_use_rela_p to choose
321         between ".rel.plt" and ".rela.plt", and between ".rel.bss" and
322         ".rela.bss".
323
324 2008-08-07  Richard Sandiford  <rdsandiford@googlemail.com>
325
326         * elf-bfd.h (MIPS_ELF_TDATA): New elf_object_id.
327         * elf32-mips.c (bfd_elf32_mkobject): Define.
328         * elf64-mips.c (bfd_elf64_mkobject): Likewise.
329         * elfn32-mips.c (bfd_elf32_mkobject): Likewise.
330         * elfxx-mips.h (_bfd_mips_elf_mkobject): Declare.
331         * elfxx-mips.c (is_mips_elf): New macro.
332         (_bfd_mips_elf_mkobject): New function.
333         (_bfd_mips_elf_final_link): Use is_mips_elf.
334         (_bfd_mips_elf_merge_private_bfd_data): Likewise.
335
336 2008-08-07  Richard Sandiford  <rdsandiford@googlemail.com>
337
338         * elfxx-mips.c (mips_elf_record_relocs): Defer allocation of a
339         global GOT entry when deferring allocation of dynamic relocations.
340         (allocate_dynrelocs): When allocating deferred dynamic relocations,
341         also do the deferred allocation of a GOT entry.
342
343 2008-08-07  Richard Sandiford  <rdsandiford@googlemail.com>
344
345         * elfxx-mips.c (mips_got_info): Add a "reloc_only_gotno" field.
346         (mips_elf_got_section): Delete.
347         (mips_elf_sort_hash_table): Use g->reloc_only_gotno to decide
348         how many reloc-only entries there are.
349         (mips_elf_count_got_symbols): Adjust g->reloc_only_gotno as
350         well as g->global_gotno.
351         (mips_elf_make_got_per_bfd): Initialize reloc_only_gotno.
352         (mips_elf_multi_got): Likewise.  Use gg->reloc_only_gotno
353         rather than gg->assigned_gotno to store the number of
354         reloc-only GOT entries.
355         (mips_elf_create_got_section): Remove the MAYBE_EXCLUDE parameter.
356         Initialize reloc_only_gotno.
357         (mips_elf_calculate_relocation): Check htab->got_info instead of
358         dynobj when deciding whether to call mips_elf_adjust_gp,
359         (_bfd_mips_elf_create_dynamic_sections): Adjust the call
360         to mips_elf_create_got_section.
361         (mips_elf_record_relocs): Likewise.  Remove redundant
362         "dynobj == NULL" code.  Do not use mips_elf_create_got_section
363         or mips_elf_record_global_got_symbol for R_MIPS_32, R_MIPS_REL32
364         and R_MIPS_64; limit global_got_area to GGA_RELOC_ONLY instead.
365         (_bfd_mips_elf_finish_dynamic_symbol): Use htab->sgot instead
366         of mips_elf_got_section.
367         (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise.
368         (_bfd_mips_elf_finish_dynamic_sections): Likewise.
369         Move the initial assignment of G to the block that uses it;
370         it is used for an unrelated purpose later.
371
372 2008-08-07  Richard Sandiford  <rdsandiford@googlemail.com>
373
374         * elfxx-mips.c (count_section_dynsyms): Move before the new first use.
375         (mips_elf_sort_hash_table): Take the output bfd as a parameter.
376         Remove the MAX_LOCAL parameter.  Exit early if there are no
377         dynamic symbols, if there is no dynobj, or if there is no
378         GOT section.  Use count_section_dynsyms instead of MAX_LOCAL.
379         Assert == rather than <= when checking hsd.max_unref_got_dynindx.
380         Also assert that g->global_gotno is right.
381         (mips_elf_count_forced_local_got_symbols): Rename to...
382         (mips_elf_count_got_symbols): ...and count global GOT entries too.
383         Set the global_got_area of a forced-local GGA_RELOC_ONLY symbol
384         to GGA_NONE.
385         (mips_elf_multi_got): Don't sort the symbol table.
386         (mips_elf_lay_out_got): Likewise.  Use mips_elf_count_got_symbols
387         to count the number of global GOT entries.
388         (_bfd_mips_elf_final_link): Unconditionally call
389         mips_elf_sort_hash_table.
390
391 2008-08-07  Richard Sandiford  <rdsandiford@googlemail.com>
392
393         * elfxx-mips.c (GGA_NORMAL, GGA_RELOC_ONLY, GGA_NONE): New macros.
394         (mips_elf_link_hash_entry): Add a "global_got_area" field.
395         (mips_elf_link_hash_newfunc): Initialize it.
396         (mips_elf_sort_hash_table_f): Use h->global_got_area instead of
397         h->root.got.offset.  Do not handle forced_local symbols specially.
398         (mips_elf_record_global_got_symbol): Set h->global_got_area
399         instead of h->root.got.offset.
400         (mips_elf_recreate_got): Assert that h->global_got_area == GGA_NONE
401         for indirect and warning symbols.
402         (mips_elf_count_forced_local_got_symbols): Change the argument
403         from a "elf_link_hash_entry" to "mips_elf_link_hash_entry".
404         Use and set h->global_got_area instead of h->root.got.offset.
405         Set it to GGA_NONE for all forced-local symbols.
406         (mips_elf_set_global_got_offset): Set h->global_got_area
407         instead of h->root.got.offset.  Use g->global_got_area instead
408         of a combination of dynindx, forced_local and tls_type.
409         (mips_elf_multi_got): Remove disabled code.  Pass GGA_* values to
410         mips_elf_set_global_got_offset.
411         (mips_elf_lay_out_got): Use mips_elf_link_hash_traverse instead
412         of elf_link_hash_traverse.
413         (_bfd_mips_elf_copy_indirect_symbol): Copy the indirect symbol's
414         global_got_area to the direct symbol if the latter's value is higher.
415         Set the indirect symbol's area to GGA_NONE.
416
417 2008-08-07  Richard Sandiford  <rdsandiford@googlemail.com>
418
419         * elf32-mips.c (elf_backend_hide_symbol): Delete.
420         * elfn32-mips.c (elf_backend_hide_symbol): Likewise.
421         * elf64-mips.c (elf_backend_hide_symbol): Likewise.
422         * elfxx-mips.h (elf_backend_hide_symbol): Likewise.
423         * elfxx-mips.c (mips_elf_link_hash_entry): Remove "forced_local"
424         and add "needs_lazy_stub".
425         (mips_elf_link_hash_newfunc): Update accordingly.
426         (mips_elf_link_hash_table): Remove "computed_got_sizes" and
427         add "lazy_stub_count".
428         (_bfd_mips_elf_link_hash_table_create): Update accordingly.
429         (mips_elf_output_extsym): Use hd->needs_lazy_stub to detect
430         cases where a lazy stub is being used.
431         (mips_elf_sort_hash_table_f): Use h->root.forced_local instead
432         of h->forced_local.
433         (mips_elf_record_global_got_symbol): Use _bfd_elf_link_hash_hide_symbol
434         instead of _bfd_mips_elf_hide_symbol.  Do not increment local_gotno
435         here.
436         (mips_elf_allocate_dynamic_relocations): Move before new first use.
437         (mips_elf_check_recreate_got, mips_elf_recreate_got): New functions.
438         (mips_elf_resolve_final_got_entries): Move earlier in file.  Make at
439         most two passes over the hash table.  Use mips_elf_check_recreate_got
440         to see if there are any indirect or warning entries and
441         mips_elf_recreate_got to create a new GOT without them.
442         Return a boolean success value.
443         (mips_elf_count_forced_local_got_entries): New function.
444         (mips_elf_make_got_per_bfd): Check h->root.forced_local instead of
445         h->forced_local.
446         (mips_elf_set_global_got_offset): Likewise.
447         (mips_elf_set_no_stub): Replace with...
448         (mips_elf_forbid_lazy_stubs): ...this new function.
449         (mips_elf_resolve_final_got_entry): Delete.
450         (mips_elf_multi_got): Fix formatting.  Use mips_elf_forbid_lazy_stubs
451         instead of mips_elf_set_no_stub.  Move the code that sets
452         global offsets and allocates dynamic relocations from the main
453         _bfd_mips_elf_size_dynamic_sections loop to here.
454         (_bfd_mips_elf_adjust_dynamic_symbol): Do not allocate room in
455         .MIPS.stubs here; just set hmips->needs_lazy_stub and increment
456         htab->lazy_stub_count.
457         (_bfd_mips_elf_always_size_sections): Move the stub-estimation
458         code to mips_elf_estimate_stub_size and the GOT-sizing code to
459         mips_elf_lay_out_got.  Do not call these functions here.
460         (mips_elf_estimate_stub_size): New function, split
461         out from _bfd_mips_elf_always_size_sections.  Call
462         mips_elf_resolve_final_got_entries earlier.  Count the number
463         of forced-local entries.  Do not add stub sizes to loadable_size;
464         after this patch, the stub sizes are already included in the main
465         estimate.  Allocate dynamic relocations here rather than in the
466         main _bfd_mips_elf_size_dynamic_sections loop.
467         (mips_elf_estimate_stub_size): New function, split out from
468         _bfd_mips_elf_always_size_sections.
469         (mips_elf_allocate_lazy_stub): New function.
470         (mips_elf_lay_out_lazy_stubs): Likewise.
471         (_bfd_mips_elf_size_dynamic_sections): Call mips_elf_estimate_stub_size,
472         mips_elf_lay_out_got and mips_elf_lay_out_lazy_stubs.  Do not handle
473         the allocation of sreldyn specially.
474         (_bfd_mips_elf_hide_symbol): Delete.
475
476 2008-08-07  Richard Sandiford  <rdsandiford@googlemail.com>
477
478         * elfxx-mips.c (allocate_dynrelocs): Ignore indirect and warning
479         symbols.
480
481 2008-08-06  Richard Sandiford  <rdsandiford@googlemail.com>
482
483         * elfxx-mips.c (mips_elf_link_hash_entry): Move bfd_boolean
484         fields to the end of the structure and make them single-bit
485         bitfields.
486         (mips_elf_link_hash_newfunc): Make the initialization statements
487         follow the new field order.
488
489 2008-08-06  Richard Sandiford  <rdsandiford@googlemail.com>
490
491         * elfxx-mips.c (_mips_elf_section_data): Remove the "u.got_info" field.
492         (mips_elf_link_hash_table): Add "sgot" and "got_info" fields.
493         (_bfd_mips_elf_link_hash_table_create): Initialize them.
494         (mips_elf_got_section): Always apply the !maybe_excluded behavior.
495         (mips_elf_got_info): Delete.
496         (mips_elf_initialize_tls_slots): Remove the DYNOBJ local variable.
497         Adjust the call to mips_elf_got_section.
498         (mips_elf_local_got_index): Don't call mips_elf_got_info.
499         Update the call to mips_elf_create_local_got_entry.
500         Use htab->got_info.
501         (mips_elf_global_got_index): Don't call mips_elf_got_info;
502         use htab->got_info and htab->sgot instead.
503         (mips_elf_got_page): Don't call mips_elf_got_info.  Update the
504         call to mips_elf_create_local_got_entry.
505         (mips_elf_got16_entry): Likewise.
506         (mips_elf_got_offset_from_index): Replace with DYNOBJ parameter
507         with an INFO parameter.  Don't call mips_elf_got_info; use htab->sgot
508         and htab->got_info instead.
509         (mips_elf_create_local_got_entry): Remove the GG and SGOT parameters.
510         Use htab->sgot and htab->got_info.
511         (mips_elf_sort_hash_table): Remove the DYNOBJ local variable.
512         Don't call mips_elf_got_info; use htab->got_info instead.
513         (mips_elf_record_global_got_symbol): Turn G from a paramter to
514         a local variable and read it from htab->got_info.
515         (mips_elf_record_local_got_symbol): Replace the G parameter with
516         an INFO parameter.  Make G a local variable and read it from
517         htab->got_info instead.
518         (mips_elf_record_got_page_entry): Likewise.
519         (mips_elf_multi_got): Remove the G parameter and make it a local
520         variable instead.  Read it from htab->got_info.
521         (mips_elf_create_got_section): Cache the GOT section in htab->sgot.
522         Store the GOT information in htab->got_info.
523         (mips_elf_calculate_relocation): Don't call mips_elf_got_section
524         and mips_elf_got_info; use htab->sgot and htab->got_info instead.
525         Adjust the calls to mips_elf_got_offset_from_index and
526         mips_elf_adjust_gp.
527         (_bfd_mips_elf_check_relocs): Remove the G and SGOT local variables.
528         Adjust the calls to mips_elf_record_local_got_symbol,
529         mips_elf_record_global_got_symbol and mips_elf_record_got_page_entry.
530         Use htab->sgot.
531         (_bfd_mips_elf_always_size_sections): Remove the DYNOBJ local variable.
532         Don't call mips_elf_got_info; use htab->sgot and htab->got_info instead.
533         Update the call to mips_elf_multi_got.
534         (_bfd_mips_elf_size_dynamic_sections): Don't call mips_elf_got_info;
535         use htab->got_info instead.
536         (_bfd_mips_elf_finish_dynamic_symbol): Update the call to
537         mips_elf_got_section.  Get the got_info from the hash table
538         rather than the GOT section.
539         (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise.
540         (_bfd_mips_elf_finish_dynamic_sections): Likewise.
541         (_bfd_mips_elf_hide_symbol): Don't call mips_elf_got_section;
542         get the got_info from the hash table instead.  Remove the GOT
543         local variable.
544         (_bfd_mips_elf_final_link): Likewise.  Also remove the DYNOBJ
545         local variable.
546
547 2008-08-06  Richard Sandiford  <rdsandiford@googlemail.com>
548
549         * elfxx-mips.c (mips_elf_link_hash_table): Add an "sstubs" field.
550         (_bfd_mips_elf_create_dynamic_sections): Use it to cache the stubs
551         section.  Don't check whether the section already exists.
552         (_bfd_mips_elf_adjust_dynamic_symbol): Use htab->sstubs.
553         (_bfd_mips_elf_finish_dynamic_symbol): Likewise.
554         (_bfd_mips_elf_finish_dynamic_sections): Likewise.
555         (_bfd_mips_elf_size_dynamic_sections): Likewise.  Don't add the
556         dummy stub to an empty section.
557         (_bfd_mips_elf_link_hash_table_create): Initialize the "sstubs" field.
558
559 2008-08-06  Richard Sandiford  <rdsandiford@googlemail.com>
560
561         * reloc.c (BFD_RELOC_MIPS16_GOT16, BFD_RELOC_MIPS16_CALL16): Declare.
562         * libbfd.h, bfd-in2.h: Regenerate.
563         * elf32-mips.c (elf_mips16_howto_table_rel): Fill in reserved
564         R_MIPS16_GOT16 and R_MIPS16_CALL16 entries.
565         (mips16_reloc_map): Add mappings.
566         * elf64-mips.c (mips16_elf64_howto_table_rel): Fill in reserved
567         R_MIPS16_GOT16 and R_MIPS16_CALL16 entries.
568         (mips16_elf64_howto_table_rela): Likewise.
569         (mips16_reloc_map): Add mappings.
570         * elfn32-mips.c (elf_mips16_howto_table_rel): Fill in reserved
571         R_MIPS16_GOT16 and R_MIPS16_CALL16 entries.
572         (elf_mips16_howto_table_rela): Likewise.
573         (mips16_reloc_map): Add mappings.
574         * elfxx-mips.c (mips_elf_create_shadow_symbol): New function.
575         (section_allows_mips16_refs_p): Likewise.
576         (mips16_stub_symndx): Likewise.
577         (mips_elf_check_mips16_stubs): Treat the data argument as a
578         bfd_link_info.  Mark every dynamic symbol as needing MIPS16 stubs
579         and create a "shadow" symbol for the original MIPS16 definition.
580         (mips16_reloc_p, got16_reloc_p, call16_reloc_p, hi16_reloc_p)
581         (lo16_reloc_p, mips16_call_reloc_p): New functions.
582         (_bfd_mips16_elf_reloc_unshuffle): Use mips16_reloc_p to generalize
583         relocation checks.
584         (_bfd_mips16_elf_reloc_shuffle): Likewise.
585         (_bfd_mips_elf_lo16_reloc): Handle R_MIPS16_GOT16.
586         (mips_elf_got16_entry): Add comment.
587         (mips_elf_calculate_relocation): Use hi16_reloc_p,
588         lo16_reloc_p, mips16_call_reloc_p, call16_reloc_p and got16_reloc_p
589         to generalize relocation checks.  Use section_allows_mips16_refs_p
590         instead of mips16_stub_section_p.   Handle R_MIPS16_CALL16 and
591         R_MIPS16_GOT16, allowing the former to refer directly to a
592         MIPS16 function if its stub is not needed.
593         (mips16_stub_section_p): Delete.
594         (_bfd_mips_elf_symbol_processing): Convert odd-valued function
595         symbols into even MIPS16 symbols.
596         (mips_elf_add_lo16_rel_addend): Use mips16_reloc_p to generalize
597         a relocation check.
598         (_bfd_mips_elf_check_relocs): Calculate "bed" and "rel_end"
599         earlier in the function.  Use mips16_stub_symndx to identify
600         the target function.  Avoid out-of-bounds accesses when the
601         stub has no relocations; report an error instead.  Use
602         section_allows_mips16_refs_p instead of mips16_stub_section_p.
603         Use mips16_call_reloc_p and got16_reloc_p to generalize relocation
604         checks.  Handle R_MIPS16_CALL16 and R_MIPS16_GOT16.  Don't create
605         dynamic relocations for absolute references to __gnu_local_gp.
606         (_bfd_mips_elf_always_size_sections): Pass a bfd_link_info as
607         the argument to mips_elf_check_mips16_stubs.  Generalize comment.
608         (_bfd_mips_elf_relocate_section): Use hi16_reloc_p and got16_reloc_p
609         to generalize relocation checks.
610         (_bfd_mips_elf_finish_dynamic_symbol): If a dynamic MIPS16 function
611         symbol has a non-MIPS16 stub, redirect the symbol to the stub.
612         Fix an overly long line.  Don't give dynamic symbols type STO_MIPS16.
613         (_bfd_mips_elf_gc_sweep_hook): Handle R_MIPS16_CALL16 and
614         R_MIPS16_GOT16.
615
616 2008-08-06  Alan Modra  <amodra@bigpond.net.au>
617
618         * elf32-ppc.c (ppc_elf_relax_section): Clear R_PPC_PLTREL24 addend.
619         (ppc_elf_relocate_section <R_PPC_RELAX32_PLT>): Don't bother here.
620
621 2008-08-05  Alan Modra  <amodra@bigpond.net.au>
622             Jaka Močnik <jaka@xlab.si>
623
624         * coffcode.h (coff_slurp_line_table): bfd_alloc lineno_cache first
625         so that we don't inadvertently free it.  Use bfd_alloc for sort
626         arrays, and memcpy sorted line table.
627
628 2008-08-04  Alan Modra  <amodra@bigpond.net.au>
629
630         * elf32-spu.c (spu_elf_auto_overlay): Use the maximum possible
631         if --fixed-space request is too large.
632
633 2008-08-04  Alan Modra  <amodra@bigpond.net.au>
634
635         * Makefile.am (SRC-POTFILES.in, BLD-POTFILES.in): Set LC_ALL=C.
636         * Makefile.in: Regenerate.
637         * po/SRC-POTFILES.in: Regenerate.
638
639 2008-08-02  Alan Modra  <amodra@bigpond.net.au>
640
641         * elf32-spu.c (mark_overlay_section): Move code calculating
642         max_overlay_size to correct block.
643         (spu_elf_auto_overlay): Don't use %x in einfo error message.
644
645 2008-08-01  Alan Modra  <amodra@bigpond.net.au>
646             Jan Kratochvil  <jan.kratochvil@redhat.com>
647
648         * elfcore.h (elf_core_file_p): Ensure we have a backend match
649         with the correct arch size before rejecting the generic fallback.
650         * elfcode.h (elf_object_p): Likewise.  Ensure arch size matches
651         before accepting a target.
652
653 2008-08-01  Alan Modra  <amodra@bigpond.net.au>
654
655         PR 6774
656         * elf.c (rewrite_elf_program_header): Don't wrap p_paddr to
657         include file or program headers.
658
659 2008-07-30  Alan Modra  <amodra@bigpond.net.au>
660
661         * coff-ppc.c, coffgen.c, ecoff.c, ecofflink.c, elf.c, elf32-frv.c,
662         elf32-iq2000.c, elf32-m32c.c, elf32-mep.c, elf32-mt.c,
663         elf32-sh-symbian.c, elf64-hppa.c, mach-o.c, peXXigen.c, pef.c,
664         ppcboot.c, vms-misc.c, xsym.c: Silence gcc warnings.
665
666 2008-07-28  Daniel Jacobowitz  <dan@codesourcery.com>
667
668         * elfxx-mips.c (mips_elf_calculate_relocation): Avoid generating
669         relocations for undefined weak symbols with non-default visibility.
670         (_bfd_mips_elf_check_relocs): Use possibly_dynamic_relocs for
671         global symbols in shared libraries.
672         (allocate_dynrelocs): New function.
673         (_bfd_mips_elf_adjust_dynamic_symbol): Do not handle
674         possibly_dynamic_relocs here.
675         (_bfd_mips_elf_size_dynamic_sections): Call allocate_dynrelocs.
676
677 2008-07-28  Alexandre Oliva  <aoliva@redhat.com>
678
679         * elf32-i386.c (struct elf_i386_link_hash_table): Added field
680         tls_module_base.
681         (elf_i386_link_hash_table_create): Initialize it.
682         (elf_i386_always_size_sections): Set it.
683         (set_tls_module_base): New.
684         (elf_i386_relocate_sections): Call it.
685         * elf64-x86-64.c (struct elf64_x86_64_link_hash_table): Added
686         field tls_module_base.
687         (elf64_x86_64_link_hash_table_create): Initialize it.
688         (elf64_x86_64_always_size_sections): Set it.
689         (set_tls_module_base): New.
690         (elf64_x86_64_relocate_sections): Call it.
691         Reported by Cary Coutant <ccoutant@google.com>
692
693 2008-07-28  Ineiev  <ineiev@yahoo.co.uk>
694
695         * elf32-arm.c (arm_map_one_stub): Declare variables at beginning
696         of block.
697         * elf32-avr.c (get_local_syms): Likewise.
698
699 2008-07-28  Alan Modra  <amodra@bigpond.net.au>
700
701         PR 6769
702         * bfd-in.h (BFD_VMA_FMT): Define.
703         (printf_vma, sprintf_vma): Use the above.
704         (_bfd_int64_low, _bfd_int64_high): Delete.
705         * bfd-in2.h: Regenerate.
706
707 2008-07-27  Alan Modra  <amodra@bigpond.net.au>
708
709         * elf.c (_bfd_elf_make_section_from_shdr): Ignore return from
710         elf_parse_notes.  Use bfd_malloc_and_get_section.
711         (elf_parse_notes): Validate note namesz and descsz.
712
713 2008-07-26  Michael Eager <eager@eagercon.com>
714
715         * elf32-ppc.c (ppc_elf_merge_obj_attributes): Check compatibility
716         between single-float, double-float, and soft-float.
717
718 2008-07-24  Daniel Jacobowitz  <dan@codesourcery.com>
719
720         * elf32-mips.c (elf_backend_write_section): Define.
721
722 2008-07-24  Nick Clifton  <nickc@redhat.com>
723
724         * elf.c (_bfd_elf_map_sections_to_segments): Catch off by one
725         error assigning sections to segments.
726
727 2008-07-22  Nick Clifton  <nickc@redhat.com>
728
729         * elf.c (_bfd_elf_map_sections_to_segments): Allow sections in
730         adjoining pages to be included in the same segment.
731
732 2008-07-22  Simon Baldwin  <simonb@google.com>
733
734         * elflink.c (elf_link_output_extsym): Set st_size to zero for
735         symbols from dynamic libraries.
736
737 2008-07-21  H.J. Lu  <hongjiu.lu@intel.com>
738
739         PR ld/4424
740         * elflink.c (_bfd_elf_merge_symbol): Call bed->relocs_compatible
741         to check if 2 inputs are compatible.
742
743 2008-07-21  Sterling Augustine  <sterling@tensilica.com>
744
745         * elf.c (assign_file_positions_for_load_sections): Print vma in
746         error message about overlapping section vmas.
747
748 2008-07-21  H.J. Lu  <hongjiu.lu@intel.com>
749
750         PR ld/6747
751         * elf32-frv.c (elf32_frv_relocate_section): Revert the change
752         for PR ld/6446 checked in by accident on May 21, 2008.
753
754 2008-07-21  Nick Clifton  <nickc@redhat.com>
755
756         * coff-sh.c (bfd_pe_print_pdata): Define to NULL for non
757         COFF_WITH_PE based SH ports.
758         * libpei.h (_bfd_XX_print_ce_compressed_pdata): Prototype.
759         * arm-wince-pe.c (bfd_pe_print_pdata): Use
760         _bfd_pe_print_ce_compressed_pdata.
761         (slurp_symcache, cleanup_syms, pe_print_ce_compressed_pdata): Move
762         to...
763         * peXXigen.c: ... here and rename pe_print_ce_compressed_pdata to
764         _bfd_XX_print_ce_compressed_pdata.
765
766 2008-07-21  Alan Modra  <amodra@bigpond.net.au>
767
768         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Drop
769         unwanted zero terminators.
770
771 2008-07-21  Alan Modra  <amodra@bigpond.net.au>
772
773         * elf32-spu.c (spu_elf_relocate_section): Expand
774         RELOC_FOR_GLOBAL_SYMBOL.  Don't warn about undefined symbols for
775         R_SPU_PPU32 and R_SPU_PPU64 relocations.
776
777 2008-07-21  Luis Machado  <luisgpm@br.ibm.com>
778
779         * elf-bfd.h: Declare elfcore_write_ppc_vsx.
780         * elf.c (elfcore_grok_ppc_vsx): New function.
781         (elfcore_write_ppc_vsx): New function
782         (elfcore_grok_note): Handle VSX notes.
783         (elfcore_write_register_note): Handle VSX notes.
784
785 2008-07-18  Joseph Myers  <joseph@codesourcery.com>
786
787         * bfd-in.h (bfd_elf32_arm_set_target_relocs): Add new parameter.
788         * bfd-in2.h: Regenerate.
789         * elf32-arm.c (struct elf_arm_obj_tdata): Add field
790         no_wchar_size_warning.
791         (bfd_elf32_arm_set_target_relocs): Add new parameter
792         no_wchar_warn.
793         (elf32_arm_merge_eabi_attributes): Give a warning, not an error,
794         for conflicting wchar_t attributes.  Do not warn if
795         --no-wchar-size-warning.  Make diagnostic text more specific.
796
797 2008-07-18  H.J. Lu  <hongjiu.lu@intel.com>
798
799         PR ld/6748
800         * elf32-arm.c (elf32_arm_link_hash_table_create): Initialize
801         new fields added for ARM long call support.
802
803 2008-07-18  Danny Backx  <dannybackx@users.sourceforge.net>
804
805         * pe-arm-wince.c (pe_print_compressed_pdata): Define new function to
806         print compressed pdata structure as described on MSDN. This only
807         applies to a limited set of architectures (ARM, SH4).
808         (slurp_symtab, my_symbol_for_address): Define static helper
809         functions for pe_print_compressed_pdata.
810         * coffcode.h (bfd_coff_backend_data): Add _bfd_coff_print_pdata field.
811         (bfd_coff_have_print_pdata, bfd_coff_print_pdata): Define.
812         * bfd/peXXigen.c (_bfd_XX_print_private_bfd_data_common): Add check on
813         bfd_coff_backend_data, call the function if non-null.
814         * pei-mcore.c: Add target dependent initialisation for
815         bfd_coff_backend_data.
816         * coff-sh.c: Likewise.
817         * coff64-rs6000.c: Likewise.
818         * coff-rs6000.c: Likewise.
819         * libcoff-in.h: Likewise.
820         * cf-i386lynx.c: Likewise.
821         * coff-alpha.c: Likewise.
822         * coff-apollo.c: Likewise.
823         * coff-arm.c: Likewise.
824         * coff-aux.c: Likewise.
825         * coff-h8300.c: Likewise.
826         * coff-h8500.c: Likewise.
827         * coff-i386.c: Likewise.
828         * coff-i860.c: Likewise.
829         * coff-i960.c: Likewise.
830         * coff-ia64.c: Likewise.
831         * coff-m68k.c: Likewise.
832         * coff-m88k.c: Likewise.
833         * coff-maxq.c: Likewise.
834         * coff-mips.c: Likewise.
835         * coff-or32.c: Likewise.
836         * coff-sparc.c: Likewise.
837         * coff-tic30.c: Likewise.
838         * coff-tic4x.c: Likewise.
839         * coff-tic54x.c: Likewise.
840         * coff-tic80.c: Likewise.
841         * coff-w65.c: Likewise.
842         * coff-we32k.c: Likewise.
843         * coff-x86_64.c: Likewise.
844         * coff-z80.c: Likewise.
845         * coff-z8k.c: Likewise.
846         * pe-mcore.c: Likewise.
847         * pe-mips.c: Likewise.
848         * pe-ppc.c: Likewise.
849         * peXXigen.c: Likewise.
850         * pei-ppc.c: Likewise.
851         * libcoff.h: Regenerate.
852
853 2008-07-16  Bernd Schmidt  <bernd.schmidt@analog.com>
854
855         * elf32-bfin.c (bfin_check_relocs, bfin_relocate_section,
856         bfin_final_link_relocate, bfin_gc_mark_hook, bfin_gc_sweep_hook,
857         ELF_DYNAMIC_INTERPRETER, DEFAULT_STACK_SIZE,
858         struct _bfinfdpic_dynamic_got_info): Moved around to keep FD-PIC code
859         separate from non-FD-PIC.
860
861 2008-07-14  DJ Delorie  <dj@redhat.com>
862
863         * elf-m10300.c (mn10300_elf_final_link_relocate): Correct overflow
864         checks for PCREL8, PCREL16, GOTPC16, GOTOFF16, PLT16, and GOT16
865         relocs.
866         (mn10300_elf_relax_section): Correct jump offset check when target
867         is in a different section.
868
869 2008-07-15  Jie Zhang  <jie.zhang@analog.com>
870
871         * elf32-bfin.c (elf32_bfin_special_sections[]): New.
872         (elf_backend_special_sections): Define.
873
874 2008-07-13  Craig Silverstein  <csilvers@google.com>
875
876         PR binutils/6743
877         * dwarf2.c (struct dwarf2_debug): New variable info_ptr_memory.
878         (find_line): Use info_ptr_memory instead of sec_info_ptr.
879         (_bfd_dwarf2_cleanup_debug_info): Likewise.
880
881 2008-07-12  Jie Zhang  <jie.zhang@analog.com>
882
883         Revert
884         2008-07-12  Jie Zhang  <jie.zhang@analog.com>
885         * elf.c (_bfd_elf_map_sections_to_segments): Don't put
886         executable sections into the same segment with other
887         read only sections if --sep-code.
888         * elf32-bfin.c (elf32_bfin_code_in_l1): New variable.
889         (elf32_bfin_data_in_l1): New variable.
890         (elf32_bfin_final_write_processing): New.
891         (elf32_bfin_special_sections[]): New.
892         (elf_backend_final_write_processing): Define.
893         (elf_backend_special_sections): Define.
894
895 2008-07-12  Jie Zhang  <jie.zhang@analog.com>
896
897         * elf.c (_bfd_elf_map_sections_to_segments): Don't put
898         executable sections into the same segment with other
899         read only sections if --sep-code.
900         * elf32-bfin.c (elf32_bfin_code_in_l1): New variable.
901         (elf32_bfin_data_in_l1): New variable.
902         (elf32_bfin_final_write_processing): New.
903         (elf32_bfin_special_sections[]): New.
904         (elf_backend_final_write_processing): Define.
905         (elf_backend_special_sections): Define.
906
907 2008-07-11  Andreas Schwab  <schwab@suse.de>
908
909         * dwarf2.c (read_section): Take pointer to bfd_size_type instead
910         of unsigned long as last parameter.
911         (struct dwarf2_debug): Define dwarf_abbrev_size, dwarf_line_size,
912         dwarf_str_size and dwarf_ranges_size as bfd_size_type instead of
913         unsigned long.
914
915 2008-07-10  Richard Sandiford  <rdsandiford@googlemail.com>
916
917         * elfxx-mips.c (mips_elf_calculate_relocation): Calculate GP and GP0
918         for all relocation types.  Allow any type of relocation to refer to
919         __gnu_local_gp.
920
921 2008-07-10  Richard Sandiford  <rdsandiford@googlemail.com>
922
923         * elfxx-mips.c (mips_elf_check_mips16_stubs): Use ELF_ST_IS_MIPS16.
924         (mips_elf_calculate_relocation): Likewise.
925         (_bfd_mips_elf_add_symbol_hook): Likewise.
926         (_bfd_mips_elf_finish_dynamic_symbol): Likewise.
927         (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise.
928
929 2008-07-10  Andreas Schwab  <schwab@suse.de>
930
931         * elfxx-mips.c (_bfd_mips_elf_section_from_shdr): Add missing
932         paren.
933
934 2008-07-09  Craig Silverstein  <csilvers@google.com>
935
936         * Makefile.am (BFD32_LIBS): Add compress.lo.
937         (BFD32_LIBS_CFILES): Add compress.c.
938         (BFD_H_FILES): Likewise.
939         * Makefile.in: Regenerate.
940         * bfd-in2.h: Regenerate.
941         * config.in: Add HAVE_ZLIB_H
942         * configure.in: Add test for libz and zlib.h
943         * configure: Regenerate.
944         * dwarf2.c (read_section): New function.
945         (read_indirect_string): Call new function read_section.
946         (read_abbrevs): Likewise.
947         (decode_line_info): Likewise.
948         (read_debug_ranges): Likewise.
949         (find_line): Call new function read_section when just one
950         .zdebug_info section is found, otherwise read and compress
951         multiple sections.
952         (_bfd_dwarf2_cleanup_debug_info): Free sec_info_ptr.
953         * elf.c (_bfd_elf_make_section_from_shdr): Add zdebug prefix.
954         (special_sections_z): New struct.
955         (special_sections): Refer to special_sections_z.
956         * elfxx-mips.c (_bfd_mips_elf_section_from_shdr): Recognize
957         sections named .zdebug_*.
958         (_bfd_mips_elf_fake_sections): Likewise.
959         * compress.c: New file.
960         (bfd_uncompress_section_contents): New function.
961
962 2008-07-07  Christophe Lyon  <christophe.lyon@st.com>
963
964         * elf32-arm.c (arm_type_of_stub): Don't crash on local symbols in
965         the presence of a PLT.
966
967 2008-07-07  Alan Modra  <amodra@bigpond.net.au>
968
969         * bfd.c (bfd_demangle): Always trim off bfd_get_symbol_leading_char.
970
971 2008-07-02  Alan Modra  <amodra@bigpond.net.au>
972
973         * elf32-ppc.c (is_pic_glink_stub): New function.
974         (ppc_elf_get_synthetic_symtab): Don't generate symbols when
975         multiple shared/pie stubs per plt entry.
976
977 2008-06-30  Richard Sandiford  <rdsandiford@googlemail.com>
978
979         * elf.c (_bfd_elf_get_synthetic_symtab): Increment p by
980         bed->s->int_rels_per_ext_rel.
981
982 2008-06-30  Richard Sandiford  <rdsandiford@googlemail.com>
983
984         * syms.c (BSF_SYNTHETIC): New flag.
985         * elf.c (_bfd_elf_get_synthetic_symtab): Set it.
986         * elf32-ppc.c (ppc_elf_get_synthetic_symtab): Likewise.
987         * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Likewise.
988         * bfd-in.h (bfd_asymbol_flavour): Return bfd_target_unknown_flavour
989         for synthetic symbols.
990         * bfd-in2.h: Regenerate.
991
992 2008-06-30  Daniel Jacobowitz  <dan@codesourcery.com>
993
994         * elf32-arm.c (record_arm_to_thumb_glue, record_thumb_to_arm_glue):
995         Expand comments.
996         (arm_map_one_stub): Use | 1 when setting the low bit.
997
998 2008-06-29  Andreas Schwab  <schwab@suse.de>
999
1000         * elf32-m68k.c (elf_m68k_relocate_section): Don't ignore existing
1001         addend on _GLOBAL_OFFSET_TABLE_.
1002
1003 2008-06-24  Daniel Jacobowitz  <dan@codesourcery.com>
1004
1005         * elf32-arm.c (STUB_ENTRY_NAME): Define.
1006         (arm_thumb_thumb_long_branch_stub): Use bx instead of b.n.
1007         (arm_pic_long_branch_stub): Mention R_ARM_REL32 instead of
1008         R_ARM_ABS32.
1009         (struct elf32_arm_stub_hash_entry): Add output_name.
1010         (arm_build_one_stub): Move offsets into the offset argument
1011         of _bfd_final_link_relocate.  Correct offset for
1012         arm_thumb_arm_v4t_stub_long_branch.
1013         (elf32_arm_size_stubs): Set stub_entry->output_name.
1014         (elf32_arm_ouput_plt_map_sym): Rename to elf32_arm_output_map_sym.
1015         Update all callers.
1016         (elf32_arm_output_stub_sym): New.
1017         (arm_map_one_stub): Correct formatting.  Use elf32_arm_output_stub_sym.
1018
1019 2008-06-20  Alan Modra  <amodra@bigpond.net.au>
1020
1021         * elf32-spu.c (needs_ovl_stub): Correctly return nonovl_stub for
1022         non-branch insns.
1023
1024 2008-06-20  Alan Modra  <amodra@bigpond.net.au>
1025
1026         * elf32-spu.c (build_stub): Allow wraparound on stub branches.
1027         (allocate_spuear_stubs, build_spuear_stubs): Return value from
1028         count_stub/build_stub.
1029         (spu_elf_build_stubs): Correct location of stub reloc error message.
1030
1031 2008-06-18  M R Swami Reddy <MR.Swami.Reddy@nsc.com>
1032
1033         * elf32-cr16.c (ELF_MACHINE_ALT1): Define to EM_CR16_OLD.
1034
1035 2008-06-17  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1036
1037         * configure: Regenerate.
1038
1039 2008-06-17  Alan Modra  <amodra@bigpond.net.au>
1040
1041         * elf32-spu.c (struct spu_link_hash_table): Add extra_stack_space.
1042         (spu_elf_check_vma): Add extra_stack_space param, copy to htab.
1043         (spu_elf_auto_overlay): Use it.
1044         (RECURSE_UNMARK): Define as 0.
1045         (unmark_overlay_section): Heed RECURSE_UNMARK.
1046         * elf32-spu.h (spu_elf_check_vma): Update prototype.
1047
1048 2008-06-12  DJ Delorie  <dj@redhat.com>
1049
1050         * elf32-m32c.c (ELF_MACHINE_ALT1): Define as EM_M32C_OLD.
1051
1052 2008-06-09  Paul Brook  <paul@codesourcery.com>
1053
1054         bfd/
1055         * elf32-arm.c (elf32_arm_merge_private_bfd_data): Allow BE8 shared
1056         libraries.
1057
1058 2008-06-09  Christophe Lyon  <christophe.lyon@st.com>
1059
1060         * elf32-arm.c (arm_stub_is_thumb): Define.
1061         (elf32_arm_final_link_relocate): Handle near mode switching stubs.
1062
1063 2008-06-07  Alan Modra  <amodra@bigpond.net.au>
1064
1065         * elf32-spu.c (spu_elf_auto_overlay): Add valid area below sp
1066         to stack calculation.
1067
1068 2008-06-06  Paul Brook  <paul@codesourcery.com>
1069
1070         bfd/
1071         * elf32-arm.c (elf32_arm_merge_private_bfd_data): Reject BE8 input.
1072
1073 2008-06-06  Alan Modra  <amodra@bigpond.net.au>
1074
1075         * elf32-spu.c (spu_elf_auto_overlay): Relax requirement that
1076         file names be unique.  Specify archive:path in overlay script.
1077
1078 2008-06-05  Alan Modra  <amodra@bigpond.net.au>
1079
1080         PR ld/6590
1081         * elf64-ppc.c (ppc_build_one_stub): Correct reloc offsets.
1082
1083 2008-06-04  Alan Modra  <amodra@bigpond.net.au>
1084
1085         * elf.c (ignore_section_sym): Don't test section sym value here.
1086         (elf_map_symbols): Instead check zero value here as was done prior
1087         to 2006-05-26 change.
1088
1089 2008-06-04  Nick Clifton  <nickc@redhat.com>
1090
1091         PR ld/6019
1092         * elf32-avr.c (elf32_avr_relax_section): Handle the case where
1093         there are no local symbols.
1094
1095 2008-06-04  Alan Modra  <amodra@bigpond.net.au>
1096
1097         * elf32-spu.c (get_sym_h): Don't attempt to read global syms.
1098         (process_stubs): Likewise.
1099         (discover_functions): Don't used cached symbols.
1100         (maybe_insert_function): Correct condition under which function
1101         array is realloc'd.
1102         (mark_functions_via_relocs): Delete unused variable.
1103
1104 2008-05-30  Frediano Ziglio  <frediano.ziglio@vodafone.com>
1105             Nick Clifton  <nickc@redhat.com>
1106
1107         PR ld/6511
1108         * elf64-hppa.c (allocate_global_data_opd): Default to using the
1109         dynamic symbol table for local function names in shared libraries.
1110
1111 2008-05-29  Jan Kratochvil  <jan.kratochvil@redhat.com>
1112
1113         * elf.c (assign_file_positions_for_load_sections): Adjust pre-section
1114         gaps based on VMA and P_VADDR instead of LMA and P_PADDR addresses.
1115
1116 2008-05-28  Alan Modra  <amodra@bigpond.net.au>
1117
1118         * elf32-spu.c (spu_elf_object_p): New function.
1119         (elf_backend_object_p): Define.
1120         (build_stub): Correct second word of 8 byte overlay stubs.
1121         (spu_elf_relocate_section): Formatting.
1122
1123 2008-05-24  Carlos Eduardo Seo  <cseo@linux.vnet.ibm.com>
1124
1125         * elf.c (elfcore_write_register_note): New function.
1126         * elf-bfd.h (elfcore_write_register_note): New prototype.
1127
1128 2008-05-22  Christophe Lyon  <christophe.lyon@st.com>
1129
1130         * elf32-arm.c (arm_type_of_stub): Ignore STT_SECTION symbols.
1131         (elf32_arm_stub_add_mapping_symbol): Remove.
1132         (elf32_arm_add_stub): Don't generate mapping symbols. Change
1133         prototype.
1134         (elf32_arm_size_stubs): Use new elf32_arm_add_stub
1135         prototype. Don't generate thumb to arm glue for calls.
1136         (arm_map_one_stub): Define.
1137         (elf32_arm_output_arch_local_syms): Generate mapping symbols for
1138         long calls stubs.
1139
1140 2008-05-21  Nick Clifton  <nickc@redhat.com>
1141
1142         * elf32-arm.c (group_sections): Reformat comments.
1143
1144         PR ld/6446
1145         * elf32-frv.c (elf32_frv_relocate_section): Set EF_FRV_PIC by
1146         default (for FDPIC). Clear it if any inter-segment relocations
1147         are found.
1148
1149         * elf64-hppa.c (elf64_hppa_finalize_opd): Check NULL return
1150         from elf_link_hash_lookup.
1151
1152 2008-05-21  Maxim Kuvyrkov  <maxim@codesourcery.com>
1153
1154         Add multi-GOT support for m68k.
1155         * elf32-m68k.c (struct elf_m68k_link_hash_entry: got_entry_key,
1156         glist): New fields.
1157         (struct elf_m68k_got_entry_key, struct elf_m68k_got_entry,
1158         struct elf_m68k_got, struct elf_m68k_bfd2got_entry,
1159         struct elf_m68k_multi_got): New data structures.
1160         (struct elf_m68k_link_hash_table: local_gp_p, use_neg_got_offsets_p,
1161         allow_multigot_p, multi_got_): New fields.
1162         (elf_m68k_multi_got): New macro.
1163         (elf_m68k_link_hash_newfunc): Initialize new fields of
1164         struct elf_m68k_link_hash_entry.
1165         (elf_m68k_link_hash_table_create): Initialize new fields of
1166         struct elf_m68k_link_hash_table.
1167         (elf_m68k_link_hash_table_free): New static function implementing hook.
1168         (elf_m68k_init_got, elf_m68k_clear_got, elf_m68k_create_empty_got): New
1169         static functions for struct elf_m68k_got.
1170         (elf_m68k_init_got_entry_key, elf_m68k_got_entry_hash,
1171         elf_m68k_got_entry_eq): New static functions for
1172         struct elf_m68k_got_entry.
1173         (ELF_M68K_REL_8O_MAX_N_ENTRIES_IN_GOT,
1174         ELF_M68K_REL_8O_16O_MAX_N_ENTRIES_IN_GOT): New macros.
1175         (enum elf_m68k_get_entry_howto): New enum.
1176         (elf_m68k_get_got_entry, elf_m68k_update_got_entry_type,
1177         elf_m68k_remove_got_entry_type): New static functions for
1178         struct elf_m68k_got_entry.
1179         (elf_m68k_add_entry_to_got): New static function.
1180         (elf_m68k_bfd2got_entry_hash, elf_m68k_bfd2got_entry_eq,
1181         elf_m68k_bfd2got_entry_del, elf_m68k_get_bfd2got_entry): New static
1182         functions for struct elf_m68k_bfd2got_entry.
1183         (struct elf_m68k_can_merge_gots_arg, elf_m68k_can_merge_gots_1,
1184         elf_m68k_can_merge_gots): New traversal.
1185         (struct elf_m68k_merge_gots_arg, elf_m68k_merge_gots_1,
1186         elf_m68k_merge_gots): Ditto.
1187         (struct elf_m68k_finalize_got_offsets_arg,
1188         elf_m68k_finalize_got_offsets_1, elf_m68k_finalize_got_offsets): Ditto.
1189         (struct elf_m68k_partition_multi_got_arg,
1190         elf_m68k_partition_multi_got_1, elf_m68k_init_symndx2h_1,
1191         elf_m68k_partition_multi_got): Ditto.
1192         (elf_m68k_find_got_entry_ptr, elf_m68k_remove_got_entry): New static
1193         functions.
1194         (elf_m68k_copy_indirect_symbol): New static function implementing
1195         a hook.
1196         (elf_m68k_check_relocs): Update to add entries to multi-GOT.
1197         (elf_m68k_gc_sweep_hook): Update to remove entries from multi-GOT.
1198         (elf_m68k_always_size_sections): Assign BFDs to GOTs.
1199         (elf_m68k_relocate_section): Update to properly handle GOT relocations.
1200         (elf_m68k_finish_dynamic_symbol): Update to traverse all GOT entries
1201         of a global symbol.
1202         (bfd_elf_m68k_set_target_options): New function.
1203         (bfd_elf32_bfd_link_hash_table_free): Define hook.
1204         (bfd_elf32_bfd_final_link): Change expansion to bfd_elf_final_link
1205         to skip generic calculation of GOT offsets.
1206         (elf_backend_copy_indirect_symbol): Define hook.
1207         * bfd-in.h (bfd_elf_m68k_set_target_options): Declare function.
1208         * bfd-in2.h: Regenerate.
1209
1210 2008-05-21  André Johansen  <andrejoh@gmail.com>
1211
1212         PR 868
1213         * dwarf2.c (_bfd_dwarf2_cleanup_debug_info): Free memory allocated
1214         for filenames in function tables and variable tables.
1215
1216 2008-05-19  Alan Modra  <amodra@bigpond.net.au>
1217
1218         PR 2995, PR 6473
1219         * elf.c (_bfd_elf_make_section_from_shdr): Leave lma equal to
1220         vma when all p_paddr fields are zero and there is more than
1221         one PT_LOAD header.
1222
1223 2008-05-15  Christophe Lyon  <christophe.lyon@st.com>
1224
1225         Add long call support for ARM.
1226         * elf32-arm.c (THM2_MAX_FWD_BRANCH_OFFSET): Define.
1227         (THM2_MAX_BWD_BRANCH_OFFSET): Define.
1228         (ARM_MAX_FWD_BRANCH_OFFSET): Define.
1229         (ARM_MAX_BWD_BRANCH_OFFSET): Define.
1230         (THM_MAX_FWD_BRANCH_OFFSET): Define.
1231         (THM_MAX_BWD_BRANCH_OFFSET): Define.
1232         (arm_long_branch_stub): Define.
1233         (arm_pic_long_branch_stub): Define.
1234         (arm_thumb_v4t_long_branch_stub): Define.
1235         (arm_thumb_thumb_long_branch_stub): Define.
1236         (arm_thumb_arm_v4t_long_branch_stub): Define.
1237         (STUB_SUFFIX): Define.
1238         (elf32_arm_stub_type): Define.
1239         (elf32_arm_stub_hash_entry): Define.
1240         (elf32_arm_link_hash_entry): Add stub_cache field.
1241         (arm_stub_hash_lookup): Define.
1242         (elf32_arm_link_hash_table): Add stub_hash_table, stub_bfd,
1243         add_stub_section, layout_sections_again, stub_group, bfd_count,
1244         top_index, input_list fields.
1245         (elf32_arm_link_hash_newfunc): Init new field.
1246         (stub_hash_newfunc): New function.
1247         (elf32_arm_link_hash_table_create): Init stub_hash_table.
1248         (elf32_arm_hash_table_free): New function.
1249         (arm_type_of_stub): New function.
1250         (elf32_arm_stub_name): New function.
1251         (elf32_arm_get_stub_entry): New function.
1252         (elf32_arm_stub_add_mapping_symbol): New function.
1253         (elf32_arm_add_stub): New function.
1254         (arm_build_one_stub): New function.
1255         (arm_size_one_stub): New function.
1256         (elf32_arm_setup_section_lists): New function.
1257         (elf32_arm_next_input_section): New function.
1258         (group_sections): New function.
1259         (elf32_arm_size_stubs): New function.
1260         (elf32_arm_build_stubs): New function.
1261         (bfd_elf32_arm_add_glue_sections_to_bfd): Skip stub sections.
1262         (bfd_elf32_arm_process_before_allocation): No longer handle
1263         R_ARM_CALL and R_ARM_THM_CALL.
1264         (using_thumb_only): New function.
1265         (elf32_arm_final_link_relocate): Redirect calls to stub if range
1266         exceeds encoding capabilities.
1267         (bfd_elf32_bfd_link_hash_table_free): Define.
1268         * bfd-in.h (R_ARM_max): Fix value to 130.
1269         (elf32_arm_setup_section_lists): Protype.
1270         (elf32_arm_next_input_section): Protype.
1271         (elf32_arm_size_stubs): Protype.
1272         (elf32_arm_build_stubs): Protype.
1273         * bfd-in2.h: Regenerate.
1274
1275 2008-05-14  Ulrich Weigand  <uweigand@de.ibm.com>
1276
1277         * elf32-ppc.c (ppc_elf_get_synthetic_symtab): Fix memset calls.
1278         * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Likewise.
1279
1280 2008-05-14  Alan Modra  <amodra@bigpond.net.au>
1281
1282         * Makefile.am: Run "make dep-am".
1283         * Makefile.in: Regenerate.
1284
1285 2008-05-14  Ulrich Weigand  <uweigand@de.ibm.com>
1286             Alan Modra  <amodra@bigpond.net.au>
1287
1288         * elf32-ppc.c (section_covers_vma): New function.
1289         (ppc_elf_get_synthetic_symtab): New function.
1290         (bfd_elf32_get_synthetic_symtab): Define.
1291         * elf64-ppc.c (section_covers_vma): New function.
1292         (ppc64_elf_get_synthetic_symtab): Generate sym@plt on glink branch
1293         table entries, and __glink_PLTresolve on resolver stub.
1294         (ppc64_elf_build_stubs): Rename __glink sym to __glink_PLTresolve.
1295
1296 2008-05-12  Alan Modra  <amodra@bigpond.net.au>
1297
1298         PR 6443
1299         * elf32-ppc.c (MUST_BE_DYN_RELOC): Delete.
1300         (must_be_dyn_reloc): New function.
1301         (ppc_elf_check_relocs): Don't set DF_STATIC_TLS for tprel relocs
1302         in pies.
1303         (ppc_elf_tls_optimize): Optimise pies.
1304         (ppc_elf_relocate_section): Use a section symbol rather than no
1305         symbol if possible for LD->IE TLS sequence, but don't error if
1306         we must use no symbol.
1307         * elf64-ppc.c (MUST_BE_DYN_RELOC): As for elf32-ppc.c.
1308         (must_be_dyn_reloc): Likewise.
1309         (ppc64_elf_check_relocs): Likewise.
1310         (ppc64_elf_tls_optimize): Likewise.
1311         (ppc64_elf_relocate_section): Likewise.
1312
1313 2008-05-12  Alan Modra  <amodra@bigpond.net.au>
1314
1315         * elf32-spu.c (spu_elf_relocate_section): Rename is_ea to is_ea_sym.
1316
1317 2008-05-10  Paul Pluzhnikov  <ppluzhnikov@google.com>
1318
1319         * elfcore.h (elf_core_file_p): Warn about core truncation.
1320
1321 2008-05-07  Bob Wilson  <bob.wilson@acm.org>
1322
1323         * elf32-xtensa.c (xtensa_property_section_name): New.
1324         (xtensa_make_property_section): New.
1325         (xtensa_get_property_section): Make static.  Do not create a new
1326         section if it does not exist.
1327
1328 2008-05-08  Alan Modra  <amodra@bigpond.net.au>
1329
1330         * elf32-spu.c (spu_elf_special_sections): Add "._ea".
1331         (spu_elf_relocate_section): Handle relocations against symbols
1332         defined in ._ea specially.
1333
1334 2008-05-03  Daniel Jacobowitz  <dan@codesourcery.com>
1335
1336         * elf32-arm.c (elf32_arm_symbian_link_hash_table_create): Use
1337         ARRAY_SIZE.
1338         (elf32_arm_symbian_plt_sym_val): New.
1339         (elf_backend_plt_sym_val): Define.
1340
1341 2008-05-03  Alan Modra  <amodra@bigpond.net.au>
1342
1343         PR 2995, PR 6473
1344         * elf.c (rewrite_elf_program_header): Rather than clearing
1345         p_paddr_valid at end, don't set it in the first place.  Delete
1346         comment no longer relevant.  When not p_paddr_valid, don't set
1347         paddr from vaddr, and don't set p_vaddr_offset.
1348
1349 2008-05-01  Cary Coutant  <ccoutant@google.com>
1350
1351         * elf.c (bfd_elf_get_str_section): Fix memory leak caused by
1352         corrupt string table.
1353
1354 2008-05-01  Joel Brobecker  <brobecker@adacore.com>
1355
1356         * cache.c (cache_bread_1): Renames cache_bread.
1357         (cache_bread): New function.
1358
1359 2008-05-01  Alan Modra  <amodra@bigpond.net.au>
1360
1361         PR 2995, PR 6473
1362         * elf.c (_bfd_elf_make_section_from_shdr): Always set lma from p_paddr.
1363         (assign_file_positions_for_load_sections): Combine nested "if".
1364         (copy_elf_program_header): Don't set p_paddr_valid or p_vaddr_offset
1365         when all header p_paddr fields are zero.
1366
1367 2008-04-30  Edmar Wienskoski  <edmar@freescale.com>
1368
1369         * cpu-powerpc.c (bfd_powerpc_archs): Add e500mc entry.
1370
1371 2008-04-29  Daniel Jacobowitz  <dan@codesourcery.com>
1372
1373         * elf.c (_bfd_elf_get_dynamic_reloc_upper_bound)
1374         (_bfd_elf_canonicalize_dynamic_reloc): Find dynamic relocations
1375         even if they are not loaded.
1376         * elflink.c (_bfd_elf_init_2_index_sections): Set data_index_section
1377         first.
1378
1379 2008-04-25  Jay Foad  <jay.foad@gmail.com>
1380
1381         * reloc16.c (bfd_coff_reloc16_get_value): Add support for
1382         undefined weak symbols.
1383
1384 2008-04-25  Nick Clifton  <nickc@redhat.com>
1385
1386         * po/vi.po: Updated Vietnamese translation.
1387
1388 2008-04-23  Paolo Bonzini  <bonzini@gnu.org>
1389
1390         * aclocal.m4: Regenerate.
1391         * configure: Regenerate.
1392
1393 2008-04-21  Cary Coutant  <ccoutant@google.com>
1394
1395         * archive.c (_bfd_write_archive_contents): Fix incorrect use of
1396         ARFMAG.
1397
1398 2008-04-21  Nathan Sidwell  <nathan@codesourcery.com>
1399
1400         * elfxx-mips.c (_bfd_mips_vxworks_adjust_dynamic_symbol): Don't
1401         set the value of undefined symbols in shared objects.
1402         (_bfd_mips_vxworks_finish_dynamic_symbol): Clear value for
1403         undefined symbols unless pointer equality is needed.
1404
1405 2008-04-18  Dennis Roberts  <dennis.roberts@sunquestinfo.com>
1406
1407         * aix5ppc-core.c: Define macros for the default architecture and
1408         machine for matching core files.
1409         (xcoff64_core_p): Set the architecture and machine to the default
1410         values defined in the macros mentioned above.
1411         * rs6000-core.c: Define macros to determine whether or not the
1412         core file header uses the core_dumpxx header format.
1413         (rs6000coff_core_p): Don't match core files that use the
1414         core_dumpxx header format.
1415
1416 2008-04-16  Pedro Alves  <pedro@codesourcery.com>
1417
1418         * config.bfd (i[3-7]86-*-dicos*, x86_64-*-dicos*): Add.
1419
1420 2008-04-16  David S. Miller  <davem@davemloft.net>
1421
1422         * reloc.c (BFD_RELOC_SPARC_GOTDATA_HIX22,
1423         BFD_RELOC_SPARC_GOTDATA_LOX10, BFD_RELOC_SPARC_GOTDATA_OP_HIX22,
1424         BFD_RELOC_SPARC_GOTDATA_OP_LOX10, BFD_RELOC_SPARC_GOTDATA_OP): New.
1425         * libbfd.h: Regnerate.
1426         * bfd-in2.h: Regenerate.
1427         * elfxx-sparc.c (_bfd_sparc_elf_howto_table): Add entries for
1428         GOTDATA relocations.
1429         (sparc_reloc_map): Likewise.
1430         (_bfd_sparc_elf_check_relocs): Handle R_SPARC_GOTDATA_* like
1431         R_SPARC_GOT*.
1432         (_bfd_sparc_elf_gc_sweep_hook): Likewise.
1433         (_bfd_sparc_elf_relocate_section): Transform R_SPARC_GOTDATA_HIX22,
1434         R_SPARC_GOTDATA_LOX10, R_SPARC_GOTDATA_OP_HIX22, and
1435         R_SPARC_GOTDATA_OP_LOX10 into the equivalent R_SPARC_GOT* reloc.
1436         Simply ignore R_SPARC_GOTDATA_OP relocations.
1437
1438 2008-04-14  Aurelien Jarno  <aurelien@aurel32.net>
1439
1440         * configure.in: Link with the PIC version of libiberty on
1441         Linux/MIPS hosts.
1442         * configure: Regenerate.
1443
1444 2008-04-14  Edmar Wienskoski  <edmar@freescale.com>
1445
1446         * archures.c: Add bfd_mach_ppc_e500mc.
1447         * bfd-in2.h: Regenerate.
1448
1449 2008-04-08  Alan Modra  <amodra@bigpond.net.au>
1450
1451         * elf32-spu.c (spu_elf_build_stubs): Correct error message.
1452         (mark_functions_via_relocs): Remove premature init of symtab_hdr.
1453         (collect_overlays): Commment typo fix.
1454
1455 2008-04-08  Kees Cook  <kees@canonical.com>
1456
1457         * elflink.c (bfd_elf_size_dynamic_sections): Ignore GNU-stack note
1458         in EXEC_P bfds.
1459
1460 2008-04-08  Alan Modra  <amodra@bigpond.net.au>
1461
1462         * elf32-spu.c: Include libiberty.h.
1463         (struct spu_link_hash_table): Add local_stire, overlay_fixed, reserved,
1464         non_ovly_stub, spu_elf_load_ovl_mgr, spu_elf_open_overlay_script,
1465         spu_elf_relink, auto_overlay fields.
1466         (AUTO_OVERLAY, AUTO_RELINK, OVERLAY_RODATA): Define.
1467         (needs_ovl_stub): Flip test so that call to non-function warning
1468         is emitted during relocate_section rather than earlier.
1469         (spu_elf_check_vma): Stash --auto-overlay parameters, and clear
1470         auto_overlay if no section exceeds local store.
1471         (struct call_info): Add count, max_depth, is_pasted fields.
1472         (struct function_info): Add rodata, last_caller, call_count,
1473         depth, new visit flags.
1474         (insert_callee): Increment call count.
1475         (copy_callee): New function.
1476         (mark_functions_via_relocs): Investigate all reloc types to count
1477         possible function pointer stubs for --auto-overlay.  Track
1478         last_caller and increment function call_count.
1479         (pasted_function): Insert a "call" into call info for pasted section.
1480         (remove_cycles): Track max depth of calls.  Don't emit call graph
1481         pruning warning for --auto-overlay.
1482         (build_call_tree): Don't transfer_calls for --auto-overlay.
1483         Adjust remove_cycles call.
1484         (sort_calls, sort_lib, sort_bfds): New functions.
1485         (struct _mos_param, struct _uos_param, struct _cl_param): New.
1486         (mark_overlay_section, unmark_overlay_section): New functions.
1487         (collect_lib_sectios, auto_ovl_lib_functions): New functions.
1488         (collect_overlays, find_pasted_call): New functions.
1489         (sum_stack): Deal with is_pasted "calls".  Exit before printing
1490         when --auto-overlay.
1491         (spu_elf_auto_overlay): New function.
1492         (spu_elf_final_link): Call spu_elf_auto_overlay.
1493         * elf32-spu.h (spu_elf_check_vma): Update prototype.
1494
1495 2008-04-07  Alan Modra  <amodra@bigpond.net.au>
1496
1497         * elf32-spu.c (allocate_spuear_stubs): Ensure _SPUEAR_ symbol
1498         is defined in overlay section before creating a stub.
1499         (build_spuear_stubs): Likewise.
1500         (spu_elf_size_stubs, spu_elf_build_stubs): Adjust calls.
1501
1502 2008-04-02  Alan Modra  <amodra@bigpond.net.au>
1503
1504         * elf32-spu.c (insert_callee): Reorder call list so most recent
1505         call is always first.
1506         (interesting_section): Move.
1507         (mark_functions_via_relocs): Fold interesting_section and
1508         reloc_count tests in callers to here.  Simplify output section
1509         owner test.
1510         (discover_functions): Set "gaps" when no symbols and some
1511         "interesting_section".  Run pasted_function loop for no symbol
1512         bfds.
1513         (for_each_node, transfer_calls): New functions.
1514         (mark_non_root): Adjust to suit for_each_node.
1515         (call_graph_traverse): Likewise.  Fix memory leak.  Rename to..
1516         (remove_cycles): ..this.
1517         (build_call_tree): Use for_each_node and transfer_calls.
1518         (struct _sum_stack_param): New.
1519         (sum_stack): Adjust to suit for_each_node.  Return error on
1520         malloc failure.  Move code to print root node cumulative stack from..
1521         (spu_elf_stack_analysis): ..here.  Use for_each_node.
1522
1523 2008-03-31  Cary Coutant  <ccoutant@google.com>
1524
1525         PR 6006
1526         * archive.c (_bfd_slurp_extended_name_table): Change
1527         ARFMAG[0] to ARFMAG[1].
1528         (_bfd_construct_extended_name_table): Likewise.
1529
1530 2008-03-31  Daniel Jacobowitz  <dan@codesourcery.com>
1531
1532         * elfxx-mips.c (mips_elf_record_got_page_entry): Update comment.
1533         (_bfd_mips_elf_check_relocs): Update comments.  Always call
1534         mips_elf_record_got_page_entry for R_MIPS_GOT_PAGE.
1535
1536 2008-03-27  Cary Coutant  <ccoutant@google.com>
1537
1538         Add support for thin archives.
1539         * archive.c (_bfd_find_nested_archive): New function.
1540         (get_extended_arelt_filename): Add origin parameter.
1541         (_bfd_generic_read_ar_hdr_mag): Deal with extended name
1542         combined with a file offset.
1543         (append_relative_path): New function.
1544         (_bfd_get_elt_at_filepos): Deal with external members and
1545         nested archives.
1546         (bfd_generic_openr_next_archived_file): Thin archives.
1547         (bfd_generic_archive_p): Recognize new magic string.
1548         (adjust_relative_path): New function.
1549         (_bfd_construct_extended_name_table): Construct extended
1550         names for thin archive members.
1551         (_bfd_write_archive_contents): Emit new magic string, skip
1552         copying files for thin archives.
1553         * bfd-in.h (bfd_is_thin_archive): New macro.
1554         * bfd.c (struct bfd): New fields for thin archives.
1555         * libbfd-in.h (struct areltdata): New field for thin archives.
1556         * opncls.c (bfd_close): Delete BFDs for nested archives.
1557
1558 2008-03-25  Bernd Schmidt  <bernd.schmidt@analog.com>
1559
1560         * elf32-bfin.c (bfin_final_link_relocate): New function, wrapper around
1561         _bfd_final_link_relocate that also handles R_pcrel24 relocs.
1562         (bfinfdpic_relocate_section, bfin_relocate_section): Use it.
1563
1564 2008-03-25  Nathan Sidwell  <nathan@codesourcery.com>
1565
1566         * elf32-arm.c (elf32_arm_final_link_relocate): Skip dynamic relocs
1567         in vxworks tls_vars sections.
1568         (allocate_dynrelocs, elf32_arm_size_dynamic_sections): Likewise.
1569         * elf32-i386.c (allocate_dynrelocs,
1570         elf_i386_size_dynamic_sections, elf_i386_relocate_section): Likewise.
1571         * elf32-ppc.c (allocate_dynrelocs, ppc_elf_size_dynamic_sections,
1572         ppc_elf_relocate_section): Likewise.
1573         * elf32-sh.c (allocate_dynrelocs, sh_elf_size_dynamic_sections,
1574         sh_elf_relocate_section): Likewise.
1575         * elfxx-sparc.c (allocate_dynrelocs,
1576         _bfd_sparc_elf_size_dynamic_sections,
1577         _bfd_sparc_elf_relocate_section): Likewise.
1578
1579 2008-03-21  Adam Nemet  <anemet@caviumnetworks.com>
1580
1581         * elf.c (_bfd_elf_print_private_bfd_data): Use bfd_fprintf_vma to
1582         print the values from the dynamic section.
1583
1584 2008-03-20  Richard Sandiford  <rsandifo@nildram.co.uk>
1585
1586         * elfxx-mips.c (MIPS_ELF_GNU_GOT1_MASK): New macro.
1587         (_bfd_mips_elf_finish_dynamic_sections): Use it instead of 0x80000000.
1588
1589 2008-03-20  Alan Modra  <amodra@bigpond.net.au>
1590
1591         * elf32-spu.c (spu_elf_create_sections): Remove output_bfd parameter.
1592         (spu_elf_find_overlays, spu_elf_size_stubs): Likewise
1593         (process_stubs, discover_functions, build_call_tree): Likewise.
1594         (spu_elf_stack_analysis): Likewise.
1595         (spu_elf_check_vma): Likewise.  Move.
1596         (struct call_info): Make "is_tail" a bitfield.
1597         (insert_callee): Clear fun->start and set fun->is_func if we find
1598         a non-tail call.
1599         * elf32-spu.h (spu_elf_create_sections): Update prototype.
1600         (spu_elf_find_overlays, spu_elf_size_stubs, spu_elf_check_vma): Ditto.
1601
1602 2008-03-17  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1603
1604         * aclocal.m4: Regenerate.
1605         * configure: Likewise.
1606         * Makefile.in: Likewise.
1607
1608 2008-03-16  H.J. Lu  <hongjiu.lu@intel.com>
1609
1610         PR ld/5789
1611         PR ld/5943
1612         * elf32-i386.c  (elf_i386_relocate_section): Issue an error
1613         for R_386_GOTOFF relocaton against undefined hidden/internal
1614         symbols when building a shared object.
1615
1616         * elf64-x86-64.c (elf64_x86_64_relocate_section): Issue an
1617         error for R_X86_64_PC8/R_X86_64_PC16/R_X86_64_PC32
1618         relocaton against undefined hidden/internal symbols when
1619         building a shared object.
1620         (elf64_x86_64_finish_dynamic_symbol): Return FALSE when symbol
1621         is referenced locally, but isn't defined in a regular file.
1622
1623 2008-03-15  H.J. Lu  <hongjiu.lu@intel.com>
1624
1625         * bfd-in.h (BFD_NO_FLAGS, HAS_RELOC, EXEC_P, HAS_LINENO,
1626         HAS_DEBUG, HAS_SYMS, HAS_LOCALS, DYNAMIC, WP_TEXT, D_PAGED,
1627         BFD_IS_RELAXABLE, BFD_TRADITIONAL_FORMAT, BFD_IN_MEMORY,
1628         HAS_LOAD_PAGE, BFD_LINKER_CREATED): Moved to ...
1629         * bfd.c: Here.
1630
1631         * bfd.c (bfd): Change cacheable, target_defaulted, opened_once,
1632         mtime_set, no_export, output_has_begun and has_armap to bit
1633         field.
1634
1635         * bfd-in2.h: Regenerated.
1636
1637 2008-03-14  Daniel Jacobowitz  <dan@codesourcery.com>
1638
1639         * cache.c (close_one): Remove mtime hack.
1640
1641 2008-03-14  H.J. Lu  <hongjiu.lu@intel.com>
1642
1643         PR ld/5913
1644         * elfxx-ia64.c (elfNN_ia64_tprel_base): Remove BFD_ASSERT.
1645         (elfNN_ia64_dtprel_base): Likewise.
1646         (elfNN_ia64_relocate_section): Go to missing_tls_sec if
1647         tls_sec is NULL before calling elfNN_ia64_tprel_base or
1648         elfNN_ia64_dtprel_base.  Report unsupported TLS relocations.
1649
1650 2008-03-14  Alan Modra  <amodra@bigpond.net.au>
1651
1652         * elf32-spu.c (process_stubs, spu_elf_relocate_section): Move
1653         common code to..
1654         (maybe_needs_stub): ..here, a new function that also omits stubs
1655         for .eh_frame, and..
1656         (needs_ovl_stub): ..here.  Create stubs for labels in code section
1657         referenced by switch jump table.
1658         (spu_elf_find_overlays): Set htab->ovly_load and htab->ovly_return.
1659         (enum _insn_type): Delete.
1660         (enum _stub_type): New.
1661         (count_stub, build_stub): Adjust.
1662         (allocate_spuear_stubs, build_spuear_stubs): Adjust.
1663
1664 2008-03-13  Alan Modra  <amodra@bigpond.net.au>
1665
1666         * elf.c (_bfd_elf_make_section_from_shdr): Remove unnecessary cast.
1667         (_bfd_elf_assign_file_position_for_section): Simplify align.
1668         (_bfd_elf_init_reloc_shdr): Ensure shift expression wide enough
1669         for sh_addralign.
1670         (elf_fake_sections, swap_out_syms): Likewise.
1671         * elflink.c (bfd_elf_final_link): Likewise.
1672
1673 2008-03-13  Alan Modra  <amodra@bigpond.net.au>
1674
1675         * Makefile.am: Run "make dep-am".
1676         * Makefile.in: Regenerate.
1677         * po/SRC-POTFILES.in: Regenerate.
1678
1679 2008-03-12  Bernd Schmidt  <bernd.schmidt@analog.com>
1680
1681         From Jie Zhang <jie.zhang@analog.com>
1682         * elf32-bfin.c (struct bfinfdpic_relocs_info): Make got17m4,
1683         gothilo, fd, fdgot17m4, fdgothilo, fdgoff17m4, fdgoffhilo,
1684         gotoff, call and sym not bitfields.
1685         (bfinfdpic_gc_sweep_hook): New function; update the relocation
1686         information for the relocations of the section being removed.
1687         (bfinfdpic_check_relocs): Accumulate the number of relocations
1688         which set got17m4, gothilo, fd, fdgot17m4, fdgothilo, fdgoff17m4,
1689         fdgoffhilo, gotoff, call and sym fields.
1690         (elf_backend_gc_sweep_hook): Redefine for FD-PIC.
1691
1692 2008-03-12  Alan Modra  <amodra@bigpond.net.au>
1693
1694         PR 5900
1695         * elf-bfd.h: Include elf/internal.h after elf/external.h.
1696         * elfcode.h (elf_swap_symbol_in): Map reserved shndx range.
1697         (elf_swap_symbol_out): Adjust SHN_XINDEX test.
1698         (elf_swap_ehdr_out): Mask SHN_LORESERVE and SHN_XINDEX to values
1699         seen in external structs.
1700         (valid_section_index_p): Delete.
1701         (elf_object_p): Don't increment section numbers over reserved range.
1702         Simplify test for valid sh_link, sh_info and e_shstrndx fields.
1703         (elf_write_shdrs_and_ehdr): Mask SHN_LORESERVE and SHN_XINDEX to values
1704         seen in external structs.  Don't increment section numbers over
1705         reserved range.
1706         * elf.c (bfd_elf_sym_name): Remove redundant tests on st_shndx.
1707         (bfd_section_from_shdr): Likewise.
1708         (group_signature): Range check before accessing elf_elfsections.
1709         (_bfd_elf_setup_sections): Likewise.
1710         (bfd_section_from_shdr): Likewise.
1711         (bfd_section_from_shdr): Don't increment section number over
1712         reserved sections.
1713         (assign_file_positions_for_non_load_sections): Likewise.
1714         (assign_file_positions_except_relocs): Likewise.
1715         (_bfd_elf_write_object_contents): Likewise.
1716         (assign_section_numbers): Likewise.  Adjust for changed SHN_*.
1717         (prep_headers): Delete unused variable.
1718         * elflink.c (bfd_elf_link_record_local_dynamic_symbol): Adjust
1719         for changed SHN_* values.
1720         (check_dynsym, elf_link_input_bfd): Likewise.
1721         (bfd_elf_final_link): Likewise.  Don't skip over reserved section
1722         range.
1723         (elf_fixup_link_order): Check that sh_link field is valid.
1724         * elf-hppa.h (elf_hppa_add_symbol_hook): Make "index" unsigned.
1725         * elf32-arm.c (elf32_arm_gc_mark_extra_sections): Range check before
1726         accesssing elf_elfsections.
1727         * elf32-avr.c (elf32_avr_size_stubs): Likewise.
1728         * elf32-hppa.c (elf32_hppa_size_stubs): Likewise.
1729         * elf32-m68hc1x.c (elf32_m68hc11_size_stubs): Likewise.
1730         * elf64-hppa.c (elf64_hppa_check_relocs): Adjust for changed
1731         SHN_* defines.  Test for SHN_BAD return from
1732         _bfd_elf_section_from_bfd_section
1733
1734 2008-03-12  Alan Modra  <amodra@bigpond.net.au>
1735
1736         * elf-bfd.h (_bfd_elf_section_from_bfd_section): Update prototype.
1737         * elf.c (_bfd_elf_section_from_bfd_section): Return unsigned int,
1738         SHN_BAD on error.
1739         (_bfd_elf_print_private_bfd_data): Test for SHN_BAD result from
1740         _bfd_elf_section_from_bfd_section, not -1.
1741         (swap_out_syms): Likewise.
1742         * elflink.c (elf_link_add_object_symbols): Likewise.
1743         (bfd_elf_get_bfd_needed_list): Likewise.
1744         (bfd_elf_match_symbols_in_sections): Likewise.
1745         (elf_link_add_object_symbols): Don't bother testing for symbols
1746         using normal sections before calling bfd_section_from_elf_index.
1747         (elf_link_input_bfd, bfd_elf_final_link): Likewise.
1748         (bfd_elf_reloc_symbol_deleted_p): Likewise.
1749         * elfcode.h (elf_slurp_symbol_table): Likewise.
1750         * elf32-spu.c (get_sym_h): Likewise.
1751         * elf32-xtensa.c (get_elf_r_symndx_section): Likewise.
1752         * elf64-ppc.c (opd_entry_value, get_sym_h, ppc64_elf_edit_toc): Ditto.
1753         * elf64-sh64.c (sh_elf64_get_relocated_section_contents): Likewise.
1754
1755 2008-03-11  Alan Modra  <amodra@bigpond.net.au>
1756
1757         * elf32-spu.c (spu_elf_relocate_section): Test identical conditions
1758         to those in process_stubs for overlay symbols.
1759
1760 2008-03-09  Paul Brook  <paul@codesourcery.com>
1761
1762         * elf32-arm.c (elf32_arm_merge_eabi_attributes): Handle new
1763         Tag_VFP_arch values.
1764
1765 2008-03-08  Paul Brook  <paul@codesourcery.com>
1766
1767         * elf32-arm.c (insert_thumb_branch): Rewrite.
1768         (elf32_thumb_to_arm_stub): Use new insert_thumb_branch.
1769
1770 2008-03-07  Paul Brook  <paul@codesourcery.com>
1771
1772         * elf32-arm.c (elf32_arm_howto_table_1): Fix bitmasks for MOVW and
1773         MOVT relocations.
1774         (elf32_arm_final_link_relocate): Fix off by one MOVW/MOVT sign
1775         extension.
1776         (elf32_arm_relocate_section): Handle MOVW and MOVT
1777         relocations.  Improve safety check for other weird relocations.
1778         (elf32_arm_check_relocs): Only set h->needs_plt for branch/call
1779         relocations.
1780
1781 2008-03-03  Bob Wilson  <bob.wilson@acm.org>
1782
1783         * xtensa-isa.c (xtensa_isa_num_pipe_stages): Make max_stage static and
1784         only compute its value once.
1785
1786 2008-03-03  Alan Modra  <amodra@bigpond.net.au>
1787
1788         * elf32-spu.c (struct got_entry): Add "addend" field.
1789         (count_stub, build_stub): Use a new stub if relocation addend
1790         differs from existing stubs for this symbol.
1791         (process_stubs): Deal with addends.
1792         (spu_elf_relocate_section, spu_elf_output_symbol_hook): Likewise.
1793
1794 2008-03-02  H.J. Lu  <hongjiu.lu@intel.com>
1795
1796         PR ld/5789
1797         * elflink.c (_bfd_elf_symbol_refs_local_p): Always return true
1798         for hidden and local symbols.
1799
1800 2008-03-03  Alan Modra  <amodra@bigpond.net.au>
1801
1802         * elf32-ppc.c (allocate_dynrelocs): Discard relocs on
1803         undefined symbols with internal or hidden visibility.
1804         (ppc_elf_relocate_section): Likewise.  Use SYMBOL_CALLS_LOCAL
1805         rather than SYMBOL_REFERENCES_LOCAL on branches.  Don't
1806         return immediately on dynamic reloc error.
1807
1808 2008-03-01  Alan Modra  <amodra@bigpond.net.au>
1809
1810         * elf64-ppc.c (build_plt_stub): Add relocs on plt call stubs
1811         if emitrelocations.
1812         (get_relocs): New function, split out from..
1813         (ppc_build_one_stub): ..here.  Add relocs on plt_branch stubs if
1814         emitrelocations.  Remove indx temp.
1815         (ppc_size_one_stub): Count new stub relocs.
1816         (ppc64_elf_size_stubs): Count new glink reloc.
1817         (ppc64_elf_build_stubs): Emit glink reloc if emitrelocations.
1818         (ppc64_elf_finish_dynamic_sections): Output glink relocs.
1819         * elf32-ppc.c (ppc_elf_finish_dynamic_sections): Describe non-pic
1820         glink code.
1821
1822 2008-02-28  Alan Modra  <amodra@bigpond.net.au>
1823
1824         * elf32-spu.c (mark_functions_via_relocs): Don't assume that
1825         the "->start" pointer reaches to function origin, so that we
1826         can handle functions split over more than two sections.
1827         (build_call_tree): Likewise.
1828         (pasted_function): Don't attempt to set fun->start back to the
1829         function origin, just go back one section.
1830
1831 2008-02-27  Catherine Moore  <clm@codesourcery.com>
1832
1833         * elf.c ( _bfd_elf_print_private_bfd_data): Call
1834         elf_backend_get_target_dtag if defined.
1835         * elf32-mips.c (elf_backend_get_target_dtag): Define.
1836         * elf64-mips.c: Likewise.
1837         * elfn32-mips.c: Likewise.
1838         * elfxx-mips.c (_bfd_mips_elf_get_target_dtag): New.
1839         * elfxx-mips.h (_bfd_mips_elf_get_target_dtag): Declare.
1840         * elf-bfd.h (elf_backend_get_target_dtag): Add prototype.
1841         * elfxx-target.h (elf_backend_get_target_dtag): Add default.
1842         (elf_backend_data): Add elf_backend_get_target_dtag.
1843
1844 2008-02-26  Alan Modra  <amodra@bigpond.net.au>
1845
1846         * elf32-ppc.c (ppc_elf_check_relocs): Set pointer_equality_needed
1847         for R_PPC_REL32 syms.  Don't set non_got_ref on branch reloc syms,
1848         and assume branch relocs are not dynamic when non-shared.
1849         (readonly_dynrelocs): New function, split out from..
1850         (maybe_set_textrel): ..here, renamed from old readonly_dynrelocs.
1851         (ppc_elf_adjust_dynamic_symbol): For symbols generating plt entries,
1852         clear non_got_ref..
1853         (allocate_dynrelocs): ..and don't set u.def for undefined weak.
1854         Do allow dynamic relocs on undefined symbols.
1855         (ppc_elf_adjust_dynamic_symbol): Use readonly_dynrelocs.
1856         (ppc_elf_relocate_section): Mirror dynamic reloc changes in
1857         check_relocs.
1858         (ppc_elf_finish_dynamic_symbol): Don't give a warning on weak
1859         plt symbols needing pointer_equality_needed.
1860
1861 2008-02-23  Alan Modra  <amodra@bigpond.net.au>
1862
1863         * elf32-ppc.c (ppc_elf_check_relocs): Revert non_got_ref change.
1864
1865 2008-02-23  Alan Modra  <amodra@bigpond.net.au>
1866
1867         * elf32-ppc.c (ppc_elf_copy_indirect_symbol): Copy
1868         pointer_equality_needed.
1869         (ppc_elf_check_relocs): Split out non-branch relocs from others
1870         that might emit dynamic relocs.  Set pointer_equality_needed
1871         for their symbols.  Don't set non_got_ref on branch reloc symbols.
1872         (ppc_elf_hash_symbol): New function.
1873         (elf_backend_hash_symbol): Define.
1874         (ppc_elf_finish_dynamic_symbol): Handle pointer_equality_needed.
1875         Error if pointer_equality_needed on weak plt symbol.
1876
1877 2008-02-22  H.J. Lu  <hongjiu.lu@intel.com>
1878
1879         PR ld/5788
1880         * elflink.c (elf_create_symbuf): Correct buffer size and
1881         position.
1882
1883 2008-02-22  Nick Clifton  <nickc@redhat.com>
1884
1885         PR 868
1886         * dwarf2.c: Revert previous patch.  All of the allocate memory is
1887         on an obstack which will be freed at some other time.
1888
1889 2008-02-20  Nick Clifton  <nickc@redhat.com>
1890
1891         PR 868
1892         * libbfd.c (bfd_realloc_or_free): New function.  Performs like
1893         bfd_realloc, but if the (re)allocation fails, the pointer is
1894         freed.
1895         * libbfd-in.h: Prototype.
1896         * libbfd.h: Regenerate.
1897         * bfdio.c (bfd_bwrite): Use the new function.
1898         (bfd_seek): Likewise.
1899         * bfdwin.c:(bfd_get_file_window): Likewise.
1900         * elf-strtab.c (_bfd_elf_strtab_add): Likewise.
1901         * elf32-ppc.c (ppc_elf_relax_section): Likewise.
1902         * elf32-xtensa.c (vsprintf_msg): Likewise.
1903         * mach-o.c (bfd_mach_o_core_fetch_environment): Likewise.
1904         * stabs.c (_bfd_link_seciton_stabs): Likewise.
1905         * vms-misc.c (_bfd_vms_get_record): Likewise.
1906         * vms-tir.c (check_section): Likewise.
1907         * vms.c (vms_new_section_hook): Likewise.
1908         * elf32-arm.c (elf32_arm_section_map_add): Check that the
1909         allocation of sec_data->map succeeded before using it.
1910         * elflink.c (elf_link_output_sym): Do not overwrite finfo->
1911         symshndxbuf until it is known that the reallocation succeeded.
1912
1913 2008-02-20  Diogo de Carvalho Kraemer  <diogo@kraemer.eng.br>
1914             Nick Clifton  <nickc@redhat.com>
1915
1916         PR 868
1917         * dwarf2.c (read_abbrevs): Free the abbreviation table if we run
1918         out of memory.
1919         (decode_line_info): Free the line_info_table before returning a
1920         failure result.
1921         (_bfd_dwarf2_cleanup_debug_info): Free the abbreviation table.
1922         Free the line table.  Free the function table.  Free the variable
1923         table.
1924
1925 2008-02-17  Mark Kettenis  <kettenis@gnu.org>
1926
1927         * elf.c (swap_out_syms): Avoid preprocessing directive within
1928         macro arg.
1929
1930 2008-02-17  Jan Kratochvil  <jan.kratochvil@redhat.com>
1931
1932         * elf.c (assign_file_positions_for_load_sections): Set the type of
1933         PT_NOTE sections to SHT_NOTE.
1934
1935 2008-02-17  Ulrich Weigand  <uweigand@de.ibm.com>
1936
1937         * simple.c (bfd_simple_get_relocated_section_contents): Set
1938         link_info.output_bfd.
1939
1940 2008-02-16  Nathan Sidwell  <nathan@codesourcery.com>
1941
1942         * dwarf2.c (find_line): Don't trust debug information after an
1943         unparseable compilation unit.
1944
1945 2008-02-15  Alan Modra  <amodra@bigpond.net.au>
1946
1947         PR 5765
1948         * section.c (SEC_LINK_DUPLICATES): Correct.  Renumber following flags.
1949         * bfd-in2.h: Regenerate.
1950
1951 2008-02-15  Alan Modra  <amodra@bigpond.net.au>
1952
1953         * elf-bfd.h (enum elf_object_id): Add HPPA_ELF_TDATA.
1954         * elf.c (bfd_elf_allocate_object): Don't check for already allocated
1955         tdata.
1956         * elf32-hppa.c (elf32_hppa_mkobject): New function.
1957         (bfd_elf32_mkobject): Define.
1958         * elf32-ppc.c (is_ppc_elf_target): Delete.  Replace all uses with..
1959         (is_ppc_elf): ..this new macro.
1960         * elf64-ppc.c (is_ppc64_elf_target): Delete.  Replace all uses with..
1961         (is_ppc64_elf): ..this new macro.
1962
1963 2008-02-15  Alan Modra  <amodra@bigpond.net.au>
1964
1965         * elflink.c: Replace all accesses to hash->creator field with
1966         output_bfd->xvec.
1967         * cofflink.c: Likewise.
1968         * coff-h8300.c: Likewise.
1969         * ecoff.c: Likewise.
1970         * elf32-m68hc1x.c: Likewise.
1971         * elf32-ppc.c: Likewise.
1972         * elf64-alpha.c: Likewise.
1973         * elf64-ppc.c: Likewise.
1974         * elf64-sparc.c: Likewise.
1975         * elfxx-mips.c: Likewise.
1976         * i386linux.c: Likewise.
1977         * m68klinux.c: Likewise.
1978         * sparclinux.c: Likewise.
1979         * sunos.c: Likewise.
1980         * xcofflink.c: Likewise.
1981         * linker.c: Likewise.
1982         (_bfd_link_hash_table_init): Don't store creator.
1983
1984 2008-02-14  Peter Jones  <pjones@redhat.com>
1985
1986         * efi-rtdrv-ia32.c: New file.
1987         * efi-bsdrv-ia32.c: New file.
1988         * efi-rtdrv-ia64.c: New file.
1989         * efi-bsdrv-ia64.c: New file.
1990         * efi-rtdrv-x86_64.c: New file.
1991         * efi-bsdrv-x86_64.c: New file.
1992         * peicode.h (pe_bfd_object_p): Add support for boot service and
1993         runtime service drivers.
1994         * libpei.h: Add macros for EFI formats, and rename the efi application
1995         format macros to disambiguate.
1996         * targets.c: Add bfd_target _vec externs.
1997         (_bfd_tar): Add EFI _vec entries.
1998         * config.bfd: Add EFI vectors into the selection routines.
1999         * configure.in: add EFI _vec entries.
2000         * configure: Regenerate.
2001         * Makefile.am: Add EFI files.
2002         * Makefile.in: Regenerate.
2003
2004 2008-02-14  Nathan Sidwell  <nathan@codesourcery.com>
2005
2006         * dwarf1.c (struct dwarf1_debug): Add syms member.
2007         (alloc_dwarf1_unit, alloc_dwarf1_func): Check for out of memory.
2008         (parse_line_table, _bfd_dwarf1_find_nearest_line): Relocate
2009         section contents, check for out of memory.
2010
2011         * dwarf1.c (struct dwarf1_debug): Change data pointers to bfd_byte.
2012         (parse_die): Change data pointers to bfd_byte.
2013         (parse_line_table, parse_functions_in_unit): Likewise.
2014
2015 2008-02-14  Alan Modra  <amodra@bigpond.net.au>
2016
2017         * elflink.c (compute_bucket_count): Warning fixes.
2018
2019 2008-02-12  DJ Delorie  <dj@redhat.com>
2020
2021         * elf32-iq2000.c (iq2000_elf_relocate_section): Adjust addend of
2022         relocation pointing to local symbol in merged section.
2023
2024         * elf32-iq2000.c (iq2000_elf_relocate_offset16): New.
2025         (iq2000_elf_relocate_section): Call it.
2026
2027 2008-02-12  Nick Clifton  <nickc@redhat.com>
2028
2029         PR ld/5692
2030         * elf-bfd.h (enum elf_object_id): New enum, used to identify
2031         target specific extensions to the elf_obj_tdata structure.
2032         (struct elf_obj_tdata): New field 'object_id'.
2033         (elf_object_id, elf_program_header_size, elf_symtab_hdr): New
2034         macros for accessing fields in the elf_obj_tdata structure.
2035         (bfd_elf_mkobject): Rename to bfd_elf_make_generic_object.
2036         (bfd_elf_allocate_object): New function.
2037         * elf.c (bfd_elf_mkobject): Rename to bfd_elf_make_generic_object
2038         and implement by calling bfd_elf_allocate_object.
2039         (bfd_elf_allocate_object): New function: Allocates an
2040         elf_obj_tdata structure, possibly with a target specific
2041         extension.
2042         * elfxx-target.h (bfd_elfNN_mkobject): Use
2043         bfd_elf_make_generic_object as the default value.
2044         * elf32-arm.c (elf32_arm_obj_tdata): Rename to elf_arm_obj_tdata
2045         for consistency with other, similar structures.
2046         (is_arm_elf): New macro.  Checks a BFD to make sure that is an ARM
2047         ELF bfd.
2048         (elf32_arm_mkobject): Call bfd_elf_allocate_object.
2049         (bfd_elf32_arm_vfp11_erratum_scan): Use is_arm_elf macro to check
2050         the bfd being processed.
2051         (bfd_elf32_arm_vfp11_fix_veneer_locations): Likewise.
2052         (bfd_elf32_arm_set_target_relocs): Likewise.
2053         (bfd_elf32_arm_final_link_relocate): Likewise.
2054         (bfd_elf32_arm_copy_private_bfd_data): Likewise.
2055         (bfd_elf32_arm_merge_eabi_attributes): Likewise.
2056         (bfd_elf32_arm_merge_private_bfd_data): Likewise.
2057         (bfd_elf32_arm_check_relocs): Likewise.
2058         (bfd_elf32_arm_gc_mark_extra_sections): Likewise.
2059         (bfd_elf32_arm_size_dynamic_sections): Likewise.
2060         (bfd_elf32_arm_process_before_allocation): Use elf_symtab_hdr.
2061         (bfd_elf32_arm_init_maps): Likewise.
2062         (bfd_elf32_arm_final_link_relocate): Likewise.
2063         (bfd_elf32_arm_relocate_section): Likewise.
2064         (bfd_elf32_arm_gc_sweep_hook): Likewise.
2065         (bfd_elf32_arm_check_relocs): Likewise.
2066         (bfd_elf32_arm_size_dynamic_sections): Likewise.
2067         * elf32-i386.c (elf_i386_mkobject): Call bfd_elf_allocate_object.
2068         (is_i386_elf): New macro.  Checks a BFD to make sure that is an x86
2069         ELF bfd.
2070         (elf_i386_check_relocs): Use is_i386_elf macro to check    the bfd
2071         being processed.
2072         (elf_i386_size_dynamic_sections): Likewise.
2073         (elf_i386_relocate_section): Likewise.
2074         (elf_i386_check_relocs): Use elf_symtab_hdr.
2075         (elf_i386_gc_sweep_hook): Likewise.
2076         (elf_i386_size_dynamic_sections): Likewise.
2077         (elf_i386_relocate_section): Likewise.
2078         * elf32-ppc.c (ppc_elf_mkobject): Call bfd_elf_allocate_object.
2079         (elf_create_pointer_linker_section): Use is_ppc_elf_target to
2080         verify that the bfd before accessing target specific fields.
2081         (ppc_elf_check_relocs): Likewise.
2082         (elf_finish_pointer_linker_section): Likewise.
2083         (elf_create_pointer_linker_section): Use elf_symtab_hdr.
2084         (ppc_elf_check_relocs): Likewise.
2085         (ppc_elf_gc_sweep_hook): Likewise.
2086         (ppc_elf_tls_optimize): Likewise.
2087         (ppc_elf_size_dynamic_sections): Likewise.
2088         (ppc_elf_relax_section): Likewise.
2089         (ppc_elf_relocate_section): Likewise.
2090         * elf32-s390.c (struct elf_s390_obj_tdata): Add a comment
2091         reminding programmers to keep this structure in sync with the one
2092         defined in elf64-s390.c.
2093         (elf_s390_mkobject): Call bfd_elf_allocate_object.
2094         (is_s390_elf): New macro.  Checks a BFD to make sure that is an s390
2095         ELF bfd.
2096         (elf_s390_check_relocs): Use is_s390_elf macro to check    the bfd
2097         being processed.
2098         (elf_s390_size_dynamic_sections): Likewise.
2099         (elf_s390_relocate_section): Likewise.
2100         (elf_s390_check_relocs): Use elf_symtab_hdr.
2101         (elf_s390_gc_sweep_hook): Likewise.
2102         (elf_s390_size_dynamic_sections): Likewise.
2103         (elf_s390_relocate_section): Likewise.
2104         * elf32-sh.c (sh_elf_mkobject): Call bfd_elf_allocate_object.
2105         (is_sh_elf): New macro.  Checks a BFD to make sure that is an SH
2106         ELF bfd.
2107         (sh_elf_size_dynamic_sections): Use is_sh_elf macro to check the
2108         bfd being processed.
2109         (sh_elf_relocate_section): Likewise.
2110         (sh_elf_check_relocs): Likewise.
2111         (sh_elf_copy_private_data): Likewise.
2112         (sh_elf_relax_section): Use elf_symtab_hdr.
2113         (sh_elf_size_dynamic_sections): Likewise.
2114         (sh_elf_relocate_section): Likewise.
2115         (sh_elf_get_relocated_section_contents): Likewise.
2116         (sh_elf_gc_sweep_hook): Likewise.
2117         (sh_elf_check_relocs): Likewise.
2118         * elf64-alpha.c (elf64_alpha_mkobject): Call bfd_elf_allocate_object.
2119         (is_alpha_elf): New macro.  Checks a BFD to make sure that is an
2120         Alpha ELF bfd.
2121         (elf64_alpha_create_got_section): Use is_alpha_elf macro to check
2122         the bfd being processed.
2123         (elf64_alpha_create_dynamic_section): Likewise.
2124         (elf64_alpha_check_relocs): Likewise.
2125         (elf64_alpha_size_got_sections): Likewise.
2126         (elf64_alpha_relax_section): Likewise.
2127         (elf64_alpha_relocate_section): Likewise.
2128         (elf64_alpha_final_link): Likewise.
2129         (elf64_alpha_check_relocs): Use elf_symtab_hdr.
2130         (elf64_alpha_relax_section): Likewise.
2131         (elf64_alpha_relocate_section_r): Likewise.
2132         (elf64_alpha_relocate_section): Likewise.
2133         * elf64-ppc.c (ppc64_elf_mkobject): Call bfd_elf_allocate_object.
2134         (ppc64_elf_check_relocs): Use is_ppc64_elf_target to check the bfd
2135         being processed.
2136         (opd_entry_value): Likewise.
2137         (allocate_dynrelocs): Likewise.
2138         (ppc64_elf_relocate_section): Likewise.
2139         (ppc64_elf_check_relocs): Use elf_symtab_hdr.
2140         (opd_entry_value): Likewise.
2141         (ppc64_elf_gc_sweep_hook): Likewise.
2142         (get_sym_h): Likewise.
2143         (ppc64_elf_edit_opd): Likewise.
2144         (ppc64_elf_tls_optimize): Likewise.
2145         (ppc64_elf_edit_toc): Likewise.
2146         (ppc64_elf_size_dynamic_sections): Likewise.
2147         (toc_adjusting_stub_needed): Likewise.
2148         (ppc64_elf_size_stubs): Likewise.
2149         (ppc64_elf_relocate_section): Likewise.
2150         * elf64-s390.c (struct elf_s390_obj_tdata): Add a comment
2151         reminding programmers to keep this structure in sync with the one
2152         defined in elf32-s390.c.
2153         (elf_s390_mkobject): Call bfd_elf_allocate_object.
2154         (is_s390_elf): New macro.  Checks a BFD to make sure that is an s390
2155         ELF bfd.
2156         (elf_s390_check_relocs): Use is_s390_elf macro to check    the bfd
2157         being processed.
2158         (elf_s390_size_dynamic_sections): Likewise.
2159         (elf_s390_relocate_section): Likewise.
2160         (elf_s390_check_relocs): Use elf_symtab_hdr.
2161         (elf_s390_gc_sweep_hook): Likewise.
2162         (elf_s390_size_dynamic_sections): Likewise.
2163         (elf_s390_relocate_section): Likewise.
2164         * elf64-x86_64.c (elf64_x86_64_mkobject): Call bfd_elf_allocate_object.
2165         (is_x86_64_elf): New macro.  Checks a BFD to make sure that is an
2166         x86_64 ELF bfd.
2167         (elf64_x86_64_check_relocs): Use is_x86_64_elf macro to check the bfd
2168         being processed.
2169         (elf64_x86_64_size_dynamic_sections): Likewise.
2170         (elf64_x86_64_relocate_section): Likewise.
2171         (elf64_x86_64_check_relocs): Use elf_symtab_hdr.
2172         (elf64_x86_64_gc_sweep_hook): Likewise.
2173         (elf64_x86_64_size_dynamic_sections): Likewise.
2174         (elf64_x86_64_relocate_section): Likewise.
2175         * elfxx-sparc.c (_bfd_sparc_elf_mkobject): Call bfd_elf_allocate_object.
2176         (is_sparc_elf): New macro.  Checks a BFD to make sure that is a Sparc
2177         ELF bfd.
2178         (_bfd_sparc_elf_check_relocs): Use is_sparc_elf macro to check the
2179         bfd being processed.
2180         (_bfd_sparc_elf_gc_sweep_hook): Likewise.
2181         (_bfd_sparc_elf_size_dynamic_sections): Likewise.
2182         (_bfd_sparc_elf_check_relocs): Use elf_symtab_hdr.
2183         (_bfd_sparc_elf_gc_sweep_hook): Likewise.
2184         (_bfd_sparc_elf_size_dynamic_sections): Likewise.
2185         (_bfd_sparc_elf_relocate_section): Likewise.
2186
2187 2008-02-12  Alan Modra  <amodra@bigpond.net.au>
2188
2189         PR 5303, 5755
2190         * arange-set.c: Delete.
2191         * arange-set.h: Delete.
2192         * dwarf2.c: Revert 2007-09-21 changes.
2193         * Makefile.am: Likewise.
2194         * Makefile.in: Regenerate.
2195         * po/SRC-POTFILES.in: Regenerate.
2196
2197 2008-02-11  Bernd Schmidt  <bernd.schmidt@analog.com>
2198
2199         * elf32-bfin.c (bfin_relocate_section): Set up dynobj before using it
2200         if necessary.
2201         (elf32_bfin_merge_private_bfd_data): Simplify, and ensure object type
2202         mismatches are detected.
2203
2204         * elf32-bfin.c (bfinfdpic_relocate_section): Take more care not to
2205         emit invalid relocs or rofixup entries for deleted .eh_frame entries.
2206
2207 2008-02-11  Daniel Jacobowitz  <dan@codesourcery.com>
2208
2209         * cache.c (cache_bread): Set bfd_error_file_truncated if EOF
2210         was reached.
2211         * srec.c (srec_scan): Calculate the checksum.  Complain on mismatch.
2212
2213 2008-02-07  Alan Modra  <amodra@bigpond.net.au>
2214
2215         * elf32-spu.c (spu_elf_size_stubs): Revert 2008-01-28 doubling
2216         of _ovly_buf_table size.
2217         (spu_elf_build_stubs): Use low bit of .size as "present" bit.
2218         Adjust initialisations relating to _ovly_buf_table.
2219
2220 2008-02-04  Bob Wilson  <bob.wilson@acm.org>
2221
2222         * elf32-xtensa (elf_xtensa_relocate_section): After finding an invalid
2223         relocation, do not continue processing it.  Ignore R_XTENSA_ASM_EXPAND
2224         relocations against dynamic symbols.
2225         (elf_xtensa_finish_dynamic_sections): Do not fail if there is no
2226         .xt.lit section.
2227
2228 2008-02-04  Kai Tietz  <kai.tietz@onevision.com>
2229             H.J. Lu  <hongjiu.lu@intel.com>
2230
2231         PR 5715
2232         * warning.m4: Enable -Wno-format by default when using gcc on
2233         mingw.
2234         * configure: Regenerated.
2235
2236 2008-02-04  Adam Nemet  <anemet@caviumnetworks.com>
2237
2238         * archures.c: Update copyright.
2239         (bfd_mach_mips_octeon): New macro.
2240         * bfd-in2.h: Regenerate.
2241         * elfxx-mips.c (_bfd_elf_mips_mach): Handle Octeon.
2242         (mips_set_isa_flags): Likewise.
2243         (mips_mach_extensions): Add Octeon.
2244         * cpu-mips.c: Update copyright.
2245         (I_mipsocteon): New enum constant.
2246         (arch_info_struct): Add Octeon.
2247
2248 2008-02-04  Alan Modra  <amodra@bigpond.net.au>
2249
2250         * elf32-spu.c (spu_elf_relocate_section): Correct return type.
2251         Return error status on unexpected relocation errors.
2252
2253 2008-02-04  Alan Modra  <amodra@bigpond.net.au>
2254
2255         PR ld/5692
2256         * elf.c (bfd_elf_get_elf_syms): Revert 2008-01-31.  Instead abort
2257         on non-ELF input.
2258         * elf32-arm.c (elf32_arm_size_dynamic_sections): Skip glue
2259         processing on non-ELF input.
2260
2261 2008-01-31  Marc Gauthier  <marc@tensilica.com>
2262
2263         * config.bfd (xtensa*-*-*): Recognize processor variants.
2264
2265 2008-01-31  Nick Clifton  <nickc@redhat.com>
2266
2267         PR ld/5692
2268         * elf.c (bfd_elf_get_elf_syms): Check the return value of
2269         get_elf_backend_data.
2270
2271 2008-01-28  Fabian Groffen  <grobian@gentoo.org>
2272
2273         * config.bfd (x86_64-*-solaris2): Add support for this target.
2274
2275 2008-01-28  Alan Modra  <amodra@bigpond.net.au>
2276
2277         Rewrite SPU overlay handling code.  Put overlay calls stubs in the
2278         overlays where possible.  Use a faster call stub, or optionally at
2279         compile time, a more compact stub.  Double size of _ovly_buf_table
2280         so that low bit of _ovly_table.buf can be used as a "present" bit.
2281         Reserve an extra _ovly_table entry for index zero.
2282         * elf32-spu.c: (struct spu_link_hash_table): Delete a number of fields,
2283         add new ones.
2284         (struct got_entry): New.
2285         (struct spu_stub_hash_entry): Delete.
2286         (stub_hash_newfunc, spu_elf_link_hash_table_free): Delete.
2287         (spu_elf_link_hash_table_create): Adjust for struct changes.
2288         (spu_stub_name): Delete.
2289         (spu_elf_find_overlays): Don't track sections from overlay regions.
2290         Instead set ovl_buf number in spu elf section data.  Error if
2291         overlays in one region don't start at the same address.  Adjust
2292         for struct _spu_elf_section_data changes.
2293         (SIZEOF_STUB1, SIZEOF_STUB2, ILA_79, ILA_78): Delete.
2294         (OVL_STUB_SIZE, BRSL, LNOP, ILA): Define.
2295         (needs_ovl_stub): Adjust for struct _spu_elf_section_data changes.
2296         (enum _insn_type): New.
2297         (count_stub, build_stub): New functions.
2298         (allocate_spuear_stubs): Use count_stub.
2299         (build_spuear_stubs): Use build_stub.
2300         (populate_stubs, sort_stubs): Delete.
2301         (process_stubs): New function.
2302         (write_one_stub): Delete.
2303         (spu_elf_size_stubs, spu_elf_build_stubs): Rewrite.
2304         (alloc_stack_info): Adjust for struct _spu_elf_section_data changes.
2305         (maybe_insert_function, check_function_ranges): Likewise.
2306         (find_function, pasted_function, build_call_tree): Likewise.
2307         (spu_elf_stack_analysis, spu_elf_modify_segment_map): Likewise.
2308         (spu_elf_modify_program_headers): Likewise.
2309         (interesting_section): Detect stub sections differently.  Delete
2310         htab param, adjust all callers.
2311         (spu_elf_relocate_section): Rewrite stub handling.
2312         (spu_elf_output_symbol_hook): Likewise.
2313         (bfd_elf32_bfd_link_hash_table_free): Delete.
2314         * elf32-spu.h (struct _spu_elf_section_data): Move input-only and
2315         output-only fields into a union.  Add ovl_buf.
2316         (spu_elf_size_stubs, spu_elf_build_stubs): Update prototypes.
2317
2318 2008-01-25  DJ Delorie  <dj@redhat.com>
2319
2320         * elf32-m32c.c (_bfd_m32c_elf_eh_frame_address_size): New.
2321
2322 2008-01-25  Kai Tietz  <kai.tietz@onevision.com>
2323
2324         * bfd-in.h: Add mingw I64 support.
2325         * bfd-in2.h: Regenerated.
2326         * bfd.c: (bfd_get_sign_extend_vma): Add pe-x86-64 and pei-x86-64.
2327
2328 2008-01-21  Alan Modra  <amodra@bigpond.net.au>
2329
2330         PR 4453
2331         * format.c (bfd_check_format_matches): Don't accept archives as
2332         fully matching unless they have a map.
2333
2334 2008-01-21  Alan Modra  <amodra@bigpond.net.au>
2335
2336         * elflink.c (_bfd_elf_link_output_relocs): Correct error return.
2337
2338 2008-01-21  Alan Modra  <amodra@bigpond.net.au>
2339
2340         * ecoff.c (_bfd_ecoff_archive_p): Delete.
2341         * libecoff.h (_bfd_ecoff_archive_p): Delete.
2342         * coff-alpha.c (ecoffalpha_little_vec): Use bfd_generic_archive_p.
2343         * coff-mips.c (ecoff_little_vec, ecoff_big_vec): Likewise.
2344         (ecoff_biglittle_vec): Likewise.
2345
2346 2008-01-19  Alan Modra  <amodra@bigpond.net.au>
2347
2348         PR 5646
2349         * elf64-ppc.c (ppc64_elf_tls_optimize): Ensure htab->tls_get_addr
2350         non-NULL before dereferencing.
2351
2352 2008-01-15  Alan Modra  <amodra@bigpond.net.au>
2353
2354         PR 5604
2355         * elf-bfd.h (struct elf_backend_data): Add gc_keep.  Remove param
2356         names from others.
2357         (_bfd_elf_gc_keep): Declare.
2358         * elfxx-target.h (elf_backend_gc_keep): Define.
2359         (elfNN_bed): Init new field.
2360         * elflink.c (_bfd_elf_gc_keep): New function.
2361         (bfd_elf_gc_sections): Call gc_keep.
2362         * elf64-ppc.c (elf_backend_gc_keep): Define.
2363         (struct _ppc64_elf_section_data): Move .opd related fields to
2364         a struct so they don't occupy the same storage.  Adjust accesses
2365         throughout file.
2366         (ppc64_elf_gc_keep): New function, split out from..
2367         (ppc64_elf_gc_mark_hook): ..here.  Don't call _bfd_elf_gc_mark
2368         to mark .opd section, just set gc_mark.
2369         (ppc64_elf_edit_opd): Remove no_opd_opt parm.  Don't set opd->adjust
2370         unless we are changing .opd.  Test non-NULL opd->adjust at all
2371         accesses throughout file.
2372         * elf64-ppc.h (ppc64_elf_edit_opd): Update prototype.
2373
2374 2008-01-15  Alan Modra  <amodra@bigpond.net.au>
2375
2376         * bfd-in.h (BFD_HOST_LONG_LONG): Delete.
2377         * bfd-in2.h: Regenerate.
2378
2379 2008-01-11  Tristan Gingold  <gingold@adacore.com>
2380             Eric Botcazou  <ebotcazou@adacore.com>
2381
2382         * elf32-ppc.c (ppc_elf_gc_sweep_hook): Exit early if generating a
2383         relocatable.
2384         * elf32-arm.c (elf32_arm_gc_sweep_hook): Likewise.
2385         * elf32-cris.c (cris_elf_gc_sweep_hook): Likewise.
2386         * elf32-hppa.c (elf32_hppa_gc_sweep_hook): Likewise.
2387         * elf32-i386.c (elf_i386_gc_sweep_hook): Likewise.
2388         * elf32-m32r.c (m32r_elf_gc_sweep_hook): Likewise.
2389         * elf32-m68k.c (elf_m68k_gc_sweep_hook): Likewise.
2390         * elf32-s390.c (elf_s390_gc_sweep_hook): Likewise.
2391         * elf32-sh.c (sh_elf_gc_sweep_hook): Likewise.
2392         * elf32-vax.c (elf_vax_gc_sweep_hook): Likewise.
2393         * elf32-xtensa.c (elf_xtensa_gc_sweep_hook): Likewise.
2394         * elf64-x86-64.c (elf64_x86_64_gc_sweep_hook): Likewise.
2395         * elf64-s390.c (elf_s390_gc_sweep_hook): Likewise.
2396         * elf64-ppc.c (ppc64_elf_gc_sweep_hook): Likewise.
2397         * elfxx-mips.c (_bfd_mips_elf_gc_sweep_hook): Likewise.
2398         * elfxx-sparc.c (_bfd_sparc_elf_gc_sweep_hook): Likewise.
2399         * elflink.c (bfd_elf_gc_sections): Do not punt on relocatable output
2400         or executable output with relocations.
2401
2402 2008-01-09  Nick Clifton  <nickc@redhat.com>
2403
2404         PR gas/5552
2405         * elf32-fr30.c (fr30_elf_howto_table): Set partial_inplace field
2406         to FALSE for all relocs.
2407
2408 2008-01-09  Richard Sandiford  <rsandifo@nildram.co.uk>
2409
2410         PR ld/5526
2411         * elf-bfd.h (eh_cie_fde): Add u.cie.u.full_cie and u.cie.merged
2412         fields.  Rename u.cie.u.merged to u.cie.u.merged_with.
2413         (eh_frame_sec_info): Add a cies field.
2414         (eh_frame_hdr_info): Add a merge_cies field.
2415         * elf-eh-frame.c (cie): Add a reloc_index member to the personality
2416         union.
2417         (_bfd_elf_begin_eh_frame_parsing): Set hdr_info->merge_cies instead
2418         of hdr_info->cies.
2419         (_bfd_elf_parse_eh_frame): Remove tmp_cie.  Ccreate an array of
2420         cie structures in all cases and use it instead of extended_cies.
2421         If merging, store the cie array in sec_info->cies and point each
2422         CIE's eh_fde_cie at the associated element.  Do not try to
2423         calculate the value of the personality routine here; record the
2424         offset of the relocation instead.  Do not merge CIEs here.
2425         (_bfd_elf_end_eh_frame_parsing): Do not free hdr_info->cies here...
2426         (_bfd_elf_discard_section_eh_frame_hdr): ...do it here instead.
2427         (_bfd_elf_gc_mark_fdes): Mark the original (unmerged) CIE.
2428         (find_merged_cie): New function.
2429         (_bfd_elf_gc_mark_fdes): Use it.  Free sec_info->cies.
2430
2431 2008-01-07  Nick Clifton  <nickc@redhat.com>
2432
2433         PR binutils/5535
2434         * vms.c (vms_close_and_cleanup): Check for the presence of a
2435         vms_private_data_struct before examining any of its fields.
2436
2437 2008-01-07  H.J. Lu  <hongjiu.lu@intel.com>
2438
2439         PR ld/5522
2440         * elflink.c (elf_link_input_bfd): Don't write out a section if
2441         its output section is marked with SEC_NEVER_LOAD.
2442
2443 For older changes see ChangeLog-2007
2444 \f
2445 Local Variables:
2446 mode: change-log
2447 left-margin: 8
2448 fill-column: 74
2449 version-control: never
2450 End: