* elf-m10300.c (_bfd_mn10300_elf_create_got_section): Fix
[platform/upstream/binutils.git] / bfd / ChangeLog
1 2003-11-04  Alan Modra  <amodra@bigpond.net.au>
2
3         * elf-m10300.c (_bfd_mn10300_elf_create_got_section): Fix
4         "dereferencing type-punned pointer" warnings.
5
6         * aout-adobe.c (aout_adobe_set_section_contents): Constify location.
7         * aoutx.h (NAME(aout,set_section_contents)): Ditto.
8         * bfd-in2.h: Regenerate.
9         * binary.c (binary_set_section_contents): Ditto.
10         * bout.c (b_out_set_section_contents): Ditto.
11         * coff-tic54x.c (tic54x_set_section_contents): Ditto.
12         * coffcode.h (coff_set_section_contents): Ditto.
13         * ecoff.c (_bfd_ecoff_set_section_contents): Ditto.
14         * elf-bfd.h (_bfd_elf_set_section_contents): Ditto.
15         * elf.c (_bfd_elf_set_section_contents): Ditto.
16         * elfxx-mips.c (_bfd_mips_elf_set_section_contents): Ditto.
17         * elfxx-mips.h (_bfd_mips_elf_set_section_contents): Ditto.
18         * i386msdos.c (msdos_set_section_contents): Ditto.
19         * ieee.c (ieee_set_section_contents): Ditto.
20         * ihex.c (ihex_set_section_contents): Ditto.
21         * libaout.h (NAME(aout,set_section_contents)): Ditto.
22         * libbfd-in.h (_bfd_nowrite_set_section_contents): Ditto.
23         (_bfd_generic_set_section_contents): Ditto.
24         * libbfd.h: Regenerate.
25         * libbfd.c (_bfd_generic_set_section_contents): Ditto.
26         * libecoff.h (_bfd_ecoff_set_section_contents): Ditto.
27         * libnlm.h (nlmNAME(set_section_contents)): Ditto.
28         (struct nlm_backend_data <nlm_mangle_relocs>): Ditto.
29         * mmo.c (mmo_set_section_contents): Ditto.
30         * nlm32-alpha.c (nlm_alpha_mangle_relocs): Ditto.
31         * nlm32-i386.c (nlm_i386_mangle_relocs): Ditto.
32         * nlm32-ppc.c (nlm_powerpc_mangle_relocs): Ditto.
33         * nlm32-sparc.c (nlm_sparc_mangle_relocs): Ditto.
34         * nlmcode.h (nlm_set_section_contents): Ditto.
35         * oasys.c (oasys_set_section_contents): Ditto.
36         * pdp11.c (NAME(aout,set_section_contents)): Ditto.
37         * ppcboot.c (ppcboot_set_section_contents): Ditto.
38         * srec.c (srec_set_section_contents): Ditto.
39         * targets.c (BFD_JUMP_TABLE_WRITE <_bfd_set_section_contents>): Ditto.
40         * tekhex.c (tekhex_set_section_contents): Ditto.
41         (move_section_contents): Ditto.
42         * versados.c (versados_set_section_contents): Ditto.
43         * vms-misc.c (_bfd_save_vms_section): Ditto.
44         * vms.c (vms_set_section_contents): Ditto.
45         * vms.h (_bfd_save_vms_section): Ditto.
46
47 2003-11-04  Alan Modra  <amodra@bigpond.net.au>
48
49         * elf64-ppc.c (ppc_size_one_stub): Size relbrlt.  Accept info arg
50         rather than htab.
51         (ppc64_elf_size_stubs): Adjust ppc_size_one_stub traversal.  Zero
52         relbrlt size.
53         (ppc64_elf_build_stubs): Allocate space for relbrlt.
54
55 2003-11-04  Alan Modra  <amodra@bigpond.net.au>
56
57         * bfd-in.h (_bfd_elf_tls_setup): Declare.
58         * bfd-in2.h: Regenerate.
59         * elf-bfd.h (struct elf_link_tls_segment): Delete.
60         (struct elf_link_hash_table): Add tls_sec and tls_size.
61         * elf.c (_bfd_elf_link_hash_table_init): Init tls_sec and tls_size.
62         * elflink.c (_bfd_elf_tls_setup): New function.
63         * elflink.h (struct elf_final_link_info): Remove first_tls_sec.
64         (elf_bfd_final_link): Don't set first_tls_sec here.  Update code
65         saving tls segment info, round segment size up.
66         (elf_link_output_extsym): Adjust code using tls segment info.
67         (elf_link_input_bfd): Likewise.
68         * elf32-i386.c (dtpoff_base, tpoff): Likewise.
69         * elf32-s390.c (dtpoff_base, tpoff): Likewise.
70         * elf32-sh.c (dtpoff_base, tpoff): Likewise.
71         * elf32-sparc.c (dtpoff_base, tpoff): Likewise.
72         * elf64-s390.c (dtpoff_base, tpoff): Likewise.
73         * elf64-x86-64.c (dtpoff_base, tpoff): Likewise.
74         * elfxx-ia64.c (elfNN_ia64_tprel_base): Likewise.
75         (elfNN_ia64_dtprel_base): Likewise.
76         * elf64-alpha.c (alpha_get_dtprel_base): Likewise.
77         (alpha_get_tprel_base): Likewise.
78         (struct alpha_relax_info): Remove tls_segment.
79         (elf64_alpha_relax_got_load): Adjust invocation of
80         alpha_get_dtprel_base and alpha_get_tprel_base.
81         (elf64_alpha_relax_tls_get_addr): Likewise.
82         (elf64_alpha_relax_section): Likewise.
83         (elf64_alpha_relocate_section): Likewise.
84         (elf64_alpha_relax_find_tls_segment): Delete.
85         * elf32-ppc.c (struct ppc_elf_link_hash_table): Remove tls_sec.
86         (ppc_elf_tls_setup): Call _bfd_elf_tls_setup.  Return section.
87         (ppc_elf_relocate_section): Adjust to use elf.tls_sec.
88         * elf32-ppc.h (ppc_elf_tls_setup): Update.
89         * elf64-ppc.c (struct ppc_link_hash_table): Remove tls_sec.
90         (ppc64_elf_tls_setup): Call _bfd_elf_tls_setup.  Return section.
91         (ppc64_elf_tls_optimize): Adjust to use elf.tls_sec.
92         (ppc64_elf_relocate_section): Likewise.
93         * elf64-ppc.h (ppc64_elf_tls_setup): Update.
94
95 2003-11-03  Daniel Jacobowitz  <drow@mvista.com>
96
97         * elf-bfd.h (struct elf_backend_data): Remove plt_header_size.
98         * elf-m10300.c (elf_backend_plt_header_size): Don't define.
99         * elf32-arm.h (elf_backend_plt_header_size): Don't define.
100         * elf32-cris.c (elf_backend_plt_header_size): Don't define.
101         * elf32-i386.c (elf_backend_plt_header_size): Don't define.
102         * elf32-mips.c (elf_backend_plt_header_size): Don't define.
103         * elf32-ppc.c (elf_backend_plt_header_size): Don't define.
104         * elf32-s390.c (elf_backend_plt_header_size): Don't define.
105         * elf32-sh.c (elf_backend_plt_header_size): Don't define.
106         * elf32-sparc.c (elf_backend_plt_header_size): Don't define.
107         * elf64-alpha.c (elf_backend_plt_header_size): Don't define.
108         * elf64-hppa.c (elf_backend_plt_header_size): Don't define.
109         * elf64-mips.c (elf_backend_plt_header_size): Don't define.
110         * elf64-ppc.c (elf_backend_plt_header_size): Don't define.
111         * elf64-s390.c (elf_backend_plt_header_size): Don't define.
112         * elf64-sh64.c (elf_backend_plt_header_size): Don't define.
113         * elf64-sparc.c (elf_backend_plt_header_size): Don't define.
114         * elf64-x86-64.c (elf_backend_plt_header_size): Don't define.
115         * elfn32-mips.c (elf_backend_plt_header_size): Don't define.
116         * elfxx-ia64.c (elf_backend_plt_header_size): Don't define.
117         * elfxx-target.h (elf_backend_plt_header_size): Don't define
118         or include in target initializer.
119
120 2003-11-03  Andrew Cagney  <cagney@redhat.com>
121
122         * section.c (bfd_set_section_contents): Make the "location" buffer
123         constant.
124         * bfd-in2.h: Re-generate.
125
126 2003-10-30  Andrew Cagney  <cagney@redhat.com>
127
128         * syms.c: Replace "struct symbol_cache_entry" with "struct
129         bfd_symbol".
130         * vms.h, targets.c, section.c, reloc.c, peicode.h: Ditto.
131         * mipsbsd.c, elf.c, linker.c, elf-bfd.h, ecoff.c: Ditto.
132         * cpu-z8k.c, cpu-ns32k.c, cpu-h8500.c, bfd.c, bfd-in.h: Ditto.
133         * bfd-in2.h: Re-generate.
134
135 2003-10-30  Jakub Jelinek  <jakub@redhat.com>
136
137         * elfxx-ia64.c: Include objalloc.h, hashtab.h.
138         (struct elfNN_ia64_local_hash_entry): Remove root. Add id and r_sym
139         fields.
140         (struct elfNN_ia64_local_hash_table): Remove.
141         (struct elfNN_ia64_link_hash_table): Change loc_hash_table's type
142         to htab_t.  Add loc_hash_memory field.
143         (elfNN_ia64_local_hash_table_init, elfNN_ia64_new_loc_hash_entry):
144         Removed.
145         (elfNN_ia64_local_htab_hash, elfNN_ia64_local_htab_eq): New
146         functions.
147         (elfNN_ia64_hash_table_create): Use hashtab.h hashtable for
148         loc_hash_table.  Initialize loc_hash_memory.
149         (elfNN_ia64_hash_table_free): New function.
150         (elfNN_ia64_local_hash_lookup): Remove.
151         (elfNN_ia64_local_dyn_sym_thunk): Change into htab_traverse
152         callback.
153         (elfNN_ia64_dyn_sym_traverse): Use htab_traverse.
154         (get_local_sym_hash): Use hashtab.h hashtable for loc_hash_table.
155         (bfd_elfNN_bfd_link_hash_table_free): Define.
156
157 2003-10-30  Alan Modra  <amodra@bigpond.net.au>
158
159         * elflink.c (_bfd_elf_link_record_dynamic_symbol): Modify versioned
160         symbol string in place.
161
162 2003-10-30  Jim Blandy  <jimb@redhat.com>
163
164         * cpu-rs6000.c (rs6000_compatible): Check the correct arch_info
165         object's mach field: all PowerPC machines are supersets of the
166         original rs6000, but not later rs6000 machines.
167
168 2003-10-30  Alan Modra  <amodra@bigpond.net.au>
169
170         * dwarf2.c (struct attribute): Delete "unsnd", "snd" and "addr".
171         Add "val" and "sval" fields.
172         (DW_STRING, DW_UNSND, DW_BLOCK, DW_SND, DW_ADDR): Delete.
173         (read_attribute_value): Expand and adjust DW_* occurrences.
174         (scan_unit_for_functions, parse_comp_unit): Likewise.
175
176 2003-10-30  Phil Edwards  <phil@codesourcery.com>
177
178         * config.bfd (arm-*-vxworks):  Remove separate stanza; merge with
179         other common ELF triples.
180         (i[3-7]86-*-vxworks):  Change to ELF format.
181         (mips*-*-windiss):  New triple, add to common MIPS/ELF stanza.
182         (sh-*-vxworks):  New stanza.
183
184 2003-10-30  Lars Knoll  <lars@trolltech.com>
185             Michael Matz  <matz@suse.de>
186             Jakub Jelinek  <jakub@redhat.com>
187             Alan Modra  <amodra@bigpond.net.au>
188
189         * merge.c (struct sec_merge_sec_info): Update comment.
190         (struct sec_merge_hash_entry): Remove entsize.
191         (sec_merge_hash_lookup): Only adjust alignment when creating.
192         (sec_merge_emit): Remove register keyword.
193         (cmplengthentry, last4_eq, last_eq): Delete.
194         (strrevcmp, strrevcmp_align, is_suffix): New.
195         (merge_strings): Use them to implement fast suffix merging.
196         * elf-strtab.c (struct elf_strtab_hash_entry): Update comments.
197         Make "len" signed.
198         (_bfd_elf_strtab_add): Lose on >2G strings.
199         (_bfd_elf_strtab_emit): Don't emit strings with len < 0.
200         (cmplengthentry, last4_eq): Delete.
201         (strrevcmp, is_suffix): New.
202         (_bfd_elf_strtab_finalize): Rework to implement fast suffix merging.
203
204 2003-10-29  Daniel Jacobowitz  <drow@mvista.com>
205
206         * elf32-arm.h (elf32_arm_final_link_relocate): Move check for
207         SEC_ALLOC.
208
209 2003-10-29  Philip Blundell  <philb@gnu.org>
210
211         * elf32-arm.h (elf32_arm_plt0_entry, elf32_arm_plt_entry): New
212         code sequence.
213         (PLT_HEADER_SIZE): New.
214         (struct elf32_arm_pcrel_relocs_copied): Rename to ...
215         (struct elf32_arm_relocs_copied): ... this.  Count both
216         pcrel and non-pcrel relocs.  All uses updated.
217         (struct elf32_arm_link_hash_table): Add pointers to dynamic linker
218         sections and symbol/section mapping cache.
219         (create_got_section): New.
220         (elf32_arm_create_dynamic_sections): New.
221         (elf_backend_create_dynamic_sections): Use it.
222         (elf32_arm_final_link_relocate): Support garbage collection of relocs.
223         (elf32_arm_check_relocs): Likewise.
224         (elf32_arm_adjust_dynamic_symbol): Likewise.
225         (elf32_arm_copy_indirect_symbol): New.
226         (elf32_arm_link_hash_table_create): Initialise new fields.
227         (elf32_arm_gc_sweep_hook): Implement.
228         (elf32_arm_discard_copies): Delete.
229         (elf32_arm_finish_dynamic_symbol): Use new PLT code.
230         (elf32_arm_finish_dynamic_sections): Likewise.
231         (elf_backend_can_refcount): Define.
232         (elf_backend_copy_indirect_symbol): Likewise.
233         (elf_backend_plt_header_size): Set to PLT_HEADER_SIZE.
234
235 2003-10-29  Alan Modra  <amodra@bigpond.net.au>
236
237         * elf64-ppc.c (elf_backend_grok_prstatus): Define.
238         (elf_backend_grok_psinfo): Define.
239         (ppc64_elf_grok_prstatus, ppc64_elf_grok_psinfo): New functions.
240
241         * elf.c (_bfd_elfcore_make_pseudosection): Allow multiple
242         sections with the same name.
243         (elfcore_grok_lwpstatus): Likewise.
244         (elfcore_grok_win32pstatus): Likewise.
245         (elfcore_grok_note): Likewise.
246         (elfcore_grok_nto_status): Likewise.
247         (elfcore_grok_nto_gregs): Likewise.
248
249 2003-10-27  Daniel Jacobowitz  <drow@mvista.com>
250
251         * elf32-arm.h (elf32_arm_merge_private_bfd_data): Never skip dynamic
252         objects.
253
254 2003-10-14  Richard Sandiford  <rsandifo@redhat.com>
255
256         * elfxx-mips.c (mips_elf_create_got_section): Initialize global_gotno.
257
258 2003-10-24  H.J. Lu  <hongjiu.lu@intel.com>
259
260         * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Look up
261         hash table for real symbols.
262
263 2003-10-23  Michael Snyder  <msnyder@redhat.com>
264
265         * section.c (asection): Fix typo in comment.
266
267 2003-10-23  Alan Modra  <amodra@bigpond.net.au>
268
269         * elf64-ppc.c (get_tls_mask): Add toc_symndx param, save toc
270         reloc symbol index to it.  Don't allow gd syms in shared libs
271         to be optimized.
272         (ppc64_elf_tls_optimize): Adjust get_tls_mask call.
273         (ppc64_elf_size_stubs): Likewise.
274         (ppc64_elf_relocate_section): Check that tls relocs are only used
275         with tls syms, and similarly for non-tls.  Correct symbol used
276         when optimizing toc tls code.
277
278 2003-10-22  Nick Clifton  <nickc@redhat.com>
279
280         * peicode.h (coff_swap_scnhdr_in): Only remove padding when
281         processing an executable.
282
283 2003-10-22  Jakub Jelinek  <jakub@redhat.com>
284
285         * elflink.c (_bfd_elf_export_symbol): Adjust for globals and locals
286         field changes.
287         (_bfd_elf_link_assign_sym_version): Likewise.
288         * elflink.h (size_dynamic_sections): Likewise.
289
290 2003-10-21  Alexandre Oliva  <aoliva@redhat.com>,
291             Michael Snyder  <msnyder@redhat.com>
292
293         * archures.c (bfd_mach_sh4a, bfd_mach_sh4al_dsp, bfd_mach_sh4_nofpu,
294         bfd_mach_sh4a_nofpu): New machine types.
295         * bfd-in2.h: Rebuilt.
296         * cpu-sh.c (compatible): Remove unused function.
297         (SH4A_NEXT, SH4AL_DSP_NEXT, SH4_NOFPU_NEXT, SH4A_NOFPU_NEXT): New.
298         (arch_info_struct): Add sh4a, sh4al_dsp, sh4-nofpu and sh4a-nofpu.
299         * elf32-sh.c (sh_elf_set_mach_from_flags): Handle them.
300
301 2003-10-21  Wouter van Heyst <wouter@vidicode.nl>
302
303         * elf32-arm.h (elf32_arm_merge_private_bfd_data): Correct text
304         describing mismatched formats involving the Maverick FP type.
305
306 2003-10-21  Anil Paranjpe  <anilp1@KPITCummins.com>
307
308         * binary.c (binary_object_p): Pass machine flag along with
309         architecture.
310
311 2003-10-21  Thorsten Brehm  <brehm@gmx.net>
312
313         * archures.c (bfd_default_scan): Add support for mcf528x.
314         * ieee.c (ieee_write_processor): Likewise.
315
316 2003-10-21  Peter Barada  <pbarada@mail.wm.sps.mot.com>
317             Bernardo Innocenti  <bernie@develer.com>
318
319         * archures.c: Add MCF528x (MCFv4) support.
320         * bfd/cpu-m68k.c (arch_info_struct): Likewise.
321         * bfd-in2.h: Regenerate.
322
323 2003-10-20  Andrew Cagney  <cagney@redhat.com>
324
325         * targets.c: Replace "struct sec" with "struct bfd_section"
326         * syms.c, sparclynx.c, section.c, opncls.c: Ditto.
327         * libcoff-in.h, libbfd-in.h, elfxx-target.h: Ditto.
328         * elf.c, coffgen.c, bfd.c, bfd-in.h, aoutf1.h: Ditto.
329         * aout-tic30.c, aout-target.h:
330         * bfd-in2.h, libcoff.h, libbfd.h: Regenerate.
331
332 2003-10-18  Hans-Peter Nilsson  <hp@bitrange.com>
333
334         Support linker relaxation of new R_MMIX_PUSHJ_STUBBABLE relocs.
335         * elf64-mmix.c (MAX_PUSHJ_STUB_SIZE): New macro.
336         (struct _mmix_elf_section_data): New member pjs.
337         (mmix_set_relaxable_size, mmix_elf_get_section_contents): New
338         functions.
339         (elf_mmix_howto_table): New entry for R_MMIX_PUSHJ_STUBBABLE.
340         (mmix_reloc_map): Ditto.
341         (mmix_elf_relocate_section): Handle R_MMIX_PUSHJ_STUBBABLE.
342         (mmix_final_link_relocate, mmix_elf_check_common_relocs): Ditto.
343         (mmix_elf_perform_relocation): Ditto.  Don't mark parameter addr
344         unused.
345         (mmix_elf_check_relocs): Move early return to after
346         mmix_elf_check_common_relocs call.
347         (mmix_elf_symbol_processing): Fix cut-and-pasto in head comment.
348         (_bfd_mmix_before_linker_allocation): Rename from
349         _bfd_mmix_prepare_linker_allocated_gregs.  All referers changed.
350         Arrange to set the initial relaxable size of sections.
351         (_bfd_mmix_after_linker_allocation): Rename from
352         _bfd_mmix_finalize_linker_allocated_gregs.
353         (mmix_elf_relax_section): Relax a R_MMIX_PUSHJ_STUBBABLE reloc.
354         (bfd_elf64_get_section_contents): Define.
355         * reloc.c: Add ENUMX for BFD_RELOC_MMIX_PUSHJ_STUBBABLE.
356         * libbfd.h, bfd-in2.h: Regenerate.
357
358         * reloc.c (bfd_generic_relax_section): Default-set
359         section->_cooked_size here.
360         (bfd_generic_get_relocated_section_contents): Don't set it here.
361         Explain why.
362
363 2003-10-17  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
364
365         * elf32-hppa.c (elf32_hppa_relocate_section): Skip relocation if
366         output section has been discarded.
367
368 2003-10-17  Shrinivas Atre  <shrinivasa@KPITCummins.com>
369
370         * coff-h8300.c (funcvec_hash_newfunc): Handle normal mode.
371         (h8300_reloc16_extra_cases): Likewise.
372         (h8300_bfd_link_add_symbols): Likewise.
373
374 2003-10-17 Dhananjay Deshpande <dhananjayd@kpitcummins.com>
375
376         * cpu-h8300.c (h8300sxn_info_struct): Correct address size.
377         (h8300sn_info_struct): Likewise.
378         (h8300hn_info_struct): Likewise.
379
380 2003-10-16  Pavel Roskin  <proski@gnu.org>
381
382         * peXXigen.c (_bfd_XXi_swap_aouthdr_out): Don't calculate image size
383         for sections which lack size info.
384
385 2003-10-17  Danny Smith  <dannysmith@users.sourceforge.net>
386
387         * configure.host: Add __USE_MINGW_FSEEK to HDEFINES for
388          mingw32.
389
390 2003-10-16  H.J. Lu  <hongjiu.lu@intel.com>
391
392         * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Also warn
393         undefined patterns with '*'.
394
395 2003-10-16  H.J. Lu  <hongjiu.lu@intel.com>
396
397         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Don't
398         use the last CIE from a different section.
399         (_bfd_elf_write_section_eh_frame): Don't pad beyond the raw
400         size of the output section.
401
402 2003-10-07  Roland McGrath  <roland@redhat.com>
403
404         * elf.c (_bfd_elf_make_section_from_phdr): Set alignment_power of
405         new section from p_align header field.
406
407 2003-10-16  H.J. Lu  <hongjiu.lu@intel.com>
408
409         * elf32-xtensa.c (xtensa_read_table_entries): The external size
410         of entry is 8 bytes.
411
412 2003-10-15  Andrew Cagney  <cagney@redhat.com>
413
414         * targets.c (BFD_JUMP_TABLE_SYMBOLS): Replace NAME##_get_symtab
415         with NAME##_canonicalize_symtab.
416         * libcoff-in.h (coff_canonicalize_symtab): Update.
417         * xsym.h (bfd_sym_canonicalize_symtab): Update.
418         * elf-bfd.h (_bfd_elf_canonicalize_symtab): Update.
419         * coffgen.c (coff_canonicalize_symtab): Update.
420         * libbfd-in.h (_bfd_nosymbols_canonicalize_symtab): Update.
421         * libnlm.h (nlmNAME(canonicalize_symtab)): Update.
422         * ieee.c (ieee_vec): Update comment.
423         * libecoff.h (_bfd_ecoff_canonicalize_symtab): Update.
424         * mmo.c (mmo_canonicalize_symtab): Update.
425         * nlm-target.h (nlm_canonicalize_symtab): Update.
426         * nlmcode.h (nlm_canonicalize_symtab): Update.
427         * i386msdos.c (msdos_canonicalize_symtab): Update.
428         * hp300hpux.c (MY (canonicalize_symtab)): Update.
429         * oasys.c (oasys_canonicalize_symtab): Update.
430         * som.c (som_canonicalize_symtab): Update.
431         * pef.c (bfd_pef_canonicalize_symtab): Update.
432         * nlmcode.h (nlm_canonicalize_symtab): Update.
433         * xsym.c (bfd_sym_canonicalize_symtab): Update.
434         * vms.c (vms_canonicalize_symtab): Update.
435         * versados.c (versados_canonicalize_symtab): Update.
436         * mach-o.c (bfd_mach_o_canonicalize_symtab): Update.
437         * ieee.c (ieee_canonicalize_symtab): Update.
438         * pdp11.c (NAME(aout,canonicalize_symtab)): Update.
439         * reloc.c: Update comment.
440         * libaout.h (NAME(aout,canonicalize_symtab)): Update.
441         * coff64-rs6000.c (aix5coff64_vec): Update.
442         * coff64-rs6000.c (bfd_xcoff_aix5_backend_data): Update.
443         * coff-rs6000.c (rs6000coff_vec, pmac_xcoff_vec): Update.
444         * aoutx.h (NAME(aout,canonicalize_symtab)): Update.
445         * elfxx-target.h (bfd_elfNN_canonicalize_symtab): Update.
446         * hp300hpux.c (MY_canonicalize_symtab): Update.
447         * ecoff.c (_bfd_ecoff_canonicalize_symtab): Update.
448         * aout-tic30.c (MY_canonicalize_symtab): Update.
449         * aout-target.h (MY_canonicalize_symtab): Update.
450         * ppcboot.c (ppcboot_canonicalize_symtab): Update.
451         * elf.c (_bfd_elf_canonicalize_symtab): Update.
452         * elfcode.h (elf_canonicalize_symtab): Update.
453         * ihex.c (ihex_canonicalize_symtab): Update.
454         * tekhex.c (tekhex_canonicalize_symtab): Update.
455         * binary.c (binary_canonicalize_symtab): Update.
456         * srec.c (srec_canonicalize_symtab): Update.
457
458 2003-10-15  Kazu Hirata  <kazu@cs.umass.edu>
459
460         * elf32-h8300.c (elf_reloc_map): Fix a comment typo.
461
462 2003-10-15  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
463
464         * elf32-sh.c (sh_elf_relocate_section): Handle R_SH_IMM_*_PCREL
465         relocations.
466         (sh_elf_check_relocs): Likewise.
467
468         * elf32-sh64.c (elf_backend_merge_symbol_attribute): Define.
469         (sh64_elf_merge_symbol_attribute): New.
470         * elf64-sh64.c (elf_backend_merge_symbol_attribute): Define.
471         (sh64_elf64_merge_symbol_attribute): New.
472
473 2003-10-14  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
474
475         * elf-bfd.h (struct elf_backend_data): New function pointer member
476         elf_backend_merge_symbol_attribute.
477         * elflink.h (elf_link_add_object_symbols): Adjust call to
478         elf_backend_merge_symbol_attribute if the backend defined it.
479         * elfxx-target.h (elf_backend_merge_symbol_attribute): New macro.
480         (elfNN_bed): Add that to the initializer.
481
482 2003-10-14  Bob Wilson  <bob.wilson@acm.org>
483
484         * elf32-xtensa.c (get_is_linkonce_section): Delete.
485         (xtensa_is_property_section, xtensa_is_littable_section): Use
486         XTENSA_INSN_SEC_NAME and XTENSA_LIT_SEC_NAME macros.  Do not recognize
487         linkonce sections containing ".xt.insn" and ".xt.lit" substrings.
488         (xtensa_get_property_section_name): Check section name instead of
489         calling get_is_linkonce_section.  Remove unused bfd parameter.  Use
490         XTENSA_INSN_SEC_NAME and XTENSA_LIT_SEC_NAME macros.  Never generate
491         linkonce section names by appending ".xt.insn" or ".xt.lit".
492         (xtensa_read_table_entries): Remove bfd argument in call to
493         xtensa_get_property_section_name.  Free section name when done.
494         (elf_xtensa_combine_prop_entries): Free leaking table.
495
496 2003-10-13  Richard Sandiford  <rsandifo@redht.com>
497
498         * elfxx-mips.c (_bfd_mips_elf_size_dynamic_sections): Don't add
499         DT_MIPS_LIBLIST or DT_MIPS_CONFLICT entries.
500         (_bfd_mips_elf_finish_dynamic_symbol): Don't handle them.  Don't
501         handle DT_MIPS_MSYM.  Set DT_RELSZ based on the number of relocations
502         that were needed.
503         (_bfd_mips_elf_modify_segment_map): Fix placement of PT_MIPS_OPTIONS.
504         (_bfd_mips_elf_merge_private_bfd_data): Ignore EF_MIPS_UCODE.
505
506 2003-10-13  H.J. Lu  <hongjiu.lu@intel.com>
507
508         * bfd-in.h (bfd_elf32_ia64_after_parse): New prototype.
509         (bfd_elf64_ia64_after_parse): Likewise.
510         * bfd-in2.h: Regenerated.
511
512         * elfxx-ia64.c (oor_ip): New.
513         (oor_branch_size): Likewise.
514         (bfd_elfNN_ia64_after_parse): Likewise.
515         (elfNN_ia64_relax_section): Use oor_ip if oor_branch_size
516         equals sizeof (oor_ip).
517
518 2003-10-12  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
519
520         * elf64-sh64.c (sh_elf64_relocate_section): Tidy up for the
521         renumbering of some relocation numbers.
522
523 2003-10-11  Alan Modra  <amodra@bigpond.net.au>
524
525         * coff-sh.c: Move definition of MAP and guard more code with
526         COFF_IMAGE_WITH_PE.
527
528         * section.c (bfd_get_section_size_before_reloc): Ignore reloc_done.
529         * bfd-in2.h: Regenerate.
530
531 2003-10-10  H.J. Lu  <hongjiu.lu@intel.com>
532
533         * Makefile.am: Run "make dep-am".
534         * Makefile.in: Regenerate.
535         * doc/Makefile.in: Likewise.
536
537 2003-10-09  H.J. Lu  <hongjiu.lu@intel.com>
538
539         * cofflink.c: Include "safe-ctype.h".
540         (coff_link_add_symbols): Use ISDIGIT instead of isdigit.
541
542 2003-10-08  Dave Brolley  <brolley@redhat.com>
543         On behalf of Michael Snyder  <msnyder@redhat.com>
544
545         * archures.c: Add FRV fr550 machine.
546         * cpu-frv.c: Ditto.
547         * elf32-frv.c: Ditto.
548         * bfd-in2.h: Regenerate.
549
550 2003-10-08  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
551
552         * elfxx-mips.c (STUB_MOVE,STUB_LI16): Fix stub code
553         for non-SGI N64 ABI. Improve code consitency.
554
555 2003-10-07  Alexandre Oliva  <aoliva@redhat.com>
556
557         * elf32-frv.c (elf32_frv_howto_table): Set R_FRV_LABEL16's
558         rightshift to 2.
559
560 2003-10-07  Nathan Sidwell  <nathan@codesourcery.com>
561
562         * libbfd-in.h (_bfd_link_section_stabs): Add string offset
563         parameter.
564         * cofflink.c (coff_link_add_symbols): Deal with split stab
565         sections.
566         * elflink.h (elf_link_add_object_symbols): Deal with split stab
567         sections.
568         * stabs.c (_bfd_link_section_stabs): Add string offset parameter.
569         * libbfd.h: Regenerated.
570
571         * coffcode.h (coff_set_alignment_hook): With PE_COFF reloc
572         overflow, set reloc start position to after the count
573         reloc. Subtract one from num relocs. Give error on 0xffff relocs
574         and no overflow.
575         * cofflink.c (_bfd_coff_final_link): Deal with PE_COFF reloc
576         overflow.
577         * peXXigen.c (_bfd_XXi_swap_scnhdr_out): Do overflow if >=
578         0xffff.
579
580 2003-10-06  H.J. Lu  <hongjiu.lu@intel.com>
581
582         * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): Pad the
583         last CIE/FDE if needed.
584
585 2003-10-06  Nick Clifton  <nickc@redhat.com>
586
587         * targets.c (_bfd_target_vector): Include bfd_elf64_sparc_vec if
588         BFD64 is enabled.
589
590 2003-10-06  Matt Thomas <matt@3am-software.com>
591
592         * config.bfd: Move the hppa*-*-netbsd* case to the hppa*-*-linux* case.
593
594 2003-10-06  Robert Millan  <robertmh@gnu.org>
595
596         * configure.in: Match GNU/KNetBSD with new knetbsd*-gnu triplet.
597         * config.bfd: Likewise.
598         * configure: Regenerate.
599
600 2003-10-04  Christian Groessler  <chris@groessler.org>
601
602         * coff-z8k.c (extra_case): Fix displacement length check for R_JR
603         and R_CALLR.
604
605 2003-10-04  Stephane Carrez  <stcarrez@nerim.fr>
606
607         * elf32-m68hc1x.c: Update to ISO C90; replace PTR with void*.
608         * elf32-m68hc11.c: Likewise.
609         * elf32-m68hc12.c: Likewise.
610         * elf32-m68hc1x.h: Likewise.
611
612 2003-10-04  Stephane Carrez  <stcarrez@nerim.fr>
613
614         * elf32-m68hc1x.c (_bfd_m68hc11_elf_merge_private_bfd_data): Fix merge
615         of flags between HC12 and HCS12.
616
617 2003-10-04  Bryce McKinlay  <bryce@mckinlay.net.nz>
618
619         * merge.c (_bfd_merge_sections): Set SEC_EXCLUDE flag on sections
620         which become empty after merging.
621
622 2003-09-30  Jakub Jelinek  <jakub@redhat.com>
623
624         * elfxx-ia64.c (ia64_howto_table): Fix size of R_IA64_TPREL64[LM]SB,
625         R_IA64_DTPREL{32,64}[LM]SB and R_IA64_DTPMOD64[LM]SB.
626
627 2003-09-30  Chris Demetriou  <cgd@broadcom.com>
628
629         * archures.c (bfd_mach_mipsisa64r2): New define.
630         * bfd-in2.h: Regenerate.
631         * aoutx.h (NAME(aout,machine_type)): Handle bfd_mach_mipsisa64r2.
632         * cpu-mips.c (I_mipsisa64r2): New enum value.
633         (arch_info_struct): Add entry for I_mipsisa64r2.
634         * elfxx-mips.c (_bfd_elf_mips_mach)
635         (_bfd_mips_elf_print_private_bfd_data): Handle E_MIPS_ARCH_64R2.
636         (mips_set_isa_flags): Add bfd_mach_mipsisa64r2 case.
637         (mips_mach_extensions): Add entry for bfd_mach_mipsisa64r2.
638
639 2003-09-29  H.J. Lu  <hongjiu.lu@intel.com>
640
641         * elfxx-ia64.c (elfNN_hpux_backend_symbol_processing): New.
642         Handle SHN_IA_64_ANSI_COMMON.
643         (elf_backend_section_from_bfd_section): Defined.
644
645 2003-09-26  H.J. Lu  <hongjiu.lu@intel.com>
646
647         * elflink.c (elf_link_read_relocs_from_section): Add an argument
648         of a pointer to section. Check bad symbol index.
649         (_bfd_elf_link_read_relocs): Modify calls to
650         elf_link_read_relocs_from_section.
651
652 2003-09-23  DJ Delorie  <dj@redhat.com>
653
654         * elf32-sh.c (sh_elf_howto_table): R_SH_SWITCH8,
655         R_SH_GNU_VTINHERIT, R_SH_GNU_VTENTRY,
656         R_SH_LOOP_START,R_SH_LOOP_END moved to "reserved" spaces,
657         R_SH_DIR16, R_SH_DIR8, R_SH_DIR8UL, R_SH_DIR8UW, R_SH_DIR8U,
658         R_SH_DIR8SW, R_SH_DIR8S, R_SH_DIR4UL, R_SH_DIR4UW, R_SH_DIR4U,
659         R_SH_PSHA, R_SH_PSHL added.
660         (sh_reloc_map): Add R_SH_DIR16 and R_SH_DIR8.
661         (sh_elf_relocate_section): Support new relocs.
662
663 2003-09-23  Bob Wilson  <bob.wilson@acm.org>
664
665         * elf32-xtensa.c (elf_xtensa_relocate_section): Fix typo that clobbered
666         dynamic relocation offsets.
667
668 2003-09-23  Alan Modra  <amodra@bigpond.net.au>
669
670         * simple.c (bfd_simple_get_relocated_section_contents): Free the
671         hash table using _bfd_generic_link_hash_table_free.
672
673 2003-09-23  Alan Modra  <amodra@bigpond.net.au>
674
675         * elf-bfd.h (struct bfd_elf_special_section): Remove "suffix".  Change
676         type of prefix_length and suffix_length to int.  Rename "attributes"
677         to "attr".  Comment.
678         (_bfd_elf_get_sec_type_attr): Update prototype.
679         * elf.c (get_special_section): Rewrite.
680         (_bfd_elf_get_sec_type_attr): Return struct rather than passing in
681         attr and type pointers.
682         (_bfd_elf_new_section_hook): Adjust for above.
683         (special_sections): Merge suffix with prefix.  Set
684         prefix_length for all entries.  Set suffix_length appropriately.
685         * elf32-m32r.c (m32r_elf_special_sections): Likewise.
686         * elf32-m68hc11.c (elf32_m68hc11_special_sections): Likewise.
687         * elf32-m68hc12.c (elf32_m68hc12_special_sections): Likewise.
688         * elf32-mcore.c (mcore_elf_special_sections): Likewise.
689         * elf32-sh64.c (sh64_elf_special_sections): Likewise.
690         * elf32-v850.c (v850_elf_special_sections): Likewise.
691         * elf32-xtensa.c (elf_xtensa_special_sections): Likewise.
692         * elf64-alpha.c (elf64_alpha_special_sections): Likewise.
693         * elf64-hppa.c (elf64_hppa_special_sections): Likewise.
694         * elf64-ppc.c (ppc64_elf_special_sections): Likewise.
695         * elf64-sh64.c (sh64_elf64_special_sections): Likewise.
696         * elfxx-ia64.c (elfNN_ia64_special_sections): Likewise.
697         * elfxx-mips.c (_bfd_mips_elf_special_sections): Likewise.
698         * elf32-ppc.c (ppc_elf_special_sections): Likewise.  Fix .plt flags.
699
700 2003-09-21  Daniel Jacobowitz  <drow@mvista.com>
701
702         * elf64-alpha.c (elf64_alpha_create_got_section): Initialize
703         ->got if the section already exists.
704
705 2003-09-19  Nathan Sidwell  <nathan@codesourcery.com>
706
707         * dwarf2.c (decode_line_info): Cope with an initially empty
708         filename table.
709
710 2003-09-18  H.J. Lu  <hongjiu.lu@intel.com>
711
712         * acinclude.m4: Include ../config/accross.m4.
713         * aclocal.m4: Regenerated.
714
715         * configure.host (HOST_64BIT_TYPE): Remove if it is set to long
716         or long long.
717         (HOST_U_64BIT_TYPE): Remove if it is set to unsigned long long.
718         (host64): Remove if HOST_64BIT_TYPE is set to long.
719
720         * configure.in (HOST_64BIT_TYPE): Set according to the size of
721         long and long long.
722         (HOST_U_64BIT_TYPE): Likewise.
723         (host64): Likewise.
724         * configure: Regenerated.
725
726 2003-09-19  Alan Modra  <amodra@bigpond.net.au>
727
728         * elf.c (elfcore_write_note): Don't use sizeof(Elf_External_note)
729         since some ABIs round up the size of the struct.
730
731 2003-09-18  H.J. Lu  <hongjiu.lu@intel.com>
732
733         * elflink.c (_bfd_elf_merge_symbol): Allow type change if
734         the old symbol is undefined and the new symbol is defined.
735
736 2003-09-18  Andreas Schwab  <schwab@suse.de>
737
738         * simple.c (bfd_simple_get_relocated_section_contents): Use
739         _bfd_generic_link_hash_table_create instead of
740         bfd_link_hash_table_create.
741
742 2003-09-10  H.J. Lu  <hongjiu.lu@intel.com>
743
744         * elfxx-ia64.c (elfNN_ia64_special_sections): Mark all sections
745         started with ".sbss" or "".sdata" as SHF_IA_64_SHORT.
746
747 2003-09-10  John David Anglin   <dave.anglin@nrc-cnrc.nrc.ca>
748             Randolph Chung      <randolph@tausq.org>
749
750         * elf32-hppa.c (struct elf32_hppa_link_hash_entry,
751         hppa_link_hash_newfunc, hppa_build_one_stub,
752         elf32_hppa_adjust_dynamic_symbol, mark_PIC_calls, allocate_plt_static,
753         allocate_dynrelocs, elf32_hppa_size_dynamic_sections,
754         elf32_hppa_finish_dynamic_symbol): Remove pic_call field and all code
755         for generating import stubs for calls to statically linked PIC
756         functions.
757         (hppa_type_of_stub): Don't generate an import stub for calls to
758         statically linked pic functions.  Generate import stubs for calls
759         in a shared object, to functions not in a regular file, and to
760         defined weak functions.  Add new argument INFO.
761         (hppa_build_one_stub): Don't undef ADDIL_DP.
762         (elf32_hppa_check_relocs): Don't set SEC_HAS_GOT_REF flag.
763         (elf32_hppa_size_stubs): Pass info to hppa_type_of_stub.
764         (final_link_relocate): Change all DLTIND relocs to DPREL relocs in a
765         non-shared link.  Convert instructions that use the the linkage table
766         pointer, or a facsimile thereof, to use the global data pointer when
767         the reloc has been changed.
768
769 2003-09-08  Joel Brobecker  <brobecker@gnat.com>
770
771         * archures.c: Add new machine names for hppa.
772         * bfd-in2.h: Regenerate.
773         * cpu-hppa.c: Use the new machine names.
774
775 2003-09-06  Stephane Carrez  <stcarrez@nerim.fr>
776
777         * elf32-m68hc1x.h (struct m68hc11_elf_link_hash_table): Remove
778         all_local_syms member.
779         * elf32-m68hc1x.c (elf32_m68hc11_size_stubs): Use bfd_elf_get_elf_syms
780         to get the local symbols.
781
782 2003-09-06  Stephane Carrez  <stcarrez@nerim.fr>
783
784         * elf32-m68hc12.c (elf32_m68hc12_special_sections): New for hc11.
785         (elf_backend_special_sections): Define.a
786
787         PR savannah/4950:
788         * elf32-m68hc11.c (elf32_m68hc11_special_sections): The .vectors
789         section is read-only.
790
791 2003-09-04  Nick Clifton  <nickc@redhat.com>
792
793         * archures.c (bfd_mach_v850e1): Define.
794         * bfd-in2.h: Regenerate.
795         * cpu-v850.h (scan): Accept bfd_mach_v850e1.
796         (arch_info_struct): Include an entry for bfd_mach_v850e1.
797         * elf32-v850.c (v850_elf_object_p): Accept E_V850E1_ARCH flag.
798         (v850_elf_final_write_processing): Accept bfd_mach_v850e1.
799         (v850_elf_print_private_bfd_data): Interpret E_V850E1_ARCH flag.
800         (v850_elf_merge_private_bfd_data): Allow v850e1 binaries to be
801         linked with v850e binaries.  Mark the output as v850e.
802
803 2003-09-03  Nick Clifton  <nickc@redhat.com>
804
805         * cofflink.c (_bfd_coff_link_input_bfd): Do not skip section
806         symbols that are used in relocs.
807
808 2003-08-30  Robert Millan  <robertmh@gnu.org>
809
810         * configure.in: Match GNU/KFreeBSD with new kfreebsd*-gnu triplet.
811         * config.bfd: Likewise.
812         * configure: Regenerate.
813
814 2003-08-31  Christian Groessler  <chris@groessler.org>
815
816         * elf32-i860.c (i860_howto_pc26_reloc): Finish relocation here
817         instead of returning bfd_reloc_continue.
818
819 2003-08-31  Andreas Jaeger  <aj@suse.de>
820
821         * merge.c: Update to ISO C90.
822
823 2003-08-27  Ian Lance Taylor  <ian@airs.com>
824
825         * configure.in: Check for strtoull.
826         * bfd.c (bfd_scan_vma): Use strtoull when available.
827         * configure, config.in: Regenerate.
828
829         * configure.in: Define and substitute BFD_HOST_LONG_LONG.
830         * bfd-in.h: Define BFD_HOST_LONG_LONG.  Test it rather than
831         __GNUC__ when deciding whether to use long long for
832         BFD_HOST_64_BIT.
833         * configure, Makefile.in, doc/Makefile.in, bfd-in2.h: Regenerate.
834
835 2003-08-27  Christian Groessler  <chris@groessler.org>
836
837         * elf32-i860.c (i860_howto_pc26_reloc, i860_howto_pc16_reloc,
838         i860_howto_splitn_reloc, i860_howto_highadj_reloc): New
839         functions.
840         (elf32_i860_howto_table): Insert the new functions as
841         'special_function's in the proper reloc type entries.
842
843 2003-08-27  Richard Sandiford  <rsandifo@redhat.com>
844
845         * elf32-frv.c (elf32_frv_relocate_section): Use
846         _bfd_elf_rela_local_sym.
847
848 2003-08-26  Michael Snyder  <msnyder@redhat.com>
849
850         * cpu-frv.c: Remove unused enum.
851
852 2003-08-25  Maciej W. Rozycki  <macro@ds2.pg.gda.pl>
853
854         * reloc.c: Fix documentation for MIPS ELF relocations.
855         libbfd.h: Regenerate.
856         bfd-in2.h: Regenerate.
857
858 2003-08-24  Jason Eckhardt  <jle@rice.edu>
859
860         * coff-i860.c (CALC_ADDEND): Define to be a no-op.
861
862 2003-08-24  Jason Eckhardt  <jle@rice.edu>
863
864         * elf32-i860.c (elf32_i860_relocate_pc16): Subtract 4 and
865         shift by 2 before storing the relocated value.
866
867 2003-08-23  Jason Eckhardt  <jle@rice.edu>
868
869         * coff-i860.c (coff_i860_reloc_nyi): New function.
870         (howto_table): Add entries for relocations PAIR, HIGHADJ, HIGH,
871         LOWn, SPLITn, and BRADDR.
872         (RTYPE2HOWTO): Check that the r_type is within the howto_table
873         before trying to access the entry.
874         (coff_i860_rtype_to_howto): Likewise.
875         (coff_i860_reloc_type_lookup): New function.
876         (i860_reloc_processing): New function.
877         (coff_bfd_reloc_type_lookup): Define macro.
878         (RELOC_PROCESSING): Define macro.
879         Minor formatting adjustments.
880
881 2003-08-23  Alan Modra  <amodra@bigpond.net.au>
882
883         * elflink.h (elf_link_add_object_symbols): Don't crash on NULL owner.
884
885 2003-08-22  H.J. Lu  <hongjiu.lu@intel.com>
886
887         * elfxx-ia64.c (elfNN_ia64_create_dynamic_sections): Align the
888         .got section at 8 bytes.
889
890 2003-08-21  Nick Clifton  <nickc@redhat.com>
891
892         * cofflink.c: Update to ISO C90 and tidy up formatting.
893
894 2003-08-21  Randolph Chung  <tausq@debian.org>
895
896         * elf32-hppa.c (elf32_hppa_object_p): For elf32-hppa-linux, objects
897         can have OSABI=Linux or OSABI=SysV.  Check for both.
898         * elf64-hppa.c (elf64_hppa_object_p): Likewise.
899
900 2003-08-21  Nick Clifton  <nickc@redhat.com>
901
902         * po/sv.po: Updated Swedish translation.
903
904 2003-08-20  Richard Sandiford  <rsandifo@redhat.com>
905
906         * elf64-mips.c (elf_backend_copy_indirect_symbol): Define.
907
908 2003-08-20  Nick Clifton  <nickc@redhat.com>
909
910         * elf-bfd.h (RELOC_FOR_GLOBAL_SYMBOL): New macro used to
911         replace some duplicated code in most elfxx-xxxx.c files.  This
912         version uses the new fields in bfd_link_info.
913
914         * elf-m10300.c (mn10300_elf_relocate_section): Use new macro.
915         * elf32-arm.h (elf32_arm_relocate_section): Likewise.
916         * elf32-cris.c (cris_elf_relocate_section): Likewise.
917         * elf32-hppa.c (elf32_hppa_relocate_section): Likewise.
918         * elf32-i386.c (elf_i386_relocate_section): Likewise.
919         * elf32-ip2k.c (ip2k_elf_relocate_section): Likewise.
920         * elf32-iq2000.c (iq2000_elf_relocate_section): Likewise.
921         * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
922         * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
923         * elf32-s390.c (elf_s390_relocate_section): Likewise.
924         * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
925         * elf32-vax.c (elf_vax_relocate_section): Likewise.
926         * elf32-xtensa.c (elf_xtensa_relocate_section): Likewise.
927         * elf64-alpha.c (elf64_alpha_relocate_section): Likewise.
928         * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
929         * elf64-s390.c (elf_s390_relocate_section): Likewise.
930         * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
931         * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
932         * elfxx-ia64.c (elfNN_ia64_relocate_section): Likewise.
933
934         * elf-hppa.h (elf_hppa_unmark_useless_dynamic_symbols,
935         elf_hppa_remark_useless_dynamic_symbols,
936         elf_hppa_relocate_section): Use the new fields in
937         bfd_link_info structure.
938         * elf32-sh.c (sh_elf_relocate_section): Likewise.
939         * elf64-alpha.c (elf64_alpha_check_relocs): Likewise.
940         * elf64-hppa.c (elf64_hppa_check_relocs): Likewise.
941         * elf64-sh64.c (sh_elf64_relocate_section): Likewise.
942         * elfxx-ia64.c (elfNN_ia64_check_relocs): Likewise.
943         * elfxx-mips.c (mips_elf_calculate_relocation): Likewise.
944
945         * elflink.h (elf_link_output_extsym): Fix test for reporting
946         undefined symbols in shared libraries.  Remove redundant test
947         of shlib_undefined when reporting references to forced local
948         symbols.
949
950 2003-08-18  Andreas Schwab  <schwab@suse.de>
951
952         * libpei.h (bfd_pe_executable_p): Also recognize efi-app
953         executables.
954
955 2003-08-17  Hans-Peter Nilsson  <hp@bitrange.com>
956
957         * simple.c (bfd_simple_get_relocated_section_contents): Move
958         reloc_done hack to before first bfd_section_size call.  Change all
959         returns to use new wrapper macro RETURN, restoring sec->reloc_done.
960
961 2003-08-16  Alan Modra  <amodra@bigpond.net.au>
962
963         * elf64-ppc.c: Don't include elf/ppc.h.
964
965 2003-08-14  Richard Sandiford  <rsandifo@redhat.com>
966
967         * elfxx-mips.c (_bfd_mips_elf_modify_segment_map): Fix PT_DYNAMIC
968         code to work with 64-bit bfds.
969
970 2003-08-14  Alan Modra  <amodra@bigpond.net.au>
971
972         * dep-in.sed: Remove libintl.h.
973         * Makefile.am (SRC-POTFILES.in, BLD-POTFILES.in): Unset LC_COLLATE.
974         (POTFILES.in): Remove target.
975         * Makefile.in: Regenerate.
976
977 2003-08-12  Alan Modra  <amodra@bigpond.net.au>
978
979         * elf64-ppc.c (ppc64_elf_next_input_section): Update comment.
980         (ppc64_elf_relocate_section): For zero sym R_PPC64_TOC relocs,
981         use the function sym from the previous reloc.
982
983 2003-08-11  Jakub Jelinek  <jakub@redhat.com>
984
985         * elf32-i386.c (elf_i386_relocate_section): Make undefined symbols
986         fatal if -pie.
987         * elf32-s390.c (elf_s390_relocate_section): Likewise.
988         * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
989         * elf64-alpha.c (elf64_alpha_relocate_section): Likewise.
990         * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
991         * elf64-s390.c (elf_s390_relocate_section): Likewise.
992         * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
993         * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
994         * elfxx-ia64.c (elfNN_ia64_relocate_section): Likewise.
995         * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
996         (ppc_elf_relocate_section) <case R_PPC_RELAX32>: Issue fatal error
997         on undefined symbols if -pie.
998         * elf32-sh.c (sh_elf_relocate_section): Likewise.
999
1000 2003-08-11  Alan Modra  <amodra@bigpond.net.au>
1001
1002         * elf64-ppc.c (ppc64_elf_relocate_section): Add special case for crt1.o
1003         branch to __libc_start_main.
1004
1005 2003-08-08 Dmitry Diky <diwil@mail.ru>
1006
1007         * archures.c: Add xW42 and xE42 parts. Sort MPU list according to
1008         gcc order.
1009         * cpu-msp430.c: Likewise.
1010         * elf32-msp430.c: Likewise.
1011         * bfd-in2.h: Regenerate.
1012
1013 2003-08-07  Alan Modra  <amodra@bigpond.net.au>
1014
1015         * elfxx-target.h: Remove PTR cast.
1016         * targets.c (bfd_target): Make backend_data const void *.
1017         * elf-bfd.h: Constify all occurrences of struct elf_backend_data.
1018         * elf-m10300.c: Likewise.
1019         * elf.c: Likewise.
1020         * elf32-hppa.c: Likewise.
1021         * elf32-i386.c: Likewise.
1022         * elf32-m68hc1x.c: Likewise.
1023         * elf32-ppc.c: Likewise.
1024         * elf32-s390.c: Likewise.
1025         * elf32-sh.c: Likewise.
1026         * elf32-sh64.c: Likewise.
1027         * elf32-sparc.c: Likewise.
1028         * elf32-xtensa.c: Likewise.
1029         * elf64-mips.c: Likewise.
1030         * elf64-ppc.c: Likewise.
1031         * elf64-s390.c: Likewise.
1032         * elf64-sh64.c: Likewise.
1033         * elf64-sparc.c: Likewise.
1034         * elf64-x86-64.c: Likewise.
1035         * elfcode.h: Likewise.
1036         * elfcore.h: Likewise.
1037         * elflink.c: Likewise.
1038         * elflink.h: Likewise.
1039         * elfxx-ia64.c: Likewise.
1040         * elfxx-mips.c: Likewise.
1041         * elfxx-mips.h: Likewise.
1042         * elf.c (prep_headers): Remove useless check for null backend_data.
1043         * bfd-in2.h: Regenerate.
1044
1045         * elf-bfd.h: Remove PARAMS macro.  Replace PTR with void *.
1046         (NAME): Use ## rather than CONCAT4 macro.
1047         * elfcode.h: Remove one remaining PARAMS macro.
1048         * elf-eh-frame.c: Convert to C90, remove unneeded casts and prototypes.
1049         * elf-strtab.c: Likewise.
1050         * elf-hppa.h: Likewise.
1051         * elf32-hppa.h: Likewise.
1052         * elf32-hppa.c: Likewise.
1053         (elf32_hppa_add_symbol_hook): Delete.
1054         (elf_backend_add_symbol_hook): Don't define.
1055         * libhppa.h: Convert to C90.  Replace INLINE with inline.
1056
1057 2003-08-06  Alan Modra  <amodra@bigpond.net.au>
1058
1059         * elf64-ppc.c (ppc_stub_name): Tweak names for better readability.
1060         (ppc64_elf_adjust_dynamic_symbol): Allow copy relocs against
1061         function descriptors, but warn.
1062         (ppc_build_one_stub): Remove a couple of vars.  Move code creating
1063         stub syms so that we can avoid a stub sym if we already have a
1064         plt sym.  Do not redefine an existing symbol.
1065         (ppc64_elf_build_stubs): When --emit-stub-syms, print a symbol for
1066         glink.
1067
1068 2003-08-06  Nick Clifton  <nickc@redhat.com>
1069
1070         * po/fr.po: Updated French translation.
1071
1072 2003-08-06  Alan Modra  <amodra@bigpond.net.au>
1073
1074         * elflink.c (_bfd_elf_create_dynamic_sections): Mark .dynbss with
1075         SEC_LINKER_CREATED.
1076
1077 2003-08-05  Daniel Jacobowitz  <drow@mvista.com>
1078
1079         * elf32-arm.h (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Define.
1080         (elf32_arm_final_link_relocate, elf32_arm_relocate_section): Use it.
1081
1082 2003-08-03  Jeff Muizelaar  <muizelaar@rogers.com>
1083
1084         * coffcode.h (coff_slurp_line_table): Return with a warning
1085         message if the line number table could not be read.
1086
1087 2003-08-04  Nick Clifton  <nickc@redhat.com>
1088
1089         * elflink.h (elf_link_add_object_symbols): Prepend "warning: "
1090         to messages produced for .gnu.warning.SYMBOL sections.
1091
1092 2003-08-04  Alan Modra  <amodra@bigpond.net.au>
1093
1094         * elfcode.h: Convert to C90, remove unneeded casts and prototypes.
1095         * elfcore.h: Likewise.
1096         * elflink.c: Likewise.
1097         * elflink.h: Likewise.
1098         * elf.c (sym_is_global): Remove INLINE.
1099         (align_file_position): Replace INLINE with inline.
1100         * elfcode.h (elf_swap_dyn_in, elf_swap_dyn_out): Remove INLINE.
1101         (elf_file_p): Replace INLINE with inline.
1102
1103 2003-08-02  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1104
1105         * elf32-sh.c (sh_elf_check_relocs): Don't set DF_TEXTREL here.
1106
1107 2003-08-01  H.J. Lu  <hongjiu.lu@intel.com>
1108
1109         * elfxx-ia64.c (get_got): Align the .got section at 8 bytes.
1110
1111 2003-08-01  H.J. Lu  <hongjiu.lu@intel.com>
1112
1113         * elfxx-ia64.c (elfNN_ia64_finish_dynamic_symbol): Use
1114         ElfNN_External_Rela instead of Elf64_External_Rela.
1115
1116 2003-08-01  Nick Clifton  <nickc@redhat.com>
1117
1118         * config.bfd: Add code to catch obsolete configurations and warn
1119         about them unless --enable-obsolete is used.  Use this to mark
1120         vax-vms port as obsolete.
1121
1122 2003-07-30  Alan Modra  <amodra@bigpond.net.au>
1123
1124         * elf32-ppc.c (ppc_elf_install_value): Tidy.
1125         (ppc_elf_relax_section): Remove dead code.  Remove unnecessary casts.
1126         Formatting.
1127         * elfxx-target.h: Remove PARAMS macro.  Formatting.
1128
1129 2003-07-30  Alan Modra  <amodra@bigpond.net.au>
1130
1131         * elf.c (bfd_section_from_r_symndx): Test for SHN_UNDEF.
1132         * elf64-ppc.c (get_fdh): New function, split out from
1133         ppc64_elf_edit_opd.
1134         (ppc64_elf_check_relocs): Use get_fdh.
1135         (func_desc_adjust): Likewise.  Tidy.
1136         (ppc64_elf_edit_opd): Tighten reloc checks.  Free local_syms on error
1137         exit.  Use get_fdh.  Account for superfluous dynamic relocs.
1138         (ppc64_elf_relocate_section): Warning fix.
1139
1140 2003-07-30  Jason Eckhardt  <jle@rice.edu>
1141
1142         * coff-i860.c: Convert to ISO C90.  Remove superflous prototypes.
1143
1144 2003-07-30  Jason Eckhardt  <jle@rice.edu>
1145
1146         * elf32-i860.c: Convert to ISO C90.  Remove superflous prototypes.
1147
1148 2003-07-30  Randolph Chung  <tausq@debian.org>
1149
1150         * elf-hppa.h (elf_hppa_relocate_section): Look up dyn_h for undefweak.
1151         * elf64-hppa.c (elf64_hppa_finalize_dlt): Check h->root.type.
1152
1153 2003-07-30  Alan Modra  <amodra@bigpond.net.au>
1154
1155         * elf.c: Convert to C90, remove unnecessary prototypes and casts.
1156         Replace PTR with void *.  Formatting.
1157         (_bfd_elf_assign_file_position_for_section): Remove INLINE.
1158         (make_mapping): Likewise.
1159
1160 2003-07-29  Alan Modra  <amodra@bigpond.net.au>
1161
1162         * elf64-ppc.c (func_desc_adjust): Give linker created function
1163         descriptor symbols a size and type.
1164         (ppc64_elf_relocate_section): Correct lq insn test.
1165
1166 2003-07-28  Eric Christopher  <echristo@redhat.com>
1167
1168         * elf32-ppc.c (R_PPC_RELAX32): New relocation.
1169         (ppc_elf_install_value): New function.
1170         (ppc_elf_sort_rela): Remove.
1171         (ppc_elf_relax_section): Rewrite. Remove old relaxation
1172         and replace with out of range branch stubs.
1173         (ppc_elf_relocate_section): Handle R_PPC_RELAX32.
1174
1175 2003-07-29  Alexandre Oliva  <aoliva@redhat.com>
1176
1177         * elf-m10300.c (mn10300_elf_relax_section): Take symbol hash table
1178         from input_bfd.
1179
1180 2003-07-28  Alan Modra  <amodra@bigpond.net.au>
1181
1182         * elf.c (special_sections): Set attributes for .got and .plt.
1183
1184 2003-07-27  Alan Modra  <amodra@bigpond.net.au>
1185
1186         * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Ensure no copy relocs
1187         on function descriptors.
1188         (ELIMINATE_COPY_RELOCS): Expand comment.
1189         (ppc64_elf_special_sections): Move.  Don't include non-ppc64 sections.
1190         Do include ".toc1".
1191
1192 2003-07-25  H.J. Lu  <hongjiu.lu@intel.com>
1193
1194         * elf.c (_bfd_elf_new_section_hook): Set the default section
1195         type to SHT_NULL.
1196         (elf_fake_sections): Set the section type based on asect->flags
1197         if it is SHT_NULL. Don't abort on processor specific section
1198         types.
1199
1200 2003-07-25  H.J. Lu  <hongjiu.lu@intel.com>
1201
1202         * bfd-in2.h: Regenerated.
1203
1204 2003-07-25  H.J. Lu  <hongjiu.lu@intel.com>
1205
1206         * elf-bfd.h (bfd_elf_special_section): New.
1207         (elf_backend_data): Add special_sections, a pointer to
1208         bfd_elf_special_section.
1209         (elf_section_type). New.
1210         (elf_section_flags): New.
1211         (_bfd_elf_get_sec_type_attr): New.
1212
1213         * elf.c (_bfd_elf_make_section_from_shdr): Always use the
1214         real section type/flags.
1215         (special_sections): New.
1216         (get_special_section): New.
1217         (_bfd_elf_get_sec_type_attr): New.
1218         (_bfd_elf_new_section_hook): Check special_section to set
1219         elf_section_type and elf_section_flags.
1220         (elf_fake_sections): Don't use section name to set ELF section
1221         data.
1222
1223         * elf32-m32r.c (m32r_elf_special_sections): New.
1224         (elf_backend_special_sections): Defined.
1225
1226         * elf32-m68hc11.c (elf32_m68hc11_special_sections): New.
1227         (elf_backend_special_sections): Defined.
1228
1229         * elf32-mcore.c (mcore_elf_special_sections): New.
1230         (elf_backend_special_sections): Defined.
1231
1232         * elf32-ppc.c (ppc_elf_special_sections): New.
1233         (elf_backend_special_sections): Defined.
1234
1235         * elf32-sh64.c (sh64_elf_special_sections): New.
1236         (elf_backend_special_sections): Defined.
1237
1238         * elf32-v850.c (v850_elf_special_sections): New.
1239         (elf_backend_special_sections): Defined.
1240
1241         * elf32-xtensa.c (elf_xtensa_special_sections): New.
1242         (elf_backend_special_sections): Defined.
1243
1244         * elf64-alpha.c (elf64_alpha_special_sections): New.
1245         (elf_backend_special_sections): Defined.
1246
1247         * elf64-hppa.c (elf64_hppa_special_sections): New.
1248         (elf_backend_special_sections): Defined.
1249
1250         * elf64-ppc.c (ppc64_elf_special_sections): New.
1251         (elf_backend_special_sections): Defined.
1252
1253         * elf64-sh64.c (sh64_elf64_special_sections): New.
1254         (elf_backend_special_sections): Defined.
1255
1256         * elfxx-ia64.c (elfNN_ia64_special_sections): New.
1257         (elf_backend_special_sections): Defined.
1258
1259         * elfxx-mips.c (_bfd_mips_elf_special_sections): New.
1260
1261         * elfxx-mips.h (_bfd_mips_elf_special_sections): New.
1262         (elf_backend_special_sections): Defined.
1263
1264         * elfxx-target.h (elf_backend_special_sections): New. Default
1265         to NULL.
1266         (elfNN_bed): Initialize special_sections.
1267
1268         * section.c (bfd_abs_section): Remove const.
1269         (bfd_und_section): Likewise.
1270         (bfd_com_section): Likewise.
1271         (bfd_ind_section): Likewise.
1272
1273 2003-07-24  Nick Clifton  <nickc@redhat.com>
1274
1275         * coff-arm.c (EXTRA_S_FLAGS): Include SEC_CODE so that code
1276         sections are assigned the LOAD attribute.
1277
1278 2003-07-25  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1279
1280         * elf32-sh.c: Convert to C90.  Replace PTR with void *.
1281         * elf32-sh64-com.c: Likewise.
1282         * elf32-sh64.c: Likewise.
1283         * elf32-sh64.h: Likewise.
1284         * elf64-sh64.c: Likewise.
1285
1286 2003-07-24  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1287
1288         * elf32-sh.c (sh_elf_adjust_dynamic_symbol): Use SYMBOL_CALLS_LOCAL.
1289         (allocate_dynrelocs): Likewise.
1290         (sh_elf_relocate_section): Likewise. Use SYMBOL_REFERENCES_LOCAL.
1291         (sh_elf_finish_dynamic_symbol): Use SYMBOL_REFERENCES_LOCAL.
1292
1293 2003-07-24  Nick Clifton  <nickc@redhat.com>
1294
1295         * po/fr.po: Updated French translation.
1296
1297 2003-07-23  Bob Wilson  <bob.wilson@acm.org>
1298
1299         * elf32-xtensa.c (xtensa_elf_dynamic_symbol_p): Make inline and move
1300         near the beginning of the file.  Swap order of arguments.  Call
1301         _bfd_elf_dynamic_symbol_p with "ignore_protected" set to 0.
1302         (elf_xtensa_fix_refcounts): Adjust xtensa_elf_dynamic_symbol_p call.
1303         (elf_xtensa_relocate_section): Likewise.
1304         (shrink_dynamic_reloc_sections): Likewise.
1305
1306 2003-07-23  Bob Wilson  <bob.wilson@acm.org>
1307
1308         * elf32-xtensa.c (plt_reloc_count): Fix typo in comment.
1309         (elf_xtensa_size_dynamic_sections): Use elf_discarded_section.
1310         (elf_xtensa_combine_prop_entries): Avoid returning non-zero without
1311         first printing an error message.
1312         (elf_xtensa_finish_dynamic_sections): Likewise.
1313         (elf_xtensa_discard_info_for_section): Adjust size of .got.loc when
1314         discarding literal table entries.
1315         (elf_xtensa_merge_private_bfd_data): Remove newline from error message.
1316         (elf_xtensa_do_asm_simplify): Likewise.
1317
1318 2003-07-23  Stephane Carrez  <stcarrez@nerim.fr>
1319
1320         * elf32-m68hc1x.c (elf32_m68hc11_size_stubs): Avoid crash when
1321         we have a local symbol in common section.
1322
1323 2003-07-22  H.J. Lu <hongjiu.lu@intel.com>
1324
1325         * elflink.c (_bfd_elf_dynamic_symbol_p): Don't return TRUE for
1326         weak symbols.
1327
1328 2003-07-22  Nick Clifton  <nickc@redhat.com>
1329
1330         * coffcode.h (coff_slurp_symbol_table): Add C_TCSYM and C_ECOML to
1331         expected RS6000 storage classes.
1332
1333 2003-07-21  H.J. Lu <hongjiu.lu@intel.com>
1334
1335         * elfxx-ia64.c (elfNN_ia64_size_dynamic_sections): Mark
1336         output_bfd unused to silence gcc.
1337
1338 2003-07-21  Nick Clifton  <nickc@redhat.com>
1339
1340         * po/sv.po: Updated Swedish translation.
1341
1342 2003-07-21  Alan Modra  <amodra@bigpond.net.au>
1343
1344         * elf-bfd.h (SYMBOL_REFERENCES_LOCAL, SYMBOL_CALLS_LOCAL): Use..
1345         (_bfd_elf_symbol_refs_local_p): ..this.  Declare.
1346         * elflink.c (_bfd_elf_symbol_refs_local_p): New function.
1347         * elf32-i386.c (elf_i386_relocate_section): Remove h NULL test
1348         now done in _bfd_elf_symbol_refs_local_p.
1349         * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
1350         * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
1351         * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
1352
1353 2003-07-18  H.J. Lu <hongjiu.lu@intel.com>
1354
1355         * elflink.c (_bfd_elf_dynamic_symbol_p): Undo the last change.
1356
1357 2003-07-18  H.J. Lu <hongjiu.lu@intel.com>
1358
1359         * elf-bfd.h (SYMBOL_REFERENCES_LOCAL): Fix a typo.
1360         (SYMBOL_CALLS_LOCAL): Likewise.
1361
1362         * elflink.c (_bfd_elf_dynamic_symbol_p): Return TRUE
1363         immediately if symbol isn't defined locally.
1364
1365 2003-07-18  Richard Henderson  <rth@redhat.com>
1366
1367         * elflink.c (_bfd_elf_dynamic_symbol_p): New.
1368         * elf-bfd.h (_bfd_elf_dynamic_symbol_p): Declare it.
1369         (SYMBOL_REFERENCES_LOCAL, SYMBOL_CALLS_LOCAL): Use it.
1370         * elf32-xtensa.c (xtensa_elf_dynamic_symbol_p): Likewise.
1371         * elf64-alpha.c (alpha_elf_dynamic_symbol_p): Likewise.
1372         * elf64-hppa.c (elf64_hppa_dynamic_symbol_p): Likewise.
1373         * elfxx-ia64.c (elfNN_ia64_dynamic_symbol_p): Likewise.
1374         Update all callers to provide the relocation being resolved.
1375
1376 2003-07-17  Shaun Jackman <sjackman@pathwayconnect.com>
1377
1378         * config.bfd (arm-wince-pe): Add -DARM_COFF_BUGFIX to
1379         targ_cflags.
1380
1381 2003-07-17  Nick Clifton  <nickc@redhat.com>
1382
1383         * po/es.po: New Spanish translation.
1384         * po/sv.po: New Swedish translation.
1385         * po/opcodes.pot: Regenerate.
1386
1387 2003-07-16  Richard Henderson  <rth@redhat.com>
1388
1389         * config.bfd, configure.host, configure.in: Remove ia64-aix support.
1390         * elfxx-ia64.c, targets.c: Likewise.
1391
1392 2003-07-16  Richard Henderson  <rth@redhat.com>
1393
1394         * elfxx-ia64.c (elfNN_ia64_dynamic_symbol_p): Properly return false
1395         for symbols defined locally plus -Bsymbolic.  Tidy logic.
1396
1397 2003-07-15  Richard Sandiford  <rsandifo@redhat.com>
1398
1399         * archures.c (bfd_mach_mips7000): New.
1400         * bfd-in2.h: Regenerated.
1401         * cpu-mips.c (arch_info_struct): Add an entry for mips:7000.
1402         * elfxx-mips.c (mips_set_isa_flags): Handle bfd_mach_mips7000.
1403         (mips_mach_extensions): Add an entry for it.
1404
1405 2003-07-14  Nick Clifton  <nickc@redhat.com>
1406
1407         * po/tr.po: Update with latest version.
1408         * po/SRC-POTFILES.in: Regenerate.
1409         * po/bfd.pot: Regenerate.
1410         * Makfile.in: Regenerate.
1411         * configure: Regenerate.
1412
1413 2003-07-12  Jeff Baker  <jbaker@qnx.com>
1414
1415         * bfd/config.bfd (__QNXTARGET__): Define for Neutrino architectures.
1416         * bfd/elf32-arm.h (ELF_MAXPAGESIZE): Set to 4k for Neutrino.
1417         * bfd/elf32-sh.c (ELF_MAXPAGESIZE): Set to 4k for Neutrino.
1418         * bfd/elf32-ppc.c (ELF_MAXPAGESIZE): Set to 4k for Neutrino.
1419
1420 2003-07-12  Jeff Muizelaar  <muizelaar@rogers.com>
1421
1422         * coffcode.h (coff_set_section_contents): Set the
1423         IMAGE_FILE_32BIT_MACHINE flag for PE targets.
1424
1425 2003-07-11  Richard Sandiford  <rsandifo@redhat.com>
1426
1427         * bfd-in.h (bfd_h8300_pad_address): Declare.
1428         * bfd-in2.h: Regenerate.
1429         * cpu-h8300.c (bfd_h8300_pad_address): New function.
1430         * coff-h8300.c (h8300_reloc16_estimate): Use it to canonicalize
1431         addresses before checking whether they can be relaxed.
1432         (h8300_reloc16_extra_cases): Likewise for the R_MOVL2 sanity check.
1433         Don't complain about overflows in general 8-bit relocations.
1434         * elf32-h8300.c (elf32_h8_relax_section): Use bfd_h8300_pad_address.
1435         Fix handling of R_H8_DIR24A8.
1436
1437 2003-07-11  Richard Sandiford  <rsandifo@redhat.com>
1438
1439         * elf32-h8300.c: Convert function prototypes and definitions
1440         to C90 syntax.
1441         * coff-h8300.c: Likewise.
1442         * cpu-h8300.c: Likewise.
1443
1444 2003-07-11  Alan Modra  <amodra@bigpond.net.au>
1445
1446         * po/SRC-POTFILES.in: Regenerate.
1447         * po/bfd.pot: Likewise.
1448
1449 2003-07-10  Bob Wilson  <bob.wilson@acm.org>
1450
1451         * elf32-xtensa.c (elf_xtensa_create_dynamic_sections): Create new
1452         .got.loc section.  Do not set SEC_ALLOC or SEC_LOAD flags for the
1453         .xt.lit.plt section.
1454         (elf_xtensa_size_dynamic_sections): Set size of the .got.loc section
1455         and allocate memory for it.
1456         (elf_xtensa_combine_prop_entries): Copy contents of .xt.lit output
1457         section to the .got.loc section.
1458         (elf_xtensa_finish_dynamic_sections): Fix up call to
1459         elf_xtensa_combine_prop_entries and set DT_XTENSA_GOT_LOC_OFF to
1460         the address of .got.loc.
1461         (relax_property_section): Shrink .got.loc to match changes in any
1462         literal table section.
1463         (xtensa_is_property_section): Change to match
1464         xtensa_get_property_section_name.
1465         (xtensa_is_littable_section): New.
1466
1467 2003-07-10  H.J. Lu <hongjiu.lu@intel.com>
1468
1469         * elfxx-ia64.c (IA64_HOWTO): Set dst_mask to -1 instead of
1470         -1LL.
1471
1472 2003-07-10  Alan Modra  <amodra@bigpond.net.au>
1473
1474         * Makefile.am (BFD32_BACKENDS): Add elf32-am33lin.lo.
1475         (BFD32_BACKENDS_CFILES): elf32-am33lin.c not elf32-am33lin.lo.
1476         Run "make dep-am".
1477         * Makefile.in: Regenerate.
1478
1479 2003-07-10  Alexandre Oliva  <aoliva@redhat.com>
1480
1481         2001-09-12  Alexandre Oliva  <aoliva@redhat.com>
1482         * elf32-am33lin.c (ELF_MACHINE_CODE): Redefine to EM_MN10300.
1483         (ELF_MACHINE_ALT1): Define to EM_CYGNUS_MN10300.
1484         2001-06-02  Nick Clifton  <nickc@cambridge.redhat.com>
1485         * elf32-am33lin.c: Rename global functions.
1486         2001-05-09  Alexandre Oliva  <aoliva@redhat.com>
1487         * config.bfd (am33_2.0, am33_2.0-*-linux*): Added.
1488         * configure.in (bfd_elf32_am33lin_vec): Added.
1489         * Makefile.am (BFD32_BACKENDS): Added elf32-am33lin.lo.
1490         (elf32-am33lin.lo): List dependencies.
1491         * aclocal.m4, configure, Makefile.in: Rebuilt.
1492         * elf-m10300.c (TARGET_LITTLE_SYM, TARGET_LITTLE_NAME,
1493         ELF_ARCH, ELF_MACHINE_CODE, ELF_MAXPAGESIZE): Define only if
1494         ELF_ARCH was not defined before.
1495         (elf_symbol_leading_char): Define if not defined.
1496         * elf32-am33lin.c: Override the definitions above.
1497         * targets.c (bfd_elf32_am33lin_vec): New.
1498
1499 2003-07-09  Alexandre Oliva  <aoliva@redhat.com>
1500
1501         2002-12-12  Alexandre Oliva  <aoliva@redhat.com>
1502         * elf-m10300.c (elf32_mn10300_link_hash_newfunc): Initialize
1503         pcrel_relocs_copied.
1504         2001-12-13  Alexandre Oliva  <aoliva@redhat.com>
1505         * elf-m10300.c (ELF_DYNAMIC_INTERPRETER): Renamed from
1506         ld-linux.so.2 to ld.so.1.
1507         2001-10-10  Alexandre Oliva  <aoliva@redhat.com>
1508         * elf-m10300.c (elf_mn10300_sizeof_plt0): New macro.
1509         (_bfd_mn10300_elf_adjust_dynamic_symbol): Use it.
1510         (_bfd_mn10300_elf_finish_dynamic_symbol): Likewise.
1511         * elf-m10300.c (_bfd_mn10300_elf_size_dynamic_sections): Allocate
1512         .rela.* section contents with bfd_zalloc.
1513         2001-09-25  Alexandre Oliva  <aoliva@redhat.com>
1514         * elf-m10300.c: Added declarations for functions missing them.
1515         Merge some shared-library changes from the i386 back-end.  Use
1516         R_MN10300_RELATIVE instead of R_MN10300_PCREL32 and
1517         R_MN10300_GLOB_DAT instead of R_MN10300_32 where appropriate.
1518         (struct elf32_mn10300_link_hash_entry): Remove duplicates of
1519         members of elf_link_hash_entry.  Adjusted references.
1520         (mn10300_elf_final_link_relocate): dynobj was already loaded
1521         into a local variable, use it.
1522         2001-09-21  Nick Clifton  <nickc@cambridge.redhat.com>
1523         * elf-m10300.c: Add missing function prototypes.
1524         2001-08-24  Alexandre Oliva  <aoliva@redhat.com>
1525         * elf-m10300.c (mn10300_elf_relocate_section): Don't compute
1526         relocation for dynamic relocations.
1527         2001-05-16  Alexandre Oliva  <aoliva@redhat.com>
1528         * reloc.c (BFD_RELOC_MN10300_GOTOFF24): New.
1529         * elf-m10300.c: Introduce GOTPC16, GOTOFF24, GOTOFF16 and
1530         PLT16, and rename GOTPC to GOTPC32 and GOTOFF to GOTOFF32.
1531         (_bfd_mn10300_elf_create_dynamic_sections): Move creation ot PLT...
1532         (_bfd_mn10300_elf_create_got_section): ... here, so that its
1533         adress is already known at the time we compute relaxations.
1534         (mn10300_elf_relax_section): Relax GOTPC32, GOTOFF32, GOT32
1535         and PLT32 to narrower relocations.
1536         * libbfd.h, bfd-in2.h: Rebuilt.
1537         2001-04-12  Alexandre Oliva  <aoliva@redhat.com>
1538         * reloc.c (BFD_RELOC_MN10300_GOT32, BFD_RELOC_MN10300_GOT24,
1539         BFD_RELOC_MN10300_GOT16, BFD_RELOC_MN10300_COPY,
1540         BFD_RELOC_MN10300_GLOB_DAT, BFD_RELOC_MN10300_JMP_SLOT,
1541         BFD_RELOC_MN10300_RELATIVE): New relocs.
1542         * libbfd.h, bfd-in2.h: Rebuilt.
1543         * elf-m10300.c (struct elf_mn10300_pcrel_relocs_copied): New.
1544         (struct elf32_mn10300_link_hash_entry): Added DSO-related
1545         fields.
1546         (elf_mn10300_howto): Defined new relocation types.
1547         (mn10300_reloc_map): Map them.
1548         (_bfd_mn10300_elf_create_got_section): New fn.
1549         (mn10300_elf_check_relocs): Handle PIC relocs.
1550         (mn10300_elf_final_link_relocate): Likewise.
1551         (mn10300_elf_relocate_section): Handle DSOs.
1552         (PLT0_ENTRY_SIZE, PLT_ENTRY_SIZE, PIC_PLT_ENTRY_SIZE): New macros.
1553         (elf_mn10300_plt0_entry, elf_mn10300_plt_entry,
1554         elf_mn10300_pic_plt_entry): New.
1555         (elf_mn10300_sizeof_plt, elf_mn10300_plt_plt0_offset,
1556         elf_mn10300_plt0_linker_offset, elf_mn10300_plt0_gotid_offset,
1557         elf_mn10300_plt_temp_offset, elf_mn10300_plt_symbol_offset,
1558         elf_mn10300_plt_reloc_offset: New macros.
1559         (ELF_DYNAMIC_INTERPRETER): Likewise.
1560         (_bfd_mn10300_elf_create_dynamic_sections): New function.
1561         (_bfd_mn10300_elf_adjust_dynamic_symbol): Likewise.
1562         (_bfd_mn10300_elf_discard_copies): Likewise.
1563         (_bfd_mn10300_elf_size_dynamic_sections): Likewise.
1564         (_bfd_mn10300_elf_finish_dynamic_symbol): Likewise.
1565         (_bfd_mn10300_elf_finish_dynamic_sections): Likewise.
1566         (elf_backend_can_gc_sections,
1567         elf_backend_create_dynamic_sections,
1568         elf_backend_adjust_dynamic_sections,
1569         elf_backend_size_dynamic_sections,
1570         elf_backend_finish_dynamic_symbol,
1571         elf_backend_finish_dynamic_sections, elf_backend_want_got_plt,
1572         elf_backend_plt_readonly, elf_backend_want_plt_sym,
1573         elf_backend_got_header_size, elf_backend_plt_header_size): New
1574         macros.
1575
1576 2003-07-09  Alexandre Oliva  <aoliva@redhat.com>
1577
1578         2001-05-06  Alexandre Oliva  <aoliva@redhat.com>
1579         * elf-m10300.c (compute_function_info): Account for AM33
1580         registers in `movm' when computing stack space for `call' when
1581         linking for AM33/2.0 link.
1582         2000-04-01  Alexandre Oliva  <aoliva@cygnus.com>
1583         * archures.c (bfd_mach_am33_2): Renamed from bfd_mach_am332.
1584         * bfd-in2.h: Rebuilt.
1585         * cpu-m10300.c (bfd_am33_2_arch): Renamed from bfd_am332_arch.
1586         * elf-m10300.c: Updated.
1587         2000-03-31  Alexandre Oliva  <aoliva@cygnus.com>
1588         * archures.c (bfd_mach_am332): Defined.
1589         * bfd-in2.h: Rebuilt.
1590         * cpu-m10300.c (bfd_am332_arch): Defined.
1591         (bfd_am33_arch): Chained with am33-2.
1592         * elf-m10300.c (elf_mn10300_mach): Handle am332.
1593         (_bfd_mn10300_elf_final_write_processing): Likewise.
1594
1595 2003-07-09  H.J. Lu <hongjiu.lu@intel.com>
1596
1597         * elfxx-ia64.c (IA64_HOWTO): Set dst_mask to -1LL.
1598
1599 2003-07-10  Alan Modra  <amodra@bigpond.net.au>
1600
1601         * elf64-ppc.c (bfd_elf64_mkobject): Define.
1602         (struct ppc64_elf_obj_tdata): New.
1603         (ppc64_elf_tdata, ppc64_tlsld_got): Define.
1604         (ppc64_elf_mkobject): New function.
1605         (struct got_entry): Add "owner".  Move "tls_type".
1606         (struct ppc_link_hash_table): Delete "relgot", "tlsld_got".
1607         (ppc64_elf_init_stub_bfd): New function.
1608         (create_got_section): Create header .got in dynobj.  Create .got
1609         and .rela.got in each bfd.  Stash pointers in ppc64_elf_obj_tdata.
1610         (ppc64_elf_create_dynamic_sections): Don't call create_got_section.
1611         Look for dynobj .got, and test it.
1612         (ppc64_elf_copy_indirect_symbol): Adjust for changed got.
1613         (update_local_sym_info): Likewise.
1614         (ppc64_elf_check_relocs): Likewise.
1615         (ppc64_elf_gc_sweep_hook): Likewise.
1616         (ppc64_elf_tls_optimize): Likewise.
1617         (allocate_dynrelocs): Likewise.
1618         (ppc64_elf_size_dynamic_sections): Likewise.
1619         (ppc64_elf_relocate_section): Likewise.
1620         (ppc64_elf_next_toc_section): Update comment.
1621         (toc_adjusting_stub_needed): Remove unneeded cast.
1622         (ppc64_elf_build_stubs): Check for stub sections in stub bfd by
1623         testing section flags.
1624         (ppc64_elf_build_stubs): Likewise.
1625         (ppc64_elf_size_stubs): Likewise.  Remove stub_bfd param.
1626         (ppc64_elf_finish_dynamic_sections): Write out got sections.
1627         (func_desc_adjust): Copy over dynamic info for undef weaks.
1628         * elf64-ppc.h (ppc64_elf_init_stub_bfd): Declare.
1629         (ppc64_elf_size_stubs): Update prototype.
1630         * elflink.h (elf_link_sort_relocs): Use link_orders to find reldyn
1631         input sections rather than scanning dynobj.
1632
1633 2003-07-09  Richard Sandiford  <rsandifo@redhat.com>
1634
1635         * elfxx-mips.c (mips_elf_link_hash_entry): Remove min_dyn_reloc_index.
1636         (bfd_mips_elf_swap_msym_in, bfd_mips_elf_swap_msym_out): Delete.
1637         (mips_elf_create_msym_section): Delete.
1638         (mips_elf_create_dynamic_relocation): Don't set min_dyn_reloc_index.
1639         (_bfd_mips_elf_copy_indirect_symbol): Likewise.
1640         (_bfd_mips_elf_create_dynamic_sections): Don't create .msym.
1641         (_bfd_mips_elf_size_dynamic_sections): Don't calculate its size.
1642         (_bfd_mips_elf_size_dynamic_sections): Don't add DT_MIPS_MSYM.
1643         (_bfd_mips_elf_finish_dynamic_symbol): Don't add symbols to .msym.
1644         (_bfd_mips_elf_finish_dynamic_sections): Likewise.
1645
1646 2003-07-09  Richard Sandiford  <rsandifo@redhat.com>
1647
1648         * elfxx-mips.c (mips_elf_irix6_finish_dynamic_symbol): Make the
1649         symbols protected.
1650
1651 2003-07-09  Richard Sandiford  <rsandifo@redhat.com>
1652
1653         * elfxx-mips.c (mips_elf_create_dynamic_relocation): Fix handling
1654         of relocations whose offset is -2.
1655
1656 2003-07-09  Richard Sandiford  <rsandifo@redhat.com>
1657
1658         * bfd/elfxx-mips.c (mips_elf_create_dynamic_relocation): Treat
1659         forced-local symbols like other locals.  Don't create relocations
1660         against STN_UNDEF in irix objects.
1661
1662 2003-07-09  Richard Sandiford  <rsandifo@redhat.com>
1663
1664         * bfd/elfxx-mips.c (mips_elf_create_dynamic_relocation): In SGI-
1665         compatible objects, add the values of defined external symbols
1666         to the addend.
1667
1668 2003-07-09  Richard Sandiford  <rsandifo@redhat.com>
1669
1670         * elfxx-mips.c (_bfd_mips_elf_finish_dynamic_symbol): Always
1671         initialize a GOT entry to the symbol's st_value.
1672
1673 2003-07-08  Alan Modra  <amodra@bigpond.net.au>
1674
1675         * elf-bfd.h (struct elf_obj_tdata): Move linker_section_pointers..
1676         * elf32-ppc.c (struct ppc_elf_obj_tdata): ..to here.  New.
1677         (ppc_elf_tdata): Define.
1678         (elf_local_ptr_offsets): Adjust.
1679         (ppc_elf_mkobject): New function.
1680         (bfd_elf32_mkobject): Define.
1681
1682         * elfcode.h (elf_object_p): Allocate tdata via _bfd_set_format.
1683         * elfcore.h (elf_core_file_p): Likewise.
1684         * section.c (bfd_section_init): Remove prototype.
1685
1686 2003-07-08  Alan Modra  <amodra@bigpond.net.au>
1687
1688         * elf-bfd.h (struct elf_link_hash_entry): Remove linker_section_pointer
1689         field.
1690         (enum elf_linker_section_enum): Delete.
1691         (struct elf_linker_section): Delete.
1692         (struct elf_linker_section_pointers): Delete.
1693         (struct elf_obj_tdata): Remove #if 0 chunk.  Remove linker_section.
1694         Make linker_section_pointers a void**.
1695         (elf_local_ptr_offsets, elf_linker_section): Don't define.
1696         * elf32-ppc.c (enum elf_linker_section_enum): New, cut-down version
1697         of old item in elf-bfd.h.
1698         (struct elf_linker_section): Likewise.
1699         (struct elf_linker_section_pointers): Likewise.
1700         (elf_local_ptr_offsets): Define.
1701         (struct ppc_elf_link_hash_entry): Add linker_section_pointer.
1702         (ppc_elf_link_hash_newfunc): Init it.
1703         (struct ppc_elf_link_hash_table): Add sbss.
1704         (ppc_elf_link_hash_table_create): zmalloc rather than clearing
1705         individual fields.
1706         (elf_create_linker_section): Fold into..
1707         (ppc_elf_create_linker_section): ..here.  Remove hole_size code.
1708         Make rela section here if shared.
1709         (elf_find_pointer_linker_section): Pass lsect rather than enum.
1710         (elf_create_pointer_linker_section): Adjust.  zalloc rather than
1711         clearing in a loop.
1712         (elf_finish_pointer_linker_section): Adjust.  Don't make rela
1713         section here.
1714         (ppc_elf_check_relocs): Adjust.
1715         (ppc_elf_add_symbol_hook): Tighten hash creator test.  Remove code
1716         creating .sbss by hand.
1717         * elf.c (_bfd_elf_link_hash_newfunc): Adjust.
1718
1719 2003-07-04  Jakub Jelinek  <jakub@redhat.com>
1720
1721         * elf32-s390.c (elf_howto_table): Change R_390_GOT12 to
1722         complain_overflow_bitfield.
1723         * elf64-s390.c (elf_howto_table): Change R_390_GOT12 to
1724         complain_overflow_bitfield.
1725
1726 2003-07-04  Jakub Jelinek  <jakub@redhat.com>
1727
1728         * elf-bfd.h (SYMBOL_REFERENCES_LOCAL, SYMBOL_CALLS_LOCAL): Return
1729         true even if -pie.
1730
1731 2003-07-04  Jakub Jelinek  <jakub@redhat.com>
1732
1733         * elfxx-ia64.c (struct elfNN_ia64_link_hash_table): Add rel_fptr_sec.
1734         (elfNN_ia64_dynamic_symbol_p): Change info->shared into
1735         !info->executable.
1736         (get_fptr): For -pie create .opd as writable section and create
1737         .rela.opd as well.
1738         (elfNN_ia64_check_relocs): Change info->shared into
1739         !info->executable.
1740         (allocate_fptr): Likewise.
1741         (allocate_dynrel_entries): Account for a relative reloc for -pie
1742         @fptr().  Don't account for a relative reloc if -pie want_ltoff_fptr
1743         for undefweak symbol.  Account for an IPLT reloc in .rela.opd
1744         section if -pie.
1745         (set_got_entry): Don't create a relative reloc if -pie
1746         want_ltoff_fptr for undefweak symbol.
1747         (set_fptr_entry): Emit an IPLT reloc in .rela.opd for -pie.
1748         (elfNN_ia64_relocate_section): Emit a relative reloc for -pie
1749         @fptr().
1750
1751         * elfxx-ia64.c (elfNN_ia64_relocate_section): Issue undefined_symbol
1752         even if -pie.
1753         * elf32-i386.c (elf_i386_relocate_section): Likewise.
1754         * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
1755         * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
1756         * elf64-s390.c (elf_s390_relocate_section): Likewise.
1757         * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
1758         * elf64-alpha.c (elf64_alpha_relocate_section): Likewise.
1759         * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
1760         * elf32-s390.c (elf_s390_relocate_section): Likewise.
1761         * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
1762
1763 2003-07-04  Paul Clarke <paulc@senet.com.au>
1764
1765         * elf32-h8300.c (R_H8_DIR32A16): Fix name field.
1766         (elf32_h8_relax_section) <R_H8_DIR16A8>: Adjust position of relocation.
1767         <R_H8_DIR32A16>: Fix type of relocation.
1768
1769 2003-07-04  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1770
1771         * elf32-sh.c (sh_elf_create_dynamic_sections): Return if dynamic
1772         sections were created already.  Remove unnecessary tests of
1773         the previous change.
1774
1775 2003-07-04  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1776
1777         * elf32-sh.c (sh_elf_create_dynamic_sections): Don't call
1778         bfd_make_section for existing sections.
1779
1780 2003-07-04  Alan Modra  <amodra@bigpond.net.au>
1781
1782         * elf32-sparc.c (elf32_sparc_check_relocs): Don't call
1783         create_got_section if we already have done so.
1784         * elf32-sh.c (sh_elf_create_dynamic_sections): Likewise.
1785         (sh_elf_check_relocs): Likewise.
1786         (sh_elf_adjust_dynamic_symbol): Delete "dynobj" var.  Use
1787         htab->root.dynobj instead.
1788         (sh_elf_check_relocs): Likewise.
1789         (sh_elf_finish_dynamic_sections): Likewise.
1790
1791         * section.c (bfd_make_section): Return NULL for existing section.
1792
1793 2003-07-04  Alan Modra  <amodra@bigpond.net.au>
1794
1795         * elf32-ppc.c (ppc_elf_create_dynamic_sections): Don't call
1796         ppc_elf_create_got if we've already done so.
1797
1798         * elf-bfd.h (_bfd_elf_create_linker_section) Don't declare.
1799         (_bfd_elf_find_pointer_linker_section): Likewise.
1800         (bfd_elf32_create_pointer_linker_section): Likewise.
1801         (bfd_elf32_finish_pointer_linker_section): Likewise.
1802         (bfd_elf64_create_pointer_linker_section): Likewise.
1803         (bfd_elf64_finish_pointer_linker_section): Likewise.
1804         (_bfd_elf_make_linker_section_rela): Likewise.
1805         * elfcode.h (elf_create_pointer_linker_section): Don't define.
1806         (elf_finish_pointer_linker_section): Likewise.
1807         * elflink.c (_bfd_elf_make_linker_section_rela): Delete.
1808         (_bfd_elf_create_linker_section): Move this function..
1809         (_bfd_elf_find_pointer_linker_section): ..and this..
1810         * elflink.h (elf_create_pointer_linker_section): ..and this..
1811         (elf_finish_pointer_linker_section): ..and this..
1812         * elf32-ppc.c: ..to here, renaming to the following, and adjusting
1813         calls.
1814         (elf_create_linker_section): Convert to C90, tidy.
1815         (elf_find_pointer_linker_section): Likewise.
1816         (elf_create_pointer_linker_section): Likewise.
1817         (elf_finish_pointer_linker_section): Likewise.
1818         * elf32-i370.c: Delete #if 0 code.
1819
1820 2003-07-02  Alan Modra  <amodra@bigpond.net.au>
1821
1822         * elf64-ppc.c (ppc64_elf_func_desc_adjust): Don't allow _savef* and
1823         _restf* to be satisfied by shared libs, and always force them local.
1824         (toc_adjusting_stub_needed): Avoid scanning linker created sections.
1825         Correct test for "bl".
1826         (ppc64_elf_relocate_section <R_PPC64_TLS>): Correct test for
1827         primary opcode 31.
1828
1829 2003-07-01  Martin Schwidefsky  <schwidefsky@de.ibm.com>
1830
1831         * elf32-s390.c (s390_elf_ldisp_reloc): New prototype.
1832         (s390_tls_reloc): New function.
1833         (elf_howto_table): Add long displacement relocations R_390_20,
1834         R_390_GOT20, R_390_GOTPLT20 and R_390_TLS_GOTIE20.
1835         (elf_s390_reloc_type_lookup): Likewise.
1836         (elf_s390_check_relocs): Likewise.
1837         (elf_s390_gc_sweep_hook): Likewise.
1838         (elf_s390_relocate_section): Likewise.
1839         * elf64-s390.c: Same changes as for elf32-s390.c.
1840         * reloc.c: Add long displacement relocations BFD_RELOC_390_20,
1841         BFD_RELOC_390_GOT20, BFD_RELOC_390_GOTPLT20 and
1842         BFD_RELOC_390_TLS_GOTIE20.
1843         * bfd-in2.h: Regenerate.
1844         * libbfd.h: Likewise.
1845
1846 2003-06-30  Alan Modra  <amodra@bigpond.net.au>
1847
1848         * cpu-ia64-opc.c (ext_imms_scaled): Don't sign extend using shifts.
1849         (ins_imms, ins_immsm1u4): Likewise.  Warning fix.
1850
1851 2003-06-29  Alan Modra  <amodra@bigpond.net.au>
1852
1853         * archive.c: Convert to C90, remove unnecessary prototypes and casts.
1854         Replace PTR with void *.  Formatting.
1855         * archive64.c: Likewise.
1856         * archures.c: Likewise.
1857         * bfd-in.h: Likewise.
1858         * bfd.c: Likewise.
1859         * bfdio.c: Likewise.
1860         * bfdwin.c: Likewise.
1861         * cache.c: Likewise.
1862         * corefile.c: Likewise.
1863         * format.c: Likewise.
1864         * init.c: Likewise.
1865         * libbfd-in.h: Likewise.
1866         * libbfd.c: Likewise.
1867         * linker.c: Likewise.
1868         * opncls.c: Likewise.
1869         * reloc.c: Likewise.
1870         * section.c: Likewise.
1871         * simple.c: Likewise.
1872         * syms.c: Likewise.
1873         * targets.c: Likewise.
1874         * bfd-in2.h: Regenerate.
1875         * libbfd.h: Regenerate.
1876
1877         * ecoff.c (bfd_debug_section): Add missing kept_section initialization.
1878         * libbfd-in.h (_bfd_sh_align_load_span): Don't declare if defined.
1879         * libbfd.c (COERCE32, EIGHT_GAZILLION): Simplify.
1880         (bfd_getb64): Rewrite without parens.
1881         (bfd_getl64, bfd_getb_signed_64, bfd_getl_signed_64): Likewise.
1882         * cache.c (insert, snip): Remove INLINE.
1883         * linker.c (bfd_link_add_undef): Likewise.
1884
1885 2003-06-29  Andreas Jaeger  <aj@suse.de>
1886
1887         * elf64-x86-64.c: Convert to ISO C90 prototypes, remove
1888         unnecessary prototypes.  Replace PTR with void *.
1889         (elf64_x86_64_adjust_dynamic_symbol): Use SYMBOL_CALLS_LOCAL to
1890         trim plt entries.  Move undefweak non-default visibility test ...
1891         (allocate_dynrelocs): ... from here.
1892         (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Pass SHARED instead of INFO.
1893         Change all callers.
1894         (allocate_dynrelocs): Use SYMBOL_CALLS_LOCAL.  Use
1895         SYMBOL_REFERENCES_LOCAL for dynreloc check.
1896         (elf64_x86_64_relocate_section): Use SYMBOL_CALLS_LOCAL for
1897         dynreloc and .got relocs.
1898         (elf64_x86_64_finish_dynamic_symbol): Use SYMBOL_REFERENCES_LOCAL
1899         for .got relocs.
1900
1901 2003-06-29  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
1902
1903         * elfxx-mips.c: Allow lazy binding for R_MIPS_JALR.
1904
1905 2003-06-27  Nick Clifton  <nickc@redhat.com>
1906
1907         * opncls.c (bfd_add_gnu_debuglink_section): Rename to
1908         bfd_add_gnu_debuglink_section and only create the section, do not
1909         fill in its contents.
1910         (bfd_fill_in_gnu_debuglink_section): New function.  Fill in the
1911         contents of a .gnu-debuglink section.
1912         * bfd-in2.h: Regenerate.
1913
1914 2003-06-27  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
1915
1916         * elfxx-mips.c: Revert .got alignment to 2**4.
1917
1918 2003-06-27  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
1919
1920         * elf32-mips.c: Fix addend for _gp_disp special symbol.
1921
1922 2003-06-27  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
1923
1924         * elfxx-mips.c (_bfd_mips_elf_fake_sections): Remove non-default
1925         relocation header setup.
1926
1927 2003-06-25  Alan Modra  <amodra@bigpond.net.au>
1928
1929         * elf32-ppc.c (ppc_elf_howto_table): Remove unnecessary cast.
1930         (ppc_elf_reloc_type_lookup): Modify comment.
1931         (ppc_elf_info_to_howto): Ditto.
1932         (ppc_elf_relocate_section): Ditto.
1933         (ppc_elf_check_relocs): Call ppc_elf_howto_init.
1934
1935 2003-06-25  Alan Modra  <amodra@bigpond.net.au>
1936
1937         * aout-ns32k.c: Correct spelling of "relocatable".
1938         * aoutx.h: Likewise.
1939         * bfd-in.h: Likewise.
1940         * bfd.c: Likewise.
1941         * bout.c: Likewise.
1942         * coff-a29k.c: Likewise.
1943         * coff-alpha.c: Likewise.
1944         * coff-arm.c: Likewise.
1945         * coff-i386.c: Likewise.
1946         * coff-i860.c: Likewise.
1947         * coff-i960.c: Likewise.
1948         * coff-m68k.c: Likewise.
1949         * coff-m88k.c: Likewise.
1950         * coff-mcore.c: Likewise.
1951         * coff-mips.c: Likewise.
1952         * coff-or32.c: Likewise.
1953         * coff-ppc.c: Likewise.
1954         * coff-rs6000.c: Likewise.
1955         * coff-sh.c: Likewise.
1956         * coff-tic80.c: Likewise.
1957         * coff64-rs6000.c: Likewise.
1958         * cofflink.c: Likewise.
1959         * cpu-ns32k.c: Likewise.
1960         * ecoff.c: Likewise.
1961         * ecofflink.c: Likewise.
1962         * elf-bfd.h: Likewise.
1963         * elf-eh-frame.c: Likewise.
1964         * elf-hppa.h: Likewise.
1965         * elf-m10200.c: Likewise.
1966         * elf-m10300.c: Likewise.
1967         * elf.c: Likewise.
1968         * elf32-arm.h: Likewise.
1969         * elf32-avr.c: Likewise.
1970         * elf32-cris.c: Likewise.
1971         * elf32-d10v.c: Likewise.
1972         * elf32-dlx.c: Likewise.
1973         * elf32-fr30.c: Likewise.
1974         * elf32-frv.c: Likewise.
1975         * elf32-h8300.c: Likewise.
1976         * elf32-hppa.c: Likewise.
1977         * elf32-i370.c: Likewise.
1978         * elf32-i386.c: Likewise.
1979         * elf32-i860.c: Likewise.
1980         * elf32-i960.c: Likewise.
1981         * elf32-ip2k.c: Likewise.
1982         * elf32-iq2000.c: Likewise.
1983         * elf32-m32r.c: Likewise.
1984         * elf32-m68hc11.c: Likewise.
1985         * elf32-m68hc1x.c: Likewise.
1986         * elf32-m68k.c: Likewise.
1987         * elf32-mcore.c: Likewise.
1988         * elf32-mips.c: Likewise.
1989         * elf32-msp430.c: Likewise.
1990         * elf32-openrisc.c: Likewise.
1991         * elf32-ppc.c: Likewise.
1992         * elf32-s390.c: Likewise.
1993         * elf32-sh.c: Likewise.
1994         * elf32-sh64.c: Likewise.
1995         * elf32-sparc.c: Likewise.
1996         * elf32-v850.c: Likewise.
1997         * elf32-vax.c: Likewise.
1998         * elf32-xstormy16.c: Likewise.
1999         * elf32-xtensa.c: Likewise.
2000         * elf64-alpha.c: Likewise.
2001         * elf64-hppa.c: Likewise.
2002         * elf64-mips.c: Likewise.
2003         * elf64-mmix.c: Likewise.
2004         * elf64-ppc.c: Likewise.
2005         * elf64-s390.c: Likewise.
2006         * elf64-sh64.c: Likewise.
2007         * elf64-sparc.c: Likewise.
2008         * elf64-x86-64.c: Likewise.
2009         * elfcode.h: Likewise.
2010         * elflink.h: Likewise.
2011         * elfn32-mips.c: Likewise.
2012         * elfxx-ia64.c: Likewise.
2013         * elfxx-mips.c: Likewise.
2014         * i386linux.c: Likewise.
2015         * ieee.c: Likewise.
2016         * libcoff-in.h: Likewise.
2017         * linker.c: Likewise.
2018         * m68klinux.c: Likewise.
2019         * pdp11.c: Likewise.
2020         * pe-mips.c: Likewise.
2021         * peXXigen.c: Likewise.
2022         * reloc.c: Likewise.
2023         * reloc16.c: Likewise.
2024         * sparclinux.c: Likewise.
2025         * sunos.c: Likewise.
2026         * syms.c: Likewise.
2027         * versados.c: Likewise.
2028         * vms.c: Likewise.
2029         * xcofflink.c: Likewise.
2030         * bfd-in2.h: Regenerate.
2031         * libcoff.h: Regenerate.
2032         * libbfd.h: Regenerate.
2033
2034 2003-06-24  Alan Modra  <amodra@bigpond.net.au>
2035
2036         * elf32-ppc.c (ppc_elf_check_relocs): Report plt reloc against
2037         local sym errors.
2038
2039         * elf32-i386.c: Convert to C90 function definitions, remove unnecessary
2040         prototypes and casts.  Replace PTR with void *.  Formatting.
2041         * elf32-ppc.c: Likewise.  Break long strings too.
2042         (ppc_elf_relax_section): Use enum elf_ppc_reloc_type for r_type.
2043         (ppc_elf_unhandled_reloc): Internationalize error message.
2044         * elf32-ppc.h: Remove PARAMS.
2045
2046 2003-06-23  Mark Mitchell  <mark@codesourcery.com>
2047
2048         * elf32-ppc.c (ppc_elf_begin_write_processing): Use bytes to count
2049         APUinfo slots.
2050         (ppc_elf_final_write_processing): Likewise.
2051
2052 2003-06-23  H.J. Lu <hongjiu.lu@intel.com>
2053
2054         * elflink.h (elf_link_input_bfd): Check raw size when using
2055         kept_section to preserve debug information discarded by
2056         linkonce.
2057
2058 2003-06-20  Alan Modra  <amodra@bigpond.net.au>
2059
2060         * elf64-ppc.c (struct ppc_link_hash_table): Add top_id.
2061         (ppc64_elf_setup_section_lists): Set it.
2062         (ppc64_elf_relocate_section): Check sym section id against top_id.
2063         (ppc_build_one_stub): Comment on top_id.
2064
2065 2003-06-20  Ralf Corsepius  <corsepiu@faw.uni-ulm.de>
2066
2067         * config.bfd: Add tic4x-*-rtems*.
2068
2069 2003-06-20  Alan Modra  <amodra@bigpond.net.au>
2070
2071         * elf64-ppc.c: Convert to C90 function definitions, remove unnecessary
2072         prototypes and casts.  Replace PTR with void *.  Format copyright.
2073         Mention ABI links.
2074         (struct ppc_link_hash_table): Rename sgot, srelgot, splt, srelplt,
2075         sdynbss, srelbss, sglink, sbrlt and srelbrlt to got, relgot .. relbrlt.
2076         (ppc_type_of_stub): Make r_type an enum.
2077         (ppc64_elf_size_stubs): Likewise.
2078         * elf64-ppc.h: Remove PARAMS macro.
2079
2080 2003-06-19  Alan Modra  <amodra@bigpond.net.au>
2081
2082         * elf64-ppc.c (ppc64_elf_link_hash_table_create): Reinstate init of
2083         elf hash tab fields.
2084
2085         * elf64-ppc.c (ppc64_elf_reloc_type_lookup): Tidy prototype.
2086         (ppc64_elf_info_to_howto): Likewise.
2087         (ppc64_elf_build_stubs): Add "stats" param, and print statistics.
2088         * elf64-ppc.h (ppc64_elf_build_stubs): Adjust prototype.
2089
2090 2003-06-19  Alan Modra  <amodra@bigpond.net.au>
2091
2092         * elf64-sparc.c (sparc64_elf_relocate_section): Ignore R_SPARC_DISP32
2093         reloc overflow on discarded eh_frame entries.
2094
2095 2003-06-19  Alan Modra  <amodra@bigpond.net.au>
2096
2097         * elf64-ppc.c (toc_adjusting_stub_needed): New function.
2098         (ppc64_elf_next_input_section): Use it here to set has_gp_reloc.
2099         Return error condition.
2100         (ppc64_elf_size_stubs): Restrict toc adjusting stubs to sections
2101         that have has_gp_reloc set.
2102         (struct ppc_link_hash_table): Add stub_count.
2103         (ppc_build_one_stub): Increment it.
2104         (ppc64_elf_link_hash_table_create): zmalloc rather than clearing
2105         individual fields.
2106         * elf64-ppc.h (ppc64_elf_next_input_section): Update prototype.
2107
2108 2003-06-18  Alan Modra  <amodra@bigpond.net.au>
2109
2110         * elflink.h (elf_gc_record_vtentry): Revert last change.  Correct
2111         size calculation from addend.  Round size up.
2112
2113 2003-06-18  Hans-Peter Nilsson  <hp@axis.com>
2114
2115         * elf32-cris.c (cris_elf_relocate_section) <case
2116         R_CRIS_32_GOTREL>: When linking a program, don't complain about a
2117         symbol from a normal object or an undefined weak symbol.
2118
2119 2003-06-18  Alan Modra  <amodra@bigpond.net.au>
2120
2121         * elf64-ppc.c (ppc64_elf_relocate_section): Accept a symbol on
2122         R_PPC64_TOC relocs.
2123
2124 2003-06-17  H.J. Lu <hongjiu.lu@intel.com>
2125
2126         * section.c (struct sec): Put back kept_section.
2127         (STD_SECTION): Put back kept_section initialization.
2128         * bfd-in2.h: Regenerate.
2129
2130         * elflink.h (elf_link_input_bfd): Also check discarded linkonce
2131         sections for relocateable output. Use kept_section to preserve
2132         debug information discarded by linkonce.
2133
2134 2003-06-17  Roland McGrath  <roland@redhat.com>
2135
2136         * elfxx-ia64.c (elfNN_ia64_relocate_section): Support
2137         segment-relative relocation between different segments.
2138
2139 2003-06-17  Alan Modra  <amodra@bigpond.net.au>
2140
2141         * elf64-ppc.c (ppc64_elf_relocate_section): Do unaligned reloc
2142         optimizations earlier.
2143
2144         * elf64-ppc.c (struct ppc_link_hash_table): Reinstate top_index.
2145         Restore previous input_list type.
2146         (ppc64_elf_link_hash_table_create): Undo last change.
2147         (ppc64_elf_setup_section_lists): Reinstate code setting up input lists
2148         per output section, but don't bother with bfd_abs_section marker.
2149         (ppc64_elf_next_input_section): Adjust for multiple input section
2150         lists.
2151         (group_sections): Likewise.
2152
2153 2003-06-17  Jakub Jelinek  <jakub@redhat.com>
2154
2155         * elf64-ppc.c (ppc64_elf_relocation_section): Ensure
2156         *r_offset == r_addend for RELATIVE relocs against .got.
2157
2158 2003-06-17  Alan Modra  <amodra@bigpond.net.au>
2159
2160         * elf64-ppc.c (ppc64_elf_relocate_section): Optimize unaligned relocs.
2161
2162 2003-06-17  Nick Clifton  <nickc@redhat.com>
2163
2164         * elflink.h (elf_gc_record_vtentry): Allocate an extra element
2165         in the vtable_entries_used array to allow for the accessing
2166         the largest element.
2167
2168 2003-06-17  Alan Modra  <amodra@bigpond.net.au>
2169
2170         * elf64-ppc.c (struct ppc_link_hash_table): Remove top_index.  Modify
2171         input_list.
2172         (ppc64_elf_link_hash_table_create): Init input_list here.
2173         (ppc64_elf_setup_section_lists): Remove code setting up input lists
2174         per output section.  Set toc_off for abs and other standard sections.
2175         (ppc64_elf_reinit_toc): Don't set elf_gp on input bfds lacking a toc.
2176         (ppc64_elf_next_input_section): Adjust for single input section list.
2177         Don't set toc_curr from input bfds that haven't set elf_gp.
2178         (group_sections): Adjust for single input section list.
2179
2180         * elf64-ppc.c (ppc64_elf_relocate_section): Correct pcrel section zero.
2181
2182 2003-06-16  Alan Modra  <amodra@bigpond.net.au>
2183
2184         * elf64-ppc.c (ppc64_elf_relocate_section): When optimizing toctprel
2185         tls, check that a TOC16_DS or TOC16_LO_DS reloc isn't pointing to a
2186         dtprel entry.  Ensure TLS_LD DTPMOD reloc has a zero addend.  Write
2187         got section for RELATIVE relocs.  Fix wrong comment.  Change condition
2188         under which dynamic relocs update the section contents.
2189
2190 2003-06-13  Robert Millan  <zeratul2@wanadoo.es>
2191
2192         * config.bfd: Add i386-netbsd-gnu target.
2193
2194 2003-06-12  Nick Clifton  <nickc@redhat.com>
2195
2196         * opncls.c (calc_crc32): Rename to
2197         bfd_calc_gnu_debuglink_crc32 and export.
2198         (GNU_DEBUGLINK): Define and use to replace occurrences of
2199         hard-coded ".gnu_debuglink" in the code.
2200         (get_debug_link_info): Prevent aborts by replacing call to
2201         xmalloc with a call to malloc.
2202         (find_separate_debug_file): Prevent aborts by replacing calls
2203         to xmalloc and xstrdup with calls to malloc and strdup.
2204         (bfd_add_gnu_debuglink): New function.  Add a .gnu_debuglink
2205         section to a bfd.
2206         * bfd-in2.h: Regenerate.
2207
2208 2003-06-12 Federico G. Schwindt <fgsch@lodoss.net>
2209
2210         * config.bfd (i[3-7]86-*-openbsd[0-2].* | i[3-7]86-*-openbsd3.[0-3]):
2211         New target (was i[3-7]86-*-openbsd* before).
2212         (i[3-7]86-*-openbsd*): Change to use bfd_elf32_i386_vec.
2213         (vax-*-openbsd*): New target.
2214
2215 2003-06-11  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
2216
2217         * elfxx-mips.c (MIPS_ELF_OPTIONS_SECTION_NAME): Use .MIPS.options
2218         for n32, too.
2219         (MIPS_ELF_STUB_SECTION_NAME): Use .MIPS.stubs for n32, too.
2220         (mips_elf_rel_dyn_section): Use appropriate section alignment.
2221         (mips_elf_create_got_section): Likewise.
2222         (_bfd_mips_elf_create_dynamic_sections): Likewise.
2223
2224 2003-06-11  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
2225
2226         * elf32-mips.c (mips_elf_generic_reloc): New Function.
2227         (elf_mips_howto_table_rel): Use it.
2228         (gprel32_with_gp): Move prototype.
2229         (mips_elf_hi16_reloc): Check for ! BSF_LOCAL instead of zero addend.
2230         Use mips_elf_generic_reloc.
2231         (mips_elf_got16_reloc): Check for ! BSF_LOCAL instead of zero addend.
2232         Code cleanup.
2233         (_bfd_mips_elf32_gprel16_reloc): Check for ! BSF_LOCAL instead of
2234         zero addend.
2235         (mips_elf_gprel32_reloc): Likewise. Use the same GP assignment logic
2236         as in the other *_gprel*_reloc functions.
2237         (gprel32_with_gp): Handle partial_inplace properly.
2238         (mips32_64bit_reloc): Use mips_elf_generic_reloc.
2239         (mips16_gprel_reloc): Check for ! BSF_LOCAL instead of zero addend.
2240         Do addend handling directly instead of calling
2241         _bfd_mips_elf_gprel16_with_gp. Handle partial_inplace properly.
2242         * elf64-mips.c (mips_elf64_hi16_reloc): Check for ! BSF_LOCAL instead
2243         of zero addend. Handle partial_inplace properly.
2244         (mips_elf64_got16_reloc): Check for ! BSF_LOCAL instead of zero
2245         addend.
2246         (mips_elf64_gprel16_reloc): Likewise.
2247         (mips_elf64_literal_reloc): Likewise.
2248         (mips_elf64_gprel32_reloc): Likewise. Use the same GP assignment
2249         logic as in the other *_gprel*_reloc functions. Handle
2250         partial_inplace properly.
2251         (mips_elf64_shift6_reloc): Check for ! BSF_LOCAL instead of zero
2252         addend. Handle partial_inplace properly.
2253         (mips16_gprel_reloc): Likewise. Do addend handling directly instead
2254         of calling _bfd_mips_elf_gprel16_with_gp.
2255         * elfn32-mips.c (mips_elf_got16_reloc): Check for BSF_LOCAL.
2256         (mips_elf_gprel32_reloc): Check for ! BSF_LOCAL instead
2257         of zero addend.
2258         (mips_elf_shift6_reloc): Handle partial_inplace properly.
2259         (mips16_gprel_reloc): Likewise. Do addend handling directly instead
2260         of calling _bfd_mips_elf_gprel16_with_gp.
2261         * elfxx-mips.c (_bfd_mips_elf_gprel16_with_gp): Handle
2262         partial_inplace properly. Fix wrong addend handling. Fix overflow
2263         check.
2264         (_bfd_mips_elf_sign_extend): Renamed from mips_elf_sign_extend and
2265         exported.
2266         (mips_elf_calculate_relocation): Use _bfd_mips_elf_sign_extend.
2267         (_bfd_mips_elf_relocate_section): Likewise.
2268         (mips_elf_create_dynamic_relocation): Update sec_info_type access.
2269         * elfxx-mips.h (_bfd_mips_relax_section): Fix prototype declaration.
2270         (_bfd_mips_elf_sign_extend): New prototype.
2271
2272 2003-06-11 Federico G. Schwindt <fgsch@lodoss.net>
2273
2274         * config.bfd (sparc-*-openbsd[0-2].* | sparc-*-openbsd3.[0-1]):
2275         New target (was sparc-*-openbsd* before).
2276         (sparc-*-openbsd*): Change to use bfd_elf32_sparc_vec.
2277
2278         * configure.in (vax-*-openbsd*): Set COREFILE to netbsd-core.lo.
2279         * configure: Regenerate.
2280
2281 2003-06-11  H.J. Lu <hongjiu.lu@intel.com>
2282
2283         * po/Make-in (DESTDIR): New.
2284         (install-data-yes): Support $(DESTDIR).
2285         (uninstall): Likewise.
2286
2287 2003-06-11  Alan Modra  <amodra@bigpond.net.au>
2288
2289         * Makefile.am (config.status): Depend on version.h.
2290         Run "make dep-am".
2291         * Makefile.in: Regenerate.
2292         * po/SRC-POTFILES.in: Regenerate.
2293
2294 2003-06-10  Alan Modra  <amodra@bigpond.net.au>
2295             Gary Hade <garyhade@us.ibm.com>
2296
2297         * elf64-ppc.c (ppc64_elf_relocate_section <*_DS>): Special case lq.
2298
2299 2003-06-10  Richard Sandiford  <rsandifo@redhat.com>
2300
2301         * archures.c (bfd_mach_h8300sxn): New architecture.
2302         * bfd-in2.h: Regenerate.
2303         * cpu-h8300.c (h8300_scan): Check for 'sxn'.
2304         (h8300sxn_info_struct): New.
2305         (h8300sx_info_struct): Link to it.
2306         * elf32-h8300.c (elf32_h8_mach): Add h8300sxn case.
2307         (elf32_h8_final_write_processing): Likewise.
2308
2309 2003-06-08  Alan Modra  <amodra@bigpond.net.au>
2310
2311         * elf64-ppc.c: Move TARGET_LITTLE_SYM and other macros used by
2312         elfxx-target.h so that we can use elf_backend_got_header_size.
2313         (ELF_MACHINE_ALT1, ELF_MACHINE_ALT2): Delete.
2314         (GLINK_CALL_STUB_SIZE): Modify.  Define new glink call stub and
2315         associated macros.
2316         (ppc64_elf_howto_raw <GOT_TPREL16_DS, GOT_TPREL16_LO_DS>): Correct
2317         dst_mask.
2318         (enum ppc_stub_type): Add ppc_stub_long_branch_r2off and
2319         ppc_stub_plt_branch_r2off.
2320         (struct ppc_stub_hash_entry): Reorganize.
2321         (struct ppc_link_hash_table): Add no_multi_toc, multi_toc_needed,
2322         toc_curr, toc_off and emit_stub_syms.
2323         (ppc64_elf_link_hash_table_create): Init them.
2324         (ppc_stub_name): Correct string size.
2325         (ppc64_elf_check_relocs): Set has_gp_reloc on GOT and TOC relocs.
2326         (ppc64_elf_size_dynamic_sections): Set no_multi_toc if GOT entries
2327         used.
2328         (ppc_type_of_stub): Tweak root.type test.
2329         (build_plt_stub): Remove glink code.  Adjust for insn macro changes.
2330         (ppc_size_one_stub): Handle ppc_stub_long_branch_r2off and
2331         ppc_stub_plt_branch_r2off.
2332         (ppc_build_one_stub): Likewise.  Fix var shadowing.  Correct addis,addi
2333         range test.  Use toc_off to calculte r2 values.  Handle emit_stub_syms.
2334         (ppc64_elf_setup_section_lists): Remove htab creator flavour test.
2335         Initialize elf_gp and toc_curr.
2336         (ppc64_elf_next_toc_section, ppc64_elf_reinit_toc): New functions.
2337         (ppc64_elf_next_input_section): Set toc_off.
2338         (group_sections): Ensure groups have the same TOC.
2339         (ppc64_elf_size_stubs): Check whether we need a TOC adjusting stub.
2340         (ppc64_elf_build_stubs): Add emit_stub_syms param, and stash in htab.
2341         Build new glink stub.
2342         (ppc64_elf_relocate_section): Handle multiple TOCs.  Fix comments.
2343         (ppc64_elf_finish_dynamic_sections): Adjust DT_PPC64_GLINK.
2344         * elf64-ppc.h (ppc64_elf_build_stubs): Update prototype.
2345         (ppc64_elf_next_toc_section, ppc64_elf_reinit_toc): Declare.
2346         * section.c (struct sec): Rename flag12 to has_gp_reloc.
2347         (STD_SECTION): Update.
2348         * ecoff.c (bfd_debug_section): Update comment.
2349         * bfd-in2.h: Regenerate.
2350
2351 2003-06-05  Daniel Jacobowitz  <drow@mvista.com>
2352
2353         * elfcode.h (elf_slurp_reloc_table_from_section): Don't dereference
2354         NULL function pointers.
2355
2356 2003-06-05  Daniel Jacobowitz  <drow@mvista.com>
2357
2358         * simple.c (bfd_simple_get_relocated_section_contents): Call
2359         _bfd_generic_link_add_symbols instead of bfd_link_add_symbols.
2360
2361 2003-06-04  Svein E. Seldal  <Svein.Seldal@solidas.com>
2362
2363         * coff-tic54x.c: Removed the ticoff0_bad_format_hook() and
2364         ticoff1_bad_format_hook() functions. Removed the coff0 and coff1
2365         swaptables.
2366         * coff-tic4x.c: Ditto
2367         * coffcode.h: Added extra arguments to CREATE_BIG_COFF_TARGET_VEC
2368         and CREATE_LITTLE_COFF_TARGET_VEC. Created the macro
2369         CREATE_BIGHDR_COFF_TARGET_VEC. Created the ticoff0_bad_format_hook(),
2370         ticoff1_bad_format_hook() functions. Created the coff0 and coff1
2371         swap tables.
2372         * coff-tic4x.c: Adopted new CREATE_xxx_COFF_TARGET_VEC macros.
2373         * coff-a29k.c: Append COFF_SWAP_TABLE argument
2374         * coff-apollo.c: Ditto
2375         * coff-arm.c: Ditto
2376         * coff-h8300.c: Ditto
2377         * coff-h8500.c: Ditto
2378         * coff-i960.c: Ditto
2379         * coff-m68k.c: Ditto
2380         * coff-m88k.c: Ditto
2381         * coff-mcore.c: Ditto
2382         * coff-sh.c: Ditto
2383         * coff-sparc.c: Ditto
2384         * coff-tic80.c: Ditto
2385         * coff-we32k.c: Ditto
2386         * coff-z8k.c: Ditto
2387         * coff-w65.c: Ditto
2388
2389 2003-06-04  Svein E. Seldal  <Svein.Seldal@solidas.com>
2390
2391         * coff-tic4x.c (ticoff0_swap_table, ticoff1_swap_table): Fixed
2392         initialization bug
2393
2394 2003-06-03  Jakub Jelinek  <jakub@redhat.com>
2395
2396         * elf.c (_bfd_elf_print_private_bfd_data): Handle PT_GNU_STACK.
2397         (bfd_section_from_phdr): Likewise.
2398         (map_sections_to_segments): Create PT_GNU_STACK segment header.
2399         (get_program_header_size): Count with PT_GNU_STACK.
2400         * elf-bfd.h (struct elf_obj_tdata): Add stack_flags.
2401         * elflink.h (bfd_elfNN_size_dynamic_sections): Set stack_flags.
2402
2403 2003-06-03  H.J. Lu <hongjiu.lu@intel.com>
2404
2405         * elflink.h (elf_link_input_bfd): Call linker error_handler
2406         for discarded definitions.
2407
2408 2003-06-03  Elias Athanasopoulos  <elathan@phys.uoa.gr>
2409
2410         * syms.c (decode_section_type): Return 'n' if section flags are
2411         SEC_HAS_CONTENTS && SEC_READONLY.
2412
2413 2003-06-03  Nick Clifton  <nickc@redhat.com>
2414
2415         * elf32-v850.c (v850_elf_howto_t): Rename R_V850_32to
2416         R_V850_ABS32.  Add entry for R_V850_REL32.
2417         (v850_elf_reloc_map): Likewise.
2418         (v850_elf_check_relocs): Likewise.
2419         (v850_elf_perform_relocation): Likewise.
2420         (v850_elf_final_link_relocate): Likewise.  Include computation
2421         to make R_V850_REl32 pc-relative.
2422
2423 2003-06-03  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2424
2425         * elf32-sh.c (sh_elf_size_dynamic_sections): Create .interp section
2426         and DT_DEBUG dynamic tag even for position independent executables.
2427         * elf64-sh64.c (sh64_elf64_size_dynamic_sections): Likewize.
2428
2429 2003-06-02  Daniel Jacobowitz  <drow@mvista.com>
2430
2431         * config.bfd: Move obsolete entries out of the range of the
2432         targmatch sed script.
2433
2434 2003-06-02  Daniel Jacobowitz  <drow@mvista.com>
2435
2436         * config.bfd (mips*-dec-bsd*, mips*-*-pe*): Mark as obsolete.
2437
2438 2003-05-31  Jakub Jelinek  <jakub@redhat.com>
2439
2440         * elf32-ppc.c (allocate_dynrelocs): Use single slot for first 8192
2441         plt entries, not just 8191.
2442
2443 2003-05-30  Daniel Jacobowitz  <drow@mvista.com>
2444
2445         * elfxx-mips.c (_bfd_mips_elf_discard_info): Correct loop index.
2446         Reported by Ken Faiczak <kfaiczak@SANDVINE.com>.
2447
2448 2003-05-30  Ulrich Drepper  <drepper@redhat.com>
2449             Jakub Jelinek  <jakub@redhat.com>
2450
2451         * elflink.h (elf_link_add_object_symbols): Use !info->executable
2452         instead of info->shared where appropriate.
2453         (bfd_elfNN_size_dynamic_sections, elf_link_output_extsym): Likewise.
2454         * elflink.c (_bfd_elf_create_got_section): Likewise.
2455         (_bfd_elf_link_create_dynamic_sections): Likewise.
2456         (_bfd_elf_link_assign_sym_version): Likewise.
2457         * elf32-i386.c (elf_i386_size_dynamic_sections): Create .interp section
2458         and DT_DEBUG dynamic tag even for position independent executables.
2459         * elf32-ppc.c (ppc_elf_size_dynamic_sections): Likewise.
2460         * elf32-s390.c (elf_s390_size_dynamic_sections: Likewise.
2461         * elf64-ppc.c (ppc64_elf_size_dynamic_sections: Likewise.
2462         * elf64-s390.c (elf_s390_size_dynamic_sections: Likewise.
2463         * elf64-x86-64.c (elf64_x86_64_size_dynamic_sections: Likewise.
2464         * elfxx-ia64.c (elfNN_ia64_size_dynamic_sections: Likewise.
2465         * elf32-sparc.c (elf32_sparc_size_dynamic_sections: Likewise.
2466         * elf64-alpha.c (elf64_alpha_size_dynamic_sections: Likewise.
2467         * elf64-sparc.c (sparc64_elf_size_dynamic_sections: Likewise.
2468
2469 2003-05-30  Kris Warkentin <kewarken@qnx.com>
2470
2471         * elf.c (elfcore_grok_nto_status): Only set lwpid for the active or
2472         signalled thread.
2473         (elfcore_grok_nto_gregs): Only make .reg section for the active thread.
2474
2475 2003-05-29  Nick Clifton  <nickc@redhat.com>
2476
2477         * pef.c: Include "safe-ctype.h" instead of <ctype.h>.
2478         Tidy up formatting.
2479         * Makefile.am: Add dependency on safe-ctype.h.
2480         * Makefile.in: Regenerate.
2481
2482 2003-05-29  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
2483
2484         * elfxx-mips.c: Don't force symbols local unconditionally.
2485
2486 2003-05-28  Alan Modra  <amodra@bigpond.net.au>
2487
2488         * elf32-hppa.c (elf32_hppa_relocate_section): Delete bogus
2489         undefined_symbol call.
2490
2491 2003-05-27  Richard Sandiford  <rsandifo@redhat.com>
2492
2493         * elfxx-mips.c (mips_elf_hash_sort_data): Fix formattting.
2494         (mips_elf_link_hash_table): Likewise.
2495
2496 2003-05-22  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
2497
2498         * elf64-mips.c (elf_mips_gnu_rel16_s2): Add internally used
2499         R_MIPS_GNU_REL16_S2 support.
2500         (bfd_elf64_bfd_reloc_type_lookup): Use it.
2501         (mips_elf64_rtype_to_howto): Use it.
2502         * elfn32-mips.c (elf_mips_gnu_rel16_s2): Add internally used
2503         R_MIPS_GNU_REL16_S2 support.
2504         (bfd_elf32_bfd_reloc_type_lookup): Use it.
2505         (mips_elf_n32_rtype_to_howto): Use it.
2506
2507 2003-05-21  Stuart F. Downing  <sdowning@fame.com>
2508
2509         * som.h: Define PA_2_0 before including a.out.h
2510
2511 2003-05-07  Eric Christopher  <echristo@redhat.com>
2512             Alexandre Oliva   <aoliva@redhat.com>
2513
2514         * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Adjust
2515         pic tests, change to warning.
2516         (_bfd_mips_elf_final_link): Remove EF_MIPS_CPIC flag setting.
2517
2518 2003-05-21  Marcus Comstedt  <marcus@mc.pp.se>
2519
2520         * config.bfd: Check for a target triplet of shl-...-netbsdelf as
2521         well as shle-...-netbsdelf.  Remove duplicate entry.
2522
2523 2003-05-21  Nick Clifton  <nickc@redhat.com>
2524
2525         * elf32-xstormy16.c (xstormy16_elf_howto_table): Fix dst_mask
2526         for X_STORMY16_REL_12 reloc.
2527
2528         * elf.c (bfd_elf_get_needed_list): Use is_elf_hash_table to check
2529         the type of the hash table in the bfd_link_info structure.
2530         (bfd_elf_get_runpath_list): Likewise.
2531
2532 2003-05-19  Roland McGrath  <roland@redhat.com>
2533
2534         * elf.c (bfd_elf_bfd_from_remote_memory): New function.
2535         * bfd-in.h: Declare it.
2536         * bfd-in2.h: Regenerated.
2537         * elfcode.h (NAME(_bfd_elf,bfd_from_remote_memory)): New function.
2538         * elf-bfd.h (struct elf_backend_data): New function pointer member
2539         elf_backend_bfd_from_remote_memory.
2540         (_bfd_elf32_bfd_from_remote_memory, _bfd_elf64_bfd_from_remote_memory):
2541         Declare them.
2542         * elfxx-target.h (elf_backend_bfd_from_remote_memory): New macro.
2543         (elfNN_bed): Add that to the initializer.
2544
2545 2003-05-15  Roland McGrath  <roland@redhat.com>
2546
2547         * elf.c (elfcore_grok_note): Grok NT_AUXV note, make ".auxv" section.
2548
2549 2003-05-20  Jakub Jelinek  <jakub@redhat.com>
2550
2551         * elflink.h (elf_link_output_extsym): Only issue error about !=
2552         STV_DEFAULT symbols if they are bfd_link_hash_undefined.
2553
2554 2003-05-20  H.J. Lu <hongjiu.lu@intel.com>
2555
2556         * elflink.c (_bfd_elf_merge_symbol): Check ELF_LINK_DYNAMIC_DEF
2557         when removing the old definition for symbols with non-default
2558         visibility.
2559
2560 2003-05-18  Jason Eckhardt  <jle@rice.edu>
2561
2562         * elf32-i860.c (elf32_i860_relocate_highadj): Simplify calculation.
2563
2564 2003-05-17  Andreas Schwab  <schwab@suse.de>
2565
2566         * elf32-m68k.c (elf_m68k_check_relocs): Cache reloc section in
2567         elf_section_data during processing of pc-relative and absolute
2568         relocations.
2569         (elf_m68k_relocate_section): Use the cached reloc section instead
2570         of computing it again.  Fix handling of visibility.  Don't modify
2571         addend when copying over a relocation into the output.
2572
2573 2003-05-17  Alan Modra  <amodra@bigpond.net.au>
2574
2575         * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Use SYMBOL_CALLS_LOCAL
2576         to trim plt entries.  Move undefweak non-default visibility test..
2577         (allocate_dynrelocs): ..from here.
2578         * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Don't test
2579         dynamic_sections_created here.  Update comment.  Move undefweak
2580         non-default visibility test..
2581         (allocate_dynrelocs): ..from here.  Fix comment.
2582         * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Use SYMBOL_CALLS_LOCAL
2583         to trim plt entries.  Move undefweak non-default visibility test..
2584         (allocate_dynrelocs): ..from here.  Fix comment.
2585         * elflink.h (elf_link_output_extsym): Compare ELF_ST_VISIBILITY with
2586         STV_DEFAULT rather than comparing with zero.
2587         * elflink.c (_bfd_elf_merge_symbol): Likewise.
2588         (_bfd_elf_fix_symbol_flags): Likewise.  Format comment.
2589
2590 2003-05-17  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
2591
2592         * bfd.c (_bfd_get_gp_value): Prevent illegal access for abfd null
2593         pointers.
2594         (_bfd_set_gp_value): Likewise.
2595
2596 2003-05-16  Michael Snyder  <msnyder@redhat.com>
2597         From Bernd Schmidt  <bernds@redhat.com>
2598         * archures.c (bfd_mach_h8300sx): New.
2599         * bfd-in2.h: Regenerate.
2600         * cpu-h8300.c (h8300_scan)): Add support for h8300sx.
2601         (h8300sx_info_struct): New.
2602         (h8300s_info_struct): Link to it.
2603         * elf32-h8300.c (elf32_h8_mach): Add support for h8300sx.
2604         (elf32_h8_final_write_processing): Likewise.
2605         (elf32_h8_relax_section): Likewise.
2606
2607 2003-05-16  Kelley Cook  <kelleycook@wideopenwest.com>
2608
2609         * config.bfd: Accept i[3-7]86 variants.
2610         * configure.host: Likewise.
2611         * configure.in: Likewise.
2612         * configure: Regenerate.
2613
2614 2003-05-15  H.J. Lu <hongjiu.lu@intel.com>
2615
2616         * elflink.c (_bfd_elf_fix_symbol_flags): Also hide protected
2617         symbol.
2618
2619 2003-05-15  H.J. Lu <hongjiu.lu@intel.com>
2620
2621         * elflink.h (elf_link_check_versioned_symbol): Also allow
2622         the base version.
2623
2624 2003-05-15  Alan Modra  <amodra@bigpond.net.au>
2625             H.J. Lu <hongjiu.lu@intel.com>
2626
2627         * elf32-i386.c (allocate_dynrelocs): Use SYMBOL_CALLS_LOCAL.
2628         (elf_i386_relocate_section): Likewise.
2629         * elf32-ppc.c (allocate_dynrelocs): Likewise.
2630         (ppc_elf_relocate_section): Likewise.
2631         * elf64-ppc.c (allocate_dynrelocs): Likewise.
2632         (ppc64_elf_relocate_section): Likewise.
2633
2634 2003-05-15  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
2635
2636         * elf32-mips.c (gprel32_with_gp): Remove useless N64 ABI case.
2637
2638 2003-05-13  Stephane Carrez  <stcarrez@nerim.fr>
2639
2640         * elf32-m68hc1x.c (_bfd_m68hc11_elf_merge_private_bfd_data): Check for
2641         processor capability, allow merge of HC12 and HCS12 in some cases.
2642         (m68hc11_elf_hash_table_create): Use bfd_malloc instead of bfd_zalloc.
2643         * cpu-m68hc12.c (bfd_m68hc12s_arch): New struct.
2644         (bfd_m68hc12_arch): Link it.
2645         (scan_mach): New function.
2646
2647 2003-05-13  Andrew Haley  <aph@redhat.com>
2648
2649         * elf.c (bfd_elf_hash): Mask lower 32 bits of hash.
2650
2651 2003-05-13  Alan Modra  <amodra@bigpond.net.au>
2652             H.J. Lu  <hongjiu.lu@intel.com>
2653
2654         * elf-bfd.h (SYMBOL_REFERENCES_LOCAL, SYMBOL_CALLS_LOCAL): Move from
2655         elf32-ppc.c.  Add ELF_LINK_FORCED_LOCAL check.
2656         * elf32-ppc.c: (SYMBOL_REFERENCES_LOCAL, SYMBOL_CALLS_LOCAL): Delete.
2657         (allocate_dynrelocs): Use SYMBOL_REFERENCES_LOCAL for dynreloc check.
2658         (ppc_elf_relocate_section): Likewise.
2659         * elf64-ppc.c (allocate_dynrelocs): Likewise.
2660         (ppc64_elf_relocate_section): Likewise.  Use for .got relocs too.
2661         (ppc64_elf_adjust_dynamic_symbol): Don't assume symbols with .plt
2662         relocs need no other types.
2663         * elf32-i386.c (allocate_dynrelocs): Use SYMBOL_REFERENCES_LOCAL for
2664         dynreloc check.
2665         (elf_i386_relocate_section): Likewise.  Use for .got relocs too.
2666         (elf_i386_finish_dynamic_symbol): Use SYMBOL_REFERENCES_LOCAL for
2667         .got relocs.
2668
2669 2003-05-13  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2670
2671         * elf32-sh.c (sh_elf_adjust_dynamic_symbol): For weak symbols,
2672         copy ELF_LINK_NON_GOT_REF from weakdef.
2673         (allocate_dynrelocs): For undef weak syms with non-default
2674         visibility, a) don't allocate plt entries, b) don't allocate
2675         .got relocs, c) discard dyn rel space
2676         (sh_elf_relocate_section): d) don't generate .got relocs, e)
2677         don't generate dynamic relocs.
2678         (sh_elf_copy_indirect_symbol): Don't copy ELF_LINK_NON_GOT_REF
2679         for weakdefs when symbol already adjusted.
2680
2681 2003-05-12  Nick Clifton  <nickc@redhat.com>
2682
2683         * elf32-xstormy16.c (xstormy16_elf_howto_table): use 'bitfield'
2684         overflow detection for R_XSTORMY16_16 reloc.
2685
2686 2003-05-12  Paul Clarke  <paulc@senet.com.au>
2687
2688         * elf32-h8300.c: Fix typo in name of R_H8_DIR8 reloc.
2689
2690 2003-05-11  Jason Eckhardt  <jle@rice.edu>
2691
2692         * elf32-i860.c (elf32_i860_relocate_highadj): Properly
2693         adjust upper bits.
2694         (elf32_i860_relocate_splitn): Obtain upper 5 bits from the
2695         proper place.
2696         (elf32_i860_relocate_pc16): Obtain upper 5 bits from the
2697         proper place.
2698
2699 2003-05-11  Andreas Schwab  <schwab@suse.de>
2700
2701         * elf32-m68k.c (elf_m68k_relocate_section): Replace ugly
2702         complicated tests for unresolvable relocs with a simple direct
2703         scheme using "unresolved_reloc" var.  Report some detail on
2704         bfd_reloc_outofrange and similar errors.
2705
2706 2003-05-09  Martin Schwidefsky  <schwidefsky@de.ibm.com>
2707
2708         * elf32-s390.c (allocate_dynrelocs, elf_s390_relocate_section):
2709         Fix WILL_CALL_FINISH_DYNAMIC_SYMBOL call.
2710         (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Pass SHARED instead of INFO.
2711         * elf64-s390.c: Likewise.
2712
2713 2003-05-09  Martin Schwidefsky  <schwidefsky@de.ibm.com>
2714
2715         * elf32-s390.c (ELIMINATE_COPY_RELOCS): Define as one.
2716         (elf_s390_adjust_dynamic_symbol): For weak symbols, copy
2717         ELF_LINK_NON_GOT_REF from weakdef.
2718         (elf_s390_copy_indirect_symbol): Test whether the weakdef sym has
2719         already been adjusted before treating it specially.
2720         * el64-s390.c: Likwise.
2721
2722 2003-05-09  Martin Schwidefsky  <schwidefsky@de.ibm.com>
2723
2724         * elf32-s390.c (allocate_dynrelocs): For undef weak syms with
2725         non-default visibility, a) don't make them dynamic, b) discard
2726         space for dynamic relocs.
2727         (elf_s390_relocate_section): Initialize the GOT entries and skip
2728         R_390_{8,16,32}/R_390_PC{16,16DBL,32DBL,32} for weak undefined
2729         symbols with non-default visibility.
2730         * elf64-s390.c: Likewise.
2731
2732 2003-05-09  Alan Modra  <amodra@bigpond.net.au>
2733
2734         * cpu-arm.c (arm_check_note): Warning fix.
2735         * elf32-iq2000.c (iq2000_elf_check_relocs): Warning fixes.  Arrange
2736         to keep relocs if edited.
2737         (iq2000_elf_print_private_bfd_data): Return TRUE.
2738         * elfxx-ia64.c (elfNN_ia64_relax_section): Use ELFNN_R_SYM, not
2739         ELF64_R_SYM.
2740         (elfNN_ia64_relax_ldxmov): Warning fix.
2741         * xtensa-isa.c (xtensa_add_isa): Warning fix.
2742         * xtensa-modules.c (get_num_opcodes): Warning fix.
2743
2744 2003-05-09  Andrey Petrov <petrov@netbsd.org>
2745
2746         * elf.c (elf_fake_sections): Use correct cast for sh_name.
2747
2748 2003-05-09  Alan Modra  <amodra@bigpond.net.au>
2749
2750         * elflink.c (_bfd_elf_link_create_dynamic_sections): Move from
2751         elflink.h.  Replace LOG_FILE_ALIGN with bed->s->log_file_align.
2752         (_bfd_elf_create_dynamic_sections): Use bed->s->log_file_align.
2753         (bfd_elf_record_link_assignment): Move from elflink.h.
2754         (_bfd_elf_merge_symbol): Likewise.
2755         (_bfd_elf_add_default_symbol): Likewise.
2756         (_bfd_elf_export_symbol): Likewise.
2757         (_bfd_elf_link_find_version_dependencies): Likewise.
2758         (_bfd_elf_link_assign_sym_version): Likewise.
2759         (_bfd_elf_link_read_relocs): Likewise.
2760         (_bfd_elf_link_size_reloc_section): Likewise.
2761         (_bfd_elf_fix_symbol_flags): Likewise.
2762         (_bfd_elf_adjust_dynamic_symbol): Likewise.
2763         (_bfd_elf_link_sec_merge_syms): Likewise.
2764         (elf_link_read_relocs_from_section): Likewise.  Use bed->s->sizeof_rel
2765         and bed->s->sizeof_rela.
2766         (_bfd_elf_link_output_relocs): Likewise.
2767         * elf-bfd.h (struct elf_size_info): Rename file_align to
2768         log_file_align.
2769         (struct elf_info_failed): Move from elflink.h.
2770         (struct elf_assign_sym_version_info): Likewise.
2771         (struct elf_find_verdep_info): Likewise.
2772         (_bfd_elf_create_dynamic_sections): Delete duplicate declaration.
2773         (_bfd_elf_merge_symbol, _bfd_elf_add_default_symbol,
2774         _bfd_elf_export_symbol, _bfd_elf_link_find_version_dependencies,
2775         _bfd_elf_link_assign_sym_version,
2776         _bfd_elf_link_create_dynamic_sections, _bfd_elf_link_read_relocs,
2777         _bfd_elf_link_size_reloc_section, _bfd_elf_link_output_relocs,
2778         _bfd_elf_fix_symbol_flags, _bfd_elf_adjust_dynamic_symbol,
2779         _bfd_elf_link_sec_merge_syms): Declare.
2780         (bfd_elf32_link_create_dynamic_sections): Don't declare.
2781         (_bfd_elf32_link_read_relocs): Likewise.
2782         (bfd_elf64_link_create_dynamic_sections): Likewise.
2783         (_bfd_elf64_link_read_relocs): Likewise.
2784         * elflink.h: Move lots o' stuff elsewhere.
2785         * bfd-in.h (bfd_elf32_record_link_assignment): Don't declare.
2786         (bfd_elf64_record_link_assignment): Likewise.
2787         (bfd_elf_record_link_assignment): Declare.
2788         * bfd-in2.h: Regenerate.
2789         * elfcode.h (elf_link_create_dynamic_sections): Don't declare.
2790         (NAME(_bfd_elf,size_info)): Adjust for log_file_align.
2791         * elf.c (_bfd_elf_init_reloc_shdr): Adjust for bed->s->log_file_align.
2792         (assign_file_positions_for_segments): Likewise.
2793         (assign_file_positions_except_relocs): Likewise.
2794         (swap_out_syms, elfcore_write_note): Likewise.
2795         * elf-m10200.c: Adjust for changed function names.
2796         * elf-m10300.c: Likewise.
2797         * elf32-arm.h: Likewise.
2798         * elf32-h8300.c: Likewise.
2799         * elf32-hppa.c: Likewise.
2800         * elf32-ip2k.c: Likewise.
2801         * elf32-m32r.c: Likewise.
2802         * elf32-m68hc11.c: Likewise.
2803         * elf32-m68hc1x.c: Likewise.
2804         * elf32-m68k.c: Likewise.
2805         * elf32-mips.c: Likewise.
2806         * elf32-ppc.c: Likewise.
2807         * elf32-sh.c: Likewise.
2808         * elf32-v850.c: Likewise.
2809         * elf32-xtensa.c: Likewise.
2810         * elf64-alpha.c: Likewise.
2811         * elf64-hppa.c: Likewise.
2812         * elf64-mmix.c: Likewise.
2813         * elf64-ppc.c: Likewise.
2814         * elf64-sh64.c: Likewise.
2815         * elfxx-ia64.c: Likewise.
2816         * elfxx-mips.c: Likewise.
2817         (MIPS_ELF_LOG_FILE_ALIGN): Use log_file_align.
2818         * elf64-alpha.c (alpha_elf_size_info): Adjust for log_file_align.
2819         * elf64-hppa.c (hppa64_elf_size_info): Likewise.
2820         * elf64-mips.c (mips_elf64_size_info): Likewise.
2821         * elf64-s390.c (s390_elf64_size_info): Likewise.
2822         * elf64-sparc.c (sparc64_elf_size_info): Likewise.
2823
2824 2003-05-08  H.J. Lu <hongjiu.lu@intel.com>
2825
2826         * elflink.h (elf_add_default_symbol): After skipping the
2827         unversioned symbol, go to non-default one.
2828
2829 2003-05-07  H.J. Lu <hongjiu.lu@intel.com>
2830
2831         * elfxx-ia64.c (_bfd_elf_link_hash_hide_symbol): Also clear the
2832         want_plt field.
2833         (elfNN_ia64_relocate_section): Don't do dynamic symbol lookup
2834         for symbols with non-default visibility.
2835
2836 2003-05-07  H.J. Lu <hongjiu.lu@intel.com>
2837
2838         * elflink.h (elf_link_check_versioned_symbol): Also handle the
2839         case that a DSO references a hidden symbol which may be
2840         satisfied by a versioned symbol in another DSO.
2841         (elf_link_output_extsym): Check versioned definition for hidden
2842         symbol referenced by a DSO.
2843
2844 2003-05-07  Nick Clifton  <nickc@redhat.com>
2845
2846         * elf32-xstormy16.c (xstormy16_elf_howto_table): Reset
2847         R_XSTORMY16_16 reloc to ignore overflows.
2848
2849 2003-05-06  Alexandre Oliva  <aoliva@redhat.com>
2850
2851         * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Improve
2852         error message for mixing different-endian files.  Check for ABI
2853         compatibility of input files with the selected emulation.
2854
2855 2003-05-05  Alan Modra  <amodra@bigpond.net.au>
2856
2857         * elf32-i386.c (allocate_dynrelocs): For undef weak syms with
2858         non-default visibility, a) don't make them dynamic, b) discard
2859         space for dynamic relocs.
2860         * elf64-x86-64.c (allocate_dynrelocs): Likewise.
2861
2862         * elf32-ppc.c (allocate_dynrelocs): For undef weak syms with
2863         non-default visibility, a) don't allocate plt entries, b) don't
2864         allocate .got relocs, c) discard dyn rel space,
2865         (ppc_elf_relocate_section): d) don't generate .got relocs, e)
2866         don't generate dynamic relocs.
2867         * elf64-ppc.c (allocate_dynrelocs): As above.
2868         (ppc64_elf_relocate_section): As above.
2869
2870 2003-05-05  Andreas Jaeger  <aj@suse.de>
2871
2872         * elf64-x86-64.c (allocate_dynrelocs): Don't allocate dynamic
2873         relocation entries for weak undefined symbols with non-default
2874         visibility.
2875         (elf64_x86_64_relocate_section): Initialize the GOT entries and
2876         skip R_386_32/R_386_PC32 for weak undefined symbols with
2877         non-default visibility.
2878
2879 2003-05-04  H.J. Lu <hjl@gnu.org>
2880
2881         * elf32-i386.c (allocate_dynrelocs): Don't allocate dynamic
2882         relocation entries for weak undefined symbols with non-default
2883         visibility.
2884         (elf_i386_relocate_section): Initialize the GOT entries and
2885         skip R_386_32/R_386_PC32 for weak undefined symbols with
2886         non-default visibility.
2887
2888         * elfxx-ia64.c (allocate_fptr): Don't allocate function
2889         descriptors for weak undefined symbols with non-default
2890         visibility.
2891         (allocate_dynrel_entries): Don't allocate relocation entries
2892         for symbols resolved to 0.
2893         (set_got_entry): Don't install dynamic relocation for weak
2894         undefined symbols with non-default visibility.
2895         (set_pltoff_entry): Likewise.
2896
2897         * elflink.h (elf_fix_symbol_flags): Hide weak undefined symbols
2898         with non-default visibility.
2899         (elf_link_output_extsym): Don't make weak undefined symbols
2900         with non-default visibility dynamic.
2901
2902 2003-05-04  H.J. Lu <hjl@gnu.org>
2903
2904         * elflink.h (elf_merge_symbol): Correctly handle weak definiton.
2905
2906 2003-05-04  H.J. Lu <hjl@gnu.org>
2907
2908         * elflink.h (elf_merge_symbol): Don't record a hidden/internal
2909         symbol dynamic. Check indirection when removing the old
2910         definition for symbols with non-default visibility.
2911         (elf_add_default_symbol): Skip when told by elf_merge_symbol.
2912
2913 2003-05-02  Nick Clifton  <nickc@redhat.com>
2914
2915         * elf32-xstormy16.c (xstormy16_elf_howto_table): Make the
2916         R_XSTORMY16_8 and R_XSTORMY16_16 relocs detect and complain about
2917         unsigned overflow.
2918
2919 2003-05-02  Andreas Jaeger  <aj@suse.de>
2920
2921         * elf64-x86-64.c (elf_x86_64_copy_indirect_symbol): Don't copy
2922         ELF_LINK_NON_GOT_REF for weakdefs when symbol already adjusted.
2923         (ELIMINATE_COPY_RELOCS): Define as one.  Use throughout.
2924         (elf_x86_64_adjust_dynamic_symbol): For weak symbols, copy
2925         ELF_LINK_NON_GOT_REF from weakdef.
2926
2927 2003-05-02  Charles Lepple <clepple@ghz.cc>
2928             Nick Clifton <nickc@redhat.com>
2929
2930         * acinclude.m4: Fix name of --enable-install-libbfd switch.
2931         * aclocal.m4: Regenerate.
2932         * configure: Regenerate.
2933         * Makefile.in: Regenerate.
2934
2935 2003-05-01  Alan Modra  <amodra@bigpond.net.au>
2936
2937         * elf32-ppc.c (ppc_elf_copy_indirect_symbol): Test whether the
2938         weakdef sym has already been adjusted before treating it specially.
2939         * elf32-i386.c (elf_i386_copy_indirect_symbol): Don't copy
2940         ELF_LINK_NON_GOT_REF for weakdefs when symbol already adjusted.
2941         * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Likewise.
2942         (ppc64_elf_check_relocs): Set ELF_LINK_NON_GOT_REF.
2943
2944 2003-04-28  H.J. Lu <hjl@gnu.org>
2945
2946         * elfxx-ia64.c (elfNN_ia64_relax_section): Relax ldxmov during
2947         the relax finalize pass.
2948
2949         * section.c (struct sec): Add need_finalize_relax and remove
2950         flag11.
2951         (STD_SECTION): Update struct sec initializer.
2952         * bfd-in2.h: Regenerated.
2953
2954 2003-04-28  H.J. Lu <hjl@gnu.org>
2955
2956         * elflink.h (elf_merge_symbol): Call elf_backend_copy_indirect_symbol
2957         to copy any information related to dynamic linking when we flip
2958         the indirection.
2959
2960 2003-04-27  H.J. Lu <hjl@gnu.org>
2961
2962         * elf-bfd.h (ELF_LINK_DYNAMIC_DEF): New.
2963         (ELF_LINK_DYNAMIC_WEAK): New.
2964
2965         * elflink.h (elf_merge_symbol): Add one argument to indicate if
2966         a symbol should be skipped. Ignore definitions in dynamic
2967         objects for symbols with non-default visibility.
2968         (elf_add_default_symbol): Adjusted.
2969         (elf_link_add_object_symbols): Check if a symbol should be
2970         skipped. Don't merge the visibility field with the one from
2971         a dynamic object.
2972         (elf_link_check_versioned_symbol): Use undef_bfd.
2973         (elf_link_output_extsym): Warn if a forced local symbol is
2974         referenced from dynamic objects. Make non-weak undefined symbol
2975         with non-default visibility a fatal error.
2976
2977 2003-04-27  Daniel Jacobowitz  <drow@mvista.com>
2978
2979         * configure.in: Bump version on HEAD to 2.14.90.
2980         * configure: Regenerated.
2981
2982 2003-04-26  Stephane Carrez  <stcarrez@nerim.fr>
2983
2984         PR savannah/3331:
2985         * elf32-m68hc11.c (m68hc11_elf_relax_section): Clear prev_insn_group
2986         when we couldn't relax something.
2987
2988 2003-04-25  Alan Modra  <amodra@bigpond.net.au>
2989
2990         * elflink.h (elf_merge_symbol): When we find a regular definition
2991         for an indirect symbol, flip the indirection so that the old
2992         direct symbol now points to the new definition.
2993
2994 2003-04-24  Roland McGrath  <roland@redhat.com>
2995
2996         * elf.c (bfd_section_from_phdr): Map PT_GNU_EH_FRAME to "eh_frame_hdr".
2997
2998 2003-04-24  Alan Modra  <amodra@bigpond.net.au>
2999
3000         * elf32-ppc.c: Formatting and comment fixes.
3001         (ELIMINATE_COPY_RELOCS): Move before ppc_elf_copy_indirect_symbol.
3002         (ppc_elf_copy_indirect_symbol): Copy flags here for weakdefs.
3003
3004 2003-04-24 Dhananjay Deshpande <dhananjayd@kpitcummins.com>
3005
3006         * archures.c (bfd_mach_h8300hn, bfd_mach_h8300sn): Added.
3007         * bfd-in2.h: Rebuilt.
3008         * coff-h8300.c (BADMAG): Add check for H8300HNBADMAG & H8300SNBADMAG.
3009         * coffcode.h (coff_set_arch_mach_hook): Add case for H8300HNMAGIC
3010         & H8300SNMAGIC.
3011         (coff_set_flags): Add case for bfd_mach_h8300hn & bfd_mach_h8300sn.
3012         * cpu-h8300.c (h8300_scan): Handle h8300hn, h8300sn.
3013         (h8300sn_info_struct, h8300hn_info_struct): New.
3014         * elf32-h8300.c (elf32_h8_mach): Handle case for h8300hn & h8300sn
3015         (elf32_h8_final_write_processing): Likewise.
3016
3017 2003-04-23  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3018
3019         * elf32-sh.c (tpoff): New.
3020         (struct elf_sh_dyn_relocs): Remove tls_tpoff32.
3021         (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Pass SHARED instead of INFO.
3022         (allocate_dynrelocs): Don't make unnecessary dynamic TLS
3023         relocations.  Adjust WILL_CALL_FINISH_DYNAMIC_SYMBOL uses.
3024         (sh_elf_relocate_section): Likewise. Remove unnecessary tests.
3025         (dtpoff_base): Fix wrong indentation.
3026         (sh_elf_check_relocs): Don't set DF_STATIC_TLS flag with non-TLS
3027         relocations.  Don't set tls_tpoff32 flag.  Don't make unnecessary
3028         R_SH_TLS_TPOFF32 relocations.
3029
3030 2003-04-23  J"orn Rennecke <joern.rennecke@superh.com>
3031
3032         * archures.c (enum bfd_architecture): Amend comment to refer to SuperH.
3033         * cpu-sh.c: Likewise.
3034         * elf32-sh.c: Likewise.
3035         * reloc.c (bfd_reloc_code_real): Likewise.
3036         * elf32-sh64-com.c: Change comment to refer to SuperH.
3037         * elf32-sh64.c: Likewise.
3038         * elf64-sh64.c: Likewise.
3039         * bfd-in2.h (enum bfd_architecture): Regenerate.
3040
3041 2003-04-23  Alan Modra  <amodra@bigpond.net.au>
3042
3043         From Julien LEMOINE <speedblue@debian.org>
3044         * elf32-i386.c (elf_i386_info_to_howto): Delete.
3045         (elf_info_to_howto): Define as elf_i386_info_to_howto_rel.
3046
3047 2003-04-22  Kazuhiro Inaoka  <inaoka.kazuhiro@renesas.com>
3048
3049         * archures.c: Replace references to Mitsubishi M32R with references
3050         to Renesas M32R.
3051         * relocs.c: Likewise.
3052         * bfd-in2.h: Regenerate.
3053
3054 2003-04-21  Richard Henderson  <rth@redhat.com>
3055
3056         * elf64-alpha.c (alpha_elf_dynamic_symbol_p): Return false for an
3057         executable when a symbol is defined both regular and dynamic.
3058
3059 2003-04-21  Stephane Carrez  <stcarrez@nerim.fr>
3060
3061         * Makefile.am (BFD32_BACKENDS): Add elf32-m68hc1x.lo.
3062         (elf32-m68hc1x.lo): Update dependencies
3063         * configure.in: Add elf32-m68hc1x.lo.
3064         * configure: Rebuild.
3065         * Makefile.in: Rebuild.
3066
3067 2003-04-21  Stephane Carrez  <stcarrez@nerim.fr>
3068
3069         * elf32-m68hc1x.c: New file (from elf32-m68hc11.c and elf32-m68hc12.c)
3070         (m68hc11_elf_hash_table_create): New function.
3071         (elf32_m68hc11_link_hash_table_free): New function.
3072         (stub_hash_newfunc): New function.
3073         (m68hc11_add_stub): New function.
3074         (elf32_m68hc11_add_symbol_hook): New function.
3075         (elf32_m68hc11_setup_section_lists): New function.
3076         (elf32_m68hc11_next_input_section): New function.
3077         (elf32_m68hc11_size_stubs): New function.
3078         (elf32_m68hc11_build_stubs): New function.
3079         (m68hc11_get_relocation_value): New function.
3080         (elf32_m68hc11_relocate_section): Call the above to redirect
3081         some relocations to the trampoline code.
3082         (m68hc11_elf_export_one_stub): New function.
3083         (m68hc11_elf_set_symbol): New function.
3084         (elf32_m68hc11_build_stubs): Call it via bfd_hash_traverse.
3085         (m68hc11_elf_get_bank_parameters): Get parameters only when the info
3086         is not yet initialized.
3087
3088         * elf32-m68hc1x.h: New file (from elf32-m68hc11.c and elf32-m68hc12.c)
3089         (elf32_m68hc11_stub_hash_entry): New struct.
3090         (m68hc11_page_info): Add trampoline handler address.
3091         (m68hc11_elf_link_hash_table): Add stubs generation members.
3092         (elf32_m68hc11_add_symbol_hook): Declare.
3093         (elf32_m68hc11_setup_section_lists): Declare.
3094         (elf32_m68hc11_size_stubs): Declare.
3095         (elf32_m68hc11_build_stubs): Declare.
3096
3097         * elf32-m68hc11.c (m68hc11_elf_ignore_reloc): Move to elf32-m68hc1x.c.
3098         (elf32_m68hc11_gc_mark_hook, elf32_m68hc11_gc_sweep_hook): Likewise.
3099         (elf32_m68hc11_check_relocs, elf32_m68hc11_relocate_section): Ditto.
3100         (_bfd_m68hc11_elf_set_private_flags): Ditto.
3101         (_bfd_m68hc11_elf_merge_private_bfd_data): Ditto.
3102         (_bfd_m68hc11_elf_print_private_bfd_data): Ditto.
3103         (bfd_elf32_bfd_link_hash_table_create): Define.
3104         (elf_backend_add_symbol_hook): Define.
3105         (m68hc11_elf_bfd_link_hash_table_create): New function.
3106         (m68hc11_elf_build_one_stub): New function.
3107         (m68hc11_elf_size_one_stub): New function.
3108         (m68hc11_elf_bfd_link_hash_table_create): Install the above.
3109         (bfd_elf32_bfd_link_hash_table_create): Define.
3110
3111         * elf32-m68hc12.c (m68hc11_elf_ignore_reloc): Remove.
3112         (m68hc12_addr_is_banked): Remove, use m68hc11_addr_is_banked.
3113         (m68hc12_phys_addr): Ditto.
3114         (m68hc12_phys_page): Ditto.
3115         (m68hc12_elf_special_reloc): Move to elf32-m68hc1x.c.
3116         (elf32_m68hc11_gc_mark_hook): Likewise.
3117         (elf32_m68hc11_gc_sweep_hook): Likewise.
3118         (elf32_m68hc11_check_relocs): Likewise.
3119         (elf32_m68hc11_relocate_section): Likewise.
3120         (_bfd_m68hc12_elf_set_private_flags): Likewise.
3121         (_bfd_m68hc12_elf_merge_private_bfd_data): Likewise.
3122         (_bfd_m68hc12_elf_print_private_bfd_data): Likewise.
3123         (m68hc12_elf_build_one_stub): New function.
3124         (m68hc12_elf_size_one_stub): New function.
3125         (m68hc12_elf_bfd_link_hash_table_create): New function, use the above.
3126         (elf_backend_add_symbol_hook): Define.
3127         (elf_m68hc11_howto_table): Use TRUE for pcrel relocs; fix masks.
3128
3129 2003-04-18  Nick Clifton  <nickc@redhat.com>
3130
3131         * format.c (bfd_check_format_matches): Only check associated
3132         vector if the matching_vector has been created.
3133
3134 2003-04-15  Alexandre Oliva  <aoliva@redhat.com>
3135
3136         * dwarf2.c (_bfd_dwarf2_find_nearest_line): Fix typo in
3137         2003-04-09's change.
3138
3139 2003-04-15  Brian Ford  <ford@vss.fsi.com>
3140
3141         * peicode.h (coff_swap_scnhdr_in): If a section holds
3142         uninitialized data and is from an object file or from an
3143         executable image that has not initialized the s_size field, or if
3144         the physical size is padded, use the virtual size (stored in
3145         s_paddr) instead.
3146
3147 2003-04-15  H.J. Lu <hjl@gnu.org>
3148
3149         * elflink.h (elf_link_add_object_symbols): Properly report
3150         filename for alignment reduction.
3151
3152 2003-04-15  Rohit Kumar Srivastava <rohits@kpitcummins.com>
3153
3154         * archures.c: Replace occurrances of 'Hitachi' with 'Renesas'.
3155         * reloc.c: Likewise.
3156         * coff-h8300.c: Likewise.
3157         * coff-h8500.c: Likewise.
3158         * coff-sh.c: Likewise.
3159         * cpu-h8300.c: Likewise.
3160         * cpu-sh.c: Likewise.
3161         * elf32-h8300.c: Likewise.
3162         * elf32-sh.c: Likewise.
3163         * elf32-sh64-com.c: Likewise.
3164         * elf32-sh64.c: Likewise.
3165         * elf64-sh64.c: Likewise.
3166         * bfd-in2.h: Regenerate.
3167
3168 2003-04-14  H.J. Lu <hjl@gnu.org>
3169
3170         * elflink.h (elf_link_add_object_symbols): Maintain maximum
3171         alignment for common symbols. Warn reducing alignment for
3172         common symbols. Report old filename when symbol size changes.
3173
3174 2003-04-12  Alexandre Oliva  <aoliva@redhat.com>
3175
3176         * elfxx-mips.c (mips_elf_calculate_relocation): Adjust two other
3177         occurrences of the same test changed in the previous patch.
3178         Optimize.
3179
3180 2003-04-11  Alexandre Oliva  <aoliva@redhat.com>
3181
3182         * elfxx-mips.c (mips_elf_get_global_gotsym_index): New.
3183         (mips_elf_calculate_relocation): Decay GOT_PAGE/GOT_OFST to
3184         GOT_DISP/addend only if the symbol got a global GOT entry.
3185
3186 2003-04-10  Alexandre Oliva  <aoliva@redhat.com>
3187
3188         * elfxx-mips.c (mips_elf_calculate_relocation): Decay
3189         GOT_PAGE/GOT_OFST referencing overridable symbol to
3190         GOT_DISP/addend.
3191         (_bfd_mips_elf_check_relocs): Handle GOT_PAGE referencing
3192         global symbol as GOT_DISP.
3193
3194 2003-04-10  Bob Wilson  <bob.wilson@acm.org>
3195
3196         * elf32-xtensa.c (elf_xtensa_relocate_section): Don't continue to the
3197         next relocation on an undefined symbol.
3198
3199 2003-04-09  Richard Henderson  <rth@redhat.com>
3200
3201         * elf64-alpha.c (elf64_alpha_relocate_section) <R_ALPHA_GPREL32>:
3202         Ignore relocations against r_symndx == 0.
3203
3204 2003-04-09  H.J. Lu <hjl@gnu.org>
3205
3206         * elf64-alpha.c (elf64_alpha_relocate_section): Don't return
3207         FALSE for undefined symbols.
3208         * elfxx-ia64.c (elfNN_ia64_relocate_section): Likewise.
3209
3210 2003-04-09  Alexandre Oliva  <aoliva@redhat.com>
3211
3212         * dwarf2.c (_bfd_dwarf2_find_nearest_line): Try DWARF3-standard
3213         and IRIX-specific shift-to-64-bit 4-byte lengths before following
3214         addr_size.
3215
3216 2003-04-08  Alexandre Oliva  <aoliva@redhat.com>
3217
3218         * elf32-mips.c (bfd_elf32_bfd_reloc_type_lookup): Detect (ctor)
3219         pointer size from ABI, not arch_bits_per_address.
3220
3221 2003-04-07  Kevin Buettner  <kevinb@redhat.com>
3222
3223         * elfn32-mips.c (elf32_mips_grok_prstatus): Adjust core file related
3224         constants for n32 ABI.
3225
3226 2003-04-06  Andrew Cagney  <cagney@redhat.com>
3227
3228         * simple.c (bfd_simple_get_relocated_section_contents): Disable
3229         free that leads to GDB vs BFD memory corruption.
3230
3231 2003-04-04  Stephane Carrez  <stcarrez@nerim.fr>
3232
3233         * elf32-m68hc11.c (m68hc11_elf_relax_delete_bytes): Also adjust
3234         symbols that mark the end of the section.
3235         (m68hc11_elf_relax_section): Use R_M68HC11_PCREL_8 relocs when
3236         converting to a relative branch so that the offset is computed after
3237         the relaxation; also relocate a jsr into a bsr if possible but don't
3238         relax them if they are to a far symbol as we need to call the
3239         trampoline code.
3240         (elf_m68hc11_howto_table): Set pcrel_offset to true.
3241
3242 2003-04-04  Svein E. Seldal  <Svein.Seldal@solidas.com>
3243
3244         * archures.c: Namespace cleanup. Rename bfd_mach_c3x to
3245         bfd_mach_tic3x and bfd_mach_c4x to bfd_mach_tic4x
3246         * bfd-in2.h: Regenerate
3247         * coff-tic4x.c: Namespace cleanup. Replace s/c4x/tic4x/
3248         * cpu-tic4x.c: Ditto
3249
3250 2003-04-03  Nick Clifton  <nickc@redhat.com>
3251
3252         * peXXigen.c (_bfd_XXi_swap_scnhdr_out): Compute ps and ss
3253         differently for object files and executables.
3254         * peicode.h (coff_swap_scnhdr_in): Only set the s_size field
3255         for object files or for executables who have not already
3256         initialised the field.
3257         * libpei.h (bfd_pe_executable_p): New macro.  Return true if
3258         the PE format bfd is an executable.
3259
3260 2003-04-03  Alan Modra  <amodra@bigpond.net.au>
3261
3262         * elf32-ppc.c (ppc_elf_check_relocs): Don't use SYMBOL_REFERENCES_LOCAL
3263         here as it's too early to reliably determine locality.
3264         (ppc_elf_gc_sweep_hook): Likewise.
3265         (SYMBOL_REFERENCES_LOCAL): Expand comment.
3266
3267 2003-04-02  Bob Wilson  <bob.wilson@acm.org>
3268
3269         * xtensa-modules.c: Remove comment indicating that this is a
3270         generated file.
3271
3272 2003-04-02  Alan Modra  <amodra@bigpond.net.au>
3273
3274         * elfxx-mips.c (_bfd_mips_elf_hide_symbol): Test for NULL dynobj.
3275
3276 2003-04-01  Bob Wilson  <bob.wilson@acm.org>
3277
3278         * Makefile.am (ALL_MACHINES): Add cpu-xtensa.lo.
3279         (ALL_MACHINES_CFILES): Add cpu-xtensa.c.
3280         (BFD32_BACKENDS): Add elf32-xtensa.lo, xtensa-isa.lo, and
3281         xtensa-modules.lo.
3282         (BFD32_BACKENDS_CFILES): Add elf32-xtensa.c, xtensa-isa.c, and
3283         xtensa-modules.c.
3284         (cpu-xtensa.lo): New target.
3285         (elf32-xtensa.lo): Likewise.
3286         (xtensa-isa.lo): Likewise.
3287         (xtensa-modules.lo): Likewise.
3288         * Makefile.in: Regenerate.
3289         * archures.c (bfd_architecture): Add bfd_{arch,mach}_xtensa.
3290         (bfd_archures_list): Add bfd_xtensa_arch.
3291         * config.bfd: Handle xtensa-*-*.
3292         * configure.in: Handle bfd_elf32_xtensa_{le,be}_vec.
3293         * configure: Regenerate.
3294         * reloc.c: Add BFD_RELOC_XTENSA_{RTLD,GLOB_DAT,JMP_SLOT,RELATIVE,
3295         PLT,OP0,OP1,OP2,ASM_EXPAND,ASM_SIMPLIFY}.
3296         * targets.c (bfd_elf32_xtensa_be_vec): Declare.
3297         (bfd_elf32_xtensa_le_vec): Likewise.
3298         (bfd_target_vector): Add bfd_elf32_xtensa_{be,le}_vec.
3299         * cpu-xtensa.c: New file.
3300         * elf32-xtensa.c: Likewise.
3301         * xtensa-isa.c: Likewise.
3302         * xtensa-modules.c: Likewise.
3303         * libbfd.h: Regenerate.
3304         * bfd-in2.h: Likewise.
3305
3306 2003-04-01  Nick Clifton  <nickc@redhat.com>
3307
3308         * archures.c (bfd_mach_arm_unknown): Define.
3309         * bfd-in.h (bfd_arm_merge_machines, bfd_arm+update_notes,
3310         bfd_arm_get_mach_from_notes): Prototype.
3311         * bfd-in2.h: Regenerate.
3312         * coff-arm.c (coff_arm_merge_private_bfd_data): Call
3313         bfd_arm_merge_machines.
3314         (coff_arm_final_link_postscript): Call bfd_arm_update_notes.
3315         * coffcode.h (coff_set_arch_mach_hook): Call
3316         bfd_arm_get_mach_from_notes.
3317         * coffgen.c (coff_real_object_p): Revert previous delta.
3318         * cpu_arm.c (arm_check_note): New function.  Examine a note in a
3319         .note section.
3320         (bfd_arm_merge_machines): New function: Handle the merging of ARM
3321         binaries compiled for different architectures..
3322         (bfd_arm_update_notes): New function: Update an ARM note section.
3323         (bfd_arm_get_mach_from_notes): New function: Extract a bfd machine
3324         number from an ARM note section.
3325         * elf32-arm.h (elf32_arm_object_p): Use
3326         bfd_arm_get_mach_from_notes.
3327         (elf32_arm_merge_private_bfd_data): Use bfd_arm_merge_machines.
3328         (elf32_arm_final_write_processing): Use bfd_arm_update_notes.
3329
3330 2003-04-01  Ben Elliston  <bje@wasabisystems.com>
3331
3332         * dwarf2.c (read_attribute_value): Correct typo in comment.
3333
3334 2003-04-01  Nick Clifton  <nickc@redhat.com>
3335
3336         * dwarf2.c (concat_filename): Use bfd_malloc() and strdup()
3337         instead of concat().
3338         (decode_line_info): Only free filename if it is not NULL.
3339         (add_line_info): Make a copy of the filename when storing it into
3340         the info structure.
3341
3342 2003-03-31  Andreas Schwab  <schwab@suse.de>
3343             Daniel Jacobowitz  <drow@mvista.com>
3344
3345         * simple.c (bfd_simple_get_relocated_section_contents): Add
3346         parameter symbol_table.  Optionally use it instead of the symbol
3347         table from the bfd.  Save and restore output offsets and output
3348         sections  around bfd_get_relocated_section_contents.  Fix a memory
3349         leak.
3350         (simple_save_output_info, simple_restore_output_info): New
3351         functions.
3352         * bfd-in2.h: Regenerate.
3353         * dwarf2.c (read_abbrevs): Use
3354         bfd_simple_get_relocated_section_contents instead of
3355         bfd_get_section_contents.
3356         (decode_line_info): Likewise.
3357         (_bfd_dwarf2_find_nearest_line): Likewise.  Don't call
3358         find_rela_addend.
3359         (find_rela_addend): Remove.
3360         * elfxx-ia64.c (elfNN_ia64_reloc): Weaken sanity check for
3361         debugging sections.
3362         (elfNN_ia64_hash_table_create): Create the hash table with malloc,
3363         not bfd_zalloc.
3364
3365 2003-03-31  David Heine  <dlheine@suif.stanford.edu>
3366
3367         * aoutx.h (aout_link_hash_table_create): Use bfd_malloc instead of
3368         bfd_alloc.
3369         * dwarf2.c (concat_filename): Always allocate space for the
3370         returned filename.
3371         (decode_line_info): Free the allocated filename returned by
3372         concat_filename.
3373         * elf-eh-frame.c (bfd_elf_write_section_eh_frame): Fix memory leaks.
3374         * elf.c (copy_private_bfd_data): Likewise.
3375         (_bfd_elf_slurp_version_tables): Fix bug freeing contents pointer.
3376         * elflink.h (elf_link_sort_relocs): Fix memory leak.
3377         * format.c (bfd_check_format_matches): Likewise.
3378         * linker.c (bfd_generic_final_link): Likewise.
3379         * opncls.c (find_separate_debug_info): Likewise.
3380         * simple.c (bfd_simple_get_relocated_section_contents): Likewise.
3381
3382 2003-03-28  H.J. Lu <hjl@gnu.org>
3383
3384         * elflink.h (elf_link_add_object_symbols): Correctly combine
3385         visibilities.
3386
3387 2003-03-27  Jakub Jelinek  <jakub@redhat.com>
3388
3389         * elfxx-ia64.c (elfNN_ia64_relax_section): Reset self_dtpmod_offset
3390         to -1 before recomputing got offsets.
3391
3392 2003-03-26  Andreas Schwab  <schwab@suse.de>
3393
3394         * elf32-m68k.c (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Define.
3395         (elf_m68k_relocate_section): Use it to correctly handle symbols
3396         forced to be local.
3397         (elf_m68k_finish_dynamic_symbol): Emit RELATIVE reloc for got
3398         entries for symbols that are forced to be local.
3399
3400 2003-03-25  Alexandre Oliva  <aoliva@redhat.com>
3401
3402         * elfxx-mips.c (_bfd_mips_relax_section): New function.
3403         * elfxx-mips.h (_bfd_mips_relax_section): Declare.
3404         * elfn32-mips.c, elf64-mips.c: Use it.
3405
3406 2003-03-25  Stan Cox   <scox@redhat.com>
3407             Nick Clifton  <nickc@redhat.com>
3408
3409         Contribute support for Intel's iWMMXt chip - an ARM variant:
3410
3411         * archures.c: Add bfd_mach_arm_iWMMXt.
3412         * reloc.c: Add BFD_RELOC_ARM_CP_OFF_IMM_S2.
3413         * bfd-in2.h: Regenerate.
3414         * libbfd.h: Regenerate.
3415         * coff-arm.c (coff_arm_merge_private_bfd_data): Allow iWMMXt
3416         object files to be linked with XScale ones.
3417         (coff_arm_final_link_postscript): Update note section.
3418         * coffcode.h (coff_set_arch_mach_hook): Handle note section.
3419         * coffgen.c (coff_real_object_p): Call bfd_coff_set_arch_mach_hook
3420         after identifying a coff binary.
3421         * cpu-arm.c (processors): Add iWMMXt.
3422         (arch_inf): Likewise.
3423         * elf32-arm.h (arm_object_p): Handle note section.
3424         (elf32_arm_merge_private_bfd_data): Allow iWMMXt object files to
3425         be linked with XScale ones.
3426         (elf32_arm_section_flags): New function: Set flags on note section.
3427         (elf32_arm_final_write_processing): Handle note section.
3428
3429 2003-03-21  DJ Delorie  <dj@redhat.com>
3430
3431         * elf32-xstormy16.c (elf32_xstormy16_relocate_section): Call
3432         _bfd_elf_rela_local_sym.
3433
3434 2003-03-20  H.J. Lu <hjl@gnu.org>
3435
3436         * elfxx-ia64.c (elfNN_ia64_relax_section): Don't try relax for
3437         non-ELF outputs.
3438
3439 2003-03-20  Nick Clifton  <nickc@redhat.com>
3440
3441         * peXXigen.c (_bfd_XXi_swap_aouthdr_out): Initialise $idata2 and
3442         $idata5 in case bfd_coff_final_link is not called.
3443
3444 2003-03-19  Jakub Jelinek  <jakub@redhat.com>
3445
3446         * elf64-sparc.c (struct sparc64_elf_section_data): Add reloc_count
3447         field.
3448         (canon_reloc_count): Define.
3449         (sparc64_elf_slurp_one_reloc_table, sparc64_elf_slurp_reloc_table,
3450         sparc64_elf_canonicalize_dynamic_reloc): Use it instead of
3451         reloc_count.
3452         (sparc64_elf_canonicalize_reloc): New routine.
3453         (bfd_elf64_canonicalize_reloc): Define.
3454
3455 2003-03-18  Jakub Jelinek  <jakub@redhat.com>
3456
3457         * elfxx-ia64.c (elfNN_ia64_relax_section): Handle relaxation
3458         againt mergeable sections.  Take r_addend into account when caching
3459         trampolines.
3460
3461 2003-03-18  Richard Henderson  <rth@redhat.com>
3462
3463         * elfxx-ia64.c (get_dyn_sym_info): Return NULL gracefully for
3464         local symbols that have no dyninfo.
3465
3466 2003-03-14  Gene Smith  <gene.smith@siemens.com>
3467
3468         * ieee.c (ieee_write_expression): Handle the case where symbol is
3469         NULL.
3470         General formatting improvements.
3471
3472 2003-03-13  Nick Clifton  <nickc@redhat.com>
3473
3474         * configure.in (LINGUAS): Add zh_CN.
3475         * configure: Regenerate.
3476         * po/zh_CN.po: New file.
3477
3478 2003-03-13  Elias Athanasopoulos  <elathan@phys.uoa.gr>
3479
3480         * aout-cris.c (BYTES_IN_WORD): Don't define.
3481         aout-encap.c: Likewise.
3482         aout-ns32k.c: Likewise.
3483         aout-tic30.c: Likewise.
3484         hp300bsd.c: Likewise.
3485         i386aout.c: Likewise.
3486         i386dynix.c: Likewise.
3487         i386linux.c: Likewise.
3488         i386lynx.c: Likewise.
3489         i386mach3.c: Likewise.
3490         m68k4knetbsd.c: Likewise.
3491         m68klinux.c: Likewise.
3492         m68klynx.c: Likewise.
3493         m68knetbsd.c: Likewise.
3494         m88kmach3.c: Likewise.
3495         mipsbsd.c: Likewise.
3496         newsos3.c: Likewise.
3497         sparclinux.c: Likewise.
3498         sparclynx.c: Likewise.
3499         sparcnetbsd.c: Likewise.
3500         vaxbsd.c: Likewise. Fix comment formatting.
3501
3502 2003-03-12  Alexandre Oliva  <aoliva@redhat.com>
3503
3504         * Reverted 2003-03-02's patch.
3505
3506         * elfxx-target.h (bfd_elfNN_canonicalize_reloc): Make it
3507         overridable.
3508         * elf64-mips.c (mips_elf64_canonicalize_reloc,
3509         mips_elf64_get_dynamic_reloc_upper_bound,
3510         mips_elf64_canonicalize_dynamic_reloc): New, adapted from elf.c.
3511         (bfd_elf64_get_canonicalize_reloc,
3512         bfd_elf64_get_dynamic_reloc_upper_bound,
3513         bfd_elf64_canonicalize_dynamic_reloc): Define.
3514         (mips_elf64_slurp_reloc_table): Support dynamic.
3515         (mips_elf64_slurp_one_reloc_table): Adjust.
3516
3517 2003-03-12  Nick Clifton  <nickc@redhat.com>
3518
3519         * xsym.c (bfd_sym_fetch_type_information_table_entry): Change
3520         'index' to 'offset' in test for zero value.
3521
3522 2003-03-11  Alexandre Oliva  <aoliva@redhat.com>
3523
3524         * elfxx-mips.c (mips_elf_create_dynamic_relocation): Do not create
3525         dynamic relocations pointing to local or section symbols, use the
3526         NULL symbol instead.  Document the choice to not emit an
3527         additional R_MIPS_64 relocation.
3528
3529 2003-03-11  Alan Modra  <amodra@bigpond.net.au>
3530
3531         * elf32-ppc.c (ppc_elf_relocate_section): Subtract tls seg vma from
3532         zero index dynamic tls relocs generated for the GOT.  Tidy code.
3533         Set "relocation" to 1 on DTPMOD32 relocs.  Optimize HA adjustment.
3534         * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
3535
3536 2003-03-07  Alan Modra  <amodra@bigpond.net.au>
3537
3538         * elf32-ppc.c (ppc_elf_relocate_section): Don't look for a nop after
3539         a tls_get_addr call.
3540
3541         * elf32-ppc.c (ELIMINATE_COPY_RELOCS): Define as one.
3542         (ppc_elf_adjust_dynamic_symbol): For weak symbols, copy
3543         ELF_LINK_NON_GOT_REF from weakdef.
3544         * elf64-ppc.c (ELIMINATE_COPY_RELOCS): Define as one.
3545         (ppc64_elf_adjust_dynamic_symbol): For weak symbols, copy
3546         ELF_LINK_NON_GOT_REF from weakdef.
3547         * elf32-i386.c (ELIMINATE_COPY_RELOCS): Define as one.  Use throughout.
3548         (elf_i386_adjust_dynamic_symbol): For weak symbols, copy
3549         ELF_LINK_NON_GOT_REF from weakdef.
3550
3551 2003-03-06  Jakub Jelinek <jakub@redhat.com>
3552         Andrew Haley  <aph@redhat.com>
3553
3554         * elflink.h (elf_bfd_discard_info): Don't process eh frames if
3555         output is relocateable.
3556
3557 2003-03-06  Steven Konopa <skonopa@kgo.csc.com>
3558
3559         * som.c (som_fixup_formats): Correct formats for R_AUX_UNWIND and
3560         R_COMMENT.
3561
3562 2003-03-06  Alan Modra  <amodra@bigpond.net.au>
3563
3564         * elf32-ppc.c (ppc_elf_create_linker_section): Don't capitalize
3565         error messages.
3566         (ELIMINATE_COPY_RELOCS): Define to zero.
3567         (ppc_elf_relocate_section): Don't deref htab->tls_sec when calculating
3568         TLSLD relocs.  Report reloc types on a number of errors.  Optimize
3569         LOCAL24PC check for non-local syms.  Don't capitalize error messages.
3570         * elf64-ppc.c (ELIMINATE_COPY_RELOCS): Define to zero.
3571         (ppc64_elf_relocate_section): Don't deref htab->tls_sec when
3572         calculating TLSLD relocs.  Report reloc types on a number of errors.
3573         Don't capitalize error messages.
3574
3575 2003-03-03  H.J. Lu <hjl@gnu.org>
3576
3577         * elfxx-ia64.c (USE_BRL): Removed.
3578         (oor_ip): Removed.
3579
3580 2003-03-03  J"orn Rennecke <joern.rennecke@superh.com>
3581
3582         * elf32-sh.c (sh_elf_howto_tab): Make R_SH_IND12W into an ordinary
3583         relocation (no special function), and make it non-partial_inplace.
3584         (sh_elf_relax_section): When creating a bsr, use a consistent value
3585         no matter if the symbol is extern or not;  set addend to -4.
3586         Don't swap load / non-load instructions for SH4.
3587         (sh_elf_relax_delete_bytes): In R_SH_IND12W case, check the offset
3588         rather than if the symbol is external to determine if adjusting the
3589         offset makes sense.  Adjust the addend too if appropriate.
3590         (sh_elf_relocate_section): In R_SH_IND12W, don't fiddle with the
3591         relocation.
3592
3593 2003-03-03  Nick Clifton  <nickc@redhat.com>
3594
3595         * po/da.po: Installed latest translation.
3596
3597 2003-03-02  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
3598
3599         * elf32-mips.c (elf_mips_howto_table_rel): Change definition of
3600         R_MIPS_PC16 to rightshift 2.
3601         (elf_reloc_map mips_reloc_map): Map to rightshifted BFD reloc.
3602         (bfd_elf32_bfd_reloc_type_lookup): Support
3603         BFD_RELOC_MIPSEMB_16_PCREL_S2.
3604         * elf64-mips.c (mips_elf64_howto_table_rel): Change definition of
3605         R_MIPS_PC16 to rightshift 2.
3606         (mips_elf64_howto_table_rela): Likewise.
3607         (mips_reloc_map): Map to rightshifted BFD reloc.
3608         * elfn32-mips.c: The same as in elf64-mips.c.
3609         * elfxx-mips.c (mips_elf_got_for_ibfd): Typo in comment.
3610         (mips_elf_calculate_relocation): Handle rightshifted addends for
3611         R_MIPS_PC16.
3612         * reloc.c (BFD_RELOC_MIPSEMB_16_PCREL_S2): New BFD relocation for
3613         MIPS Embedded PIC. Remove superfluous empty COMMENT.
3614         * libbfd.h: Regenerate.
3615         * bfd-in2.h: Regenerate.
3616
3617 2003-02-28  Richard Henderson  <rth@redhat.com>
3618
3619         * elfxx-ia64.c (elfNN_ia64_relax_section): Correct bounds
3620         for ltoff22x relaxation.
3621
3622 2003-03-01  Alan Modra  <amodra@bigpond.net.au>
3623
3624         * bfd-in.h (_bfd): Don't define.
3625         * bfd.c: Rename occurrences of "struct _bfd" to "struct bfd".
3626         * syms.c: Likewise.
3627         * bfd-in2.h: Regenerate.
3628
3629 2003-02-27  Richard Henderson  <rth@redhat.com>
3630
3631         * elfxx-ia64.c (struct elfNN_ia64_dyn_sym_info): Add want_gotx;
3632         (elfNN_ia64_check_relocs): Set it.
3633         (allocate_global_data_got): Check it.
3634         (allocate_local_got): Likewise.
3635         (allocate_dynrel_entries): Likewise.
3636         (elfNN_ia64_relax_ldxmov): New.
3637         (elfNN_ia64_relax_section): Handle LTOFF22X, LDXMOV.
3638         (elfNN_ia64_choose_gp): Split out from ...
3639         (elfNN_ia64_final_link): ... here.
3640
3641 2003-02-27  Andrew Cagney  <cagney@redhat.com>
3642
3643         * bfd.c (struct bfd): Rename "struct _bfd".
3644         * bfd-in.h: Update copyright.
3645         (struct bfd): Rename "struct _bfd".
3646         (_bfd): Define for backward compatibility.
3647         * bfd-in2.h: Regenerate.
3648
3649 2003-02-25  Alan Modra  <amodra@bigpond.net.au>
3650
3651         * elflink.h (elf_bfd_final_link): Apportion reloc counts to rel_hdr
3652         and rel_hdr2 when initially counting input relocs rather than after
3653         creating output reloc sections.
3654         (elf_link_read_relocs_from_section): Don't abort with wrong reloc
3655         sizes.
3656
3657         * Makefile.am: Run "make dep-am".
3658         * Makefile.in: Regenerate.
3659
3660 2003-02-24  Kris Warkentin  <kewarken@qnx.com>
3661
3662         * elf.c (elfcore_read_notes): Add check for QNX style core file.
3663         (elfcore_grog_nto_note): New function.
3664         (elfcore_grog_nto_gregs): New function.
3665         (elfcore_grog_nto_status): New function.
3666
3667 2003-02-24  Alan Modra  <amodra@bigpond.net.au>
3668
3669         * elflink.c (_bfd_elf_create_got_section): Check existing .got
3670         section flags before concluding that we've already been called.
3671         Don't use register keyword.
3672         (_bfd_elf_create_dynamic_sections): Don't use register keyword.
3673         (_bfd_elf_create_linker_section): Formatting.
3674
3675 2003-02-20  jmc  <jmc@prioris.mini.pw.edu.pl>
3676
3677         * coff-h8300.c: Fix typo: intial -> initial.
3678         * coff-ppc.c: Likewise.
3679
3680 2003-02-20  Alan Modra  <amodra@bigpond.net.au>
3681
3682         * elf32-ppc.c: Formatting.
3683         (allocate_dynrelocs): LD and GD relocs against the same sym need
3684         separate GOT entries.
3685         (ppc_elf_relocate_section): Correct GOT handling for multiple GOT
3686         entries per symbol.
3687
3688 2003-02-19  Alan Modra  <amodra@bigpond.net.au>
3689
3690         * elf32-hppa.c (elf32_hppa_gc_sweep_hook): Simplify dynamic reloc
3691         removal.  Localize vars.  Remove unnecessary dynobj test.
3692         * elf32-i386 (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Pass SHARED instead
3693         of INFO.
3694         (allocate_dynrelocs): Adjust WILL_CALL_FINISH_DYNAMIC_SYMBOL uses,
3695         and optimize.
3696         (elf_i386_relocate_section): Likewise.
3697         (elf_i386_gc_sweep_hook): Simplify dyn reloc removal.  Localize vars.
3698         * elf32-s390.c (elf_s390_gc_sweep_hook): Likewise.
3699         * elf32-sh.c (sh_elf_gc_sweep_hook): Likewise.
3700         * elf64-s390.c (elf_s390_gc_sweep_hook): Likewise.
3701         * elf64-x86-64.c (elf64_x86_64_gc_sweep_hook): Likewise.
3702         * elf32-sparc.c (elf32_sparc_gc_sweep_hook): Likewise.  Remove
3703         local_dynrel for section too.  Don't touch HIPLT22, LOPLT10, PCPLT32
3704         or PCPLT10 relocs.  Don't subtract twice on PLT32 relocs.
3705         Formatting.
3706
3707         * elf64-ppc.c (ELIMINATE_COPY_RELOCS): Define.
3708         (ppc64_elf_check_relocs): Use it.  Correct comment.  Move SEC_ALLOC
3709         test.
3710         (ppc64_elf_adjust_dynamic_symbol): Use ELIMINATE_COPY_RELOCS.
3711         (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Pass SHARED instead of INFO.
3712         (allocate_dynrelocs): Adjust WILL_CALL_FINISH_DYNAMIC_SYMBOL uses,
3713         and optimize.  Use ELIMINATE_COPY_RELOCS.
3714         (ppc64_elf_relocate_section): Likewise.
3715
3716         * elf32-ppc.c (struct ppc_elf_dyn_relocs): Add pc_count field.
3717         (ppc_elf_copy_indirect_symbol): Copy pc_count field.
3718         (ELIMINATE_COPY_RELOCS): Define.
3719         (ppc_elf_adjust_dynamic_symbol): Convert copy relocs to dynamic.
3720         (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Pass SHARED instead of INFO.
3721         (MUST_BE_DYN_RELOC): Define.
3722         (allocate_dynrelocs): Adjust WILL_CALL_FINISH_DYNAMIC_SYMBOL uses,
3723         and optimize.  Trim dyn_relocs.
3724         (ppc_elf_check_relocs): Don't generate dyn_relocs when we know they'll
3725         not be used.  Do generate dyn_relocs for copy reloc avoidance.  Keep
3726         track of pc_rel dyn relocs.
3727         (ppc_elf_relocate_section): Remove "will_become_local".  Adjust
3728         WILL_CALL_FINISH_DYNAMIC_SYMBOL use.  Trim dyn relocs as per
3729         allocate_dynrelocs.  Don't recalculate "sec".
3730
3731 2003-02-18  Alan Modra  <amodra@bigpond.net.au>
3732
3733         * elf32-ppc.c (ppc_elf_relocate_section): Remove unnecessary test.
3734         * elf64-ppc.c (ppc64_elf_tls_optimize): Decrement tlsld_got.refcount
3735         on invalid LD relocs.
3736         (allocate_dynrelocs): Invalid LD relocs don't use tlsld_got entry.
3737         (ppc64_elf_relocate_section): Unify new handling of LD relocs and
3738         tlsld_got entry.  Use IS_PPC64_TLS_RELOC.
3739
3740         * elf32-ppc.h: New file.
3741         * elf32-ppc.c: Include elf32-ppc.h.
3742         (NOP, CROR_151515, CROR_313131, TP_OFFSET, DTP_OFFSET): Define.
3743         (struct ppc_elf_link_hash_entry): Rename "root" to "elf".  Adjust uses.
3744         Add "tls_mask" field.
3745         (TLS_GD, TLS_LD, TLS_TPREL, TLS_DTPREL, TLS_TLS, TLS_TPRELGD): Define.
3746         (struct ppc_elf_link_hash_table): Rename "root" to "elf".  Adjust uses.
3747         Add got, relgot, plt, relplt, dynbss, relbss, dynsbss, relsbss,
3748         sdata, sdata2, tls_sec, tls_get_addr, tlsld_got fields.
3749         Make use of htab shortcuts throughout file.
3750         (ppc_elf_link_hash_newfunc): Init tls_mask field.
3751         (ppc_elf_link_hash_table_create): Init new fields.
3752         (ppc_elf_copy_indirect_symbol): Copy tls_mask.
3753         (ppc_elf_howto_raw): Add tls relocs.
3754         (ppc_elf_reloc_type_lookup): Handle them.
3755         (ppc_elf_unhandled_reloc): New function.
3756         (ppc_elf_create_got): Stash got section pointer in hash table,
3757         return status.  Make .rela.got too.
3758         (ppc_elf_create_dynamic_sections): Stash section pointers in htab.
3759         (ppc_elf_adjust_dynamic_symbol): Only set up copy relocs when
3760         NON_GOT_REF set.  Don't allocate space in .plt here..
3761         (allocate_dynrelocs): ..do so here instead, properly ref-counting and
3762         not allocating plt entries unnecessarily.  Allocate got entries here.
3763         (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Define.
3764         (ppc_elf_size_dynamic_sections): Allocate local got entries.  Pass
3765         "info" during allocate_dynrelocs hash traversal.  Use htab section
3766         shortcuts rather than searching for named sections.  Get rid of
3767         "plt" and "strip" booleans.
3768         (update_local_sym_info, bad_shared_reloc): New functions.
3769         (ppc_elf_check_relocs): Handle TLS relocs.  Move .rela.got creation to
3770         ppc_elf_create_got.  Don't mark got or plt reloc syms dynamic, do so
3771         in allocate_dynreloc.  Use update_local_sym_info and bad_shared_reloc.
3772         Disallow R_PPC_EMB_RELSDA, R_PPC_EMB_NADDR32, R_PPC_EMB_NADDR16,
3773         R_PPC_EMB_NADDR16_LO, R_PPC_EMB_NADDR16_HI and R_PPC_EMB_NADDR16_HA
3774         in shared libs.  R_PPC_PLTREL32 is a plt reloc too.  Refcount all
3775         relocs that might use a plt entry.  Set NON_GOT_REF too.
3776         Enumerate all do-nothing relocs.
3777         (ppc_elf_gc_sweep_hook): Simplify removal of dynrelocs.  Handle
3778         tls relocs and all plt relocs.
3779         (ppc_elf_tls_setup, ppc_elf_tls_optimize): New functions.
3780         (ppc_elf_finish_dynamic_symbol): Don't build got entries here.
3781         (ppc_elf_finish_dynamic_sections): Rewrite tag code using htab
3782         shortcuts.
3783         (ppc_elf_relocate_section): Tidy.  Handle TLS relocs.  Use
3784         bfd_elf_local_sym_name.  Simplify unresolved reloc code.  Build got
3785         entries and got relocs here.  Warn on non-zero got reloc addend.
3786         Split out branch taken/not taken reloc code into a separate switch
3787         and correct offset calculation. Allow BRTAKEN/BRNTAKEN dynamic relocs.
3788         Split out HA reloc adjustments to separate switch statement.  Don't
3789         warn on reloc overflow if we've already warned about undefined.
3790         Don't rebuild sym name when reporting errors.  Report all possible
3791         errors from _bfd_final_link_relocate.
3792         (bfd_elf32_bfd_final_link): Don't define.
3793
3794 2003-02-18  Alan Modra  <amodra@bigpond.net.au>
3795
3796         * elf64-ppc.c (ppc64_elf_relocate_section): Don't init "r".  Don't
3797         rebuild sym name when reporting errors.
3798
3799 2003-02-17  Nick Clifton  <nickc@redhat.com>
3800
3801         * elflink.h (elf_link_output_extsym): Only check
3802         allow_shlib_undefined for shared libraries.
3803         * elf32-i386.c (elf_i386_relocate_section): Remove bogus check
3804         of allow_shlib_undefined.
3805         * elf32-cris.c (cris_elf_relocate_section): Likewise.
3806         * elf32-hppa.c (elf32_hppa_relocate_section): Likewise.
3807         * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
3808         * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
3809         * elf32-s390.c (elf_s390_relocate_section): Likewise.
3810         * elf32-sh.c (sh_elf_relocate_section): Likewise.
3811         * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
3812         * elf32-vax.c (elf_vax_relocate_section): Likewise.
3813         * elf64-alpha.c (elf64_alpha_relocate_section): Likewise.
3814         * elf64-hppa.c (elf64_hppa_relocate_section): Likewise.
3815         * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
3816         * elf64-s390.c (elf_s390_relocate_section): Likewise.
3817         * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
3818         * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
3819         * elfxx-ia64.c (elfNN_ia64_relocate_section): Likewise.
3820         * elfxx-mips.c (_bfd_mips_elf_relocate_section): Likewise.
3821
3822 2003-02-17  Nick Clifton  <nickc@redhat.com>
3823
3824         * elf.c (SEGMENT_AFTER_SEGMENT): Add third parameter - the
3825         address field to use in the comparison.
3826         (SEGMENT_OVERLAPS): Check that LMAs overlap as well.
3827
3828 2003-02-14  Bob Wilson  <bob.wilson@acm.org>
3829
3830         * elfcore.h (elf_core_file_p): Compare alternate machine codes for ELF
3831         backends when checking if the generic ELF target should be used.
3832
3833         * syms.c (_bfd_stab_section_find_nearest_line): For line number stabs
3834         outside of functions, treat values as absolute addresses.
3835
3836         * bfd.c: Change embedded documentation to use consistent indentation
3837         and to split up long lines.  Change informal style of description
3838         for functions lacking real documentation.
3839         * coffcode.h: Break up long lines in embedded documentation.
3840         * format.c: Likewise.
3841         * targets.c: Likewise.
3842         * libcoff.h: Regenerate.
3843         * bfd-in2.h: Regenerate.
3844
3845 2003-02-14  Alan Modra  <amodra@bigpond.net.au>
3846
3847         * elf64-ppc.c (ppc64_elf_link_hash_table_create): Init tls_get_addr.
3848         (ppc64_elf_copy_indirect_symbol): Merge tls_mask too.
3849         (ppc64_elf_gc_sweep_hook): Simplify removal of dyn_relocs.
3850         (allocate_dynrelocs): Don't treat undefined and undefweak specially.
3851         (ppc_size_one_stub): Fix warning, and tighten plt entry check.
3852         (group_sections): Don't share a stub section if stubs are for a large
3853         section.  Adjust comment.
3854         (ppc64_elf_size_stubs): Roughly double the size left for stubs if
3855         !stubs_always_before_branch.
3856         (ppc64_elf_relocate_section): Initialize tlsld GOT entry once.  Don't
3857         treat undefined and undefweak specially when processing dyn relocs.
3858
3859 2003-02-13  Jakub Jelinek  <jakub@redhat.com>
3860
3861         * elflink.h (elf_link_add_object_symbols): Handle .symver x, x@FOO.
3862
3863 2003-02-13  Nick Clifton  <nickc@redhat.com>
3864
3865         * elf32-arm.h (elf32_thumb_to_arm_stub): Include section VMAs
3866         in computation of offset to insert into BL instruction.
3867
3868 2003-02-11  Uwe Stieber  <uwe@wwws.de>
3869
3870         * config.bfd: Add support for kaOS as cross build target system.
3871
3872 2003-02-11  Alan Modra  <amodra@bigpond.net.au>
3873
3874         * elf64-ppc.c (ppc64_elf_check_relocs): Match versioned
3875         .__tls_get_addr too.
3876         (ppc64_elf_tls_setup): Ensure cached tls_get_addr is not indirect.
3877
3878 2003-02-10  Kaz kojima  <kkojima@rr.iij4u.or.jp>
3879
3880         * elf32-sh.c (elf_sh_dyn_relocs): Add tls_tpoff32 field.
3881         (elf_sh_link_hash_entry): Remove tls_tpoff32 field.
3882         (sh_elf_link_hash_newfunc): Remove the initialization of
3883         tls_tpoff32 field.
3884         (allocate_dynrelocs): Keep dyn_relocs if it includes the entry
3885         for which tls_tpoff32 flag is set.
3886         (sh_elf_relocate_section): Covert to LE only if the dyn_relocs
3887         of the symbol includes the entry matched with the input_section
3888         and having tls_tpoff32 flag on.  When linking statically, set
3889         symbol index of R_SH_TLS_TPOFF32 relocation to zero if the symbol
3890         is defined in this executable.
3891         (sh_elf_check_relocs): Set tls_tpoff32 flag appropriately.
3892
3893 2003-02-10  Jakub Jelinek  <jakub@redhat.com>
3894
3895         * elf32-s390.c (elf_s390_size_dynamic_sections): Set relocs to TRUE
3896         even if there is just non-empty .rela.plt.
3897
3898 2003-02-10  Nick Clifton  <nickc@redhat.com>
3899
3900         * archures.c (bfd_mach_arm_ep9312): Define.
3901         * bfd-in2.h: Regenerate.
3902         * cpu-arm.c (processors[]): Add ep9312.
3903         (bfd_arm_arch): Add ep9312.
3904         * elf32-arm.h (elf32_arm_merge_private_data): Update error
3905         messages and add test for Maverick floating point support.
3906         (elf32_arm_print_private_bfd_data): Handle
3907         EF_ARM_MAVERICK_FLOAT flag.
3908         (elf32_arm_object_p): New function.
3909         (elf_backend_object_p): Define.
3910
3911 2003-02-10  Alan Modra  <amodra@bigpond.net.au>
3912
3913         * elf64-ppc.c: Rename assorted occurrences of tls_type and similar
3914         variables, structure fields or function params to tls_mask or
3915         similar to better reflect usage.
3916         (struct got_entry): Comment.
3917         (struct ppc_link_hash_entry): Expand comment, and renumber TLS_*.
3918         (get_tls_mask): Rename from get_tls_type.
3919
3920 2003-02-09  Alan Modra  <amodra@bigpond.net.au>
3921
3922         * elf64-ppc.c (TLS_GD_LD): Don't define..
3923         (TLS_GD): ..define this instead and update all uses.
3924         (TLS_TPRELGD): Define.
3925         (ppc64_elf_link_hash_table_create): Tweak initialization of
3926         init_refcount and init_offset.
3927         (ppc64_elf_check_relocs): Add one extra element to t_symndx array.
3928         Mark second slot of GD or LD toc entries.
3929         (get_tls_type): Return an int.  Distinguish toc GD and LD entries
3930         from other tls types.
3931         (ppc64_elf_tls_setup): New function, split out from..
3932         (ppc64_elf_tls_optimize): ..here.  Don't optimize when symbols are
3933         defined in a dynamic object.  Fix LD optimization.  Don't set TLS_TPREL
3934         on GD->IE optimization, use TLS_TPRELGD instead.  Use get_tls_type
3935         return value to properly decide whether toc GD and LD entries can
3936         optimize away __tls_get_addr call.  Check next reloc after DTPMOD64
3937         to determine GD or LD rather than looking at TLS_LD flag.  Don't
3938         attempt to adjust got entry tls_type here..
3939         (allocate_dynrelocs): ..instead, adjust got entry tls_type here, and
3940         look for possible merges.
3941         (ppc64_elf_size_dynamic_sections): Adjust local got entries for
3942         optimization.
3943         (ppc64_elf_size_stubs): Tweak __tls_get_addr fudge.
3944         (ppc64_elf_relocate_section): Rename some vars to better reflect usage.
3945         Make use of return value from get_tls_type to properly detect GD and
3946         LD optimizations.  Split tlsld/gd hi/ha from lo/ds case.  Don't
3947         handle tls_get_addr removal when looking at REL24 relocs, do it when
3948         looking at the previous reloc.  Check reloc after DTPMOD64 to determine
3949         GD or LD.
3950         * elf64-ppc.h (ppc64_elf_tls_setup): Declare.
3951
3952 2003-02-08  Alan Modra  <amodra@bigpond.net.au>
3953
3954         * elf32-hppa.c (group_sections): Don't share a stub section if
3955         stubs are for a large section.
3956
3957         * elf32-hppa.c (elf32_hppa_size_stubs): Double the size left for
3958         stubs if !stubs_always_before_branch.
3959
3960 2003-02-07  Nick Clifton  <nickc@redhat.com>
3961
3962         * elf.c (swap_out_syms): Generate an error message if an
3963         equivalent output section cannot be found for a symbol.
3964
3965 2003-02-07  Jakub Jelinek  <jakub@redhat.com>
3966
3967         * elf64-alpha.c (elf64_alpha_relax_section): Don't crash if
3968         local_got_entries is NULL.
3969
3970 2003-02-06  Andreas Schwab  <schwab@suse.de>
3971
3972         * elf-eh-frame.c (get_DW_EH_PE_signed): Define.
3973         (read_value): Add parameter is_signed, use signed extraction if
3974         the value is signed.
3975         (_bfd_elf_write_section_eh_frame): Pass signed flag of the
3976         encoding to read_value.
3977
3978 2003-02-06  Alan Modra  <amodra@bigpond.net.au>
3979
3980         * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Don't copy got and
3981         plt info when called to transfer weak sym info.
3982
3983 2003-02-05  Alan Modra  <amodra@bigpond.net.au>
3984
3985         * reloc.c: Add PPC and PPC64 TLS relocs.
3986         * libbfd.h: Regenerate.
3987         * bfd-in2.h: Regenerate.
3988         * elf64-ppc.c (TP_OFFSET, DTP_OFFSET): Declare.
3989         (ppc64_elf_howto_raw): Add TLS howto's.  Adjust R_PPC64_NONE to be
3990         against a 32 bit field.
3991         (ppc64_elf_reloc_type_lookup): Handle TLS relocs.
3992         (_ppc64_elf_section_data): Add t_symndx and comments.
3993         (ppc64_elf_section_data): Use elf_section_data macro.
3994         (ppc64_elf_new_section_hook): American spelling.
3995         (struct got_entry, struct plt_entry): New.
3996         (MUST_BE_DYN_RELOC): Rename from IS_ABSOLUTE_RELOC.
3997         (struct ppc_stub_hash_entry): Add "addend" field.
3998         (struct ppc_link_hash_entry): Add "tls_type".
3999         (TLS_TLS, TLS_GD_LD, TLS_LD, TLS_TPREL, TLS_DTPREL,
4000         TLS_EXPLICIT): Define.
4001         (struct ppc_link_hash_table): Add tls_sec, tls_get_addr, tlsld_got.
4002         (link_hash_newfunc): Init new fields.
4003         (ppc64_elf_link_hash_table_create): Likewise.  Set init_refcount and
4004         init_offset to NULL.
4005         (ppc64_elf_copy_indirect_symbol): Copy got and plt info.  Don't call
4006         _bfd_elf_link_hash_copy_indirect, rather insert relevant code from
4007         there.
4008         (update_local_sym_info, update_plt_info): New functions.
4009         (ppc64_elf_check_relocs): Use them.  Handle TLS relocs.  Adjust GOT
4010         handling to use got.glist rather than got.refcount.  Likewise for PLT.
4011         (ppc64_elf_gc_sweep_hook): Handle TLS relocs, new GOT and PLT lists.
4012         (func_desc_adjust): Adjust for new PLT list.
4013         (ppc64_elf_adjust_dynamic_symbol): Likewise.
4014         (get_sym_h, get_tls_type): New functions.
4015         (ppc64_elf_edit_opd): Remove unused variable.  Use get_sym_h.
4016         (ppc64_elf_tls_optimize): New function.
4017         (allocate_dynrelocs): Adjust for new PLT and GOT lists.  Allocate
4018         TLS relocs.
4019         (ppc64_elf_size_dynamic_sections): Likewise.
4020         (ppc_type_of_stub): Adjust for new PLT list.
4021         (ppc_build_one_stub): Likewise.
4022         (ppc64_elf_size_stubs): Likewise.  Use get_sym_h.  Treat __tls_get_addr
4023         calls specially.
4024         (ppc64_elf_relocate_section): Adjust for new GOT and PLT lists.  Handle
4025         TLS relocs.  Report local syms using bfd_elf_local_sym_name.  Don't
4026         init GOT entries that have a reloc.  Generate GOT relocs here..
4027         (ppc64_elf_finish_dynamic_symbol): ..not here.  Adjust for PLT list.
4028         * elf64-ppc.h (ppc64_elf_tls_optimize): Declare.
4029
4030 2003-02-04  Andreas Schwab  <schwab@suse.de>
4031
4032         * elf32-m68k.c (elf_m68k_hash_entry): Define.
4033         (elf_m68k_link_hash_traverse): Remove.
4034         (elf_m68k_link_hash_newfunc): Use struct bfd_hash_entry and
4035         elf_m68k_hash_entry instead of struct elf_m68k_link_hash_entry to
4036         reduce casting.
4037         (elf_m68k_check_relocs): Use elf_m68k_hash_entry instead of
4038         casting.
4039         (elf_m68k_size_dynamic_sections): Use elf_link_hash_traverse
4040         instead of elf_m68k_link_hash_traverse.
4041         (elf_m68k_discard_copies): Change first parameter to pointer to
4042         struct elf_link_hash_entry and use elf_m68k_hash_entry when struct
4043         elf_m68k_link_hash_entry is needed.
4044
4045 2003-02-04  Alan Modra  <amodra@bigpond.net.au>
4046
4047         * elf-bfd.h (struct got_entry, struct plt_entry): Forward declare.
4048         (struct elf_link_hash_entry): Add "glist" and "plist" fields to
4049         "got" union, and declare as gotplt_union.  Use gotplt_uinion for
4050         "plt" field.
4051         (struct elf_link_hash_table): Make "init_refcount" a gotplt_union.
4052         Add "init_offset" field.
4053         (struct elf_obj_tdata <local_got>): Add "struct got_entry **" to union.
4054         (elf_local_got_ents): Declare.
4055         * elf.c (_bfd_elf_link_hash_newfunc): Adjust initialization of "got"
4056         and "plt".
4057         (_bfd_elf_link_hash_hide_symbol): Use "init_offset".
4058         (_bfd_elf_link_hash_table_init): Set "init_offset".
4059         * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Set init_refcount
4060         from init_offset.
4061         (elf_adjust_dynamic_symbol): Set plt and got offsets using init_offset.
4062
4063         * elf.c (bfd_elf_local_sym_name): Split out from..
4064         (group_signature): ..here.
4065         * elf-bfd.h (bfd_elf_local_sym_name): Declare.
4066
4067 2003-02-04  Alan Modra  <amodra@bigpond.net.au>
4068
4069         * elf-bfd.h (enum elf_link_info_type): Remove.
4070         (struct bfd_elf_section_data): Move sec_info_type, use_rela_p fields
4071         to struct sec.  Remove linkonce_p field.
4072         (elf_linkonce_p): Delete.
4073         (elf_discarded_section): Update for sec_info_type change.
4074         * section.c (struct sec): Add sec_info_type, use_rela_p, has_tls_reloc,
4075         flag11, flag12, flag13, flag14, flag15, flag16, flag20, flag24.
4076         (ELF_INFO_TYPE_NONE): Define.
4077         (ELF_INFO_TYPE_STABS): Define.
4078         (ELF_INFO_TYPE_MERGE): Define.
4079         (ELF_INFO_TYPE_EH_FRAME): Define.
4080         (ELF_INFO_TYPE_JUST_SYMS): Define.
4081         (STD_SECTION): Update struct sec initializer.
4082         * ecoff.c (bfd_debug_section): Likewise.
4083         * elf.c: Likewise.  Update occurrences of sec_info_type and use_rela_p.
4084         * elflink.h: Likewise.
4085         * elf-eh-frame.c: Likewise.
4086         * elf64-alpha.c: Likewise.
4087         * elfxx-ia64.c: Likewise.
4088         * elfxx-mips.c: Likewise.
4089         * bfd-in2.h: Regenerate.
4090
4091         * elf32-sparc.c (sec_do_relax): Use elf_section_data macro rather than
4092         referring to used_by_bfd.
4093         * elf64-sparc.c (sec_do_relax): Likewise.
4094         * elf64-mmix.c (mmix_elf_section_data): Likewise.
4095         * elfxx-mips.c (mips_elf_section_data): Likewise.
4096         * ieee.c (ieee_slurp_section_data): Use ieee_per_section macro.
4097         (ieee_get_section_contents): Likewise.
4098         (ieee_new_section_hook): Formatting.
4099         (ieee_canonicalize_reloc): Remove commented out code.
4100         * mmo.c (mmo_section_data): Define.  Use throughout file.
4101         * oasys.c (oasys_get_section_contents): Use oasys_per_section macro.
4102
4103 2003-01-31  Graydon Hoare <graydon@redhat.com>
4104
4105         * Makefile.am (opncls.lo): Add dependency upon libiberty.h.
4106         * Makefile.in: Regenerate.
4107         * opncls.c (calc_crc32, get_debug_link_info,
4108         seperate_debug_file_exists, find_seperate_debug_file): New
4109         internal functions.
4110         (bfd_follow_gnu_debuglink): New function.  Follow the pointer
4111         contained inside a .gnu_debuglink section.
4112         * bfd-in2.h: Regenerate.
4113
4114 2003-01-29  Alexandre Oliva  <aoliva@redhat.com>
4115
4116         * elfxx-mips.c (mips_elf_got_entry_hash): Don't dereference
4117         entry->abfd when it's NULL.
4118
4119 2003-01-27  Alexandre Oliva  <aoliva@redhat.com>
4120
4121         * elfxx-mips.c (mips_elf_create_dynamic_relocation): Handle
4122         _bfd_elf_section_offset returning -2 the same way as -1.
4123
4124         * elfxx-mips.c (mips_elf_multi_got): New function.
4125         (struct mips_got_entry): Make symndx and gotidx signed.  Moved
4126         addend into union along with address and link hash entry.
4127         (struct mips_got_info): Added bfd2got and next.
4128         (struct mips_elf_hash_sort_data): Added max_unref_got_dynindx.
4129         (mips_elf_got_section, mips_elf_create_got_section): Use
4130         SEC_EXCLUDE bit to tell whether we really need the got
4131         section.  Take boolean arguments to disregard an excluded
4132         section, or to create it as excluded.  Adjust all callers.
4133         Use mips_elf_got_section all over.
4134         (mips_elf_local_got_index, mips_elf_got_page,
4135         mips_elf_got16_entry): Take input bfd as argument, and pass it
4136         on to mips_elf_create_local_got_entry.
4137         (mips_elf_global_got_index, mips_elf_create_local_got_entry):
4138         Take input bfd as argument, and manage entries in the
4139         appropriate GOT.
4140         (mips_elf_got_offset_from_index): Take input bfd as argument,
4141         and use it to adjust the GP offset of the bfd.
4142         (mips_elf_sort_hash_table, mips_elf_sort_hash_table_f): Move
4143         unreferenced GOT entries of global symbols to the end.
4144         (mips_elf_record_global_got_symbol): Take input bfd as
4145         argument.  Add entries to the master GOT hash table.
4146         (struct mips_elf_bfd2got_hash): New.
4147         (struct mips_elf_got_per_bfd_arg): New.
4148         (struct mips_elf_set_global_got_offset_arg): New.
4149         (mips_elf_hash_bfd_vma, mips_elf_multi_got_entry_hash,
4150         mips_elf_multi_got_entry_eq, mips_elf_bfd2got_entry_hash,
4151         mips_elf_bfd2got_entry_eq, mips_elf_make_got_per_bfd,
4152         mips_elf_merge_gots, mips_elf_set_global_got_offset,
4153         mips_elf_resolve_final_got_entry,
4154         mips_elf_resolve_final_got_entries, mips_elf_adjust_gp,
4155         mips_elf_got_for_ibfd): New functions.
4156         (ELF_MIPS_GP_OFFSET): Don't depend on SGI_COMPAT.
4157         (MIPS_ELF_GOT_MAX_SIZE): New macro.
4158         (STUB_LW): Generate 64-bit stub regardless of SGI_COMPAT.
4159         (mips_elf_got_entry_hash): Take new fields into account.  Use
4160         mips_elf_hash_bfd_vma.
4161         (mips_elf_got_entry_eq): Take new fields into account.
4162         (mips_elf_create_got_section): Initialize new fields.
4163         (mips_elf_calculate_relocation): Pass input_bfd to functions
4164         that now take it.  Adjust gp for the input_bfd.
4165         (mips_elf_allocate_dynamic_relocation,
4166         mips_elf_create_dynamic_relocation,
4167         _bfd_mips_elf_create_dynamic_sections): Use...
4168         (mips_elf_rel_dyn_section): New function.  Borrow code from...
4169         (_bfd_mips_elf_check_relocs): Pass input_bfd to functions that
4170         now take it.  Create the got section if needed, even if
4171         excluded, before recording a global got symbol.  Move some
4172         code to...
4173         (mips_elf_record_local_got_symbol): New fn.
4174         (_bfd_mips_elf_size_dynamic_sections): Disable combreloc.
4175         Compute multi-got global entries offsets.  Move GOT code to...
4176         (_bfd_mips_elf_always_size_sections): Call mips_elf_multi_got
4177         if the GOT is too big.
4178         (_bfd_mips_elf_finish_dynamic_symbol): Set got entry of
4179         undefweak symbol to zero.  Generate dynamic relocations for
4180         non-primary GOT entries for global symbols.
4181         (_bfd_mips_elf_finish_dynamic_sections): Handle multi-got
4182         case.  Generate dynamic relocations for local got entries.
4183         Sort dynamic relocations on N64 too, using...
4184         (sort_dynamic_relocs_64): New fns.
4185         (_bfd_mips_elf_hide_symbol): Adjust multi-got counters.
4186         (_bfd_mips_elf_merge_private_bfd_data): Ignore EF_MIPS_XGOT.
4187
4188 2003-01-27  Alexandre Oliva  <aoliva@redhat.com>
4189
4190         * bfd.c (struct _bfd): Added id field.
4191         * opncls.c (_bfd_id_counter): New static variable.
4192         (_bfd_new_bfd): Use it.
4193         * bfd-in2.h: Rebuilt.
4194
4195 2003-01-25  Alan Modra  <amodra@bigpond.net.au>
4196
4197         * elf32-sparc.c (bfd_elf32_new_section_hook): Define.
4198
4199 2003-01-25  Jakub Jelinek  <jakub@redhat.com>
4200
4201         * elf32-sparc.c (_bfd_sparc_elf_howto_table): Add TLS relocs.
4202         (elf32_sparc_rev32_howto): New variable.
4203         (sparc_reloc_map): Add TLS relocs.
4204         (elf32_sparc_reloc_type_lookup, elf32_sparc_info_to_howto):
4205         Handle REV32.
4206         (sparc_elf_hix22_reloc, sparc_elf_lox10_reloc, elf32_sparc_mkobject):
4207         New functions.
4208         (struct elf32_sparc_dyn_relocs, struct elf32_sparc_link_hash_entry,
4209         struct elf32_sparc_link_hash_table):
4210         New structures.
4211         (elf32_sparc_tdata, elf32_sparc_local_got_tls_type,
4212         elf32_sparc_hash_table): Define.
4213         (link_hash_newfunc, elf32_sparc_link_hash_table_create,
4214         create_got_section, elf32_sparc_create_dynamic_sections,
4215         elf32_sparc_copy_indirect_symbol, elf32_sparc_tls_transition): New
4216         functions.
4217         (elf32_sparc_check_relocs): Handle TLS relocs.  Add dynamic reloc
4218         reference counting.
4219         (elf32_sparc_gc_sweep_hook): Likewise.
4220         (elf32_sparc_adjust_dynamic_symbol): Likewise.
4221         (elf32_sparc_size_dynamic_sections): Likewise.
4222         (elf32_sparc_relocate_section): Likewise.
4223         (allocate_dynrelocs, readonly_dynrelocs, dtpoff_base, tpoff):
4224         New functions.
4225         (elf32_sparc_object_p): Allocate backend private object data.
4226         (bfd_elf32_bfd_link_hash_table_create,
4227         elf_backend_copy_indirect_symbol, bfd_elf32_mkobject,
4228         elf_backend_can_refcount): Define.
4229         (elf_backend_create_dynamic_sections): Define to
4230         elf32_sparc_create_dynamic_sections.
4231         * reloc.c: Add SPARC TLS relocs.
4232         * bfd-in2.h, libbfd.h: Rebuilt.
4233         * elf64-sparc.c (sparc64_elf_howto_table): Add TLS relocs.
4234         (sparc_reloc_map): Likewise.
4235
4236 2003-01-24  Martin Schwidefsky  <schwidefsky@de.ibm.com>
4237
4238         * bfd-in2.h: Regenerate.
4239         * elf32-s390.c (elf_s390_mkobject, elf_s390_tls_transition,
4240         s390_tls_reloc, dtpoff_base, tpoff, invalid_tls_insn): New functions.
4241         (elf_howto_table): Add TLS relocs.
4242         (elf_s390_reloc_type_lookup): Likewise.
4243         (elf_s390_link_hash_entry): Add tls_type.
4244         (elf_s390_hash_entry, elf_s390_obj_tdata, elf_s390_local_got_tls_type):
4245         New macros.
4246         (elf_s390_link_hash_table): Add tls_ldm_got.
4247         (link_hash_newfunc): Initialize tls_type.
4248         (elf_s390_link_hash_table_create): Initialize refcount of tls_ldm_got.
4249         (elf_s390_copy_indirect_symbol): Copy tls_type information.
4250         (elf_s390_check_relocs): Support TLS relocs.
4251         (elf_s390_gc_sweep_hook): Likewise.
4252         (allocate_dynrelocs): Likewise.
4253         (elf_s390_size_dynamic_sections): Likewise.
4254         (elf_s390_relocate_section): Likewise.
4255         (elf_s390_finish_dynamic_symbol): Likewise.
4256         (bfd_elf32_mkobject): Define for TLS.
4257         * elf64-s390.c: Same changes as for elf32-s390.c.
4258         * libbfd.h: Regenerate.
4259         * reloc.c: Add s390 TLS relocations.
4260
4261 2003-01-24  Charles Lepple  <clepple@ghz.cc>
4262
4263         * aclocal.m4: Fix name of --enable-install-libbfd switch.
4264
4265 2003-01-23  Nick Clifton  <nickc@redhat.com>
4266
4267         * Add sh2e support:
4268         2002-04-02  Elena Zannoni  <ezannoni@redhat.com>
4269         * archures.c (bfd_mach_sh2e): Added.
4270         * bfd-in2.h: Rebuilt.
4271         * cpu-sh.c (arch_info_struct): Added SH2e.
4272         * elf32-sh.c (sh_elf_set_mach_from_flags): Handle EF_SH2E.
4273
4274 2003-01-23  Alan Modra  <amodra@bigpond.net.au>
4275
4276         * elf-bfd.h (struct bfd_elf_section_data): Remove tdata.  Change
4277         dynindx to an int.  Rearrange for better packing.
4278         * elf.c (_bfd_elf_new_section_hook): Don't alloc if already done.
4279         * elf32-mips.c (bfd_elf32_new_section_hook): Define.
4280         * elf32-sh64.h: New.  Split out from include/elf/sh.h.
4281         (struct _sh64_elf_section_data): New struct.
4282         (sh64_elf_section_data): Don't dereference sh64_info (was tdata).
4283         * elf32-sh64-com.c: Include elf32-sh64.h.
4284         * elf32-sh64.c: Likewise.
4285         (sh64_elf_new_section_hook): New function.
4286         (bfd_elf32_new_section_hook): Define.
4287         (sh64_elf_fake_sections): Adjust for sh64_elf_section_data change.
4288         (sh64_bfd_elf_copy_private_section_data): Likewise.
4289         (sh64_elf_final_write_processing): Likewise.
4290         * elf32-sparc.c (struct elf32_sparc_section_data): New.
4291         (elf32_sparc_new_section_hook): New function.
4292         (SET_SEC_DO_RELAX, SEC_DO_RELAX): Delete.
4293         (sec_do_relax): Define.
4294         (elf32_sparc_relax_section): Adjust to use sec_do_relax.
4295         (elf32_sparc_relocate_section): Likewise.
4296         * elf64-mips.c (bfd_elf64_new_section_hook): Define.
4297         * elf64-mmix.c (struct _mmix_elf_section_data): New.
4298         (mmix_elf_section_data): Define.  Use throughout file.
4299         (mmix_elf_new_section_hook): New function.
4300         (bfd_elf64_new_section_hook): Define.
4301         * elf64-ppc.c (struct _ppc64_elf_section_data): New.
4302         (ppc64_elf_section_data): Define.  Use throughout.
4303         (ppc64_elf_new_section_hook): New function.
4304         (bfd_elf64_new_section_hook): Define.
4305         * elf64-sparc.c (struct sparc64_elf_section_data): New.
4306         (sparc64_elf_new_section_hook): New function.
4307         (SET_SEC_DO_RELAX, SEC_DO_RELAX): Delete.
4308         (sec_do_relax): Define.
4309         (sparc64_elf_relax_section): Adjust to use sec_do_relax.
4310         (sparc64_elf_relocate_section): Likewise.
4311         (bfd_elf64_new_section_hook): Define.
4312         * elfn32-mips.c (bfd_elf32_new_section_hook): Define.
4313         * elfxx-mips.c (struct _mips_elf_section_data): New.
4314         (mips_elf_section_data): Define.  Use throughout.
4315         (_bfd_mips_elf_new_section_hook): New function.
4316         (mips_elf_create_got_section): Don't alloc used_by_bfd.
4317         * elfxx-mips.h (_bfd_mips_elf_new_section_hook): Declare.
4318         * elfxx-target.h (bfd_elfNN_new_section_hook): Add #ifndef.
4319         * Makefile.am: Run "make dep-am".
4320         * Makefile.in: Regenerate.
4321
4322 2003-01-21  Richard Henderson  <rth@redhat.com>
4323
4324         * elf64-alpha.c (ALPHA_ELF_LINK_HASH_PLT_LOC): New.
4325         (struct alpha_elf_link_hash_entry): Add plt_old_section, plt_old_value.
4326         (elf64_alpha_adjust_dynamic_symbol): Set them.
4327         (elf64_alpha_size_plt_section_1): Reset them when plt entry removed.
4328         (elf64_alpha_relax_tls_get_addr): Handle LDM relocs.  Frob the
4329         symbol index when relaxing LDM to TPREL.
4330         (elf64_alpha_relax_section): Likewise.  Allow relaxation of GD
4331         relocs, even if the target isn't locally defined.
4332         (elf64_alpha_check_relocs): Frob LDM reloc symndx to zero.
4333         (elf64_alpha_relocate_section): Likewise.  Force TP-relative
4334         relocs vs symndx 0 to the tp base.
4335
4336 2003-01-21  Fabio Alemagna  <falemagn@aros.org>
4337
4338         * config.bfd: Handle i[3456]86-*-aros*.
4339
4340 2003-01-21  Andreas Schwab  <schwab@suse.de>
4341
4342         * elf32-ppc.c (struct ppc_elf_dyn_relocs): Define.
4343         (struct ppc_elf_link_hash_entry): Define.
4344         (ppc_elf_hash_entry): New function.
4345         (struct ppc_elf_link_hash_table): Define.
4346         (ppc_elf_hash_table): New function.
4347         (ppc_elf_link_hash_newfunc): New function.
4348         (ppc_elf_link_hash_table_create): New function.
4349         (ppc_elf_copy_indirect_symbol): New function.
4350         (allocate_dynrelocs): New function.
4351         (readonly_dynrelocs): New function.
4352         (ppc_elf_size_dynamic_sections): Allocate space for dynamic
4353         relocs and determine DT_TEXTREL.
4354         (ppc_elf_check_relocs): Don't do that here, just count the
4355         dynamic relocs.
4356         (ppc_elf_gc_sweep_hook): Discard any dynamic relocs against the
4357         removed section.
4358         (bfd_elf32_bfd_link_hash_table_create): Define.
4359         (elf_backend_copy_indirect_symbol): Define.
4360
4361 2003-01-21  Richard Henderson  <rth@redhat.com>
4362
4363         * elf64-alpha.c (alpha_dynamic_entries_for_reloc): GOTTPREL and
4364         TPREL also get a reloc if shared.  Remove SREL support.
4365         (elf64_alpha_emit_dynrel): New.
4366         (elf64_alpha_relocate_section): Use it.  Resolve dynamic TPREL
4367         and GOTTPREL relocs to local symbols against the tp base.
4368         (elf64_alpha_finish_dynamic_symbol): Use elf64_alpha_emit_dynrel.
4369
4370         * elf64-alpha.c (elf64_alpha_relax_got_load): Decrement got
4371         use count before clobbering r_type.
4372         (elf64_alpha_relax_tls_get_addr): Don't use pos[1] if insn
4373         ordering would mean dataflow inspection is necessary.
4374
4375 2003-01-20  Svein E. Seldal  <Svein.Seldal@solidas.com>
4376
4377         * coffcode.h (coff_set_flags): Added get/set arch hooks.
4378
4379 2003-01-20  Fabio Alemagna  <falemagn@aros.org>
4380
4381         * elf32-sh.c: Treat elfNN_bed like other macros defined in
4382           elfxx-target.h and #undef it before #define'ing it.
4383         * elf32-i386.c: Likewise.
4384         * elf32-sh64.c: Likewise.
4385         * elf64-alpha.c: Likewise.
4386         * elf64-sh64.c: Likewise.
4387
4388 2003-01-20  Martin Schwidefsky  <schwidefsky@de.ibm.com>
4389
4390         * bfd-in2.h: Regenerate.
4391         * elf32-s390.c (elf_s390_adjust_gotplt): New prototype.
4392         (elf_howto_table): Rename R_390_GOTOFF to R_390_GOTOFF32. Add
4393         R_390_GOTOFF16, R_390_GOTOFF64, R_390_GOTPLT12, R_390_GOTPLT16,
4394         R_390_GOTPLT32, R_390_GOTPLT64, R_390_GOTPLTENT, R_390_PLTOFF16,
4395         R_390_PLTOFF32 and R_390_PLTOFF64.
4396         (elf_s390_reloc_type_lookup): Likewise.
4397         (struct elf_s390_link_hash_entry): Add gotplt_refcount to keep track
4398         of GOTPLT references to a function.
4399         (link_hash_newfunc): Initialize gotplt_refcount.
4400         (elf_s390_check_relocs): Move allocation of local_got_refcounts array
4401         and creation of the got section out of the main switch. Add support
4402         for the gotoff, gotplt and pltoff relocations.
4403         (elf_s390_gc_sweep_hook): Add reference counting for gotoff, gotplt
4404         and pltoff.
4405         (elf_s390_adjust_gotplt): New function.
4406         (elf_s390_adjust_dynamic_symbol): Adjust gotplt refcount for removed
4407         plt entries.
4408         (allocate_dynrelocs): Add comment.
4409         (elf_s390_relocate_section): Change r_type to unsigned. Add support
4410         for gotoff, gotplt and pltoff relocations.
4411         * elf64-s390.c: Same changes as for elf32-s390.c.
4412         * libbfd.h: Regenerate.
4413         * reloc.c: Add BFD_RELOC_390_GOTOFF64, BFD_RELOC_390_GOTPLT12,
4414         BFD_RELOC_390_GOTPLT16, BFD_RELOC_390_GOTPLT32, BFD_RELOC_390_GOTPLT64,
4415         BFD_RELOC_390_GOTPLTENT, BFD_RELOC_390_PLTOFF16, BFD_RELOC_390_PLTOFF32
4416         and BFD_RELOC_390_PLTOFF64.
4417
4418 2003-01-18  Jakub Jelinek  <jakub@redhat.com>
4419
4420         * elfxx-ia64.c (elfNN_ia64_relocate_section): Handle
4421         R_IA64_TPREL64[LM]SB against non-global symbol properly.
4422
4423 2003-01-16  Jakub Jelinek  <jakub@redhat.com>
4424
4425         * elfxx-ia64.c (struct elfNN_ia64_link_hash_table): Add
4426         self_dtpmod_done and self_dtpmod_offset.
4427         (allocate_global_data_got): Only use one got entry for all
4428         dtpmod relocs against local symbols.
4429         (allocate_dynrel_entries): Only need .rela.got entry for
4430         dtpmod against global symbol.
4431         (elfNN_ia64_size_dynamic_sections): Initialize self_dtpmod_offset.
4432         Reserve space in .rela.got for the local dtpmod entry.
4433         (set_got_entry): Initialize the common local dtpmod .got entry.
4434         (elfNN_ia64_relocate_section): Handle R_IA_64_DTPREL64LSB
4435         and R_IA_64_DTPREL64MSB.
4436
4437 2003-01-16  Alan Modra  <amodra@bigpond.net.au>
4438
4439         * elf64-ppc.c: Include elf/ppc64.h rather than elf/ppc.h.
4440         (R_PPC_*): Rename all occurrences to R_PPC64_*.
4441         (R_PPC64_ADDR30): Rename all occurrences to R_PPC64_REL30.
4442         (enum elf_ppc_reloc_type): Ditto to enum elf_ppc64_reloc_type.
4443         (ppc64_elf_gc_sweep_hook): Handle R_PPC64_REL30 along with other
4444         relative relocs, not with absolute ones.
4445         * Makefile.am: Run "make dep-am".
4446         * Makefile.in: Regenerate.
4447         * po/SRC-POTFILES.in: Regenerate.
4448
4449 2003-01-15  Andreas Schwab  <schwab@suse.de>
4450
4451         * elf32-ppc.c (ppc_elf_check_relocs): Don't set DF_TEXTREL for a
4452         relocation against a non-allocated readonly section.
4453
4454 2003-01-10  Alan Modra  <amodra@bigpond.net.au>
4455
4456         * elf32-ppc.c (ppc_elf_relocate_section): Adjust addend for GOT16_HA.
4457         * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.  PLTGOT16_HA too.
4458
4459 2002-01-08  Klee Dienes  <kdienes@apple.com>
4460
4461         * Makefile.am (ALL_MACHINES): Use cpu-msp430.lo, not cpu-msp430.c.
4462         (BFD32_BACKENDS): Use elf32-msp430.lo, not elf32-msp430.c.
4463         * Makefile.in: Regenerate.
4464
4465 2003-01-08  Alexandre Oliva  <aoliva@redhat.com>
4466
4467         * elfn32-mips.c (prev_reloc_section): New.
4468         (GET_RELOC_ADDEND): Use it.  Parenthesize macro arguments.
4469         (SET_RELOC_ADDEND): Parenthesize macro argument.
4470
4471 2003-01-07  John David Anglin  <dave.anglin@nrc.gc.ca>
4472
4473         * elf32-hppa.c (final_link_relocate): For all DP relative relocations,
4474         adjust addil instructions if the symbol has no section.
4475
4476 2003-01-07  DJ Delorie  <dj@redhat.com>
4477
4478         * elf32-xstormy16.c (xstormy16_elf_howto_table): Make REL_12 not
4479         partial_inplace.
4480
4481 2003-01-07  Andreas Schwab  <schwab@suse.de>
4482
4483         * elf32-m68k.c (elf_m68k_check_relocs): Don't set DF_TEXTREL for
4484         PC relative relocations.
4485         (elf_m68k_discard_copies): Set it here instead.
4486
4487 2002-01-02  Ben Elliston  <bje@redhat.com>
4488             Jeff Johnston  <jjohnstn@redhat.com>
4489
4490         * Makefile.am (ALL_MACHINES): Add cpu-iq2000.lo.
4491         (ALL_MACHINES_CFILES): Add cpu-iq2000.c.
4492         (BFD32_BACKENDS): Add elf32-iq2000.lo.
4493         (BFD32_BACKENDS_CFILES): Add elf32-iq2000.c.
4494         (cpu-iq2000.lo): New target.
4495         * Makefile.in: Regenerate.
4496         * config.bfd: Handle iq2000-*-elf.
4497         * archures.c (bfd_architecture): Add bfd_{arch,mach}_iq2000.
4498         (bfd_archures_list): Add bfd_iq2000_arch.
4499         * configure.in: Handle bfd_elf32_iq2000_vec.
4500         * configure: Regenerate.
4501         * reloc.c: Add BFD_RELOC_IQ2000_OFFSET_16, BFD_RELOC_IQ2000_OFFSET_21,
4502         and BFD_RELOC_IQ2000_UHI16.
4503         * targets.c (bfd_elf32_iq2000_vec): Declare.
4504         (bfd_target_vector): Add bfd_elf32_iq2000_vec.
4505         * elf.c (prep_headers): Set e_machine to EM_IQ2000.
4506         * cpu-iq2000.c: New file.
4507         * elf32-iq2000.c: Likewise.
4508         * libbfd.h: Regenerate.
4509         * bfd-in2.h: Likewise.
4510
4511 2003-01-02  Richard Sandiford  <rsandifo@redhat.com>
4512
4513         * elfxx-mips.c: Include libiberty.h.
4514         (elf_mips_isa, _bfd_mips_elf_mach_extends_p): Remove.
4515         (mips_set_isa_flags): New function, split out from...
4516         (_bfd_mips_elf_final_write_processing): ...here.  Only call
4517         mips_set_isa_flags if the EF_MIPS_MACH bits are clear.
4518         (mips_mach_extensions): New array.
4519         (mips_32bit_flags_p): New function.
4520         (_bfd_mips_elf_merge_private_bfd_data): Rework architecture checks.
4521         Use mips_32bit_flags_p to check if one binary is 32-bit and the
4522         other is 64-bit.  When adopting IBFD's architecture, adopt the
4523         bfd_mach as well as the flags.
4524
4525 2003-01-02  Nick Kelsey  <nickk@ubicom.com>
4526
4527         * elf32-ip2k.c: Re-work of linker relaxation code for the ip2k to
4528         fix internal errors, fix bad code generation, fix incorrect stabs
4529         information, and improve ability to eliminate redundant page
4530         instructions. Added code to ip2k_final_link_relocate to self-verify
4531         the linker relaxation.  Fix formatting problems.
4532
4533 2002-12-30  Chris Demetriou  <cgd@broadcom.com>
4534
4535         * aoutx.h (NAME(aout,machine_type)): Add bfd_mach_mipsisa32r2 case.
4536         * archures.c (bfd_mach_mipsisa32r2): New define.
4537         * bfd-in2.h: Regenerate.
4538         * cpu-mips.c (I_mipsisa32r2): New enum value.
4539         (arch_info_struct): Add entry for I_mipsisa32r2.
4540         * elfxx-mips.c (elf_mips_isa, _bfd_elf_mips_mach)
4541         (_bfd_mips_elf_print_private_bfd_data): Handle E_MIPS_ARCH_32R2.
4542         (_bfd_mips_elf_final_write_processing): Add
4543         bfd_mach_mipsisa32r2 case.
4544         (_bfd_mips_elf_merge_private_bfd_data): Handle merging of
4545         binaries marked as using MIPS32 Release 2.
4546
4547 2002-12-30    Dmitry Diky <diwil@mail.ru>
4548
4549         * Makefile.am: Add msp430 target.
4550         * configure.in: Likewise.
4551         * Makefile.in: Regenerate.
4552         * configure: Regenerate.
4553         * archures.c: Add msp430 architecture vector.
4554         * config.bfd: Likewise.
4555         * reloc.c: Add msp430 relocs.
4556         * targets.c: Add msp320 target.
4557         * cpu-msp430.c: New file: msp430 cpu detection.
4558         * elf32-msp430.c: New file: msp430 reloc processing.
4559         * bfd-in2.h: Regenerate.
4560         * libbfd.h: Regenerate.
4561
4562 2002-12-28  Jakub Jelinek  <jakub@redhat.com>
4563
4564         * elf.c (elf_sort_sections): Don't reorder .tbss.
4565         (assign_file_positions_for_segments): Only adjust off/voff
4566         for increased alignment in PT_LOAD or PT_NOTE segment,
4567         but adjust p_filesz for .tbss too.  in PT_LOAD consider
4568         .tbss to have zero memory size.
4569         (copy_private_bfd_data) [SECTION_SIZE]: Define.
4570         [IS_CONTAINED_BY_VMA, IS_CONTAINED_BY_LMA]: Use it.
4571         [INCLUDE_SECTION_IN_SEGMENT]: Only put SHF_TLS sections
4572         into PT_TLS segment.  Never put SHF_TLS sections in
4573         segments other than PT_TLS or PT_LOAD.
4574
4575         * elf64-alpha.c (elf64_alpha_finish_dynamic_sections): Clear .plt
4576         sh_entsize.
4577
4578 2002-12-23  DJ Delorie  <dj@redhat.com>
4579
4580         * coff64-rs6000.c (xcoff64_ppc_relocate_section): Fix logic reversal.
4581
4582 2002-12-23  Alan Modra  <amodra@bigpond.net.au>
4583
4584         * elflink.h (elf_link_output_extsym): Heed strip_discarded.
4585
4586 2002-12-23  Nick Clifton  <nickc@redhat.com>
4587
4588         * archures.c (bfd_arch_get_compatible): Add third parameter
4589         'accept_unknowns'.  Only accept unknown format BFDs if
4590         accept_unknowns is true, or if the format is "binary".
4591         * bfd-in2.h: Regenerate.
4592
4593 2002-12-21  Nick Clifton  <nickc@redhat.com>
4594
4595         * coff-arm.c (coff_arm_relocate_section): Disable WINCE workaround
4596         that subtracted 8 from pc relative relocations.
4597
4598 2002-12-20  Kazu Hirata  <kazu@cs.umass.edu>
4599
4600         * coff-h8300.c: Fix comment typos.
4601         * coffcode.h: Likewise.
4602         * cpu-cris.c: Likewise.
4603         * elf32-vax.c: Likewise.
4604         * genlink.h: Likewise.
4605         * linker.c: Likewise.
4606         * som.c: Likewise.
4607         * tekhex.c: Likewise.
4608         * vms-misc.c: Likewise.
4609
4610 2002-12-20  DJ Delorie  <dj@redhat.com>
4611
4612         * reloc.c: Add BFD_RELOC_XSTORMY16_12.
4613         * libbfd.h: Regenerate.
4614         * bfd-in2.h: Regenerate.
4615         * elf32-xstormy16.c (xstormy16_elf_howto): Add R_XSTORMY16_12.
4616         (xstormy16_reloc_map): Add R_XSTORMY16_12.
4617
4618 2002-12-19  Kazu Hirata  <kazu@cs.umass.edu>
4619
4620         * doc/bfdint.texi: Fix typos.
4621
4622 2002-12-20  Paul Eggert  <eggert@twinsun.com>
4623
4624         Port to POSIX 1003.1-2001.
4625         * acinclude.m4 (AM_INSTALL_LIBBFD): Do not rely on "test -o".
4626         * configure.in (build-warnings): Likewise.
4627         (Horrible hacks to build DLLs on Windows): Do not rely on "tail -1".
4628         * aclocal.m4: Regenerate.
4629         * config.in: Regenerate.
4630         * configure: Regenerate.
4631
4632 2002-12-19  Alan Modra  <amodra@bigpond.net.au>
4633
4634         * coff-h8300.c: Include libiberty.h.
4635         (h8300_reloc16_extra_cases): Check the hash table creator before
4636         referencing h8300 specific fields.  Stash the hash table pointer
4637         in a local var.  Comment typo fixes.
4638         (h8300_bfd_link_add_symbols): Likewise.
4639
4640         * reloc.c (struct reloc_howto_struct): Revise src_mask and
4641         dst_mask comments.
4642         * bfd-in2.h: Regenerate.
4643
4644 2002-12-18  Alan Modra  <amodra@bigpond.net.au>
4645
4646         * elf32-ppc.c (ppc_elf_relocate_section): Reorganize dynamic reloc
4647         code a little.  Comment on dynamic relocs against section symbols.
4648
4649 2002-12-17  Roger Sayle  <roger@eyesopen.com>
4650
4651         * configure.host (ia64-*-hpux*): Support 64 bit targets using
4652         the HP compiler's "long long".
4653
4654 2002-12-16  Andrew MacLeod  <amacleod@redhat.com>
4655
4656         * elf32-xstormy16.c (xstormy16_elf_howto): Add R_XSTORMY16_LO16
4657         and R_XSTORMY16_HI16) howto entries.
4658         (xstormy16_reloc_map): Map R_XSTORMY16_{LO,HI}16 to BFD_RELOC_{LO,HI}16.
4659         (xstormy16_info_to_howto_rela): Use R_XSTORMY16_GNU_VTINHERIT to
4660         determine the start of the second reloc table.
4661
4662 2002-12-16  Nathan Tallent  <eraxxon@alumni.rice.edu>
4663
4664         * ecofflink.c: Fix the reading of the debugging information
4665         of Tru64/Alpha binaries that are produced by recent Compaq
4666         compilers.
4667         (mk_fdrtab): Fix error in creating the FDR (file descriptor)
4668         table.
4669         (lookup_line): Because of the strange information sometimes
4670         generated by Compaq's recent compilers, change how the FDR
4671         table is searched so that PDRs (procedure descriptors) are
4672         correctly found.  Note that this change is really more of a hack;
4673         however, I have included extensive documentation as to why
4674         this is the best solution short of an extensive rewrite or
4675         another hack.
4676         (fdrtab_lookup): Add comments to explain the algorithm.
4677
4678 2002-12-12  Alexandre Oliva  <aoliva@redhat.com>
4679
4680         * elf-m10300.c (elf32_mn10300_link_hash_newfunc): Reorder
4681         initializers to match struct declaration.
4682
4683 2002-12-12  Alan Modra  <amodra@bigpond.net.au>
4684
4685         * dwarf2.c (comp_unit_contains_address): Comment typo fix.
4686         * elf.c (get_program_header_size): Likewise.
4687         * elf32-m32r.c (m32r_elf_lo16_reloc): Likewise.
4688         (m32r_elf_generic_reloc): Likewise.
4689         * elf32-ppc.c (ppc_elf_howto_init): Likewise.
4690         * elflink.h (elf_bfd_discard_info): Likewise.
4691
4692 2002-12-12  Alan Modra  <amodra@bigpond.net.au>
4693
4694         * elf32-i386.c (elf_i386_finish_dynamic_sections): Add output_offset
4695         to DT_JMPREL.  Use srelplt input section size for DT_PLTRELSZ and
4696         DT_RELSZ adjustment, not output section.  Avoid writing tags when
4697         unchanged.  Don't assume linker script is sane, adjust DT_REL too.
4698         * elf32-hppa.c (elf32_hppa_finish_dynamic_sections): Just use raw
4699         size of srelplt for DT_PLTRELSZ.  Use srelplt input section size for
4700         DT_RELASZ adjustment, not output section.  Avoid writing tags when
4701         unchanged.  Adjust DT_RELA.
4702         * elf64-ppc.c (ppc64_elf_finish_dynamic_sections): Tweaks for better
4703         formatting.  Avoid writing tags when unchanged.  Adjust DT_RELA.
4704
4705 2002-12-12  Alexandre Oliva  <aoliva@redhat.com>
4706
4707         * elfxx-mips.c (mips_elf_calculate_relocation): Don't divide
4708         addend by 4.
4709
4710 2002-12-12  Alexandre Oliva  <aoliva@redhat.com>
4711
4712         * elfxx-mips.c (struct mips_got_entry): New.
4713         (struct mips_got_info): Added got_entries field.
4714         (mips_elf_got_entry_hash, mips_elf_got_entry_eq): New functions.
4715         (mips_elf_local_got_index, mips_elf_got_page,
4716         mips_elf_got16_entry): Re-implement in terms of new...
4717         (mips_elf_create_local_got_entry): Rewrite to use got_entries.
4718         Change return type.
4719         (mips_elf_highest): Warning clean-up.
4720         (mips_elf_create_got_section): Initialize got_entries.
4721         (_bfd_mips_elf_check_relocs): Use got_entries to estimate
4722         local got size.
4723         (_bfd_mips_elf_size_dynamic_sections): Do not account for
4724         GOT_PAGE entries, since we now reuse GOT16 entries.
4725
4726 2002-12-10  Jason Thorpe  <thorpej@wasabisystems.com>
4727
4728         * aoutx.h (set_section_contents): Allow an otherwise unrepresentable
4729         read-only section that lies after .text and before .data to be
4730         written into the output file and included in a_text.
4731         (translate_to_native_sym_flags): If an otherwise unrepresentable
4732         section was merged with .text, convert its symbols to N_TEXT
4733         symbols.
4734         * libaout.h (aout_section_merge_with_text_p): New macro.
4735
4736 2002-12-08  Alan Modra  <amodra@bigpond.net.au>
4737
4738         * bfd-in.h: Comment typo fix.  Formatting.
4739         * bfd-in2.h: Regenerate.
4740         * coff64-rs6000.c (xcoff64_openr_next_archived_file): Warning fix.
4741         * elf32-m68hc12.c (m68hc12_elf_set_mach_from_flags): Prototype.
4742         * elf64-mmix.c (mmix_dump_bpo_gregs): Warning fix.
4743
4744 2002-12-05  Richard Henderson  <rth@redhat.com>
4745
4746         * elfxx-ia64.c (elfNN_ia64_relax_section): Handle PCREL21BI.
4747         Only send PCREL21B though the plt.  Fix installed reloc type.
4748         (elfNN_ia64_relocate_section): Give error for dynamic reloc
4749         against PCREL22 or PCREL64I; clean up error messages for
4750         branch relocs.
4751
4752 2002-12-04  Kevin Buettner  <kevinb@redhat.com>
4753
4754         * elf64-mips.c (elf64_mips_grok_prstatus, elf64_mips_grok_psinfo):
4755         New functions.
4756         (elf_backend_grok_prstatus, elf_backend_grok_psinfo): Define.
4757
4758 2002-12-04  David Mosberger  <davidm@hpl.hp.com>
4759
4760         * cpu-ia64-opc.c: Add operand constant "ar.csd".
4761
4762 2002-12-04  H.J. Lu <hjl@gnu.org>
4763
4764         * elfxx-ia64.c (get_local_sym_hash): Use section ID instead of
4765         BFD address when constructing local name.
4766
4767 2002-12-04  Andreas Schwab  <schwab@suse.de>
4768
4769         * elf32-m68k.c (struct elf_m68k_link_hash_table): Add sym_sec
4770         member.
4771         (elf_m68k_link_hash_table_create): Initialize it.
4772         (elf_m68k_check_relocs): Handle symbols that are forced to be
4773         local due to visibility changes.
4774         (elf_m68k_adjust_dynamic_symbol): Likewise.
4775         (elf_m68k_size_dynamic_sections): Likewise.
4776         (elf_m68k_discard_copies): Likewise.
4777         (elf_m68k_relocate_section): Likewise.
4778
4779 2002-12-04  Alan Modra  <amodra@bigpond.net.au>
4780
4781         * elf64-ppc.c (ppc64_elf_edit_opd): Correct typo.
4782
4783 2002-12-04  Alan Modra  <amodra@bigpond.net.au>
4784
4785         * srec.c (srec_write_symbols): Restore '$' prefix to address
4786         accidentally removed in 2002-04-04 change.
4787         (srec_get_symtab): Use 0 instead of `(long) FALSE'.
4788
4789 2002-12-03  Nick Clifton  <nickc@redhat.com>
4790
4791         * elf32-ppc.c (apuinfo_list_init): New function.
4792         (apuinfo_list_add): New function: Add a value to the list.
4793         (apuinfo_list_length): New function: Return the number of
4794         values on the list.
4795         (apuinfo_list_element): New function: Return a value on the
4796         list.
4797         (apuinfo_list_finish): New function: Free the resources used
4798         by the list.
4799         (ppc_elf_begin_write_processing): New function.  Scan the
4800         input bfds for apuinfo sections.
4801         (ppc_elf_write_section): New function: Delay the creation of
4802         the contents of an apuinfo section in an output bfd.
4803         (ppc_elf_final_write_processing): New function.  Create the
4804         contents of an apuinfo section in an output bfd.
4805         (elf_backend_begin_write_processing): Define.
4806         (elf_backend_final_write_processing): Define.
4807         (elf_backend_write_section): Define.
4808
4809 2002-12-03  Richard Henderson  <rth@redhat.com>
4810
4811         * cpu-ia64-opc.c (elf64_ia64_operands): Add ldxmov entry.
4812
4813 2002-12-01  Stephane Carrez  <stcarrez@nerim.fr>
4814
4815         Fix PR savannah/1417:
4816         * elf32-m68hc11.c (m68hc11_elf_relax_delete_bytes): Don't adjust
4817         branch if it goes to the start of the deleted region.
4818
4819 2002-12-01  Stephane Carrez  <stcarrez@nerim.fr>
4820
4821         * bfd-in2.h (bfd_mach_m6812): Rebuild.
4822         * archures.c (bfd_mach_m6812_default, bfd_mach_m6812,
4823         bfd_mach_m6812s): Declare.
4824
4825         * elf32-m68hc12.c (m68hc12_elf_set_mach_from_flags): New function.
4826         (_bfd_m68hc12_elf_set_private_flags): Call it.
4827         (_bfd_m68hc12_elf_print_private_bfd_data): Report processor version.
4828         (_bfd_m68hc12_elf_merge_private_bfd_data): Merge the flags and
4829         report microcontroller incompatibilities (HC12 vs HCS12).
4830         (elf_backend_object_p): Update.
4831
4832 2002-11-30  Alan Modra  <amodra@bigpond.net.au>
4833
4834         * bfd-in.h (TRUE_FALSE_ALREADY_DEFINED, BFD_TRUE_FALSE): Delete.
4835         (enum bfd_boolean, boolean): Delete.
4836         (bfd_boolean): Typedef to an int.
4837         (FALSE, TRUE): Define.
4838         * aix386-core.c, aix5ppc-core.c, aout-adobe.c, aout-arm.c, aout-cris.c,
4839         aout-encap.c, aout-ns32k.c, aout-target.h, aout-tic30.c, aoutf1.h,
4840         aoutx.h, archive.c, archive64.c, archures.c, bfd-in.h, bfd.c, bfdwin.c,
4841         binary.c, bout.c, cache.c, cisco-core.c, coff-a29k.c, coff-alpha.c,
4842         coff-apollo.c, coff-arm.c, coff-aux.c, coff-h8300.c, coff-h8500.c,
4843         coff-i386.c, coff-i860.c, coff-i960.c, coff-ia64.c, coff-m68k.c,
4844         coff-m88k.c, coff-mcore.c, coff-mips.c, coff-or32.c, coff-ppc.c,
4845         coff-rs6000.c, coff-sh.c, coff-sparc.c, coff-stgo32.c, coff-tic30.c,
4846         coff-tic4x.c, coff-tic54x.c, coff-tic80.c, coff-w65.c, coff-we32k.c,
4847         coff-z8k.c, coff64-rs6000.c, coffcode.h, coffgen.c, cofflink.c,
4848         corefile.c, cpu-a29k.c, cpu-alpha.c, cpu-arc.c, cpu-arm.c, cpu-avr.c,
4849         cpu-cris.c, cpu-d10v.c, cpu-d30v.c, cpu-dlx.c, cpu-fr30.c, cpu-frv.c,
4850         cpu-h8300.c, cpu-h8500.c, cpu-hppa.c, cpu-i370.c, cpu-i386.c,
4851         cpu-i860.c, cpu-i960.c, cpu-ia64.c, cpu-ip2k.c, cpu-m10200.c,
4852         cpu-m10300.c, cpu-m32r.c, cpu-m68hc11.c, cpu-m68hc12.c, cpu-m68k.c,
4853         cpu-m88k.c, cpu-mcore.c, cpu-mips.c, cpu-mmix.c, cpu-ns32k.c,
4854         cpu-openrisc.c, cpu-or32.c, cpu-pdp11.c, cpu-pj.c, cpu-powerpc.c,
4855         cpu-rs6000.c, cpu-s390.c, cpu-sh.c, cpu-sparc.c, cpu-tic30.c,
4856         cpu-tic4x.c, cpu-tic54x.c, cpu-tic80.c, cpu-v850.c, cpu-vax.c,
4857         cpu-w65.c, cpu-we32k.c, cpu-xstormy16.c, cpu-z8k.c, dwarf1.c,
4858         dwarf2.c, ecoff.c, ecofflink.c, efi-app-ia32.c, efi-app-ia64.c,
4859         elf-bfd.h, elf-eh-frame.c, elf-hppa.h, elf-m10200.c, elf-m10300.c,
4860         elf-strtab.c, elf.c, elf32-arc.c, elf32-arm.h, elf32-avr.c,
4861         elf32-cris.c, elf32-d10v.c, elf32-d30v.c, elf32-dlx.c, elf32-fr30.c,
4862         elf32-frv.c, elf32-gen.c, elf32-h8300.c, elf32-hppa.c, elf32-hppa.h,
4863         elf32-i370.c, elf32-i386.c, elf32-i860.c, elf32-i960.c, elf32-ip2k.c,
4864         elf32-m32r.c, elf32-m68hc11.c, elf32-m68hc12.c, elf32-m68k.c,
4865         elf32-mcore.c, elf32-mips.c, elf32-openrisc.c, elf32-or32.c,
4866         elf32-pj.c, elf32-ppc.c, elf32-s390.c, elf32-sh.c, elf32-sh64-com.c,
4867         elf32-sh64.c, elf32-sparc.c, elf32-v850.c, elf32-vax.c,
4868         elf32-xstormy16.c, elf64-alpha.c, elf64-gen.c, elf64-hppa.c,
4869         elf64-mips.c, elf64-mmix.c, elf64-ppc.c, elf64-ppc.h, elf64-s390.c,
4870         elf64-sh64.c, elf64-sparc.c, elf64-x86-64.c, elfarm-nabi.c,
4871         elfarm-oabi.c, elfcode.h, elfcore.h, elflink.c, elflink.h,
4872         elfn32-mips.c, elfxx-ia64.c, elfxx-mips.c, elfxx-mips.h,
4873         elfxx-target.h, format.c, freebsd.h, genlink.h, hash.c, hp300hpux.c,
4874         hppabsd-core.c, hpux-core.c, i386aout.c, i386linux.c, i386lynx.c,
4875         i386mach3.c, i386msdos.c, i386os9k.c, ieee.c, ihex.c, irix-core.c,
4876         libaout.h, libbfd-in.h, libbfd.c, libcoff-in.h, libecoff.h, libieee.h,
4877         libnlm.h, liboasys.h, libpei.h, libxcoff.h, linker.c, lynx-core.c,
4878         m68klinux.c, m68klynx.c, mach-o.c, mach-o.h, merge.c, mipsbsd.c,
4879         mmo.c, netbsd-core.c, netbsd.h, nlm.c, nlm32-alpha.c, nlm32-i386.c,
4880         nlm32-ppc.c, nlm32-sparc.c, nlmcode.h, oasys.c, opncls.c, osf-core.c,
4881         pc532-mach.c, pdp11.c, pe-arm.c, pe-i386.c, pe-mcore.c, pe-mips.c,
4882         pe-sh.c, peXXigen.c, pef.c, pei-arm.c, pei-i386.c, pei-mcore.c,
4883         pei-mips.c, pei-sh.c, peicode.h, ppcboot.c, ptrace-core.c, reloc.c,
4884         reloc16.c, riscix.c, rs6000-core.c, sco5-core.c, section.c, simple.c,
4885         som.c, som.h, sparclinux.c, sparclynx.c, srec.c, stabs.c, sunos.c,
4886         syms.c, targets.c, tekhex.c, ticoff.h, trad-core.c, versados.c,
4887         vms-gsd.c, vms-hdr.c, vms-misc.c, vms-tir.c, vms.c, vms.h,
4888         xcoff-target.h, xcofflink.c, xsym.c, xsym.h: Replace boolean with
4889         bfd_boolean, true with TRUE, false with FALSE.  Simplify comparisons
4890         of bfd_boolean vars with TRUE/FALSE.  Formatting.
4891         * bfd-in2.h, libbfd.h, libcoff.h: Regenerate
4892
4893 2002-11-28  Alan Modra  <amodra@bigpond.net.au>
4894
4895         * elf-bfd.h: Replace occurrences of Elf32_Internal_* and
4896         Elf64_Internal_* with Elf_Internal_*.  Replace Elf_Internal_Rel
4897         with Elf_Internal_Rela.
4898         * elf-hppa.h, elf-m10200.c, elf-m10300.c, elf32-arc.c, elf32-arm.h,
4899         elf32-avr.c, elf32-cris.c, elf32-d10v.c, elf32-d30v.c, elf32-dlx.c,
4900         elf32-fr30.c, elf32-frv.c, elf32-gen.c, elf32-h8300.c, elf32-hppa.c,
4901         elf32-i370.c, elf32-i386.c, elf32-i860.c, elf32-i960.c, elf32-ip2k.c,
4902         elf32-m32r.c, elf32-m68hc11.c, elf32-m68hc12.c, elf32-m68k.c,
4903         elf32-mcore.c, elf32-mips.c, elf32-openrisc.c, elf32-or32.c,
4904         elf32-ppc.c, elf32-s390.c, elf32-sh.c, elf32-v850.c, elf32-vax.c,
4905         elf32-xstormy16.c, elf64-alpha.c, elf64-gen.c, elf64-hppa.c,
4906         elf64-mips.c, elf64-mmix.c, elf64-ppc.c, elf64-s390.c, elf64-sh64.c,
4907         elf64-sparc.c, elf64-x86-64.c, elfarm-nabi.c, elfarm-oabi.c,
4908         elfcode.h, elflink.h, elfn32-mips.c, elfxx-ia64.c, elfxx-mips.c: Ditto.
4909         * elf-hppa.h (elf_hppa_internal_shdr): Delete.  Use Elf_Internal_Shdr
4910         throughout instead.
4911         * elf.c (_bfd_elf_no_info_to_howto_rel): Delete.
4912         * elfcode.h (elf_swap_reloca_in): Pass source operand as a bfd_byte *.
4913         Remove INLINE keyword.
4914         (elf_swap_reloc_in): Likewise.  Also clear r_addend.
4915         (elf_swap_reloc_out, elf_swap_reloca_out): Pass destination operand
4916         as a bfd_byte *.
4917         (elf_write_relocs): Consolidate REL and RELA code.
4918         (elf_slurp_reloc_table_from_section): Simplify REL code.
4919         (NAME(_bfd_elf,size_info)): Populate reloc swap entries.
4920         * elf-bfd.h (MAX_INT_RELS_PER_EXT_REL): Define.
4921         * elflink.h (elf_link_read_relocs_from_section): Consolidate REL and
4922         RELA code.
4923         (elf_link_adjust_relocs): Likewise.  Don't malloc space for temp
4924         reloc array, use a fixed size of MAX_INT_RELS_PER_EXT_REL.
4925         (elf_link_output_relocs): Likewise.
4926         (elf_reloc_link_order): Likewise.
4927         (elf_finish_pointer_linker_section): Likewise.
4928         (struct elf_link_sort_rela): Remove union.
4929         (elf_link_sort_cmp1): Update to suit.
4930         (elf_link_sort_cmp2): Here too.
4931         (elf_link_sort_relocs): Consolidate REL and RELA code.  Fix memory
4932         over-allocation for int_rels_per_ext_rel != 1 case.
4933         * elf32-arm.h: Update all bfd_elf32_swap_reloc_out calls.
4934         * elf32-i386.c: Likewise.
4935         * elf32-cris.c: Likewise for bfd_elf32_swap_reloca_out.
4936         * elf32-hppa.c, elf32-i370.c, elf32-m68k.c, elf32-ppc.c, elf32-s390.c,
4937         elf32-sh.c, elf32-vax.c, elfxx-mips.c: Likewise.
4938         * elf64-alpha.c: Likewise for bfd_elf64_swap_reloca_out.
4939         * elf64-hppa.c, elf64-mips.c, elf64-ppc.c, elf64-s390.c, elf64-sh64.c,
4940         elf64-sparc.c, elf64-x86-64.c: Likewise.
4941         * elfxx-ia64.c: Likewise for bfd_elfNN_swap_reloca_out.
4942         * elfxx-mips.c (sort_dynamic_relocs): Likewise for
4943         bfd_elf32_swap_reloc_in.
4944
4945         * elf32-arm.h: Update elf32_arm_info_to_howto calls.
4946         * elf32-mips.c: Likewise for mips_info_to_howto_rel.
4947         (mips_elf64_swap_reloc_in): Zero r_addend.
4948         (mips_elf64_be_swap_reloc_in): Likewise.
4949         (mips_elf64_slurp_one_reloc_table): Simplify.
4950
4951         * elf64-alpha.c (alpha_elf_size_info): Populate reloc swap entries.
4952         * elf64-hppa.c (hppa64_elf_size_info): Likewise.
4953         * elf64-sparc.c (sparc64_elf_size_info): Likewise.
4954
4955 2002-11-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4956
4957         * elf32-sh.c (sh_elf_relocate_section): Don't complain about
4958         unresolved debugging relocs in dynamic applications.
4959         * elf64-sh64.c (sh_elf64_relocate_section): Likewise.
4960
4961 2002-11-26  Alan Modra  <amodra@bigpond.net.au>
4962
4963         * elf-eh-frame.c (ENSURE_NO_RELOCS): Disregard R_*_NONE relocs.
4964         (_bfd_elf_discard_section_eh_frame): Don't discard duplicate CIEs
4965         on a relocatable link.  Comment typos.
4966         * elf.c (_bfd_elf_link_hash_newfunc): Assign elements of structure
4967         in the order they are declared.  Clear elf_hash_value too.
4968         (_bfd_elf_link_hash_table_init): Likewise assign in order.  Clear
4969         eh_info and tls_segment.
4970         * elflink.h (elf_link_input_bfd <emit_relocs>): Keep reloc offsets
4971         sorted when discarding relocs by turning them into R_*_NONE.
4972
4973         * libbfd.c (warn_deprecated): Comment spelling.
4974         * po/SRC-POTFILES.in: Regenerate.
4975
4976 2002-11-21  Richard Henderson  <rth@redhat.com>
4977
4978         * elflink.h (elf_link_add_object_symbols): Don't overwrite the
4979         arch's st_other bits when merging visibilities.
4980         (elf_link_output_extsym): Tidy clearing of visibility field.
4981
4982 2002-11-21  Alan Modra  <amodra@bigpond.net.au>
4983
4984         * coff-mcore.c (SWAP_IN_RELOC_OFFSET): Define.
4985         (SWAP_OUT_RELOC_OFFSET): Define.
4986
4987 2002-11-20  Alexandre Oliva  <aoliva@redhat.com>
4988
4989         * elf.c (_bfd_elf_link_hash_table_init): Make sure
4990         can_refcount is properly extended to the type of
4991         init_refcount.
4992
4993 2002-11-19  Alexandre Oliva  <aoliva@redhat.com>
4994
4995         * elfxx-mips.c (MIPS_RELOC_RELA_P): New macro.
4996         (_bfd_mips_elf_relocate_section): Use it.
4997
4998         * elfxx-mips.c (MNAME): New macro.
4999         (_bfd_mips_elf_check_relocs): Use it.
5000         (_bfd_mips_elf_discard_info): Likewise.
5001         (_bfd_mips_elf_final_link): Likewise.
5002
5003 2002-11-19  Alan Modra  <amodra@bigpond.net.au>
5004
5005         * elf64-ppc.c (ppc64_elf_edit_opd): When deleting relocs, adjust
5006         rel_hdr.sh_size too.
5007
5008 2002-11-18  Klee Dienes  <kdienes@apple.com>
5009
5010         * Makefile.am (BFD32_LIBS): Add bfdwin.lo, bfdio.lo.
5011         (BFD32_LIBS_CFILES): Add bfdwin.c, bfdio.c.
5012         (BFD_H_FILES): Add bfdwin.c, bfdio.c.
5013         (LIBBFD_H_FILES): Add bfdwin.c, bfdio.c.
5014         Add dependencies for bfdwin.c, bfdio.c.
5015         * bfd.c: Remove bfd_get_mtime, bfd_get_size.
5016         * libbfd.c: Remove real_read, bfd_bread, _bfd_window_internal,
5017         bfd_init_window, bfd_free_window, bfd_get_file_window, bfd_bwrite,
5018         bfd_tell, bfd_flush, bfd_stat, bfd_seek.
5019         * bfdio.c: New file.  Contains real_read, bfd_bread, bfd_write,
5020         bfd_tell, bfd_flush, bfd_stat, bfd_seek, bfd_ge_mtime,
5021         bfd_get_size (moved from libbfd.c and bfd.c).
5022         * bfdwin.c New file.  Contains _bfd_window_internal,
5023         bfd_init_window, bfd_free_window, bfd_get_file_window (moved from
5024         libbfd.c and bfd.c).
5025         * po/SRC-POTFILES.in: Regenerate.
5026         * po/bfd.pot: Regenerate.
5027         * libbfd.h: Regenerate.
5028         * bfd-in2.h: Regenerate.
5029         * aclocal.m4: Regenerate.
5030         * Makefile.in: Regenerate.
5031         * configure: Regenerate.
5032
5033 2002-11-18  Klee Dienes  <kdienes@apple.com>
5034
5035         * bfd.c (bfd_preserve_save): Don't zero BFD_IN_MEMORY.
5036
5037 2002-11-15  Kazu Hirata  <kazu@cs.umass.edu>
5038
5039         * coff-h8300.c (h8300_reloc16_estimate): Do not optimize away
5040         jsr after a short jump.
5041         * elf32-h8300.c (elf32_h8_relax_section): Likewise.
5042
5043 2002-11-15  Klee Dienes  <kdienes@apple.com>
5044
5045         * pef.c (bfd_pef_convert_architecture): Move declaration of
5046         ARCH_POWERPC and ARCH_M68K to the start of the function.
5047
5048 2002-11-14  Svein E. Seldal  <Svein.Seldal@solidas.com>
5049
5050         * coff-tic4x.c (tic4x_howto_table): Formatting fixup
5051
5052 2002-11-14  Hans-Peter Nilsson  <hp@bitrange.com>
5053
5054         * elf64-mmix.c (_bfd_mmix_finalize_linker_allocated_gregs):
5055         For bpo_gregs_section->contents, allocate _raw_size, not
5056         _cooked_size.
5057
5058 2002-11-13  Klee Dienes  <kdienes@apple.com>
5059
5060         * config.bfd: Add entries for powerpc-*-darwin and cousins.
5061
5062 2002-11-13  H.J. Lu <hjl@gnu.org>
5063
5064         * elfcode.h (elf_object_p): Don't restore abfd->arch_info.
5065
5066 2002-11-13  Klee Dienes  <kdienes@apple.com>
5067             Alan Modra  <amodra@bigpond.net.au>
5068
5069         * bfd.c (struct bfd_preserve): New.
5070         (bfd_preserve_save): New function.
5071         (bfd_preserve_restore): Ditto.
5072         (bfd_preserve_finish): Ditto.
5073         * bfd-in2.h: Regenerate.
5074         * mach-o.c: Formatting.
5075         (bfd_mach_o_scan_read_symtab_symbol): Make "value" unsigned.
5076         (bfd_mach_o_object_p): Use bfd_preserve_save/restore/finish.
5077         (bfd_mach_o_core_p): Ditto.
5078         (bfd_mach_o_scan): Pass in mdata.
5079         * mach-o.h (bfd_mach_o_scan): Update prototype.
5080         * pef.c: Formatting.
5081         (bfd_pef_object_p): Use bfd_preserve_save/restore/finish.
5082         (bfd_pef_xlib_object_p): Ditto.
5083         (bfd_pef_scan): Pass in mdata.  Move version check to bfd_pef_object_p.
5084         * pef.h (bfd_pef_scan): Update prototype.
5085         * xsym.c: Formatting, K&R fixes.
5086         (bfd_sym_object_p): Use bfd_preserve_save/restore/finish.
5087         (bfd_sym_scan): New function split out from bfd_sym_object_p.
5088         * xsym.h (bfd_sym_scan): Declare.
5089         * elfcode.h (elf_object_p): Use bfd_preserve_save/restore/finish.
5090         * elfcore.h (elf_core_file_p): Likewise.
5091         * targets.c (_bfd_target_vector): Revert 2002-11-08 change.
5092
5093 2002-11-12  Nick Clifton  <nickc@redhat.com>
5094
5095         * po/da.po: Updated Danish translation.
5096
5097 2002-11-12  Alan Modra  <amodra@bigpond.net.au>
5098
5099         * elflink.h (elf_link_add_object_symbols): Optimize stabs for
5100         relocatable link too.
5101         (elf_link_input_bfd): When emitting relocs, adjust offsets for
5102         eh_frame and stab sections.  Zap deleted relocs.
5103         (elf_reloc_symbol_deleted_p): Return true for zero r_symndx.
5104         (elf_bfd_discard_info): Run for relocatable link too.
5105         * elf64-ppc.c (ppc64_elf_edit_opd): Rename from edit_opd.  Make global.
5106         Handle ld -r case.
5107         (ppc64_elf_size_dynamic_sections): Don't call edit_opd from here.
5108         * elf64-ppc.h (ppc64_elf_edit_opd): Declare.
5109
5110         * elf-bfd.h (struct cie_header): Move from elf_eh-frame.c.
5111         (struct cie, struct eh_cie_fde, struct eh_frame_sec_info): Likewise.
5112         (struct eh_frame_array_ent, struct eh_frame_hdr_info): Likewise.
5113         (enum elf_link_info_type): Remove ELF_INFO_TYPE_EH_FRAME_HDR.
5114         (struct eh_frame_hdr_info): Add "hdr_sec", remove "split".
5115         (struct elf_link_hash_table): Add eh_info.
5116         (struct elf_obj_tdata): Change eh_frame_hdr to an asection *.
5117         (_bfd_elf_discard_section_eh_frame): Update prototype.
5118         (_bfd_elf_discard_section_eh_frame_hdr): Likewise.
5119         (_bfd_elf_write_section_eh_frame): Likewise.
5120         (_bfd_elf_write_section_eh_frame_hdr): Likewise.
5121         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Remove "ehdrsec"
5122         param.  Get "hdr_info" from link hash table.
5123         (_bfd_elf_discard_section_eh_frame_hdr): Remove "sec" param.  Get
5124         header section from link hash table.  Save header section to elf_tdata.
5125         (_bfd_elf_maybe_strip_eh_frame_hdr): Remove local "sec".  Use
5126         header section from link hash table.  Don't alloc hdr_info.  Clear
5127         hdr_sec instead of setting "strip".
5128         (_bfd_elf_eh_frame_section_offset): Formatting.
5129         (_bfd_elf_write_section_eh_frame): Remove "ehdrsec", add "info" param.
5130         Get header section from link hash table.
5131         (_bfd_elf_write_section_eh_frame_hdr): Remove "sec", add "info" param.
5132         Get header section from link hash table.
5133         * elf.c (map_sections_to_segments): Use cached eh_frame_hdr.
5134         (get_program_header_size): Likewise.
5135         (_bfd_elf_section_offset): Formatting.
5136         * elflink.h (elf_link_create_dynamic_sections): Stash eh frame header
5137         section pointer in link hash table.
5138         (elf_bfd_final_link): Adjust _bfd_elf_write_section_eh_frame_hdr
5139         and _bfd_elf_write_section_eh_frame calls.  Update comment about
5140         eh_frame entries.
5141         (elf_bfd_discard_info): Adjust _bfd_elf_discard_section_eh_frame and
5142         _bfd_elf_discard_section_eh_frame_hdr calls.  Remove "ehdr".
5143
5144         * po/SRC-POTFILES.in: Regenerate.
5145
5146         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Don't zero
5147         relocs for discarded FDEs.  Remove dead code.
5148         (_bfd_elf_write_section_eh_frame_hdr): Remove dead code.
5149         * elflink.h (elf_bfd_discard_info): Don't save edited relocs.
5150         Tidy conditions under which stabs are edited.  Formatting.
5151         * elf64-sparc.c (sparc64_elf_relocate_section): Ignore overflows
5152         from discarded relocs.
5153         * elfxx-ia64.c (elfNN_ia64_install_dyn_reloc): Add reloc output
5154         section adjustments after testing magic values.
5155
5156 2002-11-12  Thomas Moestl <tmm@FreeBSD.org>
5157
5158         * elf64-sparc.c (sparc64_elf_adjust_dynamic_symbol): Correct
5159         references to large plt symbols.
5160
5161 2002-11-12  Klee Dienes  <kdienes@apple.com>
5162
5163         * mach-o.c (bfd_mach_o_scan_read_thread): Don't re-use 'i' when
5164         looking for an unused section name.
5165
5166 2002-11-11  Kazu Hirata  <kazu@cs.umass.edu>
5167
5168         * coff-h8300.c: Fix formatting.
5169         * elf32-h8300.c: Likewise.
5170         * reloc16.c: Likewise.
5171
5172 2002-11-09  Jeroen Dobbelaere  <jeroen.dobbelaere@acunia.com>
5173
5174         * elf32-arm.h (elf32_arm_size_dynamic_sections): Don't strip output
5175         section when dynamic section unused;  _bfd_strip_section_from_output
5176         instead.
5177
5178 2002-11-08  Alan Modra  <amodra@bigpond.net.au>
5179
5180         * targets.c (_bfd_target_vector): Disable pef_vec, pef_xlib_vec
5181         and sym_vec.
5182
5183         * dwarf2.c: Revert last change.
5184
5185 2002-11-07  Michal Ludvig  <mludvig@suse.cz>
5186
5187         * dwarf2.c (read_indirect_string, read_abbrevs, decode_line_info,
5188         _bfd_dwarf2_find_nearest_line): Use
5189         bfd_simple_get_relocated_section_contents() instead of
5190         bfd_get_section_contents().
5191         * reloc.c (bfd_perform_relocation): Add sanity check.
5192         * simple.c (simple_get_relocated_section_contents): If the section
5193         does not have any relocs associated with it, just return the
5194         unadjusted contents.
5195
5196 2002-11-07  Hans-Peter Nilsson  <hp@axis.com>
5197
5198         * elf32-cris.c (cris_elf_relocate_section) <case R_CRIS_16_GOT,
5199         case R_CRIS_32_GOT>: Correct test for filling in constant .got
5200         contents, enabling for a non-DSO, for symbols defined in the
5201         program with --export-dynamic.
5202
5203 2002-11-07  Alan Modra  <amodra@bigpond.net.au>
5204
5205         * elf64-ppc.c: Comment typo fixes.
5206         (ppc64_elf_merge_private_bfd_data): Allow BFD_ENDIAN_UNKNOWN input.
5207
5208 2002-11-07  Nick Clifton  <nickc@redhat.com>
5209
5210         * po/da.po: Updated Danish translation.
5211
5212 2002-11-06  Alexandre Oliva  <aoliva@redhat.com>
5213
5214         * elf64-mips.c (mips_elf64_slurp_one_reloc_table): Generate
5215         exactly three internal relocs per external reloc.  Set reloc_count
5216         to the external reloc count.
5217
5218 2002-11-06  Klee Dienes  <kdienes@apple.com>
5219
5220          * coff-stgo32.c (stub_bytes): Mark as const.
5221          Fix comment formatting.
5222
5223 2002-11-06  Klee Dienes  <kdienes@apple.com>
5224
5225         * Makefile.am (BFD32_BACKENDS): Add mach-o.lo, pef.lo, and
5226         xsym.lo.
5227         (BFD32_BACKENDS_CFILES): Add mach-o.c, pef.c, and xsym.c.
5228         (SOURCE_HFILES): Add mach-o.h, pef.h, pef-traceback.h, xsym.h
5229         * archures.c (enum bfd_architecture): Add bfd_arch_m98k.
5230         * bfd.c (struct bfd): Add private data for mach-o, pef, and sym.
5231         * targets.c (enum bfd_flavour): Add flavours for mach-o, pef, and
5232         sym.
5233         (_bfd_target_vector): Add target vectors for mach-o, pef, and sym.
5234         * Makefile.in: Regenerate.
5235         * doc/Makefile.in: Regenerate.
5236         * bfd-in2.h: Regenerate.
5237         * xsym.c: New file.  Contains support for the Apple/Metrowerks
5238         xSYM debugging format.
5239         * xsym.h: New file.
5240         * pef.c: New file.  Contains support for the Apple Code Fragment
5241         Manager Preferred Executable Format
5242         * pef.h: New file.
5243         * pef-traceback.h: New file.  Contains support for parsing PowerPC
5244         traceback tables as used by PEF executables (and perhaps other
5245         systems as well).
5246         * mach-o.c: New file.  Contains support for the Mach-O object file
5247         format.
5248         * mach-o.h: New file.
5249         * mach-o-target.c: New file.  Declares the mach-o targets
5250         themselves.  Included three times by mach-o.c; each time with a
5251         different set of macros set.
5252
5253 2002-11-06  Graeme Peterson  <gp@qnx.com>
5254
5255         * Makefile.am: Remove entries for elf32-qnx.[ch].
5256         * Makefile.in: Regenerate.
5257         * config.bfd: Change arm-nto to use bfd_elf32_{big|little}arm_vec,
5258         ppc-nto to use bfd_elf32_powerpc{le}_vec, sh-nto to use
5259         bfd_elf32_sh{l}_vec, and i386-nto to use bfd_elf32_i386_vec.
5260         * configure.in: Remove support for bfd_elf32_sh{l}qnx_vec,
5261         bfd_elf32_powerpc{le}qnx_vec, bfd_elf32_{big|little}armqnx_vec,
5262         and bfd_elf32_i386qnx_vec, and removed elf32-qnx.lo from other targets.
5263         bfd_elf32_sh{l}_vec, and i386-nto to use bfd_elf32_i386_vec.
5264         * configure: Regenerate.
5265         * elf32-qnx.c: Remove.
5266         * elf32-qnx.h: Remove.
5267         * elf.c: Remove calls to QNX specific set_nonloadable_filepos,
5268         is_contained_by_filepos, and copy_private_bfd_data_p.
5269         * elf-bfd.h (struct elf_backend_data): Remove set_nonloadable_filepos,
5270         is_contained_by_filepos, and copy_private_bfd_data_p.
5271         * elf32-i386.c: Remove QNX extended bfd support.
5272         * elf32-ppc.c: Remove QNX extended bfd support.
5273         * elf32-sh.c: Remove QNX extended bfd support.
5274         * elfarm-nabi.c: Remove QNX extended bfd support.
5275         * targets.c: Remove qnx vectors.
5276         * elfxx-target.h (elf_backend_set_nonloadable_filepos): Remove
5277         (elf_backend_is_contained_by_filepos): Remove.
5278         (elf_backend_copy_private_bfd_data_p): Remove.
5279         * po/SRC-POTFILES.in: Regenerate.
5280
5281 2002-11-06  David O'Brien  <obrien@FreeBSD.org>
5282             Alan Modra  <amodra@bigpond.net.au>
5283
5284         * elf64-sparc.c (sparc64_elf_relocate_section): Adjust addend of
5285         dynamic relocs against section symbols for the output section vma.
5286
5287 2002-11-05  Alan Modra  <amodra@bigpond.net.au>
5288
5289         * elf32-arm.h (t2a1_push_insn, t2a2_ldr_insn, t2a3_mov_insn,
5290         t2a4_bx_insn, t2a5_pop_insn, t2a6_bx_insn): Remove.
5291
5292 2002-11-05  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5293             Alan Modra  <amodra@bigpond.net.au>
5294
5295         * config.bfd (sh-*-linux*): Use bfd_elf*_sh64*lin_vec as sh64
5296         vectors in target_selvecs.
5297         (shle-*-netbsdelf*): Use bfd_elf*_sh64*nbsd_vec as sh64 vectors
5298         in target_selvecs.
5299         (sh-*-netbsdelf*): Likewise.
5300         * configure.in (assocvecs): New variable.  Handle assocvecs like
5301         selvecs.
5302         * configure: Regenerate.
5303         * format.c (bfd_check_format_matches): Store bfd_target pointers
5304         in matching_vector instead of target names.  Select first target
5305         from bfd_associated_vector that matches a list of ambiguous targets.
5306         * targets.c (_bfd_associated_vector): New array.
5307         (bfd_associated_vector): New variable.
5308         (_bfd_target_vector): Add bfd_elf*_sh64*lin_vec.
5309         * libbfd-in.h (bfd_associated_vector): Declare.
5310         * libbfd.h: Regenerate.
5311
5312 2002-11-05  Elias Athanasopoulos  <eathan@otenet.gr>
5313
5314         * vms-gsd.c (_bfd_vms_write_gsd): Check that symbol->udata.p is
5315         non-NULL before dereferencing.
5316
5317 2002-11-04  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5318
5319         * vms.c (vms_object_p): Restore the start address when returning
5320         NULL.
5321
5322 2002-11-04  Alan Modra  <amodra@bigpond.net.au>
5323             Hans-Peter Nilsson  <hp@axis.com>
5324
5325         * elflink.h (struct elf_final_link_info): Add shndxbuf_size.
5326         (elf_bfd_final_link): Don't bother zeroing symtab_hdr fields.
5327         Set up a larger symshndxbuf, and write it out.  Free it on
5328         exit rather than freeing symbuf twice.  Correct section index
5329         on output section symbol loop.
5330         (elf_link_output_sym): Accumulate symbol extension section
5331         indices, reallocating symshndxbuf rather than writing it out.
5332         (elf_link_flush_output_syms): Don't flush symshndxbuf.
5333         * elf.c (assign_section_numbers): Init i_shdrp to all zero.
5334         Use bfd_zalloc to clear i_shdrp[0] too.
5335
5336 2002-11-03  Stephen Clarke <stephen.clarke@earthling.net>
5337
5338          * elf32-sh64-com.c (sh64_address_in_cranges): Use
5339         _raw_size of cranges section if _cooked_size not yet set.
5340
5341 2002-11-03  Hans-Peter Nilsson  <hp@axis.com>
5342
5343         * elf32-v850.c (v850_elf_relax_delete_bytes): Correct parameters
5344         for bfd_elf32_swap_symbol_out.
5345
5346 2002-10-31  David O'Brien  <obrien@FreeBSD.org>
5347
5348         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Don't mix
5349         signed and unsigned in comparison.
5350
5351 2002-10-30  Daniel Jacobowitz  <drow@mvista.com>
5352
5353         * coffcode.h: Remove extraneous '\'.
5354
5355 2002-10-28  H.J. Lu <hjl@gnu.org>
5356
5357         * Makefile.am (targets.lo): Depend on Makefile instead of
5358         config.status.
5359         (archures.lo): Likewise.
5360         * Makefile.in: Regenerated.
5361
5362 2002-10-25  Jason Thorpe  <thorpej@wasabisystems.com>
5363
5364         * config.bfd (mips*el-*-netbsd*, mips*-*-netbsd*): Add
5365         bfd_elf64_bigmips_vec and bfd_elf64_littlemips_vec to
5366         targ_selvecs.
5367
5368 2002-10-25  Jim Wilson  <wilson@redhat.com>
5369
5370         * elf64-sh64.c (sh_elf64_relocate_section): Call
5371         _bfd_elf_rela_local_sym.  Handle relocs against STT_SECTION symbol
5372         of SHF_MERGE section.
5373
5374 2002-10-25  Hans-Peter Nilsson  <hp@axis.com>
5375
5376         * simple.c: Correct placement of ATTRIBUTE_UNUSED.
5377
5378 2002-10-24  John David Anglin  <dave@hiauly1.hia.nrc.ca>
5379
5380         * aoutx.h (NAME(aout,swap_ext_reloc_in)): Cast bytes->r_index to
5381         unsigned int.  Cast RELOC_BASE10, RELOC_BASE13 and RELOC_BASE22 to
5382         unsigned int.
5383         (NAME(aout,final_link)): Cast enum used in assignment.
5384         (aout_link_write_symbols): Cast enums in comparisons, int values to
5385         boolean, enums in assignments to int.
5386         (aout_link_input_section_std): Cast rel->r_index to unsigned int.
5387         (aout_link_input_section_ext): Likewise.  Cast enums used in
5388         comparisons with unsigned ints.
5389         (aout_link_reloc_link_order): Cast enum to int in assignment.
5390         * archive.c (_bfd_generic_read_ar_hdr_mag): Cast result of memchr
5391         calls to char *.
5392         * bfd-in.h (bfd_set_section_vma): Cast enum true to unsigned int in
5393         assignment.
5394         * bfd-in2.h (bfd_set_section_vma): Likewise.
5395         * bfd.c (bfd_record_phdr): Cast enums in assignments.
5396         * binary.c (bfd_alloc): Cast enum to long.
5397         * coffgen.c (_bfd_coff_is_local_label_name): Cast return to boolean.
5398         * dwarf2.c (read_abbrevs): Add casts to enum types.
5399         (read_attribute_value): Likewise.
5400         (arange_add): Cast result of bfd_zalloc call.
5401         (comp_unit_contains_address): Return true and false.
5402         (comp_unit_find_nearest_line): Cast return to boolean.
5403         * format.c (bfd_check_format_matches, bfd_set_format): Likewise.
5404         * gen-aout.c: define macro '_' if not defined.
5405         * libbfd.c (bfd_realloc): Cast malloc and realloc to PTR.
5406         (bfd_bwrite): Cast bfd_realloc to bfd_byte *.
5407         (bfd_write_bigendian_4byte_int): Cast return to boolean.
5408         (bfd_seek): Cast bfd_realloc to bfd_byte *.
5409         (bfd_generic_is_local_label_name): Cast return to boolean.
5410         * libcoff.h (_bfd_coff_adjust_symndx): Remove extraneous '\'.
5411         * linker.c (_bfd_link_hash_newfunc): Cast bfd_hash_allocate result to
5412         struct bfd_hash_entry *.
5413         (_bfd_generic_link_hash_newfunc): likewise.
5414         (_bfd_generic_final_link): Cast enum to unsigned int.
5415         * merge.c (sec_merge_emit): Cast return to boolean.
5416         (merge_strings): Add casts to const unsigned char *.
5417         * reloc.c (bfd_get_reloc_code_name): Cast enums in comparison to int.
5418         (bfd_generic_get_relocated_section_content): Cast enum to unsigned int.
5419         * section.c (bfd_section_hash_newfunc): Cast bfd_hash_allocate result
5420         to struct bfd_hash_entry *.
5421         (bfd_set_section_content): Add cast to PTR in comparison.
5422         * simple.c (simple_dummy_warning, simple_dummy_undefined_symbol,
5423         simple_dummy_reloc_overflow, simple_dummy_reloc_dangerous,
5424         simple_dummy_unattached_reloc,
5425         bfd_simple_get_relocated_section_contents): Add K&R declarations and
5426         function definitions.
5427         * srec.c (S3Forced): Initialize to false.
5428         (srec_get_symtab): Cast return value from bfd_alloc to asymbol *.
5429         * stabs.c (_bfd_link_section_stabs): Cast enum to int in comparisons.
5430         (_bfd_discard_section_stabs): Likewise.  Also cast return to boolean.
5431         * syms.c (bfd_is_undefined_symclass): Cast return to boolean.
5432         (_bfd_stab_section_find_nearest_line): Cast enum to bfd_byte in
5433         comparisons.
5434
5435 2002-10-23  Jakub Jelinek  <jakub@redhat.com>
5436
5437         * elf64-alpha.c (elf64_alpha_check_relocs): Only put maybe_dynamic
5438         relocs into shared lib non-allocated reloc sections.
5439
5440 2002-10-23  Nathan Tallent  <eraxxon@alumni.rice.edu>
5441
5442         * dwarf2.c (add_line_info): Ensure that the line_info_table is
5443         sorted even when given an out-of-order line sequence.
5444         (lookup_address_in_line_info_table): When an exact VMA match is
5445         not found, return line information with the closest VMA.
5446
5447 2002-10-23 Ross Alexander <ross.alexander@uk.neceur.com>
5448
5449         * elf64-hppa.c: Force DT_FLAGS to always be set.  Required by
5450         HPUX 11.00 patch PHSS_26559.
5451
5452 2002-10-22  Alexandre Oliva  <aoliva@redhat.com>
5453
5454         * elfxx-mips.c (_bfd_mips_elf_modify_segment_map): Don't move
5455         the options section into a separate section unless IRIX 6
5456         compatibility is enabled.
5457
5458 2002-10-22  Alexandre Oliva  <aoliva@redhat.com>
5459
5460         * elflink.h (struct elf_link_sort_rela): Turn rel and rela
5461         into arrays.
5462         (elf_link_sort_cmp1, elf_link_sort_cmp2): Adjust.
5463         (elf_link_sort_relocs): Likewise.  Take int_rels_per_ext_rel
5464         into account.
5465         * elfxx-mips.c (mips_elf_create_dynamic_relocation): Compose
5466         R_MIPS_REL32 with R_MIPS64 if ABI_64_P.
5467
5468 2002-10-21  Graeme Peterson  <gp@qnx.com>
5469
5470         * targets.c (_bfd_target_vector): Add missing qnx vectors.
5471
5472 2002-10-21  Alan Modra  <amodra@bigpond.net.au>
5473
5474         * targets.c (bfd_target_list): Don't return the default target twice.
5475
5476 2002-10-21  Elias Athanasopoulos  <eathan@otenet.gr>
5477
5478         * archive.c (_bfd_archive_bsd_update_armap_timestamp): Replace
5479         perror with bfd_perror.
5480
5481 2002-10-19  H.J. Lu <hjl@gnu.org>
5482
5483         * elflink.h (elf_link_add_object_symbols): Correctly handle
5484         DT_RPATH and DT_RUNPATH.
5485
5486 2002-10-19  Mark Kettenis  <kettenis@gnu.org>
5487
5488         * elf.c (elfcore_grok_note): Fix recognition on NT_PRXFPREG notes.
5489
5490 2002-10-17  Denis Chertykov  <denisc@overta.ru>
5491
5492         * elf32-ip2k.c (ELF_MACHINE_ALT1): Define alternate machine code
5493         for ip2k port.
5494
5495 2002-10-17  Alan Modra  <amodra@bigpond.net.au>
5496
5497         * elfxx-target.h (USE_REL): Don't define as 1.
5498         * elf32-arm.h (USE_REL): Provide a default define of 0.
5499         Use #if rather than #ifdef when testing USE_REL.
5500         * elf32-m32r.c: Likewise.
5501
5502         * elf32-arc.c (USE_REL): Define as 1.
5503         * elf32-d10v.c (USE_REL): Likewise.
5504         * elf32-m32r.c (USE_REL): Likewise.
5505         * elf32-m68hc11.c (USE_REL): Likewise.
5506         * elf32-m68hc12.c (USE_REL): Likewise.
5507         * elf32-or32.c (USE_REL): Likewise.
5508         * elfarm-nabi.c (USE_REL): Likewise.
5509
5510 2002-10-16  Jakub Jelinek  <jakub@redhat.com>
5511
5512         * config.bfd (s390-*-linux*): Add targ64_selvecs.
5513         (s390x-*-linux*): Add targ_selvecs.
5514
5515 2002-10-16  Alan Modra  <amodra@bigpond.net.au>
5516
5517         * Makefile.am (BFD32_BACKENDS): Remove elfarmqnx-nabi.lo,
5518         elf32-i386-fbsd.lo, elf32-i386qnx.lo, elf32-ppcqnx.lo,
5519         elf32-sh-lin.lo, elf32-sh64-lin.lo, elf32-sh-nbsd.lo,
5520         elf32-sh64-nbsd.lo, elf32-shqnx.lo.  Add elf32-qnx.lo.
5521         (BFD32_BACKENDS_CFILES): Likewise for corresponding C files.
5522         (BFD64_BACKENDS): Remove elf64-sh64-lin.lo, elf64-sh64-nbsd.lo.
5523         (BFD64_BACKENDS_CFILES): Likewise for corresponding C files.
5524         (SOURCE_HFILES): Add elf32-qnx.h.
5525         (BUILD_HFILES): Add bfdver.h.
5526         Run "make dep-am".
5527         * Makefile.in: Regenerate.
5528         * configure.in Update bfd vector dependencies.
5529         * configure: Regenerate.
5530         * elf32-i386-fbsd.c: Delete.  Move code to elf32-i386.c.
5531         * elf32-i386qnx.c: Likewise.
5532         * elf32-ppcqnx.c: Delete.  Move code to elf32-ppc.c.
5533         * elf32-sh-nbsd.c: Delete.  Move code to elf32-sh.c.
5534         * elf32-sh-lin.c: Likewise.
5535         * elf32-shqnx.c: Likewise.
5536         * elf32-sh64-lin.c: Delete.  Move code to elf32-sh64.c.
5537         * elf32-sh64-nbsd.c: Likewise.
5538         * elf64-sh64-lin.c: Delete.  Move code to elf64-sh64.c.
5539         * elf64-sh64-nbsd.c: Likewise.
5540         * elfarmqnx-nabi.c: Delete.  Move code to elfarm-nabi.c.
5541         * elf32-arm.h (ELF_MAXPAGESIZE): Always define.
5542         * elf32-i386.c: Remove ELF_ARCH and ELF32_I386_C_INCLUDED tests.
5543         * elf32-ppc.c: Remove ELF32_PPC_C_INCLUDED tests.
5544         * elf32-qnx.h (elf_backend_set_nonloadable_filepos): Always define.
5545         (elf_backend_is_contained_by_filepos): Likewise.
5546         (elf_backend_copy_private_bfd_data_p): Likewise.
5547         Globalize and move functions to..
5548         * elf32-qnx.c: ..here.  New file.
5549         * elf32-sh.c: Remove ELF_ARCH and ELF32_SH_C_INCLUDED tests.  Don't
5550         emit target vectors when INCLUDE_SHMEDIA.
5551         * elf32-sh64.c: Remove ELF_ARCH test.  Move TARGET_* etc. defines to
5552         end of file.
5553         * elf64-sh64.c: Remove ELF_ARCH test.
5554         * elfarm-nabi.c: Remove ELFARM_NABI_C_INCLUDED test.
5555         * po/BLD-POTFILES.in: Regenerate.
5556         * po/SRC-POTFILES.in: Regenerate.
5557
5558 2002-10-16  Alan Modra  <amodra@bigpond.net.au>
5559
5560         * elflink.h (elf_link_add_object_symbols): Error out on dynamic objects
5561         loaded with --just-symbols.
5562
5563         * elf32-i386qnx.c (TARGET_LITTLE_NAME): Define.
5564         * elf32-ppcqnx.c (TARGET_LITTLE_NAME, TARGET_BIG_NAME): Define.
5565         * elf32-shqnx.c (TARGET_LITTLE_NAME, TARGET_BIG_NAME): Define.
5566         * elfarmqnx-nabi.c (TARGET_LITTLE_NAME, TARGET_BIG_NAME): Define.
5567
5568 2002-10-15  Richard Henderson  <rth@redhat.com>
5569
5570         * Makefile.am (BFD64_BACKENDS): Remove elf64-alpha-fbsd.
5571         (BFD64_BACKENDS_CFILES): Likewise.
5572         * configure.in (bfd_elf64_alpha_freebsd_vec): Use elf64-alpha.
5573         * elf64-alpha-fbsd.c: Remove file, move code ...
5574         * elf64-alpha.c: ... here.
5575         * Makefile.in, configure: Rebuild.
5576
5577 2002-10-14  Richard Henderson  <rth@redhat.com>
5578
5579         * elf64-alpha.c (elf64_alpha_relocate_section) [BRSGP]: Increment
5580         VALUE, not ADDEND.
5581
5582 2002-10-14  Stephen Clarke <stephen.clarke@superh.com>
5583
5584         * elf32-sh.c (elf_sh_link_hash_entry): Replace
5585         datalabel_got_offset with union of datalabel_got
5586         offset and refcount.
5587         (sh_elf_link_hash_newfunc): Initialize datalabel_got.refcount.
5588         (allocate_dynrelocs): Delete unnecessary code for
5589         STT_DATALABEL type.  Create entry in got for
5590         datalabel version of symbol if datalabel_got.refcount > 0.
5591         (sh_elf_relocate_section): Use datalabel_got union.
5592         (sh_elf_gc_sweep_hook): Pull common code to initialize
5593         h and eh out of switch statement.  Declare seen_stt_datalabel.
5594         Initialize it.  Decrement datalabel_got.refcount for
5595         got relocs when seen_stt_datalabel is true.
5596         Decrement local_got_refcounts entry for datalabel got relocs
5597         of local symbols.
5598         (sh_elf_copy_indirect_symbol): Copy datalabel_got field over.
5599         (sh_elf_check_relocs): Declare seen_stt_datalabel.
5600         Initialize it.  When seen_stt_datalabel is true, increment
5601         datalabel_got refcount rather than got.refcount.
5602         (sh_elf_finish_dynamic_symbol): Create relocs to
5603         initialize got entry for datalabel version of symbol.
5604
5605 2002-10-14  Alan Modra  <amodra@bigpond.net.au>
5606
5607         * Makefile.am: Run "make dep-am".
5608         (BFD_H_FILES): Remove version.h.
5609         * bfd-in.h (BFD_VERSION, BFD_VERSION_DATE, BFD_VERSION_STRING): Move..
5610         * version.h: ..to here.
5611         * configure.in (bfd_version_date): Remove.
5612         (AC_OUTPUT): Make bfdver.h from version.h.
5613         * bfd.c: #include "bfdver.h".
5614         * vms-hdr.c: Likewise.
5615         * Makefile.in: Regenerate.
5616         * bfd-in2.h: Regenerate.
5617         * configure: Regenerate.
5618         * po/SRC-POTFILES.in: Regenerate.
5619
5620 2002-10-14  Alan Modra  <amodra@bigpond.net.au>
5621
5622         * archures.c (bfd_mach_i386_i386, bfd_mach_i386_i8086,
5623         bfd_mach_i386_i386_intel_syntax, bfd_mach_x86_64,
5624         bfd_mach_x86_64_intel_syntax bfd_mach_ppc, bfd_mach_ppc64,
5625         bfd_mach_rs6k, bfd_mach_d10v, bfd_mach_sh, bfd_mach_v850,
5626         bfd_mach_arc_5, bfd_mach_arc_6, bfd_mach_arc_7, bfd_mach_arc_8,
5627         bfd_mach_m32r, bfd_mach_frv, bfd_mach_frvsimple,
5628         bfd_mach_ia64_elf64, bfd_mach_ia64_elf32,
5629         bfd_mach_ip2022, bfd_mach_ip2022ext,
5630         bfd_mach_s390_31, bfd_mach_s390_64, bfd_mach_xstormy16): Renumber.
5631         * bfd-in2.h: Regenerate.
5632
5633 2002-10-14  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5634
5635         * config.bfd (sh*eb-*-linux*, sh*-*-linux*): Add the alternative
5636         endian vector to targ_selvecs.
5637
5638 2002-10-13  Alexandre Oliva  <aoliva@redhat.com>
5639
5640         * elfxx-mips.c (mips_elf_calculate_relocation): Take
5641         save_addend argument.  Don't apply the 32-bit mask to a
5642         GPREL32 value if it's to be used in another relocation.  Don't
5643         use forced-check computation of local_p to decide whether to
5644         add gp0 to GPREL16 value.  Don't use only the lowest 16 bits
5645         of the addend of a non-in-place GPREL16 relocation.
5646         (_bfd_mips_elf_relocate_section): Pass use_saved_addend_p to
5647         mips_elf_calculate_relocation().
5648
5649 2002-10-12  Stephane Carrez  <stcarrez@nerim.fr>
5650
5651         * elf32-m68hc11.c (m68hc11_elf_relax_section): Don't treat relocs
5652         with symbols in other sections if we relaxed something;  the sections
5653         output offsets must be re-computed before.
5654
5655 2002-10-12  Stephane Carrez  <stcarrez@nerim.fr>
5656
5657         * elf32-m68hc11.c (m68hc11_elf_relax_section): Update symbols
5658         handling to use Elf_Internal_Sym.
5659         (m68hc11_elf_relax_delete_bytes): Likewise.
5660
5661 2002-10-11  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5662
5663         * elf32-sh.c (sh_elf_optimized_tls_reloc, sh_elf_mkobject,
5664         sh_elf_object_p, dtpoff_base): New functions.
5665         (sh_elf_howto_table): Add TLS relocs.
5666         (sh_reloc_map): Likewise.
5667         (sh_elf_info_to_howto): Support TLS relocs.
5668         (elf_sh_link_hash_entry): Add tls_type and tls_tpoff32.
5669         (sh_elf_hash_entry, sh_elf_tdata, sh_elf_local_got_tls_type):
5670         New macros.
5671         (sh_elf_obj_tdata): New.
5672         (elf_sh_link_hash_table): Add tls_ldm_got.
5673         (sh_elf_link_hash_table_create): Clear refcount of tls_ldm_got.
5674         (allocate_dynrelocs): Support TLS relocs.
5675         (sh_elf_size_dynamic_sections): Likewise.
5676         (sh_elf_relocate_section): Support TLS relocs.  Don't try to find
5677         .rela.got section when found already.  Return false after printing
5678         error about unresolvable relocation.
5679         (sh_elf_gc_sweep_hook): Support TLS relocs.
5680         (sh_elf_check_relocs): Likewise.
5681         (sh_elf_finish_dynamic_symbol): Likewise.
5682         (bfd_elf32_mkobject, elf_backend_object_p): Define for TLS case.
5683         * reloc.c: Add SH TLS relocs.
5684         * bfd-in2.h, libbfd.h: Regenerate.
5685
5686 2002-10-11  Daniel Jacobowitz  <drow@mvista.com>
5687
5688         * Makefile.in: Regenerated.
5689
5690 2002-10-11  Daniel Jacobowitz  <drow@mvista.com>
5691
5692         * Makefile.am: Run dep-am.
5693         (BFD_H_DEP): Add simple.c and linker.c.
5694         (BFD32_LIBS): Add simple.lo.
5695         (BFD32_LIBS_CFILES): Add simple.c.
5696         * Makefile.in: Regenerated.
5697         * bfd-in2.h: Regenerated.
5698         * simple.c: New file.
5699
5700 2002-10-11  Alan Modra  <amodra@bigpond.net.au>
5701
5702         * coff-arm.c (record_arm_to_thumb_glue): Avoid type-punned pointers.
5703         (record_thumb_to_arm_glue): Likewise.
5704         * ecoff.c (ecoff_link_add_externals): Likewise.
5705         * elf32-arm.h (record_arm_to_thumb_glue): Likewise.
5706         (record_thumb_to_arm_glue): Likewise.
5707         * elf32-m32r.c (m32r_elf_add_symbol_hook): Likewise.
5708         * elf32-sh.c (sh_elf_create_dynamic_sections): Likewise.
5709         * elf32-sh64.c (sh64_elf_add_symbol_hook): Likewise.
5710         * elf64-alpha.c (elf64_alpha_create_dynamic_sections): Likewise.
5711         * elf64-ppc.c (func_desc_adjust): Likewise.
5712         * elf64-sh64.c (sh64_elf64_add_symbol_hook): Likewise.
5713         (sh64_elf64_create_dynamic_sections): Likewise.
5714         * elflink.c (_bfd_elf_create_got_section): Likewise.
5715         (_bfd_elf_create_dynamic_sections): Likewise.
5716         (_bfd_elf_create_linker_section): Likewise.
5717         * elflink.h (elf_add_default_symbol): Likewise.
5718         (elf_link_create_dynamic_sections): Likewise.
5719         (NAME(bfd_elf,size_dynamic_sections)): Likewise.
5720         * elfxx-ia64.c (elfNN_ia64_aix_add_symbol_hook): Likewise.
5721         * elfxx-mips.c (mips_elf_create_got_section): Likewise.
5722         (_bfd_mips_elf_add_symbol_hook): Likewise.
5723         (_bfd_mips_elf_create_dynamic_sections): Likewise.
5724         * linker.c (generic_link_add_symbol_list): Likewise.
5725         * xcofflink.c (xcoff_link_add_symbols): Likewise.
5726
5727         * elfxx-ia64.c (oor_brl, oor_ip): Conditionally define.
5728
5729         * elf64-ppc.c (edit_opd): Only zero opd syms when function is
5730         completely removed.  Correct local sym adjustment.
5731
5732 2002-10-10  Stephen Clarke <stephen.clarke@superh.com>
5733
5734         * elf32-sh.c (elf_sh_pic_plt_entry_be, elf_sh_pic_plt_entry_le):
5735         Correct mistake in calculation of address of .got.
5736         * elf64-sh64.c (elf_sh64_pic_plt_entry_be,
5737         elf_sh64_pic_plt_entry_le): Likewise.
5738
5739 2002-10-09  Richard Shann <richard.shann@superh.com>
5740             Stephen Clarke <stephen.clarke@superh.com>
5741
5742         * Makefile.am: Add entries for elf32-sh64-lin.c and
5743         elf64-sh64-lin.c. Regenerate.
5744         * Makefile.in: Regenerate.
5745         * config.bfd: Change sh64eb-*-linux* and sh64-*-linux*
5746         to use sh64 vectors rather than sh vectors.
5747         * configure.in: Add bfd_elf32_sh64lin_vec, bfd_elf32_sh64blin_vec,
5748         bfd_elf64_sh64lin_vec, bfd_elf64_sh64blin_vec.
5749         * configure: Regenerate.
5750         * elf32-sh64-lin.c: New file.
5751         * elf64-sh64-lin.c: New file.
5752         * targets.c: Add bfd_elf32_sh64lin_vec, bfd_elf32_sh64blin_vec,
5753         bfd_elf64_sh64lin_vec, bfd_elf64_sh64blin_vec.
5754
5755 2002-10-08  H.J. Lu <hjl@gnu.org>
5756
5757         * elf32-i386.c (elf_i386_relocate_section): Re-arrange the
5758         IE->LE transition for R_386_TLS_IE.
5759
5760 2002-10-08  Alan Modra  <amodra@bigpond.net.au>
5761
5762         * elf64-ppc.c (edit_opd): Correct test for discarded sections.
5763
5764 2002-10-07  Mark Elbrecht  <snowball3@softhome.net>
5765
5766         * cofflink.c (mark_relocs): Don't mark relocations in excluded
5767         sections.
5768
5769 2002-10-07  Alan Modra  <amodra@bigpond.net.au>
5770
5771         * elflink.h (elf_link_input_bfd): Remove BFD_VERSION_DATE dependent
5772         code.
5773
5774         * elf64-ppc.c (ppc64_elf_build_stubs): Increment .glink indx.
5775
5776 2002-10-06  Alan Modra  <amodra@bigpond.net.au>
5777
5778         * opncls.c: Formatting.
5779         (_bfd_new_bfd): Use a smaller section hash table.
5780
5781 2002-10-05  Alexandre Oliva  <aoliva@redhat.com>
5782
5783         * elfxx-mips.c (mips_elf_create_dynamic_relocation): Set the type
5784         of the other two relocations packed with a REL32 to NONE.
5785
5786 2002-10-02  Stephen Clarke <stephen.clarke@superh.com>
5787
5788         * elf32-sh.c (elf_sh_link_hash_entry): Add gotplt_refcount.
5789         (sh_elf_link_hash_newfunc): Initialize it.
5790         (allocate_dynrelocs): Transfer gotplt refs from plt.refcount
5791         to got.refcount for symbols that are forced local or when
5792         we have direct got refs.
5793         (sh_elf_gc_sweep_hook): Adjust gotplt_refcount.  Use it
5794         to correctly adjust got.refcount and plt.refcount.
5795         (sh_elf_copy_indirect_symbol): Copy gotplt_refcount across.
5796         (sh_elf_check_relocs): Increment gotplt_refcount.
5797
5798 2002-10-01  Jakub Jelinek  <jakub@redhat.com>
5799
5800         * elf32-i386.c (elf_i386_relocate_section): Fix
5801         movl foo@indntpoff, %eax IE->LE transition.
5802
5803 2002-10-01  Jakub Jelinek  <jakub@redhat.com>
5804
5805         * elf64-x86-64.c (elf64_x86_64_relocate_section): Change TLSGD
5806         sequence and its transitions.
5807
5808 2002-10-01  Jakub Jelinek  <jakub@redhat.com>
5809
5810         * elf32-i386.c (elf_i386_relocate_section): Resolve R_386_TLS_LDO_32
5811         to st_value + addend in non-code sections.
5812         * elf64-x86-64.c (elf64_x86_64_relocate_section): Resolve
5813         R_X86_64_DTPOFF32 to st_value + addend in non-code sections.
5814
5815 2002-09-30  Gavin Romig-Koch  <gavin@redhat.com>
5816             Ken Raeburn  <raeburn@cygnus.com>
5817             Aldy Hernandez  <aldyh@redhat.com>
5818             Eric Christopher  <echristo@redhat.com>
5819             Richard Sandiford  <rsandifo@redhat.com>
5820
5821         * archures.c (bfd_mach_mips4120, bfd_mach_mips5400): New.
5822         (bfd_mach_mips5500): New.
5823         * cpu-mips.c (I_mips4120, I_mips5400, I_mips5500): New.
5824         (arch_info_struct): Add corresponding entries here.
5825         * elfxx-mips.c (_bfd_elf_mips_mach): Handle E_MIPS_MACH_4120,
5826         E_MIPS_MACH_5400 and E_MIPS_MACH_5500.
5827         (_bfd_mips_elf_final_write_processing): Handle bfd_mach_mips4120,
5828         bfd_mach_mips5400 and bfd_mach_mips5500.
5829         (_bfd_mips_elf_mach_extends_p): New function.
5830         (_bfd_mips_elf_merge_private_bfd_data): Use it to help merge
5831         the EF_MIPS_MACH flags.
5832         * bfd-in2.h: Regenerate.
5833
5834 2002-09-28  Jason Thorpe  <thorpej@wasabisystems.com>
5835
5836         * elf32-vax.c (elf_vax_size_dynamic_section): Don't strip
5837         .got sections.
5838
5839 2002-09-28  Alan Modra  <amodra@bigpond.net.au>
5840
5841         * elf.c (map_sections_to_segments): Correct test for start of
5842         writable section in the same page as end of read-only section.
5843
5844 2002-09-27  Matt Thomas  <matt@3am-software.com>
5845
5846         * elf32-vax.c (elf_vax_check_relocs): Remove unused
5847         local_got_refcounts usage.  Remove allocation of got slot.
5848         (elf_vax_gc_sweep_hook): Remove unused local_got_refcounts usage.
5849         Remove de-allocation of got slot.
5850         (elf_vax_size_dynamic_section): Fix some indentation.  Add hash
5851         traversal for elf_vax_instantiate_got_entries.  Allow empty .got
5852         sections to be GC'ed.
5853         (elf_vax_instantiate_got_entries): New function.
5854         (elf_vax_relocate_section): Simplify R_VAX_GOT32 handling.  Remove
5855         tests that are now handled by elf_vax_instantiate_got_entries.
5856         Assert GOT entry falls within .got section size.  Remove redundant
5857         comparisions.  Fix comments.
5858
5859 2002-09-27  Jakub Jelinek  <jakub@redhat.com>
5860
5861         * reloc.c: Add x86-64 TLS relocs.
5862         * bfd-in2.h, libbfd.h: Rebuilt.
5863         * elf64-x86-64.c (x86_64_elf_howto): Fix size fields for 32-bit
5864         relocs.  Add TLS relocs.
5865         (x86_64_reloc_map): Add TLS relocs.
5866         (elf64_x86_64_info_to_howto): Adjust for added TLS relocs.
5867         (struct elf64_x86_64_link_hash_entry): Add tls_type field.
5868         (GOT_UNKNOWN, GOT_NORMAL, GOT_TLS_GD, GOT_TLS_IE): Define.
5869         (elf64_x86_64_hash_entry): Define.
5870         (struct elf64_x86_64_obj_tdata): New.
5871         (elf64_x86_64_tdata, elf64_x86_64_local_got_tls_type): Define.
5872         (struct elf64_x86_64_link_hash_table): Add tls_ld_got.
5873         (link_hash_newfunc): Initialize tls_type.
5874         (elf64_x86_64_link_hash_table_create): Initialize tls_ld_got.
5875         (elf64_x86_64_copy_indirect_symbol): Swap tls_type if necessary.
5876         (elf64_x86_64_mkobject): New.
5877         (elf64_x86_64_elf_object_p): Allocate struct elf64_x86_64_obj_tdata.
5878         (elf64_x86_64_tls_transition): New.
5879         (elf64_x86_64_check_relocs): Add r_type variable and use it.
5880         Handle TLS relocs.
5881         (elf64_x86_64_gc_sweep_hook): Handle TLS relocs.
5882         (allocate_dynrelocs): Allocate GOT space for TLS relocs.
5883         (elf64_x86_64_size_dynamic_sections): Likewise.
5884         (dtpoff_base, tpoff): New.
5885         (elf64_x86_64_relocate_section): Handle TLS relocs.
5886         (elf64_x86_64_finish_dynamic_symbol): Only handle non-TLS GOT
5887         entries.
5888         (bfd_elf64_mkobject): Define.
5889
5890         * elf32-i386.c (elf_i386_check_relocs) [R_386_TLS_LE]: Set
5891         DF_STATIC_TLS if shared.
5892
5893 2002-09-26  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
5894
5895         * elfxx-mips.c (_bfd_mips_elf_fake_sections): Don't emit unneeded
5896         empty relocation sections.
5897
5898 2002-09-26  Alan Modra  <amodra@bigpond.net.au>
5899
5900         * elf64-ppc.c (ppc_build_one_stub): Don't build glink stubs here.
5901         (ppc64_elf_build_stubs): Build them here instead.
5902
5903 2002-09-24  Jakub Jelinek  <jakub@redhat.com>
5904
5905         * elf32-sparc.c (elf32_sparc_relocate_section): Put R_SPARC_RELATIVE
5906         addend into r_addend, not *r_offset.
5907         (elf32_sparc_finish_dynamic_symbol): Likewise.
5908         * elf64-sparc.c (sparc64_elf_finish_dynamic_symbol): Clear xword at
5909         R_SPARC_RELATIVE's r_offset.
5910
5911 2002-09-23  Nathan Tallent  <eraxxon@alumni.rice.edu>
5912
5913         * dwarf2.c (decode_line_info): Update to correctly decode
5914         the (non-standard DWARF2) out-of-order address sequences
5915         generated by the Intel C++ 6.0 compiler for ia64-Linux.
5916
5917 2002-09-23  Mark Elbrecht  <snowball3@softhome.net>
5918
5919         * config.bfd: For DJGPP targets, match with any cpu and any machine.
5920
5921 2002-09-23  Alan Modra  <amodra@bigpond.net.au>
5922
5923         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Zero relocs
5924         for discarded FDEs.  Remove redundant assignment.
5925         * elflink.h (elf_bfd_discard_info): Save edited relocs.
5926
5927 2002-09-22  H.J. Lu <hjl@gnu.org>
5928
5929         * elf64-alpha.c (elf64_alpha_merge_ind_symbols): Don't merge
5930         the relocation count between different .reloc sections.
5931
5932 2002-09-21  Alan Modra  <amodra@bigpond.net.au>
5933
5934         * elf32-ppc.c (ppc_elf_relocate_section): Allow ".sbss.*" and
5935         ".sdata.*" for R_PPC_SDAREL16, ".sbss2*" and ".sdata2*" for
5936         R_PPC_EMB_SDA2REL.  Similarly for R_PPC_EMB_SDA21 and
5937         R_PPC_EMB_RELSDA.
5938
5939         * elfcode.h (elf_slurp_reloc_table_from_section): Make "symcount"
5940         unsigned.  Move "symcount" assignment out of loop.
5941         * Makefile.am: Run "make dep-am".
5942         * Makefile.in: Regenerate.
5943         * configure: Regenerate.
5944         * po/SRC-POTFILES.in: Regnerate.
5945
5946 2002-09-19  Nathan Tallent  <eraxxon@alumni.rice.edu>
5947
5948         * dwarf2.c (_bfd_dwarf2_find_nearest_line): If address length is
5949         zero, set it to 8 for (non-standard) 64-bit DWARF2 formats
5950         (e.g. IRIX64).
5951
5952 2002-09-19  Jakub Jelinek  <jakub@redhat.com>
5953
5954         * elf32-ppc.c (ppc_elf_finish_dynamic_symbol): Clear .got word
5955         even if generating R_PPC_RELATIVE reloc.
5956         (ppc_elf_relocate_section): Make sure relocation is performed
5957         if skip == -2.  Clear memory at r_offset when creating dynamic
5958         relocation.
5959
5960 2002-09-19  Jakub Jelinek  <jakub@redhat.com>
5961
5962         * reloc.c (BFD_RELOC_386_TLS_TPOFF, BFD_RELOC_386_TLS_IE,
5963         BFD_RELOC_386_TLS_GOTIE): Add.
5964         * bfd-in2.h, libbfd.h: Rebuilt.
5965         * elf32-i386.c (elf_howto_table): Add R_386_TLS_TPOFF, R_386_TLS_IE
5966         and R_386_TLS_GOTIE.
5967         (elf_i386_reloc_type_lookup): Handle it.
5968         (struct elf_i386_link_hash_entry): Change tls_type type to unsigned
5969         char instead of enum, change GOT_* into defines.
5970         (GOT_TLS_IE_POS, GOT_TLS_IE_NEG, GOT_TLS_IE_BOTH): Define.
5971         (elf_i386_tls_transition): Handle R_386_TLS_IE and R_386_TLS_GOTIE.
5972         (elf_i386_check_relocs): Likewise.  Avoid crash if local symbol is
5973         accessed both as normal and TLS symbol.  Move R_386_TLS_LDM and
5974         R_386_PLT32 cases so that R_386_TLS_IE can fall through.
5975         Handle R_386_TLS_LE_32 and R_386_TLS_LE in shared libs.
5976         (elf_i386_gc_sweep_hook): Handle R_386_TLS_IE and R_386_TLS_GOTIE.
5977         Handle R_386_TLS_LE_32 and R_386_TLS_LE in shared libs.
5978         (allocate_dynrelocs): Allocate 2 .got and 2 .rel.got entries if
5979         tls_type is GOT_TLS_IE_BOTH.
5980         (elf_i386_size_dynamic_sections): Likewise.
5981         (elf_i386_relocate_section): Handle R_386_TLS_IE and R_386_TLS_GOTIE.
5982         Handle R_386_TLS_LE_32 and R_386_TLS_LE in shared libs.
5983         (elf_i386_finish_dynamic_symbol): Use tls_type & GOT_TLS_IE to catch
5984         all 4 GOT_TLS_* TLS types.
5985
5986 2002-09-19  Nick Clifton  <nickc@redhat.com>
5987
5988         * elflink.h (elf_fix_symbol_flags): When examining weak symbols,
5989         follow indirect links.
5990
5991 2002-09-19  Nathan Tallent  <eraxxon@alumni.rice.edu>
5992
5993         * ecoffswap.h (ecoff_swap_pdr_in) <isym, iline>: Update to
5994         correctly sign-extend 32-bit ECOFF null values (0xffffffff, -1)
5995         on 64 bit machines.
5996         (ecoff_swap_sym_in) <iss>: Likewise.
5997         * ecoff.c (_bfd_ecoff_slurp_symbolic_info): Fix error reading
5998         ECOFF information: 'ioptMax' refers to the actual *size*
5999         of the optimization symtab, not the number of entries.
6000
6001 2002-09-19  Daniel Jacobowitz  <drow@mvista.com>
6002
6003         * elf32-arm.h (elf32_arm_adjust_dynamic_symbol): Update
6004         ELF_LINK_HASH_NEEDS_PLT logic.
6005
6006 2002-09-18  Daniel Jacobowitz  <drow@mvista.com>
6007
6008         * elfcode.h (elf_slurp_reloc_table_from_section): Check
6009         correct relocation count.
6010
6011 2002-09-17  Daniel Jacobowitz  <drow@mvista.com>
6012
6013         * bfd-in.h (bfd_get_dynamic_symcount): Define.
6014         * bfd.c (struct _bfd): Add dynsymcount.
6015         * bfd-in2.h: Regenerated.
6016         * elf.c (_bfd_elf_canonicalize_dynamic_symtab): Set
6017         abfd->dynsymcount.
6018         * elfcode.h (elf_slurp_reloc_table_from_section): Check
6019         for overflow.
6020
6021 2002-09-17  Stan Cox <scox@redhat.com>
6022
6023         * elf64-mips.c (mips_elf64_be_swap_reloca_out): Handle type2 and type3.
6024         (mips_elf64_final_gp): Don't make up gp value.
6025         * elfn32-mips.c (mips_elf_final_gp): Likewise.
6026         * elfxx-mips.c (_bfd_mips_elf_final_link): Always create
6027         .MIPS.options/.options section.
6028
6029 2002-09-17  David O'Brien  <obrien@FreeBSD.org>
6030
6031         * elf32-i386-fbsd.c: Always label using the EI_OSABI method.
6032         It is benign for FreeBSD < 4.1.  Minor reformatting.
6033         * elf64-alpha-fbsd.c: Likewise.
6034
6035 2002-09-17  Jakub Jelinek  <jakub@redhat.com>
6036
6037         * elf32-i386.c (elf_i386_relocate_section) [R_386_TLS_TPOFF32]: Negate
6038         addend.
6039
6040 2002-09-17  Alan Modra  <amodra@bigpond.net.au>
6041
6042         * elf64-alpha.c (alpha_elf_size_info): Make static.
6043
6044 2002-09-17  Svein E. Seldal  <Svein.Seldal@solidas.com>
6045
6046         * coff-tic4x.c: Add function declarations and ATTRIBUTE_UNUSED.
6047         * cpu-tic4x.c: Ditto.
6048
6049 2002-09-17  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
6050
6051         * elf64-mips.c (define elf_backend_ignore_discarded_relocs): Remove
6052         duplicate define.
6053
6054 2002-09-16  Bruno Haible  <bruno@clisp.org>
6055
6056         * elf32-i386.c: Don't defined ELF_ARCH etc. if this file is included
6057         by a target variant implementation.
6058         * elf64-alpha.c: Likewise.
6059         * elf32-i386-fbsd.c: New file.
6060         * elf64-alpha-fbsd.c: New file.
6061         * targets.c: Support bfd_elf32_i386_freebsd_vec and
6062         bfd_elf64_alpha_freebsd_vec.
6063         * configure.in: Accept the vectors bfd_elf32_i386_freebsd_vec,
6064         bfd_elf64_alpha_freebsd_vec.
6065         * Makefile.am (BFD32_BACKENDS): Add elf32-i386-fbsd.lo.
6066         (BFD32_BACKENDS_CFILES): Add elf32-i386-fbsd.c.
6067         (BFD64_BACKENDS): Add elf64-alpha-fbsd.lo.
6068         (BFD64_BACKENDS_CFILES): Add elf64-alpha-fbsd.c.
6069         (elf32-i386-fbsd.lo, elf64-alpha-fbsd.lo): Add dependencies.
6070         * config.bfd: For FreeBSD targets, set targ_defvec to a FreeBSD
6071         specific targets. Define OLD_FREEBSD_ABI_LABEL if appropriate.
6072
6073 2002-09-12  Jakub Jelinek  <jakub@redhat.com>
6074
6075         * elf32-i386.c (dtpoff_base, tpoff): Don't crash if tls_segment is
6076         NULL.
6077         (elf_i386_relocate_section): Return false after printing error about
6078         unresolvable relocation.
6079
6080 2002-09-12  Nick Clifton  <nickc@redhat.com>
6081
6082         * elf32-arm.h (elf32_arm_final_link_relocate): Fix handling of
6083         R_ARM_THM_PC11.
6084
6085 2002-09-11  Jeffrey Law  <law@redhat.com>
6086
6087         * elf32-h8300.c (elf32_h8_relax_section): Fix typo.
6088
6089 2002-09-11  Andrew Haley  <aph@cambridge.redhat.com>
6090
6091         * elf.c (_bfd_elf_find_nearest_line): Check functionname_ptr and
6092         line_ptr before deciding we've found a symbol.
6093
6094 2002-09-11  Nick Clifton  <nickc@redhat.com>
6095
6096         * po/da.po: New Danish translation file.
6097         * configure.in (LINGUAS): Add 'da'.
6098         * configure: Regenerate.
6099
6100 2002-09-10  Michael Snyder  <msnyder@redhat.com>
6101
6102         * irix-core.c (do_sections, do_sections64): New functions.
6103         (irix_core_core_file_p): Call new functions do_sections,
6104         do_sections64, depending on corefile (32-bit or 64-bit).
6105
6106 2002-09-09  Richard Henderson  <rth@redhat.com>
6107
6108         * elfxx-ia64.c (elfNN_ia64_relax_section): Handle PCREL21M
6109         and PCREL21F like PCREL21B.
6110
6111 2002-09-04  Kevin Buettner  <kevinb@redhat.com>
6112
6113         * config.bfd (mips*-*-irix6*): Add new ABI vectors.  Make n32 default
6114         vector.
6115
6116 2002-09-02  Nick Clifton  <nickc@redhat.com>
6117
6118         * elf32-v850.c (v850_elf_final_link_relocate): Use helpful
6119         names instead of cryptically overloaded bfd_reloc error
6120         codes.
6121         (v850_elf_relocate_section): Likewise.
6122         (v850_elf_relax_section): Replace caching of external symbols
6123         with caching of internal symbols obtained from calling
6124         bfd_elf_get_elf_syms().
6125         Fixup problems with freeing cached allocated memory blocks.
6126
6127 2002-09-02  Alan Modra  <amodra@bigpond.net.au>
6128
6129         * cpu-pj.c (scan_mach, compatible, arch_info_struct): Remove.
6130         (bfd_pj_arch): Use bfd_default_scan.
6131         * cpu-v850.c (scan): Remove.
6132         (N): Use bfd_default_scan.
6133         * cpu-z8k.c (scan_mach): Remove.
6134         (arch_info_struct, bfd_z8k_arch): Reorganize so that the default is
6135         first.  Use bfd_default_scan.
6136
6137         * ecoff.c (_bfd_ecoff_set_arch_mach_hook): Don't use hard-coded
6138         bfd_mach constants.
6139         (ecoff_get_magic): Likewise.
6140         * elf32-v850.c (v850_elf_object_p): Likewise.
6141         (v850_elf_final_write_processing): Likewise.
6142         * mipsbsd.c (MY(set_arch_mach)): Likewise.
6143         (MY(write_object_contents)): Likewise.
6144         * coff64-rs6000.c (xcoff64_write_object_contents): Likewise.
6145         * coffcode.h (coff_write_object_contents): Likewise.
6146         (coff_set_arch_mach_hook): Add comment describing machine == 0.
6147         Remove unnecessary "machine" assignments.
6148         (coff_write_relocs): Test for the absolute section sym by testing
6149         section and flags.
6150
6151         * aoutx.h (NAME(aout,machine_type)): Recognize bfd_mach_i386_i386
6152         and bfd_mach_i386_i386_intel_syntax.
6153         * pdp11.c (NAME(aout,machine_type)): Likewise.
6154
6155 2002-08-30  John David Anglin  <dave@hiauly1.hia.nrc.ca>
6156
6157         * bfd-in.h (align_power): Cast constants to bfd_vma type.
6158         * bfd-in2.h (align_power): Likewise.
6159
6160 2002-08-30  Alan Modra  <amodra@bigpond.net.au>
6161
6162         * Makefile.am: Run "make dep-am".
6163         * Makefile.in: Regenerate.
6164
6165         * cpu-avr.c (compatible): Don't use hard-coded mach constants.
6166         * cpu-powerpc.c (powerpc_compatible): Likewise.
6167         * cpu-rs6000.c (rs6000_compatible): Likewise.
6168
6169 2002-08-28  Catherine Moore  <clm@redhat.com>
6170
6171         * elf32-v850.c (v850_elf_reloc_map): Add new relocs.
6172         (v850-elf-reloc): Don't resolve pc relative relocs.
6173         (v850_elf_ignore_reloc): New routine.
6174         (v850_elf_final_link_relocate): Handle new relocs.
6175         (v850_elf_relax_delete_bytes ): New routine.
6176         (v850_elf_relax_section): New routine.
6177         (bfd_elf32_bfd_relax_section): Define.
6178         (HOWTO): New entries for new relocs.
6179         * reloc.c (BFD_RELOC_V850_LONGCALL): New reloc.
6180         (BFD_RELOC_V850_LONGJUMP): New reloc.
6181         (BFD_RELOC_V850_ALIGN): New reloc.
6182         * archures.c: Remove redundant v850ea architecture.
6183         * cpu-v850.c: Remove redundant v850ea support.
6184         * libbfd.h: Regenerate.
6185         * bfd-in2.h: Regenerated.
6186
6187 2002-08-28  Svein E. Seldal  <Svein.Seldal@solidas.com>
6188
6189         * config.bfd: Add tic4x-*-*coff* and c4x-*-*coff* target.
6190         * configure.in: Add tic4x_coff vector files.
6191         * configure: Regenerate.
6192         * Makefile.am: Add tic4x target.
6193         * Makefile.in: Regenerate.
6194
6195 2002-08-27  Michael Hayes <m.hayes@elec.canterbury.ac.nz>
6196
6197         * archures.c: Add the BFD arch type tic4x.
6198         * bfd-in.h: Add BFD_IN_MEMORY flag.
6199         * coff-tic4x.c: New file.
6200         * coffswap.h (coff_swap_sym_out): Add preadjuster.
6201         * cpu-tic4x.c: New file.
6202         * targets.c: Added tic4x- in list of xvecs.
6203         * ticoff.h: New file.
6204         * bfd-in2.h: Regenerate.
6205
6206 2002-08-27  Adam Nemet  <anemet@lnxw.com>
6207
6208         * elf32-arm.h (elf32_arm_finish_dynamic_sections): Set the last
6209         bit of DT_INIT and DT_FINI for Thumb functions.
6210
6211 2002-08-26  Alan Modra  <amodra@bigpond.net.au>
6212
6213         * coffcode.h (coff_set_arch_mach_hook): Handle W65MAGIC.
6214
6215 2002-08-26  Alan Modra  <amodra@bigpond.net.au>
6216
6217         * aoutx.h (NAME(aout,reloc_type_lookup)): Handle BFD_RELOC_8.
6218
6219 2002-08-24  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
6220
6221         * elf32-sh.c (sh_elf_copy_indirect_symbol): New.
6222         (create_got_section, allocate_dynrelocs, readonly_dynrelocs):
6223         Likewise.
6224         (struct elf_sh_pcrel_relocs_copied): Removed.
6225         (struct elf_sh_dyn_relocs): New.
6226         (struct elf_sh_link_hash_entry): Replace pcrel_relocs_copied
6227         field with dyn_relocs.
6228         (struct elf_sh_link_hash_table): Add short-cuts to get dynamic
6229         sections and sym_sec.
6230         (sh_elf_link_hash_newfunc): Clear dyn_relocs.
6231         (sh_elf_link_hash_table_create): Clear shorts-cuts and sym_sec.
6232         (sh_elf_create_dynamic_sections): Use create_got_section instead
6233         of _bfd_elf_create_got_section.
6234         (sh_elf_check_relocs): Likewise.
6235         (sh_elf_create_dynamic_sections): Use short-cuts to the dynamic
6236         sections.
6237         (sh_elf_adjust_dynamic_symbol, sh_elf_size_dynamic_sections,
6238         sh_elf_relocate_section, sh_elf_check_relocs,
6239         sh_elf_finish_dynamic_symbol, sh_elf_finish_dynamic_sections):
6240         Likewise.
6241         (sh_elf_adjust_dynamic_symbol): Handle nocopyreloc. Keep the
6242         dynamic relocations and avoiding the copy relocation when we
6243         didn't find any dynamic relocations in the section which has
6244         contents or is read-only.
6245         (WILL_CALL_FINISH_DYNAMIC_SYMBOL): New.
6246         (sh_elf_size_dynamic_sections): Don't reset the size of
6247         .rela.got section even if dynamic_sections_created flag is off.
6248         Don't use sh_elf_discard_copies. Scan all input bfd and use
6249         allocate_dynrelocs. Call readonly_dynrelocs to determine
6250         whether we need DT_TEXTREL.
6251         (sh_elf_adjust_dynamic_symbol): Use plt.refcount to determine
6252         whether the symbol was never referred to.
6253         (sh_elf_relocate_section): Use WILL_CALL_FINISH_DYNAMIC_SYMBOL.
6254         (sh_elf_gc_sweep_hook): Fill with the real sweep function.
6255         (sh_elf_check_relocs): Call create_got_section if the short-cut
6256         to .got is null. Increment reference counters only instead of
6257         allocating space on dynamic sections here. Don't conditionalize
6258         uninitialized got.offset value when marking the symbol as a
6259         global offset table entry. Keep relocations for symbols satisfied
6260         by a dynamic library to avoid copy relocations for the symbol.
6261         Set dynobj field of an elf hash table if needed.
6262         (sh_elf_finish_dynamic_sections): Handle null section pointer
6263         correctly.
6264         (elf_backend_copy_indirect_symbol): Defined.
6265         (elf_backend_can_refcount): Defined.
6266
6267 2002-08-23  Nick Clifton  <nickc@redhat.com>
6268
6269         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Undo
6270         previous change.  Add comment explaining why.
6271
6272 2002-08-23  Stephen Clarke <stephen.clarke@superh.com>
6273
6274         * elf32-sh.c (elf_sh_plt0_entry_be, elf_sh_plt0_entry_le): Copy
6275         contents of .got.plt[2] to tr0, not address of .got.plt.
6276         (sh_elf_finish_dynamic_symbol): Do not apply GOT_BIAS when
6277         patching absolute plt entry. For shmedia plt entry, set bottom bit
6278         of branch to plt0 as this is a branch to an shmedia instruction.
6279         * elf64-sh64.c (elf_sh64_plt0_entry_be, elf_sh64_plt0_entry_le):
6280         Copy contents of .got.plt[2] to tr0, not address of .got.plt.
6281         (elf_sh64_plt_entry_be, elf_sh64_plt_entry_le): Use ptrel to
6282         branch to plt0.
6283         (sh64_elf64_finish_dynamic_symbol): Do not apply GOT_BIAS when
6284         patching absolute plt entry. For shmedia plt entry, branch to
6285         plt0 is now ptrel, so use relative offset.  Set bottom bit of
6286         branch target as it is a branch to an shmedia instruction.
6287
6288 2002-08-23  Stephen Clarke <stephen.clarke@superh.com>,
6289             Richard Shann <richard.shann@superh.com>
6290
6291         * elf32-sh.c (sh_elf_finish_dynamic_sections): Set LSB of DT_INIT
6292         value if .init is an SHmedia function.  Similarly for DT_FINI.
6293         * elf64-sh64.c (sh64_elf64_finish_dynamic_sections): Likewise.
6294
6295 2002-08-23  Stephen Clarke <stephen.clarke@superh.com>
6296
6297         * elf32-sh.c (sh_elf_size_dynamic_sections): Zero initialize
6298         dynamic section.
6299         * elf64-sh64.c (sh64_elf64_size_dynamic_sections): Likewise.
6300
6301 2002-08-22  Kaz Kojima <kkojima@rr.iij4u.or.jp>
6302
6303         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Use a simple
6304         byte read when reading the return address register column.
6305
6306 2002-08-22  Nick Clifton  <nickc@redhat.com>
6307
6308         * config.bfd: Add powepc64-*-*bsd* target.
6309
6310 2002-08-22  Graeme Peterson  <gp@qnx.com>
6311
6312         * Makefile.am: Add entries for elf32-shqnx.c
6313         * Makefile.in: Regenerate.
6314         * config.bfd: Add support sh-*-nto* target.
6315         * configure.in: Add support for bfd_elf32_sh{l}qnx_vec.
6316         * configure: Regenerate.
6317         * elf32-qnx.h: Changed typo "elf_i386qnx_*" to "elf_qnx_*" .
6318         * elf32-sh.c: Do not include elf32-target.h if
6319         ELF32_SH_C_INCLUDED is defined.
6320         * elf32-shqnx.c: New file: Support for QNX.
6321         * targets.c: Add bfd_elf32_sh{l}qnx_vec.
6322
6323 2002-08-22  Nick Clifton  <nickc@redhat.com>
6324
6325         * po/tr.po: Updated Turkish translation.
6326
6327         * syms.c (_bfd_generic_read_minisymbols): Set bfd_error if the
6328         symbols are not read.
6329
6330 2002-08-22  Alan Modra  <amodra@bigpond.net.au>
6331
6332         * elf32-m68hc11.c: Formatting fixes.
6333         (elf32_m68hc11_gc_mark_hook): Correct params.  Remove unnecessary test.
6334         * elf32-m68hc12.c: Formatting fixes.
6335         (elf32_m68hc11_gc_mark_hook): Correct params.  Remove unnecessary test.
6336
6337 2002-08-22  Alan Modra  <amodra@bigpond.net.au>
6338
6339         * coff-rs6000.c (rs6000coff_vec <object_flags>): Add SEC_CODE and
6340         SEC_DATA.
6341         (pmac_xcoff_vec): Likewise.
6342         * coff64-rs6000.c (rs6000coff64_vec): Likewise.
6343         (aix5coff64_vec): Likewise.
6344
6345 2002-08-22  Alan Modra  <amodra@bigpond.net.au>
6346
6347         * elf-bfd.h (struct elf_backend_data): Add struct elf_backend_data
6348         param to elf_backend_copy_indirect_symbol.
6349         (_bfd_elf_link_hash_copy_indirect): Likewise.
6350         * elflink.h (elf_add_default_symbol, elf_fix_symbol_flags): Adjust
6351         calls to copy_indirect_symbol.
6352         * elf32-hppa.c (elf32_hppa_copy_indirect_symbol): Likewise.
6353         * elf32-i386.c (elf_i386_copy_indirect_symbol): Likewise.
6354         * elf32-s390.c (elf_s390_copy_indirect_symbol): Likewise.
6355         * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Likewise.
6356         * elf64-s390.c (elf_s390_copy_indirect_symbol): Likewise.
6357         * elf64-x86-64.c (elf64_x86_64_copy_indirect_symbol): Likewise.
6358         * elfxx-ia64.c (elfNN_ia64_hash_copy_indirect): Likewise.
6359         * elfxx-mips.c (_bfd_mips_elf_copy_indirect_symbol): Likewise.
6360         * elfxx-mips.h (_bfd_mips_elf_copy_indirect_symbol): Likewise.
6361         * elf.c (_bfd_elf_link_hash_copy_indirect): Likewise.  Properly
6362         test refcounts for "used" values.
6363
6364 2002-08-21  John David Anglin  <dave@hiauly1.hia.nrc.ca>
6365
6366         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Add PARAMS to
6367         argument declaration.
6368
6369 2002-08-19  Elena Zannoni <ezannoni@redhat.com>
6370
6371         * archures.c (bfd_mach_ppc_e500): Added.
6372         * bfd-in2.h: Rebuilt.
6373         * cpu-powerpc.c (bfd_powerpc_archs): Added e500.
6374
6375 2002-08-19  Alan Modra  <amodra@bigpond.net.au>
6376
6377         * elf32-m68hc12.c (elf_backend_can_gc_sections): False.
6378
6379 2002-08-17  Andrew Cagney  <ac131313@redhat.com>
6380
6381         * elf.c (bfd_elf_get_elf_syms): Change type of `esym' to
6382         `bfd_byte'.
6383
6384 2002-08-17  Stan Cox  <scox@redhat.com>
6385
6386         * elfxx-mips.c (_bfd_mips_elf_modify_segment_map): Use the
6387         IRIX 6 segment layout for NEWABI.
6388
6389 2002-08-16  Stephen Clarke <stephen.clarke@superh.com>
6390
6391         * elf32-sh.c (sh_elf_gc_mark_hook): For sh64, skip indirect
6392         symbols when looking for section referred to by a relocation.
6393         * elf64-sh.c (sh_elf64_gc_mark_hook): Likewise.
6394
6395 2002-08-15  Alan Modra  <amodra@bigpond.net.au>
6396
6397         * elf32-i370.c: Move reloc enum to include/elf/i370.h.
6398
6399 2002-08-15  Hans-Peter Nilsson  <hp@axis.com>
6400
6401         * elf32-cris.c (elf_cris_discard_excess_program_dynamics): Add
6402         missing check for whether the symbol is referenced by DSO before
6403         unexporting it as an unneeded dynamic symbol.
6404
6405 2002-08-14  H.J. Lu <hjl@gnu.org>
6406
6407         * libbfd.h: Regenerate.
6408
6409 2002-08-14  H.J. Lu <hjl@gnu.org>
6410
6411         * config.bfd: Always add 64bit vectors to 32bit Linux/mips.
6412
6413 2002-08-14  Stephane Carrez  <stcarrez@nerim.fr>
6414
6415         * elf32-m68hc11.c (m68hc11_relax_group): New to relax group of
6416         instructions.
6417         (m68hc11_direct_relax): New to define table of relaxable instructions.
6418         (find_relaxable_insn): New, find a relaxable insn.
6419         (compare_reloc): New to compare two relocs.
6420         (m68hc11_elf_relax_section): New, relax text sections.
6421         (m68hc11_elf_relax_delete_bytes): New, delete bytes and adjust branchs.
6422         (elf32_m68hc11_check_relocs): New function for GC support.
6423         (elf32_m68hc11_relocate_section): New function for GC support.
6424         (bfd_elf32_bfd_relax_section): Define to support linker relaxation.
6425         (elf_backend_check_relocs): Likewise.
6426         (elf_backend_relocate_section): Likewise.
6427
6428 2002-08-13  H.J. Lu <hjl@gnu.org>
6429
6430         * elflink.h (NAME(bfd_elf,size_dynamic_sections): Don't count
6431         definitions in shared objects when checking symbol with
6432         undefined version.
6433
6434 2002-08-13  Stephane Carrez  <stcarrez@nerim.fr>
6435
6436         * elf32-m68hc11.c (elf32_m68hc11_gc_mark_hook): New for section GC.
6437         (elf32_m68hc11_gc_sweep_hook): Likewise.
6438         (elf_backend_gc_mark_hook): Define for GC section support.
6439         (elf_backend_gc_sweep_hook): Likewise.
6440         (elf_backend_can_gc_sections): Likewise.
6441
6442         * elf32-m68hc12.c: Likewise.
6443
6444 2002-08-13  Stephane Carrez  <stcarrez@nerim.fr>
6445
6446         * elf32-m68hc11.c (_bfd_m68hc11_elf_print_private_bfd_data): New.
6447         (_bfd_m68hc11_elf_merge_private_bfd_data): New function.
6448         (_bfd_m68hc11_elf_set_private_flags): New function.
6449         Use them to set/check/print ELF flags specific to 68HC11.
6450
6451         * elf32-m68hc12.c (_bfd_m68hc12_elf_print_private_bfd_data): New.
6452         (_bfd_m68hc12_elf_merge_private_bfd_data): New function.
6453         (_bfd_m68hc12_elf_set_private_flags): New function.
6454         Use them to set/check/print ELF flags specific to 68HC12.
6455
6456 2002-08-13  Stephane Carrez  <stcarrez@nerim.fr>
6457
6458         * elf32-m68hc11.c (elf_m68hc11_howto_table): Add the new relocs;
6459         fix masks for PC-rel relocs.
6460         (m68hc11_elf_ignore_reloc): New function.
6461
6462         * elf32-m68hc12.c (m68hc12_elf_special_reloc): New to handle specific
6463         68HC12 banked addressing relocs.
6464         (m68hc12_phys_addr): New to compute physical address of banked memory.
6465         (m68hc12_phys_page): Likewise for page.
6466         (m68hc12_addr_is_banked): New to see if address is in banked area.
6467         (elf_m68hc12_howto_table): Add new relocs and rename to xx12.
6468
6469 2002-08-13  Stephane Carrez  <stcarrez@nerim.fr>
6470
6471         * reloc.c (BFD_RELOC_M68HC11_RL_JUMP, BFD_RELOC_M68HC11_RL_GROUP,
6472         BFD_RELOC_M68HC11_LO16, BFD_RELOC_M68HC11_PAGE,
6473         BFD_RELOC_M68HC11_24): New relocs for 68HC11/68HC12.
6474         * bfd-in2.h: Regenerate.
6475
6476 2002-08-12  H.J. Lu <hjl@gnu.org>
6477
6478         * elflink.h (elf_add_default_symbol): Preserve section across
6479         elf_merge_symbol.
6480
6481 2002-08-09  Graeme Peterson  <gp@qnx.com>
6482
6483         * Makefile.am: Add entries for elf32-ppcqnx.c, and add
6484         elf32-qnx.h dependency to elfarmqnx-nabi.c and elf32-i386qnx.c.
6485         * Makefile.in: Regenerate.
6486         * config.bfd: Add support for powerpc{le}-*-nto targets.
6487         * configure.in: Add support for bfd_elf32_powerpc{le}qnx_vec.
6488         * configure: Regenerate.
6489         * elf32-i386qnx.c: Moved backend functions into a QNX specific
6490         common file "elf32-qnx.h", and now include that file.
6491         * elf32-qnx.h: New file: QNX specific common elf backend.
6492         * elf32-ppc.c: Do not include elf32-target.h if
6493         ELF32_PPC_C_INCLUDED is defined.
6494         * elf32-ppcqnx.c: New file: Support for QNX.
6495         * elfarmqnx-nabi.c: Include elf32-qnx.h for qnx elf backend.
6496         * targets.c: Add bfd_elf32_powerpc{le}qnx_vec.
6497
6498 2002-08-09  Nick Clifton  <nickc@redhat.com>
6499
6500         * po/sv.po: Updated Swedish translation.
6501
6502 2002-08-09  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
6503
6504         * elfxx-mips.c (mips_elf_global_got_index): Avoid segfault if
6505         g->global_gotsym is NULL.
6506
6507 2002-08-08  H.J. Lu <hjl@gnu.org>
6508
6509         * elflink.h (elf_add_default_symbol): Don't warn if a definition
6510         overrides an indirect versioned symbol.
6511
6512 2002-08-08  Jakub Jelinek  <jakub@redhat.com>
6513
6514         * elf32-i386.c (elf_i386_relocate_section): Fill in proper addend
6515         for R_386_TLS_TPOFF32 relocs against symndx 0.
6516
6517 2002-08-07  H.J. Lu <hjl@gnu.org>
6518
6519         * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Check symbol
6520         with undefined version if needed.
6521         (elf_link_assign_sym_version): Match a default symbol with a
6522         version without definition. No need to hide the default
6523         definition separately.
6524
6525 2002-08-08  Alan Modra  <amodra@bigpond.net.au>
6526
6527         * elflink.h (elf_link_output_extsym): Don't output symbols from
6528         SEC_EXCLUDE sections.
6529
6530         * aoutx.h (aout_link_write_symbols): Correct handling of warning syms.
6531
6532 2002-08-07  Alan Modra  <amodra@bigpond.net.au>
6533
6534         * elf64-ppc.c (edit_opd): Arrange to drop symbols for discarded .opd
6535         entries.
6536
6537 2002-08-07  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
6538
6539         * elfxx-mips.c (mips_elf_create_dynamic_relocation): Cast signedness
6540         mismatch.
6541
6542 2002-08-07  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
6543
6544         * elfxx-mips.c (ABI_64_P): Remove superfluous check.
6545
6546 2002-08-07  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
6547
6548         * elf32-mips.c (mips_reloc_map): Fix typo.
6549
6550 2002-08-06  Alan Modra  <amodra@bigpond.net.au>
6551
6552         * xcofflink.c (xcoff_write_global_symbol): Set n_scnum for abs_section.
6553
6554 2002-08-06  Alan Modra  <amodra@bigpond.net.au>
6555
6556         * elf64-ppc.c (ppc64_elf_howto_raw): Zero all src_mask entries.
6557
6558 2002-08-06  Alan Modra  <amodra@bigpond.net.au>
6559
6560         * libxcoff.h: Use PARAMS on function declarations.
6561         * coff-rs6000.c (xcoff_generate_rtinit): Simplify size calc.
6562         * coff64-rs6000.c (xcoff64_generate_rtinit): Likewise.
6563
6564         * coff-rs6000.c: (xcoff_rtype2howto): Don't place reloc address in
6565         addend.
6566         * coff64-rs6000.c: (xcoff64_rtype2howto): Likewise.
6567
6568 2002-08-06  Alan Modra  <amodra@bigpond.net.au>
6569
6570         * coff-rs6000.c: Formatting fixes.
6571         (xcoff_calculate_relocation): Use PARAMS in declaration.
6572         (xcoff_complain_overflow): Likewise.
6573         (xcoff_ppc_relocate_section): Use old-style function pointer call.
6574         (bfd_xcoff_backend_data): Remove useless comments.
6575         (rs6000coff_vec): Likewise.
6576         (bfd_pmac_xcoff_backend_data): Likewise.
6577         (pmac_xcoff_vec): Likewise.
6578
6579         * coff64-rs6000.c: Formatting fixes.
6580         (xcoff64_calculate_relocation): Use PARAMS in declaration.
6581         (xcoff64_ppc_relocate_section): Use old-style function pointer call.
6582         (bfd_xcoff_backend_data): Remove useless comments.
6583         (rs6000coff64_vec): Likewise.
6584         (bfd_xcoff_aix5_backend_data): Likewise.
6585         (aix5coff64_vec): Likewise.
6586
6587 2002-08-06  Alan Modra  <amodra@bigpond.net.au>
6588
6589         * coff-rs6000.c (xcoff_howto_table): Revert some of last change to
6590         mask entries.  Use complain_overflow_dont for R_REF.
6591         (xcoff_reloc_type_ba): Revert last change.
6592         (xcoff_reloc_type_br): Likewise.
6593         (xcoff_reloc_type_crel): Likewise.
6594         (xcoff_ppc_relocate_section): Likewise.
6595         * coff64-rs6000.c (xcoff64_reloc_type_br): Likewise.
6596         (xcoff64_ppc_relocate_section): Likewise.
6597         (xcoff64_howto_table): Revert some of last change to mask entries.
6598         Use complain_overflow_dont for R_REF.
6599
6600         * coff-rs6000.c (xcoff_howto_table): Fix src_mask entries.  Make all
6601         relocs with bitsize == 16 have size = 1.
6602         (xcoff_reloc_type_ba): Correct src_mask and dst_mask adjustment.
6603         (xcoff_reloc_type_br): Likewise.
6604         (xcoff_reloc_type_crel): Likewise.
6605         (xcoff_ppc_relocate_section): Set up src_mask and dst_mask correctly.
6606         * coff64-rs6000.c (xcoff64_reloc_type_br): Correct src_mask and
6607         dst_mask adjustment.
6608         (xcoff64_ppc_relocate_section): Set up src_mask and dst_mask correctly.
6609         (xcoff64_howto_table): Fix src_mask entries.  Make all relocs with
6610         bitsize == 16 have size = 1.
6611
6612 2002-08-01  Denis Chertykov  <denisc@overta.ru>
6613
6614         * elf32-ip2k.c: Processor manufacturer changed to Ubicom.
6615         (struct misc): New field isymbuf. All free_* fields removed.
6616         (symbol_value): Pass in internal syms. No need to swap syms in.
6617         (ip2k_elf_relax_section): Use bfd_elf_get_elf_syms. Properly free
6618         possibly cached info.
6619         (tidyup_after_error): Removed.
6620         (ip2k_elf_relax_section_pass1): Don't use removed fields of struct
6621         misc. Use new field.
6622         (adjust_all_relocations): Use internal syms. No need to swap syms
6623         in and out.
6624         (add_page_insn): Don't use removed fields of struct misc.
6625
6626 2002-08-01  Nick Clifton  <nickc@redhat.com>
6627
6628         * elf32-arm.h: Revert previous delta.
6629
6630 2002-08-01  Nick Clifton  <nickc@redhat.com>
6631
6632         * configure.in (AM_INIT_AUTOMAKE): Bump version number.
6633         * configure: Regenerate.
6634
6635 2002-07-31  H.J. Lu <hjl@gnu.org>
6636
6637         * config.bfd: Add x86-64 vector to Linux/i386 if 64bit BFD is
6638         selected.
6639
6640 2002-07-31  H.J. Lu <hjl@gnu.org>
6641
6642         * config.bfd: Add n32 vectors to 32bit Linux/mips if 64bit BFD
6643         is selected.
6644
6645 2002-07-31  Jakub Jelinek  <jakub@redhat.com>
6646
6647         * elf32-i386.c (elf_i386_copy_indirect_symbol): Swap tls_type
6648         if _bfd_elf_link_hash_copy_indirect will swap got.refcount.
6649
6650 2002-07-31  Ian Dall  <ian@sibyl.beware.dropbear.id.au>
6651
6652         * cpu-ns32k.c (_bfd_ns32k_put_immdeiate, _bfd_ns32k_get_immediate):
6653         There is no 8 byte relocation type for this architecture.
6654         (do_ns32k_reloc): Use bfd_vma instead of native types.
6655         (bfd_ns32k_put_immediate, _bfd_ns32k_relocate_contents) put_data
6656         returns void.
6657         (_bfd_ns32k_put_displacement): Don't check for overflow. We can
6658         rely on generic code to do that.
6659         * aout-ns32k.c (howto_table): Add appropriate overflow detection
6660         to all table entries.
6661         (_bfd_ns32k_relocate_contents): put_data returns void.
6662         * ns32k.h: (_bfd_ns32k_put_displacement, _bfd_ns32k_put_immediate)
6663         (_bfd_do_ns32k_reloc_contents): Fix prototypes. put data functions
6664         return void.
6665
6666 2002-07-31  Ian Dall  <ian@sibyl.beware.dropbear.id.au>
6667
6668         * aoutx.h (aout_link_check_ar_symbols): Whether to include an
6669         archive object is target dependant.
6670
6671 2002-07-31  Adam Nemet  <anemet@lnxw.com>
6672
6673         * elf32-arm.h (ARM_PLT_ENTRY_SIZE): Rename PLT_ENTRY_SIZE.
6674         (THUMB_PLT_ENTRY_SIZE): New macro.
6675         (PLT_ENTRY_SIZE): Return the appropriate *_PLT_ENTRY_SIZE.
6676         (elf32_arm_plt0_entry): Rename PLT_ENTRY_SIZE to
6677         ARM_PLT_ENTRY_SIZE.
6678         (elf32_arm_plt_entry): Likewise.
6679         (elf_backend_plt_header_size): Likewise.
6680         (elf32_thumb_plt0_entry): New global.
6681         (elf32_arm_finish_dynamic_sections): Use it.  Put Thumb entries
6682         into .plt.thumb.
6683         (elf32_thumb_plt_entry): New global.
6684         (elf32_arm_finish_dynamic_symbol): Use it.  Use .thumb.plt for
6685         Thumb entries.  Set the bottom bit of the corresponding GOT entry
6686         for a Thumb PLT entry.
6687         (struct elf32_arm_plt_entry_info): New structure.
6688         (struct elf32_arm_link_hash_entry, plt_info): New member of this
6689         type.
6690         (elf32_arm_link_hash_newfunc): Initialize new member.
6691         (elf32_arm_final_link_relocate, R_ARM_THM_PC22 case): Handle
6692         relocations against the PLT.
6693         (elf32_arm_check_relocs, case R_ARM_PLT32 case): Set
6694         first_rel_type if this is the first time we encounter the symbol.
6695         (elf32_arm_check_relocs, case R_ARM_THM_PC22 case): New case.
6696         Determine if relocation needs a PLT entry.  Set first_rel_type if
6697         this is the first time we encounter the symbol
6698         (elf32_arm_adjust_dynamic_symbol): Create PLT entries for Thumb
6699         functions as well.
6700         (elf32_arm_size_dynamic_sections): Handle .plt.thumb like .plt.
6701         (elf32_arm_create_dynamic_sections): New function.  Create the
6702         .plt.thumb section.
6703         (elf_backend_create_dynamic_sections): Call it.
6704
6705 2002-07-31  Nick Clifton  <nickc@redhat.com>
6706
6707         * bfd.c (bfd_alt_mach_code): Rename parameter 'index' to
6708         'alternative' in order to avoid shadowing global symbol of the
6709         same name.
6710         * bfd-in2.h: Regenerate.
6711         * libbfd.h: Regenerate.
6712         * libcoff.h: Regenerate.
6713
6714 2002-07-31  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
6715
6716         * Makefile.am: Add n32 ABI support.
6717         * Makefile.in: Regenerate.
6718         * config.bfd: Add n32 vectors to mips64*-*-linux* targets. Treat 64
6719         bit vectors for mips*-*-linux targets as optional.
6720         * configure.in: Add n32 ABI vectors.
6721         * configure: Regenerate.
6722         * elf32-mips.c (mips_elf32_object_p): Reject n32 ABI files.
6723         * elfn32-mips.c: New file, n32 ABI support.
6724         * targets.c: Add n32 ABI vectors.
6725
6726 2002-07-30  Graeme Peterson  <gp@qnx.com>
6727
6728         * elfarmqnx-nabi.c: New file: Support for QNX.
6729         * config.bfd: Add support for arm-*-nto target.
6730         * configure.in: Add support for bfd_elf32_{big|little}armqnx_vec.
6731         * configure: Regenerate.
6732         * Makefile.am: Add entries for elfarmqnx-nabi.c.
6733         * Makefile.in: Regenerate.
6734         * elf32-arm.h (ELF_MAXPAGESIZE): Do not define if already defined.
6735         Do not define global function if ELFARM_NABI_C_INCLUDED is defined.
6736         * elfarm-nabi.c: Do not include elf32-arm.h if
6737         ELFARM_NABI_C_INCLUDED is defined.
6738         * targets.c: Add bfd_elf32_{big|little}armqnx_vec.
6739
6740 2002-07-30  Nick Clifton  <nickc@redhat.com>
6741
6742         * po/sv.po: Updated Swedish translation.
6743
6744 2002-07-30  Jakub Jelinek  <jakub@redhat.com>
6745
6746         * elf.c (elf_fake_sections): Fix up .tbss sh_size and sh_type.
6747
6748 2002-07-30  Alan Modra  <amodra@bigpond.net.au>
6749
6750         * aoutx.h (some_aout_object_p): Clean up tdata properly on error.
6751         * archive.c (bfd_generic_archive_p): Likewise.
6752         * coff-rs6000.c (_bfd_xcoff_archive_p): Likewise.
6753         (_bfd_xcoff_archive_p): Use bfd_scan_vma in place of strtol.
6754         * coff64-rs6000.c (xcoff64_slurp_armap): Likewise.
6755         (xcoff64_archive_p): Likewise.
6756         (xcoff64_openr_next_archived_file): Likewise.
6757         (xcoff64_archive_p): Clean up tdata properly on error.
6758         * coffgen.c (coff_real_object_p): Likewise.
6759         (coff_object_p): Release filehdr and opthdr.
6760         * ecoff.c (_bfd_ecoff_archive_p): Clean up tdata properly on error.
6761         * ieee.c (ieee_archive_p): Likewise.
6762         * ihex.c (ihex_object_p): Likewise.
6763         (ihex_mkobject): Always allocate tdata.
6764         * peicode.h (pe_ILF_object_p): Release bfd_alloc'd buffer on error.
6765         * srec.c (srec_mkobject): Always allocate tdata.
6766         (srec_object_p): Clean up tdata properly on error.
6767         (symbolsrec_object_p): Likewise.
6768         * versados.c (versados_object_p): Likewise.
6769         * vms-misc.c (_bfd_vms_get_record): Use bfd_malloc instead of malloc,
6770         and bfd_realloc instead of realloc.
6771         (add_new_contents): Use bfd_alloc instead of bfd_malloc for sections.
6772         * vms.c (vms_initialize): Always allocate tdata.  Use bfd_alloc in
6773         place of bfd_malloc, simplifying error freeing.  Free hash table too.
6774         (vms_object_p): Clean up tdata on error.
6775         (vms_mkobject): Don't complain on stderr if vms_initialize fails.
6776         (vms_close_and_cleanup): Adjust for bfd_alloc use.
6777
6778 2002-07-30  Alan Modra  <amodra@bigpond.net.au>
6779
6780         * elfxx-ia64.c (elfNN_ia64_final_write_processing): Set e_flags.
6781
6782 2002-07-26  Chris Demetriou  <cgd@broadcom.com>
6783
6784         * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Merge ASE
6785         flags into resulting BFD.
6786
6787 2002-07-26  Alan Modra  <amodra@bigpond.net.au>
6788
6789         From John Reiser <jreiser@BitWagon.com>
6790         * elf32-i386.c (elf_i386_link_hash_table_create): Clear
6791         tls_ldm_got.refcount.
6792
6793 2002-07-25  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
6794
6795         * elf64-mips.c: Update TODO comment.
6796         (mips_elf64_higher_reloc,mips_elf64_highest_reloc,
6797         mips_elf64_gprel16_reloca): Remove prototypes.
6798         (mips16_jump_reloc,mips16_gprel_reloc): Add functions.
6799         (UNUSED_RELOC): Replace by EMPTY_RELOC.
6800         (mips_elf64_howto_table_rel): Use special R_MIPS_HI16 handling. Remove
6801         wrong comments. Remove disfunctional support of R_MIPS_HIGHER and
6802         R_MIPS_HIGHEST.
6803         (mips_elf64_howto_table_rela): Fix handling of R_MIPS_GPREL16 and
6804         R_MIPS_GOT16. Remove wrong comments.
6805         (elf_mips16_jump_howto,elf_mips16_gprel_howto,
6806         elf_mips_gnu_vtinherit_howto,elf_mips_gnu_vtentry_howto): New, code
6807         from elf32-mips.c.
6808         (mips_elf64_hi16_reloc): Fix formatting.
6809         (mips_elf64_higher_reloc,mips_elf64_highest_reloc): Remove.
6810         (mips_elf64_got16_reloc): Fix formatting. Remove superfluous code.
6811         Better comment. Fall back to R_MIPS_GOT_DISP instead of abort().
6812         (mips_elf64_gprel16_reloc): Make static. Add check for
6813         partial_inplace.
6814         (mips_elf64_gprel16_reloca): Remove.
6815         (mips_elf64_literal_reloc): New function.
6816         (mips_elf64_gprel32_reloc): Fix formatting.
6817         (mips_elf64_shift6_reloc): Fix comment. Make static.
6818         (mips16_jump_reloc,mips16_gprel_reloc): New functions, code from
6819         elf32-mips.c.
6820         (elf_reloc_map,mips_reloc_map): New mapping table, similiar as in
6821         elf32-mips.c
6822         (bfd_elf64_bfd_reloc_type_lookup): Use the mapping table. Enable GNU
6823         specific relocations.
6824         (mips_elf64_rtype_to_howto): Enable GNU specific relocations.
6825         (mips_elf64_object_p): Invert logic to check for SGI-ish ABI.
6826         (ELF_MAXPAGESIZE): Add comment.
6827
6828 2002-07-25  Nick Clifton  <nickc@redhat.com>
6829
6830         * po/sv.po: Updated Swedish translation.
6831         * po/es.po: Updated Spanish translation.
6832         * po/fr.po: Updated French translation.
6833
6834 2002-07-25  Alan Modra  <amodra@bigpond.net.au>
6835
6836         * elf-bfd.h (_bfd_elf32_link_record_local_dynamic_symbol): Define
6837         as elf_link_record_local_dynamic_symbol.
6838         (_bfd_elf64_link_record_local_dynamic_symbol): Likewise.
6839         (elf_link_record_local_dynamic_symbol): Declare.  Now returns int.
6840         * elflink.h (elf_link_record_local_dynamic_symbol): Move to..
6841         * elflink.c: .. here.  Use bfd_elf_get_elf_syms.  Check whether an
6842         attempt is made to record a symbol in a discarded section, and
6843         return `2' in that case.
6844
6845 2002-07-24  Nick Clifton  <nickc@redhat.com>
6846
6847         * po/sv.po: Updated Swedish translation.
6848         * po/es.po: Updated Spanish translation.
6849
6850 2002-07-23  Alan Modra  <amodra@bigpond.net.au>
6851
6852         * po/SRC-POTFILES.in: Regenerate.
6853
6854         * elf-hppa.h (elf_hppa_relocate_section): If relocatable, return
6855         immediately.  Remove code handling relocatable linking.
6856         * elf32-avr.c (elf32_avr_relocate_section): Likewise.
6857         * elf32-cris.c (cris_elf_relocate_section): Likewise.
6858         * elf32-fr30.c (elf32_frv_relocate_section): Likewise.
6859         * elf32-frv.c (elf32_frv_relocate_section): Likewise.
6860         * elf32-h8300.c (elf32_h8_relocate_section): Likewise.
6861         * elf32-hppa.c (elf32_hppa_relocate_section): Likewise.
6862         * elf32-ip2k.c (ip2k_elf_relocate_section): Likewise.
6863         * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
6864         * elf32-v850.c (v850_elf_relocate_section): Likewise.
6865         * elf32-vax.c (elf_vax_relocate_section): Likewise.
6866         * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
6867         * elf32-avr.c (elf_backend_rela_normal): Define.
6868         * elf32-cris.c: Likewise.
6869         * elf32-fr30.c: Likewise.
6870         * elf32-frv.c: Likewise.
6871         * elf32-h8300.c: Likewise.
6872         * elf32-hppa.c: Likewise.
6873         * elf32-ip2k.c: Likewise.
6874         * elf32-sparc.c: Likewise.
6875         * elf32-v850.c: Likewise.
6876         * elf32-vax.c: Likewise.
6877         * elf64-hppa.c: Likewise.
6878         * elf64-sparc.c: Likewise.
6879         * elf32-fr30.c (elf32_frv_relocate_section): Edit comment.
6880         * elf32-frv.c (elf32_frv_relocate_section): Likewise.
6881         * elf32-i860.c (elf32_i860_relocate_section): Likewise.
6882         * elf32-ip2k.c (ip2k_elf_relocate_section): Likewise.
6883         * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
6884         * elf32-openrisc.c (openrisc_elf_relocate_section): Likewise.
6885         * elf32-xstormy16.c (xstormy16_elf_relocate_section): Likewise.
6886         * elf-m10200.c (USE_RELA): Don't define.
6887         * elf-m10300.c: Likewise.
6888         * elfarm-oabi.c: Likewise.
6889         * elf32-i370.c: Likewise.
6890         * elf32-ip2k.c: Likewise.
6891         * elf32-m68k.c: Likewise.
6892         * elf32-mcore.c: Likewise.
6893         * elf32-ppc.c: Likewise.
6894         * elf32-s390.c: Likewise.
6895         * elf32-vax.c: Likewise.
6896         * elf64-ppc.c: Likewise.
6897         * elf64-s390.c: Likewise.
6898         * elf64-x86-64.c: Likewise.
6899         * elfxx-ia64.c: Likewise.
6900         * elf32-avr.c (USE_REL): Don't undef.
6901         * elf32-ip2k.c: Likewise.
6902
6903 2002-07-23  Nick Clifton  <nickc@redhat.com>
6904
6905         * elf-bfd.h (struct elf_backend_data): Add new bitfield
6906         'want_p_paddr_set_to_zero'.
6907         * elfxx-target.h: Set default value for want_p_paddr_set_to_zero
6908         to false;
6909         * elfxx-ia64.c: Set want_p_paddr_set_zero for HPUX target.
6910         * elf.c (copy_private_bfd_data): Test want_p_paddr_set_zero.
6911
6912 2002-07-23  Gabor Keresztfalvi  <keresztg@mail.com>
6913
6914         * nlmcode.h (nlm_swap_auxiliary_headers_out): Swapped the order of
6915         the MeSsAgEs and CoPyRiGhT tags to make >=NW4.x NLM loaders to
6916         show the Copyright string.
6917         Minor formatting tidy ups.
6918
6919 2002-07-23  Nick Clifton  <nickc@redhat.com>
6920
6921         * po/fr.po: Updated French translation.
6922         * po/sv.po: Updated Swedish translation.
6923
6924 2002-07-23  Alan Modra  <amodra@bigpond.net.au>
6925
6926         * elflink.h (elf_link_input_bfd): Don't change internal symbols
6927         when outputting relocs.
6928
6929 2002-07-20  Jason Thorpe  <thorpej@wasabisystems.com>
6930
6931         * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Only insert
6932         DT_PLTGOT into the dynamic section if there is a PLT.
6933
6934 2002-07-19  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
6935
6936         * elfxx-mips.c (_bfd_mips_elf_discard_info): New function, code from
6937         elf32-mips.c.
6938         (_bfd_mips_elf_write_section): Likewise.
6939         * elfxx-mips.h (_bfd_mips_elf_discard_info): New prototype.
6940         (_bfd_mips_elf_write_section): Likewise.
6941         * elf32-mips.c (elf32_mips_discard_info): Move to elfxx-mips.c.
6942         (elf32_mips_write_section): Likewise.
6943         * elf64-mips.c (_bfd_mips_elf_ignore_discarded_relocs): Use it.
6944         (_bfd_mips_elf_write_section): Likewise.
6945
6946 2002-07-19  Alan Modra  <amodra@bigpond.net.au>
6947
6948         * elfxx-ia64.c: (elfNN_ia64_modify_segment_map): Properly scan
6949         PT_IA_64_UNWIND segments for a given section.
6950
6951 2002-07-17  H.J. Lu <hjl@gnu.org>
6952
6953         * Makefile.am: Fix a typo.
6954         * Makefile.in: Regenerate.
6955
6956 2002-07-15  Denis Chertykov  <denisc@overta.ru>
6957             Frank Ch. Eigler  <fche@redhat.com>
6958             Ben Elliston  <bje@redhat.com>
6959             Alan Lehotsky  <alehotsky@cygnus.com>
6960             John Healy  <jhealy@redhat.com>
6961             Graham Stott  <grahams@redhat.com>
6962             Jeff Johnston  <jjohnstn@redhat.com>
6963
6964         * Makefile.am: Add support for ip2k.
6965         * Makefile.in: Regenerate.
6966         * doc/Makefile.in: Regenerate.
6967         * archures.c: Add support for ip2k.
6968         * config.bfd: Add support for ip2k.
6969         * configure.in: Add support for ip2k.
6970         * configure: Regenerate.
6971         * reloc.c: Add support for ip2k.
6972         * targets.c: Add support for ip2k.
6973         * bfd-in2.h: Regenerate.
6974         * libbfd.h: Regenerate.
6975         * cpu-ip2k.c: New file.
6976         * elf32-ip2k.c: New file.
6977
6978 2002-07-17  Ian Rickards  <irickard@arm.com>
6979
6980         * dwarf2.c (concat_filename): If we can't establish the directory
6981         just return the filename.
6982
6983 2002-07-16  Moritz Jodeit  <moritz@jodeit.org>
6984
6985         * peXXigen.c (_bfd_XXi_swap_aouthdr_out): Correct order of memset args.
6986
6987 2002-07-16  Alan Modra  <amodra@bigpond.net.au>
6988
6989         * elflink.h: Formatting fixes, tidy prototypes.
6990         (elf_link_assign_sym_version): Move common code out of loop.
6991
6992 2002-07-16  Alan Modra  <amodra@bigpond.net.au>
6993
6994         * elflink.h (elf_link_input_bfd): Don't call reloc_emitter when
6995         reloc section size is zero.  Correct reloc output location.
6996
6997 2002-07-16  John David Anglin  <dave@hiauly1.hia.nrc.ca>
6998
6999         * elf-hppa.h (elf_hppa_reloc_final_type): Use R_PARISC_PCREL16F as
7000         the final type for the e_fsel selector when generating PA2.0W code.
7001         (elf_hppa_relocate_insn): Provide support for PA2.0W 16-bit format 1
7002         relocations.
7003
7004 2002-07-14  H.J. Lu <hjl@gnu.org>
7005
7006         * elflink.h (elf_link_assign_sym_version): Hide the default
7007         definition if there is a hidden versioned definition.
7008
7009 2002-07-12  Hans-Peter Nilsson  <hp@axis.com>
7010
7011         * elf32-cris.c (cris_elf_relocate_section): Drop nonsensical
7012         dynamic reference test in assertion when initializing GOT with
7013         static contents.  Just assert that there are either no dynamic
7014         sections, the symbol is defined in the regular objects or that the
7015         symbol is undef weak.  Tweak comment.
7016         (elf_cris_finish_dynamic_symbol): Emit .got reloc for a program
7017         only if the symbol isn't defined in the program and isn't undef
7018         weak.
7019         (elf_cris_adjust_dynamic_symbol): Simplify condition for getting
7020         rid of PLT entry: only do it if the symbol isn't defined in a DSO.
7021         When doing so, clear ELF_LINK_HASH_NEEDS_PLT.  Tweak comments.
7022         (elf_cris_discard_excess_program_dynamics): Don't consider
7023         ELF_LINK_HASH_REF_DYNAMIC when omitting .got runtime relocs.
7024
7025 2002-07-11  Alan Modra  <amodra@bigpond.net.au>
7026
7027         * elf32-i386.c (elf_i386_relocate_section): Don't complain about
7028         unresolved debugging relocs in dynamic applications.
7029         * elf32-s390.c (elf_s390_relocate_section): Likewise.
7030         * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
7031         * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
7032         * elf64-s390.c (elf_s390_relocate_section): Likewise.
7033         * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
7034         * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
7035
7036 2002-07-10  Alan Modra  <amodra@bigpond.net.au>
7037
7038         * elf64-ppc.c (ONES): Define.
7039         (ppc64_elf_howto_table): Use ONES here to avoid warnings.  Fill in
7040         missing src_mask fields.  Tweak R_PPC64_NONE, R_PPC64_COPY.  Fill
7041         in missing dst_mask fields on R_PPC64_PLT32, R_PPC64_PLTREL32.
7042
7043         * elf64-ppc.c (ppc64_elf_get_symbol_info): Delete.
7044         (ppc64_elf_set_private_flags): Delete.
7045         (ppc64_elf_section_from_shdr): Delete.
7046         (ppc64_elf_merge_private_bfd_data): Remove flag checking/merging code.
7047         (ppc64_elf_fake_sections): Delete.
7048         (bfd_elf64_bfd_set_private_flags): Don't define.
7049         (bfd_elf64_get_symbol_info): Likewise.
7050         (elf_backend_section_from_shdr): Likewise.
7051         (elf_backend_fake_sections): Likewise.
7052
7053 2002-07-10  Marco Walther  <Marco.Walther@sun.com>
7054
7055         * elf.c: (assign_section_numbers) Set sh_entsize for .stab only
7056         when not already set.
7057         * elf64-sparc.c: (sparc64_elf_fake_sections): New function.
7058         (elf_backend_fake_sections): Define.
7059
7060 2002-07-10  Alan Modra  <amodra@bigpond.net.au>
7061
7062         * merge.c (_bfd_merge_section): Remove redundant output_section check.
7063         Formatting.
7064         (_bfd_merge_sections): Don't set SEC_EXCLUDE on unused sections.
7065
7066 2002-07-09  Hans-Peter Nilsson  <hp@axis.com>
7067
7068         * elf32-cris.c (cris_elf_relocate_section): Move sanity-check for
7069         NULL sym_hashes to just before use.
7070         <case R_CRIS_32_GOTREL>: In test for local symbol, accept also
7071         symbol with non-default visibility.
7072         <case R_CRIS_32_GOTREL, case R_CRIS_32_PLT_GOTREL>: Ditto.
7073         <case R_CRIS_8_PCREL, case R_CRIS_16_PCREL, case R_CRIS_32_PCREL>:
7074         Ditto.
7075         (cris_elf_gc_sweep_hook): Only decrease h->plt.refcount for
7076         symbol with non-default visibility.
7077         (cris_elf_check_relocs): At tests for local symbol before
7078         increasing h->plt.refcount, also check for non-default
7079         visibility.  Ditto when checking for local symbol to eliminate
7080         pc-relative runtime relocs.
7081
7082 2002-07-08  Alan Modra  <amodra@bigpond.net.au>
7083
7084         * elf.c: Formatting.
7085         (IS_SOLARIS_PT_INTERP): Add p_paddr and p_memsz checks.
7086         (INCLUDE_SECTION_IN_SEGMENT): Remove IS_SOLARIS_PT_INTERP.
7087         (copy_private_bfd_data): Set p_vaddr on broken Solaris PT_INTERP
7088         segments.
7089
7090 2002-07-07  Mark Mitchell  <mark@codesourcery.com>
7091             Alan Modra  <amodra@bigpond.net.au>
7092
7093         * cofflink.c (_bfd_coff_final_link): On PE COFF systems, take into
7094         account the impact of relocation count overflow when computing
7095         section offsets.
7096         * coffcode.h (coff_write_relocs): Use obj_pe when deciding whether
7097         or not to apply the PE COFF reloc overflow handling.  Fix a
7098         fencepost error in deciding whether or not to use that technique.
7099
7100 2002-07-07  Alan Modra  <amodra@bigpond.net.au>
7101
7102         * elf-bfd.h (struct elf_reloc_cookie): Remove locsym_shndx,
7103         change type of locsyms.
7104         (bfd_elf_get_elf_syms): Declare.
7105         * elf.c (bfd_elf_get_elf_syms): New function.
7106         (group_signature): Use bfd_elf_get_elf_syms.
7107         (bfd_section_from_r_symndx): Likewise.
7108         * elfcode.h (elf_slurp_symbol_table): Likewise.
7109         * elflink.h (elf_link_is_defined_archive_symbol): Likewise.
7110         (elf_link_add_object_symbols): Likewise.  Reorganise to increase
7111         locality of various data structures.  Properly free internal relocs.
7112         (elf_bfd_final_link): Properly free internal relocs.
7113         (elf_link_check_versioned_symbol): Use bfd_elf_get_elf_syms.
7114         (elf_link_input_bfd): Likewise.
7115         (elf_gc_mark): Likewise.  Properly free internal relocs.
7116         (elf_gc_sweep): Properly free internal relocs.
7117         (elf_reloc_symbol_deleted_p): No need to swap syms in.
7118         (elf_bfd_discard_info): Use bfd_elf_get_elf_syms.  Properly free
7119         internal relocs.
7120         * elf-m10200.c (mn10200_elf_relax_section): Use bfd_elf_get_elf_syms.
7121         Properly free possibly cached info.
7122         (mn10200_elf_relax_delete_bytes): Remove symbol swapping code.
7123         (mn10200_elf_symbol_address_p): Pass in internal syms.  Remove
7124         symbol swapping code.
7125         (mn10200_elf_get_relocated_section_contents): Use bfd_elf_get_elf_syms.
7126         Properly free possibly cached info.
7127         * elf-m10300.c (mn10300_elf_relax_section): As above for elf-m10200.c.
7128         (mn10300_elf_relax_delete_bytes): Likewise.
7129         (mn10300_elf_symbol_address_p): Likewise.
7130         (mn10300_elf_get_relocated_section_contents): Likewise.
7131         * elf32-h8300.c (elf32_h8_relax_section): As above for elf-m10200.c.
7132         (elf32_h8_relax_delete_bytes): Likewise.
7133         (elf32_h8_symbol_address_p): Likewise.
7134         (elf32_h8_get_relocated_section_contents): Likewise.
7135         * elf32-m32r.c (m32r_elf_relax_section): As above for elf-m10200.c.
7136         (m32r_elf_relax_delete_bytes): Likewise.
7137         (m32r_elf_get_relocated_section_contents): Likewise.
7138         * elf32-sh.c (sh_elf_reloc_loop): Free section contents using
7139         elf_section_data to determine whether cached.
7140         (sh_elf_relax_section): As above for elf-m10200.c.
7141         (sh_elf_relax_delete_bytes): Likewise.
7142         (sh_elf_get_relocated_section_contents): Likewise.
7143         * elf32-xstormy16.c (xstormy16_elf_relax_section): As above.
7144         * elf64-alpha.c (elf64_alpha_relax_section): As above.  Also delay
7145         reading of local syms.
7146         * elf64-mmix.c (mmix_elf_relax_section): Likewise.
7147         * elf64-sh64.c (sh_elf64_get_relocated_section_contents): As above.
7148         * elfxx-ia64.c (elfNN_ia64_relax_section): As above.
7149         * elfxx-mips.c (_bfd_mips_elf_check_relocs): Properly free internal
7150         relocs.
7151         * elf32-arm.h (bfd_elf32_arm_process_before_allocation): Properly
7152         free internal relocs and section contents.  Don't read symbols.
7153         * elf32-hppa.c (get_local_syms): Use bfd_elf_get_elf_syms.
7154         (elf32_hppa_size_stubs): Don't free local syms.
7155         * elf32-m68k.c (bfd_m68k_elf32_create_embedded_relocs): Delay
7156         reading of local syms.  Use bfd_elf_get_elf_syms.  Properly free
7157         possibly cached info.
7158         * elf32-mips.c (bfd_mips_elf32_create_embedded_relocs): Likewise.
7159         * elf64-hppa.c (elf64_hppa_check_relocs): Use bfd_elf_get_elf_syms.
7160         * elf64-ppc.c (struct ppc_link_hash_table): Delete bfd_count and
7161         all_local_syms.
7162         (get_local_syms): Delete function.
7163         (edit_opd): Use bfd_elf_get_elf_syms.  Free on error exit.  Cache
7164         on exit.
7165         (ppc64_elf_size_stubs): Use bfd_elf_get_elf_syms.  Free/cache on exit.
7166
7167 2002-07-05  Jim Wilson  <wilson@redhat.com>
7168
7169         * syms.c (decode_section_type): New.
7170         (bfd_decode_symclass): Call decode_section_type.
7171
7172 2002-07-04  Jakub Jelinek  <jakub@redhat.com>
7173
7174         * merge.c (_bfd_merged_section_offset): Avoid accessing byte before
7175         section content start.
7176         Reported by Michael Schumacher <mike@hightec-rt.com>.
7177
7178 2002-07-04  Alan Modra  <amodra@bigpond.net.au>
7179
7180         * section.c (_bfd_strip_section_from_output): Remove unnecessary
7181         link order code.  Don't actually remove the output section here;
7182         Just set a flag for the linker to do so.
7183         * elflink.c (_bfd_elf_link_renumber_dynsyms): Test for removed
7184         sections when setting up output section dynsyms.
7185
7186 2002-07-04  Alan Modra  <amodra@bigpond.net.au>
7187
7188         * elflink.h (elf_link_add_object_symbols): Revert 1999-09-02 hpux
7189         fudge.
7190         * elf.c (bfd_section_from_shdr): Work around broken hpux shared
7191         libs here instead.
7192
7193 2002-07-02  Martin Schwidefsky  <schwidefsky@de.ibm.com>
7194
7195         * elf64-s390.c (create_got_section): Set .got section alignment to
7196         8 bytes.
7197         (elf_s390_check_relocs): Set .rela.dyn section alignment to 8 bytes.
7198
7199 2002-07-02  Alan Modra  <amodra@bigpond.net.au>
7200
7201         * elf.c (_bfd_elf_reloc_type_class): Fix comment grammar.
7202
7203 2002-07-01  Matt Thomas  <matt@3am-software.com>
7204
7205         * elf32-vax.c (elf32_vax_print_private_bfd_data): Change EF_*
7206         to EF_VAX_*.
7207
7208 2002-07-01  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
7209
7210         * elfxx-mips.c (ABI_64_P): Fix comment.
7211         (MIPS_ELF_OPTIONS_SECTION_NAME,MIPS_ELF_STUB_SECTION_NAME): Use the
7212         new section names for N64 ABI.
7213         (mips_elf_output_extsym): No special _gp_disp handling for NewABI.
7214         (mips_elf_calculate_relocation): Code formatting.
7215         (mips_elf_create_dynamic_relocation): Likewise.
7216         (_bfd_mips_elf_fake_sections): IRIX6 needs this hack, too.
7217         (_bfd_mips_elf_size_dynamic_sections): Handle GOT_PAGE for any NewABI.
7218         (_bfd_mips_elf_relocate_section): No special handling for R_MIPS_64
7219         in any NewABI.
7220         (_bfd_mips_elf_finish_dynamic_symbol): No special _gp_disp handling
7221         for NewABI.
7222         (_bfd_mips_elf_modify_segment_map): Handle any N64 ABI.
7223         (_bfd_mips_elf_gc_sweep_hook): NewABI GOT relocs should be handled
7224         here, too.
7225
7226 2002-07-01  Andreas Schwab  <schwab@suse.de>
7227
7228         * elf64-x86-64.c (elf64_x86_64_relocate_section): Only convert
7229         R_X86_64_64 to R_X86_64_RELATIVE.
7230
7231 2002-07-01  John David Anglin  <dave@hiauly1.hia.nrc.ca>
7232
7233         * vaxbsd.c: New BFD backend for VAX BSD and Ultrix.
7234         * Makefile.am (BFD32_BACKENDS, BFD32_BACKENDS_CFILES): Add new backend.
7235         Run "make dep-am".
7236         * config.bfd (vax-*-bsd* | vax-*-ultrix*): Use vaxbsd_vec instead of
7237         host_aout_vec.
7238         * configure.in (vaxbsd_vec): Add.
7239         * targets.c (vaxbsd_vec): Add.
7240         * Makefile.in: Rebuild.
7241         * configure: Rebuild.
7242         * po/SRC-POTFILES.in: Rebuild.
7243
7244 2002-07-01  Alan Modra  <amodra@bigpond.net.au>
7245
7246         * elflink.h (elf_gc_mark): Pass in the section whose relocs we are
7247         examining to gc_mark_hook, rather than the bfd.
7248         (elf_gc_sections): Adjust.
7249         * elf-bfd.h (struct elf_backend_data <gc_mark_hook>): Likewise.
7250         * elf-m10300.c (mn10300_elf_gc_mark_hook): Likewise.
7251         * elf32-arm.h (elf32_arm_gc_mark_hook): Likewise.
7252         * elf32-avr.c (elf32_avr_gc_mark_hook): Likewise.
7253         * elf32-cris.c (cris_elf_gc_mark_hook): Likewise.
7254         * elf32-d10v.c (elf32_d10v_gc_mark_hook): Likewise.
7255         * elf32-fr30.c (fr30_elf_gc_mark_hook): Likewise.
7256         * elf32-hppa.c (elf32_hppa_gc_mark_hook): Likewise.
7257         * elf32-i386.c (elf_i386_gc_mark_hook): Likewise.
7258         * elf32-m32r.c (m32r_elf_gc_mark_hook): Likewise.
7259         * elf32-m68k.c (elf_m68k_gc_mark_hook): Likewise.
7260         * elf32-mcore.c (mcore_elf_gc_mark_hook): Likewise.
7261         * elf32-openrisc.c (openrisc_elf_gc_mark_hook): Likewise.
7262         * elf32-ppc.c (ppc_elf_gc_mark_hook): Likewise.
7263         * elf32-s390.c (elf_s390_gc_mark_hook): Likewise.
7264         * elf32-sh.c (sh_elf_gc_mark_hook): Likewise.
7265         * elf32-sparc.c (elf32_sparc_gc_mark_hook): Likewise.
7266         * elf32-v850.c (v850_elf_gc_mark_hook): Likewise.
7267         * elf32-vax.c (elf_vax_gc_mark_hook): Likewise.
7268         * elf32-xstormy16.c (xstormy16_elf_gc_mark_hook): Likewise.
7269         * elf64-mmix.c (mmix_elf_gc_mark_hook): Likewise.
7270         * elf64-ppc.c (ppc64_elf_gc_mark_hook): Likewise.
7271         * elf64-s390.c (elf_s390_gc_mark_hook): Likewise.
7272         * elf64-sh64.c (sh_elf64_gc_mark_hook): Likewise.
7273         * elfxx-mips.c (_bfd_mips_elf_gc_mark_hook): Likewise.
7274         * elfxx-mips.h (_bfd_mips_elf_gc_mark_hook): Likewise.
7275         * elf64-x86-64.c (elf64_x86_64_gc_mark_hook): Likewise.
7276         * elf32-frv.c (elf32_frv_gc_mark_hook): Likewise.  Also remove
7277         redundant local sym tests.
7278         * elf64-ppc.c (struct ppc_link_hash_entry): Add is_entry.
7279         (link_hash_newfunc): Init is_entry.
7280         (ppc64_elf_copy_indirect_symbol): Copy is_entry.
7281         (ppc64_elf_link_hash_table_create): Init all_local_syms.
7282         (create_linkage_sections): Use bfd_make_section_anyway rather than
7283         bfd_make_section.
7284         (ppc64_elf_mark_entry_syms): New function.
7285         (ppc64_elf_check_relocs): Don't bother testing elf_bad_symtab.  Set
7286         up opd entry to function section map.
7287         (ppc64_elf_gc_mark_hook): Special case opd section relocs, and
7288         relocs that reference the opd section.
7289         (edit_opd): New function.
7290         (ppc64_elf_size_dynamic_sections): Call get_local_syms and edit_opd.
7291         (ppc64_elf_setup_section_lists): Don't calculate htab->bfd_count here.
7292         (get_local_syms): Do so here.  Exit if we already have local syms.
7293         Remove bogus comment imported from elf32-hppa.c.  Don't attempt to
7294         read local syms on non-ELF input.
7295         (ppc64_elf_size_stubs): Call _bfd_elf64_link_read_relocs rather
7296         than duplicating it's function here.  Adjust free of internal
7297         relocs to suit.
7298         (ppc64_elf_relocate_section): Adjust local syms in opd section.
7299         * elf64-ppc.h (ppc64_elf_mark_entry_syms): Declare.
7300         * elf32-hppa.c (elf32_hppa_size_stubs): Call
7301         _bfd_elf32_link_read_relocs rather than duplicating it's function
7302         here.  Adjust free of internal relocs to suit.
7303
7304 2002-07-01  Andreas Jaeger  <aj@suse.de>
7305
7306         * elf64-x86-64.c (elf64_x86_64_check_relocs): Certain relocations
7307         are not allowed in shared libs code, enforce -fPIC.
7308
7309 2002-06-29  Hans-Peter Nilsson  <hp@bitrange.com>
7310
7311         * mmo.c (mmo_write_loc_chunk): Don't eliminate leading and
7312         trailing zero-sequences when there's previous left-over data.
7313
7314 2002-06-27  John David Anglin  <dave@hiauly1.hia.nrc.ca>
7315
7316         * elf64-hppa.c (elf64_hppa_reloc_type_class): New function.
7317         (elf64_hppa_finish_dynamic_sections): Check other_rel_sec, dlt_rel_sec
7318         and opd_rel_sec in order for starting rela section.  Check _raw_size.
7319         (elf_backend_reloc_type_class): Define.
7320
7321 2002-06-27  Kevin Buettner <kevinb@redhat.com>
7322
7323         * dwarf2.c (decode_line_info): Handle older, non-standard, 64-bit
7324         DWARF2 formats.
7325
7326 2002-06-27  Alan Modra  <amodra@bigpond.net.au>
7327
7328         * cpu-powerpc.c: Comment on ordering of arch_info.
7329         * elf32-ppc.c (ppc_elf_object_p): New function.
7330         (elf_backend_object_p): Define.
7331         * elf64-ppc.c (ppc64_elf_object_p): New function.
7332         (elf_backend_object_p): Define.
7333
7334 2002-06-26  Jason Thorpe  <thorpej@wasabisystems.com>
7335
7336         * configure.in (vax-*-netbsd*): Set COREFILE to netbsd-core.lo.
7337         * configure: Regenerate.
7338
7339 2002-06-25  Jason Eckhardt  <jle@rice.edu>
7340
7341         * dwarf2.c (decode_line_info): Check unit->addr_size
7342         to read in the proper number of prologue bytes.
7343
7344 2002-06-25  Nick Clifton  <nickc@cambridge.redhat.com>
7345
7346         * config.bfd (powerpc-*-aix5*): Only create a selvecs for
7347         aix5coff64_vec if 64-bit bfd support has been enabled.
7348         (powerpc64-*-aix5*): Only define if 64-bit bfd support has
7349         been enabled.
7350
7351         * targets.c (_bfd_target_vector[]): Only include
7352         aix5coff64_vec if 64-bit bfd support has been enabled.
7353
7354 2002-06-25  Alan Modra  <amodra@bigpond.net.au>
7355
7356         * elf64-ppc.c (ppc_add_stub): Replace strcpy/strncpy with memcpy.
7357         * elf32-hppa.c (hppa_add_stub): Likewise.
7358         * elflink.c (_bfd_elf_link_record_dynamic_symbol): Likewise.
7359         * elflink.h (elf_add_default_symbol): Fix comment typo.
7360         (elf_add_default_symbol): Replace strcpy and strncpy with memcpy.
7361         (elf_link_add_object_symbols): Likewise.
7362         (elf_link_assign_sym_version): Likewise.
7363         * hash.c (bfd_hash_lookup): Likewise.
7364         * linker.c (_bfd_generic_link_add_one_symbol): Likewise.
7365         * section.c (bfd_get_unique_section_name): Likewise.
7366         * syms.c (_bfd_stab_section_find_nearest_line): Likewise.
7367         * elf.c (_bfd_elf_make_section_from_phdr): Likewise.
7368         (assign_section_numbers): Likewise.
7369         (_bfd_elfcore_make_pseudosection): Likewise.
7370         (elfcore_grok_lwpstatus): Likewise.
7371         (elfcore_grok_win32pstatus): Likewise.
7372         (elfcore_write_note): Constify input params.  Use PTR instead of
7373         void *.  Include terminating NUL in namesz.  Correct padding.
7374         Support NULL "name" param.  Use memcpy instead of strcpy.
7375         (elfcore_write_prpsinfo): Constify input params.
7376         (elfcore_write_prstatus): Likewise.  Use PTR instead of void *.
7377         (elfcore_write_lwpstatus): Likewise.
7378         (elfcore_write_pstatus): Likewise.
7379         (elfcore_write_prfpreg): Likewise.
7380         (elfcore_write_prxfpreg): Likewise.
7381         * elf-bfd.h (elfcore_write_note): Update declaration.
7382         (elfcore_write_prpsinfo): Likewise.
7383         (elfcore_write_prstatus): Likewise.
7384         (elfcore_write_pstatus): Likewise.
7385         (elfcore_write_prfpreg): Likewise.
7386         (elfcore_write_prxfpreg): Likewise.
7387         (elfcore_write_lwpstatus): Likewise.
7388
7389 2002-06-25  Jason Eckhardt  <jle@rice.edu>
7390
7391         * ecoff.c (ecoff_set_symbol_info): Set BSF_FUNCTION for
7392         symbols of type stProc and stStaticProc.
7393
7394 2002-06-25  Nick Clifton  <nickc@redhat.com>
7395
7396         * ecoff.c: VArious formatting fixes.
7397
7398 2002-06-25  Alan Modra  <amodra@bigpond.net.au>
7399
7400         * coff-rs6000.c (xcoff_generate_rtinit): Fix typo.
7401
7402 2002-06-25  Alan Modra  <amodra@bigpond.net.au>
7403
7404         * aout-adobe.c: Don't compare against "true" or "false.
7405         * aout-target.h: Likewise.
7406         * aoutx.h: Likewise.
7407         * archive.c: Likewise.
7408         * bout.c: Likewise.
7409         * cache.c: Likewise.
7410         * coff-a29k.c: Likewise.
7411         * coff-alpha.c: Likewise.
7412         * coff-i386.c: Likewise.
7413         * coff-mips.c: Likewise.
7414         * coff-or32.c: Likewise.
7415         * coff64-rs6000.c: Likewise.
7416         * coffcode.h: Likewise.
7417         * coffgen.c: Likewise.
7418         * cpu-ns32k.c: Likewise.
7419         * ecoff.c: Likewise.
7420         * ecofflink.c: Likewise.
7421         * elf.c: Likewise.
7422         * elf32-arm.h: Likewise.
7423         * elf32-cris.c: Likewise.
7424         * elf32-d30v.c: Likewise.
7425         * elf32-i386.c: Likewise.
7426         * elf32-mcore.c: Likewise.
7427         * elf32-ppc.c: Likewise.
7428         * elf32-sh.c: Likewise.
7429         * elf32-sh64.c: Likewise.
7430         * elf32-v850.c: Likewise.
7431         * elf64-alpha.c: Likewise.
7432         * elf64-sh64.c: Likewise.
7433         * elfcode.h: Likewise.
7434         * elfcore.h: Likewise.
7435         * elflink.h: Likewise.
7436         * elfxx-mips.c: Likewise.
7437         * i386os9k.c: Likewise.
7438         * ieee.c: Likewise.
7439         * libbfd.c: Likewise.
7440         * linker.c: Likewise.
7441         * mmo.c: Likewise.
7442         * nlm32-alpha.c: Likewise.
7443         * nlm32-i386.c: Likewise.
7444         * nlm32-ppc.c: Likewise.
7445         * nlm32-sparc.c: Likewise.
7446         * nlmcode.h: Likewise.
7447         * oasys.c: Likewise.
7448         * pdp11.c: Likewise.
7449         * peicode.h: Likewise.
7450         * reloc.c: Likewise.
7451         * som.c: Likewise.
7452         * srec.c: Likewise.
7453         * tekhex.c: Likewise.
7454         * vms.c: Likewise.
7455         * xcofflink.c: Likewise.
7456         * elf64-sparc.c: Edit comment to not use "== false".
7457
7458         * aoutf1.h: Don't use "? true : false".
7459         * ecoff.c: Likewise.
7460         * format.c: Likewise.
7461         * ieee.c: Likewise.
7462         * linker.c: Likewise.
7463         * mmo.c: Likewise.
7464         * oasys.c: Likewise.
7465
7466 2002-06-23  H.J. Lu  <hjl@gnu.org>
7467
7468         * elflink.h (elf_link_add_archive_symbols): For the default
7469         version, check references with only one `@' first.
7470
7471 2002-06-23  John David Anglin  <dave@hiauly1.hia.nrc.ca>
7472
7473         * elf64-hppa.c (elf64_hppa_mark_milli_and_exported_functions): New
7474         function.
7475         (allocate_global_data_dlt): Don't add millicode symbols to dynamic
7476         symbol table.
7477         (allocate_global_data_opd, allocate_dynrel_entries): Likewise.
7478         (elf64_hppa_size_dynamic_sections): Revise to use
7479         elf64_hppa_mark_milli_and_exported_functions.
7480         (elf64_hppa_finish_dynamic_symbol): Remove code to keep millicode
7481         symbols out of dynamic symbol table.
7482
7483 2002-06-23  Alan Modra  <amodra@bigpond.net.au>
7484
7485         * Makefile.in: Regenerate.
7486         * libbfd.h: Regenerate.
7487         * bfd-in2.h: Regenerate.
7488         * configure: Regenerate.
7489         * po/SRC-POTFILES.in: Regenerate.
7490
7491         * elflink.h: Comment typo fixes.
7492
7493 2002-06-23  H.J. Lu  <hjl@gnu.org>
7494
7495         * elf-bfd.h (elf_link_loaded_list): New structure.
7496         (elf_link_hash_table): Add "loaded".
7497         * elf.c (_bfd_elf_link_hash_table_init): Initialize "loaded".
7498         * elflink.h (elf_link_check_versioned_symbol): New function.
7499         (elf_link_output_extsym): Call elf_link_check_versioned_symbol.
7500
7501 2002-06-19  Nick Clifton  <nickc@cambridge.redhat.com>
7502
7503         * elflink.h (size_dynamic_sections): If the target does not
7504         support an ELF style hash table, return true, indicating that
7505         nothing needed to be done, rather than false, indicating that the
7506         section's size could not be computed.
7507
7508 2002-06-18  Dave Brolley  <brolley@redhat.com>
7509
7510         From Catherine Moore, Michael Meissner, Dave Brolley:
7511         * po/SRC-POTFILES.in: Add cpu-frv.c and elf32-frv.c
7512         * targets.c: Support bfd_elf32_frv_vec.
7513         * reloc.c: Add FRV relocs.
7514         * configure.in: Add support for bfd-elf32-frv-vec.
7515         * config.bfd (targ_cpu): Add support for frv-*-elf.
7516         * archures.c: Add frv arch and machines.
7517         * Makefile.am (ALL_MACHINES): Add cpu-frv.lo.
7518         (ALL_MACHINES_CFILES): Add cpu-frv.c.
7519         (BFD32_BACKENDS): Add elf32-frv.lo.
7520         (BFD32_BACKENDS_CFILES): Add elf32-frv.c
7521         (cpu-frv.lo): New target.
7522         (elf32-frv.lo): New target.
7523         * cpu-frv.c: New file.
7524         * elf32-frv.c: New file.
7525
7526 2002-06-18  Jakub Jelinek  <jakub@redhat.com>
7527
7528         * elfcode.h (elf_object_p): Sanity check eh_shoff == 0 implies
7529         e_shnum == 0.
7530         Only read the first section header if e_shoff is non-zero.
7531         Don't consider e_shstrndx if there are no sections.
7532
7533 2002-06-17  Tom Rix <trix@redhat.com>
7534
7535         * elf32-d10v.c (elf_d10v_howto_table): Change R_D10V_10_PCREL_R,
7536         R_D10V_10_PCREL_L and R_D10V_18_PCREL to use
7537         complain_overflow_bitfield.
7538
7539 2002-06-17  Alan Modra  <amodra@bigpond.net.au>
7540
7541         * opncls.c (bfd_openr): Remove redundant bfd_set_error.
7542         (bfd_fdopenr): Likewise.
7543         (bfd_openstreamr): Likewise.
7544         (bfd_openw): Likewise.
7545
7546         * targets.c: Sort target vecs.
7547         (_bfd_target_vector): Add aix5coff64_vec, bfd_elf32_sh64_vec,
7548         bfd_elf32_sh64l_vec, bfd_elf32_sh64lnbsd_vec,
7549         bfd_elf32_sh64nbsd_vec, bfd_elf64_sh64_vec, bfd_elf64_sh64l_vec,
7550         bfd_elf64_sh64lnbsd_vec, bfd_elf64_sh64nbsd_vec.
7551         * configure.in: Sort target vecs.  Add m88kmach3_vec.
7552         * configure: Regenerate.
7553
7554 2002-06-16  Hans-Peter Nilsson  <hp@bitrange.com>
7555
7556         * elf64-mmix.c (bpo_reloc_request_sort_fn): Use member
7557         bpo_reloc_no to break sort order ties, not address of items.
7558
7559 2002-06-16  John David Anglin  <dave@hiauly1.hia.nrc.ca>
7560
7561         * elf-hppa.h (elf_hppa_final_link): Fix formatting in comment.
7562         Skip excluded sections in determing __gp value.
7563         (elf_hppa_final_link_relocate): Use the symbol's address in
7564         R_PARISC_FPTR64 relocations that don't need an opd entry.
7565         * elf64-hppa.c (allocate_dynrel_entries): Simplify code.
7566         (elf64_hppa_finalize_dynreloc): Likewise.
7567         (elf64_hppa_size_dynamic_sections): Move comments and fix typo.
7568         (elf64_hppa_finish_dynamic_symbol): Break up assert.
7569
7570 2002-06-14  Sergey Grigoriev  <serge@leopold.Physik.Uni-Augsburg.DE>
7571
7572         * pei-i386.c (COFF_SECTION_ALIGNMENT_ENTRIES): Enable 16 byte
7573         alignment for .bss, .data and .text sections so that sse and sse2
7574         code will work.
7575         * pe-i386.c (COFF_SECTION_ALIGNMENT_ENTRIES): Likewise.
7576
7577 2002-06013  J"orn Rennecke  <joern.rennecke@superh.com>
7578
7579         config.bfd: Add support for sh[1234]l*-*-elf* | sh3el*-*-elf*,
7580         sh[1234]*-elf*.
7581
7582 2002-06-12  John David Anglin  <dave@hiauly1.hia.nrc.ca>
7583
7584         * elflink.h (elf_bfd_final_link): Improve error handling for missing
7585         dynamic sections.
7586
7587         * elf64-hppa.c (allocate_global_data_opd): We don't need an opd entry
7588         for a symbol that has no output section.
7589         (allocate_dynrel_entries): Correct comment.
7590         (elf64_hppa_finalize_dynreloc): Likewise.  Don't create an opd entry
7591         unless we want one.
7592         (elf64_hppa_finalize_opd): Prevent segfault if dyn_h is NULL.
7593         (elf64_hppa_finalize_dlt): Likewise.  Prevent segfault for symbols
7594         with no section.  Remove unnecessary parentheses.
7595
7596 2002-06-11  Tom Rix  <trix@redhat.com>
7597
7598         * coffcode.h (coff_compute_section_file_positions): Add data
7599         section to AIX loader alignment check.
7600
7601         * coff-rs6000.c (_bfd_xcoff_mkobject): Set default text section
7602         alignment to 4 bytes.
7603         (_bfd_xcoff_copy_private_bfd_data): Use text and data alignment
7604         power accessor macro.
7605         (do_shared_object_padding): Remove invalid assertion.
7606
7607 2002-06-10  Richard Sandiford  <rsandifo@redhat.com>
7608
7609         * section.c (_bfd_strip_section_from_output): Set SEC_EXCLUDE
7610         for removed output sections.
7611
7612 2002-06-10  Geoffrey Keating  <geoffk@redhat.com>
7613
7614         * merge.c (merge_strings): Use htab_create_alloc with calloc, not
7615         htab_alloc.
7616         * elf-strtab.c (_bfd_elf_strtab_finalize): Likewise.
7617
7618 2002-06-08  H.J. Lu <hjl@gnu.org>
7619
7620         * elf.c (copy_private_bfd_data): Don't cast to bfd_size_type to
7621         work around a long long bug in gcc 2.96 on mips.
7622
7623 2002-06-08  Jason Thorpe  <thorpej@wasabisystems.com>
7624
7625         * Makefile.am (BFD32_BACKENDS): Add vax1knetbsd.lo.
7626         (BFD32_BACKENDS_CFILES): Add vax1knetbsd.c.
7627         Regenerate dependency lists.
7628         * Makefile.in: Regenerate.
7629         * config.bfd (vax-*-netbsdelf*, vax-*-netbsdaout*): Add
7630         vax1knetbsd_vec to targ_selvecs.
7631         * configure.in: Add vax1knetbsd_vec.
7632         * configure: Regenerate.
7633         * targets.c (_bfd_target_vector): Add vax1knetbsd_vec.
7634         * vax1knetbsd.c: New file.
7635         * vaxnetbsd.c: Update copyright years.
7636         (TARGET_PAGE_SIZE): Set to 0x1000.
7637         (DEFAULT_MID): Set to M_VAX4K_NETBSD.
7638
7639 2002-06-08  Matt Thomas  <matt@3am-software.com>
7640
7641         * libaout.h (enum machine_type): Add M_VAX4K_NETBSD.
7642
7643 2002-06-08  Alan Modra  <amodra@bigpond.net.au>
7644
7645         * elf64-sh64.c (sh64_elf64_link_output_symbol_hook): Make static.
7646
7647 2002-06-08  Alan Modra  <amodra@bigpond.net.au>
7648
7649         * Makefile.am: Run "make dep-am".
7650         * Makefile.in: Regenerate.
7651
7652         * armnetbsd.c: Replace CONST with const.
7653         * corefile.c: Likewise.
7654         * elf32-dlx.c: Likewise.
7655         * elf64-mips.c: Likewise.
7656         * mmo.c: Likewise.
7657         * ns32knetbsd.c: Likewise.
7658
7659         * elf64-sparc.c (sparc64_elf_add_symbol_hook): Check the hash
7660         table is elf64-sparc.
7661
7662 2002-06-08  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
7663
7664         * elfxx-mips.c (_bfd_mips_elf_relocate_section): Simplify code.
7665         Fix RELA addends to get not shifted in the result. Don't do special
7666         handling of R_MIPS_64 for NewABI.
7667
7668 2002-06-07  Alan Modra  <amodra@bigpond.net.au>
7669
7670         * aoutx.h (NAME(aout,slurp_symbol_table)): Use bfd_zmalloc.
7671         (NAME(aout,slurp_reloc_table)): Likewise.
7672         * coff-mips.c (mips_relax_section): Use bfd_zalloc.
7673         * coff-rs6000.c (xcoff_write_armap_big): Use bfd_zmalloc.
7674         (xcoff_write_archive_contents_big): Likewise.
7675         (xcoff_generate_rtinit): Likewise.
7676         (xcoff_generate_rtinit): Likewise, and check error return.
7677         * coff64-rs6000.c (xcoff64_generate_rtinit): Likewise.
7678         * coffgen.c (coff_section_symbol): Use bfd_zalloc.
7679         (coff_get_normalized_symtab): Likewise.
7680         (coff_make_empty_symbol): Likewise.
7681         (bfd_coff_set_symbol_class): Likewise.
7682         * cofflink.c (coff_link_add_symbols): Likewise.
7683         * ecoff.c (_bfd_ecoff_make_empty_symbol): Likewise.
7684         * ecofflink.c (ecoff_write_shuffle): Use bfd_zmalloc.
7685         (bfd_ecoff_write_accumulated_debug): Likewise.
7686         * elf64-alpha.c (get_got_entry): Use bfd_zalloc.
7687         * i386linux.c (bfd_i386linux_size_dynamic_sections): Likewise.
7688         * i386lynx.c (NAME(lynx,slurp_reloc_table)): Use bfd_zmalloc.
7689         * ieee.c (do_with_relocs): Use bfd_zalloc.
7690         * m68klinux.c (bfd_m68klinux_size_dynamic_sections): Likewise.
7691         * pdp11.c (NAME(aout,slurp_symbol_table)): Use bfd_zmalloc.
7692         (NAME(aout,slurp_reloc_table)): Likewise.
7693         (NAME(aout,squirt_out_relocs)): Don't memset when zalloc'd.
7694         * reloc16.c (bfd_coff_reloc16_relax_section): Use bfd_zmalloc.
7695         * som.c (som_build_and_write_symbol_table): Likewise.
7696         (som_slurp_string_table): Likewise.
7697         (som_slurp_symbol_table): Likewise.
7698         (som_bfd_ar_write_symbol_stuff): Likewise.
7699         * sparclinux.c (bfd_sparclinux_size_dynamic_sections): Use bfd_zalloc.
7700         * sunos.c (bfd_sunos_size_dynamic_sections): Likewise.
7701         * tekhex.c (find_chunk): Likewise.  Get rid of unused "sname".
7702         * vms-gsd.c (_bfd_vms_slurp_gsd): Use bfd_zmalloc.
7703         * xcofflink.c (xcoff_link_add_symbols): Use bfd_zalloc/bfd_zmalloc.
7704
7705 2002-06-07  Alan Modra  <amodra@bigpond.net.au>
7706
7707         * elf-bfd.h (struct bfd_elf_section_data <group_name>): Replace with
7708         "group" union.
7709         (elf_group_name): Update.
7710         (elf_group_id): Define.
7711         (bfd_elf_set_group_contents): Declare.
7712         * elf.c (elf_fake_sections): Qualify use of elf_group_name.
7713         (set_group_contents): Rename to bfd_elf_set_group_contents.  Remove
7714         ATTRIBUTE_UNUSED from failedptrarg.  If elf_group_id is set, use
7715         that sym for the signature.
7716         (_bfd_elf_compute_section_file_positions): Don't call
7717         set_group_contents for "ld -r" case.
7718         (swap_out_syms): Use bfd_zalloc.
7719         * elflink.h (elf_link_add_archive_symbols): Likewise.
7720         (NAME(bfd_elf,size_dynamic_sections)): Likewise.
7721         (elf_bfd_final_link): Call bfd_elf_set_group_contents.
7722
7723 2002-06-07  Alan Modra  <amodra@bigpond.net.au>
7724
7725         * elf64-ppc.c (ppc64_elf_relocate_section): Allow unresolved
7726         relocs in opd for non-shared too.
7727
7728 2002-06-06  Jeffrey Law  <law@redhat.com>
7729
7730         * elf32-h8300.c (elf32_h8_relax_section): Ignore uninteresting
7731         relocations.
7732
7733 2002-06-06  Nick Clifton  <nickc@cambridge.redhat.com>
7734
7735         * merge.c: Include libiberty.h.
7736         * elf-strtab.c: Include libiberty.h.
7737
7738 2002-06-06  Elias Athanasopoulos  <eathan@otenet.gr>
7739
7740         * peXXigen.c (pe_print_idata): Remove unused variable.
7741
7742 2002-06-06  David Heine <dlheine@tensilica.com>
7743
7744         * elf.c (assign_file_positions_for_segments): Remove unallocated
7745         sections from the section to segment mapping for PT_LOAD segments.
7746         Update comment about empty loadable segments.
7747
7748 2002-06-06  Richard Sandiford  <rsandifo@redhat.com>
7749
7750         * stabs.c (_bfd_link_section_stabs): Check that the symbol offset
7751         is within the .stabstr section.
7752
7753 2002-06-06  Alan Modra  <amodra@bigpond.net.au>
7754
7755         * elf-bfd.h (struct elf_size_info <swap_symbol_in>): Function args
7756         are "const PTR", not "const PTR *".
7757         (bfd_elf32_swap_symbol_in): Likewise.
7758         (bfd_elf64_swap_symbol_in): Likewise.
7759         * elfcode.h (elf_swap_symbol_in): Change input args to const PTR.
7760         (elf_slurp_symbol_table): Adjust call to elf_swap_symbol_in.
7761         * elflink.h (elf_link_is_defined_archive_symbol): Likewise.
7762         (elf_link_add_object_symbols): Likewise.
7763         (elf_link_record_local_dynamic_symbol): Likewise.
7764         (elf_link_input_bfd): Likewise.
7765         (elf_gc_mark): Likewise.
7766         (elf_reloc_symbol_deleted_p): Likewise.
7767         * elf-m10200.c (mn10200_elf_relax_section): Likewise.
7768         (mn10200_elf_relax_delete_bytes): Likewise.
7769         (mn10200_elf_symbol_address_p): Likewise.
7770         (mn10200_elf_get_relocated_section_contents): Likewise.
7771         * elf-m10300.c (mn10300_elf_relax_section): Likewise.
7772         (mn10300_elf_relax_section): Likewise.
7773         (mn10300_elf_relax_delete_bytes): Likewise.
7774         (mn10300_elf_symbol_address_p): Likewise.
7775         (mn10300_elf_get_relocated_section_contents): Likewise.
7776         * elf32-h8300.c (elf32_h8_relax_section): Likewise.
7777         (elf32_h8_relax_delete_bytes): Likewise.
7778         (elf32_h8_symbol_address_p): Likewise.
7779         (elf32_h8_get_relocated_section_contents): Likewise.
7780         * elf32-hppa.c (get_local_syms): Likewise.
7781         * elf32-m68k.c (bfd_m68k_elf32_create_embedded_relocs): Likewise.
7782         * elf32-mips.c (bfd_mips_elf32_create_embedded_relocs): Likewise.
7783         * elf32-sh.c (sh_elf_relax_section): Likewise.
7784         (sh_elf_relax_delete_bytes): Likewise.
7785         (sh_elf_get_relocated_section_contents): Likewise.
7786         * elf32-xstormy16.c (xstormy16_elf_relax_section): Likewise.
7787         * elf64-alpha.c (elf64_alpha_relax_section): Likewise.
7788         * elf64-hppa.c (elf64_hppa_check_relocs): Likewise.
7789         * elf64-mmix.c (mmix_elf_relax_section): Likewise.
7790         * elf64-ppc.c (get_local_syms): Likewise.
7791         * elf64-sh64.c (sh_elf64_get_relocated_section_contents): Likewise.
7792         * elfxx-ia64.c (elfNN_ia64_relax_section): Likewise.
7793
7794 2002-06-05  J"orn Rennecke <joern.rennecke@superh.com>
7795
7796         * config.bfd (sh64l*-*-elf*, shl*-*-elf*): New configurations.
7797
7798 2002-06-05  Alan Modra  <amodra@bigpond.net.au>
7799
7800         * elf.c (group_signature): Swap in the whole symbol, and handle
7801         extracting section symbol names.
7802         (setup_group): Add comment.
7803         (set_group_contents): When called from objcopy or ld, arrange for
7804         section contents to be written.  Write group member output section
7805         indices to allow objcopy to reorganize sections.
7806         (_bfd_elf_copy_private_section_data): Copy group info.
7807
7808         * elf-bfd.h (struct elf_size_info): Add swap_symbol_in field.
7809         (bfd_elf32_swap_symbol_in): Update prototype.
7810         (bfd_elf64_swap_symbol_in): Likewise.
7811         * elfcode.h (elf_swap_symbol_in): Change input args to const PTR *.
7812         (elf_slurp_symbol_table): Adjust call to elf_swap_symbol_in.
7813         * elflink.h (elf_link_is_defined_archive_symbol): Likewise.
7814         (elf_link_add_object_symbols): Likewise.
7815         (elf_link_record_local_dynamic_symbol): Likewise.
7816         (elf_link_input_bfd): Likewise.
7817         (elf_gc_mark): Likewise.
7818         (elf_reloc_symbol_deleted_p): Likewise.
7819         * elf-m10200.c (mn10200_elf_relax_section): Likewise.
7820         (mn10200_elf_relax_delete_bytes): Likewise.
7821         (mn10200_elf_symbol_address_p): Likewise.
7822         (mn10200_elf_get_relocated_section_contents): Likewise.
7823         * elf-m10300.c (mn10300_elf_relax_section): Likewise.
7824         (mn10300_elf_relax_section): Likewise.
7825         (mn10300_elf_relax_delete_bytes): Likewise.
7826         (mn10300_elf_symbol_address_p): Likewise.
7827         (mn10300_elf_get_relocated_section_contents): Likewise.
7828         * elf32-h8300.c (elf32_h8_relax_section): Likewise.
7829         (elf32_h8_relax_delete_bytes): Likewise.
7830         (elf32_h8_symbol_address_p): Likewise.
7831         (elf32_h8_get_relocated_section_contents): Likewise.
7832         * elf32-hppa.c (get_local_syms): Likewise.
7833         * elf32-m68k.c (bfd_m68k_elf32_create_embedded_relocs): Likewise.
7834         * elf32-mips.c (bfd_mips_elf32_create_embedded_relocs): Likewise.
7835         * elf32-sh.c (sh_elf_relax_section): Likewise.
7836         (sh_elf_relax_delete_bytes): Likewise.
7837         (sh_elf_get_relocated_section_contents): Likewise.
7838         * elf32-xstormy16.c (xstormy16_elf_relax_section): Likewise.
7839         * elf64-alpha.c (elf64_alpha_relax_section): Likewise.
7840         * elf64-hppa.c (elf64_hppa_check_relocs): Likewise.
7841         * elf64-mmix.c (mmix_elf_relax_section): Likewise.
7842         * elf64-ppc.c (get_local_syms): Likewise.
7843         * elf64-sh64.c (sh_elf64_get_relocated_section_contents): Likewise.
7844         * elfxx-ia64.c (elfNN_ia64_relax_section): Likewise.
7845         * elfcode.h (NAME(_bfd_elf,size_info)): Update initialiser.
7846         * elf64-alpha.c (alpha_elf_size_info): Likewise.
7847         * elf64-hppa.c (hppa64_elf_size_info): Likewise.
7848         * elf64-mips.c (mips_elf64_size_info): Likewise.
7849         * elf64-s390.c (s390_elf64_size_info): Likewise.
7850         * elf64-sparc.c (sparc64_elf_size_info): Likewise.
7851
7852 2002-06-05  Maciej W. Rozycki  <macro@ds2.pg.gda.pl>
7853
7854         * elf32-mips.c (elf32_mips_ignore_discarded_relocs): Move to...
7855         elfxx-mips.c (_bfd_mips_elf_ignore_discarded_relocs): ... here.
7856         elf64-mips.c (elf_backend_ignore_discarded_relocs): Use
7857         _bfd_mips_elf_ignore_discarded_relocs.
7858         elfxx-mips.h (_bfd_mips_elf_ignore_discarded_relocs): Declare.
7859
7860 2002-06-05  H.J. Lu <hjl@gnu.org>
7861
7862         * elfxx-mips.c (mips_elf_calculate_relocation): Call
7863         _bfd_elf_rel_local_sym for STT_SECTION relocations against
7864         the SEC_MERGE section.
7865
7866 2002-06-05  Alan Modra  <amodra@bigpond.net.au>
7867
7868         * coff-alpha.c: Update copyright date.
7869         * coff-mips.c: Likewise.
7870         * xcoff-target.h: Likewise.
7871
7872         * bfd-in.h: Remove "taken from the source" comment.
7873         * libbfd-in.h: Likewise.
7874         * libcoff-in.h: Likewise.
7875         * bfd-in2.h: Regenerate.
7876         * libbfd.h: Regenerate.
7877         * libcoff.h: Regenerate.
7878
7879         * elf.c (bfd_elf_discard_group): Return true.
7880         * elf-bfd.h (bfd_elf_discard_group): Declare.
7881         * bfd-in.h (bfd_elf_discard_group): Don't declare here.
7882         * section.c (bfd_discard_group): Rename to bfd_generic_discard_group.
7883         * bfd.c (bfd_discard_group): Define.
7884         * targets.c (struct bfd_target): Add _bfd_discard_group.
7885         (BFD_JUMP_TABLE_LINK): Here too.
7886         * libbfd-in.h (_bfd_nolink_bfd_discard_group): Define.
7887         * aout-adobe.c (aout_32_bfd_discard_group): Define.
7888         * aout-target.h (MY_bfd_discard_group): Define.
7889         * aout-tic30.c (MY_bfd_discard_group): Define.
7890         * binary.c (binary_bfd_discard_group): Define.
7891         * bout.c (b_out_bfd_discard_group): Define.
7892         * coff-alpha.c (_bfd_ecoff_bfd_discard_group): Define.
7893         * coffcode.h (coff_bfd_discard_group): Define.
7894         * coff-mips.c (_bfd_ecoff_bfd_discard_group): Define.
7895         * elfxx-target.h (bfd_elfNN_bfd_discard_group): Define.
7896         * i386msdos.c (msdos_bfd_discard_group): Define.
7897         * i386os9k.c (os9k_bfd_discard_group): Define.
7898         * ieee.c (ieee_bfd_discard_group): Define.
7899         * ihex.c (ihex_bfd_discard_group): Define.
7900         * mmo.c (mmo_bfd_discard_group): Define.
7901         * nlm-target.h (nlm_bfd_discard_group): Define.
7902         * oasys.c (oasys_bfd_discard_group): Define.
7903         * ppcboot.c (ppcboot_bfd_discard_group): Define.
7904         * som.c (som_bfd_discard_group): Define.
7905         * srec.c (srec_bfd_discard_group): Define.
7906         * tekhex.c (tekhex_bfd_discard_group): Define.
7907         * versados.c (versados_bfd_discard_group): Define.
7908         * vms.c (vms_bfd_discard_group): Define.
7909         * xcoff-target.h (_bfd_xcoff_bfd_discard_group): Define.
7910         * coff64-rs6000.c (rs6000coff64_vec): Update initialiser.
7911         (aix5coff64_vec): Likewise.
7912         * coff-rs6000.c (rs6000coff_vec, pmac_xcoff_vec): Likewise.
7913
7914 2002-06-04  Jason Thorpe  <thorpej@wasabisystems.com>
7915
7916         * Makefile.am (BFD32_BACKENDS): Add elf32-sh64-com.lo.
7917         (BFD32_BACKENDS_CFILES): Add elf32-sh64-com.c.
7918         (elf32-sh64-com.lo): New dependency list.
7919         * Makefile.in: Regenerate.
7920         * configure.in (bfd_elf32_sh64_vec, bfd_elf32_sh64l_vec)
7921         (bfd_elf32_sh64nbsd_vec, bfd_elf32_sh64lnbsd_vec): Add
7922         elf32-sh64-com.lo.
7923         * configure: Regenerate.
7924         * elf32-sh64.c (sh64_address_in_cranges)
7925         (sh64_get_contents_type, sh64_address_is_shmedia): Move to...
7926         (crange_qsort_cmpb, crange_qsort_cmpl, crange_bsearch_cmpb):
7927         (crange_bsearch_cmpl): Prepend _bfd_sh64_ to name and move to...
7928         * elf32-sh64-com.c: ...here.  New file.
7929
7930 2002-06-04  Alan Modra  <amodra@bigpond.net.au>
7931
7932         * elf32-openrisc.c (openrisc_elf_gc_mark_hook): Remove
7933         ATTRIBUTE_UNUSED on used params.
7934         * elf32-vax.c (elf_vax_gc_mark_hook): Remove unnecessary checks
7935         before calling bfd_section_from_elf_index on local syms.
7936         * elf64-sh64.c (sh_elf64_gc_mark_hook): Likewise.
7937
7938 2002-06-04  Jason Thorpe  <thorpej@wasabisystems.com>
7939
7940         * Makefile.am (BFD32_BACKENDS): Add elf32-sh64-nbsd.lo.
7941         (BFD32_BACKENDS_CFILES): Add elf32-sh64-nbsd.c.
7942         (BFD64_BACKENDS): Add elf64-sh64-nbsd.lo.
7943         (BFD64_BACKENDS_CFILES): Add elf64-sh64-nbsd.c.
7944         (elf32-sh64-nbsd.lo, elf64-sh64-nbsd.lo): New rules.
7945         * Makefile.in: Regenerate.
7946         * config.bfd (sh5le-*-netbsd*, sh5-*-netbsd*, sh64le-*-netbsd*)
7947         (sh64-*-netbsd*): New targets.
7948         * configure.in: Add bfd_elf32_sh64nbsd_vec, bfd_elf32_sh64lnbsd_vec,
7949         bfd_elf64_sh64nbsd_vec, and bfd_elf64_sh64lnbsd_vec.
7950         * configure: Regenerate.
7951         * elf32-sh64-nbsd.c: New file.
7952         * elf64-sh64-nbsd.c: New file.
7953         * targets.c: Add extern decls for bfd_elf32_sh64nbsd_vec,
7954         bfd_elf32_sh64lnbsd_vec, bfd_elf64_sh64nbsd_vec, and
7955         bfd_elf64_sh64lnbsd_vec.
7956
7957 2002-06-04  Alan Modra  <amodra@bigpond.net.au>
7958
7959         * elf.c (setup_group): Set SEC_LINK_ONCE on GRP_COMDAT groups.
7960         (bfd_section_from_shdr): Likewise.  Set section name of group
7961         sections from signature.
7962         (group_signature): Split out from setup_group.  Ensure symbol table
7963         is available.
7964         (bfd_elf_discard_group): New function.
7965         (_bfd_elf_make_section_from_shdr): Don't set SEC_LINK_ONCE on
7966         .gnu.linkonce* sections if they are members of a group.
7967         (set_group_contents): Set GRP_COMDAT flag.
7968         * section.c (bfd_discard_group): New function.
7969         * bfd-in.h (bfd_elf_discard_group): Declare.
7970         * bfd-in2.h: Regenerate.
7971         * elf-bfd.h (struct bfd_elf_section_data): Add linkonce_p field.
7972         (elf_linkonce_p): Define.
7973
7974 2002-06-04  Alan Modra  <amodra@bigpond.net.au>
7975
7976         * elf.c (bfd_section_from_shdr): Make "name" const.
7977         * elf-bfd.h (elf_backend_section_from_shdr): Likewise.
7978         * elf32-i370.c (i370_elf_section_from_shdr): Likewise.
7979         * elf32-ppc.c (ppc_elf_section_from_shdr): Likewise.
7980         * elf32-sh64.c (sh64_backend_section_from_shdr): Likewise.
7981         * elf32-v850.c (v850_elf_section_from_shdr): Likewise.
7982         * elf64-alpha.c (elf64_alpha_section_from_shdr): Likewise.
7983         * elf64-hppa.c (elf64_hppa_section_from_shdr): Likewise.
7984         * elf64-ppc.c (ppc64_elf_section_from_shdr): Likewise.
7985         * elfxx-ia64.c (elfNN_ia64_section_from_shdr): Likewise.
7986         * elfxx-mips.c (_bfd_mips_elf_section_from_shdr): Likewise.
7987         * elfxx-mips.h (_bfd_mips_elf_section_from_shdr): Likewise.
7988
7989 2002-06-03  Maciej W. Rozycki  <macro@ds2.pg.gda.pl>
7990
7991         * elfxx-mips.c (ABI_64_P): Use backend's data to determine the
7992         ABI.
7993
7994 2002-06-02  Kazu Hirata  <kazu@cs.umass.edu>
7995
7996         * elf32-arc.c: Fix formatting.
7997         * elf32-arm.h: Likewise.
7998         * elf32-cris.c: Likewise.
7999         * elf32-dlx.c: Likewise.
8000         * elf32-hppa.c: Likewise.
8001         * elf32-i386.c: Likewise.
8002         * elf32-i386qnx.c: Likewise.
8003         * elf32-or32.c: Likewise.
8004         * elf32-s390.c: Likewise.
8005         * elf32-sh64.c: Likewise.
8006         * elf32-vax.c: Likewise.
8007         * elf32-xstormy16.c: Likewise.
8008         * elf64-alpha.c: Likewise.
8009         * elf64-mmix.c: Likewise.
8010         * elf64-ppc.c: Likewise.
8011         * elf64-s390.c: Likewise.
8012         * elf64-sh64.c: Likewise.
8013         * elf64-x86-64.c: Likewise.
8014
8015 2002-06-02  Richard Henderson  <rth@redhat.com>
8016
8017         * elf64-alpha.c (elf64_alpha_relocate_section): Don't dereference
8018         null when there are no got entries for a symbol.
8019         (elf64_alpha_relax_find_tls_segment): Rearrange to avoid
8020         uninitialized variable warning.
8021
8022 2002-06-01  Richard Henderson  <rth@redhat.com>
8023
8024         * elf64-alpha.c (elf64_alpha_relax_with_lituse): Don't test for
8025         undefined symbols here.
8026         (elf64_alpha_relax_section): Do it here.  Also test for not
8027         defined in the current module.
8028         (elf64_alpha_relocate_section_r): Split out of ...
8029         (elf64_alpha_relocate_section): ... here.  Don't dereference
8030         NULL when looking up local got entries.
8031
8032 2002-06-01  Richard Henderson  <rth@redhat.com>
8033
8034         * elf64-alpha.c (elf64_alpha_relax_with_lituse): Reject undefined
8035         symbols from JSR relaxation.
8036         (elf64_alpha_size_plt_section_1): New.
8037         (elf64_alpha_calc_dynrel_sizes): Split out .rela.got bits ...
8038         (elf64_alpha_size_rela_got_1): ... here.
8039         (elf64_alpha_size_dynamic_sections): Split out .rela.got bits ...
8040         (elf64_alpha_size_rela_got_section): ... here.
8041         (elf64_alpha_size_plt_section): New.
8042         (elf64_alpha_relax_section): Call them.
8043         (elf64_alpha_size_got_sections): Remove output_bfd arg.
8044         (elf64_alpha_finish_dynamic_symbol): Check gotent use_count.
8045
8046 2002-06-01  Richard Henderson  <rth@redhat.com>
8047
8048         * elf64-alpha.c (alpha_get_dtprel_base, alpha_get_tprel_base): New.
8049         (elf64_alpha_relocate_section): Use them.  Reject LE TLS relocs
8050         in shared libraries.  Fix DTPRELHI and TPRELHI value.
8051         (INSN_ADDQ, INSN_RDUNIQ): New.
8052         (struct alpha_relax_info): Add symtab_hdr, tls_segment, first_gotent.
8053         (elf64_alpha_relax_with_lituse): Return boolean.  Remove irelend
8054         argument.  Reject dynamic symbols.  Use LITUSE symbolic constants.
8055         (elf64_alpha_relax_got_load): Rename from relax_without_lituse.
8056         Handle GOTDTPREL and GOTTPREL relocations.
8057         (elf64_alpha_relax_gprelhilo): New.
8058         (elf64_alpha_relax_tls_get_addr): New.
8059         (elf64_alpha_relax_find_tls_segment): New.
8060         (elf64_alpha_relax_section): Handle TLS relocations.
8061         (ALPHA_ELF_LINK_HASH_TLS_IE): New.
8062         (elf64_alpha_check_relocs): Set it.
8063
8064 2002-06-01  Richard Henderson  <rth@redhat.com>
8065
8066         * elf64-alpha.c (elf64_alpha_relax_section): Don't store computed gp.
8067
8068         * elf64-alpha.c (elf64_alpha_check_relocs): Fix typo on maybe_dynamic
8069         check; don't suppress dynamic relocs for non-allocated sections.
8070
8071         * elf64-alpha.c: Remove dead code.
8072
8073 2002-05-31  Alan Modra  <amodra@bigpond.net.au>
8074
8075         * bfd-in2.h: Regenerate.
8076         * libbfd.h: Regenerate.
8077         * po/SRC-POTFILES.in: Regenerate.
8078
8079         * elf64-ppc.c (ppc64_elf_size_dynamic_sections): Don't allocate
8080         space for bss .plt.
8081
8082 2002-05-31  Graeme Peterson  <gp@qnx.com>
8083
8084         * Makefile.am (BFD32_BACKENDS): Add elf32-i386qnx.lo.
8085         (BFD32_BACKENDS_CFILES): Add elf32-i386qnx.c.
8086         Run "make dep-am".
8087         * Makefile.in: Regenerate.
8088         * config.bfd: Add i[3456]86-*-nto-qnx* support.
8089         * configure.in: Add bfd_elf32_i386qnx_vec support.
8090         * configure: Regenerate.
8091         * elf-bfd.h (struct elf_backend_data): Add set_nonloadable_filepos,
8092         is_contained_by_filepos, and copy_private_bfd_data_p.
8093         * elf.c (assign_file_positions_for_segments): Call backend
8094         set_nonloadable_filepos.  Fix non-K&R call to _bfd_error_handler.
8095         (IS_CONTAINED_BY_FILEPOS): Define.
8096         (INCLUDE_SECTION_IN_SEGMENT): Also test IS_CONTAINED_BY_FILEPOS.
8097         (copy_private_bfd_data): Use IS_CONTAINED_BY_FILEPOS.  Typo fix.
8098         Fix non-K&R call to _bfd_error_handler.
8099         (_bfd_elf_copy_private_section_data): Use backend
8100         copy_private_bfd_data_p.
8101         * elf32-i386.c: Don't include elfxx-target.h when
8102         ELF32_I386_C_INCLUDED is defined.
8103         * elf32-i386qnx.c: New QNX elf backend file.
8104         * elfxx-target.h: Add elf_backend_set_nonloadable_filepos,
8105         elf_backend_is_contained_by_filepos, and
8106         elf_backend_do_copy_private_bfd_data.
8107         * targets.c: Add bfd_target bfd_elf32_i386qnx_vec.
8108
8109 2002-05-31  Alan Modra  <amodra@bigpond.net.au>
8110
8111         * elfarm-oabi.c (bfd_elf32_arm_add_glue_sections_to_bfd): Define.
8112         Move other similar defines to start of file.
8113
8114 2002-05-30  Tom Rix  <trix@redhat.com>
8115
8116         * coff-rs6000.c (xcoff_rtype2howto): Handle 16 bit R_RBA.
8117         * coff64-rs6000.c (xcoff64_rtype2howto): Same.
8118
8119 2002-05-30  Richard Henderson  <rth@redhat.com>
8120
8121         * elf64-alpha.c (ALPHA_ELF_LINK_HASH_LU_TLSGD,
8122         ALPHA_ELF_LINK_HASH_LU_TLSLDM, ALPHA_ELF_LINK_HASH_LU_FUNC): New.
8123         (ALPHA_ELF_GOT_ENTRY_RELOCS_DONE): Remove.
8124         (ALPHA_ELF_GOT_ENTRY_RELOCS_XLATED): Remove.
8125         (struct alpha_elf_got_entry): Add reloc_type, reloc_done, reloc_xlated.
8126         (struct alpha_elf_obj_tdata): Rename total_got_entries and
8127         n_local_got_entries to total_got_size and local_got_size.
8128         (elf64_alpha_howto, elf64_alpha_reloc_map): Update for TLS relocs.
8129         (alpha_got_entry_size): New.
8130         (elf64_alpha_relax_with_lituse): Use it.
8131         (elf64_alpha_relax_without_lituse): Likewise.
8132         (MAX_GOT_SIZE): Rename from MAX_GOT_ENTRIES.
8133         (get_got_entry): New.
8134         (elf64_alpha_check_relocs): Handle TLS relocs.  Reorganize.
8135         (elf64_alpha_adjust_dynamic_symbol): Test LU_FUNC as a mask.
8136         (elf64_alpha_merge_ind_symbols): Check gotent->reloc_type.
8137         (elf64_alpha_can_merge_gots, elf64_alpha_merge_gots): Likewise.
8138         (elf64_alpha_calc_got_offsets_for_symbol): Use alpha_got_entry_size.
8139         (elf64_alpha_calc_got_offsets): Likewise.
8140         (alpha_dynamic_entries_for_reloc): New.
8141         (elf64_alpha_calc_dynrel_sizes): Use it.
8142         (elf64_alpha_size_dynamic_sections): Likewise.
8143         (elf64_alpha_relocate_section): Handle TLS relocations.
8144         * reloc.c: Add Alpha TLS relocations.
8145         * bfd-in2.h, libbfd.h: Rebuild.
8146
8147 2002-05-29 Ralf Habacker <ralf.habacker@freenet.de>
8148
8149         * peXXigen.c (pe_print_idata): Remove double printed
8150         import table lines; add Bound-To comment.
8151
8152 2002-05-29  Matt Thomas  <matt@3am-software.com>
8153
8154         * Makefile.am (BFD32_BACKENDS): Add elf32-vax.lo.
8155         (BFD32_BACKENDS_CFILES): Add elf32-vax.c.
8156         (elf32-vax.lo): New rule.
8157         * Makefile.in: Regenerate.
8158         * configure.in (bfd_elf32_vax_vec)
8159         (vaxnetbsd_vec): New vectors.
8160         * configure: Regenerate.
8161         * config.bfd (vax-*-netbsdelf*)
8162         (vax-*-netbsdaout*)
8163         (vax-*-netbsd*): New targets.
8164         * elf32-vax.c: New file.
8165         * reloc.c: Add VAX relocations.
8166         * bfd-in2.h: Regenerate.
8167         * targets.c (_bfd_target_vector): Add bfd_elf32_vax_vec.
8168
8169 2002-05-29  Jason Thorpe  <thorpej@wasabisystems.com>
8170
8171         * config.bfd (arm-*-netbsd*): Add bfd_elf32_littlearm_vec
8172         and bfd_elf32_bigarm_vec to targ_selvecs.
8173
8174 2002-05-29  Ralf Habacker  <ralf.habacker@freenet.de>
8175
8176         * peXXigen.c (pe_print_idata): Fix seg faults on printing import tables
8177         with auto-imported symbols.
8178
8179 2002-05-29  Adam Nemet  <anemet@lnxw.com>
8180
8181         * elf32-arm.h (bfd_elf32_arm_get_bfd_for_interworking): Don't add glue
8182         sections only record bfd.
8183         (bfd_elf32_arm_add_glue_sections_to_bfd): New function.
8184         * bfd-in.h (bfd_elf32_arm_add_glue_sections_to_bfd): Declare it.
8185         * bfd-in2.h: Regenerate.
8186
8187 2002-05-28  Nick Clifton  <nickc@cambridge.redhat.com>
8188
8189         * syms.c (_bfd_stab_section_find_nearest_line): Move
8190         declaration and initialisation of saw_line and saw_func out of
8191         for loop.
8192
8193 2002-05-29  Alan Modra  <amodra@bigpond.net.au>
8194
8195         * elf64-ppc.c (ppc64_elf_get_symbol_info): New function.
8196         (bfd_elf64_get_symbol_info): Define.
8197         * elfxx-target.h (bfd_elfNN_get_symbol_info): Only define if undef.
8198
8199 2002-05-29  Andrey Volkov  <avolkov@transas.com>
8200
8201         * cpu-h8300.c: Make default h8300 machine first in machine list.
8202
8203 2002-05-28  Kuang Hwa Lin <kuang@sbcglobal.net>
8204
8205         * config.bfd: Added DLX configuraton.
8206         * Makefile.am: Added DLX configuraton.
8207         * configure.in: Added DLX configuraton.
8208         * archures.c: Add DLX architecure.
8209         * reloc.c: Add DLX relocs.
8210         * targets.c: Added DLX target vector.
8211         * configure: Regenerate.
8212         * Makefile.in: Regenreate.
8213         * bfd-in2.h: Regenreate.
8214         * elf32-dlx.c: New file: Support DLX target.
8215         * cpu-dlx.c: New file: Support DLX target.
8216
8217 2002-05-25  Alan Modra  <amodra@bigpond.net.au>
8218
8219         * elf32-m68k.c (elf32_m68k_print_private_bfd_data): Formatting.
8220
8221         * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Revert last change.
8222         (ppc64_elf_check_relocs): Don't set up function descriptor symbol
8223         strings to point inside function code sym string.
8224         (func_desc_adjust): Likewise.
8225         (ppc64_elf_hide_symbol): Rewrite code to look up function code sym.
8226
8227 2002-05-24  Michal Ludvig  <mludvig@suse.cz>
8228
8229         * elf64-x86-64.c (elf64_x86_64_grok_prstatus): Added.
8230         (elf64_x86_64_grok_psinfo): Added.
8231
8232 2002-05-24  TAMURA Kent <kent@netbsd.org>
8233
8234         * config.bfd: Add a target for i386-netbsdpe.
8235
8236 2002-05-24  Alan Modra  <amodra@bigpond.net.au>
8237
8238         * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Don't copy is_func
8239         and is_func_descriptor.
8240         (func_desc_adjust): Hide function code sym in shared libs unless
8241         there is a matching exported function descriptor sym.
8242
8243 2002-05-23  Jakub Jelinek  <jakub@redhat.com>
8244
8245         * elf.c (_bfd_elf_make_section_from_shdr): Set SEC_THREAD_LOCAL
8246         for symbols from SHF_TLS section.
8247         (_bfd_elf_print_private_bfd_data): Add PT_TLS.
8248         (elf_fake_sections): Set SHF_TLS for SEC_THREAD_LOCAL sections.
8249         (map_sections_to_segments): Build PT_TLS segment if necessary.
8250         (assign_file_positions_for_segments): Likewise.
8251         (get_program_header_size): Account for PT_TLS segment.
8252         (swap_out_syms): Set type of BSF_THREAD_LOCAL symbols and symbols from
8253         SEC_THREAD_LOCAL sections to STT_TLS.
8254         * reloc.c: Add 386 and IA-64 TLS relocs.
8255         * section.c (SEC_THREAD_LOCAL): Define.
8256         (SEC_CONSTRUCTOR_TEXT, SEC_CONSTRUCTOR_DATA, SEC_CONSTRUCTOR_BSS):
8257         Remove.
8258         * elflink.h (elf_link_add_object_symbols): Support .tcommon.
8259         (size_dynamic_sections): If DF_STATIC_TLS, set DF_FLAGS
8260         unconditionally.
8261         (struct elf_final_link_info): Add first_tls_sec.
8262         (elf_bfd_final_link): Set first_tls_sec.
8263         Compute elf_hash_table (info)->tls_segment.
8264         (elf_link_output_extsym): Handle STT_TLS symbols.
8265         (elf_link_input_bfd): Likewise.
8266         * syms.c (BSF_THREAD_LOCAL): Define.
8267         * bfd-in2.h: Rebuilt.
8268         * libbfd.h: Rebuilt.
8269         * elf32-i386.c (elf_i386_tls_transition, dtpoff_base, tpoff,
8270         elf_i386_mkobject, elf_i386_object_p): New functions.
8271         (elf_howto_table): Add TLS relocs.
8272         (elf_i386_reloc_type_lookup): Support TLS relocs.
8273         (elf_i386_info_to_howto_rel): Likewise.
8274         (struct elf_i386_link_hash_entry): Add tls_type.
8275         (struct elf_i386_obj_tdata): New.
8276         (elf_i386_hash_entry, elf_i386_tdata, elf_i386_local_got_tls_type):
8277         New macros.
8278         (struct elf_i386_link_hash_table): Add tls_ldm_got.
8279         (link_hash_newfunc): Clear tls_type.
8280         (elf_i386_check_relocs): Support TLS relocs.
8281         (elf_i386_gc_sweep_hook): Likewise.
8282         (allocate_dynrelocs): Likewise.
8283         (elf_i386_size_dynamic_sections): Likewise.
8284         (elf_i386_relocate_section): Likewise.
8285         (elf_i386_finish_dynamic_symbol): Likewise.
8286         (bfd_elf32_mkobject, elf_backend_object_p): Define.
8287         * elfxx-ia64.c (struct elfNN_ia64_dyn_sym_info): Add tprel_offset,
8288         dtpmod_offset, dtprel_offset, tprel_done, dtpmod_done, dtprel_done,
8289         want_tprel, want_dtpmod, want_dtprel.
8290         (elfNN_ia64_tprel_base, elfNN_ia64_dtprel_base): New functions.
8291         (ia64_howto_table): Add TLS relocs, rename R_IA64_LTOFF_TP22 to
8292         R_IA64_LTOFF_TPREL22.
8293         (elf_code_to_howto_index): Add TLS relocs.
8294         (elfNN_ia64_check_relocs): Support TLS relocs.
8295         (allocate_global_data_got): Account for TLS .got data.
8296         (allocate_dynrel_entries): Account for TLS dynamic relocations.
8297         (elfNN_ia64_install_value): Supprt TLS relocs.
8298         (set_got_entry): Support TLS relocs.
8299         (elfNN_ia64_relocate_section): Likewise.
8300
8301 2002-05-23  Nick Clifton  <nickc@cambridge.redhat.com>
8302
8303         * elf32-arm.h (elf32_arm_final_link_relocate): For the Thumb
8304         BLX reloc round the relocation up rather than down.
8305         * coff-arm.c (coff_arm_relocate_section): Likewise.
8306
8307 2002-05-21  H.J. Lu  (hjl@gnu.org)
8308
8309         * linker.c (_bfd_generic_link_add_one_symbol): Allow multiple
8310         definition.
8311
8312 2002-05-22  Alan Modra  <amodra@bigpond.net.au>
8313
8314         * elf64-ppc.c (ppc64_elf_size_stubs): Don't strip .branch_lt.
8315         (ppc64_elf_relocate_section): Handle unresolved relocs in opd.
8316
8317 2002-05-22  Alan Modra  <amodra@bigpond.net.au>
8318
8319         * elf64-ppc.c (ppc64_elf_relocate_section): Return false for
8320         unresolved relocs.
8321         (ppc64_elf_size_dynamic_sections): Check for splt NULL.
8322
8323 2002-05-21  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
8324
8325         * bfd.c (bfd_get_arch_size): Remove bfd_set_error call for
8326         non-ELF targets.
8327
8328 2002-05-21  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
8329
8330         * elf-bfd.h (elf_backend_emit_relocs): Change prototype to return
8331         an error value.
8332         * elflink.h (elf_link_output_relocs): Likewise. Improve error message.
8333         return with false on error.
8334         (elf_link_input_bfd): Check reloc_emitter return value.
8335
8336 2002-05-21  Jason Thorpe  <thorpej@wasabisystems.com>
8337
8338         * config.bfd (armeb-*-netbsdelf*): New target.
8339
8340 2002-05-20  Alan Modra  <amodra@bigpond.net.au>
8341
8342         * elf64-ppc.c (ppc_build_one_stub): Point undefined function syms
8343         at the plt call stub.
8344
8345 2002-05-19  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
8346
8347         * cpu-mips.c (mips_compatible): Don't try to check machine
8348         compatibility.
8349
8350 2002-05-18  Tom Rix  <trix@redhat.com>
8351
8352         * coff64-rs6000.c (_bfd_xcoff64_swap_aux_out): Fix C_FILE auxent.
8353
8354 2002-05-17  Alan Modra  <amodra@bigpond.net.au>
8355
8356         * elf64-ppc.c (ppc64_elf_info_to_howto): Formatting.
8357         (ppc64_elf_relocate_section): Don't warn about reloc overflow when
8358         we've already warned about an undefined symbol.  Report more
8359         detail on reloc errors.
8360
8361 2002-05-17  Alan Modra  <amodra@bigpond.net.au>
8362
8363         * acinclude.m4 (AM_INSTALL_LIBBFD): New.
8364         * configure.in: Invoke AM_INSTALL_LIBBFD.
8365         * Makefile.am (install-data-local): Revert 2002-05-13.  Move to..
8366         (install_libbfd): .. New target.
8367         (uninstall_libbfd): Likewise.
8368         (install-bfdlibLTLIBRARIES): Likewise.
8369         (uninstall-bfdlibLTLIBRARIES): Likewise.
8370         (bfdlibdir): New.
8371         (bfdincludedir): New.
8372         (lib_LTLIBRARIES): Rename to bfdlib_LTLIBRARIES.
8373         * aclocal.m4: Regenerate.
8374         * configure: Regenerate.
8375         * Makefile.in: Regenerate.
8376
8377 2002-05-17  Stuart Balfour <sbalfour@cisco.com>
8378
8379         * hash.c (bfd_hash_lookup): Remove computation of len from inside
8380         hash loop.
8381
8382 2002-05-16  Nick Clifton  <nickc@cambridge.redhat.com>
8383
8384         * config.bfd: Add targets for sh64-linux (little endian and
8385         big endian).
8386
8387 2002-05-15  Laurent Pinchart <laurent.pinchart@skynet.be>
8388
8389         * peXXigen.c (pe_print_idata): Do not assume that the first thunk
8390         is located in the same section as the import table.  Instead
8391         check, and if necessary load the section containing the thunk.
8392
8393 2002-05-15  Nick Clifton  <nickc@cambridge.redhat.com>
8394
8395         * aix5ppc-core.c (xcoff64_core_p): Replace bfd_read with
8396         bfd_bread.
8397         (xcoff64_core_file_matches_executable_p): Replace bfd_read
8398         with bfd_bread.
8399
8400 2002-05-15  Alan Modra  <amodra@bigpond.net.au>
8401
8402         * aix5ppc-core.c: Warning fixes.
8403         * aout-adobe.c (aout_32_bfd_link_just_syms): Define.
8404         * aout-target.h (MY_bfd_link_just_syms): Define.
8405         * aout-tic30.c (MY_bfd_link_just_syms): Define.
8406         * bfd.c (bfd_link_just_syms): Define.
8407         * binary.c (binary_bfd_link_just_syms): Define.
8408         * bout.c (b_out_bfd_link_just_syms): Define.
8409         * coff-rs6000.c (rs6000coff_vec, pmac_xcoff_vec): Update initializer.
8410         * coff64-rs6000.c (rs6000coff64_vec, aix5coff64_vec): Likewise.
8411         * coffcode.h (coff_bfd_link_just_syms): Define.
8412         * elf-bfd.h (enum elf_link_info_type): Add ELF_INFO_TYPE_JUST_SYMS.
8413         (elf_discarded_section): Check for ELF_INFO_TYPE_JUST_SYMS.
8414         (_bfd_elf_link_just_syms): Declare.
8415         * elf.c (_bfd_elf_link_just_syms): New function.
8416         * elf-eh-frame.c (_bfd_elf_maybe_strip_eh_frame_hdr): Check that
8417         sections haven't already been discarded by the linker.
8418         * elflink.h (elf_link_add_object_symbols): Likewise for stab
8419         sections and SEC_MERGE sections.
8420         (elf_bfd_discard_info): Similarly here.
8421         * elfxx-target.h (bfd_elfNN_bfd_link_just_syms): Define.
8422         * i386msdos.c (msdos_bfd_link_just_syms): Define.
8423         * i386os9k.c (os9k_bfd_link_just_syms): Define.
8424         * ieee.c (ieee_bfd_link_just_syms): Define.
8425         * ihex.c (ihex_bfd_link_just_syms): Define.
8426         * libbfd-in.h (_bfd_nolink_bfd_link_just_syms): Define.
8427         (_bfd_generic_link_just_syms): Declare.
8428         * libecoff.h (_bfd_ecoff_bfd_link_just_syms): Define.
8429         * linker.c (_bfd_generic_link_just_syms): New function.
8430         * mmo.c (mmo_bfd_link_just_syms): Define.
8431         * nlm-target.h (nlm_bfd_link_just_syms): Define.
8432         * oasys.c (oasys_bfd_link_just_syms): Define.
8433         * ppcboot.c (ppcboot_bfd_link_just_syms): Define.
8434         * som.c (som_bfd_link_just_syms): Define.
8435         * srec.c (srec_bfd_link_just_syms): Define.
8436         * targets.c (struct bfd_target): Add _bfd_link_just_syms.
8437         (BFD_JUMP_TABLE_LINK): And here.
8438         * tekhex.c (tekhex_bfd_link_just_syms): Define.
8439         * versados.c (versados_bfd_link_just_syms): Define.
8440         * vms.c (vms_bfd_link_just_syms): Define.
8441         * libbfd.h: Regenerate.
8442         * bfd-in2.h: Regenerate.
8443
8444 2002-05-15  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
8445
8446         * elf32-mips.c: Remove superfluous definitions copied from
8447         elfxx-mips.c.
8448         (bfd_elf32_bigmips_vec,bfd_elf32_littlemips_vec): Use the
8449         SGIish vectors to check the special case.
8450         (mips_elf_hi16_reloc): Fix comment.
8451         (mips_elf_got16_reloc): Likewise.
8452         (_bfd_mips_elf32_gprel16_reloc): Likewise.
8453         (elf_reloc_map): Code cleanup.
8454         (mips_reloc_map): Add comment.
8455         (bfd_elf23_bfd_reloc_type_lookup): Code cleanup.
8456         (mips_elf32_rtype_to_howto): Likewise.
8457         (mips_elf32_discard_info): Likewise.
8458         (elf32_mips_irix_compat): Invert logic: Only SGIish vectors
8459         lead to IRIX compatibility now.
8460
8461 2002-05-15  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
8462
8463         * elfxx-mips.c: Call it IRIX, not Irix in comments.
8464
8465 2002-05-13  Jason Thorpe  <thorpej@wasabisystems.com>
8466
8467         * config.bfd (shle-*-netbsdelf*): Add target which includes
8468         sh64 support.
8469
8470 2002-05-13  David Edelsohn  <edelsohn@gnu.org>
8471
8472         * configure.in: Revert 2002-04-07.  Instead, auto-configure
8473         HAVE_ST_C_IMPL.
8474         * configure: Regenerate.
8475         * config.in: Regenerate.
8476         * rs6000-core.c (CNEW_IMPL): Guard use of c_impl with HAVE_ST_C_IMPL
8477         or AIX_5_CORE.
8478
8479 2002-05-11  Federico G. Schwindt <fgsch@olimpo.com.br>
8480
8481         * configure.in (sparc*-*-openbsd*): Support sparc64-openbsd
8482         corefiles as well.2
8483         * configure: Regenerate.
8484
8485 2002-05-13  Alan Modra  <amodra@bigpond.net.au>
8486
8487         * Makefile.am (install-data-local): Install headers to
8488         $(exec_prefix)/include.
8489         * Makefile.in: Regenerate.
8490
8491 2002-05-11  Ralf Corsepius  <corsepiu@faw.uni-ulm.de>
8492             Daniel Jacobowitz  <drow@mvista.com>
8493
8494         * coff-sh.c (sh_reloc_map): Map to R_SH_IMM32 for non-PE.  Don't
8495         map BFD_RELOC_RVA.
8496
8497 2002-05-11  Federico G. Schwindt <fgsch@olimpo.com.br>
8498
8499         * config.bfd (alpha*-*-openbsd*, sparc64*-*-openbsd*,
8500         hppa*-*-openbsd*): New targets.
8501         * configure.in (alpha*-*-openbsd*): Set COREFILE.
8502         * configure: Regenerate.
8503
8504 2002-05-10  Tom Rix  <trix@redhat.com>
8505
8506         * coff64-rs6000.c (xcoff64_reloc_type_br): New function for
8507         xcoff64_ppc_relocate_section.
8508         * coff-rs6000.c : Extern common xcoff_reloc_type functions.
8509         * libxcoff.h: Common xcoff_reloc_type function declaration.
8510
8511 2002-05-10  Alan Modra  <amodra@bigpond.net.au>
8512
8513         * elf32-i386.c (elf_i386_relocate_section): Remove overflow checks
8514         added in 2002-05-09 commit.
8515
8516         * elf32-hppa.c (elf32_hppa_size_stubs): Revert part of 2002-05-04,
8517         don't look for stubs on all undefined syms.
8518
8519 2002-05-09  Alan Modra  <amodra@bigpond.net.au>
8520
8521         * elf64-ppc.c (RA_REGISTER_MASK, RA_REGISTER_SHIFT): Delete.
8522         (ppc64_elf_howto_raw <R_PPC64_RELATIVE>): Not pc_relative or
8523         pcrel_offset.
8524
8525         * elf32-i386.c (elf_howto_table): Comments.
8526         (elf_i386_relocate_section): Handle more relocs for relocatable
8527         linking and against SEC_MERGE sections.
8528
8529 2002-05-08  Alan Modra  <amodra@bigpond.net.au>
8530
8531         * elf32-ppc.c (ppc_elf_create_got): New function.
8532         (ppc_elf_create_dynamic_sections): Call ppc_elf_create_got before
8533         _bfd_elf_create_dynamic_sections.  Correct .plt flags.
8534         (ppc_elf_check_relocs): Use ppc_elf_create_got in place of
8535         _bfd_elf_create_got_section.
8536
8537 2002-05-07  Alan Modra  <amodra@bigpond.net.au>
8538
8539         * elf-bfd.h (struct elf_backend_data): Add rela_normal.
8540         * elfxx-target.h (elf_backend_rela_normal): Define.
8541         (elfNN_bed): Init rela_normal.
8542         * elflink.h (elf_link_input_bfd <emit_relocs>): Handle adjustment
8543         for section symbols here if rela_normal.  Simplify abs section test.
8544         * elf-m10200.c (mn10200_elf_relocate_section): If relocatable,
8545         return immediately.  Remove code handling relocatable linking.
8546         * elf-m10300.c (mn10300_elf_relocate_section): Likewise.
8547         * elf32-fr30.c (fr30_elf_relocate_section): Likewise.
8548         * elf32-i370.c (i370_elf_relocate_section): Likewise.
8549         * elf32-i860.c (elf32_i860_relocate_section): Likewise.
8550         * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
8551         * elf32-mcore.c (mcore_elf_relocate_section): Likewise.
8552         * elf32-openrisc.c (openrisc_elf_relocate_section): Likewise.
8553         * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
8554         * elf32-s390.c (elf_s390_relocate_section): Likewise.
8555         * elf32-xstormy16.c (xstormy16_elf_relocate_section): Likewise.
8556         * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
8557         * elf64-s390.c (elf_s390_relocate_section): Likewise.
8558         * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
8559         * elfxx-ia64.c (elfNN_ia64_relocate_section): Likewise.
8560         * elf32-arm.h (elf32_arm_relocate_section): Likewise #ifndef USE_REL.
8561         * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
8562         * elf-m10200.c (elf_backend_rela_normal): Define.
8563         * elf-m10300.c (elf_backend_rela_normal): Define.
8564         * elf32-fr30.c (elf_backend_rela_normal): Define.
8565         * elf32-i370.c (elf_backend_rela_normal): Define.
8566         * elf32-i860.c (elf_backend_rela_normal): Define.
8567         * elf32-m68k.c (elf_backend_rela_normal): Define.
8568         * elf32-mcore.c (elf_backend_rela_normal): Define.
8569         * elf32-openrisc.c (elf_backend_rela_normal): Define.
8570         * elf32-ppc.c (elf_backend_rela_normal): Define.
8571         * elf32-s390.c (elf_backend_rela_normal): Define.
8572         * elf32-xstormy16.c (elf_backend_rela_normal): Define.
8573         * elf64-ppc.c (elf_backend_rela_normal): Define.
8574         * elf64-s390.c (elf_backend_rela_normal): Define.
8575         * elf64-x86-64.c (elf_backend_rela_normal): Define.
8576         * elfxx-ia64.c (elf_backend_rela_normal): Define.
8577         * elf32-arm.h (elf_backend_rela_normal): Define #ifndef USE_REL.
8578         * elf32-m32r.c (elf_backend_rela_normal): Likewise.
8579
8580 2002-05-06  Nick Clifton  <nickc@cambridge.redhat.com>
8581
8582         * elf32-arm.h (elf32_arm_final_link_relocate): Convert
8583         'reloc_signed_max' and 'reloc_signed_min' into half-word offsets.
8584
8585 2002-05-06  Alan Modra  <amodra@bigpond.net.au>
8586
8587         * elflink.h (elf_link_input_bfd <emit_relocs>): Adjust r_offset
8588         when not relocatable.  Fix reloc_emitter call for K&R.
8589
8590 2002-05-04  Alan Modra  <amodra@bigpond.net.au>
8591
8592         * elf64-ppc.c (ppc64_elf_relocate_section): Reinstate code
8593         reloading local sym addend mistakenly removed in 2002-05-01 change.
8594
8595         * dwarf2.c (struct line_head): Make prologue_length a bfd_vma.
8596         (read_abbrevs): Change "offset" param to bfd_vma.
8597         (parse_comp_unit): Change "version" and addr_size to unsigned ints.
8598         Change "abbrev_offset" to bfd_vma.
8599         (read_indirect_string): Use correct conversion chars in error
8600         message format string, cast bfd_vma's to unsigned long.
8601         (read_abbrevs): Likewise.
8602         (read_attribute_value): Likewise.
8603         (decode_line_info): Likewise.
8604         (scan_unit_for_functions): Likewise.
8605         (parse_comp_unit): Likewise.
8606
8607 2002-05-04  Tom Rix  <trix@redhat.com>
8608
8609         * coffswap.h (coff_swap_reloc_in): Remove XCOFF support.
8610         (coff_swap_reloc_out): Same.
8611         * coff-rs6000.c: (xcoff_swap_reloc_in): Moved from coffswap.h.
8612         (xcoff_swap_reloc_out): Same.
8613         (xcoff_rtype2howto): Renamed from _bfd_xcoff_rtype2howto. Special
8614         case some 16 bit relocs. Add reloc value to output.
8615         (xcoff_howto_table): Remove 64 bit R_POS, add 16 bit
8616         R_RBR. Improve names.
8617         (_bfd_xcoff_reloc_type_lookup): Adjust for removal of 64 bit R_POS.
8618         (bfd_xcoff_backend_data): Update with new reloc swap names.
8619         (bfd_pmac_xcoff_backend_data) : Same.
8620         * coff64-rs6000.c: (xcoff64_swap_reloc_in): Moved from coffswap.h.
8621         (xcoff64_swap_reloc_out): Same.
8622         (xcoff64_rtype2howto): Special case some 16 bit relocs and 32 bit
8623         R_POS. Add reloc value to output.
8624         (xcoff64_howto_table): Move 64 bit R_POS to first entry.  Add 16
8625         bit R_RBR. Improve names, masks.
8626         (xcoff64_reloc_type_lookup): Adjust for move of 64 bit R_POS.
8627         (bfd_xcoff_backend_data): Update with new reloc swap names.
8628         (bfd_xcoff_aix5_backend_data) : Same.
8629
8630 2002-05-04  Alan Modra  <amodra@bigpond.net.au>
8631
8632         * elf32-hppa.c (struct elf32_hppa_link_hash_table): Add
8633         bfd_count top_index, input_list, all_local_syms.
8634         (elf32_hppa_setup_section_lists): New function, split from
8635         elf32_hppa_size_stubs.
8636         (elf32_hppa_next_input_section): Likewise.
8637         (group_sections): Likewise.
8638         (get_local_syms): Likewise.
8639         (elf32_hppa_size_stubs): Adjust for split out functions.  Look for
8640         stubs on undefined syms too.
8641         (elf32_hppa_set_gp): Use bfd_link_hash* instead of elf_link_hash*.
8642         Only access htab elf fields when we have an elf hash table.
8643         * elf32-hppa.h (elf32_hppa_setup_section_lists): Declare.
8644         (elf32_hppa_next_input_section): Declare.
8645
8646 2002-05-04  Bob Byrnes  <byrnes@curl.com>
8647
8648         * opncls.c (_bfd_new_bfd_contained_in): Check return value of
8649         _bfd_new_bfd.
8650
8651 2002-05-03  H.J. Lu  (hjl@gnu.org)
8652
8653         * elfxx-mips.c (mips_elf_link_hash_entry): Add forced_local.
8654         (mips_elf_link_hash_newfunc): Initialize forced_local to false.
8655         (mips_elf_record_global_got_symbol): Call _bfd_mips_elf_hide_symbol
8656         to hide a global symbol.
8657         (_bfd_mips_elf_hide_symbol): Return if forced_local is true. Set
8658         forced_local to true.
8659
8660 2002-05-02  Richard Henderson  <rth@redhat.com>
8661
8662         * elf64-alpha.c (elf64_alpha_relocate_section): Force relative relocs
8663         vs SHN_UNDEF to zero.
8664
8665 2002-05-02  Alan Modra  <amodra@bigpond.net.au>
8666
8667         * elf64-ppc.c (ppc64_elf_howto_raw <R_PPC64_SECTOFF>): Change to a
8668         16 bit reloc.
8669         <R_PPC64_SECTOFF_DS>: Likewise.
8670         (ppc64_elf_reloc_type_lookup): Map from BFD_RELOC_16_BASEREL to
8671         SECTOFF reloc.
8672         * elf32-ppc.c (ppc_elf_howto_raw <R_PPC_SECTOFF>): Correct.
8673         (ppc_elf_reloc_type_lookup): Map from BFD_RELOC_16_BASEREL to
8674         SECTOFF reloc.
8675
8676         * elf64-ppc.c (ppc64_elf_addr16_ha_reloc): Delete.
8677         (ppc64_elf_ha_reloc): New function.
8678         (ppc64_elf_brtaken_reloc): New function.
8679         (ppc64_elf_sectoff_reloc): New function.
8680         (ppc64_elf_sectoff_ha_reloc): New function.
8681         (ppc64_elf_toc_reloc): New function.
8682         (ppc64_elf_toc_ha_reloc): New function.
8683         (ppc64_elf_toc64_reloc): New function.
8684         (ppc64_elf_unhandled_reloc): New function.
8685         (ppc64_elf_howto_raw): Use the above.
8686         <R_PPC64_RELATIVE>: Mark pc_relative, pcrel_offset.
8687         <R_PPC64_SECTOFF>: Not pc_relative or pcrel_offset.  Fix dst_mask.
8688         <R_PPC64_SECTOFF_DS>: Likewise.
8689         (IS_ABSOLUTE_RELOC): Update.
8690         (struct ppc_link_hash_table): Add have_undefweak.
8691         (ppc64_elf_link_hash_table_create): Init.
8692         (func_desc_adjust): Set have_undefweak.
8693         (ppc64_elf_func_desc_adjust): Call func_desc_adjust earlier.  Only
8694         add the .sfpr blr when have_undefweak.
8695         (ppc64_elf_setup_section_lists): Check hash table flavour.
8696         (ppc64_elf_next_input_section): Move output_section->owner test to
8697         ppc64elf.em.
8698         (ppc64_elf_set_toc): Rename to ppc64_elf_toc, remove info param
8699         and relocatable test.  Return TOCstart and don't set elf_gp.
8700         (ppc64_elf_relocate_section): Correct BRTAKEN/BRNTAKEN branch
8701         offset calculation.  Add assert on weak sym branch tweaks.
8702         * elf64-ppc.h (ppc64_elf_set_toc): Delete.
8703         (ppc64_elf_toc): Declare.
8704         (ppc64_elf_next_input_section): Update.
8705
8706 2002-05-01  Alan Modra  <amodra@bigpond.net.au>
8707
8708         * syms.c (_bfd_stab_section_find_nearest_line): Don't bomb on NULL
8709         file_name.
8710
8711 2002-05-01  Alan Modra  <amodra@bigpond.net.au>
8712
8713         * elf64-ppc.c (CROR_151515, CROR_313131): Define.
8714         (ppc64_elf_relocate_section): Use them.  Don't look for plt calls
8715         on R_PPC64_ADDR24 relocs.  Require a nop or no link reg on plt
8716         call branches.  Correct undefined weak destination.
8717         (ppc64_elf_func_desc_adjust): Always create at least one blr in
8718         .sfpr, and correct case where either only savef* or restf* is
8719         needed.
8720
8721         Long branch stubs, multiple stub sections.
8722         * elf64-ppc.h (ppc64_elf_setup_section_lists): Declare.
8723         (ppc64_elf_next_input_section): Declare.
8724         * elf64-ppc.c: Move linker-only prototypes.
8725         (STUB_SUFFIX): Define.
8726         (enum ppc_stub_type): New.
8727         (struct ppc_stub_hash_entry): New.
8728         (struct ppc_branch_hash_entry): New.
8729         (struct ppc_link_hash_entry): Add stub_cache, oh.
8730         (struct ppc_link_hash_table): Add stub_hash_table etc.  Remove
8731         sstub.  Add sbrlt, srelbrlt, has_14bit_branch, stub_iteration.
8732         Rename plt_overflow to stub_error.
8733         (ppc_stub_hash_lookup): Define.
8734         (ppc_branch_hash_lookup): Define.
8735         (stub_hash_newfunc): New function.
8736         (branch_hash_newfunc): New function.
8737         (link_hash_newfunc): Init new fields.
8738         (ppc64_elf_link_hash_table_create): Likewise.
8739         (ppc64_elf_link_hash_table_free): New function.
8740         (ppc_stub_name): New function.
8741         (ppc_get_stub_entry): New function.
8742         (ppc_add_stub): New function.
8743         (create_linkage_sections): Use bfd_make_section_anyway.  Create
8744         .branch_lt and .rela.branch_lt sections.  Don't create .stub.
8745         (ppc64_elf_check_relocs): Set has_14bit_branch on R_PPC64_REL14*,
8746         and set up for plt call stubs.  Link func and func desc syms.
8747         (ppc64_elf_gc_sweep_hook): Handle REL14* as per REL24.
8748         (func_desc_adjust): Avoid hash lookup when func desc sym available
8749         via shortcut, and set links when processing.
8750         (ppc64_elf_hide_symbol): Likewise.
8751         (allocate_dynrelocs): Don't allocate stub section here.
8752         (ppc64_elf_size_dynamic_sections): Handle sbrlt and srelbrlt.
8753         Remove sstub code.
8754         (ppc_type_of_stub): New function.
8755         (build_one_stub): Delete.
8756         (ppc_build_one_stub): New function.
8757         (ppc_size_one_stub): New function.
8758         (ppc64_elf_setup_section_lists): New function.
8759         (ppc64_elf_next_input_section): New function.
8760         (group_sections): New function.
8761         (get_local_syms): New function.
8762         (ppc64_elf_size_stubs): Rewrite.
8763         (ppc64_elf_build_stubs): Rewrite.
8764         (ppc64_elf_relocate_section): Look up stub entry for REL24
8765         relocs.  Don't propagate REL14* to dynamic objects.  Look for long
8766         branch stubs if REL14* or REL24 relocs won't reach.
8767         (bfd_elf64_bfd_link_hash_table_free): Define.
8768
8769 2002-04-30  Mark Mitchell  <mark@codesourcery.com>
8770
8771         * config.bfd: Add support for powerpc-*-windiss.
8772
8773 2002-04-30  Tom Rix  <trix@redhat.com>
8774
8775         * xcofflink.c (xcoff_link_add_symbols): Always copy undef C_EXT
8776         symbol names into the hash table.
8777
8778 2002-04-28  Tom Rix  <trix@redhat.com>
8779
8780         * coff-rs6000.c (xcoff_calculate_relocation) : Function table for
8781         calulating relocations.
8782         (xcoff_complain_overflow) : Function table for relocation errors.
8783         (xcoff_ppc_relocate_section): Use relocation and complain function
8784         tables.
8785         (xcoff_complain_overflow_unsigned_func): New complain function.
8786         (xcoff_complain_overflow_signed_func): Same.
8787         (xcoff_complain_overflow_bitfield_func): Same.
8788         (xcoff_complain_overflow_dont_func): Same.
8789         (xcoff_reloc_type_crel): New recot function.
8790         (xcoff_reloc_type_br): Same.
8791         (xcoff_reloc_type_ba): Same.
8792         (xcoff_reloc_type_toc): Same.
8793         (xcoff_reloc_type_rel): Same.
8794         (xcoff_reloc_type_neg): Same.
8795         (xcoff_reloc_type_pos): Same.
8796         (xcoff_reloc_type_fail): Same.
8797         (xcoff_reloc_type_noop): Same.
8798         * libxcoff.h : Declare common parts for xcoff64.
8799         * coff64-rs6000.c (xcoff64_ppc_relocate_section): Use relocation
8800         and complain function tables.
8801
8802 2002-04-28  Alan Modra  <amodra@bigpond.net.au>
8803
8804         * elf64-x86-64.c (struct elf64_x86_64_dyn_relocs): Comment typo.
8805         * elf32-hppa.c (elf32_hppa_final_link): Formatting.
8806
8807 2002-04-26  Alan Modra  <amodra@bigpond.net.au>
8808
8809         * opncls.c (bfd_make_readable): Call bfd_section_list_clear.
8810         * xcofflink.c (xcoff_link_add_dynamic_symbols): Likewise.
8811
8812         * elflink.h (elf_bfd_final_link): Ensure input bfd class is the
8813         same as the output before calling elf_link_input_bfd.
8814
8815         * coffcode.h (coff_compute_section_file_positions): Set
8816         section_tail after shuffling section list.
8817
8818 2002-04-24  Christian Groessler <chris@groessler.org>
8819
8820         * coff-z8k.c (extra_case): Fix R_IMM32 relocations: The
8821         addresses are 23bit with a special layout, not plain 32bit
8822         values.  Prevent relocation of immediate values.
8823
8824 2002-04-24  Chris G. Demetriou  <cgd@broadcom.com>
8825
8826         * elfxx-mips.c (_bfd_mips_elf_print_private_bfd_data): If MDMX or
8827         MIPS-16 ASE flags are set, print something to indicate that.
8828
8829 2002-04-23  Alan Modra  <amodra@bigpond.net.au>
8830
8831         * elf32-hppa.c (hppa_type_of_stub): Correct and simplify condition
8832         under which a plt call stub is used.
8833         (final_link_relocate): Similarly.
8834         (allocate_plt_static): Clear h-plabel except when plt entry is
8835         exclusively used for a plabel.
8836         (allocate_dynrelocs): Use the above to simplify plt sizing.
8837         (struct elf32_hppa_link_hash_table): Add has_22bit_branch.
8838         (elf32_hppa_link_hash_table_create): Init.
8839         (BL22_RP): Define.
8840         (hppa_build_one_stub): Use BL22_RP if has_22bit_branch.
8841         (elf32_hppa_check_relocs): Set has_22bit_branch.
8842
8843         * elf32-hppa.c (elf32_hppa_check_relocs): Remove debug message.
8844         (final_link_relocate): Likewise.
8845
8846 2002-04-22  Jakub Jelinek  <jakub@redhat.com>
8847
8848         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Don't build
8849         search table if some FDE is DW_EH_PE_aligned encoded either.
8850         (_bfd_elf_write_section_eh_frame): Handle terminating FDE specially.
8851
8852 2002-04-22  Richard Smith  <richard@ex-parrot.com>
8853             Jakub Jelinek  <jakub@redhat.com>
8854
8855         * elf-eh-frame.c (struct eh_cie_fde): Add per_encoding_relative.
8856         (_bfd_elf_discard_section_eh_frame): Set it for CIEs with pcrel
8857         encoded personality.
8858         (_bfd_elf_write_section_eh_frame): Adjust pcrel encoded personality
8859         for CIE/FDE removal.
8860
8861 2002-04-20  Tom Rix  <trix@redhat.com>
8862
8863         * coff64-rs6000.c (_bfd_xcoff64_swap_aux_in): Fix C_FILE auxent.
8864
8865 2002-04-20  Alan Modra  <amodra@bigpond.net.au>
8866
8867         * archures.c (bfd_lookup_arch): Move the list order comment..
8868         (struct bfd_arch_info): ..to where it belongs.
8869         * bfd-in2.h: Regenerate.
8870
8871         * archures.c (bfd_lookup_arch): Add comment on list order.
8872         (bfd_default_set_arch_mach): Use bfd_lookup_arch.
8873         * cpu-powerpc.c (bfd_powerpc_archs): Re-order so that the default
8874         is always at head of list.
8875
8876 2002-04-18  Nick Clifton  <nickc@cambridge.redhat.com>
8877
8878         * coff-arm.c (coff_thumb_pcrel_12, coff_thumb_pcrel_9,
8879         insert_thumb_branch, record_thumb_to_arm_glue): Suppress
8880         definition of these functions for ARM_WINCE builds as they are
8881         not used.
8882         (SWAP_IN_RELOC_OFFSET, SWAP_OUT_RELOC_OFFSET): Do not define
8883         for ARM_WINCE builds.
8884
8885 2002-04-18  Nick Clifton  <nickc@cambridge.redhat.com>
8886
8887         * coff-arm.c (bfd_arm_process_before_allocation):
8888
8889 2002-04-17  J"orn Rennecke <joern.rennecke@superh.com>
8890
8891         * cpu-sh.c (scan_mach): Delete.
8892         (arch_info_struct): Replace scan_mach with bfd_default_scan.
8893         (bfd_sh_arch): Likewise.
8894
8895 2002-04-16  Nick Clifton  <nickc@cambridge.redhat.com>
8896
8897         * ihex.c (ihex_write_object_contents): Fix check for records
8898         crossing 64K boundaries.
8899
8900 2002-04-16  Alan Modra  <amodra@bigpond.net.au>
8901
8902         * elf32-m32r.c (m32r_elf_add_symbol_hook): Check the hash table
8903         type rather than just assuming entries are ELF.
8904         * elf32-sh64.c (sh64_elf_add_symbol_hook): Likewise.
8905         * elf64-sh64.c (sh64_elf64_add_symbol_hook): Likewise.
8906         * elf64-sparc.c (sparc64_elf_add_symbol_hook): Likewise.
8907         * elf64-mmix.c (mmix_elf_add_symbol_hook): Use bfd_link_hash_entry
8908         rather than elf_link_hash_entry.
8909
8910 2002-04-15  Richard Henderson  <rth@redhat.com>
8911
8912         * elf32-mips.c (mips_elf32_object_p): Revert 0404 fragment: allow
8913         n32 binaries.
8914
8915 2002-04-15  Michael Snyder  <msnyder@redhat.com>
8916
8917         * opncls.c (bfd_close): Write contents if writeable.
8918         Minor formatting tidy-ups.
8919
8920 2002-04-15  Alan Modra  <amodra@bigpond.net.au>
8921
8922         * elf32-ppc.c (ppc_elf_add_symbol_hook): Check the hash table type.
8923
8924 2002-04-12  Michael Snyder  <msnyder@redhat.com>
8925
8926         * bfd-in.h (bfd_get_section_lma): New access macro.
8927         Minor white-space fix-up.
8928
8929 2002-04-12  Alan Modra  <amodra@bigpond.net.au>
8930
8931         * elf.c (prep_headers): Don't zero EI_OSABI, EI_ABIVERSION or
8932         header pad.
8933
8934 2002-04-09  DJ Delorie  <dj@redhat.com>
8935
8936         * elfarm-nabi.c (elf32_arm_howto_table): Fix ABS16 masks.
8937
8938 2002-04-09  Casper S. Hornstrup <chorns@users.sourceforge.net>
8939
8940         * coffcode.h (coff_read_word): New.
8941         (coff_compute_checksum): New.
8942         (coff_apply_checksum): New.
8943         (coff_write_object_contents): Call coff_apply_checksum () to
8944         apply checksum to PE image.
8945
8946 2002-04-08  Randolph Chung  <tausq@debian.org>
8947
8948         * elf32-hppa.c (hppa_unwind_entry_compare): Move to elf-hppa.h.
8949         (elf32_hppa_final_link): Split out sorting logic to..
8950         * elf-hppa.h (elf_hppa_sort_unwind): ..here.
8951         (elf_hppa_final_link): Call elf_hppa_sort_unwind.
8952
8953 2002-04-07  Andrew Cagney  <ac131313@redhat.com>
8954
8955         * configure.in: Add missing ``|'' to powerpc-*-aix4.[4-9]*
8956         pattern.
8957         * configure: Re-generate.
8958
8959 2002-04-07  Andrew Cagney  <ac131313@redhat.com>
8960
8961         * configure.in: Only define AIX_CORE_DUMPX_CORE when AIX version
8962         is greater or equal to 4.3.3.
8963         * configure: Regenerate.
8964         Fix PR gdb/344.
8965
8966 2002-04-05  Hans-Peter Nilsson  <hp@axis.com>
8967
8968         * elf32-cris.c (cris_elf_howto_table) <R_CRIS_16_PCREL,
8969         R_CRIS_32_PCREL>: Fix typo in name.
8970         (cris_elf_check_relocs): Always create .rela.got here when
8971         R_CRIS_16_GOTPLT or R_CRIS_32_GOTPLT is seen.
8972         (elf_cris_adjust_gotplt_to_got): Don't create .rela.got here;
8973         assume it's created.
8974
8975 2002-04-04  Daniel Jacobowitz  <drow@mvista.com>
8976
8977         * aout-adobe.c (aout_32_bfd_link_hash_table_free): Define.
8978         * aout-target.h (MY_bfd_link_hash_table_free): Conditionally
8979         define.
8980         * aout-tic30.c (MY_bfd_link_hash_table_free): Likewise.
8981         * bfd.c (bfd_link_hash_table_free): Define.
8982         * binary.c (binary_bfd_link_hash_table_free): Define.
8983         * bout.c (b_out_bfd_link_hash_table_free): Define.
8984         * coff-rs6000.c (rs6000coff_vec): Include
8985         _bfd_generic_link_hash_table_free.
8986         (pmac_xcoff_vec): Likewise.
8987         * coff64-rs6000.c (rs6000coff64_vec): Likewise.
8988         (aix5coff64_vec): Likewise.
8989         * coffcode.h (coff_bfd_link_hash_table_free): Conditionally define.
8990         * elf-m10300.c (elf32_mn10300_link_hash_table_free): New function.
8991         (bfd_elf32_bfd_link_hash_table_free): Define.
8992         * elf32-hppa.c (elf32_hppa_link_hash_table_free): New function.
8993         (bfd_elf32_bfd_link_hash_table_free): Define.
8994         * elfxx-target.h (bfd_elfNN_bfd_link_hash_table_free): Conditionally
8995         define.
8996         * i386msdos.c (msdos_bfd_link_hash_table_free): Define.
8997         * i386os9k.c (os9k_bfd_link_hash_table_free): Define.
8998         * ieee.c (ieee_bfd_link_hash_table_free): Define.
8999         * ihex.c (ihex_bfd_link_hash_table_free): Define.
9000         * libbfd-in.h (_bfd_nolink_bfd_link_hash_table_free): Define.
9001         (_bfd_generic_link_hash_table_free): Add prototype.
9002         * libcoff-in.h (_bfd_xcoff_bfd_link_hash_table_free): Add prototype.
9003         * libecoff.h (_bfd_ecoff_bfd_link_hash_table_free): Define.
9004         * linker.c (_bfd_generic_link_hash_table_free): New function.
9005         * mmo.c (mmo_bfd_link_hash_table_free): Define.
9006         * nlm-target.h (nlm_bfd_link_hash_table_free): Define.
9007         * oasys.c (oasys_bfd_link_hash_table_free): Define.
9008         * ppcboot.c (ppcboot_bfd_link_hash_table_free): Define.
9009         * som.c (som_bfd_link_hash_table_free): Define.
9010         * srec.c (srec_bfd_link_hash_table_free): Define.
9011         * tekhex.c (tekhex_bfd_link_hash_table_free): Define.
9012         * versados.c (versados_bfd_link_hash_table_free): Define.
9013         * vms.c (vms_bfd_link_hash_table_free): New function.
9014         * xcofflink.c (_bfd_xcoff_bfd_link_hash_table_free): New function.
9015
9016         * coff-arm.c (coff_arm_link_hash_table_create): Use bfd_malloc
9017         instead of bfd_alloc.
9018         * coff-h8300.c (h8300_coff_link_hash_table_create): Likewise.
9019         * coff-mcore.c (coff_mcore_link_hash_table_create): Likewise.
9020         * coff-ppc.c (ppc_coff_link_hash_table_create): Likewise.
9021         * cofflink.c (_bfd_coff_link_hash_table_create): Likewise.
9022         * ecoff.c (_bfd_ecoff_bfd_link_hash_table_create): Likewise.
9023         * elf-m10300.c (elf32_mn10300_link_hash_table_create): Likewise.
9024         * elf.c (_bfd_elf_link_hash_table_create): Likewise.
9025         * elf32-arm.h (elf32_arm_link_hash_table_create): Likewise.
9026         * elf32-cris.c (elf_cris_link_hash_table_create): Likewise.
9027         * elf32-hppa.c (elf32_hppa_link_hash_table_create): Likewise.
9028         * elf32-i386.c (elf_i386_link_hash_table_create): Likewise.
9029         * elf32-m68k.c (elf_m68k_link_hash_table_create): Likewise.
9030         * elf32-s390.c (elf_s390_link_hash_table_create): Likewise.
9031         * elf32-sh.c (sh_elf_link_hash_table_create): Likewise.
9032         * elf64-alpha.c (elf64_alpha_bfd_link_hash_table_create): Likewise.
9033         * elf64-ppc.c (ppc64_elf_link_hash_table_create): Likewise.
9034         * elf64-s390.c (elf_s390_link_hash_table_create): Likewise.
9035         * elf64-sh64.c (sh64_elf64_link_hash_table_create): Likewise.
9036         * elf64-sparc.c (sparc64_elf_bfd_link_hash_table_create): Likewise.
9037         * elf64-x86-64.c (elf64_x86_64_link_hash_table_create): Likewise.
9038         * elfxx-mips.c (_bfd_mips_elf_link_hash_table_create): Likewise.
9039         * linker.c (_bfd_generic_link_hash_table_create): Likewise.
9040         * m68klinux.c (linux_link_hash_table_create): Likewise.
9041         * sparclinux.c (linux_link_hash_table_create): Likewise.
9042         * sunos.c (sunos_link_hash_table_create): Likewise.
9043         * xcofflink.c (_bfd_xcoff_bfd_link_hash_table_create): Likewise.
9044
9045         * targets.c: Add _bfd_link_hash_table_free to xvec.
9046
9047         * bfd-in2.h: Regenerate.
9048         * libbfd.h: Regenerate.
9049         * libcoff.h: Regenerate.
9050
9051 2002-04-04  Alan Modra  <amodra@bigpond.net.au>
9052
9053         * dep-in.sed: Cope with absolute paths.
9054         * Makefile.am (dep.sed): Subst TOPDIR, and not INCDIR.
9055         Run "make dep-am".
9056         * Makefile.in: Regenerate.
9057         * coff-arm.c: Fix copyright date.
9058         * cpu-h8300.c: Likewise.
9059         * cpu-i370.c: Likewise.
9060         * cpu-s390.c: Likewise.
9061         * cpu-mips.c: Likewise.
9062         * po/SRC-POTFILES.in: Regenerate.
9063
9064 2002-04-04  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
9065
9066         * Makefile.am: Add elfxx-mips.c to the known backends.
9067         (elf32-mips.lo): remove dependency to coff/external.h.
9068         * Makefile.in: Regenerate.
9069         * configure.in: Add elfxx-mips.lo to all vectors using elf32-mips.lo
9070         Remove elf32-mips.lo from 64 bit vectors. Update dependencies
9071         accordingly.
9072         * configure: Regenerate.
9073         * elf-bfd.h: Move all MIPS ELF specific prototypes to elfxx-mips.h.
9074         (irix_compat_t): IRIX compatibility level, moved from elf32-mips.c.
9075         (elf_backend_mips_irix_compat, elf_backend_mips_rtype_to_howto): New
9076         MIPS specific backend functions.
9077         * elf32-mips.c: Moved most code to elfxx-mips.c.
9078         (mips_elf_hi16_reloc): Rename from _bfd_mips_elf_hi16_reloc and make
9079         static.
9080         (mips_elf_lo16_reloc): Likewise, was _bfd_mips_elf_lo16_reloc.
9081         (mips_elf_got16_reloc): Likewise, was _bfd_mips_elf_got16_reloc.
9082         (mips_elf_gprel32_reloc): Likewise, was _bfd_mips_elf_gprel32_reloc.
9083         (mips_elf32_rtype_to_howto): Rename from mips_rtype_to_howto. Changed
9084         interface to allow selection of the right REL or RELA howto table.
9085         (mips_elf32_object_p): Rename from _bfd_mips_elf_object_p and made
9086         static. Let it refuse n32 objects.
9087         (elf32_mips_grok_prstatus): Rename from _bfd_elf32_mips_grok_prstatus.
9088         (elf32_mips_grok_psinfo): Rename from _bfd_elf32_mips_grok_psinfo.
9089         (elf32_mips_discard_info): Rename from _bfd_elf32_mips_discard_info.
9090         (elf32_mips_ignore_discarded_relocs): Rename from
9091         _bfd_elf32_mips_ignore_discarded_relocs.
9092         (elf32_mips_write_section): Rename from _bfd_elf32_mips_write_section.
9093         (elf32_mips_irix_compat): New function, replaces IRIX_COMPAT.
9094         (elf_mips_howto_table_rela): Remove.
9095         * elf64-mips.c: Moved most code to elfxx-mips.c.
9096         (bfd_elf64_bfd_reloc_type_lookup): Make static.
9097         (mips_elf64_rtype_to_howto): New function.
9098         (mips_elf64_object_p): Likewise.
9099         (elf64_mips_irix_compat): Likewise.
9100         * elfxx-mips.c: New file containing common code merged together from
9101         elf32-mips.c and elf64-mips.c.
9102         * elfxx-mips.h: New file containing MIPS specific prototypes from
9103         elf-bfd.h.
9104         * elfxx-target.h: Add handling for elf_backend_mips_irix_compat and
9105         elf_backend_mips_rtype_to_howto.
9106
9107 2002-04-04  Alan Modra  <amodra@bigpond.net.au>
9108
9109         * srec.c (MAXCHUNK, Chunk): Revise comments.
9110         (srec_write_record): Correct buffer size.
9111         (srec_write_header): Do without intermediate buffer.
9112         (srec_write_section): Validate Chunk.
9113         (srec_write_terminator): Pass NULL instead of dummy buffer.
9114         (srec_write_symbols): Pass file and symbol names directly to
9115         bfd_bwrite so sprintf won't overflow buffer.
9116
9117 2002-04-03  Jakub Jelinek  <jakub@redhat.com>
9118
9119         * elf32-sparc.c (elf32_sparc_relocate_section): Don't emit dynamic
9120         PC relative relocs against hidden symbols.
9121         * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
9122
9123 2002-04-03  Alan Modra  <amodra@bigpond.net.au>
9124
9125         * elf.c (_bfd_elf_make_section_from_shdr): When setting section
9126         LMAs, loop over segments until p_vaddr and p_memsz specify an
9127         extent enclosing the section.
9128
9129 2002-04-02  Nick Clifton  <nickc@cambridge.redhat.com>
9130
9131         * ihex.c (ihex_write_object_contents): Do not allow records to
9132         cross a 64K boundary - wrap if necessary.
9133
9134 2002-04-01  Nathan Williams  <nathanw@wasabisystems.com>
9135
9136         * elf.c (elfcore_netbsd_get_lwpid): Fix off-by-one error
9137         which caused the returned LWP ID to always be 0.
9138
9139 2002-04-01  Richard Henderson  <rth@redhat.com>
9140
9141         * elf32-sparc.c (WILL_CALL_FINISH_DYNAMIC_SYMBOL): New.
9142         (elf32_sparc_relocate_section): Use it to figure out when to
9143         initialize .got entries.
9144         * elf64-sparc.c: Similarly.
9145
9146 2002-03-28  Alan Modra  <amodra@bigpond.net.au>
9147
9148         * linker.c (link_action): Ignore duplicate warning syms.
9149         (_bfd_generic_link_write_global_symbol): Follow warning symbol link.
9150         * elflink.h (elf_adjust_dynstr_offsets): Likewise.
9151         (elf_adjust_dynamic_symbol): Likewise.
9152         (elf_export_symbol): Likewise.
9153         (elf_link_find_version_dependencies): Likewise.
9154         (elf_link_assign_sym_version): Likewise.
9155         (elf_link_sec_merge_syms): Likewise.
9156         (elf_link_output_extsym): Likewise.
9157         (elf_gc_sweep_symbol): Likewise.
9158         (elf_gc_propagate_vtable_entries_used): Likewise.
9159         (elf_gc_smash_unused_vtentry_relocs): Likewise.
9160         (elf_gc_allocate_got_offsets): Likewise.
9161         (elf_collect_hash_codes): Likewise.
9162         * elflink.c (elf_link_renumber_hash_table_dynsyms): Likewise.
9163         * elf-hppa.h (elf_hppa_unmark_useless_dynamic_symbols): Likewise.
9164         (elf_hppa_remark_useless_dynamic_symbols): Likewise.
9165         * elf-m10300.c (elf32_mn10300_finish_hash_table_entry): Likewise.
9166         * elf32-arm.h (elf32_arm_discard_copies): Likewise.
9167         * elf32-cris.c (elf_cris_adjust_gotplt_to_got): Likewise.
9168         (elf_cris_discard_excess_dso_dynamics): Likewise.
9169         * elf32-hppa.c (clobber_millicode_symbols): Likewise.
9170         (mark_PIC_calls): Likewise.
9171         (allocate_plt_static): Likewise.
9172         (allocate_dynrelocs): Likewise.
9173         (readonly_dynrelocs): Likewise.
9174         * elf32-i386.c (allocate_dynrelocs): Likewise.
9175         (readonly_dynrelocs): Likewise.
9176         * elf32-i370.c (i370_elf_adjust_dynindx): Likewise.
9177         * elf32-m68k.c (elf_m68k_discard_copies): Likewise.
9178         * elf32-mips.c (mips_elf_output_extsym): Likewise.
9179         (mips_elf_sort_hash_table_f): Likewise.
9180         (mips_elf_check_mips16_stubs): Likewise.
9181         * elf32-s390.c (allocate_dynrelocs): Likewise.
9182         (readonly_dynrelocs): Likewise.
9183         * elf32-sh.c (sh_elf_discard_copies): Likewise.
9184         * elf32-xstormy16.c (xstormy16_relax_plt_check): Likewise.
9185         (xstormy16_relax_plt_realloc): Likewise.
9186         * elf64-alpha.c (elf64_alpha_calc_got_offsets_for_symbol): Likewise.
9187         (elf64_alpha_output_extsym): Likewise.
9188         * elf64-hppa.c (elf64_hppa_mark_exported_functions): Likewise.
9189         * elf64-mips.c (mips_elf64_sort_hash_table_f): Likewise.
9190         (mips_elf64_check_mips16_stubs): Likewise.
9191         (mips_elf64_output_extsym): Likewise.
9192         * elf64-ppc.c (func_desc_adjust): Likewise.
9193         (allocate_dynrelocs): Likewise.
9194         (readonly_dynrelocs): Likewise.
9195         * elf64-s390.c (allocate_dynrelocs): Likewise.
9196         (readonly_dynrelocs): Likewise.
9197         * elf64-sh64.c (sh64_elf64_discard_copies): Likewise.
9198         * elf64-x86-64.c (allocate_dynrelocs): Likewise.
9199         (readonly_dynrelocs): Likewise.
9200         * elfxx-ia64.c (elfNN_ia64_global_dyn_sym_thunk): Likewise.
9201         * aoutx.h (aout_link_write_other_symbol): Likewise.
9202         * cofflink.c (_bfd_coff_write_task_globals): Likewise.
9203         (_bfd_coff_write_global_sym): Likewise.
9204         * i386linux.c (linux_tally_symbols): Likewise.
9205         * m68klinux.c (linux_tally_symbols): Likewise.
9206         * sparclinux.c (linux_tally_symbols): Likewise.
9207         * pdp11.c (aout_link_write_other_symbol): Likewise.
9208         * sunos.c (sunos_scan_dynamic_symbol): Likewise.
9209         * xcofflink.c (xcoff_build_ldsyms): Likewise.
9210         (xcoff_write_global_symbol): Likewise.
9211
9212         * cofflink.c (_bfd_coff_final_link): Formatting.
9213         * cpu-mips.c (mips_compatible): Make static, prototype.
9214         * elf32-i386.c (elf_i386_check_relocs): Formatting.
9215         * elf32-sh.c (sh_elf_size_dynamic_sections): Likewise.
9216         * elf64-alpha.c (elf64_alpha_output_extsym): Likewise.
9217         * elf64-mips.c (mips_elf64_sort_hash_table): Likewise.
9218         (mips_elf64_final_link): Likewise.
9219         * elflink.h (elf_link_find_version_dependencies): Remove duplicate
9220         prototype.
9221
9222 2002-03-27  Nick Clifton  <nickc@cambridge.redhat.com>
9223
9224         * coff-arm.c (SWAP_IN_RELOC_OFFSET): Define.
9225         (SWAP_OUT_RELOC_OFFSET): Define.
9226
9227 2002-03-27  Gregory Steuck <greg@nest.cx>
9228
9229         * elf.c (_bfd_elf_get_symtab_upper_bound): Leave space for
9230         terminating NULL if empty symbol table.
9231         (_bfd_elf_get_dynamic_symtab_upper_bound): Likewise.
9232
9233 2002-03-26  H.J. Lu  (hjl@gnu.org)
9234
9235         * elflink.h (elf_link_input_bfd): Revert the last change since
9236         the gcc exception handling isn't fixed yet.
9237
9238 2002-03-26  H.J. Lu  (hjl@gnu.org)
9239
9240         * elflink.h (elf_link_input_bfd): Complain about relocations
9241         against local symbols in discarded sections.
9242
9243 2002-03-26  Alan Modra  <amodra@bigpond.net.au>
9244
9245         * elflink.h (elf_gc_mark): Don't recurse into non-ELF sections.
9246
9247 2002-03-23  Alan Modra  <amodra@bigpond.net.au>
9248
9249         * elf.c (_bfd_elf_make_section_from_shdr): Don't set lma based on
9250         section file offset for !SEC_LOAD sections.
9251
9252 2002-03-21  Richard Earnshaw  <rearnsha@arm.com>
9253
9254         * elf32-arm.h (elf32_arm_final_link_relocate <case R_ARM_GOTOFF>,
9255         <case R_ARM_GOT>): Handle relocations to Thumb functions.
9256
9257 2002-03-21  Alan Modra  <amodra@bigpond.net.au>
9258
9259         * coff64-rs6000.c (_bfd_xcoff64_put_symbol_name): Prototype.
9260         Whitespace changes.
9261         * archive.c: Update copyright date.
9262         * bfd-in2.h: Regenerate.
9263         * libbfd.h: Regenerate.
9264         * Makefile.am: Run "make dep-am"
9265         * Makefile.in: Regenerate.
9266         * po/SRC-POTFILES.in: Regenerate.
9267
9268 2002-03-20  Daniel Jacobowitz  <drow@mvista.com>
9269
9270         * dwarf2.c (struct funcinfo): Move up.
9271         (lookup_address_in_function_table): New argument function_ptr.
9272         Set it.
9273         (lookup_address_in_line_table): New argument function.  If function
9274         is non-NULL, use it to handle ``addr'' before the first line note of
9275         the function.
9276         (comp_unit_find_nearest_line): Update and swap calls to
9277         lookup_address_in_function_table and lookup_address_in_line_table.
9278         * syms.c (_bfd_stab_section_find_nearest_line): Use the first
9279         N_SLINE encountered if we see an N_FUN before any N_SLINE.
9280
9281 2002-03-20  Tom Rix  <trix@redhat.com>
9282
9283         * coff-rs6000.c (_bfd_xcoff_stat_arch_elt): Renamed from
9284         _bfd_xcoff_generic_stat_arch_elt.  Fix format check.
9285         * coff64-rs6000.c : Use _bfd_xcoff_stat_arch_elt.
9286
9287 2002-03-19  Tom Rix  <trix@redhat.com>
9288
9289         * xcofflink.c (_bfd_xcoff_bfd_link_add_symbols): Look through all
9290         dynamic objects in archives.
9291
9292 2002-03-19  Hans-Peter Nilsson  <hp@bitrange.com>
9293
9294         * elflink.h (NAME(bfd_elf,record_link_assignment)): Don't set
9295         STT_NOTYPE symbols to STT_OBJECT.
9296
9297 2002-03-18  Jan Hubicka  <jh@suse.cz>
9298
9299         * cpu-i386.c (bfd_x86_64_arch): Rename to "i386:x86-64"
9300
9301 2002-03-18  Tom Rix  <trix@redhat.com>
9302
9303         * aix5ppc.core.c : New file for AIX 5 64 bit core support.
9304         * bfd-in.h : Add bfd_xcoff_ar_archive_set_magic declaration.
9305         * coff-rs6000 (do_pad) : New function for archive padding.
9306         (do_copy) : New function for object file copying in archives.
9307         (do_shared_object_padding) : New function for padding shared
9308         objects to their text section alignment in archives.
9309         (bfd_xcoff_ar_achive_set_magic) : Stub.
9310         (xcoff_write_armap_big) : Use do_copy and do_pad.
9311         (xcoff_write_archive_contents_big) : Use do_shared_object_padding,
9312         do_copy and do_pad.
9313         * coff64-rs6000.c (xcoff64_write_ojbect_contents) : Use
9314         bfd_xcoff_magic_number.
9315         (xcoff64_bad_format_hook) : New function for _bfd_bad_format_hook
9316         fop.
9317         (xcoff_backend_data_r) : Use xcoff64_bad_format_hook.
9318         (bfd_xcoff_aix5_backend_data) : New Aix 5 backend data.
9319         (aix5coff64_vec) : New Aix 5 target aix5coff64-rs6000.
9320         * rs6000-core.c : Update copyright date.
9321         * xcofflink.c (bfd_xcoff_size_dynamic_sections): Check for NULL
9322         csectpp.
9323         * coffcode.h (coff_new_section_hook) : Use new accessor macros.
9324         (coff_set_arch_mach_hook) : Add Aix 5 U64_TOCMAGIC magic #.
9325         (coff_set_flags) : Use bfd_xcoff_magic_number.
9326         * libxcoff.h (bfd_xcoff_is_xcoff64): Add U64_TOCMAGIC.
9327         * configure.in : Add powerpc-*-aix5 and rs6000-*-aix5 support.
9328         * Makefile.am : Same.
9329         * config.bfd : Same.
9330         * targets.c : Same.
9331         * configure : Regnerate.
9332         * Makefile.in : Same.
9333         * bfd-in2.h : Same.
9334
9335 2002-03-18  Nick Clifton  <nickc@cambridge.redhat.com>
9336
9337         * po/fr.po: Updated version.
9338
9339 2002-03-18  Alan Modra  <amodra@bigpond.net.au>
9340
9341         * libbfd.c (bfd_write_bigendian_4byte_int): Return true iff success.
9342         * libbfd.h: Regenerate.
9343         * archive.c (coff_write_armap): Pass on failures from
9344         bfd_write_bigendian_4byte_int.
9345
9346 2002-03-14  H.J. Lu <hjl@gnu.org>
9347
9348         * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Set the BFD
9349         error to bfd_error_nonrepresentable_section for reinit_array
9350         section in DSO.
9351
9352 2002-03-14  Nick Clifton  <nickc@cambridge.redhat.com>
9353
9354         * coffcode.h (coff_slurp_symbol_table): When adding BSF_WEAK flag,
9355         OR it in rather than replacing previously selected flags.
9356
9357         * elfxx-target.h (TARGET_BIG_SYM): Set ar_max_namelen to 15.
9358         (TARGET_LITTLE_SYM): Set ar_max_namelen to 15.
9359
9360 2002-03-14  Alan Modra  <amodra@bigpond.net.au>
9361
9362         * cpu-mips.c (mips_compatible): New.  Don't check bits_per_word.
9363         (N): Use the above.
9364         * elflink.h (elf_bfd_final_link): Revert last change.  Instead,
9365         ensure reloc size matches before calling elf_link_input_bfd.
9366         Add an assert to check reloc size when counting output relocs.
9367
9368 2002-03-14  Nick Clifton  <nickc@cambridge.redhat.com>
9369
9370         * mmo.c (mmo_get_loc): Return NULL rather than false.
9371
9372 2002-03-13  Nick Clifton  <nickc@cambridge.redhat.com>
9373
9374         * po/fr.po: Updated version.
9375
9376 2002-03-13  Alan Modra  <amodra@bigpond.net.au>
9377
9378         * archures.c (bfd_default_compatible): Test bits_per_word.
9379         * cpu-i386.c (i386_compatible): Remove.  Replace occurrences with
9380         bfd_default_compatible.
9381         * cpu-i370.c (i370_compatible): Likewise.
9382         * cpu-sparc.c (sparc_compatible): Likewise.
9383         * cpu-h8300.c (compatible): Test in->arch == out->arch.
9384
9385         * elflink.h: Formatting fixes.
9386         (elf_link_output_extsym): Merge undefined and undef weak cases.
9387
9388         * elflink.h (elf_bfd_final_link): Only call elf_link_input_bfd
9389         when word size of input matches output word size.
9390
9391 2002-03-12  Andreas Jaeger  <aj@suse.de>
9392
9393         * cpu-i386.c (i386_compatible): New.  Use it instead of
9394         bfd_default_compatible.
9395
9396 2002-03-07  H.J. Lu  (hjl@gnu.org)
9397
9398         * coff-sh.c (shcoff_reloc_map): Use bfd_reloc_code_real_type
9399         as the type for bfd_reloc_val.
9400
9401 2002-03-05  John David Anglin  <dave@hiauly1.hia.nrc.ca>
9402
9403         * elf-hppa.h (elf_hppa_is_dynamic_loader_symbol): New function.
9404         (elf_hppa_relocate_section): Ignore undefined dynamic loader symbols.
9405         (elf_hppa_final_link_relocate): Correct relocations for indirect
9406         references to local data through the DLT.  Fix .opd creation for
9407         local symbols using R_PARISC_LTOFF_FPTR32 and R_PARISC_FPTR64
9408         relocations.  Use e_lsel selector for R_PARISC_DLTIND21L,
9409         R_PARISC_LTOFF_FPTR21L and R_PARISC_LTOFF_TP21L as per
9410         "Processor-Specific ELF for PA_RISC, Version 1.43" document.
9411         Similarly, use e_rsel for DLT and LTOFF 'R' relocations.
9412         * elf32-hppa.c (final_link_relocate): Revise relocation selectors
9413         as per "Processor-Specific ELF for PA_RISC, Version 1.43" document.
9414
9415 2002-03-05  Jakub Jelinek  <jakub@redhat.com>
9416
9417         * merge.c (_bfd_merge_sections): Don't segfault if there
9418         is nothing to merge due to GC.
9419
9420 2002-03-05  Alan Modra  <amodra@bigpond.net.au>
9421
9422         * elf32-hppa.c (clobber_millicode_symbols): Remove hack to keep
9423         symbols that have been forced local.
9424
9425         * elflink.h (elf_bfd_final_link): Call elf_link_output_extsym
9426         to output forced local syms for non-shared link.
9427         (elf_link_output_extsym): Tweak condition for calling backend
9428         adjust_dynamic_symbol so that previous behaviour is kept.
9429         Whitespace changes throughout file.
9430
9431 2002-03-04  H.J. Lu <hjl@gnu.org>
9432
9433         * elf.c (bfd_section_from_shdr): Handle special sections,
9434         .init_array, .fini_array and .preinit_array.
9435         (elf_fake_sections): Likewise.
9436
9437         * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Create the
9438         DT entry only if the section is in output for .init_array,
9439         .fini_array and .preinit_array. Complain about .preinit_array
9440         section in DSO.
9441         (elf_bfd_final_link): Warn zero size for .init_array,
9442         .fini_array and .preinit_array sections.
9443
9444         * elfxx-ia64.c (elfNN_ia64_section_from_shdr): Remove
9445         SHT_INIT_ARRAY, SHT_FINI_ARRAY and SHT_PREINIT_ARRAY.
9446         (elfNN_ia64_fake_sections): Remove .init_array, .fini_array and
9447         .preinit_array.
9448
9449 2002-03-04  Alan Modra  <amodra@bigpond.net.au>
9450
9451         * configure.in (WIN32LIBADD): Don't eval PICFLAG assignment.
9452         * configure: Regenerate.
9453
9454 2002-03-02  Tom Rix  <trix@redhat.com>
9455
9456         * coff64-rs6000.c (xcoff64_howto_table): Replace howto types with
9457         symbolic equiv.
9458         * coff-rs6000.c (xcoff_howto_table): Same.
9459
9460 2002-03-01  David Mosberger  <davidm@hpl.hp.com>
9461
9462         * elflink.h (size_dynamic_sections): If section named
9463         ".preinit_array" exists, create DT_PREINIT_ARRAY and
9464         DT_PREINIT_ARRAYSZ entries in dynamic table.  Analogously for
9465         ".init_array" and ".fini_array".
9466         (elf_bfd_final_link): Handle DT_PREINIT_ARRAYSZ, DT_INIT_ARRAYSZ,
9467         DT_FINI_ARRAYSZ, DT_PREINIT_ARRAY, DT_INIT_ARRAY, and
9468         DT_FINI_ARRAY.
9469
9470 2002-02-26  Andrew Macleod  <amacleod@cygnus.com>
9471
9472         * elflink.h (elf_bfd_final_link): Don't crash on SHN_UNDEF local
9473         dynsyms.
9474
9475 2002-02-25  Alan Modra  <amodra@bigpond.net.au>
9476
9477         * elf64-hppa.h: Update copyright date.
9478
9479         * elf64-ppc.c (ppc64_elf_check_relocs): Warning fix.
9480         (ppc64_elf_relocate_section): Don't generate power4 style branch
9481         hints for *_BRTAKEN and *_BRNTAKEN relocs.
9482
9483 2002-02-22  Jakub Jelinek  <jakub@redhat.com>
9484
9485         * elf64-sh64.c (sh_elf64_relocate_section): Fix a typo from my
9486         last patch.
9487         * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
9488
9489 2002-02-21  Andreas Jaeger  <aj@suse.de>
9490
9491         * elf64-x86-64.c: Major rework that introduces all recent changes
9492         to the x86-64 backend.  Get a closer match to elf32-i386.
9493         (struct elf64_x86_64_dyn_relocs): Rename from
9494         elf64_x86_64_pcrel_relocs_copied, add additional fields.  Change
9495         all users.
9496         (struct elf64_x86_64_link_hash_table): Add short cuts to some
9497         sections.
9498         (link_hash_newfunc): Rename from elf64_x86_64_link_hash_newfunc,
9499         remove casts, initialize new hash members.
9500         (create_got_section): New.
9501         (elf64_x86_64_create_dynamic_sections): New.
9502         (elf64_x86_64_copy_indirect_symbol): New.
9503         (elf64_x86_64_check_relocs): Don't allocate space for dynamic
9504         relocs, .got or .relgot here but do it in allocate_dynrelocs.
9505         Reference count possible .plt and .got entries.  Don't test input
9506         section SEC_READONLY here to try to avoid copy relocs, and keep
9507         dyn_relocs regardless of ELF_LINK_NON_GOT_REF.  Don't set
9508         DF_TEXTREL here.  Delay setting of variables until needed.  Cache
9509         pointer to "sreloc" section in elf_section_data. Tweak condition
9510         under which .got created.  Report files with bad relocation
9511         section names.
9512         (elf64_x86_64_gc_sweep_hook): Sweep dyn_relocs and local_dynrel.
9513         Reference count possible .plt entries.  Don't deallocate .got and
9514         .relgot space here.
9515         (elf64_x86_64_adjust_dynamic_symbol): Handle nocopyreloc.  Don't
9516         do copy reloc processing for weakdefs.  Remove redundant casts and
9517         aborts.  Delay setting of vars until needed.  Move creation of
9518         dynamic symbols and allocation of .plt and .rela.plt to
9519         allocate_dynrelocs.  Replace BFD_ASSERT with abort.
9520         (WILL_CALL_FINISH_DYNAMIC_SYMBOL): New.
9521         (allocate_dynrelocs): New.
9522         (readonly_dynrelocs): New.
9523         (elf64_x86_64_size_dynamic_sections): Call readonly_dynrelocs.
9524         Allocate space for dyn relocs.  Replace BFD_ASSERT with abort.
9525         Zero out the dynamic allocated content space.
9526         (elf64_x86_64_discard_copies): Removed.
9527         (elf64_x86_64_relocate_section): Make use of dynamic section
9528         short-cuts.  Localise vars, and delay setting.  Better error
9529         reporting, replace BFD_ASSERT with abort.  Check
9530         ELF_LINK_HASH_DEF_DYNAMIC to see if a symbol is not defined in the
9531         regular object file and tread the weak definition as the normal
9532         one.  Don't discard relocs for undefweak or undefined symbols and
9533         check !DEF_REGULAR as well as DEF_DYNAMIC in test for avoided copy
9534         relocs.
9535         (elf64_x86_64_finish_dynamic_symbol): Don't copy relocs for
9536         symbols that have been forced local.  Use same test to decide if
9537         we can use a relative reloc for got as relocate_section.  Expand
9538         SHN_UNDEF comment.  Move expressions out of function calls.
9539         Replace BFD_ASSERT with abort.
9540         (bfd_elf64_bfd_final_link): Removed.
9541         (elf_backend_copy_indirect_symbol): Define.
9542
9543 2002-02-20  Tom Rix  <trix@redhat.com>
9544
9545         * coff-rs6000.c (xcoff_howto_table): Add 16 bit R_BA.
9546         (_bfd_xcoff_reloc_type_lookup): Use it.
9547         * coff64-rs6000.c (xcoff64_howto_table): Same.
9548         (xcoff64_reloc_type_lookup): Same.
9549
9550 2002-02-20  Peter Schauer  <pes@regent.e-technik.tu-muenchen.de>
9551
9552         * osf-core.c (osf_core_vec): OSF/1 (Digital Unix) core files are
9553         little endian.
9554
9555 2002-02-19  Martin Schwidefsky  <schwidefsky@de.ibm.com>
9556
9557         * archures.c (bfd_mach_s390_esa): Rename to bfd_mach_s390_31.
9558         (bfd_mach_s390_esame): Rename to bfd_mach_s390_64.
9559         * bfd-in2.h: Regenerate.
9560         * cpu-s390.c (arch_info_struct): Use renamed architecture defines.
9561         Replace architecture name "s390" with "s390:31-bit" and "s390:esame"
9562         with "s390:64-bit".
9563         * elf32-s390.c (elf_howto_table): Add 32 bit pc relative relocations.
9564         (elf_s390_reloc_type_lookup): Likewise.
9565         (elf_s390_check_relocs): Likewise.
9566         (elf_s390_gc_sweep_hook): Likewise.
9567         (elf_s390_relocate_section): Likewise.
9568         (elf_s390_object_p): Use renamed architecture define.
9569         * elf64-s390.c (elf_s390_object_p): Use renamed architecture define.
9570
9571 2002-02-19  Frank Ch. Eigler  <fche@redhat.com>
9572
9573         * syms.c (stt[]): Sorted.  Added .init/.fini -> "t" mapping.
9574
9575 2002-02-19  Jakub Jelinek  <jakub@redhat.com>
9576
9577         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Enable
9578         absptr -> pcrel optimization for shared libs.
9579         Only create minimal .eh_frame_hdr if absptr FDE encoding in shared
9580         library cannot be converted to pcrel.
9581         (_bfd_elf_eh_frame_section_offset): Return -2 if making absptr
9582         relative.
9583         * elf32-i386.c (elf_i386_relocate_section): If
9584         _bfd_elf_section_offset returned -2, skip, but make sure the
9585         relocation is installed.
9586         * elf32-arm.h (elf32_arm_final_link_relocate): Likewise.
9587         * elf32-cris.c (cris_elf_relocate_section): Likewise.
9588         * elf32-hppa.c (elf32_hppa_relocate_section): Likewise.
9589         * elf32-i370.c (i370_elf_relocate_section): Likewise.
9590         * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
9591         * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
9592         * elf32-s390.c (elf_s390_relocate_section): Likewise.
9593         * elf32-sh.c (sh_elf_relocate_section): Likewise.
9594         * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
9595         * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
9596         * elf64-s390.c (elf_s390_relocate_section): Likewise.
9597         * elf64-sh64.c (sh_elf64_relocate_section): Likewise.
9598         * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
9599         * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
9600         * elf64-alpha.c (elf64_alpha_relocate_section): Handle
9601         _bfd_elf_section_offset returning -2 the same way as -1.
9602         * elfxx-ia64.c (elfNN_ia64_install_dyn_reloc): Likewise.
9603         * elf32-mips.c (mips_elf_create_dynamic_relocation): Add FIXME
9604         and BFD_ASSERT.
9605         * elf64-mips.c (mips_elf64_create_dynamic_relocation): Likewise.
9606
9607 2002-02-18  Tom Rix  <trix@redhat.com>
9608
9609         * xcofflink.c (bfd_xcoff_link_gernate_rtinit): Add -brtl support.
9610         (bfd_xcoff_size_dynamic_sections): Same.
9611         * bfd-in.h (bfd_xcoff_link_generate_rtinit): Same.
9612         (bfd_xcoff_size_dynamic_sections): Same.
9613         * coff-rs6000.c (xcoff_generate_rtinit): Same.
9614         * coff-rs646000.c (xcoff64_generate_rtinit): Same.
9615         * libxcoff.h (struct xcoff_backend_data_rec): Same.
9616         * xcofflink.c (xcoff_build_ldsyms, xcoff_link_add_symbols): Clean.
9617         * bfd-in2.h: Regenerate.
9618
9619 2002-02-18  Alan Modra  <amodra@bigpond.net.au>
9620
9621         * elf64-ppc.c (STFD_FR0_0R1, LFD_FR0_0R1, BLR): Define.
9622         (struct ppc_link_hash_table): Add sfpr.
9623         (ppc64_elf_link_hash_table_create): Init it.
9624         (ppc64_elf_create_dynamic_sections): Split creation of .stub and
9625         .glink out to..
9626         (create_linkage_sections): ..here.  Make .sfpr too.
9627         (ppc64_elf_check_relocs): Call create_linkage_sections, and set
9628         dynobj early.
9629         (MIN_SAVE_FPR, MAX_SAVE_FPR): Define.
9630         (ppc64_elf_func_desc_adjust): Look for missing ._savef* and
9631         ._restf* functions, and create as needed.
9632         (func_desc_adjust): Only force_local for shared libs.
9633
9634 2002-02-18  David O'Brien  <obrien@FreeBSD.org>
9635
9636         * configure.in: Bump version number post 2.12 branching.
9637         * configure: Regenerate.
9638
9639 2002-02-17  Hans-Peter Nilsson  <hp@bitrange.com>
9640
9641         * mmo.c: Correct and improve comments.
9642         (mmo_write_chunk): Store trailing byte in bfd buffer; don't
9643         zero-pad.  Use input to fill up non-empty bfd buffer.
9644         (mmo_flush_chunk): New function.
9645         (mmo_write_loc_chunk): Add parameter last_vmap, all callers
9646         changed.  Don't emit location specifier if VMA is same as
9647         *LAST_VMAP after omitting leading zero contents.  Call
9648         mmo_flush_chunk before emitting location specifier.
9649         (mmo_write_loc_chunk_list): Call mmo_flush_chunk when finished
9650         with mmo_write_loc_chunk calls.
9651         (mmo_internal_write_section): Call mmo_flush_chunk after
9652         mmo_write_chunk.
9653         (mmo_write_symbols_and_terminator): Move :Main to first position
9654         in symbol array.  Add faked one if it does not exist if there are
9655         other symbols.  Don't add it if there are no symbols at all.  Move
9656         out test for value of :Main from symbol loop.  Rename table
9657         fakemain to maintable and variable mainsym to fakemain.
9658
9659 2002-02-15  Richard Henderson  <rth@redhat.com>
9660
9661         * elf64-alpha.c (elf64_alpha_relocate_section) [BRSGP]: A target
9662         section with no got matches any got.  Simplify error generaion.
9663
9664 2002-02-15  Alan Modra  <amodra@bigpond.net.au>
9665
9666         Support arbitrary length fill patterns.
9667         * linker.c (bfd_new_link_order): Zero all fields with bfd_zalloc.
9668         (_bfd_default_link_order): Remove bfd_fill_link_order code.
9669         Call default_data_link_order.
9670         (default_fill_link_order): Delete.
9671         (default_data_link_order): New function.
9672         * elf32-mips.c (_bfd_mips_elf_final_link): Replace occurrences
9673         of bfd_fill_link_order with bfd_data_link_order.
9674         * elf64-alpha.c (elf64_alpha_final_link): Likewise.
9675         * elf64-mips.c (mips_elf64_final_link): Likewise.
9676
9677         * bfd.c (bfd_scan_vma): Clamp overflows to max bfd_vma value.
9678         Correct value returned in "end" for "0x<non-hex>".
9679
9680 2002-02-14  Nick Clifton  <nickc@cambridge.redhat.com>
9681
9682         * cpu-arm.c (processors): Replace 'arch' field with 'mach'.
9683         (scan): Test against 'mach' field in info structure.
9684
9685 2002-02-14  Alan Modra  <amodra@bigpond.net.au>
9686
9687         * elf.c (elf_fake_sections): Use SHT_NOBITS when SEC_NEVER_LOAD.
9688
9689 2002-02-14  Matt Fredette  <fredette@netbsd.org>
9690
9691         * elf32-m68k.c (elf32_m68k_print_private_bfd_data): Recognize
9692         EF_M68000.
9693
9694 2002-02-13  Nick Clifton  <nickc@cambridge.redhat.com>
9695
9696         * elf.c (_bfd_elf_make_section_from_shdr): Do not insist on
9697         non-zero physical addresses when adjusting the LMAs of new
9698         sections.
9699
9700 2002-02-12  John David Anglin  <dave@hiauly1.hia.nrc.ca>
9701
9702         * elf-hppa.h (elf_hppa_reloc_final_type): New function stripped
9703         from _bfd_elf_hppa_gen_reloc_type.
9704         (_bfd_elf_hppa_gen_reloc_type): Remove duplicate prototype.
9705         * elf32-hppa.h (elf32_hppa_reloc_final_type): Add protptype.
9706         * elf32-hppa.c: Include elf32-hppa.h before elf-hppa.h.
9707         * elf64-hppa.h (elf64_hppa_reloc_final_type): Add protptype.
9708
9709 2002-02-12  Alexandre Oliva  <aoliva@redhat.com>
9710
9711         * elf-m10300.c (mn10300_elf_relax_section): Skip section before
9712         loading its contents if there's nothing to do in it.
9713
9714 2002-02-12  Alan Modra  <amodra@bigpond.net.au>
9715
9716         * elf64-ppc.c (ppc64_elf_size_stubs): Correct test for crossing
9717         64k boundary.
9718
9719         * elf64-ppc.c (ppc64_elf_size_dynamic_sections): Add dynamic
9720         DT_PPC64_OPD and DT_PPC64_OPDSZ tags.
9721         (ppc64_elf_finish_dynamic_sections): Set values for them.
9722
9723 2002-02-11  Michael Snyder  <msnyder@redhat.com>
9724
9725         * elf-bfd.h (elfcore_write_lwpstatus): Add prototype.
9726         * elf.c (elfcore_grok_pstatus): Add prototype.
9727         (elfcore_grok_lwpstatus): Add prototype.
9728         (elfcore_write_lwpstatus): New function.
9729         (elfcore_write_pstatus): Fix typo, eliminate unnecessary memcpy.
9730
9731 2002-02-11  Alexandre Oliva  <aoliva@redhat.com>
9732
9733         * elf32-sh.c: Added missing prototypes.
9734         * elf32-sh64.c: Likewise.
9735         (sh_elf_align_loads): Mark unused args as such.
9736         * elf64-sh64.c: Added missing prototypes.
9737         (struct elf_sh64_link_hash_entry): Fix typo.
9738         (sh_elf64_relocate_section): Fix info argument passed to
9739         _bfd_elf_section_offset.
9740
9741 2002-02-11  Alan Modra  <amodra@bigpond.net.au>
9742
9743         * Makefile.am: "make dep-am".
9744         * Makefile.in: Regenerate.
9745         * aclocal.m4: Regenerate.
9746         * config.in: Regenerate.
9747         * configure: Regenerate.
9748
9749 2002-02-10  Daniel Jacobowitz  <drow@mvista.com>
9750
9751         * coff-rs6000.c (xcoff_generate_rtinit): Silence uninitialized
9752         variable warnings.
9753         * elf32-sh.c (sh_elf_relax_section): Silence signed/unsigned
9754         comparison warning.
9755         * trad-core.c (trad_unix_core_file_p): Silence pointer/integer
9756         cast warnings for the common case.
9757
9758 2002-02-10  Hans-Peter Nilsson  <hp@bitrange.com>
9759
9760         * config.bfd (sh-*-linux*, sh-*-elf* | sh-*-rtemself*): Add sh64
9761         vectors.
9762         (sh-*-netbsdelf*): New, to trump sh*-*-netbsdelf* and add sh64
9763         vectors.
9764
9765 2002-02-09  Richard Henderson  <rth@redhat.com>
9766
9767         * elf64-alpha.c (elf64_alpha_howto): Add R_ALPHA_BRSGP.
9768         (elf64_alpha_reloc_map, elf64_alpha_check_relocs): Likewise.
9769         (elf64_alpha_relocate_section): Likewise.
9770         * reloc.c (BFD_RELOC_ALPHA_BRSGP): New.
9771         * bfd-in2.h, libbfd.h: Rebuild.
9772
9773 2002-02-09  Hans-Peter Nilsson  <hp@bitrange.com>
9774
9775         * elf64-mmix.c (_bfd_mmix_finalize_linker_allocated_gregs): Check
9776         that base-plus-offset reloc accounting is consistent.
9777         (mmix_elf_relax_section): Keep base-plus-offset reloc accounting
9778         up to date for undefined symbols.
9779
9780 2002-02-08  Eric Christopher  <echristo@redhat.com>
9781
9782         From Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
9783
9784         * elf32-mips.c (_bfd_mips_elf_fake_sections): Don't create .rela
9785         sections for the O32 ABI.
9786
9787 2002-02-08  Chris Demetriou  <cgd@broadcom.com>
9788
9789         * elf32-arm.h: Fix formatting of _("...").
9790         * elf32-d10v.c: Likewise.
9791         * elf32-m68k.c: Likewise.
9792         * elf32-mips.c: Likewise.
9793
9794 2002-02-08  Ivan Guzvinec <ivang@opencores.org>
9795
9796         * coff-or32.c: Fix compile time warning messages.
9797
9798 2002-02-08  Alexandre Oliva  <aoliva@redhat.com>
9799
9800         Contribute sh64-elf.
9801         2002-01-23  Alexandre Oliva  <aoliva@redhat.com>
9802         * reloc.c (R_SH_GOTPLT32, R_SH_GOT_LOW16, R_SH_GOT_MEDLOW16,
9803         R_SH_GOT_MEDHI16, R_SH_GOT_HI16, R_SH_GOTPLT_LOW16,
9804         R_SH_GOTPLT_MEDLOW16, R_SH_GOTPLT_MEDHI16, R_SH_GOTPLT_HI16,
9805         R_SH_PLT_LOW16, R_SH_PLT_MEDLOW16, R_SH_PLT_MEDHI16,
9806         R_SH_PLT_HI16, R_SH_GOTOFF_LOW16, R_SH_GOTOFF_MEDLOW16,
9807         R_SH_GOTOFF_MEDHI16, R_SH_GOTOFF_HI16, R_SH_GOTPC_LOW16,
9808         R_SH_GOTPC_MEDLOW16, R_SH_GOTPC_MEDHI16, R_SH_GOTPC_HI16,
9809         R_SH_GOT10BY4, R_SH_GOTPLT10BY4, R_SH_GOT10BY8, R_SH_GOTPLT10BY8,
9810         R_SH_COPY64, R_SH_GLOB_DAT64, R_SH_JMP_SLOT64, R_SH_RELATIVE64):
9811         New relocs.
9812         * libbfd.h, bfd-in2.h: Rebuilt.
9813         * elf32-sh.c (sh_elf_howto_table): Define new relocs.
9814         (sh_reloc_map): Map them.
9815         (PLT_ENTRY_SIZE, elf_sh_plt0_entry_be, elf_sh_plt0_entry_le,
9816         elf_sh_plt_entry_be, elf_sh_plt_entry_le, elf_sh_pic_plt_entry_be,
9817         elf_sh_pic_plt_entry_le, elf_sh_plt0_entry, elf_sh_plt_entry,
9818         elf_sh_pic_plt_entry, elf_sh_sizeof_plt, elf_sh_plt_plt0_offset,
9819         elf_sh_plt0_gotplt_offset, elf_sh_plt_temp_offset,
9820         elf_sh_plt_symbol_offset, elf_sh_plt_reloc_offset,
9821         movi_shori_putval) [INCLUDE_SHMEDIA]: New.
9822         (elf_sh_link_hash_entry) [INCLUDE_SHMEDIA]: Add
9823         datalabel_got_offset.
9824         (sh_elf_link_hash_newfunc): Initialize it.
9825         (sh_elf_relocate_section): Augment the scope of
9826         seen_stt_datalabel.  Introduce GOTPLT support.  Extend GOTPC, PLT,
9827         GOT and GOTOFF handling to new SHmedia relocation types.  Support
9828         GOT_BIAS.
9829         (sh_elf_check_relocs): Likewise.
9830         (sh_elf_finish_dynamic_symbol) [TARGET_SHMEDIA]: Set up values in
9831         PLT entries using movi_shori_putval.  Support GOT_BIAS.
9832         (sh_elf_finish_dynamic_sections): Likewise.
9833         * elf32-sh64.c (shmedia_prepare_reloc): Do not add addend to
9834         relocation, it's now done by the caller.
9835         (GOT_BIAS): New.
9836         * elf64-sh64.c (GOT_BIAS, PLT_ENTRY_SIZE, elf_sh64_sizeof_plt,
9837         elf_sh64_plt_plt0_offset, elf_sh64_plt0_gotplt_offset,
9838         elf_sh64_plt_temp_offset, elf_sh64_plt_symbol_offset,
9839         elf_sh64_plt_reloc_offset, ELF_DYNAMIC_INTERPRETER,
9840         elf_sh64_pcrel_relocs_copied, elf_sh64_link_hash_entry,
9841         elf_sh64_link_hash_table, sh64_elf64_link_hash_traverse,
9842         sh64_elf64_hash_table): New.
9843         (sh_elf64_howto_table): Introduce new relocs.
9844         (sh_elf64_info_to_howto): Accept new PIC relocs.
9845         (sh_elf64_relocate_section): Augment the scope of
9846         seen_stt_datalabel.  Support new PIC relocs.
9847         (sh_elf64_check_relocs): Support new PIC relocs.
9848         (elf_sh64_plt0_entry_be, elf_sh64_plt0_entry_le,
9849         elf_sh64_plt_entry_be, elf_sh64_plt_entry_le,
9850         elf_sh64_pic_plt_entry_be, elf_sh64_pic_plt_entry_le,
9851         elf_sh64_plt0_entry, elf_sh64_plt_entry, elf_sh64_pic_plt_entry,
9852         sh64_elf64_link_hash_newfunc, sh64_elf64_link_hash_table_create,
9853         movi_shori_putval, movi_3shori_putval,
9854         sh64_elf64_create_dynamic_sections,
9855         sh64_elf64_adjust_dynamic_symbol, sh64_elf64_discard_copies,
9856         sh64_elf64_size_dynamic_sections,
9857         sh64_elf64_finish_dynamic_symbol,
9858         sh64_elf64_finish_dynamic_sections): New.
9859         (elf_backend_create_dynamic-sections,
9860         bfd_elf64_bfd_link_hash_table_create,
9861         elf_backend_adjust_dynamic_symbol,
9862         elf_backend_size_dynamic_sections,
9863         elf_backend_finish_dynamic_symbol,
9864         elf_backend_finish_dynamic_sections, elf_backend_want_got_plt,
9865         elf_backend_plt_readonly, elf_backend_want_plt_sym,
9866         elf_backend_got_header_size, elf_backend_plt_header_size):
9867         Define.
9868         2001-05-16  Alexandre Oliva  <aoliva@redhat.com>
9869         * elf32-sh.c: Renumbered and renamed some SH5 relocations to
9870         match official numbers and names; moved unmaching ones to the
9871         range 0xf2-0xff.
9872         * elf32-sh64.c, elf64-sh64.c: Likewise.
9873         2001-03-12  DJ Delorie  <dj@redhat.com>
9874         * elf32-sh.c (sh_elf_relax_section): Don't relax SHmedia
9875         sections.
9876         2001-03-12  DJ Delorie  <dj@redhat.com>
9877         * elf32-sh64.c (shmedia_prepare_reloc): Validate relocs that must
9878         be aligned.
9879         * elf64-sh64.c (sh_elf64_relocate_section): Ditto.
9880         2001-01-14  Hans-Peter Nilsson  <hpn@cygnus.com>
9881         * elf32-sh64.c (bfd_elf32_bfd_copy_private_section_data): Define.
9882         (sh64_elf_fake_sections): Set type to SHT_SH5_CR_SORTED for a
9883         .cranges section with SEC_SORT_ENTRIES set.
9884         (sh64_backend_section_from_shdr): Set SEC_SORT_ENTRIES on an
9885         incoming sorted .cranges section.
9886         (sh64_bfd_elf_copy_private_section_data): New.
9887         (sh64_elf_final_write_processing): Only sort .cranges and modify
9888         start address if called by linker.
9889         2001-01-08  Ben Elliston  <bje@redhat.com>
9890         * elf32-sh64.c (sh64_elf_final_write_processing): Activate
9891         Hans-Peter Nilsson's set bit 0 patch from 2001-01-06.
9892         * elf64-sh64.c (sh64_elf64_final_write_processing): Ditto.
9893         2001-01-06  Hans-Peter Nilsson  <hpn@cygnus.com>
9894         * elf64-sh64.c (sh_elf64_howto_table): No open brace at start of
9895         line.  Add comments before all entries.
9896         <R_SH_PT_16, R_SH_SHMEDIA_CODE>: Correct and clarify describing
9897         comment.
9898         (sh_elf64_reloc): Correct head comment.
9899         (sh_elf64_relocate_section): Correct spacing.
9900         <relocating for a local symbol>: Do not honour STO_SH5_ISA32;
9901         instead call reloc_dangerous callback.
9902         <case R_SH_SHMEDIA_CODE>: New case.
9903         (sh_elf64_gc_mark_hook): Correct spacing.
9904         (sh_elf64_check_relocs): Ditto.
9905         * elf32-sh64.c (shmedia_prepare_reloc) <case R_SH_SHMEDIA_CODE>:
9906         New case.
9907         * elf32-sh.c: Correct #endif comments for #ifndef-wrapped
9908         functions.
9909         (sh_elf_howto_table) <R_SH_PT_16, R_SH_SHMEDIA_CODE>: Correct,
9910         clarify describing comment.  Add comments before all entries.
9911         (sh_elf_relocate_section) <relocating for a local symbol>: Do not
9912         honour STO_SH5_ISA32; instead call reloc_dangerous callback.
9913         2001-01-06  Hans-Peter Nilsson  <hpn@cygnus.com>
9914         Sort .cranges section in final link.  Prepare to set bit 0 on
9915         entry address.
9916         * elf32-sh64.c (struct sh64_find_section_vma_data): New.
9917         (sh64_elf_link_output_symbol_hook): Fix typo in prototype.
9918         (sh64_elf_set_mach_from_flags): Set SEC_DEBUGGING on incoming
9919         .cranges section.
9920         (sh64_backend_section_from_shdr): New, to recognize
9921         SHT_SH5_CR_SORTED on incoming .cranges section.
9922         (elf_backend_section_from_shdr): Define.
9923         (sh64_elf_final_write_processing): Sort outgoing .cranges
9924         section.  (New, temporarily disabled:) Set bit 0 on entry address
9925         according to ISA type.
9926         (sh64_find_section_for_address): New.
9927         (crange_qsort_cmpb, crange_qsort_cmpl, crange_bsearch_cmpb,
9928         crange_bsearch_cmpl): Move here from opcodes/sh64-dis.c.
9929         (sh64_address_in_cranges): Move here from opcodes/sh64-dis.c.  Use
9930         bfd_malloc, not xmalloc.
9931         (sh64_get_contents_type): Move here from opcodes/sh64-dis.c.  Make
9932         global.
9933         * elf32-sh64.c (sh64_elf64_final_write_processing): New, (but
9934         temporarily disabled) setting bit 0 on entry address.
9935         (elf_backend_final_write_processing): Define.
9936         2001-01-05  Hans-Peter Nilsson  <hpn@cygnus.com>
9937         * elf32-sh.c (sh_elf_howto_table) <R_SH_PT_16>: Adjust fields to
9938         be a proper relocation for PTA and PTB rather than a marker.
9939         <R_SH_IMMU5, R_SH_IMMS6, R_SH_IMMU6, R_SH_IMMS10, R_SH_IMMS10BY2,
9940         R_SH_IMMS10BY4, R_SH_IMMS10BY8, R_SH_IMMS16, R_SH_IMMU16,
9941         R_SH_IMM_LOW16, R_SH_IMM_LOW16_PCREL, R_SH_IMM_MEDLOW16,
9942         R_SH_IMM_MEDLOW16_PCREL, R_SH_IMM_MEDHI16, R_SH_IMM_MEDHI16_PCREL,
9943         R_SH_IMM_HI16, R_SH_IMM_HI16_PCREL, R_SH_64, R_SH_64_PCREL>:
9944         Zero src_mask.
9945         * elf64-sh64.c: Ditto.
9946         (sh_elf64_relocate_section) <case R_SH_PT_16>: New case.
9947         * elf32-sh64.c: Include opcodes/sh64-opc.h
9948         (shmedia_prepare_reloc): Take a bfd_link_info pointer as first
9949         argument.  Drop const qualifiers from "bfd *" and "bfd_byte *"
9950         parameters.  No unused parameters.  Caller changed.
9951         <case R_SH_PT_16>: New case.
9952         * Makefile.am (elf32-sh64.lo): Add dependency on sh64-opc.h.
9953         * Makefile.in: Regenerate.
9954         2000-12-30  Hans-Peter Nilsson  <hpn@cygnus.com>
9955         * elf64-sh64.c (sh64_elf64_fake_sections): Set SHF_SH5_ISA32 for
9956         all code sections.
9957         (sh_elf64_set_mach_from_flags): Change from EF_SH64 to EF_SH5.
9958         (sh64_elf_merge_private_data): Ditto.
9959         * elf32-sh64.c (sh64_elf_fake_sections): Use sh64_elf_section_data
9960         to access stored section flags.
9961         (sh64_elf_final_write_processing): Return immediately unless
9962         called by linker.  Use sh64_elf_section_data (cranges) to get size
9963         of linker-generated cranges entries.
9964         (sh64_elf_copy_private_data): Add missing "return true".
9965         (sh64_elf_set_mach_from_flags): Change from EF_SH64 to EF_SH5.
9966         (sh_elf64_merge_private_data): Ditto.
9967         2000-12-19  Hans-Peter Nilsson  <hpn@cygnus.com>
9968         * elf64-sh64.c (sh64_elf64_fake_sections): New, copy of
9969         elf64-sh64.c:sh64_elf_fake_sections.
9970         (elf_backend_fake_sections): Define as sh64_elf64_fake_sections.
9971         2000-12-18  Hans-Peter Nilsson  <hpn@cygnus.com>
9972         * elf32-sh64.c (sh64_elf_copy_private_data_internal): Delete.
9973         (sh64_elf_final_write_processing): New.
9974         (elf_backend_final_write_processing): Define.
9975         (sh64_elf_fake_sections): Get header flags from tdata field.
9976         (sh64_elf_copy_private_data): Do not call
9977         sh64_elf_copy_private_data_internal, just copy e_flags field.
9978         (sh64_elf_merge_private_data): Do not call
9979         sh64_elf_copy_private_data_internal.
9980         2000-12-12  Hans-Peter Nilsson  <hpn@cygnus.com>
9981         Remove EF_SH64_ABI64, let ELF size make difference.
9982         Remove SH64-specific BFD section flag.
9983         * elf32-sh64.c (sh64_elf_fake_sections): Recognize section as
9984         containing SHmedia through elf_section_data (asect)->tdata
9985         non-zero, not using a BFD section flag.
9986         (sh64_elf_set_mach_from_flags): Don't recognize EF_SH64_ABI64.
9987         (sh64_elf_merge_private_data): Similar.
9988         (elf_backend_section_flags): Don't define.
9989         (sh64_elf_backend_section_flags): Delete.
9990         * elf64-sh64.c (sh_elf64_set_mach_from_flags): Recognize EF_SH64,
9991         not EF_SH64_ABI64.
9992         (sh_elf64_merge_private_data): Similar.
9993         * section.c (Section flags definitions): Don't define
9994         SEC_SH_ISA_SHMEDIA.
9995         (bfd-in2.h): Regenerate.
9996         2000-12-09  Hans-Peter Nilsson  <hpn@cygnus.com>
9997         Make DataLabel references work with partial linking.
9998         * elf32-sh64.c: Fix formatting.
9999         (sh64_elf_link_output_symbol_hook): New.
10000         (elf_backend_link_output_symbol_hook): Define to
10001         sh64_elf_link_output_symbol_hook.
10002         (sh64_elf_add_symbol_hook): Make DataLabel symbol just global
10003         undefined if partial linking.  Adjust sanity check.
10004         * elf64-sh64.c (sh64_elf64_link_output_symbol_hook): New.
10005         (elf_backend_link_output_symbol_hook): Define to
10006         sh64_elf64_link_output_symbol_hook.
10007         (sh64_elf64_add_symbol_hook): Make DataLabel symbol just global
10008         undefined if partial linking.  Adjust sanity check.
10009         2000-12-07  Hans-Peter Nilsson  <hpn@cygnus.com>
10010         Implement semantics for inter-file DataLabel references.
10011         * elf64-sh64.c (DATALABEL_SUFFIX): Define.
10012         (sh64_elf64_add_symbol_hook): New.
10013         (sh_elf64_relocate_section): If passing an indirect symbol with
10014         st_type STT_DATALABEL on the way to a symbol with st_other
10015         STO_SH5_ISA32, do not bitor 1 to the relocation.
10016         (elf_backend_add_symbol_hook): Define to
10017         sh64_elf64_add_symbol_hook.
10018         * elf64-sh32.c: Tweak comments.
10019         (DATALABEL_SUFFIX): Define.
10020         (sh64_elf_add_symbol_hook): New.
10021         (elf_backend_add_symbol_hook): Define to sh64_elf_add_symbol_hook.
10022         * elf32-sh.c (sh_elf_relocate_section): If passing an indirect
10023         symbol with st_type STT_DATALABEL on the way to a symbol with
10024         st_other STO_SH5_ISA32, do not bitor 1 to the relocation.
10025         2000-12-05  Hans-Peter Nilsson  <hpn@cygnus.com>
10026         Pass through STT_DATALABEL.
10027         * elf32-sh64.c (sh64_elf_get_symbol_type): New.
10028         (elf_backend_get_symbol_type): Define.
10029         * elf64-sh64.c (sh64_elf64_get_symbol_type): New.
10030         (elf_backend_get_symbol_type): Define.
10031         2000-11-30  Hans-Peter Nilsson  <hpn@cygnus.com>
10032         * elf32-sh64.c: Tweak comments.
10033         (sh64_elf_copy_private_data_internal): Add prototype.
10034         (bfd_elf32_bfd_set_private_flags): Define.
10035         (sh64_elf_copy_private_data_internal): Compare machine name, not
10036         textual BFD target name, to check whether to copy section flag
10037         SHF_SH5_ISA32.
10038         (sh64_elf_merge_private_data): Validize bfd_get_arch_size.
10039         Tweak section-contents-type-mismatch message.
10040         (shmedia_prepare_reloc): Add ATTRIBUTE_UNUSED markers.
10041         Validize reloc-types.
10042         * elf64-sh64.c: New file.
10043         * targets.c (bfd_elf64_sh64_vec, bfd_elf64_sh64l_vec): Declare.
10044         * Makefile.am (BFD64_BACKENDS): Add elf64-sh64.lo.
10045         (BFD64_BACKENDS_CFILES): Add elf64-sh64.c.
10046         Regenerate dependencies.
10047         * Makefile.in: Regenerate.
10048         * config.bfd (sh64-*-elf*): Add bfd_elf64_sh64_vec and
10049         bfd_elf64_sh64l_vec.
10050         * configure.in: Handle bfd_elf64_sh64_vec and
10051         bfd_elf64_sh64l_vec.
10052         * configure: Regenerate.
10053         * po/POTFILES.in: Regenerate.
10054         * po/bfd.pot: Regenerate.
10055         2000-11-29  Hans-Peter Nilsson  <hpn@cygnus.com>
10056         * elf32-sh64.c (sh64_elf_set_mach_from_flags): Do not recognize
10057         anything else but EF_SH64 and EF_SH64_ABI64.
10058         (sh64_elf_merge_private_data): Emit error for anything else but
10059         EF_SH64 and EF_SH64_ABI64.
10060         * config.bfd: Remove bfd_elf32_shblin_vec and bfd_elf32_shlin_vec
10061         from targ_selvecs.
10062         * configure.in: Add cofflink.lo to bfd_elf32_sh64_vec and
10063         bfd_elf32_sh64l_vec as a temporary measure.
10064         * configure: Regenerate.
10065         2000-11-27  Hans-Peter Nilsson  <hpn@cygnus.com>
10066         * cpu-sh.c (arch_info_struct): Include sh5 item
10067         unconditionalized.
10068         * config.bfd (sh64-*-elf*): Do not set targ_cflags.
10069         Add targ_selvecs bfd_elf32_sh_vec, bfd_elf32_shl_vec,
10070         bfd_elf32_shblin_vec and bfd_elf32_shlin_vec.
10071         * elf32-sh64.c: Tweak comments.
10072         (sh64_elf_set_mach_from_flags): Recognize all machine flags that
10073         are proper subsets of SH64 as bfd_mach_sh5.  Add EF_SH64_ABI64.
10074         (sh64_elf_copy_private_data_internal): Wrap long line.
10075         (sh64_elf_merge_private_data): Rewrite to allow objects from
10076         SH64 subsets to be linked together.
10077         (INCLUDE_SHMEDIA): Define.
10078         * elf32-sh.c (sh_elf_relocate_section) <local symbol>:
10079         Parenthesize plus-expression inside or-expression.
10080         <global symbol>: Ditto.
10081         (sh_elf_set_mach_from_flags): Remove code refusing
10082         deleted EF_SH64_32BIT_ABI flag.
10083         2000-11-26  Hans-Peter Nilsson  <hpn@cygnus.com>
10084         * elf32-sh.c (sh_elf_howto_table) <R_SH_IMM_LOW16_PCREL,
10085         R_SH_IMM_MEDLOW16_PCREL, R_SH_IMM_MEDHI16_PCREL,
10086         R_SH_IMM_HI16_PCREL, R_SH_64_PCREL>: Set pcrel_offset to true.
10087         (sh_elf_relocate_section) <local symbol>: Or 1 in
10088         calculation of relocation if sym->st_other & STO_SH5_ISA32.
10089         <global symbol>: Ditto if h->other & STO_SH5_ISA32.
10090         * elf32-sh64.c (shmedia_prepare_reloc): Add rel->r_addend to
10091         relocation.
10092         2000-11-24  Hans-Peter Nilsson  <hpn@cygnus.com>
10093         * Makefile.am (BFD32_BACKENDS): Add elf32-sh64.lo.
10094         (BFD32_BACKENDS_CFILES): Add elf32-sh64.c.
10095         Regenerate dependencies.
10096         * Makefile.in: Regenerate.
10097         * archures.c: Add bfd_mach_sh5.
10098         * config.bfd: Map targ_cpu sh* to bfd_sh_arch.
10099         Handle sh64-*-elf*.  Set targ_cflags to -DINCLUDE_SHMEDIA.
10100         * configure.in: Handle bfd_elf32_sh64_vec and bfd_elf32_sh64l_vec.
10101         * configure: Regenerate.
10102         * reloc.c (BFD_RELOC_SH_SHMEDIA_CODE, BFD_RELOC_SH_IMMU5,
10103         BFD_RELOC_SH_IMMS6, BFD_RELOC_SH_IMMS6BY32, BFD_RELOC_SH_IMMU6,
10104         BFD_RELOC_SH_IMMS10, BFD_RELOC_SH_IMMS10BY2,
10105         BFD_RELOC_SH_IMMS10BY4, BFD_RELOC_SH_IMMS10BY8,
10106         BFD_RELOC_SH_IMMS16, BFD_RELOC_SH_IMMU16, BFD_RELOC_SH_IMM_LOW16,
10107         BFD_RELOC_SH_IMM_LOW16_PCREL, BFD_RELOC_SH_IMM_MEDLOW16,
10108         BFD_RELOC_SH_IMM_MEDLOW16_PCREL, BFD_RELOC_SH_IMM_MEDHI16,
10109         BFD_RELOC_SH_IMM_MEDHI16_PCREL, BFD_RELOC_SH_IMM_HI16,
10110         BFD_RELOC_SH_IMM_HI16_PCREL, BFD_RELOC_SH_PT_16): New relocations.
10111         * cpu-sh.c [INCLUDE_SHMEDIA] (arch_info_struct): Define and link
10112         in item for SH5.
10113         * elf32-sh.c [INCLUDE_SHMEDIA] (sh_elf_howto_table): Add howto items
10114         for SHmedia relocs.
10115         [INCLUDE_SHMEDIA] (sh_rel): Add mappings for SHmedia relocs.
10116         [INCLUDE_SHMEDIA] (sh_elf_relocate_section) [default]: Call
10117         shmedia_prepare_reloc, goto final_link_relocate if it returns
10118         non-zero, else fail as before.
10119         (sh_elf_set_mach_from_flags): Provide function only if not defined
10120         as macro.  Do not recognize objects with EF_SH64_32BIT_ABI set.
10121         (sh_elf_set_private_flags): Provide function only if not defined
10122         as a macro.
10123         (sh_elf_copy_private_data): Similar.
10124         (sh_elf_merge_private_data): Similar.
10125         * section.c (SEC_SH_ISA_SHMEDIA): New.
10126         * targets.c (bfd_elf32_sh64_vec, bfd_elf32_sh64l_vec): Declare.
10127         * elf32-sh64.c: New file.
10128         * libbfd.h: Regenerate.
10129         * bfd-in2.h: Regenerate.
10130         * po/POTFILES.in: Regenerate.
10131         * po/bfd.pot: Regenerate.
10132         * bfd-in2.h: Regenerate.
10133         * libbfd.h: Regenerate.
10134
10135 2002-02-07  Daniel Jacobowitz  <drow@mvista.com>
10136
10137         * bfd-in.h: Update <stdbool.h> check to only see if <stdbool.h> has
10138         been included, not drag it in.
10139         * bfd-in2.h: Regenerate.
10140
10141 2002-02-06  H.J. Lu  (hjl@gnu.org)
10142
10143         * elf32-mips.c (_bfd_mips_elf_merge_private_bfd_data): Update
10144         the mach and ISA fields if necessary.
10145
10146 2002-02-06  Nick Clifton  <nickc@cambridge.redhat.com>
10147
10148         * coffcode.h (coff_set_arch_mach_hook): Select the highest known
10149         ARM architecture when an F_ARM_5 flag is detected, since we cannot
10150         be sure exactly which architecture this represents.
10151
10152 2002-02-05  Nick Clifton  <nickc@redhat.com>
10153
10154         * po/tr.po: Updated translation.
10155
10156 2002-02-05  Alan Modra  <amodra@bigpond.net.au>
10157
10158         From Jimi X <jimix@watson.ibm.com>
10159         * archures (bfd_mach_ppc64): Define.
10160         (bfd_powerpc_arch): Rename to bfd_powerpc_archs.
10161         (bfd_powerpc_arch): Define.
10162         * bfd-in2.h: Regenerate.
10163         * cpu-powerpc.c (arch_info_struct): Rename to bfd_powerpc_archs.
10164         (bfd_powerpc_arch): Move to tail of bfd_powerpc_archs.
10165         (bfd_powerpc_archs): Add default powerpc64 arch.
10166
10167 2002-02-05  Alan Modra  <amodra@bigpond.net.au>
10168
10169         * elf64-ppc.c (ppc64_elf_size_dynamic_sections): Check for relocs
10170         against section syms in readonly sections.  Don't do the global
10171         sym check if we find one.
10172         * elf64-s390.c (elf_s390_size_dynamic_sections): Likewise.
10173         * elf32-hppa.c (elf32_hppa_size_dynamic_sections): Likewise.
10174         * elf32-i386.c (elf_i386_size_dynamic_sections): Likewise.
10175         * elf32-s390.c (elf_s390_size_dynamic_sections): Likewise.
10176         (elf_s390_grok_prstatus): Add missing prototype.
10177
10178 2002-02-04  Hans-Peter Nilsson  <hp@bitrange.com>
10179
10180         * elf64-mmix.c (mmix_dump_bpo_gregs): New function.
10181         (mmix_elf_check_common_relocs) <case R_MMIX_BASE_PLUS_OFFSET>:
10182         Call bfd_get_section_by_name only once.  Initialize
10183         bpodata->n_bpo_relocs_this_section.
10184         (_bfd_mmix_prepare_linker_allocated_gregs): Remove comment
10185         referring to DSOs.
10186         (bpo_reloc_request_sort_fn): Don't use difference of values as
10187         return-value.
10188
10189 2002-02-02  David O'Brien  <obrien@FreeBSD>
10190
10191         * configure.in: Tweak the FreeBSD 4.x recognition more.  Only treat
10192         version 4.5 and later the same as 5-CURRENT.
10193         * configure: Re-generate.
10194
10195 2002-02-02  Jason Thorpe  <thorpej@wasabisystems.com>
10196
10197         * config.bfd (hppa*-*-netbsd*): New target.
10198
10199 2002-01-31  Philipp Thomas  <pthomas@suse.de>
10200
10201         * coff-arm.c (coff_arm_merge_private_bfd_data): Move ERROR
10202         to front of message. Unify messages with elf32-arm.h. Use
10203         commas where neccessary.
10204         * elf32-arm.h (elf32_arm_merge_private_bfd_data): Use all upcase
10205         ERROR in messages. Unify messages with coff-arm.c. Correct
10206         VFP/FPA error message.
10207         (elf32_arm_print_private_bfd_data): Don't mark APCS-26 and
10208         APCS-32 for translation.
10209
10210 2002-02-01  Hans-Peter Nilsson  <hp@bitrange.com>
10211
10212         Perform on-demand global register allocation from
10213         R_MMIX_BASE_PLUS_OFFSET relocs.
10214         * elf64-mmix.c (struct bpo_reloc_section_info, struct
10215         bpo_reloc_request, struct bpo_greg_section_info): New.
10216         (mmix_elf_check_common_relocs, mmix_elf_gc_sweep_hook,
10217         bpo_reloc_request_sort_fn, mmix_elf_relax_section,
10218         _bfd_mmix_check_all_relocs,
10219         _bfd_mmix_prepare_linker_allocated_gregs,
10220         _bfd_mmix_finalize_linker_allocated_gregs): New functions.
10221         (elf_mmix_howto_table): Correct src_mask for most relocs.
10222         (mmix_elf_perform_relocation) <case R_MMIX_BASE_PLUS_OFFSET>: New
10223         case.
10224         (mmix_final_link_relocate) <case R_MMIX_BASE_PLUS_OFFSET>: New
10225         case.  Fix typo in comment.  New label do_mmix_reloc.
10226         (mmix_elf_check_relocs): Abuse bfd_link_info member base_file to
10227         store first object file with a base-plus-offset reloc.  Call
10228         mmix_elf_check_common_relocs for the part common with mmo.
10229         (mmix_elf_final_link): Write out linker-allocated register
10230         contents section.
10231         (elf_backend_gc_sweep_hook): Define.
10232         (bfd_elf64_bfd_relax_section): Define.
10233
10234         * mmo.c: Don't include <ctype.h>
10235         (mmo_init): Correct init-once logic.
10236
10237 2002-02-01  Tom Rix  <trix@redhat.com>
10238
10239         * config.bfd: Conditionally support <aiaff> for pre AIX 4.3.
10240
10241 2002-02-01  Alan Modra  <amodra@bigpond.net.au>
10242
10243         * Makefile.am: Run "make dep-am"
10244         * Makefile.in: Regenerate.
10245
10246 2002-01-31  David O'Brien  <obrien@FreeBSD>
10247
10248         * configure.in: Recognize the differences in core files from FreeBSD
10249         4.{0,1} and later versions of 4.x.  This treats 4.2+ the same as
10250         5-CURRENT.
10251         * configure: Regenerate.
10252
10253 2002-01-31  Ivan Guzvinec  <ivang@opencores.org>
10254
10255         * coff-or32.c: New file.
10256         * cpu-or32.c: New file.
10257         * elf32-or32.c: New file.
10258         * archures.c: Add support for or32.
10259         * targets.c: Add support for or32.
10260         * bfd-in2.h: Regenerate.
10261         * coffcode.h (coff_set_arch_mach_hook, coff_set_flags,
10262         coff_write_object_contents): Add support for or32.
10263         * config.bfd: Add target.
10264         * configure.in: Add support for or32.
10265         * configure: Regenerate.
10266         * Makefile.am: Add support for or32.
10267         * Makefile.in: Regenerate.
10268         * po/SRC-POTFILES.in: Add or32 files.
10269         * po/bfd.pot: Regenerate.
10270
10271 2002-01-31  Nick Clifton  <nickc@cambridge.redhat.com>
10272             Don Lindsay  <lindsayd@cisco.com>
10273
10274         * elf32-mips.c (mips_elf_calculate_relocation): Replace 'return
10275         false' with a return of a bfd_reloc_ error code.
10276
10277 2002-01-31  Hans-Peter Nilsson  <hp@axis.com>
10278
10279         * elf32-cris.c (elf_cris_discard_excess_program_dynamics): Don't
10280         unexport unreferenced symbols when --export-dynamic.  Call
10281         _bfd_elf_strtab_delref when unexporting.
10282
10283 2002-01-30  Daniel Jacobowitz  <drow@mvista.com>
10284
10285         * bfd-in.h: Include <stdbool.h> if it is available.
10286         * bfd-in2.h: Regenerated.
10287
10288 2002-01-31  Alan Modra  <amodra@bigpond.net.au>
10289
10290         * elf64-ppc.c (func_desc_adjust): STV_PROTECTED functions should
10291         not go via the plt.
10292
10293 2002-01-30  Nick Clifton  <nickc@cambridge.redhat.com>
10294
10295         * archures.c: Tidy up formatting of embedded comments.
10296         * bfd.c: Tidy up formatting of embedded comments.
10297         * bfd-in.h: Fix formatting of comments.
10298         * reloc.c: Tidy up formatting of ordinary & embedded comments.
10299         * section.c: Tidy up formatting of embedded comments.
10300         * syms.c: Tidy up formatting of embedded comments.
10301         * targets.c: Tidy up formatting of embedded comments.
10302
10303         * bfd-in2.h: Regenerate.
10304
10305 2002-01-30  Nick Clifton  <nickc@cambridge.redhat.com>
10306
10307         * vms-tir.c (cmd_name): New function.
10308         (tir_cmd_name): New function.
10309         (etir_sta, etir_sto, etir_opr, etir_stc): Use cmd_name().
10310         (tir_opr, tir_ctl, tir_cmd): use tir_cmd_name().
10311         Fix formatting.
10312
10313         * peXXigen.c (pe_print_idata): Rearrange message to aid in
10314         translation.
10315         (pe_print_pdata): Rearrange message to aid in translation.
10316
10317         * libbfd.c (warn_deprecated): Rearrange error message to aid in
10318         translation.
10319
10320         * ihex.c (ihex_write_object_contents): Fix spelling typo.
10321
10322         * ieee.c (ieee_slurp_external_symbols): Remove spurious space.
10323
10324         * elf64-sparc.c (sparc64_elf_add_symbol_hook): Rearrange error
10325         message to aid in translation.
10326
10327         * elf64-mmix.c (mmix_final_link_relocate): Rearrange error message
10328         to aid in translation.
10329
10330         * elf32-arm.h (elf32_arm_merge_private_bfd_data): Fix typo.
10331
10332 2002-01-30  Philipp Thomas  <pthomas@suse.de>
10333
10334         * coff-arm.c, elf32-elf.h: Unify messages.
10335
10336 2002-01-30  Nick Clifton <nickc@redhat.com>
10337
10338         * po/sv.po: Updated translation.
10339
10340 2002-01-30  Philipp Thomas  <pthomas@suse.de>
10341
10342         * dwarf2.c (read_abbrev): Use full section name in error message.
10343         (decode_line_info): Likewise.
10344
10345         * elf.c (_bfd_elf_symbol_from_bfd_symbol): Don't translate debugging
10346         message.
10347
10348 2002-01-30  Alan Modra  <amodra@bigpond.net.au>
10349
10350         * elf64-ppc.c (func_desc_adjust): Only provide missing function
10351         descriptor symbols for undefined function code syms.  Clear
10352         ELF_LINK_NON_ELF so that they can stay weak.
10353
10354 2002-01-29  Chris Demetriou  <cgd@broadcom.com>
10355             Mitch Lichtenberg  <mpl@broadcom.com>
10356
10357         * bfd-in.h (bfd_mips_elf32_create_embedded_relocs): New prototype.
10358         * elf32-mips.c (bfd_mips_elf32_create_embedded_relocs): New function
10359         to handle 32-bit ELF embedded reloc (ld --embedded-relocs)
10360         generation.
10361         * bfd-in2.h: Regenerate.
10362
10363 2002-01-29  Chris Demetriou  <cgd@broadcom.com>
10364
10365         * elf32-mips.c: Add additional comments about HI16 relocation
10366         processing.
10367         (_bfd_mips_elf_hi16_reloc): Don't subtract address here for
10368         pc-relative relocations.  (Reverts change made on 2001-10-31.)
10369         (_bfd_mips_elf_lo16_reloc): Subtract address of LO16 part here
10370         for pc-relative relocations.
10371         (mips_elf_calculate_relocation): Add a comment about a kludge
10372         in the R_MIPS_GNU_REL_HI16 handling.
10373         (_bfd_mips_elf_relocate_section): Implement that kludge;
10374         adjust pc-relative HI16 relocation for difference in HI16 and
10375         LO16 addresses, since it can't easily be done in
10376         mips_elf_calculate_relocation.
10377
10378 2002-01-29  Martin Schwidefsky  <schwidefsky@de.ibm.com>
10379
10380         * elf32-i386 (elf_i386_adjust_dynamic_symbol): Do not replace PLT32
10381         relocations with PC32 relocations for undefined or weak symbols.
10382         * elf32-s390 (elf_i386_adjust_dynamic_symbol): Likewise.
10383         * elf64-s390x (elf_i386_adjust_dynamic_symbol): Likewise.
10384
10385 2002-01-28  Jason Thorpe  <thorpej@wasabisystems.com>
10386
10387         * elfcore.h (elf_core_file_p): Improve comment for last change.
10388
10389 2002-01-27  Daniel Jacobowitz  <drow@mvista.com>
10390
10391         * configure: Regenerated.
10392
10393 2002-01-27  Jason Thorpe  <thorpej@wasabisystems.com>
10394
10395         * elfcore.h (elf_core_file_p): Set the machine architecture
10396         before processing the program headers.
10397
10398 2002-01-26  Hans-Peter Nilsson  <hp@bitrange.com>
10399
10400         * configure.in <64-bit configuration>: If using gcc, check and
10401         emit error for egcs-1.1.2.
10402         * configure: Regenerate.
10403
10404 2002-01-26  Egor Duda  <deo@logos-m.ru>
10405
10406         * elf.c (elfcore_grok_win32pstatus): Copy only as much information
10407         as possible to avoid stack corruption.
10408
10409 2002-01-26  Richard Henderson  <rth@redhat.com>
10410
10411         * elf64-alpha.c (elf64_alpha_check_relocs): Don't set reltext
10412         for non-allocated sections.
10413
10414 2002-01-25  Mark Kettenis  <kettenis@gnu.org>
10415
10416         * elf.c (elfcore_write_prstatus): Make sure we pass the address of
10417         prstat.pr_reg even if it is a struct.
10418
10419 2002-01-25  Steve Ellcey <sje@cup.hp.com>
10420
10421         * elfxx-ia64.c: Reset AIX vector function overrides for HP-UX.
10422
10423 2002-01-25  Philipp Thomas  <pthomas@suse.de>
10424
10425         * coffgen.c (coff_print_symbol): Don't mark info message
10426         for translation.
10427
10428 2002-01-25  Nick Clifton <nickc@redhat.com>
10429
10430         * po/fr.po: Updated translation.
10431         * po/es.po: Updated translation.
10432
10433 2002-01-25  Philipp Thomas  <pthomas@suse.de>
10434
10435         * coff-alpha.c (alpha_relocate_section): Unify warning message
10436         for GP relative relocations without GP defined.
10437         * coff-mips.c (mips_relocate_section): Likewise.
10438
10439 2002-01-25  Alan Modra  <amodra@bigpond.net.au>
10440
10441         * elf-eh-frame.c (_bfd_elf_eh_frame_section_offset): Avoid
10442         unsigned overflow when new_offset < old_offset.
10443
10444 2002-01-24  Philipp Thomas  <pthomas@suse.de>
10445
10446         * bfd.c (_bfd_abort): Fix typo.
10447
10448 2002-01-23  Richard Henderson  <rth@redhat.com>
10449
10450         * elf64-alpha.c (elf64_alpha_adjust_dynamic_symbol): Don't suppress
10451         plt entries for undefweak symbols.
10452
10453 2002-01-23  Steve Ellcey <sje@cup.hp.com>
10454
10455         * targets.c (bfd_elf32_ia64_hpux_big_vec): Add to DEFAULT_VECTOR.
10456         (bfd_elf64_ia64_hpux_big_vec): Ditto.
10457         (bfd_elf32_h8300_vec): Ditto.
10458
10459 2002-01-23  Alan Modra  <amodra@bigpond.net.au>
10460
10461         * elf64-ppc.c: Remove stale part of ABI comment.
10462         (NO_OPD_RELOCS): Define.
10463         (ppc64_elf_check_relocs): Use it.
10464         (ppc64_elf_relocate_section): Here too.
10465         (build_one_stub): Don't point function syms at the stub.  Instead,
10466         hijack plt.offset.
10467         (ppc64_elf_relocate_section): Check whether REL24 relocs should
10468         really go to the stub.  Make all dynamic relocs in opd against
10469         locals.
10470         (ppc64_elf_finish_dynamic_symbol): Allow for non-standard use of
10471         plt.offset.
10472
10473 2002-01-22  Richard Henderson  <rth@redhat.com>
10474
10475         * elf64-alpha.c (INSN_UNOP): Encode with RB as $sp.
10476
10477 2002-01-22  Alan Modra  <amodra@bigpond.net.au>
10478
10479         * elf64-ppc.c (ppc64_elf_finish_dynamic_sections): Correct sign of
10480         TOC_BASE_OFF adjustment.
10481
10482         * Makefile.am: Run "make dep-am".
10483         * Makefile.in: Regenerate.
10484         * po/SRC-POTFILES.in: Regenerate.
10485
10486 2002-01-22  John David Anglin  <dave@hiauly1.hia.nrc.ca>
10487
10488         * configure.host (hppa*64*-*-hpux*, hppa*64*-*-linux*): Add new
10489         host defines.
10490
10491 2002-01-21  Hans-Peter Nilsson  <hp@axis.com>
10492
10493         * elf32-cris.c (cris_elf_relocate_section) <case R_CRIS_32_GOTREL>:
10494         Check for and emit error if sgot is NULL at this point.
10495
10496 2002-01-21  Jason Thorpe  <thorpej@wasabisystems.com>
10497
10498         * config.bfd (ia64*-*-netbsd*): New target.
10499
10500 2002-01-21  Thomas Klausner <wiz@danbala.ifoer.tuwien.ac.at>
10501
10502         * som.c (som_write_space_strings): Comment typo fix.
10503
10504 2002-01-21  Alan Modra  <amodra@bigpond.net.au>
10505
10506         * elf64-ppc.c (struct ppc_link_hash_entry): Add is_func and
10507         is_func_descriptor fields.
10508         (link_hash_newfunc): Init them.
10509         (ppc64_elf_check_relocs): Only R_PPC24_REL24 syms starting with a
10510         dot are candidates for plt entries.  When processing .opd relocs,
10511         set function descriptor strings to point inside function code
10512         string, and set new ppc_link_hash_entry fields.
10513         (ppc64_elf_gc_sweep_hook): Don't sweep R_PPC64_REL24 relocs.
10514         (ppc64_elf_adjust_dynamic_symbol): Remove most code dealing with
10515         function descriptors.  It's now done in..
10516         (func_desc_adjust): New.
10517         (ppc64_elf_func_desc_adjust): New.
10518         (define elf_backend_always_size_sections): Define.
10519         (ppc64_elf_hide_symbol): New.
10520         (define elf_backend_hide_symbol): Define.
10521         (allocate_dynrelocs): Remove code looking up function descriptors
10522         as that has been done earlier.
10523         (ppc64_elf_size_dynamic_sections): Use htab shortcut to elf hash
10524         table.
10525         (ppc64_elf_finish_dynamic_symbol): Likewise.  Remove code looking
10526         up function descriptor.
10527         (build_one_stub): Look up the function code sym.  Check for
10528         invalid plt offsets.
10529         (ppc64_elf_relocate_section): Tweak calls to undefined weak syms.
10530         Convert R_PPC64_TOC relocs to R_PPC64_RELATIVE in shared libs.
10531
10532         * elf-bfd.h (elf_backend_data <elf_backend_hide_symbol>): Add
10533         boolean param.
10534         (_bfd_elf_link_hash_hide_symbol): Likewise.
10535         * elflink.h (elf_link_add_object_symbols): Adjust call to
10536         elf_backend_hide_symbol.
10537         (elf_fix_symbol_flags): Likewise.
10538         (elf_link_assign_sym_version): Likewise. Use bfd_malloc rather
10539         than bfd_alloc.
10540         * elf.c (_bfd_elf_link_hash_hide_symbol): Add "force_local" param.
10541         Set ELF_LINK_FORCED_LOCAL and call _bfd_elf_strtab_delref.
10542         * elf32-hppa.c (elf32_hppa_hide_symbol): Likewise.
10543         (clobber_millicode_symbols): Adjust to suit new hide_symbol.
10544         * elf32-cris.c (elf_cris_hide_symbol): Add "force_local" param
10545         and adjust to suit.
10546         * elf32-mips.c (_bfd_mips_elf_hide_symbol): Likewise, and call
10547         _bfd_elf_link_hash_hide_symbol rather than duplicating code.
10548         * elfxx-ia64.c (elfNN_ia64_hash_hide_symbol): Likewise.
10549
10550 2002-01-18  Alan Modra  <amodra@bigpond.net.au>
10551
10552         * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Test for a
10553         dynamic function descriptor symbol, not the associated function
10554         symbol.
10555
10556 2002-01-17  Eric Christopher  <echristo@redhat.com>
10557
10558         * elf32-mips.c (mips_elf_calculate_relocation): Fix typo.
10559
10560 2002-01-17  Nick Clifton  <nickc@cambridge.redhat.com>
10561
10562         * po/bfd.pot: Regenerate.
10563         * po/fr.po: Regenerate.
10564
10565 2002-01-17  Alan Modra  <amodra@bigpond.net.au>
10566
10567         * elf-bfd.h (elf_backend_data <elf_backend_section_from_bfd_section>):
10568         Remove "Elf_Internal_Shdr *" param.
10569         (_bfd_mips_elf_section_from_bfd_section): Ditto.
10570         * elf32-mips.c (_bfd_mips_elf_section_from_bfd_section): Ditto.
10571         * elf32-m32r.c (_bfd_m32r_elf_section_from_bfd_section): Ditto.
10572         * elf32-v850.c (v850_elf_section_from_bfd_section): Ditto.
10573         * elf64-mmix.c (mmix_elf_section_from_bfd_section): Ditto.
10574         * elfxx-ia64.c (elfNN_hpux_backend_section_from_bfd_section): Ditto.
10575         * elf.c (_bfd_elf_section_from_bfd_section): Allow backend
10576         function to override special sections.  Remove hdr arg from
10577         backend call, and don't loop.
10578
10579 2002-01-16  Eric Christopher  <echristo@redhat.com>
10580
10581         * elf32-mips.c (mips_elf_calculate_relocation): Set require_jalxp
10582         on R_MIPS_26 and target is 16bit. Add R_MIPS16_GPREL to list of
10583         relocations requiring gp0 and gp.
10584
10585 2002-01-16  Richard Earnshaw  <rearnsha@arm.com>
10586
10587         * elf32-arm.h (elf32_arm_merge_private_bfd_data): Handle
10588         EF_ARM_VFP_FLOAT.
10589         (elf32_arm_print_private_bfd_data): Likewise.
10590
10591 2002-01-16  Nick Clifton  <nickc@cambridge.redhat.com>
10592
10593         * po/tr.po: Import new version.
10594
10595 2002-01-16  Alan Modra  <amodra@bigpond.net.au>
10596
10597         * elf64-ppc.c (ppc64_elf_howto_raw): Remove stale FIXMEs.
10598         (ppc64_elf_reloc_type_lookup): Use proper CTOR reloc.
10599         (ORI_R0_R0_0): Correct.
10600
10601 2002-01-16  Alan Modra  <amodra@bigpond.net.au>
10602
10603         * elflink.c (_bfd_elf_create_dynamic_sections): Don't set SEC_CODE
10604         when plt_not_loaded.
10605         * elf64-ppc.c (ppc64_elf_create_dynamic_sections): No need to
10606         clear .plt SEC_CODE here.  Create .stub and correct .glink flags.
10607         (PLT_INITIAL_ENTRY_SIZE): Set to 24.
10608         (ppc64_elf_glink_code): Delete.
10609         (PPC64_ELF_GLINK_SIZE): Delete.
10610         (ADDIS_R12_R2, STD_R2_40R1, LD_R11_0R12, LD_R2_0R12, MTCTR_R11,
10611         BCTR, ADDIS_R12_R12_1, LD_R2_40R1, NOP, LI_R0_0, B_DOT, LIS_R0_0,
10612         ORI_R0_R0_0): Define.
10613         (PLT_CALL_STUB_SIZE, GLINK_CALL_STUB_SIZE): Define.
10614         (struct ppc_link_hash_table): Add sstub and plt_overflow.
10615         (ppc64_elf_link_hash_table_create): Init them.
10616         (ppc64_elf_check_relocs <R_PPC64_REL24>): Refcount .plt entry.
10617         Don't copy to shared lib.
10618         (ppc64_elf_check_relocs): Call bfd_set_error on errors.
10619         (ppc64_elf_gc_sweep_hook <R_PPC64_REL24>): Sweep plt refcount.
10620         (allocate_dynrelocs <plt>): Don't change function sym here.  Make
10621         room for .stub and .glink code.
10622         (ppc64_elf_size_dynamic_sections): Handle .stub.  Make entry for
10623         DT_PPC64_GLINK.
10624         (ppc64_elf_final_link): Rename to ppc64_elf_set_toc.  Don't call
10625         bfd_elf64_bfd_final_link.
10626         (bfd_elf64_bfd_final_link): Don't define.
10627         (ppc64_elf_size_stubs): New.
10628         (build_plt_stub): New.
10629         (build_one_stub): New.
10630         (ppc64_elf_build_stubs): New.
10631         (ppc64_elf_relocate_section <toc relocs>): Remove assert.
10632         (ppc64_elf_relocate_section): Don't copy R_PPC64_REL24 relocs.
10633         (ppc64_elf_finish_dynamic_symbol): Don't build stubs here.  Set
10634         DT_PPC64_GLINK entry.  Tweak DT_PLTGOT, DT_JMPREL, DT_PLTRELSZ in
10635         case output sections not separate.  Adjust DT_RELASZ to not
10636         include plt relocs.  Set reserved got entry.  Set got and plt
10637         entry size.
10638         (elf_backend_got_header_size): Set to 8.
10639         * elf64-ppc.h: New file.
10640
10641 2002-01-16  Alan Modra  <amodra@bigpond.net.au>
10642
10643         * elf32-arm.h (elf32_arm_size_dynamic_sections): When removing
10644         sections, use bfd_section_list_remove.
10645         * elf32-i370.c (i370_elf_size_dynamic_sections): Likewise.
10646         * elflink.h (elf_link_add_object_symbols): When removing all
10647         sections, use bfd_section_list_clear.
10648
10649 2002-01-15  Nick Clifton  <nickc@cambridge.redhat.com>
10650
10651         * po/sv.po: New file: Swedish translation.
10652         * configure.in (ALL_LINGUAS): Add sv.
10653         * configure: Regenerate.
10654
10655 2002-01-15  Jakub Jelinek  <jakub@redhat.com>
10656
10657         * elflink.h (elf_link_input_bfd): Back out 2002-01-07 change.
10658         * elf.c (merge_sections_remove_hook): New function.
10659         (_bfd_elf_merge_sections): Pass it as 3rd argument to
10660         _bfd_merge_sections.
10661         * libbfd-in.h (_bfd_merge_sections): Add 3rd argument.
10662         * libbfd.h: Rebuilt.
10663         * merge.c (_bfd_merge_sections): Add remove_hook argument.
10664         Call remove_hook if a SEC_EXCLUDE section is encountered.
10665
10666 2002-01-15  Nick Clifton  <nickc@cambridge.redhat.com>
10667
10668         * elf32-xstormy16.c (xstormy16_reloc_map): Add new field 'table'.
10669         (xstormy16_reloc_map): Initialise new field with correct howto
10670         table.
10671         (xstormy16_reloc_type_lookup): Use 'table' field to locate correct
10672         howto entry.
10673
10674 2002-01-10  Michael Snyder  <msnyder@redhat.com>
10675
10676         * elf.c (elfcore_write_prstatus): Use long instead of pid_t;
10677         (elfcore_write_pstatus): Use long instead of pid_t;
10678         * elf-bfd.h: Change prototypes to use long instead of pid_t;
10679
10680 2002-01-09  Jason Thorpe  <thorpej@wasabisystems.com>
10681
10682         * elf.c: Update copyright years.
10683         (elfcore_grok_netbsd_note): Use NT_NETBSDCORE_PROCINFO
10684         and NT_NETBSDCORE_FIRSTMACH.  Improve a comment.
10685
10686 2002-01-08  Michael Snyder  <msnyder@redhat.com>
10687
10688         Add capability to write corefile note sections, for gdb.
10689         * elf.c (elfcore_write_note): New function.
10690         (elfcore_write_prpsinfo): New function.
10691         (elfcore_write_prstatus): New function.
10692         (elfcore_write_pstatus): New function.
10693         (elfcore_write_prfpreg): New function.
10694         (elfcore_write_prxfpreg): New function.
10695         * elf-bfd.h: Add prototypes for above functions.
10696
10697 2002-01-08  Alexandre Oliva  <aoliva@redhat.com>
10698
10699         * elf.c (elf_fake_sections): Propagate errors from
10700         elf_backend_fake_section.
10701
10702 2002-01-07  Jason Thorpe  <thorpej@wasabisystems.com>
10703
10704         * Makefile.am (BFD32_BACKENDS): Add elf32-sh-nbsd.lo.
10705         (BFD32_BACKENDS_CFILES): Add elf32-sh-nbsd.c.
10706         (elf32-sh-nbsd.lo): New rule.
10707         * Makefile.in: Regenerate.
10708         * config.bfd (sh*le-*-netbsdelf*): New target.
10709         (sh*-*-netbsdelf*): New target.
10710         * configure.in: Include netbsd-core.lo for native sh*-*-netbsd*.
10711         (bfd_elf32_shnbsd_vec): New vector.
10712         (bfd_elf32_shlnbsd_vec): New vector.
10713         * configure: Regenerate.
10714         * elf32-sh-nbsd.c: New file.
10715         * targets.c: Update copyright years.
10716         (_bfd_target_vector): Add bfd_elf32_shlnbsd_vec and
10717         bfd_elf32_shnbsd_vec.
10718
10719 2002-01-07  Aldy Hernandez  <aldyh@redhat.com>
10720
10721         * coff-rs6000.c (READ20): Use bfd_scan_vma.
10722
10723 2002-01-07  Geoffrey Keating  <geoffk@redhat.com>
10724
10725         * elflink.h (elf_link_input_bfd): Don't ask for the merged offset
10726         of a symbol in a section that will be deleted.
10727
10728 2002-01-07  Nick Clifton  <nickc@cambridge.redhat.com>
10729
10730         * po/es.po: New file: Spanish translation.
10731         * configure.in (ALL_LINGUAS): Add es.
10732         * configure: Regenerate.
10733
10734 2002-01-06  Steve Ellcey  <sje@cup.hp.com>
10735
10736         * elfxx-ia64.c (is_unwind_section_name): Add target vector as
10737         argument so we can handle HP-UX specially.
10738         (elfNN_ia64_hpux_vec): New for use in is_unwind_section_name.
10739         (elfNN_hpux_backend_section_from_bfd_section): New for support
10740         of SHN_IA_64_ANSI_COMMON.
10741         (elfNN_ia64_relax_section): Add support for SHN_IA_64_ANSI_COMMON.
10742         (is_unwind_section_name): Add special HP-UX support.
10743         (elfNN_ia64_section_from_shdr): Add support for more sections.
10744         (elfNN_ia64_fake_sections): Modify is_unwind_section_name call and
10745         add support for more sections.
10746         (elfNN_ia64_additional_program_headers): Modify
10747         is_unwind_section_name call.
10748         (elfNN_ia64_modify_segment_map): Remove assumption that there is
10749         only one unwind section in segment.
10750
10751 2002-01-06  Alan Modra  <amodra@bigpond.net.au>
10752
10753         * syms.c (_bfd_generic_make_empty_symbol): New function.
10754         * libbfd-in.h (_bfd_nosymbols_make_empty_symbol): Define as
10755         _bfd_generic_make_empty_symbol.
10756         * libbfd.h: Regenerate.
10757         * bfd-in2.h: Regenerate.
10758         * hppabsd-core.c (hppabsd_core_make_empty_symbol): Delete function.
10759         (hppabsd_core_get_symtab_upper_bound): Don't define.
10760         (hppabsd_core_get_symtab): Likewise.
10761         (hppabsd_core_print_symbol): Likewise.
10762         (hppabsd_core_get_symbol_info): Likewise.
10763         (hppabsd_core_bfd_is_local_label_name): Likewise.
10764         (hppabsd_core_get_lineno): Likewise.
10765         (hppabsd_core_find_nearest_line): Likewise.
10766         (hppabsd_core_bfd_make_debug_symbol): Likewise.
10767         (hppabsd_core_read_minisymbols): Likewise.
10768         (hppabsd_core_minisymbol_to_symbol): Likewise.
10769         (hppabsd_core_vec): Use BFD_JUMP_TABLE_SYMBOLS (_bfd_nosymbols).
10770         Formatting fixes.
10771         * hpux-core.c: Similarly.
10772         * irix-core.c: Similarly.
10773         * osf-core.c: Similarly.
10774         * sco5-core.c: Similarly.
10775         * binary.c (binary_make_empty_symbol): Remove function, define as
10776         _bfd_generic_make_empty_symbol.
10777         * ihex.c (ihex_make_empty_symbol): Likewise.
10778         * mmo.c (mmo_make_empty_symbol): Likewise.
10779         * ppcboot.c (ppcboot_make_empty_symbol): Likewise.
10780         * srec.c (srec_make_empty_symbol): Likewise.
10781         * versados.c (versados_make_empty_symbol): Likewise.
10782         * vms.c (_bfd_vms_make_empty_symbol): Remove.
10783         (vms_make_empty_symbol): Define as _bfd_generic_make_empty_symbol.
10784         * vms-gsd.c (_bfd_vms_slurp_gsd): Call bfd_make_empty_symbol
10785         rather than _bfd_vms_make_empty_symbol.
10786         * vms-misc.c (new_symbol): Likewise.
10787
10788 2002-01-05  Alan Modra  <amodra@bigpond.net.au>
10789
10790         * section.c (bfd_section_init): Remove unnecessary initialisations.
10791         (bfd_section_list_clear): New function.
10792         (bfd_section_list_remove, bfd_section_list_insert): New macros.
10793         (_bfd_strip_section_from_output): Use them.
10794         * coffcode.h (coff_set_alignment_hook): Likewise.
10795         * elf32-mips.c (_bfd_mips_elf_final_link): Likewise.
10796         * elf64-mips.c (mips_elf64_final_link): Likewise.
10797         * elf64-mmix.c (mmix_elf_final_link): Likewise.
10798         * sunos.c (sunos_add_dynamic_symbols): Likewise.
10799         * xcofflink.c (_bfd_xcoff_bfd_final_link): Likewise.
10800         * bfd-in2.h: Regenerate.
10801
10802         * netbsd-core.c (netbsd_core_file_p): Use bfd_make_section_anyway
10803         rather than doing our own section handling.  Clean up after errors
10804         with bfd_release and bfd_section_list_clear.  Handle unexpected
10805         flags.
10806         * aoutf1.h (sunos4_core_file_p): Likewise.
10807         * aix386-core.c (aix386_core_file_p): Likewise.
10808         * cisco-core.c (cisco_core_file_validate): Likewise.
10809         * ptrace-core.c (ptrace_unix_core_file_p): Likewise.
10810         * trad-core.c (trad_unix_core_file_p): Likewise.
10811
10812         * hppabsd-core.c (hppabsd_core_core_file_p): Clean up after errors
10813         with bfd_release and bfd_section_list_clear.
10814         * hpux-core.c (hpux_core_core_file_p): Likewise.
10815         * irix-core.c (irix_core_core_file_p): Likewise.
10816         * lynx-core.c (lynx_core_file_p): Likewise.
10817         * osf-core.c (osf_core_core_file_p): Likewise.
10818         * rs6000-core.c (rs6000coff_core_p): Likewise.
10819         * sco5-core.c (sco5_core_file_p): Likewise.
10820
10821         * elf32-mips.c (_bfd_mips_elf_lo16_reloc): Simplify, and perform
10822         sign extension adjustments without conditionals.
10823
10824 2002-01-04  Jakub Jelinek  <jakub@redhat.com>
10825
10826         * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): Don't crash if
10827         CIE at .eh_frame start is removed due to no FDEs referencing it.
10828
10829 2002-01-04  Jason Thorpe  <thorpej@wasabisystems.com>
10830
10831         * config.bfd (x86_64-*-netbsd*): New target.
10832         * configure.in (x86_64-*-netbsd*): Set COREFILE
10833         to netbsd-core.lo.
10834         * configure: Regenerated.
10835
10836 2002-01-03  Tom Rix  <trix@redhat.com>
10837
10838         * xcofflink.c (_bfd_xcoff_bfd_final_link): Update .pad section ordering
10839         for recent bfd_make_section_anyway change.
10840
10841 2002-01-03  Nick Clifton  <nickc@cambridge.redhat.com>
10842
10843         * elf32-arm.h (elf32_arm_final_link_relocate): Handle
10844         R_ARM_THM_PC11 reloc.
10845
10846 2002-01-02  Nick Clifton  <nickc@cambridge.redhat.com>
10847
10848         * configure.in (LINGUAS): Add ja.
10849         * configure: Regenerate.
10850         * po/ja.po: Import from translation project's web site.
10851
10852 2002-01-02  Nick Clifton  <nickc@cambridge.redhat.com>
10853
10854         * elf32-arm.h (elf32_arm_merge_private_bfd_data): Reformat error
10855         messages to ease translation into other languages.
10856
10857 For older changes see ChangeLog-0001
10858 \f
10859 Local Variables:
10860 mode: change-log
10861 left-margin: 8
10862 fill-column: 74
10863 version-control: never
10864 End: