* Makefile.am (INCLUDES): Don't -D_GNU_SOURCE here.
[external/binutils.git] / bfd / ChangeLog
1 2005-05-05  Hans-Peter Nilsson  <hp@axis.com>
2
3         * Makefile.am (INCLUDES): Don't -D_GNU_SOURCE here.
4         * configure.in: Call AC_GNU_SOURCE here, after AC_PROG_CC.
5         * configure, config.in, Makefile.in: Regenerate.
6         * sysdep.h (stpcpy): Revert last change.
7
8 2005-05-05  Hans-Peter Nilsson  <hp@axis.com>
9
10         * sysdep.h (stpcpy): Wrap declaration in parentheses.
11
12 2005-05-04  H.J. Lu  <hongjiu.lu@intel.com>
13
14         * elfxx-ia64.c (ARCH_SIZE): New.
15         (LOG_SECTION_ALIGN): Likewise.
16         (elfNN_ia64_create_dynamic_sections): Use LOG_SECTION_ALIGN to
17         align relocation sections.
18         (get_fptr): Likewise.
19         (get_reloc_section): Likewise.
20         (elfNN_ia64_tprel_base): Likewise.
21         (elfNN_ia64_check_relocs): Support 32bit relocations.
22         (allocate_global_fptr_got): Likewise.
23         (allocate_dynrel_entries): Likewise.
24         (set_got_entry): Likewise.
25         (set_pltoff_entry): Likewise.
26         (elfNN_ia64_relocate_section): Likewise.
27
28 2005-05-04  H.J. Lu  <hongjiu.lu@intel.com>
29
30         * configure.in: Add AC_CHECK_DECLS(stpcpy).
31         * configure: Regenerate.
32         * config.in: Likewise.
33
34         * sysdep.h (stpcpy): New.
35
36 2005-05-04  Nick Clifton  <nickc@redhat.com>
37
38         * Update the address and phone number of the FSF organization in
39         the GPL notices in the following files:
40         aix386-core.c, aix5ppc-core.c, aout-adobe.c, aout-arm.c,
41         aout-cris.c, aout-ns32k.c, aout-sparcle.c, aout-target.h,
42         aout-tic30.c, aout0.c, aout32.c, aout64.c, aoutf1.h, aoutx.h,
43         archive.c, archive64.c, archures.c, armnetbsd.c, bfd-in.h,
44         bfd-in2.h, bfd.c, bfdio.c, bfdwin.c, binary.c, bout.c, cache.c,
45         cf-i386lynx.c, cf-m68klynx.c, cf-sparclynx.c, cisco-core.c,
46         coff-a29k.c, coff-alpha.c, coff-apollo.c, coff-arm.c, coff-aux.c,
47         coff-go32.c, coff-h8300.c, coff-h8500.c, coff-i386.c, coff-i860.c,
48         coff-i960.c, coff-ia64.c, coff-m68k.c, coff-m88k.c, coff-maxq.c,
49         coff-mcore.c, coff-mips.c, coff-or32.c, coff-pmac.c, coff-ppc.c,
50         coff-rs6000.c, coff-sh.c, coff-sparc.c, coff-stgo32.c,
51         coff-svm68k.c, coff-tic30.c, coff-tic4x.c, coff-tic54x.c,
52         coff-tic80.c, coff-u68k.c, coff-w65.c, coff-we32k.c, coff-z8k.c,
53         coff64-rs6000.c, coffcode.h, coffgen.c, cofflink.c, coffswap.h,
54         corefile.c, cpu-a29k.c, cpu-alpha.c, cpu-arc.c, cpu-arm.c,
55         cpu-avr.c, cpu-cr16c.c, cpu-cris.c, cpu-crx.c, cpu-d10v.c,
56         cpu-d30v.c, cpu-dlx.c, cpu-fr30.c, cpu-frv.c, cpu-h8300.c,
57         cpu-h8500.c, cpu-hppa.c, cpu-i370.c, cpu-i386.c, cpu-i860.c,
58         cpu-i960.c, cpu-ia64-opc.c, cpu-ia64.c, cpu-ip2k.c, cpu-iq2000.c,
59         cpu-m10200.c, cpu-m10300.c, cpu-m32r.c, cpu-m68hc11.c,
60         cpu-m68hc12.c, cpu-m68k.c, cpu-m88k.c, cpu-maxq.c, cpu-mcore.c,
61         cpu-mips.c, cpu-mmix.c, cpu-msp430.c, cpu-ns32k.c, cpu-openrisc.c,
62         cpu-or32.c, cpu-pdp11.c, cpu-pj.c, cpu-powerpc.c, cpu-rs6000.c,
63         cpu-s390.c, cpu-sh.c, cpu-sparc.c, cpu-tic30.c, cpu-tic4x.c,
64         cpu-tic54x.c, cpu-tic80.c, cpu-v850.c, cpu-vax.c, cpu-w65.c,
65         cpu-we32k.c, cpu-xstormy16.c, cpu-xtensa.c, cpu-z8k.c, demo64.c,
66         dwarf1.c, dwarf2.c, ecoff.c, ecofflink.c, ecoffswap.h,
67         efi-app-ia32.c, efi-app-ia64.c, elf-bfd.h, elf-eh-frame.c,
68         elf-hppa.h, elf-m10200.c, elf-m10300.c, elf-strtab.c, elf.c,
69         elf32-am33lin.c, elf32-arc.c, elf32-arm.c, elf32-avr.c,
70         elf32-cr16c.c, elf32-cris.c, elf32-crx.c, elf32-d10v.c,
71         elf32-d30v.c, elf32-dlx.c, elf32-fr30.c, elf32-frv.c, elf32-gen.c,
72         elf32-h8300.c, elf32-hppa.c, elf32-hppa.h, elf32-i370.c,
73         elf32-i386.c, elf32-i860.c, elf32-i960.c, elf32-ip2k.c,
74         elf32-iq2000.c, elf32-m32r.c, elf32-m68hc11.c, elf32-m68hc12.c,
75         elf32-m68hc1x.c, elf32-m68hc1x.h, elf32-m68k.c, elf32-m88k.c,
76         elf32-mcore.c, elf32-mips.c, elf32-msp430.c, elf32-openrisc.c,
77         elf32-or32.c, elf32-pj.c, elf32-ppc.c, elf32-ppc.h, elf32-s390.c,
78         elf32-sh-symbian.c, elf32-sh.c, elf32-sh64-com.c, elf32-sh64.c,
79         elf32-sh64.h, elf32-sparc.c, elf32-v850.c, elf32-vax.c,
80         elf32-xstormy16.c, elf32-xtensa.c, elf32.c, elf64-alpha.c,
81         elf64-gen.c, elf64-hppa.c, elf64-hppa.h, elf64-mips.c,
82         elf64-mmix.c, elf64-ppc.c, elf64-ppc.h, elf64-s390.c,
83         elf64-sh64.c, elf64-sparc.c, elf64-x86-64.c, elf64.c, elfcode.h,
84         elfcore.h, elflink.c, elfn32-mips.c, elfxx-ia64.c, elfxx-mips.c,
85         elfxx-mips.h, elfxx-sparc.c, elfxx-sparc.h, elfxx-target.h,
86         epoc-pe-arm.c, epoc-pei-arm.c, format.c, freebsd.h, gen-aout.c,
87         genlink.h, hash.c, host-aout.c, hp300bsd.c, hp300hpux.c,
88         hppabsd-core.c, hpux-core.c, i386aout.c, i386bsd.c, i386dynix.c,
89         i386freebsd.c, i386linux.c, i386lynx.c, i386mach3.c, i386msdos.c,
90         i386netbsd.c, i386os9k.c, ieee.c, ihex.c, init.c, irix-core.c,
91         libaout.h, libbfd-in.h, libbfd.c, libbfd.h, libcoff-in.h,
92         libcoff.h, libecoff.h, libhppa.h, libieee.h, libnlm.h, liboasys.h,
93         libpei.h, libxcoff.h, linker.c, lynx-core.c, m68k4knetbsd.c,
94         m68klinux.c, m68klynx.c, m68knetbsd.c, m88kmach3.c, m88kopenbsd.c,
95         mach-o-target.c, mach-o.c, mach-o.h, merge.c, mipsbsd.c, mmo.c,
96         netbsd-core.c, netbsd.h, newsos3.c, nlm-target.h, nlm.c,
97         nlm32-alpha.c, nlm32-i386.c, nlm32-ppc.c, nlm32-sparc.c, nlm32.c,
98         nlm64.c, nlmcode.h, nlmswap.h, ns32k.h, ns32knetbsd.c, oasys.c,
99         opncls.c, osf-core.c, pc532-mach.c, pdp11.c, pe-arm.c, pe-i386.c,
100         pe-mcore.c, pe-mips.c, pe-ppc.c, pe-sh.c, peXXigen.c,
101         pef-traceback.h, pef.c, pef.h, pei-arm.c, pei-i386.c, pei-mcore.c,
102         pei-mips.c, pei-ppc.c, pei-sh.c, peicode.h, ppcboot.c,
103         ptrace-core.c, reloc.c, reloc16.c, riscix.c, rs6000-core.c,
104         sco5-core.c, section.c, simple.c, som.c, som.h, sparclinux.c,
105         sparclynx.c, sparcnetbsd.c, srec.c, stab-syms.c, stabs.c, sunos.c,
106         syms.c, sysdep.h, targets.c, tekhex.c, ticoff.h, trad-core.c,
107         vax1knetbsd.c, vaxbsd.c, vaxnetbsd.c, versados.c, vms-gsd.c,
108         vms-hdr.c, vms-misc.c, vms-tir.c, vms.c, vms.h, xcoff-target.h,
109         xcofflink.c, xsym.c, xsym.h, xtensa-isa.c, xtensa-modules.c,
110         doc/chew.c, hosts/alphavms.h
111
112 2005-05-04  H.J. Lu  <hongjiu.lu@intel.com>
113
114         * bfd-in.h (_bfd_elf_provide_section_bound_symbols): New.
115         * bfd-in2.h: Regenerated.
116
117         * elflink.c (bfd_elf_set_symbol): New.
118         (_bfd_elf_provide_symbol): Call it.
119         (_bfd_elf_provide_section_bound_symbols): New.
120
121 2005-05-04  H.J. Lu  <hongjiu.lu@intel.com>
122
123         * elflink.c (_bfd_elf_merge_symbol): Only skip weak definitions
124         at the end, if a strong definition has already been seen.
125
126 2005-05-04  Alan Modra  <amodra@bigpond.net.au>
127
128         * section.c (struct bfd_section): Replace link_order_head and
129         link_order_tail with map_head and map_tail union.
130         (STD_SECTION): Update.
131         (_bfd_strip_section_from_output): Delete.
132         * aoutx.h: Update throughout for above changes.
133         * coff-ppc.c: Likewise.
134         * cofflink.c: Likewise.
135         * ecoff.c: Likewise.
136         * elf-eh-frame.c: Likewise.
137         * elf-m10300.c: Likewise.
138         * elf.c: Likewise.
139         * elf32-arm.c: Likewise.
140         * elf32-cris.c: Likewise.
141         * elf32-hppa.c: Likewise.
142         * elf32-i386.c: Likewise.
143         * elf32-m32r.c: Likewise.
144         * elf32-m68hc1x.c: Likewise.
145         * elf32-m68k.c: Likewise.
146         * elf32-ppc.c: Likewise.
147         * elf32-s390.c: Likewise.
148         * elf32-sh.c: Likewise.
149         * elf32-vax.c: Likewise.
150         * elf32-xtensa.c: Likewise.
151         * elf64-alpha.c: Likewise.
152         * elf64-hppa.c: Likewise.
153         * elf64-ppc.c: Likewise.
154         * elf64-s390.c: Likewise.
155         * elf64-sh64.c: Likewise.
156         * elf64-x86-64.c: Likewise.
157         * elflink.c: Likewise.
158         * elfxx-ia64.c: Likewise.
159         * elfxx-mips.c: Likewise.
160         * elfxx-sparc.c: Likewise.
161         * linker.c: Likewise.
162         * merge.c: Likewise.
163         * pdp11.c: Likewise.
164         * xcofflink.c: Likewise.
165         * elflink.c (bfd_boolean bfd_elf_size_dynsym_hash_dynstr): Split
166         out from bfd_elf_size_dynamic_sections.
167         * bfd-in.h (bfd_boolean bfd_elf_size_dynsym_hash_dynstr): Declare.
168         * bfd-in2.h: Regenerate.
169
170 2005-05-04  Nick Clifton  <nickc@redhat.com>
171
172         * COPYING, aix386-core.c, aix5ppc-core.c, aout-adobe.c,
173         aout-arm.c, aout-cris.c, aout-ns32k.c, aout-sparcle.c,
174         aout-target.h, aout-tic30.c, aout0.c, aout32.c, aout64.c,
175         aoutf1.h, aoutx.h, archive.c, archive64.c, archures.c,
176         armnetbsd.c, bfd-in.h, bfd-in2.h, bfd.c, bfdio.c, bfdwin.c,
177         binary.c, bout.c, cache.c, cf-i386lynx.c, cf-m68klynx.c,
178         cf-sparclynx.c, cisco-core.c, coff-a29k.c, coff-alpha.c,
179         coff-apollo.c, coff-arm.c, coff-aux.c, coff-go32.c, coff-h8300.c,
180         coff-h8500.c, coff-i386.c, coff-i860.c, coff-i960.c, coff-ia64.c,
181         coff-m68k.c, coff-m88k.c, coff-maxq.c, coff-mcore.c, coff-mips.c,
182         coff-or32.c, coff-pmac.c, coff-ppc.c, coff-rs6000.c, coff-sh.c,
183         coff-sparc.c, coff-stgo32.c, coff-svm68k.c, coff-tic30.c,
184         coff-tic4x.c, coff-tic54x.c, coff-tic80.c, coff-u68k.c,
185         coff-w65.c, coff-we32k.c, coff-z8k.c, coff64-rs6000.c, coffcode.h,
186         coffgen.c, cofflink.c, coffswap.h, corefile.c, cpu-a29k.c,
187         cpu-alpha.c, cpu-arc.c, cpu-arm.c, cpu-avr.c, cpu-cr16c.c,
188         cpu-cris.c, cpu-crx.c, cpu-d10v.c, cpu-d30v.c, cpu-dlx.c,
189         cpu-fr30.c, cpu-frv.c, cpu-h8300.c, cpu-h8500.c, cpu-hppa.c,
190         cpu-i370.c, cpu-i386.c, cpu-i860.c, cpu-i960.c, cpu-ia64-opc.c,
191         cpu-ia64.c, cpu-ip2k.c, cpu-iq2000.c, cpu-m10200.c, cpu-m10300.c,
192         cpu-m32r.c, cpu-m68hc11.c, cpu-m68hc12.c, cpu-m68k.c, cpu-m88k.c,
193         cpu-maxq.c, cpu-mcore.c, cpu-mips.c, cpu-mmix.c, cpu-msp430.c,
194         cpu-ns32k.c, cpu-openrisc.c, cpu-or32.c, cpu-pdp11.c, cpu-pj.c,
195         cpu-powerpc.c, cpu-rs6000.c, cpu-s390.c, cpu-sh.c, cpu-sparc.c,
196         cpu-tic30.c, cpu-tic4x.c, cpu-tic54x.c, cpu-tic80.c, cpu-v850.c,
197         cpu-vax.c, cpu-w65.c, cpu-we32k.c, cpu-xstormy16.c, cpu-xtensa.c,
198         cpu-z8k.c, demo64.c, dwarf1.c, dwarf2.c, ecoff.c, ecofflink.c,
199         ecoffswap.h, efi-app-ia32.c, efi-app-ia64.c, elf-bfd.h,
200         elf-eh-frame.c, elf-hppa.h, elf-m10200.c, elf-m10300.c,
201         elf-strtab.c, elf.c, elf32-am33lin.c, elf32-arc.c, elf32-arm.c,
202         elf32-avr.c, elf32-cr16c.c, elf32-cris.c, elf32-crx.c,
203         elf32-d10v.c, elf32-d30v.c, elf32-dlx.c, elf32-fr30.c,
204         elf32-frv.c, elf32-gen.c, elf32-h8300.c, elf32-hppa.c,
205         elf32-hppa.h, elf32-i370.c, elf32-i386.c, elf32-i860.c,
206         elf32-i960.c, elf32-ip2k.c, elf32-iq2000.c, elf32-m32r.c,
207         elf32-m68hc11.c, elf32-m68hc12.c, elf32-m68hc1x.c,
208         elf32-m68hc1x.h, elf32-m68k.c, elf32-m88k.c, elf32-mcore.c,
209         elf32-mips.c, elf32-msp430.c, elf32-openrisc.c, elf32-or32.c,
210         elf32-pj.c, elf32-ppc.c, elf32-ppc.h, elf32-s390.c,
211         elf32-sh-symbian.c, elf32-sh.c, elf32-sh64-com.c, elf32-sh64.c,
212         elf32-sh64.h, elf32-sparc.c, elf32-v850.c, elf32-vax.c,
213         elf32-xstormy16.c, elf32-xtensa.c, elf32.c, elf64-alpha.c,
214         elf64-gen.c, elf64-hppa.c, elf64-hppa.h, elf64-mips.c,
215         elf64-mmix.c, elf64-ppc.c, elf64-ppc.h, elf64-s390.c,
216         elf64-sh64.c, elf64-sparc.c, elf64-x86-64.c, elf64.c, elfcode.h,
217         elfcore.h, elflink.c, elfn32-mips.c, elfxx-ia64.c, elfxx-mips.c,
218         elfxx-mips.h, elfxx-sparc.c, elfxx-sparc.h, elfxx-target.h,
219         epoc-pe-arm.c, epoc-pei-arm.c, format.c, freebsd.h, gen-aout.c,
220         genlink.h, hash.c, host-aout.c, hp300bsd.c, hp300hpux.c,
221         hppabsd-core.c, hpux-core.c, i386aout.c, i386bsd.c, i386dynix.c,
222         i386freebsd.c, i386linux.c, i386lynx.c, i386mach3.c, i386msdos.c,
223         i386netbsd.c, i386os9k.c, ieee.c, ihex.c, init.c, irix-core.c,
224         libaout.h, libbfd-in.h, libbfd.c, libbfd.h, libcoff-in.h,
225         libcoff.h, libecoff.h, libhppa.h, libieee.h, libnlm.h, liboasys.h,
226         libpei.h, libxcoff.h, linker.c, lynx-core.c, m68k4knetbsd.c,
227         m68klinux.c, m68klynx.c, m68knetbsd.c, m88kmach3.c, m88kopenbsd.c,
228         mach-o-target.c, mach-o.c, mach-o.h, merge.c, mipsbsd.c, mmo.c,
229         netbsd-core.c, netbsd.h, newsos3.c, nlm-target.h, nlm.c,
230         nlm32-alpha.c, nlm32-i386.c, nlm32-ppc.c, nlm32-sparc.c, nlm32.c,
231         nlm64.c, nlmcode.h, nlmswap.h, ns32k.h, ns32knetbsd.c, oasys.c,
232         opncls.c, osf-core.c, pc532-mach.c, pdp11.c, pe-arm.c, pe-i386.c,
233         pe-mcore.c, pe-mips.c, pe-ppc.c, pe-sh.c, peXXigen.c,
234         pef-traceback.h, pef.c, pef.h, pei-arm.c, pei-i386.c, pei-mcore.c,
235         pei-mips.c, pei-ppc.c, pei-sh.c, peicode.h, ppcboot.c,
236         ptrace-core.c, reloc.c, reloc16.c, riscix.c, rs6000-core.c,
237         sco5-core.c, section.c, simple.c, som.c, som.h, sparclinux.c,
238         sparclynx.c, sparcnetbsd.c, srec.c, stab-syms.c, stabs.c, sunos.c,
239         syms.c, sysdep.h, targets.c, tekhex.c, ticoff.h, trad-core.c,
240         vax1knetbsd.c, vaxbsd.c, vaxnetbsd.c, versados.c, vms-gsd.c,
241         vms-hdr.c, vms-misc.c, vms-tir.c, vms.c, vms.h, xcoff-target.h,
242         xcofflink.c, xsym.c, xsym.h, xtensa-isa.c, xtensa-modules.c,
243         doc/chew.c, doc/fdl.texi, hosts/alphavms.h: Update FSF address.
244
245 2005-05-04  Alan Modra  <amodra@bigpond.net.au>
246
247         * section.c (bfd_section_list_remove): Don't clear s->next.
248         (bfd_section_list_append): Always init s->prev.
249         (bfd_section_list_prepend): Define.
250         (bfd_section_list_insert_after): Minor optimization.
251         (bfd_section_removed_from_list): Rewrite.
252         * elf.c (assign_section_numbers): Simplify list traversal now that
253         bfd_section_list_remove doesn't destroy removed section next ptr.
254         * sunos.c (sunos_add_dynamic_symbols): Likewise.
255         * elfxx-ia64.c (elfNN_ia64_object_p): Use bfd_section_list_prepend.
256         * xcofflink.c (_bfd_xcoff_bfd_final_link): Simplify list traversal.
257         * bfd-in2.h: Regenerate.
258
259 2005-05-02  H.J. Lu  <hongjiu.lu@intel.com>
260
261         * bfd.c (bfd): Remove section_tail and add section_last.
262         (bfd_preserve): Likewise.
263         (bfd_preserve_save): Likewise.
264         (bfd_preserve_restore): Likewise.
265         * opncls.c (_bfd_new_bfd): Likewise.
266
267         * coffcode.h (coff_compute_section_file_positions): Updated.
268         (coff_compute_section_file_positions): Likewise.
269         * elf.c (assign_section_numbers): Likewise.
270         * elf32-i370.c (i370_elf_size_dynamic_sections): Likewise.
271         * elf64-mmix.c (mmix_elf_final_link): Likewise.
272         * elfxx-ia64.c (elfNN_ia64_object_p): Likewise.
273         * elfxx-mips.c (_bfd_mips_elf_link_hash_table_create): Likewise.
274         * sunos.c (sunos_add_dynamic_symbols): Likewise.
275         * xcofflink.c (_bfd_xcoff_bfd_final_link): Likewise.
276
277         * ecoff.c (bfd_debug_section): Initialize prev.
278
279         * section.c (bfd_section): Add prev.
280         (bfd_section_list_remove): Updated.
281         (bfd_section_list_append): New.
282         (bfd_section_list_insert_after): New.
283         (bfd_section_list_insert_before): New.
284         (bfd_section_list_insert): Removed.
285         (bfd_section_removed_from_list): Updated.
286         (STD_SECTION): Initialize prev.
287         (bfd_section_init): Updated.
288         (bfd_section_list_clear): Updated.
289
290         * bfd-in2.h: Regenerated.
291
292 2005-05-02  H.J. Lu  <hongjiu.lu@intel.com>
293
294         * elf.c (_bfd_elf_new_section_hook): Don't call
295         _bfd_elf_get_sec_type_attr on sections from input files.
296
297 2005-05-02  H.J. Lu  <hongjiu.lu@intel.com>
298
299         * merge.c (sec_merge_init): Call bfd_hash_table_init_n with
300         hash table size 16699 instead of bfd_hash_table_init.
301
302 2005-05-01  Paul Brook  <paul@codesourcery.com>
303
304         * elflink.c (_bfd_elf_merge_symbol): Skip weak definitions if a strong
305         definition has already been seen.
306
307 2005-05-01  Paul Brook  <paul@codesourcery.com>
308
309         * elf32-arm.c (bfd_elf32_arm_process_before_allocation): Treat
310         R_ARM_PLT32 the same as R_ARM_PC24.
311         (arm_add_to_rel): Ditto.
312
313 2005-04-29  Ralf Corsepius <ralf.corsepius@rtems.org>
314
315         * config.bfd: Add h8300*-*-rtemscoff.
316         Switch h8300*-*-rtems* to elf.
317
318 2005-04-28  Paul Brook  <paul@codesourcery.com>
319
320         Merge changes only applied to Makefile.in.
321         * Makefile.am (BFD32_BACKENDS): Add elfxx-sparc.lo
322         (BFD32_BACKENDS_CFILES): Add elfxx-sparc.c
323         (elfxx-sparc.lo): New rule.
324         (elf32-sparc.lo): Add elfxx-sparc.h dependency.
325         (elf64-sparc.lo): Likewise.
326
327 2005-04-28  Julian Brown  <julian@codesourcery.com>
328
329         * elflink.c (_bfd_elf_provide_symbol): Provide symbol for weak
330         import.
331
332 2005-04-27  H.J. Lu  <hongjiu.lu@intel.com>
333
334         * elf-bfd.h (bfd_elf_sym_name): Also take "asection *".
335
336         * elf.c (bfd_elf_sym_name): Updated.
337         (group_signature): Likewise.
338         * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
339         * elf64-ppc.c (ppc64_elf_edit_opd): Likewise.
340         (ppc64_elf_edit_toc): Likewise.
341         (ppc64_elf_relocate_section): Likewise.
342         * elfcode.h (elf_slurp_symbol_table): Likewise.
343         * elflink.c (elf_link_input_bfd): Likewise.
344
345         * elfxx-ia64.c (elfNN_ia64_relocate_section): Call
346         bfd_elf_sym_name to get local symbol name when reporting errors.
347
348 2005-04-27  Nick Clifton  <nickc@redhat.com>
349
350         * elflink.c (elf_link_input_bfd): Handle the case where a badly
351         formatted input file results in a reloc which has no associated
352         global symbol.
353
354 2005-04-26  Jerome Guitton  <guitton@gnat.com>
355
356         * bfd.m4 (BFD_NEED_DECLARATION): Restore.
357
358 2005-04-25  David S. Miller  <davem@davemloft.net>
359
360         * elfxx-sparc.c (sparc_elf_append_rela_64): Add BFD64 protection.
361         (sparc_elf_r_info_64, _bfd_sparc_elf_finish_dynamic_symbol,
362         sparc64_finish_dyn, _bfd_sparc_elf_finish_dynamic_sections):
363         Likewise.
364
365 2005-04-25  H.J. Lu  <hongjiu.lu@intel.com>
366
367         PR 858
368         * elflink.c (elf_link_input_bfd): Make non-debugging reference
369         to discarded section an error.
370
371 2005-04-21  Jerome Guitton  <guitton@gnat.com>
372
373         * configure.in: Replace BFD_NEED_DECLARATION checks by the
374         corresponding AC_CHECK_DECLS.
375         * sysdep.h: Replace NEED_DECLARATION_* checks by the corresponding
376         HAVE_DECL_*.
377         * bfd.m4 (BFD_NEED_DECLARATION): Remove, obsolete.
378         * configure: Regenerate.
379         * config.in: Ditto.
380
381 2005-04-21  Andreas Schwab  <schwab@suse.de>
382
383         * elfxx-sparc.h (struct _bfd_sparc_elf_link_hash_table): Remove
384         unsigned from type of dynamic_interpreter.
385         * elfxx-sparc.c (_bfd_sparc_elf_link_hash_table_create): Remove
386         casts again.
387
388         * elf.c (assign_section_numbers): Fix comment.
389
390 2005-04-21  Jerome Guitton  <guitton@gnat.com>
391
392         * som.c (som_bfd_print_private_bfd_data): Add explicit cast to long
393         for struct som_exec_auxhdr fields.
394
395 2005-04-21  Nick Clifton  <nickc@redhat.com>
396
397         * aout-adobe.c: Convert to ISO C and fix formatting.
398         * aout-arm.c: Convert to ISO C and fix formatting.
399         * aout-cris.c: Convert to ISO C and fix formatting.
400         * aout-ns32k.c: Convert to ISO C and fix formatting.
401         * aout-tic30.c: Convert to ISO C and fix formatting.
402         * coffcode.h: Convert to ISO C and fix formatting.
403         * coffswap.h: Convert to ISO C and fix formatting.
404         * i386aout.c: Convert to ISO C and fix formatting.
405         * libaout.h: Convert to ISO C and fix formatting.
406         * libcoff-in.h: Convert to ISO C and fix formatting.
407         * libcoff.h: Convert to ISO C and fix formatting.
408         * libecoff.h: Convert to ISO C and fix formatting.
409         * libnlm.h: Convert to ISO C and fix formatting.
410         * libpei.h: Convert to ISO C and fix formatting.
411         * libxcoff.h: Convert to ISO C and fix formatting.
412         * nlm-target.h: Convert to ISO C and fix formatting.
413         * nlm.c: Convert to ISO C and fix formatting.
414         * nlm32-alpha.c: Convert to ISO C and fix formatting.
415         * nlm32-i386.c: Convert to ISO C and fix formatting.
416         * nlm32-ppc.c: Convert to ISO C and fix formatting.
417         * nlm32-sparc.c: Convert to ISO C and fix formatting.
418         * nlmcode.h: Convert to ISO C and fix formatting.
419         * nlmswap.h: Convert to ISO C and fix formatting.
420         * pe-mips.c: Convert to ISO C and fix formatting.
421         * peXXigen.c: Convert to ISO C and fix formatting.
422         * peicode.h: Convert to ISO C and fix formatting.
423         * vms-gsd.c: Convert to ISO C and fix formatting.
424         * vms-hdr.c: Convert to ISO C and fix formatting.
425         * vms-misc.c: Convert to ISO C and fix formatting.
426         * vms-tir.c: Convert to ISO C and fix formatting.
427         * vms.c: Convert to ISO C and fix formatting.
428         * vms.h: Convert to ISO C and fix formatting.
429
430         * coffgen.c (coff_print_symbol): Restore correct formatting of
431         output.
432
433 2005-04-20  David S. Miller  <davem@davemloft.net>
434
435         * elfxx-sparc.c (sparc_elf_r_symndx_64): Fix compiler warning.
436         (_bfd_sparc_elf_link_hash_table_create): Likewise.
437         (allocate_dynrelocs): Likewise.
438
439 2005-04-20  Jerome Guitton  <guitton@gnat.com>
440
441         * configure.in: Fix the check for basename declaration. Add check
442         for declarations of ftello, ftello64, fseeko, fseeko64.
443         * configure: Regenerate.
444         * config.in: Ditto.
445         * sysdep.h: If needed, declare ftello, ftello64, fseeko, fseeko64.
446
447 2005-04-19  David S. Miller  <davem@davemloft.net>
448
449         * elfxx-sparc.c: New file.
450         * elfxx-sparc.h: New file.
451         * Makefile.in (BFD32_BACKENDS): Add elfxx-sparc.lo
452         (BFD32_BACKENDS_CFILES): Add elfxx-sparc.c
453         (elfxx-sparc.lo): New rule.
454         (elf32-sparc.lo): Add elfxx-sparc.h dependency.
455         (elf64-sparc.lo): Likewise.
456         * configure.in (bfd_elf32_sparc_vec): Add elfxx-sparc.lo
457         (bfd_elf64_sparc_vec): Likewise.
458         * configure: Regenerate.
459         * elf32-sparc.c: Remove common code now in elfxx-sparc.c
460         * elf64-sparc.c: Likewise, also use elf64_sparc_*() naming
461         which is more consistent with elf32-sparc.c
462
463 2005-04-19  Daniel Jacobowitz  <dan@codesourcery.com>
464
465         * elfxx-mips.c (struct mips_elf_link_hash_entry): Update comment.
466         (mips_elf_create_local_got_entry): Check h->root.forced_local.
467
468 2005-04-19  Alan Modra  <amodra@bigpond.net.au>
469
470         * elf32-ppc.c (ppc_elf_check_relocs): Don't bother with
471         dynamic relocs in non-SEC_ALLOC sections.
472         (ppc_elf_gc_sweep_hook): Likewise.
473         (ppc_elf_relax_section): Likewise.
474         (ppc_elf_relocate_section): Likewise.
475
476 2005-04-18  Nick Clifton  <nickc@redhat.com>
477
478         * aix5ppc-core.c (xcoff64_core_p): Fix compile time warning
479         assigning a value to return_value.
480
481 2005-04-17  H.J. Lu  <hongjiu.lu@intel.com>
482
483         PR 855
484         * elf.c (_bfd_elf_copy_private_section_data): Don't copy linker
485         created group data.
486
487 2005-04-17  H.J. Lu  <hongjiu.lu@intel.com>
488
489         PR 855
490         * elf.c (setup_group): Properly handle zero group count.
491
492 2005-04-17  Mark Kettenis  <kettenis@gnu.org>
493
494         * som.c (hppa_som_reloc, som_mkobject, som_is_space)
495         (som_is_subspace, compare_subspaces, som_compute_checksum)
496         (som_build_and_write_symbol_table, som_slurp_symbol_table): New
497         protoypes.
498         (hppa_som_reloc, compare_syms, compare_subspaces)
499         (som_print_symbol, som_get_section_contents)
500         (som_set_section_contents): Remove space after 'void *'.
501         (som_bfd_print_private_bfd_data): Use %lx to print longs.
502         (som_bfd_merge_private_bfd_data)
503         (som_bfd_copy_private_header_data, som_bfd_set_private_flags): New
504         defines.
505
506 2004-04-15  Julian Brown  <julian@codesourcery.com>
507
508         * bfd-in.h (bfd_elf32_arm_set_target_relocs): Update prototype.
509         * bfd-in2.h: Regenerate.
510         * elf32-arm.c (elf32_arm_link_hash_table): New field, 'use_blx'.
511         (elf32_arm_link_hash_table_create): Initialise fix_v4bx, use_blx.
512         (bfd_elf32_arm_set_target_relocs): Handle use_blx.
513         (elf32_arm_final_link_relocate): Use Thumb BLX for R_ARM_THM_PC22
514         relocations if requested to.
515         (allocate_dynrelocs): Don't count size of omitted Thumb stubs based on
516         use_blx rather than symbian_p.
517         (elf32_arm_finish_dynamic_symbol): Don't output Thumb PLT stubs if
518         use_blx is in effect.
519         (elf32_arm_symbian_link_hash_table_create): Enable use_blx by default
520         for SymbianOS.
521
522 2005-04-15  Nick Clifton  <nickc@redhat.com>
523
524         * coffgen.c (coff_print_symbol): Use fprintf_vma to print vma
525         values.
526
527 2005-04-15  Alan Modra  <amodra@bigpond.net.au>
528
529         PR ld/815
530         * elflink.c (elf_smash_syms): Clear undef.next if it's not being
531         used as a list pointer.
532
533 2005-04-14  Alan Modra  <amodra@bigpond.net.au>
534
535         * Makefile.am (NO_WERROR): Define.
536         * warning.m4: New file
537         * acinclude.m4: Include warning.m4.
538         * configure.in: Invoke AM_BINUTILS_WARNINGS.
539         * Makefile.in: Regenerate.
540         * configure: Regenerate.
541
542 2005-04-14  Alan Modra  <amodra@bigpond.net.au>
543
544         * merge.c (sec_merge_emit): Tidy.  Check for bfd_zmalloc errors.
545         Write trailing padding.
546
547         * merge.c (merge_strings): Round up section size for alignment.
548
549 2005-04-14  David S. Miller  <davem@davemloft.net>
550
551         Add TLS support for 64-bit Sparc ELF.
552         *  elf64-sparc.c (sparc64_elf_dyn_relocs,
553         sparc64_elf_link_hash_entry, sparc64_elf_obj_tdata): New structs.
554         (GOT_UNKNOWN, GOT_NORMAL, GOT_TLD_GD, GOT_TLD_IE,
555         sparc64_elf_hash_entry, sparc64_elf_tdata,
556         sparc64_elf_local_got_tls_type): New defines.
557         (sparc64_elf_mkobject): New function.
558         (sparc64_elf_link_hash_table): Add members for dynamic linker
559         sections PLT, RELPLT, DYNBSS, and RELBSS.  Add tls_ldm_got
560         uion to track TLS GOT references.  Add sym_sec to cache
561         mappings from local sym to section.
562         (link_hash_newfunc): New function.
563         (sparc64_elf_bfd_link_hash_table_create): Rename to
564         sparc64_elf_link_hash_table_create for consistency.
565         Pass link_hash_newfunc to _bfd_elf_link_hash_table_init.
566         (sparc64_elf_create_dynamic_sections): Initialize new section
567         members of sparc64_elf_link_hash_table.  Only init srelbss
568         if not-shared.
569         (sparc64_elf_copy_indirect_symbol, sparc64_elf_tls_transition):
570         New functions.
571         (SPARC_NOP): Define.
572         (sparc64_elf_build_plt, sparc64_elf_plt_entry_offset,
573         sparc64_elf_plt_ptr_offset): Delete.
574         (sparc64_plt_entry_build): New function to build PLT entries
575         gradually instread of all at once at the end of linking.
576         (sparc64_elf_check_relocs): Delete dynobj, sgot, and srelgot
577         local vars.  Get them from sparc64_elf_hash_table instead.
578         Check early on if r_symndx is in bounds.  Handle TLS transitions.
579         Account for TLS GOT references and DF_STATIC_TLS, as needed.
580         For TLS relocs, record the tls_type in either
581         sparc64_elf_local_got_tls_type or sparc64_elf_hash_entry as
582         appropriate.  For R_SPARC_TLS_{GD,LDM}_CALL, emit a reference
583         to the __tls_get_addr symbol.  For PLT relocs, track references
584         via h->plt.refcount.  When R_SPARC_{PC10,PC22,PC_HH22,PC_HM10,
585         PC_LM22} and h not-NULL, set h->non_got_ref.  For global data
586         symbol references, count the number of relocations needed for
587         that symbol.  For default switch case, don't error, this lets
588         the TLS relocs not explicitly handled by this function get
589         accepted.
590         (sparc64_elf_gc_mark_hook, sparc64_gc_sweep_hook): New functions.
591         (sparc64_elf_adjust_dynamic_symbol): Remove dynobj local var, get
592         it from sparc64_elf_hash_table.  Store the real PLT offset
593         in h->plt.offset, and build PLT entries one at a time.  Also
594         get .dynbss section pointer from htab.
595         (allocate_dynrelocs, readonly_dynrelocs,
596         sparc64_omit_section_dynsym): New functions.
597         (sparc64_elf_omit_section_dynsym): Use these new functions as
598         helpers.
599         (dtpoff_base, tpoff): New functions.
600         (sparc64_elf_relocate_section): Kill dynobj, sgot, and splt
601         locals, get them from sparc64_elf_hash_table.  Handle TLS
602         relocations and refcounting in main relocation loop.
603         (sparc64_elf_finish_dynamic_symbol): Use
604         sparc64_elf_link_hash_table.  Build PLT entries as we see
605         them.  Handle TLS GOT relocations.
606         (sparc64_elf_finish_dynamic_sections): Get sgot and dynobj
607         from sparc64_elf_hash_table.  Initialize only PLT header
608         not all entries since we not build PLT entries one by one.
609         (elf_backend_copy_indirect_symbol, bfd_elf64_mkobject,
610         elf_backend_gc_mark_hook, elf_backend_gc_sweep_hook,
611         elf_backend_can_gc_sections, elf_backend_can_refcount): Define.
612
613 2005-04-13  Daniel Jacobowitz  <dan@codesourcery.com>
614
615         * elflink.c (elf_link_input_bfd): Update check for removed
616         sections.
617
618 2005-04-12  Alan Modra  <amodra@bigpond.net.au>
619
620         * Makefile.am: Run "make dep-am".
621         * Makefile.in: Regenerate.
622         * aclocal.m4: Regenerate.
623         * libcoff.h: Regenerate.
624
625 2005-04-11  H.J. Lu  <hongjiu.lu@intel.com>
626
627         * linker.c (_bfd_generic_link_output_symbols): Also check if
628         the output section of an input section has been removed from
629         the output file.
630
631         * section.c (bfd_section_list_remove): Clear the next field
632         of the removed section.
633         (bfd_section_removed_from_list): New.
634         * bfd-in2.h: Regenerated.
635
636 2005-04-11  David S. Miller  <davem@davemloft.net>
637
638         * elf32-sparc.c (elf32_sparc_relocate_section,
639         R_SPARC_TLS_LDO_{HIX22,LOX10}): When not shared, transition to
640         R_SPARC_TLS_LE_{HIX22,LOX10}.
641         (elf32_sparc_relocate_section, R_SPARC_TLS_{LDO,LE}_HIX22): Only
642         xor relocation with 0xffffffff if R_SPARC_TLS_LE_HIX22.
643         (elf32_sparc_relocate_section, R_SPARC_TLS_{LDO,LE}_LOX10): Only
644         or 0x1c00 into relocation if R_SPARC_TLS_LE_HIX22.
645
646 2005-04-11  H.J. Lu  <hongjiu.lu@intel.com>
647
648         * coffcode.h (STRING_SIZE_SIZE): Updated to match libcoff-in.h.
649
650 2005-04-11  Nick Clifton  <nickc@redhat.com>
651         
652         * aout-target.h:  Convert to ISO C.
653         * aoutf1.h:  Convert to ISO C.
654         * aoutx.h:  Convert to ISO C.
655         * bout.c:  Convert to ISO C.
656         * dwarf1.c:  Convert to ISO C.
657         * ecoffswap.h:  Convert to ISO C.
658         * freebsd.h:  Convert to ISO C.
659         * genlink.h:  Convert to ISO C.
660         * ieee.c:  Convert to ISO C.
661         * ihex.c:  Convert to ISO C.
662         * libcoff-in.h:  Convert to ISO C.
663         * mach-o.c:  Convert to ISO C.
664         * mach-o.h:  Convert to ISO C.
665         * netbsd.h:  Convert to ISO C.
666         * ns32k.h:  Convert to ISO C.
667         * ns32knetbsd.c:  Convert to ISO C.
668         * oasys.c:  Convert to ISO C.
669         * pdp11.c:  Convert to ISO C.
670         * pef-traceback.h:  Convert to ISO C.
671         * pef.c:  Convert to ISO C.
672         * pef.h:  Convert to ISO C.
673         * riscix.c:  Convert to ISO C.
674         * som.c:  Convert to ISO C.
675         * som.h:  Convert to ISO C.
676         * srec.c:  Convert to ISO C.
677         * stabs.c:  Convert to ISO C.
678         * sunos.c:  Convert to ISO C.
679         * tekhex.c:  Convert to ISO C.
680         * versados.c:  Convert to ISO C.
681         * version.h:  Convert to ISO C.
682         * xcoff-target.h:  Convert to ISO C.
683         * xcofflink.c:  Convert to ISO C.
684         * xsym.c:  Convert to ISO C.
685         * xsym.h:  Convert to ISO C.
686
687 2005-04-08  Paul Brook  <paul@codesourcery.com>
688
689         * elf32-arm.c (ARM2THUMB_GLUE_SIZE): Rename...
690         (ARM2THUMB_STATIC_GLUE_SIZE): ... to this.
691         (ARM2THUMB_PIC_GLUE_SIZE): Define.
692         (a2t1p_ldr_insn, a2t2p_add_pc_insn, a2t3p_bx_r12_insn): Add.
693         (elf32_arm_to_thumb_stub): Create PIC stubs.
694         (record_arm_to_thumb_glue): Use different stub size for relocatable
695         images.
696
697 2005-04-05  Alan Modra  <amodra@bigpond.net.au>
698
699         * elf64-ppc.c (dec_dynrel_count): New function split out from
700         ppc64_elf_edit_toc, with additional code from ppc64_elf_edit_opd.
701         (ppc64_elf_edit_toc, ppc64_elf_edit_opd): Use it.
702         (ppc64_elf_tls_optimize): Likewise.
703
704 2005-04-05  Mark Kettenis  <kettenis@gnu.org>
705
706         * netbsd-core.c (SPARC_WCOOKIE_OFFSET): Renamed from
707         CORE_WCOOKIE_OFFSET.
708         (SPARC64_WCOOKIE_OFFSET): New.
709         (netbsd_core_file_p): Provide .wcookie section for OpenBSD/sparc64.
710
711 2005-04-05  Nick Clifton  <nickc@redhat.com>
712
713         * po/rw.po: New translation: Kinyarwanda
714         * configure.in (ALL_LINGUAS): Add rw
715         * configure: Regenerate.
716
717 2005-04-05  Richard Sandiford  <rsandifo@redhat.com>
718
719         * elfxx-mips.c (MIPS_ELF_OPTIONS_SECTION_NAME_P): New macro.
720         (_bfd_mips_elf_section_from_shdr): Use it to check for recognized
721         SHT_MIPS_OPTIONS names.  Allow all sections with unrecognised
722         section flags.
723         (_bfd_mips_elf_fake_sections): Use MIPS_ELF_OPTIONS_SECTION_NAME_P
724         to check for SHT_MIPS_OPTIONS sections.
725         (_bfd_mips_elf_set_section_contents): Likewise.
726
727 2005-04-04  Eric Christopher  <echristo@redhat.com>
728
729         * elfxx-mips.c (_bfd_elf_mips_get_relocated_section_contents):
730         Clean up gp handling code.
731
732 2005-04-04  H.J. Lu  <hongjiu.lu@intel.com>
733
734         * elf.c (bfd_elf_set_group_contents): Ignore linker created
735         group section. 
736         (assign_section_numbers): Accept link_info. Check SHT_GROUP
737         sections for relocatable files only. Remove the linker created
738         group sections.
739         (_bfd_elf_compute_section_file_positions): Pass link_info to
740         assign_section_numbers.
741
742         * elfxx-ia64.c (elfNN_ia64_object_p): New.
743         (elf_backend_object_p): Defined.
744
745 2005-04-04  H.J. Lu  <hongjiu.lu@intel.com>
746
747         * elf-bfd.h (elf_section_data): Use (sec) instead of sec.
748
749 2005-04-03  Fred Fish  <fnf@specifixinc.com>
750
751         * dwarf2.c (struct dwarf2_debug): Add dwarf_ranges_buffer and
752         dwarf_ranges_size members.
753         (struct comp_unit): Add base_address member.
754         (struct funcinfo): Replace low/high members with an arange.
755         (arange_add): Replace incoming "unit" parameter with "abfd" and
756         "first_arange" pointers.  Reorganize/rewrite function body.
757         (decode_line_info): Change arange_add call to pass bfd and arange
758         pointers.
759         (lookup_address_in_line_info_table): Use arange list instead of
760         individual low/high members.  Walk function's arange list to find
761         lowest PC in list, to test for overlapping functions.
762         (read_debug_ranges): New function, reads the debug_ranges section.
763         (lookup_address_in_function_table): Use arange list instead of
764         individual low/high members.  Rewrite to find smallest range that
765         matches.
766         (read_rangelist): Read a given rangelist from debug_ranges.
767         (scan_unit_for_functions): Use arange list instead of individual
768         low/high members.  Handle a DW_AT_ranges attribute.
769         (parse_comp_unit): Use arange list instead of individual low/high
770         members.  Save comp unit base address.  Handle a DW_AT_ranges
771         attribute.
772
773 2005-04-01  H.J. Lu  <hongjiu.lu@intel.com>
774
775         * elf.c (assign_section_numbers): Really use the kept section.
776
777 2005-03-31  H.J. Lu  <hongjiu.lu@intel.com>
778
779         * elf-bfd.h (_bfd_elf_check_kept_section): New.
780
781         * elf.c (assign_section_numbers): When sh_link points to a
782         discarded section, call _bfd_elf_check_kept_section to see if
783         the kept section can be used. Otherwise reject sh_link
784         pointing to discarded section.
785
786         * elflink.c (_bfd_elf_check_kept_section): New.
787         (elf_link_input_bfd): Use it.
788
789 2005-04-01  Alan Modra  <amodra@bigpond.net.au>
790
791         * elf64-ppc.c (ppc64_elf_edit_toc): Account for dynamic relocs
792         that we no longer need.
793
794 2005-04-01  Alan Modra  <amodra@bigpond.net.au>
795
796         * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Return -1 on errors
797         rather than 0.
798         (ppc64_elf_check_relocs): Remove unnecessary SEC_ALLOC check.
799
800 2005-03-31  H.J. Lu  <hongjiu.lu@intel.com>
801
802         * elf.c (assign_section_numbers): Fix a typo.
803
804 2005-03-31  H.J. Lu  <hongjiu.lu@intel.com>
805
806         * elflink.c (elf_link_input_bfd): Remove the extra `\n' in
807         error message.
808         (_bfd_elf_section_already_linked): Likewise.
809
810 2005-03-31  Jerome Guitton  <guitton@gnat.com>
811
812         * config.in: Regenerate.
813
814 2005-03-31  Jerome Guitton  <guitton@gnat.com>
815
816         * config.in (HAVE_DECL_BASENAME): New configure macro.
817         * configure.in: Check for basename.
818         * configure: Regenerate.
819
820 2005-03-30  Julian Brown  <julian@codesourcery.com>
821
822         * bfd-in.h (bfd_is_arm_mapping_symbol_name): Rename from
823         bfd_elf32_is_arm_mapping_symbol_name.
824         * bfd-in2.h: Regenerate.
825         * cpu-arm.c (bfd_is_arm_mapping_symbol_name): Rename from
826         bfd_elf32_is_arm_mapping_symbol_name.
827         * elf32-arm.c (elf32_arm_is_target_special_symbol): Rename
828         bfd_elf32_is_arm_mapping_symbol_name to bfd_is_arm_mapping_symbol_name.
829         (arm_elf_find_function): Likewise.
830         (elf32_arm_output_symbol_hook): Likewise.
831
832 2005-03-30  Julian Brown  <julian@codesourcery.com>
833
834         * bfd-in.h (bfd_elf32_is_arm_mapping_symbol_name): Add prototype.
835         * bfd-in2.h: Regenerate.
836         * elf32-arm.c (elf32_arm_is_target_special_symbol): Rename call to
837         bfd_elf32_is_arm_mapping_symbol_name.
838         (elf32_arm_output_symbol_hook): Likewise.
839         (arm_elf_find_function): Likewise, and include STT_NOTYPE in test for
840         mapping symbols.
841         (is_arm_mapping_symbol_name): Function moved from here...
842         * cpu-arm.c (bfd_elf32_is_arm_mapping_symbol_name): ...to here, renamed
843         and made global.
844
845 2005-03-29  Aaron W. LaFramboise  <aaron98wiridge9@aaronwl.com>
846
847         * configure.in: Check for ffs decl and alphabetize.
848         * config.in: Regenerate.
849         * configure: Regenerate.
850         * sysdep.h [NEED_DECLARATION_FFS] (ffs): Prototype and 
851         alphabetize.
852
853 2005-03-29  Fred Fish  <fnf@specifixinc.com>
854
855         * dwarf2.c (struct comp_unit): Fix typo.
856         (scan_unit_for_functions): Remove unused local variable "name"
857         and dead code that set it.
858
859 2005-03-29  Daniel Jacobowitz  <dan@codesourcery.com>
860             Phil Blundell  <philb@gnu.org>
861
862         * bfd-in2.h, libbfd.h: Regenerated.
863         * reloc.c: Add ARM TLS relocations.
864         * elf32-arm.c (elf32_arm_howto_table): Add dynamic TLS
865         relocations.
866         (elf32_arm_tls_gd32_howto, elf32_arm_tls_ldo32_howto)
867         (elf32_arm_tls_ldm32_howto, elf32_arm_tls_le32_howto)
868         (elf32_arm_tls_ie32_howto): New.
869         (elf32_arm_howto_from_type): Support TLS relocations.
870         (elf32_arm_reloc_map): Likewise.
871         (elf32_arm_reloc_type_lookup): Likewise.
872         (TCB_SIZE): Define.
873         (struct elf32_arm_obj_tdata): New.
874         (elf32_arm_tdata, elf32_arm_local_got_tls_type): Define.
875         (elf32_arm_mkobject): New function.
876         (struct elf32_arm_relocs_copied): Add pc_count.
877         (elf32_arm_hash_entry, GOT_UNKNOWN, GOT_NORMAL, GOT_TLS_GD)
878         (GOT_TLS_IE): Define.
879         (struct elf32_arm_link_hash_table): Add tls_ldm_got.
880         (elf32_arm_link_hash_newfunc): Initialize tls_type.
881         (elf32_arm_copy_indirect_symbol): Copy pc_count and tls_type.
882         (elf32_arm_link_hash_table_create): Initialize tls_ldm_got.
883         (dtpoff_base, tpoff): New functions.
884         (elf32_arm_final_link_relocate): Handle TLS relocations.
885         (IS_ARM_TLS_RELOC): Define.
886         (elf32_arm_relocate_section): Warn about TLS mismatches.
887         (elf32_arm_gc_sweep_hook): Handle TLS relocations and pc_count.
888         (elf32_arm_check_relocs): Detect invalid symbol indexes.  Handle
889         TLS relocations and pc_count.
890         (elf32_arm_adjust_dynamic_symbol): Check non_got_ref.
891         (allocate_dynrelocs): Handle TLS.  Bind REL32 relocs to local
892         calls.
893         (elf32_arm_size_dynamic_sections): Handle TLS.
894         (elf32_arm_finish_dynamic_symbol): Likewise.
895         (bfd_elf32_mkobject): Define.
896
897 2005-03-29  Daniel Jacobowitz  <dan@codesourcery.com>
898
899         * elf32-arm.c (elf32_arm_check_relocs): Increment count for all
900         relocation types.  Don't count relocations which will use a PLT.
901
902 2005-03-29  Joel Brobecker  <brobecker@gnat.com>
903
904         * elf.c (elfcore_grok_nto_status): Print tid as long.
905         (elfcore_grok_nto_regs): Likewise.
906
907 2005-03-29  Joel Brobecker  <brobecker@gnat.com>
908
909         * irix-core.c: Remove some unnecessary prototypes.
910
911 2005-03-28  Joel Brobecker  <brobecker@adacore.com>
912
913         * irix-core.c: Convert to ISO C.
914
915 2005-03-28  Joel Brobecker  <brobecker@adacore.com>
916
917         * irix-core.c (do_sections): Replace + by | in expression.
918         (irix_core_core_file_matches_executable_p): Add ATTRIBUTE_UNUSED
919         to unused parameters to avoid a compiler warning.
920
921 2005-03-28  Mark Kettenis  <kettenis@gnu.org>
922
923         * netbsd-core.c: Convert to ISO C.  Fix formatting.
924
925 2005-03-24  Eric Christopher  <echristo@redhat.com>
926
927         * elfxx-mips.c: Revert previous patch.
928
929 2005-03-24  Nick Clifton  <nickc@redhat.com>
930
931         * targets.c (_bfd_target_vector): Only include the
932         bfd_elf32_ia64_hpux_big_vec vector when building a 64-bit BFD with
933         all targets enabled.
934
935 2005-03-24  James E Wilson  <wilson@specifixinc.com>
936
937         * Makefile.am (BFD32_BACKENDS): Delete elf32-ia64.lo.
938         (BFD64_BACKENDS): Add elf32-ia64.lo.
939         * Makefile.in: Regenerate.
940
941 2005-03-23  Eric Christopher  <echristo@redhat.com>
942
943         * elfxx-mips.c (MIPS_ELF_READONLY_SECTION): New.
944         (mips_elf_calculate_relocation): Use. Define DF_TEXTREL
945         after emitting relocation.
946         (_bfd_mips_elf_adjust_dynamic_symbol): Ditto.
947         (_bfd_mips_elf_check_relocs): Remove code to set DF_TEXTREL
948         and readonly_reloc.
949
950 2005-03-23  Mike Frysinger  <vapier@gentoo.org>
951             Nick Clifton  <nickc@redhat.com>
952
953         * config.bfd: Accept any C library to accompany a GNU Linux
954         implementation, not just the GNU C library.
955         * configure.in: Likewise.
956         * configure: Regenerate.
957
958 2005-03-22  H.J. Lu  <hongjiu.lu@intel.com>
959
960         * bfd-in.h (_bfd_elf_provide_symbol): New.
961         * bfd-in2.h: Regenerated.
962
963         * elf32-ppc.c (set_linker_sym): Moved to elflink.c.
964         (ppc_elf_set_sdata_syms): Call _bfd_elf_provide_symbol instead
965         of set_linker_sym.
966
967         * elflink.c (_bfd_elf_provide_symbol): New. Moved and renamed
968         from elf32-ppc.c.
969
970 2005-03-22  Hans-Peter Nilsson  <hp@axis.com>
971
972         * hash.c (strtab_hash_newfunc): Fix typo in allocated size.
973
974 2005-03-22  Bob Wilson  <bob.wilson@acm.org>
975
976         * xtensa-isa.c (xtensa_opcode_lookup, xtensa_state_lookup,
977         xtensa_sysreg_lookup_name, xtensa_interface_lookup,
978         xtensa_funcUnit_lookup): Skip bsearch call if count is zero.
979         (xtensa_opcode_decode): Rearrange code.
980
981 2005-03-22  Nick Clifton  <nickc@redhat.com>
982
983         * binary.c: Convert to ISO C90 formatting.
984         * coff-arm.c: Convert to ISO C90 formatting.
985         * coffgen.c: Convert to ISO C90 formatting.
986         * elf32-gen.c: Convert to ISO C90 formatting.
987         * elf64-gen.c: Convert to ISO C90 formatting.
988         * hash.c: Convert to ISO C90 formatting.
989         * ieee.c: Convert to ISO C90 formatting.
990
991 2005-03-22  Daniel Jacobowitz  <dan@codesourcery.com>
992
993         * elf32-arm.c (elf32_arm_final_link_relocate): Don't fail for
994         unresolved symbols in R_ARM_NONE relocations.
995
996 2005-03-22  Daniel Jacobowitz  <dan@codesourcery.com>
997
998         * elf32-arm.c (elf32_arm_final_link_relocate): Add
999         UNRESOLVED_RELOC_P argument.  Set it appropriately.
1000         (elf32_arm_relocate_section): Update call to
1001         elf32_arm_final_link_relocate.  Don't clobber RELOCATION; use
1002         unresolved_reloc instead.
1003
1004 2005-03-23  Alan Modra  <amodra@bigpond.net.au>
1005
1006         * elflink.c (elf_link_add_object_symbols): Set SEC_EXCLUDE on
1007         .gnu.warning.* sections.
1008
1009 2005-03-22  Alan Modra  <amodra@bigpond.net.au>
1010
1011         * elf32-ppc.c (elf_linker_section_pointers_t): Remove
1012         written_address_p.
1013         (ppc_elf_create_linker_section): Don't try to reuse existing section.
1014         (elf_create_pointer_linker_section): Delete info parm.  Don't make
1015         h dynamic.  Don't set written_address_p.
1016         (ppc_elf_check_relocs): Adjust ppc_elf_create_linker_section calls.
1017         (bfd_put_ptr): Delete.
1018         (elf_finish_pointer_linker_section): Remove output_bfd and info parms.
1019         Always write section contents.  Assert global sym is def_regular.
1020         Use offset bottom bit as a written flag.
1021         (ppc_elf_relocate_section): Adjust elf_finish_pointer_linker_section
1022         calls.
1023
1024 2005-03-22  Alan Modra  <amodra@bigpond.net.au>
1025
1026         * elf32-ppc.c (ppc_elf_set_sdata_syms): New function, extracted from..
1027         (ppc_elf_set_sdata_syms): ..here.  Expand comment.  Set .sbss start
1028         and end syms.
1029
1030 2005-03-21  Nick Clifton  <nickc@redhat.com>
1031
1032         * coff-arm.c (coff_link_hash_entry): Only define for non WINCE
1033         targets.
1034         (t2a1_bx_pc_insn): Likewise.
1035         (t2a2_noop_insn): Likewise.
1036         (t2a3_b_insn): Likewise.
1037         (t2a1_push_insn): Likewise.
1038         (t2a2_ldr_insn): Likewise.
1039         (t2a3_mov_insn): Likewise.
1040         (t2a4_bx_insn): Likewise.
1041         (t2a5_pop_insn): Likewise.
1042         (t2a6_bx_insn): Likewise.
1043         (coff_arm_relocate_section): Only declare the high_address
1044         variable for non WINCE targets.
1045
1046 2005-03-22  Alan Modra  <amodra@bigpond.net.au>
1047
1048         * elf32-ppc.c (ppc_elf_add_symbol_hook): Make htab->sbss
1049         SEC_LINKER_CREATED.  Attach to dynobj.
1050         (ppc_elf_size_dynamic_sections): Strip htab->sbss if zero size.
1051
1052 2005-03-21  Alan Modra  <amodra@bigpond.net.au>
1053
1054         * elf32-ppc.c (struct elf_linker_section): Remove sym_hash and
1055         sym_offset.  Add name, bss_name, sym_name, sym_val.
1056         (struct ppc_elf_link_hash_table): Remove sdata and sdata2 pointers.
1057         Add sdata array of elf_linker_section_t.
1058         (ppc_elf_link_hash_table_create): Set name, sym_name, and bss_name.
1059         (enum elf_linker_section_enum): Delete.
1060         (ppc_elf_create_linker_section): Rewrite.  Don't create syms here.
1061         (ppc_elf_check_relocs): Delay ppc_elf_create_linker_section until
1062         the special sections are needed.  Adjust htab->sdata refs.
1063         Ensure dynobj is set in sreloc code.
1064         (ppc_elf_size_dynamic_sections): Strip sdata sections.
1065         (ppc_elf_set_sdata_syms): New function.
1066         (elf_finish_pointer_linker_section): Use 0x8000 for sym_offset.
1067         (ppc_elf_relocate_section): Adjust references to htab->sdata.  Use
1068         sym_val instead of sym_hash.
1069         * elf32-ppc.h (ppc_elf_set_sdata_syms): Declare.
1070
1071 2005-03-21  Alan Modra  <amodra@bigpond.net.au>
1072
1073         * elf32-ppc.c (is_ppc_elf_target): Move to linker part of file.
1074         (ppc_elf_merge_private_bfd_data): Likewise.
1075
1076 2005-03-21  Alan Modra  <amodra@bigpond.net.au>
1077
1078         * elf32-ppc.c (struct elf_linker_section): Remove rel_section.
1079         (ppc_elf_create_linker_section): Don't create rel_section.
1080         (elf_create_pointer_linker_section): Don't size relocs.
1081         (elf_finish_pointer_linker_section): Remove relative_reloc parm.
1082         Don't generate relocs.
1083         (ppc_elf_relocate_section): Adjust calls to
1084         elf_finish_pointer_linker_section.
1085
1086 2005-03-21  Alan Modra  <amodra@bigpond.net.au>
1087
1088         * elf32-ppc.c (is_ppc_elf_target): New function.
1089         (ppc_elf_merge_private_bfd_data): Use it rather than just testing
1090         for bfd_target_elf_flavour.  Do this test before endian check.
1091         (ppc_elf_add_symbol_hook): Use is_pcc_elf_target.
1092         (ppc_elf_size_dynamic_sections): Likewise.
1093
1094 2005-03-20  H.J. Lu  <hongjiu.lu@intel.com>
1095
1096         * elf-bfd.h (elf_backend_data): Add int to
1097         elf_backend_section_from_shdr.
1098         (bfd_elf_section_data): Update comment for this_idx.
1099         (_bfd_elf_make_section_from_shdr): Add int.
1100         * elfxx-mips.h (_bfd_mips_elf_section_from_shdr): Likewise.
1101
1102         * elf.c (_bfd_elf_make_section_from_shdr): Take section index
1103         and use it to set this_idx in bfd_elf_section_data.
1104         (bfd_section_from_shdr): Pass shindex to
1105         _bfd_elf_make_section_from_shdr.
1106         (_bfd_elf_section_from_bfd_section): Use this_idx in
1107         bfd_elf_section_data to find section index.
1108
1109         * elf32-arm.c (elf32_arm_section_from_shdr): Take section
1110         index and pass it to _bfd_elf_make_section_from_shdr.
1111         * elf32-i370.c(i370_elf_section_from_shdr): Likewise.
1112         * elf32-ppc.c (ppc_elf_section_from_shdr): Likewise.
1113         * elf32-sh64.c (sh64_backend_section_from_shdr): Likewise.
1114         * elf32-v850.c (v850_elf_section_from_shdr): Likewise.
1115         * elf64-alpha.c (elf64_alpha_section_from_shdr): Likewise.
1116         * elf64-hppa.c (elf64_hppa_section_from_shdr): Likewise.
1117         * elf64-x86-64.c (elf64_x86_64_section_from_shdr): Likewise.
1118         * elfxx-ia64.c (elfNN_ia64_section_from_shdr): Likewise.
1119         * elfxx-mips.c (_bfd_mips_elf_section_from_shdr): Likewise.
1120
1121 2005-03-19  Danny Smith <dannysmith@users.sourceforge.net>
1122             Ross Ridge  <rridge@csclub.uwaterloo.ca>
1123
1124         * peicode.h (pe_ILF_build_a_bfd): Strip only one prefix
1125         character in IMPORT_NAME_UNDECORATE and IMPORT_NAME_NOPREFIX
1126         cases.  Add comment.
1127
1128 2005-03-18  H.J. Lu  <hongjiu.lu@intel.com>
1129
1130         * elflink.c (elf_mark_used_section): Remove check for special
1131         sections.
1132
1133 2005-03-18  Andreas Schwab  <schwab@suse.de>
1134
1135         * elfxx-ia64.c (elfNN_ia64_install_value): Change type of insn
1136         from bfd_vma to ia64_insn, remove broken cast.
1137
1138 2005-03-18  C Jaiprakash  <cjaiprakash@noida.hcltech.com>
1139
1140         * elf32-m68k.c (elf_cfv4e_plt0_entry): plt entry for coldfire v4e.
1141         (elf_m68k_adjust_dynamic_symbol,elf_m68k_finish_dynamic_symbol,
1142          elf_m68k_finish_dynamic_sections): Use it.
1143
1144 2005-03-17  Paul Brook <paul@codesourcery.com>
1145             Dan Jacobowitz <dan@codesourcery.com>
1146             Mark Mitchell  <mark@codesourcery.com>
1147
1148         * elf32-arm.c (elf32_arm_modify_segment_map): New function.
1149         (elf32_arm_additional_program_headers): Likewise.
1150         (elf_backend_modify_segment_map): Define.
1151         (elf_backend_additional_program_headers): Likewise.
1152         (elf32_arm_symbian_modify_segment_map): Use
1153         elf32_arm_modify_segment_map.
1154
1155 2005-03-18  H.J. Lu  <hongjiu.lu@intel.com>
1156
1157         * elflink.c (elf_mark_used_section): Check bfd_is_const_section
1158         for special sections.
1159
1160 2005-03-18  Alan Modra  <amodra@bigpond.net.au>
1161
1162         * elf-bfd.h (_bfd_elf_link_renumber_dynsyms): Delete.
1163         * elflink.c (_bfd_elf_link_renumber_dynsyms): Make static, add
1164         section_sym_count param, and return number of section symbols.
1165         (bfd_elf_size_dynamic_sections): Clear section symbol area of
1166         .dynsym contents.  Don't bother calling swap_symbol_out on the
1167         first all-zero dynsym.
1168         (elf_mark_used_section): Formatting.  Avoid twiddling flags in
1169         special sections like bfd_abs_section.
1170         (bfd_elf_gc_sections): Spelling fix.
1171
1172 2005-03-16  Fred Fish  <fnf@specifixinc.com>
1173
1174         PR binutils/790
1175         * dwarf2.c (read_indirect_string): Fix apparent typo, check
1176         dwarf_str_buffer allocation, not dwarf_abbrev_buffer.
1177
1178 2005-03-16  H.J. Lu  <hongjiu.lu@intel.com>
1179
1180         * elflink.c (elf_mark_used_section): New.
1181         (bfd_elf_gc_sections): Call elf_gc_mark_section for
1182         non-relocatable link if we don't do GC.
1183
1184 2005-03-16  Nick Clifton  <nickc@redhat.com>
1185             Ben Elliston  <bje@au.ibm.com>
1186
1187         * configure.in (werror): New switch: Add -Werror to the
1188         compiler command line.  Enabled by default.  Disable via
1189         --disable-werror.
1190         * configure: Regenerate.
1191
1192 2005-03-16  Nick Clifton  <nickc@redhat.com>
1193
1194         * ecoff.c: Convert to ISO C90 formatting.
1195
1196 2005-03-16  Alan Modra  <amodra@bigpond.net.au>
1197
1198         * elf32-ppc.c: Divide file into general and linker specific
1199         functions.  Sort linker functions into roughly the order in which
1200         they are called by the ELF linker code.
1201
1202 2005-03-16  Alan Modra  <amodra@bigpond.net.au>
1203
1204         * elf32-ppc.c (ppc_elf_create_linker_section): Set SEC_LINKER_CREATED
1205         on section.  Correct comment, and add FIXME.
1206         (ppc_elf_additional_program_headers): Don't bump header count for
1207         interp.  Test SEC_ALLOC, not SEC_LOAD, and don't test size.
1208         (ppc_elf_size_dynamic_sections): Don't strip sdata and sdata2, but
1209         do allocate memory if they need it.
1210
1211 2005-03-15  Mikkel Krautz  <krautz@gmail.com>
1212
1213         * config.bfd (x86_64-elf): Add target.
1214
1215 2005-03-15  Alan Modra  <amodra@bigpond.net.au>
1216
1217         * po/es.po: Commit new Spanish translation.
1218
1219 2005-03-14  H.J. Lu  <hongjiu.lu@intel.com>
1220
1221         * elfxx-ia64.c (elfNN_ia64_relocate_section): Set symbo name
1222         for global symbol when reporting overflow.
1223
1224 2005-03-11  Jakub Jelinek  <jakub@redhat.com>
1225
1226         * libbfd-in.h (_bfd_ar_spacepad): New prototype.
1227         * libbfd.h: Rebuilt.
1228         * archive.c (_bfd_ar_spacepad): New function.
1229         (_bfd_construct_extended_name_table, _bfd_write_archive_contents,
1230         bsd_write_armap, _bfd_archive_bsd_update_armap_timestamp,
1231         coff_write_armap): Use it.
1232         (bfd_ar_hdr_from_filesystem): Likewise.  Fix HP-UX large
1233         uid/gid support.
1234         * archive64.c (bfd_elf64_archive_write_armap): Use _bfd_ar_spacepad.
1235
1236 2005-03-10  Mark Kettenis  <kettenis@gnu.org>
1237
1238         * archive.c (_bfd_look_for_bfd_in_cache): Move declaration of
1239         has_table to the start of the function.
1240
1241 2005-03-10  Ben Elliston  <bje@au.ibm.com>
1242
1243         * archive.c: Include hashtab.h.
1244         (struct ar_cache): Rename `arelt' to `arbfd' and remove `next'.
1245         (_bfd_look_for_bfd_in_cache): Reimplement using htab_find.
1246         (hash_file_ptr): New function.
1247         (eq_file_ptr): Likewise.
1248         (_bfd_add_bfd_to_archive_cache): Reimplement using a hash table.
1249         * libbfd-in.h: Include hashtab.h.
1250         (struct artdata): Change `cache' member type to htab_t.
1251         * libbfd.h: Rebuild.
1252
1253 2005-03-08  Daniel Jacobowitz  <dan@codesourcery.com>
1254
1255         * configure.in: Bump version to 2.16.90.
1256         * configure: Regenerated.
1257
1258 2005-03-07  Jakub Jelinek  <jakub@redhat.com>
1259
1260         * opncls.c (opncls_bread, opncls_bclose): Fix if pread resp.
1261         close is a function like macro in system headers.
1262
1263 2005-03-07  Alan Modra  <amodra@bigpond.net.au>
1264
1265         PR ld/778
1266         * elf32-hppa.c (elf32_hppa_create_dynamic_sections): Reinstate
1267         _GLOBAL_OFFSET_TABLE_ as a normal dynamic symbol.
1268
1269 2005-03-06  Alan Modra  <amodra@bigpond.net.au>
1270
1271         * elf.c (elfcore_grok_win32pstatus): Warning fixes.
1272
1273 2005-03-05  Alan Modra  <amodra@bigpond.net.au>
1274
1275         * po/bfd.pot: Regenerate.
1276
1277 2005-03-05  Alan Modra  <amodra@bigpond.net.au>
1278
1279         * elf64-ppc.c (update_plt_info): Don't mark new ABI call syms
1280         with is_func.
1281         (func_desc_adjust): Force dot-syms local in executables as well
1282         as shared libs.
1283
1284 2005-03-04  David Daney  <ddaney@avtrex.com>
1285
1286         * elfxx-mips.c (mips_elf_calculate_relocation): Handle special
1287         '__gnu_local_gp' symbol used by gas -mno-shared.
1288
1289 2005-03-03  H.J. Lu  <hongjiu.lu@intel.com>
1290
1291         * elf-bfd.h (elf_backend_data): Add "const char *" to
1292         elf_backend_section_from_phdr.
1293
1294         * elf.c (bfd_section_from_phdr): Pass "proc" to the
1295         elf_backend_section_from_phdr hook.
1296
1297 2005-03-02  Daniel Jacobowitz  <dan@codesourcery.com>
1298             Joseph Myers  <joseph@codesourcery.com>
1299
1300         * elfxx-mips.c (struct mips_got_entry): Add tls_type.
1301         (struct mips_got_info): Add tls_gotno, tls_assigned_gotno,
1302         and tls_ldm_offset.
1303         (struct mips_elf_got_per_bfd_arg): Add global_count.
1304         (struct mips_elf_count_tls_arg): New.
1305         (struct mips_elf_hash_sort_data): Update comment for min_got_dynindx.
1306         (struct mips_elf_link_hash_entry): Add tls_type and tls_got_offset.
1307         (GOT_NORMAL, GOT_TLS_GD, GOT_TLS_LDM, GOT_TLS_IE)
1308         (GOT_TLS_OFFSET_DONE, GOT_TLS_DONE): Define.
1309         (TLS_RELOC_P): Define.
1310         (TP_OFFSET, DTP_OFFSET): Define.
1311         (dtprel_base, tprel_base): New functions.
1312         (mips_elf_link_hash_newfunc): Initialize tls_type.
1313         (mips_elf_got_entry_hash, mips_elf_got_entry_eq)
1314         (mips_elf_multi_got_entry_hash, mips_elf_multi_got_entry_eq): Handle
1315         TLS entries.
1316         (mips_tls_got_relocs, mips_elf_count_local_tls_relocs)
1317         (mips_elf_count_global_tls_entries, mips_elf_count_global_tls_relocs)
1318         (mips_elf_output_dynamic_relocation, mips_elf_initialize_tls_slots)
1319         (mips_tls_got_index): New functions.
1320         (mips_elf_local_got_index): Add new R_SYMNDX, H, and R_TYPE
1321         arguments.  Pass them to mips_elf_create_local_got_entry.  Use
1322         mips_tls_got_index.
1323         (mips_elf_global_got_index): Add new R_TYPE and INFO arguments.
1324         Handle TLS entries.
1325         (mips_elf_got_page, mips_elf_got16_entry): Update calls to
1326         mips_elf_create_local_got_entry.
1327         (mips_elf_create_local_got_entry): Add new R_SYMNDX, H, and R_TYPE
1328         arguments.  Handle TLS entries.
1329         (mips_elf_sort_hash_table_f): Add non-TLS assertions.
1330         (mips_elf_record_local_got_symbol): Add new TLS_FLAG argument.  Handle
1331         TLS entries.
1332         (mips_elf_record_global_got_symbol): Likewise.
1333         (mips_elf_make_got_per_bfd): Initialize new mips_got_info members.
1334         Count TLS entries.
1335         (mips_elf_merge_gots): Handle TLS entries when merging.
1336         (mips_elf_initialize_tls_index): New function.
1337         (mips_elf_set_global_got_offset): Handle TLS entries.
1338         (mips_elf_adjust_gp): Handle TLS.
1339         (mips_elf_multi_got): Remove redundant call to
1340         mips_elf_resolve_final_got_entries.  Initialize global_count.
1341         Correct a comment.  Initialize new TLS members of mips_got_info.
1342         Assign TLS GOT indexes for new GOTs.
1343         (mips_elf_create_got_section): Initialize new TLS members of
1344         mips_got_info.
1345         (mips_elf_calculate_relocation): Handle TLS relocs.
1346         (_bfd_mips_elf_check_relocs): Likewise.  Update calls to changed
1347         functions.
1348         (_bfd_mips_elf_always_size_sections): Handle TLS.
1349         (_bfd_mips_elf_size_dynamic_sections): Likewise.
1350         (_bfd_mips_elf_finish_dynamic_symbol): Likewise.  Update calls to
1351         changed functions.
1352         (_bfd_mips_elf_copy_indirect_symbol): Copy tls_type.
1353         (_bfd_mips_elf_hide_symbol): Handle TLS.
1354         * elfn32-mips.c (elf_mips_howto_table_rel, elf_mips_howto_table_rela)
1355         (mips_reloc_map): Add TLS relocs.
1356         * elf32-mips.c (elf_mips_howto_table_rel, mips_reloc_map): Likewise.
1357         * elf64-mips.c (mips_elf64_howto_table_rel)
1358         (mips_elf64_howto_table_rela, mips_reloc_map): Likewise.
1359         * reloc.c: Define new MIPS TLS relocations.
1360         * libbfd.h, bfd-in2.h: Regenerated.
1361
1362 2005-03-02  Jan Beulich  <jbeulich@novell.com>
1363
1364         * Makefile.am: Add dependency of cache.o on libiberty.h.
1365         * cache.c: Include libiberty.h.
1366         (bfd_open_file): Use unlink_if_ordinary instead of unlink.
1367
1368 2005-03-01  Zack Weinberg  <zack@codesourcery.com>
1369
1370         * elf.c (bfd_section_from_shdr <default case>): Call
1371         elf_backend_section_from_shdr hook unconditionally, and return
1372         what it returns.
1373         (bfd_section_from_phdr): Similarly, for elf_backend_section_from_phdr.
1374         * elfxx-target.h (elf_backend_section_from_shdr)
1375         (elf_backend_section_from_phdr): Default to
1376         _bfd_elf_make_section_from_shdr and _bfd_elf_make_section_from_phdr
1377         respectively.
1378
1379 2005-03-01  Alan Modra  <amodra@bigpond.net.au>
1380
1381         * targets.h: Typo fix.
1382         * bfd-in2.h: Regenerate.
1383
1384         * bout.c (b_out_write_object_contents): Don't use sizeof on host
1385         structs to size on-disk structures.
1386         (b_out_set_section_contents): Size the external struct, not the
1387         internal one for on-disk size.
1388         (b_out_sizeof_headers): Likewise.
1389
1390 2005-03-01  Alan Modra  <amodra@bigpond.net.au>
1391
1392         * elf64-ppc.c (ppc64_elf_size_stubs): Override defined dot-sym
1393         entry points with the func descriptor as well as undefweak.
1394
1395 2005-02-28  Ross Ridge  <rridge@csclub.uwaterloo.ca>
1396
1397         * peicode.h (pe_ILF_build_a_bfd): Do not assume that an @ will be
1398         present when IMPORT_NAME_UNDOECRATE is used.
1399
1400 2005-02-28  H.J. Lu  <hongjiu.lu@intel.com>
1401
1402         PR 757
1403         * elf-bfd.h (_bfd_elf_merge_symbol): Add a pointer to unsigned
1404         int.
1405
1406         * elf32-sh-symbian.c (sh_symbian_relocate_section): Pass NULL
1407         to _bfd_elf_merge_symbol.
1408
1409         * elflink.c (_bfd_elf_merge_symbol): Use the pointer to
1410         unsigned int to return the alignment of the old common symbol
1411         in the dynamic object.
1412         (_bfd_elf_add_default_symbol): Pass NULL to
1413         _bfd_elf_merge_symbol.
1414         (elf_link_add_object_symbols): Pass &old_alignment to
1415         _bfd_elf_merge_symbol. Get the alignment of the new common
1416         symbol in the dynamic object.
1417
1418 2005-02-24  Ben Elliston  <bje@au.ibm.com>
1419
1420         * coffcode.h (coff_sym_filepos): Remove GNU960 conditional code.
1421         * format.c (bfd_check_format_matches): Likewise.
1422         * archive.c (BFD_GNU960_ARMAG): Likewise.
1423         (bfd_generic_archive_p): Likewise.
1424         (_bfd_write_archive_contents): Likewise.
1425
1426 2005-02-24  H.J. Lu  <hongjiu.lu@intel.com>
1427
1428         * configure.in: (AM_INIT_AUTOMAKE): Set version to 2.15.95.
1429         * configure: Regenerate.
1430
1431 2005-02-24  Julian Brown  <julian@sirius.codesourcery.com>
1432
1433         * elflink.c (elf_link_add_object_symbols): Force symbols in discarded
1434         COMDAT group sections to have default visibility.
1435
1436 2005-02-24  Alan Modra  <amodra@bigpond.net.au>
1437
1438         * coffcode.h (coff_print_aux): Warning fix.
1439         * elf-m10300.c (mn10300_elf_relax_section): Use section->id
1440         instead of section pointer to identify.
1441         * coff-h8300.c (h8300_reloc16_extra_cases): Likewise.  Allocate
1442         the correct size buffer for local sym mangling too.
1443         (h8300_bfd_link_add_symbols): Likewise.
1444         * elf32-sh-symbian.c (sh_symbian_process_embedded_commands): Fix
1445         warning.
1446         * elf32-sh64.c (shmedia_prepare_reloc): Use %B and %p in error message
1447         * elf32-xtensa.c (literal_value_hash): Warning fix.
1448         * versados.c (process_otr): Warning fix.
1449         (versados_canonicalize_reloc): Likewise.
1450         * vms-gsd.c (_bfd_vms_slurp_gsd): Warning fix.
1451         * vms.c (fill_section_ptr): Warning fix.
1452
1453 2005-02-23  H.J. Lu  <hongjiu.lu@intel.com>
1454
1455         * coff-tic54x.c (SWAP_OUT_RELOC_EXTRA): Defined.
1456         * coff-tic80.c (SWAP_OUT_RELOC_EXTRA): Likewise.
1457
1458 2005-02-23  Nick Clifton  <nickc@redhat.com>
1459
1460         * elfxx-mips.c (mips_elf_create_dynamic_relocation): Initialise
1461         the relvaddr field of the Elf32_crinfo structure.
1462
1463         * elf32-m68hc1x.c (elf32_m68hc11_relocate_section): Initialise
1464         variables that are passed by reference to
1465         m68hc11_get_relocation_value in case that function does not
1466         initialise them.
1467
1468         * elf32-cr16c.c (cr16c_elf_final_link_relocate): Remove duplicated
1469         return statements and replace with a single return at the end of
1470         the function.  This helps pacify the flow analysis code in gcc 4.0.
1471
1472         * elf.c (_bfd_elf_compute_section_file_positions): Initialise
1473         strtab to avoid compile time warning.
1474
1475 2005-02-23  Ben Elliston  <bje@au.ibm.com>
1476
1477         * opncls.c (bfd_zalloc): Document this function.
1478
1479 2005-02-21  H.J. Lu  <hongjiu.lu@intel.com>
1480
1481         * coffcode.h (sec_to_styp_flags): Replaced SEC_CLINK with
1482         SEC_TIC54X_CLINK. Replace SEC_BLOCK with SEC_TIC54X_BLOCK.
1483         Replace SEC_SHARED with SEC_COFF_SHARED.
1484         (styp_to_sec_flags): Likewise.
1485
1486         * elfxx-target.h (TARGET_BIG_SYM): Remove SEC_ARCH_BIT_0.
1487         (TARGET_LITTLE_SYM): Likewise.
1488
1489         * section.c (SEC_ARCH_BIT_0): Removed.
1490         (SEC_LINK_DUPLICATES_SAME_CONTENTS): Defined with
1491         SEC_LINK_DUPLICATES_ONE_ONLY and SEC_LINK_DUPLICATES_SAME_SIZE.
1492         (SEC_SHARED): Renamed to ...
1493         (SEC_COFF_SHARED): This.
1494         (SEC_BLOCK): Renamed to ...
1495         (SEC_TIC54X_BLOCK): This.
1496         (SEC_CLINK): Renamed to ...
1497         (SEC_TIC54X_CLINK): This.
1498         (SEC_XXX): Rearranged. Move SEC_COFF_SHARED_LIBRARY,
1499         SEC_COFF_SHARED, SEC_TIC54X_BLOCK and SEC_TIC54X_CLINK to the
1500         end.
1501         * bfd-in2.h: Regenerated.
1502
1503 2005-02-21  Fred Fish  <fnf@specifixinc.com>
1504
1505         * dwarf2.c (find_abstract_instance_name): Call recursively
1506         to handle a DW_AT_specification.
1507
1508 2005-02-21  Thiemo Seufer  <seufer@csv.ica.uni-stuttgart.de>
1509
1510         * elfxx-mips.c (ecoff_swap_rpdr_out, mips_elf_output_extsym,
1511         mips_elf_create_dynamic_relocation,
1512         _bfd_mips_elf_size_dynamic_sections, _bfd_mips_elf_final_link):
1513         Remove #if 0'd code.
1514
1515 2005-02-21  Alan Modra  <amodra@bigpond.net.au>
1516
1517         * Makefile.am: Run "make dep-am"
1518         * Makefile.in: Regenerate.
1519
1520 2005-02-21  Alan Modra  <amodra@bigpond.net.au>
1521
1522         * coffgen.c (bfd_coff_get_comdat_section): Check that
1523         coff_section_data isn't NULL.
1524
1525 2005-02-21  Alan Modra  <amodra@bigpond.net.au>
1526
1527         * bfd-in.h (bfd_elf_bfd_from_remote_memory): Warning fix.
1528         * coff-m68k.c (bfd_m68k_coff_create_embedded_relocs): Likewise.
1529         * coff-rs6000.c (xcoff_write_armap_big): Warning fixes.  Remove
1530         useless assignments.
1531         (xcoff_write_archive_contents_big): Likewise.
1532         (_bfd_xcoff_put_ldsymbol_name): Likewise.
1533         * coff64-rs6000.c (_bfd_xcoff64_put_ldsymbol_name): Likewise.
1534         * coffgen.c (coff_write_symbols): Make "written" a bfd_vma.
1535         * cofflink.c (process_embedded_commands): Warning fixes.
1536         * cpu-arm.c: Delete unnecessary prototypes.  Convert to C90.
1537         Warning fixes.
1538         * dwarf2.c: Warning fixes.
1539         * elf-bfd.h: Likewise.
1540         * elf-eh-frame.c: Likewise.
1541         * elf-strtab.c: Likewise.
1542         * elf.c: Likewise.
1543         * elf32-m68k.c: Likewise.
1544         * elf32-ppc.c: Likewise.
1545         * elf32-sh-symbian.c: Likewise.
1546         * elf32-sh.c: Delete unnecessary prototypes.  Warning fixes.
1547         * elf64-sh64.c: Likewise.
1548         * peicode.h: Likewise.
1549         * elf64-mmix.c: Warning fixes.
1550         * elfcode.h: Likewise.
1551         * elfxx-mips.c: Likewise.
1552         * libbfd-in.h: Likewise.
1553         * libbfd.c: Likewise.
1554         * mach-o.c: Likewise.
1555         * merge.c: Likewise.
1556         * mmo.c: Likewise.
1557         * opncls.c: Likewise.
1558         * pef.c: Likewise.
1559         * srec.c: Likewise.
1560         * vms-hdr.c: Likewise.
1561         * vms-tir.c: Likewise.
1562         * xtensa-isa.c: Likewise.
1563         * xtensa-modules.c: Likewise.
1564         * xsym.c: Likewise.
1565         (pstrcmp): Use correct choice of string lengths.  Fix return value.
1566         (bfd_sym_module_name): Correct string length.
1567         * bfd-in2.h: Regenerate.
1568         * libbfd.h: Regenerate.
1569
1570 2005-02-17  Alexandre Oliva  <aoliva@redhat.com>
1571
1572         * elf32-frv.c (elf32_frv_relocate_section): Remove warning from
1573         uninitialized check_segment[1] in TLSMOFF case.
1574         Reported by Alan Modra.
1575         (elf32_frv_relocate_section): Improve errors and warnings.
1576
1577 2005-02-17  Alan Modra  <amodra@bigpond.net.au>
1578
1579         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Fix warning.
1580
1581 2005-02-16  Alan Modra  <amodra@bigpond.net.au>
1582
1583         * coff-arm.c (coff_arm_is_local_label_name): Warning fix.
1584         * elf32-frv.c (frvfdpic_relocs_info_hash): Likewise.
1585         * pef.c (bfd_pef_scan): Don't ignore return value of
1586         bfd_pef_scan_start_address.
1587         * mach-o.c (bfd_mach_o_scan): Don't ignore return value of
1588         bfd_mach_o_scan_start_address.
1589         * elfxx-ia64.c (elfNN_ia64_relax_brl): Rewrite for 32-bit bfd_vma.
1590         * elfxx-mips.c: Remove unnecessary prototypes.
1591         (sort_dynamic_relocs_64): Abort if not BFD64.
1592
1593 2005-02-16  Alan Modra  <amodra@bigpond.net.au>
1594
1595         * elf64-ppc.c (ppc64_elf_edit_toc): Skip toc if size is zero.
1596         Skip toc reloc adjust if reloc_count is zero.
1597
1598 2005-02-15  Nigel Stephens  <nigel@mips.com>
1599             Maciej W. Rozycki  <macro@mips.com>
1600
1601         * elf32-mips.c (elf_mips16_howto_table_rel): New array for MIPS16
1602         reloc howtos.  Add R_MIPS16_HI16 and R_MIPS16_LO16 relocs and
1603         R_MIPS16_GOT16 and R_MIPS16_CALL16 placeholders.
1604         (elf_mips16_jump_howto): Move into elf_mips16_howto_table_rel.
1605         (elf_mips16_gprel_howto): Likewise.  Redefine src_mask and
1606         dst_mask.
1607         (mips16_gprel_reloc): Remove bit shuffling; call
1608         _bfd_mips16_elf_reloc_unshuffle(), _bfd_mips_elf_gprel16_with_gp()
1609         and _bfd_mips16_elf_reloc_shuffle() instead.
1610         (mips16_reloc_map): New reloc map for MIPS16 relocs.
1611         (bfd_elf32_bfd_reloc_type_lookup): Use mips16_reloc_map for MIPS16
1612         relocs.
1613         (mips_elf32_rtype_to_howto): Fetch MIPS16 howtos from
1614         elf_mips16_howto_table_rel.
1615         * elf64-mips.c (mips16_elf64_howto_table_rel): New array for
1616         MIPS16 REL reloc howtos.  Add R_MIPS16_HI16 and R_MIPS16_LO16
1617         relocs and R_MIPS16_GOT16 and R_MIPS16_CALL16 placeholders.
1618         (elf_mips16_jump_howto): Move into mips16_elf64_howto_table_rel.
1619         (elf_mips16_gprel_howto): Likewise.  Redefine src_mask and
1620         dst_mask.
1621         (mips16_elf64_howto_table_rela): New array for MIPS16 RELA
1622         reloc howtos.  Add R_MIPS16_26, R_MIPS16_GPREL, R_MIPS16_HI16 and
1623         R_MIPS16_LO16 relocs and R_MIPS16_GOT16 and R_MIPS16_CALL16
1624         placeholders.
1625         (mips16_gprel_reloc): Remove bit shuffling; call
1626         _bfd_mips16_elf_reloc_unshuffle(), _bfd_mips_elf_gprel16_with_gp()
1627         and _bfd_mips16_elf_reloc_shuffle() instead.
1628         (mips16_reloc_map): New reloc map for MIPS16 relocs.
1629         (bfd_elf64_bfd_reloc_type_lookup): Use mips16_reloc_map for MIPS16
1630         relocs.
1631         (mips_elf64_rtype_to_howto): Fetch MIPS16 howtos from
1632         mips16_elf64_howto_table_rela or mips16_elf64_howto_table_rel.
1633         * elfn32-mips.c (elf_mips16_howto_table_rel): New array for MIPS16
1634         REL reloc howtos.  Add R_MIPS16_HI16 and R_MIPS16_LO16 relocs and
1635         R_MIPS16_GOT16 and R_MIPS16_CALL16 placeholders.
1636         (elf_mips16_jump_howto): Move into elf_mips16_howto_table_rel.
1637         (elf_mips16_gprel_howto): Likewise.  Redefine src_mask and
1638         dst_mask.
1639         (mips16_gprel_reloc): Remove bit shuffling; call
1640         _bfd_mips16_elf_reloc_unshuffle(), _bfd_mips_elf_gprel16_with_gp()
1641         and _bfd_mips16_elf_reloc_shuffle() instead.
1642         (mips16_reloc_map): New reloc map for MIPS16 relocs.
1643         (bfd_elf32_bfd_reloc_type_lookup): Use mips16_reloc_map for MIPS16
1644         relocs.
1645         (mips_elf_n32_rtype_to_howto): Fetch MIPS16 howtos from
1646         elf_mips16_howto_table_rela or elf_mips16_howto_table_rel.
1647         * elfxx-mips.c (_bfd_mips16_elf_reloc_unshuffle): New function to
1648         handle bit shuffling for MIPS16 relocs.
1649         (_bfd_mips16_elf_reloc_shuffle): Likewise.
1650         (_bfd_mips_elf_lo16_reloc): Use _bfd_mips16_elf_reloc_unshuffle()
1651         and _bfd_mips16_elf_reloc_shuffle().
1652         (_bfd_mips_elf_generic_reloc): Likewise.
1653         (mips_elf_calculate_relocation): Likewise.  Handle R_MIPS16_HI16
1654         and R_MIPS16_LO16.
1655         (mips_elf_obtain_contents): Remove bit shuffling.
1656         (mips_elf_perform_relocation): Likewise; call
1657         _bfd_mips16_elf_reloc_unshuffle() and _bfd_mips16_elf_reloc_shuffle()
1658         instead.
1659         (_bfd_mips_elf_relocate_section): Likewise.  Handle R_MIPS16_HI16
1660         and R_MIPS16_LO16.
1661         * elfxx-mips.h (_bfd_mips16_elf_reloc_unshuffle): Declare.
1662         (_bfd_mips16_elf_reloc_shuffle): Likewise.
1663         * reloc.c (BFD_RELOC_MIPS16_HI16): New reloc.
1664         (BFD_RELOC_MIPS16_HI16_S): Likewise.
1665         (BFD_RELOC_MIPS16_LO16): Likewise.
1666         * bfd-in2.h: Regenerate.
1667         * libbfd.h: Regenerate.
1668
1669 2005-02-15  Jan Beulich  <jbeulich@novell.com>
1670
1671         * elfxx-ia64.c (ia64_howto_table): Correct strings for
1672         R_IA64_DTPMOD64[LM]SB.
1673
1674 2005-02-14  H.J. Lu  <hongjiu.lu@intel.com>
1675
1676         * elfxx-ia64.c (elfNN_ia64_relax_section): Allow relax
1677         backward branch in the same section.
1678         (elfNN_ia64_relocate_section): Inform users that the input
1679         section is too big to relax br instruction when overflow
1680         happens to R_IA64_PCREL21B, R_IA64_PCREL21BI, R_IA64_PCREL21M
1681         and R_IA64_PCREL21F.
1682
1683 2005-02-14 Orjan Friberg <orjanf@axis.com>
1684
1685         * elfcore.h (elf_core_file_p): Move the call to
1686         elf_backend_object_p to allow the correct machine to be set before
1687         processing the program headers.
1688
1689 2005-02-14  Nick Clifton  <nickc@redhat.com>
1690
1691         PR binutils/716
1692         * peicode.h (pe_bfd_copy_private_bfd_data): Copy the large address
1693         aware flag from the input bfd to the output bfd.
1694
1695 2005-02-11  Maciej W. Rozycki  <macro@mips.com>
1696
1697         * elf32-mips.c (_bfd_mips_elf32_gprel16_reloc): Reject
1698         R_MIPS_LITERAL relocations for external symbols.
1699         * elf64-mips.c (mips_elf64_literal_reloc): Likewise.
1700         * elfn32-mips.c (mips_elf_literal_reloc): Likewise.
1701
1702 2005-02-11  H.J. Lu  <hongjiu.lu@intel.com>
1703
1704         * bfd-in2.h: Rebuilt.
1705
1706 2005-02-11  Paul Brook  <paul@codesourcery.com>
1707
1708         * elf-bfd.h (struct elf_link_hash_table): Add
1709         is_relocatable_executable.
1710         * elf.c (_bfd_elf_link_hash_table_init): Initialize it.
1711         * elflink.c (bfd_elf_link_record_dynamic_symbol): Create local dynamic
1712         symbols in relocatable executables.
1713         (bfd_elf_record_link_assignment): Create dynamic section symbols in
1714         relocatable executables.
1715         (_bfd_elf_link_renumber_dynsyms): Ditto.
1716         (bfd_elf_final_link): Ditto.
1717         * elf32-arm.c (elf32_arm_final_link_relocate): Copy absolute
1718         relocations into relocatable executables.
1719         (elf32_arm_check_relocs): Crate dynamic sections for relocatable
1720         executables.  Also copy absolute relocations.
1721         (elf32_arm_adjust_dynamic_symbol): Don't create copy relocations
1722         in relocatable executables.
1723         (allocate_dynrelocs): Copy relocations for relocatable executables.
1724         Output dynamic symbols for symbols defined in linker scripts.
1725
1726 2005-02-11  Nick Clifton  <nickc@redhat.com>
1727
1728         * libbfd.c (read_signed_leb128): Use an unsigned type for 'shift'
1729         to avoid a compile time warning.
1730
1731         * coff-alpha.c (alpha_adjust_reloc_in): Remove redundant test from
1732         BFD_ASSERT.
1733
1734         * coff-tic4x.c (coff_rtype_to_howto): Move definition before
1735         inclusion of coffcode.h so that it is actually picked up.
1736
1737         * coffcode.h (coff_std_swap_table): Add an unused attribute in
1738         case it is not used.
1739
1740         * elf32-ip2k.c (ip2k_call_opcode, IS_CALL_OPCODE): Remove unused
1741         structure and macro.
1742
1743         * elf32-iq2000.c (iq2000_reloc_map): Remove unused structure and
1744         array.
1745
1746         * elf32-m32r.c (m32r_reloc_map_old): Use #ifdef USE_M32R_OLD_RELOC
1747         to protect the declaration of this array.
1748
1749         * xsym.c (bfd_sym_parse_contained_variables_table_entry_v32):
1750         Avoid call to memcpy with a size of 0.
1751
1752 2005-02-12  Alan Modra  <amodra@bigpond.net.au>
1753
1754         * elf64-ppc.c (toc_adjusting_stub_needed): Return true for
1755         old-style branches to undefined dot-symbols which will be
1756         satisfied by a plt call.
1757
1758 2005-02-11  Alan Modra  <amodra@bigpond.net.au>
1759
1760         * elf64-ppc.c (move_plt_plist): New function, extracted from..
1761         (ppc64_elf_copy_indirect_symbol): ..here.
1762         (func_desc_adjust): Use move_plt_plist.
1763
1764 2005-02-10  Paul Brook  <paul@codesourcery.com>
1765
1766         * elf32-arm.c (elf32_arm_final_link_relocate): Handle R_ARM_THM_PC9.
1767
1768 2005-02-10  Paul Brook  <paul@codesourcery.com>
1769
1770         * elflink.c (bfd_elf_record_link_assignment): Make hidden and internal
1771         symbols local.
1772         (elf_link_renumber_hash_table_dynsyms): Ignore local symbols.
1773         (elf_link_renumber_local_hash_table_dynsyms): New function.
1774         (_bfd_elf_link_renumber_dynsyms): Number local dynamic symbols.
1775
1776 2005-02-10  Jakub Jelinek  <jakub@redhat.com>
1777
1778         * bfd-in.h (BFD_LINKER_CREATED): Define.
1779         * bfd-in2.h: Rebuilt.
1780         * elflink.c (bfd_elf_size_dynamic_sections): Disregard
1781         BFD_LINKER_CREATED bfds when determining input bfds without
1782         .note.GNU-stack section.
1783
1784 2005-02-10  Maciej W. Rozycki  <macro@mips.com>
1785
1786         * elf64-mips.c (mips16_gprel_reloc): Update a comment.
1787         * elfn32-mips.c (mips16_gprel_reloc): Keep R_MIPS16_GPREL
1788         relocations against external symbols unchanged.
1789
1790 2005-02-08  Paul Brook  <paul@codesourcery.com>
1791
1792         * elflink.c (elf_link_input_bfd): Ignore symbols from null input
1793         sections.
1794
1795 2005-02-08  Hans-Peter Nilsson  <hp@axis.com>
1796
1797         * elflink.c (elf_link_add_object_symbols): Don't add "warning: "
1798         prefix here.
1799
1800 2005-02-07  Maciej W. Rozycki  <macro@mips.com>
1801
1802         * elf64-mips.c: Fix formatting throughout.
1803
1804 2005-02-07  Maciej W. Rozycki  <macro@mips.com>
1805
1806         * elfn32-mips.c (elf_mips_howto_table_rela): Fix a comment typo.
1807
1808 2005-02-07  Alexandre Oliva  <aoliva@redhat.com>
1809
1810         * elf32-frv.c (FRVFDPIC_SYM_LOCAL): Remove special handling for
1811         *ABS*/*UND* sections.
1812         (elf32_frv_relocate_section): Move zero-addend-required error...
1813         (_frv_emit_got_relocs_plt_entries): ... here.  Report error for
1814         missing needed TLS section.
1815
1816 2005-02-07  Hans-Peter Nilsson  <hp@axis.com>
1817
1818         * aoutx.h (NAME(aout,find_nearest_line)): Correct case for N_SO
1819         being the last symbol.
1820         (aout_link_add_symbols): Just return TRUE if a warning
1821         symbol was last.
1822
1823 2005-02-07  Maciej W. Rozycki  <macro@mips.com>
1824
1825         * elf32-mips.c (mips_elf_gprel32_reloc): Reject
1826         R_MIPS_GPREL32 relocations against external symbols.
1827         * elf64-mips.c (mips_elf64_gprel32_reloc): Replace an incorrect
1828         comment.
1829
1830 2005-02-07  Alan Modra  <amodra@bigpond.net.au>
1831
1832         * elf-bfd.h (elf_string_from_elf_strtab): Delete macro.
1833         * elf.c (bfd_elf_string_from_elf_section): Expand occurrence of
1834         elf_string_from_elf_strtab.
1835         (_bfd_elf_setup_group_pointers, bfd_section_from_shdr): Likewise.
1836         (bfd_section_from_shdr): For SHT_SYMTAB, load SHT_SYMTAB_SHNDX too
1837         if it exists.  Don't do the reverse for SHT_SYMTAB_SHNDX.  For
1838         SHT_STRTAB, check whether the strtab is for symtab or dynsymtab by
1839         looking at cached symtab info first, before iterating over headers.
1840         For SHT_REL and SHT_RELA, load dynsymtab if needed.
1841         * elfcode.h (elf_object_p): Don't load section header stringtab
1842         specially.
1843
1844 2005-02-06  H.J. Lu  <hongjiu.lu@intel.com>
1845
1846         * elf32-i386.c (elf_i386_relocate_section): Disallow R_386_GOTOFF
1847         against protected function when building shared library.
1848
1849         PR 584
1850         * elf64-x86-64.c (is_32bit_relative_branch): New.
1851         (elf64_x86_64_relocate_section): Alllow R_X86_64_PC32 on a
1852         protected function symbol when building shared library for
1853         32bit relative branch instruction.
1854
1855 2005-02-06  Alan Modra  <amodra@bigpond.net.au>
1856
1857         * elf64-ppc.c (add_symbol_adjust): Don't create fake descriptor
1858         syms when doing a relocatable link.
1859         (ppc64_elf_gc_mark_hook): Check that syms are defined before looking
1860         at u.def.section.
1861         (ppc64_elf_tls_setup): Likewise.
1862         (ppc64_elf_edit_opd): Don't use an undefined func desc sym.
1863
1864 2005-02-04  Alan Modra  <amodra@bigpond.net.au>
1865
1866         * elf64-ppc.c (struct ppc_link_hash_entry): Add "fake".
1867         (link_hash_newfunc): Clear all locals using memset.
1868         (make_fdh): Remove flags param.  Always create fake func desc
1869         weak.  Link the descriptor with the code entry sym.
1870         (ppc64_elf_archive_symbol_lookup): Don't return fake syms.
1871         (add_symbol_adjust): Adjust make_fdh call.
1872         (func_desc_adjust): Likewise.  Twiddle any pre-existing fake
1873         descriptor to strong undefined if code entry is strong.
1874
1875 2005-02-04  Alan Modra  <amodra@bigpond.net.au>
1876
1877         * elflink.c (bfd_elf_record_link_assignment): Do "provide" symbol
1878         lookup here.  Set to new before calling bfd_link_repair_undef_list.
1879         (elf_smash_syms): Check that u.undef.weak isn't the not_needed bfd.
1880
1881 2005-02-03  Alan Modra  <amodra@bigpond.net.au>
1882
1883         * linker.c (_bfd_link_hash_newfunc): Set all local fields.
1884
1885 2005-02-03  Alan Modra  <amodra@bigpond.net.au>
1886
1887         * linker.c (_bfd_generic_link_add_one_symbol): Set u.undef.weak.
1888         * elflink.c (elf_smash_syms): Restore symbols that were undefweak
1889         before the as-needed lib was loaded.  Abort on unexpected refs.
1890
1891 2005-02-02  Alan Modra  <amodra@bigpond.net.au>
1892
1893         * elflink.c (elf_smash_syms): Expand comments.
1894         (elf_link_add_object_symbols): Only call elf_smash_syms for
1895         as-needed dynamic objects.
1896
1897         * elfxx-ia64.c (elfNN_ia64_new_elf_hash_entry): Don't clear
1898         everything, just the field specific to ia64.
1899         * elf64-hppa.c (elf64_hppa_new_dyn_hash_entry): Likewise.
1900
1901 2005-02-01  Alan Modra  <amodra@bigpond.net.au>
1902
1903         * elf64-ppc.c (func_desc_adjust): Move code creating func desc sym to..
1904         (make_fdh): ..here.  New function.  Don't set BSF_OBJECT for
1905         undefined syms.
1906         (struct add_symbol_adjust_data): New.
1907         (add_symbol_adjust): Make an undefweak func desc for old ABI
1908         objects to link with --as-needed shared libs.  Return fail status.
1909         Don't adjust old ABI func entry sym to weak if func desc syms
1910         isn't defined.
1911         (ppc64_elf_check_directives): Adjust call to add_symbol_adjust,
1912         and return status.
1913
1914 2005-02-01  Hans-Peter Nilsson  <hp@axis.com>
1915
1916         * cpu-cris.c (get_compatible): Rearrange disabled code and comment
1917         for clarity.
1918
1919 2005-02-01  Alan Modra  <amodra@bigpond.net.au>
1920
1921         * elf64-ppc.c (ppc64_elf_check_directives): Move undefs list fixup..
1922         * linker.c (bfd_link_repair_undef_list): ..to new function, but don't
1923         remove anything but new and undefweak.
1924         * elflink.c (_bfd_elf_link_create_dynamic_sections): Override any
1925         existing _DYNAMIC.
1926         (_bfd_elf_create_dynamic_sections): Formatting.
1927         (bfd_elf_record_link_assignment): Call bfd_link_repair_undef_list.
1928         (_bfd_elf_merge_symbol): Don't handle as-needed syms here.
1929         (struct elf_smash_data): New.
1930         (elf_smash_syms): New function.
1931         (elf_link_add_object_symbols): Call elf_smash_syms.  Don't add
1932         unneeded dynamic objects to loaded list.
1933         (elf_link_output_extsym): Don't handle as-needed here.  Strip
1934         bfd_link_hash_new symbols.
1935         * elf32-cris.c (elf_cris_discard_excess_program_dynamics): Don't
1936         delref when dynindx is already -1.
1937         * elf64-alpha.c (elf64_alpha_output_extsym): Strip bfd_link_hash_new
1938         symbols.
1939         * elfxx-mips.c (mips_elf_output_extsym): Likewise.
1940
1941 2005-02-01  Ben Elliston  <bje@au.ibm.com>
1942
1943         * elfxx-target.h (bfd_elfNN_bfd_discard_group): Redefine.
1944
1945 2005-02-01  Ben Elliston  <bje@au.ibm.com>
1946
1947         * aout-arm.c, aout-target.h, aoutx.h, archive.c, armnetbsd.c,
1948         bfd-in.h, bfdio.c, coff-alpha.c, coff-arm.c, coff-h8300.c,
1949         coff-i860.c, coff-mcore.c, coff-or32.c, coff-ppc.c, coff-sh.c,
1950         coff-sparc.c, coffcode.h, coffgen.c, cofflink.c, cpu-cris.c,
1951         cpu-h8500.c, cpu-ns32k.c, ecoff.c, ecofflink.c, elf.c,
1952         elf32-dlx.c, elf32-fr30.c, elf32-frv.c, elf32-hppa.c,
1953         elf32-i860.c, elf32-ip2k.c, elf32-m32r.c, elf32-sh.c,
1954         elf32-v850.c, elf64-mips.c, elf64-sparc.c, elflink.c,
1955         i386aout.c, i386msdos.c, i386os9k.c, ieee.c, mach-o.c,
1956         nlm32-sparc.c, oasys.c, opncls.c, pdp11.c, pe-mips.c, peXXigen.c,
1957         pef.c, peicode.h, reloc.c, riscix.c, section.c, simple.c, som.c,
1958         sparclynx.c, targets.c, vms-misc.c, vms-tir.c, xsym.c, doc/chew.c,
1959         hosts/delta68.h, hosts/vaxbsd.h: Remove #if 0'd code
1960         throughout. Similarly, collapse #if 1'd code.
1961
1962 2005-02-01  Ben Elliston  <bje@au.ibm.com>
1963
1964         * elf-bfd.h (bfd_elf_discard_group): Remove.
1965         * elf.c (bfd_elf_discard_group): Likewise.
1966         * elfxx-target.h (bfd_elfNN_bfd_discard_group): Remove macro.
1967
1968 2005-01-31  Richard Sandiford  <rsandifo@redhat.com>
1969
1970         * elf-bfd.h (elf_backend_data): Add elf_backend_eh_frame_address_size.
1971         (_bfd_elf_eh_frame_address_size): Declare.
1972         * elfxx-target.h (elf_backend_eh_frame_address_size): Define a default.
1973         (elfNN_bed): Initialize elf_backend_eh_frame_address_size.
1974         * elfxx-mips.h (_bfd_mips_elf_eh_frame_address_size): Declare.
1975         (elf_backend_eh_frame_address_size): Define.
1976         * elfxx-mips.c (_bfd_mips_elf_eh_frame_address_size): New function.
1977         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Get the address
1978         size from the new backend hook.
1979         (_bfd_elf_write_section_eh_frame): Likewise.
1980         (_bfd_elf_eh_frame_address_size): New function.
1981
1982 2005-01-31  Andrew Cagney  <cagney@gnu.org>
1983
1984         * configure: Regenerate to track ../gettext.m4.
1985
1986 2005-01-31  Mark Mitchell  <mark@codesourcery.com>
1987
1988         * elf32-arm.c (elf32_arm_symbian_special_sections): Do not set
1989         SHF_WRITE for .init_array, .fini_array, and .preinit_array.
1990
1991 2005-01-31  Nick Clifton  <nickc@redhat.com>
1992
1993         * confg.bfd: Make targets scheduled for obsoletion (m68k-lynxos,
1994         sparc-lynxos, vax-vms) be obsolete.
1995
1996 2005-01-28  Daniel Jacobowitz  <dan@codesourcery.com>
1997
1998         * elf-bfd.h (struct elf_backend_data): Add minpagesize.
1999         * elf32-arm.c (ELF_MINPAGESIZE): Define.
2000         * elf32-ppc.c (ELF_MINPAGESIZE): Define.
2001         * elfcode.h (elf_object_p): Use minpagesize instead of
2002         maxpagesize.
2003         * elfxx-target.h (ELF_MINPAGESIZE): Default to ELF_MAXPAGESIZE.
2004         (elfNN_bed): Include ELF_MINPAGESIZE.
2005
2006 2005-01-28  Julian Brown  <julian@codesourcery.com>
2007
2008         * bin-in.h (bfd_elf32_arm_set_target_relocs): Update prototype.
2009         * bin-in2.h (bfd_elf32_arm_set_target_relocs): Update prototype.
2010         * elf32-arm.c (elf32_arm_link_hash_table): Add fix_v4bx flag.
2011         (bfd_elf32_arm_set_target_relocs): Add formal parameter fix_v4bx for
2012         passing flag value from ld. Set flag value in global hash table entry.
2013         (elf32_arm_final_link_relocate): Add code to implement R_ARM_V4BX
2014         relocation.
2015
2016 2005-01-27  Andrew Cagney  <cagney@gnu.org>
2017
2018         * configure: Regenerate to track ../gettext.m4 change.
2019
2020 2005-01-25  Mark Mitchell  <mark@codesourcery.com>
2021
2022         * elf32-arm.c (elf_backend_default_use_rela_p): Define to zero for
2023         SymbianOS.
2024
2025 2005-01-25  Alexandre Oliva  <aoliva@redhat.com>
2026
2027         2004-12-10  Alexandre Oliva  <aoliva@redhat.com>
2028         * elf32-frv.c (elf32_frv_relocate_section): Force local binding
2029         for TLSMOFF.
2030         * reloc.c: Add R_FRV_TLSMOFF.
2031         * elf32-frv.c (elf32_frv_howto_table): Likewise.
2032         (frv_reloc_map, frv_reloc_type_lookup): Map it.
2033         (elf32_frv_relocate_section): Handle it.
2034         (elf32_frv_check_relocs): Likewise.
2035         * libbfd.h, bfd-in2.h: Rebuilt.
2036         2004-11-26  Alexandre Oliva  <aoliva@redhat.com>
2037         * elf32-frv.c (_frvfdpic_emit_got_relocs_plt_entries): Don't crash
2038         when given an undefweak TLS symbol.  Fix constant TLS PLT entries
2039         such that they return the constant in gr9.
2040         (_frvfdpic_relax_tls_entries): Don't crash for undefweak TLS
2041         symbols.
2042         (_frvfdpic_size_got_plt): Set _cooked_size of dynamic sections.
2043         too, such that they shrink on relaxation.
2044         (elf32_frvfdpic_finish_dynamic_sections): Check __ROFIXUP_END__ as
2045         marking the position right past the _GLOBAL_OFFSET_TABLE_ value.
2046         (_frvfdpic_assign_plt_entries): Shrink constant TLS PLT entries
2047         if we can guarantee the use of 16-bit constants.
2048         2004-11-10  Alexandre Oliva  <aoliva@redhat.com>
2049         Introduce TLS support for FR-V FDPIC.
2050         * reloc.c: Add TLS relocations.
2051         * elf32-frv.c (elf32_frv_howto_table): Add TLS relocations.
2052         (elf32_frv_rel_tlsdesc_value_howto): New.
2053         (elf32_frv_rel_tlsoff_howto): New.
2054         (frv_reloc_map): Add new mappings.
2055         (struct frvfdpic_elf_link_hash_table): Add pointer to summary
2056         reloc information.
2057         (frvfdpic_dynamic_got_plt_info): New.
2058         (frvfdpic_plt_tls_ret_offset): New.
2059         (ELF_DYNAMIC_INTERPRETER, DEFAULT_STACK_SIZE): Move earlier.
2060         (struct _frvfdpic_dynamic_got_info): Likewise.  Add TLS members.
2061         (struct _frvfdpic_dynamic_got_plt_info): Likewise.
2062         (FRVFDPIC_SYM_LOCAL): Regard symbols defined in the absolute
2063         section as local.
2064         (struct frvfdpic_relocs_info): Add TLS fields.
2065         (frvfdpic_relocs_info_hash): Warning clean up.
2066         (frvfdpic_relocs_info_find): Initialize tlsplt_entry.
2067         (frvfdpic_pic_merge_early_relocs_info): Merge TLS fields.
2068         (FRVFDPIC_TLS_BIAS): Define.
2069         (tls_biased_base): New.
2070         (_frvfdpic_emit_got_relocs_plt_entries): Deal with TLS
2071         relocations.
2072         (frv_reloc_type_lookup): Likewise.
2073         (frvfdpic_info_to_howto_rel): Likewise.
2074         (elf32_frv_relocate_section): Likewise.
2075         (_frv_create_got_section): Create the PLT section here.
2076         (elf32_frvfdpic_create_dynamic_sections): Not here.
2077         (_frvfdpic_count_nontls_entries): Move out of...
2078         (_frvfdpic_count_got_plt_entries): ... here.
2079         (_frvfdpic_count_tls_entries): Likewise.  Add TLS support.
2080         (_frvfdpic_count_relocs_fixups): Likewise.  Add relaxation
2081         support.
2082         (_frvfdpic_relax_tls_entries): New.
2083         (_frvfdpic_compute_got_alloc_data): Add TLS support.
2084         (_frvfdpic_get_tlsdesc_entry): New.
2085         (_frvfdpic_assign_got_entries): Add TLS support.
2086         (_frvfdpic_assign_plt_entries): Likewise.
2087         (_frvfdpic_reset_got_plt_entries): New.
2088         (_frvfdpic_size_got_plt): Move out of...
2089         (elf32_frvfdpic_size_dynamic_sections): ... here.
2090         (_frvfdpic_relax_got_plt_entries): New.
2091         (elf32_frvfdpic_relax_section): New.
2092         (elf32_frvfdpic_finish_dynamic_sections): Add TLS sanity check.
2093         (elf32_frv_check_relocs): Add TLS support.
2094         (bfd_elf32_bfd_relax_section): Define for FDPIC.
2095         * libbfd.h, bfd-in2.h: Rebuilt.
2096
2097 2005-01-25  Alan Modra  <amodra@bigpond.net.au>
2098
2099         * elf.c (_bfd_elf_get_dynamic_reloc_upper_bound): Only include
2100         loadable reloc sections.
2101         (_bfd_elf_canonicalize_dynamic_reloc): Likewise.
2102         (_bfd_elf_get_synthetic_symtab): Return 0 if no dynamic syms.
2103
2104 2005-01-25  Alan Modra  <amodra@bigpond.net.au>
2105
2106         * elflink.c (elf_link_add_object_symbols): Don't create link dynamic
2107         sections immediately when linking shared libs.  Instead, wait until
2108         we know a lib is needed.
2109         (_bfd_elf_link_create_dynstrtab): Extract from..
2110         (_bfd_elf_link_create_dynamic_sections_): ..here.
2111         (elf_add_dt_needed_tag): Call _bfd_elf_link_create_dynstrtab and
2112         _bfd_elf_link_create_dynamic_sections.  Add abfd param.  Allow
2113         for non-existent .dynamic.
2114         (elf_link_output_extsym): Don't complain about undefined symbols
2115         in as-needed dynamic libs that aren't actually linked.
2116
2117 2005-01-24  Andrew Cagney  <cagney@gnu.org>
2118
2119         * configure: Regenerate, ../gettext.m4 was updated.
2120
2121 2005-01-21  Ben Elliston  <bje@au.ibm.com>
2122
2123         * aout-encap.c: Remove unused file.
2124
2125 2005-01-19  H.J. Lu  <hongjiu.lu@intel.com>
2126
2127         PR 679
2128         * elflink.c (_bfd_elf_dynamic_symbol_p): Only protected
2129         non-function symbols are local.
2130         (_bfd_elf_symbol_refs_local_p): Likewise.
2131
2132 2005-01-18  Alan Modra  <amodra@bigpond.net.au>
2133
2134         * bfd.c (bfd_link_just_syms): Add abfd param.
2135         * bfd-in2.h: Regenerate.
2136
2137 2005-01-17  Richard Sandiford  <rsandifo@redhat.com>
2138
2139         * elf-eh-frame.c (skip_cfa_op, skip_non_nops): New functions.
2140         (_bfd_elf_discard_section_eh_frame): Use them to interpret the CFA
2141         instructions.  If the amount of padding is known, reduce the size
2142         of the CIE or FDE by that amount.
2143
2144 2005-01-17  Richard Sandiford  <rsandifo@redhat.com>
2145
2146         * elf-bfd.h (struct cie): Use bfd_vmas for code_align, ra_column and
2147         augmentation_size.  Use bfd_signed_vmas for data_align.
2148         * elf-eh-frame.c (read_uleb128, read_sleb128): Delete in favor of...
2149         (read_byte, skip_leb128, read_uleb128, read_sleb128): ...these new
2150         functions.  Don't read past the end of the enclosing CIE or FDE.
2151         (skip_bytes): New utility function.
2152         (_bfd_elf_discard_section_eh_frame): Use new functions, adding more
2153         sanity checking.
2154         (_bfd_elf_write_section_eh_frame): Use new functions.
2155
2156 2005-01-17  Richard Sandiford  <rsandifo@redhat.com>
2157
2158         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Use an
2159         assert-style REQUIRE() macro to handle sanity checks.
2160
2161 2005-01-17  H.J. Lu  <hongjiu.lu@intel.com>
2162
2163         * dwarf2.c (dwarf2_debug): Move info_ptr_unit to ...
2164         (comp_unit): Here.
2165         (read_unsigned_leb128): Removed.
2166         (read_signed_leb128): Removed.
2167         (find_abstract_instance_name): Updated.
2168         (parse_comp_unit): Accept info_ptr_unit.
2169         (_bfd_dwarf2_find_nearest_line): Set info_ptr_unit for each
2170         comp unit and pass it to parse_comp_unit.
2171
2172         * elf-eh-frame.c (read_unsigned_leb128): Moved to ...
2173         (read_signed_leb128): Moved to ...
2174         * libbfd.c: Here.
2175
2176         * libbfd-in.h (read_unsigned_leb128): New prototype.
2177         (read_signed_leb128): Likewise.
2178         * libbfd.h: Regenerated.
2179
2180 2005-01-17  Andrew Stubbs  <andrew.stubbs@st.com>
2181             Nick Clifton   <nickc@redhat.com>
2182
2183         * cpu-sh.c (bfd_to_arch_table): Change arch_sh1_up to arch_sh_up,
2184         arch__sh4_nofp_up to arch_sh4_nofpu_up and arch_sh4a_nofp_up to
2185         arch_sh4a_nofpu_up in order to match the external names and make the
2186         testsuite's job easier.
2187         * archuires.c: Rename bfd_mach_sh2a_fake? to more meaningful
2188         names.
2189         * bfd-in2.h: Regenerate.
2190
2191 2005-01-15  Andrew Cagney  <cagney@gnu.org>
2192
2193         * bfd.m4: New file.
2194         * acinclude.m4: Move BFD_NEED_DECLARATION,
2195         BFD_HAVE_SYS_PROCFS_TYPE and BFD_HAVE_SYS_PROCFS_TYPE_MEMBER to
2196         the new file bfd.m4.  Include ../bfd/bfd.m4.
2197         * configure: Re-generate.
2198
2199 2005-01-12  Alan Modra  <amodra@bigpond.net.au>
2200
2201         * elf32-ppc.c (ppc_elf_howto_raw): Delete RELAX32* entries.
2202         (ppc_elf_relax_section): Use PLT variants of RELAX32 relocs for
2203         reaching PLT.
2204         (ppc_elf_relocate_section): Handle R_PPC_RELAX32_PLT and
2205         R_PPC_RELAX32PC_PLT.
2206
2207 2005-01-11  Alan Modra  <amodra@bigpond.net.au>
2208
2209         * elf64-ppc.c (ppc64_elf_gc_sweep_hook): Follow indirect and warning
2210         symbols.
2211         * elf32-arm.c (elf32_arm_gc_sweep_hook): Likewise.
2212         * elf32-cris.c (cris_elf_gc_sweep_hook): Likewise.
2213         * elf32-hppa.c (elf32_hppa_gc_sweep_hook): Likewise.
2214         * elf32-i386.c (elf_i386_gc_sweep_hook): Likewise.
2215         * elf32-m32r.c (m32r_elf_gc_sweep_hook): Likewise.
2216         * elf32-m68k.c (elf_m68k_gc_sweep_hook): Likewise.
2217         * elf32-ppc.c (ppc_elf_gc_sweep_hook): Likewise.
2218         * elf32-s390.c (elf_s390_gc_sweep_hook): Likewise.
2219         * elf32-sh.c (sh_elf_gc_sweep_hook): Likewise.
2220         * elf32-sparc.c (elf32_sparc_gc_sweep_hook): Likewise.
2221         * elf32-vax.c (elf_vax_gc_sweep_hook): Likewise.
2222         * elf32-xtensa.c (elf_xtensa_gc_sweep_hook): Likewise.
2223         * elf64-s390.c (elf_s390_gc_sweep_hook): Likewise.
2224         * elf64-x86-64.c (elf64_x86_64_gc_sweep_hook): Likewise.
2225
2226 2005-01-11  Alan Modra  <amodra@bigpond.net.au>
2227
2228         * elf32-ppc.c (ppc_elf_create_dynamic_sections): Correct
2229         .dynsbss flags.
2230
2231 2005-01-10  Inderpreet Singh <inderpreetb@noida.hcltech.com>
2232
2233         * archures.c: Define bfd_mach_maxq10 and bfd_mach_maxq20.
2234         * bfd-in2.h:  Regenerate.
2235         * coffcode.h (coff_set_arch_mach_hook, coff_set_flags): Add code
2236         to support these new machine values.
2237         * cpu-maxq.c (bfd_maxq10_arch): New architecture definition for
2238         the maxq10.
2239         (bfd_maxq_arch): Update values for the maxq20.
2240
2241 2005-01-10  Eric Botcazou  <ebotcazou@libertysurf.fr>
2242
2243         * elf64-sparc.c (sparc64_elf_adjust_dynamic_symbol): When linking a
2244         non-shared object, do not reserve space in .plt and .rela.plt for
2245         regular symbols neither defined nor referenced in shared objects.
2246
2247 2005-01-09  Eric Botcazou  <ebotcazou@libertysurf.fr>
2248
2249         * elf32-sparc.c (elf32_sparc_link_hash_table_create): Use bfd_zmalloc
2250         to zero the structure.
2251         (create_got_section): Use BFD_ASSERT instead of abort.
2252         * elf64-sparc.c (struct sparc64_elf_link_hash_table): New 'sgot' and
2253         'srelgot' fields.
2254         (create_got_section): New function.
2255         (sparc64_elf_create_dynamic_sections): Likewise.
2256         (sparc64_elf_check_relocs): Invoke create_got_section instead of
2257         _bfd_elf_create_got_section.  Use the sgot and srelgot shortcuts.
2258         (sparc64_elf_size_dynamic_sections): Use the srelgot shortcut.
2259         (sparc64_elf_relocate_section): Use the sgot and srelgot shortcuts.
2260         (sparc64_elf_finish_dynamic_symbol): Likewise.
2261         (sparc64_elf_finish_dynamic_sections): Use the sgot shortcut.
2262         (elf_backend_create_dynamic_sections): Define to
2263         sparc64_elf_create_dynamic_sections.
2264
2265 2005-01-09  Eric Botcazou  <ebotcazou@libertysurf.fr>
2266
2267         * elf32-sparc.c (elf32_sparc_omit_section_dynsym): New function.
2268         (elf_backend_omit_section_dynsym): Define to it.
2269         * elf64-sparc.c (sparc64_elf_omit_section_dynsym): New function.
2270         (elf_backend_omit_section_dynsym): Define to it.
2271
2272 2005-01-07  Jakub Jelinek  <jakub@redhat.com>
2273
2274         * bfd/elf.c (INCLUDE_SECTION_IN_SEGMENT): Don't put empty sections into
2275         PT_DYNAMIC segment, unless .dynamic.
2276
2277 2005-01-06  Paul Brook  <paul@codesourcery.com>
2278
2279         * config.bfd: Add entry for arm-*-vxworks and arm-*-windiss.
2280         * configure.in: Add bfd_elf32_{big,little}arm_vxworks_vec.
2281         * configure: Regenerate.
2282         * elf32-arm.c: Add VxWorks target bfd.
2283         (USE_REL): Remove.
2284         (elf32_arm_link_hash_table): Add use_rel.
2285         (elf32_arm_link_hash_table_create, elf32_arm_final_link_relocate,
2286         elf32_arm_relocate_section): Replace USE_REL with runtime check.
2287         Correct offset calculation for RELA case.
2288         (elf_backend_may_use_rel_p, elf_backend_may_use_rela_p,
2289         elf_backend_default_use_rela_p, elf_backend_rela_normal): Define.
2290         (elf32_arm_vxworks_link_hash_table_create): New function.
2291         * targets.c (bfd_elf32_bigarm_vxworks_vec): Add declaration.
2292         (bfd_elf32_littlearm_vxworks_vec): Ditto.
2293         (_bfd_target_vector): Add bfd_elf32_{big,little}arm_vxworks_vec.
2294
2295 2005-01-06  Alan Modra  <amodra@bigpond.net.au>
2296
2297         * elf64-ppc.c (struct ppc_link_hash_table): Add no_multi_toc and
2298         multi_toc_needed.
2299         (has_toc_reloc, makes_toc_func_call, call_check_in_progress): Define.
2300         (ppc64_elf_check_relocs): Update references to has_gp_reloc.
2301         (ppc64_elf_setup_section_lists): Add no_multi_toc parm, set htab bit.
2302         (ppc64_elf_next_toc_section): Heed no_multi_toc.
2303         (ppc64_elf_reinit_toc): Set multi_toc_needed.
2304         (toc_adjusting_stub_needed): Rewrite.
2305         (ppc64_elf_next_input_section): Use multi_toc_needed to shortcut
2306         toc tests.  Adjust for toc_adjusting_stub_needed changes.
2307         (ppc64_elf_size_stubs): Update references to has_gp_reloc.
2308         * elf64-ppc.h (ppc64_elf_setup_section_lists): Update prototype.
2309         * section.c: Expand comment on backend bits.
2310         * bfd-in2.h: Regenerate.
2311         * libbfd.h: Regenerate.
2312
2313 2005-01-06  Alan Modra  <amodra@bigpond.net.au>
2314
2315         * elf64-ppc.c (ppc64_elf_size_stubs): When determining need for
2316         toc adjusting stub, do not test source section flags.
2317
2318 2005-01-05  Eric Botcazou  <ebotcazou@libertysurf.fr>
2319
2320         * elf64-sparc.c (sparc64_elf_relocate_section): Ignore overflows
2321         from STABS debugging sections again.
2322
2323 2005-01-05  Fred Fish  <fnf@specifixinc.com>
2324
2325         * dwarf2.c (struct dwarf2_debug): Add info_ptr_unit member.
2326         (find_abstract_instance_name): New function.
2327         (scan_unit_for_functions): Handle DW_TAG_inlined_subroutine.
2328         (scan_unit_for_functions): Handle DW_AT_abstract_origin.
2329         (_bfd_dwarf2_find_nearest_line): Initialize info_ptr_unit.
2330
2331 2004-12-31  Paul Brook  <paul@copdesourcery.com>
2332
2333         * elf32-arm.c (elf32_arm_symbian_plt_entry): Fix comment typo.
2334
2335 2004-12-31  Alan Modra  <amodra@bigpond.net.au>
2336
2337         * reloc.c (BFD_RELOC_AVR_LDI, BFD_RELOC_AVR_6, BFD_RELOC_AVR_6_ADIW):
2338         Commit missing changes from 2004-12-22.
2339         * bfd-in2.h: Regenerate.
2340
2341 2004-12-23  Tomer Levi  <Tomer.Levi@nsc.com>
2342
2343         * elf32-crx.c (elf32_crx_relax_section): Support 'bcop' relaxation.
2344
2345 2004-12-21  Kris Warkentin  <kewarken@qnx.com>
2346
2347         * elf.c (elfcore_grok_nto_gregs): Change name to elfcore_grok_nto_regs.
2348         Add 'base' argument for constructing register sections.  Reformat.
2349         (elfcore_grok_nto_note): Call elfcore_grok_nto_regs for both
2350         gp and fp regs.  Reformat.
2351
2352 2004-12-22  Klaus Rudolph  <lts-rudolph@gmx.de>
2353
2354         * reloc.c: Add new relocs R_AVR_LDI, R_AVR_6, R_AVR_6_ADIW.
2355         * bfd-in2.h: Regenerate.
2356         * elf32-avr.c (elf_avr_nowto_table): Add the new relocs.
2357         (avr_reloc_map): Likewise.
2358         (avr_final_link_relocate): Likewise.
2359
2360 2004-12-22  Alan Modra  <amodra@bigpond.net.au>
2361
2362         * elflink.c (_bfd_elf_merge_symbol): Treat old definitions from
2363         as-needed dynamic libs as undefined.
2364         (elf_link_add_object_symbols): Remove DYN_AS_NEEDED from as-needed
2365         libs when finding they are needed.
2366
2367 2004-12-20  Alan Modra  <amodra@bigpond.net.au>
2368
2369         * elf64-ppc.c (struct ppc64_elf_obj_tdata): Add opd_relocs.
2370         (opd_entry_value): Use opd_relocs if available.
2371         (ppc64_elf_relocate_section): Don't set reloc_done.  Instead
2372         copy .opd relocations to opd_relocs.
2373         (ppc64_elf_edit_toc): Set rel_hdr.sh_size after editing relocs.
2374
2375 2004-12-16  Richard Sandiford  <rsandifo@redhat.com>
2376
2377         * reloc.c (BFD_RELOC_V850_LO16_SPLIT_OFFSET): New bfd_reloc_code_type.
2378         * elf32-v850.c (v850_elf_howto_table): Add entry for
2379         R_V850_LO16_SPLIT_OFFSET.
2380         (v850_elf_reloc_map): Map it to BFD_RELOC_V850_LO16_SPLIT_OFFSET.
2381         (v850_elf_perform_lo16_relocation): New function, extracted from...
2382         (v850_elf_perform_relocation): ...here.  Use it to handle
2383         R_V850_LO16_SPLIT_OFFSET.
2384         (v850_elf_check_relocs, v850_elf_final_link_relocate): Handle
2385         R_V850_LO16_SPLIT_OFFSET.
2386         * libbfd.h, bfd-in2.h: Regenerate.
2387
2388 2004-12-14  P.J. Darcy  <darcypj@us.ibm.com>
2389
2390         * config.bfd: Add s390x-ibm-tpf support.
2391
2392 2004-12-14  Tomer Levi  <Tomer.Levi@nsc.com>
2393
2394         * elf32-crx.c (elf32_crx_relax_delete_bytes): Add 'struct bfd_link_info *'
2395         to prototype, to make hash info available.
2396         Prevent wrapped symbols from being adjusted twice.
2397
2398 2004-12-14  Richard Sandiford  <rsandifo@redhat.com>
2399
2400         * elfxx-mips.c (mips_elf_calculate_relocation): Don't report an
2401         overflow for calls to undefined weak symbols.
2402
2403 2004-12-11  Alan Modra  <amodra@bigpond.net.au>
2404
2405         * elfcode.h (elf_slurp_symbol_table): Use bfd_elf_sym_name so that
2406         canonical sections syms have a name.
2407
2408 2004-12-11  Alan Modra  <amodra@bigpond.net.au>
2409
2410         * elf64-ppc.c (opd_entry_value): Don't use cached relocs if they
2411         have been adjusted for output.
2412         (ppc64_elf_relocate_section): Mark sections with reloc_done.
2413
2414 2004-12-10  Alan Modra  <amodra@bigpond.net.au>
2415
2416         * elf.c (bfd_elf_sym_name): Rename from bfd_elf_local_sym_name and
2417         add symtab_hdr param.
2418         (group_signature): Update calls.
2419         * elf-bfd.h (bfd_elf_sym_name): Update.
2420         * elf32-ppc.c (ppc_elf_relocate_section): Update.
2421         * elf64-ppc.c (ppc64_elf_edit_opd, ppc64_elf_edit_toc): Update.
2422         (ppc64_elf_relocate_section): Update.
2423         * elflink.c (elf_link_input_bfd): Update.
2424
2425 2004-12-10  Jakub Jelinek  <jakub@redhat.com>
2426
2427         * elf.c (bfd_elf_local_sym_name): Avoid crashes with invalid
2428         st_shndx on STT_SECTION sections.
2429
2430 2004-12-09  Daniel Jacobowitz  <dan@codesourcery.com>
2431
2432         * elfcode.h (elf_slurp_reloc_table_from_section): Don't canonicalize
2433         ELF section symbols.
2434
2435 2004-12-09  Ian Lance Taylor  <ian@wasabisystems.com>
2436
2437         * elfxx-mips.c (mips_elf_calculate_relocation): For R_MIPS_JALR,
2438         return a real value, unless it is a PLT symbol.
2439         (mips_elf_perform_relocation): On the RM9000, turn a jal into a
2440         bal if possible.
2441
2442         * elfn32-mips.c (elf_mips_howto_table_rela): Change dst_mask of
2443         R_MIPS_JALR entry to 0.
2444
2445         * archures.c: Define bfd_mach_mips9000.
2446         * elfxx-mips.c (_bfd_elf_mips_mach): Handle E_MIPS_MACH_9000.
2447         (mips_set_isa_flags): Handle bfd_mach_mips9000.
2448         * cpu-mips.c (I_mips9000): Define.
2449         (arch_info_struct): Add case for bfd_mach_mips9000.
2450         * aoutx.h (NAME(aout,machine_type)): Handle bfd_mach_mips9000.
2451         * bfd-in2.h: Regenerate.
2452
2453 2004-12-08  Ian Lance Taylor  <ian@wasabisystems.com>
2454
2455         * elfxx-mips.c (mips_elf_calculate_relocation): Test for R_MIPS_26
2456         overflow.
2457
2458 2004-12-07  Ben Elliston  <bje@gnu.org>
2459
2460         * netbsd-core.c (netbsd_core_file_p): Make `i' unsigned.
2461
2462 2004-12-06  Daniel Jacobowitz  <dan@debian.org>
2463
2464         Suggested by Fergal Daly <fergal@esatclear.ie>:
2465         * simple.c (simple_dummy_multiple_definition): New function.
2466         (bfd_simple_get_relocated_section_contents): Use it.
2467
2468 2004-12-03  Jan Beulich  <jbeulich@novell.com>
2469
2470         * elf.c (elf_find_function): Don't use the last file symbol ever,
2471         seen, but the last one seen prior to the symbol being reported.
2472         Don't report a filename at all for global symbols when that might
2473         be ambiguous/wrong.
2474
2475 2004-12-01  Paul Brook  <paul@codesourcery.com>
2476
2477         * elf32-arm.c (elf32_arm_copy_private_bfd_data): Set EI_OSABI.
2478         (elf32_arm_post_process_headers): Set EI_OSABI depending on ABI
2479         version.
2480
2481 2004-12-01  Paul Brook  <paul@codesourcery.com>
2482
2483         * elflink.c (elf_link_add_object_symbols): Make symbols from discarded
2484         sections undefined.
2485
2486 2004-11-30  Paul Brook  <paul@codesourcery.com>
2487
2488         * elf32-arm.c (struct elf32_arm_link_hash_table): Remove
2489         no_pipeline_knowledge
2490         (elf32_arm_link_hash_table_create): Ditto.
2491         (bfd_elf32_arm_process_before_allocation): Ditto.
2492         (elf32_arm_final_link_relocate): Ditto.  Remove oabi relocation
2493         handling.
2494         * bfd-in.h (bfd_elf32_arm_process_before_allocation): Update
2495         prototype.
2496         * bfd-in2.h: Regenerate.
2497
2498 2004-11-30  Randolph Chung  <tausq@debian.org>
2499
2500         * elf32-hppa.c (elf32_hppa_grok_prstatus): New function.
2501         (elf32_hppa_grok_psinfo): New function.
2502         (elf_backend_grok_prstatus): Define.
2503         (elf_backend_grok_psinfo): Define.
2504
2505 2004-11-24  H.J. Lu  <hongjiu.lu@intel.com>
2506
2507         PR 574:
2508         * elfcode.h (elf_slurp_symbol_table): Handle STT_TLS.
2509
2510 2004-11-24  Paul Brook  <paul@codesourcery.com>
2511
2512         * elf.c (assign_section_numbers): Number SHT_GROUP sections first.
2513
2514 2004-11-24  Paul Brook  <paul@codesourcery.com>
2515
2516         * elf32-arm.c (elf32_arm_swap_symbol_in): New function.
2517         (elf32_arm_swap_symbol_out): New function.
2518         (elf32_arm_size_info): Add.
2519         (elf_backend_size_info): Define.
2520
2521 2004-11-20  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
2522
2523         * hpux-core.c (hpux_core_core_file_p): Use offsetof macro in calls to
2524         make_bfd_asection.
2525
2526 2004-11-19  Alan Modra  <amodra@bigpond.net.au>
2527
2528         * elf32-arm.c (elf32_arm_finish_dynamic_sections): Warning fix.
2529         * elf32-iq2000.c (iq2000_reloc_type_lookup): C90 function decl.
2530         * nlmcode.h (nlm_write_object_contents): Warning fix.
2531
2532 2004-11-18  Bob Wilson  <bob.wilson@acm.org>
2533
2534         * elf32-xtensa.c (ebb_propose_action): Fix argument order.
2535
2536 2004-11-17  Daniel Jacobowitz  <dan@codesourcery.com>
2537
2538         * elf32-arm.c (PLT_THUMB_STUB_SIZE): Define.
2539         (elf32_arm_plt_thumb_stub): New.
2540         (struct elf32_arm_link_hash_entry): Add plt_thumb_refcount
2541         and plt_got_offset.
2542         (elf32_arm_link_hash_traverse): Fix typo.
2543         (elf32_arm_link_hash_table): Add obfd.
2544         (elf32_arm_link_hash_newfunc): Initialize new fields.
2545         (elf32_arm_copy_indirect_symbol): Copy plt_thumb_refcount.
2546         (elf32_arm_link_hash_table_create): Initialize obfd.
2547         (record_arm_to_thumb_glue): Mark the glue as a local ARM function.
2548         (record_thumb_to_arm_glue): Mark the glue as a local Thumb function.
2549         (bfd_elf32_arm_get_bfd_for_interworking): Verify that the
2550         interworking BFD is not dynamic.
2551         (bfd_elf32_arm_process_before_allocation): Handle R_ARM_PLT32.  Do
2552         not emit glue for PLT references.
2553         (elf32_arm_final_link_relocate): Handle Thumb functions.  Do not
2554         emit glue for PLT references.  Support the Thumb PLT prefix.
2555         (elf32_arm_gc_sweep_hook): Handle R_ARM_THM_PC22 and
2556         plt_thumb_refcount.
2557         (elf32_arm_check_relocs): Likewise.
2558         (elf32_arm_adjust_dynamic_symbol): Handle Thumb functions and
2559         plt_thumb_refcount.
2560         (allocate_dynrelocs): Handle Thumb PLT references.
2561         (elf32_arm_finish_dynamic_symbol): Likewise.
2562         (elf32_arm_symbol_processing): New function.
2563         (elf_backend_symbol_processing): Define.
2564
2565 2004-11-16  Richard Sandiford  <rsandifo@redhat.com>
2566
2567         * elf-bfd.h (eh_cie_fde): Add new fields: add_augmentation_size and
2568         add_fde_encoding.  Remove need_relative.
2569         * elf-eh-frame.c (extra_augmentation_string_bytes)
2570         (extra_augmentation_data_bytes, size_of_output_cie_fde): New functions.
2571         (_bfd_elf_discard_section_eh_frame): Consider changing the FDE encoding
2572         in cases where the CIE has no existing 'R' augmentation.  Use
2573         size_of_output_cie_fde when assigning offsets.  Use the final offset
2574         as the new section size.
2575         (_bfd_elf_eh_frame_section_offset): Remove need_relative handling.
2576         Account for any extra augmentation bytes in the returned offset.
2577         (_bfd_elf_write_section_eh_frame): Rework so that the entries are
2578         moved before being modified.  Pad growing entries with DW_CFA_nops.
2579         Add 'z' and 'R' augmentations as directed by add_augmentation_size
2580         and add_fde_encoding.
2581
2582 2004-11-15  Mark Mitchell  <mark@codesourcery.com>
2583
2584         * elf32-arm.c (elf32_arm_relocate_section): Use
2585         arm_real_reloc_type.
2586
2587 2004-11-16  Richard Sandiford  <rsandifo@redhat.com>
2588
2589         * elfxx-mips.c (mips_elf_create_dynamic_relocation): Return early
2590         for discard relocations; don't add an R_MIPS_NONE to the main body
2591         of .rel.dyn.
2592
2593 2004-11-04  Paul Brook  <paul@codesourcery.com>
2594
2595         * elf-bfd.h (_bfd_elf_slurp_version_tables): Update prototype.
2596         * elf.c (_bfd_elf_print_private_bfd_data): Pass extra argument.
2597         (_bfd_elf_slurp_version_tables): Add extra argument.  Create extra
2598         default version definition for unversioned symbols.
2599         * elfcode.h (elf_slurp_symbol_table): Pass extra argument.
2600         * elflink.c (elf_link_add_object_symbols): Pass extra argument to
2601         _bfd_elf_slurp_version_tables.  Set default version for unversioned
2602         imported symbols.
2603
2604 2004-11-15  Paul Brook  <paul@codesourcery.com>
2605
2606         * elflink.c (elf_link_add_object_symbols): Don't assume version
2607         indices are consecutive.
2608
2609 2004-11-14  Richard Sandiford  <rsandifo@redhat.com>
2610
2611         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Deal with
2612         composite relocations against the personality data.
2613
2614 2004-11-13  Paul Brook  <paul@codesourcery.com>
2615
2616         * bfd/elf32-arm.c (elf32_arm_final_link_relocate): Resolve
2617         R_ARM_PREL31 relocations to PLT entries.
2618         (elf32_arm_relocate_section, elf32_arm_gc_sweep_hook): Ditto.
2619         (elf32_arm_check_relocs): Ditto.
2620
2621 2004-11-12  Bob Wilson  <bob.wilson@acm.org>
2622
2623         * xtensa-isa.c (xtensa_interface_class_id): New.
2624
2625 2004-11-11  Bob Wilson  <bob.wilson@acm.org>
2626
2627         * elf32-xtensa.c (property_table_compare): Remove assertion about
2628         entries with the same address and non-zero size.
2629         (xtensa_read_table_entries): Report such entries as errors.
2630
2631 2004-11-11  Mark Mitchell  <mark@codesourcery.com>
2632
2633         * elf32-arm.c (elf32_arm_final_link_relocate): Correct logic for
2634         R_ARM_RELATIVE on Symbian OS.
2635
2636 2004-11-09  Mark Mitchell  <mark@codesourcery.com>
2637
2638         * som.c (som_bfd_print_private_bfd_data): New function.
2639         (som_object_setup): Save the auxiliary header.  Don't assume that
2640         zero is an invalid entry point for a shared library.
2641         (som_object_p): Allocate the auxiliary header on the heap.
2642
2643         * elf32-arm.c (elf32_arm_begin_write_processing): Do not use a K&R
2644         declaration.
2645         (elf32_arm_symbian_modify_segment_map): Likewise.
2646
2647 2004-11-09  Daniel Jacobowitz  <dan@debian.org>
2648
2649         From David Poole <daveml@mbuf.com>:
2650         * elf32-arm.c (elf32_arm_readonly_dynrelocs): New function.
2651         (elf32_arm_size_dynamic_sections): Call it.
2652
2653 2004-11-09  Alan Modra  <amodra@bigpond.net.au>
2654
2655         * Makefile.am (SOURCE_HFILES): Remove elf32-arm.h.
2656         (ALL_MACHINES_CFILES): Fix typo.
2657         * Makefile.in: Regenerate.
2658         * po/SRC-POTFILES.in: Regenerate.
2659
2660 2004-11-08  Mark Mitchell  <mark@codesourcery.com>
2661
2662         * elf32-arm.c (elf32_arm_final_link_relocate): When generating an
2663         R_ARM_RELATIVE relocation for Symbian OS, mention the section
2664         symbol in the relocation.
2665
2666 2004-11-08  Inderpreet Singh  <inderpreetb@nioda.hcltech.com>
2667             Vineet Sharma  <vineets@noida.hcltech.com>
2668
2669         * coff-maxq.c: New File.
2670         * cpu-maxq.c: New File.
2671         * coffcode.h: Likewise.
2672         * config.bfd: Likewise.
2673         * configure.in (maxqcoff_vec): New target vector.
2674         * Makefile.am: Add support for maxq target.
2675         * configure.in: Likewise.
2676         * archures.c:. Likewise.
2677         * targets.c: Likewise.
2678         * bfd_in2.h : Regenerated.
2679         * Makefile.in: Regenerated.
2680         * configure: Regenerated.
2681         * doc/Makefile.in: Regenerated.
2682
2683 2004-11-08  Aaron W. LaFramboise <aaron98wiridge9@aaronwl.com>
2684
2685         * coff-i386.c (coff_i386_reloc): Fix weak symbols.
2686         * cofflink.c (_bfd_coff_link_input_bfd): Don't process
2687         C_NT_WEAK aux entries.
2688         (_bfd_coff_generic_relocate_section): Handle undefined
2689         aliases.
2690
2691 2004-11-07  Andreas Schwab  <schwab@suse.de>
2692
2693         * elf32-m68k.c (elf_m68k_adjust_dynamic_symbol): Use
2694         SYMBOL_CALLS_LOCAL and check for undefweak symbols with
2695         non-default visibility.
2696
2697 2004-11-01  Mark Mitchell  <mark@codesourcery.com>
2698
2699         * elf32-arm.c (elf32_arm_symbian_begin_write_processing): Clear
2700         D_PAGED.
2701         (elf32_arm_symbian_modify_segment_map): Don't
2702         reset includes_filehdr and includes_phdrs here.
2703
2704 2004-11-04  Daniel Jacobowitz  <dan@debian.org>
2705
2706         * Makefile.am (BFD32_BACKENDS, BFD32_BACKENDS_CFILES): Replace
2707         elfarm-nabi with elf32-arm.  Remove elfarm-oabi.
2708         (elf32-arm.lo): Replace elfarm-nabi.lo rule.  Remove elf32-arm.h
2709         dependency.
2710         * config.bfd: Move arm-*-oabi* and thumb-*-oabi* from obsolete list
2711         to a new removed list.  Remove normal configuration stanzas.
2712         * configure.in: (bfd_elf32_bigarm_vec, bfd_elf32_bigarm_symbian_vec)
2713         (bfd_elf32_littlearm_symbian_vec, bfd_elf32_littlearm_vec): Replace
2714         elfarm-nabi.lo with elf32-arm.lo.
2715         (bfd_elf32_bigarm_oabi_vec, bfd_elf32_littlearm_oabi_vec): Remove.
2716         * elf32-arm.c: Renamed from elfarm-nabi.c.  Inline elf32-arm.h.
2717         * elf32-arm.h: Remove.
2718         * elfarm-oabi.c: Remove.
2719         * targets.c (_bfd_target_vector): Remove bfd_elf32_bigarm_oabi_vec
2720         and bfd_elf32_littlearm_oabi_vec.
2721         * aclocal.m4, Makefile.in, configure, doc/Makefile.in: Regenerated.
2722
2723 2004-11-04  Hans-Peter Nilsson  <hp@axis.com>
2724
2725         * config.bfd: Support crisv32-*-* like cris-*-*.
2726         * archures.c (bfd_mach_cris_v0_v10, bfd_mach_cris_v32)
2727         (bfd_mach_cris_v10_v32): New macros.
2728         * cpu-cris.c: Tweak formatting.
2729         (get_compatible): New function.
2730         (N): New macro.
2731         (bfd_cris_arch_compat_v10_v32, bfd_cris_arch_v32): New
2732         bfd_arch_info_type:s.
2733         (bfd_cris_arch): Use bfd_mach_cris_v0_v10 for member mach,
2734         get_compatible for member compatible and link bfd_cris_arch_v32 as
2735         next.
2736         * elf32-cris.c (cris_elf_pcrel_reloc)
2737         (cris_elf_set_mach_from_flags): New functions.
2738         (cris_elf_howto_table) <R_CRIS_8_PCREL, R_CRIS_16_PCREL>
2739         <R_CRIS_32_PCREL>: Use cris_elf_pcrel_reloc.
2740         (cris_elf_grok_prstatus, cris_elf_grok_psinfo): Give correct
2741         numbers for bfd_mach_cris_v32.
2742         (PLT_ENTRY_SIZE_V32): New macro.
2743         (elf_cris_plt0_entry): Drop last comma in initializer.
2744         (elf_cris_plt0_entry_v32, elf_cris_plt_entry_v32)
2745         (elf_cris_pic_plt0_entry_v32, elf_cris_pic_plt_entry_v32): New
2746         PLT initializers.
2747         (cris_elf_relocate_section): Change all "%B(%A)" messages to
2748         "%B, section %A".
2749         (elf_cris_finish_dynamic_symbol): Do V32-specific PLT entries.
2750         (elf_cris_finish_dynamic_sections): Similar.
2751         (elf_cris_adjust_dynamic_symbol): Similar.
2752         (cris_elf_check_relocs): Change all "%B(%A)" messages to "%B,
2753         section %A".
2754         <switch with PIC relocs>: Emit error and return FALSE for
2755         bfd_mach_cris_v10_v32.
2756         <case R_CRIS_8_PCREL, case R_CRIS_16_PCREL, case R_CRIS_32_PCREL>:
2757         Emit warning when generating textrel reloc.
2758         (cris_elf_object_p): Call cris_elf_set_mach_from_flags.
2759         (cris_elf_final_write_processing): Set flags according to mach.
2760         (cris_elf_print_private_bfd_data): Display
2761         EF_CRIS_VARIANT_COMMON_V10_V32 and EF_CRIS_VARIANT_V32.
2762         (cris_elf_merge_private_bfd_data): Drop variables old_flags,
2763         new_flags.  Don't call cris_elf_final_write_processing.  Don't
2764         look at the actual elf header flags at all; use
2765         bfd_get_symbol_leading_char to check ibfd, obfd.  Trap difference
2766         in bfd_get_mach for ibfd and obfd and handle merging of compatible
2767         objects.
2768         (bfd_elf32_bfd_copy_private_bfd_data): Define.
2769         * reloc.c (BFD_RELOC_CRIS_SIGNED_8, BFD_RELOC_CRIS_UNSIGNED_8)
2770         (BFD_RELOC_CRIS_SIGNED_16, BFD_RELOC_CRIS_UNSIGNED_16)
2771         (BFD_RELOC_CRIS_LAPCQ_OFFSET): New relocs.
2772         * bfd-in2.h, libbfd.h: Regenerate.
2773
2774 2004-11-04  Alan Modra  <amodra@bigpond.net.au>
2775
2776         * elf64-ppc.h (ppc64_elf_edit_toc): Declare.
2777         * elf64-ppc.c (struct ppc_link_hash_entry <adjust_done>): Update
2778         comment.
2779         (struct adjust_toc_info): New.
2780         (adjust_toc_syms, ppc64_elf_edit_toc): New functions.
2781
2782 2004-11-03  Bob Wilson  <bob.wilson@acm.org>
2783
2784         * elf.c (assign_file_positions_for_segments): Set next_file_pos even
2785         if there are no segments.
2786
2787 2004-11-02  Daniel Jacobowitz  <dan@debian.org>
2788
2789         * config.bfd: Mark arm-*-oabi and thumb-*-oabi as obsolete.
2790
2791 2004-11-02  Nick Clifton  <nickc@redhat.com>
2792
2793         * elf32-iq2000.c: Convert to ISO C90 formatting.
2794
2795 2004-11-02  Hans-Peter Nilsson  <hp@axis.com>
2796
2797         * elflink.c (_bfd_elf_create_got_section): Hide _GLOBAL_OFFSET_TABLE_.
2798
2799 2004-10-28  H.J. Lu  <hongjiu.lu@intel.com>
2800
2801         * elfxx-ia64.c (elfNN_ia64_relocate_section): Handle weak
2802         undefined symbols for R_IA64_SECREL32MSB, R_IA64_SECREL32LSB,
2803         R_IA64_SECREL64MSB and R_IA64_SECREL64LSB.
2804
2805 2004-10-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2806
2807         * elf32-sh.c (tpoff): Take alignment into account.
2808
2809 2004-10-28  Nick Clifton  <nickc@redhat.com>
2810
2811         * elf32-iq2000.c (iq2000_elf_relocate_section): Do nothing when
2812         performing a relocatable link.
2813         (iq2000_elf_object_p): Do not set elf_bad_symtab.  This is only
2814         for MIPS ports under Irix.
2815
2816 2004-10-27  Richard Earnshaw  <rearnsha@arm.com>
2817
2818         * elf32-arm.h (bfd_elf32_arm_process_before_allocation): Handle
2819         R_ARM_CALL and R_ARM_JUMP24 as aliases of R_ARM_PC24.
2820         (elf32_arm_final_link_relocate): Ditto.
2821         (arm_add_to_rel, elf32_arm_relocate_section): Ditto.
2822         (elf32_arm_gc_sweep_hook, elf32_arm_check_relocs): Ditto
2823         (elf32_arm_adjust_dynamic_symbol): Ditto.
2824         * elfarm-nabi.c (elf32_arm_howto_table): Add R_ARM_CALL and
2825         R_ARM_JUMP32.  Move R_ARM_R{REL32,ABS32,PC24,BASE}...
2826         (elf32_arm_r_howto): ... To here.
2827         (elf32_arm_howto_from_type): Use elf32_arm_r_howto.
2828
2829 2004-10-26  H.J. Lu  <hongjiu.lu@intel.com>
2830
2831         PR 475
2832         * elfxx-ia64.c (elfNN_ia64_relocate_section): Correct
2833         R_IA64_SECREL32MSB, R_IA64_SECREL32LSB, R_IA64_SECREL64MSB
2834         and R_IA64_SECREL64LSB.
2835
2836 2004-10-26  Paul Brook  <paul@codesourcery.com>
2837
2838         * elflink.c (elf_finalize_dynstr): Skip shared aux structure.
2839         (bfd_elf_size_dynamic_sections): Create default version definition.
2840         (elf_link_output_extsym): Adjust for default symbol version.
2841
2842 2004-10-24  Hans-Peter Nilsson  <hp@bitrange.com>
2843
2844         * mmo.c: Adjust to ISO C.
2845
2846         * mmo.c (mmo_write_section_description): New function broken out
2847         of mmo_internal_write_section.
2848         (mmo_internal_write_section): For each of .text and .data, call
2849         mmo_write_section_description before outputting contents if it has
2850         nontrivially deducible vma or contents.
2851         (mmo_has_leading_or_trailing_zero_tetra_p): New function.
2852         (mmo_canonicalize_symtab): Adjust absolute symbols to .data
2853         symbols if found within the .data address range.
2854
2855 2004-10-24  Daniel Jacobowitz  <dan@debian.org>
2856
2857         * opncls.c (bfd_close): Return TRUE for BFD_IN_MEMORY.
2858
2859 2004-10-24  Hans-Peter Nilsson  <hp@bitrange.com>
2860
2861         * mmo.c (File Layout): Correct place of misplaced blurb about
2862         special data.
2863
2864 2004-10-22  Mark Kettenis  <kettenis@gnu.org>
2865
2866         * config.bfd: Add mips64*-*-openbsd.
2867
2868 2004-10-21  Bob Wilson  <bob.wilson@acm.org>
2869
2870         * elf32-xtensa.c (ebb_propose_action): Put declarations before
2871         statements.
2872
2873 2004-10-21  H.J. Lu  <hongjiu.lu@intel.com>
2874
2875         * configure.in: (AM_INIT_AUTOMAKE): Set version to 2.15.94.
2876         * configure: Regenerate.
2877
2878 2004-10-21  H.J. Lu  <hongjiu.lu@intel.com>
2879
2880         PR 463
2881         * aoutx.h (aout_link_input_section_std): Pass proper hash entry
2882         to linker reloc_overflow callback.
2883         (aout_link_input_section_ext): Likewise.
2884         (aout_link_reloc_link_order): Likewise.
2885         * coff-a29k.c (coff_a29k_relocate_section): Likewise.
2886         * coff-alpha.c (alpha_ecoff_get_relocated_section_contents):
2887         Likewise.
2888         (alpha_relocate_section): Likewise.
2889         * coff-arm.c (coff_arm_relocate_section): Likewise.
2890         * coff-h8300.c (h8300_reloc16_extra_cases): Likewise.
2891         * coff-h8500.c (extra_case): Likewise.
2892         * coff-i960.c (coff_i960_relocate_section): Likewise.
2893         * coff-mcore.c (coff_mcore_relocate_section): Likewise.
2894         * coff-mips.c (mips_relocate_section): Likewise.
2895         * coff-or32.c (coff_or32_relocate_section): Likewise.
2896         * coff-ppc.c (coff_ppc_relocate_section): Likewise.
2897         * coff-rs6000.c (xcoff_ppc_relocate_section): Likewise.
2898         * coff-sh.c (sh_relocate_section): Likewise.
2899         * coff-tic80.c (coff_tic80_relocate_section): Likewise.
2900         * coff-w65.c (w65_reloc16_extra_cases): Likewise.
2901         * coff-z8k.c (extra_case): Likewise.
2902         * coff64-rs6000.c (xcoff64_ppc_relocate_section): Likewise.
2903         * cofflink.c (_bfd_coff_reloc_link_order): Likewise.
2904         (_bfd_coff_generic_relocate_section): Likewise.
2905         * ecoff.c (ecoff_reloc_link_order): Likewise.
2906         * elf-hppa.h (elf_hppa_relocate_section): Likewise.
2907         * elf-m10200.c (mn10200_elf_relocate_section): Likewise.
2908         * elf-m10300.c (mn10300_elf_relocate_section): Likewise.
2909         * elf32-arm.h (elf32_arm_relocate_section): Likewise.
2910         * elf32-avr.c (elf32_avr_relocate_section): Likewise.
2911         * elf32-cr16c.c (elf32_cr16c_relocate_section): Likewise.
2912         * elf32-cris.c (cris_elf_relocate_section): Likewise.
2913         * elf32-crx.c (elf32_crx_relocate_section): Likewise.
2914         * elf32-d10v.c (elf32_d10v_relocate_section): Likewise.
2915         * elf32-fr30.c (fr30_elf_relocate_section): Likewise.
2916         * elf32-frv.c (elf32_frv_relocate_section): Likewise.
2917         * elf32-h8300.c (elf32_h8_relocate_section): Likewise.
2918         * elf32-hppa.c (elf32_hppa_relocate_section): Likewise.
2919         * elf32-i370.c (i370_elf_relocate_section): Likewise.
2920         * elf32-i386.c (elf_i386_relocate_section): Likewise.
2921         * elf32-i860.c (elf32_i860_relocate_section): Likewise.
2922         * elf32-ip2k.c (ip2k_elf_relocate_section): Likewise.
2923         * elf32-iq2000.c (iq2000_elf_relocate_section): Likewise.
2924         * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
2925         * elf32-m68hc1x.c (elf32_m68hc11_relocate_section): Likewise.
2926         * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
2927         * elf32-mcore.c (mcore_elf_relocate_section): Likewise.
2928         * elf32-msp430.c (elf32_msp430_relocate_section): Likewise.
2929         * elf32-openrisc.c (openrisc_elf_relocate_section): Likewise.
2930         * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
2931         * elf32-s390.c (elf_s390_relocate_section): Likewise.
2932         * elf32-sh.c (sh_elf_relocate_section): Likewise.
2933         * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
2934         * elf32-v850.c (v850_elf_relocate_section): Likewise.
2935         * elf32-vax.c (elf_vax_relocate_section): Likewise.
2936         * elf32-xstormy16.c (xstormy16_elf_relocate_section): Likewise.
2937         * elf64-alpha.c (elf64_alpha_relocate_section): Likewise.
2938         * elf64-mmix.c (mmix_elf_relocate_section): Likewise.
2939         * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
2940         * elf64-s390.c (elf_s390_relocate_section): Likewise.
2941         * elf64-sh64.c (sh_elf64_relocate_section): Likewise.
2942         * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
2943         * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
2944         * elflink.c (elf_reloc_link_order): Likewise.
2945         * elfxx-ia64.c (elfNN_ia64_relocate_section): Likewise.
2946         * elfxx-mips.c (_bfd_mips_elf_relocate_section): Likewise.
2947         (_bfd_elf_mips_get_relocated_section_contents): Likewise.
2948         * linker.c (_bfd_generic_reloc_link_order): Likewise.
2949         * pdp11.c (pdp11_aout_link_input_section): Likewise.
2950         (aout_link_reloc_link_order): Likewise.
2951         * reloc.c (bfd_generic_get_relocated_section_contents):
2952         Likewise.
2953         * xcofflink.c (xcoff_reloc_link_order): Likewise.
2954         * simple.c (simple_dummy_reloc_overflow): Updated.
2955
2956 2004-10-20  Andreas Schwab  <schwab@suse.de>
2957
2958         * elf32-m68k.c (elf_m68k_plt_sym_val): New function.
2959         (elf_backend_plt_sym_val): Define.
2960
2961 2004-10-19  Danny Smith  <dannysmith@users.sourceforege.net>
2962
2963         * config.bfd: Set targ_underscore=yes for PE COFF targets
2964
2965 2004-10-19  Alan Modra  <amodra@bigpond.net.au>
2966
2967         * elf64-ppc.c (opd_entry_value): Handle --just-symbols objects.
2968         (ppc64_elf_edit_opd): Likewise.
2969
2970 2004-10-18  Mark Mitchell  <mark@codesourcery.com>
2971
2972         * elfarm-nabi.c (ELF_DYNAMIC_SEC_FLAGS): Add comment.
2973         * elflink.c (_bfd_elf_create_dynamic_sections): For a loaded PLT,
2974         set SEC_ALLOC and SEC_LOAD.
2975
2976 2004-10-18  Nick Clifton  <nickc@redhat.com>
2977
2978         * elf32-xstormy16.c (xstormy16_elf_relocate_section): Compute
2979         'name' for relocs against both local and global symbols.
2980
2981 2004-10-16  Daniel Jacobowitz  <dan@debian.org>
2982
2983         * bfd-in2.h: Regenerate.
2984         * bfd.c (struct bfd): Add no_export.
2985         * elflink.c (elf_link_add_object_symbols): Handle no_export.
2986
2987 2004-10-15  Alan Modra  <amodra@bigpond.net.au>
2988
2989         * config.bfd: Whitespace cleanup.
2990         * Makefile.am: Run "make dep-am"
2991         * Makefile.in: Regenerate.
2992
2993 2004-10-15  Jakub Jelinek  <jakub@redhat.com>
2994
2995         * elflink.c (struct already_linked_section): Removed.
2996         (try_match_symbols_in_sections, already_linked): Removed.
2997         (_bfd_elf_section_already_linked): Skip ^\.gnu\.linkonce\.[^.]*\.
2998         prefix of section names when finding already_linked_table
2999         chain.  Compare section names.  Instead of calling already_linked,
3000         do it inline and only for sections in the same already_linked_list.
3001
3002 2004-10-15  Alan Modra  <amodra@bigpond.net.au>
3003
3004         * elf-eh-frame.c (_bfd_elf_eh_frame_section_offset): Add "info"
3005         parameter.  If called after _bfd_elf_write_section_eh_frame,
3006         don't allow a -2 return unless need_* bit is already set, and
3007         handle offsets adjusted for output_offset.
3008         * elf-bfd.h (_bfd_elf_eh_frame_section_offset): Update prototype.
3009         * elf.c (_bfd_elf_section_offset): Update call.
3010
3011 2004-10-13  H.J. Lu  <hongjiu.lu@intel.com>
3012
3013         PR 440
3014         * coffcode.h (coff_compute_section_file_positions): Cast to
3015         bfd_vma when computing page alignment.
3016
3017 2004-10-13  Mark Mitchell  <mark@codesourcery.com>
3018
3019         * elf32-arm.h (elf32_arm_finish_dynamic_sections): Use file
3020         offsets, not VMAs, for DT_VERSYM, DT_VERDEF, DT_VERNEED.
3021
3022 2004-10-12  Mark Mitchell  <mark@codesourcery.com>
3023
3024         * elf32-arm.h (elf32_arm_finish_dynamic_symbol): Make .rel.plt
3025         relocations use a virtual address, not a section offset.
3026
3027 2004-10-12  Bob Wilson  <bob.wilson@acm.org>
3028
3029         * elf32-xtensa.c (elf_xtensa_get_private_bfd_flags): Delete.
3030         (narrow_instruction, widen_instruction): Remove unnecessary calls to
3031         xtensa_format_encode.
3032         (ebb_propose_action): Inline call to ebb_add_proposed_action.
3033         (ebb_add_proposed_action): Delete.
3034
3035 2004-10-12  Bob Wilson  <bob.wilson@acm.org>
3036
3037         * elf32-xtensa.c: Use ISO C90 formatting.
3038
3039 2004-10-12  Paul Brook  <paul@codesourcery.com>
3040
3041         * elf32-arm.h (elf32_arm_merge_private_bfd_data): Rephrase error
3042         message.
3043
3044 2004-10-12  Paul Brook  <paul@codesourcery.com>
3045
3046         * elf32-arm.h: Support EABI version 4 objects.
3047
3048 2004-10-12  Alan Modra  <amodra@bigpond.net.au>
3049
3050         PR 325
3051         * cpu-i386.c (bfd_x86_64_arch_intel_syntax): Place last in chain.
3052         Don't mark as default.
3053         (bfd_x86_64_arch): Don't mark as default.
3054
3055 2004-10-12  Alan Modra  <amodra@bigpond.net.au>
3056
3057         * elflink.c (enum action_discarded): New.
3058         (elf_section_complain_discarded): Delete.
3059         (elf_action_discarded): New function subsuming the above and also
3060         controlling reloc behaviour.
3061         (elf_link_input_bfd): Use it.
3062
3063 2004-10-11  Jakub Jelinek  <jakub@redhat.com>
3064
3065         * elf.c (bfd_section_from_shdr): Handle SHT_GNU_LIBLIST.
3066         (special_sections): Add .gnu.liblist and .gnu.conflict.
3067         (assign_section_numbers): Handle SHT_GNU_LIBLIST.
3068
3069 2004-10-11  Alan Modra  <amodra@bigpond.net.au>
3070
3071         PR 233
3072         * elflink.c (elf_link_input_bfd): Try harder to support
3073         relocations against symbols in removed linkonce sections.
3074
3075 2004-10-11  Alan Modra  <amodra@bigpond.net.au>
3076
3077         * elflink.c (elf_link_input_bfd): Revert PR 354 change.
3078
3079         PR 354
3080         * elflink.c (elf_link_input_bfd): Check that relocs in SEC_ALLOC
3081         sections do not reference symbols in non-SEC_ALLOC sections.
3082
3083 2004-10-11  Alan Modra  <amodra@bigpond.net.au>
3084
3085         PR 437
3086         * elflink.c (elf_link_sort_relocs): Don't bomb on unusual sections.
3087         (_bfd_elf_link_omit_section_dynsym): Formatting.
3088
3089 2004-10-10  Alan Modra  <amodra@bigpond.net.au>
3090
3091         * libbfd-in.h (BFD_ASSERT, BFD_FAIL): Wrap macro body in do while.
3092         * libbfd.h: Regnerate.
3093         * elf32-cris.c: Add missing semicolon to BFD_ASSERTs.
3094         * elf32-frv.c: Likewise.
3095         * elf32-m32r.c: Likewise.
3096         * elf32-ppc.c: Likewise.
3097         * elf64-hppa.c: Likewise.
3098         * elfxx-ia64.c: Likewise.
3099         * opncls.c: Likewise.
3100
3101 2004-10-10  Alan Modra  <amodra@bigpond.net.au>
3102
3103         * elf-bfd.h (struct eh_frame_hdr_info): Add offsets_adjusted.
3104         * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): Adjust
3105         offsets stored in struct eh_cie_fde entries before doing other
3106         work.
3107
3108         * elf-bfd.h (struct eh_cie_fde): Add cie_inf, remove sec.
3109         (struct eh_frame_hdr_info): Add last_cie_inf, remove last_cie_offset.
3110         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Delete code
3111         setting offsets for removed CIEs.  Don't set "sec", instead set
3112         cie_inf for FDEs.  Keep a pointer to last struct eh_cie_fde for a
3113         CIE in hdr_info.  Only set make_relative and make_lsda_relative
3114         for CIEs.  Use pointers rather than array indices.
3115         (_bfd_elf_eh_frame_section_offset): Test/set make_relative,
3116         make_lsda_relative, need_* on cie_inf for FDEs.
3117         (_bfd_elf_write_section_eh_frame): Adjust offset and new_offset for
3118         section output_offset.  Delete cie_offset, instead use cie_inf
3119         pointer to CIE entry.  Use need_relative and need_lsda_relative on
3120         CIE entry for FDEs.  Use pointers rather than array indices.
3121
3122 2004-10-09  Alan Modra  <amodra@bigpond.net.au>
3123
3124         * coff-rs6000.c (rs6000coff_vec): Add initializer for
3125         bfd_is_target_special_symbol.
3126         * coff64-rs6000.c (rs6000coff64_vec): Likewise.
3127         * som.c (som_bfd_is_target_special_symbol): Define.
3128
3129 2004-10-08  Nick Clifton  <nickc@redhat.com>
3130
3131         * configure.in: (AM_INIT_AUTOMAKE): Set version to 2.15.93.
3132         * configure: Regenerate.
3133         * bfd-in2.h: Regenerate.
3134         * syms.c (bfd_is_target_special_symbol): New interface function.
3135         Returns true when a symbol should be considered to be special.
3136         * targets.c (bfd_target): Include bfd_is_target_special_symbol in
3137         the symbol jump table.
3138         * elf32-arm.h (elf32_arm_is_target_special_symbol): New function.
3139         Return true iff the symbol is a mapping symbol.
3140         (bfd_elf32_bfd_is_target_special_symbol): Define.
3141         * elfxx-target.h: Provide a default definition for
3142         bfd_is_target_special_symbol.
3143         * aout-target.h: Likewise.
3144         * aout-tic30.c: Likewise.
3145         * binary.c: Likewise.
3146         * coffcode.h: Likewise.
3147         * i386msdos.c: Likewise.
3148         * ieee.c: Likewise.
3149         * ihex.c: Likewise.
3150         * libaout.h: Likewise.
3151         * libbfd-in.h: Likewise
3152         * libecoff.h: Likewise.
3153         * mach-o.c: Likewise.
3154         * mmo.c: Likewise.
3155         * nlm-target.h: Likewise.
3156         * oasys.c: Likewise.
3157         * pef.c: Likewise.
3158         * ppcboot.c: Likewise.
3159         * srec.c: Likewise.
3160         * tekhex.c: Likewise.
3161         * versados.c: Likewise.
3162         * vms.c: Likewise.
3163         * xcoff-target.h: Likewise.
3164         * xsym.c: Likewise.
3165         * libbfd.h: Regenerate.
3166
3167 2004-10-08  Daniel Jacobowitz  <dan@debian.org>
3168
3169         * config.bfd: Include 64-bit support for i[3-7]86-*-solaris2*.
3170         * elf64-x86-64.c (elf64_x86_64_section_from_shdr): New function.
3171         (elf_backend_section_from_shdr): Define.
3172
3173 2004-10-08  Alan Modra  <amodra@bigpond.net.au>
3174
3175         * syms.c (bfd_is_local_label): Return false for file symbols.
3176
3177 2004-10-07  Bob Wilson  <bob.wilson@acm.org>
3178             David Heine  <dlheine@tensilica.com>
3179
3180         * elf32-xtensa.c (elf32xtensa_size_opt): New global variable.
3181         (xtensa_default_isa): Global variable moved here from xtensa-isa.c.
3182         (elf32xtensa_no_literal_movement): New global variable.
3183         (elf_howto_table): Add entries for new relocations.
3184         (elf_xtensa_reloc_type_lookup): Handle new relocations.
3185         (property_table_compare): When addresses are equal, compare sizes and
3186         various property flags.
3187         (property_table_matches): New.
3188         (xtensa_read_table_entries): Extend to read new property tables.  Add
3189         output_addr parameter to indicate that output addresses should be used.
3190         Use bfd_get_section_limit.
3191         (elf_xtensa_find_property_entry): New.
3192         (elf_xtensa_in_literal_pool): Use elf_xtensa_find_property_entry.
3193         (elf_xtensa_check_relocs): Handle new relocations.
3194         (elf_xtensa_do_reloc): Use bfd_get_section_limit.  Handle new
3195         relocations.  Use new xtensa-isa.h functions.
3196         (build_encoding_error_message): Remove encode_result parameter.  Add
3197         new target_address parameter used to detect alignment errors.
3198         (elf_xtensa_relocate_section): Use bfd_get_section_limit.  Clean up
3199         error handling.  Use new is_operand_relocation function.
3200         (elf_xtensa_combine_prop_entries, elf_xtensa_merge_private_bfd_data):
3201         Use underbar macro for error messages.  Formatting.
3202         (get_const16_opcode): New.
3203         (get_l32r_opcode): Add a separate flag for initialization.
3204         (get_relocation_opnd): Operand number is no longer explicit in the
3205         relocation.  Change to decode the opcode and analyze its operands.
3206         (get_relocation_slot): New.
3207         (get_relocation_opcode): Add bfd parameter.  Use bfd_get_section_limit.
3208         Use new xtensa-isa.h functions to handle multislot instructions.
3209         (is_l32r_relocation): Add bfd parameter.  Use is_operand_relocation.
3210         (get_asm_simplify_size, is_alt_relocation, is_operand_relocation,
3211         insn_decode_len, insn_decode_opcode, check_branch_target_aligned,
3212         check_loop_aligned, check_branch_target_aligned_address, narrowable,
3213         widenable, narrow_instruction, widen_instruction, op_single_fmt_table,
3214         get_single_format, init_op_single_format_table): New.
3215         (elf_xtensa_do_asm_simplify): Add error_message parameter and use it
3216         instead of calling _bfd_error_handler.  Use new xtensa-isa.h functions.
3217         (contract_asm_expansion): Add error_message parameter and pass it to
3218         elf_xtensa_do_asm_simplify.  Replace use of R_XTENSA_OP0 relocation
3219         with R_XTENSA_SLOT0_OP.
3220         (get_expanded_call_opcode): Extend to handle either L32R or CONST16
3221         instructions.  Use new xtensa-isa.h functions.
3222         (r_reloc struct): Add new virtual_offset field.
3223         (r_reloc_init): Add contents and content_length parameters.  Set
3224         virtual_offset field to zero.  Add contents to target_offset field for
3225         partial_inplace relocations.
3226         (r_reloc_is_defined): Check for null.
3227         (print_r_reloc): New debug function.
3228         (source_reloc struct): Replace xtensa_operand field with pair of the
3229         opcode and the operand position.  Add is_abs_literal field.
3230         (init_source_reloc): Specify operand by opcode/position pair.  Set
3231         is_abs_literal field.
3232         (source_reloc_compare): When target_offsets are equal, compare other
3233         fields to make sorting predictable.
3234         (literal_value struct): Add is_abs_literal field.
3235         (value_map_hash_table struct): Add has_last_loc and last_loc fields.
3236         (init_literal_value): New.
3237         (is_same_value): Replace with ...
3238         (literal_value_equal): ... this function.  Add comparisons of
3239         virtual_offset and is_abs_literal fields.
3240         (value_map_hash_table_init): Use bfd_zmalloc.  Check for allocation
3241         failure.  Initialize has_last_loc field.
3242         (value_map_hash_table_delete): New.
3243         (hash_literal_value): Rename to ...
3244         (literal_value_hash): ... this.  Include is_abs_literal flag and
3245         virtual_offset field in the hash value.
3246         (get_cached_value): Rename to ...
3247         (value_map_get_cached_value): ... this.  Update calls to
3248         literal_value_hash and literal_value_equal.
3249         (add_value_map): Check for allocation failure.  Update calls to
3250         value_map_get_cached_value and literal_value_hash.
3251         (text_action, text_action_list, text_action_t): New types.
3252         (find_fill_action, compute_removed_action_diff, adjust_fill_action,
3253         text_action_add, text_action_add_literal, offset_with_removed_text,
3254         offset_with_removed_text_before_fill, find_insn_action,
3255         print_action_list, print_removed_literals): New.
3256         (offset_with_removed_literals): Delete.
3257         (xtensa_relax_info struct): Add is_relaxable_asm_section, action_list,
3258         fix_array, fix_array_count, allocated_relocs, relocs_count, and
3259         allocated_relocs_count fields.
3260         (init_xtensa_relax_info): Initialize new fields.
3261         (reloc_bfd_fix struct): Add new translated field.
3262         (reloc_bfd_fix_init): Add translated parameter and use it to set the
3263         translated field.
3264         (fix_compare, cache_fix_array): New.
3265         (get_bfd_fix): Remove fix_list parameter and get all relax_info for the
3266         section via get_xtensa_relax_info.  Use cache_fix_array to set up
3267         sorted fix_array and use bsearch instead of linear search.
3268         (section_cache_t): New struct.
3269         (init_section_cache, section_cache_section, clear_section_cache): New.
3270         (ebb_t, ebb_target_enum, proposed_action, ebb_constraint): New types.
3271         (init_ebb_constraint, free_ebb_constraint, init_ebb, extend_ebb_bounds,
3272         extend_ebb_bounds_forward, extend_ebb_bounds_backward,
3273         insn_block_decodable_len, ebb_propose_action, ebb_add_proposed_action):
3274         New.
3275         (retrieve_contents): Use bfd_get_section_limit.
3276         (elf_xtensa_relax_section): Add relocations_analyzed flag.  Update call
3277         to compute_removed_literals.  Free value_map_hash_table when no longer
3278         needed.
3279         (analyze_relocations): Check is_relaxable_asm_section flag.  Call
3280         compute_text_actions for all sections.
3281         (find_relaxable_sections): Mark sections as relaxable if they contain
3282         ASM_EXPAND relocations that can be optimized.  Adjust r_reloc_init
3283         call.  Increment relax_info src_count field only for appropriate
3284         relocation types.  Remove is_literal_section check.
3285         (collect_source_relocs): Use bfd_get_section_limit.  Adjust calls to
3286         r_reloc_init and find_associated_l32r_irel.  Check
3287         is_relaxable_asm_section flag.  Handle L32R instructions with absolute
3288         literals.  Pass is_abs_literal flag to init_source_reloc.
3289         (is_resolvable_asm_expansion): Use bfd_get_section_limit.  Check for
3290         CONST16 instructions.  Adjust calls to r_reloc_init and
3291         pcrel_reloc_fits.  Handle weak symbols conservatively.
3292         (find_associated_l32r_irel): Add bfd parameter and pass it to
3293         is_l32r_relocation.
3294         (compute_text_actions, compute_ebb_proposed_actions,
3295         compute_ebb_actions, check_section_ebb_pcrels_fit,
3296         check_section_ebb_reduces, text_action_add_proposed,
3297         compute_fill_extra_space): New.
3298         (remove_literals): Replace with ...
3299         (compute_removed_literals): ... this function.  Call
3300         init_section_cache.  Use bfd_get_section_limit.  Sort internal_relocs.
3301         Call xtensa_read_table_entries to get the property table.  Skip
3302         relocations other than R_XTENSA_32 and R_XTENSA_PLT.  Use new
3303         is_removable_literal, remove_dead_literal, and
3304         identify_literal_placement functions.
3305         (get_irel_at_offset): Rewrite to use bsearch on sorted relocations
3306         instead of linear search.
3307         (is_removable_literal, remove_dead_literal,
3308         identify_literal_placement): New.
3309         (relocations_reach): Update check for literal not referenced by any
3310         PC-relative relocations.  Adjust call to pcrel_reloc_fits.
3311         (coalesce_shared_literal, move_shared_literal): New.
3312         (relax_section): Use bfd_get_section_limit.  Call
3313         translate_section_fixes.  Update calls to r_reloc_init and
3314         offset_with_removed_text.  Check new is_relaxable_asm_section flag.
3315         Add call to pin_internal_relocs.  Add special handling for
3316         R_XTENSA_ASM_SIMPLIFY and R_XTENSA_DIFF* relocs.  Use virtual_offset
3317         info to calculate new addend_displacement variable.  Replace code for
3318         deleting literals with more general code to perform the actions
3319         determined by the action_list for the section.
3320         (translate_section_fixes, translate_reloc_bfd_fix): New.
3321         (translate_reloc): Check new is_relaxable_asm_section flag.  Call
3322         find_removed_literal only if is_operand_relocation.  Update call to
3323         offset_with_removed_text.  Use new target_offset and removed_bytes
3324         variables.
3325         (move_literal): New.
3326         (relax_property_section):  Use bfd_get_section_limit.  Set new
3327         is_full_prop_section flag and handle new property tables.  Update calls
3328         to r_reloc_init and offset_with_removed_text.  Check
3329         is_relaxable_asm_section flag.  Handle expansion of zero-sized
3330         unreachable entries, with use of offset_with_removed_text_before_fill.
3331         For relocatable links, combine entries only for literal tables.
3332         (relax_section_symbols): Check is_relaxable_asm_section flag.  Update
3333         calls to offset_with_removed_text.  Translate st_size field for
3334         function symbols.
3335         (do_fix_for_relocatable_link): Change to return bfd_boolean to indicate
3336         failure.  Add contents parameter.  Update call to get_bfd_fix.  Update
3337         call to r_reloc_init.  Call _bfd_error_handler and return FALSE for
3338         R_XTENSA_ASM_EXPAND relocs.
3339         (do_fix_for_final_link): Add input_bfd and contents parameters.  Update
3340         call to get_bfd_fix.  Include offset from contents for partial_inplace
3341         relocations.
3342         (is_reloc_sym_weak): New.
3343         (pcrel_reloc_fits): Use new xtensa-isa.h functions.
3344         (prop_sec_len): New.
3345         (xtensa_is_property_section): Handle new property sections.
3346         (is_literal_section): Delete.
3347         (internal_reloc_compare): When r_offset matches, compare r_info and
3348         r_addend to make sorting predictable.
3349         (internal_reloc_matches): New.
3350         (xtensa_get_property_section_name): Handle new property sections.
3351         (xtensa_get_property_predef_flags): New.
3352         (xtensa_callback_required_dependence): Use bfd_get_section_limit.
3353         Update calls to xtensa_isa_init, is_l32r_relocation, and r_reloc_init.
3354         * xtensa-isa.c (xtensa_default_isa): Moved to elf32-xtensa.c.
3355         (xtisa_errno, xtisa_error_msg): New variables.
3356         (xtensa_isa_errno, xtensa_isa_error_msg): New.
3357         (xtensa_insnbuf_alloc): Add error handling.
3358         (xtensa_insnbuf_to_chars): Add num_chars parameter.  Update to
3359         use xtensa_format_decode.  Add error handling.
3360         (xtensa_insnbuf_from_chars): Add num_chars parameter.  Decode the
3361         instruction length to find the number of bytes to copy.
3362         (xtensa_isa_init): Add error handling.  Replace calls to
3363         xtensa_load_isa and xtensa_extend_isa with code to initialize lookup
3364         tables in the xtensa_modules structure.
3365         (xtensa_check_isa_config, xtensa_add_isa, xtensa_load_isa,
3366         xtensa_extend_isa): Delete.
3367         (xtensa_isa_free): Change to only free lookup tables.
3368         (opname_lookup_compare): Replace with ...
3369         (xtensa_isa_name_compare): ... this function.  Use strcasecmp.
3370         (xtensa_insn_maxlength): Rename to ...
3371         (xtensa_isa_maxlength): ... this.
3372         (xtensa_insn_length): Delete.
3373         (xtensa_insn_length_from_first_byte): Replace with ...
3374         (xtensa_isa_length_from_chars): ... this function.
3375         (xtensa_num_opcodes): Rename to ...
3376         (xtensa_isa_num_opcodes): ... this.
3377         (xtensa_isa_num_pipe_stages, xtensa_isa_num_formats,
3378         xtensa_isa_num_regfiles, xtensa_isa_num_stages,
3379         xtensa_isa_num_sysregs, xtensa_isa_num_interfaces,
3380         xtensa_isa_num_funcUnits, xtensa_format_name, xtensa_format_lookup,
3381         xtensa_format_decode, xtensa_format_encode, xtensa_format_length,
3382         xtensa_format_num_slots, xtensa_format_slot_nop_opcode,
3383         xtensa_format_get_slot, xtensa_format_set_slot): New functions.
3384         (xtensa_opcode_lookup): Add error handling.
3385         (xtensa_decode_insn): Replace with ...
3386         (xtensa_opcode_decode): ... this function, with new format and
3387         slot parameters.  Add error handling.
3388         (xtensa_encode_insn): Replace with ...
3389         (xtensa_opcode_encode): ... this function, which does the encoding via
3390         one of the entries in the "encode_fns" array.  Add error handling.
3391         (xtensa_opcode_name): Add error handling.
3392         (xtensa_opcode_is_branch, xtensa_opcode_is_jump, xtensa_opcode_is_loop,
3393         xtensa_opcode_is_call): New.
3394         (xtensa_num_operands): Replace with ...
3395         (xtensa_opcode_num_operands): ... this function.  Add error handling.
3396         (xtensa_opcode_num_stateOperands,
3397         xtensa_opcode_num_interfaceOperands, xtensa_opcode_num_funcUnit_uses,
3398         xtensa_opcode_funcUnit_use, xtensa_operand_name,
3399         xtensa_operand_is_visible): New.
3400         (xtensa_get_operand, xtensa_operand_kind): Delete.
3401         (xtensa_operand_inout): Add error handling and special-case for
3402         "sout" operands.
3403         (xtensa_operand_get_field, xtensa_operand_set_field): Rewritten to
3404         operate on one slot of an instruction.  Added error handling.
3405         (xtensa_operand_encode): Handle default operands with no encoding
3406         functions.  Check for success by comparing against decoded value.
3407         Add error handling.
3408         (xtensa_operand_decode): Handle default operands.  Return decoded value
3409         through argument pointer.  Add error handling.
3410         (xtensa_operand_is_register, xtensa_operand_regfile,
3411         xtensa_operand_num_regs, xtensa_operand_is_known_reg): New.
3412         (xtensa_operand_isPCRelative): Rename to ...
3413         (xtensa_operand_is_PCrelative): ... this.  Add error handling.
3414         (xtensa_operand_do_reloc, xtensa_operand_undo_reloc): Return value
3415         through argument pointer.  Add error handling.
3416         (xtensa_stateOperand_state, xtensa_stateOperand_inout,
3417         xtensa_interfaceOperand_interface, xtensa_regfile_lookup,
3418         xtensa_regfile_lookup_shortname, xtensa_regfile_name,
3419         xtensa_regfile_shortname, xtensa_regfile_view_parent,
3420         xtensa_regfile_num_bits, xtensa_regfile_num_entries,
3421         xtensa_state_lookup, xtensa_state_name, xtensa_state_num_bits,
3422         xtensa_state_is_exported, xtensa_sysreg_lookup,
3423         xtensa_sysreg_lookup_name, xtensa_sysreg_name, xtensa_sysreg_number,
3424         xtensa_sysreg_is_user, xtensa_interface_lookup, xtensa_interface_name,
3425         xtensa_interface_num_bits, xtensa_interface_inout,
3426         xtensa_interface_has_side_effect, xtensa_funcUnit_lookup,
3427         xtensa_funcUnit_name, xtensa_funcUnit_num_copies): New.
3428         * xtensa-modules.c: Rewrite to use new data structures.
3429         * reloc.c (BFD_RELOC_XTENSA_DIFF8, BFD_RELOC_XTENSA_DIFF16,
3430         BFD_RELOC_XTENSA_DIFF32, BFD_RELOC_XTENSA_SLOT0_OP,
3431         BFD_RELOC_XTENSA_SLOT1_OP, BFD_RELOC_XTENSA_SLOT2_OP,
3432         BFD_RELOC_XTENSA_SLOT3_OP, BFD_RELOC_XTENSA_SLOT4_OP,
3433         BFD_RELOC_XTENSA_SLOT5_OP, BFD_RELOC_XTENSA_SLOT6_OP,
3434         BFD_RELOC_XTENSA_SLOT7_OP, BFD_RELOC_XTENSA_SLOT8_OP,
3435         BFD_RELOC_XTENSA_SLOT9_OP, BFD_RELOC_XTENSA_SLOT10_OP,
3436         BFD_RELOC_XTENSA_SLOT11_OP, BFD_RELOC_XTENSA_SLOT12_OP,
3437         BFD_RELOC_XTENSA_SLOT13_OP, BFD_RELOC_XTENSA_SLOT14_OP,
3438         BFD_RELOC_XTENSA_SLOT0_ALT, BFD_RELOC_XTENSA_SLOT1_ALT,
3439         BFD_RELOC_XTENSA_SLOT2_ALT, BFD_RELOC_XTENSA_SLOT3_ALT,
3440         BFD_RELOC_XTENSA_SLOT4_ALT, BFD_RELOC_XTENSA_SLOT5_ALT,
3441         BFD_RELOC_XTENSA_SLOT6_ALT, BFD_RELOC_XTENSA_SLOT7_ALT,
3442         BFD_RELOC_XTENSA_SLOT8_ALT, BFD_RELOC_XTENSA_SLOT9_ALT,
3443         BFD_RELOC_XTENSA_SLOT10_ALT, BFD_RELOC_XTENSA_SLOT11_ALT,
3444         BFD_RELOC_XTENSA_SLOT12_ALT, BFD_RELOC_XTENSA_SLOT13_ALT,
3445         BFD_RELOC_XTENSA_SLOT14_ALT): Add new relocations.
3446         * Makefile.am (xtensa-isa.lo, xtensa-modules.lo): Update dependencies.
3447         * Makefile.in: Regenerate.
3448         * bfd-in2.h: Likewise.
3449         * libbfd.h: Likewise.
3450
3451 2004-10-07  Richard Sandiford  <rsandifo@redhat.com>
3452
3453         * elf64-mips.c (mips_elf64_write_rel): Use STN_UNDEF for relocs
3454         against the absolute section.
3455         (mips_elf64_write_rela): Likewise.
3456
3457 2004-10-07  Jan Beulich <jbeulich@novell.com>
3458
3459         * elf.c (elf_find_function): Don't generally check for matching
3460         section, just for non-file symbols.  Remove redunant comparison
3461         for the latter.
3462         * elf32-arm.h (arm_elf_find_function): Likewise.
3463
3464 2004-10-07  Jeff Baker  <jbaker@qnx.com>
3465
3466         * elflink.c (_bfd_elf_add_dynamic_entry): Add code to warn if
3467         adding a DT_TEXTREL to a shared object and --warn-shared-textrel
3468         was specified.
3469
3470 2004-10-04  Roland McGrath  <roland@redhat.com>
3471
3472         * hash.c (bfd_hash_set_default_size): Use const for table.
3473         Use size_t instead of int for variable compared to sizeof results.
3474
3475 2004-10-05  Alan Modra  <amodra@bigpond.net.au>
3476
3477         PR 425
3478         * syms.c (_bfd_stab_section_find_nearest_line): Ignore R_*_NONE relocs.
3479
3480 2004-10-01  Paul Brook  <paul@codesourcery.com>
3481
3482         * elf32-arm.h (elf32_arm_fake_sections,
3483         is_arm_elf_unwind_section_name, elf32_arm_section_from_shdr): New
3484         functions.
3485         (elf_backend_fake_sections, elf_backend_section_from_shdr): Define.
3486
3487 2004-10-01  Alan Modra  <amodra@bigpond.net.au>
3488
3489         * elf-bfd.h (struct eh_cie_fde): Add need_relative and
3490         need_lsda_relative.
3491         * elf-eh-frame.c (_bfd_elf_eh_frame_section_offset): Set
3492         need_relative or need_lsda_relative if we are processing an
3493         offset for a reloc on a FDE initial loc or LSDA field
3494         respectively.
3495         (_bfd_elf_write_section_eh_frame): Test need_relative and
3496         need_lsda_relative in place of corresponding make_* field
3497         when deciding to use pc-relative encodings.
3498
3499 2004-09-30  Paul Brook  <paul@codesourcery.com>
3500
3501         * elf32-arm.h (bfd_elf32_arm_set_target_relocs): Handle "abs"
3502         target2 relocation type.
3503
3504 2004-09-30  H.J. Lu  <hongjiu.lu@intel.com>
3505
3506         PR 414
3507         * elflink.c (_bfd_elf_merge_symbol): Check TLS symbol.
3508
3509 2004-09-30  Paul Brook  <paul@codesourcery.com>
3510
3511         * reloc.c: Add BFD_RELOC_ARM_SMI.
3512         * bfd-in2.h: Regenerate.
3513         * libbfd.h: Ditto.
3514
3515 2004-09-24  Alan Modra  <amodra@bigpond.net.au>
3516
3517         * dwarf2.c (_bfd_dwarf2_find_nearest_line): Add output section
3518         vma and output offset to address.
3519         * simple.c (simple_save_output_info): Only set output section
3520         and offset for debug sections, or those not already set up by
3521         the linker.
3522         (bfd_simple_get_relocated_section_contents): Update comment.
3523
3524 2004-09-24  Alan Modra  <amodra@bigpond.net.au>
3525
3526         * elf.c (IS_LOADED): Delete.
3527         (assign_file_positions_for_segments): Just test SEC_LOAD instead.
3528         Restore SEC_HAS_CONTENTS test to the one place it was used prior
3529         to 2004-09-22.
3530
3531 2004-09-23  Alan Modra  <amodra@bigpond.net.au>
3532
3533         PR gas/396
3534         * elf32-sparc.c (elf32_sparc_final_write_processing): Handle
3535         bfd_mach_sparc_sparclet and bfd_mach_sparc_sparclite.  Remove
3536         redundant assignment of EM_SPARC.
3537
3538 2004-09-22  Brian Ford  <ford@vss.fsi.com>
3539
3540         * pei-i386.c (COFF_SECTION_ALIGNMENT_ENTRIES): Enable 16 byte
3541         alignment for .rdata sections so sse[2] code works with gcc >= 3.3.3
3542         constants.
3543         * pe-i386.c (COFF_SECTION_ALIGNMENT_ENTRIES): Likewise.
3544
3545 2004-09-22  Alan Modra  <amodra@bigpond.net.au>
3546
3547         * elf32-ppc.c (ppc_elf_modify_segment_map): Delete.
3548         (elf_backend_modify_segment_map): Don't define.
3549
3550 2004-09-22  Alan Modra  <amodra@bigpond.net.au>
3551
3552         * elf.c (IS_LOADED): Define.
3553         (assign_file_positions_for_segments): Don't round up file offset of
3554         PT_LOAD segments containing no SEC_LOAD sections, instead round down.
3555         Delete code handling link script adjustment of lma.  Do the adjust
3556         in later code handling similar ajustments.  Remove dead code error
3557         check.  Warn if section lma would require a negative offset
3558         adjustment.  Tweak lma adjustment to use p_filesz rather than p_memsz.
3559         Use p_vaddr + p_memsz inside section loop in place of voff.  Don't
3560         update voff in section loop.  Change voff in segment loop to be an
3561         adjustment on top of "off".  Set sec->filepos and update "off" later.
3562         Test for loadable sections consistently using IS_LOADED.  Similarly,
3563         test for alloc-only sections other than .tbss consistently.
3564         Don't bother checking SEC_ALLOC in PT_LOAD segments.  Remove FIXME.
3565         Tidy PT_NOTE handling.  Use %B and %A in error messages.
3566         (assign_file_positions_except_relocs): Use %B in error message.
3567
3568 2004-09-17  H.J. Lu  <hongjiu.lu@intel.com>
3569
3570         * Makefile.am (AUTOMAKE_OPTIONS): Require 1.9.
3571         (CONFIG_STATUS_DEPENDENCIES): New.
3572         (Makefile): Removed.
3573         (config.status): Likewise.
3574         * Makefile.in: Regenerated.
3575
3576 2004-09-17  Paul Brook  <paul@codesourcery.com>
3577
3578         * bfd-in.h (bfd_elf32_arm_set_target_relocs): Add prototype.
3579         (bfd_elf32_arm_process_before_allocation): Update prototype.
3580         * bfd-in2.h: Regenerate.
3581         * bfd/elf32-arm.h (elf32_arm_link_hash_table): Add target2_reloc.
3582         (elf32_arm_link_hash_table_create): Set it.
3583         (bfd_elf32_arm_process_before_allocation): Remove target1_is_rel.
3584         (bfd_elf32_arm_set_target_relocs): New function.
3585         (arm_real_reloc_type): New function.
3586         (elf32_arm_final_link_relocate): Use it.  Handle R_ARM_PREL31 and
3587         R_ARM_GOT_PREL.  Remove R_ARM_TARGET1.
3588         (elf32_arm_gc_sweep_hook): Ditto.
3589         (elf32_arm_check_relocs): Ditto.
3590         (elf32_arm_relocate_section): Handle R_ARM_GOT_PREL.
3591         * elfarm-nabi.c (elf32_arm_howto_table): Add R_ARM_PREL31 and
3592         R_ARM_GOT_TARGET2.
3593         (elf32_arm_got_prel): New variable.
3594         (elf32_arm_howto_from_type): New function.
3595         (elf32_arm_info_to_howto): Use it.
3596         (elf32_arm_reloc_map): Add BFD_RELOC_ARM_PREL31 and
3597         BFD_RELOC_ARM_TARGET2.
3598         * libbfd.h: Regenerate.
3599         * reloc.c: Add BFD_RELOC_ARM_TARGET2 and BFD_RELOC_ARM_PREL31.
3600
3601 2004-09-17  Alan Modra  <amodra@bigpond.net.au>
3602
3603         * ecoff.c: Update u.undef.next refs.
3604         * elf64-ppc.c: Likewise.
3605         * elflink.c: Likewise.
3606         * linker.c: Likewise.
3607         * xcofflink.c: Likewise.
3608
3609         * elf-bfd.h (struct elf_link_hash_entry): Rearrange.  Add FIXME to
3610         dynamic_def.  Combine weakdef and elf_hash_value.  Move vtable
3611         fields to indirect struct.
3612         * elf-m10300.c: Update u.weakdef refs.
3613         * elf32-arm.h: Likewise.
3614         * elf32-cris.c: Likewise.
3615         * elf32-frv.c: Likewise.
3616         * elf32-hppa.c: Likewise.
3617         * elf32-i370.c: Likewise.
3618         * elf32-i386.c: Likewise.
3619         * elf32-m32r.c: Likewise.
3620         * elf32-m68k.c: Likewise.
3621         * elf32-ppc.c: Likewise.
3622         * elf32-s390.c: Likewise.
3623         * elf32-sh.c: Likewise.
3624         * elf32-sparc.c: Likewise.
3625         * elf32-vax.c: Likewise.
3626         * elf32-xtensa.c: Likewise.
3627         * elf64-alpha.c: Likewise.
3628         * elf64-hppa.c: Likewise.
3629         * elf64-ppc.c: Likewise.
3630         * elf64-s390.c: Likewise.
3631         * elf64-sh64.c: Likewise.
3632         * elf64-sparc.c: Likewise.
3633         * elf64-x86-64.c: Likewise.
3634         * elfxx-ia64.c: Likewise.
3635         * elfxx-mips.c: Likewise.
3636         * elflink.c: Likewise.  Also u.elf_hash_value.
3637         (elf_gc_propagate_vtable_entries_used): Update for h->vtable
3638         indirection.
3639         (elf_gc_smash_unused_vtentry_relocs): Likewise.
3640         (bfd_elf_gc_record_vtinherit): Alloc vtable.
3641         (bfd_elf_gc_record_vtentry): Likewise.
3642         * elf.c (_bfd_elf_link_hash_newfunc): Use memset.
3643
3644 2004-09-17  Alan Modra  <amodra@bigpond.net.au>
3645
3646         * Makefile.am: Run "make dep-am".
3647         * Makefile.in: Regenerate.
3648         * bfd-in2.h: Regenerate.
3649         * po/SRC-POTFILES.in: Regenerate.
3650         * po/bfd.pot: Regenerate.
3651
3652 2004-09-16  Alan Modra  <amodra@bigpond.net.au>
3653
3654         * elf-bfd.h (struct elf_link_hash_entry): Replace elf_link_hash_flags
3655         with bitfields.  Make "type" and "other" bitfields too.
3656         (ELF_LINK_HASH_REF_REGULAR, ELF_LINK_HASH_DEF_REGULAR,
3657         ELF_LINK_HASH_REF_DYNAMIC, ELF_LINK_HASH_DEF_DYNAMIC,
3658         ELF_LINK_HASH_REF_REGULAR_NONWEAK, ELF_LINK_HASH_DYNAMIC_ADJUSTED,
3659         ELF_LINK_HASH_NEEDS_COPY, ELF_LINK_HASH_NEEDS_PLT, ELF_LINK_NON_ELF,
3660         ELF_LINK_HIDDEN, ELF_LINK_FORCED_LOCAL, ELF_LINK_HASH_MARK,
3661         ELF_LINK_NON_GOT_REF, ELF_LINK_DYNAMIC_DEF, ELF_LINK_DYNAMIC_WEAK,
3662         ELF_LINK_POINTER_EQUALITY_NEEDED): Delete.
3663         (ELF_COMMON_DEF_P, WILL_CALL_FINISH_DYNAMIC_SYMBOL): Update.
3664         * elf-hppa.h: Update all uses of elf_link_hash_flags.
3665         * elf-m10300.c: Likewise.
3666         * elf.c: Likewise.
3667         * elf32-arm.h: Likewise.
3668         * elf32-cris.c: Likewise.
3669         * elf32-frv.c: Likewise.
3670         * elf32-hppa.c: Likewise.
3671         * elf32-i370.c: Likewise.
3672         * elf32-i386.c: Likewise.
3673         * elf32-m32r.c: Likewise.
3674         * elf32-m68k.c: Likewise.
3675         * elf32-ppc.c: Likewise.
3676         * elf32-s390.c: Likewise.
3677         * elf32-sh-symbian.c: Likewise.
3678         * elf32-sh.c: Likewise.
3679         * elf32-sh64.c: Likewise.
3680         * elf32-sparc.c: Likewise.
3681         * elf32-vax.c: Likewise.
3682         * elf32-xtensa.c: Likewise.
3683         * elf64-alpha.c: Likewise.
3684         * elf64-hppa.c: Likewise.
3685         * elf64-ppc.c: Likewise.
3686         * elf64-s390.c: Likewise.
3687         * elf64-sh64.c: Likewise.
3688         * elf64-sparc.c: Likewise.
3689         * elf64-x86-64.c: Likewise.
3690         * elflink.c: Likewise.
3691         * elfxx-ia64.c: Likewise.
3692         * elfxx-mips.c: Likewise.
3693         * configure.in (AM_INIT_AUTOMAKE): Set version to 2.15.92.
3694         * configure: Regenerate.
3695         * aclocal.m4: Regenerate.
3696
3697 2004-09-16  Alan Modra  <amodra@bigpond.net.au>
3698
3699         * elf32-arm.h (elf32_arm_gc_sweep_hook): Add #ifndef OLD_ARM_ABI
3700         around uses of R_ARM_TARGET1.
3701         (elf32_arm_check_relocs): Likewise.
3702
3703 2004-09-13  Paul Brook  <paul@codesourcery.com>
3704
3705         * bfd-in.h (bfd_elf32_arm_process_before_allocation): Update
3706         prototype.
3707         * bfd-in2.h: Regenerate.
3708         * libbfd.h: Regenerate.
3709         * elf32-arm.h (elf32_arm_link_hash_table): Add target1_is_rel.
3710         (elf32_arm_link_hash_table_create): Set target1_is_rel.
3711         (bfd_elf32_arm_process_before_allocation): Ditto.
3712         (elf32_arm_final_link_relocate): Handle R_ARM_TARGET1.
3713         (elf32_arm_gc_sweep_hook, elf32_arm_check_relocs): Ditto.
3714         * elfarm-nabi.c (elf32_arm_howto_table): Rename RELABS to TARGET1.
3715         * reloc.c: Ditto.
3716
3717 2004-09-10  Joel Brobecker  <brobecker@gnat.com>
3718
3719         * hpux-core.c (thread_section_p): New function.
3720         (hpux_core_core_file_p): Fix computation of offset in call
3721         to bfd_seek. Create a ".reg" section from an arbitrary
3722         ".reg/<id>" section if none was created after having read
3723         all sections.
3724
3725 2004-09-11  Andreas Schwab  <schwab@suse.de>
3726
3727         * acinclude.m4: Fix spelling of ACX_NONCANONICAL_*.
3728         * aclocal.m4: Rebuild.
3729         * configure: Rebuild.
3730
3731 2004-09-10  Joel Brobecker  <brobecker@gnat.com>
3732
3733         * section.c (bfd_sections_find_if): Fix parameter name in
3734         comment to match code.
3735
3736 2004-09-10  Alan Modra  <amodra@bigpond.net.au>
3737
3738         * elf.c  (assign_file_positions_except_relocs): Assign relocs
3739         stored in a bfd section.
3740
3741 2004-09-08  Hans-Peter Nilsson  <hp@axis.com>
3742
3743         * elf32-cris.c (elf_cris_adjust_gotplt_to_got): Reset
3744         h->gotplt_refcount to 0, not -1.
3745
3746 2004-09-07  Hans-Peter Nilsson  <hp@axis.com>
3747
3748         * elf32-cris.c (cris_elf_relocate_section) <case R_CRIS_16_GOTPLT,
3749         case R_CRIS_32_GOTPLT>: For internal error message, handle NULL
3750         symname.
3751         (cris_elf_check_relocs) <case R_CRIS_32_PLT_PCREL>: Don't try to
3752         handle symbol visibility here.
3753
3754 2004-09-07  Alan Modra  <amodra@bigpond.net.au>
3755
3756         * elf64-ppc.c (struct ppc_link_hash_table): Add stub_globals.
3757         (is_ppc64_elf_target): Rename from is_ppc64_target.  Update all
3758         callers.
3759         (ppc_stub_name): Remove trailing "+0" on stub name.
3760         (create_linkage_sections): Create relocations for
3761         branch lookup table when --emit-relocs as well as when --shared.
3762         (ppc_build_one_stub): Emit relocs for long branch stubs.  Adjust
3763         relbrlt test.  For --emit-stub-syms, always output a sym even when
3764         one already exists on a plt call stub.  Put stub type in the stub
3765         symbol name.
3766         (ppc_size_one_stub): Size long branch stub relocs.  Adjust relbrlt
3767         test.
3768         (ppc64_elf_size_stubs): Count global sym stubs added.  Zero
3769         reloc_count in stub sections.  Adjust relbrlt test.
3770         (ppc64_elf_build_stubs): Adjust relbrlt test.  Tweak stats output.
3771         * elflink.c (bfd_elf_size_dynamic_sections): Fix comment typo.
3772         (elf_link_input_bfd): Ignore symbol index zero relocs when checking
3773         for relocs against discarded symbols.  Fix comments.
3774
3775 2004-09-06  Mark Mitchell  <mark@codesourcery.com>
3776
3777         * elf-bfd.h (_bfd_elf_make_dynamic_segment): Declare it.
3778         * elf.c (_bfd_elf_make_dynamic_segment): New function, split out
3779         from ...
3780         (map_sections_to_segments): ... here.  Use it.  Assign a file
3781         position to the .dynamic section if it is not loadable, but part
3782         of the PT_DYNAMIC segment.
3783         * elf32-arm.h (elf32_arm_finish_dynamic_sections): Use file
3784         offsets, not VMAs, for the BPABI.  Do not fill in the header in
3785         the .got.plt section for the BPABI.
3786         * elfarm-nabi.c (elf32_arm_symbian_modify_segment_map): Add a
3787         PT_DYNAMIC segment.
3788         (elf_backend_want_got_plt): Define to zero for Symbian OS.
3789
3790 2004-09-06  Nick Clifton  <nickc@redhat.com>
3791
3792         * elflink.c (elf_link_add_object_symbols): Set the error code to
3793         bfd_error_wrong_format when the input format does not match the
3794         output format.
3795
3796 2004-09-06  Alan Modra  <amodra@bigpond.net.au>
3797
3798         * elf64-ppc.c (is_ppc64_target): New function, extracted from..
3799         (ppc64_elf_check_directives): ..here.
3800         (ppc64_elf_size_dynamic_sections): Use it here to check bfd type
3801         before accessing ppc64_elf_tdata.
3802         (ppc64_elf_finish_dynamic_sections): And here too.
3803
3804 2004-09-04  Alan Modra  <amodra@bigpond.net.au>
3805
3806         * bfd.c (_bfd_default_error_handler): Correct loop exit.
3807
3808 2004-09-03  Mark Mitchell  <mark@codesourcery.com>
3809
3810         * config.bfd (arm*-*-symbianelf*): Use OS-specific target vectors.
3811         * configure.in (bfd_elf32_bigarm_symbian_vec): Add it.
3812         (bfd_elf32_littlearm_symbian_vec): Likewise.
3813         * configure: Regenerated.
3814         * elf-bfd.h (elf_backend_data): Add dynamic_sec_flags.
3815         * elf32-arm.h (PLT_HEADER_SIZE): Do not define.
3816         (PLT_ENTRY_SIZE): Likewise.
3817         (bfd_vma_elf32_arm_symbian_plt_entry): New
3818         variable.
3819         (elf32_arm_link_hash_table): Add plt_header_size, plt_entry_size,
3820         and symbian_p.
3821         (create_got_section): Don't create sections when generating BPABI
3822         objects.
3823         (elf32_arm_create_dynamic_sections): Tidy.
3824         (elf32_arm_link_hash_table_create): Set plt_header_size,
3825         plt_entry_size, and symbian_p.
3826         (elf32_arm_check_relocs): Do not mark .rel.dyn as loadable when
3827         generating BPABI objects.
3828         (allocate_dynrelocs): Use htab->plt_header_size, not
3829         PLT_HEADER_SIZE.  Do not add to .got.plt when
3830         generating BPABI objects.
3831         (elf32_arm_finish_dynamic_symbol): Generate Symbian OS PLTs.
3832         * elfarm-nabi.c: Add SymbianOS target vectors.
3833         * elflink.c (_bfd_elf_create_got_section): Use dynamic_sec_flags.
3834         (_bfd_elf_link_create_dynamic_sections): Likewise.
3835         * elfxx-target.h (ELF_DYNAMIC_SEC_FLAGS): New macro.
3836         (elfNN_bed): Use it.
3837         * targets.c (bfd_elf32_bigarm_symbian_vec): New variable.
3838         (bfd_elf32_littlearm_symbian_vec): Likewise.
3839         (_bfd_target_vector): Add them.
3840
3841 2004-09-03  Nick Clifton  <nickc@redhat.com>
3842
3843         PR 360
3844         * coffcode.h (handle_COMDAT): Replace abort with an warning
3845         message and allow the scan to continue.
3846
3847 2004-09-02  Alan Modra  <amodra@bigpond.net.au>
3848
3849         * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Use static_syms passed
3850         in when reading relocs, not our sorted syms.  Remove unnecessary
3851         var.
3852
3853 2004-08-31  Eric Botcazou  <ebotcazou@libertysurf.fr>
3854
3855         * elf.c (special_sections): Add .gnu.linkonce.b modelled on .bss.
3856
3857 2004-08-30  Nathanael Nerode  <neroden@gcc.gnu.org>
3858
3859         * acinclude.m4: Require AC_CANONICAL_TARGET, not AC_CANONICAL_SYSTEM.
3860         Include ../config/acx.m4 and use ACX_NONCANONICAL_* where appropriate;
3861         replace uses of *_alias with *_noncanonical.
3862         * aclocal.m4: Rebuild with aclocal 1.4p6.
3863         * Makefile.in: Rebuild with automake 1.4p6.
3864         * doc/Makefile.in: Rebuild with automake 1.4p6.
3865         * configure.in: Autoupdate with autoupdate 2.59.
3866         * config.in: Regenerate with autoheader 2.59.
3867         * configure: Regnerate with autoconf 2.59.
3868
3869 2004-08-28  Alan Modra  <amodra@bigpond.net.au>
3870
3871         * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Copy input
3872         symbol pointer arrays before modifying.
3873
3874 2004-08-28  Alan Modra  <amodra@bigpond.net.au>
3875
3876         * bfd.c (bfd_get_synthetic_symtab): Pass counts and both symbol tables.
3877         * elf-bfd.h (_bfd_elf_get_synthetic_symtab): Adjust.
3878         * elf.c (_bfd_elf_get_synthetic_symtab): Adjust.
3879         * libbfd-in.h (_bfd_nodynamic_get_synthetic_symtab): Adjust.
3880         * targets.c (struct bfd_target <_bfd_get_synthetic_symtab>): Adjust.
3881         * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Don't read symbols.
3882         Use both symbol tables on non-relocatable objects.  Use a common
3883         error exit.  Fix "mid" warning.
3884         * libbfd.h: Regenerate.
3885         * bfd-in2.h: Regenerate.
3886
3887 2004-08-28  Alan Modra  <amodra@bigpond.net.au>
3888
3889         * elf64-ppc.c (ppc64_elf_branch_reloc): Check .opd is in a regular
3890         object file.
3891         (struct sfpr_def_parms): Save some space.
3892         (sfpr_define): Here too.
3893
3894         * elf64-ppc.c (compare_symbols): Put section syms first.
3895         (sym_exists_at): New function.
3896         (ppc64_elf_get_synthetic_symtab): Use relocs to find code entry
3897         points only for relocatable files.  Use .opd section contents
3898         otherwise.  Generally clean up the code.
3899
3900 2004-08-27  Alan Modra  <amodra@bigpond.net.au>
3901
3902         * elf64-ppc.c (STD_R0_0R1, STD_R0_0R12, LD_R0_0R1, LD_R0_0R12,
3903         LI_R12_0, STVX_VR0_R12_R0, LVX_VR0_R12_R0, MTLR_R0, SFPR_MAX): Define.
3904         (struct sfpr_def_parms): New.
3905         (sfpr_define): New function.
3906         (savegpr0, savegpr0_tail, restgpr0, restgpr0_tail): New functions.
3907         (savegpr1, savegpr1_tail, restgpr1, restgpr1_tail): New functions.
3908         (savefpr, savefpr0_tail, restfpr, restfpr0_tail): New functions.
3909         (savefpr1_tail, restfpr1_tail): New functions.
3910         (savevr, savevr_tail, restvr, restvr_tail): New functions.
3911         (MIN_SAVE_FPR, MAX_SAVE_FPR): Don't define.
3912         (ppc64_elf_func_desc_adjust): Use sfpr_define in place of existing
3913         code.  Define all ABI mandated _save and _rest functions.
3914
3915 2004-08-26  Paul Brook  <paul@codesourcery.com>
3916
3917         * elf32-arm.h (INTERWORK_FLAG): Return true for EABIv3 objects.
3918
3919 2004-08-26  Alan Modra  <amodra@bigpond.net.au>
3920
3921         * elf32-m32r.c (m32r_elf_relocate_section): Don't compare with
3922         TRUE or FALSE.
3923
3924 2004-08-26  Alan Modra  <amodra@bigpond.net.au>
3925
3926         * elf32-i386.c (elf_i386_relocate_section): Tweak last change so
3927         that pcrel correction is applied for R_386_PC32.
3928
3929 2004-08-25  Alan Modra  <amodra@bigpond.net.au>
3930
3931         * elf32-i386.c (elf_i386_relocate_section): Zero section contents
3932         for R_386_32 and R_386_PC32 relocs against symbols defined in
3933         discarded sections.
3934
3935 2004-08-25  Dmitry Diky  <diwil@spec.ru>
3936
3937         * reloc.c (BFD_RELOC_MSP430_2X_PCREL,BFD_RELOC_MSP430_RL_PCREL):
3938         Add new relocations.
3939         * bfd-in2.h: Regenerate.
3940         * libbfd.h: Regenerate.
3941         * elf32-msp430.c: Clean-up code.
3942         (elf_msp430_howto_table): Add new relocation entries.
3943         (bfd_elf32_bfd_reloc_type_lookup): New relocation handlers.
3944         (msp430_elf_relax_section): New function.
3945         (msp430_elf_relax_delete_bytes): New function.
3946         (msp430_elf_symbol_address_p): New function.
3947
3948 2004-08-24  Kazuhiro Inaoka  <inaoka.kazuhiro@renesas.com>
3949
3950         * elf32-m32r.c (m32r_elf_relocate_section): Handle
3951         R_M32R_SDA16_RELA in the same way as R_M32R_SDA16.
3952
3953 2004-08-20  Daniel Jacobowitz  <dan@debian.org>
3954
3955         * elflink.c (_bfd_elf_section_already_linked): Handle
3956         SEC_LINK_DUPLICATES_SAME_CONTENTS.
3957
3958 2004-08-19  Mark Mitchell  <mark@codesourcery.com>
3959
3960         * config.bfd (arm*-*-symbianelf*): New target.
3961         (arm*-*-eabi*): Likewise.
3962
3963 2004-08-19  Alan Modra  <amodra@bigpond.net.au>
3964
3965         * elf64-ppc.c (ppc_get_stub_entry): Change third param to a
3966         "struct ppc_link_hash_entry *".
3967         (ppc64_elf_relocate_section): Ditto for type of h.  Introduce h_elf
3968         to satisfy RELOC_FOR_GLOBAL_SYMBOL.
3969
3970 2004-08-19  Jakub Jelinek  <jakub@redhat.com>
3971
3972         * elf64-ppc.c (ppc64_elf_edit_opd): Support 16 byte long .opd
3973         entries (where fd_aux overlaps next entry's fd_func).
3974         Add non_overlapping argument, use it.
3975         (ppc64_elf_check_relocs, ppc64_elf_gc_mark_hook, adjust_opd_syms,
3976         ppc64_elf_size_stubs, ppc64_elf_relocate_section,
3977         ppc64_elf_output_symbol_hook): Use address / 8 instead of address / 24
3978         as indexes into opd_sym_map/opd_adjust array.
3979         * elf64-ppc.h (ppc64_elf_edit_opd): Adjust prototype.
3980
3981 2004-08-18  Alan Modra  <amodra@bigpond.net.au>
3982
3983         * elf64-ppc.c (func_desc_adjust): Give undefined dot-symbols a value
3984         if we can look up their function descriptor in a regular file.
3985
3986 2004-08-18  Nick Clifton  <nickc@redhat.com>
3987
3988         PR 324
3989         * cofflink.c (coff_link_add_symbols): Check that the comdat
3990         pointer in the coff_section_data structure has been initialised
3991         before using it.
3992
3993 2004-08-18  Alan Modra  <amodra@bigpond.net.au>
3994
3995         PR 338
3996         * elflink.c (bfd_elf_record_link_assignment): Add comment about
3997         changing bfd_link_hash_undefined to bfd_link_hash_new.
3998
3999 2004-08-17  Jakub Jelinek  <jakub@redhat.com>
4000
4001         * elfxx-target.h (bfd_elfNN_get_synthetic_symtab): Only define
4002         if not yet defined.
4003         * elf64-ppc.c (bfd_elf64_get_synthetic_symtab): Define.
4004         (synthetic_opd, synthetic_relocatable): New variables.
4005         (compare_symbols, compare_relocs): New helper routines.
4006         (ppc64_elf_get_synthetic_symtab): New function.
4007         * bfd.c (bfd_get_synthetic_symtab): Rename dynsyms argument
4008         to relsyms.
4009         * bfd-in2.h: Regenerated.
4010         * elf.c (_bfd_elf_get_synthetic_symtab): Rename dynsyms argument
4011         to relsyms.  Return 0 if abfd is relocatable.
4012
4013 2004-08-17  Alan Modra  <amodra@bigpond.net.au>
4014
4015         * elflink.h (elf_gc_sweep): Keep non-alloc, non-load sections.
4016
4017 2004-08-17  Nick Clifton  <nickc@redhat.com>
4018
4019         * (is_arm_mapping_symbol_name): New function - return true
4020         when a symbol name matches the requirements for an ARM mapping
4021         symbol name.
4022         (arm_elf_find_function): New function based on
4023         elf_find_function in elf.c but skipping ARM mapping symbols
4024         and including thumb function symbols.
4025         (elf32_arm_find_nearest_line): Use arm_elf_find_function.
4026         (elf32_arm_output_symbol_hook): Use is_arm_mapping_symbol_name.
4027
4028 2004-08-17  Alan Modra  <amodra@bigpond.net.au>
4029
4030         * elf64-ppc.c (ppc64_elf_branch_reloc): New function.
4031         (ppc64_elf_howto_raw): Use ppc64_elf_branch_reloc.
4032         (ppc64_elf_brtaken_reloc): Here too.
4033
4034 2004-08-17  Alan Modra  <amodra@bigpond.net.au>
4035
4036         * elf64-ppc.c (add_symbol_adjust): Correct mismatched function
4037         symbol visibility.
4038         (ppc64_elf_check_directives): Check that we have the right hash
4039         table before proceeding.
4040
4041 2004-08-17  Alan Modra  <amodra@bigpond.net.au>
4042
4043         * elf64-ppc.c (struct ppc64_elf_obj_tdata): Add "deleted_section".
4044         (adjust_opd_syms): Attach opd syms for deleted entries to one of
4045         the sections that will be discarded.
4046
4047 2004-08-16  Alan Modra  <amodra@bigpond.net.au>
4048
4049         * elflink.c (elf_section_complain_discarded): Ignore .fixup.
4050
4051 2004-08-16  Alan Modra  <amodra@bigpond.net.au>
4052
4053         * bfd.c (_bfd_default_error_handler): Account for doubled '%' in
4054         free space available.
4055
4056 2004-08-16  Alan Modra  <amodra@bigpond.net.au>
4057
4058         * pdp11.c (struct pdp11_aout_reloc_external): Delete.  Replace
4059         occurrences with bfd_byte * thoughout file.
4060
4061         * coff-rs6000.c (do_shared_object_padding): Warning fix.
4062         (xcoff_write_armap_big): Likewise.
4063         (xcoff_write_archive_contents_old): Likewise.
4064         (xcoff_write_archive_contents_big): Likewise.
4065
4066         * elf64-mmix.c (mmix_elf_get_section_contents): Delete declaration.
4067
4068 2004-08-13  Nick Clifton  <nickc@redhat.com>
4069
4070         * elf32-arm.h: Convert to ISO C90.
4071
4072 2004-08-13  Alan Modra  <amodra@bigpond.net.au>
4073
4074         PR 293
4075         * elf32-hppa.c (elf32_hppa_hide_symbol): Use init_refcount to
4076         zero the plt field.
4077
4078 2004-08-13  Alan Modra  <amodra@bigpond.net.au>
4079
4080         * bfd.c (_bfd_default_error_handler): Handle %A and %B.
4081         (bfd_archive_filename, bfd_get_section_ident): Delete.
4082         * ecofflink.c (bfd_ecoff_debug_accumulate_other): Don't call
4083         bfd_archive_filename.
4084         * elflink.c (elf_link_input_bfd): Don't use callbacks->error_handler
4085         to warn about symbols in discarded sections.  Use _bfd_error_handler.
4086         * aout-adobe.c (aout_adobe_callback): See below.
4087         * aout-cris.c (swap_ext_reloc_in): ..
4088         * coff-arm.c (find_thumb_glue, find_arm_glue,
4089         coff_arm_relocate_section, bfd_arm_process_before_allocation,
4090         coff_arm_merge_private_bfd_data, _bfd_coff_arm_set_private_flags,
4091         coff_arm_copy_private_bfd_data): ..
4092         * coff-i860.c (i860_reloc_processing): ..
4093         * coff-mcore.c (mcore_coff_unsupported_reloc,
4094         coff_mcore_relocate_section): ..
4095         * coff-ppc.c (coff_ppc_relocate_section): ..
4096         * coff-rs6000.c (xcoff_create_csect_from_smclas
4097         * coff-sh.c (sh_relax_section, sh_relax_delete_bytes,
4098         sh_swap_insns, sh_relocate_section): ..
4099         * coff-tic54x.c (tic54x_reloc_processing): ..
4100         * coff-tic80.c (coff_tic80_relocate_section): ..
4101         * coff64-rs6000.c (xcoff64_create_csect_from_smclas): ..
4102         * coffcode.h (styp_to_sec_flags, coff_slurp_line_table,
4103         coff_slurp_symbol_table, coff_classify_symbol,
4104         coff_slurp_reloc_table): ..
4105         * coffgen.c (_bfd_coff_read_string_table): ..
4106         * cofflink.c (coff_link_add_symbols, _bfd_coff_link_input_bfd,
4107         _bfd_coff_generic_relocate_section): ..
4108         * cpu-arm.c (bfd_arm_merge_machines): ..
4109         * cpu-sh.c (sh_merge_bfd_arch): ..
4110         * elf-hppa.h (elf_hppa_relocate_section): ..
4111         * elf.c (bfd_elf_string_from_elf_section, setup_group,
4112         _bfd_elf_setup_group_pointers, bfd_section_from_shdr,
4113         assign_section_numbers, _bfd_elf_symbol_from_bfd_symbol,
4114         copy_private_bfd_data, _bfd_elf_validate_reloc): ..
4115         * elf32-arm.h (find_thumb_glue, find_arm_glue,
4116         bfd_elf32_arm_process_before_allocation, elf32_thumb_to_arm_stub,
4117         elf32_arm_to_thumb_stub, elf32_arm_final_link_relocate,
4118         elf32_arm_relocate_section, elf32_arm_set_private_flags,
4119         elf32_arm_copy_private_bfd_data, elf32_arm_merge_private_bfd_data): ..
4120         * elf32-cris.c (cris_elf_relocate_section, cris_elf_check_relocs,
4121         cris_elf_merge_private_bfd_data
4122         * elf32-frv.c (elf32_frv_relocate_section, elf32_frv_check_relocs): ..
4123         * elf32-gen.c (elf32_generic_link_add_symbols): ..
4124         * elf32-hppa.c (hppa_add_stub, hppa_build_one_stub,
4125         elf32_hppa_check_relocs, get_local_syms, final_link_relocate,
4126         elf32_hppa_relocate_section): ..
4127         * elf32-i370.c (i370_elf_merge_private_bfd_data,
4128         i370_elf_check_relocs, i370_elf_relocate_section): ..
4129         * elf32-i386.c (elf_i386_info_to_howto_rel, elf_i386_check_relocs,
4130         elf_i386_relocate_section): ..
4131         * elf32-m32r.c (m32r_elf_relocate_section,
4132         m32r_elf_merge_private_bfd_data): ..
4133         * elf32-m68hc1x.c (m68hc12_add_stub,
4134         _bfd_m68hc11_elf_merge_private_bfd_data): ..
4135         * elf32-m68k.c (elf_m68k_relocate_section): ..
4136         * elf32-mcore.c (mcore_elf_unsupported_reloc,
4137         mcore_elf_relocate_section): ..
4138         * elf32-ppc.c (ppc_elf_merge_private_bfd_data, bad_shared_reloc,
4139         ppc_elf_check_relocs, ppc_elf_relocate_section,
4140         ppc_elf_begin_write_processing): ..
4141         * elf32-s390.c (elf_s390_check_relocs, invalid_tls_insn,
4142         elf_s390_relocate_section): ..
4143         * elf32-sh-symbian.c (sh_symbian_import_as,
4144         sh_symbian_process_embedded_commands,
4145         sh_symbian_relocate_section): ..
4146         * elf32-sh.c (sh_elf_relax_section, sh_elf_relax_delete_bytes,
4147         sh_elf_swap_insns, sh_elf_relocate_section, sh_elf_check_relocs,
4148         sh_elf_merge_private_data): ..
4149         * elf32-sparc.c (elf32_sparc_check_relocs,
4150         elf32_sparc_relocate_section,
4151         elf32_sparc_merge_private_bfd_data): ..
4152         * elf32-v850.c (v850_elf_check_relocs,
4153         v850_elf_merge_private_bfd_data): ..
4154         * elf32-xtensa.c (elf_xtensa_check_relocs,
4155         elf_xtensa_relocate_section, elf_xtensa_merge_private_bfd_data): ..
4156         * elf64-alpha.c (elf64_alpha_relax_with_lituse,
4157         elf64_alpha_relax_got_load, elf64_alpha_size_got_sections,
4158         elf64_alpha_relocate_section_r, elf64_alpha_relocate_section): ..
4159         * elf64-gen.c (elf64_generic_link_add_symbols): ..
4160         * elf64-ppc.c (ppc64_elf_merge_private_bfd_data, ppc_add_stub,
4161         ppc64_elf_check_relocs, ppc64_elf_edit_opd,
4162         ppc64_elf_relocate_section): ..
4163         * elf64-s390.c (elf_s390_check_relocs, invalid_tls_insn,
4164         elf_s390_relocate_section): ..
4165         * elf64-sh64.c (sh_elf64_relocate_section): ..
4166         * elf64-sparc.c (sparc64_elf_check_relocs,
4167         sparc64_elf_add_symbol_hook, sparc64_elf_relocate_section,
4168         sparc64_elf_merge_private_bfd_data): ..
4169         * elf64-x86-64.c (elf64_x86_64_check_relocs,
4170         elf64_x86_64_relocate_section): ..
4171         * elflink.c (_bfd_elf_add_default_symbol,
4172         _bfd_elf_link_assign_sym_version, elf_link_read_relocs_from_section,
4173         _bfd_elf_link_output_relocs, elf_link_add_object_symbols,
4174         bfd_elf_size_dynamic_sections, elf_link_output_extsym,
4175         elf_get_linked_section_vma, elf_fixup_link_order,
4176         bfd_elf_final_link, bfd_elf_gc_record_vtinherit,
4177         bfd_elf_gc_record_vtinherit, _bfd_elf_section_already_linked): ..
4178         * elfxx-ia64.c (elfNN_ia64_relax_section,
4179         elfNN_ia64_relocate_section, elfNN_ia64_merge_private_bfd_data): ..
4180         * elfxx-mips.c (mips_elf_perform_relocation,
4181         _bfd_mips_elf_check_relocs,
4182         _bfd_mips_elf_merge_private_bfd_data): ..
4183         * ieee.c (ieee_slurp_external_symbols): ..
4184         * ihex.c (ihex_bad_byte, ihex_scan, ihex_read_section): ..
4185         * libbfd.c (_bfd_generic_verify_endian_match): ..
4186         * linker.c (_bfd_generic_link_add_one_symbol,
4187         _bfd_generic_section_already_linked): ..
4188         * pdp11.c (translate_to_native_sym_flags): ..
4189         * pe-mips.c (coff_pe_mips_relocate_section): ..
4190         * peicode.h (pe_ILF_build_a_bfd): ..
4191         * srec.c (srec_bad_byte): ..
4192         * stabs.c (_bfd_link_section_stabs): ..
4193         * xcofflink.c (xcoff_link_add_symbols, xcoff_link_input_bfd): ..
4194         Replace all uses of bfd_archive_filename and bfd_get_section_ident
4195         with corresponding %B and %A in _bfd_error_handler format string.
4196         Replace occurrences of "fprintf (stderr," with _bfd_error_handler
4197         calls to use %A and %B.  Fix "against symbol .. from section" and
4198         similar error messages.  Combine multiple _bfd_error_handler calls
4199         where they were separated due to bfd_archive_filename deficiencies.
4200         * bfd-in2.h: Regenerate.
4201
4202 2004-08-12  H.J. Lu  <hongjiu.lu@intel.com>
4203
4204         * elf32-i386.c (elf_i386_relocate_section): Report unrecognized
4205         relocation.
4206
4207 2004-08-10  Alan Modra  <amodra@bigpond.net.au>
4208
4209         * elf64-ppc.c (struct ppc_link_hash_entry): Add was_undefined.
4210         (struct ppc_link_hash_table): Remove no_multi_toc, multi_toc_needed.
4211         Make emit_stub_syms, stub_error and has_14bit_branch bit-fields.
4212         Add twiddled_syms.
4213         (link_hash_newfunc): Init was_undefined.
4214         (add_symbol_adjust): Don't set undefined dot symbols to defweak;
4215         Use undefweak instead.
4216         (ppc64_elf_check_directives): Fix undefs chain.
4217         (ppc64_elf_next_toc_section): Remove no_multi_toc and multi_toc_needed
4218         references.
4219         (ppc64_elf_size_stubs): Adjust for add_symbol_adjust change.
4220         (undo_symbol_twiddle, ppc64_elf_restore_symbols): New functions.
4221         * elf64-ppc.h (ppc64_elf_restore_symbols): Declare.
4222
4223 2004-08-09  Jakub Jelinek  <jakub@redhat.com>
4224
4225         * elf64-x86-64.c (elf64_x86_64_relocate_section): For -fno-pic
4226         error, test input_section flags rather than sec.
4227
4228 2004-08-09  Alan Modra  <amodra@bigpond.net.au>
4229
4230         * elf-bfd.h (struct elf_backend_data): Add
4231         elf_backend_archive_symbol_lookup.
4232         (_bfd_elf_archive_symbol_lookup): Declare.
4233         * elflink.c (_bfd_elf_archive_symbol_lookup): New function..
4234         (elf_link_add_archive_symbols): ..extracted from here.  Call the
4235         backend version.
4236         * elfxx-target.h (elf_backend_archive_symbol_lookup): Provide default.
4237         (elfNN_bed): Init new field.
4238         * elf64-ppc.c (elf_backend_check_directives): Define.
4239         (elf_backend_archive_symbol_lookup): Define.
4240         (struct ppc_link_hash_table): Add tls_get_add_fd.  Make tls_get_add
4241         a ppc_link_hash_entry pointer.
4242         (get_fdh): Move.
4243         (ppc64_elf_archive_symbol_lookup, opd_entry_value): New functions.
4244         (add_symbol_adjust, ppc64_elf_check_directives): New functions.
4245         (ppc64_elf_check_relocs, ppc64_elf_gc_mark_hook, func_desc_adjust,
4246         ppc64_elf_adjust_dynamic_symbol, ppc64_elf_tls_setup,
4247         ppc64_elf_tls_optimize, allocate_dynrelocs, ppc_type_of_stub,
4248         ppc_build_one_stub, ppc64_elf_size_stubs, ppc64_elf_relocate_section,
4249         ppc64_elf_finish_dynamic_symbol): Handle branch relocs to function
4250         descriptor symbols.
4251
4252 2004-08-09  Alan Modra  <amodra@bigpond.net.au>
4253
4254         * elf64-ppc.c (struct ppc_link_hash_entry): Expand adjust_done comment.
4255         (ppc64_elf_add_symbol_hook): Test for NULL section.
4256         (get_sym_h): Formatting.
4257         (ppc64_elf_size_stubs): Include reloc addend in value stored as
4258         stub target_value.
4259
4260         * elf64-ppc.c (ppc64_elf_relocate_section): Combine handling of
4261         long branch stubs with code handling plt and r2off branch stubs.
4262
4263 2004-08-09  Alan Modra  <amodra@bigpond.net.au>
4264
4265         * elf-bfd.h (_bfd_elf_gc_mark): Declare.
4266         * elflink.c (elf_link_input_bfd): Formatting.
4267         (_bfd_elf_gc_mark): Rename from elf_gc_mark and make global.  Adjust
4268         all callers.
4269         * elf64-ppc.c (struct ppc_link_hash_entry): Remove is_entry.
4270         (link_hash_newfunc): Don't set it.
4271         (ppc64_elf_copy_indirect_symbol): Nor copy it.
4272         (ppc64_elf_mark_entry_syms): Delete.
4273         (ppc64_elf_gc_mark_hook): Mark entry syms here.  Also mark opd
4274         sections.  Use get_opd_info.
4275         * elf64-ppc.h (ppc64_elf_mark_entry_syms): Delete.
4276
4277 2004-08-09  Alan Modra  <amodra@bigpond.net.au>
4278
4279         * elf64-ppc.c (adjust_opd_syms): Fix merge error.
4280
4281         * elf64-ppc.c (struct ppc_link_hash_table): Remove have_undefweak.
4282         (func_desc_adjust): Don't set have_undefweak.
4283         (ppc64_elf_func_desc_adjust): Don't add an extr nop to sfpr.
4284         (ppc64_elf_relocate_section): NOP out calls to undefweak functions.
4285
4286         * elf64-ppc.c (struct ppc_link_hash_entry): Make "oh" a
4287         "struct ppc_link_hash_entry *".  Adjust all references.
4288         (ppc64_elf_hide_symbol): Correct a comment.
4289
4290         * elf64-ppc.c (get_opd_info): New function.
4291         (adjust_opd_syms): Use get_opd_info.  Define removed symbols as zero.
4292         (ppc64_elf_edit_opd): Use get_opd_info.  Check that sym has a dot
4293         before calling get_fdh.  Test fdh rather than h before dereferencing
4294         fdh.  Mark removed symbols in opd_adjust.
4295         (ppc64_elf_tls_optimize): Don't bother with opd adjustment here.
4296         (ppc64_elf_relocate_section): Use get_opd_info, and handle removed
4297         opd symbols.
4298         (ppc64_elf_output_symbol_hook): Likewise.
4299
4300 2004-08-06  Paul Brook  <paul@codesourcery.com>
4301
4302         * elfarm-nabi.c (elf32_arm_howto_table): Add new EABI relocations.
4303         (elf32_arm_reloc_map): Add BFD_RELOC_ARM_RELABS32,
4304         BFD_RELOC_ARM_ROSEGREL32 and BFD_RELOC_ARM_SBREL32.
4305         * reloc.c: Add BFD_RELOC_ARM_RELABS32, BFD_RELOC_ARM_ROSEGREL32
4306         and BFD_RELOC_ARM_SBREL32.
4307         * bfd-in2.h, bbfd.h: Regenerate.
4308
4309 2004-08-01  Thiemo Seufer  <seufer@csv.ica.uni-stuttgart.de>
4310
4311         * elfxx-mips.c (mips_elf_calculate_relocation): Test only for
4312         the dynamic link symbol actually in use.
4313
4314 2004-08-01  Stephane Carrez  <stcarrez@nerim.fr>
4315
4316         * elf32-m68hc1x.c (elf32_m68hc11_size_stubs): Handle bfd_link_hash_new
4317
4318 2004-07-31  Joel Brobecker  <brobecker@gnat.com>
4319             Thiemo Seufer  <seufer@csv.ica.uni-stuttgart.de>
4320
4321         * elfxx-mips.c (_bfd_mips_elf_symbol_processing): Handle
4322         SHN_MIPS_TEXT and SHN_MIPS_DATA.
4323
4324 2004-07-30  H.J. Lu  <hongjiu.lu@intel.com>
4325             Nick Clifton  <nickc@redhat.com>
4326
4327         PR 290
4328         * bfd.c (_bfd_default_error_handler): Make it global.
4329
4330         * elf-bfd.h (elf_backend_data): Add link_order_error_handler.
4331
4332         * elf.c (assign_section_numbers): Cope gracefully with sections
4333         which have SHF_LINK_ORDER set but no sh_link set up.
4334         * elflink.c (elf_get_linked_section_vma): Likewise.
4335
4336         * elfxx-ia64.c (elf_backend_link_order_error_handler): New. Set
4337         it to NULL.
4338
4339         * elfxx-target.h (elf_backend_link_order_error_handler): New.
4340         Set it to _bfd_default_error_handler.
4341         (elfNN_bed): Add elf_backend_link_order_error_handler.
4342
4343         * libbfd-in.h (_bfd_default_error_handler): New.
4344
4345         * libbfd.h: Regenerated.
4346
4347 2004-07-30  Jakub Jelinek  <jakub@redhat.com>
4348
4349         * archures.c (bfd_mach_sparc_64bit_p): Define.
4350         * elf32-sparc.c (elf32_sparc_merge_private_bfd_data): Use it.
4351         * bfd-in2.h: Rebuilt.
4352
4353 2004-07-29  Alexandre Oliva  <aoliva@redhat.com>
4354
4355         Introduce SH2a support.
4356         2004-02-18  Corinna Vinschen  <vinschen@redhat.com>
4357         * archures.c (bfd_mach_sh2a_nofpu): New.
4358         * bfd-in2.h: Rebuilt.
4359         * cpu-sh.c (SH2A_NOFPU_NEXT): New.
4360         (arch_info_struct): Add sh2a_nofpu.
4361         * elf32-sh.c (sh_elf_set_mach_from_flags): Handle sh2a_nofpu.
4362         2003-12-29  DJ Delorie  <dj@redhat.com>
4363         * reloc.c: Add relocs for sh2a.
4364         * bfd-in2.h: Regenerate.
4365         * libbfd.hh: Regenerate.
4366         2003-12-01  Michael Snyder  <msnyder@redhat.com>
4367         * archures.c (bfd_mach_sh2a): New.
4368         * bfd-in2.h: Rebuilt.
4369         * cpu-sh.c (SH_NEXT, SH2_NEXT, etc.): Change defines to enums.
4370         (SH2A_NEXT): New.
4371         (arch_info_struct): Add sh2a.
4372         * elf32-sh.c (sh_elf_set_mach_from_flags): Handle sh2a.
4373
4374 2004-07-28  Nick Clifton  <nickc@redhat.com>
4375             John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
4376
4377         PR 273
4378         * som.c (setup_sections): Improve estimation of space sizes in
4379         relocatable objects.
4380
4381 2004-07-27  Jason Thorpe  <thorpej@wasabisystems.com>
4382         * config.bfd (hppa*-*-netbsd*): Set targ_defvec to
4383         bfd_elf32_hppa_nbsd_vec.  Add bfd_elf32_hppa_linux_vec
4384         to targ_selvecs.
4385         * configure.in (bfd_elf32_hppa_nbsd_vec): Add case.
4386         * configure: Regenerate.
4387         * elf32-hppa.c (elf32_hppa_object_p): Add "elf32-hppa-netbsd"
4388         case that accepts OSABI=NetBSD and OSABI=SysV.
4389         (elf32_hppa_set_gp): For "elf32-hppa-netbsd", set the GP to
4390         the base of .got or .data (if .got does not exist).
4391         (elf32_hppa_post_process_headers): For elf32-hppa-netbsd,
4392         set OSABI=NetBSD.
4393         (TARGET_BIG_SYM): Add bfd_elf32_hppa_nbsd_vec case.
4394         (TARGET_BIG_NAME): Add "elf32-hppa-netbsd" case.
4395         * targets.c (bfd_elf32_hppa_nbsd_vec): Add extern declaration.
4396         (_bfd_target_vector): Add bfd_elf32_hppa_nbsd_vec.
4397
4398 2004-07-27  H.J. Lu  <hongjiu.lu@intel.com>
4399
4400         PR 161/251
4401         * elf-bfd.h (bfd_elf_section_data): Add sec_group.
4402         (elf_sec_group): Defined.
4403         (bfd_elf_match_symbols_in_sections): New prototype.
4404         (_bfd_elf_setup_group_pointers): Likewise.
4405
4406         * elf.c (bfd_elf_discard_group): Abort.
4407         (bfd_elf_set_group_contents): Also include relocation sections.
4408         Remove zero-fill for ld -r.
4409         (_bfd_elf_setup_group_pointers): New function.
4410         (elf_sort_elf_symbol): Likewise.
4411         (elf_sym_name_compare): Likewise.
4412         (bfd_elf_match_symbols_in_sections): Likewise.
4413
4414         * elfcode.h (elf_object_p): Call _bfd_elf_setup_group_pointers.
4415
4416         * elflink.c (match_group_member): New.
4417         (elf_link_input_bfd): Check group member for discarded section.
4418         (try_match_symbols_in_sections): New function.
4419         (already_linked): Likewise.
4420         (_bfd_elf_section_already_linked): Support mixing comdat group
4421         and linkonce section.
4422
4423         * libbfd-in.h (bfd_section_already_linked_table_traverse): New.
4424         * linker.c (bfd_section_already_linked_table_traverse): New.
4425
4426         * libbfd.h: Regenerated.
4427
4428 2004-07-27  Tomer Levi  <Tomer.Levi@nsc.com>
4429
4430         * reloc.c: Add BFD_RELOC_CRX_SWITCH8, BFD_RELOC_CRX_SWITCH16,
4431         BFD_RELOC_CRX_SWITCH32.
4432         * bfd-in2.h: Regenerate.
4433         * libbfd.h: Regenerate.
4434         * elf32-crx.c: Support relocation/relaxation of
4435         BFD_RELOC_CRX_SWITCH* types.
4436
4437 2004-07-27  Alan Modra  <amodra@bigpond.net.au>
4438
4439         * elf64-ppc.c: Correct "Linker stubs" comment.
4440
4441 2004-07-26  H.J. Lu  <hongjiu.lu@intel.com>
4442
4443         * elf-bfd.h (bfd_elf_section_data): Add a pointer for the
4444         linked-to section.
4445         (elf_linked_to_section): New.
4446
4447         * elf.c (assign_section_numbers): Set up sh_link for
4448         SHF_LINK_ORDER.
4449
4450         * elfxx-ia64.c (elfNN_ia64_final_write_processing): Set sh_info
4451         to sh_link for SHT_IA_64_UNWIND sections.
4452
4453 2004-07-22  H.J. Lu  <hongjiu.lu@intel.com>
4454
4455         * elflink.c (elf_fixup_link_order): Add _() to error message.
4456
4457 2004-07-22  H.J. Lu  <hongjiu.lu@intel.com>
4458
4459         * elflink.c (elf_fixup_link_order): Issue a warning and flag
4460         an error if failed.
4461
4462 2004-07-21  H.J. Lu  <hongjiu.lu@intel.com>
4463
4464         * aout-adobe.c (aout_32_section_already_linked): Defined.
4465         * aout-target.h (MY_section_already_linked): Likewise.
4466         * aout-tic30.c (MY_section_already_linked): Likewise.
4467         * binary.c (binary_section_already_linked): Likewise.
4468         * bout.c (b_out_section_already_linked): Likewise.
4469         * coff-alpha.c (_bfd_ecoff_section_already_linked): Likewise.
4470         * coff-mips.c (_bfd_ecoff_section_already_linked): Likewise.
4471         * coffcode.h (coff_section_already_linked): Likewise.
4472         * i386msdos.c (msdos_section_already_linked): Likewise.
4473         * i386os9k.c (os9k_section_already_linked): Likewise.
4474         * ieee.c (ieee_section_already_linked): Likewise.
4475         * ihex.c (ihex_section_already_linked): Likewise.
4476         * mach-o.c (bfd_mach_o_section_already_linked): Likewise.
4477         * mmo.c (mmo_section_already_linked): Likewise.
4478         * nlm-target.h (nlm_section_already_linked): Likewise.
4479         * oasys.c (oasys_section_already_linked): Likewise.
4480         * pef.c (bfd_pef_section_already_linked): Likewise.
4481         * ppcboot.c (ppcboot_section_already_linked): Likewise.
4482         * som.c (som_bfd_discard_group): Likewise.
4483         * srec.c (srec_section_already_linked): Likewise.
4484         * tekhex.c (tekhex_section_already_linked): Likewise.
4485         * versados.c (versados_section_already_linked): Likewise.
4486         * vms.c (vms_section_already_linked): Likewise.
4487         * coff-target.h (_bfd_xcoff_section_already_linked): Likewise.
4488         * xsym.c (bfd_sym_section_already_linked): Likewise.
4489
4490         * bfd-in.h (bfd_section_already_linked_table_init): New.
4491         (bfd_section_already_linked_table_free): Likewise.
4492
4493         * coff-rs6000.c (rs6000coff_vec): Add
4494         _bfd_generic_section_already_linked.
4495         (pmac_xcoff_vec): Likewise.
4496         * coff64-rs6000.c (rs6000coff64_vec): Likewise.
4497         (aix5coff64_vec): Likewise.
4498
4499         * elf-bfd.h (_bfd_elf_section_already_linked): New prototype.
4500         * elflink.c (_bfd_elf_section_already_linked): New function.
4501
4502         * elfxx-target.h (bfd_elfNN_section_already_linked): Defined.
4503
4504         * libbfd-in.h (_bfd_nolink_section_already_linked): Defined.
4505         (_bfd_generic_section_already_linked): New.
4506         (bfd_section_already_linked_hash_entry): Likewise.
4507         (bfd_section_already_linked): Likewise.
4508         (bfd_section_already_linked_table_lookup): Likewise.
4509         (bfd_section_already_linked_table_insert): Likewise.
4510
4511         * linker.c (bfd_section_already_linked): New.
4512         (_bfd_section_already_linked_table): Likewise.
4513         (bfd_section_already_linked_table_lookup): Likewise.
4514         (bfd_section_already_linked_table_insert): Likewise.
4515         (already_linked_newfunc): Likewise.
4516         (bfd_section_already_linked_table_init): Likewise.
4517         (bfd_section_already_linked_table_free): Likewise.
4518         (_bfd_generic_section_already_linked): Likewise.
4519
4520         * section.c (bfd_section): Remove comdat.
4521         (bfd_comdat_info): Moved to ...
4522         * bfd-in.h (coff_comdat_info): Here.
4523         (bfd_coff_get_comdat_section): New.
4524         * coffgen.c (bfd_coff_get_comdat_section): Likewise.
4525         * libcoff-in.h (coff_section_tdata): Add comdat.
4526         * coffcode.h (handle_COMDAT): Updated.
4527         * cofflink.c (coff_link_add_symbols): Likewise.
4528         * ecoff.c (bfd_debug_section): Likewise.
4529
4530         * targets.c (bfd_target): Add _section_already_linked.
4531         (BFD_JUMP_TABLE_LINK): Updated.
4532
4533         * bfd-in2.h: Regenerated.
4534         * libbfd.h: Likewise.
4535         * libcoff.h: Likewise.
4536
4537 2003-07-21  Paul Brook  <paul@codesourcery.com>
4538
4539         * elflink.c (elf_get_linked_section_vma, compare_link_order,
4540         elf_fixup_link_order): New functions.
4541         (bfd_elf_final_link): Call elf_fixup_link_order.
4542
4543 2004-07-21  Alexandre Oliva  <aoliva@redhat.com>
4544
4545         * elf-bfd.h (ELF_COMMON_DEF_P): New.
4546         * elflink.c (_bfd_elf_symbol_refs_local_p): Use it to handle
4547         common definitions.
4548         * elf-m10300.c: Use SYMBOL_REFERENCES_LOCAL instead of
4549         _bfd_elf_symbol_refs_local_p.
4550         * elf32-frv.c (FRVFDPIC_SYM_LOCAL): Remove hack for common
4551         symbols.
4552
4553 2004-07-19  H.J. Lu  <hongjiu.lu@intel.com>
4554
4555         * bfd-in.h (dynamic_lib_link_class): Add DYN_NO_ADD_NEEDED and
4556         DYN_NO_NEEDED.
4557         (bfd_elf_get_dyn_lib_class): New prototype.
4558         * elf.c (bfd_elf_get_dyn_lib_class): New function.
4559
4560         * elflink.c (elf_link_add_object_symbols): Check DYN_AS_NEEDED,
4561         DYN_DT_NEEDED and DYN_NO_NEEDED bits to see if a DT_NEEDED
4562         entry is needed. Issue an error if a DT_NEEDED entry is needed
4563         for a file marked DYN_NO_NEEDED.
4564         (elf_link_check_versioned_symbol): Check the DYN_DT_NEEDED bit
4565         for DT_NEEDED tags.
4566
4567         * bfd-in2.h: Regenerated.
4568
4569 2004-07-14  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
4570
4571         * elflink.c (elf_section_complain_discarded): Don't complain in
4572         .PARISC.unwind.
4573
4574 2004-07-10  James E Wilson  <wilson@specifixinc.com>
4575
4576         * elfxx-ia64.c (elfNN_ia64_relax_ldxmov): Remove abfd parameter.
4577         (elfNN_ia64_install_value, elfNN_ia64_relax_brl): Likewise.
4578         (elfNN_ia64_relax_section, elfNN_ia64_relocate_section,
4579         elfNN_ia64_finish_dynamic_symbol, elfNN_ia64_finish_dynamic_sections):
4580         Fix callers.
4581         (elfNN_ia64_relax_brl): Change bfd_get_64 to bfd_getl64.  Change
4582         bfd_put_64 to bfd_putl64.
4583         (elfNN_ia64_relax_ldxmov, elfNN_ia64_install_value): Likewise.
4584
4585 2004-07-09  H.J. Lu  <hongjiu.lu@intel.com>
4586
4587         PR 240
4588         * elfxx-ia64.c (elfNN_ia64_relax_section): Only warn br in
4589         .init/.fini sections when trying to relax it.
4590
4591 2004-07-09  Jie Zhang  <zhangjie@magima.com.cn>
4592
4593         * elf.c (assign_file_positions_for_segments): Make sure the
4594         .dynamic section is the first section in the PT_DYNAMIC segment.
4595
4596 2004-07-09  Nick Clifton  <nickc@redhat.com>
4597
4598         * config.bfd: Change sh-sybmian-elf to sh-*-symbianelf.
4599         * elf32-sh-symbian.c: Rename the sh_find_elf_flags and
4600         sh_elf_get_flags_from_mach functions so that they do not conflict
4601         when this target is built with other sh-elf targets.
4602         * elf32-sh.c (sh_elf_get_flags_from_mach): Remove bogus
4603         suppression of this function.
4604         (sh_elf_find_flags): Likewise.
4605
4606 2004-07-07  Tomer Levi  <Tomer.Levi@nsc.com>
4607
4608         * Makefile.am (ALL_MACHINES): Add cpu-crx.lo.
4609         (ALL_MACHINES_CFILES): Add cpu-crx.c.
4610         (BFD32_BACKENDS): Add elf32-crx.lo.
4611         (BFD32_BACKENDS_CFILES): Add elf32-crx.c.
4612         (cpu-crx.lo): New target.
4613         (elf32-crx.lo): New target.
4614         * Makefile.in: Regenerate.
4615         * archures.c (bfd_architecture): Add bfd_{arch,mach}_crx.
4616         (bfd_archures_list): Add bfd_crx_arch.
4617         * bfd-in2.h: Regenerate.
4618         * config.bfd: Handle crx-*-elf*, crx*.
4619         * configure.in: Handle bfd_elf32_crx_vec.
4620         * configure: Regenerate.
4621         * cpu-crx.c: New file.
4622         * elf32-crx.c: Likewise.
4623         * libbfd.h: Regenerate.
4624         * reloc.c: Add BFD_RELOC_CRX_REL4, BFD_RELOC_CRX_REL8,
4625         BFD_RELOC_CRX_REL8_CMP, BFD_RELOC_CRX_REL16, BFD_RELOC_CRX_REL24,
4626         BFD_RELOC_CRX_REL32, BFD_RELOC_CRX_REGREL12, BFD_RELOC_CRX_REGREL22,
4627         BFD_RELOC_CRX_REGREL28, BFD_RELOC_CRX_REGREL32, BFD_RELOC_CRX_ABS16,
4628         BFD_RELOC_CRX_ABS32, BFD_RELOC_CRX_NUM8, BFD_RELOC_CRX_NUM16,
4629         BFD_RELOC_CRX_NUM32, BFD_RELOC_CRX_IMM16 and BFD_RELOC_CRX_IMM32
4630         * targets.c (bfd_elf32_crx_vec): Declare.
4631         (bfd_target_vector): Add bfd_elf32_crx_vec.
4632
4633 2004-07-06  Nick Clifton  <nickc@redhat.com>
4634
4635         * config.bfd: Add sh-symbian-elf target.
4636         * configure.in: Add bfd_elf32_shl_symbian_vec.
4637         * configure: Regenerate.
4638         * elf-bfd.h (struct elf_backend_data): Add new field
4639         'check_directives'.
4640         * elflink.c (elf_link_add_object_symbols): Invoke the
4641         check_directives function, if defined.
4642         * elfxx-target.h: Provide a default, NULL definition for
4643         check_directives.
4644         * targets.c: Add bfd_elf32_shl_symbian_vec.
4645         * elf32-sh.c (sh_elf_swap_insns): Protect against unnecessary
4646         definition.
4647         (elf32_shlin_grok_prstatus, elf32_shlib_grok_psinfo,
4648         * sh_elf_get_flags_from_mach, sh_elf_find_flags): Likewise.
4649         (TARGET_BIG_SYM, TARGET_LITTLE_SYM): Only define if they have
4650         not already been defined.
4651         * elf32-sh64.c: Use SH_TARGET_ALREADY_DEFINED.
4652         * sh-symbian.c: New file.  Provide functions to support the
4653         * sh-symbian-elf target.
4654         * Makefile.am: Add elf32-sh-symbian.c
4655         * Makefile.in: Regenerate.
4656
4657 2004-07-05  Andrew Stubbs <andrew.stubbs@superh.com>
4658
4659         * elf32-sh.c: Include ../opcodes/sh-opc.h.
4660         * Makefile.am: Ran make dep-am.
4661         * Makefile.in: Ran make dep-in.
4662
4663 2004-07-03  Aaron W. LaFramboise  <aaron98wiridge9@aaronwl.com>
4664
4665         * cofflink.c (_bfd_coff_generic_relocate_section): Resolve PE weak
4666         externals properly.
4667
4668 2004-07-02  Martin Schwidefsky  <schwidefsky@de.ibm.com>
4669
4670         * config.bfd: Add want64 to configuration target s390-*-linux*.
4671
4672 2004-07-01  H.J. Lu  <hongjiu.lu@intel.com>
4673
4674         * bfd.c (bfd_get_section_ident): New.
4675
4676         * elflink.c (elf_link_read_relocs_from_section): Call
4677         bfd_get_section_ident to identify the section when reporting
4678         error.
4679         (_bfd_elf_link_output_relocs): Likewise.
4680         (elf_link_output_extsym): Likewise.
4681         (elf_link_input_bfd): Likewise.
4682         (bfd_elf_gc_record_vtinherit): Likewise.
4683
4684         * bfd-in2.h: Regenerated.
4685
4686 2004-07-01  Jie Zhang  <zhangjie@magima.com.cn>
4687             Nick Clifton  <nickc@redhat.com>
4688
4689         PR 204
4690         * elfxx-mips.c (_bfd_mips_elf_final_link): Pass the correct number
4691         of section symbols to mips_elf_sort_hash_table ().
4692
4693 2004-07-01  Alan Modra  <amodra@bigpond.net.au>
4694
4695         * elflink.c (elf_section_ignore_discarded_relocs): Revert last
4696         change.  Comment.
4697         (elf_section_complain_discarded): New function.  Handle
4698         .gcc_except_table too.
4699         (elf_link_input_bfd): Rewrite handling of relocs against symbols
4700         in discarded sections.
4701         * elf-bfd.h (elf_discarded_section): Protect macro arg.
4702
4703 2004-06-30  James E Wilson  <wilson@specifixinc.com>
4704
4705         * elfxx-ia64.c (elfNN_ia64_check_relocs): New local pltoff.  Initialize
4706         to NULL.  Call get_pltoff if NULL and NEED_PLTOFF is true.
4707
4708 2004-06-30  H.J. Lu  <hongjiu.lu@intel.com>
4709
4710         PR 233
4711         * elflink.c (elf_link_input_bfd): Issue an error for non-debug
4712         local references to discarded sections and report their
4713         locations.
4714
4715 2004-06-30  Alan Modra  <amodra@bigpond.net.au>
4716
4717         * elflink.c (elf_section_ignore_discarded_relocs): Don't test
4718         sec_info_type, test section name instead.
4719
4720 2004-06-29  H.J. Lu  <hongjiu.lu@intel.com>
4721
4722         PR 240
4723         * elfxx-ia64.c (elfNN_ia64_relax_section): Don't relax branch
4724         in .init/.fini sections.
4725
4726 2004-06-29  Bob Wilson  <bob.wilson@acm.org>
4727
4728         * elf32-xtensa.c (elf_xtensa_relocate_section): Use
4729         bfd_get_section_limit.
4730
4731 2004-06-29  Bob Wilson  <bob.wilson@acm.org>
4732
4733         * elf32-xtensa.c (elf_xtensa_combine_prop_entries): Don't change the
4734         output section size.
4735
4736 2004-06-29  Alan Modra  <amodra@bigpond.net.au>
4737
4738         * elf64-mmix.c (mmix_set_relaxable_size): Save original size in
4739         rawsize.
4740         (mmix_elf_perform_relocation): Adjust for above change.
4741         (mmix_elf_relocate_section): Likewise.
4742         (mmix_elf_relax_section): Likewise.  Use output_section->rawsize.
4743         (mmix_elf_get_section_contents): Delete.
4744         (bfd_elf64_get_section_contents): Delete.
4745         (mmix_elf_relocate_section): Zero stub area.
4746         * linker.c (default_indirect_link_order): Alloc max of section size
4747         and rawsize.
4748         * simple.c (bfd_simple_get_relocated_section_contents): Likewise.
4749         * section.c (bfd_malloc_and_get_section): Likewise.
4750         (struct bfd_section): Update rawsize comment.
4751         * bfd-in2.h: Regenerate.
4752
4753         * reloc16.c (bfd_coff_reloc16_relax_section): Set rawsize.
4754
4755 2004-06-29  Alan Modra  <amodra@bigpond.net.au>
4756
4757         * bfd-in.h (bfd_get_section_limit): Define.
4758         * reloc.c (bfd_perform_relocation, bfd_install_relocation)
4759         (_bfd_final_link_relocate): Use bfd_get_section_limit.
4760         * aout-tic30.c (tic30_aout_final_link_relocate): Likewise.
4761         * coff-arm.c (coff_arm_relocate_section): Likewise.
4762         * coff-mips.c (mips_refhi_reloc, mips_gprel_reloc): Likewise.
4763         * cpu-ns32k.c (do_ns32k_reloc): Likewise.
4764         (bfd_ns32k_final_link_relocate): Likewise.
4765         * elf32-d30v.c (bfd_elf_d30v_reloc, bfd_elf_d30v_reloc_21): Likwise.
4766         * elf32-dlx.c (_bfd_dlx_elf_hi16_reloc): Likewise.
4767         * elf32-i860.c (i860_howto_pc26_reloc, i860_howto_pc16_reloc)
4768         (i860_howto_highadj_reloc, i860_howto_splitn_reloc): Likewise.
4769         * elf32-m32r.c (m32r_elf_do_10_pcrel_reloc, m32r_elf_hi16_reloc)
4770         (m32r_elf_generic_reloc, m32r_elf_relocate_section): Likewise.
4771         * elf32-m68hc1x.c (m68hc11_elf_special_reloc): Likewise.
4772         * elf32-mips.c (gprel32_with_gp, mips16_gprel_reloc): Likewise.
4773         * elf32-or32.c (or32_elf_consth_reloc): Likewise.
4774         * elf32-ppc.c (ppc_elf_addr16_ha_reloc): Likewise.
4775         * elf32-s390.c (s390_elf_ldisp_reloc): Likewise.
4776         * elf32-sh.c (sh_elf_reloc_loop): Likewise.
4777         * elf32-sparc.c (sparc_elf_wdisp16_reloc): Likewise.
4778         (sparc_elf_hix22_reloc, sparc_elf_lox10_reloc): Likwise.
4779         * elf32-v850.c (v850_elf_reloc): Likewise.
4780         * elf32-xstormy16.c (xstormy16_elf_24_reloc): Likewise.
4781         * elf32-xtensa.c (bfd_elf_xtensa_reloc): Likewise.
4782         * elf64-alpha.c (elf64_alpha_reloc_gpdisp): Likewise.
4783         * elf64-mips.c (mips_elf64_gprel32_reloc)
4784         (mips16_gprel_reloc): Likewise.
4785         * elf64-mmix.c (mmix_elf_reloc): Likewise.
4786         * elf64-s390.c (s390_elf_ldisp_reloc): Likewise.
4787         * elf64-sparc.c (init_insn_reloc): Likewise.
4788         * elfn32-mips.c (gprel32_with_gp, mips16_gprel_reloc): Likewise.
4789         * elfxx-mips.c (_bfd_mips_elf_gprel16_with_gp)
4790         (_bfd_mips_elf_hi16_reloc, _bfd_mips_elf_lo16_reloc)
4791         (_bfd_mips_elf_generic_reloc): Likewise.
4792         * bfd-in2.h: Regenerate.
4793
4794 2004-06-28  Alan Modra  <amodra@bigpond.net.au>
4795
4796         * bfd-in.h (struct stab_info): Move from stabs.c.
4797         * stabs.c (struct stab_link_includes_table): Delete.
4798         (stab_link_includes_lookup): Delete.
4799         (_bfd_write_section_stabs, _bfd_write_stab_strings): Remove one
4800         level of indirection from sinfo parm.
4801         (_bfd_link_section_stabs): Likewise.  Set SEC_LINKER_CREATED on
4802         stabstr section.  Adjust hash table accesses.
4803         * coff-ppc.c (ppc_bfd_coff_final_link): Do include rawsize in contents
4804         alloc.  Adjust stab_info test.
4805         * cofflink.c (_bfd_coff_link_hash_table_init): Clear stab_info.
4806         (_bfd_coff_final_link): Adjust stab_info test.
4807         (_bfd_coff_link_input_bfd): Ignore SEC_LINKER_CREATED sections.
4808         * elf-bfd.h (struct elf_link_hash_table): Include struct stab_info
4809         in place.
4810         * libcoff-in.h (struct coff_link_hash_table): Likewise.
4811         * elf.c (_bfd_elf_link_hash_table_init): Clear stab_info.
4812         * elflink.c (bfd_elf_final_link): Don't attempt to link linker created
4813         stabstr section.  Adjust stab_info test.
4814         * libbfd-in.h (_bfd_link_section_stabs, _bfd_write_section_stabs)
4815         (_bfd_write_stab_strings): Adjust prototypes.
4816         * libbfd.h: Regenerate.
4817         * libcoff.h: Regenerate.
4818         * bfd-in2.h: Regenerate.
4819
4820 2004-06-27  Mark Kettenis  <kettenis@gnu.org>
4821
4822         From Miod Vallat <miod@online.fr>:
4823         * aoutx.h (NAME(aout,machine_type)): Handle bfd_arch_m88k.
4824
4825 2004-06-26  Alexandre Oliva  <aoliva@redhat.com>
4826
4827         * elf-m10300.c (struct elf_mn10300_pcrel_relocs_copied): Delete.
4828         (struct elf32_mn10300_link_hash_entry): Remove
4829         pcrel_relocs_copied.
4830         (mn10300_elf_check_relocs): Only reserve dynamic relocations for
4831         R_MN10300_32.  Don't adjust pcrel_relocs_copied.
4832         (mn10300_elf_final_link_relocate): Fail for direct, pc-relative
4833         and gotoff relocations if the symbol doesn't bind locally.  Use
4834         _bfd_elf_symbol_refs_local_p to test.  Don't create dynamic
4835         relocation for PCREL32.
4836         (mn10300_elf_relocate_section): Use _bfd_elf_symbol_refs_local_p
4837         to test whether a symbol binds locally.
4838         (elf32_mn10300_link_hash_newfunc): Don't initialize
4839         pcrel_relocs_copied.
4840         (_bfd_mn10300_elf_discard_copies): Delete.
4841         (_bfd_mn10300_elf_size_dynamic_sections): Don't call it.
4842
4843 2004-06-26  Mark Kettenis  <kettenis@gnu.org>
4844
4845         * config.bfd: Replace m88k-*-openbsd* with m88*-*-openbsd*.
4846
4847 2004-06-25  Joel Brobecker  <brobecker@gnat.com>
4848
4849         * som.c (som_set_reloc_info): Correct small typo.
4850
4851 2004-06-25  Kazuhiro Inaoka  <inaoka.kazuhiro@renesas.com>
4852
4853         * elf32-m32r.c (m32r_elf_howto_table): Support R_M32R_GOTOFF.
4854         (m32r_elf_relocate_section): Changed for R_M32R_GOTOFF.
4855         (m32r_elf_gcsweep_hook): Likewise.
4856         (m32r_elf_check_relocs): Likewise.
4857         (m32r_elf_howto_table): Added R_M32R_GOTOFF_HI_ULO,
4858         R_M32R_GOTOFF_HI_SLO and R_M32R_GOTOFF_LO.
4859         * reloc.c: Added BFD_RELOC_M32R_GOTOFF_HI_ULO,
4860         BFD_RELOC_M32R_GOTOFF_HI_SLO and BFD_RELOC_M32R_GOTOFF_LO.
4861         * bfd-in2.h: Regenerated.
4862         * libbfd.h: Regenerated.
4863
4864 2004-06-24  H.J. Lu  <hongjiu.lu@intel.com>
4865
4866         * elf64-x86-64.c (elf64_x86_64_check_relocs): Warn overflow
4867         relocation symbol.
4868         (elf64_x86_64_relocate_section): Issue an error for
4869         R_X86_64_PC8, R_X86_64_PC16 and R_X86_64_PC32 relocations
4870         against global symbols when building shared library.
4871
4872 2004-06-24  Alan Modra  <amodra@bigpond.net.au>
4873
4874         * section.c (struct sec): Rename "_cooked_size" to "size".
4875         Rename "_raw_size" to "rawsize".
4876         (STD_SECTION): Adjust comments.
4877         (bfd_set_section_size, bfd_get_section_contents): Use size.
4878         (bfd_malloc_and_get_section): New function.
4879         * bfd-in.h (bfd_section_size, bfd_get_section_size): Use size.
4880         * coff-sh.c (sh_relax_section): Alloc coff_section_data struct early.
4881         Correctly free reloc and contents memory.
4882         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Delete FIXME
4883         and fake CIE now that we can shink section size to zero.
4884         (_bfd_elf_write_section_eh_frame): Likewise..
4885         * elf32-ppc.c (ppc_elf_relax_section): Delay reading section contents.
4886         * elf-m10300.c (mn10300_elf_final_link_relocate): Don't use
4887         _bfd_stab_section_offset.  Use _bfd_elf_section_offset.
4888         * stabs.c (_bfd_stab_section_offset_): Remove unused args and
4889         unneeded indirection.
4890         * elf.c (_bfd_elf_section_offset): .. and update call.
4891         * libbfd-in.h (_bfd_stab_section_offset): Update prototype.
4892         * libbfd.h: Regenerate.
4893         * bfd-in2.h: Regenerate.
4894
4895         Replace occurrences of "_raw_size" and "_cooked_size" in most places
4896         with "size".  Set new "rawsize" for stabs, eh_frame, and SEC_MERGE
4897         sections.  Use "rawsize", if non-zero, for bfd_get_section_contents
4898         calls if the section might be a stabs, eh_frame, or SEC_MERGE section.
4899         Similarly use "rawsize", if non-zero, in reloc functions to validate
4900         reloc addresses.  Use new bfd_malloc_and_get_section in most places
4901         where bfd_get_section_contents was called.  Expand all occurrences of
4902         bfd_section_size and bfd_get_section_size.  Rename "raw_size" var in
4903         grok_prstatus and similar functions to "size".
4904         * aix386-core.c (aix386_core_file_p): ..
4905         * aix5ppc-core.c (xcoff64_core_p): ..
4906         * aout-adobe.c (aout_adobe_callback, aout_adobe_write_object_contents,
4907         aout_adobe_set_section_contents): ..
4908         * aout-target.h (callback): ..
4909         * aout-tic30.c (tic30_aout_callback, tic30_aout_final_link_relocate,
4910         MY_bfd_final_link): ..
4911         * aoutf1.h (sunos4_core_file_p): ..
4912         * aoutx.h (some_aout_object_p, adjust_o_magic, adjust_z_magic,
4913         adjust_n_magic, adjust_sizes_and_vmas, translate_from_native_sym_flags,
4914         final_link, aout_link_input_section): ..
4915         * binary.c (binary_object_p, binary_canonicalize_symtab,
4916         binary_set_section_contents): ..
4917         * bout.c (b_out_callback, b_out_write_object_contents,
4918         b_out_set_section_contents, b_out_bfd_relax_section,
4919         b_out_bfd_get_relocated_section_contents): ..
4920         * cisco-core.c (cisco_core_file_validate): ..
4921         * coff-alpha.c (alpha_ecoff_object_p,
4922         alpha_ecoff_get_relocated_section_conten, alpha_relocate_section): ..
4923         * coff-arm.c (coff_arm_relocate_section,
4924         bfd_arm_allocate_interworking_sections): ..
4925         * coff-h8300.c (h8300_reloc16_extra_cases,
4926         h8300_bfd_link_add_symbols): ..
4927         * coff-mips.c (mips_refhi_reloc, mips_gprel_reloc): ..
4928         * coff-ppc.c (coff_ppc_relocate_section, ppc_allocate_toc_section,
4929         ppc_bfd_coff_final_link): ..
4930         * coff-rs6000.c (xcoff_reloc_type_br, xcoff_ppc_relocate_section): ..
4931         * coff-sh.c (sh_relax_section, sh_relax_delete_bytes,
4932         sh_align_loads, sh_coff_get_relocated_section_contents): ..
4933         * coff64-rs6000.c (xcoff64_write_object_contents,
4934         xcoff64_reloc_type_br, xcoff64_ppc_relocate_section): ..
4935         * coffcode.h (coff_compute_section_file_positions,
4936         coff_write_object_contents): ..
4937         * coffgen.c (make_a_section_from_file, coff_write_symbols,
4938         coff_section_symbol, build_debug_section): ..
4939         * cofflink.c (coff_link_add_symbols, _bfd_coff_final_link,
4940         process_embedded_commands, _bfd_coff_link_input_bfd,
4941         _bfd_coff_write_global_sym): ..
4942         * cpu-arm.c (bfd_arm_update_notes, bfd_arm_get_mach_from_notes): ..
4943         * cpu-ns32k.c (do_ns32k_reloc, _bfd_ns32k_final_link_relocate): ..
4944         * dwarf1.c (parse_line_table, _bfd_dwarf1_find_nearest_line): ..
4945         * dwarf2.c (read_indirect_string, read_abbrevs, decode_line_info,
4946         _bfd_dwarf2_find_nearest_line): ..
4947         * ecoff.c (bfd_debug_section, ecoff_set_symbol_info,
4948         ecoff_compute_section_file_positions,
4949         _bfd_ecoff_write_object_contents, ecoff_indirect_link_order): ..
4950         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame,
4951         _bfd_elf_discard_section_eh_frame_hdr,
4952         _bfd_elf_maybe_strip_eh_frame_hdr, _bfd_elf_eh_frame_section_offset,
4953         _bfd_elf_write_section_eh_frame,
4954         _bfd_elf_write_section_eh_frame_hdr): ..
4955         * elf-hppa.h (elf_hppa_sort_unwind): ..
4956         * elf-m10200.c (mn10200_elf_relax_section,
4957         mn10200_elf_relax_delete_bytes,
4958         mn10200_elf_get_relocated_section_contents): ..
4959         * elf-m10300.c (_bfd_mn10300_elf_create_got_section,
4960         mn10300_elf_check_relocs, mn10300_elf_relax_section,
4961         mn10300_elf_relax_delete_bytes,
4962         mn10300_elf_get_relocated_section_contents,
4963         _bfd_mn10300_elf_adjust_dynamic_symbol,
4964         _bfd_mn10300_elf_discard_copies,
4965         _bfd_mn10300_elf_size_dynamic_sections,
4966         _bfd_mn10300_elf_finish_dynamic_sections): ..
4967         * elf.c (_bfd_elf_print_private_bfd_data, bfd_elf_get_bfd_needed_list,
4968         _bfd_elf_make_section_from_phdr, elf_fake_sections,
4969         bfd_elf_set_group_contents, map_sections_to_segments,
4970         elf_sort_sections, assign_file_positions_for_segments,
4971         SECTION_SIZE, copy_private_bfd_data,
4972         _bfd_elf_get_dynamic_reloc_upper_bound,
4973         _bfd_elf_canonicalize_dynamic_reloc, elfcore_maybe_make_sect,
4974         _bfd_elfcore_make_pseudosection, elfcore_grok_prstatus,
4975         elfcore_grok_lwpstatus, elfcore_grok_win32pstatus,
4976         elfcore_grok_note, elfcore_grok_nto_status, elfcore_grok_nto_gregs,
4977         _bfd_elf_rel_local_sym, _bfd_elf_get_synthetic_symtab): ..
4978         * elf32-arm.h (bfd_elf32_arm_allocate_interworking_sect,
4979         bfd_elf32_arm_process_before_allocation,
4980         elf32_arm_adjust_dynamic_symbol, allocate_dynrelocs,
4981         elf32_arm_size_dynamic_sections, elf32_arm_finish_dynamic_sections,
4982         elf32_arm_write_section): ..
4983         * elf32-cris.c (cris_elf_grok_prstatus,
4984         elf_cris_finish_dynamic_sections, cris_elf_gc_sweep_hook,
4985         elf_cris_adjust_gotplt_to_got, elf_cris_adjust_dynamic_symbol,
4986         cris_elf_check_relocs, elf_cris_size_dynamic_sections,
4987         elf_cris_discard_excess_dso_dynamics,
4988         elf_cris_discard_excess_program_dynamics): ..
4989         * elf32-d30v.c (bfd_elf_d30v_reloc, bfd_elf_d30v_reloc_21): ..
4990         * elf32-dlx.c (_bfd_dlx_elf_hi16_reloc): ..
4991         * elf32-frv.c (_frvfdpic_add_dyn_reloc, _frvfdpic_add_rofixup,
4992         _frv_create_got_section, _frvfdpic_assign_plt_entries,
4993         elf32_frvfdpic_size_dynamic_sections,
4994         elf32_frvfdpic_modify_segment_map,
4995         elf32_frvfdpic_finish_dynamic_sections): ..
4996         * elf32-h8300.c (elf32_h8_relax_section, elf32_h8_relax_delete_bytes,
4997         elf32_h8_get_relocated_section_contents): ..
4998         * elf32-hppa.c (hppa_build_one_stub, hppa_size_one_stub,
4999         elf32_hppa_adjust_dynamic_symbol, allocate_plt_static,
5000         allocate_dynrelocs, elf32_hppa_size_dynamic_sections, group_sections,
5001         elf32_hppa_size_stubs, elf32_hppa_set_gp, elf32_hppa_build_stubs,
5002         elf32_hppa_finish_dynamic_sections): ..
5003         * elf32-i370.c (i370_elf_adjust_dynamic_symbol,
5004         i370_elf_size_dynamic_sections, i370_elf_check_relocs,
5005         i370_elf_finish_dynamic_sections): ..
5006         * elf32-i386.c (elf_i386_grok_prstatus, elf_i386_adjust_dynamic_symbol,
5007         allocate_dynrelocs, elf_i386_size_dynamic_sections,
5008         elf_i386_relocate_section, elf_i386_finish_dynamic_sections): ..
5009         * elf32-i860.c (i860_howto_pc26_reloc, i860_howto_pc16_reloc,
5010         i860_howto_highadj_reloc, i860_howto_splitn_reloc): ..
5011         * elf32-ip2k.c (ip2k_is_switch_table_128,
5012         ip2k_relax_switch_table_128, ip2k_is_switch_table_256,
5013         ip2k_relax_switch_table_256, ip2k_elf_relax_section,
5014         adjust_all_relocations, ip2k_elf_relax_delete_bytes): ..
5015         * elf32-m32r.c (m32r_elf_do_10_pcrel_reloc, m32r_elf_hi16_reloc,
5016         m32r_elf_generic_reloc, m32r_elf_adjust_dynamic_symbol,
5017         allocate_dynrelocs, m32r_elf_size_dynamic_sections,
5018         m32r_elf_relocate_section, m32r_elf_finish_dynamic_sections,
5019         m32r_elf_relax_section, m32r_elf_relax_delete_bytes,
5020         m32r_elf_get_relocated_section_contents): ..
5021         * elf32-m68hc11.c (m68hc11_elf_build_one_stub,
5022         m68hc11_elf_size_one_stub, m68hc11_elf_relax_section,
5023         m68hc11_elf_relax_delete_bytes): ..
5024         * elf32-m68hc12.c (m68hc12_elf_build_one_stub,
5025         m68hc12_elf_size_one_stub): ..
5026         * elf32-m68hc1x.c (elf32_m68hc11_size_stubs,
5027         elf32_m68hc11_build_stubs, m68hc11_elf_special_reloc): ..
5028         * elf32-m68k.c (elf_m68k_check_relocs, elf_m68k_gc_sweep_hook,
5029         elf_m68k_adjust_dynamic_symbol, elf_m68k_size_dynamic_sections,
5030         elf_m68k_discard_copies, elf_m68k_finish_dynamic_sections): ..
5031         * elf32-mips.c (gprel32_with_gp, mips16_gprel_reloc,
5032         elf32_mips_grok_prstatus): ..
5033         * elf32-or32.c (or32_elf_consth_reloc): ..
5034         * elf32-ppc.c (ppc_elf_relax_section, ppc_elf_addr16_ha_reloc,
5035         elf_create_pointer_linker_section, ppc_elf_create_linker_section,
5036         ppc_elf_additional_program_headers, ppc_elf_adjust_dynamic_symbol,
5037         allocate_dynrelocs, ppc_elf_size_dynamic_sections,
5038         ppc_elf_finish_dynamic_sections, ppc_elf_grok_prstatus,
5039         ppc_elf_final_write_processing): ..
5040         * elf32-s390.c (s390_elf_ldisp_reloc, elf_s390_adjust_dynamic_symbol,
5041         allocate_dynrelocs, elf_s390_size_dynamic_sections,
5042         elf_s390_finish_dynamic_sections, elf_s390_grok_prstatus): ..
5043         * elf32-sh.c (sh_elf_reloc_loop, sh_elf_relax_section,
5044         sh_elf_relax_delete_bytes, sh_elf_align_loads,
5045         sh_elf_adjust_dynamic_symbol, allocate_dynrelocs,
5046         sh_elf_size_dynamic_sections, sh_elf_get_relocated_section_contents,
5047         sh_elf_finish_dynamic_sections, elf32_shlin_grok_prstatus): ..
5048         * elf32-sh64-com.c (sh64_address_in_cranges,
5049         sh64_get_contents_type): ..
5050         * elf32-sh64.c (sh64_find_section_for_address,
5051         sh64_elf_final_write_processing): ..
5052         * elf32-sparc.c (sparc_elf_wdisp16_reloc, sparc_elf_hix22_reloc,
5053         sparc_elf_lox10_reloc, elf32_sparc_adjust_dynamic_symbol,
5054         allocate_dynrelocs, elf32_sparc_size_dynamic_sections,
5055         elf32_sparc_relocate_section, elf32_sparc_finish_dynamic_sections): ..
5056         * elf32-v850.c (v850_elf_reloc, v850_elf_relax_section): ..
5057         * elf32-vax.c (elf_vax_check_relocs, elf_vax_adjust_dynamic_symbol,
5058         elf_vax_size_dynamic_sections, elf_vax_discard_copies,
5059         elf_vax_instantiate_got_entries, elf_vax_relocate_section,
5060         elf_vax_finish_dynamic_sections): ..
5061         * elf32-xstormy16.c (xstormy16_elf_24_reloc,
5062         xstormy16_elf_check_relocs, xstormy16_relax_plt_check,
5063         xstormy16_elf_relax_section, xstormy16_elf_always_size_sections,
5064         xstormy16_elf_finish_dynamic_sections): ..
5065         * elf32-xtensa.c (xtensa_read_table_entries,
5066         elf_xtensa_allocate_got_size, elf_xtensa_allocate_local_got_size,
5067         elf_xtensa_size_dynamic_sections, elf_xtensa_do_reloc,
5068         bfd_elf_xtensa_reloc, elf_xtensa_relocate_section,
5069         elf_xtensa_combine_prop_entries, elf_xtensa_finish_dynamic_sections,
5070         elf_xtensa_discard_info_for_section, elf_xtensa_grok_prstatus,
5071         get_relocation_opcode, retrieve_contents, find_relaxable_sections,
5072         collect_source_relocs, is_resolvable_asm_expansion, remove_literals,
5073         relax_section, shrink_dynamic_reloc_sections, relax_property_section,
5074         xtensa_callback_required_dependence): ..
5075         * elf64-alpha.c (elf64_alpha_reloc_gpdisp, elf64_alpha_relax_section,
5076         elf64_alpha_check_relocs, elf64_alpha_adjust_dynamic_symbol,
5077         elf64_alpha_calc_got_offsets_for_symbol, elf64_alpha_calc_got_offsets,
5078         elf64_alpha_size_plt_section, elf64_alpha_size_plt_section_1,
5079         elf64_alpha_always_size_sections, elf64_alpha_calc_dynrel_sizes,
5080         elf64_alpha_size_rela_got_section, elf64_alpha_size_rela_got_1,
5081         elf64_alpha_size_dynamic_sections, elf64_alpha_emit_dynrel,
5082         elf64_alpha_finish_dynamic_sections, elf64_alpha_final_link): ..
5083         * elf64-hppa.c (allocate_dynrel_entries,
5084         elf64_hppa_size_dynamic_sections,
5085         elf64_hppa_finish_dynamic_sections): ..
5086         * elf64-mips.c (mips_elf64_gprel32_reloc, mips16_gprel_reloc,
5087         mips_elf64_canonicalize_dynamic_reloc, mips_elf64_slurp_reloc_table,
5088         elf64_mips_grok_prstatus): ..
5089         * elf64-mmix.c (mmix_elf_perform_relocation, mmix_elf_reloc,
5090         mmix_elf_relocate_section, mmix_elf_final_link,
5091         mmix_set_relaxable_size, _bfd_mmix_after_linker_allocation,
5092         mmix_elf_relax_section, mmix_elf_get_section_contents): ..
5093         * elf64-ppc.c (ppc64_elf_object_p, ppc64_elf_grok_prstatus,
5094         ppc64_elf_check_relocs, ppc64_elf_func_desc_adjust,
5095         ppc64_elf_adjust_dynamic_symbol, ppc64_elf_edit_opd,
5096         allocate_dynrelocs, ppc64_elf_size_dynamic_sections,
5097         ppc_build_one_stub, ppc_size_one_stub, ppc64_elf_next_toc_section,
5098         toc_adjusting_stub_needed, group_sections, ppc64_elf_size_stubs,
5099         ppc64_elf_build_stubs, ppc64_elf_relocate_section,
5100         ppc64_elf_finish_dynamic_sections): ..
5101         * elf64-s390.c (s390_elf_ldisp_reloc, elf_s390_adjust_dynamic_symbol,
5102         allocate_dynrelocs, elf_s390_size_dynamic_sections,
5103         elf_s390_finish_dynamic_sections): ..
5104         * elf64-sh64.c (sh_elf64_get_relocated_section_contents,
5105         sh_elf64_check_relocs, sh64_elf64_adjust_dynamic_symbol,
5106         sh64_elf64_discard_copies, sh64_elf64_size_dynamic_sections,
5107         sh64_elf64_finish_dynamic_sections): ..
5108         * elf64-sparc.c (sparc64_elf_slurp_reloc_table, init_insn_reloc,
5109         sparc64_elf_check_relocs, sparc64_elf_adjust_dynamic_symbol,
5110         sparc64_elf_size_dynamic_sections, sparc64_elf_relocate_section,
5111         sparc64_elf_finish_dynamic_symbol,
5112         sparc64_elf_finish_dynamic_sections): ..
5113         * elf64-x86-64.c (elf64_x86_64_grok_prstatus,
5114         elf64_x86_64_adjust_dynamic_symbol, allocate_dynrelocs,
5115         elf64_x86_64_size_dynamic_sections, elf64_x86_64_relocate_section,
5116         elf64_x86_64_finish_dynamic_sections): ..
5117         * elfarm-nabi.c (elf32_arm_nabi_grok_prstatus): ..
5118         * elfcode.h (elf_slurp_reloc_table): ..
5119         * elflink.c (_bfd_elf_create_got_section, elf_add_dt_needed_tag,
5120         elf_finalize_dynstr, elf_link_add_object_symbols,
5121         bfd_elf_size_dynamic_sections, elf_link_sort_relocs,
5122         elf_link_input_bfd, bfd_elf_final_link, bfd_elf_discard_info): ..
5123         * elfn32-mips.c (gprel32_with_gp, mips16_gprel_reloc,
5124         elf32_mips_grok_prstatus): ..
5125         * elfxx-ia64.c (elfNN_ia64_relax_section, allocate_dynrel_entries,
5126         elfNN_ia64_size_dynamic_sections, elfNN_ia64_install_dyn_reloc,
5127         elfNN_ia64_choose_gp, elfNN_ia64_final_link,
5128         elfNN_ia64_finish_dynamic_sections): ..
5129         * elfxx-mips.c (mips_elf_create_procedure_table,
5130         mips_elf_check_mips16_stubs, _bfd_mips_elf_gprel16_with_gp,
5131         _bfd_mips_elf_hi16_reloc, _bfd_mips_elf_generic_reloc,
5132         mips_elf_global_got_index, mips_elf_multi_got,
5133         mips_elf_create_compact_rel_section, mips_elf_calculate_relocation,
5134         mips_elf_allocate_dynamic_relocations,
5135         mips_elf_create_dynamic_relocation, _bfd_mips_elf_fake_sections,
5136         _bfd_mips_relax_section, _bfd_mips_elf_adjust_dynamic_symbol,
5137         _bfd_mips_elf_always_size_sections,
5138         _bfd_mips_elf_size_dynamic_sections,
5139         _bfd_mips_elf_finish_dynamic_symbol,
5140         _bfd_mips_elf_finish_dynamic_sections,
5141         _bfd_mips_elf_modify_segment_map, _bfd_mips_elf_discard_info,
5142         _bfd_mips_elf_write_section, _bfd_mips_elf_set_section_contents,
5143         _bfd_elf_mips_get_relocated_section_contents,
5144         _bfd_mips_elf_final_link, _bfd_mips_elf_merge_private_bfd_data): ..
5145         * hp300hpux.c (callback): ..
5146         * hppabsd-core.c (make_bfd_asection): ..
5147         * hpux-core.c (make_bfd_asection): ..
5148         * i386linux.c (linux_link_create_dynamic_sections,
5149         bfd_i386linux_size_dynamic_sections, linux_finish_dynamic_link): ..
5150         * i386msdos.c (msdos_write_object_contents): ..
5151         * i386os9k.c (os9k_callback, os9k_write_object_contents,
5152         os9k_set_section_contents): ..
5153         * ieee.c (parse_expression, ieee_slurp_external_symbols,
5154         ieee_slurp_sections, ieee_slurp_debug, ieee_slurp_section_data,
5155         ieee_write_section_part, do_with_relocs, do_as_repeat,
5156         do_without_relocs, ieee_write_debug_part, init_for_output,
5157         ieee_set_section_contents): ..
5158         * ihex.c (ihex_scan, ihex_read_section, ihex_get_section_contents): ..
5159         * irix-core.c (do_sections, make_bfd_asection): ..
5160         * libaout.h (aout_section_merge_with_text_p): ..
5161         * libbfd.c (_bfd_generic_get_section_contents,
5162         _bfd_generic_get_section_contents_in_window): ..
5163         * linker.c (default_indirect_link_order): ..
5164         * lynx-core.c (make_bfd_asection): ..
5165         * m68klinux.c (linux_link_create_dynamic_sections,
5166         bfd_m68klinux_size_dynamic_sections, linux_finish_dynamic_link): ..
5167         * mach-o.c (bfd_mach_o_make_bfd_section,
5168         bfd_mach_o_scan_read_dylinker, bfd_mach_o_scan_read_dylib,
5169         bfd_mach_o_scan_read_thread, bfd_mach_o_scan_read_symtab,
5170         bfd_mach_o_scan_read_segment): ..
5171         * merge.c (_bfd_add_merge_section, record_section, merge_strings,
5172         _bfd_merge_sections): ..
5173         * mmo.c (mmo_find_sec_w_addr, mmo_get_spec_section, mmo_get_loc,
5174         mmo_map_set_sizes, mmo_canonicalize_symtab,
5175         mmo_internal_write_section, mmo_write_object_contents): ..
5176         * netbsd-core.c (netbsd_core_file_p): ..
5177         * nlm32-alpha.c (nlm_alpha_read_reloc, nlm_alpha_write_import,
5178         nlm_alpha_set_public_section): ..
5179         * nlm32-ppc.c (nlm_powerpc_read_reloc, nlm_powerpc_write_reloc): ..
5180         * nlm32-sparc.c (nlm_sparc_write_import): ..
5181         * nlmcode.h (add_bfd_section, nlm_swap_auxiliary_headers_in,
5182         nlm_compute_section_file_positions): ..
5183         * oasys.c (oasys_object_p, oasys_slurp_section_data,
5184         oasys_write_sections, oasys_write_data, oasys_set_section_contents): ..
5185         * opncls.c (get_debug_link_info): ..
5186         * osf-core.c (make_bfd_asection): ..
5187         * pdp11.c (some_aout_object_p, adjust_o_magic, adjust_z_magic,
5188         adjust_n_magic, adjust_sizes_and_vmas, squirt_out_relocs,
5189         final_link, aout_link_input_section): ..
5190         * peXXigen.c (_bfd_XXi_swap_sym_in, _bfd_XXi_swap_aouthdr_out,
5191         pe_print_idata, pe_print_edata, pe_print_pdata, pe_print_reloc): ..
5192         * pef.c (bfd_pef_make_bfd_section, bfd_pef_print_loader_section,
5193         bfd_pef_scan_start_address, bfd_pef_parse_symbols): ..
5194         * ppcboot.c (ppcboot_object_p, ppcboot_canonicalize_symtab): ..
5195         * ptrace-core.c (ptrace_unix_core_file_p): ..
5196         * reloc.c (bfd_perform_relocation, bfd_install_relocation,
5197         _bfd_final_link_relocate, bfd_generic_relax_section,
5198         bfd_generic_get_relocated_section_contents): ..
5199         * reloc16.c (bfd_coff_reloc16_relax_section,
5200         bfd_coff_reloc16_get_relocated_section_c): ..
5201         * riscix.c (riscix_some_aout_object_p): ..
5202         * rs6000-core.c (read_hdr, make_bfd_asection): ..
5203         * sco5-core.c (make_bfd_asection): ..
5204         * simple.c (bfd_simple_get_relocated_section_contents): ..
5205         * som.c (som_object_setup, setup_sections, som_prep_headers,
5206         som_write_fixups, som_begin_writing, bfd_section_from_som_symbol,
5207         som_set_reloc_info, som_get_section_contents,
5208         som_bfd_link_split_section): ..
5209         * sparclinux.c (linux_link_create_dynamic_sections,
5210         bfd_sparclinux_size_dynamic_sections, linux_finish_dynamic_link): ..
5211         * srec.c (srec_scan, srec_read_section, srec_get_section_contents): ..
5212         * stabs.c (_bfd_link_section_stabs, _bfd_discard_section_stabs,
5213         _bfd_write_stab_strings, _bfd_stab_section_offset): ..
5214         * sunos.c (sunos_read_dynamic_info, sunos_create_dynamic_sections,
5215         bfd_sunos_size_dynamic_sections, sunos_scan_std_relocs,
5216         sunos_scan_ext_relocs, sunos_scan_dynamic_symbol,
5217         sunos_write_dynamic_symbol, sunos_check_dynamic_reloc,
5218         sunos_finish_dynamic_link): ..
5219         * syms.c (_bfd_stab_section_find_nearest_line): ..
5220         * tekhex.c (first_phase, tekhex_set_section_contents,
5221         tekhex_write_object_contents): ..
5222         * trad-core.c (trad_unix_core_file_p): ..
5223         * versados.c (process_esd, process_otr, process_otr): ..
5224         * vms-gsd.c (_bfd_vms_slurp_gsd, _bfd_vms_write_gsd): ..
5225         * vms-misc.c (add_new_contents): ..
5226         * vms-tir.c (check_section, new_section, _bfd_vms_write_tir): ..
5227         * vms.c (vms_set_section_contents): ..
5228         * xcofflink.c (xcoff_get_section_contents, xcoff_link_add_symbols,
5229         xcoff_sweep, bfd_xcoff_size_dynamic_sections, xcoff_build_ldsyms,
5230         _bfd_xcoff_bfd_final_link, xcoff_link_input_bfd): ..
5231         * xsym.c (bfd_sym_scan): .. See above.
5232
5233 2004-06-21  H.J. Lu  <hongjiu.lu@intel.com>
5234
5235         * elfxx-ia64.c (elfNN_ia64_relax_section): Add addend when
5236         calling _bfd_merged_section_offset only for section symbols.
5237
5238 2004-06-22  Alan Modra  <amodra@bigpond.net.au>
5239
5240         * elf32-ppc.c (ppc_elf_relax_section): Implement reference code
5241         for handling SEC_MERGE symbols in relax_section.
5242
5243 2004-06-21  Alexandre Oliva  <aoliva@redhat.com>
5244
5245         2003-05-15  Richard Sandiford  <rsandifo@redhat.com>
5246         * cpu-h8300.c (compatible): Allow h8300s and h8300sx code to be
5247         linked together. Mark the result as h8300sx code.
5248
5249 2004-06-21  Alexandre Oliva  <aoliva@redhat.com>
5250
5251         * elf-bfd.h (struct elf_backend_data): Added
5252         elf_backend_omit_section_dynsym.
5253         (_bfd_elf_link_omit_section_dynsym): Declare.
5254         * elf32-frv.c (_frvfdpic_link_omit_section_dynsym): New.
5255         (elf_backend_omit_section_dynsym): Use it for frvfdpic.
5256         * elflink.c (_bfd_elf_link_omit_section_dynsym): Split out of...
5257         (_bfd_elf_link_renumber_dynsyms): ... this function.
5258         * elfxx-target.h (elf_backend_omit_section_dynsym): Default to
5259         _bfd_elf_link_omit_section_dynsym).
5260         (elfNN_bed): Added elf_backend_omit_section_dynsym.
5261
5262 2004-06-21  Nick Clifton  <nickc@redhat.com>
5263
5264         * coffcode.h (styp_to_sec_flags): Ignore IMAGE_SCN_MEM_NOT_PAGED
5265         flags.
5266
5267 2004-06-17  Jerome Guitton  <guitton@gnat.com>
5268
5269         * bfd-in.h (bfd_cache_close_all): New function declaration.
5270         * bfd-in2.h: Regenerate.
5271         * cache.c (bfd_cache_close_all): New function definition.
5272
5273 2004-06-16  Mark Kettenis  <kettenis@gnu.org>
5274
5275         * configure.in: Don't set COREFILE to trad-core.lo for FreeBSD
5276         4.10 and beyond.
5277         * configure: Regenerate.
5278
5279 2004-06-16  Daniel Jacobowitz  <dan@debian.org>
5280
5281         * elf32-ppc.c (ppc_elf_create_linker_section): Create symbols in
5282         the pre-existing section.
5283
5284 2004-06-15  Alan Modra  <amodra@bigpond.net.au>
5285
5286         * section.c (struct sec): Remove usused flags.  Reorganize a little.
5287         (bfd_get_section_size_before_reloc): Delete.
5288         (bfd_get_section_size_after_reloc): Delete.
5289         (STD_SECTION): Update.
5290         (bfd_get_section_size_now): Delete.
5291         (bfd_set_section_contents): Don't referece reloc_done.
5292         (bfd_get_section_contents): Remove reloc_done comment.
5293         * bout.c (b_out_bfd_get_relocated_section_contents): Don't set
5294         reloc_done.
5295         * coff-alpha.c (alpha_ecoff_get_relocated_section_contents): Likewise.
5296         * ecoff.c (bfd_debug_section): Update initializer.
5297         * elfxx-mips.c (_bfd_elf_mips_get_relocated_section_contents): Ditto.
5298         * reloc.c (bfd_generic_get_relocated_section_contents): Likewise.
5299         * bfd-in.h (bfd_section_size): Expand.
5300         (bfd_get_section_size): New macro.
5301         * bfd-in2.h: Regenerate.
5302         * coff64-rs6000.c (xcoff64_write_object_contents): Replace
5303         bfd_get_section_size_before_reloc with bfd_get_section_size.
5304         * coffcode.h (coff_write_object_contents): Likewise.
5305         * coffgen.c (build_debug_section): Likewise.
5306         * dwarf1.c (parse_line_table): Likewise.
5307         (_bfd_dwarf1_find_nearest_line): Likewise.
5308         * ecoff.c (_bfd_ecoff_write_object_contents): Likewise.
5309         * i386msdos.c (msdos_write_object_contents): Likewise.
5310         * pdp11.c (squirt_out_relocs): Likewise.
5311         * elf32-sh64.c (sh64_find_section_for_address): Remove comment.
5312         * elf64-mmix.c (mmix_elf_final_link): Update comment.
5313
5314 2004-06-14  Chris Demetriou  <cgd@broadcom.com>
5315
5316         * elf32-mips.c (elf_mips_gnu_pcrel32): Add (undoing 2004-04-24
5317         removal) with updated comment.
5318         (bfd_elf32_bfd_reloc_type_lookup): Add back case for
5319         BFD_RELOC_32_PCREL.
5320         (mips_elf32_rtype_to_howto): Add back case for R_MIPS_PC32.
5321         * elfxx-mips.c (mips_elf_calculate_relocation): Likewise.
5322
5323 2004-06-12  Alan Modra  <amodra@bigpond.net.au>
5324
5325         * elf64-x86-64.c (elf64_x86_64_relocate_section): Ignore reloc
5326         overflow on branches to undefweaks.
5327
5328 2004-06-11  Maciej W. Rozycki  <macro@ds2.pg.gda.pl>
5329
5330         * coff-alpha.c (alpha_relocate_section): Set used_by_bfd directly
5331         as ecoff_section_data() does not return a valid lvalue.
5332
5333 2004-06-09  Alexandre Oliva  <aoliva@redhat.com>
5334
5335         * elflink.c (elf_sort_symbol): Compare section id, not pointers.
5336         (elf_link_add_object_symbols): Likewise.
5337
5338         * elf-m10300.c (_bfd_mn10300_elf_reloc_type_class): New.
5339         (elf_backend_reloc_type_class): New.
5340
5341 2004-06-08  Mark Kettenis  <kettenis@gnu.org>
5342
5343         * configure.in (hppa*-*-netbsd*, hppa*-*-openbsd): Set COREFILE to
5344         netbsd-core.lo.
5345         * configure: Regenerate.
5346
5347 2004-06-07  Daniel Jacobowitz  <dan@debian.org>
5348
5349         From:  Albert Chin-A-Young  <china@thewrittenword.com>
5350         * bfd/elf-bfd.h (struct eh_cie_fde): Convert unsigned char bitfields
5351         to unsigned int.
5352
5353 2004-05-29  H.J. Lu  <hongjiu.lu@intel.com>
5354
5355         * elfxx-ia64.c (elfNN_ia64_relax_section): Undo the last
5356         change.
5357
5358 2004-05-28  DJ Delorie  <dj@redhat.com>
5359
5360         * elf-m10300.c (mn10300_elf_relax_section): Preserve reloc addend
5361         for linking, but otherwise adjust reloc for merged sections.
5362
5363 2004-05-28  H.J. Lu  <hongjiu.lu@intel.com>
5364
5365         * elfxx-ia64.c (elfNN_ia64_relax_section): Properly call
5366         _bfd_merged_section_offset for local symbols.
5367
5368 2004-05-28  Andrew Stubbs <andrew.stubbs@superh.com>
5369
5370         * Makefile.am: Regenerate dependencies.
5371         * Makefile.in: Regenerate.
5372         * archures.c: Add bfd_mach_sh3_nommu .
5373         * bfd-in2.h: Regenerate.
5374         * cpu-sh.c: Add sh3-nommu architecture.
5375         (bfd_to_arch_table): Create new table.
5376         (sh_get_arch_from_bfd_mach): Create new function.
5377         (sh_get_arch_up_from_bfd_mach): Create new function.
5378         (sh_merge_bfd_arch): Create new function.
5379         * elf32-sh.c (sh_ef_bfd_table): Add table.
5380         (sh_elf_check_relocs): Replace switch statement with
5381         use of sh_ef_bfd_table .
5382         (sh_elf_get_flags_from_mach): Add new function.
5383         (sh_find_elf_flags): Likewise.
5384         (sh_elf_copy_private_data): Replace most of non-elf contents
5385         with a call to sh_merge_bfd_arch() .
5386
5387 2004-05-27  Michael Chastain  <mec.gnu@mindspring.com>
5388
5389         * Makefile.am (bfdver.h): Use explicit filename, not $< .
5390         * Makefile.in: Regenerate.
5391
5392 2004-05-27  Alexandre Oliva  <aoliva@redhat.com>
5393
5394         * elf-m10300.c (elf32_mn10300_finish_hash_table_entry): Avoid
5395         custom calling conventions for dynamic symbols.
5396         (mn10300_elf_relax_section): Avoid relaxing a function as a local
5397         symbol if it's an alias to a global one.
5398
5399 2004-05-26  H.J. Lu  <hongjiu.lu@intel.com>
5400
5401         * elf.c (_bfd_elf_make_section_from_shdr): Undo the last
5402         change.
5403
5404 2004-05-27  Alexandre Oliva  <aoliva@redhat.com>
5405
5406         * elf-m10300.c (mn10300_elf_relax_section): Don't test isym within
5407         loop over hashes.
5408
5409 2004-05-26  Alan Modra  <amodra@bigpond.net.au>
5410
5411         * elf.c (_bfd_elf_make_section_from_shdr): Don't set SEC_EXCLUDE
5412         for SHT_GROUP sections.
5413
5414 2004-05-25  Alan Modra  <amodra@bigpond.net.au>
5415
5416         * elflink.c (elf_link_add_object_symbols): Don't set up merge
5417         section data here..
5418         * elf.c (_bfd_elf_merge_sections): .. Do it here instead.
5419         * merge.c: Formatting.  Remove unnecessary casts.  Expand
5420         bfd_get_section_alignment macro.
5421         (struct sec_merge_sec_info): Rename "first" to "first_str".  Update
5422         use throughout file.
5423         (_bfd_add_merge_section): Rename from _bfd_merge_section.  Update
5424         comment.  Abort on dynamic or non-SEC_MERGE input.  Don't test
5425         section name to determine sinfo group, instead test output section
5426         and alignment.
5427         (_bfd_merge_sections): Add struct bfd_link_info param.  Call
5428         _bfd_strip_section_from_output rather than just twiddling flags.
5429         * libbfd-in.h (_bfd_add_merge_section): Rename, update comment.
5430         (_bfd_merge_sections): Update prototype.
5431         * libbfd.h: Regenerate.
5432
5433 2004-05-24  Mark Kettenis  <kettenis@gnu.org>
5434
5435         * netbsd-core.c: Correctly indent section that sets architecture
5436         from machine ID.
5437
5438         From Miod Vallat <miod@online.fr>:
5439         * m88kopenbsd.c: New file.
5440         * targets.c (m88k_openbsd_vec): New.
5441         * config.bfd: Add m88k-*-openbsd*.
5442         * configure.in (m88k-*-openbsd*): Set COREFILE to netbsd-core.lo.
5443         (m88kopenbsd_vec): New.
5444         * configure: Regenerate.
5445         * Makefile.am (BFD32_BACKENDS): Add m88kopenbsd.lo.
5446         (BFD32_BACKENDS_CFILES): Add m88kopenbsd.c.
5447         Run "make dep-am".
5448         * Makefile.in: Regenerate.
5449         * po/SRC-POTFILES.in: Regenerate.
5450
5451 2004-05-24  Nick Clifton  <nickc@redhat.com>
5452
5453         * hash.c: Remove bogus node "Changing the default Hash Table Size"
5454         introduced by hash table size patch.
5455
5456 2004-05-22  Ben Elliston  <bje@au.ibm.com>
5457
5458         * configure.in (is_release): Remove.
5459         (bfd_version_date, bfd_version, bfd_version_string): Likewise.
5460         (AC_OUTPUT): Don't output bfdver.h from version.h.
5461         * configure: Regenerate.
5462         * Makefile.am (RELEASE): New variable.
5463         (bfdver.h): New target.
5464         * Makefile.in: Regenerate.
5465         * doc/Makefile.in: Likewise.
5466
5467 2004-05-22  Ben Elliston  <bje@au.ibm.com>
5468
5469         * Makefile.am (config.status): Don't depend on version.h.
5470         * Makefile.in: Regenerate.
5471
5472 2004-05-22  Alan Modra  <amodra@bigpond.net.au>
5473
5474         * merge.c (_bfd_merged_section_offset): Remove "addend" param.
5475         * libbfd-in.h (_bfd_merged_section_offset): Adjust prototype.
5476         * libbfd.h: Regenerate.
5477         * elf.c (_bfd_elf_rela_local_sym): Adjust call.
5478         (_bfd_elf_rel_local_sym): Likewise.
5479         * elflink.c (_bfd_elf_link_sec_merge_syms): Likewise.
5480         (elf_link_input_bfd): Likewise.
5481         * elf32-ppc.c (ppc_elf_relax_section): Likewise.
5482         * elf64-alpha.c (elf64_alpha_relocate_section): Likewise.
5483         * elfxx-ia64.c (elfNN_ia64_relax_section): Likewise.
5484         (elfNN_ia64_relocate_section): Likewise.
5485
5486 2004-05-21  Andy Chittenden  <achittenden@bluearc.com>
5487
5488         * hash.c (bfd_default_hash_table_size): New variable.
5489         (bfd_hash_table_init): Use new variable instead of DEFAULT_SIZE.
5490         (bfd_hash_set_default_size): New function.  Set the default size
5491         to a selected prime number close to the argument.  Document new
5492         function.
5493         * bfd-in.h: Add prototype for  bfd_hash_set_default_size.
5494         * bfd-in2.h: Regenerate.
5495         * Makefile.am (hash.lo): Add dependency upon libiberty.h.
5496         * Makefile.in: Regenerate.
5497
5498 2004-05-21  Mark Kettenis  <kettenis@gnu.org>
5499
5500         * libaout.h (machine_type): Add M_88K_OPENBSD and M_HPPA_OPENBSD.
5501         * netbsd-core.c (netbsd_core_file_p): Set architecture for alpha,
5502         arm, m68k, m88k and hppa core files.
5503
5504 2004-05-21  Nick Clifton  <nickc@redhat.com>
5505
5506         * bfdio.c (bfd_bread): Do not use iovec if it is NULL.
5507         (bfd_bwrite): Likewise.
5508         (bfd_tell): Likewise.
5509         (bfd_flush): Likewise.
5510         (bfd_stat): Likewise.
5511         (bfd_seek): Likewise.
5512         (bfd_get_mtime): Likewise.
5513         (bfd_get_size): Likewise.
5514
5515 2004-05-19  Ben Elliston  <bje@au.ibm.com>
5516
5517         * dwarf2.c (_bfd_dwarf2_find_nearest_line): Comment correction.
5518
5519 2004-05-19  Mikulas Patocka  <mikulas@artax.karlin.mff.cuni.cz>
5520
5521         * archive.c (_bfd_get_elt_at_filepos): Cope with a nested archives.
5522         (bfd_generic_openr_next_archived_file): Likewise.
5523
5524 2004-05-17  Bob Wilson  <bob.wilson@acm.org>
5525
5526         * elf32-xtensa.c (xtensa_get_property_section_name): Determine linkonce
5527         section names by inserting a new substring after .gnu.linkonce, except
5528         for .gnu.linkonce.t.* where the "t." is replaced.
5529
5530 2004-05-17  Adam Nemet  <anemet@lnxw.com>
5531
5532         * config.bfd (sparc-*-lynxos* case): Add to obsolete list.
5533         (m68-*-lynxos* case): Likewise.
5534         (powerpc-*-lyxnos* case): New case.
5535         (i[3-7]86-*-lynxos* case): Update to LynxOS 4.0 ELF.
5536
5537 2004-05-17  David Heine  <dlheine@tensilica.com>
5538
5539         * aout-target.h (MY_bfd_copy_private_header_data): Define.
5540         * aout-tic30.c (MY_bfd_copy_private_header_data): Define.
5541         * bfd.c (bfd_copy_private_header_data): Define.
5542         * coff-rs6000.c (rs6000coff_vec, pmac_xcoff_vec): Add entries for new
5543         interface.
5544         * coff64-rs6000.c (rs6000coff64_vec, aix5coff64_vec): Likewise.
5545         * coffcode.h (coff_bfd_copy_private_header_data): Define.
5546         * elf-bfd.h (_bfd_elf_copy_private_header_data): Declare.
5547         * elf.c (_bfd_elf_copy_private_section_data): Remove code to set up
5548         segments by calling copy_private_bfd_data.
5549         (_bfd_elf_copy_private_header_data): Define.
5550         * elfxx-target.h (bfd_elfNN_bfd_copy_private_header_data): Define.
5551         * libbfd-in.h (_bfd_generic_bfd_copy_private_header_data): Define.
5552         * libecoff.h (_bfd_ecoff_bfd_copy_private_header_data): Define.
5553         * mach-o.c (bfd_mach_o_bfd_copy_private_header_data): Define.
5554         * mmo.c (mmo_bfd_copy_private_header_data): Define.
5555         * ppcboot.c (ppcboot_bfd_copy_private_header_data): Define.
5556         * som.c (som_bfd_copy_private_header_data): Define.
5557         * targets.c (BFD_JUMP_TABLE_COPY): Add _bfd_copy_private_header_data.
5558         * vms.c (vms_bfd_copy_private_header_data): Define.
5559         * bfd-in2.h: Regenerate.
5560         * libbfd.h: Regenerate.
5561
5562 2004-05-15  Thiemo Seufer  <seufer@csv.ica.uni-stuttgart.de>
5563
5564         * elfxx-mips.c (MINUS_TWO): Define.
5565         (mips_elf_higher, mips_elf_highest,
5566         mips_elf_create_dynamic_relocation): Use MINUS_ONE and MINUS_TWO for
5567         some bfd_vma values.
5568         (_bfd_mips_elf_finish_dynamic_symbol): Likewise. Code cleanup.
5569
5570 2004-05-14  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
5571
5572         * som.c (log2): Rename to exact_log2.  Adjust all callers.
5573
5574 2004-05-13  Paul Brook  <paul@codesourcery.com>
5575
5576         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Handle
5577         dwarf3 format CIE entries.  Remove comment about the size of the
5578         ra_column field.  It is now correctly deduced.
5579
5580 2004-05-13  Joel Sherrill <joel@oarcorp.com>
5581
5582         * config.bfd (or32-*-rtems*): Switch to elf.
5583
5584 2004-05-13  Nick Clifton  <nickc@redhat.com>
5585
5586         * po/fr.po: Updated French translation.
5587
5588 2004-05-11  Jakub Jelinek  <jakub@redhat.com>
5589
5590         * elflink.c (bfd_elf_final_link): Don't output STT_SECTION symbol
5591         into .dynsym if elf_section_data (sec)->dynindx <= 0.
5592         Adjust counting of last_local.
5593         (_bfd_elf_link_renumber_dynsyms): Don't assign dynindx to sections
5594         other than SHT_PROGBITS/SHT_NOBITS and neither for .got/.got.plt/.plt
5595         created by the linker nor !SHF_ALLOC.
5596
5597         * elf32-i386.c (elf_i386_finish_dynamic_sections): Point
5598         DT_PLTGOT to the start of the .got.plt section instead of the
5599         .got output section.  Set sh_entsize for .got section in addition
5600         to .got.plt.
5601         (elf_i386_relocate_section): Don't assume _GLOBAL_OFFSET_TABLE_
5602         is at sgot->output_section->vma.
5603         * elf64-x86-64.c (elf64_x86_64_finish_dynamic_sections): Point
5604         DT_PLTGOT to the start of the .got.plt section instead of the
5605         .got output section.
5606         (elf64_x86_64_relocate_section): Don't assume _GLOBAL_OFFSET_TABLE_
5607         is at sgot->output_section->vma.  Set sh_entsize for .got section
5608         in addition to .got.plt.
5609         * elf.c (_bfd_elf_print_private_bfd_data): Handle PT_GNU_RELRO.
5610         (bfd_section_from_phdr): Likewise.
5611         (map_sections_to_segments): Likewise.
5612         (assign_file_positions_for_segments): Likewise.
5613         (get_program_header_size): Likewise.
5614         * elflink.c (bfd_elf_size_dynamic_sections): Set
5615         elf_tdata (output_bfd)->relro from info->relro.
5616         * elf-bfd.h (struct elf_obj_tdata): Add relro field.
5617
5618 2004-05-08  Alexandre Oliva  <aoliva@redhat.com>
5619
5620         * elf32-frv.c (_frvfdpic_add_dyn_reloc): Don't warn when we get
5621         a zero symndx for which we hadn't accounted a dynamic relocation.
5622         (_frvfdpic_add_rofixup): Likewise.
5623
5624 2004-05-07  Brian Ford  <ford@vss.fsi.com>
5625             DJ Delorie  <dj@redhat.com>
5626
5627         * coffcode.h (coff_write_object_contents) [COFF_IMAGE_WITH_PE]:
5628         Propagate IMAGE_FILE_LARGE_ADDRESS_AWARE.
5629         * peXXigen.c (_bfd_XX_print_private_bfd_data_common): Recognize
5630         IMAGE_FILE_LARGE_ADDRESS_AWARE.  Use PE defines.
5631
5632 2004-05-07  Alexandre Oliva  <aoliva@redhat.com>
5633
5634         * elf32-frv.c (elf32_frvfdpic_modify_segment_map): Return
5635         immediately if there's no link info.
5636         (elf32_frvfdpic_copy_private_bfd_data): New.
5637         (bfd_elf32_bfd_copy_private_bfd_data): Use it for frvfdpic.
5638
5639 2004-05-06  Zack Weinberg  <zack@codesourcery.com>
5640
5641         * dwarf2.c (add_line_info): Also set info->filename to NULL if
5642         filename argument is null; do not call strlen on a null pointer.
5643
5644 2004-05-06  Daniel Jacobowitz  <drow@mvista.com>
5645
5646         * elf32-arm.h (elf32_arm_relocate_section): Remove R_ARM_PLT32
5647         special case.
5648
5649 2004-05-05  Alexandre Oliva  <aoliva@redhat.com>
5650
5651         * configure.in (bfd_elf32_frvfdpic_vec): New.
5652         * configure: Rebuilt.
5653         * targets.c (bfd_elf32_frvfdpic_vec): New.
5654         * config.bfd: Enable it on frv-*-elf and frv-*-*linux*, as default
5655         on the latter.
5656         * elf32-frv.c: Prefix all identifiers added for FDPIC support with
5657         frvfdpic instead of frv.  Rearrange elf-target macros such that
5658         the FDPIC-specific ones are only defined for this new target
5659         vector.
5660         (bfd_elf32_frvfdpic_vec): Declare.
5661         (IS_FDPIC): New.
5662         (elf32_frv_relocate_section): Use it to enable segment checking
5663         and to control rofixup emission.  Add output section vma to
5664         applied relocation in non-LOAD non-ALLOC sections.  Use
5665         _bfd_error_handler for errors.
5666         (_frv_create_got_section): Create .rel.got and .rofixup only in
5667         FDPIC.  Create non-dynamic _gp at .got+2048 in non-FDPIC, like the
5668         linker script.
5669         (elf32_frvfdpic_size_dynamic_sections): Assume FDPIC.
5670         (elf32_frvfdpic_modify_segment_map): Likewise.
5671         (elf32_frv_finish_dynamic_sections): New, do-nothing.
5672         (elf32_frvfdpic_finish_dynamic_sections): Assume FDPIC.  Improve
5673         error message if we miscompute the rofixup size.
5674         (frvfdpic_elf_use_relative_eh_frame): Assume FDPIC.
5675         (frvfdpic_elf_encode_eh_address): Likewise.
5676         (elf32_frv_check_relocs): Reject FDPIC-only relocs in non-FDPIC.
5677         Record relocs only in FDPIC.  Make sure _gp is defined for GPREL
5678         relocs.  Reject unknown relocation types.
5679         (elf32_frv_object_p): Make sure target vector matches FDPIC bits.
5680         (frv_elf_merge_private_bfd_data): Likewise.
5681         (ELF_MAXPAGESIZE): Revert to 0x1000 for elf32-frv; keep it as
5682         0x4000 for newly-added elf32-frvfdpic.
5683
5684 2004-05-05  Nick Clifton  <nickc@redhat.com>
5685
5686         PR/136
5687         * cache.c (bfd_cache_lookup_worker): Call abort() rather than
5688         returning NULL as most users of this function do not check its
5689         return value.
5690         * hppabsd-core.c (hppabsd_core_core_file_p): Do not check result
5691         of bfd_cache_lookup().
5692         * sco5-core.c (sco5_core_file_p): Likewise.
5693         * trad-core.c (trad_unix_core_file_p): Likewise.
5694
5695 2004-05-05  Nick Clifton  <nickc@redhat.com>
5696
5697         * cache.c (bfd_cache_lookup): Improve formatting.
5698         * archive.c: Fix formatting.
5699
5700 2004-05-05  Peter Barada  <peter@the-baradas.com>
5701
5702         * bfd_archures.c(bfd_architecture): Add 521x,5249,547x,548x.
5703         * cpu-m68k.c(bfd_m68k_arch): Likewise.
5704         * bfd-in2.h(bfd_architecture): Regenerate.
5705
5706 2004-05-03  Alan Modra  <amodra@bigpond.net.au>
5707
5708         * elf.c (_bfd_elf_rela_local_sym): Set kept_section for excluded
5709         SEC_MERGE sections.
5710         * elflink.c (elf_link_input_bfd): Adjust output reloc index for
5711         those against discarded link-once and SEC_MERGE section symbols.
5712
5713 2004-05-02  H.J. Lu  <hongjiu.lu@intel.com>
5714
5715         * section.c (bfd_get_section_by_name_if): New.
5716         * bfd-in2.h: Regenerated.
5717
5718 2004-05-02  Alan Modra  <amodra@bigpond.net.au>
5719
5720         * som.c (som_bfd_is_group_section): Define.
5721
5722 2004-05-01  Alan Modra  <amodra@bigpond.net.au>
5723
5724         * section.c (bfd_make_section_anyway): Copy the whole
5725         bfd_hash_entry, not just "next" from existing entry.
5726
5727 2004-04-30  H.J. Lu  <hongjiu.lu@intel.com>
5728
5729         * elf.c (bfd_section_from_shdr): Maintain the section order in
5730         a section group.
5731         (special_sections): Add ".note.GNU-stack".
5732         (elf_fake_sections): Handle section group for relocatable
5733         link..
5734
5735 2004-04-30  H.J. Lu  <hongjiu.lu@intel.com>
5736
5737         * section.c (bfd_sections_find_if): New.
5738         * bfd-in2.h: Regenerated.
5739
5740 2004-04-30  Alan Modra  <amodra@bigpond.net.au>
5741
5742         * section.c (bfd_make_section_anyway): Add all sections to hash tab.
5743
5744         * elf-bfd.h (bfd_elf_is_group_section): Declare.
5745         * elf.c (bfd_elf_is_group_section): New function.
5746         * elfxx-target.h (bfd_elfNN_bfd_is_group_section
5747         * section.c (bfd_generic_is_group_section): New function.
5748         * targets.c (struct bfd_target): Add _bfd_is_group_section field.
5749         (BFD_JUMP_TABLE_LINK): Adjust.
5750         * aout-adobe.c (aout_32_bfd_is_group_section): Define.
5751         * aout-target.h (MY_bfd_is_group_section): Define.
5752         * aout-tic30.c (MY_bfd_is_group_section): Define.
5753         * bfd.c (bfd_is_group_section): Define.
5754         * binary.c (binary_bfd_is_group_section): Define.
5755         * bout.c (b_out_bfd_is_group_section): Define.
5756         * coff-alpha.c (_bfd_ecoff_bfd_is_group_section): Define.
5757         * coff-mips.c (_bfd_ecoff_bfd_is_group_section): Define.
5758         * coff-rs6000.c (rs6000coff_vec, pmac_xcoff_vec): Adjust.
5759         * coff64-rs6000.c (rs6000coff64_vec, aix5coff64_vec): Adjust.
5760         * coffcode.h (coff_bfd_is_group_section): Define.
5761         * i386msdos.c (msdos_bfd_is_group_section): Define.
5762         * i386os9k.c (os9k_bfd_is_group_section): Define.
5763         * ieee.c (ieee_bfd_is_group_section): Define.
5764         * ihex.c (ihex_bfd_is_group_section): Define.
5765         * libbfd-in.h (_bfd_nolink_bfd_is_group_section): Define.
5766         * mach-o.c (bfd_mach_o_bfd_is_group_section): Define.
5767         * mmo.c (mmo_bfd_is_group_section): Define.
5768         * nlm-target.h (nlm_bfd_is_group_section): Define.
5769         * oasys.c (oasys_bfd_is_group_section): Define.
5770         * pef.c (bfd_pef_bfd_is_group_section): Define.
5771         * ppcboot.c (ppcboot_bfd_is_group_section): Define.
5772         * srec.c (srec_bfd_is_group_section): Define.
5773         * tekhex.c (tekhex_bfd_is_group_section): Define.
5774         * versados.c (versados_bfd_is_group_section): Define.
5775         * vms.c (vms_bfd_is_group_section): Define.
5776         * xsym.c (bfd_sym_bfd_is_group_section): Define.
5777         * bfd-in2.h: Regenerate.
5778         * libbfd.h: Regenerate.
5779
5780 2004-04-30  Alan Modra  <amodra@bigpond.net.au>
5781
5782         * elflink.c (elf_gc_mark): Follow indirect and warning syms.
5783
5784 2004-04-30  Hans-Peter Nilsson  <hp@axis.com>
5785
5786         * configure.in: Update version to 2.15.91.
5787         * configure: Regenerate.
5788
5789 2004-04-29  Brian Ford  <ford@vss.fsi.com>
5790
5791         * bfd.c (bfd_get_sign_extend_vma): Add pe[i]-i386 case to DJGPP hack.
5792         * coffcode.h (DOT_DEBUG, GNU_LINKONCE_WI): Define.
5793         [!COFF_WITH_PE] (sec_to_styp_flags, styp_to_sec_flags): Use them.
5794         (coff_compute_section_file_positions) [RS6000COFF_C]: Likewise.
5795         [COFF_WITH_PE] (sec_to_styp_flags): Handle DWARF 2/3 .debug* and
5796         .gnu.linkonce.wi. sections.
5797         * pe-i386.c (COFF_SUPPORT_GNU_LINKONCE): Define.
5798         (COFF_SECTION_ALIGNMENT_ENTRIES): Add entries for .debug and
5799         .gnu.linkonce.wi..
5800         * pei-i386.c (COFF_SUPPORT_GNU_LINKONCE): Likewise.
5801         (COFF_SECTION_ALIGNMENT_ENTRIES): Likewise.
5802
5803 2004-04-28  Chris Demetriou  <cgd@broadcom.com>
5804
5805         * reloc.c: Remove BFD_RELOC_PCREL_HI16_S and BFD_RELOC_PCREL_LO16.
5806         * bfd-in2.h: Regenerate.
5807         * libbfd.h: Likewise.
5808
5809 2004-04-28  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
5810
5811         * som.c (struct som_misc_symbol_info): Add is_comdat, is_common and
5812         dup_common fields.
5813         (setup_sections): Use som_subspace_dictionary_record struct instead
5814         subspace_dictionary_record.  Set SEC_LINK_ONCE if subspace is
5815         is_comdat, is_common or dup_common.
5816         (som_prep_headers): Use som_subspace_dictionary_record struct.  Set
5817         is_comdat, is_common and dup_common in section subspace_dict from
5818         copy_data.
5819         (som_begin_writing): Use som_subspace_dictionary_record struct.
5820         (som_finish_writing): Likewise.
5821         (som_bfd_derive_misc_symbol_info): Add support to set is_comdat,
5822         is_common and dup_common flags in info for symbol.  Add comment
5823         regarding linker support for these fields.  Slightly reorganize
5824         function.
5825         (som_build_and_write_symbol_table): Set is_comdat, is_common and
5826         dup_common fields in symbol table from symbol info.
5827         (bfd_som_set_subsection_attributes): Add comdat, common and dup_common
5828         arguments.  Set corresponding fields in copy_data.  Change all callers.
5829         (som_bfd_ar_write_symbol_stuff): Set dup_common flag in library
5830         symbol table.
5831         (som_vec): Add SEC_LINK_ONCE to applicable section flags.
5832         * som.h (som_subspace_dictionary_record): Define.
5833         (som_copyable_section_data_struct): Add is_comdat, is_common and
5834         dup_common fields.
5835         (som_section_data_struct): Use som_subspace_dictionary_record struct
5836         instead of subspace_dictionary_record.
5837         (bfd_boolean bfd_som_set_subsection_attributes): Adjust prototype.
5838
5839 2004-04-27  Bob Wilson  <bob.wilson@acm.org>
5840
5841         * elf32-xtensa.c (xtensa_read_table_entries): Use section _cooked_size
5842         if set.  Check reloc_done flag before applying relocations.  Use
5843         output addresses, both when applying relocations and when comparing
5844         against the specified section.
5845         (elf_xtensa_relocate_section): Use output address to check if dynamic
5846         reloc is in a literal pool.  Set section's reloc_done flag.
5847
5848 2004-04-27  H.J. Lu  <hongjiu.lu@intel.com>
5849
5850         * elf32-sh64.c (elf_backend_section_flags): New. Defined.
5851         (sh64_elf_set_mach_from_flags): Remove the kludge for .cranges
5852         section.
5853         (sh64_elf_section_flags): New. Set SEC_DEBUGGING for .cranges
5854         section.
5855
5856 2004-04-27  Alan Modra  <amodra@bigpond.net.au>
5857
5858         * elf64-alpha.c (elf64_alpha_read_ecoff_info): Don't assign
5859         structure field removed in 2004-04-24 patch.
5860         * elf64-sparc.c (sparc64_elf_plt_sym_val): Warning fix.
5861
5862         * elf-bfd.h (struct elf_backend_data <elf_backend_section_flags>):
5863         Constify hdr arg.
5864         * elf32-arm.h (elf32_arm_section_flags): Likewise.
5865         * elf64-alpha.c (elf64_alpha_section_flags): Likewise.
5866         * elfxx-ia64.c (elfNN_ia64_section_flags): Likewise.
5867         * elf.c (_bfd_elf_make_section_from_shdr): Set the bfd_section
5868         field before calling elf_backend_section_flags.
5869
5870 2004-04-24  Chris Demetriou  <cgd@broadcom.com>
5871
5872         * elf32-mips.c (elf_mips_gnu_rel_hi16, elf_mips_gnu_rel_lo16)
5873         (elf_mips_gnu_pcrel64, elf_mips_gnu_pcrel32): Remove.
5874         (bfd_elf32_bfd_reloc_type_lookup): Remove cases for
5875         BFD_RELOC_PCREL_HI16_S, BFD_RELOC_PCREL_LO16, BFD_RELOC_64_PCREL,
5876         and BFD_RELOC_32_PCREL.
5877         (mips_elf32_rtype_to_howto): Remove cases for R_MIPS_GNU_REL_HI16,
5878         R_MIPS_GNU_REL_LO16, R_MIPS_PC64, R_MIPS_PC32.
5879         * elfxx-mips.c (mips_elf_calculate_relocation): Likewise.
5880         (_bfd_mips_elf_lo16_reloc): Remove handling for R_MIPS_GNU_REL_HI16.
5881         (mips_elf_next_relocation): Move comment about matching HI/LO
5882         relocations to...
5883         (_bfd_mips_elf_relocate_section): Here.  Remove handling for
5884         R_MIPS_GNU_REL_HI16.
5885
5886 2004-04-23  Chris Demetriou  <cgd@broadcom.com>
5887
5888         * coff-mips.c (mips_relhi_reloc, mips_rello_reloc)
5889         (mips_switch_reloc, mips_read_relocs, mips_relax_section)
5890         (mips_relax_pcrel16, PCREL16_EXPANSION_ADJUSTMENT): Remove.
5891         (mips_relocate_hi): Remove now-unused 'adjust' and 'pcrel' arguments,
5892         and update comments to reflect current usage.
5893         (mips_howto_table): Remove entries for MIPS_R_RELHI, MIPS_R_RELLO,
5894         and MIPS_R_SWITCH, as well as several empty entries.  Update comment
5895         for MIPS_R_PCREL16.
5896         (mips_ecoff_swap_reloc_in, mips_ecoff_swap_reloc_out)
5897         (mips_adjust_reloc_out, mips_bfd_reloc_type_lookup): Remove support
5898         for MIPS_R_SWITCH, MIPS_R_RELLO, and MIPS_R_RELHI relocations.
5899         (mips_adjust_reloc_in): Likewise, adjust maximum accepted relocation
5900         type number to be MIPS_R_PCREL16.
5901         (mips_relocate_section): Remove support for link-time relaxation
5902         of branches used by embedded-PIC.  Remove support for MIPS_R_SWITCH,
5903         MIPS_R_RELLO, and MIPS_R_RELHI relocations.
5904         (_bfd_ecoff_bfd_relax_section): Redefine to bfd_generic_relax_section.
5905         * ecoff.c (ecoff_indirect_link_order): Remove support for link-time
5906         relaxation of branches used by embedded-PIC.
5907         * ecofflink.c (bfd_ecoff_debug_accumulate): Likewise.
5908         * libecoff.h (struct ecoff_section_tdata): Remove embedded-PIC
5909         related members, update comment.
5910         * pe-mips.c: Remove disabled (commented-out and #if 0'd)
5911         code related to embedded-PIC.
5912         * elfxx-mips.c (_bfd_mips_elf_read_ecoff_info): Remove
5913         initialization of now-removed 'adjust' member of
5914         'struct ecoff_debug_info'.
5915
5916 2004-04-23  Chris Demetriou  <cgd@broadcom.com>
5917
5918         * elfxx-mips.c (mips_elf_get_global_gotsym_index): Remove.
5919
5920 2004-04-21  Philip Blundell  <pb@nexus.co.uk>
5921
5922         * elf32-arm.h (elf32_arm_check_relocs): Don't output REL32
5923         relocs for locally defined symbols during -shared final link.
5924         (elf32_arm_final_link_relocate): Likewise.
5925
5926 2004-04-22  Jakub Jelinek  <jakub@redhat.com>
5927
5928         * elf64-x86-64.c (elf64_x86_64_copy_indirect_symbol): Copy also
5929         ELF_LINK_POINTER_EQUALITY_NEEDED.
5930         (elf64_x86_64_check_relocs): Set ELF_LINK_POINTER_EQUALITY_NEEDED
5931         if r_type is not R_X86_64_PC32.
5932         (elf64_x86_64_finish_dynamic_symbol): If
5933         ELF_LINK_POINTER_EQUALITY_NEEDED is not set, clear st_value of
5934         SHN_UNDEF symbols.
5935
5936 2004-04-22  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5937
5938         * elf32-sh.c (sh_elf_plt_sym_val): New function.
5939         (elf_backend_plt_sym_val): Define.
5940
5941 2004-04-22  Andrew Cagney  <cagney@redhat.com>
5942
5943         * opncls.c (bfd_alloc): Fix type of "wanted" in doco.
5944
5945 2004-04-22  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
5946
5947         * hpux-core.c (hpux_core_core_file_p): Add cast in call to
5948         make_bfd_asection.
5949         * som.c (som_set_section_contents): Constantify second argument.
5950         (hppa_som_gen_reloc_type): Abort for unsupported selectors.
5951         (som_object_setup): Rework to avoid warning.
5952         (setup_sections, som_write_fixups, bfd_section_from_som_symbol):
5953         Likewise.
5954
5955 2004-04-22  Andrew Cagney  <cagney@redhat.com>
5956
5957         * cache.c (bfd_cache_close): Check for a previously closed file.
5958
5959 2004-04-22  Jakub Jelinek  <jakub@redhat.com>
5960
5961         * bfd.c (bfd_get_synthetic_symtab): Define.
5962         * targets.c (BFD_JUMP_TABLE_DYNAMIC): Add
5963         NAME##_get_synthetic_symtab.
5964         (struct bfd_target): Add _bfd_get_synthetic_symtab.
5965         * libbfd-in.h (_bfd_nodynamic_get_synthetic_symtab): Define.
5966         * elf-bfd.h (struct elf_backend_data): Add plt_sym_val and
5967         relplt_name fields.
5968         (_bfd_elf_get_synthetic_symtab): New prototype.
5969         * elfcode.h (elf_get_synthetic_symtab): Define.
5970         * elf.c (_bfd_elf_get_synthetic_symtab): New function.
5971         * elfxx-target.h (bfd_elfNN_get_synthetic_symtab): Define.
5972         (elf_backend_plt_sym_val, elf_backend_relplt_name): Define.
5973         (elfNN_bed): Add elf_backend_plt_sym_val and elf_backend_relplt_name.
5974         * bfd-in2.h: Rebuilt.
5975         * libbfd.h: Rebuilt.
5976         * elf32-i386.c (elf_i386_plt_sym_val): New function.
5977         (elf_backend_plt_sym_val): Define.
5978         * elf64-x86-64.c (elf64_x86_64_plt_sym_val): New function.
5979         (elf_backend_plt_sym_val): Define.
5980         * elf32-s390.c (elf_s390_plt_sym_val): New function.
5981         (elf_backend_plt_sym_val): Define.
5982         * elf64-s390.c (elf_s390_plt_sym_val): New function.
5983         (elf_backend_plt_sym_val): Define.
5984         * elf32-sparc (elf32_sparc_plt_sym_val): New function.
5985         (elf_backend_plt_sym_val): Define.
5986         * elf64-sparc.c (sparc64_elf_plt_sym_val): New function.
5987         (elf_backend_plt_sym_val): Define.
5988         * elf32-ppc.c (ppc_elf_plt_sym_val): New function.
5989         (elf_backend_plt_sym_val): Define.
5990         * aout-target.h (MY_get_synthetic_symtab): Define.
5991         * aout-tic30.c (MY_get_synthetic_symtab): Define.
5992         * coff-rs6000.c (rs6000coff_vec): Add
5993         _bfd_nodynamic_get_synthetic_symtab.
5994         (pmac_xcoff_vec): Likewise.
5995         * coff64-rs6000.c (rs6000coff64_vec): Add
5996         _bfd_nodynamic_get_synthetic_symtab.
5997         (aix5coff64_vec): Likewise.
5998         * sunos.c (MY_get_synthetic_symtab): Define.
5999         * vms.c (vms_get_synthetic_symtab): Define.
6000
6001 2004-04-22  Nick Clifton  <nickc@redhat.com>
6002
6003         * bfd.c (bfd_archive_filename): Return NULL on NULL input.
6004
6005 2004-04-22  Peter Barada <peter@the-baradas.com>
6006
6007         * archures.c: Add bfd_mach_mcfv4e to bfd_architecture.
6008         * bfd2-in.h: Regenerate.
6009         * cpu-m68k.c: Add 'm68k:mcfv4e' to arch_info_struct[].
6010
6011 2004-04-21  Chris Demetriou  <cgd@broadcom.com>
6012
6013         * coff-mips.c (bfd_mips_ecoff_create_embedded_relocs): Remove.
6014         * elf32-mips.c (bfd_mips_elf32_create_embedded_relocs): Remove.
6015         * bfd-in.h (bfd_mips_ecoff_create_embedded_relocs)
6016         (bfd_mips_elf32_create_embedded_relocs): Remove prototypes
6017         * bfd-in2.h: Regenerate.
6018
6019 2004-04-21  Bob Wilson  <bob.wilson@acm.org>
6020
6021         * elf32-xtensa.c (is_same_value): Add final_static_link argument and
6022         require relocations against a weak symbol to reference the same
6023         symbol hash entry if not a final, static link.
6024         (get_cached_value, add_value_map): Add final_static_link argument.
6025         (remove_literals): Pass final_static_link argument as needed.
6026
6027 2004-04-21  Andrew Cagney  <cagney@redhat.com>
6028
6029         * opncls.c (_bfd_new_bfd_contained_in): Copy "iovec".
6030         (struct opncls, opncls_btell, opncls_bseek, opncls_bread)
6031         (opncls_bwrite, opncls_bclose, opncls_bflush)
6032         (opncls_bstat, opncls_iovec, bfd_openr_iovec): Implement a
6033         bfd iovec that uses function callbacks.
6034         (bfd_close): Use the iovec's bclose.
6035         * cache.c (cache_btell, cache_bseek, cache_bread, cache_bwrite)
6036         (cache_bclose, cache_bflush, cache_bstat)
6037         (cache_iovec): New functions and global variable, implement a
6038         cache "iovec", where applicable set bfd_error.
6039         (bfd_cache_init, bfd_cache_close): Set/test the bfd's iovec.
6040         * bfdio.c (struct bfd_iovec): Define.
6041         (real_read): Delete function.
6042         (bfd_bread, bfd_bread, bfd_bwrite, bfd_tell, bfd_flush, bfd_stat)
6043         (bfd_seek, bfd_get_mtime, bfd_get_size): Use the bfd's "iovec",
6044         assume that bread and bwrite set bfd_error.
6045         * bfd.c (struct bfd): Add "iovec", update comments.
6046         * bfd-in2.h, libbfd.h: Re-generate.
6047
6048 2004-04-21  Andrew Cagney  <cagney@redhat.com>
6049
6050         * libaout.h (enum machine_type): Add M_POWERPC_NETBSD.
6051
6052 2004-04-21  Eric Botcazou  <ebotcazou@act-europe.fr>
6053
6054         * elflink.c (elf_gc_mark_dynamic_ref_symbol): New function.
6055         (bfd_elf_gc_sections): Fail if a shared object is being created.
6056         Do not fail if dynamic sections have been created.  Instead call
6057         elf_gc_mark_dynamic_ref_symbol to mark sections that contain
6058         dynamically referenced symbols.  Do not mark the whole graph
6059         rooted at .eh_frame, only the section proper.
6060
6061 2004-04-20  DJ Delorie  <dj@redhat.com>
6062
6063         * reloc.c: Add BFD_RELOC_32_SECREL.
6064         * bfd-in2.h: Regenerate.
6065         * libbfd.h: Likewise.
6066         * coff-i386.c (howto_table) [COFF_WITH_PE]: Add R_SECREL32.
6067         (coff_i386_rtype_to_howto) [COFF_WITH_PE]: Handle it.
6068         (coff_i386_reloc_type_lookup) [COFF_WITH_PE]: Likewise.
6069
6070 2004-04-19  Jakub Jelinek  <jakub@redhat.com>
6071
6072         * elf32-sparc.c (elf32_sparc_relocate_section): Handle
6073         relocs against hidden/protected undefweak symbols properly.
6074         * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
6075
6076 2004-04-18  Mark Kettenis  <kettenis@gnu.org>
6077
6078         * libaout.h (enum machine_type): Add M_POWERPC_NETBSD.
6079         * netbsd-core.c (netbsd_core_file_p): Set architecture for PowerPC
6080         core files.
6081
6082 2004-04-17  Brian Ford  <ford@vss.fsi.com>
6083
6084         * peXXigen.c (_bfd_XXi_swap_aouthdr_out): Use the first non-zero
6085         filepos for the SizeOfHeaders field.
6086         (_bfd_XXi_swap_scnhdr_out): Correct section flags lossage on reloc
6087         overflow.
6088         (_bfd_XXi_swap_sym_in): Remove redundant section flags assignment.
6089
6090 2004-04-16  Alan Modra  <amodra@bigpond.net.au>
6091
6092         * simple.c (bfd_simple_get_relocated_section_contents): Don't
6093         change reloc_done.  Set and restore _cooked_size.
6094         (RETURN): Delete.
6095
6096 2004-04-15  Mark Kettenis  <kettenis@gnu.org>
6097
6098         * netbsd-core.c (netbsd_core_file_p): Set architecture for VAX
6099         core files.
6100
6101 2004-04-15  Nick Clifton  <nickc@redhat.com>
6102
6103         * bfd.c (bfd_archive_filename): Catch NULL bfd pointers.
6104
6105 2004-04-15  Alan Modra  <amodra@bigpond.net.au>
6106
6107         * elf64-sparc.c (sparc64_elf_check_relocs): Fix thinko last change.
6108
6109 2004-04-15  H.J. Lu  <hongjiu.lu@intel.com>
6110
6111         * elflink.c (_bfd_elf_merge_symbol): Treat weak as strong only
6112         when it is a definition.
6113
6114 2004-04-14  Alan Modra  <amodra@bigpond.net.au>
6115
6116         * elf32-sparc.c (elf32_sparc_relocate_section): Don't abort
6117         when statically linking PIC code.
6118         * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
6119
6120 2004-04-11  Thiemo Seufer  <seufer@csv.ica.uni-stuttgart.de>
6121
6122         * config.bfd: Remove mips*-*-mach3* and mips*-dec-mach3* targets.
6123         * configure.in: Remove mips-dec-bsd*, mips-dec-mach3*, mips-*-mach3*
6124         targets amd aout_mips_big_vec, aout_mips_little_vec target vectors.
6125         * configure: Regenerate.
6126
6127 2004-04-08  Richard Sandiford  <rsandifo@redhat.com>
6128
6129         * elflink.c: Include libiberty.h.
6130         * Makefile.am (elflink.lo): Depend on libiberty.h.
6131         * Makefile.in: Regenerate.
6132
6133 2004-04-06  Daniel Jacobowitz  <drow@mvista.com>
6134
6135         * elfxx-mips.c (MIPS_ELF_STUB_SECTION_NAME): Always use
6136         ".MIPS.stubs".
6137
6138 2004-04-05  H.J. Lu  <hongjiu.lu@intel.com>
6139
6140         * elfxx-ia64.c (elfNN_ia64_size_dynamic_sections): Always
6141         reserve the memory for dynamic linker
6142
6143 2004-04-05  Mark Kettenis  <kettenis@gnu.org>
6144
6145         * netbsd-core.c (CORE_WCOOKIE_OFFSET): New define.
6146         (netbsd_core_file_p): Create a .wcookie section for OpenBSD/sparc.
6147
6148 2004-04-02  H.J. Lu  <hongjiu.lu@intel.com>
6149
6150         * elf32-cr16c.c (elf32_cr16c_relocate_section): Use
6151         RELOC_FOR_GLOBAL_SYMBOL.
6152         (elf32_cr16c_add_symbol_hook): Remove const from Elf_Internal_Sym.
6153
6154 2004-04-02  H.J. Lu  <hongjiu.lu@intel.com>
6155
6156         * elf32-arm.h (elf32_arm_final_link_relocate): Handle
6157         R_ARM_ALU* only if OLD_ARM_ABI is not defined.
6158
6159 2004-04-01  Paul Brook  <paul@codesourcery.com>
6160
6161         * bfd-in.h (bfd_elf32_arm_process_before_allocation): Update.
6162         * elf32-arm.h (struct elf32_elf_section_map): New.
6163         (struct _arm_elf_section_data): New.
6164         (elf32_arm_section_data): Define.
6165         (struct elf32_arm_link_hash_table): Add byteswap_code.
6166         (elf32_arm_link_hash_table_create): Initialize byteswap_code.
6167         (bfd_elf32_arm_process_before_allocation): Add byteswap_code.
6168         (elf32_arm_post_process_headers): Set EF_ARM_BE8.
6169         (elf32_arm_output_symbol_hook, elf32_arm_new_section_hook,
6170         elf32_arm_compare_mapping, elf32_arm_write_section): New functions.
6171         (bfd_elf32_new_section_hook, elf_backend_write_section,
6172         elf_backend_link_output_symbol_hook): Define.
6173
6174 2004-04-01  Andy Chittenden  <achittenden@bluearc.com>
6175
6176         * stabs.c (struct stab_link_includes_totals): Add field 'symb'
6177         that keeps the characters in a B_INCL..B_EINCL range.
6178         (_bfd_link_section_stabs): When computing the sum of the
6179         characters in a B_INCL..B_EINCL range also keep a copy of those
6180         characters.  Use this information to distinguish between
6181         include sections that have the same sum and the same length
6182         but which are nevertheless unique.
6183
6184 2004-03-31  Paul Brook  <paul@codesourcery.com>
6185
6186         * elf32-arm.h (elf32_arm_final_link_relocate): Add R_ARM_ALU*.
6187         * elfarm-nabi.c (elf32_arm_howto_table): Ditto.
6188
6189 2004-03-31  Andy Chittenden <achittenden@bluearc.com>
6190
6191         * stabs.c (struct stab_link_includes_totals): Rename field 'total'
6192         to 'sum_chars' and add field 'num_chars'.
6193         (_bfd_link_section_stabs): When computing the sum of the
6194         characters in a B_INCL..B_EINCL range also keep a count of the
6195         number of characters.  Use this information to help distinguish
6196         between include sections when have the same sum but which
6197         nevertheless are still unique.
6198
6199 2004-03-31  Mattias EngdegÃ¥rd  <mattias@virtutech.se>
6200
6201         * stabs.c (_bfd_link_section_stabs): Do not skip N_EXCL stabs.
6202
6203 2004-03-30  Galit Heller  <Galit.Heller@nsc.com>
6204             Tomer Levi    <Tomer.Levi@nsc.com>
6205
6206         * Makefile.am (ALL_MACHINES): Add cpu-cr16c.lo.
6207         (ALL_MACHINES_CFILES): Add cpu-cr16c.c.
6208         (BFD32_BACKENDS): Add elf32-cr16c.lo.
6209         (BFD32_BACKENDS_CFILES): Add elf32-cr16c.c.
6210         (cpu-cr16c.lo): New target.
6211         (elf32-cr16c.lo): Likewise.
6212         * Makefile.in: Regenerate.
6213         * archures.c (bfd_architecture): Add bfd_{arch,mach}_cr16c.
6214         (bfd_archures_list): Add bfd_cr16c_arch.
6215         * config.bfd: Handle cr16c-*-elf*.
6216         * configure.in: Handle bfd_elf32_cr16c_vec.
6217         * configure: Regenerate.
6218         * reloc.c: Add BFD_RELOC_16C_NUM08, BFD_RELOC_16C_NUM08_C,
6219         BFD_RELOC_16C_NUM16, BFD_RELOC_16C_NUM16_C,
6220         BFD_RELOC_16C_NUM32, BFD_RELOC_16C_NUM32_C,
6221         BFD_RELOC_16C_DISP04, BFD_RELOC_16C_DISP04_C,
6222         BFD_RELOC_16C_DISP08, BFD_RELOC_16C_DISP08_C,
6223         BFD_RELOC_16C_DISP16, BFD_RELOC_16C_DISP16_C,
6224         BFD_RELOC_16C_DISP24, BFD_RELOC_16C_DISP24_C,
6225         BFD_RELOC_16C_DISP24a, BFD_RELOC_16C_DISP24a_C,
6226         BFD_RELOC_16C_REG04, BFD_RELOC_16C_REG04_C,
6227         BFD_RELOC_16C_REG04a, BFD_RELOC_16C_REG04a_C,
6228         BFD_RELOC_16C_REG14, BFD_RELOC_16C_REG14_C,
6229         BFD_RELOC_16C_REG16, BFD_RELOC_16C_REG16_C,
6230         BFD_RELOC_16C_REG20, BFD_RELOC_16C_REG20_C,
6231         BFD_RELOC_16C_ABS20, BFD_RELOC_16C_ABS20_C,
6232         BFD_RELOC_16C_ABS24, BFD_RELOC_16C_ABS24_C,
6233         BFD_RELOC_16C_IMM04, BFD_RELOC_16C_IMM04_C,
6234         BFD_RELOC_16C_IMM16, BFD_RELOC_16C_IMM16_C,
6235         BFD_RELOC_16C_IMM20, BFD_RELOC_16C_IMM20_C,
6236         BFD_RELOC_16C_IMM24, BFD_RELOC_16C_IMM24_C,
6237         BFD_RELOC_16C_IMM32, BFD_RELOC_16C_IMM32_C.
6238         * targets.c (bfd_elf32_cr16c_vec): Declare.
6239         (bfd_target_vector): Add bfd_elf32_cr16c_vec.
6240         * cpu-cr16c.c: New file.
6241         * elf32-cr16c.c: Likewise.
6242         * libbfd.h: Regenerate.
6243         * bfd-in2.h: Likewise.
6244
6245 2004-03-30  Jakub Jelinek  <jakub@redhat.com>
6246
6247         * elf.c (map_sections_to_segments): Fix handling of .tbss.
6248
6249 2004-03-27  Alan Modra  <amodra@bigpond.net.au>
6250
6251         * Makefile.am: Remove all mention of elflink.h.
6252         * Makefile.in: Regenerate.
6253         * bfd-in.h (bfd_elf_discard_info): Declare.
6254         (bfd_elf32_discard_info, bfd_elf64_discard_info): Delete.
6255         * bfd-in2.h: Regenerate.
6256         * elf-bfd.h (bfd_elf32_print_symbol, bfd_elf64_print_symbol,
6257         bfd_elf32_link_record_dynamic_symbol,
6258         bfd_elf64_link_record_dynamic_symbol,
6259         _bfd_elf_link_record_dynamic_symbol, bfd_elf32_bfd_final_link,
6260         bfd_elf64_bfd_final_link, elf_link_record_local_dynamic_symbol,
6261         _bfd_elf32_link_record_local_dynamic_symbol,
6262         _bfd_elf64_link_record_local_dynamic_symbol,
6263         _bfd_elf32_gc_sections, _bfd_elf32_gc_common_finalize_got_offsets,
6264         _bfd_elf32_gc_common_final_link, _bfd_elf64_gc_common_final_link,
6265         _bfd_elf32_gc_record_vtinherit, _bfd_elf32_gc_record_vtentry,
6266         _bfd_elf64_gc_sections, _bfd_elf64_gc_common_finalize_got_offsets,
6267         _bfd_elf64_gc_record_vtinherit, _bfd_elf64_gc_record_vtentry,
6268         _bfd_elf32_reloc_symbol_deleted_p,
6269         _bfd_elf64_reloc_symbol_deleted_p): Delete.
6270         (bfd_elf_link_record_dynamic_symbol,
6271         bfd_elf_link_record_local_dynamic_symbol,
6272         bfd_elf_final_link, bfd_elf_gc_sections,
6273         bfd_elf_gc_record_vtinherit, bfd_elf_gc_record_vtentry,
6274         bfd_elf_gc_common_finalize_got_offsets, bfd_elf_gc_common_final_link,
6275         bfd_elf_reloc_symbol_deleted_p): Declare.
6276         (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Define.
6277         * elf32-arm.h: Update for changed function names.  Remove local
6278         WILL_CALL_FINISH_DYNAMIC_SECTION define.
6279         * elf-hppa.h, elf-m10300.c, elf32-cris.c, elf32-d10v.c, elf32-dlx.c,
6280         * elf32-fr30.c, elf32-frv.c, elf32-h8300.c, elf32-hppa.c, elf32-i386.c,
6281         * elf32-iq2000.c, elf32-m32r.c, elf32-m68hc1x.c, elf32-m68k.c,
6282         * elf32-mcore.c, elf32-openrisc.c, elf32-ppc.c, elf32-s390.c,
6283         * elf32-sh.c, elf32-sparc.c, elf32-v850.c, elf32-vax.c,
6284         * elf32-xstormy16.c, elf32-xtensa.c, elf64-alpha.c, elf64-hppa.c,
6285         * elf64-mmix.c, elf64-ppc.c, elf64-s390.c, elf64-sh64.c, elf64-sparc.c,
6286         * elf64-x86-64.c, elfxx-ia64.c, elfxx-mips.c, elfxx-target.h: Likewise.
6287         * elfxx-target.h (bfd_elfNN_bfd_final_link): Define.
6288         (bfd_elfNN_print_symbol): Define.
6289         * elfcode.h: Don't include elflink.h.
6290         (elf_bfd_discard_info, elf_reloc_symbol_deleted_p,
6291         elf_link_record_dynamic_symbol, elf_bfd_final_link, elf_gc_sections,
6292         elf_gc_common_finalize_got_offsets, elf_gc_common_final_link,
6293         elf_gc_record_vtinherit, elf_gc_record_vtentry,
6294         elf_link_record_local_dynamic_symbol): Don't define.
6295         * elflink.c: Update for changed function names.  Move elflink.h
6296         code here.
6297         * elflink.h: Delete file.
6298         * po/SRC-POTFILES.in: Regenerate.
6299         * po/bfd.pot: Regenerate.
6300
6301 2004-03-27  Alan Modra  <amodra@bigpond.net.au>
6302
6303         * elf64-mmix.c (mmix_elf_relocate_section): Restore code setting
6304         "name" for global syms accidentally removed in 2004-03-20 change.
6305
6306 2004-03-27  Alan Modra  <amodra@bigpond.net.au>
6307
6308         * elf-bfd.h (struct elf_reloc_cookie): Add r_sym_shift field.
6309         * elflink.h: Replace all occurrences of sizeof (Elf_External_*)
6310         where Elf_External_* is different for 64 and 32 bit, with
6311         corresponding elf_size_info field.
6312         (struct elf_final_link_info): Use "bfd_byte *" instead
6313         of "Elf_External_Sym *" for external_syms and symbuf.
6314         (elf_link_adjust_relocs): Set up r_type_mask and r_sym_shift local
6315         vars and use instead of ELF_R_INFO and ELF_R_TYPE macros.
6316         (struct elf_link_sort_rela): Add "sym_mask" alias for "offset".
6317         (elf_link_sort_cmp1): Use sym_mask field instead of ELF_R_SYM.
6318         (elf_link_sort_cmp2): Adjust.
6319         (elf_link_sort_relocs): Set up r_sym_mask local var instead of
6320         using ELF_R_SYM macro.  Set u.sym_mask.
6321         (elf_bfd_final_link): Call _bfd_elf_stringtab_init instead of macro
6322         version, elf_stringtab_init.  Ditto for bfd_section_from_elf_index
6323         vs. section_from_elf_index.  Adjust Elf_External_Sym pointer
6324         arithmetic.  Pass bed to elf_link_flush_output_syms.  Adjust
6325         Elf_External_Dyn pointer arithmentic.  Use bed swap_dyn_in and
6326         swap_syn_out functions.  Rearrange dyn swap in/out switch.
6327         (elf_link_output_sym): Adjust Elf_External_Sym pointer arithmentic.
6328         Pass bed to elf_link_flush_output_syms.  Use bed swap_symbol_out.
6329         (elf_link_flush_output_syms): Add elf_backend_data arg.
6330         (elf_link_check_versioned_symbol): Likewise.
6331         (elf_link_output_extsym): Pass bed to elf_link_check_versioned_symbol.
6332         Adjust Elf_External_Sym pointer arithmetic.  Use bed swap_symbol_out.
6333         (elf_link_input_bfd): Use bfd_section_from_elf_index.  Set up
6334         r_type_mask and r_sym_shift local vars and use instead of ELF_R_SYM,
6335         ELF_R_TYPE and ELF_R_INFO macros.
6336         (elf_reloc_link_order): Select ELF32_R_INFO or ELF64_R_INFO invocation
6337         based on size rather than using ELF_R_INFO.
6338         (elf_gc_mark): Set up r_sym_shift local var and use instead of
6339         ELF_R_SYM macro.
6340         (struct alloc_got_off_arg): New.
6341         (elf_gc_common_finalize_got_offsets): Use elf_size_info instead of
6342         ARCH_SIZE.  Pass get entry size down to elf_gc_allocate_got_offsets.
6343         (elf_gc_allocate_got_offsets): Adjust.
6344         (elf_reloc_symbol_deleted_p): Usee cookie.r_sym_shift instead of
6345         ELF_R_SYM.  Use bfd_section_from_elf_index.
6346         (elf_bfd_discard_info): Set cookie.r_sym_shift.
6347         * elfcode.h (elf_stringtab_init, section_from_elf_index): Delete.
6348         (elf_slurp_symbol_table): Use bfd_section_from_elf_index.
6349
6350 2004-03-26  Stan Shebs  <shebs@apple.com>
6351
6352         Remove MPW support, no longer used.
6353         * config.bfd (powerpc-*-mpw*): Remove configuration.
6354         * mpw-config.in, mpw-make.sed: Remove files.
6355         * ecoffswap.h [MPW_C]: Remove MPW-C-friendly version of code.
6356
6357 2004-03-26  Alan Modra  <amodra@bigpond.net.au>
6358
6359         * elf64-ppc.c (elf_backend_add_symbol_hook): Define.
6360         (ppc64_elf_add_symbol_hook): New function.
6361         * elf-bfd.h (struct elf_backend_data <elf_add_symbol_hook>): Remove
6362         const from Elf_Internal_Sym param.
6363         * elflink.c (elf_link_add_object_symbols): Adjust.
6364         * elf-hppa.h (elf_hppa_add_symbol_hook): Adjust.
6365         * elf32-frv.c (elf32_frv_add_symbol_hook): Adjust.
6366         * elf32-i370.c (elf_backend_add_symbol_hook): Adjust.
6367         * elf32-m32r.c (m32r_elf_add_symbol_hook): Adjust.
6368         * elf32-m68hc1x.c (elf32_m68hc11_add_symbol_hook): Adjust.
6369         * elf32-m68hc1x.h (elf32_m68hc11_add_symbol_hook): Adjust.
6370         * elf32-ppc.c (ppc_elf_add_symbol_hook): Adjust.
6371         * elf32-sh64.c (sh64_elf_add_symbol_hook): Adjust.
6372         * elf32-v850.c (v850_elf_add_symbol_hook): Adjust.
6373         * elf64-alpha.c (elf64_alpha_add_symbol_hook): Adjust.
6374         * elf64-mmix.c (mmix_elf_add_symbol_hook): Adjust.
6375         * elf64-sh64.c (sh64_elf64_add_symbol_hook): Adjust.
6376         * elf64-sparc.c (sparc64_elf_add_symbol_hook): Adjust.
6377         * elfxx-ia64.c (elfNN_ia64_add_symbol_hook): Adjust.
6378         * elfxx-mips.c (_bfd_mips_elf_add_symbol_hook): Adjust.
6379         * elfxx-mips.h (_bfd_mips_elf_add_symbol_hook): Adjust.
6380
6381 2004-03-26  Alan Modra  <amodra@bigpond.net.au>
6382
6383         * elfxx-target.h (bfd_elfNN_bfd_link_add_symbols): Define.
6384         * elf-bfd.h (_bfd_elf_link_add_archive_symbols): Delete.
6385         (_bfd_elf_sort_symbol, _bfd_elf_add_dt_needed_tag): Delete.
6386         (_bfd_elf_finalize_dynstr, bfd_elf32_bfd_link_add_symbols): Delete.
6387         (bfd_elf64_bfd_link_add_symbols): Delete.
6388         (bfd_elf_link_add_symbols): Declare.
6389         * elfcode.h (elf_bfd_link_add_symbols): Delete.
6390         * elflink.c: Include safe-ctype.h.
6391         (elf_add_dt_needed_tag): Rename from _bfd_elf_add_dt_needed_tag,
6392         make static.
6393         (elf_sort_symbol): Rename from _bfd_elf_sort_symbol, make static.
6394         (elf_finalize_dynstr): Rename from _bfd_elf_finalize_dynstr, make
6395         static.
6396         (elf_link_add_archive_symbols): Rename from
6397         _bfd_elf_link_add_archive_symbols, make static.
6398         (elf_link_add_object_symbols): New function.  Corresponding
6399         elflink.h function converted to use elf_size_info.
6400         (bfd_elf_link_add_symbols): Likewise.
6401         (bfd_elf_size_dynamic_sections): Adjust.
6402         * elflink.h (elf_bfd_link_add_symbols): Delete.
6403         (elf_link_add_object_symbols): Delete.
6404         * elf32-gen.c (elf32_generic_link_add_symbols): Call
6405         bfd_elf_link_add_symbols.
6406         * elf64-gen.c (elf64_generic_link_add_symbols): Likewise.
6407
6408 2004-03-25  Alan Modra  <amodra@bigpond.net.au>
6409
6410         * elflink.h (elf_link_add_object_symbols): Add DT_NEEDED for as-needed
6411         and chained shared libs only if dynsym.  Clear dynsym on forced-local.
6412
6413         * elf-bfd.h (_bfd_elf_add_dynamic_entry): Declare.
6414         (bfd_elf32_add_dynamic_entry, bfd_elf64_add_dynamic_entry): Delete.
6415         (_bfd_elf_add_dt_needed_tag): Declare.
6416         (_bfd_elf_sort_symbol): Declare.
6417         (_bfd_elf_finalize_dynstr): Declare.
6418         (RELOC_FOR_GLOBAL_SYM): Formatting.
6419         * elfcode.h (elf_add_dynamic_entry): Delete.
6420         * elflink.c (_bfd_elf_add_dynamic_entry): New function.  Corresponding
6421         elflink.h function converted to use elf_size_info.
6422         (_bfd_elf_add_dt_needed_tag): Likewise.
6423         (_bfd_elf_sort_symbol): Likewise.
6424         (_bfd_elf_finalize_dynstr): Likewise.
6425         (compute_bucket_count): Likewise.
6426         (bfd_elf_size_dynamic_sections): Likewise.  Check result of
6427         _bfd_elf_strtab_add before calling _bfd_elf_strtab_addref.
6428         (elf_adjust_dynstr_offsets, elf_collect_hash_codes): Moved from..
6429         * elflink.h: ..here.
6430         (sort_symbol, add_dt_needed_tag): Delete.
6431         (elf_add_dynamic_entry, elf_finalize_dynstr): Delete.
6432         (compute_bucket_count, NAME(bfd_elf,size_dynamic_sections)): Delete.
6433         Update all users.
6434         * elf32-arm.h (add_dynamic_entry): Update.  Remove casts.
6435         * elf32-cris.c (add_dynamic_entry): Likewise.
6436         * elf32-hppa.c (add_dynamic_entry): Likewise.
6437         * elf32-i370.c (add_dynamic_entry): Likewise.
6438         * elf32-i386.c (add_dynamic_entry): Likewise.
6439         * elf32-m32r.c (add_dynamic_entry): Likewise.
6440         * elf32-m68k.c (add_dynamic_entry): Likewise.
6441         * elf32-ppc.c (add_dynamic_entry): Likewise.
6442         * elf32-s390.c (add_dynamic_entry): Likewise.
6443         * elf32-sh.c (add_dynamic_entry): Likewise.
6444         * elf32-sparc.c (add_dynamic_entry): Likewise.
6445         * elf32-vax.c (add_dynamic_entry): Likewise.
6446         * elf32-xtensa.c (add_dynamic_entry): Likewise.
6447         * elf64-alpha.c (add_dynamic_entry): Likewise.
6448         * elf64-hppa.c (add_dynamic_entry): Likewise.
6449         * elf64-ppc.c (add_dynamic_entry): Likewise.
6450         * elf64-s390.c (add_dynamic_entry): Likewise.
6451         * elf64-sparc.c (add_dynamic_entry): Likewise.
6452         * elf64-x86-64.c (add_dynamic_entry): Likewise.
6453         * elfxx-ia64.c (add_dynamic_entry): Likewise.
6454         * elfxx-mips.c (MIPS_ELF_ADD_DYNAMIC_ENTRY): Likewise.
6455         * elf-m10300.c (_bfd_mn10300_elf_size_dynamic_sections): Likewise.
6456         * elf32-frv.c (elf32_frv_size_dynamic_sections): Likewise.
6457         * elf64-sh64.c (sh64_elf64_size_dynamic_sections): Likewise.
6458
6459 2004-03-23  Paul Brook  <paul@codesourcery.com>
6460
6461         * elf32-arm.h (arm_print_private_bfd_data): Add EABI v3.
6462
6463 2004-03-22  Bob Wilson  <bob.wilson@acm.org>
6464
6465         * elf32-xtensa.c (elf_xtensa_check_relocs): Remove code to read
6466         literal tables and check for relocs outside of literal pools.
6467         (elf_xtensa_make_sym_local): Don't clear ELF_LINK_NON_GOT_REF flag.
6468         (elf_xtensa_fix_refcounts): Don't check ELF_LINK_NON_GOT_REF or
6469         set DF_TEXTREL.
6470         (elf_xtensa_size_dynamic_sections): Don't add DT_TEXTREL entry.
6471         (elf_xtensa_relocate_section): Read literal tables and check for
6472         dynamic relocations in read-only sections and not in literal pools.
6473
6474 2004-03-23  Alan Modra  <amodra@bigpond.net.au>
6475
6476         PR 51.
6477         * linker.c (bfd_wrapped_link_hash_lookup): Handle info->wrap_char.
6478
6479 2004-03-22  Hans-Peter Nilsson  <hp@axis.com>
6480
6481         * elf32-cris.c (cris_elf_relocate_section) <case R_CRIS_16_GOTPLT,
6482         R_CRIS_16_GOTPLT>: Also error if there's no PLT for a symbol
6483         not defined by the executable, or defined in a DSO.
6484         <eliding run-time relocation of .got>: Initialize GOT entry for a
6485         function symbol or ELF_LINK_HASH_NEEDS_PLT statically in an
6486         executable.
6487         (cris_elf_gc_sweep_hook): Improve fallthrough marking.
6488         (elf_cris_try_fold_plt_to_got): Improve head comment.  Do not fold
6489         a PLT reloc to GOT for an executable.
6490         (elf_cris_adjust_dynamic_symbol): Only fold a .got.plt entry with
6491         .got for a DSO and explain why.
6492         (elf_cris_discard_excess_program_dynamics): Also lose GOT-relocs
6493         and unreferenced symbols for which a PLT is defined.  Adjust
6494         dynamic-symbol pruning correspondingly, to make sure we don't lose
6495         a dynamic symbol also defined by a DSO.
6496
6497 2004-03-22  Alan Modra  <amodra@bigpond.net.au>
6498
6499         * elf-bfd.h (RELOC_FOR_GLOBAL_SYMBOL): Add input_bfd, input_section
6500         and rel args.  Group input and output args.  Wrap to 80 columns.
6501         * elf-m10200.c, elf-m10300.c, elf32-arm.h, elf32-avr.c,
6502         elf32-cris.c, elf32-d10v.c, elf32-fr30.c, elf32-h8300.c,
6503         elf32-hppa.c, elf32-i386.c, elf32-i860.c, elf32-ip2k.c,
6504         elf32-iq2000.c, elf32-m68hc1x.c, elf32-m68k.c, elf32-mcore.c,
6505         elf32-msp430.c, elf32-openrisc.c, elf32-ppc.c, elf32-s390.c,
6506         elf32-sparc.c, elf32-v850.c, elf32-vax.c, elf32-xstormy16.c,
6507         elf32-xtensa.c, elf64-alpha.c, elf64-mmix.c, elf64-ppc.c,
6508         elf64-s390.c, elf64-sparc.c, elf64-x86-64.c, elfxx-ia64.c: Update
6509         RELOC_FOR_GLOBAL_SYMBOL invocation.
6510
6511 2004-03-20  H.J. Lu  <hongjiu.lu@intel.com>
6512
6513         * elf-bfd.h (RELOC_FOR_GLOBAL_SYMBOL): Report error if
6514         unresolved symbols in objects aren't allowed.
6515
6516         * elf-hppa.h (elf_hppa_relocate_section): Properly handle
6517         unresolved symbols.
6518         (elf_hppa_remark_useless_dynamic_symbols): Likewise.
6519         (elf_hppa_unmark_useless_dynamic_symbols):
6520         * elf32-frv.c (elf32_frv_relocate_section): Likewise.
6521         * elf32-hppa.c (elf32_hppa_size_stubs): Likewise.
6522         (elf32_hppa_relocate_section): Likewise.
6523         * elf32-i370.c (i370_elf_relocate_section): Likewise.
6524         * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
6525         * elf32-sh.c (sh_elf_relocate_section): Likewise.
6526         * elf64-sh64.c (sh_elf64_relocate_section): Likewise.
6527         * elfxx-mips.c (mips_elf_calculate_relocation): Likewise.
6528
6529         * elf-m10200.c (mn10200_elf_relocate_section): Use
6530         RELOC_FOR_GLOBAL_SYMBOL.
6531         * elf32-avr.c (elf32_avr_relocate_section): Likewise.
6532         * elf32-d10v.c (elf32_d10v_relocate_section): Likewise.
6533         * elf32-fr30.c (fr30_elf_relocate_section): Likewise.
6534         * elf32-h8300.c (elf32_h8_relocate_section): Likewise.
6535         * elf32-i860.c (elf32_i860_relocate_section): Likewise.
6536         * elf32-m68hc1x.c (m68hc11_get_relocation_value): Likewise.
6537         * elf32-mcore.c (mcore_elf_relocate_section): Likewise.
6538         * elf32-msp430.c (elf32_msp430_relocate_section): Likewise.
6539         * elf32-openrisc.c (openrisc_elf_relocate_section): Likewise.
6540         * elf32-v850.c (v850_elf_relocate_section): Likewise.
6541         * elf32-xstormy16.c (xstormy16_elf_relocate_section): Likewise.
6542         * elf64-mmix.c (mmix_elf_relocate_section): Likewise.
6543
6544 2004-03-19  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
6545
6546         * elf32-hppa.c (elf32_hppa_check_relocs): Handle R_PARISC_PCREL32.
6547         (final_link_relocate): Likewise.
6548         * elf-hppa.h (elf_hppa_reloc_final_type): Handle selectors for
6549         R_PARISC_PCREL32 and R_PARISC_PCREL64 relocations.
6550
6551 2004-03-19  Alan Modra  <amodra@bigpond.net.au>
6552
6553         * Makefile.am: Run "make dep-am".
6554         * Makefile.in: Regenerate.
6555         * aclocal.m4: Regenerate.
6556         * config.in: Regenerate.
6557         * po/bfd.pot: Regenerate.
6558
6559 2004-03-19  Alan Modra  <amodra@bigpond.net.au>
6560             H.J. Lu  <hongjiu.lu@intel.com>
6561
6562         * elflink.c (_bfd_elf_merge_symbol): Revert last change.  Move
6563         type and size change code to where it was previously.  Remove
6564         dt_needed param.  Treat old weak syms as strong if new sym is
6565         from a shared lib, even when old sym is from another shared
6566         lib.  Remove unnecessary tests of oldweak and newweak.  Correct
6567         comments.
6568         (_bfd_elf_add_default_symbol): Remove dt_needed param.  Update
6569         _bfd_elf_merge_symbol calls.
6570         * elflink.h (elf_link_add_object_symbols): Update calls.  Remove
6571         dt_needed local var.  Update comments.
6572         * elf-bfd.h (_bfd_elf_merge_symbol): Update prototype.
6573         (_bfd_elf_add_default_symbol): Likewise.
6574
6575         * elflink.c (_bfd_elf_merge_symbol): Reinstate code to handle
6576         strong syms in one shared object overriding weak syms in another.
6577
6578 2004-03-18  Alan Modra  <amodra@bigpond.net.au>
6579
6580         * elf-bfd.h (struct elf_obj_tdata): Delete dt_soname field.  Add
6581         dyn_lib_class field.  Rearrange for better packing.
6582         (elf_dt_soname): Delete.
6583         (elf_dyn_lib_class): Define.
6584         * elf.c (bfd_elf_set_dt_needed_name): Update comment.
6585         (bfd_elf_set_dt_needed_soname): Delete.
6586         (bfd_elf_set_dyn_lib_class): New function.
6587         * elflink.h (add_dt_needed_tag): New function.  Split out from..
6588         (elf_link_add_object_symbols): ..here.  Rename "name" to "soname".
6589         Use elf_dyn_lib_class to set dt_needed and add_needed.  Move fallback
6590         initialization of soname.
6591         (elf_link_check_versioned_symbol): Test elf_dyn_lib_class instead of
6592         elf_dt_soname.
6593         * bfd-in.h (enum dynamic_lib_link_class): New.
6594         (bfd_elf_set_dt_needed_soname): Delete.
6595         (bfd_elf_set_dyn_lib_class): Declare.
6596         * bfd-in2.h: Regenerate.
6597
6598         * elflink.c (_bfd_elf_merge_symbol): Rewrite weak symbol handling.
6599         (_bfd_elf_add_default_symbol): Remove indirect BFD_ASSERTs.
6600         * elflink.h (elf_link_add_object_symbols): Don't clear dt_needed in
6601         symbol loop.  Instead use add_needed to flag tag as written.
6602
6603 2004-03-17  Nathan Sidwell  <nathan@codesourcery.com>
6604
6605         * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Correct
6606         logic for null_input_bfd detection.
6607
6608 2004-03-17  Ralf Corsepius <corsepiu@faw.uni-ulm.de>
6609
6610         * config.bfd: Switch sh-*-rtems* to ELF.  Add sh-*-rtemscoff*.
6611
6612 2004-03-16  Mark Kettenis  <kettenis@gnu.org>
6613
6614         * netbsd-core.c (netbsd_core_file_p) [CORE_FPU_OFFSET]: Remove
6615         code.
6616
6617 2004-03-16  Alan Modra  <amodra@bigpond.net.au>
6618
6619         * elflink.c (elf_link_read_relocs_from_section): Don't use
6620         NUM_SHDR_ENTRIES in end of reloc calc.  Move NULL shdr check..
6621         (_bfd_elf_link_read_relocs): ..to here.
6622         * elf32-ppc.c (ppc_elf_relax_section): Formatting.
6623
6624 2004-03-16  Alan Modra  <amodra@bigpond.net.au>
6625
6626         * configure.in (HOST_64BIT_TYPE, HOST_U_64BIT_TYPE): Don't override
6627         values selected in configure.host.  Require both to be defined
6628         before setting BFD_HOST_64_BIT_DEFINED.  Protect assignment to
6629         corresponding BFD_HOST vars with quotes.
6630         <${host64}-${target64}-${want64} in *true*>: Don't exempt gcc;
6631         Always require BFD_HOST_64_BIT_DEFINED.
6632         <file_ptr type>: Find off_t size before emitting message.  Combine
6633         off_t and ftello64 conditional.
6634         * configure: Regenerate.
6635
6636 2004-03-16  Alan Modra  <amodra@bigpond.net.au>
6637
6638         * elf32-m32r.c (m32r_elf_create_dynamic_sections): Fix pointer
6639         aliasing warning.  Remove trailing whitespace throughout file.
6640
6641 2004-03-15  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
6642
6643         * elf-hppa.h (elf_hppa_relocate_section): Pass input_bfd instead of
6644         input_section in calls to get_dyn_name.
6645         * elf64-hppa.c (get_dyn_name): Change type of first argument to "bfd *".        Use section id of first section in input BFD to build dynamic name for
6646         local symbols.
6647         (elf64_hppa_check_relocs): Pass abfd in call to get_dyn_name.
6648
6649 2004-03-15  Alan Modra  <amodra@bigpond.net.au>
6650
6651         * bfd-in.h (bfd_int64_t, bfd_uint64_t): New types.
6652         (BFD_HOST_64_BIT, BFD_HOST_U_64_BIT): Don't define here.
6653         (bfd_getb64, bfd_getl64, bfd_get_bits): Return bfd_uint64_t.
6654         (bfd_getb_signed_64, bfd_getl_signed_64): Return bfd_int64_t.
6655         (bfd_putb64, bfd_putl64, bfd_put_bits): Accept bfd_uint64_t.
6656         * configure.in (HOST_U_64BIT_TYPE): Set when sizeof long is 8.
6657         (BFD_HOST_64_BIT_DEFINED, BFD_HOST_64_BIT, BFD_HOST_U_64_BIT): Set
6658         when using long.
6659         * libbfd.c (EIGHT_GAZILLION, COERCE64): Use bfd_int64_t.
6660         (bfd_getb64): Return bfd_uint64_t.  Enable when BFD_HOST_64_BIT.
6661         (bfd_getl64, bfd_getb_signed_64, bfd_getl_signed_64): Likewise.
6662         (bfd_putb64): Accept bfd_uint64_t.  Enable when BFD_HOST_64_BIT.
6663         (bfd_putl64, bfd_put_bits, bfd_get_bits): Likewise.
6664         * dwarf2.c (struct attribute): Use bfd_int64_t and bfd_uint64_t.
6665         (read_8_bytes, read_indirect_string, read_address): Likewise.
6666         (read_abbrevs, parse_comp_unit): Likewise.
6667         * targets.c (struct bfd_target): Likewise.
6668         * aix386-core.c (NO_GET64, NO_PUT64, NO_GETS64): Define and use.
6669         * hppabsd-core.c: Likewise.  Formatting.
6670         * hpux-core.c: Likewise.
6671         * irix-core.c: Likewise.
6672         * netbsd-core.c: Likewise.
6673         * osf-core.c: Likewise.
6674         * ptrace-core.c: Likewise.
6675         * sco5-core.c: Likewise.
6676         * trad-core.c: Likewise.
6677         * configure: Regenerate.
6678         * bfd-in2.h: Regenerate.
6679
6680 2004-03-15  Alan Modra  <amodra@bigpond.net.au>
6681
6682         * bfd-in.h (bfd_getb64, bfd_getl64): Replace bfd_byte* with void*.
6683         (bfd_getb32, bfd_getl32, bfd_getb16, bfd_getl16): Likewise.
6684         (bfd_getb_signed_64, bfd_getl_signed_64): Likewise.
6685         (bfd_getb_signed_32, bfd_getl_signed_32): Likewise.
6686         (bfd_getb_signed_16, bfd_getl_signed_16): Likewise.
6687         (bfd_putb64, bfd_putl64, bfd_putb32, bfd_putl32): Likewise.
6688         (bfd_putb16, bfd_putl16, bfd_get_bits, bfd_put_bits): Likewise.
6689         * libbfd.c: Likewise in function definitions.
6690         (bfd_put_8): Mask with 0xff rather than casting to char.
6691         (bfd_putb16, bfd_putl16, bfd_putb32, bfd_putl32): Likewise.
6692         (bfd_putb64, bfd_putl64, bfd_put_bits): Likewise.
6693         (H_PUT_64, H_PUT_32, H_PUT_16, H_PUT_8): Remove casts, simplify.
6694         (H_PUT_S64, H_PUT_S32, H_PUT_S16, H_PUT_S8): Likewise.
6695         (H_GET_64, H_GET_32, H_GET_16, H_GET_8): Likewise.
6696         (H_GET_S64, H_GET_S32, H_GET_S16, H_GET_S8): Likewise.
6697         * libaout.h (H_PUT_64 H_PUT_32, H_PUT_16): Remove casts, simplify.
6698         (H_PUT_S64, H_PUT_S32, H_PUT_S16): Likewise.
6699         (H_GET_64, H_GET_32, H_GET_16): Likewise.
6700         (H_GET_S64, H_GET_S32, H_GET_S16): Likewise.
6701         * archive.c (do_slurp_coff_armap): Update swap prototype.
6702         * coff-tic54x.c (tic54x_getl32): Replace bfd_byte* with void*.
6703         (tic54x_getl_signed_32): Likewise.
6704         (tic54x_putl32): Likewise.  Mask with 0xff rather than casting to char.
6705         * mach-o.c (bfd_mach_o_read_header): Update get32 prototype.
6706         * pdp11.c (bfd_getp32): Make static, replace bfd_byte* with void*.
6707         (bfd_getp_signed_32, bfd_putp32): Likewise.
6708         * targets.c (struct bfd_target): Use void* in place of bfd_byte* for
6709         bfd_getx64, bfd_getx_signed_64, bfd_putx64, bfd_getx32,
6710         bfd_getx_signed_32, bfd_putx32, bfd_getx16, bfd_getx_signed_16,
6711         bfd_putx16, bfd_h_getx64, bfd_h_getx_signed_64, bfd_h_putx64,
6712         bfd_h_getx32, bfd_h_getx_signed_32, bfd_h_putx32, bfd_h_getx16,
6713         bfd_h_getx_signed_16, bfd_h_putx16.
6714         * aix386-core.c (NO_GET, NO_GETS, NO_PUT): Update prototypes.
6715         * hppabsd-core.c: Similarly.  Rename NO_SIGNED_GET to NO_GETS.
6716         * hpux-core.c: Likewise.
6717         * irix-core.c: Likewise.
6718         * netbsd-core.c: Likewise.
6719         * osf-core.c: Likewise.
6720         * ptrace-core.c: Likewise.
6721         * sco5-core.c: Likewise.
6722         * trad-core.c: Likewise.
6723         * bfd-in2.h: Regenerate.
6724
6725 2004-03-15  Matt Thomas  <matt@3am-software.com>
6726
6727         * config.bfd: Add x86-64 vector to NetBSD/i386 if 64bit BFD is
6728         selected.
6729
6730 2004-03-13  Mark Kettenis  <kettenis@gnu.org>
6731
6732         * config.bfd: Add x86_64-*-openbsd*.
6733         * configure.in (x86_64-*-openbsd*): Set COREFILE to
6734         netbsd-core.lo.
6735         * configure: Regenerate.
6736
6737 2004-03-12  Nick Clifton  <nickc@redhat.com>
6738             Dave Murphy  <wintermute2k4@ntlworld.com>
6739
6740         * elf32-arm.h (elf32_arm_merge_private_bfd_data): Skip most checks
6741         if the input bfd does not contain any code.
6742
6743 2004-03-09  Steve Ellcey  <sje@cup.hp.com>
6744
6745         * elfxx-ia64.c (plt_full_entry): Change ld8 to ld8.acq.
6746
6747 2004-03-05  Fred Fish  <fnf@redhat.com>
6748
6749         * elfxx-mips.c (_bfd_mips_elf_finish_dynamic_symbol): Just force
6750         mips16 symbols to be even rather than testing first for even/odd.
6751         (_bfd_mips_elf_link_output_symbol_hook): Ditto.
6752
6753 2004-03-05  Nathan Sidwell  <nathan@codesourcery.com>
6754
6755         * elf.c (map_sections_to_segments): Ignore .tbss sections for
6756         layout purposes.
6757
6758 2004-03-03  Alexandre Oliva  <aoliva@redhat.com>
6759
6760         * elflink.c (bfd_elf_record_link_assignment): Mark undefweak and
6761         undefined symbols as hash_new.
6762
6763 2003-03-03  Andrew Stubbs  <andrew.stubbs@superh.com>
6764
6765         * archures.c: Add bfd_mach_sh4_nommu_nofpu.
6766         * cpu-sh.c: Ditto.
6767         * elf32-sh.c: Ditto.
6768         * bfd-in2.h: Regenerate.
6769
6770 2004-03-02  Alexandre Oliva  <aoliva@redhat.com>
6771
6772         * elf32-frv.c (struct frv_pic_relocs_info): Added fixups and
6773         dynrelocs.
6774         (_frv_count_got_plt_entries): Initialize them.
6775         (frv_pic_relocs_info_find): Add insert argument.  Adjust all
6776         callers.
6777         (frv_pic_relocs_info_for_global): Likewise.
6778         (frv_pic_relocs_info_for_local): Likewise.
6779         (frv_pic_merge_early_relocs_info): New.
6780         (_frv_resolve_final_relocs_info): Use it in case one entry maps to
6781         another.
6782         (_frv_add_dyn_reloc): Add entry argument.  Adjust all callers.
6783         Check that we don't exceed the allocated count for entry.
6784         (_frv_add_rofixup): Likewise.
6785         (_frv_emit_got_relocs_plt_entries): Adjust for coding standards.
6786         (elf32_frv_finish_dynamic_sections): Improve error message in case
6787         we emit too few rofixup entries.
6788
6789 2004-03-01  Richard Sandiford  <rsandifo@redhat.com>
6790
6791         * archures.c (bfd_mach_fr450): New.
6792         * bfd-in2.h: Regenerate.
6793         * cpu-frv.c (arch_info_450): New bfd_arch_info_type.
6794         (arch_info_500): Link to it.
6795         * elf32-frv.c (elf32_frv_machine, frv_elf_merge_private_bfd_data)
6796         (frv_elf_print_private_bfd_data): Handle fr405 and fr450 header flags.
6797         (frv_elf_arch_extension_p): New function.
6798         (frv_elf_merge_private_bfd_data): Use it.
6799
6800 2004-02-28  H.J. Lu  <hongjiu.lu@intel.com>
6801
6802         * elf-bfd.h (_bfd_elf_link_add_archive_symbols): New prototype.
6803
6804         * elflink.h (is_global_data_symbol_definition): Moved to
6805         elflink.c.
6806         (elf_link_is_defined_archive_symbol): Likewise.
6807         (elf_link_add_archive_symbols): Likewise. Renamed to
6808         _bfd_elf_link_add_archive_symbols.
6809
6810         * elflink.c (elf_link_is_defined_archive_symbol): Get the size
6811         of ELF symbol table entry from backend.
6812         (_bfd_elf_link_add_archive_symbols): Call bfd_link_add_symbols
6813         instead of elf_link_add_object_symbols.
6814
6815 2004-02-27  Alexandre Oliva  <aoliva@redhat.com>
6816
6817         * elf-bfd.h (struct elf_backend_data): Added
6818         elf_backend_can_make_relative_eh_frame,
6819         elf_backend_can_make_lsda_relative_eh_frame and
6820         elf_backend_encode_eh_address.
6821         (_bfd_elf_encode_eh_address): Declare.
6822         (_bfd_elf_can_make_relative): Declare.
6823         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Use new
6824         hooks to decide whether to attempt to make_relative and
6825         make_lsda_relative.
6826         (_bfd_elf_write_section_eh_frame_hdr): Call encode_eh_address.
6827         (_bfd_elf_can_make_relative): New.
6828         (_bfd_elf_encode_eh_address): New.
6829         * elf32-frv.c (frv_elf_use_relative_eh_frame): New.
6830         (frv_elf_encode_eh_address): New.
6831         (elf_backend_can_make_relative_eh_frame): Define.
6832         (elf_backend_can_make_lsda_relative_eh_frame): Define.
6833         (elf_backend_encode_eh_address): Define.
6834         * elfxx-target.h
6835         (elf_backend_can_make_relative_eh_frame): Define.
6836         (elf_backend_can_make_lsda_relative_eh_frame): Define.
6837         (elf_backend_encode_eh_address): Define.
6838         (elfNN_bed): Add them.
6839
6840 2004-02-27  Alexandre Oliva  <aoliva@redhat.com>
6841
6842         * elf32-frv.c (elf32_frv_howto_table) <R_FRV_LABEL16>: Set
6843         complain_on_overflow to signed.
6844
6845 2004-02-27  H.J. Lu  <hongjiu.lu@intel.com>
6846
6847         * elflink.h (sort_symbol): New.
6848         (elf_link_add_object_symbols): Use a sorted symbol array for
6849         weakdef.
6850
6851 2004-02-27  Jakub Jelinek  <jakub@redhat.com>
6852
6853         * elf32-s390.c (allocate_dynrelocs): Use SYMBOL_REFERENCES_LOCAL
6854         for pc relative relocs.
6855         (elf_s390_relocate_section): Likewise.
6856         * elf64-s390.c (allocate_dynrelocs): Use SYMBOL_REFERENCES_LOCAL
6857         for pc relative relocs.
6858         (elf_s390_relocate_section): Likewise.
6859
6860 2004-02-26  H.J. Lu  <hongjiu.lu@intel.com>
6861
6862         * elfxx-ia64.c (elfNN_ia64_check_relocs): Fix call to
6863         count_dyn_reloc.
6864
6865 2004-02-25  H.J. Lu  <hongjiu.lu@intel.com>
6866
6867         * elfxx-ia64.c (elfNN_ia64_dyn_reloc_entry): Add the reltext.
6868         field to track if a relocation is against readonly section.
6869         (count_dyn_reloc): Take a new argument for rent->reltext.
6870         (elfNN_ia64_check_relocs): Adjust call to count_dyn_reloc.
6871         (get_reloc_section): Don't set ia64_info->reltext here.
6872         (allocate_dynrel_entries): Set ia64_info->reltext here.
6873
6874 2004-02-24  Alexandre Oliva  <aoliva@redhat.com>
6875
6876         * elf32-frv.c (FRV_SYM_LOCAL): Weak undefined doesn't imply local.
6877         (_frv_emit_got_relocs_plt_entries): Decay relocation to protected
6878         function's descriptor to symbol+offset, and map local undefweak
6879         symbol to NULL function descriptor.
6880         (elf32_frv_relocate_section): Likewise.
6881
6882 2004-02-23  Mark Kettenis  <kettenis@gnu.org>
6883
6884         * libaout.h (enum machine_type): Add M_SPARC64_NETBSD and
6885         M_X86_64_NETBSD.
6886         * netbsd-core.c (M_SPARC64_OPENBSD): Define.
6887         (netbsd_core_file_p): Set architecture from machine ID for
6888         selected machines.
6889
6890 2004-02-23  Jakub Jelinek  <jakub@redhat.com>
6891
6892         * elflink.h (size_dynamic_sections): If not adding DT_FLAGS and
6893         DF_BIND_NOW is set in info->flags, create DT_BIND_NOW dynamic entry.
6894
6895 2004-02-21  H.J. Lu  <hongjiu.lu@intel.com>
6896
6897         * elflink.c (_bfd_elf_merge_symbol): Properly handle undefined
6898         symbols with non-default visibility.
6899
6900 2004-02-21  Danny Smith  <daanysmith@users.sourceforge.net>
6901
6902         * peXXigen.c (_bfd_XXi_swap_scnhdr_out): Clear
6903         IMAGE_SCN_MEM_WRITE on known sections only.
6904
6905 2004-02-20  Jakub Jelinek  <jakub@redhat.com>
6906
6907         * elf32-ppc.c (allocate_dynrelocs): Create dynsym for undef weak
6908         symbols used in PIE relocs.
6909
6910 2004-02-19  Jakub Jelinek  <jakub@redhat.com>
6911
6912         * elf32-sparc.c (elf32_sparc_finish_dynamic_sections): Clear
6913         .plt sh_entsize.
6914
6915 2004-02-18  Daniel Jacobowitz  <drow@mvista.com>
6916
6917         * configure.in: Update version to 2.15.90.
6918         * configure: Regenerate.
6919
6920 2004-02-17  Daniel Jacobowitz  <drow@mvista.com>
6921             Richard Sandiford  <rsandifo@redhat.com>
6922
6923         * elfxx-mips.c (mips_elf_calculate_relocation): Use
6924         _bfd_elf_symbol_refs_local_p to decide whether to decay
6925         a GOT_PAGE/GOT_OFST pair to GOT_DISP/addend.
6926         (_bfd_mips_elf_check_relocs): Add a global GOT entry for GOT_PAGE
6927         relocs if the symbol wasn't defined by a regular object file.
6928         Don't check the symbol's dynindx.
6929
6930 2004-02-16  Andrew Cagney  <cagney@redhat.com>
6931
6932         * bfd-in.h (file_ptr, ufile_ptr): Configure type using
6933         @bfd_file_ptr@.
6934         * bfd-in2.h: Re-generate.
6935
6936 2004-02-14  Andrew Cagney  <cagney@redhat.com>
6937
6938         * configure.host (HDEFINES): When hppa*-*-hpux*, define
6939         _LARGEFILE64_SOURCE.
6940
6941 2004-02-13  Andrew Cagney  <cagney@redhat.com>
6942
6943         * elf.c (vma_page_aligned_bias): New function.
6944         (assign_file_positions_except_relocs)
6945         (assign_file_positions_for_segments): Replace broken modulo
6946         arithmetic with call to vma_page_aligned_bias.
6947
6948 2004-02-11  Andrew Cagney  <cagney@redhat.com>
6949
6950         * bfd-in.h: Update copyright.
6951         (bfd_tell): Change return type to file_ptr.
6952         * bfd-in2.h: Re-generate.
6953         * cache.c: Update copyright.
6954         (bfd_cache_lookup_worker): Use real_fseek, do not cast offset
6955         parameter.
6956         (close_one): Use real_ftell.
6957         * bfdio.c: Update copyright.
6958         (real_ftell, real_fseek): New functions.
6959         (bfd_tell): Use real_fseek and real_ftell, change return type to
6960         file_ptr.
6961         (bfd_seek): Use real_ftell and real_fseek, change type of
6962         file_position to a file_ptr.
6963         * libbfd-in.h: Update copyright.
6964         (real_ftell, real_fseek): Declare.
6965         * libbfd.h: Re-generate.
6966
6967         * configure.in (AC_CHECK_FUNCS): Check for ftello, ftello64,
6968         fseeko and fseeko64.  Determine bfd_file_ptr.
6969         * configure: Re-generate.
6970         * config.in: Re-generate.
6971
6972 2004-02-09  Anil Paranjpe  <anilp1@KPITCummins.com>
6973
6974         * coff-h8300.c: Added comments about relaxation for ldc.w and stc.w.
6975         * elf32-h8300.c: Likewise.
6976
6977 2004-02-09  Christian Vogel <vogelchr@vogel.cx>
6978             Nick Clifton  <nickc@redhat.com>
6979
6980         * elf64-alpha.c (elf64_alpha_calc_got_offsets_for_symbol): Catch
6981         GOT entries with no associated GOT subsection.
6982
6983 2004-02-09  Richard Sandiford  <rsandifo@redhat.com>
6984
6985         * bfd-elf.h (elf_backend_name_local_section_symbols): New hook.
6986         * elf.c (swap_out_syms): Use it to decide whether local section
6987         symbols should be named.
6988         * elfxx-target.h (elf_backend_name_local_section_symbols): New macro.
6989         * elfxx-mips.h (_bfd_mips_elf_name_local_section_symbols): Declare.
6990         (elf_backend_name_local_section_symbols): Define.
6991         * elfxx-mips.c (_bfd_mips_elf_name_local_section_symbols): New.
6992
6993 2004-01-30  H.J. Lu  <hongjiu.lu@intel.com>
6994
6995         * elfxx-ia64.c (elfNN_ia64_relax_brl): New function.
6996         (elfNN_ia64_relax_section): Optimize brl to br during the relax
6997         finalize pass.
6998
6999 2004-01-30  Alexandre Oliva  <aoliva@redhat.com>
7000
7001         * elf32-frv.c (elf32_frv_always_size_sections): Initialize pointer
7002         to bfd_link_hash_entry passed by reference to
7003         _bfd_generic_link_add_one_symbol.
7004
7005 2004-01-25  H.J. Lu  <hongjiu.lu@intel.com>
7006
7007         * elfxx-ia64.c (elfNN_ia64_relocate_section): Disallow imm
7008         relocations against dynamic symbols.
7009
7010 2004-01-23  Daniel Jacobowitz  <drow@mvista.com>
7011
7012         * elf32-arm.h (elf32_arm_check_relocs): Revert part of 2004-01-13
7013         change.
7014
7015 2004-01-21  Tom Rix  <tcrix@worldnet.att.net>
7016
7017         * reloc.c: New 5 bit reloc, BFD_RELOC_M68HC12_5B, for m68hc12 movb/movw.
7018         * bfd-in2.h, libbfd.h: Rebuilt.
7019
7020 2004-01-20  Danny Smith  <dannysmith@users.sourceforge.net>
7021
7022         * peXXigen.c (_bfd_XXi_swap_scnhdr_out): Don't remove
7023         IMAGE_SCN_MEM_WRITE flag from .text section if WP_TEXT
7024         flag has been cleared.
7025
7026 2004-01-19  Kazu Hirata  <kazu@cs.umass.edu>
7027
7028         * coff-h8300.c: Add and adjust comments about relaxation.
7029         * elf32-h8300.c: Likewise.
7030
7031 2004-01-16  Kazu Hirata  <kazu@cs.umass.edu>
7032
7033         * coff-h8300.c: Fix comment typos.
7034         * elf32-h8300.c: Likewise.
7035
7036 2004-01-16  Kazu Hirata  <kazu@cs.umass.edu>
7037
7038         * coff-h8300.c: Add comments about relaxation.
7039         * elf32-h8300.c: Likewise.
7040
7041 2004-01-14  Maciej W. Rozycki  <macro@ds2.pg.gda.pl>
7042
7043         * acinclude.m4: Quote names of macros to be defined by AC_DEFUN
7044         throughout.
7045         * aclocal.m4: Regenerate.
7046         * configure: Regenerate.
7047
7048 2004-01-13  Ian Lance Taylor  <ian@wasabisystems.com>
7049
7050         * elf64-mips.c (mips_elf64_slurp_one_reloc_table): Call
7051         mips_elf64_rtype_to_howto instead of using howto_table.
7052
7053 2004-01-13  Daniel Jacobowitz  <drow@mvista.com>
7054
7055         * elf32-arm.h (elf32_arm_final_link_relocate): Check that we created
7056         the .plt section.
7057         (elf32_arm_check_relocs): Don't increment the PLT refcount for
7058         relocs which would not use the PLT.
7059
7060 2004-01-13  Alan Modra  <amodra@bigpond.net.au>
7061
7062         * elf64-ppc.c (ppc64_elf_check_relocs): Ignore !SEC_ALLOC relocs.
7063         (ppc64_elf_gc_sweep_hook): Likewise.
7064         (ppc64_elf_size_dynamic_sections): Test for .plt directly.
7065
7066 2004-01-12  Anil Paranjpe  <anilp1@KPITCummins.com>
7067
7068         Adds linker relaxation support for bit manipulation insns like
7069         band, bclr, biand, bild, bior, bist, bixor, bld, bnot, bor, bset,
7070         bst, btst, bxor.
7071         * elf32-h8300.c: Opcode for bit manipulation insn is checked in
7072         elf32_h8_relax_section function while relxation for aa:16 and aa:32.
7073         * coff-h8300.c: Opcode for bit manipulation insn is checked in
7074         h8300_reloc16_extra_cases function while relxation for aa:16 and aa:32.
7075
7076 2004-01-12  Alan Modra  <amodra@bigpond.net.au>
7077
7078         * dwarf2.c: Convert to C90, remove unneeded casts and prototypes.
7079
7080 2004-01-11  Kazu Hirata  <kazu@cs.umass.edu>
7081
7082         * elf32-h8300.c: Fix formatting.
7083
7084 2004-01-11  Kazu Hirata  <kazu@cs.umass.edu>
7085
7086         * elf32-cris.c (cris_elf_gc_sweep_hook): Return early if no
7087         dynamic object is present.  Declare r_symndx and h in an inner
7088         scope.
7089         * elf32-vax.c (elf_vax_gc_sweep_hook): Likewise.
7090
7091 2004-01-09  Daniel Jacobowitz  <drow@mvista.com>
7092
7093         * elf32-arm.h (struct elf32_arm_relocs_copied): Remove pc_count.
7094         (elf32_arm_copy_indirect_symbol): Don't copy pc_count.
7095         (elf32_arm_final_link_relocate): Handle PLT32 and PC24 relocs
7096         identically.  Do not emit PC24 relocations for shared libraries.
7097         (elf32_arm_gc_sweep_hook): Handle PLT32 and PC24 relocs
7098         identically.  Don't adjust pc_count.
7099         (elf32_arm_check_relocs): Handle PLT32 and PC24 relocs identically.
7100         Set ELF_LINK_HASH_NEEDS_PLT for both.  Don't adjust pc_count; don't
7101         adjust count for branch relocations.
7102         (allocate_dynrelocs): Correct typo in call to
7103         WILL_CALL_FINISH_DYNAMIC_SYMBOL.  Never allocate space for
7104         PC24 or PLT32 relocs when linking.
7105
7106 2004-01-09  Dmitry Semyonov  <Dmitry.Semyonov@oktet.ru>
7107
7108         * coff-arm.c (aoutarm_std_reloc_howto): [ARM_WINCE] Synchronize ARM_26D
7109         relocation howto with ARM_26 one for consistency.
7110         (coff_arm_relocate_section): Set partial_inplace for ARM_26 relocations
7111         that will be converted to ARM_26D ones, since we always want 'done'
7112         relocations to be reflected in section's data.
7113         (coff_arm_relocate_section): [ARM_WINCE] Quick fix for BL instruction
7114         offset.
7115         (_bfd_final_link_relocate): Do not modify "inplace" data, if not
7116         requested.
7117
7118 2004-01-08  Dmitry Semyonov  <Dmitry.Semyonov@oktet.ru>
7119
7120         * coff-arm.c (coff_arm_relocate_section): Do not alter relocs that
7121         are not partial_inplace during a relocatable link.
7122
7123 2004-01-08  Kazu Hirata  <kazu@cs.umass.edu>
7124
7125         * elf32-m68k.c (elf_m68k_gc_sweep_hook): Return early
7126         if no dynamic object is present.  Declare r_symndx and h in an
7127         inner scope.
7128
7129 2004-01-07  H.J. Lu  <hongjiu.lu@intel.com>
7130
7131         * elfxx-ia64.c (elfNN_ia64_relax_section): Don't install
7132         trampoline if it is known out of range.
7133
7134 2004-01-06  Alexandre Oliva  <aoliva@redhat.com>
7135
7136         2003-12-17  Alexandre Oliva  <aoliva@redhat.com>
7137         * elf32-frv.c (_frv_osec_readonly_p): New.
7138         (_frv_emit_got_relocs_plt_entries): Don't emit rofixup for
7139         undefweak symbol.
7140         (_frv_count_got_plt_entries): Adjust expected count accordingly.
7141         (elf32_frv_relocate_section): Likewise.  Error out if attempting
7142         to emit rofixups or dynamic relocs in read-only segments.  Use
7143         _bfd_elf_section_offset to adjust r_offsets in rofixups and
7144         dynamic relocations.
7145         2003-12-12  Alexandre Oliva  <aoliva@redhat.com>
7146         * elf32-frv.c (elf32_frv_relocate_section): Compute dynamic
7147         relocations or fixups involving merged sections correctly.  Avoid
7148         crash when undefined symbol is referenced by R_FRV_32 or
7149         R_FRV_FUNCDESC_VALUE.
7150         2003-12-02  Alexandre Oliva  <aoliva@redhat.com>
7151         * elf32-frv.c (elf32_frv_relocate_section): Add output_offset of
7152         input section holding local symbol to addend of R_FRV_32 or
7153         R_FRV_FUNCDESC_VALUE dynamic relocation.
7154         2003-11-27  Alexandre Oliva  <aoliva@redhat.com>
7155         * elf32-frv.c (elf32_frv_modify_segment_map): Add link info arg.
7156         (elf32_frv_always_size_sections): Don't store pointer to
7157         __stacksize symbol in sec_info.
7158         (elf32_frv_modify_segment_map): Look it up here.
7159         2003-11-26  Alexandre Oliva  <aoliva@redhat.com>
7160         * elf32-frv.c (_frv_emit_got_relocs_plt_entries): Emit the address
7161         of the lazy PLT entry, not only its offset, as the low word of a
7162         function descriptor.
7163         2003-11-10  Alexandre Oliva  <aoliva@redhat.com>
7164         * elf32-frv.c (elf32_frv_always_size_sections): Define __stacksize
7165         if a hash table entry already exists but is not a definition.
7166         2003-11-05  Alexandre Oliva  <aoliva@redhat.com>
7167         * elf32-frv.c (frv_elf_link_hash_table_create): Use bfd_zalloc.
7168         (_frv_add_rofixup): Don't inline.
7169         (_frv_emit_got_relocs_plt_entries): Use NULL as funcdesc address
7170         for undefweak symbols.
7171         (elf32_frv_relocate_section): Avoid crash while computing
7172         relocation when linking with shared library.  Only emit rofixups
7173         and dynamic relocations for alloc&load sections.  Mark binaries
7174         with inter-segment relocations for relocation as a unit.
7175         (_frv_create_got_section): Rename .rofixup.got to .rofixup.
7176         (DEFAULT_STACK_SIZE): New.
7177         (_frv_count_got_plt_entries): Fix thinko in deciding whether to
7178         emit rofixups or dynamic relocs when linking dynamic non-PIE
7179         executables.
7180         (elf32_frv_size_dynamic_sections): Generate rofixup on PIEs and
7181         shared libs too.  Reserve the last entry for the GOT pointer.
7182         (elf32_frv_finish_dynamic_sections): Emit it.
7183         (elf32_frv_always_size_sections): New.
7184         (elf32_frv_modify_segment_map): New.
7185         (elf32_frv_check_relocs): Reserve relocs32 space only in ALLOC
7186         sections.
7187         (frv_elf_merge_private_bfd_data): Clear PIC bit if FDPIC is set.
7188         (frv_elf_print_private_bfd_data): Handle FDPIC and LIBPIC.
7189         (elf_backend_always_size_sections): New.
7190         (elf_backend_modify_segment_map): New.
7191         2003-10-31  Alexandre Oliva  <aoliva@redhat.com>
7192         * config.bfd: Added frv-*-*linux*.
7193         * elf32-frv.c (_frv_emit_got_relocs_plt_entries): Use idx 0 for
7194         ABS section, instead of crashing.
7195         (elf32_frv_relocate_section): Don't crash before warning about
7196         different segments in non-PIC relocation.
7197         2003-10-17  Alexandre Oliva  <aoliva@redhat.com>
7198         * elf32-frv.c (elf32_frv_relocate_section): Don't warn on LABEL24
7199         relocs to undefweak symbols.
7200         (elf32_frv_relocate_section): Ditto for undefined symbols.
7201         2003-10-06  Alexandre Oliva  <aoliva@redhat.com>
7202         * elf32-frv.c (elf32_frv_create_dynamic_sections): Make sure
7203         gotfixup section was created.
7204         2003-09-30  Alexandre Oliva  <aoliva@redhat.com>
7205         * elf32-frv.c (elf32_frv_howto_table): Change GOT12,
7206         FUNCDESC_GOT12, GOTOFF12 and FUNCDESC_GOTOFF12 to
7207         complain_overflow_signed.
7208         * elf32-frv.c (_frv_add_rofixup): Do not error out if contents
7209         have not been allocated.
7210         (_frv_emit_got_relocs_plt_entries): Return non-void.  Assert
7211         privfd only if dynamic sections were created.
7212         (elf32_frv_relocate_section): Compute gprel_segment, and use it
7213         for GPREL relocs.  When linking relocatable FDPIC executables,
7214         emit warnings for relocations that would be illegal on PIE or
7215         shared libraries.  Emit rofixup for R_FRV_32 only if input object
7216         is not FDPIC.
7217         (_frv_create_got_section): Define _gp symbol in the rofixup
7218         section.
7219         (elf32_frv_finish_dynamic_sections): If rofixups needed but
7220         dynamic sections missing, error out requesting -melf32frvfd.
7221         2003-09-19  Alexandre Oliva  <aoliva@redhat.com>
7222         * elf32-frv.c (_frv_emit_got_relocs_plt_entries): Rearrange
7223         computation of addends from section and global or local symbol
7224         value.  Change return type to bfd_boolean, and return a failure if
7225         a dynamic FUNCDESC or FUNCDESC_VALUE relocation that requires a
7226         nonzero addend is required.
7227         (elf32_frv_relocate_section): Likewise.  Print error for
7228         unsupported nonzero addends.
7229         2003-09-18  Alexandre Oliva  <aoliva@redhat.com>
7230         * elf32-frv.c (FRV_SYM_LOCAL): In the absence of dynamic sections,
7231         force everything local.
7232         (_frv_emit_got_relocs_plt_entries): Cope with NULL sec.
7233         * elf32-frv.c (struct frv_elf_link_hash_table): Added sgotfixup.
7234         (frv_gotfixup_section): New.
7235         (FRV_SYM_LOCAL): Accept undefweak and local common symbols.
7236         (struct frv_pic_relocs_info): Split relocs into relocs32, relocsfd
7237         and relocsfdv.
7238         (_frv_add_rofixup): New.
7239         (_frv_emit_got_relocs_plt_entries): Generate fixups for non-PIE
7240         fdpic executables.  Use FRV_SYM_LOCAL more widely to simplify and
7241         improve some ugly conditions.
7242         (elf32_frv_relocate_section): Likewise.  Reject inter-segment
7243         relocations in fdpic.
7244         (_frv_create_got_section): Create .rofixup.got section.
7245         (struct _frv_dynamic_got_info): Added fixups.
7246         (_frv_count_got_plt_entries): Account in-GOT relocations into
7247         relocs32, relocsfd and relocsfdv.  Account them into relocs or
7248         fixups, as appropriate.
7249         (elf32_frv_size_dynamic_sections): Size rofixup section.  Simplify
7250         sizing of gotrel.
7251         (elf32_frv_finish_dynamic_sections): Verify that the right number
7252         of relocations and fixups was generated.
7253         (elf32_frv_check_relocs): Compute relocs32, relocsfd and
7254         relocsfdv.
7255         * elf32-frv.c (FRV_SYM_LOCAL): New macro, used instead of
7256         SYMBOL_CALLS_LOCAL and SYMBOL_REFERENCES_LOCAL.
7257         (FRV_FUNCDESC_LOCAL): New macro, used to decide whether a function
7258         descriptor of a (formerly-)global symbol is local.
7259         (struct frv_pic_relocs_info): Adjust comments.
7260         (_frv_emit_got_relocs_plt_entries): Adjust.
7261         (elf32_frv_relocate_section): Likewise.
7262         (_frv_count_got_plt_entries): Likewise.
7263         * elf32-frv.c (_frv_emit_got_relocs_plt_entries): Don't add global
7264         symbol's value to addend in the common preamble.  Decay dynamic
7265         symbols to section+offset if they bind or call locally, for GOT
7266         and FUNCDESC_VALUE, respectively.
7267         (elf32_frv_relocate_section): Likewise.
7268         (elf32_frv_check_relocs): Don't register as dynamic symbols of
7269         internal or hidden visibility.
7270         2003-09-17  Alexandre Oliva  <aoliva@redhat.com>
7271         * elf32-frv.c (_frv_emit_got_relocs_plt_entries): Get addend as
7272         argument, so as to not call _bfd_elf_rel_local_sym to compute it.
7273         (elf32_frv_relocate_section): Pass relocation addend in.  Use
7274         original relocation addend to look up the got relocs/plt entries
7275         table.  Do not call _bfd_elf_rel_local_sym.  Don't error out when
7276         processing relocations that reference .scommon symbols.
7277         2003-09-15  Alexandre Oliva  <aoliva@redhat.com>
7278         Introduce support for dynamic linking.
7279         * elf32-frv.c (R_FRV_FUNCDESC_VALUE): Mark it as 64 bits.
7280         (elf32_frv_rel_32_howto, elf32_frv_rel_funcdesc_howto,
7281         elf32_frv_rel_funcdesc_value_howto): New REL descriptors.
7282         (frv_reloc_type_lookup): Return REL howtos for executables and
7283         dynamic libraries.
7284         (frv_info_to_howto_rel): New.
7285         (struct frv_elf_link_hash_table): New.
7286         (frv_hash_table, frv_got_section, frv_gotrel_section,
7287         frv_plt_section, frv_pltrel_section, frv_relocs_info,
7288         frv_got_initial_offset, frv_plt_initial_offset): New macros.
7289         (frv_elf_link_hash_table_create): New.
7290         (struct frv_pic_relocs_info): New.
7291         (frv_pic_relocs_info_hash, frv_pic_relocs_info_eq): New.
7292         (frv_pic_relocs_info_find): New.
7293         (frv_pic_relocs_info_for_global, frv_pic_relocs_info_for_local):
7294         New.
7295         (FRV_LZPLT_BLOCK_SIZE, FRV_LZPLT_RESOLVE_LOC): New.
7296         (_frv_add_dyn_reloc, _frv_osec_to_segment): New.
7297         (_frv_emit_got_relocs_plt_entries): New.
7298         (elf32_frv_relocate_section): Add support for dynamic linking.
7299         Handle new relocations.
7300         (_frv_create_got_section): New.
7301         (elf32_frv_create_dynamic_sections): New.
7302         (ELF_DYNAMIC_INTERPRETER): New.
7303         (struct _frv_dynamic_got_info): New.
7304         (_frv_count_got_plt_entries): New.
7305         (struct _frv_dynamic_got_plt_info): New.
7306         (_frv_compute_got_alloc_data): New.
7307         (_frv_get_got_entry, _frv_get_fd_entry): New.
7308         (_frv_assign_got_entries, _frv_assign_plt_entries): New.
7309         (_frv_resolve_final_relocs_info): New.
7310         (elf32_frv_size_dynamic_sections): New.
7311         (elf32_frv_finish_dynamic_sections): New.
7312         (elf32_frv_adjust_dynamic_symbol): New.
7313         (elf32_frv_finish_dynamic_symbol): New.
7314         (elf32_frv_check_relocs): Handle new relocs.  Explain how the
7315         whole thing works.
7316         (elf_info_to_howto_rel): Define.
7317         (bfd_elf32_bfd_link_hash_table_create): Define.
7318         (elf_backend_create_dynamic_sections): Define.
7319         (elf_backend_adjust_dynamic_symbol): Define.
7320         (elf_backend_size_dynamic_sections): Define.
7321         (elf_backend_finish_dynamic_symbol): Define.
7322         (elf_backend_finish_dynamic_sections): Define.
7323         (elf_backend_want_got_sym): Define.
7324         (elf_backend_got_header_size): Define.
7325         (elf_backend_want_got_plt): Define.
7326         (elf_backend_plt_readonly): Define.
7327         (elf_backend_want_plt_sym): Define.
7328         (elf_backend_plt_header_size): Define.
7329         (elf_backend_may_use_rel_p): Define.
7330         (elf_backend_may_use_rela_p): Define.
7331         (elf_backend_default_use_rela_p): Define.
7332         2003-08-08  Alexandre Oliva  <aoliva@redhat.com>
7333         * elf32-frv.c (R_FRV_FUNCDESC_VALUE, R_FRV_FUNCDESC_GOTOFF12,
7334         R_FRV_FUNCDESC_GOTOFFHI, R_FRV_FUNCDESC_GOTOFFLO, R_FRV_GOTOFF12,
7335         R_FRV_GOTOFFHI, R_FRV_GOTOFFLO): New.
7336         (frv_reloc_map): Map the corresponding BFD relocs to them.
7337         (frv_reloc_type_lookup): ... and back to BFD relocs.
7338         * reloc.c: New relocs.
7339         * bfd-in2.h, libbfd.h: Rebuilt.
7340         2003-08-04  Alexandre Oliva  <aoliva@redhat.com>
7341         * elf32-frv.c (R_FRV_GOT12, R_FRV_GOTHI, R_FRV_GOTLO,
7342         R_FRV_FUNCDESC, R_FRV_FUNCDESC_GOT12, R_FRV_FUNCDESC_GOTHI,
7343         R_FRV_FUNCDESC_GOTLO): New.
7344         (frv_reloc_map): Map the corresponding BFD relocs to them.
7345         (frv_reloc_type_lookup): ... and back to BFD relocs.
7346         * reloc.c: New relocs.
7347         * bfd-in2.h, libbfd.h: Rebuilt.
7348
7349 2004-01-05  Maciej W. Rozycki  <macro@ds2.pg.gda.pl>
7350
7351         * elf32-mips.c (ELF_MAXPAGESIZE): Redefine for traditional
7352         targets to support pages of up to 64kB.
7353         (elf32_bed): Redefine to get a separate backend data structure for
7354         traditional targets.
7355         * elf64-mips.c (ELF_MAXPAGESIZE): Redefine for traditional
7356         targets to support pages of up to 64kB.
7357         (elf64_bed): Redefine to get a separate backend data structure for
7358         traditional targets.
7359         * elfn32-mips.c (ELF_MAXPAGESIZE): Redefine for traditional
7360         targets to support pages of up to 64kB.
7361         (elf32_bed): Redefine to get a separate backend data structure for
7362         traditional targets.
7363
7364 2004-01-04  Mark Kettenis  <kettenis@gnu.org>
7365
7366         * elf32-sparc.c (elf32_sparc_grok_psinfo): New function.
7367
7368 2004-01-02  Mark Kettenis  <kettenis@gnu.org>
7369
7370         * elf32-i386.c (elf_i386_grok_prstatus): Add support for FreeBSD.
7371         (elf_i386_grok_psinfo): Likewise.
7372
7373 2004-01-02  Bernardo Innocenti  <bernie@develer.com>
7374
7375         * config.bfd: Add m68k-uClinux target.
7376
7377 2004-01-01  Grant Edwards <grante@visi.com>
7378
7379         * elflink.h (elf_gc_sections): Warn when gc-sections option is ignored.
7380         * elf32-h8300.c (elf32_h8_gc_mark_hook): New function.
7381         (elf32_h8_gc_sweep_hook): New function.
7382         (elf_backend_gc_mark_hook): Define.
7383         (elf_backend_gc_sweep_hook): Define.
7384         (elf_backend_can_gc_sections): Define.
7385
7386 For older changes see ChangeLog-0203
7387 \f
7388 Local Variables:
7389 mode: change-log
7390 left-margin: 8
7391 fill-column: 74
7392 version-control: never
7393 End: