* elf-hppa.h (elf_hppa_reloc_final_type): Use R_PARISC_PCREL16F as
[external/binutils.git] / bfd / ChangeLog
1 2002-07-16  John David Anglin  <dave@hiauly1.hia.nrc.ca>
2
3         * elf-hppa.h (elf_hppa_reloc_final_type): Use R_PARISC_PCREL16F as
4         the final type for the e_fsel selector when generating PA2.0W code.
5         (elf_hppa_relocate_insn): Provide support for PA2.0W 16-bit format 1
6         relocations.
7
8 2002-07-14  H.J. Lu <hjl@gnu.org>
9
10         * elflink.h (elf_link_assign_sym_version): Hide the default
11         definition if there is a hidden versioned definition.
12
13 2002-07-12  Hans-Peter Nilsson  <hp@axis.com>
14
15         * elf32-cris.c (cris_elf_relocate_section): Drop nonsensical
16         dynamic reference test in assertion when initializing GOT with
17         static contents.  Just assert that there are either no dynamic
18         sections, the symbol is defined in the regular objects or that the
19         symbol is undef weak.  Tweak comment.
20         (elf_cris_finish_dynamic_symbol): Emit .got reloc for a program
21         only if the symbol isn't defined in the program and isn't undef
22         weak.
23         (elf_cris_adjust_dynamic_symbol): Simplify condition for getting
24         rid of PLT entry: only do it if the symbol isn't defined in a DSO.
25         When doing so, clear ELF_LINK_HASH_NEEDS_PLT.  Tweak comments.
26         (elf_cris_discard_excess_program_dynamics): Don't consider
27         ELF_LINK_HASH_REF_DYNAMIC when omitting .got runtime relocs.
28
29 2002-07-11  Alan Modra  <amodra@bigpond.net.au>
30
31         * elf32-i386.c (elf_i386_relocate_section): Don't complain about
32         unresolved debugging relocs in dynamic applications.
33         * elf32-s390.c (elf_s390_relocate_section): Likewise.
34         * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
35         * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
36         * elf64-s390.c (elf_s390_relocate_section): Likewise.
37         * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
38         * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
39
40 2002-07-10  Alan Modra  <amodra@bigpond.net.au>
41
42         * elf64-ppc.c (ONES): Define.
43         (ppc64_elf_howto_table): Use ONES here to avoid warnings.  Fill in
44         missing src_mask fields.  Tweak R_PPC64_NONE, R_PPC64_COPY.  Fill
45         in missing dst_mask fields on R_PPC64_PLT32, R_PPC64_PLTREL32.
46
47         * elf64-ppc.c (ppc64_elf_get_symbol_info): Delete.
48         (ppc64_elf_set_private_flags): Delete.
49         (ppc64_elf_section_from_shdr): Delete.
50         (ppc64_elf_merge_private_bfd_data): Remove flag checking/merging code.
51         (ppc64_elf_fake_sections): Delete.
52         (bfd_elf64_bfd_set_private_flags): Don't define.
53         (bfd_elf64_get_symbol_info): Likewise.
54         (elf_backend_section_from_shdr): Likewise.
55         (elf_backend_fake_sections): Likewise.
56
57 2002-07-10  Marco Walther  <Marco.Walther@sun.com>
58
59         * elf.c: (assign_section_numbers) Set sh_entsize for .stab only
60         when not already set.
61         * elf64-sparc.c: (sparc64_elf_fake_sections): New function.
62         (elf_backend_fake_sections): Define.
63
64 2002-07-10  Alan Modra  <amodra@bigpond.net.au>
65
66         * merge.c (_bfd_merge_section): Remove redundant output_section check.
67         Formatting.
68         (_bfd_merge_sections): Don't set SEC_EXCLUDE on unused sections.
69
70 2002-07-09  Hans-Peter Nilsson  <hp@axis.com>
71
72         * elf32-cris.c (cris_elf_relocate_section): Move sanity-check for
73         NULL sym_hashes to just before use.
74         <case R_CRIS_32_GOTREL>: In test for local symbol, accept also
75         symbol with non-default visibility.
76         <case R_CRIS_32_GOTREL, case R_CRIS_32_PLT_GOTREL>: Ditto.
77         <case R_CRIS_8_PCREL, case R_CRIS_16_PCREL, case R_CRIS_32_PCREL>:
78         Ditto.
79         (cris_elf_gc_sweep_hook): Only decrease h->plt.refcount for
80         symbol with non-default visibility.
81         (cris_elf_check_relocs): At tests for local symbol before
82         increasing h->plt.refcount, also check for non-default
83         visibility.  Ditto when checking for local symbol to eliminate
84         pc-relative runtime relocs.
85
86 2002-07-08  Alan Modra  <amodra@bigpond.net.au>
87
88         * elf.c: Formatting.
89         (IS_SOLARIS_PT_INTERP): Add p_paddr and p_memsz checks.
90         (INCLUDE_SECTION_IN_SEGMENT): Remove IS_SOLARIS_PT_INTERP.
91         (copy_private_bfd_data): Set p_vaddr on broken Solaris PT_INTERP
92         segments.
93
94 2002-07-07  Mark Mitchell  <mark@codesourcery.com>
95             Alan Modra  <amodra@bigpond.net.au>
96
97         * cofflink.c (_bfd_coff_final_link): On PE COFF systems, take into
98         account the impact of relocation count overflow when computing
99         section offsets.
100         * coffcode.h (coff_write_relocs): Use obj_pe when deciding whether
101         or not to apply the PE COFF reloc overflow handling.  Fix a
102         fencepost error in deciding whether or not to use that technique.
103
104 2002-07-07  Alan Modra  <amodra@bigpond.net.au>
105
106         * elf-bfd.h (struct elf_reloc_cookie): Remove locsym_shndx,
107         change type of locsyms.
108         (bfd_elf_get_elf_syms): Declare.
109         * elf.c (bfd_elf_get_elf_syms): New function.
110         (group_signature): Use bfd_elf_get_elf_syms.
111         (bfd_section_from_r_symndx): Likewise.
112         * elfcode.h (elf_slurp_symbol_table): Likewise.
113         * elflink.h (elf_link_is_defined_archive_symbol): Likewise.
114         (elf_link_add_object_symbols): Likewise.  Reorganise to increase
115         locality of various data structures.  Properly free internal relocs.
116         (elf_bfd_final_link): Properly free internal relocs.
117         (elf_link_check_versioned_symbol): Use bfd_elf_get_elf_syms.
118         (elf_link_input_bfd): Likewise.
119         (elf_gc_mark): Likewise.  Properly free internal relocs.
120         (elf_gc_sweep): Properly free internal relocs.
121         (elf_reloc_symbol_deleted_p): No need to swap syms in.
122         (elf_bfd_discard_info): Use bfd_elf_get_elf_syms.  Properly free
123         internal relocs.
124         * elf-m10200.c (mn10200_elf_relax_section): Use bfd_elf_get_elf_syms.
125         Properly free possibly cached info.
126         (mn10200_elf_relax_delete_bytes): Remove symbol swapping code.
127         (mn10200_elf_symbol_address_p): Pass in internal syms.  Remove
128         symbol swapping code.
129         (mn10200_elf_get_relocated_section_contents): Use bfd_elf_get_elf_syms.
130         Properly free possibly cached info.
131         * elf-m10300.c (mn10300_elf_relax_section): As above for elf-m10200.c.
132         (mn10300_elf_relax_delete_bytes): Likewise.
133         (mn10300_elf_symbol_address_p): Likewise.
134         (mn10300_elf_get_relocated_section_contents): Likewise.
135         * elf32-h8300.c (elf32_h8_relax_section): As above for elf-m10200.c.
136         (elf32_h8_relax_delete_bytes): Likewise.
137         (elf32_h8_symbol_address_p): Likewise.
138         (elf32_h8_get_relocated_section_contents): Likewise.
139         * elf32-m32r.c (m32r_elf_relax_section): As above for elf-m10200.c.
140         (m32r_elf_relax_delete_bytes): Likewise.
141         (m32r_elf_get_relocated_section_contents): Likewise.
142         * elf32-sh.c (sh_elf_reloc_loop): Free section contents using
143         elf_section_data to determine whether cached.
144         (sh_elf_relax_section): As above for elf-m10200.c.
145         (sh_elf_relax_delete_bytes): Likewise.
146         (sh_elf_get_relocated_section_contents): Likewise.
147         * elf32-xstormy16.c (xstormy16_elf_relax_section): As above.
148         * elf64-alpha.c (elf64_alpha_relax_section): As above.  Also delay
149         reading of local syms.
150         * elf64-mmix.c (mmix_elf_relax_section): Likewise.
151         * elf64-sh64.c (sh_elf64_get_relocated_section_contents): As above.
152         * elfxx-ia64.c (elfNN_ia64_relax_section): As above.
153         * elfxx-mips.c (_bfd_mips_elf_check_relocs): Properly free internal
154         relocs.
155         * elf32-arm.h (bfd_elf32_arm_process_before_allocation): Properly
156         free internal relocs and section contents.  Don't read symbols.
157         * elf32-hppa.c (get_local_syms): Use bfd_elf_get_elf_syms.
158         (elf32_hppa_size_stubs): Don't free local syms.
159         * elf32-m68k.c (bfd_m68k_elf32_create_embedded_relocs): Delay
160         reading of local syms.  Use bfd_elf_get_elf_syms.  Properly free
161         possibly cached info.
162         * elf32-mips.c (bfd_mips_elf32_create_embedded_relocs): Likewise.
163         * elf64-hppa.c (elf64_hppa_check_relocs): Use bfd_elf_get_elf_syms.
164         * elf64-ppc.c (struct ppc_link_hash_table): Delete bfd_count and
165         all_local_syms.
166         (get_local_syms): Delete function.
167         (edit_opd): Use bfd_elf_get_elf_syms.  Free on error exit.  Cache
168         on exit.
169         (ppc64_elf_size_stubs): Use bfd_elf_get_elf_syms.  Free/cache on exit.
170
171 2002-07-05  Jim Wilson  <wilson@redhat.com>
172
173         * syms.c (decode_section_type): New.
174         (bfd_decode_symclass): Call decode_section_type.
175
176 2002-07-04  Jakub Jelinek  <jakub@redhat.com>
177
178         * merge.c (_bfd_merged_section_offset): Avoid accessing byte before
179         section content start.
180         Reported by Michael Schumacher <mike@hightec-rt.com>.
181
182 2002-07-04  Alan Modra  <amodra@bigpond.net.au>
183
184         * section.c (_bfd_strip_section_from_output):  Remove unnecessary
185         link order code.  Don't actually remove the output section here;
186         Just set a flag for the linker to do so.
187         * elflink.c (_bfd_elf_link_renumber_dynsyms): Test for removed
188         sections when setting up output section dynsyms.
189
190 2002-07-04  Alan Modra  <amodra@bigpond.net.au>
191
192         * elflink.h (elf_link_add_object_symbols): Revert 1999-09-02 hpux
193         fudge.
194         * elf.c (bfd_section_from_shdr): Work around broken hpux shared
195         libs here instead.
196
197 2002-07-02  Martin Schwidefsky  <schwidefsky@de.ibm.com>
198
199         * elf64-s390.c (create_got_section): Set .got section alignment to
200         8 bytes.
201         (elf_s390_check_relocs): Set .rela.dyn section alignment to 8 bytes.
202
203 2002-07-02  Alan Modra  <amodra@bigpond.net.au>
204
205         * elf.c (_bfd_elf_reloc_type_class): Fix comment grammar.
206
207 2002-07-01  Matt Thomas  <matt@3am-software.com>
208
209         * elf32-vax.c (elf32_vax_print_private_bfd_data): Change EF_*
210         to EF_VAX_*.
211
212 2002-07-01  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
213
214         * elfxx-mips.c (ABI_64_P): Fix comment.
215         (MIPS_ELF_OPTIONS_SECTION_NAME,MIPS_ELF_STUB_SECTION_NAME): Use the
216         new section names for N64 ABI.
217         (mips_elf_output_extsym): No special _gp_disp handling for NewABI.
218         (mips_elf_calculate_relocation): Code formatting.
219         (mips_elf_create_dynamic_relocation): Likewise.
220         (_bfd_mips_elf_fake_sections): IRIX6 needs this hack, too.
221         (_bfd_mips_elf_size_dynamic_sections): Handle GOT_PAGE for any NewABI.
222         (_bfd_mips_elf_relocate_section): No special handling for R_MIPS_64
223         in any NewABI.
224         (_bfd_mips_elf_finish_dynamic_symbol): No special _gp_disp handling
225         for NewABI.
226         (_bfd_mips_elf_modify_segment_map): Handle any N64 ABI.
227         (_bfd_mips_elf_gc_sweep_hook): NewABI GOT relocs should be handled
228         here, too.
229
230 2002-07-01  Andreas Schwab  <schwab@suse.de>
231
232         * elf64-x86-64.c (elf64_x86_64_relocate_section): Only convert
233         R_X86_64_64 to R_X86_64_RELATIVE.
234
235 2002-07-01  John David Anglin  <dave@hiauly1.hia.nrc.ca>
236
237         * vaxbsd.c: New BFD backend for VAX BSD and Ultrix.
238         * Makefile.am (BFD32_BACKENDS, BFD32_BACKENDS_CFILES): Add new backend.
239         Run "make dep-am".
240         * config.bfd (vax-*-bsd* | vax-*-ultrix*): Use vaxbsd_vec instead of
241         host_aout_vec.
242         * configure.in (vaxbsd_vec): Add.
243         * targets.c (vaxbsd_vec): Add.
244         * Makefile.in: Rebuild.
245         * configure: Rebuild.
246         * po/SRC-POTFILES.in: Rebuild.
247
248 2002-07-01  Alan Modra  <amodra@bigpond.net.au>
249
250         * elflink.h (elf_gc_mark): Pass in the section whose relocs we are
251         examining to gc_mark_hook, rather than the bfd.
252         (elf_gc_sections): Adjust.
253         * elf-bfd.h (struct elf_backend_data <gc_mark_hook>): Likewise.
254         * elf-m10300.c (mn10300_elf_gc_mark_hook): Likewise.
255         * elf32-arm.h (elf32_arm_gc_mark_hook): Likewise.
256         * elf32-avr.c (elf32_avr_gc_mark_hook): Likewise.
257         * elf32-cris.c (cris_elf_gc_mark_hook): Likewise.
258         * elf32-d10v.c (elf32_d10v_gc_mark_hook): Likewise.
259         * elf32-fr30.c (fr30_elf_gc_mark_hook): Likewise.
260         * elf32-hppa.c (elf32_hppa_gc_mark_hook): Likewise.
261         * elf32-i386.c (elf_i386_gc_mark_hook): Likewise.
262         * elf32-m32r.c (m32r_elf_gc_mark_hook): Likewise.
263         * elf32-m68k.c (elf_m68k_gc_mark_hook): Likewise.
264         * elf32-mcore.c (mcore_elf_gc_mark_hook): Likewise.
265         * elf32-openrisc.c (openrisc_elf_gc_mark_hook): Likewise.
266         * elf32-ppc.c (ppc_elf_gc_mark_hook): Likewise.
267         * elf32-s390.c (elf_s390_gc_mark_hook): Likewise.
268         * elf32-sh.c (sh_elf_gc_mark_hook): Likewise.
269         * elf32-sparc.c (elf32_sparc_gc_mark_hook): Likewise.
270         * elf32-v850.c (v850_elf_gc_mark_hook): Likewise.
271         * elf32-vax.c (elf_vax_gc_mark_hook): Likewise.
272         * elf32-xstormy16.c (xstormy16_elf_gc_mark_hook): Likewise.
273         * elf64-mmix.c (mmix_elf_gc_mark_hook): Likewise.
274         * elf64-ppc.c (ppc64_elf_gc_mark_hook): Likewise.
275         * elf64-s390.c (elf_s390_gc_mark_hook): Likewise.
276         * elf64-sh64.c (sh_elf64_gc_mark_hook): Likewise.
277         * elfxx-mips.c (_bfd_mips_elf_gc_mark_hook): Likewise.
278         * elfxx-mips.h (_bfd_mips_elf_gc_mark_hook): Likewise.
279         * elf64-x86-64.c (elf64_x86_64_gc_mark_hook): Likewise.
280         * elf32-frv.c (elf32_frv_gc_mark_hook): Likewise.  Also remove
281         redundant local sym tests.
282         * elf64-ppc.c (struct ppc_link_hash_entry): Add is_entry.
283         (link_hash_newfunc): Init is_entry.
284         (ppc64_elf_copy_indirect_symbol): Copy is_entry.
285         (ppc64_elf_link_hash_table_create): Init all_local_syms.
286         (create_linkage_sections): Use bfd_make_section_anyway rather than
287         bfd_make_section.
288         (ppc64_elf_mark_entry_syms): New function.
289         (ppc64_elf_check_relocs): Don't bother testing elf_bad_symtab.  Set
290         up opd entry to function section map.
291         (ppc64_elf_gc_mark_hook): Special case opd section relocs, and
292         relocs that reference the opd section.
293         (edit_opd): New function.
294         (ppc64_elf_size_dynamic_sections): Call get_local_syms and edit_opd.
295         (ppc64_elf_setup_section_lists): Don't calculate htab->bfd_count here.
296         (get_local_syms): Do so here.  Exit if we already have local syms.
297         Remove bogus comment imported from elf32-hppa.c.  Don't attempt to
298         read local syms on non-ELF input.
299         (ppc64_elf_size_stubs): Call _bfd_elf64_link_read_relocs rather
300         than duplicating it's function here.  Adjust free of internal
301         relocs to suit.
302         (ppc64_elf_relocate_section): Adjust local syms in opd section.
303         * elf64-ppc.h (ppc64_elf_mark_entry_syms): Declare.
304         * elf32-hppa.c (elf32_hppa_size_stubs): Call
305         _bfd_elf32_link_read_relocs rather than duplicating it's function
306         here.  Adjust free of internal relocs to suit.
307
308 2002-07-01  Andreas Jaeger  <aj@suse.de>
309
310         * elf64-x86-64.c (elf64_x86_64_check_relocs): Certain relocations
311         are not allowed in shared libs code, enforce -fPIC.
312
313 2002-06-29  Hans-Peter Nilsson  <hp@bitrange.com>
314
315         * mmo.c (mmo_write_loc_chunk): Don't eliminate leading and
316         trailing zero-sequences when there's previous left-over data.
317
318 2002-06-27  John David Anglin  <dave@hiauly1.hia.nrc.ca>
319
320         * elf64-hppa.c (elf64_hppa_reloc_type_class): New function.
321         (elf64_hppa_finish_dynamic_sections): Check other_rel_sec, dlt_rel_sec
322         and opd_rel_sec in order for starting rela section.  Check _raw_size.
323         (elf_backend_reloc_type_class): Define.
324
325 2002-06-27  Kevin Buettner <kevinb@redhat.com>
326
327         * dwarf2.c (decode_line_info): Handle older, non-standard, 64-bit
328         DWARF2 formats.
329
330 2002-06-27  Alan Modra  <amodra@bigpond.net.au>
331
332         * cpu-powerpc.c: Comment on ordering of arch_info.
333         * elf32-ppc.c (ppc_elf_object_p): New function.
334         (elf_backend_object_p): Define.
335         * elf64-ppc.c (ppc64_elf_object_p): New function.
336         (elf_backend_object_p): Define.
337
338 2002-06-26  Jason Thorpe  <thorpej@wasabisystems.com>
339
340         * configure.in (vax-*-netbsd*): Set COREFILE to netbsd-core.lo.
341         * configure: Regenerate.
342
343 2002-06-25  Jason Eckhardt  <jle@rice.edu>
344
345         * dwarf2.c (decode_line_info): Check unit->addr_size
346         to read in the proper number of prologue bytes.
347
348 2002-06-25  Nick Clifton  <nickc@cambridge.redhat.com>
349
350         * config.bfd (powerpc-*-aix5*): Only create a selvecs for
351         aix5coff64_vec if 64-bit bfd support has been enabled.
352         (powerpc64-*-aix5*): Only define if 64-bit bfd support has
353         been enabled.
354
355         * targets.c (_bfd_target_vector[]): Only include
356         aix5coff64_vec if 64-bit bfd support has been enabled.
357
358 2002-06-25  Alan Modra  <amodra@bigpond.net.au>
359
360         * elf64-ppc.c (ppc_add_stub): Replace strcpy/strncpy with memcpy.
361         * elf32-hppa.c (hppa_add_stub): Likewise.
362         * elflink.c (_bfd_elf_link_record_dynamic_symbol): Likewise.
363         * elflink.h (elf_add_default_symbol): Fix comment typo.
364         (elf_add_default_symbol): Replace strcpy and strncpy with memcpy.
365         (elf_link_add_object_symbols): Likewise.
366         (elf_link_assign_sym_version): Likewise.
367         * hash.c (bfd_hash_lookup): Likewise.
368         * linker.c (_bfd_generic_link_add_one_symbol): Likewise.
369         * section.c (bfd_get_unique_section_name): Likewise.
370         * syms.c (_bfd_stab_section_find_nearest_line): Likewise.
371         * elf.c (_bfd_elf_make_section_from_phdr): Likewise.
372         (assign_section_numbers): Likewise.
373         (_bfd_elfcore_make_pseudosection): Likewise.
374         (elfcore_grok_lwpstatus): Likewise.
375         (elfcore_grok_win32pstatus): Likewise.
376         (elfcore_write_note): Constify input params.  Use PTR instead of
377         void *.  Include terminating NUL in namesz.  Correct padding.
378         Support NULL "name" param.  Use memcpy instead of strcpy.
379         (elfcore_write_prpsinfo): Constify input params.
380         (elfcore_write_prstatus): Likewise.  Use PTR instead of void *.
381         (elfcore_write_lwpstatus): Likewise.
382         (elfcore_write_pstatus): Likewise.
383         (elfcore_write_prfpreg): Likewise.
384         (elfcore_write_prxfpreg): Likewise.
385         * elf-bfd.h (elfcore_write_note): Update declaration.
386         (elfcore_write_prpsinfo): Likewise.
387         (elfcore_write_prstatus): Likewise.
388         (elfcore_write_pstatus): Likewise.
389         (elfcore_write_prfpreg): Likewise.
390         (elfcore_write_prxfpreg): Likewise.
391         (elfcore_write_lwpstatus): Likewise.
392
393 2002-06-25  Jason Eckhardt  <jle@rice.edu>
394
395         * ecoff.c (ecoff_set_symbol_info): Set BSF_FUNCTION for
396         symbols of type stProc and stStaticProc.
397
398 2002-06-25  Nick Clifton  <nickc@redhat.com>
399
400         * ecoff.c: VArious formatting fixes.
401
402 2002-06-25  Alan Modra  <amodra@bigpond.net.au>
403
404         * coff-rs6000.c (xcoff_generate_rtinit): Fix typo.
405
406 2002-06-25  Alan Modra  <amodra@bigpond.net.au>
407
408         * aout-adobe.c: Don't compare against "true" or "false.
409         * aout-target.h: Likewise.
410         * aoutx.h: Likewise.
411         * archive.c: Likewise.
412         * bout.c: Likewise.
413         * cache.c: Likewise.
414         * coff-a29k.c: Likewise.
415         * coff-alpha.c: Likewise.
416         * coff-i386.c: Likewise.
417         * coff-mips.c: Likewise.
418         * coff-or32.c: Likewise.
419         * coff64-rs6000.c: Likewise.
420         * coffcode.h: Likewise.
421         * coffgen.c: Likewise.
422         * cpu-ns32k.c: Likewise.
423         * ecoff.c: Likewise.
424         * ecofflink.c: Likewise.
425         * elf.c: Likewise.
426         * elf32-arm.h: Likewise.
427         * elf32-cris.c: Likewise.
428         * elf32-d30v.c: Likewise.
429         * elf32-i386.c: Likewise.
430         * elf32-mcore.c: Likewise.
431         * elf32-ppc.c: Likewise.
432         * elf32-sh.c: Likewise.
433         * elf32-sh64.c: Likewise.
434         * elf32-v850.c: Likewise.
435         * elf64-alpha.c: Likewise.
436         * elf64-sh64.c: Likewise.
437         * elfcode.h: Likewise.
438         * elfcore.h: Likewise.
439         * elflink.h: Likewise.
440         * elfxx-mips.c: Likewise.
441         * i386os9k.c: Likewise.
442         * ieee.c: Likewise.
443         * libbfd.c: Likewise.
444         * linker.c: Likewise.
445         * mmo.c: Likewise.
446         * nlm32-alpha.c: Likewise.
447         * nlm32-i386.c: Likewise.
448         * nlm32-ppc.c: Likewise.
449         * nlm32-sparc.c: Likewise.
450         * nlmcode.h: Likewise.
451         * oasys.c: Likewise.
452         * pdp11.c: Likewise.
453         * peicode.h: Likewise.
454         * reloc.c: Likewise.
455         * som.c: Likewise.
456         * srec.c: Likewise.
457         * tekhex.c: Likewise.
458         * vms.c: Likewise.
459         * xcofflink.c: Likewise.
460         * elf64-sparc.c: Edit comment to not use "== false".
461
462         * aoutf1.h: Don't use "? true : false".
463         * ecoff.c: Likewise.
464         * format.c: Likewise.
465         * ieee.c: Likewise.
466         * linker.c: Likewise.
467         * mmo.c: Likewise.
468         * oasys.c: Likewise.
469
470 2002-06-23  H.J. Lu  <hjl@gnu.org>
471
472         * elflink.h (elf_link_add_archive_symbols): For the default
473         version, check references with only one `@' first.
474
475 2002-06-23  John David Anglin  <dave@hiauly1.hia.nrc.ca>
476
477         * elf64-hppa.c (elf64_hppa_mark_milli_and_exported_functions): New
478         function.
479         (allocate_global_data_dlt):  Don't add millicode symbols to dynamic
480         symbol table.
481         (allocate_global_data_opd, allocate_dynrel_entries): Likewise.
482         (elf64_hppa_size_dynamic_sections): Revise to use
483         elf64_hppa_mark_milli_and_exported_functions.
484         (elf64_hppa_finish_dynamic_symbol): Remove code to keep millicode
485         symbols out of dynamic symbol table.
486
487 2002-06-23  Alan Modra  <amodra@bigpond.net.au>
488
489         * Makefile.in: Regenerate.
490         * libbfd.h: Regenerate.
491         * bfd-in2.h: Regenerate.
492         * configure: Regenerate.
493         * po/SRC-POTFILES.in: Regenerate.
494
495         * elflink.h: Comment typo fixes.
496
497 2002-06-23  H.J. Lu  <hjl@gnu.org>
498
499         * elf-bfd.h (elf_link_loaded_list): New structure.
500         (elf_link_hash_table): Add "loaded".
501         * elf.c (_bfd_elf_link_hash_table_init): Initialize "loaded".
502         * elflink.h (elf_link_check_versioned_symbol): New function.
503         (elf_link_output_extsym): Call elf_link_check_versioned_symbol.
504
505 2002-06-19  Nick Clifton  <nickc@cambridge.redhat.com>
506
507         * elflink.h (size_dynamic_sections): If the target does not
508         support an ELF style hash table, return true, indicating that
509         nothing needed to be done, rather than false, indicating that the
510         section's size could not be computed.
511
512 2002-06-18  Dave Brolley  <brolley@redhat.com>
513
514         From Catherine Moore, Michael Meissner, Dave Brolley:
515         * po/SRC-POTFILES.in: Add cpu-frv.c and elf32-frv.c
516         * targets.c: Support bfd_elf32_frv_vec.
517         * reloc.c: Add FRV relocs.
518         * configure.in: Add support for bfd-elf32-frv-vec.
519         * config.bfd (targ_cpu): Add support for frv-*-elf.
520         * archures.c: Add frv arch and machines.
521         * Makefile.am (ALL_MACHINES): Add cpu-frv.lo.
522         (ALL_MACHINES_CFILES): Add cpu-frv.c.
523         (BFD32_BACKENDS): Add elf32-frv.lo.
524         (BFD32_BACKENDS_CFILES): Add elf32-frv.c
525         (cpu-frv.lo): New target.
526         (elf32-frv.lo): New target.
527         * cpu-frv.c: New file.
528         * elf32-frv.c: New file.
529
530 2002-06-18  Jakub Jelinek  <jakub@redhat.com>
531
532         * elfcode.h (elf_object_p): Sanity check eh_shoff == 0 implies
533         e_shnum == 0.
534         Only read the first section header if e_shoff is non-zero.
535         Don't consider e_shstrndx if there are no sections.
536
537 2002-06-17  Tom Rix <trix@redhat.com>
538
539         * elf32-d10v.c (elf_d10v_howto_table): Change R_D10V_10_PCREL_R,
540         R_D10V_10_PCREL_L and R_D10V_18_PCREL to use
541         complain_overflow_bitfield.
542
543 2002-06-17  Alan Modra  <amodra@bigpond.net.au>
544
545         * opncls.c (bfd_openr): Remove redundant bfd_set_error.
546         (bfd_fdopenr): Likewise.
547         (bfd_openstreamr): Likewise.
548         (bfd_openw): Likewise.
549
550         * targets.c: Sort target vecs.
551         (_bfd_target_vector): Add aix5coff64_vec, bfd_elf32_sh64_vec,
552         bfd_elf32_sh64l_vec, bfd_elf32_sh64lnbsd_vec,
553         bfd_elf32_sh64nbsd_vec, bfd_elf64_sh64_vec, bfd_elf64_sh64l_vec,
554         bfd_elf64_sh64lnbsd_vec, bfd_elf64_sh64nbsd_vec.
555         * configure.in: Sort target vecs.  Add m88kmach3_vec.
556         * configure: Regenerate.
557
558 2002-06-16  Hans-Peter Nilsson  <hp@bitrange.com>
559
560         * elf64-mmix.c (bpo_reloc_request_sort_fn): Use member
561         bpo_reloc_no to break sort order ties, not address of items.
562
563 2002-06-16  John David Anglin  <dave@hiauly1.hia.nrc.ca>
564
565         * elf-hppa.h (elf_hppa_final_link): Fix formatting in comment.
566         Skip excluded sections in determing __gp value.
567         (elf_hppa_final_link_relocate): Use the symbol's address in
568         R_PARISC_FPTR64 relocations that don't need an opd entry.
569         * elf64-hppa.c (allocate_dynrel_entries): Simplify code.
570         (elf64_hppa_finalize_dynreloc): Likewise.
571         (elf64_hppa_size_dynamic_sections): Move comments and fix typo.
572         (elf64_hppa_finish_dynamic_symbol): Break up assert.
573
574 2002-06-14  Sergey Grigoriev  <serge@leopold.Physik.Uni-Augsburg.DE>
575
576         * pei-i386.c (COFF_SECTION_ALIGNMENT_ENTRIES): Enable 16 byte
577         alignment for .bss, .data and .text sections so that sse and sse2
578         code will work.
579         * pe-i386.c (COFF_SECTION_ALIGNMENT_ENTRIES): Likewise.
580
581 2002-06013  J"orn Rennecke  <joern.rennecke@superh.com>
582
583         config.bfd: Add support for sh[1234]l*-*-elf* | sh3el*-*-elf*,
584         sh[1234]*-elf*.
585
586 2002-06-12  John David Anglin  <dave@hiauly1.hia.nrc.ca>
587
588         * elflink.h (elf_bfd_final_link): Improve error handling for missing
589         dynamic sections.
590
591         * elf64-hppa.c (allocate_global_data_opd): We don't need an opd entry
592         for a symbol that has no output section.
593         (allocate_dynrel_entries): Correct comment.
594         (elf64_hppa_finalize_dynreloc): Likewise.  Don't create an opd entry
595         unless we want one.
596         (elf64_hppa_finalize_opd): Prevent segfault if dyn_h is NULL.
597         (elf64_hppa_finalize_dlt): Likewise.  Prevent segfault for symbols
598         with no section.  Remove unnecessary parentheses.
599
600 2002-06-11  Tom Rix  <trix@redhat.com>
601
602         * coffcode.h (coff_compute_section_file_positions): Add data
603         section to AIX loader alignment check.
604
605         * coff-rs6000.c (_bfd_xcoff_mkobject): Set default text section
606         alignment to 4 bytes.
607         (_bfd_xcoff_copy_private_bfd_data): Use text and data alignment
608         power accessor macro.
609         (do_shared_object_padding): Remove invalid assertion.
610
611 2002-06-10  Richard Sandiford  <rsandifo@redhat.com>
612
613         * section.c (_bfd_strip_section_from_output): Set SEC_EXCLUDE
614         for removed output sections.
615
616 2002-06-10  Geoffrey Keating  <geoffk@redhat.com>
617
618         * merge.c (merge_strings): Use htab_create_alloc with calloc, not
619         htab_alloc.
620         * elf-strtab.c (_bfd_elf_strtab_finalize): Likewise.
621
622 2002-06-08  H.J. Lu <hjl@gnu.org>
623
624         * elf.c (copy_private_bfd_data): Don't cast to bfd_size_type to
625         work around a long long bug in gcc 2.96 on mips.
626
627 2002-06-08  Jason Thorpe  <thorpej@wasabisystems.com>
628
629         * Makefile.am (BFD32_BACKENDS): Add vax1knetbsd.lo.
630         (BFD32_BACKENDS_CFILES): Add vax1knetbsd.c.
631         Regenerate dependency lists.
632         * Makefile.in: Regenerate.
633         * config.bfd (vax-*-netbsdelf*, vax-*-netbsdaout*): Add
634         vax1knetbsd_vec to targ_selvecs.
635         * configure.in: Add vax1knetbsd_vec.
636         * configure: Regenerate.
637         * targets.c (_bfd_target_vector): Add vax1knetbsd_vec.
638         * vax1knetbsd.c: New file.
639         * vaxnetbsd.c: Update copyright years.
640         (TARGET_PAGE_SIZE): Set to 0x1000.
641         (DEFAULT_MID): Set to M_VAX4K_NETBSD.
642
643 2002-06-08  Matt Thomas  <matt@3am-software.com>
644
645         * libaout.h (enum machine_type): Add M_VAX4K_NETBSD.
646
647 2002-06-08  Alan Modra  <amodra@bigpond.net.au>
648
649         * elf64-sh64.c (sh64_elf64_link_output_symbol_hook): Make static.
650
651 2002-06-08  Alan Modra  <amodra@bigpond.net.au>
652
653         * Makefile.am: Run "make dep-am".
654         * Makefile.in: Regenerate.
655
656         * armnetbsd.c: Replace CONST with const.
657         * corefile.c: Likewise.
658         * elf32-dlx.c: Likewise.
659         * elf64-mips.c: Likewise.
660         * mmo.c: Likewise.
661         * ns32knetbsd.c: Likewise.
662
663         * elf64-sparc.c (sparc64_elf_add_symbol_hook): Check the hash
664         table is elf64-sparc.
665
666 2002-06-08  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
667
668         * elfxx-mips.c (_bfd_mips_elf_relocate_section): Simplify code.
669         Fix RELA addends to get not shifted in the result. Don't do special
670         handling of R_MIPS_64 for NewABI.
671
672 2002-06-07  Alan Modra  <amodra@bigpond.net.au>
673
674         * aoutx.h (NAME(aout,slurp_symbol_table)): Use bfd_zmalloc.
675         (NAME(aout,slurp_reloc_table)): Likewise.
676         * coff-mips.c (mips_relax_section): Use bfd_zalloc.
677         * coff-rs6000.c (xcoff_write_armap_big): Use bfd_zmalloc.
678         (xcoff_write_archive_contents_big): Likewise.
679         (xcoff_generate_rtinit): Likewise.
680         (xcoff_generate_rtinit): Likewise, and check error return.
681         * coff64-rs6000.c (xcoff64_generate_rtinit): Likewise.
682         * coffgen.c (coff_section_symbol): Use bfd_zalloc.
683         (coff_get_normalized_symtab): Likewise.
684         (coff_make_empty_symbol): Likewise.
685         (bfd_coff_set_symbol_class): Likewise.
686         * cofflink.c (coff_link_add_symbols): Likewise.
687         * ecoff.c (_bfd_ecoff_make_empty_symbol): Likewise.
688         * ecofflink.c (ecoff_write_shuffle): Use bfd_zmalloc.
689         (bfd_ecoff_write_accumulated_debug): Likewise.
690         * elf64-alpha.c (get_got_entry): Use bfd_zalloc.
691         * i386linux.c (bfd_i386linux_size_dynamic_sections): Likewise.
692         * i386lynx.c (NAME(lynx,slurp_reloc_table)): Use bfd_zmalloc.
693         * ieee.c (do_with_relocs): Use bfd_zalloc.
694         * m68klinux.c (bfd_m68klinux_size_dynamic_sections): Likewise.
695         * pdp11.c (NAME(aout,slurp_symbol_table)): Use bfd_zmalloc.
696         (NAME(aout,slurp_reloc_table)): Likewise.
697         (NAME(aout,squirt_out_relocs)): Don't memset when zalloc'd.
698         * reloc16.c (bfd_coff_reloc16_relax_section): Use bfd_zmalloc.
699         * som.c (som_build_and_write_symbol_table): Likewise.
700         (som_slurp_string_table): Likewise.
701         (som_slurp_symbol_table): Likewise.
702         (som_bfd_ar_write_symbol_stuff): Likewise.
703         * sparclinux.c (bfd_sparclinux_size_dynamic_sections): Use bfd_zalloc.
704         * sunos.c (bfd_sunos_size_dynamic_sections): Likewise.
705         * tekhex.c (find_chunk): Likewise.  Get rid of unused "sname".
706         * vms-gsd.c (_bfd_vms_slurp_gsd): Use bfd_zmalloc.
707         * xcofflink.c (xcoff_link_add_symbols): Use bfd_zalloc/bfd_zmalloc.
708
709 2002-06-07  Alan Modra  <amodra@bigpond.net.au>
710
711         * elf-bfd.h (struct bfd_elf_section_data <group_name>): Replace with
712         "group" union.
713         (elf_group_name): Update.
714         (elf_group_id): Define.
715         (bfd_elf_set_group_contents): Declare.
716         * elf.c (elf_fake_sections): Qualify use of elf_group_name.
717         (set_group_contents): Rename to bfd_elf_set_group_contents.  Remove
718         ATTRIBUTE_UNUSED from failedptrarg.  If elf_group_id is set, use
719         that sym for the signature.
720         (_bfd_elf_compute_section_file_positions): Don't call
721         set_group_contents for "ld -r" case.
722         (swap_out_syms): Use bfd_zalloc.
723         * elflink.h (elf_link_add_archive_symbols): Likewise.
724         (NAME(bfd_elf,size_dynamic_sections)): Likewise.
725         (elf_bfd_final_link): Call bfd_elf_set_group_contents.
726
727 2002-06-07  Alan Modra  <amodra@bigpond.net.au>
728
729         * elf64-ppc.c (ppc64_elf_relocate_section): Allow unresolved
730         relocs in opd for non-shared too.
731
732 2002-06-06  Jeffrey Law <law@redhat.com
733
734         * elf32-h8300.c (elf32_h8_relax_section): Ignore uninteresting
735         relocations.
736
737 2002-06-06  Nick Clifton  <nickc@cambridge.redhat.com>
738
739         * merge.c: Include libiberty.h.
740         * elf-strtab.c: Include libiberty.h.
741
742 2002-06-06  Elias Athanasopoulos  <eathan@otenet.gr>
743
744         * peXXigen.c (pe_print_idata): Remove unused variable.
745
746 2002-06-06  David Heine <dlheine@tensilica.com>
747
748         * elf.c (assign_file_positions_for_segments): Remove unallocated
749         sections from the section to segment mapping for PT_LOAD segments.
750         Update comment about empty loadable segments.
751
752 2002-06-06  Richard Sandiford  <rsandifo@redhat.com>
753
754         * stabs.c (_bfd_link_section_stabs): Check that the symbol offset
755         is within the .stabstr section.
756
757 2002-06-06  Alan Modra  <amodra@bigpond.net.au>
758
759         * elf-bfd.h (struct elf_size_info <swap_symbol_in>): Function args
760         are "const PTR", not "const PTR *".
761         (bfd_elf32_swap_symbol_in): Likewise.
762         (bfd_elf64_swap_symbol_in): Likewise.
763         * elfcode.h (elf_swap_symbol_in): Change input args to const PTR.
764         (elf_slurp_symbol_table): Adjust call to elf_swap_symbol_in.
765         * elflink.h (elf_link_is_defined_archive_symbol): Likewise.
766         (elf_link_add_object_symbols): Likewise.
767         (elf_link_record_local_dynamic_symbol): Likewise.
768         (elf_link_input_bfd): Likewise.
769         (elf_gc_mark): Likewise.
770         (elf_reloc_symbol_deleted_p): Likewise.
771         * elf-m10200.c (mn10200_elf_relax_section): Likewise.
772         (mn10200_elf_relax_delete_bytes): Likewise.
773         (mn10200_elf_symbol_address_p): Likewise.
774         (mn10200_elf_get_relocated_section_contents): Likewise.
775         * elf-m10300.c (mn10300_elf_relax_section): Likewise.
776         (mn10300_elf_relax_section): Likewise.
777         (mn10300_elf_relax_delete_bytes): Likewise.
778         (mn10300_elf_symbol_address_p): Likewise.
779         (mn10300_elf_get_relocated_section_contents): Likewise.
780         * elf32-h8300.c (elf32_h8_relax_section): Likewise.
781         (elf32_h8_relax_delete_bytes): Likewise.
782         (elf32_h8_symbol_address_p): Likewise.
783         (elf32_h8_get_relocated_section_contents): Likewise.
784         * elf32-hppa.c (get_local_syms): Likewise.
785         * elf32-m68k.c (bfd_m68k_elf32_create_embedded_relocs): Likewise.
786         * elf32-mips.c (bfd_mips_elf32_create_embedded_relocs): Likewise.
787         * elf32-sh.c (sh_elf_relax_section): Likewise.
788         (sh_elf_relax_delete_bytes): Likewise.
789         (sh_elf_get_relocated_section_contents): Likewise.
790         * elf32-xstormy16.c (xstormy16_elf_relax_section): Likewise.
791         * elf64-alpha.c (elf64_alpha_relax_section): Likewise.
792         * elf64-hppa.c (elf64_hppa_check_relocs): Likewise.
793         * elf64-mmix.c (mmix_elf_relax_section): Likewise.
794         * elf64-ppc.c (get_local_syms): Likewise.
795         * elf64-sh64.c (sh_elf64_get_relocated_section_contents): Likewise.
796         * elfxx-ia64.c (elfNN_ia64_relax_section): Likewise.
797
798 2002-06-05  J"orn Rennecke <joern.rennecke@superh.com>
799
800         * config.bfd (sh64l*-*-elf*, shl*-*-elf*): New configurations.
801
802 2002-06-05  Alan Modra  <amodra@bigpond.net.au>
803
804         * elf.c (group_signature): Swap in the whole symbol, and handle
805         extracting section symbol names.
806         (setup_group): Add comment.
807         (set_group_contents): When called from objcopy or ld, arrange for
808         section contents to be written.  Write group member output section
809         indices to allow objcopy to reorganize sections.
810         (_bfd_elf_copy_private_section_data): Copy group info.
811
812         * elf-bfd.h (struct elf_size_info): Add swap_symbol_in field.
813         (bfd_elf32_swap_symbol_in): Update prototype.
814         (bfd_elf64_swap_symbol_in): Likewise.
815         * elfcode.h (elf_swap_symbol_in): Change input args to const PTR *.
816         (elf_slurp_symbol_table): Adjust call to elf_swap_symbol_in.
817         * elflink.h (elf_link_is_defined_archive_symbol): Likewise.
818         (elf_link_add_object_symbols): Likewise.
819         (elf_link_record_local_dynamic_symbol): Likewise.
820         (elf_link_input_bfd): Likewise.
821         (elf_gc_mark): Likewise.
822         (elf_reloc_symbol_deleted_p): Likewise.
823         * elf-m10200.c (mn10200_elf_relax_section): Likewise.
824         (mn10200_elf_relax_delete_bytes): Likewise.
825         (mn10200_elf_symbol_address_p): Likewise.
826         (mn10200_elf_get_relocated_section_contents): Likewise.
827         * elf-m10300.c (mn10300_elf_relax_section): Likewise.
828         (mn10300_elf_relax_section): Likewise.
829         (mn10300_elf_relax_delete_bytes): Likewise.
830         (mn10300_elf_symbol_address_p): Likewise.
831         (mn10300_elf_get_relocated_section_contents): Likewise.
832         * elf32-h8300.c (elf32_h8_relax_section): Likewise.
833         (elf32_h8_relax_delete_bytes): Likewise.
834         (elf32_h8_symbol_address_p): Likewise.
835         (elf32_h8_get_relocated_section_contents): Likewise.
836         * elf32-hppa.c (get_local_syms): Likewise.
837         * elf32-m68k.c (bfd_m68k_elf32_create_embedded_relocs): Likewise.
838         * elf32-mips.c (bfd_mips_elf32_create_embedded_relocs): Likewise.
839         * elf32-sh.c (sh_elf_relax_section): Likewise.
840         (sh_elf_relax_delete_bytes): Likewise.
841         (sh_elf_get_relocated_section_contents): Likewise.
842         * elf32-xstormy16.c (xstormy16_elf_relax_section): Likewise.
843         * elf64-alpha.c (elf64_alpha_relax_section): Likewise.
844         * elf64-hppa.c (elf64_hppa_check_relocs): Likewise.
845         * elf64-mmix.c (mmix_elf_relax_section): Likewise.
846         * elf64-ppc.c (get_local_syms): Likewise.
847         * elf64-sh64.c (sh_elf64_get_relocated_section_contents): Likewise.
848         * elfxx-ia64.c (elfNN_ia64_relax_section): Likewise.
849         * elfcode.h (NAME(_bfd_elf,size_info)): Update initialiser.
850         * elf64-alpha.c (alpha_elf_size_info): Likewise.
851         * elf64-hppa.c (hppa64_elf_size_info): Likewise.
852         * elf64-mips.c (mips_elf64_size_info): Likewise.
853         * elf64-s390.c (s390_elf64_size_info): Likewise.
854         * elf64-sparc.c (sparc64_elf_size_info): Likewise.
855
856 2002-06-05  Maciej W. Rozycki  <macro@ds2.pg.gda.pl>
857
858         * elf32-mips.c (elf32_mips_ignore_discarded_relocs): Move to...
859         elfxx-mips.c (_bfd_mips_elf_ignore_discarded_relocs): ... here.
860         elf64-mips.c (elf_backend_ignore_discarded_relocs): Use
861         _bfd_mips_elf_ignore_discarded_relocs.
862         elfxx-mips.h (_bfd_mips_elf_ignore_discarded_relocs): Declare.
863
864 2002-06-05  H.J. Lu <hjl@gnu.org>
865
866         * elfxx-mips.c (mips_elf_calculate_relocation): Call
867         _bfd_elf_rel_local_sym for STT_SECTION relocations against
868         the SEC_MERGE section.
869
870 2002-06-05  Alan Modra  <amodra@bigpond.net.au>
871
872         * coff-alpha.c: Update copyright date.
873         * coff-mips.c: Likewise.
874         * xcoff-target.h: Likewise.
875
876         * bfd-in.h: Remove "taken from the source" comment.
877         * libbfd-in.h: Likewise.
878         * libcoff-in.h: Likewise.
879         * bfd-in2.h: Regenerate.
880         * libbfd.h: Regenerate.
881         * libcoff.h: Regenerate.
882
883         * elf.c (bfd_elf_discard_group): Return true.
884         * elf-bfd.h (bfd_elf_discard_group): Declare.
885         * bfd-in.h (bfd_elf_discard_group): Don't declare here.
886         * section.c (bfd_discard_group): Rename to bfd_generic_discard_group.
887         * bfd.c (bfd_discard_group): Define.
888         * targets.c (struct bfd_target): Add _bfd_discard_group.
889         (BFD_JUMP_TABLE_LINK): Here too.
890         * libbfd-in.h (_bfd_nolink_bfd_discard_group): Define.
891         * aout-adobe.c (aout_32_bfd_discard_group): Define.
892         * aout-target.h (MY_bfd_discard_group): Define.
893         * aout-tic30.c (MY_bfd_discard_group): Define.
894         * binary.c (binary_bfd_discard_group): Define.
895         * bout.c (b_out_bfd_discard_group): Define.
896         * coff-alpha.c (_bfd_ecoff_bfd_discard_group): Define.
897         * coffcode.h (coff_bfd_discard_group): Define.
898         * coff-mips.c (_bfd_ecoff_bfd_discard_group): Define.
899         * elfxx-target.h (bfd_elfNN_bfd_discard_group): Define.
900         * i386msdos.c (msdos_bfd_discard_group): Define.
901         * i386os9k.c (os9k_bfd_discard_group): Define.
902         * ieee.c (ieee_bfd_discard_group): Define.
903         * ihex.c (ihex_bfd_discard_group): Define.
904         * mmo.c (mmo_bfd_discard_group): Define.
905         * nlm-target.h (nlm_bfd_discard_group): Define.
906         * oasys.c (oasys_bfd_discard_group): Define.
907         * ppcboot.c (ppcboot_bfd_discard_group): Define.
908         * som.c (som_bfd_discard_group): Define.
909         * srec.c (srec_bfd_discard_group): Define.
910         * tekhex.c (tekhex_bfd_discard_group): Define.
911         * versados.c (versados_bfd_discard_group): Define.
912         * vms.c (vms_bfd_discard_group): Define.
913         * xcoff-target.h (_bfd_xcoff_bfd_discard_group): Define.
914         * coff64-rs6000.c (rs6000coff64_vec): Update initialiser.
915         (aix5coff64_vec): Likewise.
916         * coff-rs6000.c (rs6000coff_vec, pmac_xcoff_vec): Likewise.
917
918 2002-06-04  Jason Thorpe  <thorpej@wasabisystems.com>
919
920         * Makefile.am (BFD32_BACKENDS): Add elf32-sh64-com.lo.
921         (BFD32_BACKENDS_CFILES): Add elf32-sh64-com.c.
922         (elf32-sh64-com.lo): New dependency list.
923         * Makefile.in: Regenerate.
924         * configure.in (bfd_elf32_sh64_vec, bfd_elf32_sh64l_vec)
925         (bfd_elf32_sh64nbsd_vec, bfd_elf32_sh64lnbsd_vec): Add
926         elf32-sh64-com.lo.
927         * configure: Regenerate.
928         * elf32-sh64.c (sh64_address_in_cranges)
929         (sh64_get_contents_type, sh64_address_is_shmedia): Move to...
930         (crange_qsort_cmpb, crange_qsort_cmpl, crange_bsearch_cmpb):
931         (crange_bsearch_cmpl): Prepend _bfd_sh64_ to name and move to...
932         * elf32-sh64-com.c: ...here.  New file.
933
934 2002-06-04  Alan Modra  <amodra@bigpond.net.au>
935
936         * elf32-openrisc.c (openrisc_elf_gc_mark_hook): Remove
937         ATTRIBUTE_UNUSED on used params.
938         * elf32-vax.c (elf_vax_gc_mark_hook): Remove unnecessary checks
939         before calling bfd_section_from_elf_index on local syms.
940         * elf64-sh64.c (sh_elf64_gc_mark_hook): Likewise.
941
942 2002-06-04  Jason Thorpe  <thorpej@wasabisystems.com>
943
944         * Makefile.am (BFD32_BACKENDS): Add elf32-sh64-nbsd.lo.
945         (BFD32_BACKENDS_CFILES): Add elf32-sh64-nbsd.c.
946         (BFD64_BACKENDS): Add elf64-sh64-nbsd.lo.
947         (BFD64_BACKENDS_CFILES): Add elf64-sh64-nbsd.c.
948         (elf32-sh64-nbsd.lo, elf64-sh64-nbsd.lo): New rules.
949         * Makefile.in: Regenerate.
950         * config.bfd (sh5le-*-netbsd*, sh5-*-netbsd*, sh64le-*-netbsd*)
951         (sh64-*-netbsd*): New targets.
952         * configure.in: Add bfd_elf32_sh64nbsd_vec, bfd_elf32_sh64lnbsd_vec,
953         bfd_elf64_sh64nbsd_vec, and bfd_elf64_sh64lnbsd_vec.
954         * configure: Regenerate.
955         * elf32-sh64-nbsd.c: New file.
956         * elf64-sh64-nbsd.c: New file.
957         * targets.c: Add extern decls for bfd_elf32_sh64nbsd_vec,
958         bfd_elf32_sh64lnbsd_vec, bfd_elf64_sh64nbsd_vec, and
959         bfd_elf64_sh64lnbsd_vec.
960
961 2002-06-04  Alan Modra  <amodra@bigpond.net.au>
962
963         * elf.c (setup_group): Set SEC_LINK_ONCE on GRP_COMDAT groups.
964         (bfd_section_from_shdr): Likewise.  Set section name of group
965         sections from signature.
966         (group_signature): Split out from setup_group.  Ensure symbol table
967         is available.
968         (bfd_elf_discard_group): New function.
969         (_bfd_elf_make_section_from_shdr): Don't set SEC_LINK_ONCE on
970         .gnu.linkonce* sections if they are members of a group.
971         (set_group_contents): Set GRP_COMDAT flag.
972         * section.c (bfd_discard_group): New function.
973         * bfd-in.h (bfd_elf_discard_group): Declare.
974         * bfd-in2.h: Regenerate.
975         * elf-bfd.h (struct bfd_elf_section_data): Add linkonce_p field.
976         (elf_linkonce_p): Define.
977
978 2002-06-04  Alan Modra  <amodra@bigpond.net.au>
979
980         * elf.c (bfd_section_from_shdr): Make "name" const.
981         * elf-bfd.h (elf_backend_section_from_shdr): Likewise.
982         * elf32-i370.c (i370_elf_section_from_shdr): Likewise.
983         * elf32-ppc.c (ppc_elf_section_from_shdr): Likewise.
984         * elf32-sh64.c (sh64_backend_section_from_shdr): Likewise.
985         * elf32-v850.c (v850_elf_section_from_shdr): Likewise.
986         * elf64-alpha.c (elf64_alpha_section_from_shdr): Likewise.
987         * elf64-hppa.c (elf64_hppa_section_from_shdr): Likewise.
988         * elf64-ppc.c (ppc64_elf_section_from_shdr): Likewise.
989         * elfxx-ia64.c (elfNN_ia64_section_from_shdr): Likewise.
990         * elfxx-mips.c (_bfd_mips_elf_section_from_shdr): Likewise.
991         * elfxx-mips.h (_bfd_mips_elf_section_from_shdr): Likewise.
992
993 2002-06-03  Maciej W. Rozycki  <macro@ds2.pg.gda.pl>
994
995         * elfxx-mips.c (ABI_64_P): Use backend's data to determine the
996         ABI.
997
998 2002-06-02  Kazu Hirata  <kazu@cs.umass.edu>
999
1000         * elf32-arc.c: Fix formatting.
1001         * elf32-arm.h: Likewise.
1002         * elf32-cris.c: Likewise.
1003         * elf32-dlx.c: Likewise.
1004         * elf32-hppa.c: Likewise.
1005         * elf32-i386.c: Likewise.
1006         * elf32-i386qnx.c: Likewise.
1007         * elf32-or32.c: Likewise.
1008         * elf32-s390.c: Likewise.
1009         * elf32-sh64.c: Likewise.
1010         * elf32-vax.c: Likewise.
1011         * elf32-xstormy16.c: Likewise.
1012         * elf64-alpha.c: Likewise.
1013         * elf64-mmix.c: Likewise.
1014         * elf64-ppc.c: Likewise.
1015         * elf64-s390.c: Likewise.
1016         * elf64-sh64.c: Likewise.
1017         * elf64-x86-64.c: Likewise.
1018
1019 2002-06-02  Richard Henderson  <rth@redhat.com>
1020
1021         * elf64-alpha.c (elf64_alpha_relocate_section): Don't dereference
1022         null when there are no got entries for a symbol.
1023         (elf64_alpha_relax_find_tls_segment): Rearrange to avoid
1024         uninitialized variable warning.
1025
1026 2002-06-01  Richard Henderson  <rth@redhat.com>
1027
1028         * elf64-alpha.c (elf64_alpha_relax_with_lituse): Don't test for
1029         undefined symbols here.
1030         (elf64_alpha_relax_section): Do it here.  Also test for not
1031         defined in the current module.
1032         (elf64_alpha_relocate_section_r): Split out of ...
1033         (elf64_alpha_relocate_section): ... here.  Don't dereference
1034         NULL when looking up local got entries.
1035
1036 2002-06-01  Richard Henderson  <rth@redhat.com>
1037
1038         * elf64-alpha.c (elf64_alpha_relax_with_lituse): Reject undefined
1039         symbols from JSR relaxation.
1040         (elf64_alpha_size_plt_section_1): New.
1041         (elf64_alpha_calc_dynrel_sizes): Split out .rela.got bits ...
1042         (elf64_alpha_size_rela_got_1): ... here.
1043         (elf64_alpha_size_dynamic_sections): Split out .rela.got bits ...
1044         (elf64_alpha_size_rela_got_section): ... here.
1045         (elf64_alpha_size_plt_section): New.
1046         (elf64_alpha_relax_section): Call them.
1047         (elf64_alpha_size_got_sections): Remove output_bfd arg.
1048         (elf64_alpha_finish_dynamic_symbol): Check gotent use_count.
1049
1050 2002-06-01  Richard Henderson  <rth@redhat.com>
1051
1052         * elf64-alpha.c (alpha_get_dtprel_base, alpha_get_tprel_base): New.
1053         (elf64_alpha_relocate_section): Use them.  Reject LE TLS relocs
1054         in shared libraries.  Fix DTPRELHI and TPRELHI value.
1055         (INSN_ADDQ, INSN_RDUNIQ): New.
1056         (struct alpha_relax_info): Add symtab_hdr, tls_segment, first_gotent.
1057         (elf64_alpha_relax_with_lituse): Return boolean.  Remove irelend
1058         argument.  Reject dynamic symbols.  Use LITUSE symbolic constants.
1059         (elf64_alpha_relax_got_load): Rename from relax_without_lituse.
1060         Handle GOTDTPREL and GOTTPREL relocations.
1061         (elf64_alpha_relax_gprelhilo): New.
1062         (elf64_alpha_relax_tls_get_addr): New.
1063         (elf64_alpha_relax_find_tls_segment): New.
1064         (elf64_alpha_relax_section): Handle TLS relocations.
1065         (ALPHA_ELF_LINK_HASH_TLS_IE): New.
1066         (elf64_alpha_check_relocs): Set it.
1067
1068 2002-06-01  Richard Henderson  <rth@redhat.com>
1069
1070         * elf64-alpha.c (elf64_alpha_relax_section): Don't store computed gp.
1071
1072         * elf64-alpha.c (elf64_alpha_check_relocs): Fix typo on maybe_dynamic
1073         check; don't suppress dynamic relocs for non-allocated sections.
1074
1075         * elf64-alpha.c: Remove dead code.
1076
1077 2002-05-31  Alan Modra  <amodra@bigpond.net.au>
1078
1079         * bfd-in2.h: Regenerate.
1080         * libbfd.h: Regenerate.
1081         * po/SRC-POTFILES.in: Regenerate.
1082
1083         * elf64-ppc.c (ppc64_elf_size_dynamic_sections): Don't allocate
1084         space for bss .plt.
1085
1086 2002-05-31  Graeme Peterson  <gp@qnx.com>
1087
1088         * Makefile.am (BFD32_BACKENDS): Add elf32-i386qnx.lo.
1089         (BFD32_BACKENDS_CFILES): Add elf32-i386qnx.c.
1090         Run "make dep-am".
1091         * Makefile.in: Regenerate.
1092         * config.bfd: Add i[3456]86-*-nto-qnx* support.
1093         * configure.in: Add bfd_elf32_i386qnx_vec support.
1094         * configure: Regenerate.
1095         * elf-bfd.h (struct elf_backend_data): Add set_nonloadable_filepos,
1096         is_contained_by_filepos, and copy_private_bfd_data_p.
1097         * elf.c (assign_file_positions_for_segments): Call backend
1098         set_nonloadable_filepos.  Fix non-K&R call to _bfd_error_handler.
1099         (IS_CONTAINED_BY_FILEPOS): Define.
1100         (INCLUDE_SECTION_IN_SEGMENT): Also test IS_CONTAINED_BY_FILEPOS.
1101         (copy_private_bfd_data): Use IS_CONTAINED_BY_FILEPOS.  Typo fix.
1102         Fix non-K&R call to _bfd_error_handler.
1103         (_bfd_elf_copy_private_section_data): Use backend
1104         copy_private_bfd_data_p.
1105         * elf32-i386.c: Don't include elfxx-target.h when
1106         ELF32_I386_C_INCLUDED is defined.
1107         * elf32-i386qnx.c: New QNX elf backend file.
1108         * elfxx-target.h: Add elf_backend_set_nonloadable_filepos,
1109         elf_backend_is_contained_by_filepos, and
1110         elf_backend_do_copy_private_bfd_data.
1111         * targets.c: Add bfd_target bfd_elf32_i386qnx_vec.
1112
1113 2002-05-31  Alan Modra  <amodra@bigpond.net.au>
1114
1115         * elfarm-oabi.c (bfd_elf32_arm_add_glue_sections_to_bfd): Define.
1116         Move other similar defines to start of file.
1117
1118 2002-05-30  Tom Rix  <trix@redhat.com>
1119
1120         * coff-rs6000.c (xcoff_rtype2howto): Handle 16 bit R_RBA.
1121         * coff64-rs6000.c (xcoff64_rtype2howto): Same.
1122
1123 2002-05-30  Richard Henderson  <rth@redhat.com>
1124
1125         * elf64-alpha.c (ALPHA_ELF_LINK_HASH_LU_TLSGD,
1126         ALPHA_ELF_LINK_HASH_LU_TLSLDM, ALPHA_ELF_LINK_HASH_LU_FUNC): New.
1127         (ALPHA_ELF_GOT_ENTRY_RELOCS_DONE): Remove.
1128         (ALPHA_ELF_GOT_ENTRY_RELOCS_XLATED): Remove.
1129         (struct alpha_elf_got_entry): Add reloc_type, reloc_done, reloc_xlated.
1130         (struct alpha_elf_obj_tdata): Rename total_got_entries and
1131         n_local_got_entries to total_got_size and local_got_size.
1132         (elf64_alpha_howto, elf64_alpha_reloc_map): Update for TLS relocs.
1133         (alpha_got_entry_size): New.
1134         (elf64_alpha_relax_with_lituse): Use it.
1135         (elf64_alpha_relax_without_lituse): Likewise.
1136         (MAX_GOT_SIZE): Rename from MAX_GOT_ENTRIES.
1137         (get_got_entry): New.
1138         (elf64_alpha_check_relocs): Handle TLS relocs.  Reorganize.
1139         (elf64_alpha_adjust_dynamic_symbol): Test LU_FUNC as a mask.
1140         (elf64_alpha_merge_ind_symbols): Check gotent->reloc_type.
1141         (elf64_alpha_can_merge_gots, elf64_alpha_merge_gots): Likewise.
1142         (elf64_alpha_calc_got_offsets_for_symbol): Use alpha_got_entry_size.
1143         (elf64_alpha_calc_got_offsets): Likewise.
1144         (alpha_dynamic_entries_for_reloc): New.
1145         (elf64_alpha_calc_dynrel_sizes): Use it.
1146         (elf64_alpha_size_dynamic_sections): Likewise.
1147         (elf64_alpha_relocate_section): Handle TLS relocations.
1148         * reloc.c: Add Alpha TLS relocations.
1149         * bfd-in2.h, libbfd.h: Rebuild.
1150
1151 2002-05-29 Ralf Habacker <ralf.habacker@freenet.de>
1152
1153         * peXXigen.c (pe_print_idata): Remove double printed
1154         import table lines; add Bound-To comment.
1155
1156 2002-05-29  Matt Thomas  <matt@3am-software.com>
1157
1158         * Makefile.am (BFD32_BACKENDS): Add elf32-vax.lo.
1159         (BFD32_BACKENDS_CFILES): Add elf32-vax.c.
1160         (elf32-vax.lo): New rule.
1161         * Makefile.in: Regenerate.
1162         * configure.in (bfd_elf32_vax_vec)
1163         (vaxnetbsd_vec): New vectors.
1164         * configure: Regenerate.
1165         * config.bfd (vax-*-netbsdelf*)
1166         (vax-*-netbsdaout*)
1167         (vax-*-netbsd*): New targets.
1168         * elf32-vax.c: New file.
1169         * reloc.c: Add VAX relocations.
1170         * bfd-in2.h: Regenerate.
1171         * targets.c (_bfd_target_vector): Add bfd_elf32_vax_vec.
1172
1173 2002-05-29  Jason Thorpe  <thorpej@wasabisystems.com>
1174
1175         * config.bfd (arm-*-netbsd*): Add bfd_elf32_littlearm_vec
1176         and bfd_elf32_bigarm_vec to targ_selvecs.
1177
1178 2002-05-29  Ralf Habacker  <ralf.habacker@freenet.de>
1179
1180         * peXXigen.c (pe_print_idata): Fix seg faults on printing import tables
1181         with auto-imported symbols.
1182
1183 2002-05-29  Adam Nemet  <anemet@lnxw.com>
1184
1185         * elf32-arm.h (bfd_elf32_arm_get_bfd_for_interworking): Don't add glue
1186         sections only record bfd.
1187         (bfd_elf32_arm_add_glue_sections_to_bfd): New function.
1188         * bfd-in.h (bfd_elf32_arm_add_glue_sections_to_bfd): Declare it.
1189         * bfd-in2.h: Regenerate.
1190
1191 2002-05-28  Nick Clifton  <nickc@cambridge.redhat.com>
1192
1193         * syms.c (_bfd_stab_section_find_nearest_line): Move
1194         declaration and initialisation of saw_line and saw_func out of
1195         for loop.
1196
1197 2002-05-29  Alan Modra  <amodra@bigpond.net.au>
1198
1199         * elf64-ppc.c (ppc64_elf_get_symbol_info): New function.
1200         (bfd_elf64_get_symbol_info): Define.
1201         * elfxx-target.h (bfd_elfNN_get_symbol_info): Only define if undef.
1202
1203 2002-05-29  Andrey Volkov  <avolkov@transas.com>
1204
1205         * cpu-h8300.c: Make default h8300 machine first in machine list.
1206
1207 2002-05-28  Kuang Hwa Lin <kuang@sbcglobal.net>
1208
1209         * config.bfd: Added DLX configuraton.
1210         * Makefile.am: Added DLX configuraton.
1211         * configure.in: Added DLX configuraton.
1212         * archures.c: Add DLX architecure.
1213         * reloc.c: Add DLX relocs.
1214         * targets.c: Added DLX target vector.
1215         * configure: Regenerate.
1216         * Makefile.in: Regenreate.
1217         * bfd-in2.h: Regenreate.
1218         * elf32-dlx.c: New file: Support DLX target.
1219         * cpu-dlx.c: New file: Support DLX target.
1220
1221 2002-05-25  Alan Modra  <amodra@bigpond.net.au>
1222
1223         * elf32-m68k.c (elf32_m68k_print_private_bfd_data): Formatting.
1224
1225         * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Revert last change.
1226         (ppc64_elf_check_relocs): Don't set up function descriptor symbol
1227         strings to point inside function code sym string.
1228         (func_desc_adjust): Likewise.
1229         (ppc64_elf_hide_symbol): Rewrite code to look up function code sym.
1230
1231 2002-05-24  Michal Ludvig  <mludvig@suse.cz>
1232
1233         * elf64-x86-64.c (elf64_x86_64_grok_prstatus): Added.
1234         (elf64_x86_64_grok_psinfo): Added.
1235
1236 2002-05-24  TAMURA Kent <kent@netbsd.org>
1237
1238         * config.bfd: Add a target for i386-netbsdpe.
1239
1240 2002-05-24  Alan Modra  <amodra@bigpond.net.au>
1241
1242         * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Don't copy is_func
1243         and is_func_descriptor.
1244         (func_desc_adjust): Hide function code sym in shared libs unless
1245         there is a matching exported function descriptor sym.
1246
1247 2002-05-23  Jakub Jelinek  <jakub@redhat.com>
1248
1249         * elf.c (_bfd_elf_make_section_from_shdr): Set SEC_THREAD_LOCAL
1250         for symbols from SHF_TLS section.
1251         (_bfd_elf_print_private_bfd_data): Add PT_TLS.
1252         (elf_fake_sections): Set SHF_TLS for SEC_THREAD_LOCAL sections.
1253         (map_sections_to_segments): Build PT_TLS segment if necessary.
1254         (assign_file_positions_for_segments): Likewise.
1255         (get_program_header_size): Account for PT_TLS segment.
1256         (swap_out_syms): Set type of BSF_THREAD_LOCAL symbols and symbols from
1257         SEC_THREAD_LOCAL sections to STT_TLS.
1258         * reloc.c: Add 386 and IA-64 TLS relocs.
1259         * section.c (SEC_THREAD_LOCAL): Define.
1260         (SEC_CONSTRUCTOR_TEXT, SEC_CONSTRUCTOR_DATA, SEC_CONSTRUCTOR_BSS):
1261         Remove.
1262         * elflink.h (elf_link_add_object_symbols): Support .tcommon.
1263         (size_dynamic_sections): If DF_STATIC_TLS, set DF_FLAGS
1264         unconditionally.
1265         (struct elf_final_link_info): Add first_tls_sec.
1266         (elf_bfd_final_link): Set first_tls_sec.
1267         Compute elf_hash_table (info)->tls_segment.
1268         (elf_link_output_extsym): Handle STT_TLS symbols.
1269         (elf_link_input_bfd): Likewise.
1270         * syms.c (BSF_THREAD_LOCAL): Define.
1271         * bfd-in2.h: Rebuilt.
1272         * libbfd.h: Rebuilt.
1273         * elf32-i386.c (elf_i386_tls_transition, dtpoff_base, tpoff,
1274         elf_i386_mkobject, elf_i386_object_p): New functions.
1275         (elf_howto_table): Add TLS relocs.
1276         (elf_i386_reloc_type_lookup): Support TLS relocs.
1277         (elf_i386_info_to_howto_rel): Likewise.
1278         (struct elf_i386_link_hash_entry): Add tls_type.
1279         (struct elf_i386_obj_tdata): New.
1280         (elf_i386_hash_entry, elf_i386_tdata, elf_i386_local_got_tls_type):
1281         New macros.
1282         (struct elf_i386_link_hash_table): Add tls_ldm_got.
1283         (link_hash_newfunc): Clear tls_type.
1284         (elf_i386_check_relocs): Support TLS relocs.
1285         (elf_i386_gc_sweep_hook): Likewise.
1286         (allocate_dynrelocs): Likewise.
1287         (elf_i386_size_dynamic_sections): Likewise.
1288         (elf_i386_relocate_section): Likewise.
1289         (elf_i386_finish_dynamic_symbol): Likewise.
1290         (bfd_elf32_mkobject, elf_backend_object_p): Define.
1291         * elfxx-ia64.c (struct elfNN_ia64_dyn_sym_info): Add tprel_offset,
1292         dtpmod_offset, dtprel_offset, tprel_done, dtpmod_done, dtprel_done,
1293         want_tprel, want_dtpmod, want_dtprel.
1294         (elfNN_ia64_tprel_base, elfNN_ia64_dtprel_base): New functions.
1295         (ia64_howto_table): Add TLS relocs, rename R_IA64_LTOFF_TP22 to
1296         R_IA64_LTOFF_TPREL22.
1297         (elf_code_to_howto_index): Add TLS relocs.
1298         (elfNN_ia64_check_relocs): Support TLS relocs.
1299         (allocate_global_data_got): Account for TLS .got data.
1300         (allocate_dynrel_entries): Account for TLS dynamic relocations.
1301         (elfNN_ia64_install_value): Supprt TLS relocs.
1302         (set_got_entry): Support TLS relocs.
1303         (elfNN_ia64_relocate_section): Likewise.
1304
1305 2002-05-23  Nick Clifton  <nickc@cambridge.redhat.com>
1306
1307         * elf32-arm.h (elf32_arm_final_link_relocate): For the Thumb
1308         BLX reloc round the relocation up rather than down.
1309         * coff-arm.c (coff_arm_relocate_section): Likewise.
1310
1311 2002-05-21  H.J. Lu  (hjl@gnu.org)
1312
1313         * linker.c (_bfd_generic_link_add_one_symbol): Allow multiple
1314         definition.
1315
1316 2002-05-22  Alan Modra  <amodra@bigpond.net.au>
1317
1318         * elf64-ppc.c (ppc64_elf_size_stubs): Don't strip .branch_lt.
1319         (ppc64_elf_relocate_section): Handle unresolved relocs in opd.
1320
1321 2002-05-22  Alan Modra  <amodra@bigpond.net.au>
1322
1323         * elf64-ppc.c (ppc64_elf_relocate_section): Return false for
1324         unresolved relocs.
1325         (ppc64_elf_size_dynamic_sections): Check for splt NULL.
1326
1327 2002-05-21  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
1328
1329         * bfd/bfd.c (bfd_get_arch_size): Remove bfd_set_error call for
1330         non-ELF targets.
1331
1332 2002-05-21  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
1333
1334         * elf-bfd.h (elf_backend_emit_relocs): Change prototype to return
1335         an error value.
1336         * elflink.h (elf_link_output_relocs): Likewise. Improve error message.
1337         return with false on error.
1338         (elf_link_input_bfd): Check reloc_emitter return value.
1339
1340 2002-05-21  Jason Thorpe  <thorpej@wasabisystems.com>
1341
1342         * config.bfd (armeb-*-netbsdelf*): New target.
1343
1344 2002-05-20  Alan Modra  <amodra@bigpond.net.au>
1345
1346         * elf64-ppc.c (ppc_build_one_stub): Point undefined function syms
1347         at the plt call stub.
1348
1349 2002-05-19  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
1350
1351         * cpu-mips.c (mips_compatible): Don't try to check machine
1352         compatibility.
1353
1354 2002-05-18  Tom Rix  <trix@redhat.com>
1355
1356         * coff64-rs6000.c (_bfd_xcoff64_swap_aux_out):  Fix C_FILE auxent.
1357
1358 2002-05-17  Alan Modra  <amodra@bigpond.net.au>
1359
1360         * elf64-ppc.c (ppc64_elf_info_to_howto): Formatting.
1361         (ppc64_elf_relocate_section): Don't warn about reloc overflow when
1362         we've already warned about an undefined symbol.  Report more
1363         detail on reloc errors.
1364
1365 2002-05-17  Alan Modra  <amodra@bigpond.net.au>
1366
1367         * acinclude.m4 (AM_INSTALL_LIBBFD): New.
1368         * configure.in: Invoke AM_INSTALL_LIBBFD.
1369         * Makefile.am (install-data-local): Revert 2002-05-13.  Move to..
1370         (install_libbfd): .. New target.
1371         (uninstall_libbfd): Likewise.
1372         (install-bfdlibLTLIBRARIES): Likewise.
1373         (uninstall-bfdlibLTLIBRARIES): Likewise.
1374         (bfdlibdir): New.
1375         (bfdincludedir): New.
1376         (lib_LTLIBRARIES): Rename to bfdlib_LTLIBRARIES.
1377         * aclocal.m4: Regenerate.
1378         * configure: Regenerate.
1379         * Makefile.in: Regenerate.
1380
1381 2002-05-17  Stuart Balfour <sbalfour@cisco.com>
1382
1383         * hash.c (bfd_hash_lookup): Remove computation of len from inside
1384         hash loop.
1385
1386 2002-05-16  Nick Clifton  <nickc@cambridge.redhat.com>
1387
1388         * config.bfd: Add targets for sh64-linux (little endian and
1389         big endian).
1390
1391 2002-05-15  Laurent Pinchart <laurent.pinchart@skynet.be>
1392
1393         * peXXigen.c (pe_print_idata): Do not assume that the first thunk
1394         is located in the same section as the import table.  Instead
1395         check, and if necessary load the section containing the thunk.
1396
1397 2002-05-15  Nick Clifton  <nickc@cambridge.redhat.com>
1398
1399         * aix5ppc-core.c (xcoff64_core_p): Replace bfd_read with
1400         bfd_bread.
1401         (xcoff64_core_file_matches_executable_p): Replace bfd_read
1402         with bfd_bread.
1403
1404 2002-05-15  Alan Modra  <amodra@bigpond.net.au>
1405
1406         * aix5ppc-core.c: Warning fixes.
1407         * aout-adobe.c (aout_32_bfd_link_just_syms): Define.
1408         * aout-target.h (MY_bfd_link_just_syms): Define.
1409         * aout-tic30.c (MY_bfd_link_just_syms): Define.
1410         * bfd.c (bfd_link_just_syms): Define.
1411         * binary.c (binary_bfd_link_just_syms): Define.
1412         * bout.c (b_out_bfd_link_just_syms): Define.
1413         * coff-rs6000.c (rs6000coff_vec, pmac_xcoff_vec): Update initializer.
1414         * coff64-rs6000.c (rs6000coff64_vec, aix5coff64_vec): Likewise.
1415         * coffcode.h (coff_bfd_link_just_syms): Define.
1416         * elf-bfd.h (enum elf_link_info_type): Add ELF_INFO_TYPE_JUST_SYMS.
1417         (elf_discarded_section): Check for ELF_INFO_TYPE_JUST_SYMS.
1418         (_bfd_elf_link_just_syms): Declare.
1419         * elf.c (_bfd_elf_link_just_syms): New function.
1420         * elf-eh-frame.c (_bfd_elf_maybe_strip_eh_frame_hdr): Check that
1421         sections haven't already been discarded by the linker.
1422         * elflink.h (elf_link_add_object_symbols): Likewise for stab
1423         sections and SEC_MERGE sections.
1424         (elf_bfd_discard_info): Similarly here.
1425         * elfxx-target.h (bfd_elfNN_bfd_link_just_syms): Define.
1426         * i386msdos.c (msdos_bfd_link_just_syms): Define.
1427         * i386os9k.c (os9k_bfd_link_just_syms): Define.
1428         * ieee.c (ieee_bfd_link_just_syms): Define.
1429         * ihex.c (ihex_bfd_link_just_syms): Define.
1430         * libbfd-in.h (_bfd_nolink_bfd_link_just_syms): Define.
1431         (_bfd_generic_link_just_syms): Declare.
1432         * libecoff.h (_bfd_ecoff_bfd_link_just_syms): Define.
1433         * linker.c (_bfd_generic_link_just_syms): New function.
1434         * mmo.c (mmo_bfd_link_just_syms): Define.
1435         * nlm-target.h (nlm_bfd_link_just_syms): Define.
1436         * oasys.c (oasys_bfd_link_just_syms): Define.
1437         * ppcboot.c (ppcboot_bfd_link_just_syms): Define.
1438         * som.c (som_bfd_link_just_syms): Define.
1439         * srec.c (srec_bfd_link_just_syms): Define.
1440         * targets.c (struct bfd_target): Add _bfd_link_just_syms.
1441         (BFD_JUMP_TABLE_LINK): And here.
1442         * tekhex.c (tekhex_bfd_link_just_syms): Define.
1443         * versados.c (versados_bfd_link_just_syms): Define.
1444         * vms.c (vms_bfd_link_just_syms): Define.
1445         * libbfd.h: Regenerate.
1446         * bfd-in2.h: Regenerate.
1447
1448 2002-05-15  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
1449
1450         * elf32-mips.c: Remove superfluous definitions copied from
1451         elfxx-mips.c.
1452         (bfd_elf32_bigmips_vec,bfd_elf32_littlemips_vec): Use the
1453         SGIish vectors to check the special case.
1454         (mips_elf_hi16_reloc): Fix comment.
1455         (mips_elf_got16_reloc): Likewise.
1456         (_bfd_mips_elf32_gprel16_reloc): Likewise.
1457         (elf_reloc_map): Code cleanup.
1458         (mips_reloc_map): Add comment.
1459         (bfd_elf23_bfd_reloc_type_lookup): Code cleanup.
1460         (mips_elf32_rtype_to_howto): Likewise.
1461         (mips_elf32_discard_info): Likewise.
1462         (elf32_mips_irix_compat): Invert logic: Only SGIish vectors
1463         lead to IRIX compatibility now.
1464
1465 2002-05-15  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
1466
1467         * elfxx-mips.c: Call it IRIX, not Irix in comments.
1468
1469 2002-05-13  Jason Thorpe  <thorpej@wasabisystems.com>
1470
1471         * config.bfd (shle-*-netbsdelf*): Add target which includes
1472         sh64 support.
1473
1474 2002-05-13  David Edelsohn  <edelsohn@gnu.org>
1475
1476         * configure.in: Revert 2002-04-07.  Instead, auto-configure
1477         HAVE_ST_C_IMPL.
1478         * configure: Regenerate.
1479         * config.in: Regenerate.
1480         * rs6000-core.c (CNEW_IMPL): Guard use of c_impl with HAVE_ST_C_IMPL
1481         or AIX_5_CORE.
1482
1483 2002-05-11  Federico G. Schwindt <fgsch@olimpo.com.br>
1484
1485         * configure.in (sparc*-*-openbsd*): Support sparc64-openbsd
1486         corefiles as well.2
1487         * configure: Regenerate.
1488
1489 2002-05-13  Alan Modra  <amodra@bigpond.net.au>
1490
1491         * Makefile.am (install-data-local): Install headers to
1492         $(exec_prefix)/include.
1493         * Makefile.in: Regenerate.
1494
1495 2002-05-11  Ralf Corsepius  <corsepiu@faw.uni-ulm.de>
1496             Daniel Jacobowitz  <drow@mvista.com>
1497
1498         * coff-sh.c (sh_reloc_map): Map to R_SH_IMM32 for non-PE.  Don't
1499         map BFD_RELOC_RVA.
1500
1501 2002-05-11  Federico G. Schwindt <fgsch@olimpo.com.br>
1502
1503         * config.bfd (alpha*-*-openbsd*, sparc64*-*-openbsd*,
1504         hppa*-*-openbsd*): New targets.
1505         * configure.in (alpha*-*-openbsd*): Set COREFILE.
1506         * configure: Regenerate.
1507
1508 2002-05-10  Tom Rix  <trix@redhat.com>
1509
1510         * coff64-rs6000.c (xcoff64_reloc_type_br): New function for
1511         xcoff64_ppc_relocate_section.
1512         * coff-rs6000.c : Extern common xcoff_reloc_type functions.
1513         * libxcoff.h: Common xcoff_reloc_type function declaration.
1514
1515 2002-05-10  Alan Modra  <amodra@bigpond.net.au>
1516
1517         * elf32-i386.c (elf_i386_relocate_section): Remove overflow checks
1518         added in 2002-05-09 commit.
1519
1520         * elf32-hppa.c (elf32_hppa_size_stubs): Revert part of 2002-05-04,
1521         don't look for stubs on all undefined syms.
1522
1523 2002-05-09  Alan Modra  <amodra@bigpond.net.au>
1524
1525         * elf64-ppc.c (RA_REGISTER_MASK, RA_REGISTER_SHIFT): Delete.
1526         (ppc64_elf_howto_raw <R_PPC64_RELATIVE>): Not pc_relative or
1527         pcrel_offset.
1528
1529         * elf32-i386.c (elf_howto_table): Comments.
1530         (elf_i386_relocate_section): Handle more relocs for relocatable
1531         linking and against SEC_MERGE sections.
1532
1533 2002-05-08  Alan Modra  <amodra@bigpond.net.au>
1534
1535         * elf32-ppc.c (ppc_elf_create_got): New function.
1536         (ppc_elf_create_dynamic_sections): Call ppc_elf_create_got before
1537         _bfd_elf_create_dynamic_sections.  Correct .plt flags.
1538         (ppc_elf_check_relocs): Use ppc_elf_create_got in place of
1539         _bfd_elf_create_got_section.
1540
1541 2002-05-07  Alan Modra  <amodra@bigpond.net.au>
1542
1543         * elf-bfd.h (struct elf_backend_data): Add rela_normal.
1544         * elfxx-target.h (elf_backend_rela_normal): Define.
1545         (elfNN_bed): Init rela_normal.
1546         * elflink.h (elf_link_input_bfd <emit_relocs>): Handle adjustment
1547         for section symbols here if rela_normal.  Simplify abs section test.
1548         * elf-m10200.c (mn10200_elf_relocate_section): If relocatable,
1549         return immediately.  Remove code handling relocatable linking.
1550         * elf-m10300.c (mn10300_elf_relocate_section): Likewise.
1551         * elf32-fr30.c (fr30_elf_relocate_section): Likewise.
1552         * elf32-i370.c (i370_elf_relocate_section): Likewise.
1553         * elf32-i860.c (elf32_i860_relocate_section): Likewise.
1554         * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
1555         * elf32-mcore.c (mcore_elf_relocate_section): Likewise.
1556         * elf32-openrisc.c (openrisc_elf_relocate_section): Likewise.
1557         * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
1558         * elf32-s390.c (elf_s390_relocate_section): Likewise.
1559         * elf32-xstormy16.c (xstormy16_elf_relocate_section): Likewise.
1560         * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
1561         * elf64-s390.c (elf_s390_relocate_section): Likewise.
1562         * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
1563         * elfxx-ia64.c (elfNN_ia64_relocate_section): Likewise.
1564         * elf32-arm.h (elf32_arm_relocate_section): Likewise #ifndef USE_REL.
1565         * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
1566         * elf-m10200.c (elf_backend_rela_normal): Define.
1567         * elf-m10300.c (elf_backend_rela_normal): Define.
1568         * elf32-fr30.c (elf_backend_rela_normal): Define.
1569         * elf32-i370.c (elf_backend_rela_normal): Define.
1570         * elf32-i860.c (elf_backend_rela_normal): Define.
1571         * elf32-m68k.c (elf_backend_rela_normal): Define.
1572         * elf32-mcore.c (elf_backend_rela_normal): Define.
1573         * elf32-openrisc.c (elf_backend_rela_normal): Define.
1574         * elf32-ppc.c (elf_backend_rela_normal): Define.
1575         * elf32-s390.c (elf_backend_rela_normal): Define.
1576         * elf32-xstormy16.c (elf_backend_rela_normal): Define.
1577         * elf64-ppc.c (elf_backend_rela_normal): Define.
1578         * elf64-s390.c (elf_backend_rela_normal): Define.
1579         * elf64-x86-64.c (elf_backend_rela_normal): Define.
1580         * elfxx-ia64.c (elf_backend_rela_normal): Define.
1581         * elf32-arm.h (elf_backend_rela_normal): Define #ifndef USE_REL.
1582         * elf32-m32r.c (elf_backend_rela_normal): Likewise.
1583
1584 2002-05-06  Nick Clifton  <nickc@cambridge.redhat.com>
1585
1586         * elf32-arm.h (elf32_arm_final_link_relocate): Convert
1587         'reloc_signed_max' and 'reloc_signed_min' into half-word offsets.
1588
1589 2002-05-06  Alan Modra  <amodra@bigpond.net.au>
1590
1591         * elflink.h (elf_link_input_bfd <emit_relocs>): Adjust r_offset
1592         when not relocatable.  Fix reloc_emitter call for K&R.
1593
1594 2002-05-04  Alan Modra  <amodra@bigpond.net.au>
1595
1596         * elf64-ppc.c (ppc64_elf_relocate_section): Reinstate code
1597         reloading local sym addend mistakenly removed in 2002-05-01 change.
1598
1599         * dwarf2.c (struct line_head): Make prologue_length a bfd_vma.
1600         (read_abbrevs): Change "offset" param to bfd_vma.
1601         (parse_comp_unit): Change "version" and addr_size to unsigned ints.
1602         Change "abbrev_offset" to bfd_vma.
1603         (read_indirect_string): Use correct conversion chars in error
1604         message format string, cast bfd_vma's to unsigned long.
1605         (read_abbrevs): Likewise.
1606         (read_attribute_value): Likewise.
1607         (decode_line_info): Likewise.
1608         (scan_unit_for_functions): Likewise.
1609         (parse_comp_unit): Likewise.
1610
1611 2002-05-04  Tom Rix  <trix@redhat.com>
1612
1613         * coffswap.h (coff_swap_reloc_in): Remove XCOFF support.
1614         (coff_swap_reloc_out): Same.
1615         * coff-rs6000.c: (xcoff_swap_reloc_in): Moved from coffswap.h.
1616         (xcoff_swap_reloc_out): Same.
1617         (xcoff_rtype2howto): Renamed from _bfd_xcoff_rtype2howto. Special
1618         case some 16 bit relocs. Add reloc value to output.
1619         (xcoff_howto_table): Remove 64 bit R_POS, add 16 bit
1620         R_RBR. Improve names.
1621         (_bfd_xcoff_reloc_type_lookup): Adjust for removal of 64 bit R_POS.
1622         (bfd_xcoff_backend_data): Update with new reloc swap names.
1623         (bfd_pmac_xcoff_backend_data) : Same.
1624         * coff64-rs6000.c: (xcoff64_swap_reloc_in): Moved from coffswap.h.
1625         (xcoff64_swap_reloc_out): Same.
1626         (xcoff64_rtype2howto): Special case some 16 bit relocs and 32 bit
1627         R_POS. Add reloc value to output.
1628         (xcoff64_howto_table): Move 64 bit R_POS to first entry.  Add 16
1629         bit R_RBR. Improve names, masks.
1630         (xcoff64_reloc_type_lookup): Adjust for move of 64 bit R_POS.
1631         (bfd_xcoff_backend_data): Update with new reloc swap names.
1632         (bfd_xcoff_aix5_backend_data) : Same.
1633
1634 2002-05-04  Alan Modra  <amodra@bigpond.net.au>
1635
1636         * elf32-hppa.c (struct elf32_hppa_link_hash_table): Add
1637         bfd_count top_index, input_list, all_local_syms.
1638         (elf32_hppa_setup_section_lists): New function, split from
1639         elf32_hppa_size_stubs.
1640         (elf32_hppa_next_input_section): Likewise.
1641         (group_sections): Likewise.
1642         (get_local_syms): Likewise.
1643         (elf32_hppa_size_stubs): Adjust for split out functions.  Look for
1644         stubs on undefined syms too.
1645         (elf32_hppa_set_gp): Use bfd_link_hash* instead of elf_link_hash*.
1646         Only access htab elf fields when we have an elf hash table.
1647         * elf32-hppa.h (elf32_hppa_setup_section_lists): Declare.
1648         (elf32_hppa_next_input_section): Declare.
1649
1650 2002-05-04  Bob Byrnes  <byrnes@curl.com>
1651
1652         * opncls.c (_bfd_new_bfd_contained_in): Check return value of
1653         _bfd_new_bfd.
1654
1655 2002-05-03  H.J. Lu  (hjl@gnu.org)
1656
1657         * elfxx-mips.c (mips_elf_link_hash_entry): Add forced_local.
1658         (mips_elf_link_hash_newfunc): Initialize forced_local to false.
1659         (mips_elf_record_global_got_symbol): Call _bfd_mips_elf_hide_symbol
1660         to hide a global symbol.
1661         (_bfd_mips_elf_hide_symbol): Return if forced_local is true. Set
1662         forced_local to true.
1663
1664 2002-05-02  Richard Henderson  <rth@redhat.com>
1665
1666         * elf64-alpha.c (elf64_alpha_relocate_section): Force relative relocs
1667         vs SHN_UNDEF to zero.
1668
1669 2002-05-02  Alan Modra  <amodra@bigpond.net.au>
1670
1671         * elf64-ppc.c (ppc64_elf_howto_raw <R_PPC64_SECTOFF>): Change to a
1672         16 bit reloc.
1673         <R_PPC64_SECTOFF_DS>: Likewise.
1674         (ppc64_elf_reloc_type_lookup): Map from BFD_RELOC_16_BASEREL to
1675         SECTOFF reloc.
1676         * elf32-ppc.c (ppc_elf_howto_raw <R_PPC_SECTOFF>): Correct.
1677         (ppc_elf_reloc_type_lookup): Map from BFD_RELOC_16_BASEREL to
1678         SECTOFF reloc.
1679
1680         * elf64-ppc.c (ppc64_elf_addr16_ha_reloc): Delete.
1681         (ppc64_elf_ha_reloc): New function.
1682         (ppc64_elf_brtaken_reloc): New function.
1683         (ppc64_elf_sectoff_reloc): New function.
1684         (ppc64_elf_sectoff_ha_reloc): New function.
1685         (ppc64_elf_toc_reloc): New function.
1686         (ppc64_elf_toc_ha_reloc): New function.
1687         (ppc64_elf_toc64_reloc): New function.
1688         (ppc64_elf_unhandled_reloc): New function.
1689         (ppc64_elf_howto_raw): Use the above.
1690         <R_PPC64_RELATIVE>: Mark pc_relative, pcrel_offset.
1691         <R_PPC64_SECTOFF>: Not pc_relative or pcrel_offset.  Fix dst_mask.
1692         <R_PPC64_SECTOFF_DS>: Likewise.
1693         (IS_ABSOLUTE_RELOC): Update.
1694         (struct ppc_link_hash_table): Add have_undefweak.
1695         (ppc64_elf_link_hash_table_create): Init.
1696         (func_desc_adjust): Set have_undefweak.
1697         (ppc64_elf_func_desc_adjust): Call func_desc_adjust earlier.  Only
1698         add the .sfpr blr when have_undefweak.
1699         (ppc64_elf_setup_section_lists): Check hash table flavour.
1700         (ppc64_elf_next_input_section): Move output_section->owner test to
1701         ppc64elf.em.
1702         (ppc64_elf_set_toc): Rename to ppc64_elf_toc, remove info param
1703         and relocatable test.  Return TOCstart and don't set elf_gp.
1704         (ppc64_elf_relocate_section): Correct BRTAKEN/BRNTAKEN branch
1705         offset calculation.  Add assert on weak sym branch tweaks.
1706         * elf64-ppc.h (ppc64_elf_set_toc): Delete.
1707         (ppc64_elf_toc): Declare.
1708         (ppc64_elf_next_input_section): Update.
1709
1710 2002-05-01  Alan Modra  <amodra@bigpond.net.au>
1711
1712         * syms.c (_bfd_stab_section_find_nearest_line): Don't bomb on NULL
1713         file_name.
1714
1715 2002-05-01  Alan Modra  <amodra@bigpond.net.au>
1716
1717         * elf64-ppc.c (CROR_151515, CROR_313131): Define.
1718         (ppc64_elf_relocate_section): Use them.  Don't look for plt calls
1719         on R_PPC64_ADDR24 relocs.  Require a nop or no link reg on plt
1720         call branches.  Correct undefined weak destination.
1721         (ppc64_elf_func_desc_adjust): Always create at least one blr in
1722         .sfpr, and correct case where either only savef* or restf* is
1723         needed.
1724
1725         Long branch stubs, multiple stub sections.
1726         * elf64-ppc.h (ppc64_elf_setup_section_lists): Declare.
1727         (ppc64_elf_next_input_section): Declare.
1728         * elf64-ppc.c: Move linker-only prototypes.
1729         (STUB_SUFFIX): Define.
1730         (enum ppc_stub_type): New.
1731         (struct ppc_stub_hash_entry): New.
1732         (struct ppc_branch_hash_entry): New.
1733         (struct ppc_link_hash_entry): Add stub_cache, oh.
1734         (struct ppc_link_hash_table): Add stub_hash_table etc.  Remove
1735         sstub.  Add sbrlt, srelbrlt, has_14bit_branch, stub_iteration.
1736         Rename plt_overflow to stub_error.
1737         (ppc_stub_hash_lookup): Define.
1738         (ppc_branch_hash_lookup): Define.
1739         (stub_hash_newfunc): New function.
1740         (branch_hash_newfunc): New function.
1741         (link_hash_newfunc): Init new fields.
1742         (ppc64_elf_link_hash_table_create): Likewise.
1743         (ppc64_elf_link_hash_table_free): New function.
1744         (ppc_stub_name): New function.
1745         (ppc_get_stub_entry): New function.
1746         (ppc_add_stub): New function.
1747         (create_linkage_sections): Use bfd_make_section_anyway.  Create
1748         .branch_lt and .rela.branch_lt sections.  Don't create .stub.
1749         (ppc64_elf_check_relocs): Set has_14bit_branch on R_PPC64_REL14*,
1750         and set up for plt call stubs.  Link func and func desc syms.
1751         (ppc64_elf_gc_sweep_hook): Handle REL14* as per REL24.
1752         (func_desc_adjust): Avoid hash lookup when func desc sym available
1753         via shortcut, and set links when processing.
1754         (ppc64_elf_hide_symbol): Likewise.
1755         (allocate_dynrelocs): Don't allocate stub section here.
1756         (ppc64_elf_size_dynamic_sections): Handle sbrlt and srelbrlt.
1757         Remove sstub code.
1758         (ppc_type_of_stub): New function.
1759         (build_one_stub): Delete.
1760         (ppc_build_one_stub): New function.
1761         (ppc_size_one_stub): New function.
1762         (ppc64_elf_setup_section_lists): New function.
1763         (ppc64_elf_next_input_section): New function.
1764         (group_sections): New function.
1765         (get_local_syms): New function.
1766         (ppc64_elf_size_stubs): Rewrite.
1767         (ppc64_elf_build_stubs): Rewrite.
1768         (ppc64_elf_relocate_section): Look up stub entry for REL24
1769         relocs.  Don't propagate REL14* to dynamic objects.  Look for long
1770         branch stubs if REL14* or REL24 relocs won't reach.
1771         (bfd_elf64_bfd_link_hash_table_free): Define.
1772
1773 2002-04-30  Mark Mitchell  <mark@codesourcery.com>
1774
1775         * bfd/config.bfd: Add support for powerpc-*-windiss.
1776
1777 2002-04-30  Tom Rix  <trix@redhat.com>
1778
1779         * xcofflink.c (xcoff_link_add_symbols): Always copy undef C_EXT
1780         symbol names into the hash table.
1781
1782 2002-04-28  Tom Rix  <trix@redhat.com>
1783
1784         * coff-rs6000.c (xcoff_calculate_relocation) : Function table for
1785         calulating relocations.
1786         (xcoff_complain_overflow) : Function table for relocation errors.
1787         (xcoff_ppc_relocate_section): Use relocation and complain function
1788         tables.
1789         (xcoff_complain_overflow_unsigned_func): New complain function.
1790         (xcoff_complain_overflow_signed_func): Same.
1791         (xcoff_complain_overflow_bitfield_func): Same.
1792         (xcoff_complain_overflow_dont_func): Same.
1793         (xcoff_reloc_type_crel): New recot function.
1794         (xcoff_reloc_type_br): Same.
1795         (xcoff_reloc_type_ba): Same.
1796         (xcoff_reloc_type_toc): Same.
1797         (xcoff_reloc_type_rel): Same.
1798         (xcoff_reloc_type_neg): Same.
1799         (xcoff_reloc_type_pos): Same.
1800         (xcoff_reloc_type_fail): Same.
1801         (xcoff_reloc_type_noop): Same.
1802         * libxcoff.h : Declare common parts for xcoff64.
1803         * coff64-rs6000.c (xcoff64_ppc_relocate_section): Use relocation
1804         and complain function tables.
1805
1806 2002-04-28  Alan Modra  <amodra@bigpond.net.au>
1807
1808         * elf64-x86-64.c (struct elf64_x86_64_dyn_relocs): Comment typo.
1809         * elf32-hppa.c (elf32_hppa_final_link): Formatting.
1810
1811 2002-04-26  Alan Modra  <amodra@bigpond.net.au>
1812
1813         * opncls.c (bfd_make_readable): Call bfd_section_list_clear.
1814         * xcofflink.c (xcoff_link_add_dynamic_symbols): Likewise.
1815
1816         * elflink.h (elf_bfd_final_link): Ensure input bfd class is the
1817         same as the output before calling elf_link_input_bfd.
1818
1819         * coffcode.h (coff_compute_section_file_positions): Set
1820         section_tail after shuffling section list.
1821
1822 2002-04-24  Christian Groessler <chris@groessler.org>
1823
1824         * coff-z8k.c (extra_case): Fix R_IMM32 relocations: The
1825         addresses are 23bit with a special layout, not plain 32bit
1826         values.  Prevent relocation of immediate values.
1827
1828 2002-04-24  Chris G. Demetriou  <cgd@broadcom.com>
1829
1830         * elfxx-mips.c (_bfd_mips_elf_print_private_bfd_data): If MDMX or
1831         MIPS-16 ASE flags are set, print something to indicate that.
1832
1833 2002-04-23  Alan Modra  <amodra@bigpond.net.au>
1834
1835         * elf32-hppa.c (hppa_type_of_stub): Correct and simplify condition
1836         under which a plt call stub is used.
1837         (final_link_relocate): Similarly.
1838         (allocate_plt_static): Clear h-plabel except when plt entry is
1839         exclusively used for a plabel.
1840         (allocate_dynrelocs): Use the above to simplify plt sizing.
1841         (struct elf32_hppa_link_hash_table): Add has_22bit_branch.
1842         (elf32_hppa_link_hash_table_create): Init.
1843         (BL22_RP): Define.
1844         (hppa_build_one_stub): Use BL22_RP if has_22bit_branch.
1845         (elf32_hppa_check_relocs): Set has_22bit_branch.
1846
1847         * elf32-hppa.c (elf32_hppa_check_relocs): Remove debug message.
1848         (final_link_relocate): Likewise.
1849
1850 2002-04-22  Jakub Jelinek  <jakub@redhat.com>
1851
1852         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Don't build
1853         search table if some FDE is DW_EH_PE_aligned encoded either.
1854         (_bfd_elf_write_section_eh_frame): Handle terminating FDE specially.
1855
1856 2002-04-22  Richard Smith  <richard@ex-parrot.com>
1857             Jakub Jelinek  <jakub@redhat.com>
1858
1859         * elf-eh-frame.c (struct eh_cie_fde): Add per_encoding_relative.
1860         (_bfd_elf_discard_section_eh_frame): Set it for CIEs with pcrel
1861         encoded personality.
1862         (_bfd_elf_write_section_eh_frame): Adjust pcrel encoded personality
1863         for CIE/FDE removal.
1864
1865 2002-04-20  Tom Rix  <trix@redhat.com>
1866
1867         * coff64-rs6000.c (_bfd_xcoff64_swap_aux_in): Fix C_FILE auxent.
1868
1869 2002-04-20  Alan Modra  <amodra@bigpond.net.au>
1870
1871         * archures.c (bfd_lookup_arch): Move the list order comment..
1872         (struct bfd_arch_info): ..to where it belongs.
1873         * bfd-in2.h: Regenerate.
1874
1875         * archures.c (bfd_lookup_arch): Add comment on list order.
1876         (bfd_default_set_arch_mach): Use bfd_lookup_arch.
1877         * cpu-powerpc.c (bfd_powerpc_archs): Re-order so that the default
1878         is always at head of list.
1879
1880 2002-04-18  Nick Clifton  <nickc@cambridge.redhat.com>
1881
1882         * coff-arm.c (coff_thumb_pcrel_12, coff_thumb_pcrel_9,
1883         insert_thumb_branch, record_thumb_to_arm_glue): Suppress
1884         definition of these functions for ARM_WINCE builds as they are
1885         not used.
1886         (SWAP_IN_RELOC_OFFSET, SWAP_OUT_RELOC_OFFSET): Do not define
1887         for ARM_WINCE builds.
1888
1889 2002-04-18  Nick Clifton  <nickc@cambridge.redhat.com>
1890
1891         * coff-arm.c (bfd_arm_process_before_allocation):
1892
1893 2002-04-17  J"orn Rennecke <joern.rennecke@superh.com>
1894
1895         * cpu-sh.c (scan_mach): Delete.
1896         (arch_info_struct): Replace scan_mach with bfd_default_scan.
1897         (bfd_sh_arch): Likewise.
1898
1899 2002-04-16  Nick Clifton  <nickc@cambridge.redhat.com>
1900
1901         * ihex.c (ihex_write_object_contents): Fix check for records
1902         crossing 64K boundaries.
1903
1904 2002-04-16  Alan Modra  <amodra@bigpond.net.au>
1905
1906         * elf32-m32r.c (m32r_elf_add_symbol_hook): Check the hash table
1907         type rather than just assuming entries are ELF.
1908         * elf32-sh64.c (sh64_elf_add_symbol_hook): Likewise.
1909         * elf64-sh64.c (sh64_elf64_add_symbol_hook): Likewise.
1910         * elf64-sparc.c (sparc64_elf_add_symbol_hook): Likewise.
1911         * elf64-mmix.c (mmix_elf_add_symbol_hook): Use bfd_link_hash_entry
1912         rather than elf_link_hash_entry.
1913
1914 2002-04-15  Richard Henderson  <rth@redhat.com>
1915
1916         * elf32-mips.c (mips_elf32_object_p): Revert 0404 fragment: allow
1917         n32 binaries.
1918
1919 2002-04-15  Michael Snyder  <msnyder@redhat.com>
1920
1921         * opncls.c (bfd_close): Write contents if writeable.
1922         Minor formatting tidy-ups.
1923
1924 2002-04-15  Alan Modra  <amodra@bigpond.net.au>
1925
1926         * elf32-ppc.c (ppc_elf_add_symbol_hook): Check the hash table type.
1927
1928 2002-04-12  Michael Snyder  <msnyder@redhat.com>
1929
1930         * bfd-in.h (bfd_get_section_lma): New access macro.
1931         Minor white-space fix-up.
1932
1933 2002-04-12  Alan Modra  <amodra@bigpond.net.au>
1934
1935         * elf.c (prep_headers): Don't zero EI_OSABI, EI_ABIVERSION or
1936         header pad.
1937
1938 2002-04-09  DJ Delorie  <dj@redhat.com>
1939
1940         * elfarm-nabi.c (elf32_arm_howto_table): Fix ABS16 masks.
1941
1942 2002-04-09  Casper S. Hornstrup <chorns@users.sourceforge.net>
1943
1944         * coffcode.h (coff_read_word): New.
1945         (coff_compute_checksum): New.
1946         (coff_apply_checksum): New.
1947         (coff_write_object_contents): Call coff_apply_checksum () to
1948         apply checksum to PE image.
1949
1950 2002-04-08  Randolph Chung  <tausq@debian.org>
1951
1952         * elf32-hppa.c (hppa_unwind_entry_compare): Move to elf-hppa.h.
1953         (elf32_hppa_final_link): Split out sorting logic to..
1954         * elf-hppa.h (elf_hppa_sort_unwind): ..here.
1955         (elf_hppa_final_link): Call elf_hppa_sort_unwind.
1956
1957 2002-04-07  Andrew Cagney  <ac131313@redhat.com>
1958
1959         * configure.in: Add missing ``|'' to powerpc-*-aix4.[4-9]*
1960         pattern.
1961         * configure: Re-generate.
1962
1963 2002-04-07  Andrew Cagney  <ac131313@redhat.com>
1964
1965         * configure.in: Only define AIX_CORE_DUMPX_CORE when AIX version
1966         is greater or equal to 4.3.3.
1967         * configure: Regenerate.
1968         Fix PR gdb/344.
1969
1970 2002-04-05  Hans-Peter Nilsson  <hp@axis.com>
1971
1972         * elf32-cris.c (cris_elf_howto_table) <R_CRIS_16_PCREL,
1973         R_CRIS_32_PCREL>: Fix typo in name.
1974         (cris_elf_check_relocs): Always create .rela.got here when
1975         R_CRIS_16_GOTPLT or R_CRIS_32_GOTPLT is seen.
1976         (elf_cris_adjust_gotplt_to_got): Don't create .rela.got here;
1977         assume it's created.
1978
1979 2002-04-04  Daniel Jacobowitz  <drow@mvista.com>
1980
1981         * aout-adobe.c (aout_32_bfd_link_hash_table_free): Define.
1982         * aout-target.h (MY_bfd_link_hash_table_free): Conditionally
1983         define.
1984         * aout-tic30.c (MY_bfd_link_hash_table_free): Likewise.
1985         * bfd.c (bfd_link_hash_table_free): Define.
1986         * binary.c (binary_bfd_link_hash_table_free): Define.
1987         * bout.c (b_out_bfd_link_hash_table_free): Define.
1988         * coff-rs6000.c (rs6000coff_vec): Include
1989         _bfd_generic_link_hash_table_free.
1990         (pmac_xcoff_vec): Likewise.
1991         * coff64-rs6000.c (rs6000coff64_vec): Likewise.
1992         (aix5coff64_vec): Likewise.
1993         * coffcode.h (coff_bfd_link_hash_table_free): Conditionally define.
1994         * elf-m10300.c (elf32_mn10300_link_hash_table_free): New function.
1995         (bfd_elf32_bfd_link_hash_table_free): Define.
1996         * elf32-hppa.c (elf32_hppa_link_hash_table_free): New function.
1997         (bfd_elf32_bfd_link_hash_table_free): Define.
1998         * elfxx-target.h (bfd_elfNN_bfd_link_hash_table_free): Conditionally
1999         define.
2000         * i386msdos.c (msdos_bfd_link_hash_table_free): Define.
2001         * i386os9k.c (os9k_bfd_link_hash_table_free): Define.
2002         * ieee.c (ieee_bfd_link_hash_table_free): Define.
2003         * ihex.c (ihex_bfd_link_hash_table_free): Define.
2004         * libbfd-in.h (_bfd_nolink_bfd_link_hash_table_free): Define.
2005         (_bfd_generic_link_hash_table_free): Add prototype.
2006         * libcoff-in.h (_bfd_xcoff_bfd_link_hash_table_free): Add prototype.
2007         * libecoff.h (_bfd_ecoff_bfd_link_hash_table_free): Define.
2008         * linker.c (_bfd_generic_link_hash_table_free): New function.
2009         * mmo.c (mmo_bfd_link_hash_table_free): Define.
2010         * nlm-target.h (nlm_bfd_link_hash_table_free): Define.
2011         * oasys.c (oasys_bfd_link_hash_table_free): Define.
2012         * ppcboot.c (ppcboot_bfd_link_hash_table_free): Define.
2013         * som.c (som_bfd_link_hash_table_free): Define.
2014         * srec.c (srec_bfd_link_hash_table_free): Define.
2015         * tekhex.c (tekhex_bfd_link_hash_table_free): Define.
2016         * versados.c (versados_bfd_link_hash_table_free): Define.
2017         * vms.c (vms_bfd_link_hash_table_free): New function.
2018         * xcofflink.c (_bfd_xcoff_bfd_link_hash_table_free): New function.
2019
2020         * coff-arm.c (coff_arm_link_hash_table_create): Use bfd_malloc
2021         instead of bfd_alloc.
2022         * coff-h8300.c (h8300_coff_link_hash_table_create): Likewise.
2023         * coff-mcore.c (coff_mcore_link_hash_table_create): Likewise.
2024         * coff-ppc.c (ppc_coff_link_hash_table_create): Likewise.
2025         * cofflink.c (_bfd_coff_link_hash_table_create): Likewise.
2026         * ecoff.c (_bfd_ecoff_bfd_link_hash_table_create): Likewise.
2027         * elf-m10300.c (elf32_mn10300_link_hash_table_create): Likewise.
2028         * elf.c (_bfd_elf_link_hash_table_create): Likewise.
2029         * elf32-arm.h (elf32_arm_link_hash_table_create): Likewise.
2030         * elf32-cris.c (elf_cris_link_hash_table_create): Likewise.
2031         * elf32-hppa.c (elf32_hppa_link_hash_table_create): Likewise.
2032         * elf32-i386.c (elf_i386_link_hash_table_create): Likewise.
2033         * elf32-m68k.c (elf_m68k_link_hash_table_create): Likewise.
2034         * elf32-s390.c (elf_s390_link_hash_table_create): Likewise.
2035         * elf32-sh.c (sh_elf_link_hash_table_create): Likewise.
2036         * elf64-alpha.c (elf64_alpha_bfd_link_hash_table_create): Likewise.
2037         * elf64-ppc.c (ppc64_elf_link_hash_table_create): Likewise.
2038         * elf64-s390.c (elf_s390_link_hash_table_create): Likewise.
2039         * elf64-sh64.c (sh64_elf64_link_hash_table_create): Likewise.
2040         * elf64-sparc.c (sparc64_elf_bfd_link_hash_table_create): Likewise.
2041         * elf64-x86-64.c (elf64_x86_64_link_hash_table_create): Likewise.
2042         * elfxx-mips.c (_bfd_mips_elf_link_hash_table_create): Likewise.
2043         * linker.c (_bfd_generic_link_hash_table_create): Likewise.
2044         * m68klinux.c (linux_link_hash_table_create): Likewise.
2045         * sparclinux.c (linux_link_hash_table_create): Likewise.
2046         * sunos.c (sunos_link_hash_table_create): Likewise.
2047         * xcofflink.c (_bfd_xcoff_bfd_link_hash_table_create): Likewise.
2048
2049         * targets.c: Add _bfd_link_hash_table_free to xvec.
2050
2051         * bfd-in2.h: Regenerate.
2052         * libbfd.h: Regenerate.
2053         * libcoff.h: Regenerate.
2054
2055 2002-04-04  Alan Modra  <amodra@bigpond.net.au>
2056
2057         * dep-in.sed: Cope with absolute paths.
2058         * Makefile.am (dep.sed): Subst TOPDIR, and not INCDIR.
2059         Run "make dep-am".
2060         * Makefile.in: Regenerate.
2061         * coff-arm.c: Fix copyright date.
2062         * cpu-h8300.c: Likewise.
2063         * cpu-i370.c: Likewise.
2064         * cpu-s390.c: Likewise.
2065         * cpu-mips.c: Likewise.
2066         * po/SRC-POTFILES.in: Regenerate.
2067
2068 2002-04-04  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
2069
2070         * Makefile.am: Add elfxx-mips.c to the known backends.
2071         (elf32-mips.lo): remove dependency to coff/external.h.
2072         * Makefile.in: Regenerate.
2073         * configure.in: Add elfxx-mips.lo to all vectors using elf32-mips.lo
2074         Remove elf32-mips.lo from 64 bit vectors. Update dependencies
2075         accordingly.
2076         * configure: Regenerate.
2077         * elf-bfd.h: Move all MIPS ELF specific prototypes to elfxx-mips.h.
2078         (irix_compat_t): IRIX compatibility level, moved from elf32-mips.c.
2079         (elf_backend_mips_irix_compat, elf_backend_mips_rtype_to_howto): New
2080         MIPS specific backend functions.
2081         * elf32-mips.c: Moved most code to elfxx-mips.c.
2082         (mips_elf_hi16_reloc): Rename from _bfd_mips_elf_hi16_reloc and make
2083         static.
2084         (mips_elf_lo16_reloc): Likewise, was _bfd_mips_elf_lo16_reloc.
2085         (mips_elf_got16_reloc): Likewise, was _bfd_mips_elf_got16_reloc.
2086         (mips_elf_gprel32_reloc): Likewise, was _bfd_mips_elf_gprel32_reloc.
2087         (mips_elf32_rtype_to_howto): Rename from mips_rtype_to_howto. Changed
2088         interface to allow selection of the right REL or RELA howto table.
2089         (mips_elf32_object_p): Rename from _bfd_mips_elf_object_p and made
2090         static. Let it refuse n32 objects.
2091         (elf32_mips_grok_prstatus): Rename from _bfd_elf32_mips_grok_prstatus.
2092         (elf32_mips_grok_psinfo): Rename from _bfd_elf32_mips_grok_psinfo.
2093         (elf32_mips_discard_info): Rename from _bfd_elf32_mips_discard_info.
2094         (elf32_mips_ignore_discarded_relocs): Rename from
2095         _bfd_elf32_mips_ignore_discarded_relocs.
2096         (elf32_mips_write_section): Rename from _bfd_elf32_mips_write_section.
2097         (elf32_mips_irix_compat): New function, replaces IRIX_COMPAT.
2098         (elf_mips_howto_table_rela): Remove.
2099         * elf64-mips.c: Moved most code to elfxx-mips.c.
2100         (bfd_elf64_bfd_reloc_type_lookup): Make static.
2101         (mips_elf64_rtype_to_howto): New function.
2102         (mips_elf64_object_p): Likewise.
2103         (elf64_mips_irix_compat): Likewise.
2104         * elfxx-mips.c: New file containing common code merged together from
2105         elf32-mips.c and elf64-mips.c.
2106         * elfxx-mips.h: New file containing MIPS specific prototypes from
2107         elf-bfd.h.
2108         * elfxx-target.h: Add handling for elf_backend_mips_irix_compat and
2109         elf_backend_mips_rtype_to_howto.
2110
2111 2002-04-04  Alan Modra  <amodra@bigpond.net.au>
2112
2113         * srec.c (MAXCHUNK, Chunk): Revise comments.
2114         (srec_write_record): Correct buffer size.
2115         (srec_write_header): Do without intermediate buffer.
2116         (srec_write_section): Validate Chunk.
2117         (srec_write_terminator): Pass NULL instead of dummy buffer.
2118         (srec_write_symbols): Pass file and symbol names directly to
2119         bfd_bwrite so sprintf won't overflow buffer.
2120
2121 2002-04-03  Jakub Jelinek  <jakub@redhat.com>
2122
2123         * elf32-sparc.c (elf32_sparc_relocate_section): Don't emit dynamic
2124         PC relative relocs against hidden symbols.
2125         * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
2126
2127 2002-04-03  Alan Modra  <amodra@bigpond.net.au>
2128
2129         * elf.c (_bfd_elf_make_section_from_shdr): When setting section
2130         LMAs, loop over segments until p_vaddr and p_memsz specify an
2131         extent enclosing the section.
2132
2133 2002-04-02  Nick Clifton  <nickc@cambridge.redhat.com>
2134
2135         * ihex.c (ihex_write_object_contents): Do not allow records to
2136         cross a 64K boundary - wrap if necessary.
2137
2138 2002-04-01  Nathan Williams  <nathanw@wasabisystems.com>
2139
2140         * elf.c (elfcore_netbsd_get_lwpid): Fix off-by-one error
2141         which caused the returned LWP ID to always be 0.
2142
2143 2002-04-01  Richard Henderson  <rth@redhat.com>
2144
2145         * elf32-sparc.c (WILL_CALL_FINISH_DYNAMIC_SYMBOL): New.
2146         (elf32_sparc_relocate_section): Use it to figure out when to
2147         initialize .got entries.
2148         * elf64-sparc.c: Similarly.
2149
2150 2002-03-28  Alan Modra  <amodra@bigpond.net.au>
2151
2152         * linker.c (link_action): Ignore duplicate warning syms.
2153         (_bfd_generic_link_write_global_symbol): Follow warning symbol link.
2154         * elflink.h (elf_adjust_dynstr_offsets): Likewise.
2155         (elf_adjust_dynamic_symbol): Likewise.
2156         (elf_export_symbol): Likewise.
2157         (elf_link_find_version_dependencies): Likewise.
2158         (elf_link_assign_sym_version): Likewise.
2159         (elf_link_sec_merge_syms): Likewise.
2160         (elf_link_output_extsym): Likewise.
2161         (elf_gc_sweep_symbol): Likewise.
2162         (elf_gc_propagate_vtable_entries_used): Likewise.
2163         (elf_gc_smash_unused_vtentry_relocs): Likewise.
2164         (elf_gc_allocate_got_offsets): Likewise.
2165         (elf_collect_hash_codes): Likewise.
2166         * elflink.c (elf_link_renumber_hash_table_dynsyms): Likewise.
2167         * elf-hppa.h (elf_hppa_unmark_useless_dynamic_symbols): Likewise.
2168         (elf_hppa_remark_useless_dynamic_symbols): Likewise.
2169         * elf-m10300.c (elf32_mn10300_finish_hash_table_entry): Likewise.
2170         * elf32-arm.h (elf32_arm_discard_copies): Likewise.
2171         * elf32-cris.c (elf_cris_adjust_gotplt_to_got): Likewise.
2172         (elf_cris_discard_excess_dso_dynamics): Likewise.
2173         * elf32-hppa.c (clobber_millicode_symbols): Likewise.
2174         (mark_PIC_calls): Likewise.
2175         (allocate_plt_static): Likewise.
2176         (allocate_dynrelocs): Likewise.
2177         (readonly_dynrelocs): Likewise.
2178         * elf32-i386.c (allocate_dynrelocs): Likewise.
2179         (readonly_dynrelocs): Likewise.
2180         * elf32-i370.c (i370_elf_adjust_dynindx): Likewise.
2181         * elf32-m68k.c (elf_m68k_discard_copies): Likewise.
2182         * elf32-mips.c (mips_elf_output_extsym): Likewise.
2183         (mips_elf_sort_hash_table_f): Likewise.
2184         (mips_elf_check_mips16_stubs): Likewise.
2185         * elf32-s390.c (allocate_dynrelocs): Likewise.
2186         (readonly_dynrelocs): Likewise.
2187         * elf32-sh.c (sh_elf_discard_copies): Likewise.
2188         * elf32-xstormy16.c (xstormy16_relax_plt_check): Likewise.
2189         (xstormy16_relax_plt_realloc): Likewise.
2190         * elf64-alpha.c (elf64_alpha_calc_got_offsets_for_symbol): Likewise.
2191         (elf64_alpha_output_extsym): Likewise.
2192         * elf64-hppa.c (elf64_hppa_mark_exported_functions): Likewise.
2193         * elf64-mips.c (mips_elf64_sort_hash_table_f): Likewise.
2194         (mips_elf64_check_mips16_stubs): Likewise.
2195         (mips_elf64_output_extsym): Likewise.
2196         * elf64-ppc.c (func_desc_adjust): Likewise.
2197         (allocate_dynrelocs): Likewise.
2198         (readonly_dynrelocs): Likewise.
2199         * elf64-s390.c (allocate_dynrelocs): Likewise.
2200         (readonly_dynrelocs): Likewise.
2201         * elf64-sh64.c (sh64_elf64_discard_copies): Likewise.
2202         * elf64-x86-64.c (allocate_dynrelocs): Likewise.
2203         (readonly_dynrelocs): Likewise.
2204         * elfxx-ia64.c (elfNN_ia64_global_dyn_sym_thunk): Likewise.
2205         * aoutx.h (aout_link_write_other_symbol): Likewise.
2206         * cofflink.c (_bfd_coff_write_task_globals): Likewise.
2207         (_bfd_coff_write_global_sym): Likewise.
2208         * i386linux.c (linux_tally_symbols): Likewise.
2209         * m68klinux.c (linux_tally_symbols): Likewise.
2210         * sparclinux.c (linux_tally_symbols): Likewise.
2211         * pdp11.c (aout_link_write_other_symbol): Likewise.
2212         * sunos.c (sunos_scan_dynamic_symbol): Likewise.
2213         * xcofflink.c (xcoff_build_ldsyms): Likewise.
2214         (xcoff_write_global_symbol): Likewise.
2215
2216         * cofflink.c (_bfd_coff_final_link): Formatting.
2217         * cpu-mips.c (mips_compatible): Make static, prototype.
2218         * elf32-i386.c (elf_i386_check_relocs): Formatting.
2219         * elf32-sh.c (sh_elf_size_dynamic_sections): Likewise.
2220         * elf64-alpha.c (elf64_alpha_output_extsym): Likewise.
2221         * elf64-mips.c (mips_elf64_sort_hash_table): Likewise.
2222         (mips_elf64_final_link): Likewise.
2223         * elflink.h (elf_link_find_version_dependencies): Remove duplicate
2224         prototype.
2225
2226 2002-03-27  Nick Clifton  <nickc@cambridge.redhat.com>
2227
2228         * coff-arm.c (SWAP_IN_RELOC_OFFSET): Define.
2229         (SWAP_OUT_RELOC_OFFSET): Define.
2230
2231 2002-03-27  Gregory Steuck <greg@nest.cx>
2232
2233         * elf.c (_bfd_elf_get_symtab_upper_bound): Leave space for
2234         terminating NULL if empty symbol table.
2235         (_bfd_elf_get_dynamic_symtab_upper_bound): Likewise.
2236
2237 2002-03-26  H.J. Lu  (hjl@gnu.org)
2238
2239         * elflink.h (elf_link_input_bfd): Revert the last change since
2240         the gcc exception handling isn't fixed yet.
2241
2242 2002-03-26  H.J. Lu  (hjl@gnu.org)
2243
2244         * elflink.h (elf_link_input_bfd): Complain about relocations
2245         against local symbols in discarded sections.
2246
2247 2002-03-26  Alan Modra  <amodra@bigpond.net.au>
2248
2249         * elflink.h (elf_gc_mark): Don't recurse into non-ELF sections.
2250
2251 2002-03-23  Alan Modra  <amodra@bigpond.net.au>
2252
2253         * elf.c (_bfd_elf_make_section_from_shdr): Don't set lma based on
2254         section file offset for !SEC_LOAD sections.
2255
2256 2002-03-21  Richard Earnshaw  <rearnsha@arm.com>
2257
2258         * elf32-arm.h (elf32_arm_final_link_relocate <case R_ARM_GOTOFF>,
2259         <case R_ARM_GOT>): Handle relocations to Thumb functions.
2260
2261 2002-03-21  Alan Modra  <amodra@bigpond.net.au>
2262
2263         * coff64-rs6000.c (_bfd_xcoff64_put_symbol_name): Prototype.
2264         Whitespace changes.
2265         * archive.c: Update copyright date.
2266         * bfd-in2.h: Regenerate.
2267         * libbfd.h: Regenerate.
2268         * Makefile.am: Run "make dep-am"
2269         * Makefile.in: Regenerate.
2270         * po/SRC-POTFILES.in: Regenerate.
2271
2272 2002-03-20  Daniel Jacobowitz  <drow@mvista.com>
2273
2274         * dwarf2.c (struct funcinfo): Move up.
2275         (lookup_address_in_function_table): New argument function_ptr.
2276         Set it.
2277         (lookup_address_in_line_table): New argument function.  If function
2278         is non-NULL, use it to handle ``addr'' before the first line note of
2279         the function.
2280         (comp_unit_find_nearest_line): Update and swap calls to
2281         lookup_address_in_function_table and lookup_address_in_line_table.
2282         * syms.c (_bfd_stab_section_find_nearest_line): Use the first
2283         N_SLINE encountered if we see an N_FUN before any N_SLINE.
2284
2285 2002-03-20  Tom Rix  <trix@redhat.com>
2286
2287         * coff-rs6000.c (_bfd_xcoff_stat_arch_elt): Renamed from
2288         _bfd_xcoff_generic_stat_arch_elt.  Fix format check.
2289         * coff64-rs6000.c :  Use _bfd_xcoff_stat_arch_elt.
2290
2291 2002-03-19  Tom Rix  <trix@redhat.com>
2292
2293         * xcofflink.c (_bfd_xcoff_bfd_link_add_symbols): Look through all
2294         dynamic objects in archives.
2295
2296 2002-03-19  Hans-Peter Nilsson  <hp@bitrange.com>
2297
2298         * elflink.h (NAME(bfd_elf,record_link_assignment)): Don't set
2299         STT_NOTYPE symbols to STT_OBJECT.
2300
2301 2002-03-18  Jan Hubicka  <jh@suse.cz>
2302
2303         * cpu-i386.c (bfd_x86_64_arch): Rename to "i386:x86-64"
2304
2305 2002-03-18  Tom Rix  <trix@redhat.com>
2306
2307         * aix5ppc.core.c : New file for AIX 5 64 bit core support.
2308         * bfd-in.h : Add bfd_xcoff_ar_archive_set_magic declaration.
2309         * coff-rs6000 (do_pad) : New function for archive padding.
2310         (do_copy) : New function for object file copying in archives.
2311         (do_shared_object_padding) : New function for padding shared
2312         objects to their text section alignment in archives.
2313         (bfd_xcoff_ar_achive_set_magic) : Stub.
2314         (xcoff_write_armap_big) : Use do_copy and do_pad.
2315         (xcoff_write_archive_contents_big) : Use do_shared_object_padding,
2316         do_copy and do_pad.
2317         * coff64-rs6000.c (xcoff64_write_ojbect_contents) : Use
2318         bfd_xcoff_magic_number.
2319         (xcoff64_bad_format_hook) : New function for _bfd_bad_format_hook
2320         fop.
2321         (xcoff_backend_data_r) : Use xcoff64_bad_format_hook.
2322         (bfd_xcoff_aix5_backend_data) : New Aix 5 backend data.
2323         (aix5coff64_vec) : New Aix 5 target aix5coff64-rs6000.
2324         * rs6000-core.c : Update copyright date.
2325         * xcofflink.c (bfd_xcoff_size_dynamic_sections): Check for NULL
2326         csectpp.
2327         * coffcode.h (coff_new_section_hook) : Use new accessor macros.
2328         (coff_set_arch_mach_hook) : Add Aix 5 U64_TOCMAGIC magic #.
2329         (coff_set_flags) : Use bfd_xcoff_magic_number.
2330         * libxcoff.h (bfd_xcoff_is_xcoff64): Add U64_TOCMAGIC.
2331         * configure.in : Add powerpc-*-aix5 and rs6000-*-aix5 support.
2332         * Makefile.am : Same.
2333         * config.bfd : Same.
2334         * targets.c : Same.
2335         * configure : Regnerate.
2336         * Makefile.in : Same.
2337         * bfd-in2.h : Same.
2338
2339 2002-03-18  Nick Clifton  <nickc@cambridge.redhat.com>
2340
2341         * po/fr.po: Updated version.
2342
2343 2002-03-18  Alan Modra  <amodra@bigpond.net.au>
2344
2345         * libbfd.c (bfd_write_bigendian_4byte_int): Return true iff success.
2346         * libbfd.h: Regenerate.
2347         * archive.c (coff_write_armap): Pass on failures from
2348         bfd_write_bigendian_4byte_int.
2349
2350 2002-03-14  H.J. Lu <hjl@gnu.org>
2351
2352         * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Set the BFD
2353         error to bfd_error_nonrepresentable_section for reinit_array
2354         section in DSO.
2355
2356 2002-03-14  Nick Clifton  <nickc@cambridge.redhat.com>
2357
2358         * coffcode.h (coff_slurp_symbol_table): When adding BSF_WEAK flag,
2359         OR it in rather than replacing previously selected flags.
2360
2361         * elfxx-target.h (TARGET_BIG_SYM): Set ar_max_namelen to 15.
2362         (TARGET_LITTLE_SYM): Set ar_max_namelen to 15.
2363
2364 2002-03-14  Alan Modra  <amodra@bigpond.net.au>
2365
2366         * cpu-mips.c (mips_compatible): New.  Don't check bits_per_word.
2367         (N): Use the above.
2368         * elflink.h (elf_bfd_final_link): Revert last change.  Instead,
2369         ensure reloc size matches before calling elf_link_input_bfd.
2370         Add an assert to check reloc size when counting output relocs.
2371
2372 2002-03-14  Nick Clifton  <nickc@cambridge.redhat.com>
2373
2374         * mmo.c (mmo_get_loc): Return NULL rather than false.
2375
2376 2002-03-13  Nick Clifton  <nickc@cambridge.redhat.com>
2377
2378         * po/fr.po: Updated version.
2379
2380 2002-03-13  Alan Modra  <amodra@bigpond.net.au>
2381
2382         * archures.c (bfd_default_compatible): Test bits_per_word.
2383         * cpu-i386.c (i386_compatible): Remove.  Replace occurrences with
2384         bfd_default_compatible.
2385         * cpu-i370.c (i370_compatible): Likewise.
2386         * cpu-sparc.c (sparc_compatible): Likewise.
2387         * cpu-h8300.c (compatible): Test in->arch == out->arch.
2388
2389         * elflink.h: Formatting fixes.
2390         (elf_link_output_extsym): Merge undefined and undef weak cases.
2391
2392         * elflink.h (elf_bfd_final_link): Only call elf_link_input_bfd
2393         when word size of input matches output word size.
2394
2395 2002-03-12  Andreas Jaeger  <aj@suse.de>
2396
2397         * cpu-i386.c (i386_compatible): New.  Use it instead of
2398         bfd_default_compatible.
2399
2400 2002-03-07  H.J. Lu  (hjl@gnu.org)
2401
2402         * coff-sh.c (shcoff_reloc_map): Use bfd_reloc_code_real_type
2403         as the type for bfd_reloc_val.
2404
2405 2002-03-05  John David Anglin  <dave@hiauly1.hia.nrc.ca>
2406
2407         * elf-hppa.h (elf_hppa_is_dynamic_loader_symbol): New function.
2408         (elf_hppa_relocate_section): Ignore undefined dynamic loader symbols.
2409         (elf_hppa_final_link_relocate): Correct relocations for indirect
2410         references to local data through the DLT.  Fix .opd creation for
2411         local symbols using R_PARISC_LTOFF_FPTR32 and R_PARISC_FPTR64
2412         relocations.  Use e_lsel selector for R_PARISC_DLTIND21L,
2413         R_PARISC_LTOFF_FPTR21L and R_PARISC_LTOFF_TP21L as per
2414         "Processor-Specific ELF for PA_RISC, Version 1.43" document.
2415         Similarly, use e_rsel for DLT and LTOFF 'R' relocations.
2416         * elf32-hppa.c (final_link_relocate): Revise relocation selectors
2417         as per "Processor-Specific ELF for PA_RISC, Version 1.43" document.
2418
2419 2002-03-05  Jakub Jelinek  <jakub@redhat.com>
2420
2421         * merge.c (_bfd_merge_sections): Don't segfault if there
2422         is nothing to merge due to GC.
2423
2424 2002-03-05  Alan Modra  <amodra@bigpond.net.au>
2425
2426         * elf32-hppa.c (clobber_millicode_symbols): Remove hack to keep
2427         symbols that have been forced local.
2428
2429         * elflink.h (elf_bfd_final_link): Call elf_link_output_extsym
2430         to output forced local syms for non-shared link.
2431         (elf_link_output_extsym): Tweak condition for calling backend
2432         adjust_dynamic_symbol so that previous behaviour is kept.
2433         Whitespace changes throughout file.
2434
2435 2002-03-04  H.J. Lu <hjl@gnu.org>
2436
2437         * elf.c (bfd_section_from_shdr): Handle special sections,
2438         .init_array, .fini_array and .preinit_array.
2439         (elf_fake_sections): Likewise.
2440
2441         * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Create the
2442         DT entry only if the section is in output for .init_array,
2443         .fini_array and .preinit_array. Complain about .preinit_array
2444         section in DSO.
2445         (elf_bfd_final_link): Warn zero size for .init_array,
2446         .fini_array and .preinit_array sections.
2447
2448         * elfxx-ia64.c (elfNN_ia64_section_from_shdr): Remove
2449         SHT_INIT_ARRAY, SHT_FINI_ARRAY and SHT_PREINIT_ARRAY.
2450         (elfNN_ia64_fake_sections): Remove .init_array, .fini_array and
2451         .preinit_array.
2452
2453 2002-03-04  Alan Modra  <amodra@bigpond.net.au>
2454
2455         * configure.in (WIN32LIBADD): Don't eval PICFLAG assignment.
2456         * configure: Regenerate.
2457
2458 2002-03-02  Tom Rix  <trix@redhat.com>
2459
2460         * coff64-rs6000.c (xcoff64_howto_table): Replace howto types with
2461         symbolic equiv.
2462         * coff-rs6000.c (xcoff_howto_table): Same.
2463
2464 2002-03-01  David Mosberger  <davidm@hpl.hp.com>
2465
2466         * elflink.h (size_dynamic_sections): If section named
2467         ".preinit_array" exists, create DT_PREINIT_ARRAY and
2468         DT_PREINIT_ARRAYSZ entries in dynamic table.  Analogously for
2469         ".init_array" and ".fini_array".
2470         (elf_bfd_final_link): Handle DT_PREINIT_ARRAYSZ, DT_INIT_ARRAYSZ,
2471         DT_FINI_ARRAYSZ, DT_PREINIT_ARRAY, DT_INIT_ARRAY, and
2472         DT_FINI_ARRAY.
2473
2474 2002-02-26  Andrew Macleod  <amacleod@cygnus.com>
2475
2476         * elflink.h (elf_bfd_final_link): Don't crash on SHN_UNDEF local
2477         dynsyms.
2478
2479 2002-02-25  Alan Modra  <amodra@bigpond.net.au>
2480
2481         * elf64-hppa.h: Update copyright date.
2482
2483         * elf64-ppc.c (ppc64_elf_check_relocs): Warning fix.
2484         (ppc64_elf_relocate_section): Don't generate power4 style branch
2485         hints for *_BRTAKEN and *_BRNTAKEN relocs.
2486
2487 2002-02-22  Jakub Jelinek  <jakub@redhat.com>
2488
2489         * elf64-sh64.c (sh_elf64_relocate_section): Fix a typo from my
2490         last patch.
2491         * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
2492
2493 2002-02-21  Andreas Jaeger  <aj@suse.de>
2494
2495         * elf64-x86-64.c: Major rework that introduces all recent changes
2496         to the x86-64 backend.  Get a closer match to elf32-i386.
2497         (struct elf64_x86_64_dyn_relocs): Rename from
2498         elf64_x86_64_pcrel_relocs_copied, add additional fields.  Change
2499         all users.
2500         (struct elf64_x86_64_link_hash_table): Add short cuts to some
2501         sections.
2502         (link_hash_newfunc): Rename from elf64_x86_64_link_hash_newfunc,
2503         remove casts, initialize new hash members.
2504         (create_got_section): New.
2505         (elf64_x86_64_create_dynamic_sections): New.
2506         (elf64_x86_64_copy_indirect_symbol): New.
2507         (elf64_x86_64_check_relocs): Don't allocate space for dynamic
2508         relocs, .got or .relgot here but do it in allocate_dynrelocs.
2509         Reference count possible .plt and .got entries.  Don't test input
2510         section SEC_READONLY here to try to avoid copy relocs, and keep
2511         dyn_relocs regardless of ELF_LINK_NON_GOT_REF.  Don't set
2512         DF_TEXTREL here.  Delay setting of variables until needed.  Cache
2513         pointer to "sreloc" section in elf_section_data. Tweak condition
2514         under which .got created.  Report files with bad relocation
2515         section names.
2516         (elf64_x86_64_gc_sweep_hook): Sweep dyn_relocs and local_dynrel.
2517         Reference count possible .plt entries.  Don't deallocate .got and
2518         .relgot space here.
2519         (elf64_x86_64_adjust_dynamic_symbol): Handle nocopyreloc.  Don't
2520         do copy reloc processing for weakdefs.  Remove redundant casts and
2521         aborts.  Delay setting of vars until needed.  Move creation of
2522         dynamic symbols and allocation of .plt and .rela.plt to
2523         allocate_dynrelocs.  Replace BFD_ASSERT with abort.
2524         (WILL_CALL_FINISH_DYNAMIC_SYMBOL): New.
2525         (allocate_dynrelocs): New.
2526         (readonly_dynrelocs): New.
2527         (elf64_x86_64_size_dynamic_sections): Call readonly_dynrelocs.
2528         Allocate space for dyn relocs.  Replace BFD_ASSERT with abort.
2529         Zero out the dynamic allocated content space.
2530         (elf64_x86_64_discard_copies): Removed.
2531         (elf64_x86_64_relocate_section): Make use of dynamic section
2532         short-cuts.  Localise vars, and delay setting.  Better error
2533         reporting, replace BFD_ASSERT with abort.  Check
2534         ELF_LINK_HASH_DEF_DYNAMIC to see if a symbol is not defined in the
2535         regular object file and tread the weak definition as the normal
2536         one.  Don't discard relocs for undefweak or undefined symbols and
2537         check !DEF_REGULAR as well as DEF_DYNAMIC in test for avoided copy
2538         relocs.
2539         (elf64_x86_64_finish_dynamic_symbol): Don't copy relocs for
2540         symbols that have been forced local.  Use same test to decide if
2541         we can use a relative reloc for got as relocate_section.  Expand
2542         SHN_UNDEF comment.  Move expressions out of function calls.
2543         Replace BFD_ASSERT with abort.
2544         (bfd_elf64_bfd_final_link): Removed.
2545         (elf_backend_copy_indirect_symbol): Define.
2546
2547 2002-02-20  Tom Rix  <trix@redhat.com>
2548
2549         * coff-rs6000.c (xcoff_howto_table): Add 16 bit R_BA.
2550         (_bfd_xcoff_reloc_type_lookup): Use it.
2551         * coff64-rs6000.c (xcoff64_howto_table): Same.
2552         (xcoff64_reloc_type_lookup): Same.
2553
2554 2002-02-20  Peter Schauer  <pes@regent.e-technik.tu-muenchen.de>
2555
2556         * osf-core.c (osf_core_vec):  OSF/1 (Digital Unix) core files are
2557         little endian.
2558
2559 2002-02-19  Martin Schwidefsky  <schwidefsky@de.ibm.com>
2560
2561         * archures.c (bfd_mach_s390_esa): Rename to bfd_mach_s390_31.
2562         (bfd_mach_s390_esame): Rename to bfd_mach_s390_64.
2563         * bfd-in2.h: Regenerate.
2564         * cpu-s390.c (arch_info_struct): Use renamed architecture defines.
2565         Replace architecture name "s390" with "s390:31-bit" and "s390:esame"
2566         with "s390:64-bit".
2567         * elf32-s390.c (elf_howto_table): Add 32 bit pc relative relocations.
2568         (elf_s390_reloc_type_lookup): Likewise.
2569         (elf_s390_check_relocs): Likewise.
2570         (elf_s390_gc_sweep_hook): Likewise.
2571         (elf_s390_relocate_section): Likewise.
2572         (elf_s390_object_p): Use renamed architecture define.
2573         * elf64-s390.c (elf_s390_object_p): Use renamed architecture define.
2574
2575 2002-02-19  Frank Ch. Eigler  <fche@redhat.com>
2576
2577         * syms.c (stt[]): Sorted.  Added .init/.fini -> "t" mapping.
2578
2579 2002-02-19  Jakub Jelinek  <jakub@redhat.com>
2580
2581         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Enable
2582         absptr -> pcrel optimization for shared libs.
2583         Only create minimal .eh_frame_hdr if absptr FDE encoding in shared
2584         library cannot be converted to pcrel.
2585         (_bfd_elf_eh_frame_section_offset): Return -2 if making absptr
2586         relative.
2587         * elf32-i386.c (elf_i386_relocate_section): If
2588         _bfd_elf_section_offset returned -2, skip, but make sure the
2589         relocation is installed.
2590         * elf32-arm.h (elf32_arm_final_link_relocate): Likewise.
2591         * elf32-cris.c (cris_elf_relocate_section): Likewise.
2592         * elf32-hppa.c (elf32_hppa_relocate_section): Likewise.
2593         * elf32-i370.c (i370_elf_relocate_section): Likewise.
2594         * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
2595         * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
2596         * elf32-s390.c (elf_s390_relocate_section): Likewise.
2597         * elf32-sh.c (sh_elf_relocate_section): Likewise.
2598         * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
2599         * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
2600         * elf64-s390.c (elf_s390_relocate_section): Likewise.
2601         * elf64-sh64.c (sh_elf64_relocate_section): Likewise.
2602         * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
2603         * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
2604         * elf64-alpha.c (elf64_alpha_relocate_section): Handle
2605         _bfd_elf_section_offset returning -2 the same way as -1.
2606         * elfxx-ia64.c (elfNN_ia64_install_dyn_reloc): Likewise.
2607         * elf32-mips.c (mips_elf_create_dynamic_relocation): Add FIXME
2608         and BFD_ASSERT.
2609         * elf64-mips.c (mips_elf64_create_dynamic_relocation): Likewise.
2610
2611 2002-02-18  Tom Rix  <trix@redhat.com>
2612
2613         * xcofflink.c (bfd_xcoff_link_gernate_rtinit): Add -brtl support.
2614         (bfd_xcoff_size_dynamic_sections): Same.
2615         * bfd-in.h (bfd_xcoff_link_generate_rtinit): Same.
2616         (bfd_xcoff_size_dynamic_sections): Same.
2617         * coff-rs6000.c (xcoff_generate_rtinit): Same.
2618         * coff-rs646000.c (xcoff64_generate_rtinit): Same.
2619         * libxcoff.h (struct xcoff_backend_data_rec): Same.
2620         * xcofflink.c (xcoff_build_ldsyms, xcoff_link_add_symbols): Clean.
2621         * bfd-in2.h: Regenerate.
2622
2623 2002-02-18  Alan Modra  <amodra@bigpond.net.au>
2624
2625         * elf64-ppc.c (STFD_FR0_0R1, LFD_FR0_0R1, BLR): Define.
2626         (struct ppc_link_hash_table): Add sfpr.
2627         (ppc64_elf_link_hash_table_create): Init it.
2628         (ppc64_elf_create_dynamic_sections): Split creation of .stub and
2629         .glink out to..
2630         (create_linkage_sections): ..here.  Make .sfpr too.
2631         (ppc64_elf_check_relocs): Call create_linkage_sections, and set
2632         dynobj early.
2633         (MIN_SAVE_FPR, MAX_SAVE_FPR): Define.
2634         (ppc64_elf_func_desc_adjust): Look for missing ._savef* and
2635         ._restf* functions, and create as needed.
2636         (func_desc_adjust): Only force_local for shared libs.
2637
2638 2002-02-18  David O'Brien  <obrien@FreeBSD.org>
2639
2640         * configure.in: Bump version number post 2.12 branching.
2641         * configure: Regenerate.
2642
2643 2002-02-17  Hans-Peter Nilsson  <hp@bitrange.com>
2644
2645         * mmo.c: Correct and improve comments.
2646         (mmo_write_chunk): Store trailing byte in bfd buffer; don't
2647         zero-pad.  Use input to fill up non-empty bfd buffer.
2648         (mmo_flush_chunk): New function.
2649         (mmo_write_loc_chunk): Add parameter last_vmap, all callers
2650         changed.  Don't emit location specifier if VMA is same as
2651         *LAST_VMAP after omitting leading zero contents.  Call
2652         mmo_flush_chunk before emitting location specifier.
2653         (mmo_write_loc_chunk_list): Call mmo_flush_chunk when finished
2654         with mmo_write_loc_chunk calls.
2655         (mmo_internal_write_section): Call mmo_flush_chunk after
2656         mmo_write_chunk.
2657         (mmo_write_symbols_and_terminator): Move :Main to first position
2658         in symbol array.  Add faked one if it does not exist if there are
2659         other symbols.  Don't add it if there are no symbols at all.  Move
2660         out test for value of :Main from symbol loop.  Rename table
2661         fakemain to maintable and variable mainsym to fakemain.
2662
2663 2002-02-15  Richard Henderson  <rth@redhat.com>
2664
2665         * elf64-alpha.c (elf64_alpha_relocate_section) [BRSGP]: A target
2666         section with no got matches any got.  Simplify error generaion.
2667
2668 2002-02-15  Alan Modra  <amodra@bigpond.net.au>
2669
2670         Support arbitrary length fill patterns.
2671         * linker.c (bfd_new_link_order): Zero all fields with bfd_zalloc.
2672         (_bfd_default_link_order): Remove bfd_fill_link_order code.
2673         Call default_data_link_order.
2674         (default_fill_link_order): Delete.
2675         (default_data_link_order): New function.
2676         * elf32-mips.c (_bfd_mips_elf_final_link): Replace occurrences
2677         of bfd_fill_link_order with bfd_data_link_order.
2678         * elf64-alpha.c (elf64_alpha_final_link): Likewise.
2679         * elf64-mips.c (mips_elf64_final_link): Likewise.
2680
2681         * bfd.c (bfd_scan_vma): Clamp overflows to max bfd_vma value.
2682         Correct value returned in "end" for "0x<non-hex>".
2683
2684 2002-02-14  Nick Clifton  <nickc@cambridge.redhat.com>
2685
2686         * cpu-arm.c (processors): Replace 'arch' field with 'mach'.
2687         (scan): Test against 'mach' field in info structure.
2688
2689 2002-02-14  Alan Modra  <amodra@bigpond.net.au>
2690
2691         * elf.c (elf_fake_sections): Use SHT_NOBITS when SEC_NEVER_LOAD.
2692
2693 2002-02-14  Matt Fredette  <fredette@netbsd.org>
2694
2695         * elf32-m68k.c (elf32_m68k_print_private_bfd_data): Recognize
2696         EF_M68000.
2697
2698 2002-02-13  Nick Clifton  <nickc@cambridge.redhat.com>
2699
2700         * elf.c (_bfd_elf_make_section_from_shdr): Do not insist on
2701         non-zero physical addresses when adjusting the LMAs of new
2702         sections.
2703
2704 2002-02-12  John David Anglin  <dave@hiauly1.hia.nrc.ca>
2705
2706         * elf-hppa.h (elf_hppa_reloc_final_type): New function stripped
2707         from _bfd_elf_hppa_gen_reloc_type.
2708         (_bfd_elf_hppa_gen_reloc_type): Remove duplicate prototype.
2709         * elf32-hppa.h (elf32_hppa_reloc_final_type): Add protptype.
2710         * elf32-hppa.c: Include elf32-hppa.h before elf-hppa.h.
2711         * elf64-hppa.h (elf64_hppa_reloc_final_type): Add protptype.
2712
2713 2002-02-12  Alexandre Oliva  <aoliva@redhat.com>
2714
2715         * elf-m10300.c (mn10300_elf_relax_section): Skip section before
2716         loading its contents if there's nothing to do in it.
2717
2718 2002-02-12  Alan Modra  <amodra@bigpond.net.au>
2719
2720         * elf64-ppc.c (ppc64_elf_size_stubs): Correct test for crossing
2721         64k boundary.
2722
2723         * elf64-ppc.c (ppc64_elf_size_dynamic_sections): Add dynamic
2724         DT_PPC64_OPD and DT_PPC64_OPDSZ tags.
2725         (ppc64_elf_finish_dynamic_sections): Set values for them.
2726
2727 2002-02-11  Michael Snyder  <msnyder@redhat.com>
2728
2729         * elf-bfd.h (elfcore_write_lwpstatus): Add prototype.
2730         * elf.c (elfcore_grok_pstatus): Add prototype.
2731         (elfcore_grok_lwpstatus): Add prototype.
2732         (elfcore_write_lwpstatus): New function.
2733         (elfcore_write_pstatus): Fix typo, eliminate unnecessary memcpy.
2734
2735 2002-02-11  Alexandre Oliva  <aoliva@redhat.com>
2736
2737         * elf32-sh.c: Added missing prototypes.
2738         * elf32-sh64.c: Likewise.
2739         (sh_elf_align_loads): Mark unused args as such.
2740         * elf64-sh64.c: Added missing prototypes.
2741         (struct elf_sh64_link_hash_entry): Fix typo.
2742         (sh_elf64_relocate_section): Fix info argument passed to
2743         _bfd_elf_section_offset.
2744
2745 2002-02-11  Alan Modra  <amodra@bigpond.net.au>
2746
2747         * Makefile.am: "make dep-am".
2748         * Makefile.in: Regenerate.
2749         * aclocal.m4: Regenerate.
2750         * config.in: Regenerate.
2751         * configure: Regenerate.
2752
2753 2002-02-10  Daniel Jacobowitz  <drow@mvista.com>
2754
2755         * coff-rs6000.c (xcoff_generate_rtinit): Silence uninitialized
2756         variable warnings.
2757         * elf32-sh.c (sh_elf_relax_section): Silence signed/unsigned
2758         comparison warning.
2759         * trad-core.c (trad_unix_core_file_p): Silence pointer/integer
2760         cast warnings for the common case.
2761
2762 2002-02-10  Hans-Peter Nilsson  <hp@bitrange.com>
2763
2764         * config.bfd (sh-*-linux*, sh-*-elf* | sh-*-rtemself*): Add sh64
2765         vectors.
2766         (sh-*-netbsdelf*): New, to trump sh*-*-netbsdelf* and add sh64
2767         vectors.
2768
2769 2002-02-09  Richard Henderson  <rth@redhat.com>
2770
2771         * elf64-alpha.c (elf64_alpha_howto): Add R_ALPHA_BRSGP.
2772         (elf64_alpha_reloc_map, elf64_alpha_check_relocs): Likewise.
2773         (elf64_alpha_relocate_section): Likewise.
2774         * reloc.c (BFD_RELOC_ALPHA_BRSGP): New.
2775         * bfd-in2.h, libbfd.h: Rebuild.
2776
2777 2002-02-09  Hans-Peter Nilsson  <hp@bitrange.com>
2778
2779         * elf64-mmix.c (_bfd_mmix_finalize_linker_allocated_gregs): Check
2780         that base-plus-offset reloc accounting is consistent.
2781         (mmix_elf_relax_section): Keep base-plus-offset reloc accounting
2782         up to date for undefined symbols.
2783
2784 2002-02-08  Eric Christopher  <echristo@redhat.com>
2785
2786         From Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
2787
2788         * elf32-mips.c (_bfd_mips_elf_fake_sections): Don't create .rela
2789         sections for the O32 ABI.
2790
2791 2002-02-08  Chris Demetriou  <cgd@broadcom.com>
2792
2793         * elf32-arm.h: Fix formatting of _("...").
2794         * elf32-d10v.c: Likewise.
2795         * elf32-m68k.c: Likewise.
2796         * elf32-mips.c: Likewise.
2797
2798 2002-02-08  Ivan Guzvinec <ivang@opencores.org>
2799
2800         * coff-or32.c: Fix compile time warning messages.
2801
2802 2002-02-08  Alexandre Oliva  <aoliva@redhat.com>
2803
2804         Contribute sh64-elf.
2805         2002-01-23  Alexandre Oliva  <aoliva@redhat.com>
2806         * reloc.c (R_SH_GOTPLT32, R_SH_GOT_LOW16, R_SH_GOT_MEDLOW16,
2807         R_SH_GOT_MEDHI16, R_SH_GOT_HI16, R_SH_GOTPLT_LOW16,
2808         R_SH_GOTPLT_MEDLOW16, R_SH_GOTPLT_MEDHI16, R_SH_GOTPLT_HI16,
2809         R_SH_PLT_LOW16, R_SH_PLT_MEDLOW16, R_SH_PLT_MEDHI16,
2810         R_SH_PLT_HI16, R_SH_GOTOFF_LOW16, R_SH_GOTOFF_MEDLOW16,
2811         R_SH_GOTOFF_MEDHI16, R_SH_GOTOFF_HI16, R_SH_GOTPC_LOW16,
2812         R_SH_GOTPC_MEDLOW16, R_SH_GOTPC_MEDHI16, R_SH_GOTPC_HI16,
2813         R_SH_GOT10BY4, R_SH_GOTPLT10BY4, R_SH_GOT10BY8, R_SH_GOTPLT10BY8,
2814         R_SH_COPY64, R_SH_GLOB_DAT64, R_SH_JMP_SLOT64, R_SH_RELATIVE64):
2815         New relocs.
2816         * libbfd.h, bfd-in2.h: Rebuilt.
2817         * elf32-sh.c (sh_elf_howto_table): Define new relocs.
2818         (sh_reloc_map): Map them.
2819         (PLT_ENTRY_SIZE, elf_sh_plt0_entry_be, elf_sh_plt0_entry_le,
2820         elf_sh_plt_entry_be, elf_sh_plt_entry_le, elf_sh_pic_plt_entry_be,
2821         elf_sh_pic_plt_entry_le, elf_sh_plt0_entry, elf_sh_plt_entry,
2822         elf_sh_pic_plt_entry, elf_sh_sizeof_plt, elf_sh_plt_plt0_offset,
2823         elf_sh_plt0_gotplt_offset, elf_sh_plt_temp_offset,
2824         elf_sh_plt_symbol_offset, elf_sh_plt_reloc_offset,
2825         movi_shori_putval) [INCLUDE_SHMEDIA]: New.
2826         (elf_sh_link_hash_entry) [INCLUDE_SHMEDIA]: Add
2827         datalabel_got_offset.
2828         (sh_elf_link_hash_newfunc): Initialize it.
2829         (sh_elf_relocate_section): Augment the scope of
2830         seen_stt_datalabel.  Introduce GOTPLT support.  Extend GOTPC, PLT,
2831         GOT and GOTOFF handling to new SHmedia relocation types.  Support
2832         GOT_BIAS.
2833         (sh_elf_check_relocs): Likewise.
2834         (sh_elf_finish_dynamic_symbol) [TARGET_SHMEDIA]: Set up values in
2835         PLT entries using movi_shori_putval.  Support GOT_BIAS.
2836         (sh_elf_finish_dynamic_sections): Likewise.
2837         * elf32-sh64.c (shmedia_prepare_reloc): Do not add addend to
2838         relocation, it's now done by the caller.
2839         (GOT_BIAS): New.
2840         * elf64-sh64.c (GOT_BIAS, PLT_ENTRY_SIZE, elf_sh64_sizeof_plt,
2841         elf_sh64_plt_plt0_offset, elf_sh64_plt0_gotplt_offset,
2842         elf_sh64_plt_temp_offset, elf_sh64_plt_symbol_offset,
2843         elf_sh64_plt_reloc_offset, ELF_DYNAMIC_INTERPRETER,
2844         elf_sh64_pcrel_relocs_copied, elf_sh64_link_hash_entry,
2845         elf_sh64_link_hash_table, sh64_elf64_link_hash_traverse,
2846         sh64_elf64_hash_table): New.
2847         (sh_elf64_howto_table): Introduce new relocs.
2848         (sh_elf64_info_to_howto): Accept new PIC relocs.
2849         (sh_elf64_relocate_section): Augment the scope of
2850         seen_stt_datalabel.  Support new PIC relocs.
2851         (sh_elf64_check_relocs): Support new PIC relocs.
2852         (elf_sh64_plt0_entry_be, elf_sh64_plt0_entry_le,
2853         elf_sh64_plt_entry_be, elf_sh64_plt_entry_le,
2854         elf_sh64_pic_plt_entry_be, elf_sh64_pic_plt_entry_le,
2855         elf_sh64_plt0_entry, elf_sh64_plt_entry, elf_sh64_pic_plt_entry,
2856         sh64_elf64_link_hash_newfunc, sh64_elf64_link_hash_table_create,
2857         movi_shori_putval, movi_3shori_putval,
2858         sh64_elf64_create_dynamic_sections,
2859         sh64_elf64_adjust_dynamic_symbol, sh64_elf64_discard_copies,
2860         sh64_elf64_size_dynamic_sections,
2861         sh64_elf64_finish_dynamic_symbol,
2862         sh64_elf64_finish_dynamic_sections): New.
2863         (elf_backend_create_dynamic-sections,
2864         bfd_elf64_bfd_link_hash_table_create,
2865         elf_backend_adjust_dynamic_symbol,
2866         elf_backend_size_dynamic_sections,
2867         elf_backend_finish_dynamic_symbol,
2868         elf_backend_finish_dynamic_sections, elf_backend_want_got_plt,
2869         elf_backend_plt_readonly, elf_backend_want_plt_sym,
2870         elf_backend_got_header_size, elf_backend_plt_header_size):
2871         Define.
2872         2001-05-16  Alexandre Oliva  <aoliva@redhat.com>
2873         * elf32-sh.c: Renumbered and renamed some SH5 relocations to
2874         match official numbers and names; moved unmaching ones to the
2875         range 0xf2-0xff.
2876         * elf32-sh64.c, elf64-sh64.c: Likewise.
2877         2001-03-12  DJ Delorie  <dj@redhat.com>
2878         * elf32-sh.c (sh_elf_relax_section): Don't relax SHmedia
2879         sections.
2880         2001-03-12  DJ Delorie  <dj@redhat.com>
2881         * elf32-sh64.c (shmedia_prepare_reloc): Validate relocs that must
2882         be aligned.
2883         * elf64-sh64.c (sh_elf64_relocate_section): Ditto.
2884         2001-01-14  Hans-Peter Nilsson  <hpn@cygnus.com>
2885         * elf32-sh64.c (bfd_elf32_bfd_copy_private_section_data): Define.
2886         (sh64_elf_fake_sections): Set type to SHT_SH5_CR_SORTED for a
2887         .cranges section with SEC_SORT_ENTRIES set.
2888         (sh64_backend_section_from_shdr): Set SEC_SORT_ENTRIES on an
2889         incoming sorted .cranges section.
2890         (sh64_bfd_elf_copy_private_section_data): New.
2891         (sh64_elf_final_write_processing): Only sort .cranges and modify
2892         start address if called by linker.
2893         2001-01-08  Ben Elliston  <bje@redhat.com>
2894         * elf32-sh64.c (sh64_elf_final_write_processing): Activate
2895         Hans-Peter Nilsson's set bit 0 patch from       2001-01-06.
2896         * elf64-sh64.c (sh64_elf64_final_write_processing): Ditto.
2897         2001-01-06  Hans-Peter Nilsson  <hpn@cygnus.com>
2898         * elf64-sh64.c (sh_elf64_howto_table): No open brace at start of
2899         line.  Add comments before all entries.
2900         <R_SH_PT_16, R_SH_SHMEDIA_CODE>: Correct and clarify describing
2901         comment.
2902         (sh_elf64_reloc): Correct head comment.
2903         (sh_elf64_relocate_section): Correct spacing.
2904         <relocating for a local symbol>: Do not honour STO_SH5_ISA32;
2905         instead call reloc_dangerous callback.
2906         <case R_SH_SHMEDIA_CODE>: New case.
2907         (sh_elf64_gc_mark_hook): Correct spacing.
2908         (sh_elf64_check_relocs): Ditto.
2909         * elf32-sh64.c (shmedia_prepare_reloc) <case R_SH_SHMEDIA_CODE>:
2910         New case.
2911         * elf32-sh.c: Correct #endif comments for #ifndef-wrapped
2912         functions.
2913         (sh_elf_howto_table) <R_SH_PT_16, R_SH_SHMEDIA_CODE>: Correct,
2914         clarify describing comment.  Add comments before all entries.
2915         (sh_elf_relocate_section) <relocating for a local symbol>: Do not
2916         honour STO_SH5_ISA32; instead call reloc_dangerous callback.
2917         2001-01-06  Hans-Peter Nilsson  <hpn@cygnus.com>
2918         Sort .cranges section in final link.  Prepare to set bit 0 on
2919         entry address.
2920         * elf32-sh64.c (struct sh64_find_section_vma_data): New.
2921         (sh64_elf_link_output_symbol_hook): Fix typo in prototype.
2922         (sh64_elf_set_mach_from_flags): Set SEC_DEBUGGING on incoming
2923         .cranges section.
2924         (sh64_backend_section_from_shdr): New, to recognize
2925         SHT_SH5_CR_SORTED on incoming .cranges section.
2926         (elf_backend_section_from_shdr): Define.
2927         (sh64_elf_final_write_processing): Sort outgoing .cranges
2928         section.  (New, temporarily disabled:) Set bit 0 on entry address
2929         according to ISA type.
2930         (sh64_find_section_for_address): New.
2931         (crange_qsort_cmpb, crange_qsort_cmpl, crange_bsearch_cmpb,
2932         crange_bsearch_cmpl): Move here from opcodes/sh64-dis.c.
2933         (sh64_address_in_cranges): Move here from opcodes/sh64-dis.c.  Use
2934         bfd_malloc, not xmalloc.
2935         (sh64_get_contents_type): Move here from opcodes/sh64-dis.c.  Make
2936         global.
2937         * elf32-sh64.c (sh64_elf64_final_write_processing): New, (but
2938         temporarily disabled) setting bit 0 on entry address.
2939         (elf_backend_final_write_processing): Define.
2940         2001-01-05  Hans-Peter Nilsson  <hpn@cygnus.com>
2941         * elf32-sh.c (sh_elf_howto_table) <R_SH_PT_16>: Adjust fields to
2942         be a proper relocation for PTA and PTB rather than a marker.
2943         <R_SH_IMMU5, R_SH_IMMS6, R_SH_IMMU6, R_SH_IMMS10, R_SH_IMMS10BY2,
2944         R_SH_IMMS10BY4, R_SH_IMMS10BY8, R_SH_IMMS16, R_SH_IMMU16,
2945         R_SH_IMM_LOW16, R_SH_IMM_LOW16_PCREL, R_SH_IMM_MEDLOW16,
2946         R_SH_IMM_MEDLOW16_PCREL, R_SH_IMM_MEDHI16, R_SH_IMM_MEDHI16_PCREL,
2947         R_SH_IMM_HI16, R_SH_IMM_HI16_PCREL, R_SH_64, R_SH_64_PCREL>:
2948         Zero src_mask.
2949         * elf64-sh64.c: Ditto.
2950         (sh_elf64_relocate_section) <case R_SH_PT_16>: New case.
2951         * elf32-sh64.c: Include opcodes/sh64-opc.h
2952         (shmedia_prepare_reloc): Take a bfd_link_info pointer as first
2953         argument.  Drop const qualifiers from "bfd *" and "bfd_byte *"
2954         parameters.  No unused parameters.  Caller changed.
2955         <case R_SH_PT_16>: New case.
2956         * Makefile.am (elf32-sh64.lo): Add dependency on sh64-opc.h.
2957         * Makefile.in: Regenerate.
2958         2000-12-30  Hans-Peter Nilsson  <hpn@cygnus.com>
2959         * elf64-sh64.c (sh64_elf64_fake_sections): Set SHF_SH5_ISA32 for
2960         all code sections.
2961         (sh_elf64_set_mach_from_flags): Change from EF_SH64 to EF_SH5.
2962         (sh64_elf_merge_private_data): Ditto.
2963         * elf32-sh64.c (sh64_elf_fake_sections): Use sh64_elf_section_data
2964         to access stored section flags.
2965         (sh64_elf_final_write_processing): Return immediately unless
2966         called by linker.  Use sh64_elf_section_data (cranges) to get size
2967         of linker-generated cranges entries.
2968         (sh64_elf_copy_private_data): Add missing "return true".
2969         (sh64_elf_set_mach_from_flags): Change from EF_SH64 to EF_SH5.
2970         (sh_elf64_merge_private_data): Ditto.
2971         2000-12-19  Hans-Peter Nilsson  <hpn@cygnus.com>
2972         * elf64-sh64.c (sh64_elf64_fake_sections): New, copy of
2973         elf64-sh64.c:sh64_elf_fake_sections.
2974         (elf_backend_fake_sections): Define as sh64_elf64_fake_sections.
2975         2000-12-18  Hans-Peter Nilsson  <hpn@cygnus.com>
2976         * elf32-sh64.c (sh64_elf_copy_private_data_internal): Delete.
2977         (sh64_elf_final_write_processing): New.
2978         (elf_backend_final_write_processing): Define.
2979         (sh64_elf_fake_sections): Get header flags from tdata field.
2980         (sh64_elf_copy_private_data): Do not call
2981         sh64_elf_copy_private_data_internal, just copy e_flags field.
2982         (sh64_elf_merge_private_data): Do not call
2983         sh64_elf_copy_private_data_internal.
2984         2000-12-12  Hans-Peter Nilsson  <hpn@cygnus.com>
2985         Remove EF_SH64_ABI64, let ELF size make difference.
2986         Remove SH64-specific BFD section flag.
2987         * elf32-sh64.c (sh64_elf_fake_sections): Recognize section as
2988         containing SHmedia through elf_section_data (asect)->tdata
2989         non-zero, not using a BFD section flag.
2990         (sh64_elf_set_mach_from_flags): Don't recognize EF_SH64_ABI64.
2991         (sh64_elf_merge_private_data): Similar.
2992         (elf_backend_section_flags): Don't define.
2993         (sh64_elf_backend_section_flags): Delete.
2994         * elf64-sh64.c (sh_elf64_set_mach_from_flags): Recognize EF_SH64,
2995         not EF_SH64_ABI64.
2996         (sh_elf64_merge_private_data): Similar.
2997         * section.c (Section flags definitions): Don't define
2998         SEC_SH_ISA_SHMEDIA.
2999         (bfd-in2.h): Regenerate.
3000         2000-12-09  Hans-Peter Nilsson  <hpn@cygnus.com>
3001         Make DataLabel references work with partial linking.
3002         * elf32-sh64.c: Fix formatting.
3003         (sh64_elf_link_output_symbol_hook): New.
3004         (elf_backend_link_output_symbol_hook): Define to
3005         sh64_elf_link_output_symbol_hook.
3006         (sh64_elf_add_symbol_hook): Make DataLabel symbol just global
3007         undefined if partial linking.  Adjust sanity check.
3008         * elf64-sh64.c (sh64_elf64_link_output_symbol_hook): New.
3009         (elf_backend_link_output_symbol_hook): Define to
3010         sh64_elf64_link_output_symbol_hook.
3011         (sh64_elf64_add_symbol_hook): Make DataLabel symbol just global
3012         undefined if partial linking.  Adjust sanity check.
3013         2000-12-07  Hans-Peter Nilsson  <hpn@cygnus.com>
3014         Implement semantics for inter-file DataLabel references.
3015         * elf64-sh64.c (DATALABEL_SUFFIX): Define.
3016         (sh64_elf64_add_symbol_hook): New.
3017         (sh_elf64_relocate_section): If passing an indirect symbol with
3018         st_type STT_DATALABEL on the way to a symbol with st_other
3019         STO_SH5_ISA32, do not bitor 1 to the relocation.
3020         (elf_backend_add_symbol_hook): Define to
3021         sh64_elf64_add_symbol_hook.
3022         * elf64-sh32.c: Tweak comments.
3023         (DATALABEL_SUFFIX): Define.
3024         (sh64_elf_add_symbol_hook): New.
3025         (elf_backend_add_symbol_hook): Define to sh64_elf_add_symbol_hook.
3026         * elf32-sh.c (sh_elf_relocate_section): If passing an indirect
3027         symbol with st_type STT_DATALABEL on the way to a symbol with
3028         st_other STO_SH5_ISA32, do not bitor 1 to the relocation.
3029         2000-12-05  Hans-Peter Nilsson  <hpn@cygnus.com>
3030         Pass through STT_DATALABEL.
3031         * elf32-sh64.c (sh64_elf_get_symbol_type): New.
3032         (elf_backend_get_symbol_type): Define.
3033         * elf64-sh64.c (sh64_elf64_get_symbol_type): New.
3034         (elf_backend_get_symbol_type): Define.
3035         2000-11-30  Hans-Peter Nilsson  <hpn@cygnus.com>
3036         * elf32-sh64.c: Tweak comments.
3037         (sh64_elf_copy_private_data_internal): Add prototype.
3038         (bfd_elf32_bfd_set_private_flags): Define.
3039         (sh64_elf_copy_private_data_internal): Compare machine name, not
3040         textual BFD target name, to check whether to copy section flag
3041         SHF_SH5_ISA32.
3042         (sh64_elf_merge_private_data): Validize bfd_get_arch_size.
3043         Tweak section-contents-type-mismatch message.
3044         (shmedia_prepare_reloc): Add ATTRIBUTE_UNUSED markers.
3045         Validize reloc-types.
3046         * elf64-sh64.c: New file.
3047         * targets.c (bfd_elf64_sh64_vec, bfd_elf64_sh64l_vec): Declare.
3048         * Makefile.am (BFD64_BACKENDS): Add elf64-sh64.lo.
3049         (BFD64_BACKENDS_CFILES): Add elf64-sh64.c.
3050         Regenerate dependencies.
3051         * Makefile.in: Regenerate.
3052         * config.bfd (sh64-*-elf*): Add bfd_elf64_sh64_vec and
3053         bfd_elf64_sh64l_vec.
3054         * configure.in: Handle bfd_elf64_sh64_vec and
3055         bfd_elf64_sh64l_vec.
3056         * configure: Regenerate.
3057         * po/POTFILES.in: Regenerate.
3058         * po/bfd.pot: Regenerate.
3059         2000-11-29  Hans-Peter Nilsson  <hpn@cygnus.com>
3060         * elf32-sh64.c (sh64_elf_set_mach_from_flags): Do not recognize
3061         anything else but EF_SH64 and EF_SH64_ABI64.
3062         (sh64_elf_merge_private_data): Emit error for anything else but
3063         EF_SH64 and EF_SH64_ABI64.
3064         * config.bfd: Remove bfd_elf32_shblin_vec and bfd_elf32_shlin_vec
3065         from targ_selvecs.
3066         * configure.in: Add cofflink.lo to bfd_elf32_sh64_vec and
3067         bfd_elf32_sh64l_vec as a temporary measure.
3068         * configure: Regenerate.
3069         2000-11-27  Hans-Peter Nilsson  <hpn@cygnus.com>
3070         * cpu-sh.c (arch_info_struct): Include sh5 item
3071         unconditionalized.
3072         * config.bfd (sh64-*-elf*): Do not set targ_cflags.
3073         Add targ_selvecs bfd_elf32_sh_vec, bfd_elf32_shl_vec,
3074         bfd_elf32_shblin_vec and bfd_elf32_shlin_vec.
3075         * elf32-sh64.c: Tweak comments.
3076         (sh64_elf_set_mach_from_flags): Recognize all machine flags that
3077         are proper subsets of SH64 as bfd_mach_sh5.  Add EF_SH64_ABI64.
3078         (sh64_elf_copy_private_data_internal): Wrap long line.
3079         (sh64_elf_merge_private_data): Rewrite to allow objects from
3080         SH64 subsets to be linked together.
3081         (INCLUDE_SHMEDIA): Define.
3082         * elf32-sh.c (sh_elf_relocate_section) <local symbol>:
3083         Parenthesize plus-expression inside or-expression.
3084         <global symbol>: Ditto.
3085         (sh_elf_set_mach_from_flags): Remove code refusing
3086         deleted EF_SH64_32BIT_ABI flag.
3087         2000-11-26  Hans-Peter Nilsson  <hpn@cygnus.com>
3088         * elf32-sh.c (sh_elf_howto_table) <R_SH_IMM_LOW16_PCREL,
3089         R_SH_IMM_MEDLOW16_PCREL, R_SH_IMM_MEDHI16_PCREL,
3090         R_SH_IMM_HI16_PCREL, R_SH_64_PCREL>: Set pcrel_offset to true.
3091         (sh_elf_relocate_section) <local symbol>: Or 1 in
3092         calculation of relocation if sym->st_other & STO_SH5_ISA32.
3093         <global symbol>: Ditto if h->other & STO_SH5_ISA32.
3094         * elf32-sh64.c (shmedia_prepare_reloc): Add rel->r_addend to
3095         relocation.
3096         2000-11-24  Hans-Peter Nilsson  <hpn@cygnus.com>
3097         * Makefile.am (BFD32_BACKENDS): Add elf32-sh64.lo.
3098         (BFD32_BACKENDS_CFILES): Add elf32-sh64.c.
3099         Regenerate dependencies.
3100         * Makefile.in: Regenerate.
3101         * archures.c: Add bfd_mach_sh5.
3102         * config.bfd: Map targ_cpu sh* to bfd_sh_arch.
3103         Handle sh64-*-elf*.  Set targ_cflags to -DINCLUDE_SHMEDIA.
3104         * configure.in: Handle bfd_elf32_sh64_vec and bfd_elf32_sh64l_vec.
3105         * configure: Regenerate.
3106         * reloc.c (BFD_RELOC_SH_SHMEDIA_CODE, BFD_RELOC_SH_IMMU5,
3107         BFD_RELOC_SH_IMMS6, BFD_RELOC_SH_IMMS6BY32, BFD_RELOC_SH_IMMU6,
3108         BFD_RELOC_SH_IMMS10, BFD_RELOC_SH_IMMS10BY2,
3109         BFD_RELOC_SH_IMMS10BY4, BFD_RELOC_SH_IMMS10BY8,
3110         BFD_RELOC_SH_IMMS16, BFD_RELOC_SH_IMMU16, BFD_RELOC_SH_IMM_LOW16,
3111         BFD_RELOC_SH_IMM_LOW16_PCREL, BFD_RELOC_SH_IMM_MEDLOW16,
3112         BFD_RELOC_SH_IMM_MEDLOW16_PCREL, BFD_RELOC_SH_IMM_MEDHI16,
3113         BFD_RELOC_SH_IMM_MEDHI16_PCREL, BFD_RELOC_SH_IMM_HI16,
3114         BFD_RELOC_SH_IMM_HI16_PCREL, BFD_RELOC_SH_PT_16): New relocations.
3115         * cpu-sh.c [INCLUDE_SHMEDIA] (arch_info_struct): Define and link
3116         in item for SH5.
3117         * elf32-sh.c [INCLUDE_SHMEDIA] (sh_elf_howto_table): Add howto items
3118         for SHmedia relocs.
3119         [INCLUDE_SHMEDIA] (sh_rel): Add mappings for SHmedia relocs.
3120         [INCLUDE_SHMEDIA] (sh_elf_relocate_section) [default]: Call
3121         shmedia_prepare_reloc, goto final_link_relocate if it returns
3122         non-zero, else fail as before.
3123         (sh_elf_set_mach_from_flags): Provide function only if not defined
3124         as macro.  Do not recognize objects with EF_SH64_32BIT_ABI set.
3125         (sh_elf_set_private_flags): Provide function only if not defined
3126         as a macro.
3127         (sh_elf_copy_private_data): Similar.
3128         (sh_elf_merge_private_data): Similar.
3129         * section.c (SEC_SH_ISA_SHMEDIA): New.
3130         * targets.c (bfd_elf32_sh64_vec, bfd_elf32_sh64l_vec): Declare.
3131         * elf32-sh64.c: New file.
3132         * libbfd.h: Regenerate.
3133         * bfd-in2.h: Regenerate.
3134         * po/POTFILES.in: Regenerate.
3135         * po/bfd.pot: Regenerate.
3136         * bfd-in2.h: Regenerate.
3137         * libbfd.h: Regenerate.
3138
3139 2002-02-07  Daniel Jacobowitz  <drow@mvista.com>
3140
3141         * bfd-in.h: Update <stdbool.h> check to only see if <stdbool.h> has
3142         been included, not drag it in.
3143         * bfd-in2.h: Regenerate.
3144
3145 2002-02-06  H.J. Lu  (hjl@gnu.org)
3146
3147         * elf32-mips.c (_bfd_mips_elf_merge_private_bfd_data): Update
3148         the mach and ISA fields if necessary.
3149
3150 2002-02-06  Nick Clifton  <nickc@cambridge.redhat.com>
3151
3152         * coffcode.h (coff_set_arch_mach_hook): Select the highest known
3153         ARM architecture when an F_ARM_5 flag is detected, since we cannot
3154         be sure exactly which architecture this represents.
3155
3156 2002-02-05  Nick Clifton  <nickc@redhat.com>
3157
3158         * po/tr.po: Updated translation.
3159
3160 2002-02-05  Alan Modra  <amodra@bigpond.net.au>
3161
3162         From Jimi X <jimix@watson.ibm.com>
3163         * archures (bfd_mach_ppc64): Define.
3164         (bfd_powerpc_arch): Rename to bfd_powerpc_archs.
3165         (bfd_powerpc_arch): Define.
3166         * bfd-in2.h: Regenerate.
3167         * cpu-powerpc.c (arch_info_struct): Rename to bfd_powerpc_archs.
3168         (bfd_powerpc_arch): Move to tail of bfd_powerpc_archs.
3169         (bfd_powerpc_archs): Add default powerpc64 arch.
3170
3171 2002-02-05  Alan Modra  <amodra@bigpond.net.au>
3172
3173         * elf64-ppc.c (ppc64_elf_size_dynamic_sections): Check for relocs
3174         against section syms in readonly sections.  Don't do the global
3175         sym check if we find one.
3176         * elf64-s390.c (elf_s390_size_dynamic_sections): Likewise.
3177         * elf32-hppa.c (elf32_hppa_size_dynamic_sections): Likewise.
3178         * elf32-i386.c (elf_i386_size_dynamic_sections): Likewise.
3179         * elf32-s390.c (elf_s390_size_dynamic_sections): Likewise.
3180         (elf_s390_grok_prstatus): Add missing prototype.
3181
3182 2002-02-04  Hans-Peter Nilsson  <hp@bitrange.com>
3183
3184         * elf64-mmix.c (mmix_dump_bpo_gregs): New function.
3185         (mmix_elf_check_common_relocs) <case R_MMIX_BASE_PLUS_OFFSET>:
3186         Call bfd_get_section_by_name only once.  Initialize
3187         bpodata->n_bpo_relocs_this_section.
3188         (_bfd_mmix_prepare_linker_allocated_gregs): Remove comment
3189         referring to DSOs.
3190         (bpo_reloc_request_sort_fn): Don't use difference of values as
3191         return-value.
3192
3193 2002-02-02  David O'Brien  <obrien@FreeBSD>
3194
3195         * configure.in: Tweak the FreeBSD 4.x recognition more.  Only treat
3196         version 4.5 and later the same as 5-CURRENT.
3197         * configure: Re-generate.
3198
3199 2002-02-02  Jason Thorpe  <thorpej@wasabisystems.com>
3200
3201         * config.bfd (hppa*-*-netbsd*): New target.
3202
3203 2002-01-31  Philipp Thomas  <pthomas@suse.de>
3204
3205         * coff-arm.c (coff_arm_merge_private_bfd_data): Move ERROR
3206         to front of message. Unify messages with elf32-arm.h. Use
3207         commas where neccessary.
3208         * elf32-arm.h (elf32_arm_merge_private_bfd_data): Use all upcase
3209         ERROR in messages. Unify messages with coff-arm.c. Correct
3210         VFP/FPA error message.
3211         (elf32_arm_print_private_bfd_data): Don't mark APCS-26 and
3212         APCS-32 for translation.
3213
3214 2002-02-01  Hans-Peter Nilsson  <hp@bitrange.com>
3215
3216         Perform on-demand global register allocation from
3217         R_MMIX_BASE_PLUS_OFFSET relocs.
3218         * elf64-mmix.c (struct bpo_reloc_section_info, struct
3219         bpo_reloc_request, struct bpo_greg_section_info): New.
3220         (mmix_elf_check_common_relocs, mmix_elf_gc_sweep_hook,
3221         bpo_reloc_request_sort_fn, mmix_elf_relax_section,
3222         _bfd_mmix_check_all_relocs,
3223         _bfd_mmix_prepare_linker_allocated_gregs,
3224         _bfd_mmix_finalize_linker_allocated_gregs): New functions.
3225         (elf_mmix_howto_table): Correct src_mask for most relocs.
3226         (mmix_elf_perform_relocation) <case R_MMIX_BASE_PLUS_OFFSET>: New
3227         case.
3228         (mmix_final_link_relocate) <case R_MMIX_BASE_PLUS_OFFSET>: New
3229         case.  Fix typo in comment.  New label do_mmix_reloc.
3230         (mmix_elf_check_relocs): Abuse bfd_link_info member base_file to
3231         store first object file with a base-plus-offset reloc.  Call
3232         mmix_elf_check_common_relocs for the part common with mmo.
3233         (mmix_elf_final_link): Write out linker-allocated register
3234         contents section.
3235         (elf_backend_gc_sweep_hook): Define.
3236         (bfd_elf64_bfd_relax_section): Define.
3237
3238         * mmo.c: Don't include <ctype.h>
3239         (mmo_init): Correct init-once logic.
3240
3241 2002-02-01  Tom Rix  <trix@redhat.com>
3242
3243         * config.bfd: Conditionally support <aiaff> for pre AIX 4.3.
3244
3245 2002-02-01  Alan Modra  <amodra@bigpond.net.au>
3246
3247         * Makefile.am: Run "make dep-am"
3248         * Makefile.in: Regenerate.
3249
3250 2002-01-31  David O'Brien  <obrien@FreeBSD>
3251
3252         * configure.in: Recognize the differences in core files from FreeBSD
3253         4.{0,1} and later versions of 4.x.  This treats 4.2+ the same as
3254         5-CURRENT.
3255         * configure: Regenerate.
3256
3257 2002-01-31  Ivan Guzvinec  <ivang@opencores.org>
3258
3259         * coff-or32.c: New file.
3260         * cpu-or32.c: New file.
3261         * elf32-or32.c: New file.
3262         * archures.c: Add support for or32.
3263         * targets.c: Add support for or32.
3264         * bfd-in2.h: Regenerate.
3265         * coffcode.h (coff_set_arch_mach_hook, coff_set_flags,
3266         coff_write_object_contents): Add support for or32.
3267         * config.bfd: Add target.
3268         * configure.in: Add support for or32.
3269         * configure: Regenerate.
3270         * Makefile.am: Add support for or32.
3271         * Makefile.in: Regenerate.
3272         * po/SRC-POTFILES.in: Add or32 files.
3273         * po/bfd.pot: Regenerate.
3274
3275 2002-01-31  Nick Clifton  <nickc@cambridge.redhat.com>
3276             Don Lindsay  <lindsayd@cisco.com>
3277
3278         * elf32-mips.c (mips_elf_calculate_relocation): Replace 'return
3279         false' with a return of a bfd_reloc_ error code.
3280
3281 2002-01-31  Hans-Peter Nilsson  <hp@axis.com>
3282
3283         * elf32-cris.c (elf_cris_discard_excess_program_dynamics): Don't
3284         unexport unreferenced symbols when --export-dynamic.  Call
3285         _bfd_elf_strtab_delref when unexporting.
3286
3287 2002-01-30  Daniel Jacobowitz  <drow@mvista.com>
3288
3289         * bfd-in.h: Include <stdbool.h> if it is available.
3290         * bfd-in2.h: Regenerated.
3291
3292 2002-01-31  Alan Modra  <amodra@bigpond.net.au>
3293
3294         * elf64-ppc.c (func_desc_adjust): STV_PROTECTED functions should
3295         not go via the plt.
3296
3297 2002-01-30  Nick Clifton  <nickc@cambridge.redhat.com>
3298
3299         * archures.c: Tidy up formatting of embedded comments.
3300         * bfd.c: Tidy up formatting of embedded comments.
3301         * bfd-in.h: Fix formatting of comments.
3302         * reloc.c: Tidy up formatting of ordinary & embedded comments.
3303         * section.c: Tidy up formatting of embedded comments.
3304         * syms.c: Tidy up formatting of embedded comments.
3305         * targets.c: Tidy up formatting of embedded comments.
3306
3307         * bfd-in2.h: Regenerate.
3308
3309 2002-01-30  Nick Clifton  <nickc@cambridge.redhat.com>
3310
3311         * vms-tir.c (cmd_name): New function.
3312         (tir_cmd_name): New function.
3313         (etir_sta, etir_sto, etir_opr, etir_stc): Use cmd_name().
3314         (tir_opr, tir_ctl, tir_cmd): use tir_cmd_name().
3315         Fix formatting.
3316
3317         * peXXigen.c (pe_print_idata): Rearrange message to aid in
3318         translation.
3319         (pe_print_pdata):  Rearrange message to aid in translation.
3320
3321         * libbfd.c (warn_deprecated): Rearrange error message to aid in
3322         translation.
3323
3324         * ihex.c (ihex_write_object_contents): Fix spelling typo.
3325
3326         * ieee.c (ieee_slurp_external_symbols): Remove spurious space.
3327
3328         * elf64-sparc.c (sparc64_elf_add_symbol_hook): Rearrange error
3329         message to aid in translation.
3330
3331         * elf64-mmix.c (mmix_final_link_relocate): Rearrange error message
3332         to aid in translation.
3333
3334         * elf32-arm.h (elf32_arm_merge_private_bfd_data): Fix typo.
3335
3336 2002-01-30  Philipp Thomas  <pthomas@suse.de>
3337
3338         * coff-arm.c, elf32-elf.h: Unify messages.
3339
3340 2002-01-30  Nick Clifton <nickc@redhat.com>
3341
3342         * po/sv.po: Updated translation.
3343
3344 2002-01-30  Philipp Thomas  <pthomas@suse.de>
3345
3346         * dwarf2.c (read_abbrev): Use full section name in error message.
3347         (decode_line_info): Likewise.
3348
3349         * elf.c (_bfd_elf_symbol_from_bfd_symbol): Don't translate debugging
3350         message.
3351
3352 2002-01-30  Alan Modra  <amodra@bigpond.net.au>
3353
3354         * elf64-ppc.c (func_desc_adjust): Only provide missing function
3355         descriptor symbols for undefined function code syms.  Clear
3356         ELF_LINK_NON_ELF so that they can stay weak.
3357
3358 2002-01-29  Chris Demetriou  <cgd@broadcom.com>
3359             Mitch Lichtenberg  <mpl@broadcom.com>
3360
3361         * bfd-in.h (bfd_mips_elf32_create_embedded_relocs): New prototype.
3362         * elf32-mips.c (bfd_mips_elf32_create_embedded_relocs): New function
3363         to handle 32-bit ELF embedded reloc (ld --embedded-relocs)
3364         generation.
3365         * bfd-in2.h: Regenerate.
3366
3367 2002-01-29  Chris Demetriou  <cgd@broadcom.com>
3368
3369         * elf32-mips.c: Add additional comments about HI16 relocation
3370         processing.
3371         (_bfd_mips_elf_hi16_reloc): Don't subtract address here for
3372         pc-relative relocations.  (Reverts change made on 2001-10-31.)
3373         (_bfd_mips_elf_lo16_reloc): Subtract address of LO16 part here
3374         for pc-relative relocations.
3375         (mips_elf_calculate_relocation): Add a comment about a kludge
3376         in the R_MIPS_GNU_REL_HI16 handling.
3377         (_bfd_mips_elf_relocate_section): Implement that kludge;
3378         adjust pc-relative HI16 relocation for difference in HI16 and
3379         LO16 addresses, since it can't easily be done in
3380         mips_elf_calculate_relocation.
3381
3382 2002-01-29  Martin Schwidefsky  <schwidefsky@de.ibm.com>
3383
3384         * elf32-i386 (elf_i386_adjust_dynamic_symbol): Do not replace PLT32
3385         relocations with PC32 relocations for undefined or weak symbols.
3386         * elf32-s390 (elf_i386_adjust_dynamic_symbol): Likewise.
3387         * elf64-s390x (elf_i386_adjust_dynamic_symbol): Likewise.
3388
3389 2002-01-28  Jason Thorpe  <thorpej@wasabisystems.com>
3390
3391         * elfcore.h (elf_core_file_p): Improve comment for last change.
3392
3393 2002-01-27  Daniel Jacobowitz  <drow@mvista.com>
3394
3395         * configure: Regenerated.
3396
3397 2002-01-27  Jason Thorpe  <thorpej@wasabisystems.com>
3398
3399         * elfcore.h (elf_core_file_p): Set the machine architecture
3400         before processing the program headers.
3401
3402 2002-01-26  Hans-Peter Nilsson  <hp@bitrange.com>
3403
3404         * configure.in <64-bit configuration>: If using gcc, check and
3405         emit error for egcs-1.1.2.
3406         * configure: Regenerate.
3407
3408 2002-01-26  Egor Duda  <deo@logos-m.ru>
3409
3410         * elf.c (elfcore_grok_win32pstatus): Copy only as much information
3411         as possible to avoid stack corruption.
3412
3413 2002-01-26  Richard Henderson  <rth@redhat.com>
3414
3415         * elf64-alpha.c (elf64_alpha_check_relocs): Don't set reltext
3416         for non-allocated sections.
3417
3418 2002-01-25  Mark Kettenis  <kettenis@gnu.org>
3419
3420         * elf.c (elfcore_write_prstatus): Make sure we pass the address of
3421         prstat.pr_reg even if it is a struct.
3422
3423 2002-01-25  Steve Ellcey <sje@cup.hp.com>
3424
3425         * bfd/elfxx-ia64.c: Reset AIX vector function overrides for HP-UX.
3426
3427 2002-01-25  Philipp Thomas  <pthomas@suse.de>
3428
3429         * coffgen.c (coff_print_symbol): Don't mark info message
3430         for translation.
3431
3432 2002-01-25  Nick Clifton <nickc@redhat.com>
3433
3434         * po/fr.po: Updated translation.
3435         * po/es.po: Updated translation.
3436
3437 2002-01-25  Philipp Thomas  <pthomas@suse.de>
3438
3439         * coff-alpha.c (alpha_relocate_section): Unify warning message
3440         for GP relative relocations without GP defined.
3441         * coff-mips.c (mips_relocate_section): Likewise.
3442
3443 2002-01-25  Alan Modra  <amodra@bigpond.net.au>
3444
3445         * elf-eh-frame.c (_bfd_elf_eh_frame_section_offset): Avoid
3446         unsigned overflow when new_offset < old_offset.
3447
3448 2002-01-24  Philipp Thomas  <pthomas@suse.de>
3449
3450         * bfd.c (_bfd_abort): Fix typo.
3451
3452 2002-01-23  Richard Henderson  <rth@redhat.com>
3453
3454         * elf64-alpha.c (elf64_alpha_adjust_dynamic_symbol): Don't suppress
3455         plt entries for undefweak symbols.
3456
3457 2002-01-23  Steve Ellcey <sje@cup.hp.com>
3458
3459         * bfd/targets.c (bfd_elf32_ia64_hpux_big_vec): Add to
3460         DEFAULT_VECTOR.
3461         (bfd_elf64_ia64_hpux_big_vec): Ditto.
3462         (bfd_elf32_h8300_vec): Ditto.
3463
3464 2002-01-23  Alan Modra  <amodra@bigpond.net.au>
3465
3466         * elf64-ppc.c: Remove stale part of ABI comment.
3467         (NO_OPD_RELOCS): Define.
3468         (ppc64_elf_check_relocs): Use it.
3469         (ppc64_elf_relocate_section): Here too.
3470         (build_one_stub): Don't point function syms at the stub.  Instead,
3471         hijack plt.offset.
3472         (ppc64_elf_relocate_section): Check whether REL24 relocs should
3473         really go to the stub.  Make all dynamic relocs in opd against
3474         locals.
3475         (ppc64_elf_finish_dynamic_symbol): Allow for non-standard use of
3476         plt.offset.
3477
3478 2002-01-22  Richard Henderson  <rth@redhat.com>
3479
3480         * elf64-alpha.c (INSN_UNOP): Encode with RB as $sp.
3481
3482 2002-01-22  Alan Modra  <amodra@bigpond.net.au>
3483
3484         * elf64-ppc.c (ppc64_elf_finish_dynamic_sections): Correct sign of
3485         TOC_BASE_OFF adjustment.
3486
3487         * Makefile.am: Run "make dep-am".
3488         * Makefile.in: Regenerate.
3489         * po/SRC-POTFILES.in: Regenerate.
3490
3491 2002-01-22  John David Anglin  <dave@hiauly1.hia.nrc.ca>
3492
3493         * configure.host (hppa*64*-*-hpux*, hppa*64*-*-linux*): Add new
3494         host defines.
3495
3496 2002-01-21  Hans-Peter Nilsson  <hp@axis.com>
3497
3498         * elf32-cris.c (cris_elf_relocate_section) <case R_CRIS_32_GOTREL>:
3499         Check for and emit error if sgot is NULL at this point.
3500
3501 2002-01-21  Jason Thorpe  <thorpej@wasabisystems.com>
3502
3503         * config.bfd (ia64*-*-netbsd*): New target.
3504
3505 2002-01-21  Thomas Klausner <wiz@danbala.ifoer.tuwien.ac.at>
3506
3507         * som.c (som_write_space_strings): Comment typo fix.
3508
3509 2002-01-21  Alan Modra  <amodra@bigpond.net.au>
3510
3511         * elf64-ppc.c (struct ppc_link_hash_entry): Add is_func and
3512         is_func_descriptor fields.
3513         (link_hash_newfunc): Init them.
3514         (ppc64_elf_check_relocs): Only R_PPC24_REL24 syms starting with a
3515         dot are candidates for plt entries.  When processing .opd relocs,
3516         set function descriptor strings to point inside function code
3517         string, and set new ppc_link_hash_entry fields.
3518         (ppc64_elf_gc_sweep_hook): Don't sweep R_PPC64_REL24 relocs.
3519         (ppc64_elf_adjust_dynamic_symbol): Remove most code dealing with
3520         function descriptors.  It's now done in..
3521         (func_desc_adjust): New.
3522         (ppc64_elf_func_desc_adjust): New.
3523         (define elf_backend_always_size_sections): Define.
3524         (ppc64_elf_hide_symbol): New.
3525         (define elf_backend_hide_symbol): Define.
3526         (allocate_dynrelocs): Remove code looking up function descriptors
3527         as that has been done earlier.
3528         (ppc64_elf_size_dynamic_sections): Use htab shortcut to elf hash
3529         table.
3530         (ppc64_elf_finish_dynamic_symbol): Likewise.  Remove code looking
3531         up function descriptor.
3532         (build_one_stub): Look up the function code sym.  Check for
3533         invalid plt offsets.
3534         (ppc64_elf_relocate_section): Tweak calls to undefined weak syms.
3535         Convert R_PPC64_TOC relocs to R_PPC64_RELATIVE in shared libs.
3536
3537         * elf-bfd.h (elf_backend_data <elf_backend_hide_symbol>): Add
3538         boolean param.
3539         (_bfd_elf_link_hash_hide_symbol): Likewise.
3540         * elflink.h (elf_link_add_object_symbols): Adjust call to
3541         elf_backend_hide_symbol.
3542         (elf_fix_symbol_flags): Likewise.
3543         (elf_link_assign_sym_version): Likewise. Use bfd_malloc rather
3544         than bfd_alloc.
3545         * elf.c (_bfd_elf_link_hash_hide_symbol): Add "force_local" param.
3546         Set ELF_LINK_FORCED_LOCAL and call _bfd_elf_strtab_delref.
3547         * elf32-hppa.c (elf32_hppa_hide_symbol): Likewise.
3548         (clobber_millicode_symbols): Adjust to suit new hide_symbol.
3549         * elf32-cris.c (elf_cris_hide_symbol): Add "force_local" param
3550         and adjust to suit.
3551         * elf32-mips.c (_bfd_mips_elf_hide_symbol): Likewise, and call
3552         _bfd_elf_link_hash_hide_symbol rather than duplicating code.
3553         * elfxx-ia64.c (elfNN_ia64_hash_hide_symbol): Likewise.
3554
3555 2002-01-18  Alan Modra  <amodra@bigpond.net.au>
3556
3557         * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Test for a
3558         dynamic function descriptor symbol, not the associated function
3559         symbol.
3560
3561 2002-01-17  Eric Christopher  <echristo@redhat.com>
3562
3563         * elf32-mips.c (mips_elf_calculate_relocation): Fix typo.
3564
3565 2002-01-17  Nick Clifton  <nickc@cambridge.redhat.com>
3566
3567         * po/bfd.pot: Regenerate.
3568         * po/fr.po: Regenerate.
3569
3570 2002-01-17  Alan Modra  <amodra@bigpond.net.au>
3571
3572         * elf-bfd.h (elf_backend_data <elf_backend_section_from_bfd_section>):
3573         Remove "Elf_Internal_Shdr *" param.
3574         (_bfd_mips_elf_section_from_bfd_section): Ditto.
3575         * elf32-mips.c (_bfd_mips_elf_section_from_bfd_section): Ditto.
3576         * elf32-m32r.c (_bfd_m32r_elf_section_from_bfd_section): Ditto.
3577         * elf32-v850.c (v850_elf_section_from_bfd_section): Ditto.
3578         * elf64-mmix.c (mmix_elf_section_from_bfd_section): Ditto.
3579         * elfxx-ia64.c (elfNN_hpux_backend_section_from_bfd_section): Ditto.
3580         * elf.c (_bfd_elf_section_from_bfd_section): Allow backend
3581         function to override special sections.  Remove hdr arg from
3582         backend call, and don't loop.
3583
3584 2002-01-16  Eric Christopher  <echristo@redhat.com>
3585
3586         * elf32-mips.c (mips_elf_calculate_relocation): Set require_jalxp
3587         on R_MIPS_26 and target is 16bit. Add R_MIPS16_GPREL to list of
3588         relocations requiring gp0 and gp.
3589
3590 2002-01-16  Richard Earnshaw  <rearnsha@arm.com>
3591
3592         * elf32-arm.h (elf32_arm_merge_private_bfd_data): Handle
3593         EF_ARM_VFP_FLOAT.
3594         (elf32_arm_print_private_bfd_data): Likewise.
3595
3596 2002-01-16  Nick Clifton  <nickc@cambridge.redhat.com>
3597
3598         * po/tr.po: Import new version.
3599
3600 2002-01-16  Alan Modra  <amodra@bigpond.net.au>
3601
3602         * elf64-ppc.c (ppc64_elf_howto_raw): Remove stale FIXMEs.
3603         (ppc64_elf_reloc_type_lookup): Use proper CTOR reloc.
3604         (ORI_R0_R0_0): Correct.
3605
3606 2002-01-16  Alan Modra  <amodra@bigpond.net.au>
3607
3608         * elflink.c (_bfd_elf_create_dynamic_sections): Don't set SEC_CODE
3609         when plt_not_loaded.
3610         * elf64-ppc.c (ppc64_elf_create_dynamic_sections): No need to
3611         clear .plt SEC_CODE here.  Create .stub and correct .glink flags.
3612         (PLT_INITIAL_ENTRY_SIZE): Set to 24.
3613         (ppc64_elf_glink_code): Delete.
3614         (PPC64_ELF_GLINK_SIZE): Delete.
3615         (ADDIS_R12_R2, STD_R2_40R1, LD_R11_0R12, LD_R2_0R12, MTCTR_R11,
3616         BCTR, ADDIS_R12_R12_1, LD_R2_40R1, NOP, LI_R0_0, B_DOT, LIS_R0_0,
3617         ORI_R0_R0_0): Define.
3618         (PLT_CALL_STUB_SIZE, GLINK_CALL_STUB_SIZE): Define.
3619         (struct ppc_link_hash_table): Add sstub and plt_overflow.
3620         (ppc64_elf_link_hash_table_create): Init them.
3621         (ppc64_elf_check_relocs <R_PPC64_REL24>): Refcount .plt entry.
3622         Don't copy to shared lib.
3623         (ppc64_elf_check_relocs): Call bfd_set_error on errors.
3624         (ppc64_elf_gc_sweep_hook <R_PPC64_REL24>): Sweep plt refcount.
3625         (allocate_dynrelocs <plt>): Don't change function sym here.  Make
3626         room for .stub and .glink code.
3627         (ppc64_elf_size_dynamic_sections): Handle .stub.  Make entry for
3628         DT_PPC64_GLINK.
3629         (ppc64_elf_final_link): Rename to ppc64_elf_set_toc.  Don't call
3630         bfd_elf64_bfd_final_link.
3631         (bfd_elf64_bfd_final_link): Don't define.
3632         (ppc64_elf_size_stubs): New.
3633         (build_plt_stub): New.
3634         (build_one_stub): New.
3635         (ppc64_elf_build_stubs): New.
3636         (ppc64_elf_relocate_section <toc relocs>): Remove assert.
3637         (ppc64_elf_relocate_section): Don't copy R_PPC64_REL24 relocs.
3638         (ppc64_elf_finish_dynamic_symbol): Don't build stubs here.  Set
3639         DT_PPC64_GLINK entry.  Tweak DT_PLTGOT, DT_JMPREL, DT_PLTRELSZ in
3640         case output sections not separate.  Adjust DT_RELASZ to not
3641         include plt relocs.  Set reserved got entry.  Set got and plt
3642         entry size.
3643         (elf_backend_got_header_size): Set to 8.
3644         * elf64-ppc.h: New file.
3645
3646 2002-01-16  Alan Modra  <amodra@bigpond.net.au>
3647
3648         * elf32-arm.h (elf32_arm_size_dynamic_sections): When removing
3649         sections, use bfd_section_list_remove.
3650         * elf32-i370.c (i370_elf_size_dynamic_sections): Likewise.
3651         * elflink.h (elf_link_add_object_symbols): When removing all
3652         sections, use bfd_section_list_clear.
3653
3654 2002-01-15  Nick Clifton  <nickc@cambridge.redhat.com>
3655
3656         * po/sv.po: New file: Swedish translation.
3657         * configure.in (ALL_LINGUAS): Add sv.
3658         * configure: Regenerate.
3659
3660 2002-01-15  Jakub Jelinek  <jakub@redhat.com>
3661
3662         * elflink.h (elf_link_input_bfd): Back out 2002-01-07 change.
3663         * elf.c (merge_sections_remove_hook): New function.
3664         (_bfd_elf_merge_sections): Pass it as 3rd argument to
3665         _bfd_merge_sections.
3666         * libbfd-in.h (_bfd_merge_sections): Add 3rd argument.
3667         * libbfd.h: Rebuilt.
3668         * merge.c (_bfd_merge_sections): Add remove_hook argument.
3669         Call remove_hook if a SEC_EXCLUDE section is encountered.
3670
3671 2002-01-15  Nick Clifton  <nickc@cambridge.redhat.com>
3672
3673         * elf32-xstormy16.c (xstormy16_reloc_map): Add new field 'table'.
3674         (xstormy16_reloc_map): Initialise new field with correct howto
3675         table.
3676         (xstormy16_reloc_type_lookup): Use 'table' field to locate correct
3677         howto entry.
3678
3679 2002-01-10  Michael Snyder  <msnyder@redhat.com>
3680
3681         * elf.c (elfcore_write_prstatus): Use long instead of pid_t;
3682         (elfcore_write_pstatus): Use long instead of pid_t;
3683         * elf-bfd.h: Change prototypes to use long instead of pid_t;
3684
3685 2002-01-09  Jason Thorpe  <thorpej@wasabisystems.com>
3686
3687         * elf.c: Update copyright years.
3688         (elfcore_grok_netbsd_note): Use NT_NETBSDCORE_PROCINFO
3689         and NT_NETBSDCORE_FIRSTMACH.  Improve a comment.
3690
3691 2002-01-08  Michael Snyder  <msnyder@redhat.com>
3692
3693         Add capability to write corefile note sections, for gdb.
3694         * elf.c (elfcore_write_note): New function.
3695         (elfcore_write_prpsinfo): New function.
3696         (elfcore_write_prstatus): New function.
3697         (elfcore_write_pstatus): New function.
3698         (elfcore_write_prfpreg): New function.
3699         (elfcore_write_prxfpreg): New function.
3700         * elf-bfd.h: Add prototypes for above functions.
3701
3702 2002-01-08  Alexandre Oliva  <aoliva@redhat.com>
3703
3704         * elf.c (elf_fake_sections): Propagate errors from
3705         elf_backend_fake_section.
3706
3707 2002-01-07  Jason Thorpe  <thorpej@wasabisystems.com>
3708
3709         * Makefile.am (BFD32_BACKENDS): Add elf32-sh-nbsd.lo.
3710         (BFD32_BACKENDS_CFILES): Add elf32-sh-nbsd.c.
3711         (elf32-sh-nbsd.lo): New rule.
3712         * Makefile.in: Regenerate.
3713         * config.bfd (sh*le-*-netbsdelf*): New target.
3714         (sh*-*-netbsdelf*): New target.
3715         * configure.in: Include netbsd-core.lo for native sh*-*-netbsd*.
3716         (bfd_elf32_shnbsd_vec): New vector.
3717         (bfd_elf32_shlnbsd_vec): New vector.
3718         * configure: Regenerate.
3719         * elf32-sh-nbsd.c: New file.
3720         * targets.c: Update copyright years.
3721         (_bfd_target_vector): Add bfd_elf32_shlnbsd_vec and
3722         bfd_elf32_shnbsd_vec.
3723
3724 2002-01-07  Aldy Hernandez  <aldyh@redhat.com>
3725
3726         * coff-rs6000.c (READ20): Use bfd_scan_vma.
3727
3728 2002-01-07  Geoffrey Keating  <geoffk@redhat.com>
3729
3730         * elflink.h (elf_link_input_bfd): Don't ask for the merged offset
3731         of a symbol in a section that will be deleted.
3732
3733 2002-01-07  Nick Clifton  <nickc@cambridge.redhat.com>
3734
3735         * po/es.po: New file: Spanish translation.
3736         * configure.in (ALL_LINGUAS): Add es.
3737         * configure: Regenerate.
3738
3739 2002-01-06  Steve Ellcey  <sje@cup.hp.com>
3740
3741         * elfxx-ia64.c (is_unwind_section_name): Add target vector as
3742         argument so we can handle HP-UX specially.
3743         (elfNN_ia64_hpux_vec): New for use in is_unwind_section_name.
3744         (elfNN_hpux_backend_section_from_bfd_section): New for support
3745         of SHN_IA_64_ANSI_COMMON.
3746         (elfNN_ia64_relax_section): Add support for SHN_IA_64_ANSI_COMMON.
3747         (is_unwind_section_name): Add special HP-UX support.
3748         (elfNN_ia64_section_from_shdr): Add support for more sections.
3749         (elfNN_ia64_fake_sections): Modify is_unwind_section_name call and
3750         add support for more sections.
3751         (elfNN_ia64_additional_program_headers): Modify
3752         is_unwind_section_name call.
3753         (elfNN_ia64_modify_segment_map): Remove assumption that there is
3754         only one unwind section in segment.
3755
3756 2002-01-06  Alan Modra  <amodra@bigpond.net.au>
3757
3758         * syms.c (_bfd_generic_make_empty_symbol): New function.
3759         * libbfd-in.h (_bfd_nosymbols_make_empty_symbol): Define as
3760         _bfd_generic_make_empty_symbol.
3761         * libbfd.h: Regenerate.
3762         * bfd-in2.h: Regenerate.
3763         * hppabsd-core.c (hppabsd_core_make_empty_symbol): Delete function.
3764         (hppabsd_core_get_symtab_upper_bound): Don't define.
3765         (hppabsd_core_get_symtab): Likewise.
3766         (hppabsd_core_print_symbol): Likewise.
3767         (hppabsd_core_get_symbol_info): Likewise.
3768         (hppabsd_core_bfd_is_local_label_name): Likewise.
3769         (hppabsd_core_get_lineno): Likewise.
3770         (hppabsd_core_find_nearest_line): Likewise.
3771         (hppabsd_core_bfd_make_debug_symbol): Likewise.
3772         (hppabsd_core_read_minisymbols): Likewise.
3773         (hppabsd_core_minisymbol_to_symbol): Likewise.
3774         (hppabsd_core_vec): Use BFD_JUMP_TABLE_SYMBOLS (_bfd_nosymbols).
3775         Formatting fixes.
3776         * hpux-core.c: Similarly.
3777         * irix-core.c: Similarly.
3778         * osf-core.c: Similarly.
3779         * sco5-core.c: Similarly.
3780         * binary.c (binary_make_empty_symbol): Remove function, define as
3781         _bfd_generic_make_empty_symbol.
3782         * ihex.c (ihex_make_empty_symbol): Likewise.
3783         * mmo.c (mmo_make_empty_symbol): Likewise.
3784         * ppcboot.c (ppcboot_make_empty_symbol): Likewise.
3785         * srec.c (srec_make_empty_symbol): Likewise.
3786         * versados.c (versados_make_empty_symbol): Likewise.
3787         * vms.c (_bfd_vms_make_empty_symbol): Remove.
3788         (vms_make_empty_symbol): Define as _bfd_generic_make_empty_symbol.
3789         * vms-gsd.c (_bfd_vms_slurp_gsd): Call bfd_make_empty_symbol
3790         rather than _bfd_vms_make_empty_symbol.
3791         * vms-misc.c (new_symbol): Likewise.
3792
3793 2002-01-05  Alan Modra  <amodra@bigpond.net.au>
3794
3795         * section.c (bfd_section_init): Remove unnecessary initialisations.
3796         (bfd_section_list_clear): New function.
3797         (bfd_section_list_remove, bfd_section_list_insert): New macros.
3798         (_bfd_strip_section_from_output): Use them.
3799         * coffcode.h (coff_set_alignment_hook): Likewise.
3800         * elf32-mips.c (_bfd_mips_elf_final_link): Likewise.
3801         * elf64-mips.c (mips_elf64_final_link): Likewise.
3802         * elf64-mmix.c (mmix_elf_final_link): Likewise.
3803         * sunos.c (sunos_add_dynamic_symbols): Likewise.
3804         * xcofflink.c (_bfd_xcoff_bfd_final_link): Likewise.
3805         * bfd-in2.h: Regenerate.
3806
3807         * netbsd-core.c (netbsd_core_file_p): Use bfd_make_section_anyway
3808         rather than doing our own section handling.  Clean up after errors
3809         with bfd_release and bfd_section_list_clear.  Handle unexpected
3810         flags.
3811         * aoutf1.h (sunos4_core_file_p): Likewise.
3812         * aix386-core.c (aix386_core_file_p): Likewise.
3813         * cisco-core.c (cisco_core_file_validate): Likewise.
3814         * ptrace-core.c (ptrace_unix_core_file_p): Likewise.
3815         * trad-core.c (trad_unix_core_file_p): Likewise.
3816
3817         * hppabsd-core.c (hppabsd_core_core_file_p):  Clean up after errors
3818         with bfd_release and bfd_section_list_clear.
3819         * hpux-core.c (hpux_core_core_file_p): Likewise.
3820         * irix-core.c (irix_core_core_file_p): Likewise.
3821         * lynx-core.c (lynx_core_file_p): Likewise.
3822         * osf-core.c (osf_core_core_file_p): Likewise.
3823         * rs6000-core.c (rs6000coff_core_p): Likewise.
3824         * sco5-core.c (sco5_core_file_p): Likewise.
3825
3826         * elf32-mips.c (_bfd_mips_elf_lo16_reloc): Simplify, and perform
3827         sign extension adjustments without conditionals.
3828
3829 2002-01-04  Jakub Jelinek  <jakub@redhat.com>
3830
3831         * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): Don't crash if
3832         CIE at .eh_frame start is removed due to no FDEs referencing it.
3833
3834 2002-01-04  Jason Thorpe  <thorpej@wasabisystems.com>
3835
3836         * config.bfd (x86_64-*-netbsd*): New target.
3837         * configure.in (x86_64-*-netbsd*): Set COREFILE
3838         to netbsd-core.lo.
3839         * configure: Regenerated.
3840
3841 2002-01-03  Tom Rix  <trix@redhat.com>
3842
3843         * xcofflink.c (_bfd_xcoff_bfd_final_link): Update .pad section ordering
3844         for recent bfd_make_section_anyway change.
3845
3846 2002-01-03  Nick Clifton  <nickc@cambridge.redhat.com>
3847
3848         * elf32-arm.h (elf32_arm_final_link_relocate): Handle
3849         R_ARM_THM_PC11 reloc.
3850
3851 2002-01-02  Nick Clifton  <nickc@cambridge.redhat.com>
3852
3853         * configure.in (LINGUAS): Add ja.
3854         * configure: Regenerate.
3855         * po/ja.po: Import from translation project's web site.
3856
3857 2002-01-02  Nick Clifton  <nickc@cambridge.redhat.com>
3858
3859         * elf32-arm.h (elf32_arm_merge_private_bfd_data): Reformat error
3860         messages to ease translation into other languages.
3861
3862 For older changes see ChangeLog-0001
3863 \f
3864 Local Variables:
3865 mode: change-log
3866 left-margin: 8
3867 fill-column: 74
3868 version-control: never
3869 End: