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