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