OSDN Git Service

* section.c (bfd_section_init): Remove unnecessary initialisations.
[pf3gnuchains/pf3gnuchains4x.git] / bfd / ChangeLog
1 2002-01-05  Alan Modra  <amodra@bigpond.net.au>
2
3         * section.c (bfd_section_init): Remove unnecessary initialisations.
4         (bfd_section_list_clear): New function.
5         (bfd_section_list_remove, bfd_section_list_insert): New macros.
6         (_bfd_strip_section_from_output): Use them.
7         * coffcode.h (coff_set_alignment_hook): Likewise.
8         * elf32-mips.c (_bfd_mips_elf_final_link): Likewise.
9         * elf64-mips.c (mips_elf64_final_link): Likewise.
10         * elf64-mmix.c (mmix_elf_final_link): Likewise.
11         * sunos.c (sunos_add_dynamic_symbols): Likewise.
12         * xcofflink.c (_bfd_xcoff_bfd_final_link): Likewise.
13         * bfd-in2.h: Regenerate.
14
15         * netbsd-core.c (netbsd_core_file_p): Use bfd_make_section_anyway
16         rather than doing our own section handling.  Clean up after errors
17         with bfd_release and bfd_section_list_clear.  Handle unexpected
18         flags.
19         * aoutf1.h (sunos4_core_file_p): Likewise.
20         * aix386-core.c (aix386_core_file_p): Likewise.
21         * cisco-core.c (cisco_core_file_validate): Likewise.
22         * ptrace-core.c (ptrace_unix_core_file_p): Likewise.
23         * trad-core.c (trad_unix_core_file_p): Likewise.
24
25         * hppabsd-core.c (hppabsd_core_core_file_p):  Clean up after errors
26         with bfd_release and bfd_section_list_clear.
27         * hpux-core.c (hpux_core_core_file_p): Likewise.
28         * irix-core.c (irix_core_core_file_p): Likewise.
29         * lynx-core.c (lynx_core_file_p): Likewise.
30         * osf-core.c (osf_core_core_file_p): Likewise.
31         * rs6000-core.c (rs6000coff_core_p): Likewise.
32         * sco5-core.c (sco5_core_file_p): Likewise.
33
34         * elf32-mips.c (_bfd_mips_elf_lo16_reloc): Simplify, and perform
35         sign extension adjustments without conditionals.
36
37 2002-01-04  Jakub Jelinek  <jakub@redhat.com>
38
39         * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): Don't crash if
40         CIE at .eh_frame start is removed due to no FDEs referencing it.
41
42 2002-01-04  Jason Thorpe  <thorpej@wasabisystems.com>
43
44         * config.bfd (x86_64-*-netbsd*): New target.
45         * configure.in (x86_64-*-netbsd*): Set COREFILE
46         to netbsd-core.lo.
47         * configure: Regenerated.
48
49 2002-01-03  Tom Rix  <trix@redhat.com>
50
51         * xcofflink.c (_bfd_xcoff_bfd_final_link): Update .pad section ordering
52         for recent bfd_make_section_anyway change.
53
54 2002-01-03  Nick Clifton  <nickc@cambridge.redhat.com>
55
56         * elf32-arm.h (elf32_arm_final_link_relocate): Handle
57         R_ARM_THM_PC11 reloc.
58
59 2002-01-02  Nick Clifton  <nickc@cambridge.redhat.com>
60
61         * configure.in (LINGUAS): Add ja.
62         * configure: Regenerate.
63         * po/ja.po: Import from translation project's web site.
64
65 2002-01-02  Nick Clifton  <nickc@cambridge.redhat.com>
66
67         * elf32-arm.h (elf32_arm_merge_private_bfd_data): Reformat error
68         messages to ease translation into other languages.
69
70 2001-12-31  Jakub Jelinek  <jakub@redhat.com>
71
72         * elflink.h (elf_bfd_final_link): Check if dynobj is not NULL
73         before looking for .eh_frame_hdr section.
74         * elf-eh-frame.c (_bfd_elf_write_section_eh_frame_hdr): If
75         .eh_frame_hdr section is being stripped from output, don't do
76         anything.
77
78 2001-12-27  Tom Rix  <trix@redhat.com>
79
80         * coff-rs6000.c (xcoff_generate_rtinit): Clean data_buffer alloc/free.
81         * coff64-rs6000.c (xcoff64_generate_rtinit): Same.
82         (xcoff_write_archive_contents_big): Rewrite.
83         (xcoff_write_armap_big): Rewrite.
84         (xcoff_write_one_armap_big): Delete.
85         * libxcoff.h : Clean up.
86
87 2001-12-21  Tom Rix  <trix@redhat.com>
88
89         * xcofflink.c (bfd_xcoff_link_generate_rtinit): New function.
90         Interface to linker for generation of __rtinit.
91         * libxcoff.h (struct xcoff_backend_data_rec): Add new ops to xcoff
92         backend to generate special linker symbol __rtinit.
93         * coff-rs6000.c (bfd_xcoff_backend_data, bfd_pmac_xcoff_backend_data)
94         :  Add new rtinit ops
95         * coff64-rs6000.c (bfd_xcoff_aix5_backend_data,
96         bfd_xcoff_backend_data): Same.
97         * bfd-in.h: Add bfd_xcoff_link_generate_rtinit.
98         * bfd-in2.h : Regenerate.
99
100 2001-12-21  Jakub Jelinek  <jakub@redhat.com>
101
102         * elf32-sparc.c (_bfd_sparc_elf_howto_table): Fix dst_mask for
103         R_SPARC_DISP32.  Support R_SPARC_PLT32.
104         (sparc_reloc_map): Add BFD_RELOC_16_PCREL and BFD_RELOC_SPARC_PLT32.
105         (elf32_sparc_check_relocs): Handle R_SPARC_PLT32.
106         (elf32_sparc_relocate_section): Likewise.
107         * elf64-sparc.c (sparc64_elf_howto_table): Fix dst_mask for
108         R_SPARC_DISP32.  Support R_SPARC_PLT32 and R_SPARC_PLT64.
109         (sparc_reloc_map): Add BFD_RELOC_16_PCREL, BFD_RELOC_64_PCREL
110         and BFD_RELOC_SPARC_PLT32.
111         (sparc64_elf_check_relocs): Handle R_SPARC_PLT32 and R_SPARC_PLT64.
112         (sparc64_elf_relocate_section): Likewise.
113         * reloc.c (bfd_reloc_code_type): Add BFD_RELOC_SPARC_PLT32.
114         * bfd-in2.h, libbfd.h: Rebuilt.
115
116 2001-12-20  Tom Rix  <trix@redhat.com>
117
118         * coffcode.h (coff_compute_section_file_positions): Add special AIX
119         loader alignment of text section.
120
121 2001-12-20  Jason Thorpe  <thorpej@wasabisystems.com>
122
123         * config.bfd (mips-dec-netbsd*): Delete alias for mips*el-*-netbsd*.
124
125         * config.bfd (arm-*-netbsdelf*): Add target.
126         * configure.in: Include netbsd-core.lo for native arm-*-netbsd*.
127         * configure: Regenerate.
128
129 2001-12-20  Alan Modra  <amodra@bigpond.net.au>
130
131         * elfcode.h (elf_slurp_symbol_table): Test elf_elfsections for NULL,
132         as can happen with a core file, before dereferencing.
133
134 2001-12-19  Michael Snyder  <msnyder@redhat.com>
135
136         * elf32-i386.c (elf_i386_grok_psinfo): Fix copy-and-paste error:
137         target is i386 (not mips), and size of descdata is 124 (not 128).
138
139 2001-12-19  Jakub Jelinek  <jakub@redhat.com>
140
141         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): If new_size
142         is 0, temporarily grow it to minimal CIE size.
143         (_bfd_elf_write_section_eh_frame): If input .eh_frame section would
144         end up empty, build a fake minimal CIE.
145
146 2001-12-19  Steve Ellcey  <sje@cup.hp.com>
147
148         * config.bfd (bfd_elf32_ia64_hpux_big_vec): New vector for
149         ia64*-*-hpux* target.
150         (bfd_elf64_ia64_hpux_big_vec): Likewise.
151         * targets.c: Ditto.
152         * configure.in: Ditto.
153         * configure: Regenerate
154         * elfxx-ia64.c (elfNN_ia64_final_write_processing): Replace use of
155         alloca with bfd_malloc.
156         (get_local_sym_hash): Likewise.
157         (elfNN_hpux_post_process_headers): New function.
158         #include elfNN-target.h again with values for IA64 HP-UX vector.
159
160 2001-12-18  Michael Snyder  <msnyder@redhat.com>
161
162         * elf.c (assign_file_positions_for_segments): Don't sort PT_NOTE
163         sections of corefiles.  Also it makes no sense to sort if count == 1.
164
165 2001-12-18  H.J. Lu <hjl@gnu.org>
166
167         * elf.c (_bfd_elf_copy_private_bfd_data): Also copy GP.
168
169 2001-12-18  H.J. Lu <hjl@gnu.org>
170
171         * elf.c (_bfd_elf_copy_private_bfd_data): Update comments.
172
173 2001-12-18  H.J. Lu <hjl@gnu.org>
174
175         * elf-bfd.h (_bfd_elf_copy_private_bfd_data): New. Prototype.
176         (_bfd_mips_elf_copy_private_bfd_data): Removed.
177
178         * elf.c (_bfd_elf_copy_private_bfd_data): New. Copy e_flags in
179         the ELF header.
180
181         * elf32-i370.c (??_elf_copy_private_bfd_data): Removed.
182         (bfd_elf??_bfd_copy_private_bfd_data): Removed.
183         * elf32-m32r.c: Likewise.
184         * elf32-m68k.c: Likewise.
185         * elf32-mcore.c: Likewise.
186         * elf32-mips.c: Likewise.
187         * elf32-ppc.c: Likewise.
188         * elf32-v850.c: Likewise.
189         * elf64-ppc.c: Likewise.
190         * elf64-sparc.c: Likewise.
191         * elfxx-ia64.c: Likewise.
192
193         * elf64-mips.c (bfd_elf64_bfd_copy_private_bfd_data): Removed.
194
195         * elfxx-target.h (bfd_elfNN_bfd_copy_private_bfd_data): Defined
196         to _bfd_elf_copy_private_bfd_data.
197
198 2001-12-18  Martin Schwidefsky  <schwidefsky@de.ibm.com>
199
200         * elf32-s390 (elf_s390_check_relocs): Pass addend to
201         gc_record_vtentry.
202         * elf64-s390 (elf_s390_check_relocs): Likewise.
203         Fix by Andreas Jaeger <aj@suse.de>.
204
205 2001-12-18  Jason Thorpe  <thorpej@wasabisystems.com>
206
207         * configure.host: Correctly match all NetBSD/mips
208         hosts.
209
210 2001-12-18  matthew green  <mrg@eterna.com.au>
211
212         * config.bfd (m68*-*-netbsdelf*): New target.
213         (m68*-*-netbsd): Also include bfd_elf32_m68k_vec.
214         (m68*-*-netbsdaout*): New alias for m68*-*-netbsd.
215
216 2001-12-18  Jakub Jelinek  <jakub@redhat.com>
217
218         * elflink.h (size_dynamic_sections): Skip anonymous version tag.
219         (elf_link_assign_sym_version): Don't count anonymous version tag.
220
221 2001-12-18  Jakub Jelinek  <jakub@redhat.com>
222
223         * elf-eh-frame.c (struct cie): Add make_lsda_relative.
224         (struct eh_cie_fde): Add lsda_encoding, lsda_offset,
225         make_lsda_relative.
226         (read_value, write_value): New.
227         (_bfd_elf_discard_section_eh_frame): Inicialize
228         lsda_encoding, lsda_offset and make_lsda_relative.
229         (_bfd_elf_eh_frame_section_offset): If make_lsda_relative,
230         request no dynamic reloc for LSDA field of FDE.
231         (_bfd_elf_write_section_eh_frame): Handle make_lsda_relative.
232         If a non-DW_EH_PE_absptr value is 0, don't adjust it by base
233         or pcrel.  Fix address computation for DW_EH_PE_pcrel relocs.
234         Update LSDA field if LSDA encoding is DW_EH_PE_pcrel, because
235         . might have changed due to deleted FDE or CIEs.
236
237 2001-12-18  Jakub Jelinek  <jakub@redhat.com>
238
239         * elf-strtab.c (struct elf_strtab_hash_entry): Add u.next.
240         (last_eq): Remove.
241         (_bfd_elf_strtab_finalize): Don't use a hash table for last
242         character chains, instead use an array.
243
244 2001-12-18  Jason Thorpe  <thorpej@wasabisystems.com>
245
246         * elf.c (elfcore_netbsd_get_lwpid): New function.
247         (elfcore_grok_netbsd_procinfo): New function.
248         (elfcore_grok_netbsd_note): New function.
249         (elfcore_read_notes): Call elfcore_grok_netbsd_note to process
250         NetBSD ELF core file notes.
251
252 2001-12-18  Alan Modra  <amodra@bigpond.net.au>
253
254         * elfcode.h (struct bfd_preserve): New.
255         (elf_object_p): Replace preserved_* vars with instance of above.
256         Save and restore arch_info pointer rather than arch, mach so that
257         more cases can be restored.  Save and restore new section_tail,
258         section_htab structure, and init appropriately.  Move "rest of
259         section header" code so that i_shdrp needs no NULL initialisation.
260         Free old section_htab on success.
261         * elfcore.h (elf_core_file_p): Likewise.
262
263 2001-12-17  Tom Rix  <trix@redhat.com>
264
265         * coffcode.h (sec_to_styp_flags): Add STYP_EXCEPT and STYP_TYPCHK for
266         xcoff.
267
268 2001-12-17  Jakub Jelinek  <jakub@redhat.com>
269
270         * elf-bfd.h (elf_discarded_section): Define.
271         * elflink.h (elf_link_input_bfd): Use it.
272         (elf_reloc_symbol_deleted_p): Likewise.
273
274         * elf64-alpha.c (elf64_alpha_relocate_section): Don't warn about
275         overflows for pc relative relocs against discarded sections.
276
277 2001-12-17  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
278
279         * elf32-mips.c (_bfd_mips_elf_relocate_section): Formatting.
280         * elf64-mips.c: Add most of the fixes and tweaks done in elf32-mips.c
281         over the last months. Add some code for mips16 handling.
282         (mips_elf64_check_mips16_stubs): New function.
283         (mips_elf64_stub_section_p): Likewise.
284         (mips_elf64_calculate_relocation): Change interface to support mips16.
285         (mips_elf64_perform_relocation): Likewise.
286
287 2001-12-17  Alan Modra  <amodra@bigpond.net.au>
288
289         Support for more than 64k ELF sections.
290         * elf-bfd.h (elf_size_info <swap_symbol_out>): Add shndx param.
291         (bfd_elf32_swap_symbol_in): Likewise.
292         (bfd_elf32_swap_symbol_out): Likewise.
293         (bfd_elf64_swap_symbol_in): Likewise.
294         (bfd_elf64_swap_symbol_out): Likewise.
295         (elf_reloc_cookie): Add locsym_shndx field.  Make locsyms a PTR.
296         (elf_obj_tdata): Add num_elf_sections, symtab_shndx_hdr and
297         symtab_shndx_section.
298         (elf_numsections): Define.
299         (elf_symtab_shndx): Define.
300         * elf.c (setup_group): Use elf_numsections rather than header e_shnum.
301         (bfd_elf_find_section): Likewise.
302         (bfd_section_from_elf_index): Likewise.
303         (bfd_section_from_shdr): Likewise.  Handle SHT_SYMTAB_SHNDX.
304         (bfd_section_from_r_symndx): Read symbol shndx extension, and
305         translate st_shndx for > SHN_HIRESERVE.
306         (assign_section_numbers): Skip reserved sections.  Assign
307         symtab_shndx_section and elf_numsections.  Exclude reserved
308         sections from e_shnum.  Set up symtab_shndx_hdr.
309         (_bfd_elf_compute_section_file_positions): Handle symtab_shndx_hdr.
310         (map_sections_to_segments): Don't map eh_frame_hdr unless required.
311         (assign_file_positions_except_relocs): Use elf_numsections rather
312         than header e_shnum.  Skip reserved sections and symtab_shndx_section.
313         (prep_headers): Set name for symtab_shndx_hdr.
314         (_bfd_elf_assign_file_positions_for_relocs): Use elf_numsections.
315         (_bfd_elf_write_object_contents): Likewise.  Skip reserved sections.
316         (_bfd_elf_section_from_bfd_section): Check bfd_{abs,com,und}_section
317         first.  Use elf_section_data if available.  Use elf_numsections.
318         Start scan at index 1.
319         (copy_private_bfd_data ): Comment fixes.
320         (MAP_ONESYMTAB): Define above SHN_HIOS.
321         (MAP_DYNSYMTAB): Likewise.
322         (MAP_STRTAB): Likewise.
323         (MAP_SHSTRTAB): Likewise.
324         (MAP_SYM_SHNDX): New define.
325         (_bfd_elf_copy_private_symbol_data): Handle symtab_shndx_section.
326         (swap_out_syms): Swap out SHT_SYMTAB_SHNDX section too.
327         * elfcode.h (elf_swap_symbol_in): Add shndx param, and handle shndx
328         extension.
329         (elf_swap_symbol_out): Likewise.
330         (elf_object_p): Set elf_numsections, and use instead of e_shnum.
331         Initialialise reserved elf_elfsections to point at shdr[0].  Remove
332         redundant bfd_release calls.
333         (elf_slurp_symbol_table): Read symbol shndx extension, and use with
334         elf_swap_symbol_in.  Translate st_shndx for > SHN_HIRESERVE too.
335         * elflink.h (elf_link_is_defined_archive_symbol): Read symbol shndx
336         extension, and use with elf_swap_symbol_in.
337         (elf_link_record_local_dynamic_symbol): Likewise.
338         (elf_link_add_object_symbols): Likewise.  Also translate st_shndx
339         for elf sections > SHN_HIRESERVE.
340         (NAME(bfd_elf,size_dynamic_sections)): Adjust elf_swap_symbol_out
341         call.
342         (struct elf_final_link_info): Add locsym_shndx and symshndxbuf.
343         (elf_bfd_final_link): Allocate the above, and tidy code allocating
344         other buffers.  Use elf_numsections instead of e_shnum.  Adjust
345         elf_swap_symbol_out calls.
346         (elf_link_output_sym): Swap out symbol shndx extension too.
347         (elf_link_flush_output_syms): And flush them to disk.
348         (elf_link_output_extsym): Use SHN_BAD.  Adjust elf_swap_symbol_out
349         calls.
350         (elf_gc_mark): Read symbol shndx extension, and use with
351         elf_swap_symbol_in.
352         (elf_link_input_bfd): Likewise,  Translate st_shndx for elf sections
353         > SHN_HIRESERVE too.  Use SHN_BAD.
354         (elf_reloc_symbol_deleted_p): Use symbol shndx extensions with
355         elf_swap_symbol_in.  Translate st_shndx > SHN_HIRESERVE too.
356         (elf_bfd_discard_info): Read symbol shndx extension.  Don't attempt
357         to continue after a bfd error.
358         * elf-m10200.c (mn10200_elf_relax_section): Only read local syms.
359         Stash them immediately to symtab_hdr->contents rather than later
360         in multiple places.  Clean up afterwards.  Read symbol shndx
361         extension, and use with swap_symbol_in.  Translate SHN_UNDEF,
362         SHN_ABS, SHN_COMMON and elf sections > SHN_HIRESERVE to bfd
363         sections too.  Remove dead code.
364         (mn10200_elf_relax_delete_bytes): Use symbol shndx extension
365         when swapping in symbols.  Tidy code adjusting global syms.
366         Don't swap in global syms.
367         (mn10200_elf_symbol_address_p): Likewise.  Remove extsyms param.
368         (mn10200_elf_get_relocated_section_contents): Read symbol shndx
369         extension, and use with swap_symbol_in.  Rename "size" -> "amt"
370         to maximize code in common with other files.  Translate st_shndx
371         for > SHN_HIRESERVE too.  Remove dead code.
372         * elf-m10300.c (mn10300_elf_relax_section): Only read local syms.
373         Stash them immediately to symtab_hdr->contents rather than later
374         in multiple places.  Clean up afterwards.  Read symbol shndx
375         extension, and use with swap_symbol_in.  Remove dead code.
376         (mn10300_elf_relax_delete_bytes): As for elf-m10200.c.
377         (mn10300_elf_symbol_address_p): Likewise.
378         (mn10300_elf_get_relocated_section_contents): Likewise.
379         * elf32-h8300.c (elf32_h8_relax_section): As for elf-m10300.c.
380         (elf32_h8_relax_delete_bytes): Likewise.
381         (elf32_h8_symbol_address_p): Likewise.
382         (elf32_h8_get_relocated_section_contents): Likewise.
383         * elf32-hppa.c (elf32_hppa_size_stubs): Read symbol shndx
384         extension, and use with swap_symbol_in.
385         * elf64-hppa.c (elf64_hppa_check_relocs): Likewise.
386         * elf32-i370.c (i370_elf_finish_dynamic_sections): Adjust call to
387         bfd_elf32_swap_symbol_out.
388         * elf32-m32r.c (m32r_elf_get_relocated_section_contents): Translate
389         elf sections > SHN_HIRESERVE too.
390         * elf32-m68k.c (bfd_m68k_elf32_create_embedded_relocs): Only read
391         local syms.  Read symbol shndx extension, and use with swap_symbol_in.
392         * elf32-mips.c (_bfd_mips_elf_final_write_processing): Use
393         elf_numsections rather than header e_shnum.
394         * elf32-sh.c (sh_elf_relax_section): As for elf-m10300.c.
395         (sh_elf_relax_delete_bytes): Likewise.
396         (sh_elf_get_relocated_section_contents): Likewise.  Only read local
397         symbols.
398         * elf32-v850.c (v850_elf_symbol_processing): Use an unsigned int to
399         hold section index.  Use elf_numsections rather than e_shnum.
400         Rename "index" -> "indx" to avoid shadowing warning.
401         (v850_elf_add_symbol_hook): Likewise.
402         * elf64-alpha.c (elf64_alpha_relax_section): Only read local syms.
403         Read symbol shndx extension, and use with swap_symbol_in.
404         * elf32-xstormy16.c (xstormy16_elf_relax_section): Likewise.
405         Translate SHN_COMMON and elf sections > SHN_HIRESERVE too.
406         * elfxx-ia64.c (elfNN_ia64_relax_section): Likewise.
407         (elfNN_ia64_aix_add_symbol_hook): Use elf_numsections.
408
409         * elf-m10300.c (mn10300_elf_gc_mark_hook): Remove unnecessary checks
410         before calling bfd_section_from_elf_index on local syms.
411         * elf32-arm.h (elf32_arm_gc_mark_hook): Likewise.
412         * elf32-avr.c (elf32_avr_gc_mark_hook): Likewise.
413         * elf32-cris.c (cris_elf_gc_mark_hook): Likewise.
414         * elf32-d10v.c (elf32_d10v_gc_mark_hook): Likewise.
415         * elf32-fr30.c (fr30_elf_gc_mark_hook): Likewise.
416         * elf32-hppa.c (elf32_hppa_gc_mark_hook): Likewise.
417         * elf32-i386.c (elf_i386_gc_mark_hook): Likewise.
418         * elf32-m32r.c (m32r_elf_gc_mark_hook): Likewise.
419         * elf32-m68k.c (elf_m68k_gc_mark_hook): Likewise.
420         * elf32-mcore.c (mcore_elf_gc_mark_hook): Likewise.
421         * elf32-mips.c (_bfd_mips_elf_gc_mark_hook): Likewise.
422         * elf32-openrisc.c (openrisc_elf_gc_mark_hook): Likewise.
423         * elf32-ppc.c (ppc_elf_gc_mark_hook): Likewise.
424         * elf32-s390.c (elf_s390_gc_mark_hook): Likewise.
425         * elf32-sh.c (sh_elf_gc_mark_hook): Likewise.
426         * elf32-sparc.c (elf32_sparc_gc_mark_hook): Likewise.
427         * elf32-v850.c (v850_elf_gc_mark_hook): Likewise.
428         * elf32-xstormy16.c (xstormy16_elf_gc_mark_hook): Likewise.
429         * elf64-mips.c (mips_elf64_gc_mark_hook): Likewise.
430         * elf64-mmix.c (mmix_elf_gc_mark_hook): Likewise.
431         * elf64-ppc.c (ppc64_elf_gc_mark_hook): Likewise.
432         * elf64-s390.c (elf_s390_gc_mark_hook): Likewise.
433         * elf64-x86-64.c (elf64_x86_64_gc_mark_hook): Likewise.
434
435 2001-12-17  Alan Modra  <amodra@bigpond.net.au>
436
437         Hash bfd sections for fast lookup and create.
438         * bfd.c (struct _bfd): Add section_htab, section_tail.
439         * libbfd-in.h (_bfd_delete_bfd): Declare.
440         (bfd_section_hash_newfunc): Declare.
441         * opncls.c (_bfd_new_bfd): Free memory on failure.  Init
442         section_htab and section_tail.
443         (_bfd_delete_bfd): New function.
444         (bfd_openr): Use it.
445         (bfd_fdopenr): Likewise.
446         (bfd_openstreamr): Likewise.
447         (bfd_openw): Likewise.
448         (bfd_close): Likewise.
449         (bfd_close_all_done): Likewise.
450         (bfd_release): Comment.
451         * section.c (struct section_hash_entry): New.
452         (bfd_section_hash_newfunc): New function.
453         (section_hash_lookup): Define.
454         (bfd_section_init): New function, split out from
455         bfd_make_section_anyway.
456         (bfd_get_section_by_name): Lookup via hash table.
457         (bfd_get_unique_section_name): Likewise.
458         (bfd_make_section_old_way): Rewrite to use hash table.
459         (bfd_make_section_anyway): Likewise.
460         (bfd_make_section): Likewise.  Return NULL for attempts to make
461         BFD_{ABS,COM,UND,IND}_SECTION_NAME.
462         (_bfd_strip_section_from_output): Adjust section_tail if needed.
463         * configure.in: Bump bfd version.
464         * configure: Regenerate.
465         * libbfd.h: Regenerate.
466         * bfd-in2.h: Regenerate.
467
468 2001-12-15  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
469
470         * elf64-mips.c (mips_elf64_link_hash_entry): New link hash.
471         (mips_elf64_high): New Function.
472         (mips_elf64_higher): Likewise.
473         (mips_elf64_highest): Likewise.
474         (mips_elf64_info_to_howto_rel): Likewise.
475         (mips_elf64_info_to_howto_rela): Likewise.
476         (mips_elf64_write_rel): Likewise.
477         (mips_elf64_write_rela): Likewise.
478         (mips_elf64_link_hash_newfunc): Likewise.
479         (mips_elf64_hi16_reloc): Likewise.
480         (mips_elf64_higher_reloc): Likewise.
481         (mips_elf64_highest_reloc): Likewise.
482         (mips_elf64_gprel16_reloc): Likewise.
483         (mips_elf64_gprel16_reloca): Likewise.
484         (mips_elf64_literal_reloc): Likewise.
485         (mips_elf64_gprel32_reloc): Likewise.
486         (mips_elf64_shift6_reloc): Likewise.
487         (mips_elf64_got16_reloc): Likewise.
488         (mips_elf64_assign_gp): Likewise.
489         (mips_elf64_final_gp): Likewise.
490         (gprel16_with_gp): Likewise.
491         (mips_elf64_additional_program_headers): Likewise.
492         (mips_elf64_link_hash_table_create): Likewise.
493         (mips_elf64_got_offset_from_index): Likewise.
494         (_mips_elf64_got_info): Likewise.
495         (mips_elf64_sign_extend): Likewise.
496         (mips_elf64_overflow_p): Likewise.
497         (mips_elf64_global_got_index): Likewise.
498         (mips_elf64_sort_hash_table_f): Likewise.
499         (mips_elf64_sort_hash_table): Likewise.
500         (mips_elf64_swap_msym_out): Likewise.
501         (mips_elf64_create_local_got_entry): Likewise.
502         (mips_elf64_local_got_index): Likewise.
503         (mips_elf64_got_page): Likewise.
504         (mips_elf64_got16_entry): Likewise.
505         (mips_elf64_local_relocation_p): Likewise.
506         (mips_elf64_next_relocation): Likewise.
507         (mips_elf64_create_dynamic_relocation): Likewise.
508         (mips_elf64_calculate_relocation): Likewise.
509         (mips_elf64_obtain_contents): Likewise.
510         (mips_elf64_perform_relocation): Likewise.
511         (mips_elf64_relocate_section): Likewise.
512         (mips_elf64_create_dynamic_sections): Likewise.
513         (mips_elf64_adjust_dynamic_symbol): Likewise.
514         (mips_elf64_always_size_sections): Likewise.
515         (mips_elf64_size_dynamic_sections): Likewise.
516         (mips_elf64_finish_dynamic_symbol): Likewise.
517         (mips_elf64_finish_dynamic_sections): Likewise.
518         (mips_elf64_gc_mark_hook): Likewise.
519         (mips_elf64_gc_sweep_hook): Likewise.
520         (mips_elf64_create_got_section): Likewise.
521         (mips_elf64_record_global_got_symbol): Likewise.
522         (mips_elf64_create_msym_section): Likewise.
523         (mips_elf64_allocate_dynamic_relocations): Likewise.
524         (mips_elf64_check_relocs): Likewise.
525         (mips_elf64_output_extsym): Likewise.
526         (mips_elf64_swap_gptab_in): Likewise.
527         (mips_elf64_swap_gptab_out): Likewise.
528         (gptab_compare): Likewise.
529         (mips_elf64_final_link): Likewise.
530         (prev_reloc_addend): Remenber addend of previous parts of a combined
531         reloc.
532         (ELF_MIPS_GP_OFFSET): New define.
533         (STUB_LW,STUB_MOVE,STUB_JALR,STUB_LI16): Likewise.
534         (MIPS_FUNCTION_STUB_SIZE): Likewise.
535         (mips_elf64_howto_rel): Fix HOWTO defines.
536         (mips_elf64_howto_rela): Likewise.
537         (mips_elf64_swap_reloca_out): Fix signedness.
538         (mips_elf64_be_swap_reloc_in): Use ELF64* instead of ELF32*.
539         (mips_elf64_be_swap_reloca_in): Likewise.
540         (mips_elf64_be_swap_reloc_out): Likewise. Preserve extended type info.
541         (mips_elf64_be_swap_reloca_out): Likewise.
542
543 2001-12-15  Jakub Jelinek  <jakub@redhat.com>
544
545         * elf-bfd.h (_bfd_elf_maybe_strip_eh_frame_hdr): New prototype.
546         * elf-eh-frame.c (struct eh_frame_hdr_info): Add strip.
547         (_bfd_elf_discard_section_eh_frame): Don't create .eh_frame_hdr
548         sec_info here.  Free ehbuf.
549         (_bfd_elf_discard_section_eh_frame_hdr): Don't size the section
550         if hdr_info->strip.
551         (_bfd_elf_maybe_strip_eh_frame_hdr): New.
552         * elflink.h (size_dynamic_sections): Call it.
553
554 2001-12-14  Alan Modra  <amodra@bigpond.net.au>
555
556         * elflink.h (elf_bfd_discard_info): Fix segfault when dynobj NULL.
557
558 2001-12-13  Jakub Jelinek  <jakub@redhat.com>
559
560         * elf-bfd.h (enum elf_link_info_type): New.
561         (struct bfd_elf_section_data): Remove stab_info and merge_info
562         fields, add sec_info and sec_info_type.
563         (struct elf_obj_tdata): Add eh_frame_hdr field.
564         (_bfd_elf_discard_section_eh_frame): New prototype.
565         (_bfd_elf_discard_section_eh_frame_hdr): Likewise.
566         (_bfd_elf_eh_frame_section_offset): Likewise.
567         (_bfd_elf_write_section_eh_frame): Likewise.
568         (_bfd_elf_write_section_eh_frame_hdr): Likewise.
569         * Makefile.am (BFD32_BACKENDS): Add elf-eh-frame.lo.
570         (BFD32_BACKENDS_CFILES): Add elf-eh-frame.c.
571         (elf-eh-frame.lo): New.
572         * Makefile.in: Rebuilt.
573         * configure.in (elf): Add elf-eh-frame.lo.
574         * configure: Rebuilt.
575         * elf.c (_bfd_elf_print_private_bfd_data): Support PT_GNU_EH_FRAME.
576         (map_sections_to_segments): Create PT_GNU_EH_FRAME if requested.
577         (get_program_header_size): Take into account PT_GNU_EH_FRAME
578         segment.
579         (_bfd_elf_rela_local_sym): Use sec_info_type and sec_info.
580         (_bfd_elf_rel_local_sym): Likewise.
581         (_bfd_elf_section_offset): Likewise.  Call
582         _bfd_elf_eh_frame_section_offset too.
583         * elfxx-ia64.c (elfNN_ia64_relocate_section): Use sec_info_type and
584         sec_info.
585         * elf64-alpha.c (elf64_alpha_relocate_section): Likewise.
586         * elf-eh-frame.c: New file.
587         * elflink.h (elf_link_add_object_symbols): Don't optimize SHF_MERGE
588         .stab sections.  Set sec_info_type, use sec_info instead
589         of merge_info and stab_info.
590         (elf_link_create_dynamic_sections): Create .eh_frame_hdr section
591         if --eh-frame-hdr.
592         (elf_bfd_final_link): Write .eh_frame_hdr section.
593         (elf_link_sec_merge_syms): Use sec_info_type and sec_info.
594         (elf_link_input_bfd): Likewise.
595         Call _bfd_elf_write_section_eh_frame to write .eh_frame sections.
596         (elf_bfd_discard_info): Add output_bfd argument.
597         Call _bfd_elf_discard_section_eh_frame and
598         _bfd_elf_discard_section_eh_frame_hdr.
599         (elf_section_ignore_discarded_relocs): Use sec_info_type, not section
600         names.
601         * bfd-in.h (bfd_elf32_discard_info, bfd_elf64_discard_info): Adjust
602         prototypes.
603         * bfd-in2.h (bfd_elf32_discard_info, bfd_elf64_discard_info): Likewise.
604
605 2001-12-12  Richard Henderson  <rth@redhat.com>
606
607         * syms.c (_bfd_generic_read_minisymbols): Early return for
608         no symbols.  Patch from FreeBSD folk; exact origin unknown.
609
610 2001-12-11  Alan Modra  <amodra@bigpond.net.au>
611
612         * elfcode.h (elf_swap_ehdr_out): Adjust value written for e_shnum
613         and e_shstrndx if out of range.
614         (elf_object_p): Read extended values for e_shnum and e_shstrndx
615         from the first section header.  Allocate space in elf_elfsections
616         for reserved sections and set to NULLs.
617         (elf_write_shdrs_and_ehdr): Set overflow fields in first section
618         header.  Skip reserved sections in elf_elfsections.  Remove
619         duplicate size calculation.
620
621 2001-12-07  Geoffrey Keating  <geoffk@redhat.com>
622             Richard Henderson  <rth@redhat.com>
623             Corinna Vinschen  <vinschen@redhat.com>
624
625         * Makefile.am: Add support for xstormy16.
626         * archures.c: Add support for xstormy16.
627         * config.bfd: Add support for xstormy16.
628         * configure.in: Add support for xstormy16.
629         * reloc.c: Add support for xstormy16.
630         * targets.c: Add support for xstormy16.
631         * cpu-xstormy16.c: New file.
632         * elf32-xstormy16.c: New file.
633         * Makefile.in: Regenerated.
634         * bfd-in2.h: Regenerated.
635         * configure: Regenerated.
636         * libbfd.h: Regenerated.
637
638 2001-12-07  Nick Clifton  <nickc@cambridge.redhat.com>
639
640         * elf.c (assign_file_positions_for_segments): Combine sentance
641         fragments into a single sentance in order to permit better
642         translation into foreign languages.
643
644 2001-12-07  Jim Blandy  <jimb@redhat.com>
645
646         * elf32-s390.c (elf32_s390_grok_prstatus): New function.
647         (elf_backend_grok_prstatus): Define.
648
649 2001-12-07  Jakub Jelinek  <jakub@redhat.com>
650
651         * elf32-sparc.c (elf32_sparc_relocate_section): Revert
652         2001-09-14 change.
653
654 2001-12-07  Jakub Jelinek  <jakub@redhat.com>
655
656         * elf.c (_bfd_elf_rela_local_sym): Only call
657         _bfd_merged_section_offset if merge_info is non-NULL.
658         (_bfd_elf_rel_local_sym, _bfd_elf_section_offset): New.
659         * elf-bfd.h (_bfd_elf_rel_local_sym, _bfd_elf_section_offset): New
660         prototypes.
661         * elf32-arm.h (elf32_arm_final_link_relocate): Use
662         _bfd_elf_section_offset.
663         (elf32_arm_relocate_section): Use _bfd_elf_rel_local_sym.
664         * elf32-i386.c (elf_i386_relocate_section): Use
665         _bfd_elf_section_offset and _bfd_elf_rel_local_sym.
666         * elf32-sh.c (sh_elf_relocate_section): Likewise.
667         * elf32-sparc.c (elf32_sparc_relocate_section): Use
668         _bfd_elf_section_offset.
669         * elf32-cris.c (cris_elf_relocate_section): Likewise.
670         * elf32-hppa.c (elf32_hppa_relocate_section): Likewise.
671         * elf32-i370.c (i370_elf_relocate_section): Likewise.
672         * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
673         * elf32-mips.c (mips_elf_create_dynamic_relocation): Likewise.
674         * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
675         * elf32-s390.c (elf_s390_relocate_section): Likewise.
676         * elf64-alpha.c (elf64_alpha_relocate_section): Likewise.
677         * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
678         * elf64-s390.c (elf_s390_relocate_section): Likewise.
679         * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
680         * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
681         * elfxx-ia64.c (elfNN_ia64_install_dyn_reloc): Likewise.
682
683 2001-12-07  Alan Modra  <amodra@bigpond.net.au>
684
685         * elf32-hppa.c (clobber_millicode_symbols): Don't do anything if
686         already forced local.
687
688 2001-12-05  Nick Clifton  <nickc@cambridge.redhat.com>
689
690         * elf32-arm.h (elf32_arm_merge_private_bfd_data): Combine
691         fragmented sentence parts into a whole sentence to permit
692         better translation into foreign languages.
693
694 2001-12-06  Hans-Peter Nilsson  <hp@bitrange.com>
695
696         * configure: Regenerate.
697         * Makefile.in: Regenerate.
698
699 2001-12-05  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
700
701         * Makefile.am: split up BFD_LIBS like statements in BFD32_LIBS and
702         BFD64_LIBS, make the latter depending on the availability of BFD64.
703         Add archive64.c source file.
704         * archive64.c: New file implementing bfd_elf64_archive_slurp_armap
705         and bfd_elf64_archive_write_armap, code from elf64-mips.c
706         * archive.c (bfd_slurp_armap): Add ELF64 archive support.
707         * config.bfd (mips*-*-irix6*): Allow with BFD64 only.
708         (mips64*el-*-linux*): Likewise.
709         (mips*el-*-linux*): Likewise. Reorder entries.
710         * configure.in (bfd_libs): Define in dependency of BFD64 and
711         AC_SUBST it.
712         * elf64-mips.c (mips_elf64_slurp_armap): Remove, use
713         bfd_elf64_archive_slurp_armap instead.
714         (mips_elf64_write_armap): Remove, use bfd_elf64_archive_write_armap
715         instead.
716
717 2001-12-04  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
718
719         * config.bfd: Remove trailing blanks.
720         * elf32-mips.c (gprel16_with_gp): Remove superfluous casts.
721
722 2001-12-04  Alexandre Oliva  <aoliva@redhat.com>
723
724         * elf32-d10v.c (elf_d10v_howto_table): Adjust bit-size of
725         R_D10V_10_PCREL_L, R_D10V_10_PCREL_R, R_D10V_18,
726         R_D10V_18_PCREL.  Check 10_PCREL relocations as signed.
727         Disable pointless overflow checking of NONE and 32.
728
729 2001-12-04  Alan Modra  <amodra@bigpond.net.au>
730
731         * reloc.c (bfd_install_relocation): Correct reloc address test.
732         (bfd_perform_relocation): Formatting fix.
733         * bfd-in2.h: Regenerate for 2001-12-02 reloc.c change.
734
735 2001-12-03  Nick Clifton  <nickc@cambridge.redhat.com>
736
737         * configure.in (LINGUAS): Add tr.
738         * configure: Regenerate.
739         * po/tr.po: Import from translation project's web site.
740
741 2001-12-03  Alan Modra  <amodra@bigpond.net.au>
742
743         * elf32-hppa.c (hppa_get_stub_entry): Remove debug message that
744         happens to trigger on undefined symbols.
745         (final_link_relocate): Return bfd_reloc_undefined for undefined
746         stubs.
747         (elf32_hppa_relocate_section): Don't say we can't handle a reloc
748         if we have already warned about an undefined symbol.
749
750 2001-12-02  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
751
752         * elf32-mips.c (NEWABI_P): New define.
753         (USE_REL): Remove, replaced by
754         (elf_backend_may_use_rel_p): New define.
755         (elf_backend_may_use_rela_p): Likewise.
756         (elf_backend_default_use_rela_p): Likewise.
757         (elf_mips_howto_table): Rename to elf_mips_howto_table_rel.
758         Fix some relocation definitions.
759         (elf_mips_howto_table_rela): New RELA relocation definitions for
760         NewABI support.
761         (mips32_64bit_reloc): Use the renamed elf_mips_howto_table_rel.
762         (bfd_elf32_bfd_reloc_type_lookup): Likewise.
763         (mips_rtype_to_howto): Likewise.
764         (_bfd_mips_elf_relocate_section): Likewise.
765         (_bfd_mips_elf_object_p): Typo.
766         (elf_backend_sign_extend_vma): Reordered together with many other
767         defines nearby to resemble the order of declaration in the header
768         file.
769
770 2001-12-02  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
771
772         * coff-mips.c (mips_bfd_reloc_type_lookup): Replace
773         BFD_RELOC_MIPS_GPREL by BFD_RELOC_GPREL16.
774         * pe-mips.c (mips_bfd_reloc_type_lookup): Likewise.
775         * elf32-mips.c (mips_reloc_map): Likewise. Replace
776         BFD_RELOC_MIPS_GPREL32 by BFD_RELOC_GPREL32.
777         * elf64-mips.c (mips_reloc_map): Likewise.
778         * reloc.c (BFD_RELOC_MIPS_GPREL): Remove.
779         (BFD_RELOC_MIPS_GPREL32): Remove.
780
781 2001-11-30  H.J. Lu <hjl@gnu.org>
782
783         * elflink.h (elf_add_default_symbol): New.
784         (elf_link_add_object_symbols): Call elf_add_default_symbol ()
785         to create an indirect symbol from the default for the symbol
786         with the default version if needed.
787
788 2001-11-29  "Peter.Schauer" <Peter.Schauer@regent.e-technik.tu-muenchen.de>
789
790         * elf.c (elfcore_grok_prstatus): Do not overwite the core signal
791         if it has already been set by another thread.
792
793 2001-11-28  Jakub Jelinek  <jakub@redhat.com>
794
795         * elf64-alpha.c (ALPHA_ELF_GOT_ENTRY_RELOCS_XLATED): Defined.
796         (elf64_alpha_relocate_section): Translate local_got_entries
797         for STT_SECTION symbol to SHF_MERGE section the first time
798         we see it.
799         * elfxx-ia64.c (struct elfNN_ia64_local_hash_entry): Add
800         sec_merge_done.
801         (get_local_sym_hash): New, extracted from get_dyn_sym_info.
802         (get_dyn_sym_info): Use it.
803         (elfNN_ia64_relocate_section): Translate local dyn entries
804         for STT_SECTION symbol to SHF_MERGE section the first time
805         we see it.
806
807 2001-11-27  H.J. Lu <hjl@gnu.org>
808
809         * elflink.h (elf_bfd_discard_info): Skip if the input bfd isn't
810         ELF.
811
812 2001-11-26  Jeffrey A Law  (law@cygnus.com)
813
814         * stabs.c (_bfd_discard_section_stabs): Use PARAMS in function
815         prototypes.
816
817 2001-11-24  Alan Modra  <amodra@bigpond.net.au>
818
819         * elf32-hppa.c (elf32_hppa_size_stubs): Decrease default stub
820         group sizes to accommodate c++.
821
822 2001-11-23  Jakub Jelinek  <jakub@redhat.com>
823
824         * elf32-sparc.c (elf32_sparc_relocate_section): Don't clear
825         relocations in non-alloced sections against global symbols
826         defined in shared library being built.
827         * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
828
829 2001-11-23  Jakub Jelinek  <jakub@redhat.com>
830
831         * elf.c (_bfd_elf_rela_local_sym): New.
832         * elflink.h (elf_link_input_bfd): Don't consider empty
833         merged sections as removed in relocation tests.
834         * elf-bfd.h (_bfd_elf_rela_local_sym): Add prototype.
835         * elf32-i386.c (elf_i386_relocate_section): Handle relocs
836         against STT_SECTION symbol of SHF_MERGE section.
837         * elf32-arm.h (elf32_arm_relocate_section): Likewise.
838         * elf32-avr.c (elf32_avr_relocate_section): Call
839         _bfd_elf_rela_local_sym.
840         * elf32-cris.c (cris_elf_relocate_section): Likewise.
841         * elf32-d10v.c (elf32_d10v_relocate_section): Likewise.
842         * elf32-fr30.c (fr30_final_link_relocate): Likewise.
843         * elf32-h8300.c (elf32_h8_relocate_section): Likewise.
844         * elf32-hppa.c (elf32_hppa_relocate_section): Likewise.
845         * elf32-i370.c (i370_elf_relocate_section): Likewise.
846         * elf32-i860.c (elf32_i860_relocate_section): Likewise.
847         * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
848         * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
849         * elf32-mcore.c (mcore_elf_relocate_section): Likewise.
850         * elf32-openrisc.c (openrisc_elf_relocate_section): Likewise.
851         * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
852         * elf32-s390.c (elf_s390_relocate_section): Likewise.
853         * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
854         * elf32-v850.c (v850_elf_relocate_section): Likewise.
855         * elf64-alpha.c (elf64_alpha_relocate_section): Likewise.
856         * elf64-mmix.c (mmix_elf_relocate_section): Likewise.
857         * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
858         * elf64-s390.c (elf_s390_relocate_section): Likewise.
859         * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
860         * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
861         * elf-hppa.h (elf_hppa_relocate_section): Likewise.
862         * elf-m10200.c (mn10200_elf_relocate_section): Likewise.
863         * elf-m10300.c (mn10300_elf_relocate_section): Likewise.
864         * elfxx-ia64.c (elfNN_ia64_relocate_section): Likewise.
865         * elf32-sh.c (sh_elf_relocate_section): Likewise for
866         !partial_inplace relocs. Handle relocs against STT_SECTION
867         symbol of SHF_MERGE for partial_inplace relocs.
868
869 2001-11-21  Nick Clifton  <nickc@cambridge.redhat.com>
870
871         * po/Make-in (distclean): Move SRC-POTFILES.in and
872         BLD-POTFILES.in to maintainer-clean target.
873
874 2001-11-21  Alan Modra  <amodra@bigpond.net.au>
875
876         * elfxx-ia64.c (elfNN_ia64_relocate_section): Test r_symndx rather
877         than sym_sec->output_section to detect relocs against discarded
878         sections.
879
880 2001-11-19  H.J. Lu  <hjl@gnu.org>
881
882         * elflink.h (elf_link_input_bfd): Assert r_symndx != 0 when
883         discarding relocations.
884
885 2001-11-19  Nick Clifton  <nickc@cambridge.redhat.com>
886
887         * section.c (bfd_is_const_section): New macro.  Return true if the
888         given seciton is one of the special, constant, sections.
889         * bfd-in2.h: Regenerate.
890         * coffgen.c (coff_count_linenumbers): Use bfd_is_const_section.
891         (coff_write_native_symbol): Use bfd_is_const_section.
892
893 2001-11-19  Alan Modra  <amodra@bigpond.net.au>
894
895         * elf32-hppa.c (clobber_millicode_symbols): Dec dynstr refcount.
896
897         * elf32-hppa.c (elf32_hppa_size_stubs): Don't consider undefined
898         millicode syms as candidates for import stubs.
899
900         * elf32-hppa.c (PLABEL_PLT_ENTRY_SIZE): Delete.
901         (allocate_PIC_calls): Rename to allocate_plt_static.
902         (allocate_dynrelocs): Move most of code handling .plt entries to..
903         (allocate_plt_static): ..here.  Don't drop plabel entries.
904
905 2001-11-19  Hans-Peter Nilsson  <hp@bitrange.com>
906
907         * mmo.c: Adjust documentation tags to use texinfo 4 features.
908
909 2001-11-16  Nick Clifton  <nickc@cambridge.redhat.com>
910
911         * section.c (bfd_is_const_section): New macro.  Return true if the
912         section pointer refers to one of the special, constant sections.
913         * bfd-in2.h: Regenerate.
914
915         * coffgen.c (coff_count_linenumbers): Only update the line number
916         count in non-special sections.
917         (coff_write_native_symbol): Only update the line number file
918         position in non-special sections.
919
920 2001-11-15  Daniel Jacobowitz  <drow@mvista.com>
921
922         * elflink.h (elf_reloc_symbol_deleted_p): Catch all relocs against
923         local syms from discarded sections.  Update comment.
924
925 2001-11-15  Alan Modra  <amodra@bigpond.net.au>
926
927         * po/SRC-POTFILES.in: Regenerate.
928
929         * elflink.h (elf_link_input_bfd): Complain about all relocs
930         against local syms from discarded sections.  K&R fixes.
931         (elf_reloc_symbol_deleted_p): Don't try to swap in external syms.
932         K&R fixes.
933
934 2001-11-15  Alexandre Oliva  <aoliva@redhat.com>
935
936         * elf64-sparc.c (sparc64_elf_relocate_section): Disregard
937         overflows in the .stab section.
938
939 2001-11-14  Daniel Jacobowitz  <drow@mvista.com>
940
941         * bfd-in.h (bfd_elf32_discard_info): Add prototype.
942         (bfd_elf64_discard_info): Likewise.
943         * bfd-in2.h: Regenerate.
944         * elf-bfd.h (struct elf_reloc_cookie): New.
945         (struct elf_backend_data): Add elf_backend_discard_info,
946         elf_backend_ignore_discarded_relocs, and elf_backend_write_section.
947         (_bfd_elf32_reloc_symbol_deleted_p): Add prototype.
948         (_bfd_elf64_reloc_symbol_deleted_p): Likewise.
949         * elf32-mips.c (_bfd_elf32_mips_discard_info): New.
950         (_bfd_elf32_mips_ignore_discarded_relocs): New.
951         (_bfd_elf32_mips_write_section): New.
952         (elf_backend_discard_info): Define.
953         (elf_backend_ignore_discarded_relocs): Define.
954         (elf_backend_write_section): Define.
955         * elfcode.h (elf_bfd_discard_info): Define.
956         (elf_reloc_symbol_deleted_p): Define.
957         * elflink.h (elf_link_input_bfd): Check
958         elf_section_ignore_discarded_relocs.  Call
959         bed->elf_backend_write_section if available.
960         (elf_reloc_symbol_deleted_p): New.
961         (elf_bfd_discard_info): New.
962         (elf_section_ignore_discarded_relocs): New.
963         * elfxx-target.h (elf_backend_discard_info): Define.
964         (elf_backend_ignore_discarded_relocs): Define.
965         (elf_backend_write_section): Define.
966         (elfNN_bed): Add elf_backend_discard_info,
967         elf_backend_ignore_discarded_relocs, and
968         elf_backend_write_section.
969         * libbfd-in.h (_bfd_discard_section_stabs): Add prototype.
970         * libbfd.h: Regenerate.
971         * stabs.c (_bfd_discard_section_stabs): New.
972
973 2001-11-14  Martin Schwidefsky  <schwidefsky@de.ibm.com>
974
975         * elf32-s390.c (elf_s390_relocate_section): Use the "unresolved_reloc"
976         scheme to get rid of an ugly complicated test.
977         * elf64-s390.c (elf_s390_relocate_section): Likewise.
978
979 2001-11-14  Andreas Jaeger  <aj@suse.de>
980
981         * cpu-i386.c (bfd_x86_64_arch_intel_syntax,bfd_x86_64_arch): Use
982         x86-64 for display.
983
984 2001-11-14  Jakub Jelinek  <jakub@redhat.com>
985
986         * dwarf2.c (struct line_head) [total_length]: Change type to
987         bfd_vma.
988         (struct dwarf2_debug): Add dwarf_str_buffer and dwarf_str_size.
989         (struct comp_unit): Add stash and offset_size.
990         (read_8_bytes): Return bfd_vma.
991         (read_indirect_string): New.
992         (read_attribute): Handle DW_FORM_strp.
993         (decode_line_info): Support 64-bit DWARF format.
994         (_bfd_dwarf2_find_nearest_line): Likewise.
995         (parse_comp_unit): Set offset_size and stash.
996
997 2001-11-13  Keith Walker <keith.walker@arm.com>
998
999         * dwarf2.c (read_attribute_value): New function to handle
1000         DW_FORM_indirect.
1001         (read_attribute): Use it.
1002
1003 2001-11-13  Geoffrey Keating  <geoffk@redhat.com>
1004
1005         * dwarf2.c (decode_line_info): Properly deal with unknown standard
1006         opcodes.
1007
1008 2001-11-13  John Marshall  <jmarshall@acm.org>
1009             Alan Modra  <amodra@bigpond.net.au>
1010
1011         * section.c (bfd_make_section_anyway): Don't increment section_id
1012         and the BFD's section_count if adding the section failed.
1013         * vms.c (vms_new_section_hook): Adjust for bfd_make_section_anyway
1014         change.
1015
1016 2001-11-12  Orjan Friberg  <orjanf@axis.com>
1017
1018         * elf32-cris.c (cris_elf_grok_prstatus): Adjust values to match new
1019         core dump format.
1020
1021 2001-11-11  H.J. Lu <hjl@gnu.org>
1022
1023         * elf32-mips.c (_bfd_mips_elf_finish_dynamic_sections): Call
1024         _bfd_elf_strtab_size instead of _bfd_stringtab_size.
1025
1026         * elf64-sparc.c (sparc64_elf_size_dynamic_sections): Change
1027         dynstr type to `struct elf_strtab_hash *'.
1028
1029 2001-11-11  Hans-Peter Nilsson  <hp@bitrange.com>
1030
1031         * elf-strtab.c (_bfd_elf_strtab_finalize): Make first variable i
1032         size_t.  Rename second i to j.
1033
1034 2001-11-10  Jeffrey A Law  (law@cygnus.com)
1035
1036         * binary.c: Include safe-ctype.h after bfd.h and sysdep.h.
1037
1038 2001-11-10  Alan Modra  <amodra@bigpond.net.au>
1039
1040         * elf32-arm.h (elf32_arm_final_link_relocate): Don't copy STN_UNDEF
1041         relocs into shared libs.
1042         * elf32-cris.c (cris_elf_relocate_section): Likewise.
1043         * elf32-i370.c (i370_elf_relocate_section): Likewise.
1044         * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
1045         * elf32-mips.c (mips_elf_calculate_relocation): Likewise.
1046         * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
1047         * elf32-sh.c (sh_elf_relocate_section): Likewise.
1048         * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
1049         * elf64-alpha.c (elf64_alpha_relocate_section): Likewise.
1050         * elf64-s390.c (elf_s390_relocate_section): Likewise.
1051         * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
1052         * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
1053         * elfxx-ia64.c (elfNN_ia64_relocate_section): Likewise.
1054
1055         * elf.c (bfd_section_from_r_symndx): New function.
1056         * elf-bfd.h (LOCAL_SYM_CACHE_SIZE): Define.
1057         (struct sym_sec_cache): New.
1058         (bfd_section_from_r_symndx): Declare.
1059         (struct bfd_elf_section_data): Change local_dynrel type to PTR.
1060         * elflink.h (elf_link_input_bfd): Don't test for removed linkonce
1061         relocs when relocatable.  Don't zero entire reloc, just zero the
1062         addend and sym.
1063         * elf32-hppa.c (struct elf32_hppa_link_hash_table): Add sym_sec.
1064         (elf32_hppa_link_hash_table_create): Init it.
1065         (elf32_hppa_check_relocs): Track dynamic relocs needed for local
1066         syms on a per-section basis as we do for globals.
1067         (elf32_hppa_gc_sweep_hook): Update for local_dynrel change.
1068         (allocate_dynrelocs): Warning fix.
1069         (elf32_hppa_size_dynamic_sections): Don't allocate relocs when
1070         section has been discarded.
1071         (elf32_hppa_relocate_section): Don't copy STN_UNDEF relocs
1072         into shared libs.
1073         * elf32-i386.c (struct elf_i386_link_hash_table): Add sym_sec.
1074         (elf_i386_link_hash_table_create): Init it.
1075         (elf_i386_check_relocs): Track dynamic relocs needed for local
1076         syms on a per-section basis as we do for globals.
1077         (elf_i386_gc_sweep_hook): Update for local_dynrel change.
1078         Remove dead code.
1079         (allocate_dynrelocs): Warning fix.
1080         (elf_i386_size_dynamic_sections): Don't allocate relocs when
1081         section has been discarded.
1082         (elf_i386_relocate_section): Don't copy STN_UNDEF relocs
1083         into shared libs.
1084         * elf32-s390.c (struct elf_s390_link_hash_table): Add sym_sec.
1085         (elf_s390_link_hash_table_create): Init it.
1086         (elf_s390_check_relocs): Track dynamic relocs needed for local
1087         syms on a per-section basis as we do for globals.
1088         (elf_s390_gc_sweep_hook): Update for local_dynrel change.
1089         Remove dead code.
1090         (allocate_dynrelocs): Warning fix.
1091         (elf_s390_size_dynamic_sections): Don't allocate relocs when
1092         section has been discarded.
1093         (elf_s390_relocate_section): Don't copy STN_UNDEF relocs
1094         into shared libs.
1095         * elf64-ppc.c (struct ppc_link_hash_table): Add sym_sec.
1096         (ppc64_link_hash_table_create): Init it.
1097         (ppc64_elf_check_relocs): Track dynamic relocs needed for local
1098         syms on a per-section basis as we do for globals.
1099         (ppc64_elf_gc_sweep_hook): Update for local_dynrel change.
1100         (allocate_dynrelocs): Call the correct record_dynamic_dymbol
1101         function.  Warning fix.
1102         (ppc64_elf_size_dynamic_sections): Don't allocate relocs when
1103         section has been discarded.
1104         (ppc64_elf_relocate_section): Don't copy STN_UNDEF relocs
1105         into shared libs.
1106         * elf64-s390.c (struct elf_s390_link_hash_table): Add sym_sec.
1107         (elf_s390_link_hash_table_create): Init it.
1108         (elf_s390_check_relocs): Track dynamic relocs needed for local
1109         syms on a per-section basis as we do for globals.
1110         (elf_s390_gc_sweep_hook): Update for local_dynrel change.
1111         Remove dead code.
1112         (allocate_dynrelocs): Warning fix.
1113         (elf_s390_size_dynamic_sections): Don't allocate relocs when
1114         section has been discarded.
1115         (elf_s390_relocate_section): Don't copy STN_UNDEF relocs
1116         into shared libs.
1117
1118 2001-11-08  Martin Schwidefsky  <schwidefsky@de.ibm.com>
1119
1120         * elf32-s390: Major rework that introduces all recent changes to
1121         the s390 backends.  Get a closer match to elf32-i386.
1122         (elf_s390_relocate_section): Make use of dynamic section short-cuts.
1123         Localise vars, and delay setting.  Better error reporting, replace
1124         BFD_ASSERT with abort.  Check ELF_LINK_HASH_DEF_DYNAMIC to see if a
1125         symbol is not defined in the regular object file and tread the weak
1126         definition as the normal one.  Don't discard relocs for undefweak or
1127         undefined symbols and check !DEF_REGULAR as well as DEF_DYNAMIC in
1128         test for avoided copy relocs.  Reinstate fudge for unresolved relocs
1129         in debugging sections.
1130         (elf32_s390_adjust_dynamic_symbol): Handle nocopyreloc.  Don't do copy
1131         reloc processing for weakdefs.  Remove redundant casts and aborts.
1132         Delay setting of vars until needed.  Move creation of dynamic symbols
1133         and allocation of .plt and .rela.plt to allocate_dynrelocs.  Replace
1134         BFD_ASSERT with abort.  Discard .plt entries for everything with
1135         plt.refcount <= 0.
1136         (elf_s390_check_relocs):  Don't allocate space for dynamic relocs,
1137         .got or .relgot here but do it in allocate_dynrelocs.  Reference count
1138         possible .plt and .got entries.  Don't test input section SEC_READONLY
1139         here to try to avoid copy relocs, and keep dyn_relocs regardless of
1140         ELF_LINK_NON_GOT_REF.  Don't set DF_TEXTREL here.  Delay setting of
1141         variables until needed.  Remove separate switch stmt for creating .got
1142         section.  Initialise local_got_refcounts to 0.  Cache pointer to
1143         "sreloc" section in elf_section_data. Tweak condition under which .got
1144         created.  Report files with bad relocation section names.
1145         (elf_s390_finish_dynamic_symbol): Don't copy relocs for symbols that
1146         have been forced local.  Use same test to decide if we can use a
1147         relative reloc for got as elf_s390_relocate_section.  Expand SHN_UNDEF
1148         comment.  Move expressions out of function calls.  Replace BFD_ASSERT
1149         with abort.
1150         (elf_s390_finish_dynamic_sections): Migrate common code out of switch
1151         statement.  Replace BFD_ASSERT with abort.
1152         (elf_s390_size_dynamic_sections): Call readonly_dynrelocs. Rename "i"
1153         to "ibfd".  Allocate space for local dyn relocs.  Use DF_TEXTREL flag
1154         instead of looking up section names for DT_TEXTREL.  Replace
1155         BFD_ASSERT with abort.  Zero out the dynamic allocated content space.
1156         Add a comment to remind us that one day this ought to be fixed.
1157         (struct elf_s390_link_hash_entry): Rename "root" to "elf".
1158         (struct elf_s390_link_hash_table): Likewise.
1159         (elf_s390_link_hash_newfunc): Rename to link_hash_newfunc and get
1160         rid of unnecessary casts.
1161         (struct elf_s390_dyn_relocs): Add "sec", and "pc_count" fields.
1162         Remove "section" field.
1163         (elf_s390_gc_sweep_hook): Sweep dyn_relocs and local_dynrel.
1164         Reference count possible .plt entries.  Don't deallocate .got and
1165         .relgot space here.
1166         (struct elf_s390_pcrel_relocs_copied): Rename to elf_s390_dyn_relocs.
1167         Update comment.
1168         (struct elf_s390_link_hash_entry): Rename pcrel_relocs_copied to
1169         dyn_relocs.
1170         (elf_s390_discard_copies):  Delete.
1171         (elf_s390_link_hash_traverse): Delete.
1172         (bfd_elf32_bfd_final_link): Delete.  (ie. use regular final link
1173         rather than gc variety).
1174         (struct elf_s390_link_hash_table): Add sgot, sgotplt, srelgot, splt,
1175         srelplt, sdynbss, srelbss fields.
1176         (elf_s390_link_hash_table_create): Init them.
1177         (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Define.
1178         (allocate_dynrelocs): New function.
1179         (create_got_section): New function.
1180         (elf_backend_can_refcount): Define.
1181         (elf_backend_copy_indirect_symbol): Define.
1182         (elf_s390_copy_indirect_symbol): New function.
1183         (elf_s390_create_dynamic_sections): New function.
1184         (readonly_dynrelocs): New function.
1185         * elf64-s390.c: Likewise.
1186
1187 2001-11-07  Jakub Jelinek  <jakub@redhat.com>
1188
1189         * Makefile.am (BFD32_BACKENDS): Add elf-strtab.lo.
1190         (BFD32_BACKENDS_CFILES): Add elf-strtab.c.
1191         (elf-strtab.lo): Add rule.
1192         * Makefile.in: Rebuilt.
1193         * configure.in (elf): Add elf-strtab.lo.
1194         * configure: Rebuilt.
1195         * elf-bfd.h (elf_strtab_hash): Forward declare.
1196         (struct elf_link_hash_table): Change dynstr type to
1197         struct elf_strtab_hash *.
1198         (struct elf_obj_tdata): Change strtab_ptr type to
1199         struct elf_strtab_hash *.
1200         (_bfd_elf_strtab_init, _bfd_elf_strtab_free, _bfd_elf_strtab_add,
1201         _bfd_elf_strtab_addref, _bfd_elf_strtab_delref,
1202         _bfd_elf_strtab_clear_all_refs, _bfd_elf_strtab_size,
1203         _bfd_elf_strtab_offset, _bfd_elf_strtab_emit,
1204         _bfd_elf_strtab_finalize): New prototypes.
1205         * elf-strtab.c: New file.
1206         * elflink.h (elf_link_add_object_symbols): Use _bfd_elf_strtab_add
1207         and _bfd_elf_strtab_size instead of _bfd_stringtab calls.
1208         Call _bfd_elf_strtab_delref if DT_NEEDED entry is not needed or
1209         when forcing dynamic symbol to local.
1210         (elf_link_create_dynamic_sections): Call
1211         _bfd_elf_strtab_init instead of elf_stringtab_init.
1212         (elf_link_record_local_dynamic_symbol): Likewise, change
1213         dynstr type.  Use _bfd_elf_strtab functions instead of
1214         _bfd_stringtab calls.
1215         (size_dynamic_sections): Use _bfd_elf_strtab functions instead of
1216         _bfd_stringtab calls.  For DT_RUNPATH and Verdaux vda_name fields,
1217         call _bfd_elf_strtab_addref.  Call elf_finalize_dynstr.
1218         (elf_adjust_dynstr_offsets, elf_finalize_dynstr): New functions.
1219         (elf_fix_symbol_flags): Call _bfd_elf_strtab_delref when forcing
1220         dynamic symbol to local.
1221         (elf_link_assign_sym_version): Likewise.
1222         (elf_bfd_final_link): Call _bfd_elf_strtab_emit instead of
1223         _bfd_stringtab_emit.
1224         * elflink.c (_bfd_elf_link_record_dynamic_symbol): Change dynstr
1225         type.  Call _bfd_elf_strtab functions instead of
1226         _bfd_stringtab functions.
1227         * elf64-sparc.c (sparc64_elf_size_dynamic_sections): Likewise.
1228         * elf.c (_bfd_elf_init_reloc_shdr): Likewise.
1229         (elf_fake_sections): Likewise.
1230         (assign_section_numbers): Call _bfd_elf_strtab_clear_all_refs
1231         on shstrtab hash table, call _bfd_elf_strtab_addref on each section
1232         name in the output.  Call _bfd_elf_strtab_finalize and
1233         use _bfd_elf_strtab_offset to finalize sh_name section header fields.
1234         (_bfd_elf_compute_section_file_positions): Use _bfd_elf_strtab_size
1235         instead of _bfd_stringtab_size.
1236         (prep_headers): Change shstrtab type.
1237         Use _bfd_elf_strtab calls instead of _bfd_stringtab calls.
1238
1239 2001-11-07  Alan Modra  <amodra@bigpond.net.au>
1240
1241         * elflink.h (elf_link_input_bfd <removed linkonce relocs>): Fix
1242         bad symtab segfault.  Formatting and warning fixes.  Improve
1243         error message for internationalisation.
1244
1245 2001-11-06  H.J. Lu  (hjl@gnu.org)
1246
1247         * elflink.h (elf_link_input_bfd): Complain about relocs against
1248         discarded sections.
1249
1250 2001-11-03  Alan Modra  <amodra@bigpond.net.au>
1251
1252         * elfxx-target.h (elfNN_bed): Correct want_got_sym, want_dynbss order.
1253
1254 2001-11-02  H.J. Lu  <hjl@gnu.org>
1255
1256         * elf32-mips.c (mips_elf_calculate_relocation): Don't create
1257         dynamic relocation for symbols defined in regular objects when
1258         creating executables.
1259
1260 2001-11-02  Nick Clifton  <nickc@cambridge.redhat.com>
1261
1262         * configure.in (ALL_LINGUAS): Add "fr".
1263         * configure: Regenerate.
1264         * po/fr.po: New file.
1265
1266         * coffgen.c (coff_object_p): Add comment to H.J.'s recent patch.
1267
1268 2001-11-02  John David Anglin  <dave@hiauly1.hia.nrc.ca>
1269
1270         * som.c (setup_sections): Initialize subspace_sections.
1271
1272 2001-11-02  H.J. Lu  (hjl@gnu.org)
1273
1274         * coffgen.c (coff_object_p): Return 0 if the header is too big.
1275
1276 2001-11-02  Hans-Peter Nilsson  <hp@axis.com>
1277
1278         * elfcore.h (elf_core_file_p): Preserve and clear abfd section
1279         information.  Save bfd arch and mach values.  Restore on error.
1280
1281 2001-11-02  Alan Modra  <amodra@bigpond.net.au>
1282
1283         * elf32-hppa.c (hppa_handle_PIC_calls): Rename to mark_PIC_calls.
1284         (allocate_PIC_calls): New function.
1285         (allocate_dynrelocs): Don't allocate pic_call plt entries here.
1286         (elf32_hppa_size_dynamic_sections): Call allocate_PIC_calls.
1287         (elf32_hppa_finish_dynamic_symbol): Remove dead code.
1288
1289 2001-11-02  Hans-Peter Nilsson  <hp@axis.com>
1290
1291         * elf32-cris.c (cris_elf_grok_prstatus): New function.
1292         (cris_elf_grok_psinfo): New function.
1293         (elf_backend_grok_prstatus): Define.
1294         (elf_backend_grok_psinfo): Define.
1295
1296 2001-11-01  Alan Modra  <amodra@bigpond.net.au>
1297
1298         * elf64-ppc.c (ppc64_elf_relocate_section): Correct branch
1299         prediction bits.
1300
1301 2001-10-31  Chris Demetriou  <cgd@demetriou.com>
1302
1303         * elf32-mips.c (_bfd_mips_elf_hi16_reloc): Handle PC-relative
1304         relocations properly.
1305
1306 2001-10-31  H.J. Lu <hjl@gnu.org>
1307
1308         * elflink.h (elf_link_output_extsym): Don't clear the visibility
1309         field for relocateable.
1310
1311 2001-11-01  Alan Modra  <amodra@bigpond.net.au>
1312
1313         * elf32-hppa.c (elf32_hppa_finish_dynamic_sections): Don't count
1314         .plt relocs in DT_RELASZ.
1315
1316 2001-10-29  NIIBE Yutaka  <gniibe@m17n.org>
1317
1318         * config.bfd: Supports sh3/sh4/sh3eb/sh4eb-unknown-linux-gnu
1319         targets.
1320
1321 2001-10-31  Nick Clifton  <nickc@cambridge.redhat.com>
1322
1323         * targets.c: Fix typo: bfd_mmo_mmix_vec => bfd_mmo_vec.
1324
1325 2001-10-30  Hans-Peter Nilsson  <hp@bitrange.com>
1326
1327         * Makefile.am (ALL_MACHINES): Add cpu-mmix.lo.
1328         (BFD64_BACKENDS): Add elf64-mmix.lo and mmo.lo.
1329         (BFD64_BACKENDS_CFILES): Add elf64-mmix.c and mmo.c.
1330         Regenerate dependencies.
1331         * configure.in (bfd_elf64_mmix_vec, bfd_mmo_vec): New vectors.
1332         * config.bfd: [BFD64] (mmix-*-*): New case.
1333         * cpu-mmix.c, mmo.c, elf64-mmix.c: New files.
1334         * archures.c (enum bfd_architecture): Add bfd_arch_mmix.
1335         (bfd_mmix_arch): Declare.
1336         (bfd_archures_list): Add bfd_mmix_arch.
1337         * targets.c (enum bfd_flavour): Add bfd_target_mmo_flavour.
1338         (bfd_elf64_mmix_vec, bfd_mmo_vec): Declare.
1339         (bfd_target_vect) [BFD64]: Add bfd_elf64_mmix_vec and
1340         bfd_mmo_mmix_vec.
1341         * reloc.c: Add MMIX relocations.
1342         * bfd.c (struct _bfd, tdata): Add mmo_data.
1343         * Makefile.in: Regenerate.
1344         * configure: Regenerate.
1345         * libbfd.h: Regenerate.
1346         * bfd-in2.h: Regenerate.
1347         * configure: Rebuild.
1348
1349 2001-10-30  Richard Earnshaw (rearnsha@arm.com)
1350
1351         * elf.c (_bfd_elf_make_section_from_shdr): Set the LMA based on the
1352         p_paddr of the segment that contains it.
1353         (copy_private_bfd_data): If the LMA for a segment is known, use it
1354         for matching sections to segments.
1355         (assign_file_positions_for_segments): Use the LMA when adjusting
1356         for inter-section alignment padding.
1357
1358 2001-10-29  Kazu Hirata  <kazu@hxi.com>
1359
1360         * README: Fix a typo.
1361
1362 2001-10-24  Richard Henderson  <rth@redhat.com>
1363
1364         * peXXigen.c (_bfd_XX_print_private_bfd_data_common): Copy
1365         timestamp to time_t for ctime.
1366
1367 2001-10-24  Hans-Peter Nilsson  <hp@axis.com>
1368
1369         * elf32-cris.c (cris_reloc_type_lookup): Change loop to use
1370         unsigned, increasing index.
1371
1372 2001-10-23  H.J. Lu <hjl@gnu.org>
1373
1374         * elf32-mips.c (_bfd_mips_elf_modify_segment_map): Check
1375         m != NULL before accessing it.
1376
1377 2001-10-23  Alan Modra  <amodra@bigpond.net.au>
1378
1379         * elflink.h (elf_link_input_bfd): Zero the reloc instead of doing
1380         bfd_reloc_type_lookup (bfd, BFD_RELOC_NONE) as bfd_reloc_type_lookup
1381         doesn't accept BFD_RELOC_* on some targets, eg. hppa.
1382
1383         * elf32-hppa.c (elf32_hppa_link_hash_entry): Remove plt_abs.
1384         (hppa_link_hash_newfunc): Likewise.
1385         (elf32_hppa_finish_dynamic_symbol): Likewise.
1386         (allocate_dynrelocs): Always allocate .got relocs if shared.
1387         (elf32_hppa_relocate_section): Output them too.  Similarly
1388         consolidate .plt reloc code, and no longer initialise .plt
1389         when a reloc is output.
1390         (elf32_hppa_finish_dynamic_symbol): Only initialise .plt entries
1391         when no reloc is output.
1392
1393         From Herbert Xu <herbert@gondor.apana.org.au>
1394         * elf32-hppa.c (final_link_relocate): Call bfd_set_error for
1395         unreachable branches.
1396
1397 2001-10-22  H.J. Lu <hjl@gnu.org>
1398
1399         * configure.in (WIN32LIBADD): Use -L../libiberty for
1400         mips*-*-linux*.
1401         * configure: Rebuild.
1402
1403 2001-10-21  H.J. Lu <hjl@gnu.org>
1404
1405         * configure.in (WIN32LIBADD): Include -L../libiberty/pic -liberty
1406         if shared library is enabled only for Linux hosts.
1407         * configure: Rebuild.
1408
1409 2001-10-21  H.J. Lu <hjl@gnu.org>
1410
1411         * configure.in (WIN32LIBADD): Check if PICFLAG is defined in
1412         ../libiberty/Makefile instead of $enable_shared.
1413         * configure: Rebuild.
1414
1415 2001-10-21  H.J. Lu <hjl@gnu.org>
1416
1417         * elf32-cris.c (cris_reloc_type_lookup): Use int for index.  Cover
1418         index 0.
1419
1420 2001-10-20  H.J. Lu <hjl@gnu.org>
1421
1422         * configure.in (WIN32LIBADD): Include -L../libiberty/pic -liberty
1423         if shared library is enabled.
1424         * configure: Rebuild.
1425
1426 2001-10-20  H.J. Lu <hjl@gnu.org>
1427
1428         * elf32-cris.c (cris_reloc_type_lookup): Allow index 0.
1429
1430 2001-10-19  H.J. Lu <hjl@gnu.org>
1431
1432         * elfcode.h (elf_object_p): Don't clear D_PAGED if the section
1433         size is empty.
1434
1435 2001-10-18  H.J. Lu <hjl@gnu.org>
1436
1437         * elf32-i370.c (i370_elf_relocate_section): Ignore R_XXX_NONE.
1438         * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
1439
1440 2001-10-18  Jakub Jelinek  <jakub@redhat.com>
1441
1442         * section.c (_bfd_strip_section_from_output): Don't count
1443         SEC_EXCLUDE sections as references.  Set SEC_EXCLUDE.
1444
1445 2001-10-17  Alan Modra  <amodra@bigpond.net.au>
1446
1447         * elf-m10200.c (mn10200_elf_relax_section): Cast assignment to
1448         Elf_Internal_Shdr.contents now that it's no longer a PTR.
1449         * elf-m10300.c (mn10300_elf_relax_section): Likewise.
1450         * elf32-h8300.c (elf32_h8_relax_section): Likewise.
1451         * elf32-m68k.c (bfd_m68k_elf32_create_embedded_relocs): Likewise.
1452         * elf32-sh.c (sh_elf_relax_section): Likewise.
1453         * elf64-alpha.c (elf64_alpha_relax_section): Likewise.
1454         * elfxx-ia64.c (elfNN_ia64_relax_section): Likewise.
1455         * elf.c (setup_group): Warning fixes.
1456         * elflink.h (elf_link_sort_relocs): Likewise.
1457         * pdp11.c (slurp_reloc_table): Likewise.
1458
1459 2001-10-16  Jeff Holcomb  <jeffh@redhat.com>
1460
1461         * elflink.h (elf_link_sort_relocs): Remove unnecessary pointer
1462         casts.
1463
1464 2001-10-15  H.J. Lu <hjl@gnu.org>
1465
1466         * elflink.h (elf_link_input_bfd): Set type to BFD_RELOC_NONE
1467         for relocations against discarded link-once section.
1468
1469 2001-10-15  Alan Modra  <amodra@bigpond.net.au>
1470
1471         * elf32-i386.c (elf_i386_relocate_section): Report some detail on
1472         bfd_reloc_outofrange and similar errors.
1473
1474         * elf.c (_bfd_elf_link_hash_copy_indirect): Test ind->root.type
1475         rather than ind->weakdef.
1476         * elf32-hppa.c (elf32_hppa_copy_indirect_symbol): Likewise.
1477         * elf32-i386.c (elf_i386_copy_indirect_symbol): Likewise.
1478         * elf32-mips.c (_bfd_mips_elf_copy_indirect_symbol): Likewise.
1479         * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Likewise.
1480         * elfxx-ia64.c (elfNN_ia64_hash_copy_indirect): Likewise.
1481
1482 2001-10-15  Alan Modra  <amodra@bigpond.net.au>
1483             H.J. Lu  <hjl@gnu.org>
1484
1485         * elf32-hppa.c (elf32_hppa_copy_indirect_symbol): Merge dyn_reloc
1486         counts for aliases instead of aborting.
1487         * elf32-i386.c (elf_i386_copy_indirect_symbol): Likewise.
1488         * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Likewise.
1489
1490         * elf32-hppa.c (elf32_hppa_adjust_dynamic_symbol): Set plt.offset
1491         to -1 for non-function symbols.
1492         * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Likewise.
1493         * elf32-s390.c (elf_s390_adjust_dynamic_symbol): Likewise.
1494         * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Likewise.
1495         * elf64-s390.c (elf_s390_adjust_dynamic_symbol): Likewise.
1496         * elf64-x86-64.c (elf64_x86_64_adjust_dynamic_symbol): Likewise.
1497         * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Refer to
1498         plt.offset instead of plt.refcount when setting to -1.
1499
1500 2001-10-12  Nick Clifton  <nickc@cambridge.redhat.com>
1501
1502         * elf32-arm.h (elf32_arm_relocate_section): Treat R_ARM_THM_PC22
1503         like R_ARM_PC24.  Include reloc number in error message about
1504         unresolvable relocs.
1505
1506 2001-10-10  Jakub Jelinek  <jakub@redhat.com>
1507
1508         * elflink.h (elf_link_sort_cmp2): Don't mix PLT and non-PLT
1509         relocations against the same symbol in .rel{,a}.dyn section.
1510
1511 2001-10-10  Kazu Hirata  <kazu@hxi.com>
1512
1513         * aout-encap.c: Fix comment typos.
1514         * aoutx.h: Likewise.
1515         * archive.c: Likewise.
1516         * bout.c: Likewise.
1517         * coff64-rs6000.c: Likewise.
1518         * coffcode.h: Likewise.
1519         * coffgen.c: Likewise.
1520         * cofflink.c: Likewise.
1521         * coff-mips.c: Likewise.
1522         * ecoff.c: Likewise.
1523         * elf32-m32r.c: Likewise.
1524         * libcoff-in.h: Likewise.
1525         * libecoff.h: Likewise.
1526         * libxcoff.h: Likewise.
1527         * nlm32-i386.c: Likewise.
1528         * pdp11.c: Likewise.
1529         * section.c: Likewise.
1530         * som.c: Likewise.
1531         * som.h: Likewise.
1532         * bfd-in2.h: Regenerate.
1533         * libcoff.h: Likewise.
1534
1535 2001-10-10  Alan Modra  <amodra@bigpond.net.au>
1536
1537         * elf.c (elf_map_symbols): Don't create new section symbols; Use
1538         existing section syms.  Update comments.
1539         (copy_private_bfd_data): Formatting fixes.
1540         (elfcore_grok_win32pstatus): Likewise.
1541         (swap_out_syms): Likewise.  Remove unnecessary level of braces.
1542
1543 2001-10-09  Alan Modra  <amodra@bigpond.net.au>
1544
1545         * elf-bfd.h (struct bfd_elf_section_data): Rename "group" to
1546         "group_name".
1547         (elf_group_name): Define.
1548         (elf_next_in_group): Define.
1549         * elf.c: Make use of elf_group_name and elf_next_in_group throughout.
1550         (setup_group): Don't use sec->lineno for SHT_GROUP section to store
1551         first member section; Instead use elf_next_in_group.
1552         (bfd_section_from_shdr): Likewise.
1553         (set_group_contents): Likewise.  Use elf_section_syms, not sec->symbol.
1554
1555 2001-10-09  Alan Modra  <amodra@bigpond.net.au>
1556
1557         * elf-bfd.h (struct bfd_elf_section_data): Add "group" and
1558         "next_in_group".  Fix gp and gp_size comments.
1559         * elf.c (union elf_internal_group): New.
1560         (setup_group): New function.
1561         (_bfd_elf_make_section_from_shdr): Set BFD flags for SHT_GROUP.
1562         Call setup_group for SHF_GROUP sections.
1563         (bfd_section_from_shdr): Build a BFD section for SHT_GROUP.
1564         (elf_fake_sections): Set header type for SEC_GROUP, and header
1565         flags for sections in a group.
1566         (set_group_contents): New function.
1567         (_bfd_elf_compute_section_file_positions): Call it.
1568         (assign_section_numbers): Set sh_link for SHT_GROUP.
1569
1570         * elflink.h (gc_mark_hook): Handle section groups.
1571         * elfxx-target.h: Add SEC_GROUP to applicable_flags.
1572         * section.c (SEC_GROUP): Define.
1573         (struct sec): Comment fixes.
1574         * bfd-in2.h: Regenerate.
1575
1576         * elf.c (bfd_elf_print_symbol): Formatting fix; migrate expression
1577         out of function args.
1578         (_bfd_elf_canonicalize_reloc): Similarly.
1579         (_bfd_elf_get_symtab): Here too.
1580         (_bfd_elf_canonicalize_dynamic_symtab): And here.
1581         * elfcode.h (elf_slurp_symbol_table): Don't recalculate size for
1582         bfd_bread, and remove unnecessary cast.
1583
1584 2001-10-08  Aldy Hernandez  <aldyh@redhat.com>
1585
1586         * bfd/config.bfd (targ_cpu): Add arm9e-*-elf.
1587
1588 2001-10-06  Stephane Carrez  <Stephane.Carrez@worldnet.fr>
1589
1590         * dwarf2.c (comp_unit_find_nearest_line): Check for end of
1591         compilation unit.
1592
1593 2001-10-06  Alan Modra  <amodra@bigpond.net.au>
1594
1595         * bfd.c (bfd_assert): Report bfd version.
1596         (_bfd_abort): Likewise.
1597
1598         * elflink.h (elf_link_input_bfd): Don't zero discarded link-once
1599         section sym values.  Instead replace any relocs against them with
1600         relocs against STN_UNDEF, which has a zero value.
1601
1602         * elf32-arc.c (elf_arc_howto_table): Set partial_inplace for all
1603         relocs.
1604
1605 2001-10-05  Jeff Law <law@redhat.com>
1606
1607         * som.h (som_exec_data): New field "version_id".
1608         * som.c (som_object_setup): Record the version_id if it
1609         exists.
1610         (som_prep_headers): Do not initialize version_id here.
1611         (som_finish_writing): Initialize version_id here.
1612
1613 2000-10-05  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
1614
1615         * elf32-mips.c (elf_mips_howto_table): Fix some relocation howtos
1616         according to the MIPS/SGI ELF64 ABI Draft.
1617         (mips_elf_sort_hash_table): Typo.
1618
1619 2001-10-04  Alan Modra  <amodra@bigpond.net.au>
1620
1621         * elf32-mips.c (_bfd_mips_elf_copy_indirect_symbol): Comment typo.
1622
1623         * elf32-mips.c (_bfd_mips_elf_copy_indirect_symbol): Bail out after
1624         copying flags if this is a weakdef.
1625
1626 2001-10-04  Alan Modra  <amodra@bigpond.net.au>
1627
1628         * elf-bfd.h (struct elf_link_hash_entry): Reorganise for better
1629         packing.
1630
1631         * elf32-mips.c (mips_elf_record_global_got_symbol): Set got.offset
1632         to 1 rather than 0 to avoid confusing copy_indirect_symbol.
1633         (mips_elf_sort_hash_table_f): Compare got.offset against 1.
1634
1635         * Makefile.am (BFD_H_DEPS): Add symcat.h.  Ensure everything
1636         depends on $(BFD_H) $(BFD_H_DEPS) $(LOCAL_H_DEPS), not just those
1637         backends we configure.  Run "make dep-am".
1638         (install-data-local): Install symcat.h.
1639         * dep-in.sed: Remove symcat.h from dependencies.
1640         * Makefile.in: Regenerate.
1641
1642 2001-10-03  Vassili Karpov  <malc@pulsesoft.com>
1643
1644         * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Handle nocopyreloc.
1645
1646 2001-10-03  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
1647
1648         * elf64-mips.c (elf_backend_may_use_rela_p): New define.
1649         (elf_backend_default_use_rela_p): New define.
1650
1651 2001-10-03  Alan Modra  <amodra@bigpond.net.au>
1652
1653         * elfxx-ia64.c (elfNN_ia64_hash_copy_indirect): Fix typos in last
1654         change.
1655
1656         * configure.in (AC_OUTPUT <bfd-in3.h>): Remove version.h.
1657         * configure: Regenerate.
1658         * Makefile.am (BFD_H_FILES): Add version.h.
1659         * Makefile.in: Regenerate.
1660         * po/SRC-POTFILES.in: Regenerate.
1661
1662         * elflink.h (elf_fix_symbol_flags): Copy flags to weakdef using
1663         elf_backend_copy_indirect_symbol so that backend has a chance to
1664         copy other necessary fields.
1665         * elf-bfd.h (struct elf_backend_data): Update description of
1666         elf_backend_copy_indirect_symbol.
1667         * elf.c (_bfd_elf_link_hash_copy_indirect): Bail out after
1668         copying flags if this is a weakdef.
1669         * elfxx-ia64.c (elfNN_ia64_hash_copy_indirect): Likewise.
1670         (elfNN_ia64_aix_add_symbol_hook): Use elf_link_hash_lookup rather
1671         than bfd_link_hash_lookup.
1672         * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Don't do copy
1673         reloc processing for weakdefs.
1674         * elf32-hppa.c (elf32_hppa_adjust_dynamic_symbol): Likewise.
1675         * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Likewise.
1676
1677 2001-10-02  Alan Modra  <amodra@bigpond.net.au>
1678
1679         * elf64-ppc.c (ppc64_elf_check_relocs): Use a local var and cast
1680         result of ELF64_R_TYPE to enum before using in a switch.
1681         (ppc64_elf_gc_mark_hook): Likewise.
1682         (ppc64_elf_gc_sweep_hook): Likewise.
1683         (ppc64_elf_reloc_type_class): Likewise.
1684
1685 2001-10-02  Alan Modra  <amodra@bigpond.net.au>
1686
1687         * version.h: New file.
1688         * bfd-in.h: (BFD_VERSION): Substitute bfd_version.
1689         (BFD_VERSION_DATE): Define.
1690         (BFD_VERSION_STRING): Define.
1691         * configure.in: AC_SUBST bfd_version, bfd_version_date and
1692         bfd_version_string.
1693         (AC_OUTPUT <bfd-in3.h>): Depend on version.h.
1694         * bfd-in2.h: Regenerate.
1695         * configure: Regenerate.
1696         * Makefile.am: Run "make dep-am".
1697         * Makefile.in: Regenerate.
1698
1699         * bfd-in.h: Include "symcat.h".
1700         (CONCAT4): Redefine as for old CAT4.
1701         * aout-arm.c: Use equivalent CONCAT* macro in place of CAT* macros.
1702         Add warning regarding whitespace.
1703         * aout-cris.c: Likewise.
1704         * aout-ns32k.c: Likewise.
1705         * aout-sparcle.c: Likewise.
1706         * aout-tic30.c: Likewise.
1707         * aout0.c: Likewise.
1708         * armnetbsd.c: Likewise.
1709         * demo64.c: Likewise.
1710         * elf-bfd.h: Likewise.
1711         * gen-aout.c: Likewise.
1712         * host-aout.c: Likewise.
1713         * hp300bsd.c: Likewise.
1714         * hp300hpux.c: Likewise.
1715         * i386aout.c: Likewise.
1716         * i386bsd.c: Likewise.
1717         * i386dynix.c: Likewise.
1718         * i386freebsd.c: Likewise.
1719         * i386linux.c: Likewise.
1720         * i386lynx.c: Likewise.
1721         * i386mach3.c: Likewise.
1722         * i386netbsd.c: Likewise.
1723         * libaout.h: Likewise.
1724         * m68k4knetbsd.c: Likewise.
1725         * m68klinux.c: Likewise.
1726         * m68klynx.c: Likewise.
1727         * m68knetbsd.c: Likewise.
1728         * m88kmach3.c: Likewise.
1729         * mipsbsd.c: Likewise.
1730         * newsos3.c: Likewise.
1731         * ns32knetbsd.c: Likewise.
1732         * pc532-mach.c: Likewise.
1733         * pdp11.c: Likewise.
1734         * riscix.c: Likewise.
1735         * sparclinux.c: Likewise.
1736         * sparclynx.c: Likewise.
1737         * sparcnetbsd.c: Likewise.
1738         * sunos.c: Likewise.
1739         * targets.c: Likewise.
1740         * vaxnetbsd.c: Likewise.
1741         * vms-hdr.c: Likewise.
1742
1743 2001-10-01  Alan Modra  <amodra@bigpond.net.au>
1744
1745         * bfd-in.h: Remove comments regarding generated files.
1746         * libbfd-in.h: Likewise.
1747         * libcoff-in.h: Likewise.
1748         * bfd-in2.h: Regenerate.
1749         * libbfd.h: Likewise.
1750         * libcoff.h: Likewise.
1751
1752 2001-09-30  kaz Kojima  <kkojima@rr.iij4u.or.jp>
1753             Hans-Peter Nilsson  <hp@bitrange.com>
1754
1755         * elf32-sh.c (sh_elf_howto_table, R_SH_REL32): Make
1756         partial_inplace, matching assembler output.  Set src_mask to
1757         all ones.
1758         (sh_elf_relocate_section): Delete misplaced comment.
1759         For relocatable linking against section symbol, call
1760         _bfd_relocate_contents for partial_inplace relocs and adjust
1761         rel->r_addend for others.
1762         <case R_SH_DIR32, R_SH_REL32>: Fetch partial_inplace addend with
1763         bfd_get_32, not at rel->r_addend.
1764
1765 2001-09-30  Alan Modra  <amodra@bigpond.net.au>
1766
1767         * elf.c (_bfd_elf_link_hash_copy_indirect): Set ind refcounts to
1768         the old dir refcount, so we indirectly set them to init_refcount.
1769         Short-circuit asserts when we've just verified they are true.
1770
1771 2001-09-29  Alan Modra  <amodra@bigpond.net.au>
1772
1773         * section.c (struct sec): Remove kept_section.
1774         (STD_SECTION): Remove kept_section initialisation.
1775         (bfd_make_section_anyway): Here too.
1776         * ecoff.c (bfd_debug_section): Remove kept_section initialisation.
1777         * cofflink.c (_bfd_coff_link_input_bfd): Don't test kept_section.
1778         * elflink.h (elf_link_input_bfd): Set discarded link-once section
1779         symbols to zero, and remove all code involved with kept_section
1780         and tracking section symbol values.
1781         * bfd-in2.h: Regenerate.
1782         * configure.in: Bump version number.
1783         * configure: Regenerate.
1784
1785 2001-09-29  Alan Modra  <amodra@bigpond.net.au>
1786
1787         * elf64-ppc.c (struct ppc_dyn_relocs): New.
1788         (IS_ABSOLUTE_RELOC): Define.
1789         (struct ppc_link_hash_entry): New.
1790         (struct ppc_link_hash_table): New.
1791         (ppc_hash_table): Define.
1792         (link_hash_newfunc): New function.
1793         (ppc64_elf_link_hash_table_create): New function.
1794         (create_got_section): New function.
1795         (ppc64_elf_create_dynamic_sections): Call create_got_section.  Stash
1796         pointers to our dynamic sections in hash table.
1797         (ppc64_elf_copy_indirect_symbol): New function.
1798         (ppc64_elf_check_relocs): Remove DEBUG code.  Use short-cuts to
1799         dynamic sections.  Localise vars.  Modify code for refcounts
1800         starting from zero.  Don't allocate here, or force symbols dynamic.
1801         Don't copy all relocs if shared, select ones we need.  Add code
1802         to track possible copy relocs for non-shared link.
1803         (ppc64_elf_gc_mark_hook): Update comment.
1804         (ppc64_elf_gc_sweep_hook): Sweep dynrelocs too.
1805         (ppc64_elf_adjust_dynamic_symbol): Remove DEBUG code.  Rewrite .plt
1806         code for reference counting garbage collection.  Don't create .plt
1807         entries for functions that don't comply with ABI naming convention,
1808         and don't allocate .plt space here.  Use short-cuts to dynamic
1809         sections.  If possible, keep dynamic relocations instead of using
1810         copy relocs.  Remove confused comments.
1811         (ppc_adjust_dynindx): Delete.
1812         (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Define.
1813         (allocate_dynrelocs): New function.
1814         (readonly_dynrelocs): New function.
1815         (ppc64_elf_size_dynamic_sections): Rewrite.  Allocate local .got
1816         space here, and call allocate_dynrelocs to allocate space for
1817         global .plt, .got and reloc sections.  Use short-cuts to dynamic
1818         sections.  Call readonly_dynrelocs to determine whether we need
1819         DT_TEXTREL.  Don't generate section symbols here, the generic
1820         ELF linker code does it for us.
1821         (ppc64_elf_final_link): Call regular ELF backend linker rather than
1822         gc variety, since we do our own .got handling.
1823         (ppc64_elf_relocate_section): Remove DEBUG code.  Make use of
1824         dynamic section short-cuts.  Localise vars, and delay setting.
1825         Handle unknown relocs in main switch statement.  Replace ugly
1826         complicated tests for unresolvable relocs with a simple direct
1827         scheme using "unresolved_reloc" var.  Test ELF_ST_VISIBILITY
1828         before allowing an undefined sym in a shared lib.  Do R_*_DS tests
1829         after main switch, when we've set addend.  Do non-addend insn
1830         tweaks before main swithc.  Ignore input_section->vma when
1831         calculating reloc offsets as it's always zero.  Rewrite dynamic
1832         reloc handling.  Consolidate R_*_HA handling.  Handle more relocs.
1833         (ppc64_elf_finish_dynamic_symbol): Remove DEBUG code.  Make use
1834         of dynamic section short-cuts.  Reorganise .plt handling code.
1835         Remove confused comments.  Take note of ELF_LINK_FORCED_LOCAL.
1836         Move expressions out of swap_reloca_out function calls.
1837         (ppc64_elf_reloc_type_class): New function.
1838         (ppc64_elf_info_to_howto): Move common expression to local var.
1839         (ppc64_elf_finish_dynamic_sections): Remove DEBUG code.  Make use
1840         of dynamic section short-cuts.  Don't fiddle with section syms
1841         here as the ELF linker does it for us.
1842         (elf_backend_can_refcount): Define.
1843         (bfd_elf64_bfd_link_hash_table_create): Define.
1844         (elf_backend_copy_indirect_symbol): Define.
1845         (elf_backend_reloc_type_class): Define.
1846         (elf_backend_*, bfd_elf64_bfd_* defines): Sort.
1847
1848 2001-09-29  Alan Modra  <amodra@bigpond.net.au>
1849
1850         * elf-bfd.h (struct elf_link_local_dynamic_entry): Add init_refcount.
1851         (struct elf_backend_data): Add can_refcount.
1852         * elf.c (_bfd_elf_link_hash_newfunc): Get rid of a few casts.  Set
1853         got.refcount and plt.refcount from init_refcount.
1854         (_bfd_elf_link_hash_table_init): Set up init_refcount.
1855         (_bfd_elf_link_hash_copy_indirect): Reference got/plt.refcount
1856         rather than got/plt.offset, and test for <= 0 rather than -1.
1857         * elflink.h (size_dynamic_sections): Set init_refcount to -1.
1858         * elfxx-target.h (elf_backend_can_refcount): Define.
1859         (elfNN_bed): Init can_refcount.
1860         * linker.c (_bfd_link_hash_newfunc): Get rid of a few casts.
1861         (_bfd_generic_link_hash_newfunc): Likewise.
1862         * elf32-cris.c (cris_elf_check_relocs): Modify for refcounts
1863         starting from zero.
1864         (elf_backend_can_refcount): Define.
1865         * elf32-hppa.c (elf32_hppa_check_relocs): Modify for refcounts
1866         starting from zero.
1867         (elf32_hppa_copy_indirect_symbol): Make static to agree with
1868         prototype.
1869         (elf_backend_can_refcount): Define.
1870         * elf32-i386.c (elf_i386_check_relocs): Modify for refcounts
1871         starting from zero.
1872         (allocate_dynrelocs): Set plt/got.offset rather than *.refcount.
1873         (elf_i386_finish_dynamic_symbol): Expand SHN_UNDEF comment.
1874         (elf_i386_finish_dynamic_sections): Use local var so line < 80 chars.
1875         (elf_backend_can_refcount): Define.
1876         (elf_i386_copy_indirect_symbol): Make static to agree with
1877         prototype.  Formatting fix.
1878         * elf32-m68k.c (elf_m68k_check_relocs): Modify for refcounts
1879         starting from zero.
1880         (elf_backend_can_refcount): Define.
1881         * elf32-ppc.c (ppc_elf_check_relocs): Modify for refcounts
1882         starting from zero.
1883         (elf_backend_can_refcount): Define.
1884         * elf32-s390.c (elf_s390_check_relocs): Modify for refcounts
1885         starting from zero.
1886         (elf_backend_can_refcount): Define.
1887         * elf64-s390.c (elf_s390_check_relocs): Modify for refcounts
1888         starting from zero.
1889         (elf_backend_can_refcount): Define.
1890         * elf64-x86-64.c (elf64_x86_64_check_relocs): Modify for refcounts
1891         starting from zero.
1892         (elf_backend_can_refcount): Define.
1893
1894         * som.c (som_write_symbol_strings): Cast current_offset in
1895         bfd_seek call to match param type.
1896
1897 2001-09-28  J. Brobecker <brobecker@gnat.com>
1898
1899         * som.c (som_write_symbol_strings): Fix incorrect type of
1900         current_offset to match the function definition. Fixes a build
1901         failure on HPUX-11.00.
1902
1903 2001-09-28  Richard Henderson  <rth@redhat.com>
1904
1905         * elfxx-target.h [section_flags]: Add SEC_ARCH_BIT_0, SEC_SMALL_DATA,
1906         SEC_MERGE, SEC_STRINGS.
1907
1908         * section.c (SEC_ARCH_BIT_0): New; replace unused SEC_BALIGN.
1909         * bfd-in2.h: Rebuild.
1910
1911 2001-09-28  Alan Modra  <amodra@bigpond.net.au>
1912
1913         * elf64-x86-64.c (elf64_x86_64_reloc_type_lookup): Don't map bfd
1914         reloc code using x86_64_reloc_map.
1915
1916         * elf32-hppa.c (elf32_hppa_check_relocs): Update comment since we
1917         no longer allocate here.  Localise some vars to blocks where they
1918         are used.
1919         (elf32_hppa_adjust_dynamic_symbol): Correct a comment.  Delay
1920         setting of vars until needed.
1921         (allocate_dynrelocs): Don't create a .plt entry without a reloc
1922         when symbol visibilty makes a function local.
1923         (elf32_hppa_finish_dynamic_symbol): Move expressions out of
1924         swap_reloca_out function calls.
1925         (elf32_hppa_relocate_section): Likewies.  Comment typo fix.
1926         (elf32_hppa_finish_dynamic_sections): Migrate common code out of
1927         switch statement.
1928
1929         * elf32-i386.c (elf_i386_check_relocs): Update comment since we
1930         no longer allocate here.  Localise some vars to blocks where they
1931         are used.  Remove separate switch stmt for creating .got sec.
1932         (elf_i386_adjust_dynamic_symbol): Correct a comment.  Remove
1933         redundant casts and aborts.  Delay setting of vars until needed.
1934         (allocate_dynrelocs): Remove redundant casts and aborts.
1935         (elf_i386_size_dynamic_sections): Move comment.
1936         (elf_i386_finish_dynamic_symbol): Move expressions out of function
1937         calls.
1938         (elf_i386_relocate_section): Likewise.  Comment typo fix.
1939         (elf_i386_finish_dynamic_sections): Migrate common code out of
1940         switch statement.
1941         (elf_backend_* defines): Sort.
1942
1943         * elf32-i386.c (allocate_dynrelocs): Don't create a .plt entry
1944         without a reloc when symbol visibilty makes a function local.
1945
1946 2001-09-27  Nick Clifton  <nickc@cambridge.redhat.com>
1947
1948         * elf32-arm.h (elf32_arm_merge_private_bfd_data): Fix detection of
1949         conflicting float flags.
1950
1951 2001-09-26  Alan Modra  <amodra@bigpond.net.au>
1952
1953         * elf32-i386 (elf_i386_copy_indirect_symbol): New function.
1954         (elf_backend_copy_indirect_symbol): Define.
1955         (struct elf_i386_link_hash_entry): Rename "root" to "elf".
1956         (struct elf_i386_link_hash_table): Likewise.
1957         (link_hash_newfunc): Get rid of unnecessary casts.
1958         (elf_i386_link_hash_table_create): Likewise.
1959         (elf_i386_check_relocs): Initialise local_got_refcounts to 0.
1960         Don't test input section SEC_READONLY here to try to avoid copy
1961         relocs, and keep dyn_relocs regardleas of ELF_LINK_NON_GOT_REF.
1962         (elf_i386_adjust_dynamic_symbol): Check output section SEC_READONLY
1963         here to properly test whether we need copy relocs.  Do so for weak
1964         syms too.
1965
1966         * elf32-hppa (elf32_hppa_copy_indirect_symbol): New function.
1967         (elf_backend_copy_indirect_symbol): Define.
1968         (struct elf32_hppa_link_hash_table): Rename "root" to "elf".
1969         (stub_hash_newfunc): Get rid of unnecessary casts.
1970         (hppa_link_hash_newfunc): Likewise.
1971         (elf32_hppa_check_relocs): Initialise local_got_refcounts to 0.
1972         Don't test input section SEC_READONLY here to try to avoid copy
1973         relocs, and keep dyn_relocs regardleas of ELF_LINK_NON_GOT_REF.
1974         (elf32_hppa_adjust_dynamic_symbol): Check output section SEC_READONLY
1975         here to properly test whether we need copy relocs.  Do so for weak
1976         syms too.
1977
1978 2001-09-26  Alan Modra  <amodra@bigpond.net.au>
1979
1980         * bfd.c (_bfd_default_error_handlerl): Define using VPARAMS,
1981         VA_OPEN, VA_FIXEDARG, VA_CLOSE.
1982         (bfd_archive_filename): Cast bfd_malloc arg to the correct size.
1983
1984 2001-09-25  Jakub Jelinek  <jakub@redhat.com>
1985
1986         * elf64-sparc.c (sparc64_elf_build_plt): Fix .plt[32768+] slot
1987         computation.
1988
1989 2001-09-25  H.J. Lu  <hjl@gnu.org>
1990
1991         * bfd-in2.h: Regenerated.
1992
1993 2001-09-25  Alan Modra  <amodra@bigpond.net.au>
1994
1995         * elf32-i386.c: Add comment re linker function names and ordering.
1996         (elf_i386_link_hash_newfunc): Rename to link_hash_newfunc.
1997         (elf_i386_grok_prstatus): Move before linker functions.
1998         (elf_i386_grok_psinfo): Likewise.
1999         (elf_i386_fake_sections): Move so that functions are ordered.
2000         (elf_i386_reloc_type_class): Likewise.  Comment function purpose.
2001
2002 2001-09-25  Alan Modra  <amodra@bigpond.net.au>
2003
2004         * elf32-hppa.c: Rename occurrences of "hplink" to "htab"
2005         throughout file.
2006
2007         * elf32-hppa.c: (LONG_BRANCH_PIC_IN_SHLIB): Delete.  Remove all
2008         code handling this option.
2009         (LONG_BRANCH_VIA_PLT): Likewise.
2010         (RELATIVE_DYNRELOCS): Define as zero.
2011         (struct elf32_hppa_dyn_reloc_entry): Add "sec", and
2012         "pc_count" fields.  Remove "section" field.
2013         (elf32_hppa_link_hash_entry): Rename reloc_entries to dyn_relocs.
2014         (elf32_hppa_check_relocs): Don't allocate space for dynamic
2015         relocs here.  Instead, record all needed dynamic relocs via
2016         dyn_relocs and local_dynrel.  Cache pointer to "sreloc" section
2017         in elf_section_data.
2018         (elf32_hppa_gc_sweep_hook): Sweep dyn_relocs and local_dynrel.
2019         (allocate_plt_and_got_and_discard_relocs): Rename to
2020         allocate_dynrelocs.  Allocate rather than discarding dyn relocs.
2021         (readonly_dynrelocs): New function.
2022         (elf32_hppa_size_dynamic_sections): Mark output_bfd unused.
2023         Call readonly_dynrelocs to determine need for DT_TEXTREL.
2024         Rename "i" to "ibfd".  Allocate space for local dyn relocs.
2025         (elf32_hppa_relocate_section): Make use of cached sreloc.
2026         (elf32_hppa_reloc_type_class): New function.
2027         (elf_backend_reloc_type_class): Define.
2028
2029 2001-09-25  Alan Modra  <amodra@bigpond.net.au>
2030
2031         * elf-bfd.h (struct bfd_elf_section_data): Add "local_dynrel"
2032         and "sreloc" fields.
2033         * elf32-i386.c (struct elf_i386_dyn_relocs): Add "sec", and
2034         "pc_count" fields.  Remove "section" field.
2035         (elf_i386_check_relocs): Don't set DF_TEXTREL here.  Don't
2036         allocate space for dynamic relocs here.  Instead, record all
2037         needed dynamic relocs via dyn_relocs and local_dynrel.  Cache
2038         pointer to "sreloc" section in elf_section_data.
2039         (elf_i386_gc_sweep_hook): Sweep dyn_relocs and local_dynrel.
2040         (allocate_plt_and_got_and_discard_relocs): Rename to
2041         allocate_dynrelocs.  Allocate rather than discarding dyn relocs.
2042         (readonly_dynrelocs): New function.
2043         (elf_i386_size_dynamic_sections): Call readonly_dynrelocs.
2044         Rename "i" to "ibfd".  Allocate space for local dyn relocs.
2045         (elf_i386_relocate_section): Make use of cached sreloc.
2046
2047 2001-09-24  Alan Modra  <amodra@bigpond.net.au>
2048
2049         * elf-bfd.h (elf_backend_reloc_type_class): Pass in the entire
2050         reloc rather than just the type.
2051         (_bfd_elf_reloc_type_class): Likewise.
2052         * elf.c (_bfd_elf_reloc_type_class): Likewise.
2053         * elf32-arm.h (elf32_arm_reloc_type_class): Likewise.
2054         * elf32-cris.c (elf_cris_reloc_type_class): Likewise.
2055         * elf32-i386.c (elf_i386_reloc_type_class): Likewise.
2056         * elf32-m68k.c (elf32_m68k_reloc_type_class): Likewise.
2057         * elf32-ppc.c (ppc_elf_reloc_type_class): Likewise.
2058         * elf32-s390.c (elf_s390_reloc_type_class): Likewise.
2059         * elf32-sh.c (sh_elf_reloc_type_class): Likewise.
2060         * elf32-sparc.c (elf32_sparc_reloc_type_class): Likewise.
2061         * elf64-alpha.c (elf64_alpha_reloc_type_class): Likewise.
2062         * elf64-s390.c (elf_s390_reloc_type_class): Likewise.
2063         * elf64-sparc.c (sparc64_elf_reloc_type_class): Likewise.
2064         * elf64-x86-64.c (elf64_x86_64_reloc_type_class): Likewise.
2065         * elfxx-ia64.c (elfNN_ia64_reloc_type_class): Likewise.
2066         * elflink.h: Formatting fixes.
2067         (elf_link_sort_relocs): Make "count" and "size" bfd_size_type.
2068         Call bfd_zmalloc rather than calloc.  Remove unnecessary cast of
2069         o->contents to PTR.  Update call to elf_backend_reloc_type_class.
2070
2071 2001-09-22  John Reiser  <jreiser@BitWagon.com>
2072
2073         * elfcode.h (elf_object_p): Allow for no section header at all in
2074         non-ET_REL files.  Honor 0 for e_shnum, e_shstrndx, e_shoff.
2075
2076 2001-09-21  Nick Clifton  <nickc@cambridge.redhat.com>
2077
2078         * elfxx-ia64.c: Fix compile time warning messages.
2079         * coff-mcore.c: Fix compile time warning messages.
2080         * coff-ppc.c: Fix compile time warning messages.
2081         * coffcode.h: Fix compile time warning messages.
2082         * elf32-mips.c: Fix compile time warning messages.
2083         * elf64-alpha.c: Fix compile time warning messages.
2084         * libbfd.c: Fix compile time warning messages.
2085         * bfd-in2.h: Regenerate.
2086
2087 2001-09-21  Alan Modra  <amodra@bigpond.net.au>
2088
2089         * Makefile.am: Run "make dep-am".
2090         * Makefile.in: Regenerate.
2091
2092         * aoutx.h: Formatting fixes.
2093         * merge.c (_bfd_merged_section_offset): Break line at 80 chars.
2094
2095         * linker.c: Replace bfd_get_filename with bfd_archive_filename
2096         in error message.
2097
2098 2001-09-21  Alan Modra  <amodra@bigpond.net.au>
2099
2100         * bfd.c (bfd_archive_filename): New function.
2101         * bfd-in2.h: Regenerate.
2102         * aout-adobe.c: Replace bfd_get_filename with bfd_archive_filename
2103         in error messages where the bfd is an input bfd.
2104         * aout-cris.c: Likewise.
2105         * coff-arm.c: Likewise.
2106         * coff-mcore.c: Likewise.
2107         * coff-ppc.c: Likewise.
2108         * coff-rs6000.c: Likewise.
2109         * coff-sh.c: Likewise.
2110         * coff-tic54x.c: Likewise.
2111         * coff-tic80.c: Likewise.
2112         * coff64-rs6000.c: Likewise.
2113         * coffcode.h: Likewise.
2114         * coffgen.c: Likewise.
2115         * cofflink.c: Likewise.
2116         * ecofflink.c: Likewise.
2117         * elf-hppa.h: Likewise.
2118         * elf.c: Likewise.
2119         * elf32-arm.h: Likewise.
2120         * elf32-cris.c: Likewise.
2121         * elf32-gen.c: Likewise.
2122         * elf32-hppa.c: Likewise.
2123         * elf32-i370.c: Likewise.
2124         * elf32-i386.c: Likewise.
2125         * elf32-m32r.c: Likewise.
2126         * elf32-mcore.c: Likewise.
2127         * elf32-mips.c: Likewise.
2128         * elf32-ppc.c: Likewise.
2129         * elf32-s390.c: Likewise.
2130         * elf32-sh.c: Likewise.
2131         * elf32-sparc.c: Likewise.
2132         * elf32-v850.c: Likewise.
2133         * elf64-alpha.c: Likewise.
2134         * elf64-gen.c: Likewise.
2135         * elf64-ppc.c: Likewise.
2136         * elf64-s390.c: Likewise.
2137         * elf64-sparc.c: Likewise.
2138         * elf64-x86-64.c: Likewise.
2139         * elflink.h: Likewise.
2140         * elfxx-ia64.c: Likewise.
2141         * ieee.c: Likewise.
2142         * ihex.c: Likewise.
2143         * libbfd.c: Likewise.
2144         * pdp11.c: Likewise.
2145         * pe-mips.c: Likewise.
2146         * peicode.h: Likewise.
2147         * srec.c: Likewise.
2148         * xcofflink.c: Likewise.
2149
2150         * elf32-arm.h: Make _bfd_error_handler calls K&R compatible.
2151
2152         * elflink.c (_bfd_elf_create_linker_section): Better grammar for
2153         error message.
2154
2155         * coff-mcore.c (coff_mcore_relocate_section): Internalionalise
2156         error message.
2157
2158         * elf64-sparc.c (sparc64_elf_add_symbol_hook): Constify stt_types.
2159         Consolidate error messages, and split long messages to two lines.
2160
2161 2001-09-20  John Reiser  <jreiser@BitWagon.com>
2162
2163         * elf32-i386.c (elf_i386_relocate_section): Coordinate info->symbolic
2164         and info->allow_shlib_undefined.
2165         * elf32-cris.c: Likewise.
2166         * elf32-hppa.c: Likewise.
2167         * elf32-m68k.c: Likewise.
2168         * elf32-mips.c: Likewise.
2169         * elf32-ppc.c: Likewise.
2170         * elf32-s390.c: Likewise.
2171         * elf32-sh.c: Likewise.
2172         * elf32-sparc.c: Likewise.
2173         * elf64-alpha.c: Likewise.
2174         * elf64-hppa.c: Likewise.
2175         * elf64-ppc.c: Likewise.
2176         * elf64-s390.c: Likewise.
2177         * elf64-sparc.c: Likewise.
2178         * elf64-x86-64.c: Likewise.
2179         * elfxx-ia64.c: Likewise.
2180
2181 2001-09-18  Bruno Haible  <haible@clisp.cons.org>
2182
2183         * aoutx.h: Include "safe-ctype.h" instead of <ctype.h>.
2184         (aout_link_write_symbols): Use ISDIGIT instead of isdigit.
2185         * archive.c: Include "safe-ctype.h" instead of <ctype.h>.
2186         (_bfd_generic_read_ar_hdr_mag): Use ISDIGIT instead of isdigit.
2187         * archures.c: Include "safe-ctype.h" instead of <ctype.h>.
2188         (bfd_default_scan): Use ISDIGIT instead of isdigit.
2189         * bfd.c: Include "safe-ctype.h" instead of <ctype.h>.
2190         (bfd_scan_vma): Use ISXDIGIT/ISDIGIT/ISLOWER instead of
2191         isxdigit/isdigit/islower.
2192         * binary.c: Include "safe-ctype.h" instead of <ctype.h>.
2193         (mangle_name): Use ISALNUM instead of isalnum.
2194         * cpu-v850.c: Include "safe-ctype.h" instead of <ctype.h>.
2195         (scan): Use ISDIGIT instead of isdigit.
2196         * hosts/alphavms.h: Don't include <ctype.h>.
2197         * ieee.c: Include "safe-ctype.h" instead of <ctype.h>.
2198         (ieee_object_p): Use TOUPPER instead of toupper.
2199         * ihex.c: Include "safe-ctype.h" instead of <ctype.h>.
2200         (ihex_bad_byte): Use ISPRINT instead of isprint.
2201         * merge.c: Don't include <ctype.h>.
2202         * oasys.c: Include "safe-ctype.h" instead of <ctype.h>.
2203         (oasys_write_sections): Use ISDIGIT instead of isdigit.
2204         * pdp11.c: Include "safe-ctype.h" instead of <ctype.h>.
2205         (aout_link_write_symbols): Use ISDIGIT instead of isdigit.
2206         * ppcboot.c: Include "safe-ctype.h" instead of <ctype.h>.
2207         (mangle_name): Use ISALNUM instead of isalnum.
2208         * som.c: Include "safe-ctype.h" instead of <ctype.h>.
2209         (som_set_reloc_info): Use ISUPPER/ISLOWER/ISDIGIT instead of
2210         isupper/islower/isdigit.
2211         (som_decode_symclass): Use TOUPPER instead of toupper.
2212         * srec.c: Include "safe-ctype.h" instead of <ctype.h>.
2213         (srec_bad_byte): Use ISPRINT instead of isprint.
2214         (srec_scan): Use ISSPACE instead of isspace.
2215         * stabs.c: Include "safe-ctype.h" instead of <ctype.h>.
2216         (_bfd_link_section_stabs): Use ISDIGIT instead of isdigit.
2217         * syms.c: Include "safe-ctype.h"
2218         (islower, toupper): Remove macro definitions.
2219         (bfd_decode_symclass): Use TOUPPER instead of toupper.
2220         * vms-gsd.c: Don't include <ctype.h>.
2221         * vms-hdr.c: Include "safe-ctype.h" instead of <ctype.h>.
2222         (_bfd_vms_write_hdr): Use ISLOWER/TOUPPER instead of
2223         islower/toupper.
2224         * vms-tir.c: Don't include <ctype.h>.
2225
2226 2001-09-18  Alan Modra  <amodra@bigpond.net.au>
2227
2228         * libbfd.c (bfd_bread): New function replacing bfd_read without
2229         redundant params.  Allow reads up to (size_t) -2 in length.
2230         (bfd_bwrite): Similarly for bfd_write.
2231         (real_read): Return a size_t.
2232         (bfd_read): Call bfd_bread.
2233         (bfd_write): Call bfd_bwrite.
2234         (warn_deprecated): New function to annoy everybody.
2235         (bfd_get_file_window): Don't call bfd_set_error unnecessarily.
2236         * bfd-in.h (bfd_bread, bfd_bwrite, warn_deprecated): Declare.
2237         (bfd_read, bfd_write): Define as macro.
2238         * aix386-core.c: Replace calls to bfd_read with bfd_bread, and
2239         likewise for bfd_write.  Ensure function args are correct size by
2240         using casts or local vars.  In some cases, remove unnecessary
2241         casts.  Formatting fixes, in some cases removing a large expression
2242         from function args by using a local var.  Replace CONST with const.
2243         Modify variable types to avoid warings.  Use casts to avoid
2244         warnings when using negative numbers in unsigned expressions.
2245         * aout-adobe.c: Likewise.
2246         * aout-arm.c: Likewise.
2247         * aout-cris.c: Likewise.
2248         * aout-encap.c: Likewise.
2249         * aout-ns32k.c: Likewise.
2250         * aout-target.h: Likewise.
2251         * aout-tic30.c: Likewise.
2252         * aoutf1.h: Likewise.
2253         * aoutx.h: Likewise.
2254         * archive.c: Likewise.
2255         * archures.c: Likewise.
2256         * bfd-in.h: Likewise.
2257         * bfd.c: Likewise.
2258         * binary.c: Likewise.
2259         * bout.c: Likewise.
2260         * cache.c: Likewise.
2261         * cisco-core.c: Likewise.
2262         * coff-a29k.c: Likewise.
2263         * coff-alpha.c: Likewise.
2264         * coff-arm.c: Likewise.
2265         * coff-h8300.c: Likewise.
2266         * coff-h8500.c: Likewise.
2267         * coff-i386.c: Likewise.
2268         * coff-i860.c: Likewise.
2269         * coff-i960.c: Likewise.
2270         * coff-ia64.c: Likewise.
2271         * coff-m68k.c: Likewise.
2272         * coff-m88k.c: Likewise.
2273         * coff-mcore.c: Likewise.
2274         * coff-mips.c: Likewise.
2275         * coff-ppc.c: Likewise.
2276         * coff-rs6000.c: Likewise.
2277         * coff-sh.c: Likewise.
2278         * coff-sparc.c: Likewise.
2279         * coff-stgo32.c: Likewise.
2280         * coff-tic30.c: Likewise.
2281         * coff-tic54x.c: Likewise.
2282         * coff-tic80.c: Likewise.
2283         * coff-w65.c: Likewise.
2284         * coff-z8k.c: Likewise.
2285         * coff64-rs6000.c: Likewise.
2286         * coffcode.h: Likewise.
2287         * coffgen.c: Likewise.
2288         * cofflink.c: Likewise.
2289         * coffswap.h: Likewise.
2290         * corefile.c: Likewise.
2291         * cpu-arc.c: Likewise.
2292         * cpu-h8300.c: Likewise.
2293         * cpu-h8500.c: Likewise.
2294         * cpu-i960.c: Likewise.
2295         * cpu-ia64-opc.c: Likewise.
2296         * cpu-ns32k.c: Likewise.
2297         * cpu-pdp11.c: Likewise.
2298         * cpu-pj.c: Likewise.
2299         * cpu-sh.c: Likewise.
2300         * cpu-w65.c: Likewise.
2301         * cpu-z8k.c: Likewise.
2302         * dwarf1.c: Likewise.
2303         * dwarf2.c: Likewise.
2304         * ecoff.c: Likewise.
2305         * ecofflink.c: Likewise.
2306         * ecoffswap.h: Likewise.
2307         * elf-bfd.h: Likewise.
2308         * elf-hppa.h: Likewise.
2309         * elf-m10200.c: Likewise.
2310         * elf-m10300.c: Likewise.
2311         * elf.c: Likewise.
2312         * elf32-arc.c: Likewise.
2313         * elf32-arm.h: Likewise.
2314         * elf32-avr.c: Likewise.
2315         * elf32-cris.c: Likewise.
2316         * elf32-fr30.c: Likewise.
2317         * elf32-gen.c: Likewise.
2318         * elf32-h8300.c: Likewise.
2319         * elf32-hppa.c: Likewise.
2320         * elf32-i370.c: Likewise.
2321         * elf32-i386.c: Likewise.
2322         * elf32-i860.c: Likewise.
2323         * elf32-m32r.c: Likewise.
2324         * elf32-m68k.c: Likewise.
2325         * elf32-mcore.c: Likewise.
2326         * elf32-mips.c: Likewise.
2327         * elf32-openrisc.c: Likewise.
2328         * elf32-pj.c: Likewise.
2329         * elf32-ppc.c: Likewise.
2330         * elf32-s390.c: Likewise.
2331         * elf32-sh-lin.c: Likewise.
2332         * elf32-sh.c: Likewise.
2333         * elf32-sparc.c: Likewise.
2334         * elf32-v850.c: Likewise.
2335         * elf64-alpha.c: Likewise.
2336         * elf64-hppa.c: Likewise.
2337         * elf64-mips.c: Likewise.
2338         * elf64-ppc.c: Likewise.
2339         * elf64-s390.c: Likewise.
2340         * elf64-sparc.c: Likewise.
2341         * elf64-x86-64.c: Likewise.
2342         * elfarm-nabi.c: Likewise.
2343         * elfcode.h: Likewise.
2344         * elfcore.h: Likewise.
2345         * elflink.c: Likewise.
2346         * elflink.h: Likewise.
2347         * elfxx-ia64.c: Likewise.
2348         * elfxx-target.h: Likewise.
2349         * format.c: Likewise.
2350         * hash.c: Likewise.
2351         * hp300hpux.c: Likewise.
2352         * hppabsd-core.c: Likewise.
2353         * hpux-core.c: Likewise.
2354         * i386aout.c: Likewise.
2355         * i386dynix.c: Likewise.
2356         * i386linux.c: Likewise.
2357         * i386lynx.c: Likewise.
2358         * i386mach3.c: Likewise.
2359         * i386msdos.c: Likewise.
2360         * i386os9k.c: Likewise.
2361         * ieee.c: Likewise.
2362         * ihex.c: Likewise.
2363         * irix-core.c: Likewise.
2364         * libaout.h: Likewise.
2365         * libbfd-in.h: Likewise.
2366         * libbfd.c: Likewise.
2367         * libcoff-in.h: Likewise.
2368         * libecoff.h: Likewise.
2369         * libieee.h: Likewise.
2370         * libnlm.h: Likewise.
2371         * libpei.h: Likewise.
2372         * libxcoff.h: Likewise.
2373         * linker.c: Likewise.
2374         * lynx-core.c: Likewise.
2375         * m68klinux.c: Likewise.
2376         * merge.c: Likewise.
2377         * mipsbsd.c: Likewise.
2378         * netbsd-core.c: Likewise.
2379         * nlm.c: Likewise.
2380         * nlm32-alpha.c: Likewise.
2381         * nlm32-i386.c: Likewise.
2382         * nlm32-ppc.c: Likewise.
2383         * nlm32-sparc.c: Likewise.
2384         * nlmcode.h: Likewise.
2385         * nlmswap.h: Likewise.
2386         * ns32k.h: Likewise.
2387         * oasys.c: Likewise.
2388         * opncls.c: Likewise.
2389         * osf-core.c: Likewise.
2390         * pc532-mach.c: Likewise.
2391         * pdp11.c: Likewise.
2392         * pe-mips.c: Likewise.
2393         * peXXigen.c: Likewise.
2394         * peicode.h: Likewise.
2395         * ppcboot.c: Likewise.
2396         * ptrace-core.c: Likewise.
2397         * reloc.c: Likewise.
2398         * reloc16.c: Likewise.
2399         * riscix.c: Likewise.
2400         * rs6000-core.c: Likewise.
2401         * sco5-core.c: Likewise.
2402         * section.c: Likewise.
2403         * som.c: Likewise.
2404         * sparclinux.c: Likewise.
2405         * sparclynx.c: Likewise.
2406         * srec.c: Likewise.
2407         * stabs.c: Likewise.
2408         * sunos.c: Likewise.
2409         * syms.c: Likewise.
2410         * targets.c: Likewise.
2411         * tekhex.c: Likewise.
2412         * trad-core.c: Likewise.
2413         * versados.c: Likewise.
2414         * vms-gsd.c: Likewise.
2415         * vms-hdr.c: Likewise.
2416         * vms-misc.c: Likewise.
2417         * vms-tir.c: Likewise.
2418         * vms.c: Likewise.
2419         * vms.h: Likewise.
2420         * xcofflink.c: Likewise.
2421         * bfd-in2.h: Regenerate.
2422         * libbfd.h: Regenerate.
2423         * libcoff.h: Regenerate.
2424
2425         * bfd.c (struct _bfd): Make "where" and "origin" unsigned.
2426         * bfd-in.h (file_ptr): Change from a long int to a bfd_signed_vma.
2427         (ufile_ptr): Define.
2428         (bfd_tell): Return a ufile_ptr.
2429         * libbfd.c (bfd_tell): Likewise.
2430         (bfd_seek): Use bfd_size_type locals.  Don't call bfd_set_error
2431         unnecessarily.
2432         * aix386-core.c: Test != 0 for bfd_seek errors rather than < 0.
2433         * aoutf1.h: Likewise.
2434         * som.c: Likewise.
2435         * cache.c (bfd_cache_lookup_worker): Guard against abfd->where
2436         larger than unsigned long can represent.
2437
2438         * libbfd.c (bfd_malloc): Take a bfd_size_type arg.  Error if
2439         size overflows size_t.
2440         (bfd_realloc): Likewise.
2441         (bfd_zmalloc): Likewise.
2442         * opncls.c (bfd_alloc): Likewise.
2443         (bfd_zalloc): Likewise.
2444         * libbfd-in.h (bfd_malloc, bfd_realloc, bfd_zmalloc): Update.
2445         (bfd_alloc, bfd_zalloc): Update.
2446
2447         * libbfd.c (bfd_get_8): Mask with 0xff in case char is more than
2448         8 bits.
2449         (bfd_get_signed_8): Likewise.
2450         (H_PUT_64, H_PUT_32, H_PUT_16, H_PUT_8,
2451         H_PUT_S64, H_PUT_S32, H_PUT_S16, H_PUT_S8,
2452         H_GET_64, H_GET_32, H_GET_16, H_GET_8,
2453         H_GET_S64, H_GET_S32, H_GET_S16, H_GET_S8): Define and use.
2454         * libaout.h: Likewise define and use here.
2455         * aout-adobe.c: Use H_GET_* and H_PUT_* macros.
2456         * aout-arm.c: Likewise.
2457         * aout-encap.c: Likewise.
2458         * aout-ns32k.c: Likewise.
2459         * aout-tic30.c: Likewise.
2460         * aoutf1.h: Likewise.
2461         * aoutx.h: Likewise.
2462         * bout.c: Likewise.
2463         * coff-alpha.c: Likewise.
2464         * coff-h8300.c: Likewise.
2465         * coff-h8500.c: Likewise.
2466         * coff-i960.c: Likewise.
2467         * coff-ia64.c: Likewise.
2468         * coff-m88k.c: Likewise.
2469         * coff-mips.c: Likewise.
2470         * coff-ppc.c: Likewise.
2471         * coff-rs6000.c: Likewise.
2472         * coff-sh.c: Likewise.
2473         * coff-sparc.c: Likewise.
2474         * coff-stgo32.c: Likewise.
2475         * coff-tic30.c: Likewise.
2476         * coff-tic80.c: Likewise.
2477         * coff-w65.c: Likewise.
2478         * coff-z8k.c: Likewise.
2479         * coff64-rs6000.c: Likewise.
2480         * coffgen.c: Likewise.
2481         * cofflink.c: Likewise.
2482         * coffswap.h: Likewise.
2483         * ecoff.c: Likewise.
2484         * ecoffswap.h: Likewise.
2485         * elf.c: Likewise.
2486         * elf32-mips.c: Likewise.
2487         * elf64-mips.c: Likewise.
2488         * hp300hpux.c: Likewise.
2489         * i386dynix.c: Likewise.
2490         * i386lynx.c: Likewise.
2491         * i386msdos.c: Likewise.
2492         * i386os9k.c: Likewise.
2493         * libpei.h: Likewise.
2494         * nlm32-alpha.c: Likewise.
2495         * nlm32-i386.c: Likewise.
2496         * nlm32-ppc.c: Likewise.
2497         * nlmcode.h: Likewise.
2498         * nlmswap.h: Likewise.
2499         * oasys.c: Likewise.
2500         * pdp11.c: Likewise.
2501         * pe-mips.c: Likewise.
2502         * peXXigen.c: Likewise.
2503         * peicode.h: Likewise.
2504         * riscix.c: Likewise.
2505         * sunos.c: Likewise.
2506         * xcofflink.c: Likewise.
2507         * elfcode.h: (put_word, get_word, put_signed_word, get_signed_word):
2508         Rename to H_PUT_WORD, H_GET_WORD, H_PUT_SIGNED_WORD, H_GET_SIGNED_WORD.
2509         * coff-rs6000.c (PUTWORD, PUTHALF, PUTBYTE): Don't define. Use
2510         equivalent H_PUT_* macro instead.
2511         (GETWORD, GETHALF, GETBYTE): Similarly.
2512         * coff64-rs6000.c (PUTWORD, PUTHALF, PUTBYTE): Likewise.
2513         (GETWORD, GETHALF, GETBYTE): Likewise.
2514         * coffswap.h (PUTWORD, PUTHALF, PUTBYTE): Likewise.
2515
2516         * bfd-in.h (struct orl): Change "pos" to a union.
2517         * archive.c (_bfd_compute_and_write_armap): Use it instead of casts.
2518         (bsd_write_armap): Here too.
2519         (coff_write_armap): And here.
2520         * coff-rs6000.c (xcoff_write_armap_old): And here.
2521         (xcoff_write_one_armap_big): And here.
2522         (xcoff_write_armap_big): And here.
2523         * ecoff.c (_bfd_ecoff_write_armap): And here.
2524         * elf64-mips.c (mips_elf64_write_armap): And here.
2525
2526         * aoutf1.h (sunos_set_arch_mach): Make "mach" param an enum.
2527         * elf-m10300.c (elf_mn10300_mach): Return an unsigned long.
2528         * elf32-h8300.c (elf32_h8_mach): Likewise.
2529         * elf32-mips.c (elf_mips_mach): Likewise.
2530         * sparclynx.c (NAME(lynx,set_arch_mach)): Likewise.
2531
2532         * aix386-core.c (aix386_core_file_p): Remove redundant bfd_release
2533         calls.
2534         (aix386_core_vec): Typo fix.
2535
2536         * aout-arm.c: Include libaout.h and aout/aout64.h after N_TXTADDR
2537         etc. to avoid redefined macro warning.
2538         (MY(put_reloc)): Use bfd_vma for "value" rather than long.
2539         (MY(fix_pcrel_26)): Likewise.
2540         * aout-ns32k.c (MY(put_reloc)): Likewise.
2541         * aout-cris.c (MY(swap_ext_reloc_out)): Likewise for r_addend.
2542         * aoutx.h (NAME(aout,swap_ext_reloc_out)): Likewise.
2543         * coff-arm.c (coff_arm_relocate_section): Likewise for my_offset.
2544
2545         * aout-encap.c: Include "file", not <file> for binutils headers.
2546         (encap_object_p): Half baked attempt to fix compile errors in
2547         code dealing with "magic".
2548
2549         * aout-ns32k.c: Include "file", not <file> for binutils headers.
2550         (_bfd_ns32k_relocate_contents): get_data and put_data manipulate
2551         bfd_vma's rather than longs.
2552         * cpu-ns32k.c (ns32k_sign_extend): Delete.
2553         (_bfd_ns32k_get_displacement): Return a bfd_vma, don't pass in offset.
2554         (_bfd_ns32k_get_immediate): Likewise.  Add code for 8 byte values,
2555         remove case 3.
2556         (_bfd_ns32k_put_displacement): Accept a bfd_vma, don't pass in offset.
2557         Use unsigned comparisons.
2558         (bfd_ns32k_put_immediate): Likewise, and add code for 8 byte values.
2559         (do_ns32k_reloc): get_data and put_data operate on bfd_vma's.
2560         (_bfd_do_ns32k_reloc_contents): Likewise.
2561         * ns32k.h (_bfd_ns32k_get_displacement): Update prototype.
2562         (_bfd_ns32k_get_immediate): Likewise.
2563         (_bfd_ns32k_put_displacement): Likewise.
2564         (_bfd_ns32k_put_immediate): Likewise.
2565         (bfd_reloc_status_type): Likewise.
2566
2567         * aoutx.h (NAME(aout,find_nearest_line)): Rename 'p' to 'colon'
2568         to avoid shadowing.
2569         * pdp11.c (NAME(aout,find_nearest_line)): Likewise.
2570         * coff-h8300.c (h8300_reloc16_extra_cases): Remove shadowing "value".
2571         * coff-ppc.c (enum ref_category): Rename "data" to "tocdata" to
2572         avoid shadowing.
2573         (record_toc): Use a bfd_signed_vma for our_toc_offset.
2574         * coffcode.h (coff_write_relocs): Rename "i" to avoid shadowing.
2575         * elf.c (bfd_elf_get_bfd_needed_list): Rename "link" var to avoid
2576         shadow warning.
2577         (_bfd_elfcore_strndup): Likewise for "dup".
2578         * elf32-cris.c (cris_elf_relocate_section): "symname" instead of
2579         "name" to avoid shadowing.
2580         * elf32-hppa.c (elf32_hppa_relocate_section): Remove duplicate
2581         definition of "off".
2582         * elf32-i386.c (elf_i386_relocate_section): Likewise.
2583         * elf32-mips.c (_bfd_mips_elf_modify_segment_map): Remove duplicate
2584         definition of "s".
2585         (_bfd_mips_elf_final_link): Rename "i" to "j".  Remove duplicate
2586         "secpp".
2587         * elf64-x86-64.c (elf64_x86_64_relocate_section): Rename inner "indx"
2588         to avoid shadowing.
2589         * elflink.h (elf_link_add_object_symbols): Rename "link" to "shlink"
2590         to avoid shadowing.
2591         (elf_link_input_bfd): Likewise.
2592         (elf_bfd_final_link): Remove duplicate innermost "off" var.
2593         * oasys.c (oasys_write_data): Rename innermost "p" to "sym".
2594         * reloc16.c (bfd_coff_reloc16_relax_section): Rename "i" param to
2595         "input_section".
2596         * som.c (som_prep_for_fixups): Rename inner "i" to "j".
2597         * sunos.c (sunos_add_dynamic_symbols): Localise "s" var.
2598         (sunos_write_dynamic_symbol): Remove unused vars.
2599         * syms.c (_bfd_stab_section_find_nearest_line): Remove duplicate
2600         innermost "directory_name" and "file_name" vars.
2601         * tekhex.c (first_phase): Rename local var "type" to "stype".
2602         (tekhex_write_object_contents): Rename innermost "s" to "sym".
2603         * vms-gsd.c (vms_secflag_by_name): Change "size" param to "hassize",
2604         doing comparison at caller.
2605         (vms_esecflag_by_name): Likewise.
2606         * vms-tir.c (etir_sto): Rename innermost "psect" to "psect1".
2607         * xcofflink.c (xcoff_link_input_bfd): Delete duplicate innermost "o".
2608         (xcoff_write_global_symbol): Rename "p" param to "inf".
2609
2610         * cisco-core.c: Add missing prototypes.
2611         (cisco_core_file_failing_command): Add ATTRIBUTE_UNUSED.
2612         (cisco_core_file_failing_signal): Likewise.
2613         (cisco_core_file_matches_executable_p): Likewise.
2614         * hpux-core.c (hpux_core_core_file_failing_signal): Likewise.
2615         * netbsd-core.c (netbsd_core_file_matches_executable_p): Likewise.
2616         * osf-core.c (osf_core_core_file_matches_executable_p): Likewise.
2617         * sco5-core.c (sco5_core_file_matches_executable_p): Likewise.
2618
2619         * coff-arm.c (coff_arm_link_hash_table): Use bfd_size_type for
2620         thumb_glue_size and arm_glue_size.
2621         * elf32-arm.h (elf32_arm_link_hash_table): Likewise here.
2622
2623         * coff64-rs6000.c: Group prototypes together.
2624
2625         * coffcode.h (coff_set_arch_mach): Add ATTRIBUTE_UNUSED.
2626         (buy_and_read): Remove "seek" param.  Change "size" to bfd_size_type.
2627
2628         * cpu-arc.c: Add missing prototypes.
2629         * cpu-h8500.c: Likewise.
2630         * cpu-i960.c: Likewise.
2631         * cpu-pj.c: Likewise.
2632         * cpu-sh.c: Likewise.
2633         * cpu-w65.c: Likewise.
2634         * cpu-z8k.c: Likewise.
2635         * elf32-fr30.c: Likewise.
2636         * elf32-h8300.c: Likewise.
2637         * elf32-i370.c: Likewise.
2638         * hpux-core.c: Likewise.
2639         * versados.c: Likewise.
2640
2641         * cpu-h8300.c (bfd_default_scan_num_mach): Don't declare.
2642         * cpu-h8500.c: Likewise.
2643         * cpu-i960.c: Likewise.
2644         * cpu-z8k.c: Likewise.
2645
2646         * cpu-ia64-opc.c: Correct comment.
2647
2648         * dwarf2.c (_bfd_dwarf2_find_nearest_line): Remove unused var.
2649
2650         * elf-bfd.h (elf_size_info): Change count param of write_out_phdrs
2651         to unsigned.
2652         (bfd_elf32_write_out_phdrs): Likewise.
2653         (bfd_elf64_write_out_phdrs): Likewise.
2654         (elf_linker_section_pointers): Change addend to bfd_vma.
2655         (_bfd_elf_find_pointer_linker_section): Likewise.
2656         (_bfd_elfcore_make_pseudosection): Change size param to size_t and
2657         filepos to unsigned file_ptr.
2658         (_bfd_elfcore_strndup): Change max param to size_t.
2659         * elf.c (_bfd_elfcore_make_pseudosection): As above.
2660         (_bfd_elfcore_strndup): Likewise.
2661         (_bfd_elf_find_pointer_linker_section): Likewise.
2662
2663         * elf-hppa.h (elf_hppa_relocate_insn): Return an int, and change
2664         insn and sym_value to ints.
2665
2666         * elf.c (elf_read): Make "offset" param a file_ptr, "size" a
2667         bfd_size_type.
2668         (elfcore_read_notes): Likewise.
2669
2670         * elf32-arm.h (elf32_arm_final_link_relocate): Change sym_flags
2671         param from unsigned char to int.
2672         (elf32_arm_relocate_section): If USE_REL, cast "rel" appropriately
2673         for info_to_howto call.
2674         (add_dynamic_entry): Define macro.
2675         (elf32_arm_size_dynamic_sections): Use add_dynamic_entry.
2676
2677         * elf32-cris.c (add_dynamic_entry): Define macro.
2678         (elf_cris_size_dynamic_sections): Use add_dynamic_entry.
2679
2680         * elf32-h8300.c (elf32_h8_final_write_processing): Make static.
2681         (elf32_h8_object_p): Likewise.
2682         (elf32_h8_merge_private_bfd_data): Likewise.
2683         (elf32_h8_relax_section): Cast gap to int so signed comparisons work.
2684
2685         * elf32-hppa.c (add_dynamic_entry): Define macro.
2686         (elf32_hppa_size_dynamic_sections): Use it.
2687         * elf32-i370.c (add_dynamic_entry): Define macro.
2688         (i370_elf_size_dynamic_sections): Use it.
2689         (i370_noop): Make static.
2690         * elf32-i386.c (add_dynamic_entry): Define macro.
2691         (elf_i386_size_dynamic_sections): Use it.
2692         * elf32-m68k.c (add_dynamic_entry): Define macro.
2693         (elf_m68k_size_dynamic_sections): Use it.
2694         * elf32-ppc.c (add_dynamic_entry): Define macro.
2695         (ppc_elf_size_dynamic_sections): Use it.
2696         * elf32-s390.c (add_dynamic_entry): Define macro.
2697         (elf_s390_size_dynamic_sections): Use it.
2698         * elf64-alpha.c (add_dynamic_entry): Define macro.
2699         (elf64_alpha_size_dynamic_sections): Use it.
2700         * elf64-hppa.c (add_dynamic_entry): Define macro.
2701         (elf64_hppa_size_dynamic_sections): Use it.
2702         * elf64-ppc.c (add_dynamic_entry): Define macro.
2703         (ppc64_elf_size_dynamic_sections): Use it.
2704         * elf64-s390.c (add_dynamic_entry): Define macro.
2705         (elf_s390_size_dynamic_sections): Use it.
2706         * elf64-sparc.c (add_dynamic_entry): Define macro.
2707         (sparc64_elf_size_dynamic_sections): Use it.
2708         * elf64-x86-64.c (add_dynamic_entry): Define macro.
2709         (elf64_x86_64_size_dynamic_sections): Use it.
2710         * elfxx-ia64.c (add_dynamic_entry): Define macro.
2711         (elfNN_ia64_size_dynamic_sections): Use it.
2712
2713         * elf32-v850.c (SEXT24): Modify to avoid signed/unsigned warning.
2714         (v850_elf_perform_relocation): Make "r_type" param unsigned.
2715
2716         * elf64-mips.c (mips_elf64_slurp_one_reloc_table): Just return
2717         false if the first malloc fails rather than going via error_return.
2718
2719         * elf64-sparc.c (sparc64_elf_plt_entry_offset): Use a bfd_vma for
2720         "index" param.
2721         (sparc64_elf_plt_ptr_offset): Likewise, and for "max" param too.
2722
2723         * elflink.h (elf_link_input_bfd): s/ingored/ignored/ in error message.
2724
2725         * elfxx-ia64.c (global_sym_index): Return a long.
2726
2727         * ieee.c (get_symbol): Use int rather than char param.
2728         (ieee_slurp_sections): Move "section" var to inner blocks.
2729         (copy_expression): Don't init "value" to zero or worry about
2730         clearing to zero after using.
2731         (ieee_write_debug_part): Rename "output_buffer" to "obuff" to avoid
2732         shadowing.
2733
2734         * ihex.c (ihex_write_record): Make "count" var a size_t, "addr" an
2735         unsigned int.
2736
2737         * libbfd-in.h (BFD_ALIGN): Add cast to avoid signed/unsigned warning.
2738         (bfd_write_bigendian_4byte_int): Pass an unsigned int value param.
2739
2740         * mipsbsd.c (mips_fix_jmp_addr): Add "error_message" param.
2741
2742         * pc532-mach.c (MYNSX): Delete.
2743         (ns32kaout_bfd_reloc_type_lookup): Define prototype without MYNSX.
2744         (write_object_contents): Correct prototype.
2745
2746         * peicode.h (pe_ILF_build_a_bfd): Use an unsigned int param rather
2747         than unsigned short.
2748
2749         * section.c (bfd_set_section_contents): Remove redundant
2750         "offset < 0" test.  Check that "count" doesn't overflow size_t.
2751         (bfd_get_section_contents): Likewise.
2752
2753         * som.c (som_fixup_formats): Add missing braces.
2754         (som_reloc_addend): Pass a bfd_vma for "addend".
2755
2756         * srec.c (srec_write_record): Pass "type" as an unsigned int.
2757         (srec_write_symbols): Remove an unnecessary var.
2758
2759         * targets.c (_bfd_target_vector): Sort entries.  Sort externs
2760         to match.
2761         * configure.in: Sort to match.  Bump version number.
2762         * configure: Regenerate.
2763
2764         * tekhex.c (move_section_contents): Assert offset == 0.
2765
2766         * versados.c (new_symbol_string): Constify arg.
2767         (process_esd): Use bfd_und_section_ptr rather than &bfd_und_section.
2768         (versados_get_symbol_info): Make static.
2769         (versados_print_symbol): Likewise.
2770         (versados_get_reloc_upper_bound): Likewise.
2771         (versados_canonicalize_reloc): Likewise.
2772
2773 2001-09-18  Nick Clifton  <nickc@cambridge.redhat.com>
2774
2775         * elflink.h (elf_link_input_bfd): Fix typo in error message.
2776
2777 2001-09-17  H.J. Lu  <hjl@gnu.org>
2778
2779         * dwarf1.c (parse_die): Take a new arg for the end of the
2780         section. Return false if die is beyond the section.
2781         (parse_functions_in_unit): Pass the end of the section to
2782         parse_die ().
2783         (_bfd_dwarf1_find_nearest_line): Likewise.
2784
2785 2001-09-14  Michael Rauch <mrauch@netbsd.org>
2786
2787         * elf32-sparc.c (elf32_sparc_relocate_section): Treat R_SPARC_UA32
2788         just like R_SPARC_32.
2789
2790 2001-09-14  Kevin Lo <kevlo@openbsd.org>
2791
2792         * configure.bfd: Add arm-openbsd target.
2793
2794 2001-09-14  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
2795
2796         * config.bfd: Change machine triplets from mips*el*-* to mips*el-*.
2797         Add support for mips64.
2798
2799 2001-09-13  Alexandre Oliva  <aoliva@redhat.com>
2800
2801         * elf32-openrisc.c (ELF_MACHINE_ALT1): Define as EM_OPENRISC_OLD.
2802
2803 2001-09-12  Alexandre Oliva  <aoliva@redhat.com>
2804
2805         * elf.c (prep_headers): Get the machine code from the elf
2806         backend data.
2807         * elf-m10200.c (ELF_MACHINE_CODE): Redefine to EM_MN10200.
2808         (ELF_MACHINE_ALT1): Define to EM_CYGNUS_MN10200.
2809         * elf-m10300.c (ELF_MACHINE_CODE): Redefine to EM_MN10300.
2810         (ELF_MACHINE_ALT1): Define to EM_CYGNUS_MN10300.
2811         * elf-arc.c (arc_elf_final_write_processing): Don't override
2812         e_machine, it's now properly set in prep_headers.
2813         * elf32-avr.c (elf32_avr_object_p): Accept both EM_AVR and
2814         EM_AVR_OLD.
2815         (ELF_MACHINE_ALT1): Define to EM_AVR_OLD.
2816         * elf-d10v.c (ELF_MACHINE_CODE): Redefine to EM_D10V.
2817         (ELF_MACHINE_ALT1): Define to EM_CYGNUS_D10V.
2818         * elf-d30v.c (ELF_MACHINE_CODE): Redefine to EM_D30V.
2819         (ELF_MACHINE_ALT1): Define to EM_CYGNUS_D30V.
2820         * elf-fr30.c (ELF_MACHINE_CODE): Redefine to EM_FR30.
2821         (ELF_MACHINE_ALT1): Define to EM_CYGNUS_FR30.
2822         * elf-m32r.c (ELF_MACHINE_CODE): Redefine to EM_M32R.
2823         (ELF_MACHINE_ALT1): Define to EM_CYGNUS_M32R.
2824         * elf32-pj.c (ELF_MACHINE_ALT1): DEfine to EM_PJ_OLD.
2825         * elf-v850.c (ELF_MACHINE_CODE): Redefine to EM_V850.
2826         (ELF_MACHINE_ALT1): Define to EM_CYGNUS_V850.
2827
2828 2001-09-11  Richard Henderson  <rth@redhat.com>
2829
2830         * elf64-alpha.c (elf64_alpha_section_flags): New.
2831         (elf64_alpha_fake_sections): Map SEC_SMALL_DATA to SHF_ALPHA_GPREL.
2832
2833 2001-09-11  Richard Henderson  <rth@redhat.com>
2834
2835         * elf64-alpha.c (elf64_alpha_relocate_section): Do not
2836         apply HINT relocations against dynamic symbols.
2837
2838 2001-09-11  H.J. Lu  <hjl@gnu.org>
2839
2840         * linker.c (link_action): Change COMMON_ROW\defw from CREF to COM.
2841
2842 2001-09-09  Richard Henderson  <rth@redhat.com>
2843
2844         * elf64-alpha.c: Delete all unused ERIC_neverdef and rth_notdef code.
2845
2846         * elf64-alpha.c (elf64_alpha_relax_with_lituse): Nop out gpdisp
2847         following a call to a near function.
2848
2849 2001-09-08  Richard Henderson  <rth@redhat.com>
2850
2851         * elf64-alpha.c (elf64_alpha_relocate_section): Soft fail
2852         relocation errors.  Fail gp-relative relocations against
2853         dynamic symbols.
2854
2855 2001-09-08  Alan Modra  <amodra@bigpond.net.au>
2856
2857         * elf32-i386.c (elf_i386_relocate_section): Check !DEF_REGULAR
2858         as well as DEF_DYNAMIC in test for avoided copy relocs.
2859         (allocate_plt_and_got_and_discard_relocs): Likewise.
2860         * elf32-hppa.c (elf_i386_relocate_section): Likewise.
2861         (allocate_plt_and_got_and_discard_relocs): Likewise.
2862
2863 2001-09-07  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
2864
2865         * elf32-mips.c (mips_elf_calculate_relocation): Fix overflow handling
2866         of R_MIPS_PC16.
2867
2868 2001-09-06  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
2869
2870         * elf64-mips.c (mips_elf64_howto_table_rel): Fix relocation HOWTO
2871         definitions.
2872         (mips_elf64_howto_table_rel): Likewise.
2873
2874 2001-09-05  Tom Rix <trix@redhat.com>
2875
2876         * xcofflink.c (bfd_xcoff_import_symbol): Handle import file XMC_XO
2877         and syscall symbols.
2878         (write_global_symbol) : Same.
2879         (bfd_xcoff_export_symbol): Remove unused syscall param.
2880         * libxcoff.h: Change prototype of bfd_xcoff_export symbol and
2881         bfd_xcoff_import_symbol.
2882         * bfd-in.h: Same.
2883         * bfd-in2.h : Regenerate.
2884
2885 2001-09-04  Richard Henderson  <rth@redhat.com>
2886
2887         * elf64-alpha.c (SKIP_HOWTO): New.
2888         (elf64_alpha_howto_table): Use it to remove dead ECOFF relocs.
2889         Fix sizes of 16-bit mem format relocs.
2890         (elf64_alpha_reloc_map): Update to match.
2891         (elf64_alpha_relax_with_lituse): Use GPREL16 as appropriate.
2892         (elf64_alpha_relax_without_lituse): Likewise.
2893         (elf64_alpha_check_relocs): Handle GPREL16.
2894         (elf64_alpha_relocate_section): Likewise.
2895         * reloc.c (BFD_RELOC_ALPHA_USER_*): Remove.
2896         (BFD_RELOC_ALPHA_GPREL_HI16, BFD_RELOC_ALPHA_GPREL_LO16): New.
2897         * bfd-in2.h, libbfd.h: Rebuild.
2898
2899 2001-09-04  Jeff Law <law@redhat.com>
2900
2901         * elf32-h8300.c (elf32_h8_relax_section): New function.
2902         (elf32_h8_relax_delete_bytes): Likewise.
2903         (elf32_h8_symbol_address_p): Likewise.
2904         (elf32_h8_get_relocated_section_contents): Likewise.
2905         (bfd_elf32_bfd_relax_section): Define.
2906         (bfd_elf32_bfd_get_relocated_section_contents): Likewise.
2907
2908         * elf32-h8300.c (special): New function.
2909         (h8_elf_howto_table): Use it for SPECIAL_FUNCTION field in
2910         all relocations.
2911         (elf32_h8_final_link_relocate): Treat R_H8_DIR24A8 like 32bit
2912         relocations.  Fix problems with the true 24bit reloc R_H8_DIR24R8.
2913         Fix minor problems with 8bit and 16bit PC relative relocations.
2914
2915 2001-09-01  Andreas Jaeger  <aj@suse.de>
2916
2917         * vms-tir.c: Add missing prototypes.
2918         * vms-hdr.c: Likewise.
2919         * vms-gsd.c: Likewise.
2920         * vms-misc.c: Likewise.
2921
2922 2001-08-31  H.J. Lu  <hjl@gnu.org>
2923
2924         * elf32-mips.c (_bfd_mips_elf_check_relocs): Report filename
2925         with bad relocation.
2926
2927 2001-08-31  Eric Christopher  <echristo@redhat.com>
2928             Jason Eckhardt  <jle@redhat.com>
2929
2930         * bfd/archures.c: Add mipsisa32 and mipsisa64. Remove mips32,
2931         mips32_4k and mips64.
2932         * bfd/aoutx.h: Remove bfd_mach_mips32, bfd_mach_mips32_4k,
2933         bfd_mach_mips64.  Add bfd_mach_mipsisa32, bfd_mach_mipsisa64.
2934         * bfd/cpu-mips.c: Ditto.
2935         * bfd/elf32-mips.c (_bfd_mips_elf_final_write_processing): Ditto.
2936         * bfd/bfd-in2.h: Regenerate.
2937
2938 2001-08-31  Jakub Jelinek  <jakub@redhat.com>
2939
2940         * elf64-alpha.c (elf64_alpha_relocate_section): Duplicate memory
2941         value into R_ALPHA_RELATIVE's addend.
2942         (elf64_alpha_finish_dynamic_symbol): Likewise.
2943
2944 2001-08-31  Nick Clifton  <nickc@cambridge.redhat.com>
2945
2946         * elf32-arm.h (elf32_arm_relocate_section): Do not rightshift
2947         recomputed addend during relocatable link if not USE_REL.
2948
2949         * elflink.h (elf_gc_propagate_vtable_entries_used): Fix off-by-one
2950         error.
2951
2952 2001-08-30  H.J. Lu  <hjl@gnu.org>
2953
2954         * elf32-mips.c (mips_elf_calculate_relocation): Revert the last
2955         2 changes.
2956         (_bfd_mips_elf_adjust_dynamic_symbol): Allocate dynamic
2957         relocations for weak definitions.
2958
2959 2001-08-30  H.J. Lu  <hjl@gnu.org>
2960
2961         * Makefile.am (BFD32_BACKENDS): Add elf32-h8300.lo.
2962         (BFD32_BACKENDS_CFILES): Add elf32-h8300.c.
2963         * Makefile.in: Rebuild.
2964
2965 2001-08-30  H.J. Lu  <hjl@gnu.org>
2966
2967         * elf32-mips.c (mips_elf_calculate_relocation): Don't create
2968         dynamic relocation for undefined weak symbols when creating
2969         executables. Check h->root.root.type, instead of h->root.type.
2970
2971 2001-08-29  Joel Sherrill <joel@OARcorp.com>
2972
2973         * config.bfd (i[3456]86-*-rtems*, m68*-*-rtems*): Change
2974         default from coff to elf.
2975
2976 2001-08-29  Jeff Law <law@redhat.com>
2977
2978         * elf32-h8300.c (h8_elf_howto_table): Add new PC relative
2979         relocations.
2980         (h8_reloc_map): Similarly.
2981         (elf32_h8_final_link_relocate): Remove incorrect overflow tests.
2982         Add support for PC relative relocations.
2983
2984         * elf32-h8300.c: Put all prototypes together.
2985         (elf32_h8_info_to_howto): Parameter elf_reloc is used.
2986         (elf32_h8_final_link_relocate): New function for linker.
2987         (elf32_h8_relocate_section): Similarly.
2988         (elf_backend_relocate_section): Define.
2989
2990         * cpu-h8300.c (h8300_scan, compatible): Prototype.
2991         (h8300_scan): Handle architecture:machine encodings typically
2992         found in linker scripts.
2993         * elf.c (prep_headers): Do not try to do H8 machine recognition
2994         here.
2995         * elf32-h8300.c:  Add some missing prototypes.
2996         (elf32_h8_mach, elf32_h8_final_write_processing): New functions.
2997         (elf32_h8_object_p): Similarly.
2998
2999 2001-08-29  Tom Rix <trix@redhat.com>
3000
3001         * xcofflink.c (xcoff_link_add_symbols):  Fix XTY_LD symbol that
3002         does not follow a XTY_SD.
3003
3004 2001-08-29  Alan Modra  <amodra@bigpond.net.au>
3005
3006         * targmatch.sed: Delete case statements.
3007         * config.bfd <powerpc-*-aix* entry>: Select 64 bit xcoff for
3008         aix4.3 and above.
3009
3010 2001-08-29  J"orn Rennecke <amylaar@redhat.com>
3011
3012         * Makefile.am (elf32-h8300.lo): New target.
3013         * config.bfd (h8300*-*-elf): New case.
3014         * configure.in (bfd_elf32_h8300_vec): New case.
3015         * elf.c (prep_headers): Add case for bfd_arch_h8300.
3016         * reloc.c (BFD_RELOC_H8_DIR16A8): New relocation.
3017         (BFD_RELOC_H8_DIR16R8, BFD_RELOC_H8_DIR24A8): Likewise.
3018         (BFD_RELOC_H8_DIR24R8, BFD_RELOC_H8_DIR32A16): Likewise.
3019         * targets.c (bfd_target bfd_elf32_h8300_vec): New extern declaration.
3020         * elf32-h8300.c: New file.
3021         * Makefile.in, bfd-in2.h, libbfd.h, configure: Regenerated.
3022
3023 2001-08-28  Nick Clifton  <nickc@cambridge.redhat.com>
3024
3025         * sparclynx.c: Add missing prototypes.
3026         * coff-mcore.c: Add missing prototypes.
3027         * elf32-pj.c: Add missing prototypes.
3028         * nlm32-sparc.c: Add missing prototypes.
3029         * oasys.c: Add missing prototypes.
3030         * pdp11.c: Add missing prototypes.
3031         * pe-mips.c: Add missing prototypes.
3032         * riscix.c: Add missing prototypes.
3033
3034 2001-08-27  Daniel Jacobowitz  <drow@mvista.com>
3035
3036         * elf32-i386.c: Add missing prototypes.
3037         * elf32-ppc.c: Likewise.
3038         * elf32-sh-lin.c: Likewise.
3039         * elfarm-nabi.c: Likewise.
3040
3041 2001-08-27  Daniel Jacobowitz  <drow@mvista.com>
3042
3043         * elf32-i386.c (elf_i386_grok_prstatus): New function.
3044         (elf_i386_grok_psinfo): New function.
3045         (elf_backend_grok_prstatus): Define.
3046         (elf_backend_grok_psinfo): Likewise.
3047         * elf32-ppc.c (ppc_elf_grok_prstatus): New function.
3048         (ppc_elf_grok_psinfo): New function.
3049         (elf_backend_grok_prstatus): Define.
3050         (elf_backend_grok_psinfo): Likewise.
3051         * elf32-sh-lin.c (elf32_shlin_grok_prstatus): New function.
3052         (elf32_shlin_grok_psinfo): New function.
3053         (elf_backend_grok_prstatus): Define.
3054         (elf_backend_grok_psinfo): Likewise.
3055         * elfarm-nabi.c (elf32_arm_nabi_grok_prstatus): New function.
3056         (elf32_arm_nabi_grok_psinfo): New function.
3057         (elf_backend_grok_prstatus): Define.
3058         (elf_backend_grok_psinfo): Likewise.
3059
3060 2001-08-27  H.J. Lu  <hjl@gnu.org>
3061
3062         * elf32-mips.c (mips_elf_create_dynamic_relocation): Add more
3063         sanity check.
3064         (mips_elf_calculate_relocation): Create dynamic relocation for
3065         symbols with weak definition or the ELF_LINK_HASH_DEF_REGULAR
3066         bit is not set.
3067
3068 2001-08-27  H.J. Lu  <hjl@gnu.org>
3069
3070         * elf32-mips.c (_bfd_mips_elf_hide_symbol): Add prototype.
3071         (_bfd_mips_elf_copy_indirect_symbol): Likewise.
3072         (_bfd_elf32_mips_grok_prstatus): Likewise.
3073         (_bfd_elf32_mips_grok_psinfo): Likewise.
3074         (_bfd_mips_elf_hide_symbol): Make it static and cast to
3075         `struct mips_elf_link_hash_entry *'.
3076         (_bfd_mips_elf_copy_indirect_symbol): Make it static.
3077
3078 2001-08-27  Nick Clifton  <nickc@cambridge.redhat.com>
3079
3080         * mipsbsd.c: Add missing prototypes.
3081         * hp300hpux.c: Add missing prototypes.
3082         * i386aout.c: Add missing prototypes.
3083         * i386lynx.c: Add missing prototypes.
3084         * i386mach3.c: Add missing prototypes.
3085         * i386msdos.c: Add missing prototypes.
3086         * i386os9k.c: Add missing prototypes.
3087
3088 2001-08-27  Linus Nordberg  <linus@swox.se>
3089             Torbjorn Granlund  <tege@swox.com>
3090             Staffan Ulfberg  <staffanu@swox.se>
3091             Alan Modra  <amodra@bigpond.net.au>
3092
3093         * config.bfd: Add powerpc64 target.  Add powerpc64 vectors to
3094         targ64_selvecs for 32 bit powerpc targets.
3095         * Makefile.am (BFD64_BACKENDS): Add elf64-ppc.lo.
3096         (BFD64_BACKENDS_CFILES): Add elf64-ppc.c.
3097         Run "make dep-am".
3098         * Makefile.in: Regenerate.
3099         * configure.in: Add elf64_powerpc vecs.
3100         * configure: Regenerate.
3101         * cpu-powerpc.c: Default to bfd_mach_ppc_620 entry for 64 bit.
3102         * elf.c (prep_headers): EM_PPC64 for 64 bit ppc elf target.
3103         * targets.c: Add bfd_elf64_powerpc_vec and bfd_elf64_powerpcle_vec.
3104         * elf64-ppc.c: New file.
3105         * reloc.c: Add powerpc64 relocs.
3106         * libbfd.h: Regenerate.
3107         * bfd-in2.h: Regenerate.
3108
3109 2001-08-27  Andreas Schwab  <schwab@suse.de>
3110
3111         * elf32-m68k.c (elf32_m68k_check_relocs): Set DF_TEXTREL if the
3112         reloc is against read-only section.
3113         (elf32_m68k_size_dynamic_sections): Use DF_TEXTREL flag instead of
3114         looking up section names for DT_TEXTREL.
3115         (elf32_m68k_reloc_type_class): New function.
3116         (elf_backend_reloc_type_class): Define.
3117
3118 2001-08-27  Andreas Jaeger  <aj@suse.de>
3119
3120         * elf64-s390.c (elf_s390_check_relocs): Set DF_TEXTREL if the
3121         reloc is against read-only section.
3122         (elf_s390_size_dynamic_sections): Use DF_TEXTREL flag instead of
3123         looking up section names for DT_TEXTREL.
3124         (elf_s390_reloc_type_class): New.
3125         (elf_backend_reloc_type_class): Define.
3126
3127         * elf32-s390.c (elf_s390_check_relocs): Set DF_TEXTREL if the
3128         reloc is against read-only section.
3129         (elf_s390_size_dynamic_sections): Use DF_TEXTREL flag instead of
3130         looking up section names for DT_TEXTREL.
3131         (elf_s390_reloc_type_class): New.
3132         (elf_backend_reloc_type_class): Define.
3133
3134         * elf32-ppc.c (ppc_elf_check_relocs): Set DF_TEXTREL if the reloc
3135         is against read-only section.
3136         (ppc_elf_size_dynamic_sections): Use DF_TEXTREL flag instead of
3137         looking up section names for DT_TEXTREL.
3138         (ppc_elf_reloc_type_class): New.
3139         (elf_backend_reloc_type_class): Define.
3140
3141 2001-08-26  Andreas Jaeger  <aj@suse.de>
3142
3143         * elf32-cris.c (cris_elf_check_relocs): Set DF_TEXTREL if the
3144         reloc is against read-only section.
3145         (elf_cris_size_dynamic_sections): Use DF_TEXTREL flag instead of
3146         looking up section names for DT_TEXTREL.
3147         (elf_cris_reloc_type_class): New.
3148         (elf_backend_reloc_type_class): Define.
3149
3150         * elf32-sh.c (sh_elf_check_relocs): Set DF_TEXTREL if the reloc is
3151         against read-only section.
3152         (elf_backend_reloc_type_class): Define.
3153         (sh_elf_reloc_type_class): New.
3154         (sh_elf_size_dynamic_sections): Use DF_TEXTREL flag instead of
3155         looking up section names for DT_TEXTREL.
3156
3157         * elf32-arm.h (elf32_arm_check_relocs): Set DF_TEXTREL if the
3158         reloc is against read-only section.
3159         (elf32_arm_size_dynamic_sections): Use DF_TEXTREL flag instead of
3160         looking up section names for DT_TEXTREL.
3161         (elf32_arm_reloc_type_class): New.
3162         (elf_backend_reloc_type_class): Define.
3163
3164 2001-08-25  Andreas Jaeger  <aj@suse.de>
3165
3166         * oasys.c: Add missing prototypes.
3167
3168         * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Add unused
3169         attribute for parameter.
3170         * elf.c (_bfd_elf_reloc_type_class): Likewise.
3171
3172         * versados.c (get_4): Make static.
3173         (get_10): Make static.
3174         Add missing prototypes.
3175         (process_esd): Fix call to versados_new_symbol.
3176
3177 2001-08-25  Nick Clifton  <nickc@cambridge.redhat.com>
3178
3179         * coff-a29k.c: Add missing prototypes.
3180         * coff-apollo.c: Add missing prototypes.
3181         * coff-arm.c: Add missing prototypes.
3182         * coff-i860.c: Add missing prototypes.
3183         * coff-rs6000.c: Add missing prototypes.
3184         * coff-tic80.c: Add missing prototypes.
3185         * elf-m10200.c: Add missing prototypes.
3186         * elf-m10300.c: Add missing prototypes.
3187         * elf32-arm.h: Add missing prototypes.
3188         * elf32-d10v.c: Add missing prototypes.
3189         * elf32-m32r.c: Add missing prototypes.
3190         * elf32-mcore.c: Add missing prototypes.
3191         * elf32-openrisc.c: Add missing prototypes.
3192         * elf32-sh.c: Add missing prototypes.
3193         * elf32-sparc.c: Add missing prototypes.
3194         * elf32-v850.c: Add missing prototypes.
3195         * elfarm-nabi.c: Add missing prototypes.
3196         * elfarm-oabi.c: Add missing prototypes.
3197
3198 2001-08-25  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
3199
3200         * elf32-mips.c (elf_mips_abi_name): Return the right ABI string for
3201         E_MIPS_ABI_O64 and E_MIPS_ABI_EABI64
3202
3203 2001-08-24  H.J. Lu  <hjl@gnu.org>
3204
3205         * elf.c (_bfd_elf_merge_sections): Fail if not using an ELF
3206         hash structure.
3207
3208 2001-08-24  Nick Clifton  <nickc@cambridge.redhat.com>
3209
3210         * elf-bfd.h (elf_hash_table): Revert definition.
3211         (is_elf_hash_table): New macro.
3212         * elflink.h (elf_link_add_object_symbols): Test
3213         is_elf_hash_table before accessing ELF only fields in hash
3214         structure.
3215         (elf_link_create_dynamic_sections): Fail if not using an ELF
3216         hash structure.
3217         (elf_add_dynamic_entry): Fail if not using an ELF hash
3218         structure.
3219         (elf_link_record_local_dynamic_symbol): Fail if not using an
3220         ELF hash structure.
3221         (size_dynamic_sections): Fail if not using an ELF hash
3222         structure.
3223         (elf_adjust_dynamic_symbol): Fail if not using an ELF
3224         hash structure.
3225         (elf_bfd_final_link): Fail if not using an ELF hash
3226         structure.
3227
3228 2001-08-24  H.J. Lu  <hjl@gnu.org>
3229
3230         * elf-bfd.h (elf_hash_table): Return NULL if the linker hash
3231         table is not an ELF linker hash table.
3232
3233         * elf.c (_bfd_elf_link_hash_table_init): Set the linker hash
3234         table type to bfd_link_elf_hash_table.
3235
3236         * elfxx-target.h (bfd_elfNN_bfd_link_hash_table_create): Revert
3237         the last change.
3238
3239         * linker.c (_bfd_link_hash_table_init): Set the linker hash
3240         table type to bfd_link_generic_hash_table.
3241
3242 2001-08-24  Alexandre Oliva  <aoliva@redhat.com>
3243
3244         * bfd.c (bfd_alt_mach_code): New function.
3245         * bfd-in2.h: Rebuilt.
3246
3247 2001-08-24  Alexandre Oliva  <aoliva@redhat.com>
3248
3249         * elf-m10300.c (mn10300_elf_relocate_section): Test the right
3250         `type' field in the hash entry when deciding whether to follow a
3251         link.
3252
3253 2001-08-24  Jakub Jelinek  <jakub@redhat.com>
3254
3255         * elflink.h (elf_link_sort_cmp1): Sort RELATIVE relocs first, not
3256         last.
3257         (elf_link_sort_relocs): Adjust accordingly.
3258
3259         * elf64-alpha.c (struct alpha_elf_link_hash_entry): Add reltext flag.
3260         (elf64_alpha_check_relocs): Set it if section this reloc is against
3261         is read-only.  Set DF_TEXTREL if a RELATIVE reloc is needed against
3262         read-only section.
3263         (elf64_alpha_calc_dynrel_sizes): Set DF_TEXTREL flag if relocation
3264         is is against read-only section.
3265         (elf64_alpha_size_dynamic_sections): Use DF_TEXTREL flag, don't
3266         check section names.
3267         (elf64_alpha_reloc_type_class): New.
3268         (elf_backend_reloc_type_class): Define.
3269
3270 2001-08-24  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
3271
3272         * linker.c (_bfd_generic_link_add_archive_symbols): Replace alloca()
3273         by bfd_malloc().
3274
3275 2001-08-23  Andreas Jaeger  <aj@suse.de>
3276
3277         * elf64-x86-64.c (elf64_x86_64_check_relocs): Set DF_TEXTREL if
3278         the reloc is against read-only section.
3279         (elf64_x86_64_size_dynamic_sections): Use DF_TEXTREL flag instead
3280         of looking up section names for DT_TEXTREL.
3281         (elf64_x86_64_reloc_type_class): New.
3282         (elf_backend_reloc_type_class): Define.
3283
3284 2001-08-23  H.J. Lu  <hjl@gnu.org>
3285
3286         * syms.c (bfd_print_symbol_vandf): Add abfd to arg.
3287         * bfd-in2.h (bfd_print_symbol_vandf): Regenerated.
3288
3289         * aoutx.h (NAME(aout,print_symbol)): Pass abfd to
3290         bfd_print_symbol_vandf.
3291         * coffgen.c (coff_print_symbol): Likewise.
3292         * elf.c (bfd_elf_print_symbol): Likewise.
3293         * ieee.c (ieee_print_symbol): Likewise.
3294         * nlmcode.h (nlm_print_symbol): Likewise.
3295         * oasys.c (oasys_print_symbol): Likewise.
3296         * pdp11.c (NAME(aout,print_symbol)): Likewise.
3297         * som.c (som_print_symbol): Likewise.
3298         * srec.c (srec_print_symbol): Likewise.
3299         * tekhex.c (tekhex_print_symbol): Likewise.
3300         * versados.c (versados_print_symbol): Likewise.
3301         * vms.c (vms_print_symbol): Likewise.
3302
3303         * elf.c (_bfd_elf_print_private_bfd_data): Replace fprintf_vma
3304         with bfd_fprintf_vma.
3305         (bfd_elf_print_symbol): Likewise.
3306         * syms.c (bfd_print_symbol_vandf): Likewise.
3307
3308 2001-08-23  Nick Clifton  <nickc@cambridge.redhat.com>
3309
3310         * aoutf1.h (sunos_write_object_contents): Silence compile time
3311         warning.
3312         * libaout.h (N_SET_DYNAMIC): Silence compile time warning.
3313
3314         * bout.c: Add missing function prototypes.  Fix formatting.
3315         * coff-z8k.c: Add missing function prototypes.  Fix formatting.
3316         * coff-w65.c: Add missing function prototypes.  Fix formatting.
3317         * coff-h8500.c: Add missing function prototypes.  Fix formatting.
3318         * coff-h8300.c: Add missing function prototypes.  Fix formatting.
3319         * coff-tic54x.c: Add missing function prototypes.  Fix formatting.
3320         * coff-tic30.c: Add missing function prototypes.  Fix formatting.
3321         * coff-m68k.c: Add missing function prototypes.  Fix formatting.
3322         * coff-rs6000.c: Add missing function prototypes.  Fix formatting.
3323         * coff-sh.c: Add missing function prototypes.  Fix formatting.
3324
3325 2001-08-23  Jakub Jelinek  <jakub@redhat.com>
3326
3327         * elf-bfd.h (enum elf_reloc_type_class): New.
3328         (struct elf_backend_data): Add elf_backend_reloc_type_class.
3329         (_bfd_elf_reloc_type_class): New.
3330         * elfxx-target.h (elf_backend_reloc_type_class): Define.
3331         (elfNN_bed): Add elf_backend_reloc_type_class.
3332         * elf.c (_bfd_elf_reloc_type_class): New.
3333         * elf32-i386.c (elf_i386_check_relocs): Set DF_TEXTREL if the reloc
3334         is against read-only section.
3335         (elf_i386_size_dynamic_sections): Use DF_TEXTREL flag instead of
3336         looking up section names for DT_TEXTREL.
3337         (elf_i386_reloc_type_class): New.
3338         (elf_backend_reloc_type_class): Define.
3339         * elf32-sparc.c (elf32_sparc_check_relocs): Set DF_TEXTREL if the
3340         reloc is against read-only section.
3341         (elf32_sparc_size_dynamic_sections): Use DF_TEXTREL flag instead of
3342         looking up section names for DT_TEXTREL.
3343         (elf32_sparc_reloc_type_class): New.
3344         (elf_backend_reloc_type_class): Define.
3345         * elf64-sparc.c (sparc64_elf_check_relocs): Set DF_TEXTREL if the
3346         reloc is against read-only section.
3347         (sparc64_elf_size_dynamic_sections): Use DF_TEXTREL flag instead of
3348         looking up section names for DT_TEXTREL.
3349         (sparc64_elf_reloc_type_class): New.
3350         (elf_backend_reloc_type_class): Define.
3351         * elfxx-ia64.c (struct elfNN_ia64_link_hash_table): Add reltext field.
3352         (elfNN_ia64_hash_table_create): Clear ia64_info.
3353         (get_reloc_section): Set DF_TEXTREL if the reloc is against read-only
3354         section.
3355         (elfNN_ia64_size_dynamic_sections): Use ia64_info->reltext flag
3356         instead of looking up section names for DT_TEXTREL.
3357         (elfNN_ia64_reloc_type_class): New.
3358         (elf_backend_reloc_type_class): Define.
3359         * elflink.h (size_dynamic_sections): Add spare DT_NULL tags.
3360         (struct elf_link_sort_rela): New.
3361         (elf_link_sort_cmp1, elf_link_sort_cmp2, elf_link_sort_relocs): New.
3362         (elf_bfd_final_link): Call elf_link_sort_relocs.
3363         Convert one spare DT_NULL into DT_RELCOUNT resp. DT_RELACOUNT if
3364         necessary.
3365
3366 2001-08-23  Nick Clifton  <nickc@cambridge.redhat.com>
3367
3368         * configure.in (x86-bsdi): No corefile support.
3369         * configure: Regenerate.
3370
3371 2001-08-22  Nick Clifton  <nickc@cambridge.redhat.com>
3372
3373         * coff-stgo32.c (COFF_SECTION_ALIGNMENT_ENTRIES): Add missing
3374         comma.
3375
3376 2001-08-21  Mark Elbrecht  <snowball3@bigfoot.com>
3377
3378         * coff-go32.c: Make DWARF2 sections use an alignment of 0.  Set
3379         the alignment of dwarf2 linkonce sections to 0.
3380         * coff-sto32.c: Likewise.
3381
3382 2001-08-20  Andreas Jaeger  <aj@suse.de>
3383
3384         * coff-sparc.c: Add missing prototypes.
3385         * elf32-s390.c: Likewise.
3386         * elf32-i960.c: Likewise.
3387         * aout-target.h: Likewise.
3388
3389 2001-08-20  H.J. Lu  <hjl@gnu.org>
3390
3391         * elf-bfd.h (elf_obj_tdata): Add num_section_syms.
3392         (elf_num_section_syms): New for num_section_syms.
3393
3394         * elf.c (elf_map_symbols): Set num_section_syms.
3395         (_bfd_elf_symbol_from_bfd_symbol): Check num_section_syms for
3396         the section symbol index.
3397
3398 2001-08-20  Nick Clifton  <nickc@cambridge.redhat.com>
3399
3400         * elfxx-target.h (bfd_elfNN_bfd_link_hash_table_create): Never
3401         select the generic has table creator.  All elf backends need elf
3402         specific fields in the hash table.
3403
3404 2001-08-20  Alan Modra  <amodra@bigpond.net.au>
3405
3406         * archive.c (offsetof): Remove define.
3407         * elf.c: Likewise.
3408         * oasys.c: Likewise
3409         * sysdep.h (offsetof): Define.
3410
3411 2001-08-17  Alan Modra  <amodra@bigpond.net.au>
3412
3413         * bfd.c (bfd_get_gp_size): Return an unsigned int.
3414         (bfd_set_gp_size): Make param unsigned.
3415         * bfd-in2.h: Regenerate.
3416         * elf32-ppc.c (ppc_elf_add_symbol_hook): Use elf_gp_size rather
3417         than calling bfd_get_gp_size.
3418         * elf64-alpha.c (elf64_alpha_add_symbol_hook): Likewise.
3419         * elfxx-ia64.c (elfNN_ia64_add_symbol_hook): Likewise.
3420
3421 2001-08-17  Alan Modra  <amodra@bigpond.net.au>
3422
3423         * linker.c (default_fill_link_order): Handle four byte fill value.
3424
3425 2001-08-17  Alan Modra  <amodra@bigpond.net.au>
3426
3427         * elf64-sparc.c (sparc64_elf_output_arch_syms): Add missing
3428         prototype.
3429         * nlm32-alpha.c (nlm_alpha_write_external): Fix warning.
3430
3431         * elf64-mips.c (UNUSED_RELOC): Define.
3432         (mips_elf64_howto_table_rel): Use it.
3433         (mips_elf64_howto_table_rela): Here too.
3434         (mips_elf64_write_relocs): Fix signed/unsigned warning.
3435
3436         * coffcode.h (coff_write_object_contents): Add ATTRIBUTE_UNUSED to
3437         silence warning.
3438         * coffgen.c (coff_print_symbol): Fix warnings.
3439         (coff_find_nearest_line): Likewise.
3440         * cofflink.c (_bfd_coff_link_input_bfd): Likewise.
3441         * coff-alpha.c (alpha_convert_external_reloc): Likewise.
3442         * format.c (bfd_check_format_matches): Likewise.
3443         (bfd_set_format): Likewise.
3444         * coff-ia64.c: Add missing prototypes.
3445         * elf64-alpha.c (struct alpha_elf_link_hash_entry): Make addend
3446         signed to silence warnings.
3447         (elf64_alpha_relocate_section): Likewise.
3448         (elf64_alpha_find_reloc_at_ofs): Fix warnings.
3449         (elf64_alpha_add_symbol_hook): Likewise.
3450         (elf64_alpha_final_link): Likewise.
3451         (elf64_alpha_relax_section): Remove redundant assign to info.gotent.
3452         (elf64_alpha_merge_gots): Add ATTRIBUTE_UNUSED to unused args.
3453         (elf64_alpha_size_got_sections): Likewise.
3454         * elfxx-ia64.c: Add missing prototypes.
3455         (elfNN_ia64_relocate_section): Fix warning.
3456         (elfNN_ia64_unwind_entry_compare): Make params const.
3457
3458 2001-08-17  Alan Modra  <amodra@bigpond.net.au>
3459
3460         * config.bfd (targ64_selvecs): New.
3461         <powerpc-*-aix* entry>: Use it here instead of ineffectual #ifdef.
3462
3463         * bfd-in.h (BFD_VERSION): Remove wrong comment.
3464         (BFD_DEFAULT_TARGET_SIZE): New.
3465         (BFD_ARCH_SIZE): Comment.
3466         * configure.in (target_size): New.  Set instead of target64 in
3467         selvecs case statement.  Set target64 from it.
3468         (bfd_default_target_size): New.  Set from taget_size. AC_SUBST.
3469         * bfd-in2.h: Regenerate.
3470         * configure: Regenerate.
3471
3472 2001-08-17  Alan Modra  <amodra@bigpond.net.au>
3473
3474         * bfd.c (enum bfd_error): Add bfd_error_wrong_object_format.
3475         (bfd_errmsgs): Add corresponding message.
3476         * archive.c (bfd_generic_archive_p): Don't release bfd_ardata when
3477         finding an archive that contains different format object files.
3478         Return bfd_error_wrong_object_format for this case.
3479         * format.c: Formatting fixes.  s/CONST/const/.
3480         (bfd_check_format_matches): Accept archives that give
3481         bfd_error_wrong_object_format if no full match is found.  Tidy
3482         code handling matching_vector.  Don't return a pointer to freed
3483         memory in `matching'.  Handle ambiguous matches as for partial
3484         archive matches.
3485         * bfd-in2.h: Regenerate.
3486
3487 2001-08-15  Alan Modra  <amodra@bigpond.net.au>
3488
3489         * libieee.h (common_header_type): Add last_byte field.
3490
3491         * ieee.c: Add missing prototypes.  Some format fixes.
3492         (struct output_buffer_struct): Move for availability to prototypes.
3493         (ieee_part_after): New function.
3494         (ieee_slurp_debug): Use it here.
3495         (ieee_seek): Pass in ieee_data_struct rather than bfd.  Use
3496         ieee_part_after to set last_byte to one past end of current part.
3497         Update callers.
3498         (ieee_pos): Pass in ieee_data_struct rather than bfd.
3499         Update callers.
3500         (parse_expression): Don't go beyond the end of the current part.
3501         (ieee_slurp_external_symbols): Correct type passed to read_2bytes.
3502         (ieee_get_symtab_upper_bound, ieee_get_symtab,
3503         ieee_get_symbol_info, ieee_print_symbol, ieee_new_section_hook,
3504         ieee_get_reloc_upper_bound, ieee_canonicalize_reloc, block,
3505         ieee_set_section_contents, ieee_write_object_contents,
3506         ieee_make_empty_symbol): Make static.
3507         (ieee_archive_p): Correct comments regarding bfd_read.
3508         (ieee_object_p): Similarly.
3509         (ieee_mkobject): Move it.  Clear output_ptr_start, output_ptr,
3510         output_ptr_end, input_ptr_start, input_ptr, input_ptr_end,
3511         input_bfd, output_bfd, output_buffer.
3512         (do_as_repeat): Write out ieee_set_current_pc_enum value as for
3513         do_with_relocs, ie. as a symbol for relocatable files.
3514         (ieee_vec): Add comments showing functions referenced by macros.
3515
3516 2001-08-14  Nick Clifton  <nickc@cambridge.redhat.com>
3517
3518         * aout-tic30.c: Add missing prototypes.  Fix formatting.
3519         * aout-ns32k.c: Add missing prototypes.  Fix formatting.
3520         * peXXigen.c: Add missining prototypes.  Fix formatting.
3521         * aout-adobe.c: Add missining prototypes.  Fix formatting.
3522
3523 2001-08-13  Nick Clifton  <nickc@cambridge.redhat.com>
3524
3525         * elf32-v850.c: Add missing function prototypes.
3526         Fix some formatting.
3527
3528         * cpu-v850.c: Add missing function prototype.
3529         Fix some formatting.
3530
3531 2001-08-11  Nick Clifton  <nickc@cambridge.redhat.com>
3532
3533         * elf-bfd.h (struct elf_backend_data): Add new fields
3534         'elf_backend_sprintf_vma' and 'elf_backend_fprintf_vma'.
3535         (bfd_elf_sprintf_vma): Rename function prototype to
3536         '_bfd_elf_sprintf_vma'.
3537         (bfd_elf_fprintf_vma): Rename function prototype to
3538         '_bfd_elf_fprintf_vma'.
3539         * bfd.c (bfd_sprintf_vma): Do not invoke bfd_elf_sprintf_vma
3540         directly, instead indirect via the elf_backend_data structure.
3541         (bfd_fprintf_vma): Do not invoke bfd_elf_fprintf_vma directly,
3542         instead indirect via the elf_backend_data structure.
3543         * elf.c (bfd_elf_sprintf_vma): Rename to _bfd_elf_sprintf_vma.
3544         (bfd_elf_fprintf_vma): Rename to _bfd_elf_fprintf_vma.
3545         * elfxx-target.h (elf_backend_sprintf_vma): Initialise if not
3546         already defined.
3547         (elf_backend_fprintf_vma): Initialise if not already defined.
3548         (struct elf_backend_data): Initialise the
3549         elf_backend_sprintf_vma and elf_backend_fprintf_vma fields.
3550
3551 2001-08-10  Andreas Jaeger  <aj@suse.de>
3552
3553         * elf64-sparc.c: Add missing prototypes.
3554         * elf32-cris.c: Likewise.
3555         * elf32-i370.c: Likewise.
3556         * elf64-hppa.c: Likewise.
3557         * elf64-s390.c: Likewise.
3558
3559 2001-08-10  Andreas Jaeger  <aj@suse.de>
3560
3561         * elf64-x86-64.c (elf64_x86_64_elf_object_p): Make static.
3562         Add prototypes where needed.
3563
3564 2001-08-10  H.J. Lu  <hjl@gnu.org>
3565
3566         * bfd.c (bfd_sprintf_vma): Fix a typo in the last change.
3567         (bfd_fprintf_vma): Likewise.
3568
3569 2001-08-10  H.J. Lu  <hjl@gnu.org>
3570
3571         * bfd.c (bfd_sprintf_vma): Don't return void.
3572         (bfd_fprintf_vma): Likewise.
3573
3574 2001-08-10  Andreas Jaeger  <aj@suse.de>
3575
3576         * configure.in: Add -Wstrict-prototypes and -Wmissing-prototypes
3577         to build warnings.
3578         * configure: Regenerate.
3579
3580 2001-08-10  Alan Modra  <amodra@bigpond.net.au>
3581
3582         * elf.c (bfd_elf_sprintf_vma): Add ATTRIBUTE_UNUSED to quiet
3583         warning if not BFD64.  Add braces so emacs auto format works.
3584         (bfd_elf_fprintf_vma): Likewise.
3585
3586         * libxcoff.h (struct xcoff_backend_data_rec): Constify src param
3587         of _xcoff_swap_ld*.
3588         * coff-rs6000.c (xcoff_swap_ldhdr_in): Modify type of external
3589         param to agree with libxcoff.h.
3590         (xcoff_swap_ldhdr_out): Likewise.
3591         (xcoff_swap_ldsym_in): Likewise.
3592         (xcoff_swap_ldsym_out): Likewise.
3593         (xcoff_swap_ldrel_in): Likewise.
3594         (xcoff_swap_ldrel_out): Likewise.
3595         (xcoff_create_csect_from_smclas): Likewise.
3596         * coff64-rs6000.c: Add missing prototypes.
3597         (xcoff64_swap_ldhdr_in): Modify type of external param to agree
3598         with libxcoff.h.
3599         (xcoff64_swap_ldhdr_out): Likewise.
3600         (xcoff64_swap_ldsym_in): Likewise.
3601         (xcoff64_swap_ldsym_out): Likewise.
3602         (xcoff64_swap_ldrel_in): Likewise.
3603         (xcoff64_swap_ldrel_out): Likewise.
3604         (xcoff64_ppc_relocate_section): Make static.
3605         (xcoff64_slurp_armap): Likewise.
3606         (xcoff64_archive_p): Likewise.
3607         (xcoff64_openr_next_archived_file): Likewise.
3608         (xcoff64_sizeof_headers): Likewise.
3609         (xcoff64_is_lineno_count_overflow): Likewise.
3610         (xcoff64_is_reloc_count_overflow): Likewise.
3611         (xcoff64_loader_symbol_offset): Likewise.
3612         (xcoff64_loader_reloc_offset): Likewise.
3613         * elf64-gen.c: Add missing prototypes.
3614
3615 2001-08-09  H.J. Lu  <hjl@gnu.org>
3616
3617         * elf.c (bfd_elf_sprintf_vma): Check ELFCLASS64 only in BFD64.
3618         (bfd_elf_fprintf_vma): Likewise.
3619
3620 2001-08-09  H.J. Lu  <hjl@gnu.org>
3621
3622         * bfd-in.h (bfd_elf_sprintf_vma, bfd_elf_fprintf_vma): Moved
3623         to ...
3624         * elf-bfd.h: Here.
3625         * bfd-in2.h: Regenerated.
3626
3627 2001-08-09  H.J. Lu  <hjl@gnu.org>
3628
3629         * bfd-in.h (bfd_sprintf_vma): New prototype.
3630         (bfd_fprintf_vma): Likewise.
3631         (bfd_elf_sprintf_vma): Likewise.
3632         (bfd_elf_fprintf_vma): Likewise.
3633         (bfd_printf_vma): New. Defined with bfd_fprintf_vma.
3634         * bfd-in2.h: Regenerated.
3635
3636         * bfd.c (bfd_sprintf_vma): New. Defined.
3637         (bfd_fprintf_vma): Likewise.
3638
3639         * elf.c (bfd_elf_sprintf_vma): New. Defined.
3640         (bfd_elf_fprintf_vma): Likewise.
3641
3642 2001-08-09  Alan Modra  <amodra@bigpond.net.au>
3643
3644         * coff-rs6000.c: Add missing prototypes.
3645         (xcoff_ppc_relocate_section, xcoff_is_lineno_count_overflow,
3646         xcoff_is_reloc_count_overflow, xcoff_loader_symbol_offset,
3647         xcoff_loader_reloc_offset): Make static.
3648         * dwarf1.c: Add missing prototypes.
3649         * dwarf2.c: Add missing prototypes.
3650         (struct abbrev_info): Move definition.
3651         (struct attr_abbrev, ABBREV_HASH_SIZE, ATTR_ALLOC_CHUNK): Likewise.
3652         * elf.c: Add missing prototypes.
3653         * elf32-gen.c: Likewise.
3654         * elf32-i386.c: Likewise.
3655         * elf32-ppc.c: Likewise.
3656         (ppc_elf_sort_rela): Use PTR instead of "void *".
3657         * elflink.h: Add missing prototypes.  Formatting fixes.
3658         * merge.c: Add missing prototypes.
3659         (last4_eq): Use PTR instead of "void *".
3660         (last_eq): Likewise.
3661         * syms.c: Add missing prototypes.
3662
3663 2001-08-09  Nick Clifton  <nickc@cambridge.redhat.com>
3664
3665         * bfd.c: Fix formatting.
3666         * bfd-in2.h: Regenerate.
3667
3668 2001-08-09  Nick Clifton  <nickc@cambridge.redhat.com>
3669
3670         * elf32-arc.c (R_ARC_B22_PCREL): Change 'partial_inplace' to
3671         true (this target uses REL relocations) and 'pcrel_offset' to
3672         false (the PC is implied, not stored in the offset).
3673
3674 2001-08-08  Alan Modra  <amodra@bigpond.net.au>
3675
3676         1999-10-19  Linus Nordberg  <linus@swox.se>
3677         * elf-bfd.h (struct elf_backend_data): Add want_got_sym.
3678         * elfxx-target.h (elf_backend_want_got_sym): Define.
3679         (elfNN_bed): Add elf_backend_want_got_sym.
3680         * elflink.c (_bfd_elf_create_got_section): Define
3681         _GLOBAL_OFFSET_TABLE_ only if bed->want_got_sym.
3682
3683 2001-08-08  Alexandre Oliva  <aoliva@redhat.com>
3684
3685         * dwarf2.c (struct dwarf2_debug): Add sec, sec_info_ptr and syms.
3686         (find_rela_addend): New function.
3687         (parse_comp_unit): Call it to find the abbrev offset addend.
3688         (_bfd_dwarf2_find_nearest_line): Initialize and maintain the new
3689         members of dwarf2_debug as debugging information is read.
3690
3691 2001-08-07  Nick Clifton  <nickc@cambridge.redhat.com>
3692
3693         * coff-sh.c (sh_coff_reloc_type_lookup): Provide for sh-coff
3694         targets as well as sh-pe.
3695
3696 2001-08-03  Ben Harris <bjh21@netbsd.org>
3697
3698         * elf32-arm.h (elf32_arm_final_link_relocate): Include offset of
3699         reloc from start of section when computing value for R_ARM_REL32
3700         reloc.
3701
3702 2001-08-03  Alan Modra  <amodra@bigpond.net.au>
3703
3704         From  H.J. Lu  <hjl@gnu.org>
3705         * elf32-i386.c (allocate_plt_and_got_and_discard_relocs): Don't
3706         keep relocs for undefined syms if there are no dynamic sections in
3707         executable.
3708         * elf32-hppa.c (allocate_plt_and_got_and_discard_relocs): Likewise.
3709
3710 2001-08-02  Paul Sokolovsky  <paul.sokolovsky@technologist.com>
3711
3712         * cofflink.c (coff_link_check_ar_symbols): also search for
3713         __imp__symbol as well as _symbol.
3714         * linker.c (_bfd_generic_link_add_archive_symbols): also
3715         search for __imp__symbol as well as _symbol.
3716
3717 2001-08-01  Adam Nemet  <anemet@lnxw.com>
3718
3719         * elf.c (elf_sort_sections): Return zero only as the last step.
3720
3721 2001-08-01  Nick Clifton  <nickc@cambridge.redhat.com>
3722
3723         * config.bfd (arm-vxworks): Change name of define from VXWORKS to
3724         ARM_COFF_BUGFIX.
3725         (arm-epoc-pe): Define ARM_COFF_BUGFIX.
3726         coff-arm.c (coff_arm_relocate_section): Replace VXWORKS with
3727         ARM_COFF_BUGFIX.
3728
3729 2001-07-30  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
3730
3731         * libecoff.h (_bfd_ecoff_styp_to_sec_flags): Changed return type
3732         to match corresponding bfd_coff_backend data member.
3733
3734 2001-07-24  Alan Modra  <amodra@bigpond.net.au>
3735
3736         * Makefile.am: Update dependencies with "make dep-am".
3737         * Makefile.in: Regenerate
3738
3739 2001-07-15  H.J. Lu  <hjl@gnu.org>
3740
3741         * Makefile.am (po/SRC-POTFILES.in): Use tmp.src instead of tmp.
3742         (po/BLD-POTFILES.in): Use tmp.bld instead of tmp.
3743         * Makefile.in: Regenerate.
3744
3745 2001-07-11  H.J. Lu  <hjl@gnu.org>
3746
3747         * elf64-alpha.c (elf64_alpha_check_relocs): Set the ALLOC|LOAD
3748         flags when creating the reloc section if the ALLOC flag in the
3749         source section is set.
3750
3751 2001-07-11  Steve Ellcey  <sje@cup.hp.com>
3752
3753         * reloc.c (bfd_reloc_code_type): Add IA64 relocs
3754         BFD_RELOC_IA64_LTOFF_FPTR32MSB and BFD_RELOC_IA64_LTOFF_FPTR32LSB
3755         * bfd-in2.h: Regenerate.
3756         * libbfd.h: Regenerate.
3757         * elfxx-ia64.c (ia64_howto_table): Define how to handle
3758         new relocations.
3759         (elfNN_ia64_reloc_type_lookup): Handle new relocations.
3760         (elfNN_ia64_check_relocs): Likewise.
3761         (elfNN_ia64_install_value): Likewise.
3762         (elfNN_ia64_relocate_section): Likewise.
3763
3764 2001-07-11  Jakub Jelinek  <jakub@redhat.com>
3765
3766         * elf32-sparc.c (_bfd_sparc_elf_howto_table): Remove support for
3767         R_SPARC_UA64.
3768         (elf32_sparc_check_relocs): Likewise.
3769         Only create .rela section for alloced sections in shared libraries.
3770         (elf32_sparc_relocate_section): Likewise.
3771         Remove redundant check.
3772         Optimize unaligned reloc usage.
3773         * elf64-sparc.c (sparc64_elf_relocate_section): Remove redundant
3774         check.
3775
3776 2001-07-11  H.J. Lu  <hjl@gnu.org>
3777
3778         * elf64-alpha.c (elf64_alpha_check_relocs): Only use the same
3779         ALLOC|LOAD flags as the source section for debugging sections
3780         when creating the reloc section.
3781
3782 2001-07-05  Jim Wilson  <wilson@redhat.com>
3783
3784         * linker.c (_bfd_generic_link_add_one_symbol, case BIG): Use
3785         the section of the bigger symbol.
3786
3787         * syms.c (bfd_is_local_label): Return false if BSF_SECTION_SYM.
3788
3789 2001-07-05  Nick Clifton  <nickc@cambridge.redhat.com>
3790
3791         * peicode.h (coff_swap_scnhdr_in): For sections containing
3792         uninitialised data, only set their size to s_paddr if this does
3793         not reset their size to zero.  MS's latest compilers will set
3794         s_paddr to zero.
3795
3796 2001-07-04  H.J. Lu  <hjl@gnu.org>
3797
3798         * bfd/elf32-mips.c (_bfd_mips_elf_final_write_processing):
3799         Handle bfd_mach_mips4400, bfd_mach_mips4600 and
3800         bfd_mach_mips5000.
3801
3802 2001-07-03  Mark Elbrecht  <snowball3@softhome.net>
3803
3804         * bfd.c (bfd_get_sign_extend_vma): Support DJGPP COFF targets.
3805
3806         * cofflink.c (_bfd_coff_link_input_bfd): Skip section symbols from
3807         sections being discarded.
3808
3809 2001-06-30  Alan Modra  <amodra@bigpond.net.au>
3810
3811         * elfcore.h (elf_core_file_p): Call bfd_section_from_phdr directly
3812         instead of _bfd_elfcore_section_from_phdr.
3813         * elf-bfd.h (_bfd_elfcore_section_from_phdr): Remove.
3814         * elf.c (_bfd_elfcore_section_from_phdr): Remove.
3815         (_bfd_elfcore_make_pseudosection): Expedite tail-call.
3816         (elfcore_grok_prstatus): Likewise.
3817         (elfcore_grok_lwpstatus): Likewise.
3818         (bfd_get_elf_phdr_upper_bound): Likewise.
3819         (elfcore_make_note_pseudosection): Formatting.
3820         (_bfd_elfcore_strndup): Formatting.
3821         * elf32-mips.c (mips_elf_sym_is_global): Formatting.
3822         (_bfd_elf32_mips_grok_prstatus): Expedite tail-call.
3823
3824 2001-06-29  Daniel Jacobowitz  <drow@mvista.com>
3825
3826         * elf-bfd.h: Add prototypes for _bfd_elfcore_make_pseudosection
3827         and _bfd_elfcore_strndup.
3828         (struct elf_backend_data): Add elf_backend_grok_prstatus
3829         and elf_backend_grok_psinfo.
3830         * elf.c (_bfd_elfcore_make_pseudosection): New function.
3831         (elfcore_grok_prstatus): Use it.
3832         (elfcore_make_note_pseudosection): Likewise.
3833         (elfcore_strndup):  Rename to...
3834         (_bfd_elfcore_strndup): Here, and make global.
3835         (elfcore_grok_psinfo): Use _bfd_elfcore_strndup.
3836         (elfcore_grok_note): Call elf_backend_grok_prstatus
3837         and elf_backend_grok_psinfo if available.
3838         * elf32-mips.c (_bfd_elf32_mips_grok_prstatus): New function.
3839         (_bfd_elf32_mips_grok_psinfo): New function.
3840         (elf_backend_grok_prstatus): Define.
3841         (elf_backend_grok_psinfo): Define.
3842         * elfxx-target.h (elf_backend_grok_prstatus): Default to NULL.
3843         (elf_backend_grok_psinfo): Likewise.
3844         (elfNN_bed): Include elf_backend_grok_prstatus and
3845         elf_backend_grok_psinfo.
3846
3847 2001-06-29  H.J. Lu  <hjl@gnu.org>
3848
3849         * elf32-hppa.c (elf32_hppa_finish_dynamic_sections): Check if
3850         hplink->sgot is NULL before filling GOT.  Check if hplink->splt
3851         is NULL before filling PLT.
3852
3853 2001-06-29  Alan Modra  <amodra@bigpond.net.au>
3854
3855         * elflink.h (elf_link_output_extsym): Revert 1999-04-10.
3856
3857 2001-06-27  Alan Modra  <amodra@bigpond.net.au>
3858
3859         * elf32-hppa.c (elf32_hppa_check_relocs): Don't make syms dynamic
3860         here..
3861         (elf32_hppa_adjust_dynamic_symbol): ..nor here..
3862         (allocate_plt_and_got_and_discard_relocs): .. instead do so here
3863         after gc has run.
3864
3865         * elf32-hppa.c (RELATIVE_DYNAMIC_RELOCS): Delete.
3866         (IS_ABSOLUTE_RELOC): Define.
3867         (elf32_hppa_link_hash_entry): Always include reloc_entries field.
3868         (hppa_link_hash_newfunc): Always init it.
3869         (elf32_hppa_check_relocs): Mark symbols as ELF_LINK_NON_GOT_REF to
3870         create COPY relocs only when the reloc is in a read-only section.
3871         Instead, allocate space for a dynamic reloc to reference the
3872         library symbol directly.  Keep track of space we allocate using
3873         relocs_entries.
3874         (hppa_discard_copies): Delete, and move code to..
3875         (allocate_plt_and_got): ..here.  Rename to
3876         allocate_plt_and_got_and_discard_relocs.  Remove unneeded dynamic
3877         relocs for non-shared link.
3878         (elf32_hppa_size_dynamic_sections): Update calls to above.
3879         (elf32_hppa_relocate_section): Write out the dynamic relocs used
3880         in lieu of COPY relocs.
3881
3882         * elf32-i386.c (elf_i386_check_relocs): Don't make syms dynamic
3883         here..
3884         (elf_i386_adjust_dynamic_symbol): ..nor here..
3885         (allocate_plt_and_got_and_discard_relocs): .. instead do so here
3886         after gc has run.
3887         (elf_i386_size_dynamic_sections): Fix a comment.
3888         (elf_i386_relocate_section <R_386_32, R_386_PC32>): Rearrange code
3889         involved in writing reloc out.
3890
3891 2001-06-25  Alan Modra  <amodra@bigpond.net.au>
3892
3893         * elf32-i386.c (elf_i386_check_relocs <R_386_32, R_386_PC32>):
3894         Ensure syms are dynamic if we might be emitting a reloc.
3895         (allocate_plt_and_got_and_discard_relocs): Don't discard relocs
3896         for undefweak or undefined syms..
3897         (elf_i386_relocate_section <R_386_32, R_386_PC32>): .. and emit.
3898
3899         * elf32-i386.c (allocate_plt_and_got_and_discard_relocs): Discard
3900         relocs without ELF_LINK_HASH_DEF_DYNAMIC set.
3901         (elf_i386_relocate_section <R_386_32, R_386_PC32>): Remove
3902         redundant bfd_link_hash_defined, bfd_link_hash_defweak test.
3903
3904 2001-06-24  H.J. Lu  <hjl@gnu.org>
3905
3906         * cpu-i960.c (scan_960_mach): Don't modify const char *. Use
3907         strncasecmp/strcasecmp instead of strncmp/strcmp.
3908
3909 2001-06-23  H.J. Lu  <hjl@gnu.org>
3910
3911         * elf32-i386.c (elf_i386_relocate_section <R_386_32, R_386_PC32>):
3912         Check ELF_LINK_HASH_DEF_DYNAMIC to see if a symbol is not defined
3913         in the regular object file and treat the weak definition as
3914         the normal one.
3915
3916 2001-06-23  Alan Modra  <amodra@bigpond.net.au>
3917
3918         * elf32-i386.c (elf_i386_relocate_section <R_386_GOT32>): Tighten
3919         unresolved_reloc test to exclude cases where we use "relocation"
3920         before setting it to point into the .got.  Reinstate fudge for
3921         unresolved relocs in debugging sections.
3922
3923         * elf32-i386.c (elf_i386_relocate_section): Replace ugly
3924         complicated tests for unresolvable relocs with a simple direct
3925         scheme using "unresolved_reloc" var.
3926
3927         * elf32-i386.c (struct elf_i386_pcrel_relocs_copied): Rename to
3928         elf_i386_dyn_relocs.  Update comment.
3929         (struct elf_i386_link_hash_entry): Rename pcrel_relocs_copied to
3930         dyn_relocs.
3931         (elf_i386_adjust_dynamic_symbol): Remove a BFD_ASSERT, change
3932         others to aborts.
3933         (allocate_plt_and_got_and_discard_relocs): Replace BFD_ASSERT with
3934         abort.
3935         (elf_i386_size_dynamic_sections): Likewise.
3936         (elf_i386_finish_dynamic_symbol): Likewise.
3937         (elf_i386_finish_dynamic_sections): Likewise.
3938         (elf_i386_relocate_section): Likewise.  Tidy R_386_GOT32 and error
3939         handling code.
3940
3941         Avoid creating COPY relocs if possible.
3942         * elf32-i386.c (elf_i386_check_relocs): Tweak condition under
3943         which .got created.  Mark symbols used by R_386_32 and R_386_PC32
3944         relocs as ELF_LINK_NON_GOT_REF to create COPY relocs only when the
3945         reloc is in a read-only section.  Instead, allocate space for a
3946         dynamic reloc to reference the library symbol directly.  Keep
3947         track of space we allocate using pcrel_relocs_copied.
3948         (discard_copies): Delete, and move code to ..
3949         (allocate_plt_and_got): ..here.  Rename to
3950         allocate_plt_and_got_and_discard_relocs.  Remove unneeded dynamic
3951         relocs for non-shared link.
3952         (elf_i386_size_dynamic_sections): Update calls to above functions.
3953         (elf_i386_relocate_section): Write out the dynamic relocs.  Add
3954         more ugly logic to avoid "unresolvable relocation" error.  Use
3955         htab shortcut in place of elf_hash_table macro.
3956         (elf_i386_finish_dynamic_sections): Allow that dynamic .got may
3957         not always be created now.
3958
3959 2001-06-20  Bo Thorsen  <bo@suse.co.uk>
3960
3961         * elf64-x86-64.c (elf64_x86_64_relocate_section): Fix linking of
3962         shared libraries.
3963
3964 2001-06-18  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
3965
3966         * configure.host (mips64-*-linux): Reformat.
3967
3968 2001-06-21  Alan Modra  <amodra@bigpond.net.au>
3969
3970         * elf32-hppa.c (elf32_hppa_size_dynamic_sections): Always
3971         allocate local .got space.  Use shortcuts from hash table for .got
3972         and .plt rather than comparing section names.
3973         (elf32_hppa_check_relocs): Use local_plt_refcounts var rather than
3974         adjusting index into local_got_refcounts to document what we are
3975         really doing.
3976         (elf32_hppa_relocate_section): Similarly for local_plt_offsets.
3977         Tidy .got and .plt error checking.
3978
3979 2001-06-20  Catherine Moore  <clm@redhat.com>
3980
3981         * elf-bfd.h (struct elf_backend_data):
3982         elf_backend_emit_relocs: New field: Function for emitting
3983         relocs.
3984         elf_backend_count_relocs: New field: Function for determining
3985         the number of relocs to be emitted.
3986         * elfxx-target.h: Provide default (NULL) values for
3987         elf_backend_emit_relocs and elf_backend_count_relocs.
3988         * elflink.h (elf_link_size_reloc_section): Make the hash table
3989         big enough to hold the relocs counted by either reloc_count or
3990         o->reloc_count.
3991         (elf_bfd_final_link) emit_relocs: New boolean, set if relocs
3992         should be emitted, either because of a command line option
3993         stored in the info structure or because the target provides a
3994         special reloc emitting function.
3995         If the target provides a reloc counting function use it,
3996         unless performing a relocatable link or emitting all relocs.
3997         Also set the SEC_RELOC flag on any output section which will
3998         contain relocs.
3999         (elf_link_input_bfd): emit_relocs: New boolean, set if relocs
4000         should be emitted, either because of a command line option
4001         stored in the info structure or because the target provides a
4002         special reloc emitting function.
4003         If the target provides a reloc emitting function, use it,
4004         unless performing a relocatable link or emitting all relocs.
4005
4006 2001-06-20  H.J. Lu  <hjl@gnu.org>
4007
4008         * elf32-i386.c (elf_i386_size_dynamic_sections): Always
4009         allocate local .got space.
4010
4011 2001-06-19  Andreas Jaeger  <aj@suse.de>
4012
4013         * elf64-x86-64.c (elf64_x86_64_relocate_section): Fix creation of
4014         dynamic symbols.
4015
4016 2001-06-18  Hans-Peter Nilsson  <hp@axis.com>
4017
4018         * elflink.h (struct elf_assign_sym_version_info): Remove member
4019         export_dynamic.  All users changed to use info member.
4020         NAME(bfd_elf,size_dynamic_sections)): Remove parameter
4021         export_dynamic, instead use member in parameter info.
4022         * bfd-in.h (bfd_elf32_size_dynamic_sections,
4023         bfd_elf64_size_dynamic_sections): Update prototype.
4024         * bfd-in2.h: Regenerate.
4025
4026 2001-06-18  H.J. Lu  <hjl@gnu.org>
4027
4028         * elflink.h (elf_info_failed): Add a new field, verdefs.
4029         (NAME(bfd_elf,size_dynamic_sections): Pass verdefs to
4030         elf_export_symbol.
4031         (elf_export_symbol): Check eif->verdefs to decide if a symbol
4032         should be exported.
4033
4034 2001-06-17  H.J. Lu  <hjl@gnu.org>
4035
4036         * elf32-mips.c (mips_elf_link_hash_entry): Add a new field,
4037         readonly_reloc, to record if a relocation in the .rel.dyn
4038         section is against a read-only section.
4039         (mips_elf_link_hash_newfunc): Initialize the readonly_reloc
4040         field to false.
4041         (_bfd_mips_elf_check_relocs): Record if there is a relocation
4042         in the .rel.dyn section against a read-only section by setting
4043         DF_TEXTREL or readonly_reloc.
4044         (_bfd_mips_elf_copy_indirect_symbol): Copy readonly_reloc if
4045         it is true.
4046         (_bfd_mips_elf_adjust_dynamic_symbol): Record DF_TEXTREL if
4047         there is a relocation in the .rel.dyn section against a
4048         read-only section.
4049         (_bfd_mips_elf_size_dynamic_sections): Set DT_TEXTREL if
4050         DF_TEXTREL is set.
4051
4052 2001-06-12  Nick Clifton  <nickc@cambridge.redhat.com>
4053
4054         * coffcode.h (styp_flags_to_sec_flags): Change to a boolean
4055         function.  Move flagword result into parameter list.  Remove
4056         comment about setting bfd_error_handler to intercept failure
4057         results.
4058         * coffgen.c (make_a_section_from_file): Examine result of
4059         calling bfd_coff_styp_to_sec_flags and pass a failure back to
4060         caller.
4061         * ecoff.h (styp_flags_to_sec_flags): Change to a boolean
4062         function.  Move flagword result into parameter list.
4063         * libcoff.h: Regenerate.
4064         * libecoff.h: Regenerate.
4065
4066 2001-06-13  Nick Clifton  <nickc@cambridge.redhat.com>
4067
4068         * aoutx.h (adjust_z_magic): Only pad the tesxt section if the data
4069         section is going to follow it.
4070
4071 2001-06-12  Catherine Moore  <clm@redhat.com>
4072
4073         * elflink.h (elf_gc_propagate_vtable_entries): Replace FILE_ALIGN
4074         with the file_align entry from elf_backend_data.
4075         (elf_gc_smash_unused_vtentry_relocs): Likewise.
4076         (elf_gc_record_vtentry): Likewise.
4077
4078 2001-06-10  Alan Modra  <amodra@bigpond.net.au>
4079
4080         * elflink.h: Whitespace changes.
4081         (elf_link_read_relocs_from_section): Use "unsigned int" iterator
4082         rather than "unsigned char".
4083         (elf_link_output_relocs): Likewise.
4084         (elf_link_input_bfd): Likewise.
4085         (elf_reloc_link_order): LIkewise.
4086         * elf.c: s/CONST/const/.  Whitespace changes.
4087         * elf32-mips.c: Formatting fix.
4088
4089         * Makefile.am (SOURCE_HFILES): Include xcoff-target.h, remove xcoff.h.
4090         * Makefile.in: Regenerate.
4091         * po/Make-in: Remove trailing tab.
4092
4093 2001-06-09  Philip Blundell  <philb@gnu.org>
4094
4095         * elf32-arm.h (elf32_arm_plt0_entry): Correct error in last
4096         change.
4097         (elf32_arm_plt_entry): Likewise.
4098
4099 2001-06-08  H.J. Lu  <hjl@gnu.org>
4100
4101         * elf.c (swap_out_syms): Keep names for global section symbols.
4102
4103 2001-06-07  H.J. Lu  <hjl@gnu.org>
4104
4105         * config.bfd: Put back ecoff for Linux/mips. Firmwares on some
4106         MIPS-based machines need it.
4107
4108 2001-06-07  H.J. Lu  <hjl@gnu.org>
4109
4110         * elf32-mips.c (_bfd_mips_elf_object_p): Set the bad symtab
4111         for SGI only.
4112
4113         * config.bfd: Remove ecoff from Linux/mips.
4114
4115 2001-06-07  Andreas Jaeger  <aj@suse.de>
4116
4117         * elf64-x86-64.c (elf64_x86_64_finish_dynamic_symbol): Add an
4118         assertion.
4119         (elf64_x86_64_check_relocs): Fix VTENTRY relocation; set an
4120         alignment of 8 for .rela sections; handle further relocations.
4121
4122 2001-06-06  Christian Groessler <cpg@aladdin.de>
4123
4124         * coff-z8k.c: Fix formatting.
4125         Fix howtos: howto->size was always 1.
4126
4127 2001-06-05  Thiemo Seufer  <seufer@csv.ica.uni-stuttgart.de>
4128
4129         * configure.host (mips64*-*-linux*): Define.
4130
4131 2001-06-05  Alan Modra  <amodra@bigpond.net.au>
4132
4133         * elf32-i386.c (elf_i386_discard_copies): Rename to
4134         discard_copies, and use elf_link_hash_entry arg rather than
4135         elf_i386_link_hash_entry.
4136         (elf_i386_link_hash_traverse): Delete.
4137         (elf_i386_size_dynamic_sections): Adjust call to discard_copies.
4138         Tidy sizing of dynamic sections.
4139         (elf_i386_check_relocs <R_386_32, R_386_PC32>): Reference count
4140         possible .plt entries.
4141         (elf_i386_gc_sweep_hook): Likewise.
4142         (elf_i386_adjust_dynamic_symbol): Discard .plt entries for
4143         everything with plt.refcount <= 0.
4144
4145         * elf32-i386.c (elf_i386_check_relocs): Don't allocate .got and
4146         .relgot space here.
4147         (elf_i386_gc_sweep_hook): ..and no need to deallocate here..
4148         (elf_i386_adjust_dynamic_symbol): ..and don't allocate .plt and
4149         .rel.plt here..
4150         (allocate_plt_and_got): ..instead do it all here.  New function.
4151         (elf_i386_size_dynamic_sections): Allocate local .got space and
4152         call allocate_plt_and_got.  No need to zap .relgot if not dynamic.
4153         (bfd_elf32_bfd_final_link): Delete.  (ie. use regular final link
4154         rather than gc variety).
4155         (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Define.
4156         (elf_i386_relocate_section): Use it here and correct handling of
4157         R_386_GOT32.  Provide section and offset for "unresolvable
4158         relocation" error message.
4159         (elf_i386_finish_dynamic_symbol): Correct handling of R_386_GOT32.
4160
4161         * elf32-i386.c (struct elf_i386_link_hash_table): Add sgot,
4162         sgotplt, srelgot, splt, srelplt, sdynbss, srelbss fields.
4163         (elf_i386_link_hash_table_create): Init them.
4164         (create_got_section): New function.
4165         (elf_i386_create_dynamic_sections): New function.
4166         (elf_backend_create_dynamic_sections): Set to above.
4167         (elf_i386_check_relocs): Use shortcuts from hash table rather than
4168         calling bfd_get_section_by_name.
4169         (elf_i386_gc_sweep_hook): Likewise.
4170         (elf_i386_adjust_dynamic_symbol): Likewise.
4171         (elf_i386_size_dynamic_sections): Likewise.
4172         (elf_i386_relocate_section): Likewise.
4173         (elf_i386_finish_dynamic_sections): Likewise.
4174
4175         * elf32-hppa.c (allocate_plt_and_got): Skip indirect and warning syms.
4176
4177 2001-06-02  H.J. Lu  <hjl@gnu.org>
4178
4179         * elf32-hppa.c (elf32_hppa_object_p): Check ELFOSABI_LINUX
4180         and ELFOSABI_HPUX.
4181         * elf64-hppa.c (elf64_hppa_object_p): Likewise.
4182
4183 2001-06-02  H.J. Lu  <hjl@gnu.org>
4184
4185         * aout-cris.c (MACHTYPE_OK): New. Defined.
4186
4187 2001-06-02  Hans-Peter Nilsson  <hp@axis.com>
4188
4189         * section.c (_bfd_strip_section_from_output): Handle NULL
4190         output_section.
4191
4192 2001-06-02  H.J. Lu  <hjl@gnu.org>
4193
4194         * config.bfd (powerpc-*-aix*, powerpc-*-beos*, rs6000-*-*): Add
4195         rs6000coff64_vec only if BFD64 is defined.
4196         (powerpc64-*-aix*): Enable only if BFD64 is defined.
4197
4198 2001-06-02  H.J. Lu  <hjl@gnu.org>
4199
4200         * coff-ia64.c (ia64coff_object_p): Rewrite with
4201         external_PEI_DOS_hdr and external_PEI_IMAGE_hdr.
4202
4203 2001-06-01  Andreas Jaeger  <aj@suse.de>
4204
4205         * elf64-x86-64.c (elf64_x86_64_relocate_section): Add PC8
4206         relocation, small reformatting.
4207
4208 2001-05-29  Andreas Jaeger  <aj@suse.de>
4209
4210         * elf64-x86-64.c (elf64_x86_64_check_relocs): Handle R_X86_64_64.
4211         (elf64_x86_64_relocate_section): Likewise.
4212
4213 2001-05-30  Alan Modra  <amodra@one.net.au>
4214
4215         * elf32-hppa.c (elf32_hppa_check_relocs): Don't NEED_PLT for
4216         millicode.  Don't allocate .got and .rela.got space here..
4217         (elf32_hppa_gc_sweep_hook): ..and no need to deallocate here..
4218         (elf32_hppa_adjust_dynamic_symbol): ..and don't allocate .plt and
4219         .rela.plt here..
4220         (hppa_handle_PIC_calls): ..nor here..
4221         (allocate_plt_and_got): ..instead do it all here.  New function.
4222         (elf32_hppa_size_dynamic_sections): Allocate local .got space and
4223         call allocate_plt_and_got.  No need to zap .got if not dynamic.
4224         (elf32_hppa_final_link): Call regular bfd_final_link instead of
4225         gc_common_final_link.
4226         (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Define.
4227         (elf32_hppa_relocate_section): Use it here.
4228         (elf32_hppa_finish_dynamic_symbol): Remove superfluous test of
4229         dynamic_sections_created.
4230         (hppa_type_of_stub): Don't LONG_BRANCH_VIA_PLT if millicode sym.
4231
4232 2001-05-28  Andreas Jaeger  <aj@suse.de>
4233
4234         * elf64-x86-64.c (elf64_86_64_size_info): Remove, we can use the
4235         generic version since we want a hashsize of 4.
4236         (elf_backend_size_info): Likewise.
4237
4238 2001-05-28  Thiemo Seufer  <seufer@csv.ica.uni-stuttgart.de>
4239
4240         * elflink.h (elf_link_size_reloc_section): Use bfd_zmalloc instead of
4241         a zeroing loop.
4242         (elf_link_output_relocs): Handle MIPS ELF64 relocations correctly.
4243         (elf_link_input_bfd): Likewise.
4244         (elf_reloc_link_order): Likewise.
4245         (elf_finish_pointer_linker_section): Typo. Handle MIPS ELF64
4246         relocations correctly.
4247
4248 2001-05-28  Nicolas Pitre <nico@cam.org>
4249
4250         * elf32-arm.h: fix PLT generation for big endian ARM
4251
4252 2001-05-28  Alan Modra  <amodra@one.net.au>
4253
4254         * elf32-hppa.c (elf32_hppa_relocate_section): Set up .plt entries
4255         for symbols forced local that need plabels.
4256         (elf32_hppa_adjust_dynamic_symbol): Don't allocate space in
4257         .plt.rela for local syms if non-shared.
4258         (hppa_build_one_stub): Mask lsb of plt.offset.
4259         (elf32_hppa_finish_dynamic_symbol): Abort if lsb of plt.offset set.
4260         (clobber_millicode_symbols): Correct comment.
4261         (elf32_hppa_relocate_section): Likewise.
4262         (elf32_hppa_finish_dynamic_symbol): Likewise.
4263
4264 2001-05-28  Jeff Sturm  <jsturm@one-point.com>
4265
4266         * reloc.c: Add BFD_RELOC_SPARC_UA16 and BFD_RELOC_SPARC_UA64.
4267         * bfd-in2.h: Regenerate.
4268         * libbfd.h: Regenerate.
4269         * elf32-sparc.c: Enable BFD_RELOC_SPARC_UA16, BFD_RELOC_SPARC_UA32
4270         and BFD_RELOC_SPARC_UA64 mapping
4271         * elf64-sparc.c: Likewise.
4272
4273 2001-05-25  H.J. Lu  <hjl@gnu.org>
4274
4275         * Makefile.am (BFD32_BACKENDS): Remove coff-pmac.lo.
4276         (BFD32_BACKENDS_CFILES): Remove coff-pmac.c.
4277         (coff-rs6000.lo): Remove the old dependency.
4278         * Makefile.in: Rebuild.
4279
4280         * configure.in (pmac_xcoff_vec): Replace coff-pmac.lo with
4281         coff-rs6000.lo.
4282
4283 2001-05-25  H.J. Lu  <hjl@gnu.org>
4284
4285         * coff-rs6000.c (rs6000coff_vec): Use rs6000coff_core_p,
4286         rs6000coff_core_file_matches_executable_p,
4287         rs6000coff_core_file_failing_command and
4288         rs6000coff_core_file_failing_signal only if AIX_CORE is
4289         defined.
4290         (pmac_xcoff_vec): Likewise.
4291         * coff64-rs6000.c (rs6000coff64_vec): Likewise.
4292
4293 2001-05-25  Timothy Wall  <twall@redhat.com>
4294
4295         * elfxx-ia64.c (allocate_dynrel_entries): Don't allocate an entry
4296         for __GLOB_DATA_PTR on AIX5.  Clean up some relocation bugs.
4297
4298 2001-05-25  H.J. Lu  <hjl@gnu.org>
4299
4300         * bfd-in2.h: Regenerated.
4301         * libcoff.h: Likewise.
4302
4303 2001-05-25  Alan Modra  <amodra@one.net.au>
4304
4305         * elf32-hppa.c (elf32_hppa_relocate_section): Don't allow
4306         undefined millicode syms in shared libs.
4307         (hppa_build_one_stub): Turn BFD_ASSERTs into aborts.
4308         (elf32_hppa_check_relocs): Likewise.
4309         (elf32_hppa_adjust_dynamic_symbol): Likewise.
4310         (elf32_hppa_size_dynamic_sections): Likewise.
4311         (elf32_hppa_relocate_section): Likewise.
4312         (elf32_hppa_finish_dynamic_symbol): Likewise.
4313         (elf32_hppa_finish_dynamic_sections): Likewise.
4314
4315 2001-05-24  Tom Rix <trix@redhat.com>
4316
4317         * Makefile.am coff-pmac bfd now defined in coff-rs6000.c
4318         xcoff-target.h not used to define rs6000 or ppc bfd.
4319         * Makefile.in same
4320
4321         * bfd-in.h : (struct lineno_cache_entry) promote element "offset"
4322         to 64 bit.
4323
4324         * coff-rs6000.c : Many changes for 64 bit support.  Move common
4325         32/64 code to xcofflink.c.  Explictly define the rs6000coff_vec
4326         and pmac_xcoff_vec
4327
4328         * coff64-rs6000.c : Many changes for 64 bit support.  64 bit
4329         linker now supported.  Explictly define the rs6000coff64_vec.
4330
4331         * coffcode.h : (coff_set_arch_mach_hook) xcoff 64 bit support
4332         (coff_print_aux) same
4333         (coff_write_object_contents) same
4334         (coff_slurp_line_table) same
4335
4336         * coffgen.c : (coff_fix_symbol_name) formatting
4337         (coff_mangle_symbols) xcoff 64 bit support
4338         (coff_write_symbol) same
4339         (coff_write_alien_symbol) same
4340         (coff_write_native_symbol) same
4341         (coff_write_symbols) same
4342         (coff_get_symbol_info) same
4343         (bfd_coff_get_syment) same
4344         (coff_print_symbol) same
4345
4346         * config.bfd : add powerpc64-*-aix* target
4347
4348         * libcoff-in.h : formatting
4349
4350         * libcoff.h : move xcoff extern declarations to libxcoff.h
4351
4352         * libxcoff.h : New file
4353
4354         * xcofflink.c : Many changes for xcoff64 support.  Move common
4355         structures to include/coff/xcoff.h.  Move specific structure to
4356         backends coff-rs6000.c and coff64-rs6000.c.  Use new backend
4357         functions, defined in libxcoff.h, to isolate 32/64 dependencies.
4358
4359         (bfd_xcoff_size_dynamic_sections) : special __rtinit symbol for
4360         aix4.2+ -binitfini.
4361
4362         (xcoff_build_ldsyms) : handle special __rtinit symbol.
4363
4364 2001-05-23  Alexandre Oliva  <aoliva@redhat.com>
4365
4366         * elf64-sparc.c (sparc64_elf_slurp_reloc_table): Fix typo
4367         s/ENTIRES/ENTRIES/.
4368
4369 2001-05-23  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
4370
4371         * reloc.c (bfd_reloc_code_real): Add MIPS ELF64 relocations.
4372         * libbfd.h: Regenerate.
4373         * bfd-in2.h: Regenerate.
4374
4375         * aoutx.h (aout_@var{size}_machine_type): Add MIPS r12k support.
4376         * archures.c (bfd_mach_mips12000): Define.
4377         * cpu-mips.c (arch_info_struct): Add MIPS r12k support.
4378         * elf32-mips.c (_bfd_mips_elf_final_write_processing): Add MIPS r12k
4379         support.
4380         (_bfd_mips_elf_size_dynamic_sections): Use official bfd typedef.
4381         * bfd-in2.h: Regenerate.
4382         * elfxx-target.h: Do not redefine bfd_elfNN_bfd_make_debug_symbol.
4383
4384 2001-05-23  kaz Kojima  <kkojima@rr.iij4u.or.jp>
4385
4386         * elf32-sh.c (elf_sh_plt0_entry_be, elf_sh_plt0_entry,
4387         elf_sh_plt_entry_be, elf_sh_plt_entry, elf_sh_pic_plt_entry_be,
4388         elf_sh_pic_plt_entry): New PLT code, that does not use r2, since
4389         that is used by GCC.
4390
4391 2001-05-23  Nick Clifton  <nickc@cambridge.redhat.com>
4392
4393         * elf-bfd.h (NUM_SHDR_ENTRIES): New macro: compute the number
4394         of entries in a structured section.
4395         * elf.c: Use new macro.
4396         * elf32-i386.c: Use new macro.
4397         * elf32-mips.c: Use new macro.
4398         * elf64-alpha.c: Use new macro.
4399         * elf64-sparc.c: Use new macro.
4400         * elfcode.h: Use new macro.
4401         * elflink.h: Use new macro.
4402
4403 2001-05-23  Nick Clifton  <nickc@cambridge.redhat.com>
4404
4405         * bfdint.texi: Replace -oformat with --oformat.
4406
4407 2001-05-21  Andreas Jaeger  <aj@suse.de>
4408
4409         * dwarf2.c (decode_line_info): Fix error message.
4410         (read_abbrevs): Fix test for offset as suggested by Alan Modra and
4411         adjust error message.
4412
4413 2001-05-18  H.J. Lu  <hjl@gnu.org>
4414
4415         * elflink.h (elf_link_add_object_symbols): Revert the last
4416         change.
4417
4418 2001-05-17  Alan Modra  <amodra@one.net.au>
4419
4420         * elf32-hppa.c (clobber_millicode_symbols): Temporarily set
4421         ELF_LINK_FORCED_LOCAL to suit 2001-04-30 change.
4422         (hppa_build_one_stub): Add an assert to check plt.offset.
4423
4424 2001-05-17  H.J. Lu  <hjl@gnu.org>
4425
4426         * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Set the
4427         version definition to basename of the output filename.
4428
4429 2001-05-17  H.J. Lu  <hjl@gnu.org>
4430
4431         * elflink.h (elf_link_add_object_symbols): Set DT_NEEDED to
4432         basename of the bfd filename.
4433
4434 2001-05-16  Alan Modra  <amodra@one.net.au>
4435
4436         * section.c (asection): Add linker_has_input field.
4437         (STD_SECTION): Adjust initialization to suit.
4438         * ecoff.c (bfd_debug_section): Likewise.
4439         * bfd-in2.h: Regenerate.
4440
4441 2001-05-15  Alexandre Oliva  <aoliva@redhat.com>
4442
4443         * elf-m10300.c (mn10300_elf_relax_section): Don't relax
4444         negative 32-bit operands to 16 operands when the operand is
4445         going to be zero-extended by the modified opcode.
4446
4447 2001-05-12  Peter Targett  <peter.targett@arccores.com>
4448
4449         * cpu-arc.c (arch_info_struct): Add entry 'base' representing old
4450         name for 'arc5' core versions.
4451         (bfd_arc_arch): Make bfd_mach_arc_6 default.
4452
4453         * elf32-arc.c (arc_elf_object_p): Make E_ARC_MACH_ARC6 default
4454         architecture.
4455         (arc_elf_final_write_processing): Make bfd_mach_arc_6 default.
4456
4457 2001-05-11  Jakub Jelinek  <jakub@redhat.com>
4458
4459         * elfxx-ia64.c (is_unwind_section_name): Consider linkonce unwind
4460         sections as well.
4461         (elfNN_ia64_final_write_processing): Map .gnu.linkonce.ia64unw.FOO
4462         to .gnu.linkonce.t.FOO text section.
4463
4464 2001-05-11  Jakub Jelinek  <jakub@redhat.com>
4465
4466         * merge.c (struct sec_merge_hash_entry): Add u.entsize and u.suffix
4467         fields, change sec into secinfo.
4468         (struct sec_merge_info): Add chain, remove last fields.
4469         (struct sec_merge_sec_info): Add next, sec, psecinfo fields.
4470         (sec_merge_hash_lookup): If lookup could not use a string only
4471         because it has bad alignment, mark the old string for deletion.
4472         (sec_merge_add): Add secinfo argument. Don't compute entry's
4473         position, instead record the section.
4474         (sec_merge_emit): Update for the sec into secinfo change in
4475         struct sec_merge_hash_entry.
4476         (_bfd_merge_section): Only record the section for merging, defer
4477         putting strings into the hash table.
4478         (cmplengthentry, last4_eq, last_eq, record_section, merge_strings,
4479         _bfd_merge_sections): New functions.
4480         (_bfd_merged_section_offset): Update for the sec_merge_hash_entry
4481         changes.
4482         * libbfd-in.h (_bfd_merge_sections): Add prototype.
4483         (_bfd_nolink_bfd_merge_sections): Define.
4484         * libbfd.h: Likewise.
4485         (bfd_generic_merge_sections): Add prototype.
4486         * targets.c (BFD_JUMP_TABLE_LINK): Add _bfd_merge_sections.
4487         (struct bfd_target): Likewise.
4488         * bfd.c (bfd_merge_sections): Define.
4489         * bfd-in2.h: Rebuilt.
4490         * elf.c (_bfd_elf_merge_sections): New function.
4491         * elf-bfd.h (_bfd_elf_merge_sections): Add prototype.
4492         * elfxx-target.h (bfd_elfNN_bfd_merge_sections): Define.
4493         * reloc.c (bfd_generic_merge_sections): New function.
4494         * vms.c (vms_bfd_merge_sections): New function.
4495         * aout-adobe.c (aout_32_bfd_merge_sections): Define.
4496         * aout-target.h (MY_bfd_merge_sections): Define.
4497         * aout-tic30.c (MY_bfd_merge_sections): Define.
4498         * binary.c (binary_bfd_merge_sections): Define.
4499         * bout.c (b_out_bfd_merge_sections): Define.
4500         * coff-alpha.c (_bfd_ecoff_bfd_merge_sections): Define.
4501         * coffcode.c (coff_bfd_merge_sections): Define.
4502         * coff-mips.c (_bfd_ecoff_bfd_merge_sections): Define.
4503         * i386msdos.c (msdos_bfd_merge_sections): Define.
4504         * i386os9k.c (os9k_bfd_merge_sections): Define.
4505         * ieee.c (ieee_bfd_merge_sections): Define.
4506         * ihex.c (ihex_bfd_merge_sections): Define.
4507         * nlm-target.h (nlm_bfd_merge_sections): Define.
4508         * oasys.c (oasys_bfd_merge_sections): Define.
4509         * ppcboot.c (ppcboot_bfd_merge_sections): Define.
4510         * som.c (som_bfd_merge_sections): Define.
4511         * srec.c (srec_bfd_merge_sections): Define.
4512         * tekhex.c (tekhex_bfd_merge_sections): Define.
4513         * versados.c (versados_bfd_merge_sections): Define.
4514         * xcoff-target.h (_bfd_xcoff_bfd_merge_sections): Define.
4515
4516 2001-05-11  Nick Clifton  <nickc@cambridge.redhat.com>
4517
4518         * dwarf1.c (_bfd_dwarf1_find_nearest_line): Change type of 'addr'
4519         to be unsigned long, in order to match its use.
4520
4521 2001-05-10  H.J. Lu  <hjl@gnu.org>
4522
4523         * linker.c (_bfd_generic_link_add_one_symbol): Check loop on
4524         indirect symbols.
4525
4526 2001-05-09  H.J. Lu  <hjl@gnu.org>
4527
4528         * elflink.h (elf_link_add_object_symbols): Fix a typo. Allocate
4529         versymhdr->sh_size bytes for extversym instead of hdr->sh_size.
4530         Remove the unused veriable `dynver'.
4531
4532 2001-05-08  Ian Lance Taylor  <ian@zembu.com>
4533
4534         * coff-i386.c (coff_i386_reloc): Don't dump core if output_bfd is
4535         NULL or is not COFF.
4536         (coff_i386_rtype_to_howto): Don't dump core if output section
4537         owner is not COFF.
4538
4539 2001-05-07  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
4540
4541         * ecoff.c (bfd_debug_section): Fix initialization.
4542         * elf.c (_bfd_elf_slurp_version_tables): Change maxidx to unsigned, it
4543         is always a positive integer. Cast away sign mismatch.
4544         * elf32-mips.c: Fix misleading comment and typo.
4545         (_bfd_mips_elf_section_from_bfd_section): Remove unused attribute, use
4546         correct data type.
4547         * elflink.c: Fix typo.
4548         (_bfd_elf_create_dynamic_sections): Remove superfluous initialization.
4549         * ecoffswap.h (ecoff_swap_fdr_in): Cast away sign mismatch.
4550
4551 2001-05-04  Richard Henderson  <rth@redhat.com>
4552
4553         * elf64-alpha.c (SREL16, SREL32, SREL64): Set pcrel_offset true.
4554
4555 2001-05-04  Nick Clifton  <nickc@cambridge.redhat.com>
4556
4557         * elf32-arm.h (elf32_arm_final_link_relocate): Set
4558         EF_ARM_HASENTRY if the start address is set.
4559
4560 2001-05-03  Nick Clifton  <nickc@cambridge.redhat.com>
4561
4562         * targets.c (_bfd_target_vector_entries): Compute value based on
4563         the size of the _bfd_target_vector and not bfd_target_vector.
4564
4565 2001-05-03  H.J. Lu  <hjl@gnu.org>
4566
4567         * elfcode.h: Include "libiberty.h".
4568
4569         * elflink.h (elf_link_add_object_symbols): Set
4570         elf_dt_name (abfd) to basename of the bfd filename.
4571         (NAME(bfd_elf,size_dynamic_sections)): Set vn_file to basename
4572         of the bfd filename.
4573
4574 2001-05-03  Andreas Jaeger  <aj@suse.de>
4575
4576         * elf64-gen.c (elf_generic_info_to_howto): Add unused attribute.
4577         (elf_generic_info_to_howto_rel): Likewise.
4578         * coff-alpha.c (reloc_nil): Likewise.
4579         (alpha_ecoff_bad_format_hook): Likewise.
4580         (alpha_adjust_reloc_out): Likewise.
4581         (alpha_bfd_reloc_type_lookup): Likewise.
4582         (alpha_convert_external_reloc): Likewise.
4583         * elf64-alpha.c (elf64_alpha_reloc_nil): Likewise.
4584         (elf64_alpha_reloc_bad): Likewise.
4585         (elf64_alpha_reloc_gpdisp): Likewise.
4586         (elf64_alpha_bfd_reloc_type_lookup): Likewise.
4587         (elf64_alpha_info_to_howto): Likewise.
4588         (elf64_alpha_add_symbol_hook): Likewise.
4589         (elf64_alpha_create_got_section): Likewise.
4590         (elf64_alpha_is_local_label_name): Likewise.
4591         (elf64_alpha_merge_ind_symbols): Likewise.
4592         * elf64-mips.c (mips_elf64_reloc_type_lookup): Likewise.
4593         (mips_elf64_get_reloc_upper_bound): Likewise.
4594         * nlm32-alpha.c (nlm_alpha_mangle_relocs): Likewise.
4595         (nlm_alpha_get_public_offset): Likewise.
4596
4597 2001-05-02  Johan Rydberg  <jrydberg@opencores.org>
4598
4599         * elf32-openrisc.c (openrisc_elf_howto_table): Do not complain
4600         about overflow in R_OPENRISC_LO_16_IN_INSN and
4601         R_OPENRISC_HI_16_IN_INSN.Index: bfd/elf32-openrisc.c
4602
4603 2001-04-30  H.J. Lu  <hjl@gnu.org>
4604
4605         * elf.c (_bfd_elf_link_hash_hide_symbol): Set dynindx to -1
4606         only for ELF_LINK_FORCED_LOCAL.
4607         * elf32-hppa.c (elf32_hppa_hide_symbol): Likewise.
4608         * elf32-mips.c (_bfd_mips_elf_hide_symbol): Likewise.
4609         * elfxx-ia64.c (elfNN_ia64_hash_hide_symbol): Likewise.
4610
4611         * elflink.h (elf_fix_symbol_flags): Set ELF_LINK_FORCED_LOCAL
4612         if the symbol has hidden or internal visibility.
4613
4614 2001-04-30  Alan Modra  <amodra@one.net.au>
4615
4616         * elf32-hppa.c (final_link_relocate): Branch to .+8 for
4617         calls to undefined weak symbols.
4618
4619 2001-04-30  Andreas Jaeger  <aj@suse.de>, Andreas Schwab <schwab@suse.de>
4620
4621         * elf64-x86-64.c (elf64_x86_64_relocate_section): Correct test for
4622         R_X86_64_GOTPCREL, don't use assignments instead of comparisons.
4623
4624 2001-04-27  Andreas Jaeger  <aj@suse.de>
4625
4626         * elf64-x86-64.c (elf64_x86_64_finish_dynamic_sections): Only swap
4627         out handled entries.
4628         (elf64_x86_64_finish_dynamic_symbol): Set up GOT entries.
4629         (elf64_x86_64_relocate_section): Fix GOTPCREL calculation.
4630         (elf64_x86_64_relocate_section): Merge entries for GOTPCREL and
4631         GOT32.
4632
4633 2001-04-27  Sean McNeil <sean@mcneil.com>
4634
4635         * config.bfd: Add arm-vxworks target.
4636         * coff-arm (coff_arm_relocate_section): Add in symbol value to
4637         addend (fro VXworks targets).
4638
4639 2001-04-26  H.J. Lu  <hjl@gnu.org>
4640
4641         * elf32-i386.c (elf_i386_check_relocs): Verify if r_symndx is
4642         valid.
4643
4644 2001-04-25  Frank Ch. Eigler  <fche@redhat.com>
4645
4646         * bfd-in.h (bfd_cache_close): Declare newly exported function.
4647         * bfd-in2.h: Regenerated.
4648
4649 2001-04-24  Jakub Jelinek  <jakub@redhat.com>
4650
4651         * merge.c (struct sec_merge_hash_entry): Add alignment field.
4652         (struct sec_merge_hash): Remove alignment_power.
4653         (sec_merge_hash_newfunc): Clear alignment.
4654         (sec_merge_hash_lookup): Pass alignment as argument.
4655         Use hashp->root.next, not hashp->next to walk the hash chain.
4656         If a string already in the hashtable does not have required
4657         alignment, create a new hashtable entry.
4658         (sec_merge_init): Remove alignment_power argument.
4659         (sec_merge_add): Add alignment argument.
4660         (sec_merge_emit): Alignment is now a per-entity thing, not per
4661         section.
4662         (_bfd_merge_section): Sanity check even non-SEC_STRINGS sections
4663         for proper alignment.
4664         Pass alignment information to sec_merge_add.
4665
4666 2001-04-24  Christian Groessler  <cpg@aladdin.de>
4667
4668         * coff-z8k.c (extra_case): added handler for R_DISP7, R_CALLR
4669         and R_REL16 reloc types; accept odd values for R_REL16 type
4670
4671 2001-04-24  Johan Rydberg  <jrydberg@opencores.org>
4672
4673         * cpu-openrisc.c: New file.
4674         * elf32-openrisc.c: Likewise.
4675
4676         * Makefile.am (ALL_MACHINES): Add cpu-openrisc.lo.
4677         (ALL_MACHINES_CFILES): Add cpu-openrisc.c.
4678         (BFD32_BACKENDS): Add elf32-openrisc.lo.
4679         (BFD32_BACKENDS_CFILES): Add elf32-openrisc.c.
4680         (cpu-openrisc.lo, elf32-openrisc.lo): New rules.
4681         * Makefile.in: Regenerated.
4682         * config.bfd: (openrisc-*-elf): New target.
4683         * configure.in (bfd_elf32_openrisc_vec): New vector.
4684         * configure: Regenerated.
4685         * libbfd.h: Regenerated.
4686         * bfd-in2.h: Regenerated.
4687         * reloc.c: Add OpenRISC relocations.
4688         * targets.c (bfd_elf32_openrisc_vec): Declare.
4689         (bfd_target_vect): Add bfd_elf32_openrisc_vec.
4690         * archures.c (enum bfd_architecture): Add bfd_arch_openrisc.
4691         (bfd_openrisc_arch): Declare.
4692         (bfd_archures_list): Add bfd_openrisc_arch.
4693         * elf.c (prep_headers): Add bfd_arch_openrisc.
4694
4695 2001-04-23  Bo Thorsen  <bo@suse.de>
4696
4697         * elf64-x86-64.c: Add c++ vtable hack.
4698         Small whitespace and comment changes.
4699
4700 2001-04-19  Andreas Jaeger  <aj@suse.de>
4701
4702         * elf64-x86-64.c (elf64_x86_64_plt0_entry): Fix instructions.
4703         (elf64_x86_64_plt_entry): Likewise.
4704         (elf64_x86_64_finish_dynamic_sections): Fix PLT0 generation.
4705         (elf64_x86_64_finish_dynamic_symbol): Fix PLT generation.
4706
4707 2001-04-17  Hans-Peter Nilsson  <hp@axis.com>
4708
4709         * elf32-cris.c: Tweak comments related to dynamic linking.
4710         (cris_elf_relocate_section): When not creating shared object, fill
4711         in the .got table for any symbol not in the dynamic symbol table.
4712         (elf_cris_finish_dynamic_symbol): When not creating shared object,
4713         only emit a .got.rela reloc if the symbol is in the dynamic symbol
4714         table.
4715         (cris_elf_check_relocs): Use variable r_type in all places rather
4716         than the original expression.  Add default case in switch for
4717         reloc types.
4718         (elf_cris_size_dynamic_sections): Iterate over
4719         elf_cris_discard_excess_program_dynamics when not creating shared
4720         library.
4721         (elf_cris_discard_excess_dso_dynamics): Renamed from
4722         elf_cris_discard_copies.  Correct typo, s/Rel/Rela/.
4723         (elf_cris_discard_excess_program_dynamics): New.
4724
4725 2001-04-14  Mark Elbrecht  <snowball3@bigfoot.com>
4726
4727         * coffcode.h (coff_write_object_contents): Use
4728         bfd_coff_swap_filehdr_out instead of coff_swap_filehdr_out.
4729
4730 2001-04-14  H.J. Lu  <hjl@gnu.org>
4731
4732         * bfd-in2.h: Regenerate.
4733
4734 2001-04-14  Jakub Jelinek <jakub@redhat.com>
4735
4736         * section.c (STD_SECTION): Add entsize.
4737
4738 2001-04-13  H.J. Lu  <hjl@gnu.org>
4739
4740         * section.c (SEC_MERGE): Define new flag for merging.
4741         (SEC_STRINGS): Likewise.
4742         (entsize): New field.
4743
4744 2001-04-13  Roger Sayle  <roger@metaphorics.com>
4745
4746         * coff-i386.c (TARGET_SYM): SEC_READONLY is an applicable section
4747         flag on pe-i386 targets.
4748
4749 2001-04-13  Jakub Jelinek  <jakub@redhat.com>
4750
4751         * libbfd-in.h (_bfd_merge_section): New.
4752         (_bfd_write_merged_section): New.
4753         (_bfd_merged_section_offset): New.
4754         * libbfd.h: Rebuilt.
4755         * linker.c (_bfd_generic_link_output_symbols): Handle
4756         discard_sec_merge.
4757         * aoutx.h (aout_link_write_symbols): Likewise.
4758         * pdp11.c (aout_link_write_symbols): Likewise.
4759         * elflink.h (elf_link_add_object_symbols): Call _bfd_merge_section.
4760         (elf_bfd_final_link): Adjust global symbols pointing into SEC_MERGE
4761         sections.
4762         (elf_link_sec_merge_syms): New.
4763         (elf_link_input_bfd): Call _bfd_merged_section_offset
4764         and _bfd_write_merged_section.
4765         Handle discard_sec_merge.
4766         * elf-bfd.h (struct elf_link_hash_table): Add merge_info
4767         field.
4768         (struct bfd_elf_section_data): Likewise.
4769         * elf.c (_bfd_elf_make_section_from_shdr): Set SEC_MERGE and
4770         SEC_STRINGS section flags and entsize from their ELF counterparts.
4771         (_bfd_elf_link_hash_table_init): Initialize merge_info.
4772         (elf_fake_sections): Set SHF_MERGE, SHF_STRINGS and sh_entsize
4773         from their BFD counterparts.
4774         * merge.c: New file.
4775         * Makefile.am: Add strtab.lo.
4776         * Makefile.in: Rebuilt.
4777
4778 2001-04-09  Hans-Peter Nilsson  <hp@axis.com>
4779
4780         * elflink.h (elf_fix_symbol_flags): For non-default visibilities,
4781         only hide symbols marked STV_INTERNAL or STV_HIDDEN.
4782
4783 2001-04-05  Steven J. Hill  <sjhill@cotw.com>
4784
4785         * config.bfd (mips*el*-*-linux-gnu*): Use traditional little
4786         endian MIPS ELF target.
4787         * config.bfd (mips*-*-linux-gnu*): Use traditional big endian
4788         MIPS ELF target.
4789
4790         * configure.in (bfd_elf64_tradbigmips_vec): New. Traditional
4791         64bit big endian MIPS ELF target.
4792         (bfd_elf64_tradlittlemips_vec): New. Traditional 64bit little
4793         endian MIPS ELF target.
4794         * configure: Regenerated.
4795
4796         * elf32-mips.c (IRIX_COMPAT): Handle traditional 64bit and
4797         little endian targets.
4798         (mips_elf_sym_is_global): Handle traditional targets.
4799
4800         * elf64-mips.c (bfd_elf64_tradbigmips_vec): New. Traditional
4801         64bit big endian MIPS ELF target.
4802         (bfd_elf64_tradlittlemips_vec): New. Traditional 64bit little
4803         endian MIPS ELF target.
4804
4805         * targets.c: (_bfd_target_vector): Add bfd_elf64_tradbigmips_vec
4806         and bfd_elf64_tradlittlemips_vec.
4807
4808 2001-04-05  David Mosberger  <davidm@hpl.hp.com>
4809
4810         * elf32-i386.c (elf_i386_fake_sections): Treat ".reloc" as an
4811         ordinary "progbits" section.
4812
4813 2001-04-04  Alan Modra  <alan@linuxcare.com.au>
4814
4815         * elflink.h (elf_fix_symbol_flags): Call elf_backend_hide_symbol
4816         when -Bsymbolic causes a symbol to no longer need a .plt entry.
4817
4818 2001-04-03  David Mosberger  <davidm@hpl.hp.com>
4819
4820         * efi-app-ia32.c (ALIGN_SECTIONS_IN_FILE): Deleted.
4821
4822 2001-03-30  H.J. Lu  <hjl@gnu.org>
4823
4824         * efi-app-ia32.c (PEI_TARGET_SUBSYSTEM): Rename from ...
4825         (PEI_DEFAULT_TARGET_SUBSYSTEM): This.
4826
4827 2001-03-26  H.J. Lu  <hjl@gnu.org>
4828
4829         * elf32-gen.c (elf32_generic_link_add_symbols): New. Check
4830         if there are any relocations for generic ELF.
4831         (bfd_elf32_bfd_link_add_symbols): Defined to
4832         elf32_generic_link_add_symbols.
4833         * elf64-gen.c (elf64_generic_link_add_symbols): New. Check
4834         if there are any relocations for generic ELF.
4835         (bfd_elf64_bfd_link_add_symbols): Defined to
4836         elf64_generic_link_add_symbols.
4837
4838 2001-03-23  Nick Clifton  <nickc@redhat.com>
4839
4840         * Makefile.am (BUILD_CFILES): New variable: List of C source
4841         files created in build directory.
4842         (BUILD_HFILES): New variable: List of header files created in
4843         build directory.
4844         (POTFILES): Delete.
4845         (po/POTFILES.in): Replace rule with empty entry.
4846         (po/SRC-POTFILES.in): New rule: Create a list of source files
4847         in the source directory.
4848         (po/BLD-POTFILES.in): New rule: Create a list of source files
4849         in the build directory.
4850         (MOSTLYCLEAN): Do not delete source files created in build
4851         directory.
4852         * Makefile.in: Regenerate.
4853         * configure.in: Insert SRC-POTFILES.in and BLD-POTFILES.in
4854         into po/Makefile.
4855         * configure: Regenerate.
4856
4857         * po/Make-in: Replace occurrences of POTFILES with SRC-POTFILES
4858         and BLD_POTFILES.
4859         Add .. to the search path when building bfd.pot.
4860         Delete POTFILES when performing distclean.
4861         Add comment describing why distclean is broken in maintainer mode.
4862         * po/POTFILES.in: Delete.
4863         * po/SRC-POTFILES.in: New file.
4864         * po/BLD-POTFILES.in: New file.
4865         * po/bfd.pot: Regenerate.
4866
4867 2001-03-22  Hans-Peter Nilsson  <hp@axis.com>
4868
4869         * elf32-cris.c: Shlib and PIC support.  PCREL tweaks.
4870         (elf_cris_discard_copies, elf_cris_adjust_gotplt_to_got,
4871         elf_cris_try_fold_plt_to_got, elf_cris_link_hash_newfunc,
4872         elf_cris_link_hash_table_create, elf_cris_adjust_dynamic_symbol,
4873         elf_cris_size_dynamic_sections, elf_cris_finish_dynamic_symbol,
4874         elf_cris_finish_dynamic_sections,elf_cris_hide_symbol): New
4875         functions.
4876         (cris_elf_howto_table) <R_CRIS_8_PCREL, R_CRIS_16_PCREL,
4877         R_CRIS_32_PCREL>: Correct comments.  Set pcrel_offset to false.
4878         <R_CRIS_COPY, R_CRIS_GLOB_DAT, R_CRIS_JUMP_SLOT, R_CRIS_RELATIVE,
4879         R_CRIS_16_GOT, R_CRIS_32_GOT, R_CRIS_16_GOTPLT, R_CRIS_32_GOTPLT,
4880         R_CRIS_32_GOTREL, R_CRIS_32_PLT_GOTREL, R_CRIS_32_PLT_PCREL>:
4881         New HOWTO members for new relocs.
4882         (cris_reloc_map): Map new relocs.
4883         (ELF_DYNAMIC_INTERPRETER): Define.
4884         (PLT_ENTRY_SIZE): Define.
4885         (elf_cris_plt0_entry, elf_cris_plt_entry, elf_cris_pic_plt0_entry,
4886         elf_cris_pic_plt_entry): New, PLT templates.
4887         (struct elf_cris_pcrel_relocs_copied, struct
4888         elf_cris_link_hash_entry, struct elf_cris_link_hash_table): New.
4889         (elf_cris_link_hash_traverse, elf_cris_hash_table): Define.
4890         (cris_final_link_relocate): Check that 16-bit GOT relocs have
4891         positive values.  Adjust PCREL relocs to be relative to location
4892         after relocation.
4893         (cris_elf_relocate_section): Handle relocations to dynamic
4894         objects.  Handle new relocations.  Call error handler when seeing
4895         non-PIC relocation for read-only sections while generating shared
4896         object.
4897         (cris_elf_check_relocs): Set reference counts for GOT and PLT
4898         entries.
4899         (bfd_elf32_bfd_link_hash_table_create,
4900         elf_backend_adjust_dynamic_symbol,
4901         elf_backend_size_dynamic_sections,
4902         elf_backend_finish_dynamic_symbol,
4903         elf_backend_finish_dynamic_sections,
4904         elf_backend_create_dynamic_sections, bfd_elf32_bfd_final_link,
4905         elf_backend_hide_symbol, elf_backend_want_got_plt,
4906         elf_backend_plt_readonly, elf_backend_want_plt_sym,
4907         elf_backend_got_header_size, elf_backend_plt_header_size):
4908         Define.
4909
4910         * reloc.c: (BFD_RELOC_CRIS_COPY, BFD_RELOC_CRIS_GLOB_DAT,
4911         BFD_RELOC_CRIS_JUMP_SLOT, BFD_RELOC_CRIS_RELATIVE,
4912         BFD_RELOC_CRIS_32_GOT, BFD_RELOC_CRIS_16_GOT,
4913         BFD_RELOC_CRIS_32_GOTPLT, BFD_RELOC_CRIS_16_GOTPLT,
4914         BFD_RELOC_CRIS_32_GOTREL, BFD_RELOC_CRIS_32_PLT_GOTREL,
4915         BFD_RELOC_CRIS_32_PLT_PCREL): New relocs.
4916         * bfd-in2.h, libbfd.h: Regenerate.
4917
4918 2001-03-21  Diego Novillo  <dnovillo@redhat.com>
4919
4920         (_bfd_mips_elf_relocate_section): Give a better error message when
4921         a relocation is not recognized.
4922
4923 2001-03-21  Alan Modra  <alan@linuxcare.com.au>
4924
4925         * elf32-hppa.c (elf32_hppa_set_gp): Check sec->output_section
4926         non-NULL before attempting to dereference.
4927
4928 2001-03-20  H.J. Lu  <hjl@gnu.org>
4929
4930         * configure.in: Remove the redundent AC_ARG_PROGRAM.
4931         * configure: Rebuild.
4932
4933 2001-03-20  Andreas Schwab  <schwab@suse.de>
4934
4935         * elf32-m68k.c (elf_m68k_relocate_section): Don't need the
4936         relocation value when resolving a reference from a debugging
4937         section.
4938
4939 2001-03-16  Scott Thomason  <SThomaso@hii.com>
4940
4941         * coff64-rs6000.c (xcoff64_swap_sym_out): Fix syntax errors.
4942         (xcoff64_swap_sym_out): Fix syntax errors.
4943
4944 2001-03-16  Richard Sandiford  <rsandifo@redhat.com>
4945
4946         * elf32-arm.h (elf32_arm_merge_private_bfd_data): Fix warning.
4947
4948 2001-03-15  Alan Modra  <alan@linuxcare.com.au>
4949
4950         * elf32-hppa.c (elf32_hppa_link_hash_entry): Add maybe_pic_call.
4951         (hppa_link_hash_newfunc): Init it.
4952         (hppa_type_of_stub): Only use non-PIC to PIC call stub if caller
4953         section appears to be non-PIC.
4954         (final_link_relocate): Likewise.
4955         (elf32_hppa_adjust_dynamic_symbol): Set maybe_pic_call for any
4956         possible candidate function, and set pic_call for those that will
4957         only have a .plt entry for the PIC call stub.
4958         (hppa_handle_PIC_calls): Set maybe_pic_call.
4959
4960 2001-03-12  DJ Delorie  <dj@redhat.com>
4961
4962         * elf32-sh.c (sh_elf_relocate_section): Only relocation
4963         R_SH_DIR8WP* relocs if they're against external symbols, else
4964         they're just for relaxing.  Validate the reloc values.
4965
4966 2001-03-12  Stefan Geuken <mail@stefan-geuken.de>
4967
4968         * binary.c (bfd_external_binary_architecture): Declare.
4969         (binary_object_p): If bfd_external_binary_architecture is defined,
4970         set the architecture to this string.
4971
4972 2001-03-11  Philip Blundell  <philb@gnu.org>
4973
4974         * elf32-arm.h (elf32_arm_finish_dynamic_symbol): Don't make PLT
4975         entries that could serve as a definition for a weak symbol.
4976
4977 2001-03-08  Nick Clifton  <nickc@redhat.com>
4978
4979         * Most files: Update copyright notices using Perl script created
4980         by Kevin Buettner <kevinb@redhat.com>.
4981
4982 2001-03-07  Nick Clifton  <nickc@redhat.com>
4983
4984         * elf32-arm.h (elf32_arm_final_link_relocate): Conditionalise
4985         prior patch on ! defined OLD_ARM_ABI.
4986
4987 2001-03-07  Andreas Jaeger  <aj@suse.de>
4988
4989         * elf64-x86-64.c (elf64_x86_64_relocate_section): Fix handling of
4990         some relocation values.
4991
4992 2001-03-06  Nick Clifton  <nickc@redhat.com>
4993
4994         * elf32-arm.h (elf32_arm_final_link_relocate): Clear bit zero
4995         of offset in BLX(1) instruction.
4996         * coff-arm.c (coff_arm_relocate_section): Clear bit zero of
4997         offset in BLX(1) instruction.
4998         Fix formatting.
4999
5000 2001-03-06  Nick Clifton  <nickc@redhat.com>
5001
5002         * coff-arm.c (coff_arm_reloc_type_lookup): Add
5003         BFD_RELOC_THUMB_PCREL_BLX.
5004
5005 2001-03-06  Igor Shevlyakov  <igor@windriver.com>
5006
5007         * archures.c (bfd_default_scan): Add Coldfire CPUs.
5008         * bfd-in2.h: Regenerate.
5009         * cpu-m68k.c: Add Coldfire CPUs for arch table.
5010         * ieee.c (ieee_write_processor): Set proper id for
5011         Coldfire CPUs.
5012
5013 2001-03-01  D.J. Barrow <djbarrow@de.ibm.com,barrow_dj@yahoo.com>
5014
5015         * configure.in: Add s390 target.
5016         * configure: Regenerate.
5017
5018 2001-02-28  Andreas Jaeger  <aj@suse.de>
5019
5020         * elf64-x86-64.c (elf64_x86_64_relocate_section): Add relocation
5021         to addend.
5022
5023 2001-02-28  Philip Blundell  <pb@futuretv.com>
5024
5025         * elf32-arm.h: Update mentions of renamed EF_xx constants.
5026         (elf32_arm_print_private_bfd_data): Handle ARM EABI version 2.
5027
5028 2001-02-27  H.J. Lu  <hjl@gnu.org>
5029
5030         * aoutx.h (NAME(aout,bfd_free_cached_info)): Return true if
5031         abfd->tdata.aout_data == NULL.
5032
5033 2001-02-27  Alan Modra  <alan@linuxcare.com.au>
5034
5035         * elf32-hppa.c: Correct field selector in stub comments.
5036         (clobber_millicode_symbols): Formatting fix.
5037
5038         * configure.in: Bump version to 2.11.90.
5039         * configure: Regenerate.
5040         * Makefile.am (CFILES): Rename to SOURCE_CFILES.
5041         (CFILES): $SOURCE_CFILES + generated C files.
5042         (POTFILES): Include $HFILES not $SOURCE_HFILES.
5043         Run "make dep-am"
5044         * Makefile.in: Regenerate.
5045         * doc/Makefile.in: This too.
5046
5047 2001-02-26  Timothy Wall  <twall@cygnus.com>
5048
5049         * elfxx-ia64.c (elfNN_ia64_aix_add_symbol_hook): Remove obsolete
5050         comments.
5051
5052 2001-02-26  Nick Clifton <nickc@redhat.com>
5053
5054         * coffcode.h (styp_to_sec_flags) [COFF_WITH_PE version]: Tidy
5055         up, replacing multiple if statements with a switch.
5056         (handle_COMDAT): New function.
5057
5058 2001-02-26  H.J. Lu  <hjl@gnu.org>
5059
5060         * coffcode.h (styp_to_sec_flags) [COFF_WITH_PE version]: Issue
5061         a warning for section flags we do not handle instead of
5062         aborting.
5063
5064 2001-02-26  Andreas Jaeger  <aj@suse.de>
5065
5066         * elf64-x86-64.c (x86_64_elf_howto_table): Fix order of entries.
5067
5068 2001-02-22  Timothy Wall  <twall@cygnus.com>
5069
5070         * config.bfd (targ_cpu): Add vectors for ia64-*-aix* (aka Monterey).
5071         * configure.in: Add objects for elf64_ia64_aix vectors.
5072         * configure: Regenerated.
5073         * configure.host: Recognize ia64-*-aix*.
5074         * elfxx-ia64.c: Add hooks for ELF64 on AIX5.  Define new vectors
5075         for AIX.  AIX5 requires most relocations to be dynamic (*all*
5076         binaries are somewhat similar to shared libraries).
5077         * targets.c: Add elf64_ia64_aix vectors.
5078
5079 2001-02-21  David Mosberger  <davidm@hpl.hp.com>
5080
5081         * cpu-ia64-opc.c (elf64_ia64_operands}: Fix typo: error string for
5082         C8 said "1" instead of "8".  Clarify error string for IMM22:
5083         "signed integer" instead of just "integer".
5084
5085 2001-02-20  Andreas Jaeger  <aj@suse.de>
5086
5087         * elf64-x86-64.c (elf64_x86_64_finish_dynamic_symbol): Don't make
5088         PLT entries that could serve as a definition for a weak symbol.
5089
5090 2001-02-19  Jakub Jelinek  <jakub@redhat.com>
5091
5092         * elf32-sparc.c (elf32_sparc_finish_dynamic_symbol): Don't make PLT
5093         entries that could serve as a definition for a weak symbol.
5094         * elf64-sparc.c (sparc64_elf_finish_dynamic_symbol): Likewise.
5095
5096 2001-02-18  David O'Brien  <obrien@FreeBSD>
5097
5098         * configure.in: Recognize FreeBSD/arm, FreeBSD/PowerPC, and treat
5099         FreeBSD/i386-CURRENT differently until I can figure out the needed
5100         corefile changes.
5101         * configure: Regenerate.
5102         * config.bfd: Recognize FreeBSD/x86-64, FreeBSD/ia64, FreeBSD/arm,
5103         FreeBSD/PowerPC, and FreeBSD/sparc64.
5104
5105 2001-02-18  lars brinkhoff  <lars@nocrew.org>
5106
5107         * Makefile.am: Add PDP-11 a.out target.
5108         * config.bfd: Likewise.
5109         * configure.in: Likewise.
5110         * targets.c: Likewise.
5111         * archures.c: Likewise.
5112         * bfd-in2.h: Likewise.  Add PDP-11 relocations.
5113         * libbfd.h: Add PDP-11 relocations.
5114         * reloc.c: Likewise.
5115         * cpu-pdp11.c: New file.
5116         * pdp11.c: New file.
5117
5118         * libaout.h (GET_WORD) [ARCH_SIZE==16]: Define.
5119         (GET_SWORD) [ARCH_SIZE==16]: Likewise.
5120         (GET_SWORD) [ARCH_SIZE==16]: Likewise.
5121         (PUT_WORD) [ARCH_SIZE==16]: Likewise.
5122         (GET_MAGIC): New macro.
5123         (PUT_MAGIC): Likewise.
5124         * aout-target.h (MY(object_p)): Use GET_MAGIC to read magic word.
5125
5126 2001-02-18  Jim Kingdon  <jkingdon@engr.sgi.com>
5127
5128         * irix-core.c (irix_core_core_file_p): Set the architecture (GDB
5129         multiarch needs it).
5130
5131 2001-02-18  H.J. Lu  <hjl@gnu.org>
5132
5133         * elflink.h (elf_link_input_bfd): Ignore invalid section symbol
5134         index.
5135
5136 2001-02-18  Kazu Hirata  <kazu@hxi.com>
5137
5138         * vms-misc.c: Fix formatting.
5139
5140 2001-02-16  Kazu Hirata  <kazu@hxi.com>
5141
5142         * vms.c: Fix formatting.
5143
5144 2001-02-14  H.J. Lu  <hjl@gnu.org>
5145
5146         * elf.c (elf_find_function): New function.
5147         (_bfd_elf_find_nearest_line): Call elf_find_function () to find
5148         the file name and function name.
5149
5150 2001-02-14  Nick Clifton  <nickc@redhat.com>
5151
5152         * ecoff.c (bfd_debug_section): Update to initialise new fields in
5153         asection structure.
5154
5155         * Makefile.am (BFD32_BACKENDS_CFILES): Remove peigen.c
5156         (BFD64_BACKENDS): Add pepigen.c
5157         Add rules to create peigen.c and pepigen.c from peXXigen.c.
5158
5159         * Makefile.in: Regenerate.
5160         * configure:  Regenerate.
5161         * po/POTFILES.in: Regenerate.
5162         * po/bfd.pot: Regenerate.
5163
5164 2001-02-14  H.J. Lu  <hjl@gnu.org>
5165
5166         * libcoff-in.h (pe_tdata): Add members target_subsystem and
5167         force_minimum_alignment.
5168
5169 2001-02-14  Bo Thorsen  <bo@suse.de>
5170
5171         * elf64-x86-64.c: Small formatting fixes and rearrangements of code.
5172         (elf64_86_64_size_info): Struct added to fix a problem
5173         with the hashtable string entries.
5174         (elf64_x86_64_adjust_dynamic_symbol): Add generation of .got.plt.
5175         (elf64_x86_64_size_dynamic_sections): A FIXME removed.
5176         (elf64_x86_64_size_dynamic_sections): Fix a dynamic entry and
5177         remove the FIXME for this.
5178         (elf64_x86_64_adjust_dynamic_symbol): Fix check for unneeded .plt
5179         section. Also removed the FIXME for it.
5180         (x86_64_elf_howto_table): Use bfd_elf_generic_reloc.
5181         (ELF_DYNAMIC_INTERPRETER): Fix the name of the dynamic linker.
5182         (elf64_x86_64_finish_dynamic_sections): Enable .got.plt writing.
5183
5184 2001-02-13  Richard Henderson  <rth@redhat.com>
5185
5186         * elfxx-ia64.c (elfNN_ia64_final_link): Set __gp if required
5187         and not user provided.
5188
5189 2001-02-13  Kazu Hirata  <kazu@hxi.com>
5190
5191         * vms.c (vms_print_symbol): Remove unreachable code.
5192
5193         * rs6000-core.c: Fix formatting.
5194
5195 2001-02-13  David Mosberger  <davidm@hpl.hp.com>
5196
5197         * peicode.h (coff_swap_filehdr_out) [COFF_IMAGE_WITH_PE]: Define
5198         as _bfd_XXi_only_swap_filehdr_out.
5199         (pe_mkobject) [PEI_FORCE_MINIMUM_ALIGNMENT]: Set
5200         pe->force_minimum_alignment to TRUE.
5201         (pe_mkobject) [PEI_TARGET_SUBSYSTEM]: Set pe->target_subsystem to
5202         PEI_TARGET_SUBSYSTEM.
5203         (pe_print_private_bfd_data): Call
5204         _bfd_XX_print_private_bfd_data_common() instead of
5205         _bfd_pe_print_private_bfd_data_common().
5206         (pe_bfd_copy_private_bfd_data): Call
5207         _bfd_XX_bfd_copy_private_bfd_data_common() instead of
5208         _bfd_pe_bfd_copy_private_bfd_data_common().
5209         (coff_bfd_copy_private_section_data): Define as
5210         _bfd_XX_bfd_copy_private_section_data instead of
5211         _bfd_pe_bfd_copy_private_section_data.
5212         (coff_get_symbol_info): Define as _bfd_XX_get_symbol_info instead
5213         of a _bfd_pe_get_symbol_info.
5214
5215         * peigen.c: Delete.
5216
5217         * peXXigen.c: Renamed from peigen.c.
5218         (COFF_WITH_XX): Define this macro (will get expanded into
5219         COFF_WITH_pep or COFF_WITH_pe, depending on whether this is being
5220         compiled as peigen.c or pepigen.c.
5221         [COFF_WITH_pep]: Include "coff/ia64.h" instead of "coff/i386.h" to
5222         define the canonical PEP structures and definitions.
5223         (_bfd_XXi_swap_aouthdr_out): If pe->force_minimum_alignment is in
5224         effect, enforce minimum file and section alignments.  If
5225         extra->Subsystem is IMAGE_SUBSYSTEM_UNKNOWN, set it to
5226         pe->target_subsystem (this defaults to IMAGE_SUBSYSTEM_UNKNOWN,
5227         so, by default, this is a no-op).
5228
5229         * libpei.h: Rename COFF_WITH_PEP to COFF_WITH_pep.
5230         (_bfd_XX_bfd_copy_private_bfd_data_common): Add macros to map
5231         _bfd_XXfoo to _bfd_pepfoo if COFF_WIT_PEP is defined and to
5232         _bfd_pefoo if it's not defined.  Use these macros to define
5233         coff swap macros.
5234
5235         * libcoff.h (pe_tdata): Add members target_subsystem and
5236         force_minimum_alignment.
5237
5238         * efi-app-ia64.c (COFF_WITH_pep): Rename COFF_WITH_PEP to
5239         COFF_WITH_pep.
5240         (PEI_TARGET_SUBSYSTEM): Rename from PEI_DEFAULT_TARGET_SUBSYSTEM.
5241
5242         * configure.in (bfd_efi_app_ia64_vec): Use pepigen.lo instead of
5243         peigen.lo.
5244
5245         * coff-ia64.c: Rename COFF_WITH_PEP to COFF_WITH_pep.
5246         (AOUTSZ): Rename PEP64AOUTSZ and PEP64AOUTHDR to PEPAOUTSZ and
5247         PEPAOUTHDR.
5248
5249         * Makefile.in (BFD64_BACKENDS): Mention pepigen.lo.
5250         (BFD64_BACKENDS_CFILES): Mention pepigen.c
5251         (peigen.c): Add rule to generate from peXXigen.c.
5252         (pepigen.c): Ditto.
5253         (pepigen.lo): List dependencies for pepigen.lo.
5254
5255 2001-02-13  Alan Modra  <alan@linuxcare.com.au>
5256
5257         * elf32-hppa.c (elf32_hppa_set_gp): Handle weak $global$.  If
5258         $global$ referenced but not defined, set its value here.
5259
5260 2001-02-09  Bo Thorsen  <bo@suse.de>
5261
5262         * elf64-x86-64.c (elf64_x86_64_check_relocs): Set .rela.got section
5263         alignment to 3.
5264         (elf64_x86_64_check_relocs): Write R_X86_64_GOTPCREL GOT entry
5265         and relocation.
5266         (elf64_x86_64_relocate_section): Fix formatting.
5267         (elf64_x86_64_relocate_section): Fix addend for relocation of
5268         R_X86_64_(8|16|32|PC8|PC16|PC32).
5269
5270 2001-02-12  Jan Hubicka  <jh@suse.cz>
5271
5272         * elf64-x86-64.c (x86_64_elf_howto): Fix name of R_X86_64_GOTPCREL.
5273
5274 2001-02-11  H.J. Lu  <hjl@gnu.org>
5275
5276         * elflink.h (elf_bfd_final_link): Use file_align for SYMTAB
5277         alignment.
5278
5279 2001-02-11  Maciej W. Rozycki  <macro@ds2.pg.gda.pl>
5280
5281         * elf32-mips.c (mips_elf_create_dynamic_relocation): Undo patch
5282         from 2000-10-13.  Do not add the symbol's value for R_MIPS_REL32
5283         relocations against dynsym symbols.
5284
5285         * elf32-mips.c (elf_mips_howto_table): Fix the comment on
5286         the R_MIPS_26 relocation.
5287         (mips_elf_calculate_relocation): Use (p + 4) instead of p for
5288         the R_MIPS_26 relocation.
5289         (mips_elf_perform_relocation): Fix the comment on the R_MIPS16_26
5290         relocation.
5291         * elf64-mips.c (mips_elf64_howto_table_rel): Fix the comment on
5292         the R_MIPS_26 relocation.
5293         (mips_elf64_howto_table_rela): Likewise.
5294
5295         * elf32-mips.c (struct mips_elf_link_hash_entry): Added no_fn_stub
5296         member to mark symbols that have non-CALL relocations against
5297         them.
5298         (mips_elf_link_hash_newfunc): Initialize no_fn_stub.
5299         (mips_elf_calculate_relocation): Handle R_MIPS_CALL16 like
5300         R_MIPS_GOT16.
5301         (_bfd_mips_elf_check_relocs): Set no_fn_stub for a symbol if a
5302         non-CALL relocation against it is encountered.
5303         (_bfd_mips_elf_copy_indirect_symbol): Merge no_fn_stub as well.
5304         (_bfd_mips_elf_adjust_dynamic_symbol): Only create a stub if
5305         no_fn_stub is not set.
5306
5307         * elf32-mips.c (mips_elf_output_extsym): Get the output section
5308         information from the real symbol for indirect ones.
5309         Check no_fn_stub to find out if a symbol has a function stub
5310         indeed.
5311
5312 2001-02-11  Michael Sokolov  <msokolov@ivan.Harhan.ORG>
5313
5314         * Makefile.am (stamp-lib): ranlib the libbfd.a in the build directory.
5315         * Makefile.in: Regenerate.
5316
5317 2001-02-09  David Mosberger  <davidm@hpl.hp.com>
5318
5319         * elfxx-ia64.c (is_unwind_section_name): New function.  Returns
5320         true if section name is an unwind table section name.
5321         (elfNN_ia64_additional_program_headers): Count each unwind section
5322         separately.
5323         (elfNN_ia64_modify_segment_map): Install one unwind program header
5324         for each unwind separate section.  Note: normally the linker
5325         script merges the unwind sections that go into a single segment,
5326         so this still generates at most one unwind program header per
5327         segment.
5328
5329         * elfxx-ia64.c (elfNN_ia64_section_from_shdr): Accept any section
5330         name for SHT_IA_64_UNWIND, not just .IA_64.unwind.
5331         (elfNN_ia64_fake_sections): Mark sections with names that start
5332         with .IA_64.unwind but not with .IA_64.unwind_info as an IA-64
5333         unwind section.
5334
5335         * elfxx-ia64.c (elfNN_ia64_final_write_processing): New function.
5336         Use it to make sh_info in unwind section point to the text section
5337         it applies to.
5338
5339 2001-02-09  Martin Schwidefsky  <schwidefsky@de.ibm.com>
5340
5341         * Makefile.am: Add linux target for S/390.
5342         * archures.c: Likewise.
5343         * bfd-in2.h: Likewise.
5344         * config.bfd: Likewise.
5345         * configure.in: Likewise.
5346         * elf.c: Likewise.
5347         * libbfd.h: Likewise.
5348         * targets.c: Likewise.
5349         * cpu-s390.c: New file.
5350         * elf32-s390.c: New file.
5351         * elf64-s390.c: New file.
5352
5353 2001-02-09  Nick Clifton  <nickc@redhat.com>
5354
5355         * peigen.c (_bfd_pe_get_symbol_info): Suppress addition of
5356         ImageBase.  This has already been done by coff_swap_hdr_in.
5357
5358 2001-02-09  Jakub Jelinek  <jakub@redhat.com>
5359
5360         * elf64-sparc.c (sparc64_elf_copy_private_bfd_data): New function.
5361
5362 2001-02-09  Jakub Jelinek  <jakub@redhat.com>
5363
5364         * elf64-sparc.c (sparc64_elf_check_relocs): Don't trust reloc_count.
5365         (sparc64_elf_relocate_section): Likewise.
5366
5367 2001-02-09  Mark Kettenis  <kettenis@gnu.org>
5368
5369         * elf32-sparc.c (_bfd_sparc_elf_howto_table): Treat R_SPARC_UA32
5370         similar to R_SPARC_32.
5371         * elf64-sparc.c (sparc64_elf_howto_table): Likewise.
5372
5373 2001-02-08  H.J. Lu  <hjl@gnu.org>
5374
5375         * elf32-i386.c (elf_i386_check_relocs): Reserve R_386_PC32
5376         relocation entries for weak definitions when building DSO with
5377         -Bsymbolic.
5378
5379 2001-02-08  Richard Henderson  <rth@redhat.com>
5380
5381         * elf64-alpha.c (alpha_elf_dynamic_symbol_p): Respect weakness
5382         before visibility.  Locally defined protected symbols are not
5383         dynamic.
5384
5385 2001-02-08  Geoffrey Keating  <geoffk@redhat.com>
5386
5387         * config.bfd: Enable coff64 for rs6000-*.  Patch from
5388         <hzoli@austin.ibm.com>.
5389
5390 2001-02-07  Mark Elbrecht  <snowball3@bigfoot.com>
5391
5392         * coffgen.c (coff_find_nearest_line): If stabs info is successfully
5393         found, do not attempt to find dwarf2 info before returning.
5394
5395 2001-02-07  Jakub Jelinek  <jakub@redhat.com>
5396
5397         * elflink.h (is_global_symbol_definition): Rename to
5398         is_global_data_symbol_definition and have it reject function
5399         symbols.
5400         (elf_link_is_defined_archive_symbol): Use renamed function.
5401
5402 2001-02-07  Todd Vierling  <tv@wasabisystems.com>
5403
5404         * libbfd-in.h (bfd_target_vector): Change extern array to pointer.
5405         * libbfd.h (bfd_target_vector): Likewise.
5406         * targets.c (bfd_target_vector): Rename to _bfd_target_vector and
5407         make static; create pointer reference named bfd_target_vector.
5408         (_bfd_target_vector_entries): Calculate this based on the array
5409         typed _bfd_target_vector.
5410
5411 2001-02-06  H.J. Lu  <hjl@gnu.org>
5412
5413         * elfxx-ia64.c (elfNN_ia64_dynamic_symbol_p): Only hidden and
5414         internal symbols are not dynamic.
5415         * elf64-alpha.c (alpha_elf_dynamic_symbol_p): Likewise.
5416
5417 2001-02-06  Nick Clifton  <nickc@redhat.com>
5418
5419         * Makefile.am (BFD64_BACKENDS_CFILES): Remove elf64-ia64.c, so
5420         that it will not be pulled into the list of files that make up
5421         po/POTFILES.in.
5422         * Makefile.in: Regenerate.
5423         * po/bfd.pot:  Regenerate.
5424
5425 2001-02-06  H.J. Lu  <hjl@gnu.org>
5426
5427         * peicode.h (coff_swap_filehdr_in): Remove the e_magic
5428         checking.
5429         (pe_bfd_object_p): Rewrite with external_PEI_DOS_hdr and
5430         external_PEI_IMAGE_hdr.
5431
5432 2001-02-06  Kazu Hirata  <kazu@hxi.com>
5433
5434         * elf-m10200.c: Fix formatting.
5435
5436 2001-02-04  Nick Clifton  <nickc@redhat.com>
5437
5438         * elf32-v850.c (v850_elf_reloc): Do not convert reloc addend to PC
5439         rel, it will be handled later on.
5440
5441 2001-02-02  Fred Fish  <fnf@ninemoons.com>
5442
5443         * Makefile.in: Fix typo.
5444
5445 2001-02-01  Kazu Hirata  <kazu@hxi.com>
5446
5447         * elf-m10300.c: Fix formatting.
5448
5449 2001-01-30  Alan Modra  <alan@linuxcare.com.au>
5450
5451         * elf64-hppa.c (elf64_hppa_elf_get_symbol_type): New function.
5452         (elf_backend_get_symbol_type): Define.
5453         (elf64_hppa_object_p): Set architecture and machine from elf
5454         header flags.
5455
5456 2001-01-30  Curtis L. Janssen  <cljanss@ca.sandia.gov>
5457
5458         * elf64-alpha.c (elf64_alpha_find_nearest_line): Query dwarf2
5459         before mdebug.
5460
5461 2001-01-26  Richard Henderson  <rth@redhat.com>
5462
5463         * elfxx-ia64.c (elfNN_ia64_dynamic_symbol_p): Return false
5464         for non-default visibility.
5465         * elf64-alpha.c (alpha_elf_dynamic_symbol_p): Likewise, but
5466         delete ugly macro and replace with pretty function.
5467
5468 2001-01-25  Mark Elbrecht  <snowball3@bigfoot.com>
5469
5470         * coff-go32.c: Update copyright.
5471         * coff-stgo32.c: Likewise.
5472         * coff-go32.c (COFF_LONG_FILENAMES): Define.
5473         * coff-stgo32.c (COFF_LONG_FILENAMES): Likewise.
5474         * coff-go32.c (COFF_SECTION_ALIGNMENT_ENTRIES): Remove .bss entry.
5475         * coff-stgo32.c (COFF_SECTION_ALIGNMENT_ENTRIES): Likewise.
5476
5477 2001-01-25  Kazu Hirata  <kazu@hxi.com>
5478
5479         * bfd-in2.h: Rebuild.
5480         * libbfd.h: Likewise.
5481
5482 2001-01-23  H.J. Lu  <hjl@gnu.org>
5483
5484         * bfd-in2.h: Rebuild.
5485
5486 2001-01-23  H.J. Lu  <hjl@gnu.org>
5487
5488         * vms-misc.c (_bfd_vms_next_record): Return -1 if PRIV(vms_buf)
5489         is NULL or PRIV(vms_rec) is outside of the buffer.
5490
5491 2001-01-23  Kazu Hirata  <kazu@hxi.com>
5492
5493         * coff64-rs6000.c: Fix formatting.
5494         * coff-arm.c: Likewise.
5495         * coffgen.c: Likewise.
5496         * cofflink.c: Likewise.
5497         * coff-mcore.c: Likewise.
5498         * coff-mips.c: Likewise.
5499         * coff-pmac.c: Likewise.
5500         * coff-ppc.c: Likewise.
5501         * coff-rs6000.c: Likewise.
5502         * elf32.c: Likewise.
5503         * elf32-fr30.c: Likewise.
5504         * elf32-i370.c: Likewise.
5505         * elf32-i860.c: Likewise.
5506         * elf32-m32r.c: Likewise.
5507         * elf32-m68k.c: Likewise.
5508         * elf32-mcore.c: Likewise.
5509         * elf32-ppc.c: Likewise.
5510         * elf32-sh.c: Likewise.
5511         * elf32-v850.c: Likewise.
5512         * elf64-alpha.c: Likewise.
5513         * elf64-sparc.c: Likewise.
5514         * elflink.c: Likewise.
5515         * elflink.h: Likewise.
5516         * elf-m10200.c: Likewise.
5517         * elf-m10300.c: Likewise.
5518         * elfxx-ia64.c: Likewise.
5519
5520         * aoutx.h: Fix formatting.
5521         * bfd.c: Likewise.
5522         * bfd-in2.h: Likewise.
5523         * bfd-in.h: Likewise.
5524         * cpu-i386.c: Likewise.
5525         * cpu-m68hc11.c: Likewise.
5526         * dwarf2.c: Likewise.
5527         * elf64-x86-64.c: Likewise.
5528         * format.c: Likewise.
5529         * freebsd.h: Likewise.
5530         * hash.c: Likewise.
5531         * hp300hpux.c: Likewise.
5532         * hppabsd-core.c: Likewise.
5533         * hpux-core.c: Likewise.
5534
5535 2001-01-22  Bo Thorsen  <bo@suse.de>
5536
5537         * elf64-x86-64.c: Added PIC support for X86-64.
5538         (elf64_x86_64_link_hash_newfunc): Function added.
5539         (elf64_x86_64_link_hash_table_create): Likewise.
5540         (elf64_x86_64_check_relocs): Likewise.
5541         (elf64_x86_64_gc_mark_hook): Likewise.
5542         (elf64_x86_64_gc_sweep_hook): Likewise.
5543         (elf64_x86_64_adjust_dynamic_symbol): Likewise.
5544         (elf64_x86_64_size_dynamic_sections): Likewise.
5545         (elf64_x86_64_discard_copies): Likewise.
5546         (elf64_x86_64_finish_dynamic_symbol): Likewise.
5547         (elf64_x86_64_finish_dynamic_sections): Likewise.
5548         (elf64_x86_64_relocate_section): Add relocation of PIC sections.
5549
5550 2001-01-21  Maciej W. Rozycki  <macro@ds2.pg.gda.pl>
5551
5552         * Makefile.am (install-data-local): Make use of $(DESTDIR).
5553         * Makefile.in: Regenerate.
5554
5555 2001-01-21  Kazu Hirata  <kazu@hxi.com>
5556
5557         * coff-a29k.c: Fix formatting.
5558
5559 2001-01-19  H.J. Lu  <hjl@gnu.org>
5560
5561         * elf32-i386.c (elf_i386_check_relocs): Report files with bad
5562         relocation section names.
5563         (elf_i386_relocate_section): Report files with bad relocation
5564         section names and return false.
5565
5566 2001-01-17  Bo Thorsen  <bo@suse.de>
5567
5568         * targets.c: Alphabetize list of xvecs.
5569
5570 2001-01-14  Alan Modra  <alan@linuxcare.com.au>
5571
5572         * config.bfd: Add linux target variant for elfxx-hppa.
5573         * configure.in: Recognize bfd_elf32_hppa_linux_vec and
5574         bfd_elf64_hppa_linux_vec.
5575         * configure: Regenerate.
5576         * elf64-hppa.c: Include elf64-target.h again to support linux
5577         target variant.
5578         (elf64_hppa_post_process_headers): Set ELFOSABI_LINUX for linux.
5579         * elf32-hppa.c: Include elf32-target.h again to support linux
5580         target variant.
5581         (elf32_hppa_post_process_headers): New function.
5582         (elf_backend_post_process_headers): Define.
5583         * targets.c (bfd_target_vector): Add bfd_elf64_hppa_linux_vec and
5584         bfd_elf32_hppa_linux_vec.
5585
5586         * elf32-hppa.c (elf32_hppa_link_hash_table): Add text_segment_base,
5587         and data_segment_base fields.
5588         (elf32_hppa_link_hash_table_create ): Init them.
5589         (elf32_hppa_check_relocs): Update comments.
5590         (hppa_record_segment_addr): New function.
5591         (elf32_hppa_relocate_section): Call it.
5592         (final_link_relocate): Handle R_PARISC_SEGREL32.
5593         (elf32_hppa_final_link): New function.
5594         (bfd_elf32_bfd_final_link): Define to call it.
5595         (hppa_unwind_entry_compare): New function.
5596         * cache.c (bfd_open_file): Create files in write+read mode.
5597
5598         * elf-hppa.h (elf_hppa_howto_table): Set bitsize value for
5599         SEGREL32 and numerous other relocs.  Change duplicate
5600         R_PARISC_NONE relocs to R_PARISC_UNIMPLEMENTED.
5601
5602         * opncls.c (bfd_fdopenr): Add parens like the comment says around
5603         O_ACCMODE.
5604
5605         * elf32-hppa.c (elf32_hppa_size_dynamic_sections): Don't create
5606         .plt entries for DT_INIT and DT_FINI.
5607         (elf32_hppa_finish_dynamic_sections): Remove special handling of
5608         DT_INIT and DT_FINI.
5609
5610         * elf64-hppa.c (elf64_hppa_finish_dynamic_symbol): Use 16-bit
5611         offsets for stub .plt access if wide mode.  Check offset in range.
5612
5613 2001-01-13  Nick Clifton  <nickc@redhat.com>
5614
5615         * elf32-fr30.c (fr30_elf_howto_table): Remove spurious blank
5616         line.
5617
5618         * coffcode.h (coff_canonicalize_reloc): Remove spurious blank
5619         line.
5620
5621 2001-01-12  Alan Modra  <alan@linuxcare.com.au>
5622
5623         * configure.in ([bfd_elf64_x86_64_vec]): Set target64.
5624         * configure: Regenerate.
5625
5626 2001-01-11  Peter Targett  <peter.targett@arccores.com>
5627
5628         * bfd-in2.h (bfd_architecture): Add bfd_mach_arc_5,
5629         bfd_mach_arc_6, bfd_mach_arc_7, bfd_mach_arc_8 for ARC variants.
5630         * cpu-arc.c (arch_info_struct): Add entries for variants.
5631         (bfd_arc_arch) Set default to bfd_mach_arc_5.
5632         (arc_get_mach) Don't assume machine names prefixed arc- before
5633         testing.
5634         * elf32-arc.c (arc_elf_object_p): Set machine number based on new
5635         selections.
5636         (arc_elf_final_write_processing) Likewise.
5637         (ELF_MACHINE_CODE) Use EM_ARC.
5638
5639 2001-01-10  Nick Clifton  <nickc@redhat.com>
5640
5641         * coff-arm.c (LOCAL_LABEL_PREFIX): Change definition to "".
5642
5643 2001-01-07  Philip Blundell  <philb@gnu.org>
5644
5645         * README: Replace `bug-gnu-utils@gnu.org' with
5646         `bug-binutils@gnu.org'.
5647
5648 2001-01-04  Kazu Hirata  <kazu@hxi.com>
5649
5650         * som.c: Fix formatting.
5651
5652 2001-01-03  Kazu Hirata  <kazu@hxi.com>
5653
5654         * ecoffswap.h: Fix formatting.
5655         * elf-bfd.h: Likewise.
5656         * elfarm-nabi.c: Likewise.
5657         * elfarm-oabi.c: Likewise.
5658         * elfcode.h: Likewise.
5659         * elfcore.h: Likewise.
5660         * elflink.c: Likewise.
5661         * elflink.h: Likewise.
5662         * elfxx-ia64.c: Likewise.
5663         * elfxx-target.h: Likewise.
5664         * libbfd.c: Likewise
5665         * linker.c: Likewise.
5666         * lynx-core.c: Likewise.
5667
5668 2001-01-02  Kazu Hirata  <kazu@hxi.com>
5669
5670         * pc532-mach.c: Fix formatting.
5671         * pe-arm.c: Likewise.
5672         * pe-i386.c: Likewise.
5673         * pe-mips.c: Likewise.
5674         * pe-ppc.c: Likewise.
5675         * pe-sh.c: Likewise.
5676         * pei-mips.c: Likewise.
5677         * pei-sh.c: Likewise.
5678         * peicode.h: Likewise.
5679         * ppcboot.c: Likewise.
5680         * ptrace-core.c: Likewise.
5681
5682 2001-01-01  Kazu Hirata  <kazu@hxi.com>
5683
5684         * reloc.c: Fix formatting.
5685         * riscix.c: Likewise.
5686         * rs6000-core.c: Likewise.
5687         * xcoff-target.h: Likewise.
5688
5689 2000-12-29  Hans-Peter Nilsson  <hp@bitrange.com>
5690
5691         * elfcode.h (elf_object_p): Also restore the bfd mach field on
5692         error, by calling bfd_default_set_arch_mach with incoming
5693         values.
5694
5695 2000-12-26  Kazu Hirata  <kazu@hxi.com>
5696
5697         * vaxnetbsd.c: Fix formatting.
5698         * versados.c: Likewise.
5699         * vms-gsd.c: Likewise.
5700         * vms-hdr.c: Likewise.
5701         * vms-misc.c: Likewise.
5702
5703 2000-12-25  Alexandre Oliva  <aoliva@redhat.com>
5704
5705         * archive.c (coff_write_armap): Don't write more than symbol_count
5706         `archive_member_file_ptr's.
5707
5708 2000-12-25  Kazu Hirata  <kazu@hxi.com>
5709
5710         * vms-tir.c: Fix formatting.
5711
5712 2000-12-23  Kazu Hirata  <kazu@hxi.com>
5713
5714         * vms.c: Fix formatting.
5715         * vms.h: Likewise.
5716
5717 2000-12-21  Santeri Paavolainen <santtu@ssh.com>
5718
5719         * vms-hdr.c: Include alloca.h if HAVE_ALLOCA_H is defined.
5720
5721         * peicode.h (pe_ILF_object_p): Add const to import of TARGET_LITTLE_SYM.
5722
5723         * elf32-m32r.c (m32r_elf_generic_reloc): Add cast to avoid (void *)
5724         arithmetic.
5725
5726         * elf32-fr30.c: Add casts to avoid (void *) arithmetic.
5727
5728         * coffcode.h (styp_to_sec_flags): Add empty statement after label.
5729
5730 2000-12-21  Richard Sandiford  <rsandifo@redhat.com>
5731
5732         * libbfd.c (bfd_get_bits): Added
5733         (bfd_put_bits): Likewise
5734         * bfd-in.h: Declared the above.
5735         * bfd-in2.h: Regenerated.
5736
5737 2000-12-20  Kazu Hirata  <kazu@hxi.com>
5738
5739         * targets.c: Fix formatting.
5740         * tekhex.c: Likewise.
5741         * trad-core.c: Likewise.
5742
5743 2000-12-19  Kazu Hirata  <kazu@hxi.com>
5744
5745         * sco5-core.c: Fix formatting.
5746         * section.c: Likewise.
5747         * sparclinux.c: Likewise.
5748         * sparclynx.c: Likewise.
5749         * sparcnetbsd.c: Likewise.
5750         * srec.c: Likewise.
5751         * stabs.c: Likewise.
5752         * stab-syms.c: Likewise.
5753         * sunos.c: Likewise.
5754         * syms.c: Likewise.
5755         * sysdep.h: Likewise.
5756
5757 2000-12-18  Nick Clifton  <nickc@redhat.com>
5758
5759         * coff-arm.c (EXTRA_S_FLAGS): Only define if not already
5760         defined.
5761         * epoc-pe-arm.c (EXTRA_S_FLAGS): Define.
5762         * epoc-pei-arm.c (EXTRA_S_FLAGS): Define.
5763
5764 2000-12-18  Nick Clifton  <nickc@redhat.com>
5765
5766         * vms-misc.c (_bfd_vms_get_record): Add default case to
5767         file_format switch.
5768
5769 2000-12-15  Miloslav Trmac <mitr@volny.cz>
5770
5771         * elfcore.h (elf_core_file_p): Move to the start of the program
5772         headers before attempting to read them.
5773
5774 2000-12-14  Kazu Hirata  <kazu@hxi.com>
5775
5776         * peigen.c: Fix formatting.
5777         * som.c: Likewise.
5778         * som.h: Likewise.
5779
5780 2000-12-13  Kazu Hirata  <kazu@hxi.com>
5781
5782         * peigen.c: Fix formatting.
5783
5784 2000-12-12  Jim Wilson  <wilson@redhat.com>
5785
5786         *  elfxx-ia64.c (get_dyn_sym_info): Cast %p argument to void *.
5787
5788 2000-12-08  Mark Salter  <msalter@redhat.com>
5789
5790         * binary.c (binary_set_section_contents): Ignore sections
5791         with zero size.
5792
5793 2000-12-12  Kazu Hirata  <kazu@hxi.com>
5794
5795         * m68klinux.c: Fix formatting.
5796         * m68knetbsd.c: Likewise.
5797         * mipsbsd.c: Likewise.
5798         * netbsd-core.c: Likewise.
5799         * netbsd.h: Likewise.
5800         * newsos3.c: Likewise.
5801         * nlm32-alpha.c: Likewise.
5802         * nlm32-i386.c: Likewise.
5803         * nlm32-ppc.c: Likewise.
5804         * nlm32-sparc.c: Likewise.
5805         * nlmcode.h: Likewise.
5806         * nlmswap.h: Likewise.
5807         * nlm-target.h: Likewise.
5808         * ns32knetbsd.c: Likewise.
5809
5810 2000-12-10  Fred Fish  <fnf@be.com>
5811
5812         * elflink.h (elf_link_output_extsym): Don't complain about undefined
5813         symbols in shared objects if allow_shlib_undefined is true.
5814
5815 2000-12-12  Nick Clifton  <nickc@redhat.com>
5816
5817         * cpu-sh.c: Fix formattng.
5818         * elf.c: Fix formattng.
5819         * elf32-mips.c: Fix formattng.
5820         * elf32-sh.c: Fix formattng.
5821         * elf64-alpha.c: Fix formattng.
5822
5823 2000-12-09  Nick Clifton  <nickc@redhat.com>
5824
5825         * elf32-mips.c (_bfd_mips_elf_find_nearest_line): Pass
5826         dwarf2_find_line_info as last parameter to invocation of
5827         _bfd_dwarf2_find_nearest_line.
5828         * elf32-arm.h (elf32_arm_find_nearest_line): Pass
5829         dwarf2_find_line_info as last parameter to invocation of
5830         _bfd_dwarf2_find_nearest_line.
5831
5832 2000-12-08  Mark Elbrecht  <snowball3@bigfoot.com>
5833
5834         * Makefile.am (BFD32_BACKENDS): Move dwarf2.lo from here...
5835         (BFD_LIBS): ...to here.
5836         (BFD32_BACKENDS_CFILES): Move dwarf2.c from here...
5837         (BFD_LIBS_CFILES): ...to here.
5838         * Makefile.in: Regenerate.
5839         * configure.in: Remove dwarf.lo from the elf shell variable.
5840         * configure: Regenerate.
5841         * libcoff-in.h (coff_tdata): Add pointer dwarf2_find_line_info.
5842         * libcoff.h: Regenerate.
5843         * coffgen.c (coff_find_nearest_line): Call
5844         _bfd_dwarf2_find_nearest_line.
5845         * dwarf2.c (_bfd_dwarf2_find_nearest_line): Add parameter. Update
5846         accordingly.
5847         (read_abbrevs): Likewise
5848         (decode_line_info): Likewise.
5849         (parse_comp_unit): Likewise.
5850         (comp_unit_find_nearest_line): Likewise.
5851         * libbfd-in.h (_bfd_dwarf2_find_nearest_line): Update prototype.
5852         * libbfd.h: Regenerate.
5853         * elf.c (_bfd_elf_find_nearest_line): Update call.
5854         * elf-bfd.h (elf_obj_tdata): Change dwarf2_find_line_info to type PTR.
5855         * dwarf2.c (concat_filename): Use IS_ABSOLUTE_PATH.
5856         * coffcode.h (STYP_XCOFF_DEBUG, STYP_DEBUG_INFO): New macros.
5857         (sec_to_styp_flags): Use them. Handle DWARF2 sections.
5858         (styp_to_sec_flags): Handle DWARF2 sections.
5859         * elf32-arm.h (elf32_arm_find_nearest_line): Add parameter to call
5860         to _bfd_find_nearest_line.
5861         * elf32-mips.c (_bfd_mips_elf_find_nearest_line): Add parameter to
5862         call to _bfd_find_nearest_line.
5863
5864 2000-12-08  Kazu Hirata  <kazu@hxi.com>
5865
5866         * coffgen.c: Fix formatting.
5867         * elf-m10300.c: Likewise.
5868         * elf32-i386.c: Likewise.
5869         * elf32-i960.c: Likewise.
5870         * elf32-m68k.c: Likewise.
5871         * elf32-mcore.c: Likewise.
5872         * elf32-ppc.c: Likewise.
5873         * elf32-sh.c: Likewise.
5874         * elf32-sparc.c: Likewise.
5875         * elf32-v850.c: Likewise.
5876         * elf64-alpha.c: Likewise.
5877         * elf64-hppa.c: Likewise.
5878         * elf64-mips.c: Likewise.
5879         * elf64-sparc.c: Likewise.
5880
5881 2000-12-07  Kazu Hirata  <kazu@hxi.com>
5882
5883         * elf32-ppc.c: Fix formatting.
5884         * elf64-x86-64.c: Likewise.
5885
5886 2000-12-06  Ulf Carlsson  <ulfc@engr.sgi.com>
5887
5888         From  Ralf Baechle  <ralf@gnu.org>
5889
5890         * elf32-mips.c (elf32_mips_merge_private_bfd_data): Always permit
5891         BFDs containing no sections or empty .text, .data or .bss sections
5892         to be merged, regardless of their flags.
5893
5894 2000-12-06  Kazu Hirata  <kazu@hxi.com>
5895
5896         * elf32-m32r.c: Fix formatting.
5897         * elf32-m68hc11.c: Likewise.
5898         * elf32-m68hc12.c: Likewise.
5899         * elf32-m68k.c: Likewise.
5900         * elf32-mcore.c: Likewise.
5901         * elf32-pj.c: Likewise.
5902         * elf32-ppc.c: Likewise.
5903
5904 2000-12-05  Kazu Hirata  <kazu@hxi.com>
5905
5906         * elf32-fr30.c: Fix formatting.
5907         * elf32-hppa.c: Likewise.
5908         * elf32-i370.c: Likewise.
5909         * elf32-i386.c: Likewise.
5910         * elf32-i860.c: Likewise.
5911         * elf32-i960.c: Likewise.
5912
5913 2000-12-03  Kazu Hirata  <kazu@hxi.com>
5914
5915         * elf32-arm.h: Fix formatting.
5916         * elf32-avr.c: Likewise.
5917         * elf32-cris.c: Likewise.
5918         * elf32-d10v.c: Likewise.
5919         * elf32-d30v.c: Likewise.
5920         * elf-hppa.h: Likewise.
5921         * elf-m10200.c: Likewise.
5922         * elf-m10300.c: Likewise.
5923
5924 2000-12-01  Chris Demetriou  <cgd@sibyte.com>
5925
5926         * aoutx.h (NAME(aout,machine_type)): Add bfd_mach_mips32 and
5927         bfd_mach_mips32_4k.  Update FIXME comment.
5928         * archures.c (bfd_mach_mips32): New constant.
5929         (bfd_mach_mips4K, bfd_mach_mips32_4k) Rename the former to
5930         the latter, renumber it.
5931         * bfd-in2.h (bfd_mach_mips32): New constant.
5932         (bfd_mach_mips4K, bfd_mach_mips32_4k) Rename the former to
5933         the latter, renumber it.
5934         * cpu-mips.c (I_mips32): New constant.
5935         (I_mips4K, I_mips32_4k): Rename the former to the latter.
5936         (arch_info_struct): Add bfd_mach_mips32 entry, replace
5937         bfd_mach_mips4K entry with bfd_mach_mips32_4k entry.
5938         * elf32-mips.c (elf_mips_isa): Add E_MIPS_ARCH_32 case.
5939         (elf_mips_mach): Likewise.  Also, replace E_MIPS_MACH_MIPS32
5940         with E_MIPS_MACH_MIPS32_4K.
5941         (_bfd_mips_elf_final_write_processing): Replace
5942         bfd_mach_mips4K with bfd_mach_mips32_4k case, add
5943         bfd_mach_mips32 case.
5944         (_bfd_mips_elf_merge_private_bfd_data): Generalize ISA mixing
5945         comparison with support for MIPS32.
5946         (_bfd_mips_elf_print_private_bfd_data): Print ISA name for
5947         MIPS32.
5948
5949         * aoutx.h (NAME(aout,machine_type)): Add cases for
5950         bfd_mach_mips5 and bfd_mach_mips64.
5951         * archures.c (bfd_mach_mips5, bfd_mach_mips64): New constants.
5952         * bfd-in2.h (bfd_mach_mips5, bfd_mach_mips64): Likewise.
5953         * cpu_mips.c (I_mips5, I_mips64): New definitions.
5954         (arch_info_struct): Add entries for bfd_mach_mips5 and
5955         bfd_mach_mips64.
5956         * elf32-mips.c (elf_mips_isa, elf_mips_mach,
5957         _bfd_mips_elf_print_private_bfd_data): Add cases for
5958         E_MIPS_ARCH_5 and E_MIPS_ARCH_64.
5959         (_bfd_mips_elf_final_write_processing): Add cases for
5960         bfd_mach_mips5 and bfd_mach_mips64.
5961
5962         * aoutx.h (NAME(aout,machine_type)): Add a
5963         bfd_mach_mips_sb1 case.
5964         * archures.c (bfd_mach_mips_sb1): New constant.
5965         * bfd-in2.h (bfd_mach_mips_sb1): New constant.
5966         * cpu-mips.c (I_sb1): New constant.
5967         (arch_info_struct): Add entry for bfd_mach_mips_sb1.
5968         * elf32-mips.c (elf_mips_mach): Add case for
5969         E_MIPS_MACH_SB1.
5970         (_bfd_mips_elf_final_write_processing): Add case for
5971         bfd_mach_mips_sb1.
5972
5973 2000-12-01  Joel Sherrill <joel@OARcorp.com>
5974
5975         * config.bfd (arm-*-rtems*, a29k-*rtems*): New targets.
5976         (sparc*-*-rtemself*, sparc*-*-rtemsaout*): New targets.
5977         (sparc*-*-rtems*): Switched from a.out to ELF.
5978
5979 2000-11-30  Jan Hubicka  <jh@suse.cz>
5980
5981         * Makefile.am (BFD64_BACKENDS): Add elf64-x86-64.lo
5982         BFD64_BACKENDS_CFILES): Add elf64-x86-64.c
5983         (elf64-x86-64.lo): Add dependencies.
5984         * archures.c (DESCRIPTION): Add bfd_mach_x86_64,
5985         bfd_mach_x86_64_intel_syntax.
5986         * elf.c (prep_headers): Use EM_x86_64 for 64bit output.
5987         * config.bfd (x86_64): Add.
5988         * configure.in: Add support for bfd_elf64_x86_64_vec.
5989         * cpu-i386.c (bfd_x86_64_arch_intel_syntax, bfd_x86_64_arch): Add.
5990         (bfd_i386_arch, i8086_ar): Link in.
5991         * elf64-x86-64.c: New file.
5992         * reloc.c (ENUMDOC): Add BFD_RELOC_X86_64*.
5993         * targets.c (bfd_elf64_x86_64_vec): Add.
5994         (bfd_target_vect): Add bfd_elf64_x86_64_vec.
5995
5996 2000-11-30  Kazu Hirata  <kazu@hxi.com>
5997
5998         * xcofflink.c: Fix formatting.
5999
6000 2000-11-28  Kazu Hirata  <kazu@hxi.com>
6001
6002         * aoutx.h: Fix formatting.
6003         * bfd-in.h: Likewise.
6004         * bfd-in2.h: Likewise.
6005         * cache.c: Likewise.
6006         * cisco-core.c: Likewise.
6007         * coff64-rs6000.c: Likewise.
6008         * coffcode.h: Likewise.
6009         * coffswap.h: Likewise.
6010         * corefile.c: Likewise.
6011         * elf32-mips.c: Likewise.
6012
6013 2000-11-27  Kazu Hirata  <kazu@hxi.com>
6014
6015         * aout-adobe.c: Fix formatting.
6016         * coff64-rs6000.c: Likewise.
6017         * coffgen.c: Likewise.
6018         * cofflink.c: Likewise.
6019
6020 2000-11-27  Philip Blundell  <pb@futuretv.com>
6021
6022         * libcoff-in.h (coff_tdata): Add `strings_written' flag.
6023         (obj_coff_strings_written): New accessor macro for above.
6024         * libcoff.h: Regenerate.
6025         * cofflink.c (_bfd_coff_final_link): Say that we wrote the
6026         strings.
6027         * coffcode.h (coff_write_object_contents): No need to write out
6028         the string table if it's already been done.
6029
6030 2000-11-22  Philip Blundell  <pb@futuretv.com>
6031
6032         * cofflink.c (_bfd_coff_generic_relocate_section): Don't object to
6033         weak undefined symbols.
6034
6035 2000-11-24  Nick Clifton  <nickc@redhat.com>
6036
6037         * archures.c (bfd_mach_arm_5TE): Define.
6038         (bfd_mach_arm+XScale): Define.
6039         * bfd-in2.h: Regenerate.
6040
6041         * coff-arm.c (coff_arm_reloc_type_lookup): Accept
6042         BFD_RELOC_ARM_PCREL_BLX.
6043
6044         * coffcode.h (coff_set_flags): Set flags for 5t, 5te and
6045         XScale machine numbers.
6046
6047         * config.bfd (xscale-elf): Add target.
6048         (xscale-coff): Add target.
6049
6050         * cpu-arm.c: Add xscale machine name.
6051         Add v5t, v5te and XScale machine numbers.
6052
6053 2000-11-23  Kazu Hirata  <kazu@hxi.com>
6054
6055         * aix386-core.c: Fix formatting.
6056
6057 2000-11-22  Jim Wilson  <wilson@redhat.com>
6058
6059         * coff-ia64.c (howto_table): Use EMPTY_HOWTO.
6060         (in_reloc_p): Add ATTRIBUTE_UNUSED to unused parameters.
6061         * cpu-ia64-opc.c (ins_rsvd, ext_rsvd, ins_const, ext_const): Likewise.
6062         (ins_imms_scaled): Initialize sign_bit at function entry.
6063         (elf64_ia64_operands): Add missing initializers.
6064         * elfxx-ia64.c (elfNN_ia64_reloc, elfNN_ia64_reloc_type_lookup,
6065         elfNN_ia64_info_to_howto, elfNN_ia64_fake_sections,
6066         elfNN_ia64_add_symbol_hook, elfNN_ia64_is_local_label_name,
6067         elfNN_ia64_local_hash_table_init, get_fptr, get_pltoff,
6068         elfNN_ia64_adjust_dynamic_symbol): Add ATTRIBUTE_UNUSED for unused
6069         parameters.
6070         (elfNN_ia64_info_to_howto): Initialize free_relocs, free_contents,
6071         and free_extsyms at function entry.
6072         (elfNN_add_symbol_hook): Add unsigned cast to bfd_get_gp_size result.
6073         (elfNN_ia64_create_dynamic_sections): Delete unused local h.
6074         (get_got): Delete unused local srel.
6075         (elfNN_ia64_check_relocs): Initialize dynrel_type when declared.
6076         (elfNN_ia64_relocate_section): Delete unused local dynindx.
6077
6078 2000-11-21  Kazu Hirata  <kazu@hxi.com>
6079
6080         * coff-a29k.c: Fix formatting.
6081         * coff-h8500.c: Likewise.
6082         * coff-i960.c: Likewise.
6083         * coff-ppc.c: Likewise.
6084         * coff-rs6000.c: Likewise.
6085         * coff-stgo32.c: Likewise.
6086         * coff-tic54x.c: Likewise.
6087         * coff-w65.c: Likewise.
6088         * cpu-h8500.c: Likewise.
6089         * cpu-hppa.c: Likewise.
6090         * cpu-ns32k.c: Likewise.
6091         * ecoff.c: Likewise.
6092         * ecofflink.c: Likewise.
6093
6094 2000-11-21  Nick Clifton  <nickc@redhat.com>
6095
6096         * elf32-sh.c (sh_elf_reloc_loop): Fix compile time warning, and
6097         remove possibility of infinite loop.
6098
6099 2000-11-20  Kazu Hirata  <kazu@hxi.com>
6100
6101         * aix386-core.c: Fix formatting.
6102         * aout-adobe.c: Likewise.
6103         * aout-arm.c: Likewise.
6104         * aout-encap.c: Likewise.
6105         * aout-ns32k.c: Likewise.
6106         * aout-target.h: Likewise.
6107         * aout-tic30.c: Likewise.
6108         * aoutf1.h: Likewise.
6109         * aoutx.h: Likewise.
6110         * archive.c: Likewise.
6111         * bfd-in.h: Likewise.
6112         * bfd-in2.h: Likewise.
6113         * bfd.c: Likewise.
6114         * bout.c: Likewise.
6115
6116 2000-11-17  H.J. Lu  <hjl@gnu.org>
6117
6118         * elfxx-ia64.c (elfNN_ia64_size_dynamic_sections): Don't create
6119         pltoff entries for DT_INIT and DT_FINI.
6120         (elfNN_ia64_final_link): Don't set DT_INIT/FINI entries.
6121         (elfNN_ia64_finish_dynamic_sections): Don't fill in DT_INIT/FINI
6122         entries.
6123
6124 2000-11-16  Richard Henderson  <rth@redhat.com>
6125
6126         * elfxx-ia64.c (elfNN_ia64_check_relocs): Handle IPLT relocs.
6127         (allocate_dynrel_entries): Likewise.
6128         (elfNN_ia64_relocate_section): Likewise.  Set REL addends correctly.
6129         (set_pltoff_entry): Likewise.
6130         (ia64_howto_table): Remove R_IA64_SEGBASE, and R_IA64_EPLT[ML]SB
6131         (elfNN_ia64_reloc_type_lookup): Likewise.
6132         (elfNN_ia64_install_value): Likewise.
6133         (elfNN_ia64_relocate_section): Likewise.
6134         * reloc.c (BFD_RELOC_IA64_SEGBASE): Remove.
6135         (BFD_RELOC_IA64_EPLTMSB, BFD_RELOC_IA64_EPLTLSB): Remove.
6136
6137 2000-11-16  Kazu Hirata  <kazu@hxi.com>
6138
6139         * cpu-a29k.c: Fix formatting.
6140         * cpu-alpha.c: Likewise.
6141         * cpu-arm.c: Likewise.
6142         * cpu-avr.c: Likewise.
6143         * cpu-d10v.c: Likewise.
6144         * cpu-h8500.c: Likewise.
6145         * cpu-hppa.c: Likewise.
6146         * cpu-i370.c: Likewise.
6147         * cpu-i386.c: Likewise.
6148         * cpu-i960.c: Likewise.
6149         * cpu-ia64-opc.c: Likewise.
6150         * cpu-ia64.c: Likewise.
6151         * cpu-m32r.c: Likewise.
6152         * cpu-m68hc11.c: Likewise.
6153         * cpu-m68hc12.c: Likewise.
6154         * cpu-m68k.c: Likewise.
6155         * cpu-m88k.c: Likewise.
6156         * cpu-mips.c: Likewise.
6157         * cpu-ns32k.c: Likewise.
6158         * cpu-pj.c: Likewise.
6159         * cpu-powerpc.c: Likewise.
6160         * cpu-sh.c: Likewise.
6161         * cpu-sparc.c: Likewise.
6162         * cpu-tic54x.c: Likewise.
6163         * cpu-v850.c: Likewise.
6164         * cpu-vax.c: Likewise.
6165         * cpu-w65.c: Likewise.
6166         * cpu-we32k.c: Likewise.
6167         * cpu-z8k.c: Likewise.
6168         * dwarf1.c: Likewise.
6169         * dwarf2.c: Likewise.
6170
6171 2000-11-15  Kazu Hirata  <kazu@hxi.com>
6172
6173         * coff-arm.c: Fix formatting.
6174         * coff-ppc.c: Likewise.
6175         * coff-rs6000.c: Likewise.
6176         * coff-sh.c: Likewise.
6177         * coff-sparc.c: Likewise.
6178         * coff-tic30.c: Likewise.
6179         * coff-tic54x.c: Likewise.
6180         * coff-tic80.c: Likewise.
6181         * coff-w65.c: Likewise.
6182         * coff-we32k.c: Likewise.
6183         * coff-z8k.c: Likewise.
6184
6185 2000-11-15  Richard Henderson  <rth@redhat.com>
6186
6187         * elf64-alpha.c (elf64_alpha_check_relocs): Create the reloc
6188         section with the same ALLOC|LOAD flags as the source section.
6189
6190 2000-11-14  Jakub Jelinek  <jakub@redhat.com>
6191
6192         * elf64-alpha.c (elf64_alpha_relax_opt_call): Only check bits used
6193         by STO_ALPHA constants.
6194
6195 2000-11-14  Kazu Hirata  <kazu@hxi.com>
6196
6197         * coff-pmac.c: Fix formatting.
6198         * coff-ppc.c: Likewise.
6199
6200 2000-11-13  H.J. Lu  <hjl@gnu.org>
6201
6202         * elflink.h (elf_link_add_object_symbols): Also add indirect
6203         symbols for common symbols with the default version.
6204
6205 2000-11-09  Philip Blundell  <pb@futuretv.com>
6206
6207         * section.c (STD_SECTION): Set gc_mark flag.
6208
6209 2000-11-11  Kazu Hirata  <kazu@hxi.com>
6210
6211         * coff-i960.c: Likewise.
6212         * coff-m68k.c: Likewise.
6213         * coff-m88k.c: Likewise.
6214         * coff-mcore.c: Likewise.
6215         * coff-mips.c: Likewise.
6216
6217 2000-11-11  Bernd Schmidt  <bernds@cygnus.co.uk>
6218
6219         * elf32-sh.c (sh_elf_relocate_section): Ignore R_SH_NONE relocs.
6220
6221 2000-11-10  Kazu Hirata  <kazu@hxi.com>
6222
6223         * coff-h8300.c: Fix formatting.
6224         * coff-h8500.c: Likewise.
6225         * coff-i386.c: Likewise.
6226         * coff-i860.c: Likewise.
6227         * coff-i960.c: Likewise.
6228         * coff-ia64.c: Likewise.
6229
6230 2000-11-09  Kazu Hirata  <kazu@hxi.com>
6231
6232         * archive.c: Fix formatting.
6233         * archures.c: Likewise.
6234
6235 2000-11-07  Richard Henderson  <rth@redhat.com>
6236
6237         * elfxx-ia64.c (elf64_ia64_final_link): New local unwind_output_sec.
6238         Set it before bfd_elf64_bfd_final_link call.  Use it after the call.
6239         * section.c (bfd_set_section_contents): Call memcpy if
6240         section->contents set and location not equal to contents plus offset.
6241
6242 2000-11-08  Kazu Hirata  <kazu@hxi.com>
6243
6244         * bfd-in.h: Fix formatting.
6245         * bfd-in2.h: Likewise.
6246         * bfd.c: Likewise.
6247         * binary.c: Likewise.
6248         * bout.c: Likewise.
6249         * coff-a29k.c: Likewise.
6250         * coff-alpha.c: Likewise.
6251         * coff-apollo.c: Likewise.
6252         * coff-aux.c: Likewise.
6253
6254 2000-11-07  Kazu Hirata  <kazu@hxi.com>
6255
6256         * aix386-core.c: Fix formatting.
6257         * aoutf1.h: Likewise.
6258         * aoutx.h: Likewise.
6259         * archures.c: Likewise.
6260         * armnetbsd.c: Likewise.
6261
6262 2000-11-07  Alan Modra  <alan@linuxcare.com.au>
6263
6264         * coff-h8300.c (special): Adjust reloc address.
6265
6266 2000-11-06  Steve Ellcey <sje@cup.hp.com>
6267
6268         * archures.c (bfd_mach_ia64_elf64, bfd_mach_ia64_elf32): Add defines
6269         to differentiate elf32 and elf64 on ia64.
6270         * bfd-in2.h: Regenerate.
6271         * config.bfd: Add target for "ia64*-*-hpux*".
6272         * configure.in: Add bfd_elf32_ia64_big_vec to selvecs switch.
6273         * configure: Regenerate.
6274         * cpu-ia64.c (bfd_ia64_elf32_arch): Add elf32 arch info structure.
6275         * targets.c: Add bfd_target bfd_elf32_ia64_big_vec.
6276
6277         * Makefile.am: Make elf32-ia64.c and elf64-ia64.c derived objects
6278         from elfxx-ia64.c.  Add depenency rules for making elf32-ia64.lo.
6279         * Makefile.in: Regnerate.
6280         * elf64-ia64.c: Deleted.
6281         * elfxx-ia64.c: New file, paramaterized version of elf64-ia64.c.
6282
6283 2000-11-06  Kazu Hirata  <kazu@hxi.com>
6284
6285         * aout-adobe.c: Fix formatting.
6286         * aout-arm.c: Likewise.
6287         * aout-cris.c: Likewise.
6288         * aout-encap.c: Likewise.
6289         * aout-ns32k.c: Likewise.
6290         * aout-target.h: Likewise.
6291         * aout-tic30.c: Likewise.
6292
6293 2000-11-05  Philip Blundell  <philb@gnu.org>
6294
6295         * elf32-arm.h (elf32_arm_merge_private_bfd_data): Always permit
6296         BFDs containing no sections to be merged, regardless of their flags.
6297
6298 2000-11-04  Philip Blundell  <philb@gnu.org>
6299
6300         * elf32-arm.h (elf32_arm_relocate_section): Suppress error message
6301         if a relocation for an undefined symbol also results in an
6302         overflow.
6303
6304 2000-11-06  Christopher Faylor <cgf@cygnus.com>
6305
6306         * config.bfd: Add support for Sun Chorus.
6307
6308 2000-11-05  David O'Brien  <obrien@FreeBSD.org>
6309
6310         * configure.in: Recognize alpha-*-freebsd*.
6311         * configure: Regenerate.
6312
6313 2000-11-02  Luciano Gemme <ishitawa@yahoo.com>
6314
6315         * srec.c (CHUNK): Rename to DEFAULT_CHUNK.
6316         (Chunk): New global variable set by a parameter in objcopy.c.
6317         (S3Forced): New global variable set by a parameter in
6318         objcopy.c.
6319         (srec_set_section_contents): If S3Forced is true, always generate
6320         S3 records.
6321         (srec_write_section): Use 'Chunk' to limit maximum length of S
6322         records.
6323
6324 2000-11-02  Per Lundberg  <plundis@chaosdev.org>
6325
6326         * config.bfd: Add support for i[3456]86-chaosdev-storm-chaos.
6327         * Makefile.in: Regenerate.
6328         * bfd-in2.h: Regenerate.
6329         * po/bfd.pot: Regenerate.
6330
6331 2000-10-31  Philip Blundell  <philb@gnu.org>
6332
6333         * elf32-arm.h (elf32_arm_merge_private_bfd_data): Only handle
6334         EF_SOFT_FLOAT if it is defined.
6335
6336 2000-10-27  Philip Blundell  <philb@gnu.org>
6337
6338         * elf32-arm.h (elf32_arm_copy_private_bfd_data): Don't refuse
6339         attempts to mix PIC code with non-PIC, just mark the output as
6340         being position dependent.
6341         (elf32_arm_merge_private_bfd_data): Likewise.  Print an error
6342         message for EF_SOFT_FLOAT mismatches.  Display diagnostics for
6343         all mismatches, not just the first one.
6344
6345 2000-10-25  Chris Demetriou  <cgd@sibyte.com>
6346
6347         * ieee.c (ieee_archive_p): Plug one of many possible
6348         memory leaks in error handling.
6349
6350 2000-10-20  Jakub Jelinek  <jakub@redhat.com>
6351
6352         * elf32-sparc.c (elf32_sparc_merge_private_bfd_data,
6353         elf32_sparc_object_p, elf32_sparc_final_write_processing):
6354         Support v8plusb.
6355         * elf64-sparc.c (sparc64_elf_merge_private_bfd_data,
6356         sparc64_elf_object_p): Support v9b.
6357         * archures.c: Declare v8plusb and v9b machines.
6358         * bfd-in2.h: Ditto.
6359         * cpu-sparc.c: Ditto.
6360
6361 2000-10-16  Geoffrey Keating  <geoffk@shoggoth.cygnus.com>
6362
6363         * elf64-sparc.c (sparc64_elf_relocate_section): Clear the location
6364         of a GOT reloc.
6365
6366         * elf32-ppc.c (SYMBOL_REFERENCES_LOCAL): New macro.
6367         (SYMBOL_CALLS_LOCAL): New macro.
6368         (ppc_elf_adjust_dynamic_symbol): Use SYMBOL_CALLS_LOCAL.
6369         (ppc_elf_check_relocs): Use SYMBOL_REFERENCES_LOCAL.
6370         (ppc_elf_finish_dynamic_symbol): Use SYMBOL_REFERENCES_LOCAL.
6371         (ppc_elf_relocate_section): Use flag variable to determine
6372         whether the relocation refers to a local symbol.
6373         Test whether a PLTREL24 reloc will produce a reloc by looking
6374         to see whether a PLT entry was made.
6375
6376 2000-10-14  Geoffrey Keating  <geoffk@shoggoth.cygnus.com>
6377
6378         * elf32-ppc.c (ppc_elf_finish_dynamic_symbol): Don't make PLT
6379         entries that could serve as a definition for a weak symbol.
6380
6381 2000-10-13  Ulf Carlsson  <ulfc@engr.sgi.com>
6382
6383         From  Ralf Baechle  <ralf@gnu.org>
6384
6385         * elf32-mips.c (mips_elf_create_dynamic_relocation): New argument
6386         local_p.  Add symbol value only for non-R_MIPS_REL32 relocations
6387         against local symbols.
6388         (_bfd_mips_elf_finish_dynamic_sections): Undo patch from 2000-10-01.
6389
6390 2000-10-12  Alan Modra  <alan@linuxcare.com.au>
6391
6392         * section.c (struct sec): Add kept_section.
6393         (struct bfd_comdat_info): Remove sec, we can use above.
6394         (STD_SECTION): Add initializer.
6395         (bfd_make_section_anyway): Init here too.
6396
6397         * bfd-in2.h: Regenerate.
6398
6399         * elflink.h (elf_link_add_object_symbols): Remove unnecessary
6400         zeroing of `flags'.
6401         (elf_link_input_bfd): Set all asection->symbol->value's here, and
6402         fudge values for discarded link-once section symbols.
6403
6404         * elf64-hppa.c: Include alloca-conf.h
6405
6406 2000-10-11  Alan Modra  <alan@linuxcare.com.au>
6407
6408         * elf.c (swap_out_syms): Revert 2000-10-07 changes.
6409
6410         * ieee.c (ieee_make_empty_symbol): Oops, bfd_zalloc needs another arg.
6411
6412 2000-10-10  Alan Modra  <alan@linuxcare.com.au>
6413
6414         * ieee.c (ieee_make_empty_symbol): Use bfd_zalloc, not bfd_zmalloc.
6415
6416 2000-10-10  Tom Rix <trix@redhat.com>
6417
6418         * section.c (bfd_make_section_anyway): Release newsect ptr when
6419         newsect->symbol fails to alloc.  Use bfd_release instead of free.
6420
6421 2000-10-09  Richard Henderson  <rth@cygnus.com
6422
6423         * elf64-ia64.c (elf64_ia64_unwind_entry_compare_bfd): New.
6424         (elf64_ia64_unwind_entry_compare): New.
6425         (elf64_ia64_final_link): Sort the .IA_64.unwind section.
6426
6427 2000-10-07  Alan Modra  <alan@linuxcare.com.au>
6428
6429         * elflink.h (size_dynamic_sections): Don't create various tags if
6430         .dynstr is excluded from the link.  Don't set first dynsym entry
6431         if dynsymcount is zero.
6432         (elf_bfd_final_link): Don't try to swap out dynamic syms if
6433         .dynsym excluded from the link.  Don't try to write any dynamic
6434         sections excluded from the link.
6435
6436         * elf.c (swap_out_syms): Handle global section symbols.
6437
6438 2000-10-05  DJ Delorie  <dj@redhat.com>
6439
6440         * peigen.c (_bfd_pei_swap_scnhdr_out): note extended relocs
6441         * coffcode.h (coff_set_alignment_hook): read extended reloc count
6442         (coff_write_relocs): write extended reloc count
6443         (coff_write_object_contents): account for extended relocs
6444
6445 2000-10-05  Jim Wilson  <wilson@cygnus.com>
6446
6447         * elf-bfd.h (struct elf_backend_data): Add elf_backend_section_flags
6448         field.
6449         * elf.c (_bfd_elf_make_section_from_shdr): Call the
6450         elf_backend_section_flags function.
6451         * elf64-ia64.c (elf64_ia64_section_from_shdr): Delete flag conversion
6452         code.
6453         (elf64_ia64_section_flags): New function containing flag conversion
6454         code.
6455         (elf_backend_section_flags): Define to elf64_ia64_section_flags.
6456         * elfxx-target.h (elf_backend_section_flags): Define.
6457         (elfNN_bed): Initialize elf_backend_section_flags field.
6458
6459 2000-10-02  Alan Modra  <alan@linuxcare.com.au>
6460
6461         * elf32-hppa.c (elf32_hppa_check_relocs): Correct call to
6462         _bfd_elf32_gc_record_vtable.  Correct a comment.
6463
6464 2000-10-01  Ulf Carlsson  <ulfc@engr.sgi.com>
6465
6466         From  Ralf Baechle  <ralf@gnu.org>
6467
6468         * elf32-mips.c (_bfd_mips_elf_finish_dynamic_sections): Mark gld
6469         produces binaries with got[1] = 0x80000001 to differenciate them
6470         for the dynamic linker from the broken binaries produced by old
6471         versions.
6472
6473 2000-09-30  Petr Sorfa <petrs@sco.com>
6474
6475         * elf.c (elfcore_grok_pstatus): Check for size of pxstatus_t.
6476         (elfcore_grok_lwpstatus): Check for size of lwpxstatus_t.
6477         * configure.in: Add check for pxstatus_t and lwpxstatus_t.
6478         * configure: Regenerate.
6479
6480 2000-09-27  Hans-Peter Nilsson  <hp@axis.com>
6481
6482         Define two bfd_targets for absence and presence of leading
6483         underscore on symbols.  Make sure to only link same kind.
6484         * elf32-cris.c (cris_elf_object_p,
6485         cris_elf_final_write_processing, cris_elf_print_private_bfd_data,
6486         cris_elf_merge_private_bfd_data): New.
6487         (elf_backend_object_p, elf_backend_final_write_processing,
6488         bfd_elf32_bfd_print_private_bfd_data,
6489         bfd_elf32_bfd_merge_private_bfd_data): Define.
6490         <Target vector definition>: Include elf32-target.h twice with
6491         different macro settings:
6492         (TARGET_LITTLE_SYM): First as bfd_elf32_cris_vec, then as
6493         bfd_elf32_us_cris_vec.
6494         (TARGET_LITTLE_NAME): First as "elf32-cris", then "elf32-us-cris".
6495         (elf_symbol_leading_char): First as 0, then '_'.
6496         (INCLUDED_TARGET_FILE): Define for second include of elf32-target.h.
6497         * config.bfd (cris-*-*): Add bfd_elf32_us_cris_vec to targ_selvecs.
6498         * configure.in (bfd_elf32_cris_vec, cris_aout_vec): New vector.
6499         * configure: Regenerate.
6500         * targets.c: Declare bfd_elf32_us_cris_vec.
6501         * po/bfd.pot: Regenerate.
6502
6503 2000-09-29  Momchil Velikov  <velco@fadata.bg>
6504
6505         * elf32-arm.h (arm_add_to_rel): Correctly adjust the addend for
6506         R_ARM_THM_PC22 relocations.
6507
6508 2000-09-29  NIIBE Yutaka <gniibe@chroot.org>
6509
6510         * elflink.h (elf_link_add_object_symbols): Don't bfd_release runpath.
6511
6512 2000-09-29  Momchil Velikov <velco@fadata.bg>
6513
6514         * elf.c (elf_fake_sections): Do not mark the section SHT_NOBITS if
6515         is has the SEC_HAS_CONTENTS flag set.
6516
6517 2000-09-28  \81Örjan Friberg  <orjanf@axis.com>
6518             Hans-Peter Nilsson  <hp@axis.com>
6519
6520         * aout-cris.c (N_TXTADDR): Define.
6521
6522 2000-09-28  John David Anglin <dave@hiauly1.hia.nrc.ca>
6523
6524         * som.c: Include alloca-conf.h.
6525         * Makefile.am: "make dep-am"
6526         * Makefile.in: Regenerate.
6527
6528 2000-09-27  Alan Modra  <alan@linuxcare.com.au>
6529
6530         * elf32-hppa.c (plt_stub): New.
6531         (PLT_STUB_ENTRY): Define.
6532         (elf32_hppa_link_hash_table): Change multi_subspace to packed
6533         boolean.  Add need_plt_stub, has_12bit_branch and has_17bit_branch.
6534         (elf32_hppa_link_hash_table_create): Init to suit.
6535         (elf32_hppa_check_relocs): Set has_12bit_branch and
6536         has_17bit_branch as appropriate.
6537         (elf32_hppa_adjust_dynamic_symbol): Set need_plt_stub for
6538         non-local functions.
6539         (elf32_hppa_size_dynamic_sections): Correct setting of reltext.
6540         Add space for plt_stub as needed.
6541         (elf32_hppa_finish_dynamic_symbol): Point .plt entries for global
6542         functions at plt_stub.
6543         (elf32_hppa_finish_dynamic_sections): Write plt_stub.
6544         (elf32_hppa_create_dynamic_sections): Leave .plt executable.
6545
6546         * elf32-hppa.h (elf32_hppa_size_stubs): Add group_size param.
6547         * elf32-hppa.c (elf32_hppa_size_stubs): Likewise.  Use it instead
6548         of fixed size, and if negative, disable handling of input sections
6549         before stub section.  Set up default stub group size depending
6550         on detected branch relocs.
6551         (hppa_build_one_stub): Use lrsel and rrsel for import stubs to
6552         ensure different offsets from sym_value aren't rounded to
6553         different 2k blocks.  Use lrsel and rrsel for other stubs too for
6554         consistency rather than necessity.
6555         (elf32_hppa_check_relocs): Handle R_PARISC_DIR14F.
6556         (final_link_relocate): Likewise.
6557         (elf32_hppa_relocate_section): Likewise.
6558
6559         * elf-hppa.h (elf_hppa_howto_table): Add R_PARISC_DIR14F reloc.
6560         (_bfd_elf_hppa_gen_reloc_type): Generate them.
6561         (elf_hppa_final_link_relocate): Handle them.
6562         (elf_hppa_relocate_insn): Likewise.
6563         (_bfd_elf_hppa_gen_reloc_type): Add missing e_ldsel and e_rdsel cases.
6564
6565 2000-09-26  Hans-Peter Nilsson  <hp@axis.com>
6566
6567         * elfcode.h (elf_object_p): Preserve and clear abfd section
6568         information.  Restore at error.
6569
6570 2000-09-26  Paul Sokolovsky  <Paul.Sokolovsky@technologist.com>
6571
6572         * peigen.c (_bfd_pei_swap_aouthdr_in): If some DataDirectory
6573         is empty, make sure that its rva also 0. NT loader dislikes
6574         having otherwise.
6575
6576 2000-09-26  Steve Ellcey <sje@cup.hp.com>
6577
6578         * som.c (som_bfd_derive_misc_symbol_info): Make weak symbols
6579         global by default.
6580
6581 2000-09-21  Alan Modra  <alan@linuxcare.com.au>
6582
6583         * elf32-hppa.c (elf32_hppa_check_relocs): Fix weak sym handling in
6584         currently unused RELATIVE_DYNAMIC_RELOCS code.
6585         (hppa_discard_copies): Likewise.
6586         (elf32_hppa_size_stubs): Size `input_list' array correctly.  Correct
6587         comments.  Don't check non-code output sections for stub grouping.
6588
6589 2000-09-20  Alan Modra  <alan@linuxcare.com.au>
6590
6591         * section.c (bfd_get_unique_section_name): Return NULL if
6592         bfd_malloc fails.
6593
6594 2000-09-19  Michael Sokolov  <msokolov@ivan.Harhan.ORG>
6595
6596         * elf32-m68k.c (elf_cpu32_plt0_entry): Change the PLT entry 0
6597         instruction sequence to actually work.
6598         (elf_m68k_finish_dynamic_sections): Change the patch-in offset
6599         accordingly.
6600
6601 2000-09-18  Alexandre Oliva  <aoliva@redhat.com>
6602
6603         * elf32-sh.c (sh_elf_relocate_section): Use
6604         _bfd_final_link_relocate to apply the relocation against a section
6605         symbol, when doing relocatable links.
6606
6607 2000-09-18  Alan Modra  <alan@linuxcare.com.au>
6608
6609         * elf32-hppa.c (elf32_hppa_stub_hash_entry): Rename input_section
6610         to id_sec.
6611         (stub_hash_newfunc): Here too.
6612         (hppa_add_stub): And here.
6613         (elf32_hppa_link_hash_table): Remove stub_section_created,
6614         reloc_section_created, first_init_sec and first_fini_sec.  Add
6615         stub_group.
6616         (elf32_hppa_link_hash_table_create): Init to suit.
6617         (hppa_get_stub_entry): Add support for grouping stub sections.
6618         (hppa_add_stub): Likewise.  Remove sec_count param and init/fini
6619         section code.  Index stub vars by section->id.
6620         (elf32_hppa_size_stubs): Likewise.  Remove duplicated function
6621         exit paths.  Zap allocation of above removed vars.  Refine
6622         link-once test.
6623
6624         * elf32-hppa.h (elf32_hppa_size_stubs): Add output_bfd param.
6625         * elf32-hppa.c (elf32_hppa_size_stubs): Likewise.
6626         (hppa_get_stub_entry): Pass in pointer to elf32_hppa_link_hash_table
6627         rather than pointer to bfd_link_info.
6628         (hppa_add_stub): Likewise.
6629         (final_link_relocate): Likewise.
6630
6631 2000-09-17  David Huggins-Daines  <dhd@linuxcare.com>
6632
6633         (elf32_hppa_size_stubs): Don't try to build stubs for discarded
6634         link-once sections.
6635
6636 2000-09-16  Alexandre Oliva  <aoliva@redhat.com>
6637
6638         * elf32-sh.c (ELF_MAXPAGESIZE): Define to 128, to match
6639         ld/emulparams/shelf.sh.
6640
6641 2000-09-10  Michael Sokolov  <msokolov@ivan.Harhan.ORG>
6642
6643         * elf32-m68k.c (bfd_m68k_elf32_create_embedded_relocs): New function.
6644         * bfd-in.h (bfd_m68k_elf32_create_embedded_relocs): Add declaration.
6645         * bfd-in2.h: Regenerate.
6646
6647 2000-09-15  Kenneth Block  <Kenneth.Block@compaq.com>
6648
6649         * elf64-alpha.c (elf64_alpha_relax_with_lituse): ld performs
6650         LITUSE relocations incorrectly if -relax is specified on the ld
6651         command line and the displacement field of the load or store
6652         instruction is non-zero. (Patch by paul.winalski@compaq.com)
6653
6654 2000-09-15  Alan Modra  <alan@linuxcare.com.au>
6655
6656         * elf32-hppa.c (hppa_add_stub): Dont set first_init_sec and
6657         first_fini_sec here.
6658         (elf32_hppa_size_stubs): Instead correctly find the first .init
6659         and .fini section here.
6660
6661 2000-09-15  David Huggins-Daines  <dhd@linuxcare.com>
6662
6663         * elf32-hppa.c (clobber_millicode_symbols): New function.
6664         (elf32_hppa_size_dynamic_sections): Call it.
6665
6666 2000-09-14  Alan Modra  <alan@linuxcare.com.au>
6667
6668         * elf32-hppa.c (elf32_hppa_link_hash_entry): Make pic_call
6669         packed.  Add plabel, plt_abs packed booleans.
6670         (hppa_link_hash_newfunc): Init new fields.
6671         (PLABEL_PLT_ENTRY_SIZE): Define.
6672         (hppa_stub_name): Use size_t len vars.
6673         (hppa_add_stub): Likewise.
6674         (elf32_hppa_build_stubs): Likewise.
6675         (hppa_build_one_stub): Kill some compiler warnings.
6676         (elf32_hppa_check_relocs): Always generate a plt entry for PLABELs
6677         if dynamic linking.  Munge the local plt offsets into
6678         local_got_refcounts.  Set h->plabel for all global PLABELs.  Use
6679         size_t len vars.  Add assert for plabel addend.
6680         (elf32_hppa_gc_sweep_hook): Sweep local plt entries too.
6681         (elf32_hppa_hide_symbol): New function.
6682         (elf_backend_hide_symbol): Define.
6683         (elf32_hppa_adjust_dynamic_symbol): Don't throw away plt entries
6684         with h->plabel set.  Don't make plt entries to have dynamic syms
6685         when they have been forced local.  If plt entry is used by a
6686         plabel, make it PLABEL_PLT_ENTRY_SIZE.
6687         (elf32_hppa_size_dynamic_sections): Set plt_abs for init fns.
6688         Set up .plt offsets for local syms.
6689         (elf32_hppa_relocate_section): Initialise plt entries for local
6690         syms.  Leave weak undefined plabels zero.  Make global plabel
6691         relocs against function symbol, and leave the addend zero.
6692         Use *ABS* DIR32 relocs instead of SEGREL32 for dynamic got relocs.
6693         (elf32_hppa_finish_dynamic_symbol): Set up IPLT relocs for
6694         non-dynamic syms.  Init extra plt for plabels.  Use *ABS* DIR32
6695         relocs instead of SEGREL32 for dynamic got relocs.
6696         (elf32_hppa_finish_dynamic_sections): Reserve one more .got entry.
6697         (elf_backend_got_header_size): Adjust.
6698         (elf32_hppa_set_gp): Calculate an "ideal" LTP.
6699
6700         * elf32-hppa.c (LONG_BRANCH_VIA_PLT): Define.
6701         (hppa_type_of_stub): Use it instead of #if 0
6702         (hppa_discard_copies): Use it here too.
6703         (elf32_hppa_size_dynamic_sections): And here.
6704
6705         * elf32-hppa.c (elf32_hppa_link_hash_table): Remove `offset' field.
6706         (elf32_hppa_link_hash_table_create): And here.
6707         (hppa_build_one_stub): And here.  Instead keep track of stub
6708         offset using _raw_size.
6709         (elf32_hppa_size_stubs): Likewise.
6710         (elf32_hppa_build_stubs): Likewise.
6711         (hppa_size_one_stub): Likewise.  Resize reloc section too.
6712
6713         * elf32-hppa.c (hppa_add_stub): Correct first_init_sec and
6714         first_fini_sec handling.  Don't search for reloc section or set
6715         hplink->reloc_section_created here.
6716         (elf32_hppa_size_stubs): Instead search for reloc sections, and
6717         set reloc_section_created here.
6718         (hppa_handle_PIC_calls): Set ELF_LINK_HASH_NEEDS_PLT.
6719         (elf32_hppa_size_dynamic_sections): Make a .plt entry for DT_INIT
6720         and DT_FINI.
6721         (elf32_hppa_finish_dynamic_sections): Set DT_INIT and DT_FINI.
6722
6723         * elf32-hppa.c (hppa_build_one_stub): Replace `elf_hash_table (info)'
6724         with `hplink->root.'.
6725         (elf32_hppa_check_relocs): Likewise.
6726         (elf32_hppa_gc_sweep_hook): Likewise.
6727         (elf32_hppa_adjust_dynamic_symbol): Likewise.
6728         (hppa_handle_PIC_calls): Likewise.
6729         (elf32_hppa_size_dynamic_sections): Likewise.
6730         (elf32_hppa_set_gp): Likewise.
6731         (elf32_hppa_relocate_section): Likewise.
6732         (elf32_hppa_finish_dynamic_symbol): Likewise.
6733         (elf32_hppa_finish_dynamic_sections): Likewise.
6734
6735         From  David Huggins-Daines  <dhd@linuxcare.com>
6736         * elf32-hppa.c (hppa_type_of_stub): Generate import stubs for
6737         defined weak symbols in shared links.
6738         (final_link_relocate): Calls to defined weak symbols in shared
6739         objects must go via import stubs, as the target might not be known
6740         at link time.
6741
6742 2000-09-14  Alexandre Oliva  <aoliva@redhat.com>
6743
6744         * elf32-sh.c (sh_elf_howto_table): Moved R_SH_GOT32, R_SH_PLT32,
6745         R_SH_COPY, R_SH_GLOB_DAT, R_SH_JMP_SLOT, R_SH_RELATIVE,
6746         R_SH_GOTOFF, R_SH_GOTPC) to the range from 160 to 167.  Replaced
6747         the original entries with EMPTY_HOWTOs, and added new ones to fill
6748         in the gap.
6749         (sh_elf_info_to_howto): Make sure the new gap isn't used.
6750         (sh_elf_relocate_section): Likewise.
6751
6752 2000-09-13  Anders Norlander  <anorland@acc.umu.se>
6753
6754         * cpu-mips.c (arch_info_struct): Add mips:4K
6755         * bfd-in2.h (bfd_mach_mips4K): New define.
6756         * archures.c: Add bfd_mach_mips4K to comment.
6757         * elf32-mips.c (_bfd_mips_elf_final_write_processing): Return
6758         E_MIPS_ARCH_2 for bfd_mach_mips4K.
6759
6760 2000-09-13  Marco Franzen <marcof@thyron.com>
6761
6762         * som.c (som_write_symbol_strings): Do not used fixed buffers,
6763         use size_t as a counter.
6764         (som_write_space_strings): Similarly.
6765
6766 2000-09-12  Jason Eckhardt  <jle@cygnus.com>
6767
6768         * elf32-i860.c (elf32_i860_relocate_pc26): New function
6769         and prototype.
6770         (elf32_i860_relocate_section): Invoke new function from here.
6771
6772 2000-09-11  Michael Sokolov  <msokolov@ivan.Harhan.ORG>
6773
6774         * elf.c (_bfd_elf_make_section_from_shdr): Make debug_sec_names
6775         static.
6776
6777 2000-09-10  Michael Sokolov  <msokolov@ivan.Harhan.ORG>
6778
6779         * coff-m68k.c (bfd_m68k_coff_create_embedded_relocs): Emit 8 NULs for
6780         target section name instead of dumping core when the target symbol is
6781         undefined.
6782
6783 2000-09-09  Kazu Hirata  <kazu@hxi.com>
6784
6785         * riscix.c: Remove DEFUN.
6786
6787 2000-09-08  Nick Clifton  <nickc@redhat.com>
6788
6789         * elf32-arm.h (elf32_arm_merge_private_bfd_data): Do not
6790         initialise flags in output bfd if the input bfd is the default
6791         architecture with the default flags.
6792
6793 2000-09-08  Kazu Hirata  <kazu@hxi.com>
6794
6795         * archive.c: Fix formatting.
6796         * coff-arm.c: Likewise.
6797         * doc/chew.c: Likewise.
6798
6799 2000-09-08  Alan Modra  <alan@linuxcare.com.au>
6800
6801         * section.c (bfd_get_unique_section_name): Put a dot before the
6802         numeric suffix.
6803
6804 2000-09-07  Kazu Hirata  <kazu@hxi.com>
6805
6806         * doc/chew.c: Remove all uses of DEFUN and DEFUN_VOID.
6807         * elf.c: Fix formatting.
6808
6809 2000-09-07  Alexandre Oliva  <aoliva@redhat.com>
6810
6811         * config.bfd (sh-*-linux*): Added.
6812         * configure.in (bfd_elf32_shlin_vec, bfd_elf32_shblin_vec): New.
6813         * targets.c: Declare them.
6814         * elf32-sh-lin.c: New file.
6815         * Makefile.am: Compile it.
6816         * elf32-sh.c: Don't override defines from elf32-sh-lin.c.
6817         * configure, Makefile.in: Rebuilt.
6818
6819 2000-09-06  Geoffrey Keating  <geoffk@cygnus.com>
6820
6821         * xcofflink.c (xcoff_link_input_bfd): Include the .tocbss
6822         pseduo-section when determining where the TOC ends.
6823
6824         * coff-rs6000.c (_bfd_xcoff_swap_aux_out): Use bfd_h_put_16 to
6825         output x_tvndx as it is only two bytes wide.
6826
6827         * coff-rs6000.c (xcoff_howto_table): A modifiable branch-absolute
6828         reloc is 26 or 32 bits wide.
6829
6830         * coff-rs6000.c (_bfd_xcoff_rtype2howto): The bitsize is irrelevant
6831         for relocs that don't change anything.  Also look at the full
6832         6 bits of bitsize.
6833
6834 2000-09-06  Philip Blundell  <philb@gnu.org>
6835
6836         * config.bfd (arm*-*-uclinux*): New target.
6837
6838 2000-09-06  Alexandre Oliva  <aoliva@redhat.com>
6839
6840         * configure: Rebuilt with new libtool.m4.
6841
6842 2000-09-06  Alan Modra  <alan@linuxcare.com.au>
6843
6844         * section.c (bfd_get_unique_section_name): Avoid c++ reserved
6845         word for variable name.
6846         * bfd-in2.h: Regenerate.
6847
6848 2000-09-05  Nick Clifton  <nickc@redhat.com>
6849
6850         * config.in: Regenerate.
6851         * libbfd.h: Regenerate.
6852         * po/bfd.pot: Regenerate.
6853         * doc/bfdint.texi: Remove CVS date string - it foils compares with
6854         local versions.
6855
6856 2000-09-05  Steven Johnson  <sbjohnson@ozemail.com.au>
6857
6858         * cpu-powerpc.c  (arch_info_struct): Added MPC860 Family entry.
6859
6860 2000-09-05  Alan Modra  <alan@linuxcare.com.au>
6861
6862         Shared library and PIC support.
6863         * elf32-hppa.c (PLT_ENTRY_SIZE): New.
6864         (GOT_ENTRY_SIZE): New.
6865         (ELF_DYNAMIC_INTERPRETER): New.
6866         (STUB_SUFFIX): Define.
6867         (LONG_BRANCH_PIC_IN_SHLIB): Define.
6868         (RELATIVE_DYNAMIC_RELOCS): Define.
6869         (enum elf32_hppa_stub_type): New.
6870         (struct elf32_hppa_stub_hash_entry): Rename offset to
6871         stub_offset.  Add a number of new fields.
6872         (struct elf32_hppa_link_hash_entry): New.
6873         (struct elf32_hppa_link_hash_table): Add numerous fields.  Remove
6874         global_value.
6875         (elf32_hppa_hash_table): Rename to hppa_link_hash_table.
6876         (elf32_hppa_stub_hash_lookup): Rename to hppa_stub_hash_lookup.
6877         (elf32_hppa_stub_hash_newfunc): Rename to stub_hash_newfunc.  Init
6878         new fields.
6879         (hppa_link_hash_newfunc): New function.
6880         (elf32_hppa_link_hash_table_create): Use above function. Init new
6881         fields.
6882         (elf32_hppa_stub_name): Rename to hppa_stub_name.  Pass in reloc
6883         instead of addend, and remove sym_name from args.  Don't use
6884         symbol name for local syms, instead use sym index.
6885         (elf32_hppa_size_of_stub): Rename to hppa_type_of_stub, and return
6886         stub type rather than size.  Pass in hash and handle import stub
6887         case.  Also pass in reloc instead of offset so we can calculate
6888         PCREL22F and PCREL12F branches properly.
6889         (elf32_hppa_build_one_stub): Rename to hppa_build_one_stub.  Build
6890         import and export stubs too.
6891         (elf32_hppa_size_one_stub): Rename to hppa_size_one_stub.  Handle
6892         import and export stub sizing.
6893         (elf32_hppa_check_relocs): New function.
6894         (elf32_hppa_adjust_dynamic_symbol): New function.
6895         (hppa_discard_copies): New function.
6896         (elf32_hppa_size_dynamic_sections): New function.
6897         (elf_backend_size_dynamic_sections): Define.
6898         (elf32_hppa_finish_dynamic_symbol): New function.
6899         (elf_backend_finish_dynamic_symbol): Define.
6900         (elf32_hppa_size_stubs): Stash params in link hash table, and move
6901         some local vars into the link hash table too.  For shared links,
6902         trundle over function syms, generating export stubs.  Handle
6903         PCREL22F branches.  Break out stub creation code from here..
6904         (hppa_add_stub): .. to here.  New function.
6905         (elf32_hppa_final_link): Rename to elf32_hppa_set_gp, and don't
6906         call the bfd linker.  Use elf_gp to record global pointer.
6907         Calculate a value from sections if $global$ is missing.
6908         (bfd_elf32_bfd_final_link): Define as _bfd_elf32_gc_common_final_link.
6909         (elf32_hppa_gc_mark_hook): New function.
6910         (elf_backend_gc_mark_hook): Define.
6911         (elf32_hppa_gc_sweep_hook): New function.
6912         (elf_backend_gc_sweep_hook): Define.
6913         (elf32_hppa_bfd_final_link_relocate): Rename to final_link_relocate.
6914         Add rel to args, and remove howto, input_bfd, offset, addend,
6915         sym_name as we can recalculate these locally.  Handle calls to
6916         dynamic objects, extra PIC relocs, PCREL22F branches.  Change
6917         handling of undefined weak syms.  Check that stubs are in range.
6918         Only look for import stubs on PCREL17F and PCREL22F relocs.  Add
6919         message on hitting a DPREL21L reloc that needs fixing.  Subtract
6920         off PC for PCREL14F.  Break out code that does a stub lookup from
6921         here..
6922         (hppa_get_stub_entry): ..to here.  New function.
6923         (elf32_hppa_relocate_insn): Merge into final_link_relocate.
6924         (elf32_hppa_relocate_section): Handle got and plt relocs, dynamic
6925         relocs, etc. etc.
6926         (elf32_hppa_finish_dynamic_sections): New function.
6927         (elf_backend_finish_dynamic_sections): Define.
6928         (elf_backend_final_write_processing) Define.
6929         (hppa_handle_PIC_calls): New function.
6930         (elf32_hppa_build_stubs): Call it.  Pass link_info to
6931         hppa_build_one_stub.
6932         (elf32_hppa_create_dynamic_sections): New function
6933         to create .plt and .got then set .plt flags correctly.
6934         (elf_backend_create_dynamic_sections): Define.
6935         (elf32_hppa_object_p): New function.
6936         (elf_backend_object_p): Define.
6937         (elf32_hppa_elf_get_symbol_type): New function.
6938         (elf_backend_get_symbol_type): Define.
6939         (elf_backend_can_gc_sections): Define.
6940         (elf_backend_want_got_plt): Define.
6941         (elf_backend_plt_alignment): Set to 2.
6942         (elf_backend_plt_readonly): Define.
6943         (elf_backend_want_plt_sym): Define.
6944         (elf_backend_got_header_size): Reserve one entry.
6945
6946         * elf32-hppa.h (elf32_hppa_build_stubs): Don't pass stub bfd.
6947         (elf32_hppa_size_stubs): Pass in multi_subspace.
6948         (elf32_hppa_set_gp): Declare.
6949
6950         * section.c (SEC_HAS_GOT_REF): Define new flag for asection.
6951         (bfd_get_unique_section_name): New function.
6952         * bfd-in2.h: Regenerate.
6953
6954         * elf64-hppa.c (elf64_hppa_check_relocs): Handle R_PARISC_PCREL12F.
6955         (elf64_hppa_size_dynamic_sections): Remove the FIXME at bfd_zalloc
6956         comment.
6957
6958         From  David Huggins-Daines  <dhd@linuxcare.com>
6959         * elf64-hppa.c (elf64_hppa_check_relocs): Fix a warning.
6960         (elf64_hppa_mark_exported_functions): Set dyn_h->st_shndx.
6961         (elf64_hppa_link_output_symbol_hook): Test dyn_h->st_shndx has
6962         been updated in finish_dynamic_symbol before modifying function
6963         symbol.
6964
6965         * elf-hppa.h (elf_hppa_howto_table): Restructure into groups of
6966         eight entries.  Replace NULL with bfd_elf_generic_reloc.  Add
6967         R_PARISC_GNU_VTENTRY, R_PARISC_GNU_VTINHERIT and R_PARISC_PCREL12F.
6968         (_bfd_elf_hppa_gen_reloc_type): Handle R_PARISC_GNU_VT*.  Add some
6969         comments.  Handle format == 12 for R_HPPA_PCREL_CALL.
6970         (elf_hppa_final_link_relocate): Handle R_PARISC_PCREL12F.
6971         (elf_hppa_relocate_insn): Likewise.  Reformat some comments.
6972         (elf_hppa_final_write_processing): Expose it for ARCH_SIZE == 32.
6973
6974         From David Huggins-Daines  <dhd@linuxcare.com>
6975         * elf-hppa.h (elf_hppa_is_local_label_name): Accept the SysV/ELF
6976         style of local labels as well.
6977
6978 2000-09-03  Philip Blundell  <philb@gnu.org>
6979
6980         * elf32-arm.h (elf32_arm_relocate_section): Don't try to relocate
6981         references to undefined symbols in debugging sections.
6982
6983 2000-09-02  H.J. Lu  <hjl@gnu.org>
6984
6985         * reloc.c (BFD_RELOC_SH_COPY, BFD_RELOC_SH_GLOB_DAT,
6986         BFD_RELOC_SH_JMP_SLOT, BFD_RELOC_SH_RELATIVE,
6987         BFD_RELOC_SH_GOTPC): Move them from the MIPS section to the SH
6988         section.
6989
6990 2000-09-02  Jason Eckhardt  <jle@cygnus.com>
6991
6992         * elf32-i860.c (bfd_elf32_bfd_is_local_label_name): Define macro.
6993         (elf32_i860_is_local_label_name): New function and prototype.
6994
6995 2000-09-02  Nick Clifton  <nickc@redhat.com>
6996
6997         * configure.in: Increase version number to 2.10.91.
6998         * configure: Regenerate.
6999         * aclocal.m4: Regenerate.
7000         * config.in: Regenerate.
7001         * po/bfd.pot: Regenerate.
7002
7003 2000-09-02  Daniel Berlin <dberlin@redhat.com>
7004
7005         * elf.c (_bfd_elf_make_section_from_shdr): Add
7006         .gnu.linkobce.wi. to the list of debug section names.
7007
7008 2000-09-02  Nick Clifton  <nickc@redhat.com>
7009
7010         * dwarf2.c (find_debug_info): New function: Locate a section
7011         containing dwarf2 debug information.
7012         (bfd_dwarf2_find_nearest_line): Find all sections containing
7013         debug information and include them in the stash.
7014
7015 2000-09-01  Niibe Yutaka  <gniibe@m17n.org>, Kaz Kojima  <kkojima@rr.iij4u.or.jp>, Alexandre Oliva  <aoliva@redhat.com>
7016
7017         * elf32-sh.c (R_SH_GOT32, R_SH_PLT32, R_SH_COPY, R_SH_GLOB_DAT,
7018         R_SH_JMP_SLOT, R_SH_RELATIVE, R_SH_GOTOFF, R_SH_GOTPC): New.
7019         (sh_reloc_map): Add new relocs.
7020         (sh_elf_check_relocs, sh_elf_link_hash_newfunc,
7021         sh_elf_link_hash_table_create, sh_elf_adjust_dynamic_symbol,
7022         sh_elf_size_dynamic_sections, sh_elf_finish_dynamic_symbol,
7023         sh_elf_finishe_dynamic_sections, sh_elf_discard_copies): New
7024         functions.
7025         (ELF_DYNAMIC_INTERPRETER, PLT_ENTRY_SIZE): Define.
7026         (elf_sh_plt0_entry_be, elf_sh_plt0_entry_le,
7027         elf_sh_plt_entry_be, elf_sh_plt_entry_le,
7028         elf_sh_pic_plt_entry_be, elf_sh_pic_plt_entry_le):
7029         New array constants.
7030         (elf_sh_plt0_entry, elf_sh_plt_entry, elf_sh_pic_plt_entry):
7031         New variables.
7032         (elf_sh_sizeof_plt, elf_sh_plt_plt0_offset,
7033         elf_sh_plt0_linker_offset, elf_sh_plt0_gotid_offset,
7034         elf_sh_plt_temp_offset, elf_sh_plt_symbol_offset,
7035         elf_sh_plt_reloc_offset): Define.
7036         (elf_sh_pcrel_relocs_copied, elf_sh_link_hash_entry,
7037         elf_sh_link_hash_table): New structs.
7038         (sh_elf_link_hash_traverse, sh_elf_hash_table): New macros.
7039         (sh_elf_relocate_section, sh_elf_check_relocs): Handle new
7040         relocation types.
7041         (elf_backend_create_dynamic_sections,
7042         bfd_elf32_bfd_link_hash_table_create,
7043         elf_backend_adjust_dynamic_symbol,
7044         elf_backend_size_dynamic_sections,
7045         elf_backend_finish_dynamic_symbol,
7046         elf_backend_finish_dynamic_sections, elf_backend_want_got_plt,
7047         elf_backend_plt_readonly, elf_backend_want_plt_sym,
7048         elf_backend_got_header_size, elf_backend_plt_header_size):
7049         Define.
7050         * reloc.c (BFD_RELOC_SH_COPY, BFD_RELOC_SH_GLOB_DAT,
7051         BFD_RELOC_SH_JMP_SLOT, BFD_RELOC_SH_RELATIVE, BFD_RELOC_SH_GOTPC):
7052         New relocs.
7053         * bfd-in2.h, libbfd.h: Rebuilt.
7054
7055 2000-09-01  Alan Modra  <alan@linuxcare.com.au>
7056
7057         * elf32-i386.c (elf_i386_finish_dynamic_symbol): Revert 2000-08-27
7058         change.
7059
7060 2000-08-31  J"orn Rennecke <amylaar@cygnus.co.uk>
7061
7062         * elf32-sh.c (sh_elf_merge_private_data): If ibfd's elf header flags
7063         not initialized, set them to indicate the SH1 instruction set.
7064
7065 2000-08-31  Alexandre Oliva  <aoliva@redhat.com>
7066
7067         * acinclude.m4: Include libtool and gettext macros from the
7068         top level.
7069         * aclocal.m4, configure: Rebuilt.
7070
7071 2000-08-29  Michael Snyder  <msnyder@seadog.cygnus.com>
7072
7073         * elf.c: Eliminate references to __sparcv9 macro; replace with
7074         autoconf variables HAVE_PSINFO32_T etc.
7075         * configure.in: Auto-configure HAVE_PSINFO_32_T, HAVE_PRPSINFO32_T,
7076         HAVE_PSTATUS32_T, HAVE_PRSTATUS32_T, HAVE_PRSTATUS32_T_PR_WHO.
7077         * config.in: Ditto.
7078         * acinclude.m4 (BFD_HAVE_SYS_PROCFS_TYPE) define _SYSCALL32 so it can
7079         detect the above typedefs.  (BFD_HAVE_SYS_PROCFS_TYPE_MEMBER): Ditto.
7080         * aclocal.m4: Ditto.
7081         * configure: Regenerate.
7082
7083 2000-08-27  Alan Modra  <alan@linuxcare.com.au>
7084
7085         * elf32-i386.c (elf_i386_check_relocs): Keep info on relocs copied
7086         for any shared link, not just shared -Bsymbolic.
7087         (elf_i386_size_dynamic_sections): Call elf_i386_discard_copies on
7088         any shared link, and pass link info to it.
7089         (elf_i386_size_dynamic_sections): Update comment.
7090         (elf_i386_discard_copies): Modify to discard relocs for symbols
7091         that have been forced local.
7092         (elf_i386_finish_dynamic_symbol): Don't copy relocs for symbols
7093         that have been forced local.
7094
7095 2000-08-24  Denis Chertykov  <denisc@overta.ru> & Nick Clifton  <nickc@redhat.com>
7096
7097         * elflink.h (elf_link_add_object_symbols): Allow common
7098         symbols to have an alignment of 1 if explicitly requested, and
7099         not overridden by other definitions.
7100
7101 2000-08-22  Doug Kwan <dkwan@transmeta.com>
7102
7103         * coff-w65.c (CREATE_LITTLE_COFF_TARGET): Fix typo.
7104         * coffcode.h (coff_set_flags): Add detection of w65 architecture.
7105
7106 2000-08-22  H.J. Lu  <hjl@gnu.org>
7107
7108         * elf-bfd.h (elf_link_hash_table): Add runpath.
7109
7110         * bfd-in.h (bfd_elf_get_runpath_list): New prototype.
7111         * bfd-in2.h: Rebuilt.
7112
7113         * elf.c (_bfd_elf_link_hash_table_init): Initialize the
7114         "runpath" field to NULL.
7115         (bfd_elf_get_runpath_list): New function.
7116
7117         * elflink.h (elf_link_add_object_symbols): Record DT_RPATH and
7118         DT_RUNPATH entries.
7119
7120 2000-08-22  Alexandre Oliva  <aoliva@redhat.com>
7121
7122         * elf32-sh.c (sh_elf_relocate_section) [R_SH_IND12W,
7123         R_SH_DIR8WPN, R_SH_DIR8WPZ, R_SH_DIR8WPL]: Handle them
7124         explicitly.  Improve validation of r_type.
7125
7126 2000-08-21  H.J. Lu  <hjl@gnu.org>
7127
7128         * elf32-i386.c (elf_i386_size_dynamic_sections): Zero out the
7129         dynamic allocated content space.  Add a comment to remind us that
7130         one day this ought to be fixed.
7131         * elf32-m68k.c (elf_m68k_size_dynamic_sections): Likewise.
7132         * elf32-sparc.c (elf32_sparc_size_dynamic_sections): Likewise.
7133         * elf64-hppa.c (elf64_hppa_size_dynamic_sections): Likewise.
7134
7135 2000-08-21  Jason Eckhardt  <jle@cygnus.com>
7136
7137         * elf32-i860.c (elf32_i860_relocate_pc16): Just write the immediate
7138         field with the newly relocated value instead of adding it to the
7139         existing immediate field.
7140         (elf32_i860_relocate_splitn): Likewise.
7141         (elf32_i860_relocate_highadj): Likewise.
7142
7143 2000-08-16  Jason Eckhardt  <jle@cygnus.com>
7144
7145         * elf32-i860.c (elf32_i860_relocate_pc16): Implemented function (it
7146         was previously just a stub).
7147
7148 2000-08-16  Alexandre Oliva  <aoliva@redhat.com>
7149
7150         * elflink.c (_bfd_elf_create_got_section): Don't abort().
7151         Formatting fixes.
7152         (_bfd_elf_create_dynamic_sections): Likewise.
7153
7154 2000-08-16  Andrew Macleod  <amacleod@cygnus.com>
7155
7156         * elf64-sparc.c (sparc64_elf_relocate_section): Set relocation address
7157         for undefined symbols to be the beginning of the section.
7158
7159         * elf64-sparc.c (sparc64_elf_adjust_dynamic_symbol): Don't allocate
7160         four extra entries at the beginning of the .rela.plt section.
7161         (sparc64_elf_finish_dynamic_symbol): Adjust the offset in the .rela.plt
7162         section to account for the four reserved entries in the .plt section.
7163
7164 2000-08-15  Geoffrey Keating  <geoffk@cygnus.com>
7165
7166         * xcofflink.c (_bfd_ppc_xcoff_relocate_section): Add ori r0,r0,0
7167         to the list of NOPs we recognize after a branch-and-link.
7168         Use the ori NOP when one is needed.
7169
7170         * coff-rs6000.c (_bfd_xcoff_slurp_armap): Finish implementation
7171         for large archives.
7172
7173 2000-08-14  Jim Wilson  <wilson@cygnus.com>
7174
7175         * elf64-ia64.c (elf64_ia64_merge_private_bfd_data): Handle
7176         EF_IA_64_REDUCEDFP, EF_IA_64_CONS_GP, and EF_IA_64_NOFUNCDESC_CONS_GP.
7177         (elf64_ia64_print_private_bfd_data): Likewise.  Also handle
7178         EF_IA_64_ABSOLUTE.
7179
7180 2000-08-11  Alexandre Oliva  <aoliva@redhat.com>
7181
7182         * elf32-sh.c (sh_elf_set_mach_from_flags): Make it static.
7183
7184 2000-08-10  Jason Eckhardt  <jle@cygnus.com>
7185
7186         * elf32-i860.c (elf32_i860_relocate_section): New function.
7187         (i860_final_link_relocate): New function.
7188         (elf32_i860_relocate_splitn): New function.
7189         (elf32_i860_relocate_pc16): New function.
7190         (elf32_i860_relocate_highadj): New function.
7191         (elf32_i860_howto): Minor adjustments to some relocations.
7192         (elf_info_to_howto_rel): Define.
7193         (elf_backend_relocate_section): Define.
7194
7195 2000-08-10  Nick Clifton  <nickc@cygnus.com>
7196
7197         * elf32-arm.h: Fix formatting.
7198
7199 2000-08-10  Bernd Schmidt  <bernds@cygnus.co.uk>
7200
7201         * elf32-sh.c (sh_elf_reloc_loop): Make LAST_SYMBOL_SECTION static.
7202
7203 2000-08-08  Jason Eckhardt  <jle@cygnus.com>
7204
7205         * elf32-i860.c (elf32_i860_howto_table): Updated some fields.
7206
7207 2000-08-07  Kazu Hirata  <kazu@hxi.com>
7208
7209         * ieee.c (ieee_write_debug_part): Rewrite a comment.
7210         * elf64-ia64.c: Fix a typo.
7211
7212 2000-08-05  Jason Eckhardt  <jle@cygnus.com>
7213
7214         * elf32-i860.c (elf32_i860_howto_table): New structure.
7215         (lookup_howto): New function.
7216         (elf32_i860_reloc_type_lookup): New function.
7217         (elf32_i860_info_to_howto_rela): New function.
7218         (elf_code_to_howto_index): New structure.
7219         (elf_info_to_howto): Re-define as elf32_i860_info_to_howto_rela.
7220         (bfd_elf32_bfd_reloc_type_lookup): Re-define as
7221         elf32_i860_reloc_type_lookup.
7222
7223 2000-08-04  Rodney Brown  <RodneyBrown@pmsc.com>
7224
7225         * som.c (struct fixup_format): Constify `format'.
7226         (som_hppa_howto_table): Use SOM_HOWTO macro.
7227         (try_prev_fixup, hppa_som_reloc): Decorate unused parameter.
7228         (som_bfd_reloc_type_lookup): Likewise.
7229         (compare_subspaces): Remove unused `count1', `count2'.
7230         (som_begin_writing): Remove unused `total_reloc_size'.
7231         (som_bfd_derive_misc_symbol_info): Decorate unused parameter.
7232         (som_print_symbol, som_bfd_is_local_label_name): Likewise.
7233         (som_set_reloc_info): Constify `cp'. Remove unused `addend'.
7234         (som_find_nearest_line): Decorate unused parameter(s).
7235         (som_sizeof_headers, som_get_symbol_info, som_write_armap): Likewise.
7236         (som_bfd_link_split_section): Likewise.
7237
7238 2000-08-03  Nick Clifton  <nickc@cygnus.com>
7239
7240         * section.c: Restore backed out code.
7241         * elf.c: Restore backed out code.
7242         (copy_private_bfd_data): Fix bug preventing stipped dynamic
7243         binaries from working.
7244         * bfd-in2.h: Regenerate.
7245
7246 2000-08-03  H.J. Lu  <hjl@gnu.org>
7247
7248         * section.c: Back out the change made by Nick Clifton
7249         <nickc@cygnus.com> on 2000-07-31. It breaks stripping dynamic
7250         binaries.
7251         * bfd-in2.h: Likewise.
7252         * elf.c: Likewise.
7253
7254 2000-08-03  Alexandre Oliva  <aoliva@redhat.com>
7255
7256         * elf32-sh.c (sh_elf_reloc_loop): Warning removal.
7257
7258 2000-07-31  Jason Eckhardt  <jle@cygnus.com>
7259
7260         * reloc.c (BFD_RELOC_860_*): New bfd relocs for i860.
7261         * bfd-in2.h, libbfd.h: Regenerate.
7262
7263 2000-07-31  Nick Clifton  <nickc@cygnus.com>
7264
7265         * section.c (struct sec): Add new boolean field 'segment_mark'.
7266         (STD_SECTION): Initialise new field to zero.
7267
7268         * bfd-in2.h: Regenerate.
7269
7270         * elf.c (copy_private_bfd_data): Reorganise section to segment
7271         mapping to cope with moved sections requiring new segments,
7272         and overlapping segments.
7273         (SEGMENT_END): New macro: Return the end address of a segment.
7274         (IS_CONTAINED_BY_VMA): New macro: Determine if a segment
7275         contains a section by comparing their VMA addresses.
7276         (IS_CONTAINED_BY_LMA): New macro: Determine if a segment
7277         contains a section by comparing their LMA addresses.
7278         (INCLUDE_SECTION_IN_SEGMENT): New macro: Determine if a
7279         section should be included in a segment.
7280         (SEGMENT_AFTER_SEGMENT): New macro: Determine if one segment
7281         follows another in memory.
7282         (SEGMENT_OVERLAPS_SEGMENT): New macro: Determine if two
7283         segments overlap.
7284
7285 2000-07-22  Jason Eckhardt  <jle@cygnus.com>
7286
7287         * cpu-i860.c: Added comments.
7288
7289         * elf32-i860.c (TARGET_LITTLE_SYM): Defined to
7290         bfd_elf32_i860_little_vec.
7291         (TARGET_LITTLE_NAME): Defined to "elf32-i860-little".
7292         (ELF_MAXPAGESIZE): Changed to 4096.
7293
7294         * targets.c (bfd_elf32_i860_little_vec): Declaration of
7295         new target.
7296         (bfd_target_vector): Added bfd_elf32_i860_little_vec.
7297
7298         * config.bfd (i860-stardent-sysv4*, i860-stardent-elf*): Added
7299         config for little endian elf32 i860.
7300         (targ_defvec): Define for the new config above
7301         as "bfd_elf32_i860_little_vec".
7302         (targ_selvecs): Define for the new config above
7303         as "bfd_elf32_i860_vec bfd_elf32_i860_little_vec"
7304
7305         * configure.in (bfd_elf32_i860_little_vec): Added recognition
7306         of new target vec.
7307
7308         * configure: Regenerated.
7309
7310 2000-07-27  H.J. Lu  <hjl@gnu.org>
7311
7312         * elflink.h (elf_merge_symbol): Take one more argument,
7313         dt_needed, to indicate if the symbol comes from a DT_NEEDED
7314         entry. Don't overide the existing weak definition if dt_needed
7315         is true.
7316         (elf_link_add_object_symbols): Pass dt_needed to
7317         elf_merge_symbol ().
7318
7319 2000-07-27  Nick Clifton  <nickc@cygnus.com>
7320
7321         * elflink.h (elf_link_size_reloc_section): Zeroes the section's
7322         allocated contents.
7323
7324 2000-07-25  Geoffrey Keating  <geoffk@cygnus.com>
7325
7326         * configure.host (*-*-aix*): AIX has 'long long' always.
7327
7328         * coff-rs6000.c (xcoff_write_one_armap_big): New procedure.
7329         (xcoff_write_armap_big): Write both 32-bit and 64-bit armaps.
7330         (xcoff_write_archive_contents_big): Don't update the offset
7331         of the symbol table, xcoff_write_armap will do it.
7332
7333 2000-07-23  Ulf Carlsson  <ulfc@engr.sgi.com>
7334
7335         * elf32-mips.c (_bfd_mips_elf_check_relocs): Use abfd instead
7336         of dynobj for SGI_COMPAT checks.
7337
7338 2000-07-21  Michael Sokolov  <msokolov@ivan.Harhan.ORG>
7339
7340         * coff-m68k.c (bfd_m68k_coff_create_embedded_relocs): New function.
7341         * bfd-in.h (bfd_m68k_coff_create_embedded_relocs): Add declaration.
7342         * bfd-in2.h: Regenerate.
7343
7344 2000-07-21  Nick Clifton  <nickc@cygnus.com>
7345
7346         * elf32-mips.c (_bfd_mips_elf_check_relocs): Detect out of
7347         range symbol indices in relocs and issue an error message.
7348
7349 2000-07-20  H.J. Lu  <hjl@gnu.org>
7350
7351         * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Don't check
7352         info->new_dtags when setting DT_FLAGS_1. It will only be set
7353         by the new linker options. It shouldn't break anything.
7354
7355 2000-07-20  H.J. Lu  <hjl@gnu.org>
7356
7357         * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Set DT_FLAGS_1
7358         only if info->new_dtags is true.
7359
7360 2000-07-20  H.J. Lu  <hjl@gnu.org>
7361
7362         * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Set
7363         DT_RUNPATH and DT_FLAGS only if info->new_dtags is true.
7364
7365 2000-07-20  Hans-Peter Nilsson  <hp@axis.com>
7366
7367         * Makefile.am (ALL_MACHINES): Add cpu-cris.lo.
7368         (ALL_MACHINES_CFILES): Add cpu-cris.c.
7369         (BFD32_BACKENDS): Add aout-cris.lo and elf32-cris.lo.
7370         (BFD32_BACKENDS_CFILES): Add aout-cris.c and elf32-cris.c.
7371         (cpu-cris.lo, aout-cris.lo, elf32-cris.lo): New rules.
7372         * Makefile.in: Rebuild.
7373         * aclocal.m4: Rebuild.
7374         * aoutx.h (NAME(aout,machine_type)): Add case for bfd_arch_cris.
7375         * archures.c (enum bfd_architecture): Add bfd_arch_cris.
7376         (bfd_cris_arch): Declare.
7377         (bfd_archures_list): Add bfd_cris_arch.
7378         * bfd-in2.h: Rebuild.
7379         * config.bfd: (cris-*-*): New target.
7380         * configure.in (bfd_elf32_cris_vec, cris_aout_vec): New vectors.
7381         * configure: Rebuild.
7382         * elf.c (prep_headers): Add bfd_arch_cris.
7383         * libbfd.h: Rebuild.
7384         * libaout.h (enum machine_type): Add M_CRIS.
7385         * reloc.c: Add CRIS relocations.
7386         * targets.c (bfd_elf32_cris_vec, cris_aout_vec): Declare.
7387         (bfd_target_vect): Add bfd_elf32_cris_vec and cris_aout_vec.
7388         * cpu-cris.c, aout-cris.c, elf32-cris.c: New files.
7389         * po/POTFILES.in, po/bfd.pot: Regenerate.
7390
7391 2000-07-19  H.J. Lu  <hjl@gnu.org>
7392
7393         * elf32-arm.h (elf32_arm_size_dynamic_sections): Also set
7394         DF_TEXTREL if DT_TEXTREL is set.
7395         * elf32-i370.c (i370_elf_size_dynamic_sections): Likewise.
7396         * elf32-i386.c (elf_i386_size_dynamic_sections): Likewise.
7397         * elf32-m68k.c (elf_m68k_size_dynamic_sections): Likewise.
7398         * elf32-mips.c (_bfd_mips_elf_size_dynamic_sections): Likewise.
7399         * elf32-ppc.c (ppc_elf_size_dynamic_sections): Likewise.
7400         * elf32-sparc.c (elf32_sparc_size_dynamic_sections): Likewise.
7401         * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Likewise.
7402         * elf64-hppa.c (elf64_hppa_size_dynamic_sections): Likewise.
7403         * elf64-ia64.c (elf64_ia64_size_dynamic_sections): Likewise.
7404         * elf64-sparc.c (sparc64_elf_size_dynamic_sections): Likewise.
7405
7406         * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Also
7407         set DF_SYMBOLIC for symbolic link. Also set DT_RUNPATH if
7408         DT_RPATH is set.
7409         Set the DT_FLAGS and DT_FLAGS_1 entries if necessary.
7410
7411 2000-07-19  H.J. Lu  <hjl@gnu.org>
7412
7413         * bfd-in.h (bfd_elf_set_dt_needed_soname): New.
7414         * bfd-in2.h: Rebuild.
7415
7416         * elf-bfd.h (elf_obj_tdata): Add dt_soname.
7417         (elf_dt_soname): New.
7418
7419         * elf.c (bfd_elf_set_dt_needed_soname): New.
7420
7421         * elflink.h (elf_link_add_object_symbols): Add the DT_NEEDED
7422         entry if the shared object loaded by DT_NEEDED is used to
7423         resolve the reference in a regular object.
7424
7425 2000-07-19  H.J. Lu  <hjl@gnu.org>
7426
7427         * elf.c (_bfd_elf_print_private_bfd_data): Handle DT_CONFIG,
7428         DT_DEPAUDIT and DT_AUDIT as strings.
7429
7430 2000-07-19  Nick Clifton  <nickc@cygnus.com>
7431
7432         * format.c: Fix formatting.
7433
7434 2000-07-19  H.J. Lu  <hjl@gnu.org>
7435
7436         * elf.c (_bfd_elf_print_private_bfd_data): Fix DT_CHECKSUM.
7437
7438 2000-07-19  H.J. Lu  <hjl@gnu.org>
7439
7440         * elf.c (_bfd_elf_print_private_bfd_data): Handle DT_BIND_NOW,
7441         DT_INIT_ARRAY, DT_FINI_ARRAY, DT_INIT_ARRAYSZ, DT_FINI_ARRAYSZ,
7442         DT_RUNPATH, DT_FLAGS, DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ,
7443         DT_PLTPADSZ, DT_MOVEENT, DT_MOVESZ, DT_FEATURE, DT_POSFLAG_1,
7444         DT_SYMINSZ, DT_SYMINENT, DT_CONFIG, DT_DEPAUDIT, DT_AUDIT,
7445         DT_PLTPAD, DT_MOVETAB, DT_SYMINFO, DT_RELACOUNT, DT_RELCOUNT,
7446         DT_FLAGS_1, DT_USED and DT_CHECKSUM.
7447
7448 2000-07-18  Andrew Cagney  <cagney@b1.cygnus.com>
7449
7450         * elf.c (bfd_elf_get_sign_extend_vma, bfd_elf_get_arch_size): Move
7451         renamed functions from here...
7452         (assign_section_numbers): Use renamed functions.
7453         (prep_headers): Use renamed functions.
7454
7455         * bfd.c (bfd_get_sign_extend_vma, bfd_get_arch_size): ...To here.
7456         * bfd-in.h (bfd_get_sign_extend_vma, bfd_get_arch_size): Update.
7457         * bfd-in2.h: Regenerate.
7458
7459 2000-07-18  Ulf Carlsson  <ulfc@engr.sgi.com>
7460
7461         * elf32-mips.c (_bfd_mips_elf_finish_dynamic_symbol): Add
7462         parenthesis in if statement.
7463
7464 2000-07-17  Koundinya K  <kk@ddeorg.soft.net>
7465
7466         Enable the support for Traditional MIPS.
7467         * elf32-mips.c (IRIX_COMPAT): Recognize bfd_elf32_tradbigmips_vecand
7468         return ict_none appropriately for traditional mips targets.
7469         (STUB_LW): Change 0x8f998000 to 0x8f998010 for traditional mips.
7470         (STUB_MOVE): Conditionalize for traditonal mips.
7471         (STUB_LI16): Likewise.
7472         (_bfd_mips_elf_modify_segment_map): Conditionalize to avoid making
7473         room for RTPROC header.
7474         (_bfd_mips_elf_modify_segment_map): For a normal mips executable set
7475         the permission for the PT_DYNAMIC as read, write and execute.
7476         (mips_elf_calculate_relocation): Check for the symbol _DYNAMIC_LINKING
7477         for traditonal mips.
7478         (_bfd_mips_elf_create_dynamic_sections): Add the symbol
7479         _DYNAMIC_LINKING for traditonal mips.
7480         (_bfd_mips_elf_create_dynamic_sections): Add the symbol __RLD_MAP
7481         in case of traditonal mips.
7482         (_bfd_mips_elf_adjust_dynamic_symbol): Create a stub only if a PLT
7483         entry is required. For a function if PLT is not required then set the
7484         corresponding hash table entry to 0.
7485         (_bfd_mips_elf_size_dynamic_sections): Add DT_DEBUG entry for
7486         traditonal mips.
7487         (_bfd_mips_elf_finish_dynamic_symbol): for a undefined symbol in a
7488         shared object set the value to 0.
7489         (_bfd_mips_elf_finish_dynamic_symbol): Check for the symbol
7490         _DYNAMIC_LINKING for traditonal mips.
7491         (_bfd_mips_elf_finish_dynamic_symbol): Check for the symbol __RLD_MAP
7492         for traditonal mips.
7493
7494 2000-07-15  H.J. Lu  <hjl@gnu.org>
7495
7496         * aoutx.h (translate_to_native_sym_flags): Handle BSF_LOCAL.
7497
7498 2000-07-12  Charles Wilson  <cwilson@ece.gatech.edu>
7499
7500         * libbfd.c (bfd_seek): fix 'seek beyond EOF' error when writing
7501         out a structure that is BFD_IN_MEMORY.
7502
7503 2000-07-11  Alan Modra  <alan@linuxcare.com.au>
7504
7505         * elf64-hppa.c (get_dyn_name): Pass in section pointer instead of
7506         bfd pointer.  Print section id instead of bfd pointer for local
7507         syms.  Prefix addend with `+' for global syms as well as local.
7508         Correct calculation of name component lengths.
7509         (elf64_hppa_check_relocs): Update call to get_dyn_name.
7510
7511         From David Huggins-Daines  <dhd@linuxcare.com>
7512         * elf-hppa.h (elf_hppa_relocate_section): Update calls here too.
7513         * elf64-hppa.c (elf64_hppa_check_relocs): Fix some warnings.
7514         (elf64_hppa_modify_segment_map): Likewise.
7515
7516 2000-07-11  Andrew Cagney  <cagney@b1.cygnus.com>
7517
7518         * elf.c (bfd_elf_get_sign_extend_vma): Return tendency of VMA
7519         addresses to be "naturally" sign extended.  Return -1 if unknown.
7520         * bfd-in.h (bfd_elf_get_sign_extend_vma): Add declaration.
7521         * bfd-in2.h: Regenerate.
7522
7523 2000-07-11  Andrew Cagney  <cagney@b1.cygnus.com>
7524
7525         * ecoffswap.h (ecoff_get_off, ecoff_put_off): Add ECOFF_SIGNED_32
7526         and ECOF_SIGNED_64 to list ways to extract an offset.
7527         (ecoff_swap_fdr_in, ecoff_swap_fdr_out, ecoff_swap_pdr_in,
7528         ecoff_swap_pdr_out, ecoff_swap_ext_in, ecoff_swap_ext_out):
7529         Update.
7530         * elf64-mips.c (ECOFF_SIGNED_64): Define instead of ECOFF_64.
7531         * elf32-mips.c (ECOFF_SIGNED_32): Define instead of ECOFF_32.
7532
7533 2000-07-11  Andrew Cagney  <cagney@b1.cygnus.com>
7534
7535         * elfcode.h (elf_object_p): Use bfd_set_start_address and not
7536         bfd_get_start_address.
7537         (elf_swap_ehdr_in): Sign extend e_entry when applicable.
7538         (elf_swap_ehdr_out): Ditto.
7539
7540 2000-07-10  Alexander Aganichev  <AAganichev@hypercom.com>
7541
7542         * archures.c (bfd_default_scan): Add set of bfd_mach_ cases for
7543         compatibility with older binutils.
7544
7545 2000-07-10  Alan Modra  <alan@linuxcare.com.au>
7546
7547         * section.c (bfd_make_section_anyway): Start section_id at 0x10.
7548         (STD_SECTION): Avoid negative ids, instead use 0 to 3.
7549
7550         From Ryan Bradetich  <rbradetich@uswest.net>
7551         * dwarf1.c (parse_die): Cure signed/unsigned char warnings.
7552         (parse_line_table): Ditto.
7553         (_bfd_dwarf1_find_nearest_line): Ditto.
7554         * syms.c (cmpindexentry): Remove extra `*' from params.
7555
7556 2000-07-09  Koundinya K  <kk@ddeorg.soft.net>
7557
7558         * elf32-mips.c (sort_dynamic_relocs): New Function.
7559         (_bfd_mips_elf_finish_dynamic_sections): Call sort_dynamic_relocs
7560         via qsort to sort the dynamic relocations in increasing r_symndx
7561         value.
7562
7563 2000-07-09  Alan Modra  <alan@linuxcare.com.au>
7564
7565         * elf64-hppa.c (elf64_hppa_dyn_hash_table_init): Add
7566         ATTRIBUTE_UNUSED to unused args.
7567         (get_opd): Likewise.
7568         (get_plt): Likewise.
7569         (get_dlt): Likewise.
7570         (get_stub): Likewise.
7571         (elf64_hppa_adjust_dynamic_symbol): Likewise.
7572         (elf64_hppa_link_output_symbol_hook): Likewise.
7573         (elf64_hppa_check_relocs): Delete unused var.
7574         (elf64_hppa_size_dynamic_sections): Likewise.
7575         (elf64_hppa_finalize_opd): Likewise.
7576         (elf64_hppa_finalize_dynreloc): Likewise.
7577         (elf64_hppa_modify_segment_map): Likewise.
7578         (elf64_hppa_finish_dynamic_sections): Likewise.
7579
7580         * elf-hppa.h (elf_hppa_final_write_processing): Add
7581         ATTRIBUTE_UNUSED to unused args.
7582         (elf_hppa_final_link_relocate): Likewise.
7583         (elf_hppa_record_segment_addrs): Add paretheses.
7584         (elf_hppa_relocate_section): Constify dyn_name.
7585
7586         From  David Huggins-Daines  <dhd@linuxcare.com>
7587         * config.bfd: Add hppa*64*-*-linux-gnu 64-bit target, and
7588         rearrange case statement so that it gets preferred to 32-bit ones.
7589
7590         * elf32-hppa.c (elf32_hppa_bfd_final_link_relocate): Use
7591         asection->id instead of address of asection structure.
7592         (elf32_hppa_size_stubs): Likewise.
7593
7594         * elf32-hppa.c (elf32_hppa_size_stubs): Use just one stub section
7595         for .init* and .fini*.
7596
7597         * elf32-hppa.c (elf32_hppa_bfd_final_link_relocate): Mask pointers
7598         and addends used in stub names to 32 bits.
7599         (elf32_hppa_size_stubs): Likewise.
7600
7601         * elf-hppa.h (elf_hppa_final_link_relocate): Don't sum addend
7602         twice for R_PARISC_GPREL64.  Use bfd_put_32 for R_PARISC_PCREL32,
7603         not bfd_put_64.  Fix minor comment typo and formatting.
7604
7605         Changes to create multiple linker stubs, positioned immediately
7606         before the section where they are required.
7607         * elf32-hppa.c: Don't include hppa_stubs.h.
7608         (elf32_hppa_stub_hash_entry): Add a pointer to the stub section.
7609         (elf32_hppa_stub_hash_table): Delete.
7610         (elf32_hppa_link_hash_entry): Delete.
7611         (elf32_hppa_link_hash_table): Use plain bfd_hash_table for
7612         stub_hash_table, and store the struct here rather than a pointer.
7613         Delete output_symbol_count.  Add offset array.  Change
7614         global_value to a bfd_vma.
7615         (elf32_hppa_stub_hash_lookup): Use table instead of table->root.
7616         (elf32_hppa_stub_hash_traverse): Delete.
7617         (elf32_hppa_name_of_stub): Delete.
7618         (elf32_hppa_link_hash_lookup): Delete.
7619         (elf32_hppa_link_hash_traverse): Delete.
7620         (elf32_hppa_stub_hash_table_init): Delete.
7621         (elf32_hppa_size_of_stub): Pass input section and offset rather
7622         than location and calculate location here.  Don't pass name as all
7623         stubs are now the same size.
7624         (elf32_hppa_stub_hash_newfunc): Init new fields.
7625         (elf32_hppa_link_hash_table_create): Likewise, and stub_hash_table
7626         too.
7627         (elf32_hppa_bfd_final_link_relocate): Cast enums to int before
7628         comparing against ints.  Rewrite stub handling code.
7629         (elf32_hppa_relocate_section): Make r_type and r_symndx unsigned.
7630         Case enums to int before comparing against ints.  Remove
7631         bfd_reloc_dangerous case.
7632         (elf32_hppa_build_one_stub): Rewrite.
7633         (elf32_hppa_size_one_stub): New function.
7634         (elf32_hppa_build_stubs): Rewrite.
7635         (elf32_hppa_size_stubs): Pass in linker call-back functions.
7636         Rewrite stub-handling specific code.
7637
7638         * elf32-hppa.h (elf32_hppa_size_stubs): Update prototype.
7639
7640         * elf64-hppa.c (elf64_hppa_dyn_hash_entry): Fix a comment typo.
7641
7642         * hppa_stubs.h: Delete.
7643         * Makefile.am (SOURCE_HFILES): Remove hppa_stubs.h
7644         (elf32-hppa.lo): Remove hppa_stubs.h from dependencies.
7645         * Makefile.in: Regenerate.
7646
7647         * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): Handle e_nlsel and
7648         e_nlrsel.
7649
7650         * libhppa.h (hppa_field_adjust): Correct e_nsel case.
7651
7652         * elf32-hppa.c (elf32_hppa_relocate_section): Mention the offset
7653         and section name for bfd_reloc_notsupported error message.
7654         (elf32_hppa_bfd_final_link_relocate): Print reasons for returning
7655         bfd_reloc_notsupported.
7656         (elf32_hppa_relocate_section): Add ATTRIBUTE_UNUSED to output_bfd.
7657
7658         * elf32-hppa.c (elf32_hppa_bfd_final_link_relocate): Handle
7659         undefined weak symbols for all relocs.
7660         (elf32_hppa_size_of_stub): Adjust calculation by 8 since branch
7661         offsets are relative to one past the delay slot.
7662         (elf32_hppa_size_stubs): Account for reloc addend when calculating
7663         branch destination.  Put addend into stub name too.
7664         (elf32_hppa_bfd_final_link_relocate): Account for reloc addend and
7665         adjust by 8 when deciding whether a linker stub is needed.  Put
7666         addend into stub name as for above.
7667
7668         * elf32-hppa.c (hppa_elf_relocate_insn): Change signed/unsigned on
7669         various args and vars.
7670         (elf32_hppa_bfd_final_link_relocate): Here too.
7671         (elf32_hppa_size_stubs): Rename index -> indx.  Use e_indx for
7672         inner block var to avoid shadowing.
7673
7674         * elf32-hppa.h (_bfd_elf32_hppa_gen_reloc_type):  Make `field' arg
7675         unsigned.
7676         * elf64-hppa.h (_bfd_elf64_hppa_gen_reloc_type): Ditto.
7677         * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): Ditto.
7678         (elf_hppa_fake_sections): Rename local var to avoid shadowing.
7679
7680         * libhppa.h: Change practically all unsigned ints to plain ints.
7681         Remove tests on gcc version.  Instead use ATTRIBUTE_UNUSED for
7682         prototypes.
7683
7684         From Ryan Bradetich  <rbradetich@uswest.net>
7685         * libhppa.h (hppa_opcode_type): New enum to replace #define's.
7686         * elf32-hppa.c (elf32_hppa_bfd_final_link_relocate): Modify to
7687         suit above.
7688         From  David Huggins-Daines  <dhd@linuxcare.com>
7689         * elf-hppa.h (elf_hppa_relocate_insn): Update the opcode constants
7690         to the new OP_* ones.
7691
7692         * elf32-hppa.c (elf32_hppa_size_stubs): Consolidate freeing on
7693         error exit.  Bail out earlier on plabel relocs that we aren't
7694         interested in.  Don't tell elf32_hppa_stub_hash_lookup to copy
7695         string, and then don't free our copy.
7696         (elf32_hppa_build_one_stub): Make insn unsigned int.
7697
7698         * libhppa.h (bfd_hppa_insn2fmt): 22 bit branches are only
7699         available with BL, not BE and BLE.
7700
7701         * elf32-hppa.c (hppa_elf_relocate_insn): Add some more example
7702         code for elf arg relocs.
7703         (elf32_hppa_bfd_final_link_relocate): Replace boolean is_local
7704         argument with elf_link_hash_entry h.  Handle undefined weak
7705         symbols.  Move $global$ lookup from here...
7706         (elf32_hppa_relocate_section): ...to here.  Return correct error
7707         message for non-handled relocs.
7708         (elf32_hppa_size_of_stub): Correctly test branch range.  Previous
7709         wrong test was -0x3ffff to +0x40000.
7710
7711         * elf-hppa.h (elf_hppa_final_link_relocate): R_PARISC_DIR17R,
7712         R_PARISC_DIR17F, and R_PARISC_DIR21L are for absolute branches;
7713         Handle them as such.
7714         (elf_hppa_relocate_insn): Fix a typo.
7715
7716         * libhppa.h (GET_FIELD, GET_BIT, MASK, CATENATE, ELEVEN): Delete.
7717         (assemble_3, assemble_6, assemble_12, assemble_16, assemble_16a,
7718         assemble_17, assemble_21): Delete.
7719         Supply defines for all 64 possible opcodes.
7720         (bfd_hppa_insn2fmt): Add bfd argument, and use to select wide mode
7721         formats.  Handle COMICLR.
7722         (hppa_rebuild_insn): Delete bfd argument.  Handle formats 10, -11,
7723         -10, -16, 16, 22.
7724
7725         * elf32-hppa.c (hppa_elf_relocate_insn): Complete rewrite.
7726         (elf32_hppa_bfd_final_link_relocate): Major rewrite.
7727         (elf32_hppa_build_one_stub): Modify hppa_elf_relocate_insn calls
7728         to suit.
7729         (elf32_hppa_size_stubs): Don't free stub_name twice.  Read in all
7730         the local syms - did this code get deleted accidentally?  Ignore
7731         undefined and undefweak syms.
7732
7733         * elf-hppa.h (elf_hppa_final_link): Move hppa_info to outermost
7734         block.  Use it instead of elf64_hppa_hash_table (info).
7735         (elf_hppa_final_link_relocate): Use hppa_info instead of
7736         elf64_hppa_hash_table (info).
7737
7738         * libhppa.h (re_assemble_3, re_assemble_12, re_assemble_16,
7739         re_assemble_17, re_assemble_21, re_assemble_22): Don't mask insn.
7740         (hppa_rebuild_insn): Mask immediate bits here instead.
7741         * elf-hppa.h (elf_hppa_relocate_insn): Mask here too.
7742
7743 2000-07-08  Alan Modra  <alan@linuxcare.com.au>
7744
7745         * section.c (struct sec): Add id field.  Tidy comment formatting.
7746         (bfd_make_section_anyway): Set id.
7747         (STD_SECTION): Init id too.
7748         Change CONST to const throughout.
7749         * archures.c (bfd_arch_info): Tidy comment.
7750         (bfd_arch_list): Change a CONST to const.
7751         * libbfd-in.h: Tidy comments and replace CONST with const.
7752         * elf-bfd.h: Likewise.
7753         * libbfd.h: Regenerate.
7754         * bfd-in2.h: Regenerate.
7755         * libcoff.h: Regenerate.
7756
7757 2000-07-07  DJ Delorie  <dj@redhat.com>
7758
7759         * archive.c (_bfd_write_archive_contents): Add an informative
7760         comment.
7761
7762 2000-07-06  Kazu Hirata  <kazu@hxi.com>
7763
7764         * srec.c: Fix formatting.
7765
7766 2000-06-05  DJ Delorie  <dj@redhat.com>
7767
7768         * MAINTAINERS: new
7769
7770 2000-07-04  Alexandre Oliva  <aoliva@redhat.com>
7771
7772         * coff-arm.c (coff_arm_relocate_section): Do not ignore the symbol
7773         value of PC-relative offsets.
7774
7775 2000-07-03  Jim Wilson  <wilson@cygnus.com>
7776
7777         * elf64-alpha.c (alpha_elf_size_info): New.
7778         (elf_backend_size_info): Define to alpha_elf_size_info.
7779         * elfcode.h (elf_size_info): Change hash bucket size to 4.
7780
7781 2000-07-03  Ulf Carlsson  <ulfc@engr.sgi.com>
7782
7783         * elf32-mips.c: Include elf32-target.h again for the traditional
7784         MIPS targets.
7785
7786 2000-07-03  Marek Michalkiewicz  <marekm@linux.org.pl>
7787
7788         * elf32-avr.c (bfd_elf32_bfd_reloc_type_lookup):
7789         Add ATTRIBUTE_UNUSED to unused arguments to avoid warnings.
7790         (avr_info_to_howto_rela): Likewise.
7791         (elf32_avr_gc_mark_hook): Likewise.
7792         (elf32_avr_gc_sweep_hook): Likewise.
7793         (elf32_avr_relocate_section): Likewise.
7794
7795 2000-07-03  Mark Elbrecht  <snowball3@bigfoot.com>
7796
7797         * cofflink.c (_bfd_coff_write_global_sym): Turn a weak symbol into
7798         an external symbol for a non-shared, non-relocatable link.
7799
7800 2000-07-03  Nick Clifton  <nickc@redhat.com>
7801
7802         * cofflink.c (IS_EXTERNAL): New macro: Return true if the symbol
7803         is an external symbol.
7804         (IS_WEAK_EXTERNAL): New macro: Return true if the symbol is a weak
7805         external symbol.
7806
7807 2000-07-03  Kazu Hirata  <kazu@hxi.com>
7808
7809         * reloc16.c: Fix formatting.
7810
7811 2000-07-01  Koundinya K  <kk@ddeorg.soft.net>
7812
7813         * config.bfd: Change targ_defvec and targ_selvecs for mips*-*-sysv4*
7814         to add a new target for traditional mips i.e
7815         bfd_elf32_tradbigmips_vec and bfd_elf32_tradlittlemips_vec.
7816         * configure.in: Likewise.
7817         * configure: Rebuild.
7818         * targets.c (bfd_elf32_tradbigmips_vec): Declare and put in
7819         bfd_target_vector.
7820         (bfd_elf32_tradlittlemips_vec): Likewise.
7821         * elfxx-target.h: Add macro INCLUDED_TARGET_FILE which is more a test
7822         to see that elfNN_bed does not get redefined even if the target file
7823         is included twice for a chip. See elf32-mips.c.
7824
7825 2000-07-01  Alan Modra  <alan@linuxcare.com.au>
7826
7827         * Makefile.am (DEP): Fix 2000-06-22.  grep after running dep.sed
7828         (CLEANFILES): Add DEPA.
7829         * Makefile.in: Regenerate.
7830
7831 2000-06-30  DJ Delorie  <dj@cygnus.com>
7832
7833         * peicode.h (coff_swap_filehdr_in): can't use e_magic because we
7834         can't assume the PE header is at 0x80.
7835
7836 2000-06-29  Mark Elbrecht  <snowball3@bigfoot.com>
7837
7838         * syms.c (_bfd_stab_section_find_nearest_line): Use IS_ABSOLUTE_PATH.
7839
7840 2000-06-28  Mark Elbrecht  <snowball3@bigfoot.com>
7841
7842         * go32stub.h: Update stub.
7843
7844 2000-06-26  Marek Michalkiewicz  <marekm@linux.org.pl>
7845
7846         * archures.c (bfd_mach_avr5): Define.
7847         * bfd-in2.h (bfd_mach_avr5): Define.
7848         * cpu-avr.c (arch_info_struct): Rename bfd_mach_avr4 to
7849         bfd_mach_avr5, add bfd_mach_avr4.  Update comments.
7850         (compatible): Update comment.  Add missing test.
7851         * elf32-avr.c (avr_final_link_relocate): Support 8K wrap
7852         for avr2 and avr4.  Simplify 8K wrap code.
7853         (bfd_elf_avr_final_write_processing): Recognize bfd_mach_avr5.
7854         (elf32_avr_object_p): Recognize E_AVR_MACH_AVR5.
7855
7856 2000-06-26  Kazu Hirata  <kazu@hxi.com>
7857
7858         * coff-h8300.c: Fix formatting.
7859         * cpu-h8300.c: Likewise.
7860
7861 2000-06-24  Alexandre Oliva  <aoliva@redhat.com>
7862
7863         * elf32-arm.h (elf32_arm_final_link_relocate): Print `(local)'
7864         for local symbols whose names are unknown.
7865
7866 2000-06-22  Alan Modra  <alan@linuxcare.com.au>
7867
7868         * Makefile.am (DEP): grep for leading `/' in DEP1, and fail if we
7869         find one.
7870         * Makefile.in: Regenerate.
7871         * doc/Makefile.in: Regenerate.
7872
7873 2000-06-20  H.J. Lu  <hjl@gnu.org>
7874
7875         * Makefile.am: Rebuild dependency.
7876         * Makefile.in: Rebuild.
7877
7878 2000-06-20  Maciej W. Rozycki  <macro@ds2.pg.gda.pl>
7879
7880         * elf32-mips.c (_bfd_mips_elf_copy_indirect_symbol): New function.
7881         (elf_backend_copy_indirect_symbol): Map to the new function.
7882
7883 2000-06-20  Alan Modra  <alan@linuxcare.com.au>
7884
7885         * archive.c (normalize): Correct pointer comparison when checking
7886         for backslashes.
7887         (bfd_bsd_truncate_arname): Likewise.
7888         (bfd_gnu_truncate_arname): Likewise.
7889
7890 2000-06-20  Ulf Carlsson  <ulfc@engr.sgi.com>
7891
7892         * elf-bfd.h (struct elf_obj_tdata): Define per BFD Irix 5 virtual
7893         sections elf_{text,data}_{section,symbol}.
7894         * elf32-mips.c: mips_elf_{text,data}_{section,symbol}{,_ptr}: Remove.
7895         (_bfd_mips_elf_hide_symbol): New function.
7896         (elf_backend_hide_symbol): Map to the new function.
7897         (_bfd_mips_elf_add_symbol_hook): Change to use new per BFD
7898         definitions of mips_elf_{text,data}_{section,symbol}.
7899         (mips_elf_local_relocation_p): Try to find the direct symbol
7900         based on new check_forced argument.
7901         (mips_elf_calculate_relocation): Use new version of
7902         mips_elf_local_relocation_p.
7903         (mips_elf_relocate_section): Likewise.
7904         (_bfd_mips_elf_relocate_section): Likewise.
7905         (mips_elf_sort_hash_table): Only assert that have enough GOT
7906         space.
7907         (mips_elf_got16_entry): Match all 32 bits to the existing GOT
7908         entry if the relocation based on the new external argument.
7909         (mips_elf_create_dynamic_relocation): Assert that we have a
7910         section contents allocated where we can swap out the dynamic
7911         relocations.
7912         (mips_elf_calculate_relocation): Find the real hash-table entry
7913         correctly by using h->root.root.type.  Only create a dynamic
7914         relocation entry if the symbol is defined in a shared library.
7915         Create an external GOT entry for the GOT16 relocation if the
7916         symbol was forced local.
7917         (_bfd_mips_elf_finish_dynamic_symbol): Don't assert there is a
7918         dynamic index if the symbol was forced local.
7919
7920 2000-06-20  Maciej W. Rozycki  <macro@ds2.pg.gda.pl>
7921
7922         * elf32-mips.c: Fix typos in comments.
7923
7924 2000-06-19  Mark Kettenis  <kettenis@gnu.org>
7925
7926         * rs6000-core.c: Wrap definition of `union VmInfo' within #ifdef
7927         CORE_VERSION_1.
7928
7929 2000-06-18  Stephane Carrez  <stcarrez@worldnet.fr>
7930
7931         * Makefile.in, bfd-in2.h, libbfd.h, configure: Rebuild.
7932         * Makefile.am (ALL_MACHINES, ALL_MACHINES_CFILES, BFD32_BACKENDS,
7933         BFD32_BACKENDS_CFILES): Add 68hc12, 68hc11 files.
7934         * configure.in (bfd_elf32_m68hc12_vec): Recognize.
7935         (bfd_elf32_m68hc11_vec): Likewise.
7936         * config.bfd (targ_cpu): Recognize 68hc12 and 68hc11.
7937         Supports 68hc11 & 68hc12  at the same time.
7938         * targets.c (bfd_elf32_m68hc12_vec): Declare and put in
7939         bfd_target_vector.
7940         (bfd_elf32_m68hc11_vec): Likewise.
7941         * elf.c (prep_headers): Recognize bfd_arch_m68hc12 and 68hc11.
7942         * archures.c (bfd_m68hc12_arch): Define and register in global list
7943         (bfd_m68hc11_arch): Likewise.
7944         * reloc.c (BFD_RELOC_M68HC11_HI8, BFD_RELOC_M68HC11_LO8,
7945         BFD_RELOC_M68HC11_3B): Define.
7946         * cpu-m68hc12.c, elf32-m68hc12.c: New files for 68hc12 support.
7947         * cpu-m68hc11.c, elf32-m68hc11.c: New files for 68hc11 support.
7948
7949 2000-06-18  Ulf Carlsson  <ulfc@engr.sgi.com>
7950
7951         * elf_bfd.h (struct elf_backend_data): Add info argument to
7952         elf_backend_hide_symbol.
7953         (_bfd_elf_link_hash_hide_symbol): Likewise.
7954         * elf.c (_bfd_elf_link_hash_hide_symbol): Likewise.
7955         * elf64-ia64.c (elf64_ia64_hash_hide_symbol): Likewise.
7956         * elflink.h (elf_link_add_object_symbols): Likewise.
7957         (elf_link_assign_sym_version): Likewise.
7958
7959 2000-06-18  H.J. Lu  <hjl@gnu.org>
7960
7961         * coff-i386.c (coff_i386_reloc): Don't return in case of
7962         output_bfd == (bfd *) NULL if COFF_WITH_PE is defined.
7963         Compensate PE relocations when linking with non-PE object
7964         files to generate a non-PE executable.
7965
7966 2000-06-17  Ulf Carlsson  <ulfc@engr.sgi.com>
7967
7968         * elf32-mips.c (mips_elf_calculate_relocation): Explicitly write
7969         GOT entries if we're doing a static link or -Bsymbolic link.
7970
7971 2000-06-15  Ulf Carlsson  <ulfc@engr.sgi.com>
7972
7973         * elflink.h (elf_link_adjust_relocs): Check for and call backend
7974         specifific swap_reloc_{in,out} and swap_reloca_{in,out} if
7975         available.
7976         (elf_link_output_relocs): Likewise.
7977         (elf_reloc_link_order): Likewise.
7978
7979 2000-06-16  Nicholas Duffek  <nsd@redhat.com>
7980
7981         * archures.c (enum bfd_architecture): #define constants for
7982         PowerPc and RS6000 machine numbers.
7983         * bfd-in2.h: Regenerate.
7984         * coffcode.h (coff_set_arch_mach_hook): #ifdef XCOFF64, set arch
7985         to bfd_arch_powerpc instead of bfd_arch_rs6000.  Refer to PowerPc
7986         and RS6000 machine numbers using #defined constants from
7987         archures.c.
7988         * cpu-powerpc.c (arch_info_struct): Refer to PowerPc and RS6000
7989         machine numbers using #defined constants from archures.c.  Add
7990         entries for EC603e, 630, A35, RS64II, RS64III, 7400.  Specify
7991         64-bit words in 620 entry.
7992         * cpu-rs6000.c (arch_info_struct): Create with entries for RS1,
7993         RSC, and RS2.
7994         (bfd_rs6000_arch): Change default machine to 0 (bfd_mach_rs6k).
7995
7996 2000-06-16  Nicholas Duffek  <nsd@cygnus.com>
7997
7998         * coffcode.h (coff_mkobject_hook): Set xcoff_tdata.xcoff64.
7999         * libcoff-in.h (struct xcoff_tdata): Define xcoff64 field.
8000         * libcoff.h (struct xcoff_tdata): Define xcoff64 field.
8001
8002 2000-06-16  Nicholas Duffek  <nsd@redhat.com>
8003
8004         * bfd-in.h (bfd_family_coff): Define.
8005         * bfd-in2.h: Regenerate.
8006         * coffgen.c (coff_count_linenumbers, coff_symbol_from,
8007         coff_find_nearest_line): Check COFFness using bfd_family_coff()
8008         instead of bfd_target_coff_flavour.
8009         * cofflink.c (_bfd_coff_final_link): Likewise.
8010         * cpu-ns32k.c (do_ns32k_reloc): Don't strcmp() target name to
8011         exclude XCOFF files.
8012         * reloc.c (bfd_perform_relocation, bfd_install_relocation):
8013         Likewise.
8014         * targets.c (enum bfd_flavour): Add bfd_target_xcoff_flavour.
8015         * xcoff-target.h (TARGET_SYM): Use bfd_target_xcoff_flavour.
8016         * xcofflink.c (XCOFF_XVECP): Delete.
8017         (bfd_xcoff_link_record_set, bfd_xcoff_import_symbol,
8018         bfd_xcoff_export_symbol, bfd_xcoff_link_count_reloc,
8019         bfd_xcoff_record_link_assignment,
8020         bfd_xcoff_size_dynamic_sections): Replace XCOFF_XVECP() with
8021         check for bfd_target_xcoff_flavour.
8022
8023 2000-06-16  Nicholas Duffek  <nsd@redhat.com>
8024
8025         * rs6000-core.c: Support 64-bit core files, support pre-4.3 core
8026         files on AIX 4.3.
8027         (read_hdr): New function.
8028         (rs6000coff_core_p): Store mstsave or __context64 struct instead
8029         of trying to extract individual registers.  Set abfd->arch_info
8030         to match the architecture that created the core file.
8031         (rs6000coff_get_section_contents): Delete.
8032         * xcoff-target.h (rs6000coff_get_section_contents): Delete.
8033
8034 2000-06-14  H.J. Lu  <hjl@gnu.org>
8035
8036         * vms-misc.c (_bfd_vms_next_record): Return -1 if PRIV(vms_rec)
8037         is NULL.
8038
8039 2000-06-13  H.J. Lu  <hjl@gnu.org>
8040
8041         * configure: Regenerate.
8042
8043 2000-06-13  J"orn Rennecke <amylaar@cygnus.co.uk>
8044
8045         * peicode.h (pe_ILF_object_p): Use TARGET_LITTLE_SYM instead of
8046         armpei_little_vec.
8047
8048 2000-06-08  David O'Brien  <obrien@FreeBSD.org>
8049
8050         * configure.in (VERSION): Update to show this is the CVS mainline.
8051
8052 2000-06-07  Alan Modra  <alan@linuxcare.com.au>
8053
8054         * elf32-d10v.c: Include elf/d10v.h
8055         (enum reloc_type): Delete.
8056         * elf32-d30v.c: Include elf/d30v.h
8057         (enum reloc_type): Delete.
8058
8059         * Makefile.am: Run "make dep-am" to regenerate dependencies.
8060         * Makefile.in: Regenerate.
8061
8062         * elf32-i386.c (elf_howto_table): Remove EMPTY_HOWTOs.
8063         (elf32_i386_vtinherit_howto, elf32_i386_vtentry_howto): Delete and
8064         move HOWTOs into elf_howto_table.
8065         (R_386_standard, R_386_ext_offset): Define.
8066         (R_386_ext, R_386_vt_offset, R_386_vt): Define.
8067         (elf_i386_reloc_type_lookup): Modify calculation of index into
8068         elf_howto_table since we've removed the padding.
8069         (elf_i386_info_to_howto_rel): Likewise.
8070         (elf_i386_relocate_section): Likewise.
8071
8072 2000-06-06  Michael Snyder  <msnyder@seadog.cygnus.com>
8073
8074         * elf.c (elf_grok_pr_status): Eliminate reference to prgregset_t.
8075
8076 2000-06-05  H.J. Lu  <hjl@gnu.org>
8077
8078         * elflink.c (_bfd_elf_link_record_dynamic_symbol): Don't flag
8079         an error when seeing an undefined symbol with hidden/internal
8080         attribute. It is handled in *_relocate_section ().
8081
8082 2000-06-05  H.J. Lu  <hjl@gnu.org>
8083
8084         * elflink.h (elf_fix_symbol_flags): Follow the link for the
8085         indirect symbol for the ELF_LINK_NON_ELF bit.
8086         (elf_link_output_extsym): Don't output the indirect symbol even
8087         if the ELF_LINK_NON_ELF bit is set.
8088
8089 2000-06-01  J.T. Conklin  <jtc@redback.com>
8090
8091         * config.bfd (i[3456]86-*-netbsdelf*): New target.
8092         (i[3456]86-*-netbsdaout*): New target.
8093         (i[3456]86-*-netbsd*): Add bfd_elf32_i386_vec to targ_selvecs.
8094         (i[3456]86-*-openbsd*): Likewise.
8095
8096 2000-05-30  Andrew Cagney  <cagney@b1.cygnus.com>
8097
8098         * trad-core.c: From hpux-core.c, include <dirent.h> or
8099         <sys/ndir.h> when possible.
8100
8101 2000-05-31  Ulrich Drepper  <drepper@redhat.com>
8102
8103         * elf.c (_bfd_elf_slurp_version_tables): Correct reading of version
8104         definitions.  We must not assume they are sorted in the file
8105         according to their index numbers.
8106
8107 2000-05-31  Alan Modra  <alan@linuxcare.com.au>
8108
8109         * elf-hppa.h: (elf_hppa_final_link_relocate): Use e_rsel field
8110         selector for R_PARISC_PCREL17R.  R_PARISC_DIR17R and
8111         R_PARISC_DIR17F are for absolute branches; Handle them as such.
8112
8113 2000-05-30  Nick Clifton  <nickc@cygnus.com>
8114
8115         * cpu-i960.c (scan_960_mach): Accept 80960KA, 80960KB,
8116         80960CA, 80960MC as valid machine names.
8117
8118 2000-05-30  H.J. Lu  <hjl@gnu.org>
8119
8120         * elflink.c (_bfd_elf_link_record_dynamic_symbol): Clear the
8121         visibility bits if the symbol is undefined. Correctly handle
8122         weak undefined symbols with hidden and internal attributes.
8123
8124         * elflink.h (elf_link_add_object_symbols): Always turn the
8125         symbol into local if it has the hidden or internal attribute.
8126
8127 2000-05-29  Philip Blundell  <philb@gnu.org>
8128
8129         * ppcboot.c:  Add packed attribute if compiling with GCC.
8130
8131 2000-05-29  Anatoly Vorobey  <mellon@pobox.com>
8132
8133         * elf.c (_bfd_elf_link_hash_table_init): Initialize dynlocal.
8134
8135 2000-05-26  Michael Snyder  <msnyder@seadog.cygnus.com>
8136
8137         * elf.c (elfcore_grok_prstatus, elfcore_grok_pstatus,
8138         elfcore_grok_psinfo): Add code to allow debugging a 32-bit
8139         corefile on a 64-bit (Sparc Solaris) host.  Also clean up
8140         a few old comments.
8141
8142 2000-05-26  Alan Modra  <alan@linuxcare.com.au>
8143
8144         * Makefile.am: Update dependencies with "make dep-am"
8145         * Makefile.in: Regenerate.
8146
8147         * sysdep.h (gettext, dgettext, dcgettext, textdomain,
8148         bindtextdomain): Replace defines with those from intl/libgettext.h
8149         to quieten gcc warnings.
8150
8151 2000-05-26  Eli Zaretskii  <eliz@is.elta.co.il>
8152
8153         * aoutx.h (find_nearest_line): Use IS_ABSOLUTE_PATH.
8154
8155         * archive.c (normalize, bfd_bsd_truncate_arname,
8156         bfd_gnu_truncate_arname) [HAVE_DOS_BASED_FILE_SYSTEM]: Support
8157         file names with backslashes.
8158
8159         * cache.c (bfd_open_file) [__MSDOS__]: Don't unlink the file
8160         before opening it.
8161
8162         * sysdep.h: Include filenames.h.
8163
8164 2000-05-26  Alan Modra  <alan@linuxcare.com.au>
8165
8166         * opncls.c (bfd_close_all_done): Mask file perms with 0777 not 0x777.
8167
8168 2000-05-26  Jakub Jelinek  <jakub@redhat.com>
8169
8170         * elf64-sparc.c (sparc64_elf_relax_section): New.
8171         (sparc64_elf_relocate_section): Optimize tail call into branch always
8172         if possible.
8173         * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
8174         (elf32_sparc_relax_section): New.
8175
8176 2000-05-26  Jakub Jelinek  <jakub@redhat.com>
8177
8178         * elf64-sparc.c: Add ATTRIBUTE_UNUSED to unused function parameters.
8179         Remove unusued variables.
8180         (sparc64_elf_relocate_section): Change r_symndx type to unsigned long.
8181         (sparc64_elf_merge_private_bfd_data): Fix shared library case from
8182         previous fix, so that shared libs really don't influence targets
8183         extension mask and memory model.
8184
8185 2000-05-23  H.J. Lu  <hjl@gnu.org>
8186
8187         * elf64-alpha.c (elf64_alpha_relocate_section): Check
8188         h->root.other not h->other.
8189         * elf32-mips.c (mips_elf_calculate_relocation): Likewise.
8190
8191         * elf32-ppc.c (ppc_elf_relocate_section): Fix a typo.
8192
8193 2000-05-23  H.J. Lu  <hjl@gnu.org>
8194
8195         * elf32-i386.c (elf_i386_relocate_section): Don't allow the
8196         undefined symbol with the non-default visibility attributes.
8197         * elf-hppa.h (elf_hppa_relocate_section): Likewise.
8198         * elf32-arm.h (elf32_arm_relocate_section): Likewise.
8199         * elf32-i370.c (i370_elf_relocate_section): Likewise.
8200         * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
8201         * elf32-mcore.c (mcore_elf_relocate_section): Likewise.
8202         * elf32-mips.c (mips_elf_calculate_relocation): Likewise.
8203         * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
8204         * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
8205         * elf64-alpha.c (elf64_alpha_relocate_section): Likewise.
8206         * elf64-ia64.c (elf64_ia64_relocate_section): Likewise.
8207         * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
8208
8209 2000-05-22  Richard Henderson  <rth@cygnus.com>
8210
8211         * elf64-ia64.c (ia64_howto_table): Add PCREL60B, PCREL21BI,
8212         PCREL22, PCREL64I.  Zero size of special relocs.
8213         (elf64_ia64_reloc_type_lookup): Likewise.
8214         (USE_BRL, oor_brl, oor_ip): New.
8215         (elf64_ia64_relax_section): New.
8216         (elf64_ia64_check_relocs): Handle PCREL60B, PCREL22, PCREL64I.
8217         (elf64_ia64_install_value): Likewise, plus PCREL21BI.
8218         (elf64_ia64_relocate_section): Likewise.
8219         (bfd_elf64_bfd_relax_section): New.
8220         * reloc.c (BFD_RELOC_IA64_PCREL21BI): New.
8221         (BFD_RELOC_IA64_{PCREL22,PCREL60B,PCREL64I}): New.
8222         * bfd-in2.h, libbfd.h: Regenerate.
8223
8224 2000-05-22  Nick Clifton  <nickc@cygnus.com>
8225
8226         * configure.in : Add peigen.lo to MIPS PE targets.
8227         * configure: Regenerate.
8228
8229 2000-05-22  Momchil Velikov  <velco@fadata.bg>
8230
8231         * libbfd.c (_bfd_generic_verify_endian_match): Compare endianess
8232         only if it is known for both input and output bfds. Separate
8233         error message strings as in some languages, it may be necessary
8234         to change more than one place in the string to change between
8235         'big' and 'little'.
8236
8237         * elf32-ppc.c (ppc_elf_merge_private_bfd_data): Remove inline
8238         endianess checks, call _bfd_generic_verify_endian_match() instead.
8239
8240         * elf32-mips.c (_bfd_mips_elf_merge_private_bfd_data): Likewise.
8241
8242         * elf32-mcore.c (mcore_elf_merge_private_bfd_data): Likewise.
8243
8244         * elf32-arm.h (elf32_arm_merge_private_bfd_data): Likewise. Verify
8245         endianess before checking bfd flavours.
8246
8247 2000-05-22  H.J. Lu  <hjl@gnu.org>
8248
8249         * elflink.h (elf_link_output_extsym): Clear the visibility
8250         field for symbols not defined locally.
8251
8252 2000-05-18  Alan Modra  <alan@linuxcare.com.au>
8253
8254         * libhppa.h (re_assemble_3, re_assemble_12, re_assemble_16,
8255         re_assemble_17, re_assemble_21, re_assemble_22): Don't mask insn.
8256         (hppa_rebuild_insn): Mask immediate bits here instead.
8257         * elf-hppa.h (elf_hppa_relocate_insn): Mask here too.
8258
8259 2000-05-18  Momchil Velikov <velco@fadata.bg>
8260
8261         * elflink.h (elf_bfd_final_link, elf_link_input_bfd): When emiting
8262         relocs for an executable, ensure that they are virtual addresses.
8263
8264 2000-05-18  Jeffrey A Law  (law@cygnus.com)
8265
8266         * config.bfd (hppa*64*-*-hpux11*): New target triplet.
8267
8268 2000-05-17  S. Bharadwaj Yadavalli  <sby@scrugs.lkg.dec.com>
8269             Rick Gorton             <gorton@scrugs.lkg.dec.com>
8270
8271         * elflink.h: Add emitrelocations support: when enabled, relocation
8272         information and relocation sections are put into final output
8273         executables.  If the emitrelocations flag is set, do the following:
8274         (elf_bfd_final_link): Emit relocation sections.
8275         (elf_link_input_bfd): Compute relocation section contents.
8276         (elf_gc_sections): Don't clean relocation sections.
8277
8278 2000-05-16  Catherine Moore  <clm@cygnus.com>
8279
8280         * som.c (som_decode_symclass):  Recognize weak symbols.
8281
8282 2000-05-16  Szabolcs Szakacsits <szaka@F-Secure.com>
8283
8284         * peigen.c (pe_print_idata): Undo part of 2000-05-12 change that
8285         read idata section only from dataoff.
8286         (pe_print_edata): Correctly check for valid eat_member.
8287
8288 2000-05-16  J"orn Rennecke <amylaar@cygnus.co.uk>
8289
8290         * elf32-sh.c (sh_elf_relax_delete_bytes): Handle R_SH_SWITCH8.
8291
8292 2000-05-14  Philip Blundell  <philb@gnu.org>
8293
8294         * config.bfd (armeb-*-elf, arm*b-*-linux-gnu*): New targets.
8295
8296 2000-05-12  Alan Modra  <alan@linuxcare.com.au>
8297
8298         * targets.c (bfd_target_vector): #ifdef BFD64 rs6000coff64_vec
8299
8300         * peigen.c (pe_print_idata): Look for .idata section and print
8301         info even if data directory has zero entries.  Read idata section
8302         starting from dataoff, and adjust all data offsets to suit.  Cast
8303         all bfd_vma vars to unsigned long before passing to fprintf.
8304         * peigen.c (pe_print_edata): Similarly, look for .edata section
8305         and print info even if data directory has zero entries.  Cast
8306         all bfd_vma vars to unsigned long before passing to fprintf.
8307
8308         From Szabolcs Szakacsits <szaka@F-Secure.com>
8309         * peigen.c (pe_print_idata): Use bfd_section_size rather than data
8310         directory size which may be bogus.
8311         * peigen.c (pe_print_edata): Similarly.
8312
8313 2000-05-09  Alan Modra  <alan@linuxcare.com.au>
8314
8315         * elf.c (bfd_section_from_shdr): Don't set use_rela_p if rela
8316         section is empty.
8317         (copy_private_bfd_data): Allow for space possibly taken up by elf
8318         headers when calculating segment physical address from lma.
8319
8320 2000-05-08  Alan Modra  <alan@linuxcare.com.au>
8321
8322         * versados.c (versados_scan): Init stringlen and pass_2_done.
8323
8324         * trad-core.c (trad_unix_core_file_p): Return
8325         bfd_error_wrong_format rather than bfd_error_file_truncated.
8326
8327         * peigen.c (_bfd_pei_swap_aouthdr_out): Pass ImageBase to
8328         add_data_entry.  DataDirectory virtual address is relative.
8329         (pe_print_idata): Account for relative DataDirectory virtual
8330         addresses.  Don't trash datasize inside POWERPC_LE_PE code.
8331         (pe_print_edata): Similarly.
8332
8333         From Szabolcs Szakacsits <szaka@F-Secure.com>
8334         * peigen.c (dir_names): Add Delay Import Directory.
8335         (pe_print_idata):  Always search for bfd section containing
8336         idata address rather than looking up section name.  Print this
8337         section name rather than .idata.
8338         (pe_print_edata): Similarly.  Also print some fields as %08lx.
8339         (_bfd_pe_print_private_bfd_data_common): Print Reserved1 field as
8340         Win32Version.
8341
8342 2000-05-05  Clinton Popetz  <cpopetz@cygnus.com>
8343
8344         * xcoff.h: Rename to xcoff-target.h
8345         * Makefile.am: Change all instances of xcoff.h to xcoff-target.h
8346         * coff-rs6000.c: Ditto.
8347         * coff64-rs6000.c: Ditto.
8348         * coff-pmac.c: Ditto.
8349         * Makefile.in: Regenerate.
8350
8351 2000-05-05  Clinton Popetz  <cpopetz@cygnus.com>
8352
8353         * coffcode.h (coff_set_arch_mach_hook, coff_set_flags):
8354         Change U802TOC64MAGIC to U803XTOCMAGIC.
8355
8356 2000-05-04  Michael Snyder  <msnyder@seadog.cygnus.com>
8357
8358         * elf.c (bfd_elf_get_arch_size): New function, return 32 | 64 | -1.
8359         * bfd-in.h: Prototype bfd_elf_get_arch_size.
8360         * bfd-in2.h: Prototype bfd_elf_get_arch_size.
8361
8362 2000-05-04  Alan Modra  <alan@linuxcare.com.au>
8363
8364         * libhppa.h (HPPA_R_CONSTANT): Cast argument to bfd_signed_vma.
8365
8366 2000-05-03  Martin v. L\81öwis  <loewis@informatik.hu-berlin.de>
8367
8368         * elflink.h (elf_link_add_object_symbols): Reset dynindx for
8369         hidden and internal symbols.
8370         (elf_fix_symbol_flags): Clear NEEDS_PLT for symbols with
8371         visibility.
8372         * elflink.c (_bfd_elf_link_record_dynamic_symbol): Do not
8373         assign a PLT or GOT entry to symbols with hidden and
8374         internal visibility.
8375
8376 2000-05-03  Mark Elbrecht  <snowball3@bigfoot.com>
8377
8378         * coff-go32.c (COFF_SECTION_ALIGNMENT_ENTRIES): Add entry for
8379         the .bss section.
8380         * coff-stgo32.c (COFF_SECTION_ALIGNMENT_ENTRIES): Likewise.
8381
8382 2000-05-02  H.J. Lu  <hjl@gnu.org>
8383
8384         * elf.c (prep_headers): Use ELFOSABI_NONE instead of
8385         ELFOSABI_SYSV.
8386
8387 2000-05-02  Alan Modra  <alan@linuxcare.com.au>
8388
8389         * targets.c (bfd_target_vector): Restore bfd_elf32_hppa_vec.
8390         * Makefile.am (BFD32_BACKENDS): Restore elf32-hppa.lo.  Regenerate
8391         dependencies.
8392         * Makefile.in: Regenerate.
8393
8394 2000-05-01  Jim Wilson  <wilson@cygnus.com>
8395
8396         * Makefile.am (BFD32_BACKENDS): Add efi-app-ia32.lo.
8397         (BFD32_BACKENDS_CFILES): Add efi-app-ia32.c.
8398         (BFD64_BACKENDS): Delete coff-ia64.lo.  Add efi-app-ia64.lo.
8399         (BFD64_BACKENDS_CFILES): Delete coff-ia64.c.  Add efi-app-ia64.c.
8400         * Makefile.in: Rebuild.
8401
8402 2000-05-02  Alan Modra  <alan@linuxcare.com.au>
8403
8404         * config.bfd: Re-enable elf32-hppa.  It now compiles, even if it
8405         doesn't work very well.
8406
8407         * elf-hppa.h (elf_hppa_internal_shdr): Define.
8408         (elf_hppa_fake_sections): hdr is elf_hppa_internal_shdr.
8409         Set hdr->s_type to 1 if ARCH_SIZE == 32.
8410         (_bfd_elf_hppa_gen_reloc_type): Add prototype.
8411         (elf_hppa_info_to_howto): Likewise.
8412         (elf_hppa_info_to_howto_rel): Likewise.
8413         (elf_hppa_reloc_type_lookup): Likewise.
8414         (elf_hppa_is_local_label_name): Likewise.
8415         (elf_hppa_fake_sections): Likewise.
8416         (elf_hppa_final_write_processing): Likewise.
8417         (elf_hppa_howto_table): Fully initialise all entries.
8418         (_bfd_elf_hppa_gen_reloc_type): Add ATTRIBUTE_UNUSED to args.
8419         (elf_hppa_info_to_howto): Likewise.
8420         (elf_hppa_info_to_howto_rel): Likewise.
8421         (elf_hppa_reloc_type_lookup): Likewise.
8422         (elf_hppa_final_write_processing, elf_hppa_add_symbol_hook,
8423         elf_hppa_unmark_useless_dynamic_symbols,
8424         elf_hppa_remark_useless_dynamic_symbols,
8425         elf_hppa_record_segment_addrs, elf_hppa_final_link,
8426         elf_hppa_relocate_section, elf_hppa_final_link_relocate,
8427         elf_hppa_relocate_insn): Compile only if ARCH_SIZE == 64 until
8428         elf32-hppa.c mess is cleaned up.
8429         (elf_hppa_final_link_relocate): Make insn and r_type unsigned
8430         int.  Delete r_field.  In case R_PARISC_PCREL21L, don't set
8431         r_field then call hppa_field_adjust inline func with variable
8432         r_field arg, instead call hppa_field_adjust with fixed arg.
8433         In case R_PARISC_PCREL22F, don't set r_field.
8434         (elf_hppa_relocate_insn): Change args and return type to unsigned
8435         int.  Call re_assemble_* funcs to do the work.
8436
8437         * elf32-hppa.c (hppa_elf_relocate_insn): Don't assume 32 bit when
8438         sign extending.
8439
8440         * libhppa.h (HPPA_R_CONSTANT): Don't assume 32 bit when sign
8441         extending.
8442         (sign_extend): Mask first before sign extending.
8443         (low_sign_extend): Rewrite without condition expression.
8444         (ones, dis_assemble_3, dis_assemble_12, dis_assemble_16,
8445         dis_assemble_17, dis_assemble_21, dis_assemble_22): Delete.
8446         (assemble_3, assemble_6, assemble_12, assemble_16, assemble_16a,
8447         assemble_17, assemble_21, sign_unext, low_sign_unext): Return
8448         result as function return value rather than through pointer arg.
8449         Accept unsigned int args, and return unsigned int.
8450         (re_assemble_3): New.  Combines function of dis_assemble_3 with
8451         re-assembly of opcode and immediate.
8452         (re_assemble_12): Likewise.
8453         (re_assemble_16): Likewise.
8454         (re_assemble_17): Likewise.
8455         (re_assemble_21): Likewise.
8456         (re_assemble_22): Likewise.
8457         (hppa_field_adjust): Rewrite and document, paying attention to
8458         size of types and signed/unsigned issues.
8459         (get_opcode): Shift before masking.
8460         (FDLW): Rename to FLDW.
8461         (bfd_hppa_insn2fmt): Change arg to unsigned int.  Delete fmt.
8462         (hppa_rebuild_insn): Change args and return value to unsigned
8463         int.  Make use of re_assemble_*.  Correct case 11.
8464
8465         * dep-in.sed: Handle ../opcodes/.
8466         * Makefile.am (SOURCE_HFILES): Add elf-hppa.h, elf32-hppa.h,
8467         elf64-hppa.h, hppa_stubs.h, xcoff.h.
8468         (BFD32_BACKENDS_CFILES): Restore elf32-hppa.c.
8469         Remove elf64-hppa.lo, cpu-ia64.lo, elf64-ia64.lo, elfarm-oabi.lo,
8470         elfarm-nabi.lo dependencies outside of auto-dependency area.
8471         Regenerate dependencies.
8472         * Makefile.in: Regenerate.
8473
8474         * configure.in (TRAD_HEADER): Test non-null before
8475         AC_DEFINE_UNQUOTED.
8476         * configure: Regenerate.
8477
8478         * reloc.c: Fix mis-spelling in comment.
8479
8480 2000-05-01  Alan Modra  <alan@linuxcare.com.au>
8481
8482         * coff-sh.c (bfd_coff_small_swap_table): Fix Fri Apr 28 change.
8483         * vms.c (vms_openr_next_archived_file): Return NULL.
8484
8485 2000-04-28  Clinton Popetz  <cpopetz@cygnus.com>
8486
8487         * coffcode.h Copy changes mistakenly done to libcoff.h in
8488         4/24/2000 patch.
8489
8490 2000-04-29  Andreas Jaeger  <aj@suse.de>
8491
8492         * libbfd-in.h: Correctly check GCC version.
8493         * bfd-in.h: Likewise.
8494         * libhppa.h: Likewise.
8495         * libbfd.h: Regenerate.
8496         * bfd-in2.h: Regenerate.
8497
8498 2000-04-28  Clinton Popetz  <cpopetz@cygnus.com>
8499
8500         * Makefile.am (BFD64_BACKENDS, BFD64_BACKENDS_CFILES): Add
8501         coffdu-rs6000.{lo,c}.
8502         (coff-pmac.lo, coff-rs6000.lo, coff64-rs6000.lo): Add dependency
8503         on xcoff.h
8504         * Makefile.in: Regenerate.
8505         * xcoff.h: New file.
8506         * coff-pmac.c: Use xcoff.h instead of coff-rs6000.c.
8507         * coff-rs6000.c: Move all declarations and defines that are
8508         common to the xcoff backends into xcoff.h
8509         * coff64-rs6000.c: Ditto,
8510
8511 2000-04-28  Clinton Popetz  <cpopetz@cygnus.com>
8512
8513         * coff-mips.c (mips_ecoff_backend_data):  Add initialization of
8514         _bfd_coff_force_symnames in strings and
8515         _bfd_coff_debug_string_prefix_length to their default values.
8516         * coff-sh.c: (bfd_coff_small_swap_table): Ditto.
8517
8518 2000-04-28  Clinton Popetz  <cpopetz@cygnus.com>
8519
8520         * coff-alpha.c (alpha_ecoff_backend_data): Add initialization of
8521         _bfd_coff_force_symnames in strings and
8522         _bfd_coff_debug_string_prefix_length to their default values.
8523
8524 2000-04-27  Alan Modra  <alan@linuxcare.com.au>
8525
8526         * elf32-m68k.c (elf_m68k_gc_sweep_hook):  Return if dynobj NULL.
8527         Check local_got_refcounts before dereferencing.
8528
8529         * elf32-ppc.c (ppc_elf_relocate_section): Check splt != NULL
8530         before deciding we don't need R_PPC_PLT32 relocation.
8531         (ppc_elf_gc_sweep_hook): Check local_got_refcounts before
8532         dereferencing.
8533
8534         * elflink.h (elf_gc_common_finalize_got_offsets): Fix comment.
8535
8536         * elf32-i386.c (elf_i386_check_relocs): Reference count .got and
8537         .plt entries.
8538         (elf_i386_gc_sweep_hook): Garbage collect .got and .plt entries.
8539         (elf_i386_adjust_dynamic_symbol): Recognize unused .plt entries.
8540         (elf_i386_relocate_section): Allow for .plt to go missing.
8541         (elf_i386_finish_dynamic_symbol): Use same test to decide if we
8542         can use a relative reloc for got as elf_i386_relocate_section.
8543         (bfd_elf32_bfd_final_link): Define to use gc form of final link.
8544
8545 2000-04-26  Clinton Popetz  <cpopetz@cygnus.com>
8546
8547         * config.bfd: Remove extraneous bfd_powerpc_64_arch.
8548
8549 2000-04-24  Clinton Popetz  <cpopetz@cygnus.com>
8550
8551         * Makefile.am (coff64-rs6000.lo): New rule.
8552         * Makefile.in: Regenerate.
8553         * coff-rs6000.c (xcoff_mkobject, xcoff_copy_private_bfd_data,
8554         xcoff_is_local_label_name, xcoff_rtype2howto,
8555         xcoff_reloc_type_lookup, xcoff_slurp_armap, xcoff_archive_p,
8556         xcoff_read_ar_hdr, xcoff_openr_next_archived_file, xcoff_write_armap,
8557         xcoff_write_archive_contents): No longer static, and prefix with _bfd_.
8558         (NO_COFF_SYMBOLS): Define.
8559         (xcoff64_swap_sym_in, xcoff64_swap_sym_out, xcoff64_swap_aux_in,
8560         xcoff64_swap_aux_out): New functions; handle xcoff symbol tables
8561         internally.
8562         (MINUS_ONE): New macro.
8563         (xcoff_howto_tabl, xcoff_reloc_type_lookup): Add 64 bit POS
8564         relocation.
8565         (coff_SWAP_sym_in, coff_SWAP_sym_out, coff_SWAP_aux_in,
8566         coff_SWAP_aux_out): Map to the new functions.
8567         * coff64-rs6000.c: New file.
8568         * libcoff.h (bfd_coff_backend_data): Add new fields
8569         _bfd_coff_force_symnames_in_strings and
8570         _bfd_coff_debug_string_prefix_length.
8571         (bfd_coff_force_symnames_in_strings,
8572         bfd_coff_debug_string_prefix_length): New macros for above fields.
8573         * coffcode.h (coff_set_arch_mach_hook): Handle XCOFF64 magic.
8574         Set machine to 620 for XCOFF64.  Use bfd_coff_swap_sym_in instead
8575         of using coff_swap_sym_in directly.
8576         (FORCE_SYMNAMES_IN_STRINGS): New macro, defined for XCOFF64.
8577         (coff_set_flags) Set magic for XCOFF64.
8578         (coff_compute_section_file_positions): Add symbol name length to
8579         string section length if bfd_coff_debug_string_prefix_length is
8580         true.
8581         (coff_write_object_contents): Don't do reloc overflow for XCOFF64.
8582         (coff_slurp_line_table): Use bfd_coff_swap_lineno_in instead of
8583         using coff_swap_lineno_in directly.
8584         (bfd_coff_backend_data): Add _bfd_coff_force_symnames_in_strings
8585         and _bfd_coff_debug_string_prefix_length fields.
8586         * coffgen.c (coff_fix_symbol_name, coff_write_symbols): Force
8587         symbol names into strings table when
8588         bfd_coff_force_symnames_in_strings is true.
8589         * coffswap.h (MAX_SCNHDR_NRELOC, MAX_SCNHDR_NLNNO, GET_RELOC_VADDR,
8590         SET_RELOC_VADDR): New macros.
8591         (coff_swap_reloc_in, coff_swap_reloc_out): Use above macros.
8592         (coff_swap_aux_in, coff_swap_aux_out): Remove RS6000COFF_C
8593         code.
8594         (coff_swap_aouthdr_in, coff_swap_aouthdr_out): Handle XCOFF64
8595         changes within RS6000COFF_C specific code.
8596         (coff_swap_scnhdr_out): Use PUT_SCNHDR_NLNNO, PUT_SCNHDR_NRELOC,
8597         MAX_SCNHDR_NRELOC, and MAX_SCNHDR_NLNNO.
8598         * reloc.c (bfd_perform_relocation, bfd_install_relocation):
8599         Extend existing hack on target name.
8600         * xcofflink.c (XCOFF_XVECP): Extend existing hack on
8601         target name.
8602         * coff-tic54x.c (ticof): Keep up to date with new fields
8603         in bfd_coff_backend_data.
8604         * config.bfd: Add bfd_powerpc_64_arch to targ_arch and define
8605         targ_selvecs to include rs6000coff64_vec for rs6000.
8606         * configure.in: Add rs6000coff64_vec case.
8607         * cpu-powerpc.c: New bfd_arch_info_type.
8608
8609 2000-04-24  Jeffrey A Law  (law@cygnus.com)
8610
8611         * config.bfd: Only disable elf32-hppa vectors, not all of the
8612         BSD and OSF configuration support.  Provide (disabled) clauses
8613         for PA64 support.
8614         * configure.in: Add clause for PA64 support.
8615         * configure: Rebuilt.
8616
8617         * targets.c (bfd_target_vector): Add bfd_elf64_hppa_vec.
8618         (bfd_elf64_hppa_vec): Declare.
8619
8620         * Makefile.am (BFD64_BACKENDS): Add elf64-hppa.lo
8621         (BFD64_BACKENDS_CFILES): Add elf64-hppa.c
8622         (elf64-hppa.lo): Add dependencies.
8623         * Makefile.in: Rebuilt.
8624
8625         * elf64-hppa.c, elf64-hppa.h: New files with PA64 support.
8626
8627 2000-04-24  Jason Eckhardt  <jle@cygnus.com>
8628
8629         * libhppa.h (dis_assemble_16): New function.
8630         (pa_arch): Added pa20w element.
8631
8632 2000-04-24  Ulrich Drepper  <drepper@cygnus.com>
8633
8634         * elf-bfd.h: Add prototypes for bfd_elf32_write_relocs,
8635         bfd_elf32_slurp_reloc_table, bfd_elf64_write_relocs, and
8636         bfd_elf64_slurp_reloc_table.
8637
8638         * elfcode.h (elf_write_relocs, elf_slurp_reloc_table): New
8639         definitions to get external names.
8640         (elf_write_relocs): Renamed from write_relocs and make global.
8641         (elf_slurp_reloc_table): Make global.
8642         (_bfd_elf,size_info): Use elf_write_relocs instead of write_relocs.
8643
8644         * archive.c (hpux_uid_gid_encode): New function.
8645         (bfd_ar_hdr_from_filesystem): Use it if HPUX_LARGE_AR_IDS is
8646         defined and the ID is greater than 99999.
8647         (bfd_generic_stat_arch_elt): If HPUX_LARGE_AR_IDS is defined decode
8648         special uid/gid fields into 32 bit values.
8649
8650 2000-04-21  Matthew Green  <mrg@cygnus.com>
8651
8652         * config.bfd: Add NetBSD/sparc64 support.
8653
8654 2000-04-21  Richard Henderson  <rth@cygnus.com>
8655             David Mosberger  <davidm@hpl.hp.com>
8656             Timothy Wall <twall@cygnus.com>
8657             Jim Wilson  <wilson@cygnus.com>
8658
8659         * Makefile.am (ALL_MACHINES): Add cpu-ia64.lo.
8660         (ALL_MACHINES_CFILES): Add cpu-ia64.c.
8661         (BFD64_BACKENDS): Add elf64-ia64.lo.
8662         (BFD64_BACKENDS_CFILES): Add elf64-ia64.c.
8663         (cpu-ia64.lo, elf64-ia64.lo): New rules.
8664         * Makefile.in: Rebuild.
8665         * archures.c (enum bfd_architecture): Add bfd_arch_ia64.
8666         (bfd_ia64_arch): Declare.
8667         (bfd_archures_list): Add bfd_ia64_arch.
8668         * bfd-in2.h: Rebuild.
8669         * config.bfd: (ia64*-*-linux-gnu*, ia64*-*-elf*): New targets.
8670         * configure: Rebuild.
8671         * configure.host: (ia64-*-linux*): New host.
8672         * configure.in (bfd_elf64_ia64_little_vec, bfd_elf64_ia64_big_vec,
8673         bfd_efi_app_ia64_vec, bfd_efi_app_ia64_vec): New vectors.
8674         * elf.c (prep_headers): Add bfd_arch_ia64.
8675         * libbfd.h: Rebuild.
8676         * reloc.c: Add IA-64 relocations.
8677         * targets.c (bfd_elf64_ia64_little_vec, bfd_elf64_ia64_big_vec):
8678         Declare.
8679         (bfd_target_vect): Add bfd_elf64_ia64_little_vec.
8680         * cpu-ia64-opc.c, cpu-ia64.c, elf64-ia64.c: New files.
8681
8682 2000-04-21  Richard Henderson  <rth@cygnus.com>
8683
8684         * elf32-d30v.c (bfd_elf_d30v_reloc): Don't modify section
8685         contents when performing a partial link.
8686         (bfd_elf_d30v_reloc_21): Likewise.
8687
8688 2000-04-20  H.J. Lu  <hjl@gnu.org>
8689
8690         * elf32-i386.c (elf_i386_relocate_section): Restrict 1998-12-10
8691         patch to symbols defined by a shared object.
8692         * elf32-ppc.c (ppc_elf_relocate_section): Similarly.
8693
8694 2000-04-19  Michael Sokolov  <msokolov@ivan.Harhan.ORG>
8695
8696         K&R compiler fixes.
8697         * dwarf2.c (concat_filename): Avoid string literal concatenation.
8698         * ieee.c (ieee_get_symtab): Don't initialise union in struct.
8699
8700 2000-04-11  David Mosberger  <davidm@hpl.hp.com>
8701
8702         * Makefile.am (BFD64_BACKENDS): Mention coff-ia64.lo.
8703         (BFD64_BACKENDS_CFILES): Mention coff-ia64.c
8704         (coff-ia64.lo): Add dependency.
8705         * Makefile.in: Regenerate.
8706         * coff-ia64.c: New file.
8707         * efi-app-ia32.c: Ditto.
8708         * efi-app-ia64.c: Ditto.
8709         * coffcode.h (coff_set_arch_mach_hook): Handle IA64MAGIC.
8710         (coff_set_flags): Ditto.
8711         (coff_write_object_contents) [IA64]: Set magic number to ZMAGIC.
8712         * config.bfd (i[3456]86-*-linux-gnu*): Mention bfd_efi_app_ia32_vec.
8713         * configure.in (elf): Handle bfd_efi_app_ia32 and bfd_efi_app_ia64_vec.
8714         * configure: Regenerate.
8715         * libpei.h (GET_OPTHDR_IMAGE_BASE): New macro.
8716         (PUT_OPTHDR_IMAGE_BASE): Ditto.
8717         (GET_OPTHDR_SIZE_OF_STACK_RESERVE): Ditto.
8718         (PUT_OPTHDR_SIZE_OF_STACK_RESERVE): Ditto.
8719         (GET_OPTHDR_SIZE_OF_STACK_COMMIT): Ditto.
8720         (PUT_OPTHDR_SIZE_OF_STACK_COMMIT): Ditto.
8721         (GET_OPTHDR_SIZE_OF_HEAP_RESERVE): Ditto.
8722         (PUT_OPTHDR_SIZE_OF_HEAP_RESERVE): Ditto.
8723         (GET_OPTHDR_SIZE_OF_HEAP_COMMIT): Ditto.
8724         (PUT_OPTHDR_SIZE_OF_HEAP_COMMIT): Ditto.
8725         (GET_PDATA_ENTRY): Ditto.
8726         * peigen.c (_bfd_pei_swap_aouthdr_in) [COFF_WITH_PEP64]: Don't read
8727         data_start.  Use above macros to read fields that are 64 bit wide for
8728         COFF_WITH_PEP64.  Don't truncate entry and text_start to 32 bits.
8729         (_bfd_pei_swap_aouthdr_out) [PEI_FORCE_MINIMUM_ALIGNMENT]: Force
8730         FileAlignment and SectionAlignment to minimum alignment if they
8731         are zero.
8732         (_bfd_pei_swap_aouthdr_out) [PEI_DEFAULT_TARGET_SUBSYSTEM]: Set
8733         Subsystem to default PEI_DEFAULT_TARGET_SUBSYSTEM.
8734         (_bfd_pei_swap_aouthdr_out) [COFF_WITH_PEP64]: Don't set data_start.
8735         Use above macros to write fields that are 64 bit wide for
8736         COFF_WITH_PEP64.
8737         (pe_print_pdata): Set PDATA_ROW_SIZE to 3*8 for COFF_WITH_PEP64,
8738         5*4 otherwise.  This should be right for IA-32 and IA-64, but may
8739         be wrong for platforms.  Use PDATA_ROW_SIZE instead of hardcoded
8740         value of 20 bytes.  Modify printing for COFF_WITH_PEP64 to print
8741         begin address, end address, and unwind info address only.  Use
8742         GET_PDATA_ENTRY() to read .pdata entries.  Use fprintf_vma() to
8743         print addresses.
8744         (tbl): Add SECTION, REL32, RESERVED1, MIPS_JMPADDR16, DIR64, and
8745         HIGH3ADJ relocation names.
8746         (_bfd_pe_print_private_bfd_data): Print Subsystem name in legible form.
8747         * targets.c: Declare bfd_efi_app_ia32_vec and
8748         bfd_efi_app_ia64_vec.
8749         (bfd_target_vector): Mention bfd_efi_app_ia32_vec and
8750         bfd_efi_app_ia64_vec.
8751
8752 2000-04-17  Timothy Wall  <twall@cygnus.com>
8753
8754         * bfd-in2.h: Add prototypes for tic54x load page access.
8755         * bfd-in.h: Regenerate.
8756         * coff-tic54x.c: Add load page functions; allow bfd_arch_unknown
8757         in customized _set_arch_mach function.
8758         * coffcode.h (coff_set_alignment_hook): Set section load page if
8759         the appropriate macro is defined.
8760         (write_object_contents): Read section load page.
8761
8762 2000-04-13  Alan Modra  <alan@linuxcare.com.au>
8763
8764         * elf32-hppa.h: Update copyright date.
8765
8766         * elf32-fr30.c (fr30_elf_i20_reloc): Don't use U suffix.
8767         * elf32-mips.c (_bfd_mips_elf_relocate_section): And here.
8768
8769         * elf32-d30v.c (MAX32): Don't use LL suffix.
8770         (MIN32): Define in terms of MAX32.
8771         (bfd_elf_d30v_reloc): Make relocation a bfd_signed_vma.
8772
8773         * coff-a29k.c (SIGN_EXTEND_HWORD): Replace with more concise
8774         expression.
8775
8776         * peicode.h (pe_ILF_build_a_bfd): Remove UL from hex constants.
8777
8778 2000-04-12  Alan Modra  <alan@linuxcare.com.au>
8779
8780         * dep-in.sed: Match space before file name, not after.
8781         * Makefile.am: Regenerate dependencies.
8782         * Makefile.in: Regenerate.
8783
8784         * reloc.c (_bfd_relocate_contents): In complain_overflow_bitfield
8785         case, allow address wrap-around stupidly removed 2000-03-17.  Sign
8786         extend without an if statement.
8787
8788 2000-04-11  Alan Modra  <alan@linuxcare.com.au>
8789
8790         * coff-mips.c (mips_gprel_reloc): Test for 16 bit range using
8791         signed quantites.
8792         * elf32-mips.c (gprel16_with_gp): Likewise.
8793         * elf32-hppa.c (elf32_hppa_bfd_final_link_relocate): Test range
8794         here using -0x40000, not (int)0xfffc0000.
8795         (elf32_hppa_size_of_stub): Likewise.
8796
8797 2000-04-11  Timothy Wall  <twall@cygnus.com>
8798
8799         * coff-tic54x.c: Now builds with all targets.
8800         * Makefile.am: Add coff/tic54x.h to coff-tic54x.o dependencies.
8801         * Makefile.in: Regenerate.
8802         * coffcode.h (coff_set_arch_mach_hook): Eliminate warning on
8803         unitialized variable.
8804
8805 2000-04-07  Andrew Cagney  <cagney@b1.cygnus.com>
8806
8807         * configure.in (WARN_CFLAGS): Set to -W -Wall by default.  Add
8808         --enable-build-warnings option.
8809         * Makefile.am (AM_CFLAGS, WARN_CFLAGS): Add definitions.
8810         * Makefile.in, configure: Re-generate.
8811
8812 2000-04-07  Nick Clifton  <nickc@cygnus.com>
8813
8814         * reloc.c: Add BFD_RELOC_ARM_PCREL_BLX and
8815         BFD_RELOC_THUMB_PCREL_BLX.
8816
8817         * elf32-arm.h (elf32_arm_final_link_relocate): Handle
8818         R_ARM_XPC25 and R_ARM_THM_PC22.
8819
8820         * elfarm-nabi.c (elf32_arm_howto_): Fix definitions of
8821         R_ARM_XPC25 and R_ARM_THM_XPC22.
8822         (elf32_arm_reloc_map): Make BFD_RELOC_{ARM|THUMB}_PCREL_BLX to
8823         R_ARM_[XPC25|THM_XPC22].
8824
8825         * elfarm-oabi.c: Define OLD_ARM_ABI and change include from
8826         elf/arm-oabi.h to elf/arm.h
8827
8828         * Makefile.am: Fix dependency for elfarm-oabi.c
8829         * Makefile.in: Regenerate.
8830
8831         * bfd-in2.h: Regenerate.
8832         * libbfd.h: Regenerate.
8833
8834 2000-04-06  Michael Snyder  <msnyder@seadog.cygnus.com>
8835
8836         * elfcore.h (elf_core_file_p): preserve value of tdata at entry,
8837         and restore it on failure.  Release newly allocated tdata on
8838         failure.
8839
8840 2000-04-07  Jim Wilson  <wilson@cygnus.com>
8841
8842         * dwarf2.c (struct dwarf2_debug): New field dwarf_line_size.
8843         (decode_line_info): Set it.  Report error if unit->line_offset is
8844         equal to or larger than it.
8845
8846 2000-04-07  Timothy Wall  <twall@cygnus.com>
8847
8848         * targets.c: Added vecs for tic54x.
8849         * reloc.c: Added relocs for tic54x.
8850         * libbfd.h: Regenerated.
8851         * configure: Add TI COFF vecs for tic54x.
8852         * configure.in: Ditto.
8853         * config.bfd (targ_cpu): Recognize new tic54x target.
8854         * coffcode.h (coff_slurp_symbol_table): Additions for TI COFF handling.
8855         * bfd-in2.h: Add tic54x target and relocations.
8856         * Makefile.am, Makefile.in: Add tic54x target.
8857         * archures.c (bfd_archures_list): Add tic54x target.
8858         * coff-tic54x.c: New.
8859         * cpu-tic54x.c: New.
8860
8861 2000-04-06  Michael Snyder  <msnyder@seadog.cygnus.com>
8862
8863         * elfcore.h (elf_core_file_p): call backend_object_p which
8864         thereby gets an opportunity to update the arch/machine type.
8865
8866 2000-04-06  Timothy Wall  <twall@cygnus.com>
8867
8868         * coffcode.h (coff_slurp_symbol_table): Handle C_STATLAB storage
8869         class.  Handle SEC_CLINK and SEC_BLOCK flags.
8870         * section.c: Add SEC_CLINK and SEC_BLOCK flags.
8871         * bfd-in2.h: Add SEC_CLINK and SEC_BLOCK flags.
8872
8873 2000-04-06  Nick Clifton  <nickc@cygnus.com>
8874
8875         * elf32-arm.h (elf32_arm_set_private_flags): Only check for
8876         EF_INTERWORK if this is an unknown EABI.
8877         (elf32_arm_merge_private_bfd_data): Check EABI version
8878         numbers.  Only check EF_xxx flags if the EABI version number
8879         is unknown.
8880         (elf32_arm_check_private_bfd_data): Only check EF_xxx flags
8881         if the EABI version number is unknown.
8882         (elf32_arm_print_private_bfd_data): Only decode EF_xxx flags
8883         if the EABI version number is unknown.
8884
8885 2000-04-05  J"orn Rennecke <amylaar@cygnus.co.uk>
8886
8887         * reloc.c (_bfd_relocate_contents): Add BFD_RELOC_SH_LOOP_START and
8888         BFD_RELOC_SH_LOOP_END.
8889         * elf32-sh.c (sh_elf_howto_tab): Change special_func to
8890         sh_elf_ignore_reloc for all entries that sh_elf_reloc used to ignore.
8891         Add entries for R_SH_LOOP_START and R_SH_LOOP_END.
8892         (sh_elf_reloc_loop): New function.
8893         (sh_elf_reloc): No need to test for always-to-be-ignored relocs
8894         any more.
8895         (sh_rel): Add entries for BFD_RELOC_SH_LOOP_{START,END}.
8896         (sh_elf_relocate_section): Handle BFD_RELOC_SH_LOOP_{START,END}.
8897         * bfd-in2.h, libbfd.h: Regenerate.
8898
8899 2000-04-04  Alan Modra  <alan@linuxcare.com.au>
8900
8901         * po/bfd.pot: Regenerate.
8902
8903         * Makefile.am: Remove extraneous mkdep comment.
8904         (MKDEP): Use gcc -MM rather than mkdep.
8905         (DEP): Quote when passing vars to sub-make.  Add warning
8906         message to end.
8907         (DEP1): Rewrite for "gcc -MM".
8908         (CLEANFILES): Add DEP2.
8909         Update dependencies.
8910         * Makefile.in: Regenerate.
8911
8912 2000-04-03  Kevin Buettner  <kevinb@redhat.com>
8913
8914         * configure.in: Added corefile support for AIX 4.3.  In particular,
8915         AIX_CORE_DUMPX_CORE will be defined in addition to AIX_CORE when
8916         compiling rs6000-core.c.
8917         * configure: Regenerated.
8918
8919 2000-04-03  H.J. Lu  <hjl@gnu.org>
8920
8921         * cache.c (bfd_open_file): Unlink the output file only if
8922         it has non-zero size.
8923
8924 2000-04-01  Ken Block USG  <block@zk3.dec.com>
8925
8926         * elf64-alpha.c (elf64_alpha_relocate_section): Don't emit
8927         relative relocations for non-loaded sections in shared objects.
8928         (elf64_alpha_check_relocs): Similarly.
8929
8930 2000-04-03  Hans-Peter Nilsson  <hp@axis.com>
8931
8932         * aoutx.h (NAME(aout,reloc_type_lookup)): Add BFD_RELOC_8 and
8933         BFD_RELOC_16 to switch for extended relocs.
8934         (MY_swap_ext_reloc_in): New.
8935         (MY_swap_ext_reloc_out): New.
8936         (NAME(aout,slurp_reloc_table)): Use MY_swap_ext_reloc_in rather
8937         than NAME(aout,swap_ext_reloc_in) for extended relocs.
8938         (NAME(aout,squirt_out_relocs)): Similarly use
8939         MY_swap_ext_reloc_out.
8940         (aout_link_reloc_link_order): Use MY_put_ext_reloc if defined.
8941
8942 2000-04-03  Kazu Hirata  <kazu@hxi.com>
8943
8944         * coff-h8300.c (h8300_reloc16_extra_cases): Add bsr:16 -> bsr:8 to
8945         the R_PCRWORD_B case.
8946
8947 2000-03-31  Thomas de Lellis  <tdel@wrs.com>
8948
8949         * srec.c : Set CHUNK size to 16 bytes to prevent download failures
8950         on some targets.
8951         * ihex.c : Ditto.
8952
8953 2000-03-30  Donald Lindsay  <dlindsay@cygnus.com>
8954
8955         * elf32-m32r.c (m32r_elf_generic_reloc): new function.  All
8956         HOWTO references to bfd_elf_generic_reloc, that have
8957         partial_inplace == true, now use the new function.  The function
8958         is based on the recent rewrite of m32r_elf_lo16_reloc(), and
8959         extends its fixes to the R_M32R_{16,24,32} relocs.
8960         The new logic in m32r_elf_lo16_reloc() has been removed, and
8961         it instead calls the new routine to obtain that functionality.
8962
8963 2000-03-27  Alan Modra  <alan@linuxcare.com.au>
8964
8965         * elf32-avr.c (elf32_avr_gc_mark_hook, elf32_avr_gc_sweep_hook,
8966         elf32_avr_check_relocs, avr_final_link_relocate,
8967         elf32_avr_relocate_section, bfd_elf_avr_final_write_processing,
8968         elf32_avr_object_p): Add prototypes.
8969         (elf32_avr_gc_mark_hook): Add default for h->root.type.
8970         (bfd_elf_avr_final_write_processing): Make static.
8971
8972 2000-03-27  Denis Chertykov  <denisc@overta.ru>
8973
8974         * cpu-avr.c: New file.  BFD support routines for AVR architecture.
8975         * archures.c (bfd_architecture): Add AVR architecture.
8976         (bfd_archures_list): Add reference to AVR architecture info.
8977         * elf.c (prep_headers): Handle bfd_arch_avr.
8978         * reloc.c: Add various AVR relocation enums.
8979         * targets.c (bfd_elf32_avr_vec): Declare and add to target vector
8980         list.
8981         * Makefile.am: Add support for AVR elf.
8982         * configure.in: Likewise.
8983         * config.bfd: Likewise.
8984         * Makefile.in: Regenerate.
8985         * configure: This too.
8986         * bfd-in2.h: And this.
8987         * libbfd.h: And this.
8988
8989 2000-03-24  H.J. Lu  <hjl@gnu.org>
8990
8991         * elf64-alpha.c (elf64_alpha_merge_ind_symbols): Add prototype.
8992         (elf64_alpha_find_reloc_at_ofs): Likewise.
8993
8994 2000-03-17  Alan Modra  <alan@linuxcare.com.au>
8995
8996         * reloc.c (bfd_check_overflow): In case complain_overflow_bitfield,
8997         flag an overflow if the bitfield is outside -2**n to 2**n-1.  The
8998         allowable range used to be -2**(n-1) to 2**n-1.
8999         * reloc.c (_bfd_relocate_contents): Same here.  Also replace
9000         "boolean overflow" with "bfd_reloc_status_type flag".
9001
9002 2000-03-14  Doug Evans  <dje@casey.transmeta.com>
9003
9004         * elf32-m32r.c (m32r_elf_lo16_reloc): Rewrite.
9005
9006 2000-03-14  Kazu Hirata  <kazu@hxi.com>
9007
9008         * reloc16.c (bfd_coff_reloc16_relax_section): Count the total number
9009         of shrinks properly, including the last reloc.
9010
9011 2000-03-13  Kazu Hirata  <kazu@hxi.com>
9012
9013         * coff-h8300.c (h8300_reloc16_extra_cases): Fix the sanity
9014         check for R_MOVL2.
9015
9016 2000-03-11  Alan Modra  <alan@linuxcare.com.au>
9017
9018         * ieee.c (ieee_archive_p): Return bfd_error_wrong_format on
9019         a format mismatch rather than an "error" from bfd_read such as
9020         bfd_error_file_truncated.
9021
9022 2000-03-10  Geoff Keating  <geoffk@cygnus.com>
9023
9024         * elf32-mips.c (_bfd_mips_elf_relocate_section): Do proper
9025         sign-extension and big-endian compensation for
9026         R_MIPS_64 even in ld -r.
9027
9028 2000-03-10  Geoffrey Keating  <geoffk@cygnus.com>
9029
9030         * elf32-mips.c (mips_elf_next_relocation): Rename from
9031         mips_elf_next_lo16_relocation, and generalize to look
9032         for any relocation type.
9033         (elf_mips_howto_table): Make R_MIPS_PC16 pcrel_offset.
9034         (elf_mips_gnu_rel_hi16): Howto for R_MIPS_GNU_REL_HI16.
9035         (elf_mips_gnu_rel_lo16): Howto for R_MIPS_GNU_REL_LO16.
9036         (elf_mips_gnu_rel16_s2): Howto for R_MIPS_GNU_REL16_S2.
9037         (elf_mips_gnu_pcrel64): Howto for R_MIPS_PC64.
9038         (elf_mips_gnu_pcrel32): Howto for R_MIPS_PC32.
9039         (bfd_elf32_bfd_reloc_type_lookup): Add new relocs.
9040         (mips_rtype_to_howto): Likewise.
9041         (mips_elf_calculate_relocation): Handle new relocs.
9042         (_bfd_mips_elf_relocate_section): REL_HI16/REL_LO16 relocs
9043         are paired.  The addend for R_MIPS_GNU_REL16_S2
9044         is shifted right two bits.
9045
9046 2000-03-10  Alan Modra  <alan@linuxcare.com.au>
9047
9048         * reloc.c (bfd_perform_relocation): Undo emacs formatting of
9049         comment, and ensure it doesn't happen again.
9050         (bfd_install_relocation): Same here.
9051         (_bfd_relocate_contents): Don't bother assigning unused signmask
9052         shift result.  Fix typos in comments.
9053         Remove trailing whitespace throughout file.
9054
9055 2000-03-07  Doug Evans  <dje@casey.transmeta.com>
9056
9057         * reloc.c (reloc_howto_struct): Fix partial_inplace comment.
9058         * bfd-in2.h: Rebuild.
9059
9060 2000-03-06  Nick Clifton  <nickc@cygnus.com>
9061
9062         * peicode.h (struct pe_ILF_vars): Add sym_ptr_table and
9063         sym_ptr_ptr fields.
9064         (SIZEOF_ILF_SYM_PTR_TABLE): Define.
9065         (SIZEOF_ILF_STRINGS): Redefine.
9066         (pe_ILF_make_a_symbol-reloc): New function.  Creates a symbol
9067         relative reloc, as opposed to a section relative reloc.
9068         (pe_ILF_make_a_symbol): Set the class of local symbols to C_STAT
9069         not C_LABEL.
9070         Add length of symbol's prefix to string pointer.
9071         Store a pointer to the symbol in the symbol pointer table.
9072         (pe_ILF_build_a_bfd): Do not build .idata$2 or .idata$7.
9073         Initialise the symbol pointer table.
9074         Store the hint in the Hint/Name table.
9075         Make the jump reloc be symbol realtive, not section relative.
9076         Create an import symbol for imported code.
9077
9078 2000-03-06  Catherine Moore  <clm@cygnus.com>
9079
9080         * elf.c (swap_out_syms):  Check for null type_ptr.
9081
9082 2000-03-01  Hans-Peter Nilsson  <hp@axis.com>
9083
9084         * aout-target.h (MY(write_object_contents)): Remove unused
9085         and unusable "#if CHOOSE_RELOC_SIZE".
9086         * pc532-mach.c (MY(write_object_contents)): Ditto.
9087         * netbsd.h (MY(write_object_contents)): Ditto.
9088         * hp300hpux.c (MY(write_object_contents)): Ditto.
9089         * freebsd.h (MY(write_object_contents)): Ditto.
9090         * aout-tic30.c (tic30_aout_write_object_contents): Ditto.
9091
9092 2000-02-29  H.J. Lu  <hjl@gnu.org>
9093
9094         * peicode.h (jtab): Make it static.
9095
9096         * coff-sh.c (sh_align_load_span): Declared if COFF_WITH_PE is
9097         defined and COFF_IMAGE_WITH_PE is not defined.
9098         (_bfd_sh_align_load_span): Defined as sh_align_load_span if
9099         COFF_WITH_PE is defined and COFF_IMAGE_WITH_PE is not defined.
9100
9101 2000-03-01  Nick Clifton  <nickc@cygnus.com>
9102
9103         * coff-arm.c (bfd_arm_process_before_allocation): Make
9104         'symndx' signed to prevent compile time warning.
9105
9106         * coff-mcore.c: Remove unused prototype for pe_object_p.
9107
9108         * coff-sh.c: Add "#ifndef COFF_IMAGE_WITH_PE" around static
9109         functions that are not used when COFF_IMAGE_WITH_PE is
9110         defined.
9111         (struct sh_opcode): Change type of 'flags' field to unsigned
9112         long so that it can hold the USESAS flag.
9113
9114         * coffcode.h (styp_to_sec_flags): Initialise 'target_name'.
9115
9116         * elf-m10300.c (mn10300_elf_relax_section): Initialise
9117         'sym_sec'.
9118
9119         * elf32-i370.c: Add ATTRIBUTE_UNUSED to unused function
9120         parameters.
9121         Remove unusued variables and code.
9122         (elf_backend_add_symbol_hook): Fix prototype.
9123
9124         * elf32-m68k.c (elf_m68k_gc_sweep_hook): Initialise 'sgot' and
9125         'srelgot'.
9126
9127         * elf32-mcore.c (mcore_elf_relocate_section): Initialise
9128         'oldinst'.
9129
9130         * elf32-mips.c: Add ATTRIBUTE_UNUSED to unused function
9131         parameters.
9132         Remove unusued variables and code.
9133         (elf_backend_add_symbol_hook): Fix prototype.
9134
9135         * elf32-sh.c (sh_elf_set_mach_from_flags): Use 'flags'.
9136
9137         * elflink.h (elf_bfd_link_add_symbols): Add ATTRIBUTE_UNUSED
9138         to unused function parameter.
9139
9140         * pe-mips.c: Add ATTRIBUTE_UNUSED to unused function
9141         parameters.
9142         Use EMPTY_HOWTO to initialise empty howto slots.
9143         Remove unused variables.
9144
9145         * peicode.h (pe_ILF_build_a_bfd): Initialise id6.
9146
9147 2000-03-01  H.J. Lu  <hjl@gnu.org>
9148
9149         * aoutx.h (aout_link_input_section_std): Pass "true" to
9150         the undefined_symbol callback.
9151         (aout_link_input_section_ext): Likewise.
9152         * bout.c (get_value): Likewise.
9153         * coff-a29k.c (coff_a29k_relocate_section): Likewise.
9154         * coff-alpha.c (alpha_ecoff_get_relocated_section_conten):
9155         Likewise.
9156         (alpha_relocate_section): Likewise.
9157         * coff-arm.c (coff_arm_relocate_section): Likewise.
9158         * coff-i960.c (coff_i960_relocate_section): Likewise.
9159         * coff-mcore.c (coff_mcore_relocate_section): Likewise.
9160         * coff-mips.c (mips_relocate_section): Likewise.
9161         * coff-ppc.c (coff_ppc_relocate_section): Likewise.
9162         * coff-sh.c (sh_relocate_section): Likewise.
9163         * coff-tic80.c (coff_tic80_relocate_section): Likewise.
9164         * cofflink.c (_bfd_coff_generic_relocate_section): Likewise.
9165         * elf-m10200.c (mn10200_elf_relocate_section): Likewise.
9166         * elf-m10300.c (mn10300_elf_relocate_section): Likewise.
9167         * elf32-d10v.c (elf32_d10v_relocate_section): Likewise.
9168         * elf32-fr30.c (fr30_elf_relocate_section): Likewise.
9169         * elf32-hppa.c (elf32_hppa_relocate_section): Likewise.
9170         * elf32-i370.c (i370_elf_relocate_section): Likewise.
9171         * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
9172         * elf32-mcore.c (mcore_elf_relocate_section): Likewise.
9173         * elf32-sh.c (sh_elf_relocate_section): Likewise.
9174         * elf32-v850.c (v850_elf_relocate_section): Likewise.
9175         * elflink.c (_bfd_elf_link_record_dynamic_symbol): Likewise.
9176         * elflink.h (elf_link_output_extsym): Likewise.
9177         * pe-mips.c (coff_pe_mips_relocate_section): Likewise.
9178         * reloc.c (bfd_generic_get_relocated_section_conten): Likewise.
9179         * reloc16.c (_bfd_ppc_xcoff_relocate_section): Likewise.
9180
9181         * elf-hppa.h (elf_hppa_relocate_section): Pass "false" to the
9182         undefined_symbol callback when building shared library with
9183         -Bsymbolic and undefined symbols are allowed. Otherwise, pass
9184         "true".
9185         * elf32-arm.h (elf32_arm_relocate_section): Likewise.
9186         * elf32-i386.c (elf_i386_relocate_section): Likewise.
9187         * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
9188         * elf32-mips.c (mips_elf_calculate_relocation): Likewise.
9189         (elf32_mips_get_relocated_section_content): Likewise.
9190         * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
9191         * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
9192         * elf64-alpha.c (elf64_alpha_relocate_section): Likewise.
9193         * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
9194
9195 2000-02-28  Nick Clifton  <nickc@cygnus.com>
9196
9197         * Makefile.am: Add rules to build pe[i]-{sh|mips}.lo objects.
9198         * Makefile.in: Regenerate.
9199
9200         * configure.in: Add support for mips and sh pe vectors.
9201         * configure: regenerate.
9202
9203         * config.bfd: Add support for arm-wince, mips-pe and sh-pe
9204         targets.
9205
9206         * targets.c: Add mips and sh pe vectors.
9207
9208         * libpei.h (coff_final_link_postscript): Only define if not
9209         already defined.
9210
9211         * coffcode.h: Add support for WinCE magic numbers.
9212
9213         * peigen.c (pe_print_reloc): Update comment and rearrange
9214         appending of newline character.
9215
9216         * peicode.h: Add support for Image Library Format.
9217         (pe_ILF_vars): Structure containing data used by ILF code.
9218         (pe_ILF_make_a_section): New function.  Create a section based
9219         on ILF data.
9220         (pe_ILF_make_a_reloc): New function.  Create a reloc based on
9221         ILF data.
9222         (pe_ILF_make_a_symbol): New function.  Create a symbol based
9223         on ILF data.
9224         (pe_ILF_save_relocs): New function.  Store the relocs created
9225         by pe_ILF_make_a_reloc in a section.
9226         (pe_ILF_build_a_bfd): New function.  Create a BFD describing
9227         an ILF object.
9228         (pe_ILF_object_p): New function.  Return a bfd_target pointer
9229         for an ILF object.
9230         (pe_bfd_object_p): If an ILF object is detected call
9231         pe_ILF_object_p on it.
9232
9233         * coff-arm.c: Add support for WinCE relocs which are different
9234         from normal ARM COFF relocs.
9235         * pe-arm.c: Unset TARGET_UNDERSCORE for a WinCE target.
9236
9237         * coff-sh.c: Add support for sh-pe target.
9238         * pe-sh.c: New file.  Support code for sh-pe target.
9239         * pei-sh.c: New file.  Support code for sh-pe target.
9240
9241         * pe-mips.c: New file.  Support code for mips-pe target.
9242         * pei-mips.c: New file.  Support code for mips-pe target.
9243
9244 2000-02-27  Jakub Jelinek  <jakub@redhat.com>
9245
9246         * elf32-sparc.c (elf32_sparc_merge_private_bfd_data): Don't bump
9247         architecture if the object causing the bump is dynamic.
9248         * elf64-sparc.c (sparc64_elf_merge_private_bfd_data): Likewise,
9249         and also don't it for memory ordering.
9250         (sparc64_elf_write_relocs): Take src_rela out of the loop.
9251
9252 2000-02-27  Ian Lance Taylor  <ian@zembu.com>
9253
9254         * dwarf2.c (read_abbrevs): Use _raw_size directly rather than
9255         calling bfd_get_section_size_before_reloc.
9256         (decode_line_info): Likewise.
9257         (_bfd_dwarf2_find_nearest_line): Likewise.
9258
9259 2000-02-27  Eli Zaretskii  <eliz@is.elta.co.il>
9260
9261         * Makefile.am (stamp-lib): Use $(LIBTOOL) --config to get the
9262         name of the libtool directory.
9263         * Makefile.in: Rebuild.
9264
9265 2000-02-25  Rodney Brown (RodneyBrown@pmsc.com)
9266
9267         * som.c (SOM_HOWTO): Define.
9268         (som_hppa_howto_table): Use it.
9269
9270 2000-02-25  Alexandre Oliva  <oliva@lsd.ic.unicamp.br>
9271
9272         * config.bfd: Enable 64 bit support for GNU/Linux/sparc.
9273
9274         * config.bfd: Enable 64 bit support for Solaris7+/sparc.
9275
9276 2000-02-24  Catherine Moore  <clm@cygnus.com>
9277
9278         * som.c (som_misc_symbol_info):  Add field
9279         secondary_def.
9280         (som_bfd_derive_misc_symbol_info):  Initialize
9281         secondary_def.
9282         (som_build_and_write_symbol_table): Keep track
9283         of secondary_def field.
9284         (som_slurp_symbol_table): Set BSF_WEAK symbol flag
9285         if secondary_def field is set.
9286         (som_bfd_ar_write_symbol_stuff): Initialize
9287         secondary_def.
9288
9289 2000-02-23  Stephane Carrez  <stcarrez@worldnet.fr>
9290
9291         * dwarf2.c (read_address): Read 16-bits addresses.
9292         (parse_comp_unit): Accept addr_size == 2.
9293
9294 2000-02-23  Alan Modra  <alan@spri.levels.unisa.edu.au>
9295
9296         * bfd-in.h: Update copyright date.
9297
9298 2000-02-23  Linas Vepstas <linas@linas.org>
9299
9300         * cpu-i370.c: New file.
9301         * elf32-i370.c:  New file.
9302         * archures.c (enum bfd_architecture): Add bfd_arch_i370.
9303         (bfd_i370_arch): New.
9304         (bfd_archures_list): Add bfd_i370_arch.
9305         * elf.c (prep_headers): Add bfd_arch_i370.
9306         * Makefile.am: Add support for IBM 370 elf.
9307         * config.bfd: Likewise.
9308         * configure.in: Likewise.
9309         * libbfd.h (bfd_reloc_code_real_names): Likewise.
9310         * reloc.c (bfd_reloc_code_type): Likewise.
9311         * targets.c: Likewise.
9312
9313         * Makefile.in: Regenerate.
9314         * configure: Regenerate.
9315         * bfd-in2.h: Regenerate.
9316
9317 2000-02-22  Ian Lance Taylor  <ian@zembu.com>
9318
9319         * elf32-i386.c (elf_i386_info_to_howto_rel): Give a warning for
9320         invalid relocation types, and change them to R_386_NONE.
9321
9322 2000-02-22  H.J. Lu  <hjl@gnu.org>
9323
9324         * elflink.h (elf_link_add_object_symbols): If a version symbol is
9325         not defined, don't add a second ELF_VER_CHR.
9326
9327         * elflink.h (elf_bfd_final_link): Call output_extsym for global
9328         symbols converted to local symbols even when stripping all
9329         symbols.
9330         (elf_link_output_extsym): Process global symbols converted to
9331         local symbols even if they are being stripped.
9332
9333 2000-02-21  Alan Modra  <alan@spri.levels.unisa.edu.au>
9334
9335         * archures.c (bfd_octets_per_byte): Return unsigned int.
9336         (bfd_arch_mach_octets_per_byte): Ditto.
9337         * libbfd.c (bfd_read, bfd_seek): Quell signed vs. unsigned
9338         comparison warning.
9339         * section.c (bfd_get_section_size_before_reloc): Quell signed
9340         vs. unsigned comparison warning.
9341         (bfd_get_section_size_after_reloc): Same here.  Fix parentheses too.
9342         * trad-core.c (trad_unix_core_file_p): Correct 2000-01-27
9343         change.  What was I thinking?
9344         * bfd-in2.h: Regenerate.
9345
9346         * elflink.h (elf_gc_sweep): Skip non-elf input bfds.
9347         (elf_gc_sections): Same here.
9348         (elf_gc_common_finalize_got_offsets): And here.
9349
9350 2000-02-21  Ian Lance Taylor  <ian@zembu.com>
9351
9352         ELF HPPA doesn't work at present; remove it until it does.
9353         * config.bfd: Comment out setting targ_defvec to
9354         bfd_elf32_hppa_vec.
9355         * Makefile.am: Rebuild dependencies.
9356         (BFD32_BACKENDS): Remove elf32-hppa.lo.
9357         (BFD32_BACKENDS_CFILES): Remove elf32-hppa.c.
9358         (SOURCE_HFILES): Remove elf32-hppa.h and hppa_stubs.h.
9359         * Makefile.in: Rebuild.
9360         * targets.c (bfd_target_vector): Comment out bfd_elf32_hppa_vec.
9361
9362 2000-02-18  Geoff Keating  <geoffk@cygnus.com>
9363
9364         * coffcode.h (coff_set_arch_mach_hook): Use free(), because there
9365         is no bfd_free().  Revert bfd_free part of previous change.
9366
9367 2000-02-18  Geoff Keating  <geoffk@cygnus.com>
9368
9369         * coffcode.h (coff_set_arch_mach_hook): Don't use variable-size
9370         arrays.
9371         (coff_compute_section_file_positions): Use bfd_free to pair
9372         bfd_malloc.
9373         (coff_write_object_contents): Likewise.
9374
9375         * coff-rs6000.c (xcoff_howto_table_16): New variable.
9376         (xcoff_rtype2howto): Handle 16-bit variants of 32-bit relocs.
9377
9378 2000-02-18  Ulrich Drepper  <drepper@cygnus.com>
9379
9380         * coff-rs6000.c (XCOFFARMAGBIG): New macro.
9381         (xcoff_ar_file_hdr_big): New structure.
9382         (SIZEOF_AR_FILE_HDR_BIG): New macro.
9383         (xcoff_ar_hdr_big): New structure.
9384         (SIZEOF_AR_HDR_BIG): New macro.
9385         (xcoff_big_format_p): New macro.
9386         (xcoff_ardata_big): New macro.
9387         (arch_xhdr_big): New macro.
9388         (xcoff_slurp_armap): Handle large archives.
9389         (xcoff_archive_p): Detect large archives.
9390         (xcoff_read_ar_hdr): Handle large archives.
9391         (xcoff_openr_next_archived_file): Handle large archives.
9392         (xcoff_generic_stat_arch_elt): Handle large archives.
9393         (xcoff_write_armap_old): Rename from xcoff_write_armap.
9394         (xcoff_write_armap_big): New function.
9395         (xcoff_write_armap): New function, dispatch to _old or _big.
9396         (xcoff_write_archive_contents_old): Rename from
9397         xcoff_write_archive_contents.
9398         (xcoff_write_archive_contents_big): New function.
9399         (xcoff_write_archive_contents): New function, dispatch to _old or
9400         _big.
9401
9402 2000-02-18  Richard Henderson  <rth@cygnus.com>
9403
9404         * elf-bfd.h (struct elf_link_hash_table): Remove copy_indirect
9405         and hide_symbol members.
9406         (elf_link_hash_copy_indirect): Remove.
9407         (elf_link_hash_hide_symbol): Remove.
9408         (struct elf_backend_data): Add elf_backend_copy_indirect_symbol
9409         and elf_backend_hide_symbol.
9410         (_bfd_elf_link_hash_copy_indirect): Declare.
9411         (_bfd_elf_link_hash_hide_symbol): Declare.
9412         * elf.c (_bfd_elf_link_hash_copy_indirect): Remove table argument.
9413         (_bfd_elf_link_hash_hide_symbol): Likewise.
9414         (_bfd_elf_link_hash_table_init): Don't init killed members.
9415         * elflink.h (elf_link_add_object_symbols): Use the bed function
9416         pointers not elf_link_hash_{copy_indirect,hide_symbol}.
9417         (elf_link_assign_sym_version): Likewise.
9418         * elfxx-target.h (elf_backend_copy_indirect_symbol): Default.
9419         (elf_backend_hide_symbol): Likewise.
9420         (elfNN_bed): Update for new members.
9421
9422 2000-02-17  Kevin Buettner  <kevinb@redhat.com>
9423
9424         * rs6000-core.c (CORE_DATA_SIZE_FIELD, CORE_COMM_FIELD, SAVE_FIELD,
9425         STACK_END_ADDR): Define for new core file format.
9426         (LOADER_OFFSET_FIELD, LOADER_REGION_SIZE, CORE_DUMP): New defines
9427         for handling the vagaries of the various core file structures used
9428         by AIX over the years.
9429         (rs6000coff_core_p, rs6000coff_core_file_matches_executable,
9430         Rs6kCorData): Use above defines to adapt code to use AIX 4.3's
9431         core_dumpx structure.
9432
9433 2000-02-17  J"orn Rennecke <amylaar@cygnus.co.uk>
9434
9435         * archures.c (bfd_mach_sh2, bfd_mach_sh_dsp): New macros.
9436         (bfd_mach_sh3_dsp): Likewise.
9437         (bfd_mach_sh4): Reinstate.
9438         (bfd_default_scan): Recognize 7410, 7708, 7729 and 7750.
9439         * bfd-in2.h: Regenerate.
9440         * coff-sh.c (struct sh_opcode): flags is no longer short.
9441         (USESAS, USESAS_REG, USESR8, SETSAS, SETSAS_REG): New macros.
9442         (sh_opcode41, sh_opcode42): Integrate as sh_opcode41.
9443         (sh_opcode01, sh_opcode02, sh_opcode40): Add sh-dsp opcodes.
9444         (sh_opcode41, sh_opcode4, sh_opcode80): Likewise.
9445         (sh_opcodes): No longer const.
9446         (sh_dsp_opcodef0, sh_dsp_opcodef): New arrays.
9447         (sh_insn_uses_reg): Check for USESAS and USESR8.
9448         (sh_insn_sets_reg, sh_insns_conflict): Check for SETSAS.
9449         (_bfd_sh_align_load_span): Return early for SH4.
9450         Modify sh_opcodes lookup table for sh-dsp / sh3-dsp.
9451         Take into account that field b of a parallel processing insn
9452         could be mistaken for a separate insn.
9453         * cpu-sh.c (arch_info_struct): New array elements for
9454         sh2, sh-dsp and sh3-dsp.
9455         Reinstate element for sh4.
9456         (SH2_NEXT, SH_DSP_NEXT, SH3_DSP_NEXT): New macros.
9457         (SH4_NEXT): Reinstate.
9458         (SH3_NEXT, SH3E_NEXT): Adjust.
9459         * elf-bfd.h (_sh_elf_set_mach_from_flags): Declare.
9460         * elf32-sh.c (sh_elf_set_private_flags): New function.
9461         (sh_elf_copy_private_data, sh_elf_set_mach_from_flags): Likewise.
9462         (sh_elf_merge_private_data): New function.
9463         (elf_backend_object_p, bfd_elf32_bfd_set_private_bfd_flags): Define.
9464         (bfd_elf32_bfd_copy_private_bfd_data): Define.
9465         (bfd_elf32_bfd_merge_private_bfd_data): Change to
9466         sh_elf_merge_private_data.
9467
9468 2000-02-13  Richard Henderson  <rth@cygnus.com>
9469
9470         * elf-bfd.h (struct elf_link_hash_table): Add copy_indirect and
9471         hide_symbol members.
9472         (elf_link_hash_copy_indirect): New.
9473         (elf_link_hash_hide_symbol): New.
9474         * elflink.h (elf_link_add_object_symbols): Break out copy from
9475         indirect new new symbol to elf.c.
9476         (elf_link_assign_sym_version): Break out privatization of
9477         non-exported symbol to elf.c.
9478         * elf.c (_bfd_elf_link_hash_copy_indirect): New.
9479         (_bfd_elf_link_hash_hide_symbol): New.
9480         (_bfd_elf_link_hash_table_init): Init copy_indirect and hide_symbol.
9481
9482 2000-02-13  Ian Lance Taylor  <ian@zembu.com>
9483
9484         * section.c (_bfd_strip_section_from_output): Add info parameter.
9485         If it passed as non-NULL, use it to check whether any input BFD
9486         has an input section which uses this output section.  Change all
9487         callers.
9488         * bfd-in2.h: Rebuild.
9489
9490         * bfd-in.h: Move declarations of bfd_get_elf_phdr_upper_bound and
9491         bfd_get_elf_phdrs in from bfd-in2.h, correcting patch of
9492         1999-11-29.
9493         * bfd-in2.h: Rebuild.
9494
9495 2000-02-10  Timothy Wall  <twall@cygnus.com>
9496
9497         * coffswap.h (coff_swap_sym_in): Add hook SWAP_SYM_IN_POST to
9498         allow final modifications of swapped-in symbol.
9499         (coff_swap_sym_out): Ditto with SWAP_SYM_OUT_POST.
9500         * coffcode.h (coff_write_relocs): Use macro
9501         SECTION_RELATIVE_ABSOLUTE_SYMBOL_P if defined to determine whether
9502         symbol index should be set to -1.
9503
9504 2000-02-10  Toshiyasu Morita (toshi.morita@sega.com)
9505
9506         * coff-sh.c (USES1_REG, USES2_REG, SETS1_REG, SETS2_REG,
9507         USESF1_REG, USESF2_REG, SETSF1_REG, SETSF2_REG): New macros.
9508         * (sh_insn_sets_reg, sh_insn_sets_freg): New prototypes.
9509         * (sh_insn_sets_reg, sh_insn_uses_or_sets_reg, sh_insns_sets_freg,
9510         sh_insns_uses_or_sets_freg): New functions.
9511         * (sh_insn_uses_reg, sh_insn_uses_freg): Use new macros.
9512         * (sh_insns_conflict): Use new functions and new macros to
9513         detect conflicts when two instructions both set same integer registers,
9514         both set same fp register, and both set special register.
9515
9516 2000-02-09  Timothy Wall  <twall@cygnus.com>
9517
9518         * coffgen.c (coff_real_object_p): Set arch/mach info prior to
9519         swapping in sections, so that the swapping routines have access to
9520         the arch/mach info.
9521
9522 2000-02-08 Mark Elbrecht <snowball3@bigfoot.com>
9523
9524         * coff-go32.c: Update comment. Update copyright.
9525
9526 2000-01-27  Thomas de Lellis  <tdel@windriver.com>
9527
9528         * syms.c (bfd_decode_symclass)
9529         Two new class characters were added - 'V' and 'v'.  The
9530         meaning of 'W' is now restricted to just weak non-object
9531         symbols.  This allows differentiation between, for example,
9532         weak functions vs weak objects.  nm for example now dumps:
9533         'W' = weak global
9534         'w' = weak unresolved
9535         'V' = weak global object
9536         'v' = weak unresolved object
9537
9538         (bfd_is_undefined_symclass): New function.  Return true if the
9539         given symbol class represents and undefined/unresolved symbol.
9540
9541         (bfd_symbol_info): Use bfd_is_undefined_symclass to check for
9542         unresolved symbols.
9543
9544         * bfd-in2.h: Add prototype for bfd_is_undefined_symbol().
9545
9546         * elf32-arm.h (elf32_arm_get_symbol_type): If a symbol has the
9547         STT_ARM_16BIT flag set, but it is not attached to a data object
9548         return STT_ARM_16BIT so that it will be treated as code by the
9549         disassembler.
9550
9551 2000-01-27  Alan Modra  <alan@spri.levels.unisa.edu.au>
9552
9553         * coff-i386.c (i3coff_object_p): Remove prototype.
9554         Update copyright.
9555
9556         * elflink.c (_bfd_elf_link_record_dynamic_symbol): Add const
9557         to name.  Update copyright.
9558
9559         * trad-core.c (trad_unix_core_file_p): Cast core_regsec
9560         assignment to avoid warning.  Update copyright.
9561
9562 2000-01-24  Robert Lipe  (robertl@sco.com)
9563
9564         * coffcode.h (coff_write_object_contents): Get buff via bfd_malloc
9565         instead of using GNU C extension.
9566
9567 2000-01-21  Nick Clifton  <nickc@cygnus.com>
9568
9569         * libbfd.c (bfd_read): Do not attempt to get a negativly sized
9570         amount from a bfd_in_memory structure.
9571         (bfd_seek): Do not allow seeks past the end of a bfd_in_memory
9572         structure.
9573
9574 2000-01-14  Nick Clifton  <nickc@cygnus.com>
9575
9576         * linker.c (default_indirect_link_order): oops - fix incorrectly
9577         applied patch from Tim Wall.
9578
9579 2000-01-13  Timothy Wall (twall@tiac.net>
9580
9581         * coffcode.h: Use bfd_coff_xxx instead of the macro XXX (where xxx
9582         = scnhsz, filhsz, relsz, aoutsz, etc)
9583
9584         * coffswap.h: Ditto.
9585
9586 2000-01-13  Nick Clifton  <nickc@cygnus.com>
9587
9588         * elf32-arm.h (elf32_thumb_to_arm_stub): Fix offset in branch to
9589         interwork thumb to arm stub.
9590
9591 2000-01-13  Timothy Wall (twall@tiac.net>
9592
9593         * archures.c (bfd_octets_per_byte): New function: Return
9594         target byte size.
9595         (bfd_arch_mach_octets_per_byte): New function: Return target
9596         byte size.
9597
9598         * section.c: Distinguish between octets and bytes for usage of
9599         _cooked_size,  _raw_size, and output_offset.  Clarify
9600         description of bfd_set_section_contents.
9601
9602         * bfd-in2.h: Regenerate.
9603
9604         * coffgen.c: Indicate that the offset parameter is in bytes, not
9605         octets.
9606
9607         * cofflink.c (bfd_coff_link_input_bfd): Use bfd_octets_per_byte
9608         where appropriate to get the octet offset when calling
9609         bfd_set_section_contents.
9610         (bfd_coff_reloc_link_order): Ditto.
9611
9612         * linker.c (bfd_generic_reloc_link_order): Ditto.
9613         (_bfd_default_link_order): Ditto.
9614
9615         * reloc.c (bfd_perform_relocation):  Distinguish between octets
9616         and bytes.  Use octets when indexing into octet data; use bytes
9617         when calculating target addresses.
9618         (bfd_install_relocation): Ditto.
9619
9620         * srec.c (srec_write_section): Ditto.
9621
9622 2000-01-13  Nick Clifton  <nickc@cygnus.com>
9623
9624         * coff-mcore.c (COFF_DEFAULT_SECTION_ALIGNMENT_POWER): Change from
9625         3 to 2.  This allows 4 byte sized sections, which is necessary for
9626         dlltool to build functioning DLLs.
9627
9628 2000-01-10  Philip Blundell  <pb@futuretv.com>
9629
9630         * config.bfd (arm*-*-linux-gnu*): Match instead of arm*-*-linux-gnu.
9631         (arm*-*-conix*): New target.
9632
9633 2000-01-10  Egor Duda  <deo@logos-m.ru>
9634
9635         * config.bfd: Include elf32_i386 vector to target list for cygwin
9636         and mingw.
9637
9638         * config.in: Undefine HAVE_WIN32_PSTATUS_T.
9639         * configure.in: Test for structure win32_pstatus_t in
9640         <sys/procfs.h>
9641         * configure: Regenerate.
9642
9643         * elf.c (elfcore_grok_win32pstatus): New function: process
9644         win32_pstatus_t notes in elf core file.
9645         (elfcore_grok_note): Detect win32_pstatus notes.
9646
9647 2000-01-03  Martin v. Loewis  <loewis@informatik.hu-berlin.de>
9648
9649         * elflink.c (_bfd_elf_link_record_dynamic_symbol): Process symbol
9650         visibility.
9651         * elflink.h (elf_link_add_object_symbols): Combine visibilities.
9652         * elf.c (bfd_elf_print_symbol): Interpret st_other as visibility.
9653
9654 For older changes see ChangeLog-9899
9655 \f
9656 Local Variables:
9657 mode: change-log
9658 left-margin: 8
9659 fill-column: 74
9660 version-control: never
9661 End: