2007-07-26 Michael Snyder <msnyder@access-company.com>
[external/binutils.git] / bfd / ChangeLog
1 2007-07-26  Michael Snyder  <msnyder@access-company.com>
2
3         * coffgen.c (fixup_symbol_value): Guard against null; 
4         bfd_is_com_section will dereference the section pointer.
5
6         * syms.c (bfd_decode_symclass): Guard against NULL, since 
7         bfd_is_com_section dereferences the pointer.
8
9         * srec.c (srec_scan): Check for EOF (critical because return value
10         will be used as array index).
11
12         * coffgen.c (_bfd_coff_read_internal_relocs): If internal_relocs
13         are not to be cached, free the temporary buffer.
14
15         * aoutx.h (slurp_reloc_table): Return TRUE if reloc_size == zero
16         or count == zero.
17
18         * tekhex.c (first_phase): Check return value for null.
19
20         * elf.c (_bfd_elf_get_synthetic_symtab): Remove meaningless 
21         pointer increment.
22
23 2007-07-26  Alan Modra  <amodra@bigpond.net.au>
24
25         * elflink.c (_bfd_elf_fix_symbol_flags): Remove unnecessary
26         check on dynobj.  Remove bed shadow.
27
28         * srec.c (srec_get_section_contents): Return immediately on
29         count zero.  Check that offset and count are within section.
30         * libbfd.c (_bfd_generic_get_section_contents): Check that
31         offset + count does not overflow.
32
33         * srec.c (srec_canonicalize_symtab): Don't alloc when symcount
34         is zero.  Correct return value on error.
35         * mmo.c (mmo_canonicalize_symtab): Likewise.
36         * binary.c (binary_canonicalize_symtab) Correct return on error.
37
38 2007-07-26  Thiemo Seufer  <ths@mips.com>
39
40         * bfd.c (_bfd_set_gp_value): Use abort instead of BFD_FAIL.
41
42 2007-07-26  Alan Modra  <amodra@bigpond.net.au>
43
44         * reloc.c (bfd_generic_get_relocated_section_contents): Avoid
45         bfd_canonicalize_reloc call when bfd_get_reloc_upper_bound
46         says there are no relocs.
47
48 2007-07-26  Doug Kwan  <dougkwan@google.com>
49
50         Speed up bfd_dwarf2_find_line.
51         * dwarf2.c (struct dwarf2_debug): Add new fields to support function
52         and variable info hash tables. Add last_comp_unit, info_hash_count,
53         funcinfo_hash_table, varinfo_hash_table, hash_units_head.
54         (struct comp_unit): Add prev_unit, cached.
55         (struct info_list_node, struct info_hash_entry,
56         struct info_hash_table): New.
57         (info_hash_table_newfunc, create_info_hash_table,
58         insert_info_hash_table, lookup_info_hash_table): New functions
59         implementing function and variable info hash tables.
60         (scan_unit_for_symbols): Add checks to make sure hash tables are
61         consistent with compilation units.
62         (comp_unit_maybe_decode_line_info): New function.
63         (comp_unit_find_line): Use comp_unit_maybe_decode_line_info.
64         (reverse_funcinfo_list, reverse_varinfo_list, comp_unit_hash_info,
65         info_hash_lookup_funcinfo, info_hash_lookup_varinfo,
66         stash_maybe_update_info_hash_table, stash_verify_info_hash_table,
67         stash_maybe_enable_info_hash_tables, stash_find_line_fast): New
68         functions. Make use of info hash tables to speed up
69         bfd_dwarf2_find_line.
70         (find_line): Use hash table for faster lookup if it is turned on.
71         Also add code to maintain bi-directional link in comp units.
72
73 2007-07-25  Michael Snyder  <msnyder@access-company.com>
74
75         * coffgen.c (_bfd_coff_get_external_symbols): Nothing to be done
76         if size == 0; return and avoid possible null pointer issues.
77
78 2007-07-25  Alan Modra  <amodra@bigpond.net.au>
79
80         * linker.c (generic_link_add_symbol_list): Warning fix.
81
82 2007-07-24  Michael Snyder  <msnyder@access-company.com>
83
84         * opncls.c (bfd_make_writable): Check return from bfd_malloc.
85
86         * elflink.c (bfd_elf_final_link): Avoid redundant frees -- return
87         on bfd_malloc error rather than goto error_return.
88
89 2007-07-24  Alan Modra  <amodra@bigpond.net.au>
90
91         * elflink.c (_bfd_elf_link_just_syms, merge_sections_remove_hook,
92         _bfd_elf_merge_sections, _bfd_elf_link_hash_newfunc,
93         _bfd_elf_link_hash_copy_indirect, _bfd_elf_link_hash_hide_symbol,
94         _bfd_elf_link_hash_table_init, _bfd_elf_link_hash_table_create,
95         bfd_elf_set_dt_needed_name, bfd_elf_get_dyn_lib_class,
96         bfd_elf_set_dyn_lib_class, bfd_elf_get_needed_list,
97         bfd_elf_get_runpath_list, bfd_elf_get_dt_soname,
98         bfd_elf_get_bfd_needed_list, struct elf_symbuf_symbol,
99         struct elf_symbuf_head, struct elf_symbol, elf_sort_elf_symbol,
100         elf_sym_name_compare, elf_create_symbuf,
101         bfd_elf_match_symbols_in_sections,
102         _bfd_elf_match_sections_by_type): Move to here..
103         * elf.c: ..from here.
104
105 2007-07-23  Richard Sandiford  <richard@codesourcery.com>
106
107         * elflink.c (_bfd_elf_fix_symbol_flags): Only assert the type
108         of weakdef->root.type if weakdef has no regular definition.
109
110 2007-07-22  Adam Nemet  <anemet@caviumnetworks.com>
111
112         * elfxx-mips.c (struct mips_elf_link_hash_table): Add new field
113         small_data_overflow_reported.
114         (_bfd_mips_elf_link_hash_table_create): Initialize it.
115         (_bfd_mips_elf_relocate_section) <bfd_reloc_overflow>: Report
116         small-data section overflow.
117
118 2007-07-19  Doug Kwan  <dougkwan@google.com>
119
120         PR binutils/4797
121         * dwarf2.c: (find_line) Do not dereference functionname_ptr if
122         do_line is true.
123
124 2007-07-18  Bob Wilson  <bob.wilson@acm.org>
125
126         * elf32-xtensa.c (xtensa_callback_required_dependence): Ignore
127         non-ELF sections.
128
129 2007-07-18  Bob Wilson  <bob.wilson@acm.org>
130
131         * elf32-xtensa.c (elf_xtensa_finish_dynamic_sections): Get section
132         vma and size for dynamic tags from the output sections.
133
134 2007-07-18  Alan Modra  <amodra@bigpond.net.au>
135
136         * elf-bfd.h (struct sym_sec_cache): Delete "sec".  Add "shndx".
137         * elf.c (bfd_section_from_r_symndx): Don't cache bfd section of
138         symbol.  Instead cache ELF section index.  Remove redundant
139         checks of st_shndx.
140
141 2007-07-15  Mike Frysinger  <vapier@gentoo.org>
142
143         * trad-core.c (NBPG): If not defined, set to getpagesize().
144
145 2007-07-13  Roland McGrath  <roland@redhat.com>
146
147         * elf-bfd.h (struct elf_obj_tdata): Revert last change.
148         Add after_write_object_contents, after_write_object_contents_info.
149         * elf.c (_bfd_elf_write_object_contents): Revert last change.
150         Instead, call after_write_object_contents if set.
151
152 2007-07-12  Kai Tietz   <kai.tietz@onevision.com>
153
154         * bfd-in.h: (BFD_HOST_64BIT_LONG_LONG): New.
155         (BFD_HOSTPTR_T): Host pointer type for casting a
156         pointer to an integer type.
157         (bfd_hostptr_t): The typedef of BFD_HOSTPTR_T.
158         (sprintf_vma, fprintf_vma): Add support for long long prints.
159         * bfd-in2.h: Regenerate.
160         * configure.in: (BFD_HOST_64BIT_LONG_LONG): New.
161         (BFD_HOSTPTR_T): Host pointer type for casting a
162         pointer to an integer type. Default is "unsigned long".
163         (AC_CHECK_SIZEOF(void *)): New.
164         (host64): Set it if the pointer size is 8.
165         * configure: Regenerate.
166         * config.in: Add macro SIZEOF_VOID_P.
167         * coffcode.h: Replace host ptr type assuming "long" with
168         bfd_hostptr_t type.
169         * coffgen.c: Likewise.
170         * elf-eh-frame.c: Likewise.
171         * peicode.h: Likewise.
172
173 2007-07-10  H.J. Lu  <hongjiu.lu@intel.com>
174
175         * Makefile.in: Regenerated.
176
177 2007-07-10  H.J. Lu  <hongjiu.lu@intel.com>
178
179         PR binutils/4756
180         * simple.c (bfd_simple_get_relocated_section_content): Don't
181         apply relocation on executable and shared library.
182
183 2007-07-10  Nathan Sidwell  <nathan@codesourcery.com>
184
185         * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Don't eliminate
186         copy relocs on vxworks.
187
188 2007-07-10  Alan Modra  <amodra@bigpond.net.au>
189
190         * elf32-arm.c (elf32_arm_size_info): Init checksum_contents field.
191         * elf64-alpha.c (alpha_elf_size_info): Likewise.
192         * elf64-hppa.c (hppa64_elf_size_info): Likewise.
193         * elf64-mips.c (mips_elf64_size_info): Likewise.
194         * elf64-s390.c (s390_elf64_size_info): Likewise.
195         * elf64-sparc.c (elf64_sparc_size_info): Likewise.
196
197 2007-07-09  H.J. Lu  <hongjiu.lu@intel.com>
198
199         * elflink.c (bfd_elf_record_link_assignment): Handle indirect
200         symbol.
201         (_bfd_elf_merge_symbol): Properly update normal symbol when
202         overriding the versioned symbol from a dynamic library.
203
204 2007-07-09  Roland McGrath  <roland@redhat.com>
205
206         * elf-bfd.h (struct elf_obj_tdata): Add members
207         emit_note_gnu_build_id and note_gnu_build_id_sec.
208         * elf.c (_bfd_id_note_section_size): New global function.
209         (read_hex, _bfd_elf_write_build_id_section): New static functions.
210         (_bfd_elf_write_object_contents): Call _bfd_elf_write_build_id_section
211         if emit_note_gnu_build_id is set.
212         * Makefile.am (elf.lo): Update dependencies.
213
214         * elf-bfd.h (struct elf_size_info): Add checksum_contents hook.
215         (bfd_elf32_checksum_contents, bfd_elf64_checksum_contents): Declare.
216         * elfcode.h (elf_checksum_contents): New macro and function.
217         (NAME(_bfd_elf,size_info)): Initialize checksum_contents hook.
218
219 2007-07-06  Michael Snyder  <msnyder@access-company.com>
220
221         * elflink.c (elf_link_add_object_symbols): Return via
222         error_free_vers on "notice" failure.
223
224 2007-07-04  H.J. Lu  <hongjiu.lu@intel.com>
225
226         * peicode.h (pe_bfd_object_p): Don't check PE vs. EFI target
227         if arch is unknown.
228
229 2007-07-04  Nick Clifton  <nickc@redhat.com>
230
231         Import this patch from an internal tree:
232
233         2001-07-17  Richard Henderson  <rth@redhat.com>
234
235         * elf32-mep.c (mep_final_link_relocate) [R_MEP_HI16S]: Correctly
236         compensate for high bit set in R_MEP_LOW16.
237
238 2007-07-03  Joseph Myers  <joseph@codesourcery.com>
239
240         * elf32-arm.c (elf32_arm_merge_eabi_attributes): Copy type from
241         input attributes if value has been copied.
242
243 2007-07-03  Nick Clifton  <nickc@redhat.com>
244
245         * COPYING: Replace with GPLv3 text.
246         * aix386-core.c: Update copyright notice to refer to GPLv3.
247         * aix5ppc-core.c, aout0.c, aout32.c, aout64.c, aout-adobe.c,
248         aout-arm.c, aout-cris.c, aoutf1.h, aout-ns32k.c, aout-sparcle.c,
249         aout-target.h, aout-tic30.c, aoutx.h, archive64.c, archive.c,
250         archures.c, armnetbsd.c, bfd.c, bfd-in.h, bfdio.c, bfdwin.c,
251         binary.c, bout.c, cache.c, cf-i386lynx.c, cf-sparclynx.c,
252         cisco-core.c, coff64-rs6000.c, coff-alpha.c, coff-apollo.c,
253         coff-arm.c, coff-aux.c, coffcode.h, coffgen.c, coff-go32.c,
254         coff-h8300.c, coff-h8500.c, coff-i386.c, coff-i860.c, coff-i960.c,
255         coff-ia64.c, cofflink.c, coff-m68k.c, coff-m88k.c, coff-maxq.c,
256         coff-mcore.c, coff-mips.c, coff-or32.c, coff-pmac.c, coff-ppc.c,
257         coff-rs6000.c, coff-sh.c, coff-sparc.c, coff-stgo32.c,
258         coff-svm68k.c, coffswap.h, coff-tic30.c, coff-tic4x.c,
259         coff-tic54x.c, coff-tic80.c, coff-u68k.c, coff-w65.c,
260         coff-we32k.c, coff-x86_64.c, coff-z80.c, coff-z8k.c, corefile.c,
261         cpu-alpha.c, cpu-arc.c, cpu-arm.c, cpu-avr.c, cpu-bfin.c,
262         cpu-cr16.c, cpu-cr16c.c, cpu-cris.c, cpu-crx.c, cpu-d10v.c,
263         cpu-d30v.c, cpu-dlx.c, cpu-fr30.c, cpu-frv.c, cpu-h8300.c,
264         cpu-h8500.c, cpu-hppa.c, cpu-i370.c, cpu-i386.c, cpu-i860.c,
265         cpu-i960.c, cpu-ia64.c, cpu-ia64-opc.c, cpu-ip2k.c, cpu-iq2000.c,
266         cpu-m10200.c, cpu-m10300.c, cpu-m32c.c, cpu-m32r.c, cpu-m68hc11.c,
267         cpu-m68hc12.c, cpu-m68k.c, cpu-m88k.c, cpu-maxq.c, cpu-mcore.c,
268         cpu-mep.c, cpu-mips.c, cpu-mmix.c, cpu-msp430.c, cpu-mt.c,
269         cpu-ns32k.c, cpu-openrisc.c, cpu-or32.c, cpu-pdp11.c, cpu-pj.c,
270         cpu-powerpc.c, cpu-rs6000.c, cpu-s390.c, cpu-score.c, cpu-sh.c,
271         cpu-sparc.c, cpu-spu.c, cpu-tic30.c, cpu-tic4x.c, cpu-tic54x.c,
272         cpu-tic80.c, cpu-v850.c, cpu-vax.c, cpu-w65.c, cpu-we32k.c,
273         cpu-xc16x.c, cpu-xstormy16.c, cpu-xtensa.c, cpu-z80.c, cpu-z8k.c,
274         demo64.c, doc/chew.c, dwarf1.c, dwarf2.c, ecoff.c, ecofflink.c,
275         ecoffswap.h, efi-app-ia32.c, efi-app-ia64.c, efi-app-x86_64.c,
276         elf32-am33lin.c, elf32-arc.c, elf32-arm.c, elf32-avr.c,
277         elf32-avr.h, elf32-bfin.c, elf32.c, elf32-cr16.c, elf32-cr16c.c,
278         elf32-cris.c, elf32-crx.c, elf32-d10v.c, elf32-d30v.c,
279         elf32-dlx.c, elf32-fr30.c, elf32-frv.c, elf32-gen.c,
280         elf32-h8300.c, elf32-hppa.c, elf32-hppa.h, elf32-i370.c,
281         elf32-i386.c, elf32-i860.c, elf32-i960.c, elf32-ip2k.c,
282         elf32-iq2000.c, elf32-m32c.c, elf32-m32r.c, elf32-m68hc11.c,
283         elf32-m68hc12.c, elf32-m68hc1x.c, elf32-m68hc1x.h, elf32-m68k.c,
284         elf32-m88k.c, elf32-mcore.c, elf32-mep.c, elf32-mips.c,
285         elf32-msp430.c, elf32-mt.c, elf32-openrisc.c, elf32-or32.c,
286         elf32-pj.c, elf32-ppc.c, elf32-ppc.h, elf32-s390.c, elf32-score.c,
287         elf32-sh64.c, elf32-sh64-com.c, elf32-sh64.h, elf32-sh.c,
288         elf32-sh-symbian.c, elf32-sparc.c, elf32-spu.c, elf32-spu.h,
289         elf32-v850.c, elf32-vax.c, elf32-xc16x.c, elf32-xstormy16.c,
290         elf32-xtensa.c, elf64-alpha.c, elf64.c, elf64-gen.c, elf64-hppa.c,
291         elf64-hppa.h, elf64-mips.c, elf64-mmix.c, elf64-ppc.c,
292         elf64-ppc.h, elf64-s390.c, elf64-sh64.c, elf64-sparc.c,
293         elf64-x86-64.c, elf-attrs.c, elf-bfd.h, elf.c, elfcode.h,
294         elfcore.h, elf-eh-frame.c, elf-hppa.h, elflink.c, elf-m10200.c,
295         elf-m10300.c, elfn32-mips.c, elf-strtab.c, elf-vxworks.c,
296         elf-vxworks.h, elfxx-ia64.c, elfxx-mips.c, elfxx-mips.h,
297         elfxx-sparc.c, elfxx-sparc.h, elfxx-target.h, epoc-pe-arm.c,
298         epoc-pei-arm.c, format.c, freebsd.h, gen-aout.c, genlink.h,
299         hash.c, host-aout.c, hosts/alphavms.h, hp300bsd.c, hp300hpux.c,
300         hppabsd-core.c, hpux-core.c, i386aout.c, i386bsd.c, i386dynix.c,
301         i386freebsd.c, i386linux.c, i386lynx.c, i386mach3.c, i386msdos.c,
302         i386netbsd.c, i386os9k.c, ieee.c, ihex.c, init.c, irix-core.c,
303         libaout.h, libbfd.c, libbfd-in.h, libcoff-in.h, libecoff.h,
304         libhppa.h, libieee.h, libnlm.h, liboasys.h, libpei.h, libxcoff.h,
305         linker.c, lynx-core.c, m68k4knetbsd.c, m68klinux.c, m68knetbsd.c,
306         m88kmach3.c, m88kopenbsd.c, mach-o.c, mach-o.h, mach-o-target.c,
307         mep-relocs.pl, merge.c, mipsbsd.c, mmo.c, netbsd-core.c, netbsd.h,
308         newsos3.c, nlm32-alpha.c, nlm32.c, nlm32-i386.c, nlm32-ppc.c,
309         nlm32-sparc.c, nlm64.c, nlm.c, nlmcode.h, nlmswap.h, nlm-target.h,
310         ns32k.h, ns32knetbsd.c, oasys.c, opncls.c, osf-core.c,
311         pc532-mach.c, pdp11.c, pe-arm.c, pe-arm-wince.c, pef.c, pef.h,
312         pef-traceback.h, pe-i386.c, pei-arm.c, pei-arm-wince.c, peicode.h,
313         pei-i386.c, pei-mcore.c, pei-mips.c, pei-ppc.c, pei-sh.c,
314         pei-x86_64.c, pe-mcore.c, pe-mips.c, pe-ppc.c, pe-sh.c,
315         pe-x86_64.c, peXXigen.c, ppcboot.c, ptrace-core.c, reloc16.c,
316         reloc.c, riscix.c, rs6000-core.c, sco5-core.c, section.c,
317         simple.c, som.c, som.h, sparclinux.c, sparclynx.c, sparcnetbsd.c,
318         srec.c, stabs.c, stab-syms.c, stamp-h.in, sunos.c, syms.c,
319         sysdep.h, targets.c, targmatch.sed, tekhex.c, ticoff.h,
320         trad-core.c, vax1knetbsd.c, vaxbsd.c, vaxnetbsd.c, versados.c,
321         vms.c, vms-gsd.c, vms.h, vms-hdr.c, vms-misc.c, vms-tir.c,
322         xcofflink.c, xcoff-target.h, xsym.c, xsym.h, xtensa-isa.c,
323         xtensa-modules.c: Likewise.
324         * elf32-sh-relocs.h: Add copyright notice.
325         * hosts/alphalinux.h, hosts/decstation.h, hosts/delta68.h,
326         hosts/dpx2.h, hosts/hp300bsd.h, hosts/i386bsd.h,
327         hosts/i386linux.h, hosts/i386mach3.h, hosts/i386sco.h,
328         hosts/i860mach3.h, hosts/m68kaux.h, hosts/m68klinux.h,
329         hosts/m88kmach3.h, hosts/mipsbsd.h, hosts/mipsmach3.h,
330         hosts/news.h, hosts/news-mips.h, hosts/pc532mach.h,
331         hosts/riscos.h, hosts/symmetry.h, hosts/tahoe.h, hosts/vaxbsd.h,
332         hosts/vaxlinux.h, hosts/vaxult2.h, hosts/vaxult.h: Likewise.
333         * bfd-in2.h, libbfd.h, libcoff.h: Regenerate.
334
335 2007-07-02  Joseph Myers  <joseph@codesourcery.com>
336
337         * elfxx-mips.c (mips_elf_calculate_relocation): Handle
338         R_MIPS_TLS_DTPREL32 and R_MIPS_TLS_DTPREL64.
339         * elf64-mips.c (mips_elf64_howto_table_rela): Support
340         R_MIPS_TLS_DTPREL64.
341
342 2007-07-02  Alan Modra  <amodra@bigpond.net.au>
343
344         * Makefile.am: Run "make dep-am".
345         * Makefile.in: Regenerate.
346         * aclocal.m4: Regenerate.
347         * config.in: Regenerate.
348         * po/SRC-POTFILES.in: Regenerate.
349         * po/bfd.pot: Regenerate.
350
351 2007-07-02  Alan Modra  <amodra@bigpond.net.au>
352
353         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Tidy
354         symsec != NULL tests.
355
356 2007-07-02  Alan Modra  <amodra@bigpond.net.au>
357
358         PR 4712
359         * elf.c (assign_file_positions_for_load_sections): Adjust lma
360         by p_vaddr_offset.
361
362 2007-06-30  H.J. Lu  <hongjiu.lu@intel.com>
363
364         * aclocal.m4: Regenerated.
365         * Makefile.in: Likewise.
366
367 2007-06-29  Joseph Myers  <joseph@codesourcery.com>
368
369         * elf32-ppc.c (ppc_elf_merge_obj_attributes): New.
370         (ppc_elf_merge_private_bfd_data): Call it.
371
372 2007-06-29  Joseph Myers  <joseph@codesourcery.com>
373
374         * elfxx-mips.c (mips_elf_merge_obj_attributes): New.
375         (_bfd_mips_elf_merge_private_bfd_data): Call it.
376
377 2007-06-29  Joseph Myers  <joseph@codesourcery.com>
378
379         * elf-attrs.c: New.
380         * Makefile.am (BFD32_BACKENDS): Add elf-attrs.lo.
381         (BFD32_BACKENDS_CFILES): Add elf-attrs.c.
382         (elf-attrs.lo): Generate dependencies.
383         * Makefile.in: Regenerate.
384         * configure.in (elf): Add elf-attrs.lo.
385         * configure: Regenerate.
386         * elf-bfd.h (struct elf_backend_data): Add entries for object
387         attributes.
388         (NUM_KNOWN_OBJ_ATTRIBUTES, obj_attribute, obj_attribute_list,
389         OBJ_ATTR_PROC, OBJ_ATTR_GNU, OBJ_ATTR_FIRST, OBJ_ATTR_LAST,
390         Tag_NULL, Tag_File, Tag_Section, Tag_Symbol, Tag_compatibility):
391         New.
392         (struct elf_obj_tdata): Add entries for object attributes.
393         (elf_known_obj_attributes, elf_other_obj_attributes,
394         elf_known_obj_attributes_proc, elf_other_obj_attributes_proc):
395         New.
396         (bfd_elf_obj_attr_size, bfd_elf_set_obj_attr_contents,
397         bfd_elf_get_obj_attr_int, bfd_elf_add_obj_attr_int,
398         bfd_elf_add_proc_attr_int, bfd_elf_add_obj_attr_string,
399         bfd_elf_add_proc_attr_string, bfd_elf_add_obj_attr_compat,
400         bfd_elf_add_proc_attr_compat, _bfd_elf_attr_strdup,
401         _bfd_elf_copy_obj_attributes, _bfd_elf_obj_attrs_arg_type,
402         _bfd_elf_parse_attributes, _bfd_elf_merge_object_attributes): New.
403         * elf.c (_bfd_elf_copy_private_bfd_data): Copy object attributes.
404         (bfd_section_from_shdr): Handle attributes sections.
405         * elflink.c (bfd_elf_final_link): Handle attributes sections.
406         * elfxx-target.h (elf_backend_obj_attrs_vendor,
407         elf_backend_obj_attrs_section, elf_backend_obj_attrs_arg_type,
408         elf_backend_obj_attrs_section_type): New.
409         (elfNN_bed): Update.
410         * elf32-arm.c (NUM_KNOWN_ATTRIBUTES, aeabi_attribute,
411         aeabi_attribute_list): Remove.
412         (struct elf32_arm_obj_tdata): Remove object attributes fields.
413         (check_use_blx, bfd_elf32_arm_set_vfp11_fix, using_thumb2,
414         elf32_arm_copy_private_bfd_data, elf32_arm_merge_eabi_attributes):
415         Update for new object attributes interfaces.
416         (uleb128_size, is_default_attr, eabi_attr_size,
417         elf32_arm_eabi_attr_size, write_uleb128, write_eabi_attribute,
418         elf32_arm_set_eabi_attr_contents, elf32_arm_bfd_final_link,
419         elf32_arm_new_eabi_attr, elf32_arm_get_eabi_attr_int,
420         elf32_arm_add_eabi_attr_int, attr_strdup,
421         elf32_arm_add_eabi_attr_string, elf32_arm_add_eabi_attr_compat,
422         copy_eabi_attributes, elf32_arm_parse_attributes): Remove.  Moved
423         to generic code in elf-attrs.c.
424         (elf32_arm_obj_attrs_arg_type): New.
425         (elf32_arm_fake_sections): Do not handle .ARM.attributes.
426         (elf32_arm_section_from_shdr): Do not handle SHT_ARM_ATTRIBUTES.
427         (bfd_elf32_bfd_final_link): Remove.
428         (elf_backend_obj_attrs_vendor, elf_backend_obj_attrs_section,
429         elf_backend_obj_attrs_arg_type,
430         elf_backend_obj_attrs_section_type): New.
431         * elf32-bfin.c (bfin_elf_copy_private_bfd_data): Copy object
432         attributes.
433         * elf32-frv.c (frv_elf_copy_private_bfd_data): Likewise.
434         * elf32-iq2000.c (iq2000_elf_copy_private_bfd_data): Likewise.
435         * elf32-mep.c (mep_elf_copy_private_bfd_data): Likewise.
436         * elf32-mt.c (mt_elf_copy_private_bfd_data): Likewise.
437         * elf32-sh.c (sh_elf_copy_private_data): Likewise.
438         * elf64-sh64.c (sh_elf64_copy_private_data_internal): Likewise.
439
440 2007-06-29  Paul Brook  <paul@codesourcery.com>
441
442         * elf32-arm.c (bfd_elf32_arm_process_before_allocation): Suppress
443         call veneers for call relocations against undefined symbols.
444         (elf32_arm_final_link_relocate): Turn call to undefined symbol
445         into a jump to the next instruction.
446
447 2007-06-29  Michael Snyder  <msnyder@svkmacdonelllnx>
448
449         * bfd.c (bfd_demangle): Plug memory leak (Coverity).
450
451 2007-06-29  M R Swami Reddy  <MR.Swami.Reddy@nsc.com>
452
453         * Makefile.am: Add cr16 related entry
454         * Makefile.in: Regenerate
455         * archures.c: Add bfd_cr16_arch
456         * bfd-in2.h: Regenerate
457         * config.bfd: Add cr16-elf
458         * configure.in: Add bfd_elf32_cr16_vec
459         * configure: Regenerate.
460         * targets.c: Added cr16 related information
461         * cpu-cr16.c: New file.
462         * elf32-cr16.c: New file.
463         * reloc.c: Added cr16 relocs.
464
465 2007-06-29  Alan Modra  <amodra@bigpond.net.au>
466
467         * elflink.c (_bfd_elf_link_assign_sym_version): Improve error
468         message for undefined version nodes.
469         (elf_gc_sweep): Don't warn when zero size sections are
470         removed.
471
472 2007-06-29  Nathan Froyd  <froydnj@codesourcery.com>
473
474         * elf32-ppc.c (ppc_elf_info_to_howto): Check for invalid relocation
475         types.
476
477 2007-06-29  Alan Modra  <amodra@bigpond.net.au>
478
479         * elf32-spu.c (spu_elf_fake_sections): New function.
480         (elf_backend_fake_sections): Define.
481
482 2007-06-29  Alan Modra  <amodra@bigpond.net.au>
483
484         * elf.c (assign_file_positions_for_load_sections): Use elf
485         section header sh_size rather than bfd section size, simplifying
486         .tbss handling.
487
488 2007-06-29  Alan Modra  <amodra@bigpond.net.au>
489
490         PR ld/4701
491         * elf.c (assign_file_positions_for_load_sections): Ensure bss
492         segments meet gABI alignment requirements.  Don't allocate
493         file space for bss sections in a segment also containing file
494         or program headers.
495
496 2007-06-27  Alan Modra  <amodra@bigpond.net.au>
497
498         * bfd.c (struct bfd): Rename "next" to "archive_next".
499         * archive.c: Rename uses throughout file.
500         * archive64.c: Likewise.
501         * coff-rs6000.c: Likewise.
502         * ecoff.c: Likewise.
503         * som.c: Likewise.
504         * bfd-in2.h: Regenerate.
505
506         * elf32-ppc.c (ppc_elf_select_plt_layout): Properly iterate over
507         input bfds.
508         * elf32-spu.c (spu_elf_create_sections): Likewise.
509
510 2007-06-26  H.J. Lu  <hongjiu.lu@intel.com>
511
512         * dwarf2.c (find_line): New.  Contains the duplicated code from:
513         (_bfd_dwarf2_find_nearest_line): Use it.
514         (_bfd_dwarf2_find_line): Use it.
515
516 2007-06-26  Joseph Myers  <joseph@codesourcery.com>
517
518         * elf32-arm.c (copy_eabi_attributes): Copy type of attributes.
519
520 2007-06-25  Richard Sandiford  <richard@codesourcery.com>
521
522         * elfxx-mips.c (mips_elf_calculate_relocation): Allow local stubs
523         to be used for calls from MIPS16 code.
524
525 2007-06-23  Andreas Schwab  <schwab@suse.de>
526
527         * configure.in (--with-separate-debug-dir): New option.
528         * configure: Regenerate.
529         * Makefile.am (dwarf2.lo): Add rule to pass DEBUGDIR.
530         * Makefile.in: Regenerate.
531         * dwarf2.c (_bfd_dwarf2_find_nearest_line): Pass DEBUGDIR to
532         bfd_follow_gnu_debuglink.
533         (_bfd_dwarf2_find_line): Likewise.
534
535 2007-06-22  Nick Clifton  <nickc@redhat.com>
536
537         * dwarf2.c: Add support for reading in debug information via a
538         .gnu_debuglink section:
539         (struct dwarf2_debug): Add bfd field to record the bfd containing
540         the debug info.
541         (parse_comp_unit): Remove ABFD parameter.  Instead use the bfd
542         field in the dwarf2_debug structure.
543         (_bfd_dwarf2_find_nearest_line): If a debug info section could not
544         be found in the current bfd call bfd_follow_gnu_debuglink to see
545         if another file contains the debug information.  If it does, open
546         it and continue.
547         (_bfd_dwarf2_find_line): Likewise.
548
549 2007-06-19  H.J. Lu  <hongjiu.lu@intel.com>
550
551         PR ld/4590
552         * elfxx-ia64.c (sort_dyn_sym_info): Keep the valid got_offset
553         when removing duplicated entries.
554         (get_dyn_sym_info): Initialize the got_offset field to -1.
555         Update call to sort_dyn_sym_info.
556         (elfNN_ia64_relocate_section): Call sort_dyn_sym_info to sort
557         array of addend and remove duplicates.
558
559 2007-06-18  H.J. Lu  <hongjiu.lu@intel.com>
560
561         * libpei.h (_bfd_XXi_final_link_postscript): Remove
562         duplication.
563         (bfd_target_pei_p): New.
564         (bfd_target_pei_arch): New
565         (bfd_target_efi_p): Likewise.
566         (bfd_target_efi_arch): New
567         (bfd_pe_executable_p): Use bfd_target_pei_p and
568         bfd_target_efi_p.
569
570         * peicode.h (arch_type): New enum.
571         (pe_arch): New function.
572         (pe_bfd_object_p): Don't match PE/EFI target with EFI/PE file
573         if there is an EFI/PE target.
574
575 2007-06-14  H.J. Lu  <hongjiu.lu@intel.com>
576
577         * Makefile.am (ACLOCAL_AMFLAGS): Add -I . -I ../config.
578
579         * acinclude.m4: Don't include m4 files. Remove libtool
580         kludge.
581
582         * Makefile.in: Regenerated.
583         * aclocal.m4: Likewise.
584         * configure: Likewise.
585
586 2007-06-11  Sterling Augustine  <sterling@tensilica.com>
587             Bob Wilson  <bob.wilson@acm.org>
588
589         * elf32-xtensa.c (extend_ebb_bounds_forward): Use renamed
590         XTENSA_PROP_NO_TRANSFORM flag instead of XTENSA_PROP_INSN_NO_TRANSFORM.
591         (extend_ebb_bounds_backward, compute_text_actions): Likewise.
592         (compute_ebb_proposed_actions, coalesce_shared_literal): Likewise.
593         (xtensa_get_property_predef_flags): Likewise.
594         (compute_removed_literals): Pass new arguments to is_removable_literal.
595         (is_removable_literal): Add sec, prop_table and ptblsize arguments.
596         Do not remove literal if the NO_TRANSFORM property flag is set.
597
598 2007-05-31  Richard Sandiford  <rsandifo@nildram.co.uk>
599
600         * elfxx-mips.c (mips_elf_initialize_tls_index): When processing a
601         type (3) single-GOT entry, read tls_type from the hash table entry
602         rather than the GOT entry.
603
604 2007-06-01  Alan Modra  <amodra@bigpond.net.au>
605
606         * simple.c (bfd_simple_get_relocated_section_contents): Init
607         input_bfds_tail.
608
609 2007-05-30  Alan Modra  <amodra@bigpond.net.au>
610
611         * elf.c (elf_fake_sections): Adjust test for SHT_NOBITS sections
612         created by objcopy --only-keep-debug.
613         (_bfd_elf_init_private_section_data): Only change elf_section_type
614         if it is SHT_NULL.
615
616         * elf.c (assign_file_positions_for_load_sections): Correct sh_type
617         to SHT_NOBITS earlier.  Base actions in rest of function on sh_type
618         and sh_flags instead of bfd section flags.  Delete voff and code
619         keeping nobits segments aligned.
620
621 2007-05-25  Eric Christopher  <echristo@apple.com>
622
623         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame):
624         Check that sym_sec isn't NULL before accessing.
625
626 2007-05-24  Steve Ellcey  <sje@cup.hp.com>
627
628         * Makefile.in: Regnerate.
629         * configure: Regenerate.
630         * aclocal.m4: Regenerate.
631         * doc/Makefile.in: Regenerate.
632
633 2007-05-22  Paul Brook  <paul@codesourcery.com>
634
635         * elf32-arm.c (output_arch_syminfo): Replace plt_shndx and plt_offset
636         with sec and sec_shndx.
637         (elf32_arm_ouput_plt_map_sym): Use them.
638         (elf32_arm_output_arch_local_syms): Output mapping symbols for
639         interworking glue.
640
641 2007-05-18  Paul Brook  <paul@codesourcery.com>
642
643         * elf32-arm.c (ARM2THUMB_V5_STATIC_GLUE_SIZE): Define.
644         (a2t1v5_ldr_insn, a2t1v5_ldr_insn): New.
645         (record_arm_to_thumb_glue): Add v5t non-pic glue.
646         (elf32_arm_create_thumb_stub): Ditto.
647
648 2007-05-16  H.J. Lu  <hongjiu.lu@intel.com>
649             Alan Modra  <amodra@bigpond.net.au>
650
651         * elflink.c (_bfd_elf_adjust_dynamic_copy): Align dynamic bss
652         section to the minimum alignment.
653
654 2007-05-15  H.J. Lu  <hongjiu.lu@intel.com>
655             Alan Modra  <amodra@bigpond.net.au>
656
657         PR ld/4504
658         * elf-bfd.h (_bfd_elf_adjust_dynamic_copy): New.
659         * elflink.c (_bfd_elf_adjust_dynamic_copy): New.
660
661         * elf-m10300.c (_bfd_mn10300_elf_adjust_dynamic_symbol): Call
662         _bfd_elf_adjust_dynamic_copy to adjust for the copy in dynamic
663         bss section.
664         * elf32-arm.c (elf32_arm_adjust_dynamic_symbol): Likewise.
665         * elf32-cris.c (elf_cris_adjust_dynamic_symbol): Likewise.
666         * elf32-hppa.c (elf32_hppa_adjust_dynamic_symbol): Likewise.
667         * elf32-i370.c (i370_elf_adjust_dynamic_symbol): Likewise.
668         * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Likewise.
669         * elf32-m32r.c (m32r_elf_adjust_dynamic_symbol): Likewise.
670         * elf32-m68k.c (elf_m68k_adjust_dynamic_symbol): Likewise.
671         * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Likewise.
672         * elf32-s390.c (elf_s390_adjust_dynamic_symbol): Likewise.
673         * elf32-sh.c (sh_elf_adjust_dynamic_symbol): Likewise.
674         * elf32-vax.c (elf_vax_adjust_dynamic_symbol): Likewise.
675         * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Likewise.
676         * elf64-s390.c (elf_s390_adjust_dynamic_symbol): Likewise.
677         * elf64-sh64.c (sh64_elf64_adjust_dynamic_symbol): Likewise.
678         * elf64-x86-64.c (elf64_x86_64_adjust_dynamic_symbol): Likewise.
679         * elfxx-mips.c (_bfd_mips_vxworks_adjust_dynamic_symbol): Likewise.
680         * elfxx-sparc.c (_bfd_sparc_elf_adjust_dynamic_symbol): Likewise.
681
682 2007-05-15  Richard Sandiford  <richard@codesourcery.com>
683
684         * elfxx-mips.c (mips_elf_create_local_got_entry): Remove
685         input_section argument.  Create .rela.dyn relocations against
686         symbol 0 rather than the section symbol.
687         (mips_elf_local_got_index): Remove input_section argument.
688         Update call to mips_elf_create_local_got_entry.
689         (mips_elf_got_page, mips_elf_got16_entry): Likewise.
690         (mips_elf_calculate_relocation): Update calls to
691         mips_elf_local_got_index, mips_elf_got16_entry and mips_elf_got_page.
692
693 2007-05-15  Mark Shinwell  <shinwell@codesourcery.com>
694
695         * elf32-arm.c (elf32_arm_final_link_relocate): Correctly
696         handle the Thumb-2 JUMP19 relocation.
697
698 2007-05-15  Alan Modra  <amodra@bigpond.net.au>
699
700         PR 4479
701         * elf.c (elf_fake_sections): Don't allow backend to change
702         SHT_NOBITS if called for strip/objcopy --only-keep-debug.
703         * elfxx-mips.c (_bfd_mips_elf_fake_sections): Remove similar
704         fix from here.
705
706 2007-05-14  Alan Modra  <amodra@bigpond.net.au>
707
708         * elf.c (bfd_elf_string_from_elf_section): Return NULL on
709         invalid shstrndx.
710         (bfd_elf_get_str_section): Likewise.
711
712 2007-05-12  Alan Modra  <amodra@bigpond.net.au>
713
714         PR 4497
715         * elf-eh-frame.c (struct cie): Add "local_personality".  Make
716         "personality" a union.
717         (cie_eq): Compare local_personality too.  Adjust personality
718         comparison.
719         (_bfd_elf_discard_section_eh_frame): Check binding on personality
720         reloc sym to allow for bad symtab.  Use stashed local syms rather
721         than reading personality local sym.  Handle discarded sections.
722
723 2007-05-12  Alan Modra  <amodra@bigpond.net.au>
724
725         * elf32-spu.c (elf_howto_table): Add howto for R_SPU_ADDR16X.
726
727 2007-05-11  Alan Modra  <amodra@bigpond.net.au>
728
729         * elf32-ppc.h (ppc_elf_select_plt_layout): Update prototype.
730         (enum ppc_elf_plt_type): Move from..
731         * elf32-ppc.c: ..here.
732         (struct ppc_elf_obj_tdata): Add makes_plt_call and has_rel16.
733         (struct ppc_elf_link_hash_table): Reorder.  Add old_bfd.  Delete
734         can_use_new_plt.  Make is_vxworks a bitfield.
735         (ppc_elf_link_hash_table_create): Don't clear is_vxworks (again).
736         (ppc_elf_check_relocs): Update setting of reloc flags.  Set old_bfd.
737         (ppc_elf_select_plt_layout): Modify parameters.  Use bfd reloc
738         flags to better detect object files needing old bss-style plt.
739         Allow secure plt to be used without rel16 relocs being detected.
740         Warn if secure plt request cannot be allowed.
741
742 2007-05-11  Alan Modra  <amodra@bigpond.net.au>
743
744         * reloc.c (BFD_RELOC_SPU_PPU32, BFD_RELOC_SPU_PPU64): Define.
745         * elf-bfd.h (struct elf_backend_data): Change return type of
746         elf_backend_relocate_section to int.
747         * elf32-spu.c (elf_howto_table): Add howtos for R_SPU_PPU32 and
748         R_SPU_PPU64.
749         (spu_elf_bfd_to_reloc_type): Convert new relocs.
750         (spu_elf_count_relocs): New function.
751         (elf_backend_count_relocs): Define.
752         (spu_elf_relocate_section): Arrange to emit R_SPU_PPU32 and
753         R_SPU_PPU64 relocs.
754         * elflink.c (elf_link_input_bfd): Emit relocs if relocate_section
755         returns 2.
756         * bfd-in2.h: Regenerate.
757         * libbfd.h: Regenerate.
758
759 2007-05-10  Richard Sandiford  <richard@codesourcery.com>
760
761         * elf32-arm.c (elf32_arm_check_relocs): Don't create PLT entries
762         for R_ARM_ABS12 relocs.
763         (elf32_arm_finish_dynamic_symbol): Fix the loop that creates
764         non-shared VxWorks PLT entries.
765
766 2007-05-11  Alan Modra  <amodra@bigpond.net.au>
767
768         PR 4454
769         * elf-eh-frame.c (struct cie): Make "personality" a bfd_vma.
770         (_bfd_elf_discard_section_eh_frame): Handle local syms on
771         personality relocation.
772
773 2007-05-10  Richard Sandiford  <richard@codesourcery.com>
774
775         * elf.c (assign_file_positions_for_load_sections): Use p_memsz
776         rather than p_filesz to calculate the LMA of the end of a segment.
777
778 2007-05-10  Jakub Jelinek  <jakub@redhat.com>
779
780         * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Don't do copyreloc
781         processing if symbol is defined in the executable.
782
783 2007-05-10  Alexandre Oliva  <aoliva@redhat.com>
784
785         * elf32-frv.c (_frvfdpic_check_discarded_relocs): New.
786         (frvfdpic_elf_discard_info): New.
787         (elf_backend_discard_info): Define for FDPIC.
788
789 2007-05-09  Mark Shinwell  <shinwell@codesourcery.com>
790
791         * elf32-arm.c (bfd_elf32_arm_vfp11_erratum_scan): Don't
792         attempt to scan if the bfd doesn't correspond to an ELF image.
793         (bfd_elf32_arm_vfp11_fix_veneer_locations): Likewise.
794
795 2007-05-08  Alexandre Oliva  <aoliva@redhat.com>
796
797         * elf32-frv.c (elf32_frv_relocate_section): Discard dynamic relocs
798         for which _bfd_elf_section_offset returns -1.
799
800 2007-05-08  Alan Modra  <amodra@bigpond.net.au>
801
802         * elf32-spu.c (spu_elf_size_stubs): Use "void *" for psyms.
803         (mark_functions_via_relocs): Likewise.
804
805 2007-05-07  Alan Modra  <amodra@bigpond.net.au>
806
807         * elflink.c (bfd_elf_final_link): Correct reloc handling for
808         elf_backend_count_relocs.
809         (bfd_elf_discard_info): Print an error if we can't read syms.
810
811 2007-05-07  Alan Modra  <amodra@bigpond.net.au>
812
813         * elf32-spu.c (spu_elf_reloc_type_lookup): Return NULL on
814         invalid reloc code.
815         (spu_elf_gc_mark_hook, spu_elf_section_processing): Delete functions.
816         (elf_backend_gc_mark_hook, elf_backend_section_processing): Don't
817         define.
818
819 2007-05-07  Alan Modra  <amodra@bigpond.net.au>
820
821         * elf.c (assign_file_positions_for_load_sections): Don't check
822         core segment.
823
824 2007-05-04  H.J. Lu  <hongjiu.lu@intel.com>
825
826         * elflink.c (elf_link_sort_relocs): Return if both .rela.dyn
827         and .rel.dyn aren't present.
828
829 2007-05-04  Nick Clifton  <nickc@redhat.com>
830
831         * elflink.c (elf_link_sort_relocs): If both .rela.dyn and .rel.dyn
832         sections are present examine the indirect sections in an attempt
833         to compute the correct relocation size.  If there is any
834         ambiguity, produce an error and refuse to sort.
835
836 2007-05-03  Sandra Loosemore  <sandra@codesourcery.com>
837
838         * elf32-arm.c (allocate_dynrelocs): Fix typo in comment.
839
840 2007-05-03  Vincent Riviere  <vincent.riviere@freesbee.fr>
841             Nick Clifton  <nickc@redhat.com>
842
843         PR gas/3041
844         * aoutx.h (swap_std_reloc_out): Treat relocs against weak symbols
845         in the same way as relocs against external symbols.
846
847 2007-05-02  Alan Modra  <amodra@bigpond.net.au>
848
849         * elf.c (assign_file_positions_for_load_sections): Set sh_offset
850         here.  Set sh_type to SHT_NOBITS if we won't be allocating
851         file space.  Don't bump p_memsz for non-alloc sections.  Adjust
852         section-in-segment check.
853         (assign_file_positions_for_non_load_sections): Don't set sh_offset
854         here for sections that have already been handled above.
855
856 2007-04-30  Alan Modra  <amodra@bigpond.net.au>
857
858         * elf32-spu.c (struct spu_link_hash_table): Add stack_analysis
859         and emit_stack_syms bitfields.
860         (get_sym_h): Read all symbols if stack analysis will be done.
861         (spu_elf_create_sections): Add stack_analysis and emit_stack_syms
862         params, and stash in hash table.
863         (is_hint): Split off from..
864         (is_branch): ..here.  Adjust callers.
865         (spu_elf_size_stubs): Add stack_analysis param.  Arrange to read
866         and keep all syms.
867         (write_one_stub): Fix mem leak.
868         (find_function_stack_adjust): New function.
869         (sort_syms_syms, sort_syms_psecs): New vars.
870         (sort_syms): New function.
871         (struct call_info, struct function_info): New.
872         (struct spu_elf_stack_info): New.
873         (alloc_stack_info, maybe_insert_function, func_name): New functions.
874         (is_nop, insns_at_end, check_function_ranges): Likewise.
875         (find_function, insert_callee, mark_functions_via_relocs): Likewise.
876         (pasted_function, interesting_section, discover_functions): Likewise.
877         (mark_non_root, call_graph_traverse, build_call_tree): Likewise.
878         (sum_stack, spu_elf_stack_analysis, spu_elf_final_link): Likewise.
879         (bfd_elf32_bfd_final_link): Define.
880         * elf32-spu.h (struct _spu_elf_section_data): Add stack_info field.
881         (spu_elf_create_sections, spu_elf_size_stubs): Update prototypes.
882
883 2007-04-28  Sergey Rogozhkin  <rogozhkin@niisi.msk.ru>
884
885         * elfxx-mips.c (mips_elf_create_dynamic_relocation): Don't access
886         memory which we might not own.
887
888 2007-04-27  Bob Wilson  <bob.wilson@acm.org>
889
890         * elf32-xtensa.c (elf_xtensa_make_sym_local): Restore deleted function.
891         (elf_xtensa_hide_symbol, elf_backend_hide_symbol): Likewise.
892         (elf_xtensa_allocate_dynrelocs): Use elf_xtensa_make_sym_local.
893
894 2007-04-27  Bob Wilson  <bob.wilson@acm.org>
895
896         * elf32-xtensa.c (xtensa_read_table_entries): Step through table
897         contents and relocs in parallel.
898
899 2007-04-27  Bob Wilson  <bob.wilson@acm.org>
900
901         * elf32-xtensa.c (relax_property_section): Remove extra irel increment.
902
903 2007-04-27  Alan Modra  <amodra@bigpond.net.au>
904
905         * cpu-rs6000.c: Write Mimi's name in ASCII.
906         * coff-rs6000.c: Likewise.
907         * rs6000-core.c: Likewise.
908
909 2007-04-27  Alan Modra  <amodra@bigpond.net.au>
910
911         * sysdep.h: Include config.h first.
912         Many files: Include sysdep.h before bfd.h.
913         * Makefile.am: Run "make dep-am".
914         * Makefile.in: Regenerate.
915
916 2007-04-25  Alan Modra  <amodra@bigpond.net.au>
917
918         * sysdep.h: Revert last change.
919
920 2007-04-24  Nick Clifton  <nickc@redhat.com>
921
922         * coffcode.h (coff_slurp_reloc_table): Initialise dst.r_offset.
923         * coff-m68k.c (m68kcoff_rtype_to_howto): Initialize relent.howto.
924
925 2007-04-24  Alan Modra  <amodra@bigpond.net.au>
926
927         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Warn if
928         eh_frame_hdr table won't be created.
929
930 2007-04-24  Alan Modra  <amodra@bigpond.net.au>
931
932         * acinclude.m4: Include config/stdint.m4.
933         * configure.in: Invoke GCC_HEADER_STDINT.
934         * sysdep.h: Don't include ansidecl.h here.
935         * configure: Regenerate.
936         * config.in: Regenerate.
937         * Makefile.in: Regenerate.
938
939 2007-04-23  Nathan Sidwell  <nathan@codesourcery.com>
940
941         * archures.c (bfd_mach_mcf_isa_c, bfd_mach_mcf_isa_c_mac,
942         bfd_mach_mcf_isa_c_emac): New.
943         * elf32-m68k.c (ISAC_PLT_ENTRY_SIZE, elf_isac_plt0_entry,
944         elf_isac_plt_entry, elf_isac_plt_info): New.
945         (elf32_m68k_object_p): Add ISA_C.
946         (elf32_m68k_print_private_bfd_data): Print ISA_C.
947         (elf32_m68k_get_plt_info): Detect ISA_C.
948         * cpu-m68k.c (arch_info): Add ISAC.
949         (m68k_arch_features): Likewise,
950         (bfd_m68k_compatible): ISAs B & C are not compatible.
951
952 2007-04-21  Nick Clifton  <nickc@redhat.com>
953
954         * ecoff.c (_bfd_ecoff_write_armap): Initialise rehash.
955         (ecoff_link_add_archive_symbols): Likewise.
956         * coff-m68k.c (m68kcoff_common_addend_rtype_to_howto): Initialise
957         relent.howto.
958         * ieee.c (parse_int): Initialise x.
959         (must_parse_int): Initialise result.
960         (ieee_slurp_external_symbols): Initialise value.
961
962 2007-04-21  Alan Modra  <amodra@bigpond.net.au>
963
964         * config.bfd (spu-*-elf): Delete targ_selvecs.
965
966 2007-04-19  Nick Clifton  <nickc@redhat.com>
967
968         * coffcode.h (coff_rtype_to_howto): Initialise genrel.howto.
969
970 2007-04-19  Alan Modra  <amodra@bigpond.net.au>
971
972         * bfd.c (bfd_demangle): New function.
973         * Makefile.am: Run "make dep-am".
974         * Makefile.in: Regenerate.
975         * bfd-in2.h: Regenerate.
976
977 2007-04-18  Matthias Klose  <doko@ubuntu.com>
978
979         * Makefile.am (libbfd_la_LDFLAGS): Use bfd soversion.
980         (bfdver.h): Use the date in non-release builds for the soversion.
981         * Makefile.in: Regenerate.
982
983 2007-04-17  Paul Brook  <paul@codesourcery.com>
984
985         * elf.c (_bfd_elf_is_function_type): New function.
986         * elflink.c (_bfd_elf_merge_symbol): Use bed->is_function_type.
987         (_bfd_elf_dynamic_symbol_p, _bfd_elf_symbol_refs_local_p,
988         is_global_data_symbol_definition, elf_link_add_object_symbols): Ditto.
989         * elf-bfd.h (elf_backend_data): Add is_function_type.
990         (_bfd_elf_is_function_type): Add prototype.
991         * elfxx-target.h (elf_backend_is_function_type): Add default
992         definition.
993         (elfNN_bed): Add elf_backend_is_function_type.
994         * elf32-arm.c (elf32_arm_is_function_type): New function.
995         (elf_backend_is_function_type): Define.
996
997 2007-04-17  Daniel Jacobowitz  <dan@codesourcery.com>
998
999         * elfxx-mips.c (_bfd_mips_elf_size_dynamic_sections): Put
1000         DT_MIPS_RLD_MAP before DT_DEBUG again.
1001
1002 2007-04-14  Steve Ellcey  <sje@cup.hp.com>
1003
1004         * Makefile.am: Add ACLOCAL_AMFLAGS.
1005         * configure.in: Change macro call order.
1006         * Makefile.in: Regnerate.
1007         * doc/Makefile.in: Regenerate.
1008         * configure: Regenerate.
1009
1010 2007-04-14  Jakub Jelinek  <jakub@redhat.com>
1011
1012         * elflink.c (bfd_elf_final_link): Don't free symbuf for
1013         non-elf input bfds.
1014         (bfd_elf_size_dynamic_sections): Don't access elf_section_data
1015         for non-elf input bfds.
1016
1017 2007-04-12  Richard Sandiford  <richard@codesourcery.com>
1018
1019         * elfxx-mips.c (_bfd_mips_elf_size_dynamic_sections): Don't add
1020         DT_MIPS_RTLD_MAP for PIEs.
1021
1022 2007-04-12  Richard Sandiford  <richard@codesourcery.com>
1023
1024         * elfxx-mips.c (mips_elf_calculate_relocation): Set DT_TEXTREL
1025         when creating a __GOTT_BASE__ or __GOTT_INDEX__ relocation
1026         in a read-only section.
1027         (_bfd_mips_elf_check_relocs): Likewise.
1028
1029 2007-04-12  Bob Wilson  <bob.wilson@acm.org>
1030
1031         * elf32-xtensa.c (xtensa_is_insntable_section): New.
1032         (xtensa_is_proptable_section): New.
1033         (elf_xtensa_discard_info_for_section): Handle "full" .xt.prop property
1034         tables with 12-byte entries, as well as tables with 8-byte entries.
1035         Sort the relocations before examining them.
1036         (relax_property_section): Use xtensa_is_proptable_section and
1037         xtensa_is_littable_section.  Rewrite code for combining table entries
1038         to be more robust in case of unexpected relocations.  Do not set offset
1039         of unused relocations to less than zero.
1040         (xtensa_is_property_section): Use other functions instead of
1041         duplicating section name comparisons.
1042         (xtensa_is_littable_section): Use CONST_STRNEQ for ".gnu.linkonce.p.".
1043         (xtensa_get_property_predef_flags): Use xtensa_is_insntable_section.
1044
1045 2007-04-12  Bob Wilson  <bob.wilson@acm.org>
1046
1047         * elf32-xtensa.c (elf_xtensa_gc_mark_hook): Don't follow references
1048         from Xtensa property sections.
1049
1050 2007-04-12  Alan Modra  <amodra@bigpond.net.au>
1051
1052         * elf32-spu.c (needs_ovl_stub): Test that spu_elf_section_data
1053         is non-NULL before dereferencing.
1054
1055 2007-04-11  Nathan Sidwell  <nathan@codesourcery.com>
1056
1057         * elf-vxworks.c (elf_vxworks_emit_relocs): Remap weakdef PLT slot
1058         relocs too.
1059
1060 2007-04-10  Richard Henderson  <rth@redhat.com>
1061
1062         * elf64-alpha.c (struct alpha_elf_link_hash_table): Add relax_trip.
1063         (elf64_alpha_size_got_sections): Remove unused something_changed local.
1064         (elf64_alpha_size_plt_section): Return void.
1065         (elf64_alpha_size_rela_got_section): Likewise.
1066         (elf64_alpha_relax_section): Only regenerate got+plt if the
1067         relax_trip counter has changed.
1068
1069 2007-04-09  Daniel Jacobowitz  <dan@codesourcery.com>
1070
1071         * Makefile.am (bfdver.h): Do not generate doc/bfdver.texi.
1072         * doc/Makefile.am (DOCFILES): Add bfdver.texi.
1073         (bfdver.texi): New rule.
1074         * Makefile.in, doc/Makefile.in: Regenerated.
1075
1076 2007-04-03  Matt Thomas  <matt@netbsd.org>
1077
1078         * elf32-vax.c (elf_vax_relocate_section): Do not emit a PCREL reloc
1079         in a shared object if it is not in a CODE section or if it is against
1080         a section symbol.  This allows DWARF2 to use pcrel format.
1081
1082 2007-04-05  H.J. Lu  <hongjiu.lu@intel.com>
1083
1084         PR ld/4304
1085         * elflink.c (bfd_elf_final_link): Call einfo callback in
1086         bfd_link_info instead of _bfd_error_handler for DT_TEXTREL
1087         warning.
1088
1089 2007-04-05  Alan Modra  <amodra@bigpond.net.au>
1090
1091         * elf32-spu.c (spu_elf_output_symbol_hook): New function.
1092         (elf_backend_link_output_symbol_hook): Define.
1093
1094 2007-04-02  Nick Clifton  <nickc@redhat.com>
1095
1096         PR binutils/4292
1097         * bfd.c (bfd_fprintf_vma): Do not print addresses of 32-bit
1098         targets as 64-bit values, even if running on a 64-bit host.
1099         * coffgen.c (coff_print_symbol): Likewise.
1100
1101 2007-03-29  Nick Clifton  <nickc@redhat.com>
1102
1103         PR binutils/4110
1104         * elf.c (IS_VALID_GROUP_SECTION_HEADER): New macro.
1105         (setup_group): Use it.  Report corrupt group section headers.
1106         (bfd_section_from_shdr): Use new macro.  Replace constant 4 with
1107         GRP_ENTRY_SIZE.  Cope with NULLs in the group section table.
1108         (elf_fake_section): Replace constant 4 with GRP_ENTRY_SIZE.
1109
1110 2007-03-29  Alan Modra  <amodra@bigpond.net.au>
1111
1112         PR ld/4267
1113         * elflink.c (evaluate_complex_relocation_symbols): Use bfd_vma
1114         for rel->r_info values.
1115         (bfd_elf_perform_complex_relocation): Likewise.
1116         * elf32-ppc.c (allocate_dynrelocs): Set plt.offset to -1 for
1117         unused entries.  Don't clear plt.plist in loop.
1118
1119 2007-03-28  Richard Sandiford  <richard@codesourcery.com>
1120
1121         * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Remove append_rela.
1122         * elfxx-sparc.c (sparc_elf_append_rela_64, sparc_elf_append_rela_32):
1123         Merge into...
1124         (sparc_elf_append_rela): ...this new function.
1125         (SPARC_ELF_APPEND_RELA): Delete.
1126         (_bfd_sparc_elf_link_hash_table_create): Don't initialize
1127         the deleted append_rela field.
1128         (_bfd_sparc_elf_relocate_section): Use sparc_elf_append_rela
1129         instead of SPARC_ELF_APPEND_RELA.
1130         (_bfd_sparc_elf_finish_dynamic_symbol): Likewise.  Use the
1131         elf_size_info structure to find the size of a RELA entry and
1132         the associated swap-out function.
1133         (sparc64_finish_dyn, sparc64_finish_dyn): Merge into...
1134         (sparc_finish_dyn): ...this new function.
1135         (_bfd_sparc_elf_finish_dynamic_sections): Update calls accordingly.
1136
1137 2007-03-28  Richard Sandiford  <richard@codesourcery.com>
1138             Phil Edwards  <phil@codesourcery.com>
1139
1140         * doc/bfd.texinfo: Put the contents after the title page rather
1141         than at the end of the document.
1142
1143 2007-03-27  Andreas Schwab  <schwab@suse.de>
1144
1145         * elfxx-ia64.c (elf_backend_default_execstack): Define to 0.
1146
1147 2007-03-26  H.J. Lu  <hongjiu.lu@intel.com>
1148
1149         * configure: Regenerated.
1150
1151 2007-03-26  Alan Modra  <amodra@bigpond.net.au>
1152
1153         * elf32-spu.c (struct stubarr): Add stub_hash_table and err fields.
1154         (allocate_spuear_stubs): New function.
1155         (spu_elf_size_stubs): Call allocate_spuear_stubs.
1156
1157 2007-03-26  Alan Modra  <amodra@bigpond.net.au>
1158
1159         * aout-adobe.c (aout_32_bfd_reloc_name_lookup): Define.
1160         * aout-arm.c (MY_bfd_reloc_name_lookup): Define.
1161         (MY (bfd_reloc_name_lookup)): New function.
1162         * aout-ns32k.c (MY (bfd_reloc_name_lookup)): New function.
1163         * aout-target.h (NAME (aout, reloc_name_lookup)): Declare.
1164         (MY_bfd_reloc_name_lookup): Define.
1165         * aout-tic30.c (tic30_aout_reloc_name_lookup): New function.
1166         (MY_bfd_reloc_name_lookup): Define.
1167         * aoutx.h (NAME (aout, reloc_type_lookup)): Don't declare.
1168         (NAME (aout, reloc_name_lookup)): New function.
1169         * bout.c (b_out_bfd_reloc_name_lookup): New function.
1170         * coff-alpha.c (alpha_bfd_reloc_name_lookup): New function.
1171         (_bfd_ecoff_bfd_reloc_name_lookup): Define.
1172         * coff-arm.c (coff_arm_reloc_name_lookup): New function.
1173         (coff_bfd_reloc_name_lookup): Define.
1174         * coff-i386.c (coff_bfd_reloc_name_lookup): Define.
1175         (coff_i386_reloc_name_lookup): New function.
1176         * coff-i860.c (coff_i860_reloc_name_lookup): New function.
1177         (coff_bfd_reloc_name_lookup): Define.
1178         * coff-i960.c (coff_i960_reloc_name_lookup): New function.
1179         (coff_bfd_reloc_name_lookup): Define.
1180         * coff-m68k.c (m68k_reloc_name_lookup): New function.
1181         (coff_bfd_reloc_name_lookup): Define.
1182         * coff-maxq.c (maxq_reloc_name_lookup): New function.
1183         (coff_bfd_reloc_name_lookup): Define.
1184         * coff-mcore.c (mcore_coff_reloc_name_lookup): New function.
1185         (coff_bfd_reloc_name_lookup): Define.
1186         * coff-mips.c (mips_bfd_reloc_name_lookup): New function.
1187         (_bfd_ecoff_bfd_reloc_name_lookup): Define.
1188         * coff-ppc.c (ppc_coff_reloc_name_lookup): New function.
1189         (coff_bfd_reloc_name_lookup): Define.
1190         * coff-rs6000.c (coff_bfd_reloc_name_lookup): Define.
1191         (_bfd_xcoff_reloc_name_lookup): New function.
1192         (rs6000coff_vec, pmac_xcoff_vec): Init new field.
1193         * coff-sh.c (coff_bfd_reloc_name_lookup): Define.
1194         (sh_coff_reloc_name_lookup): New function.
1195         * coff-sparc.c (coff_sparc_reloc_name_lookup): New function.
1196         (coff_bfd_reloc_name_lookup): Define.
1197         * coff-tic30.c (coff_bfd_reloc_name_lookup): Define.
1198         (tic30_coff_reloc_name_lookup): New function.
1199         * coff-tic4x.c (coff_bfd_reloc_name_lookup): Define.
1200         (tic4x_coff_reloc_name_lookup): New function.
1201         * coff-tic54x.c (coff_bfd_reloc_name_lookup): Define.
1202         (tic54x_coff_reloc_name_lookup): New function.
1203         * coff-x86_64.c (coff_bfd_reloc_name_lookup): Define.
1204         (coff_amd64_reloc_name_lookup): New function.
1205         * coff-z80.c (coff_z80_reloc_name_lookup): New function.
1206         (coff_bfd_reloc_name_lookup): Define.
1207         * coff-z8k.c (coff_z8k_reloc_name_lookup): New function.
1208         (coff_bfd_reloc_name_lookup): Define.
1209         * coff64-rs6000.c (coff_bfd_reloc_name_lookup): Define.
1210         (xcoff64_reloc_name_lookup): New function.
1211         (rs6000coff64_vec, aix5coff64_vec): Init new field.
1212         * coffcode.h (coff_bfd_reloc_name_lookup): Define.
1213         * elf-hppa.h (elf_hppa_reloc_name_lookup): New function.
1214         * elf-m10200.c (bfd_elf32_bfd_reloc_name_lookup): New function.
1215         * elf-m10300.c (bfd_elf32_bfd_reloc_name_lookup): New function.
1216         * elf32-arc.c (bfd_elf32_bfd_reloc_name_lookup): New function.
1217         * elf32-arm.c (elf32_arm_reloc_name_lookup): New function.
1218         (bfd_elf32_bfd_reloc_name_lookup): Define.
1219         * elf32-avr.c (bfd_elf32_bfd_reloc_name_lookup): New function.
1220         * elf32-bfin.c (bfin_bfd_reloc_name_lookup): New function.
1221         (bfd_elf32_bfd_reloc_name_lookup): Define.
1222         * elf32-cr16c.c (elf_cr16c_reloc_name_lookup): New function.
1223         (bfd_elf32_bfd_reloc_name_lookup): Define.
1224         * elf32-cris.c (cris_reloc_name_lookup): New function.
1225         (bfd_elf32_bfd_reloc_name_lookup): Define.
1226         * elf32-crx.c (elf_crx_reloc_name_lookup): New function.
1227         (bfd_elf32_bfd_reloc_name_lookup): Define.
1228         * elf32-d10v.c (bfd_elf32_bfd_reloc_name_lookup): New function.
1229         * elf32-d30v.c (bfd_elf32_bfd_reloc_name_lookup): New function.
1230         * elf32-dlx.c (elf32_dlx_reloc_name_lookup): New function.
1231         (bfd_elf32_bfd_reloc_name_lookup): Define.
1232         * elf32-fr30.c (fr30_reloc_name_lookup): New function.
1233         (bfd_elf32_bfd_reloc_name_lookup): Define.
1234         * elf32-frv.c (frv_reloc_name_lookup): New function.
1235         (bfd_elf32_bfd_reloc_name_lookup): Define.
1236         * elf32-gen.c (bfd_elf32_bfd_reloc_name_lookup): Define.
1237         * elf32-h8300.c (elf32_h8_reloc_name_lookup): New function.
1238         (bfd_elf32_bfd_reloc_name_lookup): Define.
1239         * elf32-hppa.c (bfd_elf32_bfd_reloc_name_lookup): Define.
1240         * elf32-i370.c (i370_elf_reloc_name_lookup): New function.
1241         (bfd_elf32_bfd_reloc_name_lookup): Define.
1242         * elf32-i386.c (elf_i386_reloc_name_lookup): New function.
1243         (bfd_elf32_bfd_reloc_name_lookup): Define.
1244         * elf32-i860.c (elf32_i860_reloc_name_lookup): New function.
1245         (bfd_elf32_bfd_reloc_name_lookup): Define.
1246         * elf32-i960.c (elf32_i960_reloc_name_lookup): New function.
1247         (bfd_elf32_bfd_reloc_name_lookup): Define.
1248         * elf32-ip2k.c (ip2k_reloc_name_lookup): New function.
1249         (bfd_elf32_bfd_reloc_name_lookup): Define.
1250         * elf32-iq2000.c (iq2000_reloc_name_lookup): New function.
1251         (bfd_elf32_bfd_reloc_name_lookup): Define.
1252         * elf32-m32c.c (m32c_reloc_name_lookup): New function.
1253         (bfd_elf32_bfd_reloc_name_lookup): Define.
1254         * elf32-m32r.c (bfd_elf32_bfd_reloc_name_lookup): New function.
1255         * elf32-m68hc11.c (bfd_elf32_bfd_reloc_name_lookup): New function.
1256         * elf32-m68hc12.c (bfd_elf32_bfd_reloc_name_lookup): New function.
1257         * elf32-m68k.c (reloc_name_lookup): New function.
1258         (bfd_elf32_bfd_reloc_name_lookup): Define.
1259         * elf32-m88k.c (bfd_elf32_bfd_reloc_name_lookup): Define.
1260         * elf32-mcore.c (mcore_elf_reloc_name_lookup): New function.
1261         (bfd_elf32_bfd_reloc_name_lookup): Define.
1262         * elf32-mep.c (mep_reloc_name_lookup): New function.
1263         (bfd_elf32_bfd_reloc_name_lookup): Define.
1264         * elf32-mips.c (bfd_elf32_bfd_reloc_name_lookup): New function.
1265         (mips_vxworks_bfd_reloc_name_lookup): Likewise.
1266         (bfd_elf32_bfd_reloc_name_lookup): Define.
1267         * elf32-msp430.c (bfd_elf32_bfd_reloc_name_lookup): New function.
1268         * elf32-mt.c (mt_reloc_name_lookup): New function.
1269         (bfd_elf32_bfd_reloc_name_lookup): Define.
1270         * elf32-openrisc.c (openrisc_reloc_name_lookup): New function.
1271         (bfd_elf32_bfd_reloc_name_lookup): Define.
1272         * elf32-or32.c (bfd_elf32_bfd_reloc_name_lookup): New function.
1273         * elf32-pj.c (pj_elf_reloc_name_lookup): New function.
1274         (bfd_elf32_bfd_reloc_name_lookup): Define.
1275         * elf32-ppc.c (ppc_elf_reloc_name_lookup): New function.
1276         (bfd_elf32_bfd_reloc_name_lookup): Define.
1277         * elf32-s390.c (elf_s390_reloc_name_lookup): New function.
1278         (bfd_elf32_bfd_reloc_name_lookup): Define.
1279         * elf32-score.c (elf32_score_reloc_name_lookup): New function.
1280         (bfd_elf32_bfd_reloc_name_lookup): Define.
1281         * elf32-sh.c (sh_elf_reloc_name_lookup): New function.
1282         (bfd_elf32_bfd_reloc_name_lookup): Define.
1283         * elf32-sparc.c (bfd_elf32_bfd_reloc_name_lookup): Define.
1284         * elf32-spu.c (spu_elf_reloc_name_lookup): New function.
1285         (bfd_elf32_bfd_reloc_name_lookup): Define.
1286         * elf32-v850.c (v850_elf_reloc_name_lookup): New function.
1287         (bfd_elf32_bfd_reloc_name_lookup): Define.
1288         * elf32-vax.c (reloc_name_lookup): New function.
1289         (bfd_elf32_bfd_reloc_name_lookup): Define.
1290         * elf32-xc16x.c (xc16x_reloc_name_lookup): New function.
1291         (bfd_elf32_bfd_reloc_name_lookup): Define.
1292         * elf32-xstormy16.c (xstormy16_reloc_name_lookup): New function.
1293         (bfd_elf32_bfd_reloc_name_lookup): Define.
1294         * elf32-xtensa.c (elf_xtensa_reloc_name_lookup): New function.
1295         (bfd_elf32_bfd_reloc_name_lookup): Define.
1296         * elf64-alpha.c (elf64_alpha_bfd_reloc_name_lookup): New function.
1297         (bfd_elf64_bfd_reloc_name_lookup): Define.
1298         * elf64-gen.c (bfd_elf64_bfd_reloc_name_lookup): Define.
1299         * elf64-hppa.c (bfd_elf64_bfd_reloc_name_lookup): Define.
1300         * elf64-mips.c (bfd_elf64_bfd_reloc_name_lookup): New function.
1301         * elf64-mmix.c (bfd_elf64_bfd_reloc_name_lookup): New function.
1302         * elf64-ppc.c (ppc64_elf_reloc_name_lookup): New function.
1303         (bfd_elf64_bfd_reloc_name_lookup): Define.
1304         * elf64-s390.c (elf_s390_reloc_name_lookup): New function.
1305         (bfd_elf64_bfd_reloc_name_lookup): Define.
1306         * elf64-sh64.c (sh_elf64_reloc_name_lookup): New function.
1307         (bfd_elf64_bfd_reloc_name_lookup): Define.
1308         * elf64-sparc.c (bfd_elf64_bfd_reloc_name_lookup): Define.
1309         * elf64-x86-64.c (elf64_x86_64_reloc_name_lookup): New function.
1310         (bfd_elf64_bfd_reloc_name_lookup): Define.
1311         * elfn32-mips.c (bfd_elf32_bfd_reloc_name_lookup): New function.
1312         * elfxx-ia64.c (elfNN_ia64_reloc_name_lookup): New function.
1313         (bfd_elfNN_bfd_reloc_name_lookup): Define.
1314         * elfxx-sparc.c (_bfd_sparc_elf_reloc_name_lookup): New function.
1315         * elfxx-sparc.h (_bfd_sparc_elf_reloc_name_lookup): Declare.
1316         * i386msdos.c (msdos_bfd_reloc_name_lookup): Define.
1317         * i386os9k.c (aout_32_bfd_reloc_name_lookup): Define.
1318         * ieee.c (ieee_bfd_reloc_name_lookup): Define.
1319         * libaout.h (NAME (aout, reloc_name_lookup)): Declare.
1320         * libbfd-in.h (_bfd_norelocs_bfd_reloc_name_lookup): Declare.
1321         * mipsbsd.c (MY_bfd_reloc_name_lookup): Define.
1322         (MY(reloc_type_lookup)): Rename from MY(reloc_howto_type_lookup).
1323         (MY(reloc_name_lookup)): New function.
1324         * nlm-target.h (nlm_bfd_reloc_name_lookup): Define.
1325         * oasys.c (oasys_bfd_reloc_name_lookup): Define.
1326         * pdp11.c (NAME (aout, reloc_name_lookup)): New function.
1327         * pe-mips.c (coff_mips_reloc_name_lookup): New function.
1328         (coff_bfd_reloc_name_lookup): Define.
1329         * reloc.c (bfd_reloc_name_lookup): New function.
1330         * riscix.c (riscix_reloc_name_lookup): New function.
1331         (MY_bfd_reloc_name_lookup): Define.
1332         * som.c (som_bfd_reloc_name_lookup): New function.
1333         * targets.c (struct bfd_target): Add reloc_name_lookup.
1334         (BFD_JUMP_TABLE_RELOCS): Add NAME##_bfd_reloc_name_lookup.
1335         * versados.c (versados_bfd_reloc_name_lookup): Define.
1336         * vms.c (vms_bfd_reloc_name_lookup): New function.
1337         * bfd-in2.h: Regenerate.
1338         * libbfd.h: Regenerate.
1339
1340 2007-03-26  Thiemo Seufer  <ths@mips.com>
1341
1342         PR ld/4208
1343         * elfxx-mips.c (mips_elf_next_relocation): Don't signal an error if no
1344         matching relocation is found.
1345         (_bfd_mips_elf_relocate_section): Only warn about missing relocations.
1346
1347 2007-03-23  H.J. Lu  <hongjiu.lu@intel.com>
1348
1349         * configure: Regenerated.
1350
1351 2007-03-23  Joseph Myers  <joseph@codesourcery.com>
1352
1353         * configure.in: Use ACX_PKGVERSION and ACX_BUGURL.
1354         * configure: Regenerate.
1355
1356 2007-03-23  Alan Modra  <amodra@bigpond.net.au>
1357
1358         * elf32-spu.c (spu_stub_name): Don't put input section in stub name.
1359         Remove input_sec param.  Adjust all calls.
1360         (write_one_stub): Adjust stub symbol.
1361         (needs_ovl_stub): New function, extracted from..
1362         (spu_elf_size_stubs): ..here.
1363         (spu_elf_relocate_section): Use needs_ovl_stub.
1364
1365 2007-03-22  Joseph Myers  <joseph@codesourcery.com>
1366
1367         * Makefile.am (bfdver.h): Only set VERSION_PACKAGE in bfdver.texi
1368         if nonempty.
1369         * configure.in (REPORT_BUGS_TO): Do not use "URL:" prefix.
1370         * Makefile.in, configure, doc/Makefile.in: Regenerate.
1371
1372 2007-03-22  H.J. Lu  <hongjiu.lu@intel.com>
1373
1374         PR ld/4210
1375         * peXXigen.c (_bfd_XXi_swap_aouthdr_out): Use the virtual
1376         address and virtual size of the last section for the image
1377         size.
1378
1379 2007-03-22  H.J. Lu  <hongjiu.lu@intel.com>
1380
1381         PR ld/4007
1382         * elf.c (assign_file_positions_for_load_sections): Check if
1383         all sections are in the segment.
1384
1385 2007-03-20  H.J. Lu  <hongjiu.lu@intel.com>
1386
1387         PR ld/4208
1388         * elfxx-mips.c (_bfd_mips_elf_relocate_section): Report missing
1389         matching LO16 relocation for HI16 relocation.
1390
1391 2007-03-20  Paul Brook  <paul@codesourcery.com>
1392
1393         * bfd-in.h (bfd_elf32_arm_set_target_relocs): Update prototype.
1394         * bfd-in2.h: Regenerate.
1395         * elf32-arm.c (elf32_arm_link_hash_table): Add pic_veneer.
1396         (record_arm_to_thumb_glue): Use globals->pic_veneer.
1397         (elf32_arm_create_thumb_stub): Ditto.
1398         (bfd_elf32_arm_set_target_relocs): Set globals->pic_veneer.
1399
1400 2007-03-18  Mark Shinwell  <shinwell@codesourcery.com>
1401
1402         * bfd-in.h (bfd_elf32_arm_set_target_relocs): Add "bfd *"
1403         argument and extra last argument.
1404         * bfd-in2.h: Regenerate.
1405         * elf32-arm.c (elf32_arm_obj_tdata): Add no_enum_size_warning
1406         member.
1407         (bfd_elf32_arm_set_target_relocs): Add "bfd *" argument and
1408         extra last argument.  Set no_enum_size_warning appropriately.
1409         (elf32_arm_merge_eabi_attributes): Improve enum sizes
1410         diagnostic, suppressing it when no_enum_size_warning dictates.
1411
1412 2007-03-20  Nick Clifton  <nickc@redhat.com>
1413
1414         PR binutils/3535
1415         * elf.c (copy_private_bfd_data): Widen the scope of Solaris
1416         specific conditions that need the program headers to be
1417         rewritten.
1418
1419 2007-03-19  H.J. Lu  <hongjiu.lu@intel.com>
1420
1421         * peXXigen.c (_bfd_XXi_swap_aouthdr_in): Store Magic,
1422         MajorLinkerVersion, MinorLinkerVersion, SizeOfCode,
1423         SizeOfInitializedData, SizeOfUninitializedData,
1424         AddressOfEntryPoint, BaseOfCode and BaseOfData in internal
1425         extra PE a.out header.
1426         (IMAGE_NT_OPTIONAL_HDR_MAGIC): Defined as 0x10b if not defined.
1427         (IMAGE_NT_OPTIONAL_HDR64_MAGIC): Defined as 0x20b if not
1428         defined.
1429         (IMAGE_NT_OPTIONAL_HDRROM_MAGIC): Defined as 0x107 if not
1430         defined.
1431         (_bfd_XX_print_private_bfd_data_common): Also print Magic,
1432         MajorLinkerVersion, MinorLinkerVersion, SizeOfCode,
1433         SizeOfInitializedData, SizeOfUninitializedData,
1434         AddressOfEntryPoint, BaseOfCode and BaseOfData from internal
1435         extra PE a.out header.
1436
1437 2007-03-18  H.J. Lu  <hongjiu.lu@intel.com>
1438
1439         * targets.c (_bfd_target_vector): Add bfd_efi_app_x86_64_vec
1440         only if BFD64 is defined.
1441
1442 2007-03-17  Alan Modra  <amodra@bigpond.net.au>
1443
1444         * elf32-spu.c (spu_elf_size_stubs): Always use an overlay stub
1445         on setjmp calls.
1446
1447 2007-03-15  H.J. Lu  <hongjiu.lu@intel.com>
1448
1449         * doc/Makefile.in: Regenerated.
1450
1451 2007-03-15  H.J. Lu  <hongjiu.lu@intel.com>
1452
1453         * Makefile.am (bfdver.h): Substitute report_bugs_to.  Also
1454         create doc/bfdver.texi.
1455         * Makefile.in: Regenerated.
1456
1457         * configure.in (--with-bugurl): New option.
1458         * configure: Regenerated.
1459
1460         * version.h (REPORT_BUGS_TO): New.
1461
1462 2007-03-13  H.J. Lu  <hongjiu.lu@intel.com>
1463
1464         PR binutils/3826
1465         * elf-bfd.h (elf_backend_data): Add elf_osabi.
1466         (_bfd_elf_set_osabi): New.
1467
1468         * elf.c (_bfd_elf_set_osabi): New.
1469
1470         * elf32-hppa.c (elf32_hppa_post_process_headers): Removed.
1471         (elf_backend_post_process_headers): Defined with
1472         _bfd_elf_set_osabi.
1473         (ELF_OSABI): Properly defined for each target.
1474
1475         * elf32-i370.c (i370_elf_post_process_headers): Removed.
1476         (ELF_OSABI): Defined.
1477         (elf_backend_post_process_headers): Defined with
1478         _bfd_elf_set_osabi.
1479
1480         * elf32-i386.c (ELF_OSABI): Defined to ELFOSABI_FREEBSD for
1481         freebsd.
1482         (elf_i386_post_process_headers): Set EI_OSABI with elf_osabi.
1483
1484         * elf32-msp430.c (elf32_msp430_post_process_headers): Removed.
1485         (ELF_OSABI): Defined.
1486         (elf_backend_post_process_headers): Defined with
1487         _bfd_elf_set_osabi.
1488
1489         * elf64-alpha.c (ELF_OSABI): Defined to ELFOSABI_FREEBSD for
1490         freebsd.
1491         (elf64_alpha_fbsd_post_process_headers): Set EI_OSABI with
1492         elf_osabi.
1493
1494         * elf64-hppa.c (elf64_hppa_post_process_headers): Set EI_OSABI
1495         with elf_osabi.
1496         (ELF_OSABI): Properly defined for each target.
1497         (elf_backend_post_process_headers): Defined with
1498         _bfd_elf_set_osabi for Linux.
1499
1500         * elf64-sparc.c (elf64_sparc_fbsd_post_process_headers): Removed.
1501         (ELF_OSABI): Defined to ELFOSABI_FREEBSD for freebsd.
1502         (elf_backend_post_process_headers): Defined with
1503         _bfd_elf_set_osabi.
1504
1505         * elf64-x86-64.c (elf64_x86_64_fbsd_post_process_headers): Removed.
1506         (ELF_OSABI): Defined to ELFOSABI_FREEBSD for freebsd.
1507         (elf_backend_post_process_headers): Defined with
1508         _bfd_elf_set_osabi.
1509
1510         * elfcode.h (elf_object_p): Match the ELFOSABI_NONE ELF target
1511         with any ELF target of the compatible machine for which we do not
1512         have a specific backend.
1513
1514         * elfxx-ia64.c (elfNN_hpux_post_process_headers): Set EI_OSABI
1515         with elf_osabi.
1516
1517         * elfxx-target.h (ELF_OSABI): Default to ELFOSABI_NONE.
1518         (elfNN_bed): Initialize elf_osabi with ELF_OSABI.
1519
1520 2007-03-08  Alan Modra  <amodra@bigpond.net.au>
1521
1522         * elf32-v850.c (v850_elf_link_output_symbol_hook): Clean out
1523         V850_OTHER_* bits.
1524
1525 2007-03-08  Alan Modra  <amodra@bigpond.net.au>
1526
1527         * Makefile.am (BFD64_BACKENDS): Add efi-app-x86_64.lo.
1528         (BFD64_BACKENDS_CFILES): Add efi-app-x86_64.c.
1529         Run "make dep-am".
1530         * Makefile.in: Regenerate.
1531         * po/SRC-POTFILES.in: Regenerate.
1532
1533 2007-03-07  H.J. Lu  <hongjiu.lu@intel.com>
1534
1535         * config.bfd (x86_64-*-freebsd*): Add bfd_efi_app_x86_64_vec.
1536         (x86_64-*-kfreebsd*-gnu): Likewise.
1537         (x86_64-*-netbsd*): Likewise.
1538         (x86_64-*-openbsd*): Likewise.
1539         (x86_64-*-linux-*): Likewise.
1540
1541         * configure.in: Support bfd_efi_app_x86_64_vec.
1542         * configure: Regenerated.
1543
1544         * efi-app-x86_64.c: New file.
1545
1546         * targets.c (bfd_efi_app_x86_64_vec): New.
1547         (_bfd_target_vector): Add bfd_efi_app_x86_64_vec.
1548
1549 2007-03-07  Kai Tietz   <kai.tietz@onevision.com>
1550
1551         * reloc.c (bfd_generic_get_relocated_section_contents): Remove
1552         const for type reloc_howto_type.
1553
1554 2007-03-07  Alan Modra  <amodra@bigpond.net.au>
1555
1556         PR 3958
1557         * elf-bfd.h (RELOC_FOR_GLOBAL_SYMBOL): No error on relocatable link.
1558         (elf_discarded_section): Move..
1559         * bfd-in.h: ..to here.
1560         * bfd-in2.h: Regenerate.
1561         * elflink.c (elf_link_input_bfd): Don't zap relocs against symbols
1562         from discarded sections before relocate_section has done its job.
1563         * reloc.c (bfd_generic_get_relocated_section_contents): Handle
1564         relocs against symbols from discarded sections.
1565         * elf-hppa.h (elf_hppa_howto_table): Set size.  Set dst_mask on
1566         SECREL32.
1567         (elf_hppa_relocate_section): Handle relocatable link after setting
1568         sec, sym, h etc. for final link.  Squash error messages for
1569         relocatable link.  Clear section contents for relocs against
1570         symbols in discarded sections, and zero reloc.  Remove existing
1571         zero r_symndx code.
1572         * elf-m10200.c (mn10200_elf_relocate_section): Likewise.
1573         * elf-m10300.c (mn10300_elf_relocate_section): Likewise.
1574         * elf32-arm.c (elf32_arm_relocate_section): Likewise.
1575         * elf32-avr.c (elf32_avr_relocate_section): Likewise.
1576         * elf32-bfin.c (bfinfdpic_relocate_section): Likewise.
1577         (bfin_relocate_section): Likewise.
1578         * elf32-cr16c.c (elf32_cr16c_relocate_section): Likewise.
1579         * elf32-cris.c (cris_elf_relocate_section): Likewise.
1580         * elf32-crx.c (elf32_crx_relocate_section): Likewise.
1581         * elf32-d10v.c (elf32_d10v_relocate_section): Likewise.
1582         * elf32-fr30.c (fr30_elf_relocate_section): Likewise.
1583         * elf32-frv.c (elf32_frv_relocate_section): Likewise.
1584         * elf32-h8300.c (elf32_h8_relocate_section): Likewise.
1585         * elf32-hppa.c (elf32_hppa_relocate_section): Likewise.
1586         * elf32-i370.c (i370_elf_relocate_section): Likewise.
1587         * elf32-i386.c (elf_i386_relocate_section): Likewise.
1588         * elf32-i860.c (elf32_i860_relocate_section): Likewise.
1589         * elf32-ip2k.c (ip2k_elf_relocate_section): Likewise.
1590         * elf32-iq2000.c (iq2000_elf_relocate_section): Likewise.
1591         * elf32-m32c.c (m32c_elf_relocate_section): Likewise.
1592         * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
1593         * elf32-m68hc1x.c (elf32_m68hc11_check_relocs): Likewise.
1594         * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
1595         * elf32-mcore.c (mcore_elf_relocate_section): Likewise.
1596         * elf32-mep.c (mep_elf_relocate_section): Likewise.
1597         * elf32-msp430.c (elf32_msp430_relocate_section): Likewise.
1598         * elf32-mt.c (mt_elf_relocate_section): Likewise.
1599         * elf32-openrisc.c (openrisc_elf_relocate_section): Likewise.
1600         * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
1601         * elf32-s390.c (elf_s390_relocate_section): Likewise.
1602         * elf32-score.c (_bfd_score_elf_relocate_section): Likewise.
1603         * elf32-sh.c (sh_elf_relocate_section): Likewise.
1604         * elf32-spu.c (spu_elf_relocate_section): Likewise.
1605         * elf32-v850.c (v850_elf_relocate_section): Likewise.
1606         * elf32-vax.c (elf_vax_relocate_section): Likewise.
1607         * elf32-xc16x.c (elf32_xc16x_relocate_section): Likewise.
1608         * elf32-xstormy16.c (xstormy16_elf_relocate_section): Likewise.
1609         * elf32-xtensa.c (elf_xtensa_relocate_section): Likewise.
1610         * elf64-alpha.c (elf64_alpha_relocate_section_r): Likewise.
1611         (elf64_alpha_relocate_section): Likewise.
1612         * elf64-mmix.c (mmix_elf_relocate_section): Likewise.
1613         * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
1614         * elf64-s390.c (elf_s390_relocate_section): Likewise.
1615         * elf64-sh64.c (sh_elf64_relocate_section): Likewise.
1616         * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
1617         * elfxx-ia64.c (elfNN_ia64_relocate_section): Likewise.
1618         * elfxx-mips.c (_bfd_mips_elf_relocate_section): Likewise.
1619         * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Likewise.
1620
1621         * elf32-arm.c (elf32_arm_relocate_section): Always adjust section
1622         symbols for relocatable link.  Don't use always-zero st_value.
1623         (elf_backend_rela_normal): Don't define.
1624         * elf32-bfin.c (bfinfdpic_relocate_section): Use
1625         RELOC_FOR_GLOBAL_SYMBOL.
1626         * elf32-frv.c (elf32_frv_relocate_section): Likewise.
1627         * elf32-d10v.c (elf32_d10v_relocate_section): Combine SEC_MERGE
1628         section symbol adjustments with same for relocatable link.
1629         * elf32-i386.c (elf_i386_relocate_section): Likewise.
1630         * elf32-m68hc1x.c (m68hc11_get_relocation_value): Move..
1631         (elf32_m68hc11_check_relocs): ..to here.
1632         * elf32-score.c (score_elf_final_link_relocate): Remove zero
1633         r_symndx code.
1634         * elfxx-mips.c (mips_elf_calculate_relocation): Likewise.
1635
1636 2007-03-07  Alan Modra  <amodra@bigpond.net.au>
1637
1638         PR 4144
1639         * elf.c (assign_file_positions_for_load_sections): Don't
1640         adjust p_memsz for !SEC_LOAD section vma modulo page size.
1641         Instead, use the same lma based adjustment for SEC_LOAD
1642         sections.
1643
1644 2007-03-01  Bob Wilson  <bob.wilson@acm.org>
1645
1646         * elf32-xtensa.c (analyze_relocations): Zero src_count if not relaxing.
1647         (find_relaxable_sections): Do not increment src_count for unknown
1648         opcodes.  Decode only once instead of calling is_l32r_relocation.
1649         (compute_text_actions): Remove unused no_insn_move flag.  Assert that
1650         src_next matches src_count in relax_info.
1651
1652 2007-03-01  Joseph Myers  <joseph@codesourcery.com>
1653
1654         * Makefile.am (bfdver.h): Use "." not " " between version number
1655         and date.
1656         * Makefile.in: Regenerate.
1657         * configure.in (PKGVERSION): Default to "(GNU Binutils) ".
1658         * configure: Regenerate.
1659
1660 2007-02-28  Nathan Sidwell  <nathan@codesourcery.com>
1661
1662         * config.bfd (sh-*-uclinux, sh[12]-*-uclinux): New stanza.
1663
1664 2007-02-27  Alan Modra  <amodra@bigpond.net.au>
1665
1666         * elf32-spu.h (struct _ovl_stream): Make "start" and "end" const.
1667         * elf32-spu.c (ovl_mgr_pread): Add const to casts.
1668
1669 2007-02-23  Carlos O'Donell  <carlos@codesourcery.com>
1670
1671         * dwarf2.c (_bfd_dwarf2_find_nearest_line): Assume 32-bit
1672         DWARF even with 64-bit addresses.
1673         (_bfd_dwarf2_find_nearest_line): Likewise.
1674
1675 2007-02-23  Nick Clifton  <nickc@redhat.com>
1676
1677         PR binutils/3535
1678         * elf.c (copy_private_bfd_data): Always rewrite the program
1679         headers when a Solaris interpreter segment is involved.
1680
1681 2007-02-22  Paul Brook  <paul@codesourcery.com>
1682
1683         * elflink.c (gc_mark_hook_fn): Remove.
1684         (_bfd_elf_gc_mark): Rename gc_mark_hook_fn to elf_gc_mark_hook_fn.
1685         (bfd_elf_gc_sections): Ditto.  Call gc_mark_extra_sections.
1686         * elf-bfd.h (elf_gc_mark_hook_fn): Define.
1687         (elf_backend_data): Add gc_mark_extra_sections.
1688         * elfxx-target.h (elf_backend_gc_mark_extra_sections): Provide default
1689         definition.
1690         (elfNN_bed): Add elf_backend_gc_mark_extra_sections.
1691         * elf32-arm.c (elf32_arm_gc_mark_extra_sections): New function.
1692         (elf_backend_gc_mark_extra_sections): Define.
1693
1694 2007-02-21  Nick Clifton  <nickc@redhat.com>
1695
1696         * elf.c (_bfd_elf_map_sections_to_segments): If the
1697         override_segment_assignment callback is defined then call it.
1698
1699 2007-02-21  Alan Modra  <amodra@bigpond.net.au>
1700
1701         * elf32-spu.c (spu_elf_size_stubs): Correct order of warning args.
1702
1703 2007-02-19  Thiemo Seufer  <ths@mips.com>
1704
1705         * elfxx-mips.c (_bfd_mips_elf_print_private_bfd_data): Remove
1706         translation marker from untranslatable strings.
1707
1708 2007-02-19  Alan Modra  <amodra@bigpond.net.au>
1709
1710         * elf-bfd.h (struct elf_backend_data): Add default_execstack.
1711         * elflink.c (bfd_elf_size_dynamic_sections): Heed default_execstack.
1712         * elfxx-target.h (elf_backend_default_execstack): Define to 1.
1713         (elfNN_bed): Init new field.
1714         * elf64-ppc.c (elf_backend_default_execstack): Define to 0.
1715
1716 2007-02-17  Mark Mitchell  <mark@codesourcery.com>
1717             Nathan Sidwell  <nathan@codesourcery.com>
1718             Vladimir Prus  <vladimir@codesourcery.com
1719             Joseph Myers  <joseph@codesourcery.com>
1720
1721         * configure.in (--with-pkgversion): New option.
1722         * configure: Regenerate.
1723         * Makefile.am (bfdver.h): Substitute for @bfd_version_package@.
1724         * Makefile.in: Regenerate.
1725         * version.h (BFD_VERSION_STRING): Define using
1726         @bfd_version_package@.
1727
1728 2007-02-16  Carlos O'Donell  <carlos@codesourcery.com>
1729
1730         * elfxx-mips.c (_bfd_mips_elf_print_private_bfd_data):
1731         Print EF_MIPS_NOREORDER, EF_MIPS_PIC, EF_MIPS_CPIC, EF_MIPS_XGOT
1732         and EF_MIPS_UCODE.
1733
1734 2007-02-15  Alan Modra  <amodra@bigpond.net.au>
1735
1736         * libbfd-in.h (_bfd_norelocs_get_reloc_upper_bound): Don't define,
1737         declare.
1738         (_bfd_norelocs_canonicalize_reloc): Likewise.
1739         * libbfd.h: Regenerate.
1740         * libbfd.c (_bfd_norelocs_get_reloc_upper_bound): New function.
1741         (_bfd_norelocs_canonicalize_reloc): Likewise.
1742         * binary.c (binary_bfd_reloc_type_lookup): Don't define.
1743         (binary_get_reloc_upper_bound, binary_canonicalize_reloc): Likewise.
1744         (binary_vec): Use _bfd_norelocs in BFD_JUMP_TABLE_RELOCS.
1745         * ihex.c: Similarly.
1746         * mach-o-target.c: Similarly.
1747         * mach-o.c: Similarly.
1748         * mmo.c: Similarly.
1749         * pef.c: Similarly.
1750         * ppcboot.c: Similarly.
1751         * srec.c: Similarly.
1752         * xsym.c: Similarly.
1753
1754 2007-02-14  H.J. Lu  <hongjiu.lu@intel.com>
1755
1756         PR ld/3953
1757         * elflink.c (_bfd_elf_add_default_symbol): Check warning symbol
1758         when adding default symbol.
1759
1760 2007-02-13  Alan Modra  <amodra@bigpond.net.au>
1761
1762         * elf64-ppc.c (create_linkage_sections): Use section ".branch_lt"
1763         for branch lookup table.
1764
1765 2007-02-12  Alan Modra  <amodra@bigpond.net.au>
1766
1767         * elf64-ppc.c (create_linkage_sections): Don't create
1768         .rela.rodata.brlt for --emit-relocs.
1769         (ppc_build_one_stub): Create relocs for brlt --emit-relocs here.
1770         (ppc_size_one_stub): Count them.  Simplify test of stub type
1771         when counting stub relocs.  Set SEC_RELOC too.
1772         (ppc64_elf_size_stubs): Clear reloc_count and SEC_RELOC.
1773         (ppc64_elf_finish_dynamic_sections): Output brlt relocs.
1774
1775 2007-02-12  Alan Modra  <amodra@bigpond.net.au>
1776
1777         * elflink.c (evaluate_complex_relocation_symbols): Ignore relocs
1778         with a zero symbol index.
1779
1780 2007-02-12  Alan Modra  <amodra@bigpond.net.au>
1781
1782         * elflink.c (bfd_elf_discard_info): Tidy setting of "eh".
1783
1784 2007-02-05  Dave Brolley  <brolley@redhat.com>
1785             Stan Cox  <scox@redhat.com>
1786
1787         PR ld/3972
1788         * elflink.c (elf_link_input_bfd): Always setup finfo->internal_syms.
1789
1790 2007-02-05  Dave Brolley  <brolley@redhat.com>
1791             Richard Sandiford  <rsandifo@redhat.com>
1792             Stan Cox  <scox@redhat.com>
1793             Nick Clifton  <nickc@redhat.com>
1794             DJ Delorie  <dj@redhat.com>
1795             Frank Ch. Eigler  <fche@redhat.com>
1796             Ben Elliston  <bje@redhat.com>
1797             Richard Henderson  <rth@redhat.com>
1798
1799         * Makefile.am (ALL_MACHINES): Add cpu-mep.lo.
1800         (ALL_MACHINES_CFILES): Add CPU_MEP.c.
1801         (BFD32_BACKENDS): Add elf32-mep.lo.
1802         (BFD32_BACKENDS_CFILES): Add elf32-mep.c.
1803         (cpu-mep.lo,elf32-mep.lo): New targets.
1804         * archures.c (bfd_arch_mep): New enumerator.
1805         (bfd_mach_mep, bfd_mach_mep_h1): New macros.
1806         (bfd_mep_arch): New external variable.
1807         (bfd_archures_list): Add bfd_mep_arch.
1808         * config.bfd: Support mep-*-elf.
1809         * configure.in: Support bfd_elf32_mep_vec and bfd_elf32_mep_little_vec.
1810         * reloc.c (BFD_RELOC_MEP_*): New relocation numbers.
1811         * targets.c (bfd_elf32_mep_vec,bfd_elf32_mep_little_vec): New extern
1812         declarations.
1813         (_bfd_target_vector): Add bfd_elf32_mep_vec and
1814         bfd_elf32_mep_little_vec.
1815         * mep-relocs.pl: New file.
1816         * cpu-mep.c: New file.
1817         * elf32-mep.c: New file.
1818         * bfd-in2.h: Regenerate.
1819         * po/POTFILES.in: Regenerate.
1820         * libbfd.h: Regenerate.
1821         * Makefile.in: Regenerate.
1822         * configure: Regenerate.
1823
1824 2007-02-05  Dave Brolley  <brolley@redhat.com>
1825
1826         * elflink.c (evaluate_complex_relocation_symbols): Check for
1827         STT_SRELC for global symbols.
1828         (perform_complex_relocations): Renamed to
1829         perform_complex_relocation and now examines only one relocation.
1830         (elf_link_input_bfd): Don't call perform_complex_relocations.
1831         * elf-bfd.h (bfd_elf_perform_complex_relocation_: New prototype.
1832         * elf32-mep.c (mep_elf_howto_table): Add R_RELC.
1833         (OD,OS,OU): #undefs corrected to N, S and U repectively.
1834         (mep_reloc_type_lookup): Handle BFD_RELOC_RELC.
1835         (complex_reloc_installation_howto): Removed.
1836         (mep_info_to_howto_rela): Remove special case for r_type==0xff.
1837         (mep_elf_relocate_section): Call bfd_elf_perform_complex_relocation.
1838
1839 2007-02-05  Dave Brolley  <brolley@redhat.com>
1840             Richard Sandiford  <rsandifo@redhat.com>
1841             DJ Delorie  <dj@redhat.com>
1842             Graydon Hoare  <graydon@redhat.com>
1843             Nick Clifton  <nickc@cambridge.redhat.com>
1844             Jeff Holcomb  <jeffh@redhat.com>
1845             Frank Ch. Eigler  <fche@redhat.com>
1846
1847         * elf-bfd.h (bfd_elf_perform_complex_relocations): New prototype.
1848         * elf.c (swap_out_syms): Handle BSF_RELC and BSF_SRELC.
1849         * elfcode.h (elf_slurp_symbol_table): Handle STT_RELC and STT_SRELC.
1850         * elflink.c (set_symbolValue): New static function.
1851         (resolve_symbol): Likewise.
1852         (resolve_section): Likewise.
1853         (undefined_reference): Likewise.
1854         (eval_symbol): Likewise.
1855         (evaluate_complex_relocation_symbols): Likewise.
1856         (put_value): Likewise.
1857         (get_value): Likewise.
1858         (decode_complex_addend):
1859         (bfd_elf_perform_complex_relocation): New function.
1860         (elf_link_input_bfd): Call evaluate_complex_relocation_symbols.
1861         * reloc.c (BFD_RELOC_RELC): New relocation number.
1862         * syms.c (BSF_RELC,BSF_SRELC): New macros.
1863
1864 2007-02-05  Bob Wilson  <bob.wilson@acm.org>
1865
1866         * elf32-xtensa.c (elf_xtensa_make_sym_local): Delete.
1867         (elf_xtensa_hide_symbol, elf_backend_hide_symbol): Delete.
1868         (elf_xtensa_fix_refcounts, elf_xtensa_allocate_plt_size)
1869         (elf_xtensa_allocate_got_size): Replace these with...
1870         (elf_xtensa_allocate_dynrelocs): ...this new function.
1871         (elf_xtensa_size_dynamic_sections): Use it.
1872
1873 2007-02-05  Bob Wilson  <bob.wilson@acm.org>
1874
1875         * elf32-xtensa.c (elf_howto_table) <R_XTENSA_GLOB_DAT>
1876         <R_XTENSA_JMP_SLOT, R_XTENSA_RELATIVE, R_XTENSA_PLT, R_XTENSA_DIFF32>:
1877         Set src_mask to zero.
1878         <R_XTENSA_DIFF8, R_XTENSA_DIFF16>: Likewise.  Also fix dst_mask.
1879         <R_XTENSA_ASM_EXPAND>: Set pcrel_offset to TRUE.
1880
1881 2007-02-02  Bob Wilson  <bob.wilson@acm.org>
1882
1883         * elf32-xtensa.c (xtensa_elf_dynamic_symbol_p): Renamed to...
1884         (elf_xtensa_dynamic_symbol_p): ...this.
1885
1886 2007-02-02  Bob Wilson  <bob.wilson@acm.org>
1887
1888         * elf32-xtensa.c (plt_reloc_count): Move into link hash table.
1889         (struct elf_xtensa_link_hash_table): New.
1890         (elf_xtensa_hash_table): New.
1891         (elf_xtensa_link_hash_table_create): New.
1892         (elf_xtensa_check_relocs): Update plt_reloc_count references.
1893         Update arguments to add_extra_plt_sections.
1894         (elf_xtensa_create_dynamic_sections): Record new sections in the hash
1895         table.  Update for plt_reloc_count and add_extra_plt_sections.
1896         (add_extra_plt_sections, elf_xtensa_create_plt_entry): Replace dynobj
1897         argument with link info.  Update calls to elf_xtensa_get_plt_section
1898         and elf_xtensa_get_gotplt_section.
1899         (elf_xtensa_allocate_local_got_size, elf_xtensa_size_dynamic_sections)
1900         (elf_xtensa_relocate_section, elf_xtensa_finish_dynamic_sections)
1901         (elf_xtensa_discard_info_for_section, shrink_dynamic_reloc_sections)
1902         (relax_property_section): Get sections from the hash table and update
1903         function calls.
1904         (elf_xtensa_get_plt_section, elf_xtensa_get_gotplt_section): Replace
1905         dynobj argument with link info.  Get sections for first plt chunk from
1906         the hash table.
1907         (bfd_elf32_bfd_link_hash_table_create): Define.
1908
1909 2007-02-02  Jakub Jelinek  <jakub@redhat.com>
1910
1911         * elf-bfd.h (struct elf_obj_tdata): Change symbuf type to void *.
1912         * elf.c (struct elf_symbuf_symbol, struct elf_symbuf_head): New types.
1913         (struct elf_symbol): Change first member into union.
1914         (elf_sort_elf_symbol): Compare pointers to internal syms rather than
1915         internal syms.  Only compare st_shndx fields.
1916         (elf_create_symbuf): New function.
1917         (bfd_elf_match_symbols_in_sections): Use it.  If symbufs are available
1918         for bfds, use a binary search, otherwise don't qsort symbols
1919         unnecessarily only to select which symbols are for the particular
1920         shndx.
1921
1922 2007-02-01  Nick Clifton  <nickc@redhat.com>
1923
1924         PR ld/3852
1925         * elf.c (_bfd_elf_link_hash_table_init): Initialize all the fields
1926         in the elf_link_hash_table structure.
1927
1928 2007-02-01  Alan Modra  <amodra@bigpond.net.au>
1929
1930         * elf-bfd.h (struct elf_backend_data): Add elf_backend_write_core_note.
1931         * elfxx-target.h (elf_backend_write_core_note): Define and use.
1932         * elf.c (elfcore_write_prpsinfo): Call the above.  Add support for
1933         32-bit core note on 64-bit target.
1934         (elfcore_write_prstatus): Likewise.
1935         (elfcore_write_lwpstatus): Make note_name const.
1936         (elfcore_write_prfpreg): Likewise.
1937         (elfcore_write_pstatus): Add support for 32-bit core note on 64-bit
1938         target.
1939         * elf32-ppc.c (ppc_elf_write_core_note): New function.
1940         (elf_backend_write_core_note): Define.
1941         * elf64-ppc.c (ppc64_elf_write_core_note): New function.
1942         (elf_backend_write_core_note): Define.
1943
1944 2007-01-31  H.J. Lu  <hongjiu.lu@intel.com>
1945
1946         * elf32-cris.c (INCLUDED_TARGET_FILE): Removed.
1947         (elf32_bed): Defined for elf32-us-cris.
1948
1949         * elf64-sh64.c (elf64_bed): Defined for Linux.
1950         (INCLUDED_TARGET_FILE): Removed.
1951
1952         * elfxx-target.h (elfNN_bed): Always define. Don't check
1953         INCLUDED_TARGET_FILE.
1954
1955 2007-01-31  DJ Delorie  <dj@redhat.com>
1956
1957         * elf-m10300.c (mn10300_elf_relocate_section): Clarify the warning
1958         message for dangerous relocs, special case the common user error.
1959
1960 2007-01-30  H.J. Lu  <hongjiu.lu@intel.com>
1961
1962         * elf.c (copy_elf_program_header): Start from the first section
1963         in a segment and stop when all sections in a segment are
1964         accounted for.
1965
1966 2007-01-29  Julian Brown  <julian@codesourcery.com>
1967
1968         * bfd-in2.h: Regenerate.
1969         * bfd-in.h (bfd_arm_vfp11_fix): New enum. Specify how VFP11
1970         instruction scanning should be done.
1971         (bfd_elf32_arm_init_maps, bfd_elf32_arm_vfp11_erratum_scan)
1972         (bfd_elf32_arm_vfp11_fix_veneer_locations): Add prototypes.
1973         (bfd_elf32_arm_set_target_relocs): Add vfp11 fix type argument to
1974         prototype.
1975         * elf-bfd.h (elf_backend_write_section): Add struct bfd_link_info
1976         argument.
1977         * elf32-arm.c (VFP11_ERRATUM_VENEER_SECTION_NAME)
1978         (VFP11_ERRATUM_VENEER_ENTRY_NAME): Define macros.
1979         (elf32_vfp11_erratum_type): New enum.
1980         (elf32_vfp11_erratum_list): New struct. List of veneers or jumps to
1981         veneers.
1982         (_arm_elf_section_data): Add mapsize, erratumcount, erratumlist.
1983         (elf32_arm_link_hash_table): Add vfp11_erratum_glue_size,
1984         vfp11_fix and num_vfp11_fixes fields.
1985         (elf32_arm_link_hash_table_create): Initialise vfp11_fix,
1986         vfp11_erratum_glue_size, num_vfp11_fixes fields.
1987         (VFP11_ERRATUM_VENEER_SIZE): Define. Size of an (ARM) veneer.
1988         (bfd_elf32_arm_allocate_interworking_sections): Initialise erratum
1989         glue section.
1990         (elf32_arm_section_map_add): Add an code/data mapping symbol entry
1991         to a section's map.
1992         (record_vfp11_erratum_veneer): Create a single veneer, and its
1993         associated symbols.
1994         (bfd_elf32_arm_add_glue_sections_to_bfd): Add vfp11 erratum glue.
1995         (bfd_elf32_arm_init_maps): Initialise mapping symbol table for input
1996         BFDs.
1997         (bfd_elf32_arm_set_vfp11_fix): Set the type of erratum workaround
1998         required.
1999         (bfd_arm_vfp11_pipe): Define VFP11 instruction pipes.
2000         (bfd_arm_vfp11_regno): Recode a register number from a VFP11 insn.
2001         (bfd_arm_vfp11_write_mask): Update write mask according to coded
2002         register number.
2003         (bfd_arm_vfp11_antidependency): New function.
2004         (bfd_arm_vfp11_insn_decode): Decode a VFP11 insn.
2005         (elf32_arm_compare_mapping): Declare.
2006         (bfd_elf32_arm_vfp11_erratum_scan): Scan the sections of an input
2007         BFD for potential erratum-triggering insns. Record results.
2008         (bfd_elf32_arm_vfp11_fix_veneer_locations): Find out where veneers
2009         and branches to veneers have been placed in virtual memory after
2010         layout.
2011         (bfd_elf32_arm_set_target_relocs): Set vfp11_fix field in global
2012         hash table.
2013         (elf32_arm_output_symbol_hook): Remove.
2014         (elf32_arm_write_section): Output veneers, and branches to veneers.
2015         Use maps from input sections, not output sections, for code
2016         byte-swapping.
2017         * elf32-ppc.c (ppc_elf_write_section): Add dummy link_info argument.
2018         * elf32-score.c (_bfd_score_elf_write_section): Likewise.
2019         * elfxx-mips.c (_bfd_mips_elf_write_section): Likewise.
2020         * elfxx-mips.h (_bfd_mips_elf_write_section): Likewise.
2021
2022 2007-01-27  H.J. Lu  <hongjiu.lu@intel.com>
2023
2024         * elf64-hppa.c (elf64_bed): Defined for HPUX and Linux.
2025         (INCLUDED_TARGET_FILE): Removed.
2026
2027 2007-01-27  Mike Frysinger  <vapier@gentoo.org>
2028
2029         * elf32-hppa.c (elf32_bed): Define for hpux, linux and netbsd.
2030         (INCLUDED_TARGET_FILE): Remove.
2031
2032 2007-01-25  DJ Delorie  <dj@redhat.com>
2033
2034         * elf32-m32c.c (m32c_elf_howto_table): Don't complain about
2035         R_M32C_16 or R_M32C_24 relocs.
2036
2037 2007-01-25  Nick Clifton  <nickc@redhat.com>
2038
2039         PR binutils/3874
2040         * elf32-avr.c (avr_link_hash_table): Check to make sure that the
2041         hash table was created by elf32_avr_link_hash_table_create before
2042         using it.
2043         (elf32_avr_link_hash_newfunc): New function.  Just pass the call
2044         through to _bfd_elf_link_hash_newfunc.
2045         (elf32_avr_link_hash_table_create): Use
2046         elf32_avr_link_hash_newfunc instead of
2047         _bfd_elf_link_hash_newfunc.
2048         (elf32_avr_relocate_section): Check for the hash table pointer
2049         being NULL.
2050         (elf32_avr_relax_section, avr_build_one_stub,
2051         elf32_avr_setup_params, get_local_syms, elf32_avr_size_stubs,
2052         elf32_avr_build_stubs): Likewise.
2053
2054 2007-01-16  H.J. Lu  <hongjiu.lu@intel.com>
2055
2056         PR ld/3831
2057         * elf-bfd.h (bfd_elf_link_mark_dynamic_symbol): Add an
2058         argument, Elf_Internal_Sym *.
2059
2060         * elflink.c (bfd_elf_link_mark_dynamic_symbol): Mark a data
2061         symbol dynamic if info->dynamic_data is TRUE.
2062         (bfd_elf_record_link_assignment): Updated call to
2063         bfd_elf_record_link_assignment.
2064         (_bfd_elf_merge_symbol): Likewise.  Always call
2065         bfd_elf_link_mark_dynamic_symbol.
2066
2067 2007-01-12  H.J. Lu  <hongjiu.lu@intel.com>
2068
2069         * Makefile.am (BFD_LIBS): Removed.
2070         * Makefile.in: Regenerated.
2071
2072 2007-01-11  H.J. Lu  <hongjiu.lu@intel.com>
2073
2074         PR binutils/3631
2075         * Makefile.am (OFILES): Add @bfd64_libs@.
2076         (libbfd_la_SOURCES): Remove $(BFD64_LIBS_CFILES).
2077         * Makefile.in: Regenerated.
2078
2079         * configure.in (bfd_libs): Replaced by ...
2080         (bfd64_libs): This.
2081         * configure: Regenerated.
2082
2083 2007-01-11  Nathan Sidwell  <nathan@codesourcery.com>
2084
2085         * elf.c (assign_file_positions_for_load_sections): We can
2086         require fewer phdrs than expected.
2087
2088 2007-01-08  Kazu Hirata  <kazu@codesourcery.com>
2089
2090         * archures.c (bfd_mach_cpu32_fido): Rename to bfd_mach_fido.
2091         * bfd-in2.h: Regenerate.
2092         * cpu-m68k.c (arch_info_struct): Use bfd_mach_fido instead of
2093         bfd_mach_cpu32_fido.
2094         (m68k_arch_features): Use fido_a instead of cpu32.
2095         (bfd_m68k_compatible): Reject the combination of Fido and
2096         ColdFire.  Accept the combination of CPU32 and Fido with a
2097         warning.
2098         * elf32-m68k.c (elf32_m68k_object_p,
2099         elf32_m68k_merge_private_bfd_data,
2100         elf32_m68k_print_private_bfd_data): Treat Fido as an
2101         architecture by itself.
2102
2103 2007-01-08  Kai Tietz   <kai.tietz@onevision.com>
2104
2105         * config.bfd: Renamed target x86_64-*-mingw64 to x86_64-*-mingw*.
2106
2107 2007-01-05  Jakub Jelinek  <jakub@redhat.com>
2108
2109         * texhex.c (first_phase): Don't fall through into the default
2110         case.
2111         (pass_over): Replace abort () calls with return FALSE.  Fix
2112         buffer overflow.
2113
2114 2007-01-04  Jie Zhang  <jie.zhang@analog.com>
2115
2116         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Don't set
2117         SEC_EXCLUDE on zero size .eh_frame.
2118
2119 For older changes see ChangeLog-2006
2120 \f
2121 Local Variables:
2122 mode: change-log
2123 left-margin: 8
2124 fill-column: 74
2125 version-control: never
2126 End: